Bez popisu

pdfmake.js 2.4MB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156291572915829159291602916129162291632916429165291662916729168291692917029171291722917329174291752917629177291782917929180291812918229183291842918529186291872918829189291902919129192291932919429195291962919729198291992920029201292022920329204292052920629207292082920929210292112921229213292142921529216292172921829219292202922129222292232922429225292262922729228292292923029231292322923329234292352923629237292382923929240292412924229243292442924529246292472924829249292502925129252292532925429255292562925729258292592926029261292622926329264292652926629267292682926929270292712927229273292742927529276292772927829279292802928129282292832928429285292862928729288292892929029291292922929329294292952929629297292982929929300293012930229303293042930529306293072930829309293102931129312293132931429315293162931729318293192932029321293222932329324293252932629327293282932929330293312933229333293342933529336293372933829339293402934129342293432934429345293462934729348293492935029351293522935329354293552935629357293582935929360293612936229363293642936529366293672936829369293702937129372293732937429375293762937729378293792938029381293822938329384293852938629387293882938929390293912939229393293942939529396293972939829399294002940129402294032940429405294062940729408294092941029411294122941329414294152941629417294182941929420294212942229423294242942529426294272942829429294302943129432294332943429435294362943729438294392944029441294422944329444294452944629447294482944929450294512945229453294542945529456294572945829459294602946129462294632946429465294662946729468294692947029471294722947329474294752947629477294782947929480294812948229483294842948529486294872948829489294902949129492294932949429495294962949729498294992950029501295022950329504295052950629507295082950929510295112951229513295142951529516295172951829519295202952129522295232952429525295262952729528295292953029531295322953329534295352953629537295382953929540295412954229543295442954529546295472954829549295502955129552295532955429555295562955729558295592956029561295622956329564295652956629567295682956929570295712957229573295742957529576295772957829579295802958129582295832958429585295862958729588295892959029591295922959329594295952959629597295982959929600296012960229603296042960529606296072960829609296102961129612296132961429615296162961729618296192962029621296222962329624296252962629627296282962929630296312963229633296342963529636296372963829639296402964129642296432964429645296462964729648296492965029651296522965329654296552965629657296582965929660296612966229663296642966529666296672966829669296702967129672296732967429675296762967729678296792968029681296822968329684296852968629687296882968929690296912969229693296942969529696296972969829699297002970129702297032970429705297062970729708297092971029711297122971329714297152971629717297182971929720297212972229723297242972529726297272972829729297302973129732297332973429735297362973729738297392974029741297422974329744297452974629747297482974929750297512975229753297542975529756297572975829759297602976129762297632976429765297662976729768297692977029771297722977329774297752977629777297782977929780297812978229783297842978529786297872978829789297902979129792297932979429795297962979729798297992980029801298022980329804298052980629807298082980929810298112981229813298142981529816298172981829819298202982129822298232982429825298262982729828298292983029831298322983329834298352983629837298382983929840298412984229843298442984529846298472984829849298502985129852298532985429855298562985729858298592986029861298622986329864298652986629867298682986929870298712987229873298742987529876298772987829879298802988129882298832988429885298862988729888298892989029891298922989329894298952989629897298982989929900299012990229903299042990529906299072990829909299102991129912299132991429915299162991729918299192992029921299222992329924299252992629927299282992929930299312993229933299342993529936299372993829939299402994129942299432994429945299462994729948299492995029951299522995329954299552995629957299582995929960299612996229963299642996529966299672996829969299702997129972299732997429975299762997729978299792998029981299822998329984299852998629987299882998929990299912999229993299942999529996299972999829999300003000130002300033000430005300063000730008300093001030011300123001330014300153001630017300183001930020300213002230023300243002530026300273002830029300303003130032300333003430035300363003730038300393004030041300423004330044300453004630047300483004930050300513005230053300543005530056300573005830059300603006130062300633006430065300663006730068300693007030071300723007330074300753007630077300783007930080300813008230083300843008530086300873008830089300903009130092300933009430095300963009730098300993010030101301023010330104301053010630107301083010930110301113011230113301143011530116301173011830119301203012130122301233012430125301263012730128301293013030131301323013330134301353013630137301383013930140301413014230143301443014530146301473014830149301503015130152301533015430155301563015730158301593016030161301623016330164301653016630167301683016930170301713017230173301743017530176301773017830179301803018130182301833018430185301863018730188301893019030191301923019330194301953019630197301983019930200302013020230203302043020530206302073020830209302103021130212302133021430215302163021730218302193022030221302223022330224302253022630227302283022930230302313023230233302343023530236302373023830239302403024130242302433024430245302463024730248302493025030251302523025330254302553025630257302583025930260302613026230263302643026530266302673026830269302703027130272302733027430275302763027730278302793028030281302823028330284302853028630287302883028930290302913029230293302943029530296302973029830299303003030130302303033030430305303063030730308303093031030311303123031330314303153031630317303183031930320303213032230323303243032530326303273032830329303303033130332303333033430335303363033730338303393034030341303423034330344303453034630347303483034930350303513035230353303543035530356303573035830359303603036130362303633036430365303663036730368303693037030371303723037330374303753037630377303783037930380303813038230383303843038530386303873038830389303903039130392303933039430395303963039730398303993040030401304023040330404304053040630407304083040930410304113041230413304143041530416304173041830419304203042130422304233042430425304263042730428304293043030431304323043330434304353043630437304383043930440304413044230443304443044530446304473044830449304503045130452304533045430455304563045730458304593046030461304623046330464304653046630467304683046930470304713047230473304743047530476304773047830479304803048130482304833048430485304863048730488304893049030491304923049330494304953049630497304983049930500305013050230503305043050530506305073050830509305103051130512305133051430515305163051730518305193052030521305223052330524305253052630527305283052930530305313053230533305343053530536305373053830539305403054130542305433054430545305463054730548305493055030551305523055330554305553055630557305583055930560305613056230563305643056530566305673056830569305703057130572305733057430575305763057730578305793058030581305823058330584305853058630587305883058930590305913059230593305943059530596305973059830599306003060130602306033060430605306063060730608306093061030611306123061330614306153061630617306183061930620306213062230623306243062530626306273062830629306303063130632306333063430635306363063730638306393064030641306423064330644306453064630647306483064930650306513065230653306543065530656306573065830659306603066130662306633066430665306663066730668306693067030671306723067330674306753067630677306783067930680306813068230683306843068530686306873068830689306903069130692306933069430695306963069730698306993070030701307023070330704307053070630707307083070930710307113071230713307143071530716307173071830719307203072130722307233072430725307263072730728307293073030731307323073330734307353073630737307383073930740307413074230743307443074530746307473074830749307503075130752307533075430755307563075730758307593076030761307623076330764307653076630767307683076930770307713077230773307743077530776307773077830779307803078130782307833078430785307863078730788307893079030791307923079330794307953079630797307983079930800308013080230803308043080530806308073080830809308103081130812308133081430815308163081730818308193082030821308223082330824308253082630827308283082930830308313083230833308343083530836308373083830839308403084130842308433084430845308463084730848308493085030851308523085330854308553085630857308583085930860308613086230863308643086530866308673086830869308703087130872308733087430875308763087730878308793088030881308823088330884308853088630887308883088930890308913089230893308943089530896308973089830899309003090130902309033090430905309063090730908309093091030911309123091330914309153091630917309183091930920309213092230923309243092530926309273092830929309303093130932309333093430935309363093730938309393094030941309423094330944309453094630947309483094930950309513095230953309543095530956309573095830959309603096130962309633096430965309663096730968309693097030971309723097330974309753097630977309783097930980309813098230983309843098530986309873098830989309903099130992309933099430995309963099730998309993100031001310023100331004310053100631007310083100931010310113101231013310143101531016310173101831019310203102131022310233102431025310263102731028310293103031031310323103331034310353103631037310383103931040310413104231043310443104531046310473104831049310503105131052310533105431055310563105731058310593106031061310623106331064310653106631067310683106931070310713107231073310743107531076310773107831079310803108131082310833108431085310863108731088310893109031091310923109331094310953109631097310983109931100311013110231103311043110531106311073110831109311103111131112311133111431115311163111731118311193112031121311223112331124311253112631127311283112931130311313113231133311343113531136311373113831139311403114131142311433114431145311463114731148311493115031151311523115331154311553115631157311583115931160311613116231163311643116531166311673116831169311703117131172311733117431175311763117731178311793118031181311823118331184311853118631187311883118931190311913119231193311943119531196311973119831199312003120131202312033120431205312063120731208312093121031211312123121331214312153121631217312183121931220312213122231223312243122531226312273122831229312303123131232312333123431235312363123731238312393124031241312423124331244312453124631247312483124931250312513125231253312543125531256312573125831259312603126131262312633126431265312663126731268312693127031271312723127331274312753127631277312783127931280312813128231283312843128531286312873128831289312903129131292312933129431295312963129731298312993130031301313023130331304313053130631307313083130931310313113131231313313143131531316313173131831319313203132131322313233132431325313263132731328313293133031331313323133331334313353133631337313383133931340313413134231343313443134531346313473134831349313503135131352313533135431355313563135731358313593136031361313623136331364313653136631367313683136931370313713137231373313743137531376313773137831379313803138131382313833138431385313863138731388313893139031391313923139331394313953139631397313983139931400314013140231403314043140531406314073140831409314103141131412314133141431415314163141731418314193142031421314223142331424314253142631427314283142931430314313143231433314343143531436314373143831439314403144131442314433144431445314463144731448314493145031451314523145331454314553145631457314583145931460314613146231463314643146531466314673146831469314703147131472314733147431475314763147731478314793148031481314823148331484314853148631487314883148931490314913149231493314943149531496314973149831499315003150131502315033150431505315063150731508315093151031511315123151331514315153151631517315183151931520315213152231523315243152531526315273152831529315303153131532315333153431535315363153731538315393154031541315423154331544315453154631547315483154931550315513155231553315543155531556315573155831559315603156131562315633156431565315663156731568315693157031571315723157331574315753157631577315783157931580315813158231583315843158531586315873158831589315903159131592315933159431595315963159731598315993160031601316023160331604316053160631607316083160931610316113161231613316143161531616316173161831619316203162131622316233162431625316263162731628316293163031631316323163331634316353163631637316383163931640316413164231643316443164531646316473164831649316503165131652316533165431655316563165731658316593166031661316623166331664316653166631667316683166931670316713167231673316743167531676316773167831679316803168131682316833168431685316863168731688316893169031691316923169331694316953169631697316983169931700317013170231703317043170531706317073170831709317103171131712317133171431715317163171731718317193172031721317223172331724317253172631727317283172931730317313173231733317343173531736317373173831739317403174131742317433174431745317463174731748317493175031751317523175331754317553175631757317583175931760317613176231763317643176531766317673176831769317703177131772317733177431775317763177731778317793178031781317823178331784317853178631787317883178931790317913179231793317943179531796317973179831799318003180131802318033180431805318063180731808318093181031811318123181331814318153181631817318183181931820318213182231823318243182531826318273182831829318303183131832318333183431835318363183731838318393184031841318423184331844318453184631847318483184931850318513185231853318543185531856318573185831859318603186131862318633186431865318663186731868318693187031871318723187331874318753187631877318783187931880318813188231883318843188531886318873188831889318903189131892318933189431895318963189731898318993190031901319023190331904319053190631907319083190931910319113191231913319143191531916319173191831919319203192131922319233192431925319263192731928319293193031931319323193331934319353193631937319383193931940319413194231943319443194531946319473194831949319503195131952319533195431955319563195731958319593196031961319623196331964319653196631967319683196931970319713197231973319743197531976319773197831979319803198131982319833198431985319863198731988319893199031991319923199331994319953199631997319983199932000320013200232003320043200532006320073200832009320103201132012320133201432015320163201732018320193202032021320223202332024320253202632027320283202932030320313203232033320343203532036320373203832039320403204132042320433204432045320463204732048320493205032051320523205332054320553205632057320583205932060320613206232063320643206532066320673206832069320703207132072320733207432075320763207732078320793208032081320823208332084320853208632087320883208932090320913209232093320943209532096320973209832099321003210132102321033210432105321063210732108321093211032111321123211332114321153211632117321183211932120321213212232123321243212532126321273212832129321303213132132321333213432135321363213732138321393214032141321423214332144321453214632147321483214932150321513215232153321543215532156321573215832159321603216132162321633216432165321663216732168321693217032171321723217332174321753217632177321783217932180321813218232183321843218532186321873218832189321903219132192321933219432195321963219732198321993220032201322023220332204322053220632207322083220932210322113221232213322143221532216322173221832219322203222132222322233222432225322263222732228322293223032231322323223332234322353223632237322383223932240322413224232243322443224532246322473224832249322503225132252322533225432255322563225732258322593226032261322623226332264322653226632267322683226932270322713227232273322743227532276322773227832279322803228132282322833228432285322863228732288322893229032291322923229332294322953229632297322983229932300323013230232303323043230532306323073230832309323103231132312323133231432315323163231732318323193232032321323223232332324323253232632327323283232932330323313233232333323343233532336323373233832339323403234132342323433234432345323463234732348323493235032351323523235332354323553235632357323583235932360323613236232363323643236532366323673236832369323703237132372323733237432375323763237732378323793238032381323823238332384323853238632387323883238932390323913239232393323943239532396323973239832399324003240132402324033240432405324063240732408324093241032411324123241332414324153241632417324183241932420324213242232423324243242532426324273242832429324303243132432324333243432435324363243732438324393244032441324423244332444324453244632447324483244932450324513245232453324543245532456324573245832459324603246132462324633246432465324663246732468324693247032471324723247332474324753247632477324783247932480324813248232483324843248532486324873248832489324903249132492324933249432495324963249732498324993250032501325023250332504325053250632507325083250932510325113251232513325143251532516325173251832519325203252132522325233252432525325263252732528325293253032531325323253332534325353253632537325383253932540325413254232543325443254532546325473254832549325503255132552325533255432555325563255732558325593256032561325623256332564325653256632567325683256932570325713257232573325743257532576325773257832579325803258132582325833258432585325863258732588325893259032591325923259332594325953259632597325983259932600326013260232603326043260532606326073260832609326103261132612326133261432615326163261732618326193262032621326223262332624326253262632627326283262932630326313263232633326343263532636326373263832639326403264132642326433264432645326463264732648326493265032651326523265332654326553265632657326583265932660326613266232663326643266532666326673266832669326703267132672326733267432675326763267732678326793268032681326823268332684326853268632687326883268932690326913269232693326943269532696326973269832699327003270132702327033270432705327063270732708327093271032711327123271332714327153271632717327183271932720327213272232723327243272532726327273272832729327303273132732327333273432735327363273732738327393274032741327423274332744327453274632747327483274932750327513275232753327543275532756327573275832759327603276132762327633276432765327663276732768327693277032771327723277332774327753277632777327783277932780327813278232783327843278532786327873278832789327903279132792327933279432795327963279732798327993280032801328023280332804328053280632807328083280932810328113281232813328143281532816328173281832819328203282132822328233282432825328263282732828328293283032831328323283332834328353283632837328383283932840328413284232843328443284532846328473284832849328503285132852328533285432855328563285732858328593286032861328623286332864328653286632867328683286932870328713287232873328743287532876328773287832879328803288132882328833288432885328863288732888328893289032891328923289332894328953289632897328983289932900329013290232903329043290532906329073290832909329103291132912329133291432915329163291732918329193292032921329223292332924329253292632927329283292932930329313293232933329343293532936329373293832939329403294132942329433294432945329463294732948329493295032951329523295332954329553295632957329583295932960329613296232963329643296532966329673296832969329703297132972329733297432975329763297732978329793298032981329823298332984329853298632987329883298932990329913299232993329943299532996329973299832999330003300133002330033300433005330063300733008330093301033011330123301333014330153301633017330183301933020330213302233023330243302533026330273302833029330303303133032330333303433035330363303733038330393304033041330423304333044330453304633047330483304933050330513305233053330543305533056330573305833059330603306133062330633306433065330663306733068330693307033071330723307333074330753307633077330783307933080330813308233083330843308533086330873308833089330903309133092330933309433095330963309733098330993310033101331023310333104331053310633107331083310933110331113311233113331143311533116331173311833119331203312133122331233312433125331263312733128331293313033131331323313333134331353313633137331383313933140331413314233143331443314533146331473314833149331503315133152331533315433155331563315733158331593316033161331623316333164331653316633167331683316933170331713317233173331743317533176331773317833179331803318133182331833318433185331863318733188331893319033191331923319333194331953319633197331983319933200332013320233203332043320533206332073320833209332103321133212332133321433215332163321733218332193322033221332223322333224332253322633227332283322933230332313323233233332343323533236332373323833239332403324133242332433324433245332463324733248332493325033251332523325333254332553325633257332583325933260332613326233263332643326533266332673326833269332703327133272332733327433275332763327733278332793328033281332823328333284332853328633287332883328933290332913329233293332943329533296332973329833299333003330133302333033330433305333063330733308333093331033311333123331333314333153331633317333183331933320333213332233323333243332533326333273332833329333303333133332333333333433335333363333733338333393334033341333423334333344333453334633347333483334933350333513335233353333543335533356333573335833359333603336133362333633336433365333663336733368333693337033371333723337333374333753337633377333783337933380333813338233383333843338533386333873338833389333903339133392333933339433395333963339733398333993340033401334023340333404334053340633407334083340933410334113341233413334143341533416334173341833419334203342133422334233342433425334263342733428334293343033431334323343333434334353343633437334383343933440334413344233443334443344533446334473344833449334503345133452334533345433455334563345733458334593346033461334623346333464334653346633467334683346933470334713347233473334743347533476334773347833479334803348133482334833348433485334863348733488334893349033491334923349333494334953349633497334983349933500335013350233503335043350533506335073350833509335103351133512335133351433515335163351733518335193352033521335223352333524335253352633527335283352933530335313353233533335343353533536335373353833539335403354133542335433354433545335463354733548335493355033551335523355333554335553355633557335583355933560335613356233563335643356533566335673356833569335703357133572335733357433575335763357733578335793358033581335823358333584335853358633587335883358933590335913359233593335943359533596335973359833599336003360133602336033360433605336063360733608336093361033611336123361333614336153361633617336183361933620336213362233623336243362533626336273362833629336303363133632336333363433635336363363733638336393364033641336423364333644336453364633647336483364933650336513365233653336543365533656336573365833659336603366133662336633366433665336663366733668336693367033671336723367333674336753367633677336783367933680336813368233683336843368533686336873368833689336903369133692336933369433695336963369733698336993370033701337023370333704337053370633707337083370933710337113371233713337143371533716337173371833719337203372133722337233372433725337263372733728337293373033731337323373333734337353373633737337383373933740337413374233743337443374533746337473374833749337503375133752337533375433755337563375733758337593376033761337623376333764337653376633767337683376933770337713377233773337743377533776337773377833779337803378133782337833378433785337863378733788337893379033791337923379333794337953379633797337983379933800338013380233803338043380533806338073380833809338103381133812338133381433815338163381733818338193382033821338223382333824338253382633827338283382933830338313383233833338343383533836338373383833839338403384133842338433384433845338463384733848338493385033851338523385333854338553385633857338583385933860338613386233863338643386533866338673386833869338703387133872338733387433875338763387733878338793388033881338823388333884338853388633887338883388933890338913389233893338943389533896338973389833899339003390133902339033390433905339063390733908339093391033911339123391333914339153391633917339183391933920339213392233923339243392533926339273392833929339303393133932339333393433935339363393733938339393394033941339423394333944339453394633947339483394933950339513395233953339543395533956339573395833959339603396133962339633396433965339663396733968339693397033971339723397333974339753397633977339783397933980339813398233983339843398533986339873398833989339903399133992339933399433995339963399733998339993400034001340023400334004340053400634007340083400934010340113401234013340143401534016340173401834019340203402134022340233402434025340263402734028340293403034031340323403334034340353403634037340383403934040340413404234043340443404534046340473404834049340503405134052340533405434055340563405734058340593406034061340623406334064340653406634067340683406934070340713407234073340743407534076340773407834079340803408134082340833408434085340863408734088340893409034091340923409334094340953409634097340983409934100341013410234103341043410534106341073410834109341103411134112341133411434115341163411734118341193412034121341223412334124341253412634127341283412934130341313413234133341343413534136341373413834139341403414134142341433414434145341463414734148341493415034151341523415334154341553415634157341583415934160341613416234163341643416534166341673416834169341703417134172341733417434175341763417734178341793418034181341823418334184341853418634187341883418934190341913419234193341943419534196341973419834199342003420134202342033420434205342063420734208342093421034211342123421334214342153421634217342183421934220342213422234223342243422534226342273422834229342303423134232342333423434235342363423734238342393424034241342423424334244342453424634247342483424934250342513425234253342543425534256342573425834259342603426134262342633426434265342663426734268342693427034271342723427334274342753427634277342783427934280342813428234283342843428534286342873428834289342903429134292342933429434295342963429734298342993430034301343023430334304343053430634307343083430934310343113431234313343143431534316343173431834319343203432134322343233432434325343263432734328343293433034331343323433334334343353433634337343383433934340343413434234343343443434534346343473434834349343503435134352343533435434355343563435734358343593436034361343623436334364343653436634367343683436934370343713437234373343743437534376343773437834379343803438134382343833438434385343863438734388343893439034391343923439334394343953439634397343983439934400344013440234403344043440534406344073440834409344103441134412344133441434415344163441734418344193442034421344223442334424344253442634427344283442934430344313443234433344343443534436344373443834439344403444134442344433444434445344463444734448344493445034451344523445334454344553445634457344583445934460344613446234463344643446534466344673446834469344703447134472344733447434475344763447734478344793448034481344823448334484344853448634487344883448934490344913449234493344943449534496344973449834499345003450134502345033450434505345063450734508345093451034511345123451334514345153451634517345183451934520345213452234523345243452534526345273452834529345303453134532345333453434535345363453734538345393454034541345423454334544345453454634547345483454934550345513455234553345543455534556345573455834559345603456134562345633456434565345663456734568345693457034571345723457334574345753457634577345783457934580345813458234583345843458534586345873458834589345903459134592345933459434595345963459734598345993460034601346023460334604346053460634607346083460934610346113461234613346143461534616346173461834619346203462134622346233462434625346263462734628346293463034631346323463334634346353463634637346383463934640346413464234643346443464534646346473464834649346503465134652346533465434655346563465734658346593466034661346623466334664346653466634667346683466934670346713467234673346743467534676346773467834679346803468134682346833468434685346863468734688346893469034691346923469334694346953469634697346983469934700347013470234703347043470534706347073470834709347103471134712347133471434715347163471734718347193472034721347223472334724347253472634727347283472934730347313473234733347343473534736347373473834739347403474134742347433474434745347463474734748347493475034751347523475334754347553475634757347583475934760347613476234763347643476534766347673476834769347703477134772347733477434775347763477734778347793478034781347823478334784347853478634787347883478934790347913479234793347943479534796347973479834799348003480134802348033480434805348063480734808348093481034811348123481334814348153481634817348183481934820348213482234823348243482534826348273482834829348303483134832348333483434835348363483734838348393484034841348423484334844348453484634847348483484934850348513485234853348543485534856348573485834859348603486134862348633486434865348663486734868348693487034871348723487334874348753487634877348783487934880348813488234883348843488534886348873488834889348903489134892348933489434895348963489734898348993490034901349023490334904349053490634907349083490934910349113491234913349143491534916349173491834919349203492134922349233492434925349263492734928349293493034931349323493334934349353493634937349383493934940349413494234943349443494534946349473494834949349503495134952349533495434955349563495734958349593496034961349623496334964349653496634967349683496934970349713497234973349743497534976349773497834979349803498134982349833498434985349863498734988349893499034991349923499334994349953499634997349983499935000350013500235003350043500535006350073500835009350103501135012350133501435015350163501735018350193502035021350223502335024350253502635027350283502935030350313503235033350343503535036350373503835039350403504135042350433504435045350463504735048350493505035051350523505335054350553505635057350583505935060350613506235063350643506535066350673506835069350703507135072350733507435075350763507735078350793508035081350823508335084350853508635087350883508935090350913509235093350943509535096350973509835099351003510135102351033510435105351063510735108351093511035111351123511335114351153511635117351183511935120351213512235123351243512535126351273512835129351303513135132351333513435135351363513735138351393514035141351423514335144351453514635147351483514935150351513515235153351543515535156351573515835159351603516135162351633516435165351663516735168351693517035171351723517335174351753517635177351783517935180351813518235183351843518535186351873518835189351903519135192351933519435195351963519735198351993520035201352023520335204352053520635207352083520935210352113521235213352143521535216352173521835219352203522135222352233522435225352263522735228352293523035231352323523335234352353523635237352383523935240352413524235243352443524535246352473524835249352503525135252352533525435255352563525735258352593526035261352623526335264352653526635267352683526935270352713527235273352743527535276352773527835279352803528135282352833528435285352863528735288352893529035291352923529335294352953529635297352983529935300353013530235303353043530535306353073530835309353103531135312353133531435315353163531735318353193532035321353223532335324353253532635327353283532935330353313533235333353343533535336353373533835339353403534135342353433534435345353463534735348353493535035351353523535335354353553535635357353583535935360353613536235363353643536535366353673536835369353703537135372353733537435375353763537735378353793538035381353823538335384353853538635387353883538935390353913539235393353943539535396353973539835399354003540135402354033540435405354063540735408354093541035411354123541335414354153541635417354183541935420354213542235423354243542535426354273542835429354303543135432354333543435435354363543735438354393544035441354423544335444354453544635447354483544935450354513545235453354543545535456354573545835459354603546135462354633546435465354663546735468354693547035471354723547335474354753547635477354783547935480354813548235483354843548535486354873548835489354903549135492354933549435495354963549735498354993550035501355023550335504355053550635507355083550935510355113551235513355143551535516355173551835519355203552135522355233552435525355263552735528355293553035531355323553335534355353553635537355383553935540355413554235543355443554535546355473554835549355503555135552355533555435555355563555735558355593556035561355623556335564355653556635567355683556935570355713557235573355743557535576355773557835579355803558135582355833558435585355863558735588355893559035591355923559335594355953559635597355983559935600356013560235603356043560535606356073560835609356103561135612356133561435615356163561735618356193562035621356223562335624356253562635627356283562935630356313563235633356343563535636356373563835639356403564135642356433564435645356463564735648356493565035651356523565335654356553565635657356583565935660356613566235663356643566535666356673566835669356703567135672356733567435675356763567735678356793568035681356823568335684356853568635687356883568935690356913569235693356943569535696356973569835699357003570135702357033570435705357063570735708357093571035711357123571335714357153571635717357183571935720357213572235723357243572535726357273572835729357303573135732357333573435735357363573735738357393574035741357423574335744357453574635747357483574935750357513575235753357543575535756357573575835759357603576135762357633576435765357663576735768357693577035771357723577335774357753577635777357783577935780357813578235783357843578535786357873578835789357903579135792357933579435795357963579735798357993580035801358023580335804358053580635807358083580935810358113581235813358143581535816358173581835819358203582135822358233582435825358263582735828358293583035831358323583335834358353583635837358383583935840358413584235843358443584535846358473584835849358503585135852358533585435855358563585735858358593586035861358623586335864358653586635867358683586935870358713587235873358743587535876358773587835879358803588135882358833588435885358863588735888358893589035891358923589335894358953589635897358983589935900359013590235903359043590535906359073590835909359103591135912359133591435915359163591735918359193592035921359223592335924359253592635927359283592935930359313593235933359343593535936359373593835939359403594135942359433594435945359463594735948359493595035951359523595335954359553595635957359583595935960359613596235963359643596535966359673596835969359703597135972359733597435975359763597735978359793598035981359823598335984359853598635987359883598935990359913599235993359943599535996359973599835999360003600136002360033600436005360063600736008360093601036011360123601336014360153601636017360183601936020360213602236023360243602536026360273602836029360303603136032360333603436035360363603736038360393604036041360423604336044360453604636047360483604936050360513605236053360543605536056360573605836059360603606136062360633606436065360663606736068360693607036071360723607336074360753607636077360783607936080360813608236083360843608536086360873608836089360903609136092360933609436095360963609736098360993610036101361023610336104361053610636107361083610936110361113611236113361143611536116361173611836119361203612136122361233612436125361263612736128361293613036131361323613336134361353613636137361383613936140361413614236143361443614536146361473614836149361503615136152361533615436155361563615736158361593616036161361623616336164361653616636167361683616936170361713617236173361743617536176361773617836179361803618136182361833618436185361863618736188361893619036191361923619336194361953619636197361983619936200362013620236203362043620536206362073620836209362103621136212362133621436215362163621736218362193622036221362223622336224362253622636227362283622936230362313623236233362343623536236362373623836239362403624136242362433624436245362463624736248362493625036251362523625336254362553625636257362583625936260362613626236263362643626536266362673626836269362703627136272362733627436275362763627736278362793628036281362823628336284362853628636287362883628936290362913629236293362943629536296362973629836299363003630136302363033630436305363063630736308363093631036311363123631336314363153631636317363183631936320363213632236323363243632536326363273632836329363303633136332363333633436335363363633736338363393634036341363423634336344363453634636347363483634936350363513635236353363543635536356363573635836359363603636136362363633636436365363663636736368363693637036371363723637336374363753637636377363783637936380363813638236383363843638536386363873638836389363903639136392363933639436395363963639736398363993640036401364023640336404364053640636407364083640936410364113641236413364143641536416364173641836419364203642136422364233642436425364263642736428364293643036431364323643336434364353643636437364383643936440364413644236443364443644536446364473644836449364503645136452364533645436455364563645736458364593646036461364623646336464364653646636467364683646936470364713647236473364743647536476364773647836479364803648136482364833648436485364863648736488364893649036491364923649336494364953649636497364983649936500365013650236503365043650536506365073650836509365103651136512365133651436515365163651736518365193652036521365223652336524365253652636527365283652936530365313653236533365343653536536365373653836539365403654136542365433654436545365463654736548365493655036551365523655336554365553655636557365583655936560365613656236563365643656536566365673656836569365703657136572365733657436575365763657736578365793658036581365823658336584365853658636587365883658936590365913659236593365943659536596365973659836599366003660136602366033660436605366063660736608366093661036611366123661336614366153661636617366183661936620366213662236623366243662536626366273662836629366303663136632366333663436635366363663736638366393664036641366423664336644366453664636647366483664936650366513665236653366543665536656366573665836659366603666136662366633666436665366663666736668366693667036671366723667336674366753667636677366783667936680366813668236683366843668536686366873668836689366903669136692366933669436695366963669736698366993670036701367023670336704367053670636707367083670936710367113671236713367143671536716367173671836719367203672136722367233672436725367263672736728367293673036731367323673336734367353673636737367383673936740367413674236743367443674536746367473674836749367503675136752367533675436755367563675736758367593676036761367623676336764367653676636767367683676936770367713677236773367743677536776367773677836779367803678136782367833678436785367863678736788367893679036791367923679336794367953679636797367983679936800368013680236803368043680536806368073680836809368103681136812368133681436815368163681736818368193682036821368223682336824368253682636827368283682936830368313683236833368343683536836368373683836839368403684136842368433684436845368463684736848368493685036851368523685336854368553685636857368583685936860368613686236863368643686536866368673686836869368703687136872368733687436875368763687736878368793688036881368823688336884368853688636887368883688936890368913689236893368943689536896368973689836899369003690136902369033690436905369063690736908369093691036911369123691336914369153691636917369183691936920369213692236923369243692536926369273692836929369303693136932369333693436935369363693736938369393694036941369423694336944369453694636947369483694936950369513695236953369543695536956369573695836959369603696136962369633696436965369663696736968369693697036971369723697336974369753697636977369783697936980369813698236983369843698536986369873698836989369903699136992369933699436995369963699736998369993700037001370023700337004370053700637007370083700937010370113701237013370143701537016370173701837019370203702137022370233702437025370263702737028370293703037031370323703337034370353703637037370383703937040370413704237043370443704537046370473704837049370503705137052370533705437055370563705737058370593706037061370623706337064370653706637067370683706937070370713707237073370743707537076370773707837079370803708137082370833708437085370863708737088370893709037091370923709337094370953709637097370983709937100371013710237103371043710537106371073710837109371103711137112371133711437115371163711737118371193712037121371223712337124371253712637127371283712937130371313713237133371343713537136371373713837139371403714137142371433714437145371463714737148371493715037151371523715337154371553715637157371583715937160371613716237163371643716537166371673716837169371703717137172371733717437175371763717737178371793718037181371823718337184371853718637187371883718937190371913719237193371943719537196371973719837199372003720137202372033720437205372063720737208372093721037211372123721337214372153721637217372183721937220372213722237223372243722537226372273722837229372303723137232372333723437235372363723737238372393724037241372423724337244372453724637247372483724937250372513725237253372543725537256372573725837259372603726137262372633726437265372663726737268372693727037271372723727337274372753727637277372783727937280372813728237283372843728537286372873728837289372903729137292372933729437295372963729737298372993730037301373023730337304373053730637307373083730937310373113731237313373143731537316373173731837319373203732137322373233732437325373263732737328373293733037331373323733337334373353733637337373383733937340373413734237343373443734537346373473734837349373503735137352373533735437355373563735737358373593736037361373623736337364373653736637367373683736937370373713737237373373743737537376373773737837379373803738137382373833738437385373863738737388373893739037391373923739337394373953739637397373983739937400374013740237403374043740537406374073740837409374103741137412374133741437415374163741737418374193742037421374223742337424374253742637427374283742937430374313743237433374343743537436374373743837439374403744137442374433744437445374463744737448374493745037451374523745337454374553745637457374583745937460374613746237463374643746537466374673746837469374703747137472374733747437475374763747737478374793748037481374823748337484374853748637487374883748937490374913749237493374943749537496374973749837499375003750137502375033750437505375063750737508375093751037511375123751337514375153751637517375183751937520375213752237523375243752537526375273752837529375303753137532375333753437535375363753737538375393754037541375423754337544375453754637547375483754937550375513755237553375543755537556375573755837559375603756137562375633756437565375663756737568375693757037571375723757337574375753757637577375783757937580375813758237583375843758537586375873758837589375903759137592375933759437595375963759737598375993760037601376023760337604376053760637607376083760937610376113761237613376143761537616376173761837619376203762137622376233762437625376263762737628376293763037631376323763337634376353763637637376383763937640376413764237643376443764537646376473764837649376503765137652376533765437655376563765737658376593766037661376623766337664376653766637667376683766937670376713767237673376743767537676376773767837679376803768137682376833768437685376863768737688376893769037691376923769337694376953769637697376983769937700377013770237703377043770537706377073770837709377103771137712377133771437715377163771737718377193772037721377223772337724377253772637727377283772937730377313773237733377343773537736377373773837739377403774137742377433774437745377463774737748377493775037751377523775337754377553775637757377583775937760377613776237763377643776537766377673776837769377703777137772377733777437775377763777737778377793778037781377823778337784377853778637787377883778937790377913779237793377943779537796377973779837799378003780137802378033780437805378063780737808378093781037811378123781337814378153781637817378183781937820378213782237823378243782537826378273782837829378303783137832378333783437835378363783737838378393784037841378423784337844378453784637847378483784937850378513785237853378543785537856378573785837859378603786137862378633786437865378663786737868378693787037871378723787337874378753787637877378783787937880378813788237883378843788537886378873788837889378903789137892378933789437895378963789737898378993790037901379023790337904379053790637907379083790937910379113791237913379143791537916379173791837919379203792137922379233792437925379263792737928379293793037931379323793337934379353793637937379383793937940379413794237943379443794537946379473794837949379503795137952379533795437955379563795737958379593796037961379623796337964379653796637967379683796937970379713797237973379743797537976379773797837979379803798137982379833798437985379863798737988379893799037991379923799337994379953799637997379983799938000380013800238003380043800538006380073800838009380103801138012380133801438015380163801738018380193802038021380223802338024380253802638027380283802938030380313803238033380343803538036380373803838039380403804138042380433804438045380463804738048380493805038051380523805338054380553805638057380583805938060380613806238063380643806538066380673806838069380703807138072380733807438075380763807738078380793808038081380823808338084380853808638087380883808938090380913809238093380943809538096380973809838099381003810138102381033810438105381063810738108381093811038111381123811338114381153811638117381183811938120381213812238123381243812538126381273812838129381303813138132381333813438135381363813738138381393814038141381423814338144381453814638147381483814938150381513815238153381543815538156381573815838159381603816138162381633816438165381663816738168381693817038171381723817338174381753817638177381783817938180381813818238183381843818538186381873818838189381903819138192381933819438195381963819738198381993820038201382023820338204382053820638207382083820938210382113821238213382143821538216382173821838219382203822138222382233822438225382263822738228382293823038231382323823338234382353823638237382383823938240382413824238243382443824538246382473824838249382503825138252382533825438255382563825738258382593826038261382623826338264382653826638267382683826938270382713827238273382743827538276382773827838279382803828138282382833828438285382863828738288382893829038291382923829338294382953829638297382983829938300383013830238303383043830538306383073830838309383103831138312383133831438315383163831738318383193832038321383223832338324383253832638327383283832938330383313833238333383343833538336383373833838339383403834138342383433834438345383463834738348383493835038351383523835338354383553835638357383583835938360383613836238363383643836538366383673836838369383703837138372383733837438375383763837738378383793838038381383823838338384383853838638387383883838938390383913839238393383943839538396383973839838399384003840138402384033840438405384063840738408384093841038411384123841338414384153841638417384183841938420384213842238423384243842538426384273842838429384303843138432384333843438435384363843738438384393844038441384423844338444384453844638447384483844938450384513845238453384543845538456384573845838459384603846138462384633846438465384663846738468384693847038471384723847338474384753847638477384783847938480384813848238483384843848538486384873848838489384903849138492384933849438495384963849738498384993850038501385023850338504385053850638507385083850938510385113851238513385143851538516385173851838519385203852138522385233852438525385263852738528385293853038531385323853338534385353853638537385383853938540385413854238543385443854538546385473854838549385503855138552385533855438555385563855738558385593856038561385623856338564385653856638567385683856938570385713857238573385743857538576385773857838579385803858138582385833858438585385863858738588385893859038591385923859338594385953859638597385983859938600386013860238603386043860538606386073860838609386103861138612386133861438615386163861738618386193862038621386223862338624386253862638627386283862938630386313863238633386343863538636386373863838639386403864138642386433864438645386463864738648386493865038651386523865338654386553865638657386583865938660386613866238663386643866538666386673866838669386703867138672386733867438675386763867738678386793868038681386823868338684386853868638687386883868938690386913869238693386943869538696386973869838699387003870138702387033870438705387063870738708387093871038711387123871338714387153871638717387183871938720387213872238723387243872538726387273872838729387303873138732387333873438735387363873738738387393874038741387423874338744387453874638747387483874938750387513875238753387543875538756387573875838759387603876138762387633876438765387663876738768387693877038771387723877338774387753877638777387783877938780387813878238783387843878538786387873878838789387903879138792387933879438795387963879738798387993880038801388023880338804388053880638807388083880938810388113881238813388143881538816388173881838819388203882138822388233882438825388263882738828388293883038831388323883338834388353883638837388383883938840388413884238843388443884538846388473884838849388503885138852388533885438855388563885738858388593886038861388623886338864388653886638867388683886938870388713887238873388743887538876388773887838879388803888138882388833888438885388863888738888388893889038891388923889338894388953889638897388983889938900389013890238903389043890538906389073890838909389103891138912389133891438915389163891738918389193892038921389223892338924389253892638927389283892938930389313893238933389343893538936389373893838939389403894138942389433894438945389463894738948389493895038951389523895338954389553895638957389583895938960389613896238963389643896538966389673896838969389703897138972389733897438975389763897738978389793898038981389823898338984389853898638987389883898938990389913899238993389943899538996389973899838999390003900139002390033900439005390063900739008390093901039011390123901339014390153901639017390183901939020390213902239023390243902539026390273902839029390303903139032390333903439035390363903739038390393904039041390423904339044390453904639047390483904939050390513905239053390543905539056390573905839059390603906139062390633906439065390663906739068390693907039071390723907339074390753907639077390783907939080390813908239083390843908539086390873908839089390903909139092390933909439095390963909739098390993910039101391023910339104391053910639107391083910939110391113911239113391143911539116391173911839119391203912139122391233912439125391263912739128391293913039131391323913339134391353913639137391383913939140391413914239143391443914539146391473914839149391503915139152391533915439155391563915739158391593916039161391623916339164391653916639167391683916939170391713917239173391743917539176391773917839179391803918139182391833918439185391863918739188391893919039191391923919339194391953919639197391983919939200392013920239203392043920539206392073920839209392103921139212392133921439215392163921739218392193922039221392223922339224392253922639227392283922939230392313923239233392343923539236392373923839239392403924139242392433924439245392463924739248392493925039251392523925339254392553925639257392583925939260392613926239263392643926539266392673926839269392703927139272392733927439275392763927739278392793928039281392823928339284392853928639287392883928939290392913929239293392943929539296392973929839299393003930139302393033930439305393063930739308393093931039311393123931339314393153931639317393183931939320393213932239323393243932539326393273932839329393303933139332393333933439335393363933739338393393934039341393423934339344393453934639347393483934939350393513935239353393543935539356393573935839359393603936139362393633936439365393663936739368393693937039371393723937339374393753937639377393783937939380393813938239383393843938539386393873938839389393903939139392393933939439395393963939739398393993940039401394023940339404394053940639407394083940939410394113941239413394143941539416394173941839419394203942139422394233942439425394263942739428394293943039431394323943339434394353943639437394383943939440394413944239443394443944539446394473944839449394503945139452394533945439455394563945739458394593946039461394623946339464394653946639467394683946939470394713947239473394743947539476394773947839479394803948139482394833948439485394863948739488394893949039491394923949339494394953949639497394983949939500395013950239503395043950539506395073950839509395103951139512395133951439515395163951739518395193952039521395223952339524395253952639527395283952939530395313953239533395343953539536395373953839539395403954139542395433954439545395463954739548395493955039551395523955339554395553955639557395583955939560395613956239563395643956539566395673956839569395703957139572395733957439575395763957739578395793958039581395823958339584395853958639587395883958939590395913959239593395943959539596395973959839599396003960139602396033960439605396063960739608396093961039611396123961339614396153961639617396183961939620396213962239623396243962539626396273962839629396303963139632396333963439635396363963739638396393964039641396423964339644396453964639647396483964939650396513965239653396543965539656396573965839659396603966139662396633966439665396663966739668396693967039671396723967339674396753967639677396783967939680396813968239683396843968539686396873968839689396903969139692396933969439695396963969739698396993970039701397023970339704397053970639707397083970939710397113971239713397143971539716397173971839719397203972139722397233972439725397263972739728397293973039731397323973339734397353973639737397383973939740397413974239743397443974539746397473974839749397503975139752397533975439755397563975739758397593976039761397623976339764397653976639767397683976939770397713977239773397743977539776397773977839779397803978139782397833978439785397863978739788397893979039791397923979339794397953979639797397983979939800398013980239803398043980539806398073980839809398103981139812398133981439815398163981739818398193982039821398223982339824398253982639827398283982939830398313983239833398343983539836398373983839839398403984139842398433984439845398463984739848398493985039851398523985339854398553985639857398583985939860398613986239863398643986539866398673986839869398703987139872398733987439875398763987739878398793988039881398823988339884398853988639887398883988939890398913989239893398943989539896398973989839899399003990139902399033990439905399063990739908399093991039911399123991339914399153991639917399183991939920399213992239923399243992539926399273992839929399303993139932399333993439935399363993739938399393994039941399423994339944399453994639947399483994939950399513995239953399543995539956399573995839959399603996139962399633996439965399663996739968399693997039971399723997339974399753997639977399783997939980399813998239983399843998539986399873998839989399903999139992399933999439995399963999739998399994000040001400024000340004400054000640007400084000940010400114001240013400144001540016400174001840019400204002140022400234002440025400264002740028400294003040031400324003340034400354003640037400384003940040400414004240043400444004540046400474004840049400504005140052400534005440055400564005740058400594006040061400624006340064400654006640067400684006940070400714007240073400744007540076400774007840079400804008140082400834008440085400864008740088400894009040091400924009340094400954009640097400984009940100401014010240103401044010540106401074010840109401104011140112401134011440115401164011740118401194012040121401224012340124401254012640127401284012940130401314013240133401344013540136401374013840139401404014140142401434014440145401464014740148401494015040151401524015340154401554015640157401584015940160401614016240163401644016540166401674016840169401704017140172401734017440175401764017740178401794018040181401824018340184401854018640187401884018940190401914019240193401944019540196401974019840199402004020140202402034020440205402064020740208402094021040211402124021340214402154021640217402184021940220402214022240223402244022540226402274022840229402304023140232402334023440235402364023740238402394024040241402424024340244402454024640247402484024940250402514025240253402544025540256402574025840259402604026140262402634026440265402664026740268402694027040271402724027340274402754027640277402784027940280402814028240283402844028540286402874028840289402904029140292402934029440295402964029740298402994030040301403024030340304403054030640307403084030940310403114031240313403144031540316403174031840319403204032140322403234032440325403264032740328403294033040331403324033340334403354033640337403384033940340403414034240343403444034540346403474034840349403504035140352403534035440355403564035740358403594036040361403624036340364403654036640367403684036940370403714037240373403744037540376403774037840379403804038140382403834038440385403864038740388403894039040391403924039340394403954039640397403984039940400404014040240403404044040540406404074040840409404104041140412404134041440415404164041740418404194042040421404224042340424404254042640427404284042940430404314043240433404344043540436404374043840439404404044140442404434044440445404464044740448404494045040451404524045340454404554045640457404584045940460404614046240463404644046540466404674046840469404704047140472404734047440475404764047740478404794048040481404824048340484404854048640487404884048940490404914049240493404944049540496404974049840499405004050140502405034050440505405064050740508405094051040511405124051340514405154051640517405184051940520405214052240523405244052540526405274052840529405304053140532405334053440535405364053740538405394054040541405424054340544405454054640547405484054940550405514055240553405544055540556405574055840559405604056140562405634056440565405664056740568405694057040571405724057340574405754057640577405784057940580405814058240583405844058540586405874058840589405904059140592405934059440595405964059740598405994060040601406024060340604406054060640607406084060940610406114061240613406144061540616406174061840619406204062140622406234062440625406264062740628406294063040631406324063340634406354063640637406384063940640406414064240643406444064540646406474064840649406504065140652406534065440655406564065740658406594066040661406624066340664406654066640667406684066940670406714067240673406744067540676406774067840679406804068140682406834068440685406864068740688406894069040691406924069340694406954069640697406984069940700407014070240703407044070540706407074070840709407104071140712407134071440715407164071740718407194072040721407224072340724407254072640727407284072940730407314073240733407344073540736407374073840739407404074140742407434074440745407464074740748407494075040751407524075340754407554075640757407584075940760407614076240763407644076540766407674076840769407704077140772407734077440775407764077740778407794078040781407824078340784407854078640787407884078940790407914079240793407944079540796407974079840799408004080140802408034080440805408064080740808408094081040811408124081340814408154081640817408184081940820408214082240823408244082540826408274082840829408304083140832408334083440835408364083740838408394084040841408424084340844408454084640847408484084940850408514085240853408544085540856408574085840859408604086140862408634086440865408664086740868408694087040871408724087340874408754087640877408784087940880408814088240883408844088540886408874088840889408904089140892408934089440895408964089740898408994090040901409024090340904409054090640907409084090940910409114091240913409144091540916409174091840919409204092140922409234092440925409264092740928409294093040931409324093340934409354093640937409384093940940409414094240943409444094540946409474094840949409504095140952409534095440955409564095740958409594096040961409624096340964409654096640967409684096940970409714097240973409744097540976409774097840979409804098140982409834098440985409864098740988409894099040991409924099340994409954099640997409984099941000410014100241003410044100541006410074100841009410104101141012410134101441015410164101741018410194102041021410224102341024410254102641027410284102941030410314103241033410344103541036410374103841039410404104141042410434104441045410464104741048410494105041051410524105341054410554105641057410584105941060410614106241063410644106541066410674106841069410704107141072410734107441075410764107741078410794108041081410824108341084410854108641087410884108941090410914109241093410944109541096410974109841099411004110141102411034110441105411064110741108411094111041111411124111341114411154111641117411184111941120411214112241123411244112541126411274112841129411304113141132411334113441135411364113741138411394114041141411424114341144411454114641147411484114941150411514115241153411544115541156411574115841159411604116141162411634116441165411664116741168411694117041171411724117341174411754117641177411784117941180411814118241183411844118541186411874118841189411904119141192411934119441195411964119741198411994120041201412024120341204412054120641207412084120941210412114121241213412144121541216412174121841219412204122141222412234122441225412264122741228412294123041231412324123341234412354123641237412384123941240412414124241243412444124541246412474124841249412504125141252412534125441255412564125741258412594126041261412624126341264412654126641267412684126941270412714127241273412744127541276412774127841279412804128141282412834128441285412864128741288412894129041291412924129341294412954129641297412984129941300413014130241303413044130541306413074130841309413104131141312413134131441315413164131741318413194132041321413224132341324413254132641327413284132941330413314133241333413344133541336413374133841339413404134141342413434134441345413464134741348413494135041351413524135341354413554135641357413584135941360413614136241363413644136541366413674136841369413704137141372413734137441375413764137741378413794138041381413824138341384413854138641387413884138941390413914139241393413944139541396413974139841399414004140141402414034140441405414064140741408414094141041411414124141341414414154141641417414184141941420414214142241423414244142541426414274142841429414304143141432414334143441435414364143741438414394144041441414424144341444414454144641447414484144941450414514145241453414544145541456414574145841459414604146141462414634146441465414664146741468414694147041471414724147341474414754147641477414784147941480414814148241483414844148541486414874148841489414904149141492414934149441495414964149741498414994150041501415024150341504415054150641507415084150941510415114151241513415144151541516415174151841519415204152141522415234152441525415264152741528415294153041531415324153341534415354153641537415384153941540415414154241543415444154541546415474154841549415504155141552415534155441555415564155741558415594156041561415624156341564415654156641567415684156941570415714157241573415744157541576415774157841579415804158141582415834158441585415864158741588415894159041591415924159341594415954159641597415984159941600416014160241603416044160541606416074160841609416104161141612416134161441615416164161741618416194162041621416224162341624416254162641627416284162941630416314163241633416344163541636416374163841639416404164141642416434164441645416464164741648416494165041651416524165341654416554165641657416584165941660416614166241663416644166541666416674166841669416704167141672416734167441675416764167741678416794168041681416824168341684416854168641687416884168941690416914169241693416944169541696416974169841699417004170141702417034170441705417064170741708417094171041711417124171341714417154171641717417184171941720417214172241723417244172541726417274172841729417304173141732417334173441735417364173741738417394174041741417424174341744417454174641747417484174941750417514175241753417544175541756417574175841759417604176141762417634176441765417664176741768417694177041771417724177341774417754177641777417784177941780417814178241783417844178541786417874178841789417904179141792417934179441795417964179741798417994180041801418024180341804418054180641807418084180941810418114181241813418144181541816418174181841819418204182141822418234182441825418264182741828418294183041831418324183341834418354183641837418384183941840418414184241843418444184541846418474184841849418504185141852418534185441855418564185741858418594186041861418624186341864418654186641867418684186941870418714187241873418744187541876418774187841879418804188141882418834188441885418864188741888418894189041891418924189341894418954189641897418984189941900419014190241903419044190541906419074190841909419104191141912419134191441915419164191741918419194192041921419224192341924419254192641927419284192941930419314193241933419344193541936419374193841939419404194141942419434194441945419464194741948419494195041951419524195341954419554195641957419584195941960419614196241963419644196541966419674196841969419704197141972419734197441975419764197741978419794198041981419824198341984419854198641987419884198941990419914199241993419944199541996419974199841999420004200142002420034200442005420064200742008420094201042011420124201342014420154201642017420184201942020420214202242023420244202542026420274202842029420304203142032420334203442035420364203742038420394204042041420424204342044420454204642047420484204942050420514205242053420544205542056420574205842059420604206142062420634206442065420664206742068420694207042071420724207342074420754207642077420784207942080420814208242083420844208542086420874208842089420904209142092420934209442095420964209742098420994210042101421024210342104421054210642107421084210942110421114211242113421144211542116421174211842119421204212142122421234212442125421264212742128421294213042131421324213342134421354213642137421384213942140421414214242143421444214542146421474214842149421504215142152421534215442155421564215742158421594216042161421624216342164421654216642167421684216942170421714217242173421744217542176421774217842179421804218142182421834218442185421864218742188421894219042191421924219342194421954219642197421984219942200422014220242203422044220542206422074220842209422104221142212422134221442215422164221742218422194222042221422224222342224422254222642227422284222942230422314223242233422344223542236422374223842239422404224142242422434224442245422464224742248422494225042251422524225342254422554225642257422584225942260422614226242263422644226542266422674226842269422704227142272422734227442275422764227742278422794228042281422824228342284422854228642287422884228942290422914229242293422944229542296422974229842299423004230142302423034230442305423064230742308423094231042311423124231342314423154231642317423184231942320423214232242323423244232542326423274232842329423304233142332423334233442335423364233742338423394234042341423424234342344423454234642347423484234942350423514235242353423544235542356423574235842359423604236142362423634236442365423664236742368423694237042371423724237342374423754237642377423784237942380423814238242383423844238542386423874238842389423904239142392423934239442395423964239742398423994240042401424024240342404424054240642407424084240942410424114241242413424144241542416424174241842419424204242142422424234242442425424264242742428424294243042431424324243342434424354243642437424384243942440424414244242443424444244542446424474244842449424504245142452424534245442455424564245742458424594246042461424624246342464424654246642467424684246942470424714247242473424744247542476424774247842479424804248142482424834248442485424864248742488424894249042491424924249342494424954249642497424984249942500425014250242503425044250542506425074250842509425104251142512425134251442515425164251742518425194252042521425224252342524425254252642527425284252942530425314253242533425344253542536425374253842539425404254142542425434254442545425464254742548425494255042551425524255342554425554255642557425584255942560425614256242563425644256542566425674256842569425704257142572425734257442575425764257742578425794258042581425824258342584425854258642587425884258942590425914259242593425944259542596425974259842599426004260142602426034260442605426064260742608426094261042611426124261342614426154261642617426184261942620426214262242623426244262542626426274262842629426304263142632426334263442635426364263742638426394264042641426424264342644426454264642647426484264942650426514265242653426544265542656426574265842659426604266142662426634266442665426664266742668426694267042671426724267342674426754267642677426784267942680426814268242683426844268542686426874268842689426904269142692426934269442695426964269742698426994270042701427024270342704427054270642707427084270942710427114271242713427144271542716427174271842719427204272142722427234272442725427264272742728427294273042731427324273342734427354273642737427384273942740427414274242743427444274542746427474274842749427504275142752427534275442755427564275742758427594276042761427624276342764427654276642767427684276942770427714277242773427744277542776427774277842779427804278142782427834278442785427864278742788427894279042791427924279342794427954279642797427984279942800428014280242803428044280542806428074280842809428104281142812428134281442815428164281742818428194282042821428224282342824428254282642827428284282942830428314283242833428344283542836428374283842839428404284142842428434284442845428464284742848428494285042851428524285342854428554285642857428584285942860428614286242863428644286542866428674286842869428704287142872428734287442875428764287742878428794288042881428824288342884428854288642887428884288942890428914289242893428944289542896428974289842899429004290142902429034290442905429064290742908429094291042911429124291342914429154291642917429184291942920429214292242923429244292542926429274292842929429304293142932429334293442935429364293742938429394294042941429424294342944429454294642947429484294942950429514295242953429544295542956429574295842959429604296142962429634296442965429664296742968429694297042971429724297342974429754297642977429784297942980429814298242983429844298542986429874298842989429904299142992429934299442995429964299742998429994300043001430024300343004430054300643007430084300943010430114301243013430144301543016430174301843019430204302143022430234302443025430264302743028430294303043031430324303343034430354303643037430384303943040430414304243043430444304543046430474304843049430504305143052430534305443055430564305743058430594306043061430624306343064430654306643067430684306943070430714307243073430744307543076430774307843079430804308143082430834308443085430864308743088430894309043091430924309343094430954309643097430984309943100431014310243103431044310543106431074310843109431104311143112431134311443115431164311743118431194312043121431224312343124431254312643127431284312943130431314313243133431344313543136431374313843139431404314143142431434314443145431464314743148431494315043151431524315343154431554315643157431584315943160431614316243163431644316543166431674316843169431704317143172431734317443175431764317743178431794318043181431824318343184431854318643187431884318943190431914319243193431944319543196431974319843199432004320143202432034320443205432064320743208432094321043211432124321343214432154321643217432184321943220432214322243223432244322543226432274322843229432304323143232432334323443235432364323743238432394324043241432424324343244432454324643247432484324943250432514325243253432544325543256432574325843259432604326143262432634326443265432664326743268432694327043271432724327343274432754327643277432784327943280432814328243283432844328543286432874328843289432904329143292432934329443295432964329743298432994330043301433024330343304433054330643307433084330943310433114331243313433144331543316433174331843319433204332143322433234332443325433264332743328433294333043331433324333343334433354333643337433384333943340433414334243343433444334543346433474334843349433504335143352433534335443355433564335743358433594336043361433624336343364433654336643367433684336943370433714337243373433744337543376433774337843379433804338143382433834338443385433864338743388433894339043391433924339343394433954339643397433984339943400434014340243403434044340543406434074340843409434104341143412434134341443415434164341743418434194342043421434224342343424434254342643427434284342943430434314343243433434344343543436434374343843439434404344143442434434344443445434464344743448434494345043451434524345343454434554345643457434584345943460434614346243463434644346543466434674346843469434704347143472434734347443475434764347743478434794348043481434824348343484434854348643487434884348943490434914349243493434944349543496434974349843499435004350143502435034350443505435064350743508435094351043511435124351343514435154351643517435184351943520435214352243523435244352543526435274352843529435304353143532435334353443535435364353743538435394354043541435424354343544435454354643547435484354943550435514355243553435544355543556435574355843559435604356143562435634356443565435664356743568435694357043571435724357343574435754357643577435784357943580435814358243583435844358543586435874358843589435904359143592435934359443595435964359743598435994360043601436024360343604436054360643607436084360943610436114361243613436144361543616436174361843619436204362143622436234362443625436264362743628436294363043631436324363343634436354363643637436384363943640436414364243643436444364543646436474364843649436504365143652436534365443655436564365743658436594366043661436624366343664436654366643667436684366943670436714367243673436744367543676436774367843679436804368143682436834368443685436864368743688436894369043691436924369343694436954369643697436984369943700437014370243703437044370543706437074370843709437104371143712437134371443715437164371743718437194372043721437224372343724437254372643727437284372943730437314373243733437344373543736437374373843739437404374143742437434374443745437464374743748437494375043751437524375343754437554375643757437584375943760437614376243763437644376543766437674376843769437704377143772437734377443775437764377743778437794378043781437824378343784437854378643787437884378943790437914379243793437944379543796437974379843799438004380143802438034380443805438064380743808438094381043811438124381343814438154381643817438184381943820438214382243823438244382543826438274382843829438304383143832438334383443835438364383743838438394384043841438424384343844438454384643847438484384943850438514385243853438544385543856438574385843859438604386143862438634386443865438664386743868438694387043871438724387343874438754387643877438784387943880438814388243883438844388543886438874388843889438904389143892438934389443895438964389743898438994390043901439024390343904439054390643907439084390943910439114391243913439144391543916439174391843919439204392143922439234392443925439264392743928439294393043931439324393343934439354393643937439384393943940439414394243943439444394543946439474394843949439504395143952439534395443955439564395743958439594396043961439624396343964439654396643967439684396943970439714397243973439744397543976439774397843979439804398143982439834398443985439864398743988439894399043991439924399343994439954399643997439984399944000440014400244003440044400544006440074400844009440104401144012440134401444015440164401744018440194402044021440224402344024440254402644027440284402944030440314403244033440344403544036440374403844039440404404144042440434404444045440464404744048440494405044051440524405344054440554405644057440584405944060440614406244063440644406544066440674406844069440704407144072440734407444075440764407744078440794408044081440824408344084440854408644087440884408944090440914409244093440944409544096440974409844099441004410144102441034410444105441064410744108441094411044111441124411344114441154411644117441184411944120441214412244123441244412544126441274412844129441304413144132441334413444135441364413744138441394414044141441424414344144441454414644147441484414944150441514415244153441544415544156441574415844159441604416144162441634416444165441664416744168441694417044171441724417344174441754417644177441784417944180441814418244183441844418544186441874418844189441904419144192441934419444195441964419744198441994420044201442024420344204442054420644207442084420944210442114421244213442144421544216442174421844219442204422144222442234422444225442264422744228442294423044231442324423344234442354423644237442384423944240442414424244243442444424544246442474424844249442504425144252442534425444255442564425744258442594426044261442624426344264442654426644267442684426944270442714427244273442744427544276442774427844279442804428144282442834428444285442864428744288442894429044291442924429344294442954429644297442984429944300443014430244303443044430544306443074430844309443104431144312443134431444315443164431744318443194432044321443224432344324443254432644327443284432944330443314433244333443344433544336443374433844339443404434144342443434434444345443464434744348443494435044351443524435344354443554435644357443584435944360443614436244363443644436544366443674436844369443704437144372443734437444375443764437744378443794438044381443824438344384443854438644387443884438944390443914439244393443944439544396443974439844399444004440144402444034440444405444064440744408444094441044411444124441344414444154441644417444184441944420444214442244423444244442544426444274442844429444304443144432444334443444435444364443744438444394444044441444424444344444444454444644447444484444944450444514445244453444544445544456444574445844459444604446144462444634446444465444664446744468444694447044471444724447344474444754447644477444784447944480444814448244483444844448544486444874448844489444904449144492444934449444495444964449744498444994450044501445024450344504445054450644507445084450944510445114451244513445144451544516445174451844519445204452144522445234452444525445264452744528445294453044531445324453344534445354453644537445384453944540445414454244543445444454544546445474454844549445504455144552445534455444555445564455744558445594456044561445624456344564445654456644567445684456944570445714457244573445744457544576445774457844579445804458144582445834458444585445864458744588445894459044591445924459344594445954459644597445984459944600446014460244603446044460544606446074460844609446104461144612446134461444615446164461744618446194462044621446224462344624446254462644627446284462944630446314463244633446344463544636446374463844639446404464144642446434464444645446464464744648446494465044651446524465344654446554465644657446584465944660446614466244663446644466544666446674466844669446704467144672446734467444675446764467744678446794468044681446824468344684446854468644687446884468944690446914469244693446944469544696446974469844699447004470144702447034470444705447064470744708447094471044711447124471344714447154471644717447184471944720447214472244723447244472544726447274472844729447304473144732447334473444735447364473744738447394474044741447424474344744447454474644747447484474944750447514475244753447544475544756447574475844759447604476144762447634476444765447664476744768447694477044771447724477344774447754477644777447784477944780447814478244783447844478544786447874478844789447904479144792447934479444795447964479744798447994480044801448024480344804448054480644807448084480944810448114481244813448144481544816448174481844819448204482144822448234482444825448264482744828448294483044831448324483344834448354483644837448384483944840448414484244843448444484544846448474484844849448504485144852448534485444855448564485744858448594486044861448624486344864448654486644867448684486944870448714487244873448744487544876448774487844879448804488144882448834488444885448864488744888448894489044891448924489344894448954489644897448984489944900449014490244903449044490544906449074490844909449104491144912449134491444915449164491744918449194492044921449224492344924449254492644927449284492944930449314493244933449344493544936449374493844939449404494144942449434494444945449464494744948449494495044951449524495344954449554495644957449584495944960449614496244963449644496544966449674496844969449704497144972449734497444975449764497744978449794498044981449824498344984449854498644987449884498944990449914499244993449944499544996449974499844999450004500145002450034500445005450064500745008450094501045011450124501345014450154501645017450184501945020450214502245023450244502545026450274502845029450304503145032450334503445035450364503745038450394504045041450424504345044450454504645047450484504945050450514505245053450544505545056450574505845059450604506145062450634506445065450664506745068450694507045071450724507345074450754507645077450784507945080450814508245083450844508545086450874508845089450904509145092450934509445095450964509745098450994510045101451024510345104451054510645107451084510945110451114511245113451144511545116451174511845119451204512145122451234512445125451264512745128451294513045131451324513345134451354513645137451384513945140451414514245143451444514545146451474514845149451504515145152451534515445155451564515745158451594516045161451624516345164451654516645167451684516945170451714517245173451744517545176451774517845179451804518145182451834518445185451864518745188451894519045191451924519345194451954519645197451984519945200452014520245203452044520545206452074520845209452104521145212452134521445215452164521745218452194522045221452224522345224452254522645227452284522945230452314523245233452344523545236452374523845239452404524145242452434524445245452464524745248452494525045251452524525345254452554525645257452584525945260452614526245263452644526545266452674526845269452704527145272452734527445275452764527745278452794528045281452824528345284452854528645287452884528945290452914529245293452944529545296452974529845299453004530145302453034530445305453064530745308453094531045311453124531345314453154531645317453184531945320453214532245323453244532545326453274532845329453304533145332453334533445335453364533745338453394534045341453424534345344453454534645347453484534945350453514535245353453544535545356453574535845359453604536145362453634536445365453664536745368453694537045371453724537345374453754537645377453784537945380453814538245383453844538545386453874538845389453904539145392453934539445395453964539745398453994540045401454024540345404454054540645407454084540945410454114541245413454144541545416454174541845419454204542145422454234542445425454264542745428454294543045431454324543345434454354543645437454384543945440454414544245443454444544545446454474544845449454504545145452454534545445455454564545745458454594546045461454624546345464454654546645467454684546945470454714547245473454744547545476454774547845479454804548145482454834548445485454864548745488454894549045491454924549345494454954549645497454984549945500455014550245503455044550545506455074550845509455104551145512455134551445515455164551745518455194552045521455224552345524455254552645527455284552945530455314553245533455344553545536455374553845539455404554145542455434554445545455464554745548455494555045551455524555345554455554555645557455584555945560455614556245563455644556545566455674556845569455704557145572455734557445575455764557745578455794558045581455824558345584455854558645587455884558945590455914559245593455944559545596455974559845599456004560145602456034560445605456064560745608456094561045611456124561345614456154561645617456184561945620456214562245623456244562545626456274562845629456304563145632456334563445635456364563745638456394564045641456424564345644456454564645647456484564945650456514565245653456544565545656456574565845659456604566145662456634566445665456664566745668456694567045671456724567345674456754567645677456784567945680456814568245683456844568545686456874568845689456904569145692456934569445695456964569745698456994570045701457024570345704457054570645707457084570945710457114571245713457144571545716457174571845719457204572145722457234572445725457264572745728457294573045731457324573345734457354573645737457384573945740457414574245743457444574545746457474574845749457504575145752457534575445755457564575745758457594576045761457624576345764457654576645767457684576945770457714577245773457744577545776457774577845779457804578145782457834578445785457864578745788457894579045791457924579345794457954579645797457984579945800458014580245803458044580545806458074580845809458104581145812458134581445815458164581745818458194582045821458224582345824458254582645827458284582945830458314583245833458344583545836458374583845839458404584145842458434584445845458464584745848458494585045851458524585345854458554585645857458584585945860458614586245863458644586545866458674586845869458704587145872458734587445875458764587745878458794588045881458824588345884458854588645887458884588945890458914589245893458944589545896458974589845899459004590145902459034590445905459064590745908459094591045911459124591345914459154591645917459184591945920459214592245923459244592545926459274592845929459304593145932459334593445935459364593745938459394594045941459424594345944459454594645947459484594945950459514595245953459544595545956459574595845959459604596145962459634596445965459664596745968459694597045971459724597345974459754597645977459784597945980459814598245983459844598545986459874598845989459904599145992459934599445995459964599745998459994600046001460024600346004460054600646007460084600946010460114601246013460144601546016460174601846019460204602146022460234602446025460264602746028460294603046031460324603346034460354603646037460384603946040460414604246043460444604546046460474604846049460504605146052460534605446055460564605746058460594606046061460624606346064460654606646067460684606946070460714607246073460744607546076460774607846079460804608146082460834608446085460864608746088460894609046091460924609346094460954609646097460984609946100461014610246103461044610546106461074610846109461104611146112461134611446115461164611746118461194612046121461224612346124461254612646127461284612946130461314613246133461344613546136461374613846139461404614146142461434614446145461464614746148461494615046151461524615346154461554615646157461584615946160461614616246163461644616546166461674616846169461704617146172461734617446175461764617746178461794618046181461824618346184461854618646187461884618946190461914619246193461944619546196461974619846199462004620146202462034620446205462064620746208462094621046211462124621346214462154621646217462184621946220462214622246223462244622546226462274622846229462304623146232462334623446235462364623746238462394624046241462424624346244462454624646247462484624946250462514625246253462544625546256462574625846259462604626146262462634626446265462664626746268462694627046271462724627346274462754627646277462784627946280462814628246283462844628546286462874628846289462904629146292462934629446295462964629746298462994630046301463024630346304463054630646307463084630946310463114631246313463144631546316463174631846319463204632146322463234632446325463264632746328463294633046331463324633346334463354633646337463384633946340463414634246343463444634546346463474634846349463504635146352463534635446355463564635746358463594636046361463624636346364463654636646367463684636946370463714637246373463744637546376463774637846379463804638146382463834638446385463864638746388463894639046391463924639346394463954639646397463984639946400464014640246403464044640546406464074640846409464104641146412464134641446415464164641746418464194642046421464224642346424464254642646427464284642946430464314643246433464344643546436464374643846439464404644146442464434644446445464464644746448464494645046451464524645346454464554645646457464584645946460464614646246463464644646546466464674646846469464704647146472464734647446475464764647746478464794648046481464824648346484464854648646487464884648946490464914649246493464944649546496464974649846499465004650146502465034650446505465064650746508465094651046511465124651346514465154651646517465184651946520465214652246523465244652546526465274652846529465304653146532465334653446535465364653746538465394654046541465424654346544465454654646547465484654946550465514655246553465544655546556465574655846559465604656146562465634656446565465664656746568465694657046571465724657346574465754657646577465784657946580465814658246583465844658546586465874658846589465904659146592465934659446595465964659746598465994660046601466024660346604466054660646607466084660946610466114661246613466144661546616466174661846619466204662146622466234662446625466264662746628466294663046631466324663346634466354663646637466384663946640466414664246643466444664546646466474664846649466504665146652466534665446655466564665746658466594666046661466624666346664466654666646667466684666946670466714667246673466744667546676466774667846679466804668146682466834668446685466864668746688466894669046691466924669346694466954669646697466984669946700467014670246703467044670546706467074670846709467104671146712467134671446715467164671746718467194672046721467224672346724467254672646727467284672946730467314673246733467344673546736467374673846739467404674146742467434674446745467464674746748467494675046751467524675346754467554675646757467584675946760467614676246763467644676546766467674676846769467704677146772467734677446775467764677746778467794678046781467824678346784467854678646787467884678946790467914679246793467944679546796467974679846799468004680146802468034680446805468064680746808468094681046811468124681346814468154681646817468184681946820468214682246823468244682546826468274682846829468304683146832468334683446835468364683746838468394684046841468424684346844468454684646847468484684946850468514685246853468544685546856468574685846859468604686146862468634686446865468664686746868468694687046871468724687346874468754687646877468784687946880468814688246883468844688546886468874688846889468904689146892468934689446895468964689746898468994690046901469024690346904469054690646907469084690946910469114691246913469144691546916469174691846919469204692146922469234692446925469264692746928469294693046931469324693346934469354693646937469384693946940469414694246943469444694546946469474694846949469504695146952469534695446955469564695746958469594696046961469624696346964469654696646967469684696946970469714697246973469744697546976469774697846979469804698146982469834698446985469864698746988469894699046991469924699346994469954699646997469984699947000470014700247003470044700547006470074700847009470104701147012470134701447015470164701747018470194702047021470224702347024470254702647027470284702947030470314703247033470344703547036470374703847039470404704147042470434704447045470464704747048470494705047051470524705347054470554705647057470584705947060470614706247063470644706547066470674706847069470704707147072470734707447075470764707747078470794708047081470824708347084470854708647087470884708947090470914709247093470944709547096470974709847099471004710147102471034710447105471064710747108471094711047111471124711347114471154711647117471184711947120471214712247123471244712547126471274712847129471304713147132471334713447135471364713747138471394714047141471424714347144471454714647147471484714947150471514715247153471544715547156471574715847159471604716147162471634716447165471664716747168471694717047171471724717347174471754717647177471784717947180471814718247183471844718547186471874718847189471904719147192471934719447195471964719747198471994720047201472024720347204472054720647207472084720947210472114721247213472144721547216472174721847219472204722147222472234722447225472264722747228472294723047231472324723347234472354723647237472384723947240472414724247243472444724547246472474724847249472504725147252472534725447255472564725747258472594726047261472624726347264472654726647267472684726947270472714727247273472744727547276472774727847279472804728147282472834728447285472864728747288472894729047291472924729347294472954729647297472984729947300473014730247303473044730547306473074730847309473104731147312473134731447315473164731747318473194732047321473224732347324473254732647327473284732947330473314733247333473344733547336473374733847339473404734147342473434734447345473464734747348473494735047351473524735347354473554735647357473584735947360473614736247363473644736547366473674736847369473704737147372473734737447375473764737747378473794738047381473824738347384473854738647387473884738947390473914739247393473944739547396473974739847399474004740147402474034740447405474064740747408474094741047411474124741347414474154741647417474184741947420474214742247423474244742547426474274742847429474304743147432474334743447435474364743747438474394744047441474424744347444474454744647447474484744947450474514745247453474544745547456474574745847459474604746147462474634746447465474664746747468474694747047471474724747347474474754747647477474784747947480474814748247483474844748547486474874748847489474904749147492474934749447495474964749747498474994750047501475024750347504475054750647507475084750947510475114751247513475144751547516475174751847519475204752147522475234752447525475264752747528475294753047531475324753347534475354753647537475384753947540475414754247543475444754547546475474754847549475504755147552475534755447555475564755747558475594756047561475624756347564475654756647567475684756947570475714757247573475744757547576475774757847579475804758147582475834758447585475864758747588475894759047591475924759347594475954759647597475984759947600476014760247603476044760547606476074760847609476104761147612476134761447615476164761747618476194762047621476224762347624476254762647627476284762947630476314763247633476344763547636476374763847639476404764147642476434764447645476464764747648476494765047651476524765347654476554765647657476584765947660476614766247663476644766547666476674766847669476704767147672476734767447675476764767747678476794768047681476824768347684476854768647687476884768947690476914769247693476944769547696476974769847699477004770147702477034770447705477064770747708477094771047711477124771347714477154771647717477184771947720477214772247723477244772547726477274772847729477304773147732477334773447735477364773747738477394774047741477424774347744477454774647747477484774947750477514775247753477544775547756477574775847759477604776147762477634776447765477664776747768477694777047771477724777347774477754777647777477784777947780477814778247783477844778547786477874778847789477904779147792477934779447795477964779747798477994780047801478024780347804478054780647807478084780947810478114781247813478144781547816478174781847819478204782147822478234782447825478264782747828478294783047831478324783347834478354783647837478384783947840478414784247843478444784547846478474784847849478504785147852478534785447855478564785747858478594786047861478624786347864478654786647867478684786947870478714787247873478744787547876478774787847879478804788147882478834788447885478864788747888478894789047891478924789347894478954789647897478984789947900479014790247903479044790547906479074790847909479104791147912479134791447915479164791747918479194792047921479224792347924479254792647927479284792947930479314793247933479344793547936479374793847939479404794147942479434794447945479464794747948479494795047951479524795347954479554795647957479584795947960479614796247963479644796547966479674796847969479704797147972479734797447975479764797747978479794798047981479824798347984479854798647987479884798947990479914799247993479944799547996479974799847999480004800148002480034800448005480064800748008480094801048011480124801348014480154801648017480184801948020480214802248023480244802548026480274802848029480304803148032480334803448035480364803748038480394804048041480424804348044480454804648047480484804948050480514805248053480544805548056480574805848059480604806148062480634806448065480664806748068480694807048071480724807348074480754807648077480784807948080480814808248083480844808548086480874808848089480904809148092480934809448095480964809748098480994810048101481024810348104481054810648107481084810948110481114811248113481144811548116481174811848119481204812148122481234812448125481264812748128481294813048131481324813348134481354813648137481384813948140481414814248143481444814548146481474814848149481504815148152481534815448155481564815748158481594816048161481624816348164481654816648167481684816948170481714817248173481744817548176481774817848179481804818148182481834818448185481864818748188481894819048191481924819348194481954819648197481984819948200482014820248203482044820548206482074820848209482104821148212482134821448215482164821748218482194822048221482224822348224482254822648227482284822948230482314823248233482344823548236482374823848239482404824148242482434824448245482464824748248482494825048251482524825348254482554825648257482584825948260482614826248263482644826548266482674826848269482704827148272482734827448275482764827748278482794828048281482824828348284482854828648287482884828948290482914829248293482944829548296482974829848299483004830148302483034830448305483064830748308483094831048311483124831348314483154831648317483184831948320483214832248323483244832548326483274832848329483304833148332483334833448335483364833748338483394834048341483424834348344483454834648347483484834948350483514835248353483544835548356483574835848359483604836148362483634836448365483664836748368483694837048371483724837348374483754837648377483784837948380483814838248383483844838548386483874838848389483904839148392483934839448395483964839748398483994840048401484024840348404484054840648407484084840948410484114841248413484144841548416484174841848419484204842148422484234842448425484264842748428484294843048431484324843348434484354843648437484384843948440484414844248443484444844548446484474844848449484504845148452484534845448455484564845748458484594846048461484624846348464484654846648467484684846948470484714847248473484744847548476484774847848479484804848148482484834848448485484864848748488484894849048491484924849348494484954849648497484984849948500485014850248503485044850548506485074850848509485104851148512485134851448515485164851748518485194852048521485224852348524485254852648527485284852948530485314853248533485344853548536485374853848539485404854148542485434854448545485464854748548485494855048551485524855348554485554855648557485584855948560485614856248563485644856548566485674856848569485704857148572485734857448575485764857748578485794858048581485824858348584485854858648587485884858948590485914859248593485944859548596485974859848599486004860148602486034860448605486064860748608486094861048611486124861348614486154861648617486184861948620486214862248623486244862548626486274862848629486304863148632486334863448635486364863748638486394864048641486424864348644486454864648647486484864948650486514865248653486544865548656486574865848659486604866148662486634866448665486664866748668486694867048671486724867348674486754867648677486784867948680486814868248683486844868548686486874868848689486904869148692486934869448695486964869748698486994870048701487024870348704487054870648707487084870948710487114871248713487144871548716487174871848719487204872148722487234872448725487264872748728487294873048731487324873348734487354873648737487384873948740487414874248743487444874548746487474874848749487504875148752487534875448755487564875748758487594876048761487624876348764487654876648767487684876948770487714877248773487744877548776487774877848779487804878148782487834878448785487864878748788487894879048791487924879348794487954879648797487984879948800488014880248803488044880548806488074880848809488104881148812488134881448815488164881748818488194882048821488224882348824488254882648827488284882948830488314883248833488344883548836488374883848839488404884148842488434884448845488464884748848488494885048851488524885348854488554885648857488584885948860488614886248863488644886548866488674886848869488704887148872488734887448875488764887748878488794888048881488824888348884488854888648887488884888948890488914889248893488944889548896488974889848899489004890148902489034890448905489064890748908489094891048911489124891348914489154891648917489184891948920489214892248923489244892548926489274892848929489304893148932489334893448935489364893748938489394894048941489424894348944489454894648947489484894948950489514895248953489544895548956489574895848959489604896148962489634896448965489664896748968489694897048971489724897348974489754897648977489784897948980489814898248983489844898548986489874898848989489904899148992489934899448995489964899748998489994900049001490024900349004490054900649007490084900949010490114901249013490144901549016490174901849019490204902149022490234902449025490264902749028490294903049031490324903349034490354903649037490384903949040490414904249043490444904549046490474904849049490504905149052490534905449055490564905749058490594906049061490624906349064490654906649067490684906949070490714907249073490744907549076490774907849079490804908149082490834908449085490864908749088490894909049091490924909349094490954909649097490984909949100491014910249103491044910549106491074910849109491104911149112491134911449115491164911749118491194912049121491224912349124491254912649127491284912949130491314913249133491344913549136491374913849139491404914149142491434914449145491464914749148491494915049151491524915349154491554915649157491584915949160491614916249163491644916549166491674916849169491704917149172491734917449175491764917749178491794918049181491824918349184491854918649187491884918949190491914919249193491944919549196491974919849199492004920149202492034920449205492064920749208492094921049211492124921349214492154921649217492184921949220492214922249223492244922549226492274922849229492304923149232492334923449235492364923749238492394924049241492424924349244492454924649247492484924949250492514925249253492544925549256492574925849259492604926149262492634926449265492664926749268492694927049271492724927349274492754927649277492784927949280492814928249283492844928549286492874928849289492904929149292492934929449295492964929749298492994930049301493024930349304493054930649307493084930949310493114931249313493144931549316493174931849319493204932149322493234932449325493264932749328493294933049331493324933349334493354933649337493384933949340493414934249343493444934549346493474934849349493504935149352493534935449355493564935749358493594936049361493624936349364493654936649367493684936949370493714937249373493744937549376493774937849379493804938149382493834938449385493864938749388493894939049391493924939349394493954939649397493984939949400494014940249403494044940549406494074940849409494104941149412494134941449415494164941749418494194942049421494224942349424494254942649427494284942949430494314943249433494344943549436494374943849439494404944149442494434944449445494464944749448494494945049451494524945349454494554945649457494584945949460494614946249463494644946549466494674946849469494704947149472494734947449475494764947749478494794948049481494824948349484494854948649487494884948949490494914949249493494944949549496494974949849499495004950149502495034950449505495064950749508495094951049511495124951349514495154951649517495184951949520495214952249523495244952549526495274952849529495304953149532495334953449535495364953749538495394954049541495424954349544495454954649547495484954949550495514955249553495544955549556495574955849559495604956149562495634956449565495664956749568495694957049571495724957349574495754957649577495784957949580495814958249583495844958549586495874958849589495904959149592495934959449595495964959749598495994960049601496024960349604496054960649607496084960949610496114961249613496144961549616496174961849619496204962149622496234962449625496264962749628496294963049631496324963349634496354963649637496384963949640496414964249643496444964549646496474964849649496504965149652496534965449655496564965749658496594966049661496624966349664496654966649667496684966949670496714967249673496744967549676496774967849679496804968149682496834968449685496864968749688496894969049691496924969349694496954969649697496984969949700497014970249703497044970549706497074970849709497104971149712497134971449715497164971749718497194972049721497224972349724497254972649727497284972949730497314973249733497344973549736497374973849739497404974149742497434974449745497464974749748497494975049751497524975349754497554975649757497584975949760497614976249763497644976549766497674976849769497704977149772497734977449775497764977749778497794978049781497824978349784497854978649787497884978949790497914979249793497944979549796497974979849799498004980149802498034980449805498064980749808498094981049811498124981349814498154981649817498184981949820498214982249823498244982549826498274982849829498304983149832498334983449835498364983749838498394984049841498424984349844498454984649847498484984949850498514985249853498544985549856498574985849859498604986149862498634986449865498664986749868498694987049871498724987349874498754987649877498784987949880498814988249883498844988549886498874988849889498904989149892498934989449895498964989749898498994990049901499024990349904499054990649907499084990949910499114991249913499144991549916499174991849919499204992149922499234992449925499264992749928499294993049931499324993349934499354993649937499384993949940499414994249943499444994549946499474994849949499504995149952499534995449955499564995749958499594996049961499624996349964499654996649967499684996949970499714997249973499744997549976499774997849979499804998149982499834998449985499864998749988499894999049991499924999349994499954999649997499984999950000500015000250003500045000550006500075000850009500105001150012500135001450015500165001750018500195002050021500225002350024500255002650027500285002950030500315003250033500345003550036500375003850039500405004150042500435004450045500465004750048500495005050051500525005350054500555005650057500585005950060500615006250063500645006550066500675006850069500705007150072500735007450075500765007750078500795008050081500825008350084500855008650087500885008950090500915009250093500945009550096500975009850099501005010150102501035010450105501065010750108501095011050111501125011350114501155011650117501185011950120501215012250123501245012550126501275012850129501305013150132501335013450135501365013750138501395014050141501425014350144501455014650147501485014950150501515015250153501545015550156501575015850159501605016150162501635016450165501665016750168501695017050171501725017350174501755017650177501785017950180501815018250183501845018550186501875018850189501905019150192501935019450195501965019750198501995020050201502025020350204502055020650207502085020950210502115021250213502145021550216502175021850219502205022150222502235022450225502265022750228502295023050231502325023350234502355023650237502385023950240502415024250243502445024550246502475024850249502505025150252502535025450255502565025750258502595026050261502625026350264502655026650267502685026950270502715027250273502745027550276502775027850279502805028150282502835028450285502865028750288502895029050291502925029350294502955029650297502985029950300503015030250303503045030550306503075030850309503105031150312503135031450315503165031750318503195032050321503225032350324503255032650327503285032950330503315033250333503345033550336503375033850339503405034150342503435034450345503465034750348503495035050351503525035350354503555035650357503585035950360503615036250363503645036550366503675036850369503705037150372503735037450375503765037750378503795038050381503825038350384503855038650387503885038950390503915039250393503945039550396503975039850399504005040150402504035040450405504065040750408504095041050411504125041350414504155041650417504185041950420504215042250423504245042550426504275042850429504305043150432504335043450435504365043750438504395044050441504425044350444504455044650447504485044950450504515045250453504545045550456504575045850459504605046150462504635046450465504665046750468504695047050471504725047350474504755047650477504785047950480504815048250483504845048550486504875048850489504905049150492504935049450495504965049750498504995050050501505025050350504505055050650507505085050950510505115051250513505145051550516505175051850519505205052150522505235052450525505265052750528505295053050531505325053350534505355053650537505385053950540505415054250543505445054550546505475054850549505505055150552505535055450555505565055750558505595056050561505625056350564505655056650567505685056950570505715057250573505745057550576505775057850579505805058150582505835058450585505865058750588505895059050591505925059350594505955059650597505985059950600506015060250603506045060550606506075060850609506105061150612506135061450615506165061750618506195062050621506225062350624506255062650627506285062950630506315063250633506345063550636506375063850639506405064150642506435064450645506465064750648506495065050651506525065350654506555065650657506585065950660506615066250663506645066550666506675066850669506705067150672506735067450675506765067750678506795068050681506825068350684506855068650687506885068950690506915069250693506945069550696506975069850699507005070150702507035070450705507065070750708507095071050711507125071350714507155071650717507185071950720507215072250723507245072550726507275072850729507305073150732507335073450735507365073750738507395074050741507425074350744507455074650747507485074950750507515075250753507545075550756507575075850759507605076150762507635076450765507665076750768507695077050771507725077350774507755077650777507785077950780507815078250783507845078550786507875078850789507905079150792507935079450795507965079750798507995080050801508025080350804508055080650807508085080950810508115081250813508145081550816508175081850819508205082150822508235082450825508265082750828508295083050831508325083350834508355083650837508385083950840508415084250843508445084550846508475084850849508505085150852508535085450855508565085750858508595086050861508625086350864508655086650867508685086950870508715087250873508745087550876508775087850879508805088150882508835088450885508865088750888508895089050891508925089350894508955089650897508985089950900509015090250903509045090550906509075090850909509105091150912509135091450915509165091750918509195092050921509225092350924509255092650927509285092950930509315093250933509345093550936509375093850939509405094150942509435094450945509465094750948509495095050951509525095350954509555095650957509585095950960509615096250963509645096550966509675096850969509705097150972509735097450975509765097750978509795098050981509825098350984509855098650987509885098950990509915099250993509945099550996509975099850999510005100151002510035100451005510065100751008510095101051011510125101351014510155101651017510185101951020510215102251023510245102551026510275102851029510305103151032510335103451035510365103751038510395104051041510425104351044510455104651047510485104951050510515105251053510545105551056510575105851059510605106151062510635106451065510665106751068510695107051071510725107351074510755107651077510785107951080510815108251083510845108551086510875108851089510905109151092510935109451095510965109751098510995110051101511025110351104511055110651107511085110951110511115111251113511145111551116511175111851119511205112151122511235112451125511265112751128511295113051131511325113351134511355113651137511385113951140511415114251143511445114551146511475114851149511505115151152511535115451155511565115751158511595116051161511625116351164511655116651167511685116951170511715117251173511745117551176511775117851179511805118151182511835118451185511865118751188511895119051191511925119351194511955119651197511985119951200512015120251203512045120551206512075120851209512105121151212512135121451215512165121751218512195122051221512225122351224512255122651227512285122951230512315123251233512345123551236512375123851239512405124151242512435124451245512465124751248512495125051251512525125351254512555125651257512585125951260512615126251263512645126551266512675126851269512705127151272512735127451275512765127751278512795128051281512825128351284512855128651287512885128951290512915129251293512945129551296512975129851299513005130151302513035130451305513065130751308513095131051311513125131351314513155131651317513185131951320513215132251323513245132551326513275132851329513305133151332513335133451335513365133751338513395134051341513425134351344513455134651347513485134951350513515135251353513545135551356513575135851359513605136151362513635136451365513665136751368513695137051371513725137351374513755137651377513785137951380513815138251383513845138551386513875138851389513905139151392513935139451395513965139751398513995140051401514025140351404514055140651407514085140951410514115141251413514145141551416514175141851419514205142151422514235142451425514265142751428514295143051431514325143351434514355143651437514385143951440514415144251443514445144551446514475144851449514505145151452514535145451455514565145751458514595146051461514625146351464514655146651467514685146951470514715147251473514745147551476514775147851479514805148151482514835148451485514865148751488514895149051491514925149351494514955149651497514985149951500515015150251503515045150551506515075150851509515105151151512515135151451515515165151751518515195152051521515225152351524515255152651527515285152951530515315153251533515345153551536515375153851539515405154151542515435154451545515465154751548515495155051551515525155351554515555155651557515585155951560515615156251563515645156551566515675156851569515705157151572515735157451575515765157751578515795158051581515825158351584515855158651587515885158951590515915159251593515945159551596515975159851599516005160151602516035160451605516065160751608516095161051611516125161351614516155161651617516185161951620516215162251623516245162551626516275162851629516305163151632516335163451635516365163751638516395164051641516425164351644516455164651647516485164951650516515165251653516545165551656516575165851659516605166151662516635166451665516665166751668516695167051671516725167351674516755167651677516785167951680516815168251683516845168551686516875168851689516905169151692516935169451695516965169751698516995170051701517025170351704517055170651707517085170951710517115171251713517145171551716517175171851719517205172151722517235172451725517265172751728517295173051731517325173351734517355173651737517385173951740517415174251743517445174551746517475174851749517505175151752517535175451755517565175751758517595176051761517625176351764517655176651767517685176951770517715177251773517745177551776517775177851779517805178151782517835178451785517865178751788517895179051791517925179351794517955179651797517985179951800518015180251803518045180551806518075180851809518105181151812518135181451815518165181751818518195182051821518225182351824518255182651827518285182951830518315183251833518345183551836518375183851839518405184151842518435184451845518465184751848518495185051851518525185351854518555185651857518585185951860518615186251863518645186551866518675186851869518705187151872518735187451875518765187751878518795188051881518825188351884518855188651887518885188951890518915189251893518945189551896518975189851899519005190151902519035190451905519065190751908519095191051911519125191351914519155191651917519185191951920519215192251923519245192551926519275192851929519305193151932519335193451935519365193751938519395194051941519425194351944519455194651947519485194951950519515195251953519545195551956519575195851959519605196151962519635196451965519665196751968519695197051971519725197351974519755197651977519785197951980519815198251983519845198551986519875198851989519905199151992519935199451995519965199751998519995200052001520025200352004520055200652007520085200952010520115201252013520145201552016520175201852019520205202152022520235202452025520265202752028520295203052031520325203352034520355203652037520385203952040520415204252043520445204552046520475204852049520505205152052520535205452055520565205752058520595206052061520625206352064520655206652067520685206952070520715207252073520745207552076520775207852079520805208152082520835208452085520865208752088520895209052091520925209352094520955209652097520985209952100521015210252103521045210552106521075210852109521105211152112521135211452115521165211752118521195212052121521225212352124521255212652127521285212952130521315213252133521345213552136521375213852139521405214152142521435214452145521465214752148521495215052151521525215352154521555215652157521585215952160521615216252163521645216552166521675216852169521705217152172521735217452175521765217752178521795218052181521825218352184521855218652187521885218952190521915219252193521945219552196521975219852199522005220152202522035220452205522065220752208522095221052211522125221352214522155221652217522185221952220522215222252223522245222552226522275222852229522305223152232522335223452235522365223752238522395224052241522425224352244522455224652247522485224952250522515225252253522545225552256522575225852259522605226152262522635226452265522665226752268522695227052271522725227352274522755227652277522785227952280522815228252283522845228552286522875228852289522905229152292522935229452295522965229752298522995230052301523025230352304523055230652307523085230952310523115231252313523145231552316523175231852319523205232152322523235232452325523265232752328523295233052331523325233352334523355233652337523385233952340523415234252343523445234552346523475234852349523505235152352523535235452355523565235752358523595236052361523625236352364523655236652367523685236952370523715237252373523745237552376523775237852379523805238152382523835238452385523865238752388523895239052391523925239352394523955239652397523985239952400524015240252403524045240552406524075240852409524105241152412524135241452415524165241752418524195242052421524225242352424524255242652427524285242952430524315243252433524345243552436524375243852439524405244152442524435244452445524465244752448524495245052451524525245352454524555245652457524585245952460524615246252463524645246552466524675246852469524705247152472524735247452475524765247752478524795248052481524825248352484524855248652487524885248952490524915249252493524945249552496524975249852499525005250152502525035250452505525065250752508525095251052511525125251352514525155251652517525185251952520525215252252523525245252552526525275252852529525305253152532525335253452535525365253752538525395254052541525425254352544525455254652547525485254952550525515255252553525545255552556525575255852559525605256152562525635256452565525665256752568525695257052571525725257352574525755257652577525785257952580525815258252583525845258552586525875258852589525905259152592525935259452595525965259752598525995260052601526025260352604526055260652607526085260952610526115261252613526145261552616526175261852619526205262152622526235262452625526265262752628526295263052631526325263352634526355263652637526385263952640526415264252643526445264552646526475264852649526505265152652526535265452655526565265752658526595266052661526625266352664526655266652667526685266952670526715267252673526745267552676526775267852679526805268152682526835268452685526865268752688526895269052691526925269352694526955269652697526985269952700527015270252703527045270552706527075270852709527105271152712527135271452715527165271752718527195272052721527225272352724527255272652727527285272952730527315273252733527345273552736527375273852739527405274152742527435274452745527465274752748527495275052751527525275352754527555275652757527585275952760527615276252763527645276552766527675276852769527705277152772527735277452775527765277752778527795278052781527825278352784527855278652787527885278952790527915279252793527945279552796527975279852799528005280152802528035280452805528065280752808528095281052811528125281352814528155281652817528185281952820528215282252823528245282552826528275282852829528305283152832528335283452835528365283752838528395284052841528425284352844528455284652847528485284952850528515285252853528545285552856528575285852859528605286152862528635286452865528665286752868528695287052871528725287352874528755287652877528785287952880528815288252883528845288552886528875288852889528905289152892528935289452895528965289752898528995290052901529025290352904529055290652907529085290952910529115291252913529145291552916529175291852919529205292152922529235292452925529265292752928529295293052931529325293352934529355293652937529385293952940529415294252943529445294552946529475294852949529505295152952529535295452955529565295752958529595296052961529625296352964529655296652967529685296952970529715297252973529745297552976529775297852979529805298152982529835298452985529865298752988529895299052991529925299352994529955299652997529985299953000530015300253003530045300553006530075300853009530105301153012530135301453015530165301753018530195302053021530225302353024530255302653027530285302953030530315303253033530345303553036530375303853039530405304153042530435304453045530465304753048530495305053051530525305353054530555305653057530585305953060530615306253063530645306553066530675306853069530705307153072530735307453075530765307753078530795308053081530825308353084530855308653087530885308953090530915309253093530945309553096530975309853099531005310153102531035310453105531065310753108531095311053111531125311353114531155311653117531185311953120531215312253123531245312553126531275312853129531305313153132531335313453135531365313753138531395314053141531425314353144531455314653147531485314953150531515315253153531545315553156531575315853159531605316153162531635316453165531665316753168531695317053171531725317353174531755317653177531785317953180531815318253183531845318553186531875318853189531905319153192531935319453195531965319753198531995320053201532025320353204532055320653207532085320953210532115321253213532145321553216532175321853219532205322153222532235322453225532265322753228532295323053231532325323353234532355323653237532385323953240532415324253243532445324553246532475324853249532505325153252532535325453255532565325753258532595326053261532625326353264532655326653267532685326953270532715327253273532745327553276532775327853279532805328153282532835328453285532865328753288532895329053291532925329353294532955329653297532985329953300533015330253303533045330553306533075330853309533105331153312533135331453315533165331753318533195332053321533225332353324533255332653327533285332953330533315333253333533345333553336533375333853339533405334153342533435334453345533465334753348533495335053351533525335353354533555335653357533585335953360533615336253363533645336553366533675336853369533705337153372533735337453375533765337753378533795338053381533825338353384533855338653387533885338953390533915339253393533945339553396533975339853399534005340153402534035340453405534065340753408534095341053411534125341353414534155341653417534185341953420534215342253423534245342553426534275342853429534305343153432534335343453435534365343753438534395344053441534425344353444534455344653447534485344953450534515345253453534545345553456534575345853459534605346153462534635346453465534665346753468534695347053471534725347353474534755347653477534785347953480534815348253483534845348553486534875348853489534905349153492534935349453495534965349753498534995350053501535025350353504535055350653507535085350953510535115351253513535145351553516535175351853519535205352153522535235352453525535265352753528535295353053531535325353353534535355353653537535385353953540535415354253543535445354553546535475354853549535505355153552535535355453555535565355753558535595356053561535625356353564535655356653567535685356953570535715357253573535745357553576535775357853579535805358153582535835358453585535865358753588535895359053591535925359353594535955359653597535985359953600536015360253603536045360553606536075360853609536105361153612536135361453615536165361753618536195362053621536225362353624536255362653627536285362953630536315363253633536345363553636536375363853639536405364153642536435364453645536465364753648536495365053651536525365353654536555365653657536585365953660536615366253663536645366553666536675366853669536705367153672536735367453675536765367753678536795368053681536825368353684536855368653687536885368953690536915369253693536945369553696536975369853699537005370153702537035370453705537065370753708537095371053711537125371353714537155371653717537185371953720537215372253723537245372553726537275372853729537305373153732537335373453735537365373753738537395374053741537425374353744537455374653747537485374953750537515375253753537545375553756537575375853759537605376153762537635376453765537665376753768537695377053771537725377353774537755377653777537785377953780537815378253783537845378553786537875378853789537905379153792537935379453795537965379753798537995380053801538025380353804538055380653807538085380953810538115381253813538145381553816538175381853819538205382153822538235382453825538265382753828538295383053831538325383353834538355383653837538385383953840538415384253843538445384553846538475384853849538505385153852538535385453855538565385753858538595386053861538625386353864538655386653867538685386953870538715387253873538745387553876538775387853879538805388153882538835388453885538865388753888538895389053891538925389353894538955389653897538985389953900539015390253903539045390553906539075390853909539105391153912539135391453915539165391753918539195392053921539225392353924539255392653927539285392953930539315393253933539345393553936539375393853939539405394153942539435394453945539465394753948539495395053951539525395353954539555395653957539585395953960539615396253963539645396553966539675396853969539705397153972539735397453975539765397753978539795398053981539825398353984539855398653987539885398953990539915399253993539945399553996539975399853999540005400154002540035400454005540065400754008540095401054011540125401354014540155401654017540185401954020540215402254023540245402554026540275402854029540305403154032540335403454035540365403754038540395404054041540425404354044540455404654047540485404954050540515405254053540545405554056540575405854059540605406154062540635406454065540665406754068540695407054071540725407354074540755407654077540785407954080540815408254083540845408554086540875408854089540905409154092540935409454095540965409754098540995410054101541025410354104541055410654107541085410954110541115411254113541145411554116541175411854119541205412154122541235412454125541265412754128541295413054131541325413354134541355413654137541385413954140541415414254143541445414554146541475414854149541505415154152541535415454155541565415754158541595416054161541625416354164541655416654167541685416954170541715417254173541745417554176541775417854179541805418154182541835418454185541865418754188541895419054191541925419354194541955419654197541985419954200542015420254203542045420554206542075420854209542105421154212542135421454215542165421754218542195422054221542225422354224542255422654227542285422954230542315423254233542345423554236542375423854239542405424154242542435424454245542465424754248542495425054251542525425354254542555425654257542585425954260542615426254263542645426554266542675426854269542705427154272542735427454275542765427754278542795428054281542825428354284542855428654287542885428954290542915429254293542945429554296542975429854299543005430154302543035430454305543065430754308543095431054311543125431354314543155431654317543185431954320543215432254323543245432554326543275432854329543305433154332543335433454335543365433754338543395434054341543425434354344543455434654347543485434954350543515435254353543545435554356543575435854359543605436154362543635436454365543665436754368543695437054371543725437354374543755437654377543785437954380543815438254383543845438554386543875438854389543905439154392543935439454395543965439754398543995440054401544025440354404544055440654407544085440954410544115441254413544145441554416544175441854419544205442154422544235442454425544265442754428544295443054431544325443354434544355443654437544385443954440544415444254443544445444554446544475444854449544505445154452544535445454455544565445754458544595446054461544625446354464544655446654467544685446954470544715447254473544745447554476544775447854479544805448154482544835448454485544865448754488544895449054491544925449354494544955449654497544985449954500545015450254503545045450554506545075450854509545105451154512545135451454515545165451754518545195452054521545225452354524545255452654527545285452954530545315453254533545345453554536545375453854539545405454154542545435454454545545465454754548545495455054551545525455354554545555455654557545585455954560545615456254563545645456554566545675456854569545705457154572545735457454575545765457754578545795458054581545825458354584545855458654587545885458954590545915459254593545945459554596545975459854599546005460154602546035460454605546065460754608546095461054611546125461354614546155461654617546185461954620546215462254623546245462554626546275462854629546305463154632546335463454635546365463754638546395464054641546425464354644546455464654647546485464954650546515465254653546545465554656546575465854659546605466154662546635466454665546665466754668546695467054671546725467354674546755467654677546785467954680546815468254683546845468554686546875468854689546905469154692546935469454695546965469754698546995470054701547025470354704547055470654707547085470954710547115471254713547145471554716547175471854719547205472154722547235472454725547265472754728547295473054731547325473354734547355473654737547385473954740547415474254743547445474554746547475474854749547505475154752547535475454755547565475754758547595476054761547625476354764547655476654767547685476954770547715477254773547745477554776547775477854779547805478154782547835478454785547865478754788547895479054791547925479354794547955479654797547985479954800548015480254803548045480554806548075480854809548105481154812548135481454815548165481754818548195482054821548225482354824548255482654827548285482954830548315483254833548345483554836548375483854839548405484154842548435484454845548465484754848548495485054851548525485354854548555485654857548585485954860548615486254863548645486554866548675486854869548705487154872548735487454875548765487754878548795488054881548825488354884548855488654887548885488954890548915489254893548945489554896548975489854899549005490154902549035490454905549065490754908549095491054911549125491354914549155491654917549185491954920549215492254923549245492554926549275492854929549305493154932549335493454935549365493754938549395494054941549425494354944549455494654947549485494954950549515495254953549545495554956549575495854959549605496154962549635496454965549665496754968549695497054971549725497354974549755497654977549785497954980549815498254983549845498554986549875498854989549905499154992549935499454995549965499754998549995500055001550025500355004550055500655007550085500955010550115501255013550145501555016550175501855019550205502155022550235502455025550265502755028550295503055031550325503355034550355503655037550385503955040550415504255043550445504555046550475504855049550505505155052550535505455055550565505755058550595506055061550625506355064550655506655067550685506955070550715507255073550745507555076550775507855079550805508155082550835508455085550865508755088550895509055091550925509355094550955509655097550985509955100551015510255103551045510555106551075510855109551105511155112551135511455115551165511755118551195512055121551225512355124551255512655127551285512955130551315513255133551345513555136551375513855139551405514155142551435514455145551465514755148551495515055151551525515355154551555515655157551585515955160551615516255163551645516555166551675516855169551705517155172551735517455175551765517755178551795518055181551825518355184551855518655187551885518955190551915519255193551945519555196551975519855199552005520155202552035520455205552065520755208552095521055211552125521355214552155521655217552185521955220552215522255223552245522555226552275522855229552305523155232552335523455235552365523755238552395524055241552425524355244552455524655247552485524955250552515525255253552545525555256552575525855259552605526155262552635526455265552665526755268552695527055271552725527355274552755527655277552785527955280552815528255283552845528555286552875528855289552905529155292552935529455295552965529755298552995530055301553025530355304553055530655307553085530955310553115531255313553145531555316553175531855319553205532155322553235532455325553265532755328553295533055331553325533355334553355533655337553385533955340553415534255343553445534555346553475534855349553505535155352553535535455355553565535755358553595536055361553625536355364553655536655367553685536955370553715537255373553745537555376553775537855379553805538155382553835538455385553865538755388553895539055391553925539355394553955539655397553985539955400554015540255403554045540555406554075540855409554105541155412554135541455415554165541755418554195542055421554225542355424554255542655427554285542955430554315543255433554345543555436554375543855439554405544155442554435544455445554465544755448554495545055451554525545355454554555545655457554585545955460554615546255463554645546555466554675546855469554705547155472554735547455475554765547755478554795548055481554825548355484554855548655487554885548955490554915549255493554945549555496554975549855499555005550155502555035550455505555065550755508555095551055511555125551355514555155551655517555185551955520555215552255523555245552555526555275552855529555305553155532555335553455535555365553755538555395554055541555425554355544555455554655547555485554955550555515555255553555545555555556555575555855559555605556155562555635556455565555665556755568555695557055571555725557355574555755557655577555785557955580555815558255583555845558555586555875558855589555905559155592555935559455595555965559755598555995560055601556025560355604556055560655607556085560955610556115561255613556145561555616556175561855619556205562155622556235562455625556265562755628556295563055631556325563355634556355563655637556385563955640556415564255643556445564555646556475564855649556505565155652556535565455655556565565755658556595566055661556625566355664556655566655667556685566955670556715567255673556745567555676556775567855679556805568155682556835568455685556865568755688556895569055691556925569355694556955569655697556985569955700557015570255703557045570555706557075570855709557105571155712557135571455715557165571755718557195572055721557225572355724557255572655727557285572955730557315573255733557345573555736557375573855739557405574155742557435574455745557465574755748557495575055751557525575355754557555575655757557585575955760557615576255763557645576555766557675576855769557705577155772557735577455775557765577755778557795578055781557825578355784557855578655787557885578955790557915579255793557945579555796557975579855799558005580155802558035580455805558065580755808558095581055811558125581355814558155581655817558185581955820558215582255823558245582555826558275582855829558305583155832558335583455835558365583755838558395584055841558425584355844558455584655847558485584955850558515585255853558545585555856558575585855859558605586155862558635586455865558665586755868558695587055871558725587355874558755587655877558785587955880558815588255883558845588555886558875588855889558905589155892558935589455895558965589755898558995590055901559025590355904559055590655907559085590955910559115591255913559145591555916559175591855919559205592155922559235592455925559265592755928559295593055931559325593355934559355593655937559385593955940559415594255943559445594555946559475594855949559505595155952559535595455955559565595755958559595596055961559625596355964559655596655967559685596955970559715597255973559745597555976559775597855979559805598155982559835598455985559865598755988559895599055991559925599355994559955599655997559985599956000560015600256003560045600556006560075600856009560105601156012560135601456015560165601756018560195602056021560225602356024560255602656027560285602956030560315603256033560345603556036560375603856039560405604156042560435604456045560465604756048560495605056051560525605356054560555605656057560585605956060560615606256063560645606556066560675606856069560705607156072560735607456075560765607756078560795608056081560825608356084560855608656087560885608956090560915609256093560945609556096560975609856099561005610156102561035610456105561065610756108561095611056111561125611356114561155611656117561185611956120561215612256123561245612556126561275612856129561305613156132561335613456135561365613756138561395614056141561425614356144561455614656147561485614956150561515615256153561545615556156561575615856159561605616156162561635616456165561665616756168561695617056171561725617356174561755617656177561785617956180561815618256183561845618556186561875618856189561905619156192561935619456195561965619756198561995620056201562025620356204562055620656207562085620956210562115621256213562145621556216562175621856219562205622156222562235622456225562265622756228562295623056231562325623356234562355623656237562385623956240562415624256243562445624556246562475624856249562505625156252562535625456255562565625756258562595626056261562625626356264562655626656267562685626956270562715627256273562745627556276562775627856279562805628156282562835628456285562865628756288562895629056291562925629356294562955629656297562985629956300563015630256303563045630556306563075630856309563105631156312563135631456315563165631756318563195632056321563225632356324563255632656327563285632956330563315633256333563345633556336563375633856339563405634156342563435634456345563465634756348563495635056351563525635356354563555635656357563585635956360563615636256363563645636556366563675636856369563705637156372563735637456375563765637756378563795638056381563825638356384563855638656387563885638956390563915639256393563945639556396563975639856399564005640156402564035640456405564065640756408564095641056411564125641356414564155641656417564185641956420564215642256423564245642556426564275642856429564305643156432564335643456435564365643756438564395644056441564425644356444564455644656447564485644956450564515645256453564545645556456564575645856459564605646156462564635646456465564665646756468564695647056471564725647356474564755647656477564785647956480564815648256483564845648556486564875648856489564905649156492564935649456495564965649756498564995650056501565025650356504565055650656507565085650956510565115651256513565145651556516565175651856519565205652156522565235652456525565265652756528565295653056531565325653356534565355653656537565385653956540565415654256543565445654556546565475654856549565505655156552565535655456555565565655756558565595656056561565625656356564565655656656567565685656956570565715657256573565745657556576565775657856579565805658156582565835658456585565865658756588565895659056591565925659356594565955659656597565985659956600566015660256603566045660556606566075660856609566105661156612566135661456615566165661756618566195662056621566225662356624566255662656627566285662956630566315663256633566345663556636566375663856639566405664156642566435664456645566465664756648566495665056651566525665356654566555665656657566585665956660566615666256663566645666556666566675666856669566705667156672566735667456675566765667756678566795668056681566825668356684566855668656687566885668956690566915669256693566945669556696566975669856699567005670156702567035670456705567065670756708567095671056711567125671356714567155671656717567185671956720567215672256723567245672556726567275672856729567305673156732567335673456735567365673756738567395674056741567425674356744567455674656747567485674956750567515675256753567545675556756567575675856759567605676156762567635676456765567665676756768567695677056771567725677356774567755677656777567785677956780567815678256783567845678556786567875678856789567905679156792567935679456795567965679756798567995680056801568025680356804568055680656807568085680956810568115681256813568145681556816568175681856819568205682156822568235682456825568265682756828568295683056831568325683356834568355683656837568385683956840568415684256843568445684556846568475684856849568505685156852568535685456855568565685756858568595686056861568625686356864568655686656867568685686956870568715687256873568745687556876568775687856879568805688156882568835688456885568865688756888568895689056891568925689356894568955689656897568985689956900569015690256903569045690556906569075690856909569105691156912569135691456915569165691756918569195692056921569225692356924569255692656927569285692956930569315693256933569345693556936569375693856939569405694156942569435694456945569465694756948569495695056951569525695356954569555695656957569585695956960569615696256963569645696556966569675696856969569705697156972569735697456975569765697756978569795698056981569825698356984569855698656987569885698956990569915699256993569945699556996569975699856999570005700157002570035700457005570065700757008570095701057011570125701357014570155701657017570185701957020570215702257023570245702557026570275702857029570305703157032570335703457035570365703757038570395704057041570425704357044570455704657047570485704957050570515705257053570545705557056570575705857059570605706157062570635706457065570665706757068570695707057071570725707357074570755707657077570785707957080570815708257083570845708557086570875708857089570905709157092570935709457095570965709757098570995710057101571025710357104571055710657107571085710957110571115711257113571145711557116571175711857119571205712157122571235712457125571265712757128571295713057131571325713357134571355713657137571385713957140571415714257143571445714557146571475714857149571505715157152571535715457155571565715757158571595716057161571625716357164571655716657167571685716957170571715717257173571745717557176571775717857179571805718157182571835718457185571865718757188571895719057191571925719357194571955719657197571985719957200572015720257203572045720557206572075720857209572105721157212572135721457215572165721757218572195722057221572225722357224572255722657227572285722957230572315723257233572345723557236572375723857239572405724157242572435724457245572465724757248572495725057251572525725357254572555725657257572585725957260572615726257263572645726557266572675726857269572705727157272572735727457275572765727757278572795728057281572825728357284572855728657287572885728957290572915729257293572945729557296572975729857299573005730157302573035730457305573065730757308573095731057311573125731357314573155731657317573185731957320573215732257323573245732557326573275732857329573305733157332573335733457335573365733757338573395734057341573425734357344573455734657347573485734957350573515735257353573545735557356573575735857359573605736157362573635736457365573665736757368573695737057371573725737357374573755737657377573785737957380573815738257383573845738557386573875738857389573905739157392573935739457395573965739757398573995740057401574025740357404574055740657407574085740957410574115741257413574145741557416574175741857419574205742157422574235742457425574265742757428574295743057431574325743357434574355743657437574385743957440574415744257443574445744557446574475744857449574505745157452574535745457455574565745757458574595746057461574625746357464574655746657467574685746957470574715747257473574745747557476574775747857479574805748157482574835748457485574865748757488574895749057491574925749357494574955749657497574985749957500575015750257503575045750557506575075750857509575105751157512575135751457515575165751757518575195752057521575225752357524575255752657527575285752957530575315753257533575345753557536575375753857539575405754157542575435754457545575465754757548575495755057551575525755357554575555755657557575585755957560575615756257563575645756557566575675756857569575705757157572575735757457575575765757757578575795758057581575825758357584575855758657587575885758957590575915759257593575945759557596575975759857599576005760157602576035760457605576065760757608576095761057611576125761357614576155761657617576185761957620576215762257623576245762557626576275762857629576305763157632576335763457635576365763757638576395764057641576425764357644576455764657647576485764957650576515765257653576545765557656576575765857659576605766157662576635766457665576665766757668576695767057671576725767357674576755767657677576785767957680576815768257683576845768557686576875768857689576905769157692576935769457695576965769757698576995770057701577025770357704577055770657707577085770957710577115771257713577145771557716577175771857719577205772157722577235772457725577265772757728577295773057731577325773357734577355773657737577385773957740577415774257743577445774557746577475774857749577505775157752577535775457755577565775757758577595776057761577625776357764577655776657767577685776957770577715777257773577745777557776577775777857779577805778157782577835778457785577865778757788577895779057791577925779357794577955779657797577985779957800578015780257803578045780557806578075780857809578105781157812578135781457815578165781757818578195782057821578225782357824578255782657827578285782957830578315783257833578345783557836578375783857839578405784157842578435784457845578465784757848578495785057851578525785357854578555785657857578585785957860578615786257863578645786557866578675786857869578705787157872578735787457875578765787757878578795788057881578825788357884578855788657887578885788957890578915789257893578945789557896578975789857899579005790157902579035790457905579065790757908579095791057911579125791357914579155791657917579185791957920579215792257923579245792557926579275792857929579305793157932579335793457935579365793757938579395794057941579425794357944579455794657947579485794957950579515795257953579545795557956579575795857959579605796157962579635796457965579665796757968579695797057971579725797357974579755797657977579785797957980579815798257983579845798557986579875798857989579905799157992579935799457995579965799757998579995800058001580025800358004580055800658007580085800958010580115801258013580145801558016580175801858019580205802158022580235802458025580265802758028580295803058031580325803358034580355803658037580385803958040580415804258043580445804558046580475804858049580505805158052580535805458055580565805758058580595806058061580625806358064580655806658067580685806958070580715807258073580745807558076580775807858079580805808158082580835808458085580865808758088580895809058091580925809358094580955809658097580985809958100581015810258103581045810558106581075810858109581105811158112581135811458115581165811758118581195812058121581225812358124581255812658127581285812958130581315813258133581345813558136581375813858139581405814158142581435814458145581465814758148581495815058151581525815358154581555815658157581585815958160581615816258163581645816558166581675816858169581705817158172581735817458175581765817758178581795818058181581825818358184581855818658187581885818958190581915819258193581945819558196581975819858199582005820158202582035820458205582065820758208582095821058211582125821358214582155821658217582185821958220582215822258223582245822558226582275822858229582305823158232582335823458235582365823758238582395824058241582425824358244582455824658247582485824958250582515825258253582545825558256582575825858259582605826158262582635826458265582665826758268582695827058271582725827358274582755827658277582785827958280582815828258283582845828558286582875828858289582905829158292582935829458295582965829758298582995830058301583025830358304583055830658307583085830958310583115831258313583145831558316583175831858319583205832158322583235832458325583265832758328583295833058331583325833358334583355833658337583385833958340583415834258343583445834558346583475834858349583505835158352583535835458355583565835758358583595836058361583625836358364583655836658367583685836958370583715837258373583745837558376583775837858379583805838158382583835838458385583865838758388583895839058391583925839358394583955839658397583985839958400584015840258403584045840558406584075840858409584105841158412584135841458415584165841758418584195842058421584225842358424584255842658427584285842958430584315843258433584345843558436584375843858439584405844158442584435844458445584465844758448584495845058451584525845358454584555845658457584585845958460584615846258463584645846558466584675846858469584705847158472584735847458475584765847758478584795848058481584825848358484584855848658487584885848958490584915849258493584945849558496584975849858499585005850158502585035850458505585065850758508585095851058511585125851358514585155851658517585185851958520585215852258523585245852558526585275852858529585305853158532585335853458535585365853758538585395854058541585425854358544585455854658547585485854958550585515855258553585545855558556585575855858559585605856158562585635856458565585665856758568585695857058571585725857358574585755857658577585785857958580585815858258583585845858558586585875858858589585905859158592585935859458595585965859758598585995860058601586025860358604586055860658607586085860958610586115861258613586145861558616586175861858619586205862158622586235862458625586265862758628586295863058631586325863358634586355863658637586385863958640586415864258643586445864558646586475864858649586505865158652586535865458655586565865758658586595866058661586625866358664586655866658667586685866958670586715867258673586745867558676586775867858679586805868158682586835868458685586865868758688586895869058691586925869358694586955869658697586985869958700587015870258703587045870558706587075870858709587105871158712587135871458715587165871758718587195872058721587225872358724587255872658727587285872958730587315873258733587345873558736587375873858739587405874158742587435874458745587465874758748587495875058751587525875358754587555875658757587585875958760587615876258763587645876558766587675876858769587705877158772587735877458775587765877758778587795878058781587825878358784587855878658787587885878958790587915879258793587945879558796587975879858799588005880158802588035880458805588065880758808588095881058811588125881358814588155881658817588185881958820588215882258823588245882558826588275882858829588305883158832588335883458835588365883758838588395884058841588425884358844588455884658847588485884958850588515885258853588545885558856588575885858859588605886158862588635886458865588665886758868588695887058871588725887358874588755887658877588785887958880588815888258883588845888558886588875888858889588905889158892588935889458895588965889758898588995890058901589025890358904589055890658907589085890958910589115891258913589145891558916589175891858919589205892158922589235892458925589265892758928589295893058931589325893358934589355893658937589385893958940589415894258943589445894558946589475894858949589505895158952589535895458955589565895758958589595896058961589625896358964589655896658967589685896958970589715897258973589745897558976589775897858979589805898158982589835898458985589865898758988589895899058991589925899358994589955899658997589985899959000590015900259003590045900559006590075900859009590105901159012590135901459015590165901759018590195902059021590225902359024590255902659027590285902959030590315903259033590345903559036590375903859039590405904159042590435904459045590465904759048590495905059051590525905359054590555905659057590585905959060590615906259063590645906559066590675906859069590705907159072590735907459075590765907759078590795908059081590825908359084590855908659087590885908959090590915909259093590945909559096590975909859099591005910159102591035910459105591065910759108591095911059111591125911359114591155911659117591185911959120591215912259123591245912559126591275912859129591305913159132591335913459135591365913759138591395914059141591425914359144591455914659147591485914959150591515915259153591545915559156591575915859159591605916159162591635916459165591665916759168591695917059171591725917359174591755917659177591785917959180591815918259183591845918559186591875918859189591905919159192591935919459195591965919759198591995920059201592025920359204592055920659207592085920959210592115921259213592145921559216592175921859219592205922159222592235922459225592265922759228592295923059231592325923359234592355923659237592385923959240592415924259243592445924559246592475924859249592505925159252592535925459255592565925759258592595926059261592625926359264592655926659267592685926959270592715927259273592745927559276592775927859279592805928159282592835928459285592865928759288592895929059291592925929359294592955929659297592985929959300593015930259303593045930559306593075930859309593105931159312593135931459315593165931759318593195932059321593225932359324593255932659327593285932959330593315933259333593345933559336593375933859339593405934159342593435934459345593465934759348593495935059351593525935359354593555935659357593585935959360593615936259363593645936559366593675936859369593705937159372593735937459375593765937759378593795938059381593825938359384593855938659387593885938959390593915939259393593945939559396593975939859399594005940159402594035940459405594065940759408594095941059411594125941359414594155941659417594185941959420594215942259423594245942559426594275942859429594305943159432594335943459435594365943759438594395944059441594425944359444594455944659447594485944959450594515945259453594545945559456594575945859459594605946159462594635946459465594665946759468594695947059471594725947359474594755947659477594785947959480594815948259483594845948559486594875948859489594905949159492594935949459495594965949759498594995950059501595025950359504595055950659507595085950959510595115951259513595145951559516595175951859519595205952159522595235952459525595265952759528595295953059531595325953359534595355953659537595385953959540595415954259543595445954559546595475954859549595505955159552595535955459555595565955759558595595956059561595625956359564595655956659567595685956959570595715957259573595745957559576595775957859579595805958159582595835958459585595865958759588595895959059591595925959359594595955959659597595985959959600596015960259603596045960559606596075960859609596105961159612596135961459615596165961759618596195962059621596225962359624596255962659627596285962959630596315963259633596345963559636596375963859639596405964159642596435964459645596465964759648596495965059651596525965359654596555965659657596585965959660596615966259663596645966559666596675966859669596705967159672596735967459675596765967759678596795968059681596825968359684596855968659687596885968959690596915969259693596945969559696596975969859699597005970159702597035970459705597065970759708597095971059711597125971359714597155971659717597185971959720597215972259723597245972559726597275972859729597305973159732597335973459735597365973759738597395974059741597425974359744597455974659747597485974959750597515975259753597545975559756597575975859759597605976159762597635976459765597665976759768597695977059771597725977359774597755977659777597785977959780597815978259783597845978559786597875978859789597905979159792597935979459795597965979759798597995980059801598025980359804598055980659807598085980959810598115981259813598145981559816598175981859819598205982159822598235982459825598265982759828598295983059831598325983359834598355983659837598385983959840598415984259843598445984559846598475984859849598505985159852598535985459855598565985759858598595986059861598625986359864598655986659867598685986959870598715987259873598745987559876598775987859879598805988159882598835988459885598865988759888598895989059891598925989359894598955989659897598985989959900599015990259903599045990559906599075990859909599105991159912599135991459915599165991759918599195992059921599225992359924599255992659927599285992959930599315993259933599345993559936599375993859939599405994159942599435994459945599465994759948599495995059951599525995359954599555995659957599585995959960599615996259963599645996559966599675996859969599705997159972599735997459975599765997759978599795998059981599825998359984599855998659987599885998959990599915999259993599945999559996599975999859999600006000160002600036000460005600066000760008600096001060011600126001360014600156001660017600186001960020600216002260023600246002560026600276002860029600306003160032600336003460035600366003760038600396004060041600426004360044600456004660047600486004960050600516005260053600546005560056600576005860059600606006160062600636006460065600666006760068600696007060071600726007360074600756007660077600786007960080600816008260083600846008560086600876008860089600906009160092600936009460095600966009760098600996010060101601026010360104601056010660107601086010960110601116011260113601146011560116601176011860119601206012160122601236012460125601266012760128601296013060131601326013360134601356013660137601386013960140601416014260143601446014560146601476014860149601506015160152601536015460155601566015760158601596016060161601626016360164601656016660167601686016960170601716017260173601746017560176601776017860179601806018160182601836018460185601866018760188601896019060191601926019360194601956019660197601986019960200602016020260203602046020560206602076020860209602106021160212602136021460215602166021760218602196022060221602226022360224602256022660227602286022960230602316023260233602346023560236602376023860239602406024160242602436024460245602466024760248602496025060251602526025360254602556025660257602586025960260602616026260263602646026560266602676026860269602706027160272602736027460275602766027760278602796028060281602826028360284602856028660287602886028960290602916029260293602946029560296602976029860299603006030160302603036030460305603066030760308603096031060311603126031360314603156031660317603186031960320603216032260323603246032560326603276032860329603306033160332603336033460335603366033760338603396034060341603426034360344603456034660347603486034960350603516035260353603546035560356603576035860359603606036160362603636036460365603666036760368603696037060371603726037360374603756037660377603786037960380603816038260383603846038560386603876038860389603906039160392603936039460395603966039760398603996040060401604026040360404604056040660407604086040960410604116041260413604146041560416604176041860419604206042160422604236042460425604266042760428604296043060431604326043360434604356043660437604386043960440604416044260443604446044560446604476044860449604506045160452604536045460455604566045760458604596046060461604626046360464604656046660467604686046960470604716047260473604746047560476604776047860479604806048160482604836048460485604866048760488604896049060491604926049360494604956049660497604986049960500605016050260503605046050560506605076050860509605106051160512605136051460515605166051760518605196052060521605226052360524605256052660527605286052960530605316053260533605346053560536605376053860539605406054160542605436054460545605466054760548605496055060551605526055360554605556055660557605586055960560605616056260563605646056560566605676056860569605706057160572605736057460575605766057760578605796058060581605826058360584605856058660587605886058960590605916059260593605946059560596605976059860599606006060160602606036060460605606066060760608606096061060611606126061360614606156061660617606186061960620606216062260623606246062560626606276062860629606306063160632606336063460635606366063760638606396064060641606426064360644606456064660647606486064960650606516065260653606546065560656606576065860659606606066160662606636066460665606666066760668606696067060671606726067360674606756067660677606786067960680606816068260683606846068560686606876068860689606906069160692606936069460695606966069760698606996070060701607026070360704607056070660707607086070960710607116071260713607146071560716607176071860719607206072160722607236072460725607266072760728607296073060731607326073360734607356073660737607386073960740607416074260743607446074560746607476074860749607506075160752607536075460755607566075760758607596076060761607626076360764607656076660767607686076960770607716077260773607746077560776607776077860779607806078160782607836078460785607866078760788607896079060791607926079360794607956079660797607986079960800608016080260803608046080560806608076080860809608106081160812608136081460815608166081760818608196082060821608226082360824608256082660827608286082960830608316083260833608346083560836608376083860839608406084160842608436084460845608466084760848608496085060851608526085360854608556085660857608586085960860608616086260863608646086560866608676086860869608706087160872608736087460875608766087760878608796088060881608826088360884608856088660887608886088960890608916089260893608946089560896608976089860899609006090160902609036090460905609066090760908609096091060911609126091360914609156091660917609186091960920609216092260923609246092560926609276092860929609306093160932609336093460935609366093760938609396094060941609426094360944609456094660947609486094960950609516095260953609546095560956609576095860959609606096160962609636096460965609666096760968609696097060971609726097360974609756097660977609786097960980609816098260983609846098560986609876098860989609906099160992609936099460995609966099760998609996100061001610026100361004610056100661007610086100961010610116101261013610146101561016610176101861019610206102161022610236102461025610266102761028610296103061031610326103361034610356103661037610386103961040610416104261043610446104561046610476104861049610506105161052610536105461055610566105761058610596106061061610626106361064610656106661067610686106961070610716107261073610746107561076610776107861079610806108161082610836108461085610866108761088610896109061091610926109361094610956109661097610986109961100611016110261103611046110561106611076110861109611106111161112611136111461115611166111761118611196112061121611226112361124611256112661127611286112961130611316113261133611346113561136611376113861139611406114161142611436114461145611466114761148611496115061151611526115361154611556115661157611586115961160611616116261163611646116561166611676116861169611706117161172611736117461175611766117761178611796118061181611826118361184611856118661187611886118961190611916119261193611946119561196611976119861199612006120161202612036120461205612066120761208612096121061211612126121361214612156121661217612186121961220612216122261223612246122561226612276122861229612306123161232612336123461235612366123761238612396124061241612426124361244612456124661247612486124961250612516125261253612546125561256612576125861259612606126161262612636126461265612666126761268612696127061271612726127361274612756127661277612786127961280612816128261283612846128561286612876128861289612906129161292612936129461295612966129761298612996130061301613026130361304613056130661307613086130961310613116131261313613146131561316613176131861319613206132161322613236132461325613266132761328613296133061331613326133361334613356133661337613386133961340613416134261343613446134561346613476134861349613506135161352613536135461355613566135761358613596136061361613626136361364613656136661367613686136961370613716137261373613746137561376613776137861379613806138161382613836138461385613866138761388613896139061391613926139361394613956139661397613986139961400614016140261403614046140561406614076140861409614106141161412614136141461415614166141761418614196142061421614226142361424614256142661427614286142961430614316143261433614346143561436614376143861439614406144161442614436144461445614466144761448614496145061451614526145361454614556145661457614586145961460614616146261463614646146561466614676146861469614706147161472614736147461475614766147761478614796148061481614826148361484614856148661487614886148961490614916149261493614946149561496614976149861499615006150161502615036150461505615066150761508615096151061511615126151361514615156151661517615186151961520615216152261523615246152561526615276152861529615306153161532615336153461535615366153761538615396154061541615426154361544615456154661547615486154961550615516155261553615546155561556615576155861559615606156161562615636156461565615666156761568615696157061571615726157361574615756157661577615786157961580615816158261583615846158561586615876158861589615906159161592615936159461595615966159761598615996160061601616026160361604616056160661607616086160961610616116161261613616146161561616616176161861619616206162161622616236162461625616266162761628616296163061631616326163361634616356163661637616386163961640616416164261643616446164561646616476164861649616506165161652616536165461655616566165761658616596166061661616626166361664616656166661667616686166961670616716167261673616746167561676616776167861679616806168161682616836168461685616866168761688616896169061691616926169361694616956169661697616986169961700617016170261703617046170561706617076170861709617106171161712617136171461715617166171761718617196172061721617226172361724617256172661727617286172961730617316173261733617346173561736617376173861739617406174161742617436174461745617466174761748617496175061751617526175361754617556175661757617586175961760617616176261763617646176561766617676176861769617706177161772617736177461775617766177761778617796178061781617826178361784617856178661787617886178961790617916179261793617946179561796617976179861799618006180161802618036180461805618066180761808618096181061811618126181361814618156181661817618186181961820618216182261823618246182561826618276182861829618306183161832618336183461835618366183761838618396184061841618426184361844618456184661847618486184961850618516185261853618546185561856618576185861859618606186161862618636186461865618666186761868618696187061871618726187361874618756187661877618786187961880618816188261883618846188561886618876188861889618906189161892618936189461895618966189761898618996190061901619026190361904619056190661907619086190961910619116191261913619146191561916619176191861919619206192161922619236192461925619266192761928619296193061931619326193361934619356193661937619386193961940619416194261943619446194561946619476194861949619506195161952619536195461955619566195761958619596196061961619626196361964619656196661967619686196961970619716197261973619746197561976619776197861979619806198161982619836198461985619866198761988619896199061991619926199361994619956199661997619986199962000620016200262003620046200562006620076200862009620106201162012620136201462015620166201762018620196202062021620226202362024620256202662027620286202962030620316203262033620346203562036620376203862039620406204162042620436204462045620466204762048620496205062051620526205362054620556205662057620586205962060620616206262063620646206562066620676206862069620706207162072620736207462075620766207762078620796208062081620826208362084620856208662087620886208962090620916209262093620946209562096620976209862099621006210162102621036210462105621066210762108621096211062111621126211362114621156211662117621186211962120621216212262123621246212562126621276212862129621306213162132621336213462135621366213762138621396214062141621426214362144621456214662147621486214962150621516215262153621546215562156621576215862159621606216162162621636216462165621666216762168621696217062171621726217362174621756217662177621786217962180621816218262183621846218562186621876218862189621906219162192621936219462195621966219762198621996220062201622026220362204622056220662207622086220962210622116221262213622146221562216622176221862219622206222162222622236222462225622266222762228622296223062231622326223362234622356223662237622386223962240622416224262243622446224562246622476224862249622506225162252622536225462255622566225762258622596226062261622626226362264622656226662267622686226962270622716227262273622746227562276622776227862279622806228162282622836228462285622866228762288622896229062291622926229362294622956229662297622986229962300623016230262303623046230562306623076230862309623106231162312623136231462315623166231762318623196232062321623226232362324623256232662327623286232962330623316233262333623346233562336623376233862339623406234162342623436234462345623466234762348623496235062351623526235362354623556235662357623586235962360623616236262363623646236562366623676236862369623706237162372623736237462375623766237762378623796238062381623826238362384623856238662387623886238962390623916239262393623946239562396623976239862399624006240162402624036240462405624066240762408624096241062411624126241362414624156241662417624186241962420624216242262423624246242562426624276242862429624306243162432624336243462435624366243762438624396244062441624426244362444624456244662447624486244962450624516245262453624546245562456624576245862459624606246162462624636246462465624666246762468624696247062471624726247362474624756247662477624786247962480624816248262483624846248562486624876248862489624906249162492624936249462495624966249762498624996250062501625026250362504625056250662507625086250962510625116251262513625146251562516625176251862519625206252162522625236252462525625266252762528625296253062531625326253362534625356253662537625386253962540625416254262543625446254562546625476254862549625506255162552625536255462555625566255762558625596256062561625626256362564625656256662567625686256962570625716257262573625746257562576625776257862579625806258162582625836258462585625866258762588625896259062591625926259362594625956259662597625986259962600626016260262603626046260562606626076260862609626106261162612626136261462615626166261762618626196262062621626226262362624626256262662627626286262962630626316263262633626346263562636626376263862639626406264162642626436264462645626466264762648626496265062651626526265362654626556265662657626586265962660626616266262663626646266562666626676266862669626706267162672626736267462675626766267762678626796268062681626826268362684626856268662687626886268962690626916269262693626946269562696626976269862699627006270162702627036270462705627066270762708627096271062711627126271362714627156271662717627186271962720627216272262723627246272562726627276272862729627306273162732627336273462735627366273762738627396274062741627426274362744627456274662747627486274962750627516275262753627546275562756627576275862759627606276162762627636276462765627666276762768627696277062771627726277362774627756277662777627786277962780627816278262783627846278562786627876278862789627906279162792627936279462795627966279762798627996280062801628026280362804628056280662807628086280962810628116281262813628146281562816628176281862819628206282162822628236282462825628266282762828628296283062831628326283362834628356283662837628386283962840628416284262843628446284562846628476284862849628506285162852628536285462855628566285762858628596286062861628626286362864628656286662867628686286962870628716287262873628746287562876628776287862879628806288162882628836288462885628866288762888628896289062891628926289362894628956289662897628986289962900629016290262903629046290562906629076290862909629106291162912629136291462915629166291762918629196292062921629226292362924629256292662927629286292962930629316293262933629346293562936629376293862939629406294162942629436294462945629466294762948629496295062951629526295362954629556295662957629586295962960629616296262963629646296562966629676296862969629706297162972629736297462975629766297762978629796298062981629826298362984629856298662987629886298962990629916299262993629946299562996629976299862999630006300163002630036300463005630066300763008630096301063011630126301363014630156301663017630186301963020630216302263023630246302563026630276302863029630306303163032630336303463035630366303763038630396304063041630426304363044630456304663047630486304963050630516305263053630546305563056630576305863059630606306163062630636306463065630666306763068630696307063071630726307363074630756307663077630786307963080630816308263083630846308563086630876308863089630906309163092630936309463095630966309763098630996310063101631026310363104631056310663107631086310963110631116311263113631146311563116631176311863119631206312163122631236312463125631266312763128631296313063131631326313363134631356313663137631386313963140631416314263143631446314563146631476314863149631506315163152631536315463155631566315763158631596316063161631626316363164631656316663167631686316963170631716317263173631746317563176631776317863179631806318163182631836318463185631866318763188631896319063191631926319363194631956319663197631986319963200632016320263203632046320563206632076320863209632106321163212632136321463215632166321763218632196322063221632226322363224632256322663227632286322963230632316323263233632346323563236632376323863239632406324163242632436324463245632466324763248632496325063251632526325363254632556325663257632586325963260632616326263263632646326563266632676326863269632706327163272632736327463275632766327763278632796328063281632826328363284632856328663287632886328963290632916329263293632946329563296632976329863299633006330163302633036330463305633066330763308633096331063311633126331363314633156331663317633186331963320633216332263323633246332563326633276332863329633306333163332633336333463335633366333763338633396334063341633426334363344633456334663347633486334963350633516335263353633546335563356633576335863359633606336163362633636336463365633666336763368633696337063371633726337363374633756337663377633786337963380633816338263383633846338563386633876338863389633906339163392633936339463395633966339763398633996340063401634026340363404634056340663407634086340963410634116341263413634146341563416634176341863419634206342163422634236342463425634266342763428634296343063431634326343363434634356343663437634386343963440634416344263443634446344563446634476344863449634506345163452634536345463455634566345763458634596346063461634626346363464634656346663467634686346963470634716347263473634746347563476634776347863479634806348163482634836348463485634866348763488634896349063491634926349363494634956349663497634986349963500635016350263503635046350563506635076350863509635106351163512635136351463515635166351763518635196352063521635226352363524635256352663527635286352963530635316353263533635346353563536635376353863539635406354163542635436354463545635466354763548635496355063551635526355363554635556355663557635586355963560635616356263563635646356563566635676356863569635706357163572635736357463575635766357763578635796358063581635826358363584635856358663587635886358963590635916359263593635946359563596635976359863599636006360163602636036360463605636066360763608636096361063611636126361363614636156361663617636186361963620636216362263623636246362563626636276362863629636306363163632636336363463635636366363763638636396364063641636426364363644636456364663647636486364963650636516365263653636546365563656636576365863659636606366163662636636366463665636666366763668636696367063671636726367363674636756367663677636786367963680636816368263683636846368563686636876368863689636906369163692636936369463695636966369763698636996370063701637026370363704637056370663707637086370963710637116371263713637146371563716637176371863719637206372163722637236372463725637266372763728637296373063731637326373363734637356373663737637386373963740637416374263743637446374563746637476374863749637506375163752637536375463755637566375763758637596376063761637626376363764637656376663767637686376963770637716377263773637746377563776637776377863779637806378163782637836378463785637866378763788637896379063791637926379363794637956379663797637986379963800638016380263803638046380563806638076380863809638106381163812638136381463815638166381763818638196382063821638226382363824638256382663827638286382963830638316383263833638346383563836638376383863839638406384163842638436384463845638466384763848638496385063851638526385363854638556385663857638586385963860638616386263863638646386563866638676386863869638706387163872638736387463875638766387763878638796388063881638826388363884638856388663887638886388963890638916389263893638946389563896638976389863899639006390163902639036390463905639066390763908639096391063911639126391363914639156391663917639186391963920639216392263923639246392563926639276392863929639306393163932639336393463935639366393763938639396394063941639426394363944639456394663947639486394963950639516395263953639546395563956639576395863959639606396163962639636396463965639666396763968639696397063971639726397363974639756397663977639786397963980639816398263983639846398563986639876398863989639906399163992639936399463995639966399763998639996400064001640026400364004640056400664007640086400964010640116401264013640146401564016640176401864019640206402164022640236402464025640266402764028640296403064031640326403364034640356403664037640386403964040640416404264043640446404564046640476404864049640506405164052640536405464055640566405764058640596406064061640626406364064640656406664067640686406964070640716407264073640746407564076640776407864079640806408164082640836408464085640866408764088640896409064091640926409364094640956409664097640986409964100641016410264103641046410564106641076410864109641106411164112641136411464115641166411764118641196412064121641226412364124641256412664127641286412964130641316413264133641346413564136641376413864139641406414164142641436414464145641466414764148641496415064151641526415364154641556415664157641586415964160641616416264163641646416564166641676416864169641706417164172641736417464175641766417764178641796418064181641826418364184641856418664187641886418964190641916419264193641946419564196641976419864199642006420164202642036420464205642066420764208642096421064211642126421364214642156421664217642186421964220642216422264223642246422564226642276422864229642306423164232642336423464235642366423764238642396424064241642426424364244642456424664247642486424964250642516425264253642546425564256642576425864259642606426164262642636426464265642666426764268642696427064271642726427364274642756427664277642786427964280642816428264283642846428564286642876428864289642906429164292642936429464295642966429764298642996430064301643026430364304643056430664307643086430964310643116431264313643146431564316643176431864319643206432164322643236432464325643266432764328643296433064331643326433364334643356433664337643386433964340643416434264343643446434564346643476434864349643506435164352643536435464355643566435764358643596436064361643626436364364643656436664367643686436964370643716437264373643746437564376643776437864379643806438164382643836438464385643866438764388643896439064391643926439364394643956439664397643986439964400644016440264403644046440564406644076440864409644106441164412644136441464415644166441764418644196442064421644226442364424644256442664427644286442964430644316443264433644346443564436644376443864439644406444164442644436444464445644466444764448644496445064451644526445364454644556445664457644586445964460644616446264463644646446564466644676446864469644706447164472644736447464475644766447764478644796448064481644826448364484644856448664487644886448964490644916449264493644946449564496644976449864499645006450164502645036450464505645066450764508645096451064511645126451364514645156451664517645186451964520645216452264523645246452564526645276452864529645306453164532645336453464535645366453764538645396454064541645426454364544645456454664547645486454964550645516455264553645546455564556645576455864559645606456164562645636456464565645666456764568645696457064571645726457364574645756457664577645786457964580645816458264583645846458564586645876458864589645906459164592645936459464595645966459764598645996460064601646026460364604646056460664607646086460964610646116461264613646146461564616646176461864619646206462164622646236462464625646266462764628646296463064631646326463364634646356463664637646386463964640646416464264643646446464564646646476464864649646506465164652646536465464655646566465764658646596466064661646626466364664646656466664667646686466964670646716467264673646746467564676646776467864679646806468164682646836468464685646866468764688646896469064691646926469364694646956469664697646986469964700647016470264703647046470564706647076470864709647106471164712647136471464715647166471764718647196472064721647226472364724647256472664727647286472964730647316473264733647346473564736647376473864739647406474164742647436474464745647466474764748647496475064751647526475364754647556475664757647586475964760647616476264763647646476564766647676476864769647706477164772647736477464775647766477764778647796478064781647826478364784647856478664787647886478964790647916479264793647946479564796647976479864799648006480164802648036480464805648066480764808648096481064811648126481364814648156481664817648186481964820648216482264823648246482564826648276482864829648306483164832648336483464835648366483764838648396484064841648426484364844648456484664847648486484964850648516485264853648546485564856648576485864859648606486164862648636486464865648666486764868648696487064871648726487364874648756487664877648786487964880648816488264883648846488564886648876488864889648906489164892648936489464895648966489764898648996490064901649026490364904649056490664907649086490964910649116491264913649146491564916649176491864919649206492164922649236492464925649266492764928649296493064931649326493364934649356493664937649386493964940649416494264943649446494564946649476494864949649506495164952649536495464955649566495764958649596496064961649626496364964649656496664967649686496964970649716497264973649746497564976649776497864979649806498164982649836498464985649866498764988649896499064991649926499364994649956499664997649986499965000650016500265003650046500565006650076500865009650106501165012650136501465015650166501765018650196502065021650226502365024650256502665027650286502965030650316503265033650346503565036650376503865039650406504165042650436504465045650466504765048650496505065051650526505365054650556505665057650586505965060650616506265063650646506565066650676506865069650706507165072650736507465075650766507765078650796508065081650826508365084650856508665087650886508965090650916509265093650946509565096650976509865099651006510165102651036510465105651066510765108651096511065111651126511365114651156511665117651186511965120651216512265123651246512565126651276512865129651306513165132651336513465135651366513765138651396514065141651426514365144651456514665147651486514965150651516515265153651546515565156651576515865159651606516165162651636516465165651666516765168651696517065171651726517365174651756517665177651786517965180651816518265183651846518565186651876518865189651906519165192651936519465195651966519765198651996520065201652026520365204652056520665207652086520965210652116521265213652146521565216652176521865219652206522165222652236522465225652266522765228652296523065231652326523365234652356523665237652386523965240652416524265243652446524565246652476524865249652506525165252652536525465255652566525765258652596526065261652626526365264652656526665267652686526965270652716527265273652746527565276652776527865279652806528165282652836528465285652866528765288652896529065291652926529365294652956529665297652986529965300653016530265303653046530565306653076530865309653106531165312653136531465315653166531765318653196532065321653226532365324653256532665327653286532965330653316533265333653346533565336653376533865339653406534165342653436534465345653466534765348653496535065351653526535365354653556535665357653586535965360653616536265363653646536565366653676536865369653706537165372653736537465375653766537765378653796538065381653826538365384653856538665387653886538965390653916539265393653946539565396653976539865399654006540165402654036540465405654066540765408654096541065411654126541365414654156541665417654186541965420654216542265423654246542565426654276542865429654306543165432654336543465435654366543765438654396544065441654426544365444654456544665447654486544965450654516545265453654546545565456654576545865459654606546165462654636546465465654666546765468654696547065471654726547365474654756547665477654786547965480654816548265483654846548565486654876548865489654906549165492654936549465495654966549765498654996550065501655026550365504655056550665507655086550965510655116551265513655146551565516655176551865519655206552165522655236552465525655266552765528655296553065531655326553365534655356553665537655386553965540655416554265543655446554565546655476554865549655506555165552655536555465555655566555765558655596556065561655626556365564655656556665567655686556965570655716557265573655746557565576655776557865579655806558165582655836558465585655866558765588655896559065591655926559365594655956559665597655986559965600656016560265603656046560565606656076560865609656106561165612656136561465615656166561765618656196562065621656226562365624656256562665627656286562965630656316563265633656346563565636656376563865639656406564165642656436564465645656466564765648656496565065651656526565365654656556565665657656586565965660656616566265663656646566565666656676566865669656706567165672656736567465675656766567765678656796568065681656826568365684656856568665687656886568965690656916569265693656946569565696656976569865699657006570165702657036570465705657066570765708657096571065711657126571365714657156571665717657186571965720657216572265723657246572565726657276572865729657306573165732657336573465735657366573765738657396574065741657426574365744657456574665747657486574965750657516575265753657546575565756657576575865759657606576165762657636576465765657666576765768657696577065771657726577365774657756577665777657786577965780657816578265783657846578565786657876578865789657906579165792657936579465795657966579765798657996580065801658026580365804658056580665807658086580965810658116581265813658146581565816658176581865819658206582165822658236582465825658266582765828658296583065831658326583365834658356583665837658386583965840658416584265843658446584565846658476584865849658506585165852658536585465855658566585765858658596586065861658626586365864658656586665867658686586965870658716587265873658746587565876658776587865879658806588165882658836588465885658866588765888658896589065891658926589365894658956589665897658986589965900659016590265903659046590565906659076590865909659106591165912659136591465915659166591765918659196592065921659226592365924659256592665927659286592965930659316593265933659346593565936659376593865939659406594165942659436594465945659466594765948659496595065951659526595365954659556595665957659586595965960659616596265963659646596565966659676596865969659706597165972659736597465975659766597765978659796598065981659826598365984659856598665987659886598965990659916599265993659946599565996659976599865999660006600166002660036600466005660066600766008660096601066011660126601366014660156601666017660186601966020660216602266023660246602566026660276602866029660306603166032660336603466035660366603766038660396604066041660426604366044660456604666047660486604966050660516605266053660546605566056660576605866059660606606166062660636606466065660666606766068660696607066071660726607366074660756607666077660786607966080660816608266083660846608566086660876608866089660906609166092660936609466095660966609766098660996610066101661026610366104661056610666107661086610966110661116611266113661146611566116661176611866119661206612166122661236612466125661266612766128661296613066131661326613366134661356613666137661386613966140661416614266143661446614566146661476614866149661506615166152661536615466155661566615766158661596616066161661626616366164661656616666167661686616966170661716617266173661746617566176661776617866179661806618166182661836618466185661866618766188661896619066191661926619366194661956619666197661986619966200662016620266203662046620566206662076620866209662106621166212662136621466215662166621766218662196622066221662226622366224662256622666227662286622966230662316623266233662346623566236662376623866239662406624166242662436624466245662466624766248662496625066251662526625366254662556625666257662586625966260662616626266263662646626566266662676626866269662706627166272662736627466275662766627766278662796628066281662826628366284662856628666287662886628966290662916629266293662946629566296662976629866299663006630166302663036630466305663066630766308663096631066311663126631366314663156631666317663186631966320663216632266323663246632566326663276632866329663306633166332663336633466335663366633766338663396634066341663426634366344663456634666347663486634966350663516635266353663546635566356663576635866359663606636166362663636636466365663666636766368663696637066371663726637366374663756637666377663786637966380663816638266383663846638566386663876638866389663906639166392663936639466395663966639766398663996640066401664026640366404664056640666407664086640966410664116641266413664146641566416664176641866419664206642166422664236642466425664266642766428664296643066431664326643366434664356643666437664386643966440664416644266443664446644566446664476644866449664506645166452664536645466455664566645766458664596646066461664626646366464664656646666467664686646966470664716647266473664746647566476664776647866479664806648166482664836648466485664866648766488664896649066491664926649366494664956649666497664986649966500665016650266503665046650566506665076650866509665106651166512665136651466515665166651766518665196652066521665226652366524665256652666527665286652966530665316653266533665346653566536665376653866539665406654166542665436654466545665466654766548665496655066551665526655366554665556655666557665586655966560665616656266563665646656566566665676656866569665706657166572665736657466575665766657766578665796658066581665826658366584665856658666587665886658966590665916659266593665946659566596665976659866599666006660166602666036660466605666066660766608666096661066611666126661366614666156661666617666186661966620666216662266623666246662566626666276662866629666306663166632666336663466635666366663766638666396664066641666426664366644666456664666647666486664966650666516665266653666546665566656666576665866659666606666166662666636666466665666666666766668666696667066671666726667366674666756667666677666786667966680666816668266683666846668566686666876668866689666906669166692666936669466695666966669766698666996670066701667026670366704667056670666707667086670966710667116671266713667146671566716667176671866719667206672166722667236672466725667266672766728667296673066731667326673366734667356673666737667386673966740667416674266743667446674566746667476674866749667506675166752667536675466755667566675766758667596676066761667626676366764667656676666767667686676966770667716677266773667746677566776667776677866779667806678166782667836678466785667866678766788667896679066791667926679366794667956679666797667986679966800668016680266803668046680566806668076680866809668106681166812668136681466815668166681766818668196682066821668226682366824668256682666827668286682966830668316683266833668346683566836668376683866839668406684166842668436684466845668466684766848668496685066851668526685366854668556685666857668586685966860668616686266863668646686566866668676686866869668706687166872668736687466875668766687766878668796688066881668826688366884668856688666887668886688966890668916689266893668946689566896668976689866899669006690166902669036690466905669066690766908669096691066911669126691366914669156691666917669186691966920669216692266923669246692566926669276692866929669306693166932669336693466935669366693766938669396694066941669426694366944669456694666947669486694966950669516695266953669546695566956669576695866959669606696166962669636696466965669666696766968669696697066971669726697366974669756697666977669786697966980669816698266983669846698566986669876698866989669906699166992669936699466995669966699766998669996700067001670026700367004670056700667007670086700967010670116701267013670146701567016670176701867019670206702167022670236702467025670266702767028670296703067031670326703367034670356703667037670386703967040670416704267043670446704567046670476704867049670506705167052670536705467055670566705767058670596706067061670626706367064670656706667067670686706967070670716707267073670746707567076670776707867079670806708167082670836708467085670866708767088670896709067091670926709367094670956709667097670986709967100671016710267103671046710567106671076710867109671106711167112671136711467115671166711767118671196712067121671226712367124671256712667127671286712967130671316713267133671346713567136671376713867139671406714167142671436714467145671466714767148671496715067151671526715367154671556715667157671586715967160671616716267163671646716567166671676716867169671706717167172671736717467175671766717767178671796718067181671826718367184671856718667187671886718967190671916719267193671946719567196671976719867199672006720167202672036720467205672066720767208672096721067211672126721367214672156721667217672186721967220672216722267223672246722567226672276722867229672306723167232672336723467235672366723767238672396724067241672426724367244672456724667247672486724967250672516725267253672546725567256672576725867259672606726167262672636726467265672666726767268672696727067271672726727367274672756727667277672786727967280672816728267283672846728567286672876728867289672906729167292672936729467295672966729767298672996730067301673026730367304673056730667307673086730967310673116731267313673146731567316673176731867319673206732167322673236732467325673266732767328673296733067331673326733367334673356733667337673386733967340673416734267343673446734567346673476734867349673506735167352673536735467355673566735767358673596736067361673626736367364673656736667367673686736967370673716737267373673746737567376673776737867379673806738167382673836738467385673866738767388673896739067391673926739367394673956739667397673986739967400674016740267403674046740567406674076740867409674106741167412674136741467415674166741767418674196742067421674226742367424674256742667427674286742967430674316743267433674346743567436674376743867439674406744167442674436744467445674466744767448674496745067451674526745367454674556745667457674586745967460674616746267463674646746567466674676746867469674706747167472674736747467475674766747767478674796748067481674826748367484674856748667487674886748967490674916749267493674946749567496674976749867499675006750167502675036750467505675066750767508675096751067511675126751367514675156751667517675186751967520675216752267523675246752567526675276752867529675306753167532675336753467535675366753767538675396754067541675426754367544675456754667547675486754967550675516755267553675546755567556675576755867559675606756167562675636756467565675666756767568675696757067571675726757367574675756757667577675786757967580675816758267583675846758567586675876758867589675906759167592675936759467595675966759767598675996760067601676026760367604676056760667607676086760967610676116761267613676146761567616676176761867619676206762167622676236762467625676266762767628676296763067631676326763367634676356763667637676386763967640676416764267643676446764567646676476764867649676506765167652676536765467655676566765767658676596766067661676626766367664676656766667667676686766967670676716767267673676746767567676676776767867679676806768167682676836768467685676866768767688676896769067691676926769367694676956769667697676986769967700677016770267703677046770567706677076770867709677106771167712677136771467715677166771767718677196772067721677226772367724677256772667727677286772967730677316773267733677346773567736677376773867739677406774167742677436774467745677466774767748677496775067751677526775367754677556775667757677586775967760677616776267763677646776567766677676776867769677706777167772677736777467775677766777767778677796778067781677826778367784677856778667787677886778967790677916779267793677946779567796677976779867799678006780167802678036780467805678066780767808678096781067811678126781367814678156781667817678186781967820678216782267823678246782567826678276782867829678306783167832678336783467835678366783767838678396784067841678426784367844678456784667847678486784967850678516785267853678546785567856678576785867859678606786167862678636786467865678666786767868678696787067871678726787367874678756787667877678786787967880678816788267883678846788567886678876788867889678906789167892678936789467895678966789767898678996790067901679026790367904679056790667907679086790967910679116791267913679146791567916679176791867919679206792167922679236792467925679266792767928679296793067931679326793367934679356793667937679386793967940679416794267943679446794567946679476794867949679506795167952679536795467955679566795767958679596796067961679626796367964679656796667967679686796967970679716797267973679746797567976679776797867979679806798167982679836798467985679866798767988679896799067991679926799367994679956799667997679986799968000680016800268003680046800568006680076800868009680106801168012680136801468015680166801768018680196802068021680226802368024680256802668027680286802968030680316803268033680346803568036680376803868039680406804168042680436804468045680466804768048680496805068051680526805368054680556805668057680586805968060680616806268063680646806568066680676806868069680706807168072680736807468075680766807768078680796808068081680826808368084680856808668087680886808968090680916809268093680946809568096680976809868099681006810168102681036810468105681066810768108681096811068111681126811368114681156811668117681186811968120681216812268123681246812568126681276812868129681306813168132681336813468135681366813768138681396814068141681426814368144681456814668147681486814968150681516815268153681546815568156681576815868159681606816168162681636816468165681666816768168681696817068171681726817368174681756817668177681786817968180681816818268183681846818568186681876818868189681906819168192681936819468195681966819768198681996820068201682026820368204682056820668207682086820968210682116821268213682146821568216682176821868219682206822168222682236822468225682266822768228682296823068231682326823368234682356823668237682386823968240682416824268243682446824568246682476824868249682506825168252682536825468255682566825768258682596826068261682626826368264682656826668267682686826968270682716827268273682746827568276682776827868279682806828168282682836828468285682866828768288682896829068291682926829368294682956829668297682986829968300683016830268303683046830568306683076830868309683106831168312683136831468315683166831768318683196832068321683226832368324683256832668327683286832968330683316833268333683346833568336683376833868339683406834168342683436834468345683466834768348683496835068351683526835368354683556835668357683586835968360683616836268363683646836568366683676836868369683706837168372683736837468375683766837768378683796838068381683826838368384683856838668387683886838968390683916839268393683946839568396683976839868399684006840168402684036840468405684066840768408684096841068411684126841368414684156841668417684186841968420684216842268423684246842568426684276842868429684306843168432684336843468435684366843768438684396844068441684426844368444684456844668447684486844968450684516845268453684546845568456684576845868459684606846168462684636846468465684666846768468684696847068471684726847368474684756847668477684786847968480684816848268483684846848568486684876848868489684906849168492684936849468495684966849768498684996850068501685026850368504685056850668507685086850968510685116851268513685146851568516685176851868519685206852168522685236852468525685266852768528685296853068531685326853368534685356853668537685386853968540685416854268543685446854568546685476854868549685506855168552685536855468555685566855768558685596856068561685626856368564685656856668567685686856968570685716857268573685746857568576685776857868579685806858168582685836858468585685866858768588685896859068591685926859368594685956859668597685986859968600686016860268603686046860568606686076860868609686106861168612686136861468615686166861768618686196862068621686226862368624686256862668627686286862968630686316863268633686346863568636686376863868639686406864168642686436864468645686466864768648686496865068651686526865368654686556865668657686586865968660686616866268663686646866568666686676866868669686706867168672686736867468675686766867768678686796868068681686826868368684686856868668687686886868968690686916869268693686946869568696686976869868699687006870168702687036870468705687066870768708687096871068711687126871368714687156871668717687186871968720687216872268723687246872568726687276872868729687306873168732687336873468735687366873768738687396874068741687426874368744687456874668747687486874968750687516875268753687546875568756687576875868759687606876168762687636876468765687666876768768687696877068771687726877368774687756877668777687786877968780687816878268783687846878568786687876878868789687906879168792687936879468795687966879768798687996880068801688026880368804688056880668807688086880968810688116881268813688146881568816688176881868819688206882168822688236882468825688266882768828688296883068831688326883368834688356883668837688386883968840688416884268843688446884568846688476884868849688506885168852688536885468855688566885768858688596886068861688626886368864688656886668867688686886968870688716887268873688746887568876688776887868879688806888168882688836888468885688866888768888688896889068891688926889368894688956889668897688986889968900689016890268903689046890568906689076890868909689106891168912689136891468915689166891768918689196892068921689226892368924689256892668927689286892968930689316893268933689346893568936689376893868939689406894168942689436894468945689466894768948689496895068951689526895368954689556895668957689586895968960689616896268963689646896568966689676896868969689706897168972689736897468975689766897768978689796898068981689826898368984689856898668987689886898968990689916899268993689946899568996689976899868999690006900169002690036900469005690066900769008690096901069011690126901369014690156901669017690186901969020690216902269023690246902569026690276902869029690306903169032690336903469035690366903769038690396904069041690426904369044690456904669047690486904969050690516905269053690546905569056690576905869059690606906169062690636906469065690666906769068690696907069071690726907369074690756907669077690786907969080690816908269083690846908569086690876908869089690906909169092690936909469095690966909769098690996910069101691026910369104691056910669107691086910969110691116911269113691146911569116691176911869119691206912169122691236912469125691266912769128691296913069131691326913369134691356913669137691386913969140691416914269143691446914569146691476914869149691506915169152691536915469155691566915769158691596916069161691626916369164691656916669167691686916969170691716917269173691746917569176691776917869179691806918169182691836918469185691866918769188691896919069191691926919369194691956919669197691986919969200692016920269203692046920569206692076920869209692106921169212692136921469215692166921769218692196922069221692226922369224692256922669227692286922969230692316923269233692346923569236692376923869239692406924169242692436924469245692466924769248692496925069251692526925369254692556925669257692586925969260692616926269263692646926569266692676926869269692706927169272692736927469275692766927769278692796928069281692826928369284692856928669287692886928969290692916929269293692946929569296692976929869299693006930169302693036930469305693066930769308693096931069311693126931369314693156931669317693186931969320693216932269323693246932569326693276932869329693306933169332693336933469335693366933769338693396934069341693426934369344693456934669347693486934969350693516935269353693546935569356693576935869359693606936169362693636936469365693666936769368693696937069371693726937369374693756937669377693786937969380693816938269383693846938569386693876938869389693906939169392693936939469395693966939769398693996940069401694026940369404694056940669407694086940969410694116941269413694146941569416694176941869419694206942169422694236942469425694266942769428694296943069431694326943369434694356943669437694386943969440694416944269443694446944569446694476944869449694506945169452694536945469455694566945769458694596946069461694626946369464694656946669467694686946969470694716947269473694746947569476694776947869479694806948169482694836948469485694866948769488694896949069491694926949369494694956949669497694986949969500695016950269503695046950569506695076950869509695106951169512695136951469515695166951769518695196952069521695226952369524695256952669527695286952969530695316953269533695346953569536695376953869539695406954169542
  1. /*! pdfmake v0.1.65, @license MIT, @link http://pdfmake.org */
  2. (function webpackUniversalModuleDefinition(root, factory) {
  3. if(typeof exports === 'object' && typeof module === 'object')
  4. module.exports = factory();
  5. else if(typeof define === 'function' && define.amd)
  6. define([], factory);
  7. else {
  8. var a = factory();
  9. for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
  10. }
  11. })(typeof self !== 'undefined' ? self : this, function() {
  12. return /******/ (function(modules) { // webpackBootstrap
  13. /******/ // The module cache
  14. /******/ var installedModules = {};
  15. /******/
  16. /******/ // The require function
  17. /******/ function __webpack_require__(moduleId) {
  18. /******/
  19. /******/ // Check if module is in cache
  20. /******/ if(installedModules[moduleId]) {
  21. /******/ return installedModules[moduleId].exports;
  22. /******/ }
  23. /******/ // Create a new module (and put it into the cache)
  24. /******/ var module = installedModules[moduleId] = {
  25. /******/ i: moduleId,
  26. /******/ l: false,
  27. /******/ exports: {}
  28. /******/ };
  29. /******/
  30. /******/ // Execute the module function
  31. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  32. /******/
  33. /******/ // Flag the module as loaded
  34. /******/ module.l = true;
  35. /******/
  36. /******/ // Return the exports of the module
  37. /******/ return module.exports;
  38. /******/ }
  39. /******/
  40. /******/
  41. /******/ // expose the modules object (__webpack_modules__)
  42. /******/ __webpack_require__.m = modules;
  43. /******/
  44. /******/ // expose the module cache
  45. /******/ __webpack_require__.c = installedModules;
  46. /******/
  47. /******/ // define getter function for harmony exports
  48. /******/ __webpack_require__.d = function(exports, name, getter) {
  49. /******/ if(!__webpack_require__.o(exports, name)) {
  50. /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
  51. /******/ }
  52. /******/ };
  53. /******/
  54. /******/ // define __esModule on exports
  55. /******/ __webpack_require__.r = function(exports) {
  56. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  57. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  58. /******/ }
  59. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  60. /******/ };
  61. /******/
  62. /******/ // create a fake namespace object
  63. /******/ // mode & 1: value is a module id, require it
  64. /******/ // mode & 2: merge all properties of value into the ns
  65. /******/ // mode & 4: return value when already ns object
  66. /******/ // mode & 8|1: behave like require
  67. /******/ __webpack_require__.t = function(value, mode) {
  68. /******/ if(mode & 1) value = __webpack_require__(value);
  69. /******/ if(mode & 8) return value;
  70. /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
  71. /******/ var ns = Object.create(null);
  72. /******/ __webpack_require__.r(ns);
  73. /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
  74. /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
  75. /******/ return ns;
  76. /******/ };
  77. /******/
  78. /******/ // getDefaultExport function for compatibility with non-harmony modules
  79. /******/ __webpack_require__.n = function(module) {
  80. /******/ var getter = module && module.__esModule ?
  81. /******/ function getDefault() { return module['default']; } :
  82. /******/ function getModuleExports() { return module; };
  83. /******/ __webpack_require__.d(getter, 'a', getter);
  84. /******/ return getter;
  85. /******/ };
  86. /******/
  87. /******/ // Object.prototype.hasOwnProperty.call
  88. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  89. /******/
  90. /******/ // __webpack_public_path__
  91. /******/ __webpack_require__.p = "";
  92. /******/
  93. /******/
  94. /******/ // Load entry module and return exports
  95. /******/ return __webpack_require__(__webpack_require__.s = 214);
  96. /******/ })
  97. /************************************************************************/
  98. /******/ ([
  99. /* 0 */
  100. /***/ (function(module, exports, __webpack_require__) {
  101. "use strict";
  102. function isString(variable) {
  103. return typeof variable === 'string' || variable instanceof String;
  104. }
  105. function isNumber(variable) {
  106. return typeof variable === 'number' || variable instanceof Number;
  107. }
  108. function isBoolean(variable) {
  109. return typeof variable === 'boolean';
  110. }
  111. function isArray(variable) {
  112. return Array.isArray(variable);
  113. }
  114. function isFunction(variable) {
  115. return typeof variable === 'function';
  116. }
  117. function isObject(variable) {
  118. return variable !== null && typeof variable === 'object';
  119. }
  120. function isNull(variable) {
  121. return variable === null;
  122. }
  123. function isUndefined(variable) {
  124. return variable === undefined;
  125. }
  126. function pack() {
  127. var result = {};
  128. for (var i = 0, l = arguments.length; i < l; i++) {
  129. var obj = arguments[i];
  130. if (obj) {
  131. for (var key in obj) {
  132. if (obj.hasOwnProperty(key)) {
  133. result[key] = obj[key];
  134. }
  135. }
  136. }
  137. }
  138. return result;
  139. }
  140. function offsetVector(vector, x, y) {
  141. switch (vector.type) {
  142. case 'ellipse':
  143. case 'rect':
  144. vector.x += x;
  145. vector.y += y;
  146. break;
  147. case 'line':
  148. vector.x1 += x;
  149. vector.x2 += x;
  150. vector.y1 += y;
  151. vector.y2 += y;
  152. break;
  153. case 'polyline':
  154. for (var i = 0, l = vector.points.length; i < l; i++) {
  155. vector.points[i].x += x;
  156. vector.points[i].y += y;
  157. }
  158. break;
  159. }
  160. }
  161. function fontStringify(key, val) {
  162. if (key === 'font') {
  163. return 'font';
  164. }
  165. return val;
  166. }
  167. function getNodeId(node) {
  168. if (node.id) {
  169. return node.id;
  170. }
  171. if (isArray(node.text)) {
  172. for (var i = 0, l = node.text.length; i < l; i++) {
  173. var n = node.text[i];
  174. var nodeId = getNodeId(n);
  175. if (nodeId) {
  176. return nodeId;
  177. }
  178. }
  179. }
  180. return null;
  181. }
  182. module.exports = {
  183. isString: isString,
  184. isNumber: isNumber,
  185. isBoolean: isBoolean,
  186. isArray: isArray,
  187. isFunction: isFunction,
  188. isObject: isObject,
  189. isNull: isNull,
  190. isUndefined: isUndefined,
  191. pack: pack,
  192. fontStringify: fontStringify,
  193. offsetVector: offsetVector,
  194. getNodeId: getNodeId
  195. };
  196. /***/ }),
  197. /* 1 */
  198. /***/ (function(module, exports, __webpack_require__) {
  199. ;(function (root, factory) {
  200. if (true) {
  201. // CommonJS
  202. module.exports = exports = factory();
  203. }
  204. else {}
  205. }(this, function () {
  206. /**
  207. * CryptoJS core components.
  208. */
  209. var CryptoJS = CryptoJS || (function (Math, undefined) {
  210. /*
  211. * Local polyfil of Object.create
  212. */
  213. var create = Object.create || (function () {
  214. function F() {};
  215. return function (obj) {
  216. var subtype;
  217. F.prototype = obj;
  218. subtype = new F();
  219. F.prototype = null;
  220. return subtype;
  221. };
  222. }())
  223. /**
  224. * CryptoJS namespace.
  225. */
  226. var C = {};
  227. /**
  228. * Library namespace.
  229. */
  230. var C_lib = C.lib = {};
  231. /**
  232. * Base object for prototypal inheritance.
  233. */
  234. var Base = C_lib.Base = (function () {
  235. return {
  236. /**
  237. * Creates a new object that inherits from this object.
  238. *
  239. * @param {Object} overrides Properties to copy into the new object.
  240. *
  241. * @return {Object} The new object.
  242. *
  243. * @static
  244. *
  245. * @example
  246. *
  247. * var MyType = CryptoJS.lib.Base.extend({
  248. * field: 'value',
  249. *
  250. * method: function () {
  251. * }
  252. * });
  253. */
  254. extend: function (overrides) {
  255. // Spawn
  256. var subtype = create(this);
  257. // Augment
  258. if (overrides) {
  259. subtype.mixIn(overrides);
  260. }
  261. // Create default initializer
  262. if (!subtype.hasOwnProperty('init') || this.init === subtype.init) {
  263. subtype.init = function () {
  264. subtype.$super.init.apply(this, arguments);
  265. };
  266. }
  267. // Initializer's prototype is the subtype object
  268. subtype.init.prototype = subtype;
  269. // Reference supertype
  270. subtype.$super = this;
  271. return subtype;
  272. },
  273. /**
  274. * Extends this object and runs the init method.
  275. * Arguments to create() will be passed to init().
  276. *
  277. * @return {Object} The new object.
  278. *
  279. * @static
  280. *
  281. * @example
  282. *
  283. * var instance = MyType.create();
  284. */
  285. create: function () {
  286. var instance = this.extend();
  287. instance.init.apply(instance, arguments);
  288. return instance;
  289. },
  290. /**
  291. * Initializes a newly created object.
  292. * Override this method to add some logic when your objects are created.
  293. *
  294. * @example
  295. *
  296. * var MyType = CryptoJS.lib.Base.extend({
  297. * init: function () {
  298. * // ...
  299. * }
  300. * });
  301. */
  302. init: function () {
  303. },
  304. /**
  305. * Copies properties into this object.
  306. *
  307. * @param {Object} properties The properties to mix in.
  308. *
  309. * @example
  310. *
  311. * MyType.mixIn({
  312. * field: 'value'
  313. * });
  314. */
  315. mixIn: function (properties) {
  316. for (var propertyName in properties) {
  317. if (properties.hasOwnProperty(propertyName)) {
  318. this[propertyName] = properties[propertyName];
  319. }
  320. }
  321. // IE won't copy toString using the loop above
  322. if (properties.hasOwnProperty('toString')) {
  323. this.toString = properties.toString;
  324. }
  325. },
  326. /**
  327. * Creates a copy of this object.
  328. *
  329. * @return {Object} The clone.
  330. *
  331. * @example
  332. *
  333. * var clone = instance.clone();
  334. */
  335. clone: function () {
  336. return this.init.prototype.extend(this);
  337. }
  338. };
  339. }());
  340. /**
  341. * An array of 32-bit words.
  342. *
  343. * @property {Array} words The array of 32-bit words.
  344. * @property {number} sigBytes The number of significant bytes in this word array.
  345. */
  346. var WordArray = C_lib.WordArray = Base.extend({
  347. /**
  348. * Initializes a newly created word array.
  349. *
  350. * @param {Array} words (Optional) An array of 32-bit words.
  351. * @param {number} sigBytes (Optional) The number of significant bytes in the words.
  352. *
  353. * @example
  354. *
  355. * var wordArray = CryptoJS.lib.WordArray.create();
  356. * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]);
  357. * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6);
  358. */
  359. init: function (words, sigBytes) {
  360. words = this.words = words || [];
  361. if (sigBytes != undefined) {
  362. this.sigBytes = sigBytes;
  363. } else {
  364. this.sigBytes = words.length * 4;
  365. }
  366. },
  367. /**
  368. * Converts this word array to a string.
  369. *
  370. * @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex
  371. *
  372. * @return {string} The stringified word array.
  373. *
  374. * @example
  375. *
  376. * var string = wordArray + '';
  377. * var string = wordArray.toString();
  378. * var string = wordArray.toString(CryptoJS.enc.Utf8);
  379. */
  380. toString: function (encoder) {
  381. return (encoder || Hex).stringify(this);
  382. },
  383. /**
  384. * Concatenates a word array to this word array.
  385. *
  386. * @param {WordArray} wordArray The word array to append.
  387. *
  388. * @return {WordArray} This word array.
  389. *
  390. * @example
  391. *
  392. * wordArray1.concat(wordArray2);
  393. */
  394. concat: function (wordArray) {
  395. // Shortcuts
  396. var thisWords = this.words;
  397. var thatWords = wordArray.words;
  398. var thisSigBytes = this.sigBytes;
  399. var thatSigBytes = wordArray.sigBytes;
  400. // Clamp excess bits
  401. this.clamp();
  402. // Concat
  403. if (thisSigBytes % 4) {
  404. // Copy one byte at a time
  405. for (var i = 0; i < thatSigBytes; i++) {
  406. var thatByte = (thatWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
  407. thisWords[(thisSigBytes + i) >>> 2] |= thatByte << (24 - ((thisSigBytes + i) % 4) * 8);
  408. }
  409. } else {
  410. // Copy one word at a time
  411. for (var i = 0; i < thatSigBytes; i += 4) {
  412. thisWords[(thisSigBytes + i) >>> 2] = thatWords[i >>> 2];
  413. }
  414. }
  415. this.sigBytes += thatSigBytes;
  416. // Chainable
  417. return this;
  418. },
  419. /**
  420. * Removes insignificant bits.
  421. *
  422. * @example
  423. *
  424. * wordArray.clamp();
  425. */
  426. clamp: function () {
  427. // Shortcuts
  428. var words = this.words;
  429. var sigBytes = this.sigBytes;
  430. // Clamp
  431. words[sigBytes >>> 2] &= 0xffffffff << (32 - (sigBytes % 4) * 8);
  432. words.length = Math.ceil(sigBytes / 4);
  433. },
  434. /**
  435. * Creates a copy of this word array.
  436. *
  437. * @return {WordArray} The clone.
  438. *
  439. * @example
  440. *
  441. * var clone = wordArray.clone();
  442. */
  443. clone: function () {
  444. var clone = Base.clone.call(this);
  445. clone.words = this.words.slice(0);
  446. return clone;
  447. },
  448. /**
  449. * Creates a word array filled with random bytes.
  450. *
  451. * @param {number} nBytes The number of random bytes to generate.
  452. *
  453. * @return {WordArray} The random word array.
  454. *
  455. * @static
  456. *
  457. * @example
  458. *
  459. * var wordArray = CryptoJS.lib.WordArray.random(16);
  460. */
  461. random: function (nBytes) {
  462. var words = [];
  463. var r = (function (m_w) {
  464. var m_w = m_w;
  465. var m_z = 0x3ade68b1;
  466. var mask = 0xffffffff;
  467. return function () {
  468. m_z = (0x9069 * (m_z & 0xFFFF) + (m_z >> 0x10)) & mask;
  469. m_w = (0x4650 * (m_w & 0xFFFF) + (m_w >> 0x10)) & mask;
  470. var result = ((m_z << 0x10) + m_w) & mask;
  471. result /= 0x100000000;
  472. result += 0.5;
  473. return result * (Math.random() > .5 ? 1 : -1);
  474. }
  475. });
  476. for (var i = 0, rcache; i < nBytes; i += 4) {
  477. var _r = r((rcache || Math.random()) * 0x100000000);
  478. rcache = _r() * 0x3ade67b7;
  479. words.push((_r() * 0x100000000) | 0);
  480. }
  481. return new WordArray.init(words, nBytes);
  482. }
  483. });
  484. /**
  485. * Encoder namespace.
  486. */
  487. var C_enc = C.enc = {};
  488. /**
  489. * Hex encoding strategy.
  490. */
  491. var Hex = C_enc.Hex = {
  492. /**
  493. * Converts a word array to a hex string.
  494. *
  495. * @param {WordArray} wordArray The word array.
  496. *
  497. * @return {string} The hex string.
  498. *
  499. * @static
  500. *
  501. * @example
  502. *
  503. * var hexString = CryptoJS.enc.Hex.stringify(wordArray);
  504. */
  505. stringify: function (wordArray) {
  506. // Shortcuts
  507. var words = wordArray.words;
  508. var sigBytes = wordArray.sigBytes;
  509. // Convert
  510. var hexChars = [];
  511. for (var i = 0; i < sigBytes; i++) {
  512. var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
  513. hexChars.push((bite >>> 4).toString(16));
  514. hexChars.push((bite & 0x0f).toString(16));
  515. }
  516. return hexChars.join('');
  517. },
  518. /**
  519. * Converts a hex string to a word array.
  520. *
  521. * @param {string} hexStr The hex string.
  522. *
  523. * @return {WordArray} The word array.
  524. *
  525. * @static
  526. *
  527. * @example
  528. *
  529. * var wordArray = CryptoJS.enc.Hex.parse(hexString);
  530. */
  531. parse: function (hexStr) {
  532. // Shortcut
  533. var hexStrLength = hexStr.length;
  534. // Convert
  535. var words = [];
  536. for (var i = 0; i < hexStrLength; i += 2) {
  537. words[i >>> 3] |= parseInt(hexStr.substr(i, 2), 16) << (24 - (i % 8) * 4);
  538. }
  539. return new WordArray.init(words, hexStrLength / 2);
  540. }
  541. };
  542. /**
  543. * Latin1 encoding strategy.
  544. */
  545. var Latin1 = C_enc.Latin1 = {
  546. /**
  547. * Converts a word array to a Latin1 string.
  548. *
  549. * @param {WordArray} wordArray The word array.
  550. *
  551. * @return {string} The Latin1 string.
  552. *
  553. * @static
  554. *
  555. * @example
  556. *
  557. * var latin1String = CryptoJS.enc.Latin1.stringify(wordArray);
  558. */
  559. stringify: function (wordArray) {
  560. // Shortcuts
  561. var words = wordArray.words;
  562. var sigBytes = wordArray.sigBytes;
  563. // Convert
  564. var latin1Chars = [];
  565. for (var i = 0; i < sigBytes; i++) {
  566. var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
  567. latin1Chars.push(String.fromCharCode(bite));
  568. }
  569. return latin1Chars.join('');
  570. },
  571. /**
  572. * Converts a Latin1 string to a word array.
  573. *
  574. * @param {string} latin1Str The Latin1 string.
  575. *
  576. * @return {WordArray} The word array.
  577. *
  578. * @static
  579. *
  580. * @example
  581. *
  582. * var wordArray = CryptoJS.enc.Latin1.parse(latin1String);
  583. */
  584. parse: function (latin1Str) {
  585. // Shortcut
  586. var latin1StrLength = latin1Str.length;
  587. // Convert
  588. var words = [];
  589. for (var i = 0; i < latin1StrLength; i++) {
  590. words[i >>> 2] |= (latin1Str.charCodeAt(i) & 0xff) << (24 - (i % 4) * 8);
  591. }
  592. return new WordArray.init(words, latin1StrLength);
  593. }
  594. };
  595. /**
  596. * UTF-8 encoding strategy.
  597. */
  598. var Utf8 = C_enc.Utf8 = {
  599. /**
  600. * Converts a word array to a UTF-8 string.
  601. *
  602. * @param {WordArray} wordArray The word array.
  603. *
  604. * @return {string} The UTF-8 string.
  605. *
  606. * @static
  607. *
  608. * @example
  609. *
  610. * var utf8String = CryptoJS.enc.Utf8.stringify(wordArray);
  611. */
  612. stringify: function (wordArray) {
  613. try {
  614. return decodeURIComponent(escape(Latin1.stringify(wordArray)));
  615. } catch (e) {
  616. throw new Error('Malformed UTF-8 data');
  617. }
  618. },
  619. /**
  620. * Converts a UTF-8 string to a word array.
  621. *
  622. * @param {string} utf8Str The UTF-8 string.
  623. *
  624. * @return {WordArray} The word array.
  625. *
  626. * @static
  627. *
  628. * @example
  629. *
  630. * var wordArray = CryptoJS.enc.Utf8.parse(utf8String);
  631. */
  632. parse: function (utf8Str) {
  633. return Latin1.parse(unescape(encodeURIComponent(utf8Str)));
  634. }
  635. };
  636. /**
  637. * Abstract buffered block algorithm template.
  638. *
  639. * The property blockSize must be implemented in a concrete subtype.
  640. *
  641. * @property {number} _minBufferSize The number of blocks that should be kept unprocessed in the buffer. Default: 0
  642. */
  643. var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({
  644. /**
  645. * Resets this block algorithm's data buffer to its initial state.
  646. *
  647. * @example
  648. *
  649. * bufferedBlockAlgorithm.reset();
  650. */
  651. reset: function () {
  652. // Initial values
  653. this._data = new WordArray.init();
  654. this._nDataBytes = 0;
  655. },
  656. /**
  657. * Adds new data to this block algorithm's buffer.
  658. *
  659. * @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8.
  660. *
  661. * @example
  662. *
  663. * bufferedBlockAlgorithm._append('data');
  664. * bufferedBlockAlgorithm._append(wordArray);
  665. */
  666. _append: function (data) {
  667. // Convert string to WordArray, else assume WordArray already
  668. if (typeof data == 'string') {
  669. data = Utf8.parse(data);
  670. }
  671. // Append
  672. this._data.concat(data);
  673. this._nDataBytes += data.sigBytes;
  674. },
  675. /**
  676. * Processes available data blocks.
  677. *
  678. * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype.
  679. *
  680. * @param {boolean} doFlush Whether all blocks and partial blocks should be processed.
  681. *
  682. * @return {WordArray} The processed data.
  683. *
  684. * @example
  685. *
  686. * var processedData = bufferedBlockAlgorithm._process();
  687. * var processedData = bufferedBlockAlgorithm._process(!!'flush');
  688. */
  689. _process: function (doFlush) {
  690. // Shortcuts
  691. var data = this._data;
  692. var dataWords = data.words;
  693. var dataSigBytes = data.sigBytes;
  694. var blockSize = this.blockSize;
  695. var blockSizeBytes = blockSize * 4;
  696. // Count blocks ready
  697. var nBlocksReady = dataSigBytes / blockSizeBytes;
  698. if (doFlush) {
  699. // Round up to include partial blocks
  700. nBlocksReady = Math.ceil(nBlocksReady);
  701. } else {
  702. // Round down to include only full blocks,
  703. // less the number of blocks that must remain in the buffer
  704. nBlocksReady = Math.max((nBlocksReady | 0) - this._minBufferSize, 0);
  705. }
  706. // Count words ready
  707. var nWordsReady = nBlocksReady * blockSize;
  708. // Count bytes ready
  709. var nBytesReady = Math.min(nWordsReady * 4, dataSigBytes);
  710. // Process blocks
  711. if (nWordsReady) {
  712. for (var offset = 0; offset < nWordsReady; offset += blockSize) {
  713. // Perform concrete-algorithm logic
  714. this._doProcessBlock(dataWords, offset);
  715. }
  716. // Remove processed words
  717. var processedWords = dataWords.splice(0, nWordsReady);
  718. data.sigBytes -= nBytesReady;
  719. }
  720. // Return processed words
  721. return new WordArray.init(processedWords, nBytesReady);
  722. },
  723. /**
  724. * Creates a copy of this object.
  725. *
  726. * @return {Object} The clone.
  727. *
  728. * @example
  729. *
  730. * var clone = bufferedBlockAlgorithm.clone();
  731. */
  732. clone: function () {
  733. var clone = Base.clone.call(this);
  734. clone._data = this._data.clone();
  735. return clone;
  736. },
  737. _minBufferSize: 0
  738. });
  739. /**
  740. * Abstract hasher template.
  741. *
  742. * @property {number} blockSize The number of 32-bit words this hasher operates on. Default: 16 (512 bits)
  743. */
  744. var Hasher = C_lib.Hasher = BufferedBlockAlgorithm.extend({
  745. /**
  746. * Configuration options.
  747. */
  748. cfg: Base.extend(),
  749. /**
  750. * Initializes a newly created hasher.
  751. *
  752. * @param {Object} cfg (Optional) The configuration options to use for this hash computation.
  753. *
  754. * @example
  755. *
  756. * var hasher = CryptoJS.algo.SHA256.create();
  757. */
  758. init: function (cfg) {
  759. // Apply config defaults
  760. this.cfg = this.cfg.extend(cfg);
  761. // Set initial values
  762. this.reset();
  763. },
  764. /**
  765. * Resets this hasher to its initial state.
  766. *
  767. * @example
  768. *
  769. * hasher.reset();
  770. */
  771. reset: function () {
  772. // Reset data buffer
  773. BufferedBlockAlgorithm.reset.call(this);
  774. // Perform concrete-hasher logic
  775. this._doReset();
  776. },
  777. /**
  778. * Updates this hasher with a message.
  779. *
  780. * @param {WordArray|string} messageUpdate The message to append.
  781. *
  782. * @return {Hasher} This hasher.
  783. *
  784. * @example
  785. *
  786. * hasher.update('message');
  787. * hasher.update(wordArray);
  788. */
  789. update: function (messageUpdate) {
  790. // Append
  791. this._append(messageUpdate);
  792. // Update the hash
  793. this._process();
  794. // Chainable
  795. return this;
  796. },
  797. /**
  798. * Finalizes the hash computation.
  799. * Note that the finalize operation is effectively a destructive, read-once operation.
  800. *
  801. * @param {WordArray|string} messageUpdate (Optional) A final message update.
  802. *
  803. * @return {WordArray} The hash.
  804. *
  805. * @example
  806. *
  807. * var hash = hasher.finalize();
  808. * var hash = hasher.finalize('message');
  809. * var hash = hasher.finalize(wordArray);
  810. */
  811. finalize: function (messageUpdate) {
  812. // Final message update
  813. if (messageUpdate) {
  814. this._append(messageUpdate);
  815. }
  816. // Perform concrete-hasher logic
  817. var hash = this._doFinalize();
  818. return hash;
  819. },
  820. blockSize: 512/32,
  821. /**
  822. * Creates a shortcut function to a hasher's object interface.
  823. *
  824. * @param {Hasher} hasher The hasher to create a helper for.
  825. *
  826. * @return {Function} The shortcut function.
  827. *
  828. * @static
  829. *
  830. * @example
  831. *
  832. * var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256);
  833. */
  834. _createHelper: function (hasher) {
  835. return function (message, cfg) {
  836. return new hasher.init(cfg).finalize(message);
  837. };
  838. },
  839. /**
  840. * Creates a shortcut function to the HMAC's object interface.
  841. *
  842. * @param {Hasher} hasher The hasher to use in this HMAC helper.
  843. *
  844. * @return {Function} The shortcut function.
  845. *
  846. * @static
  847. *
  848. * @example
  849. *
  850. * var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256);
  851. */
  852. _createHmacHelper: function (hasher) {
  853. return function (message, key) {
  854. return new C_algo.HMAC.init(hasher, key).finalize(message);
  855. };
  856. }
  857. });
  858. /**
  859. * Algorithm namespace.
  860. */
  861. var C_algo = C.algo = {};
  862. return C;
  863. }(Math));
  864. return CryptoJS;
  865. }));
  866. /***/ }),
  867. /* 2 */
  868. /***/ (function(module, exports) {
  869. var core = module.exports = { version: '2.6.11' };
  870. if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef
  871. /***/ }),
  872. /* 3 */
  873. /***/ (function(module, exports, __webpack_require__) {
  874. var store = __webpack_require__(61)('wks');
  875. var uid = __webpack_require__(29);
  876. var Symbol = __webpack_require__(8).Symbol;
  877. var USE_SYMBOL = typeof Symbol == 'function';
  878. var $exports = module.exports = function (name) {
  879. return store[name] || (store[name] =
  880. USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));
  881. };
  882. $exports.store = store;
  883. /***/ }),
  884. /* 4 */
  885. /***/ (function(module, exports, __webpack_require__) {
  886. "use strict";
  887. /* WEBPACK VAR INJECTION */(function(global) {/*!
  888. * The buffer module from node.js, for the browser.
  889. *
  890. * @author Feross Aboukhadijeh <http://feross.org>
  891. * @license MIT
  892. */
  893. /* eslint-disable no-proto */
  894. var base64 = __webpack_require__(216)
  895. var ieee754 = __webpack_require__(217)
  896. var isArray = __webpack_require__(132)
  897. exports.Buffer = Buffer
  898. exports.SlowBuffer = SlowBuffer
  899. exports.INSPECT_MAX_BYTES = 50
  900. /**
  901. * If `Buffer.TYPED_ARRAY_SUPPORT`:
  902. * === true Use Uint8Array implementation (fastest)
  903. * === false Use Object implementation (most compatible, even IE6)
  904. *
  905. * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
  906. * Opera 11.6+, iOS 4.2+.
  907. *
  908. * Due to various browser bugs, sometimes the Object implementation will be used even
  909. * when the browser supports typed arrays.
  910. *
  911. * Note:
  912. *
  913. * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,
  914. * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.
  915. *
  916. * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.
  917. *
  918. * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of
  919. * incorrect length in some situations.
  920. * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they
  921. * get the Object implementation, which is slower but behaves correctly.
  922. */
  923. Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined
  924. ? global.TYPED_ARRAY_SUPPORT
  925. : typedArraySupport()
  926. /*
  927. * Export kMaxLength after typed array support is determined.
  928. */
  929. exports.kMaxLength = kMaxLength()
  930. function typedArraySupport () {
  931. try {
  932. var arr = new Uint8Array(1)
  933. arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}
  934. return arr.foo() === 42 && // typed array instances can be augmented
  935. typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`
  936. arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`
  937. } catch (e) {
  938. return false
  939. }
  940. }
  941. function kMaxLength () {
  942. return Buffer.TYPED_ARRAY_SUPPORT
  943. ? 0x7fffffff
  944. : 0x3fffffff
  945. }
  946. function createBuffer (that, length) {
  947. if (kMaxLength() < length) {
  948. throw new RangeError('Invalid typed array length')
  949. }
  950. if (Buffer.TYPED_ARRAY_SUPPORT) {
  951. // Return an augmented `Uint8Array` instance, for best performance
  952. that = new Uint8Array(length)
  953. that.__proto__ = Buffer.prototype
  954. } else {
  955. // Fallback: Return an object instance of the Buffer class
  956. if (that === null) {
  957. that = new Buffer(length)
  958. }
  959. that.length = length
  960. }
  961. return that
  962. }
  963. /**
  964. * The Buffer constructor returns instances of `Uint8Array` that have their
  965. * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
  966. * `Uint8Array`, so the returned instances will have all the node `Buffer` methods
  967. * and the `Uint8Array` methods. Square bracket notation works as expected -- it
  968. * returns a single octet.
  969. *
  970. * The `Uint8Array` prototype remains unmodified.
  971. */
  972. function Buffer (arg, encodingOrOffset, length) {
  973. if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {
  974. return new Buffer(arg, encodingOrOffset, length)
  975. }
  976. // Common case.
  977. if (typeof arg === 'number') {
  978. if (typeof encodingOrOffset === 'string') {
  979. throw new Error(
  980. 'If encoding is specified then the first argument must be a string'
  981. )
  982. }
  983. return allocUnsafe(this, arg)
  984. }
  985. return from(this, arg, encodingOrOffset, length)
  986. }
  987. Buffer.poolSize = 8192 // not used by this implementation
  988. // TODO: Legacy, not needed anymore. Remove in next major version.
  989. Buffer._augment = function (arr) {
  990. arr.__proto__ = Buffer.prototype
  991. return arr
  992. }
  993. function from (that, value, encodingOrOffset, length) {
  994. if (typeof value === 'number') {
  995. throw new TypeError('"value" argument must not be a number')
  996. }
  997. if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {
  998. return fromArrayBuffer(that, value, encodingOrOffset, length)
  999. }
  1000. if (typeof value === 'string') {
  1001. return fromString(that, value, encodingOrOffset)
  1002. }
  1003. return fromObject(that, value)
  1004. }
  1005. /**
  1006. * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
  1007. * if value is a number.
  1008. * Buffer.from(str[, encoding])
  1009. * Buffer.from(array)
  1010. * Buffer.from(buffer)
  1011. * Buffer.from(arrayBuffer[, byteOffset[, length]])
  1012. **/
  1013. Buffer.from = function (value, encodingOrOffset, length) {
  1014. return from(null, value, encodingOrOffset, length)
  1015. }
  1016. if (Buffer.TYPED_ARRAY_SUPPORT) {
  1017. Buffer.prototype.__proto__ = Uint8Array.prototype
  1018. Buffer.__proto__ = Uint8Array
  1019. if (typeof Symbol !== 'undefined' && Symbol.species &&
  1020. Buffer[Symbol.species] === Buffer) {
  1021. // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97
  1022. Object.defineProperty(Buffer, Symbol.species, {
  1023. value: null,
  1024. configurable: true
  1025. })
  1026. }
  1027. }
  1028. function assertSize (size) {
  1029. if (typeof size !== 'number') {
  1030. throw new TypeError('"size" argument must be a number')
  1031. } else if (size < 0) {
  1032. throw new RangeError('"size" argument must not be negative')
  1033. }
  1034. }
  1035. function alloc (that, size, fill, encoding) {
  1036. assertSize(size)
  1037. if (size <= 0) {
  1038. return createBuffer(that, size)
  1039. }
  1040. if (fill !== undefined) {
  1041. // Only pay attention to encoding if it's a string. This
  1042. // prevents accidentally sending in a number that would
  1043. // be interpretted as a start offset.
  1044. return typeof encoding === 'string'
  1045. ? createBuffer(that, size).fill(fill, encoding)
  1046. : createBuffer(that, size).fill(fill)
  1047. }
  1048. return createBuffer(that, size)
  1049. }
  1050. /**
  1051. * Creates a new filled Buffer instance.
  1052. * alloc(size[, fill[, encoding]])
  1053. **/
  1054. Buffer.alloc = function (size, fill, encoding) {
  1055. return alloc(null, size, fill, encoding)
  1056. }
  1057. function allocUnsafe (that, size) {
  1058. assertSize(size)
  1059. that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)
  1060. if (!Buffer.TYPED_ARRAY_SUPPORT) {
  1061. for (var i = 0; i < size; ++i) {
  1062. that[i] = 0
  1063. }
  1064. }
  1065. return that
  1066. }
  1067. /**
  1068. * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
  1069. * */
  1070. Buffer.allocUnsafe = function (size) {
  1071. return allocUnsafe(null, size)
  1072. }
  1073. /**
  1074. * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
  1075. */
  1076. Buffer.allocUnsafeSlow = function (size) {
  1077. return allocUnsafe(null, size)
  1078. }
  1079. function fromString (that, string, encoding) {
  1080. if (typeof encoding !== 'string' || encoding === '') {
  1081. encoding = 'utf8'
  1082. }
  1083. if (!Buffer.isEncoding(encoding)) {
  1084. throw new TypeError('"encoding" must be a valid string encoding')
  1085. }
  1086. var length = byteLength(string, encoding) | 0
  1087. that = createBuffer(that, length)
  1088. var actual = that.write(string, encoding)
  1089. if (actual !== length) {
  1090. // Writing a hex string, for example, that contains invalid characters will
  1091. // cause everything after the first invalid character to be ignored. (e.g.
  1092. // 'abxxcd' will be treated as 'ab')
  1093. that = that.slice(0, actual)
  1094. }
  1095. return that
  1096. }
  1097. function fromArrayLike (that, array) {
  1098. var length = array.length < 0 ? 0 : checked(array.length) | 0
  1099. that = createBuffer(that, length)
  1100. for (var i = 0; i < length; i += 1) {
  1101. that[i] = array[i] & 255
  1102. }
  1103. return that
  1104. }
  1105. function fromArrayBuffer (that, array, byteOffset, length) {
  1106. array.byteLength // this throws if `array` is not a valid ArrayBuffer
  1107. if (byteOffset < 0 || array.byteLength < byteOffset) {
  1108. throw new RangeError('\'offset\' is out of bounds')
  1109. }
  1110. if (array.byteLength < byteOffset + (length || 0)) {
  1111. throw new RangeError('\'length\' is out of bounds')
  1112. }
  1113. if (byteOffset === undefined && length === undefined) {
  1114. array = new Uint8Array(array)
  1115. } else if (length === undefined) {
  1116. array = new Uint8Array(array, byteOffset)
  1117. } else {
  1118. array = new Uint8Array(array, byteOffset, length)
  1119. }
  1120. if (Buffer.TYPED_ARRAY_SUPPORT) {
  1121. // Return an augmented `Uint8Array` instance, for best performance
  1122. that = array
  1123. that.__proto__ = Buffer.prototype
  1124. } else {
  1125. // Fallback: Return an object instance of the Buffer class
  1126. that = fromArrayLike(that, array)
  1127. }
  1128. return that
  1129. }
  1130. function fromObject (that, obj) {
  1131. if (Buffer.isBuffer(obj)) {
  1132. var len = checked(obj.length) | 0
  1133. that = createBuffer(that, len)
  1134. if (that.length === 0) {
  1135. return that
  1136. }
  1137. obj.copy(that, 0, 0, len)
  1138. return that
  1139. }
  1140. if (obj) {
  1141. if ((typeof ArrayBuffer !== 'undefined' &&
  1142. obj.buffer instanceof ArrayBuffer) || 'length' in obj) {
  1143. if (typeof obj.length !== 'number' || isnan(obj.length)) {
  1144. return createBuffer(that, 0)
  1145. }
  1146. return fromArrayLike(that, obj)
  1147. }
  1148. if (obj.type === 'Buffer' && isArray(obj.data)) {
  1149. return fromArrayLike(that, obj.data)
  1150. }
  1151. }
  1152. throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')
  1153. }
  1154. function checked (length) {
  1155. // Note: cannot use `length < kMaxLength()` here because that fails when
  1156. // length is NaN (which is otherwise coerced to zero.)
  1157. if (length >= kMaxLength()) {
  1158. throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
  1159. 'size: 0x' + kMaxLength().toString(16) + ' bytes')
  1160. }
  1161. return length | 0
  1162. }
  1163. function SlowBuffer (length) {
  1164. if (+length != length) { // eslint-disable-line eqeqeq
  1165. length = 0
  1166. }
  1167. return Buffer.alloc(+length)
  1168. }
  1169. Buffer.isBuffer = function isBuffer (b) {
  1170. return !!(b != null && b._isBuffer)
  1171. }
  1172. Buffer.compare = function compare (a, b) {
  1173. if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
  1174. throw new TypeError('Arguments must be Buffers')
  1175. }
  1176. if (a === b) return 0
  1177. var x = a.length
  1178. var y = b.length
  1179. for (var i = 0, len = Math.min(x, y); i < len; ++i) {
  1180. if (a[i] !== b[i]) {
  1181. x = a[i]
  1182. y = b[i]
  1183. break
  1184. }
  1185. }
  1186. if (x < y) return -1
  1187. if (y < x) return 1
  1188. return 0
  1189. }
  1190. Buffer.isEncoding = function isEncoding (encoding) {
  1191. switch (String(encoding).toLowerCase()) {
  1192. case 'hex':
  1193. case 'utf8':
  1194. case 'utf-8':
  1195. case 'ascii':
  1196. case 'latin1':
  1197. case 'binary':
  1198. case 'base64':
  1199. case 'ucs2':
  1200. case 'ucs-2':
  1201. case 'utf16le':
  1202. case 'utf-16le':
  1203. return true
  1204. default:
  1205. return false
  1206. }
  1207. }
  1208. Buffer.concat = function concat (list, length) {
  1209. if (!isArray(list)) {
  1210. throw new TypeError('"list" argument must be an Array of Buffers')
  1211. }
  1212. if (list.length === 0) {
  1213. return Buffer.alloc(0)
  1214. }
  1215. var i
  1216. if (length === undefined) {
  1217. length = 0
  1218. for (i = 0; i < list.length; ++i) {
  1219. length += list[i].length
  1220. }
  1221. }
  1222. var buffer = Buffer.allocUnsafe(length)
  1223. var pos = 0
  1224. for (i = 0; i < list.length; ++i) {
  1225. var buf = list[i]
  1226. if (!Buffer.isBuffer(buf)) {
  1227. throw new TypeError('"list" argument must be an Array of Buffers')
  1228. }
  1229. buf.copy(buffer, pos)
  1230. pos += buf.length
  1231. }
  1232. return buffer
  1233. }
  1234. function byteLength (string, encoding) {
  1235. if (Buffer.isBuffer(string)) {
  1236. return string.length
  1237. }
  1238. if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&
  1239. (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {
  1240. return string.byteLength
  1241. }
  1242. if (typeof string !== 'string') {
  1243. string = '' + string
  1244. }
  1245. var len = string.length
  1246. if (len === 0) return 0
  1247. // Use a for loop to avoid recursion
  1248. var loweredCase = false
  1249. for (;;) {
  1250. switch (encoding) {
  1251. case 'ascii':
  1252. case 'latin1':
  1253. case 'binary':
  1254. return len
  1255. case 'utf8':
  1256. case 'utf-8':
  1257. case undefined:
  1258. return utf8ToBytes(string).length
  1259. case 'ucs2':
  1260. case 'ucs-2':
  1261. case 'utf16le':
  1262. case 'utf-16le':
  1263. return len * 2
  1264. case 'hex':
  1265. return len >>> 1
  1266. case 'base64':
  1267. return base64ToBytes(string).length
  1268. default:
  1269. if (loweredCase) return utf8ToBytes(string).length // assume utf8
  1270. encoding = ('' + encoding).toLowerCase()
  1271. loweredCase = true
  1272. }
  1273. }
  1274. }
  1275. Buffer.byteLength = byteLength
  1276. function slowToString (encoding, start, end) {
  1277. var loweredCase = false
  1278. // No need to verify that "this.length <= MAX_UINT32" since it's a read-only
  1279. // property of a typed array.
  1280. // This behaves neither like String nor Uint8Array in that we set start/end
  1281. // to their upper/lower bounds if the value passed is out of range.
  1282. // undefined is handled specially as per ECMA-262 6th Edition,
  1283. // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.
  1284. if (start === undefined || start < 0) {
  1285. start = 0
  1286. }
  1287. // Return early if start > this.length. Done here to prevent potential uint32
  1288. // coercion fail below.
  1289. if (start > this.length) {
  1290. return ''
  1291. }
  1292. if (end === undefined || end > this.length) {
  1293. end = this.length
  1294. }
  1295. if (end <= 0) {
  1296. return ''
  1297. }
  1298. // Force coersion to uint32. This will also coerce falsey/NaN values to 0.
  1299. end >>>= 0
  1300. start >>>= 0
  1301. if (end <= start) {
  1302. return ''
  1303. }
  1304. if (!encoding) encoding = 'utf8'
  1305. while (true) {
  1306. switch (encoding) {
  1307. case 'hex':
  1308. return hexSlice(this, start, end)
  1309. case 'utf8':
  1310. case 'utf-8':
  1311. return utf8Slice(this, start, end)
  1312. case 'ascii':
  1313. return asciiSlice(this, start, end)
  1314. case 'latin1':
  1315. case 'binary':
  1316. return latin1Slice(this, start, end)
  1317. case 'base64':
  1318. return base64Slice(this, start, end)
  1319. case 'ucs2':
  1320. case 'ucs-2':
  1321. case 'utf16le':
  1322. case 'utf-16le':
  1323. return utf16leSlice(this, start, end)
  1324. default:
  1325. if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
  1326. encoding = (encoding + '').toLowerCase()
  1327. loweredCase = true
  1328. }
  1329. }
  1330. }
  1331. // The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect
  1332. // Buffer instances.
  1333. Buffer.prototype._isBuffer = true
  1334. function swap (b, n, m) {
  1335. var i = b[n]
  1336. b[n] = b[m]
  1337. b[m] = i
  1338. }
  1339. Buffer.prototype.swap16 = function swap16 () {
  1340. var len = this.length
  1341. if (len % 2 !== 0) {
  1342. throw new RangeError('Buffer size must be a multiple of 16-bits')
  1343. }
  1344. for (var i = 0; i < len; i += 2) {
  1345. swap(this, i, i + 1)
  1346. }
  1347. return this
  1348. }
  1349. Buffer.prototype.swap32 = function swap32 () {
  1350. var len = this.length
  1351. if (len % 4 !== 0) {
  1352. throw new RangeError('Buffer size must be a multiple of 32-bits')
  1353. }
  1354. for (var i = 0; i < len; i += 4) {
  1355. swap(this, i, i + 3)
  1356. swap(this, i + 1, i + 2)
  1357. }
  1358. return this
  1359. }
  1360. Buffer.prototype.swap64 = function swap64 () {
  1361. var len = this.length
  1362. if (len % 8 !== 0) {
  1363. throw new RangeError('Buffer size must be a multiple of 64-bits')
  1364. }
  1365. for (var i = 0; i < len; i += 8) {
  1366. swap(this, i, i + 7)
  1367. swap(this, i + 1, i + 6)
  1368. swap(this, i + 2, i + 5)
  1369. swap(this, i + 3, i + 4)
  1370. }
  1371. return this
  1372. }
  1373. Buffer.prototype.toString = function toString () {
  1374. var length = this.length | 0
  1375. if (length === 0) return ''
  1376. if (arguments.length === 0) return utf8Slice(this, 0, length)
  1377. return slowToString.apply(this, arguments)
  1378. }
  1379. Buffer.prototype.equals = function equals (b) {
  1380. if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
  1381. if (this === b) return true
  1382. return Buffer.compare(this, b) === 0
  1383. }
  1384. Buffer.prototype.inspect = function inspect () {
  1385. var str = ''
  1386. var max = exports.INSPECT_MAX_BYTES
  1387. if (this.length > 0) {
  1388. str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')
  1389. if (this.length > max) str += ' ... '
  1390. }
  1391. return '<Buffer ' + str + '>'
  1392. }
  1393. Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {
  1394. if (!Buffer.isBuffer(target)) {
  1395. throw new TypeError('Argument must be a Buffer')
  1396. }
  1397. if (start === undefined) {
  1398. start = 0
  1399. }
  1400. if (end === undefined) {
  1401. end = target ? target.length : 0
  1402. }
  1403. if (thisStart === undefined) {
  1404. thisStart = 0
  1405. }
  1406. if (thisEnd === undefined) {
  1407. thisEnd = this.length
  1408. }
  1409. if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
  1410. throw new RangeError('out of range index')
  1411. }
  1412. if (thisStart >= thisEnd && start >= end) {
  1413. return 0
  1414. }
  1415. if (thisStart >= thisEnd) {
  1416. return -1
  1417. }
  1418. if (start >= end) {
  1419. return 1
  1420. }
  1421. start >>>= 0
  1422. end >>>= 0
  1423. thisStart >>>= 0
  1424. thisEnd >>>= 0
  1425. if (this === target) return 0
  1426. var x = thisEnd - thisStart
  1427. var y = end - start
  1428. var len = Math.min(x, y)
  1429. var thisCopy = this.slice(thisStart, thisEnd)
  1430. var targetCopy = target.slice(start, end)
  1431. for (var i = 0; i < len; ++i) {
  1432. if (thisCopy[i] !== targetCopy[i]) {
  1433. x = thisCopy[i]
  1434. y = targetCopy[i]
  1435. break
  1436. }
  1437. }
  1438. if (x < y) return -1
  1439. if (y < x) return 1
  1440. return 0
  1441. }
  1442. // Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
  1443. // OR the last index of `val` in `buffer` at offset <= `byteOffset`.
  1444. //
  1445. // Arguments:
  1446. // - buffer - a Buffer to search
  1447. // - val - a string, Buffer, or number
  1448. // - byteOffset - an index into `buffer`; will be clamped to an int32
  1449. // - encoding - an optional encoding, relevant is val is a string
  1450. // - dir - true for indexOf, false for lastIndexOf
  1451. function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
  1452. // Empty buffer means no match
  1453. if (buffer.length === 0) return -1
  1454. // Normalize byteOffset
  1455. if (typeof byteOffset === 'string') {
  1456. encoding = byteOffset
  1457. byteOffset = 0
  1458. } else if (byteOffset > 0x7fffffff) {
  1459. byteOffset = 0x7fffffff
  1460. } else if (byteOffset < -0x80000000) {
  1461. byteOffset = -0x80000000
  1462. }
  1463. byteOffset = +byteOffset // Coerce to Number.
  1464. if (isNaN(byteOffset)) {
  1465. // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
  1466. byteOffset = dir ? 0 : (buffer.length - 1)
  1467. }
  1468. // Normalize byteOffset: negative offsets start from the end of the buffer
  1469. if (byteOffset < 0) byteOffset = buffer.length + byteOffset
  1470. if (byteOffset >= buffer.length) {
  1471. if (dir) return -1
  1472. else byteOffset = buffer.length - 1
  1473. } else if (byteOffset < 0) {
  1474. if (dir) byteOffset = 0
  1475. else return -1
  1476. }
  1477. // Normalize val
  1478. if (typeof val === 'string') {
  1479. val = Buffer.from(val, encoding)
  1480. }
  1481. // Finally, search either indexOf (if dir is true) or lastIndexOf
  1482. if (Buffer.isBuffer(val)) {
  1483. // Special case: looking for empty string/buffer always fails
  1484. if (val.length === 0) {
  1485. return -1
  1486. }
  1487. return arrayIndexOf(buffer, val, byteOffset, encoding, dir)
  1488. } else if (typeof val === 'number') {
  1489. val = val & 0xFF // Search for a byte value [0-255]
  1490. if (Buffer.TYPED_ARRAY_SUPPORT &&
  1491. typeof Uint8Array.prototype.indexOf === 'function') {
  1492. if (dir) {
  1493. return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)
  1494. } else {
  1495. return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)
  1496. }
  1497. }
  1498. return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)
  1499. }
  1500. throw new TypeError('val must be string, number or Buffer')
  1501. }
  1502. function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
  1503. var indexSize = 1
  1504. var arrLength = arr.length
  1505. var valLength = val.length
  1506. if (encoding !== undefined) {
  1507. encoding = String(encoding).toLowerCase()
  1508. if (encoding === 'ucs2' || encoding === 'ucs-2' ||
  1509. encoding === 'utf16le' || encoding === 'utf-16le') {
  1510. if (arr.length < 2 || val.length < 2) {
  1511. return -1
  1512. }
  1513. indexSize = 2
  1514. arrLength /= 2
  1515. valLength /= 2
  1516. byteOffset /= 2
  1517. }
  1518. }
  1519. function read (buf, i) {
  1520. if (indexSize === 1) {
  1521. return buf[i]
  1522. } else {
  1523. return buf.readUInt16BE(i * indexSize)
  1524. }
  1525. }
  1526. var i
  1527. if (dir) {
  1528. var foundIndex = -1
  1529. for (i = byteOffset; i < arrLength; i++) {
  1530. if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
  1531. if (foundIndex === -1) foundIndex = i
  1532. if (i - foundIndex + 1 === valLength) return foundIndex * indexSize
  1533. } else {
  1534. if (foundIndex !== -1) i -= i - foundIndex
  1535. foundIndex = -1
  1536. }
  1537. }
  1538. } else {
  1539. if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength
  1540. for (i = byteOffset; i >= 0; i--) {
  1541. var found = true
  1542. for (var j = 0; j < valLength; j++) {
  1543. if (read(arr, i + j) !== read(val, j)) {
  1544. found = false
  1545. break
  1546. }
  1547. }
  1548. if (found) return i
  1549. }
  1550. }
  1551. return -1
  1552. }
  1553. Buffer.prototype.includes = function includes (val, byteOffset, encoding) {
  1554. return this.indexOf(val, byteOffset, encoding) !== -1
  1555. }
  1556. Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {
  1557. return bidirectionalIndexOf(this, val, byteOffset, encoding, true)
  1558. }
  1559. Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {
  1560. return bidirectionalIndexOf(this, val, byteOffset, encoding, false)
  1561. }
  1562. function hexWrite (buf, string, offset, length) {
  1563. offset = Number(offset) || 0
  1564. var remaining = buf.length - offset
  1565. if (!length) {
  1566. length = remaining
  1567. } else {
  1568. length = Number(length)
  1569. if (length > remaining) {
  1570. length = remaining
  1571. }
  1572. }
  1573. // must be an even number of digits
  1574. var strLen = string.length
  1575. if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')
  1576. if (length > strLen / 2) {
  1577. length = strLen / 2
  1578. }
  1579. for (var i = 0; i < length; ++i) {
  1580. var parsed = parseInt(string.substr(i * 2, 2), 16)
  1581. if (isNaN(parsed)) return i
  1582. buf[offset + i] = parsed
  1583. }
  1584. return i
  1585. }
  1586. function utf8Write (buf, string, offset, length) {
  1587. return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
  1588. }
  1589. function asciiWrite (buf, string, offset, length) {
  1590. return blitBuffer(asciiToBytes(string), buf, offset, length)
  1591. }
  1592. function latin1Write (buf, string, offset, length) {
  1593. return asciiWrite(buf, string, offset, length)
  1594. }
  1595. function base64Write (buf, string, offset, length) {
  1596. return blitBuffer(base64ToBytes(string), buf, offset, length)
  1597. }
  1598. function ucs2Write (buf, string, offset, length) {
  1599. return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
  1600. }
  1601. Buffer.prototype.write = function write (string, offset, length, encoding) {
  1602. // Buffer#write(string)
  1603. if (offset === undefined) {
  1604. encoding = 'utf8'
  1605. length = this.length
  1606. offset = 0
  1607. // Buffer#write(string, encoding)
  1608. } else if (length === undefined && typeof offset === 'string') {
  1609. encoding = offset
  1610. length = this.length
  1611. offset = 0
  1612. // Buffer#write(string, offset[, length][, encoding])
  1613. } else if (isFinite(offset)) {
  1614. offset = offset | 0
  1615. if (isFinite(length)) {
  1616. length = length | 0
  1617. if (encoding === undefined) encoding = 'utf8'
  1618. } else {
  1619. encoding = length
  1620. length = undefined
  1621. }
  1622. // legacy write(string, encoding, offset, length) - remove in v0.13
  1623. } else {
  1624. throw new Error(
  1625. 'Buffer.write(string, encoding, offset[, length]) is no longer supported'
  1626. )
  1627. }
  1628. var remaining = this.length - offset
  1629. if (length === undefined || length > remaining) length = remaining
  1630. if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
  1631. throw new RangeError('Attempt to write outside buffer bounds')
  1632. }
  1633. if (!encoding) encoding = 'utf8'
  1634. var loweredCase = false
  1635. for (;;) {
  1636. switch (encoding) {
  1637. case 'hex':
  1638. return hexWrite(this, string, offset, length)
  1639. case 'utf8':
  1640. case 'utf-8':
  1641. return utf8Write(this, string, offset, length)
  1642. case 'ascii':
  1643. return asciiWrite(this, string, offset, length)
  1644. case 'latin1':
  1645. case 'binary':
  1646. return latin1Write(this, string, offset, length)
  1647. case 'base64':
  1648. // Warning: maxLength not taken into account in base64Write
  1649. return base64Write(this, string, offset, length)
  1650. case 'ucs2':
  1651. case 'ucs-2':
  1652. case 'utf16le':
  1653. case 'utf-16le':
  1654. return ucs2Write(this, string, offset, length)
  1655. default:
  1656. if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
  1657. encoding = ('' + encoding).toLowerCase()
  1658. loweredCase = true
  1659. }
  1660. }
  1661. }
  1662. Buffer.prototype.toJSON = function toJSON () {
  1663. return {
  1664. type: 'Buffer',
  1665. data: Array.prototype.slice.call(this._arr || this, 0)
  1666. }
  1667. }
  1668. function base64Slice (buf, start, end) {
  1669. if (start === 0 && end === buf.length) {
  1670. return base64.fromByteArray(buf)
  1671. } else {
  1672. return base64.fromByteArray(buf.slice(start, end))
  1673. }
  1674. }
  1675. function utf8Slice (buf, start, end) {
  1676. end = Math.min(buf.length, end)
  1677. var res = []
  1678. var i = start
  1679. while (i < end) {
  1680. var firstByte = buf[i]
  1681. var codePoint = null
  1682. var bytesPerSequence = (firstByte > 0xEF) ? 4
  1683. : (firstByte > 0xDF) ? 3
  1684. : (firstByte > 0xBF) ? 2
  1685. : 1
  1686. if (i + bytesPerSequence <= end) {
  1687. var secondByte, thirdByte, fourthByte, tempCodePoint
  1688. switch (bytesPerSequence) {
  1689. case 1:
  1690. if (firstByte < 0x80) {
  1691. codePoint = firstByte
  1692. }
  1693. break
  1694. case 2:
  1695. secondByte = buf[i + 1]
  1696. if ((secondByte & 0xC0) === 0x80) {
  1697. tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)
  1698. if (tempCodePoint > 0x7F) {
  1699. codePoint = tempCodePoint
  1700. }
  1701. }
  1702. break
  1703. case 3:
  1704. secondByte = buf[i + 1]
  1705. thirdByte = buf[i + 2]
  1706. if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
  1707. tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)
  1708. if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
  1709. codePoint = tempCodePoint
  1710. }
  1711. }
  1712. break
  1713. case 4:
  1714. secondByte = buf[i + 1]
  1715. thirdByte = buf[i + 2]
  1716. fourthByte = buf[i + 3]
  1717. if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
  1718. tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)
  1719. if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
  1720. codePoint = tempCodePoint
  1721. }
  1722. }
  1723. }
  1724. }
  1725. if (codePoint === null) {
  1726. // we did not generate a valid codePoint so insert a
  1727. // replacement char (U+FFFD) and advance only 1 byte
  1728. codePoint = 0xFFFD
  1729. bytesPerSequence = 1
  1730. } else if (codePoint > 0xFFFF) {
  1731. // encode to utf16 (surrogate pair dance)
  1732. codePoint -= 0x10000
  1733. res.push(codePoint >>> 10 & 0x3FF | 0xD800)
  1734. codePoint = 0xDC00 | codePoint & 0x3FF
  1735. }
  1736. res.push(codePoint)
  1737. i += bytesPerSequence
  1738. }
  1739. return decodeCodePointsArray(res)
  1740. }
  1741. // Based on http://stackoverflow.com/a/22747272/680742, the browser with
  1742. // the lowest limit is Chrome, with 0x10000 args.
  1743. // We go 1 magnitude less, for safety
  1744. var MAX_ARGUMENTS_LENGTH = 0x1000
  1745. function decodeCodePointsArray (codePoints) {
  1746. var len = codePoints.length
  1747. if (len <= MAX_ARGUMENTS_LENGTH) {
  1748. return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
  1749. }
  1750. // Decode in chunks to avoid "call stack size exceeded".
  1751. var res = ''
  1752. var i = 0
  1753. while (i < len) {
  1754. res += String.fromCharCode.apply(
  1755. String,
  1756. codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
  1757. )
  1758. }
  1759. return res
  1760. }
  1761. function asciiSlice (buf, start, end) {
  1762. var ret = ''
  1763. end = Math.min(buf.length, end)
  1764. for (var i = start; i < end; ++i) {
  1765. ret += String.fromCharCode(buf[i] & 0x7F)
  1766. }
  1767. return ret
  1768. }
  1769. function latin1Slice (buf, start, end) {
  1770. var ret = ''
  1771. end = Math.min(buf.length, end)
  1772. for (var i = start; i < end; ++i) {
  1773. ret += String.fromCharCode(buf[i])
  1774. }
  1775. return ret
  1776. }
  1777. function hexSlice (buf, start, end) {
  1778. var len = buf.length
  1779. if (!start || start < 0) start = 0
  1780. if (!end || end < 0 || end > len) end = len
  1781. var out = ''
  1782. for (var i = start; i < end; ++i) {
  1783. out += toHex(buf[i])
  1784. }
  1785. return out
  1786. }
  1787. function utf16leSlice (buf, start, end) {
  1788. var bytes = buf.slice(start, end)
  1789. var res = ''
  1790. for (var i = 0; i < bytes.length; i += 2) {
  1791. res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)
  1792. }
  1793. return res
  1794. }
  1795. Buffer.prototype.slice = function slice (start, end) {
  1796. var len = this.length
  1797. start = ~~start
  1798. end = end === undefined ? len : ~~end
  1799. if (start < 0) {
  1800. start += len
  1801. if (start < 0) start = 0
  1802. } else if (start > len) {
  1803. start = len
  1804. }
  1805. if (end < 0) {
  1806. end += len
  1807. if (end < 0) end = 0
  1808. } else if (end > len) {
  1809. end = len
  1810. }
  1811. if (end < start) end = start
  1812. var newBuf
  1813. if (Buffer.TYPED_ARRAY_SUPPORT) {
  1814. newBuf = this.subarray(start, end)
  1815. newBuf.__proto__ = Buffer.prototype
  1816. } else {
  1817. var sliceLen = end - start
  1818. newBuf = new Buffer(sliceLen, undefined)
  1819. for (var i = 0; i < sliceLen; ++i) {
  1820. newBuf[i] = this[i + start]
  1821. }
  1822. }
  1823. return newBuf
  1824. }
  1825. /*
  1826. * Need to make sure that buffer isn't trying to write out of bounds.
  1827. */
  1828. function checkOffset (offset, ext, length) {
  1829. if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
  1830. if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
  1831. }
  1832. Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
  1833. offset = offset | 0
  1834. byteLength = byteLength | 0
  1835. if (!noAssert) checkOffset(offset, byteLength, this.length)
  1836. var val = this[offset]
  1837. var mul = 1
  1838. var i = 0
  1839. while (++i < byteLength && (mul *= 0x100)) {
  1840. val += this[offset + i] * mul
  1841. }
  1842. return val
  1843. }
  1844. Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
  1845. offset = offset | 0
  1846. byteLength = byteLength | 0
  1847. if (!noAssert) {
  1848. checkOffset(offset, byteLength, this.length)
  1849. }
  1850. var val = this[offset + --byteLength]
  1851. var mul = 1
  1852. while (byteLength > 0 && (mul *= 0x100)) {
  1853. val += this[offset + --byteLength] * mul
  1854. }
  1855. return val
  1856. }
  1857. Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
  1858. if (!noAssert) checkOffset(offset, 1, this.length)
  1859. return this[offset]
  1860. }
  1861. Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
  1862. if (!noAssert) checkOffset(offset, 2, this.length)
  1863. return this[offset] | (this[offset + 1] << 8)
  1864. }
  1865. Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
  1866. if (!noAssert) checkOffset(offset, 2, this.length)
  1867. return (this[offset] << 8) | this[offset + 1]
  1868. }
  1869. Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
  1870. if (!noAssert) checkOffset(offset, 4, this.length)
  1871. return ((this[offset]) |
  1872. (this[offset + 1] << 8) |
  1873. (this[offset + 2] << 16)) +
  1874. (this[offset + 3] * 0x1000000)
  1875. }
  1876. Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
  1877. if (!noAssert) checkOffset(offset, 4, this.length)
  1878. return (this[offset] * 0x1000000) +
  1879. ((this[offset + 1] << 16) |
  1880. (this[offset + 2] << 8) |
  1881. this[offset + 3])
  1882. }
  1883. Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
  1884. offset = offset | 0
  1885. byteLength = byteLength | 0
  1886. if (!noAssert) checkOffset(offset, byteLength, this.length)
  1887. var val = this[offset]
  1888. var mul = 1
  1889. var i = 0
  1890. while (++i < byteLength && (mul *= 0x100)) {
  1891. val += this[offset + i] * mul
  1892. }
  1893. mul *= 0x80
  1894. if (val >= mul) val -= Math.pow(2, 8 * byteLength)
  1895. return val
  1896. }
  1897. Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
  1898. offset = offset | 0
  1899. byteLength = byteLength | 0
  1900. if (!noAssert) checkOffset(offset, byteLength, this.length)
  1901. var i = byteLength
  1902. var mul = 1
  1903. var val = this[offset + --i]
  1904. while (i > 0 && (mul *= 0x100)) {
  1905. val += this[offset + --i] * mul
  1906. }
  1907. mul *= 0x80
  1908. if (val >= mul) val -= Math.pow(2, 8 * byteLength)
  1909. return val
  1910. }
  1911. Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
  1912. if (!noAssert) checkOffset(offset, 1, this.length)
  1913. if (!(this[offset] & 0x80)) return (this[offset])
  1914. return ((0xff - this[offset] + 1) * -1)
  1915. }
  1916. Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
  1917. if (!noAssert) checkOffset(offset, 2, this.length)
  1918. var val = this[offset] | (this[offset + 1] << 8)
  1919. return (val & 0x8000) ? val | 0xFFFF0000 : val
  1920. }
  1921. Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
  1922. if (!noAssert) checkOffset(offset, 2, this.length)
  1923. var val = this[offset + 1] | (this[offset] << 8)
  1924. return (val & 0x8000) ? val | 0xFFFF0000 : val
  1925. }
  1926. Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
  1927. if (!noAssert) checkOffset(offset, 4, this.length)
  1928. return (this[offset]) |
  1929. (this[offset + 1] << 8) |
  1930. (this[offset + 2] << 16) |
  1931. (this[offset + 3] << 24)
  1932. }
  1933. Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
  1934. if (!noAssert) checkOffset(offset, 4, this.length)
  1935. return (this[offset] << 24) |
  1936. (this[offset + 1] << 16) |
  1937. (this[offset + 2] << 8) |
  1938. (this[offset + 3])
  1939. }
  1940. Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
  1941. if (!noAssert) checkOffset(offset, 4, this.length)
  1942. return ieee754.read(this, offset, true, 23, 4)
  1943. }
  1944. Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
  1945. if (!noAssert) checkOffset(offset, 4, this.length)
  1946. return ieee754.read(this, offset, false, 23, 4)
  1947. }
  1948. Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
  1949. if (!noAssert) checkOffset(offset, 8, this.length)
  1950. return ieee754.read(this, offset, true, 52, 8)
  1951. }
  1952. Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
  1953. if (!noAssert) checkOffset(offset, 8, this.length)
  1954. return ieee754.read(this, offset, false, 52, 8)
  1955. }
  1956. function checkInt (buf, value, offset, ext, max, min) {
  1957. if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance')
  1958. if (value > max || value < min) throw new RangeError('"value" argument is out of bounds')
  1959. if (offset + ext > buf.length) throw new RangeError('Index out of range')
  1960. }
  1961. Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
  1962. value = +value
  1963. offset = offset | 0
  1964. byteLength = byteLength | 0
  1965. if (!noAssert) {
  1966. var maxBytes = Math.pow(2, 8 * byteLength) - 1
  1967. checkInt(this, value, offset, byteLength, maxBytes, 0)
  1968. }
  1969. var mul = 1
  1970. var i = 0
  1971. this[offset] = value & 0xFF
  1972. while (++i < byteLength && (mul *= 0x100)) {
  1973. this[offset + i] = (value / mul) & 0xFF
  1974. }
  1975. return offset + byteLength
  1976. }
  1977. Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
  1978. value = +value
  1979. offset = offset | 0
  1980. byteLength = byteLength | 0
  1981. if (!noAssert) {
  1982. var maxBytes = Math.pow(2, 8 * byteLength) - 1
  1983. checkInt(this, value, offset, byteLength, maxBytes, 0)
  1984. }
  1985. var i = byteLength - 1
  1986. var mul = 1
  1987. this[offset + i] = value & 0xFF
  1988. while (--i >= 0 && (mul *= 0x100)) {
  1989. this[offset + i] = (value / mul) & 0xFF
  1990. }
  1991. return offset + byteLength
  1992. }
  1993. Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
  1994. value = +value
  1995. offset = offset | 0
  1996. if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)
  1997. if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
  1998. this[offset] = (value & 0xff)
  1999. return offset + 1
  2000. }
  2001. function objectWriteUInt16 (buf, value, offset, littleEndian) {
  2002. if (value < 0) value = 0xffff + value + 1
  2003. for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {
  2004. buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>
  2005. (littleEndian ? i : 1 - i) * 8
  2006. }
  2007. }
  2008. Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
  2009. value = +value
  2010. offset = offset | 0
  2011. if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
  2012. if (Buffer.TYPED_ARRAY_SUPPORT) {
  2013. this[offset] = (value & 0xff)
  2014. this[offset + 1] = (value >>> 8)
  2015. } else {
  2016. objectWriteUInt16(this, value, offset, true)
  2017. }
  2018. return offset + 2
  2019. }
  2020. Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
  2021. value = +value
  2022. offset = offset | 0
  2023. if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
  2024. if (Buffer.TYPED_ARRAY_SUPPORT) {
  2025. this[offset] = (value >>> 8)
  2026. this[offset + 1] = (value & 0xff)
  2027. } else {
  2028. objectWriteUInt16(this, value, offset, false)
  2029. }
  2030. return offset + 2
  2031. }
  2032. function objectWriteUInt32 (buf, value, offset, littleEndian) {
  2033. if (value < 0) value = 0xffffffff + value + 1
  2034. for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {
  2035. buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff
  2036. }
  2037. }
  2038. Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
  2039. value = +value
  2040. offset = offset | 0
  2041. if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
  2042. if (Buffer.TYPED_ARRAY_SUPPORT) {
  2043. this[offset + 3] = (value >>> 24)
  2044. this[offset + 2] = (value >>> 16)
  2045. this[offset + 1] = (value >>> 8)
  2046. this[offset] = (value & 0xff)
  2047. } else {
  2048. objectWriteUInt32(this, value, offset, true)
  2049. }
  2050. return offset + 4
  2051. }
  2052. Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
  2053. value = +value
  2054. offset = offset | 0
  2055. if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
  2056. if (Buffer.TYPED_ARRAY_SUPPORT) {
  2057. this[offset] = (value >>> 24)
  2058. this[offset + 1] = (value >>> 16)
  2059. this[offset + 2] = (value >>> 8)
  2060. this[offset + 3] = (value & 0xff)
  2061. } else {
  2062. objectWriteUInt32(this, value, offset, false)
  2063. }
  2064. return offset + 4
  2065. }
  2066. Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
  2067. value = +value
  2068. offset = offset | 0
  2069. if (!noAssert) {
  2070. var limit = Math.pow(2, 8 * byteLength - 1)
  2071. checkInt(this, value, offset, byteLength, limit - 1, -limit)
  2072. }
  2073. var i = 0
  2074. var mul = 1
  2075. var sub = 0
  2076. this[offset] = value & 0xFF
  2077. while (++i < byteLength && (mul *= 0x100)) {
  2078. if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
  2079. sub = 1
  2080. }
  2081. this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
  2082. }
  2083. return offset + byteLength
  2084. }
  2085. Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
  2086. value = +value
  2087. offset = offset | 0
  2088. if (!noAssert) {
  2089. var limit = Math.pow(2, 8 * byteLength - 1)
  2090. checkInt(this, value, offset, byteLength, limit - 1, -limit)
  2091. }
  2092. var i = byteLength - 1
  2093. var mul = 1
  2094. var sub = 0
  2095. this[offset + i] = value & 0xFF
  2096. while (--i >= 0 && (mul *= 0x100)) {
  2097. if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
  2098. sub = 1
  2099. }
  2100. this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
  2101. }
  2102. return offset + byteLength
  2103. }
  2104. Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
  2105. value = +value
  2106. offset = offset | 0
  2107. if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)
  2108. if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
  2109. if (value < 0) value = 0xff + value + 1
  2110. this[offset] = (value & 0xff)
  2111. return offset + 1
  2112. }
  2113. Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
  2114. value = +value
  2115. offset = offset | 0
  2116. if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
  2117. if (Buffer.TYPED_ARRAY_SUPPORT) {
  2118. this[offset] = (value & 0xff)
  2119. this[offset + 1] = (value >>> 8)
  2120. } else {
  2121. objectWriteUInt16(this, value, offset, true)
  2122. }
  2123. return offset + 2
  2124. }
  2125. Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
  2126. value = +value
  2127. offset = offset | 0
  2128. if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
  2129. if (Buffer.TYPED_ARRAY_SUPPORT) {
  2130. this[offset] = (value >>> 8)
  2131. this[offset + 1] = (value & 0xff)
  2132. } else {
  2133. objectWriteUInt16(this, value, offset, false)
  2134. }
  2135. return offset + 2
  2136. }
  2137. Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
  2138. value = +value
  2139. offset = offset | 0
  2140. if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
  2141. if (Buffer.TYPED_ARRAY_SUPPORT) {
  2142. this[offset] = (value & 0xff)
  2143. this[offset + 1] = (value >>> 8)
  2144. this[offset + 2] = (value >>> 16)
  2145. this[offset + 3] = (value >>> 24)
  2146. } else {
  2147. objectWriteUInt32(this, value, offset, true)
  2148. }
  2149. return offset + 4
  2150. }
  2151. Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
  2152. value = +value
  2153. offset = offset | 0
  2154. if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
  2155. if (value < 0) value = 0xffffffff + value + 1
  2156. if (Buffer.TYPED_ARRAY_SUPPORT) {
  2157. this[offset] = (value >>> 24)
  2158. this[offset + 1] = (value >>> 16)
  2159. this[offset + 2] = (value >>> 8)
  2160. this[offset + 3] = (value & 0xff)
  2161. } else {
  2162. objectWriteUInt32(this, value, offset, false)
  2163. }
  2164. return offset + 4
  2165. }
  2166. function checkIEEE754 (buf, value, offset, ext, max, min) {
  2167. if (offset + ext > buf.length) throw new RangeError('Index out of range')
  2168. if (offset < 0) throw new RangeError('Index out of range')
  2169. }
  2170. function writeFloat (buf, value, offset, littleEndian, noAssert) {
  2171. if (!noAssert) {
  2172. checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)
  2173. }
  2174. ieee754.write(buf, value, offset, littleEndian, 23, 4)
  2175. return offset + 4
  2176. }
  2177. Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
  2178. return writeFloat(this, value, offset, true, noAssert)
  2179. }
  2180. Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
  2181. return writeFloat(this, value, offset, false, noAssert)
  2182. }
  2183. function writeDouble (buf, value, offset, littleEndian, noAssert) {
  2184. if (!noAssert) {
  2185. checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)
  2186. }
  2187. ieee754.write(buf, value, offset, littleEndian, 52, 8)
  2188. return offset + 8
  2189. }
  2190. Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
  2191. return writeDouble(this, value, offset, true, noAssert)
  2192. }
  2193. Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
  2194. return writeDouble(this, value, offset, false, noAssert)
  2195. }
  2196. // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
  2197. Buffer.prototype.copy = function copy (target, targetStart, start, end) {
  2198. if (!start) start = 0
  2199. if (!end && end !== 0) end = this.length
  2200. if (targetStart >= target.length) targetStart = target.length
  2201. if (!targetStart) targetStart = 0
  2202. if (end > 0 && end < start) end = start
  2203. // Copy 0 bytes; we're done
  2204. if (end === start) return 0
  2205. if (target.length === 0 || this.length === 0) return 0
  2206. // Fatal error conditions
  2207. if (targetStart < 0) {
  2208. throw new RangeError('targetStart out of bounds')
  2209. }
  2210. if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')
  2211. if (end < 0) throw new RangeError('sourceEnd out of bounds')
  2212. // Are we oob?
  2213. if (end > this.length) end = this.length
  2214. if (target.length - targetStart < end - start) {
  2215. end = target.length - targetStart + start
  2216. }
  2217. var len = end - start
  2218. var i
  2219. if (this === target && start < targetStart && targetStart < end) {
  2220. // descending copy from end
  2221. for (i = len - 1; i >= 0; --i) {
  2222. target[i + targetStart] = this[i + start]
  2223. }
  2224. } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {
  2225. // ascending copy from start
  2226. for (i = 0; i < len; ++i) {
  2227. target[i + targetStart] = this[i + start]
  2228. }
  2229. } else {
  2230. Uint8Array.prototype.set.call(
  2231. target,
  2232. this.subarray(start, start + len),
  2233. targetStart
  2234. )
  2235. }
  2236. return len
  2237. }
  2238. // Usage:
  2239. // buffer.fill(number[, offset[, end]])
  2240. // buffer.fill(buffer[, offset[, end]])
  2241. // buffer.fill(string[, offset[, end]][, encoding])
  2242. Buffer.prototype.fill = function fill (val, start, end, encoding) {
  2243. // Handle string cases:
  2244. if (typeof val === 'string') {
  2245. if (typeof start === 'string') {
  2246. encoding = start
  2247. start = 0
  2248. end = this.length
  2249. } else if (typeof end === 'string') {
  2250. encoding = end
  2251. end = this.length
  2252. }
  2253. if (val.length === 1) {
  2254. var code = val.charCodeAt(0)
  2255. if (code < 256) {
  2256. val = code
  2257. }
  2258. }
  2259. if (encoding !== undefined && typeof encoding !== 'string') {
  2260. throw new TypeError('encoding must be a string')
  2261. }
  2262. if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
  2263. throw new TypeError('Unknown encoding: ' + encoding)
  2264. }
  2265. } else if (typeof val === 'number') {
  2266. val = val & 255
  2267. }
  2268. // Invalid ranges are not set to a default, so can range check early.
  2269. if (start < 0 || this.length < start || this.length < end) {
  2270. throw new RangeError('Out of range index')
  2271. }
  2272. if (end <= start) {
  2273. return this
  2274. }
  2275. start = start >>> 0
  2276. end = end === undefined ? this.length : end >>> 0
  2277. if (!val) val = 0
  2278. var i
  2279. if (typeof val === 'number') {
  2280. for (i = start; i < end; ++i) {
  2281. this[i] = val
  2282. }
  2283. } else {
  2284. var bytes = Buffer.isBuffer(val)
  2285. ? val
  2286. : utf8ToBytes(new Buffer(val, encoding).toString())
  2287. var len = bytes.length
  2288. for (i = 0; i < end - start; ++i) {
  2289. this[i + start] = bytes[i % len]
  2290. }
  2291. }
  2292. return this
  2293. }
  2294. // HELPER FUNCTIONS
  2295. // ================
  2296. var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g
  2297. function base64clean (str) {
  2298. // Node strips out invalid characters like \n and \t from the string, base64-js does not
  2299. str = stringtrim(str).replace(INVALID_BASE64_RE, '')
  2300. // Node converts strings with length < 2 to ''
  2301. if (str.length < 2) return ''
  2302. // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
  2303. while (str.length % 4 !== 0) {
  2304. str = str + '='
  2305. }
  2306. return str
  2307. }
  2308. function stringtrim (str) {
  2309. if (str.trim) return str.trim()
  2310. return str.replace(/^\s+|\s+$/g, '')
  2311. }
  2312. function toHex (n) {
  2313. if (n < 16) return '0' + n.toString(16)
  2314. return n.toString(16)
  2315. }
  2316. function utf8ToBytes (string, units) {
  2317. units = units || Infinity
  2318. var codePoint
  2319. var length = string.length
  2320. var leadSurrogate = null
  2321. var bytes = []
  2322. for (var i = 0; i < length; ++i) {
  2323. codePoint = string.charCodeAt(i)
  2324. // is surrogate component
  2325. if (codePoint > 0xD7FF && codePoint < 0xE000) {
  2326. // last char was a lead
  2327. if (!leadSurrogate) {
  2328. // no lead yet
  2329. if (codePoint > 0xDBFF) {
  2330. // unexpected trail
  2331. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  2332. continue
  2333. } else if (i + 1 === length) {
  2334. // unpaired lead
  2335. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  2336. continue
  2337. }
  2338. // valid lead
  2339. leadSurrogate = codePoint
  2340. continue
  2341. }
  2342. // 2 leads in a row
  2343. if (codePoint < 0xDC00) {
  2344. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  2345. leadSurrogate = codePoint
  2346. continue
  2347. }
  2348. // valid surrogate pair
  2349. codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000
  2350. } else if (leadSurrogate) {
  2351. // valid bmp char, but last char was a lead
  2352. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  2353. }
  2354. leadSurrogate = null
  2355. // encode utf8
  2356. if (codePoint < 0x80) {
  2357. if ((units -= 1) < 0) break
  2358. bytes.push(codePoint)
  2359. } else if (codePoint < 0x800) {
  2360. if ((units -= 2) < 0) break
  2361. bytes.push(
  2362. codePoint >> 0x6 | 0xC0,
  2363. codePoint & 0x3F | 0x80
  2364. )
  2365. } else if (codePoint < 0x10000) {
  2366. if ((units -= 3) < 0) break
  2367. bytes.push(
  2368. codePoint >> 0xC | 0xE0,
  2369. codePoint >> 0x6 & 0x3F | 0x80,
  2370. codePoint & 0x3F | 0x80
  2371. )
  2372. } else if (codePoint < 0x110000) {
  2373. if ((units -= 4) < 0) break
  2374. bytes.push(
  2375. codePoint >> 0x12 | 0xF0,
  2376. codePoint >> 0xC & 0x3F | 0x80,
  2377. codePoint >> 0x6 & 0x3F | 0x80,
  2378. codePoint & 0x3F | 0x80
  2379. )
  2380. } else {
  2381. throw new Error('Invalid code point')
  2382. }
  2383. }
  2384. return bytes
  2385. }
  2386. function asciiToBytes (str) {
  2387. var byteArray = []
  2388. for (var i = 0; i < str.length; ++i) {
  2389. // Node's code seems to be doing this and not & 0x7F..
  2390. byteArray.push(str.charCodeAt(i) & 0xFF)
  2391. }
  2392. return byteArray
  2393. }
  2394. function utf16leToBytes (str, units) {
  2395. var c, hi, lo
  2396. var byteArray = []
  2397. for (var i = 0; i < str.length; ++i) {
  2398. if ((units -= 2) < 0) break
  2399. c = str.charCodeAt(i)
  2400. hi = c >> 8
  2401. lo = c % 256
  2402. byteArray.push(lo)
  2403. byteArray.push(hi)
  2404. }
  2405. return byteArray
  2406. }
  2407. function base64ToBytes (str) {
  2408. return base64.toByteArray(base64clean(str))
  2409. }
  2410. function blitBuffer (src, dst, offset, length) {
  2411. for (var i = 0; i < length; ++i) {
  2412. if ((i + offset >= dst.length) || (i >= src.length)) break
  2413. dst[i + offset] = src[i]
  2414. }
  2415. return i
  2416. }
  2417. function isnan (val) {
  2418. return val !== val // eslint-disable-line no-self-compare
  2419. }
  2420. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(22)))
  2421. /***/ }),
  2422. /* 5 */
  2423. /***/ (function(module, exports, __webpack_require__) {
  2424. var global = __webpack_require__(8);
  2425. var core = __webpack_require__(39);
  2426. var hide = __webpack_require__(15);
  2427. var redefine = __webpack_require__(23);
  2428. var ctx = __webpack_require__(52);
  2429. var PROTOTYPE = 'prototype';
  2430. var $export = function (type, name, source) {
  2431. var IS_FORCED = type & $export.F;
  2432. var IS_GLOBAL = type & $export.G;
  2433. var IS_STATIC = type & $export.S;
  2434. var IS_PROTO = type & $export.P;
  2435. var IS_BIND = type & $export.B;
  2436. var target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE];
  2437. var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});
  2438. var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {});
  2439. var key, own, out, exp;
  2440. if (IS_GLOBAL) source = name;
  2441. for (key in source) {
  2442. // contains in native
  2443. own = !IS_FORCED && target && target[key] !== undefined;
  2444. // export native or passed
  2445. out = (own ? target : source)[key];
  2446. // bind timers to global for call from export context
  2447. exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
  2448. // extend global
  2449. if (target) redefine(target, key, out, type & $export.U);
  2450. // export
  2451. if (exports[key] != out) hide(exports, key, exp);
  2452. if (IS_PROTO && expProto[key] != out) expProto[key] = out;
  2453. }
  2454. };
  2455. global.core = core;
  2456. // type bitmap
  2457. $export.F = 1; // forced
  2458. $export.G = 2; // global
  2459. $export.S = 4; // static
  2460. $export.P = 8; // proto
  2461. $export.B = 16; // bind
  2462. $export.W = 32; // wrap
  2463. $export.U = 64; // safe
  2464. $export.R = 128; // real proto method for `library`
  2465. module.exports = $export;
  2466. /***/ }),
  2467. /* 6 */
  2468. /***/ (function(module, exports, __webpack_require__) {
  2469. ;(function (root, factory, undef) {
  2470. if (true) {
  2471. // CommonJS
  2472. module.exports = exports = factory(__webpack_require__(1), __webpack_require__(33));
  2473. }
  2474. else {}
  2475. }(this, function (CryptoJS) {
  2476. /**
  2477. * Cipher core components.
  2478. */
  2479. CryptoJS.lib.Cipher || (function (undefined) {
  2480. // Shortcuts
  2481. var C = CryptoJS;
  2482. var C_lib = C.lib;
  2483. var Base = C_lib.Base;
  2484. var WordArray = C_lib.WordArray;
  2485. var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm;
  2486. var C_enc = C.enc;
  2487. var Utf8 = C_enc.Utf8;
  2488. var Base64 = C_enc.Base64;
  2489. var C_algo = C.algo;
  2490. var EvpKDF = C_algo.EvpKDF;
  2491. /**
  2492. * Abstract base cipher template.
  2493. *
  2494. * @property {number} keySize This cipher's key size. Default: 4 (128 bits)
  2495. * @property {number} ivSize This cipher's IV size. Default: 4 (128 bits)
  2496. * @property {number} _ENC_XFORM_MODE A constant representing encryption mode.
  2497. * @property {number} _DEC_XFORM_MODE A constant representing decryption mode.
  2498. */
  2499. var Cipher = C_lib.Cipher = BufferedBlockAlgorithm.extend({
  2500. /**
  2501. * Configuration options.
  2502. *
  2503. * @property {WordArray} iv The IV to use for this operation.
  2504. */
  2505. cfg: Base.extend(),
  2506. /**
  2507. * Creates this cipher in encryption mode.
  2508. *
  2509. * @param {WordArray} key The key.
  2510. * @param {Object} cfg (Optional) The configuration options to use for this operation.
  2511. *
  2512. * @return {Cipher} A cipher instance.
  2513. *
  2514. * @static
  2515. *
  2516. * @example
  2517. *
  2518. * var cipher = CryptoJS.algo.AES.createEncryptor(keyWordArray, { iv: ivWordArray });
  2519. */
  2520. createEncryptor: function (key, cfg) {
  2521. return this.create(this._ENC_XFORM_MODE, key, cfg);
  2522. },
  2523. /**
  2524. * Creates this cipher in decryption mode.
  2525. *
  2526. * @param {WordArray} key The key.
  2527. * @param {Object} cfg (Optional) The configuration options to use for this operation.
  2528. *
  2529. * @return {Cipher} A cipher instance.
  2530. *
  2531. * @static
  2532. *
  2533. * @example
  2534. *
  2535. * var cipher = CryptoJS.algo.AES.createDecryptor(keyWordArray, { iv: ivWordArray });
  2536. */
  2537. createDecryptor: function (key, cfg) {
  2538. return this.create(this._DEC_XFORM_MODE, key, cfg);
  2539. },
  2540. /**
  2541. * Initializes a newly created cipher.
  2542. *
  2543. * @param {number} xformMode Either the encryption or decryption transormation mode constant.
  2544. * @param {WordArray} key The key.
  2545. * @param {Object} cfg (Optional) The configuration options to use for this operation.
  2546. *
  2547. * @example
  2548. *
  2549. * var cipher = CryptoJS.algo.AES.create(CryptoJS.algo.AES._ENC_XFORM_MODE, keyWordArray, { iv: ivWordArray });
  2550. */
  2551. init: function (xformMode, key, cfg) {
  2552. // Apply config defaults
  2553. this.cfg = this.cfg.extend(cfg);
  2554. // Store transform mode and key
  2555. this._xformMode = xformMode;
  2556. this._key = key;
  2557. // Set initial values
  2558. this.reset();
  2559. },
  2560. /**
  2561. * Resets this cipher to its initial state.
  2562. *
  2563. * @example
  2564. *
  2565. * cipher.reset();
  2566. */
  2567. reset: function () {
  2568. // Reset data buffer
  2569. BufferedBlockAlgorithm.reset.call(this);
  2570. // Perform concrete-cipher logic
  2571. this._doReset();
  2572. },
  2573. /**
  2574. * Adds data to be encrypted or decrypted.
  2575. *
  2576. * @param {WordArray|string} dataUpdate The data to encrypt or decrypt.
  2577. *
  2578. * @return {WordArray} The data after processing.
  2579. *
  2580. * @example
  2581. *
  2582. * var encrypted = cipher.process('data');
  2583. * var encrypted = cipher.process(wordArray);
  2584. */
  2585. process: function (dataUpdate) {
  2586. // Append
  2587. this._append(dataUpdate);
  2588. // Process available blocks
  2589. return this._process();
  2590. },
  2591. /**
  2592. * Finalizes the encryption or decryption process.
  2593. * Note that the finalize operation is effectively a destructive, read-once operation.
  2594. *
  2595. * @param {WordArray|string} dataUpdate The final data to encrypt or decrypt.
  2596. *
  2597. * @return {WordArray} The data after final processing.
  2598. *
  2599. * @example
  2600. *
  2601. * var encrypted = cipher.finalize();
  2602. * var encrypted = cipher.finalize('data');
  2603. * var encrypted = cipher.finalize(wordArray);
  2604. */
  2605. finalize: function (dataUpdate) {
  2606. // Final data update
  2607. if (dataUpdate) {
  2608. this._append(dataUpdate);
  2609. }
  2610. // Perform concrete-cipher logic
  2611. var finalProcessedData = this._doFinalize();
  2612. return finalProcessedData;
  2613. },
  2614. keySize: 128/32,
  2615. ivSize: 128/32,
  2616. _ENC_XFORM_MODE: 1,
  2617. _DEC_XFORM_MODE: 2,
  2618. /**
  2619. * Creates shortcut functions to a cipher's object interface.
  2620. *
  2621. * @param {Cipher} cipher The cipher to create a helper for.
  2622. *
  2623. * @return {Object} An object with encrypt and decrypt shortcut functions.
  2624. *
  2625. * @static
  2626. *
  2627. * @example
  2628. *
  2629. * var AES = CryptoJS.lib.Cipher._createHelper(CryptoJS.algo.AES);
  2630. */
  2631. _createHelper: (function () {
  2632. function selectCipherStrategy(key) {
  2633. if (typeof key == 'string') {
  2634. return PasswordBasedCipher;
  2635. } else {
  2636. return SerializableCipher;
  2637. }
  2638. }
  2639. return function (cipher) {
  2640. return {
  2641. encrypt: function (message, key, cfg) {
  2642. return selectCipherStrategy(key).encrypt(cipher, message, key, cfg);
  2643. },
  2644. decrypt: function (ciphertext, key, cfg) {
  2645. return selectCipherStrategy(key).decrypt(cipher, ciphertext, key, cfg);
  2646. }
  2647. };
  2648. };
  2649. }())
  2650. });
  2651. /**
  2652. * Abstract base stream cipher template.
  2653. *
  2654. * @property {number} blockSize The number of 32-bit words this cipher operates on. Default: 1 (32 bits)
  2655. */
  2656. var StreamCipher = C_lib.StreamCipher = Cipher.extend({
  2657. _doFinalize: function () {
  2658. // Process partial blocks
  2659. var finalProcessedBlocks = this._process(!!'flush');
  2660. return finalProcessedBlocks;
  2661. },
  2662. blockSize: 1
  2663. });
  2664. /**
  2665. * Mode namespace.
  2666. */
  2667. var C_mode = C.mode = {};
  2668. /**
  2669. * Abstract base block cipher mode template.
  2670. */
  2671. var BlockCipherMode = C_lib.BlockCipherMode = Base.extend({
  2672. /**
  2673. * Creates this mode for encryption.
  2674. *
  2675. * @param {Cipher} cipher A block cipher instance.
  2676. * @param {Array} iv The IV words.
  2677. *
  2678. * @static
  2679. *
  2680. * @example
  2681. *
  2682. * var mode = CryptoJS.mode.CBC.createEncryptor(cipher, iv.words);
  2683. */
  2684. createEncryptor: function (cipher, iv) {
  2685. return this.Encryptor.create(cipher, iv);
  2686. },
  2687. /**
  2688. * Creates this mode for decryption.
  2689. *
  2690. * @param {Cipher} cipher A block cipher instance.
  2691. * @param {Array} iv The IV words.
  2692. *
  2693. * @static
  2694. *
  2695. * @example
  2696. *
  2697. * var mode = CryptoJS.mode.CBC.createDecryptor(cipher, iv.words);
  2698. */
  2699. createDecryptor: function (cipher, iv) {
  2700. return this.Decryptor.create(cipher, iv);
  2701. },
  2702. /**
  2703. * Initializes a newly created mode.
  2704. *
  2705. * @param {Cipher} cipher A block cipher instance.
  2706. * @param {Array} iv The IV words.
  2707. *
  2708. * @example
  2709. *
  2710. * var mode = CryptoJS.mode.CBC.Encryptor.create(cipher, iv.words);
  2711. */
  2712. init: function (cipher, iv) {
  2713. this._cipher = cipher;
  2714. this._iv = iv;
  2715. }
  2716. });
  2717. /**
  2718. * Cipher Block Chaining mode.
  2719. */
  2720. var CBC = C_mode.CBC = (function () {
  2721. /**
  2722. * Abstract base CBC mode.
  2723. */
  2724. var CBC = BlockCipherMode.extend();
  2725. /**
  2726. * CBC encryptor.
  2727. */
  2728. CBC.Encryptor = CBC.extend({
  2729. /**
  2730. * Processes the data block at offset.
  2731. *
  2732. * @param {Array} words The data words to operate on.
  2733. * @param {number} offset The offset where the block starts.
  2734. *
  2735. * @example
  2736. *
  2737. * mode.processBlock(data.words, offset);
  2738. */
  2739. processBlock: function (words, offset) {
  2740. // Shortcuts
  2741. var cipher = this._cipher;
  2742. var blockSize = cipher.blockSize;
  2743. // XOR and encrypt
  2744. xorBlock.call(this, words, offset, blockSize);
  2745. cipher.encryptBlock(words, offset);
  2746. // Remember this block to use with next block
  2747. this._prevBlock = words.slice(offset, offset + blockSize);
  2748. }
  2749. });
  2750. /**
  2751. * CBC decryptor.
  2752. */
  2753. CBC.Decryptor = CBC.extend({
  2754. /**
  2755. * Processes the data block at offset.
  2756. *
  2757. * @param {Array} words The data words to operate on.
  2758. * @param {number} offset The offset where the block starts.
  2759. *
  2760. * @example
  2761. *
  2762. * mode.processBlock(data.words, offset);
  2763. */
  2764. processBlock: function (words, offset) {
  2765. // Shortcuts
  2766. var cipher = this._cipher;
  2767. var blockSize = cipher.blockSize;
  2768. // Remember this block to use with next block
  2769. var thisBlock = words.slice(offset, offset + blockSize);
  2770. // Decrypt and XOR
  2771. cipher.decryptBlock(words, offset);
  2772. xorBlock.call(this, words, offset, blockSize);
  2773. // This block becomes the previous block
  2774. this._prevBlock = thisBlock;
  2775. }
  2776. });
  2777. function xorBlock(words, offset, blockSize) {
  2778. // Shortcut
  2779. var iv = this._iv;
  2780. // Choose mixing block
  2781. if (iv) {
  2782. var block = iv;
  2783. // Remove IV for subsequent blocks
  2784. this._iv = undefined;
  2785. } else {
  2786. var block = this._prevBlock;
  2787. }
  2788. // XOR blocks
  2789. for (var i = 0; i < blockSize; i++) {
  2790. words[offset + i] ^= block[i];
  2791. }
  2792. }
  2793. return CBC;
  2794. }());
  2795. /**
  2796. * Padding namespace.
  2797. */
  2798. var C_pad = C.pad = {};
  2799. /**
  2800. * PKCS #5/7 padding strategy.
  2801. */
  2802. var Pkcs7 = C_pad.Pkcs7 = {
  2803. /**
  2804. * Pads data using the algorithm defined in PKCS #5/7.
  2805. *
  2806. * @param {WordArray} data The data to pad.
  2807. * @param {number} blockSize The multiple that the data should be padded to.
  2808. *
  2809. * @static
  2810. *
  2811. * @example
  2812. *
  2813. * CryptoJS.pad.Pkcs7.pad(wordArray, 4);
  2814. */
  2815. pad: function (data, blockSize) {
  2816. // Shortcut
  2817. var blockSizeBytes = blockSize * 4;
  2818. // Count padding bytes
  2819. var nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes;
  2820. // Create padding word
  2821. var paddingWord = (nPaddingBytes << 24) | (nPaddingBytes << 16) | (nPaddingBytes << 8) | nPaddingBytes;
  2822. // Create padding
  2823. var paddingWords = [];
  2824. for (var i = 0; i < nPaddingBytes; i += 4) {
  2825. paddingWords.push(paddingWord);
  2826. }
  2827. var padding = WordArray.create(paddingWords, nPaddingBytes);
  2828. // Add padding
  2829. data.concat(padding);
  2830. },
  2831. /**
  2832. * Unpads data that had been padded using the algorithm defined in PKCS #5/7.
  2833. *
  2834. * @param {WordArray} data The data to unpad.
  2835. *
  2836. * @static
  2837. *
  2838. * @example
  2839. *
  2840. * CryptoJS.pad.Pkcs7.unpad(wordArray);
  2841. */
  2842. unpad: function (data) {
  2843. // Get number of padding bytes from last byte
  2844. var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff;
  2845. // Remove padding
  2846. data.sigBytes -= nPaddingBytes;
  2847. }
  2848. };
  2849. /**
  2850. * Abstract base block cipher template.
  2851. *
  2852. * @property {number} blockSize The number of 32-bit words this cipher operates on. Default: 4 (128 bits)
  2853. */
  2854. var BlockCipher = C_lib.BlockCipher = Cipher.extend({
  2855. /**
  2856. * Configuration options.
  2857. *
  2858. * @property {Mode} mode The block mode to use. Default: CBC
  2859. * @property {Padding} padding The padding strategy to use. Default: Pkcs7
  2860. */
  2861. cfg: Cipher.cfg.extend({
  2862. mode: CBC,
  2863. padding: Pkcs7
  2864. }),
  2865. reset: function () {
  2866. // Reset cipher
  2867. Cipher.reset.call(this);
  2868. // Shortcuts
  2869. var cfg = this.cfg;
  2870. var iv = cfg.iv;
  2871. var mode = cfg.mode;
  2872. // Reset block mode
  2873. if (this._xformMode == this._ENC_XFORM_MODE) {
  2874. var modeCreator = mode.createEncryptor;
  2875. } else /* if (this._xformMode == this._DEC_XFORM_MODE) */ {
  2876. var modeCreator = mode.createDecryptor;
  2877. // Keep at least one block in the buffer for unpadding
  2878. this._minBufferSize = 1;
  2879. }
  2880. if (this._mode && this._mode.__creator == modeCreator) {
  2881. this._mode.init(this, iv && iv.words);
  2882. } else {
  2883. this._mode = modeCreator.call(mode, this, iv && iv.words);
  2884. this._mode.__creator = modeCreator;
  2885. }
  2886. },
  2887. _doProcessBlock: function (words, offset) {
  2888. this._mode.processBlock(words, offset);
  2889. },
  2890. _doFinalize: function () {
  2891. // Shortcut
  2892. var padding = this.cfg.padding;
  2893. // Finalize
  2894. if (this._xformMode == this._ENC_XFORM_MODE) {
  2895. // Pad data
  2896. padding.pad(this._data, this.blockSize);
  2897. // Process final blocks
  2898. var finalProcessedBlocks = this._process(!!'flush');
  2899. } else /* if (this._xformMode == this._DEC_XFORM_MODE) */ {
  2900. // Process final blocks
  2901. var finalProcessedBlocks = this._process(!!'flush');
  2902. // Unpad data
  2903. padding.unpad(finalProcessedBlocks);
  2904. }
  2905. return finalProcessedBlocks;
  2906. },
  2907. blockSize: 128/32
  2908. });
  2909. /**
  2910. * A collection of cipher parameters.
  2911. *
  2912. * @property {WordArray} ciphertext The raw ciphertext.
  2913. * @property {WordArray} key The key to this ciphertext.
  2914. * @property {WordArray} iv The IV used in the ciphering operation.
  2915. * @property {WordArray} salt The salt used with a key derivation function.
  2916. * @property {Cipher} algorithm The cipher algorithm.
  2917. * @property {Mode} mode The block mode used in the ciphering operation.
  2918. * @property {Padding} padding The padding scheme used in the ciphering operation.
  2919. * @property {number} blockSize The block size of the cipher.
  2920. * @property {Format} formatter The default formatting strategy to convert this cipher params object to a string.
  2921. */
  2922. var CipherParams = C_lib.CipherParams = Base.extend({
  2923. /**
  2924. * Initializes a newly created cipher params object.
  2925. *
  2926. * @param {Object} cipherParams An object with any of the possible cipher parameters.
  2927. *
  2928. * @example
  2929. *
  2930. * var cipherParams = CryptoJS.lib.CipherParams.create({
  2931. * ciphertext: ciphertextWordArray,
  2932. * key: keyWordArray,
  2933. * iv: ivWordArray,
  2934. * salt: saltWordArray,
  2935. * algorithm: CryptoJS.algo.AES,
  2936. * mode: CryptoJS.mode.CBC,
  2937. * padding: CryptoJS.pad.PKCS7,
  2938. * blockSize: 4,
  2939. * formatter: CryptoJS.format.OpenSSL
  2940. * });
  2941. */
  2942. init: function (cipherParams) {
  2943. this.mixIn(cipherParams);
  2944. },
  2945. /**
  2946. * Converts this cipher params object to a string.
  2947. *
  2948. * @param {Format} formatter (Optional) The formatting strategy to use.
  2949. *
  2950. * @return {string} The stringified cipher params.
  2951. *
  2952. * @throws Error If neither the formatter nor the default formatter is set.
  2953. *
  2954. * @example
  2955. *
  2956. * var string = cipherParams + '';
  2957. * var string = cipherParams.toString();
  2958. * var string = cipherParams.toString(CryptoJS.format.OpenSSL);
  2959. */
  2960. toString: function (formatter) {
  2961. return (formatter || this.formatter).stringify(this);
  2962. }
  2963. });
  2964. /**
  2965. * Format namespace.
  2966. */
  2967. var C_format = C.format = {};
  2968. /**
  2969. * OpenSSL formatting strategy.
  2970. */
  2971. var OpenSSLFormatter = C_format.OpenSSL = {
  2972. /**
  2973. * Converts a cipher params object to an OpenSSL-compatible string.
  2974. *
  2975. * @param {CipherParams} cipherParams The cipher params object.
  2976. *
  2977. * @return {string} The OpenSSL-compatible string.
  2978. *
  2979. * @static
  2980. *
  2981. * @example
  2982. *
  2983. * var openSSLString = CryptoJS.format.OpenSSL.stringify(cipherParams);
  2984. */
  2985. stringify: function (cipherParams) {
  2986. // Shortcuts
  2987. var ciphertext = cipherParams.ciphertext;
  2988. var salt = cipherParams.salt;
  2989. // Format
  2990. if (salt) {
  2991. var wordArray = WordArray.create([0x53616c74, 0x65645f5f]).concat(salt).concat(ciphertext);
  2992. } else {
  2993. var wordArray = ciphertext;
  2994. }
  2995. return wordArray.toString(Base64);
  2996. },
  2997. /**
  2998. * Converts an OpenSSL-compatible string to a cipher params object.
  2999. *
  3000. * @param {string} openSSLStr The OpenSSL-compatible string.
  3001. *
  3002. * @return {CipherParams} The cipher params object.
  3003. *
  3004. * @static
  3005. *
  3006. * @example
  3007. *
  3008. * var cipherParams = CryptoJS.format.OpenSSL.parse(openSSLString);
  3009. */
  3010. parse: function (openSSLStr) {
  3011. // Parse base64
  3012. var ciphertext = Base64.parse(openSSLStr);
  3013. // Shortcut
  3014. var ciphertextWords = ciphertext.words;
  3015. // Test for salt
  3016. if (ciphertextWords[0] == 0x53616c74 && ciphertextWords[1] == 0x65645f5f) {
  3017. // Extract salt
  3018. var salt = WordArray.create(ciphertextWords.slice(2, 4));
  3019. // Remove salt from ciphertext
  3020. ciphertextWords.splice(0, 4);
  3021. ciphertext.sigBytes -= 16;
  3022. }
  3023. return CipherParams.create({ ciphertext: ciphertext, salt: salt });
  3024. }
  3025. };
  3026. /**
  3027. * A cipher wrapper that returns ciphertext as a serializable cipher params object.
  3028. */
  3029. var SerializableCipher = C_lib.SerializableCipher = Base.extend({
  3030. /**
  3031. * Configuration options.
  3032. *
  3033. * @property {Formatter} format The formatting strategy to convert cipher param objects to and from a string. Default: OpenSSL
  3034. */
  3035. cfg: Base.extend({
  3036. format: OpenSSLFormatter
  3037. }),
  3038. /**
  3039. * Encrypts a message.
  3040. *
  3041. * @param {Cipher} cipher The cipher algorithm to use.
  3042. * @param {WordArray|string} message The message to encrypt.
  3043. * @param {WordArray} key The key.
  3044. * @param {Object} cfg (Optional) The configuration options to use for this operation.
  3045. *
  3046. * @return {CipherParams} A cipher params object.
  3047. *
  3048. * @static
  3049. *
  3050. * @example
  3051. *
  3052. * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key);
  3053. * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv });
  3054. * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv, format: CryptoJS.format.OpenSSL });
  3055. */
  3056. encrypt: function (cipher, message, key, cfg) {
  3057. // Apply config defaults
  3058. cfg = this.cfg.extend(cfg);
  3059. // Encrypt
  3060. var encryptor = cipher.createEncryptor(key, cfg);
  3061. var ciphertext = encryptor.finalize(message);
  3062. // Shortcut
  3063. var cipherCfg = encryptor.cfg;
  3064. // Create and return serializable cipher params
  3065. return CipherParams.create({
  3066. ciphertext: ciphertext,
  3067. key: key,
  3068. iv: cipherCfg.iv,
  3069. algorithm: cipher,
  3070. mode: cipherCfg.mode,
  3071. padding: cipherCfg.padding,
  3072. blockSize: cipher.blockSize,
  3073. formatter: cfg.format
  3074. });
  3075. },
  3076. /**
  3077. * Decrypts serialized ciphertext.
  3078. *
  3079. * @param {Cipher} cipher The cipher algorithm to use.
  3080. * @param {CipherParams|string} ciphertext The ciphertext to decrypt.
  3081. * @param {WordArray} key The key.
  3082. * @param {Object} cfg (Optional) The configuration options to use for this operation.
  3083. *
  3084. * @return {WordArray} The plaintext.
  3085. *
  3086. * @static
  3087. *
  3088. * @example
  3089. *
  3090. * var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, key, { iv: iv, format: CryptoJS.format.OpenSSL });
  3091. * var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, key, { iv: iv, format: CryptoJS.format.OpenSSL });
  3092. */
  3093. decrypt: function (cipher, ciphertext, key, cfg) {
  3094. // Apply config defaults
  3095. cfg = this.cfg.extend(cfg);
  3096. // Convert string to CipherParams
  3097. ciphertext = this._parse(ciphertext, cfg.format);
  3098. // Decrypt
  3099. var plaintext = cipher.createDecryptor(key, cfg).finalize(ciphertext.ciphertext);
  3100. return plaintext;
  3101. },
  3102. /**
  3103. * Converts serialized ciphertext to CipherParams,
  3104. * else assumed CipherParams already and returns ciphertext unchanged.
  3105. *
  3106. * @param {CipherParams|string} ciphertext The ciphertext.
  3107. * @param {Formatter} format The formatting strategy to use to parse serialized ciphertext.
  3108. *
  3109. * @return {CipherParams} The unserialized ciphertext.
  3110. *
  3111. * @static
  3112. *
  3113. * @example
  3114. *
  3115. * var ciphertextParams = CryptoJS.lib.SerializableCipher._parse(ciphertextStringOrParams, format);
  3116. */
  3117. _parse: function (ciphertext, format) {
  3118. if (typeof ciphertext == 'string') {
  3119. return format.parse(ciphertext, this);
  3120. } else {
  3121. return ciphertext;
  3122. }
  3123. }
  3124. });
  3125. /**
  3126. * Key derivation function namespace.
  3127. */
  3128. var C_kdf = C.kdf = {};
  3129. /**
  3130. * OpenSSL key derivation function.
  3131. */
  3132. var OpenSSLKdf = C_kdf.OpenSSL = {
  3133. /**
  3134. * Derives a key and IV from a password.
  3135. *
  3136. * @param {string} password The password to derive from.
  3137. * @param {number} keySize The size in words of the key to generate.
  3138. * @param {number} ivSize The size in words of the IV to generate.
  3139. * @param {WordArray|string} salt (Optional) A 64-bit salt to use. If omitted, a salt will be generated randomly.
  3140. *
  3141. * @return {CipherParams} A cipher params object with the key, IV, and salt.
  3142. *
  3143. * @static
  3144. *
  3145. * @example
  3146. *
  3147. * var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32);
  3148. * var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32, 'saltsalt');
  3149. */
  3150. execute: function (password, keySize, ivSize, salt) {
  3151. // Generate random salt
  3152. if (!salt) {
  3153. salt = WordArray.random(64/8);
  3154. }
  3155. // Derive key and IV
  3156. var key = EvpKDF.create({ keySize: keySize + ivSize }).compute(password, salt);
  3157. // Separate key and IV
  3158. var iv = WordArray.create(key.words.slice(keySize), ivSize * 4);
  3159. key.sigBytes = keySize * 4;
  3160. // Return params
  3161. return CipherParams.create({ key: key, iv: iv, salt: salt });
  3162. }
  3163. };
  3164. /**
  3165. * A serializable cipher wrapper that derives the key from a password,
  3166. * and returns ciphertext as a serializable cipher params object.
  3167. */
  3168. var PasswordBasedCipher = C_lib.PasswordBasedCipher = SerializableCipher.extend({
  3169. /**
  3170. * Configuration options.
  3171. *
  3172. * @property {KDF} kdf The key derivation function to use to generate a key and IV from a password. Default: OpenSSL
  3173. */
  3174. cfg: SerializableCipher.cfg.extend({
  3175. kdf: OpenSSLKdf
  3176. }),
  3177. /**
  3178. * Encrypts a message using a password.
  3179. *
  3180. * @param {Cipher} cipher The cipher algorithm to use.
  3181. * @param {WordArray|string} message The message to encrypt.
  3182. * @param {string} password The password.
  3183. * @param {Object} cfg (Optional) The configuration options to use for this operation.
  3184. *
  3185. * @return {CipherParams} A cipher params object.
  3186. *
  3187. * @static
  3188. *
  3189. * @example
  3190. *
  3191. * var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password');
  3192. * var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password', { format: CryptoJS.format.OpenSSL });
  3193. */
  3194. encrypt: function (cipher, message, password, cfg) {
  3195. // Apply config defaults
  3196. cfg = this.cfg.extend(cfg);
  3197. // Derive key and other params
  3198. var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize);
  3199. // Add IV to config
  3200. cfg.iv = derivedParams.iv;
  3201. // Encrypt
  3202. var ciphertext = SerializableCipher.encrypt.call(this, cipher, message, derivedParams.key, cfg);
  3203. // Mix in derived params
  3204. ciphertext.mixIn(derivedParams);
  3205. return ciphertext;
  3206. },
  3207. /**
  3208. * Decrypts serialized ciphertext using a password.
  3209. *
  3210. * @param {Cipher} cipher The cipher algorithm to use.
  3211. * @param {CipherParams|string} ciphertext The ciphertext to decrypt.
  3212. * @param {string} password The password.
  3213. * @param {Object} cfg (Optional) The configuration options to use for this operation.
  3214. *
  3215. * @return {WordArray} The plaintext.
  3216. *
  3217. * @static
  3218. *
  3219. * @example
  3220. *
  3221. * var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, 'password', { format: CryptoJS.format.OpenSSL });
  3222. * var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, 'password', { format: CryptoJS.format.OpenSSL });
  3223. */
  3224. decrypt: function (cipher, ciphertext, password, cfg) {
  3225. // Apply config defaults
  3226. cfg = this.cfg.extend(cfg);
  3227. // Convert string to CipherParams
  3228. ciphertext = this._parse(ciphertext, cfg.format);
  3229. // Derive key and other params
  3230. var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize, ciphertext.salt);
  3231. // Add IV to config
  3232. cfg.iv = derivedParams.iv;
  3233. // Decrypt
  3234. var plaintext = SerializableCipher.decrypt.call(this, cipher, ciphertext, derivedParams.key, cfg);
  3235. return plaintext;
  3236. }
  3237. });
  3238. }());
  3239. }));
  3240. /***/ }),
  3241. /* 7 */
  3242. /***/ (function(module, exports, __webpack_require__) {
  3243. var global = __webpack_require__(21);
  3244. var core = __webpack_require__(2);
  3245. var ctx = __webpack_require__(38);
  3246. var hide = __webpack_require__(27);
  3247. var has = __webpack_require__(36);
  3248. var PROTOTYPE = 'prototype';
  3249. var $export = function (type, name, source) {
  3250. var IS_FORCED = type & $export.F;
  3251. var IS_GLOBAL = type & $export.G;
  3252. var IS_STATIC = type & $export.S;
  3253. var IS_PROTO = type & $export.P;
  3254. var IS_BIND = type & $export.B;
  3255. var IS_WRAP = type & $export.W;
  3256. var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});
  3257. var expProto = exports[PROTOTYPE];
  3258. var target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE];
  3259. var key, own, out;
  3260. if (IS_GLOBAL) source = name;
  3261. for (key in source) {
  3262. // contains in native
  3263. own = !IS_FORCED && target && target[key] !== undefined;
  3264. if (own && has(exports, key)) continue;
  3265. // export native or passed
  3266. out = own ? target[key] : source[key];
  3267. // prevent global pollution for namespaces
  3268. exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]
  3269. // bind timers to global for call from export context
  3270. : IS_BIND && own ? ctx(out, global)
  3271. // wrap global constructors for prevent change them in library
  3272. : IS_WRAP && target[key] == out ? (function (C) {
  3273. var F = function (a, b, c) {
  3274. if (this instanceof C) {
  3275. switch (arguments.length) {
  3276. case 0: return new C();
  3277. case 1: return new C(a);
  3278. case 2: return new C(a, b);
  3279. } return new C(a, b, c);
  3280. } return C.apply(this, arguments);
  3281. };
  3282. F[PROTOTYPE] = C[PROTOTYPE];
  3283. return F;
  3284. // make static versions for prototype methods
  3285. })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
  3286. // export proto methods to core.%CONSTRUCTOR%.methods.%NAME%
  3287. if (IS_PROTO) {
  3288. (exports.virtual || (exports.virtual = {}))[key] = out;
  3289. // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%
  3290. if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out);
  3291. }
  3292. }
  3293. };
  3294. // type bitmap
  3295. $export.F = 1; // forced
  3296. $export.G = 2; // global
  3297. $export.S = 4; // static
  3298. $export.P = 8; // proto
  3299. $export.B = 16; // bind
  3300. $export.W = 32; // wrap
  3301. $export.U = 64; // safe
  3302. $export.R = 128; // real proto method for `library`
  3303. module.exports = $export;
  3304. /***/ }),
  3305. /* 8 */
  3306. /***/ (function(module, exports) {
  3307. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  3308. var global = module.exports = typeof window != 'undefined' && window.Math == Math
  3309. ? window : typeof self != 'undefined' && self.Math == Math ? self
  3310. // eslint-disable-next-line no-new-func
  3311. : Function('return this')();
  3312. if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef
  3313. /***/ }),
  3314. /* 9 */
  3315. /***/ (function(module, exports, __webpack_require__) {
  3316. // Thank's IE8 for his funny defineProperty
  3317. module.exports = !__webpack_require__(10)(function () {
  3318. return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
  3319. });
  3320. /***/ }),
  3321. /* 10 */
  3322. /***/ (function(module, exports) {
  3323. module.exports = function (exec) {
  3324. try {
  3325. return !!exec();
  3326. } catch (e) {
  3327. return true;
  3328. }
  3329. };
  3330. /***/ }),
  3331. /* 11 */
  3332. /***/ (function(module, exports, __webpack_require__) {
  3333. var anObject = __webpack_require__(12);
  3334. var IE8_DOM_DEFINE = __webpack_require__(134);
  3335. var toPrimitive = __webpack_require__(51);
  3336. var dP = Object.defineProperty;
  3337. exports.f = __webpack_require__(9) ? Object.defineProperty : function defineProperty(O, P, Attributes) {
  3338. anObject(O);
  3339. P = toPrimitive(P, true);
  3340. anObject(Attributes);
  3341. if (IE8_DOM_DEFINE) try {
  3342. return dP(O, P, Attributes);
  3343. } catch (e) { /* empty */ }
  3344. if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
  3345. if ('value' in Attributes) O[P] = Attributes.value;
  3346. return O;
  3347. };
  3348. /***/ }),
  3349. /* 12 */
  3350. /***/ (function(module, exports, __webpack_require__) {
  3351. var isObject = __webpack_require__(18);
  3352. module.exports = function (it) {
  3353. if (!isObject(it)) throw TypeError(it + ' is not an object!');
  3354. return it;
  3355. };
  3356. /***/ }),
  3357. /* 13 */
  3358. /***/ (function(module, exports, __webpack_require__) {
  3359. // Thank's IE8 for his funny defineProperty
  3360. module.exports = !__webpack_require__(37)(function () {
  3361. return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
  3362. });
  3363. /***/ }),
  3364. /* 14 */
  3365. /***/ (function(module, exports, __webpack_require__) {
  3366. var store = __webpack_require__(119)('wks');
  3367. var uid = __webpack_require__(78);
  3368. var Symbol = __webpack_require__(21).Symbol;
  3369. var USE_SYMBOL = typeof Symbol == 'function';
  3370. var $exports = module.exports = function (name) {
  3371. return store[name] || (store[name] =
  3372. USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));
  3373. };
  3374. $exports.store = store;
  3375. /***/ }),
  3376. /* 15 */
  3377. /***/ (function(module, exports, __webpack_require__) {
  3378. var dP = __webpack_require__(11);
  3379. var createDesc = __webpack_require__(40);
  3380. module.exports = __webpack_require__(9) ? function (object, key, value) {
  3381. return dP.f(object, key, createDesc(1, value));
  3382. } : function (object, key, value) {
  3383. object[key] = value;
  3384. return object;
  3385. };
  3386. /***/ }),
  3387. /* 16 */
  3388. /***/ (function(module, exports, __webpack_require__) {
  3389. // 7.1.15 ToLength
  3390. var toInteger = __webpack_require__(31);
  3391. var min = Math.min;
  3392. module.exports = function (it) {
  3393. return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
  3394. };
  3395. /***/ }),
  3396. /* 17 */
  3397. /***/ (function(module, exports, __webpack_require__) {
  3398. var anObject = __webpack_require__(28);
  3399. var IE8_DOM_DEFINE = __webpack_require__(180);
  3400. var toPrimitive = __webpack_require__(114);
  3401. var dP = Object.defineProperty;
  3402. exports.f = __webpack_require__(13) ? Object.defineProperty : function defineProperty(O, P, Attributes) {
  3403. anObject(O);
  3404. P = toPrimitive(P, true);
  3405. anObject(Attributes);
  3406. if (IE8_DOM_DEFINE) try {
  3407. return dP(O, P, Attributes);
  3408. } catch (e) { /* empty */ }
  3409. if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
  3410. if ('value' in Attributes) O[P] = Attributes.value;
  3411. return O;
  3412. };
  3413. /***/ }),
  3414. /* 18 */
  3415. /***/ (function(module, exports) {
  3416. module.exports = function (it) {
  3417. return typeof it === 'object' ? it !== null : typeof it === 'function';
  3418. };
  3419. /***/ }),
  3420. /* 19 */
  3421. /***/ (function(module, exports, __webpack_require__) {
  3422. // 7.1.13 ToObject(argument)
  3423. var defined = __webpack_require__(30);
  3424. module.exports = function (it) {
  3425. return Object(defined(it));
  3426. };
  3427. /***/ }),
  3428. /* 20 */
  3429. /***/ (function(module, exports) {
  3430. module.exports = function (it) {
  3431. return typeof it === 'object' ? it !== null : typeof it === 'function';
  3432. };
  3433. /***/ }),
  3434. /* 21 */
  3435. /***/ (function(module, exports) {
  3436. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  3437. var global = module.exports = typeof window != 'undefined' && window.Math == Math
  3438. ? window : typeof self != 'undefined' && self.Math == Math ? self
  3439. // eslint-disable-next-line no-new-func
  3440. : Function('return this')();
  3441. if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef
  3442. /***/ }),
  3443. /* 22 */
  3444. /***/ (function(module, exports) {
  3445. var g;
  3446. // This works in non-strict mode
  3447. g = (function() {
  3448. return this;
  3449. })();
  3450. try {
  3451. // This works if eval is allowed (see CSP)
  3452. g = g || new Function("return this")();
  3453. } catch (e) {
  3454. // This works if the window reference is available
  3455. if (typeof window === "object") g = window;
  3456. }
  3457. // g can still be undefined, but nothing to do about it...
  3458. // We return undefined, instead of nothing here, so it's
  3459. // easier to handle this case. if(!global) { ...}
  3460. module.exports = g;
  3461. /***/ }),
  3462. /* 23 */
  3463. /***/ (function(module, exports, __webpack_require__) {
  3464. var global = __webpack_require__(8);
  3465. var hide = __webpack_require__(15);
  3466. var has = __webpack_require__(24);
  3467. var SRC = __webpack_require__(29)('src');
  3468. var $toString = __webpack_require__(223);
  3469. var TO_STRING = 'toString';
  3470. var TPL = ('' + $toString).split(TO_STRING);
  3471. __webpack_require__(39).inspectSource = function (it) {
  3472. return $toString.call(it);
  3473. };
  3474. (module.exports = function (O, key, val, safe) {
  3475. var isFunction = typeof val == 'function';
  3476. if (isFunction) has(val, 'name') || hide(val, 'name', key);
  3477. if (O[key] === val) return;
  3478. if (isFunction) has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key)));
  3479. if (O === global) {
  3480. O[key] = val;
  3481. } else if (!safe) {
  3482. delete O[key];
  3483. hide(O, key, val);
  3484. } else if (O[key]) {
  3485. O[key] = val;
  3486. } else {
  3487. hide(O, key, val);
  3488. }
  3489. // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
  3490. })(Function.prototype, TO_STRING, function toString() {
  3491. return typeof this == 'function' && this[SRC] || $toString.call(this);
  3492. });
  3493. /***/ }),
  3494. /* 24 */
  3495. /***/ (function(module, exports) {
  3496. var hasOwnProperty = {}.hasOwnProperty;
  3497. module.exports = function (it, key) {
  3498. return hasOwnProperty.call(it, key);
  3499. };
  3500. /***/ }),
  3501. /* 25 */
  3502. /***/ (function(module, exports) {
  3503. // shim for using process in browser
  3504. var process = module.exports = {};
  3505. // cached from whatever global is present so that test runners that stub it
  3506. // don't break things. But we need to wrap it in a try catch in case it is
  3507. // wrapped in strict mode code which doesn't define any globals. It's inside a
  3508. // function because try/catches deoptimize in certain engines.
  3509. var cachedSetTimeout;
  3510. var cachedClearTimeout;
  3511. function defaultSetTimout() {
  3512. throw new Error('setTimeout has not been defined');
  3513. }
  3514. function defaultClearTimeout () {
  3515. throw new Error('clearTimeout has not been defined');
  3516. }
  3517. (function () {
  3518. try {
  3519. if (typeof setTimeout === 'function') {
  3520. cachedSetTimeout = setTimeout;
  3521. } else {
  3522. cachedSetTimeout = defaultSetTimout;
  3523. }
  3524. } catch (e) {
  3525. cachedSetTimeout = defaultSetTimout;
  3526. }
  3527. try {
  3528. if (typeof clearTimeout === 'function') {
  3529. cachedClearTimeout = clearTimeout;
  3530. } else {
  3531. cachedClearTimeout = defaultClearTimeout;
  3532. }
  3533. } catch (e) {
  3534. cachedClearTimeout = defaultClearTimeout;
  3535. }
  3536. } ())
  3537. function runTimeout(fun) {
  3538. if (cachedSetTimeout === setTimeout) {
  3539. //normal enviroments in sane situations
  3540. return setTimeout(fun, 0);
  3541. }
  3542. // if setTimeout wasn't available but was latter defined
  3543. if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
  3544. cachedSetTimeout = setTimeout;
  3545. return setTimeout(fun, 0);
  3546. }
  3547. try {
  3548. // when when somebody has screwed with setTimeout but no I.E. maddness
  3549. return cachedSetTimeout(fun, 0);
  3550. } catch(e){
  3551. try {
  3552. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  3553. return cachedSetTimeout.call(null, fun, 0);
  3554. } catch(e){
  3555. // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
  3556. return cachedSetTimeout.call(this, fun, 0);
  3557. }
  3558. }
  3559. }
  3560. function runClearTimeout(marker) {
  3561. if (cachedClearTimeout === clearTimeout) {
  3562. //normal enviroments in sane situations
  3563. return clearTimeout(marker);
  3564. }
  3565. // if clearTimeout wasn't available but was latter defined
  3566. if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
  3567. cachedClearTimeout = clearTimeout;
  3568. return clearTimeout(marker);
  3569. }
  3570. try {
  3571. // when when somebody has screwed with setTimeout but no I.E. maddness
  3572. return cachedClearTimeout(marker);
  3573. } catch (e){
  3574. try {
  3575. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  3576. return cachedClearTimeout.call(null, marker);
  3577. } catch (e){
  3578. // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
  3579. // Some versions of I.E. have different rules for clearTimeout vs setTimeout
  3580. return cachedClearTimeout.call(this, marker);
  3581. }
  3582. }
  3583. }
  3584. var queue = [];
  3585. var draining = false;
  3586. var currentQueue;
  3587. var queueIndex = -1;
  3588. function cleanUpNextTick() {
  3589. if (!draining || !currentQueue) {
  3590. return;
  3591. }
  3592. draining = false;
  3593. if (currentQueue.length) {
  3594. queue = currentQueue.concat(queue);
  3595. } else {
  3596. queueIndex = -1;
  3597. }
  3598. if (queue.length) {
  3599. drainQueue();
  3600. }
  3601. }
  3602. function drainQueue() {
  3603. if (draining) {
  3604. return;
  3605. }
  3606. var timeout = runTimeout(cleanUpNextTick);
  3607. draining = true;
  3608. var len = queue.length;
  3609. while(len) {
  3610. currentQueue = queue;
  3611. queue = [];
  3612. while (++queueIndex < len) {
  3613. if (currentQueue) {
  3614. currentQueue[queueIndex].run();
  3615. }
  3616. }
  3617. queueIndex = -1;
  3618. len = queue.length;
  3619. }
  3620. currentQueue = null;
  3621. draining = false;
  3622. runClearTimeout(timeout);
  3623. }
  3624. process.nextTick = function (fun) {
  3625. var args = new Array(arguments.length - 1);
  3626. if (arguments.length > 1) {
  3627. for (var i = 1; i < arguments.length; i++) {
  3628. args[i - 1] = arguments[i];
  3629. }
  3630. }
  3631. queue.push(new Item(fun, args));
  3632. if (queue.length === 1 && !draining) {
  3633. runTimeout(drainQueue);
  3634. }
  3635. };
  3636. // v8 likes predictible objects
  3637. function Item(fun, array) {
  3638. this.fun = fun;
  3639. this.array = array;
  3640. }
  3641. Item.prototype.run = function () {
  3642. this.fun.apply(null, this.array);
  3643. };
  3644. process.title = 'browser';
  3645. process.browser = true;
  3646. process.env = {};
  3647. process.argv = [];
  3648. process.version = ''; // empty string to avoid regexp issues
  3649. process.versions = {};
  3650. function noop() {}
  3651. process.on = noop;
  3652. process.addListener = noop;
  3653. process.once = noop;
  3654. process.off = noop;
  3655. process.removeListener = noop;
  3656. process.removeAllListeners = noop;
  3657. process.emit = noop;
  3658. process.prependListener = noop;
  3659. process.prependOnceListener = noop;
  3660. process.listeners = function (name) { return [] }
  3661. process.binding = function (name) {
  3662. throw new Error('process.binding is not supported');
  3663. };
  3664. process.cwd = function () { return '/' };
  3665. process.chdir = function (dir) {
  3666. throw new Error('process.chdir is not supported');
  3667. };
  3668. process.umask = function() { return 0; };
  3669. /***/ }),
  3670. /* 26 */
  3671. /***/ (function(module, exports, __webpack_require__) {
  3672. // Generated by CoffeeScript 1.7.1
  3673. (function() {
  3674. var NumberT, PropertyDescriptor;
  3675. NumberT = __webpack_require__(49).Number;
  3676. exports.resolveLength = function(length, stream, parent) {
  3677. var res;
  3678. if (typeof length === 'number') {
  3679. res = length;
  3680. } else if (typeof length === 'function') {
  3681. res = length.call(parent, parent);
  3682. } else if (parent && typeof length === 'string') {
  3683. res = parent[length];
  3684. } else if (stream && length instanceof NumberT) {
  3685. res = length.decode(stream);
  3686. }
  3687. if (isNaN(res)) {
  3688. throw new Error('Not a fixed size');
  3689. }
  3690. return res;
  3691. };
  3692. PropertyDescriptor = (function() {
  3693. function PropertyDescriptor(opts) {
  3694. var key, val;
  3695. if (opts == null) {
  3696. opts = {};
  3697. }
  3698. this.enumerable = true;
  3699. this.configurable = true;
  3700. for (key in opts) {
  3701. val = opts[key];
  3702. this[key] = val;
  3703. }
  3704. }
  3705. return PropertyDescriptor;
  3706. })();
  3707. exports.PropertyDescriptor = PropertyDescriptor;
  3708. }).call(this);
  3709. /***/ }),
  3710. /* 27 */
  3711. /***/ (function(module, exports, __webpack_require__) {
  3712. var dP = __webpack_require__(17);
  3713. var createDesc = __webpack_require__(57);
  3714. module.exports = __webpack_require__(13) ? function (object, key, value) {
  3715. return dP.f(object, key, createDesc(1, value));
  3716. } : function (object, key, value) {
  3717. object[key] = value;
  3718. return object;
  3719. };
  3720. /***/ }),
  3721. /* 28 */
  3722. /***/ (function(module, exports, __webpack_require__) {
  3723. var isObject = __webpack_require__(20);
  3724. module.exports = function (it) {
  3725. if (!isObject(it)) throw TypeError(it + ' is not an object!');
  3726. return it;
  3727. };
  3728. /***/ }),
  3729. /* 29 */
  3730. /***/ (function(module, exports) {
  3731. var id = 0;
  3732. var px = Math.random();
  3733. module.exports = function (key) {
  3734. return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
  3735. };
  3736. /***/ }),
  3737. /* 30 */
  3738. /***/ (function(module, exports) {
  3739. // 7.2.1 RequireObjectCoercible(argument)
  3740. module.exports = function (it) {
  3741. if (it == undefined) throw TypeError("Can't call method on " + it);
  3742. return it;
  3743. };
  3744. /***/ }),
  3745. /* 31 */
  3746. /***/ (function(module, exports) {
  3747. // 7.1.4 ToInteger
  3748. var ceil = Math.ceil;
  3749. var floor = Math.floor;
  3750. module.exports = function (it) {
  3751. return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
  3752. };
  3753. /***/ }),
  3754. /* 32 */
  3755. /***/ (function(module, exports, __webpack_require__) {
  3756. "use strict";
  3757. // Copyright Joyent, Inc. and other Node contributors.
  3758. //
  3759. // Permission is hereby granted, free of charge, to any person obtaining a
  3760. // copy of this software and associated documentation files (the
  3761. // "Software"), to deal in the Software without restriction, including
  3762. // without limitation the rights to use, copy, modify, merge, publish,
  3763. // distribute, sublicense, and/or sell copies of the Software, and to permit
  3764. // persons to whom the Software is furnished to do so, subject to the
  3765. // following conditions:
  3766. //
  3767. // The above copyright notice and this permission notice shall be included
  3768. // in all copies or substantial portions of the Software.
  3769. //
  3770. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  3771. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  3772. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  3773. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  3774. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  3775. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  3776. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  3777. // a duplex stream is just a stream that is both readable and writable.
  3778. // Since JS doesn't have multiple prototypal inheritance, this class
  3779. // prototypally inherits from Readable, and then parasitically from
  3780. // Writable.
  3781. /*<replacement>*/
  3782. var pna = __webpack_require__(69);
  3783. /*</replacement>*/
  3784. /*<replacement>*/
  3785. var objectKeys = Object.keys || function (obj) {
  3786. var keys = [];
  3787. for (var key in obj) {
  3788. keys.push(key);
  3789. }return keys;
  3790. };
  3791. /*</replacement>*/
  3792. module.exports = Duplex;
  3793. /*<replacement>*/
  3794. var util = Object.create(__webpack_require__(56));
  3795. util.inherits = __webpack_require__(46);
  3796. /*</replacement>*/
  3797. var Readable = __webpack_require__(166);
  3798. var Writable = __webpack_require__(102);
  3799. util.inherits(Duplex, Readable);
  3800. {
  3801. // avoid scope creep, the keys array can then be collected
  3802. var keys = objectKeys(Writable.prototype);
  3803. for (var v = 0; v < keys.length; v++) {
  3804. var method = keys[v];
  3805. if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];
  3806. }
  3807. }
  3808. function Duplex(options) {
  3809. if (!(this instanceof Duplex)) return new Duplex(options);
  3810. Readable.call(this, options);
  3811. Writable.call(this, options);
  3812. if (options && options.readable === false) this.readable = false;
  3813. if (options && options.writable === false) this.writable = false;
  3814. this.allowHalfOpen = true;
  3815. if (options && options.allowHalfOpen === false) this.allowHalfOpen = false;
  3816. this.once('end', onend);
  3817. }
  3818. Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', {
  3819. // making it explicit this property is not enumerable
  3820. // because otherwise some prototype manipulation in
  3821. // userland will fail
  3822. enumerable: false,
  3823. get: function () {
  3824. return this._writableState.highWaterMark;
  3825. }
  3826. });
  3827. // the no-half-open enforcer
  3828. function onend() {
  3829. // if we allow half-open state, or if the writable side ended,
  3830. // then we're ok.
  3831. if (this.allowHalfOpen || this._writableState.ended) return;
  3832. // no more data can be written.
  3833. // But allow more writes to happen in this tick.
  3834. pna.nextTick(onEndNT, this);
  3835. }
  3836. function onEndNT(self) {
  3837. self.end();
  3838. }
  3839. Object.defineProperty(Duplex.prototype, 'destroyed', {
  3840. get: function () {
  3841. if (this._readableState === undefined || this._writableState === undefined) {
  3842. return false;
  3843. }
  3844. return this._readableState.destroyed && this._writableState.destroyed;
  3845. },
  3846. set: function (value) {
  3847. // we ignore the value if the stream
  3848. // has not been initialized yet
  3849. if (this._readableState === undefined || this._writableState === undefined) {
  3850. return;
  3851. }
  3852. // backward compatibility, the user is explicitly
  3853. // managing destroyed
  3854. this._readableState.destroyed = value;
  3855. this._writableState.destroyed = value;
  3856. }
  3857. });
  3858. Duplex.prototype._destroy = function (err, cb) {
  3859. this.push(null);
  3860. this.end();
  3861. pna.nextTick(cb, err);
  3862. };
  3863. /***/ }),
  3864. /* 33 */
  3865. /***/ (function(module, exports, __webpack_require__) {
  3866. ;(function (root, factory, undef) {
  3867. if (true) {
  3868. // CommonJS
  3869. module.exports = exports = factory(__webpack_require__(1), __webpack_require__(105), __webpack_require__(106));
  3870. }
  3871. else {}
  3872. }(this, function (CryptoJS) {
  3873. (function () {
  3874. // Shortcuts
  3875. var C = CryptoJS;
  3876. var C_lib = C.lib;
  3877. var Base = C_lib.Base;
  3878. var WordArray = C_lib.WordArray;
  3879. var C_algo = C.algo;
  3880. var MD5 = C_algo.MD5;
  3881. /**
  3882. * This key derivation function is meant to conform with EVP_BytesToKey.
  3883. * www.openssl.org/docs/crypto/EVP_BytesToKey.html
  3884. */
  3885. var EvpKDF = C_algo.EvpKDF = Base.extend({
  3886. /**
  3887. * Configuration options.
  3888. *
  3889. * @property {number} keySize The key size in words to generate. Default: 4 (128 bits)
  3890. * @property {Hasher} hasher The hash algorithm to use. Default: MD5
  3891. * @property {number} iterations The number of iterations to perform. Default: 1
  3892. */
  3893. cfg: Base.extend({
  3894. keySize: 128/32,
  3895. hasher: MD5,
  3896. iterations: 1
  3897. }),
  3898. /**
  3899. * Initializes a newly created key derivation function.
  3900. *
  3901. * @param {Object} cfg (Optional) The configuration options to use for the derivation.
  3902. *
  3903. * @example
  3904. *
  3905. * var kdf = CryptoJS.algo.EvpKDF.create();
  3906. * var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8 });
  3907. * var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8, iterations: 1000 });
  3908. */
  3909. init: function (cfg) {
  3910. this.cfg = this.cfg.extend(cfg);
  3911. },
  3912. /**
  3913. * Derives a key from a password.
  3914. *
  3915. * @param {WordArray|string} password The password.
  3916. * @param {WordArray|string} salt A salt.
  3917. *
  3918. * @return {WordArray} The derived key.
  3919. *
  3920. * @example
  3921. *
  3922. * var key = kdf.compute(password, salt);
  3923. */
  3924. compute: function (password, salt) {
  3925. // Shortcut
  3926. var cfg = this.cfg;
  3927. // Init hasher
  3928. var hasher = cfg.hasher.create();
  3929. // Initial values
  3930. var derivedKey = WordArray.create();
  3931. // Shortcuts
  3932. var derivedKeyWords = derivedKey.words;
  3933. var keySize = cfg.keySize;
  3934. var iterations = cfg.iterations;
  3935. // Generate key
  3936. while (derivedKeyWords.length < keySize) {
  3937. if (block) {
  3938. hasher.update(block);
  3939. }
  3940. var block = hasher.update(password).finalize(salt);
  3941. hasher.reset();
  3942. // Iterations
  3943. for (var i = 1; i < iterations; i++) {
  3944. block = hasher.finalize(block);
  3945. hasher.reset();
  3946. }
  3947. derivedKey.concat(block);
  3948. }
  3949. derivedKey.sigBytes = keySize * 4;
  3950. return derivedKey;
  3951. }
  3952. });
  3953. /**
  3954. * Derives a key from a password.
  3955. *
  3956. * @param {WordArray|string} password The password.
  3957. * @param {WordArray|string} salt A salt.
  3958. * @param {Object} cfg (Optional) The configuration options to use for this computation.
  3959. *
  3960. * @return {WordArray} The derived key.
  3961. *
  3962. * @static
  3963. *
  3964. * @example
  3965. *
  3966. * var key = CryptoJS.EvpKDF(password, salt);
  3967. * var key = CryptoJS.EvpKDF(password, salt, { keySize: 8 });
  3968. * var key = CryptoJS.EvpKDF(password, salt, { keySize: 8, iterations: 1000 });
  3969. */
  3970. C.EvpKDF = function (password, salt, cfg) {
  3971. return EvpKDF.create(cfg).compute(password, salt);
  3972. };
  3973. }());
  3974. return CryptoJS.EvpKDF;
  3975. }));
  3976. /***/ }),
  3977. /* 34 */
  3978. /***/ (function(module, exports, __webpack_require__) {
  3979. "use strict";
  3980. /* WEBPACK VAR INJECTION */(function(process) {/* eslint-disable node/no-deprecated-api */
  3981. var buffer = __webpack_require__(4)
  3982. var Buffer = buffer.Buffer
  3983. var safer = {}
  3984. var key
  3985. for (key in buffer) {
  3986. if (!buffer.hasOwnProperty(key)) continue
  3987. if (key === 'SlowBuffer' || key === 'Buffer') continue
  3988. safer[key] = buffer[key]
  3989. }
  3990. var Safer = safer.Buffer = {}
  3991. for (key in Buffer) {
  3992. if (!Buffer.hasOwnProperty(key)) continue
  3993. if (key === 'allocUnsafe' || key === 'allocUnsafeSlow') continue
  3994. Safer[key] = Buffer[key]
  3995. }
  3996. safer.Buffer.prototype = Buffer.prototype
  3997. if (!Safer.from || Safer.from === Uint8Array.from) {
  3998. Safer.from = function (value, encodingOrOffset, length) {
  3999. if (typeof value === 'number') {
  4000. throw new TypeError('The "value" argument must not be of type number. Received type ' + typeof value)
  4001. }
  4002. if (value && typeof value.length === 'undefined') {
  4003. throw new TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type ' + typeof value)
  4004. }
  4005. return Buffer(value, encodingOrOffset, length)
  4006. }
  4007. }
  4008. if (!Safer.alloc) {
  4009. Safer.alloc = function (size, fill, encoding) {
  4010. if (typeof size !== 'number') {
  4011. throw new TypeError('The "size" argument must be of type number. Received type ' + typeof size)
  4012. }
  4013. if (size < 0 || size >= 2 * (1 << 30)) {
  4014. throw new RangeError('The value "' + size + '" is invalid for option "size"')
  4015. }
  4016. var buf = Buffer(size)
  4017. if (!fill || fill.length === 0) {
  4018. buf.fill(0)
  4019. } else if (typeof encoding === 'string') {
  4020. buf.fill(fill, encoding)
  4021. } else {
  4022. buf.fill(fill)
  4023. }
  4024. return buf
  4025. }
  4026. }
  4027. if (!safer.kStringMaxLength) {
  4028. try {
  4029. safer.kStringMaxLength = process.binding('buffer').kStringMaxLength
  4030. } catch (e) {
  4031. // we can't determine kStringMaxLength in environments where process.binding
  4032. // is unsupported, so let's not set it
  4033. }
  4034. }
  4035. if (!safer.constants) {
  4036. safer.constants = {
  4037. MAX_LENGTH: safer.kMaxLength
  4038. }
  4039. if (safer.kStringMaxLength) {
  4040. safer.constants.MAX_STRING_LENGTH = safer.kStringMaxLength
  4041. }
  4042. }
  4043. module.exports = safer
  4044. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(25)))
  4045. /***/ }),
  4046. /* 35 */
  4047. /***/ (function(module, exports, __webpack_require__) {
  4048. // to indexed object, toObject with fallback for non-array-like ES3 strings
  4049. var IObject = __webpack_require__(110);
  4050. var defined = __webpack_require__(112);
  4051. module.exports = function (it) {
  4052. return IObject(defined(it));
  4053. };
  4054. /***/ }),
  4055. /* 36 */
  4056. /***/ (function(module, exports) {
  4057. var hasOwnProperty = {}.hasOwnProperty;
  4058. module.exports = function (it, key) {
  4059. return hasOwnProperty.call(it, key);
  4060. };
  4061. /***/ }),
  4062. /* 37 */
  4063. /***/ (function(module, exports) {
  4064. module.exports = function (exec) {
  4065. try {
  4066. return !!exec();
  4067. } catch (e) {
  4068. return true;
  4069. }
  4070. };
  4071. /***/ }),
  4072. /* 38 */
  4073. /***/ (function(module, exports, __webpack_require__) {
  4074. // optional / simple context binding
  4075. var aFunction = __webpack_require__(182);
  4076. module.exports = function (fn, that, length) {
  4077. aFunction(fn);
  4078. if (that === undefined) return fn;
  4079. switch (length) {
  4080. case 1: return function (a) {
  4081. return fn.call(that, a);
  4082. };
  4083. case 2: return function (a, b) {
  4084. return fn.call(that, a, b);
  4085. };
  4086. case 3: return function (a, b, c) {
  4087. return fn.call(that, a, b, c);
  4088. };
  4089. }
  4090. return function (/* ...args */) {
  4091. return fn.apply(that, arguments);
  4092. };
  4093. };
  4094. /***/ }),
  4095. /* 39 */
  4096. /***/ (function(module, exports) {
  4097. var core = module.exports = { version: '2.6.11' };
  4098. if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef
  4099. /***/ }),
  4100. /* 40 */
  4101. /***/ (function(module, exports) {
  4102. module.exports = function (bitmap, value) {
  4103. return {
  4104. enumerable: !(bitmap & 1),
  4105. configurable: !(bitmap & 2),
  4106. writable: !(bitmap & 4),
  4107. value: value
  4108. };
  4109. };
  4110. /***/ }),
  4111. /* 41 */
  4112. /***/ (function(module, exports) {
  4113. module.exports = false;
  4114. /***/ }),
  4115. /* 42 */
  4116. /***/ (function(module, exports, __webpack_require__) {
  4117. // 19.1.2.14 / 15.2.3.14 Object.keys(O)
  4118. var $keys = __webpack_require__(138);
  4119. var enumBugKeys = __webpack_require__(88);
  4120. module.exports = Object.keys || function keys(O) {
  4121. return $keys(O, enumBugKeys);
  4122. };
  4123. /***/ }),
  4124. /* 43 */
  4125. /***/ (function(module, exports, __webpack_require__) {
  4126. // to indexed object, toObject with fallback for non-array-like ES3 strings
  4127. var IObject = __webpack_require__(85);
  4128. var defined = __webpack_require__(30);
  4129. module.exports = function (it) {
  4130. return IObject(defined(it));
  4131. };
  4132. /***/ }),
  4133. /* 44 */
  4134. /***/ (function(module, exports, __webpack_require__) {
  4135. __webpack_require__(140)('Uint8', 1, function (init) {
  4136. return function Uint8Array(data, byteOffset, length) {
  4137. return init(this, data, byteOffset, length);
  4138. };
  4139. });
  4140. /***/ }),
  4141. /* 45 */
  4142. /***/ (function(module, exports) {
  4143. module.exports = {};
  4144. /***/ }),
  4145. /* 46 */
  4146. /***/ (function(module, exports) {
  4147. if (typeof Object.create === 'function') {
  4148. // implementation from standard node.js 'util' module
  4149. module.exports = function inherits(ctor, superCtor) {
  4150. if (superCtor) {
  4151. ctor.super_ = superCtor
  4152. ctor.prototype = Object.create(superCtor.prototype, {
  4153. constructor: {
  4154. value: ctor,
  4155. enumerable: false,
  4156. writable: true,
  4157. configurable: true
  4158. }
  4159. })
  4160. }
  4161. };
  4162. } else {
  4163. // old school shim for old browsers
  4164. module.exports = function inherits(ctor, superCtor) {
  4165. if (superCtor) {
  4166. ctor.super_ = superCtor
  4167. var TempCtor = function () {}
  4168. TempCtor.prototype = superCtor.prototype
  4169. ctor.prototype = new TempCtor()
  4170. ctor.prototype.constructor = ctor
  4171. }
  4172. }
  4173. }
  4174. /***/ }),
  4175. /* 47 */
  4176. /***/ (function(module, exports, __webpack_require__) {
  4177. ;(function (root, factory) {
  4178. if (true) {
  4179. // CommonJS
  4180. module.exports = exports = factory(__webpack_require__(1));
  4181. }
  4182. else {}
  4183. }(this, function (CryptoJS) {
  4184. (function () {
  4185. // Shortcuts
  4186. var C = CryptoJS;
  4187. var C_lib = C.lib;
  4188. var WordArray = C_lib.WordArray;
  4189. var C_enc = C.enc;
  4190. /**
  4191. * Base64 encoding strategy.
  4192. */
  4193. var Base64 = C_enc.Base64 = {
  4194. /**
  4195. * Converts a word array to a Base64 string.
  4196. *
  4197. * @param {WordArray} wordArray The word array.
  4198. *
  4199. * @return {string} The Base64 string.
  4200. *
  4201. * @static
  4202. *
  4203. * @example
  4204. *
  4205. * var base64String = CryptoJS.enc.Base64.stringify(wordArray);
  4206. */
  4207. stringify: function (wordArray) {
  4208. // Shortcuts
  4209. var words = wordArray.words;
  4210. var sigBytes = wordArray.sigBytes;
  4211. var map = this._map;
  4212. // Clamp excess bits
  4213. wordArray.clamp();
  4214. // Convert
  4215. var base64Chars = [];
  4216. for (var i = 0; i < sigBytes; i += 3) {
  4217. var byte1 = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
  4218. var byte2 = (words[(i + 1) >>> 2] >>> (24 - ((i + 1) % 4) * 8)) & 0xff;
  4219. var byte3 = (words[(i + 2) >>> 2] >>> (24 - ((i + 2) % 4) * 8)) & 0xff;
  4220. var triplet = (byte1 << 16) | (byte2 << 8) | byte3;
  4221. for (var j = 0; (j < 4) && (i + j * 0.75 < sigBytes); j++) {
  4222. base64Chars.push(map.charAt((triplet >>> (6 * (3 - j))) & 0x3f));
  4223. }
  4224. }
  4225. // Add padding
  4226. var paddingChar = map.charAt(64);
  4227. if (paddingChar) {
  4228. while (base64Chars.length % 4) {
  4229. base64Chars.push(paddingChar);
  4230. }
  4231. }
  4232. return base64Chars.join('');
  4233. },
  4234. /**
  4235. * Converts a Base64 string to a word array.
  4236. *
  4237. * @param {string} base64Str The Base64 string.
  4238. *
  4239. * @return {WordArray} The word array.
  4240. *
  4241. * @static
  4242. *
  4243. * @example
  4244. *
  4245. * var wordArray = CryptoJS.enc.Base64.parse(base64String);
  4246. */
  4247. parse: function (base64Str) {
  4248. // Shortcuts
  4249. var base64StrLength = base64Str.length;
  4250. var map = this._map;
  4251. var reverseMap = this._reverseMap;
  4252. if (!reverseMap) {
  4253. reverseMap = this._reverseMap = [];
  4254. for (var j = 0; j < map.length; j++) {
  4255. reverseMap[map.charCodeAt(j)] = j;
  4256. }
  4257. }
  4258. // Ignore padding
  4259. var paddingChar = map.charAt(64);
  4260. if (paddingChar) {
  4261. var paddingIndex = base64Str.indexOf(paddingChar);
  4262. if (paddingIndex !== -1) {
  4263. base64StrLength = paddingIndex;
  4264. }
  4265. }
  4266. // Convert
  4267. return parseLoop(base64Str, base64StrLength, reverseMap);
  4268. },
  4269. _map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='
  4270. };
  4271. function parseLoop(base64Str, base64StrLength, reverseMap) {
  4272. var words = [];
  4273. var nBytes = 0;
  4274. for (var i = 0; i < base64StrLength; i++) {
  4275. if (i % 4) {
  4276. var bits1 = reverseMap[base64Str.charCodeAt(i - 1)] << ((i % 4) * 2);
  4277. var bits2 = reverseMap[base64Str.charCodeAt(i)] >>> (6 - (i % 4) * 2);
  4278. words[nBytes >>> 2] |= (bits1 | bits2) << (24 - (nBytes % 4) * 8);
  4279. nBytes++;
  4280. }
  4281. }
  4282. return WordArray.create(words, nBytes);
  4283. }
  4284. }());
  4285. return CryptoJS.enc.Base64;
  4286. }));
  4287. /***/ }),
  4288. /* 48 */
  4289. /***/ (function(module, exports, __webpack_require__) {
  4290. ;(function (root, factory) {
  4291. if (true) {
  4292. // CommonJS
  4293. module.exports = exports = factory(__webpack_require__(1));
  4294. }
  4295. else {}
  4296. }(this, function (CryptoJS) {
  4297. (function (Math) {
  4298. // Shortcuts
  4299. var C = CryptoJS;
  4300. var C_lib = C.lib;
  4301. var WordArray = C_lib.WordArray;
  4302. var Hasher = C_lib.Hasher;
  4303. var C_algo = C.algo;
  4304. // Constants table
  4305. var T = [];
  4306. // Compute constants
  4307. (function () {
  4308. for (var i = 0; i < 64; i++) {
  4309. T[i] = (Math.abs(Math.sin(i + 1)) * 0x100000000) | 0;
  4310. }
  4311. }());
  4312. /**
  4313. * MD5 hash algorithm.
  4314. */
  4315. var MD5 = C_algo.MD5 = Hasher.extend({
  4316. _doReset: function () {
  4317. this._hash = new WordArray.init([
  4318. 0x67452301, 0xefcdab89,
  4319. 0x98badcfe, 0x10325476
  4320. ]);
  4321. },
  4322. _doProcessBlock: function (M, offset) {
  4323. // Swap endian
  4324. for (var i = 0; i < 16; i++) {
  4325. // Shortcuts
  4326. var offset_i = offset + i;
  4327. var M_offset_i = M[offset_i];
  4328. M[offset_i] = (
  4329. (((M_offset_i << 8) | (M_offset_i >>> 24)) & 0x00ff00ff) |
  4330. (((M_offset_i << 24) | (M_offset_i >>> 8)) & 0xff00ff00)
  4331. );
  4332. }
  4333. // Shortcuts
  4334. var H = this._hash.words;
  4335. var M_offset_0 = M[offset + 0];
  4336. var M_offset_1 = M[offset + 1];
  4337. var M_offset_2 = M[offset + 2];
  4338. var M_offset_3 = M[offset + 3];
  4339. var M_offset_4 = M[offset + 4];
  4340. var M_offset_5 = M[offset + 5];
  4341. var M_offset_6 = M[offset + 6];
  4342. var M_offset_7 = M[offset + 7];
  4343. var M_offset_8 = M[offset + 8];
  4344. var M_offset_9 = M[offset + 9];
  4345. var M_offset_10 = M[offset + 10];
  4346. var M_offset_11 = M[offset + 11];
  4347. var M_offset_12 = M[offset + 12];
  4348. var M_offset_13 = M[offset + 13];
  4349. var M_offset_14 = M[offset + 14];
  4350. var M_offset_15 = M[offset + 15];
  4351. // Working varialbes
  4352. var a = H[0];
  4353. var b = H[1];
  4354. var c = H[2];
  4355. var d = H[3];
  4356. // Computation
  4357. a = FF(a, b, c, d, M_offset_0, 7, T[0]);
  4358. d = FF(d, a, b, c, M_offset_1, 12, T[1]);
  4359. c = FF(c, d, a, b, M_offset_2, 17, T[2]);
  4360. b = FF(b, c, d, a, M_offset_3, 22, T[3]);
  4361. a = FF(a, b, c, d, M_offset_4, 7, T[4]);
  4362. d = FF(d, a, b, c, M_offset_5, 12, T[5]);
  4363. c = FF(c, d, a, b, M_offset_6, 17, T[6]);
  4364. b = FF(b, c, d, a, M_offset_7, 22, T[7]);
  4365. a = FF(a, b, c, d, M_offset_8, 7, T[8]);
  4366. d = FF(d, a, b, c, M_offset_9, 12, T[9]);
  4367. c = FF(c, d, a, b, M_offset_10, 17, T[10]);
  4368. b = FF(b, c, d, a, M_offset_11, 22, T[11]);
  4369. a = FF(a, b, c, d, M_offset_12, 7, T[12]);
  4370. d = FF(d, a, b, c, M_offset_13, 12, T[13]);
  4371. c = FF(c, d, a, b, M_offset_14, 17, T[14]);
  4372. b = FF(b, c, d, a, M_offset_15, 22, T[15]);
  4373. a = GG(a, b, c, d, M_offset_1, 5, T[16]);
  4374. d = GG(d, a, b, c, M_offset_6, 9, T[17]);
  4375. c = GG(c, d, a, b, M_offset_11, 14, T[18]);
  4376. b = GG(b, c, d, a, M_offset_0, 20, T[19]);
  4377. a = GG(a, b, c, d, M_offset_5, 5, T[20]);
  4378. d = GG(d, a, b, c, M_offset_10, 9, T[21]);
  4379. c = GG(c, d, a, b, M_offset_15, 14, T[22]);
  4380. b = GG(b, c, d, a, M_offset_4, 20, T[23]);
  4381. a = GG(a, b, c, d, M_offset_9, 5, T[24]);
  4382. d = GG(d, a, b, c, M_offset_14, 9, T[25]);
  4383. c = GG(c, d, a, b, M_offset_3, 14, T[26]);
  4384. b = GG(b, c, d, a, M_offset_8, 20, T[27]);
  4385. a = GG(a, b, c, d, M_offset_13, 5, T[28]);
  4386. d = GG(d, a, b, c, M_offset_2, 9, T[29]);
  4387. c = GG(c, d, a, b, M_offset_7, 14, T[30]);
  4388. b = GG(b, c, d, a, M_offset_12, 20, T[31]);
  4389. a = HH(a, b, c, d, M_offset_5, 4, T[32]);
  4390. d = HH(d, a, b, c, M_offset_8, 11, T[33]);
  4391. c = HH(c, d, a, b, M_offset_11, 16, T[34]);
  4392. b = HH(b, c, d, a, M_offset_14, 23, T[35]);
  4393. a = HH(a, b, c, d, M_offset_1, 4, T[36]);
  4394. d = HH(d, a, b, c, M_offset_4, 11, T[37]);
  4395. c = HH(c, d, a, b, M_offset_7, 16, T[38]);
  4396. b = HH(b, c, d, a, M_offset_10, 23, T[39]);
  4397. a = HH(a, b, c, d, M_offset_13, 4, T[40]);
  4398. d = HH(d, a, b, c, M_offset_0, 11, T[41]);
  4399. c = HH(c, d, a, b, M_offset_3, 16, T[42]);
  4400. b = HH(b, c, d, a, M_offset_6, 23, T[43]);
  4401. a = HH(a, b, c, d, M_offset_9, 4, T[44]);
  4402. d = HH(d, a, b, c, M_offset_12, 11, T[45]);
  4403. c = HH(c, d, a, b, M_offset_15, 16, T[46]);
  4404. b = HH(b, c, d, a, M_offset_2, 23, T[47]);
  4405. a = II(a, b, c, d, M_offset_0, 6, T[48]);
  4406. d = II(d, a, b, c, M_offset_7, 10, T[49]);
  4407. c = II(c, d, a, b, M_offset_14, 15, T[50]);
  4408. b = II(b, c, d, a, M_offset_5, 21, T[51]);
  4409. a = II(a, b, c, d, M_offset_12, 6, T[52]);
  4410. d = II(d, a, b, c, M_offset_3, 10, T[53]);
  4411. c = II(c, d, a, b, M_offset_10, 15, T[54]);
  4412. b = II(b, c, d, a, M_offset_1, 21, T[55]);
  4413. a = II(a, b, c, d, M_offset_8, 6, T[56]);
  4414. d = II(d, a, b, c, M_offset_15, 10, T[57]);
  4415. c = II(c, d, a, b, M_offset_6, 15, T[58]);
  4416. b = II(b, c, d, a, M_offset_13, 21, T[59]);
  4417. a = II(a, b, c, d, M_offset_4, 6, T[60]);
  4418. d = II(d, a, b, c, M_offset_11, 10, T[61]);
  4419. c = II(c, d, a, b, M_offset_2, 15, T[62]);
  4420. b = II(b, c, d, a, M_offset_9, 21, T[63]);
  4421. // Intermediate hash value
  4422. H[0] = (H[0] + a) | 0;
  4423. H[1] = (H[1] + b) | 0;
  4424. H[2] = (H[2] + c) | 0;
  4425. H[3] = (H[3] + d) | 0;
  4426. },
  4427. _doFinalize: function () {
  4428. // Shortcuts
  4429. var data = this._data;
  4430. var dataWords = data.words;
  4431. var nBitsTotal = this._nDataBytes * 8;
  4432. var nBitsLeft = data.sigBytes * 8;
  4433. // Add padding
  4434. dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);
  4435. var nBitsTotalH = Math.floor(nBitsTotal / 0x100000000);
  4436. var nBitsTotalL = nBitsTotal;
  4437. dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = (
  4438. (((nBitsTotalH << 8) | (nBitsTotalH >>> 24)) & 0x00ff00ff) |
  4439. (((nBitsTotalH << 24) | (nBitsTotalH >>> 8)) & 0xff00ff00)
  4440. );
  4441. dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = (
  4442. (((nBitsTotalL << 8) | (nBitsTotalL >>> 24)) & 0x00ff00ff) |
  4443. (((nBitsTotalL << 24) | (nBitsTotalL >>> 8)) & 0xff00ff00)
  4444. );
  4445. data.sigBytes = (dataWords.length + 1) * 4;
  4446. // Hash final blocks
  4447. this._process();
  4448. // Shortcuts
  4449. var hash = this._hash;
  4450. var H = hash.words;
  4451. // Swap endian
  4452. for (var i = 0; i < 4; i++) {
  4453. // Shortcut
  4454. var H_i = H[i];
  4455. H[i] = (((H_i << 8) | (H_i >>> 24)) & 0x00ff00ff) |
  4456. (((H_i << 24) | (H_i >>> 8)) & 0xff00ff00);
  4457. }
  4458. // Return final computed hash
  4459. return hash;
  4460. },
  4461. clone: function () {
  4462. var clone = Hasher.clone.call(this);
  4463. clone._hash = this._hash.clone();
  4464. return clone;
  4465. }
  4466. });
  4467. function FF(a, b, c, d, x, s, t) {
  4468. var n = a + ((b & c) | (~b & d)) + x + t;
  4469. return ((n << s) | (n >>> (32 - s))) + b;
  4470. }
  4471. function GG(a, b, c, d, x, s, t) {
  4472. var n = a + ((b & d) | (c & ~d)) + x + t;
  4473. return ((n << s) | (n >>> (32 - s))) + b;
  4474. }
  4475. function HH(a, b, c, d, x, s, t) {
  4476. var n = a + (b ^ c ^ d) + x + t;
  4477. return ((n << s) | (n >>> (32 - s))) + b;
  4478. }
  4479. function II(a, b, c, d, x, s, t) {
  4480. var n = a + (c ^ (b | ~d)) + x + t;
  4481. return ((n << s) | (n >>> (32 - s))) + b;
  4482. }
  4483. /**
  4484. * Shortcut function to the hasher's object interface.
  4485. *
  4486. * @param {WordArray|string} message The message to hash.
  4487. *
  4488. * @return {WordArray} The hash.
  4489. *
  4490. * @static
  4491. *
  4492. * @example
  4493. *
  4494. * var hash = CryptoJS.MD5('message');
  4495. * var hash = CryptoJS.MD5(wordArray);
  4496. */
  4497. C.MD5 = Hasher._createHelper(MD5);
  4498. /**
  4499. * Shortcut function to the HMAC's object interface.
  4500. *
  4501. * @param {WordArray|string} message The message to hash.
  4502. * @param {WordArray|string} key The secret key.
  4503. *
  4504. * @return {WordArray} The HMAC.
  4505. *
  4506. * @static
  4507. *
  4508. * @example
  4509. *
  4510. * var hmac = CryptoJS.HmacMD5(message, key);
  4511. */
  4512. C.HmacMD5 = Hasher._createHmacHelper(MD5);
  4513. }(Math));
  4514. return CryptoJS.MD5;
  4515. }));
  4516. /***/ }),
  4517. /* 49 */
  4518. /***/ (function(module, exports, __webpack_require__) {
  4519. // Generated by CoffeeScript 1.7.1
  4520. (function() {
  4521. var DecodeStream, Fixed, NumberT,
  4522. __hasProp = {}.hasOwnProperty,
  4523. __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
  4524. DecodeStream = __webpack_require__(107);
  4525. NumberT = (function() {
  4526. function NumberT(type, endian) {
  4527. this.type = type;
  4528. this.endian = endian != null ? endian : 'BE';
  4529. this.fn = this.type;
  4530. if (this.type[this.type.length - 1] !== '8') {
  4531. this.fn += this.endian;
  4532. }
  4533. }
  4534. NumberT.prototype.size = function() {
  4535. return DecodeStream.TYPES[this.type];
  4536. };
  4537. NumberT.prototype.decode = function(stream) {
  4538. return stream['read' + this.fn]();
  4539. };
  4540. NumberT.prototype.encode = function(stream, val) {
  4541. return stream['write' + this.fn](val);
  4542. };
  4543. return NumberT;
  4544. })();
  4545. exports.Number = NumberT;
  4546. exports.uint8 = new NumberT('UInt8');
  4547. exports.uint16be = exports.uint16 = new NumberT('UInt16', 'BE');
  4548. exports.uint16le = new NumberT('UInt16', 'LE');
  4549. exports.uint24be = exports.uint24 = new NumberT('UInt24', 'BE');
  4550. exports.uint24le = new NumberT('UInt24', 'LE');
  4551. exports.uint32be = exports.uint32 = new NumberT('UInt32', 'BE');
  4552. exports.uint32le = new NumberT('UInt32', 'LE');
  4553. exports.int8 = new NumberT('Int8');
  4554. exports.int16be = exports.int16 = new NumberT('Int16', 'BE');
  4555. exports.int16le = new NumberT('Int16', 'LE');
  4556. exports.int24be = exports.int24 = new NumberT('Int24', 'BE');
  4557. exports.int24le = new NumberT('Int24', 'LE');
  4558. exports.int32be = exports.int32 = new NumberT('Int32', 'BE');
  4559. exports.int32le = new NumberT('Int32', 'LE');
  4560. exports.floatbe = exports.float = new NumberT('Float', 'BE');
  4561. exports.floatle = new NumberT('Float', 'LE');
  4562. exports.doublebe = exports.double = new NumberT('Double', 'BE');
  4563. exports.doublele = new NumberT('Double', 'LE');
  4564. Fixed = (function(_super) {
  4565. __extends(Fixed, _super);
  4566. function Fixed(size, endian, fracBits) {
  4567. if (fracBits == null) {
  4568. fracBits = size >> 1;
  4569. }
  4570. Fixed.__super__.constructor.call(this, "Int" + size, endian);
  4571. this._point = 1 << fracBits;
  4572. }
  4573. Fixed.prototype.decode = function(stream) {
  4574. return Fixed.__super__.decode.call(this, stream) / this._point;
  4575. };
  4576. Fixed.prototype.encode = function(stream, val) {
  4577. return Fixed.__super__.encode.call(this, stream, val * this._point | 0);
  4578. };
  4579. return Fixed;
  4580. })(NumberT);
  4581. exports.Fixed = Fixed;
  4582. exports.fixed16be = exports.fixed16 = new Fixed(16, 'BE');
  4583. exports.fixed16le = new Fixed(16, 'LE');
  4584. exports.fixed32be = exports.fixed32 = new Fixed(32, 'BE');
  4585. exports.fixed32le = new Fixed(32, 'LE');
  4586. }).call(this);
  4587. /***/ }),
  4588. /* 50 */
  4589. /***/ (function(module, exports, __webpack_require__) {
  4590. // 7.1.13 ToObject(argument)
  4591. var defined = __webpack_require__(112);
  4592. module.exports = function (it) {
  4593. return Object(defined(it));
  4594. };
  4595. /***/ }),
  4596. /* 51 */
  4597. /***/ (function(module, exports, __webpack_require__) {
  4598. // 7.1.1 ToPrimitive(input [, PreferredType])
  4599. var isObject = __webpack_require__(18);
  4600. // instead of the ES6 spec version, we didn't implement @@toPrimitive case
  4601. // and the second argument - flag - preferred type is a string
  4602. module.exports = function (it, S) {
  4603. if (!isObject(it)) return it;
  4604. var fn, val;
  4605. if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
  4606. if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;
  4607. if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
  4608. throw TypeError("Can't convert object to primitive value");
  4609. };
  4610. /***/ }),
  4611. /* 52 */
  4612. /***/ (function(module, exports, __webpack_require__) {
  4613. // optional / simple context binding
  4614. var aFunction = __webpack_require__(136);
  4615. module.exports = function (fn, that, length) {
  4616. aFunction(fn);
  4617. if (that === undefined) return fn;
  4618. switch (length) {
  4619. case 1: return function (a) {
  4620. return fn.call(that, a);
  4621. };
  4622. case 2: return function (a, b) {
  4623. return fn.call(that, a, b);
  4624. };
  4625. case 3: return function (a, b, c) {
  4626. return fn.call(that, a, b, c);
  4627. };
  4628. }
  4629. return function (/* ...args */) {
  4630. return fn.apply(that, arguments);
  4631. };
  4632. };
  4633. /***/ }),
  4634. /* 53 */
  4635. /***/ (function(module, exports) {
  4636. var toString = {}.toString;
  4637. module.exports = function (it) {
  4638. return toString.call(it).slice(8, -1);
  4639. };
  4640. /***/ }),
  4641. /* 54 */
  4642. /***/ (function(module, exports, __webpack_require__) {
  4643. var toInteger = __webpack_require__(31);
  4644. var max = Math.max;
  4645. var min = Math.min;
  4646. module.exports = function (index, length) {
  4647. index = toInteger(index);
  4648. return index < 0 ? max(index + length, 0) : min(index, length);
  4649. };
  4650. /***/ }),
  4651. /* 55 */
  4652. /***/ (function(module, exports, __webpack_require__) {
  4653. // 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)
  4654. var $keys = __webpack_require__(138);
  4655. var hiddenKeys = __webpack_require__(88).concat('length', 'prototype');
  4656. exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
  4657. return $keys(O, hiddenKeys);
  4658. };
  4659. /***/ }),
  4660. /* 56 */
  4661. /***/ (function(module, exports, __webpack_require__) {
  4662. /* WEBPACK VAR INJECTION */(function(Buffer) {// Copyright Joyent, Inc. and other Node contributors.
  4663. //
  4664. // Permission is hereby granted, free of charge, to any person obtaining a
  4665. // copy of this software and associated documentation files (the
  4666. // "Software"), to deal in the Software without restriction, including
  4667. // without limitation the rights to use, copy, modify, merge, publish,
  4668. // distribute, sublicense, and/or sell copies of the Software, and to permit
  4669. // persons to whom the Software is furnished to do so, subject to the
  4670. // following conditions:
  4671. //
  4672. // The above copyright notice and this permission notice shall be included
  4673. // in all copies or substantial portions of the Software.
  4674. //
  4675. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  4676. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  4677. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  4678. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  4679. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  4680. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  4681. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  4682. // NOTE: These type checking functions intentionally don't use `instanceof`
  4683. // because it is fragile and can be easily faked with `Object.create()`.
  4684. function isArray(arg) {
  4685. if (Array.isArray) {
  4686. return Array.isArray(arg);
  4687. }
  4688. return objectToString(arg) === '[object Array]';
  4689. }
  4690. exports.isArray = isArray;
  4691. function isBoolean(arg) {
  4692. return typeof arg === 'boolean';
  4693. }
  4694. exports.isBoolean = isBoolean;
  4695. function isNull(arg) {
  4696. return arg === null;
  4697. }
  4698. exports.isNull = isNull;
  4699. function isNullOrUndefined(arg) {
  4700. return arg == null;
  4701. }
  4702. exports.isNullOrUndefined = isNullOrUndefined;
  4703. function isNumber(arg) {
  4704. return typeof arg === 'number';
  4705. }
  4706. exports.isNumber = isNumber;
  4707. function isString(arg) {
  4708. return typeof arg === 'string';
  4709. }
  4710. exports.isString = isString;
  4711. function isSymbol(arg) {
  4712. return typeof arg === 'symbol';
  4713. }
  4714. exports.isSymbol = isSymbol;
  4715. function isUndefined(arg) {
  4716. return arg === void 0;
  4717. }
  4718. exports.isUndefined = isUndefined;
  4719. function isRegExp(re) {
  4720. return objectToString(re) === '[object RegExp]';
  4721. }
  4722. exports.isRegExp = isRegExp;
  4723. function isObject(arg) {
  4724. return typeof arg === 'object' && arg !== null;
  4725. }
  4726. exports.isObject = isObject;
  4727. function isDate(d) {
  4728. return objectToString(d) === '[object Date]';
  4729. }
  4730. exports.isDate = isDate;
  4731. function isError(e) {
  4732. return (objectToString(e) === '[object Error]' || e instanceof Error);
  4733. }
  4734. exports.isError = isError;
  4735. function isFunction(arg) {
  4736. return typeof arg === 'function';
  4737. }
  4738. exports.isFunction = isFunction;
  4739. function isPrimitive(arg) {
  4740. return arg === null ||
  4741. typeof arg === 'boolean' ||
  4742. typeof arg === 'number' ||
  4743. typeof arg === 'string' ||
  4744. typeof arg === 'symbol' || // ES6 symbol
  4745. typeof arg === 'undefined';
  4746. }
  4747. exports.isPrimitive = isPrimitive;
  4748. exports.isBuffer = Buffer.isBuffer;
  4749. function objectToString(o) {
  4750. return Object.prototype.toString.call(o);
  4751. }
  4752. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(4).Buffer))
  4753. /***/ }),
  4754. /* 57 */
  4755. /***/ (function(module, exports) {
  4756. module.exports = function (bitmap, value) {
  4757. return {
  4758. enumerable: !(bitmap & 1),
  4759. configurable: !(bitmap & 2),
  4760. writable: !(bitmap & 4),
  4761. value: value
  4762. };
  4763. };
  4764. /***/ }),
  4765. /* 58 */
  4766. /***/ (function(module, exports) {
  4767. module.exports = {};
  4768. /***/ }),
  4769. /* 59 */
  4770. /***/ (function(module, exports, __webpack_require__) {
  4771. // 19.1.2.14 / 15.2.3.14 Object.keys(O)
  4772. var $keys = __webpack_require__(186);
  4773. var enumBugKeys = __webpack_require__(120);
  4774. module.exports = Object.keys || function keys(O) {
  4775. return $keys(O, enumBugKeys);
  4776. };
  4777. /***/ }),
  4778. /* 60 */
  4779. /***/ (function(module, exports, __webpack_require__) {
  4780. "use strict";
  4781. var $at = __webpack_require__(343)(true);
  4782. // 21.1.3.27 String.prototype[@@iterator]()
  4783. __webpack_require__(116)(String, 'String', function (iterated) {
  4784. this._t = String(iterated); // target
  4785. this._i = 0; // next index
  4786. // 21.1.5.2.1 %StringIteratorPrototype%.next()
  4787. }, function () {
  4788. var O = this._t;
  4789. var index = this._i;
  4790. var point;
  4791. if (index >= O.length) return { value: undefined, done: true };
  4792. point = $at(O, index);
  4793. this._i += point.length;
  4794. return { value: point, done: false };
  4795. });
  4796. /***/ }),
  4797. /* 61 */
  4798. /***/ (function(module, exports, __webpack_require__) {
  4799. var core = __webpack_require__(39);
  4800. var global = __webpack_require__(8);
  4801. var SHARED = '__core-js_shared__';
  4802. var store = global[SHARED] || (global[SHARED] = {});
  4803. (module.exports = function (key, value) {
  4804. return store[key] || (store[key] = value !== undefined ? value : {});
  4805. })('versions', []).push({
  4806. version: core.version,
  4807. mode: __webpack_require__(41) ? 'pure' : 'global',
  4808. copyright: '© 2019 Denis Pushkarev (zloirock.ru)'
  4809. });
  4810. /***/ }),
  4811. /* 62 */
  4812. /***/ (function(module, exports) {
  4813. exports.f = {}.propertyIsEnumerable;
  4814. /***/ }),
  4815. /* 63 */
  4816. /***/ (function(module, exports, __webpack_require__) {
  4817. var def = __webpack_require__(11).f;
  4818. var has = __webpack_require__(24);
  4819. var TAG = __webpack_require__(3)('toStringTag');
  4820. module.exports = function (it, tag, stat) {
  4821. if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });
  4822. };
  4823. /***/ }),
  4824. /* 64 */
  4825. /***/ (function(module, exports, __webpack_require__) {
  4826. // getting tag from 19.1.3.6 Object.prototype.toString()
  4827. var cof = __webpack_require__(53);
  4828. var TAG = __webpack_require__(3)('toStringTag');
  4829. // ES3 wrong here
  4830. var ARG = cof(function () { return arguments; }()) == 'Arguments';
  4831. // fallback for IE11 Script Access Denied error
  4832. var tryGet = function (it, key) {
  4833. try {
  4834. return it[key];
  4835. } catch (e) { /* empty */ }
  4836. };
  4837. module.exports = function (it) {
  4838. var O, T, B;
  4839. return it === undefined ? 'Undefined' : it === null ? 'Null'
  4840. // @@toStringTag case
  4841. : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T
  4842. // builtinTag case
  4843. : ARG ? cof(O)
  4844. // ES3 arguments fallback
  4845. : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;
  4846. };
  4847. /***/ }),
  4848. /* 65 */
  4849. /***/ (function(module, exports, __webpack_require__) {
  4850. // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
  4851. var anObject = __webpack_require__(12);
  4852. var dPs = __webpack_require__(227);
  4853. var enumBugKeys = __webpack_require__(88);
  4854. var IE_PROTO = __webpack_require__(87)('IE_PROTO');
  4855. var Empty = function () { /* empty */ };
  4856. var PROTOTYPE = 'prototype';
  4857. // Create object with fake `null` prototype: use iframe Object with cleared prototype
  4858. var createDict = function () {
  4859. // Thrash, waste and sodomy: IE GC bug
  4860. var iframe = __webpack_require__(135)('iframe');
  4861. var i = enumBugKeys.length;
  4862. var lt = '<';
  4863. var gt = '>';
  4864. var iframeDocument;
  4865. iframe.style.display = 'none';
  4866. __webpack_require__(228).appendChild(iframe);
  4867. iframe.src = 'javascript:'; // eslint-disable-line no-script-url
  4868. // createDict = iframe.contentWindow.Object;
  4869. // html.removeChild(iframe);
  4870. iframeDocument = iframe.contentWindow.document;
  4871. iframeDocument.open();
  4872. iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
  4873. iframeDocument.close();
  4874. createDict = iframeDocument.F;
  4875. while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];
  4876. return createDict();
  4877. };
  4878. module.exports = Object.create || function create(O, Properties) {
  4879. var result;
  4880. if (O !== null) {
  4881. Empty[PROTOTYPE] = anObject(O);
  4882. result = new Empty();
  4883. Empty[PROTOTYPE] = null;
  4884. // add "__proto__" for Object.getPrototypeOf polyfill
  4885. result[IE_PROTO] = O;
  4886. } else result = createDict();
  4887. return Properties === undefined ? result : dPs(result, Properties);
  4888. };
  4889. /***/ }),
  4890. /* 66 */
  4891. /***/ (function(module, exports, __webpack_require__) {
  4892. "use strict";
  4893. var addToUnscopables = __webpack_require__(91);
  4894. var step = __webpack_require__(232);
  4895. var Iterators = __webpack_require__(45);
  4896. var toIObject = __webpack_require__(43);
  4897. // 22.1.3.4 Array.prototype.entries()
  4898. // 22.1.3.13 Array.prototype.keys()
  4899. // 22.1.3.29 Array.prototype.values()
  4900. // 22.1.3.30 Array.prototype[@@iterator]()
  4901. module.exports = __webpack_require__(150)(Array, 'Array', function (iterated, kind) {
  4902. this._t = toIObject(iterated); // target
  4903. this._i = 0; // next index
  4904. this._k = kind; // kind
  4905. // 22.1.5.2.1 %ArrayIteratorPrototype%.next()
  4906. }, function () {
  4907. var O = this._t;
  4908. var kind = this._k;
  4909. var index = this._i++;
  4910. if (!O || index >= O.length) {
  4911. this._t = undefined;
  4912. return step(1);
  4913. }
  4914. if (kind == 'keys') return step(0, index);
  4915. if (kind == 'values') return step(0, O[index]);
  4916. return step(0, [index, O[index]]);
  4917. }, 'values');
  4918. // argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)
  4919. Iterators.Arguments = Iterators.Array;
  4920. addToUnscopables('keys');
  4921. addToUnscopables('values');
  4922. addToUnscopables('entries');
  4923. /***/ }),
  4924. /* 67 */
  4925. /***/ (function(module, exports, __webpack_require__) {
  4926. var pIE = __webpack_require__(62);
  4927. var createDesc = __webpack_require__(40);
  4928. var toIObject = __webpack_require__(43);
  4929. var toPrimitive = __webpack_require__(51);
  4930. var has = __webpack_require__(24);
  4931. var IE8_DOM_DEFINE = __webpack_require__(134);
  4932. var gOPD = Object.getOwnPropertyDescriptor;
  4933. exports.f = __webpack_require__(9) ? gOPD : function getOwnPropertyDescriptor(O, P) {
  4934. O = toIObject(O);
  4935. P = toPrimitive(P, true);
  4936. if (IE8_DOM_DEFINE) try {
  4937. return gOPD(O, P);
  4938. } catch (e) { /* empty */ }
  4939. if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]);
  4940. };
  4941. /***/ }),
  4942. /* 68 */
  4943. /***/ (function(module, exports, __webpack_require__) {
  4944. "use strict";
  4945. // Copyright Joyent, Inc. and other Node contributors.
  4946. //
  4947. // Permission is hereby granted, free of charge, to any person obtaining a
  4948. // copy of this software and associated documentation files (the
  4949. // "Software"), to deal in the Software without restriction, including
  4950. // without limitation the rights to use, copy, modify, merge, publish,
  4951. // distribute, sublicense, and/or sell copies of the Software, and to permit
  4952. // persons to whom the Software is furnished to do so, subject to the
  4953. // following conditions:
  4954. //
  4955. // The above copyright notice and this permission notice shall be included
  4956. // in all copies or substantial portions of the Software.
  4957. //
  4958. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  4959. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  4960. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  4961. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  4962. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  4963. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  4964. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  4965. var R = typeof Reflect === 'object' ? Reflect : null
  4966. var ReflectApply = R && typeof R.apply === 'function'
  4967. ? R.apply
  4968. : function ReflectApply(target, receiver, args) {
  4969. return Function.prototype.apply.call(target, receiver, args);
  4970. }
  4971. var ReflectOwnKeys
  4972. if (R && typeof R.ownKeys === 'function') {
  4973. ReflectOwnKeys = R.ownKeys
  4974. } else if (Object.getOwnPropertySymbols) {
  4975. ReflectOwnKeys = function ReflectOwnKeys(target) {
  4976. return Object.getOwnPropertyNames(target)
  4977. .concat(Object.getOwnPropertySymbols(target));
  4978. };
  4979. } else {
  4980. ReflectOwnKeys = function ReflectOwnKeys(target) {
  4981. return Object.getOwnPropertyNames(target);
  4982. };
  4983. }
  4984. function ProcessEmitWarning(warning) {
  4985. if (console && console.warn) console.warn(warning);
  4986. }
  4987. var NumberIsNaN = Number.isNaN || function NumberIsNaN(value) {
  4988. return value !== value;
  4989. }
  4990. function EventEmitter() {
  4991. EventEmitter.init.call(this);
  4992. }
  4993. module.exports = EventEmitter;
  4994. // Backwards-compat with node 0.10.x
  4995. EventEmitter.EventEmitter = EventEmitter;
  4996. EventEmitter.prototype._events = undefined;
  4997. EventEmitter.prototype._eventsCount = 0;
  4998. EventEmitter.prototype._maxListeners = undefined;
  4999. // By default EventEmitters will print a warning if more than 10 listeners are
  5000. // added to it. This is a useful default which helps finding memory leaks.
  5001. var defaultMaxListeners = 10;
  5002. function checkListener(listener) {
  5003. if (typeof listener !== 'function') {
  5004. throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener);
  5005. }
  5006. }
  5007. Object.defineProperty(EventEmitter, 'defaultMaxListeners', {
  5008. enumerable: true,
  5009. get: function() {
  5010. return defaultMaxListeners;
  5011. },
  5012. set: function(arg) {
  5013. if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) {
  5014. throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + '.');
  5015. }
  5016. defaultMaxListeners = arg;
  5017. }
  5018. });
  5019. EventEmitter.init = function() {
  5020. if (this._events === undefined ||
  5021. this._events === Object.getPrototypeOf(this)._events) {
  5022. this._events = Object.create(null);
  5023. this._eventsCount = 0;
  5024. }
  5025. this._maxListeners = this._maxListeners || undefined;
  5026. };
  5027. // Obviously not all Emitters should be limited to 10. This function allows
  5028. // that to be increased. Set to zero for unlimited.
  5029. EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {
  5030. if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) {
  5031. throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n + '.');
  5032. }
  5033. this._maxListeners = n;
  5034. return this;
  5035. };
  5036. function _getMaxListeners(that) {
  5037. if (that._maxListeners === undefined)
  5038. return EventEmitter.defaultMaxListeners;
  5039. return that._maxListeners;
  5040. }
  5041. EventEmitter.prototype.getMaxListeners = function getMaxListeners() {
  5042. return _getMaxListeners(this);
  5043. };
  5044. EventEmitter.prototype.emit = function emit(type) {
  5045. var args = [];
  5046. for (var i = 1; i < arguments.length; i++) args.push(arguments[i]);
  5047. var doError = (type === 'error');
  5048. var events = this._events;
  5049. if (events !== undefined)
  5050. doError = (doError && events.error === undefined);
  5051. else if (!doError)
  5052. return false;
  5053. // If there is no 'error' event listener then throw.
  5054. if (doError) {
  5055. var er;
  5056. if (args.length > 0)
  5057. er = args[0];
  5058. if (er instanceof Error) {
  5059. // Note: The comments on the `throw` lines are intentional, they show
  5060. // up in Node's output if this results in an unhandled exception.
  5061. throw er; // Unhandled 'error' event
  5062. }
  5063. // At least give some kind of context to the user
  5064. var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : ''));
  5065. err.context = er;
  5066. throw err; // Unhandled 'error' event
  5067. }
  5068. var handler = events[type];
  5069. if (handler === undefined)
  5070. return false;
  5071. if (typeof handler === 'function') {
  5072. ReflectApply(handler, this, args);
  5073. } else {
  5074. var len = handler.length;
  5075. var listeners = arrayClone(handler, len);
  5076. for (var i = 0; i < len; ++i)
  5077. ReflectApply(listeners[i], this, args);
  5078. }
  5079. return true;
  5080. };
  5081. function _addListener(target, type, listener, prepend) {
  5082. var m;
  5083. var events;
  5084. var existing;
  5085. checkListener(listener);
  5086. events = target._events;
  5087. if (events === undefined) {
  5088. events = target._events = Object.create(null);
  5089. target._eventsCount = 0;
  5090. } else {
  5091. // To avoid recursion in the case that type === "newListener"! Before
  5092. // adding it to the listeners, first emit "newListener".
  5093. if (events.newListener !== undefined) {
  5094. target.emit('newListener', type,
  5095. listener.listener ? listener.listener : listener);
  5096. // Re-assign `events` because a newListener handler could have caused the
  5097. // this._events to be assigned to a new object
  5098. events = target._events;
  5099. }
  5100. existing = events[type];
  5101. }
  5102. if (existing === undefined) {
  5103. // Optimize the case of one listener. Don't need the extra array object.
  5104. existing = events[type] = listener;
  5105. ++target._eventsCount;
  5106. } else {
  5107. if (typeof existing === 'function') {
  5108. // Adding the second element, need to change to array.
  5109. existing = events[type] =
  5110. prepend ? [listener, existing] : [existing, listener];
  5111. // If we've already got an array, just append.
  5112. } else if (prepend) {
  5113. existing.unshift(listener);
  5114. } else {
  5115. existing.push(listener);
  5116. }
  5117. // Check for listener leak
  5118. m = _getMaxListeners(target);
  5119. if (m > 0 && existing.length > m && !existing.warned) {
  5120. existing.warned = true;
  5121. // No error code for this since it is a Warning
  5122. // eslint-disable-next-line no-restricted-syntax
  5123. var w = new Error('Possible EventEmitter memory leak detected. ' +
  5124. existing.length + ' ' + String(type) + ' listeners ' +
  5125. 'added. Use emitter.setMaxListeners() to ' +
  5126. 'increase limit');
  5127. w.name = 'MaxListenersExceededWarning';
  5128. w.emitter = target;
  5129. w.type = type;
  5130. w.count = existing.length;
  5131. ProcessEmitWarning(w);
  5132. }
  5133. }
  5134. return target;
  5135. }
  5136. EventEmitter.prototype.addListener = function addListener(type, listener) {
  5137. return _addListener(this, type, listener, false);
  5138. };
  5139. EventEmitter.prototype.on = EventEmitter.prototype.addListener;
  5140. EventEmitter.prototype.prependListener =
  5141. function prependListener(type, listener) {
  5142. return _addListener(this, type, listener, true);
  5143. };
  5144. function onceWrapper() {
  5145. if (!this.fired) {
  5146. this.target.removeListener(this.type, this.wrapFn);
  5147. this.fired = true;
  5148. if (arguments.length === 0)
  5149. return this.listener.call(this.target);
  5150. return this.listener.apply(this.target, arguments);
  5151. }
  5152. }
  5153. function _onceWrap(target, type, listener) {
  5154. var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener };
  5155. var wrapped = onceWrapper.bind(state);
  5156. wrapped.listener = listener;
  5157. state.wrapFn = wrapped;
  5158. return wrapped;
  5159. }
  5160. EventEmitter.prototype.once = function once(type, listener) {
  5161. checkListener(listener);
  5162. this.on(type, _onceWrap(this, type, listener));
  5163. return this;
  5164. };
  5165. EventEmitter.prototype.prependOnceListener =
  5166. function prependOnceListener(type, listener) {
  5167. checkListener(listener);
  5168. this.prependListener(type, _onceWrap(this, type, listener));
  5169. return this;
  5170. };
  5171. // Emits a 'removeListener' event if and only if the listener was removed.
  5172. EventEmitter.prototype.removeListener =
  5173. function removeListener(type, listener) {
  5174. var list, events, position, i, originalListener;
  5175. checkListener(listener);
  5176. events = this._events;
  5177. if (events === undefined)
  5178. return this;
  5179. list = events[type];
  5180. if (list === undefined)
  5181. return this;
  5182. if (list === listener || list.listener === listener) {
  5183. if (--this._eventsCount === 0)
  5184. this._events = Object.create(null);
  5185. else {
  5186. delete events[type];
  5187. if (events.removeListener)
  5188. this.emit('removeListener', type, list.listener || listener);
  5189. }
  5190. } else if (typeof list !== 'function') {
  5191. position = -1;
  5192. for (i = list.length - 1; i >= 0; i--) {
  5193. if (list[i] === listener || list[i].listener === listener) {
  5194. originalListener = list[i].listener;
  5195. position = i;
  5196. break;
  5197. }
  5198. }
  5199. if (position < 0)
  5200. return this;
  5201. if (position === 0)
  5202. list.shift();
  5203. else {
  5204. spliceOne(list, position);
  5205. }
  5206. if (list.length === 1)
  5207. events[type] = list[0];
  5208. if (events.removeListener !== undefined)
  5209. this.emit('removeListener', type, originalListener || listener);
  5210. }
  5211. return this;
  5212. };
  5213. EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
  5214. EventEmitter.prototype.removeAllListeners =
  5215. function removeAllListeners(type) {
  5216. var listeners, events, i;
  5217. events = this._events;
  5218. if (events === undefined)
  5219. return this;
  5220. // not listening for removeListener, no need to emit
  5221. if (events.removeListener === undefined) {
  5222. if (arguments.length === 0) {
  5223. this._events = Object.create(null);
  5224. this._eventsCount = 0;
  5225. } else if (events[type] !== undefined) {
  5226. if (--this._eventsCount === 0)
  5227. this._events = Object.create(null);
  5228. else
  5229. delete events[type];
  5230. }
  5231. return this;
  5232. }
  5233. // emit removeListener for all listeners on all events
  5234. if (arguments.length === 0) {
  5235. var keys = Object.keys(events);
  5236. var key;
  5237. for (i = 0; i < keys.length; ++i) {
  5238. key = keys[i];
  5239. if (key === 'removeListener') continue;
  5240. this.removeAllListeners(key);
  5241. }
  5242. this.removeAllListeners('removeListener');
  5243. this._events = Object.create(null);
  5244. this._eventsCount = 0;
  5245. return this;
  5246. }
  5247. listeners = events[type];
  5248. if (typeof listeners === 'function') {
  5249. this.removeListener(type, listeners);
  5250. } else if (listeners !== undefined) {
  5251. // LIFO order
  5252. for (i = listeners.length - 1; i >= 0; i--) {
  5253. this.removeListener(type, listeners[i]);
  5254. }
  5255. }
  5256. return this;
  5257. };
  5258. function _listeners(target, type, unwrap) {
  5259. var events = target._events;
  5260. if (events === undefined)
  5261. return [];
  5262. var evlistener = events[type];
  5263. if (evlistener === undefined)
  5264. return [];
  5265. if (typeof evlistener === 'function')
  5266. return unwrap ? [evlistener.listener || evlistener] : [evlistener];
  5267. return unwrap ?
  5268. unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);
  5269. }
  5270. EventEmitter.prototype.listeners = function listeners(type) {
  5271. return _listeners(this, type, true);
  5272. };
  5273. EventEmitter.prototype.rawListeners = function rawListeners(type) {
  5274. return _listeners(this, type, false);
  5275. };
  5276. EventEmitter.listenerCount = function(emitter, type) {
  5277. if (typeof emitter.listenerCount === 'function') {
  5278. return emitter.listenerCount(type);
  5279. } else {
  5280. return listenerCount.call(emitter, type);
  5281. }
  5282. };
  5283. EventEmitter.prototype.listenerCount = listenerCount;
  5284. function listenerCount(type) {
  5285. var events = this._events;
  5286. if (events !== undefined) {
  5287. var evlistener = events[type];
  5288. if (typeof evlistener === 'function') {
  5289. return 1;
  5290. } else if (evlistener !== undefined) {
  5291. return evlistener.length;
  5292. }
  5293. }
  5294. return 0;
  5295. }
  5296. EventEmitter.prototype.eventNames = function eventNames() {
  5297. return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];
  5298. };
  5299. function arrayClone(arr, n) {
  5300. var copy = new Array(n);
  5301. for (var i = 0; i < n; ++i)
  5302. copy[i] = arr[i];
  5303. return copy;
  5304. }
  5305. function spliceOne(list, index) {
  5306. for (; index + 1 < list.length; index++)
  5307. list[index] = list[index + 1];
  5308. list.pop();
  5309. }
  5310. function unwrapListeners(arr) {
  5311. var ret = new Array(arr.length);
  5312. for (var i = 0; i < ret.length; ++i) {
  5313. ret[i] = arr[i].listener || arr[i];
  5314. }
  5315. return ret;
  5316. }
  5317. /***/ }),
  5318. /* 69 */
  5319. /***/ (function(module, exports, __webpack_require__) {
  5320. "use strict";
  5321. /* WEBPACK VAR INJECTION */(function(process) {
  5322. if (typeof process === 'undefined' ||
  5323. !process.version ||
  5324. process.version.indexOf('v0.') === 0 ||
  5325. process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) {
  5326. module.exports = { nextTick: nextTick };
  5327. } else {
  5328. module.exports = process
  5329. }
  5330. function nextTick(fn, arg1, arg2, arg3) {
  5331. if (typeof fn !== 'function') {
  5332. throw new TypeError('"callback" argument must be a function');
  5333. }
  5334. var len = arguments.length;
  5335. var args, i;
  5336. switch (len) {
  5337. case 0:
  5338. case 1:
  5339. return process.nextTick(fn);
  5340. case 2:
  5341. return process.nextTick(function afterTickOne() {
  5342. fn.call(null, arg1);
  5343. });
  5344. case 3:
  5345. return process.nextTick(function afterTickTwo() {
  5346. fn.call(null, arg1, arg2);
  5347. });
  5348. case 4:
  5349. return process.nextTick(function afterTickThree() {
  5350. fn.call(null, arg1, arg2, arg3);
  5351. });
  5352. default:
  5353. args = new Array(len - 1);
  5354. i = 0;
  5355. while (i < args.length) {
  5356. args[i++] = arguments[i];
  5357. }
  5358. return process.nextTick(function afterTick() {
  5359. fn.apply(null, args);
  5360. });
  5361. }
  5362. }
  5363. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(25)))
  5364. /***/ }),
  5365. /* 70 */
  5366. /***/ (function(module, exports, __webpack_require__) {
  5367. /* eslint-disable node/no-deprecated-api */
  5368. var buffer = __webpack_require__(4)
  5369. var Buffer = buffer.Buffer
  5370. // alternative to using Object.keys for old browsers
  5371. function copyProps (src, dst) {
  5372. for (var key in src) {
  5373. dst[key] = src[key]
  5374. }
  5375. }
  5376. if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {
  5377. module.exports = buffer
  5378. } else {
  5379. // Copy properties from require('buffer')
  5380. copyProps(buffer, exports)
  5381. exports.Buffer = SafeBuffer
  5382. }
  5383. function SafeBuffer (arg, encodingOrOffset, length) {
  5384. return Buffer(arg, encodingOrOffset, length)
  5385. }
  5386. // Copy static methods from Buffer
  5387. copyProps(Buffer, SafeBuffer)
  5388. SafeBuffer.from = function (arg, encodingOrOffset, length) {
  5389. if (typeof arg === 'number') {
  5390. throw new TypeError('Argument must not be a number')
  5391. }
  5392. return Buffer(arg, encodingOrOffset, length)
  5393. }
  5394. SafeBuffer.alloc = function (size, fill, encoding) {
  5395. if (typeof size !== 'number') {
  5396. throw new TypeError('Argument must be a number')
  5397. }
  5398. var buf = Buffer(size)
  5399. if (fill !== undefined) {
  5400. if (typeof encoding === 'string') {
  5401. buf.fill(fill, encoding)
  5402. } else {
  5403. buf.fill(fill)
  5404. }
  5405. } else {
  5406. buf.fill(0)
  5407. }
  5408. return buf
  5409. }
  5410. SafeBuffer.allocUnsafe = function (size) {
  5411. if (typeof size !== 'number') {
  5412. throw new TypeError('Argument must be a number')
  5413. }
  5414. return Buffer(size)
  5415. }
  5416. SafeBuffer.allocUnsafeSlow = function (size) {
  5417. if (typeof size !== 'number') {
  5418. throw new TypeError('Argument must be a number')
  5419. }
  5420. return buffer.SlowBuffer(size)
  5421. }
  5422. /***/ }),
  5423. /* 71 */
  5424. /***/ (function(module, exports, __webpack_require__) {
  5425. "use strict";
  5426. var TYPED_OK = (typeof Uint8Array !== 'undefined') &&
  5427. (typeof Uint16Array !== 'undefined') &&
  5428. (typeof Int32Array !== 'undefined');
  5429. function _has(obj, key) {
  5430. return Object.prototype.hasOwnProperty.call(obj, key);
  5431. }
  5432. exports.assign = function (obj /*from1, from2, from3, ...*/) {
  5433. var sources = Array.prototype.slice.call(arguments, 1);
  5434. while (sources.length) {
  5435. var source = sources.shift();
  5436. if (!source) { continue; }
  5437. if (typeof source !== 'object') {
  5438. throw new TypeError(source + 'must be non-object');
  5439. }
  5440. for (var p in source) {
  5441. if (_has(source, p)) {
  5442. obj[p] = source[p];
  5443. }
  5444. }
  5445. }
  5446. return obj;
  5447. };
  5448. // reduce buffer size, avoiding mem copy
  5449. exports.shrinkBuf = function (buf, size) {
  5450. if (buf.length === size) { return buf; }
  5451. if (buf.subarray) { return buf.subarray(0, size); }
  5452. buf.length = size;
  5453. return buf;
  5454. };
  5455. var fnTyped = {
  5456. arraySet: function (dest, src, src_offs, len, dest_offs) {
  5457. if (src.subarray && dest.subarray) {
  5458. dest.set(src.subarray(src_offs, src_offs + len), dest_offs);
  5459. return;
  5460. }
  5461. // Fallback to ordinary array
  5462. for (var i = 0; i < len; i++) {
  5463. dest[dest_offs + i] = src[src_offs + i];
  5464. }
  5465. },
  5466. // Join array of chunks to single array.
  5467. flattenChunks: function (chunks) {
  5468. var i, l, len, pos, chunk, result;
  5469. // calculate data length
  5470. len = 0;
  5471. for (i = 0, l = chunks.length; i < l; i++) {
  5472. len += chunks[i].length;
  5473. }
  5474. // join chunks
  5475. result = new Uint8Array(len);
  5476. pos = 0;
  5477. for (i = 0, l = chunks.length; i < l; i++) {
  5478. chunk = chunks[i];
  5479. result.set(chunk, pos);
  5480. pos += chunk.length;
  5481. }
  5482. return result;
  5483. }
  5484. };
  5485. var fnUntyped = {
  5486. arraySet: function (dest, src, src_offs, len, dest_offs) {
  5487. for (var i = 0; i < len; i++) {
  5488. dest[dest_offs + i] = src[src_offs + i];
  5489. }
  5490. },
  5491. // Join array of chunks to single array.
  5492. flattenChunks: function (chunks) {
  5493. return [].concat.apply([], chunks);
  5494. }
  5495. };
  5496. // Enable/Disable typed arrays use, for testing
  5497. //
  5498. exports.setTyped = function (on) {
  5499. if (on) {
  5500. exports.Buf8 = Uint8Array;
  5501. exports.Buf16 = Uint16Array;
  5502. exports.Buf32 = Int32Array;
  5503. exports.assign(exports, fnTyped);
  5504. } else {
  5505. exports.Buf8 = Array;
  5506. exports.Buf16 = Array;
  5507. exports.Buf32 = Array;
  5508. exports.assign(exports, fnUntyped);
  5509. }
  5510. };
  5511. exports.setTyped(TYPED_OK);
  5512. /***/ }),
  5513. /* 72 */
  5514. /***/ (function(module, exports, __webpack_require__) {
  5515. ;(function (root, factory) {
  5516. if (true) {
  5517. // CommonJS
  5518. module.exports = exports = factory(__webpack_require__(1));
  5519. }
  5520. else {}
  5521. }(this, function (CryptoJS) {
  5522. (function (undefined) {
  5523. // Shortcuts
  5524. var C = CryptoJS;
  5525. var C_lib = C.lib;
  5526. var Base = C_lib.Base;
  5527. var X32WordArray = C_lib.WordArray;
  5528. /**
  5529. * x64 namespace.
  5530. */
  5531. var C_x64 = C.x64 = {};
  5532. /**
  5533. * A 64-bit word.
  5534. */
  5535. var X64Word = C_x64.Word = Base.extend({
  5536. /**
  5537. * Initializes a newly created 64-bit word.
  5538. *
  5539. * @param {number} high The high 32 bits.
  5540. * @param {number} low The low 32 bits.
  5541. *
  5542. * @example
  5543. *
  5544. * var x64Word = CryptoJS.x64.Word.create(0x00010203, 0x04050607);
  5545. */
  5546. init: function (high, low) {
  5547. this.high = high;
  5548. this.low = low;
  5549. }
  5550. /**
  5551. * Bitwise NOTs this word.
  5552. *
  5553. * @return {X64Word} A new x64-Word object after negating.
  5554. *
  5555. * @example
  5556. *
  5557. * var negated = x64Word.not();
  5558. */
  5559. // not: function () {
  5560. // var high = ~this.high;
  5561. // var low = ~this.low;
  5562. // return X64Word.create(high, low);
  5563. // },
  5564. /**
  5565. * Bitwise ANDs this word with the passed word.
  5566. *
  5567. * @param {X64Word} word The x64-Word to AND with this word.
  5568. *
  5569. * @return {X64Word} A new x64-Word object after ANDing.
  5570. *
  5571. * @example
  5572. *
  5573. * var anded = x64Word.and(anotherX64Word);
  5574. */
  5575. // and: function (word) {
  5576. // var high = this.high & word.high;
  5577. // var low = this.low & word.low;
  5578. // return X64Word.create(high, low);
  5579. // },
  5580. /**
  5581. * Bitwise ORs this word with the passed word.
  5582. *
  5583. * @param {X64Word} word The x64-Word to OR with this word.
  5584. *
  5585. * @return {X64Word} A new x64-Word object after ORing.
  5586. *
  5587. * @example
  5588. *
  5589. * var ored = x64Word.or(anotherX64Word);
  5590. */
  5591. // or: function (word) {
  5592. // var high = this.high | word.high;
  5593. // var low = this.low | word.low;
  5594. // return X64Word.create(high, low);
  5595. // },
  5596. /**
  5597. * Bitwise XORs this word with the passed word.
  5598. *
  5599. * @param {X64Word} word The x64-Word to XOR with this word.
  5600. *
  5601. * @return {X64Word} A new x64-Word object after XORing.
  5602. *
  5603. * @example
  5604. *
  5605. * var xored = x64Word.xor(anotherX64Word);
  5606. */
  5607. // xor: function (word) {
  5608. // var high = this.high ^ word.high;
  5609. // var low = this.low ^ word.low;
  5610. // return X64Word.create(high, low);
  5611. // },
  5612. /**
  5613. * Shifts this word n bits to the left.
  5614. *
  5615. * @param {number} n The number of bits to shift.
  5616. *
  5617. * @return {X64Word} A new x64-Word object after shifting.
  5618. *
  5619. * @example
  5620. *
  5621. * var shifted = x64Word.shiftL(25);
  5622. */
  5623. // shiftL: function (n) {
  5624. // if (n < 32) {
  5625. // var high = (this.high << n) | (this.low >>> (32 - n));
  5626. // var low = this.low << n;
  5627. // } else {
  5628. // var high = this.low << (n - 32);
  5629. // var low = 0;
  5630. // }
  5631. // return X64Word.create(high, low);
  5632. // },
  5633. /**
  5634. * Shifts this word n bits to the right.
  5635. *
  5636. * @param {number} n The number of bits to shift.
  5637. *
  5638. * @return {X64Word} A new x64-Word object after shifting.
  5639. *
  5640. * @example
  5641. *
  5642. * var shifted = x64Word.shiftR(7);
  5643. */
  5644. // shiftR: function (n) {
  5645. // if (n < 32) {
  5646. // var low = (this.low >>> n) | (this.high << (32 - n));
  5647. // var high = this.high >>> n;
  5648. // } else {
  5649. // var low = this.high >>> (n - 32);
  5650. // var high = 0;
  5651. // }
  5652. // return X64Word.create(high, low);
  5653. // },
  5654. /**
  5655. * Rotates this word n bits to the left.
  5656. *
  5657. * @param {number} n The number of bits to rotate.
  5658. *
  5659. * @return {X64Word} A new x64-Word object after rotating.
  5660. *
  5661. * @example
  5662. *
  5663. * var rotated = x64Word.rotL(25);
  5664. */
  5665. // rotL: function (n) {
  5666. // return this.shiftL(n).or(this.shiftR(64 - n));
  5667. // },
  5668. /**
  5669. * Rotates this word n bits to the right.
  5670. *
  5671. * @param {number} n The number of bits to rotate.
  5672. *
  5673. * @return {X64Word} A new x64-Word object after rotating.
  5674. *
  5675. * @example
  5676. *
  5677. * var rotated = x64Word.rotR(7);
  5678. */
  5679. // rotR: function (n) {
  5680. // return this.shiftR(n).or(this.shiftL(64 - n));
  5681. // },
  5682. /**
  5683. * Adds this word with the passed word.
  5684. *
  5685. * @param {X64Word} word The x64-Word to add with this word.
  5686. *
  5687. * @return {X64Word} A new x64-Word object after adding.
  5688. *
  5689. * @example
  5690. *
  5691. * var added = x64Word.add(anotherX64Word);
  5692. */
  5693. // add: function (word) {
  5694. // var low = (this.low + word.low) | 0;
  5695. // var carry = (low >>> 0) < (this.low >>> 0) ? 1 : 0;
  5696. // var high = (this.high + word.high + carry) | 0;
  5697. // return X64Word.create(high, low);
  5698. // }
  5699. });
  5700. /**
  5701. * An array of 64-bit words.
  5702. *
  5703. * @property {Array} words The array of CryptoJS.x64.Word objects.
  5704. * @property {number} sigBytes The number of significant bytes in this word array.
  5705. */
  5706. var X64WordArray = C_x64.WordArray = Base.extend({
  5707. /**
  5708. * Initializes a newly created word array.
  5709. *
  5710. * @param {Array} words (Optional) An array of CryptoJS.x64.Word objects.
  5711. * @param {number} sigBytes (Optional) The number of significant bytes in the words.
  5712. *
  5713. * @example
  5714. *
  5715. * var wordArray = CryptoJS.x64.WordArray.create();
  5716. *
  5717. * var wordArray = CryptoJS.x64.WordArray.create([
  5718. * CryptoJS.x64.Word.create(0x00010203, 0x04050607),
  5719. * CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f)
  5720. * ]);
  5721. *
  5722. * var wordArray = CryptoJS.x64.WordArray.create([
  5723. * CryptoJS.x64.Word.create(0x00010203, 0x04050607),
  5724. * CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f)
  5725. * ], 10);
  5726. */
  5727. init: function (words, sigBytes) {
  5728. words = this.words = words || [];
  5729. if (sigBytes != undefined) {
  5730. this.sigBytes = sigBytes;
  5731. } else {
  5732. this.sigBytes = words.length * 8;
  5733. }
  5734. },
  5735. /**
  5736. * Converts this 64-bit word array to a 32-bit word array.
  5737. *
  5738. * @return {CryptoJS.lib.WordArray} This word array's data as a 32-bit word array.
  5739. *
  5740. * @example
  5741. *
  5742. * var x32WordArray = x64WordArray.toX32();
  5743. */
  5744. toX32: function () {
  5745. // Shortcuts
  5746. var x64Words = this.words;
  5747. var x64WordsLength = x64Words.length;
  5748. // Convert
  5749. var x32Words = [];
  5750. for (var i = 0; i < x64WordsLength; i++) {
  5751. var x64Word = x64Words[i];
  5752. x32Words.push(x64Word.high);
  5753. x32Words.push(x64Word.low);
  5754. }
  5755. return X32WordArray.create(x32Words, this.sigBytes);
  5756. },
  5757. /**
  5758. * Creates a copy of this word array.
  5759. *
  5760. * @return {X64WordArray} The clone.
  5761. *
  5762. * @example
  5763. *
  5764. * var clone = x64WordArray.clone();
  5765. */
  5766. clone: function () {
  5767. var clone = Base.clone.call(this);
  5768. // Clone "words" array
  5769. var words = clone.words = this.words.slice(0);
  5770. // Clone each X64Word object
  5771. var wordsLength = words.length;
  5772. for (var i = 0; i < wordsLength; i++) {
  5773. words[i] = words[i].clone();
  5774. }
  5775. return clone;
  5776. }
  5777. });
  5778. }());
  5779. return CryptoJS;
  5780. }));
  5781. /***/ }),
  5782. /* 73 */
  5783. /***/ (function(module, exports) {
  5784. exports.f = {}.propertyIsEnumerable;
  5785. /***/ }),
  5786. /* 74 */
  5787. /***/ (function(module, exports, __webpack_require__) {
  5788. __webpack_require__(337);
  5789. var global = __webpack_require__(21);
  5790. var hide = __webpack_require__(27);
  5791. var Iterators = __webpack_require__(58);
  5792. var TO_STRING_TAG = __webpack_require__(14)('toStringTag');
  5793. var DOMIterables = ('CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,' +
  5794. 'DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,' +
  5795. 'MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,' +
  5796. 'SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,' +
  5797. 'TextTrackList,TouchList').split(',');
  5798. for (var i = 0; i < DOMIterables.length; i++) {
  5799. var NAME = DOMIterables[i];
  5800. var Collection = global[NAME];
  5801. var proto = Collection && Collection.prototype;
  5802. if (proto && !proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME);
  5803. Iterators[NAME] = Iterators.Array;
  5804. }
  5805. /***/ }),
  5806. /* 75 */
  5807. /***/ (function(module, exports) {
  5808. module.exports = true;
  5809. /***/ }),
  5810. /* 76 */
  5811. /***/ (function(module, exports, __webpack_require__) {
  5812. // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
  5813. var anObject = __webpack_require__(28);
  5814. var dPs = __webpack_require__(185);
  5815. var enumBugKeys = __webpack_require__(120);
  5816. var IE_PROTO = __webpack_require__(118)('IE_PROTO');
  5817. var Empty = function () { /* empty */ };
  5818. var PROTOTYPE = 'prototype';
  5819. // Create object with fake `null` prototype: use iframe Object with cleared prototype
  5820. var createDict = function () {
  5821. // Thrash, waste and sodomy: IE GC bug
  5822. var iframe = __webpack_require__(181)('iframe');
  5823. var i = enumBugKeys.length;
  5824. var lt = '<';
  5825. var gt = '>';
  5826. var iframeDocument;
  5827. iframe.style.display = 'none';
  5828. __webpack_require__(341).appendChild(iframe);
  5829. iframe.src = 'javascript:'; // eslint-disable-line no-script-url
  5830. // createDict = iframe.contentWindow.Object;
  5831. // html.removeChild(iframe);
  5832. iframeDocument = iframe.contentWindow.document;
  5833. iframeDocument.open();
  5834. iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
  5835. iframeDocument.close();
  5836. createDict = iframeDocument.F;
  5837. while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];
  5838. return createDict();
  5839. };
  5840. module.exports = Object.create || function create(O, Properties) {
  5841. var result;
  5842. if (O !== null) {
  5843. Empty[PROTOTYPE] = anObject(O);
  5844. result = new Empty();
  5845. Empty[PROTOTYPE] = null;
  5846. // add "__proto__" for Object.getPrototypeOf polyfill
  5847. result[IE_PROTO] = O;
  5848. } else result = createDict();
  5849. return Properties === undefined ? result : dPs(result, Properties);
  5850. };
  5851. /***/ }),
  5852. /* 77 */
  5853. /***/ (function(module, exports, __webpack_require__) {
  5854. // 7.1.15 ToLength
  5855. var toInteger = __webpack_require__(117);
  5856. var min = Math.min;
  5857. module.exports = function (it) {
  5858. return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
  5859. };
  5860. /***/ }),
  5861. /* 78 */
  5862. /***/ (function(module, exports) {
  5863. var id = 0;
  5864. var px = Math.random();
  5865. module.exports = function (key) {
  5866. return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
  5867. };
  5868. /***/ }),
  5869. /* 79 */
  5870. /***/ (function(module, exports, __webpack_require__) {
  5871. var def = __webpack_require__(17).f;
  5872. var has = __webpack_require__(36);
  5873. var TAG = __webpack_require__(14)('toStringTag');
  5874. module.exports = function (it, tag, stat) {
  5875. if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });
  5876. };
  5877. /***/ }),
  5878. /* 80 */
  5879. /***/ (function(module, exports, __webpack_require__) {
  5880. var META = __webpack_require__(78)('meta');
  5881. var isObject = __webpack_require__(20);
  5882. var has = __webpack_require__(36);
  5883. var setDesc = __webpack_require__(17).f;
  5884. var id = 0;
  5885. var isExtensible = Object.isExtensible || function () {
  5886. return true;
  5887. };
  5888. var FREEZE = !__webpack_require__(37)(function () {
  5889. return isExtensible(Object.preventExtensions({}));
  5890. });
  5891. var setMeta = function (it) {
  5892. setDesc(it, META, { value: {
  5893. i: 'O' + ++id, // object ID
  5894. w: {} // weak collections IDs
  5895. } });
  5896. };
  5897. var fastKey = function (it, create) {
  5898. // return primitive with prefix
  5899. if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
  5900. if (!has(it, META)) {
  5901. // can't set metadata to uncaught frozen object
  5902. if (!isExtensible(it)) return 'F';
  5903. // not necessary to add metadata
  5904. if (!create) return 'E';
  5905. // add missing metadata
  5906. setMeta(it);
  5907. // return object ID
  5908. } return it[META].i;
  5909. };
  5910. var getWeak = function (it, create) {
  5911. if (!has(it, META)) {
  5912. // can't set metadata to uncaught frozen object
  5913. if (!isExtensible(it)) return true;
  5914. // not necessary to add metadata
  5915. if (!create) return false;
  5916. // add missing metadata
  5917. setMeta(it);
  5918. // return hash weak collections IDs
  5919. } return it[META].w;
  5920. };
  5921. // add metadata on freeze-family methods calling
  5922. var onFreeze = function (it) {
  5923. if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it);
  5924. return it;
  5925. };
  5926. var meta = module.exports = {
  5927. KEY: META,
  5928. NEED: false,
  5929. fastKey: fastKey,
  5930. getWeak: getWeak,
  5931. onFreeze: onFreeze
  5932. };
  5933. /***/ }),
  5934. /* 81 */
  5935. /***/ (function(module, exports, __webpack_require__) {
  5936. var ctx = __webpack_require__(38);
  5937. var call = __webpack_require__(195);
  5938. var isArrayIter = __webpack_require__(196);
  5939. var anObject = __webpack_require__(28);
  5940. var toLength = __webpack_require__(77);
  5941. var getIterFn = __webpack_require__(121);
  5942. var BREAK = {};
  5943. var RETURN = {};
  5944. var exports = module.exports = function (iterable, entries, fn, that, ITERATOR) {
  5945. var iterFn = ITERATOR ? function () { return iterable; } : getIterFn(iterable);
  5946. var f = ctx(fn, that, entries ? 2 : 1);
  5947. var index = 0;
  5948. var length, step, iterator, result;
  5949. if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!');
  5950. // fast case for arrays with default iterator
  5951. if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) {
  5952. result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]);
  5953. if (result === BREAK || result === RETURN) return result;
  5954. } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) {
  5955. result = call(iterator, f, step.value, entries);
  5956. if (result === BREAK || result === RETURN) return result;
  5957. }
  5958. };
  5959. exports.BREAK = BREAK;
  5960. exports.RETURN = RETURN;
  5961. /***/ }),
  5962. /* 82 */
  5963. /***/ (function(module, exports, __webpack_require__) {
  5964. __webpack_require__(140)('Uint32', 4, function (init) {
  5965. return function Uint32Array(data, byteOffset, length) {
  5966. return init(this, data, byteOffset, length);
  5967. };
  5968. });
  5969. /***/ }),
  5970. /* 83 */
  5971. /***/ (function(module, exports) {
  5972. var TINF_OK = 0;
  5973. var TINF_DATA_ERROR = -3;
  5974. function Tree() {
  5975. this.table = new Uint16Array(16); /* table of code length counts */
  5976. this.trans = new Uint16Array(288); /* code -> symbol translation table */
  5977. }
  5978. function Data(source, dest) {
  5979. this.source = source;
  5980. this.sourceIndex = 0;
  5981. this.tag = 0;
  5982. this.bitcount = 0;
  5983. this.dest = dest;
  5984. this.destLen = 0;
  5985. this.ltree = new Tree(); /* dynamic length/symbol tree */
  5986. this.dtree = new Tree(); /* dynamic distance tree */
  5987. }
  5988. /* --------------------------------------------------- *
  5989. * -- uninitialized global data (static structures) -- *
  5990. * --------------------------------------------------- */
  5991. var sltree = new Tree();
  5992. var sdtree = new Tree();
  5993. /* extra bits and base tables for length codes */
  5994. var length_bits = new Uint8Array(30);
  5995. var length_base = new Uint16Array(30);
  5996. /* extra bits and base tables for distance codes */
  5997. var dist_bits = new Uint8Array(30);
  5998. var dist_base = new Uint16Array(30);
  5999. /* special ordering of code length codes */
  6000. var clcidx = new Uint8Array([
  6001. 16, 17, 18, 0, 8, 7, 9, 6,
  6002. 10, 5, 11, 4, 12, 3, 13, 2,
  6003. 14, 1, 15
  6004. ]);
  6005. /* used by tinf_decode_trees, avoids allocations every call */
  6006. var code_tree = new Tree();
  6007. var lengths = new Uint8Array(288 + 32);
  6008. /* ----------------------- *
  6009. * -- utility functions -- *
  6010. * ----------------------- */
  6011. /* build extra bits and base tables */
  6012. function tinf_build_bits_base(bits, base, delta, first) {
  6013. var i, sum;
  6014. /* build bits table */
  6015. for (i = 0; i < delta; ++i) bits[i] = 0;
  6016. for (i = 0; i < 30 - delta; ++i) bits[i + delta] = i / delta | 0;
  6017. /* build base table */
  6018. for (sum = first, i = 0; i < 30; ++i) {
  6019. base[i] = sum;
  6020. sum += 1 << bits[i];
  6021. }
  6022. }
  6023. /* build the fixed huffman trees */
  6024. function tinf_build_fixed_trees(lt, dt) {
  6025. var i;
  6026. /* build fixed length tree */
  6027. for (i = 0; i < 7; ++i) lt.table[i] = 0;
  6028. lt.table[7] = 24;
  6029. lt.table[8] = 152;
  6030. lt.table[9] = 112;
  6031. for (i = 0; i < 24; ++i) lt.trans[i] = 256 + i;
  6032. for (i = 0; i < 144; ++i) lt.trans[24 + i] = i;
  6033. for (i = 0; i < 8; ++i) lt.trans[24 + 144 + i] = 280 + i;
  6034. for (i = 0; i < 112; ++i) lt.trans[24 + 144 + 8 + i] = 144 + i;
  6035. /* build fixed distance tree */
  6036. for (i = 0; i < 5; ++i) dt.table[i] = 0;
  6037. dt.table[5] = 32;
  6038. for (i = 0; i < 32; ++i) dt.trans[i] = i;
  6039. }
  6040. /* given an array of code lengths, build a tree */
  6041. var offs = new Uint16Array(16);
  6042. function tinf_build_tree(t, lengths, off, num) {
  6043. var i, sum;
  6044. /* clear code length count table */
  6045. for (i = 0; i < 16; ++i) t.table[i] = 0;
  6046. /* scan symbol lengths, and sum code length counts */
  6047. for (i = 0; i < num; ++i) t.table[lengths[off + i]]++;
  6048. t.table[0] = 0;
  6049. /* compute offset table for distribution sort */
  6050. for (sum = 0, i = 0; i < 16; ++i) {
  6051. offs[i] = sum;
  6052. sum += t.table[i];
  6053. }
  6054. /* create code->symbol translation table (symbols sorted by code) */
  6055. for (i = 0; i < num; ++i) {
  6056. if (lengths[off + i]) t.trans[offs[lengths[off + i]]++] = i;
  6057. }
  6058. }
  6059. /* ---------------------- *
  6060. * -- decode functions -- *
  6061. * ---------------------- */
  6062. /* get one bit from source stream */
  6063. function tinf_getbit(d) {
  6064. /* check if tag is empty */
  6065. if (!d.bitcount--) {
  6066. /* load next tag */
  6067. d.tag = d.source[d.sourceIndex++];
  6068. d.bitcount = 7;
  6069. }
  6070. /* shift bit out of tag */
  6071. var bit = d.tag & 1;
  6072. d.tag >>>= 1;
  6073. return bit;
  6074. }
  6075. /* read a num bit value from a stream and add base */
  6076. function tinf_read_bits(d, num, base) {
  6077. if (!num)
  6078. return base;
  6079. while (d.bitcount < 24) {
  6080. d.tag |= d.source[d.sourceIndex++] << d.bitcount;
  6081. d.bitcount += 8;
  6082. }
  6083. var val = d.tag & (0xffff >>> (16 - num));
  6084. d.tag >>>= num;
  6085. d.bitcount -= num;
  6086. return val + base;
  6087. }
  6088. /* given a data stream and a tree, decode a symbol */
  6089. function tinf_decode_symbol(d, t) {
  6090. while (d.bitcount < 24) {
  6091. d.tag |= d.source[d.sourceIndex++] << d.bitcount;
  6092. d.bitcount += 8;
  6093. }
  6094. var sum = 0, cur = 0, len = 0;
  6095. var tag = d.tag;
  6096. /* get more bits while code value is above sum */
  6097. do {
  6098. cur = 2 * cur + (tag & 1);
  6099. tag >>>= 1;
  6100. ++len;
  6101. sum += t.table[len];
  6102. cur -= t.table[len];
  6103. } while (cur >= 0);
  6104. d.tag = tag;
  6105. d.bitcount -= len;
  6106. return t.trans[sum + cur];
  6107. }
  6108. /* given a data stream, decode dynamic trees from it */
  6109. function tinf_decode_trees(d, lt, dt) {
  6110. var hlit, hdist, hclen;
  6111. var i, num, length;
  6112. /* get 5 bits HLIT (257-286) */
  6113. hlit = tinf_read_bits(d, 5, 257);
  6114. /* get 5 bits HDIST (1-32) */
  6115. hdist = tinf_read_bits(d, 5, 1);
  6116. /* get 4 bits HCLEN (4-19) */
  6117. hclen = tinf_read_bits(d, 4, 4);
  6118. for (i = 0; i < 19; ++i) lengths[i] = 0;
  6119. /* read code lengths for code length alphabet */
  6120. for (i = 0; i < hclen; ++i) {
  6121. /* get 3 bits code length (0-7) */
  6122. var clen = tinf_read_bits(d, 3, 0);
  6123. lengths[clcidx[i]] = clen;
  6124. }
  6125. /* build code length tree */
  6126. tinf_build_tree(code_tree, lengths, 0, 19);
  6127. /* decode code lengths for the dynamic trees */
  6128. for (num = 0; num < hlit + hdist;) {
  6129. var sym = tinf_decode_symbol(d, code_tree);
  6130. switch (sym) {
  6131. case 16:
  6132. /* copy previous code length 3-6 times (read 2 bits) */
  6133. var prev = lengths[num - 1];
  6134. for (length = tinf_read_bits(d, 2, 3); length; --length) {
  6135. lengths[num++] = prev;
  6136. }
  6137. break;
  6138. case 17:
  6139. /* repeat code length 0 for 3-10 times (read 3 bits) */
  6140. for (length = tinf_read_bits(d, 3, 3); length; --length) {
  6141. lengths[num++] = 0;
  6142. }
  6143. break;
  6144. case 18:
  6145. /* repeat code length 0 for 11-138 times (read 7 bits) */
  6146. for (length = tinf_read_bits(d, 7, 11); length; --length) {
  6147. lengths[num++] = 0;
  6148. }
  6149. break;
  6150. default:
  6151. /* values 0-15 represent the actual code lengths */
  6152. lengths[num++] = sym;
  6153. break;
  6154. }
  6155. }
  6156. /* build dynamic trees */
  6157. tinf_build_tree(lt, lengths, 0, hlit);
  6158. tinf_build_tree(dt, lengths, hlit, hdist);
  6159. }
  6160. /* ----------------------------- *
  6161. * -- block inflate functions -- *
  6162. * ----------------------------- */
  6163. /* given a stream and two trees, inflate a block of data */
  6164. function tinf_inflate_block_data(d, lt, dt) {
  6165. while (1) {
  6166. var sym = tinf_decode_symbol(d, lt);
  6167. /* check for end of block */
  6168. if (sym === 256) {
  6169. return TINF_OK;
  6170. }
  6171. if (sym < 256) {
  6172. d.dest[d.destLen++] = sym;
  6173. } else {
  6174. var length, dist, offs;
  6175. var i;
  6176. sym -= 257;
  6177. /* possibly get more bits from length code */
  6178. length = tinf_read_bits(d, length_bits[sym], length_base[sym]);
  6179. dist = tinf_decode_symbol(d, dt);
  6180. /* possibly get more bits from distance code */
  6181. offs = d.destLen - tinf_read_bits(d, dist_bits[dist], dist_base[dist]);
  6182. /* copy match */
  6183. for (i = offs; i < offs + length; ++i) {
  6184. d.dest[d.destLen++] = d.dest[i];
  6185. }
  6186. }
  6187. }
  6188. }
  6189. /* inflate an uncompressed block of data */
  6190. function tinf_inflate_uncompressed_block(d) {
  6191. var length, invlength;
  6192. var i;
  6193. /* unread from bitbuffer */
  6194. while (d.bitcount > 8) {
  6195. d.sourceIndex--;
  6196. d.bitcount -= 8;
  6197. }
  6198. /* get length */
  6199. length = d.source[d.sourceIndex + 1];
  6200. length = 256 * length + d.source[d.sourceIndex];
  6201. /* get one's complement of length */
  6202. invlength = d.source[d.sourceIndex + 3];
  6203. invlength = 256 * invlength + d.source[d.sourceIndex + 2];
  6204. /* check length */
  6205. if (length !== (~invlength & 0x0000ffff))
  6206. return TINF_DATA_ERROR;
  6207. d.sourceIndex += 4;
  6208. /* copy block */
  6209. for (i = length; i; --i)
  6210. d.dest[d.destLen++] = d.source[d.sourceIndex++];
  6211. /* make sure we start next block on a byte boundary */
  6212. d.bitcount = 0;
  6213. return TINF_OK;
  6214. }
  6215. /* inflate stream from source to dest */
  6216. function tinf_uncompress(source, dest) {
  6217. var d = new Data(source, dest);
  6218. var bfinal, btype, res;
  6219. do {
  6220. /* read final block flag */
  6221. bfinal = tinf_getbit(d);
  6222. /* read block type (2 bits) */
  6223. btype = tinf_read_bits(d, 2, 0);
  6224. /* decompress block */
  6225. switch (btype) {
  6226. case 0:
  6227. /* decompress uncompressed block */
  6228. res = tinf_inflate_uncompressed_block(d);
  6229. break;
  6230. case 1:
  6231. /* decompress block with fixed huffman trees */
  6232. res = tinf_inflate_block_data(d, sltree, sdtree);
  6233. break;
  6234. case 2:
  6235. /* decompress block with dynamic huffman trees */
  6236. tinf_decode_trees(d, d.ltree, d.dtree);
  6237. res = tinf_inflate_block_data(d, d.ltree, d.dtree);
  6238. break;
  6239. default:
  6240. res = TINF_DATA_ERROR;
  6241. }
  6242. if (res !== TINF_OK)
  6243. throw new Error('Data error');
  6244. } while (!bfinal);
  6245. if (d.destLen < d.dest.length) {
  6246. if (typeof d.dest.slice === 'function')
  6247. return d.dest.slice(0, d.destLen);
  6248. else
  6249. return d.dest.subarray(0, d.destLen);
  6250. }
  6251. return d.dest;
  6252. }
  6253. /* -------------------- *
  6254. * -- initialization -- *
  6255. * -------------------- */
  6256. /* build fixed huffman trees */
  6257. tinf_build_fixed_trees(sltree, sdtree);
  6258. /* build extra bits and base tables */
  6259. tinf_build_bits_base(length_bits, length_base, 4, 3);
  6260. tinf_build_bits_base(dist_bits, dist_base, 2, 1);
  6261. /* fix a special case */
  6262. length_bits[28] = 0;
  6263. length_base[28] = 258;
  6264. module.exports = tinf_uncompress;
  6265. /***/ }),
  6266. /* 84 */
  6267. /***/ (function(module, exports, __webpack_require__) {
  6268. "use strict";
  6269. /* WEBPACK VAR INJECTION */(function(Buffer, __dirname) {
  6270. function VirtualFileSystem() {
  6271. this.fileSystem = {};
  6272. this.dataSystem = {};
  6273. }
  6274. VirtualFileSystem.prototype.readFileSync = function (filename, options) {
  6275. filename = fixFilename(filename);
  6276. var dataContent = this.dataSystem[filename];
  6277. if (typeof dataContent === 'string' && options === 'utf8') {
  6278. return dataContent;
  6279. }
  6280. if (dataContent) {
  6281. return new Buffer(dataContent, typeof dataContent === 'string' ? 'base64' : undefined);
  6282. }
  6283. var content = this.fileSystem[filename];
  6284. if (content) {
  6285. return content;
  6286. }
  6287. throw 'File \'' + filename + '\' not found in virtual file system';
  6288. };
  6289. VirtualFileSystem.prototype.writeFileSync = function (filename, content) {
  6290. this.fileSystem[fixFilename(filename)] = content;
  6291. };
  6292. VirtualFileSystem.prototype.bindFS = function (data) {
  6293. this.dataSystem = data || {};
  6294. };
  6295. function fixFilename(filename) {
  6296. if (filename.indexOf(__dirname) === 0) {
  6297. filename = filename.substring(__dirname.length);
  6298. }
  6299. if (filename.indexOf('/') === 0) {
  6300. filename = filename.substring(1);
  6301. }
  6302. return filename;
  6303. }
  6304. module.exports = new VirtualFileSystem();
  6305. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(4).Buffer, "/"))
  6306. /***/ }),
  6307. /* 85 */
  6308. /***/ (function(module, exports, __webpack_require__) {
  6309. // fallback for non-array-like ES3 and non-enumerable old V8 strings
  6310. var cof = __webpack_require__(53);
  6311. // eslint-disable-next-line no-prototype-builtins
  6312. module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
  6313. return cof(it) == 'String' ? it.split('') : Object(it);
  6314. };
  6315. /***/ }),
  6316. /* 86 */
  6317. /***/ (function(module, exports, __webpack_require__) {
  6318. // false -> Array#indexOf
  6319. // true -> Array#includes
  6320. var toIObject = __webpack_require__(43);
  6321. var toLength = __webpack_require__(16);
  6322. var toAbsoluteIndex = __webpack_require__(54);
  6323. module.exports = function (IS_INCLUDES) {
  6324. return function ($this, el, fromIndex) {
  6325. var O = toIObject($this);
  6326. var length = toLength(O.length);
  6327. var index = toAbsoluteIndex(fromIndex, length);
  6328. var value;
  6329. // Array#includes uses SameValueZero equality algorithm
  6330. // eslint-disable-next-line no-self-compare
  6331. if (IS_INCLUDES && el != el) while (length > index) {
  6332. value = O[index++];
  6333. // eslint-disable-next-line no-self-compare
  6334. if (value != value) return true;
  6335. // Array#indexOf ignores holes, Array#includes - not
  6336. } else for (;length > index; index++) if (IS_INCLUDES || index in O) {
  6337. if (O[index] === el) return IS_INCLUDES || index || 0;
  6338. } return !IS_INCLUDES && -1;
  6339. };
  6340. };
  6341. /***/ }),
  6342. /* 87 */
  6343. /***/ (function(module, exports, __webpack_require__) {
  6344. var shared = __webpack_require__(61)('keys');
  6345. var uid = __webpack_require__(29);
  6346. module.exports = function (key) {
  6347. return shared[key] || (shared[key] = uid(key));
  6348. };
  6349. /***/ }),
  6350. /* 88 */
  6351. /***/ (function(module, exports) {
  6352. // IE 8- don't enum bug keys
  6353. module.exports = (
  6354. 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
  6355. ).split(',');
  6356. /***/ }),
  6357. /* 89 */
  6358. /***/ (function(module, exports) {
  6359. exports.f = Object.getOwnPropertySymbols;
  6360. /***/ }),
  6361. /* 90 */
  6362. /***/ (function(module, exports, __webpack_require__) {
  6363. "use strict";
  6364. // 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length)
  6365. var toObject = __webpack_require__(19);
  6366. var toAbsoluteIndex = __webpack_require__(54);
  6367. var toLength = __webpack_require__(16);
  6368. module.exports = function fill(value /* , start = 0, end = @length */) {
  6369. var O = toObject(this);
  6370. var length = toLength(O.length);
  6371. var aLen = arguments.length;
  6372. var index = toAbsoluteIndex(aLen > 1 ? arguments[1] : undefined, length);
  6373. var end = aLen > 2 ? arguments[2] : undefined;
  6374. var endPos = end === undefined ? length : toAbsoluteIndex(end, length);
  6375. while (endPos > index) O[index++] = value;
  6376. return O;
  6377. };
  6378. /***/ }),
  6379. /* 91 */
  6380. /***/ (function(module, exports, __webpack_require__) {
  6381. // 22.1.3.31 Array.prototype[@@unscopables]
  6382. var UNSCOPABLES = __webpack_require__(3)('unscopables');
  6383. var ArrayProto = Array.prototype;
  6384. if (ArrayProto[UNSCOPABLES] == undefined) __webpack_require__(15)(ArrayProto, UNSCOPABLES, {});
  6385. module.exports = function (key) {
  6386. ArrayProto[UNSCOPABLES][key] = true;
  6387. };
  6388. /***/ }),
  6389. /* 92 */
  6390. /***/ (function(module, exports, __webpack_require__) {
  6391. "use strict";
  6392. var anObject = __webpack_require__(12);
  6393. var toLength = __webpack_require__(16);
  6394. var advanceStringIndex = __webpack_require__(93);
  6395. var regExpExec = __webpack_require__(95);
  6396. // @@match logic
  6397. __webpack_require__(96)('match', 1, function (defined, MATCH, $match, maybeCallNative) {
  6398. return [
  6399. // `String.prototype.match` method
  6400. // https://tc39.github.io/ecma262/#sec-string.prototype.match
  6401. function match(regexp) {
  6402. var O = defined(this);
  6403. var fn = regexp == undefined ? undefined : regexp[MATCH];
  6404. return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[MATCH](String(O));
  6405. },
  6406. // `RegExp.prototype[@@match]` method
  6407. // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@match
  6408. function (regexp) {
  6409. var res = maybeCallNative($match, regexp, this);
  6410. if (res.done) return res.value;
  6411. var rx = anObject(regexp);
  6412. var S = String(this);
  6413. if (!rx.global) return regExpExec(rx, S);
  6414. var fullUnicode = rx.unicode;
  6415. rx.lastIndex = 0;
  6416. var A = [];
  6417. var n = 0;
  6418. var result;
  6419. while ((result = regExpExec(rx, S)) !== null) {
  6420. var matchStr = String(result[0]);
  6421. A[n] = matchStr;
  6422. if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
  6423. n++;
  6424. }
  6425. return n === 0 ? null : A;
  6426. }
  6427. ];
  6428. });
  6429. /***/ }),
  6430. /* 93 */
  6431. /***/ (function(module, exports, __webpack_require__) {
  6432. "use strict";
  6433. var at = __webpack_require__(94)(true);
  6434. // `AdvanceStringIndex` abstract operation
  6435. // https://tc39.github.io/ecma262/#sec-advancestringindex
  6436. module.exports = function (S, index, unicode) {
  6437. return index + (unicode ? at(S, index).length : 1);
  6438. };
  6439. /***/ }),
  6440. /* 94 */
  6441. /***/ (function(module, exports, __webpack_require__) {
  6442. var toInteger = __webpack_require__(31);
  6443. var defined = __webpack_require__(30);
  6444. // true -> String#at
  6445. // false -> String#codePointAt
  6446. module.exports = function (TO_STRING) {
  6447. return function (that, pos) {
  6448. var s = String(defined(that));
  6449. var i = toInteger(pos);
  6450. var l = s.length;
  6451. var a, b;
  6452. if (i < 0 || i >= l) return TO_STRING ? '' : undefined;
  6453. a = s.charCodeAt(i);
  6454. return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff
  6455. ? TO_STRING ? s.charAt(i) : a
  6456. : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;
  6457. };
  6458. };
  6459. /***/ }),
  6460. /* 95 */
  6461. /***/ (function(module, exports, __webpack_require__) {
  6462. "use strict";
  6463. var classof = __webpack_require__(64);
  6464. var builtinExec = RegExp.prototype.exec;
  6465. // `RegExpExec` abstract operation
  6466. // https://tc39.github.io/ecma262/#sec-regexpexec
  6467. module.exports = function (R, S) {
  6468. var exec = R.exec;
  6469. if (typeof exec === 'function') {
  6470. var result = exec.call(R, S);
  6471. if (typeof result !== 'object') {
  6472. throw new TypeError('RegExp exec method returned something other than an Object or null');
  6473. }
  6474. return result;
  6475. }
  6476. if (classof(R) !== 'RegExp') {
  6477. throw new TypeError('RegExp#exec called on incompatible receiver');
  6478. }
  6479. return builtinExec.call(R, S);
  6480. };
  6481. /***/ }),
  6482. /* 96 */
  6483. /***/ (function(module, exports, __webpack_require__) {
  6484. "use strict";
  6485. __webpack_require__(236);
  6486. var redefine = __webpack_require__(23);
  6487. var hide = __webpack_require__(15);
  6488. var fails = __webpack_require__(10);
  6489. var defined = __webpack_require__(30);
  6490. var wks = __webpack_require__(3);
  6491. var regexpExec = __webpack_require__(97);
  6492. var SPECIES = wks('species');
  6493. var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
  6494. // #replace needs built-in support for named groups.
  6495. // #match works fine because it just return the exec results, even if it has
  6496. // a "grops" property.
  6497. var re = /./;
  6498. re.exec = function () {
  6499. var result = [];
  6500. result.groups = { a: '7' };
  6501. return result;
  6502. };
  6503. return ''.replace(re, '$<a>') !== '7';
  6504. });
  6505. var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = (function () {
  6506. // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
  6507. var re = /(?:)/;
  6508. var originalExec = re.exec;
  6509. re.exec = function () { return originalExec.apply(this, arguments); };
  6510. var result = 'ab'.split(re);
  6511. return result.length === 2 && result[0] === 'a' && result[1] === 'b';
  6512. })();
  6513. module.exports = function (KEY, length, exec) {
  6514. var SYMBOL = wks(KEY);
  6515. var DELEGATES_TO_SYMBOL = !fails(function () {
  6516. // String methods call symbol-named RegEp methods
  6517. var O = {};
  6518. O[SYMBOL] = function () { return 7; };
  6519. return ''[KEY](O) != 7;
  6520. });
  6521. var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL ? !fails(function () {
  6522. // Symbol-named RegExp methods call .exec
  6523. var execCalled = false;
  6524. var re = /a/;
  6525. re.exec = function () { execCalled = true; return null; };
  6526. if (KEY === 'split') {
  6527. // RegExp[@@split] doesn't call the regex's exec method, but first creates
  6528. // a new one. We need to return the patched regex when creating the new one.
  6529. re.constructor = {};
  6530. re.constructor[SPECIES] = function () { return re; };
  6531. }
  6532. re[SYMBOL]('');
  6533. return !execCalled;
  6534. }) : undefined;
  6535. if (
  6536. !DELEGATES_TO_SYMBOL ||
  6537. !DELEGATES_TO_EXEC ||
  6538. (KEY === 'replace' && !REPLACE_SUPPORTS_NAMED_GROUPS) ||
  6539. (KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC)
  6540. ) {
  6541. var nativeRegExpMethod = /./[SYMBOL];
  6542. var fns = exec(
  6543. defined,
  6544. SYMBOL,
  6545. ''[KEY],
  6546. function maybeCallNative(nativeMethod, regexp, str, arg2, forceStringMethod) {
  6547. if (regexp.exec === regexpExec) {
  6548. if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
  6549. // The native String method already delegates to @@method (this
  6550. // polyfilled function), leasing to infinite recursion.
  6551. // We avoid it by directly calling the native @@method method.
  6552. return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) };
  6553. }
  6554. return { done: true, value: nativeMethod.call(str, regexp, arg2) };
  6555. }
  6556. return { done: false };
  6557. }
  6558. );
  6559. var strfn = fns[0];
  6560. var rxfn = fns[1];
  6561. redefine(String.prototype, KEY, strfn);
  6562. hide(RegExp.prototype, SYMBOL, length == 2
  6563. // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)
  6564. // 21.2.5.11 RegExp.prototype[@@split](string, limit)
  6565. ? function (string, arg) { return rxfn.call(string, this, arg); }
  6566. // 21.2.5.6 RegExp.prototype[@@match](string)
  6567. // 21.2.5.9 RegExp.prototype[@@search](string)
  6568. : function (string) { return rxfn.call(string, this); }
  6569. );
  6570. }
  6571. };
  6572. /***/ }),
  6573. /* 97 */
  6574. /***/ (function(module, exports, __webpack_require__) {
  6575. "use strict";
  6576. var regexpFlags = __webpack_require__(98);
  6577. var nativeExec = RegExp.prototype.exec;
  6578. // This always refers to the native implementation, because the
  6579. // String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js,
  6580. // which loads this file before patching the method.
  6581. var nativeReplace = String.prototype.replace;
  6582. var patchedExec = nativeExec;
  6583. var LAST_INDEX = 'lastIndex';
  6584. var UPDATES_LAST_INDEX_WRONG = (function () {
  6585. var re1 = /a/,
  6586. re2 = /b*/g;
  6587. nativeExec.call(re1, 'a');
  6588. nativeExec.call(re2, 'a');
  6589. return re1[LAST_INDEX] !== 0 || re2[LAST_INDEX] !== 0;
  6590. })();
  6591. // nonparticipating capturing group, copied from es5-shim's String#split patch.
  6592. var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
  6593. var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED;
  6594. if (PATCH) {
  6595. patchedExec = function exec(str) {
  6596. var re = this;
  6597. var lastIndex, reCopy, match, i;
  6598. if (NPCG_INCLUDED) {
  6599. reCopy = new RegExp('^' + re.source + '$(?!\\s)', regexpFlags.call(re));
  6600. }
  6601. if (UPDATES_LAST_INDEX_WRONG) lastIndex = re[LAST_INDEX];
  6602. match = nativeExec.call(re, str);
  6603. if (UPDATES_LAST_INDEX_WRONG && match) {
  6604. re[LAST_INDEX] = re.global ? match.index + match[0].length : lastIndex;
  6605. }
  6606. if (NPCG_INCLUDED && match && match.length > 1) {
  6607. // Fix browsers whose `exec` methods don't consistently return `undefined`
  6608. // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
  6609. // eslint-disable-next-line no-loop-func
  6610. nativeReplace.call(match[0], reCopy, function () {
  6611. for (i = 1; i < arguments.length - 2; i++) {
  6612. if (arguments[i] === undefined) match[i] = undefined;
  6613. }
  6614. });
  6615. }
  6616. return match;
  6617. };
  6618. }
  6619. module.exports = patchedExec;
  6620. /***/ }),
  6621. /* 98 */
  6622. /***/ (function(module, exports, __webpack_require__) {
  6623. "use strict";
  6624. // 21.2.5.3 get RegExp.prototype.flags
  6625. var anObject = __webpack_require__(12);
  6626. module.exports = function () {
  6627. var that = anObject(this);
  6628. var result = '';
  6629. if (that.global) result += 'g';
  6630. if (that.ignoreCase) result += 'i';
  6631. if (that.multiline) result += 'm';
  6632. if (that.unicode) result += 'u';
  6633. if (that.sticky) result += 'y';
  6634. return result;
  6635. };
  6636. /***/ }),
  6637. /* 99 */
  6638. /***/ (function(module, exports, __webpack_require__) {
  6639. var $iterators = __webpack_require__(66);
  6640. var getKeys = __webpack_require__(42);
  6641. var redefine = __webpack_require__(23);
  6642. var global = __webpack_require__(8);
  6643. var hide = __webpack_require__(15);
  6644. var Iterators = __webpack_require__(45);
  6645. var wks = __webpack_require__(3);
  6646. var ITERATOR = wks('iterator');
  6647. var TO_STRING_TAG = wks('toStringTag');
  6648. var ArrayValues = Iterators.Array;
  6649. var DOMIterables = {
  6650. CSSRuleList: true, // TODO: Not spec compliant, should be false.
  6651. CSSStyleDeclaration: false,
  6652. CSSValueList: false,
  6653. ClientRectList: false,
  6654. DOMRectList: false,
  6655. DOMStringList: false,
  6656. DOMTokenList: true,
  6657. DataTransferItemList: false,
  6658. FileList: false,
  6659. HTMLAllCollection: false,
  6660. HTMLCollection: false,
  6661. HTMLFormElement: false,
  6662. HTMLSelectElement: false,
  6663. MediaList: true, // TODO: Not spec compliant, should be false.
  6664. MimeTypeArray: false,
  6665. NamedNodeMap: false,
  6666. NodeList: true,
  6667. PaintRequestList: false,
  6668. Plugin: false,
  6669. PluginArray: false,
  6670. SVGLengthList: false,
  6671. SVGNumberList: false,
  6672. SVGPathSegList: false,
  6673. SVGPointList: false,
  6674. SVGStringList: false,
  6675. SVGTransformList: false,
  6676. SourceBufferList: false,
  6677. StyleSheetList: true, // TODO: Not spec compliant, should be false.
  6678. TextTrackCueList: false,
  6679. TextTrackList: false,
  6680. TouchList: false
  6681. };
  6682. for (var collections = getKeys(DOMIterables), i = 0; i < collections.length; i++) {
  6683. var NAME = collections[i];
  6684. var explicit = DOMIterables[NAME];
  6685. var Collection = global[NAME];
  6686. var proto = Collection && Collection.prototype;
  6687. var key;
  6688. if (proto) {
  6689. if (!proto[ITERATOR]) hide(proto, ITERATOR, ArrayValues);
  6690. if (!proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME);
  6691. Iterators[NAME] = ArrayValues;
  6692. if (explicit) for (key in $iterators) if (!proto[key]) redefine(proto, key, $iterators[key], true);
  6693. }
  6694. }
  6695. /***/ }),
  6696. /* 100 */
  6697. /***/ (function(module, exports, __webpack_require__) {
  6698. // Copyright Joyent, Inc. and other Node contributors.
  6699. //
  6700. // Permission is hereby granted, free of charge, to any person obtaining a
  6701. // copy of this software and associated documentation files (the
  6702. // "Software"), to deal in the Software without restriction, including
  6703. // without limitation the rights to use, copy, modify, merge, publish,
  6704. // distribute, sublicense, and/or sell copies of the Software, and to permit
  6705. // persons to whom the Software is furnished to do so, subject to the
  6706. // following conditions:
  6707. //
  6708. // The above copyright notice and this permission notice shall be included
  6709. // in all copies or substantial portions of the Software.
  6710. //
  6711. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  6712. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  6713. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  6714. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  6715. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  6716. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  6717. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  6718. module.exports = Stream;
  6719. var EE = __webpack_require__(68).EventEmitter;
  6720. var inherits = __webpack_require__(46);
  6721. inherits(Stream, EE);
  6722. Stream.Readable = __webpack_require__(101);
  6723. Stream.Writable = __webpack_require__(261);
  6724. Stream.Duplex = __webpack_require__(262);
  6725. Stream.Transform = __webpack_require__(263);
  6726. Stream.PassThrough = __webpack_require__(264);
  6727. // Backwards-compat with node 0.4.x
  6728. Stream.Stream = Stream;
  6729. // old-style streams. Note that the pipe method (the only relevant
  6730. // part of this class) is overridden in the Readable class.
  6731. function Stream() {
  6732. EE.call(this);
  6733. }
  6734. Stream.prototype.pipe = function(dest, options) {
  6735. var source = this;
  6736. function ondata(chunk) {
  6737. if (dest.writable) {
  6738. if (false === dest.write(chunk) && source.pause) {
  6739. source.pause();
  6740. }
  6741. }
  6742. }
  6743. source.on('data', ondata);
  6744. function ondrain() {
  6745. if (source.readable && source.resume) {
  6746. source.resume();
  6747. }
  6748. }
  6749. dest.on('drain', ondrain);
  6750. // If the 'end' option is not supplied, dest.end() will be called when
  6751. // source gets the 'end' or 'close' events. Only dest.end() once.
  6752. if (!dest._isStdio && (!options || options.end !== false)) {
  6753. source.on('end', onend);
  6754. source.on('close', onclose);
  6755. }
  6756. var didOnEnd = false;
  6757. function onend() {
  6758. if (didOnEnd) return;
  6759. didOnEnd = true;
  6760. dest.end();
  6761. }
  6762. function onclose() {
  6763. if (didOnEnd) return;
  6764. didOnEnd = true;
  6765. if (typeof dest.destroy === 'function') dest.destroy();
  6766. }
  6767. // don't leave dangling pipes when there are errors.
  6768. function onerror(er) {
  6769. cleanup();
  6770. if (EE.listenerCount(this, 'error') === 0) {
  6771. throw er; // Unhandled stream error in pipe.
  6772. }
  6773. }
  6774. source.on('error', onerror);
  6775. dest.on('error', onerror);
  6776. // remove all the event listeners that were added.
  6777. function cleanup() {
  6778. source.removeListener('data', ondata);
  6779. dest.removeListener('drain', ondrain);
  6780. source.removeListener('end', onend);
  6781. source.removeListener('close', onclose);
  6782. source.removeListener('error', onerror);
  6783. dest.removeListener('error', onerror);
  6784. source.removeListener('end', cleanup);
  6785. source.removeListener('close', cleanup);
  6786. dest.removeListener('close', cleanup);
  6787. }
  6788. source.on('end', cleanup);
  6789. source.on('close', cleanup);
  6790. dest.on('close', cleanup);
  6791. dest.emit('pipe', source);
  6792. // Allow for unix-like usage: A.pipe(B).pipe(C)
  6793. return dest;
  6794. };
  6795. /***/ }),
  6796. /* 101 */
  6797. /***/ (function(module, exports, __webpack_require__) {
  6798. exports = module.exports = __webpack_require__(166);
  6799. exports.Stream = exports;
  6800. exports.Readable = exports;
  6801. exports.Writable = __webpack_require__(102);
  6802. exports.Duplex = __webpack_require__(32);
  6803. exports.Transform = __webpack_require__(169);
  6804. exports.PassThrough = __webpack_require__(260);
  6805. /***/ }),
  6806. /* 102 */
  6807. /***/ (function(module, exports, __webpack_require__) {
  6808. "use strict";
  6809. /* WEBPACK VAR INJECTION */(function(process, global) {// Copyright Joyent, Inc. and other Node contributors.
  6810. //
  6811. // Permission is hereby granted, free of charge, to any person obtaining a
  6812. // copy of this software and associated documentation files (the
  6813. // "Software"), to deal in the Software without restriction, including
  6814. // without limitation the rights to use, copy, modify, merge, publish,
  6815. // distribute, sublicense, and/or sell copies of the Software, and to permit
  6816. // persons to whom the Software is furnished to do so, subject to the
  6817. // following conditions:
  6818. //
  6819. // The above copyright notice and this permission notice shall be included
  6820. // in all copies or substantial portions of the Software.
  6821. //
  6822. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  6823. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  6824. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  6825. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  6826. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  6827. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  6828. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  6829. // A bit simpler than readable streams.
  6830. // Implement an async ._write(chunk, encoding, cb), and it'll handle all
  6831. // the drain event emission and buffering.
  6832. /*<replacement>*/
  6833. var pna = __webpack_require__(69);
  6834. /*</replacement>*/
  6835. module.exports = Writable;
  6836. /* <replacement> */
  6837. function WriteReq(chunk, encoding, cb) {
  6838. this.chunk = chunk;
  6839. this.encoding = encoding;
  6840. this.callback = cb;
  6841. this.next = null;
  6842. }
  6843. // It seems a linked list but it is not
  6844. // there will be only 2 of these for each stream
  6845. function CorkedRequest(state) {
  6846. var _this = this;
  6847. this.next = null;
  6848. this.entry = null;
  6849. this.finish = function () {
  6850. onCorkedFinish(_this, state);
  6851. };
  6852. }
  6853. /* </replacement> */
  6854. /*<replacement>*/
  6855. var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick;
  6856. /*</replacement>*/
  6857. /*<replacement>*/
  6858. var Duplex;
  6859. /*</replacement>*/
  6860. Writable.WritableState = WritableState;
  6861. /*<replacement>*/
  6862. var util = Object.create(__webpack_require__(56));
  6863. util.inherits = __webpack_require__(46);
  6864. /*</replacement>*/
  6865. /*<replacement>*/
  6866. var internalUtil = {
  6867. deprecate: __webpack_require__(259)
  6868. };
  6869. /*</replacement>*/
  6870. /*<replacement>*/
  6871. var Stream = __webpack_require__(167);
  6872. /*</replacement>*/
  6873. /*<replacement>*/
  6874. var Buffer = __webpack_require__(70).Buffer;
  6875. var OurUint8Array = global.Uint8Array || function () {};
  6876. function _uint8ArrayToBuffer(chunk) {
  6877. return Buffer.from(chunk);
  6878. }
  6879. function _isUint8Array(obj) {
  6880. return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
  6881. }
  6882. /*</replacement>*/
  6883. var destroyImpl = __webpack_require__(168);
  6884. util.inherits(Writable, Stream);
  6885. function nop() {}
  6886. function WritableState(options, stream) {
  6887. Duplex = Duplex || __webpack_require__(32);
  6888. options = options || {};
  6889. // Duplex streams are both readable and writable, but share
  6890. // the same options object.
  6891. // However, some cases require setting options to different
  6892. // values for the readable and the writable sides of the duplex stream.
  6893. // These options can be provided separately as readableXXX and writableXXX.
  6894. var isDuplex = stream instanceof Duplex;
  6895. // object stream flag to indicate whether or not this stream
  6896. // contains buffers or objects.
  6897. this.objectMode = !!options.objectMode;
  6898. if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode;
  6899. // the point at which write() starts returning false
  6900. // Note: 0 is a valid value, means that we always return false if
  6901. // the entire buffer is not flushed immediately on write()
  6902. var hwm = options.highWaterMark;
  6903. var writableHwm = options.writableHighWaterMark;
  6904. var defaultHwm = this.objectMode ? 16 : 16 * 1024;
  6905. if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm;
  6906. // cast to ints.
  6907. this.highWaterMark = Math.floor(this.highWaterMark);
  6908. // if _final has been called
  6909. this.finalCalled = false;
  6910. // drain event flag.
  6911. this.needDrain = false;
  6912. // at the start of calling end()
  6913. this.ending = false;
  6914. // when end() has been called, and returned
  6915. this.ended = false;
  6916. // when 'finish' is emitted
  6917. this.finished = false;
  6918. // has it been destroyed
  6919. this.destroyed = false;
  6920. // should we decode strings into buffers before passing to _write?
  6921. // this is here so that some node-core streams can optimize string
  6922. // handling at a lower level.
  6923. var noDecode = options.decodeStrings === false;
  6924. this.decodeStrings = !noDecode;
  6925. // Crypto is kind of old and crusty. Historically, its default string
  6926. // encoding is 'binary' so we have to make this configurable.
  6927. // Everything else in the universe uses 'utf8', though.
  6928. this.defaultEncoding = options.defaultEncoding || 'utf8';
  6929. // not an actual buffer we keep track of, but a measurement
  6930. // of how much we're waiting to get pushed to some underlying
  6931. // socket or file.
  6932. this.length = 0;
  6933. // a flag to see when we're in the middle of a write.
  6934. this.writing = false;
  6935. // when true all writes will be buffered until .uncork() call
  6936. this.corked = 0;
  6937. // a flag to be able to tell if the onwrite cb is called immediately,
  6938. // or on a later tick. We set this to true at first, because any
  6939. // actions that shouldn't happen until "later" should generally also
  6940. // not happen before the first write call.
  6941. this.sync = true;
  6942. // a flag to know if we're processing previously buffered items, which
  6943. // may call the _write() callback in the same tick, so that we don't
  6944. // end up in an overlapped onwrite situation.
  6945. this.bufferProcessing = false;
  6946. // the callback that's passed to _write(chunk,cb)
  6947. this.onwrite = function (er) {
  6948. onwrite(stream, er);
  6949. };
  6950. // the callback that the user supplies to write(chunk,encoding,cb)
  6951. this.writecb = null;
  6952. // the amount that is being written when _write is called.
  6953. this.writelen = 0;
  6954. this.bufferedRequest = null;
  6955. this.lastBufferedRequest = null;
  6956. // number of pending user-supplied write callbacks
  6957. // this must be 0 before 'finish' can be emitted
  6958. this.pendingcb = 0;
  6959. // emit prefinish if the only thing we're waiting for is _write cbs
  6960. // This is relevant for synchronous Transform streams
  6961. this.prefinished = false;
  6962. // True if the error was already emitted and should not be thrown again
  6963. this.errorEmitted = false;
  6964. // count buffered requests
  6965. this.bufferedRequestCount = 0;
  6966. // allocate the first CorkedRequest, there is always
  6967. // one allocated and free to use, and we maintain at most two
  6968. this.corkedRequestsFree = new CorkedRequest(this);
  6969. }
  6970. WritableState.prototype.getBuffer = function getBuffer() {
  6971. var current = this.bufferedRequest;
  6972. var out = [];
  6973. while (current) {
  6974. out.push(current);
  6975. current = current.next;
  6976. }
  6977. return out;
  6978. };
  6979. (function () {
  6980. try {
  6981. Object.defineProperty(WritableState.prototype, 'buffer', {
  6982. get: internalUtil.deprecate(function () {
  6983. return this.getBuffer();
  6984. }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003')
  6985. });
  6986. } catch (_) {}
  6987. })();
  6988. // Test _writableState for inheritance to account for Duplex streams,
  6989. // whose prototype chain only points to Readable.
  6990. var realHasInstance;
  6991. if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') {
  6992. realHasInstance = Function.prototype[Symbol.hasInstance];
  6993. Object.defineProperty(Writable, Symbol.hasInstance, {
  6994. value: function (object) {
  6995. if (realHasInstance.call(this, object)) return true;
  6996. if (this !== Writable) return false;
  6997. return object && object._writableState instanceof WritableState;
  6998. }
  6999. });
  7000. } else {
  7001. realHasInstance = function (object) {
  7002. return object instanceof this;
  7003. };
  7004. }
  7005. function Writable(options) {
  7006. Duplex = Duplex || __webpack_require__(32);
  7007. // Writable ctor is applied to Duplexes, too.
  7008. // `realHasInstance` is necessary because using plain `instanceof`
  7009. // would return false, as no `_writableState` property is attached.
  7010. // Trying to use the custom `instanceof` for Writable here will also break the
  7011. // Node.js LazyTransform implementation, which has a non-trivial getter for
  7012. // `_writableState` that would lead to infinite recursion.
  7013. if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) {
  7014. return new Writable(options);
  7015. }
  7016. this._writableState = new WritableState(options, this);
  7017. // legacy.
  7018. this.writable = true;
  7019. if (options) {
  7020. if (typeof options.write === 'function') this._write = options.write;
  7021. if (typeof options.writev === 'function') this._writev = options.writev;
  7022. if (typeof options.destroy === 'function') this._destroy = options.destroy;
  7023. if (typeof options.final === 'function') this._final = options.final;
  7024. }
  7025. Stream.call(this);
  7026. }
  7027. // Otherwise people can pipe Writable streams, which is just wrong.
  7028. Writable.prototype.pipe = function () {
  7029. this.emit('error', new Error('Cannot pipe, not readable'));
  7030. };
  7031. function writeAfterEnd(stream, cb) {
  7032. var er = new Error('write after end');
  7033. // TODO: defer error events consistently everywhere, not just the cb
  7034. stream.emit('error', er);
  7035. pna.nextTick(cb, er);
  7036. }
  7037. // Checks that a user-supplied chunk is valid, especially for the particular
  7038. // mode the stream is in. Currently this means that `null` is never accepted
  7039. // and undefined/non-string values are only allowed in object mode.
  7040. function validChunk(stream, state, chunk, cb) {
  7041. var valid = true;
  7042. var er = false;
  7043. if (chunk === null) {
  7044. er = new TypeError('May not write null values to stream');
  7045. } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {
  7046. er = new TypeError('Invalid non-string/buffer chunk');
  7047. }
  7048. if (er) {
  7049. stream.emit('error', er);
  7050. pna.nextTick(cb, er);
  7051. valid = false;
  7052. }
  7053. return valid;
  7054. }
  7055. Writable.prototype.write = function (chunk, encoding, cb) {
  7056. var state = this._writableState;
  7057. var ret = false;
  7058. var isBuf = !state.objectMode && _isUint8Array(chunk);
  7059. if (isBuf && !Buffer.isBuffer(chunk)) {
  7060. chunk = _uint8ArrayToBuffer(chunk);
  7061. }
  7062. if (typeof encoding === 'function') {
  7063. cb = encoding;
  7064. encoding = null;
  7065. }
  7066. if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;
  7067. if (typeof cb !== 'function') cb = nop;
  7068. if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) {
  7069. state.pendingcb++;
  7070. ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);
  7071. }
  7072. return ret;
  7073. };
  7074. Writable.prototype.cork = function () {
  7075. var state = this._writableState;
  7076. state.corked++;
  7077. };
  7078. Writable.prototype.uncork = function () {
  7079. var state = this._writableState;
  7080. if (state.corked) {
  7081. state.corked--;
  7082. if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);
  7083. }
  7084. };
  7085. Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {
  7086. // node::ParseEncoding() requires lower case.
  7087. if (typeof encoding === 'string') encoding = encoding.toLowerCase();
  7088. if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding);
  7089. this._writableState.defaultEncoding = encoding;
  7090. return this;
  7091. };
  7092. function decodeChunk(state, chunk, encoding) {
  7093. if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {
  7094. chunk = Buffer.from(chunk, encoding);
  7095. }
  7096. return chunk;
  7097. }
  7098. Object.defineProperty(Writable.prototype, 'writableHighWaterMark', {
  7099. // making it explicit this property is not enumerable
  7100. // because otherwise some prototype manipulation in
  7101. // userland will fail
  7102. enumerable: false,
  7103. get: function () {
  7104. return this._writableState.highWaterMark;
  7105. }
  7106. });
  7107. // if we're already writing something, then just put this
  7108. // in the queue, and wait our turn. Otherwise, call _write
  7109. // If we return false, then we need a drain event, so set that flag.
  7110. function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {
  7111. if (!isBuf) {
  7112. var newChunk = decodeChunk(state, chunk, encoding);
  7113. if (chunk !== newChunk) {
  7114. isBuf = true;
  7115. encoding = 'buffer';
  7116. chunk = newChunk;
  7117. }
  7118. }
  7119. var len = state.objectMode ? 1 : chunk.length;
  7120. state.length += len;
  7121. var ret = state.length < state.highWaterMark;
  7122. // we must ensure that previous needDrain will not be reset to false.
  7123. if (!ret) state.needDrain = true;
  7124. if (state.writing || state.corked) {
  7125. var last = state.lastBufferedRequest;
  7126. state.lastBufferedRequest = {
  7127. chunk: chunk,
  7128. encoding: encoding,
  7129. isBuf: isBuf,
  7130. callback: cb,
  7131. next: null
  7132. };
  7133. if (last) {
  7134. last.next = state.lastBufferedRequest;
  7135. } else {
  7136. state.bufferedRequest = state.lastBufferedRequest;
  7137. }
  7138. state.bufferedRequestCount += 1;
  7139. } else {
  7140. doWrite(stream, state, false, len, chunk, encoding, cb);
  7141. }
  7142. return ret;
  7143. }
  7144. function doWrite(stream, state, writev, len, chunk, encoding, cb) {
  7145. state.writelen = len;
  7146. state.writecb = cb;
  7147. state.writing = true;
  7148. state.sync = true;
  7149. if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);
  7150. state.sync = false;
  7151. }
  7152. function onwriteError(stream, state, sync, er, cb) {
  7153. --state.pendingcb;
  7154. if (sync) {
  7155. // defer the callback if we are being called synchronously
  7156. // to avoid piling up things on the stack
  7157. pna.nextTick(cb, er);
  7158. // this can emit finish, and it will always happen
  7159. // after error
  7160. pna.nextTick(finishMaybe, stream, state);
  7161. stream._writableState.errorEmitted = true;
  7162. stream.emit('error', er);
  7163. } else {
  7164. // the caller expect this to happen before if
  7165. // it is async
  7166. cb(er);
  7167. stream._writableState.errorEmitted = true;
  7168. stream.emit('error', er);
  7169. // this can emit finish, but finish must
  7170. // always follow error
  7171. finishMaybe(stream, state);
  7172. }
  7173. }
  7174. function onwriteStateUpdate(state) {
  7175. state.writing = false;
  7176. state.writecb = null;
  7177. state.length -= state.writelen;
  7178. state.writelen = 0;
  7179. }
  7180. function onwrite(stream, er) {
  7181. var state = stream._writableState;
  7182. var sync = state.sync;
  7183. var cb = state.writecb;
  7184. onwriteStateUpdate(state);
  7185. if (er) onwriteError(stream, state, sync, er, cb);else {
  7186. // Check if we're actually ready to finish, but don't emit yet
  7187. var finished = needFinish(state);
  7188. if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {
  7189. clearBuffer(stream, state);
  7190. }
  7191. if (sync) {
  7192. /*<replacement>*/
  7193. asyncWrite(afterWrite, stream, state, finished, cb);
  7194. /*</replacement>*/
  7195. } else {
  7196. afterWrite(stream, state, finished, cb);
  7197. }
  7198. }
  7199. }
  7200. function afterWrite(stream, state, finished, cb) {
  7201. if (!finished) onwriteDrain(stream, state);
  7202. state.pendingcb--;
  7203. cb();
  7204. finishMaybe(stream, state);
  7205. }
  7206. // Must force callback to be called on nextTick, so that we don't
  7207. // emit 'drain' before the write() consumer gets the 'false' return
  7208. // value, and has a chance to attach a 'drain' listener.
  7209. function onwriteDrain(stream, state) {
  7210. if (state.length === 0 && state.needDrain) {
  7211. state.needDrain = false;
  7212. stream.emit('drain');
  7213. }
  7214. }
  7215. // if there's something in the buffer waiting, then process it
  7216. function clearBuffer(stream, state) {
  7217. state.bufferProcessing = true;
  7218. var entry = state.bufferedRequest;
  7219. if (stream._writev && entry && entry.next) {
  7220. // Fast case, write everything using _writev()
  7221. var l = state.bufferedRequestCount;
  7222. var buffer = new Array(l);
  7223. var holder = state.corkedRequestsFree;
  7224. holder.entry = entry;
  7225. var count = 0;
  7226. var allBuffers = true;
  7227. while (entry) {
  7228. buffer[count] = entry;
  7229. if (!entry.isBuf) allBuffers = false;
  7230. entry = entry.next;
  7231. count += 1;
  7232. }
  7233. buffer.allBuffers = allBuffers;
  7234. doWrite(stream, state, true, state.length, buffer, '', holder.finish);
  7235. // doWrite is almost always async, defer these to save a bit of time
  7236. // as the hot path ends with doWrite
  7237. state.pendingcb++;
  7238. state.lastBufferedRequest = null;
  7239. if (holder.next) {
  7240. state.corkedRequestsFree = holder.next;
  7241. holder.next = null;
  7242. } else {
  7243. state.corkedRequestsFree = new CorkedRequest(state);
  7244. }
  7245. state.bufferedRequestCount = 0;
  7246. } else {
  7247. // Slow case, write chunks one-by-one
  7248. while (entry) {
  7249. var chunk = entry.chunk;
  7250. var encoding = entry.encoding;
  7251. var cb = entry.callback;
  7252. var len = state.objectMode ? 1 : chunk.length;
  7253. doWrite(stream, state, false, len, chunk, encoding, cb);
  7254. entry = entry.next;
  7255. state.bufferedRequestCount--;
  7256. // if we didn't call the onwrite immediately, then
  7257. // it means that we need to wait until it does.
  7258. // also, that means that the chunk and cb are currently
  7259. // being processed, so move the buffer counter past them.
  7260. if (state.writing) {
  7261. break;
  7262. }
  7263. }
  7264. if (entry === null) state.lastBufferedRequest = null;
  7265. }
  7266. state.bufferedRequest = entry;
  7267. state.bufferProcessing = false;
  7268. }
  7269. Writable.prototype._write = function (chunk, encoding, cb) {
  7270. cb(new Error('_write() is not implemented'));
  7271. };
  7272. Writable.prototype._writev = null;
  7273. Writable.prototype.end = function (chunk, encoding, cb) {
  7274. var state = this._writableState;
  7275. if (typeof chunk === 'function') {
  7276. cb = chunk;
  7277. chunk = null;
  7278. encoding = null;
  7279. } else if (typeof encoding === 'function') {
  7280. cb = encoding;
  7281. encoding = null;
  7282. }
  7283. if (chunk !== null && chunk !== undefined) this.write(chunk, encoding);
  7284. // .end() fully uncorks
  7285. if (state.corked) {
  7286. state.corked = 1;
  7287. this.uncork();
  7288. }
  7289. // ignore unnecessary end() calls.
  7290. if (!state.ending && !state.finished) endWritable(this, state, cb);
  7291. };
  7292. function needFinish(state) {
  7293. return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;
  7294. }
  7295. function callFinal(stream, state) {
  7296. stream._final(function (err) {
  7297. state.pendingcb--;
  7298. if (err) {
  7299. stream.emit('error', err);
  7300. }
  7301. state.prefinished = true;
  7302. stream.emit('prefinish');
  7303. finishMaybe(stream, state);
  7304. });
  7305. }
  7306. function prefinish(stream, state) {
  7307. if (!state.prefinished && !state.finalCalled) {
  7308. if (typeof stream._final === 'function') {
  7309. state.pendingcb++;
  7310. state.finalCalled = true;
  7311. pna.nextTick(callFinal, stream, state);
  7312. } else {
  7313. state.prefinished = true;
  7314. stream.emit('prefinish');
  7315. }
  7316. }
  7317. }
  7318. function finishMaybe(stream, state) {
  7319. var need = needFinish(state);
  7320. if (need) {
  7321. prefinish(stream, state);
  7322. if (state.pendingcb === 0) {
  7323. state.finished = true;
  7324. stream.emit('finish');
  7325. }
  7326. }
  7327. return need;
  7328. }
  7329. function endWritable(stream, state, cb) {
  7330. state.ending = true;
  7331. finishMaybe(stream, state);
  7332. if (cb) {
  7333. if (state.finished) pna.nextTick(cb);else stream.once('finish', cb);
  7334. }
  7335. state.ended = true;
  7336. stream.writable = false;
  7337. }
  7338. function onCorkedFinish(corkReq, state, err) {
  7339. var entry = corkReq.entry;
  7340. corkReq.entry = null;
  7341. while (entry) {
  7342. var cb = entry.callback;
  7343. state.pendingcb--;
  7344. cb(err);
  7345. entry = entry.next;
  7346. }
  7347. if (state.corkedRequestsFree) {
  7348. state.corkedRequestsFree.next = corkReq;
  7349. } else {
  7350. state.corkedRequestsFree = corkReq;
  7351. }
  7352. }
  7353. Object.defineProperty(Writable.prototype, 'destroyed', {
  7354. get: function () {
  7355. if (this._writableState === undefined) {
  7356. return false;
  7357. }
  7358. return this._writableState.destroyed;
  7359. },
  7360. set: function (value) {
  7361. // we ignore the value if the stream
  7362. // has not been initialized yet
  7363. if (!this._writableState) {
  7364. return;
  7365. }
  7366. // backward compatibility, the user is explicitly
  7367. // managing destroyed
  7368. this._writableState.destroyed = value;
  7369. }
  7370. });
  7371. Writable.prototype.destroy = destroyImpl.destroy;
  7372. Writable.prototype._undestroy = destroyImpl.undestroy;
  7373. Writable.prototype._destroy = function (err, cb) {
  7374. this.end();
  7375. cb(err);
  7376. };
  7377. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(25), __webpack_require__(22)))
  7378. /***/ }),
  7379. /* 103 */
  7380. /***/ (function(module, exports, __webpack_require__) {
  7381. "use strict";
  7382. // Copyright Joyent, Inc. and other Node contributors.
  7383. //
  7384. // Permission is hereby granted, free of charge, to any person obtaining a
  7385. // copy of this software and associated documentation files (the
  7386. // "Software"), to deal in the Software without restriction, including
  7387. // without limitation the rights to use, copy, modify, merge, publish,
  7388. // distribute, sublicense, and/or sell copies of the Software, and to permit
  7389. // persons to whom the Software is furnished to do so, subject to the
  7390. // following conditions:
  7391. //
  7392. // The above copyright notice and this permission notice shall be included
  7393. // in all copies or substantial portions of the Software.
  7394. //
  7395. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  7396. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  7397. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  7398. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  7399. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  7400. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  7401. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  7402. /*<replacement>*/
  7403. var Buffer = __webpack_require__(70).Buffer;
  7404. /*</replacement>*/
  7405. var isEncoding = Buffer.isEncoding || function (encoding) {
  7406. encoding = '' + encoding;
  7407. switch (encoding && encoding.toLowerCase()) {
  7408. case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw':
  7409. return true;
  7410. default:
  7411. return false;
  7412. }
  7413. };
  7414. function _normalizeEncoding(enc) {
  7415. if (!enc) return 'utf8';
  7416. var retried;
  7417. while (true) {
  7418. switch (enc) {
  7419. case 'utf8':
  7420. case 'utf-8':
  7421. return 'utf8';
  7422. case 'ucs2':
  7423. case 'ucs-2':
  7424. case 'utf16le':
  7425. case 'utf-16le':
  7426. return 'utf16le';
  7427. case 'latin1':
  7428. case 'binary':
  7429. return 'latin1';
  7430. case 'base64':
  7431. case 'ascii':
  7432. case 'hex':
  7433. return enc;
  7434. default:
  7435. if (retried) return; // undefined
  7436. enc = ('' + enc).toLowerCase();
  7437. retried = true;
  7438. }
  7439. }
  7440. };
  7441. // Do not cache `Buffer.isEncoding` when checking encoding names as some
  7442. // modules monkey-patch it to support additional encodings
  7443. function normalizeEncoding(enc) {
  7444. var nenc = _normalizeEncoding(enc);
  7445. if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);
  7446. return nenc || enc;
  7447. }
  7448. // StringDecoder provides an interface for efficiently splitting a series of
  7449. // buffers into a series of JS strings without breaking apart multi-byte
  7450. // characters.
  7451. exports.StringDecoder = StringDecoder;
  7452. function StringDecoder(encoding) {
  7453. this.encoding = normalizeEncoding(encoding);
  7454. var nb;
  7455. switch (this.encoding) {
  7456. case 'utf16le':
  7457. this.text = utf16Text;
  7458. this.end = utf16End;
  7459. nb = 4;
  7460. break;
  7461. case 'utf8':
  7462. this.fillLast = utf8FillLast;
  7463. nb = 4;
  7464. break;
  7465. case 'base64':
  7466. this.text = base64Text;
  7467. this.end = base64End;
  7468. nb = 3;
  7469. break;
  7470. default:
  7471. this.write = simpleWrite;
  7472. this.end = simpleEnd;
  7473. return;
  7474. }
  7475. this.lastNeed = 0;
  7476. this.lastTotal = 0;
  7477. this.lastChar = Buffer.allocUnsafe(nb);
  7478. }
  7479. StringDecoder.prototype.write = function (buf) {
  7480. if (buf.length === 0) return '';
  7481. var r;
  7482. var i;
  7483. if (this.lastNeed) {
  7484. r = this.fillLast(buf);
  7485. if (r === undefined) return '';
  7486. i = this.lastNeed;
  7487. this.lastNeed = 0;
  7488. } else {
  7489. i = 0;
  7490. }
  7491. if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i);
  7492. return r || '';
  7493. };
  7494. StringDecoder.prototype.end = utf8End;
  7495. // Returns only complete characters in a Buffer
  7496. StringDecoder.prototype.text = utf8Text;
  7497. // Attempts to complete a partial non-UTF-8 character using bytes from a Buffer
  7498. StringDecoder.prototype.fillLast = function (buf) {
  7499. if (this.lastNeed <= buf.length) {
  7500. buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);
  7501. return this.lastChar.toString(this.encoding, 0, this.lastTotal);
  7502. }
  7503. buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);
  7504. this.lastNeed -= buf.length;
  7505. };
  7506. // Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a
  7507. // continuation byte. If an invalid byte is detected, -2 is returned.
  7508. function utf8CheckByte(byte) {
  7509. if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4;
  7510. return byte >> 6 === 0x02 ? -1 : -2;
  7511. }
  7512. // Checks at most 3 bytes at the end of a Buffer in order to detect an
  7513. // incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4)
  7514. // needed to complete the UTF-8 character (if applicable) are returned.
  7515. function utf8CheckIncomplete(self, buf, i) {
  7516. var j = buf.length - 1;
  7517. if (j < i) return 0;
  7518. var nb = utf8CheckByte(buf[j]);
  7519. if (nb >= 0) {
  7520. if (nb > 0) self.lastNeed = nb - 1;
  7521. return nb;
  7522. }
  7523. if (--j < i || nb === -2) return 0;
  7524. nb = utf8CheckByte(buf[j]);
  7525. if (nb >= 0) {
  7526. if (nb > 0) self.lastNeed = nb - 2;
  7527. return nb;
  7528. }
  7529. if (--j < i || nb === -2) return 0;
  7530. nb = utf8CheckByte(buf[j]);
  7531. if (nb >= 0) {
  7532. if (nb > 0) {
  7533. if (nb === 2) nb = 0;else self.lastNeed = nb - 3;
  7534. }
  7535. return nb;
  7536. }
  7537. return 0;
  7538. }
  7539. // Validates as many continuation bytes for a multi-byte UTF-8 character as
  7540. // needed or are available. If we see a non-continuation byte where we expect
  7541. // one, we "replace" the validated continuation bytes we've seen so far with
  7542. // a single UTF-8 replacement character ('\ufffd'), to match v8's UTF-8 decoding
  7543. // behavior. The continuation byte check is included three times in the case
  7544. // where all of the continuation bytes for a character exist in the same buffer.
  7545. // It is also done this way as a slight performance increase instead of using a
  7546. // loop.
  7547. function utf8CheckExtraBytes(self, buf, p) {
  7548. if ((buf[0] & 0xC0) !== 0x80) {
  7549. self.lastNeed = 0;
  7550. return '\ufffd';
  7551. }
  7552. if (self.lastNeed > 1 && buf.length > 1) {
  7553. if ((buf[1] & 0xC0) !== 0x80) {
  7554. self.lastNeed = 1;
  7555. return '\ufffd';
  7556. }
  7557. if (self.lastNeed > 2 && buf.length > 2) {
  7558. if ((buf[2] & 0xC0) !== 0x80) {
  7559. self.lastNeed = 2;
  7560. return '\ufffd';
  7561. }
  7562. }
  7563. }
  7564. }
  7565. // Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.
  7566. function utf8FillLast(buf) {
  7567. var p = this.lastTotal - this.lastNeed;
  7568. var r = utf8CheckExtraBytes(this, buf, p);
  7569. if (r !== undefined) return r;
  7570. if (this.lastNeed <= buf.length) {
  7571. buf.copy(this.lastChar, p, 0, this.lastNeed);
  7572. return this.lastChar.toString(this.encoding, 0, this.lastTotal);
  7573. }
  7574. buf.copy(this.lastChar, p, 0, buf.length);
  7575. this.lastNeed -= buf.length;
  7576. }
  7577. // Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a
  7578. // partial character, the character's bytes are buffered until the required
  7579. // number of bytes are available.
  7580. function utf8Text(buf, i) {
  7581. var total = utf8CheckIncomplete(this, buf, i);
  7582. if (!this.lastNeed) return buf.toString('utf8', i);
  7583. this.lastTotal = total;
  7584. var end = buf.length - (total - this.lastNeed);
  7585. buf.copy(this.lastChar, 0, end);
  7586. return buf.toString('utf8', i, end);
  7587. }
  7588. // For UTF-8, a replacement character is added when ending on a partial
  7589. // character.
  7590. function utf8End(buf) {
  7591. var r = buf && buf.length ? this.write(buf) : '';
  7592. if (this.lastNeed) return r + '\ufffd';
  7593. return r;
  7594. }
  7595. // UTF-16LE typically needs two bytes per character, but even if we have an even
  7596. // number of bytes available, we need to check if we end on a leading/high
  7597. // surrogate. In that case, we need to wait for the next two bytes in order to
  7598. // decode the last character properly.
  7599. function utf16Text(buf, i) {
  7600. if ((buf.length - i) % 2 === 0) {
  7601. var r = buf.toString('utf16le', i);
  7602. if (r) {
  7603. var c = r.charCodeAt(r.length - 1);
  7604. if (c >= 0xD800 && c <= 0xDBFF) {
  7605. this.lastNeed = 2;
  7606. this.lastTotal = 4;
  7607. this.lastChar[0] = buf[buf.length - 2];
  7608. this.lastChar[1] = buf[buf.length - 1];
  7609. return r.slice(0, -1);
  7610. }
  7611. }
  7612. return r;
  7613. }
  7614. this.lastNeed = 1;
  7615. this.lastTotal = 2;
  7616. this.lastChar[0] = buf[buf.length - 1];
  7617. return buf.toString('utf16le', i, buf.length - 1);
  7618. }
  7619. // For UTF-16LE we do not explicitly append special replacement characters if we
  7620. // end on a partial character, we simply let v8 handle that.
  7621. function utf16End(buf) {
  7622. var r = buf && buf.length ? this.write(buf) : '';
  7623. if (this.lastNeed) {
  7624. var end = this.lastTotal - this.lastNeed;
  7625. return r + this.lastChar.toString('utf16le', 0, end);
  7626. }
  7627. return r;
  7628. }
  7629. function base64Text(buf, i) {
  7630. var n = (buf.length - i) % 3;
  7631. if (n === 0) return buf.toString('base64', i);
  7632. this.lastNeed = 3 - n;
  7633. this.lastTotal = 3;
  7634. if (n === 1) {
  7635. this.lastChar[0] = buf[buf.length - 1];
  7636. } else {
  7637. this.lastChar[0] = buf[buf.length - 2];
  7638. this.lastChar[1] = buf[buf.length - 1];
  7639. }
  7640. return buf.toString('base64', i, buf.length - n);
  7641. }
  7642. function base64End(buf) {
  7643. var r = buf && buf.length ? this.write(buf) : '';
  7644. if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed);
  7645. return r;
  7646. }
  7647. // Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex)
  7648. function simpleWrite(buf) {
  7649. return buf.toString(this.encoding);
  7650. }
  7651. function simpleEnd(buf) {
  7652. return buf && buf.length ? this.write(buf) : '';
  7653. }
  7654. /***/ }),
  7655. /* 104 */
  7656. /***/ (function(module, exports, __webpack_require__) {
  7657. /* WEBPACK VAR INJECTION */(function(process) {// Copyright Joyent, Inc. and other Node contributors.
  7658. //
  7659. // Permission is hereby granted, free of charge, to any person obtaining a
  7660. // copy of this software and associated documentation files (the
  7661. // "Software"), to deal in the Software without restriction, including
  7662. // without limitation the rights to use, copy, modify, merge, publish,
  7663. // distribute, sublicense, and/or sell copies of the Software, and to permit
  7664. // persons to whom the Software is furnished to do so, subject to the
  7665. // following conditions:
  7666. //
  7667. // The above copyright notice and this permission notice shall be included
  7668. // in all copies or substantial portions of the Software.
  7669. //
  7670. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  7671. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  7672. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  7673. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  7674. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  7675. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  7676. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  7677. var getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors ||
  7678. function getOwnPropertyDescriptors(obj) {
  7679. var keys = Object.keys(obj);
  7680. var descriptors = {};
  7681. for (var i = 0; i < keys.length; i++) {
  7682. descriptors[keys[i]] = Object.getOwnPropertyDescriptor(obj, keys[i]);
  7683. }
  7684. return descriptors;
  7685. };
  7686. var formatRegExp = /%[sdj%]/g;
  7687. exports.format = function(f) {
  7688. if (!isString(f)) {
  7689. var objects = [];
  7690. for (var i = 0; i < arguments.length; i++) {
  7691. objects.push(inspect(arguments[i]));
  7692. }
  7693. return objects.join(' ');
  7694. }
  7695. var i = 1;
  7696. var args = arguments;
  7697. var len = args.length;
  7698. var str = String(f).replace(formatRegExp, function(x) {
  7699. if (x === '%%') return '%';
  7700. if (i >= len) return x;
  7701. switch (x) {
  7702. case '%s': return String(args[i++]);
  7703. case '%d': return Number(args[i++]);
  7704. case '%j':
  7705. try {
  7706. return JSON.stringify(args[i++]);
  7707. } catch (_) {
  7708. return '[Circular]';
  7709. }
  7710. default:
  7711. return x;
  7712. }
  7713. });
  7714. for (var x = args[i]; i < len; x = args[++i]) {
  7715. if (isNull(x) || !isObject(x)) {
  7716. str += ' ' + x;
  7717. } else {
  7718. str += ' ' + inspect(x);
  7719. }
  7720. }
  7721. return str;
  7722. };
  7723. // Mark that a method should not be used.
  7724. // Returns a modified function which warns once by default.
  7725. // If --no-deprecation is set, then it is a no-op.
  7726. exports.deprecate = function(fn, msg) {
  7727. if (typeof process !== 'undefined' && process.noDeprecation === true) {
  7728. return fn;
  7729. }
  7730. // Allow for deprecating things in the process of starting up.
  7731. if (typeof process === 'undefined') {
  7732. return function() {
  7733. return exports.deprecate(fn, msg).apply(this, arguments);
  7734. };
  7735. }
  7736. var warned = false;
  7737. function deprecated() {
  7738. if (!warned) {
  7739. if (process.throwDeprecation) {
  7740. throw new Error(msg);
  7741. } else if (process.traceDeprecation) {
  7742. console.trace(msg);
  7743. } else {
  7744. console.error(msg);
  7745. }
  7746. warned = true;
  7747. }
  7748. return fn.apply(this, arguments);
  7749. }
  7750. return deprecated;
  7751. };
  7752. var debugs = {};
  7753. var debugEnviron;
  7754. exports.debuglog = function(set) {
  7755. if (isUndefined(debugEnviron))
  7756. debugEnviron = process.env.NODE_DEBUG || '';
  7757. set = set.toUpperCase();
  7758. if (!debugs[set]) {
  7759. if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) {
  7760. var pid = process.pid;
  7761. debugs[set] = function() {
  7762. var msg = exports.format.apply(exports, arguments);
  7763. console.error('%s %d: %s', set, pid, msg);
  7764. };
  7765. } else {
  7766. debugs[set] = function() {};
  7767. }
  7768. }
  7769. return debugs[set];
  7770. };
  7771. /**
  7772. * Echos the value of a value. Trys to print the value out
  7773. * in the best way possible given the different types.
  7774. *
  7775. * @param {Object} obj The object to print out.
  7776. * @param {Object} opts Optional options object that alters the output.
  7777. */
  7778. /* legacy: obj, showHidden, depth, colors*/
  7779. function inspect(obj, opts) {
  7780. // default options
  7781. var ctx = {
  7782. seen: [],
  7783. stylize: stylizeNoColor
  7784. };
  7785. // legacy...
  7786. if (arguments.length >= 3) ctx.depth = arguments[2];
  7787. if (arguments.length >= 4) ctx.colors = arguments[3];
  7788. if (isBoolean(opts)) {
  7789. // legacy...
  7790. ctx.showHidden = opts;
  7791. } else if (opts) {
  7792. // got an "options" object
  7793. exports._extend(ctx, opts);
  7794. }
  7795. // set default options
  7796. if (isUndefined(ctx.showHidden)) ctx.showHidden = false;
  7797. if (isUndefined(ctx.depth)) ctx.depth = 2;
  7798. if (isUndefined(ctx.colors)) ctx.colors = false;
  7799. if (isUndefined(ctx.customInspect)) ctx.customInspect = true;
  7800. if (ctx.colors) ctx.stylize = stylizeWithColor;
  7801. return formatValue(ctx, obj, ctx.depth);
  7802. }
  7803. exports.inspect = inspect;
  7804. // http://en.wikipedia.org/wiki/ANSI_escape_code#graphics
  7805. inspect.colors = {
  7806. 'bold' : [1, 22],
  7807. 'italic' : [3, 23],
  7808. 'underline' : [4, 24],
  7809. 'inverse' : [7, 27],
  7810. 'white' : [37, 39],
  7811. 'grey' : [90, 39],
  7812. 'black' : [30, 39],
  7813. 'blue' : [34, 39],
  7814. 'cyan' : [36, 39],
  7815. 'green' : [32, 39],
  7816. 'magenta' : [35, 39],
  7817. 'red' : [31, 39],
  7818. 'yellow' : [33, 39]
  7819. };
  7820. // Don't use 'blue' not visible on cmd.exe
  7821. inspect.styles = {
  7822. 'special': 'cyan',
  7823. 'number': 'yellow',
  7824. 'boolean': 'yellow',
  7825. 'undefined': 'grey',
  7826. 'null': 'bold',
  7827. 'string': 'green',
  7828. 'date': 'magenta',
  7829. // "name": intentionally not styling
  7830. 'regexp': 'red'
  7831. };
  7832. function stylizeWithColor(str, styleType) {
  7833. var style = inspect.styles[styleType];
  7834. if (style) {
  7835. return '\u001b[' + inspect.colors[style][0] + 'm' + str +
  7836. '\u001b[' + inspect.colors[style][1] + 'm';
  7837. } else {
  7838. return str;
  7839. }
  7840. }
  7841. function stylizeNoColor(str, styleType) {
  7842. return str;
  7843. }
  7844. function arrayToHash(array) {
  7845. var hash = {};
  7846. array.forEach(function(val, idx) {
  7847. hash[val] = true;
  7848. });
  7849. return hash;
  7850. }
  7851. function formatValue(ctx, value, recurseTimes) {
  7852. // Provide a hook for user-specified inspect functions.
  7853. // Check that value is an object with an inspect function on it
  7854. if (ctx.customInspect &&
  7855. value &&
  7856. isFunction(value.inspect) &&
  7857. // Filter out the util module, it's inspect function is special
  7858. value.inspect !== exports.inspect &&
  7859. // Also filter out any prototype objects using the circular check.
  7860. !(value.constructor && value.constructor.prototype === value)) {
  7861. var ret = value.inspect(recurseTimes, ctx);
  7862. if (!isString(ret)) {
  7863. ret = formatValue(ctx, ret, recurseTimes);
  7864. }
  7865. return ret;
  7866. }
  7867. // Primitive types cannot have properties
  7868. var primitive = formatPrimitive(ctx, value);
  7869. if (primitive) {
  7870. return primitive;
  7871. }
  7872. // Look up the keys of the object.
  7873. var keys = Object.keys(value);
  7874. var visibleKeys = arrayToHash(keys);
  7875. if (ctx.showHidden) {
  7876. keys = Object.getOwnPropertyNames(value);
  7877. }
  7878. // IE doesn't make error fields non-enumerable
  7879. // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx
  7880. if (isError(value)
  7881. && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {
  7882. return formatError(value);
  7883. }
  7884. // Some type of object without properties can be shortcutted.
  7885. if (keys.length === 0) {
  7886. if (isFunction(value)) {
  7887. var name = value.name ? ': ' + value.name : '';
  7888. return ctx.stylize('[Function' + name + ']', 'special');
  7889. }
  7890. if (isRegExp(value)) {
  7891. return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
  7892. }
  7893. if (isDate(value)) {
  7894. return ctx.stylize(Date.prototype.toString.call(value), 'date');
  7895. }
  7896. if (isError(value)) {
  7897. return formatError(value);
  7898. }
  7899. }
  7900. var base = '', array = false, braces = ['{', '}'];
  7901. // Make Array say that they are Array
  7902. if (isArray(value)) {
  7903. array = true;
  7904. braces = ['[', ']'];
  7905. }
  7906. // Make functions say that they are functions
  7907. if (isFunction(value)) {
  7908. var n = value.name ? ': ' + value.name : '';
  7909. base = ' [Function' + n + ']';
  7910. }
  7911. // Make RegExps say that they are RegExps
  7912. if (isRegExp(value)) {
  7913. base = ' ' + RegExp.prototype.toString.call(value);
  7914. }
  7915. // Make dates with properties first say the date
  7916. if (isDate(value)) {
  7917. base = ' ' + Date.prototype.toUTCString.call(value);
  7918. }
  7919. // Make error with message first say the error
  7920. if (isError(value)) {
  7921. base = ' ' + formatError(value);
  7922. }
  7923. if (keys.length === 0 && (!array || value.length == 0)) {
  7924. return braces[0] + base + braces[1];
  7925. }
  7926. if (recurseTimes < 0) {
  7927. if (isRegExp(value)) {
  7928. return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
  7929. } else {
  7930. return ctx.stylize('[Object]', 'special');
  7931. }
  7932. }
  7933. ctx.seen.push(value);
  7934. var output;
  7935. if (array) {
  7936. output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);
  7937. } else {
  7938. output = keys.map(function(key) {
  7939. return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);
  7940. });
  7941. }
  7942. ctx.seen.pop();
  7943. return reduceToSingleString(output, base, braces);
  7944. }
  7945. function formatPrimitive(ctx, value) {
  7946. if (isUndefined(value))
  7947. return ctx.stylize('undefined', 'undefined');
  7948. if (isString(value)) {
  7949. var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '')
  7950. .replace(/'/g, "\\'")
  7951. .replace(/\\"/g, '"') + '\'';
  7952. return ctx.stylize(simple, 'string');
  7953. }
  7954. if (isNumber(value))
  7955. return ctx.stylize('' + value, 'number');
  7956. if (isBoolean(value))
  7957. return ctx.stylize('' + value, 'boolean');
  7958. // For some reason typeof null is "object", so special case here.
  7959. if (isNull(value))
  7960. return ctx.stylize('null', 'null');
  7961. }
  7962. function formatError(value) {
  7963. return '[' + Error.prototype.toString.call(value) + ']';
  7964. }
  7965. function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
  7966. var output = [];
  7967. for (var i = 0, l = value.length; i < l; ++i) {
  7968. if (hasOwnProperty(value, String(i))) {
  7969. output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
  7970. String(i), true));
  7971. } else {
  7972. output.push('');
  7973. }
  7974. }
  7975. keys.forEach(function(key) {
  7976. if (!key.match(/^\d+$/)) {
  7977. output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
  7978. key, true));
  7979. }
  7980. });
  7981. return output;
  7982. }
  7983. function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
  7984. var name, str, desc;
  7985. desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };
  7986. if (desc.get) {
  7987. if (desc.set) {
  7988. str = ctx.stylize('[Getter/Setter]', 'special');
  7989. } else {
  7990. str = ctx.stylize('[Getter]', 'special');
  7991. }
  7992. } else {
  7993. if (desc.set) {
  7994. str = ctx.stylize('[Setter]', 'special');
  7995. }
  7996. }
  7997. if (!hasOwnProperty(visibleKeys, key)) {
  7998. name = '[' + key + ']';
  7999. }
  8000. if (!str) {
  8001. if (ctx.seen.indexOf(desc.value) < 0) {
  8002. if (isNull(recurseTimes)) {
  8003. str = formatValue(ctx, desc.value, null);
  8004. } else {
  8005. str = formatValue(ctx, desc.value, recurseTimes - 1);
  8006. }
  8007. if (str.indexOf('\n') > -1) {
  8008. if (array) {
  8009. str = str.split('\n').map(function(line) {
  8010. return ' ' + line;
  8011. }).join('\n').substr(2);
  8012. } else {
  8013. str = '\n' + str.split('\n').map(function(line) {
  8014. return ' ' + line;
  8015. }).join('\n');
  8016. }
  8017. }
  8018. } else {
  8019. str = ctx.stylize('[Circular]', 'special');
  8020. }
  8021. }
  8022. if (isUndefined(name)) {
  8023. if (array && key.match(/^\d+$/)) {
  8024. return str;
  8025. }
  8026. name = JSON.stringify('' + key);
  8027. if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
  8028. name = name.substr(1, name.length - 2);
  8029. name = ctx.stylize(name, 'name');
  8030. } else {
  8031. name = name.replace(/'/g, "\\'")
  8032. .replace(/\\"/g, '"')
  8033. .replace(/(^"|"$)/g, "'");
  8034. name = ctx.stylize(name, 'string');
  8035. }
  8036. }
  8037. return name + ': ' + str;
  8038. }
  8039. function reduceToSingleString(output, base, braces) {
  8040. var numLinesEst = 0;
  8041. var length = output.reduce(function(prev, cur) {
  8042. numLinesEst++;
  8043. if (cur.indexOf('\n') >= 0) numLinesEst++;
  8044. return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1;
  8045. }, 0);
  8046. if (length > 60) {
  8047. return braces[0] +
  8048. (base === '' ? '' : base + '\n ') +
  8049. ' ' +
  8050. output.join(',\n ') +
  8051. ' ' +
  8052. braces[1];
  8053. }
  8054. return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];
  8055. }
  8056. // NOTE: These type checking functions intentionally don't use `instanceof`
  8057. // because it is fragile and can be easily faked with `Object.create()`.
  8058. function isArray(ar) {
  8059. return Array.isArray(ar);
  8060. }
  8061. exports.isArray = isArray;
  8062. function isBoolean(arg) {
  8063. return typeof arg === 'boolean';
  8064. }
  8065. exports.isBoolean = isBoolean;
  8066. function isNull(arg) {
  8067. return arg === null;
  8068. }
  8069. exports.isNull = isNull;
  8070. function isNullOrUndefined(arg) {
  8071. return arg == null;
  8072. }
  8073. exports.isNullOrUndefined = isNullOrUndefined;
  8074. function isNumber(arg) {
  8075. return typeof arg === 'number';
  8076. }
  8077. exports.isNumber = isNumber;
  8078. function isString(arg) {
  8079. return typeof arg === 'string';
  8080. }
  8081. exports.isString = isString;
  8082. function isSymbol(arg) {
  8083. return typeof arg === 'symbol';
  8084. }
  8085. exports.isSymbol = isSymbol;
  8086. function isUndefined(arg) {
  8087. return arg === void 0;
  8088. }
  8089. exports.isUndefined = isUndefined;
  8090. function isRegExp(re) {
  8091. return isObject(re) && objectToString(re) === '[object RegExp]';
  8092. }
  8093. exports.isRegExp = isRegExp;
  8094. function isObject(arg) {
  8095. return typeof arg === 'object' && arg !== null;
  8096. }
  8097. exports.isObject = isObject;
  8098. function isDate(d) {
  8099. return isObject(d) && objectToString(d) === '[object Date]';
  8100. }
  8101. exports.isDate = isDate;
  8102. function isError(e) {
  8103. return isObject(e) &&
  8104. (objectToString(e) === '[object Error]' || e instanceof Error);
  8105. }
  8106. exports.isError = isError;
  8107. function isFunction(arg) {
  8108. return typeof arg === 'function';
  8109. }
  8110. exports.isFunction = isFunction;
  8111. function isPrimitive(arg) {
  8112. return arg === null ||
  8113. typeof arg === 'boolean' ||
  8114. typeof arg === 'number' ||
  8115. typeof arg === 'string' ||
  8116. typeof arg === 'symbol' || // ES6 symbol
  8117. typeof arg === 'undefined';
  8118. }
  8119. exports.isPrimitive = isPrimitive;
  8120. exports.isBuffer = __webpack_require__(267);
  8121. function objectToString(o) {
  8122. return Object.prototype.toString.call(o);
  8123. }
  8124. function pad(n) {
  8125. return n < 10 ? '0' + n.toString(10) : n.toString(10);
  8126. }
  8127. var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',
  8128. 'Oct', 'Nov', 'Dec'];
  8129. // 26 Feb 16:19:34
  8130. function timestamp() {
  8131. var d = new Date();
  8132. var time = [pad(d.getHours()),
  8133. pad(d.getMinutes()),
  8134. pad(d.getSeconds())].join(':');
  8135. return [d.getDate(), months[d.getMonth()], time].join(' ');
  8136. }
  8137. // log is just a thin wrapper to console.log that prepends a timestamp
  8138. exports.log = function() {
  8139. console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));
  8140. };
  8141. /**
  8142. * Inherit the prototype methods from one constructor into another.
  8143. *
  8144. * The Function.prototype.inherits from lang.js rewritten as a standalone
  8145. * function (not on Function.prototype). NOTE: If this file is to be loaded
  8146. * during bootstrapping this function needs to be rewritten using some native
  8147. * functions as prototype setup using normal JavaScript does not work as
  8148. * expected during bootstrapping (see mirror.js in r114903).
  8149. *
  8150. * @param {function} ctor Constructor function which needs to inherit the
  8151. * prototype.
  8152. * @param {function} superCtor Constructor function to inherit prototype from.
  8153. */
  8154. exports.inherits = __webpack_require__(268);
  8155. exports._extend = function(origin, add) {
  8156. // Don't do anything if add isn't an object
  8157. if (!add || !isObject(add)) return origin;
  8158. var keys = Object.keys(add);
  8159. var i = keys.length;
  8160. while (i--) {
  8161. origin[keys[i]] = add[keys[i]];
  8162. }
  8163. return origin;
  8164. };
  8165. function hasOwnProperty(obj, prop) {
  8166. return Object.prototype.hasOwnProperty.call(obj, prop);
  8167. }
  8168. var kCustomPromisifiedSymbol = typeof Symbol !== 'undefined' ? Symbol('util.promisify.custom') : undefined;
  8169. exports.promisify = function promisify(original) {
  8170. if (typeof original !== 'function')
  8171. throw new TypeError('The "original" argument must be of type Function');
  8172. if (kCustomPromisifiedSymbol && original[kCustomPromisifiedSymbol]) {
  8173. var fn = original[kCustomPromisifiedSymbol];
  8174. if (typeof fn !== 'function') {
  8175. throw new TypeError('The "util.promisify.custom" argument must be of type Function');
  8176. }
  8177. Object.defineProperty(fn, kCustomPromisifiedSymbol, {
  8178. value: fn, enumerable: false, writable: false, configurable: true
  8179. });
  8180. return fn;
  8181. }
  8182. function fn() {
  8183. var promiseResolve, promiseReject;
  8184. var promise = new Promise(function (resolve, reject) {
  8185. promiseResolve = resolve;
  8186. promiseReject = reject;
  8187. });
  8188. var args = [];
  8189. for (var i = 0; i < arguments.length; i++) {
  8190. args.push(arguments[i]);
  8191. }
  8192. args.push(function (err, value) {
  8193. if (err) {
  8194. promiseReject(err);
  8195. } else {
  8196. promiseResolve(value);
  8197. }
  8198. });
  8199. try {
  8200. original.apply(this, args);
  8201. } catch (err) {
  8202. promiseReject(err);
  8203. }
  8204. return promise;
  8205. }
  8206. Object.setPrototypeOf(fn, Object.getPrototypeOf(original));
  8207. if (kCustomPromisifiedSymbol) Object.defineProperty(fn, kCustomPromisifiedSymbol, {
  8208. value: fn, enumerable: false, writable: false, configurable: true
  8209. });
  8210. return Object.defineProperties(
  8211. fn,
  8212. getOwnPropertyDescriptors(original)
  8213. );
  8214. }
  8215. exports.promisify.custom = kCustomPromisifiedSymbol
  8216. function callbackifyOnRejected(reason, cb) {
  8217. // `!reason` guard inspired by bluebird (Ref: https://goo.gl/t5IS6M).
  8218. // Because `null` is a special error value in callbacks which means "no error
  8219. // occurred", we error-wrap so the callback consumer can distinguish between
  8220. // "the promise rejected with null" or "the promise fulfilled with undefined".
  8221. if (!reason) {
  8222. var newReason = new Error('Promise was rejected with a falsy value');
  8223. newReason.reason = reason;
  8224. reason = newReason;
  8225. }
  8226. return cb(reason);
  8227. }
  8228. function callbackify(original) {
  8229. if (typeof original !== 'function') {
  8230. throw new TypeError('The "original" argument must be of type Function');
  8231. }
  8232. // We DO NOT return the promise as it gives the user a false sense that
  8233. // the promise is actually somehow related to the callback's execution
  8234. // and that the callback throwing will reject the promise.
  8235. function callbackified() {
  8236. var args = [];
  8237. for (var i = 0; i < arguments.length; i++) {
  8238. args.push(arguments[i]);
  8239. }
  8240. var maybeCb = args.pop();
  8241. if (typeof maybeCb !== 'function') {
  8242. throw new TypeError('The last argument must be of type Function');
  8243. }
  8244. var self = this;
  8245. var cb = function() {
  8246. return maybeCb.apply(self, arguments);
  8247. };
  8248. // In true node style we process the callback on `nextTick` with all the
  8249. // implications (stack, `uncaughtException`, `async_hooks`)
  8250. original.apply(this, args)
  8251. .then(function(ret) { process.nextTick(cb, null, ret) },
  8252. function(rej) { process.nextTick(callbackifyOnRejected, rej, cb) });
  8253. }
  8254. Object.setPrototypeOf(callbackified, Object.getPrototypeOf(original));
  8255. Object.defineProperties(callbackified,
  8256. getOwnPropertyDescriptors(original));
  8257. return callbackified;
  8258. }
  8259. exports.callbackify = callbackify;
  8260. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(25)))
  8261. /***/ }),
  8262. /* 105 */
  8263. /***/ (function(module, exports, __webpack_require__) {
  8264. ;(function (root, factory) {
  8265. if (true) {
  8266. // CommonJS
  8267. module.exports = exports = factory(__webpack_require__(1));
  8268. }
  8269. else {}
  8270. }(this, function (CryptoJS) {
  8271. (function () {
  8272. // Shortcuts
  8273. var C = CryptoJS;
  8274. var C_lib = C.lib;
  8275. var WordArray = C_lib.WordArray;
  8276. var Hasher = C_lib.Hasher;
  8277. var C_algo = C.algo;
  8278. // Reusable object
  8279. var W = [];
  8280. /**
  8281. * SHA-1 hash algorithm.
  8282. */
  8283. var SHA1 = C_algo.SHA1 = Hasher.extend({
  8284. _doReset: function () {
  8285. this._hash = new WordArray.init([
  8286. 0x67452301, 0xefcdab89,
  8287. 0x98badcfe, 0x10325476,
  8288. 0xc3d2e1f0
  8289. ]);
  8290. },
  8291. _doProcessBlock: function (M, offset) {
  8292. // Shortcut
  8293. var H = this._hash.words;
  8294. // Working variables
  8295. var a = H[0];
  8296. var b = H[1];
  8297. var c = H[2];
  8298. var d = H[3];
  8299. var e = H[4];
  8300. // Computation
  8301. for (var i = 0; i < 80; i++) {
  8302. if (i < 16) {
  8303. W[i] = M[offset + i] | 0;
  8304. } else {
  8305. var n = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16];
  8306. W[i] = (n << 1) | (n >>> 31);
  8307. }
  8308. var t = ((a << 5) | (a >>> 27)) + e + W[i];
  8309. if (i < 20) {
  8310. t += ((b & c) | (~b & d)) + 0x5a827999;
  8311. } else if (i < 40) {
  8312. t += (b ^ c ^ d) + 0x6ed9eba1;
  8313. } else if (i < 60) {
  8314. t += ((b & c) | (b & d) | (c & d)) - 0x70e44324;
  8315. } else /* if (i < 80) */ {
  8316. t += (b ^ c ^ d) - 0x359d3e2a;
  8317. }
  8318. e = d;
  8319. d = c;
  8320. c = (b << 30) | (b >>> 2);
  8321. b = a;
  8322. a = t;
  8323. }
  8324. // Intermediate hash value
  8325. H[0] = (H[0] + a) | 0;
  8326. H[1] = (H[1] + b) | 0;
  8327. H[2] = (H[2] + c) | 0;
  8328. H[3] = (H[3] + d) | 0;
  8329. H[4] = (H[4] + e) | 0;
  8330. },
  8331. _doFinalize: function () {
  8332. // Shortcuts
  8333. var data = this._data;
  8334. var dataWords = data.words;
  8335. var nBitsTotal = this._nDataBytes * 8;
  8336. var nBitsLeft = data.sigBytes * 8;
  8337. // Add padding
  8338. dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);
  8339. dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000);
  8340. dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal;
  8341. data.sigBytes = dataWords.length * 4;
  8342. // Hash final blocks
  8343. this._process();
  8344. // Return final computed hash
  8345. return this._hash;
  8346. },
  8347. clone: function () {
  8348. var clone = Hasher.clone.call(this);
  8349. clone._hash = this._hash.clone();
  8350. return clone;
  8351. }
  8352. });
  8353. /**
  8354. * Shortcut function to the hasher's object interface.
  8355. *
  8356. * @param {WordArray|string} message The message to hash.
  8357. *
  8358. * @return {WordArray} The hash.
  8359. *
  8360. * @static
  8361. *
  8362. * @example
  8363. *
  8364. * var hash = CryptoJS.SHA1('message');
  8365. * var hash = CryptoJS.SHA1(wordArray);
  8366. */
  8367. C.SHA1 = Hasher._createHelper(SHA1);
  8368. /**
  8369. * Shortcut function to the HMAC's object interface.
  8370. *
  8371. * @param {WordArray|string} message The message to hash.
  8372. * @param {WordArray|string} key The secret key.
  8373. *
  8374. * @return {WordArray} The HMAC.
  8375. *
  8376. * @static
  8377. *
  8378. * @example
  8379. *
  8380. * var hmac = CryptoJS.HmacSHA1(message, key);
  8381. */
  8382. C.HmacSHA1 = Hasher._createHmacHelper(SHA1);
  8383. }());
  8384. return CryptoJS.SHA1;
  8385. }));
  8386. /***/ }),
  8387. /* 106 */
  8388. /***/ (function(module, exports, __webpack_require__) {
  8389. ;(function (root, factory) {
  8390. if (true) {
  8391. // CommonJS
  8392. module.exports = exports = factory(__webpack_require__(1));
  8393. }
  8394. else {}
  8395. }(this, function (CryptoJS) {
  8396. (function () {
  8397. // Shortcuts
  8398. var C = CryptoJS;
  8399. var C_lib = C.lib;
  8400. var Base = C_lib.Base;
  8401. var C_enc = C.enc;
  8402. var Utf8 = C_enc.Utf8;
  8403. var C_algo = C.algo;
  8404. /**
  8405. * HMAC algorithm.
  8406. */
  8407. var HMAC = C_algo.HMAC = Base.extend({
  8408. /**
  8409. * Initializes a newly created HMAC.
  8410. *
  8411. * @param {Hasher} hasher The hash algorithm to use.
  8412. * @param {WordArray|string} key The secret key.
  8413. *
  8414. * @example
  8415. *
  8416. * var hmacHasher = CryptoJS.algo.HMAC.create(CryptoJS.algo.SHA256, key);
  8417. */
  8418. init: function (hasher, key) {
  8419. // Init hasher
  8420. hasher = this._hasher = new hasher.init();
  8421. // Convert string to WordArray, else assume WordArray already
  8422. if (typeof key == 'string') {
  8423. key = Utf8.parse(key);
  8424. }
  8425. // Shortcuts
  8426. var hasherBlockSize = hasher.blockSize;
  8427. var hasherBlockSizeBytes = hasherBlockSize * 4;
  8428. // Allow arbitrary length keys
  8429. if (key.sigBytes > hasherBlockSizeBytes) {
  8430. key = hasher.finalize(key);
  8431. }
  8432. // Clamp excess bits
  8433. key.clamp();
  8434. // Clone key for inner and outer pads
  8435. var oKey = this._oKey = key.clone();
  8436. var iKey = this._iKey = key.clone();
  8437. // Shortcuts
  8438. var oKeyWords = oKey.words;
  8439. var iKeyWords = iKey.words;
  8440. // XOR keys with pad constants
  8441. for (var i = 0; i < hasherBlockSize; i++) {
  8442. oKeyWords[i] ^= 0x5c5c5c5c;
  8443. iKeyWords[i] ^= 0x36363636;
  8444. }
  8445. oKey.sigBytes = iKey.sigBytes = hasherBlockSizeBytes;
  8446. // Set initial values
  8447. this.reset();
  8448. },
  8449. /**
  8450. * Resets this HMAC to its initial state.
  8451. *
  8452. * @example
  8453. *
  8454. * hmacHasher.reset();
  8455. */
  8456. reset: function () {
  8457. // Shortcut
  8458. var hasher = this._hasher;
  8459. // Reset
  8460. hasher.reset();
  8461. hasher.update(this._iKey);
  8462. },
  8463. /**
  8464. * Updates this HMAC with a message.
  8465. *
  8466. * @param {WordArray|string} messageUpdate The message to append.
  8467. *
  8468. * @return {HMAC} This HMAC instance.
  8469. *
  8470. * @example
  8471. *
  8472. * hmacHasher.update('message');
  8473. * hmacHasher.update(wordArray);
  8474. */
  8475. update: function (messageUpdate) {
  8476. this._hasher.update(messageUpdate);
  8477. // Chainable
  8478. return this;
  8479. },
  8480. /**
  8481. * Finalizes the HMAC computation.
  8482. * Note that the finalize operation is effectively a destructive, read-once operation.
  8483. *
  8484. * @param {WordArray|string} messageUpdate (Optional) A final message update.
  8485. *
  8486. * @return {WordArray} The HMAC.
  8487. *
  8488. * @example
  8489. *
  8490. * var hmac = hmacHasher.finalize();
  8491. * var hmac = hmacHasher.finalize('message');
  8492. * var hmac = hmacHasher.finalize(wordArray);
  8493. */
  8494. finalize: function (messageUpdate) {
  8495. // Shortcut
  8496. var hasher = this._hasher;
  8497. // Compute HMAC
  8498. var innerHash = hasher.finalize(messageUpdate);
  8499. hasher.reset();
  8500. var hmac = hasher.finalize(this._oKey.clone().concat(innerHash));
  8501. return hmac;
  8502. }
  8503. });
  8504. }());
  8505. }));
  8506. /***/ }),
  8507. /* 107 */
  8508. /***/ (function(module, exports, __webpack_require__) {
  8509. /* WEBPACK VAR INJECTION */(function(Buffer) {// Generated by CoffeeScript 1.7.1
  8510. (function() {
  8511. var DecodeStream, iconv;
  8512. try {
  8513. iconv = __webpack_require__(108);
  8514. } catch (_error) {}
  8515. DecodeStream = (function() {
  8516. var key;
  8517. function DecodeStream(buffer) {
  8518. this.buffer = buffer;
  8519. this.pos = 0;
  8520. this.length = this.buffer.length;
  8521. }
  8522. DecodeStream.TYPES = {
  8523. UInt8: 1,
  8524. UInt16: 2,
  8525. UInt24: 3,
  8526. UInt32: 4,
  8527. Int8: 1,
  8528. Int16: 2,
  8529. Int24: 3,
  8530. Int32: 4,
  8531. Float: 4,
  8532. Double: 8
  8533. };
  8534. for (key in Buffer.prototype) {
  8535. if (key.slice(0, 4) === 'read') {
  8536. (function(key) {
  8537. var bytes;
  8538. bytes = DecodeStream.TYPES[key.replace(/read|[BL]E/g, '')];
  8539. return DecodeStream.prototype[key] = function() {
  8540. var ret;
  8541. ret = this.buffer[key](this.pos);
  8542. this.pos += bytes;
  8543. return ret;
  8544. };
  8545. })(key);
  8546. }
  8547. }
  8548. DecodeStream.prototype.readString = function(length, encoding) {
  8549. var buf, byte, i, _i, _ref;
  8550. if (encoding == null) {
  8551. encoding = 'ascii';
  8552. }
  8553. switch (encoding) {
  8554. case 'utf16le':
  8555. case 'ucs2':
  8556. case 'utf8':
  8557. case 'ascii':
  8558. return this.buffer.toString(encoding, this.pos, this.pos += length);
  8559. case 'utf16be':
  8560. buf = new Buffer(this.readBuffer(length));
  8561. for (i = _i = 0, _ref = buf.length - 1; _i < _ref; i = _i += 2) {
  8562. byte = buf[i];
  8563. buf[i] = buf[i + 1];
  8564. buf[i + 1] = byte;
  8565. }
  8566. return buf.toString('utf16le');
  8567. default:
  8568. buf = this.readBuffer(length);
  8569. if (iconv) {
  8570. try {
  8571. return iconv.decode(buf, encoding);
  8572. } catch (_error) {}
  8573. }
  8574. return buf;
  8575. }
  8576. };
  8577. DecodeStream.prototype.readBuffer = function(length) {
  8578. return this.buffer.slice(this.pos, this.pos += length);
  8579. };
  8580. DecodeStream.prototype.readUInt24BE = function() {
  8581. return (this.readUInt16BE() << 8) + this.readUInt8();
  8582. };
  8583. DecodeStream.prototype.readUInt24LE = function() {
  8584. return this.readUInt16LE() + (this.readUInt8() << 16);
  8585. };
  8586. DecodeStream.prototype.readInt24BE = function() {
  8587. return (this.readInt16BE() << 8) + this.readUInt8();
  8588. };
  8589. DecodeStream.prototype.readInt24LE = function() {
  8590. return this.readUInt16LE() + (this.readInt8() << 16);
  8591. };
  8592. return DecodeStream;
  8593. })();
  8594. module.exports = DecodeStream;
  8595. }).call(this);
  8596. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(4).Buffer))
  8597. /***/ }),
  8598. /* 108 */
  8599. /***/ (function(module, exports, __webpack_require__) {
  8600. "use strict";
  8601. /* WEBPACK VAR INJECTION */(function(process) {
  8602. // Some environments don't have global Buffer (e.g. React Native).
  8603. // Solution would be installing npm modules "buffer" and "stream" explicitly.
  8604. var Buffer = __webpack_require__(34).Buffer;
  8605. var bomHandling = __webpack_require__(304),
  8606. iconv = module.exports;
  8607. // All codecs and aliases are kept here, keyed by encoding name/alias.
  8608. // They are lazy loaded in `iconv.getCodec` from `encodings/index.js`.
  8609. iconv.encodings = null;
  8610. // Characters emitted in case of error.
  8611. iconv.defaultCharUnicode = '�';
  8612. iconv.defaultCharSingleByte = '?';
  8613. // Public API.
  8614. iconv.encode = function encode(str, encoding, options) {
  8615. str = "" + (str || ""); // Ensure string.
  8616. var encoder = iconv.getEncoder(encoding, options);
  8617. var res = encoder.write(str);
  8618. var trail = encoder.end();
  8619. return (trail && trail.length > 0) ? Buffer.concat([res, trail]) : res;
  8620. }
  8621. iconv.decode = function decode(buf, encoding, options) {
  8622. if (typeof buf === 'string') {
  8623. if (!iconv.skipDecodeWarning) {
  8624. console.error('Iconv-lite warning: decode()-ing strings is deprecated. Refer to https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding');
  8625. iconv.skipDecodeWarning = true;
  8626. }
  8627. buf = Buffer.from("" + (buf || ""), "binary"); // Ensure buffer.
  8628. }
  8629. var decoder = iconv.getDecoder(encoding, options);
  8630. var res = decoder.write(buf);
  8631. var trail = decoder.end();
  8632. return trail ? (res + trail) : res;
  8633. }
  8634. iconv.encodingExists = function encodingExists(enc) {
  8635. try {
  8636. iconv.getCodec(enc);
  8637. return true;
  8638. } catch (e) {
  8639. return false;
  8640. }
  8641. }
  8642. // Legacy aliases to convert functions
  8643. iconv.toEncoding = iconv.encode;
  8644. iconv.fromEncoding = iconv.decode;
  8645. // Search for a codec in iconv.encodings. Cache codec data in iconv._codecDataCache.
  8646. iconv._codecDataCache = {};
  8647. iconv.getCodec = function getCodec(encoding) {
  8648. if (!iconv.encodings)
  8649. iconv.encodings = __webpack_require__(305); // Lazy load all encoding definitions.
  8650. // Canonicalize encoding name: strip all non-alphanumeric chars and appended year.
  8651. var enc = iconv._canonicalizeEncoding(encoding);
  8652. // Traverse iconv.encodings to find actual codec.
  8653. var codecOptions = {};
  8654. while (true) {
  8655. var codec = iconv._codecDataCache[enc];
  8656. if (codec)
  8657. return codec;
  8658. var codecDef = iconv.encodings[enc];
  8659. switch (typeof codecDef) {
  8660. case "string": // Direct alias to other encoding.
  8661. enc = codecDef;
  8662. break;
  8663. case "object": // Alias with options. Can be layered.
  8664. for (var key in codecDef)
  8665. codecOptions[key] = codecDef[key];
  8666. if (!codecOptions.encodingName)
  8667. codecOptions.encodingName = enc;
  8668. enc = codecDef.type;
  8669. break;
  8670. case "function": // Codec itself.
  8671. if (!codecOptions.encodingName)
  8672. codecOptions.encodingName = enc;
  8673. // The codec function must load all tables and return object with .encoder and .decoder methods.
  8674. // It'll be called only once (for each different options object).
  8675. codec = new codecDef(codecOptions, iconv);
  8676. iconv._codecDataCache[codecOptions.encodingName] = codec; // Save it to be reused later.
  8677. return codec;
  8678. default:
  8679. throw new Error("Encoding not recognized: '" + encoding + "' (searched as: '"+enc+"')");
  8680. }
  8681. }
  8682. }
  8683. iconv._canonicalizeEncoding = function(encoding) {
  8684. // Canonicalize encoding name: strip all non-alphanumeric chars and appended year.
  8685. return (''+encoding).toLowerCase().replace(/:\d{4}$|[^0-9a-z]/g, "");
  8686. }
  8687. iconv.getEncoder = function getEncoder(encoding, options) {
  8688. var codec = iconv.getCodec(encoding),
  8689. encoder = new codec.encoder(options, codec);
  8690. if (codec.bomAware && options && options.addBOM)
  8691. encoder = new bomHandling.PrependBOM(encoder, options);
  8692. return encoder;
  8693. }
  8694. iconv.getDecoder = function getDecoder(encoding, options) {
  8695. var codec = iconv.getCodec(encoding),
  8696. decoder = new codec.decoder(options, codec);
  8697. if (codec.bomAware && !(options && options.stripBOM === false))
  8698. decoder = new bomHandling.StripBOM(decoder, options);
  8699. return decoder;
  8700. }
  8701. // Load extensions in Node. All of them are omitted in Browserify build via 'browser' field in package.json.
  8702. var nodeVer = typeof process !== 'undefined' && process.versions && process.versions.node;
  8703. if (nodeVer) {
  8704. // Load streaming support in Node v0.10+
  8705. var nodeVerArr = nodeVer.split(".").map(Number);
  8706. if (nodeVerArr[0] > 0 || nodeVerArr[1] >= 10) {
  8707. __webpack_require__(320)(iconv);
  8708. }
  8709. // Load Node primitive extensions.
  8710. __webpack_require__(321)(iconv);
  8711. }
  8712. if (false) {}
  8713. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(25)))
  8714. /***/ }),
  8715. /* 109 */
  8716. /***/ (function(module) {
  8717. module.exports = JSON.parse("[[\"0\",\"\\u0000\",127,\"€\"],[\"8140\",\"丂丄丅丆丏丒丗丟丠両丣並丩丮丯丱丳丵丷丼乀乁乂乄乆乊乑乕乗乚乛乢乣乤乥乧乨乪\",5,\"乲乴\",9,\"乿\",6,\"亇亊\"],[\"8180\",\"亐亖亗亙亜亝亞亣亪亯亰亱亴亶亷亸亹亼亽亾仈仌仏仐仒仚仛仜仠仢仦仧仩仭仮仯仱仴仸仹仺仼仾伀伂\",6,\"伋伌伒\",4,\"伜伝伡伣伨伩伬伭伮伱伳伵伷伹伻伾\",4,\"佄佅佇\",5,\"佒佔佖佡佢佦佨佪佫佭佮佱佲併佷佸佹佺佽侀侁侂侅來侇侊侌侎侐侒侓侕侖侘侙侚侜侞侟価侢\"],[\"8240\",\"侤侫侭侰\",4,\"侶\",8,\"俀俁係俆俇俈俉俋俌俍俒\",4,\"俙俛俠俢俤俥俧俫俬俰俲俴俵俶俷俹俻俼俽俿\",11],[\"8280\",\"個倎倐們倓倕倖倗倛倝倞倠倢倣値倧倫倯\",10,\"倻倽倿偀偁偂偄偅偆偉偊偋偍偐\",4,\"偖偗偘偙偛偝\",7,\"偦\",5,\"偭\",8,\"偸偹偺偼偽傁傂傃傄傆傇傉傊傋傌傎\",20,\"傤傦傪傫傭\",4,\"傳\",6,\"傼\"],[\"8340\",\"傽\",17,\"僐\",5,\"僗僘僙僛\",10,\"僨僩僪僫僯僰僱僲僴僶\",4,\"僼\",9,\"儈\"],[\"8380\",\"儉儊儌\",5,\"儓\",13,\"儢\",28,\"兂兇兊兌兎兏児兒兓兗兘兙兛兝\",4,\"兣兤兦內兩兪兯兲兺兾兿冃冄円冇冊冋冎冏冐冑冓冔冘冚冝冞冟冡冣冦\",4,\"冭冮冴冸冹冺冾冿凁凂凃凅凈凊凍凎凐凒\",5],[\"8440\",\"凘凙凚凜凞凟凢凣凥\",5,\"凬凮凱凲凴凷凾刄刅刉刋刌刏刐刓刔刕刜刞刟刡刢刣別刦刧刪刬刯刱刲刴刵刼刾剄\",5,\"剋剎剏剒剓剕剗剘\"],[\"8480\",\"剙剚剛剝剟剠剢剣剤剦剨剫剬剭剮剰剱剳\",9,\"剾劀劃\",4,\"劉\",6,\"劑劒劔\",6,\"劜劤劥劦劧劮劯劰労\",9,\"勀勁勂勄勅勆勈勊勌勍勎勏勑勓勔動勗務\",5,\"勠勡勢勣勥\",10,\"勱\",7,\"勻勼勽匁匂匃匄匇匉匊匋匌匎\"],[\"8540\",\"匑匒匓匔匘匛匜匞匟匢匤匥匧匨匩匫匬匭匯\",9,\"匼匽區卂卄卆卋卌卍卐協単卙卛卝卥卨卪卬卭卲卶卹卻卼卽卾厀厁厃厇厈厊厎厏\"],[\"8580\",\"厐\",4,\"厖厗厙厛厜厞厠厡厤厧厪厫厬厭厯\",6,\"厷厸厹厺厼厽厾叀參\",4,\"収叏叐叒叓叕叚叜叝叞叡叢叧叴叺叾叿吀吂吅吇吋吔吘吙吚吜吢吤吥吪吰吳吶吷吺吽吿呁呂呄呅呇呉呌呍呎呏呑呚呝\",4,\"呣呥呧呩\",7,\"呴呹呺呾呿咁咃咅咇咈咉咊咍咑咓咗咘咜咞咟咠咡\"],[\"8640\",\"咢咥咮咰咲咵咶咷咹咺咼咾哃哅哊哋哖哘哛哠\",4,\"哫哬哯哰哱哴\",5,\"哻哾唀唂唃唄唅唈唊\",4,\"唒唓唕\",5,\"唜唝唞唟唡唥唦\"],[\"8680\",\"唨唩唫唭唲唴唵唶唸唹唺唻唽啀啂啅啇啈啋\",4,\"啑啒啓啔啗\",4,\"啝啞啟啠啢啣啨啩啫啯\",5,\"啹啺啽啿喅喆喌喍喎喐喒喓喕喖喗喚喛喞喠\",6,\"喨\",8,\"喲喴営喸喺喼喿\",4,\"嗆嗇嗈嗊嗋嗎嗏嗐嗕嗗\",4,\"嗞嗠嗢嗧嗩嗭嗮嗰嗱嗴嗶嗸\",4,\"嗿嘂嘃嘄嘅\"],[\"8740\",\"嘆嘇嘊嘋嘍嘐\",7,\"嘙嘚嘜嘝嘠嘡嘢嘥嘦嘨嘩嘪嘫嘮嘯嘰嘳嘵嘷嘸嘺嘼嘽嘾噀\",11,\"噏\",4,\"噕噖噚噛噝\",4],[\"8780\",\"噣噥噦噧噭噮噯噰噲噳噴噵噷噸噹噺噽\",7,\"嚇\",6,\"嚐嚑嚒嚔\",14,\"嚤\",10,\"嚰\",6,\"嚸嚹嚺嚻嚽\",12,\"囋\",8,\"囕囖囘囙囜団囥\",5,\"囬囮囯囲図囶囷囸囻囼圀圁圂圅圇國\",6],[\"8840\",\"園\",9,\"圝圞圠圡圢圤圥圦圧圫圱圲圴\",4,\"圼圽圿坁坃坄坅坆坈坉坋坒\",4,\"坘坙坢坣坥坧坬坮坰坱坲坴坵坸坹坺坽坾坿垀\"],[\"8880\",\"垁垇垈垉垊垍\",4,\"垔\",6,\"垜垝垞垟垥垨垪垬垯垰垱垳垵垶垷垹\",8,\"埄\",6,\"埌埍埐埑埓埖埗埛埜埞埡埢埣埥\",7,\"埮埰埱埲埳埵埶執埻埼埾埿堁堃堄堅堈堉堊堌堎堏堐堒堓堔堖堗堘堚堛堜堝堟堢堣堥\",4,\"堫\",4,\"報堲堳場堶\",7],[\"8940\",\"堾\",5,\"塅\",6,\"塎塏塐塒塓塕塖塗塙\",4,\"塟\",5,\"塦\",4,\"塭\",16,\"塿墂墄墆墇墈墊墋墌\"],[\"8980\",\"墍\",4,\"墔\",4,\"墛墜墝墠\",7,\"墪\",17,\"墽墾墿壀壂壃壄壆\",10,\"壒壓壔壖\",13,\"壥\",5,\"壭壯壱売壴壵壷壸壺\",7,\"夃夅夆夈\",4,\"夎夐夑夒夓夗夘夛夝夞夠夡夢夣夦夨夬夰夲夳夵夶夻\"],[\"8a40\",\"夽夾夿奀奃奅奆奊奌奍奐奒奓奙奛\",4,\"奡奣奤奦\",12,\"奵奷奺奻奼奾奿妀妅妉妋妌妎妏妐妑妔妕妘妚妛妜妝妟妠妡妢妦\"],[\"8a80\",\"妧妬妭妰妱妳\",5,\"妺妼妽妿\",6,\"姇姈姉姌姍姎姏姕姖姙姛姞\",4,\"姤姦姧姩姪姫姭\",11,\"姺姼姽姾娀娂娊娋娍娎娏娐娒娔娕娖娗娙娚娛娝娞娡娢娤娦娧娨娪\",6,\"娳娵娷\",4,\"娽娾娿婁\",4,\"婇婈婋\",9,\"婖婗婘婙婛\",5],[\"8b40\",\"婡婣婤婥婦婨婩婫\",8,\"婸婹婻婼婽婾媀\",17,\"媓\",6,\"媜\",13,\"媫媬\"],[\"8b80\",\"媭\",4,\"媴媶媷媹\",4,\"媿嫀嫃\",5,\"嫊嫋嫍\",4,\"嫓嫕嫗嫙嫚嫛嫝嫞嫟嫢嫤嫥嫧嫨嫪嫬\",4,\"嫲\",22,\"嬊\",11,\"嬘\",25,\"嬳嬵嬶嬸\",7,\"孁\",6],[\"8c40\",\"孈\",7,\"孒孖孞孠孡孧孨孫孭孮孯孲孴孶孷學孹孻孼孾孿宂宆宊宍宎宐宑宒宔宖実宧宨宩宬宭宮宯宱宲宷宺宻宼寀寁寃寈寉寊寋寍寎寏\"],[\"8c80\",\"寑寔\",8,\"寠寢寣實寧審\",4,\"寯寱\",6,\"寽対尀専尃尅將專尋尌對導尐尒尓尗尙尛尞尟尠尡尣尦尨尩尪尫尭尮尯尰尲尳尵尶尷屃屄屆屇屌屍屒屓屔屖屗屘屚屛屜屝屟屢層屧\",6,\"屰屲\",6,\"屻屼屽屾岀岃\",4,\"岉岊岋岎岏岒岓岕岝\",4,\"岤\",4],[\"8d40\",\"岪岮岯岰岲岴岶岹岺岻岼岾峀峂峃峅\",5,\"峌\",5,\"峓\",5,\"峚\",6,\"峢峣峧峩峫峬峮峯峱\",9,\"峼\",4],[\"8d80\",\"崁崄崅崈\",5,\"崏\",4,\"崕崗崘崙崚崜崝崟\",4,\"崥崨崪崫崬崯\",4,\"崵\",7,\"崿\",7,\"嵈嵉嵍\",10,\"嵙嵚嵜嵞\",10,\"嵪嵭嵮嵰嵱嵲嵳嵵\",12,\"嶃\",21,\"嶚嶛嶜嶞嶟嶠\"],[\"8e40\",\"嶡\",21,\"嶸\",12,\"巆\",6,\"巎\",12,\"巜巟巠巣巤巪巬巭\"],[\"8e80\",\"巰巵巶巸\",4,\"巿帀帄帇帉帊帋帍帎帒帓帗帞\",7,\"帨\",4,\"帯帰帲\",4,\"帹帺帾帿幀幁幃幆\",5,\"幍\",6,\"幖\",4,\"幜幝幟幠幣\",14,\"幵幷幹幾庁庂広庅庈庉庌庍庎庒庘庛庝庡庢庣庤庨\",4,\"庮\",4,\"庴庺庻庼庽庿\",6],[\"8f40\",\"廆廇廈廋\",5,\"廔廕廗廘廙廚廜\",11,\"廩廫\",8,\"廵廸廹廻廼廽弅弆弇弉弌弍弎弐弒弔弖弙弚弜弝弞弡弢弣弤\"],[\"8f80\",\"弨弫弬弮弰弲\",6,\"弻弽弾弿彁\",14,\"彑彔彙彚彛彜彞彟彠彣彥彧彨彫彮彯彲彴彵彶彸彺彽彾彿徃徆徍徎徏徑従徔徖徚徛徝從徟徠徢\",5,\"復徫徬徯\",5,\"徶徸徹徺徻徾\",4,\"忇忈忊忋忎忓忔忕忚忛応忞忟忢忣忥忦忨忩忬忯忰忲忳忴忶忷忹忺忼怇\"],[\"9040\",\"怈怉怋怌怐怑怓怗怘怚怞怟怢怣怤怬怭怮怰\",4,\"怶\",4,\"怽怾恀恄\",6,\"恌恎恏恑恓恔恖恗恘恛恜恞恟恠恡恥恦恮恱恲恴恵恷恾悀\"],[\"9080\",\"悁悂悅悆悇悈悊悋悎悏悐悑悓悕悗悘悙悜悞悡悢悤悥悧悩悪悮悰悳悵悶悷悹悺悽\",7,\"惇惈惉惌\",4,\"惒惓惔惖惗惙惛惞惡\",4,\"惪惱惲惵惷惸惻\",4,\"愂愃愄愅愇愊愋愌愐\",4,\"愖愗愘愙愛愜愝愞愡愢愥愨愩愪愬\",18,\"慀\",6],[\"9140\",\"慇慉態慍慏慐慒慓慔慖\",6,\"慞慟慠慡慣慤慥慦慩\",6,\"慱慲慳慴慶慸\",18,\"憌憍憏\",4,\"憕\"],[\"9180\",\"憖\",6,\"憞\",8,\"憪憫憭\",9,\"憸\",5,\"憿懀懁懃\",4,\"應懌\",4,\"懓懕\",16,\"懧\",13,\"懶\",8,\"戀\",5,\"戇戉戓戔戙戜戝戞戠戣戦戧戨戩戫戭戯戰戱戲戵戶戸\",4,\"扂扄扅扆扊\"],[\"9240\",\"扏扐払扖扗扙扚扜\",6,\"扤扥扨扱扲扴扵扷扸扺扻扽抁抂抃抅抆抇抈抋\",5,\"抔抙抜抝択抣抦抧抩抪抭抮抯抰抲抳抴抶抷抸抺抾拀拁\"],[\"9280\",\"拃拋拏拑拕拝拞拠拡拤拪拫拰拲拵拸拹拺拻挀挃挄挅挆挊挋挌挍挏挐挒挓挔挕挗挘挙挜挦挧挩挬挭挮挰挱挳\",5,\"挻挼挾挿捀捁捄捇捈捊捑捒捓捔捖\",7,\"捠捤捥捦捨捪捫捬捯捰捲捳捴捵捸捹捼捽捾捿掁掃掄掅掆掋掍掑掓掔掕掗掙\",6,\"採掤掦掫掯掱掲掵掶掹掻掽掿揀\"],[\"9340\",\"揁揂揃揅揇揈揊揋揌揑揓揔揕揗\",6,\"揟揢揤\",4,\"揫揬揮揯揰揱揳揵揷揹揺揻揼揾搃搄搆\",4,\"損搎搑搒搕\",5,\"搝搟搢搣搤\"],[\"9380\",\"搥搧搨搩搫搮\",5,\"搵\",4,\"搻搼搾摀摂摃摉摋\",6,\"摓摕摖摗摙\",4,\"摟\",7,\"摨摪摫摬摮\",9,\"摻\",6,\"撃撆撈\",8,\"撓撔撗撘撚撛撜撝撟\",4,\"撥撦撧撨撪撫撯撱撲撳撴撶撹撻撽撾撿擁擃擄擆\",6,\"擏擑擓擔擕擖擙據\"],[\"9440\",\"擛擜擝擟擠擡擣擥擧\",24,\"攁\",7,\"攊\",7,\"攓\",4,\"攙\",8],[\"9480\",\"攢攣攤攦\",4,\"攬攭攰攱攲攳攷攺攼攽敀\",4,\"敆敇敊敋敍敎敐敒敓敔敗敘敚敜敟敠敡敤敥敧敨敩敪敭敮敯敱敳敵敶數\",14,\"斈斉斊斍斎斏斒斔斕斖斘斚斝斞斠斢斣斦斨斪斬斮斱\",7,\"斺斻斾斿旀旂旇旈旉旊旍旐旑旓旔旕旘\",7,\"旡旣旤旪旫\"],[\"9540\",\"旲旳旴旵旸旹旻\",4,\"昁昄昅昇昈昉昋昍昐昑昒昖昗昘昚昛昜昞昡昢昣昤昦昩昪昫昬昮昰昲昳昷\",4,\"昽昿晀時晄\",6,\"晍晎晐晑晘\"],[\"9580\",\"晙晛晜晝晞晠晢晣晥晧晩\",4,\"晱晲晳晵晸晹晻晼晽晿暀暁暃暅暆暈暉暊暋暍暎暏暐暒暓暔暕暘\",4,\"暞\",8,\"暩\",4,\"暯\",4,\"暵暶暷暸暺暻暼暽暿\",25,\"曚曞\",7,\"曧曨曪\",5,\"曱曵曶書曺曻曽朁朂會\"],[\"9640\",\"朄朅朆朇朌朎朏朑朒朓朖朘朙朚朜朞朠\",5,\"朧朩朮朰朲朳朶朷朸朹朻朼朾朿杁杄杅杇杊杋杍杒杔杕杗\",4,\"杝杢杣杤杦杧杫杬杮東杴杶\"],[\"9680\",\"杸杹杺杻杽枀枂枃枅枆枈枊枌枍枎枏枑枒枓枔枖枙枛枟枠枡枤枦枩枬枮枱枲枴枹\",7,\"柂柅\",9,\"柕柖柗柛柟柡柣柤柦柧柨柪柫柭柮柲柵\",7,\"柾栁栂栃栄栆栍栐栒栔栕栘\",4,\"栞栟栠栢\",6,\"栫\",6,\"栴栵栶栺栻栿桇桋桍桏桒桖\",5],[\"9740\",\"桜桝桞桟桪桬\",7,\"桵桸\",8,\"梂梄梇\",7,\"梐梑梒梔梕梖梘\",9,\"梣梤梥梩梪梫梬梮梱梲梴梶梷梸\"],[\"9780\",\"梹\",6,\"棁棃\",5,\"棊棌棎棏棐棑棓棔棖棗棙棛\",4,\"棡棢棤\",9,\"棯棲棳棴棶棷棸棻棽棾棿椀椂椃椄椆\",4,\"椌椏椑椓\",11,\"椡椢椣椥\",7,\"椮椯椱椲椳椵椶椷椸椺椻椼椾楀楁楃\",16,\"楕楖楘楙楛楜楟\"],[\"9840\",\"楡楢楤楥楧楨楩楪楬業楯楰楲\",4,\"楺楻楽楾楿榁榃榅榊榋榌榎\",5,\"榖榗榙榚榝\",9,\"榩榪榬榮榯榰榲榳榵榶榸榹榺榼榽\"],[\"9880\",\"榾榿槀槂\",7,\"構槍槏槑槒槓槕\",5,\"槜槝槞槡\",11,\"槮槯槰槱槳\",9,\"槾樀\",9,\"樋\",11,\"標\",5,\"樠樢\",5,\"権樫樬樭樮樰樲樳樴樶\",6,\"樿\",4,\"橅橆橈\",7,\"橑\",6,\"橚\"],[\"9940\",\"橜\",4,\"橢橣橤橦\",10,\"橲\",6,\"橺橻橽橾橿檁檂檃檅\",8,\"檏檒\",4,\"檘\",7,\"檡\",5],[\"9980\",\"檧檨檪檭\",114,\"欥欦欨\",6],[\"9a40\",\"欯欰欱欳欴欵欶欸欻欼欽欿歀歁歂歄歅歈歊歋歍\",11,\"歚\",7,\"歨歩歫\",13,\"歺歽歾歿殀殅殈\"],[\"9a80\",\"殌殎殏殐殑殔殕殗殘殙殜\",4,\"殢\",7,\"殫\",7,\"殶殸\",6,\"毀毃毄毆\",4,\"毌毎毐毑毘毚毜\",4,\"毢\",7,\"毬毭毮毰毱毲毴毶毷毸毺毻毼毾\",6,\"氈\",4,\"氎氒気氜氝氞氠氣氥氫氬氭氱氳氶氷氹氺氻氼氾氿汃汄汅汈汋\",4,\"汑汒汓汖汘\"],[\"9b40\",\"汙汚汢汣汥汦汧汫\",4,\"汱汳汵汷汸決汻汼汿沀沄沇沊沋沍沎沑沒沕沖沗沘沚沜沝沞沠沢沨沬沯沰沴沵沶沷沺泀況泂泃泆泇泈泋泍泎泏泑泒泘\"],[\"9b80\",\"泙泚泜泝泟泤泦泧泩泬泭泲泴泹泿洀洂洃洅洆洈洉洊洍洏洐洑洓洔洕洖洘洜洝洟\",5,\"洦洨洩洬洭洯洰洴洶洷洸洺洿浀浂浄浉浌浐浕浖浗浘浛浝浟浡浢浤浥浧浨浫浬浭浰浱浲浳浵浶浹浺浻浽\",4,\"涃涄涆涇涊涋涍涏涐涒涖\",4,\"涜涢涥涬涭涰涱涳涴涶涷涹\",5,\"淁淂淃淈淉淊\"],[\"9c40\",\"淍淎淏淐淒淓淔淕淗淚淛淜淟淢淣淥淧淨淩淪淭淯淰淲淴淵淶淸淺淽\",7,\"渆渇済渉渋渏渒渓渕渘渙減渜渞渟渢渦渧渨渪測渮渰渱渳渵\"],[\"9c80\",\"渶渷渹渻\",7,\"湅\",7,\"湏湐湑湒湕湗湙湚湜湝湞湠\",10,\"湬湭湯\",14,\"満溁溂溄溇溈溊\",4,\"溑\",6,\"溙溚溛溝溞溠溡溣溤溦溨溩溫溬溭溮溰溳溵溸溹溼溾溿滀滃滄滅滆滈滉滊滌滍滎滐滒滖滘滙滛滜滝滣滧滪\",5],[\"9d40\",\"滰滱滲滳滵滶滷滸滺\",7,\"漃漄漅漇漈漊\",4,\"漐漑漒漖\",9,\"漡漢漣漥漦漧漨漬漮漰漲漴漵漷\",6,\"漿潀潁潂\"],[\"9d80\",\"潃潄潅潈潉潊潌潎\",9,\"潙潚潛潝潟潠潡潣潤潥潧\",5,\"潯潰潱潳潵潶潷潹潻潽\",6,\"澅澆澇澊澋澏\",12,\"澝澞澟澠澢\",4,\"澨\",10,\"澴澵澷澸澺\",5,\"濁濃\",5,\"濊\",6,\"濓\",10,\"濟濢濣濤濥\"],[\"9e40\",\"濦\",7,\"濰\",32,\"瀒\",7,\"瀜\",6,\"瀤\",6],[\"9e80\",\"瀫\",9,\"瀶瀷瀸瀺\",17,\"灍灎灐\",13,\"灟\",11,\"灮灱灲灳灴灷灹灺灻災炁炂炃炄炆炇炈炋炌炍炏炐炑炓炗炘炚炛炞\",12,\"炰炲炴炵炶為炾炿烄烅烆烇烉烋\",12,\"烚\"],[\"9f40\",\"烜烝烞烠烡烢烣烥烪烮烰\",6,\"烸烺烻烼烾\",10,\"焋\",4,\"焑焒焔焗焛\",10,\"焧\",7,\"焲焳焴\"],[\"9f80\",\"焵焷\",13,\"煆煇煈煉煋煍煏\",12,\"煝煟\",4,\"煥煩\",4,\"煯煰煱煴煵煶煷煹煻煼煾\",5,\"熅\",4,\"熋熌熍熎熐熑熒熓熕熖熗熚\",4,\"熡\",6,\"熩熪熫熭\",5,\"熴熶熷熸熺\",8,\"燄\",9,\"燏\",4],[\"a040\",\"燖\",9,\"燡燢燣燤燦燨\",5,\"燯\",9,\"燺\",11,\"爇\",19],[\"a080\",\"爛爜爞\",9,\"爩爫爭爮爯爲爳爴爺爼爾牀\",6,\"牉牊牋牎牏牐牑牓牔牕牗牘牚牜牞牠牣牤牥牨牪牫牬牭牰牱牳牴牶牷牸牻牼牽犂犃犅\",4,\"犌犎犐犑犓\",11,\"犠\",11,\"犮犱犲犳犵犺\",6,\"狅狆狇狉狊狋狌狏狑狓狔狕狖狘狚狛\"],[\"a1a1\",\" 、。·ˉˇ¨〃々—~‖…‘’“”〔〕〈\",7,\"〖〗【】±×÷∶∧∨∑∏∪∩∈∷√⊥∥∠⌒⊙∫∮≡≌≈∽∝≠≮≯≤≥∞∵∴♂♀°′″℃$¤¢£‰§№☆★○●◎◇◆□■△▲※→←↑↓〓\"],[\"a2a1\",\"ⅰ\",9],[\"a2b1\",\"⒈\",19,\"⑴\",19,\"①\",9],[\"a2e5\",\"㈠\",9],[\"a2f1\",\"Ⅰ\",11],[\"a3a1\",\"!"#¥%\",88,\" ̄\"],[\"a4a1\",\"ぁ\",82],[\"a5a1\",\"ァ\",85],[\"a6a1\",\"Α\",16,\"Σ\",6],[\"a6c1\",\"α\",16,\"σ\",6],[\"a6e0\",\"︵︶︹︺︿﹀︽︾﹁﹂﹃﹄\"],[\"a6ee\",\"︻︼︷︸︱\"],[\"a6f4\",\"︳︴\"],[\"a7a1\",\"А\",5,\"ЁЖ\",25],[\"a7d1\",\"а\",5,\"ёж\",25],[\"a840\",\"ˊˋ˙–―‥‵℅℉↖↗↘↙∕∟∣≒≦≧⊿═\",35,\"▁\",6],[\"a880\",\"█\",7,\"▓▔▕▼▽◢◣◤◥☉⊕〒〝〞\"],[\"a8a1\",\"āáǎàēéěèīíǐìōóǒòūúǔùǖǘǚǜüêɑ\"],[\"a8bd\",\"ńň\"],[\"a8c0\",\"ɡ\"],[\"a8c5\",\"ㄅ\",36],[\"a940\",\"〡\",8,\"㊣㎎㎏㎜㎝㎞㎡㏄㏎㏑㏒㏕︰¬¦\"],[\"a959\",\"℡㈱\"],[\"a95c\",\"‐\"],[\"a960\",\"ー゛゜ヽヾ〆ゝゞ﹉\",9,\"﹔﹕﹖﹗﹙\",8],[\"a980\",\"﹢\",4,\"﹨﹩﹪﹫\"],[\"a996\",\"〇\"],[\"a9a4\",\"─\",75],[\"aa40\",\"狜狝狟狢\",5,\"狪狫狵狶狹狽狾狿猀猂猄\",5,\"猋猌猍猏猐猑猒猔猘猙猚猟猠猣猤猦猧猨猭猯猰猲猳猵猶猺猻猼猽獀\",8],[\"aa80\",\"獉獊獋獌獎獏獑獓獔獕獖獘\",7,\"獡\",10,\"獮獰獱\"],[\"ab40\",\"獲\",11,\"獿\",4,\"玅玆玈玊玌玍玏玐玒玓玔玕玗玘玙玚玜玝玞玠玡玣\",5,\"玪玬玭玱玴玵玶玸玹玼玽玾玿珁珃\",4],[\"ab80\",\"珋珌珎珒\",6,\"珚珛珜珝珟珡珢珣珤珦珨珪珫珬珮珯珰珱珳\",4],[\"ac40\",\"珸\",10,\"琄琇琈琋琌琍琎琑\",8,\"琜\",5,\"琣琤琧琩琫琭琯琱琲琷\",4,\"琽琾琿瑀瑂\",11],[\"ac80\",\"瑎\",6,\"瑖瑘瑝瑠\",12,\"瑮瑯瑱\",4,\"瑸瑹瑺\"],[\"ad40\",\"瑻瑼瑽瑿璂璄璅璆璈璉璊璌璍璏璑\",10,\"璝璟\",7,\"璪\",15,\"璻\",12],[\"ad80\",\"瓈\",9,\"瓓\",8,\"瓝瓟瓡瓥瓧\",6,\"瓰瓱瓲\"],[\"ae40\",\"瓳瓵瓸\",6,\"甀甁甂甃甅\",7,\"甎甐甒甔甕甖甗甛甝甞甠\",4,\"甦甧甪甮甴甶甹甼甽甿畁畂畃畄畆畇畉畊畍畐畑畒畓畕畖畗畘\"],[\"ae80\",\"畝\",7,\"畧畨畩畫\",6,\"畳畵當畷畺\",4,\"疀疁疂疄疅疇\"],[\"af40\",\"疈疉疊疌疍疎疐疓疕疘疛疜疞疢疦\",4,\"疭疶疷疺疻疿痀痁痆痋痌痎痏痐痑痓痗痙痚痜痝痟痠痡痥痩痬痭痮痯痲痳痵痶痷痸痺痻痽痾瘂瘄瘆瘇\"],[\"af80\",\"瘈瘉瘋瘍瘎瘏瘑瘒瘓瘔瘖瘚瘜瘝瘞瘡瘣瘧瘨瘬瘮瘯瘱瘲瘶瘷瘹瘺瘻瘽癁療癄\"],[\"b040\",\"癅\",6,\"癎\",5,\"癕癗\",4,\"癝癟癠癡癢癤\",6,\"癬癭癮癰\",7,\"癹発發癿皀皁皃皅皉皊皌皍皏皐皒皔皕皗皘皚皛\"],[\"b080\",\"皜\",7,\"皥\",8,\"皯皰皳皵\",9,\"盀盁盃啊阿埃挨哎唉哀皑癌蔼矮艾碍爱隘鞍氨安俺按暗岸胺案肮昂盎凹敖熬翱袄傲奥懊澳芭捌扒叭吧笆八疤巴拔跋靶把耙坝霸罢爸白柏百摆佰败拜稗斑班搬扳般颁板版扮拌伴瓣半办绊邦帮梆榜膀绑棒磅蚌镑傍谤苞胞包褒剥\"],[\"b140\",\"盄盇盉盋盌盓盕盙盚盜盝盞盠\",4,\"盦\",7,\"盰盳盵盶盷盺盻盽盿眀眂眃眅眆眊県眎\",10,\"眛眜眝眞眡眣眤眥眧眪眫\"],[\"b180\",\"眬眮眰\",4,\"眹眻眽眾眿睂睄睅睆睈\",7,\"睒\",7,\"睜薄雹保堡饱宝抱报暴豹鲍爆杯碑悲卑北辈背贝钡倍狈备惫焙被奔苯本笨崩绷甭泵蹦迸逼鼻比鄙笔彼碧蓖蔽毕毙毖币庇痹闭敝弊必辟壁臂避陛鞭边编贬扁便变卞辨辩辫遍标彪膘表鳖憋别瘪彬斌濒滨宾摈兵冰柄丙秉饼炳\"],[\"b240\",\"睝睞睟睠睤睧睩睪睭\",11,\"睺睻睼瞁瞂瞃瞆\",5,\"瞏瞐瞓\",11,\"瞡瞣瞤瞦瞨瞫瞭瞮瞯瞱瞲瞴瞶\",4],[\"b280\",\"瞼瞾矀\",12,\"矎\",8,\"矘矙矚矝\",4,\"矤病并玻菠播拨钵波博勃搏铂箔伯帛舶脖膊渤泊驳捕卜哺补埠不布步簿部怖擦猜裁材才财睬踩采彩菜蔡餐参蚕残惭惨灿苍舱仓沧藏操糙槽曹草厕策侧册测层蹭插叉茬茶查碴搽察岔差诧拆柴豺搀掺蝉馋谗缠铲产阐颤昌猖\"],[\"b340\",\"矦矨矪矯矰矱矲矴矵矷矹矺矻矼砃\",5,\"砊砋砎砏砐砓砕砙砛砞砠砡砢砤砨砪砫砮砯砱砲砳砵砶砽砿硁硂硃硄硆硈硉硊硋硍硏硑硓硔硘硙硚\"],[\"b380\",\"硛硜硞\",11,\"硯\",7,\"硸硹硺硻硽\",6,\"场尝常长偿肠厂敞畅唱倡超抄钞朝嘲潮巢吵炒车扯撤掣彻澈郴臣辰尘晨忱沉陈趁衬撑称城橙成呈乘程惩澄诚承逞骋秤吃痴持匙池迟弛驰耻齿侈尺赤翅斥炽充冲虫崇宠抽酬畴踌稠愁筹仇绸瞅丑臭初出橱厨躇锄雏滁除楚\"],[\"b440\",\"碄碅碆碈碊碋碏碐碒碔碕碖碙碝碞碠碢碤碦碨\",7,\"碵碶碷碸確碻碼碽碿磀磂磃磄磆磇磈磌磍磎磏磑磒磓磖磗磘磚\",9],[\"b480\",\"磤磥磦磧磩磪磫磭\",4,\"磳磵磶磸磹磻\",5,\"礂礃礄礆\",6,\"础储矗搐触处揣川穿椽传船喘串疮窗幢床闯创吹炊捶锤垂春椿醇唇淳纯蠢戳绰疵茨磁雌辞慈瓷词此刺赐次聪葱囱匆从丛凑粗醋簇促蹿篡窜摧崔催脆瘁粹淬翠村存寸磋撮搓措挫错搭达答瘩打大呆歹傣戴带殆代贷袋待逮\"],[\"b540\",\"礍\",5,\"礔\",9,\"礟\",4,\"礥\",14,\"礵\",4,\"礽礿祂祃祄祅祇祊\",8,\"祔祕祘祙祡祣\"],[\"b580\",\"祤祦祩祪祫祬祮祰\",6,\"祹祻\",4,\"禂禃禆禇禈禉禋禌禍禎禐禑禒怠耽担丹单郸掸胆旦氮但惮淡诞弹蛋当挡党荡档刀捣蹈倒岛祷导到稻悼道盗德得的蹬灯登等瞪凳邓堤低滴迪敌笛狄涤翟嫡抵底地蒂第帝弟递缔颠掂滇碘点典靛垫电佃甸店惦奠淀殿碉叼雕凋刁掉吊钓调跌爹碟蝶迭谍叠\"],[\"b640\",\"禓\",6,\"禛\",11,\"禨\",10,\"禴\",4,\"禼禿秂秄秅秇秈秊秌秎秏秐秓秔秖秗秙\",5,\"秠秡秢秥秨秪\"],[\"b680\",\"秬秮秱\",6,\"秹秺秼秾秿稁稄稅稇稈稉稊稌稏\",4,\"稕稖稘稙稛稜丁盯叮钉顶鼎锭定订丢东冬董懂动栋侗恫冻洞兜抖斗陡豆逗痘都督毒犊独读堵睹赌杜镀肚度渡妒端短锻段断缎堆兑队对墩吨蹲敦顿囤钝盾遁掇哆多夺垛躲朵跺舵剁惰堕蛾峨鹅俄额讹娥恶厄扼遏鄂饿恩而儿耳尔饵洱二\"],[\"b740\",\"稝稟稡稢稤\",14,\"稴稵稶稸稺稾穀\",5,\"穇\",9,\"穒\",4,\"穘\",16],[\"b780\",\"穩\",6,\"穱穲穳穵穻穼穽穾窂窅窇窉窊窋窌窎窏窐窓窔窙窚窛窞窡窢贰发罚筏伐乏阀法珐藩帆番翻樊矾钒繁凡烦反返范贩犯饭泛坊芳方肪房防妨仿访纺放菲非啡飞肥匪诽吠肺废沸费芬酚吩氛分纷坟焚汾粉奋份忿愤粪丰封枫蜂峰锋风疯烽逢冯缝讽奉凤佛否夫敷肤孵扶拂辐幅氟符伏俘服\"],[\"b840\",\"窣窤窧窩窪窫窮\",4,\"窴\",10,\"竀\",10,\"竌\",9,\"竗竘竚竛竜竝竡竢竤竧\",5,\"竮竰竱竲竳\"],[\"b880\",\"竴\",4,\"竻竼竾笀笁笂笅笇笉笌笍笎笐笒笓笖笗笘笚笜笝笟笡笢笣笧笩笭浮涪福袱弗甫抚辅俯釜斧脯腑府腐赴副覆赋复傅付阜父腹负富讣附妇缚咐噶嘎该改概钙盖溉干甘杆柑竿肝赶感秆敢赣冈刚钢缸肛纲岗港杠篙皋高膏羔糕搞镐稿告哥歌搁戈鸽胳疙割革葛格蛤阁隔铬个各给根跟耕更庚羹\"],[\"b940\",\"笯笰笲笴笵笶笷笹笻笽笿\",5,\"筆筈筊筍筎筓筕筗筙筜筞筟筡筣\",10,\"筯筰筳筴筶筸筺筼筽筿箁箂箃箄箆\",6,\"箎箏\"],[\"b980\",\"箑箒箓箖箘箙箚箛箞箟箠箣箤箥箮箯箰箲箳箵箶箷箹\",7,\"篂篃範埂耿梗工攻功恭龚供躬公宫弓巩汞拱贡共钩勾沟苟狗垢构购够辜菇咕箍估沽孤姑鼓古蛊骨谷股故顾固雇刮瓜剐寡挂褂乖拐怪棺关官冠观管馆罐惯灌贯光广逛瑰规圭硅归龟闺轨鬼诡癸桂柜跪贵刽辊滚棍锅郭国果裹过哈\"],[\"ba40\",\"篅篈築篊篋篍篎篏篐篒篔\",4,\"篛篜篞篟篠篢篣篤篧篨篩篫篬篭篯篰篲\",4,\"篸篹篺篻篽篿\",7,\"簈簉簊簍簎簐\",5,\"簗簘簙\"],[\"ba80\",\"簚\",4,\"簠\",5,\"簨簩簫\",12,\"簹\",5,\"籂骸孩海氦亥害骇酣憨邯韩含涵寒函喊罕翰撼捍旱憾悍焊汗汉夯杭航壕嚎豪毫郝好耗号浩呵喝荷菏核禾和何合盒貉阂河涸赫褐鹤贺嘿黑痕很狠恨哼亨横衡恒轰哄烘虹鸿洪宏弘红喉侯猴吼厚候后呼乎忽瑚壶葫胡蝴狐糊湖\"],[\"bb40\",\"籃\",9,\"籎\",36,\"籵\",5,\"籾\",9],[\"bb80\",\"粈粊\",6,\"粓粔粖粙粚粛粠粡粣粦粧粨粩粫粬粭粯粰粴\",4,\"粺粻弧虎唬护互沪户花哗华猾滑画划化话槐徊怀淮坏欢环桓还缓换患唤痪豢焕涣宦幻荒慌黄磺蝗簧皇凰惶煌晃幌恍谎灰挥辉徽恢蛔回毁悔慧卉惠晦贿秽会烩汇讳诲绘荤昏婚魂浑混豁活伙火获或惑霍货祸击圾基机畸稽积箕\"],[\"bc40\",\"粿糀糂糃糄糆糉糋糎\",6,\"糘糚糛糝糞糡\",6,\"糩\",5,\"糰\",7,\"糹糺糼\",13,\"紋\",5],[\"bc80\",\"紑\",14,\"紡紣紤紥紦紨紩紪紬紭紮細\",6,\"肌饥迹激讥鸡姬绩缉吉极棘辑籍集及急疾汲即嫉级挤几脊己蓟技冀季伎祭剂悸济寄寂计记既忌际妓继纪嘉枷夹佳家加荚颊贾甲钾假稼价架驾嫁歼监坚尖笺间煎兼肩艰奸缄茧检柬碱硷拣捡简俭剪减荐槛鉴践贱见键箭件\"],[\"bd40\",\"紷\",54,\"絯\",7],[\"bd80\",\"絸\",32,\"健舰剑饯渐溅涧建僵姜将浆江疆蒋桨奖讲匠酱降蕉椒礁焦胶交郊浇骄娇嚼搅铰矫侥脚狡角饺缴绞剿教酵轿较叫窖揭接皆秸街阶截劫节桔杰捷睫竭洁结解姐戒藉芥界借介疥诫届巾筋斤金今津襟紧锦仅谨进靳晋禁近烬浸\"],[\"be40\",\"継\",12,\"綧\",6,\"綯\",42],[\"be80\",\"線\",32,\"尽劲荆兢茎睛晶鲸京惊精粳经井警景颈静境敬镜径痉靖竟竞净炯窘揪究纠玖韭久灸九酒厩救旧臼舅咎就疚鞠拘狙疽居驹菊局咀矩举沮聚拒据巨具距踞锯俱句惧炬剧捐鹃娟倦眷卷绢撅攫抉掘倔爵觉决诀绝均菌钧军君峻\"],[\"bf40\",\"緻\",62],[\"bf80\",\"縺縼\",4,\"繂\",4,\"繈\",21,\"俊竣浚郡骏喀咖卡咯开揩楷凯慨刊堪勘坎砍看康慷糠扛抗亢炕考拷烤靠坷苛柯棵磕颗科壳咳可渴克刻客课肯啃垦恳坑吭空恐孔控抠口扣寇枯哭窟苦酷库裤夸垮挎跨胯块筷侩快宽款匡筐狂框矿眶旷况亏盔岿窥葵奎魁傀\"],[\"c040\",\"繞\",35,\"纃\",23,\"纜纝纞\"],[\"c080\",\"纮纴纻纼绖绤绬绹缊缐缞缷缹缻\",6,\"罃罆\",9,\"罒罓馈愧溃坤昆捆困括扩廓阔垃拉喇蜡腊辣啦莱来赖蓝婪栏拦篮阑兰澜谰揽览懒缆烂滥琅榔狼廊郎朗浪捞劳牢老佬姥酪烙涝勒乐雷镭蕾磊累儡垒擂肋类泪棱楞冷厘梨犁黎篱狸离漓理李里鲤礼莉荔吏栗丽厉励砾历利傈例俐\"],[\"c140\",\"罖罙罛罜罝罞罠罣\",4,\"罫罬罭罯罰罳罵罶罷罸罺罻罼罽罿羀羂\",7,\"羋羍羏\",4,\"羕\",4,\"羛羜羠羢羣羥羦羨\",6,\"羱\"],[\"c180\",\"羳\",4,\"羺羻羾翀翂翃翄翆翇翈翉翋翍翏\",4,\"翖翗翙\",5,\"翢翣痢立粒沥隶力璃哩俩联莲连镰廉怜涟帘敛脸链恋炼练粮凉梁粱良两辆量晾亮谅撩聊僚疗燎寥辽潦了撂镣廖料列裂烈劣猎琳林磷霖临邻鳞淋凛赁吝拎玲菱零龄铃伶羚凌灵陵岭领另令溜琉榴硫馏留刘瘤流柳六龙聋咙笼窿\"],[\"c240\",\"翤翧翨翪翫翬翭翯翲翴\",6,\"翽翾翿耂耇耈耉耊耎耏耑耓耚耛耝耞耟耡耣耤耫\",5,\"耲耴耹耺耼耾聀聁聄聅聇聈聉聎聏聐聑聓聕聖聗\"],[\"c280\",\"聙聛\",13,\"聫\",5,\"聲\",11,\"隆垄拢陇楼娄搂篓漏陋芦卢颅庐炉掳卤虏鲁麓碌露路赂鹿潞禄录陆戮驴吕铝侣旅履屡缕虑氯律率滤绿峦挛孪滦卵乱掠略抡轮伦仑沦纶论萝螺罗逻锣箩骡裸落洛骆络妈麻玛码蚂马骂嘛吗埋买麦卖迈脉瞒馒蛮满蔓曼慢漫\"],[\"c340\",\"聾肁肂肅肈肊肍\",5,\"肔肕肗肙肞肣肦肧肨肬肰肳肵肶肸肹肻胅胇\",4,\"胏\",6,\"胘胟胠胢胣胦胮胵胷胹胻胾胿脀脁脃脄脅脇脈脋\"],[\"c380\",\"脌脕脗脙脛脜脝脟\",12,\"脭脮脰脳脴脵脷脹\",4,\"脿谩芒茫盲氓忙莽猫茅锚毛矛铆卯茂冒帽貌贸么玫枚梅酶霉煤没眉媒镁每美昧寐妹媚门闷们萌蒙檬盟锰猛梦孟眯醚靡糜迷谜弥米秘觅泌蜜密幂棉眠绵冕免勉娩缅面苗描瞄藐秒渺庙妙蔑灭民抿皿敏悯闽明螟鸣铭名命谬摸\"],[\"c440\",\"腀\",5,\"腇腉腍腎腏腒腖腗腘腛\",4,\"腡腢腣腤腦腨腪腫腬腯腲腳腵腶腷腸膁膃\",4,\"膉膋膌膍膎膐膒\",5,\"膙膚膞\",4,\"膤膥\"],[\"c480\",\"膧膩膫\",7,\"膴\",5,\"膼膽膾膿臄臅臇臈臉臋臍\",6,\"摹蘑模膜磨摩魔抹末莫墨默沫漠寞陌谋牟某拇牡亩姆母墓暮幕募慕木目睦牧穆拿哪呐钠那娜纳氖乃奶耐奈南男难囊挠脑恼闹淖呢馁内嫩能妮霓倪泥尼拟你匿腻逆溺蔫拈年碾撵捻念娘酿鸟尿捏聂孽啮镊镍涅您柠狞凝宁\"],[\"c540\",\"臔\",14,\"臤臥臦臨臩臫臮\",4,\"臵\",5,\"臽臿舃與\",4,\"舎舏舑舓舕\",5,\"舝舠舤舥舦舧舩舮舲舺舼舽舿\"],[\"c580\",\"艀艁艂艃艅艆艈艊艌艍艎艐\",7,\"艙艛艜艝艞艠\",7,\"艩拧泞牛扭钮纽脓浓农弄奴努怒女暖虐疟挪懦糯诺哦欧鸥殴藕呕偶沤啪趴爬帕怕琶拍排牌徘湃派攀潘盘磐盼畔判叛乓庞旁耪胖抛咆刨炮袍跑泡呸胚培裴赔陪配佩沛喷盆砰抨烹澎彭蓬棚硼篷膨朋鹏捧碰坯砒霹批披劈琵毗\"],[\"c640\",\"艪艫艬艭艱艵艶艷艸艻艼芀芁芃芅芆芇芉芌芐芓芔芕芖芚芛芞芠芢芣芧芲芵芶芺芻芼芿苀苂苃苅苆苉苐苖苙苚苝苢苧苨苩苪苬苭苮苰苲苳苵苶苸\"],[\"c680\",\"苺苼\",4,\"茊茋茍茐茒茓茖茘茙茝\",9,\"茩茪茮茰茲茷茻茽啤脾疲皮匹痞僻屁譬篇偏片骗飘漂瓢票撇瞥拼频贫品聘乒坪苹萍平凭瓶评屏坡泼颇婆破魄迫粕剖扑铺仆莆葡菩蒲埔朴圃普浦谱曝瀑期欺栖戚妻七凄漆柒沏其棋奇歧畦崎脐齐旗祈祁骑起岂乞企启契砌器气迄弃汽泣讫掐\"],[\"c740\",\"茾茿荁荂荄荅荈荊\",4,\"荓荕\",4,\"荝荢荰\",6,\"荹荺荾\",6,\"莇莈莊莋莌莍莏莐莑莔莕莖莗莙莚莝莟莡\",6,\"莬莭莮\"],[\"c780\",\"莯莵莻莾莿菂菃菄菆菈菉菋菍菎菐菑菒菓菕菗菙菚菛菞菢菣菤菦菧菨菫菬菭恰洽牵扦钎铅千迁签仟谦乾黔钱钳前潜遣浅谴堑嵌欠歉枪呛腔羌墙蔷强抢橇锹敲悄桥瞧乔侨巧鞘撬翘峭俏窍切茄且怯窃钦侵亲秦琴勤芹擒禽寝沁青轻氢倾卿清擎晴氰情顷请庆琼穷秋丘邱球求囚酋泅趋区蛆曲躯屈驱渠\"],[\"c840\",\"菮華菳\",4,\"菺菻菼菾菿萀萂萅萇萈萉萊萐萒\",5,\"萙萚萛萞\",5,\"萩\",7,\"萲\",5,\"萹萺萻萾\",7,\"葇葈葉\"],[\"c880\",\"葊\",6,\"葒\",4,\"葘葝葞葟葠葢葤\",4,\"葪葮葯葰葲葴葷葹葻葼取娶龋趣去圈颧权醛泉全痊拳犬券劝缺炔瘸却鹊榷确雀裙群然燃冉染瓤壤攘嚷让饶扰绕惹热壬仁人忍韧任认刃妊纫扔仍日戎茸蓉荣融熔溶容绒冗揉柔肉茹蠕儒孺如辱乳汝入褥软阮蕊瑞锐闰润若弱撒洒萨腮鳃塞赛三叁\"],[\"c940\",\"葽\",4,\"蒃蒄蒅蒆蒊蒍蒏\",7,\"蒘蒚蒛蒝蒞蒟蒠蒢\",12,\"蒰蒱蒳蒵蒶蒷蒻蒼蒾蓀蓂蓃蓅蓆蓇蓈蓋蓌蓎蓏蓒蓔蓕蓗\"],[\"c980\",\"蓘\",4,\"蓞蓡蓢蓤蓧\",4,\"蓭蓮蓯蓱\",10,\"蓽蓾蔀蔁蔂伞散桑嗓丧搔骚扫嫂瑟色涩森僧莎砂杀刹沙纱傻啥煞筛晒珊苫杉山删煽衫闪陕擅赡膳善汕扇缮墒伤商赏晌上尚裳梢捎稍烧芍勺韶少哨邵绍奢赊蛇舌舍赦摄射慑涉社设砷申呻伸身深娠绅神沈审婶甚肾慎渗声生甥牲升绳\"],[\"ca40\",\"蔃\",8,\"蔍蔎蔏蔐蔒蔔蔕蔖蔘蔙蔛蔜蔝蔞蔠蔢\",8,\"蔭\",9,\"蔾\",4,\"蕄蕅蕆蕇蕋\",10],[\"ca80\",\"蕗蕘蕚蕛蕜蕝蕟\",4,\"蕥蕦蕧蕩\",8,\"蕳蕵蕶蕷蕸蕼蕽蕿薀薁省盛剩胜圣师失狮施湿诗尸虱十石拾时什食蚀实识史矢使屎驶始式示士世柿事拭誓逝势是嗜噬适仕侍释饰氏市恃室视试收手首守寿授售受瘦兽蔬枢梳殊抒输叔舒淑疏书赎孰熟薯暑曙署蜀黍鼠属术述树束戍竖墅庶数漱\"],[\"cb40\",\"薂薃薆薈\",6,\"薐\",10,\"薝\",6,\"薥薦薧薩薫薬薭薱\",5,\"薸薺\",6,\"藂\",6,\"藊\",4,\"藑藒\"],[\"cb80\",\"藔藖\",5,\"藝\",6,\"藥藦藧藨藪\",14,\"恕刷耍摔衰甩帅栓拴霜双爽谁水睡税吮瞬顺舜说硕朔烁斯撕嘶思私司丝死肆寺嗣四伺似饲巳松耸怂颂送宋讼诵搜艘擞嗽苏酥俗素速粟僳塑溯宿诉肃酸蒜算虽隋随绥髓碎岁穗遂隧祟孙损笋蓑梭唆缩琐索锁所塌他它她塔\"],[\"cc40\",\"藹藺藼藽藾蘀\",4,\"蘆\",10,\"蘒蘓蘔蘕蘗\",15,\"蘨蘪\",13,\"蘹蘺蘻蘽蘾蘿虀\"],[\"cc80\",\"虁\",11,\"虒虓處\",4,\"虛虜虝號虠虡虣\",7,\"獭挞蹋踏胎苔抬台泰酞太态汰坍摊贪瘫滩坛檀痰潭谭谈坦毯袒碳探叹炭汤塘搪堂棠膛唐糖倘躺淌趟烫掏涛滔绦萄桃逃淘陶讨套特藤腾疼誊梯剔踢锑提题蹄啼体替嚏惕涕剃屉天添填田甜恬舔腆挑条迢眺跳贴铁帖厅听烃\"],[\"cd40\",\"虭虯虰虲\",6,\"蚃\",6,\"蚎\",4,\"蚔蚖\",5,\"蚞\",4,\"蚥蚦蚫蚭蚮蚲蚳蚷蚸蚹蚻\",4,\"蛁蛂蛃蛅蛈蛌蛍蛒蛓蛕蛖蛗蛚蛜\"],[\"cd80\",\"蛝蛠蛡蛢蛣蛥蛦蛧蛨蛪蛫蛬蛯蛵蛶蛷蛺蛻蛼蛽蛿蜁蜄蜅蜆蜋蜌蜎蜏蜐蜑蜔蜖汀廷停亭庭挺艇通桐酮瞳同铜彤童桶捅筒统痛偷投头透凸秃突图徒途涂屠土吐兔湍团推颓腿蜕褪退吞屯臀拖托脱鸵陀驮驼椭妥拓唾挖哇蛙洼娃瓦袜歪外豌弯湾玩顽丸烷完碗挽晚皖惋宛婉万腕汪王亡枉网往旺望忘妄威\"],[\"ce40\",\"蜙蜛蜝蜟蜠蜤蜦蜧蜨蜪蜫蜬蜭蜯蜰蜲蜳蜵蜶蜸蜹蜺蜼蜽蝀\",6,\"蝊蝋蝍蝏蝐蝑蝒蝔蝕蝖蝘蝚\",5,\"蝡蝢蝦\",7,\"蝯蝱蝲蝳蝵\"],[\"ce80\",\"蝷蝸蝹蝺蝿螀螁螄螆螇螉螊螌螎\",4,\"螔螕螖螘\",6,\"螠\",4,\"巍微危韦违桅围唯惟为潍维苇萎委伟伪尾纬未蔚味畏胃喂魏位渭谓尉慰卫瘟温蚊文闻纹吻稳紊问嗡翁瓮挝蜗涡窝我斡卧握沃巫呜钨乌污诬屋无芜梧吾吴毋武五捂午舞伍侮坞戊雾晤物勿务悟误昔熙析西硒矽晰嘻吸锡牺\"],[\"cf40\",\"螥螦螧螩螪螮螰螱螲螴螶螷螸螹螻螼螾螿蟁\",4,\"蟇蟈蟉蟌\",4,\"蟔\",6,\"蟜蟝蟞蟟蟡蟢蟣蟤蟦蟧蟨蟩蟫蟬蟭蟯\",9],[\"cf80\",\"蟺蟻蟼蟽蟿蠀蠁蠂蠄\",5,\"蠋\",7,\"蠔蠗蠘蠙蠚蠜\",4,\"蠣稀息希悉膝夕惜熄烯溪汐犀檄袭席习媳喜铣洗系隙戏细瞎虾匣霞辖暇峡侠狭下厦夏吓掀锨先仙鲜纤咸贤衔舷闲涎弦嫌显险现献县腺馅羡宪陷限线相厢镶香箱襄湘乡翔祥详想响享项巷橡像向象萧硝霄削哮嚣销消宵淆晓\"],[\"d040\",\"蠤\",13,\"蠳\",5,\"蠺蠻蠽蠾蠿衁衂衃衆\",5,\"衎\",5,\"衕衖衘衚\",6,\"衦衧衪衭衯衱衳衴衵衶衸衹衺\"],[\"d080\",\"衻衼袀袃袆袇袉袊袌袎袏袐袑袓袔袕袗\",4,\"袝\",4,\"袣袥\",5,\"小孝校肖啸笑效楔些歇蝎鞋协挟携邪斜胁谐写械卸蟹懈泄泻谢屑薪芯锌欣辛新忻心信衅星腥猩惺兴刑型形邢行醒幸杏性姓兄凶胸匈汹雄熊休修羞朽嗅锈秀袖绣墟戌需虚嘘须徐许蓄酗叙旭序畜恤絮婿绪续轩喧宣悬旋玄\"],[\"d140\",\"袬袮袯袰袲\",4,\"袸袹袺袻袽袾袿裀裃裄裇裈裊裋裌裍裏裐裑裓裖裗裚\",4,\"裠裡裦裧裩\",6,\"裲裵裶裷裺裻製裿褀褁褃\",5],[\"d180\",\"褉褋\",4,\"褑褔\",4,\"褜\",4,\"褢褣褤褦褧褨褩褬褭褮褯褱褲褳褵褷选癣眩绚靴薛学穴雪血勋熏循旬询寻驯巡殉汛训讯逊迅压押鸦鸭呀丫芽牙蚜崖衙涯雅哑亚讶焉咽阉烟淹盐严研蜒岩延言颜阎炎沿奄掩眼衍演艳堰燕厌砚雁唁彦焰宴谚验殃央鸯秧杨扬佯疡羊洋阳氧仰痒养样漾邀腰妖瑶\"],[\"d240\",\"褸\",8,\"襂襃襅\",24,\"襠\",5,\"襧\",19,\"襼\"],[\"d280\",\"襽襾覀覂覄覅覇\",26,\"摇尧遥窑谣姚咬舀药要耀椰噎耶爷野冶也页掖业叶曳腋夜液一壹医揖铱依伊衣颐夷遗移仪胰疑沂宜姨彝椅蚁倚已乙矣以艺抑易邑屹亿役臆逸肄疫亦裔意毅忆义益溢诣议谊译异翼翌绎茵荫因殷音阴姻吟银淫寅饮尹引隐\"],[\"d340\",\"覢\",30,\"觃觍觓觔觕觗觘觙觛觝觟觠觡觢觤觧觨觩觪觬觭觮觰觱觲觴\",6],[\"d380\",\"觻\",4,\"訁\",5,\"計\",21,\"印英樱婴鹰应缨莹萤营荧蝇迎赢盈影颖硬映哟拥佣臃痈庸雍踊蛹咏泳涌永恿勇用幽优悠忧尤由邮铀犹油游酉有友右佑釉诱又幼迂淤于盂榆虞愚舆余俞逾鱼愉渝渔隅予娱雨与屿禹宇语羽玉域芋郁吁遇喻峪御愈欲狱育誉\"],[\"d440\",\"訞\",31,\"訿\",8,\"詉\",21],[\"d480\",\"詟\",25,\"詺\",6,\"浴寓裕预豫驭鸳渊冤元垣袁原援辕园员圆猿源缘远苑愿怨院曰约越跃钥岳粤月悦阅耘云郧匀陨允运蕴酝晕韵孕匝砸杂栽哉灾宰载再在咱攒暂赞赃脏葬遭糟凿藻枣早澡蚤躁噪造皂灶燥责择则泽贼怎增憎曾赠扎喳渣札轧\"],[\"d540\",\"誁\",7,\"誋\",7,\"誔\",46],[\"d580\",\"諃\",32,\"铡闸眨栅榨咋乍炸诈摘斋宅窄债寨瞻毡詹粘沾盏斩辗崭展蘸栈占战站湛绽樟章彰漳张掌涨杖丈帐账仗胀瘴障招昭找沼赵照罩兆肇召遮折哲蛰辙者锗蔗这浙珍斟真甄砧臻贞针侦枕疹诊震振镇阵蒸挣睁征狰争怔整拯正政\"],[\"d640\",\"諤\",34,\"謈\",27],[\"d680\",\"謤謥謧\",30,\"帧症郑证芝枝支吱蜘知肢脂汁之织职直植殖执值侄址指止趾只旨纸志挚掷至致置帜峙制智秩稚质炙痔滞治窒中盅忠钟衷终种肿重仲众舟周州洲诌粥轴肘帚咒皱宙昼骤珠株蛛朱猪诸诛逐竹烛煮拄瞩嘱主著柱助蛀贮铸筑\"],[\"d740\",\"譆\",31,\"譧\",4,\"譭\",25],[\"d780\",\"讇\",24,\"讬讱讻诇诐诪谉谞住注祝驻抓爪拽专砖转撰赚篆桩庄装妆撞壮状椎锥追赘坠缀谆准捉拙卓桌琢茁酌啄着灼浊兹咨资姿滋淄孜紫仔籽滓子自渍字鬃棕踪宗综总纵邹走奏揍租足卒族祖诅阻组钻纂嘴醉最罪尊遵昨左佐柞做作坐座\"],[\"d840\",\"谸\",8,\"豂豃豄豅豈豊豋豍\",7,\"豖豗豘豙豛\",5,\"豣\",6,\"豬\",6,\"豴豵豶豷豻\",6,\"貃貄貆貇\"],[\"d880\",\"貈貋貍\",6,\"貕貖貗貙\",20,\"亍丌兀丐廿卅丕亘丞鬲孬噩丨禺丿匕乇夭爻卮氐囟胤馗毓睾鼗丶亟鼐乜乩亓芈孛啬嘏仄厍厝厣厥厮靥赝匚叵匦匮匾赜卦卣刂刈刎刭刳刿剀剌剞剡剜蒯剽劂劁劐劓冂罔亻仃仉仂仨仡仫仞伛仳伢佤仵伥伧伉伫佞佧攸佚佝\"],[\"d940\",\"貮\",62],[\"d980\",\"賭\",32,\"佟佗伲伽佶佴侑侉侃侏佾佻侪佼侬侔俦俨俪俅俚俣俜俑俟俸倩偌俳倬倏倮倭俾倜倌倥倨偾偃偕偈偎偬偻傥傧傩傺僖儆僭僬僦僮儇儋仝氽佘佥俎龠汆籴兮巽黉馘冁夔勹匍訇匐凫夙兕亠兖亳衮袤亵脔裒禀嬴蠃羸冫冱冽冼\"],[\"da40\",\"贎\",14,\"贠赑赒赗赟赥赨赩赪赬赮赯赱赲赸\",8,\"趂趃趆趇趈趉趌\",4,\"趒趓趕\",9,\"趠趡\"],[\"da80\",\"趢趤\",12,\"趲趶趷趹趻趽跀跁跂跅跇跈跉跊跍跐跒跓跔凇冖冢冥讠讦讧讪讴讵讷诂诃诋诏诎诒诓诔诖诘诙诜诟诠诤诨诩诮诰诳诶诹诼诿谀谂谄谇谌谏谑谒谔谕谖谙谛谘谝谟谠谡谥谧谪谫谮谯谲谳谵谶卩卺阝阢阡阱阪阽阼陂陉陔陟陧陬陲陴隈隍隗隰邗邛邝邙邬邡邴邳邶邺\"],[\"db40\",\"跕跘跙跜跠跡跢跥跦跧跩跭跮跰跱跲跴跶跼跾\",6,\"踆踇踈踋踍踎踐踑踒踓踕\",7,\"踠踡踤\",4,\"踫踭踰踲踳踴踶踷踸踻踼踾\"],[\"db80\",\"踿蹃蹅蹆蹌\",4,\"蹓\",5,\"蹚\",11,\"蹧蹨蹪蹫蹮蹱邸邰郏郅邾郐郄郇郓郦郢郜郗郛郫郯郾鄄鄢鄞鄣鄱鄯鄹酃酆刍奂劢劬劭劾哿勐勖勰叟燮矍廴凵凼鬯厶弁畚巯坌垩垡塾墼壅壑圩圬圪圳圹圮圯坜圻坂坩垅坫垆坼坻坨坭坶坳垭垤垌垲埏垧垴垓垠埕埘埚埙埒垸埴埯埸埤埝\"],[\"dc40\",\"蹳蹵蹷\",4,\"蹽蹾躀躂躃躄躆躈\",6,\"躑躒躓躕\",6,\"躝躟\",11,\"躭躮躰躱躳\",6,\"躻\",7],[\"dc80\",\"軃\",10,\"軏\",21,\"堋堍埽埭堀堞堙塄堠塥塬墁墉墚墀馨鼙懿艹艽艿芏芊芨芄芎芑芗芙芫芸芾芰苈苊苣芘芷芮苋苌苁芩芴芡芪芟苄苎芤苡茉苷苤茏茇苜苴苒苘茌苻苓茑茚茆茔茕苠苕茜荑荛荜茈莒茼茴茱莛荞茯荏荇荃荟荀茗荠茭茺茳荦荥\"],[\"dd40\",\"軥\",62],[\"dd80\",\"輤\",32,\"荨茛荩荬荪荭荮莰荸莳莴莠莪莓莜莅荼莶莩荽莸荻莘莞莨莺莼菁萁菥菘堇萘萋菝菽菖萜萸萑萆菔菟萏萃菸菹菪菅菀萦菰菡葜葑葚葙葳蒇蒈葺蒉葸萼葆葩葶蒌蒎萱葭蓁蓍蓐蓦蒽蓓蓊蒿蒺蓠蒡蒹蒴蒗蓥蓣蔌甍蔸蓰蔹蔟蔺\"],[\"de40\",\"轅\",32,\"轪辀辌辒辝辠辡辢辤辥辦辧辪辬辭辮辯農辳辴辵辷辸辺辻込辿迀迃迆\"],[\"de80\",\"迉\",4,\"迏迒迖迗迚迠迡迣迧迬迯迱迲迴迵迶迺迻迼迾迿逇逈逌逎逓逕逘蕖蔻蓿蓼蕙蕈蕨蕤蕞蕺瞢蕃蕲蕻薤薨薇薏蕹薮薜薅薹薷薰藓藁藜藿蘧蘅蘩蘖蘼廾弈夼奁耷奕奚奘匏尢尥尬尴扌扪抟抻拊拚拗拮挢拶挹捋捃掭揶捱捺掎掴捭掬掊捩掮掼揲揸揠揿揄揞揎摒揆掾摅摁搋搛搠搌搦搡摞撄摭撖\"],[\"df40\",\"這逜連逤逥逧\",5,\"逰\",4,\"逷逹逺逽逿遀遃遅遆遈\",4,\"過達違遖遙遚遜\",5,\"遤遦遧適遪遫遬遯\",4,\"遶\",6,\"遾邁\"],[\"df80\",\"還邅邆邇邉邊邌\",4,\"邒邔邖邘邚邜邞邟邠邤邥邧邨邩邫邭邲邷邼邽邿郀摺撷撸撙撺擀擐擗擤擢攉攥攮弋忒甙弑卟叱叽叩叨叻吒吖吆呋呒呓呔呖呃吡呗呙吣吲咂咔呷呱呤咚咛咄呶呦咝哐咭哂咴哒咧咦哓哔呲咣哕咻咿哌哙哚哜咩咪咤哝哏哞唛哧唠哽唔哳唢唣唏唑唧唪啧喏喵啉啭啁啕唿啐唼\"],[\"e040\",\"郂郃郆郈郉郋郌郍郒郔郕郖郘郙郚郞郟郠郣郤郥郩郪郬郮郰郱郲郳郵郶郷郹郺郻郼郿鄀鄁鄃鄅\",19,\"鄚鄛鄜\"],[\"e080\",\"鄝鄟鄠鄡鄤\",10,\"鄰鄲\",6,\"鄺\",8,\"酄唷啖啵啶啷唳唰啜喋嗒喃喱喹喈喁喟啾嗖喑啻嗟喽喾喔喙嗪嗷嗉嘟嗑嗫嗬嗔嗦嗝嗄嗯嗥嗲嗳嗌嗍嗨嗵嗤辔嘞嘈嘌嘁嘤嘣嗾嘀嘧嘭噘嘹噗嘬噍噢噙噜噌噔嚆噤噱噫噻噼嚅嚓嚯囔囗囝囡囵囫囹囿圄圊圉圜帏帙帔帑帱帻帼\"],[\"e140\",\"酅酇酈酑酓酔酕酖酘酙酛酜酟酠酦酧酨酫酭酳酺酻酼醀\",4,\"醆醈醊醎醏醓\",6,\"醜\",5,\"醤\",5,\"醫醬醰醱醲醳醶醷醸醹醻\"],[\"e180\",\"醼\",10,\"釈釋釐釒\",9,\"針\",8,\"帷幄幔幛幞幡岌屺岍岐岖岈岘岙岑岚岜岵岢岽岬岫岱岣峁岷峄峒峤峋峥崂崃崧崦崮崤崞崆崛嵘崾崴崽嵬嵛嵯嵝嵫嵋嵊嵩嵴嶂嶙嶝豳嶷巅彳彷徂徇徉後徕徙徜徨徭徵徼衢彡犭犰犴犷犸狃狁狎狍狒狨狯狩狲狴狷猁狳猃狺\"],[\"e240\",\"釦\",62],[\"e280\",\"鈥\",32,\"狻猗猓猡猊猞猝猕猢猹猥猬猸猱獐獍獗獠獬獯獾舛夥飧夤夂饣饧\",5,\"饴饷饽馀馄馇馊馍馐馑馓馔馕庀庑庋庖庥庠庹庵庾庳赓廒廑廛廨廪膺忄忉忖忏怃忮怄忡忤忾怅怆忪忭忸怙怵怦怛怏怍怩怫怊怿怡恸恹恻恺恂\"],[\"e340\",\"鉆\",45,\"鉵\",16],[\"e380\",\"銆\",7,\"銏\",24,\"恪恽悖悚悭悝悃悒悌悛惬悻悱惝惘惆惚悴愠愦愕愣惴愀愎愫慊慵憬憔憧憷懔懵忝隳闩闫闱闳闵闶闼闾阃阄阆阈阊阋阌阍阏阒阕阖阗阙阚丬爿戕氵汔汜汊沣沅沐沔沌汨汩汴汶沆沩泐泔沭泷泸泱泗沲泠泖泺泫泮沱泓泯泾\"],[\"e440\",\"銨\",5,\"銯\",24,\"鋉\",31],[\"e480\",\"鋩\",32,\"洹洧洌浃浈洇洄洙洎洫浍洮洵洚浏浒浔洳涑浯涞涠浞涓涔浜浠浼浣渚淇淅淞渎涿淠渑淦淝淙渖涫渌涮渫湮湎湫溲湟溆湓湔渲渥湄滟溱溘滠漭滢溥溧溽溻溷滗溴滏溏滂溟潢潆潇漤漕滹漯漶潋潴漪漉漩澉澍澌潸潲潼潺濑\"],[\"e540\",\"錊\",51,\"錿\",10],[\"e580\",\"鍊\",31,\"鍫濉澧澹澶濂濡濮濞濠濯瀚瀣瀛瀹瀵灏灞宀宄宕宓宥宸甯骞搴寤寮褰寰蹇謇辶迓迕迥迮迤迩迦迳迨逅逄逋逦逑逍逖逡逵逶逭逯遄遑遒遐遨遘遢遛暹遴遽邂邈邃邋彐彗彖彘尻咫屐屙孱屣屦羼弪弩弭艴弼鬻屮妁妃妍妩妪妣\"],[\"e640\",\"鍬\",34,\"鎐\",27],[\"e680\",\"鎬\",29,\"鏋鏌鏍妗姊妫妞妤姒妲妯姗妾娅娆姝娈姣姘姹娌娉娲娴娑娣娓婀婧婊婕娼婢婵胬媪媛婷婺媾嫫媲嫒嫔媸嫠嫣嫱嫖嫦嫘嫜嬉嬗嬖嬲嬷孀尕尜孚孥孳孑孓孢驵驷驸驺驿驽骀骁骅骈骊骐骒骓骖骘骛骜骝骟骠骢骣骥骧纟纡纣纥纨纩\"],[\"e740\",\"鏎\",7,\"鏗\",54],[\"e780\",\"鐎\",32,\"纭纰纾绀绁绂绉绋绌绐绔绗绛绠绡绨绫绮绯绱绲缍绶绺绻绾缁缂缃缇缈缋缌缏缑缒缗缙缜缛缟缡\",6,\"缪缫缬缭缯\",4,\"缵幺畿巛甾邕玎玑玮玢玟珏珂珑玷玳珀珉珈珥珙顼琊珩珧珞玺珲琏琪瑛琦琥琨琰琮琬\"],[\"e840\",\"鐯\",14,\"鐿\",43,\"鑬鑭鑮鑯\"],[\"e880\",\"鑰\",20,\"钑钖钘铇铏铓铔铚铦铻锜锠琛琚瑁瑜瑗瑕瑙瑷瑭瑾璜璎璀璁璇璋璞璨璩璐璧瓒璺韪韫韬杌杓杞杈杩枥枇杪杳枘枧杵枨枞枭枋杷杼柰栉柘栊柩枰栌柙枵柚枳柝栀柃枸柢栎柁柽栲栳桠桡桎桢桄桤梃栝桕桦桁桧桀栾桊桉栩梵梏桴桷梓桫棂楮棼椟椠棹\"],[\"e940\",\"锧锳锽镃镈镋镕镚镠镮镴镵長\",7,\"門\",42],[\"e980\",\"閫\",32,\"椤棰椋椁楗棣椐楱椹楠楂楝榄楫榀榘楸椴槌榇榈槎榉楦楣楹榛榧榻榫榭槔榱槁槊槟榕槠榍槿樯槭樗樘橥槲橄樾檠橐橛樵檎橹樽樨橘橼檑檐檩檗檫猷獒殁殂殇殄殒殓殍殚殛殡殪轫轭轱轲轳轵轶轸轷轹轺轼轾辁辂辄辇辋\"],[\"ea40\",\"闌\",27,\"闬闿阇阓阘阛阞阠阣\",6,\"阫阬阭阯阰阷阸阹阺阾陁陃陊陎陏陑陒陓陖陗\"],[\"ea80\",\"陘陙陚陜陝陞陠陣陥陦陫陭\",4,\"陳陸\",12,\"隇隉隊辍辎辏辘辚軎戋戗戛戟戢戡戥戤戬臧瓯瓴瓿甏甑甓攴旮旯旰昊昙杲昃昕昀炅曷昝昴昱昶昵耆晟晔晁晏晖晡晗晷暄暌暧暝暾曛曜曦曩贲贳贶贻贽赀赅赆赈赉赇赍赕赙觇觊觋觌觎觏觐觑牮犟牝牦牯牾牿犄犋犍犏犒挈挲掰\"],[\"eb40\",\"隌階隑隒隓隕隖隚際隝\",9,\"隨\",7,\"隱隲隴隵隷隸隺隻隿雂雃雈雊雋雐雑雓雔雖\",9,\"雡\",6,\"雫\"],[\"eb80\",\"雬雭雮雰雱雲雴雵雸雺電雼雽雿霂霃霅霊霋霌霐霑霒霔霕霗\",4,\"霝霟霠搿擘耄毪毳毽毵毹氅氇氆氍氕氘氙氚氡氩氤氪氲攵敕敫牍牒牖爰虢刖肟肜肓肼朊肽肱肫肭肴肷胧胨胩胪胛胂胄胙胍胗朐胝胫胱胴胭脍脎胲胼朕脒豚脶脞脬脘脲腈腌腓腴腙腚腱腠腩腼腽腭腧塍媵膈膂膑滕膣膪臌朦臊膻\"],[\"ec40\",\"霡\",8,\"霫霬霮霯霱霳\",4,\"霺霻霼霽霿\",18,\"靔靕靗靘靚靜靝靟靣靤靦靧靨靪\",7],[\"ec80\",\"靲靵靷\",4,\"靽\",7,\"鞆\",4,\"鞌鞎鞏鞐鞓鞕鞖鞗鞙\",4,\"臁膦欤欷欹歃歆歙飑飒飓飕飙飚殳彀毂觳斐齑斓於旆旄旃旌旎旒旖炀炜炖炝炻烀炷炫炱烨烊焐焓焖焯焱煳煜煨煅煲煊煸煺熘熳熵熨熠燠燔燧燹爝爨灬焘煦熹戾戽扃扈扉礻祀祆祉祛祜祓祚祢祗祠祯祧祺禅禊禚禧禳忑忐\"],[\"ed40\",\"鞞鞟鞡鞢鞤\",6,\"鞬鞮鞰鞱鞳鞵\",46],[\"ed80\",\"韤韥韨韮\",4,\"韴韷\",23,\"怼恝恚恧恁恙恣悫愆愍慝憩憝懋懑戆肀聿沓泶淼矶矸砀砉砗砘砑斫砭砜砝砹砺砻砟砼砥砬砣砩硎硭硖硗砦硐硇硌硪碛碓碚碇碜碡碣碲碹碥磔磙磉磬磲礅磴礓礤礞礴龛黹黻黼盱眄眍盹眇眈眚眢眙眭眦眵眸睐睑睇睃睚睨\"],[\"ee40\",\"頏\",62],[\"ee80\",\"顎\",32,\"睢睥睿瞍睽瞀瞌瞑瞟瞠瞰瞵瞽町畀畎畋畈畛畲畹疃罘罡罟詈罨罴罱罹羁罾盍盥蠲钅钆钇钋钊钌钍钏钐钔钗钕钚钛钜钣钤钫钪钭钬钯钰钲钴钶\",4,\"钼钽钿铄铈\",6,\"铐铑铒铕铖铗铙铘铛铞铟铠铢铤铥铧铨铪\"],[\"ef40\",\"顯\",5,\"颋颎颒颕颙颣風\",37,\"飏飐飔飖飗飛飜飝飠\",4],[\"ef80\",\"飥飦飩\",30,\"铩铫铮铯铳铴铵铷铹铼铽铿锃锂锆锇锉锊锍锎锏锒\",4,\"锘锛锝锞锟锢锪锫锩锬锱锲锴锶锷锸锼锾锿镂锵镄镅镆镉镌镎镏镒镓镔镖镗镘镙镛镞镟镝镡镢镤\",8,\"镯镱镲镳锺矧矬雉秕秭秣秫稆嵇稃稂稞稔\"],[\"f040\",\"餈\",4,\"餎餏餑\",28,\"餯\",26],[\"f080\",\"饊\",9,\"饖\",12,\"饤饦饳饸饹饻饾馂馃馉稹稷穑黏馥穰皈皎皓皙皤瓞瓠甬鸠鸢鸨\",4,\"鸲鸱鸶鸸鸷鸹鸺鸾鹁鹂鹄鹆鹇鹈鹉鹋鹌鹎鹑鹕鹗鹚鹛鹜鹞鹣鹦\",6,\"鹱鹭鹳疒疔疖疠疝疬疣疳疴疸痄疱疰痃痂痖痍痣痨痦痤痫痧瘃痱痼痿瘐瘀瘅瘌瘗瘊瘥瘘瘕瘙\"],[\"f140\",\"馌馎馚\",10,\"馦馧馩\",47],[\"f180\",\"駙\",32,\"瘛瘼瘢瘠癀瘭瘰瘿瘵癃瘾瘳癍癞癔癜癖癫癯翊竦穸穹窀窆窈窕窦窠窬窨窭窳衤衩衲衽衿袂袢裆袷袼裉裢裎裣裥裱褚裼裨裾裰褡褙褓褛褊褴褫褶襁襦襻疋胥皲皴矜耒耔耖耜耠耢耥耦耧耩耨耱耋耵聃聆聍聒聩聱覃顸颀颃\"],[\"f240\",\"駺\",62],[\"f280\",\"騹\",32,\"颉颌颍颏颔颚颛颞颟颡颢颥颦虍虔虬虮虿虺虼虻蚨蚍蚋蚬蚝蚧蚣蚪蚓蚩蚶蛄蚵蛎蚰蚺蚱蚯蛉蛏蚴蛩蛱蛲蛭蛳蛐蜓蛞蛴蛟蛘蛑蜃蜇蛸蜈蜊蜍蜉蜣蜻蜞蜥蜮蜚蜾蝈蜴蜱蜩蜷蜿螂蜢蝽蝾蝻蝠蝰蝌蝮螋蝓蝣蝼蝤蝙蝥螓螯螨蟒\"],[\"f340\",\"驚\",17,\"驲骃骉骍骎骔骕骙骦骩\",6,\"骲骳骴骵骹骻骽骾骿髃髄髆\",4,\"髍髎髏髐髒體髕髖髗髙髚髛髜\"],[\"f380\",\"髝髞髠髢髣髤髥髧髨髩髪髬髮髰\",8,\"髺髼\",6,\"鬄鬅鬆蟆螈螅螭螗螃螫蟥螬螵螳蟋蟓螽蟑蟀蟊蟛蟪蟠蟮蠖蠓蟾蠊蠛蠡蠹蠼缶罂罄罅舐竺竽笈笃笄笕笊笫笏筇笸笪笙笮笱笠笥笤笳笾笞筘筚筅筵筌筝筠筮筻筢筲筱箐箦箧箸箬箝箨箅箪箜箢箫箴篑篁篌篝篚篥篦篪簌篾篼簏簖簋\"],[\"f440\",\"鬇鬉\",5,\"鬐鬑鬒鬔\",10,\"鬠鬡鬢鬤\",10,\"鬰鬱鬳\",7,\"鬽鬾鬿魀魆魊魋魌魎魐魒魓魕\",5],[\"f480\",\"魛\",32,\"簟簪簦簸籁籀臾舁舂舄臬衄舡舢舣舭舯舨舫舸舻舳舴舾艄艉艋艏艚艟艨衾袅袈裘裟襞羝羟羧羯羰羲籼敉粑粝粜粞粢粲粼粽糁糇糌糍糈糅糗糨艮暨羿翎翕翥翡翦翩翮翳糸絷綦綮繇纛麸麴赳趄趔趑趱赧赭豇豉酊酐酎酏酤\"],[\"f540\",\"魼\",62],[\"f580\",\"鮻\",32,\"酢酡酰酩酯酽酾酲酴酹醌醅醐醍醑醢醣醪醭醮醯醵醴醺豕鹾趸跫踅蹙蹩趵趿趼趺跄跖跗跚跞跎跏跛跆跬跷跸跣跹跻跤踉跽踔踝踟踬踮踣踯踺蹀踹踵踽踱蹉蹁蹂蹑蹒蹊蹰蹶蹼蹯蹴躅躏躔躐躜躞豸貂貊貅貘貔斛觖觞觚觜\"],[\"f640\",\"鯜\",62],[\"f680\",\"鰛\",32,\"觥觫觯訾謦靓雩雳雯霆霁霈霏霎霪霭霰霾龀龃龅\",5,\"龌黾鼋鼍隹隼隽雎雒瞿雠銎銮鋈錾鍪鏊鎏鐾鑫鱿鲂鲅鲆鲇鲈稣鲋鲎鲐鲑鲒鲔鲕鲚鲛鲞\",5,\"鲥\",4,\"鲫鲭鲮鲰\",7,\"鲺鲻鲼鲽鳄鳅鳆鳇鳊鳋\"],[\"f740\",\"鰼\",62],[\"f780\",\"鱻鱽鱾鲀鲃鲄鲉鲊鲌鲏鲓鲖鲗鲘鲙鲝鲪鲬鲯鲹鲾\",4,\"鳈鳉鳑鳒鳚鳛鳠鳡鳌\",4,\"鳓鳔鳕鳗鳘鳙鳜鳝鳟鳢靼鞅鞑鞒鞔鞯鞫鞣鞲鞴骱骰骷鹘骶骺骼髁髀髅髂髋髌髑魅魃魇魉魈魍魑飨餍餮饕饔髟髡髦髯髫髻髭髹鬈鬏鬓鬟鬣麽麾縻麂麇麈麋麒鏖麝麟黛黜黝黠黟黢黩黧黥黪黯鼢鼬鼯鼹鼷鼽鼾齄\"],[\"f840\",\"鳣\",62],[\"f880\",\"鴢\",32],[\"f940\",\"鵃\",62],[\"f980\",\"鶂\",32],[\"fa40\",\"鶣\",62],[\"fa80\",\"鷢\",32],[\"fb40\",\"鸃\",27,\"鸤鸧鸮鸰鸴鸻鸼鹀鹍鹐鹒鹓鹔鹖鹙鹝鹟鹠鹡鹢鹥鹮鹯鹲鹴\",9,\"麀\"],[\"fb80\",\"麁麃麄麅麆麉麊麌\",5,\"麔\",8,\"麞麠\",5,\"麧麨麩麪\"],[\"fc40\",\"麫\",8,\"麵麶麷麹麺麼麿\",4,\"黅黆黇黈黊黋黌黐黒黓黕黖黗黙黚點黡黣黤黦黨黫黬黭黮黰\",8,\"黺黽黿\",6],[\"fc80\",\"鼆\",4,\"鼌鼏鼑鼒鼔鼕鼖鼘鼚\",5,\"鼡鼣\",8,\"鼭鼮鼰鼱\"],[\"fd40\",\"鼲\",4,\"鼸鼺鼼鼿\",4,\"齅\",10,\"齒\",38],[\"fd80\",\"齹\",5,\"龁龂龍\",11,\"龜龝龞龡\",4,\"郎凉秊裏隣\"],[\"fe40\",\"兀嗀﨎﨏﨑﨓﨔礼﨟蘒﨡﨣﨤﨧﨨﨩\"]]");
  8718. /***/ }),
  8719. /* 110 */
  8720. /***/ (function(module, exports, __webpack_require__) {
  8721. // fallback for non-array-like ES3 and non-enumerable old V8 strings
  8722. var cof = __webpack_require__(111);
  8723. // eslint-disable-next-line no-prototype-builtins
  8724. module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
  8725. return cof(it) == 'String' ? it.split('') : Object(it);
  8726. };
  8727. /***/ }),
  8728. /* 111 */
  8729. /***/ (function(module, exports) {
  8730. var toString = {}.toString;
  8731. module.exports = function (it) {
  8732. return toString.call(it).slice(8, -1);
  8733. };
  8734. /***/ }),
  8735. /* 112 */
  8736. /***/ (function(module, exports) {
  8737. // 7.2.1 RequireObjectCoercible(argument)
  8738. module.exports = function (it) {
  8739. if (it == undefined) throw TypeError("Can't call method on " + it);
  8740. return it;
  8741. };
  8742. /***/ }),
  8743. /* 113 */
  8744. /***/ (function(module, exports, __webpack_require__) {
  8745. var pIE = __webpack_require__(73);
  8746. var createDesc = __webpack_require__(57);
  8747. var toIObject = __webpack_require__(35);
  8748. var toPrimitive = __webpack_require__(114);
  8749. var has = __webpack_require__(36);
  8750. var IE8_DOM_DEFINE = __webpack_require__(180);
  8751. var gOPD = Object.getOwnPropertyDescriptor;
  8752. exports.f = __webpack_require__(13) ? gOPD : function getOwnPropertyDescriptor(O, P) {
  8753. O = toIObject(O);
  8754. P = toPrimitive(P, true);
  8755. if (IE8_DOM_DEFINE) try {
  8756. return gOPD(O, P);
  8757. } catch (e) { /* empty */ }
  8758. if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]);
  8759. };
  8760. /***/ }),
  8761. /* 114 */
  8762. /***/ (function(module, exports, __webpack_require__) {
  8763. // 7.1.1 ToPrimitive(input [, PreferredType])
  8764. var isObject = __webpack_require__(20);
  8765. // instead of the ES6 spec version, we didn't implement @@toPrimitive case
  8766. // and the second argument - flag - preferred type is a string
  8767. module.exports = function (it, S) {
  8768. if (!isObject(it)) return it;
  8769. var fn, val;
  8770. if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
  8771. if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;
  8772. if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
  8773. throw TypeError("Can't convert object to primitive value");
  8774. };
  8775. /***/ }),
  8776. /* 115 */
  8777. /***/ (function(module, exports, __webpack_require__) {
  8778. // most Object methods by ES6 should accept primitives
  8779. var $export = __webpack_require__(7);
  8780. var core = __webpack_require__(2);
  8781. var fails = __webpack_require__(37);
  8782. module.exports = function (KEY, exec) {
  8783. var fn = (core.Object || {})[KEY] || Object[KEY];
  8784. var exp = {};
  8785. exp[KEY] = exec(fn);
  8786. $export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp);
  8787. };
  8788. /***/ }),
  8789. /* 116 */
  8790. /***/ (function(module, exports, __webpack_require__) {
  8791. "use strict";
  8792. var LIBRARY = __webpack_require__(75);
  8793. var $export = __webpack_require__(7);
  8794. var redefine = __webpack_require__(184);
  8795. var hide = __webpack_require__(27);
  8796. var Iterators = __webpack_require__(58);
  8797. var $iterCreate = __webpack_require__(339);
  8798. var setToStringTag = __webpack_require__(79);
  8799. var getPrototypeOf = __webpack_require__(342);
  8800. var ITERATOR = __webpack_require__(14)('iterator');
  8801. var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`
  8802. var FF_ITERATOR = '@@iterator';
  8803. var KEYS = 'keys';
  8804. var VALUES = 'values';
  8805. var returnThis = function () { return this; };
  8806. module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {
  8807. $iterCreate(Constructor, NAME, next);
  8808. var getMethod = function (kind) {
  8809. if (!BUGGY && kind in proto) return proto[kind];
  8810. switch (kind) {
  8811. case KEYS: return function keys() { return new Constructor(this, kind); };
  8812. case VALUES: return function values() { return new Constructor(this, kind); };
  8813. } return function entries() { return new Constructor(this, kind); };
  8814. };
  8815. var TAG = NAME + ' Iterator';
  8816. var DEF_VALUES = DEFAULT == VALUES;
  8817. var VALUES_BUG = false;
  8818. var proto = Base.prototype;
  8819. var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];
  8820. var $default = $native || getMethod(DEFAULT);
  8821. var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;
  8822. var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;
  8823. var methods, key, IteratorPrototype;
  8824. // Fix native
  8825. if ($anyNative) {
  8826. IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));
  8827. if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {
  8828. // Set @@toStringTag to native iterators
  8829. setToStringTag(IteratorPrototype, TAG, true);
  8830. // fix for some old engines
  8831. if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis);
  8832. }
  8833. }
  8834. // fix Array#{values, @@iterator}.name in V8 / FF
  8835. if (DEF_VALUES && $native && $native.name !== VALUES) {
  8836. VALUES_BUG = true;
  8837. $default = function values() { return $native.call(this); };
  8838. }
  8839. // Define iterator
  8840. if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {
  8841. hide(proto, ITERATOR, $default);
  8842. }
  8843. // Plug for library
  8844. Iterators[NAME] = $default;
  8845. Iterators[TAG] = returnThis;
  8846. if (DEFAULT) {
  8847. methods = {
  8848. values: DEF_VALUES ? $default : getMethod(VALUES),
  8849. keys: IS_SET ? $default : getMethod(KEYS),
  8850. entries: $entries
  8851. };
  8852. if (FORCED) for (key in methods) {
  8853. if (!(key in proto)) redefine(proto, key, methods[key]);
  8854. } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);
  8855. }
  8856. return methods;
  8857. };
  8858. /***/ }),
  8859. /* 117 */
  8860. /***/ (function(module, exports) {
  8861. // 7.1.4 ToInteger
  8862. var ceil = Math.ceil;
  8863. var floor = Math.floor;
  8864. module.exports = function (it) {
  8865. return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
  8866. };
  8867. /***/ }),
  8868. /* 118 */
  8869. /***/ (function(module, exports, __webpack_require__) {
  8870. var shared = __webpack_require__(119)('keys');
  8871. var uid = __webpack_require__(78);
  8872. module.exports = function (key) {
  8873. return shared[key] || (shared[key] = uid(key));
  8874. };
  8875. /***/ }),
  8876. /* 119 */
  8877. /***/ (function(module, exports, __webpack_require__) {
  8878. var core = __webpack_require__(2);
  8879. var global = __webpack_require__(21);
  8880. var SHARED = '__core-js_shared__';
  8881. var store = global[SHARED] || (global[SHARED] = {});
  8882. (module.exports = function (key, value) {
  8883. return store[key] || (store[key] = value !== undefined ? value : {});
  8884. })('versions', []).push({
  8885. version: core.version,
  8886. mode: __webpack_require__(75) ? 'pure' : 'global',
  8887. copyright: '© 2019 Denis Pushkarev (zloirock.ru)'
  8888. });
  8889. /***/ }),
  8890. /* 120 */
  8891. /***/ (function(module, exports) {
  8892. // IE 8- don't enum bug keys
  8893. module.exports = (
  8894. 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
  8895. ).split(',');
  8896. /***/ }),
  8897. /* 121 */
  8898. /***/ (function(module, exports, __webpack_require__) {
  8899. var classof = __webpack_require__(188);
  8900. var ITERATOR = __webpack_require__(14)('iterator');
  8901. var Iterators = __webpack_require__(58);
  8902. module.exports = __webpack_require__(2).getIteratorMethod = function (it) {
  8903. if (it != undefined) return it[ITERATOR]
  8904. || it['@@iterator']
  8905. || Iterators[classof(it)];
  8906. };
  8907. /***/ }),
  8908. /* 122 */
  8909. /***/ (function(module, exports, __webpack_require__) {
  8910. "use strict";
  8911. exports.__esModule = true;
  8912. var _iterator = __webpack_require__(348);
  8913. var _iterator2 = _interopRequireDefault(_iterator);
  8914. var _symbol = __webpack_require__(350);
  8915. var _symbol2 = _interopRequireDefault(_symbol);
  8916. var _typeof = typeof _symbol2.default === "function" && typeof _iterator2.default === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj; };
  8917. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  8918. exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.default) === "symbol" ? function (obj) {
  8919. return typeof obj === "undefined" ? "undefined" : _typeof(obj);
  8920. } : function (obj) {
  8921. return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof(obj);
  8922. };
  8923. /***/ }),
  8924. /* 123 */
  8925. /***/ (function(module, exports, __webpack_require__) {
  8926. exports.f = __webpack_require__(14);
  8927. /***/ }),
  8928. /* 124 */
  8929. /***/ (function(module, exports, __webpack_require__) {
  8930. var global = __webpack_require__(21);
  8931. var core = __webpack_require__(2);
  8932. var LIBRARY = __webpack_require__(75);
  8933. var wksExt = __webpack_require__(123);
  8934. var defineProperty = __webpack_require__(17).f;
  8935. module.exports = function (name) {
  8936. var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {});
  8937. if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) });
  8938. };
  8939. /***/ }),
  8940. /* 125 */
  8941. /***/ (function(module, exports) {
  8942. exports.f = Object.getOwnPropertySymbols;
  8943. /***/ }),
  8944. /* 126 */
  8945. /***/ (function(module, exports) {
  8946. /***/ }),
  8947. /* 127 */
  8948. /***/ (function(module, exports, __webpack_require__) {
  8949. var isObject = __webpack_require__(20);
  8950. module.exports = function (it, TYPE) {
  8951. if (!isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!');
  8952. return it;
  8953. };
  8954. /***/ }),
  8955. /* 128 */
  8956. /***/ (function(module, exports, __webpack_require__) {
  8957. "use strict";
  8958. var implementation = __webpack_require__(393);
  8959. module.exports = Function.prototype.bind || implementation;
  8960. /***/ }),
  8961. /* 129 */
  8962. /***/ (function(module, exports, __webpack_require__) {
  8963. "use strict";
  8964. var keys = __webpack_require__(201);
  8965. var hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';
  8966. var toStr = Object.prototype.toString;
  8967. var concat = Array.prototype.concat;
  8968. var origDefineProperty = Object.defineProperty;
  8969. var isFunction = function (fn) {
  8970. return typeof fn === 'function' && toStr.call(fn) === '[object Function]';
  8971. };
  8972. var arePropertyDescriptorsSupported = function () {
  8973. var obj = {};
  8974. try {
  8975. origDefineProperty(obj, 'x', { enumerable: false, value: obj });
  8976. // eslint-disable-next-line no-unused-vars, no-restricted-syntax
  8977. for (var _ in obj) { // jscs:ignore disallowUnusedVariables
  8978. return false;
  8979. }
  8980. return obj.x === obj;
  8981. } catch (e) { /* this is IE 8. */
  8982. return false;
  8983. }
  8984. };
  8985. var supportsDescriptors = origDefineProperty && arePropertyDescriptorsSupported();
  8986. var defineProperty = function (object, name, value, predicate) {
  8987. if (name in object && (!isFunction(predicate) || !predicate())) {
  8988. return;
  8989. }
  8990. if (supportsDescriptors) {
  8991. origDefineProperty(object, name, {
  8992. configurable: true,
  8993. enumerable: false,
  8994. value: value,
  8995. writable: true
  8996. });
  8997. } else {
  8998. object[name] = value;
  8999. }
  9000. };
  9001. var defineProperties = function (object, map) {
  9002. var predicates = arguments.length > 2 ? arguments[2] : {};
  9003. var props = keys(map);
  9004. if (hasSymbols) {
  9005. props = concat.call(props, Object.getOwnPropertySymbols(map));
  9006. }
  9007. for (var i = 0; i < props.length; i += 1) {
  9008. defineProperty(object, props[i], map[props[i]], predicates[props[i]]);
  9009. }
  9010. };
  9011. defineProperties.supportsDescriptors = !!supportsDescriptors;
  9012. module.exports = defineProperties;
  9013. /***/ }),
  9014. /* 130 */
  9015. /***/ (function(module, exports, __webpack_require__) {
  9016. "use strict";
  9017. var isString = __webpack_require__(0).isString;
  9018. var isNumber = __webpack_require__(0).isNumber;
  9019. var isObject = __webpack_require__(0).isObject;
  9020. var isArray = __webpack_require__(0).isArray;
  9021. var isUndefined = __webpack_require__(0).isUndefined;
  9022. var LineBreaker = __webpack_require__(209);
  9023. var LEADING = /^(\s)+/g;
  9024. var TRAILING = /(\s)+$/g;
  9025. /**
  9026. * Creates an instance of TextTools - text measurement utility
  9027. *
  9028. * @constructor
  9029. * @param {FontProvider} fontProvider
  9030. */
  9031. function TextTools(fontProvider) {
  9032. this.fontProvider = fontProvider;
  9033. }
  9034. /**
  9035. * Converts an array of strings (or inline-definition-objects) into a collection
  9036. * of inlines and calculated minWidth/maxWidth.
  9037. * and their min/max widths
  9038. * @param {Object} textArray - an array of inline-definition-objects (or strings)
  9039. * @param {Object} styleContextStack current style stack
  9040. * @return {Object} collection of inlines, minWidth, maxWidth
  9041. */
  9042. TextTools.prototype.buildInlines = function (textArray, styleContextStack) {
  9043. var measured = measure(this.fontProvider, textArray, styleContextStack);
  9044. var minWidth = 0,
  9045. maxWidth = 0,
  9046. currentLineWidth;
  9047. measured.forEach(function (inline) {
  9048. minWidth = Math.max(minWidth, inline.width - inline.leadingCut - inline.trailingCut);
  9049. if (!currentLineWidth) {
  9050. currentLineWidth = { width: 0, leadingCut: inline.leadingCut, trailingCut: 0 };
  9051. }
  9052. currentLineWidth.width += inline.width;
  9053. currentLineWidth.trailingCut = inline.trailingCut;
  9054. maxWidth = Math.max(maxWidth, getTrimmedWidth(currentLineWidth));
  9055. if (inline.lineEnd) {
  9056. currentLineWidth = null;
  9057. }
  9058. });
  9059. if (getStyleProperty({}, styleContextStack, 'noWrap', false)) {
  9060. minWidth = maxWidth;
  9061. }
  9062. return {
  9063. items: measured,
  9064. minWidth: minWidth,
  9065. maxWidth: maxWidth
  9066. };
  9067. function getTrimmedWidth(item) {
  9068. return Math.max(0, item.width - item.leadingCut - item.trailingCut);
  9069. }
  9070. };
  9071. /**
  9072. * Returns size of the specified string (without breaking it) using the current style
  9073. * @param {String} text text to be measured
  9074. * @param {Object} styleContextStack current style stack
  9075. * @return {Object} size of the specified string
  9076. */
  9077. TextTools.prototype.sizeOfString = function (text, styleContextStack) {
  9078. text = text ? text.toString().replace(/\t/g, ' ') : '';
  9079. //TODO: refactor - extract from measure
  9080. var fontName = getStyleProperty({}, styleContextStack, 'font', 'Roboto');
  9081. var fontSize = getStyleProperty({}, styleContextStack, 'fontSize', 12);
  9082. var fontFeatures = getStyleProperty({}, styleContextStack, 'fontFeatures', null);
  9083. var bold = getStyleProperty({}, styleContextStack, 'bold', false);
  9084. var italics = getStyleProperty({}, styleContextStack, 'italics', false);
  9085. var lineHeight = getStyleProperty({}, styleContextStack, 'lineHeight', 1);
  9086. var characterSpacing = getStyleProperty({}, styleContextStack, 'characterSpacing', 0);
  9087. var font = this.fontProvider.provideFont(fontName, bold, italics);
  9088. return {
  9089. width: widthOfString(text, font, fontSize, characterSpacing, fontFeatures),
  9090. height: font.lineHeight(fontSize) * lineHeight,
  9091. fontSize: fontSize,
  9092. lineHeight: lineHeight,
  9093. ascender: font.ascender / 1000 * fontSize,
  9094. descender: font.descender / 1000 * fontSize
  9095. };
  9096. };
  9097. /**
  9098. * Returns size of the specified rotated string (without breaking it) using the current style
  9099. *
  9100. * @param {string} text text to be measured
  9101. * @param {number} angle
  9102. * @param {object} styleContextStack current style stack
  9103. * @returns {object} size of the specified string
  9104. */
  9105. TextTools.prototype.sizeOfRotatedText = function (text, angle, styleContextStack) {
  9106. var angleRad = angle * Math.PI / -180;
  9107. var size = this.sizeOfString(text, styleContextStack);
  9108. return {
  9109. width: Math.abs(size.height * Math.sin(angleRad)) + Math.abs(size.width * Math.cos(angleRad)),
  9110. height: Math.abs(size.width * Math.sin(angleRad)) + Math.abs(size.height * Math.cos(angleRad))
  9111. };
  9112. }
  9113. TextTools.prototype.widthOfString = function (text, font, fontSize, characterSpacing, fontFeatures) {
  9114. return widthOfString(text, font, fontSize, characterSpacing, fontFeatures);
  9115. };
  9116. function splitWords(text, noWrap) {
  9117. var results = [];
  9118. text = text.replace(/\t/g, ' ');
  9119. if (noWrap) {
  9120. results.push({ text: text });
  9121. return results;
  9122. }
  9123. var breaker = new LineBreaker(text);
  9124. var last = 0;
  9125. var bk;
  9126. while (bk = breaker.nextBreak()) {
  9127. var word = text.slice(last, bk.position);
  9128. if (bk.required || word.match(/\r?\n$|\r$/)) { // new line
  9129. word = word.replace(/\r?\n$|\r$/, '');
  9130. results.push({ text: word, lineEnd: true });
  9131. } else {
  9132. results.push({ text: word });
  9133. }
  9134. last = bk.position;
  9135. }
  9136. return results;
  9137. }
  9138. function copyStyle(source, destination) {
  9139. destination = destination || {};
  9140. source = source || {}; //TODO: default style
  9141. for (var key in source) {
  9142. if (key != 'text' && source.hasOwnProperty(key)) {
  9143. destination[key] = source[key];
  9144. }
  9145. }
  9146. return destination;
  9147. }
  9148. function normalizeTextArray(array, styleContextStack) {
  9149. function flatten(array) {
  9150. return array.reduce(function (prev, cur) {
  9151. var current = isArray(cur.text) ? flatten(cur.text) : cur;
  9152. var more = [].concat(current).some(Array.isArray);
  9153. return prev.concat(more ? flatten(current) : current);
  9154. }, []);
  9155. }
  9156. function getOneWord(index, words, noWrap) {
  9157. if (isUndefined(words[index])) {
  9158. return null;
  9159. }
  9160. if (words[index].lineEnd) {
  9161. return null;
  9162. }
  9163. var word = words[index].text;
  9164. if (noWrap) {
  9165. var tmpWords = splitWords(normalizeString(word), false);
  9166. if (isUndefined(tmpWords[tmpWords.length - 1])) {
  9167. return null;
  9168. }
  9169. word = tmpWords[tmpWords.length - 1].text;
  9170. }
  9171. return word;
  9172. }
  9173. var results = [];
  9174. if (!isArray(array)) {
  9175. array = [array];
  9176. }
  9177. array = flatten(array);
  9178. var lastWord = null;
  9179. for (var i = 0, l = array.length; i < l; i++) {
  9180. var item = array[i];
  9181. var style = null;
  9182. var words;
  9183. var noWrap = getStyleProperty(item || {}, styleContextStack, 'noWrap', false);
  9184. if (isObject(item)) {
  9185. if (item._textRef && item._textRef._textNodeRef.text) {
  9186. item.text = item._textRef._textNodeRef.text;
  9187. }
  9188. words = splitWords(normalizeString(item.text), noWrap);
  9189. style = copyStyle(item);
  9190. } else {
  9191. words = splitWords(normalizeString(item), noWrap);
  9192. }
  9193. if (lastWord && words.length) {
  9194. var firstWord = getOneWord(0, words, noWrap);
  9195. var wrapWords = splitWords(normalizeString(lastWord + firstWord), false);
  9196. if (wrapWords.length === 1) {
  9197. results[results.length - 1].noNewLine = true;
  9198. }
  9199. }
  9200. for (var i2 = 0, l2 = words.length; i2 < l2; i2++) {
  9201. var result = {
  9202. text: words[i2].text
  9203. };
  9204. if (words[i2].lineEnd) {
  9205. result.lineEnd = true;
  9206. }
  9207. copyStyle(style, result);
  9208. results.push(result);
  9209. }
  9210. lastWord = null;
  9211. if (i + 1 < l) {
  9212. lastWord = getOneWord(words.length - 1, words, noWrap);
  9213. }
  9214. }
  9215. return results;
  9216. }
  9217. function normalizeString(value) {
  9218. if (value === undefined || value === null) {
  9219. return '';
  9220. } else if (isNumber(value)) {
  9221. return value.toString();
  9222. } else if (isString(value)) {
  9223. return value;
  9224. } else {
  9225. return value.toString();
  9226. }
  9227. }
  9228. function getStyleProperty(item, styleContextStack, property, defaultValue) {
  9229. var value;
  9230. if (item[property] !== undefined && item[property] !== null) {
  9231. // item defines this property
  9232. return item[property];
  9233. }
  9234. if (!styleContextStack) {
  9235. return defaultValue;
  9236. }
  9237. styleContextStack.auto(item, function () {
  9238. value = styleContextStack.getProperty(property);
  9239. });
  9240. if (value !== null && value !== undefined) {
  9241. return value;
  9242. } else {
  9243. return defaultValue;
  9244. }
  9245. }
  9246. function measure(fontProvider, textArray, styleContextStack) {
  9247. var normalized = normalizeTextArray(textArray, styleContextStack);
  9248. if (normalized.length) {
  9249. var leadingIndent = getStyleProperty(normalized[0], styleContextStack, 'leadingIndent', 0);
  9250. if (leadingIndent) {
  9251. normalized[0].leadingCut = -leadingIndent;
  9252. normalized[0].leadingIndent = leadingIndent;
  9253. }
  9254. }
  9255. normalized.forEach(function (item) {
  9256. var fontName = getStyleProperty(item, styleContextStack, 'font', 'Roboto');
  9257. var fontSize = getStyleProperty(item, styleContextStack, 'fontSize', 12);
  9258. var fontFeatures = getStyleProperty(item, styleContextStack, 'fontFeatures', null);
  9259. var bold = getStyleProperty(item, styleContextStack, 'bold', false);
  9260. var italics = getStyleProperty(item, styleContextStack, 'italics', false);
  9261. var color = getStyleProperty(item, styleContextStack, 'color', 'black');
  9262. var decoration = getStyleProperty(item, styleContextStack, 'decoration', null);
  9263. var decorationColor = getStyleProperty(item, styleContextStack, 'decorationColor', null);
  9264. var decorationStyle = getStyleProperty(item, styleContextStack, 'decorationStyle', null);
  9265. var background = getStyleProperty(item, styleContextStack, 'background', null);
  9266. var lineHeight = getStyleProperty(item, styleContextStack, 'lineHeight', 1);
  9267. var characterSpacing = getStyleProperty(item, styleContextStack, 'characterSpacing', 0);
  9268. var link = getStyleProperty(item, styleContextStack, 'link', null);
  9269. var linkToPage = getStyleProperty(item, styleContextStack, 'linkToPage', null);
  9270. var linkToDestination = getStyleProperty(item, styleContextStack, 'linkToDestination', null);
  9271. var noWrap = getStyleProperty(item, styleContextStack, 'noWrap', null);
  9272. var preserveLeadingSpaces = getStyleProperty(item, styleContextStack, 'preserveLeadingSpaces', false);
  9273. var preserveTrailingSpaces = getStyleProperty(item, styleContextStack, 'preserveTrailingSpaces', false);
  9274. var opacity = getStyleProperty(item, styleContextStack, 'opacity', 1);
  9275. var font = fontProvider.provideFont(fontName, bold, italics);
  9276. item.width = widthOfString(item.text, font, fontSize, characterSpacing, fontFeatures);
  9277. item.height = font.lineHeight(fontSize) * lineHeight;
  9278. if (!item.leadingCut) {
  9279. item.leadingCut = 0;
  9280. }
  9281. var leadingSpaces;
  9282. if (!preserveLeadingSpaces && (leadingSpaces = item.text.match(LEADING))) {
  9283. item.leadingCut += widthOfString(leadingSpaces[0], font, fontSize, characterSpacing, fontFeatures);
  9284. }
  9285. var trailingSpaces;
  9286. if (!preserveTrailingSpaces && (trailingSpaces = item.text.match(TRAILING))) {
  9287. item.trailingCut = widthOfString(trailingSpaces[0], font, fontSize, characterSpacing, fontFeatures);
  9288. } else {
  9289. item.trailingCut = 0;
  9290. }
  9291. item.alignment = getStyleProperty(item, styleContextStack, 'alignment', 'left');
  9292. item.font = font;
  9293. item.fontSize = fontSize;
  9294. item.fontFeatures = fontFeatures;
  9295. item.characterSpacing = characterSpacing;
  9296. item.color = color;
  9297. item.decoration = decoration;
  9298. item.decorationColor = decorationColor;
  9299. item.decorationStyle = decorationStyle;
  9300. item.background = background;
  9301. item.link = link;
  9302. item.linkToPage = linkToPage;
  9303. item.linkToDestination = linkToDestination;
  9304. item.noWrap = noWrap;
  9305. item.opacity = opacity;
  9306. });
  9307. return normalized;
  9308. }
  9309. function widthOfString(text, font, fontSize, characterSpacing, fontFeatures) {
  9310. return font.widthOfString(text, fontSize, fontFeatures) + ((characterSpacing || 0) * (text.length - 1));
  9311. }
  9312. module.exports = TextTools;
  9313. /***/ }),
  9314. /* 131 */
  9315. /***/ (function(module, exports, __webpack_require__) {
  9316. "use strict";
  9317. var isString = __webpack_require__(0).isString;
  9318. function buildColumnWidths(columns, availableWidth) {
  9319. var autoColumns = [],
  9320. autoMin = 0, autoMax = 0,
  9321. starColumns = [],
  9322. starMaxMin = 0,
  9323. starMaxMax = 0,
  9324. fixedColumns = [],
  9325. initial_availableWidth = availableWidth;
  9326. columns.forEach(function (column) {
  9327. if (isAutoColumn(column)) {
  9328. autoColumns.push(column);
  9329. autoMin += column._minWidth;
  9330. autoMax += column._maxWidth;
  9331. } else if (isStarColumn(column)) {
  9332. starColumns.push(column);
  9333. starMaxMin = Math.max(starMaxMin, column._minWidth);
  9334. starMaxMax = Math.max(starMaxMax, column._maxWidth);
  9335. } else {
  9336. fixedColumns.push(column);
  9337. }
  9338. });
  9339. fixedColumns.forEach(function (col) {
  9340. // width specified as %
  9341. if (isString(col.width) && /\d+%/.test(col.width)) {
  9342. col.width = parseFloat(col.width) * initial_availableWidth / 100;
  9343. }
  9344. if (col.width < (col._minWidth) && col.elasticWidth) {
  9345. col._calcWidth = col._minWidth;
  9346. } else {
  9347. col._calcWidth = col.width;
  9348. }
  9349. availableWidth -= col._calcWidth;
  9350. });
  9351. // http://www.freesoft.org/CIE/RFC/1942/18.htm
  9352. // http://www.w3.org/TR/CSS2/tables.html#width-layout
  9353. // http://dev.w3.org/csswg/css3-tables-algorithms/Overview.src.htm
  9354. var minW = autoMin + starMaxMin * starColumns.length;
  9355. var maxW = autoMax + starMaxMax * starColumns.length;
  9356. if (minW >= availableWidth) {
  9357. // case 1 - there's no way to fit all columns within available width
  9358. // that's actually pretty bad situation with PDF as we have no horizontal scroll
  9359. // no easy workaround (unless we decide, in the future, to split single words)
  9360. // currently we simply use minWidths for all columns
  9361. autoColumns.forEach(function (col) {
  9362. col._calcWidth = col._minWidth;
  9363. });
  9364. starColumns.forEach(function (col) {
  9365. col._calcWidth = starMaxMin; // starMaxMin already contains padding
  9366. });
  9367. } else {
  9368. if (maxW < availableWidth) {
  9369. // case 2 - we can fit rest of the table within available space
  9370. autoColumns.forEach(function (col) {
  9371. col._calcWidth = col._maxWidth;
  9372. availableWidth -= col._calcWidth;
  9373. });
  9374. } else {
  9375. // maxW is too large, but minW fits within available width
  9376. var W = availableWidth - minW;
  9377. var D = maxW - minW;
  9378. autoColumns.forEach(function (col) {
  9379. var d = col._maxWidth - col._minWidth;
  9380. col._calcWidth = col._minWidth + d * W / D;
  9381. availableWidth -= col._calcWidth;
  9382. });
  9383. }
  9384. if (starColumns.length > 0) {
  9385. var starSize = availableWidth / starColumns.length;
  9386. starColumns.forEach(function (col) {
  9387. col._calcWidth = starSize;
  9388. });
  9389. }
  9390. }
  9391. }
  9392. function isAutoColumn(column) {
  9393. return column.width === 'auto';
  9394. }
  9395. function isStarColumn(column) {
  9396. return column.width === null || column.width === undefined || column.width === '*' || column.width === 'star';
  9397. }
  9398. //TODO: refactor and reuse in measureTable
  9399. function measureMinMax(columns) {
  9400. var result = { min: 0, max: 0 };
  9401. var maxStar = { min: 0, max: 0 };
  9402. var starCount = 0;
  9403. for (var i = 0, l = columns.length; i < l; i++) {
  9404. var c = columns[i];
  9405. if (isStarColumn(c)) {
  9406. maxStar.min = Math.max(maxStar.min, c._minWidth);
  9407. maxStar.max = Math.max(maxStar.max, c._maxWidth);
  9408. starCount++;
  9409. } else if (isAutoColumn(c)) {
  9410. result.min += c._minWidth;
  9411. result.max += c._maxWidth;
  9412. } else {
  9413. result.min += ((c.width !== undefined && c.width) || c._minWidth);
  9414. result.max += ((c.width !== undefined && c.width) || c._maxWidth);
  9415. }
  9416. }
  9417. if (starCount) {
  9418. result.min += starCount * maxStar.min;
  9419. result.max += starCount * maxStar.max;
  9420. }
  9421. return result;
  9422. }
  9423. /**
  9424. * Calculates column widths
  9425. * @private
  9426. */
  9427. module.exports = {
  9428. buildColumnWidths: buildColumnWidths,
  9429. measureMinMax: measureMinMax,
  9430. isAutoColumn: isAutoColumn,
  9431. isStarColumn: isStarColumn
  9432. };
  9433. /***/ }),
  9434. /* 132 */
  9435. /***/ (function(module, exports) {
  9436. var toString = {}.toString;
  9437. module.exports = Array.isArray || function (arr) {
  9438. return toString.call(arr) == '[object Array]';
  9439. };
  9440. /***/ }),
  9441. /* 133 */
  9442. /***/ (function(module, exports, __webpack_require__) {
  9443. var $export = __webpack_require__(5);
  9444. var fails = __webpack_require__(10);
  9445. var defined = __webpack_require__(30);
  9446. var quot = /"/g;
  9447. // B.2.3.2.1 CreateHTML(string, tag, attribute, value)
  9448. var createHTML = function (string, tag, attribute, value) {
  9449. var S = String(defined(string));
  9450. var p1 = '<' + tag;
  9451. if (attribute !== '') p1 += ' ' + attribute + '="' + String(value).replace(quot, '&quot;') + '"';
  9452. return p1 + '>' + S + '</' + tag + '>';
  9453. };
  9454. module.exports = function (NAME, exec) {
  9455. var O = {};
  9456. O[NAME] = exec(createHTML);
  9457. $export($export.P + $export.F * fails(function () {
  9458. var test = ''[NAME]('"');
  9459. return test !== test.toLowerCase() || test.split('"').length > 3;
  9460. }), 'String', O);
  9461. };
  9462. /***/ }),
  9463. /* 134 */
  9464. /***/ (function(module, exports, __webpack_require__) {
  9465. module.exports = !__webpack_require__(9) && !__webpack_require__(10)(function () {
  9466. return Object.defineProperty(__webpack_require__(135)('div'), 'a', { get: function () { return 7; } }).a != 7;
  9467. });
  9468. /***/ }),
  9469. /* 135 */
  9470. /***/ (function(module, exports, __webpack_require__) {
  9471. var isObject = __webpack_require__(18);
  9472. var document = __webpack_require__(8).document;
  9473. // typeof document.createElement is 'object' in old IE
  9474. var is = isObject(document) && isObject(document.createElement);
  9475. module.exports = function (it) {
  9476. return is ? document.createElement(it) : {};
  9477. };
  9478. /***/ }),
  9479. /* 136 */
  9480. /***/ (function(module, exports) {
  9481. module.exports = function (it) {
  9482. if (typeof it != 'function') throw TypeError(it + ' is not a function!');
  9483. return it;
  9484. };
  9485. /***/ }),
  9486. /* 137 */
  9487. /***/ (function(module, exports, __webpack_require__) {
  9488. "use strict";
  9489. // B.2.3.10 String.prototype.link(url)
  9490. __webpack_require__(133)('link', function (createHTML) {
  9491. return function link(url) {
  9492. return createHTML(this, 'a', 'href', url);
  9493. };
  9494. });
  9495. /***/ }),
  9496. /* 138 */
  9497. /***/ (function(module, exports, __webpack_require__) {
  9498. var has = __webpack_require__(24);
  9499. var toIObject = __webpack_require__(43);
  9500. var arrayIndexOf = __webpack_require__(86)(false);
  9501. var IE_PROTO = __webpack_require__(87)('IE_PROTO');
  9502. module.exports = function (object, names) {
  9503. var O = toIObject(object);
  9504. var i = 0;
  9505. var result = [];
  9506. var key;
  9507. for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);
  9508. // Don't enum bug & hidden keys
  9509. while (names.length > i) if (has(O, key = names[i++])) {
  9510. ~arrayIndexOf(result, key) || result.push(key);
  9511. }
  9512. return result;
  9513. };
  9514. /***/ }),
  9515. /* 139 */
  9516. /***/ (function(module, exports, __webpack_require__) {
  9517. // 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length)
  9518. var $export = __webpack_require__(5);
  9519. $export($export.P, 'Array', { fill: __webpack_require__(90) });
  9520. __webpack_require__(91)('fill');
  9521. /***/ }),
  9522. /* 140 */
  9523. /***/ (function(module, exports, __webpack_require__) {
  9524. "use strict";
  9525. if (__webpack_require__(9)) {
  9526. var LIBRARY = __webpack_require__(41);
  9527. var global = __webpack_require__(8);
  9528. var fails = __webpack_require__(10);
  9529. var $export = __webpack_require__(5);
  9530. var $typed = __webpack_require__(141);
  9531. var $buffer = __webpack_require__(226);
  9532. var ctx = __webpack_require__(52);
  9533. var anInstance = __webpack_require__(143);
  9534. var propertyDesc = __webpack_require__(40);
  9535. var hide = __webpack_require__(15);
  9536. var redefineAll = __webpack_require__(142);
  9537. var toInteger = __webpack_require__(31);
  9538. var toLength = __webpack_require__(16);
  9539. var toIndex = __webpack_require__(144);
  9540. var toAbsoluteIndex = __webpack_require__(54);
  9541. var toPrimitive = __webpack_require__(51);
  9542. var has = __webpack_require__(24);
  9543. var classof = __webpack_require__(64);
  9544. var isObject = __webpack_require__(18);
  9545. var toObject = __webpack_require__(19);
  9546. var isArrayIter = __webpack_require__(145);
  9547. var create = __webpack_require__(65);
  9548. var getPrototypeOf = __webpack_require__(146);
  9549. var gOPN = __webpack_require__(55).f;
  9550. var getIterFn = __webpack_require__(147);
  9551. var uid = __webpack_require__(29);
  9552. var wks = __webpack_require__(3);
  9553. var createArrayMethod = __webpack_require__(229);
  9554. var createArrayIncludes = __webpack_require__(86);
  9555. var speciesConstructor = __webpack_require__(149);
  9556. var ArrayIterators = __webpack_require__(66);
  9557. var Iterators = __webpack_require__(45);
  9558. var $iterDetect = __webpack_require__(151);
  9559. var setSpecies = __webpack_require__(234);
  9560. var arrayFill = __webpack_require__(90);
  9561. var arrayCopyWithin = __webpack_require__(235);
  9562. var $DP = __webpack_require__(11);
  9563. var $GOPD = __webpack_require__(67);
  9564. var dP = $DP.f;
  9565. var gOPD = $GOPD.f;
  9566. var RangeError = global.RangeError;
  9567. var TypeError = global.TypeError;
  9568. var Uint8Array = global.Uint8Array;
  9569. var ARRAY_BUFFER = 'ArrayBuffer';
  9570. var SHARED_BUFFER = 'Shared' + ARRAY_BUFFER;
  9571. var BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT';
  9572. var PROTOTYPE = 'prototype';
  9573. var ArrayProto = Array[PROTOTYPE];
  9574. var $ArrayBuffer = $buffer.ArrayBuffer;
  9575. var $DataView = $buffer.DataView;
  9576. var arrayForEach = createArrayMethod(0);
  9577. var arrayFilter = createArrayMethod(2);
  9578. var arraySome = createArrayMethod(3);
  9579. var arrayEvery = createArrayMethod(4);
  9580. var arrayFind = createArrayMethod(5);
  9581. var arrayFindIndex = createArrayMethod(6);
  9582. var arrayIncludes = createArrayIncludes(true);
  9583. var arrayIndexOf = createArrayIncludes(false);
  9584. var arrayValues = ArrayIterators.values;
  9585. var arrayKeys = ArrayIterators.keys;
  9586. var arrayEntries = ArrayIterators.entries;
  9587. var arrayLastIndexOf = ArrayProto.lastIndexOf;
  9588. var arrayReduce = ArrayProto.reduce;
  9589. var arrayReduceRight = ArrayProto.reduceRight;
  9590. var arrayJoin = ArrayProto.join;
  9591. var arraySort = ArrayProto.sort;
  9592. var arraySlice = ArrayProto.slice;
  9593. var arrayToString = ArrayProto.toString;
  9594. var arrayToLocaleString = ArrayProto.toLocaleString;
  9595. var ITERATOR = wks('iterator');
  9596. var TAG = wks('toStringTag');
  9597. var TYPED_CONSTRUCTOR = uid('typed_constructor');
  9598. var DEF_CONSTRUCTOR = uid('def_constructor');
  9599. var ALL_CONSTRUCTORS = $typed.CONSTR;
  9600. var TYPED_ARRAY = $typed.TYPED;
  9601. var VIEW = $typed.VIEW;
  9602. var WRONG_LENGTH = 'Wrong length!';
  9603. var $map = createArrayMethod(1, function (O, length) {
  9604. return allocate(speciesConstructor(O, O[DEF_CONSTRUCTOR]), length);
  9605. });
  9606. var LITTLE_ENDIAN = fails(function () {
  9607. // eslint-disable-next-line no-undef
  9608. return new Uint8Array(new Uint16Array([1]).buffer)[0] === 1;
  9609. });
  9610. var FORCED_SET = !!Uint8Array && !!Uint8Array[PROTOTYPE].set && fails(function () {
  9611. new Uint8Array(1).set({});
  9612. });
  9613. var toOffset = function (it, BYTES) {
  9614. var offset = toInteger(it);
  9615. if (offset < 0 || offset % BYTES) throw RangeError('Wrong offset!');
  9616. return offset;
  9617. };
  9618. var validate = function (it) {
  9619. if (isObject(it) && TYPED_ARRAY in it) return it;
  9620. throw TypeError(it + ' is not a typed array!');
  9621. };
  9622. var allocate = function (C, length) {
  9623. if (!(isObject(C) && TYPED_CONSTRUCTOR in C)) {
  9624. throw TypeError('It is not a typed array constructor!');
  9625. } return new C(length);
  9626. };
  9627. var speciesFromList = function (O, list) {
  9628. return fromList(speciesConstructor(O, O[DEF_CONSTRUCTOR]), list);
  9629. };
  9630. var fromList = function (C, list) {
  9631. var index = 0;
  9632. var length = list.length;
  9633. var result = allocate(C, length);
  9634. while (length > index) result[index] = list[index++];
  9635. return result;
  9636. };
  9637. var addGetter = function (it, key, internal) {
  9638. dP(it, key, { get: function () { return this._d[internal]; } });
  9639. };
  9640. var $from = function from(source /* , mapfn, thisArg */) {
  9641. var O = toObject(source);
  9642. var aLen = arguments.length;
  9643. var mapfn = aLen > 1 ? arguments[1] : undefined;
  9644. var mapping = mapfn !== undefined;
  9645. var iterFn = getIterFn(O);
  9646. var i, length, values, result, step, iterator;
  9647. if (iterFn != undefined && !isArrayIter(iterFn)) {
  9648. for (iterator = iterFn.call(O), values = [], i = 0; !(step = iterator.next()).done; i++) {
  9649. values.push(step.value);
  9650. } O = values;
  9651. }
  9652. if (mapping && aLen > 2) mapfn = ctx(mapfn, arguments[2], 2);
  9653. for (i = 0, length = toLength(O.length), result = allocate(this, length); length > i; i++) {
  9654. result[i] = mapping ? mapfn(O[i], i) : O[i];
  9655. }
  9656. return result;
  9657. };
  9658. var $of = function of(/* ...items */) {
  9659. var index = 0;
  9660. var length = arguments.length;
  9661. var result = allocate(this, length);
  9662. while (length > index) result[index] = arguments[index++];
  9663. return result;
  9664. };
  9665. // iOS Safari 6.x fails here
  9666. var TO_LOCALE_BUG = !!Uint8Array && fails(function () { arrayToLocaleString.call(new Uint8Array(1)); });
  9667. var $toLocaleString = function toLocaleString() {
  9668. return arrayToLocaleString.apply(TO_LOCALE_BUG ? arraySlice.call(validate(this)) : validate(this), arguments);
  9669. };
  9670. var proto = {
  9671. copyWithin: function copyWithin(target, start /* , end */) {
  9672. return arrayCopyWithin.call(validate(this), target, start, arguments.length > 2 ? arguments[2] : undefined);
  9673. },
  9674. every: function every(callbackfn /* , thisArg */) {
  9675. return arrayEvery(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  9676. },
  9677. fill: function fill(value /* , start, end */) { // eslint-disable-line no-unused-vars
  9678. return arrayFill.apply(validate(this), arguments);
  9679. },
  9680. filter: function filter(callbackfn /* , thisArg */) {
  9681. return speciesFromList(this, arrayFilter(validate(this), callbackfn,
  9682. arguments.length > 1 ? arguments[1] : undefined));
  9683. },
  9684. find: function find(predicate /* , thisArg */) {
  9685. return arrayFind(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined);
  9686. },
  9687. findIndex: function findIndex(predicate /* , thisArg */) {
  9688. return arrayFindIndex(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined);
  9689. },
  9690. forEach: function forEach(callbackfn /* , thisArg */) {
  9691. arrayForEach(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  9692. },
  9693. indexOf: function indexOf(searchElement /* , fromIndex */) {
  9694. return arrayIndexOf(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);
  9695. },
  9696. includes: function includes(searchElement /* , fromIndex */) {
  9697. return arrayIncludes(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);
  9698. },
  9699. join: function join(separator) { // eslint-disable-line no-unused-vars
  9700. return arrayJoin.apply(validate(this), arguments);
  9701. },
  9702. lastIndexOf: function lastIndexOf(searchElement /* , fromIndex */) { // eslint-disable-line no-unused-vars
  9703. return arrayLastIndexOf.apply(validate(this), arguments);
  9704. },
  9705. map: function map(mapfn /* , thisArg */) {
  9706. return $map(validate(this), mapfn, arguments.length > 1 ? arguments[1] : undefined);
  9707. },
  9708. reduce: function reduce(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars
  9709. return arrayReduce.apply(validate(this), arguments);
  9710. },
  9711. reduceRight: function reduceRight(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars
  9712. return arrayReduceRight.apply(validate(this), arguments);
  9713. },
  9714. reverse: function reverse() {
  9715. var that = this;
  9716. var length = validate(that).length;
  9717. var middle = Math.floor(length / 2);
  9718. var index = 0;
  9719. var value;
  9720. while (index < middle) {
  9721. value = that[index];
  9722. that[index++] = that[--length];
  9723. that[length] = value;
  9724. } return that;
  9725. },
  9726. some: function some(callbackfn /* , thisArg */) {
  9727. return arraySome(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  9728. },
  9729. sort: function sort(comparefn) {
  9730. return arraySort.call(validate(this), comparefn);
  9731. },
  9732. subarray: function subarray(begin, end) {
  9733. var O = validate(this);
  9734. var length = O.length;
  9735. var $begin = toAbsoluteIndex(begin, length);
  9736. return new (speciesConstructor(O, O[DEF_CONSTRUCTOR]))(
  9737. O.buffer,
  9738. O.byteOffset + $begin * O.BYTES_PER_ELEMENT,
  9739. toLength((end === undefined ? length : toAbsoluteIndex(end, length)) - $begin)
  9740. );
  9741. }
  9742. };
  9743. var $slice = function slice(start, end) {
  9744. return speciesFromList(this, arraySlice.call(validate(this), start, end));
  9745. };
  9746. var $set = function set(arrayLike /* , offset */) {
  9747. validate(this);
  9748. var offset = toOffset(arguments[1], 1);
  9749. var length = this.length;
  9750. var src = toObject(arrayLike);
  9751. var len = toLength(src.length);
  9752. var index = 0;
  9753. if (len + offset > length) throw RangeError(WRONG_LENGTH);
  9754. while (index < len) this[offset + index] = src[index++];
  9755. };
  9756. var $iterators = {
  9757. entries: function entries() {
  9758. return arrayEntries.call(validate(this));
  9759. },
  9760. keys: function keys() {
  9761. return arrayKeys.call(validate(this));
  9762. },
  9763. values: function values() {
  9764. return arrayValues.call(validate(this));
  9765. }
  9766. };
  9767. var isTAIndex = function (target, key) {
  9768. return isObject(target)
  9769. && target[TYPED_ARRAY]
  9770. && typeof key != 'symbol'
  9771. && key in target
  9772. && String(+key) == String(key);
  9773. };
  9774. var $getDesc = function getOwnPropertyDescriptor(target, key) {
  9775. return isTAIndex(target, key = toPrimitive(key, true))
  9776. ? propertyDesc(2, target[key])
  9777. : gOPD(target, key);
  9778. };
  9779. var $setDesc = function defineProperty(target, key, desc) {
  9780. if (isTAIndex(target, key = toPrimitive(key, true))
  9781. && isObject(desc)
  9782. && has(desc, 'value')
  9783. && !has(desc, 'get')
  9784. && !has(desc, 'set')
  9785. // TODO: add validation descriptor w/o calling accessors
  9786. && !desc.configurable
  9787. && (!has(desc, 'writable') || desc.writable)
  9788. && (!has(desc, 'enumerable') || desc.enumerable)
  9789. ) {
  9790. target[key] = desc.value;
  9791. return target;
  9792. } return dP(target, key, desc);
  9793. };
  9794. if (!ALL_CONSTRUCTORS) {
  9795. $GOPD.f = $getDesc;
  9796. $DP.f = $setDesc;
  9797. }
  9798. $export($export.S + $export.F * !ALL_CONSTRUCTORS, 'Object', {
  9799. getOwnPropertyDescriptor: $getDesc,
  9800. defineProperty: $setDesc
  9801. });
  9802. if (fails(function () { arrayToString.call({}); })) {
  9803. arrayToString = arrayToLocaleString = function toString() {
  9804. return arrayJoin.call(this);
  9805. };
  9806. }
  9807. var $TypedArrayPrototype$ = redefineAll({}, proto);
  9808. redefineAll($TypedArrayPrototype$, $iterators);
  9809. hide($TypedArrayPrototype$, ITERATOR, $iterators.values);
  9810. redefineAll($TypedArrayPrototype$, {
  9811. slice: $slice,
  9812. set: $set,
  9813. constructor: function () { /* noop */ },
  9814. toString: arrayToString,
  9815. toLocaleString: $toLocaleString
  9816. });
  9817. addGetter($TypedArrayPrototype$, 'buffer', 'b');
  9818. addGetter($TypedArrayPrototype$, 'byteOffset', 'o');
  9819. addGetter($TypedArrayPrototype$, 'byteLength', 'l');
  9820. addGetter($TypedArrayPrototype$, 'length', 'e');
  9821. dP($TypedArrayPrototype$, TAG, {
  9822. get: function () { return this[TYPED_ARRAY]; }
  9823. });
  9824. // eslint-disable-next-line max-statements
  9825. module.exports = function (KEY, BYTES, wrapper, CLAMPED) {
  9826. CLAMPED = !!CLAMPED;
  9827. var NAME = KEY + (CLAMPED ? 'Clamped' : '') + 'Array';
  9828. var GETTER = 'get' + KEY;
  9829. var SETTER = 'set' + KEY;
  9830. var TypedArray = global[NAME];
  9831. var Base = TypedArray || {};
  9832. var TAC = TypedArray && getPrototypeOf(TypedArray);
  9833. var FORCED = !TypedArray || !$typed.ABV;
  9834. var O = {};
  9835. var TypedArrayPrototype = TypedArray && TypedArray[PROTOTYPE];
  9836. var getter = function (that, index) {
  9837. var data = that._d;
  9838. return data.v[GETTER](index * BYTES + data.o, LITTLE_ENDIAN);
  9839. };
  9840. var setter = function (that, index, value) {
  9841. var data = that._d;
  9842. if (CLAMPED) value = (value = Math.round(value)) < 0 ? 0 : value > 0xff ? 0xff : value & 0xff;
  9843. data.v[SETTER](index * BYTES + data.o, value, LITTLE_ENDIAN);
  9844. };
  9845. var addElement = function (that, index) {
  9846. dP(that, index, {
  9847. get: function () {
  9848. return getter(this, index);
  9849. },
  9850. set: function (value) {
  9851. return setter(this, index, value);
  9852. },
  9853. enumerable: true
  9854. });
  9855. };
  9856. if (FORCED) {
  9857. TypedArray = wrapper(function (that, data, $offset, $length) {
  9858. anInstance(that, TypedArray, NAME, '_d');
  9859. var index = 0;
  9860. var offset = 0;
  9861. var buffer, byteLength, length, klass;
  9862. if (!isObject(data)) {
  9863. length = toIndex(data);
  9864. byteLength = length * BYTES;
  9865. buffer = new $ArrayBuffer(byteLength);
  9866. } else if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) {
  9867. buffer = data;
  9868. offset = toOffset($offset, BYTES);
  9869. var $len = data.byteLength;
  9870. if ($length === undefined) {
  9871. if ($len % BYTES) throw RangeError(WRONG_LENGTH);
  9872. byteLength = $len - offset;
  9873. if (byteLength < 0) throw RangeError(WRONG_LENGTH);
  9874. } else {
  9875. byteLength = toLength($length) * BYTES;
  9876. if (byteLength + offset > $len) throw RangeError(WRONG_LENGTH);
  9877. }
  9878. length = byteLength / BYTES;
  9879. } else if (TYPED_ARRAY in data) {
  9880. return fromList(TypedArray, data);
  9881. } else {
  9882. return $from.call(TypedArray, data);
  9883. }
  9884. hide(that, '_d', {
  9885. b: buffer,
  9886. o: offset,
  9887. l: byteLength,
  9888. e: length,
  9889. v: new $DataView(buffer)
  9890. });
  9891. while (index < length) addElement(that, index++);
  9892. });
  9893. TypedArrayPrototype = TypedArray[PROTOTYPE] = create($TypedArrayPrototype$);
  9894. hide(TypedArrayPrototype, 'constructor', TypedArray);
  9895. } else if (!fails(function () {
  9896. TypedArray(1);
  9897. }) || !fails(function () {
  9898. new TypedArray(-1); // eslint-disable-line no-new
  9899. }) || !$iterDetect(function (iter) {
  9900. new TypedArray(); // eslint-disable-line no-new
  9901. new TypedArray(null); // eslint-disable-line no-new
  9902. new TypedArray(1.5); // eslint-disable-line no-new
  9903. new TypedArray(iter); // eslint-disable-line no-new
  9904. }, true)) {
  9905. TypedArray = wrapper(function (that, data, $offset, $length) {
  9906. anInstance(that, TypedArray, NAME);
  9907. var klass;
  9908. // `ws` module bug, temporarily remove validation length for Uint8Array
  9909. // https://github.com/websockets/ws/pull/645
  9910. if (!isObject(data)) return new Base(toIndex(data));
  9911. if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) {
  9912. return $length !== undefined
  9913. ? new Base(data, toOffset($offset, BYTES), $length)
  9914. : $offset !== undefined
  9915. ? new Base(data, toOffset($offset, BYTES))
  9916. : new Base(data);
  9917. }
  9918. if (TYPED_ARRAY in data) return fromList(TypedArray, data);
  9919. return $from.call(TypedArray, data);
  9920. });
  9921. arrayForEach(TAC !== Function.prototype ? gOPN(Base).concat(gOPN(TAC)) : gOPN(Base), function (key) {
  9922. if (!(key in TypedArray)) hide(TypedArray, key, Base[key]);
  9923. });
  9924. TypedArray[PROTOTYPE] = TypedArrayPrototype;
  9925. if (!LIBRARY) TypedArrayPrototype.constructor = TypedArray;
  9926. }
  9927. var $nativeIterator = TypedArrayPrototype[ITERATOR];
  9928. var CORRECT_ITER_NAME = !!$nativeIterator
  9929. && ($nativeIterator.name == 'values' || $nativeIterator.name == undefined);
  9930. var $iterator = $iterators.values;
  9931. hide(TypedArray, TYPED_CONSTRUCTOR, true);
  9932. hide(TypedArrayPrototype, TYPED_ARRAY, NAME);
  9933. hide(TypedArrayPrototype, VIEW, true);
  9934. hide(TypedArrayPrototype, DEF_CONSTRUCTOR, TypedArray);
  9935. if (CLAMPED ? new TypedArray(1)[TAG] != NAME : !(TAG in TypedArrayPrototype)) {
  9936. dP(TypedArrayPrototype, TAG, {
  9937. get: function () { return NAME; }
  9938. });
  9939. }
  9940. O[NAME] = TypedArray;
  9941. $export($export.G + $export.W + $export.F * (TypedArray != Base), O);
  9942. $export($export.S, NAME, {
  9943. BYTES_PER_ELEMENT: BYTES
  9944. });
  9945. $export($export.S + $export.F * fails(function () { Base.of.call(TypedArray, 1); }), NAME, {
  9946. from: $from,
  9947. of: $of
  9948. });
  9949. if (!(BYTES_PER_ELEMENT in TypedArrayPrototype)) hide(TypedArrayPrototype, BYTES_PER_ELEMENT, BYTES);
  9950. $export($export.P, NAME, proto);
  9951. setSpecies(NAME);
  9952. $export($export.P + $export.F * FORCED_SET, NAME, { set: $set });
  9953. $export($export.P + $export.F * !CORRECT_ITER_NAME, NAME, $iterators);
  9954. if (!LIBRARY && TypedArrayPrototype.toString != arrayToString) TypedArrayPrototype.toString = arrayToString;
  9955. $export($export.P + $export.F * fails(function () {
  9956. new TypedArray(1).slice();
  9957. }), NAME, { slice: $slice });
  9958. $export($export.P + $export.F * (fails(function () {
  9959. return [1, 2].toLocaleString() != new TypedArray([1, 2]).toLocaleString();
  9960. }) || !fails(function () {
  9961. TypedArrayPrototype.toLocaleString.call([1, 2]);
  9962. })), NAME, { toLocaleString: $toLocaleString });
  9963. Iterators[NAME] = CORRECT_ITER_NAME ? $nativeIterator : $iterator;
  9964. if (!LIBRARY && !CORRECT_ITER_NAME) hide(TypedArrayPrototype, ITERATOR, $iterator);
  9965. };
  9966. } else module.exports = function () { /* empty */ };
  9967. /***/ }),
  9968. /* 141 */
  9969. /***/ (function(module, exports, __webpack_require__) {
  9970. var global = __webpack_require__(8);
  9971. var hide = __webpack_require__(15);
  9972. var uid = __webpack_require__(29);
  9973. var TYPED = uid('typed_array');
  9974. var VIEW = uid('view');
  9975. var ABV = !!(global.ArrayBuffer && global.DataView);
  9976. var CONSTR = ABV;
  9977. var i = 0;
  9978. var l = 9;
  9979. var Typed;
  9980. var TypedArrayConstructors = (
  9981. 'Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array'
  9982. ).split(',');
  9983. while (i < l) {
  9984. if (Typed = global[TypedArrayConstructors[i++]]) {
  9985. hide(Typed.prototype, TYPED, true);
  9986. hide(Typed.prototype, VIEW, true);
  9987. } else CONSTR = false;
  9988. }
  9989. module.exports = {
  9990. ABV: ABV,
  9991. CONSTR: CONSTR,
  9992. TYPED: TYPED,
  9993. VIEW: VIEW
  9994. };
  9995. /***/ }),
  9996. /* 142 */
  9997. /***/ (function(module, exports, __webpack_require__) {
  9998. var redefine = __webpack_require__(23);
  9999. module.exports = function (target, src, safe) {
  10000. for (var key in src) redefine(target, key, src[key], safe);
  10001. return target;
  10002. };
  10003. /***/ }),
  10004. /* 143 */
  10005. /***/ (function(module, exports) {
  10006. module.exports = function (it, Constructor, name, forbiddenField) {
  10007. if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) {
  10008. throw TypeError(name + ': incorrect invocation!');
  10009. } return it;
  10010. };
  10011. /***/ }),
  10012. /* 144 */
  10013. /***/ (function(module, exports, __webpack_require__) {
  10014. // https://tc39.github.io/ecma262/#sec-toindex
  10015. var toInteger = __webpack_require__(31);
  10016. var toLength = __webpack_require__(16);
  10017. module.exports = function (it) {
  10018. if (it === undefined) return 0;
  10019. var number = toInteger(it);
  10020. var length = toLength(number);
  10021. if (number !== length) throw RangeError('Wrong length!');
  10022. return length;
  10023. };
  10024. /***/ }),
  10025. /* 145 */
  10026. /***/ (function(module, exports, __webpack_require__) {
  10027. // check on default Array iterator
  10028. var Iterators = __webpack_require__(45);
  10029. var ITERATOR = __webpack_require__(3)('iterator');
  10030. var ArrayProto = Array.prototype;
  10031. module.exports = function (it) {
  10032. return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it);
  10033. };
  10034. /***/ }),
  10035. /* 146 */
  10036. /***/ (function(module, exports, __webpack_require__) {
  10037. // 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)
  10038. var has = __webpack_require__(24);
  10039. var toObject = __webpack_require__(19);
  10040. var IE_PROTO = __webpack_require__(87)('IE_PROTO');
  10041. var ObjectProto = Object.prototype;
  10042. module.exports = Object.getPrototypeOf || function (O) {
  10043. O = toObject(O);
  10044. if (has(O, IE_PROTO)) return O[IE_PROTO];
  10045. if (typeof O.constructor == 'function' && O instanceof O.constructor) {
  10046. return O.constructor.prototype;
  10047. } return O instanceof Object ? ObjectProto : null;
  10048. };
  10049. /***/ }),
  10050. /* 147 */
  10051. /***/ (function(module, exports, __webpack_require__) {
  10052. var classof = __webpack_require__(64);
  10053. var ITERATOR = __webpack_require__(3)('iterator');
  10054. var Iterators = __webpack_require__(45);
  10055. module.exports = __webpack_require__(39).getIteratorMethod = function (it) {
  10056. if (it != undefined) return it[ITERATOR]
  10057. || it['@@iterator']
  10058. || Iterators[classof(it)];
  10059. };
  10060. /***/ }),
  10061. /* 148 */
  10062. /***/ (function(module, exports, __webpack_require__) {
  10063. // 7.2.2 IsArray(argument)
  10064. var cof = __webpack_require__(53);
  10065. module.exports = Array.isArray || function isArray(arg) {
  10066. return cof(arg) == 'Array';
  10067. };
  10068. /***/ }),
  10069. /* 149 */
  10070. /***/ (function(module, exports, __webpack_require__) {
  10071. // 7.3.20 SpeciesConstructor(O, defaultConstructor)
  10072. var anObject = __webpack_require__(12);
  10073. var aFunction = __webpack_require__(136);
  10074. var SPECIES = __webpack_require__(3)('species');
  10075. module.exports = function (O, D) {
  10076. var C = anObject(O).constructor;
  10077. var S;
  10078. return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S);
  10079. };
  10080. /***/ }),
  10081. /* 150 */
  10082. /***/ (function(module, exports, __webpack_require__) {
  10083. "use strict";
  10084. var LIBRARY = __webpack_require__(41);
  10085. var $export = __webpack_require__(5);
  10086. var redefine = __webpack_require__(23);
  10087. var hide = __webpack_require__(15);
  10088. var Iterators = __webpack_require__(45);
  10089. var $iterCreate = __webpack_require__(233);
  10090. var setToStringTag = __webpack_require__(63);
  10091. var getPrototypeOf = __webpack_require__(146);
  10092. var ITERATOR = __webpack_require__(3)('iterator');
  10093. var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`
  10094. var FF_ITERATOR = '@@iterator';
  10095. var KEYS = 'keys';
  10096. var VALUES = 'values';
  10097. var returnThis = function () { return this; };
  10098. module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {
  10099. $iterCreate(Constructor, NAME, next);
  10100. var getMethod = function (kind) {
  10101. if (!BUGGY && kind in proto) return proto[kind];
  10102. switch (kind) {
  10103. case KEYS: return function keys() { return new Constructor(this, kind); };
  10104. case VALUES: return function values() { return new Constructor(this, kind); };
  10105. } return function entries() { return new Constructor(this, kind); };
  10106. };
  10107. var TAG = NAME + ' Iterator';
  10108. var DEF_VALUES = DEFAULT == VALUES;
  10109. var VALUES_BUG = false;
  10110. var proto = Base.prototype;
  10111. var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];
  10112. var $default = $native || getMethod(DEFAULT);
  10113. var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;
  10114. var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;
  10115. var methods, key, IteratorPrototype;
  10116. // Fix native
  10117. if ($anyNative) {
  10118. IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));
  10119. if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {
  10120. // Set @@toStringTag to native iterators
  10121. setToStringTag(IteratorPrototype, TAG, true);
  10122. // fix for some old engines
  10123. if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis);
  10124. }
  10125. }
  10126. // fix Array#{values, @@iterator}.name in V8 / FF
  10127. if (DEF_VALUES && $native && $native.name !== VALUES) {
  10128. VALUES_BUG = true;
  10129. $default = function values() { return $native.call(this); };
  10130. }
  10131. // Define iterator
  10132. if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {
  10133. hide(proto, ITERATOR, $default);
  10134. }
  10135. // Plug for library
  10136. Iterators[NAME] = $default;
  10137. Iterators[TAG] = returnThis;
  10138. if (DEFAULT) {
  10139. methods = {
  10140. values: DEF_VALUES ? $default : getMethod(VALUES),
  10141. keys: IS_SET ? $default : getMethod(KEYS),
  10142. entries: $entries
  10143. };
  10144. if (FORCED) for (key in methods) {
  10145. if (!(key in proto)) redefine(proto, key, methods[key]);
  10146. } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);
  10147. }
  10148. return methods;
  10149. };
  10150. /***/ }),
  10151. /* 151 */
  10152. /***/ (function(module, exports, __webpack_require__) {
  10153. var ITERATOR = __webpack_require__(3)('iterator');
  10154. var SAFE_CLOSING = false;
  10155. try {
  10156. var riter = [7][ITERATOR]();
  10157. riter['return'] = function () { SAFE_CLOSING = true; };
  10158. // eslint-disable-next-line no-throw-literal
  10159. Array.from(riter, function () { throw 2; });
  10160. } catch (e) { /* empty */ }
  10161. module.exports = function (exec, skipClosing) {
  10162. if (!skipClosing && !SAFE_CLOSING) return false;
  10163. var safe = false;
  10164. try {
  10165. var arr = [7];
  10166. var iter = arr[ITERATOR]();
  10167. iter.next = function () { return { done: safe = true }; };
  10168. arr[ITERATOR] = function () { return iter; };
  10169. exec(arr);
  10170. } catch (e) { /* empty */ }
  10171. return safe;
  10172. };
  10173. /***/ }),
  10174. /* 152 */
  10175. /***/ (function(module, exports, __webpack_require__) {
  10176. var dP = __webpack_require__(11).f;
  10177. var FProto = Function.prototype;
  10178. var nameRE = /^\s*function ([^ (]*)/;
  10179. var NAME = 'name';
  10180. // 19.2.4.2 name
  10181. NAME in FProto || __webpack_require__(9) && dP(FProto, NAME, {
  10182. configurable: true,
  10183. get: function () {
  10184. try {
  10185. return ('' + this).match(nameRE)[1];
  10186. } catch (e) {
  10187. return '';
  10188. }
  10189. }
  10190. });
  10191. /***/ }),
  10192. /* 153 */
  10193. /***/ (function(module, exports, __webpack_require__) {
  10194. "use strict";
  10195. var isRegExp = __webpack_require__(154);
  10196. var anObject = __webpack_require__(12);
  10197. var speciesConstructor = __webpack_require__(149);
  10198. var advanceStringIndex = __webpack_require__(93);
  10199. var toLength = __webpack_require__(16);
  10200. var callRegExpExec = __webpack_require__(95);
  10201. var regexpExec = __webpack_require__(97);
  10202. var fails = __webpack_require__(10);
  10203. var $min = Math.min;
  10204. var $push = [].push;
  10205. var $SPLIT = 'split';
  10206. var LENGTH = 'length';
  10207. var LAST_INDEX = 'lastIndex';
  10208. var MAX_UINT32 = 0xffffffff;
  10209. // babel-minify transpiles RegExp('x', 'y') -> /x/y and it causes SyntaxError
  10210. var SUPPORTS_Y = !fails(function () { RegExp(MAX_UINT32, 'y'); });
  10211. // @@split logic
  10212. __webpack_require__(96)('split', 2, function (defined, SPLIT, $split, maybeCallNative) {
  10213. var internalSplit;
  10214. if (
  10215. 'abbc'[$SPLIT](/(b)*/)[1] == 'c' ||
  10216. 'test'[$SPLIT](/(?:)/, -1)[LENGTH] != 4 ||
  10217. 'ab'[$SPLIT](/(?:ab)*/)[LENGTH] != 2 ||
  10218. '.'[$SPLIT](/(.?)(.?)/)[LENGTH] != 4 ||
  10219. '.'[$SPLIT](/()()/)[LENGTH] > 1 ||
  10220. ''[$SPLIT](/.?/)[LENGTH]
  10221. ) {
  10222. // based on es5-shim implementation, need to rework it
  10223. internalSplit = function (separator, limit) {
  10224. var string = String(this);
  10225. if (separator === undefined && limit === 0) return [];
  10226. // If `separator` is not a regex, use native split
  10227. if (!isRegExp(separator)) return $split.call(string, separator, limit);
  10228. var output = [];
  10229. var flags = (separator.ignoreCase ? 'i' : '') +
  10230. (separator.multiline ? 'm' : '') +
  10231. (separator.unicode ? 'u' : '') +
  10232. (separator.sticky ? 'y' : '');
  10233. var lastLastIndex = 0;
  10234. var splitLimit = limit === undefined ? MAX_UINT32 : limit >>> 0;
  10235. // Make `global` and avoid `lastIndex` issues by working with a copy
  10236. var separatorCopy = new RegExp(separator.source, flags + 'g');
  10237. var match, lastIndex, lastLength;
  10238. while (match = regexpExec.call(separatorCopy, string)) {
  10239. lastIndex = separatorCopy[LAST_INDEX];
  10240. if (lastIndex > lastLastIndex) {
  10241. output.push(string.slice(lastLastIndex, match.index));
  10242. if (match[LENGTH] > 1 && match.index < string[LENGTH]) $push.apply(output, match.slice(1));
  10243. lastLength = match[0][LENGTH];
  10244. lastLastIndex = lastIndex;
  10245. if (output[LENGTH] >= splitLimit) break;
  10246. }
  10247. if (separatorCopy[LAST_INDEX] === match.index) separatorCopy[LAST_INDEX]++; // Avoid an infinite loop
  10248. }
  10249. if (lastLastIndex === string[LENGTH]) {
  10250. if (lastLength || !separatorCopy.test('')) output.push('');
  10251. } else output.push(string.slice(lastLastIndex));
  10252. return output[LENGTH] > splitLimit ? output.slice(0, splitLimit) : output;
  10253. };
  10254. // Chakra, V8
  10255. } else if ('0'[$SPLIT](undefined, 0)[LENGTH]) {
  10256. internalSplit = function (separator, limit) {
  10257. return separator === undefined && limit === 0 ? [] : $split.call(this, separator, limit);
  10258. };
  10259. } else {
  10260. internalSplit = $split;
  10261. }
  10262. return [
  10263. // `String.prototype.split` method
  10264. // https://tc39.github.io/ecma262/#sec-string.prototype.split
  10265. function split(separator, limit) {
  10266. var O = defined(this);
  10267. var splitter = separator == undefined ? undefined : separator[SPLIT];
  10268. return splitter !== undefined
  10269. ? splitter.call(separator, O, limit)
  10270. : internalSplit.call(String(O), separator, limit);
  10271. },
  10272. // `RegExp.prototype[@@split]` method
  10273. // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@split
  10274. //
  10275. // NOTE: This cannot be properly polyfilled in engines that don't support
  10276. // the 'y' flag.
  10277. function (regexp, limit) {
  10278. var res = maybeCallNative(internalSplit, regexp, this, limit, internalSplit !== $split);
  10279. if (res.done) return res.value;
  10280. var rx = anObject(regexp);
  10281. var S = String(this);
  10282. var C = speciesConstructor(rx, RegExp);
  10283. var unicodeMatching = rx.unicode;
  10284. var flags = (rx.ignoreCase ? 'i' : '') +
  10285. (rx.multiline ? 'm' : '') +
  10286. (rx.unicode ? 'u' : '') +
  10287. (SUPPORTS_Y ? 'y' : 'g');
  10288. // ^(? + rx + ) is needed, in combination with some S slicing, to
  10289. // simulate the 'y' flag.
  10290. var splitter = new C(SUPPORTS_Y ? rx : '^(?:' + rx.source + ')', flags);
  10291. var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
  10292. if (lim === 0) return [];
  10293. if (S.length === 0) return callRegExpExec(splitter, S) === null ? [S] : [];
  10294. var p = 0;
  10295. var q = 0;
  10296. var A = [];
  10297. while (q < S.length) {
  10298. splitter.lastIndex = SUPPORTS_Y ? q : 0;
  10299. var z = callRegExpExec(splitter, SUPPORTS_Y ? S : S.slice(q));
  10300. var e;
  10301. if (
  10302. z === null ||
  10303. (e = $min(toLength(splitter.lastIndex + (SUPPORTS_Y ? 0 : q)), S.length)) === p
  10304. ) {
  10305. q = advanceStringIndex(S, q, unicodeMatching);
  10306. } else {
  10307. A.push(S.slice(p, q));
  10308. if (A.length === lim) return A;
  10309. for (var i = 1; i <= z.length - 1; i++) {
  10310. A.push(z[i]);
  10311. if (A.length === lim) return A;
  10312. }
  10313. q = p = e;
  10314. }
  10315. }
  10316. A.push(S.slice(p));
  10317. return A;
  10318. }
  10319. ];
  10320. });
  10321. /***/ }),
  10322. /* 154 */
  10323. /***/ (function(module, exports, __webpack_require__) {
  10324. // 7.2.8 IsRegExp(argument)
  10325. var isObject = __webpack_require__(18);
  10326. var cof = __webpack_require__(53);
  10327. var MATCH = __webpack_require__(3)('match');
  10328. module.exports = function (it) {
  10329. var isRegExp;
  10330. return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp');
  10331. };
  10332. /***/ }),
  10333. /* 155 */
  10334. /***/ (function(module, exports, __webpack_require__) {
  10335. "use strict";
  10336. var global = __webpack_require__(8);
  10337. var has = __webpack_require__(24);
  10338. var cof = __webpack_require__(53);
  10339. var inheritIfRequired = __webpack_require__(237);
  10340. var toPrimitive = __webpack_require__(51);
  10341. var fails = __webpack_require__(10);
  10342. var gOPN = __webpack_require__(55).f;
  10343. var gOPD = __webpack_require__(67).f;
  10344. var dP = __webpack_require__(11).f;
  10345. var $trim = __webpack_require__(238).trim;
  10346. var NUMBER = 'Number';
  10347. var $Number = global[NUMBER];
  10348. var Base = $Number;
  10349. var proto = $Number.prototype;
  10350. // Opera ~12 has broken Object#toString
  10351. var BROKEN_COF = cof(__webpack_require__(65)(proto)) == NUMBER;
  10352. var TRIM = 'trim' in String.prototype;
  10353. // 7.1.3 ToNumber(argument)
  10354. var toNumber = function (argument) {
  10355. var it = toPrimitive(argument, false);
  10356. if (typeof it == 'string' && it.length > 2) {
  10357. it = TRIM ? it.trim() : $trim(it, 3);
  10358. var first = it.charCodeAt(0);
  10359. var third, radix, maxCode;
  10360. if (first === 43 || first === 45) {
  10361. third = it.charCodeAt(2);
  10362. if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix
  10363. } else if (first === 48) {
  10364. switch (it.charCodeAt(1)) {
  10365. case 66: case 98: radix = 2; maxCode = 49; break; // fast equal /^0b[01]+$/i
  10366. case 79: case 111: radix = 8; maxCode = 55; break; // fast equal /^0o[0-7]+$/i
  10367. default: return +it;
  10368. }
  10369. for (var digits = it.slice(2), i = 0, l = digits.length, code; i < l; i++) {
  10370. code = digits.charCodeAt(i);
  10371. // parseInt parses a string to a first unavailable symbol
  10372. // but ToNumber should return NaN if a string contains unavailable symbols
  10373. if (code < 48 || code > maxCode) return NaN;
  10374. } return parseInt(digits, radix);
  10375. }
  10376. } return +it;
  10377. };
  10378. if (!$Number(' 0o1') || !$Number('0b1') || $Number('+0x1')) {
  10379. $Number = function Number(value) {
  10380. var it = arguments.length < 1 ? 0 : value;
  10381. var that = this;
  10382. return that instanceof $Number
  10383. // check on 1..constructor(foo) case
  10384. && (BROKEN_COF ? fails(function () { proto.valueOf.call(that); }) : cof(that) != NUMBER)
  10385. ? inheritIfRequired(new Base(toNumber(it)), that, $Number) : toNumber(it);
  10386. };
  10387. for (var keys = __webpack_require__(9) ? gOPN(Base) : (
  10388. // ES3:
  10389. 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' +
  10390. // ES6 (in case, if modules with ES6 Number statics required before):
  10391. 'EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,' +
  10392. 'MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger'
  10393. ).split(','), j = 0, key; keys.length > j; j++) {
  10394. if (has(Base, key = keys[j]) && !has($Number, key)) {
  10395. dP($Number, key, gOPD(Base, key));
  10396. }
  10397. }
  10398. $Number.prototype = proto;
  10399. proto.constructor = $Number;
  10400. __webpack_require__(23)(global, NUMBER, $Number);
  10401. }
  10402. /***/ }),
  10403. /* 156 */
  10404. /***/ (function(module, exports, __webpack_require__) {
  10405. // Works with __proto__ only. Old v8 can't work with null proto objects.
  10406. /* eslint-disable no-proto */
  10407. var isObject = __webpack_require__(18);
  10408. var anObject = __webpack_require__(12);
  10409. var check = function (O, proto) {
  10410. anObject(O);
  10411. if (!isObject(proto) && proto !== null) throw TypeError(proto + ": can't set as prototype!");
  10412. };
  10413. module.exports = {
  10414. set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line
  10415. function (test, buggy, set) {
  10416. try {
  10417. set = __webpack_require__(52)(Function.call, __webpack_require__(67).f(Object.prototype, '__proto__').set, 2);
  10418. set(test, []);
  10419. buggy = !(test instanceof Array);
  10420. } catch (e) { buggy = true; }
  10421. return function setPrototypeOf(O, proto) {
  10422. check(O, proto);
  10423. if (buggy) O.__proto__ = proto;
  10424. else set(O, proto);
  10425. return O;
  10426. };
  10427. }({}, false) : undefined),
  10428. check: check
  10429. };
  10430. /***/ }),
  10431. /* 157 */
  10432. /***/ (function(module, exports, __webpack_require__) {
  10433. "use strict";
  10434. // https://github.com/tc39/Array.prototype.includes
  10435. var $export = __webpack_require__(5);
  10436. var $includes = __webpack_require__(86)(true);
  10437. $export($export.P, 'Array', {
  10438. includes: function includes(el /* , fromIndex = 0 */) {
  10439. return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
  10440. }
  10441. });
  10442. __webpack_require__(91)('includes');
  10443. /***/ }),
  10444. /* 158 */
  10445. /***/ (function(module, exports, __webpack_require__) {
  10446. "use strict";
  10447. // 21.1.3.7 String.prototype.includes(searchString, position = 0)
  10448. var $export = __webpack_require__(5);
  10449. var context = __webpack_require__(241);
  10450. var INCLUDES = 'includes';
  10451. $export($export.P + $export.F * __webpack_require__(242)(INCLUDES), 'String', {
  10452. includes: function includes(searchString /* , position = 0 */) {
  10453. return !!~context(this, searchString, INCLUDES)
  10454. .indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined);
  10455. }
  10456. });
  10457. /***/ }),
  10458. /* 159 */
  10459. /***/ (function(module, exports, __webpack_require__) {
  10460. "use strict";
  10461. var anObject = __webpack_require__(12);
  10462. var toObject = __webpack_require__(19);
  10463. var toLength = __webpack_require__(16);
  10464. var toInteger = __webpack_require__(31);
  10465. var advanceStringIndex = __webpack_require__(93);
  10466. var regExpExec = __webpack_require__(95);
  10467. var max = Math.max;
  10468. var min = Math.min;
  10469. var floor = Math.floor;
  10470. var SUBSTITUTION_SYMBOLS = /\$([$&`']|\d\d?|<[^>]*>)/g;
  10471. var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&`']|\d\d?)/g;
  10472. var maybeToString = function (it) {
  10473. return it === undefined ? it : String(it);
  10474. };
  10475. // @@replace logic
  10476. __webpack_require__(96)('replace', 2, function (defined, REPLACE, $replace, maybeCallNative) {
  10477. return [
  10478. // `String.prototype.replace` method
  10479. // https://tc39.github.io/ecma262/#sec-string.prototype.replace
  10480. function replace(searchValue, replaceValue) {
  10481. var O = defined(this);
  10482. var fn = searchValue == undefined ? undefined : searchValue[REPLACE];
  10483. return fn !== undefined
  10484. ? fn.call(searchValue, O, replaceValue)
  10485. : $replace.call(String(O), searchValue, replaceValue);
  10486. },
  10487. // `RegExp.prototype[@@replace]` method
  10488. // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@replace
  10489. function (regexp, replaceValue) {
  10490. var res = maybeCallNative($replace, regexp, this, replaceValue);
  10491. if (res.done) return res.value;
  10492. var rx = anObject(regexp);
  10493. var S = String(this);
  10494. var functionalReplace = typeof replaceValue === 'function';
  10495. if (!functionalReplace) replaceValue = String(replaceValue);
  10496. var global = rx.global;
  10497. if (global) {
  10498. var fullUnicode = rx.unicode;
  10499. rx.lastIndex = 0;
  10500. }
  10501. var results = [];
  10502. while (true) {
  10503. var result = regExpExec(rx, S);
  10504. if (result === null) break;
  10505. results.push(result);
  10506. if (!global) break;
  10507. var matchStr = String(result[0]);
  10508. if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
  10509. }
  10510. var accumulatedResult = '';
  10511. var nextSourcePosition = 0;
  10512. for (var i = 0; i < results.length; i++) {
  10513. result = results[i];
  10514. var matched = String(result[0]);
  10515. var position = max(min(toInteger(result.index), S.length), 0);
  10516. var captures = [];
  10517. // NOTE: This is equivalent to
  10518. // captures = result.slice(1).map(maybeToString)
  10519. // but for some reason `nativeSlice.call(result, 1, result.length)` (called in
  10520. // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
  10521. // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
  10522. for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j]));
  10523. var namedCaptures = result.groups;
  10524. if (functionalReplace) {
  10525. var replacerArgs = [matched].concat(captures, position, S);
  10526. if (namedCaptures !== undefined) replacerArgs.push(namedCaptures);
  10527. var replacement = String(replaceValue.apply(undefined, replacerArgs));
  10528. } else {
  10529. replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
  10530. }
  10531. if (position >= nextSourcePosition) {
  10532. accumulatedResult += S.slice(nextSourcePosition, position) + replacement;
  10533. nextSourcePosition = position + matched.length;
  10534. }
  10535. }
  10536. return accumulatedResult + S.slice(nextSourcePosition);
  10537. }
  10538. ];
  10539. // https://tc39.github.io/ecma262/#sec-getsubstitution
  10540. function getSubstitution(matched, str, position, captures, namedCaptures, replacement) {
  10541. var tailPos = position + matched.length;
  10542. var m = captures.length;
  10543. var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
  10544. if (namedCaptures !== undefined) {
  10545. namedCaptures = toObject(namedCaptures);
  10546. symbols = SUBSTITUTION_SYMBOLS;
  10547. }
  10548. return $replace.call(replacement, symbols, function (match, ch) {
  10549. var capture;
  10550. switch (ch.charAt(0)) {
  10551. case '$': return '$';
  10552. case '&': return matched;
  10553. case '`': return str.slice(0, position);
  10554. case "'": return str.slice(tailPos);
  10555. case '<':
  10556. capture = namedCaptures[ch.slice(1, -1)];
  10557. break;
  10558. default: // \d\d?
  10559. var n = +ch;
  10560. if (n === 0) return match;
  10561. if (n > m) {
  10562. var f = floor(n / 10);
  10563. if (f === 0) return match;
  10564. if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1);
  10565. return match;
  10566. }
  10567. capture = captures[n - 1];
  10568. }
  10569. return capture === undefined ? '' : capture;
  10570. });
  10571. }
  10572. });
  10573. /***/ }),
  10574. /* 160 */
  10575. /***/ (function(module, exports, __webpack_require__) {
  10576. // 19.1.2.14 Object.keys(O)
  10577. var toObject = __webpack_require__(19);
  10578. var $keys = __webpack_require__(42);
  10579. __webpack_require__(245)('keys', function () {
  10580. return function keys(it) {
  10581. return $keys(toObject(it));
  10582. };
  10583. });
  10584. /***/ }),
  10585. /* 161 */
  10586. /***/ (function(module, exports, __webpack_require__) {
  10587. "use strict";
  10588. // 19.1.3.6 Object.prototype.toString()
  10589. var classof = __webpack_require__(64);
  10590. var test = {};
  10591. test[__webpack_require__(3)('toStringTag')] = 'z';
  10592. if (test + '' != '[object z]') {
  10593. __webpack_require__(23)(Object.prototype, 'toString', function toString() {
  10594. return '[object ' + classof(this) + ']';
  10595. }, true);
  10596. }
  10597. /***/ }),
  10598. /* 162 */
  10599. /***/ (function(module, exports, __webpack_require__) {
  10600. __webpack_require__(163)('asyncIterator');
  10601. /***/ }),
  10602. /* 163 */
  10603. /***/ (function(module, exports, __webpack_require__) {
  10604. var global = __webpack_require__(8);
  10605. var core = __webpack_require__(39);
  10606. var LIBRARY = __webpack_require__(41);
  10607. var wksExt = __webpack_require__(164);
  10608. var defineProperty = __webpack_require__(11).f;
  10609. module.exports = function (name) {
  10610. var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {});
  10611. if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) });
  10612. };
  10613. /***/ }),
  10614. /* 164 */
  10615. /***/ (function(module, exports, __webpack_require__) {
  10616. exports.f = __webpack_require__(3);
  10617. /***/ }),
  10618. /* 165 */
  10619. /***/ (function(module, exports, __webpack_require__) {
  10620. "use strict";
  10621. // ECMAScript 6 symbols shim
  10622. var global = __webpack_require__(8);
  10623. var has = __webpack_require__(24);
  10624. var DESCRIPTORS = __webpack_require__(9);
  10625. var $export = __webpack_require__(5);
  10626. var redefine = __webpack_require__(23);
  10627. var META = __webpack_require__(252).KEY;
  10628. var $fails = __webpack_require__(10);
  10629. var shared = __webpack_require__(61);
  10630. var setToStringTag = __webpack_require__(63);
  10631. var uid = __webpack_require__(29);
  10632. var wks = __webpack_require__(3);
  10633. var wksExt = __webpack_require__(164);
  10634. var wksDefine = __webpack_require__(163);
  10635. var enumKeys = __webpack_require__(253);
  10636. var isArray = __webpack_require__(148);
  10637. var anObject = __webpack_require__(12);
  10638. var isObject = __webpack_require__(18);
  10639. var toObject = __webpack_require__(19);
  10640. var toIObject = __webpack_require__(43);
  10641. var toPrimitive = __webpack_require__(51);
  10642. var createDesc = __webpack_require__(40);
  10643. var _create = __webpack_require__(65);
  10644. var gOPNExt = __webpack_require__(254);
  10645. var $GOPD = __webpack_require__(67);
  10646. var $GOPS = __webpack_require__(89);
  10647. var $DP = __webpack_require__(11);
  10648. var $keys = __webpack_require__(42);
  10649. var gOPD = $GOPD.f;
  10650. var dP = $DP.f;
  10651. var gOPN = gOPNExt.f;
  10652. var $Symbol = global.Symbol;
  10653. var $JSON = global.JSON;
  10654. var _stringify = $JSON && $JSON.stringify;
  10655. var PROTOTYPE = 'prototype';
  10656. var HIDDEN = wks('_hidden');
  10657. var TO_PRIMITIVE = wks('toPrimitive');
  10658. var isEnum = {}.propertyIsEnumerable;
  10659. var SymbolRegistry = shared('symbol-registry');
  10660. var AllSymbols = shared('symbols');
  10661. var OPSymbols = shared('op-symbols');
  10662. var ObjectProto = Object[PROTOTYPE];
  10663. var USE_NATIVE = typeof $Symbol == 'function' && !!$GOPS.f;
  10664. var QObject = global.QObject;
  10665. // Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
  10666. var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;
  10667. // fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687
  10668. var setSymbolDesc = DESCRIPTORS && $fails(function () {
  10669. return _create(dP({}, 'a', {
  10670. get: function () { return dP(this, 'a', { value: 7 }).a; }
  10671. })).a != 7;
  10672. }) ? function (it, key, D) {
  10673. var protoDesc = gOPD(ObjectProto, key);
  10674. if (protoDesc) delete ObjectProto[key];
  10675. dP(it, key, D);
  10676. if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc);
  10677. } : dP;
  10678. var wrap = function (tag) {
  10679. var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]);
  10680. sym._k = tag;
  10681. return sym;
  10682. };
  10683. var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) {
  10684. return typeof it == 'symbol';
  10685. } : function (it) {
  10686. return it instanceof $Symbol;
  10687. };
  10688. var $defineProperty = function defineProperty(it, key, D) {
  10689. if (it === ObjectProto) $defineProperty(OPSymbols, key, D);
  10690. anObject(it);
  10691. key = toPrimitive(key, true);
  10692. anObject(D);
  10693. if (has(AllSymbols, key)) {
  10694. if (!D.enumerable) {
  10695. if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {}));
  10696. it[HIDDEN][key] = true;
  10697. } else {
  10698. if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false;
  10699. D = _create(D, { enumerable: createDesc(0, false) });
  10700. } return setSymbolDesc(it, key, D);
  10701. } return dP(it, key, D);
  10702. };
  10703. var $defineProperties = function defineProperties(it, P) {
  10704. anObject(it);
  10705. var keys = enumKeys(P = toIObject(P));
  10706. var i = 0;
  10707. var l = keys.length;
  10708. var key;
  10709. while (l > i) $defineProperty(it, key = keys[i++], P[key]);
  10710. return it;
  10711. };
  10712. var $create = function create(it, P) {
  10713. return P === undefined ? _create(it) : $defineProperties(_create(it), P);
  10714. };
  10715. var $propertyIsEnumerable = function propertyIsEnumerable(key) {
  10716. var E = isEnum.call(this, key = toPrimitive(key, true));
  10717. if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false;
  10718. return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;
  10719. };
  10720. var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) {
  10721. it = toIObject(it);
  10722. key = toPrimitive(key, true);
  10723. if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return;
  10724. var D = gOPD(it, key);
  10725. if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true;
  10726. return D;
  10727. };
  10728. var $getOwnPropertyNames = function getOwnPropertyNames(it) {
  10729. var names = gOPN(toIObject(it));
  10730. var result = [];
  10731. var i = 0;
  10732. var key;
  10733. while (names.length > i) {
  10734. if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key);
  10735. } return result;
  10736. };
  10737. var $getOwnPropertySymbols = function getOwnPropertySymbols(it) {
  10738. var IS_OP = it === ObjectProto;
  10739. var names = gOPN(IS_OP ? OPSymbols : toIObject(it));
  10740. var result = [];
  10741. var i = 0;
  10742. var key;
  10743. while (names.length > i) {
  10744. if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]);
  10745. } return result;
  10746. };
  10747. // 19.4.1.1 Symbol([description])
  10748. if (!USE_NATIVE) {
  10749. $Symbol = function Symbol() {
  10750. if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!');
  10751. var tag = uid(arguments.length > 0 ? arguments[0] : undefined);
  10752. var $set = function (value) {
  10753. if (this === ObjectProto) $set.call(OPSymbols, value);
  10754. if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;
  10755. setSymbolDesc(this, tag, createDesc(1, value));
  10756. };
  10757. if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set });
  10758. return wrap(tag);
  10759. };
  10760. redefine($Symbol[PROTOTYPE], 'toString', function toString() {
  10761. return this._k;
  10762. });
  10763. $GOPD.f = $getOwnPropertyDescriptor;
  10764. $DP.f = $defineProperty;
  10765. __webpack_require__(55).f = gOPNExt.f = $getOwnPropertyNames;
  10766. __webpack_require__(62).f = $propertyIsEnumerable;
  10767. $GOPS.f = $getOwnPropertySymbols;
  10768. if (DESCRIPTORS && !__webpack_require__(41)) {
  10769. redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);
  10770. }
  10771. wksExt.f = function (name) {
  10772. return wrap(wks(name));
  10773. };
  10774. }
  10775. $export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol });
  10776. for (var es6Symbols = (
  10777. // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14
  10778. 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'
  10779. ).split(','), j = 0; es6Symbols.length > j;)wks(es6Symbols[j++]);
  10780. for (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]);
  10781. $export($export.S + $export.F * !USE_NATIVE, 'Symbol', {
  10782. // 19.4.2.1 Symbol.for(key)
  10783. 'for': function (key) {
  10784. return has(SymbolRegistry, key += '')
  10785. ? SymbolRegistry[key]
  10786. : SymbolRegistry[key] = $Symbol(key);
  10787. },
  10788. // 19.4.2.5 Symbol.keyFor(sym)
  10789. keyFor: function keyFor(sym) {
  10790. if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!');
  10791. for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key;
  10792. },
  10793. useSetter: function () { setter = true; },
  10794. useSimple: function () { setter = false; }
  10795. });
  10796. $export($export.S + $export.F * !USE_NATIVE, 'Object', {
  10797. // 19.1.2.2 Object.create(O [, Properties])
  10798. create: $create,
  10799. // 19.1.2.4 Object.defineProperty(O, P, Attributes)
  10800. defineProperty: $defineProperty,
  10801. // 19.1.2.3 Object.defineProperties(O, Properties)
  10802. defineProperties: $defineProperties,
  10803. // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
  10804. getOwnPropertyDescriptor: $getOwnPropertyDescriptor,
  10805. // 19.1.2.7 Object.getOwnPropertyNames(O)
  10806. getOwnPropertyNames: $getOwnPropertyNames,
  10807. // 19.1.2.8 Object.getOwnPropertySymbols(O)
  10808. getOwnPropertySymbols: $getOwnPropertySymbols
  10809. });
  10810. // Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives
  10811. // https://bugs.chromium.org/p/v8/issues/detail?id=3443
  10812. var FAILS_ON_PRIMITIVES = $fails(function () { $GOPS.f(1); });
  10813. $export($export.S + $export.F * FAILS_ON_PRIMITIVES, 'Object', {
  10814. getOwnPropertySymbols: function getOwnPropertySymbols(it) {
  10815. return $GOPS.f(toObject(it));
  10816. }
  10817. });
  10818. // 24.3.2 JSON.stringify(value [, replacer [, space]])
  10819. $JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () {
  10820. var S = $Symbol();
  10821. // MS Edge converts symbol values to JSON as {}
  10822. // WebKit converts symbol values to JSON as null
  10823. // V8 throws on boxed symbols
  10824. return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}';
  10825. })), 'JSON', {
  10826. stringify: function stringify(it) {
  10827. var args = [it];
  10828. var i = 1;
  10829. var replacer, $replacer;
  10830. while (arguments.length > i) args.push(arguments[i++]);
  10831. $replacer = replacer = args[1];
  10832. if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined
  10833. if (!isArray(replacer)) replacer = function (key, value) {
  10834. if (typeof $replacer == 'function') value = $replacer.call(this, key, value);
  10835. if (!isSymbol(value)) return value;
  10836. };
  10837. args[1] = replacer;
  10838. return _stringify.apply($JSON, args);
  10839. }
  10840. });
  10841. // 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)
  10842. $Symbol[PROTOTYPE][TO_PRIMITIVE] || __webpack_require__(15)($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);
  10843. // 19.4.3.5 Symbol.prototype[@@toStringTag]
  10844. setToStringTag($Symbol, 'Symbol');
  10845. // 20.2.1.9 Math[@@toStringTag]
  10846. setToStringTag(Math, 'Math', true);
  10847. // 24.3.3 JSON[@@toStringTag]
  10848. setToStringTag(global.JSON, 'JSON', true);
  10849. /***/ }),
  10850. /* 166 */
  10851. /***/ (function(module, exports, __webpack_require__) {
  10852. "use strict";
  10853. /* WEBPACK VAR INJECTION */(function(global, process) {// Copyright Joyent, Inc. and other Node contributors.
  10854. //
  10855. // Permission is hereby granted, free of charge, to any person obtaining a
  10856. // copy of this software and associated documentation files (the
  10857. // "Software"), to deal in the Software without restriction, including
  10858. // without limitation the rights to use, copy, modify, merge, publish,
  10859. // distribute, sublicense, and/or sell copies of the Software, and to permit
  10860. // persons to whom the Software is furnished to do so, subject to the
  10861. // following conditions:
  10862. //
  10863. // The above copyright notice and this permission notice shall be included
  10864. // in all copies or substantial portions of the Software.
  10865. //
  10866. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  10867. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  10868. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  10869. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  10870. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  10871. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  10872. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  10873. /*<replacement>*/
  10874. var pna = __webpack_require__(69);
  10875. /*</replacement>*/
  10876. module.exports = Readable;
  10877. /*<replacement>*/
  10878. var isArray = __webpack_require__(132);
  10879. /*</replacement>*/
  10880. /*<replacement>*/
  10881. var Duplex;
  10882. /*</replacement>*/
  10883. Readable.ReadableState = ReadableState;
  10884. /*<replacement>*/
  10885. var EE = __webpack_require__(68).EventEmitter;
  10886. var EElistenerCount = function (emitter, type) {
  10887. return emitter.listeners(type).length;
  10888. };
  10889. /*</replacement>*/
  10890. /*<replacement>*/
  10891. var Stream = __webpack_require__(167);
  10892. /*</replacement>*/
  10893. /*<replacement>*/
  10894. var Buffer = __webpack_require__(70).Buffer;
  10895. var OurUint8Array = global.Uint8Array || function () {};
  10896. function _uint8ArrayToBuffer(chunk) {
  10897. return Buffer.from(chunk);
  10898. }
  10899. function _isUint8Array(obj) {
  10900. return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
  10901. }
  10902. /*</replacement>*/
  10903. /*<replacement>*/
  10904. var util = Object.create(__webpack_require__(56));
  10905. util.inherits = __webpack_require__(46);
  10906. /*</replacement>*/
  10907. /*<replacement>*/
  10908. var debugUtil = __webpack_require__(256);
  10909. var debug = void 0;
  10910. if (debugUtil && debugUtil.debuglog) {
  10911. debug = debugUtil.debuglog('stream');
  10912. } else {
  10913. debug = function () {};
  10914. }
  10915. /*</replacement>*/
  10916. var BufferList = __webpack_require__(257);
  10917. var destroyImpl = __webpack_require__(168);
  10918. var StringDecoder;
  10919. util.inherits(Readable, Stream);
  10920. var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];
  10921. function prependListener(emitter, event, fn) {
  10922. // Sadly this is not cacheable as some libraries bundle their own
  10923. // event emitter implementation with them.
  10924. if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn);
  10925. // This is a hack to make sure that our error handler is attached before any
  10926. // userland ones. NEVER DO THIS. This is here only because this code needs
  10927. // to continue to work with older versions of Node.js that do not include
  10928. // the prependListener() method. The goal is to eventually remove this hack.
  10929. if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]];
  10930. }
  10931. function ReadableState(options, stream) {
  10932. Duplex = Duplex || __webpack_require__(32);
  10933. options = options || {};
  10934. // Duplex streams are both readable and writable, but share
  10935. // the same options object.
  10936. // However, some cases require setting options to different
  10937. // values for the readable and the writable sides of the duplex stream.
  10938. // These options can be provided separately as readableXXX and writableXXX.
  10939. var isDuplex = stream instanceof Duplex;
  10940. // object stream flag. Used to make read(n) ignore n and to
  10941. // make all the buffer merging and length checks go away
  10942. this.objectMode = !!options.objectMode;
  10943. if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode;
  10944. // the point at which it stops calling _read() to fill the buffer
  10945. // Note: 0 is a valid value, means "don't call _read preemptively ever"
  10946. var hwm = options.highWaterMark;
  10947. var readableHwm = options.readableHighWaterMark;
  10948. var defaultHwm = this.objectMode ? 16 : 16 * 1024;
  10949. if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm;
  10950. // cast to ints.
  10951. this.highWaterMark = Math.floor(this.highWaterMark);
  10952. // A linked list is used to store data chunks instead of an array because the
  10953. // linked list can remove elements from the beginning faster than
  10954. // array.shift()
  10955. this.buffer = new BufferList();
  10956. this.length = 0;
  10957. this.pipes = null;
  10958. this.pipesCount = 0;
  10959. this.flowing = null;
  10960. this.ended = false;
  10961. this.endEmitted = false;
  10962. this.reading = false;
  10963. // a flag to be able to tell if the event 'readable'/'data' is emitted
  10964. // immediately, or on a later tick. We set this to true at first, because
  10965. // any actions that shouldn't happen until "later" should generally also
  10966. // not happen before the first read call.
  10967. this.sync = true;
  10968. // whenever we return null, then we set a flag to say
  10969. // that we're awaiting a 'readable' event emission.
  10970. this.needReadable = false;
  10971. this.emittedReadable = false;
  10972. this.readableListening = false;
  10973. this.resumeScheduled = false;
  10974. // has it been destroyed
  10975. this.destroyed = false;
  10976. // Crypto is kind of old and crusty. Historically, its default string
  10977. // encoding is 'binary' so we have to make this configurable.
  10978. // Everything else in the universe uses 'utf8', though.
  10979. this.defaultEncoding = options.defaultEncoding || 'utf8';
  10980. // the number of writers that are awaiting a drain event in .pipe()s
  10981. this.awaitDrain = 0;
  10982. // if true, a maybeReadMore has been scheduled
  10983. this.readingMore = false;
  10984. this.decoder = null;
  10985. this.encoding = null;
  10986. if (options.encoding) {
  10987. if (!StringDecoder) StringDecoder = __webpack_require__(103).StringDecoder;
  10988. this.decoder = new StringDecoder(options.encoding);
  10989. this.encoding = options.encoding;
  10990. }
  10991. }
  10992. function Readable(options) {
  10993. Duplex = Duplex || __webpack_require__(32);
  10994. if (!(this instanceof Readable)) return new Readable(options);
  10995. this._readableState = new ReadableState(options, this);
  10996. // legacy
  10997. this.readable = true;
  10998. if (options) {
  10999. if (typeof options.read === 'function') this._read = options.read;
  11000. if (typeof options.destroy === 'function') this._destroy = options.destroy;
  11001. }
  11002. Stream.call(this);
  11003. }
  11004. Object.defineProperty(Readable.prototype, 'destroyed', {
  11005. get: function () {
  11006. if (this._readableState === undefined) {
  11007. return false;
  11008. }
  11009. return this._readableState.destroyed;
  11010. },
  11011. set: function (value) {
  11012. // we ignore the value if the stream
  11013. // has not been initialized yet
  11014. if (!this._readableState) {
  11015. return;
  11016. }
  11017. // backward compatibility, the user is explicitly
  11018. // managing destroyed
  11019. this._readableState.destroyed = value;
  11020. }
  11021. });
  11022. Readable.prototype.destroy = destroyImpl.destroy;
  11023. Readable.prototype._undestroy = destroyImpl.undestroy;
  11024. Readable.prototype._destroy = function (err, cb) {
  11025. this.push(null);
  11026. cb(err);
  11027. };
  11028. // Manually shove something into the read() buffer.
  11029. // This returns true if the highWaterMark has not been hit yet,
  11030. // similar to how Writable.write() returns true if you should
  11031. // write() some more.
  11032. Readable.prototype.push = function (chunk, encoding) {
  11033. var state = this._readableState;
  11034. var skipChunkCheck;
  11035. if (!state.objectMode) {
  11036. if (typeof chunk === 'string') {
  11037. encoding = encoding || state.defaultEncoding;
  11038. if (encoding !== state.encoding) {
  11039. chunk = Buffer.from(chunk, encoding);
  11040. encoding = '';
  11041. }
  11042. skipChunkCheck = true;
  11043. }
  11044. } else {
  11045. skipChunkCheck = true;
  11046. }
  11047. return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);
  11048. };
  11049. // Unshift should *always* be something directly out of read()
  11050. Readable.prototype.unshift = function (chunk) {
  11051. return readableAddChunk(this, chunk, null, true, false);
  11052. };
  11053. function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {
  11054. var state = stream._readableState;
  11055. if (chunk === null) {
  11056. state.reading = false;
  11057. onEofChunk(stream, state);
  11058. } else {
  11059. var er;
  11060. if (!skipChunkCheck) er = chunkInvalid(state, chunk);
  11061. if (er) {
  11062. stream.emit('error', er);
  11063. } else if (state.objectMode || chunk && chunk.length > 0) {
  11064. if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {
  11065. chunk = _uint8ArrayToBuffer(chunk);
  11066. }
  11067. if (addToFront) {
  11068. if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true);
  11069. } else if (state.ended) {
  11070. stream.emit('error', new Error('stream.push() after EOF'));
  11071. } else {
  11072. state.reading = false;
  11073. if (state.decoder && !encoding) {
  11074. chunk = state.decoder.write(chunk);
  11075. if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state);
  11076. } else {
  11077. addChunk(stream, state, chunk, false);
  11078. }
  11079. }
  11080. } else if (!addToFront) {
  11081. state.reading = false;
  11082. }
  11083. }
  11084. return needMoreData(state);
  11085. }
  11086. function addChunk(stream, state, chunk, addToFront) {
  11087. if (state.flowing && state.length === 0 && !state.sync) {
  11088. stream.emit('data', chunk);
  11089. stream.read(0);
  11090. } else {
  11091. // update the buffer info.
  11092. state.length += state.objectMode ? 1 : chunk.length;
  11093. if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);
  11094. if (state.needReadable) emitReadable(stream);
  11095. }
  11096. maybeReadMore(stream, state);
  11097. }
  11098. function chunkInvalid(state, chunk) {
  11099. var er;
  11100. if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {
  11101. er = new TypeError('Invalid non-string/buffer chunk');
  11102. }
  11103. return er;
  11104. }
  11105. // if it's past the high water mark, we can push in some more.
  11106. // Also, if we have no data yet, we can stand some
  11107. // more bytes. This is to work around cases where hwm=0,
  11108. // such as the repl. Also, if the push() triggered a
  11109. // readable event, and the user called read(largeNumber) such that
  11110. // needReadable was set, then we ought to push more, so that another
  11111. // 'readable' event will be triggered.
  11112. function needMoreData(state) {
  11113. return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);
  11114. }
  11115. Readable.prototype.isPaused = function () {
  11116. return this._readableState.flowing === false;
  11117. };
  11118. // backwards compatibility.
  11119. Readable.prototype.setEncoding = function (enc) {
  11120. if (!StringDecoder) StringDecoder = __webpack_require__(103).StringDecoder;
  11121. this._readableState.decoder = new StringDecoder(enc);
  11122. this._readableState.encoding = enc;
  11123. return this;
  11124. };
  11125. // Don't raise the hwm > 8MB
  11126. var MAX_HWM = 0x800000;
  11127. function computeNewHighWaterMark(n) {
  11128. if (n >= MAX_HWM) {
  11129. n = MAX_HWM;
  11130. } else {
  11131. // Get the next highest power of 2 to prevent increasing hwm excessively in
  11132. // tiny amounts
  11133. n--;
  11134. n |= n >>> 1;
  11135. n |= n >>> 2;
  11136. n |= n >>> 4;
  11137. n |= n >>> 8;
  11138. n |= n >>> 16;
  11139. n++;
  11140. }
  11141. return n;
  11142. }
  11143. // This function is designed to be inlinable, so please take care when making
  11144. // changes to the function body.
  11145. function howMuchToRead(n, state) {
  11146. if (n <= 0 || state.length === 0 && state.ended) return 0;
  11147. if (state.objectMode) return 1;
  11148. if (n !== n) {
  11149. // Only flow one buffer at a time
  11150. if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;
  11151. }
  11152. // If we're asking for more than the current hwm, then raise the hwm.
  11153. if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);
  11154. if (n <= state.length) return n;
  11155. // Don't have enough
  11156. if (!state.ended) {
  11157. state.needReadable = true;
  11158. return 0;
  11159. }
  11160. return state.length;
  11161. }
  11162. // you can override either this method, or the async _read(n) below.
  11163. Readable.prototype.read = function (n) {
  11164. debug('read', n);
  11165. n = parseInt(n, 10);
  11166. var state = this._readableState;
  11167. var nOrig = n;
  11168. if (n !== 0) state.emittedReadable = false;
  11169. // if we're doing read(0) to trigger a readable event, but we
  11170. // already have a bunch of data in the buffer, then just trigger
  11171. // the 'readable' event and move on.
  11172. if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {
  11173. debug('read: emitReadable', state.length, state.ended);
  11174. if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);
  11175. return null;
  11176. }
  11177. n = howMuchToRead(n, state);
  11178. // if we've ended, and we're now clear, then finish it up.
  11179. if (n === 0 && state.ended) {
  11180. if (state.length === 0) endReadable(this);
  11181. return null;
  11182. }
  11183. // All the actual chunk generation logic needs to be
  11184. // *below* the call to _read. The reason is that in certain
  11185. // synthetic stream cases, such as passthrough streams, _read
  11186. // may be a completely synchronous operation which may change
  11187. // the state of the read buffer, providing enough data when
  11188. // before there was *not* enough.
  11189. //
  11190. // So, the steps are:
  11191. // 1. Figure out what the state of things will be after we do
  11192. // a read from the buffer.
  11193. //
  11194. // 2. If that resulting state will trigger a _read, then call _read.
  11195. // Note that this may be asynchronous, or synchronous. Yes, it is
  11196. // deeply ugly to write APIs this way, but that still doesn't mean
  11197. // that the Readable class should behave improperly, as streams are
  11198. // designed to be sync/async agnostic.
  11199. // Take note if the _read call is sync or async (ie, if the read call
  11200. // has returned yet), so that we know whether or not it's safe to emit
  11201. // 'readable' etc.
  11202. //
  11203. // 3. Actually pull the requested chunks out of the buffer and return.
  11204. // if we need a readable event, then we need to do some reading.
  11205. var doRead = state.needReadable;
  11206. debug('need readable', doRead);
  11207. // if we currently have less than the highWaterMark, then also read some
  11208. if (state.length === 0 || state.length - n < state.highWaterMark) {
  11209. doRead = true;
  11210. debug('length less than watermark', doRead);
  11211. }
  11212. // however, if we've ended, then there's no point, and if we're already
  11213. // reading, then it's unnecessary.
  11214. if (state.ended || state.reading) {
  11215. doRead = false;
  11216. debug('reading or ended', doRead);
  11217. } else if (doRead) {
  11218. debug('do read');
  11219. state.reading = true;
  11220. state.sync = true;
  11221. // if the length is currently zero, then we *need* a readable event.
  11222. if (state.length === 0) state.needReadable = true;
  11223. // call internal read method
  11224. this._read(state.highWaterMark);
  11225. state.sync = false;
  11226. // If _read pushed data synchronously, then `reading` will be false,
  11227. // and we need to re-evaluate how much data we can return to the user.
  11228. if (!state.reading) n = howMuchToRead(nOrig, state);
  11229. }
  11230. var ret;
  11231. if (n > 0) ret = fromList(n, state);else ret = null;
  11232. if (ret === null) {
  11233. state.needReadable = true;
  11234. n = 0;
  11235. } else {
  11236. state.length -= n;
  11237. }
  11238. if (state.length === 0) {
  11239. // If we have nothing in the buffer, then we want to know
  11240. // as soon as we *do* get something into the buffer.
  11241. if (!state.ended) state.needReadable = true;
  11242. // If we tried to read() past the EOF, then emit end on the next tick.
  11243. if (nOrig !== n && state.ended) endReadable(this);
  11244. }
  11245. if (ret !== null) this.emit('data', ret);
  11246. return ret;
  11247. };
  11248. function onEofChunk(stream, state) {
  11249. if (state.ended) return;
  11250. if (state.decoder) {
  11251. var chunk = state.decoder.end();
  11252. if (chunk && chunk.length) {
  11253. state.buffer.push(chunk);
  11254. state.length += state.objectMode ? 1 : chunk.length;
  11255. }
  11256. }
  11257. state.ended = true;
  11258. // emit 'readable' now to make sure it gets picked up.
  11259. emitReadable(stream);
  11260. }
  11261. // Don't emit readable right away in sync mode, because this can trigger
  11262. // another read() call => stack overflow. This way, it might trigger
  11263. // a nextTick recursion warning, but that's not so bad.
  11264. function emitReadable(stream) {
  11265. var state = stream._readableState;
  11266. state.needReadable = false;
  11267. if (!state.emittedReadable) {
  11268. debug('emitReadable', state.flowing);
  11269. state.emittedReadable = true;
  11270. if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream);
  11271. }
  11272. }
  11273. function emitReadable_(stream) {
  11274. debug('emit readable');
  11275. stream.emit('readable');
  11276. flow(stream);
  11277. }
  11278. // at this point, the user has presumably seen the 'readable' event,
  11279. // and called read() to consume some data. that may have triggered
  11280. // in turn another _read(n) call, in which case reading = true if
  11281. // it's in progress.
  11282. // However, if we're not ended, or reading, and the length < hwm,
  11283. // then go ahead and try to read some more preemptively.
  11284. function maybeReadMore(stream, state) {
  11285. if (!state.readingMore) {
  11286. state.readingMore = true;
  11287. pna.nextTick(maybeReadMore_, stream, state);
  11288. }
  11289. }
  11290. function maybeReadMore_(stream, state) {
  11291. var len = state.length;
  11292. while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) {
  11293. debug('maybeReadMore read 0');
  11294. stream.read(0);
  11295. if (len === state.length)
  11296. // didn't get any data, stop spinning.
  11297. break;else len = state.length;
  11298. }
  11299. state.readingMore = false;
  11300. }
  11301. // abstract method. to be overridden in specific implementation classes.
  11302. // call cb(er, data) where data is <= n in length.
  11303. // for virtual (non-string, non-buffer) streams, "length" is somewhat
  11304. // arbitrary, and perhaps not very meaningful.
  11305. Readable.prototype._read = function (n) {
  11306. this.emit('error', new Error('_read() is not implemented'));
  11307. };
  11308. Readable.prototype.pipe = function (dest, pipeOpts) {
  11309. var src = this;
  11310. var state = this._readableState;
  11311. switch (state.pipesCount) {
  11312. case 0:
  11313. state.pipes = dest;
  11314. break;
  11315. case 1:
  11316. state.pipes = [state.pipes, dest];
  11317. break;
  11318. default:
  11319. state.pipes.push(dest);
  11320. break;
  11321. }
  11322. state.pipesCount += 1;
  11323. debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);
  11324. var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;
  11325. var endFn = doEnd ? onend : unpipe;
  11326. if (state.endEmitted) pna.nextTick(endFn);else src.once('end', endFn);
  11327. dest.on('unpipe', onunpipe);
  11328. function onunpipe(readable, unpipeInfo) {
  11329. debug('onunpipe');
  11330. if (readable === src) {
  11331. if (unpipeInfo && unpipeInfo.hasUnpiped === false) {
  11332. unpipeInfo.hasUnpiped = true;
  11333. cleanup();
  11334. }
  11335. }
  11336. }
  11337. function onend() {
  11338. debug('onend');
  11339. dest.end();
  11340. }
  11341. // when the dest drains, it reduces the awaitDrain counter
  11342. // on the source. This would be more elegant with a .once()
  11343. // handler in flow(), but adding and removing repeatedly is
  11344. // too slow.
  11345. var ondrain = pipeOnDrain(src);
  11346. dest.on('drain', ondrain);
  11347. var cleanedUp = false;
  11348. function cleanup() {
  11349. debug('cleanup');
  11350. // cleanup event handlers once the pipe is broken
  11351. dest.removeListener('close', onclose);
  11352. dest.removeListener('finish', onfinish);
  11353. dest.removeListener('drain', ondrain);
  11354. dest.removeListener('error', onerror);
  11355. dest.removeListener('unpipe', onunpipe);
  11356. src.removeListener('end', onend);
  11357. src.removeListener('end', unpipe);
  11358. src.removeListener('data', ondata);
  11359. cleanedUp = true;
  11360. // if the reader is waiting for a drain event from this
  11361. // specific writer, then it would cause it to never start
  11362. // flowing again.
  11363. // So, if this is awaiting a drain, then we just call it now.
  11364. // If we don't know, then assume that we are waiting for one.
  11365. if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();
  11366. }
  11367. // If the user pushes more data while we're writing to dest then we'll end up
  11368. // in ondata again. However, we only want to increase awaitDrain once because
  11369. // dest will only emit one 'drain' event for the multiple writes.
  11370. // => Introduce a guard on increasing awaitDrain.
  11371. var increasedAwaitDrain = false;
  11372. src.on('data', ondata);
  11373. function ondata(chunk) {
  11374. debug('ondata');
  11375. increasedAwaitDrain = false;
  11376. var ret = dest.write(chunk);
  11377. if (false === ret && !increasedAwaitDrain) {
  11378. // If the user unpiped during `dest.write()`, it is possible
  11379. // to get stuck in a permanently paused state if that write
  11380. // also returned false.
  11381. // => Check whether `dest` is still a piping destination.
  11382. if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {
  11383. debug('false write response, pause', src._readableState.awaitDrain);
  11384. src._readableState.awaitDrain++;
  11385. increasedAwaitDrain = true;
  11386. }
  11387. src.pause();
  11388. }
  11389. }
  11390. // if the dest has an error, then stop piping into it.
  11391. // however, don't suppress the throwing behavior for this.
  11392. function onerror(er) {
  11393. debug('onerror', er);
  11394. unpipe();
  11395. dest.removeListener('error', onerror);
  11396. if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er);
  11397. }
  11398. // Make sure our error handler is attached before userland ones.
  11399. prependListener(dest, 'error', onerror);
  11400. // Both close and finish should trigger unpipe, but only once.
  11401. function onclose() {
  11402. dest.removeListener('finish', onfinish);
  11403. unpipe();
  11404. }
  11405. dest.once('close', onclose);
  11406. function onfinish() {
  11407. debug('onfinish');
  11408. dest.removeListener('close', onclose);
  11409. unpipe();
  11410. }
  11411. dest.once('finish', onfinish);
  11412. function unpipe() {
  11413. debug('unpipe');
  11414. src.unpipe(dest);
  11415. }
  11416. // tell the dest that it's being piped to
  11417. dest.emit('pipe', src);
  11418. // start the flow if it hasn't been started already.
  11419. if (!state.flowing) {
  11420. debug('pipe resume');
  11421. src.resume();
  11422. }
  11423. return dest;
  11424. };
  11425. function pipeOnDrain(src) {
  11426. return function () {
  11427. var state = src._readableState;
  11428. debug('pipeOnDrain', state.awaitDrain);
  11429. if (state.awaitDrain) state.awaitDrain--;
  11430. if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {
  11431. state.flowing = true;
  11432. flow(src);
  11433. }
  11434. };
  11435. }
  11436. Readable.prototype.unpipe = function (dest) {
  11437. var state = this._readableState;
  11438. var unpipeInfo = { hasUnpiped: false };
  11439. // if we're not piping anywhere, then do nothing.
  11440. if (state.pipesCount === 0) return this;
  11441. // just one destination. most common case.
  11442. if (state.pipesCount === 1) {
  11443. // passed in one, but it's not the right one.
  11444. if (dest && dest !== state.pipes) return this;
  11445. if (!dest) dest = state.pipes;
  11446. // got a match.
  11447. state.pipes = null;
  11448. state.pipesCount = 0;
  11449. state.flowing = false;
  11450. if (dest) dest.emit('unpipe', this, unpipeInfo);
  11451. return this;
  11452. }
  11453. // slow case. multiple pipe destinations.
  11454. if (!dest) {
  11455. // remove all.
  11456. var dests = state.pipes;
  11457. var len = state.pipesCount;
  11458. state.pipes = null;
  11459. state.pipesCount = 0;
  11460. state.flowing = false;
  11461. for (var i = 0; i < len; i++) {
  11462. dests[i].emit('unpipe', this, unpipeInfo);
  11463. }return this;
  11464. }
  11465. // try to find the right one.
  11466. var index = indexOf(state.pipes, dest);
  11467. if (index === -1) return this;
  11468. state.pipes.splice(index, 1);
  11469. state.pipesCount -= 1;
  11470. if (state.pipesCount === 1) state.pipes = state.pipes[0];
  11471. dest.emit('unpipe', this, unpipeInfo);
  11472. return this;
  11473. };
  11474. // set up data events if they are asked for
  11475. // Ensure readable listeners eventually get something
  11476. Readable.prototype.on = function (ev, fn) {
  11477. var res = Stream.prototype.on.call(this, ev, fn);
  11478. if (ev === 'data') {
  11479. // Start flowing on next tick if stream isn't explicitly paused
  11480. if (this._readableState.flowing !== false) this.resume();
  11481. } else if (ev === 'readable') {
  11482. var state = this._readableState;
  11483. if (!state.endEmitted && !state.readableListening) {
  11484. state.readableListening = state.needReadable = true;
  11485. state.emittedReadable = false;
  11486. if (!state.reading) {
  11487. pna.nextTick(nReadingNextTick, this);
  11488. } else if (state.length) {
  11489. emitReadable(this);
  11490. }
  11491. }
  11492. }
  11493. return res;
  11494. };
  11495. Readable.prototype.addListener = Readable.prototype.on;
  11496. function nReadingNextTick(self) {
  11497. debug('readable nexttick read 0');
  11498. self.read(0);
  11499. }
  11500. // pause() and resume() are remnants of the legacy readable stream API
  11501. // If the user uses them, then switch into old mode.
  11502. Readable.prototype.resume = function () {
  11503. var state = this._readableState;
  11504. if (!state.flowing) {
  11505. debug('resume');
  11506. state.flowing = true;
  11507. resume(this, state);
  11508. }
  11509. return this;
  11510. };
  11511. function resume(stream, state) {
  11512. if (!state.resumeScheduled) {
  11513. state.resumeScheduled = true;
  11514. pna.nextTick(resume_, stream, state);
  11515. }
  11516. }
  11517. function resume_(stream, state) {
  11518. if (!state.reading) {
  11519. debug('resume read 0');
  11520. stream.read(0);
  11521. }
  11522. state.resumeScheduled = false;
  11523. state.awaitDrain = 0;
  11524. stream.emit('resume');
  11525. flow(stream);
  11526. if (state.flowing && !state.reading) stream.read(0);
  11527. }
  11528. Readable.prototype.pause = function () {
  11529. debug('call pause flowing=%j', this._readableState.flowing);
  11530. if (false !== this._readableState.flowing) {
  11531. debug('pause');
  11532. this._readableState.flowing = false;
  11533. this.emit('pause');
  11534. }
  11535. return this;
  11536. };
  11537. function flow(stream) {
  11538. var state = stream._readableState;
  11539. debug('flow', state.flowing);
  11540. while (state.flowing && stream.read() !== null) {}
  11541. }
  11542. // wrap an old-style stream as the async data source.
  11543. // This is *not* part of the readable stream interface.
  11544. // It is an ugly unfortunate mess of history.
  11545. Readable.prototype.wrap = function (stream) {
  11546. var _this = this;
  11547. var state = this._readableState;
  11548. var paused = false;
  11549. stream.on('end', function () {
  11550. debug('wrapped end');
  11551. if (state.decoder && !state.ended) {
  11552. var chunk = state.decoder.end();
  11553. if (chunk && chunk.length) _this.push(chunk);
  11554. }
  11555. _this.push(null);
  11556. });
  11557. stream.on('data', function (chunk) {
  11558. debug('wrapped data');
  11559. if (state.decoder) chunk = state.decoder.write(chunk);
  11560. // don't skip over falsy values in objectMode
  11561. if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;
  11562. var ret = _this.push(chunk);
  11563. if (!ret) {
  11564. paused = true;
  11565. stream.pause();
  11566. }
  11567. });
  11568. // proxy all the other methods.
  11569. // important when wrapping filters and duplexes.
  11570. for (var i in stream) {
  11571. if (this[i] === undefined && typeof stream[i] === 'function') {
  11572. this[i] = function (method) {
  11573. return function () {
  11574. return stream[method].apply(stream, arguments);
  11575. };
  11576. }(i);
  11577. }
  11578. }
  11579. // proxy certain important events.
  11580. for (var n = 0; n < kProxyEvents.length; n++) {
  11581. stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));
  11582. }
  11583. // when we try to consume some more bytes, simply unpause the
  11584. // underlying stream.
  11585. this._read = function (n) {
  11586. debug('wrapped _read', n);
  11587. if (paused) {
  11588. paused = false;
  11589. stream.resume();
  11590. }
  11591. };
  11592. return this;
  11593. };
  11594. Object.defineProperty(Readable.prototype, 'readableHighWaterMark', {
  11595. // making it explicit this property is not enumerable
  11596. // because otherwise some prototype manipulation in
  11597. // userland will fail
  11598. enumerable: false,
  11599. get: function () {
  11600. return this._readableState.highWaterMark;
  11601. }
  11602. });
  11603. // exposed for testing purposes only.
  11604. Readable._fromList = fromList;
  11605. // Pluck off n bytes from an array of buffers.
  11606. // Length is the combined lengths of all the buffers in the list.
  11607. // This function is designed to be inlinable, so please take care when making
  11608. // changes to the function body.
  11609. function fromList(n, state) {
  11610. // nothing buffered
  11611. if (state.length === 0) return null;
  11612. var ret;
  11613. if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {
  11614. // read it all, truncate the list
  11615. if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length);
  11616. state.buffer.clear();
  11617. } else {
  11618. // read part of list
  11619. ret = fromListPartial(n, state.buffer, state.decoder);
  11620. }
  11621. return ret;
  11622. }
  11623. // Extracts only enough buffered data to satisfy the amount requested.
  11624. // This function is designed to be inlinable, so please take care when making
  11625. // changes to the function body.
  11626. function fromListPartial(n, list, hasStrings) {
  11627. var ret;
  11628. if (n < list.head.data.length) {
  11629. // slice is the same for buffers and strings
  11630. ret = list.head.data.slice(0, n);
  11631. list.head.data = list.head.data.slice(n);
  11632. } else if (n === list.head.data.length) {
  11633. // first chunk is a perfect match
  11634. ret = list.shift();
  11635. } else {
  11636. // result spans more than one buffer
  11637. ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list);
  11638. }
  11639. return ret;
  11640. }
  11641. // Copies a specified amount of characters from the list of buffered data
  11642. // chunks.
  11643. // This function is designed to be inlinable, so please take care when making
  11644. // changes to the function body.
  11645. function copyFromBufferString(n, list) {
  11646. var p = list.head;
  11647. var c = 1;
  11648. var ret = p.data;
  11649. n -= ret.length;
  11650. while (p = p.next) {
  11651. var str = p.data;
  11652. var nb = n > str.length ? str.length : n;
  11653. if (nb === str.length) ret += str;else ret += str.slice(0, n);
  11654. n -= nb;
  11655. if (n === 0) {
  11656. if (nb === str.length) {
  11657. ++c;
  11658. if (p.next) list.head = p.next;else list.head = list.tail = null;
  11659. } else {
  11660. list.head = p;
  11661. p.data = str.slice(nb);
  11662. }
  11663. break;
  11664. }
  11665. ++c;
  11666. }
  11667. list.length -= c;
  11668. return ret;
  11669. }
  11670. // Copies a specified amount of bytes from the list of buffered data chunks.
  11671. // This function is designed to be inlinable, so please take care when making
  11672. // changes to the function body.
  11673. function copyFromBuffer(n, list) {
  11674. var ret = Buffer.allocUnsafe(n);
  11675. var p = list.head;
  11676. var c = 1;
  11677. p.data.copy(ret);
  11678. n -= p.data.length;
  11679. while (p = p.next) {
  11680. var buf = p.data;
  11681. var nb = n > buf.length ? buf.length : n;
  11682. buf.copy(ret, ret.length - n, 0, nb);
  11683. n -= nb;
  11684. if (n === 0) {
  11685. if (nb === buf.length) {
  11686. ++c;
  11687. if (p.next) list.head = p.next;else list.head = list.tail = null;
  11688. } else {
  11689. list.head = p;
  11690. p.data = buf.slice(nb);
  11691. }
  11692. break;
  11693. }
  11694. ++c;
  11695. }
  11696. list.length -= c;
  11697. return ret;
  11698. }
  11699. function endReadable(stream) {
  11700. var state = stream._readableState;
  11701. // If we get here before consuming all the bytes, then that is a
  11702. // bug in node. Should never happen.
  11703. if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream');
  11704. if (!state.endEmitted) {
  11705. state.ended = true;
  11706. pna.nextTick(endReadableNT, state, stream);
  11707. }
  11708. }
  11709. function endReadableNT(state, stream) {
  11710. // Check that we didn't get one last unshift.
  11711. if (!state.endEmitted && state.length === 0) {
  11712. state.endEmitted = true;
  11713. stream.readable = false;
  11714. stream.emit('end');
  11715. }
  11716. }
  11717. function indexOf(xs, x) {
  11718. for (var i = 0, l = xs.length; i < l; i++) {
  11719. if (xs[i] === x) return i;
  11720. }
  11721. return -1;
  11722. }
  11723. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(22), __webpack_require__(25)))
  11724. /***/ }),
  11725. /* 167 */
  11726. /***/ (function(module, exports, __webpack_require__) {
  11727. module.exports = __webpack_require__(68).EventEmitter;
  11728. /***/ }),
  11729. /* 168 */
  11730. /***/ (function(module, exports, __webpack_require__) {
  11731. "use strict";
  11732. /*<replacement>*/
  11733. var pna = __webpack_require__(69);
  11734. /*</replacement>*/
  11735. // undocumented cb() API, needed for core, not for public API
  11736. function destroy(err, cb) {
  11737. var _this = this;
  11738. var readableDestroyed = this._readableState && this._readableState.destroyed;
  11739. var writableDestroyed = this._writableState && this._writableState.destroyed;
  11740. if (readableDestroyed || writableDestroyed) {
  11741. if (cb) {
  11742. cb(err);
  11743. } else if (err && (!this._writableState || !this._writableState.errorEmitted)) {
  11744. pna.nextTick(emitErrorNT, this, err);
  11745. }
  11746. return this;
  11747. }
  11748. // we set destroyed to true before firing error callbacks in order
  11749. // to make it re-entrance safe in case destroy() is called within callbacks
  11750. if (this._readableState) {
  11751. this._readableState.destroyed = true;
  11752. }
  11753. // if this is a duplex stream mark the writable part as destroyed as well
  11754. if (this._writableState) {
  11755. this._writableState.destroyed = true;
  11756. }
  11757. this._destroy(err || null, function (err) {
  11758. if (!cb && err) {
  11759. pna.nextTick(emitErrorNT, _this, err);
  11760. if (_this._writableState) {
  11761. _this._writableState.errorEmitted = true;
  11762. }
  11763. } else if (cb) {
  11764. cb(err);
  11765. }
  11766. });
  11767. return this;
  11768. }
  11769. function undestroy() {
  11770. if (this._readableState) {
  11771. this._readableState.destroyed = false;
  11772. this._readableState.reading = false;
  11773. this._readableState.ended = false;
  11774. this._readableState.endEmitted = false;
  11775. }
  11776. if (this._writableState) {
  11777. this._writableState.destroyed = false;
  11778. this._writableState.ended = false;
  11779. this._writableState.ending = false;
  11780. this._writableState.finished = false;
  11781. this._writableState.errorEmitted = false;
  11782. }
  11783. }
  11784. function emitErrorNT(self, err) {
  11785. self.emit('error', err);
  11786. }
  11787. module.exports = {
  11788. destroy: destroy,
  11789. undestroy: undestroy
  11790. };
  11791. /***/ }),
  11792. /* 169 */
  11793. /***/ (function(module, exports, __webpack_require__) {
  11794. "use strict";
  11795. // Copyright Joyent, Inc. and other Node contributors.
  11796. //
  11797. // Permission is hereby granted, free of charge, to any person obtaining a
  11798. // copy of this software and associated documentation files (the
  11799. // "Software"), to deal in the Software without restriction, including
  11800. // without limitation the rights to use, copy, modify, merge, publish,
  11801. // distribute, sublicense, and/or sell copies of the Software, and to permit
  11802. // persons to whom the Software is furnished to do so, subject to the
  11803. // following conditions:
  11804. //
  11805. // The above copyright notice and this permission notice shall be included
  11806. // in all copies or substantial portions of the Software.
  11807. //
  11808. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  11809. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  11810. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  11811. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  11812. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  11813. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  11814. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  11815. // a transform stream is a readable/writable stream where you do
  11816. // something with the data. Sometimes it's called a "filter",
  11817. // but that's not a great name for it, since that implies a thing where
  11818. // some bits pass through, and others are simply ignored. (That would
  11819. // be a valid example of a transform, of course.)
  11820. //
  11821. // While the output is causally related to the input, it's not a
  11822. // necessarily symmetric or synchronous transformation. For example,
  11823. // a zlib stream might take multiple plain-text writes(), and then
  11824. // emit a single compressed chunk some time in the future.
  11825. //
  11826. // Here's how this works:
  11827. //
  11828. // The Transform stream has all the aspects of the readable and writable
  11829. // stream classes. When you write(chunk), that calls _write(chunk,cb)
  11830. // internally, and returns false if there's a lot of pending writes
  11831. // buffered up. When you call read(), that calls _read(n) until
  11832. // there's enough pending readable data buffered up.
  11833. //
  11834. // In a transform stream, the written data is placed in a buffer. When
  11835. // _read(n) is called, it transforms the queued up data, calling the
  11836. // buffered _write cb's as it consumes chunks. If consuming a single
  11837. // written chunk would result in multiple output chunks, then the first
  11838. // outputted bit calls the readcb, and subsequent chunks just go into
  11839. // the read buffer, and will cause it to emit 'readable' if necessary.
  11840. //
  11841. // This way, back-pressure is actually determined by the reading side,
  11842. // since _read has to be called to start processing a new chunk. However,
  11843. // a pathological inflate type of transform can cause excessive buffering
  11844. // here. For example, imagine a stream where every byte of input is
  11845. // interpreted as an integer from 0-255, and then results in that many
  11846. // bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in
  11847. // 1kb of data being output. In this case, you could write a very small
  11848. // amount of input, and end up with a very large amount of output. In
  11849. // such a pathological inflating mechanism, there'd be no way to tell
  11850. // the system to stop doing the transform. A single 4MB write could
  11851. // cause the system to run out of memory.
  11852. //
  11853. // However, even in such a pathological case, only a single written chunk
  11854. // would be consumed, and then the rest would wait (un-transformed) until
  11855. // the results of the previous transformed chunk were consumed.
  11856. module.exports = Transform;
  11857. var Duplex = __webpack_require__(32);
  11858. /*<replacement>*/
  11859. var util = Object.create(__webpack_require__(56));
  11860. util.inherits = __webpack_require__(46);
  11861. /*</replacement>*/
  11862. util.inherits(Transform, Duplex);
  11863. function afterTransform(er, data) {
  11864. var ts = this._transformState;
  11865. ts.transforming = false;
  11866. var cb = ts.writecb;
  11867. if (!cb) {
  11868. return this.emit('error', new Error('write callback called multiple times'));
  11869. }
  11870. ts.writechunk = null;
  11871. ts.writecb = null;
  11872. if (data != null) // single equals check for both `null` and `undefined`
  11873. this.push(data);
  11874. cb(er);
  11875. var rs = this._readableState;
  11876. rs.reading = false;
  11877. if (rs.needReadable || rs.length < rs.highWaterMark) {
  11878. this._read(rs.highWaterMark);
  11879. }
  11880. }
  11881. function Transform(options) {
  11882. if (!(this instanceof Transform)) return new Transform(options);
  11883. Duplex.call(this, options);
  11884. this._transformState = {
  11885. afterTransform: afterTransform.bind(this),
  11886. needTransform: false,
  11887. transforming: false,
  11888. writecb: null,
  11889. writechunk: null,
  11890. writeencoding: null
  11891. };
  11892. // start out asking for a readable event once data is transformed.
  11893. this._readableState.needReadable = true;
  11894. // we have implemented the _read method, and done the other things
  11895. // that Readable wants before the first _read call, so unset the
  11896. // sync guard flag.
  11897. this._readableState.sync = false;
  11898. if (options) {
  11899. if (typeof options.transform === 'function') this._transform = options.transform;
  11900. if (typeof options.flush === 'function') this._flush = options.flush;
  11901. }
  11902. // When the writable side finishes, then flush out anything remaining.
  11903. this.on('prefinish', prefinish);
  11904. }
  11905. function prefinish() {
  11906. var _this = this;
  11907. if (typeof this._flush === 'function') {
  11908. this._flush(function (er, data) {
  11909. done(_this, er, data);
  11910. });
  11911. } else {
  11912. done(this, null, null);
  11913. }
  11914. }
  11915. Transform.prototype.push = function (chunk, encoding) {
  11916. this._transformState.needTransform = false;
  11917. return Duplex.prototype.push.call(this, chunk, encoding);
  11918. };
  11919. // This is the part where you do stuff!
  11920. // override this function in implementation classes.
  11921. // 'chunk' is an input chunk.
  11922. //
  11923. // Call `push(newChunk)` to pass along transformed output
  11924. // to the readable side. You may call 'push' zero or more times.
  11925. //
  11926. // Call `cb(err)` when you are done with this chunk. If you pass
  11927. // an error, then that'll put the hurt on the whole operation. If you
  11928. // never call cb(), then you'll never get another chunk.
  11929. Transform.prototype._transform = function (chunk, encoding, cb) {
  11930. throw new Error('_transform() is not implemented');
  11931. };
  11932. Transform.prototype._write = function (chunk, encoding, cb) {
  11933. var ts = this._transformState;
  11934. ts.writecb = cb;
  11935. ts.writechunk = chunk;
  11936. ts.writeencoding = encoding;
  11937. if (!ts.transforming) {
  11938. var rs = this._readableState;
  11939. if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);
  11940. }
  11941. };
  11942. // Doesn't matter what the args are here.
  11943. // _transform does all the work.
  11944. // That we got here means that the readable side wants more data.
  11945. Transform.prototype._read = function (n) {
  11946. var ts = this._transformState;
  11947. if (ts.writechunk !== null && ts.writecb && !ts.transforming) {
  11948. ts.transforming = true;
  11949. this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
  11950. } else {
  11951. // mark that we need a transform, so that any data that comes in
  11952. // will get processed, now that we've asked for it.
  11953. ts.needTransform = true;
  11954. }
  11955. };
  11956. Transform.prototype._destroy = function (err, cb) {
  11957. var _this2 = this;
  11958. Duplex.prototype._destroy.call(this, err, function (err2) {
  11959. cb(err2);
  11960. _this2.emit('close');
  11961. });
  11962. };
  11963. function done(stream, er, data) {
  11964. if (er) return stream.emit('error', er);
  11965. if (data != null) // single equals check for both `null` and `undefined`
  11966. stream.push(data);
  11967. // if there's nothing in the write buffer, then that means
  11968. // that nothing more will ever be provided
  11969. if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0');
  11970. if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming');
  11971. return stream.push(null);
  11972. }
  11973. /***/ }),
  11974. /* 170 */
  11975. /***/ (function(module, exports, __webpack_require__) {
  11976. "use strict";
  11977. /* WEBPACK VAR INJECTION */(function(process) {
  11978. var Buffer = __webpack_require__(4).Buffer;
  11979. var Transform = __webpack_require__(100).Transform;
  11980. var binding = __webpack_require__(265);
  11981. var util = __webpack_require__(104);
  11982. var assert = __webpack_require__(171).ok;
  11983. var kMaxLength = __webpack_require__(4).kMaxLength;
  11984. var kRangeErrorMessage = 'Cannot create final Buffer. It would be larger ' + 'than 0x' + kMaxLength.toString(16) + ' bytes';
  11985. // zlib doesn't provide these, so kludge them in following the same
  11986. // const naming scheme zlib uses.
  11987. binding.Z_MIN_WINDOWBITS = 8;
  11988. binding.Z_MAX_WINDOWBITS = 15;
  11989. binding.Z_DEFAULT_WINDOWBITS = 15;
  11990. // fewer than 64 bytes per chunk is stupid.
  11991. // technically it could work with as few as 8, but even 64 bytes
  11992. // is absurdly low. Usually a MB or more is best.
  11993. binding.Z_MIN_CHUNK = 64;
  11994. binding.Z_MAX_CHUNK = Infinity;
  11995. binding.Z_DEFAULT_CHUNK = 16 * 1024;
  11996. binding.Z_MIN_MEMLEVEL = 1;
  11997. binding.Z_MAX_MEMLEVEL = 9;
  11998. binding.Z_DEFAULT_MEMLEVEL = 8;
  11999. binding.Z_MIN_LEVEL = -1;
  12000. binding.Z_MAX_LEVEL = 9;
  12001. binding.Z_DEFAULT_LEVEL = binding.Z_DEFAULT_COMPRESSION;
  12002. // expose all the zlib constants
  12003. var bkeys = Object.keys(binding);
  12004. for (var bk = 0; bk < bkeys.length; bk++) {
  12005. var bkey = bkeys[bk];
  12006. if (bkey.match(/^Z/)) {
  12007. Object.defineProperty(exports, bkey, {
  12008. enumerable: true, value: binding[bkey], writable: false
  12009. });
  12010. }
  12011. }
  12012. // translation table for return codes.
  12013. var codes = {
  12014. Z_OK: binding.Z_OK,
  12015. Z_STREAM_END: binding.Z_STREAM_END,
  12016. Z_NEED_DICT: binding.Z_NEED_DICT,
  12017. Z_ERRNO: binding.Z_ERRNO,
  12018. Z_STREAM_ERROR: binding.Z_STREAM_ERROR,
  12019. Z_DATA_ERROR: binding.Z_DATA_ERROR,
  12020. Z_MEM_ERROR: binding.Z_MEM_ERROR,
  12021. Z_BUF_ERROR: binding.Z_BUF_ERROR,
  12022. Z_VERSION_ERROR: binding.Z_VERSION_ERROR
  12023. };
  12024. var ckeys = Object.keys(codes);
  12025. for (var ck = 0; ck < ckeys.length; ck++) {
  12026. var ckey = ckeys[ck];
  12027. codes[codes[ckey]] = ckey;
  12028. }
  12029. Object.defineProperty(exports, 'codes', {
  12030. enumerable: true, value: Object.freeze(codes), writable: false
  12031. });
  12032. exports.Deflate = Deflate;
  12033. exports.Inflate = Inflate;
  12034. exports.Gzip = Gzip;
  12035. exports.Gunzip = Gunzip;
  12036. exports.DeflateRaw = DeflateRaw;
  12037. exports.InflateRaw = InflateRaw;
  12038. exports.Unzip = Unzip;
  12039. exports.createDeflate = function (o) {
  12040. return new Deflate(o);
  12041. };
  12042. exports.createInflate = function (o) {
  12043. return new Inflate(o);
  12044. };
  12045. exports.createDeflateRaw = function (o) {
  12046. return new DeflateRaw(o);
  12047. };
  12048. exports.createInflateRaw = function (o) {
  12049. return new InflateRaw(o);
  12050. };
  12051. exports.createGzip = function (o) {
  12052. return new Gzip(o);
  12053. };
  12054. exports.createGunzip = function (o) {
  12055. return new Gunzip(o);
  12056. };
  12057. exports.createUnzip = function (o) {
  12058. return new Unzip(o);
  12059. };
  12060. // Convenience methods.
  12061. // compress/decompress a string or buffer in one step.
  12062. exports.deflate = function (buffer, opts, callback) {
  12063. if (typeof opts === 'function') {
  12064. callback = opts;
  12065. opts = {};
  12066. }
  12067. return zlibBuffer(new Deflate(opts), buffer, callback);
  12068. };
  12069. exports.deflateSync = function (buffer, opts) {
  12070. return zlibBufferSync(new Deflate(opts), buffer);
  12071. };
  12072. exports.gzip = function (buffer, opts, callback) {
  12073. if (typeof opts === 'function') {
  12074. callback = opts;
  12075. opts = {};
  12076. }
  12077. return zlibBuffer(new Gzip(opts), buffer, callback);
  12078. };
  12079. exports.gzipSync = function (buffer, opts) {
  12080. return zlibBufferSync(new Gzip(opts), buffer);
  12081. };
  12082. exports.deflateRaw = function (buffer, opts, callback) {
  12083. if (typeof opts === 'function') {
  12084. callback = opts;
  12085. opts = {};
  12086. }
  12087. return zlibBuffer(new DeflateRaw(opts), buffer, callback);
  12088. };
  12089. exports.deflateRawSync = function (buffer, opts) {
  12090. return zlibBufferSync(new DeflateRaw(opts), buffer);
  12091. };
  12092. exports.unzip = function (buffer, opts, callback) {
  12093. if (typeof opts === 'function') {
  12094. callback = opts;
  12095. opts = {};
  12096. }
  12097. return zlibBuffer(new Unzip(opts), buffer, callback);
  12098. };
  12099. exports.unzipSync = function (buffer, opts) {
  12100. return zlibBufferSync(new Unzip(opts), buffer);
  12101. };
  12102. exports.inflate = function (buffer, opts, callback) {
  12103. if (typeof opts === 'function') {
  12104. callback = opts;
  12105. opts = {};
  12106. }
  12107. return zlibBuffer(new Inflate(opts), buffer, callback);
  12108. };
  12109. exports.inflateSync = function (buffer, opts) {
  12110. return zlibBufferSync(new Inflate(opts), buffer);
  12111. };
  12112. exports.gunzip = function (buffer, opts, callback) {
  12113. if (typeof opts === 'function') {
  12114. callback = opts;
  12115. opts = {};
  12116. }
  12117. return zlibBuffer(new Gunzip(opts), buffer, callback);
  12118. };
  12119. exports.gunzipSync = function (buffer, opts) {
  12120. return zlibBufferSync(new Gunzip(opts), buffer);
  12121. };
  12122. exports.inflateRaw = function (buffer, opts, callback) {
  12123. if (typeof opts === 'function') {
  12124. callback = opts;
  12125. opts = {};
  12126. }
  12127. return zlibBuffer(new InflateRaw(opts), buffer, callback);
  12128. };
  12129. exports.inflateRawSync = function (buffer, opts) {
  12130. return zlibBufferSync(new InflateRaw(opts), buffer);
  12131. };
  12132. function zlibBuffer(engine, buffer, callback) {
  12133. var buffers = [];
  12134. var nread = 0;
  12135. engine.on('error', onError);
  12136. engine.on('end', onEnd);
  12137. engine.end(buffer);
  12138. flow();
  12139. function flow() {
  12140. var chunk;
  12141. while (null !== (chunk = engine.read())) {
  12142. buffers.push(chunk);
  12143. nread += chunk.length;
  12144. }
  12145. engine.once('readable', flow);
  12146. }
  12147. function onError(err) {
  12148. engine.removeListener('end', onEnd);
  12149. engine.removeListener('readable', flow);
  12150. callback(err);
  12151. }
  12152. function onEnd() {
  12153. var buf;
  12154. var err = null;
  12155. if (nread >= kMaxLength) {
  12156. err = new RangeError(kRangeErrorMessage);
  12157. } else {
  12158. buf = Buffer.concat(buffers, nread);
  12159. }
  12160. buffers = [];
  12161. engine.close();
  12162. callback(err, buf);
  12163. }
  12164. }
  12165. function zlibBufferSync(engine, buffer) {
  12166. if (typeof buffer === 'string') buffer = Buffer.from(buffer);
  12167. if (!Buffer.isBuffer(buffer)) throw new TypeError('Not a string or buffer');
  12168. var flushFlag = engine._finishFlushFlag;
  12169. return engine._processChunk(buffer, flushFlag);
  12170. }
  12171. // generic zlib
  12172. // minimal 2-byte header
  12173. function Deflate(opts) {
  12174. if (!(this instanceof Deflate)) return new Deflate(opts);
  12175. Zlib.call(this, opts, binding.DEFLATE);
  12176. }
  12177. function Inflate(opts) {
  12178. if (!(this instanceof Inflate)) return new Inflate(opts);
  12179. Zlib.call(this, opts, binding.INFLATE);
  12180. }
  12181. // gzip - bigger header, same deflate compression
  12182. function Gzip(opts) {
  12183. if (!(this instanceof Gzip)) return new Gzip(opts);
  12184. Zlib.call(this, opts, binding.GZIP);
  12185. }
  12186. function Gunzip(opts) {
  12187. if (!(this instanceof Gunzip)) return new Gunzip(opts);
  12188. Zlib.call(this, opts, binding.GUNZIP);
  12189. }
  12190. // raw - no header
  12191. function DeflateRaw(opts) {
  12192. if (!(this instanceof DeflateRaw)) return new DeflateRaw(opts);
  12193. Zlib.call(this, opts, binding.DEFLATERAW);
  12194. }
  12195. function InflateRaw(opts) {
  12196. if (!(this instanceof InflateRaw)) return new InflateRaw(opts);
  12197. Zlib.call(this, opts, binding.INFLATERAW);
  12198. }
  12199. // auto-detect header.
  12200. function Unzip(opts) {
  12201. if (!(this instanceof Unzip)) return new Unzip(opts);
  12202. Zlib.call(this, opts, binding.UNZIP);
  12203. }
  12204. function isValidFlushFlag(flag) {
  12205. return flag === binding.Z_NO_FLUSH || flag === binding.Z_PARTIAL_FLUSH || flag === binding.Z_SYNC_FLUSH || flag === binding.Z_FULL_FLUSH || flag === binding.Z_FINISH || flag === binding.Z_BLOCK;
  12206. }
  12207. // the Zlib class they all inherit from
  12208. // This thing manages the queue of requests, and returns
  12209. // true or false if there is anything in the queue when
  12210. // you call the .write() method.
  12211. function Zlib(opts, mode) {
  12212. var _this = this;
  12213. this._opts = opts = opts || {};
  12214. this._chunkSize = opts.chunkSize || exports.Z_DEFAULT_CHUNK;
  12215. Transform.call(this, opts);
  12216. if (opts.flush && !isValidFlushFlag(opts.flush)) {
  12217. throw new Error('Invalid flush flag: ' + opts.flush);
  12218. }
  12219. if (opts.finishFlush && !isValidFlushFlag(opts.finishFlush)) {
  12220. throw new Error('Invalid flush flag: ' + opts.finishFlush);
  12221. }
  12222. this._flushFlag = opts.flush || binding.Z_NO_FLUSH;
  12223. this._finishFlushFlag = typeof opts.finishFlush !== 'undefined' ? opts.finishFlush : binding.Z_FINISH;
  12224. if (opts.chunkSize) {
  12225. if (opts.chunkSize < exports.Z_MIN_CHUNK || opts.chunkSize > exports.Z_MAX_CHUNK) {
  12226. throw new Error('Invalid chunk size: ' + opts.chunkSize);
  12227. }
  12228. }
  12229. if (opts.windowBits) {
  12230. if (opts.windowBits < exports.Z_MIN_WINDOWBITS || opts.windowBits > exports.Z_MAX_WINDOWBITS) {
  12231. throw new Error('Invalid windowBits: ' + opts.windowBits);
  12232. }
  12233. }
  12234. if (opts.level) {
  12235. if (opts.level < exports.Z_MIN_LEVEL || opts.level > exports.Z_MAX_LEVEL) {
  12236. throw new Error('Invalid compression level: ' + opts.level);
  12237. }
  12238. }
  12239. if (opts.memLevel) {
  12240. if (opts.memLevel < exports.Z_MIN_MEMLEVEL || opts.memLevel > exports.Z_MAX_MEMLEVEL) {
  12241. throw new Error('Invalid memLevel: ' + opts.memLevel);
  12242. }
  12243. }
  12244. if (opts.strategy) {
  12245. if (opts.strategy != exports.Z_FILTERED && opts.strategy != exports.Z_HUFFMAN_ONLY && opts.strategy != exports.Z_RLE && opts.strategy != exports.Z_FIXED && opts.strategy != exports.Z_DEFAULT_STRATEGY) {
  12246. throw new Error('Invalid strategy: ' + opts.strategy);
  12247. }
  12248. }
  12249. if (opts.dictionary) {
  12250. if (!Buffer.isBuffer(opts.dictionary)) {
  12251. throw new Error('Invalid dictionary: it should be a Buffer instance');
  12252. }
  12253. }
  12254. this._handle = new binding.Zlib(mode);
  12255. var self = this;
  12256. this._hadError = false;
  12257. this._handle.onerror = function (message, errno) {
  12258. // there is no way to cleanly recover.
  12259. // continuing only obscures problems.
  12260. _close(self);
  12261. self._hadError = true;
  12262. var error = new Error(message);
  12263. error.errno = errno;
  12264. error.code = exports.codes[errno];
  12265. self.emit('error', error);
  12266. };
  12267. var level = exports.Z_DEFAULT_COMPRESSION;
  12268. if (typeof opts.level === 'number') level = opts.level;
  12269. var strategy = exports.Z_DEFAULT_STRATEGY;
  12270. if (typeof opts.strategy === 'number') strategy = opts.strategy;
  12271. this._handle.init(opts.windowBits || exports.Z_DEFAULT_WINDOWBITS, level, opts.memLevel || exports.Z_DEFAULT_MEMLEVEL, strategy, opts.dictionary);
  12272. this._buffer = Buffer.allocUnsafe(this._chunkSize);
  12273. this._offset = 0;
  12274. this._level = level;
  12275. this._strategy = strategy;
  12276. this.once('end', this.close);
  12277. Object.defineProperty(this, '_closed', {
  12278. get: function () {
  12279. return !_this._handle;
  12280. },
  12281. configurable: true,
  12282. enumerable: true
  12283. });
  12284. }
  12285. util.inherits(Zlib, Transform);
  12286. Zlib.prototype.params = function (level, strategy, callback) {
  12287. if (level < exports.Z_MIN_LEVEL || level > exports.Z_MAX_LEVEL) {
  12288. throw new RangeError('Invalid compression level: ' + level);
  12289. }
  12290. if (strategy != exports.Z_FILTERED && strategy != exports.Z_HUFFMAN_ONLY && strategy != exports.Z_RLE && strategy != exports.Z_FIXED && strategy != exports.Z_DEFAULT_STRATEGY) {
  12291. throw new TypeError('Invalid strategy: ' + strategy);
  12292. }
  12293. if (this._level !== level || this._strategy !== strategy) {
  12294. var self = this;
  12295. this.flush(binding.Z_SYNC_FLUSH, function () {
  12296. assert(self._handle, 'zlib binding closed');
  12297. self._handle.params(level, strategy);
  12298. if (!self._hadError) {
  12299. self._level = level;
  12300. self._strategy = strategy;
  12301. if (callback) callback();
  12302. }
  12303. });
  12304. } else {
  12305. process.nextTick(callback);
  12306. }
  12307. };
  12308. Zlib.prototype.reset = function () {
  12309. assert(this._handle, 'zlib binding closed');
  12310. return this._handle.reset();
  12311. };
  12312. // This is the _flush function called by the transform class,
  12313. // internally, when the last chunk has been written.
  12314. Zlib.prototype._flush = function (callback) {
  12315. this._transform(Buffer.alloc(0), '', callback);
  12316. };
  12317. Zlib.prototype.flush = function (kind, callback) {
  12318. var _this2 = this;
  12319. var ws = this._writableState;
  12320. if (typeof kind === 'function' || kind === undefined && !callback) {
  12321. callback = kind;
  12322. kind = binding.Z_FULL_FLUSH;
  12323. }
  12324. if (ws.ended) {
  12325. if (callback) process.nextTick(callback);
  12326. } else if (ws.ending) {
  12327. if (callback) this.once('end', callback);
  12328. } else if (ws.needDrain) {
  12329. if (callback) {
  12330. this.once('drain', function () {
  12331. return _this2.flush(kind, callback);
  12332. });
  12333. }
  12334. } else {
  12335. this._flushFlag = kind;
  12336. this.write(Buffer.alloc(0), '', callback);
  12337. }
  12338. };
  12339. Zlib.prototype.close = function (callback) {
  12340. _close(this, callback);
  12341. process.nextTick(emitCloseNT, this);
  12342. };
  12343. function _close(engine, callback) {
  12344. if (callback) process.nextTick(callback);
  12345. // Caller may invoke .close after a zlib error (which will null _handle).
  12346. if (!engine._handle) return;
  12347. engine._handle.close();
  12348. engine._handle = null;
  12349. }
  12350. function emitCloseNT(self) {
  12351. self.emit('close');
  12352. }
  12353. Zlib.prototype._transform = function (chunk, encoding, cb) {
  12354. var flushFlag;
  12355. var ws = this._writableState;
  12356. var ending = ws.ending || ws.ended;
  12357. var last = ending && (!chunk || ws.length === chunk.length);
  12358. if (chunk !== null && !Buffer.isBuffer(chunk)) return cb(new Error('invalid input'));
  12359. if (!this._handle) return cb(new Error('zlib binding closed'));
  12360. // If it's the last chunk, or a final flush, we use the Z_FINISH flush flag
  12361. // (or whatever flag was provided using opts.finishFlush).
  12362. // If it's explicitly flushing at some other time, then we use
  12363. // Z_FULL_FLUSH. Otherwise, use Z_NO_FLUSH for maximum compression
  12364. // goodness.
  12365. if (last) flushFlag = this._finishFlushFlag;else {
  12366. flushFlag = this._flushFlag;
  12367. // once we've flushed the last of the queue, stop flushing and
  12368. // go back to the normal behavior.
  12369. if (chunk.length >= ws.length) {
  12370. this._flushFlag = this._opts.flush || binding.Z_NO_FLUSH;
  12371. }
  12372. }
  12373. this._processChunk(chunk, flushFlag, cb);
  12374. };
  12375. Zlib.prototype._processChunk = function (chunk, flushFlag, cb) {
  12376. var availInBefore = chunk && chunk.length;
  12377. var availOutBefore = this._chunkSize - this._offset;
  12378. var inOff = 0;
  12379. var self = this;
  12380. var async = typeof cb === 'function';
  12381. if (!async) {
  12382. var buffers = [];
  12383. var nread = 0;
  12384. var error;
  12385. this.on('error', function (er) {
  12386. error = er;
  12387. });
  12388. assert(this._handle, 'zlib binding closed');
  12389. do {
  12390. var res = this._handle.writeSync(flushFlag, chunk, // in
  12391. inOff, // in_off
  12392. availInBefore, // in_len
  12393. this._buffer, // out
  12394. this._offset, //out_off
  12395. availOutBefore); // out_len
  12396. } while (!this._hadError && callback(res[0], res[1]));
  12397. if (this._hadError) {
  12398. throw error;
  12399. }
  12400. if (nread >= kMaxLength) {
  12401. _close(this);
  12402. throw new RangeError(kRangeErrorMessage);
  12403. }
  12404. var buf = Buffer.concat(buffers, nread);
  12405. _close(this);
  12406. return buf;
  12407. }
  12408. assert(this._handle, 'zlib binding closed');
  12409. var req = this._handle.write(flushFlag, chunk, // in
  12410. inOff, // in_off
  12411. availInBefore, // in_len
  12412. this._buffer, // out
  12413. this._offset, //out_off
  12414. availOutBefore); // out_len
  12415. req.buffer = chunk;
  12416. req.callback = callback;
  12417. function callback(availInAfter, availOutAfter) {
  12418. // When the callback is used in an async write, the callback's
  12419. // context is the `req` object that was created. The req object
  12420. // is === this._handle, and that's why it's important to null
  12421. // out the values after they are done being used. `this._handle`
  12422. // can stay in memory longer than the callback and buffer are needed.
  12423. if (this) {
  12424. this.buffer = null;
  12425. this.callback = null;
  12426. }
  12427. if (self._hadError) return;
  12428. var have = availOutBefore - availOutAfter;
  12429. assert(have >= 0, 'have should not go down');
  12430. if (have > 0) {
  12431. var out = self._buffer.slice(self._offset, self._offset + have);
  12432. self._offset += have;
  12433. // serve some output to the consumer.
  12434. if (async) {
  12435. self.push(out);
  12436. } else {
  12437. buffers.push(out);
  12438. nread += out.length;
  12439. }
  12440. }
  12441. // exhausted the output buffer, or used all the input create a new one.
  12442. if (availOutAfter === 0 || self._offset >= self._chunkSize) {
  12443. availOutBefore = self._chunkSize;
  12444. self._offset = 0;
  12445. self._buffer = Buffer.allocUnsafe(self._chunkSize);
  12446. }
  12447. if (availOutAfter === 0) {
  12448. // Not actually done. Need to reprocess.
  12449. // Also, update the availInBefore to the availInAfter value,
  12450. // so that if we have to hit it a third (fourth, etc.) time,
  12451. // it'll have the correct byte counts.
  12452. inOff += availInBefore - availInAfter;
  12453. availInBefore = availInAfter;
  12454. if (!async) return true;
  12455. var newReq = self._handle.write(flushFlag, chunk, inOff, availInBefore, self._buffer, self._offset, self._chunkSize);
  12456. newReq.callback = callback; // this same function
  12457. newReq.buffer = chunk;
  12458. return;
  12459. }
  12460. if (!async) return false;
  12461. // finished with the chunk.
  12462. cb();
  12463. }
  12464. };
  12465. util.inherits(Deflate, Zlib);
  12466. util.inherits(Inflate, Zlib);
  12467. util.inherits(Gzip, Zlib);
  12468. util.inherits(Gunzip, Zlib);
  12469. util.inherits(DeflateRaw, Zlib);
  12470. util.inherits(InflateRaw, Zlib);
  12471. util.inherits(Unzip, Zlib);
  12472. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(25)))
  12473. /***/ }),
  12474. /* 171 */
  12475. /***/ (function(module, exports, __webpack_require__) {
  12476. "use strict";
  12477. /* WEBPACK VAR INJECTION */(function(global) {
  12478. var objectAssign = __webpack_require__(266);
  12479. // compare and isBuffer taken from https://github.com/feross/buffer/blob/680e9e5e488f22aac27599a57dc844a6315928dd/index.js
  12480. // original notice:
  12481. /*!
  12482. * The buffer module from node.js, for the browser.
  12483. *
  12484. * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
  12485. * @license MIT
  12486. */
  12487. function compare(a, b) {
  12488. if (a === b) {
  12489. return 0;
  12490. }
  12491. var x = a.length;
  12492. var y = b.length;
  12493. for (var i = 0, len = Math.min(x, y); i < len; ++i) {
  12494. if (a[i] !== b[i]) {
  12495. x = a[i];
  12496. y = b[i];
  12497. break;
  12498. }
  12499. }
  12500. if (x < y) {
  12501. return -1;
  12502. }
  12503. if (y < x) {
  12504. return 1;
  12505. }
  12506. return 0;
  12507. }
  12508. function isBuffer(b) {
  12509. if (global.Buffer && typeof global.Buffer.isBuffer === 'function') {
  12510. return global.Buffer.isBuffer(b);
  12511. }
  12512. return !!(b != null && b._isBuffer);
  12513. }
  12514. // based on node assert, original notice:
  12515. // NB: The URL to the CommonJS spec is kept just for tradition.
  12516. // node-assert has evolved a lot since then, both in API and behavior.
  12517. // http://wiki.commonjs.org/wiki/Unit_Testing/1.0
  12518. //
  12519. // THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8!
  12520. //
  12521. // Originally from narwhal.js (http://narwhaljs.org)
  12522. // Copyright (c) 2009 Thomas Robinson <280north.com>
  12523. //
  12524. // Permission is hereby granted, free of charge, to any person obtaining a copy
  12525. // of this software and associated documentation files (the 'Software'), to
  12526. // deal in the Software without restriction, including without limitation the
  12527. // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  12528. // sell copies of the Software, and to permit persons to whom the Software is
  12529. // furnished to do so, subject to the following conditions:
  12530. //
  12531. // The above copyright notice and this permission notice shall be included in
  12532. // all copies or substantial portions of the Software.
  12533. //
  12534. // THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  12535. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  12536. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  12537. // AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
  12538. // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  12539. // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  12540. var util = __webpack_require__(104);
  12541. var hasOwn = Object.prototype.hasOwnProperty;
  12542. var pSlice = Array.prototype.slice;
  12543. var functionsHaveNames = (function () {
  12544. return function foo() {}.name === 'foo';
  12545. }());
  12546. function pToString (obj) {
  12547. return Object.prototype.toString.call(obj);
  12548. }
  12549. function isView(arrbuf) {
  12550. if (isBuffer(arrbuf)) {
  12551. return false;
  12552. }
  12553. if (typeof global.ArrayBuffer !== 'function') {
  12554. return false;
  12555. }
  12556. if (typeof ArrayBuffer.isView === 'function') {
  12557. return ArrayBuffer.isView(arrbuf);
  12558. }
  12559. if (!arrbuf) {
  12560. return false;
  12561. }
  12562. if (arrbuf instanceof DataView) {
  12563. return true;
  12564. }
  12565. if (arrbuf.buffer && arrbuf.buffer instanceof ArrayBuffer) {
  12566. return true;
  12567. }
  12568. return false;
  12569. }
  12570. // 1. The assert module provides functions that throw
  12571. // AssertionError's when particular conditions are not met. The
  12572. // assert module must conform to the following interface.
  12573. var assert = module.exports = ok;
  12574. // 2. The AssertionError is defined in assert.
  12575. // new assert.AssertionError({ message: message,
  12576. // actual: actual,
  12577. // expected: expected })
  12578. var regex = /\s*function\s+([^\(\s]*)\s*/;
  12579. // based on https://github.com/ljharb/function.prototype.name/blob/adeeeec8bfcc6068b187d7d9fb3d5bb1d3a30899/implementation.js
  12580. function getName(func) {
  12581. if (!util.isFunction(func)) {
  12582. return;
  12583. }
  12584. if (functionsHaveNames) {
  12585. return func.name;
  12586. }
  12587. var str = func.toString();
  12588. var match = str.match(regex);
  12589. return match && match[1];
  12590. }
  12591. assert.AssertionError = function AssertionError(options) {
  12592. this.name = 'AssertionError';
  12593. this.actual = options.actual;
  12594. this.expected = options.expected;
  12595. this.operator = options.operator;
  12596. if (options.message) {
  12597. this.message = options.message;
  12598. this.generatedMessage = false;
  12599. } else {
  12600. this.message = getMessage(this);
  12601. this.generatedMessage = true;
  12602. }
  12603. var stackStartFunction = options.stackStartFunction || fail;
  12604. if (Error.captureStackTrace) {
  12605. Error.captureStackTrace(this, stackStartFunction);
  12606. } else {
  12607. // non v8 browsers so we can have a stacktrace
  12608. var err = new Error();
  12609. if (err.stack) {
  12610. var out = err.stack;
  12611. // try to strip useless frames
  12612. var fn_name = getName(stackStartFunction);
  12613. var idx = out.indexOf('\n' + fn_name);
  12614. if (idx >= 0) {
  12615. // once we have located the function frame
  12616. // we need to strip out everything before it (and its line)
  12617. var next_line = out.indexOf('\n', idx + 1);
  12618. out = out.substring(next_line + 1);
  12619. }
  12620. this.stack = out;
  12621. }
  12622. }
  12623. };
  12624. // assert.AssertionError instanceof Error
  12625. util.inherits(assert.AssertionError, Error);
  12626. function truncate(s, n) {
  12627. if (typeof s === 'string') {
  12628. return s.length < n ? s : s.slice(0, n);
  12629. } else {
  12630. return s;
  12631. }
  12632. }
  12633. function inspect(something) {
  12634. if (functionsHaveNames || !util.isFunction(something)) {
  12635. return util.inspect(something);
  12636. }
  12637. var rawname = getName(something);
  12638. var name = rawname ? ': ' + rawname : '';
  12639. return '[Function' + name + ']';
  12640. }
  12641. function getMessage(self) {
  12642. return truncate(inspect(self.actual), 128) + ' ' +
  12643. self.operator + ' ' +
  12644. truncate(inspect(self.expected), 128);
  12645. }
  12646. // At present only the three keys mentioned above are used and
  12647. // understood by the spec. Implementations or sub modules can pass
  12648. // other keys to the AssertionError's constructor - they will be
  12649. // ignored.
  12650. // 3. All of the following functions must throw an AssertionError
  12651. // when a corresponding condition is not met, with a message that
  12652. // may be undefined if not provided. All assertion methods provide
  12653. // both the actual and expected values to the assertion error for
  12654. // display purposes.
  12655. function fail(actual, expected, message, operator, stackStartFunction) {
  12656. throw new assert.AssertionError({
  12657. message: message,
  12658. actual: actual,
  12659. expected: expected,
  12660. operator: operator,
  12661. stackStartFunction: stackStartFunction
  12662. });
  12663. }
  12664. // EXTENSION! allows for well behaved errors defined elsewhere.
  12665. assert.fail = fail;
  12666. // 4. Pure assertion tests whether a value is truthy, as determined
  12667. // by !!guard.
  12668. // assert.ok(guard, message_opt);
  12669. // This statement is equivalent to assert.equal(true, !!guard,
  12670. // message_opt);. To test strictly for the value true, use
  12671. // assert.strictEqual(true, guard, message_opt);.
  12672. function ok(value, message) {
  12673. if (!value) fail(value, true, message, '==', assert.ok);
  12674. }
  12675. assert.ok = ok;
  12676. // 5. The equality assertion tests shallow, coercive equality with
  12677. // ==.
  12678. // assert.equal(actual, expected, message_opt);
  12679. assert.equal = function equal(actual, expected, message) {
  12680. if (actual != expected) fail(actual, expected, message, '==', assert.equal);
  12681. };
  12682. // 6. The non-equality assertion tests for whether two objects are not equal
  12683. // with != assert.notEqual(actual, expected, message_opt);
  12684. assert.notEqual = function notEqual(actual, expected, message) {
  12685. if (actual == expected) {
  12686. fail(actual, expected, message, '!=', assert.notEqual);
  12687. }
  12688. };
  12689. // 7. The equivalence assertion tests a deep equality relation.
  12690. // assert.deepEqual(actual, expected, message_opt);
  12691. assert.deepEqual = function deepEqual(actual, expected, message) {
  12692. if (!_deepEqual(actual, expected, false)) {
  12693. fail(actual, expected, message, 'deepEqual', assert.deepEqual);
  12694. }
  12695. };
  12696. assert.deepStrictEqual = function deepStrictEqual(actual, expected, message) {
  12697. if (!_deepEqual(actual, expected, true)) {
  12698. fail(actual, expected, message, 'deepStrictEqual', assert.deepStrictEqual);
  12699. }
  12700. };
  12701. function _deepEqual(actual, expected, strict, memos) {
  12702. // 7.1. All identical values are equivalent, as determined by ===.
  12703. if (actual === expected) {
  12704. return true;
  12705. } else if (isBuffer(actual) && isBuffer(expected)) {
  12706. return compare(actual, expected) === 0;
  12707. // 7.2. If the expected value is a Date object, the actual value is
  12708. // equivalent if it is also a Date object that refers to the same time.
  12709. } else if (util.isDate(actual) && util.isDate(expected)) {
  12710. return actual.getTime() === expected.getTime();
  12711. // 7.3 If the expected value is a RegExp object, the actual value is
  12712. // equivalent if it is also a RegExp object with the same source and
  12713. // properties (`global`, `multiline`, `lastIndex`, `ignoreCase`).
  12714. } else if (util.isRegExp(actual) && util.isRegExp(expected)) {
  12715. return actual.source === expected.source &&
  12716. actual.global === expected.global &&
  12717. actual.multiline === expected.multiline &&
  12718. actual.lastIndex === expected.lastIndex &&
  12719. actual.ignoreCase === expected.ignoreCase;
  12720. // 7.4. Other pairs that do not both pass typeof value == 'object',
  12721. // equivalence is determined by ==.
  12722. } else if ((actual === null || typeof actual !== 'object') &&
  12723. (expected === null || typeof expected !== 'object')) {
  12724. return strict ? actual === expected : actual == expected;
  12725. // If both values are instances of typed arrays, wrap their underlying
  12726. // ArrayBuffers in a Buffer each to increase performance
  12727. // This optimization requires the arrays to have the same type as checked by
  12728. // Object.prototype.toString (aka pToString). Never perform binary
  12729. // comparisons for Float*Arrays, though, since e.g. +0 === -0 but their
  12730. // bit patterns are not identical.
  12731. } else if (isView(actual) && isView(expected) &&
  12732. pToString(actual) === pToString(expected) &&
  12733. !(actual instanceof Float32Array ||
  12734. actual instanceof Float64Array)) {
  12735. return compare(new Uint8Array(actual.buffer),
  12736. new Uint8Array(expected.buffer)) === 0;
  12737. // 7.5 For all other Object pairs, including Array objects, equivalence is
  12738. // determined by having the same number of owned properties (as verified
  12739. // with Object.prototype.hasOwnProperty.call), the same set of keys
  12740. // (although not necessarily the same order), equivalent values for every
  12741. // corresponding key, and an identical 'prototype' property. Note: this
  12742. // accounts for both named and indexed properties on Arrays.
  12743. } else if (isBuffer(actual) !== isBuffer(expected)) {
  12744. return false;
  12745. } else {
  12746. memos = memos || {actual: [], expected: []};
  12747. var actualIndex = memos.actual.indexOf(actual);
  12748. if (actualIndex !== -1) {
  12749. if (actualIndex === memos.expected.indexOf(expected)) {
  12750. return true;
  12751. }
  12752. }
  12753. memos.actual.push(actual);
  12754. memos.expected.push(expected);
  12755. return objEquiv(actual, expected, strict, memos);
  12756. }
  12757. }
  12758. function isArguments(object) {
  12759. return Object.prototype.toString.call(object) == '[object Arguments]';
  12760. }
  12761. function objEquiv(a, b, strict, actualVisitedObjects) {
  12762. if (a === null || a === undefined || b === null || b === undefined)
  12763. return false;
  12764. // if one is a primitive, the other must be same
  12765. if (util.isPrimitive(a) || util.isPrimitive(b))
  12766. return a === b;
  12767. if (strict && Object.getPrototypeOf(a) !== Object.getPrototypeOf(b))
  12768. return false;
  12769. var aIsArgs = isArguments(a);
  12770. var bIsArgs = isArguments(b);
  12771. if ((aIsArgs && !bIsArgs) || (!aIsArgs && bIsArgs))
  12772. return false;
  12773. if (aIsArgs) {
  12774. a = pSlice.call(a);
  12775. b = pSlice.call(b);
  12776. return _deepEqual(a, b, strict);
  12777. }
  12778. var ka = objectKeys(a);
  12779. var kb = objectKeys(b);
  12780. var key, i;
  12781. // having the same number of owned properties (keys incorporates
  12782. // hasOwnProperty)
  12783. if (ka.length !== kb.length)
  12784. return false;
  12785. //the same set of keys (although not necessarily the same order),
  12786. ka.sort();
  12787. kb.sort();
  12788. //~~~cheap key test
  12789. for (i = ka.length - 1; i >= 0; i--) {
  12790. if (ka[i] !== kb[i])
  12791. return false;
  12792. }
  12793. //equivalent values for every corresponding key, and
  12794. //~~~possibly expensive deep test
  12795. for (i = ka.length - 1; i >= 0; i--) {
  12796. key = ka[i];
  12797. if (!_deepEqual(a[key], b[key], strict, actualVisitedObjects))
  12798. return false;
  12799. }
  12800. return true;
  12801. }
  12802. // 8. The non-equivalence assertion tests for any deep inequality.
  12803. // assert.notDeepEqual(actual, expected, message_opt);
  12804. assert.notDeepEqual = function notDeepEqual(actual, expected, message) {
  12805. if (_deepEqual(actual, expected, false)) {
  12806. fail(actual, expected, message, 'notDeepEqual', assert.notDeepEqual);
  12807. }
  12808. };
  12809. assert.notDeepStrictEqual = notDeepStrictEqual;
  12810. function notDeepStrictEqual(actual, expected, message) {
  12811. if (_deepEqual(actual, expected, true)) {
  12812. fail(actual, expected, message, 'notDeepStrictEqual', notDeepStrictEqual);
  12813. }
  12814. }
  12815. // 9. The strict equality assertion tests strict equality, as determined by ===.
  12816. // assert.strictEqual(actual, expected, message_opt);
  12817. assert.strictEqual = function strictEqual(actual, expected, message) {
  12818. if (actual !== expected) {
  12819. fail(actual, expected, message, '===', assert.strictEqual);
  12820. }
  12821. };
  12822. // 10. The strict non-equality assertion tests for strict inequality, as
  12823. // determined by !==. assert.notStrictEqual(actual, expected, message_opt);
  12824. assert.notStrictEqual = function notStrictEqual(actual, expected, message) {
  12825. if (actual === expected) {
  12826. fail(actual, expected, message, '!==', assert.notStrictEqual);
  12827. }
  12828. };
  12829. function expectedException(actual, expected) {
  12830. if (!actual || !expected) {
  12831. return false;
  12832. }
  12833. if (Object.prototype.toString.call(expected) == '[object RegExp]') {
  12834. return expected.test(actual);
  12835. }
  12836. try {
  12837. if (actual instanceof expected) {
  12838. return true;
  12839. }
  12840. } catch (e) {
  12841. // Ignore. The instanceof check doesn't work for arrow functions.
  12842. }
  12843. if (Error.isPrototypeOf(expected)) {
  12844. return false;
  12845. }
  12846. return expected.call({}, actual) === true;
  12847. }
  12848. function _tryBlock(block) {
  12849. var error;
  12850. try {
  12851. block();
  12852. } catch (e) {
  12853. error = e;
  12854. }
  12855. return error;
  12856. }
  12857. function _throws(shouldThrow, block, expected, message) {
  12858. var actual;
  12859. if (typeof block !== 'function') {
  12860. throw new TypeError('"block" argument must be a function');
  12861. }
  12862. if (typeof expected === 'string') {
  12863. message = expected;
  12864. expected = null;
  12865. }
  12866. actual = _tryBlock(block);
  12867. message = (expected && expected.name ? ' (' + expected.name + ').' : '.') +
  12868. (message ? ' ' + message : '.');
  12869. if (shouldThrow && !actual) {
  12870. fail(actual, expected, 'Missing expected exception' + message);
  12871. }
  12872. var userProvidedMessage = typeof message === 'string';
  12873. var isUnwantedException = !shouldThrow && util.isError(actual);
  12874. var isUnexpectedException = !shouldThrow && actual && !expected;
  12875. if ((isUnwantedException &&
  12876. userProvidedMessage &&
  12877. expectedException(actual, expected)) ||
  12878. isUnexpectedException) {
  12879. fail(actual, expected, 'Got unwanted exception' + message);
  12880. }
  12881. if ((shouldThrow && actual && expected &&
  12882. !expectedException(actual, expected)) || (!shouldThrow && actual)) {
  12883. throw actual;
  12884. }
  12885. }
  12886. // 11. Expected to throw an error:
  12887. // assert.throws(block, Error_opt, message_opt);
  12888. assert.throws = function(block, /*optional*/error, /*optional*/message) {
  12889. _throws(true, block, error, message);
  12890. };
  12891. // EXTENSION! This is annoying to write outside this module.
  12892. assert.doesNotThrow = function(block, /*optional*/error, /*optional*/message) {
  12893. _throws(false, block, error, message);
  12894. };
  12895. assert.ifError = function(err) { if (err) throw err; };
  12896. // Expose a strict only variant of assert
  12897. function strict(value, message) {
  12898. if (!value) fail(value, true, message, '==', strict);
  12899. }
  12900. assert.strict = objectAssign(strict, assert, {
  12901. equal: assert.strictEqual,
  12902. deepEqual: assert.deepStrictEqual,
  12903. notEqual: assert.notStrictEqual,
  12904. notDeepEqual: assert.notDeepStrictEqual
  12905. });
  12906. assert.strict.strict = assert.strict;
  12907. var objectKeys = Object.keys || function (obj) {
  12908. var keys = [];
  12909. for (var key in obj) {
  12910. if (hasOwn.call(obj, key)) keys.push(key);
  12911. }
  12912. return keys;
  12913. };
  12914. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(22)))
  12915. /***/ }),
  12916. /* 172 */
  12917. /***/ (function(module, exports, __webpack_require__) {
  12918. "use strict";
  12919. // Note: adler32 takes 12% for level 0 and 2% for level 6.
  12920. // It isn't worth it to make additional optimizations as in original.
  12921. // Small size is preferable.
  12922. // (C) 1995-2013 Jean-loup Gailly and Mark Adler
  12923. // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
  12924. //
  12925. // This software is provided 'as-is', without any express or implied
  12926. // warranty. In no event will the authors be held liable for any damages
  12927. // arising from the use of this software.
  12928. //
  12929. // Permission is granted to anyone to use this software for any purpose,
  12930. // including commercial applications, and to alter it and redistribute it
  12931. // freely, subject to the following restrictions:
  12932. //
  12933. // 1. The origin of this software must not be misrepresented; you must not
  12934. // claim that you wrote the original software. If you use this software
  12935. // in a product, an acknowledgment in the product documentation would be
  12936. // appreciated but is not required.
  12937. // 2. Altered source versions must be plainly marked as such, and must not be
  12938. // misrepresented as being the original software.
  12939. // 3. This notice may not be removed or altered from any source distribution.
  12940. function adler32(adler, buf, len, pos) {
  12941. var s1 = (adler & 0xffff) |0,
  12942. s2 = ((adler >>> 16) & 0xffff) |0,
  12943. n = 0;
  12944. while (len !== 0) {
  12945. // Set limit ~ twice less than 5552, to keep
  12946. // s2 in 31-bits, because we force signed ints.
  12947. // in other case %= will fail.
  12948. n = len > 2000 ? 2000 : len;
  12949. len -= n;
  12950. do {
  12951. s1 = (s1 + buf[pos++]) |0;
  12952. s2 = (s2 + s1) |0;
  12953. } while (--n);
  12954. s1 %= 65521;
  12955. s2 %= 65521;
  12956. }
  12957. return (s1 | (s2 << 16)) |0;
  12958. }
  12959. module.exports = adler32;
  12960. /***/ }),
  12961. /* 173 */
  12962. /***/ (function(module, exports, __webpack_require__) {
  12963. "use strict";
  12964. // Note: we can't get significant speed boost here.
  12965. // So write code to minimize size - no pregenerated tables
  12966. // and array tools dependencies.
  12967. // (C) 1995-2013 Jean-loup Gailly and Mark Adler
  12968. // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
  12969. //
  12970. // This software is provided 'as-is', without any express or implied
  12971. // warranty. In no event will the authors be held liable for any damages
  12972. // arising from the use of this software.
  12973. //
  12974. // Permission is granted to anyone to use this software for any purpose,
  12975. // including commercial applications, and to alter it and redistribute it
  12976. // freely, subject to the following restrictions:
  12977. //
  12978. // 1. The origin of this software must not be misrepresented; you must not
  12979. // claim that you wrote the original software. If you use this software
  12980. // in a product, an acknowledgment in the product documentation would be
  12981. // appreciated but is not required.
  12982. // 2. Altered source versions must be plainly marked as such, and must not be
  12983. // misrepresented as being the original software.
  12984. // 3. This notice may not be removed or altered from any source distribution.
  12985. // Use ordinary array, since untyped makes no boost here
  12986. function makeTable() {
  12987. var c, table = [];
  12988. for (var n = 0; n < 256; n++) {
  12989. c = n;
  12990. for (var k = 0; k < 8; k++) {
  12991. c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));
  12992. }
  12993. table[n] = c;
  12994. }
  12995. return table;
  12996. }
  12997. // Create table on load. Just 255 signed longs. Not a problem.
  12998. var crcTable = makeTable();
  12999. function crc32(crc, buf, len, pos) {
  13000. var t = crcTable,
  13001. end = pos + len;
  13002. crc ^= -1;
  13003. for (var i = pos; i < end; i++) {
  13004. crc = (crc >>> 8) ^ t[(crc ^ buf[i]) & 0xFF];
  13005. }
  13006. return (crc ^ (-1)); // >>> 0;
  13007. }
  13008. module.exports = crc32;
  13009. /***/ }),
  13010. /* 174 */
  13011. /***/ (function(module, exports, __webpack_require__) {
  13012. ;(function (root, factory) {
  13013. if (true) {
  13014. // CommonJS
  13015. module.exports = exports = factory(__webpack_require__(1));
  13016. }
  13017. else {}
  13018. }(this, function (CryptoJS) {
  13019. (function (Math) {
  13020. // Shortcuts
  13021. var C = CryptoJS;
  13022. var C_lib = C.lib;
  13023. var WordArray = C_lib.WordArray;
  13024. var Hasher = C_lib.Hasher;
  13025. var C_algo = C.algo;
  13026. // Initialization and round constants tables
  13027. var H = [];
  13028. var K = [];
  13029. // Compute constants
  13030. (function () {
  13031. function isPrime(n) {
  13032. var sqrtN = Math.sqrt(n);
  13033. for (var factor = 2; factor <= sqrtN; factor++) {
  13034. if (!(n % factor)) {
  13035. return false;
  13036. }
  13037. }
  13038. return true;
  13039. }
  13040. function getFractionalBits(n) {
  13041. return ((n - (n | 0)) * 0x100000000) | 0;
  13042. }
  13043. var n = 2;
  13044. var nPrime = 0;
  13045. while (nPrime < 64) {
  13046. if (isPrime(n)) {
  13047. if (nPrime < 8) {
  13048. H[nPrime] = getFractionalBits(Math.pow(n, 1 / 2));
  13049. }
  13050. K[nPrime] = getFractionalBits(Math.pow(n, 1 / 3));
  13051. nPrime++;
  13052. }
  13053. n++;
  13054. }
  13055. }());
  13056. // Reusable object
  13057. var W = [];
  13058. /**
  13059. * SHA-256 hash algorithm.
  13060. */
  13061. var SHA256 = C_algo.SHA256 = Hasher.extend({
  13062. _doReset: function () {
  13063. this._hash = new WordArray.init(H.slice(0));
  13064. },
  13065. _doProcessBlock: function (M, offset) {
  13066. // Shortcut
  13067. var H = this._hash.words;
  13068. // Working variables
  13069. var a = H[0];
  13070. var b = H[1];
  13071. var c = H[2];
  13072. var d = H[3];
  13073. var e = H[4];
  13074. var f = H[5];
  13075. var g = H[6];
  13076. var h = H[7];
  13077. // Computation
  13078. for (var i = 0; i < 64; i++) {
  13079. if (i < 16) {
  13080. W[i] = M[offset + i] | 0;
  13081. } else {
  13082. var gamma0x = W[i - 15];
  13083. var gamma0 = ((gamma0x << 25) | (gamma0x >>> 7)) ^
  13084. ((gamma0x << 14) | (gamma0x >>> 18)) ^
  13085. (gamma0x >>> 3);
  13086. var gamma1x = W[i - 2];
  13087. var gamma1 = ((gamma1x << 15) | (gamma1x >>> 17)) ^
  13088. ((gamma1x << 13) | (gamma1x >>> 19)) ^
  13089. (gamma1x >>> 10);
  13090. W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16];
  13091. }
  13092. var ch = (e & f) ^ (~e & g);
  13093. var maj = (a & b) ^ (a & c) ^ (b & c);
  13094. var sigma0 = ((a << 30) | (a >>> 2)) ^ ((a << 19) | (a >>> 13)) ^ ((a << 10) | (a >>> 22));
  13095. var sigma1 = ((e << 26) | (e >>> 6)) ^ ((e << 21) | (e >>> 11)) ^ ((e << 7) | (e >>> 25));
  13096. var t1 = h + sigma1 + ch + K[i] + W[i];
  13097. var t2 = sigma0 + maj;
  13098. h = g;
  13099. g = f;
  13100. f = e;
  13101. e = (d + t1) | 0;
  13102. d = c;
  13103. c = b;
  13104. b = a;
  13105. a = (t1 + t2) | 0;
  13106. }
  13107. // Intermediate hash value
  13108. H[0] = (H[0] + a) | 0;
  13109. H[1] = (H[1] + b) | 0;
  13110. H[2] = (H[2] + c) | 0;
  13111. H[3] = (H[3] + d) | 0;
  13112. H[4] = (H[4] + e) | 0;
  13113. H[5] = (H[5] + f) | 0;
  13114. H[6] = (H[6] + g) | 0;
  13115. H[7] = (H[7] + h) | 0;
  13116. },
  13117. _doFinalize: function () {
  13118. // Shortcuts
  13119. var data = this._data;
  13120. var dataWords = data.words;
  13121. var nBitsTotal = this._nDataBytes * 8;
  13122. var nBitsLeft = data.sigBytes * 8;
  13123. // Add padding
  13124. dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);
  13125. dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000);
  13126. dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal;
  13127. data.sigBytes = dataWords.length * 4;
  13128. // Hash final blocks
  13129. this._process();
  13130. // Return final computed hash
  13131. return this._hash;
  13132. },
  13133. clone: function () {
  13134. var clone = Hasher.clone.call(this);
  13135. clone._hash = this._hash.clone();
  13136. return clone;
  13137. }
  13138. });
  13139. /**
  13140. * Shortcut function to the hasher's object interface.
  13141. *
  13142. * @param {WordArray|string} message The message to hash.
  13143. *
  13144. * @return {WordArray} The hash.
  13145. *
  13146. * @static
  13147. *
  13148. * @example
  13149. *
  13150. * var hash = CryptoJS.SHA256('message');
  13151. * var hash = CryptoJS.SHA256(wordArray);
  13152. */
  13153. C.SHA256 = Hasher._createHelper(SHA256);
  13154. /**
  13155. * Shortcut function to the HMAC's object interface.
  13156. *
  13157. * @param {WordArray|string} message The message to hash.
  13158. * @param {WordArray|string} key The secret key.
  13159. *
  13160. * @return {WordArray} The HMAC.
  13161. *
  13162. * @static
  13163. *
  13164. * @example
  13165. *
  13166. * var hmac = CryptoJS.HmacSHA256(message, key);
  13167. */
  13168. C.HmacSHA256 = Hasher._createHmacHelper(SHA256);
  13169. }(Math));
  13170. return CryptoJS.SHA256;
  13171. }));
  13172. /***/ }),
  13173. /* 175 */
  13174. /***/ (function(module, exports, __webpack_require__) {
  13175. ;(function (root, factory, undef) {
  13176. if (true) {
  13177. // CommonJS
  13178. module.exports = exports = factory(__webpack_require__(1), __webpack_require__(72));
  13179. }
  13180. else {}
  13181. }(this, function (CryptoJS) {
  13182. (function () {
  13183. // Shortcuts
  13184. var C = CryptoJS;
  13185. var C_lib = C.lib;
  13186. var Hasher = C_lib.Hasher;
  13187. var C_x64 = C.x64;
  13188. var X64Word = C_x64.Word;
  13189. var X64WordArray = C_x64.WordArray;
  13190. var C_algo = C.algo;
  13191. function X64Word_create() {
  13192. return X64Word.create.apply(X64Word, arguments);
  13193. }
  13194. // Constants
  13195. var K = [
  13196. X64Word_create(0x428a2f98, 0xd728ae22), X64Word_create(0x71374491, 0x23ef65cd),
  13197. X64Word_create(0xb5c0fbcf, 0xec4d3b2f), X64Word_create(0xe9b5dba5, 0x8189dbbc),
  13198. X64Word_create(0x3956c25b, 0xf348b538), X64Word_create(0x59f111f1, 0xb605d019),
  13199. X64Word_create(0x923f82a4, 0xaf194f9b), X64Word_create(0xab1c5ed5, 0xda6d8118),
  13200. X64Word_create(0xd807aa98, 0xa3030242), X64Word_create(0x12835b01, 0x45706fbe),
  13201. X64Word_create(0x243185be, 0x4ee4b28c), X64Word_create(0x550c7dc3, 0xd5ffb4e2),
  13202. X64Word_create(0x72be5d74, 0xf27b896f), X64Word_create(0x80deb1fe, 0x3b1696b1),
  13203. X64Word_create(0x9bdc06a7, 0x25c71235), X64Word_create(0xc19bf174, 0xcf692694),
  13204. X64Word_create(0xe49b69c1, 0x9ef14ad2), X64Word_create(0xefbe4786, 0x384f25e3),
  13205. X64Word_create(0x0fc19dc6, 0x8b8cd5b5), X64Word_create(0x240ca1cc, 0x77ac9c65),
  13206. X64Word_create(0x2de92c6f, 0x592b0275), X64Word_create(0x4a7484aa, 0x6ea6e483),
  13207. X64Word_create(0x5cb0a9dc, 0xbd41fbd4), X64Word_create(0x76f988da, 0x831153b5),
  13208. X64Word_create(0x983e5152, 0xee66dfab), X64Word_create(0xa831c66d, 0x2db43210),
  13209. X64Word_create(0xb00327c8, 0x98fb213f), X64Word_create(0xbf597fc7, 0xbeef0ee4),
  13210. X64Word_create(0xc6e00bf3, 0x3da88fc2), X64Word_create(0xd5a79147, 0x930aa725),
  13211. X64Word_create(0x06ca6351, 0xe003826f), X64Word_create(0x14292967, 0x0a0e6e70),
  13212. X64Word_create(0x27b70a85, 0x46d22ffc), X64Word_create(0x2e1b2138, 0x5c26c926),
  13213. X64Word_create(0x4d2c6dfc, 0x5ac42aed), X64Word_create(0x53380d13, 0x9d95b3df),
  13214. X64Word_create(0x650a7354, 0x8baf63de), X64Word_create(0x766a0abb, 0x3c77b2a8),
  13215. X64Word_create(0x81c2c92e, 0x47edaee6), X64Word_create(0x92722c85, 0x1482353b),
  13216. X64Word_create(0xa2bfe8a1, 0x4cf10364), X64Word_create(0xa81a664b, 0xbc423001),
  13217. X64Word_create(0xc24b8b70, 0xd0f89791), X64Word_create(0xc76c51a3, 0x0654be30),
  13218. X64Word_create(0xd192e819, 0xd6ef5218), X64Word_create(0xd6990624, 0x5565a910),
  13219. X64Word_create(0xf40e3585, 0x5771202a), X64Word_create(0x106aa070, 0x32bbd1b8),
  13220. X64Word_create(0x19a4c116, 0xb8d2d0c8), X64Word_create(0x1e376c08, 0x5141ab53),
  13221. X64Word_create(0x2748774c, 0xdf8eeb99), X64Word_create(0x34b0bcb5, 0xe19b48a8),
  13222. X64Word_create(0x391c0cb3, 0xc5c95a63), X64Word_create(0x4ed8aa4a, 0xe3418acb),
  13223. X64Word_create(0x5b9cca4f, 0x7763e373), X64Word_create(0x682e6ff3, 0xd6b2b8a3),
  13224. X64Word_create(0x748f82ee, 0x5defb2fc), X64Word_create(0x78a5636f, 0x43172f60),
  13225. X64Word_create(0x84c87814, 0xa1f0ab72), X64Word_create(0x8cc70208, 0x1a6439ec),
  13226. X64Word_create(0x90befffa, 0x23631e28), X64Word_create(0xa4506ceb, 0xde82bde9),
  13227. X64Word_create(0xbef9a3f7, 0xb2c67915), X64Word_create(0xc67178f2, 0xe372532b),
  13228. X64Word_create(0xca273ece, 0xea26619c), X64Word_create(0xd186b8c7, 0x21c0c207),
  13229. X64Word_create(0xeada7dd6, 0xcde0eb1e), X64Word_create(0xf57d4f7f, 0xee6ed178),
  13230. X64Word_create(0x06f067aa, 0x72176fba), X64Word_create(0x0a637dc5, 0xa2c898a6),
  13231. X64Word_create(0x113f9804, 0xbef90dae), X64Word_create(0x1b710b35, 0x131c471b),
  13232. X64Word_create(0x28db77f5, 0x23047d84), X64Word_create(0x32caab7b, 0x40c72493),
  13233. X64Word_create(0x3c9ebe0a, 0x15c9bebc), X64Word_create(0x431d67c4, 0x9c100d4c),
  13234. X64Word_create(0x4cc5d4be, 0xcb3e42b6), X64Word_create(0x597f299c, 0xfc657e2a),
  13235. X64Word_create(0x5fcb6fab, 0x3ad6faec), X64Word_create(0x6c44198c, 0x4a475817)
  13236. ];
  13237. // Reusable objects
  13238. var W = [];
  13239. (function () {
  13240. for (var i = 0; i < 80; i++) {
  13241. W[i] = X64Word_create();
  13242. }
  13243. }());
  13244. /**
  13245. * SHA-512 hash algorithm.
  13246. */
  13247. var SHA512 = C_algo.SHA512 = Hasher.extend({
  13248. _doReset: function () {
  13249. this._hash = new X64WordArray.init([
  13250. new X64Word.init(0x6a09e667, 0xf3bcc908), new X64Word.init(0xbb67ae85, 0x84caa73b),
  13251. new X64Word.init(0x3c6ef372, 0xfe94f82b), new X64Word.init(0xa54ff53a, 0x5f1d36f1),
  13252. new X64Word.init(0x510e527f, 0xade682d1), new X64Word.init(0x9b05688c, 0x2b3e6c1f),
  13253. new X64Word.init(0x1f83d9ab, 0xfb41bd6b), new X64Word.init(0x5be0cd19, 0x137e2179)
  13254. ]);
  13255. },
  13256. _doProcessBlock: function (M, offset) {
  13257. // Shortcuts
  13258. var H = this._hash.words;
  13259. var H0 = H[0];
  13260. var H1 = H[1];
  13261. var H2 = H[2];
  13262. var H3 = H[3];
  13263. var H4 = H[4];
  13264. var H5 = H[5];
  13265. var H6 = H[6];
  13266. var H7 = H[7];
  13267. var H0h = H0.high;
  13268. var H0l = H0.low;
  13269. var H1h = H1.high;
  13270. var H1l = H1.low;
  13271. var H2h = H2.high;
  13272. var H2l = H2.low;
  13273. var H3h = H3.high;
  13274. var H3l = H3.low;
  13275. var H4h = H4.high;
  13276. var H4l = H4.low;
  13277. var H5h = H5.high;
  13278. var H5l = H5.low;
  13279. var H6h = H6.high;
  13280. var H6l = H6.low;
  13281. var H7h = H7.high;
  13282. var H7l = H7.low;
  13283. // Working variables
  13284. var ah = H0h;
  13285. var al = H0l;
  13286. var bh = H1h;
  13287. var bl = H1l;
  13288. var ch = H2h;
  13289. var cl = H2l;
  13290. var dh = H3h;
  13291. var dl = H3l;
  13292. var eh = H4h;
  13293. var el = H4l;
  13294. var fh = H5h;
  13295. var fl = H5l;
  13296. var gh = H6h;
  13297. var gl = H6l;
  13298. var hh = H7h;
  13299. var hl = H7l;
  13300. // Rounds
  13301. for (var i = 0; i < 80; i++) {
  13302. // Shortcut
  13303. var Wi = W[i];
  13304. // Extend message
  13305. if (i < 16) {
  13306. var Wih = Wi.high = M[offset + i * 2] | 0;
  13307. var Wil = Wi.low = M[offset + i * 2 + 1] | 0;
  13308. } else {
  13309. // Gamma0
  13310. var gamma0x = W[i - 15];
  13311. var gamma0xh = gamma0x.high;
  13312. var gamma0xl = gamma0x.low;
  13313. var gamma0h = ((gamma0xh >>> 1) | (gamma0xl << 31)) ^ ((gamma0xh >>> 8) | (gamma0xl << 24)) ^ (gamma0xh >>> 7);
  13314. var gamma0l = ((gamma0xl >>> 1) | (gamma0xh << 31)) ^ ((gamma0xl >>> 8) | (gamma0xh << 24)) ^ ((gamma0xl >>> 7) | (gamma0xh << 25));
  13315. // Gamma1
  13316. var gamma1x = W[i - 2];
  13317. var gamma1xh = gamma1x.high;
  13318. var gamma1xl = gamma1x.low;
  13319. var gamma1h = ((gamma1xh >>> 19) | (gamma1xl << 13)) ^ ((gamma1xh << 3) | (gamma1xl >>> 29)) ^ (gamma1xh >>> 6);
  13320. var gamma1l = ((gamma1xl >>> 19) | (gamma1xh << 13)) ^ ((gamma1xl << 3) | (gamma1xh >>> 29)) ^ ((gamma1xl >>> 6) | (gamma1xh << 26));
  13321. // W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16]
  13322. var Wi7 = W[i - 7];
  13323. var Wi7h = Wi7.high;
  13324. var Wi7l = Wi7.low;
  13325. var Wi16 = W[i - 16];
  13326. var Wi16h = Wi16.high;
  13327. var Wi16l = Wi16.low;
  13328. var Wil = gamma0l + Wi7l;
  13329. var Wih = gamma0h + Wi7h + ((Wil >>> 0) < (gamma0l >>> 0) ? 1 : 0);
  13330. var Wil = Wil + gamma1l;
  13331. var Wih = Wih + gamma1h + ((Wil >>> 0) < (gamma1l >>> 0) ? 1 : 0);
  13332. var Wil = Wil + Wi16l;
  13333. var Wih = Wih + Wi16h + ((Wil >>> 0) < (Wi16l >>> 0) ? 1 : 0);
  13334. Wi.high = Wih;
  13335. Wi.low = Wil;
  13336. }
  13337. var chh = (eh & fh) ^ (~eh & gh);
  13338. var chl = (el & fl) ^ (~el & gl);
  13339. var majh = (ah & bh) ^ (ah & ch) ^ (bh & ch);
  13340. var majl = (al & bl) ^ (al & cl) ^ (bl & cl);
  13341. var sigma0h = ((ah >>> 28) | (al << 4)) ^ ((ah << 30) | (al >>> 2)) ^ ((ah << 25) | (al >>> 7));
  13342. var sigma0l = ((al >>> 28) | (ah << 4)) ^ ((al << 30) | (ah >>> 2)) ^ ((al << 25) | (ah >>> 7));
  13343. var sigma1h = ((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9));
  13344. var sigma1l = ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9));
  13345. // t1 = h + sigma1 + ch + K[i] + W[i]
  13346. var Ki = K[i];
  13347. var Kih = Ki.high;
  13348. var Kil = Ki.low;
  13349. var t1l = hl + sigma1l;
  13350. var t1h = hh + sigma1h + ((t1l >>> 0) < (hl >>> 0) ? 1 : 0);
  13351. var t1l = t1l + chl;
  13352. var t1h = t1h + chh + ((t1l >>> 0) < (chl >>> 0) ? 1 : 0);
  13353. var t1l = t1l + Kil;
  13354. var t1h = t1h + Kih + ((t1l >>> 0) < (Kil >>> 0) ? 1 : 0);
  13355. var t1l = t1l + Wil;
  13356. var t1h = t1h + Wih + ((t1l >>> 0) < (Wil >>> 0) ? 1 : 0);
  13357. // t2 = sigma0 + maj
  13358. var t2l = sigma0l + majl;
  13359. var t2h = sigma0h + majh + ((t2l >>> 0) < (sigma0l >>> 0) ? 1 : 0);
  13360. // Update working variables
  13361. hh = gh;
  13362. hl = gl;
  13363. gh = fh;
  13364. gl = fl;
  13365. fh = eh;
  13366. fl = el;
  13367. el = (dl + t1l) | 0;
  13368. eh = (dh + t1h + ((el >>> 0) < (dl >>> 0) ? 1 : 0)) | 0;
  13369. dh = ch;
  13370. dl = cl;
  13371. ch = bh;
  13372. cl = bl;
  13373. bh = ah;
  13374. bl = al;
  13375. al = (t1l + t2l) | 0;
  13376. ah = (t1h + t2h + ((al >>> 0) < (t1l >>> 0) ? 1 : 0)) | 0;
  13377. }
  13378. // Intermediate hash value
  13379. H0l = H0.low = (H0l + al);
  13380. H0.high = (H0h + ah + ((H0l >>> 0) < (al >>> 0) ? 1 : 0));
  13381. H1l = H1.low = (H1l + bl);
  13382. H1.high = (H1h + bh + ((H1l >>> 0) < (bl >>> 0) ? 1 : 0));
  13383. H2l = H2.low = (H2l + cl);
  13384. H2.high = (H2h + ch + ((H2l >>> 0) < (cl >>> 0) ? 1 : 0));
  13385. H3l = H3.low = (H3l + dl);
  13386. H3.high = (H3h + dh + ((H3l >>> 0) < (dl >>> 0) ? 1 : 0));
  13387. H4l = H4.low = (H4l + el);
  13388. H4.high = (H4h + eh + ((H4l >>> 0) < (el >>> 0) ? 1 : 0));
  13389. H5l = H5.low = (H5l + fl);
  13390. H5.high = (H5h + fh + ((H5l >>> 0) < (fl >>> 0) ? 1 : 0));
  13391. H6l = H6.low = (H6l + gl);
  13392. H6.high = (H6h + gh + ((H6l >>> 0) < (gl >>> 0) ? 1 : 0));
  13393. H7l = H7.low = (H7l + hl);
  13394. H7.high = (H7h + hh + ((H7l >>> 0) < (hl >>> 0) ? 1 : 0));
  13395. },
  13396. _doFinalize: function () {
  13397. // Shortcuts
  13398. var data = this._data;
  13399. var dataWords = data.words;
  13400. var nBitsTotal = this._nDataBytes * 8;
  13401. var nBitsLeft = data.sigBytes * 8;
  13402. // Add padding
  13403. dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);
  13404. dataWords[(((nBitsLeft + 128) >>> 10) << 5) + 30] = Math.floor(nBitsTotal / 0x100000000);
  13405. dataWords[(((nBitsLeft + 128) >>> 10) << 5) + 31] = nBitsTotal;
  13406. data.sigBytes = dataWords.length * 4;
  13407. // Hash final blocks
  13408. this._process();
  13409. // Convert hash to 32-bit word array before returning
  13410. var hash = this._hash.toX32();
  13411. // Return final computed hash
  13412. return hash;
  13413. },
  13414. clone: function () {
  13415. var clone = Hasher.clone.call(this);
  13416. clone._hash = this._hash.clone();
  13417. return clone;
  13418. },
  13419. blockSize: 1024/32
  13420. });
  13421. /**
  13422. * Shortcut function to the hasher's object interface.
  13423. *
  13424. * @param {WordArray|string} message The message to hash.
  13425. *
  13426. * @return {WordArray} The hash.
  13427. *
  13428. * @static
  13429. *
  13430. * @example
  13431. *
  13432. * var hash = CryptoJS.SHA512('message');
  13433. * var hash = CryptoJS.SHA512(wordArray);
  13434. */
  13435. C.SHA512 = Hasher._createHelper(SHA512);
  13436. /**
  13437. * Shortcut function to the HMAC's object interface.
  13438. *
  13439. * @param {WordArray|string} message The message to hash.
  13440. * @param {WordArray|string} key The secret key.
  13441. *
  13442. * @return {WordArray} The HMAC.
  13443. *
  13444. * @static
  13445. *
  13446. * @example
  13447. *
  13448. * var hmac = CryptoJS.HmacSHA512(message, key);
  13449. */
  13450. C.HmacSHA512 = Hasher._createHmacHelper(SHA512);
  13451. }());
  13452. return CryptoJS.SHA512;
  13453. }));
  13454. /***/ }),
  13455. /* 176 */
  13456. /***/ (function(module) {
  13457. module.exports = JSON.parse("[[\"a140\",\"\",62],[\"a180\",\"\",32],[\"a240\",\"\",62],[\"a280\",\"\",32],[\"a2ab\",\"\",5],[\"a2e3\",\"€\"],[\"a2ef\",\"\"],[\"a2fd\",\"\"],[\"a340\",\"\",62],[\"a380\",\"\",31,\" \"],[\"a440\",\"\",62],[\"a480\",\"\",32],[\"a4f4\",\"\",10],[\"a540\",\"\",62],[\"a580\",\"\",32],[\"a5f7\",\"\",7],[\"a640\",\"\",62],[\"a680\",\"\",32],[\"a6b9\",\"\",7],[\"a6d9\",\"\",6],[\"a6ec\",\"\"],[\"a6f3\",\"\"],[\"a6f6\",\"\",8],[\"a740\",\"\",62],[\"a780\",\"\",32],[\"a7c2\",\"\",14],[\"a7f2\",\"\",12],[\"a896\",\"\",10],[\"a8bc\",\"\"],[\"a8bf\",\"ǹ\"],[\"a8c1\",\"\"],[\"a8ea\",\"\",20],[\"a958\",\"\"],[\"a95b\",\"\"],[\"a95d\",\"\"],[\"a989\",\"〾⿰\",11],[\"a997\",\"\",12],[\"a9f0\",\"\",14],[\"aaa1\",\"\",93],[\"aba1\",\"\",93],[\"aca1\",\"\",93],[\"ada1\",\"\",93],[\"aea1\",\"\",93],[\"afa1\",\"\",93],[\"d7fa\",\"\",4],[\"f8a1\",\"\",93],[\"f9a1\",\"\",93],[\"faa1\",\"\",93],[\"fba1\",\"\",93],[\"fca1\",\"\",93],[\"fda1\",\"\",93],[\"fe50\",\"⺁⺄㑳㑇⺈⺋㖞㘚㘎⺌⺗㥮㤘㧏㧟㩳㧐㭎㱮㳠⺧⺪䁖䅟⺮䌷⺳⺶⺷䎱䎬⺻䏝䓖䙡䙌\"],[\"fe80\",\"䜣䜩䝼䞍⻊䥇䥺䥽䦂䦃䦅䦆䦟䦛䦷䦶䲣䲟䲠䲡䱷䲢䴓\",6,\"䶮\",93]]");
  13458. /***/ }),
  13459. /* 177 */
  13460. /***/ (function(module) {
  13461. module.exports = JSON.parse("[[\"0\",\"\\u0000\",127],[\"a140\",\" ,、。.‧;:?!︰…‥﹐﹑﹒·﹔﹕﹖﹗|–︱—︳╴︴﹏()︵︶{}︷︸〔〕︹︺【】︻︼《》︽︾〈〉︿﹀「」﹁﹂『』﹃﹄﹙﹚\"],[\"a1a1\",\"﹛﹜﹝﹞‘’“”〝〞‵′#&*※§〃○●△▲◎☆★◇◆□■▽▼㊣℅¯ ̄_ˍ﹉﹊﹍﹎﹋﹌﹟﹠﹡+-×÷±√<>=≦≧≠∞≒≡﹢\",4,\"~∩∪⊥∠∟⊿㏒㏑∫∮∵∴♀♂⊕⊙↑↓←→↖↗↙↘∥∣/\"],[\"a240\",\"\∕﹨$¥〒¢£%@℃℉﹩﹪﹫㏕㎜㎝㎞㏎㎡㎎㎏㏄°兙兛兞兝兡兣嗧瓩糎▁\",7,\"▏▎▍▌▋▊▉┼┴┬┤├▔─│▕┌┐└┘╭\"],[\"a2a1\",\"╮╰╯═╞╪╡◢◣◥◤╱╲╳0\",9,\"Ⅰ\",9,\"〡\",8,\"十卄卅A\",25,\"a\",21],[\"a340\",\"wxyzΑ\",16,\"Σ\",6,\"α\",16,\"σ\",6,\"ㄅ\",10],[\"a3a1\",\"ㄐ\",25,\"˙ˉˊˇˋ\"],[\"a3e1\",\"€\"],[\"a440\",\"一乙丁七乃九了二人儿入八几刀刁力匕十卜又三下丈上丫丸凡久么也乞于亡兀刃勺千叉口土士夕大女子孑孓寸小尢尸山川工己已巳巾干廾弋弓才\"],[\"a4a1\",\"丑丐不中丰丹之尹予云井互五亢仁什仃仆仇仍今介仄元允內六兮公冗凶分切刈勻勾勿化匹午升卅卞厄友及反壬天夫太夭孔少尤尺屯巴幻廿弔引心戈戶手扎支文斗斤方日曰月木欠止歹毋比毛氏水火爪父爻片牙牛犬王丙\"],[\"a540\",\"世丕且丘主乍乏乎以付仔仕他仗代令仙仞充兄冉冊冬凹出凸刊加功包匆北匝仟半卉卡占卯卮去可古右召叮叩叨叼司叵叫另只史叱台句叭叻四囚外\"],[\"a5a1\",\"央失奴奶孕它尼巨巧左市布平幼弁弘弗必戊打扔扒扑斥旦朮本未末札正母民氐永汁汀氾犯玄玉瓜瓦甘生用甩田由甲申疋白皮皿目矛矢石示禾穴立丞丟乒乓乩亙交亦亥仿伉伙伊伕伍伐休伏仲件任仰仳份企伋光兇兆先全\"],[\"a640\",\"共再冰列刑划刎刖劣匈匡匠印危吉吏同吊吐吁吋各向名合吃后吆吒因回囝圳地在圭圬圯圩夙多夷夸妄奸妃好她如妁字存宇守宅安寺尖屹州帆并年\"],[\"a6a1\",\"式弛忙忖戎戌戍成扣扛托收早旨旬旭曲曳有朽朴朱朵次此死氖汝汗汙江池汐汕污汛汍汎灰牟牝百竹米糸缶羊羽老考而耒耳聿肉肋肌臣自至臼舌舛舟艮色艾虫血行衣西阡串亨位住佇佗佞伴佛何估佐佑伽伺伸佃佔似但佣\"],[\"a740\",\"作你伯低伶余佝佈佚兌克免兵冶冷別判利刪刨劫助努劬匣即卵吝吭吞吾否呎吧呆呃吳呈呂君吩告吹吻吸吮吵吶吠吼呀吱含吟听囪困囤囫坊坑址坍\"],[\"a7a1\",\"均坎圾坐坏圻壯夾妝妒妨妞妣妙妖妍妤妓妊妥孝孜孚孛完宋宏尬局屁尿尾岐岑岔岌巫希序庇床廷弄弟彤形彷役忘忌志忍忱快忸忪戒我抄抗抖技扶抉扭把扼找批扳抒扯折扮投抓抑抆改攻攸旱更束李杏材村杜杖杞杉杆杠\"],[\"a840\",\"杓杗步每求汞沙沁沈沉沅沛汪決沐汰沌汨沖沒汽沃汲汾汴沆汶沍沔沘沂灶灼災灸牢牡牠狄狂玖甬甫男甸皂盯矣私秀禿究系罕肖肓肝肘肛肚育良芒\"],[\"a8a1\",\"芋芍見角言谷豆豕貝赤走足身車辛辰迂迆迅迄巡邑邢邪邦那酉釆里防阮阱阪阬並乖乳事些亞享京佯依侍佳使佬供例來侃佰併侈佩佻侖佾侏侑佺兔兒兕兩具其典冽函刻券刷刺到刮制剁劾劻卒協卓卑卦卷卸卹取叔受味呵\"],[\"a940\",\"咖呸咕咀呻呷咄咒咆呼咐呱呶和咚呢周咋命咎固垃坷坪坩坡坦坤坼夜奉奇奈奄奔妾妻委妹妮姑姆姐姍始姓姊妯妳姒姅孟孤季宗定官宜宙宛尚屈居\"],[\"a9a1\",\"屆岷岡岸岩岫岱岳帘帚帖帕帛帑幸庚店府底庖延弦弧弩往征彿彼忝忠忽念忿怏怔怯怵怖怪怕怡性怩怫怛或戕房戾所承拉拌拄抿拂抹拒招披拓拔拋拈抨抽押拐拙拇拍抵拚抱拘拖拗拆抬拎放斧於旺昔易昌昆昂明昀昏昕昊\"],[\"aa40\",\"昇服朋杭枋枕東果杳杷枇枝林杯杰板枉松析杵枚枓杼杪杲欣武歧歿氓氛泣注泳沱泌泥河沽沾沼波沫法泓沸泄油況沮泗泅泱沿治泡泛泊沬泯泜泖泠\"],[\"aaa1\",\"炕炎炒炊炙爬爭爸版牧物狀狎狙狗狐玩玨玟玫玥甽疝疙疚的盂盲直知矽社祀祁秉秈空穹竺糾罔羌羋者肺肥肢肱股肫肩肴肪肯臥臾舍芳芝芙芭芽芟芹花芬芥芯芸芣芰芾芷虎虱初表軋迎返近邵邸邱邶采金長門阜陀阿阻附\"],[\"ab40\",\"陂隹雨青非亟亭亮信侵侯便俠俑俏保促侶俘俟俊俗侮俐俄係俚俎俞侷兗冒冑冠剎剃削前剌剋則勇勉勃勁匍南卻厚叛咬哀咨哎哉咸咦咳哇哂咽咪品\"],[\"aba1\",\"哄哈咯咫咱咻咩咧咿囿垂型垠垣垢城垮垓奕契奏奎奐姜姘姿姣姨娃姥姪姚姦威姻孩宣宦室客宥封屎屏屍屋峙峒巷帝帥帟幽庠度建弈弭彥很待徊律徇後徉怒思怠急怎怨恍恰恨恢恆恃恬恫恪恤扁拜挖按拼拭持拮拽指拱拷\"],[\"ac40\",\"拯括拾拴挑挂政故斫施既春昭映昧是星昨昱昤曷柿染柱柔某柬架枯柵柩柯柄柑枴柚查枸柏柞柳枰柙柢柝柒歪殃殆段毒毗氟泉洋洲洪流津洌洱洞洗\"],[\"aca1\",\"活洽派洶洛泵洹洧洸洩洮洵洎洫炫為炳炬炯炭炸炮炤爰牲牯牴狩狠狡玷珊玻玲珍珀玳甚甭畏界畎畋疫疤疥疢疣癸皆皇皈盈盆盃盅省盹相眉看盾盼眇矜砂研砌砍祆祉祈祇禹禺科秒秋穿突竿竽籽紂紅紀紉紇約紆缸美羿耄\"],[\"ad40\",\"耐耍耑耶胖胥胚胃胄背胡胛胎胞胤胝致舢苧范茅苣苛苦茄若茂茉苒苗英茁苜苔苑苞苓苟苯茆虐虹虻虺衍衫要觔計訂訃貞負赴赳趴軍軌述迦迢迪迥\"],[\"ada1\",\"迭迫迤迨郊郎郁郃酋酊重閂限陋陌降面革韋韭音頁風飛食首香乘亳倌倍倣俯倦倥俸倩倖倆值借倚倒們俺倀倔倨俱倡個候倘俳修倭倪俾倫倉兼冤冥冢凍凌准凋剖剜剔剛剝匪卿原厝叟哨唐唁唷哼哥哲唆哺唔哩哭員唉哮哪\"],[\"ae40\",\"哦唧唇哽唏圃圄埂埔埋埃堉夏套奘奚娑娘娜娟娛娓姬娠娣娩娥娌娉孫屘宰害家宴宮宵容宸射屑展屐峭峽峻峪峨峰島崁峴差席師庫庭座弱徒徑徐恙\"],[\"aea1\",\"恣恥恐恕恭恩息悄悟悚悍悔悌悅悖扇拳挈拿捎挾振捕捂捆捏捉挺捐挽挪挫挨捍捌效敉料旁旅時晉晏晃晒晌晅晁書朔朕朗校核案框桓根桂桔栩梳栗桌桑栽柴桐桀格桃株桅栓栘桁殊殉殷氣氧氨氦氤泰浪涕消涇浦浸海浙涓\"],[\"af40\",\"浬涉浮浚浴浩涌涊浹涅浥涔烊烘烤烙烈烏爹特狼狹狽狸狷玆班琉珮珠珪珞畔畝畜畚留疾病症疲疳疽疼疹痂疸皋皰益盍盎眩真眠眨矩砰砧砸砝破砷\"],[\"afa1\",\"砥砭砠砟砲祕祐祠祟祖神祝祗祚秤秣秧租秦秩秘窄窈站笆笑粉紡紗紋紊素索純紐紕級紜納紙紛缺罟羔翅翁耆耘耕耙耗耽耿胱脂胰脅胭胴脆胸胳脈能脊胼胯臭臬舀舐航舫舨般芻茫荒荔荊茸荐草茵茴荏茲茹茶茗荀茱茨荃\"],[\"b040\",\"虔蚊蚪蚓蚤蚩蚌蚣蚜衰衷袁袂衽衹記訐討訌訕訊託訓訖訏訑豈豺豹財貢起躬軒軔軏辱送逆迷退迺迴逃追逅迸邕郡郝郢酒配酌釘針釗釜釙閃院陣陡\"],[\"b0a1\",\"陛陝除陘陞隻飢馬骨高鬥鬲鬼乾偺偽停假偃偌做偉健偶偎偕偵側偷偏倏偯偭兜冕凰剪副勒務勘動匐匏匙匿區匾參曼商啪啦啄啞啡啃啊唱啖問啕唯啤唸售啜唬啣唳啁啗圈國圉域堅堊堆埠埤基堂堵執培夠奢娶婁婉婦婪婀\"],[\"b140\",\"娼婢婚婆婊孰寇寅寄寂宿密尉專將屠屜屝崇崆崎崛崖崢崑崩崔崙崤崧崗巢常帶帳帷康庸庶庵庾張強彗彬彩彫得徙從徘御徠徜恿患悉悠您惋悴惦悽\"],[\"b1a1\",\"情悻悵惜悼惘惕惆惟悸惚惇戚戛扈掠控捲掖探接捷捧掘措捱掩掉掃掛捫推掄授掙採掬排掏掀捻捩捨捺敝敖救教敗啟敏敘敕敔斜斛斬族旋旌旎晝晚晤晨晦晞曹勗望梁梯梢梓梵桿桶梱梧梗械梃棄梭梆梅梔條梨梟梡梂欲殺\"],[\"b240\",\"毫毬氫涎涼淳淙液淡淌淤添淺清淇淋涯淑涮淞淹涸混淵淅淒渚涵淚淫淘淪深淮淨淆淄涪淬涿淦烹焉焊烽烯爽牽犁猜猛猖猓猙率琅琊球理現琍瓠瓶\"],[\"b2a1\",\"瓷甜產略畦畢異疏痔痕疵痊痍皎盔盒盛眷眾眼眶眸眺硫硃硎祥票祭移窒窕笠笨笛第符笙笞笮粒粗粕絆絃統紮紹紼絀細紳組累終紲紱缽羞羚翌翎習耜聊聆脯脖脣脫脩脰脤舂舵舷舶船莎莞莘荸莢莖莽莫莒莊莓莉莠荷荻荼\"],[\"b340\",\"莆莧處彪蛇蛀蚶蛄蚵蛆蛋蚱蚯蛉術袞袈被袒袖袍袋覓規訪訝訣訥許設訟訛訢豉豚販責貫貨貪貧赧赦趾趺軛軟這逍通逗連速逝逐逕逞造透逢逖逛途\"],[\"b3a1\",\"部郭都酗野釵釦釣釧釭釩閉陪陵陳陸陰陴陶陷陬雀雪雩章竟頂頃魚鳥鹵鹿麥麻傢傍傅備傑傀傖傘傚最凱割剴創剩勞勝勛博厥啻喀喧啼喊喝喘喂喜喪喔喇喋喃喳單喟唾喲喚喻喬喱啾喉喫喙圍堯堪場堤堰報堡堝堠壹壺奠\"],[\"b440\",\"婷媚婿媒媛媧孳孱寒富寓寐尊尋就嵌嵐崴嵇巽幅帽幀幃幾廊廁廂廄弼彭復循徨惑惡悲悶惠愜愣惺愕惰惻惴慨惱愎惶愉愀愒戟扉掣掌描揀揩揉揆揍\"],[\"b4a1\",\"插揣提握揖揭揮捶援揪換摒揚揹敞敦敢散斑斐斯普晰晴晶景暑智晾晷曾替期朝棺棕棠棘棗椅棟棵森棧棹棒棲棣棋棍植椒椎棉棚楮棻款欺欽殘殖殼毯氮氯氬港游湔渡渲湧湊渠渥渣減湛湘渤湖湮渭渦湯渴湍渺測湃渝渾滋\"],[\"b540\",\"溉渙湎湣湄湲湩湟焙焚焦焰無然煮焜牌犄犀猶猥猴猩琺琪琳琢琥琵琶琴琯琛琦琨甥甦畫番痢痛痣痙痘痞痠登發皖皓皴盜睏短硝硬硯稍稈程稅稀窘\"],[\"b5a1\",\"窗窖童竣等策筆筐筒答筍筋筏筑粟粥絞結絨絕紫絮絲絡給絢絰絳善翔翕耋聒肅腕腔腋腑腎脹腆脾腌腓腴舒舜菩萃菸萍菠菅萋菁華菱菴著萊菰萌菌菽菲菊萸萎萄菜萇菔菟虛蛟蛙蛭蛔蛛蛤蛐蛞街裁裂袱覃視註詠評詞証詁\"],[\"b640\",\"詔詛詐詆訴診訶詖象貂貯貼貳貽賁費賀貴買貶貿貸越超趁跎距跋跚跑跌跛跆軻軸軼辜逮逵週逸進逶鄂郵鄉郾酣酥量鈔鈕鈣鈉鈞鈍鈐鈇鈑閔閏開閑\"],[\"b6a1\",\"間閒閎隊階隋陽隅隆隍陲隄雁雅雄集雇雯雲韌項順須飧飪飯飩飲飭馮馭黃黍黑亂傭債傲傳僅傾催傷傻傯僇剿剷剽募勦勤勢勣匯嗟嗨嗓嗦嗎嗜嗇嗑嗣嗤嗯嗚嗡嗅嗆嗥嗉園圓塞塑塘塗塚塔填塌塭塊塢塒塋奧嫁嫉嫌媾媽媼\"],[\"b740\",\"媳嫂媲嵩嵯幌幹廉廈弒彙徬微愚意慈感想愛惹愁愈慎慌慄慍愾愴愧愍愆愷戡戢搓搾搞搪搭搽搬搏搜搔損搶搖搗搆敬斟新暗暉暇暈暖暄暘暍會榔業\"],[\"b7a1\",\"楚楷楠楔極椰概楊楨楫楞楓楹榆楝楣楛歇歲毀殿毓毽溢溯滓溶滂源溝滇滅溥溘溼溺溫滑準溜滄滔溪溧溴煎煙煩煤煉照煜煬煦煌煥煞煆煨煖爺牒猷獅猿猾瑯瑚瑕瑟瑞瑁琿瑙瑛瑜當畸瘀痰瘁痲痱痺痿痴痳盞盟睛睫睦睞督\"],[\"b840\",\"睹睪睬睜睥睨睢矮碎碰碗碘碌碉硼碑碓硿祺祿禁萬禽稜稚稠稔稟稞窟窠筷節筠筮筧粱粳粵經絹綑綁綏絛置罩罪署義羨群聖聘肆肄腱腰腸腥腮腳腫\"],[\"b8a1\",\"腹腺腦舅艇蒂葷落萱葵葦葫葉葬葛萼萵葡董葩葭葆虞虜號蛹蜓蜈蜇蜀蛾蛻蜂蜃蜆蜊衙裟裔裙補裘裝裡裊裕裒覜解詫該詳試詩詰誇詼詣誠話誅詭詢詮詬詹詻訾詨豢貊貉賊資賈賄貲賃賂賅跡跟跨路跳跺跪跤跦躲較載軾輊\"],[\"b940\",\"辟農運遊道遂達逼違遐遇遏過遍遑逾遁鄒鄗酬酪酩釉鈷鉗鈸鈽鉀鈾鉛鉋鉤鉑鈴鉉鉍鉅鈹鈿鉚閘隘隔隕雍雋雉雊雷電雹零靖靴靶預頑頓頊頒頌飼飴\"],[\"b9a1\",\"飽飾馳馱馴髡鳩麂鼎鼓鼠僧僮僥僖僭僚僕像僑僱僎僩兢凳劃劂匱厭嗾嘀嘛嘗嗽嘔嘆嘉嘍嘎嗷嘖嘟嘈嘐嗶團圖塵塾境墓墊塹墅塽壽夥夢夤奪奩嫡嫦嫩嫗嫖嫘嫣孵寞寧寡寥實寨寢寤察對屢嶄嶇幛幣幕幗幔廓廖弊彆彰徹慇\"],[\"ba40\",\"愿態慷慢慣慟慚慘慵截撇摘摔撤摸摟摺摑摧搴摭摻敲斡旗旖暢暨暝榜榨榕槁榮槓構榛榷榻榫榴槐槍榭槌榦槃榣歉歌氳漳演滾漓滴漩漾漠漬漏漂漢\"],[\"baa1\",\"滿滯漆漱漸漲漣漕漫漯澈漪滬漁滲滌滷熔熙煽熊熄熒爾犒犖獄獐瑤瑣瑪瑰瑭甄疑瘧瘍瘋瘉瘓盡監瞄睽睿睡磁碟碧碳碩碣禎福禍種稱窪窩竭端管箕箋筵算箝箔箏箸箇箄粹粽精綻綰綜綽綾綠緊綴網綱綺綢綿綵綸維緒緇綬\"],[\"bb40\",\"罰翠翡翟聞聚肇腐膀膏膈膊腿膂臧臺與舔舞艋蓉蒿蓆蓄蒙蒞蒲蒜蓋蒸蓀蓓蒐蒼蓑蓊蜿蜜蜻蜢蜥蜴蜘蝕蜷蜩裳褂裴裹裸製裨褚裯誦誌語誣認誡誓誤\"],[\"bba1\",\"說誥誨誘誑誚誧豪貍貌賓賑賒赫趙趕跼輔輒輕輓辣遠遘遜遣遙遞遢遝遛鄙鄘鄞酵酸酷酴鉸銀銅銘銖鉻銓銜銨鉼銑閡閨閩閣閥閤隙障際雌雒需靼鞅韶頗領颯颱餃餅餌餉駁骯骰髦魁魂鳴鳶鳳麼鼻齊億儀僻僵價儂儈儉儅凜\"],[\"bc40\",\"劇劈劉劍劊勰厲嘮嘻嘹嘲嘿嘴嘩噓噎噗噴嘶嘯嘰墀墟增墳墜墮墩墦奭嬉嫻嬋嫵嬌嬈寮寬審寫層履嶝嶔幢幟幡廢廚廟廝廣廠彈影德徵慶慧慮慝慕憂\"],[\"bca1\",\"慼慰慫慾憧憐憫憎憬憚憤憔憮戮摩摯摹撞撲撈撐撰撥撓撕撩撒撮播撫撚撬撙撢撳敵敷數暮暫暴暱樣樟槨樁樞標槽模樓樊槳樂樅槭樑歐歎殤毅毆漿潼澄潑潦潔澆潭潛潸潮澎潺潰潤澗潘滕潯潠潟熟熬熱熨牖犛獎獗瑩璋璃\"],[\"bd40\",\"瑾璀畿瘠瘩瘟瘤瘦瘡瘢皚皺盤瞎瞇瞌瞑瞋磋磅確磊碾磕碼磐稿稼穀稽稷稻窯窮箭箱範箴篆篇篁箠篌糊締練緯緻緘緬緝編緣線緞緩綞緙緲緹罵罷羯\"],[\"bda1\",\"翩耦膛膜膝膠膚膘蔗蔽蔚蓮蔬蔭蔓蔑蔣蔡蔔蓬蔥蓿蔆螂蝴蝶蝠蝦蝸蝨蝙蝗蝌蝓衛衝褐複褒褓褕褊誼諒談諄誕請諸課諉諂調誰論諍誶誹諛豌豎豬賠賞賦賤賬賭賢賣賜質賡赭趟趣踫踐踝踢踏踩踟踡踞躺輝輛輟輩輦輪輜輞\"],[\"be40\",\"輥適遮遨遭遷鄰鄭鄧鄱醇醉醋醃鋅銻銷鋪銬鋤鋁銳銼鋒鋇鋰銲閭閱霄霆震霉靠鞍鞋鞏頡頫頜颳養餓餒餘駝駐駟駛駑駕駒駙骷髮髯鬧魅魄魷魯鴆鴉\"],[\"bea1\",\"鴃麩麾黎墨齒儒儘儔儐儕冀冪凝劑劓勳噙噫噹噩噤噸噪器噥噱噯噬噢噶壁墾壇壅奮嬝嬴學寰導彊憲憑憩憊懍憶憾懊懈戰擅擁擋撻撼據擄擇擂操撿擒擔撾整曆曉暹曄曇暸樽樸樺橙橫橘樹橄橢橡橋橇樵機橈歙歷氅濂澱澡\"],[\"bf40\",\"濃澤濁澧澳激澹澶澦澠澴熾燉燐燒燈燕熹燎燙燜燃燄獨璜璣璘璟璞瓢甌甍瘴瘸瘺盧盥瞠瞞瞟瞥磨磚磬磧禦積穎穆穌穋窺篙簑築篤篛篡篩篦糕糖縊\"],[\"bfa1\",\"縑縈縛縣縞縝縉縐罹羲翰翱翮耨膳膩膨臻興艘艙蕊蕙蕈蕨蕩蕃蕉蕭蕪蕞螃螟螞螢融衡褪褲褥褫褡親覦諦諺諫諱謀諜諧諮諾謁謂諷諭諳諶諼豫豭貓賴蹄踱踴蹂踹踵輻輯輸輳辨辦遵遴選遲遼遺鄴醒錠錶鋸錳錯錢鋼錫錄錚\"],[\"c040\",\"錐錦錡錕錮錙閻隧隨險雕霎霑霖霍霓霏靛靜靦鞘頰頸頻頷頭頹頤餐館餞餛餡餚駭駢駱骸骼髻髭鬨鮑鴕鴣鴦鴨鴒鴛默黔龍龜優償儡儲勵嚎嚀嚐嚅嚇\"],[\"c0a1\",\"嚏壕壓壑壎嬰嬪嬤孺尷屨嶼嶺嶽嶸幫彌徽應懂懇懦懋戲戴擎擊擘擠擰擦擬擱擢擭斂斃曙曖檀檔檄檢檜櫛檣橾檗檐檠歜殮毚氈濘濱濟濠濛濤濫濯澀濬濡濩濕濮濰燧營燮燦燥燭燬燴燠爵牆獰獲璩環璦璨癆療癌盪瞳瞪瞰瞬\"],[\"c140\",\"瞧瞭矯磷磺磴磯礁禧禪穗窿簇簍篾篷簌篠糠糜糞糢糟糙糝縮績繆縷縲繃縫總縱繅繁縴縹繈縵縿縯罄翳翼聱聲聰聯聳臆臃膺臂臀膿膽臉膾臨舉艱薪\"],[\"c1a1\",\"薄蕾薜薑薔薯薛薇薨薊虧蟀蟑螳蟒蟆螫螻螺蟈蟋褻褶襄褸褽覬謎謗謙講謊謠謝謄謐豁谿豳賺賽購賸賻趨蹉蹋蹈蹊轄輾轂轅輿避遽還邁邂邀鄹醣醞醜鍍鎂錨鍵鍊鍥鍋錘鍾鍬鍛鍰鍚鍔闊闋闌闈闆隱隸雖霜霞鞠韓顆颶餵騁\"],[\"c240\",\"駿鮮鮫鮪鮭鴻鴿麋黏點黜黝黛鼾齋叢嚕嚮壙壘嬸彝懣戳擴擲擾攆擺擻擷斷曜朦檳檬櫃檻檸櫂檮檯歟歸殯瀉瀋濾瀆濺瀑瀏燻燼燾燸獷獵璧璿甕癖癘\"],[\"c2a1\",\"癒瞽瞿瞻瞼礎禮穡穢穠竄竅簫簧簪簞簣簡糧織繕繞繚繡繒繙罈翹翻職聶臍臏舊藏薩藍藐藉薰薺薹薦蟯蟬蟲蟠覆覲觴謨謹謬謫豐贅蹙蹣蹦蹤蹟蹕軀轉轍邇邃邈醫醬釐鎔鎊鎖鎢鎳鎮鎬鎰鎘鎚鎗闔闖闐闕離雜雙雛雞霤鞣鞦\"],[\"c340\",\"鞭韹額顏題顎顓颺餾餿餽餮馥騎髁鬃鬆魏魎魍鯊鯉鯽鯈鯀鵑鵝鵠黠鼕鼬儳嚥壞壟壢寵龐廬懲懷懶懵攀攏曠曝櫥櫝櫚櫓瀛瀟瀨瀚瀝瀕瀘爆爍牘犢獸\"],[\"c3a1\",\"獺璽瓊瓣疇疆癟癡矇礙禱穫穩簾簿簸簽簷籀繫繭繹繩繪羅繳羶羹羸臘藩藝藪藕藤藥藷蟻蠅蠍蟹蟾襠襟襖襞譁譜識證譚譎譏譆譙贈贊蹼蹲躇蹶蹬蹺蹴轔轎辭邊邋醱醮鏡鏑鏟鏃鏈鏜鏝鏖鏢鏍鏘鏤鏗鏨關隴難霪霧靡韜韻類\"],[\"c440\",\"願顛颼饅饉騖騙鬍鯨鯧鯖鯛鶉鵡鵲鵪鵬麒麗麓麴勸嚨嚷嚶嚴嚼壤孀孃孽寶巉懸懺攘攔攙曦朧櫬瀾瀰瀲爐獻瓏癢癥礦礪礬礫竇競籌籃籍糯糰辮繽繼\"],[\"c4a1\",\"纂罌耀臚艦藻藹蘑藺蘆蘋蘇蘊蠔蠕襤覺觸議譬警譯譟譫贏贍躉躁躅躂醴釋鐘鐃鏽闡霰飄饒饑馨騫騰騷騵鰓鰍鹹麵黨鼯齟齣齡儷儸囁囀囂夔屬巍懼懾攝攜斕曩櫻欄櫺殲灌爛犧瓖瓔癩矓籐纏續羼蘗蘭蘚蠣蠢蠡蠟襪襬覽譴\"],[\"c540\",\"護譽贓躊躍躋轟辯醺鐮鐳鐵鐺鐸鐲鐫闢霸霹露響顧顥饗驅驃驀騾髏魔魑鰭鰥鶯鶴鷂鶸麝黯鼙齜齦齧儼儻囈囊囉孿巔巒彎懿攤權歡灑灘玀瓤疊癮癬\"],[\"c5a1\",\"禳籠籟聾聽臟襲襯觼讀贖贗躑躓轡酈鑄鑑鑒霽霾韃韁顫饕驕驍髒鬚鱉鰱鰾鰻鷓鷗鼴齬齪龔囌巖戀攣攫攪曬欐瓚竊籤籣籥纓纖纔臢蘸蘿蠱變邐邏鑣鑠鑤靨顯饜驚驛驗髓體髑鱔鱗鱖鷥麟黴囑壩攬灞癱癲矗罐羈蠶蠹衢讓讒\"],[\"c640\",\"讖艷贛釀鑪靂靈靄韆顰驟鬢魘鱟鷹鷺鹼鹽鼇齷齲廳欖灣籬籮蠻觀躡釁鑲鑰顱饞髖鬣黌灤矚讚鑷韉驢驥纜讜躪釅鑽鑾鑼鱷鱸黷豔鑿鸚爨驪鬱鸛鸞籲\"],[\"c940\",\"乂乜凵匚厂万丌乇亍囗兀屮彳丏冇与丮亓仂仉仈冘勼卬厹圠夃夬尐巿旡殳毌气爿丱丼仨仜仩仡仝仚刌匜卌圢圣夗夯宁宄尒尻屴屳帄庀庂忉戉扐氕\"],[\"c9a1\",\"氶汃氿氻犮犰玊禸肊阞伎优伬仵伔仱伀价伈伝伂伅伢伓伄仴伒冱刓刉刐劦匢匟卍厊吇囡囟圮圪圴夼妀奼妅奻奾奷奿孖尕尥屼屺屻屾巟幵庄异弚彴忕忔忏扜扞扤扡扦扢扙扠扚扥旯旮朾朹朸朻机朿朼朳氘汆汒汜汏汊汔汋\"],[\"ca40\",\"汌灱牞犴犵玎甪癿穵网艸艼芀艽艿虍襾邙邗邘邛邔阢阤阠阣佖伻佢佉体佤伾佧佒佟佁佘伭伳伿佡冏冹刜刞刡劭劮匉卣卲厎厏吰吷吪呔呅吙吜吥吘\"],[\"caa1\",\"吽呏呁吨吤呇囮囧囥坁坅坌坉坋坒夆奀妦妘妠妗妎妢妐妏妧妡宎宒尨尪岍岏岈岋岉岒岊岆岓岕巠帊帎庋庉庌庈庍弅弝彸彶忒忑忐忭忨忮忳忡忤忣忺忯忷忻怀忴戺抃抌抎抏抔抇扱扻扺扰抁抈扷扽扲扴攷旰旴旳旲旵杅杇\"],[\"cb40\",\"杙杕杌杈杝杍杚杋毐氙氚汸汧汫沄沋沏汱汯汩沚汭沇沕沜汦汳汥汻沎灴灺牣犿犽狃狆狁犺狅玕玗玓玔玒町甹疔疕皁礽耴肕肙肐肒肜芐芏芅芎芑芓\"],[\"cba1\",\"芊芃芄豸迉辿邟邡邥邞邧邠阰阨阯阭丳侘佼侅佽侀侇佶佴侉侄佷佌侗佪侚佹侁佸侐侜侔侞侒侂侕佫佮冞冼冾刵刲刳剆刱劼匊匋匼厒厔咇呿咁咑咂咈呫呺呾呥呬呴呦咍呯呡呠咘呣呧呤囷囹坯坲坭坫坱坰坶垀坵坻坳坴坢\"],[\"cc40\",\"坨坽夌奅妵妺姏姎妲姌姁妶妼姃姖妱妽姀姈妴姇孢孥宓宕屄屇岮岤岠岵岯岨岬岟岣岭岢岪岧岝岥岶岰岦帗帔帙弨弢弣弤彔徂彾彽忞忥怭怦怙怲怋\"],[\"cca1\",\"怴怊怗怳怚怞怬怢怍怐怮怓怑怌怉怜戔戽抭抴拑抾抪抶拊抮抳抯抻抩抰抸攽斨斻昉旼昄昒昈旻昃昋昍昅旽昑昐曶朊枅杬枎枒杶杻枘枆构杴枍枌杺枟枑枙枃杽极杸杹枔欥殀歾毞氝沓泬泫泮泙沶泔沭泧沷泐泂沺泃泆泭泲\"],[\"cd40\",\"泒泝沴沊沝沀泞泀洰泍泇沰泹泏泩泑炔炘炅炓炆炄炑炖炂炚炃牪狖狋狘狉狜狒狔狚狌狑玤玡玭玦玢玠玬玝瓝瓨甿畀甾疌疘皯盳盱盰盵矸矼矹矻矺\"],[\"cda1\",\"矷祂礿秅穸穻竻籵糽耵肏肮肣肸肵肭舠芠苀芫芚芘芛芵芧芮芼芞芺芴芨芡芩苂芤苃芶芢虰虯虭虮豖迒迋迓迍迖迕迗邲邴邯邳邰阹阽阼阺陃俍俅俓侲俉俋俁俔俜俙侻侳俛俇俖侺俀侹俬剄剉勀勂匽卼厗厖厙厘咺咡咭咥哏\"],[\"ce40\",\"哃茍咷咮哖咶哅哆咠呰咼咢咾呲哞咰垵垞垟垤垌垗垝垛垔垘垏垙垥垚垕壴复奓姡姞姮娀姱姝姺姽姼姶姤姲姷姛姩姳姵姠姾姴姭宨屌峐峘峌峗峋峛\"],[\"cea1\",\"峞峚峉峇峊峖峓峔峏峈峆峎峟峸巹帡帢帣帠帤庰庤庢庛庣庥弇弮彖徆怷怹恔恲恞恅恓恇恉恛恌恀恂恟怤恄恘恦恮扂扃拏挍挋拵挎挃拫拹挏挌拸拶挀挓挔拺挕拻拰敁敃斪斿昶昡昲昵昜昦昢昳昫昺昝昴昹昮朏朐柁柲柈枺\"],[\"cf40\",\"柜枻柸柘柀枷柅柫柤柟枵柍枳柷柶柮柣柂枹柎柧柰枲柼柆柭柌枮柦柛柺柉柊柃柪柋欨殂殄殶毖毘毠氠氡洨洴洭洟洼洿洒洊泚洳洄洙洺洚洑洀洝浂\"],[\"cfa1\",\"洁洘洷洃洏浀洇洠洬洈洢洉洐炷炟炾炱炰炡炴炵炩牁牉牊牬牰牳牮狊狤狨狫狟狪狦狣玅珌珂珈珅玹玶玵玴珫玿珇玾珃珆玸珋瓬瓮甮畇畈疧疪癹盄眈眃眄眅眊盷盻盺矧矨砆砑砒砅砐砏砎砉砃砓祊祌祋祅祄秕种秏秖秎窀\"],[\"d040\",\"穾竑笀笁籺籸籹籿粀粁紃紈紁罘羑羍羾耇耎耏耔耷胘胇胠胑胈胂胐胅胣胙胜胊胕胉胏胗胦胍臿舡芔苙苾苹茇苨茀苕茺苫苖苴苬苡苲苵茌苻苶苰苪\"],[\"d0a1\",\"苤苠苺苳苭虷虴虼虳衁衎衧衪衩觓訄訇赲迣迡迮迠郱邽邿郕郅邾郇郋郈釔釓陔陏陑陓陊陎倞倅倇倓倢倰倛俵俴倳倷倬俶俷倗倜倠倧倵倯倱倎党冔冓凊凄凅凈凎剡剚剒剞剟剕剢勍匎厞唦哢唗唒哧哳哤唚哿唄唈哫唑唅哱\"],[\"d140\",\"唊哻哷哸哠唎唃唋圁圂埌堲埕埒垺埆垽垼垸垶垿埇埐垹埁夎奊娙娖娭娮娕娏娗娊娞娳孬宧宭宬尃屖屔峬峿峮峱峷崀峹帩帨庨庮庪庬弳弰彧恝恚恧\"],[\"d1a1\",\"恁悢悈悀悒悁悝悃悕悛悗悇悜悎戙扆拲挐捖挬捄捅挶捃揤挹捋捊挼挩捁挴捘捔捙挭捇挳捚捑挸捗捀捈敊敆旆旃旄旂晊晟晇晑朒朓栟栚桉栲栳栻桋桏栖栱栜栵栫栭栯桎桄栴栝栒栔栦栨栮桍栺栥栠欬欯欭欱欴歭肂殈毦毤\"],[\"d240\",\"毨毣毢毧氥浺浣浤浶洍浡涒浘浢浭浯涑涍淯浿涆浞浧浠涗浰浼浟涂涘洯浨涋浾涀涄洖涃浻浽浵涐烜烓烑烝烋缹烢烗烒烞烠烔烍烅烆烇烚烎烡牂牸\"],[\"d2a1\",\"牷牶猀狺狴狾狶狳狻猁珓珙珥珖玼珧珣珩珜珒珛珔珝珚珗珘珨瓞瓟瓴瓵甡畛畟疰痁疻痄痀疿疶疺皊盉眝眛眐眓眒眣眑眕眙眚眢眧砣砬砢砵砯砨砮砫砡砩砳砪砱祔祛祏祜祓祒祑秫秬秠秮秭秪秜秞秝窆窉窅窋窌窊窇竘笐\"],[\"d340\",\"笄笓笅笏笈笊笎笉笒粄粑粊粌粈粍粅紞紝紑紎紘紖紓紟紒紏紌罜罡罞罠罝罛羖羒翃翂翀耖耾耹胺胲胹胵脁胻脀舁舯舥茳茭荄茙荑茥荖茿荁茦茜茢\"],[\"d3a1\",\"荂荎茛茪茈茼荍茖茤茠茷茯茩荇荅荌荓茞茬荋茧荈虓虒蚢蚨蚖蚍蚑蚞蚇蚗蚆蚋蚚蚅蚥蚙蚡蚧蚕蚘蚎蚝蚐蚔衃衄衭衵衶衲袀衱衿衯袃衾衴衼訒豇豗豻貤貣赶赸趵趷趶軑軓迾迵适迿迻逄迼迶郖郠郙郚郣郟郥郘郛郗郜郤酐\"],[\"d440\",\"酎酏釕釢釚陜陟隼飣髟鬯乿偰偪偡偞偠偓偋偝偲偈偍偁偛偊偢倕偅偟偩偫偣偤偆偀偮偳偗偑凐剫剭剬剮勖勓匭厜啵啶唼啍啐唴唪啑啢唶唵唰啒啅\"],[\"d4a1\",\"唌唲啥啎唹啈唭唻啀啋圊圇埻堔埢埶埜埴堀埭埽堈埸堋埳埏堇埮埣埲埥埬埡堎埼堐埧堁堌埱埩埰堍堄奜婠婘婕婧婞娸娵婭婐婟婥婬婓婤婗婃婝婒婄婛婈媎娾婍娹婌婰婩婇婑婖婂婜孲孮寁寀屙崞崋崝崚崠崌崨崍崦崥崏\"],[\"d540\",\"崰崒崣崟崮帾帴庱庴庹庲庳弶弸徛徖徟悊悐悆悾悰悺惓惔惏惤惙惝惈悱惛悷惊悿惃惍惀挲捥掊掂捽掽掞掭掝掗掫掎捯掇掐据掯捵掜捭掮捼掤挻掟\"],[\"d5a1\",\"捸掅掁掑掍捰敓旍晥晡晛晙晜晢朘桹梇梐梜桭桮梮梫楖桯梣梬梩桵桴梲梏桷梒桼桫桲梪梀桱桾梛梖梋梠梉梤桸桻梑梌梊桽欶欳欷欸殑殏殍殎殌氪淀涫涴涳湴涬淩淢涷淶淔渀淈淠淟淖涾淥淜淝淛淴淊涽淭淰涺淕淂淏淉\"],[\"d640\",\"淐淲淓淽淗淍淣涻烺焍烷焗烴焌烰焄烳焐烼烿焆焓焀烸烶焋焂焎牾牻牼牿猝猗猇猑猘猊猈狿猏猞玈珶珸珵琄琁珽琇琀珺珼珿琌琋珴琈畤畣痎痒痏\"],[\"d6a1\",\"痋痌痑痐皏皉盓眹眯眭眱眲眴眳眽眥眻眵硈硒硉硍硊硌砦硅硐祤祧祩祪祣祫祡离秺秸秶秷窏窔窐笵筇笴笥笰笢笤笳笘笪笝笱笫笭笯笲笸笚笣粔粘粖粣紵紽紸紶紺絅紬紩絁絇紾紿絊紻紨罣羕羜羝羛翊翋翍翐翑翇翏翉耟\"],[\"d740\",\"耞耛聇聃聈脘脥脙脛脭脟脬脞脡脕脧脝脢舑舸舳舺舴舲艴莐莣莨莍荺荳莤荴莏莁莕莙荵莔莩荽莃莌莝莛莪莋荾莥莯莈莗莰荿莦莇莮荶莚虙虖蚿蚷\"],[\"d7a1\",\"蛂蛁蛅蚺蚰蛈蚹蚳蚸蛌蚴蚻蚼蛃蚽蚾衒袉袕袨袢袪袚袑袡袟袘袧袙袛袗袤袬袌袓袎覂觖觙觕訰訧訬訞谹谻豜豝豽貥赽赻赹趼跂趹趿跁軘軞軝軜軗軠軡逤逋逑逜逌逡郯郪郰郴郲郳郔郫郬郩酖酘酚酓酕釬釴釱釳釸釤釹釪\"],[\"d840\",\"釫釷釨釮镺閆閈陼陭陫陱陯隿靪頄飥馗傛傕傔傞傋傣傃傌傎傝偨傜傒傂傇兟凔匒匑厤厧喑喨喥喭啷噅喢喓喈喏喵喁喣喒喤啽喌喦啿喕喡喎圌堩堷\"],[\"d8a1\",\"堙堞堧堣堨埵塈堥堜堛堳堿堶堮堹堸堭堬堻奡媯媔媟婺媢媞婸媦婼媥媬媕媮娷媄媊媗媃媋媩婻婽媌媜媏媓媝寪寍寋寔寑寊寎尌尰崷嵃嵫嵁嵋崿崵嵑嵎嵕崳崺嵒崽崱嵙嵂崹嵉崸崼崲崶嵀嵅幄幁彘徦徥徫惉悹惌惢惎惄愔\"],[\"d940\",\"惲愊愖愅惵愓惸惼惾惁愃愘愝愐惿愄愋扊掔掱掰揎揥揨揯揃撝揳揊揠揶揕揲揵摡揟掾揝揜揄揘揓揂揇揌揋揈揰揗揙攲敧敪敤敜敨敥斌斝斞斮旐旒\"],[\"d9a1\",\"晼晬晻暀晱晹晪晲朁椌棓椄棜椪棬棪棱椏棖棷棫棤棶椓椐棳棡椇棌椈楰梴椑棯棆椔棸棐棽棼棨椋椊椗棎棈棝棞棦棴棑椆棔棩椕椥棇欹欻欿欼殔殗殙殕殽毰毲毳氰淼湆湇渟湉溈渼渽湅湢渫渿湁湝湳渜渳湋湀湑渻渃渮湞\"],[\"da40\",\"湨湜湡渱渨湠湱湫渹渢渰湓湥渧湸湤湷湕湹湒湦渵渶湚焠焞焯烻焮焱焣焥焢焲焟焨焺焛牋牚犈犉犆犅犋猒猋猰猢猱猳猧猲猭猦猣猵猌琮琬琰琫琖\"],[\"daa1\",\"琚琡琭琱琤琣琝琩琠琲瓻甯畯畬痧痚痡痦痝痟痤痗皕皒盚睆睇睄睍睅睊睎睋睌矞矬硠硤硥硜硭硱硪确硰硩硨硞硢祴祳祲祰稂稊稃稌稄窙竦竤筊笻筄筈筌筎筀筘筅粢粞粨粡絘絯絣絓絖絧絪絏絭絜絫絒絔絩絑絟絎缾缿罥\"],[\"db40\",\"罦羢羠羡翗聑聏聐胾胔腃腊腒腏腇脽腍脺臦臮臷臸臹舄舼舽舿艵茻菏菹萣菀菨萒菧菤菼菶萐菆菈菫菣莿萁菝菥菘菿菡菋菎菖菵菉萉萏菞萑萆菂菳\"],[\"dba1\",\"菕菺菇菑菪萓菃菬菮菄菻菗菢萛菛菾蛘蛢蛦蛓蛣蛚蛪蛝蛫蛜蛬蛩蛗蛨蛑衈衖衕袺裗袹袸裀袾袶袼袷袽袲褁裉覕覘覗觝觚觛詎詍訹詙詀詗詘詄詅詒詈詑詊詌詏豟貁貀貺貾貰貹貵趄趀趉跘跓跍跇跖跜跏跕跙跈跗跅軯軷軺\"],[\"dc40\",\"軹軦軮軥軵軧軨軶軫軱軬軴軩逭逴逯鄆鄬鄄郿郼鄈郹郻鄁鄀鄇鄅鄃酡酤酟酢酠鈁鈊鈥鈃鈚鈦鈏鈌鈀鈒釿釽鈆鈄鈧鈂鈜鈤鈙鈗鈅鈖镻閍閌閐隇陾隈\"],[\"dca1\",\"隉隃隀雂雈雃雱雰靬靰靮頇颩飫鳦黹亃亄亶傽傿僆傮僄僊傴僈僂傰僁傺傱僋僉傶傸凗剺剸剻剼嗃嗛嗌嗐嗋嗊嗝嗀嗔嗄嗩喿嗒喍嗏嗕嗢嗖嗈嗲嗍嗙嗂圔塓塨塤塏塍塉塯塕塎塝塙塥塛堽塣塱壼嫇嫄嫋媺媸媱媵媰媿嫈媻嫆\"],[\"dd40\",\"媷嫀嫊媴媶嫍媹媐寖寘寙尟尳嵱嵣嵊嵥嵲嵬嵞嵨嵧嵢巰幏幎幊幍幋廅廌廆廋廇彀徯徭惷慉慊愫慅愶愲愮慆愯慏愩慀戠酨戣戥戤揅揱揫搐搒搉搠搤\"],[\"dda1\",\"搳摃搟搕搘搹搷搢搣搌搦搰搨摁搵搯搊搚摀搥搧搋揧搛搮搡搎敯斒旓暆暌暕暐暋暊暙暔晸朠楦楟椸楎楢楱椿楅楪椹楂楗楙楺楈楉椵楬椳椽楥棰楸椴楩楀楯楄楶楘楁楴楌椻楋椷楜楏楑椲楒椯楻椼歆歅歃歂歈歁殛嗀毻毼\"],[\"de40\",\"毹毷毸溛滖滈溏滀溟溓溔溠溱溹滆滒溽滁溞滉溷溰滍溦滏溲溾滃滜滘溙溒溎溍溤溡溿溳滐滊溗溮溣煇煔煒煣煠煁煝煢煲煸煪煡煂煘煃煋煰煟煐煓\"],[\"dea1\",\"煄煍煚牏犍犌犑犐犎猼獂猻猺獀獊獉瑄瑊瑋瑒瑑瑗瑀瑏瑐瑎瑂瑆瑍瑔瓡瓿瓾瓽甝畹畷榃痯瘏瘃痷痾痼痹痸瘐痻痶痭痵痽皙皵盝睕睟睠睒睖睚睩睧睔睙睭矠碇碚碔碏碄碕碅碆碡碃硹碙碀碖硻祼禂祽祹稑稘稙稒稗稕稢稓\"],[\"df40\",\"稛稐窣窢窞竫筦筤筭筴筩筲筥筳筱筰筡筸筶筣粲粴粯綈綆綀綍絿綅絺綎絻綃絼綌綔綄絽綒罭罫罧罨罬羦羥羧翛翜耡腤腠腷腜腩腛腢腲朡腞腶腧腯\"],[\"dfa1\",\"腄腡舝艉艄艀艂艅蓱萿葖葶葹蒏蒍葥葑葀蒆葧萰葍葽葚葙葴葳葝蔇葞萷萺萴葺葃葸萲葅萩菙葋萯葂萭葟葰萹葎葌葒葯蓅蒎萻葇萶萳葨葾葄萫葠葔葮葐蜋蜄蛷蜌蛺蛖蛵蝍蛸蜎蜉蜁蛶蜍蜅裖裋裍裎裞裛裚裌裐覅覛觟觥觤\"],[\"e040\",\"觡觠觢觜触詶誆詿詡訿詷誂誄詵誃誁詴詺谼豋豊豥豤豦貆貄貅賌赨赩趑趌趎趏趍趓趔趐趒跰跠跬跱跮跐跩跣跢跧跲跫跴輆軿輁輀輅輇輈輂輋遒逿\"],[\"e0a1\",\"遄遉逽鄐鄍鄏鄑鄖鄔鄋鄎酮酯鉈鉒鈰鈺鉦鈳鉥鉞銃鈮鉊鉆鉭鉬鉏鉠鉧鉯鈶鉡鉰鈱鉔鉣鉐鉲鉎鉓鉌鉖鈲閟閜閞閛隒隓隑隗雎雺雽雸雵靳靷靸靲頏頍頎颬飶飹馯馲馰馵骭骫魛鳪鳭鳧麀黽僦僔僗僨僳僛僪僝僤僓僬僰僯僣僠\"],[\"e140\",\"凘劀劁勩勫匰厬嘧嘕嘌嘒嗼嘏嘜嘁嘓嘂嗺嘝嘄嗿嗹墉塼墐墘墆墁塿塴墋塺墇墑墎塶墂墈塻墔墏壾奫嫜嫮嫥嫕嫪嫚嫭嫫嫳嫢嫠嫛嫬嫞嫝嫙嫨嫟孷寠\"],[\"e1a1\",\"寣屣嶂嶀嵽嶆嵺嶁嵷嶊嶉嶈嵾嵼嶍嵹嵿幘幙幓廘廑廗廎廜廕廙廒廔彄彃彯徶愬愨慁慞慱慳慒慓慲慬憀慴慔慺慛慥愻慪慡慖戩戧戫搫摍摛摝摴摶摲摳摽摵摦撦摎撂摞摜摋摓摠摐摿搿摬摫摙摥摷敳斠暡暠暟朅朄朢榱榶槉\"],[\"e240\",\"榠槎榖榰榬榼榑榙榎榧榍榩榾榯榿槄榽榤槔榹槊榚槏榳榓榪榡榞槙榗榐槂榵榥槆歊歍歋殞殟殠毃毄毾滎滵滱漃漥滸漷滻漮漉潎漙漚漧漘漻漒滭漊\"],[\"e2a1\",\"漶潳滹滮漭潀漰漼漵滫漇漎潃漅滽滶漹漜滼漺漟漍漞漈漡熇熐熉熀熅熂熏煻熆熁熗牄牓犗犕犓獃獍獑獌瑢瑳瑱瑵瑲瑧瑮甀甂甃畽疐瘖瘈瘌瘕瘑瘊瘔皸瞁睼瞅瞂睮瞀睯睾瞃碲碪碴碭碨硾碫碞碥碠碬碢碤禘禊禋禖禕禔禓\"],[\"e340\",\"禗禈禒禐稫穊稰稯稨稦窨窫窬竮箈箜箊箑箐箖箍箌箛箎箅箘劄箙箤箂粻粿粼粺綧綷緂綣綪緁緀緅綝緎緄緆緋緌綯綹綖綼綟綦綮綩綡緉罳翢翣翥翞\"],[\"e3a1\",\"耤聝聜膉膆膃膇膍膌膋舕蒗蒤蒡蒟蒺蓎蓂蒬蒮蒫蒹蒴蓁蓍蒪蒚蒱蓐蒝蒧蒻蒢蒔蓇蓌蒛蒩蒯蒨蓖蒘蒶蓏蒠蓗蓔蓒蓛蒰蒑虡蜳蜣蜨蝫蝀蜮蜞蜡蜙蜛蝃蜬蝁蜾蝆蜠蜲蜪蜭蜼蜒蜺蜱蜵蝂蜦蜧蜸蜤蜚蜰蜑裷裧裱裲裺裾裮裼裶裻\"],[\"e440\",\"裰裬裫覝覡覟覞觩觫觨誫誙誋誒誏誖谽豨豩賕賏賗趖踉踂跿踍跽踊踃踇踆踅跾踀踄輐輑輎輍鄣鄜鄠鄢鄟鄝鄚鄤鄡鄛酺酲酹酳銥銤鉶銛鉺銠銔銪銍\"],[\"e4a1\",\"銦銚銫鉹銗鉿銣鋮銎銂銕銢鉽銈銡銊銆銌銙銧鉾銇銩銝銋鈭隞隡雿靘靽靺靾鞃鞀鞂靻鞄鞁靿韎韍頖颭颮餂餀餇馝馜駃馹馻馺駂馽駇骱髣髧鬾鬿魠魡魟鳱鳲鳵麧僿儃儰僸儆儇僶僾儋儌僽儊劋劌勱勯噈噂噌嘵噁噊噉噆噘\"],[\"e540\",\"噚噀嘳嘽嘬嘾嘸嘪嘺圚墫墝墱墠墣墯墬墥墡壿嫿嫴嫽嫷嫶嬃嫸嬂嫹嬁嬇嬅嬏屧嶙嶗嶟嶒嶢嶓嶕嶠嶜嶡嶚嶞幩幝幠幜緳廛廞廡彉徲憋憃慹憱憰憢憉\"],[\"e5a1\",\"憛憓憯憭憟憒憪憡憍慦憳戭摮摰撖撠撅撗撜撏撋撊撌撣撟摨撱撘敶敺敹敻斲斳暵暰暩暲暷暪暯樀樆樗槥槸樕槱槤樠槿槬槢樛樝槾樧槲槮樔槷槧橀樈槦槻樍槼槫樉樄樘樥樏槶樦樇槴樖歑殥殣殢殦氁氀毿氂潁漦潾澇濆澒\"],[\"e640\",\"澍澉澌潢潏澅潚澖潶潬澂潕潲潒潐潗澔澓潝漀潡潫潽潧澐潓澋潩潿澕潣潷潪潻熲熯熛熰熠熚熩熵熝熥熞熤熡熪熜熧熳犘犚獘獒獞獟獠獝獛獡獚獙\"],[\"e6a1\",\"獢璇璉璊璆璁瑽璅璈瑼瑹甈甇畾瘥瘞瘙瘝瘜瘣瘚瘨瘛皜皝皞皛瞍瞏瞉瞈磍碻磏磌磑磎磔磈磃磄磉禚禡禠禜禢禛歶稹窲窴窳箷篋箾箬篎箯箹篊箵糅糈糌糋緷緛緪緧緗緡縃緺緦緶緱緰緮緟罶羬羰羭翭翫翪翬翦翨聤聧膣膟\"],[\"e740\",\"膞膕膢膙膗舖艏艓艒艐艎艑蔤蔻蔏蔀蔩蔎蔉蔍蔟蔊蔧蔜蓻蔫蓺蔈蔌蓴蔪蓲蔕蓷蓫蓳蓼蔒蓪蓩蔖蓾蔨蔝蔮蔂蓽蔞蓶蔱蔦蓧蓨蓰蓯蓹蔘蔠蔰蔋蔙蔯虢\"],[\"e7a1\",\"蝖蝣蝤蝷蟡蝳蝘蝔蝛蝒蝡蝚蝑蝞蝭蝪蝐蝎蝟蝝蝯蝬蝺蝮蝜蝥蝏蝻蝵蝢蝧蝩衚褅褌褔褋褗褘褙褆褖褑褎褉覢覤覣觭觰觬諏諆誸諓諑諔諕誻諗誾諀諅諘諃誺誽諙谾豍貏賥賟賙賨賚賝賧趠趜趡趛踠踣踥踤踮踕踛踖踑踙踦踧\"],[\"e840\",\"踔踒踘踓踜踗踚輬輤輘輚輠輣輖輗遳遰遯遧遫鄯鄫鄩鄪鄲鄦鄮醅醆醊醁醂醄醀鋐鋃鋄鋀鋙銶鋏鋱鋟鋘鋩鋗鋝鋌鋯鋂鋨鋊鋈鋎鋦鋍鋕鋉鋠鋞鋧鋑鋓\"],[\"e8a1\",\"銵鋡鋆銴镼閬閫閮閰隤隢雓霅霈霂靚鞊鞎鞈韐韏頞頝頦頩頨頠頛頧颲餈飺餑餔餖餗餕駜駍駏駓駔駎駉駖駘駋駗駌骳髬髫髳髲髱魆魃魧魴魱魦魶魵魰魨魤魬鳼鳺鳽鳿鳷鴇鴀鳹鳻鴈鴅鴄麃黓鼏鼐儜儓儗儚儑凞匴叡噰噠噮\"],[\"e940\",\"噳噦噣噭噲噞噷圜圛壈墽壉墿墺壂墼壆嬗嬙嬛嬡嬔嬓嬐嬖嬨嬚嬠嬞寯嶬嶱嶩嶧嶵嶰嶮嶪嶨嶲嶭嶯嶴幧幨幦幯廩廧廦廨廥彋徼憝憨憖懅憴懆懁懌憺\"],[\"e9a1\",\"憿憸憌擗擖擐擏擉撽撉擃擛擳擙攳敿敼斢曈暾曀曊曋曏暽暻暺曌朣樴橦橉橧樲橨樾橝橭橶橛橑樨橚樻樿橁橪橤橐橏橔橯橩橠樼橞橖橕橍橎橆歕歔歖殧殪殫毈毇氄氃氆澭濋澣濇澼濎濈潞濄澽澞濊澨瀄澥澮澺澬澪濏澿澸\"],[\"ea40\",\"澢濉澫濍澯澲澰燅燂熿熸燖燀燁燋燔燊燇燏熽燘熼燆燚燛犝犞獩獦獧獬獥獫獪瑿璚璠璔璒璕璡甋疀瘯瘭瘱瘽瘳瘼瘵瘲瘰皻盦瞚瞝瞡瞜瞛瞢瞣瞕瞙\"],[\"eaa1\",\"瞗磝磩磥磪磞磣磛磡磢磭磟磠禤穄穈穇窶窸窵窱窷篞篣篧篝篕篥篚篨篹篔篪篢篜篫篘篟糒糔糗糐糑縒縡縗縌縟縠縓縎縜縕縚縢縋縏縖縍縔縥縤罃罻罼罺羱翯耪耩聬膱膦膮膹膵膫膰膬膴膲膷膧臲艕艖艗蕖蕅蕫蕍蕓蕡蕘\"],[\"eb40\",\"蕀蕆蕤蕁蕢蕄蕑蕇蕣蔾蕛蕱蕎蕮蕵蕕蕧蕠薌蕦蕝蕔蕥蕬虣虥虤螛螏螗螓螒螈螁螖螘蝹螇螣螅螐螑螝螄螔螜螚螉褞褦褰褭褮褧褱褢褩褣褯褬褟觱諠\"],[\"eba1\",\"諢諲諴諵諝謔諤諟諰諈諞諡諨諿諯諻貑貒貐賵賮賱賰賳赬赮趥趧踳踾踸蹀蹅踶踼踽蹁踰踿躽輶輮輵輲輹輷輴遶遹遻邆郺鄳鄵鄶醓醐醑醍醏錧錞錈錟錆錏鍺錸錼錛錣錒錁鍆錭錎錍鋋錝鋺錥錓鋹鋷錴錂錤鋿錩錹錵錪錔錌\"],[\"ec40\",\"錋鋾錉錀鋻錖閼闍閾閹閺閶閿閵閽隩雔霋霒霐鞙鞗鞔韰韸頵頯頲餤餟餧餩馞駮駬駥駤駰駣駪駩駧骹骿骴骻髶髺髹髷鬳鮀鮅鮇魼魾魻鮂鮓鮒鮐魺鮕\"],[\"eca1\",\"魽鮈鴥鴗鴠鴞鴔鴩鴝鴘鴢鴐鴙鴟麈麆麇麮麭黕黖黺鼒鼽儦儥儢儤儠儩勴嚓嚌嚍嚆嚄嚃噾嚂噿嚁壖壔壏壒嬭嬥嬲嬣嬬嬧嬦嬯嬮孻寱寲嶷幬幪徾徻懃憵憼懧懠懥懤懨懞擯擩擣擫擤擨斁斀斶旚曒檍檖檁檥檉檟檛檡檞檇檓檎\"],[\"ed40\",\"檕檃檨檤檑橿檦檚檅檌檒歛殭氉濌澩濴濔濣濜濭濧濦濞濲濝濢濨燡燱燨燲燤燰燢獳獮獯璗璲璫璐璪璭璱璥璯甐甑甒甏疄癃癈癉癇皤盩瞵瞫瞲瞷瞶\"],[\"eda1\",\"瞴瞱瞨矰磳磽礂磻磼磲礅磹磾礄禫禨穜穛穖穘穔穚窾竀竁簅簏篲簀篿篻簎篴簋篳簂簉簃簁篸篽簆篰篱簐簊糨縭縼繂縳顈縸縪繉繀繇縩繌縰縻縶繄縺罅罿罾罽翴翲耬膻臄臌臊臅臇膼臩艛艚艜薃薀薏薧薕薠薋薣蕻薤薚薞\"],[\"ee40\",\"蕷蕼薉薡蕺蕸蕗薎薖薆薍薙薝薁薢薂薈薅蕹蕶薘薐薟虨螾螪螭蟅螰螬螹螵螼螮蟉蟃蟂蟌螷螯蟄蟊螴螶螿螸螽蟞螲褵褳褼褾襁襒褷襂覭覯覮觲觳謞\"],[\"eea1\",\"謘謖謑謅謋謢謏謒謕謇謍謈謆謜謓謚豏豰豲豱豯貕貔賹赯蹎蹍蹓蹐蹌蹇轃轀邅遾鄸醚醢醛醙醟醡醝醠鎡鎃鎯鍤鍖鍇鍼鍘鍜鍶鍉鍐鍑鍠鍭鎏鍌鍪鍹鍗鍕鍒鍏鍱鍷鍻鍡鍞鍣鍧鎀鍎鍙闇闀闉闃闅閷隮隰隬霠霟霘霝霙鞚鞡鞜\"],[\"ef40\",\"鞞鞝韕韔韱顁顄顊顉顅顃餥餫餬餪餳餲餯餭餱餰馘馣馡騂駺駴駷駹駸駶駻駽駾駼騃骾髾髽鬁髼魈鮚鮨鮞鮛鮦鮡鮥鮤鮆鮢鮠鮯鴳鵁鵧鴶鴮鴯鴱鴸鴰\"],[\"efa1\",\"鵅鵂鵃鴾鴷鵀鴽翵鴭麊麉麍麰黈黚黻黿鼤鼣鼢齔龠儱儭儮嚘嚜嚗嚚嚝嚙奰嬼屩屪巀幭幮懘懟懭懮懱懪懰懫懖懩擿攄擽擸攁攃擼斔旛曚曛曘櫅檹檽櫡櫆檺檶檷櫇檴檭歞毉氋瀇瀌瀍瀁瀅瀔瀎濿瀀濻瀦濼濷瀊爁燿燹爃燽獶\"],[\"f040\",\"璸瓀璵瓁璾璶璻瓂甔甓癜癤癙癐癓癗癚皦皽盬矂瞺磿礌礓礔礉礐礒礑禭禬穟簜簩簙簠簟簭簝簦簨簢簥簰繜繐繖繣繘繢繟繑繠繗繓羵羳翷翸聵臑臒\"],[\"f0a1\",\"臐艟艞薴藆藀藃藂薳薵薽藇藄薿藋藎藈藅薱薶藒蘤薸薷薾虩蟧蟦蟢蟛蟫蟪蟥蟟蟳蟤蟔蟜蟓蟭蟘蟣螤蟗蟙蠁蟴蟨蟝襓襋襏襌襆襐襑襉謪謧謣謳謰謵譇謯謼謾謱謥謷謦謶謮謤謻謽謺豂豵貙貘貗賾贄贂贀蹜蹢蹠蹗蹖蹞蹥蹧\"],[\"f140\",\"蹛蹚蹡蹝蹩蹔轆轇轈轋鄨鄺鄻鄾醨醥醧醯醪鎵鎌鎒鎷鎛鎝鎉鎧鎎鎪鎞鎦鎕鎈鎙鎟鎍鎱鎑鎲鎤鎨鎴鎣鎥闒闓闑隳雗雚巂雟雘雝霣霢霥鞬鞮鞨鞫鞤鞪\"],[\"f1a1\",\"鞢鞥韗韙韖韘韺顐顑顒颸饁餼餺騏騋騉騍騄騑騊騅騇騆髀髜鬈鬄鬅鬩鬵魊魌魋鯇鯆鯃鮿鯁鮵鮸鯓鮶鯄鮹鮽鵜鵓鵏鵊鵛鵋鵙鵖鵌鵗鵒鵔鵟鵘鵚麎麌黟鼁鼀鼖鼥鼫鼪鼩鼨齌齕儴儵劖勷厴嚫嚭嚦嚧嚪嚬壚壝壛夒嬽嬾嬿巃幰\"],[\"f240\",\"徿懻攇攐攍攉攌攎斄旞旝曞櫧櫠櫌櫑櫙櫋櫟櫜櫐櫫櫏櫍櫞歠殰氌瀙瀧瀠瀖瀫瀡瀢瀣瀩瀗瀤瀜瀪爌爊爇爂爅犥犦犤犣犡瓋瓅璷瓃甖癠矉矊矄矱礝礛\"],[\"f2a1\",\"礡礜礗礞禰穧穨簳簼簹簬簻糬糪繶繵繸繰繷繯繺繲繴繨罋罊羃羆羷翽翾聸臗臕艤艡艣藫藱藭藙藡藨藚藗藬藲藸藘藟藣藜藑藰藦藯藞藢蠀蟺蠃蟶蟷蠉蠌蠋蠆蟼蠈蟿蠊蠂襢襚襛襗襡襜襘襝襙覈覷覶觶譐譈譊譀譓譖譔譋譕\"],[\"f340\",\"譑譂譒譗豃豷豶貚贆贇贉趬趪趭趫蹭蹸蹳蹪蹯蹻軂轒轑轏轐轓辴酀鄿醰醭鏞鏇鏏鏂鏚鏐鏹鏬鏌鏙鎩鏦鏊鏔鏮鏣鏕鏄鏎鏀鏒鏧镽闚闛雡霩霫霬霨霦\"],[\"f3a1\",\"鞳鞷鞶韝韞韟顜顙顝顗颿颽颻颾饈饇饃馦馧騚騕騥騝騤騛騢騠騧騣騞騜騔髂鬋鬊鬎鬌鬷鯪鯫鯠鯞鯤鯦鯢鯰鯔鯗鯬鯜鯙鯥鯕鯡鯚鵷鶁鶊鶄鶈鵱鶀鵸鶆鶋鶌鵽鵫鵴鵵鵰鵩鶅鵳鵻鶂鵯鵹鵿鶇鵨麔麑黀黼鼭齀齁齍齖齗齘匷嚲\"],[\"f440\",\"嚵嚳壣孅巆巇廮廯忀忁懹攗攖攕攓旟曨曣曤櫳櫰櫪櫨櫹櫱櫮櫯瀼瀵瀯瀷瀴瀱灂瀸瀿瀺瀹灀瀻瀳灁爓爔犨獽獼璺皫皪皾盭矌矎矏矍矲礥礣礧礨礤礩\"],[\"f4a1\",\"禲穮穬穭竷籉籈籊籇籅糮繻繾纁纀羺翿聹臛臙舋艨艩蘢藿蘁藾蘛蘀藶蘄蘉蘅蘌藽蠙蠐蠑蠗蠓蠖襣襦覹觷譠譪譝譨譣譥譧譭趮躆躈躄轙轖轗轕轘轚邍酃酁醷醵醲醳鐋鐓鏻鐠鐏鐔鏾鐕鐐鐨鐙鐍鏵鐀鏷鐇鐎鐖鐒鏺鐉鏸鐊鏿\"],[\"f540\",\"鏼鐌鏶鐑鐆闞闠闟霮霯鞹鞻韽韾顠顢顣顟飁飂饐饎饙饌饋饓騲騴騱騬騪騶騩騮騸騭髇髊髆鬐鬒鬑鰋鰈鯷鰅鰒鯸鱀鰇鰎鰆鰗鰔鰉鶟鶙鶤鶝鶒鶘鶐鶛\"],[\"f5a1\",\"鶠鶔鶜鶪鶗鶡鶚鶢鶨鶞鶣鶿鶩鶖鶦鶧麙麛麚黥黤黧黦鼰鼮齛齠齞齝齙龑儺儹劘劗囃嚽嚾孈孇巋巏廱懽攛欂櫼欃櫸欀灃灄灊灈灉灅灆爝爚爙獾甗癪矐礭礱礯籔籓糲纊纇纈纋纆纍罍羻耰臝蘘蘪蘦蘟蘣蘜蘙蘧蘮蘡蘠蘩蘞蘥\"],[\"f640\",\"蠩蠝蠛蠠蠤蠜蠫衊襭襩襮襫觺譹譸譅譺譻贐贔趯躎躌轞轛轝酆酄酅醹鐿鐻鐶鐩鐽鐼鐰鐹鐪鐷鐬鑀鐱闥闤闣霵霺鞿韡顤飉飆飀饘饖騹騽驆驄驂驁騺\"],[\"f6a1\",\"騿髍鬕鬗鬘鬖鬺魒鰫鰝鰜鰬鰣鰨鰩鰤鰡鶷鶶鶼鷁鷇鷊鷏鶾鷅鷃鶻鶵鷎鶹鶺鶬鷈鶱鶭鷌鶳鷍鶲鹺麜黫黮黭鼛鼘鼚鼱齎齥齤龒亹囆囅囋奱孋孌巕巑廲攡攠攦攢欋欈欉氍灕灖灗灒爞爟犩獿瓘瓕瓙瓗癭皭礵禴穰穱籗籜籙籛籚\"],[\"f740\",\"糴糱纑罏羇臞艫蘴蘵蘳蘬蘲蘶蠬蠨蠦蠪蠥襱覿覾觻譾讄讂讆讅譿贕躕躔躚躒躐躖躗轠轢酇鑌鑐鑊鑋鑏鑇鑅鑈鑉鑆霿韣顪顩飋饔饛驎驓驔驌驏驈驊\"],[\"f7a1\",\"驉驒驐髐鬙鬫鬻魖魕鱆鱈鰿鱄鰹鰳鱁鰼鰷鰴鰲鰽鰶鷛鷒鷞鷚鷋鷐鷜鷑鷟鷩鷙鷘鷖鷵鷕鷝麶黰鼵鼳鼲齂齫龕龢儽劙壨壧奲孍巘蠯彏戁戃戄攩攥斖曫欑欒欏毊灛灚爢玂玁玃癰矔籧籦纕艬蘺虀蘹蘼蘱蘻蘾蠰蠲蠮蠳襶襴襳觾\"],[\"f840\",\"讌讎讋讈豅贙躘轤轣醼鑢鑕鑝鑗鑞韄韅頀驖驙鬞鬟鬠鱒鱘鱐鱊鱍鱋鱕鱙鱌鱎鷻鷷鷯鷣鷫鷸鷤鷶鷡鷮鷦鷲鷰鷢鷬鷴鷳鷨鷭黂黐黲黳鼆鼜鼸鼷鼶齃齏\"],[\"f8a1\",\"齱齰齮齯囓囍孎屭攭曭曮欓灟灡灝灠爣瓛瓥矕礸禷禶籪纗羉艭虃蠸蠷蠵衋讔讕躞躟躠躝醾醽釂鑫鑨鑩雥靆靃靇韇韥驞髕魙鱣鱧鱦鱢鱞鱠鸂鷾鸇鸃鸆鸅鸀鸁鸉鷿鷽鸄麠鼞齆齴齵齶囔攮斸欘欙欗欚灢爦犪矘矙礹籩籫糶纚\"],[\"f940\",\"纘纛纙臠臡虆虇虈襹襺襼襻觿讘讙躥躤躣鑮鑭鑯鑱鑳靉顲饟鱨鱮鱭鸋鸍鸐鸏鸒鸑麡黵鼉齇齸齻齺齹圞灦籯蠼趲躦釃鑴鑸鑶鑵驠鱴鱳鱱鱵鸔鸓黶鼊\"],[\"f9a1\",\"龤灨灥糷虪蠾蠽蠿讞貜躩軉靋顳顴飌饡馫驤驦驧鬤鸕鸗齈戇欞爧虌躨钂钀钁驩驨鬮鸙爩虋讟钃鱹麷癵驫鱺鸝灩灪麤齾齉龘碁銹裏墻恒粧嫺╔╦╗╠╬╣╚╩╝╒╤╕╞╪╡╘╧╛╓╥╖╟╫╢╙╨╜║═╭╮╰╯▓\"]]");
  13462. /***/ }),
  13463. /* 178 */
  13464. /***/ (function(module, exports, __webpack_require__) {
  13465. // Generated by CoffeeScript 1.7.1
  13466. (function() {
  13467. var ArrayT, NumberT, utils;
  13468. NumberT = __webpack_require__(49).Number;
  13469. utils = __webpack_require__(26);
  13470. ArrayT = (function() {
  13471. function ArrayT(type, length, lengthType) {
  13472. this.type = type;
  13473. this.length = length;
  13474. this.lengthType = lengthType != null ? lengthType : 'count';
  13475. }
  13476. ArrayT.prototype.decode = function(stream, parent) {
  13477. var ctx, i, length, pos, res, target, _i;
  13478. pos = stream.pos;
  13479. res = [];
  13480. ctx = parent;
  13481. if (this.length != null) {
  13482. length = utils.resolveLength(this.length, stream, parent);
  13483. }
  13484. if (this.length instanceof NumberT) {
  13485. Object.defineProperties(res, {
  13486. parent: {
  13487. value: parent
  13488. },
  13489. _startOffset: {
  13490. value: pos
  13491. },
  13492. _currentOffset: {
  13493. value: 0,
  13494. writable: true
  13495. },
  13496. _length: {
  13497. value: length
  13498. }
  13499. });
  13500. ctx = res;
  13501. }
  13502. if ((length == null) || this.lengthType === 'bytes') {
  13503. target = length != null ? stream.pos + length : (parent != null ? parent._length : void 0) ? parent._startOffset + parent._length : stream.length;
  13504. while (stream.pos < target) {
  13505. res.push(this.type.decode(stream, ctx));
  13506. }
  13507. } else {
  13508. for (i = _i = 0; _i < length; i = _i += 1) {
  13509. res.push(this.type.decode(stream, ctx));
  13510. }
  13511. }
  13512. return res;
  13513. };
  13514. ArrayT.prototype.size = function(array, ctx) {
  13515. var item, size, _i, _len;
  13516. if (!array) {
  13517. return this.type.size(null, ctx) * utils.resolveLength(this.length, null, ctx);
  13518. }
  13519. size = 0;
  13520. if (this.length instanceof NumberT) {
  13521. size += this.length.size();
  13522. ctx = {
  13523. parent: ctx
  13524. };
  13525. }
  13526. for (_i = 0, _len = array.length; _i < _len; _i++) {
  13527. item = array[_i];
  13528. size += this.type.size(item, ctx);
  13529. }
  13530. return size;
  13531. };
  13532. ArrayT.prototype.encode = function(stream, array, parent) {
  13533. var ctx, i, item, ptr, _i, _len;
  13534. ctx = parent;
  13535. if (this.length instanceof NumberT) {
  13536. ctx = {
  13537. pointers: [],
  13538. startOffset: stream.pos,
  13539. parent: parent
  13540. };
  13541. ctx.pointerOffset = stream.pos + this.size(array, ctx);
  13542. this.length.encode(stream, array.length);
  13543. }
  13544. for (_i = 0, _len = array.length; _i < _len; _i++) {
  13545. item = array[_i];
  13546. this.type.encode(stream, item, ctx);
  13547. }
  13548. if (this.length instanceof NumberT) {
  13549. i = 0;
  13550. while (i < ctx.pointers.length) {
  13551. ptr = ctx.pointers[i++];
  13552. ptr.type.encode(stream, ptr.val);
  13553. }
  13554. }
  13555. };
  13556. return ArrayT;
  13557. })();
  13558. module.exports = ArrayT;
  13559. }).call(this);
  13560. /***/ }),
  13561. /* 179 */
  13562. /***/ (function(module, exports, __webpack_require__) {
  13563. // Generated by CoffeeScript 1.7.1
  13564. (function() {
  13565. var Struct, utils;
  13566. utils = __webpack_require__(26);
  13567. Struct = (function() {
  13568. function Struct(fields) {
  13569. this.fields = fields != null ? fields : {};
  13570. }
  13571. Struct.prototype.decode = function(stream, parent, length) {
  13572. var res, _ref;
  13573. if (length == null) {
  13574. length = 0;
  13575. }
  13576. res = this._setup(stream, parent, length);
  13577. this._parseFields(stream, res, this.fields);
  13578. if ((_ref = this.process) != null) {
  13579. _ref.call(res, stream);
  13580. }
  13581. return res;
  13582. };
  13583. Struct.prototype._setup = function(stream, parent, length) {
  13584. var res;
  13585. res = {};
  13586. Object.defineProperties(res, {
  13587. parent: {
  13588. value: parent
  13589. },
  13590. _startOffset: {
  13591. value: stream.pos
  13592. },
  13593. _currentOffset: {
  13594. value: 0,
  13595. writable: true
  13596. },
  13597. _length: {
  13598. value: length
  13599. }
  13600. });
  13601. return res;
  13602. };
  13603. Struct.prototype._parseFields = function(stream, res, fields) {
  13604. var key, type, val;
  13605. for (key in fields) {
  13606. type = fields[key];
  13607. if (typeof type === 'function') {
  13608. val = type.call(res, res);
  13609. } else {
  13610. val = type.decode(stream, res);
  13611. }
  13612. if (val !== void 0) {
  13613. if (val instanceof utils.PropertyDescriptor) {
  13614. Object.defineProperty(res, key, val);
  13615. } else {
  13616. res[key] = val;
  13617. }
  13618. }
  13619. res._currentOffset = stream.pos - res._startOffset;
  13620. }
  13621. };
  13622. Struct.prototype.size = function(val, parent, includePointers) {
  13623. var ctx, key, size, type, _ref;
  13624. if (val == null) {
  13625. val = {};
  13626. }
  13627. if (includePointers == null) {
  13628. includePointers = true;
  13629. }
  13630. ctx = {
  13631. parent: parent,
  13632. val: val,
  13633. pointerSize: 0
  13634. };
  13635. size = 0;
  13636. _ref = this.fields;
  13637. for (key in _ref) {
  13638. type = _ref[key];
  13639. if (type.size != null) {
  13640. size += type.size(val[key], ctx);
  13641. }
  13642. }
  13643. if (includePointers) {
  13644. size += ctx.pointerSize;
  13645. }
  13646. return size;
  13647. };
  13648. Struct.prototype.encode = function(stream, val, parent) {
  13649. var ctx, i, key, ptr, type, _ref, _ref1;
  13650. if ((_ref = this.preEncode) != null) {
  13651. _ref.call(val, stream);
  13652. }
  13653. ctx = {
  13654. pointers: [],
  13655. startOffset: stream.pos,
  13656. parent: parent,
  13657. val: val,
  13658. pointerSize: 0
  13659. };
  13660. ctx.pointerOffset = stream.pos + this.size(val, ctx, false);
  13661. _ref1 = this.fields;
  13662. for (key in _ref1) {
  13663. type = _ref1[key];
  13664. if (type.encode != null) {
  13665. type.encode(stream, val[key], ctx);
  13666. }
  13667. }
  13668. i = 0;
  13669. while (i < ctx.pointers.length) {
  13670. ptr = ctx.pointers[i++];
  13671. ptr.type.encode(stream, ptr.val, ptr.parent);
  13672. }
  13673. };
  13674. return Struct;
  13675. })();
  13676. module.exports = Struct;
  13677. }).call(this);
  13678. /***/ }),
  13679. /* 180 */
  13680. /***/ (function(module, exports, __webpack_require__) {
  13681. module.exports = !__webpack_require__(13) && !__webpack_require__(37)(function () {
  13682. return Object.defineProperty(__webpack_require__(181)('div'), 'a', { get: function () { return 7; } }).a != 7;
  13683. });
  13684. /***/ }),
  13685. /* 181 */
  13686. /***/ (function(module, exports, __webpack_require__) {
  13687. var isObject = __webpack_require__(20);
  13688. var document = __webpack_require__(21).document;
  13689. // typeof document.createElement is 'object' in old IE
  13690. var is = isObject(document) && isObject(document.createElement);
  13691. module.exports = function (it) {
  13692. return is ? document.createElement(it) : {};
  13693. };
  13694. /***/ }),
  13695. /* 182 */
  13696. /***/ (function(module, exports) {
  13697. module.exports = function (it) {
  13698. if (typeof it != 'function') throw TypeError(it + ' is not a function!');
  13699. return it;
  13700. };
  13701. /***/ }),
  13702. /* 183 */
  13703. /***/ (function(module, exports) {
  13704. module.exports = function (done, value) {
  13705. return { value: value, done: !!done };
  13706. };
  13707. /***/ }),
  13708. /* 184 */
  13709. /***/ (function(module, exports, __webpack_require__) {
  13710. module.exports = __webpack_require__(27);
  13711. /***/ }),
  13712. /* 185 */
  13713. /***/ (function(module, exports, __webpack_require__) {
  13714. var dP = __webpack_require__(17);
  13715. var anObject = __webpack_require__(28);
  13716. var getKeys = __webpack_require__(59);
  13717. module.exports = __webpack_require__(13) ? Object.defineProperties : function defineProperties(O, Properties) {
  13718. anObject(O);
  13719. var keys = getKeys(Properties);
  13720. var length = keys.length;
  13721. var i = 0;
  13722. var P;
  13723. while (length > i) dP.f(O, P = keys[i++], Properties[P]);
  13724. return O;
  13725. };
  13726. /***/ }),
  13727. /* 186 */
  13728. /***/ (function(module, exports, __webpack_require__) {
  13729. var has = __webpack_require__(36);
  13730. var toIObject = __webpack_require__(35);
  13731. var arrayIndexOf = __webpack_require__(340)(false);
  13732. var IE_PROTO = __webpack_require__(118)('IE_PROTO');
  13733. module.exports = function (object, names) {
  13734. var O = toIObject(object);
  13735. var i = 0;
  13736. var result = [];
  13737. var key;
  13738. for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);
  13739. // Don't enum bug & hidden keys
  13740. while (names.length > i) if (has(O, key = names[i++])) {
  13741. ~arrayIndexOf(result, key) || result.push(key);
  13742. }
  13743. return result;
  13744. };
  13745. /***/ }),
  13746. /* 187 */
  13747. /***/ (function(module, exports, __webpack_require__) {
  13748. var toInteger = __webpack_require__(117);
  13749. var max = Math.max;
  13750. var min = Math.min;
  13751. module.exports = function (index, length) {
  13752. index = toInteger(index);
  13753. return index < 0 ? max(index + length, 0) : min(index, length);
  13754. };
  13755. /***/ }),
  13756. /* 188 */
  13757. /***/ (function(module, exports, __webpack_require__) {
  13758. // getting tag from 19.1.3.6 Object.prototype.toString()
  13759. var cof = __webpack_require__(111);
  13760. var TAG = __webpack_require__(14)('toStringTag');
  13761. // ES3 wrong here
  13762. var ARG = cof(function () { return arguments; }()) == 'Arguments';
  13763. // fallback for IE11 Script Access Denied error
  13764. var tryGet = function (it, key) {
  13765. try {
  13766. return it[key];
  13767. } catch (e) { /* empty */ }
  13768. };
  13769. module.exports = function (it) {
  13770. var O, T, B;
  13771. return it === undefined ? 'Undefined' : it === null ? 'Null'
  13772. // @@toStringTag case
  13773. : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T
  13774. // builtinTag case
  13775. : ARG ? cof(O)
  13776. // ES3 arguments fallback
  13777. : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;
  13778. };
  13779. /***/ }),
  13780. /* 189 */
  13781. /***/ (function(module, exports, __webpack_require__) {
  13782. // 7.2.2 IsArray(argument)
  13783. var cof = __webpack_require__(111);
  13784. module.exports = Array.isArray || function isArray(arg) {
  13785. return cof(arg) == 'Array';
  13786. };
  13787. /***/ }),
  13788. /* 190 */
  13789. /***/ (function(module, exports, __webpack_require__) {
  13790. // 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)
  13791. var $keys = __webpack_require__(186);
  13792. var hiddenKeys = __webpack_require__(120).concat('length', 'prototype');
  13793. exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
  13794. return $keys(O, hiddenKeys);
  13795. };
  13796. /***/ }),
  13797. /* 191 */
  13798. /***/ (function(module, exports, __webpack_require__) {
  13799. module.exports = { "default": __webpack_require__(360), __esModule: true };
  13800. /***/ }),
  13801. /* 192 */
  13802. /***/ (function(module, exports, __webpack_require__) {
  13803. "use strict";
  13804. var dP = __webpack_require__(17).f;
  13805. var create = __webpack_require__(76);
  13806. var redefineAll = __webpack_require__(193);
  13807. var ctx = __webpack_require__(38);
  13808. var anInstance = __webpack_require__(194);
  13809. var forOf = __webpack_require__(81);
  13810. var $iterDefine = __webpack_require__(116);
  13811. var step = __webpack_require__(183);
  13812. var setSpecies = __webpack_require__(367);
  13813. var DESCRIPTORS = __webpack_require__(13);
  13814. var fastKey = __webpack_require__(80).fastKey;
  13815. var validate = __webpack_require__(127);
  13816. var SIZE = DESCRIPTORS ? '_s' : 'size';
  13817. var getEntry = function (that, key) {
  13818. // fast case
  13819. var index = fastKey(key);
  13820. var entry;
  13821. if (index !== 'F') return that._i[index];
  13822. // frozen object case
  13823. for (entry = that._f; entry; entry = entry.n) {
  13824. if (entry.k == key) return entry;
  13825. }
  13826. };
  13827. module.exports = {
  13828. getConstructor: function (wrapper, NAME, IS_MAP, ADDER) {
  13829. var C = wrapper(function (that, iterable) {
  13830. anInstance(that, C, NAME, '_i');
  13831. that._t = NAME; // collection type
  13832. that._i = create(null); // index
  13833. that._f = undefined; // first entry
  13834. that._l = undefined; // last entry
  13835. that[SIZE] = 0; // size
  13836. if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);
  13837. });
  13838. redefineAll(C.prototype, {
  13839. // 23.1.3.1 Map.prototype.clear()
  13840. // 23.2.3.2 Set.prototype.clear()
  13841. clear: function clear() {
  13842. for (var that = validate(this, NAME), data = that._i, entry = that._f; entry; entry = entry.n) {
  13843. entry.r = true;
  13844. if (entry.p) entry.p = entry.p.n = undefined;
  13845. delete data[entry.i];
  13846. }
  13847. that._f = that._l = undefined;
  13848. that[SIZE] = 0;
  13849. },
  13850. // 23.1.3.3 Map.prototype.delete(key)
  13851. // 23.2.3.4 Set.prototype.delete(value)
  13852. 'delete': function (key) {
  13853. var that = validate(this, NAME);
  13854. var entry = getEntry(that, key);
  13855. if (entry) {
  13856. var next = entry.n;
  13857. var prev = entry.p;
  13858. delete that._i[entry.i];
  13859. entry.r = true;
  13860. if (prev) prev.n = next;
  13861. if (next) next.p = prev;
  13862. if (that._f == entry) that._f = next;
  13863. if (that._l == entry) that._l = prev;
  13864. that[SIZE]--;
  13865. } return !!entry;
  13866. },
  13867. // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)
  13868. // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)
  13869. forEach: function forEach(callbackfn /* , that = undefined */) {
  13870. validate(this, NAME);
  13871. var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3);
  13872. var entry;
  13873. while (entry = entry ? entry.n : this._f) {
  13874. f(entry.v, entry.k, this);
  13875. // revert to the last existing entry
  13876. while (entry && entry.r) entry = entry.p;
  13877. }
  13878. },
  13879. // 23.1.3.7 Map.prototype.has(key)
  13880. // 23.2.3.7 Set.prototype.has(value)
  13881. has: function has(key) {
  13882. return !!getEntry(validate(this, NAME), key);
  13883. }
  13884. });
  13885. if (DESCRIPTORS) dP(C.prototype, 'size', {
  13886. get: function () {
  13887. return validate(this, NAME)[SIZE];
  13888. }
  13889. });
  13890. return C;
  13891. },
  13892. def: function (that, key, value) {
  13893. var entry = getEntry(that, key);
  13894. var prev, index;
  13895. // change existing entry
  13896. if (entry) {
  13897. entry.v = value;
  13898. // create new entry
  13899. } else {
  13900. that._l = entry = {
  13901. i: index = fastKey(key, true), // <- index
  13902. k: key, // <- key
  13903. v: value, // <- value
  13904. p: prev = that._l, // <- previous entry
  13905. n: undefined, // <- next entry
  13906. r: false // <- removed
  13907. };
  13908. if (!that._f) that._f = entry;
  13909. if (prev) prev.n = entry;
  13910. that[SIZE]++;
  13911. // add to index
  13912. if (index !== 'F') that._i[index] = entry;
  13913. } return that;
  13914. },
  13915. getEntry: getEntry,
  13916. setStrong: function (C, NAME, IS_MAP) {
  13917. // add .keys, .values, .entries, [@@iterator]
  13918. // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11
  13919. $iterDefine(C, NAME, function (iterated, kind) {
  13920. this._t = validate(iterated, NAME); // target
  13921. this._k = kind; // kind
  13922. this._l = undefined; // previous
  13923. }, function () {
  13924. var that = this;
  13925. var kind = that._k;
  13926. var entry = that._l;
  13927. // revert to the last existing entry
  13928. while (entry && entry.r) entry = entry.p;
  13929. // get next entry
  13930. if (!that._t || !(that._l = entry = entry ? entry.n : that._t._f)) {
  13931. // or finish the iteration
  13932. that._t = undefined;
  13933. return step(1);
  13934. }
  13935. // return step by kind
  13936. if (kind == 'keys') return step(0, entry.k);
  13937. if (kind == 'values') return step(0, entry.v);
  13938. return step(0, [entry.k, entry.v]);
  13939. }, IS_MAP ? 'entries' : 'values', !IS_MAP, true);
  13940. // add [@@species], 23.1.2.2, 23.2.2.2
  13941. setSpecies(NAME);
  13942. }
  13943. };
  13944. /***/ }),
  13945. /* 193 */
  13946. /***/ (function(module, exports, __webpack_require__) {
  13947. var hide = __webpack_require__(27);
  13948. module.exports = function (target, src, safe) {
  13949. for (var key in src) {
  13950. if (safe && target[key]) target[key] = src[key];
  13951. else hide(target, key, src[key]);
  13952. } return target;
  13953. };
  13954. /***/ }),
  13955. /* 194 */
  13956. /***/ (function(module, exports) {
  13957. module.exports = function (it, Constructor, name, forbiddenField) {
  13958. if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) {
  13959. throw TypeError(name + ': incorrect invocation!');
  13960. } return it;
  13961. };
  13962. /***/ }),
  13963. /* 195 */
  13964. /***/ (function(module, exports, __webpack_require__) {
  13965. // call something on iterator step with safe closing on error
  13966. var anObject = __webpack_require__(28);
  13967. module.exports = function (iterator, fn, value, entries) {
  13968. try {
  13969. return entries ? fn(anObject(value)[0], value[1]) : fn(value);
  13970. // 7.4.6 IteratorClose(iterator, completion)
  13971. } catch (e) {
  13972. var ret = iterator['return'];
  13973. if (ret !== undefined) anObject(ret.call(iterator));
  13974. throw e;
  13975. }
  13976. };
  13977. /***/ }),
  13978. /* 196 */
  13979. /***/ (function(module, exports, __webpack_require__) {
  13980. // check on default Array iterator
  13981. var Iterators = __webpack_require__(58);
  13982. var ITERATOR = __webpack_require__(14)('iterator');
  13983. var ArrayProto = Array.prototype;
  13984. module.exports = function (it) {
  13985. return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it);
  13986. };
  13987. /***/ }),
  13988. /* 197 */
  13989. /***/ (function(module, exports, __webpack_require__) {
  13990. "use strict";
  13991. var global = __webpack_require__(21);
  13992. var $export = __webpack_require__(7);
  13993. var meta = __webpack_require__(80);
  13994. var fails = __webpack_require__(37);
  13995. var hide = __webpack_require__(27);
  13996. var redefineAll = __webpack_require__(193);
  13997. var forOf = __webpack_require__(81);
  13998. var anInstance = __webpack_require__(194);
  13999. var isObject = __webpack_require__(20);
  14000. var setToStringTag = __webpack_require__(79);
  14001. var dP = __webpack_require__(17).f;
  14002. var each = __webpack_require__(368)(0);
  14003. var DESCRIPTORS = __webpack_require__(13);
  14004. module.exports = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) {
  14005. var Base = global[NAME];
  14006. var C = Base;
  14007. var ADDER = IS_MAP ? 'set' : 'add';
  14008. var proto = C && C.prototype;
  14009. var O = {};
  14010. if (!DESCRIPTORS || typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function () {
  14011. new C().entries().next();
  14012. }))) {
  14013. // create collection constructor
  14014. C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER);
  14015. redefineAll(C.prototype, methods);
  14016. meta.NEED = true;
  14017. } else {
  14018. C = wrapper(function (target, iterable) {
  14019. anInstance(target, C, NAME, '_c');
  14020. target._c = new Base();
  14021. if (iterable != undefined) forOf(iterable, IS_MAP, target[ADDER], target);
  14022. });
  14023. each('add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON'.split(','), function (KEY) {
  14024. var IS_ADDER = KEY == 'add' || KEY == 'set';
  14025. if (KEY in proto && !(IS_WEAK && KEY == 'clear')) hide(C.prototype, KEY, function (a, b) {
  14026. anInstance(this, C, KEY);
  14027. if (!IS_ADDER && IS_WEAK && !isObject(a)) return KEY == 'get' ? undefined : false;
  14028. var result = this._c[KEY](a === 0 ? 0 : a, b);
  14029. return IS_ADDER ? this : result;
  14030. });
  14031. });
  14032. IS_WEAK || dP(C.prototype, 'size', {
  14033. get: function () {
  14034. return this._c.size;
  14035. }
  14036. });
  14037. }
  14038. setToStringTag(C, NAME);
  14039. O[NAME] = C;
  14040. $export($export.G + $export.W + $export.F, O);
  14041. if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP);
  14042. return C;
  14043. };
  14044. /***/ }),
  14045. /* 198 */
  14046. /***/ (function(module, exports, __webpack_require__) {
  14047. // https://github.com/DavidBruant/Map-Set.prototype.toJSON
  14048. var classof = __webpack_require__(188);
  14049. var from = __webpack_require__(372);
  14050. module.exports = function (NAME) {
  14051. return function toJSON() {
  14052. if (classof(this) != NAME) throw TypeError(NAME + "#toJSON isn't generic");
  14053. return from(this);
  14054. };
  14055. };
  14056. /***/ }),
  14057. /* 199 */
  14058. /***/ (function(module, exports, __webpack_require__) {
  14059. "use strict";
  14060. // https://tc39.github.io/proposal-setmap-offrom/
  14061. var $export = __webpack_require__(7);
  14062. module.exports = function (COLLECTION) {
  14063. $export($export.S, COLLECTION, { of: function of() {
  14064. var length = arguments.length;
  14065. var A = new Array(length);
  14066. while (length--) A[length] = arguments[length];
  14067. return new this(A);
  14068. } });
  14069. };
  14070. /***/ }),
  14071. /* 200 */
  14072. /***/ (function(module, exports, __webpack_require__) {
  14073. "use strict";
  14074. // https://tc39.github.io/proposal-setmap-offrom/
  14075. var $export = __webpack_require__(7);
  14076. var aFunction = __webpack_require__(182);
  14077. var ctx = __webpack_require__(38);
  14078. var forOf = __webpack_require__(81);
  14079. module.exports = function (COLLECTION) {
  14080. $export($export.S, COLLECTION, { from: function from(source /* , mapFn, thisArg */) {
  14081. var mapFn = arguments[1];
  14082. var mapping, A, n, cb;
  14083. aFunction(this);
  14084. mapping = mapFn !== undefined;
  14085. if (mapping) aFunction(mapFn);
  14086. if (source == undefined) return new this();
  14087. A = [];
  14088. if (mapping) {
  14089. n = 0;
  14090. cb = ctx(mapFn, arguments[2], 2);
  14091. forOf(source, false, function (nextItem) {
  14092. A.push(cb(nextItem, n++));
  14093. });
  14094. } else {
  14095. forOf(source, false, A.push, A);
  14096. }
  14097. return new this(A);
  14098. } });
  14099. };
  14100. /***/ }),
  14101. /* 201 */
  14102. /***/ (function(module, exports, __webpack_require__) {
  14103. "use strict";
  14104. var slice = Array.prototype.slice;
  14105. var isArgs = __webpack_require__(202);
  14106. var origKeys = Object.keys;
  14107. var keysShim = origKeys ? function keys(o) { return origKeys(o); } : __webpack_require__(388);
  14108. var originalKeys = Object.keys;
  14109. keysShim.shim = function shimObjectKeys() {
  14110. if (Object.keys) {
  14111. var keysWorksWithArguments = (function () {
  14112. // Safari 5.0 bug
  14113. var args = Object.keys(arguments);
  14114. return args && args.length === arguments.length;
  14115. }(1, 2));
  14116. if (!keysWorksWithArguments) {
  14117. Object.keys = function keys(object) { // eslint-disable-line func-name-matching
  14118. if (isArgs(object)) {
  14119. return originalKeys(slice.call(object));
  14120. }
  14121. return originalKeys(object);
  14122. };
  14123. }
  14124. } else {
  14125. Object.keys = keysShim;
  14126. }
  14127. return Object.keys || keysShim;
  14128. };
  14129. module.exports = keysShim;
  14130. /***/ }),
  14131. /* 202 */
  14132. /***/ (function(module, exports, __webpack_require__) {
  14133. "use strict";
  14134. var toStr = Object.prototype.toString;
  14135. module.exports = function isArguments(value) {
  14136. var str = toStr.call(value);
  14137. var isArgs = str === '[object Arguments]';
  14138. if (!isArgs) {
  14139. isArgs = str !== '[object Array]' &&
  14140. value !== null &&
  14141. typeof value === 'object' &&
  14142. typeof value.length === 'number' &&
  14143. value.length >= 0 &&
  14144. toStr.call(value.callee) === '[object Function]';
  14145. }
  14146. return isArgs;
  14147. };
  14148. /***/ }),
  14149. /* 203 */
  14150. /***/ (function(module, exports, __webpack_require__) {
  14151. "use strict";
  14152. var $Object = Object;
  14153. var $TypeError = TypeError;
  14154. module.exports = function flags() {
  14155. if (this != null && this !== $Object(this)) {
  14156. throw new $TypeError('RegExp.prototype.flags getter called on non-object');
  14157. }
  14158. var result = '';
  14159. if (this.global) {
  14160. result += 'g';
  14161. }
  14162. if (this.ignoreCase) {
  14163. result += 'i';
  14164. }
  14165. if (this.multiline) {
  14166. result += 'm';
  14167. }
  14168. if (this.dotAll) {
  14169. result += 's';
  14170. }
  14171. if (this.unicode) {
  14172. result += 'u';
  14173. }
  14174. if (this.sticky) {
  14175. result += 'y';
  14176. }
  14177. return result;
  14178. };
  14179. /***/ }),
  14180. /* 204 */
  14181. /***/ (function(module, exports, __webpack_require__) {
  14182. "use strict";
  14183. var implementation = __webpack_require__(203);
  14184. var supportsDescriptors = __webpack_require__(129).supportsDescriptors;
  14185. var $gOPD = Object.getOwnPropertyDescriptor;
  14186. var $TypeError = TypeError;
  14187. module.exports = function getPolyfill() {
  14188. if (!supportsDescriptors) {
  14189. throw new $TypeError('RegExp.prototype.flags requires a true ES5 environment that supports property descriptors');
  14190. }
  14191. if ((/a/mig).flags === 'gim') {
  14192. var descriptor = $gOPD(RegExp.prototype, 'flags');
  14193. if (descriptor && typeof descriptor.get === 'function' && typeof (/a/).dotAll === 'boolean') {
  14194. return descriptor.get;
  14195. }
  14196. }
  14197. return implementation;
  14198. };
  14199. /***/ }),
  14200. /* 205 */
  14201. /***/ (function(module, exports, __webpack_require__) {
  14202. /* Copyright 2013 Google Inc. All Rights Reserved.
  14203. Licensed under the Apache License, Version 2.0 (the "License");
  14204. you may not use this file except in compliance with the License.
  14205. You may obtain a copy of the License at
  14206. http://www.apache.org/licenses/LICENSE-2.0
  14207. Unless required by applicable law or agreed to in writing, software
  14208. distributed under the License is distributed on an "AS IS" BASIS,
  14209. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14210. See the License for the specific language governing permissions and
  14211. limitations under the License.
  14212. */
  14213. var BrotliInput = __webpack_require__(206).BrotliInput;
  14214. var BrotliOutput = __webpack_require__(206).BrotliOutput;
  14215. var BrotliBitReader = __webpack_require__(432);
  14216. var BrotliDictionary = __webpack_require__(207);
  14217. var HuffmanCode = __webpack_require__(208).HuffmanCode;
  14218. var BrotliBuildHuffmanTable = __webpack_require__(208).BrotliBuildHuffmanTable;
  14219. var Context = __webpack_require__(436);
  14220. var Prefix = __webpack_require__(437);
  14221. var Transform = __webpack_require__(438);
  14222. var kDefaultCodeLength = 8;
  14223. var kCodeLengthRepeatCode = 16;
  14224. var kNumLiteralCodes = 256;
  14225. var kNumInsertAndCopyCodes = 704;
  14226. var kNumBlockLengthCodes = 26;
  14227. var kLiteralContextBits = 6;
  14228. var kDistanceContextBits = 2;
  14229. var HUFFMAN_TABLE_BITS = 8;
  14230. var HUFFMAN_TABLE_MASK = 0xff;
  14231. /* Maximum possible Huffman table size for an alphabet size of 704, max code
  14232. * length 15 and root table bits 8. */
  14233. var HUFFMAN_MAX_TABLE_SIZE = 1080;
  14234. var CODE_LENGTH_CODES = 18;
  14235. var kCodeLengthCodeOrder = new Uint8Array([
  14236. 1, 2, 3, 4, 0, 5, 17, 6, 16, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  14237. ]);
  14238. var NUM_DISTANCE_SHORT_CODES = 16;
  14239. var kDistanceShortCodeIndexOffset = new Uint8Array([
  14240. 3, 2, 1, 0, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2
  14241. ]);
  14242. var kDistanceShortCodeValueOffset = new Int8Array([
  14243. 0, 0, 0, 0, -1, 1, -2, 2, -3, 3, -1, 1, -2, 2, -3, 3
  14244. ]);
  14245. var kMaxHuffmanTableSize = new Uint16Array([
  14246. 256, 402, 436, 468, 500, 534, 566, 598, 630, 662, 694, 726, 758, 790, 822,
  14247. 854, 886, 920, 952, 984, 1016, 1048, 1080
  14248. ]);
  14249. function DecodeWindowBits(br) {
  14250. var n;
  14251. if (br.readBits(1) === 0) {
  14252. return 16;
  14253. }
  14254. n = br.readBits(3);
  14255. if (n > 0) {
  14256. return 17 + n;
  14257. }
  14258. n = br.readBits(3);
  14259. if (n > 0) {
  14260. return 8 + n;
  14261. }
  14262. return 17;
  14263. }
  14264. /* Decodes a number in the range [0..255], by reading 1 - 11 bits. */
  14265. function DecodeVarLenUint8(br) {
  14266. if (br.readBits(1)) {
  14267. var nbits = br.readBits(3);
  14268. if (nbits === 0) {
  14269. return 1;
  14270. } else {
  14271. return br.readBits(nbits) + (1 << nbits);
  14272. }
  14273. }
  14274. return 0;
  14275. }
  14276. function MetaBlockLength() {
  14277. this.meta_block_length = 0;
  14278. this.input_end = 0;
  14279. this.is_uncompressed = 0;
  14280. this.is_metadata = false;
  14281. }
  14282. function DecodeMetaBlockLength(br) {
  14283. var out = new MetaBlockLength;
  14284. var size_nibbles;
  14285. var size_bytes;
  14286. var i;
  14287. out.input_end = br.readBits(1);
  14288. if (out.input_end && br.readBits(1)) {
  14289. return out;
  14290. }
  14291. size_nibbles = br.readBits(2) + 4;
  14292. if (size_nibbles === 7) {
  14293. out.is_metadata = true;
  14294. if (br.readBits(1) !== 0)
  14295. throw new Error('Invalid reserved bit');
  14296. size_bytes = br.readBits(2);
  14297. if (size_bytes === 0)
  14298. return out;
  14299. for (i = 0; i < size_bytes; i++) {
  14300. var next_byte = br.readBits(8);
  14301. if (i + 1 === size_bytes && size_bytes > 1 && next_byte === 0)
  14302. throw new Error('Invalid size byte');
  14303. out.meta_block_length |= next_byte << (i * 8);
  14304. }
  14305. } else {
  14306. for (i = 0; i < size_nibbles; ++i) {
  14307. var next_nibble = br.readBits(4);
  14308. if (i + 1 === size_nibbles && size_nibbles > 4 && next_nibble === 0)
  14309. throw new Error('Invalid size nibble');
  14310. out.meta_block_length |= next_nibble << (i * 4);
  14311. }
  14312. }
  14313. ++out.meta_block_length;
  14314. if (!out.input_end && !out.is_metadata) {
  14315. out.is_uncompressed = br.readBits(1);
  14316. }
  14317. return out;
  14318. }
  14319. /* Decodes the next Huffman code from bit-stream. */
  14320. function ReadSymbol(table, index, br) {
  14321. var start_index = index;
  14322. var nbits;
  14323. br.fillBitWindow();
  14324. index += (br.val_ >>> br.bit_pos_) & HUFFMAN_TABLE_MASK;
  14325. nbits = table[index].bits - HUFFMAN_TABLE_BITS;
  14326. if (nbits > 0) {
  14327. br.bit_pos_ += HUFFMAN_TABLE_BITS;
  14328. index += table[index].value;
  14329. index += (br.val_ >>> br.bit_pos_) & ((1 << nbits) - 1);
  14330. }
  14331. br.bit_pos_ += table[index].bits;
  14332. return table[index].value;
  14333. }
  14334. function ReadHuffmanCodeLengths(code_length_code_lengths, num_symbols, code_lengths, br) {
  14335. var symbol = 0;
  14336. var prev_code_len = kDefaultCodeLength;
  14337. var repeat = 0;
  14338. var repeat_code_len = 0;
  14339. var space = 32768;
  14340. var table = [];
  14341. for (var i = 0; i < 32; i++)
  14342. table.push(new HuffmanCode(0, 0));
  14343. BrotliBuildHuffmanTable(table, 0, 5, code_length_code_lengths, CODE_LENGTH_CODES);
  14344. while (symbol < num_symbols && space > 0) {
  14345. var p = 0;
  14346. var code_len;
  14347. br.readMoreInput();
  14348. br.fillBitWindow();
  14349. p += (br.val_ >>> br.bit_pos_) & 31;
  14350. br.bit_pos_ += table[p].bits;
  14351. code_len = table[p].value & 0xff;
  14352. if (code_len < kCodeLengthRepeatCode) {
  14353. repeat = 0;
  14354. code_lengths[symbol++] = code_len;
  14355. if (code_len !== 0) {
  14356. prev_code_len = code_len;
  14357. space -= 32768 >> code_len;
  14358. }
  14359. } else {
  14360. var extra_bits = code_len - 14;
  14361. var old_repeat;
  14362. var repeat_delta;
  14363. var new_len = 0;
  14364. if (code_len === kCodeLengthRepeatCode) {
  14365. new_len = prev_code_len;
  14366. }
  14367. if (repeat_code_len !== new_len) {
  14368. repeat = 0;
  14369. repeat_code_len = new_len;
  14370. }
  14371. old_repeat = repeat;
  14372. if (repeat > 0) {
  14373. repeat -= 2;
  14374. repeat <<= extra_bits;
  14375. }
  14376. repeat += br.readBits(extra_bits) + 3;
  14377. repeat_delta = repeat - old_repeat;
  14378. if (symbol + repeat_delta > num_symbols) {
  14379. throw new Error('[ReadHuffmanCodeLengths] symbol + repeat_delta > num_symbols');
  14380. }
  14381. for (var x = 0; x < repeat_delta; x++)
  14382. code_lengths[symbol + x] = repeat_code_len;
  14383. symbol += repeat_delta;
  14384. if (repeat_code_len !== 0) {
  14385. space -= repeat_delta << (15 - repeat_code_len);
  14386. }
  14387. }
  14388. }
  14389. if (space !== 0) {
  14390. throw new Error("[ReadHuffmanCodeLengths] space = " + space);
  14391. }
  14392. for (; symbol < num_symbols; symbol++)
  14393. code_lengths[symbol] = 0;
  14394. }
  14395. function ReadHuffmanCode(alphabet_size, tables, table, br) {
  14396. var table_size = 0;
  14397. var simple_code_or_skip;
  14398. var code_lengths = new Uint8Array(alphabet_size);
  14399. br.readMoreInput();
  14400. /* simple_code_or_skip is used as follows:
  14401. 1 for simple code;
  14402. 0 for no skipping, 2 skips 2 code lengths, 3 skips 3 code lengths */
  14403. simple_code_or_skip = br.readBits(2);
  14404. if (simple_code_or_skip === 1) {
  14405. /* Read symbols, codes & code lengths directly. */
  14406. var i;
  14407. var max_bits_counter = alphabet_size - 1;
  14408. var max_bits = 0;
  14409. var symbols = new Int32Array(4);
  14410. var num_symbols = br.readBits(2) + 1;
  14411. while (max_bits_counter) {
  14412. max_bits_counter >>= 1;
  14413. ++max_bits;
  14414. }
  14415. for (i = 0; i < num_symbols; ++i) {
  14416. symbols[i] = br.readBits(max_bits) % alphabet_size;
  14417. code_lengths[symbols[i]] = 2;
  14418. }
  14419. code_lengths[symbols[0]] = 1;
  14420. switch (num_symbols) {
  14421. case 1:
  14422. break;
  14423. case 3:
  14424. if ((symbols[0] === symbols[1]) ||
  14425. (symbols[0] === symbols[2]) ||
  14426. (symbols[1] === symbols[2])) {
  14427. throw new Error('[ReadHuffmanCode] invalid symbols');
  14428. }
  14429. break;
  14430. case 2:
  14431. if (symbols[0] === symbols[1]) {
  14432. throw new Error('[ReadHuffmanCode] invalid symbols');
  14433. }
  14434. code_lengths[symbols[1]] = 1;
  14435. break;
  14436. case 4:
  14437. if ((symbols[0] === symbols[1]) ||
  14438. (symbols[0] === symbols[2]) ||
  14439. (symbols[0] === symbols[3]) ||
  14440. (symbols[1] === symbols[2]) ||
  14441. (symbols[1] === symbols[3]) ||
  14442. (symbols[2] === symbols[3])) {
  14443. throw new Error('[ReadHuffmanCode] invalid symbols');
  14444. }
  14445. if (br.readBits(1)) {
  14446. code_lengths[symbols[2]] = 3;
  14447. code_lengths[symbols[3]] = 3;
  14448. } else {
  14449. code_lengths[symbols[0]] = 2;
  14450. }
  14451. break;
  14452. }
  14453. } else { /* Decode Huffman-coded code lengths. */
  14454. var i;
  14455. var code_length_code_lengths = new Uint8Array(CODE_LENGTH_CODES);
  14456. var space = 32;
  14457. var num_codes = 0;
  14458. /* Static Huffman code for the code length code lengths */
  14459. var huff = [
  14460. new HuffmanCode(2, 0), new HuffmanCode(2, 4), new HuffmanCode(2, 3), new HuffmanCode(3, 2),
  14461. new HuffmanCode(2, 0), new HuffmanCode(2, 4), new HuffmanCode(2, 3), new HuffmanCode(4, 1),
  14462. new HuffmanCode(2, 0), new HuffmanCode(2, 4), new HuffmanCode(2, 3), new HuffmanCode(3, 2),
  14463. new HuffmanCode(2, 0), new HuffmanCode(2, 4), new HuffmanCode(2, 3), new HuffmanCode(4, 5)
  14464. ];
  14465. for (i = simple_code_or_skip; i < CODE_LENGTH_CODES && space > 0; ++i) {
  14466. var code_len_idx = kCodeLengthCodeOrder[i];
  14467. var p = 0;
  14468. var v;
  14469. br.fillBitWindow();
  14470. p += (br.val_ >>> br.bit_pos_) & 15;
  14471. br.bit_pos_ += huff[p].bits;
  14472. v = huff[p].value;
  14473. code_length_code_lengths[code_len_idx] = v;
  14474. if (v !== 0) {
  14475. space -= (32 >> v);
  14476. ++num_codes;
  14477. }
  14478. }
  14479. if (!(num_codes === 1 || space === 0))
  14480. throw new Error('[ReadHuffmanCode] invalid num_codes or space');
  14481. ReadHuffmanCodeLengths(code_length_code_lengths, alphabet_size, code_lengths, br);
  14482. }
  14483. table_size = BrotliBuildHuffmanTable(tables, table, HUFFMAN_TABLE_BITS, code_lengths, alphabet_size);
  14484. if (table_size === 0) {
  14485. throw new Error("[ReadHuffmanCode] BuildHuffmanTable failed: ");
  14486. }
  14487. return table_size;
  14488. }
  14489. function ReadBlockLength(table, index, br) {
  14490. var code;
  14491. var nbits;
  14492. code = ReadSymbol(table, index, br);
  14493. nbits = Prefix.kBlockLengthPrefixCode[code].nbits;
  14494. return Prefix.kBlockLengthPrefixCode[code].offset + br.readBits(nbits);
  14495. }
  14496. function TranslateShortCodes(code, ringbuffer, index) {
  14497. var val;
  14498. if (code < NUM_DISTANCE_SHORT_CODES) {
  14499. index += kDistanceShortCodeIndexOffset[code];
  14500. index &= 3;
  14501. val = ringbuffer[index] + kDistanceShortCodeValueOffset[code];
  14502. } else {
  14503. val = code - NUM_DISTANCE_SHORT_CODES + 1;
  14504. }
  14505. return val;
  14506. }
  14507. function MoveToFront(v, index) {
  14508. var value = v[index];
  14509. var i = index;
  14510. for (; i; --i) v[i] = v[i - 1];
  14511. v[0] = value;
  14512. }
  14513. function InverseMoveToFrontTransform(v, v_len) {
  14514. var mtf = new Uint8Array(256);
  14515. var i;
  14516. for (i = 0; i < 256; ++i) {
  14517. mtf[i] = i;
  14518. }
  14519. for (i = 0; i < v_len; ++i) {
  14520. var index = v[i];
  14521. v[i] = mtf[index];
  14522. if (index) MoveToFront(mtf, index);
  14523. }
  14524. }
  14525. /* Contains a collection of huffman trees with the same alphabet size. */
  14526. function HuffmanTreeGroup(alphabet_size, num_htrees) {
  14527. this.alphabet_size = alphabet_size;
  14528. this.num_htrees = num_htrees;
  14529. this.codes = new Array(num_htrees + num_htrees * kMaxHuffmanTableSize[(alphabet_size + 31) >>> 5]);
  14530. this.htrees = new Uint32Array(num_htrees);
  14531. }
  14532. HuffmanTreeGroup.prototype.decode = function(br) {
  14533. var i;
  14534. var table_size;
  14535. var next = 0;
  14536. for (i = 0; i < this.num_htrees; ++i) {
  14537. this.htrees[i] = next;
  14538. table_size = ReadHuffmanCode(this.alphabet_size, this.codes, next, br);
  14539. next += table_size;
  14540. }
  14541. };
  14542. function DecodeContextMap(context_map_size, br) {
  14543. var out = { num_htrees: null, context_map: null };
  14544. var use_rle_for_zeros;
  14545. var max_run_length_prefix = 0;
  14546. var table;
  14547. var i;
  14548. br.readMoreInput();
  14549. var num_htrees = out.num_htrees = DecodeVarLenUint8(br) + 1;
  14550. var context_map = out.context_map = new Uint8Array(context_map_size);
  14551. if (num_htrees <= 1) {
  14552. return out;
  14553. }
  14554. use_rle_for_zeros = br.readBits(1);
  14555. if (use_rle_for_zeros) {
  14556. max_run_length_prefix = br.readBits(4) + 1;
  14557. }
  14558. table = [];
  14559. for (i = 0; i < HUFFMAN_MAX_TABLE_SIZE; i++) {
  14560. table[i] = new HuffmanCode(0, 0);
  14561. }
  14562. ReadHuffmanCode(num_htrees + max_run_length_prefix, table, 0, br);
  14563. for (i = 0; i < context_map_size;) {
  14564. var code;
  14565. br.readMoreInput();
  14566. code = ReadSymbol(table, 0, br);
  14567. if (code === 0) {
  14568. context_map[i] = 0;
  14569. ++i;
  14570. } else if (code <= max_run_length_prefix) {
  14571. var reps = 1 + (1 << code) + br.readBits(code);
  14572. while (--reps) {
  14573. if (i >= context_map_size) {
  14574. throw new Error("[DecodeContextMap] i >= context_map_size");
  14575. }
  14576. context_map[i] = 0;
  14577. ++i;
  14578. }
  14579. } else {
  14580. context_map[i] = code - max_run_length_prefix;
  14581. ++i;
  14582. }
  14583. }
  14584. if (br.readBits(1)) {
  14585. InverseMoveToFrontTransform(context_map, context_map_size);
  14586. }
  14587. return out;
  14588. }
  14589. function DecodeBlockType(max_block_type, trees, tree_type, block_types, ringbuffers, indexes, br) {
  14590. var ringbuffer = tree_type * 2;
  14591. var index = tree_type;
  14592. var type_code = ReadSymbol(trees, tree_type * HUFFMAN_MAX_TABLE_SIZE, br);
  14593. var block_type;
  14594. if (type_code === 0) {
  14595. block_type = ringbuffers[ringbuffer + (indexes[index] & 1)];
  14596. } else if (type_code === 1) {
  14597. block_type = ringbuffers[ringbuffer + ((indexes[index] - 1) & 1)] + 1;
  14598. } else {
  14599. block_type = type_code - 2;
  14600. }
  14601. if (block_type >= max_block_type) {
  14602. block_type -= max_block_type;
  14603. }
  14604. block_types[tree_type] = block_type;
  14605. ringbuffers[ringbuffer + (indexes[index] & 1)] = block_type;
  14606. ++indexes[index];
  14607. }
  14608. function CopyUncompressedBlockToOutput(output, len, pos, ringbuffer, ringbuffer_mask, br) {
  14609. var rb_size = ringbuffer_mask + 1;
  14610. var rb_pos = pos & ringbuffer_mask;
  14611. var br_pos = br.pos_ & BrotliBitReader.IBUF_MASK;
  14612. var nbytes;
  14613. /* For short lengths copy byte-by-byte */
  14614. if (len < 8 || br.bit_pos_ + (len << 3) < br.bit_end_pos_) {
  14615. while (len-- > 0) {
  14616. br.readMoreInput();
  14617. ringbuffer[rb_pos++] = br.readBits(8);
  14618. if (rb_pos === rb_size) {
  14619. output.write(ringbuffer, rb_size);
  14620. rb_pos = 0;
  14621. }
  14622. }
  14623. return;
  14624. }
  14625. if (br.bit_end_pos_ < 32) {
  14626. throw new Error('[CopyUncompressedBlockToOutput] br.bit_end_pos_ < 32');
  14627. }
  14628. /* Copy remaining 0-4 bytes from br.val_ to ringbuffer. */
  14629. while (br.bit_pos_ < 32) {
  14630. ringbuffer[rb_pos] = (br.val_ >>> br.bit_pos_);
  14631. br.bit_pos_ += 8;
  14632. ++rb_pos;
  14633. --len;
  14634. }
  14635. /* Copy remaining bytes from br.buf_ to ringbuffer. */
  14636. nbytes = (br.bit_end_pos_ - br.bit_pos_) >> 3;
  14637. if (br_pos + nbytes > BrotliBitReader.IBUF_MASK) {
  14638. var tail = BrotliBitReader.IBUF_MASK + 1 - br_pos;
  14639. for (var x = 0; x < tail; x++)
  14640. ringbuffer[rb_pos + x] = br.buf_[br_pos + x];
  14641. nbytes -= tail;
  14642. rb_pos += tail;
  14643. len -= tail;
  14644. br_pos = 0;
  14645. }
  14646. for (var x = 0; x < nbytes; x++)
  14647. ringbuffer[rb_pos + x] = br.buf_[br_pos + x];
  14648. rb_pos += nbytes;
  14649. len -= nbytes;
  14650. /* If we wrote past the logical end of the ringbuffer, copy the tail of the
  14651. ringbuffer to its beginning and flush the ringbuffer to the output. */
  14652. if (rb_pos >= rb_size) {
  14653. output.write(ringbuffer, rb_size);
  14654. rb_pos -= rb_size;
  14655. for (var x = 0; x < rb_pos; x++)
  14656. ringbuffer[x] = ringbuffer[rb_size + x];
  14657. }
  14658. /* If we have more to copy than the remaining size of the ringbuffer, then we
  14659. first fill the ringbuffer from the input and then flush the ringbuffer to
  14660. the output */
  14661. while (rb_pos + len >= rb_size) {
  14662. nbytes = rb_size - rb_pos;
  14663. if (br.input_.read(ringbuffer, rb_pos, nbytes) < nbytes) {
  14664. throw new Error('[CopyUncompressedBlockToOutput] not enough bytes');
  14665. }
  14666. output.write(ringbuffer, rb_size);
  14667. len -= nbytes;
  14668. rb_pos = 0;
  14669. }
  14670. /* Copy straight from the input onto the ringbuffer. The ringbuffer will be
  14671. flushed to the output at a later time. */
  14672. if (br.input_.read(ringbuffer, rb_pos, len) < len) {
  14673. throw new Error('[CopyUncompressedBlockToOutput] not enough bytes');
  14674. }
  14675. /* Restore the state of the bit reader. */
  14676. br.reset();
  14677. }
  14678. /* Advances the bit reader position to the next byte boundary and verifies
  14679. that any skipped bits are set to zero. */
  14680. function JumpToByteBoundary(br) {
  14681. var new_bit_pos = (br.bit_pos_ + 7) & ~7;
  14682. var pad_bits = br.readBits(new_bit_pos - br.bit_pos_);
  14683. return pad_bits == 0;
  14684. }
  14685. function BrotliDecompressedSize(buffer) {
  14686. var input = new BrotliInput(buffer);
  14687. var br = new BrotliBitReader(input);
  14688. DecodeWindowBits(br);
  14689. var out = DecodeMetaBlockLength(br);
  14690. return out.meta_block_length;
  14691. }
  14692. exports.BrotliDecompressedSize = BrotliDecompressedSize;
  14693. function BrotliDecompressBuffer(buffer, output_size) {
  14694. var input = new BrotliInput(buffer);
  14695. if (output_size == null) {
  14696. output_size = BrotliDecompressedSize(buffer);
  14697. }
  14698. var output_buffer = new Uint8Array(output_size);
  14699. var output = new BrotliOutput(output_buffer);
  14700. BrotliDecompress(input, output);
  14701. if (output.pos < output.buffer.length) {
  14702. output.buffer = output.buffer.subarray(0, output.pos);
  14703. }
  14704. return output.buffer;
  14705. }
  14706. exports.BrotliDecompressBuffer = BrotliDecompressBuffer;
  14707. function BrotliDecompress(input, output) {
  14708. var i;
  14709. var pos = 0;
  14710. var input_end = 0;
  14711. var window_bits = 0;
  14712. var max_backward_distance;
  14713. var max_distance = 0;
  14714. var ringbuffer_size;
  14715. var ringbuffer_mask;
  14716. var ringbuffer;
  14717. var ringbuffer_end;
  14718. /* This ring buffer holds a few past copy distances that will be used by */
  14719. /* some special distance codes. */
  14720. var dist_rb = [ 16, 15, 11, 4 ];
  14721. var dist_rb_idx = 0;
  14722. /* The previous 2 bytes used for context. */
  14723. var prev_byte1 = 0;
  14724. var prev_byte2 = 0;
  14725. var hgroup = [new HuffmanTreeGroup(0, 0), new HuffmanTreeGroup(0, 0), new HuffmanTreeGroup(0, 0)];
  14726. var block_type_trees;
  14727. var block_len_trees;
  14728. var br;
  14729. /* We need the slack region for the following reasons:
  14730. - always doing two 8-byte copies for fast backward copying
  14731. - transforms
  14732. - flushing the input ringbuffer when decoding uncompressed blocks */
  14733. var kRingBufferWriteAheadSlack = 128 + BrotliBitReader.READ_SIZE;
  14734. br = new BrotliBitReader(input);
  14735. /* Decode window size. */
  14736. window_bits = DecodeWindowBits(br);
  14737. max_backward_distance = (1 << window_bits) - 16;
  14738. ringbuffer_size = 1 << window_bits;
  14739. ringbuffer_mask = ringbuffer_size - 1;
  14740. ringbuffer = new Uint8Array(ringbuffer_size + kRingBufferWriteAheadSlack + BrotliDictionary.maxDictionaryWordLength);
  14741. ringbuffer_end = ringbuffer_size;
  14742. block_type_trees = [];
  14743. block_len_trees = [];
  14744. for (var x = 0; x < 3 * HUFFMAN_MAX_TABLE_SIZE; x++) {
  14745. block_type_trees[x] = new HuffmanCode(0, 0);
  14746. block_len_trees[x] = new HuffmanCode(0, 0);
  14747. }
  14748. while (!input_end) {
  14749. var meta_block_remaining_len = 0;
  14750. var is_uncompressed;
  14751. var block_length = [ 1 << 28, 1 << 28, 1 << 28 ];
  14752. var block_type = [ 0 ];
  14753. var num_block_types = [ 1, 1, 1 ];
  14754. var block_type_rb = [ 0, 1, 0, 1, 0, 1 ];
  14755. var block_type_rb_index = [ 0 ];
  14756. var distance_postfix_bits;
  14757. var num_direct_distance_codes;
  14758. var distance_postfix_mask;
  14759. var num_distance_codes;
  14760. var context_map = null;
  14761. var context_modes = null;
  14762. var num_literal_htrees;
  14763. var dist_context_map = null;
  14764. var num_dist_htrees;
  14765. var context_offset = 0;
  14766. var context_map_slice = null;
  14767. var literal_htree_index = 0;
  14768. var dist_context_offset = 0;
  14769. var dist_context_map_slice = null;
  14770. var dist_htree_index = 0;
  14771. var context_lookup_offset1 = 0;
  14772. var context_lookup_offset2 = 0;
  14773. var context_mode;
  14774. var htree_command;
  14775. for (i = 0; i < 3; ++i) {
  14776. hgroup[i].codes = null;
  14777. hgroup[i].htrees = null;
  14778. }
  14779. br.readMoreInput();
  14780. var _out = DecodeMetaBlockLength(br);
  14781. meta_block_remaining_len = _out.meta_block_length;
  14782. if (pos + meta_block_remaining_len > output.buffer.length) {
  14783. /* We need to grow the output buffer to fit the additional data. */
  14784. var tmp = new Uint8Array( pos + meta_block_remaining_len );
  14785. tmp.set( output.buffer );
  14786. output.buffer = tmp;
  14787. }
  14788. input_end = _out.input_end;
  14789. is_uncompressed = _out.is_uncompressed;
  14790. if (_out.is_metadata) {
  14791. JumpToByteBoundary(br);
  14792. for (; meta_block_remaining_len > 0; --meta_block_remaining_len) {
  14793. br.readMoreInput();
  14794. /* Read one byte and ignore it. */
  14795. br.readBits(8);
  14796. }
  14797. continue;
  14798. }
  14799. if (meta_block_remaining_len === 0) {
  14800. continue;
  14801. }
  14802. if (is_uncompressed) {
  14803. br.bit_pos_ = (br.bit_pos_ + 7) & ~7;
  14804. CopyUncompressedBlockToOutput(output, meta_block_remaining_len, pos,
  14805. ringbuffer, ringbuffer_mask, br);
  14806. pos += meta_block_remaining_len;
  14807. continue;
  14808. }
  14809. for (i = 0; i < 3; ++i) {
  14810. num_block_types[i] = DecodeVarLenUint8(br) + 1;
  14811. if (num_block_types[i] >= 2) {
  14812. ReadHuffmanCode(num_block_types[i] + 2, block_type_trees, i * HUFFMAN_MAX_TABLE_SIZE, br);
  14813. ReadHuffmanCode(kNumBlockLengthCodes, block_len_trees, i * HUFFMAN_MAX_TABLE_SIZE, br);
  14814. block_length[i] = ReadBlockLength(block_len_trees, i * HUFFMAN_MAX_TABLE_SIZE, br);
  14815. block_type_rb_index[i] = 1;
  14816. }
  14817. }
  14818. br.readMoreInput();
  14819. distance_postfix_bits = br.readBits(2);
  14820. num_direct_distance_codes = NUM_DISTANCE_SHORT_CODES + (br.readBits(4) << distance_postfix_bits);
  14821. distance_postfix_mask = (1 << distance_postfix_bits) - 1;
  14822. num_distance_codes = (num_direct_distance_codes + (48 << distance_postfix_bits));
  14823. context_modes = new Uint8Array(num_block_types[0]);
  14824. for (i = 0; i < num_block_types[0]; ++i) {
  14825. br.readMoreInput();
  14826. context_modes[i] = (br.readBits(2) << 1);
  14827. }
  14828. var _o1 = DecodeContextMap(num_block_types[0] << kLiteralContextBits, br);
  14829. num_literal_htrees = _o1.num_htrees;
  14830. context_map = _o1.context_map;
  14831. var _o2 = DecodeContextMap(num_block_types[2] << kDistanceContextBits, br);
  14832. num_dist_htrees = _o2.num_htrees;
  14833. dist_context_map = _o2.context_map;
  14834. hgroup[0] = new HuffmanTreeGroup(kNumLiteralCodes, num_literal_htrees);
  14835. hgroup[1] = new HuffmanTreeGroup(kNumInsertAndCopyCodes, num_block_types[1]);
  14836. hgroup[2] = new HuffmanTreeGroup(num_distance_codes, num_dist_htrees);
  14837. for (i = 0; i < 3; ++i) {
  14838. hgroup[i].decode(br);
  14839. }
  14840. context_map_slice = 0;
  14841. dist_context_map_slice = 0;
  14842. context_mode = context_modes[block_type[0]];
  14843. context_lookup_offset1 = Context.lookupOffsets[context_mode];
  14844. context_lookup_offset2 = Context.lookupOffsets[context_mode + 1];
  14845. htree_command = hgroup[1].htrees[0];
  14846. while (meta_block_remaining_len > 0) {
  14847. var cmd_code;
  14848. var range_idx;
  14849. var insert_code;
  14850. var copy_code;
  14851. var insert_length;
  14852. var copy_length;
  14853. var distance_code;
  14854. var distance;
  14855. var context;
  14856. var j;
  14857. var copy_dst;
  14858. br.readMoreInput();
  14859. if (block_length[1] === 0) {
  14860. DecodeBlockType(num_block_types[1],
  14861. block_type_trees, 1, block_type, block_type_rb,
  14862. block_type_rb_index, br);
  14863. block_length[1] = ReadBlockLength(block_len_trees, HUFFMAN_MAX_TABLE_SIZE, br);
  14864. htree_command = hgroup[1].htrees[block_type[1]];
  14865. }
  14866. --block_length[1];
  14867. cmd_code = ReadSymbol(hgroup[1].codes, htree_command, br);
  14868. range_idx = cmd_code >> 6;
  14869. if (range_idx >= 2) {
  14870. range_idx -= 2;
  14871. distance_code = -1;
  14872. } else {
  14873. distance_code = 0;
  14874. }
  14875. insert_code = Prefix.kInsertRangeLut[range_idx] + ((cmd_code >> 3) & 7);
  14876. copy_code = Prefix.kCopyRangeLut[range_idx] + (cmd_code & 7);
  14877. insert_length = Prefix.kInsertLengthPrefixCode[insert_code].offset +
  14878. br.readBits(Prefix.kInsertLengthPrefixCode[insert_code].nbits);
  14879. copy_length = Prefix.kCopyLengthPrefixCode[copy_code].offset +
  14880. br.readBits(Prefix.kCopyLengthPrefixCode[copy_code].nbits);
  14881. prev_byte1 = ringbuffer[pos-1 & ringbuffer_mask];
  14882. prev_byte2 = ringbuffer[pos-2 & ringbuffer_mask];
  14883. for (j = 0; j < insert_length; ++j) {
  14884. br.readMoreInput();
  14885. if (block_length[0] === 0) {
  14886. DecodeBlockType(num_block_types[0],
  14887. block_type_trees, 0, block_type, block_type_rb,
  14888. block_type_rb_index, br);
  14889. block_length[0] = ReadBlockLength(block_len_trees, 0, br);
  14890. context_offset = block_type[0] << kLiteralContextBits;
  14891. context_map_slice = context_offset;
  14892. context_mode = context_modes[block_type[0]];
  14893. context_lookup_offset1 = Context.lookupOffsets[context_mode];
  14894. context_lookup_offset2 = Context.lookupOffsets[context_mode + 1];
  14895. }
  14896. context = (Context.lookup[context_lookup_offset1 + prev_byte1] |
  14897. Context.lookup[context_lookup_offset2 + prev_byte2]);
  14898. literal_htree_index = context_map[context_map_slice + context];
  14899. --block_length[0];
  14900. prev_byte2 = prev_byte1;
  14901. prev_byte1 = ReadSymbol(hgroup[0].codes, hgroup[0].htrees[literal_htree_index], br);
  14902. ringbuffer[pos & ringbuffer_mask] = prev_byte1;
  14903. if ((pos & ringbuffer_mask) === ringbuffer_mask) {
  14904. output.write(ringbuffer, ringbuffer_size);
  14905. }
  14906. ++pos;
  14907. }
  14908. meta_block_remaining_len -= insert_length;
  14909. if (meta_block_remaining_len <= 0) break;
  14910. if (distance_code < 0) {
  14911. var context;
  14912. br.readMoreInput();
  14913. if (block_length[2] === 0) {
  14914. DecodeBlockType(num_block_types[2],
  14915. block_type_trees, 2, block_type, block_type_rb,
  14916. block_type_rb_index, br);
  14917. block_length[2] = ReadBlockLength(block_len_trees, 2 * HUFFMAN_MAX_TABLE_SIZE, br);
  14918. dist_context_offset = block_type[2] << kDistanceContextBits;
  14919. dist_context_map_slice = dist_context_offset;
  14920. }
  14921. --block_length[2];
  14922. context = (copy_length > 4 ? 3 : copy_length - 2) & 0xff;
  14923. dist_htree_index = dist_context_map[dist_context_map_slice + context];
  14924. distance_code = ReadSymbol(hgroup[2].codes, hgroup[2].htrees[dist_htree_index], br);
  14925. if (distance_code >= num_direct_distance_codes) {
  14926. var nbits;
  14927. var postfix;
  14928. var offset;
  14929. distance_code -= num_direct_distance_codes;
  14930. postfix = distance_code & distance_postfix_mask;
  14931. distance_code >>= distance_postfix_bits;
  14932. nbits = (distance_code >> 1) + 1;
  14933. offset = ((2 + (distance_code & 1)) << nbits) - 4;
  14934. distance_code = num_direct_distance_codes +
  14935. ((offset + br.readBits(nbits)) <<
  14936. distance_postfix_bits) + postfix;
  14937. }
  14938. }
  14939. /* Convert the distance code to the actual distance by possibly looking */
  14940. /* up past distnaces from the ringbuffer. */
  14941. distance = TranslateShortCodes(distance_code, dist_rb, dist_rb_idx);
  14942. if (distance < 0) {
  14943. throw new Error('[BrotliDecompress] invalid distance');
  14944. }
  14945. if (pos < max_backward_distance &&
  14946. max_distance !== max_backward_distance) {
  14947. max_distance = pos;
  14948. } else {
  14949. max_distance = max_backward_distance;
  14950. }
  14951. copy_dst = pos & ringbuffer_mask;
  14952. if (distance > max_distance) {
  14953. if (copy_length >= BrotliDictionary.minDictionaryWordLength &&
  14954. copy_length <= BrotliDictionary.maxDictionaryWordLength) {
  14955. var offset = BrotliDictionary.offsetsByLength[copy_length];
  14956. var word_id = distance - max_distance - 1;
  14957. var shift = BrotliDictionary.sizeBitsByLength[copy_length];
  14958. var mask = (1 << shift) - 1;
  14959. var word_idx = word_id & mask;
  14960. var transform_idx = word_id >> shift;
  14961. offset += word_idx * copy_length;
  14962. if (transform_idx < Transform.kNumTransforms) {
  14963. var len = Transform.transformDictionaryWord(ringbuffer, copy_dst, offset, copy_length, transform_idx);
  14964. copy_dst += len;
  14965. pos += len;
  14966. meta_block_remaining_len -= len;
  14967. if (copy_dst >= ringbuffer_end) {
  14968. output.write(ringbuffer, ringbuffer_size);
  14969. for (var _x = 0; _x < (copy_dst - ringbuffer_end); _x++)
  14970. ringbuffer[_x] = ringbuffer[ringbuffer_end + _x];
  14971. }
  14972. } else {
  14973. throw new Error("Invalid backward reference. pos: " + pos + " distance: " + distance +
  14974. " len: " + copy_length + " bytes left: " + meta_block_remaining_len);
  14975. }
  14976. } else {
  14977. throw new Error("Invalid backward reference. pos: " + pos + " distance: " + distance +
  14978. " len: " + copy_length + " bytes left: " + meta_block_remaining_len);
  14979. }
  14980. } else {
  14981. if (distance_code > 0) {
  14982. dist_rb[dist_rb_idx & 3] = distance;
  14983. ++dist_rb_idx;
  14984. }
  14985. if (copy_length > meta_block_remaining_len) {
  14986. throw new Error("Invalid backward reference. pos: " + pos + " distance: " + distance +
  14987. " len: " + copy_length + " bytes left: " + meta_block_remaining_len);
  14988. }
  14989. for (j = 0; j < copy_length; ++j) {
  14990. ringbuffer[pos & ringbuffer_mask] = ringbuffer[(pos - distance) & ringbuffer_mask];
  14991. if ((pos & ringbuffer_mask) === ringbuffer_mask) {
  14992. output.write(ringbuffer, ringbuffer_size);
  14993. }
  14994. ++pos;
  14995. --meta_block_remaining_len;
  14996. }
  14997. }
  14998. /* When we get here, we must have inserted at least one literal and */
  14999. /* made a copy of at least length two, therefore accessing the last 2 */
  15000. /* bytes is valid. */
  15001. prev_byte1 = ringbuffer[(pos - 1) & ringbuffer_mask];
  15002. prev_byte2 = ringbuffer[(pos - 2) & ringbuffer_mask];
  15003. }
  15004. /* Protect pos from overflow, wrap it around at every GB of input data */
  15005. pos &= 0x3fffffff;
  15006. }
  15007. output.write(ringbuffer, pos & ringbuffer_mask);
  15008. }
  15009. exports.BrotliDecompress = BrotliDecompress;
  15010. BrotliDictionary.init();
  15011. /***/ }),
  15012. /* 206 */
  15013. /***/ (function(module, exports) {
  15014. function BrotliInput(buffer) {
  15015. this.buffer = buffer;
  15016. this.pos = 0;
  15017. }
  15018. BrotliInput.prototype.read = function(buf, i, count) {
  15019. if (this.pos + count > this.buffer.length) {
  15020. count = this.buffer.length - this.pos;
  15021. }
  15022. for (var p = 0; p < count; p++)
  15023. buf[i + p] = this.buffer[this.pos + p];
  15024. this.pos += count;
  15025. return count;
  15026. }
  15027. exports.BrotliInput = BrotliInput;
  15028. function BrotliOutput(buf) {
  15029. this.buffer = buf;
  15030. this.pos = 0;
  15031. }
  15032. BrotliOutput.prototype.write = function(buf, count) {
  15033. if (this.pos + count > this.buffer.length)
  15034. throw new Error('Output buffer is not large enough');
  15035. this.buffer.set(buf.subarray(0, count), this.pos);
  15036. this.pos += count;
  15037. return count;
  15038. };
  15039. exports.BrotliOutput = BrotliOutput;
  15040. /***/ }),
  15041. /* 207 */
  15042. /***/ (function(module, exports, __webpack_require__) {
  15043. /* Copyright 2013 Google Inc. All Rights Reserved.
  15044. Licensed under the Apache License, Version 2.0 (the "License");
  15045. you may not use this file except in compliance with the License.
  15046. You may obtain a copy of the License at
  15047. http://www.apache.org/licenses/LICENSE-2.0
  15048. Unless required by applicable law or agreed to in writing, software
  15049. distributed under the License is distributed on an "AS IS" BASIS,
  15050. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15051. See the License for the specific language governing permissions and
  15052. limitations under the License.
  15053. Collection of static dictionary words.
  15054. */
  15055. var data = __webpack_require__(433);
  15056. exports.init = function() {
  15057. exports.dictionary = data.init();
  15058. };
  15059. exports.offsetsByLength = new Uint32Array([
  15060. 0, 0, 0, 0, 0, 4096, 9216, 21504, 35840, 44032,
  15061. 53248, 63488, 74752, 87040, 93696, 100864, 104704, 106752, 108928, 113536,
  15062. 115968, 118528, 119872, 121280, 122016,
  15063. ]);
  15064. exports.sizeBitsByLength = new Uint8Array([
  15065. 0, 0, 0, 0, 10, 10, 11, 11, 10, 10,
  15066. 10, 10, 10, 9, 9, 8, 7, 7, 8, 7,
  15067. 7, 6, 6, 5, 5,
  15068. ]);
  15069. exports.minDictionaryWordLength = 4;
  15070. exports.maxDictionaryWordLength = 24;
  15071. /***/ }),
  15072. /* 208 */
  15073. /***/ (function(module, exports) {
  15074. function HuffmanCode(bits, value) {
  15075. this.bits = bits; /* number of bits used for this symbol */
  15076. this.value = value; /* symbol value or table offset */
  15077. }
  15078. exports.HuffmanCode = HuffmanCode;
  15079. var MAX_LENGTH = 15;
  15080. /* Returns reverse(reverse(key, len) + 1, len), where reverse(key, len) is the
  15081. bit-wise reversal of the len least significant bits of key. */
  15082. function GetNextKey(key, len) {
  15083. var step = 1 << (len - 1);
  15084. while (key & step) {
  15085. step >>= 1;
  15086. }
  15087. return (key & (step - 1)) + step;
  15088. }
  15089. /* Stores code in table[0], table[step], table[2*step], ..., table[end] */
  15090. /* Assumes that end is an integer multiple of step */
  15091. function ReplicateValue(table, i, step, end, code) {
  15092. do {
  15093. end -= step;
  15094. table[i + end] = new HuffmanCode(code.bits, code.value);
  15095. } while (end > 0);
  15096. }
  15097. /* Returns the table width of the next 2nd level table. count is the histogram
  15098. of bit lengths for the remaining symbols, len is the code length of the next
  15099. processed symbol */
  15100. function NextTableBitSize(count, len, root_bits) {
  15101. var left = 1 << (len - root_bits);
  15102. while (len < MAX_LENGTH) {
  15103. left -= count[len];
  15104. if (left <= 0) break;
  15105. ++len;
  15106. left <<= 1;
  15107. }
  15108. return len - root_bits;
  15109. }
  15110. exports.BrotliBuildHuffmanTable = function(root_table, table, root_bits, code_lengths, code_lengths_size) {
  15111. var start_table = table;
  15112. var code; /* current table entry */
  15113. var len; /* current code length */
  15114. var symbol; /* symbol index in original or sorted table */
  15115. var key; /* reversed prefix code */
  15116. var step; /* step size to replicate values in current table */
  15117. var low; /* low bits for current root entry */
  15118. var mask; /* mask for low bits */
  15119. var table_bits; /* key length of current table */
  15120. var table_size; /* size of current table */
  15121. var total_size; /* sum of root table size and 2nd level table sizes */
  15122. var sorted; /* symbols sorted by code length */
  15123. var count = new Int32Array(MAX_LENGTH + 1); /* number of codes of each length */
  15124. var offset = new Int32Array(MAX_LENGTH + 1); /* offsets in sorted table for each length */
  15125. sorted = new Int32Array(code_lengths_size);
  15126. /* build histogram of code lengths */
  15127. for (symbol = 0; symbol < code_lengths_size; symbol++) {
  15128. count[code_lengths[symbol]]++;
  15129. }
  15130. /* generate offsets into sorted symbol table by code length */
  15131. offset[1] = 0;
  15132. for (len = 1; len < MAX_LENGTH; len++) {
  15133. offset[len + 1] = offset[len] + count[len];
  15134. }
  15135. /* sort symbols by length, by symbol order within each length */
  15136. for (symbol = 0; symbol < code_lengths_size; symbol++) {
  15137. if (code_lengths[symbol] !== 0) {
  15138. sorted[offset[code_lengths[symbol]]++] = symbol;
  15139. }
  15140. }
  15141. table_bits = root_bits;
  15142. table_size = 1 << table_bits;
  15143. total_size = table_size;
  15144. /* special case code with only one value */
  15145. if (offset[MAX_LENGTH] === 1) {
  15146. for (key = 0; key < total_size; ++key) {
  15147. root_table[table + key] = new HuffmanCode(0, sorted[0] & 0xffff);
  15148. }
  15149. return total_size;
  15150. }
  15151. /* fill in root table */
  15152. key = 0;
  15153. symbol = 0;
  15154. for (len = 1, step = 2; len <= root_bits; ++len, step <<= 1) {
  15155. for (; count[len] > 0; --count[len]) {
  15156. code = new HuffmanCode(len & 0xff, sorted[symbol++] & 0xffff);
  15157. ReplicateValue(root_table, table + key, step, table_size, code);
  15158. key = GetNextKey(key, len);
  15159. }
  15160. }
  15161. /* fill in 2nd level tables and add pointers to root table */
  15162. mask = total_size - 1;
  15163. low = -1;
  15164. for (len = root_bits + 1, step = 2; len <= MAX_LENGTH; ++len, step <<= 1) {
  15165. for (; count[len] > 0; --count[len]) {
  15166. if ((key & mask) !== low) {
  15167. table += table_size;
  15168. table_bits = NextTableBitSize(count, len, root_bits);
  15169. table_size = 1 << table_bits;
  15170. total_size += table_size;
  15171. low = key & mask;
  15172. root_table[start_table + low] = new HuffmanCode((table_bits + root_bits) & 0xff, ((table - start_table) - low) & 0xffff);
  15173. }
  15174. code = new HuffmanCode((len - root_bits) & 0xff, sorted[symbol++] & 0xffff);
  15175. ReplicateValue(root_table, table + (key >> root_bits), step, table_size, code);
  15176. key = GetNextKey(key, len);
  15177. }
  15178. }
  15179. return total_size;
  15180. }
  15181. /***/ }),
  15182. /* 209 */
  15183. /***/ (function(module, exports, __webpack_require__) {
  15184. "use strict";
  15185. var AI, AL, BA, BK, CB, CJ, CR, ID, LF, NL, NS, SA, SG, SP, WJ, XX;
  15186. var UnicodeTrie = __webpack_require__(439);
  15187. var base64 = __webpack_require__(440);
  15188. var _require = __webpack_require__(441);
  15189. BK = _require.BK;
  15190. CR = _require.CR;
  15191. LF = _require.LF;
  15192. NL = _require.NL;
  15193. CB = _require.CB;
  15194. BA = _require.BA;
  15195. SP = _require.SP;
  15196. WJ = _require.WJ;
  15197. SP = _require.SP;
  15198. BK = _require.BK;
  15199. LF = _require.LF;
  15200. NL = _require.NL;
  15201. AI = _require.AI;
  15202. AL = _require.AL;
  15203. SA = _require.SA;
  15204. SG = _require.SG;
  15205. XX = _require.XX;
  15206. CJ = _require.CJ;
  15207. ID = _require.ID;
  15208. NS = _require.NS;
  15209. var _require2 = __webpack_require__(442),
  15210. DI_BRK = _require2.DI_BRK,
  15211. IN_BRK = _require2.IN_BRK,
  15212. CI_BRK = _require2.CI_BRK,
  15213. CP_BRK = _require2.CP_BRK,
  15214. PR_BRK = _require2.PR_BRK,
  15215. pairTable = _require2.pairTable;
  15216. var data = base64.toByteArray("AA4IAAAAAAAAAhqg5VV7NJtZvz7fTC8zU5deplUlMrQoWqmqahD5So0aipYWrUhVFSVBQ10iSTtUtW6nKDVF6k7d75eQfEUbFcQ9KiFS90tQEolcP23nrLPmO+esr/+f39rr/a293t/e7/P8nmfvlz0O6RvrBJADtbBNaD88IOKTOmOrCqhu9zE770vc1pBV/xL5dxj2V7Zj4FGSomFKStCWNlV7hG1VabZfZ1LaHbFrRwzzLjzPoi1UHDnlV/lWbhgIIJvLBp/pu7AHEdRnIY+ROdXxg4fNpMdTxVnnm08OjozejAVsBqwqz8kddGRlRxsd8c55dNZoPuex6a7Dt6L0NNb03sqgTlR2/OT7eTt0Y0WnpUXxLsp5SMANc4DsmX4zJUBQvznwexm9tsMH+C9uRYMPOd96ZHB29NZjCIM2nfO7tsmQveX3l2r7ft0N4/SRJ7kO6Y8ZCaeuUQ4gMTZ67cp7TgxvlNDsPgOBdZi2YTam5Q7m3+00l+XG7PrDe6YoPmHgK+yLih7fAR16ZFCeD9WvOVt+gfNW/KT5/M6rb/9KERt+N1lad5RneVjzxXHsLofuU+TvrEsr3+26sVz5WJh6L/svoPK3qepFH9bysDljWtD1F7KrxzW1i9r+e/NLxV/acts7zuo304J9+t3Pd6Y6u8f3EAqxNRgv5DZjaI3unyvkvHPya/v3mWVYOC38qBq11+yHZ2bAyP1HbkV92vdno7r2lxz9UwCdCJVfd14NLcpO2CadHS/XPJ9doXgz5vLv/1OBVS3gX0D9n6LiNIDfpilO9RsLgZ2W/wIy8W/Rh93jfoz4qmRV2xElv6p2lRXQdO6/Cv8f5nGn3u0wLXjhnvClabL1o+7yvIpvLfT/xsKG30y/sTvq30ia9Czxp9dr9v/e7Yn/O0QJXxxBOJmceP/DBFa1q1v6oudn/e6qc/37dUoNvnYL4plQ9OoneYOh/r8fOFm7yl7FETHY9dXd5K2n/qEc53dOEe1TTJcvCfp1dpTC334l0vyaFL6mttNEbFjzO+ZV2mLk0qc3BrxJ4d9gweMmjRorxb7vic0rSq6D4wzAyFWas1TqPE0sLI8XLAryC8tPChaN3ALEZSWmtB34SyZcxXYn/E4Tg0LeMIPhgPKD9zyHGMxxhxnDDih7eI86xECTM8zodUCdgffUmRh4rQ8zyA6ow/Aei+01a8OMfziQQ+GAEkhwN/cqUFYAVzA9ex4n6jgtsiMvXf5BtXxEU4hSphvx3v8+9au8eEekEEpkrkne/zB1M+HAPuXIz3paxKlfe8aDMfGWAX6Md6PuuAdKHFVH++Ed5LEji94Z5zeiJIxbmWeN7rr1/ZcaBl5/nimdHsHgIH/ssyLUXZ4fDQ46HnBb+hQqG8yNiKRrXL/b1IPYDUsu3dFKtRMcjqlRvONd4xBvOufx2cUHuk8pmG1D7PyOQmUmluisVFS9OWS8fPIe8LiCtjwJKnEC9hrS9uKmISI3Wa5+vdXUG9dtyfr7g/oJv2wbzeZU838G6mEvntUb3SVV/fBZ6H/sL+lElzeRrHy2Xbe7UWX1q5sgOQ81rv+2baej4fP4m5Mf/GkoxfDtT3++KP7do9Jn26aa6xAhCf5L9RZVfkWKCcjI1eYbm2plvTEqkDxKC402bGzXCYaGnuALHabBT1dFLuOSB7RorOPEhZah1NjZIgR/UFGfK3p1ElYnevOMBDLURdpIjrI+qZk4sffGbRFiXuEmdFjiAODlQCJvIaB1rW61Ljg3y4eS4LAcSgDxxZQs0DYa15wA032Z+lGUfpoyOrFo3mg1sRQtN/fHHCx3TrM8eTrldMbYisDLXbUDoXMLejSq0fUNuO1muX0gEa8vgyegkqiqqbC3W0S4cC9Kmt8MuS/hFO7Xei3f8rSvIjeveMM7kxjUixOrl6gJshe4JU7PhOHpfrRYvu7yoAZKa3Buyk2J+K5W+nNTz1nhJDhRUfDJLiUXxjxXCJeeaOe/r7HlBP/uURc/5efaZEPxr55Qj39rfTLkugUGyMrwo7HAglfEjDriehF1jXtwJkPoiYkYQ5aoXSA7qbCBGKq5hwtu2VkpI9xVDop/1xrC52eiIvCoPWx4lLl40jm9upvycVPfpaH9/o2D4xKXpeNjE2HPQRS+3RFaYTc4Txw7Dvq5X6JBRwzs9mvoB49BK6b+XgsZVJYiInTlSXZ+62FT18mkFVcPKCJsoF5ahb19WheZLUYsSwdrrVM3aQ2XE6SzU2xHDS6iWkodk5AF6F8WUNmmushi8aVpMPwiIfEiQWo3CApONDRjrhDiVnkaFsaP5rjIJkmsN6V26li5LNM3JxGSyKgomknTyyrhcnwv9Qcqaq5utAh44W30SWo8Q0XHKR0glPF4fWst1FUCnk2woFq3iy9fAbzcjJ8fvSjgKVOfn14RDqyQuIgaGJZuswTywdCFSa89SakMf6fe+9KaQMYQlKxiJBczuPSho4wmBjdA+ag6QUOr2GdpcbSl51Ay6khhBt5UXdrnxc7ZGMxCvz96A4oLocxh2+px+1zkyLacCGrxnPzTRSgrLKpStFpH5ppKWm7PgMKZtwgytKLOjbGCOQLTm+KOowqa1sdut9raj1CZFkZD0jbaKNLpJUarSH5Qknx1YiOxdA5L6d5sfI/unmkSF65Ic/AvtXt98Pnrdwl5vgppQ3dYzWFwknZsy6xh2llmLxpegF8ayLwniknlXRHiF4hzzrgB8jQ4wdIqcaHCEAxyJwCeGkXPBZYSrrGa4vMwZvNN9aK0F4JBOK9mQ8g8EjEbIQVwvfS2D8GuCYsdqwqSWbQrfWdTRUJMqmpnWPax4Z7E137I6brHbvjpPlfNZpF1d7PP7HB/MPHcHVKTMhLO4f3CZcaccZEOiS2DpKiQB5KXDJ+Ospcz4qTRCRxgrKEQIgUkKLTKKwskdx2DWo3bg3PEoB5h2nA24olwfKSR+QR6TAvEDi/0czhUT59RZmO1MGeKGeEfuOSPWfL+XKmhqpZmOVR9mJVNDPKOS49Lq+Um10YsBybzDMtemlPCOJEtE8zaXhsaqEs9bngSJGhlOTTMlCXly9Qv5cRN3PVLK7zoMptutf7ihutrQ/Xj7VqeCdUwleTTKklOI8Wep9h7fCY0kVtDtIWKnubWAvbNZtsRRqOYl802vebPEkZRSZc6wXOfPtpPtN5HI63EUFfsy7U/TLr8NkIzaY3vx4A28x765XZMzRZTpMk81YIMuwJ5+/zoCuZj1wGnaHObxa5rpKZj4WhT670maRw04w0e3cZW74Z0aZe2n05hjZaxm6urenz8Ef5O6Yu1J2aqYAlqsCXs5ZB5o1JJ5l3xkTVr8rJQ09NLsBqRRDT2IIjOPmcJa6xQ1R5yGP9jAsj23xYDTezdyqG8YWZ7vJBIWK56K+iDgcHimiQOTIasNSua1fOBxsKMMEKd15jxTl+3CyvGCR+UyRwuSI2XuwRIPoNNclPihfJhaq2mKkNijwYLY6feqohktukmI3KDvOpN7ItCqHHhNuKlxMfBAEO5LjW2RKh6lE5Hd1dtAOopac/Z4FdsNsjMhXz/ug8JGmbVJTA+VOBJXdrYyJcIn5+OEeoK8kWEWF+wdG8ZtZHKSquWDtDVyhFPkRVqguKFkLkKCz46hcU1SUY9oJ2Sk+dmq0kglqk4kqKT1CV9JDELPjK1WsWGkEXF87g9P98e5ff0mIupm/w6vc3kCeq04X5bgJQlcMFRjlFWmSk+kssXCAVikfeAlMuzpUvCSdXiG+dc6KrIiLxxhbEVuKf7vW7KmDQI95bZe3H9mN3/77F6fZ2Yx/F9yClllj8gXpLWLpd5+v90iOaFa9sd7Pvx0lNa1o1+bkiZ69wCiC2x9UIb6/boBCuNMB/HYR0RC6+FD9Oe5qrgQl6JbXtkaYn0wkdNhROLqyhv6cKvyMj1Fvs2o3OOKoMYTubGENLfY5F6H9d8wX1cnINsvz+wZFQu3zhWVlwJvwBEp69Dqu/ZnkBf3nIfbx4TK7zOVJH5sGJX+IMwkn1vVBn38GbpTg9bJnMcTOb5F6Ci5gOn9Fcy6Qzcu+FL6mYJJ+f2ZZJGda1VqruZ0JRXItp8X0aTjIcJgzdaXlha7q7kV4ebrMsunfsRyRa9qYuryBHA0hc1KVsKdE+oI0ljLmSAyMze8lWmc5/lQ18slyTVC/vADTc+SNM5++gztTBLz4m0aVUKcfgOEExuKVomJ7XQDZuziMDjG6JP9tgR7JXZTeo9RGetW/Xm9/TgPJpTgHACPOGvmy2mDm9fl09WeMm9sQUAXP3Su2uApeCwJVT5iWCXDgmcuTsFgU9Nm6/PusJzSbDQIMfl6INY/OAEvZRN54BSSXUClM51im6Wn9VhVamKJmzOaFJErgJcs0etFZ40LIF3EPkjFTjGmAhsd174NnOwJW8TdJ1Dja+E6Wa6FVS22Haj1DDA474EesoMP5nbspAPJLWJ8rYcP1DwCslhnn+gTFm+sS9wY+U6SogAa9tiwpoxuaFeqm2OK+uozR6SfiLCOPz36LiDlzXr6UWd7BpY6mlrNANkTOeme5EgnnAkQRTGo9T6iYxbUKfGJcI9B+ub2PcyUOgpwXbOf3bHFWtygD7FYbRhb+vkzi87dB0JeXl/vBpBUz93VtqZi7AL7C1VowTF+tGmyurw7DBcktc+UMY0E10Jw4URojf8NdaNpN6E1q4+Oz+4YePtMLy8FPRP");
  15217. var classTrie = new UnicodeTrie(data);
  15218. var mapClass = function mapClass(c) {
  15219. switch (c) {
  15220. case AI:
  15221. return AL;
  15222. case SA:
  15223. case SG:
  15224. case XX:
  15225. return AL;
  15226. case CJ:
  15227. return NS;
  15228. default:
  15229. return c;
  15230. }
  15231. };
  15232. var mapFirst = function mapFirst(c) {
  15233. switch (c) {
  15234. case LF:
  15235. case NL:
  15236. return BK;
  15237. case CB:
  15238. return BA;
  15239. case SP:
  15240. return WJ;
  15241. default:
  15242. return c;
  15243. }
  15244. };
  15245. var Break = function Break(position, required) {
  15246. if (required === void 0) {
  15247. required = false;
  15248. }
  15249. this.position = position;
  15250. this.required = required;
  15251. };
  15252. ;
  15253. var LineBreaker = /*#__PURE__*/function () {
  15254. function LineBreaker(string) {
  15255. this.string = string;
  15256. this.pos = 0;
  15257. this.lastPos = 0;
  15258. this.curClass = null;
  15259. this.nextClass = null;
  15260. }
  15261. var _proto = LineBreaker.prototype;
  15262. _proto.nextCodePoint = function nextCodePoint() {
  15263. var code = this.string.charCodeAt(this.pos++);
  15264. var next = this.string.charCodeAt(this.pos); // If a surrogate pair
  15265. if (0xd800 <= code && code <= 0xdbff && 0xdc00 <= next && next <= 0xdfff) {
  15266. this.pos++;
  15267. return (code - 0xd800) * 0x400 + (next - 0xdc00) + 0x10000;
  15268. }
  15269. return code;
  15270. };
  15271. _proto.nextCharClass = function nextCharClass() {
  15272. return mapClass(classTrie.get(this.nextCodePoint()));
  15273. };
  15274. _proto.nextBreak = function nextBreak() {
  15275. // get the first char if we're at the beginning of the string
  15276. if (this.curClass == null) {
  15277. this.curClass = mapFirst(this.nextCharClass());
  15278. }
  15279. while (this.pos < this.string.length) {
  15280. this.lastPos = this.pos;
  15281. var lastClass = this.nextClass;
  15282. this.nextClass = this.nextCharClass(); // explicit newline
  15283. if (this.curClass === BK || this.curClass === CR && this.nextClass !== LF) {
  15284. this.curClass = mapFirst(mapClass(this.nextClass));
  15285. return new Break(this.lastPos, true);
  15286. } // handle classes not handled by the pair table
  15287. var cur = void 0;
  15288. switch (this.nextClass) {
  15289. case SP:
  15290. cur = this.curClass;
  15291. break;
  15292. case BK:
  15293. case LF:
  15294. case NL:
  15295. cur = BK;
  15296. break;
  15297. case CR:
  15298. cur = CR;
  15299. break;
  15300. case CB:
  15301. cur = BA;
  15302. break;
  15303. }
  15304. if (cur != null) {
  15305. this.curClass = cur;
  15306. if (this.nextClass === CB) {
  15307. return new Break(this.lastPos);
  15308. }
  15309. continue;
  15310. } // if not handled already, use the pair table
  15311. var shouldBreak = false;
  15312. switch (pairTable[this.curClass][this.nextClass]) {
  15313. case DI_BRK:
  15314. // Direct break
  15315. shouldBreak = true;
  15316. break;
  15317. case IN_BRK:
  15318. // possible indirect break
  15319. shouldBreak = lastClass === SP;
  15320. break;
  15321. case CI_BRK:
  15322. shouldBreak = lastClass === SP;
  15323. if (!shouldBreak) {
  15324. continue;
  15325. }
  15326. break;
  15327. case CP_BRK:
  15328. // prohibited for combining marks
  15329. if (lastClass !== SP) {
  15330. continue;
  15331. }
  15332. break;
  15333. }
  15334. this.curClass = this.nextClass;
  15335. if (shouldBreak) {
  15336. return new Break(this.lastPos);
  15337. }
  15338. }
  15339. if (this.pos >= this.string.length) {
  15340. if (this.lastPos < this.string.length) {
  15341. this.lastPos = this.string.length;
  15342. return new Break(this.string.length);
  15343. } else {
  15344. return null;
  15345. }
  15346. }
  15347. };
  15348. return LineBreaker;
  15349. }();
  15350. ;
  15351. module.exports = LineBreaker;
  15352. /***/ }),
  15353. /* 210 */
  15354. /***/ (function(module, exports, __webpack_require__) {
  15355. "use strict";
  15356. function TraversalTracker() {
  15357. this.events = {};
  15358. }
  15359. TraversalTracker.prototype.startTracking = function (event, callback) {
  15360. var callbacks = this.events[event] || (this.events[event] = []);
  15361. if (callbacks.indexOf(callback) < 0) {
  15362. callbacks.push(callback);
  15363. }
  15364. };
  15365. TraversalTracker.prototype.stopTracking = function (event, callback) {
  15366. var callbacks = this.events[event];
  15367. if (!callbacks) {
  15368. return;
  15369. }
  15370. var index = callbacks.indexOf(callback);
  15371. if (index >= 0) {
  15372. callbacks.splice(index, 1);
  15373. }
  15374. };
  15375. TraversalTracker.prototype.emit = function (event) {
  15376. var args = Array.prototype.slice.call(arguments, 1);
  15377. var callbacks = this.events[event];
  15378. if (!callbacks) {
  15379. return;
  15380. }
  15381. callbacks.forEach(function (callback) {
  15382. callback.apply(this, args);
  15383. });
  15384. };
  15385. TraversalTracker.prototype.auto = function (event, callback, innerFunction) {
  15386. this.startTracking(event, callback);
  15387. innerFunction();
  15388. this.stopTracking(event, callback);
  15389. };
  15390. module.exports = TraversalTracker;
  15391. /***/ }),
  15392. /* 211 */
  15393. /***/ (function(module, exports, __webpack_require__) {
  15394. "use strict";
  15395. var isString = __webpack_require__(0).isString;
  15396. var isArray = __webpack_require__(0).isArray;
  15397. var isUndefined = __webpack_require__(0).isUndefined;
  15398. var isNull = __webpack_require__(0).isNull;
  15399. /**
  15400. * Creates an instance of StyleContextStack used for style inheritance and style overrides
  15401. *
  15402. * @constructor
  15403. * @this {StyleContextStack}
  15404. * @param {Object} named styles dictionary
  15405. * @param {Object} optional default style definition
  15406. */
  15407. function StyleContextStack(styleDictionary, defaultStyle) {
  15408. this.defaultStyle = defaultStyle || {};
  15409. this.styleDictionary = styleDictionary;
  15410. this.styleOverrides = [];
  15411. }
  15412. /**
  15413. * Creates cloned version of current stack
  15414. * @return {StyleContextStack} current stack snapshot
  15415. */
  15416. StyleContextStack.prototype.clone = function () {
  15417. var stack = new StyleContextStack(this.styleDictionary, this.defaultStyle);
  15418. this.styleOverrides.forEach(function (item) {
  15419. stack.styleOverrides.push(item);
  15420. });
  15421. return stack;
  15422. };
  15423. /**
  15424. * Pushes style-name or style-overrides-object onto the stack for future evaluation
  15425. *
  15426. * @param {String|Object} styleNameOrOverride style-name (referring to styleDictionary) or
  15427. * a new dictionary defining overriding properties
  15428. */
  15429. StyleContextStack.prototype.push = function (styleNameOrOverride) {
  15430. this.styleOverrides.push(styleNameOrOverride);
  15431. };
  15432. /**
  15433. * Removes last style-name or style-overrides-object from the stack
  15434. *
  15435. * @param {Number} howMany - optional number of elements to be popped (if not specified,
  15436. * one element will be removed from the stack)
  15437. */
  15438. StyleContextStack.prototype.pop = function (howMany) {
  15439. howMany = howMany || 1;
  15440. while (howMany-- > 0) {
  15441. this.styleOverrides.pop();
  15442. }
  15443. };
  15444. /**
  15445. * Creates a set of named styles or/and a style-overrides-object based on the item,
  15446. * pushes those elements onto the stack for future evaluation and returns the number
  15447. * of elements pushed, so they can be easily poped then.
  15448. *
  15449. * @param {Object} item - an object with optional style property and/or style overrides
  15450. * @return the number of items pushed onto the stack
  15451. */
  15452. StyleContextStack.prototype.autopush = function (item) {
  15453. if (isString(item)) {
  15454. return 0;
  15455. }
  15456. var styleNames = [];
  15457. if (item.style) {
  15458. if (isArray(item.style)) {
  15459. styleNames = item.style;
  15460. } else {
  15461. styleNames = [item.style];
  15462. }
  15463. }
  15464. for (var i = 0, l = styleNames.length; i < l; i++) {
  15465. this.push(styleNames[i]);
  15466. }
  15467. var styleProperties = [
  15468. 'font',
  15469. 'fontSize',
  15470. 'fontFeatures',
  15471. 'bold',
  15472. 'italics',
  15473. 'alignment',
  15474. 'color',
  15475. 'columnGap',
  15476. 'fillColor',
  15477. 'fillOpacity',
  15478. 'decoration',
  15479. 'decorationStyle',
  15480. 'decorationColor',
  15481. 'background',
  15482. 'lineHeight',
  15483. 'characterSpacing',
  15484. 'noWrap',
  15485. 'markerColor',
  15486. 'leadingIndent'
  15487. //'tableCellPadding'
  15488. // 'cellBorder',
  15489. // 'headerCellBorder',
  15490. // 'oddRowCellBorder',
  15491. // 'evenRowCellBorder',
  15492. // 'tableBorder'
  15493. ];
  15494. var styleOverrideObject = {};
  15495. var pushStyleOverrideObject = false;
  15496. styleProperties.forEach(function (key) {
  15497. if (!isUndefined(item[key]) && !isNull(item[key])) {
  15498. styleOverrideObject[key] = item[key];
  15499. pushStyleOverrideObject = true;
  15500. }
  15501. });
  15502. if (pushStyleOverrideObject) {
  15503. this.push(styleOverrideObject);
  15504. }
  15505. return styleNames.length + (pushStyleOverrideObject ? 1 : 0);
  15506. };
  15507. /**
  15508. * Automatically pushes elements onto the stack, using autopush based on item,
  15509. * executes callback and then pops elements back. Returns value returned by callback
  15510. *
  15511. * @param {Object} item - an object with optional style property and/or style overrides
  15512. * @param {Function} function to be called between autopush and pop
  15513. * @return {Object} value returned by callback
  15514. */
  15515. StyleContextStack.prototype.auto = function (item, callback) {
  15516. var pushedItems = this.autopush(item);
  15517. var result = callback();
  15518. if (pushedItems > 0) {
  15519. this.pop(pushedItems);
  15520. }
  15521. return result;
  15522. };
  15523. /**
  15524. * Evaluates stack and returns value of a named property
  15525. *
  15526. * @param {String} property - property name
  15527. * @return property value or null if not found
  15528. */
  15529. StyleContextStack.prototype.getProperty = function (property) {
  15530. if (this.styleOverrides) {
  15531. for (var i = this.styleOverrides.length - 1; i >= 0; i--) {
  15532. var item = this.styleOverrides[i];
  15533. if (isString(item)) {
  15534. // named-style-override
  15535. var style = this.styleDictionary[item];
  15536. if (style && !isUndefined(style[property]) && !isNull(style[property])) {
  15537. return style[property];
  15538. }
  15539. } else if (!isUndefined(item[property]) && !isNull(item[property])) {
  15540. // style-overrides-object
  15541. return item[property];
  15542. }
  15543. }
  15544. }
  15545. return this.defaultStyle && this.defaultStyle[property];
  15546. };
  15547. module.exports = StyleContextStack;
  15548. /***/ }),
  15549. /* 212 */
  15550. /***/ (function(module, exports, __webpack_require__) {
  15551. "use strict";
  15552. var TraversalTracker = __webpack_require__(210);
  15553. var isString = __webpack_require__(0).isString;
  15554. /**
  15555. * Creates an instance of DocumentContext - a store for current x, y positions and available width/height.
  15556. * It facilitates column divisions and vertical sync
  15557. */
  15558. function DocumentContext(pageSize, pageMargins) {
  15559. this.pages = [];
  15560. this.pageMargins = pageMargins;
  15561. this.x = pageMargins.left;
  15562. this.availableWidth = pageSize.width - pageMargins.left - pageMargins.right;
  15563. this.availableHeight = 0;
  15564. this.page = -1;
  15565. this.snapshots = [];
  15566. this.endingCell = null;
  15567. this.tracker = new TraversalTracker();
  15568. this.backgroundLength = [];
  15569. this.addPage(pageSize);
  15570. }
  15571. DocumentContext.prototype.beginColumnGroup = function () {
  15572. this.snapshots.push({
  15573. x: this.x,
  15574. y: this.y,
  15575. availableHeight: this.availableHeight,
  15576. availableWidth: this.availableWidth,
  15577. page: this.page,
  15578. bottomMost: {
  15579. x: this.x,
  15580. y: this.y,
  15581. availableHeight: this.availableHeight,
  15582. availableWidth: this.availableWidth,
  15583. page: this.page
  15584. },
  15585. endingCell: this.endingCell,
  15586. lastColumnWidth: this.lastColumnWidth
  15587. });
  15588. this.lastColumnWidth = 0;
  15589. };
  15590. DocumentContext.prototype.beginColumn = function (width, offset, endingCell) {
  15591. var saved = this.snapshots[this.snapshots.length - 1];
  15592. this.calculateBottomMost(saved);
  15593. this.endingCell = endingCell;
  15594. this.page = saved.page;
  15595. this.x = this.x + this.lastColumnWidth + (offset || 0);
  15596. this.y = saved.y;
  15597. this.availableWidth = width; //saved.availableWidth - offset;
  15598. this.availableHeight = saved.availableHeight;
  15599. this.lastColumnWidth = width;
  15600. };
  15601. DocumentContext.prototype.calculateBottomMost = function (destContext) {
  15602. if (this.endingCell) {
  15603. this.saveContextInEndingCell(this.endingCell);
  15604. this.endingCell = null;
  15605. } else {
  15606. destContext.bottomMost = bottomMostContext(this, destContext.bottomMost);
  15607. }
  15608. };
  15609. DocumentContext.prototype.markEnding = function (endingCell) {
  15610. this.page = endingCell._columnEndingContext.page;
  15611. this.x = endingCell._columnEndingContext.x;
  15612. this.y = endingCell._columnEndingContext.y;
  15613. this.availableWidth = endingCell._columnEndingContext.availableWidth;
  15614. this.availableHeight = endingCell._columnEndingContext.availableHeight;
  15615. this.lastColumnWidth = endingCell._columnEndingContext.lastColumnWidth;
  15616. };
  15617. DocumentContext.prototype.saveContextInEndingCell = function (endingCell) {
  15618. endingCell._columnEndingContext = {
  15619. page: this.page,
  15620. x: this.x,
  15621. y: this.y,
  15622. availableHeight: this.availableHeight,
  15623. availableWidth: this.availableWidth,
  15624. lastColumnWidth: this.lastColumnWidth
  15625. };
  15626. };
  15627. DocumentContext.prototype.completeColumnGroup = function (height) {
  15628. var saved = this.snapshots.pop();
  15629. this.calculateBottomMost(saved);
  15630. this.endingCell = null;
  15631. this.x = saved.x;
  15632. var y = saved.bottomMost.y;
  15633. if (height) {
  15634. if (saved.page === saved.bottomMost.page) {
  15635. if ((saved.y + height) > y) {
  15636. y = saved.y + height;
  15637. }
  15638. } else {
  15639. y += height;
  15640. }
  15641. }
  15642. this.y = y;
  15643. this.page = saved.bottomMost.page;
  15644. this.availableWidth = saved.availableWidth;
  15645. this.availableHeight = saved.bottomMost.availableHeight;
  15646. if (height) {
  15647. this.availableHeight -= (y - saved.bottomMost.y);
  15648. }
  15649. this.lastColumnWidth = saved.lastColumnWidth;
  15650. };
  15651. DocumentContext.prototype.addMargin = function (left, right) {
  15652. this.x += left;
  15653. this.availableWidth -= left + (right || 0);
  15654. };
  15655. DocumentContext.prototype.moveDown = function (offset) {
  15656. this.y += offset;
  15657. this.availableHeight -= offset;
  15658. return this.availableHeight > 0;
  15659. };
  15660. DocumentContext.prototype.initializePage = function () {
  15661. this.y = this.pageMargins.top;
  15662. this.availableHeight = this.getCurrentPage().pageSize.height - this.pageMargins.top - this.pageMargins.bottom;
  15663. this.pageSnapshot().availableWidth = this.getCurrentPage().pageSize.width - this.pageMargins.left - this.pageMargins.right;
  15664. };
  15665. DocumentContext.prototype.pageSnapshot = function () {
  15666. if (this.snapshots[0]) {
  15667. return this.snapshots[0];
  15668. } else {
  15669. return this;
  15670. }
  15671. };
  15672. DocumentContext.prototype.moveTo = function (x, y) {
  15673. if (x !== undefined && x !== null) {
  15674. this.x = x;
  15675. this.availableWidth = this.getCurrentPage().pageSize.width - this.x - this.pageMargins.right;
  15676. }
  15677. if (y !== undefined && y !== null) {
  15678. this.y = y;
  15679. this.availableHeight = this.getCurrentPage().pageSize.height - this.y - this.pageMargins.bottom;
  15680. }
  15681. };
  15682. DocumentContext.prototype.moveToRelative = function (x, y) {
  15683. if (x !== undefined && x !== null) {
  15684. this.x = this.x + x;
  15685. }
  15686. if (y !== undefined && y !== null) {
  15687. this.y = this.y + y;
  15688. }
  15689. };
  15690. DocumentContext.prototype.beginDetachedBlock = function () {
  15691. this.snapshots.push({
  15692. x: this.x,
  15693. y: this.y,
  15694. availableHeight: this.availableHeight,
  15695. availableWidth: this.availableWidth,
  15696. page: this.page,
  15697. endingCell: this.endingCell,
  15698. lastColumnWidth: this.lastColumnWidth
  15699. });
  15700. };
  15701. DocumentContext.prototype.endDetachedBlock = function () {
  15702. var saved = this.snapshots.pop();
  15703. this.x = saved.x;
  15704. this.y = saved.y;
  15705. this.availableWidth = saved.availableWidth;
  15706. this.availableHeight = saved.availableHeight;
  15707. this.page = saved.page;
  15708. this.endingCell = saved.endingCell;
  15709. this.lastColumnWidth = saved.lastColumnWidth;
  15710. };
  15711. function pageOrientation(pageOrientationString, currentPageOrientation) {
  15712. if (pageOrientationString === undefined) {
  15713. return currentPageOrientation;
  15714. } else if (isString(pageOrientationString) && (pageOrientationString.toLowerCase() === 'landscape')) {
  15715. return 'landscape';
  15716. } else {
  15717. return 'portrait';
  15718. }
  15719. }
  15720. var getPageSize = function (currentPage, newPageOrientation) {
  15721. newPageOrientation = pageOrientation(newPageOrientation, currentPage.pageSize.orientation);
  15722. if (newPageOrientation !== currentPage.pageSize.orientation) {
  15723. return {
  15724. orientation: newPageOrientation,
  15725. width: currentPage.pageSize.height,
  15726. height: currentPage.pageSize.width
  15727. };
  15728. } else {
  15729. return {
  15730. orientation: currentPage.pageSize.orientation,
  15731. width: currentPage.pageSize.width,
  15732. height: currentPage.pageSize.height
  15733. };
  15734. }
  15735. };
  15736. DocumentContext.prototype.moveToNextPage = function (pageOrientation) {
  15737. var nextPageIndex = this.page + 1;
  15738. var prevPage = this.page;
  15739. var prevY = this.y;
  15740. var createNewPage = nextPageIndex >= this.pages.length;
  15741. if (createNewPage) {
  15742. var currentAvailableWidth = this.availableWidth;
  15743. var currentPageOrientation = this.getCurrentPage().pageSize.orientation;
  15744. var pageSize = getPageSize(this.getCurrentPage(), pageOrientation);
  15745. this.addPage(pageSize);
  15746. if (currentPageOrientation === pageSize.orientation) {
  15747. this.availableWidth = currentAvailableWidth;
  15748. }
  15749. } else {
  15750. this.page = nextPageIndex;
  15751. this.initializePage();
  15752. }
  15753. return {
  15754. newPageCreated: createNewPage,
  15755. prevPage: prevPage,
  15756. prevY: prevY,
  15757. y: this.y
  15758. };
  15759. };
  15760. DocumentContext.prototype.addPage = function (pageSize) {
  15761. var page = { items: [], pageSize: pageSize };
  15762. this.pages.push(page);
  15763. this.backgroundLength.push(0);
  15764. this.page = this.pages.length - 1;
  15765. this.initializePage();
  15766. this.tracker.emit('pageAdded');
  15767. return page;
  15768. };
  15769. DocumentContext.prototype.getCurrentPage = function () {
  15770. if (this.page < 0 || this.page >= this.pages.length) {
  15771. return null;
  15772. }
  15773. return this.pages[this.page];
  15774. };
  15775. DocumentContext.prototype.getCurrentPosition = function () {
  15776. var pageSize = this.getCurrentPage().pageSize;
  15777. var innerHeight = pageSize.height - this.pageMargins.top - this.pageMargins.bottom;
  15778. var innerWidth = pageSize.width - this.pageMargins.left - this.pageMargins.right;
  15779. return {
  15780. pageNumber: this.page + 1,
  15781. pageOrientation: pageSize.orientation,
  15782. pageInnerHeight: innerHeight,
  15783. pageInnerWidth: innerWidth,
  15784. left: this.x,
  15785. top: this.y,
  15786. verticalRatio: ((this.y - this.pageMargins.top) / innerHeight),
  15787. horizontalRatio: ((this.x - this.pageMargins.left) / innerWidth)
  15788. };
  15789. };
  15790. function bottomMostContext(c1, c2) {
  15791. var r;
  15792. if (c1.page > c2.page) {
  15793. r = c1;
  15794. } else if (c2.page > c1.page) {
  15795. r = c2;
  15796. } else {
  15797. r = (c1.y > c2.y) ? c1 : c2;
  15798. }
  15799. return {
  15800. page: r.page,
  15801. x: r.x,
  15802. y: r.y,
  15803. availableHeight: r.availableHeight,
  15804. availableWidth: r.availableWidth
  15805. };
  15806. }
  15807. module.exports = DocumentContext;
  15808. /***/ }),
  15809. /* 213 */
  15810. /***/ (function(module, exports, __webpack_require__) {
  15811. "use strict";
  15812. /**
  15813. * Creates an instance of Line
  15814. *
  15815. * @constructor
  15816. * @this {Line}
  15817. * @param {Number} Maximum width this line can have
  15818. */
  15819. function Line(maxWidth) {
  15820. this.maxWidth = maxWidth;
  15821. this.leadingCut = 0;
  15822. this.trailingCut = 0;
  15823. this.inlineWidths = 0;
  15824. this.inlines = [];
  15825. }
  15826. Line.prototype.getAscenderHeight = function () {
  15827. var y = 0;
  15828. this.inlines.forEach(function (inline) {
  15829. y = Math.max(y, inline.font.ascender / 1000 * inline.fontSize);
  15830. });
  15831. return y;
  15832. };
  15833. Line.prototype.hasEnoughSpaceForInline = function (inline, nextInlines) {
  15834. nextInlines = nextInlines || [];
  15835. if (this.inlines.length === 0) {
  15836. return true;
  15837. }
  15838. if (this.newLineForced) {
  15839. return false;
  15840. }
  15841. var inlineWidth = inline.width;
  15842. var inlineTrailingCut = inline.trailingCut || 0;
  15843. if (inline.noNewLine) {
  15844. for (var i = 0, l = nextInlines.length; i < l; i++) {
  15845. var nextInline = nextInlines[i];
  15846. inlineWidth += nextInline.width;
  15847. inlineTrailingCut += nextInline.trailingCut || 0;
  15848. if (!nextInline.noNewLine) {
  15849. break;
  15850. }
  15851. }
  15852. }
  15853. return (this.inlineWidths + inlineWidth - this.leadingCut - inlineTrailingCut) <= this.maxWidth;
  15854. };
  15855. Line.prototype.addInline = function (inline) {
  15856. if (this.inlines.length === 0) {
  15857. this.leadingCut = inline.leadingCut || 0;
  15858. }
  15859. this.trailingCut = inline.trailingCut || 0;
  15860. inline.x = this.inlineWidths - this.leadingCut;
  15861. this.inlines.push(inline);
  15862. this.inlineWidths += inline.width;
  15863. if (inline.lineEnd) {
  15864. this.newLineForced = true;
  15865. }
  15866. };
  15867. Line.prototype.getWidth = function () {
  15868. return this.inlineWidths - this.leadingCut - this.trailingCut;
  15869. };
  15870. Line.prototype.getAvailableWidth = function () {
  15871. return this.maxWidth - this.getWidth();
  15872. };
  15873. /**
  15874. * Returns line height
  15875. * @return {Number}
  15876. */
  15877. Line.prototype.getHeight = function () {
  15878. var max = 0;
  15879. this.inlines.forEach(function (item) {
  15880. max = Math.max(max, item.height || 0);
  15881. });
  15882. return max;
  15883. };
  15884. module.exports = Line;
  15885. /***/ }),
  15886. /* 214 */
  15887. /***/ (function(module, exports, __webpack_require__) {
  15888. /* WEBPACK VAR INJECTION */(function(global) {module.exports = global["pdfMake"] = __webpack_require__(215);
  15889. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(22)))
  15890. /***/ }),
  15891. /* 215 */
  15892. /***/ (function(module, exports, __webpack_require__) {
  15893. "use strict";
  15894. /* WEBPACK VAR INJECTION */(function(Buffer, global) {
  15895. var isFunction = __webpack_require__(0).isFunction;
  15896. var isUndefined = __webpack_require__(0).isUndefined;
  15897. var isNull = __webpack_require__(0).isNull;
  15898. var FileSaver = __webpack_require__(218);
  15899. var saveAs = FileSaver.saveAs;
  15900. var defaultClientFonts = {
  15901. Roboto: {
  15902. normal: 'Roboto-Regular.ttf',
  15903. bold: 'Roboto-Medium.ttf',
  15904. italics: 'Roboto-Italic.ttf',
  15905. bolditalics: 'Roboto-MediumItalic.ttf'
  15906. }
  15907. };
  15908. function Document(docDefinition, tableLayouts, fonts, vfs) {
  15909. this.docDefinition = docDefinition;
  15910. this.tableLayouts = tableLayouts || null;
  15911. this.fonts = fonts || defaultClientFonts;
  15912. this.vfs = vfs;
  15913. }
  15914. function canCreatePdf() {
  15915. // Ensure the browser provides the level of support needed
  15916. if (!Object.keys || typeof Uint16Array === 'undefined') {
  15917. return false;
  15918. }
  15919. return true;
  15920. }
  15921. Document.prototype._createDoc = function (options) {
  15922. options = options || {};
  15923. if (this.tableLayouts) {
  15924. options.tableLayouts = this.tableLayouts;
  15925. }
  15926. var PdfPrinter = __webpack_require__(219);
  15927. var printer = new PdfPrinter(this.fonts);
  15928. __webpack_require__(84).bindFS(this.vfs); // bind virtual file system to file system
  15929. var doc = printer.createPdfKitDocument(this.docDefinition, options);
  15930. return doc;
  15931. };
  15932. Document.prototype._flushDoc = function (doc, callback) {
  15933. var chunks = [];
  15934. var result;
  15935. doc.on('readable', function () {
  15936. var chunk;
  15937. while ((chunk = doc.read(9007199254740991)) !== null) {
  15938. chunks.push(chunk);
  15939. }
  15940. });
  15941. doc.on('end', function () {
  15942. result = Buffer.concat(chunks);
  15943. callback(result, doc._pdfMakePages);
  15944. });
  15945. doc.end();
  15946. };
  15947. Document.prototype._getPages = function (options, cb) {
  15948. if (!cb) {
  15949. throw '_getPages is an async method and needs a callback argument';
  15950. }
  15951. var doc = this._createDoc(options);
  15952. this._flushDoc(doc, function (ignoreBuffer, pages) {
  15953. cb(pages);
  15954. });
  15955. };
  15956. Document.prototype._bufferToBlob = function (buffer) {
  15957. var blob;
  15958. try {
  15959. blob = new Blob([buffer], { type: 'application/pdf' });
  15960. } catch (e) {
  15961. // Old browser which can't handle it without making it an byte array (ie10)
  15962. if (e.name === 'InvalidStateError') {
  15963. var byteArray = new Uint8Array(buffer);
  15964. blob = new Blob([byteArray.buffer], { type: 'application/pdf' });
  15965. }
  15966. }
  15967. if (!blob) {
  15968. throw 'Could not generate blob';
  15969. }
  15970. return blob;
  15971. };
  15972. Document.prototype._openWindow = function () {
  15973. // we have to open the window immediately and store the reference
  15974. // otherwise popup blockers will stop us
  15975. var win = window.open('', '_blank');
  15976. if (win === null) {
  15977. throw 'Open PDF in new window blocked by browser';
  15978. }
  15979. return win;
  15980. };
  15981. Document.prototype._openPdf = function (options, win) {
  15982. if (!win) {
  15983. win = this._openWindow();
  15984. }
  15985. try {
  15986. this.getBlob(function (result) {
  15987. var urlCreator = window.URL || window.webkitURL;
  15988. var pdfUrl = urlCreator.createObjectURL(result);
  15989. win.location.href = pdfUrl;
  15990. /* temporarily disabled
  15991. if (win !== window) {
  15992. setTimeout(function () {
  15993. if (isNull(win.window)) { // is closed by AdBlock
  15994. window.location.href = pdfUrl; // open in actual window
  15995. }
  15996. }, 500);
  15997. }
  15998. */
  15999. }, options);
  16000. } catch (e) {
  16001. win.close();
  16002. throw e;
  16003. }
  16004. };
  16005. Document.prototype.open = function (options, win) {
  16006. options = options || {};
  16007. options.autoPrint = false;
  16008. win = win || null;
  16009. this._openPdf(options, win);
  16010. };
  16011. Document.prototype.print = function (options, win) {
  16012. options = options || {};
  16013. options.autoPrint = true;
  16014. win = win || null;
  16015. this._openPdf(options, win);
  16016. };
  16017. /**
  16018. * download(defaultFileName = 'file.pdf', cb = null, options = {})
  16019. * or
  16020. * download(cb, options = {})
  16021. */
  16022. Document.prototype.download = function (defaultFileName, cb, options) {
  16023. if (isFunction(defaultFileName)) {
  16024. if (!isUndefined(cb)) {
  16025. options = cb;
  16026. }
  16027. cb = defaultFileName;
  16028. defaultFileName = null;
  16029. }
  16030. defaultFileName = defaultFileName || 'file.pdf';
  16031. this.getBlob(function (result) {
  16032. saveAs(result, defaultFileName);
  16033. if (isFunction(cb)) {
  16034. cb();
  16035. }
  16036. }, options);
  16037. };
  16038. Document.prototype.getBase64 = function (cb, options) {
  16039. if (!cb) {
  16040. throw 'getBase64 is an async method and needs a callback argument';
  16041. }
  16042. this.getBuffer(function (buffer) {
  16043. cb(buffer.toString('base64'));
  16044. }, options);
  16045. };
  16046. Document.prototype.getDataUrl = function (cb, options) {
  16047. if (!cb) {
  16048. throw 'getDataUrl is an async method and needs a callback argument';
  16049. }
  16050. this.getBuffer(function (buffer) {
  16051. cb('data:application/pdf;base64,' + buffer.toString('base64'));
  16052. }, options);
  16053. };
  16054. Document.prototype.getBlob = function (cb, options) {
  16055. if (!cb) {
  16056. throw 'getBlob is an async method and needs a callback argument';
  16057. }
  16058. var that = this;
  16059. this.getBuffer(function (result) {
  16060. var blob = that._bufferToBlob(result);
  16061. cb(blob);
  16062. }, options);
  16063. };
  16064. Document.prototype.getBuffer = function (cb, options) {
  16065. if (!cb) {
  16066. throw 'getBuffer is an async method and needs a callback argument';
  16067. }
  16068. var doc = this._createDoc(options);
  16069. this._flushDoc(doc, function (buffer) {
  16070. cb(buffer);
  16071. });
  16072. };
  16073. Document.prototype.getStream = function (options) {
  16074. var doc = this._createDoc(options);
  16075. return doc;
  16076. };
  16077. module.exports = {
  16078. createPdf: function (docDefinition, tableLayouts, fonts, vfs) {
  16079. if (!canCreatePdf()) {
  16080. throw 'Your browser does not provide the level of support needed';
  16081. }
  16082. return new Document(
  16083. docDefinition,
  16084. tableLayouts || global.pdfMake.tableLayouts,
  16085. fonts || global.pdfMake.fonts,
  16086. vfs || global.pdfMake.vfs
  16087. );
  16088. }
  16089. };
  16090. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(4).Buffer, __webpack_require__(22)))
  16091. /***/ }),
  16092. /* 216 */
  16093. /***/ (function(module, exports, __webpack_require__) {
  16094. "use strict";
  16095. exports.byteLength = byteLength
  16096. exports.toByteArray = toByteArray
  16097. exports.fromByteArray = fromByteArray
  16098. var lookup = []
  16099. var revLookup = []
  16100. var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array
  16101. var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
  16102. for (var i = 0, len = code.length; i < len; ++i) {
  16103. lookup[i] = code[i]
  16104. revLookup[code.charCodeAt(i)] = i
  16105. }
  16106. // Support decoding URL-safe base64 strings, as Node.js does.
  16107. // See: https://en.wikipedia.org/wiki/Base64#URL_applications
  16108. revLookup['-'.charCodeAt(0)] = 62
  16109. revLookup['_'.charCodeAt(0)] = 63
  16110. function getLens (b64) {
  16111. var len = b64.length
  16112. if (len % 4 > 0) {
  16113. throw new Error('Invalid string. Length must be a multiple of 4')
  16114. }
  16115. // Trim off extra bytes after placeholder bytes are found
  16116. // See: https://github.com/beatgammit/base64-js/issues/42
  16117. var validLen = b64.indexOf('=')
  16118. if (validLen === -1) validLen = len
  16119. var placeHoldersLen = validLen === len
  16120. ? 0
  16121. : 4 - (validLen % 4)
  16122. return [validLen, placeHoldersLen]
  16123. }
  16124. // base64 is 4/3 + up to two characters of the original data
  16125. function byteLength (b64) {
  16126. var lens = getLens(b64)
  16127. var validLen = lens[0]
  16128. var placeHoldersLen = lens[1]
  16129. return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
  16130. }
  16131. function _byteLength (b64, validLen, placeHoldersLen) {
  16132. return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
  16133. }
  16134. function toByteArray (b64) {
  16135. var tmp
  16136. var lens = getLens(b64)
  16137. var validLen = lens[0]
  16138. var placeHoldersLen = lens[1]
  16139. var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))
  16140. var curByte = 0
  16141. // if there are placeholders, only get up to the last complete 4 chars
  16142. var len = placeHoldersLen > 0
  16143. ? validLen - 4
  16144. : validLen
  16145. var i
  16146. for (i = 0; i < len; i += 4) {
  16147. tmp =
  16148. (revLookup[b64.charCodeAt(i)] << 18) |
  16149. (revLookup[b64.charCodeAt(i + 1)] << 12) |
  16150. (revLookup[b64.charCodeAt(i + 2)] << 6) |
  16151. revLookup[b64.charCodeAt(i + 3)]
  16152. arr[curByte++] = (tmp >> 16) & 0xFF
  16153. arr[curByte++] = (tmp >> 8) & 0xFF
  16154. arr[curByte++] = tmp & 0xFF
  16155. }
  16156. if (placeHoldersLen === 2) {
  16157. tmp =
  16158. (revLookup[b64.charCodeAt(i)] << 2) |
  16159. (revLookup[b64.charCodeAt(i + 1)] >> 4)
  16160. arr[curByte++] = tmp & 0xFF
  16161. }
  16162. if (placeHoldersLen === 1) {
  16163. tmp =
  16164. (revLookup[b64.charCodeAt(i)] << 10) |
  16165. (revLookup[b64.charCodeAt(i + 1)] << 4) |
  16166. (revLookup[b64.charCodeAt(i + 2)] >> 2)
  16167. arr[curByte++] = (tmp >> 8) & 0xFF
  16168. arr[curByte++] = tmp & 0xFF
  16169. }
  16170. return arr
  16171. }
  16172. function tripletToBase64 (num) {
  16173. return lookup[num >> 18 & 0x3F] +
  16174. lookup[num >> 12 & 0x3F] +
  16175. lookup[num >> 6 & 0x3F] +
  16176. lookup[num & 0x3F]
  16177. }
  16178. function encodeChunk (uint8, start, end) {
  16179. var tmp
  16180. var output = []
  16181. for (var i = start; i < end; i += 3) {
  16182. tmp =
  16183. ((uint8[i] << 16) & 0xFF0000) +
  16184. ((uint8[i + 1] << 8) & 0xFF00) +
  16185. (uint8[i + 2] & 0xFF)
  16186. output.push(tripletToBase64(tmp))
  16187. }
  16188. return output.join('')
  16189. }
  16190. function fromByteArray (uint8) {
  16191. var tmp
  16192. var len = uint8.length
  16193. var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
  16194. var parts = []
  16195. var maxChunkLength = 16383 // must be multiple of 3
  16196. // go through the array every three bytes, we'll deal with trailing stuff later
  16197. for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
  16198. parts.push(encodeChunk(
  16199. uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)
  16200. ))
  16201. }
  16202. // pad the end with zeros, but make sure to not forget the extra bytes
  16203. if (extraBytes === 1) {
  16204. tmp = uint8[len - 1]
  16205. parts.push(
  16206. lookup[tmp >> 2] +
  16207. lookup[(tmp << 4) & 0x3F] +
  16208. '=='
  16209. )
  16210. } else if (extraBytes === 2) {
  16211. tmp = (uint8[len - 2] << 8) + uint8[len - 1]
  16212. parts.push(
  16213. lookup[tmp >> 10] +
  16214. lookup[(tmp >> 4) & 0x3F] +
  16215. lookup[(tmp << 2) & 0x3F] +
  16216. '='
  16217. )
  16218. }
  16219. return parts.join('')
  16220. }
  16221. /***/ }),
  16222. /* 217 */
  16223. /***/ (function(module, exports) {
  16224. exports.read = function (buffer, offset, isLE, mLen, nBytes) {
  16225. var e, m
  16226. var eLen = (nBytes * 8) - mLen - 1
  16227. var eMax = (1 << eLen) - 1
  16228. var eBias = eMax >> 1
  16229. var nBits = -7
  16230. var i = isLE ? (nBytes - 1) : 0
  16231. var d = isLE ? -1 : 1
  16232. var s = buffer[offset + i]
  16233. i += d
  16234. e = s & ((1 << (-nBits)) - 1)
  16235. s >>= (-nBits)
  16236. nBits += eLen
  16237. for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}
  16238. m = e & ((1 << (-nBits)) - 1)
  16239. e >>= (-nBits)
  16240. nBits += mLen
  16241. for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}
  16242. if (e === 0) {
  16243. e = 1 - eBias
  16244. } else if (e === eMax) {
  16245. return m ? NaN : ((s ? -1 : 1) * Infinity)
  16246. } else {
  16247. m = m + Math.pow(2, mLen)
  16248. e = e - eBias
  16249. }
  16250. return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
  16251. }
  16252. exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
  16253. var e, m, c
  16254. var eLen = (nBytes * 8) - mLen - 1
  16255. var eMax = (1 << eLen) - 1
  16256. var eBias = eMax >> 1
  16257. var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
  16258. var i = isLE ? 0 : (nBytes - 1)
  16259. var d = isLE ? 1 : -1
  16260. var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0
  16261. value = Math.abs(value)
  16262. if (isNaN(value) || value === Infinity) {
  16263. m = isNaN(value) ? 1 : 0
  16264. e = eMax
  16265. } else {
  16266. e = Math.floor(Math.log(value) / Math.LN2)
  16267. if (value * (c = Math.pow(2, -e)) < 1) {
  16268. e--
  16269. c *= 2
  16270. }
  16271. if (e + eBias >= 1) {
  16272. value += rt / c
  16273. } else {
  16274. value += rt * Math.pow(2, 1 - eBias)
  16275. }
  16276. if (value * c >= 2) {
  16277. e++
  16278. c /= 2
  16279. }
  16280. if (e + eBias >= eMax) {
  16281. m = 0
  16282. e = eMax
  16283. } else if (e + eBias >= 1) {
  16284. m = ((value * c) - 1) * Math.pow(2, mLen)
  16285. e = e + eBias
  16286. } else {
  16287. m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
  16288. e = 0
  16289. }
  16290. }
  16291. for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
  16292. e = (e << mLen) | m
  16293. eLen += mLen
  16294. for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
  16295. buffer[offset + i - d] |= s * 128
  16296. }
  16297. /***/ }),
  16298. /* 218 */
  16299. /***/ (function(module, exports, __webpack_require__) {
  16300. /* WEBPACK VAR INJECTION */(function(global) {var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function(a,b){if(true)!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (b),
  16301. __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
  16302. (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
  16303. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));else {}})(this,function(){"use strict";function b(a,b){return"undefined"==typeof b?b={autoBom:!1}:"object"!=typeof b&&(console.warn("Deprecated: Expected third argument to be a object"),b={autoBom:!b}),b.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(a.type)?new Blob(["\uFEFF",a],{type:a.type}):a}function c(b,c,d){var e=new XMLHttpRequest;e.open("GET",b),e.responseType="blob",e.onload=function(){a(e.response,c,d)},e.onerror=function(){console.error("could not download file")},e.send()}function d(a){var b=new XMLHttpRequest;b.open("HEAD",a,!1);try{b.send()}catch(a){}return 200<=b.status&&299>=b.status}function e(a){try{a.dispatchEvent(new MouseEvent("click"))}catch(c){var b=document.createEvent("MouseEvents");b.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),a.dispatchEvent(b)}}var f="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof global&&global.global===global?global:void 0,a=f.saveAs||("object"!=typeof window||window!==f?function(){}:(typeof HTMLAnchorElement !== "undefined" && "download" in HTMLAnchorElement.prototype)?function(b,g,h){var i=f.URL||f.webkitURL,j=document.createElement("a");g=g||b.name||"download",j.download=g,j.rel="noopener","string"==typeof b?(j.href=b,j.origin===location.origin?e(j):d(j.href)?c(b,g,h):e(j,j.target="_blank")):(j.href=i.createObjectURL(b),setTimeout(function(){i.revokeObjectURL(j.href)},4E4),setTimeout(function(){e(j)},0))}:"msSaveOrOpenBlob"in navigator?function(f,g,h){if(g=g||f.name||"download","string"!=typeof f)navigator.msSaveOrOpenBlob(b(f,h),g);else if(d(f))c(f,g,h);else{var i=document.createElement("a");i.href=f,i.target="_blank",setTimeout(function(){e(i)})}}:function(a,b,d,e){if(e=e||open("","_blank"),e&&(e.document.title=e.document.body.innerText="downloading..."),"string"==typeof a)return c(a,b,d);var g="application/octet-stream"===a.type,h=/constructor/i.test(f.HTMLElement)||f.safari,i=/CriOS\/[\d]+/.test(navigator.userAgent);if((i||g&&h)&&"object"==typeof FileReader){var j=new FileReader;j.onloadend=function(){var a=j.result;a=i?a:a.replace(/^data:[^;]*;/,"data:attachment/file;"),e?e.location.href=a:location=a,e=null},j.readAsDataURL(a)}else{var k=f.URL||f.webkitURL,l=k.createObjectURL(a);e?e.location=l:location.href=l,e=null,setTimeout(function(){k.revokeObjectURL(l)},4E4)}});f.saveAs=a.saveAs=a, true&&(module.exports=a)});
  16304. //# sourceMappingURL=FileSaver.min.js.map
  16305. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(22)))
  16306. /***/ }),
  16307. /* 219 */
  16308. /***/ (function(module, exports, __webpack_require__) {
  16309. "use strict";
  16310. /*eslint no-unused-vars: ["error", {"args": "none"}]*/
  16311. var PdfKitEngine = __webpack_require__(220);
  16312. var FontProvider = __webpack_require__(444);
  16313. var LayoutBuilder = __webpack_require__(445);
  16314. var sizes = __webpack_require__(452);
  16315. var ImageMeasure = __webpack_require__(453);
  16316. var SVGMeasure = __webpack_require__(454);
  16317. var textDecorator = __webpack_require__(455);
  16318. var TextTools = __webpack_require__(130);
  16319. var isFunction = __webpack_require__(0).isFunction;
  16320. var isString = __webpack_require__(0).isString;
  16321. var isNumber = __webpack_require__(0).isNumber;
  16322. var isBoolean = __webpack_require__(0).isBoolean;
  16323. var isArray = __webpack_require__(0).isArray;
  16324. var isUndefined = __webpack_require__(0).isUndefined;
  16325. var getSvgToPDF = function () {
  16326. try {
  16327. // optional dependency to support svg nodes
  16328. return __webpack_require__(456);
  16329. } catch (e) {
  16330. throw new Error('Please install svg-to-pdfkit to enable svg nodes');
  16331. }
  16332. };
  16333. var findFont = function (fonts, requiredFonts, defaultFont) {
  16334. for (var i = 0; i < requiredFonts.length; i++) {
  16335. var requiredFont = requiredFonts[i].toLowerCase();
  16336. for (var font in fonts) {
  16337. if (font.toLowerCase() === requiredFont) {
  16338. return font;
  16339. }
  16340. }
  16341. }
  16342. return defaultFont;
  16343. };
  16344. ////////////////////////////////////////
  16345. // PdfPrinter
  16346. /**
  16347. * @class Creates an instance of a PdfPrinter which turns document definition into a pdf
  16348. *
  16349. * @param {Object} fontDescriptors font definition dictionary
  16350. *
  16351. * @example
  16352. * var fontDescriptors = {
  16353. * Roboto: {
  16354. * normal: 'fonts/Roboto-Regular.ttf',
  16355. * bold: 'fonts/Roboto-Medium.ttf',
  16356. * italics: 'fonts/Roboto-Italic.ttf',
  16357. * bolditalics: 'fonts/Roboto-MediumItalic.ttf'
  16358. * }
  16359. * };
  16360. *
  16361. * var printer = new PdfPrinter(fontDescriptors);
  16362. */
  16363. function PdfPrinter(fontDescriptors) {
  16364. this.fontDescriptors = fontDescriptors;
  16365. }
  16366. /**
  16367. * Executes layout engine for the specified document and renders it into a pdfkit document
  16368. * ready to be saved.
  16369. *
  16370. * @param {Object} docDefinition document definition
  16371. * @param {Object} docDefinition.content an array describing the pdf structure (for more information take a look at the examples in the /examples folder)
  16372. * @param {Object} [docDefinition.defaultStyle] default (implicit) style definition
  16373. * @param {Object} [docDefinition.styles] dictionary defining all styles which can be used in the document
  16374. * @param {Object} [docDefinition.pageSize] page size (pdfkit units, A4 dimensions by default)
  16375. * @param {Number} docDefinition.pageSize.width width
  16376. * @param {Number} docDefinition.pageSize.height height
  16377. * @param {Object} [docDefinition.pageMargins] page margins (pdfkit units)
  16378. * @param {Number} docDefinition.maxPagesNumber maximum number of pages to render
  16379. *
  16380. * @example
  16381. *
  16382. * var docDefinition = {
  16383. * info: {
  16384. * title: 'awesome Document',
  16385. * author: 'john doe',
  16386. * subject: 'subject of document',
  16387. * keywords: 'keywords for document',
  16388. * },
  16389. * content: [
  16390. * 'First paragraph',
  16391. * 'Second paragraph, this time a little bit longer',
  16392. * { text: 'Third paragraph, slightly bigger font size', fontSize: 20 },
  16393. * { text: 'Another paragraph using a named style', style: 'header' },
  16394. * { text: ['playing with ', 'inlines' ] },
  16395. * { text: ['and ', { text: 'restyling ', bold: true }, 'them'] },
  16396. * ],
  16397. * styles: {
  16398. * header: { fontSize: 30, bold: true }
  16399. * }
  16400. * }
  16401. *
  16402. * var pdfKitDoc = printer.createPdfKitDocument(docDefinition);
  16403. *
  16404. * pdfKitDoc.pipe(fs.createWriteStream('sample.pdf'));
  16405. * pdfKitDoc.end();
  16406. *
  16407. * @return {Object} a pdfKit document object which can be saved or encode to data-url
  16408. */
  16409. PdfPrinter.prototype.createPdfKitDocument = function (docDefinition, options) {
  16410. options = options || {};
  16411. docDefinition.version = docDefinition.version || '1.3';
  16412. docDefinition.compress = isBoolean(docDefinition.compress) ? docDefinition.compress : true;
  16413. docDefinition.images = docDefinition.images || {};
  16414. docDefinition.pageMargins = ((docDefinition.pageMargins !== undefined) && (docDefinition.pageMargins !== null)) ? docDefinition.pageMargins : 40;
  16415. var pageSize = fixPageSize(docDefinition.pageSize, docDefinition.pageOrientation);
  16416. var pdfOptions = {
  16417. size: [pageSize.width, pageSize.height],
  16418. pdfVersion: docDefinition.version,
  16419. compress: docDefinition.compress,
  16420. userPassword: docDefinition.userPassword,
  16421. ownerPassword: docDefinition.ownerPassword,
  16422. permissions: docDefinition.permissions,
  16423. fontLayoutCache: isBoolean(options.fontLayoutCache) ? options.fontLayoutCache : true,
  16424. bufferPages: options.bufferPages || false,
  16425. autoFirstPage: false,
  16426. font: null
  16427. };
  16428. this.pdfKitDoc = PdfKitEngine.createPdfDocument(pdfOptions);
  16429. setMetadata(docDefinition, this.pdfKitDoc);
  16430. this.fontProvider = new FontProvider(this.fontDescriptors, this.pdfKitDoc);
  16431. var builder = new LayoutBuilder(pageSize, fixPageMargins(docDefinition.pageMargins), new ImageMeasure(this.pdfKitDoc, docDefinition.images), new SVGMeasure());
  16432. registerDefaultTableLayouts(builder);
  16433. if (options.tableLayouts) {
  16434. builder.registerTableLayouts(options.tableLayouts);
  16435. }
  16436. var pages = builder.layoutDocument(docDefinition.content, this.fontProvider, docDefinition.styles || {}, docDefinition.defaultStyle || {
  16437. fontSize: 12,
  16438. font: 'Roboto'
  16439. }, docDefinition.background, docDefinition.header, docDefinition.footer, docDefinition.images, docDefinition.watermark, docDefinition.pageBreakBefore);
  16440. var maxNumberPages = docDefinition.maxPagesNumber || -1;
  16441. if (isNumber(maxNumberPages) && maxNumberPages > -1) {
  16442. pages = pages.slice(0, maxNumberPages);
  16443. }
  16444. // if pageSize.height is set to Infinity, calculate the actual height of the page that
  16445. // was laid out using the height of each of the items in the page.
  16446. if (pageSize.height === Infinity) {
  16447. var pageHeight = calculatePageHeight(pages, docDefinition.pageMargins);
  16448. this.pdfKitDoc.options.size = [pageSize.width, pageHeight];
  16449. }
  16450. renderPages(pages, this.fontProvider, this.pdfKitDoc, options.progressCallback);
  16451. if (options.autoPrint) {
  16452. var printActionRef = this.pdfKitDoc.ref({
  16453. Type: 'Action',
  16454. S: 'Named',
  16455. N: 'Print'
  16456. });
  16457. this.pdfKitDoc._root.data.OpenAction = printActionRef;
  16458. printActionRef.end();
  16459. }
  16460. return this.pdfKitDoc;
  16461. };
  16462. function setMetadata(docDefinition, pdfKitDoc) {
  16463. // PDF standard has these properties reserved: Title, Author, Subject, Keywords,
  16464. // Creator, Producer, CreationDate, ModDate, Trapped.
  16465. // To keep the pdfmake api consistent, the info field are defined lowercase.
  16466. // Custom properties don't contain a space.
  16467. function standardizePropertyKey(key) {
  16468. var standardProperties = ['Title', 'Author', 'Subject', 'Keywords',
  16469. 'Creator', 'Producer', 'CreationDate', 'ModDate', 'Trapped'];
  16470. var standardizedKey = key.charAt(0).toUpperCase() + key.slice(1);
  16471. if (standardProperties.indexOf(standardizedKey) !== -1) {
  16472. return standardizedKey;
  16473. }
  16474. return key.replace(/\s+/g, '');
  16475. }
  16476. pdfKitDoc.info.Producer = 'pdfmake';
  16477. pdfKitDoc.info.Creator = 'pdfmake';
  16478. if (docDefinition.info) {
  16479. for (var key in docDefinition.info) {
  16480. var value = docDefinition.info[key];
  16481. if (value) {
  16482. key = standardizePropertyKey(key);
  16483. pdfKitDoc.info[key] = value;
  16484. }
  16485. }
  16486. }
  16487. }
  16488. function calculatePageHeight(pages, margins) {
  16489. function getItemHeight(item) {
  16490. if (isFunction(item.item.getHeight)) {
  16491. return item.item.getHeight();
  16492. } else if (item.item._height) {
  16493. return item.item._height;
  16494. } else {
  16495. // TODO: add support for next item types
  16496. return 0;
  16497. }
  16498. }
  16499. function getBottomPosition(item) {
  16500. var top = item.item.y;
  16501. var height = getItemHeight(item);
  16502. return top + height;
  16503. }
  16504. var fixedMargins = fixPageMargins(margins || 40);
  16505. var height = fixedMargins.top;
  16506. pages.forEach(function (page) {
  16507. page.items.forEach(function (item) {
  16508. var bottomPosition = getBottomPosition(item);
  16509. if (bottomPosition > height) {
  16510. height = bottomPosition;
  16511. }
  16512. });
  16513. });
  16514. height += fixedMargins.bottom;
  16515. return height;
  16516. }
  16517. function fixPageSize(pageSize, pageOrientation) {
  16518. function isNeedSwapPageSizes(pageOrientation) {
  16519. if (isString(pageOrientation)) {
  16520. pageOrientation = pageOrientation.toLowerCase();
  16521. return ((pageOrientation === 'portrait') && (size.width > size.height)) ||
  16522. ((pageOrientation === 'landscape') && (size.width < size.height));
  16523. }
  16524. return false;
  16525. }
  16526. // if pageSize.height is set to auto, set the height to infinity so there are no page breaks.
  16527. if (pageSize && pageSize.height === 'auto') {
  16528. pageSize.height = Infinity;
  16529. }
  16530. var size = pageSize2widthAndHeight(pageSize || 'A4');
  16531. if (isNeedSwapPageSizes(pageOrientation)) { // swap page sizes
  16532. size = { width: size.height, height: size.width };
  16533. }
  16534. size.orientation = size.width > size.height ? 'landscape' : 'portrait';
  16535. return size;
  16536. }
  16537. function fixPageMargins(margin) {
  16538. if (isNumber(margin)) {
  16539. margin = { left: margin, right: margin, top: margin, bottom: margin };
  16540. } else if (isArray(margin)) {
  16541. if (margin.length === 2) {
  16542. margin = { left: margin[0], top: margin[1], right: margin[0], bottom: margin[1] };
  16543. } else if (margin.length === 4) {
  16544. margin = { left: margin[0], top: margin[1], right: margin[2], bottom: margin[3] };
  16545. } else {
  16546. throw 'Invalid pageMargins definition';
  16547. }
  16548. }
  16549. return margin;
  16550. }
  16551. function registerDefaultTableLayouts(layoutBuilder) {
  16552. layoutBuilder.registerTableLayouts({
  16553. noBorders: {
  16554. hLineWidth: function (i) {
  16555. return 0;
  16556. },
  16557. vLineWidth: function (i) {
  16558. return 0;
  16559. },
  16560. paddingLeft: function (i) {
  16561. return i && 4 || 0;
  16562. },
  16563. paddingRight: function (i, node) {
  16564. return (i < node.table.widths.length - 1) ? 4 : 0;
  16565. }
  16566. },
  16567. headerLineOnly: {
  16568. hLineWidth: function (i, node) {
  16569. if (i === 0 || i === node.table.body.length) {
  16570. return 0;
  16571. }
  16572. return (i === node.table.headerRows) ? 2 : 0;
  16573. },
  16574. vLineWidth: function (i) {
  16575. return 0;
  16576. },
  16577. paddingLeft: function (i) {
  16578. return i === 0 ? 0 : 8;
  16579. },
  16580. paddingRight: function (i, node) {
  16581. return (i === node.table.widths.length - 1) ? 0 : 8;
  16582. }
  16583. },
  16584. lightHorizontalLines: {
  16585. hLineWidth: function (i, node) {
  16586. if (i === 0 || i === node.table.body.length) {
  16587. return 0;
  16588. }
  16589. return (i === node.table.headerRows) ? 2 : 1;
  16590. },
  16591. vLineWidth: function (i) {
  16592. return 0;
  16593. },
  16594. hLineColor: function (i) {
  16595. return i === 1 ? 'black' : '#aaa';
  16596. },
  16597. paddingLeft: function (i) {
  16598. return i === 0 ? 0 : 8;
  16599. },
  16600. paddingRight: function (i, node) {
  16601. return (i === node.table.widths.length - 1) ? 0 : 8;
  16602. }
  16603. }
  16604. });
  16605. }
  16606. function pageSize2widthAndHeight(pageSize) {
  16607. if (isString(pageSize)) {
  16608. var size = sizes[pageSize.toUpperCase()];
  16609. if (!size) {
  16610. throw 'Page size ' + pageSize + ' not recognized';
  16611. }
  16612. return { width: size[0], height: size[1] };
  16613. }
  16614. return pageSize;
  16615. }
  16616. function updatePageOrientationInOptions(currentPage, pdfKitDoc) {
  16617. var previousPageOrientation = pdfKitDoc.options.size[0] > pdfKitDoc.options.size[1] ? 'landscape' : 'portrait';
  16618. if (currentPage.pageSize.orientation !== previousPageOrientation) {
  16619. var width = pdfKitDoc.options.size[0];
  16620. var height = pdfKitDoc.options.size[1];
  16621. pdfKitDoc.options.size = [height, width];
  16622. }
  16623. }
  16624. function renderPages(pages, fontProvider, pdfKitDoc, progressCallback) {
  16625. pdfKitDoc._pdfMakePages = pages;
  16626. pdfKitDoc.addPage();
  16627. var totalItems = 0;
  16628. if (progressCallback) {
  16629. pages.forEach(function (page) {
  16630. totalItems += page.items.length;
  16631. });
  16632. }
  16633. var renderedItems = 0;
  16634. progressCallback = progressCallback || function () {
  16635. };
  16636. for (var i = 0; i < pages.length; i++) {
  16637. if (i > 0) {
  16638. updatePageOrientationInOptions(pages[i], pdfKitDoc);
  16639. pdfKitDoc.addPage(pdfKitDoc.options);
  16640. }
  16641. var page = pages[i];
  16642. for (var ii = 0, il = page.items.length; ii < il; ii++) {
  16643. var item = page.items[ii];
  16644. switch (item.type) {
  16645. case 'vector':
  16646. renderVector(item.item, pdfKitDoc);
  16647. break;
  16648. case 'line':
  16649. renderLine(item.item, item.item.x, item.item.y, pdfKitDoc);
  16650. break;
  16651. case 'image':
  16652. renderImage(item.item, item.item.x, item.item.y, pdfKitDoc);
  16653. break;
  16654. case 'svg':
  16655. renderSVG(item.item, item.item.x, item.item.y, pdfKitDoc, fontProvider);
  16656. break;
  16657. case 'beginClip':
  16658. beginClip(item.item, pdfKitDoc);
  16659. break;
  16660. case 'endClip':
  16661. endClip(pdfKitDoc);
  16662. break;
  16663. }
  16664. renderedItems++;
  16665. progressCallback(renderedItems / totalItems);
  16666. }
  16667. if (page.watermark) {
  16668. renderWatermark(page, pdfKitDoc);
  16669. }
  16670. }
  16671. }
  16672. function renderLine(line, x, y, pdfKitDoc) {
  16673. function preparePageNodeRefLine(_pageNodeRef, inline) {
  16674. var newWidth;
  16675. var diffWidth;
  16676. var textTools = new TextTools(null);
  16677. if (isUndefined(_pageNodeRef.positions)) {
  16678. throw 'Page reference id not found';
  16679. }
  16680. var pageNumber = _pageNodeRef.positions[0].pageNumber.toString();
  16681. inline.text = pageNumber;
  16682. newWidth = textTools.widthOfString(inline.text, inline.font, inline.fontSize, inline.characterSpacing, inline.fontFeatures);
  16683. diffWidth = inline.width - newWidth;
  16684. inline.width = newWidth;
  16685. switch (inline.alignment) {
  16686. case 'right':
  16687. inline.x += diffWidth;
  16688. break;
  16689. case 'center':
  16690. inline.x += diffWidth / 2;
  16691. break;
  16692. }
  16693. }
  16694. if (line._pageNodeRef) {
  16695. preparePageNodeRefLine(line._pageNodeRef, line.inlines[0]);
  16696. }
  16697. x = x || 0;
  16698. y = y || 0;
  16699. var lineHeight = line.getHeight();
  16700. var ascenderHeight = line.getAscenderHeight();
  16701. var descent = lineHeight - ascenderHeight;
  16702. textDecorator.drawBackground(line, x, y, pdfKitDoc);
  16703. //TODO: line.optimizeInlines();
  16704. for (var i = 0, l = line.inlines.length; i < l; i++) {
  16705. var inline = line.inlines[i];
  16706. var shiftToBaseline = lineHeight - ((inline.font.ascender / 1000) * inline.fontSize) - descent;
  16707. if (inline._pageNodeRef) {
  16708. preparePageNodeRefLine(inline._pageNodeRef, inline);
  16709. }
  16710. var options = {
  16711. lineBreak: false,
  16712. textWidth: inline.width,
  16713. characterSpacing: inline.characterSpacing,
  16714. wordCount: 1,
  16715. link: inline.link
  16716. };
  16717. if (inline.linkToDestination) {
  16718. options.goTo = inline.linkToDestination;
  16719. }
  16720. if (line.id && i === 0) {
  16721. options.destination = line.id;
  16722. }
  16723. if (inline.fontFeatures) {
  16724. options.features = inline.fontFeatures;
  16725. }
  16726. var opacity = isNumber(inline.opacity) ? inline.opacity : 1;
  16727. pdfKitDoc.opacity(opacity);
  16728. pdfKitDoc.fill(inline.color || 'black');
  16729. pdfKitDoc._font = inline.font;
  16730. pdfKitDoc.fontSize(inline.fontSize);
  16731. pdfKitDoc.text(inline.text, x + inline.x, y + shiftToBaseline, options);
  16732. if (inline.linkToPage) {
  16733. var _ref = pdfKitDoc.ref({ Type: 'Action', S: 'GoTo', D: [inline.linkToPage, 0, 0] }).end();
  16734. pdfKitDoc.annotate(x + inline.x, y + shiftToBaseline, inline.width, inline.height, {
  16735. Subtype: 'Link',
  16736. Dest: [inline.linkToPage - 1, 'XYZ', null, null, null]
  16737. });
  16738. }
  16739. }
  16740. textDecorator.drawDecorations(line, x, y, pdfKitDoc);
  16741. }
  16742. function renderWatermark(page, pdfKitDoc) {
  16743. var watermark = page.watermark;
  16744. pdfKitDoc.fill(watermark.color);
  16745. pdfKitDoc.opacity(watermark.opacity);
  16746. pdfKitDoc.save();
  16747. pdfKitDoc.rotate(watermark.angle, { origin: [pdfKitDoc.page.width / 2, pdfKitDoc.page.height / 2] });
  16748. var x = pdfKitDoc.page.width / 2 - watermark._size.size.width / 2;
  16749. var y = pdfKitDoc.page.height / 2 - watermark._size.size.height / 2;
  16750. pdfKitDoc._font = watermark.font;
  16751. pdfKitDoc.fontSize(watermark.fontSize);
  16752. pdfKitDoc.text(watermark.text, x, y, { lineBreak: false });
  16753. pdfKitDoc.restore();
  16754. }
  16755. function renderVector(vector, pdfKitDoc) {
  16756. //TODO: pdf optimization (there's no need to write all properties everytime)
  16757. pdfKitDoc.lineWidth(vector.lineWidth || 1);
  16758. if (vector.dash) {
  16759. pdfKitDoc.dash(vector.dash.length, { space: vector.dash.space || vector.dash.length, phase: vector.dash.phase || 0 });
  16760. } else {
  16761. pdfKitDoc.undash();
  16762. }
  16763. pdfKitDoc.lineJoin(vector.lineJoin || 'miter');
  16764. pdfKitDoc.lineCap(vector.lineCap || 'butt');
  16765. //TODO: clipping
  16766. var gradient = null;
  16767. switch (vector.type) {
  16768. case 'ellipse':
  16769. pdfKitDoc.ellipse(vector.x, vector.y, vector.r1, vector.r2);
  16770. if (vector.linearGradient) {
  16771. gradient = pdfKitDoc.linearGradient(vector.x - vector.r1, vector.y, vector.x + vector.r1, vector.y);
  16772. }
  16773. break;
  16774. case 'rect':
  16775. if (vector.r) {
  16776. pdfKitDoc.roundedRect(vector.x, vector.y, vector.w, vector.h, vector.r);
  16777. } else {
  16778. pdfKitDoc.rect(vector.x, vector.y, vector.w, vector.h);
  16779. }
  16780. if (vector.linearGradient) {
  16781. gradient = pdfKitDoc.linearGradient(vector.x, vector.y, vector.x + vector.w, vector.y);
  16782. }
  16783. break;
  16784. case 'line':
  16785. pdfKitDoc.moveTo(vector.x1, vector.y1);
  16786. pdfKitDoc.lineTo(vector.x2, vector.y2);
  16787. break;
  16788. case 'polyline':
  16789. if (vector.points.length === 0) {
  16790. break;
  16791. }
  16792. pdfKitDoc.moveTo(vector.points[0].x, vector.points[0].y);
  16793. for (var i = 1, l = vector.points.length; i < l; i++) {
  16794. pdfKitDoc.lineTo(vector.points[i].x, vector.points[i].y);
  16795. }
  16796. if (vector.points.length > 1) {
  16797. var p1 = vector.points[0];
  16798. var pn = vector.points[vector.points.length - 1];
  16799. if (vector.closePath || p1.x === pn.x && p1.y === pn.y) {
  16800. pdfKitDoc.closePath();
  16801. }
  16802. }
  16803. break;
  16804. case 'path':
  16805. pdfKitDoc.path(vector.d);
  16806. break;
  16807. }
  16808. if (vector.linearGradient && gradient) {
  16809. var step = 1 / (vector.linearGradient.length - 1);
  16810. for (var i = 0; i < vector.linearGradient.length; i++) {
  16811. gradient.stop(i * step, vector.linearGradient[i]);
  16812. }
  16813. vector.color = gradient;
  16814. }
  16815. var fillOpacity = isNumber(vector.fillOpacity) ? vector.fillOpacity : 1;
  16816. var strokeOpacity = isNumber(vector.strokeOpacity) ? vector.strokeOpacity : 1;
  16817. if (vector.color && vector.lineColor) {
  16818. pdfKitDoc.fillColor(vector.color, fillOpacity);
  16819. pdfKitDoc.strokeColor(vector.lineColor, strokeOpacity);
  16820. pdfKitDoc.fillAndStroke();
  16821. } else if (vector.color) {
  16822. pdfKitDoc.fillColor(vector.color, fillOpacity);
  16823. pdfKitDoc.fill();
  16824. } else {
  16825. pdfKitDoc.strokeColor(vector.lineColor || 'black', strokeOpacity);
  16826. pdfKitDoc.stroke();
  16827. }
  16828. }
  16829. function renderImage(image, x, y, pdfKitDoc) {
  16830. var opacity = isNumber(image.opacity) ? image.opacity : 1;
  16831. pdfKitDoc.opacity(opacity);
  16832. pdfKitDoc.image(image.image, image.x, image.y, { width: image._width, height: image._height });
  16833. if (image.link) {
  16834. pdfKitDoc.link(image.x, image.y, image._width, image._height, image.link);
  16835. }
  16836. if (image.linkToPage) {
  16837. pdfKitDoc.ref({ Type: 'Action', S: 'GoTo', D: [image.linkToPage, 0, 0] }).end();
  16838. pdfKitDoc.annotate(image.x, image.y, image._width, image._height, { Subtype: 'Link', Dest: [image.linkToPage - 1, 'XYZ', null, null, null] });
  16839. }
  16840. if (image.linkToDestination) {
  16841. pdfKitDoc.goTo(image.x, image.y, image._width, image._height, image.linkToDestination);
  16842. }
  16843. }
  16844. function renderSVG(svg, x, y, pdfKitDoc, fontProvider) {
  16845. var options = Object.assign({ width: svg._width, height: svg._height, assumePt: true }, svg.options);
  16846. options.fontCallback = function (family, bold, italic) {
  16847. var fontsFamily = family.split(',').map(function (f) { return f.trim().replace(/('|")/g, ''); });
  16848. var font = findFont(fontProvider.fonts, fontsFamily, svg.font || 'Roboto');
  16849. var fontFile = fontProvider.getFontFile(font, bold, italic);
  16850. if (fontFile === null) {
  16851. var type = fontProvider.getFontType(bold, italic);
  16852. throw new Error('Font \'' + font + '\' in style \'' + type + '\' is not defined in the font section of the document definition.');
  16853. }
  16854. return fontFile;
  16855. };
  16856. getSvgToPDF()(pdfKitDoc, svg.svg, svg.x, svg.y, options);
  16857. }
  16858. function beginClip(rect, pdfKitDoc) {
  16859. pdfKitDoc.save();
  16860. pdfKitDoc.addContent('' + rect.x + ' ' + rect.y + ' ' + rect.width + ' ' + rect.height + ' re');
  16861. pdfKitDoc.clip();
  16862. }
  16863. function endClip(pdfKitDoc) {
  16864. pdfKitDoc.restore();
  16865. }
  16866. module.exports = PdfPrinter;
  16867. /***/ }),
  16868. /* 220 */
  16869. /***/ (function(module, exports, __webpack_require__) {
  16870. "use strict";
  16871. function _interopDefault(ex) {
  16872. return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex;
  16873. }
  16874. var PdfKit = _interopDefault(__webpack_require__(221));
  16875. function getEngineInstance() {
  16876. return PdfKit;
  16877. }
  16878. function createPdfDocument(options) {
  16879. options = options || {};
  16880. return new PdfKit(options);
  16881. }
  16882. module.exports = {
  16883. getEngineInstance: getEngineInstance,
  16884. createPdfDocument: createPdfDocument
  16885. };
  16886. /***/ }),
  16887. /* 221 */
  16888. /***/ (function(module, exports, __webpack_require__) {
  16889. "use strict";
  16890. /* WEBPACK VAR INJECTION */(function(Buffer, __dirname) {
  16891. Object.defineProperty(exports, "__esModule", {
  16892. value: true
  16893. });
  16894. exports.default = void 0;
  16895. __webpack_require__(222);
  16896. __webpack_require__(137);
  16897. __webpack_require__(224);
  16898. __webpack_require__(139);
  16899. __webpack_require__(44);
  16900. __webpack_require__(152);
  16901. __webpack_require__(92);
  16902. __webpack_require__(153);
  16903. __webpack_require__(155);
  16904. __webpack_require__(240);
  16905. __webpack_require__(157);
  16906. __webpack_require__(158);
  16907. __webpack_require__(243);
  16908. __webpack_require__(244);
  16909. __webpack_require__(159);
  16910. __webpack_require__(66);
  16911. __webpack_require__(160);
  16912. __webpack_require__(246);
  16913. __webpack_require__(247);
  16914. __webpack_require__(250);
  16915. __webpack_require__(161);
  16916. __webpack_require__(162);
  16917. __webpack_require__(165);
  16918. __webpack_require__(99);
  16919. __webpack_require__(255);
  16920. var _stream = _interopRequireDefault(__webpack_require__(100));
  16921. var _zlib = _interopRequireDefault(__webpack_require__(170));
  16922. var _cryptoJs = _interopRequireDefault(__webpack_require__(277));
  16923. var _fontkit = _interopRequireDefault(__webpack_require__(301));
  16924. var _events = __webpack_require__(68);
  16925. var _linebreak = _interopRequireDefault(__webpack_require__(209));
  16926. var _pngJs = _interopRequireDefault(__webpack_require__(443));
  16927. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  16928. var fs = __webpack_require__(84);
  16929. function _classCallCheck(instance, Constructor) {
  16930. if (!(instance instanceof Constructor)) {
  16931. throw new TypeError("Cannot call a class as a function");
  16932. }
  16933. }
  16934. function _defineProperties(target, props) {
  16935. for (var i = 0; i < props.length; i++) {
  16936. var descriptor = props[i];
  16937. descriptor.enumerable = descriptor.enumerable || false;
  16938. descriptor.configurable = true;
  16939. if ("value" in descriptor) descriptor.writable = true;
  16940. Object.defineProperty(target, descriptor.key, descriptor);
  16941. }
  16942. }
  16943. function _createClass(Constructor, protoProps, staticProps) {
  16944. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  16945. if (staticProps) _defineProperties(Constructor, staticProps);
  16946. return Constructor;
  16947. }
  16948. function _inherits(subClass, superClass) {
  16949. if (typeof superClass !== "function" && superClass !== null) {
  16950. throw new TypeError("Super expression must either be null or a function");
  16951. }
  16952. subClass.prototype = Object.create(superClass && superClass.prototype, {
  16953. constructor: {
  16954. value: subClass,
  16955. writable: true,
  16956. configurable: true
  16957. }
  16958. });
  16959. if (superClass) _setPrototypeOf(subClass, superClass);
  16960. }
  16961. function _getPrototypeOf(o) {
  16962. _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
  16963. return o.__proto__ || Object.getPrototypeOf(o);
  16964. };
  16965. return _getPrototypeOf(o);
  16966. }
  16967. function _setPrototypeOf(o, p) {
  16968. _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
  16969. o.__proto__ = p;
  16970. return o;
  16971. };
  16972. return _setPrototypeOf(o, p);
  16973. }
  16974. function _assertThisInitialized(self) {
  16975. if (self === void 0) {
  16976. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  16977. }
  16978. return self;
  16979. }
  16980. function _possibleConstructorReturn(self, call) {
  16981. if (call && (typeof call === "object" || typeof call === "function")) {
  16982. return call;
  16983. }
  16984. return _assertThisInitialized(self);
  16985. }
  16986. function _slicedToArray(arr, i) {
  16987. return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest();
  16988. }
  16989. function _toConsumableArray(arr) {
  16990. return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread();
  16991. }
  16992. function _arrayWithoutHoles(arr) {
  16993. if (Array.isArray(arr)) {
  16994. for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) {
  16995. arr2[i] = arr[i];
  16996. }
  16997. return arr2;
  16998. }
  16999. }
  17000. function _arrayWithHoles(arr) {
  17001. if (Array.isArray(arr)) return arr;
  17002. }
  17003. function _iterableToArray(iter) {
  17004. if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);
  17005. }
  17006. function _iterableToArrayLimit(arr, i) {
  17007. if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) {
  17008. return;
  17009. }
  17010. var _arr = [];
  17011. var _n = true;
  17012. var _d = false;
  17013. var _e = undefined;
  17014. try {
  17015. for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
  17016. _arr.push(_s.value);
  17017. if (i && _arr.length === i) break;
  17018. }
  17019. } catch (err) {
  17020. _d = true;
  17021. _e = err;
  17022. } finally {
  17023. try {
  17024. if (!_n && _i["return"] != null) _i["return"]();
  17025. } finally {
  17026. if (_d) throw _e;
  17027. }
  17028. }
  17029. return _arr;
  17030. }
  17031. function _nonIterableSpread() {
  17032. throw new TypeError("Invalid attempt to spread non-iterable instance");
  17033. }
  17034. function _nonIterableRest() {
  17035. throw new TypeError("Invalid attempt to destructure non-iterable instance");
  17036. }
  17037. /*
  17038. PDFAbstractReference - abstract class for PDF reference
  17039. */
  17040. var PDFAbstractReference = /*#__PURE__*/function () {
  17041. function PDFAbstractReference() {
  17042. _classCallCheck(this, PDFAbstractReference);
  17043. }
  17044. _createClass(PDFAbstractReference, [{
  17045. key: "toString",
  17046. value: function toString() {
  17047. throw new Error('Must be implemented by subclasses');
  17048. }
  17049. }]);
  17050. return PDFAbstractReference;
  17051. }();
  17052. var PDFNameTree = /*#__PURE__*/function () {
  17053. function PDFNameTree() {
  17054. _classCallCheck(this, PDFNameTree);
  17055. this._items = {};
  17056. }
  17057. _createClass(PDFNameTree, [{
  17058. key: "add",
  17059. value: function add(key, val) {
  17060. return this._items[key] = val;
  17061. }
  17062. }, {
  17063. key: "get",
  17064. value: function get(key) {
  17065. return this._items[key];
  17066. }
  17067. }, {
  17068. key: "toString",
  17069. value: function toString() {
  17070. // Needs to be sorted by key
  17071. var sortedKeys = Object.keys(this._items).sort(function (a, b) {
  17072. return a.localeCompare(b);
  17073. });
  17074. var out = ['<<'];
  17075. if (sortedKeys.length > 1) {
  17076. var first = sortedKeys[0],
  17077. last = sortedKeys[sortedKeys.length - 1];
  17078. out.push(" /Limits ".concat(PDFObject.convert([new String(first), new String(last)])));
  17079. }
  17080. out.push(' /Names [');
  17081. var _iteratorNormalCompletion = true;
  17082. var _didIteratorError = false;
  17083. var _iteratorError = undefined;
  17084. try {
  17085. for (var _iterator = sortedKeys[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
  17086. var key = _step.value;
  17087. out.push(" ".concat(PDFObject.convert(new String(key)), " ").concat(PDFObject.convert(this._items[key])));
  17088. }
  17089. } catch (err) {
  17090. _didIteratorError = true;
  17091. _iteratorError = err;
  17092. } finally {
  17093. try {
  17094. if (!_iteratorNormalCompletion && _iterator.return != null) {
  17095. _iterator.return();
  17096. }
  17097. } finally {
  17098. if (_didIteratorError) {
  17099. throw _iteratorError;
  17100. }
  17101. }
  17102. }
  17103. out.push(']');
  17104. out.push('>>');
  17105. return out.join('\n');
  17106. }
  17107. }]);
  17108. return PDFNameTree;
  17109. }();
  17110. var pad = function pad(str, length) {
  17111. return (Array(length + 1).join('0') + str).slice(-length);
  17112. };
  17113. var escapableRe = /[\n\r\t\b\f\(\)\\]/g;
  17114. var escapable = {
  17115. '\n': '\\n',
  17116. '\r': '\\r',
  17117. '\t': '\\t',
  17118. '\b': '\\b',
  17119. '\f': '\\f',
  17120. '\\': '\\\\',
  17121. '(': '\\(',
  17122. ')': '\\)'
  17123. }; // Convert little endian UTF-16 to big endian
  17124. var swapBytes = function swapBytes(buff) {
  17125. var l = buff.length;
  17126. if (l & 0x01) {
  17127. throw new Error('Buffer length must be even');
  17128. } else {
  17129. for (var i = 0, end = l - 1; i < end; i += 2) {
  17130. var a = buff[i];
  17131. buff[i] = buff[i + 1];
  17132. buff[i + 1] = a;
  17133. }
  17134. }
  17135. return buff;
  17136. };
  17137. var PDFObject = /*#__PURE__*/function () {
  17138. function PDFObject() {
  17139. _classCallCheck(this, PDFObject);
  17140. }
  17141. _createClass(PDFObject, null, [{
  17142. key: "convert",
  17143. value: function convert(object) {
  17144. var encryptFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; // String literals are converted to the PDF name type
  17145. if (typeof object === 'string') {
  17146. return "/".concat(object); // String objects are converted to PDF strings (UTF-16)
  17147. } else if (object instanceof String) {
  17148. var string = object; // Detect if this is a unicode string
  17149. var isUnicode = false;
  17150. for (var i = 0, end = string.length; i < end; i++) {
  17151. if (string.charCodeAt(i) > 0x7f) {
  17152. isUnicode = true;
  17153. break;
  17154. }
  17155. } // If so, encode it as big endian UTF-16
  17156. var stringBuffer;
  17157. if (isUnicode) {
  17158. stringBuffer = swapBytes(Buffer.from("\uFEFF".concat(string), 'utf16le'));
  17159. } else {
  17160. stringBuffer = Buffer.from(string.valueOf(), 'ascii');
  17161. } // Encrypt the string when necessary
  17162. if (encryptFn) {
  17163. string = encryptFn(stringBuffer).toString('binary');
  17164. } else {
  17165. string = stringBuffer.toString('binary');
  17166. } // Escape characters as required by the spec
  17167. string = string.replace(escapableRe, function (c) {
  17168. return escapable[c];
  17169. });
  17170. return "(".concat(string, ")"); // Buffers are converted to PDF hex strings
  17171. } else if (Buffer.isBuffer(object)) {
  17172. return "<".concat(object.toString('hex'), ">");
  17173. } else if (object instanceof PDFAbstractReference || object instanceof PDFNameTree) {
  17174. return object.toString();
  17175. } else if (object instanceof Date) {
  17176. var _string = "D:".concat(pad(object.getUTCFullYear(), 4)) + pad(object.getUTCMonth() + 1, 2) + pad(object.getUTCDate(), 2) + pad(object.getUTCHours(), 2) + pad(object.getUTCMinutes(), 2) + pad(object.getUTCSeconds(), 2) + 'Z'; // Encrypt the string when necessary
  17177. if (encryptFn) {
  17178. _string = encryptFn(new Buffer(_string, 'ascii')).toString('binary'); // Escape characters as required by the spec
  17179. _string = _string.replace(escapableRe, function (c) {
  17180. return escapable[c];
  17181. });
  17182. }
  17183. return "(".concat(_string, ")");
  17184. } else if (Array.isArray(object)) {
  17185. var items = object.map(function (e) {
  17186. return PDFObject.convert(e, encryptFn);
  17187. }).join(' ');
  17188. return "[".concat(items, "]");
  17189. } else if ({}.toString.call(object) === '[object Object]') {
  17190. var out = ['<<'];
  17191. for (var key in object) {
  17192. var val = object[key];
  17193. out.push("/".concat(key, " ").concat(PDFObject.convert(val, encryptFn)));
  17194. }
  17195. out.push('>>');
  17196. return out.join('\n');
  17197. } else if (typeof object === 'number') {
  17198. return PDFObject.number(object);
  17199. } else {
  17200. return "".concat(object);
  17201. }
  17202. }
  17203. }, {
  17204. key: "number",
  17205. value: function number(n) {
  17206. if (n > -1e21 && n < 1e21) {
  17207. return Math.round(n * 1e6) / 1e6;
  17208. }
  17209. throw new Error("unsupported number: ".concat(n));
  17210. }
  17211. }]);
  17212. return PDFObject;
  17213. }();
  17214. var PDFReference = /*#__PURE__*/function (_PDFAbstractReference) {
  17215. _inherits(PDFReference, _PDFAbstractReference);
  17216. function PDFReference(document, id) {
  17217. var _this;
  17218. var data = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  17219. _classCallCheck(this, PDFReference);
  17220. _this = _possibleConstructorReturn(this, _getPrototypeOf(PDFReference).call(this));
  17221. _this.document = document;
  17222. _this.id = id;
  17223. _this.data = data;
  17224. _this.gen = 0;
  17225. _this.compress = _this.document.compress && !_this.data.Filter;
  17226. _this.uncompressedLength = 0;
  17227. _this.buffer = [];
  17228. return _this;
  17229. }
  17230. _createClass(PDFReference, [{
  17231. key: "write",
  17232. value: function write(chunk) {
  17233. if (!Buffer.isBuffer(chunk)) {
  17234. chunk = new Buffer(chunk + '\n', 'binary');
  17235. }
  17236. this.uncompressedLength += chunk.length;
  17237. if (this.data.Length == null) {
  17238. this.data.Length = 0;
  17239. }
  17240. this.buffer.push(chunk);
  17241. this.data.Length += chunk.length;
  17242. if (this.compress) {
  17243. return this.data.Filter = 'FlateDecode';
  17244. }
  17245. }
  17246. }, {
  17247. key: "end",
  17248. value: function end(chunk) {
  17249. if (chunk) {
  17250. this.write(chunk);
  17251. }
  17252. return this.finalize();
  17253. }
  17254. }, {
  17255. key: "finalize",
  17256. value: function finalize() {
  17257. this.offset = this.document._offset;
  17258. var encryptFn = this.document._security ? this.document._security.getEncryptFn(this.id, this.gen) : null;
  17259. if (this.buffer.length) {
  17260. this.buffer = Buffer.concat(this.buffer);
  17261. if (this.compress) {
  17262. this.buffer = _zlib.default.deflateSync(this.buffer);
  17263. }
  17264. if (encryptFn) {
  17265. this.buffer = encryptFn(this.buffer);
  17266. }
  17267. this.data.Length = this.buffer.length;
  17268. }
  17269. this.document._write("".concat(this.id, " ").concat(this.gen, " obj"));
  17270. this.document._write(PDFObject.convert(this.data, encryptFn));
  17271. if (this.buffer.length) {
  17272. this.document._write('stream');
  17273. this.document._write(this.buffer);
  17274. this.buffer = []; // free up memory
  17275. this.document._write('\nendstream');
  17276. }
  17277. this.document._write('endobj');
  17278. this.document._refEnd(this);
  17279. }
  17280. }, {
  17281. key: "toString",
  17282. value: function toString() {
  17283. return "".concat(this.id, " ").concat(this.gen, " R");
  17284. }
  17285. }]);
  17286. return PDFReference;
  17287. }(PDFAbstractReference);
  17288. /*
  17289. PDFPage - represents a single page in the PDF document
  17290. By Devon Govett
  17291. */
  17292. var DEFAULT_MARGINS = {
  17293. top: 72,
  17294. left: 72,
  17295. bottom: 72,
  17296. right: 72
  17297. };
  17298. var SIZES = {
  17299. '4A0': [4767.87, 6740.79],
  17300. '2A0': [3370.39, 4767.87],
  17301. A0: [2383.94, 3370.39],
  17302. A1: [1683.78, 2383.94],
  17303. A2: [1190.55, 1683.78],
  17304. A3: [841.89, 1190.55],
  17305. A4: [595.28, 841.89],
  17306. A5: [419.53, 595.28],
  17307. A6: [297.64, 419.53],
  17308. A7: [209.76, 297.64],
  17309. A8: [147.4, 209.76],
  17310. A9: [104.88, 147.4],
  17311. A10: [73.7, 104.88],
  17312. B0: [2834.65, 4008.19],
  17313. B1: [2004.09, 2834.65],
  17314. B2: [1417.32, 2004.09],
  17315. B3: [1000.63, 1417.32],
  17316. B4: [708.66, 1000.63],
  17317. B5: [498.9, 708.66],
  17318. B6: [354.33, 498.9],
  17319. B7: [249.45, 354.33],
  17320. B8: [175.75, 249.45],
  17321. B9: [124.72, 175.75],
  17322. B10: [87.87, 124.72],
  17323. C0: [2599.37, 3676.54],
  17324. C1: [1836.85, 2599.37],
  17325. C2: [1298.27, 1836.85],
  17326. C3: [918.43, 1298.27],
  17327. C4: [649.13, 918.43],
  17328. C5: [459.21, 649.13],
  17329. C6: [323.15, 459.21],
  17330. C7: [229.61, 323.15],
  17331. C8: [161.57, 229.61],
  17332. C9: [113.39, 161.57],
  17333. C10: [79.37, 113.39],
  17334. RA0: [2437.8, 3458.27],
  17335. RA1: [1729.13, 2437.8],
  17336. RA2: [1218.9, 1729.13],
  17337. RA3: [864.57, 1218.9],
  17338. RA4: [609.45, 864.57],
  17339. SRA0: [2551.18, 3628.35],
  17340. SRA1: [1814.17, 2551.18],
  17341. SRA2: [1275.59, 1814.17],
  17342. SRA3: [907.09, 1275.59],
  17343. SRA4: [637.8, 907.09],
  17344. EXECUTIVE: [521.86, 756.0],
  17345. FOLIO: [612.0, 936.0],
  17346. LEGAL: [612.0, 1008.0],
  17347. LETTER: [612.0, 792.0],
  17348. TABLOID: [792.0, 1224.0]
  17349. };
  17350. var PDFPage = /*#__PURE__*/function () {
  17351. function PDFPage(document) {
  17352. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  17353. _classCallCheck(this, PDFPage);
  17354. this.document = document;
  17355. this.size = options.size || 'letter';
  17356. this.layout = options.layout || 'portrait'; // process margins
  17357. if (typeof options.margin === 'number') {
  17358. this.margins = {
  17359. top: options.margin,
  17360. left: options.margin,
  17361. bottom: options.margin,
  17362. right: options.margin
  17363. }; // default to 1 inch margins
  17364. } else {
  17365. this.margins = options.margins || DEFAULT_MARGINS;
  17366. } // calculate page dimensions
  17367. var dimensions = Array.isArray(this.size) ? this.size : SIZES[this.size.toUpperCase()];
  17368. this.width = dimensions[this.layout === 'portrait' ? 0 : 1];
  17369. this.height = dimensions[this.layout === 'portrait' ? 1 : 0];
  17370. this.content = this.document.ref(); // Initialize the Font, XObject, and ExtGState dictionaries
  17371. this.resources = this.document.ref({
  17372. ProcSet: ['PDF', 'Text', 'ImageB', 'ImageC', 'ImageI']
  17373. }); // The page dictionary
  17374. this.dictionary = this.document.ref({
  17375. Type: 'Page',
  17376. Parent: this.document._root.data.Pages,
  17377. MediaBox: [0, 0, this.width, this.height],
  17378. Contents: this.content,
  17379. Resources: this.resources
  17380. });
  17381. } // Lazily create these dictionaries
  17382. _createClass(PDFPage, [{
  17383. key: "maxY",
  17384. value: function maxY() {
  17385. return this.height - this.margins.bottom;
  17386. }
  17387. }, {
  17388. key: "write",
  17389. value: function write(chunk) {
  17390. return this.content.write(chunk);
  17391. }
  17392. }, {
  17393. key: "end",
  17394. value: function end() {
  17395. this.dictionary.end();
  17396. this.resources.end();
  17397. return this.content.end();
  17398. }
  17399. }, {
  17400. key: "fonts",
  17401. get: function get() {
  17402. var data = this.resources.data;
  17403. return data.Font != null ? data.Font : data.Font = {};
  17404. }
  17405. }, {
  17406. key: "xobjects",
  17407. get: function get() {
  17408. var data = this.resources.data;
  17409. return data.XObject != null ? data.XObject : data.XObject = {};
  17410. }
  17411. }, {
  17412. key: "ext_gstates",
  17413. get: function get() {
  17414. var data = this.resources.data;
  17415. return data.ExtGState != null ? data.ExtGState : data.ExtGState = {};
  17416. }
  17417. }, {
  17418. key: "patterns",
  17419. get: function get() {
  17420. var data = this.resources.data;
  17421. return data.Pattern != null ? data.Pattern : data.Pattern = {};
  17422. }
  17423. }, {
  17424. key: "annotations",
  17425. get: function get() {
  17426. var data = this.dictionary.data;
  17427. return data.Annots != null ? data.Annots : data.Annots = [];
  17428. }
  17429. }]);
  17430. return PDFPage;
  17431. }();
  17432. /**
  17433. * Check if value is in a range group.
  17434. * @param {number} value
  17435. * @param {number[]} rangeGroup
  17436. * @returns {boolean}
  17437. */
  17438. function inRange(value, rangeGroup) {
  17439. if (value < rangeGroup[0]) return false;
  17440. var startRange = 0;
  17441. var endRange = rangeGroup.length / 2;
  17442. while (startRange <= endRange) {
  17443. var middleRange = Math.floor((startRange + endRange) / 2); // actual array index
  17444. var arrayIndex = middleRange * 2; // Check if value is in range pointed by actual index
  17445. if (value >= rangeGroup[arrayIndex] && value <= rangeGroup[arrayIndex + 1]) {
  17446. return true;
  17447. }
  17448. if (value > rangeGroup[arrayIndex + 1]) {
  17449. // Search Right Side Of Array
  17450. startRange = middleRange + 1;
  17451. } else {
  17452. // Search Left Side Of Array
  17453. endRange = middleRange - 1;
  17454. }
  17455. }
  17456. return false;
  17457. }
  17458. /* eslint-disable prettier/prettier */
  17459. /**
  17460. * A.1 Unassigned code points in Unicode 3.2
  17461. * @link https://tools.ietf.org/html/rfc3454#appendix-A.1
  17462. */
  17463. var unassigned_code_points = [0x0221, 0x0221, 0x0234, 0x024f, 0x02ae, 0x02af, 0x02ef, 0x02ff, 0x0350, 0x035f, 0x0370, 0x0373, 0x0376, 0x0379, 0x037b, 0x037d, 0x037f, 0x0383, 0x038b, 0x038b, 0x038d, 0x038d, 0x03a2, 0x03a2, 0x03cf, 0x03cf, 0x03f7, 0x03ff, 0x0487, 0x0487, 0x04cf, 0x04cf, 0x04f6, 0x04f7, 0x04fa, 0x04ff, 0x0510, 0x0530, 0x0557, 0x0558, 0x0560, 0x0560, 0x0588, 0x0588, 0x058b, 0x0590, 0x05a2, 0x05a2, 0x05ba, 0x05ba, 0x05c5, 0x05cf, 0x05eb, 0x05ef, 0x05f5, 0x060b, 0x060d, 0x061a, 0x061c, 0x061e, 0x0620, 0x0620, 0x063b, 0x063f, 0x0656, 0x065f, 0x06ee, 0x06ef, 0x06ff, 0x06ff, 0x070e, 0x070e, 0x072d, 0x072f, 0x074b, 0x077f, 0x07b2, 0x0900, 0x0904, 0x0904, 0x093a, 0x093b, 0x094e, 0x094f, 0x0955, 0x0957, 0x0971, 0x0980, 0x0984, 0x0984, 0x098d, 0x098e, 0x0991, 0x0992, 0x09a9, 0x09a9, 0x09b1, 0x09b1, 0x09b3, 0x09b5, 0x09ba, 0x09bb, 0x09bd, 0x09bd, 0x09c5, 0x09c6, 0x09c9, 0x09ca, 0x09ce, 0x09d6, 0x09d8, 0x09db, 0x09de, 0x09de, 0x09e4, 0x09e5, 0x09fb, 0x0a01, 0x0a03, 0x0a04, 0x0a0b, 0x0a0e, 0x0a11, 0x0a12, 0x0a29, 0x0a29, 0x0a31, 0x0a31, 0x0a34, 0x0a34, 0x0a37, 0x0a37, 0x0a3a, 0x0a3b, 0x0a3d, 0x0a3d, 0x0a43, 0x0a46, 0x0a49, 0x0a4a, 0x0a4e, 0x0a58, 0x0a5d, 0x0a5d, 0x0a5f, 0x0a65, 0x0a75, 0x0a80, 0x0a84, 0x0a84, 0x0a8c, 0x0a8c, 0x0a8e, 0x0a8e, 0x0a92, 0x0a92, 0x0aa9, 0x0aa9, 0x0ab1, 0x0ab1, 0x0ab4, 0x0ab4, 0x0aba, 0x0abb, 0x0ac6, 0x0ac6, 0x0aca, 0x0aca, 0x0ace, 0x0acf, 0x0ad1, 0x0adf, 0x0ae1, 0x0ae5, 0x0af0, 0x0b00, 0x0b04, 0x0b04, 0x0b0d, 0x0b0e, 0x0b11, 0x0b12, 0x0b29, 0x0b29, 0x0b31, 0x0b31, 0x0b34, 0x0b35, 0x0b3a, 0x0b3b, 0x0b44, 0x0b46, 0x0b49, 0x0b4a, 0x0b4e, 0x0b55, 0x0b58, 0x0b5b, 0x0b5e, 0x0b5e, 0x0b62, 0x0b65, 0x0b71, 0x0b81, 0x0b84, 0x0b84, 0x0b8b, 0x0b8d, 0x0b91, 0x0b91, 0x0b96, 0x0b98, 0x0b9b, 0x0b9b, 0x0b9d, 0x0b9d, 0x0ba0, 0x0ba2, 0x0ba5, 0x0ba7, 0x0bab, 0x0bad, 0x0bb6, 0x0bb6, 0x0bba, 0x0bbd, 0x0bc3, 0x0bc5, 0x0bc9, 0x0bc9, 0x0bce, 0x0bd6, 0x0bd8, 0x0be6, 0x0bf3, 0x0c00, 0x0c04, 0x0c04, 0x0c0d, 0x0c0d, 0x0c11, 0x0c11, 0x0c29, 0x0c29, 0x0c34, 0x0c34, 0x0c3a, 0x0c3d, 0x0c45, 0x0c45, 0x0c49, 0x0c49, 0x0c4e, 0x0c54, 0x0c57, 0x0c5f, 0x0c62, 0x0c65, 0x0c70, 0x0c81, 0x0c84, 0x0c84, 0x0c8d, 0x0c8d, 0x0c91, 0x0c91, 0x0ca9, 0x0ca9, 0x0cb4, 0x0cb4, 0x0cba, 0x0cbd, 0x0cc5, 0x0cc5, 0x0cc9, 0x0cc9, 0x0cce, 0x0cd4, 0x0cd7, 0x0cdd, 0x0cdf, 0x0cdf, 0x0ce2, 0x0ce5, 0x0cf0, 0x0d01, 0x0d04, 0x0d04, 0x0d0d, 0x0d0d, 0x0d11, 0x0d11, 0x0d29, 0x0d29, 0x0d3a, 0x0d3d, 0x0d44, 0x0d45, 0x0d49, 0x0d49, 0x0d4e, 0x0d56, 0x0d58, 0x0d5f, 0x0d62, 0x0d65, 0x0d70, 0x0d81, 0x0d84, 0x0d84, 0x0d97, 0x0d99, 0x0db2, 0x0db2, 0x0dbc, 0x0dbc, 0x0dbe, 0x0dbf, 0x0dc7, 0x0dc9, 0x0dcb, 0x0dce, 0x0dd5, 0x0dd5, 0x0dd7, 0x0dd7, 0x0de0, 0x0df1, 0x0df5, 0x0e00, 0x0e3b, 0x0e3e, 0x0e5c, 0x0e80, 0x0e83, 0x0e83, 0x0e85, 0x0e86, 0x0e89, 0x0e89, 0x0e8b, 0x0e8c, 0x0e8e, 0x0e93, 0x0e98, 0x0e98, 0x0ea0, 0x0ea0, 0x0ea4, 0x0ea4, 0x0ea6, 0x0ea6, 0x0ea8, 0x0ea9, 0x0eac, 0x0eac, 0x0eba, 0x0eba, 0x0ebe, 0x0ebf, 0x0ec5, 0x0ec5, 0x0ec7, 0x0ec7, 0x0ece, 0x0ecf, 0x0eda, 0x0edb, 0x0ede, 0x0eff, 0x0f48, 0x0f48, 0x0f6b, 0x0f70, 0x0f8c, 0x0f8f, 0x0f98, 0x0f98, 0x0fbd, 0x0fbd, 0x0fcd, 0x0fce, 0x0fd0, 0x0fff, 0x1022, 0x1022, 0x1028, 0x1028, 0x102b, 0x102b, 0x1033, 0x1035, 0x103a, 0x103f, 0x105a, 0x109f, 0x10c6, 0x10cf, 0x10f9, 0x10fa, 0x10fc, 0x10ff, 0x115a, 0x115e, 0x11a3, 0x11a7, 0x11fa, 0x11ff, 0x1207, 0x1207, 0x1247, 0x1247, 0x1249, 0x1249, 0x124e, 0x124f, 0x1257, 0x1257, 0x1259, 0x1259, 0x125e, 0x125f, 0x1287, 0x1287, 0x1289, 0x1289, 0x128e, 0x128f, 0x12af, 0x12af, 0x12b1, 0x12b1, 0x12b6, 0x12b7, 0x12bf, 0x12bf, 0x12c1, 0x12c1, 0x12c6, 0x12c7, 0x12cf, 0x12cf, 0x12d7, 0x12d7, 0x12ef, 0x12ef, 0x130f, 0x130f, 0x1311, 0x1311, 0x1316, 0x1317, 0x131f, 0x131f, 0x1347, 0x1347, 0x135b, 0x1360, 0x137d, 0x139f, 0x13f5, 0x1400, 0x1677, 0x167f, 0x169d, 0x169f, 0x16f1, 0x16ff, 0x170d, 0x170d, 0x1715, 0x171f, 0x1737, 0x173f, 0x1754, 0x175f, 0x176d, 0x176d, 0x1771, 0x1771, 0x1774, 0x177f, 0x17dd, 0x17df, 0x17ea, 0x17ff, 0x180f, 0x180f, 0x181a, 0x181f, 0x1878, 0x187f, 0x18aa, 0x1dff, 0x1e9c, 0x1e9f, 0x1efa, 0x1eff, 0x1f16, 0x1f17, 0x1f1e, 0x1f1f, 0x1f46, 0x1f47, 0x1f4e, 0x1f4f, 0x1f58, 0x1f58, 0x1f5a, 0x1f5a, 0x1f5c, 0x1f5c, 0x1f5e, 0x1f5e, 0x1f7e, 0x1f7f, 0x1fb5, 0x1fb5, 0x1fc5, 0x1fc5, 0x1fd4, 0x1fd5, 0x1fdc, 0x1fdc, 0x1ff0, 0x1ff1, 0x1ff5, 0x1ff5, 0x1fff, 0x1fff, 0x2053, 0x2056, 0x2058, 0x205e, 0x2064, 0x2069, 0x2072, 0x2073, 0x208f, 0x209f, 0x20b2, 0x20cf, 0x20eb, 0x20ff, 0x213b, 0x213c, 0x214c, 0x2152, 0x2184, 0x218f, 0x23cf, 0x23ff, 0x2427, 0x243f, 0x244b, 0x245f, 0x24ff, 0x24ff, 0x2614, 0x2615, 0x2618, 0x2618, 0x267e, 0x267f, 0x268a, 0x2700, 0x2705, 0x2705, 0x270a, 0x270b, 0x2728, 0x2728, 0x274c, 0x274c, 0x274e, 0x274e, 0x2753, 0x2755, 0x2757, 0x2757, 0x275f, 0x2760, 0x2795, 0x2797, 0x27b0, 0x27b0, 0x27bf, 0x27cf, 0x27ec, 0x27ef, 0x2b00, 0x2e7f, 0x2e9a, 0x2e9a, 0x2ef4, 0x2eff, 0x2fd6, 0x2fef, 0x2ffc, 0x2fff, 0x3040, 0x3040, 0x3097, 0x3098, 0x3100, 0x3104, 0x312d, 0x3130, 0x318f, 0x318f, 0x31b8, 0x31ef, 0x321d, 0x321f, 0x3244, 0x3250, 0x327c, 0x327e, 0x32cc, 0x32cf, 0x32ff, 0x32ff, 0x3377, 0x337a, 0x33de, 0x33df, 0x33ff, 0x33ff, 0x4db6, 0x4dff, 0x9fa6, 0x9fff, 0xa48d, 0xa48f, 0xa4c7, 0xabff, 0xd7a4, 0xd7ff, 0xfa2e, 0xfa2f, 0xfa6b, 0xfaff, 0xfb07, 0xfb12, 0xfb18, 0xfb1c, 0xfb37, 0xfb37, 0xfb3d, 0xfb3d, 0xfb3f, 0xfb3f, 0xfb42, 0xfb42, 0xfb45, 0xfb45, 0xfbb2, 0xfbd2, 0xfd40, 0xfd4f, 0xfd90, 0xfd91, 0xfdc8, 0xfdcf, 0xfdfd, 0xfdff, 0xfe10, 0xfe1f, 0xfe24, 0xfe2f, 0xfe47, 0xfe48, 0xfe53, 0xfe53, 0xfe67, 0xfe67, 0xfe6c, 0xfe6f, 0xfe75, 0xfe75, 0xfefd, 0xfefe, 0xff00, 0xff00, 0xffbf, 0xffc1, 0xffc8, 0xffc9, 0xffd0, 0xffd1, 0xffd8, 0xffd9, 0xffdd, 0xffdf, 0xffe7, 0xffe7, 0xffef, 0xfff8, 0x10000, 0x102ff, 0x1031f, 0x1031f, 0x10324, 0x1032f, 0x1034b, 0x103ff, 0x10426, 0x10427, 0x1044e, 0x1cfff, 0x1d0f6, 0x1d0ff, 0x1d127, 0x1d129, 0x1d1de, 0x1d3ff, 0x1d455, 0x1d455, 0x1d49d, 0x1d49d, 0x1d4a0, 0x1d4a1, 0x1d4a3, 0x1d4a4, 0x1d4a7, 0x1d4a8, 0x1d4ad, 0x1d4ad, 0x1d4ba, 0x1d4ba, 0x1d4bc, 0x1d4bc, 0x1d4c1, 0x1d4c1, 0x1d4c4, 0x1d4c4, 0x1d506, 0x1d506, 0x1d50b, 0x1d50c, 0x1d515, 0x1d515, 0x1d51d, 0x1d51d, 0x1d53a, 0x1d53a, 0x1d53f, 0x1d53f, 0x1d545, 0x1d545, 0x1d547, 0x1d549, 0x1d551, 0x1d551, 0x1d6a4, 0x1d6a7, 0x1d7ca, 0x1d7cd, 0x1d800, 0x1fffd, 0x2a6d7, 0x2f7ff, 0x2fa1e, 0x2fffd, 0x30000, 0x3fffd, 0x40000, 0x4fffd, 0x50000, 0x5fffd, 0x60000, 0x6fffd, 0x70000, 0x7fffd, 0x80000, 0x8fffd, 0x90000, 0x9fffd, 0xa0000, 0xafffd, 0xb0000, 0xbfffd, 0xc0000, 0xcfffd, 0xd0000, 0xdfffd, 0xe0000, 0xe0000, 0xe0002, 0xe001f, 0xe0080, 0xefffd];
  17464. /* eslint-enable */
  17465. var isUnassignedCodePoint = function isUnassignedCodePoint(character) {
  17466. return inRange(character, unassigned_code_points);
  17467. };
  17468. /* eslint-disable prettier/prettier */
  17469. /**
  17470. * B.1 Commonly mapped to nothing
  17471. * @link https://tools.ietf.org/html/rfc3454#appendix-B.1
  17472. */
  17473. var commonly_mapped_to_nothing = [0x00ad, 0x00ad, 0x034f, 0x034f, 0x1806, 0x1806, 0x180b, 0x180b, 0x180c, 0x180c, 0x180d, 0x180d, 0x200b, 0x200b, 0x200c, 0x200c, 0x200d, 0x200d, 0x2060, 0x2060, 0xfe00, 0xfe00, 0xfe01, 0xfe01, 0xfe02, 0xfe02, 0xfe03, 0xfe03, 0xfe04, 0xfe04, 0xfe05, 0xfe05, 0xfe06, 0xfe06, 0xfe07, 0xfe07, 0xfe08, 0xfe08, 0xfe09, 0xfe09, 0xfe0a, 0xfe0a, 0xfe0b, 0xfe0b, 0xfe0c, 0xfe0c, 0xfe0d, 0xfe0d, 0xfe0e, 0xfe0e, 0xfe0f, 0xfe0f, 0xfeff, 0xfeff];
  17474. /* eslint-enable */
  17475. var isCommonlyMappedToNothing = function isCommonlyMappedToNothing(character) {
  17476. return inRange(character, commonly_mapped_to_nothing);
  17477. };
  17478. /* eslint-disable prettier/prettier */
  17479. /**
  17480. * C.1.2 Non-ASCII space characters
  17481. * @link https://tools.ietf.org/html/rfc3454#appendix-C.1.2
  17482. */
  17483. var non_ASCII_space_characters = [0x00a0, 0x00a0
  17484. /* NO-BREAK SPACE */
  17485. , 0x1680, 0x1680
  17486. /* OGHAM SPACE MARK */
  17487. , 0x2000, 0x2000
  17488. /* EN QUAD */
  17489. , 0x2001, 0x2001
  17490. /* EM QUAD */
  17491. , 0x2002, 0x2002
  17492. /* EN SPACE */
  17493. , 0x2003, 0x2003
  17494. /* EM SPACE */
  17495. , 0x2004, 0x2004
  17496. /* THREE-PER-EM SPACE */
  17497. , 0x2005, 0x2005
  17498. /* FOUR-PER-EM SPACE */
  17499. , 0x2006, 0x2006
  17500. /* SIX-PER-EM SPACE */
  17501. , 0x2007, 0x2007
  17502. /* FIGURE SPACE */
  17503. , 0x2008, 0x2008
  17504. /* PUNCTUATION SPACE */
  17505. , 0x2009, 0x2009
  17506. /* THIN SPACE */
  17507. , 0x200a, 0x200a
  17508. /* HAIR SPACE */
  17509. , 0x200b, 0x200b
  17510. /* ZERO WIDTH SPACE */
  17511. , 0x202f, 0x202f
  17512. /* NARROW NO-BREAK SPACE */
  17513. , 0x205f, 0x205f
  17514. /* MEDIUM MATHEMATICAL SPACE */
  17515. , 0x3000, 0x3000
  17516. /* IDEOGRAPHIC SPACE */
  17517. ];
  17518. /* eslint-enable */
  17519. var isNonASCIISpaceCharacter = function isNonASCIISpaceCharacter(character) {
  17520. return inRange(character, non_ASCII_space_characters);
  17521. };
  17522. /* eslint-disable prettier/prettier */
  17523. var non_ASCII_controls_characters = [
  17524. /**
  17525. * C.2.2 Non-ASCII control characters
  17526. * @link https://tools.ietf.org/html/rfc3454#appendix-C.2.2
  17527. */
  17528. 0x0080, 0x009f
  17529. /* [CONTROL CHARACTERS] */
  17530. , 0x06dd, 0x06dd
  17531. /* ARABIC END OF AYAH */
  17532. , 0x070f, 0x070f
  17533. /* SYRIAC ABBREVIATION MARK */
  17534. , 0x180e, 0x180e
  17535. /* MONGOLIAN VOWEL SEPARATOR */
  17536. , 0x200c, 0x200c
  17537. /* ZERO WIDTH NON-JOINER */
  17538. , 0x200d, 0x200d
  17539. /* ZERO WIDTH JOINER */
  17540. , 0x2028, 0x2028
  17541. /* LINE SEPARATOR */
  17542. , 0x2029, 0x2029
  17543. /* PARAGRAPH SEPARATOR */
  17544. , 0x2060, 0x2060
  17545. /* WORD JOINER */
  17546. , 0x2061, 0x2061
  17547. /* FUNCTION APPLICATION */
  17548. , 0x2062, 0x2062
  17549. /* INVISIBLE TIMES */
  17550. , 0x2063, 0x2063
  17551. /* INVISIBLE SEPARATOR */
  17552. , 0x206a, 0x206f
  17553. /* [CONTROL CHARACTERS] */
  17554. , 0xfeff, 0xfeff
  17555. /* ZERO WIDTH NO-BREAK SPACE */
  17556. , 0xfff9, 0xfffc
  17557. /* [CONTROL CHARACTERS] */
  17558. , 0x1d173, 0x1d17a
  17559. /* [MUSICAL CONTROL CHARACTERS] */
  17560. ];
  17561. var non_character_codepoints = [
  17562. /**
  17563. * C.4 Non-character code points
  17564. * @link https://tools.ietf.org/html/rfc3454#appendix-C.4
  17565. */
  17566. 0xfdd0, 0xfdef
  17567. /* [NONCHARACTER CODE POINTS] */
  17568. , 0xfffe, 0xffff
  17569. /* [NONCHARACTER CODE POINTS] */
  17570. , 0x1fffe, 0x1ffff
  17571. /* [NONCHARACTER CODE POINTS] */
  17572. , 0x2fffe, 0x2ffff
  17573. /* [NONCHARACTER CODE POINTS] */
  17574. , 0x3fffe, 0x3ffff
  17575. /* [NONCHARACTER CODE POINTS] */
  17576. , 0x4fffe, 0x4ffff
  17577. /* [NONCHARACTER CODE POINTS] */
  17578. , 0x5fffe, 0x5ffff
  17579. /* [NONCHARACTER CODE POINTS] */
  17580. , 0x6fffe, 0x6ffff
  17581. /* [NONCHARACTER CODE POINTS] */
  17582. , 0x7fffe, 0x7ffff
  17583. /* [NONCHARACTER CODE POINTS] */
  17584. , 0x8fffe, 0x8ffff
  17585. /* [NONCHARACTER CODE POINTS] */
  17586. , 0x9fffe, 0x9ffff
  17587. /* [NONCHARACTER CODE POINTS] */
  17588. , 0xafffe, 0xaffff
  17589. /* [NONCHARACTER CODE POINTS] */
  17590. , 0xbfffe, 0xbffff
  17591. /* [NONCHARACTER CODE POINTS] */
  17592. , 0xcfffe, 0xcffff
  17593. /* [NONCHARACTER CODE POINTS] */
  17594. , 0xdfffe, 0xdffff
  17595. /* [NONCHARACTER CODE POINTS] */
  17596. , 0xefffe, 0xeffff
  17597. /* [NONCHARACTER CODE POINTS] */
  17598. , 0x10fffe, 0x10ffff
  17599. /* [NONCHARACTER CODE POINTS] */
  17600. ];
  17601. /**
  17602. * 2.3. Prohibited Output
  17603. */
  17604. var prohibited_characters = [
  17605. /**
  17606. * C.2.1 ASCII control characters
  17607. * @link https://tools.ietf.org/html/rfc3454#appendix-C.2.1
  17608. */
  17609. 0, 0x001f
  17610. /* [CONTROL CHARACTERS] */
  17611. , 0x007f, 0x007f
  17612. /* DELETE */
  17613. ,
  17614. /**
  17615. * C.8 Change display properties or are deprecated
  17616. * @link https://tools.ietf.org/html/rfc3454#appendix-C.8
  17617. */
  17618. 0x0340, 0x0340
  17619. /* COMBINING GRAVE TONE MARK */
  17620. , 0x0341, 0x0341
  17621. /* COMBINING ACUTE TONE MARK */
  17622. , 0x200e, 0x200e
  17623. /* LEFT-TO-RIGHT MARK */
  17624. , 0x200f, 0x200f
  17625. /* RIGHT-TO-LEFT MARK */
  17626. , 0x202a, 0x202a
  17627. /* LEFT-TO-RIGHT EMBEDDING */
  17628. , 0x202b, 0x202b
  17629. /* RIGHT-TO-LEFT EMBEDDING */
  17630. , 0x202c, 0x202c
  17631. /* POP DIRECTIONAL FORMATTING */
  17632. , 0x202d, 0x202d
  17633. /* LEFT-TO-RIGHT OVERRIDE */
  17634. , 0x202e, 0x202e
  17635. /* RIGHT-TO-LEFT OVERRIDE */
  17636. , 0x206a, 0x206a
  17637. /* INHIBIT SYMMETRIC SWAPPING */
  17638. , 0x206b, 0x206b
  17639. /* ACTIVATE SYMMETRIC SWAPPING */
  17640. , 0x206c, 0x206c
  17641. /* INHIBIT ARABIC FORM SHAPING */
  17642. , 0x206d, 0x206d
  17643. /* ACTIVATE ARABIC FORM SHAPING */
  17644. , 0x206e, 0x206e
  17645. /* NATIONAL DIGIT SHAPES */
  17646. , 0x206f, 0x206f
  17647. /* NOMINAL DIGIT SHAPES */
  17648. ,
  17649. /**
  17650. * C.7 Inappropriate for canonical representation
  17651. * @link https://tools.ietf.org/html/rfc3454#appendix-C.7
  17652. */
  17653. 0x2ff0, 0x2ffb
  17654. /* [IDEOGRAPHIC DESCRIPTION CHARACTERS] */
  17655. ,
  17656. /**
  17657. * C.5 Surrogate codes
  17658. * @link https://tools.ietf.org/html/rfc3454#appendix-C.5
  17659. */
  17660. 0xd800, 0xdfff,
  17661. /**
  17662. * C.3 Private use
  17663. * @link https://tools.ietf.org/html/rfc3454#appendix-C.3
  17664. */
  17665. 0xe000, 0xf8ff
  17666. /* [PRIVATE USE, PLANE 0] */
  17667. ,
  17668. /**
  17669. * C.6 Inappropriate for plain text
  17670. * @link https://tools.ietf.org/html/rfc3454#appendix-C.6
  17671. */
  17672. 0xfff9, 0xfff9
  17673. /* INTERLINEAR ANNOTATION ANCHOR */
  17674. , 0xfffa, 0xfffa
  17675. /* INTERLINEAR ANNOTATION SEPARATOR */
  17676. , 0xfffb, 0xfffb
  17677. /* INTERLINEAR ANNOTATION TERMINATOR */
  17678. , 0xfffc, 0xfffc
  17679. /* OBJECT REPLACEMENT CHARACTER */
  17680. , 0xfffd, 0xfffd
  17681. /* REPLACEMENT CHARACTER */
  17682. ,
  17683. /**
  17684. * C.9 Tagging characters
  17685. * @link https://tools.ietf.org/html/rfc3454#appendix-C.9
  17686. */
  17687. 0xe0001, 0xe0001
  17688. /* LANGUAGE TAG */
  17689. , 0xe0020, 0xe007f
  17690. /* [TAGGING CHARACTERS] */
  17691. ,
  17692. /**
  17693. * C.3 Private use
  17694. * @link https://tools.ietf.org/html/rfc3454#appendix-C.3
  17695. */
  17696. 0xf0000, 0xffffd
  17697. /* [PRIVATE USE, PLANE 15] */
  17698. , 0x100000, 0x10fffd
  17699. /* [PRIVATE USE, PLANE 16] */
  17700. ];
  17701. /* eslint-enable */
  17702. var isProhibitedCharacter = function isProhibitedCharacter(character) {
  17703. return inRange(character, non_ASCII_space_characters) || inRange(character, prohibited_characters) || inRange(character, non_ASCII_controls_characters) || inRange(character, non_character_codepoints);
  17704. };
  17705. /* eslint-disable prettier/prettier */
  17706. /**
  17707. * D.1 Characters with bidirectional property "R" or "AL"
  17708. * @link https://tools.ietf.org/html/rfc3454#appendix-D.1
  17709. */
  17710. var bidirectional_r_al = [0x05be, 0x05be, 0x05c0, 0x05c0, 0x05c3, 0x05c3, 0x05d0, 0x05ea, 0x05f0, 0x05f4, 0x061b, 0x061b, 0x061f, 0x061f, 0x0621, 0x063a, 0x0640, 0x064a, 0x066d, 0x066f, 0x0671, 0x06d5, 0x06dd, 0x06dd, 0x06e5, 0x06e6, 0x06fa, 0x06fe, 0x0700, 0x070d, 0x0710, 0x0710, 0x0712, 0x072c, 0x0780, 0x07a5, 0x07b1, 0x07b1, 0x200f, 0x200f, 0xfb1d, 0xfb1d, 0xfb1f, 0xfb28, 0xfb2a, 0xfb36, 0xfb38, 0xfb3c, 0xfb3e, 0xfb3e, 0xfb40, 0xfb41, 0xfb43, 0xfb44, 0xfb46, 0xfbb1, 0xfbd3, 0xfd3d, 0xfd50, 0xfd8f, 0xfd92, 0xfdc7, 0xfdf0, 0xfdfc, 0xfe70, 0xfe74, 0xfe76, 0xfefc];
  17711. /* eslint-enable */
  17712. var isBidirectionalRAL = function isBidirectionalRAL(character) {
  17713. return inRange(character, bidirectional_r_al);
  17714. };
  17715. /* eslint-disable prettier/prettier */
  17716. /**
  17717. * D.2 Characters with bidirectional property "L"
  17718. * @link https://tools.ietf.org/html/rfc3454#appendix-D.2
  17719. */
  17720. var bidirectional_l = [0x0041, 0x005a, 0x0061, 0x007a, 0x00aa, 0x00aa, 0x00b5, 0x00b5, 0x00ba, 0x00ba, 0x00c0, 0x00d6, 0x00d8, 0x00f6, 0x00f8, 0x0220, 0x0222, 0x0233, 0x0250, 0x02ad, 0x02b0, 0x02b8, 0x02bb, 0x02c1, 0x02d0, 0x02d1, 0x02e0, 0x02e4, 0x02ee, 0x02ee, 0x037a, 0x037a, 0x0386, 0x0386, 0x0388, 0x038a, 0x038c, 0x038c, 0x038e, 0x03a1, 0x03a3, 0x03ce, 0x03d0, 0x03f5, 0x0400, 0x0482, 0x048a, 0x04ce, 0x04d0, 0x04f5, 0x04f8, 0x04f9, 0x0500, 0x050f, 0x0531, 0x0556, 0x0559, 0x055f, 0x0561, 0x0587, 0x0589, 0x0589, 0x0903, 0x0903, 0x0905, 0x0939, 0x093d, 0x0940, 0x0949, 0x094c, 0x0950, 0x0950, 0x0958, 0x0961, 0x0964, 0x0970, 0x0982, 0x0983, 0x0985, 0x098c, 0x098f, 0x0990, 0x0993, 0x09a8, 0x09aa, 0x09b0, 0x09b2, 0x09b2, 0x09b6, 0x09b9, 0x09be, 0x09c0, 0x09c7, 0x09c8, 0x09cb, 0x09cc, 0x09d7, 0x09d7, 0x09dc, 0x09dd, 0x09df, 0x09e1, 0x09e6, 0x09f1, 0x09f4, 0x09fa, 0x0a05, 0x0a0a, 0x0a0f, 0x0a10, 0x0a13, 0x0a28, 0x0a2a, 0x0a30, 0x0a32, 0x0a33, 0x0a35, 0x0a36, 0x0a38, 0x0a39, 0x0a3e, 0x0a40, 0x0a59, 0x0a5c, 0x0a5e, 0x0a5e, 0x0a66, 0x0a6f, 0x0a72, 0x0a74, 0x0a83, 0x0a83, 0x0a85, 0x0a8b, 0x0a8d, 0x0a8d, 0x0a8f, 0x0a91, 0x0a93, 0x0aa8, 0x0aaa, 0x0ab0, 0x0ab2, 0x0ab3, 0x0ab5, 0x0ab9, 0x0abd, 0x0ac0, 0x0ac9, 0x0ac9, 0x0acb, 0x0acc, 0x0ad0, 0x0ad0, 0x0ae0, 0x0ae0, 0x0ae6, 0x0aef, 0x0b02, 0x0b03, 0x0b05, 0x0b0c, 0x0b0f, 0x0b10, 0x0b13, 0x0b28, 0x0b2a, 0x0b30, 0x0b32, 0x0b33, 0x0b36, 0x0b39, 0x0b3d, 0x0b3e, 0x0b40, 0x0b40, 0x0b47, 0x0b48, 0x0b4b, 0x0b4c, 0x0b57, 0x0b57, 0x0b5c, 0x0b5d, 0x0b5f, 0x0b61, 0x0b66, 0x0b70, 0x0b83, 0x0b83, 0x0b85, 0x0b8a, 0x0b8e, 0x0b90, 0x0b92, 0x0b95, 0x0b99, 0x0b9a, 0x0b9c, 0x0b9c, 0x0b9e, 0x0b9f, 0x0ba3, 0x0ba4, 0x0ba8, 0x0baa, 0x0bae, 0x0bb5, 0x0bb7, 0x0bb9, 0x0bbe, 0x0bbf, 0x0bc1, 0x0bc2, 0x0bc6, 0x0bc8, 0x0bca, 0x0bcc, 0x0bd7, 0x0bd7, 0x0be7, 0x0bf2, 0x0c01, 0x0c03, 0x0c05, 0x0c0c, 0x0c0e, 0x0c10, 0x0c12, 0x0c28, 0x0c2a, 0x0c33, 0x0c35, 0x0c39, 0x0c41, 0x0c44, 0x0c60, 0x0c61, 0x0c66, 0x0c6f, 0x0c82, 0x0c83, 0x0c85, 0x0c8c, 0x0c8e, 0x0c90, 0x0c92, 0x0ca8, 0x0caa, 0x0cb3, 0x0cb5, 0x0cb9, 0x0cbe, 0x0cbe, 0x0cc0, 0x0cc4, 0x0cc7, 0x0cc8, 0x0cca, 0x0ccb, 0x0cd5, 0x0cd6, 0x0cde, 0x0cde, 0x0ce0, 0x0ce1, 0x0ce6, 0x0cef, 0x0d02, 0x0d03, 0x0d05, 0x0d0c, 0x0d0e, 0x0d10, 0x0d12, 0x0d28, 0x0d2a, 0x0d39, 0x0d3e, 0x0d40, 0x0d46, 0x0d48, 0x0d4a, 0x0d4c, 0x0d57, 0x0d57, 0x0d60, 0x0d61, 0x0d66, 0x0d6f, 0x0d82, 0x0d83, 0x0d85, 0x0d96, 0x0d9a, 0x0db1, 0x0db3, 0x0dbb, 0x0dbd, 0x0dbd, 0x0dc0, 0x0dc6, 0x0dcf, 0x0dd1, 0x0dd8, 0x0ddf, 0x0df2, 0x0df4, 0x0e01, 0x0e30, 0x0e32, 0x0e33, 0x0e40, 0x0e46, 0x0e4f, 0x0e5b, 0x0e81, 0x0e82, 0x0e84, 0x0e84, 0x0e87, 0x0e88, 0x0e8a, 0x0e8a, 0x0e8d, 0x0e8d, 0x0e94, 0x0e97, 0x0e99, 0x0e9f, 0x0ea1, 0x0ea3, 0x0ea5, 0x0ea5, 0x0ea7, 0x0ea7, 0x0eaa, 0x0eab, 0x0ead, 0x0eb0, 0x0eb2, 0x0eb3, 0x0ebd, 0x0ebd, 0x0ec0, 0x0ec4, 0x0ec6, 0x0ec6, 0x0ed0, 0x0ed9, 0x0edc, 0x0edd, 0x0f00, 0x0f17, 0x0f1a, 0x0f34, 0x0f36, 0x0f36, 0x0f38, 0x0f38, 0x0f3e, 0x0f47, 0x0f49, 0x0f6a, 0x0f7f, 0x0f7f, 0x0f85, 0x0f85, 0x0f88, 0x0f8b, 0x0fbe, 0x0fc5, 0x0fc7, 0x0fcc, 0x0fcf, 0x0fcf, 0x1000, 0x1021, 0x1023, 0x1027, 0x1029, 0x102a, 0x102c, 0x102c, 0x1031, 0x1031, 0x1038, 0x1038, 0x1040, 0x1057, 0x10a0, 0x10c5, 0x10d0, 0x10f8, 0x10fb, 0x10fb, 0x1100, 0x1159, 0x115f, 0x11a2, 0x11a8, 0x11f9, 0x1200, 0x1206, 0x1208, 0x1246, 0x1248, 0x1248, 0x124a, 0x124d, 0x1250, 0x1256, 0x1258, 0x1258, 0x125a, 0x125d, 0x1260, 0x1286, 0x1288, 0x1288, 0x128a, 0x128d, 0x1290, 0x12ae, 0x12b0, 0x12b0, 0x12b2, 0x12b5, 0x12b8, 0x12be, 0x12c0, 0x12c0, 0x12c2, 0x12c5, 0x12c8, 0x12ce, 0x12d0, 0x12d6, 0x12d8, 0x12ee, 0x12f0, 0x130e, 0x1310, 0x1310, 0x1312, 0x1315, 0x1318, 0x131e, 0x1320, 0x1346, 0x1348, 0x135a, 0x1361, 0x137c, 0x13a0, 0x13f4, 0x1401, 0x1676, 0x1681, 0x169a, 0x16a0, 0x16f0, 0x1700, 0x170c, 0x170e, 0x1711, 0x1720, 0x1731, 0x1735, 0x1736, 0x1740, 0x1751, 0x1760, 0x176c, 0x176e, 0x1770, 0x1780, 0x17b6, 0x17be, 0x17c5, 0x17c7, 0x17c8, 0x17d4, 0x17da, 0x17dc, 0x17dc, 0x17e0, 0x17e9, 0x1810, 0x1819, 0x1820, 0x1877, 0x1880, 0x18a8, 0x1e00, 0x1e9b, 0x1ea0, 0x1ef9, 0x1f00, 0x1f15, 0x1f18, 0x1f1d, 0x1f20, 0x1f45, 0x1f48, 0x1f4d, 0x1f50, 0x1f57, 0x1f59, 0x1f59, 0x1f5b, 0x1f5b, 0x1f5d, 0x1f5d, 0x1f5f, 0x1f7d, 0x1f80, 0x1fb4, 0x1fb6, 0x1fbc, 0x1fbe, 0x1fbe, 0x1fc2, 0x1fc4, 0x1fc6, 0x1fcc, 0x1fd0, 0x1fd3, 0x1fd6, 0x1fdb, 0x1fe0, 0x1fec, 0x1ff2, 0x1ff4, 0x1ff6, 0x1ffc, 0x200e, 0x200e, 0x2071, 0x2071, 0x207f, 0x207f, 0x2102, 0x2102, 0x2107, 0x2107, 0x210a, 0x2113, 0x2115, 0x2115, 0x2119, 0x211d, 0x2124, 0x2124, 0x2126, 0x2126, 0x2128, 0x2128, 0x212a, 0x212d, 0x212f, 0x2131, 0x2133, 0x2139, 0x213d, 0x213f, 0x2145, 0x2149, 0x2160, 0x2183, 0x2336, 0x237a, 0x2395, 0x2395, 0x249c, 0x24e9, 0x3005, 0x3007, 0x3021, 0x3029, 0x3031, 0x3035, 0x3038, 0x303c, 0x3041, 0x3096, 0x309d, 0x309f, 0x30a1, 0x30fa, 0x30fc, 0x30ff, 0x3105, 0x312c, 0x3131, 0x318e, 0x3190, 0x31b7, 0x31f0, 0x321c, 0x3220, 0x3243, 0x3260, 0x327b, 0x327f, 0x32b0, 0x32c0, 0x32cb, 0x32d0, 0x32fe, 0x3300, 0x3376, 0x337b, 0x33dd, 0x33e0, 0x33fe, 0x3400, 0x4db5, 0x4e00, 0x9fa5, 0xa000, 0xa48c, 0xac00, 0xd7a3, 0xd800, 0xfa2d, 0xfa30, 0xfa6a, 0xfb00, 0xfb06, 0xfb13, 0xfb17, 0xff21, 0xff3a, 0xff41, 0xff5a, 0xff66, 0xffbe, 0xffc2, 0xffc7, 0xffca, 0xffcf, 0xffd2, 0xffd7, 0xffda, 0xffdc, 0x10300, 0x1031e, 0x10320, 0x10323, 0x10330, 0x1034a, 0x10400, 0x10425, 0x10428, 0x1044d, 0x1d000, 0x1d0f5, 0x1d100, 0x1d126, 0x1d12a, 0x1d166, 0x1d16a, 0x1d172, 0x1d183, 0x1d184, 0x1d18c, 0x1d1a9, 0x1d1ae, 0x1d1dd, 0x1d400, 0x1d454, 0x1d456, 0x1d49c, 0x1d49e, 0x1d49f, 0x1d4a2, 0x1d4a2, 0x1d4a5, 0x1d4a6, 0x1d4a9, 0x1d4ac, 0x1d4ae, 0x1d4b9, 0x1d4bb, 0x1d4bb, 0x1d4bd, 0x1d4c0, 0x1d4c2, 0x1d4c3, 0x1d4c5, 0x1d505, 0x1d507, 0x1d50a, 0x1d50d, 0x1d514, 0x1d516, 0x1d51c, 0x1d51e, 0x1d539, 0x1d53b, 0x1d53e, 0x1d540, 0x1d544, 0x1d546, 0x1d546, 0x1d54a, 0x1d550, 0x1d552, 0x1d6a3, 0x1d6a8, 0x1d7c9, 0x20000, 0x2a6d6, 0x2f800, 0x2fa1d, 0xf0000, 0xffffd, 0x100000, 0x10fffd];
  17721. /* eslint-enable */
  17722. var isBidirectionalL = function isBidirectionalL(character) {
  17723. return inRange(character, bidirectional_l);
  17724. };
  17725. /**
  17726. * non-ASCII space characters [StringPrep, C.1.2] that can be
  17727. * mapped to SPACE (U+0020)
  17728. */
  17729. var mapping2space = isNonASCIISpaceCharacter;
  17730. /**
  17731. * the "commonly mapped to nothing" characters [StringPrep, B.1]
  17732. * that can be mapped to nothing.
  17733. */
  17734. var mapping2nothing = isCommonlyMappedToNothing; // utils
  17735. var getCodePoint = function getCodePoint(character) {
  17736. return character.codePointAt(0);
  17737. };
  17738. var first = function first(x) {
  17739. return x[0];
  17740. };
  17741. var last = function last(x) {
  17742. return x[x.length - 1];
  17743. };
  17744. /**
  17745. * Convert provided string into an array of Unicode Code Points.
  17746. * Based on https://stackoverflow.com/a/21409165/1556249
  17747. * and https://www.npmjs.com/package/code-point-at.
  17748. * @param {string} input
  17749. * @returns {number[]}
  17750. */
  17751. function toCodePoints(input) {
  17752. var codepoints = [];
  17753. var size = input.length;
  17754. for (var i = 0; i < size; i += 1) {
  17755. var before = input.charCodeAt(i);
  17756. if (before >= 0xd800 && before <= 0xdbff && size > i + 1) {
  17757. var next = input.charCodeAt(i + 1);
  17758. if (next >= 0xdc00 && next <= 0xdfff) {
  17759. codepoints.push((before - 0xd800) * 0x400 + next - 0xdc00 + 0x10000);
  17760. i += 1;
  17761. continue;
  17762. }
  17763. }
  17764. codepoints.push(before);
  17765. }
  17766. return codepoints;
  17767. }
  17768. /**
  17769. * SASLprep.
  17770. * @param {string} input
  17771. * @param {Object} opts
  17772. * @param {boolean} opts.allowUnassigned
  17773. * @returns {string}
  17774. */
  17775. function saslprep(input) {
  17776. var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  17777. if (typeof input !== 'string') {
  17778. throw new TypeError('Expected string.');
  17779. }
  17780. if (input.length === 0) {
  17781. return '';
  17782. } // 1. Map
  17783. var mapped_input = toCodePoints(input) // 1.1 mapping to space
  17784. .map(function (character) {
  17785. return mapping2space(character) ? 0x20 : character;
  17786. }) // 1.2 mapping to nothing
  17787. .filter(function (character) {
  17788. return !mapping2nothing(character);
  17789. }); // 2. Normalize
  17790. var normalized_input = String.fromCodePoint.apply(null, mapped_input).normalize('NFKC');
  17791. var normalized_map = toCodePoints(normalized_input); // 3. Prohibit
  17792. var hasProhibited = normalized_map.some(isProhibitedCharacter);
  17793. if (hasProhibited) {
  17794. throw new Error('Prohibited character, see https://tools.ietf.org/html/rfc4013#section-2.3');
  17795. } // Unassigned Code Points
  17796. if (opts.allowUnassigned !== true) {
  17797. var hasUnassigned = normalized_map.some(isUnassignedCodePoint);
  17798. if (hasUnassigned) {
  17799. throw new Error('Unassigned code point, see https://tools.ietf.org/html/rfc4013#section-2.5');
  17800. }
  17801. } // 4. check bidi
  17802. var hasBidiRAL = normalized_map.some(isBidirectionalRAL);
  17803. var hasBidiL = normalized_map.some(isBidirectionalL); // 4.1 If a string contains any RandALCat character, the string MUST NOT
  17804. // contain any LCat character.
  17805. if (hasBidiRAL && hasBidiL) {
  17806. throw new Error('String must not contain RandALCat and LCat at the same time,' + ' see https://tools.ietf.org/html/rfc3454#section-6');
  17807. }
  17808. /**
  17809. * 4.2 If a string contains any RandALCat character, a RandALCat
  17810. * character MUST be the first character of the string, and a
  17811. * RandALCat character MUST be the last character of the string.
  17812. */
  17813. var isFirstBidiRAL = isBidirectionalRAL(getCodePoint(first(normalized_input)));
  17814. var isLastBidiRAL = isBidirectionalRAL(getCodePoint(last(normalized_input)));
  17815. if (hasBidiRAL && !(isFirstBidiRAL && isLastBidiRAL)) {
  17816. throw new Error('Bidirectional RandALCat character must be the first and the last' + ' character of the string, see https://tools.ietf.org/html/rfc3454#section-6');
  17817. }
  17818. return normalized_input;
  17819. }
  17820. var PDFSecurity = /*#__PURE__*/function () {
  17821. _createClass(PDFSecurity, null, [{
  17822. key: "generateFileID",
  17823. value: function generateFileID() {
  17824. var info = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  17825. var infoStr = "".concat(info.CreationDate.getTime(), "\n");
  17826. for (var key in info) {
  17827. if (!info.hasOwnProperty(key)) {
  17828. continue;
  17829. }
  17830. infoStr += "".concat(key, ": ").concat(info[key], "\n");
  17831. }
  17832. return wordArrayToBuffer(_cryptoJs.default.MD5(infoStr));
  17833. }
  17834. }, {
  17835. key: "generateRandomWordArray",
  17836. value: function generateRandomWordArray(bytes) {
  17837. return _cryptoJs.default.lib.WordArray.random(bytes);
  17838. }
  17839. }, {
  17840. key: "create",
  17841. value: function create(document) {
  17842. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  17843. if (!options.ownerPassword && !options.userPassword) {
  17844. return null;
  17845. }
  17846. return new PDFSecurity(document, options);
  17847. }
  17848. }]);
  17849. function PDFSecurity(document) {
  17850. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  17851. _classCallCheck(this, PDFSecurity);
  17852. if (!options.ownerPassword && !options.userPassword) {
  17853. throw new Error('None of owner password and user password is defined.');
  17854. }
  17855. this.document = document;
  17856. this._setupEncryption(options);
  17857. }
  17858. _createClass(PDFSecurity, [{
  17859. key: "_setupEncryption",
  17860. value: function _setupEncryption(options) {
  17861. switch (options.pdfVersion) {
  17862. case '1.4':
  17863. case '1.5':
  17864. this.version = 2;
  17865. break;
  17866. case '1.6':
  17867. case '1.7':
  17868. this.version = 4;
  17869. break;
  17870. case '1.7ext3':
  17871. this.version = 5;
  17872. break;
  17873. default:
  17874. this.version = 1;
  17875. break;
  17876. }
  17877. var encDict = {
  17878. Filter: 'Standard'
  17879. };
  17880. switch (this.version) {
  17881. case 1:
  17882. case 2:
  17883. case 4:
  17884. this._setupEncryptionV1V2V4(this.version, encDict, options);
  17885. break;
  17886. case 5:
  17887. this._setupEncryptionV5(encDict, options);
  17888. break;
  17889. }
  17890. this.dictionary = this.document.ref(encDict);
  17891. }
  17892. }, {
  17893. key: "_setupEncryptionV1V2V4",
  17894. value: function _setupEncryptionV1V2V4(v, encDict, options) {
  17895. var r, permissions;
  17896. switch (v) {
  17897. case 1:
  17898. r = 2;
  17899. this.keyBits = 40;
  17900. permissions = getPermissionsR2(options.permissions);
  17901. break;
  17902. case 2:
  17903. r = 3;
  17904. this.keyBits = 128;
  17905. permissions = getPermissionsR3(options.permissions);
  17906. break;
  17907. case 4:
  17908. r = 4;
  17909. this.keyBits = 128;
  17910. permissions = getPermissionsR3(options.permissions);
  17911. break;
  17912. }
  17913. var paddedUserPassword = processPasswordR2R3R4(options.userPassword);
  17914. var paddedOwnerPassword = options.ownerPassword ? processPasswordR2R3R4(options.ownerPassword) : paddedUserPassword;
  17915. var ownerPasswordEntry = getOwnerPasswordR2R3R4(r, this.keyBits, paddedUserPassword, paddedOwnerPassword);
  17916. this.encryptionKey = getEncryptionKeyR2R3R4(r, this.keyBits, this.document._id, paddedUserPassword, ownerPasswordEntry, permissions);
  17917. var userPasswordEntry;
  17918. if (r === 2) {
  17919. userPasswordEntry = getUserPasswordR2(this.encryptionKey);
  17920. } else {
  17921. userPasswordEntry = getUserPasswordR3R4(this.document._id, this.encryptionKey);
  17922. }
  17923. encDict.V = v;
  17924. if (v >= 2) {
  17925. encDict.Length = this.keyBits;
  17926. }
  17927. if (v === 4) {
  17928. encDict.CF = {
  17929. StdCF: {
  17930. AuthEvent: 'DocOpen',
  17931. CFM: 'AESV2',
  17932. Length: this.keyBits / 8
  17933. }
  17934. };
  17935. encDict.StmF = 'StdCF';
  17936. encDict.StrF = 'StdCF';
  17937. }
  17938. encDict.R = r;
  17939. encDict.O = wordArrayToBuffer(ownerPasswordEntry);
  17940. encDict.U = wordArrayToBuffer(userPasswordEntry);
  17941. encDict.P = permissions;
  17942. }
  17943. }, {
  17944. key: "_setupEncryptionV5",
  17945. value: function _setupEncryptionV5(encDict, options) {
  17946. this.keyBits = 256;
  17947. var permissions = getPermissionsR3(options);
  17948. var processedUserPassword = processPasswordR5(options.userPassword);
  17949. var processedOwnerPassword = options.ownerPassword ? processPasswordR5(options.ownerPassword) : processedUserPassword;
  17950. this.encryptionKey = getEncryptionKeyR5(PDFSecurity.generateRandomWordArray);
  17951. var userPasswordEntry = getUserPasswordR5(processedUserPassword, PDFSecurity.generateRandomWordArray);
  17952. var userKeySalt = _cryptoJs.default.lib.WordArray.create(userPasswordEntry.words.slice(10, 12), 8);
  17953. var userEncryptionKeyEntry = getUserEncryptionKeyR5(processedUserPassword, userKeySalt, this.encryptionKey);
  17954. var ownerPasswordEntry = getOwnerPasswordR5(processedOwnerPassword, userPasswordEntry, PDFSecurity.generateRandomWordArray);
  17955. var ownerKeySalt = _cryptoJs.default.lib.WordArray.create(ownerPasswordEntry.words.slice(10, 12), 8);
  17956. var ownerEncryptionKeyEntry = getOwnerEncryptionKeyR5(processedOwnerPassword, ownerKeySalt, userPasswordEntry, this.encryptionKey);
  17957. var permsEntry = getEncryptedPermissionsR5(permissions, this.encryptionKey, PDFSecurity.generateRandomWordArray);
  17958. encDict.V = 5;
  17959. encDict.Length = this.keyBits;
  17960. encDict.CF = {
  17961. StdCF: {
  17962. AuthEvent: 'DocOpen',
  17963. CFM: 'AESV3',
  17964. Length: this.keyBits / 8
  17965. }
  17966. };
  17967. encDict.StmF = 'StdCF';
  17968. encDict.StrF = 'StdCF';
  17969. encDict.R = 5;
  17970. encDict.O = wordArrayToBuffer(ownerPasswordEntry);
  17971. encDict.OE = wordArrayToBuffer(ownerEncryptionKeyEntry);
  17972. encDict.U = wordArrayToBuffer(userPasswordEntry);
  17973. encDict.UE = wordArrayToBuffer(userEncryptionKeyEntry);
  17974. encDict.P = permissions;
  17975. encDict.Perms = wordArrayToBuffer(permsEntry);
  17976. }
  17977. }, {
  17978. key: "getEncryptFn",
  17979. value: function getEncryptFn(obj, gen) {
  17980. var digest;
  17981. if (this.version < 5) {
  17982. digest = this.encryptionKey.clone().concat(_cryptoJs.default.lib.WordArray.create([(obj & 0xff) << 24 | (obj & 0xff00) << 8 | obj >> 8 & 0xff00 | gen & 0xff, (gen & 0xff00) << 16], 5));
  17983. }
  17984. if (this.version === 1 || this.version === 2) {
  17985. var _key = _cryptoJs.default.MD5(digest);
  17986. _key.sigBytes = Math.min(16, this.keyBits / 8 + 5);
  17987. return function (buffer) {
  17988. return wordArrayToBuffer(_cryptoJs.default.RC4.encrypt(_cryptoJs.default.lib.WordArray.create(buffer), _key).ciphertext);
  17989. };
  17990. }
  17991. var key;
  17992. if (this.version === 4) {
  17993. key = _cryptoJs.default.MD5(digest.concat(_cryptoJs.default.lib.WordArray.create([0x73416c54], 4)));
  17994. } else {
  17995. key = this.encryptionKey;
  17996. }
  17997. var iv = PDFSecurity.generateRandomWordArray(16);
  17998. var options = {
  17999. mode: _cryptoJs.default.mode.CBC,
  18000. padding: _cryptoJs.default.pad.Pkcs7,
  18001. iv: iv
  18002. };
  18003. return function (buffer) {
  18004. return wordArrayToBuffer(iv.clone().concat(_cryptoJs.default.AES.encrypt(_cryptoJs.default.lib.WordArray.create(buffer), key, options).ciphertext));
  18005. };
  18006. }
  18007. }, {
  18008. key: "end",
  18009. value: function end() {
  18010. this.dictionary.end();
  18011. }
  18012. }]);
  18013. return PDFSecurity;
  18014. }();
  18015. function getPermissionsR2() {
  18016. var permissionObject = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  18017. var permissions = 0xffffffc0 >> 0;
  18018. if (permissionObject.printing) {
  18019. permissions |= 4;
  18020. }
  18021. if (permissionObject.modifying) {
  18022. permissions |= 8;
  18023. }
  18024. if (permissionObject.copying) {
  18025. permissions |= 16;
  18026. }
  18027. if (permissionObject.annotating) {
  18028. permissions |= 32;
  18029. }
  18030. return permissions;
  18031. }
  18032. function getPermissionsR3() {
  18033. var permissionObject = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  18034. var permissions = 0xfffff0c0 >> 0;
  18035. if (permissionObject.printing === 'lowResolution') {
  18036. permissions |= 4;
  18037. }
  18038. if (permissionObject.printing === 'highResolution') {
  18039. permissions |= 2052;
  18040. }
  18041. if (permissionObject.modifying) {
  18042. permissions |= 8;
  18043. }
  18044. if (permissionObject.copying) {
  18045. permissions |= 16;
  18046. }
  18047. if (permissionObject.annotating) {
  18048. permissions |= 32;
  18049. }
  18050. if (permissionObject.fillingForms) {
  18051. permissions |= 256;
  18052. }
  18053. if (permissionObject.contentAccessibility) {
  18054. permissions |= 512;
  18055. }
  18056. if (permissionObject.documentAssembly) {
  18057. permissions |= 1024;
  18058. }
  18059. return permissions;
  18060. }
  18061. function getUserPasswordR2(encryptionKey) {
  18062. return _cryptoJs.default.RC4.encrypt(processPasswordR2R3R4(), encryptionKey).ciphertext;
  18063. }
  18064. function getUserPasswordR3R4(documentId, encryptionKey) {
  18065. var key = encryptionKey.clone();
  18066. var cipher = _cryptoJs.default.MD5(processPasswordR2R3R4().concat(_cryptoJs.default.lib.WordArray.create(documentId)));
  18067. for (var i = 0; i < 20; i++) {
  18068. var xorRound = Math.ceil(key.sigBytes / 4);
  18069. for (var j = 0; j < xorRound; j++) {
  18070. key.words[j] = encryptionKey.words[j] ^ (i | i << 8 | i << 16 | i << 24);
  18071. }
  18072. cipher = _cryptoJs.default.RC4.encrypt(cipher, key).ciphertext;
  18073. }
  18074. return cipher.concat(_cryptoJs.default.lib.WordArray.create(null, 16));
  18075. }
  18076. function getOwnerPasswordR2R3R4(r, keyBits, paddedUserPassword, paddedOwnerPassword) {
  18077. var digest = paddedOwnerPassword;
  18078. var round = r >= 3 ? 51 : 1;
  18079. for (var i = 0; i < round; i++) {
  18080. digest = _cryptoJs.default.MD5(digest);
  18081. }
  18082. var key = digest.clone();
  18083. key.sigBytes = keyBits / 8;
  18084. var cipher = paddedUserPassword;
  18085. round = r >= 3 ? 20 : 1;
  18086. for (var _i = 0; _i < round; _i++) {
  18087. var xorRound = Math.ceil(key.sigBytes / 4);
  18088. for (var j = 0; j < xorRound; j++) {
  18089. key.words[j] = digest.words[j] ^ (_i | _i << 8 | _i << 16 | _i << 24);
  18090. }
  18091. cipher = _cryptoJs.default.RC4.encrypt(cipher, key).ciphertext;
  18092. }
  18093. return cipher;
  18094. }
  18095. function getEncryptionKeyR2R3R4(r, keyBits, documentId, paddedUserPassword, ownerPasswordEntry, permissions) {
  18096. var key = paddedUserPassword.clone().concat(ownerPasswordEntry).concat(_cryptoJs.default.lib.WordArray.create([lsbFirstWord(permissions)], 4)).concat(_cryptoJs.default.lib.WordArray.create(documentId));
  18097. var round = r >= 3 ? 51 : 1;
  18098. for (var i = 0; i < round; i++) {
  18099. key = _cryptoJs.default.MD5(key);
  18100. key.sigBytes = keyBits / 8;
  18101. }
  18102. return key;
  18103. }
  18104. function getUserPasswordR5(processedUserPassword, generateRandomWordArray) {
  18105. var validationSalt = generateRandomWordArray(8);
  18106. var keySalt = generateRandomWordArray(8);
  18107. return _cryptoJs.default.SHA256(processedUserPassword.clone().concat(validationSalt)).concat(validationSalt).concat(keySalt);
  18108. }
  18109. function getUserEncryptionKeyR5(processedUserPassword, userKeySalt, encryptionKey) {
  18110. var key = _cryptoJs.default.SHA256(processedUserPassword.clone().concat(userKeySalt));
  18111. var options = {
  18112. mode: _cryptoJs.default.mode.CBC,
  18113. padding: _cryptoJs.default.pad.NoPadding,
  18114. iv: _cryptoJs.default.lib.WordArray.create(null, 16)
  18115. };
  18116. return _cryptoJs.default.AES.encrypt(encryptionKey, key, options).ciphertext;
  18117. }
  18118. function getOwnerPasswordR5(processedOwnerPassword, userPasswordEntry, generateRandomWordArray) {
  18119. var validationSalt = generateRandomWordArray(8);
  18120. var keySalt = generateRandomWordArray(8);
  18121. return _cryptoJs.default.SHA256(processedOwnerPassword.clone().concat(validationSalt).concat(userPasswordEntry)).concat(validationSalt).concat(keySalt);
  18122. }
  18123. function getOwnerEncryptionKeyR5(processedOwnerPassword, ownerKeySalt, userPasswordEntry, encryptionKey) {
  18124. var key = _cryptoJs.default.SHA256(processedOwnerPassword.clone().concat(ownerKeySalt).concat(userPasswordEntry));
  18125. var options = {
  18126. mode: _cryptoJs.default.mode.CBC,
  18127. padding: _cryptoJs.default.pad.NoPadding,
  18128. iv: _cryptoJs.default.lib.WordArray.create(null, 16)
  18129. };
  18130. return _cryptoJs.default.AES.encrypt(encryptionKey, key, options).ciphertext;
  18131. }
  18132. function getEncryptionKeyR5(generateRandomWordArray) {
  18133. return generateRandomWordArray(32);
  18134. }
  18135. function getEncryptedPermissionsR5(permissions, encryptionKey, generateRandomWordArray) {
  18136. var cipher = _cryptoJs.default.lib.WordArray.create([lsbFirstWord(permissions), 0xffffffff, 0x54616462], 12).concat(generateRandomWordArray(4));
  18137. var options = {
  18138. mode: _cryptoJs.default.mode.ECB,
  18139. padding: _cryptoJs.default.pad.NoPadding
  18140. };
  18141. return _cryptoJs.default.AES.encrypt(cipher, encryptionKey, options).ciphertext;
  18142. }
  18143. function processPasswordR2R3R4() {
  18144. var password = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
  18145. var out = new Buffer(32);
  18146. var length = password.length;
  18147. var index = 0;
  18148. while (index < length && index < 32) {
  18149. var code = password.charCodeAt(index);
  18150. if (code > 0xff) {
  18151. throw new Error('Password contains one or more invalid characters.');
  18152. }
  18153. out[index] = code;
  18154. index++;
  18155. }
  18156. while (index < 32) {
  18157. out[index] = PASSWORD_PADDING[index - length];
  18158. index++;
  18159. }
  18160. return _cryptoJs.default.lib.WordArray.create(out);
  18161. }
  18162. function processPasswordR5() {
  18163. var password = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
  18164. password = unescape(encodeURIComponent(saslprep(password)));
  18165. var length = Math.min(127, password.length);
  18166. var out = new Buffer(length);
  18167. for (var i = 0; i < length; i++) {
  18168. out[i] = password.charCodeAt(i);
  18169. }
  18170. return _cryptoJs.default.lib.WordArray.create(out);
  18171. }
  18172. function lsbFirstWord(data) {
  18173. return (data & 0xff) << 24 | (data & 0xff00) << 8 | data >> 8 & 0xff00 | data >> 24 & 0xff;
  18174. }
  18175. function wordArrayToBuffer(wordArray) {
  18176. var byteArray = [];
  18177. for (var i = 0; i < wordArray.sigBytes; i++) {
  18178. byteArray.push(wordArray.words[Math.floor(i / 4)] >> 8 * (3 - i % 4) & 0xff);
  18179. }
  18180. return Buffer.from(byteArray);
  18181. }
  18182. var PASSWORD_PADDING = [0x28, 0xbf, 0x4e, 0x5e, 0x4e, 0x75, 0x8a, 0x41, 0x64, 0x00, 0x4e, 0x56, 0xff, 0xfa, 0x01, 0x08, 0x2e, 0x2e, 0x00, 0xb6, 0xd0, 0x68, 0x3e, 0x80, 0x2f, 0x0c, 0xa9, 0xfe, 0x64, 0x53, 0x69, 0x7a];
  18183. var number = PDFObject.number;
  18184. var PDFGradient = /*#__PURE__*/function () {
  18185. function PDFGradient(doc) {
  18186. _classCallCheck(this, PDFGradient);
  18187. this.doc = doc;
  18188. this.stops = [];
  18189. this.embedded = false;
  18190. this.transform = [1, 0, 0, 1, 0, 0];
  18191. }
  18192. _createClass(PDFGradient, [{
  18193. key: "stop",
  18194. value: function stop(pos, color, opacity) {
  18195. if (opacity == null) {
  18196. opacity = 1;
  18197. }
  18198. color = this.doc._normalizeColor(color);
  18199. if (this.stops.length === 0) {
  18200. if (color.length === 3) {
  18201. this._colorSpace = 'DeviceRGB';
  18202. } else if (color.length === 4) {
  18203. this._colorSpace = 'DeviceCMYK';
  18204. } else if (color.length === 1) {
  18205. this._colorSpace = 'DeviceGray';
  18206. } else {
  18207. throw new Error('Unknown color space');
  18208. }
  18209. } else if (this._colorSpace === 'DeviceRGB' && color.length !== 3 || this._colorSpace === 'DeviceCMYK' && color.length !== 4 || this._colorSpace === 'DeviceGray' && color.length !== 1) {
  18210. throw new Error('All gradient stops must use the same color space');
  18211. }
  18212. opacity = Math.max(0, Math.min(1, opacity));
  18213. this.stops.push([pos, color, opacity]);
  18214. return this;
  18215. }
  18216. }, {
  18217. key: "setTransform",
  18218. value: function setTransform(m11, m12, m21, m22, dx, dy) {
  18219. this.transform = [m11, m12, m21, m22, dx, dy];
  18220. return this;
  18221. }
  18222. }, {
  18223. key: "embed",
  18224. value: function embed(m) {
  18225. var fn;
  18226. var stopsLength = this.stops.length;
  18227. if (stopsLength === 0) {
  18228. return;
  18229. }
  18230. this.embedded = true;
  18231. this.matrix = m; // if the last stop comes before 100%, add a copy at 100%
  18232. var last = this.stops[stopsLength - 1];
  18233. if (last[0] < 1) {
  18234. this.stops.push([1, last[1], last[2]]);
  18235. }
  18236. var bounds = [];
  18237. var encode = [];
  18238. var stops = [];
  18239. for (var i = 0; i < stopsLength - 1; i++) {
  18240. encode.push(0, 1);
  18241. if (i + 2 !== stopsLength) {
  18242. bounds.push(this.stops[i + 1][0]);
  18243. }
  18244. fn = this.doc.ref({
  18245. FunctionType: 2,
  18246. Domain: [0, 1],
  18247. C0: this.stops[i + 0][1],
  18248. C1: this.stops[i + 1][1],
  18249. N: 1
  18250. });
  18251. stops.push(fn);
  18252. fn.end();
  18253. } // if there are only two stops, we don't need a stitching function
  18254. if (stopsLength === 1) {
  18255. fn = stops[0];
  18256. } else {
  18257. fn = this.doc.ref({
  18258. FunctionType: 3,
  18259. // stitching function
  18260. Domain: [0, 1],
  18261. Functions: stops,
  18262. Bounds: bounds,
  18263. Encode: encode
  18264. });
  18265. fn.end();
  18266. }
  18267. this.id = "Sh".concat(++this.doc._gradCount);
  18268. var shader = this.shader(fn);
  18269. shader.end();
  18270. var pattern = this.doc.ref({
  18271. Type: 'Pattern',
  18272. PatternType: 2,
  18273. Shading: shader,
  18274. Matrix: this.matrix.map(number)
  18275. });
  18276. pattern.end();
  18277. if (this.stops.some(function (stop) {
  18278. return stop[2] < 1;
  18279. })) {
  18280. var grad = this.opacityGradient();
  18281. grad._colorSpace = 'DeviceGray';
  18282. var _iteratorNormalCompletion = true;
  18283. var _didIteratorError = false;
  18284. var _iteratorError = undefined;
  18285. try {
  18286. for (var _iterator = this.stops[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
  18287. var stop = _step.value;
  18288. grad.stop(stop[0], [stop[2]]);
  18289. }
  18290. } catch (err) {
  18291. _didIteratorError = true;
  18292. _iteratorError = err;
  18293. } finally {
  18294. try {
  18295. if (!_iteratorNormalCompletion && _iterator.return != null) {
  18296. _iterator.return();
  18297. }
  18298. } finally {
  18299. if (_didIteratorError) {
  18300. throw _iteratorError;
  18301. }
  18302. }
  18303. }
  18304. grad = grad.embed(this.matrix);
  18305. var pageBBox = [0, 0, this.doc.page.width, this.doc.page.height];
  18306. var form = this.doc.ref({
  18307. Type: 'XObject',
  18308. Subtype: 'Form',
  18309. FormType: 1,
  18310. BBox: pageBBox,
  18311. Group: {
  18312. Type: 'Group',
  18313. S: 'Transparency',
  18314. CS: 'DeviceGray'
  18315. },
  18316. Resources: {
  18317. ProcSet: ['PDF', 'Text', 'ImageB', 'ImageC', 'ImageI'],
  18318. Pattern: {
  18319. Sh1: grad
  18320. }
  18321. }
  18322. });
  18323. form.write('/Pattern cs /Sh1 scn');
  18324. form.end("".concat(pageBBox.join(' '), " re f"));
  18325. var gstate = this.doc.ref({
  18326. Type: 'ExtGState',
  18327. SMask: {
  18328. Type: 'Mask',
  18329. S: 'Luminosity',
  18330. G: form
  18331. }
  18332. });
  18333. gstate.end();
  18334. var opacityPattern = this.doc.ref({
  18335. Type: 'Pattern',
  18336. PatternType: 1,
  18337. PaintType: 1,
  18338. TilingType: 2,
  18339. BBox: pageBBox,
  18340. XStep: pageBBox[2],
  18341. YStep: pageBBox[3],
  18342. Resources: {
  18343. ProcSet: ['PDF', 'Text', 'ImageB', 'ImageC', 'ImageI'],
  18344. Pattern: {
  18345. Sh1: pattern
  18346. },
  18347. ExtGState: {
  18348. Gs1: gstate
  18349. }
  18350. }
  18351. });
  18352. opacityPattern.write('/Gs1 gs /Pattern cs /Sh1 scn');
  18353. opacityPattern.end("".concat(pageBBox.join(' '), " re f"));
  18354. this.doc.page.patterns[this.id] = opacityPattern;
  18355. } else {
  18356. this.doc.page.patterns[this.id] = pattern;
  18357. }
  18358. return pattern;
  18359. }
  18360. }, {
  18361. key: "apply",
  18362. value: function apply(op) {
  18363. // apply gradient transform to existing document ctm
  18364. var _this$doc$_ctm = _slicedToArray(this.doc._ctm, 6),
  18365. m0 = _this$doc$_ctm[0],
  18366. m1 = _this$doc$_ctm[1],
  18367. m2 = _this$doc$_ctm[2],
  18368. m3 = _this$doc$_ctm[3],
  18369. m4 = _this$doc$_ctm[4],
  18370. m5 = _this$doc$_ctm[5];
  18371. var _this$transform = _slicedToArray(this.transform, 6),
  18372. m11 = _this$transform[0],
  18373. m12 = _this$transform[1],
  18374. m21 = _this$transform[2],
  18375. m22 = _this$transform[3],
  18376. dx = _this$transform[4],
  18377. dy = _this$transform[5];
  18378. var m = [m0 * m11 + m2 * m12, m1 * m11 + m3 * m12, m0 * m21 + m2 * m22, m1 * m21 + m3 * m22, m0 * dx + m2 * dy + m4, m1 * dx + m3 * dy + m5];
  18379. if (!this.embedded || m.join(' ') !== this.matrix.join(' ')) {
  18380. this.embed(m);
  18381. }
  18382. return this.doc.addContent("/".concat(this.id, " ").concat(op));
  18383. }
  18384. }]);
  18385. return PDFGradient;
  18386. }();
  18387. var PDFLinearGradient = /*#__PURE__*/function (_PDFGradient) {
  18388. _inherits(PDFLinearGradient, _PDFGradient);
  18389. function PDFLinearGradient(doc, x1, y1, x2, y2) {
  18390. var _this;
  18391. _classCallCheck(this, PDFLinearGradient);
  18392. _this = _possibleConstructorReturn(this, _getPrototypeOf(PDFLinearGradient).call(this, doc));
  18393. _this.x1 = x1;
  18394. _this.y1 = y1;
  18395. _this.x2 = x2;
  18396. _this.y2 = y2;
  18397. return _this;
  18398. }
  18399. _createClass(PDFLinearGradient, [{
  18400. key: "shader",
  18401. value: function shader(fn) {
  18402. return this.doc.ref({
  18403. ShadingType: 2,
  18404. ColorSpace: this._colorSpace,
  18405. Coords: [this.x1, this.y1, this.x2, this.y2],
  18406. Function: fn,
  18407. Extend: [true, true]
  18408. });
  18409. }
  18410. }, {
  18411. key: "opacityGradient",
  18412. value: function opacityGradient() {
  18413. return new PDFLinearGradient(this.doc, this.x1, this.y1, this.x2, this.y2);
  18414. }
  18415. }]);
  18416. return PDFLinearGradient;
  18417. }(PDFGradient);
  18418. var PDFRadialGradient = /*#__PURE__*/function (_PDFGradient2) {
  18419. _inherits(PDFRadialGradient, _PDFGradient2);
  18420. function PDFRadialGradient(doc, x1, y1, r1, x2, y2, r2) {
  18421. var _this2;
  18422. _classCallCheck(this, PDFRadialGradient);
  18423. _this2 = _possibleConstructorReturn(this, _getPrototypeOf(PDFRadialGradient).call(this, doc));
  18424. _this2.doc = doc;
  18425. _this2.x1 = x1;
  18426. _this2.y1 = y1;
  18427. _this2.r1 = r1;
  18428. _this2.x2 = x2;
  18429. _this2.y2 = y2;
  18430. _this2.r2 = r2;
  18431. return _this2;
  18432. }
  18433. _createClass(PDFRadialGradient, [{
  18434. key: "shader",
  18435. value: function shader(fn) {
  18436. return this.doc.ref({
  18437. ShadingType: 3,
  18438. ColorSpace: this._colorSpace,
  18439. Coords: [this.x1, this.y1, this.r1, this.x2, this.y2, this.r2],
  18440. Function: fn,
  18441. Extend: [true, true]
  18442. });
  18443. }
  18444. }, {
  18445. key: "opacityGradient",
  18446. value: function opacityGradient() {
  18447. return new PDFRadialGradient(this.doc, this.x1, this.y1, this.r1, this.x2, this.y2, this.r2);
  18448. }
  18449. }]);
  18450. return PDFRadialGradient;
  18451. }(PDFGradient);
  18452. var Gradient = {
  18453. PDFGradient: PDFGradient,
  18454. PDFLinearGradient: PDFLinearGradient,
  18455. PDFRadialGradient: PDFRadialGradient
  18456. };
  18457. var PDFGradient$1 = Gradient.PDFGradient,
  18458. PDFLinearGradient$1 = Gradient.PDFLinearGradient,
  18459. PDFRadialGradient$1 = Gradient.PDFRadialGradient;
  18460. var ColorMixin = {
  18461. initColor: function initColor() {
  18462. // The opacity dictionaries
  18463. this._opacityRegistry = {};
  18464. this._opacityCount = 0;
  18465. return this._gradCount = 0;
  18466. },
  18467. _normalizeColor: function _normalizeColor(color) {
  18468. if (color instanceof PDFGradient$1) {
  18469. return color;
  18470. }
  18471. if (typeof color === 'string') {
  18472. if (color.charAt(0) === '#') {
  18473. if (color.length === 4) {
  18474. color = color.replace(/#([0-9A-F])([0-9A-F])([0-9A-F])/i, '#$1$1$2$2$3$3');
  18475. }
  18476. var hex = parseInt(color.slice(1), 16);
  18477. color = [hex >> 16, hex >> 8 & 0xff, hex & 0xff];
  18478. } else if (namedColors[color]) {
  18479. color = namedColors[color];
  18480. }
  18481. }
  18482. if (Array.isArray(color)) {
  18483. // RGB
  18484. if (color.length === 3) {
  18485. color = color.map(function (part) {
  18486. return part / 255;
  18487. }); // CMYK
  18488. } else if (color.length === 4) {
  18489. color = color.map(function (part) {
  18490. return part / 100;
  18491. });
  18492. }
  18493. return color;
  18494. }
  18495. return null;
  18496. },
  18497. _setColor: function _setColor(color, stroke) {
  18498. color = this._normalizeColor(color);
  18499. if (!color) {
  18500. return false;
  18501. }
  18502. var op = stroke ? 'SCN' : 'scn';
  18503. if (color instanceof PDFGradient$1) {
  18504. this._setColorSpace('Pattern', stroke);
  18505. color.apply(op);
  18506. } else {
  18507. var space = color.length === 4 ? 'DeviceCMYK' : 'DeviceRGB';
  18508. this._setColorSpace(space, stroke);
  18509. color = color.join(' ');
  18510. this.addContent("".concat(color, " ").concat(op));
  18511. }
  18512. return true;
  18513. },
  18514. _setColorSpace: function _setColorSpace(space, stroke) {
  18515. var op = stroke ? 'CS' : 'cs';
  18516. return this.addContent("/".concat(space, " ").concat(op));
  18517. },
  18518. fillColor: function fillColor(color, opacity) {
  18519. var set = this._setColor(color, false);
  18520. if (set) {
  18521. this.fillOpacity(opacity);
  18522. } // save this for text wrapper, which needs to reset
  18523. // the fill color on new pages
  18524. this._fillColor = [color, opacity];
  18525. return this;
  18526. },
  18527. strokeColor: function strokeColor(color, opacity) {
  18528. var set = this._setColor(color, true);
  18529. if (set) {
  18530. this.strokeOpacity(opacity);
  18531. }
  18532. return this;
  18533. },
  18534. opacity: function opacity(_opacity) {
  18535. this._doOpacity(_opacity, _opacity);
  18536. return this;
  18537. },
  18538. fillOpacity: function fillOpacity(opacity) {
  18539. this._doOpacity(opacity, null);
  18540. return this;
  18541. },
  18542. strokeOpacity: function strokeOpacity(opacity) {
  18543. this._doOpacity(null, opacity);
  18544. return this;
  18545. },
  18546. _doOpacity: function _doOpacity(fillOpacity, strokeOpacity) {
  18547. var dictionary, name;
  18548. if (fillOpacity == null && strokeOpacity == null) {
  18549. return;
  18550. }
  18551. if (fillOpacity != null) {
  18552. fillOpacity = Math.max(0, Math.min(1, fillOpacity));
  18553. }
  18554. if (strokeOpacity != null) {
  18555. strokeOpacity = Math.max(0, Math.min(1, strokeOpacity));
  18556. }
  18557. var key = "".concat(fillOpacity, "_").concat(strokeOpacity);
  18558. if (this._opacityRegistry[key]) {
  18559. var _this$_opacityRegistr = _slicedToArray(this._opacityRegistry[key], 2);
  18560. dictionary = _this$_opacityRegistr[0];
  18561. name = _this$_opacityRegistr[1];
  18562. } else {
  18563. dictionary = {
  18564. Type: 'ExtGState'
  18565. };
  18566. if (fillOpacity != null) {
  18567. dictionary.ca = fillOpacity;
  18568. }
  18569. if (strokeOpacity != null) {
  18570. dictionary.CA = strokeOpacity;
  18571. }
  18572. dictionary = this.ref(dictionary);
  18573. dictionary.end();
  18574. var id = ++this._opacityCount;
  18575. name = "Gs".concat(id);
  18576. this._opacityRegistry[key] = [dictionary, name];
  18577. }
  18578. this.page.ext_gstates[name] = dictionary;
  18579. return this.addContent("/".concat(name, " gs"));
  18580. },
  18581. linearGradient: function linearGradient(x1, y1, x2, y2) {
  18582. return new PDFLinearGradient$1(this, x1, y1, x2, y2);
  18583. },
  18584. radialGradient: function radialGradient(x1, y1, r1, x2, y2, r2) {
  18585. return new PDFRadialGradient$1(this, x1, y1, r1, x2, y2, r2);
  18586. }
  18587. };
  18588. var namedColors = {
  18589. aliceblue: [240, 248, 255],
  18590. antiquewhite: [250, 235, 215],
  18591. aqua: [0, 255, 255],
  18592. aquamarine: [127, 255, 212],
  18593. azure: [240, 255, 255],
  18594. beige: [245, 245, 220],
  18595. bisque: [255, 228, 196],
  18596. black: [0, 0, 0],
  18597. blanchedalmond: [255, 235, 205],
  18598. blue: [0, 0, 255],
  18599. blueviolet: [138, 43, 226],
  18600. brown: [165, 42, 42],
  18601. burlywood: [222, 184, 135],
  18602. cadetblue: [95, 158, 160],
  18603. chartreuse: [127, 255, 0],
  18604. chocolate: [210, 105, 30],
  18605. coral: [255, 127, 80],
  18606. cornflowerblue: [100, 149, 237],
  18607. cornsilk: [255, 248, 220],
  18608. crimson: [220, 20, 60],
  18609. cyan: [0, 255, 255],
  18610. darkblue: [0, 0, 139],
  18611. darkcyan: [0, 139, 139],
  18612. darkgoldenrod: [184, 134, 11],
  18613. darkgray: [169, 169, 169],
  18614. darkgreen: [0, 100, 0],
  18615. darkgrey: [169, 169, 169],
  18616. darkkhaki: [189, 183, 107],
  18617. darkmagenta: [139, 0, 139],
  18618. darkolivegreen: [85, 107, 47],
  18619. darkorange: [255, 140, 0],
  18620. darkorchid: [153, 50, 204],
  18621. darkred: [139, 0, 0],
  18622. darksalmon: [233, 150, 122],
  18623. darkseagreen: [143, 188, 143],
  18624. darkslateblue: [72, 61, 139],
  18625. darkslategray: [47, 79, 79],
  18626. darkslategrey: [47, 79, 79],
  18627. darkturquoise: [0, 206, 209],
  18628. darkviolet: [148, 0, 211],
  18629. deeppink: [255, 20, 147],
  18630. deepskyblue: [0, 191, 255],
  18631. dimgray: [105, 105, 105],
  18632. dimgrey: [105, 105, 105],
  18633. dodgerblue: [30, 144, 255],
  18634. firebrick: [178, 34, 34],
  18635. floralwhite: [255, 250, 240],
  18636. forestgreen: [34, 139, 34],
  18637. fuchsia: [255, 0, 255],
  18638. gainsboro: [220, 220, 220],
  18639. ghostwhite: [248, 248, 255],
  18640. gold: [255, 215, 0],
  18641. goldenrod: [218, 165, 32],
  18642. gray: [128, 128, 128],
  18643. grey: [128, 128, 128],
  18644. green: [0, 128, 0],
  18645. greenyellow: [173, 255, 47],
  18646. honeydew: [240, 255, 240],
  18647. hotpink: [255, 105, 180],
  18648. indianred: [205, 92, 92],
  18649. indigo: [75, 0, 130],
  18650. ivory: [255, 255, 240],
  18651. khaki: [240, 230, 140],
  18652. lavender: [230, 230, 250],
  18653. lavenderblush: [255, 240, 245],
  18654. lawngreen: [124, 252, 0],
  18655. lemonchiffon: [255, 250, 205],
  18656. lightblue: [173, 216, 230],
  18657. lightcoral: [240, 128, 128],
  18658. lightcyan: [224, 255, 255],
  18659. lightgoldenrodyellow: [250, 250, 210],
  18660. lightgray: [211, 211, 211],
  18661. lightgreen: [144, 238, 144],
  18662. lightgrey: [211, 211, 211],
  18663. lightpink: [255, 182, 193],
  18664. lightsalmon: [255, 160, 122],
  18665. lightseagreen: [32, 178, 170],
  18666. lightskyblue: [135, 206, 250],
  18667. lightslategray: [119, 136, 153],
  18668. lightslategrey: [119, 136, 153],
  18669. lightsteelblue: [176, 196, 222],
  18670. lightyellow: [255, 255, 224],
  18671. lime: [0, 255, 0],
  18672. limegreen: [50, 205, 50],
  18673. linen: [250, 240, 230],
  18674. magenta: [255, 0, 255],
  18675. maroon: [128, 0, 0],
  18676. mediumaquamarine: [102, 205, 170],
  18677. mediumblue: [0, 0, 205],
  18678. mediumorchid: [186, 85, 211],
  18679. mediumpurple: [147, 112, 219],
  18680. mediumseagreen: [60, 179, 113],
  18681. mediumslateblue: [123, 104, 238],
  18682. mediumspringgreen: [0, 250, 154],
  18683. mediumturquoise: [72, 209, 204],
  18684. mediumvioletred: [199, 21, 133],
  18685. midnightblue: [25, 25, 112],
  18686. mintcream: [245, 255, 250],
  18687. mistyrose: [255, 228, 225],
  18688. moccasin: [255, 228, 181],
  18689. navajowhite: [255, 222, 173],
  18690. navy: [0, 0, 128],
  18691. oldlace: [253, 245, 230],
  18692. olive: [128, 128, 0],
  18693. olivedrab: [107, 142, 35],
  18694. orange: [255, 165, 0],
  18695. orangered: [255, 69, 0],
  18696. orchid: [218, 112, 214],
  18697. palegoldenrod: [238, 232, 170],
  18698. palegreen: [152, 251, 152],
  18699. paleturquoise: [175, 238, 238],
  18700. palevioletred: [219, 112, 147],
  18701. papayawhip: [255, 239, 213],
  18702. peachpuff: [255, 218, 185],
  18703. peru: [205, 133, 63],
  18704. pink: [255, 192, 203],
  18705. plum: [221, 160, 221],
  18706. powderblue: [176, 224, 230],
  18707. purple: [128, 0, 128],
  18708. red: [255, 0, 0],
  18709. rosybrown: [188, 143, 143],
  18710. royalblue: [65, 105, 225],
  18711. saddlebrown: [139, 69, 19],
  18712. salmon: [250, 128, 114],
  18713. sandybrown: [244, 164, 96],
  18714. seagreen: [46, 139, 87],
  18715. seashell: [255, 245, 238],
  18716. sienna: [160, 82, 45],
  18717. silver: [192, 192, 192],
  18718. skyblue: [135, 206, 235],
  18719. slateblue: [106, 90, 205],
  18720. slategray: [112, 128, 144],
  18721. slategrey: [112, 128, 144],
  18722. snow: [255, 250, 250],
  18723. springgreen: [0, 255, 127],
  18724. steelblue: [70, 130, 180],
  18725. tan: [210, 180, 140],
  18726. teal: [0, 128, 128],
  18727. thistle: [216, 191, 216],
  18728. tomato: [255, 99, 71],
  18729. turquoise: [64, 224, 208],
  18730. violet: [238, 130, 238],
  18731. wheat: [245, 222, 179],
  18732. white: [255, 255, 255],
  18733. whitesmoke: [245, 245, 245],
  18734. yellow: [255, 255, 0],
  18735. yellowgreen: [154, 205, 50]
  18736. };
  18737. var cx, cy, px, py, sx, sy;
  18738. cx = cy = px = py = sx = sy = 0;
  18739. var parameters = {
  18740. A: 7,
  18741. a: 7,
  18742. C: 6,
  18743. c: 6,
  18744. H: 1,
  18745. h: 1,
  18746. L: 2,
  18747. l: 2,
  18748. M: 2,
  18749. m: 2,
  18750. Q: 4,
  18751. q: 4,
  18752. S: 4,
  18753. s: 4,
  18754. T: 2,
  18755. t: 2,
  18756. V: 1,
  18757. v: 1,
  18758. Z: 0,
  18759. z: 0
  18760. };
  18761. var parse = function parse(path) {
  18762. var cmd;
  18763. var ret = [];
  18764. var args = [];
  18765. var curArg = '';
  18766. var foundDecimal = false;
  18767. var params = 0;
  18768. var _iteratorNormalCompletion = true;
  18769. var _didIteratorError = false;
  18770. var _iteratorError = undefined;
  18771. try {
  18772. for (var _iterator = path[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
  18773. var c = _step.value;
  18774. if (parameters[c] != null) {
  18775. params = parameters[c];
  18776. if (cmd) {
  18777. // save existing command
  18778. if (curArg.length > 0) {
  18779. args[args.length] = +curArg;
  18780. }
  18781. ret[ret.length] = {
  18782. cmd: cmd,
  18783. args: args
  18784. };
  18785. args = [];
  18786. curArg = '';
  18787. foundDecimal = false;
  18788. }
  18789. cmd = c;
  18790. } else if ([' ', ','].includes(c) || c === '-' && curArg.length > 0 && curArg[curArg.length - 1] !== 'e' || c === '.' && foundDecimal) {
  18791. if (curArg.length === 0) {
  18792. continue;
  18793. }
  18794. if (args.length === params) {
  18795. // handle reused commands
  18796. ret[ret.length] = {
  18797. cmd: cmd,
  18798. args: args
  18799. };
  18800. args = [+curArg]; // handle assumed commands
  18801. if (cmd === 'M') {
  18802. cmd = 'L';
  18803. }
  18804. if (cmd === 'm') {
  18805. cmd = 'l';
  18806. }
  18807. } else {
  18808. args[args.length] = +curArg;
  18809. }
  18810. foundDecimal = c === '.'; // fix for negative numbers or repeated decimals with no delimeter between commands
  18811. curArg = ['-', '.'].includes(c) ? c : '';
  18812. } else {
  18813. curArg += c;
  18814. if (c === '.') {
  18815. foundDecimal = true;
  18816. }
  18817. }
  18818. } // add the last command
  18819. } catch (err) {
  18820. _didIteratorError = true;
  18821. _iteratorError = err;
  18822. } finally {
  18823. try {
  18824. if (!_iteratorNormalCompletion && _iterator.return != null) {
  18825. _iterator.return();
  18826. }
  18827. } finally {
  18828. if (_didIteratorError) {
  18829. throw _iteratorError;
  18830. }
  18831. }
  18832. }
  18833. if (curArg.length > 0) {
  18834. if (args.length === params) {
  18835. // handle reused commands
  18836. ret[ret.length] = {
  18837. cmd: cmd,
  18838. args: args
  18839. };
  18840. args = [+curArg]; // handle assumed commands
  18841. if (cmd === 'M') {
  18842. cmd = 'L';
  18843. }
  18844. if (cmd === 'm') {
  18845. cmd = 'l';
  18846. }
  18847. } else {
  18848. args[args.length] = +curArg;
  18849. }
  18850. }
  18851. ret[ret.length] = {
  18852. cmd: cmd,
  18853. args: args
  18854. };
  18855. return ret;
  18856. };
  18857. var _apply = function apply(commands, doc) {
  18858. // current point, control point, and subpath starting point
  18859. cx = cy = px = py = sx = sy = 0; // run the commands
  18860. for (var i = 0; i < commands.length; i++) {
  18861. var c = commands[i];
  18862. if (typeof runners[c.cmd] === 'function') {
  18863. runners[c.cmd](doc, c.args);
  18864. }
  18865. }
  18866. };
  18867. var runners = {
  18868. M: function M(doc, a) {
  18869. cx = a[0];
  18870. cy = a[1];
  18871. px = py = null;
  18872. sx = cx;
  18873. sy = cy;
  18874. return doc.moveTo(cx, cy);
  18875. },
  18876. m: function m(doc, a) {
  18877. cx += a[0];
  18878. cy += a[1];
  18879. px = py = null;
  18880. sx = cx;
  18881. sy = cy;
  18882. return doc.moveTo(cx, cy);
  18883. },
  18884. C: function C(doc, a) {
  18885. cx = a[4];
  18886. cy = a[5];
  18887. px = a[2];
  18888. py = a[3];
  18889. return doc.bezierCurveTo.apply(doc, _toConsumableArray(a));
  18890. },
  18891. c: function c(doc, a) {
  18892. doc.bezierCurveTo(a[0] + cx, a[1] + cy, a[2] + cx, a[3] + cy, a[4] + cx, a[5] + cy);
  18893. px = cx + a[2];
  18894. py = cy + a[3];
  18895. cx += a[4];
  18896. return cy += a[5];
  18897. },
  18898. S: function S(doc, a) {
  18899. if (px === null) {
  18900. px = cx;
  18901. py = cy;
  18902. }
  18903. doc.bezierCurveTo(cx - (px - cx), cy - (py - cy), a[0], a[1], a[2], a[3]);
  18904. px = a[0];
  18905. py = a[1];
  18906. cx = a[2];
  18907. return cy = a[3];
  18908. },
  18909. s: function s(doc, a) {
  18910. if (px === null) {
  18911. px = cx;
  18912. py = cy;
  18913. }
  18914. doc.bezierCurveTo(cx - (px - cx), cy - (py - cy), cx + a[0], cy + a[1], cx + a[2], cy + a[3]);
  18915. px = cx + a[0];
  18916. py = cy + a[1];
  18917. cx += a[2];
  18918. return cy += a[3];
  18919. },
  18920. Q: function Q(doc, a) {
  18921. px = a[0];
  18922. py = a[1];
  18923. cx = a[2];
  18924. cy = a[3];
  18925. return doc.quadraticCurveTo(a[0], a[1], cx, cy);
  18926. },
  18927. q: function q(doc, a) {
  18928. doc.quadraticCurveTo(a[0] + cx, a[1] + cy, a[2] + cx, a[3] + cy);
  18929. px = cx + a[0];
  18930. py = cy + a[1];
  18931. cx += a[2];
  18932. return cy += a[3];
  18933. },
  18934. T: function T(doc, a) {
  18935. if (px === null) {
  18936. px = cx;
  18937. py = cy;
  18938. } else {
  18939. px = cx - (px - cx);
  18940. py = cy - (py - cy);
  18941. }
  18942. doc.quadraticCurveTo(px, py, a[0], a[1]);
  18943. px = cx - (px - cx);
  18944. py = cy - (py - cy);
  18945. cx = a[0];
  18946. return cy = a[1];
  18947. },
  18948. t: function t(doc, a) {
  18949. if (px === null) {
  18950. px = cx;
  18951. py = cy;
  18952. } else {
  18953. px = cx - (px - cx);
  18954. py = cy - (py - cy);
  18955. }
  18956. doc.quadraticCurveTo(px, py, cx + a[0], cy + a[1]);
  18957. cx += a[0];
  18958. return cy += a[1];
  18959. },
  18960. A: function A(doc, a) {
  18961. solveArc(doc, cx, cy, a);
  18962. cx = a[5];
  18963. return cy = a[6];
  18964. },
  18965. a: function a(doc, _a) {
  18966. _a[5] += cx;
  18967. _a[6] += cy;
  18968. solveArc(doc, cx, cy, _a);
  18969. cx = _a[5];
  18970. return cy = _a[6];
  18971. },
  18972. L: function L(doc, a) {
  18973. cx = a[0];
  18974. cy = a[1];
  18975. px = py = null;
  18976. return doc.lineTo(cx, cy);
  18977. },
  18978. l: function l(doc, a) {
  18979. cx += a[0];
  18980. cy += a[1];
  18981. px = py = null;
  18982. return doc.lineTo(cx, cy);
  18983. },
  18984. H: function H(doc, a) {
  18985. cx = a[0];
  18986. px = py = null;
  18987. return doc.lineTo(cx, cy);
  18988. },
  18989. h: function h(doc, a) {
  18990. cx += a[0];
  18991. px = py = null;
  18992. return doc.lineTo(cx, cy);
  18993. },
  18994. V: function V(doc, a) {
  18995. cy = a[0];
  18996. px = py = null;
  18997. return doc.lineTo(cx, cy);
  18998. },
  18999. v: function v(doc, a) {
  19000. cy += a[0];
  19001. px = py = null;
  19002. return doc.lineTo(cx, cy);
  19003. },
  19004. Z: function Z(doc) {
  19005. doc.closePath();
  19006. cx = sx;
  19007. return cy = sy;
  19008. },
  19009. z: function z(doc) {
  19010. doc.closePath();
  19011. cx = sx;
  19012. return cy = sy;
  19013. }
  19014. };
  19015. var solveArc = function solveArc(doc, x, y, coords) {
  19016. var _coords = _slicedToArray(coords, 7),
  19017. rx = _coords[0],
  19018. ry = _coords[1],
  19019. rot = _coords[2],
  19020. large = _coords[3],
  19021. sweep = _coords[4],
  19022. ex = _coords[5],
  19023. ey = _coords[6];
  19024. var segs = arcToSegments(ex, ey, rx, ry, large, sweep, rot, x, y);
  19025. var _iteratorNormalCompletion2 = true;
  19026. var _didIteratorError2 = false;
  19027. var _iteratorError2 = undefined;
  19028. try {
  19029. for (var _iterator2 = segs[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
  19030. var seg = _step2.value;
  19031. var bez = segmentToBezier.apply(void 0, _toConsumableArray(seg));
  19032. doc.bezierCurveTo.apply(doc, _toConsumableArray(bez));
  19033. }
  19034. } catch (err) {
  19035. _didIteratorError2 = true;
  19036. _iteratorError2 = err;
  19037. } finally {
  19038. try {
  19039. if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
  19040. _iterator2.return();
  19041. }
  19042. } finally {
  19043. if (_didIteratorError2) {
  19044. throw _iteratorError2;
  19045. }
  19046. }
  19047. }
  19048. }; // from Inkscape svgtopdf, thanks!
  19049. var arcToSegments = function arcToSegments(x, y, rx, ry, large, sweep, rotateX, ox, oy) {
  19050. var th = rotateX * (Math.PI / 180);
  19051. var sin_th = Math.sin(th);
  19052. var cos_th = Math.cos(th);
  19053. rx = Math.abs(rx);
  19054. ry = Math.abs(ry);
  19055. px = cos_th * (ox - x) * 0.5 + sin_th * (oy - y) * 0.5;
  19056. py = cos_th * (oy - y) * 0.5 - sin_th * (ox - x) * 0.5;
  19057. var pl = px * px / (rx * rx) + py * py / (ry * ry);
  19058. if (pl > 1) {
  19059. pl = Math.sqrt(pl);
  19060. rx *= pl;
  19061. ry *= pl;
  19062. }
  19063. var a00 = cos_th / rx;
  19064. var a01 = sin_th / rx;
  19065. var a10 = -sin_th / ry;
  19066. var a11 = cos_th / ry;
  19067. var x0 = a00 * ox + a01 * oy;
  19068. var y0 = a10 * ox + a11 * oy;
  19069. var x1 = a00 * x + a01 * y;
  19070. var y1 = a10 * x + a11 * y;
  19071. var d = (x1 - x0) * (x1 - x0) + (y1 - y0) * (y1 - y0);
  19072. var sfactor_sq = 1 / d - 0.25;
  19073. if (sfactor_sq < 0) {
  19074. sfactor_sq = 0;
  19075. }
  19076. var sfactor = Math.sqrt(sfactor_sq);
  19077. if (sweep === large) {
  19078. sfactor = -sfactor;
  19079. }
  19080. var xc = 0.5 * (x0 + x1) - sfactor * (y1 - y0);
  19081. var yc = 0.5 * (y0 + y1) + sfactor * (x1 - x0);
  19082. var th0 = Math.atan2(y0 - yc, x0 - xc);
  19083. var th1 = Math.atan2(y1 - yc, x1 - xc);
  19084. var th_arc = th1 - th0;
  19085. if (th_arc < 0 && sweep === 1) {
  19086. th_arc += 2 * Math.PI;
  19087. } else if (th_arc > 0 && sweep === 0) {
  19088. th_arc -= 2 * Math.PI;
  19089. }
  19090. var segments = Math.ceil(Math.abs(th_arc / (Math.PI * 0.5 + 0.001)));
  19091. var result = [];
  19092. for (var i = 0; i < segments; i++) {
  19093. var th2 = th0 + i * th_arc / segments;
  19094. var th3 = th0 + (i + 1) * th_arc / segments;
  19095. result[i] = [xc, yc, th2, th3, rx, ry, sin_th, cos_th];
  19096. }
  19097. return result;
  19098. };
  19099. var segmentToBezier = function segmentToBezier(cx, cy, th0, th1, rx, ry, sin_th, cos_th) {
  19100. var a00 = cos_th * rx;
  19101. var a01 = -sin_th * ry;
  19102. var a10 = sin_th * rx;
  19103. var a11 = cos_th * ry;
  19104. var th_half = 0.5 * (th1 - th0);
  19105. var t = 8 / 3 * Math.sin(th_half * 0.5) * Math.sin(th_half * 0.5) / Math.sin(th_half);
  19106. var x1 = cx + Math.cos(th0) - t * Math.sin(th0);
  19107. var y1 = cy + Math.sin(th0) + t * Math.cos(th0);
  19108. var x3 = cx + Math.cos(th1);
  19109. var y3 = cy + Math.sin(th1);
  19110. var x2 = x3 + t * Math.sin(th1);
  19111. var y2 = y3 - t * Math.cos(th1);
  19112. return [a00 * x1 + a01 * y1, a10 * x1 + a11 * y1, a00 * x2 + a01 * y2, a10 * x2 + a11 * y2, a00 * x3 + a01 * y3, a10 * x3 + a11 * y3];
  19113. };
  19114. var SVGPath = /*#__PURE__*/function () {
  19115. function SVGPath() {
  19116. _classCallCheck(this, SVGPath);
  19117. }
  19118. _createClass(SVGPath, null, [{
  19119. key: "apply",
  19120. value: function apply(doc, path) {
  19121. var commands = parse(path);
  19122. _apply(commands, doc);
  19123. }
  19124. }]);
  19125. return SVGPath;
  19126. }();
  19127. var number$1 = PDFObject.number; // This constant is used to approximate a symmetrical arc using a cubic
  19128. // Bezier curve.
  19129. var KAPPA = 4.0 * ((Math.sqrt(2) - 1.0) / 3.0);
  19130. var VectorMixin = {
  19131. initVector: function initVector() {
  19132. this._ctm = [1, 0, 0, 1, 0, 0]; // current transformation matrix
  19133. return this._ctmStack = [];
  19134. },
  19135. save: function save() {
  19136. this._ctmStack.push(this._ctm.slice()); // TODO: save/restore colorspace and styles so not setting it unnessesarily all the time?
  19137. return this.addContent('q');
  19138. },
  19139. restore: function restore() {
  19140. this._ctm = this._ctmStack.pop() || [1, 0, 0, 1, 0, 0];
  19141. return this.addContent('Q');
  19142. },
  19143. closePath: function closePath() {
  19144. return this.addContent('h');
  19145. },
  19146. lineWidth: function lineWidth(w) {
  19147. return this.addContent("".concat(number$1(w), " w"));
  19148. },
  19149. _CAP_STYLES: {
  19150. BUTT: 0,
  19151. ROUND: 1,
  19152. SQUARE: 2
  19153. },
  19154. lineCap: function lineCap(c) {
  19155. if (typeof c === 'string') {
  19156. c = this._CAP_STYLES[c.toUpperCase()];
  19157. }
  19158. return this.addContent("".concat(c, " J"));
  19159. },
  19160. _JOIN_STYLES: {
  19161. MITER: 0,
  19162. ROUND: 1,
  19163. BEVEL: 2
  19164. },
  19165. lineJoin: function lineJoin(j) {
  19166. if (typeof j === 'string') {
  19167. j = this._JOIN_STYLES[j.toUpperCase()];
  19168. }
  19169. return this.addContent("".concat(j, " j"));
  19170. },
  19171. miterLimit: function miterLimit(m) {
  19172. return this.addContent("".concat(number$1(m), " M"));
  19173. },
  19174. dash: function dash(length) {
  19175. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  19176. var originalLength = length;
  19177. if (!Array.isArray(length)) {
  19178. length = [length, options.space || length];
  19179. }
  19180. var valid = length.every(function (x) {
  19181. return Number.isFinite(x) && x > 0;
  19182. });
  19183. if (!valid) {
  19184. throw new Error("dash(".concat(JSON.stringify(originalLength), ", ").concat(JSON.stringify(options), ") invalid, lengths must be numeric and greater than zero"));
  19185. }
  19186. length = length.map(number$1).join(' ');
  19187. return this.addContent("[".concat(length, "] ").concat(number$1(options.phase || 0), " d"));
  19188. },
  19189. undash: function undash() {
  19190. return this.addContent('[] 0 d');
  19191. },
  19192. moveTo: function moveTo(x, y) {
  19193. return this.addContent("".concat(number$1(x), " ").concat(number$1(y), " m"));
  19194. },
  19195. lineTo: function lineTo(x, y) {
  19196. return this.addContent("".concat(number$1(x), " ").concat(number$1(y), " l"));
  19197. },
  19198. bezierCurveTo: function bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y) {
  19199. return this.addContent("".concat(number$1(cp1x), " ").concat(number$1(cp1y), " ").concat(number$1(cp2x), " ").concat(number$1(cp2y), " ").concat(number$1(x), " ").concat(number$1(y), " c"));
  19200. },
  19201. quadraticCurveTo: function quadraticCurveTo(cpx, cpy, x, y) {
  19202. return this.addContent("".concat(number$1(cpx), " ").concat(number$1(cpy), " ").concat(number$1(x), " ").concat(number$1(y), " v"));
  19203. },
  19204. rect: function rect(x, y, w, h) {
  19205. return this.addContent("".concat(number$1(x), " ").concat(number$1(y), " ").concat(number$1(w), " ").concat(number$1(h), " re"));
  19206. },
  19207. roundedRect: function roundedRect(x, y, w, h, r) {
  19208. if (r == null) {
  19209. r = 0;
  19210. }
  19211. r = Math.min(r, 0.5 * w, 0.5 * h); // amount to inset control points from corners (see `ellipse`)
  19212. var c = r * (1.0 - KAPPA);
  19213. this.moveTo(x + r, y);
  19214. this.lineTo(x + w - r, y);
  19215. this.bezierCurveTo(x + w - c, y, x + w, y + c, x + w, y + r);
  19216. this.lineTo(x + w, y + h - r);
  19217. this.bezierCurveTo(x + w, y + h - c, x + w - c, y + h, x + w - r, y + h);
  19218. this.lineTo(x + r, y + h);
  19219. this.bezierCurveTo(x + c, y + h, x, y + h - c, x, y + h - r);
  19220. this.lineTo(x, y + r);
  19221. this.bezierCurveTo(x, y + c, x + c, y, x + r, y);
  19222. return this.closePath();
  19223. },
  19224. ellipse: function ellipse(x, y, r1, r2) {
  19225. // based on http://stackoverflow.com/questions/2172798/how-to-draw-an-oval-in-html5-canvas/2173084#2173084
  19226. if (r2 == null) {
  19227. r2 = r1;
  19228. }
  19229. x -= r1;
  19230. y -= r2;
  19231. var ox = r1 * KAPPA;
  19232. var oy = r2 * KAPPA;
  19233. var xe = x + r1 * 2;
  19234. var ye = y + r2 * 2;
  19235. var xm = x + r1;
  19236. var ym = y + r2;
  19237. this.moveTo(x, ym);
  19238. this.bezierCurveTo(x, ym - oy, xm - ox, y, xm, y);
  19239. this.bezierCurveTo(xm + ox, y, xe, ym - oy, xe, ym);
  19240. this.bezierCurveTo(xe, ym + oy, xm + ox, ye, xm, ye);
  19241. this.bezierCurveTo(xm - ox, ye, x, ym + oy, x, ym);
  19242. return this.closePath();
  19243. },
  19244. circle: function circle(x, y, radius) {
  19245. return this.ellipse(x, y, radius);
  19246. },
  19247. arc: function arc(x, y, radius, startAngle, endAngle, anticlockwise) {
  19248. if (anticlockwise == null) {
  19249. anticlockwise = false;
  19250. }
  19251. var TWO_PI = 2.0 * Math.PI;
  19252. var HALF_PI = 0.5 * Math.PI;
  19253. var deltaAng = endAngle - startAngle;
  19254. if (Math.abs(deltaAng) > TWO_PI) {
  19255. // draw only full circle if more than that is specified
  19256. deltaAng = TWO_PI;
  19257. } else if (deltaAng !== 0 && anticlockwise !== deltaAng < 0) {
  19258. // necessary to flip direction of rendering
  19259. var dir = anticlockwise ? -1 : 1;
  19260. deltaAng = dir * TWO_PI + deltaAng;
  19261. }
  19262. var numSegs = Math.ceil(Math.abs(deltaAng) / HALF_PI);
  19263. var segAng = deltaAng / numSegs;
  19264. var handleLen = segAng / HALF_PI * KAPPA * radius;
  19265. var curAng = startAngle; // component distances between anchor point and control point
  19266. var deltaCx = -Math.sin(curAng) * handleLen;
  19267. var deltaCy = Math.cos(curAng) * handleLen; // anchor point
  19268. var ax = x + Math.cos(curAng) * radius;
  19269. var ay = y + Math.sin(curAng) * radius; // calculate and render segments
  19270. this.moveTo(ax, ay);
  19271. for (var segIdx = 0; segIdx < numSegs; segIdx++) {
  19272. // starting control point
  19273. var cp1x = ax + deltaCx;
  19274. var cp1y = ay + deltaCy; // step angle
  19275. curAng += segAng; // next anchor point
  19276. ax = x + Math.cos(curAng) * radius;
  19277. ay = y + Math.sin(curAng) * radius; // next control point delta
  19278. deltaCx = -Math.sin(curAng) * handleLen;
  19279. deltaCy = Math.cos(curAng) * handleLen; // ending control point
  19280. var cp2x = ax - deltaCx;
  19281. var cp2y = ay - deltaCy; // render segment
  19282. this.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, ax, ay);
  19283. }
  19284. return this;
  19285. },
  19286. polygon: function polygon() {
  19287. for (var _len = arguments.length, points = new Array(_len), _key = 0; _key < _len; _key++) {
  19288. points[_key] = arguments[_key];
  19289. }
  19290. this.moveTo.apply(this, _toConsumableArray(points.shift() || []));
  19291. for (var _i = 0, _points = points; _i < _points.length; _i++) {
  19292. var point = _points[_i];
  19293. this.lineTo.apply(this, _toConsumableArray(point || []));
  19294. }
  19295. return this.closePath();
  19296. },
  19297. path: function path(_path) {
  19298. SVGPath.apply(this, _path);
  19299. return this;
  19300. },
  19301. _windingRule: function _windingRule(rule) {
  19302. if (/even-?odd/.test(rule)) {
  19303. return '*';
  19304. }
  19305. return '';
  19306. },
  19307. fill: function fill(color, rule) {
  19308. if (/(even-?odd)|(non-?zero)/.test(color)) {
  19309. rule = color;
  19310. color = null;
  19311. }
  19312. if (color) {
  19313. this.fillColor(color);
  19314. }
  19315. return this.addContent("f".concat(this._windingRule(rule)));
  19316. },
  19317. stroke: function stroke(color) {
  19318. if (color) {
  19319. this.strokeColor(color);
  19320. }
  19321. return this.addContent('S');
  19322. },
  19323. fillAndStroke: function fillAndStroke(fillColor, strokeColor, rule) {
  19324. if (strokeColor == null) {
  19325. strokeColor = fillColor;
  19326. }
  19327. var isFillRule = /(even-?odd)|(non-?zero)/;
  19328. if (isFillRule.test(fillColor)) {
  19329. rule = fillColor;
  19330. fillColor = null;
  19331. }
  19332. if (isFillRule.test(strokeColor)) {
  19333. rule = strokeColor;
  19334. strokeColor = fillColor;
  19335. }
  19336. if (fillColor) {
  19337. this.fillColor(fillColor);
  19338. this.strokeColor(strokeColor);
  19339. }
  19340. return this.addContent("B".concat(this._windingRule(rule)));
  19341. },
  19342. clip: function clip(rule) {
  19343. return this.addContent("W".concat(this._windingRule(rule), " n"));
  19344. },
  19345. transform: function transform(m11, m12, m21, m22, dx, dy) {
  19346. // keep track of the current transformation matrix
  19347. var m = this._ctm;
  19348. var _m = _slicedToArray(m, 6),
  19349. m0 = _m[0],
  19350. m1 = _m[1],
  19351. m2 = _m[2],
  19352. m3 = _m[3],
  19353. m4 = _m[4],
  19354. m5 = _m[5];
  19355. m[0] = m0 * m11 + m2 * m12;
  19356. m[1] = m1 * m11 + m3 * m12;
  19357. m[2] = m0 * m21 + m2 * m22;
  19358. m[3] = m1 * m21 + m3 * m22;
  19359. m[4] = m0 * dx + m2 * dy + m4;
  19360. m[5] = m1 * dx + m3 * dy + m5;
  19361. var values = [m11, m12, m21, m22, dx, dy].map(function (v) {
  19362. return number$1(v);
  19363. }).join(' ');
  19364. return this.addContent("".concat(values, " cm"));
  19365. },
  19366. translate: function translate(x, y) {
  19367. return this.transform(1, 0, 0, 1, x, y);
  19368. },
  19369. rotate: function rotate(angle) {
  19370. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  19371. var y;
  19372. var rad = angle * Math.PI / 180;
  19373. var cos = Math.cos(rad);
  19374. var sin = Math.sin(rad);
  19375. var x = y = 0;
  19376. if (options.origin != null) {
  19377. var _options$origin = _slicedToArray(options.origin, 2);
  19378. x = _options$origin[0];
  19379. y = _options$origin[1];
  19380. var x1 = x * cos - y * sin;
  19381. var y1 = x * sin + y * cos;
  19382. x -= x1;
  19383. y -= y1;
  19384. }
  19385. return this.transform(cos, sin, -sin, cos, x, y);
  19386. },
  19387. scale: function scale(xFactor, yFactor) {
  19388. var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  19389. var y;
  19390. if (yFactor == null) {
  19391. yFactor = xFactor;
  19392. }
  19393. if (typeof yFactor === 'object') {
  19394. options = yFactor;
  19395. yFactor = xFactor;
  19396. }
  19397. var x = y = 0;
  19398. if (options.origin != null) {
  19399. var _options$origin2 = _slicedToArray(options.origin, 2);
  19400. x = _options$origin2[0];
  19401. y = _options$origin2[1];
  19402. x -= xFactor * x;
  19403. y -= yFactor * y;
  19404. }
  19405. return this.transform(xFactor, 0, 0, yFactor, x, y);
  19406. }
  19407. };
  19408. var WIN_ANSI_MAP = {
  19409. 402: 131,
  19410. 8211: 150,
  19411. 8212: 151,
  19412. 8216: 145,
  19413. 8217: 146,
  19414. 8218: 130,
  19415. 8220: 147,
  19416. 8221: 148,
  19417. 8222: 132,
  19418. 8224: 134,
  19419. 8225: 135,
  19420. 8226: 149,
  19421. 8230: 133,
  19422. 8364: 128,
  19423. 8240: 137,
  19424. 8249: 139,
  19425. 8250: 155,
  19426. 710: 136,
  19427. 8482: 153,
  19428. 338: 140,
  19429. 339: 156,
  19430. 732: 152,
  19431. 352: 138,
  19432. 353: 154,
  19433. 376: 159,
  19434. 381: 142,
  19435. 382: 158
  19436. };
  19437. var characters = ".notdef .notdef .notdef .notdef\n.notdef .notdef .notdef .notdef\n.notdef .notdef .notdef .notdef\n.notdef .notdef .notdef .notdef\n.notdef .notdef .notdef .notdef\n.notdef .notdef .notdef .notdef\n.notdef .notdef .notdef .notdef\n.notdef .notdef .notdef .notdef\n \nspace exclam quotedbl numbersign\ndollar percent ampersand quotesingle\nparenleft parenright asterisk plus\ncomma hyphen period slash\nzero one two three\nfour five six seven\neight nine colon semicolon\nless equal greater question\n \nat A B C\nD E F G\nH I J K\nL M N O\nP Q R S\nT U V W\nX Y Z bracketleft\nbackslash bracketright asciicircum underscore\n \ngrave a b c\nd e f g\nh i j k\nl m n o\np q r s\nt u v w\nx y z braceleft\nbar braceright asciitilde .notdef\n \nEuro .notdef quotesinglbase florin\nquotedblbase ellipsis dagger daggerdbl\ncircumflex perthousand Scaron guilsinglleft\nOE .notdef Zcaron .notdef\n.notdef quoteleft quoteright quotedblleft\nquotedblright bullet endash emdash\ntilde trademark scaron guilsinglright\noe .notdef zcaron ydieresis\n \nspace exclamdown cent sterling\ncurrency yen brokenbar section\ndieresis copyright ordfeminine guillemotleft\nlogicalnot hyphen registered macron\ndegree plusminus twosuperior threesuperior\nacute mu paragraph periodcentered\ncedilla onesuperior ordmasculine guillemotright\nonequarter onehalf threequarters questiondown\n \nAgrave Aacute Acircumflex Atilde\nAdieresis Aring AE Ccedilla\nEgrave Eacute Ecircumflex Edieresis\nIgrave Iacute Icircumflex Idieresis\nEth Ntilde Ograve Oacute\nOcircumflex Otilde Odieresis multiply\nOslash Ugrave Uacute Ucircumflex\nUdieresis Yacute Thorn germandbls\n \nagrave aacute acircumflex atilde\nadieresis aring ae ccedilla\negrave eacute ecircumflex edieresis\nigrave iacute icircumflex idieresis\neth ntilde ograve oacute\nocircumflex otilde odieresis divide\noslash ugrave uacute ucircumflex\nudieresis yacute thorn ydieresis".split(/\s+/);
  19438. var AFMFont = /*#__PURE__*/function () {
  19439. _createClass(AFMFont, null, [{
  19440. key: "open",
  19441. value: function open(filename) {
  19442. return new AFMFont(fs.readFileSync(filename, 'utf8'));
  19443. }
  19444. }]);
  19445. function AFMFont(contents) {
  19446. _classCallCheck(this, AFMFont);
  19447. this.contents = contents;
  19448. this.attributes = {};
  19449. this.glyphWidths = {};
  19450. this.boundingBoxes = {};
  19451. this.kernPairs = {};
  19452. this.parse(); // todo: remove charWidths since appears to not be used
  19453. this.charWidths = new Array(256);
  19454. for (var char = 0; char <= 255; char++) {
  19455. this.charWidths[char] = this.glyphWidths[characters[char]];
  19456. }
  19457. this.bbox = this.attributes['FontBBox'].split(/\s+/).map(function (e) {
  19458. return +e;
  19459. });
  19460. this.ascender = +(this.attributes['Ascender'] || 0);
  19461. this.descender = +(this.attributes['Descender'] || 0);
  19462. this.xHeight = +(this.attributes['XHeight'] || 0);
  19463. this.capHeight = +(this.attributes['CapHeight'] || 0);
  19464. this.lineGap = this.bbox[3] - this.bbox[1] - (this.ascender - this.descender);
  19465. }
  19466. _createClass(AFMFont, [{
  19467. key: "parse",
  19468. value: function parse() {
  19469. var section = '';
  19470. var _iteratorNormalCompletion = true;
  19471. var _didIteratorError = false;
  19472. var _iteratorError = undefined;
  19473. try {
  19474. for (var _iterator = this.contents.split('\n')[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
  19475. var line = _step.value;
  19476. var match;
  19477. var a;
  19478. if (match = line.match(/^Start(\w+)/)) {
  19479. section = match[1];
  19480. continue;
  19481. } else if (match = line.match(/^End(\w+)/)) {
  19482. section = '';
  19483. continue;
  19484. }
  19485. switch (section) {
  19486. case 'FontMetrics':
  19487. match = line.match(/(^\w+)\s+(.*)/);
  19488. var key = match[1];
  19489. var value = match[2];
  19490. if (a = this.attributes[key]) {
  19491. if (!Array.isArray(a)) {
  19492. a = this.attributes[key] = [a];
  19493. }
  19494. a.push(value);
  19495. } else {
  19496. this.attributes[key] = value;
  19497. }
  19498. break;
  19499. case 'CharMetrics':
  19500. if (!/^CH?\s/.test(line)) {
  19501. continue;
  19502. }
  19503. var name = line.match(/\bN\s+(\.?\w+)\s*;/)[1];
  19504. this.glyphWidths[name] = +line.match(/\bWX\s+(\d+)\s*;/)[1];
  19505. break;
  19506. case 'KernPairs':
  19507. match = line.match(/^KPX\s+(\.?\w+)\s+(\.?\w+)\s+(-?\d+)/);
  19508. if (match) {
  19509. this.kernPairs[match[1] + '\0' + match[2]] = parseInt(match[3]);
  19510. }
  19511. break;
  19512. }
  19513. }
  19514. } catch (err) {
  19515. _didIteratorError = true;
  19516. _iteratorError = err;
  19517. } finally {
  19518. try {
  19519. if (!_iteratorNormalCompletion && _iterator.return != null) {
  19520. _iterator.return();
  19521. }
  19522. } finally {
  19523. if (_didIteratorError) {
  19524. throw _iteratorError;
  19525. }
  19526. }
  19527. }
  19528. }
  19529. }, {
  19530. key: "encodeText",
  19531. value: function encodeText(text) {
  19532. var res = [];
  19533. for (var i = 0, len = text.length; i < len; i++) {
  19534. var char = text.charCodeAt(i);
  19535. char = WIN_ANSI_MAP[char] || char;
  19536. res.push(char.toString(16));
  19537. }
  19538. return res;
  19539. }
  19540. }, {
  19541. key: "glyphsForString",
  19542. value: function glyphsForString(string) {
  19543. var glyphs = [];
  19544. for (var i = 0, len = string.length; i < len; i++) {
  19545. var charCode = string.charCodeAt(i);
  19546. glyphs.push(this.characterToGlyph(charCode));
  19547. }
  19548. return glyphs;
  19549. }
  19550. }, {
  19551. key: "characterToGlyph",
  19552. value: function characterToGlyph(character) {
  19553. return characters[WIN_ANSI_MAP[character] || character] || '.notdef';
  19554. }
  19555. }, {
  19556. key: "widthOfGlyph",
  19557. value: function widthOfGlyph(glyph) {
  19558. return this.glyphWidths[glyph] || 0;
  19559. }
  19560. }, {
  19561. key: "getKernPair",
  19562. value: function getKernPair(left, right) {
  19563. return this.kernPairs[left + '\0' + right] || 0;
  19564. }
  19565. }, {
  19566. key: "advancesForGlyphs",
  19567. value: function advancesForGlyphs(glyphs) {
  19568. var advances = [];
  19569. for (var index = 0; index < glyphs.length; index++) {
  19570. var left = glyphs[index];
  19571. var right = glyphs[index + 1];
  19572. advances.push(this.widthOfGlyph(left) + this.getKernPair(left, right));
  19573. }
  19574. return advances;
  19575. }
  19576. }]);
  19577. return AFMFont;
  19578. }();
  19579. var PDFFont = /*#__PURE__*/function () {
  19580. function PDFFont() {
  19581. _classCallCheck(this, PDFFont);
  19582. }
  19583. _createClass(PDFFont, [{
  19584. key: "encode",
  19585. value: function encode() {
  19586. throw new Error('Must be implemented by subclasses');
  19587. }
  19588. }, {
  19589. key: "widthOfString",
  19590. value: function widthOfString() {
  19591. throw new Error('Must be implemented by subclasses');
  19592. }
  19593. }, {
  19594. key: "ref",
  19595. value: function ref() {
  19596. return this.dictionary != null ? this.dictionary : this.dictionary = this.document.ref();
  19597. }
  19598. }, {
  19599. key: "finalize",
  19600. value: function finalize() {
  19601. if (this.embedded || this.dictionary == null) {
  19602. return;
  19603. }
  19604. this.embed();
  19605. return this.embedded = true;
  19606. }
  19607. }, {
  19608. key: "embed",
  19609. value: function embed() {
  19610. throw new Error('Must be implemented by subclasses');
  19611. }
  19612. }, {
  19613. key: "lineHeight",
  19614. value: function lineHeight(size, includeGap) {
  19615. if (includeGap == null) {
  19616. includeGap = false;
  19617. }
  19618. var gap = includeGap ? this.lineGap : 0;
  19619. return (this.ascender + gap - this.descender) / 1000 * size;
  19620. }
  19621. }]);
  19622. return PDFFont;
  19623. }();
  19624. var STANDARD_FONTS = {
  19625. Courier: function Courier() {
  19626. return fs.readFileSync(__dirname + '/data/Courier.afm', 'utf8');
  19627. },
  19628. 'Courier-Bold': function CourierBold() {
  19629. return fs.readFileSync(__dirname + '/data/Courier-Bold.afm', 'utf8');
  19630. },
  19631. 'Courier-Oblique': function CourierOblique() {
  19632. return fs.readFileSync(__dirname + '/data/Courier-Oblique.afm', 'utf8');
  19633. },
  19634. 'Courier-BoldOblique': function CourierBoldOblique() {
  19635. return fs.readFileSync(__dirname + '/data/Courier-BoldOblique.afm', 'utf8');
  19636. },
  19637. Helvetica: function Helvetica() {
  19638. return fs.readFileSync(__dirname + '/data/Helvetica.afm', 'utf8');
  19639. },
  19640. 'Helvetica-Bold': function HelveticaBold() {
  19641. return fs.readFileSync(__dirname + '/data/Helvetica-Bold.afm', 'utf8');
  19642. },
  19643. 'Helvetica-Oblique': function HelveticaOblique() {
  19644. return fs.readFileSync(__dirname + '/data/Helvetica-Oblique.afm', 'utf8');
  19645. },
  19646. 'Helvetica-BoldOblique': function HelveticaBoldOblique() {
  19647. return fs.readFileSync(__dirname + '/data/Helvetica-BoldOblique.afm', 'utf8');
  19648. },
  19649. 'Times-Roman': function TimesRoman() {
  19650. return fs.readFileSync(__dirname + '/data/Times-Roman.afm', 'utf8');
  19651. },
  19652. 'Times-Bold': function TimesBold() {
  19653. return fs.readFileSync(__dirname + '/data/Times-Bold.afm', 'utf8');
  19654. },
  19655. 'Times-Italic': function TimesItalic() {
  19656. return fs.readFileSync(__dirname + '/data/Times-Italic.afm', 'utf8');
  19657. },
  19658. 'Times-BoldItalic': function TimesBoldItalic() {
  19659. return fs.readFileSync(__dirname + '/data/Times-BoldItalic.afm', 'utf8');
  19660. },
  19661. Symbol: function Symbol() {
  19662. return fs.readFileSync(__dirname + '/data/Symbol.afm', 'utf8');
  19663. },
  19664. ZapfDingbats: function ZapfDingbats() {
  19665. return fs.readFileSync(__dirname + '/data/ZapfDingbats.afm', 'utf8');
  19666. }
  19667. };
  19668. var StandardFont = /*#__PURE__*/function (_PDFFont) {
  19669. _inherits(StandardFont, _PDFFont);
  19670. function StandardFont(document, name, id) {
  19671. var _this;
  19672. _classCallCheck(this, StandardFont);
  19673. _this = _possibleConstructorReturn(this, _getPrototypeOf(StandardFont).call(this));
  19674. _this.document = document;
  19675. _this.name = name;
  19676. _this.id = id;
  19677. _this.font = new AFMFont(STANDARD_FONTS[_this.name]());
  19678. var _this$font = _this.font;
  19679. _this.ascender = _this$font.ascender;
  19680. _this.descender = _this$font.descender;
  19681. _this.bbox = _this$font.bbox;
  19682. _this.lineGap = _this$font.lineGap;
  19683. _this.xHeight = _this$font.xHeight;
  19684. _this.capHeight = _this$font.capHeight;
  19685. return _this;
  19686. }
  19687. _createClass(StandardFont, [{
  19688. key: "embed",
  19689. value: function embed() {
  19690. this.dictionary.data = {
  19691. Type: 'Font',
  19692. BaseFont: this.name,
  19693. Subtype: 'Type1',
  19694. Encoding: 'WinAnsiEncoding'
  19695. };
  19696. return this.dictionary.end();
  19697. }
  19698. }, {
  19699. key: "encode",
  19700. value: function encode(text) {
  19701. var encoded = this.font.encodeText(text);
  19702. var glyphs = this.font.glyphsForString("".concat(text));
  19703. var advances = this.font.advancesForGlyphs(glyphs);
  19704. var positions = [];
  19705. for (var i = 0; i < glyphs.length; i++) {
  19706. var glyph = glyphs[i];
  19707. positions.push({
  19708. xAdvance: advances[i],
  19709. yAdvance: 0,
  19710. xOffset: 0,
  19711. yOffset: 0,
  19712. advanceWidth: this.font.widthOfGlyph(glyph)
  19713. });
  19714. }
  19715. return [encoded, positions];
  19716. }
  19717. }, {
  19718. key: "widthOfString",
  19719. value: function widthOfString(string, size) {
  19720. var glyphs = this.font.glyphsForString("".concat(string));
  19721. var advances = this.font.advancesForGlyphs(glyphs);
  19722. var width = 0;
  19723. var _iteratorNormalCompletion = true;
  19724. var _didIteratorError = false;
  19725. var _iteratorError = undefined;
  19726. try {
  19727. for (var _iterator = advances[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
  19728. var advance = _step.value;
  19729. width += advance;
  19730. }
  19731. } catch (err) {
  19732. _didIteratorError = true;
  19733. _iteratorError = err;
  19734. } finally {
  19735. try {
  19736. if (!_iteratorNormalCompletion && _iterator.return != null) {
  19737. _iterator.return();
  19738. }
  19739. } finally {
  19740. if (_didIteratorError) {
  19741. throw _iteratorError;
  19742. }
  19743. }
  19744. }
  19745. var scale = size / 1000;
  19746. return width * scale;
  19747. }
  19748. }], [{
  19749. key: "isStandardFont",
  19750. value: function isStandardFont(name) {
  19751. return name in STANDARD_FONTS;
  19752. }
  19753. }]);
  19754. return StandardFont;
  19755. }(PDFFont);
  19756. var toHex = function toHex(num) {
  19757. return "0000".concat(num.toString(16)).slice(-4);
  19758. };
  19759. var EmbeddedFont = /*#__PURE__*/function (_PDFFont) {
  19760. _inherits(EmbeddedFont, _PDFFont);
  19761. function EmbeddedFont(document, font, id) {
  19762. var _this;
  19763. _classCallCheck(this, EmbeddedFont);
  19764. _this = _possibleConstructorReturn(this, _getPrototypeOf(EmbeddedFont).call(this));
  19765. _this.document = document;
  19766. _this.font = font;
  19767. _this.id = id;
  19768. _this.subset = _this.font.createSubset();
  19769. _this.unicode = [[0]];
  19770. _this.widths = [_this.font.getGlyph(0).advanceWidth];
  19771. _this.name = _this.font.postscriptName;
  19772. _this.scale = 1000 / _this.font.unitsPerEm;
  19773. _this.ascender = _this.font.ascent * _this.scale;
  19774. _this.descender = _this.font.descent * _this.scale;
  19775. _this.xHeight = _this.font.xHeight * _this.scale;
  19776. _this.capHeight = _this.font.capHeight * _this.scale;
  19777. _this.lineGap = _this.font.lineGap * _this.scale;
  19778. _this.bbox = _this.font.bbox;
  19779. if (document.options.fontLayoutCache !== false) {
  19780. _this.layoutCache = Object.create(null);
  19781. }
  19782. return _this;
  19783. }
  19784. _createClass(EmbeddedFont, [{
  19785. key: "layoutRun",
  19786. value: function layoutRun(text, features) {
  19787. var run = this.font.layout(text, features); // Normalize position values
  19788. for (var i = 0; i < run.positions.length; i++) {
  19789. var position = run.positions[i];
  19790. for (var key in position) {
  19791. position[key] *= this.scale;
  19792. }
  19793. position.advanceWidth = run.glyphs[i].advanceWidth * this.scale;
  19794. }
  19795. return run;
  19796. }
  19797. }, {
  19798. key: "layoutCached",
  19799. value: function layoutCached(text) {
  19800. if (!this.layoutCache) {
  19801. return this.layoutRun(text);
  19802. }
  19803. var cached;
  19804. if (cached = this.layoutCache[text]) {
  19805. return cached;
  19806. }
  19807. var run = this.layoutRun(text);
  19808. this.layoutCache[text] = run;
  19809. return run;
  19810. }
  19811. }, {
  19812. key: "layout",
  19813. value: function layout(text, features, onlyWidth) {
  19814. // Skip the cache if any user defined features are applied
  19815. if (features) {
  19816. return this.layoutRun(text, features);
  19817. }
  19818. var glyphs = onlyWidth ? null : [];
  19819. var positions = onlyWidth ? null : [];
  19820. var advanceWidth = 0; // Split the string by words to increase cache efficiency.
  19821. // For this purpose, spaces and tabs are a good enough delimeter.
  19822. var last = 0;
  19823. var index = 0;
  19824. while (index <= text.length) {
  19825. var needle;
  19826. if (index === text.length && last < index || (needle = text.charAt(index), [' ', '\t'].includes(needle))) {
  19827. var run = this.layoutCached(text.slice(last, ++index));
  19828. if (!onlyWidth) {
  19829. glyphs = glyphs.concat(run.glyphs);
  19830. positions = positions.concat(run.positions);
  19831. }
  19832. advanceWidth += run.advanceWidth;
  19833. last = index;
  19834. } else {
  19835. index++;
  19836. }
  19837. }
  19838. return {
  19839. glyphs: glyphs,
  19840. positions: positions,
  19841. advanceWidth: advanceWidth
  19842. };
  19843. }
  19844. }, {
  19845. key: "encode",
  19846. value: function encode(text, features) {
  19847. var _this$layout = this.layout(text, features),
  19848. glyphs = _this$layout.glyphs,
  19849. positions = _this$layout.positions;
  19850. var res = [];
  19851. for (var i = 0; i < glyphs.length; i++) {
  19852. var glyph = glyphs[i];
  19853. var gid = this.subset.includeGlyph(glyph.id);
  19854. res.push("0000".concat(gid.toString(16)).slice(-4));
  19855. if (this.widths[gid] == null) {
  19856. this.widths[gid] = glyph.advanceWidth * this.scale;
  19857. }
  19858. if (this.unicode[gid] == null) {
  19859. this.unicode[gid] = glyph.codePoints;
  19860. }
  19861. }
  19862. return [res, positions];
  19863. }
  19864. }, {
  19865. key: "widthOfString",
  19866. value: function widthOfString(string, size, features) {
  19867. var width = this.layout(string, features, true).advanceWidth;
  19868. var scale = size / 1000;
  19869. return width * scale;
  19870. }
  19871. }, {
  19872. key: "embed",
  19873. value: function embed() {
  19874. var _this2 = this;
  19875. var isCFF = this.subset.cff != null;
  19876. var fontFile = this.document.ref();
  19877. if (isCFF) {
  19878. fontFile.data.Subtype = 'CIDFontType0C';
  19879. }
  19880. this.subset.encodeStream().on('data', function (data) {
  19881. return fontFile.write(data);
  19882. }).on('end', function () {
  19883. return fontFile.end();
  19884. });
  19885. var familyClass = ((this.font['OS/2'] != null ? this.font['OS/2'].sFamilyClass : undefined) || 0) >> 8;
  19886. var flags = 0;
  19887. if (this.font.post.isFixedPitch) {
  19888. flags |= 1 << 0;
  19889. }
  19890. if (1 <= familyClass && familyClass <= 7) {
  19891. flags |= 1 << 1;
  19892. }
  19893. flags |= 1 << 2; // assume the font uses non-latin characters
  19894. if (familyClass === 10) {
  19895. flags |= 1 << 3;
  19896. }
  19897. if (this.font.head.macStyle.italic) {
  19898. flags |= 1 << 6;
  19899. } // generate a tag (6 uppercase letters. 16 is the char code offset from '1' to 'A'. 74 will map to 'Z')
  19900. var tag = [1, 2, 3, 4, 5, 6].map(function (i) {
  19901. return String.fromCharCode((_this2.id.charCodeAt(i) || 74) + 16);
  19902. }).join('');
  19903. var name = tag + '+' + this.font.postscriptName;
  19904. var bbox = this.font.bbox;
  19905. var descriptor = this.document.ref({
  19906. Type: 'FontDescriptor',
  19907. FontName: name,
  19908. Flags: flags,
  19909. FontBBox: [bbox.minX * this.scale, bbox.minY * this.scale, bbox.maxX * this.scale, bbox.maxY * this.scale],
  19910. ItalicAngle: this.font.italicAngle,
  19911. Ascent: this.ascender,
  19912. Descent: this.descender,
  19913. CapHeight: (this.font.capHeight || this.font.ascent) * this.scale,
  19914. XHeight: (this.font.xHeight || 0) * this.scale,
  19915. StemV: 0
  19916. }); // not sure how to calculate this
  19917. if (isCFF) {
  19918. descriptor.data.FontFile3 = fontFile;
  19919. } else {
  19920. descriptor.data.FontFile2 = fontFile;
  19921. }
  19922. descriptor.end();
  19923. var descendantFontData = {
  19924. Type: 'Font',
  19925. Subtype: 'CIDFontType0',
  19926. BaseFont: name,
  19927. CIDSystemInfo: {
  19928. Registry: new String('Adobe'),
  19929. Ordering: new String('Identity'),
  19930. Supplement: 0
  19931. },
  19932. FontDescriptor: descriptor,
  19933. W: [0, this.widths]
  19934. };
  19935. if (!isCFF) {
  19936. descendantFontData.Subtype = 'CIDFontType2';
  19937. descendantFontData.CIDToGIDMap = 'Identity';
  19938. }
  19939. var descendantFont = this.document.ref(descendantFontData);
  19940. descendantFont.end();
  19941. this.dictionary.data = {
  19942. Type: 'Font',
  19943. Subtype: 'Type0',
  19944. BaseFont: name,
  19945. Encoding: 'Identity-H',
  19946. DescendantFonts: [descendantFont],
  19947. ToUnicode: this.toUnicodeCmap()
  19948. };
  19949. return this.dictionary.end();
  19950. } // Maps the glyph ids encoded in the PDF back to unicode strings
  19951. // Because of ligature substitutions and the like, there may be one or more
  19952. // unicode characters represented by each glyph.
  19953. }, {
  19954. key: "toUnicodeCmap",
  19955. value: function toUnicodeCmap() {
  19956. var cmap = this.document.ref();
  19957. var entries = [];
  19958. var _iteratorNormalCompletion = true;
  19959. var _didIteratorError = false;
  19960. var _iteratorError = undefined;
  19961. try {
  19962. for (var _iterator = this.unicode[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
  19963. var codePoints = _step.value;
  19964. var encoded = []; // encode codePoints to utf16
  19965. var _iteratorNormalCompletion2 = true;
  19966. var _didIteratorError2 = false;
  19967. var _iteratorError2 = undefined;
  19968. try {
  19969. for (var _iterator2 = codePoints[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
  19970. var value = _step2.value;
  19971. if (value > 0xffff) {
  19972. value -= 0x10000;
  19973. encoded.push(toHex(value >>> 10 & 0x3ff | 0xd800));
  19974. value = 0xdc00 | value & 0x3ff;
  19975. }
  19976. encoded.push(toHex(value));
  19977. }
  19978. } catch (err) {
  19979. _didIteratorError2 = true;
  19980. _iteratorError2 = err;
  19981. } finally {
  19982. try {
  19983. if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
  19984. _iterator2.return();
  19985. }
  19986. } finally {
  19987. if (_didIteratorError2) {
  19988. throw _iteratorError2;
  19989. }
  19990. }
  19991. }
  19992. entries.push("<".concat(encoded.join(' '), ">"));
  19993. }
  19994. } catch (err) {
  19995. _didIteratorError = true;
  19996. _iteratorError = err;
  19997. } finally {
  19998. try {
  19999. if (!_iteratorNormalCompletion && _iterator.return != null) {
  20000. _iterator.return();
  20001. }
  20002. } finally {
  20003. if (_didIteratorError) {
  20004. throw _iteratorError;
  20005. }
  20006. }
  20007. }
  20008. cmap.end("/CIDInit /ProcSet findresource begin\n12 dict begin\nbegincmap\n/CIDSystemInfo <<\n /Registry (Adobe)\n /Ordering (UCS)\n /Supplement 0\n>> def\n/CMapName /Adobe-Identity-UCS def\n/CMapType 2 def\n1 begincodespacerange\n<0000><ffff>\nendcodespacerange\n1 beginbfrange\n<0000> <".concat(toHex(entries.length - 1), "> [").concat(entries.join(' '), "]\nendbfrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend"));
  20009. return cmap;
  20010. }
  20011. }]);
  20012. return EmbeddedFont;
  20013. }(PDFFont);
  20014. var PDFFontFactory = /*#__PURE__*/function () {
  20015. function PDFFontFactory() {
  20016. _classCallCheck(this, PDFFontFactory);
  20017. }
  20018. _createClass(PDFFontFactory, null, [{
  20019. key: "open",
  20020. value: function open(document, src, family, id) {
  20021. var font;
  20022. if (typeof src === 'string') {
  20023. if (StandardFont.isStandardFont(src)) {
  20024. return new StandardFont(document, src, id);
  20025. }
  20026. src = fs.readFileSync(src);
  20027. }
  20028. if (Buffer.isBuffer(src)) {
  20029. font = _fontkit.default.create(src, family);
  20030. } else if (src instanceof Uint8Array) {
  20031. font = _fontkit.default.create(new Buffer(src), family);
  20032. } else if (src instanceof ArrayBuffer) {
  20033. font = _fontkit.default.create(new Buffer(new Uint8Array(src)), family);
  20034. }
  20035. if (font == null) {
  20036. throw new Error('Not a supported font format or standard PDF font.');
  20037. }
  20038. return new EmbeddedFont(document, font, id);
  20039. }
  20040. }]);
  20041. return PDFFontFactory;
  20042. }();
  20043. var FontsMixin = {
  20044. initFonts: function initFonts() {
  20045. var defaultFont = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'Helvetica'; // Lookup table for embedded fonts
  20046. this._fontFamilies = {};
  20047. this._fontCount = 0; // Font state
  20048. this._fontSize = 12;
  20049. this._font = null;
  20050. this._registeredFonts = {}; // Set the default font
  20051. if (defaultFont) {
  20052. this.font(defaultFont);
  20053. }
  20054. },
  20055. font: function font(src, family, size) {
  20056. var cacheKey, font;
  20057. if (typeof family === 'number') {
  20058. size = family;
  20059. family = null;
  20060. } // check registered fonts if src is a string
  20061. if (typeof src === 'string' && this._registeredFonts[src]) {
  20062. cacheKey = src;
  20063. var _this$_registeredFont = this._registeredFonts[src];
  20064. src = _this$_registeredFont.src;
  20065. family = _this$_registeredFont.family;
  20066. } else {
  20067. cacheKey = family || src;
  20068. if (typeof cacheKey !== 'string') {
  20069. cacheKey = null;
  20070. }
  20071. }
  20072. if (size != null) {
  20073. this.fontSize(size);
  20074. } // fast path: check if the font is already in the PDF
  20075. if (font = this._fontFamilies[cacheKey]) {
  20076. this._font = font;
  20077. return this;
  20078. } // load the font
  20079. var id = "F".concat(++this._fontCount);
  20080. this._font = PDFFontFactory.open(this, src, family, id); // check for existing font familes with the same name already in the PDF
  20081. // useful if the font was passed as a buffer
  20082. if (font = this._fontFamilies[this._font.name]) {
  20083. this._font = font;
  20084. return this;
  20085. } // save the font for reuse later
  20086. if (cacheKey) {
  20087. this._fontFamilies[cacheKey] = this._font;
  20088. }
  20089. if (this._font.name) {
  20090. this._fontFamilies[this._font.name] = this._font;
  20091. }
  20092. return this;
  20093. },
  20094. fontSize: function fontSize(_fontSize) {
  20095. this._fontSize = _fontSize;
  20096. return this;
  20097. },
  20098. currentLineHeight: function currentLineHeight(includeGap) {
  20099. if (includeGap == null) {
  20100. includeGap = false;
  20101. }
  20102. return this._font.lineHeight(this._fontSize, includeGap);
  20103. },
  20104. registerFont: function registerFont(name, src, family) {
  20105. this._registeredFonts[name] = {
  20106. src: src,
  20107. family: family
  20108. };
  20109. return this;
  20110. }
  20111. };
  20112. var LineWrapper = /*#__PURE__*/function (_EventEmitter) {
  20113. _inherits(LineWrapper, _EventEmitter);
  20114. function LineWrapper(document, options) {
  20115. var _this;
  20116. _classCallCheck(this, LineWrapper);
  20117. _this = _possibleConstructorReturn(this, _getPrototypeOf(LineWrapper).call(this));
  20118. _this.document = document;
  20119. _this.indent = options.indent || 0;
  20120. _this.characterSpacing = options.characterSpacing || 0;
  20121. _this.wordSpacing = options.wordSpacing === 0;
  20122. _this.columns = options.columns || 1;
  20123. _this.columnGap = options.columnGap != null ? options.columnGap : 18; // 1/4 inch
  20124. _this.lineWidth = (options.width - _this.columnGap * (_this.columns - 1)) / _this.columns;
  20125. _this.spaceLeft = _this.lineWidth;
  20126. _this.startX = _this.document.x;
  20127. _this.startY = _this.document.y;
  20128. _this.column = 1;
  20129. _this.ellipsis = options.ellipsis;
  20130. _this.continuedX = 0;
  20131. _this.features = options.features; // calculate the maximum Y position the text can appear at
  20132. if (options.height != null) {
  20133. _this.height = options.height;
  20134. _this.maxY = _this.startY + options.height;
  20135. } else {
  20136. _this.maxY = _this.document.page.maxY();
  20137. } // handle paragraph indents
  20138. _this.on('firstLine', function (options) {
  20139. // if this is the first line of the text segment, and
  20140. // we're continuing where we left off, indent that much
  20141. // otherwise use the user specified indent option
  20142. var indent = _this.continuedX || _this.indent;
  20143. _this.document.x += indent;
  20144. _this.lineWidth -= indent;
  20145. return _this.once('line', function () {
  20146. _this.document.x -= indent;
  20147. _this.lineWidth += indent;
  20148. if (options.continued && !_this.continuedX) {
  20149. _this.continuedX = _this.indent;
  20150. }
  20151. if (!options.continued) {
  20152. return _this.continuedX = 0;
  20153. }
  20154. });
  20155. }); // handle left aligning last lines of paragraphs
  20156. _this.on('lastLine', function (options) {
  20157. var align = options.align;
  20158. if (align === 'justify') {
  20159. options.align = 'left';
  20160. }
  20161. _this.lastLine = true;
  20162. return _this.once('line', function () {
  20163. _this.document.y += options.paragraphGap || 0;
  20164. options.align = align;
  20165. return _this.lastLine = false;
  20166. });
  20167. });
  20168. return _this;
  20169. }
  20170. _createClass(LineWrapper, [{
  20171. key: "wordWidth",
  20172. value: function wordWidth(word) {
  20173. return this.document.widthOfString(word, this) + this.characterSpacing + this.wordSpacing;
  20174. }
  20175. }, {
  20176. key: "eachWord",
  20177. value: function eachWord(text, fn) {
  20178. // setup a unicode line breaker
  20179. var bk;
  20180. var breaker = new _linebreak.default(text);
  20181. var last = null;
  20182. var wordWidths = Object.create(null);
  20183. while (bk = breaker.nextBreak()) {
  20184. var shouldContinue;
  20185. var word = text.slice((last != null ? last.position : undefined) || 0, bk.position);
  20186. var w = wordWidths[word] != null ? wordWidths[word] : wordWidths[word] = this.wordWidth(word); // if the word is longer than the whole line, chop it up
  20187. // TODO: break by grapheme clusters, not JS string characters
  20188. if (w > this.lineWidth + this.continuedX) {
  20189. // make some fake break objects
  20190. var lbk = last;
  20191. var fbk = {};
  20192. while (word.length) {
  20193. // fit as much of the word as possible into the space we have
  20194. var l, mightGrow;
  20195. if (w > this.spaceLeft) {
  20196. // start our check at the end of our available space - this method is faster than a loop of each character and it resolves
  20197. // an issue with long loops when processing massive words, such as a huge number of spaces
  20198. l = Math.ceil(this.spaceLeft / (w / word.length));
  20199. w = this.wordWidth(word.slice(0, l));
  20200. mightGrow = w <= this.spaceLeft && l < word.length;
  20201. } else {
  20202. l = word.length;
  20203. }
  20204. var mustShrink = w > this.spaceLeft && l > 0; // shrink or grow word as necessary after our near-guess above
  20205. while (mustShrink || mightGrow) {
  20206. if (mustShrink) {
  20207. w = this.wordWidth(word.slice(0, --l));
  20208. mustShrink = w > this.spaceLeft && l > 0;
  20209. } else {
  20210. w = this.wordWidth(word.slice(0, ++l));
  20211. mustShrink = w > this.spaceLeft && l > 0;
  20212. mightGrow = w <= this.spaceLeft && l < word.length;
  20213. }
  20214. } // check for the edge case where a single character cannot fit into a line.
  20215. if (l === 0 && this.spaceLeft === this.lineWidth) {
  20216. l = 1;
  20217. } // send a required break unless this is the last piece and a linebreak is not specified
  20218. fbk.required = bk.required || l < word.length;
  20219. shouldContinue = fn(word.slice(0, l), w, fbk, lbk);
  20220. lbk = {
  20221. required: false
  20222. }; // get the remaining piece of the word
  20223. word = word.slice(l);
  20224. w = this.wordWidth(word);
  20225. if (shouldContinue === false) {
  20226. break;
  20227. }
  20228. }
  20229. } else {
  20230. // otherwise just emit the break as it was given to us
  20231. shouldContinue = fn(word, w, bk, last);
  20232. }
  20233. if (shouldContinue === false) {
  20234. break;
  20235. }
  20236. last = bk;
  20237. }
  20238. }
  20239. }, {
  20240. key: "wrap",
  20241. value: function wrap(text, options) {
  20242. var _this2 = this; // override options from previous continued fragments
  20243. if (options.indent != null) {
  20244. this.indent = options.indent;
  20245. }
  20246. if (options.characterSpacing != null) {
  20247. this.characterSpacing = options.characterSpacing;
  20248. }
  20249. if (options.wordSpacing != null) {
  20250. this.wordSpacing = options.wordSpacing;
  20251. }
  20252. if (options.ellipsis != null) {
  20253. this.ellipsis = options.ellipsis;
  20254. } // make sure we're actually on the page
  20255. // and that the first line of is never by
  20256. // itself at the bottom of a page (orphans)
  20257. var nextY = this.document.y + this.document.currentLineHeight(true);
  20258. if (this.document.y > this.maxY || nextY > this.maxY) {
  20259. this.nextSection();
  20260. }
  20261. var buffer = '';
  20262. var textWidth = 0;
  20263. var wc = 0;
  20264. var lc = 0;
  20265. var y = this.document.y; // used to reset Y pos if options.continued (below)
  20266. var emitLine = function emitLine() {
  20267. options.textWidth = textWidth + _this2.wordSpacing * (wc - 1);
  20268. options.wordCount = wc;
  20269. options.lineWidth = _this2.lineWidth;
  20270. y = _this2.document.y;
  20271. _this2.emit('line', buffer, options, _this2);
  20272. return lc++;
  20273. };
  20274. this.emit('sectionStart', options, this);
  20275. this.eachWord(text, function (word, w, bk, last) {
  20276. if (last == null || last.required) {
  20277. _this2.emit('firstLine', options, _this2);
  20278. _this2.spaceLeft = _this2.lineWidth;
  20279. }
  20280. if (w <= _this2.spaceLeft) {
  20281. buffer += word;
  20282. textWidth += w;
  20283. wc++;
  20284. }
  20285. if (bk.required || w > _this2.spaceLeft) {
  20286. // if the user specified a max height and an ellipsis, and is about to pass the
  20287. // max height and max columns after the next line, append the ellipsis
  20288. var lh = _this2.document.currentLineHeight(true);
  20289. if (_this2.height != null && _this2.ellipsis && _this2.document.y + lh * 2 > _this2.maxY && _this2.column >= _this2.columns) {
  20290. if (_this2.ellipsis === true) {
  20291. _this2.ellipsis = '…';
  20292. } // map default ellipsis character
  20293. buffer = buffer.replace(/\s+$/, '');
  20294. textWidth = _this2.wordWidth(buffer + _this2.ellipsis); // remove characters from the buffer until the ellipsis fits
  20295. // to avoid inifinite loop need to stop while-loop if buffer is empty string
  20296. while (buffer && textWidth > _this2.lineWidth) {
  20297. buffer = buffer.slice(0, -1).replace(/\s+$/, '');
  20298. textWidth = _this2.wordWidth(buffer + _this2.ellipsis);
  20299. } // need to add ellipsis only if there is enough space for it
  20300. if (textWidth <= _this2.lineWidth) {
  20301. buffer = buffer + _this2.ellipsis;
  20302. }
  20303. textWidth = _this2.wordWidth(buffer);
  20304. }
  20305. if (bk.required) {
  20306. if (w > _this2.spaceLeft) {
  20307. emitLine();
  20308. buffer = word;
  20309. textWidth = w;
  20310. wc = 1;
  20311. }
  20312. _this2.emit('lastLine', options, _this2);
  20313. }
  20314. emitLine(); // if we've reached the edge of the page,
  20315. // continue on a new page or column
  20316. if (_this2.document.y + lh > _this2.maxY) {
  20317. var shouldContinue = _this2.nextSection(); // stop if we reached the maximum height
  20318. if (!shouldContinue) {
  20319. wc = 0;
  20320. buffer = '';
  20321. return false;
  20322. }
  20323. } // reset the space left and buffer
  20324. if (bk.required) {
  20325. _this2.spaceLeft = _this2.lineWidth;
  20326. buffer = '';
  20327. textWidth = 0;
  20328. return wc = 0;
  20329. } else {
  20330. // reset the space left and buffer
  20331. _this2.spaceLeft = _this2.lineWidth - w;
  20332. buffer = word;
  20333. textWidth = w;
  20334. return wc = 1;
  20335. }
  20336. } else {
  20337. return _this2.spaceLeft -= w;
  20338. }
  20339. });
  20340. if (wc > 0) {
  20341. this.emit('lastLine', options, this);
  20342. emitLine();
  20343. }
  20344. this.emit('sectionEnd', options, this); // if the wrap is set to be continued, save the X position
  20345. // to start the first line of the next segment at, and reset
  20346. // the y position
  20347. if (options.continued === true) {
  20348. if (lc > 1) {
  20349. this.continuedX = 0;
  20350. }
  20351. this.continuedX += options.textWidth || 0;
  20352. return this.document.y = y;
  20353. } else {
  20354. return this.document.x = this.startX;
  20355. }
  20356. }
  20357. }, {
  20358. key: "nextSection",
  20359. value: function nextSection(options) {
  20360. this.emit('sectionEnd', options, this);
  20361. if (++this.column > this.columns) {
  20362. // if a max height was specified by the user, we're done.
  20363. // otherwise, the default is to make a new page at the bottom.
  20364. if (this.height != null) {
  20365. return false;
  20366. }
  20367. this.document.addPage();
  20368. this.column = 1;
  20369. this.startY = this.document.page.margins.top;
  20370. this.maxY = this.document.page.maxY();
  20371. this.document.x = this.startX;
  20372. if (this.document._fillColor) {
  20373. var _this$document;
  20374. (_this$document = this.document).fillColor.apply(_this$document, _toConsumableArray(this.document._fillColor));
  20375. }
  20376. this.emit('pageBreak', options, this);
  20377. } else {
  20378. this.document.x += this.lineWidth + this.columnGap;
  20379. this.document.y = this.startY;
  20380. this.emit('columnBreak', options, this);
  20381. }
  20382. this.emit('sectionStart', options, this);
  20383. return true;
  20384. }
  20385. }]);
  20386. return LineWrapper;
  20387. }(_events.EventEmitter);
  20388. var number$2 = PDFObject.number;
  20389. var TextMixin = {
  20390. initText: function initText() {
  20391. this._line = this._line.bind(this); // Current coordinates
  20392. this.x = 0;
  20393. this.y = 0;
  20394. return this._lineGap = 0;
  20395. },
  20396. lineGap: function lineGap(_lineGap) {
  20397. this._lineGap = _lineGap;
  20398. return this;
  20399. },
  20400. moveDown: function moveDown(lines) {
  20401. if (lines == null) {
  20402. lines = 1;
  20403. }
  20404. this.y += this.currentLineHeight(true) * lines + this._lineGap;
  20405. return this;
  20406. },
  20407. moveUp: function moveUp(lines) {
  20408. if (lines == null) {
  20409. lines = 1;
  20410. }
  20411. this.y -= this.currentLineHeight(true) * lines + this._lineGap;
  20412. return this;
  20413. },
  20414. _text: function _text(text, x, y, options, lineCallback) {
  20415. options = this._initOptions(x, y, options); // Convert text to a string
  20416. text = text == null ? '' : "".concat(text); // if the wordSpacing option is specified, remove multiple consecutive spaces
  20417. if (options.wordSpacing) {
  20418. text = text.replace(/\s{2,}/g, ' ');
  20419. } // word wrapping
  20420. if (options.width) {
  20421. var wrapper = this._wrapper;
  20422. if (!wrapper) {
  20423. wrapper = new LineWrapper(this, options);
  20424. wrapper.on('line', lineCallback);
  20425. }
  20426. this._wrapper = options.continued ? wrapper : null;
  20427. this._textOptions = options.continued ? options : null;
  20428. wrapper.wrap(text, options); // render paragraphs as single lines
  20429. } else {
  20430. var _iteratorNormalCompletion = true;
  20431. var _didIteratorError = false;
  20432. var _iteratorError = undefined;
  20433. try {
  20434. for (var _iterator = text.split('\n')[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
  20435. var line = _step.value;
  20436. lineCallback(line, options);
  20437. }
  20438. } catch (err) {
  20439. _didIteratorError = true;
  20440. _iteratorError = err;
  20441. } finally {
  20442. try {
  20443. if (!_iteratorNormalCompletion && _iterator.return != null) {
  20444. _iterator.return();
  20445. }
  20446. } finally {
  20447. if (_didIteratorError) {
  20448. throw _iteratorError;
  20449. }
  20450. }
  20451. }
  20452. }
  20453. return this;
  20454. },
  20455. text: function text(_text2, x, y, options) {
  20456. return this._text(_text2, x, y, options, this._line);
  20457. },
  20458. widthOfString: function widthOfString(string) {
  20459. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  20460. return this._font.widthOfString(string, this._fontSize, options.features) + (options.characterSpacing || 0) * (string.length - 1);
  20461. },
  20462. heightOfString: function heightOfString(text, options) {
  20463. var _this = this;
  20464. var x = this.x,
  20465. y = this.y;
  20466. options = this._initOptions(options);
  20467. options.height = Infinity; // don't break pages
  20468. var lineGap = options.lineGap || this._lineGap || 0;
  20469. this._text(text, this.x, this.y, options, function () {
  20470. return _this.y += _this.currentLineHeight(true) + lineGap;
  20471. });
  20472. var height = this.y - y;
  20473. this.x = x;
  20474. this.y = y;
  20475. return height;
  20476. },
  20477. list: function list(_list, x, y, options, wrapper) {
  20478. var _this2 = this;
  20479. options = this._initOptions(x, y, options);
  20480. var listType = options.listType || 'bullet';
  20481. var unit = Math.round(this._font.ascender / 1000 * this._fontSize);
  20482. var midLine = unit / 2;
  20483. var r = options.bulletRadius || unit / 3;
  20484. var indent = options.textIndent || (listType === 'bullet' ? r * 5 : unit * 2);
  20485. var itemIndent = options.bulletIndent || (listType === 'bullet' ? r * 8 : unit * 2);
  20486. var level = 1;
  20487. var items = [];
  20488. var levels = [];
  20489. var numbers = [];
  20490. var flatten = function flatten(list) {
  20491. var n = 1;
  20492. for (var _i = 0; _i < list.length; _i++) {
  20493. var item = list[_i];
  20494. if (Array.isArray(item)) {
  20495. level++;
  20496. flatten(item);
  20497. level--;
  20498. } else {
  20499. items.push(item);
  20500. levels.push(level);
  20501. if (listType !== 'bullet') {
  20502. numbers.push(n++);
  20503. }
  20504. }
  20505. }
  20506. };
  20507. flatten(_list);
  20508. var label = function label(n) {
  20509. switch (listType) {
  20510. case 'numbered':
  20511. return "".concat(n, ".");
  20512. case 'lettered':
  20513. var letter = String.fromCharCode((n - 1) % 26 + 65);
  20514. var times = Math.floor((n - 1) / 26 + 1);
  20515. var text = Array(times + 1).join(letter);
  20516. return "".concat(text, ".");
  20517. }
  20518. };
  20519. wrapper = new LineWrapper(this, options);
  20520. wrapper.on('line', this._line);
  20521. level = 1;
  20522. var i = 0;
  20523. wrapper.on('firstLine', function () {
  20524. var l;
  20525. if ((l = levels[i++]) !== level) {
  20526. var diff = itemIndent * (l - level);
  20527. _this2.x += diff;
  20528. wrapper.lineWidth -= diff;
  20529. level = l;
  20530. }
  20531. switch (listType) {
  20532. case 'bullet':
  20533. _this2.circle(_this2.x - indent + r, _this2.y + midLine, r);
  20534. return _this2.fill();
  20535. case 'numbered':
  20536. case 'lettered':
  20537. var text = label(numbers[i - 1]);
  20538. return _this2._fragment(text, _this2.x - indent, _this2.y, options);
  20539. }
  20540. });
  20541. wrapper.on('sectionStart', function () {
  20542. var pos = indent + itemIndent * (level - 1);
  20543. _this2.x += pos;
  20544. return wrapper.lineWidth -= pos;
  20545. });
  20546. wrapper.on('sectionEnd', function () {
  20547. var pos = indent + itemIndent * (level - 1);
  20548. _this2.x -= pos;
  20549. return wrapper.lineWidth += pos;
  20550. });
  20551. wrapper.wrap(items.join('\n'), options);
  20552. return this;
  20553. },
  20554. _initOptions: function _initOptions() {
  20555. var x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  20556. var y = arguments.length > 1 ? arguments[1] : undefined;
  20557. var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  20558. if (typeof x === 'object') {
  20559. options = x;
  20560. x = null;
  20561. } // clone options object
  20562. var result = Object.assign({}, options); // extend options with previous values for continued text
  20563. if (this._textOptions) {
  20564. for (var key in this._textOptions) {
  20565. var val = this._textOptions[key];
  20566. if (key !== 'continued') {
  20567. if (result[key] === undefined) {
  20568. result[key] = val;
  20569. }
  20570. }
  20571. }
  20572. } // Update the current position
  20573. if (x != null) {
  20574. this.x = x;
  20575. }
  20576. if (y != null) {
  20577. this.y = y;
  20578. } // wrap to margins if no x or y position passed
  20579. if (result.lineBreak !== false) {
  20580. if (result.width == null) {
  20581. result.width = this.page.width - this.x - this.page.margins.right;
  20582. }
  20583. result.width = Math.max(result.width, 0);
  20584. }
  20585. if (!result.columns) {
  20586. result.columns = 0;
  20587. }
  20588. if (result.columnGap == null) {
  20589. result.columnGap = 18;
  20590. } // 1/4 inch
  20591. return result;
  20592. },
  20593. _line: function _line(text) {
  20594. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  20595. var wrapper = arguments.length > 2 ? arguments[2] : undefined;
  20596. this._fragment(text, this.x, this.y, options);
  20597. var lineGap = options.lineGap || this._lineGap || 0;
  20598. if (!wrapper) {
  20599. return this.x += this.widthOfString(text);
  20600. } else {
  20601. return this.y += this.currentLineHeight(true) + lineGap;
  20602. }
  20603. },
  20604. _fragment: function _fragment(text, x, y, options) {
  20605. var _this3 = this;
  20606. var dy, encoded, i, positions, textWidth, words;
  20607. text = "".concat(text).replace(/\n/g, '');
  20608. if (text.length === 0) {
  20609. return;
  20610. } // handle options
  20611. var align = options.align || 'left';
  20612. var wordSpacing = options.wordSpacing || 0;
  20613. var characterSpacing = options.characterSpacing || 0; // text alignments
  20614. if (options.width) {
  20615. switch (align) {
  20616. case 'right':
  20617. textWidth = this.widthOfString(text.replace(/\s+$/, ''), options);
  20618. x += options.lineWidth - textWidth;
  20619. break;
  20620. case 'center':
  20621. x += options.lineWidth / 2 - options.textWidth / 2;
  20622. break;
  20623. case 'justify':
  20624. // calculate the word spacing value
  20625. words = text.trim().split(/\s+/);
  20626. textWidth = this.widthOfString(text.replace(/\s+/g, ''), options);
  20627. var spaceWidth = this.widthOfString(' ') + characterSpacing;
  20628. wordSpacing = Math.max(0, (options.lineWidth - textWidth) / Math.max(1, words.length - 1) - spaceWidth);
  20629. break;
  20630. }
  20631. } // text baseline alignments based on http://wiki.apache.org/xmlgraphics-fop/LineLayout/AlignmentHandling
  20632. if (typeof options.baseline === 'number') {
  20633. dy = -options.baseline;
  20634. } else {
  20635. switch (options.baseline) {
  20636. case 'svg-middle':
  20637. dy = 0.5 * this._font.xHeight;
  20638. break;
  20639. case 'middle':
  20640. case 'svg-central':
  20641. dy = 0.5 * (this._font.descender + this._font.ascender);
  20642. break;
  20643. case 'bottom':
  20644. case 'ideographic':
  20645. dy = this._font.descender;
  20646. break;
  20647. case 'alphabetic':
  20648. dy = 0;
  20649. break;
  20650. case 'mathematical':
  20651. dy = 0.5 * this._font.ascender;
  20652. break;
  20653. case 'hanging':
  20654. dy = 0.8 * this._font.ascender;
  20655. break;
  20656. case 'top':
  20657. dy = this._font.ascender;
  20658. break;
  20659. default:
  20660. dy = this._font.ascender;
  20661. }
  20662. dy = dy / 1000 * this._fontSize;
  20663. } // calculate the actual rendered width of the string after word and character spacing
  20664. var renderedWidth = options.textWidth + wordSpacing * (options.wordCount - 1) + characterSpacing * (text.length - 1); // create link annotations if the link option is given
  20665. if (options.link != null) {
  20666. this.link(x, y, renderedWidth, this.currentLineHeight(), options.link);
  20667. }
  20668. if (options.goTo != null) {
  20669. this.goTo(x, y, renderedWidth, this.currentLineHeight(), options.goTo);
  20670. }
  20671. if (options.destination != null) {
  20672. this.addNamedDestination(options.destination, 'XYZ', x, y, null);
  20673. } // create underline or strikethrough line
  20674. if (options.underline || options.strike) {
  20675. this.save();
  20676. if (!options.stroke) {
  20677. this.strokeColor.apply(this, _toConsumableArray(this._fillColor || []));
  20678. }
  20679. var lineWidth = this._fontSize < 10 ? 0.5 : Math.floor(this._fontSize / 10);
  20680. this.lineWidth(lineWidth);
  20681. var d = options.underline ? 1 : 2;
  20682. var lineY = y + this.currentLineHeight() / d;
  20683. if (options.underline) {
  20684. lineY -= lineWidth;
  20685. }
  20686. this.moveTo(x, lineY);
  20687. this.lineTo(x + renderedWidth, lineY);
  20688. this.stroke();
  20689. this.restore();
  20690. }
  20691. this.save(); // oblique (angle in degrees or boolean)
  20692. if (options.oblique) {
  20693. var skew;
  20694. if (typeof options.oblique === 'number') {
  20695. skew = -Math.tan(options.oblique * Math.PI / 180);
  20696. } else {
  20697. skew = -0.25;
  20698. }
  20699. this.transform(1, 0, 0, 1, x, y);
  20700. this.transform(1, 0, skew, 1, -skew * dy, 0);
  20701. this.transform(1, 0, 0, 1, -x, -y);
  20702. } // flip coordinate system
  20703. this.transform(1, 0, 0, -1, 0, this.page.height);
  20704. y = this.page.height - y - dy; // add current font to page if necessary
  20705. if (this.page.fonts[this._font.id] == null) {
  20706. this.page.fonts[this._font.id] = this._font.ref();
  20707. } // begin the text object
  20708. this.addContent('BT'); // text position
  20709. this.addContent("1 0 0 1 ".concat(number$2(x), " ").concat(number$2(y), " Tm")); // font and font size
  20710. this.addContent("/".concat(this._font.id, " ").concat(number$2(this._fontSize), " Tf")); // rendering mode
  20711. var mode = options.fill && options.stroke ? 2 : options.stroke ? 1 : 0;
  20712. if (mode) {
  20713. this.addContent("".concat(mode, " Tr"));
  20714. } // Character spacing
  20715. if (characterSpacing) {
  20716. this.addContent("".concat(number$2(characterSpacing), " Tc"));
  20717. } // Add the actual text
  20718. // If we have a word spacing value, we need to encode each word separately
  20719. // since the normal Tw operator only works on character code 32, which isn't
  20720. // used for embedded fonts.
  20721. if (wordSpacing) {
  20722. words = text.trim().split(/\s+/);
  20723. wordSpacing += this.widthOfString(' ') + characterSpacing;
  20724. wordSpacing *= 1000 / this._fontSize;
  20725. encoded = [];
  20726. positions = [];
  20727. var _iteratorNormalCompletion2 = true;
  20728. var _didIteratorError2 = false;
  20729. var _iteratorError2 = undefined;
  20730. try {
  20731. for (var _iterator2 = words[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
  20732. var word = _step2.value;
  20733. var _this$_font$encode = this._font.encode(word, options.features),
  20734. _this$_font$encode2 = _slicedToArray(_this$_font$encode, 2),
  20735. encodedWord = _this$_font$encode2[0],
  20736. positionsWord = _this$_font$encode2[1];
  20737. encoded = encoded.concat(encodedWord);
  20738. positions = positions.concat(positionsWord); // add the word spacing to the end of the word
  20739. // clone object because of cache
  20740. var space = {};
  20741. var object = positions[positions.length - 1];
  20742. for (var key in object) {
  20743. var val = object[key];
  20744. space[key] = val;
  20745. }
  20746. space.xAdvance += wordSpacing;
  20747. positions[positions.length - 1] = space;
  20748. }
  20749. } catch (err) {
  20750. _didIteratorError2 = true;
  20751. _iteratorError2 = err;
  20752. } finally {
  20753. try {
  20754. if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
  20755. _iterator2.return();
  20756. }
  20757. } finally {
  20758. if (_didIteratorError2) {
  20759. throw _iteratorError2;
  20760. }
  20761. }
  20762. }
  20763. } else {
  20764. var _this$_font$encode3 = this._font.encode(text, options.features);
  20765. var _this$_font$encode4 = _slicedToArray(_this$_font$encode3, 2);
  20766. encoded = _this$_font$encode4[0];
  20767. positions = _this$_font$encode4[1];
  20768. }
  20769. var scale = this._fontSize / 1000;
  20770. var commands = [];
  20771. var last = 0;
  20772. var hadOffset = false; // Adds a segment of text to the TJ command buffer
  20773. var addSegment = function addSegment(cur) {
  20774. if (last < cur) {
  20775. var hex = encoded.slice(last, cur).join('');
  20776. var advance = positions[cur - 1].xAdvance - positions[cur - 1].advanceWidth;
  20777. commands.push("<".concat(hex, "> ").concat(number$2(-advance)));
  20778. }
  20779. return last = cur;
  20780. }; // Flushes the current TJ commands to the output stream
  20781. var flush = function flush(i) {
  20782. addSegment(i);
  20783. if (commands.length > 0) {
  20784. _this3.addContent("[".concat(commands.join(' '), "] TJ"));
  20785. return commands.length = 0;
  20786. }
  20787. };
  20788. for (i = 0; i < positions.length; i++) {
  20789. // If we have an x or y offset, we have to break out of the current TJ command
  20790. // so we can move the text position.
  20791. var pos = positions[i];
  20792. if (pos.xOffset || pos.yOffset) {
  20793. // Flush the current buffer
  20794. flush(i); // Move the text position and flush just the current character
  20795. this.addContent("1 0 0 1 ".concat(number$2(x + pos.xOffset * scale), " ").concat(number$2(y + pos.yOffset * scale), " Tm"));
  20796. flush(i + 1);
  20797. hadOffset = true;
  20798. } else {
  20799. // If the last character had an offset, reset the text position
  20800. if (hadOffset) {
  20801. this.addContent("1 0 0 1 ".concat(number$2(x), " ").concat(number$2(y), " Tm"));
  20802. hadOffset = false;
  20803. } // Group segments that don't have any advance adjustments
  20804. if (pos.xAdvance - pos.advanceWidth !== 0) {
  20805. addSegment(i + 1);
  20806. }
  20807. }
  20808. x += pos.xAdvance * scale;
  20809. } // Flush any remaining commands
  20810. flush(i); // end the text object
  20811. this.addContent('ET'); // restore flipped coordinate system
  20812. return this.restore();
  20813. }
  20814. };
  20815. var MARKERS = [0xffc0, 0xffc1, 0xffc2, 0xffc3, 0xffc5, 0xffc6, 0xffc7, 0xffc8, 0xffc9, 0xffca, 0xffcb, 0xffcc, 0xffcd, 0xffce, 0xffcf];
  20816. var COLOR_SPACE_MAP = {
  20817. 1: 'DeviceGray',
  20818. 3: 'DeviceRGB',
  20819. 4: 'DeviceCMYK'
  20820. };
  20821. var JPEG = /*#__PURE__*/function () {
  20822. function JPEG(data, label) {
  20823. _classCallCheck(this, JPEG);
  20824. var marker;
  20825. this.data = data;
  20826. this.label = label;
  20827. if (this.data.readUInt16BE(0) !== 0xffd8) {
  20828. throw 'SOI not found in JPEG';
  20829. }
  20830. var pos = 2;
  20831. while (pos < this.data.length) {
  20832. marker = this.data.readUInt16BE(pos);
  20833. pos += 2;
  20834. if (MARKERS.includes(marker)) {
  20835. break;
  20836. }
  20837. pos += this.data.readUInt16BE(pos);
  20838. }
  20839. if (!MARKERS.includes(marker)) {
  20840. throw 'Invalid JPEG.';
  20841. }
  20842. pos += 2;
  20843. this.bits = this.data[pos++];
  20844. this.height = this.data.readUInt16BE(pos);
  20845. pos += 2;
  20846. this.width = this.data.readUInt16BE(pos);
  20847. pos += 2;
  20848. var channels = this.data[pos++];
  20849. this.colorSpace = COLOR_SPACE_MAP[channels];
  20850. this.obj = null;
  20851. }
  20852. _createClass(JPEG, [{
  20853. key: "embed",
  20854. value: function embed(document) {
  20855. if (this.obj) {
  20856. return;
  20857. }
  20858. this.obj = document.ref({
  20859. Type: 'XObject',
  20860. Subtype: 'Image',
  20861. BitsPerComponent: this.bits,
  20862. Width: this.width,
  20863. Height: this.height,
  20864. ColorSpace: this.colorSpace,
  20865. Filter: 'DCTDecode'
  20866. }); // add extra decode params for CMYK images. By swapping the
  20867. // min and max values from the default, we invert the colors. See
  20868. // section 4.8.4 of the spec.
  20869. if (this.colorSpace === 'DeviceCMYK') {
  20870. this.obj.data['Decode'] = [1.0, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0];
  20871. }
  20872. this.obj.end(this.data); // free memory
  20873. return this.data = null;
  20874. }
  20875. }]);
  20876. return JPEG;
  20877. }();
  20878. var PNGImage = /*#__PURE__*/function () {
  20879. function PNGImage(data, label) {
  20880. _classCallCheck(this, PNGImage);
  20881. this.label = label;
  20882. this.image = new _pngJs.default(data);
  20883. this.width = this.image.width;
  20884. this.height = this.image.height;
  20885. this.imgData = this.image.imgData;
  20886. this.obj = null;
  20887. }
  20888. _createClass(PNGImage, [{
  20889. key: "embed",
  20890. value: function embed(document) {
  20891. var dataDecoded = false;
  20892. this.document = document;
  20893. if (this.obj) {
  20894. return;
  20895. }
  20896. var hasAlphaChannel = this.image.hasAlphaChannel;
  20897. var isInterlaced = this.image.interlaceMethod === 1;
  20898. this.obj = this.document.ref({
  20899. Type: 'XObject',
  20900. Subtype: 'Image',
  20901. BitsPerComponent: hasAlphaChannel ? 8 : this.image.bits,
  20902. Width: this.width,
  20903. Height: this.height,
  20904. Filter: 'FlateDecode'
  20905. });
  20906. if (!hasAlphaChannel) {
  20907. var params = this.document.ref({
  20908. Predictor: isInterlaced ? 1 : 15,
  20909. Colors: this.image.colors,
  20910. BitsPerComponent: this.image.bits,
  20911. Columns: this.width
  20912. });
  20913. this.obj.data['DecodeParms'] = params;
  20914. params.end();
  20915. }
  20916. if (this.image.palette.length === 0) {
  20917. this.obj.data['ColorSpace'] = this.image.colorSpace;
  20918. } else {
  20919. // embed the color palette in the PDF as an object stream
  20920. var palette = this.document.ref();
  20921. palette.end(new Buffer(this.image.palette)); // build the color space array for the image
  20922. this.obj.data['ColorSpace'] = ['Indexed', 'DeviceRGB', this.image.palette.length / 3 - 1, palette];
  20923. } // For PNG color types 0, 2 and 3, the transparency data is stored in
  20924. // a dedicated PNG chunk.
  20925. if (this.image.transparency.grayscale != null) {
  20926. // Use Color Key Masking (spec section 4.8.5)
  20927. // An array with N elements, where N is two times the number of color components.
  20928. var val = this.image.transparency.grayscale;
  20929. this.obj.data['Mask'] = [val, val];
  20930. } else if (this.image.transparency.rgb) {
  20931. // Use Color Key Masking (spec section 4.8.5)
  20932. // An array with N elements, where N is two times the number of color components.
  20933. var rgb = this.image.transparency.rgb;
  20934. var mask = [];
  20935. var _iteratorNormalCompletion = true;
  20936. var _didIteratorError = false;
  20937. var _iteratorError = undefined;
  20938. try {
  20939. for (var _iterator = rgb[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
  20940. var x = _step.value;
  20941. mask.push(x, x);
  20942. }
  20943. } catch (err) {
  20944. _didIteratorError = true;
  20945. _iteratorError = err;
  20946. } finally {
  20947. try {
  20948. if (!_iteratorNormalCompletion && _iterator.return != null) {
  20949. _iterator.return();
  20950. }
  20951. } finally {
  20952. if (_didIteratorError) {
  20953. throw _iteratorError;
  20954. }
  20955. }
  20956. }
  20957. this.obj.data['Mask'] = mask;
  20958. } else if (this.image.transparency.indexed) {
  20959. // Create a transparency SMask for the image based on the data
  20960. // in the PLTE and tRNS sections. See below for details on SMasks.
  20961. dataDecoded = true;
  20962. return this.loadIndexedAlphaChannel();
  20963. } else if (hasAlphaChannel) {
  20964. // For PNG color types 4 and 6, the transparency data is stored as a alpha
  20965. // channel mixed in with the main image data. Separate this data out into an
  20966. // SMask object and store it separately in the PDF.
  20967. dataDecoded = true;
  20968. return this.splitAlphaChannel();
  20969. }
  20970. if (isInterlaced && !dataDecoded) {
  20971. return this.decodeData();
  20972. }
  20973. this.finalize();
  20974. }
  20975. }, {
  20976. key: "finalize",
  20977. value: function finalize() {
  20978. if (this.alphaChannel) {
  20979. var sMask = this.document.ref({
  20980. Type: 'XObject',
  20981. Subtype: 'Image',
  20982. Height: this.height,
  20983. Width: this.width,
  20984. BitsPerComponent: 8,
  20985. Filter: 'FlateDecode',
  20986. ColorSpace: 'DeviceGray',
  20987. Decode: [0, 1]
  20988. });
  20989. sMask.end(this.alphaChannel);
  20990. this.obj.data['SMask'] = sMask;
  20991. } // add the actual image data
  20992. this.obj.end(this.imgData); // free memory
  20993. this.image = null;
  20994. return this.imgData = null;
  20995. }
  20996. }, {
  20997. key: "splitAlphaChannel",
  20998. value: function splitAlphaChannel() {
  20999. var _this = this;
  21000. return this.image.decodePixels(function (pixels) {
  21001. var a, p;
  21002. var colorCount = _this.image.colors;
  21003. var pixelCount = _this.width * _this.height;
  21004. var imgData = new Buffer(pixelCount * colorCount);
  21005. var alphaChannel = new Buffer(pixelCount);
  21006. var i = p = a = 0;
  21007. var len = pixels.length; // For 16bit images copy only most significant byte (MSB) - PNG data is always stored in network byte order (MSB first)
  21008. var skipByteCount = _this.image.bits === 16 ? 1 : 0;
  21009. while (i < len) {
  21010. for (var colorIndex = 0; colorIndex < colorCount; colorIndex++) {
  21011. imgData[p++] = pixels[i++];
  21012. i += skipByteCount;
  21013. }
  21014. alphaChannel[a++] = pixels[i++];
  21015. i += skipByteCount;
  21016. }
  21017. _this.imgData = _zlib.default.deflateSync(imgData);
  21018. _this.alphaChannel = _zlib.default.deflateSync(alphaChannel);
  21019. return _this.finalize();
  21020. });
  21021. }
  21022. }, {
  21023. key: "loadIndexedAlphaChannel",
  21024. value: function loadIndexedAlphaChannel() {
  21025. var _this2 = this;
  21026. var transparency = this.image.transparency.indexed;
  21027. return this.image.decodePixels(function (pixels) {
  21028. var alphaChannel = new Buffer(_this2.width * _this2.height);
  21029. var i = 0;
  21030. for (var j = 0, end = pixels.length; j < end; j++) {
  21031. alphaChannel[i++] = transparency[pixels[j]];
  21032. }
  21033. _this2.alphaChannel = _zlib.default.deflateSync(alphaChannel);
  21034. return _this2.finalize();
  21035. });
  21036. }
  21037. }, {
  21038. key: "decodeData",
  21039. value: function decodeData() {
  21040. var _this3 = this;
  21041. this.image.decodePixels(function (pixels) {
  21042. _this3.imgData = _zlib.default.deflateSync(pixels);
  21043. _this3.finalize();
  21044. });
  21045. }
  21046. }]);
  21047. return PNGImage;
  21048. }();
  21049. var PDFImage = /*#__PURE__*/function () {
  21050. function PDFImage() {
  21051. _classCallCheck(this, PDFImage);
  21052. }
  21053. _createClass(PDFImage, null, [{
  21054. key: "open",
  21055. value: function open(src, label) {
  21056. var data;
  21057. if (Buffer.isBuffer(src)) {
  21058. data = src;
  21059. } else if (src instanceof ArrayBuffer) {
  21060. data = new Buffer(new Uint8Array(src));
  21061. } else {
  21062. var match;
  21063. if (match = /^data:.+;base64,(.*)$/.exec(src)) {
  21064. data = new Buffer(match[1], 'base64');
  21065. } else {
  21066. data = fs.readFileSync(src);
  21067. if (!data) {
  21068. return;
  21069. }
  21070. }
  21071. }
  21072. if (data[0] === 0xff && data[1] === 0xd8) {
  21073. return new JPEG(data, label);
  21074. } else if (data[0] === 0x89 && data.toString('ascii', 1, 4) === 'PNG') {
  21075. return new PNGImage(data, label);
  21076. } else {
  21077. throw new Error('Unknown image format.');
  21078. }
  21079. }
  21080. }]);
  21081. return PDFImage;
  21082. }();
  21083. var ImagesMixin = {
  21084. initImages: function initImages() {
  21085. this._imageRegistry = {};
  21086. return this._imageCount = 0;
  21087. },
  21088. image: function image(src, x, y) {
  21089. var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
  21090. var bh, bp, bw, image, ip, left, left1;
  21091. if (typeof x === 'object') {
  21092. options = x;
  21093. x = null;
  21094. }
  21095. x = (left = x != null ? x : options.x) != null ? left : this.x;
  21096. y = (left1 = y != null ? y : options.y) != null ? left1 : this.y;
  21097. if (typeof src === 'string') {
  21098. image = this._imageRegistry[src];
  21099. }
  21100. if (!image) {
  21101. if (src.width && src.height) {
  21102. image = src;
  21103. } else {
  21104. image = this.openImage(src);
  21105. }
  21106. }
  21107. if (!image.obj) {
  21108. image.embed(this);
  21109. }
  21110. if (this.page.xobjects[image.label] == null) {
  21111. this.page.xobjects[image.label] = image.obj;
  21112. }
  21113. var w = options.width || image.width;
  21114. var h = options.height || image.height;
  21115. if (options.width && !options.height) {
  21116. var wp = w / image.width;
  21117. w = image.width * wp;
  21118. h = image.height * wp;
  21119. } else if (options.height && !options.width) {
  21120. var hp = h / image.height;
  21121. w = image.width * hp;
  21122. h = image.height * hp;
  21123. } else if (options.scale) {
  21124. w = image.width * options.scale;
  21125. h = image.height * options.scale;
  21126. } else if (options.fit) {
  21127. var _options$fit = _slicedToArray(options.fit, 2);
  21128. bw = _options$fit[0];
  21129. bh = _options$fit[1];
  21130. bp = bw / bh;
  21131. ip = image.width / image.height;
  21132. if (ip > bp) {
  21133. w = bw;
  21134. h = bw / ip;
  21135. } else {
  21136. h = bh;
  21137. w = bh * ip;
  21138. }
  21139. } else if (options.cover) {
  21140. var _options$cover = _slicedToArray(options.cover, 2);
  21141. bw = _options$cover[0];
  21142. bh = _options$cover[1];
  21143. bp = bw / bh;
  21144. ip = image.width / image.height;
  21145. if (ip > bp) {
  21146. h = bh;
  21147. w = bh * ip;
  21148. } else {
  21149. w = bw;
  21150. h = bw / ip;
  21151. }
  21152. }
  21153. if (options.fit || options.cover) {
  21154. if (options.align === 'center') {
  21155. x = x + bw / 2 - w / 2;
  21156. } else if (options.align === 'right') {
  21157. x = x + bw - w;
  21158. }
  21159. if (options.valign === 'center') {
  21160. y = y + bh / 2 - h / 2;
  21161. } else if (options.valign === 'bottom') {
  21162. y = y + bh - h;
  21163. }
  21164. } // create link annotations if the link option is given
  21165. if (options.link != null) {
  21166. this.link(x, y, w, h, options.link);
  21167. }
  21168. if (options.goTo != null) {
  21169. this.goTo(x, y, w, h, options.goTo);
  21170. }
  21171. if (options.destination != null) {
  21172. this.addNamedDestination(options.destination, 'XYZ', x, y, null);
  21173. } // Set the current y position to below the image if it is in the document flow
  21174. if (this.y === y) {
  21175. this.y += h;
  21176. }
  21177. this.save();
  21178. this.transform(w, 0, 0, -h, x, y + h);
  21179. this.addContent("/".concat(image.label, " Do"));
  21180. this.restore();
  21181. return this;
  21182. },
  21183. openImage: function openImage(src) {
  21184. var image;
  21185. if (typeof src === 'string') {
  21186. image = this._imageRegistry[src];
  21187. }
  21188. if (!image) {
  21189. image = PDFImage.open(src, "I".concat(++this._imageCount));
  21190. if (typeof src === 'string') {
  21191. this._imageRegistry[src] = image;
  21192. }
  21193. }
  21194. return image;
  21195. }
  21196. };
  21197. var AnnotationsMixin = {
  21198. annotate: function annotate(x, y, w, h, options) {
  21199. options.Type = 'Annot';
  21200. options.Rect = this._convertRect(x, y, w, h);
  21201. options.Border = [0, 0, 0];
  21202. if (options.Subtype === 'Link' && typeof options.F === 'undefined') {
  21203. options.F = 1 << 2; // Print Annotation Flag
  21204. }
  21205. if (options.Subtype !== 'Link') {
  21206. if (options.C == null) {
  21207. options.C = this._normalizeColor(options.color || [0, 0, 0]);
  21208. }
  21209. } // convert colors
  21210. delete options.color;
  21211. if (typeof options.Dest === 'string') {
  21212. options.Dest = new String(options.Dest);
  21213. } // Capitalize keys
  21214. for (var key in options) {
  21215. var val = options[key];
  21216. options[key[0].toUpperCase() + key.slice(1)] = val;
  21217. }
  21218. var ref = this.ref(options);
  21219. this.page.annotations.push(ref);
  21220. ref.end();
  21221. return this;
  21222. },
  21223. note: function note(x, y, w, h, contents) {
  21224. var options = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {};
  21225. options.Subtype = 'Text';
  21226. options.Contents = new String(contents);
  21227. options.Name = 'Comment';
  21228. if (options.color == null) {
  21229. options.color = [243, 223, 92];
  21230. }
  21231. return this.annotate(x, y, w, h, options);
  21232. },
  21233. goTo: function goTo(x, y, w, h, name) {
  21234. var options = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {};
  21235. options.Subtype = 'Link';
  21236. options.A = this.ref({
  21237. S: 'GoTo',
  21238. D: new String(name)
  21239. });
  21240. options.A.end();
  21241. return this.annotate(x, y, w, h, options);
  21242. },
  21243. link: function link(x, y, w, h, url) {
  21244. var options = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {};
  21245. options.Subtype = 'Link';
  21246. if (typeof url === 'number') {
  21247. // Link to a page in the document (the page must already exist)
  21248. var pages = this._root.data.Pages.data;
  21249. if (url >= 0 && url < pages.Kids.length) {
  21250. options.A = this.ref({
  21251. S: 'GoTo',
  21252. D: [pages.Kids[url], 'XYZ', null, null, null]
  21253. });
  21254. options.A.end();
  21255. } else {
  21256. throw new Error("The document has no page ".concat(url));
  21257. }
  21258. } else {
  21259. // Link to an external url
  21260. options.A = this.ref({
  21261. S: 'URI',
  21262. URI: new String(url)
  21263. });
  21264. options.A.end();
  21265. }
  21266. return this.annotate(x, y, w, h, options);
  21267. },
  21268. _markup: function _markup(x, y, w, h) {
  21269. var options = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
  21270. var _this$_convertRect = this._convertRect(x, y, w, h),
  21271. _this$_convertRect2 = _slicedToArray(_this$_convertRect, 4),
  21272. x1 = _this$_convertRect2[0],
  21273. y1 = _this$_convertRect2[1],
  21274. x2 = _this$_convertRect2[2],
  21275. y2 = _this$_convertRect2[3];
  21276. options.QuadPoints = [x1, y2, x2, y2, x1, y1, x2, y1];
  21277. options.Contents = new String();
  21278. return this.annotate(x, y, w, h, options);
  21279. },
  21280. highlight: function highlight(x, y, w, h) {
  21281. var options = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
  21282. options.Subtype = 'Highlight';
  21283. if (options.color == null) {
  21284. options.color = [241, 238, 148];
  21285. }
  21286. return this._markup(x, y, w, h, options);
  21287. },
  21288. underline: function underline(x, y, w, h) {
  21289. var options = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
  21290. options.Subtype = 'Underline';
  21291. return this._markup(x, y, w, h, options);
  21292. },
  21293. strike: function strike(x, y, w, h) {
  21294. var options = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
  21295. options.Subtype = 'StrikeOut';
  21296. return this._markup(x, y, w, h, options);
  21297. },
  21298. lineAnnotation: function lineAnnotation(x1, y1, x2, y2) {
  21299. var options = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
  21300. options.Subtype = 'Line';
  21301. options.Contents = new String();
  21302. options.L = [x1, this.page.height - y1, x2, this.page.height - y2];
  21303. return this.annotate(x1, y1, x2, y2, options);
  21304. },
  21305. rectAnnotation: function rectAnnotation(x, y, w, h) {
  21306. var options = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
  21307. options.Subtype = 'Square';
  21308. options.Contents = new String();
  21309. return this.annotate(x, y, w, h, options);
  21310. },
  21311. ellipseAnnotation: function ellipseAnnotation(x, y, w, h) {
  21312. var options = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
  21313. options.Subtype = 'Circle';
  21314. options.Contents = new String();
  21315. return this.annotate(x, y, w, h, options);
  21316. },
  21317. textAnnotation: function textAnnotation(x, y, w, h, text) {
  21318. var options = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {};
  21319. options.Subtype = 'FreeText';
  21320. options.Contents = new String(text);
  21321. options.DA = new String();
  21322. return this.annotate(x, y, w, h, options);
  21323. },
  21324. _convertRect: function _convertRect(x1, y1, w, h) {
  21325. // flip y1 and y2
  21326. var y2 = y1;
  21327. y1 += h; // make x2
  21328. var x2 = x1 + w; // apply current transformation matrix to points
  21329. var _this$_ctm = _slicedToArray(this._ctm, 6),
  21330. m0 = _this$_ctm[0],
  21331. m1 = _this$_ctm[1],
  21332. m2 = _this$_ctm[2],
  21333. m3 = _this$_ctm[3],
  21334. m4 = _this$_ctm[4],
  21335. m5 = _this$_ctm[5];
  21336. x1 = m0 * x1 + m2 * y1 + m4;
  21337. y1 = m1 * x1 + m3 * y1 + m5;
  21338. x2 = m0 * x2 + m2 * y2 + m4;
  21339. y2 = m1 * x2 + m3 * y2 + m5;
  21340. return [x1, y1, x2, y2];
  21341. }
  21342. };
  21343. var PDFOutline = /*#__PURE__*/function () {
  21344. function PDFOutline(document, parent, title, dest) {
  21345. var options = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {
  21346. expanded: false
  21347. };
  21348. _classCallCheck(this, PDFOutline);
  21349. this.document = document;
  21350. this.options = options;
  21351. this.outlineData = {};
  21352. if (dest !== null) {
  21353. this.outlineData['Dest'] = [dest.dictionary, 'Fit'];
  21354. }
  21355. if (parent !== null) {
  21356. this.outlineData['Parent'] = parent;
  21357. }
  21358. if (title !== null) {
  21359. this.outlineData['Title'] = new String(title);
  21360. }
  21361. this.dictionary = this.document.ref(this.outlineData);
  21362. this.children = [];
  21363. }
  21364. _createClass(PDFOutline, [{
  21365. key: "addItem",
  21366. value: function addItem(title) {
  21367. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
  21368. expanded: false
  21369. };
  21370. var result = new PDFOutline(this.document, this.dictionary, title, this.document.page, options);
  21371. this.children.push(result);
  21372. return result;
  21373. }
  21374. }, {
  21375. key: "endOutline",
  21376. value: function endOutline() {
  21377. if (this.children.length > 0) {
  21378. if (this.options.expanded) {
  21379. this.outlineData.Count = this.children.length;
  21380. }
  21381. var first = this.children[0],
  21382. last = this.children[this.children.length - 1];
  21383. this.outlineData.First = first.dictionary;
  21384. this.outlineData.Last = last.dictionary;
  21385. for (var i = 0, len = this.children.length; i < len; i++) {
  21386. var child = this.children[i];
  21387. if (i > 0) {
  21388. child.outlineData.Prev = this.children[i - 1].dictionary;
  21389. }
  21390. if (i < this.children.length - 1) {
  21391. child.outlineData.Next = this.children[i + 1].dictionary;
  21392. }
  21393. child.endOutline();
  21394. }
  21395. }
  21396. return this.dictionary.end();
  21397. }
  21398. }]);
  21399. return PDFOutline;
  21400. }();
  21401. var OutlineMixin = {
  21402. initOutline: function initOutline() {
  21403. return this.outline = new PDFOutline(this, null, null, null);
  21404. },
  21405. endOutline: function endOutline() {
  21406. this.outline.endOutline();
  21407. if (this.outline.children.length > 0) {
  21408. this._root.data.Outlines = this.outline.dictionary;
  21409. return this._root.data.PageMode = 'UseOutlines';
  21410. }
  21411. }
  21412. };
  21413. var FIELD_FLAGS = {
  21414. readOnly: 1,
  21415. required: 2,
  21416. noExport: 4,
  21417. multiline: 0x1000,
  21418. password: 0x2000,
  21419. toggleToOffButton: 0x4000,
  21420. radioButton: 0x8000,
  21421. pushButton: 0x10000,
  21422. combo: 0x20000,
  21423. edit: 0x40000,
  21424. sort: 0x80000,
  21425. multiSelect: 0x200000,
  21426. noSpell: 0x400000
  21427. };
  21428. var FIELD_JUSTIFY = {
  21429. left: 0,
  21430. center: 1,
  21431. right: 2
  21432. };
  21433. var VALUE_MAP = {
  21434. value: 'V',
  21435. defaultValue: 'DV'
  21436. };
  21437. var FORMAT_SPECIAL = {
  21438. zip: '0',
  21439. zipPlus4: '1',
  21440. zip4: '1',
  21441. phone: '2',
  21442. ssn: '3'
  21443. };
  21444. var FORMAT_DEFAULT = {
  21445. number: {
  21446. nDec: 0,
  21447. sepComma: false,
  21448. negStyle: 'MinusBlack',
  21449. currency: '',
  21450. currencyPrepend: true
  21451. },
  21452. percent: {
  21453. nDec: 0,
  21454. sepComma: false
  21455. }
  21456. };
  21457. var AcroFormMixin = {
  21458. /**
  21459. * Must call if adding AcroForms to a document. Must also call font() before
  21460. * this method to set the default font.
  21461. */
  21462. initForm: function initForm() {
  21463. if (!this._font) {
  21464. throw new Error('Must set a font before calling initForm method');
  21465. }
  21466. this._acroform = {
  21467. fonts: {},
  21468. defaultFont: this._font.name
  21469. };
  21470. this._acroform.fonts[this._font.id] = this._font.ref();
  21471. var data = {
  21472. Fields: [],
  21473. NeedAppearances: true,
  21474. DA: new String("/".concat(this._font.id, " 0 Tf 0 g")),
  21475. DR: {
  21476. Font: {}
  21477. }
  21478. };
  21479. data.DR.Font[this._font.id] = this._font.ref();
  21480. var AcroForm = this.ref(data);
  21481. this._root.data.AcroForm = AcroForm;
  21482. return this;
  21483. },
  21484. /**
  21485. * Called automatically by document.js
  21486. */
  21487. endAcroForm: function endAcroForm() {
  21488. var _this = this;
  21489. if (this._root.data.AcroForm) {
  21490. if (!Object.keys(this._acroform.fonts).length && !this._acroform.defaultFont) {
  21491. throw new Error('No fonts specified for PDF form');
  21492. }
  21493. var fontDict = this._root.data.AcroForm.data.DR.Font;
  21494. Object.keys(this._acroform.fonts).forEach(function (name) {
  21495. fontDict[name] = _this._acroform.fonts[name];
  21496. });
  21497. this._root.data.AcroForm.data.Fields.forEach(function (fieldRef) {
  21498. _this._endChild(fieldRef);
  21499. });
  21500. this._root.data.AcroForm.end();
  21501. }
  21502. return this;
  21503. },
  21504. _endChild: function _endChild(ref) {
  21505. var _this2 = this;
  21506. if (Array.isArray(ref.data.Kids)) {
  21507. ref.data.Kids.forEach(function (childRef) {
  21508. _this2._endChild(childRef);
  21509. });
  21510. ref.end();
  21511. }
  21512. return this;
  21513. },
  21514. /**
  21515. * Creates and adds a form field to the document. Form fields are intermediate
  21516. * nodes in a PDF form that are used to specify form name heirarchy and form
  21517. * value defaults.
  21518. * @param {string} name - field name (T attribute in field dictionary)
  21519. * @param {object} options - other attributes to include in field dictionary
  21520. */
  21521. formField: function formField(name) {
  21522. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  21523. var fieldDict = this._fieldDict(name, null, options);
  21524. var fieldRef = this.ref(fieldDict);
  21525. this._addToParent(fieldRef);
  21526. return fieldRef;
  21527. },
  21528. /**
  21529. * Creates and adds a Form Annotation to the document. Form annotations are
  21530. * called Widget annotations internally within a PDF file.
  21531. * @param {string} name - form field name (T attribute of widget annotation
  21532. * dictionary)
  21533. * @param {number} x
  21534. * @param {number} y
  21535. * @param {number} w
  21536. * @param {number} h
  21537. * @param {object} options
  21538. */
  21539. formAnnotation: function formAnnotation(name, type, x, y, w, h) {
  21540. var options = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : {};
  21541. var fieldDict = this._fieldDict(name, type, options);
  21542. fieldDict.Subtype = 'Widget';
  21543. if (fieldDict.F === undefined) {
  21544. fieldDict.F = 4; // print the annotation
  21545. } // Add Field annot to page, and get it's ref
  21546. this.annotate(x, y, w, h, fieldDict);
  21547. var annotRef = this.page.annotations[this.page.annotations.length - 1];
  21548. return this._addToParent(annotRef);
  21549. },
  21550. formText: function formText(name, x, y, w, h) {
  21551. var options = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {};
  21552. return this.formAnnotation(name, 'text', x, y, w, h, options);
  21553. },
  21554. formPushButton: function formPushButton(name, x, y, w, h) {
  21555. var options = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {};
  21556. return this.formAnnotation(name, 'pushButton', x, y, w, h, options);
  21557. },
  21558. formCombo: function formCombo(name, x, y, w, h) {
  21559. var options = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {};
  21560. return this.formAnnotation(name, 'combo', x, y, w, h, options);
  21561. },
  21562. formList: function formList(name, x, y, w, h) {
  21563. var options = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {};
  21564. return this.formAnnotation(name, 'list', x, y, w, h, options);
  21565. },
  21566. formRadioButton: function formRadioButton(name, x, y, w, h) {
  21567. var options = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {};
  21568. return this.formAnnotation(name, 'radioButton', x, y, w, h, options);
  21569. },
  21570. formCheckbox: function formCheckbox(name, x, y, w, h) {
  21571. var options = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {};
  21572. return this.formAnnotation(name, 'checkbox', x, y, w, h, options);
  21573. },
  21574. _addToParent: function _addToParent(fieldRef) {
  21575. var parent = fieldRef.data.Parent;
  21576. if (parent) {
  21577. if (!parent.data.Kids) {
  21578. parent.data.Kids = [];
  21579. }
  21580. parent.data.Kids.push(fieldRef);
  21581. } else {
  21582. this._root.data.AcroForm.data.Fields.push(fieldRef);
  21583. }
  21584. return this;
  21585. },
  21586. _fieldDict: function _fieldDict(name, type) {
  21587. var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  21588. if (!this._acroform) {
  21589. throw new Error('Call document.initForms() method before adding form elements to document');
  21590. }
  21591. var opts = Object.assign({}, options);
  21592. if (type !== null) {
  21593. opts = this._resolveType(type, options);
  21594. }
  21595. opts = this._resolveFlags(opts);
  21596. opts = this._resolveJustify(opts);
  21597. opts = this._resolveFont(opts);
  21598. opts = this._resolveStrings(opts);
  21599. opts = this._resolveColors(opts);
  21600. opts = this._resolveFormat(opts);
  21601. opts.T = new String(name);
  21602. if (opts.parent) {
  21603. opts.Parent = opts.parent;
  21604. delete opts.parent;
  21605. }
  21606. return opts;
  21607. },
  21608. _resolveType: function _resolveType(type, opts) {
  21609. if (type === 'text') {
  21610. opts.FT = 'Tx';
  21611. } else if (type === 'pushButton') {
  21612. opts.FT = 'Btn';
  21613. opts.pushButton = true;
  21614. } else if (type === 'radioButton') {
  21615. opts.FT = 'Btn';
  21616. opts.radioButton = true;
  21617. } else if (type === 'checkbox') {
  21618. opts.FT = 'Btn';
  21619. } else if (type === 'combo') {
  21620. opts.FT = 'Ch';
  21621. opts.combo = true;
  21622. } else if (type === 'list') {
  21623. opts.FT = 'Ch';
  21624. } else {
  21625. throw new Error("Invalid form annotation type '".concat(type, "'"));
  21626. }
  21627. return opts;
  21628. },
  21629. _resolveFormat: function _resolveFormat(opts) {
  21630. var f = opts.format;
  21631. if (f && f.type) {
  21632. var fnKeystroke;
  21633. var fnFormat;
  21634. var params = '';
  21635. if (FORMAT_SPECIAL[f.type] !== undefined) {
  21636. fnKeystroke = "AFSpecial_Keystroke";
  21637. fnFormat = "AFSpecial_Format";
  21638. params = FORMAT_SPECIAL[f.type];
  21639. } else {
  21640. var format = f.type.charAt(0).toUpperCase() + f.type.slice(1);
  21641. fnKeystroke = "AF".concat(format, "_Keystroke");
  21642. fnFormat = "AF".concat(format, "_Format");
  21643. if (f.type === 'date') {
  21644. fnKeystroke += 'Ex';
  21645. params = String(f.param);
  21646. } else if (f.type === 'time') {
  21647. params = String(f.param);
  21648. } else if (f.type === 'number') {
  21649. var p = Object.assign({}, FORMAT_DEFAULT.number, f);
  21650. params = String([String(p.nDec), p.sepComma ? '0' : '1', '"' + p.negStyle + '"', 'null', '"' + p.currency + '"', String(p.currencyPrepend)].join(','));
  21651. } else if (f.type === 'percent') {
  21652. var _p = Object.assign({}, FORMAT_DEFAULT.percent, f);
  21653. params = String([String(_p.nDec), _p.sepComma ? '0' : '1'].join(','));
  21654. }
  21655. }
  21656. opts.AA = opts.AA ? opts.AA : {};
  21657. opts.AA.K = {
  21658. S: 'JavaScript',
  21659. JS: new String("".concat(fnKeystroke, "(").concat(params, ");"))
  21660. };
  21661. opts.AA.F = {
  21662. S: 'JavaScript',
  21663. JS: new String("".concat(fnFormat, "(").concat(params, ");"))
  21664. };
  21665. }
  21666. delete opts.format;
  21667. return opts;
  21668. },
  21669. _resolveColors: function _resolveColors(opts) {
  21670. var color = this._normalizeColor(opts.backgroundColor);
  21671. if (color) {
  21672. if (!opts.MK) {
  21673. opts.MK = {};
  21674. }
  21675. opts.MK.BG = color;
  21676. }
  21677. color = this._normalizeColor(opts.borderColor);
  21678. if (color) {
  21679. if (!opts.MK) {
  21680. opts.MK = {};
  21681. }
  21682. opts.MK.BC = color;
  21683. }
  21684. delete opts.backgroundColor;
  21685. delete opts.borderColor;
  21686. return opts;
  21687. },
  21688. _resolveFlags: function _resolveFlags(options) {
  21689. var result = 0;
  21690. Object.keys(options).forEach(function (key) {
  21691. if (FIELD_FLAGS[key]) {
  21692. result |= FIELD_FLAGS[key];
  21693. delete options[key];
  21694. }
  21695. });
  21696. if (result !== 0) {
  21697. options.Ff = options.Ff ? options.Ff : 0;
  21698. options.Ff |= result;
  21699. }
  21700. return options;
  21701. },
  21702. _resolveJustify: function _resolveJustify(options) {
  21703. var result = 0;
  21704. if (options.align !== undefined) {
  21705. if (typeof FIELD_JUSTIFY[options.align] === 'number') {
  21706. result = FIELD_JUSTIFY[options.align];
  21707. }
  21708. delete options.align;
  21709. }
  21710. if (result !== 0) {
  21711. options.Q = result; // default
  21712. }
  21713. return options;
  21714. },
  21715. _resolveFont: function _resolveFont(options) {
  21716. // add current font to document-level AcroForm dict if necessary
  21717. if (this._acroform.fonts[this._font.id] === null) {
  21718. this._acroform.fonts[this._font.id] = this._font.ref();
  21719. } // add current font to field's resource dict (RD) if not the default acroform font
  21720. if (this._acroform.defaultFont !== this._font.name) {
  21721. options.DR = {
  21722. Font: {}
  21723. };
  21724. options.DR.Font[this._font.id] = this._font.ref();
  21725. options.DA = new String("/".concat(this._font.id, " 0 Tf 0 g"));
  21726. }
  21727. return options;
  21728. },
  21729. _resolveStrings: function _resolveStrings(options) {
  21730. var select = [];
  21731. function appendChoices(a) {
  21732. if (Array.isArray(a)) {
  21733. for (var idx = 0; idx < a.length; idx++) {
  21734. if (typeof a[idx] === 'string') {
  21735. select.push(new String(a[idx]));
  21736. } else {
  21737. select.push(a[idx]);
  21738. }
  21739. }
  21740. }
  21741. }
  21742. appendChoices(options.Opt);
  21743. if (options.select) {
  21744. appendChoices(options.select);
  21745. delete options.select;
  21746. }
  21747. if (select.length) {
  21748. options.Opt = select;
  21749. }
  21750. if (options.value || options.defaultValue) ;
  21751. Object.keys(VALUE_MAP).forEach(function (key) {
  21752. if (options[key] !== undefined) {
  21753. options[VALUE_MAP[key]] = options[key];
  21754. delete options[key];
  21755. }
  21756. });
  21757. ['V', 'DV'].forEach(function (key) {
  21758. if (typeof options[key] === 'string') {
  21759. options[key] = new String(options[key]);
  21760. }
  21761. });
  21762. if (options.MK && options.MK.CA) {
  21763. options.MK.CA = new String(options.MK.CA);
  21764. }
  21765. if (options.label) {
  21766. options.MK = options.MK ? options.MK : {};
  21767. options.MK.CA = new String(options.label);
  21768. delete options.label;
  21769. }
  21770. return options;
  21771. }
  21772. };
  21773. var PDFDocument = /*#__PURE__*/function (_stream$Readable) {
  21774. _inherits(PDFDocument, _stream$Readable);
  21775. function PDFDocument() {
  21776. var _this;
  21777. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  21778. _classCallCheck(this, PDFDocument);
  21779. _this = _possibleConstructorReturn(this, _getPrototypeOf(PDFDocument).call(this, options));
  21780. _this.options = options; // PDF version
  21781. switch (options.pdfVersion) {
  21782. case '1.4':
  21783. _this.version = 1.4;
  21784. break;
  21785. case '1.5':
  21786. _this.version = 1.5;
  21787. break;
  21788. case '1.6':
  21789. _this.version = 1.6;
  21790. break;
  21791. case '1.7':
  21792. case '1.7ext3':
  21793. _this.version = 1.7;
  21794. break;
  21795. default:
  21796. _this.version = 1.3;
  21797. break;
  21798. } // Whether streams should be compressed
  21799. _this.compress = _this.options.compress != null ? _this.options.compress : true;
  21800. _this._pageBuffer = [];
  21801. _this._pageBufferStart = 0; // The PDF object store
  21802. _this._offsets = [];
  21803. _this._waiting = 0;
  21804. _this._ended = false;
  21805. _this._offset = 0;
  21806. var Pages = _this.ref({
  21807. Type: 'Pages',
  21808. Count: 0,
  21809. Kids: []
  21810. });
  21811. var Names = _this.ref({
  21812. Dests: new PDFNameTree()
  21813. });
  21814. _this._root = _this.ref({
  21815. Type: 'Catalog',
  21816. Pages: Pages,
  21817. Names: Names
  21818. }); // The current page
  21819. _this.page = null; // Initialize mixins
  21820. _this.initColor();
  21821. _this.initVector();
  21822. _this.initFonts(options.font);
  21823. _this.initText();
  21824. _this.initImages();
  21825. _this.initOutline(); // Initialize the metadata
  21826. _this.info = {
  21827. Producer: 'PDFKit',
  21828. Creator: 'PDFKit',
  21829. CreationDate: new Date()
  21830. };
  21831. if (_this.options.info) {
  21832. for (var key in _this.options.info) {
  21833. var val = _this.options.info[key];
  21834. _this.info[key] = val;
  21835. }
  21836. } // Generate file ID
  21837. _this._id = PDFSecurity.generateFileID(_this.info); // Initialize security settings
  21838. _this._security = PDFSecurity.create(_assertThisInitialized(_this), options); // Write the header
  21839. // PDF version
  21840. _this._write("%PDF-".concat(_this.version)); // 4 binary chars, as recommended by the spec
  21841. _this._write('%\xFF\xFF\xFF\xFF'); // Add the first page
  21842. if (_this.options.autoFirstPage !== false) {
  21843. _this.addPage();
  21844. }
  21845. return _this;
  21846. }
  21847. _createClass(PDFDocument, [{
  21848. key: "addPage",
  21849. value: function addPage(options) {
  21850. // end the current page if needed
  21851. if (options == null) {
  21852. options = this.options;
  21853. }
  21854. if (!this.options.bufferPages) {
  21855. this.flushPages();
  21856. } // create a page object
  21857. this.page = new PDFPage(this, options);
  21858. this._pageBuffer.push(this.page); // add the page to the object store
  21859. var pages = this._root.data.Pages.data;
  21860. pages.Kids.push(this.page.dictionary);
  21861. pages.Count++; // reset x and y coordinates
  21862. this.x = this.page.margins.left;
  21863. this.y = this.page.margins.top; // flip PDF coordinate system so that the origin is in
  21864. // the top left rather than the bottom left
  21865. this._ctm = [1, 0, 0, 1, 0, 0];
  21866. this.transform(1, 0, 0, -1, 0, this.page.height);
  21867. this.emit('pageAdded');
  21868. return this;
  21869. }
  21870. }, {
  21871. key: "bufferedPageRange",
  21872. value: function bufferedPageRange() {
  21873. return {
  21874. start: this._pageBufferStart,
  21875. count: this._pageBuffer.length
  21876. };
  21877. }
  21878. }, {
  21879. key: "switchToPage",
  21880. value: function switchToPage(n) {
  21881. var page;
  21882. if (!(page = this._pageBuffer[n - this._pageBufferStart])) {
  21883. throw new Error("switchToPage(".concat(n, ") out of bounds, current buffer covers pages ").concat(this._pageBufferStart, " to ").concat(this._pageBufferStart + this._pageBuffer.length - 1));
  21884. }
  21885. return this.page = page;
  21886. }
  21887. }, {
  21888. key: "flushPages",
  21889. value: function flushPages() {
  21890. // this local variable exists so we're future-proof against
  21891. // reentrant calls to flushPages.
  21892. var pages = this._pageBuffer;
  21893. this._pageBuffer = [];
  21894. this._pageBufferStart += pages.length;
  21895. var _iteratorNormalCompletion = true;
  21896. var _didIteratorError = false;
  21897. var _iteratorError = undefined;
  21898. try {
  21899. for (var _iterator = pages[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
  21900. var page = _step.value;
  21901. page.end();
  21902. }
  21903. } catch (err) {
  21904. _didIteratorError = true;
  21905. _iteratorError = err;
  21906. } finally {
  21907. try {
  21908. if (!_iteratorNormalCompletion && _iterator.return != null) {
  21909. _iterator.return();
  21910. }
  21911. } finally {
  21912. if (_didIteratorError) {
  21913. throw _iteratorError;
  21914. }
  21915. }
  21916. }
  21917. }
  21918. }, {
  21919. key: "addNamedDestination",
  21920. value: function addNamedDestination(name) {
  21921. for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  21922. args[_key - 1] = arguments[_key];
  21923. }
  21924. if (args.length === 0) {
  21925. args = ['XYZ', null, null, null];
  21926. }
  21927. if (args[0] === 'XYZ' && args[2] !== null) {
  21928. args[2] = this.page.height - args[2];
  21929. }
  21930. args.unshift(this.page.dictionary);
  21931. this._root.data.Names.data.Dests.add(name, args);
  21932. }
  21933. }, {
  21934. key: "addNamedJavaScript",
  21935. value: function addNamedJavaScript(name, js) {
  21936. if (!this._root.data.Names.data.JavaScript) {
  21937. this._root.data.Names.data.JavaScript = new PDFNameTree();
  21938. }
  21939. var data = {
  21940. JS: new String(js),
  21941. S: 'JavaScript'
  21942. };
  21943. this._root.data.Names.data.JavaScript.add(name, data);
  21944. }
  21945. }, {
  21946. key: "ref",
  21947. value: function ref(data) {
  21948. var ref = new PDFReference(this, this._offsets.length + 1, data);
  21949. this._offsets.push(null); // placeholder for this object's offset once it is finalized
  21950. this._waiting++;
  21951. return ref;
  21952. }
  21953. }, {
  21954. key: "_read",
  21955. value: function _read() {} // do nothing, but this method is required by node
  21956. }, {
  21957. key: "_write",
  21958. value: function _write(data) {
  21959. if (!Buffer.isBuffer(data)) {
  21960. data = new Buffer(data + '\n', 'binary');
  21961. }
  21962. this.push(data);
  21963. return this._offset += data.length;
  21964. }
  21965. }, {
  21966. key: "addContent",
  21967. value: function addContent(data) {
  21968. this.page.write(data);
  21969. return this;
  21970. }
  21971. }, {
  21972. key: "_refEnd",
  21973. value: function _refEnd(ref) {
  21974. this._offsets[ref.id - 1] = ref.offset;
  21975. if (--this._waiting === 0 && this._ended) {
  21976. this._finalize();
  21977. return this._ended = false;
  21978. }
  21979. }
  21980. }, {
  21981. key: "write",
  21982. value: function write(filename, fn) {
  21983. // print a deprecation warning with a stacktrace
  21984. var err = new Error("PDFDocument#write is deprecated, and will be removed in a future version of PDFKit. Please pipe the document into a Node stream.");
  21985. console.warn(err.stack);
  21986. this.pipe(fs.createWriteStream(filename));
  21987. this.end();
  21988. return this.once('end', fn);
  21989. }
  21990. }, {
  21991. key: "end",
  21992. value: function end() {
  21993. this.flushPages();
  21994. this._info = this.ref();
  21995. for (var key in this.info) {
  21996. var val = this.info[key];
  21997. if (typeof val === 'string') {
  21998. val = new String(val);
  21999. }
  22000. var entry = this.ref(val);
  22001. entry.end();
  22002. this._info.data[key] = entry;
  22003. }
  22004. this._info.end();
  22005. for (var name in this._fontFamilies) {
  22006. var font = this._fontFamilies[name];
  22007. font.finalize();
  22008. }
  22009. this.endOutline();
  22010. this._root.end();
  22011. this._root.data.Pages.end();
  22012. this._root.data.Names.end();
  22013. this.endAcroForm();
  22014. if (this._security) {
  22015. this._security.end();
  22016. }
  22017. if (this._waiting === 0) {
  22018. return this._finalize();
  22019. } else {
  22020. return this._ended = true;
  22021. }
  22022. }
  22023. }, {
  22024. key: "_finalize",
  22025. value: function _finalize(fn) {
  22026. // generate xref
  22027. var xRefOffset = this._offset;
  22028. this._write('xref');
  22029. this._write("0 ".concat(this._offsets.length + 1));
  22030. this._write('0000000000 65535 f ');
  22031. var _iteratorNormalCompletion2 = true;
  22032. var _didIteratorError2 = false;
  22033. var _iteratorError2 = undefined;
  22034. try {
  22035. for (var _iterator2 = this._offsets[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
  22036. var offset = _step2.value;
  22037. offset = "0000000000".concat(offset).slice(-10);
  22038. this._write(offset + ' 00000 n ');
  22039. } // trailer
  22040. } catch (err) {
  22041. _didIteratorError2 = true;
  22042. _iteratorError2 = err;
  22043. } finally {
  22044. try {
  22045. if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
  22046. _iterator2.return();
  22047. }
  22048. } finally {
  22049. if (_didIteratorError2) {
  22050. throw _iteratorError2;
  22051. }
  22052. }
  22053. }
  22054. var trailer = {
  22055. Size: this._offsets.length + 1,
  22056. Root: this._root,
  22057. Info: this._info,
  22058. ID: [this._id, this._id]
  22059. };
  22060. if (this._security) {
  22061. trailer.Encrypt = this._security.dictionary;
  22062. }
  22063. this._write('trailer');
  22064. this._write(PDFObject.convert(trailer));
  22065. this._write('startxref');
  22066. this._write("".concat(xRefOffset));
  22067. this._write('%%EOF'); // end the stream
  22068. return this.push(null);
  22069. }
  22070. }, {
  22071. key: "toString",
  22072. value: function toString() {
  22073. return '[object PDFDocument]';
  22074. }
  22075. }]);
  22076. return PDFDocument;
  22077. }(_stream.default.Readable);
  22078. var mixin = function mixin(methods) {
  22079. Object.assign(PDFDocument.prototype, methods);
  22080. };
  22081. mixin(ColorMixin);
  22082. mixin(VectorMixin);
  22083. mixin(FontsMixin);
  22084. mixin(TextMixin);
  22085. mixin(ImagesMixin);
  22086. mixin(AnnotationsMixin);
  22087. mixin(OutlineMixin);
  22088. mixin(AcroFormMixin);
  22089. var _default = PDFDocument;
  22090. exports.default = _default;
  22091. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(4).Buffer, "/"))
  22092. /***/ }),
  22093. /* 222 */
  22094. /***/ (function(module, exports, __webpack_require__) {
  22095. "use strict";
  22096. // B.2.3.12 String.prototype.strike()
  22097. __webpack_require__(133)('strike', function (createHTML) {
  22098. return function strike() {
  22099. return createHTML(this, 'strike', '', '');
  22100. };
  22101. });
  22102. /***/ }),
  22103. /* 223 */
  22104. /***/ (function(module, exports, __webpack_require__) {
  22105. module.exports = __webpack_require__(61)('native-function-to-string', Function.toString);
  22106. /***/ }),
  22107. /* 224 */
  22108. /***/ (function(module, exports, __webpack_require__) {
  22109. // 19.1.3.1 Object.assign(target, source)
  22110. var $export = __webpack_require__(5);
  22111. $export($export.S + $export.F, 'Object', { assign: __webpack_require__(225) });
  22112. /***/ }),
  22113. /* 225 */
  22114. /***/ (function(module, exports, __webpack_require__) {
  22115. "use strict";
  22116. // 19.1.2.1 Object.assign(target, source, ...)
  22117. var DESCRIPTORS = __webpack_require__(9);
  22118. var getKeys = __webpack_require__(42);
  22119. var gOPS = __webpack_require__(89);
  22120. var pIE = __webpack_require__(62);
  22121. var toObject = __webpack_require__(19);
  22122. var IObject = __webpack_require__(85);
  22123. var $assign = Object.assign;
  22124. // should work with symbols and should have deterministic property order (V8 bug)
  22125. module.exports = !$assign || __webpack_require__(10)(function () {
  22126. var A = {};
  22127. var B = {};
  22128. // eslint-disable-next-line no-undef
  22129. var S = Symbol();
  22130. var K = 'abcdefghijklmnopqrst';
  22131. A[S] = 7;
  22132. K.split('').forEach(function (k) { B[k] = k; });
  22133. return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;
  22134. }) ? function assign(target, source) { // eslint-disable-line no-unused-vars
  22135. var T = toObject(target);
  22136. var aLen = arguments.length;
  22137. var index = 1;
  22138. var getSymbols = gOPS.f;
  22139. var isEnum = pIE.f;
  22140. while (aLen > index) {
  22141. var S = IObject(arguments[index++]);
  22142. var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S);
  22143. var length = keys.length;
  22144. var j = 0;
  22145. var key;
  22146. while (length > j) {
  22147. key = keys[j++];
  22148. if (!DESCRIPTORS || isEnum.call(S, key)) T[key] = S[key];
  22149. }
  22150. } return T;
  22151. } : $assign;
  22152. /***/ }),
  22153. /* 226 */
  22154. /***/ (function(module, exports, __webpack_require__) {
  22155. "use strict";
  22156. var global = __webpack_require__(8);
  22157. var DESCRIPTORS = __webpack_require__(9);
  22158. var LIBRARY = __webpack_require__(41);
  22159. var $typed = __webpack_require__(141);
  22160. var hide = __webpack_require__(15);
  22161. var redefineAll = __webpack_require__(142);
  22162. var fails = __webpack_require__(10);
  22163. var anInstance = __webpack_require__(143);
  22164. var toInteger = __webpack_require__(31);
  22165. var toLength = __webpack_require__(16);
  22166. var toIndex = __webpack_require__(144);
  22167. var gOPN = __webpack_require__(55).f;
  22168. var dP = __webpack_require__(11).f;
  22169. var arrayFill = __webpack_require__(90);
  22170. var setToStringTag = __webpack_require__(63);
  22171. var ARRAY_BUFFER = 'ArrayBuffer';
  22172. var DATA_VIEW = 'DataView';
  22173. var PROTOTYPE = 'prototype';
  22174. var WRONG_LENGTH = 'Wrong length!';
  22175. var WRONG_INDEX = 'Wrong index!';
  22176. var $ArrayBuffer = global[ARRAY_BUFFER];
  22177. var $DataView = global[DATA_VIEW];
  22178. var Math = global.Math;
  22179. var RangeError = global.RangeError;
  22180. // eslint-disable-next-line no-shadow-restricted-names
  22181. var Infinity = global.Infinity;
  22182. var BaseBuffer = $ArrayBuffer;
  22183. var abs = Math.abs;
  22184. var pow = Math.pow;
  22185. var floor = Math.floor;
  22186. var log = Math.log;
  22187. var LN2 = Math.LN2;
  22188. var BUFFER = 'buffer';
  22189. var BYTE_LENGTH = 'byteLength';
  22190. var BYTE_OFFSET = 'byteOffset';
  22191. var $BUFFER = DESCRIPTORS ? '_b' : BUFFER;
  22192. var $LENGTH = DESCRIPTORS ? '_l' : BYTE_LENGTH;
  22193. var $OFFSET = DESCRIPTORS ? '_o' : BYTE_OFFSET;
  22194. // IEEE754 conversions based on https://github.com/feross/ieee754
  22195. function packIEEE754(value, mLen, nBytes) {
  22196. var buffer = new Array(nBytes);
  22197. var eLen = nBytes * 8 - mLen - 1;
  22198. var eMax = (1 << eLen) - 1;
  22199. var eBias = eMax >> 1;
  22200. var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;
  22201. var i = 0;
  22202. var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;
  22203. var e, m, c;
  22204. value = abs(value);
  22205. // eslint-disable-next-line no-self-compare
  22206. if (value != value || value === Infinity) {
  22207. // eslint-disable-next-line no-self-compare
  22208. m = value != value ? 1 : 0;
  22209. e = eMax;
  22210. } else {
  22211. e = floor(log(value) / LN2);
  22212. if (value * (c = pow(2, -e)) < 1) {
  22213. e--;
  22214. c *= 2;
  22215. }
  22216. if (e + eBias >= 1) {
  22217. value += rt / c;
  22218. } else {
  22219. value += rt * pow(2, 1 - eBias);
  22220. }
  22221. if (value * c >= 2) {
  22222. e++;
  22223. c /= 2;
  22224. }
  22225. if (e + eBias >= eMax) {
  22226. m = 0;
  22227. e = eMax;
  22228. } else if (e + eBias >= 1) {
  22229. m = (value * c - 1) * pow(2, mLen);
  22230. e = e + eBias;
  22231. } else {
  22232. m = value * pow(2, eBias - 1) * pow(2, mLen);
  22233. e = 0;
  22234. }
  22235. }
  22236. for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);
  22237. e = e << mLen | m;
  22238. eLen += mLen;
  22239. for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);
  22240. buffer[--i] |= s * 128;
  22241. return buffer;
  22242. }
  22243. function unpackIEEE754(buffer, mLen, nBytes) {
  22244. var eLen = nBytes * 8 - mLen - 1;
  22245. var eMax = (1 << eLen) - 1;
  22246. var eBias = eMax >> 1;
  22247. var nBits = eLen - 7;
  22248. var i = nBytes - 1;
  22249. var s = buffer[i--];
  22250. var e = s & 127;
  22251. var m;
  22252. s >>= 7;
  22253. for (; nBits > 0; e = e * 256 + buffer[i], i--, nBits -= 8);
  22254. m = e & (1 << -nBits) - 1;
  22255. e >>= -nBits;
  22256. nBits += mLen;
  22257. for (; nBits > 0; m = m * 256 + buffer[i], i--, nBits -= 8);
  22258. if (e === 0) {
  22259. e = 1 - eBias;
  22260. } else if (e === eMax) {
  22261. return m ? NaN : s ? -Infinity : Infinity;
  22262. } else {
  22263. m = m + pow(2, mLen);
  22264. e = e - eBias;
  22265. } return (s ? -1 : 1) * m * pow(2, e - mLen);
  22266. }
  22267. function unpackI32(bytes) {
  22268. return bytes[3] << 24 | bytes[2] << 16 | bytes[1] << 8 | bytes[0];
  22269. }
  22270. function packI8(it) {
  22271. return [it & 0xff];
  22272. }
  22273. function packI16(it) {
  22274. return [it & 0xff, it >> 8 & 0xff];
  22275. }
  22276. function packI32(it) {
  22277. return [it & 0xff, it >> 8 & 0xff, it >> 16 & 0xff, it >> 24 & 0xff];
  22278. }
  22279. function packF64(it) {
  22280. return packIEEE754(it, 52, 8);
  22281. }
  22282. function packF32(it) {
  22283. return packIEEE754(it, 23, 4);
  22284. }
  22285. function addGetter(C, key, internal) {
  22286. dP(C[PROTOTYPE], key, { get: function () { return this[internal]; } });
  22287. }
  22288. function get(view, bytes, index, isLittleEndian) {
  22289. var numIndex = +index;
  22290. var intIndex = toIndex(numIndex);
  22291. if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX);
  22292. var store = view[$BUFFER]._b;
  22293. var start = intIndex + view[$OFFSET];
  22294. var pack = store.slice(start, start + bytes);
  22295. return isLittleEndian ? pack : pack.reverse();
  22296. }
  22297. function set(view, bytes, index, conversion, value, isLittleEndian) {
  22298. var numIndex = +index;
  22299. var intIndex = toIndex(numIndex);
  22300. if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX);
  22301. var store = view[$BUFFER]._b;
  22302. var start = intIndex + view[$OFFSET];
  22303. var pack = conversion(+value);
  22304. for (var i = 0; i < bytes; i++) store[start + i] = pack[isLittleEndian ? i : bytes - i - 1];
  22305. }
  22306. if (!$typed.ABV) {
  22307. $ArrayBuffer = function ArrayBuffer(length) {
  22308. anInstance(this, $ArrayBuffer, ARRAY_BUFFER);
  22309. var byteLength = toIndex(length);
  22310. this._b = arrayFill.call(new Array(byteLength), 0);
  22311. this[$LENGTH] = byteLength;
  22312. };
  22313. $DataView = function DataView(buffer, byteOffset, byteLength) {
  22314. anInstance(this, $DataView, DATA_VIEW);
  22315. anInstance(buffer, $ArrayBuffer, DATA_VIEW);
  22316. var bufferLength = buffer[$LENGTH];
  22317. var offset = toInteger(byteOffset);
  22318. if (offset < 0 || offset > bufferLength) throw RangeError('Wrong offset!');
  22319. byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength);
  22320. if (offset + byteLength > bufferLength) throw RangeError(WRONG_LENGTH);
  22321. this[$BUFFER] = buffer;
  22322. this[$OFFSET] = offset;
  22323. this[$LENGTH] = byteLength;
  22324. };
  22325. if (DESCRIPTORS) {
  22326. addGetter($ArrayBuffer, BYTE_LENGTH, '_l');
  22327. addGetter($DataView, BUFFER, '_b');
  22328. addGetter($DataView, BYTE_LENGTH, '_l');
  22329. addGetter($DataView, BYTE_OFFSET, '_o');
  22330. }
  22331. redefineAll($DataView[PROTOTYPE], {
  22332. getInt8: function getInt8(byteOffset) {
  22333. return get(this, 1, byteOffset)[0] << 24 >> 24;
  22334. },
  22335. getUint8: function getUint8(byteOffset) {
  22336. return get(this, 1, byteOffset)[0];
  22337. },
  22338. getInt16: function getInt16(byteOffset /* , littleEndian */) {
  22339. var bytes = get(this, 2, byteOffset, arguments[1]);
  22340. return (bytes[1] << 8 | bytes[0]) << 16 >> 16;
  22341. },
  22342. getUint16: function getUint16(byteOffset /* , littleEndian */) {
  22343. var bytes = get(this, 2, byteOffset, arguments[1]);
  22344. return bytes[1] << 8 | bytes[0];
  22345. },
  22346. getInt32: function getInt32(byteOffset /* , littleEndian */) {
  22347. return unpackI32(get(this, 4, byteOffset, arguments[1]));
  22348. },
  22349. getUint32: function getUint32(byteOffset /* , littleEndian */) {
  22350. return unpackI32(get(this, 4, byteOffset, arguments[1])) >>> 0;
  22351. },
  22352. getFloat32: function getFloat32(byteOffset /* , littleEndian */) {
  22353. return unpackIEEE754(get(this, 4, byteOffset, arguments[1]), 23, 4);
  22354. },
  22355. getFloat64: function getFloat64(byteOffset /* , littleEndian */) {
  22356. return unpackIEEE754(get(this, 8, byteOffset, arguments[1]), 52, 8);
  22357. },
  22358. setInt8: function setInt8(byteOffset, value) {
  22359. set(this, 1, byteOffset, packI8, value);
  22360. },
  22361. setUint8: function setUint8(byteOffset, value) {
  22362. set(this, 1, byteOffset, packI8, value);
  22363. },
  22364. setInt16: function setInt16(byteOffset, value /* , littleEndian */) {
  22365. set(this, 2, byteOffset, packI16, value, arguments[2]);
  22366. },
  22367. setUint16: function setUint16(byteOffset, value /* , littleEndian */) {
  22368. set(this, 2, byteOffset, packI16, value, arguments[2]);
  22369. },
  22370. setInt32: function setInt32(byteOffset, value /* , littleEndian */) {
  22371. set(this, 4, byteOffset, packI32, value, arguments[2]);
  22372. },
  22373. setUint32: function setUint32(byteOffset, value /* , littleEndian */) {
  22374. set(this, 4, byteOffset, packI32, value, arguments[2]);
  22375. },
  22376. setFloat32: function setFloat32(byteOffset, value /* , littleEndian */) {
  22377. set(this, 4, byteOffset, packF32, value, arguments[2]);
  22378. },
  22379. setFloat64: function setFloat64(byteOffset, value /* , littleEndian */) {
  22380. set(this, 8, byteOffset, packF64, value, arguments[2]);
  22381. }
  22382. });
  22383. } else {
  22384. if (!fails(function () {
  22385. $ArrayBuffer(1);
  22386. }) || !fails(function () {
  22387. new $ArrayBuffer(-1); // eslint-disable-line no-new
  22388. }) || fails(function () {
  22389. new $ArrayBuffer(); // eslint-disable-line no-new
  22390. new $ArrayBuffer(1.5); // eslint-disable-line no-new
  22391. new $ArrayBuffer(NaN); // eslint-disable-line no-new
  22392. return $ArrayBuffer.name != ARRAY_BUFFER;
  22393. })) {
  22394. $ArrayBuffer = function ArrayBuffer(length) {
  22395. anInstance(this, $ArrayBuffer);
  22396. return new BaseBuffer(toIndex(length));
  22397. };
  22398. var ArrayBufferProto = $ArrayBuffer[PROTOTYPE] = BaseBuffer[PROTOTYPE];
  22399. for (var keys = gOPN(BaseBuffer), j = 0, key; keys.length > j;) {
  22400. if (!((key = keys[j++]) in $ArrayBuffer)) hide($ArrayBuffer, key, BaseBuffer[key]);
  22401. }
  22402. if (!LIBRARY) ArrayBufferProto.constructor = $ArrayBuffer;
  22403. }
  22404. // iOS Safari 7.x bug
  22405. var view = new $DataView(new $ArrayBuffer(2));
  22406. var $setInt8 = $DataView[PROTOTYPE].setInt8;
  22407. view.setInt8(0, 2147483648);
  22408. view.setInt8(1, 2147483649);
  22409. if (view.getInt8(0) || !view.getInt8(1)) redefineAll($DataView[PROTOTYPE], {
  22410. setInt8: function setInt8(byteOffset, value) {
  22411. $setInt8.call(this, byteOffset, value << 24 >> 24);
  22412. },
  22413. setUint8: function setUint8(byteOffset, value) {
  22414. $setInt8.call(this, byteOffset, value << 24 >> 24);
  22415. }
  22416. }, true);
  22417. }
  22418. setToStringTag($ArrayBuffer, ARRAY_BUFFER);
  22419. setToStringTag($DataView, DATA_VIEW);
  22420. hide($DataView[PROTOTYPE], $typed.VIEW, true);
  22421. exports[ARRAY_BUFFER] = $ArrayBuffer;
  22422. exports[DATA_VIEW] = $DataView;
  22423. /***/ }),
  22424. /* 227 */
  22425. /***/ (function(module, exports, __webpack_require__) {
  22426. var dP = __webpack_require__(11);
  22427. var anObject = __webpack_require__(12);
  22428. var getKeys = __webpack_require__(42);
  22429. module.exports = __webpack_require__(9) ? Object.defineProperties : function defineProperties(O, Properties) {
  22430. anObject(O);
  22431. var keys = getKeys(Properties);
  22432. var length = keys.length;
  22433. var i = 0;
  22434. var P;
  22435. while (length > i) dP.f(O, P = keys[i++], Properties[P]);
  22436. return O;
  22437. };
  22438. /***/ }),
  22439. /* 228 */
  22440. /***/ (function(module, exports, __webpack_require__) {
  22441. var document = __webpack_require__(8).document;
  22442. module.exports = document && document.documentElement;
  22443. /***/ }),
  22444. /* 229 */
  22445. /***/ (function(module, exports, __webpack_require__) {
  22446. // 0 -> Array#forEach
  22447. // 1 -> Array#map
  22448. // 2 -> Array#filter
  22449. // 3 -> Array#some
  22450. // 4 -> Array#every
  22451. // 5 -> Array#find
  22452. // 6 -> Array#findIndex
  22453. var ctx = __webpack_require__(52);
  22454. var IObject = __webpack_require__(85);
  22455. var toObject = __webpack_require__(19);
  22456. var toLength = __webpack_require__(16);
  22457. var asc = __webpack_require__(230);
  22458. module.exports = function (TYPE, $create) {
  22459. var IS_MAP = TYPE == 1;
  22460. var IS_FILTER = TYPE == 2;
  22461. var IS_SOME = TYPE == 3;
  22462. var IS_EVERY = TYPE == 4;
  22463. var IS_FIND_INDEX = TYPE == 6;
  22464. var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
  22465. var create = $create || asc;
  22466. return function ($this, callbackfn, that) {
  22467. var O = toObject($this);
  22468. var self = IObject(O);
  22469. var f = ctx(callbackfn, that, 3);
  22470. var length = toLength(self.length);
  22471. var index = 0;
  22472. var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;
  22473. var val, res;
  22474. for (;length > index; index++) if (NO_HOLES || index in self) {
  22475. val = self[index];
  22476. res = f(val, index, O);
  22477. if (TYPE) {
  22478. if (IS_MAP) result[index] = res; // map
  22479. else if (res) switch (TYPE) {
  22480. case 3: return true; // some
  22481. case 5: return val; // find
  22482. case 6: return index; // findIndex
  22483. case 2: result.push(val); // filter
  22484. } else if (IS_EVERY) return false; // every
  22485. }
  22486. }
  22487. return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result;
  22488. };
  22489. };
  22490. /***/ }),
  22491. /* 230 */
  22492. /***/ (function(module, exports, __webpack_require__) {
  22493. // 9.4.2.3 ArraySpeciesCreate(originalArray, length)
  22494. var speciesConstructor = __webpack_require__(231);
  22495. module.exports = function (original, length) {
  22496. return new (speciesConstructor(original))(length);
  22497. };
  22498. /***/ }),
  22499. /* 231 */
  22500. /***/ (function(module, exports, __webpack_require__) {
  22501. var isObject = __webpack_require__(18);
  22502. var isArray = __webpack_require__(148);
  22503. var SPECIES = __webpack_require__(3)('species');
  22504. module.exports = function (original) {
  22505. var C;
  22506. if (isArray(original)) {
  22507. C = original.constructor;
  22508. // cross-realm fallback
  22509. if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
  22510. if (isObject(C)) {
  22511. C = C[SPECIES];
  22512. if (C === null) C = undefined;
  22513. }
  22514. } return C === undefined ? Array : C;
  22515. };
  22516. /***/ }),
  22517. /* 232 */
  22518. /***/ (function(module, exports) {
  22519. module.exports = function (done, value) {
  22520. return { value: value, done: !!done };
  22521. };
  22522. /***/ }),
  22523. /* 233 */
  22524. /***/ (function(module, exports, __webpack_require__) {
  22525. "use strict";
  22526. var create = __webpack_require__(65);
  22527. var descriptor = __webpack_require__(40);
  22528. var setToStringTag = __webpack_require__(63);
  22529. var IteratorPrototype = {};
  22530. // 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
  22531. __webpack_require__(15)(IteratorPrototype, __webpack_require__(3)('iterator'), function () { return this; });
  22532. module.exports = function (Constructor, NAME, next) {
  22533. Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });
  22534. setToStringTag(Constructor, NAME + ' Iterator');
  22535. };
  22536. /***/ }),
  22537. /* 234 */
  22538. /***/ (function(module, exports, __webpack_require__) {
  22539. "use strict";
  22540. var global = __webpack_require__(8);
  22541. var dP = __webpack_require__(11);
  22542. var DESCRIPTORS = __webpack_require__(9);
  22543. var SPECIES = __webpack_require__(3)('species');
  22544. module.exports = function (KEY) {
  22545. var C = global[KEY];
  22546. if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, {
  22547. configurable: true,
  22548. get: function () { return this; }
  22549. });
  22550. };
  22551. /***/ }),
  22552. /* 235 */
  22553. /***/ (function(module, exports, __webpack_require__) {
  22554. "use strict";
  22555. // 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length)
  22556. var toObject = __webpack_require__(19);
  22557. var toAbsoluteIndex = __webpack_require__(54);
  22558. var toLength = __webpack_require__(16);
  22559. module.exports = [].copyWithin || function copyWithin(target /* = 0 */, start /* = 0, end = @length */) {
  22560. var O = toObject(this);
  22561. var len = toLength(O.length);
  22562. var to = toAbsoluteIndex(target, len);
  22563. var from = toAbsoluteIndex(start, len);
  22564. var end = arguments.length > 2 ? arguments[2] : undefined;
  22565. var count = Math.min((end === undefined ? len : toAbsoluteIndex(end, len)) - from, len - to);
  22566. var inc = 1;
  22567. if (from < to && to < from + count) {
  22568. inc = -1;
  22569. from += count - 1;
  22570. to += count - 1;
  22571. }
  22572. while (count-- > 0) {
  22573. if (from in O) O[to] = O[from];
  22574. else delete O[to];
  22575. to += inc;
  22576. from += inc;
  22577. } return O;
  22578. };
  22579. /***/ }),
  22580. /* 236 */
  22581. /***/ (function(module, exports, __webpack_require__) {
  22582. "use strict";
  22583. var regexpExec = __webpack_require__(97);
  22584. __webpack_require__(5)({
  22585. target: 'RegExp',
  22586. proto: true,
  22587. forced: regexpExec !== /./.exec
  22588. }, {
  22589. exec: regexpExec
  22590. });
  22591. /***/ }),
  22592. /* 237 */
  22593. /***/ (function(module, exports, __webpack_require__) {
  22594. var isObject = __webpack_require__(18);
  22595. var setPrototypeOf = __webpack_require__(156).set;
  22596. module.exports = function (that, target, C) {
  22597. var S = target.constructor;
  22598. var P;
  22599. if (S !== C && typeof S == 'function' && (P = S.prototype) !== C.prototype && isObject(P) && setPrototypeOf) {
  22600. setPrototypeOf(that, P);
  22601. } return that;
  22602. };
  22603. /***/ }),
  22604. /* 238 */
  22605. /***/ (function(module, exports, __webpack_require__) {
  22606. var $export = __webpack_require__(5);
  22607. var defined = __webpack_require__(30);
  22608. var fails = __webpack_require__(10);
  22609. var spaces = __webpack_require__(239);
  22610. var space = '[' + spaces + ']';
  22611. var non = '\u200b\u0085';
  22612. var ltrim = RegExp('^' + space + space + '*');
  22613. var rtrim = RegExp(space + space + '*$');
  22614. var exporter = function (KEY, exec, ALIAS) {
  22615. var exp = {};
  22616. var FORCE = fails(function () {
  22617. return !!spaces[KEY]() || non[KEY]() != non;
  22618. });
  22619. var fn = exp[KEY] = FORCE ? exec(trim) : spaces[KEY];
  22620. if (ALIAS) exp[ALIAS] = fn;
  22621. $export($export.P + $export.F * FORCE, 'String', exp);
  22622. };
  22623. // 1 -> String#trimLeft
  22624. // 2 -> String#trimRight
  22625. // 3 -> String#trim
  22626. var trim = exporter.trim = function (string, TYPE) {
  22627. string = String(defined(string));
  22628. if (TYPE & 1) string = string.replace(ltrim, '');
  22629. if (TYPE & 2) string = string.replace(rtrim, '');
  22630. return string;
  22631. };
  22632. module.exports = exporter;
  22633. /***/ }),
  22634. /* 239 */
  22635. /***/ (function(module, exports) {
  22636. module.exports = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003' +
  22637. '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
  22638. /***/ }),
  22639. /* 240 */
  22640. /***/ (function(module, exports, __webpack_require__) {
  22641. // 20.1.2.2 Number.isFinite(number)
  22642. var $export = __webpack_require__(5);
  22643. var _isFinite = __webpack_require__(8).isFinite;
  22644. $export($export.S, 'Number', {
  22645. isFinite: function isFinite(it) {
  22646. return typeof it == 'number' && _isFinite(it);
  22647. }
  22648. });
  22649. /***/ }),
  22650. /* 241 */
  22651. /***/ (function(module, exports, __webpack_require__) {
  22652. // helper for String#{startsWith, endsWith, includes}
  22653. var isRegExp = __webpack_require__(154);
  22654. var defined = __webpack_require__(30);
  22655. module.exports = function (that, searchString, NAME) {
  22656. if (isRegExp(searchString)) throw TypeError('String#' + NAME + " doesn't accept regex!");
  22657. return String(defined(that));
  22658. };
  22659. /***/ }),
  22660. /* 242 */
  22661. /***/ (function(module, exports, __webpack_require__) {
  22662. var MATCH = __webpack_require__(3)('match');
  22663. module.exports = function (KEY) {
  22664. var re = /./;
  22665. try {
  22666. '/./'[KEY](re);
  22667. } catch (e) {
  22668. try {
  22669. re[MATCH] = false;
  22670. return !'/./'[KEY](re);
  22671. } catch (f) { /* empty */ }
  22672. } return true;
  22673. };
  22674. /***/ }),
  22675. /* 243 */
  22676. /***/ (function(module, exports, __webpack_require__) {
  22677. var $export = __webpack_require__(5);
  22678. var toAbsoluteIndex = __webpack_require__(54);
  22679. var fromCharCode = String.fromCharCode;
  22680. var $fromCodePoint = String.fromCodePoint;
  22681. // length should be 1, old FF problem
  22682. $export($export.S + $export.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', {
  22683. // 21.1.2.2 String.fromCodePoint(...codePoints)
  22684. fromCodePoint: function fromCodePoint(x) { // eslint-disable-line no-unused-vars
  22685. var res = [];
  22686. var aLen = arguments.length;
  22687. var i = 0;
  22688. var code;
  22689. while (aLen > i) {
  22690. code = +arguments[i++];
  22691. if (toAbsoluteIndex(code, 0x10ffff) !== code) throw RangeError(code + ' is not a valid code point');
  22692. res.push(code < 0x10000
  22693. ? fromCharCode(code)
  22694. : fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00)
  22695. );
  22696. } return res.join('');
  22697. }
  22698. });
  22699. /***/ }),
  22700. /* 244 */
  22701. /***/ (function(module, exports, __webpack_require__) {
  22702. "use strict";
  22703. var $export = __webpack_require__(5);
  22704. var $at = __webpack_require__(94)(false);
  22705. $export($export.P, 'String', {
  22706. // 21.1.3.3 String.prototype.codePointAt(pos)
  22707. codePointAt: function codePointAt(pos) {
  22708. return $at(this, pos);
  22709. }
  22710. });
  22711. /***/ }),
  22712. /* 245 */
  22713. /***/ (function(module, exports, __webpack_require__) {
  22714. // most Object methods by ES6 should accept primitives
  22715. var $export = __webpack_require__(5);
  22716. var core = __webpack_require__(39);
  22717. var fails = __webpack_require__(10);
  22718. module.exports = function (KEY, exec) {
  22719. var fn = (core.Object || {})[KEY] || Object[KEY];
  22720. var exp = {};
  22721. exp[KEY] = exec(fn);
  22722. $export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp);
  22723. };
  22724. /***/ }),
  22725. /* 246 */
  22726. /***/ (function(module, exports, __webpack_require__) {
  22727. "use strict";
  22728. var $at = __webpack_require__(94)(true);
  22729. // 21.1.3.27 String.prototype[@@iterator]()
  22730. __webpack_require__(150)(String, 'String', function (iterated) {
  22731. this._t = String(iterated); // target
  22732. this._i = 0; // next index
  22733. // 21.1.5.2.1 %StringIteratorPrototype%.next()
  22734. }, function () {
  22735. var O = this._t;
  22736. var index = this._i;
  22737. var point;
  22738. if (index >= O.length) return { value: undefined, done: true };
  22739. point = $at(O, index);
  22740. this._i += point.length;
  22741. return { value: point, done: false };
  22742. });
  22743. /***/ }),
  22744. /* 247 */
  22745. /***/ (function(module, exports, __webpack_require__) {
  22746. "use strict";
  22747. var ctx = __webpack_require__(52);
  22748. var $export = __webpack_require__(5);
  22749. var toObject = __webpack_require__(19);
  22750. var call = __webpack_require__(248);
  22751. var isArrayIter = __webpack_require__(145);
  22752. var toLength = __webpack_require__(16);
  22753. var createProperty = __webpack_require__(249);
  22754. var getIterFn = __webpack_require__(147);
  22755. $export($export.S + $export.F * !__webpack_require__(151)(function (iter) { Array.from(iter); }), 'Array', {
  22756. // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined)
  22757. from: function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {
  22758. var O = toObject(arrayLike);
  22759. var C = typeof this == 'function' ? this : Array;
  22760. var aLen = arguments.length;
  22761. var mapfn = aLen > 1 ? arguments[1] : undefined;
  22762. var mapping = mapfn !== undefined;
  22763. var index = 0;
  22764. var iterFn = getIterFn(O);
  22765. var length, result, step, iterator;
  22766. if (mapping) mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2);
  22767. // if object isn't iterable or it's array with default iterator - use simple case
  22768. if (iterFn != undefined && !(C == Array && isArrayIter(iterFn))) {
  22769. for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) {
  22770. createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value);
  22771. }
  22772. } else {
  22773. length = toLength(O.length);
  22774. for (result = new C(length); length > index; index++) {
  22775. createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]);
  22776. }
  22777. }
  22778. result.length = index;
  22779. return result;
  22780. }
  22781. });
  22782. /***/ }),
  22783. /* 248 */
  22784. /***/ (function(module, exports, __webpack_require__) {
  22785. // call something on iterator step with safe closing on error
  22786. var anObject = __webpack_require__(12);
  22787. module.exports = function (iterator, fn, value, entries) {
  22788. try {
  22789. return entries ? fn(anObject(value)[0], value[1]) : fn(value);
  22790. // 7.4.6 IteratorClose(iterator, completion)
  22791. } catch (e) {
  22792. var ret = iterator['return'];
  22793. if (ret !== undefined) anObject(ret.call(iterator));
  22794. throw e;
  22795. }
  22796. };
  22797. /***/ }),
  22798. /* 249 */
  22799. /***/ (function(module, exports, __webpack_require__) {
  22800. "use strict";
  22801. var $defineProperty = __webpack_require__(11);
  22802. var createDesc = __webpack_require__(40);
  22803. module.exports = function (object, index, value) {
  22804. if (index in object) $defineProperty.f(object, index, createDesc(0, value));
  22805. else object[index] = value;
  22806. };
  22807. /***/ }),
  22808. /* 250 */
  22809. /***/ (function(module, exports, __webpack_require__) {
  22810. "use strict";
  22811. __webpack_require__(251);
  22812. var anObject = __webpack_require__(12);
  22813. var $flags = __webpack_require__(98);
  22814. var DESCRIPTORS = __webpack_require__(9);
  22815. var TO_STRING = 'toString';
  22816. var $toString = /./[TO_STRING];
  22817. var define = function (fn) {
  22818. __webpack_require__(23)(RegExp.prototype, TO_STRING, fn, true);
  22819. };
  22820. // 21.2.5.14 RegExp.prototype.toString()
  22821. if (__webpack_require__(10)(function () { return $toString.call({ source: 'a', flags: 'b' }) != '/a/b'; })) {
  22822. define(function toString() {
  22823. var R = anObject(this);
  22824. return '/'.concat(R.source, '/',
  22825. 'flags' in R ? R.flags : !DESCRIPTORS && R instanceof RegExp ? $flags.call(R) : undefined);
  22826. });
  22827. // FF44- RegExp#toString has a wrong name
  22828. } else if ($toString.name != TO_STRING) {
  22829. define(function toString() {
  22830. return $toString.call(this);
  22831. });
  22832. }
  22833. /***/ }),
  22834. /* 251 */
  22835. /***/ (function(module, exports, __webpack_require__) {
  22836. // 21.2.5.3 get RegExp.prototype.flags()
  22837. if (__webpack_require__(9) && /./g.flags != 'g') __webpack_require__(11).f(RegExp.prototype, 'flags', {
  22838. configurable: true,
  22839. get: __webpack_require__(98)
  22840. });
  22841. /***/ }),
  22842. /* 252 */
  22843. /***/ (function(module, exports, __webpack_require__) {
  22844. var META = __webpack_require__(29)('meta');
  22845. var isObject = __webpack_require__(18);
  22846. var has = __webpack_require__(24);
  22847. var setDesc = __webpack_require__(11).f;
  22848. var id = 0;
  22849. var isExtensible = Object.isExtensible || function () {
  22850. return true;
  22851. };
  22852. var FREEZE = !__webpack_require__(10)(function () {
  22853. return isExtensible(Object.preventExtensions({}));
  22854. });
  22855. var setMeta = function (it) {
  22856. setDesc(it, META, { value: {
  22857. i: 'O' + ++id, // object ID
  22858. w: {} // weak collections IDs
  22859. } });
  22860. };
  22861. var fastKey = function (it, create) {
  22862. // return primitive with prefix
  22863. if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
  22864. if (!has(it, META)) {
  22865. // can't set metadata to uncaught frozen object
  22866. if (!isExtensible(it)) return 'F';
  22867. // not necessary to add metadata
  22868. if (!create) return 'E';
  22869. // add missing metadata
  22870. setMeta(it);
  22871. // return object ID
  22872. } return it[META].i;
  22873. };
  22874. var getWeak = function (it, create) {
  22875. if (!has(it, META)) {
  22876. // can't set metadata to uncaught frozen object
  22877. if (!isExtensible(it)) return true;
  22878. // not necessary to add metadata
  22879. if (!create) return false;
  22880. // add missing metadata
  22881. setMeta(it);
  22882. // return hash weak collections IDs
  22883. } return it[META].w;
  22884. };
  22885. // add metadata on freeze-family methods calling
  22886. var onFreeze = function (it) {
  22887. if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it);
  22888. return it;
  22889. };
  22890. var meta = module.exports = {
  22891. KEY: META,
  22892. NEED: false,
  22893. fastKey: fastKey,
  22894. getWeak: getWeak,
  22895. onFreeze: onFreeze
  22896. };
  22897. /***/ }),
  22898. /* 253 */
  22899. /***/ (function(module, exports, __webpack_require__) {
  22900. // all enumerable object keys, includes symbols
  22901. var getKeys = __webpack_require__(42);
  22902. var gOPS = __webpack_require__(89);
  22903. var pIE = __webpack_require__(62);
  22904. module.exports = function (it) {
  22905. var result = getKeys(it);
  22906. var getSymbols = gOPS.f;
  22907. if (getSymbols) {
  22908. var symbols = getSymbols(it);
  22909. var isEnum = pIE.f;
  22910. var i = 0;
  22911. var key;
  22912. while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key);
  22913. } return result;
  22914. };
  22915. /***/ }),
  22916. /* 254 */
  22917. /***/ (function(module, exports, __webpack_require__) {
  22918. // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
  22919. var toIObject = __webpack_require__(43);
  22920. var gOPN = __webpack_require__(55).f;
  22921. var toString = {}.toString;
  22922. var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
  22923. ? Object.getOwnPropertyNames(window) : [];
  22924. var getWindowNames = function (it) {
  22925. try {
  22926. return gOPN(it);
  22927. } catch (e) {
  22928. return windowNames.slice();
  22929. }
  22930. };
  22931. module.exports.f = function getOwnPropertyNames(it) {
  22932. return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it));
  22933. };
  22934. /***/ }),
  22935. /* 255 */
  22936. /***/ (function(module, exports, __webpack_require__) {
  22937. // 19.1.3.19 Object.setPrototypeOf(O, proto)
  22938. var $export = __webpack_require__(5);
  22939. $export($export.S, 'Object', { setPrototypeOf: __webpack_require__(156).set });
  22940. /***/ }),
  22941. /* 256 */
  22942. /***/ (function(module, exports) {
  22943. /* (ignored) */
  22944. /***/ }),
  22945. /* 257 */
  22946. /***/ (function(module, exports, __webpack_require__) {
  22947. "use strict";
  22948. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22949. var Buffer = __webpack_require__(70).Buffer;
  22950. var util = __webpack_require__(258);
  22951. function copyBuffer(src, target, offset) {
  22952. src.copy(target, offset);
  22953. }
  22954. module.exports = function () {
  22955. function BufferList() {
  22956. _classCallCheck(this, BufferList);
  22957. this.head = null;
  22958. this.tail = null;
  22959. this.length = 0;
  22960. }
  22961. BufferList.prototype.push = function push(v) {
  22962. var entry = { data: v, next: null };
  22963. if (this.length > 0) this.tail.next = entry;else this.head = entry;
  22964. this.tail = entry;
  22965. ++this.length;
  22966. };
  22967. BufferList.prototype.unshift = function unshift(v) {
  22968. var entry = { data: v, next: this.head };
  22969. if (this.length === 0) this.tail = entry;
  22970. this.head = entry;
  22971. ++this.length;
  22972. };
  22973. BufferList.prototype.shift = function shift() {
  22974. if (this.length === 0) return;
  22975. var ret = this.head.data;
  22976. if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next;
  22977. --this.length;
  22978. return ret;
  22979. };
  22980. BufferList.prototype.clear = function clear() {
  22981. this.head = this.tail = null;
  22982. this.length = 0;
  22983. };
  22984. BufferList.prototype.join = function join(s) {
  22985. if (this.length === 0) return '';
  22986. var p = this.head;
  22987. var ret = '' + p.data;
  22988. while (p = p.next) {
  22989. ret += s + p.data;
  22990. }return ret;
  22991. };
  22992. BufferList.prototype.concat = function concat(n) {
  22993. if (this.length === 0) return Buffer.alloc(0);
  22994. if (this.length === 1) return this.head.data;
  22995. var ret = Buffer.allocUnsafe(n >>> 0);
  22996. var p = this.head;
  22997. var i = 0;
  22998. while (p) {
  22999. copyBuffer(p.data, ret, i);
  23000. i += p.data.length;
  23001. p = p.next;
  23002. }
  23003. return ret;
  23004. };
  23005. return BufferList;
  23006. }();
  23007. if (util && util.inspect && util.inspect.custom) {
  23008. module.exports.prototype[util.inspect.custom] = function () {
  23009. var obj = util.inspect({ length: this.length });
  23010. return this.constructor.name + ' ' + obj;
  23011. };
  23012. }
  23013. /***/ }),
  23014. /* 258 */
  23015. /***/ (function(module, exports) {
  23016. /* (ignored) */
  23017. /***/ }),
  23018. /* 259 */
  23019. /***/ (function(module, exports, __webpack_require__) {
  23020. /* WEBPACK VAR INJECTION */(function(global) {
  23021. /**
  23022. * Module exports.
  23023. */
  23024. module.exports = deprecate;
  23025. /**
  23026. * Mark that a method should not be used.
  23027. * Returns a modified function which warns once by default.
  23028. *
  23029. * If `localStorage.noDeprecation = true` is set, then it is a no-op.
  23030. *
  23031. * If `localStorage.throwDeprecation = true` is set, then deprecated functions
  23032. * will throw an Error when invoked.
  23033. *
  23034. * If `localStorage.traceDeprecation = true` is set, then deprecated functions
  23035. * will invoke `console.trace()` instead of `console.error()`.
  23036. *
  23037. * @param {Function} fn - the function to deprecate
  23038. * @param {String} msg - the string to print to the console when `fn` is invoked
  23039. * @returns {Function} a new "deprecated" version of `fn`
  23040. * @api public
  23041. */
  23042. function deprecate (fn, msg) {
  23043. if (config('noDeprecation')) {
  23044. return fn;
  23045. }
  23046. var warned = false;
  23047. function deprecated() {
  23048. if (!warned) {
  23049. if (config('throwDeprecation')) {
  23050. throw new Error(msg);
  23051. } else if (config('traceDeprecation')) {
  23052. console.trace(msg);
  23053. } else {
  23054. console.warn(msg);
  23055. }
  23056. warned = true;
  23057. }
  23058. return fn.apply(this, arguments);
  23059. }
  23060. return deprecated;
  23061. }
  23062. /**
  23063. * Checks `localStorage` for boolean values for the given `name`.
  23064. *
  23065. * @param {String} name
  23066. * @returns {Boolean}
  23067. * @api private
  23068. */
  23069. function config (name) {
  23070. // accessing global.localStorage can trigger a DOMException in sandboxed iframes
  23071. try {
  23072. if (!global.localStorage) return false;
  23073. } catch (_) {
  23074. return false;
  23075. }
  23076. var val = global.localStorage[name];
  23077. if (null == val) return false;
  23078. return String(val).toLowerCase() === 'true';
  23079. }
  23080. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(22)))
  23081. /***/ }),
  23082. /* 260 */
  23083. /***/ (function(module, exports, __webpack_require__) {
  23084. "use strict";
  23085. // Copyright Joyent, Inc. and other Node contributors.
  23086. //
  23087. // Permission is hereby granted, free of charge, to any person obtaining a
  23088. // copy of this software and associated documentation files (the
  23089. // "Software"), to deal in the Software without restriction, including
  23090. // without limitation the rights to use, copy, modify, merge, publish,
  23091. // distribute, sublicense, and/or sell copies of the Software, and to permit
  23092. // persons to whom the Software is furnished to do so, subject to the
  23093. // following conditions:
  23094. //
  23095. // The above copyright notice and this permission notice shall be included
  23096. // in all copies or substantial portions of the Software.
  23097. //
  23098. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  23099. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  23100. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  23101. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  23102. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  23103. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  23104. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  23105. // a passthrough stream.
  23106. // basically just the most minimal sort of Transform stream.
  23107. // Every written chunk gets output as-is.
  23108. module.exports = PassThrough;
  23109. var Transform = __webpack_require__(169);
  23110. /*<replacement>*/
  23111. var util = Object.create(__webpack_require__(56));
  23112. util.inherits = __webpack_require__(46);
  23113. /*</replacement>*/
  23114. util.inherits(PassThrough, Transform);
  23115. function PassThrough(options) {
  23116. if (!(this instanceof PassThrough)) return new PassThrough(options);
  23117. Transform.call(this, options);
  23118. }
  23119. PassThrough.prototype._transform = function (chunk, encoding, cb) {
  23120. cb(null, chunk);
  23121. };
  23122. /***/ }),
  23123. /* 261 */
  23124. /***/ (function(module, exports, __webpack_require__) {
  23125. module.exports = __webpack_require__(102);
  23126. /***/ }),
  23127. /* 262 */
  23128. /***/ (function(module, exports, __webpack_require__) {
  23129. module.exports = __webpack_require__(32);
  23130. /***/ }),
  23131. /* 263 */
  23132. /***/ (function(module, exports, __webpack_require__) {
  23133. module.exports = __webpack_require__(101).Transform
  23134. /***/ }),
  23135. /* 264 */
  23136. /***/ (function(module, exports, __webpack_require__) {
  23137. module.exports = __webpack_require__(101).PassThrough
  23138. /***/ }),
  23139. /* 265 */
  23140. /***/ (function(module, exports, __webpack_require__) {
  23141. "use strict";
  23142. /* WEBPACK VAR INJECTION */(function(Buffer, process) {
  23143. /* eslint camelcase: "off" */
  23144. var assert = __webpack_require__(171);
  23145. var Zstream = __webpack_require__(269);
  23146. var zlib_deflate = __webpack_require__(270);
  23147. var zlib_inflate = __webpack_require__(273);
  23148. var constants = __webpack_require__(276);
  23149. for (var key in constants) {
  23150. exports[key] = constants[key];
  23151. }
  23152. // zlib modes
  23153. exports.NONE = 0;
  23154. exports.DEFLATE = 1;
  23155. exports.INFLATE = 2;
  23156. exports.GZIP = 3;
  23157. exports.GUNZIP = 4;
  23158. exports.DEFLATERAW = 5;
  23159. exports.INFLATERAW = 6;
  23160. exports.UNZIP = 7;
  23161. var GZIP_HEADER_ID1 = 0x1f;
  23162. var GZIP_HEADER_ID2 = 0x8b;
  23163. /**
  23164. * Emulate Node's zlib C++ layer for use by the JS layer in index.js
  23165. */
  23166. function Zlib(mode) {
  23167. if (typeof mode !== 'number' || mode < exports.DEFLATE || mode > exports.UNZIP) {
  23168. throw new TypeError('Bad argument');
  23169. }
  23170. this.dictionary = null;
  23171. this.err = 0;
  23172. this.flush = 0;
  23173. this.init_done = false;
  23174. this.level = 0;
  23175. this.memLevel = 0;
  23176. this.mode = mode;
  23177. this.strategy = 0;
  23178. this.windowBits = 0;
  23179. this.write_in_progress = false;
  23180. this.pending_close = false;
  23181. this.gzip_id_bytes_read = 0;
  23182. }
  23183. Zlib.prototype.close = function () {
  23184. if (this.write_in_progress) {
  23185. this.pending_close = true;
  23186. return;
  23187. }
  23188. this.pending_close = false;
  23189. assert(this.init_done, 'close before init');
  23190. assert(this.mode <= exports.UNZIP);
  23191. if (this.mode === exports.DEFLATE || this.mode === exports.GZIP || this.mode === exports.DEFLATERAW) {
  23192. zlib_deflate.deflateEnd(this.strm);
  23193. } else if (this.mode === exports.INFLATE || this.mode === exports.GUNZIP || this.mode === exports.INFLATERAW || this.mode === exports.UNZIP) {
  23194. zlib_inflate.inflateEnd(this.strm);
  23195. }
  23196. this.mode = exports.NONE;
  23197. this.dictionary = null;
  23198. };
  23199. Zlib.prototype.write = function (flush, input, in_off, in_len, out, out_off, out_len) {
  23200. return this._write(true, flush, input, in_off, in_len, out, out_off, out_len);
  23201. };
  23202. Zlib.prototype.writeSync = function (flush, input, in_off, in_len, out, out_off, out_len) {
  23203. return this._write(false, flush, input, in_off, in_len, out, out_off, out_len);
  23204. };
  23205. Zlib.prototype._write = function (async, flush, input, in_off, in_len, out, out_off, out_len) {
  23206. assert.equal(arguments.length, 8);
  23207. assert(this.init_done, 'write before init');
  23208. assert(this.mode !== exports.NONE, 'already finalized');
  23209. assert.equal(false, this.write_in_progress, 'write already in progress');
  23210. assert.equal(false, this.pending_close, 'close is pending');
  23211. this.write_in_progress = true;
  23212. assert.equal(false, flush === undefined, 'must provide flush value');
  23213. this.write_in_progress = true;
  23214. if (flush !== exports.Z_NO_FLUSH && flush !== exports.Z_PARTIAL_FLUSH && flush !== exports.Z_SYNC_FLUSH && flush !== exports.Z_FULL_FLUSH && flush !== exports.Z_FINISH && flush !== exports.Z_BLOCK) {
  23215. throw new Error('Invalid flush value');
  23216. }
  23217. if (input == null) {
  23218. input = Buffer.alloc(0);
  23219. in_len = 0;
  23220. in_off = 0;
  23221. }
  23222. this.strm.avail_in = in_len;
  23223. this.strm.input = input;
  23224. this.strm.next_in = in_off;
  23225. this.strm.avail_out = out_len;
  23226. this.strm.output = out;
  23227. this.strm.next_out = out_off;
  23228. this.flush = flush;
  23229. if (!async) {
  23230. // sync version
  23231. this._process();
  23232. if (this._checkError()) {
  23233. return this._afterSync();
  23234. }
  23235. return;
  23236. }
  23237. // async version
  23238. var self = this;
  23239. process.nextTick(function () {
  23240. self._process();
  23241. self._after();
  23242. });
  23243. return this;
  23244. };
  23245. Zlib.prototype._afterSync = function () {
  23246. var avail_out = this.strm.avail_out;
  23247. var avail_in = this.strm.avail_in;
  23248. this.write_in_progress = false;
  23249. return [avail_in, avail_out];
  23250. };
  23251. Zlib.prototype._process = function () {
  23252. var next_expected_header_byte = null;
  23253. // If the avail_out is left at 0, then it means that it ran out
  23254. // of room. If there was avail_out left over, then it means
  23255. // that all of the input was consumed.
  23256. switch (this.mode) {
  23257. case exports.DEFLATE:
  23258. case exports.GZIP:
  23259. case exports.DEFLATERAW:
  23260. this.err = zlib_deflate.deflate(this.strm, this.flush);
  23261. break;
  23262. case exports.UNZIP:
  23263. if (this.strm.avail_in > 0) {
  23264. next_expected_header_byte = this.strm.next_in;
  23265. }
  23266. switch (this.gzip_id_bytes_read) {
  23267. case 0:
  23268. if (next_expected_header_byte === null) {
  23269. break;
  23270. }
  23271. if (this.strm.input[next_expected_header_byte] === GZIP_HEADER_ID1) {
  23272. this.gzip_id_bytes_read = 1;
  23273. next_expected_header_byte++;
  23274. if (this.strm.avail_in === 1) {
  23275. // The only available byte was already read.
  23276. break;
  23277. }
  23278. } else {
  23279. this.mode = exports.INFLATE;
  23280. break;
  23281. }
  23282. // fallthrough
  23283. case 1:
  23284. if (next_expected_header_byte === null) {
  23285. break;
  23286. }
  23287. if (this.strm.input[next_expected_header_byte] === GZIP_HEADER_ID2) {
  23288. this.gzip_id_bytes_read = 2;
  23289. this.mode = exports.GUNZIP;
  23290. } else {
  23291. // There is no actual difference between INFLATE and INFLATERAW
  23292. // (after initialization).
  23293. this.mode = exports.INFLATE;
  23294. }
  23295. break;
  23296. default:
  23297. throw new Error('invalid number of gzip magic number bytes read');
  23298. }
  23299. // fallthrough
  23300. case exports.INFLATE:
  23301. case exports.GUNZIP:
  23302. case exports.INFLATERAW:
  23303. this.err = zlib_inflate.inflate(this.strm, this.flush
  23304. // If data was encoded with dictionary
  23305. );if (this.err === exports.Z_NEED_DICT && this.dictionary) {
  23306. // Load it
  23307. this.err = zlib_inflate.inflateSetDictionary(this.strm, this.dictionary);
  23308. if (this.err === exports.Z_OK) {
  23309. // And try to decode again
  23310. this.err = zlib_inflate.inflate(this.strm, this.flush);
  23311. } else if (this.err === exports.Z_DATA_ERROR) {
  23312. // Both inflateSetDictionary() and inflate() return Z_DATA_ERROR.
  23313. // Make it possible for After() to tell a bad dictionary from bad
  23314. // input.
  23315. this.err = exports.Z_NEED_DICT;
  23316. }
  23317. }
  23318. while (this.strm.avail_in > 0 && this.mode === exports.GUNZIP && this.err === exports.Z_STREAM_END && this.strm.next_in[0] !== 0x00) {
  23319. // Bytes remain in input buffer. Perhaps this is another compressed
  23320. // member in the same archive, or just trailing garbage.
  23321. // Trailing zero bytes are okay, though, since they are frequently
  23322. // used for padding.
  23323. this.reset();
  23324. this.err = zlib_inflate.inflate(this.strm, this.flush);
  23325. }
  23326. break;
  23327. default:
  23328. throw new Error('Unknown mode ' + this.mode);
  23329. }
  23330. };
  23331. Zlib.prototype._checkError = function () {
  23332. // Acceptable error states depend on the type of zlib stream.
  23333. switch (this.err) {
  23334. case exports.Z_OK:
  23335. case exports.Z_BUF_ERROR:
  23336. if (this.strm.avail_out !== 0 && this.flush === exports.Z_FINISH) {
  23337. this._error('unexpected end of file');
  23338. return false;
  23339. }
  23340. break;
  23341. case exports.Z_STREAM_END:
  23342. // normal statuses, not fatal
  23343. break;
  23344. case exports.Z_NEED_DICT:
  23345. if (this.dictionary == null) {
  23346. this._error('Missing dictionary');
  23347. } else {
  23348. this._error('Bad dictionary');
  23349. }
  23350. return false;
  23351. default:
  23352. // something else.
  23353. this._error('Zlib error');
  23354. return false;
  23355. }
  23356. return true;
  23357. };
  23358. Zlib.prototype._after = function () {
  23359. if (!this._checkError()) {
  23360. return;
  23361. }
  23362. var avail_out = this.strm.avail_out;
  23363. var avail_in = this.strm.avail_in;
  23364. this.write_in_progress = false;
  23365. // call the write() cb
  23366. this.callback(avail_in, avail_out);
  23367. if (this.pending_close) {
  23368. this.close();
  23369. }
  23370. };
  23371. Zlib.prototype._error = function (message) {
  23372. if (this.strm.msg) {
  23373. message = this.strm.msg;
  23374. }
  23375. this.onerror(message, this.err
  23376. // no hope of rescue.
  23377. );this.write_in_progress = false;
  23378. if (this.pending_close) {
  23379. this.close();
  23380. }
  23381. };
  23382. Zlib.prototype.init = function (windowBits, level, memLevel, strategy, dictionary) {
  23383. assert(arguments.length === 4 || arguments.length === 5, 'init(windowBits, level, memLevel, strategy, [dictionary])');
  23384. assert(windowBits >= 8 && windowBits <= 15, 'invalid windowBits');
  23385. assert(level >= -1 && level <= 9, 'invalid compression level');
  23386. assert(memLevel >= 1 && memLevel <= 9, 'invalid memlevel');
  23387. assert(strategy === exports.Z_FILTERED || strategy === exports.Z_HUFFMAN_ONLY || strategy === exports.Z_RLE || strategy === exports.Z_FIXED || strategy === exports.Z_DEFAULT_STRATEGY, 'invalid strategy');
  23388. this._init(level, windowBits, memLevel, strategy, dictionary);
  23389. this._setDictionary();
  23390. };
  23391. Zlib.prototype.params = function () {
  23392. throw new Error('deflateParams Not supported');
  23393. };
  23394. Zlib.prototype.reset = function () {
  23395. this._reset();
  23396. this._setDictionary();
  23397. };
  23398. Zlib.prototype._init = function (level, windowBits, memLevel, strategy, dictionary) {
  23399. this.level = level;
  23400. this.windowBits = windowBits;
  23401. this.memLevel = memLevel;
  23402. this.strategy = strategy;
  23403. this.flush = exports.Z_NO_FLUSH;
  23404. this.err = exports.Z_OK;
  23405. if (this.mode === exports.GZIP || this.mode === exports.GUNZIP) {
  23406. this.windowBits += 16;
  23407. }
  23408. if (this.mode === exports.UNZIP) {
  23409. this.windowBits += 32;
  23410. }
  23411. if (this.mode === exports.DEFLATERAW || this.mode === exports.INFLATERAW) {
  23412. this.windowBits = -1 * this.windowBits;
  23413. }
  23414. this.strm = new Zstream();
  23415. switch (this.mode) {
  23416. case exports.DEFLATE:
  23417. case exports.GZIP:
  23418. case exports.DEFLATERAW:
  23419. this.err = zlib_deflate.deflateInit2(this.strm, this.level, exports.Z_DEFLATED, this.windowBits, this.memLevel, this.strategy);
  23420. break;
  23421. case exports.INFLATE:
  23422. case exports.GUNZIP:
  23423. case exports.INFLATERAW:
  23424. case exports.UNZIP:
  23425. this.err = zlib_inflate.inflateInit2(this.strm, this.windowBits);
  23426. break;
  23427. default:
  23428. throw new Error('Unknown mode ' + this.mode);
  23429. }
  23430. if (this.err !== exports.Z_OK) {
  23431. this._error('Init error');
  23432. }
  23433. this.dictionary = dictionary;
  23434. this.write_in_progress = false;
  23435. this.init_done = true;
  23436. };
  23437. Zlib.prototype._setDictionary = function () {
  23438. if (this.dictionary == null) {
  23439. return;
  23440. }
  23441. this.err = exports.Z_OK;
  23442. switch (this.mode) {
  23443. case exports.DEFLATE:
  23444. case exports.DEFLATERAW:
  23445. this.err = zlib_deflate.deflateSetDictionary(this.strm, this.dictionary);
  23446. break;
  23447. default:
  23448. break;
  23449. }
  23450. if (this.err !== exports.Z_OK) {
  23451. this._error('Failed to set dictionary');
  23452. }
  23453. };
  23454. Zlib.prototype._reset = function () {
  23455. this.err = exports.Z_OK;
  23456. switch (this.mode) {
  23457. case exports.DEFLATE:
  23458. case exports.DEFLATERAW:
  23459. case exports.GZIP:
  23460. this.err = zlib_deflate.deflateReset(this.strm);
  23461. break;
  23462. case exports.INFLATE:
  23463. case exports.INFLATERAW:
  23464. case exports.GUNZIP:
  23465. this.err = zlib_inflate.inflateReset(this.strm);
  23466. break;
  23467. default:
  23468. break;
  23469. }
  23470. if (this.err !== exports.Z_OK) {
  23471. this._error('Failed to reset stream');
  23472. }
  23473. };
  23474. exports.Zlib = Zlib;
  23475. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(4).Buffer, __webpack_require__(25)))
  23476. /***/ }),
  23477. /* 266 */
  23478. /***/ (function(module, exports, __webpack_require__) {
  23479. "use strict";
  23480. /*
  23481. object-assign
  23482. (c) Sindre Sorhus
  23483. @license MIT
  23484. */
  23485. /* eslint-disable no-unused-vars */
  23486. var getOwnPropertySymbols = Object.getOwnPropertySymbols;
  23487. var hasOwnProperty = Object.prototype.hasOwnProperty;
  23488. var propIsEnumerable = Object.prototype.propertyIsEnumerable;
  23489. function toObject(val) {
  23490. if (val === null || val === undefined) {
  23491. throw new TypeError('Object.assign cannot be called with null or undefined');
  23492. }
  23493. return Object(val);
  23494. }
  23495. function shouldUseNative() {
  23496. try {
  23497. if (!Object.assign) {
  23498. return false;
  23499. }
  23500. // Detect buggy property enumeration order in older V8 versions.
  23501. // https://bugs.chromium.org/p/v8/issues/detail?id=4118
  23502. var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
  23503. test1[5] = 'de';
  23504. if (Object.getOwnPropertyNames(test1)[0] === '5') {
  23505. return false;
  23506. }
  23507. // https://bugs.chromium.org/p/v8/issues/detail?id=3056
  23508. var test2 = {};
  23509. for (var i = 0; i < 10; i++) {
  23510. test2['_' + String.fromCharCode(i)] = i;
  23511. }
  23512. var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
  23513. return test2[n];
  23514. });
  23515. if (order2.join('') !== '0123456789') {
  23516. return false;
  23517. }
  23518. // https://bugs.chromium.org/p/v8/issues/detail?id=3056
  23519. var test3 = {};
  23520. 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
  23521. test3[letter] = letter;
  23522. });
  23523. if (Object.keys(Object.assign({}, test3)).join('') !==
  23524. 'abcdefghijklmnopqrst') {
  23525. return false;
  23526. }
  23527. return true;
  23528. } catch (err) {
  23529. // We don't expect any of the above to throw, but better to be safe.
  23530. return false;
  23531. }
  23532. }
  23533. module.exports = shouldUseNative() ? Object.assign : function (target, source) {
  23534. var from;
  23535. var to = toObject(target);
  23536. var symbols;
  23537. for (var s = 1; s < arguments.length; s++) {
  23538. from = Object(arguments[s]);
  23539. for (var key in from) {
  23540. if (hasOwnProperty.call(from, key)) {
  23541. to[key] = from[key];
  23542. }
  23543. }
  23544. if (getOwnPropertySymbols) {
  23545. symbols = getOwnPropertySymbols(from);
  23546. for (var i = 0; i < symbols.length; i++) {
  23547. if (propIsEnumerable.call(from, symbols[i])) {
  23548. to[symbols[i]] = from[symbols[i]];
  23549. }
  23550. }
  23551. }
  23552. }
  23553. return to;
  23554. };
  23555. /***/ }),
  23556. /* 267 */
  23557. /***/ (function(module, exports) {
  23558. module.exports = function isBuffer(arg) {
  23559. return arg && typeof arg === 'object'
  23560. && typeof arg.copy === 'function'
  23561. && typeof arg.fill === 'function'
  23562. && typeof arg.readUInt8 === 'function';
  23563. }
  23564. /***/ }),
  23565. /* 268 */
  23566. /***/ (function(module, exports) {
  23567. if (typeof Object.create === 'function') {
  23568. // implementation from standard node.js 'util' module
  23569. module.exports = function inherits(ctor, superCtor) {
  23570. ctor.super_ = superCtor
  23571. ctor.prototype = Object.create(superCtor.prototype, {
  23572. constructor: {
  23573. value: ctor,
  23574. enumerable: false,
  23575. writable: true,
  23576. configurable: true
  23577. }
  23578. });
  23579. };
  23580. } else {
  23581. // old school shim for old browsers
  23582. module.exports = function inherits(ctor, superCtor) {
  23583. ctor.super_ = superCtor
  23584. var TempCtor = function () {}
  23585. TempCtor.prototype = superCtor.prototype
  23586. ctor.prototype = new TempCtor()
  23587. ctor.prototype.constructor = ctor
  23588. }
  23589. }
  23590. /***/ }),
  23591. /* 269 */
  23592. /***/ (function(module, exports, __webpack_require__) {
  23593. "use strict";
  23594. // (C) 1995-2013 Jean-loup Gailly and Mark Adler
  23595. // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
  23596. //
  23597. // This software is provided 'as-is', without any express or implied
  23598. // warranty. In no event will the authors be held liable for any damages
  23599. // arising from the use of this software.
  23600. //
  23601. // Permission is granted to anyone to use this software for any purpose,
  23602. // including commercial applications, and to alter it and redistribute it
  23603. // freely, subject to the following restrictions:
  23604. //
  23605. // 1. The origin of this software must not be misrepresented; you must not
  23606. // claim that you wrote the original software. If you use this software
  23607. // in a product, an acknowledgment in the product documentation would be
  23608. // appreciated but is not required.
  23609. // 2. Altered source versions must be plainly marked as such, and must not be
  23610. // misrepresented as being the original software.
  23611. // 3. This notice may not be removed or altered from any source distribution.
  23612. function ZStream() {
  23613. /* next input byte */
  23614. this.input = null; // JS specific, because we have no pointers
  23615. this.next_in = 0;
  23616. /* number of bytes available at input */
  23617. this.avail_in = 0;
  23618. /* total number of input bytes read so far */
  23619. this.total_in = 0;
  23620. /* next output byte should be put there */
  23621. this.output = null; // JS specific, because we have no pointers
  23622. this.next_out = 0;
  23623. /* remaining free space at output */
  23624. this.avail_out = 0;
  23625. /* total number of bytes output so far */
  23626. this.total_out = 0;
  23627. /* last error message, NULL if no error */
  23628. this.msg = ''/*Z_NULL*/;
  23629. /* not visible by applications */
  23630. this.state = null;
  23631. /* best guess about the data type: binary or text */
  23632. this.data_type = 2/*Z_UNKNOWN*/;
  23633. /* adler32 value of the uncompressed data */
  23634. this.adler = 0;
  23635. }
  23636. module.exports = ZStream;
  23637. /***/ }),
  23638. /* 270 */
  23639. /***/ (function(module, exports, __webpack_require__) {
  23640. "use strict";
  23641. // (C) 1995-2013 Jean-loup Gailly and Mark Adler
  23642. // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
  23643. //
  23644. // This software is provided 'as-is', without any express or implied
  23645. // warranty. In no event will the authors be held liable for any damages
  23646. // arising from the use of this software.
  23647. //
  23648. // Permission is granted to anyone to use this software for any purpose,
  23649. // including commercial applications, and to alter it and redistribute it
  23650. // freely, subject to the following restrictions:
  23651. //
  23652. // 1. The origin of this software must not be misrepresented; you must not
  23653. // claim that you wrote the original software. If you use this software
  23654. // in a product, an acknowledgment in the product documentation would be
  23655. // appreciated but is not required.
  23656. // 2. Altered source versions must be plainly marked as such, and must not be
  23657. // misrepresented as being the original software.
  23658. // 3. This notice may not be removed or altered from any source distribution.
  23659. var utils = __webpack_require__(71);
  23660. var trees = __webpack_require__(271);
  23661. var adler32 = __webpack_require__(172);
  23662. var crc32 = __webpack_require__(173);
  23663. var msg = __webpack_require__(272);
  23664. /* Public constants ==========================================================*/
  23665. /* ===========================================================================*/
  23666. /* Allowed flush values; see deflate() and inflate() below for details */
  23667. var Z_NO_FLUSH = 0;
  23668. var Z_PARTIAL_FLUSH = 1;
  23669. //var Z_SYNC_FLUSH = 2;
  23670. var Z_FULL_FLUSH = 3;
  23671. var Z_FINISH = 4;
  23672. var Z_BLOCK = 5;
  23673. //var Z_TREES = 6;
  23674. /* Return codes for the compression/decompression functions. Negative values
  23675. * are errors, positive values are used for special but normal events.
  23676. */
  23677. var Z_OK = 0;
  23678. var Z_STREAM_END = 1;
  23679. //var Z_NEED_DICT = 2;
  23680. //var Z_ERRNO = -1;
  23681. var Z_STREAM_ERROR = -2;
  23682. var Z_DATA_ERROR = -3;
  23683. //var Z_MEM_ERROR = -4;
  23684. var Z_BUF_ERROR = -5;
  23685. //var Z_VERSION_ERROR = -6;
  23686. /* compression levels */
  23687. //var Z_NO_COMPRESSION = 0;
  23688. //var Z_BEST_SPEED = 1;
  23689. //var Z_BEST_COMPRESSION = 9;
  23690. var Z_DEFAULT_COMPRESSION = -1;
  23691. var Z_FILTERED = 1;
  23692. var Z_HUFFMAN_ONLY = 2;
  23693. var Z_RLE = 3;
  23694. var Z_FIXED = 4;
  23695. var Z_DEFAULT_STRATEGY = 0;
  23696. /* Possible values of the data_type field (though see inflate()) */
  23697. //var Z_BINARY = 0;
  23698. //var Z_TEXT = 1;
  23699. //var Z_ASCII = 1; // = Z_TEXT
  23700. var Z_UNKNOWN = 2;
  23701. /* The deflate compression method */
  23702. var Z_DEFLATED = 8;
  23703. /*============================================================================*/
  23704. var MAX_MEM_LEVEL = 9;
  23705. /* Maximum value for memLevel in deflateInit2 */
  23706. var MAX_WBITS = 15;
  23707. /* 32K LZ77 window */
  23708. var DEF_MEM_LEVEL = 8;
  23709. var LENGTH_CODES = 29;
  23710. /* number of length codes, not counting the special END_BLOCK code */
  23711. var LITERALS = 256;
  23712. /* number of literal bytes 0..255 */
  23713. var L_CODES = LITERALS + 1 + LENGTH_CODES;
  23714. /* number of Literal or Length codes, including the END_BLOCK code */
  23715. var D_CODES = 30;
  23716. /* number of distance codes */
  23717. var BL_CODES = 19;
  23718. /* number of codes used to transfer the bit lengths */
  23719. var HEAP_SIZE = 2 * L_CODES + 1;
  23720. /* maximum heap size */
  23721. var MAX_BITS = 15;
  23722. /* All codes must not exceed MAX_BITS bits */
  23723. var MIN_MATCH = 3;
  23724. var MAX_MATCH = 258;
  23725. var MIN_LOOKAHEAD = (MAX_MATCH + MIN_MATCH + 1);
  23726. var PRESET_DICT = 0x20;
  23727. var INIT_STATE = 42;
  23728. var EXTRA_STATE = 69;
  23729. var NAME_STATE = 73;
  23730. var COMMENT_STATE = 91;
  23731. var HCRC_STATE = 103;
  23732. var BUSY_STATE = 113;
  23733. var FINISH_STATE = 666;
  23734. var BS_NEED_MORE = 1; /* block not completed, need more input or more output */
  23735. var BS_BLOCK_DONE = 2; /* block flush performed */
  23736. var BS_FINISH_STARTED = 3; /* finish started, need only more output at next deflate */
  23737. var BS_FINISH_DONE = 4; /* finish done, accept no more input or output */
  23738. var OS_CODE = 0x03; // Unix :) . Don't detect, use this default.
  23739. function err(strm, errorCode) {
  23740. strm.msg = msg[errorCode];
  23741. return errorCode;
  23742. }
  23743. function rank(f) {
  23744. return ((f) << 1) - ((f) > 4 ? 9 : 0);
  23745. }
  23746. function zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } }
  23747. /* =========================================================================
  23748. * Flush as much pending output as possible. All deflate() output goes
  23749. * through this function so some applications may wish to modify it
  23750. * to avoid allocating a large strm->output buffer and copying into it.
  23751. * (See also read_buf()).
  23752. */
  23753. function flush_pending(strm) {
  23754. var s = strm.state;
  23755. //_tr_flush_bits(s);
  23756. var len = s.pending;
  23757. if (len > strm.avail_out) {
  23758. len = strm.avail_out;
  23759. }
  23760. if (len === 0) { return; }
  23761. utils.arraySet(strm.output, s.pending_buf, s.pending_out, len, strm.next_out);
  23762. strm.next_out += len;
  23763. s.pending_out += len;
  23764. strm.total_out += len;
  23765. strm.avail_out -= len;
  23766. s.pending -= len;
  23767. if (s.pending === 0) {
  23768. s.pending_out = 0;
  23769. }
  23770. }
  23771. function flush_block_only(s, last) {
  23772. trees._tr_flush_block(s, (s.block_start >= 0 ? s.block_start : -1), s.strstart - s.block_start, last);
  23773. s.block_start = s.strstart;
  23774. flush_pending(s.strm);
  23775. }
  23776. function put_byte(s, b) {
  23777. s.pending_buf[s.pending++] = b;
  23778. }
  23779. /* =========================================================================
  23780. * Put a short in the pending buffer. The 16-bit value is put in MSB order.
  23781. * IN assertion: the stream state is correct and there is enough room in
  23782. * pending_buf.
  23783. */
  23784. function putShortMSB(s, b) {
  23785. // put_byte(s, (Byte)(b >> 8));
  23786. // put_byte(s, (Byte)(b & 0xff));
  23787. s.pending_buf[s.pending++] = (b >>> 8) & 0xff;
  23788. s.pending_buf[s.pending++] = b & 0xff;
  23789. }
  23790. /* ===========================================================================
  23791. * Read a new buffer from the current input stream, update the adler32
  23792. * and total number of bytes read. All deflate() input goes through
  23793. * this function so some applications may wish to modify it to avoid
  23794. * allocating a large strm->input buffer and copying from it.
  23795. * (See also flush_pending()).
  23796. */
  23797. function read_buf(strm, buf, start, size) {
  23798. var len = strm.avail_in;
  23799. if (len > size) { len = size; }
  23800. if (len === 0) { return 0; }
  23801. strm.avail_in -= len;
  23802. // zmemcpy(buf, strm->next_in, len);
  23803. utils.arraySet(buf, strm.input, strm.next_in, len, start);
  23804. if (strm.state.wrap === 1) {
  23805. strm.adler = adler32(strm.adler, buf, len, start);
  23806. }
  23807. else if (strm.state.wrap === 2) {
  23808. strm.adler = crc32(strm.adler, buf, len, start);
  23809. }
  23810. strm.next_in += len;
  23811. strm.total_in += len;
  23812. return len;
  23813. }
  23814. /* ===========================================================================
  23815. * Set match_start to the longest match starting at the given string and
  23816. * return its length. Matches shorter or equal to prev_length are discarded,
  23817. * in which case the result is equal to prev_length and match_start is
  23818. * garbage.
  23819. * IN assertions: cur_match is the head of the hash chain for the current
  23820. * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1
  23821. * OUT assertion: the match length is not greater than s->lookahead.
  23822. */
  23823. function longest_match(s, cur_match) {
  23824. var chain_length = s.max_chain_length; /* max hash chain length */
  23825. var scan = s.strstart; /* current string */
  23826. var match; /* matched string */
  23827. var len; /* length of current match */
  23828. var best_len = s.prev_length; /* best match length so far */
  23829. var nice_match = s.nice_match; /* stop if match long enough */
  23830. var limit = (s.strstart > (s.w_size - MIN_LOOKAHEAD)) ?
  23831. s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0/*NIL*/;
  23832. var _win = s.window; // shortcut
  23833. var wmask = s.w_mask;
  23834. var prev = s.prev;
  23835. /* Stop when cur_match becomes <= limit. To simplify the code,
  23836. * we prevent matches with the string of window index 0.
  23837. */
  23838. var strend = s.strstart + MAX_MATCH;
  23839. var scan_end1 = _win[scan + best_len - 1];
  23840. var scan_end = _win[scan + best_len];
  23841. /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.
  23842. * It is easy to get rid of this optimization if necessary.
  23843. */
  23844. // Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever");
  23845. /* Do not waste too much time if we already have a good match: */
  23846. if (s.prev_length >= s.good_match) {
  23847. chain_length >>= 2;
  23848. }
  23849. /* Do not look for matches beyond the end of the input. This is necessary
  23850. * to make deflate deterministic.
  23851. */
  23852. if (nice_match > s.lookahead) { nice_match = s.lookahead; }
  23853. // Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead");
  23854. do {
  23855. // Assert(cur_match < s->strstart, "no future");
  23856. match = cur_match;
  23857. /* Skip to next match if the match length cannot increase
  23858. * or if the match length is less than 2. Note that the checks below
  23859. * for insufficient lookahead only occur occasionally for performance
  23860. * reasons. Therefore uninitialized memory will be accessed, and
  23861. * conditional jumps will be made that depend on those values.
  23862. * However the length of the match is limited to the lookahead, so
  23863. * the output of deflate is not affected by the uninitialized values.
  23864. */
  23865. if (_win[match + best_len] !== scan_end ||
  23866. _win[match + best_len - 1] !== scan_end1 ||
  23867. _win[match] !== _win[scan] ||
  23868. _win[++match] !== _win[scan + 1]) {
  23869. continue;
  23870. }
  23871. /* The check at best_len-1 can be removed because it will be made
  23872. * again later. (This heuristic is not always a win.)
  23873. * It is not necessary to compare scan[2] and match[2] since they
  23874. * are always equal when the other bytes match, given that
  23875. * the hash keys are equal and that HASH_BITS >= 8.
  23876. */
  23877. scan += 2;
  23878. match++;
  23879. // Assert(*scan == *match, "match[2]?");
  23880. /* We check for insufficient lookahead only every 8th comparison;
  23881. * the 256th check will be made at strstart+258.
  23882. */
  23883. do {
  23884. /*jshint noempty:false*/
  23885. } while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&
  23886. _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&
  23887. _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&
  23888. _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&
  23889. scan < strend);
  23890. // Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");
  23891. len = MAX_MATCH - (strend - scan);
  23892. scan = strend - MAX_MATCH;
  23893. if (len > best_len) {
  23894. s.match_start = cur_match;
  23895. best_len = len;
  23896. if (len >= nice_match) {
  23897. break;
  23898. }
  23899. scan_end1 = _win[scan + best_len - 1];
  23900. scan_end = _win[scan + best_len];
  23901. }
  23902. } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0);
  23903. if (best_len <= s.lookahead) {
  23904. return best_len;
  23905. }
  23906. return s.lookahead;
  23907. }
  23908. /* ===========================================================================
  23909. * Fill the window when the lookahead becomes insufficient.
  23910. * Updates strstart and lookahead.
  23911. *
  23912. * IN assertion: lookahead < MIN_LOOKAHEAD
  23913. * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD
  23914. * At least one byte has been read, or avail_in == 0; reads are
  23915. * performed for at least two bytes (required for the zip translate_eol
  23916. * option -- not supported here).
  23917. */
  23918. function fill_window(s) {
  23919. var _w_size = s.w_size;
  23920. var p, n, m, more, str;
  23921. //Assert(s->lookahead < MIN_LOOKAHEAD, "already enough lookahead");
  23922. do {
  23923. more = s.window_size - s.lookahead - s.strstart;
  23924. // JS ints have 32 bit, block below not needed
  23925. /* Deal with !@#$% 64K limit: */
  23926. //if (sizeof(int) <= 2) {
  23927. // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {
  23928. // more = wsize;
  23929. //
  23930. // } else if (more == (unsigned)(-1)) {
  23931. // /* Very unlikely, but possible on 16 bit machine if
  23932. // * strstart == 0 && lookahead == 1 (input done a byte at time)
  23933. // */
  23934. // more--;
  23935. // }
  23936. //}
  23937. /* If the window is almost full and there is insufficient lookahead,
  23938. * move the upper half to the lower one to make room in the upper half.
  23939. */
  23940. if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {
  23941. utils.arraySet(s.window, s.window, _w_size, _w_size, 0);
  23942. s.match_start -= _w_size;
  23943. s.strstart -= _w_size;
  23944. /* we now have strstart >= MAX_DIST */
  23945. s.block_start -= _w_size;
  23946. /* Slide the hash table (could be avoided with 32 bit values
  23947. at the expense of memory usage). We slide even when level == 0
  23948. to keep the hash table consistent if we switch back to level > 0
  23949. later. (Using level 0 permanently is not an optimal usage of
  23950. zlib, so we don't care about this pathological case.)
  23951. */
  23952. n = s.hash_size;
  23953. p = n;
  23954. do {
  23955. m = s.head[--p];
  23956. s.head[p] = (m >= _w_size ? m - _w_size : 0);
  23957. } while (--n);
  23958. n = _w_size;
  23959. p = n;
  23960. do {
  23961. m = s.prev[--p];
  23962. s.prev[p] = (m >= _w_size ? m - _w_size : 0);
  23963. /* If n is not on any hash chain, prev[n] is garbage but
  23964. * its value will never be used.
  23965. */
  23966. } while (--n);
  23967. more += _w_size;
  23968. }
  23969. if (s.strm.avail_in === 0) {
  23970. break;
  23971. }
  23972. /* If there was no sliding:
  23973. * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&
  23974. * more == window_size - lookahead - strstart
  23975. * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)
  23976. * => more >= window_size - 2*WSIZE + 2
  23977. * In the BIG_MEM or MMAP case (not yet supported),
  23978. * window_size == input_size + MIN_LOOKAHEAD &&
  23979. * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.
  23980. * Otherwise, window_size == 2*WSIZE so more >= 2.
  23981. * If there was sliding, more >= WSIZE. So in all cases, more >= 2.
  23982. */
  23983. //Assert(more >= 2, "more < 2");
  23984. n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);
  23985. s.lookahead += n;
  23986. /* Initialize the hash value now that we have some input: */
  23987. if (s.lookahead + s.insert >= MIN_MATCH) {
  23988. str = s.strstart - s.insert;
  23989. s.ins_h = s.window[str];
  23990. /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */
  23991. s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;
  23992. //#if MIN_MATCH != 3
  23993. // Call update_hash() MIN_MATCH-3 more times
  23994. //#endif
  23995. while (s.insert) {
  23996. /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */
  23997. s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;
  23998. s.prev[str & s.w_mask] = s.head[s.ins_h];
  23999. s.head[s.ins_h] = str;
  24000. str++;
  24001. s.insert--;
  24002. if (s.lookahead + s.insert < MIN_MATCH) {
  24003. break;
  24004. }
  24005. }
  24006. }
  24007. /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,
  24008. * but this is not important since only literal bytes will be emitted.
  24009. */
  24010. } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);
  24011. /* If the WIN_INIT bytes after the end of the current data have never been
  24012. * written, then zero those bytes in order to avoid memory check reports of
  24013. * the use of uninitialized (or uninitialised as Julian writes) bytes by
  24014. * the longest match routines. Update the high water mark for the next
  24015. * time through here. WIN_INIT is set to MAX_MATCH since the longest match
  24016. * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.
  24017. */
  24018. // if (s.high_water < s.window_size) {
  24019. // var curr = s.strstart + s.lookahead;
  24020. // var init = 0;
  24021. //
  24022. // if (s.high_water < curr) {
  24023. // /* Previous high water mark below current data -- zero WIN_INIT
  24024. // * bytes or up to end of window, whichever is less.
  24025. // */
  24026. // init = s.window_size - curr;
  24027. // if (init > WIN_INIT)
  24028. // init = WIN_INIT;
  24029. // zmemzero(s->window + curr, (unsigned)init);
  24030. // s->high_water = curr + init;
  24031. // }
  24032. // else if (s->high_water < (ulg)curr + WIN_INIT) {
  24033. // /* High water mark at or above current data, but below current data
  24034. // * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up
  24035. // * to end of window, whichever is less.
  24036. // */
  24037. // init = (ulg)curr + WIN_INIT - s->high_water;
  24038. // if (init > s->window_size - s->high_water)
  24039. // init = s->window_size - s->high_water;
  24040. // zmemzero(s->window + s->high_water, (unsigned)init);
  24041. // s->high_water += init;
  24042. // }
  24043. // }
  24044. //
  24045. // Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,
  24046. // "not enough room for search");
  24047. }
  24048. /* ===========================================================================
  24049. * Copy without compression as much as possible from the input stream, return
  24050. * the current block state.
  24051. * This function does not insert new strings in the dictionary since
  24052. * uncompressible data is probably not useful. This function is used
  24053. * only for the level=0 compression option.
  24054. * NOTE: this function should be optimized to avoid extra copying from
  24055. * window to pending_buf.
  24056. */
  24057. function deflate_stored(s, flush) {
  24058. /* Stored blocks are limited to 0xffff bytes, pending_buf is limited
  24059. * to pending_buf_size, and each stored block has a 5 byte header:
  24060. */
  24061. var max_block_size = 0xffff;
  24062. if (max_block_size > s.pending_buf_size - 5) {
  24063. max_block_size = s.pending_buf_size - 5;
  24064. }
  24065. /* Copy as much as possible from input to output: */
  24066. for (;;) {
  24067. /* Fill the window as much as possible: */
  24068. if (s.lookahead <= 1) {
  24069. //Assert(s->strstart < s->w_size+MAX_DIST(s) ||
  24070. // s->block_start >= (long)s->w_size, "slide too late");
  24071. // if (!(s.strstart < s.w_size + (s.w_size - MIN_LOOKAHEAD) ||
  24072. // s.block_start >= s.w_size)) {
  24073. // throw new Error("slide too late");
  24074. // }
  24075. fill_window(s);
  24076. if (s.lookahead === 0 && flush === Z_NO_FLUSH) {
  24077. return BS_NEED_MORE;
  24078. }
  24079. if (s.lookahead === 0) {
  24080. break;
  24081. }
  24082. /* flush the current block */
  24083. }
  24084. //Assert(s->block_start >= 0L, "block gone");
  24085. // if (s.block_start < 0) throw new Error("block gone");
  24086. s.strstart += s.lookahead;
  24087. s.lookahead = 0;
  24088. /* Emit a stored block if pending_buf will be full: */
  24089. var max_start = s.block_start + max_block_size;
  24090. if (s.strstart === 0 || s.strstart >= max_start) {
  24091. /* strstart == 0 is possible when wraparound on 16-bit machine */
  24092. s.lookahead = s.strstart - max_start;
  24093. s.strstart = max_start;
  24094. /*** FLUSH_BLOCK(s, 0); ***/
  24095. flush_block_only(s, false);
  24096. if (s.strm.avail_out === 0) {
  24097. return BS_NEED_MORE;
  24098. }
  24099. /***/
  24100. }
  24101. /* Flush if we may have to slide, otherwise block_start may become
  24102. * negative and the data will be gone:
  24103. */
  24104. if (s.strstart - s.block_start >= (s.w_size - MIN_LOOKAHEAD)) {
  24105. /*** FLUSH_BLOCK(s, 0); ***/
  24106. flush_block_only(s, false);
  24107. if (s.strm.avail_out === 0) {
  24108. return BS_NEED_MORE;
  24109. }
  24110. /***/
  24111. }
  24112. }
  24113. s.insert = 0;
  24114. if (flush === Z_FINISH) {
  24115. /*** FLUSH_BLOCK(s, 1); ***/
  24116. flush_block_only(s, true);
  24117. if (s.strm.avail_out === 0) {
  24118. return BS_FINISH_STARTED;
  24119. }
  24120. /***/
  24121. return BS_FINISH_DONE;
  24122. }
  24123. if (s.strstart > s.block_start) {
  24124. /*** FLUSH_BLOCK(s, 0); ***/
  24125. flush_block_only(s, false);
  24126. if (s.strm.avail_out === 0) {
  24127. return BS_NEED_MORE;
  24128. }
  24129. /***/
  24130. }
  24131. return BS_NEED_MORE;
  24132. }
  24133. /* ===========================================================================
  24134. * Compress as much as possible from the input stream, return the current
  24135. * block state.
  24136. * This function does not perform lazy evaluation of matches and inserts
  24137. * new strings in the dictionary only for unmatched strings or for short
  24138. * matches. It is used only for the fast compression options.
  24139. */
  24140. function deflate_fast(s, flush) {
  24141. var hash_head; /* head of the hash chain */
  24142. var bflush; /* set if current block must be flushed */
  24143. for (;;) {
  24144. /* Make sure that we always have enough lookahead, except
  24145. * at the end of the input file. We need MAX_MATCH bytes
  24146. * for the next match, plus MIN_MATCH bytes to insert the
  24147. * string following the next match.
  24148. */
  24149. if (s.lookahead < MIN_LOOKAHEAD) {
  24150. fill_window(s);
  24151. if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {
  24152. return BS_NEED_MORE;
  24153. }
  24154. if (s.lookahead === 0) {
  24155. break; /* flush the current block */
  24156. }
  24157. }
  24158. /* Insert the string window[strstart .. strstart+2] in the
  24159. * dictionary, and set hash_head to the head of the hash chain:
  24160. */
  24161. hash_head = 0/*NIL*/;
  24162. if (s.lookahead >= MIN_MATCH) {
  24163. /*** INSERT_STRING(s, s.strstart, hash_head); ***/
  24164. s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;
  24165. hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
  24166. s.head[s.ins_h] = s.strstart;
  24167. /***/
  24168. }
  24169. /* Find the longest match, discarding those <= prev_length.
  24170. * At this point we have always match_length < MIN_MATCH
  24171. */
  24172. if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {
  24173. /* To simplify the code, we prevent matches with the string
  24174. * of window index 0 (in particular we have to avoid a match
  24175. * of the string with itself at the start of the input file).
  24176. */
  24177. s.match_length = longest_match(s, hash_head);
  24178. /* longest_match() sets match_start */
  24179. }
  24180. if (s.match_length >= MIN_MATCH) {
  24181. // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only
  24182. /*** _tr_tally_dist(s, s.strstart - s.match_start,
  24183. s.match_length - MIN_MATCH, bflush); ***/
  24184. bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);
  24185. s.lookahead -= s.match_length;
  24186. /* Insert new strings in the hash table only if the match length
  24187. * is not too large. This saves time but degrades compression.
  24188. */
  24189. if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {
  24190. s.match_length--; /* string at strstart already in table */
  24191. do {
  24192. s.strstart++;
  24193. /*** INSERT_STRING(s, s.strstart, hash_head); ***/
  24194. s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;
  24195. hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
  24196. s.head[s.ins_h] = s.strstart;
  24197. /***/
  24198. /* strstart never exceeds WSIZE-MAX_MATCH, so there are
  24199. * always MIN_MATCH bytes ahead.
  24200. */
  24201. } while (--s.match_length !== 0);
  24202. s.strstart++;
  24203. } else
  24204. {
  24205. s.strstart += s.match_length;
  24206. s.match_length = 0;
  24207. s.ins_h = s.window[s.strstart];
  24208. /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */
  24209. s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;
  24210. //#if MIN_MATCH != 3
  24211. // Call UPDATE_HASH() MIN_MATCH-3 more times
  24212. //#endif
  24213. /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not
  24214. * matter since it will be recomputed at next deflate call.
  24215. */
  24216. }
  24217. } else {
  24218. /* No match, output a literal byte */
  24219. //Tracevv((stderr,"%c", s.window[s.strstart]));
  24220. /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/
  24221. bflush = trees._tr_tally(s, 0, s.window[s.strstart]);
  24222. s.lookahead--;
  24223. s.strstart++;
  24224. }
  24225. if (bflush) {
  24226. /*** FLUSH_BLOCK(s, 0); ***/
  24227. flush_block_only(s, false);
  24228. if (s.strm.avail_out === 0) {
  24229. return BS_NEED_MORE;
  24230. }
  24231. /***/
  24232. }
  24233. }
  24234. s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);
  24235. if (flush === Z_FINISH) {
  24236. /*** FLUSH_BLOCK(s, 1); ***/
  24237. flush_block_only(s, true);
  24238. if (s.strm.avail_out === 0) {
  24239. return BS_FINISH_STARTED;
  24240. }
  24241. /***/
  24242. return BS_FINISH_DONE;
  24243. }
  24244. if (s.last_lit) {
  24245. /*** FLUSH_BLOCK(s, 0); ***/
  24246. flush_block_only(s, false);
  24247. if (s.strm.avail_out === 0) {
  24248. return BS_NEED_MORE;
  24249. }
  24250. /***/
  24251. }
  24252. return BS_BLOCK_DONE;
  24253. }
  24254. /* ===========================================================================
  24255. * Same as above, but achieves better compression. We use a lazy
  24256. * evaluation for matches: a match is finally adopted only if there is
  24257. * no better match at the next window position.
  24258. */
  24259. function deflate_slow(s, flush) {
  24260. var hash_head; /* head of hash chain */
  24261. var bflush; /* set if current block must be flushed */
  24262. var max_insert;
  24263. /* Process the input block. */
  24264. for (;;) {
  24265. /* Make sure that we always have enough lookahead, except
  24266. * at the end of the input file. We need MAX_MATCH bytes
  24267. * for the next match, plus MIN_MATCH bytes to insert the
  24268. * string following the next match.
  24269. */
  24270. if (s.lookahead < MIN_LOOKAHEAD) {
  24271. fill_window(s);
  24272. if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {
  24273. return BS_NEED_MORE;
  24274. }
  24275. if (s.lookahead === 0) { break; } /* flush the current block */
  24276. }
  24277. /* Insert the string window[strstart .. strstart+2] in the
  24278. * dictionary, and set hash_head to the head of the hash chain:
  24279. */
  24280. hash_head = 0/*NIL*/;
  24281. if (s.lookahead >= MIN_MATCH) {
  24282. /*** INSERT_STRING(s, s.strstart, hash_head); ***/
  24283. s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;
  24284. hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
  24285. s.head[s.ins_h] = s.strstart;
  24286. /***/
  24287. }
  24288. /* Find the longest match, discarding those <= prev_length.
  24289. */
  24290. s.prev_length = s.match_length;
  24291. s.prev_match = s.match_start;
  24292. s.match_length = MIN_MATCH - 1;
  24293. if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&
  24294. s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {
  24295. /* To simplify the code, we prevent matches with the string
  24296. * of window index 0 (in particular we have to avoid a match
  24297. * of the string with itself at the start of the input file).
  24298. */
  24299. s.match_length = longest_match(s, hash_head);
  24300. /* longest_match() sets match_start */
  24301. if (s.match_length <= 5 &&
  24302. (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {
  24303. /* If prev_match is also MIN_MATCH, match_start is garbage
  24304. * but we will ignore the current match anyway.
  24305. */
  24306. s.match_length = MIN_MATCH - 1;
  24307. }
  24308. }
  24309. /* If there was a match at the previous step and the current
  24310. * match is not better, output the previous match:
  24311. */
  24312. if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {
  24313. max_insert = s.strstart + s.lookahead - MIN_MATCH;
  24314. /* Do not insert strings in hash table beyond this. */
  24315. //check_match(s, s.strstart-1, s.prev_match, s.prev_length);
  24316. /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,
  24317. s.prev_length - MIN_MATCH, bflush);***/
  24318. bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);
  24319. /* Insert in hash table all strings up to the end of the match.
  24320. * strstart-1 and strstart are already inserted. If there is not
  24321. * enough lookahead, the last two strings are not inserted in
  24322. * the hash table.
  24323. */
  24324. s.lookahead -= s.prev_length - 1;
  24325. s.prev_length -= 2;
  24326. do {
  24327. if (++s.strstart <= max_insert) {
  24328. /*** INSERT_STRING(s, s.strstart, hash_head); ***/
  24329. s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;
  24330. hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
  24331. s.head[s.ins_h] = s.strstart;
  24332. /***/
  24333. }
  24334. } while (--s.prev_length !== 0);
  24335. s.match_available = 0;
  24336. s.match_length = MIN_MATCH - 1;
  24337. s.strstart++;
  24338. if (bflush) {
  24339. /*** FLUSH_BLOCK(s, 0); ***/
  24340. flush_block_only(s, false);
  24341. if (s.strm.avail_out === 0) {
  24342. return BS_NEED_MORE;
  24343. }
  24344. /***/
  24345. }
  24346. } else if (s.match_available) {
  24347. /* If there was no match at the previous position, output a
  24348. * single literal. If there was a match but the current match
  24349. * is longer, truncate the previous match to a single literal.
  24350. */
  24351. //Tracevv((stderr,"%c", s->window[s->strstart-1]));
  24352. /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/
  24353. bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);
  24354. if (bflush) {
  24355. /*** FLUSH_BLOCK_ONLY(s, 0) ***/
  24356. flush_block_only(s, false);
  24357. /***/
  24358. }
  24359. s.strstart++;
  24360. s.lookahead--;
  24361. if (s.strm.avail_out === 0) {
  24362. return BS_NEED_MORE;
  24363. }
  24364. } else {
  24365. /* There is no previous match to compare with, wait for
  24366. * the next step to decide.
  24367. */
  24368. s.match_available = 1;
  24369. s.strstart++;
  24370. s.lookahead--;
  24371. }
  24372. }
  24373. //Assert (flush != Z_NO_FLUSH, "no flush?");
  24374. if (s.match_available) {
  24375. //Tracevv((stderr,"%c", s->window[s->strstart-1]));
  24376. /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/
  24377. bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);
  24378. s.match_available = 0;
  24379. }
  24380. s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;
  24381. if (flush === Z_FINISH) {
  24382. /*** FLUSH_BLOCK(s, 1); ***/
  24383. flush_block_only(s, true);
  24384. if (s.strm.avail_out === 0) {
  24385. return BS_FINISH_STARTED;
  24386. }
  24387. /***/
  24388. return BS_FINISH_DONE;
  24389. }
  24390. if (s.last_lit) {
  24391. /*** FLUSH_BLOCK(s, 0); ***/
  24392. flush_block_only(s, false);
  24393. if (s.strm.avail_out === 0) {
  24394. return BS_NEED_MORE;
  24395. }
  24396. /***/
  24397. }
  24398. return BS_BLOCK_DONE;
  24399. }
  24400. /* ===========================================================================
  24401. * For Z_RLE, simply look for runs of bytes, generate matches only of distance
  24402. * one. Do not maintain a hash table. (It will be regenerated if this run of
  24403. * deflate switches away from Z_RLE.)
  24404. */
  24405. function deflate_rle(s, flush) {
  24406. var bflush; /* set if current block must be flushed */
  24407. var prev; /* byte at distance one to match */
  24408. var scan, strend; /* scan goes up to strend for length of run */
  24409. var _win = s.window;
  24410. for (;;) {
  24411. /* Make sure that we always have enough lookahead, except
  24412. * at the end of the input file. We need MAX_MATCH bytes
  24413. * for the longest run, plus one for the unrolled loop.
  24414. */
  24415. if (s.lookahead <= MAX_MATCH) {
  24416. fill_window(s);
  24417. if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {
  24418. return BS_NEED_MORE;
  24419. }
  24420. if (s.lookahead === 0) { break; } /* flush the current block */
  24421. }
  24422. /* See how many times the previous byte repeats */
  24423. s.match_length = 0;
  24424. if (s.lookahead >= MIN_MATCH && s.strstart > 0) {
  24425. scan = s.strstart - 1;
  24426. prev = _win[scan];
  24427. if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {
  24428. strend = s.strstart + MAX_MATCH;
  24429. do {
  24430. /*jshint noempty:false*/
  24431. } while (prev === _win[++scan] && prev === _win[++scan] &&
  24432. prev === _win[++scan] && prev === _win[++scan] &&
  24433. prev === _win[++scan] && prev === _win[++scan] &&
  24434. prev === _win[++scan] && prev === _win[++scan] &&
  24435. scan < strend);
  24436. s.match_length = MAX_MATCH - (strend - scan);
  24437. if (s.match_length > s.lookahead) {
  24438. s.match_length = s.lookahead;
  24439. }
  24440. }
  24441. //Assert(scan <= s->window+(uInt)(s->window_size-1), "wild scan");
  24442. }
  24443. /* Emit match if have run of MIN_MATCH or longer, else emit literal */
  24444. if (s.match_length >= MIN_MATCH) {
  24445. //check_match(s, s.strstart, s.strstart - 1, s.match_length);
  24446. /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/
  24447. bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);
  24448. s.lookahead -= s.match_length;
  24449. s.strstart += s.match_length;
  24450. s.match_length = 0;
  24451. } else {
  24452. /* No match, output a literal byte */
  24453. //Tracevv((stderr,"%c", s->window[s->strstart]));
  24454. /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/
  24455. bflush = trees._tr_tally(s, 0, s.window[s.strstart]);
  24456. s.lookahead--;
  24457. s.strstart++;
  24458. }
  24459. if (bflush) {
  24460. /*** FLUSH_BLOCK(s, 0); ***/
  24461. flush_block_only(s, false);
  24462. if (s.strm.avail_out === 0) {
  24463. return BS_NEED_MORE;
  24464. }
  24465. /***/
  24466. }
  24467. }
  24468. s.insert = 0;
  24469. if (flush === Z_FINISH) {
  24470. /*** FLUSH_BLOCK(s, 1); ***/
  24471. flush_block_only(s, true);
  24472. if (s.strm.avail_out === 0) {
  24473. return BS_FINISH_STARTED;
  24474. }
  24475. /***/
  24476. return BS_FINISH_DONE;
  24477. }
  24478. if (s.last_lit) {
  24479. /*** FLUSH_BLOCK(s, 0); ***/
  24480. flush_block_only(s, false);
  24481. if (s.strm.avail_out === 0) {
  24482. return BS_NEED_MORE;
  24483. }
  24484. /***/
  24485. }
  24486. return BS_BLOCK_DONE;
  24487. }
  24488. /* ===========================================================================
  24489. * For Z_HUFFMAN_ONLY, do not look for matches. Do not maintain a hash table.
  24490. * (It will be regenerated if this run of deflate switches away from Huffman.)
  24491. */
  24492. function deflate_huff(s, flush) {
  24493. var bflush; /* set if current block must be flushed */
  24494. for (;;) {
  24495. /* Make sure that we have a literal to write. */
  24496. if (s.lookahead === 0) {
  24497. fill_window(s);
  24498. if (s.lookahead === 0) {
  24499. if (flush === Z_NO_FLUSH) {
  24500. return BS_NEED_MORE;
  24501. }
  24502. break; /* flush the current block */
  24503. }
  24504. }
  24505. /* Output a literal byte */
  24506. s.match_length = 0;
  24507. //Tracevv((stderr,"%c", s->window[s->strstart]));
  24508. /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/
  24509. bflush = trees._tr_tally(s, 0, s.window[s.strstart]);
  24510. s.lookahead--;
  24511. s.strstart++;
  24512. if (bflush) {
  24513. /*** FLUSH_BLOCK(s, 0); ***/
  24514. flush_block_only(s, false);
  24515. if (s.strm.avail_out === 0) {
  24516. return BS_NEED_MORE;
  24517. }
  24518. /***/
  24519. }
  24520. }
  24521. s.insert = 0;
  24522. if (flush === Z_FINISH) {
  24523. /*** FLUSH_BLOCK(s, 1); ***/
  24524. flush_block_only(s, true);
  24525. if (s.strm.avail_out === 0) {
  24526. return BS_FINISH_STARTED;
  24527. }
  24528. /***/
  24529. return BS_FINISH_DONE;
  24530. }
  24531. if (s.last_lit) {
  24532. /*** FLUSH_BLOCK(s, 0); ***/
  24533. flush_block_only(s, false);
  24534. if (s.strm.avail_out === 0) {
  24535. return BS_NEED_MORE;
  24536. }
  24537. /***/
  24538. }
  24539. return BS_BLOCK_DONE;
  24540. }
  24541. /* Values for max_lazy_match, good_match and max_chain_length, depending on
  24542. * the desired pack level (0..9). The values given below have been tuned to
  24543. * exclude worst case performance for pathological files. Better values may be
  24544. * found for specific files.
  24545. */
  24546. function Config(good_length, max_lazy, nice_length, max_chain, func) {
  24547. this.good_length = good_length;
  24548. this.max_lazy = max_lazy;
  24549. this.nice_length = nice_length;
  24550. this.max_chain = max_chain;
  24551. this.func = func;
  24552. }
  24553. var configuration_table;
  24554. configuration_table = [
  24555. /* good lazy nice chain */
  24556. new Config(0, 0, 0, 0, deflate_stored), /* 0 store only */
  24557. new Config(4, 4, 8, 4, deflate_fast), /* 1 max speed, no lazy matches */
  24558. new Config(4, 5, 16, 8, deflate_fast), /* 2 */
  24559. new Config(4, 6, 32, 32, deflate_fast), /* 3 */
  24560. new Config(4, 4, 16, 16, deflate_slow), /* 4 lazy matches */
  24561. new Config(8, 16, 32, 32, deflate_slow), /* 5 */
  24562. new Config(8, 16, 128, 128, deflate_slow), /* 6 */
  24563. new Config(8, 32, 128, 256, deflate_slow), /* 7 */
  24564. new Config(32, 128, 258, 1024, deflate_slow), /* 8 */
  24565. new Config(32, 258, 258, 4096, deflate_slow) /* 9 max compression */
  24566. ];
  24567. /* ===========================================================================
  24568. * Initialize the "longest match" routines for a new zlib stream
  24569. */
  24570. function lm_init(s) {
  24571. s.window_size = 2 * s.w_size;
  24572. /*** CLEAR_HASH(s); ***/
  24573. zero(s.head); // Fill with NIL (= 0);
  24574. /* Set the default configuration parameters:
  24575. */
  24576. s.max_lazy_match = configuration_table[s.level].max_lazy;
  24577. s.good_match = configuration_table[s.level].good_length;
  24578. s.nice_match = configuration_table[s.level].nice_length;
  24579. s.max_chain_length = configuration_table[s.level].max_chain;
  24580. s.strstart = 0;
  24581. s.block_start = 0;
  24582. s.lookahead = 0;
  24583. s.insert = 0;
  24584. s.match_length = s.prev_length = MIN_MATCH - 1;
  24585. s.match_available = 0;
  24586. s.ins_h = 0;
  24587. }
  24588. function DeflateState() {
  24589. this.strm = null; /* pointer back to this zlib stream */
  24590. this.status = 0; /* as the name implies */
  24591. this.pending_buf = null; /* output still pending */
  24592. this.pending_buf_size = 0; /* size of pending_buf */
  24593. this.pending_out = 0; /* next pending byte to output to the stream */
  24594. this.pending = 0; /* nb of bytes in the pending buffer */
  24595. this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */
  24596. this.gzhead = null; /* gzip header information to write */
  24597. this.gzindex = 0; /* where in extra, name, or comment */
  24598. this.method = Z_DEFLATED; /* can only be DEFLATED */
  24599. this.last_flush = -1; /* value of flush param for previous deflate call */
  24600. this.w_size = 0; /* LZ77 window size (32K by default) */
  24601. this.w_bits = 0; /* log2(w_size) (8..16) */
  24602. this.w_mask = 0; /* w_size - 1 */
  24603. this.window = null;
  24604. /* Sliding window. Input bytes are read into the second half of the window,
  24605. * and move to the first half later to keep a dictionary of at least wSize
  24606. * bytes. With this organization, matches are limited to a distance of
  24607. * wSize-MAX_MATCH bytes, but this ensures that IO is always
  24608. * performed with a length multiple of the block size.
  24609. */
  24610. this.window_size = 0;
  24611. /* Actual size of window: 2*wSize, except when the user input buffer
  24612. * is directly used as sliding window.
  24613. */
  24614. this.prev = null;
  24615. /* Link to older string with same hash index. To limit the size of this
  24616. * array to 64K, this link is maintained only for the last 32K strings.
  24617. * An index in this array is thus a window index modulo 32K.
  24618. */
  24619. this.head = null; /* Heads of the hash chains or NIL. */
  24620. this.ins_h = 0; /* hash index of string to be inserted */
  24621. this.hash_size = 0; /* number of elements in hash table */
  24622. this.hash_bits = 0; /* log2(hash_size) */
  24623. this.hash_mask = 0; /* hash_size-1 */
  24624. this.hash_shift = 0;
  24625. /* Number of bits by which ins_h must be shifted at each input
  24626. * step. It must be such that after MIN_MATCH steps, the oldest
  24627. * byte no longer takes part in the hash key, that is:
  24628. * hash_shift * MIN_MATCH >= hash_bits
  24629. */
  24630. this.block_start = 0;
  24631. /* Window position at the beginning of the current output block. Gets
  24632. * negative when the window is moved backwards.
  24633. */
  24634. this.match_length = 0; /* length of best match */
  24635. this.prev_match = 0; /* previous match */
  24636. this.match_available = 0; /* set if previous match exists */
  24637. this.strstart = 0; /* start of string to insert */
  24638. this.match_start = 0; /* start of matching string */
  24639. this.lookahead = 0; /* number of valid bytes ahead in window */
  24640. this.prev_length = 0;
  24641. /* Length of the best match at previous step. Matches not greater than this
  24642. * are discarded. This is used in the lazy match evaluation.
  24643. */
  24644. this.max_chain_length = 0;
  24645. /* To speed up deflation, hash chains are never searched beyond this
  24646. * length. A higher limit improves compression ratio but degrades the
  24647. * speed.
  24648. */
  24649. this.max_lazy_match = 0;
  24650. /* Attempt to find a better match only when the current match is strictly
  24651. * smaller than this value. This mechanism is used only for compression
  24652. * levels >= 4.
  24653. */
  24654. // That's alias to max_lazy_match, don't use directly
  24655. //this.max_insert_length = 0;
  24656. /* Insert new strings in the hash table only if the match length is not
  24657. * greater than this length. This saves time but degrades compression.
  24658. * max_insert_length is used only for compression levels <= 3.
  24659. */
  24660. this.level = 0; /* compression level (1..9) */
  24661. this.strategy = 0; /* favor or force Huffman coding*/
  24662. this.good_match = 0;
  24663. /* Use a faster search when the previous match is longer than this */
  24664. this.nice_match = 0; /* Stop searching when current match exceeds this */
  24665. /* used by trees.c: */
  24666. /* Didn't use ct_data typedef below to suppress compiler warning */
  24667. // struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */
  24668. // struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */
  24669. // struct ct_data_s bl_tree[2*BL_CODES+1]; /* Huffman tree for bit lengths */
  24670. // Use flat array of DOUBLE size, with interleaved fata,
  24671. // because JS does not support effective
  24672. this.dyn_ltree = new utils.Buf16(HEAP_SIZE * 2);
  24673. this.dyn_dtree = new utils.Buf16((2 * D_CODES + 1) * 2);
  24674. this.bl_tree = new utils.Buf16((2 * BL_CODES + 1) * 2);
  24675. zero(this.dyn_ltree);
  24676. zero(this.dyn_dtree);
  24677. zero(this.bl_tree);
  24678. this.l_desc = null; /* desc. for literal tree */
  24679. this.d_desc = null; /* desc. for distance tree */
  24680. this.bl_desc = null; /* desc. for bit length tree */
  24681. //ush bl_count[MAX_BITS+1];
  24682. this.bl_count = new utils.Buf16(MAX_BITS + 1);
  24683. /* number of codes at each bit length for an optimal tree */
  24684. //int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */
  24685. this.heap = new utils.Buf16(2 * L_CODES + 1); /* heap used to build the Huffman trees */
  24686. zero(this.heap);
  24687. this.heap_len = 0; /* number of elements in the heap */
  24688. this.heap_max = 0; /* element of largest frequency */
  24689. /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used.
  24690. * The same heap array is used to build all trees.
  24691. */
  24692. this.depth = new utils.Buf16(2 * L_CODES + 1); //uch depth[2*L_CODES+1];
  24693. zero(this.depth);
  24694. /* Depth of each subtree used as tie breaker for trees of equal frequency
  24695. */
  24696. this.l_buf = 0; /* buffer index for literals or lengths */
  24697. this.lit_bufsize = 0;
  24698. /* Size of match buffer for literals/lengths. There are 4 reasons for
  24699. * limiting lit_bufsize to 64K:
  24700. * - frequencies can be kept in 16 bit counters
  24701. * - if compression is not successful for the first block, all input
  24702. * data is still in the window so we can still emit a stored block even
  24703. * when input comes from standard input. (This can also be done for
  24704. * all blocks if lit_bufsize is not greater than 32K.)
  24705. * - if compression is not successful for a file smaller than 64K, we can
  24706. * even emit a stored file instead of a stored block (saving 5 bytes).
  24707. * This is applicable only for zip (not gzip or zlib).
  24708. * - creating new Huffman trees less frequently may not provide fast
  24709. * adaptation to changes in the input data statistics. (Take for
  24710. * example a binary file with poorly compressible code followed by
  24711. * a highly compressible string table.) Smaller buffer sizes give
  24712. * fast adaptation but have of course the overhead of transmitting
  24713. * trees more frequently.
  24714. * - I can't count above 4
  24715. */
  24716. this.last_lit = 0; /* running index in l_buf */
  24717. this.d_buf = 0;
  24718. /* Buffer index for distances. To simplify the code, d_buf and l_buf have
  24719. * the same number of elements. To use different lengths, an extra flag
  24720. * array would be necessary.
  24721. */
  24722. this.opt_len = 0; /* bit length of current block with optimal trees */
  24723. this.static_len = 0; /* bit length of current block with static trees */
  24724. this.matches = 0; /* number of string matches in current block */
  24725. this.insert = 0; /* bytes at end of window left to insert */
  24726. this.bi_buf = 0;
  24727. /* Output buffer. bits are inserted starting at the bottom (least
  24728. * significant bits).
  24729. */
  24730. this.bi_valid = 0;
  24731. /* Number of valid bits in bi_buf. All bits above the last valid bit
  24732. * are always zero.
  24733. */
  24734. // Used for window memory init. We safely ignore it for JS. That makes
  24735. // sense only for pointers and memory check tools.
  24736. //this.high_water = 0;
  24737. /* High water mark offset in window for initialized bytes -- bytes above
  24738. * this are set to zero in order to avoid memory check warnings when
  24739. * longest match routines access bytes past the input. This is then
  24740. * updated to the new high water mark.
  24741. */
  24742. }
  24743. function deflateResetKeep(strm) {
  24744. var s;
  24745. if (!strm || !strm.state) {
  24746. return err(strm, Z_STREAM_ERROR);
  24747. }
  24748. strm.total_in = strm.total_out = 0;
  24749. strm.data_type = Z_UNKNOWN;
  24750. s = strm.state;
  24751. s.pending = 0;
  24752. s.pending_out = 0;
  24753. if (s.wrap < 0) {
  24754. s.wrap = -s.wrap;
  24755. /* was made negative by deflate(..., Z_FINISH); */
  24756. }
  24757. s.status = (s.wrap ? INIT_STATE : BUSY_STATE);
  24758. strm.adler = (s.wrap === 2) ?
  24759. 0 // crc32(0, Z_NULL, 0)
  24760. :
  24761. 1; // adler32(0, Z_NULL, 0)
  24762. s.last_flush = Z_NO_FLUSH;
  24763. trees._tr_init(s);
  24764. return Z_OK;
  24765. }
  24766. function deflateReset(strm) {
  24767. var ret = deflateResetKeep(strm);
  24768. if (ret === Z_OK) {
  24769. lm_init(strm.state);
  24770. }
  24771. return ret;
  24772. }
  24773. function deflateSetHeader(strm, head) {
  24774. if (!strm || !strm.state) { return Z_STREAM_ERROR; }
  24775. if (strm.state.wrap !== 2) { return Z_STREAM_ERROR; }
  24776. strm.state.gzhead = head;
  24777. return Z_OK;
  24778. }
  24779. function deflateInit2(strm, level, method, windowBits, memLevel, strategy) {
  24780. if (!strm) { // === Z_NULL
  24781. return Z_STREAM_ERROR;
  24782. }
  24783. var wrap = 1;
  24784. if (level === Z_DEFAULT_COMPRESSION) {
  24785. level = 6;
  24786. }
  24787. if (windowBits < 0) { /* suppress zlib wrapper */
  24788. wrap = 0;
  24789. windowBits = -windowBits;
  24790. }
  24791. else if (windowBits > 15) {
  24792. wrap = 2; /* write gzip wrapper instead */
  24793. windowBits -= 16;
  24794. }
  24795. if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED ||
  24796. windowBits < 8 || windowBits > 15 || level < 0 || level > 9 ||
  24797. strategy < 0 || strategy > Z_FIXED) {
  24798. return err(strm, Z_STREAM_ERROR);
  24799. }
  24800. if (windowBits === 8) {
  24801. windowBits = 9;
  24802. }
  24803. /* until 256-byte window bug fixed */
  24804. var s = new DeflateState();
  24805. strm.state = s;
  24806. s.strm = strm;
  24807. s.wrap = wrap;
  24808. s.gzhead = null;
  24809. s.w_bits = windowBits;
  24810. s.w_size = 1 << s.w_bits;
  24811. s.w_mask = s.w_size - 1;
  24812. s.hash_bits = memLevel + 7;
  24813. s.hash_size = 1 << s.hash_bits;
  24814. s.hash_mask = s.hash_size - 1;
  24815. s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH);
  24816. s.window = new utils.Buf8(s.w_size * 2);
  24817. s.head = new utils.Buf16(s.hash_size);
  24818. s.prev = new utils.Buf16(s.w_size);
  24819. // Don't need mem init magic for JS.
  24820. //s.high_water = 0; /* nothing written to s->window yet */
  24821. s.lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */
  24822. s.pending_buf_size = s.lit_bufsize * 4;
  24823. //overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2);
  24824. //s->pending_buf = (uchf *) overlay;
  24825. s.pending_buf = new utils.Buf8(s.pending_buf_size);
  24826. // It is offset from `s.pending_buf` (size is `s.lit_bufsize * 2`)
  24827. //s->d_buf = overlay + s->lit_bufsize/sizeof(ush);
  24828. s.d_buf = 1 * s.lit_bufsize;
  24829. //s->l_buf = s->pending_buf + (1+sizeof(ush))*s->lit_bufsize;
  24830. s.l_buf = (1 + 2) * s.lit_bufsize;
  24831. s.level = level;
  24832. s.strategy = strategy;
  24833. s.method = method;
  24834. return deflateReset(strm);
  24835. }
  24836. function deflateInit(strm, level) {
  24837. return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY);
  24838. }
  24839. function deflate(strm, flush) {
  24840. var old_flush, s;
  24841. var beg, val; // for gzip header write only
  24842. if (!strm || !strm.state ||
  24843. flush > Z_BLOCK || flush < 0) {
  24844. return strm ? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR;
  24845. }
  24846. s = strm.state;
  24847. if (!strm.output ||
  24848. (!strm.input && strm.avail_in !== 0) ||
  24849. (s.status === FINISH_STATE && flush !== Z_FINISH)) {
  24850. return err(strm, (strm.avail_out === 0) ? Z_BUF_ERROR : Z_STREAM_ERROR);
  24851. }
  24852. s.strm = strm; /* just in case */
  24853. old_flush = s.last_flush;
  24854. s.last_flush = flush;
  24855. /* Write the header */
  24856. if (s.status === INIT_STATE) {
  24857. if (s.wrap === 2) { // GZIP header
  24858. strm.adler = 0; //crc32(0L, Z_NULL, 0);
  24859. put_byte(s, 31);
  24860. put_byte(s, 139);
  24861. put_byte(s, 8);
  24862. if (!s.gzhead) { // s->gzhead == Z_NULL
  24863. put_byte(s, 0);
  24864. put_byte(s, 0);
  24865. put_byte(s, 0);
  24866. put_byte(s, 0);
  24867. put_byte(s, 0);
  24868. put_byte(s, s.level === 9 ? 2 :
  24869. (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ?
  24870. 4 : 0));
  24871. put_byte(s, OS_CODE);
  24872. s.status = BUSY_STATE;
  24873. }
  24874. else {
  24875. put_byte(s, (s.gzhead.text ? 1 : 0) +
  24876. (s.gzhead.hcrc ? 2 : 0) +
  24877. (!s.gzhead.extra ? 0 : 4) +
  24878. (!s.gzhead.name ? 0 : 8) +
  24879. (!s.gzhead.comment ? 0 : 16)
  24880. );
  24881. put_byte(s, s.gzhead.time & 0xff);
  24882. put_byte(s, (s.gzhead.time >> 8) & 0xff);
  24883. put_byte(s, (s.gzhead.time >> 16) & 0xff);
  24884. put_byte(s, (s.gzhead.time >> 24) & 0xff);
  24885. put_byte(s, s.level === 9 ? 2 :
  24886. (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ?
  24887. 4 : 0));
  24888. put_byte(s, s.gzhead.os & 0xff);
  24889. if (s.gzhead.extra && s.gzhead.extra.length) {
  24890. put_byte(s, s.gzhead.extra.length & 0xff);
  24891. put_byte(s, (s.gzhead.extra.length >> 8) & 0xff);
  24892. }
  24893. if (s.gzhead.hcrc) {
  24894. strm.adler = crc32(strm.adler, s.pending_buf, s.pending, 0);
  24895. }
  24896. s.gzindex = 0;
  24897. s.status = EXTRA_STATE;
  24898. }
  24899. }
  24900. else // DEFLATE header
  24901. {
  24902. var header = (Z_DEFLATED + ((s.w_bits - 8) << 4)) << 8;
  24903. var level_flags = -1;
  24904. if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2) {
  24905. level_flags = 0;
  24906. } else if (s.level < 6) {
  24907. level_flags = 1;
  24908. } else if (s.level === 6) {
  24909. level_flags = 2;
  24910. } else {
  24911. level_flags = 3;
  24912. }
  24913. header |= (level_flags << 6);
  24914. if (s.strstart !== 0) { header |= PRESET_DICT; }
  24915. header += 31 - (header % 31);
  24916. s.status = BUSY_STATE;
  24917. putShortMSB(s, header);
  24918. /* Save the adler32 of the preset dictionary: */
  24919. if (s.strstart !== 0) {
  24920. putShortMSB(s, strm.adler >>> 16);
  24921. putShortMSB(s, strm.adler & 0xffff);
  24922. }
  24923. strm.adler = 1; // adler32(0L, Z_NULL, 0);
  24924. }
  24925. }
  24926. //#ifdef GZIP
  24927. if (s.status === EXTRA_STATE) {
  24928. if (s.gzhead.extra/* != Z_NULL*/) {
  24929. beg = s.pending; /* start of bytes to update crc */
  24930. while (s.gzindex < (s.gzhead.extra.length & 0xffff)) {
  24931. if (s.pending === s.pending_buf_size) {
  24932. if (s.gzhead.hcrc && s.pending > beg) {
  24933. strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
  24934. }
  24935. flush_pending(strm);
  24936. beg = s.pending;
  24937. if (s.pending === s.pending_buf_size) {
  24938. break;
  24939. }
  24940. }
  24941. put_byte(s, s.gzhead.extra[s.gzindex] & 0xff);
  24942. s.gzindex++;
  24943. }
  24944. if (s.gzhead.hcrc && s.pending > beg) {
  24945. strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
  24946. }
  24947. if (s.gzindex === s.gzhead.extra.length) {
  24948. s.gzindex = 0;
  24949. s.status = NAME_STATE;
  24950. }
  24951. }
  24952. else {
  24953. s.status = NAME_STATE;
  24954. }
  24955. }
  24956. if (s.status === NAME_STATE) {
  24957. if (s.gzhead.name/* != Z_NULL*/) {
  24958. beg = s.pending; /* start of bytes to update crc */
  24959. //int val;
  24960. do {
  24961. if (s.pending === s.pending_buf_size) {
  24962. if (s.gzhead.hcrc && s.pending > beg) {
  24963. strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
  24964. }
  24965. flush_pending(strm);
  24966. beg = s.pending;
  24967. if (s.pending === s.pending_buf_size) {
  24968. val = 1;
  24969. break;
  24970. }
  24971. }
  24972. // JS specific: little magic to add zero terminator to end of string
  24973. if (s.gzindex < s.gzhead.name.length) {
  24974. val = s.gzhead.name.charCodeAt(s.gzindex++) & 0xff;
  24975. } else {
  24976. val = 0;
  24977. }
  24978. put_byte(s, val);
  24979. } while (val !== 0);
  24980. if (s.gzhead.hcrc && s.pending > beg) {
  24981. strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
  24982. }
  24983. if (val === 0) {
  24984. s.gzindex = 0;
  24985. s.status = COMMENT_STATE;
  24986. }
  24987. }
  24988. else {
  24989. s.status = COMMENT_STATE;
  24990. }
  24991. }
  24992. if (s.status === COMMENT_STATE) {
  24993. if (s.gzhead.comment/* != Z_NULL*/) {
  24994. beg = s.pending; /* start of bytes to update crc */
  24995. //int val;
  24996. do {
  24997. if (s.pending === s.pending_buf_size) {
  24998. if (s.gzhead.hcrc && s.pending > beg) {
  24999. strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
  25000. }
  25001. flush_pending(strm);
  25002. beg = s.pending;
  25003. if (s.pending === s.pending_buf_size) {
  25004. val = 1;
  25005. break;
  25006. }
  25007. }
  25008. // JS specific: little magic to add zero terminator to end of string
  25009. if (s.gzindex < s.gzhead.comment.length) {
  25010. val = s.gzhead.comment.charCodeAt(s.gzindex++) & 0xff;
  25011. } else {
  25012. val = 0;
  25013. }
  25014. put_byte(s, val);
  25015. } while (val !== 0);
  25016. if (s.gzhead.hcrc && s.pending > beg) {
  25017. strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
  25018. }
  25019. if (val === 0) {
  25020. s.status = HCRC_STATE;
  25021. }
  25022. }
  25023. else {
  25024. s.status = HCRC_STATE;
  25025. }
  25026. }
  25027. if (s.status === HCRC_STATE) {
  25028. if (s.gzhead.hcrc) {
  25029. if (s.pending + 2 > s.pending_buf_size) {
  25030. flush_pending(strm);
  25031. }
  25032. if (s.pending + 2 <= s.pending_buf_size) {
  25033. put_byte(s, strm.adler & 0xff);
  25034. put_byte(s, (strm.adler >> 8) & 0xff);
  25035. strm.adler = 0; //crc32(0L, Z_NULL, 0);
  25036. s.status = BUSY_STATE;
  25037. }
  25038. }
  25039. else {
  25040. s.status = BUSY_STATE;
  25041. }
  25042. }
  25043. //#endif
  25044. /* Flush as much pending output as possible */
  25045. if (s.pending !== 0) {
  25046. flush_pending(strm);
  25047. if (strm.avail_out === 0) {
  25048. /* Since avail_out is 0, deflate will be called again with
  25049. * more output space, but possibly with both pending and
  25050. * avail_in equal to zero. There won't be anything to do,
  25051. * but this is not an error situation so make sure we
  25052. * return OK instead of BUF_ERROR at next call of deflate:
  25053. */
  25054. s.last_flush = -1;
  25055. return Z_OK;
  25056. }
  25057. /* Make sure there is something to do and avoid duplicate consecutive
  25058. * flushes. For repeated and useless calls with Z_FINISH, we keep
  25059. * returning Z_STREAM_END instead of Z_BUF_ERROR.
  25060. */
  25061. } else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) &&
  25062. flush !== Z_FINISH) {
  25063. return err(strm, Z_BUF_ERROR);
  25064. }
  25065. /* User must not provide more input after the first FINISH: */
  25066. if (s.status === FINISH_STATE && strm.avail_in !== 0) {
  25067. return err(strm, Z_BUF_ERROR);
  25068. }
  25069. /* Start a new block or continue the current one.
  25070. */
  25071. if (strm.avail_in !== 0 || s.lookahead !== 0 ||
  25072. (flush !== Z_NO_FLUSH && s.status !== FINISH_STATE)) {
  25073. var bstate = (s.strategy === Z_HUFFMAN_ONLY) ? deflate_huff(s, flush) :
  25074. (s.strategy === Z_RLE ? deflate_rle(s, flush) :
  25075. configuration_table[s.level].func(s, flush));
  25076. if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE) {
  25077. s.status = FINISH_STATE;
  25078. }
  25079. if (bstate === BS_NEED_MORE || bstate === BS_FINISH_STARTED) {
  25080. if (strm.avail_out === 0) {
  25081. s.last_flush = -1;
  25082. /* avoid BUF_ERROR next call, see above */
  25083. }
  25084. return Z_OK;
  25085. /* If flush != Z_NO_FLUSH && avail_out == 0, the next call
  25086. * of deflate should use the same flush parameter to make sure
  25087. * that the flush is complete. So we don't have to output an
  25088. * empty block here, this will be done at next call. This also
  25089. * ensures that for a very small output buffer, we emit at most
  25090. * one empty block.
  25091. */
  25092. }
  25093. if (bstate === BS_BLOCK_DONE) {
  25094. if (flush === Z_PARTIAL_FLUSH) {
  25095. trees._tr_align(s);
  25096. }
  25097. else if (flush !== Z_BLOCK) { /* FULL_FLUSH or SYNC_FLUSH */
  25098. trees._tr_stored_block(s, 0, 0, false);
  25099. /* For a full flush, this empty block will be recognized
  25100. * as a special marker by inflate_sync().
  25101. */
  25102. if (flush === Z_FULL_FLUSH) {
  25103. /*** CLEAR_HASH(s); ***/ /* forget history */
  25104. zero(s.head); // Fill with NIL (= 0);
  25105. if (s.lookahead === 0) {
  25106. s.strstart = 0;
  25107. s.block_start = 0;
  25108. s.insert = 0;
  25109. }
  25110. }
  25111. }
  25112. flush_pending(strm);
  25113. if (strm.avail_out === 0) {
  25114. s.last_flush = -1; /* avoid BUF_ERROR at next call, see above */
  25115. return Z_OK;
  25116. }
  25117. }
  25118. }
  25119. //Assert(strm->avail_out > 0, "bug2");
  25120. //if (strm.avail_out <= 0) { throw new Error("bug2");}
  25121. if (flush !== Z_FINISH) { return Z_OK; }
  25122. if (s.wrap <= 0) { return Z_STREAM_END; }
  25123. /* Write the trailer */
  25124. if (s.wrap === 2) {
  25125. put_byte(s, strm.adler & 0xff);
  25126. put_byte(s, (strm.adler >> 8) & 0xff);
  25127. put_byte(s, (strm.adler >> 16) & 0xff);
  25128. put_byte(s, (strm.adler >> 24) & 0xff);
  25129. put_byte(s, strm.total_in & 0xff);
  25130. put_byte(s, (strm.total_in >> 8) & 0xff);
  25131. put_byte(s, (strm.total_in >> 16) & 0xff);
  25132. put_byte(s, (strm.total_in >> 24) & 0xff);
  25133. }
  25134. else
  25135. {
  25136. putShortMSB(s, strm.adler >>> 16);
  25137. putShortMSB(s, strm.adler & 0xffff);
  25138. }
  25139. flush_pending(strm);
  25140. /* If avail_out is zero, the application will call deflate again
  25141. * to flush the rest.
  25142. */
  25143. if (s.wrap > 0) { s.wrap = -s.wrap; }
  25144. /* write the trailer only once! */
  25145. return s.pending !== 0 ? Z_OK : Z_STREAM_END;
  25146. }
  25147. function deflateEnd(strm) {
  25148. var status;
  25149. if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) {
  25150. return Z_STREAM_ERROR;
  25151. }
  25152. status = strm.state.status;
  25153. if (status !== INIT_STATE &&
  25154. status !== EXTRA_STATE &&
  25155. status !== NAME_STATE &&
  25156. status !== COMMENT_STATE &&
  25157. status !== HCRC_STATE &&
  25158. status !== BUSY_STATE &&
  25159. status !== FINISH_STATE
  25160. ) {
  25161. return err(strm, Z_STREAM_ERROR);
  25162. }
  25163. strm.state = null;
  25164. return status === BUSY_STATE ? err(strm, Z_DATA_ERROR) : Z_OK;
  25165. }
  25166. /* =========================================================================
  25167. * Initializes the compression dictionary from the given byte
  25168. * sequence without producing any compressed output.
  25169. */
  25170. function deflateSetDictionary(strm, dictionary) {
  25171. var dictLength = dictionary.length;
  25172. var s;
  25173. var str, n;
  25174. var wrap;
  25175. var avail;
  25176. var next;
  25177. var input;
  25178. var tmpDict;
  25179. if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) {
  25180. return Z_STREAM_ERROR;
  25181. }
  25182. s = strm.state;
  25183. wrap = s.wrap;
  25184. if (wrap === 2 || (wrap === 1 && s.status !== INIT_STATE) || s.lookahead) {
  25185. return Z_STREAM_ERROR;
  25186. }
  25187. /* when using zlib wrappers, compute Adler-32 for provided dictionary */
  25188. if (wrap === 1) {
  25189. /* adler32(strm->adler, dictionary, dictLength); */
  25190. strm.adler = adler32(strm.adler, dictionary, dictLength, 0);
  25191. }
  25192. s.wrap = 0; /* avoid computing Adler-32 in read_buf */
  25193. /* if dictionary would fill window, just replace the history */
  25194. if (dictLength >= s.w_size) {
  25195. if (wrap === 0) { /* already empty otherwise */
  25196. /*** CLEAR_HASH(s); ***/
  25197. zero(s.head); // Fill with NIL (= 0);
  25198. s.strstart = 0;
  25199. s.block_start = 0;
  25200. s.insert = 0;
  25201. }
  25202. /* use the tail */
  25203. // dictionary = dictionary.slice(dictLength - s.w_size);
  25204. tmpDict = new utils.Buf8(s.w_size);
  25205. utils.arraySet(tmpDict, dictionary, dictLength - s.w_size, s.w_size, 0);
  25206. dictionary = tmpDict;
  25207. dictLength = s.w_size;
  25208. }
  25209. /* insert dictionary into window and hash */
  25210. avail = strm.avail_in;
  25211. next = strm.next_in;
  25212. input = strm.input;
  25213. strm.avail_in = dictLength;
  25214. strm.next_in = 0;
  25215. strm.input = dictionary;
  25216. fill_window(s);
  25217. while (s.lookahead >= MIN_MATCH) {
  25218. str = s.strstart;
  25219. n = s.lookahead - (MIN_MATCH - 1);
  25220. do {
  25221. /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */
  25222. s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;
  25223. s.prev[str & s.w_mask] = s.head[s.ins_h];
  25224. s.head[s.ins_h] = str;
  25225. str++;
  25226. } while (--n);
  25227. s.strstart = str;
  25228. s.lookahead = MIN_MATCH - 1;
  25229. fill_window(s);
  25230. }
  25231. s.strstart += s.lookahead;
  25232. s.block_start = s.strstart;
  25233. s.insert = s.lookahead;
  25234. s.lookahead = 0;
  25235. s.match_length = s.prev_length = MIN_MATCH - 1;
  25236. s.match_available = 0;
  25237. strm.next_in = next;
  25238. strm.input = input;
  25239. strm.avail_in = avail;
  25240. s.wrap = wrap;
  25241. return Z_OK;
  25242. }
  25243. exports.deflateInit = deflateInit;
  25244. exports.deflateInit2 = deflateInit2;
  25245. exports.deflateReset = deflateReset;
  25246. exports.deflateResetKeep = deflateResetKeep;
  25247. exports.deflateSetHeader = deflateSetHeader;
  25248. exports.deflate = deflate;
  25249. exports.deflateEnd = deflateEnd;
  25250. exports.deflateSetDictionary = deflateSetDictionary;
  25251. exports.deflateInfo = 'pako deflate (from Nodeca project)';
  25252. /* Not implemented
  25253. exports.deflateBound = deflateBound;
  25254. exports.deflateCopy = deflateCopy;
  25255. exports.deflateParams = deflateParams;
  25256. exports.deflatePending = deflatePending;
  25257. exports.deflatePrime = deflatePrime;
  25258. exports.deflateTune = deflateTune;
  25259. */
  25260. /***/ }),
  25261. /* 271 */
  25262. /***/ (function(module, exports, __webpack_require__) {
  25263. "use strict";
  25264. // (C) 1995-2013 Jean-loup Gailly and Mark Adler
  25265. // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
  25266. //
  25267. // This software is provided 'as-is', without any express or implied
  25268. // warranty. In no event will the authors be held liable for any damages
  25269. // arising from the use of this software.
  25270. //
  25271. // Permission is granted to anyone to use this software for any purpose,
  25272. // including commercial applications, and to alter it and redistribute it
  25273. // freely, subject to the following restrictions:
  25274. //
  25275. // 1. The origin of this software must not be misrepresented; you must not
  25276. // claim that you wrote the original software. If you use this software
  25277. // in a product, an acknowledgment in the product documentation would be
  25278. // appreciated but is not required.
  25279. // 2. Altered source versions must be plainly marked as such, and must not be
  25280. // misrepresented as being the original software.
  25281. // 3. This notice may not be removed or altered from any source distribution.
  25282. /* eslint-disable space-unary-ops */
  25283. var utils = __webpack_require__(71);
  25284. /* Public constants ==========================================================*/
  25285. /* ===========================================================================*/
  25286. //var Z_FILTERED = 1;
  25287. //var Z_HUFFMAN_ONLY = 2;
  25288. //var Z_RLE = 3;
  25289. var Z_FIXED = 4;
  25290. //var Z_DEFAULT_STRATEGY = 0;
  25291. /* Possible values of the data_type field (though see inflate()) */
  25292. var Z_BINARY = 0;
  25293. var Z_TEXT = 1;
  25294. //var Z_ASCII = 1; // = Z_TEXT
  25295. var Z_UNKNOWN = 2;
  25296. /*============================================================================*/
  25297. function zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } }
  25298. // From zutil.h
  25299. var STORED_BLOCK = 0;
  25300. var STATIC_TREES = 1;
  25301. var DYN_TREES = 2;
  25302. /* The three kinds of block type */
  25303. var MIN_MATCH = 3;
  25304. var MAX_MATCH = 258;
  25305. /* The minimum and maximum match lengths */
  25306. // From deflate.h
  25307. /* ===========================================================================
  25308. * Internal compression state.
  25309. */
  25310. var LENGTH_CODES = 29;
  25311. /* number of length codes, not counting the special END_BLOCK code */
  25312. var LITERALS = 256;
  25313. /* number of literal bytes 0..255 */
  25314. var L_CODES = LITERALS + 1 + LENGTH_CODES;
  25315. /* number of Literal or Length codes, including the END_BLOCK code */
  25316. var D_CODES = 30;
  25317. /* number of distance codes */
  25318. var BL_CODES = 19;
  25319. /* number of codes used to transfer the bit lengths */
  25320. var HEAP_SIZE = 2 * L_CODES + 1;
  25321. /* maximum heap size */
  25322. var MAX_BITS = 15;
  25323. /* All codes must not exceed MAX_BITS bits */
  25324. var Buf_size = 16;
  25325. /* size of bit buffer in bi_buf */
  25326. /* ===========================================================================
  25327. * Constants
  25328. */
  25329. var MAX_BL_BITS = 7;
  25330. /* Bit length codes must not exceed MAX_BL_BITS bits */
  25331. var END_BLOCK = 256;
  25332. /* end of block literal code */
  25333. var REP_3_6 = 16;
  25334. /* repeat previous bit length 3-6 times (2 bits of repeat count) */
  25335. var REPZ_3_10 = 17;
  25336. /* repeat a zero length 3-10 times (3 bits of repeat count) */
  25337. var REPZ_11_138 = 18;
  25338. /* repeat a zero length 11-138 times (7 bits of repeat count) */
  25339. /* eslint-disable comma-spacing,array-bracket-spacing */
  25340. var extra_lbits = /* extra bits for each length code */
  25341. [0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0];
  25342. var extra_dbits = /* extra bits for each distance code */
  25343. [0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];
  25344. var extra_blbits = /* extra bits for each bit length code */
  25345. [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];
  25346. var bl_order =
  25347. [16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];
  25348. /* eslint-enable comma-spacing,array-bracket-spacing */
  25349. /* The lengths of the bit length codes are sent in order of decreasing
  25350. * probability, to avoid transmitting the lengths for unused bit length codes.
  25351. */
  25352. /* ===========================================================================
  25353. * Local data. These are initialized only once.
  25354. */
  25355. // We pre-fill arrays with 0 to avoid uninitialized gaps
  25356. var DIST_CODE_LEN = 512; /* see definition of array dist_code below */
  25357. // !!!! Use flat array instead of structure, Freq = i*2, Len = i*2+1
  25358. var static_ltree = new Array((L_CODES + 2) * 2);
  25359. zero(static_ltree);
  25360. /* The static literal tree. Since the bit lengths are imposed, there is no
  25361. * need for the L_CODES extra codes used during heap construction. However
  25362. * The codes 286 and 287 are needed to build a canonical tree (see _tr_init
  25363. * below).
  25364. */
  25365. var static_dtree = new Array(D_CODES * 2);
  25366. zero(static_dtree);
  25367. /* The static distance tree. (Actually a trivial tree since all codes use
  25368. * 5 bits.)
  25369. */
  25370. var _dist_code = new Array(DIST_CODE_LEN);
  25371. zero(_dist_code);
  25372. /* Distance codes. The first 256 values correspond to the distances
  25373. * 3 .. 258, the last 256 values correspond to the top 8 bits of
  25374. * the 15 bit distances.
  25375. */
  25376. var _length_code = new Array(MAX_MATCH - MIN_MATCH + 1);
  25377. zero(_length_code);
  25378. /* length code for each normalized match length (0 == MIN_MATCH) */
  25379. var base_length = new Array(LENGTH_CODES);
  25380. zero(base_length);
  25381. /* First normalized length for each code (0 = MIN_MATCH) */
  25382. var base_dist = new Array(D_CODES);
  25383. zero(base_dist);
  25384. /* First normalized distance for each code (0 = distance of 1) */
  25385. function StaticTreeDesc(static_tree, extra_bits, extra_base, elems, max_length) {
  25386. this.static_tree = static_tree; /* static tree or NULL */
  25387. this.extra_bits = extra_bits; /* extra bits for each code or NULL */
  25388. this.extra_base = extra_base; /* base index for extra_bits */
  25389. this.elems = elems; /* max number of elements in the tree */
  25390. this.max_length = max_length; /* max bit length for the codes */
  25391. // show if `static_tree` has data or dummy - needed for monomorphic objects
  25392. this.has_stree = static_tree && static_tree.length;
  25393. }
  25394. var static_l_desc;
  25395. var static_d_desc;
  25396. var static_bl_desc;
  25397. function TreeDesc(dyn_tree, stat_desc) {
  25398. this.dyn_tree = dyn_tree; /* the dynamic tree */
  25399. this.max_code = 0; /* largest code with non zero frequency */
  25400. this.stat_desc = stat_desc; /* the corresponding static tree */
  25401. }
  25402. function d_code(dist) {
  25403. return dist < 256 ? _dist_code[dist] : _dist_code[256 + (dist >>> 7)];
  25404. }
  25405. /* ===========================================================================
  25406. * Output a short LSB first on the stream.
  25407. * IN assertion: there is enough room in pendingBuf.
  25408. */
  25409. function put_short(s, w) {
  25410. // put_byte(s, (uch)((w) & 0xff));
  25411. // put_byte(s, (uch)((ush)(w) >> 8));
  25412. s.pending_buf[s.pending++] = (w) & 0xff;
  25413. s.pending_buf[s.pending++] = (w >>> 8) & 0xff;
  25414. }
  25415. /* ===========================================================================
  25416. * Send a value on a given number of bits.
  25417. * IN assertion: length <= 16 and value fits in length bits.
  25418. */
  25419. function send_bits(s, value, length) {
  25420. if (s.bi_valid > (Buf_size - length)) {
  25421. s.bi_buf |= (value << s.bi_valid) & 0xffff;
  25422. put_short(s, s.bi_buf);
  25423. s.bi_buf = value >> (Buf_size - s.bi_valid);
  25424. s.bi_valid += length - Buf_size;
  25425. } else {
  25426. s.bi_buf |= (value << s.bi_valid) & 0xffff;
  25427. s.bi_valid += length;
  25428. }
  25429. }
  25430. function send_code(s, c, tree) {
  25431. send_bits(s, tree[c * 2]/*.Code*/, tree[c * 2 + 1]/*.Len*/);
  25432. }
  25433. /* ===========================================================================
  25434. * Reverse the first len bits of a code, using straightforward code (a faster
  25435. * method would use a table)
  25436. * IN assertion: 1 <= len <= 15
  25437. */
  25438. function bi_reverse(code, len) {
  25439. var res = 0;
  25440. do {
  25441. res |= code & 1;
  25442. code >>>= 1;
  25443. res <<= 1;
  25444. } while (--len > 0);
  25445. return res >>> 1;
  25446. }
  25447. /* ===========================================================================
  25448. * Flush the bit buffer, keeping at most 7 bits in it.
  25449. */
  25450. function bi_flush(s) {
  25451. if (s.bi_valid === 16) {
  25452. put_short(s, s.bi_buf);
  25453. s.bi_buf = 0;
  25454. s.bi_valid = 0;
  25455. } else if (s.bi_valid >= 8) {
  25456. s.pending_buf[s.pending++] = s.bi_buf & 0xff;
  25457. s.bi_buf >>= 8;
  25458. s.bi_valid -= 8;
  25459. }
  25460. }
  25461. /* ===========================================================================
  25462. * Compute the optimal bit lengths for a tree and update the total bit length
  25463. * for the current block.
  25464. * IN assertion: the fields freq and dad are set, heap[heap_max] and
  25465. * above are the tree nodes sorted by increasing frequency.
  25466. * OUT assertions: the field len is set to the optimal bit length, the
  25467. * array bl_count contains the frequencies for each bit length.
  25468. * The length opt_len is updated; static_len is also updated if stree is
  25469. * not null.
  25470. */
  25471. function gen_bitlen(s, desc)
  25472. // deflate_state *s;
  25473. // tree_desc *desc; /* the tree descriptor */
  25474. {
  25475. var tree = desc.dyn_tree;
  25476. var max_code = desc.max_code;
  25477. var stree = desc.stat_desc.static_tree;
  25478. var has_stree = desc.stat_desc.has_stree;
  25479. var extra = desc.stat_desc.extra_bits;
  25480. var base = desc.stat_desc.extra_base;
  25481. var max_length = desc.stat_desc.max_length;
  25482. var h; /* heap index */
  25483. var n, m; /* iterate over the tree elements */
  25484. var bits; /* bit length */
  25485. var xbits; /* extra bits */
  25486. var f; /* frequency */
  25487. var overflow = 0; /* number of elements with bit length too large */
  25488. for (bits = 0; bits <= MAX_BITS; bits++) {
  25489. s.bl_count[bits] = 0;
  25490. }
  25491. /* In a first pass, compute the optimal bit lengths (which may
  25492. * overflow in the case of the bit length tree).
  25493. */
  25494. tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */
  25495. for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {
  25496. n = s.heap[h];
  25497. bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;
  25498. if (bits > max_length) {
  25499. bits = max_length;
  25500. overflow++;
  25501. }
  25502. tree[n * 2 + 1]/*.Len*/ = bits;
  25503. /* We overwrite tree[n].Dad which is no longer needed */
  25504. if (n > max_code) { continue; } /* not a leaf node */
  25505. s.bl_count[bits]++;
  25506. xbits = 0;
  25507. if (n >= base) {
  25508. xbits = extra[n - base];
  25509. }
  25510. f = tree[n * 2]/*.Freq*/;
  25511. s.opt_len += f * (bits + xbits);
  25512. if (has_stree) {
  25513. s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);
  25514. }
  25515. }
  25516. if (overflow === 0) { return; }
  25517. // Trace((stderr,"\nbit length overflow\n"));
  25518. /* This happens for example on obj2 and pic of the Calgary corpus */
  25519. /* Find the first bit length which could increase: */
  25520. do {
  25521. bits = max_length - 1;
  25522. while (s.bl_count[bits] === 0) { bits--; }
  25523. s.bl_count[bits]--; /* move one leaf down the tree */
  25524. s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */
  25525. s.bl_count[max_length]--;
  25526. /* The brother of the overflow item also moves one step up,
  25527. * but this does not affect bl_count[max_length]
  25528. */
  25529. overflow -= 2;
  25530. } while (overflow > 0);
  25531. /* Now recompute all bit lengths, scanning in increasing frequency.
  25532. * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all
  25533. * lengths instead of fixing only the wrong ones. This idea is taken
  25534. * from 'ar' written by Haruhiko Okumura.)
  25535. */
  25536. for (bits = max_length; bits !== 0; bits--) {
  25537. n = s.bl_count[bits];
  25538. while (n !== 0) {
  25539. m = s.heap[--h];
  25540. if (m > max_code) { continue; }
  25541. if (tree[m * 2 + 1]/*.Len*/ !== bits) {
  25542. // Trace((stderr,"code %d bits %d->%d\n", m, tree[m].Len, bits));
  25543. s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;
  25544. tree[m * 2 + 1]/*.Len*/ = bits;
  25545. }
  25546. n--;
  25547. }
  25548. }
  25549. }
  25550. /* ===========================================================================
  25551. * Generate the codes for a given tree and bit counts (which need not be
  25552. * optimal).
  25553. * IN assertion: the array bl_count contains the bit length statistics for
  25554. * the given tree and the field len is set for all tree elements.
  25555. * OUT assertion: the field code is set for all tree elements of non
  25556. * zero code length.
  25557. */
  25558. function gen_codes(tree, max_code, bl_count)
  25559. // ct_data *tree; /* the tree to decorate */
  25560. // int max_code; /* largest code with non zero frequency */
  25561. // ushf *bl_count; /* number of codes at each bit length */
  25562. {
  25563. var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */
  25564. var code = 0; /* running code value */
  25565. var bits; /* bit index */
  25566. var n; /* code index */
  25567. /* The distribution counts are first used to generate the code values
  25568. * without bit reversal.
  25569. */
  25570. for (bits = 1; bits <= MAX_BITS; bits++) {
  25571. next_code[bits] = code = (code + bl_count[bits - 1]) << 1;
  25572. }
  25573. /* Check that the bit counts in bl_count are consistent. The last code
  25574. * must be all ones.
  25575. */
  25576. //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,
  25577. // "inconsistent bit counts");
  25578. //Tracev((stderr,"\ngen_codes: max_code %d ", max_code));
  25579. for (n = 0; n <= max_code; n++) {
  25580. var len = tree[n * 2 + 1]/*.Len*/;
  25581. if (len === 0) { continue; }
  25582. /* Now reverse the bits */
  25583. tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);
  25584. //Tracecv(tree != static_ltree, (stderr,"\nn %3d %c l %2d c %4x (%x) ",
  25585. // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));
  25586. }
  25587. }
  25588. /* ===========================================================================
  25589. * Initialize the various 'constant' tables.
  25590. */
  25591. function tr_static_init() {
  25592. var n; /* iterates over tree elements */
  25593. var bits; /* bit counter */
  25594. var length; /* length value */
  25595. var code; /* code value */
  25596. var dist; /* distance index */
  25597. var bl_count = new Array(MAX_BITS + 1);
  25598. /* number of codes at each bit length for an optimal tree */
  25599. // do check in _tr_init()
  25600. //if (static_init_done) return;
  25601. /* For some embedded targets, global variables are not initialized: */
  25602. /*#ifdef NO_INIT_GLOBAL_POINTERS
  25603. static_l_desc.static_tree = static_ltree;
  25604. static_l_desc.extra_bits = extra_lbits;
  25605. static_d_desc.static_tree = static_dtree;
  25606. static_d_desc.extra_bits = extra_dbits;
  25607. static_bl_desc.extra_bits = extra_blbits;
  25608. #endif*/
  25609. /* Initialize the mapping length (0..255) -> length code (0..28) */
  25610. length = 0;
  25611. for (code = 0; code < LENGTH_CODES - 1; code++) {
  25612. base_length[code] = length;
  25613. for (n = 0; n < (1 << extra_lbits[code]); n++) {
  25614. _length_code[length++] = code;
  25615. }
  25616. }
  25617. //Assert (length == 256, "tr_static_init: length != 256");
  25618. /* Note that the length 255 (match length 258) can be represented
  25619. * in two different ways: code 284 + 5 bits or code 285, so we
  25620. * overwrite length_code[255] to use the best encoding:
  25621. */
  25622. _length_code[length - 1] = code;
  25623. /* Initialize the mapping dist (0..32K) -> dist code (0..29) */
  25624. dist = 0;
  25625. for (code = 0; code < 16; code++) {
  25626. base_dist[code] = dist;
  25627. for (n = 0; n < (1 << extra_dbits[code]); n++) {
  25628. _dist_code[dist++] = code;
  25629. }
  25630. }
  25631. //Assert (dist == 256, "tr_static_init: dist != 256");
  25632. dist >>= 7; /* from now on, all distances are divided by 128 */
  25633. for (; code < D_CODES; code++) {
  25634. base_dist[code] = dist << 7;
  25635. for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {
  25636. _dist_code[256 + dist++] = code;
  25637. }
  25638. }
  25639. //Assert (dist == 256, "tr_static_init: 256+dist != 512");
  25640. /* Construct the codes of the static literal tree */
  25641. for (bits = 0; bits <= MAX_BITS; bits++) {
  25642. bl_count[bits] = 0;
  25643. }
  25644. n = 0;
  25645. while (n <= 143) {
  25646. static_ltree[n * 2 + 1]/*.Len*/ = 8;
  25647. n++;
  25648. bl_count[8]++;
  25649. }
  25650. while (n <= 255) {
  25651. static_ltree[n * 2 + 1]/*.Len*/ = 9;
  25652. n++;
  25653. bl_count[9]++;
  25654. }
  25655. while (n <= 279) {
  25656. static_ltree[n * 2 + 1]/*.Len*/ = 7;
  25657. n++;
  25658. bl_count[7]++;
  25659. }
  25660. while (n <= 287) {
  25661. static_ltree[n * 2 + 1]/*.Len*/ = 8;
  25662. n++;
  25663. bl_count[8]++;
  25664. }
  25665. /* Codes 286 and 287 do not exist, but we must include them in the
  25666. * tree construction to get a canonical Huffman tree (longest code
  25667. * all ones)
  25668. */
  25669. gen_codes(static_ltree, L_CODES + 1, bl_count);
  25670. /* The static distance tree is trivial: */
  25671. for (n = 0; n < D_CODES; n++) {
  25672. static_dtree[n * 2 + 1]/*.Len*/ = 5;
  25673. static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);
  25674. }
  25675. // Now data ready and we can init static trees
  25676. static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);
  25677. static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);
  25678. static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);
  25679. //static_init_done = true;
  25680. }
  25681. /* ===========================================================================
  25682. * Initialize a new block.
  25683. */
  25684. function init_block(s) {
  25685. var n; /* iterates over tree elements */
  25686. /* Initialize the trees. */
  25687. for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }
  25688. for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }
  25689. for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }
  25690. s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;
  25691. s.opt_len = s.static_len = 0;
  25692. s.last_lit = s.matches = 0;
  25693. }
  25694. /* ===========================================================================
  25695. * Flush the bit buffer and align the output on a byte boundary
  25696. */
  25697. function bi_windup(s)
  25698. {
  25699. if (s.bi_valid > 8) {
  25700. put_short(s, s.bi_buf);
  25701. } else if (s.bi_valid > 0) {
  25702. //put_byte(s, (Byte)s->bi_buf);
  25703. s.pending_buf[s.pending++] = s.bi_buf;
  25704. }
  25705. s.bi_buf = 0;
  25706. s.bi_valid = 0;
  25707. }
  25708. /* ===========================================================================
  25709. * Copy a stored block, storing first the length and its
  25710. * one's complement if requested.
  25711. */
  25712. function copy_block(s, buf, len, header)
  25713. //DeflateState *s;
  25714. //charf *buf; /* the input data */
  25715. //unsigned len; /* its length */
  25716. //int header; /* true if block header must be written */
  25717. {
  25718. bi_windup(s); /* align on byte boundary */
  25719. if (header) {
  25720. put_short(s, len);
  25721. put_short(s, ~len);
  25722. }
  25723. // while (len--) {
  25724. // put_byte(s, *buf++);
  25725. // }
  25726. utils.arraySet(s.pending_buf, s.window, buf, len, s.pending);
  25727. s.pending += len;
  25728. }
  25729. /* ===========================================================================
  25730. * Compares to subtrees, using the tree depth as tie breaker when
  25731. * the subtrees have equal frequency. This minimizes the worst case length.
  25732. */
  25733. function smaller(tree, n, m, depth) {
  25734. var _n2 = n * 2;
  25735. var _m2 = m * 2;
  25736. return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||
  25737. (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));
  25738. }
  25739. /* ===========================================================================
  25740. * Restore the heap property by moving down the tree starting at node k,
  25741. * exchanging a node with the smallest of its two sons if necessary, stopping
  25742. * when the heap property is re-established (each father smaller than its
  25743. * two sons).
  25744. */
  25745. function pqdownheap(s, tree, k)
  25746. // deflate_state *s;
  25747. // ct_data *tree; /* the tree to restore */
  25748. // int k; /* node to move down */
  25749. {
  25750. var v = s.heap[k];
  25751. var j = k << 1; /* left son of k */
  25752. while (j <= s.heap_len) {
  25753. /* Set j to the smallest of the two sons: */
  25754. if (j < s.heap_len &&
  25755. smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {
  25756. j++;
  25757. }
  25758. /* Exit if v is smaller than both sons */
  25759. if (smaller(tree, v, s.heap[j], s.depth)) { break; }
  25760. /* Exchange v with the smallest son */
  25761. s.heap[k] = s.heap[j];
  25762. k = j;
  25763. /* And continue down the tree, setting j to the left son of k */
  25764. j <<= 1;
  25765. }
  25766. s.heap[k] = v;
  25767. }
  25768. // inlined manually
  25769. // var SMALLEST = 1;
  25770. /* ===========================================================================
  25771. * Send the block data compressed using the given Huffman trees
  25772. */
  25773. function compress_block(s, ltree, dtree)
  25774. // deflate_state *s;
  25775. // const ct_data *ltree; /* literal tree */
  25776. // const ct_data *dtree; /* distance tree */
  25777. {
  25778. var dist; /* distance of matched string */
  25779. var lc; /* match length or unmatched char (if dist == 0) */
  25780. var lx = 0; /* running index in l_buf */
  25781. var code; /* the code to send */
  25782. var extra; /* number of extra bits to send */
  25783. if (s.last_lit !== 0) {
  25784. do {
  25785. dist = (s.pending_buf[s.d_buf + lx * 2] << 8) | (s.pending_buf[s.d_buf + lx * 2 + 1]);
  25786. lc = s.pending_buf[s.l_buf + lx];
  25787. lx++;
  25788. if (dist === 0) {
  25789. send_code(s, lc, ltree); /* send a literal byte */
  25790. //Tracecv(isgraph(lc), (stderr," '%c' ", lc));
  25791. } else {
  25792. /* Here, lc is the match length - MIN_MATCH */
  25793. code = _length_code[lc];
  25794. send_code(s, code + LITERALS + 1, ltree); /* send the length code */
  25795. extra = extra_lbits[code];
  25796. if (extra !== 0) {
  25797. lc -= base_length[code];
  25798. send_bits(s, lc, extra); /* send the extra length bits */
  25799. }
  25800. dist--; /* dist is now the match distance - 1 */
  25801. code = d_code(dist);
  25802. //Assert (code < D_CODES, "bad d_code");
  25803. send_code(s, code, dtree); /* send the distance code */
  25804. extra = extra_dbits[code];
  25805. if (extra !== 0) {
  25806. dist -= base_dist[code];
  25807. send_bits(s, dist, extra); /* send the extra distance bits */
  25808. }
  25809. } /* literal or match pair ? */
  25810. /* Check that the overlay between pending_buf and d_buf+l_buf is ok: */
  25811. //Assert((uInt)(s->pending) < s->lit_bufsize + 2*lx,
  25812. // "pendingBuf overflow");
  25813. } while (lx < s.last_lit);
  25814. }
  25815. send_code(s, END_BLOCK, ltree);
  25816. }
  25817. /* ===========================================================================
  25818. * Construct one Huffman tree and assigns the code bit strings and lengths.
  25819. * Update the total bit length for the current block.
  25820. * IN assertion: the field freq is set for all tree elements.
  25821. * OUT assertions: the fields len and code are set to the optimal bit length
  25822. * and corresponding code. The length opt_len is updated; static_len is
  25823. * also updated if stree is not null. The field max_code is set.
  25824. */
  25825. function build_tree(s, desc)
  25826. // deflate_state *s;
  25827. // tree_desc *desc; /* the tree descriptor */
  25828. {
  25829. var tree = desc.dyn_tree;
  25830. var stree = desc.stat_desc.static_tree;
  25831. var has_stree = desc.stat_desc.has_stree;
  25832. var elems = desc.stat_desc.elems;
  25833. var n, m; /* iterate over heap elements */
  25834. var max_code = -1; /* largest code with non zero frequency */
  25835. var node; /* new node being created */
  25836. /* Construct the initial heap, with least frequent element in
  25837. * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1].
  25838. * heap[0] is not used.
  25839. */
  25840. s.heap_len = 0;
  25841. s.heap_max = HEAP_SIZE;
  25842. for (n = 0; n < elems; n++) {
  25843. if (tree[n * 2]/*.Freq*/ !== 0) {
  25844. s.heap[++s.heap_len] = max_code = n;
  25845. s.depth[n] = 0;
  25846. } else {
  25847. tree[n * 2 + 1]/*.Len*/ = 0;
  25848. }
  25849. }
  25850. /* The pkzip format requires that at least one distance code exists,
  25851. * and that at least one bit should be sent even if there is only one
  25852. * possible code. So to avoid special checks later on we force at least
  25853. * two codes of non zero frequency.
  25854. */
  25855. while (s.heap_len < 2) {
  25856. node = s.heap[++s.heap_len] = (max_code < 2 ? ++max_code : 0);
  25857. tree[node * 2]/*.Freq*/ = 1;
  25858. s.depth[node] = 0;
  25859. s.opt_len--;
  25860. if (has_stree) {
  25861. s.static_len -= stree[node * 2 + 1]/*.Len*/;
  25862. }
  25863. /* node is 0 or 1 so it does not have extra bits */
  25864. }
  25865. desc.max_code = max_code;
  25866. /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree,
  25867. * establish sub-heaps of increasing lengths:
  25868. */
  25869. for (n = (s.heap_len >> 1/*int /2*/); n >= 1; n--) { pqdownheap(s, tree, n); }
  25870. /* Construct the Huffman tree by repeatedly combining the least two
  25871. * frequent nodes.
  25872. */
  25873. node = elems; /* next internal node of the tree */
  25874. do {
  25875. //pqremove(s, tree, n); /* n = node of least frequency */
  25876. /*** pqremove ***/
  25877. n = s.heap[1/*SMALLEST*/];
  25878. s.heap[1/*SMALLEST*/] = s.heap[s.heap_len--];
  25879. pqdownheap(s, tree, 1/*SMALLEST*/);
  25880. /***/
  25881. m = s.heap[1/*SMALLEST*/]; /* m = node of next least frequency */
  25882. s.heap[--s.heap_max] = n; /* keep the nodes sorted by frequency */
  25883. s.heap[--s.heap_max] = m;
  25884. /* Create a new node father of n and m */
  25885. tree[node * 2]/*.Freq*/ = tree[n * 2]/*.Freq*/ + tree[m * 2]/*.Freq*/;
  25886. s.depth[node] = (s.depth[n] >= s.depth[m] ? s.depth[n] : s.depth[m]) + 1;
  25887. tree[n * 2 + 1]/*.Dad*/ = tree[m * 2 + 1]/*.Dad*/ = node;
  25888. /* and insert the new node in the heap */
  25889. s.heap[1/*SMALLEST*/] = node++;
  25890. pqdownheap(s, tree, 1/*SMALLEST*/);
  25891. } while (s.heap_len >= 2);
  25892. s.heap[--s.heap_max] = s.heap[1/*SMALLEST*/];
  25893. /* At this point, the fields freq and dad are set. We can now
  25894. * generate the bit lengths.
  25895. */
  25896. gen_bitlen(s, desc);
  25897. /* The field len is now set, we can generate the bit codes */
  25898. gen_codes(tree, max_code, s.bl_count);
  25899. }
  25900. /* ===========================================================================
  25901. * Scan a literal or distance tree to determine the frequencies of the codes
  25902. * in the bit length tree.
  25903. */
  25904. function scan_tree(s, tree, max_code)
  25905. // deflate_state *s;
  25906. // ct_data *tree; /* the tree to be scanned */
  25907. // int max_code; /* and its largest code of non zero frequency */
  25908. {
  25909. var n; /* iterates over all tree elements */
  25910. var prevlen = -1; /* last emitted length */
  25911. var curlen; /* length of current code */
  25912. var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */
  25913. var count = 0; /* repeat count of the current code */
  25914. var max_count = 7; /* max repeat count */
  25915. var min_count = 4; /* min repeat count */
  25916. if (nextlen === 0) {
  25917. max_count = 138;
  25918. min_count = 3;
  25919. }
  25920. tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */
  25921. for (n = 0; n <= max_code; n++) {
  25922. curlen = nextlen;
  25923. nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;
  25924. if (++count < max_count && curlen === nextlen) {
  25925. continue;
  25926. } else if (count < min_count) {
  25927. s.bl_tree[curlen * 2]/*.Freq*/ += count;
  25928. } else if (curlen !== 0) {
  25929. if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }
  25930. s.bl_tree[REP_3_6 * 2]/*.Freq*/++;
  25931. } else if (count <= 10) {
  25932. s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;
  25933. } else {
  25934. s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;
  25935. }
  25936. count = 0;
  25937. prevlen = curlen;
  25938. if (nextlen === 0) {
  25939. max_count = 138;
  25940. min_count = 3;
  25941. } else if (curlen === nextlen) {
  25942. max_count = 6;
  25943. min_count = 3;
  25944. } else {
  25945. max_count = 7;
  25946. min_count = 4;
  25947. }
  25948. }
  25949. }
  25950. /* ===========================================================================
  25951. * Send a literal or distance tree in compressed form, using the codes in
  25952. * bl_tree.
  25953. */
  25954. function send_tree(s, tree, max_code)
  25955. // deflate_state *s;
  25956. // ct_data *tree; /* the tree to be scanned */
  25957. // int max_code; /* and its largest code of non zero frequency */
  25958. {
  25959. var n; /* iterates over all tree elements */
  25960. var prevlen = -1; /* last emitted length */
  25961. var curlen; /* length of current code */
  25962. var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */
  25963. var count = 0; /* repeat count of the current code */
  25964. var max_count = 7; /* max repeat count */
  25965. var min_count = 4; /* min repeat count */
  25966. /* tree[max_code+1].Len = -1; */ /* guard already set */
  25967. if (nextlen === 0) {
  25968. max_count = 138;
  25969. min_count = 3;
  25970. }
  25971. for (n = 0; n <= max_code; n++) {
  25972. curlen = nextlen;
  25973. nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;
  25974. if (++count < max_count && curlen === nextlen) {
  25975. continue;
  25976. } else if (count < min_count) {
  25977. do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);
  25978. } else if (curlen !== 0) {
  25979. if (curlen !== prevlen) {
  25980. send_code(s, curlen, s.bl_tree);
  25981. count--;
  25982. }
  25983. //Assert(count >= 3 && count <= 6, " 3_6?");
  25984. send_code(s, REP_3_6, s.bl_tree);
  25985. send_bits(s, count - 3, 2);
  25986. } else if (count <= 10) {
  25987. send_code(s, REPZ_3_10, s.bl_tree);
  25988. send_bits(s, count - 3, 3);
  25989. } else {
  25990. send_code(s, REPZ_11_138, s.bl_tree);
  25991. send_bits(s, count - 11, 7);
  25992. }
  25993. count = 0;
  25994. prevlen = curlen;
  25995. if (nextlen === 0) {
  25996. max_count = 138;
  25997. min_count = 3;
  25998. } else if (curlen === nextlen) {
  25999. max_count = 6;
  26000. min_count = 3;
  26001. } else {
  26002. max_count = 7;
  26003. min_count = 4;
  26004. }
  26005. }
  26006. }
  26007. /* ===========================================================================
  26008. * Construct the Huffman tree for the bit lengths and return the index in
  26009. * bl_order of the last bit length code to send.
  26010. */
  26011. function build_bl_tree(s) {
  26012. var max_blindex; /* index of last bit length code of non zero freq */
  26013. /* Determine the bit length frequencies for literal and distance trees */
  26014. scan_tree(s, s.dyn_ltree, s.l_desc.max_code);
  26015. scan_tree(s, s.dyn_dtree, s.d_desc.max_code);
  26016. /* Build the bit length tree: */
  26017. build_tree(s, s.bl_desc);
  26018. /* opt_len now includes the length of the tree representations, except
  26019. * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.
  26020. */
  26021. /* Determine the number of bit length codes to send. The pkzip format
  26022. * requires that at least 4 bit length codes be sent. (appnote.txt says
  26023. * 3 but the actual value used is 4.)
  26024. */
  26025. for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {
  26026. if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {
  26027. break;
  26028. }
  26029. }
  26030. /* Update opt_len to include the bit length tree and counts */
  26031. s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;
  26032. //Tracev((stderr, "\ndyn trees: dyn %ld, stat %ld",
  26033. // s->opt_len, s->static_len));
  26034. return max_blindex;
  26035. }
  26036. /* ===========================================================================
  26037. * Send the header for a block using dynamic Huffman trees: the counts, the
  26038. * lengths of the bit length codes, the literal tree and the distance tree.
  26039. * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4.
  26040. */
  26041. function send_all_trees(s, lcodes, dcodes, blcodes)
  26042. // deflate_state *s;
  26043. // int lcodes, dcodes, blcodes; /* number of codes for each tree */
  26044. {
  26045. var rank; /* index in bl_order */
  26046. //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, "not enough codes");
  26047. //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,
  26048. // "too many codes");
  26049. //Tracev((stderr, "\nbl counts: "));
  26050. send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */
  26051. send_bits(s, dcodes - 1, 5);
  26052. send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */
  26053. for (rank = 0; rank < blcodes; rank++) {
  26054. //Tracev((stderr, "\nbl code %2d ", bl_order[rank]));
  26055. send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);
  26056. }
  26057. //Tracev((stderr, "\nbl tree: sent %ld", s->bits_sent));
  26058. send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */
  26059. //Tracev((stderr, "\nlit tree: sent %ld", s->bits_sent));
  26060. send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */
  26061. //Tracev((stderr, "\ndist tree: sent %ld", s->bits_sent));
  26062. }
  26063. /* ===========================================================================
  26064. * Check if the data type is TEXT or BINARY, using the following algorithm:
  26065. * - TEXT if the two conditions below are satisfied:
  26066. * a) There are no non-portable control characters belonging to the
  26067. * "black list" (0..6, 14..25, 28..31).
  26068. * b) There is at least one printable character belonging to the
  26069. * "white list" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255).
  26070. * - BINARY otherwise.
  26071. * - The following partially-portable control characters form a
  26072. * "gray list" that is ignored in this detection algorithm:
  26073. * (7 {BEL}, 8 {BS}, 11 {VT}, 12 {FF}, 26 {SUB}, 27 {ESC}).
  26074. * IN assertion: the fields Freq of dyn_ltree are set.
  26075. */
  26076. function detect_data_type(s) {
  26077. /* black_mask is the bit mask of black-listed bytes
  26078. * set bits 0..6, 14..25, and 28..31
  26079. * 0xf3ffc07f = binary 11110011111111111100000001111111
  26080. */
  26081. var black_mask = 0xf3ffc07f;
  26082. var n;
  26083. /* Check for non-textual ("black-listed") bytes. */
  26084. for (n = 0; n <= 31; n++, black_mask >>>= 1) {
  26085. if ((black_mask & 1) && (s.dyn_ltree[n * 2]/*.Freq*/ !== 0)) {
  26086. return Z_BINARY;
  26087. }
  26088. }
  26089. /* Check for textual ("white-listed") bytes. */
  26090. if (s.dyn_ltree[9 * 2]/*.Freq*/ !== 0 || s.dyn_ltree[10 * 2]/*.Freq*/ !== 0 ||
  26091. s.dyn_ltree[13 * 2]/*.Freq*/ !== 0) {
  26092. return Z_TEXT;
  26093. }
  26094. for (n = 32; n < LITERALS; n++) {
  26095. if (s.dyn_ltree[n * 2]/*.Freq*/ !== 0) {
  26096. return Z_TEXT;
  26097. }
  26098. }
  26099. /* There are no "black-listed" or "white-listed" bytes:
  26100. * this stream either is empty or has tolerated ("gray-listed") bytes only.
  26101. */
  26102. return Z_BINARY;
  26103. }
  26104. var static_init_done = false;
  26105. /* ===========================================================================
  26106. * Initialize the tree data structures for a new zlib stream.
  26107. */
  26108. function _tr_init(s)
  26109. {
  26110. if (!static_init_done) {
  26111. tr_static_init();
  26112. static_init_done = true;
  26113. }
  26114. s.l_desc = new TreeDesc(s.dyn_ltree, static_l_desc);
  26115. s.d_desc = new TreeDesc(s.dyn_dtree, static_d_desc);
  26116. s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc);
  26117. s.bi_buf = 0;
  26118. s.bi_valid = 0;
  26119. /* Initialize the first block of the first file: */
  26120. init_block(s);
  26121. }
  26122. /* ===========================================================================
  26123. * Send a stored block
  26124. */
  26125. function _tr_stored_block(s, buf, stored_len, last)
  26126. //DeflateState *s;
  26127. //charf *buf; /* input block */
  26128. //ulg stored_len; /* length of input block */
  26129. //int last; /* one if this is the last block for a file */
  26130. {
  26131. send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */
  26132. copy_block(s, buf, stored_len, true); /* with header */
  26133. }
  26134. /* ===========================================================================
  26135. * Send one empty static block to give enough lookahead for inflate.
  26136. * This takes 10 bits, of which 7 may remain in the bit buffer.
  26137. */
  26138. function _tr_align(s) {
  26139. send_bits(s, STATIC_TREES << 1, 3);
  26140. send_code(s, END_BLOCK, static_ltree);
  26141. bi_flush(s);
  26142. }
  26143. /* ===========================================================================
  26144. * Determine the best encoding for the current block: dynamic trees, static
  26145. * trees or store, and output the encoded block to the zip file.
  26146. */
  26147. function _tr_flush_block(s, buf, stored_len, last)
  26148. //DeflateState *s;
  26149. //charf *buf; /* input block, or NULL if too old */
  26150. //ulg stored_len; /* length of input block */
  26151. //int last; /* one if this is the last block for a file */
  26152. {
  26153. var opt_lenb, static_lenb; /* opt_len and static_len in bytes */
  26154. var max_blindex = 0; /* index of last bit length code of non zero freq */
  26155. /* Build the Huffman trees unless a stored block is forced */
  26156. if (s.level > 0) {
  26157. /* Check if the file is binary or text */
  26158. if (s.strm.data_type === Z_UNKNOWN) {
  26159. s.strm.data_type = detect_data_type(s);
  26160. }
  26161. /* Construct the literal and distance trees */
  26162. build_tree(s, s.l_desc);
  26163. // Tracev((stderr, "\nlit data: dyn %ld, stat %ld", s->opt_len,
  26164. // s->static_len));
  26165. build_tree(s, s.d_desc);
  26166. // Tracev((stderr, "\ndist data: dyn %ld, stat %ld", s->opt_len,
  26167. // s->static_len));
  26168. /* At this point, opt_len and static_len are the total bit lengths of
  26169. * the compressed block data, excluding the tree representations.
  26170. */
  26171. /* Build the bit length tree for the above two trees, and get the index
  26172. * in bl_order of the last bit length code to send.
  26173. */
  26174. max_blindex = build_bl_tree(s);
  26175. /* Determine the best encoding. Compute the block lengths in bytes. */
  26176. opt_lenb = (s.opt_len + 3 + 7) >>> 3;
  26177. static_lenb = (s.static_len + 3 + 7) >>> 3;
  26178. // Tracev((stderr, "\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u ",
  26179. // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,
  26180. // s->last_lit));
  26181. if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }
  26182. } else {
  26183. // Assert(buf != (char*)0, "lost buf");
  26184. opt_lenb = static_lenb = stored_len + 5; /* force a stored block */
  26185. }
  26186. if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {
  26187. /* 4: two words for the lengths */
  26188. /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.
  26189. * Otherwise we can't have processed more than WSIZE input bytes since
  26190. * the last block flush, because compression would have been
  26191. * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to
  26192. * transform a block into a stored block.
  26193. */
  26194. _tr_stored_block(s, buf, stored_len, last);
  26195. } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {
  26196. send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);
  26197. compress_block(s, static_ltree, static_dtree);
  26198. } else {
  26199. send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);
  26200. send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);
  26201. compress_block(s, s.dyn_ltree, s.dyn_dtree);
  26202. }
  26203. // Assert (s->compressed_len == s->bits_sent, "bad compressed size");
  26204. /* The above check is made mod 2^32, for files larger than 512 MB
  26205. * and uLong implemented on 32 bits.
  26206. */
  26207. init_block(s);
  26208. if (last) {
  26209. bi_windup(s);
  26210. }
  26211. // Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len>>3,
  26212. // s->compressed_len-7*last));
  26213. }
  26214. /* ===========================================================================
  26215. * Save the match info and tally the frequency counts. Return true if
  26216. * the current block must be flushed.
  26217. */
  26218. function _tr_tally(s, dist, lc)
  26219. // deflate_state *s;
  26220. // unsigned dist; /* distance of matched string */
  26221. // unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */
  26222. {
  26223. //var out_length, in_length, dcode;
  26224. s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;
  26225. s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;
  26226. s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;
  26227. s.last_lit++;
  26228. if (dist === 0) {
  26229. /* lc is the unmatched char */
  26230. s.dyn_ltree[lc * 2]/*.Freq*/++;
  26231. } else {
  26232. s.matches++;
  26233. /* Here, lc is the match length - MIN_MATCH */
  26234. dist--; /* dist = match distance - 1 */
  26235. //Assert((ush)dist < (ush)MAX_DIST(s) &&
  26236. // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&
  26237. // (ush)d_code(dist) < (ush)D_CODES, "_tr_tally: bad match");
  26238. s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;
  26239. s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;
  26240. }
  26241. // (!) This block is disabled in zlib defaults,
  26242. // don't enable it for binary compatibility
  26243. //#ifdef TRUNCATE_BLOCK
  26244. // /* Try to guess if it is profitable to stop the current block here */
  26245. // if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {
  26246. // /* Compute an upper bound for the compressed length */
  26247. // out_length = s.last_lit*8;
  26248. // in_length = s.strstart - s.block_start;
  26249. //
  26250. // for (dcode = 0; dcode < D_CODES; dcode++) {
  26251. // out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);
  26252. // }
  26253. // out_length >>>= 3;
  26254. // //Tracev((stderr,"\nlast_lit %u, in %ld, out ~%ld(%ld%%) ",
  26255. // // s->last_lit, in_length, out_length,
  26256. // // 100L - out_length*100L/in_length));
  26257. // if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {
  26258. // return true;
  26259. // }
  26260. // }
  26261. //#endif
  26262. return (s.last_lit === s.lit_bufsize - 1);
  26263. /* We avoid equality with lit_bufsize because of wraparound at 64K
  26264. * on 16 bit machines and because stored blocks are restricted to
  26265. * 64K-1 bytes.
  26266. */
  26267. }
  26268. exports._tr_init = _tr_init;
  26269. exports._tr_stored_block = _tr_stored_block;
  26270. exports._tr_flush_block = _tr_flush_block;
  26271. exports._tr_tally = _tr_tally;
  26272. exports._tr_align = _tr_align;
  26273. /***/ }),
  26274. /* 272 */
  26275. /***/ (function(module, exports, __webpack_require__) {
  26276. "use strict";
  26277. // (C) 1995-2013 Jean-loup Gailly and Mark Adler
  26278. // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
  26279. //
  26280. // This software is provided 'as-is', without any express or implied
  26281. // warranty. In no event will the authors be held liable for any damages
  26282. // arising from the use of this software.
  26283. //
  26284. // Permission is granted to anyone to use this software for any purpose,
  26285. // including commercial applications, and to alter it and redistribute it
  26286. // freely, subject to the following restrictions:
  26287. //
  26288. // 1. The origin of this software must not be misrepresented; you must not
  26289. // claim that you wrote the original software. If you use this software
  26290. // in a product, an acknowledgment in the product documentation would be
  26291. // appreciated but is not required.
  26292. // 2. Altered source versions must be plainly marked as such, and must not be
  26293. // misrepresented as being the original software.
  26294. // 3. This notice may not be removed or altered from any source distribution.
  26295. module.exports = {
  26296. 2: 'need dictionary', /* Z_NEED_DICT 2 */
  26297. 1: 'stream end', /* Z_STREAM_END 1 */
  26298. 0: '', /* Z_OK 0 */
  26299. '-1': 'file error', /* Z_ERRNO (-1) */
  26300. '-2': 'stream error', /* Z_STREAM_ERROR (-2) */
  26301. '-3': 'data error', /* Z_DATA_ERROR (-3) */
  26302. '-4': 'insufficient memory', /* Z_MEM_ERROR (-4) */
  26303. '-5': 'buffer error', /* Z_BUF_ERROR (-5) */
  26304. '-6': 'incompatible version' /* Z_VERSION_ERROR (-6) */
  26305. };
  26306. /***/ }),
  26307. /* 273 */
  26308. /***/ (function(module, exports, __webpack_require__) {
  26309. "use strict";
  26310. // (C) 1995-2013 Jean-loup Gailly and Mark Adler
  26311. // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
  26312. //
  26313. // This software is provided 'as-is', without any express or implied
  26314. // warranty. In no event will the authors be held liable for any damages
  26315. // arising from the use of this software.
  26316. //
  26317. // Permission is granted to anyone to use this software for any purpose,
  26318. // including commercial applications, and to alter it and redistribute it
  26319. // freely, subject to the following restrictions:
  26320. //
  26321. // 1. The origin of this software must not be misrepresented; you must not
  26322. // claim that you wrote the original software. If you use this software
  26323. // in a product, an acknowledgment in the product documentation would be
  26324. // appreciated but is not required.
  26325. // 2. Altered source versions must be plainly marked as such, and must not be
  26326. // misrepresented as being the original software.
  26327. // 3. This notice may not be removed or altered from any source distribution.
  26328. var utils = __webpack_require__(71);
  26329. var adler32 = __webpack_require__(172);
  26330. var crc32 = __webpack_require__(173);
  26331. var inflate_fast = __webpack_require__(274);
  26332. var inflate_table = __webpack_require__(275);
  26333. var CODES = 0;
  26334. var LENS = 1;
  26335. var DISTS = 2;
  26336. /* Public constants ==========================================================*/
  26337. /* ===========================================================================*/
  26338. /* Allowed flush values; see deflate() and inflate() below for details */
  26339. //var Z_NO_FLUSH = 0;
  26340. //var Z_PARTIAL_FLUSH = 1;
  26341. //var Z_SYNC_FLUSH = 2;
  26342. //var Z_FULL_FLUSH = 3;
  26343. var Z_FINISH = 4;
  26344. var Z_BLOCK = 5;
  26345. var Z_TREES = 6;
  26346. /* Return codes for the compression/decompression functions. Negative values
  26347. * are errors, positive values are used for special but normal events.
  26348. */
  26349. var Z_OK = 0;
  26350. var Z_STREAM_END = 1;
  26351. var Z_NEED_DICT = 2;
  26352. //var Z_ERRNO = -1;
  26353. var Z_STREAM_ERROR = -2;
  26354. var Z_DATA_ERROR = -3;
  26355. var Z_MEM_ERROR = -4;
  26356. var Z_BUF_ERROR = -5;
  26357. //var Z_VERSION_ERROR = -6;
  26358. /* The deflate compression method */
  26359. var Z_DEFLATED = 8;
  26360. /* STATES ====================================================================*/
  26361. /* ===========================================================================*/
  26362. var HEAD = 1; /* i: waiting for magic header */
  26363. var FLAGS = 2; /* i: waiting for method and flags (gzip) */
  26364. var TIME = 3; /* i: waiting for modification time (gzip) */
  26365. var OS = 4; /* i: waiting for extra flags and operating system (gzip) */
  26366. var EXLEN = 5; /* i: waiting for extra length (gzip) */
  26367. var EXTRA = 6; /* i: waiting for extra bytes (gzip) */
  26368. var NAME = 7; /* i: waiting for end of file name (gzip) */
  26369. var COMMENT = 8; /* i: waiting for end of comment (gzip) */
  26370. var HCRC = 9; /* i: waiting for header crc (gzip) */
  26371. var DICTID = 10; /* i: waiting for dictionary check value */
  26372. var DICT = 11; /* waiting for inflateSetDictionary() call */
  26373. var TYPE = 12; /* i: waiting for type bits, including last-flag bit */
  26374. var TYPEDO = 13; /* i: same, but skip check to exit inflate on new block */
  26375. var STORED = 14; /* i: waiting for stored size (length and complement) */
  26376. var COPY_ = 15; /* i/o: same as COPY below, but only first time in */
  26377. var COPY = 16; /* i/o: waiting for input or output to copy stored block */
  26378. var TABLE = 17; /* i: waiting for dynamic block table lengths */
  26379. var LENLENS = 18; /* i: waiting for code length code lengths */
  26380. var CODELENS = 19; /* i: waiting for length/lit and distance code lengths */
  26381. var LEN_ = 20; /* i: same as LEN below, but only first time in */
  26382. var LEN = 21; /* i: waiting for length/lit/eob code */
  26383. var LENEXT = 22; /* i: waiting for length extra bits */
  26384. var DIST = 23; /* i: waiting for distance code */
  26385. var DISTEXT = 24; /* i: waiting for distance extra bits */
  26386. var MATCH = 25; /* o: waiting for output space to copy string */
  26387. var LIT = 26; /* o: waiting for output space to write literal */
  26388. var CHECK = 27; /* i: waiting for 32-bit check value */
  26389. var LENGTH = 28; /* i: waiting for 32-bit length (gzip) */
  26390. var DONE = 29; /* finished check, done -- remain here until reset */
  26391. var BAD = 30; /* got a data error -- remain here until reset */
  26392. var MEM = 31; /* got an inflate() memory error -- remain here until reset */
  26393. var SYNC = 32; /* looking for synchronization bytes to restart inflate() */
  26394. /* ===========================================================================*/
  26395. var ENOUGH_LENS = 852;
  26396. var ENOUGH_DISTS = 592;
  26397. //var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);
  26398. var MAX_WBITS = 15;
  26399. /* 32K LZ77 window */
  26400. var DEF_WBITS = MAX_WBITS;
  26401. function zswap32(q) {
  26402. return (((q >>> 24) & 0xff) +
  26403. ((q >>> 8) & 0xff00) +
  26404. ((q & 0xff00) << 8) +
  26405. ((q & 0xff) << 24));
  26406. }
  26407. function InflateState() {
  26408. this.mode = 0; /* current inflate mode */
  26409. this.last = false; /* true if processing last block */
  26410. this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */
  26411. this.havedict = false; /* true if dictionary provided */
  26412. this.flags = 0; /* gzip header method and flags (0 if zlib) */
  26413. this.dmax = 0; /* zlib header max distance (INFLATE_STRICT) */
  26414. this.check = 0; /* protected copy of check value */
  26415. this.total = 0; /* protected copy of output count */
  26416. // TODO: may be {}
  26417. this.head = null; /* where to save gzip header information */
  26418. /* sliding window */
  26419. this.wbits = 0; /* log base 2 of requested window size */
  26420. this.wsize = 0; /* window size or zero if not using window */
  26421. this.whave = 0; /* valid bytes in the window */
  26422. this.wnext = 0; /* window write index */
  26423. this.window = null; /* allocated sliding window, if needed */
  26424. /* bit accumulator */
  26425. this.hold = 0; /* input bit accumulator */
  26426. this.bits = 0; /* number of bits in "in" */
  26427. /* for string and stored block copying */
  26428. this.length = 0; /* literal or length of data to copy */
  26429. this.offset = 0; /* distance back to copy string from */
  26430. /* for table and code decoding */
  26431. this.extra = 0; /* extra bits needed */
  26432. /* fixed and dynamic code tables */
  26433. this.lencode = null; /* starting table for length/literal codes */
  26434. this.distcode = null; /* starting table for distance codes */
  26435. this.lenbits = 0; /* index bits for lencode */
  26436. this.distbits = 0; /* index bits for distcode */
  26437. /* dynamic table building */
  26438. this.ncode = 0; /* number of code length code lengths */
  26439. this.nlen = 0; /* number of length code lengths */
  26440. this.ndist = 0; /* number of distance code lengths */
  26441. this.have = 0; /* number of code lengths in lens[] */
  26442. this.next = null; /* next available space in codes[] */
  26443. this.lens = new utils.Buf16(320); /* temporary storage for code lengths */
  26444. this.work = new utils.Buf16(288); /* work area for code table building */
  26445. /*
  26446. because we don't have pointers in js, we use lencode and distcode directly
  26447. as buffers so we don't need codes
  26448. */
  26449. //this.codes = new utils.Buf32(ENOUGH); /* space for code tables */
  26450. this.lendyn = null; /* dynamic table for length/literal codes (JS specific) */
  26451. this.distdyn = null; /* dynamic table for distance codes (JS specific) */
  26452. this.sane = 0; /* if false, allow invalid distance too far */
  26453. this.back = 0; /* bits back of last unprocessed length/lit */
  26454. this.was = 0; /* initial length of match */
  26455. }
  26456. function inflateResetKeep(strm) {
  26457. var state;
  26458. if (!strm || !strm.state) { return Z_STREAM_ERROR; }
  26459. state = strm.state;
  26460. strm.total_in = strm.total_out = state.total = 0;
  26461. strm.msg = ''; /*Z_NULL*/
  26462. if (state.wrap) { /* to support ill-conceived Java test suite */
  26463. strm.adler = state.wrap & 1;
  26464. }
  26465. state.mode = HEAD;
  26466. state.last = 0;
  26467. state.havedict = 0;
  26468. state.dmax = 32768;
  26469. state.head = null/*Z_NULL*/;
  26470. state.hold = 0;
  26471. state.bits = 0;
  26472. //state.lencode = state.distcode = state.next = state.codes;
  26473. state.lencode = state.lendyn = new utils.Buf32(ENOUGH_LENS);
  26474. state.distcode = state.distdyn = new utils.Buf32(ENOUGH_DISTS);
  26475. state.sane = 1;
  26476. state.back = -1;
  26477. //Tracev((stderr, "inflate: reset\n"));
  26478. return Z_OK;
  26479. }
  26480. function inflateReset(strm) {
  26481. var state;
  26482. if (!strm || !strm.state) { return Z_STREAM_ERROR; }
  26483. state = strm.state;
  26484. state.wsize = 0;
  26485. state.whave = 0;
  26486. state.wnext = 0;
  26487. return inflateResetKeep(strm);
  26488. }
  26489. function inflateReset2(strm, windowBits) {
  26490. var wrap;
  26491. var state;
  26492. /* get the state */
  26493. if (!strm || !strm.state) { return Z_STREAM_ERROR; }
  26494. state = strm.state;
  26495. /* extract wrap request from windowBits parameter */
  26496. if (windowBits < 0) {
  26497. wrap = 0;
  26498. windowBits = -windowBits;
  26499. }
  26500. else {
  26501. wrap = (windowBits >> 4) + 1;
  26502. if (windowBits < 48) {
  26503. windowBits &= 15;
  26504. }
  26505. }
  26506. /* set number of window bits, free window if different */
  26507. if (windowBits && (windowBits < 8 || windowBits > 15)) {
  26508. return Z_STREAM_ERROR;
  26509. }
  26510. if (state.window !== null && state.wbits !== windowBits) {
  26511. state.window = null;
  26512. }
  26513. /* update state and reset the rest of it */
  26514. state.wrap = wrap;
  26515. state.wbits = windowBits;
  26516. return inflateReset(strm);
  26517. }
  26518. function inflateInit2(strm, windowBits) {
  26519. var ret;
  26520. var state;
  26521. if (!strm) { return Z_STREAM_ERROR; }
  26522. //strm.msg = Z_NULL; /* in case we return an error */
  26523. state = new InflateState();
  26524. //if (state === Z_NULL) return Z_MEM_ERROR;
  26525. //Tracev((stderr, "inflate: allocated\n"));
  26526. strm.state = state;
  26527. state.window = null/*Z_NULL*/;
  26528. ret = inflateReset2(strm, windowBits);
  26529. if (ret !== Z_OK) {
  26530. strm.state = null/*Z_NULL*/;
  26531. }
  26532. return ret;
  26533. }
  26534. function inflateInit(strm) {
  26535. return inflateInit2(strm, DEF_WBITS);
  26536. }
  26537. /*
  26538. Return state with length and distance decoding tables and index sizes set to
  26539. fixed code decoding. Normally this returns fixed tables from inffixed.h.
  26540. If BUILDFIXED is defined, then instead this routine builds the tables the
  26541. first time it's called, and returns those tables the first time and
  26542. thereafter. This reduces the size of the code by about 2K bytes, in
  26543. exchange for a little execution time. However, BUILDFIXED should not be
  26544. used for threaded applications, since the rewriting of the tables and virgin
  26545. may not be thread-safe.
  26546. */
  26547. var virgin = true;
  26548. var lenfix, distfix; // We have no pointers in JS, so keep tables separate
  26549. function fixedtables(state) {
  26550. /* build fixed huffman tables if first call (may not be thread safe) */
  26551. if (virgin) {
  26552. var sym;
  26553. lenfix = new utils.Buf32(512);
  26554. distfix = new utils.Buf32(32);
  26555. /* literal/length table */
  26556. sym = 0;
  26557. while (sym < 144) { state.lens[sym++] = 8; }
  26558. while (sym < 256) { state.lens[sym++] = 9; }
  26559. while (sym < 280) { state.lens[sym++] = 7; }
  26560. while (sym < 288) { state.lens[sym++] = 8; }
  26561. inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, { bits: 9 });
  26562. /* distance table */
  26563. sym = 0;
  26564. while (sym < 32) { state.lens[sym++] = 5; }
  26565. inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, { bits: 5 });
  26566. /* do this just once */
  26567. virgin = false;
  26568. }
  26569. state.lencode = lenfix;
  26570. state.lenbits = 9;
  26571. state.distcode = distfix;
  26572. state.distbits = 5;
  26573. }
  26574. /*
  26575. Update the window with the last wsize (normally 32K) bytes written before
  26576. returning. If window does not exist yet, create it. This is only called
  26577. when a window is already in use, or when output has been written during this
  26578. inflate call, but the end of the deflate stream has not been reached yet.
  26579. It is also called to create a window for dictionary data when a dictionary
  26580. is loaded.
  26581. Providing output buffers larger than 32K to inflate() should provide a speed
  26582. advantage, since only the last 32K of output is copied to the sliding window
  26583. upon return from inflate(), and since all distances after the first 32K of
  26584. output will fall in the output data, making match copies simpler and faster.
  26585. The advantage may be dependent on the size of the processor's data caches.
  26586. */
  26587. function updatewindow(strm, src, end, copy) {
  26588. var dist;
  26589. var state = strm.state;
  26590. /* if it hasn't been done already, allocate space for the window */
  26591. if (state.window === null) {
  26592. state.wsize = 1 << state.wbits;
  26593. state.wnext = 0;
  26594. state.whave = 0;
  26595. state.window = new utils.Buf8(state.wsize);
  26596. }
  26597. /* copy state->wsize or less output bytes into the circular window */
  26598. if (copy >= state.wsize) {
  26599. utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);
  26600. state.wnext = 0;
  26601. state.whave = state.wsize;
  26602. }
  26603. else {
  26604. dist = state.wsize - state.wnext;
  26605. if (dist > copy) {
  26606. dist = copy;
  26607. }
  26608. //zmemcpy(state->window + state->wnext, end - copy, dist);
  26609. utils.arraySet(state.window, src, end - copy, dist, state.wnext);
  26610. copy -= dist;
  26611. if (copy) {
  26612. //zmemcpy(state->window, end - copy, copy);
  26613. utils.arraySet(state.window, src, end - copy, copy, 0);
  26614. state.wnext = copy;
  26615. state.whave = state.wsize;
  26616. }
  26617. else {
  26618. state.wnext += dist;
  26619. if (state.wnext === state.wsize) { state.wnext = 0; }
  26620. if (state.whave < state.wsize) { state.whave += dist; }
  26621. }
  26622. }
  26623. return 0;
  26624. }
  26625. function inflate(strm, flush) {
  26626. var state;
  26627. var input, output; // input/output buffers
  26628. var next; /* next input INDEX */
  26629. var put; /* next output INDEX */
  26630. var have, left; /* available input and output */
  26631. var hold; /* bit buffer */
  26632. var bits; /* bits in bit buffer */
  26633. var _in, _out; /* save starting available input and output */
  26634. var copy; /* number of stored or match bytes to copy */
  26635. var from; /* where to copy match bytes from */
  26636. var from_source;
  26637. var here = 0; /* current decoding table entry */
  26638. var here_bits, here_op, here_val; // paked "here" denormalized (JS specific)
  26639. //var last; /* parent table entry */
  26640. var last_bits, last_op, last_val; // paked "last" denormalized (JS specific)
  26641. var len; /* length to copy for repeats, bits to drop */
  26642. var ret; /* return code */
  26643. var hbuf = new utils.Buf8(4); /* buffer for gzip header crc calculation */
  26644. var opts;
  26645. var n; // temporary var for NEED_BITS
  26646. var order = /* permutation of code lengths */
  26647. [ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 ];
  26648. if (!strm || !strm.state || !strm.output ||
  26649. (!strm.input && strm.avail_in !== 0)) {
  26650. return Z_STREAM_ERROR;
  26651. }
  26652. state = strm.state;
  26653. if (state.mode === TYPE) { state.mode = TYPEDO; } /* skip check */
  26654. //--- LOAD() ---
  26655. put = strm.next_out;
  26656. output = strm.output;
  26657. left = strm.avail_out;
  26658. next = strm.next_in;
  26659. input = strm.input;
  26660. have = strm.avail_in;
  26661. hold = state.hold;
  26662. bits = state.bits;
  26663. //---
  26664. _in = have;
  26665. _out = left;
  26666. ret = Z_OK;
  26667. inf_leave: // goto emulation
  26668. for (;;) {
  26669. switch (state.mode) {
  26670. case HEAD:
  26671. if (state.wrap === 0) {
  26672. state.mode = TYPEDO;
  26673. break;
  26674. }
  26675. //=== NEEDBITS(16);
  26676. while (bits < 16) {
  26677. if (have === 0) { break inf_leave; }
  26678. have--;
  26679. hold += input[next++] << bits;
  26680. bits += 8;
  26681. }
  26682. //===//
  26683. if ((state.wrap & 2) && hold === 0x8b1f) { /* gzip header */
  26684. state.check = 0/*crc32(0L, Z_NULL, 0)*/;
  26685. //=== CRC2(state.check, hold);
  26686. hbuf[0] = hold & 0xff;
  26687. hbuf[1] = (hold >>> 8) & 0xff;
  26688. state.check = crc32(state.check, hbuf, 2, 0);
  26689. //===//
  26690. //=== INITBITS();
  26691. hold = 0;
  26692. bits = 0;
  26693. //===//
  26694. state.mode = FLAGS;
  26695. break;
  26696. }
  26697. state.flags = 0; /* expect zlib header */
  26698. if (state.head) {
  26699. state.head.done = false;
  26700. }
  26701. if (!(state.wrap & 1) || /* check if zlib header allowed */
  26702. (((hold & 0xff)/*BITS(8)*/ << 8) + (hold >> 8)) % 31) {
  26703. strm.msg = 'incorrect header check';
  26704. state.mode = BAD;
  26705. break;
  26706. }
  26707. if ((hold & 0x0f)/*BITS(4)*/ !== Z_DEFLATED) {
  26708. strm.msg = 'unknown compression method';
  26709. state.mode = BAD;
  26710. break;
  26711. }
  26712. //--- DROPBITS(4) ---//
  26713. hold >>>= 4;
  26714. bits -= 4;
  26715. //---//
  26716. len = (hold & 0x0f)/*BITS(4)*/ + 8;
  26717. if (state.wbits === 0) {
  26718. state.wbits = len;
  26719. }
  26720. else if (len > state.wbits) {
  26721. strm.msg = 'invalid window size';
  26722. state.mode = BAD;
  26723. break;
  26724. }
  26725. state.dmax = 1 << len;
  26726. //Tracev((stderr, "inflate: zlib header ok\n"));
  26727. strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;
  26728. state.mode = hold & 0x200 ? DICTID : TYPE;
  26729. //=== INITBITS();
  26730. hold = 0;
  26731. bits = 0;
  26732. //===//
  26733. break;
  26734. case FLAGS:
  26735. //=== NEEDBITS(16); */
  26736. while (bits < 16) {
  26737. if (have === 0) { break inf_leave; }
  26738. have--;
  26739. hold += input[next++] << bits;
  26740. bits += 8;
  26741. }
  26742. //===//
  26743. state.flags = hold;
  26744. if ((state.flags & 0xff) !== Z_DEFLATED) {
  26745. strm.msg = 'unknown compression method';
  26746. state.mode = BAD;
  26747. break;
  26748. }
  26749. if (state.flags & 0xe000) {
  26750. strm.msg = 'unknown header flags set';
  26751. state.mode = BAD;
  26752. break;
  26753. }
  26754. if (state.head) {
  26755. state.head.text = ((hold >> 8) & 1);
  26756. }
  26757. if (state.flags & 0x0200) {
  26758. //=== CRC2(state.check, hold);
  26759. hbuf[0] = hold & 0xff;
  26760. hbuf[1] = (hold >>> 8) & 0xff;
  26761. state.check = crc32(state.check, hbuf, 2, 0);
  26762. //===//
  26763. }
  26764. //=== INITBITS();
  26765. hold = 0;
  26766. bits = 0;
  26767. //===//
  26768. state.mode = TIME;
  26769. /* falls through */
  26770. case TIME:
  26771. //=== NEEDBITS(32); */
  26772. while (bits < 32) {
  26773. if (have === 0) { break inf_leave; }
  26774. have--;
  26775. hold += input[next++] << bits;
  26776. bits += 8;
  26777. }
  26778. //===//
  26779. if (state.head) {
  26780. state.head.time = hold;
  26781. }
  26782. if (state.flags & 0x0200) {
  26783. //=== CRC4(state.check, hold)
  26784. hbuf[0] = hold & 0xff;
  26785. hbuf[1] = (hold >>> 8) & 0xff;
  26786. hbuf[2] = (hold >>> 16) & 0xff;
  26787. hbuf[3] = (hold >>> 24) & 0xff;
  26788. state.check = crc32(state.check, hbuf, 4, 0);
  26789. //===
  26790. }
  26791. //=== INITBITS();
  26792. hold = 0;
  26793. bits = 0;
  26794. //===//
  26795. state.mode = OS;
  26796. /* falls through */
  26797. case OS:
  26798. //=== NEEDBITS(16); */
  26799. while (bits < 16) {
  26800. if (have === 0) { break inf_leave; }
  26801. have--;
  26802. hold += input[next++] << bits;
  26803. bits += 8;
  26804. }
  26805. //===//
  26806. if (state.head) {
  26807. state.head.xflags = (hold & 0xff);
  26808. state.head.os = (hold >> 8);
  26809. }
  26810. if (state.flags & 0x0200) {
  26811. //=== CRC2(state.check, hold);
  26812. hbuf[0] = hold & 0xff;
  26813. hbuf[1] = (hold >>> 8) & 0xff;
  26814. state.check = crc32(state.check, hbuf, 2, 0);
  26815. //===//
  26816. }
  26817. //=== INITBITS();
  26818. hold = 0;
  26819. bits = 0;
  26820. //===//
  26821. state.mode = EXLEN;
  26822. /* falls through */
  26823. case EXLEN:
  26824. if (state.flags & 0x0400) {
  26825. //=== NEEDBITS(16); */
  26826. while (bits < 16) {
  26827. if (have === 0) { break inf_leave; }
  26828. have--;
  26829. hold += input[next++] << bits;
  26830. bits += 8;
  26831. }
  26832. //===//
  26833. state.length = hold;
  26834. if (state.head) {
  26835. state.head.extra_len = hold;
  26836. }
  26837. if (state.flags & 0x0200) {
  26838. //=== CRC2(state.check, hold);
  26839. hbuf[0] = hold & 0xff;
  26840. hbuf[1] = (hold >>> 8) & 0xff;
  26841. state.check = crc32(state.check, hbuf, 2, 0);
  26842. //===//
  26843. }
  26844. //=== INITBITS();
  26845. hold = 0;
  26846. bits = 0;
  26847. //===//
  26848. }
  26849. else if (state.head) {
  26850. state.head.extra = null/*Z_NULL*/;
  26851. }
  26852. state.mode = EXTRA;
  26853. /* falls through */
  26854. case EXTRA:
  26855. if (state.flags & 0x0400) {
  26856. copy = state.length;
  26857. if (copy > have) { copy = have; }
  26858. if (copy) {
  26859. if (state.head) {
  26860. len = state.head.extra_len - state.length;
  26861. if (!state.head.extra) {
  26862. // Use untyped array for more convenient processing later
  26863. state.head.extra = new Array(state.head.extra_len);
  26864. }
  26865. utils.arraySet(
  26866. state.head.extra,
  26867. input,
  26868. next,
  26869. // extra field is limited to 65536 bytes
  26870. // - no need for additional size check
  26871. copy,
  26872. /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/
  26873. len
  26874. );
  26875. //zmemcpy(state.head.extra + len, next,
  26876. // len + copy > state.head.extra_max ?
  26877. // state.head.extra_max - len : copy);
  26878. }
  26879. if (state.flags & 0x0200) {
  26880. state.check = crc32(state.check, input, copy, next);
  26881. }
  26882. have -= copy;
  26883. next += copy;
  26884. state.length -= copy;
  26885. }
  26886. if (state.length) { break inf_leave; }
  26887. }
  26888. state.length = 0;
  26889. state.mode = NAME;
  26890. /* falls through */
  26891. case NAME:
  26892. if (state.flags & 0x0800) {
  26893. if (have === 0) { break inf_leave; }
  26894. copy = 0;
  26895. do {
  26896. // TODO: 2 or 1 bytes?
  26897. len = input[next + copy++];
  26898. /* use constant limit because in js we should not preallocate memory */
  26899. if (state.head && len &&
  26900. (state.length < 65536 /*state.head.name_max*/)) {
  26901. state.head.name += String.fromCharCode(len);
  26902. }
  26903. } while (len && copy < have);
  26904. if (state.flags & 0x0200) {
  26905. state.check = crc32(state.check, input, copy, next);
  26906. }
  26907. have -= copy;
  26908. next += copy;
  26909. if (len) { break inf_leave; }
  26910. }
  26911. else if (state.head) {
  26912. state.head.name = null;
  26913. }
  26914. state.length = 0;
  26915. state.mode = COMMENT;
  26916. /* falls through */
  26917. case COMMENT:
  26918. if (state.flags & 0x1000) {
  26919. if (have === 0) { break inf_leave; }
  26920. copy = 0;
  26921. do {
  26922. len = input[next + copy++];
  26923. /* use constant limit because in js we should not preallocate memory */
  26924. if (state.head && len &&
  26925. (state.length < 65536 /*state.head.comm_max*/)) {
  26926. state.head.comment += String.fromCharCode(len);
  26927. }
  26928. } while (len && copy < have);
  26929. if (state.flags & 0x0200) {
  26930. state.check = crc32(state.check, input, copy, next);
  26931. }
  26932. have -= copy;
  26933. next += copy;
  26934. if (len) { break inf_leave; }
  26935. }
  26936. else if (state.head) {
  26937. state.head.comment = null;
  26938. }
  26939. state.mode = HCRC;
  26940. /* falls through */
  26941. case HCRC:
  26942. if (state.flags & 0x0200) {
  26943. //=== NEEDBITS(16); */
  26944. while (bits < 16) {
  26945. if (have === 0) { break inf_leave; }
  26946. have--;
  26947. hold += input[next++] << bits;
  26948. bits += 8;
  26949. }
  26950. //===//
  26951. if (hold !== (state.check & 0xffff)) {
  26952. strm.msg = 'header crc mismatch';
  26953. state.mode = BAD;
  26954. break;
  26955. }
  26956. //=== INITBITS();
  26957. hold = 0;
  26958. bits = 0;
  26959. //===//
  26960. }
  26961. if (state.head) {
  26962. state.head.hcrc = ((state.flags >> 9) & 1);
  26963. state.head.done = true;
  26964. }
  26965. strm.adler = state.check = 0;
  26966. state.mode = TYPE;
  26967. break;
  26968. case DICTID:
  26969. //=== NEEDBITS(32); */
  26970. while (bits < 32) {
  26971. if (have === 0) { break inf_leave; }
  26972. have--;
  26973. hold += input[next++] << bits;
  26974. bits += 8;
  26975. }
  26976. //===//
  26977. strm.adler = state.check = zswap32(hold);
  26978. //=== INITBITS();
  26979. hold = 0;
  26980. bits = 0;
  26981. //===//
  26982. state.mode = DICT;
  26983. /* falls through */
  26984. case DICT:
  26985. if (state.havedict === 0) {
  26986. //--- RESTORE() ---
  26987. strm.next_out = put;
  26988. strm.avail_out = left;
  26989. strm.next_in = next;
  26990. strm.avail_in = have;
  26991. state.hold = hold;
  26992. state.bits = bits;
  26993. //---
  26994. return Z_NEED_DICT;
  26995. }
  26996. strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;
  26997. state.mode = TYPE;
  26998. /* falls through */
  26999. case TYPE:
  27000. if (flush === Z_BLOCK || flush === Z_TREES) { break inf_leave; }
  27001. /* falls through */
  27002. case TYPEDO:
  27003. if (state.last) {
  27004. //--- BYTEBITS() ---//
  27005. hold >>>= bits & 7;
  27006. bits -= bits & 7;
  27007. //---//
  27008. state.mode = CHECK;
  27009. break;
  27010. }
  27011. //=== NEEDBITS(3); */
  27012. while (bits < 3) {
  27013. if (have === 0) { break inf_leave; }
  27014. have--;
  27015. hold += input[next++] << bits;
  27016. bits += 8;
  27017. }
  27018. //===//
  27019. state.last = (hold & 0x01)/*BITS(1)*/;
  27020. //--- DROPBITS(1) ---//
  27021. hold >>>= 1;
  27022. bits -= 1;
  27023. //---//
  27024. switch ((hold & 0x03)/*BITS(2)*/) {
  27025. case 0: /* stored block */
  27026. //Tracev((stderr, "inflate: stored block%s\n",
  27027. // state.last ? " (last)" : ""));
  27028. state.mode = STORED;
  27029. break;
  27030. case 1: /* fixed block */
  27031. fixedtables(state);
  27032. //Tracev((stderr, "inflate: fixed codes block%s\n",
  27033. // state.last ? " (last)" : ""));
  27034. state.mode = LEN_; /* decode codes */
  27035. if (flush === Z_TREES) {
  27036. //--- DROPBITS(2) ---//
  27037. hold >>>= 2;
  27038. bits -= 2;
  27039. //---//
  27040. break inf_leave;
  27041. }
  27042. break;
  27043. case 2: /* dynamic block */
  27044. //Tracev((stderr, "inflate: dynamic codes block%s\n",
  27045. // state.last ? " (last)" : ""));
  27046. state.mode = TABLE;
  27047. break;
  27048. case 3:
  27049. strm.msg = 'invalid block type';
  27050. state.mode = BAD;
  27051. }
  27052. //--- DROPBITS(2) ---//
  27053. hold >>>= 2;
  27054. bits -= 2;
  27055. //---//
  27056. break;
  27057. case STORED:
  27058. //--- BYTEBITS() ---// /* go to byte boundary */
  27059. hold >>>= bits & 7;
  27060. bits -= bits & 7;
  27061. //---//
  27062. //=== NEEDBITS(32); */
  27063. while (bits < 32) {
  27064. if (have === 0) { break inf_leave; }
  27065. have--;
  27066. hold += input[next++] << bits;
  27067. bits += 8;
  27068. }
  27069. //===//
  27070. if ((hold & 0xffff) !== ((hold >>> 16) ^ 0xffff)) {
  27071. strm.msg = 'invalid stored block lengths';
  27072. state.mode = BAD;
  27073. break;
  27074. }
  27075. state.length = hold & 0xffff;
  27076. //Tracev((stderr, "inflate: stored length %u\n",
  27077. // state.length));
  27078. //=== INITBITS();
  27079. hold = 0;
  27080. bits = 0;
  27081. //===//
  27082. state.mode = COPY_;
  27083. if (flush === Z_TREES) { break inf_leave; }
  27084. /* falls through */
  27085. case COPY_:
  27086. state.mode = COPY;
  27087. /* falls through */
  27088. case COPY:
  27089. copy = state.length;
  27090. if (copy) {
  27091. if (copy > have) { copy = have; }
  27092. if (copy > left) { copy = left; }
  27093. if (copy === 0) { break inf_leave; }
  27094. //--- zmemcpy(put, next, copy); ---
  27095. utils.arraySet(output, input, next, copy, put);
  27096. //---//
  27097. have -= copy;
  27098. next += copy;
  27099. left -= copy;
  27100. put += copy;
  27101. state.length -= copy;
  27102. break;
  27103. }
  27104. //Tracev((stderr, "inflate: stored end\n"));
  27105. state.mode = TYPE;
  27106. break;
  27107. case TABLE:
  27108. //=== NEEDBITS(14); */
  27109. while (bits < 14) {
  27110. if (have === 0) { break inf_leave; }
  27111. have--;
  27112. hold += input[next++] << bits;
  27113. bits += 8;
  27114. }
  27115. //===//
  27116. state.nlen = (hold & 0x1f)/*BITS(5)*/ + 257;
  27117. //--- DROPBITS(5) ---//
  27118. hold >>>= 5;
  27119. bits -= 5;
  27120. //---//
  27121. state.ndist = (hold & 0x1f)/*BITS(5)*/ + 1;
  27122. //--- DROPBITS(5) ---//
  27123. hold >>>= 5;
  27124. bits -= 5;
  27125. //---//
  27126. state.ncode = (hold & 0x0f)/*BITS(4)*/ + 4;
  27127. //--- DROPBITS(4) ---//
  27128. hold >>>= 4;
  27129. bits -= 4;
  27130. //---//
  27131. //#ifndef PKZIP_BUG_WORKAROUND
  27132. if (state.nlen > 286 || state.ndist > 30) {
  27133. strm.msg = 'too many length or distance symbols';
  27134. state.mode = BAD;
  27135. break;
  27136. }
  27137. //#endif
  27138. //Tracev((stderr, "inflate: table sizes ok\n"));
  27139. state.have = 0;
  27140. state.mode = LENLENS;
  27141. /* falls through */
  27142. case LENLENS:
  27143. while (state.have < state.ncode) {
  27144. //=== NEEDBITS(3);
  27145. while (bits < 3) {
  27146. if (have === 0) { break inf_leave; }
  27147. have--;
  27148. hold += input[next++] << bits;
  27149. bits += 8;
  27150. }
  27151. //===//
  27152. state.lens[order[state.have++]] = (hold & 0x07);//BITS(3);
  27153. //--- DROPBITS(3) ---//
  27154. hold >>>= 3;
  27155. bits -= 3;
  27156. //---//
  27157. }
  27158. while (state.have < 19) {
  27159. state.lens[order[state.have++]] = 0;
  27160. }
  27161. // We have separate tables & no pointers. 2 commented lines below not needed.
  27162. //state.next = state.codes;
  27163. //state.lencode = state.next;
  27164. // Switch to use dynamic table
  27165. state.lencode = state.lendyn;
  27166. state.lenbits = 7;
  27167. opts = { bits: state.lenbits };
  27168. ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts);
  27169. state.lenbits = opts.bits;
  27170. if (ret) {
  27171. strm.msg = 'invalid code lengths set';
  27172. state.mode = BAD;
  27173. break;
  27174. }
  27175. //Tracev((stderr, "inflate: code lengths ok\n"));
  27176. state.have = 0;
  27177. state.mode = CODELENS;
  27178. /* falls through */
  27179. case CODELENS:
  27180. while (state.have < state.nlen + state.ndist) {
  27181. for (;;) {
  27182. here = state.lencode[hold & ((1 << state.lenbits) - 1)];/*BITS(state.lenbits)*/
  27183. here_bits = here >>> 24;
  27184. here_op = (here >>> 16) & 0xff;
  27185. here_val = here & 0xffff;
  27186. if ((here_bits) <= bits) { break; }
  27187. //--- PULLBYTE() ---//
  27188. if (have === 0) { break inf_leave; }
  27189. have--;
  27190. hold += input[next++] << bits;
  27191. bits += 8;
  27192. //---//
  27193. }
  27194. if (here_val < 16) {
  27195. //--- DROPBITS(here.bits) ---//
  27196. hold >>>= here_bits;
  27197. bits -= here_bits;
  27198. //---//
  27199. state.lens[state.have++] = here_val;
  27200. }
  27201. else {
  27202. if (here_val === 16) {
  27203. //=== NEEDBITS(here.bits + 2);
  27204. n = here_bits + 2;
  27205. while (bits < n) {
  27206. if (have === 0) { break inf_leave; }
  27207. have--;
  27208. hold += input[next++] << bits;
  27209. bits += 8;
  27210. }
  27211. //===//
  27212. //--- DROPBITS(here.bits) ---//
  27213. hold >>>= here_bits;
  27214. bits -= here_bits;
  27215. //---//
  27216. if (state.have === 0) {
  27217. strm.msg = 'invalid bit length repeat';
  27218. state.mode = BAD;
  27219. break;
  27220. }
  27221. len = state.lens[state.have - 1];
  27222. copy = 3 + (hold & 0x03);//BITS(2);
  27223. //--- DROPBITS(2) ---//
  27224. hold >>>= 2;
  27225. bits -= 2;
  27226. //---//
  27227. }
  27228. else if (here_val === 17) {
  27229. //=== NEEDBITS(here.bits + 3);
  27230. n = here_bits + 3;
  27231. while (bits < n) {
  27232. if (have === 0) { break inf_leave; }
  27233. have--;
  27234. hold += input[next++] << bits;
  27235. bits += 8;
  27236. }
  27237. //===//
  27238. //--- DROPBITS(here.bits) ---//
  27239. hold >>>= here_bits;
  27240. bits -= here_bits;
  27241. //---//
  27242. len = 0;
  27243. copy = 3 + (hold & 0x07);//BITS(3);
  27244. //--- DROPBITS(3) ---//
  27245. hold >>>= 3;
  27246. bits -= 3;
  27247. //---//
  27248. }
  27249. else {
  27250. //=== NEEDBITS(here.bits + 7);
  27251. n = here_bits + 7;
  27252. while (bits < n) {
  27253. if (have === 0) { break inf_leave; }
  27254. have--;
  27255. hold += input[next++] << bits;
  27256. bits += 8;
  27257. }
  27258. //===//
  27259. //--- DROPBITS(here.bits) ---//
  27260. hold >>>= here_bits;
  27261. bits -= here_bits;
  27262. //---//
  27263. len = 0;
  27264. copy = 11 + (hold & 0x7f);//BITS(7);
  27265. //--- DROPBITS(7) ---//
  27266. hold >>>= 7;
  27267. bits -= 7;
  27268. //---//
  27269. }
  27270. if (state.have + copy > state.nlen + state.ndist) {
  27271. strm.msg = 'invalid bit length repeat';
  27272. state.mode = BAD;
  27273. break;
  27274. }
  27275. while (copy--) {
  27276. state.lens[state.have++] = len;
  27277. }
  27278. }
  27279. }
  27280. /* handle error breaks in while */
  27281. if (state.mode === BAD) { break; }
  27282. /* check for end-of-block code (better have one) */
  27283. if (state.lens[256] === 0) {
  27284. strm.msg = 'invalid code -- missing end-of-block';
  27285. state.mode = BAD;
  27286. break;
  27287. }
  27288. /* build code tables -- note: do not change the lenbits or distbits
  27289. values here (9 and 6) without reading the comments in inftrees.h
  27290. concerning the ENOUGH constants, which depend on those values */
  27291. state.lenbits = 9;
  27292. opts = { bits: state.lenbits };
  27293. ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts);
  27294. // We have separate tables & no pointers. 2 commented lines below not needed.
  27295. // state.next_index = opts.table_index;
  27296. state.lenbits = opts.bits;
  27297. // state.lencode = state.next;
  27298. if (ret) {
  27299. strm.msg = 'invalid literal/lengths set';
  27300. state.mode = BAD;
  27301. break;
  27302. }
  27303. state.distbits = 6;
  27304. //state.distcode.copy(state.codes);
  27305. // Switch to use dynamic table
  27306. state.distcode = state.distdyn;
  27307. opts = { bits: state.distbits };
  27308. ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts);
  27309. // We have separate tables & no pointers. 2 commented lines below not needed.
  27310. // state.next_index = opts.table_index;
  27311. state.distbits = opts.bits;
  27312. // state.distcode = state.next;
  27313. if (ret) {
  27314. strm.msg = 'invalid distances set';
  27315. state.mode = BAD;
  27316. break;
  27317. }
  27318. //Tracev((stderr, 'inflate: codes ok\n'));
  27319. state.mode = LEN_;
  27320. if (flush === Z_TREES) { break inf_leave; }
  27321. /* falls through */
  27322. case LEN_:
  27323. state.mode = LEN;
  27324. /* falls through */
  27325. case LEN:
  27326. if (have >= 6 && left >= 258) {
  27327. //--- RESTORE() ---
  27328. strm.next_out = put;
  27329. strm.avail_out = left;
  27330. strm.next_in = next;
  27331. strm.avail_in = have;
  27332. state.hold = hold;
  27333. state.bits = bits;
  27334. //---
  27335. inflate_fast(strm, _out);
  27336. //--- LOAD() ---
  27337. put = strm.next_out;
  27338. output = strm.output;
  27339. left = strm.avail_out;
  27340. next = strm.next_in;
  27341. input = strm.input;
  27342. have = strm.avail_in;
  27343. hold = state.hold;
  27344. bits = state.bits;
  27345. //---
  27346. if (state.mode === TYPE) {
  27347. state.back = -1;
  27348. }
  27349. break;
  27350. }
  27351. state.back = 0;
  27352. for (;;) {
  27353. here = state.lencode[hold & ((1 << state.lenbits) - 1)]; /*BITS(state.lenbits)*/
  27354. here_bits = here >>> 24;
  27355. here_op = (here >>> 16) & 0xff;
  27356. here_val = here & 0xffff;
  27357. if (here_bits <= bits) { break; }
  27358. //--- PULLBYTE() ---//
  27359. if (have === 0) { break inf_leave; }
  27360. have--;
  27361. hold += input[next++] << bits;
  27362. bits += 8;
  27363. //---//
  27364. }
  27365. if (here_op && (here_op & 0xf0) === 0) {
  27366. last_bits = here_bits;
  27367. last_op = here_op;
  27368. last_val = here_val;
  27369. for (;;) {
  27370. here = state.lencode[last_val +
  27371. ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];
  27372. here_bits = here >>> 24;
  27373. here_op = (here >>> 16) & 0xff;
  27374. here_val = here & 0xffff;
  27375. if ((last_bits + here_bits) <= bits) { break; }
  27376. //--- PULLBYTE() ---//
  27377. if (have === 0) { break inf_leave; }
  27378. have--;
  27379. hold += input[next++] << bits;
  27380. bits += 8;
  27381. //---//
  27382. }
  27383. //--- DROPBITS(last.bits) ---//
  27384. hold >>>= last_bits;
  27385. bits -= last_bits;
  27386. //---//
  27387. state.back += last_bits;
  27388. }
  27389. //--- DROPBITS(here.bits) ---//
  27390. hold >>>= here_bits;
  27391. bits -= here_bits;
  27392. //---//
  27393. state.back += here_bits;
  27394. state.length = here_val;
  27395. if (here_op === 0) {
  27396. //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
  27397. // "inflate: literal '%c'\n" :
  27398. // "inflate: literal 0x%02x\n", here.val));
  27399. state.mode = LIT;
  27400. break;
  27401. }
  27402. if (here_op & 32) {
  27403. //Tracevv((stderr, "inflate: end of block\n"));
  27404. state.back = -1;
  27405. state.mode = TYPE;
  27406. break;
  27407. }
  27408. if (here_op & 64) {
  27409. strm.msg = 'invalid literal/length code';
  27410. state.mode = BAD;
  27411. break;
  27412. }
  27413. state.extra = here_op & 15;
  27414. state.mode = LENEXT;
  27415. /* falls through */
  27416. case LENEXT:
  27417. if (state.extra) {
  27418. //=== NEEDBITS(state.extra);
  27419. n = state.extra;
  27420. while (bits < n) {
  27421. if (have === 0) { break inf_leave; }
  27422. have--;
  27423. hold += input[next++] << bits;
  27424. bits += 8;
  27425. }
  27426. //===//
  27427. state.length += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;
  27428. //--- DROPBITS(state.extra) ---//
  27429. hold >>>= state.extra;
  27430. bits -= state.extra;
  27431. //---//
  27432. state.back += state.extra;
  27433. }
  27434. //Tracevv((stderr, "inflate: length %u\n", state.length));
  27435. state.was = state.length;
  27436. state.mode = DIST;
  27437. /* falls through */
  27438. case DIST:
  27439. for (;;) {
  27440. here = state.distcode[hold & ((1 << state.distbits) - 1)];/*BITS(state.distbits)*/
  27441. here_bits = here >>> 24;
  27442. here_op = (here >>> 16) & 0xff;
  27443. here_val = here & 0xffff;
  27444. if ((here_bits) <= bits) { break; }
  27445. //--- PULLBYTE() ---//
  27446. if (have === 0) { break inf_leave; }
  27447. have--;
  27448. hold += input[next++] << bits;
  27449. bits += 8;
  27450. //---//
  27451. }
  27452. if ((here_op & 0xf0) === 0) {
  27453. last_bits = here_bits;
  27454. last_op = here_op;
  27455. last_val = here_val;
  27456. for (;;) {
  27457. here = state.distcode[last_val +
  27458. ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];
  27459. here_bits = here >>> 24;
  27460. here_op = (here >>> 16) & 0xff;
  27461. here_val = here & 0xffff;
  27462. if ((last_bits + here_bits) <= bits) { break; }
  27463. //--- PULLBYTE() ---//
  27464. if (have === 0) { break inf_leave; }
  27465. have--;
  27466. hold += input[next++] << bits;
  27467. bits += 8;
  27468. //---//
  27469. }
  27470. //--- DROPBITS(last.bits) ---//
  27471. hold >>>= last_bits;
  27472. bits -= last_bits;
  27473. //---//
  27474. state.back += last_bits;
  27475. }
  27476. //--- DROPBITS(here.bits) ---//
  27477. hold >>>= here_bits;
  27478. bits -= here_bits;
  27479. //---//
  27480. state.back += here_bits;
  27481. if (here_op & 64) {
  27482. strm.msg = 'invalid distance code';
  27483. state.mode = BAD;
  27484. break;
  27485. }
  27486. state.offset = here_val;
  27487. state.extra = (here_op) & 15;
  27488. state.mode = DISTEXT;
  27489. /* falls through */
  27490. case DISTEXT:
  27491. if (state.extra) {
  27492. //=== NEEDBITS(state.extra);
  27493. n = state.extra;
  27494. while (bits < n) {
  27495. if (have === 0) { break inf_leave; }
  27496. have--;
  27497. hold += input[next++] << bits;
  27498. bits += 8;
  27499. }
  27500. //===//
  27501. state.offset += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;
  27502. //--- DROPBITS(state.extra) ---//
  27503. hold >>>= state.extra;
  27504. bits -= state.extra;
  27505. //---//
  27506. state.back += state.extra;
  27507. }
  27508. //#ifdef INFLATE_STRICT
  27509. if (state.offset > state.dmax) {
  27510. strm.msg = 'invalid distance too far back';
  27511. state.mode = BAD;
  27512. break;
  27513. }
  27514. //#endif
  27515. //Tracevv((stderr, "inflate: distance %u\n", state.offset));
  27516. state.mode = MATCH;
  27517. /* falls through */
  27518. case MATCH:
  27519. if (left === 0) { break inf_leave; }
  27520. copy = _out - left;
  27521. if (state.offset > copy) { /* copy from window */
  27522. copy = state.offset - copy;
  27523. if (copy > state.whave) {
  27524. if (state.sane) {
  27525. strm.msg = 'invalid distance too far back';
  27526. state.mode = BAD;
  27527. break;
  27528. }
  27529. // (!) This block is disabled in zlib defaults,
  27530. // don't enable it for binary compatibility
  27531. //#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
  27532. // Trace((stderr, "inflate.c too far\n"));
  27533. // copy -= state.whave;
  27534. // if (copy > state.length) { copy = state.length; }
  27535. // if (copy > left) { copy = left; }
  27536. // left -= copy;
  27537. // state.length -= copy;
  27538. // do {
  27539. // output[put++] = 0;
  27540. // } while (--copy);
  27541. // if (state.length === 0) { state.mode = LEN; }
  27542. // break;
  27543. //#endif
  27544. }
  27545. if (copy > state.wnext) {
  27546. copy -= state.wnext;
  27547. from = state.wsize - copy;
  27548. }
  27549. else {
  27550. from = state.wnext - copy;
  27551. }
  27552. if (copy > state.length) { copy = state.length; }
  27553. from_source = state.window;
  27554. }
  27555. else { /* copy from output */
  27556. from_source = output;
  27557. from = put - state.offset;
  27558. copy = state.length;
  27559. }
  27560. if (copy > left) { copy = left; }
  27561. left -= copy;
  27562. state.length -= copy;
  27563. do {
  27564. output[put++] = from_source[from++];
  27565. } while (--copy);
  27566. if (state.length === 0) { state.mode = LEN; }
  27567. break;
  27568. case LIT:
  27569. if (left === 0) { break inf_leave; }
  27570. output[put++] = state.length;
  27571. left--;
  27572. state.mode = LEN;
  27573. break;
  27574. case CHECK:
  27575. if (state.wrap) {
  27576. //=== NEEDBITS(32);
  27577. while (bits < 32) {
  27578. if (have === 0) { break inf_leave; }
  27579. have--;
  27580. // Use '|' instead of '+' to make sure that result is signed
  27581. hold |= input[next++] << bits;
  27582. bits += 8;
  27583. }
  27584. //===//
  27585. _out -= left;
  27586. strm.total_out += _out;
  27587. state.total += _out;
  27588. if (_out) {
  27589. strm.adler = state.check =
  27590. /*UPDATE(state.check, put - _out, _out);*/
  27591. (state.flags ? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out));
  27592. }
  27593. _out = left;
  27594. // NB: crc32 stored as signed 32-bit int, zswap32 returns signed too
  27595. if ((state.flags ? hold : zswap32(hold)) !== state.check) {
  27596. strm.msg = 'incorrect data check';
  27597. state.mode = BAD;
  27598. break;
  27599. }
  27600. //=== INITBITS();
  27601. hold = 0;
  27602. bits = 0;
  27603. //===//
  27604. //Tracev((stderr, "inflate: check matches trailer\n"));
  27605. }
  27606. state.mode = LENGTH;
  27607. /* falls through */
  27608. case LENGTH:
  27609. if (state.wrap && state.flags) {
  27610. //=== NEEDBITS(32);
  27611. while (bits < 32) {
  27612. if (have === 0) { break inf_leave; }
  27613. have--;
  27614. hold += input[next++] << bits;
  27615. bits += 8;
  27616. }
  27617. //===//
  27618. if (hold !== (state.total & 0xffffffff)) {
  27619. strm.msg = 'incorrect length check';
  27620. state.mode = BAD;
  27621. break;
  27622. }
  27623. //=== INITBITS();
  27624. hold = 0;
  27625. bits = 0;
  27626. //===//
  27627. //Tracev((stderr, "inflate: length matches trailer\n"));
  27628. }
  27629. state.mode = DONE;
  27630. /* falls through */
  27631. case DONE:
  27632. ret = Z_STREAM_END;
  27633. break inf_leave;
  27634. case BAD:
  27635. ret = Z_DATA_ERROR;
  27636. break inf_leave;
  27637. case MEM:
  27638. return Z_MEM_ERROR;
  27639. case SYNC:
  27640. /* falls through */
  27641. default:
  27642. return Z_STREAM_ERROR;
  27643. }
  27644. }
  27645. // inf_leave <- here is real place for "goto inf_leave", emulated via "break inf_leave"
  27646. /*
  27647. Return from inflate(), updating the total counts and the check value.
  27648. If there was no progress during the inflate() call, return a buffer
  27649. error. Call updatewindow() to create and/or update the window state.
  27650. Note: a memory error from inflate() is non-recoverable.
  27651. */
  27652. //--- RESTORE() ---
  27653. strm.next_out = put;
  27654. strm.avail_out = left;
  27655. strm.next_in = next;
  27656. strm.avail_in = have;
  27657. state.hold = hold;
  27658. state.bits = bits;
  27659. //---
  27660. if (state.wsize || (_out !== strm.avail_out && state.mode < BAD &&
  27661. (state.mode < CHECK || flush !== Z_FINISH))) {
  27662. if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) {
  27663. state.mode = MEM;
  27664. return Z_MEM_ERROR;
  27665. }
  27666. }
  27667. _in -= strm.avail_in;
  27668. _out -= strm.avail_out;
  27669. strm.total_in += _in;
  27670. strm.total_out += _out;
  27671. state.total += _out;
  27672. if (state.wrap && _out) {
  27673. strm.adler = state.check = /*UPDATE(state.check, strm.next_out - _out, _out);*/
  27674. (state.flags ? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out));
  27675. }
  27676. strm.data_type = state.bits + (state.last ? 64 : 0) +
  27677. (state.mode === TYPE ? 128 : 0) +
  27678. (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0);
  27679. if (((_in === 0 && _out === 0) || flush === Z_FINISH) && ret === Z_OK) {
  27680. ret = Z_BUF_ERROR;
  27681. }
  27682. return ret;
  27683. }
  27684. function inflateEnd(strm) {
  27685. if (!strm || !strm.state /*|| strm->zfree == (free_func)0*/) {
  27686. return Z_STREAM_ERROR;
  27687. }
  27688. var state = strm.state;
  27689. if (state.window) {
  27690. state.window = null;
  27691. }
  27692. strm.state = null;
  27693. return Z_OK;
  27694. }
  27695. function inflateGetHeader(strm, head) {
  27696. var state;
  27697. /* check state */
  27698. if (!strm || !strm.state) { return Z_STREAM_ERROR; }
  27699. state = strm.state;
  27700. if ((state.wrap & 2) === 0) { return Z_STREAM_ERROR; }
  27701. /* save header structure */
  27702. state.head = head;
  27703. head.done = false;
  27704. return Z_OK;
  27705. }
  27706. function inflateSetDictionary(strm, dictionary) {
  27707. var dictLength = dictionary.length;
  27708. var state;
  27709. var dictid;
  27710. var ret;
  27711. /* check state */
  27712. if (!strm /* == Z_NULL */ || !strm.state /* == Z_NULL */) { return Z_STREAM_ERROR; }
  27713. state = strm.state;
  27714. if (state.wrap !== 0 && state.mode !== DICT) {
  27715. return Z_STREAM_ERROR;
  27716. }
  27717. /* check for correct dictionary identifier */
  27718. if (state.mode === DICT) {
  27719. dictid = 1; /* adler32(0, null, 0)*/
  27720. /* dictid = adler32(dictid, dictionary, dictLength); */
  27721. dictid = adler32(dictid, dictionary, dictLength, 0);
  27722. if (dictid !== state.check) {
  27723. return Z_DATA_ERROR;
  27724. }
  27725. }
  27726. /* copy dictionary to window using updatewindow(), which will amend the
  27727. existing dictionary if appropriate */
  27728. ret = updatewindow(strm, dictionary, dictLength, dictLength);
  27729. if (ret) {
  27730. state.mode = MEM;
  27731. return Z_MEM_ERROR;
  27732. }
  27733. state.havedict = 1;
  27734. // Tracev((stderr, "inflate: dictionary set\n"));
  27735. return Z_OK;
  27736. }
  27737. exports.inflateReset = inflateReset;
  27738. exports.inflateReset2 = inflateReset2;
  27739. exports.inflateResetKeep = inflateResetKeep;
  27740. exports.inflateInit = inflateInit;
  27741. exports.inflateInit2 = inflateInit2;
  27742. exports.inflate = inflate;
  27743. exports.inflateEnd = inflateEnd;
  27744. exports.inflateGetHeader = inflateGetHeader;
  27745. exports.inflateSetDictionary = inflateSetDictionary;
  27746. exports.inflateInfo = 'pako inflate (from Nodeca project)';
  27747. /* Not implemented
  27748. exports.inflateCopy = inflateCopy;
  27749. exports.inflateGetDictionary = inflateGetDictionary;
  27750. exports.inflateMark = inflateMark;
  27751. exports.inflatePrime = inflatePrime;
  27752. exports.inflateSync = inflateSync;
  27753. exports.inflateSyncPoint = inflateSyncPoint;
  27754. exports.inflateUndermine = inflateUndermine;
  27755. */
  27756. /***/ }),
  27757. /* 274 */
  27758. /***/ (function(module, exports, __webpack_require__) {
  27759. "use strict";
  27760. // (C) 1995-2013 Jean-loup Gailly and Mark Adler
  27761. // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
  27762. //
  27763. // This software is provided 'as-is', without any express or implied
  27764. // warranty. In no event will the authors be held liable for any damages
  27765. // arising from the use of this software.
  27766. //
  27767. // Permission is granted to anyone to use this software for any purpose,
  27768. // including commercial applications, and to alter it and redistribute it
  27769. // freely, subject to the following restrictions:
  27770. //
  27771. // 1. The origin of this software must not be misrepresented; you must not
  27772. // claim that you wrote the original software. If you use this software
  27773. // in a product, an acknowledgment in the product documentation would be
  27774. // appreciated but is not required.
  27775. // 2. Altered source versions must be plainly marked as such, and must not be
  27776. // misrepresented as being the original software.
  27777. // 3. This notice may not be removed or altered from any source distribution.
  27778. // See state defs from inflate.js
  27779. var BAD = 30; /* got a data error -- remain here until reset */
  27780. var TYPE = 12; /* i: waiting for type bits, including last-flag bit */
  27781. /*
  27782. Decode literal, length, and distance codes and write out the resulting
  27783. literal and match bytes until either not enough input or output is
  27784. available, an end-of-block is encountered, or a data error is encountered.
  27785. When large enough input and output buffers are supplied to inflate(), for
  27786. example, a 16K input buffer and a 64K output buffer, more than 95% of the
  27787. inflate execution time is spent in this routine.
  27788. Entry assumptions:
  27789. state.mode === LEN
  27790. strm.avail_in >= 6
  27791. strm.avail_out >= 258
  27792. start >= strm.avail_out
  27793. state.bits < 8
  27794. On return, state.mode is one of:
  27795. LEN -- ran out of enough output space or enough available input
  27796. TYPE -- reached end of block code, inflate() to interpret next block
  27797. BAD -- error in block data
  27798. Notes:
  27799. - The maximum input bits used by a length/distance pair is 15 bits for the
  27800. length code, 5 bits for the length extra, 15 bits for the distance code,
  27801. and 13 bits for the distance extra. This totals 48 bits, or six bytes.
  27802. Therefore if strm.avail_in >= 6, then there is enough input to avoid
  27803. checking for available input while decoding.
  27804. - The maximum bytes that a single length/distance pair can output is 258
  27805. bytes, which is the maximum length that can be coded. inflate_fast()
  27806. requires strm.avail_out >= 258 for each loop to avoid checking for
  27807. output space.
  27808. */
  27809. module.exports = function inflate_fast(strm, start) {
  27810. var state;
  27811. var _in; /* local strm.input */
  27812. var last; /* have enough input while in < last */
  27813. var _out; /* local strm.output */
  27814. var beg; /* inflate()'s initial strm.output */
  27815. var end; /* while out < end, enough space available */
  27816. //#ifdef INFLATE_STRICT
  27817. var dmax; /* maximum distance from zlib header */
  27818. //#endif
  27819. var wsize; /* window size or zero if not using window */
  27820. var whave; /* valid bytes in the window */
  27821. var wnext; /* window write index */
  27822. // Use `s_window` instead `window`, avoid conflict with instrumentation tools
  27823. var s_window; /* allocated sliding window, if wsize != 0 */
  27824. var hold; /* local strm.hold */
  27825. var bits; /* local strm.bits */
  27826. var lcode; /* local strm.lencode */
  27827. var dcode; /* local strm.distcode */
  27828. var lmask; /* mask for first level of length codes */
  27829. var dmask; /* mask for first level of distance codes */
  27830. var here; /* retrieved table entry */
  27831. var op; /* code bits, operation, extra bits, or */
  27832. /* window position, window bytes to copy */
  27833. var len; /* match length, unused bytes */
  27834. var dist; /* match distance */
  27835. var from; /* where to copy match from */
  27836. var from_source;
  27837. var input, output; // JS specific, because we have no pointers
  27838. /* copy state to local variables */
  27839. state = strm.state;
  27840. //here = state.here;
  27841. _in = strm.next_in;
  27842. input = strm.input;
  27843. last = _in + (strm.avail_in - 5);
  27844. _out = strm.next_out;
  27845. output = strm.output;
  27846. beg = _out - (start - strm.avail_out);
  27847. end = _out + (strm.avail_out - 257);
  27848. //#ifdef INFLATE_STRICT
  27849. dmax = state.dmax;
  27850. //#endif
  27851. wsize = state.wsize;
  27852. whave = state.whave;
  27853. wnext = state.wnext;
  27854. s_window = state.window;
  27855. hold = state.hold;
  27856. bits = state.bits;
  27857. lcode = state.lencode;
  27858. dcode = state.distcode;
  27859. lmask = (1 << state.lenbits) - 1;
  27860. dmask = (1 << state.distbits) - 1;
  27861. /* decode literals and length/distances until end-of-block or not enough
  27862. input data or output space */
  27863. top:
  27864. do {
  27865. if (bits < 15) {
  27866. hold += input[_in++] << bits;
  27867. bits += 8;
  27868. hold += input[_in++] << bits;
  27869. bits += 8;
  27870. }
  27871. here = lcode[hold & lmask];
  27872. dolen:
  27873. for (;;) { // Goto emulation
  27874. op = here >>> 24/*here.bits*/;
  27875. hold >>>= op;
  27876. bits -= op;
  27877. op = (here >>> 16) & 0xff/*here.op*/;
  27878. if (op === 0) { /* literal */
  27879. //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
  27880. // "inflate: literal '%c'\n" :
  27881. // "inflate: literal 0x%02x\n", here.val));
  27882. output[_out++] = here & 0xffff/*here.val*/;
  27883. }
  27884. else if (op & 16) { /* length base */
  27885. len = here & 0xffff/*here.val*/;
  27886. op &= 15; /* number of extra bits */
  27887. if (op) {
  27888. if (bits < op) {
  27889. hold += input[_in++] << bits;
  27890. bits += 8;
  27891. }
  27892. len += hold & ((1 << op) - 1);
  27893. hold >>>= op;
  27894. bits -= op;
  27895. }
  27896. //Tracevv((stderr, "inflate: length %u\n", len));
  27897. if (bits < 15) {
  27898. hold += input[_in++] << bits;
  27899. bits += 8;
  27900. hold += input[_in++] << bits;
  27901. bits += 8;
  27902. }
  27903. here = dcode[hold & dmask];
  27904. dodist:
  27905. for (;;) { // goto emulation
  27906. op = here >>> 24/*here.bits*/;
  27907. hold >>>= op;
  27908. bits -= op;
  27909. op = (here >>> 16) & 0xff/*here.op*/;
  27910. if (op & 16) { /* distance base */
  27911. dist = here & 0xffff/*here.val*/;
  27912. op &= 15; /* number of extra bits */
  27913. if (bits < op) {
  27914. hold += input[_in++] << bits;
  27915. bits += 8;
  27916. if (bits < op) {
  27917. hold += input[_in++] << bits;
  27918. bits += 8;
  27919. }
  27920. }
  27921. dist += hold & ((1 << op) - 1);
  27922. //#ifdef INFLATE_STRICT
  27923. if (dist > dmax) {
  27924. strm.msg = 'invalid distance too far back';
  27925. state.mode = BAD;
  27926. break top;
  27927. }
  27928. //#endif
  27929. hold >>>= op;
  27930. bits -= op;
  27931. //Tracevv((stderr, "inflate: distance %u\n", dist));
  27932. op = _out - beg; /* max distance in output */
  27933. if (dist > op) { /* see if copy from window */
  27934. op = dist - op; /* distance back in window */
  27935. if (op > whave) {
  27936. if (state.sane) {
  27937. strm.msg = 'invalid distance too far back';
  27938. state.mode = BAD;
  27939. break top;
  27940. }
  27941. // (!) This block is disabled in zlib defaults,
  27942. // don't enable it for binary compatibility
  27943. //#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
  27944. // if (len <= op - whave) {
  27945. // do {
  27946. // output[_out++] = 0;
  27947. // } while (--len);
  27948. // continue top;
  27949. // }
  27950. // len -= op - whave;
  27951. // do {
  27952. // output[_out++] = 0;
  27953. // } while (--op > whave);
  27954. // if (op === 0) {
  27955. // from = _out - dist;
  27956. // do {
  27957. // output[_out++] = output[from++];
  27958. // } while (--len);
  27959. // continue top;
  27960. // }
  27961. //#endif
  27962. }
  27963. from = 0; // window index
  27964. from_source = s_window;
  27965. if (wnext === 0) { /* very common case */
  27966. from += wsize - op;
  27967. if (op < len) { /* some from window */
  27968. len -= op;
  27969. do {
  27970. output[_out++] = s_window[from++];
  27971. } while (--op);
  27972. from = _out - dist; /* rest from output */
  27973. from_source = output;
  27974. }
  27975. }
  27976. else if (wnext < op) { /* wrap around window */
  27977. from += wsize + wnext - op;
  27978. op -= wnext;
  27979. if (op < len) { /* some from end of window */
  27980. len -= op;
  27981. do {
  27982. output[_out++] = s_window[from++];
  27983. } while (--op);
  27984. from = 0;
  27985. if (wnext < len) { /* some from start of window */
  27986. op = wnext;
  27987. len -= op;
  27988. do {
  27989. output[_out++] = s_window[from++];
  27990. } while (--op);
  27991. from = _out - dist; /* rest from output */
  27992. from_source = output;
  27993. }
  27994. }
  27995. }
  27996. else { /* contiguous in window */
  27997. from += wnext - op;
  27998. if (op < len) { /* some from window */
  27999. len -= op;
  28000. do {
  28001. output[_out++] = s_window[from++];
  28002. } while (--op);
  28003. from = _out - dist; /* rest from output */
  28004. from_source = output;
  28005. }
  28006. }
  28007. while (len > 2) {
  28008. output[_out++] = from_source[from++];
  28009. output[_out++] = from_source[from++];
  28010. output[_out++] = from_source[from++];
  28011. len -= 3;
  28012. }
  28013. if (len) {
  28014. output[_out++] = from_source[from++];
  28015. if (len > 1) {
  28016. output[_out++] = from_source[from++];
  28017. }
  28018. }
  28019. }
  28020. else {
  28021. from = _out - dist; /* copy direct from output */
  28022. do { /* minimum length is three */
  28023. output[_out++] = output[from++];
  28024. output[_out++] = output[from++];
  28025. output[_out++] = output[from++];
  28026. len -= 3;
  28027. } while (len > 2);
  28028. if (len) {
  28029. output[_out++] = output[from++];
  28030. if (len > 1) {
  28031. output[_out++] = output[from++];
  28032. }
  28033. }
  28034. }
  28035. }
  28036. else if ((op & 64) === 0) { /* 2nd level distance code */
  28037. here = dcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];
  28038. continue dodist;
  28039. }
  28040. else {
  28041. strm.msg = 'invalid distance code';
  28042. state.mode = BAD;
  28043. break top;
  28044. }
  28045. break; // need to emulate goto via "continue"
  28046. }
  28047. }
  28048. else if ((op & 64) === 0) { /* 2nd level length code */
  28049. here = lcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];
  28050. continue dolen;
  28051. }
  28052. else if (op & 32) { /* end-of-block */
  28053. //Tracevv((stderr, "inflate: end of block\n"));
  28054. state.mode = TYPE;
  28055. break top;
  28056. }
  28057. else {
  28058. strm.msg = 'invalid literal/length code';
  28059. state.mode = BAD;
  28060. break top;
  28061. }
  28062. break; // need to emulate goto via "continue"
  28063. }
  28064. } while (_in < last && _out < end);
  28065. /* return unused bytes (on entry, bits < 8, so in won't go too far back) */
  28066. len = bits >> 3;
  28067. _in -= len;
  28068. bits -= len << 3;
  28069. hold &= (1 << bits) - 1;
  28070. /* update state and return */
  28071. strm.next_in = _in;
  28072. strm.next_out = _out;
  28073. strm.avail_in = (_in < last ? 5 + (last - _in) : 5 - (_in - last));
  28074. strm.avail_out = (_out < end ? 257 + (end - _out) : 257 - (_out - end));
  28075. state.hold = hold;
  28076. state.bits = bits;
  28077. return;
  28078. };
  28079. /***/ }),
  28080. /* 275 */
  28081. /***/ (function(module, exports, __webpack_require__) {
  28082. "use strict";
  28083. // (C) 1995-2013 Jean-loup Gailly and Mark Adler
  28084. // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
  28085. //
  28086. // This software is provided 'as-is', without any express or implied
  28087. // warranty. In no event will the authors be held liable for any damages
  28088. // arising from the use of this software.
  28089. //
  28090. // Permission is granted to anyone to use this software for any purpose,
  28091. // including commercial applications, and to alter it and redistribute it
  28092. // freely, subject to the following restrictions:
  28093. //
  28094. // 1. The origin of this software must not be misrepresented; you must not
  28095. // claim that you wrote the original software. If you use this software
  28096. // in a product, an acknowledgment in the product documentation would be
  28097. // appreciated but is not required.
  28098. // 2. Altered source versions must be plainly marked as such, and must not be
  28099. // misrepresented as being the original software.
  28100. // 3. This notice may not be removed or altered from any source distribution.
  28101. var utils = __webpack_require__(71);
  28102. var MAXBITS = 15;
  28103. var ENOUGH_LENS = 852;
  28104. var ENOUGH_DISTS = 592;
  28105. //var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);
  28106. var CODES = 0;
  28107. var LENS = 1;
  28108. var DISTS = 2;
  28109. var lbase = [ /* Length codes 257..285 base */
  28110. 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
  28111. 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0
  28112. ];
  28113. var lext = [ /* Length codes 257..285 extra */
  28114. 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,
  28115. 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78
  28116. ];
  28117. var dbase = [ /* Distance codes 0..29 base */
  28118. 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
  28119. 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
  28120. 8193, 12289, 16385, 24577, 0, 0
  28121. ];
  28122. var dext = [ /* Distance codes 0..29 extra */
  28123. 16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,
  28124. 23, 23, 24, 24, 25, 25, 26, 26, 27, 27,
  28125. 28, 28, 29, 29, 64, 64
  28126. ];
  28127. module.exports = function inflate_table(type, lens, lens_index, codes, table, table_index, work, opts)
  28128. {
  28129. var bits = opts.bits;
  28130. //here = opts.here; /* table entry for duplication */
  28131. var len = 0; /* a code's length in bits */
  28132. var sym = 0; /* index of code symbols */
  28133. var min = 0, max = 0; /* minimum and maximum code lengths */
  28134. var root = 0; /* number of index bits for root table */
  28135. var curr = 0; /* number of index bits for current table */
  28136. var drop = 0; /* code bits to drop for sub-table */
  28137. var left = 0; /* number of prefix codes available */
  28138. var used = 0; /* code entries in table used */
  28139. var huff = 0; /* Huffman code */
  28140. var incr; /* for incrementing code, index */
  28141. var fill; /* index for replicating entries */
  28142. var low; /* low bits for current root entry */
  28143. var mask; /* mask for low root bits */
  28144. var next; /* next available space in table */
  28145. var base = null; /* base value table to use */
  28146. var base_index = 0;
  28147. // var shoextra; /* extra bits table to use */
  28148. var end; /* use base and extra for symbol > end */
  28149. var count = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1]; /* number of codes of each length */
  28150. var offs = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1]; /* offsets in table for each length */
  28151. var extra = null;
  28152. var extra_index = 0;
  28153. var here_bits, here_op, here_val;
  28154. /*
  28155. Process a set of code lengths to create a canonical Huffman code. The
  28156. code lengths are lens[0..codes-1]. Each length corresponds to the
  28157. symbols 0..codes-1. The Huffman code is generated by first sorting the
  28158. symbols by length from short to long, and retaining the symbol order
  28159. for codes with equal lengths. Then the code starts with all zero bits
  28160. for the first code of the shortest length, and the codes are integer
  28161. increments for the same length, and zeros are appended as the length
  28162. increases. For the deflate format, these bits are stored backwards
  28163. from their more natural integer increment ordering, and so when the
  28164. decoding tables are built in the large loop below, the integer codes
  28165. are incremented backwards.
  28166. This routine assumes, but does not check, that all of the entries in
  28167. lens[] are in the range 0..MAXBITS. The caller must assure this.
  28168. 1..MAXBITS is interpreted as that code length. zero means that that
  28169. symbol does not occur in this code.
  28170. The codes are sorted by computing a count of codes for each length,
  28171. creating from that a table of starting indices for each length in the
  28172. sorted table, and then entering the symbols in order in the sorted
  28173. table. The sorted table is work[], with that space being provided by
  28174. the caller.
  28175. The length counts are used for other purposes as well, i.e. finding
  28176. the minimum and maximum length codes, determining if there are any
  28177. codes at all, checking for a valid set of lengths, and looking ahead
  28178. at length counts to determine sub-table sizes when building the
  28179. decoding tables.
  28180. */
  28181. /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */
  28182. for (len = 0; len <= MAXBITS; len++) {
  28183. count[len] = 0;
  28184. }
  28185. for (sym = 0; sym < codes; sym++) {
  28186. count[lens[lens_index + sym]]++;
  28187. }
  28188. /* bound code lengths, force root to be within code lengths */
  28189. root = bits;
  28190. for (max = MAXBITS; max >= 1; max--) {
  28191. if (count[max] !== 0) { break; }
  28192. }
  28193. if (root > max) {
  28194. root = max;
  28195. }
  28196. if (max === 0) { /* no symbols to code at all */
  28197. //table.op[opts.table_index] = 64; //here.op = (var char)64; /* invalid code marker */
  28198. //table.bits[opts.table_index] = 1; //here.bits = (var char)1;
  28199. //table.val[opts.table_index++] = 0; //here.val = (var short)0;
  28200. table[table_index++] = (1 << 24) | (64 << 16) | 0;
  28201. //table.op[opts.table_index] = 64;
  28202. //table.bits[opts.table_index] = 1;
  28203. //table.val[opts.table_index++] = 0;
  28204. table[table_index++] = (1 << 24) | (64 << 16) | 0;
  28205. opts.bits = 1;
  28206. return 0; /* no symbols, but wait for decoding to report error */
  28207. }
  28208. for (min = 1; min < max; min++) {
  28209. if (count[min] !== 0) { break; }
  28210. }
  28211. if (root < min) {
  28212. root = min;
  28213. }
  28214. /* check for an over-subscribed or incomplete set of lengths */
  28215. left = 1;
  28216. for (len = 1; len <= MAXBITS; len++) {
  28217. left <<= 1;
  28218. left -= count[len];
  28219. if (left < 0) {
  28220. return -1;
  28221. } /* over-subscribed */
  28222. }
  28223. if (left > 0 && (type === CODES || max !== 1)) {
  28224. return -1; /* incomplete set */
  28225. }
  28226. /* generate offsets into symbol table for each length for sorting */
  28227. offs[1] = 0;
  28228. for (len = 1; len < MAXBITS; len++) {
  28229. offs[len + 1] = offs[len] + count[len];
  28230. }
  28231. /* sort symbols by length, by symbol order within each length */
  28232. for (sym = 0; sym < codes; sym++) {
  28233. if (lens[lens_index + sym] !== 0) {
  28234. work[offs[lens[lens_index + sym]]++] = sym;
  28235. }
  28236. }
  28237. /*
  28238. Create and fill in decoding tables. In this loop, the table being
  28239. filled is at next and has curr index bits. The code being used is huff
  28240. with length len. That code is converted to an index by dropping drop
  28241. bits off of the bottom. For codes where len is less than drop + curr,
  28242. those top drop + curr - len bits are incremented through all values to
  28243. fill the table with replicated entries.
  28244. root is the number of index bits for the root table. When len exceeds
  28245. root, sub-tables are created pointed to by the root entry with an index
  28246. of the low root bits of huff. This is saved in low to check for when a
  28247. new sub-table should be started. drop is zero when the root table is
  28248. being filled, and drop is root when sub-tables are being filled.
  28249. When a new sub-table is needed, it is necessary to look ahead in the
  28250. code lengths to determine what size sub-table is needed. The length
  28251. counts are used for this, and so count[] is decremented as codes are
  28252. entered in the tables.
  28253. used keeps track of how many table entries have been allocated from the
  28254. provided *table space. It is checked for LENS and DIST tables against
  28255. the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in
  28256. the initial root table size constants. See the comments in inftrees.h
  28257. for more information.
  28258. sym increments through all symbols, and the loop terminates when
  28259. all codes of length max, i.e. all codes, have been processed. This
  28260. routine permits incomplete codes, so another loop after this one fills
  28261. in the rest of the decoding tables with invalid code markers.
  28262. */
  28263. /* set up for code type */
  28264. // poor man optimization - use if-else instead of switch,
  28265. // to avoid deopts in old v8
  28266. if (type === CODES) {
  28267. base = extra = work; /* dummy value--not used */
  28268. end = 19;
  28269. } else if (type === LENS) {
  28270. base = lbase;
  28271. base_index -= 257;
  28272. extra = lext;
  28273. extra_index -= 257;
  28274. end = 256;
  28275. } else { /* DISTS */
  28276. base = dbase;
  28277. extra = dext;
  28278. end = -1;
  28279. }
  28280. /* initialize opts for loop */
  28281. huff = 0; /* starting code */
  28282. sym = 0; /* starting code symbol */
  28283. len = min; /* starting code length */
  28284. next = table_index; /* current table to fill in */
  28285. curr = root; /* current table index bits */
  28286. drop = 0; /* current bits to drop from code for index */
  28287. low = -1; /* trigger new sub-table when len > root */
  28288. used = 1 << root; /* use root table entries */
  28289. mask = used - 1; /* mask for comparing low */
  28290. /* check available table space */
  28291. if ((type === LENS && used > ENOUGH_LENS) ||
  28292. (type === DISTS && used > ENOUGH_DISTS)) {
  28293. return 1;
  28294. }
  28295. /* process all codes and make table entries */
  28296. for (;;) {
  28297. /* create table entry */
  28298. here_bits = len - drop;
  28299. if (work[sym] < end) {
  28300. here_op = 0;
  28301. here_val = work[sym];
  28302. }
  28303. else if (work[sym] > end) {
  28304. here_op = extra[extra_index + work[sym]];
  28305. here_val = base[base_index + work[sym]];
  28306. }
  28307. else {
  28308. here_op = 32 + 64; /* end of block */
  28309. here_val = 0;
  28310. }
  28311. /* replicate for those indices with low len bits equal to huff */
  28312. incr = 1 << (len - drop);
  28313. fill = 1 << curr;
  28314. min = fill; /* save offset to next table */
  28315. do {
  28316. fill -= incr;
  28317. table[next + (huff >> drop) + fill] = (here_bits << 24) | (here_op << 16) | here_val |0;
  28318. } while (fill !== 0);
  28319. /* backwards increment the len-bit code huff */
  28320. incr = 1 << (len - 1);
  28321. while (huff & incr) {
  28322. incr >>= 1;
  28323. }
  28324. if (incr !== 0) {
  28325. huff &= incr - 1;
  28326. huff += incr;
  28327. } else {
  28328. huff = 0;
  28329. }
  28330. /* go to next symbol, update count, len */
  28331. sym++;
  28332. if (--count[len] === 0) {
  28333. if (len === max) { break; }
  28334. len = lens[lens_index + work[sym]];
  28335. }
  28336. /* create new sub-table if needed */
  28337. if (len > root && (huff & mask) !== low) {
  28338. /* if first time, transition to sub-tables */
  28339. if (drop === 0) {
  28340. drop = root;
  28341. }
  28342. /* increment past last table */
  28343. next += min; /* here min is 1 << curr */
  28344. /* determine length of next table */
  28345. curr = len - drop;
  28346. left = 1 << curr;
  28347. while (curr + drop < max) {
  28348. left -= count[curr + drop];
  28349. if (left <= 0) { break; }
  28350. curr++;
  28351. left <<= 1;
  28352. }
  28353. /* check for enough space */
  28354. used += 1 << curr;
  28355. if ((type === LENS && used > ENOUGH_LENS) ||
  28356. (type === DISTS && used > ENOUGH_DISTS)) {
  28357. return 1;
  28358. }
  28359. /* point entry in root table to sub-table */
  28360. low = huff & mask;
  28361. /*table.op[low] = curr;
  28362. table.bits[low] = root;
  28363. table.val[low] = next - opts.table_index;*/
  28364. table[low] = (root << 24) | (curr << 16) | (next - table_index) |0;
  28365. }
  28366. }
  28367. /* fill in remaining table entry if code is incomplete (guaranteed to have
  28368. at most one remaining entry, since if the code is incomplete, the
  28369. maximum code length that was allowed to get this far is one bit) */
  28370. if (huff !== 0) {
  28371. //table.op[next + huff] = 64; /* invalid code marker */
  28372. //table.bits[next + huff] = len - drop;
  28373. //table.val[next + huff] = 0;
  28374. table[next + huff] = ((len - drop) << 24) | (64 << 16) |0;
  28375. }
  28376. /* set return parameters */
  28377. //opts.table_index += used;
  28378. opts.bits = root;
  28379. return 0;
  28380. };
  28381. /***/ }),
  28382. /* 276 */
  28383. /***/ (function(module, exports, __webpack_require__) {
  28384. "use strict";
  28385. // (C) 1995-2013 Jean-loup Gailly and Mark Adler
  28386. // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
  28387. //
  28388. // This software is provided 'as-is', without any express or implied
  28389. // warranty. In no event will the authors be held liable for any damages
  28390. // arising from the use of this software.
  28391. //
  28392. // Permission is granted to anyone to use this software for any purpose,
  28393. // including commercial applications, and to alter it and redistribute it
  28394. // freely, subject to the following restrictions:
  28395. //
  28396. // 1. The origin of this software must not be misrepresented; you must not
  28397. // claim that you wrote the original software. If you use this software
  28398. // in a product, an acknowledgment in the product documentation would be
  28399. // appreciated but is not required.
  28400. // 2. Altered source versions must be plainly marked as such, and must not be
  28401. // misrepresented as being the original software.
  28402. // 3. This notice may not be removed or altered from any source distribution.
  28403. module.exports = {
  28404. /* Allowed flush values; see deflate() and inflate() below for details */
  28405. Z_NO_FLUSH: 0,
  28406. Z_PARTIAL_FLUSH: 1,
  28407. Z_SYNC_FLUSH: 2,
  28408. Z_FULL_FLUSH: 3,
  28409. Z_FINISH: 4,
  28410. Z_BLOCK: 5,
  28411. Z_TREES: 6,
  28412. /* Return codes for the compression/decompression functions. Negative values
  28413. * are errors, positive values are used for special but normal events.
  28414. */
  28415. Z_OK: 0,
  28416. Z_STREAM_END: 1,
  28417. Z_NEED_DICT: 2,
  28418. Z_ERRNO: -1,
  28419. Z_STREAM_ERROR: -2,
  28420. Z_DATA_ERROR: -3,
  28421. //Z_MEM_ERROR: -4,
  28422. Z_BUF_ERROR: -5,
  28423. //Z_VERSION_ERROR: -6,
  28424. /* compression levels */
  28425. Z_NO_COMPRESSION: 0,
  28426. Z_BEST_SPEED: 1,
  28427. Z_BEST_COMPRESSION: 9,
  28428. Z_DEFAULT_COMPRESSION: -1,
  28429. Z_FILTERED: 1,
  28430. Z_HUFFMAN_ONLY: 2,
  28431. Z_RLE: 3,
  28432. Z_FIXED: 4,
  28433. Z_DEFAULT_STRATEGY: 0,
  28434. /* Possible values of the data_type field (though see inflate()) */
  28435. Z_BINARY: 0,
  28436. Z_TEXT: 1,
  28437. //Z_ASCII: 1, // = Z_TEXT (deprecated)
  28438. Z_UNKNOWN: 2,
  28439. /* The deflate compression method */
  28440. Z_DEFLATED: 8
  28441. //Z_NULL: null // Use -1 or null inline, depending on var type
  28442. };
  28443. /***/ }),
  28444. /* 277 */
  28445. /***/ (function(module, exports, __webpack_require__) {
  28446. ;(function (root, factory, undef) {
  28447. if (true) {
  28448. // CommonJS
  28449. module.exports = exports = factory(__webpack_require__(1), __webpack_require__(72), __webpack_require__(278), __webpack_require__(279), __webpack_require__(47), __webpack_require__(48), __webpack_require__(105), __webpack_require__(174), __webpack_require__(280), __webpack_require__(175), __webpack_require__(281), __webpack_require__(282), __webpack_require__(283), __webpack_require__(106), __webpack_require__(284), __webpack_require__(33), __webpack_require__(6), __webpack_require__(285), __webpack_require__(286), __webpack_require__(287), __webpack_require__(288), __webpack_require__(289), __webpack_require__(290), __webpack_require__(291), __webpack_require__(292), __webpack_require__(293), __webpack_require__(294), __webpack_require__(295), __webpack_require__(296), __webpack_require__(297), __webpack_require__(298), __webpack_require__(299), __webpack_require__(300));
  28450. }
  28451. else {}
  28452. }(this, function (CryptoJS) {
  28453. return CryptoJS;
  28454. }));
  28455. /***/ }),
  28456. /* 278 */
  28457. /***/ (function(module, exports, __webpack_require__) {
  28458. ;(function (root, factory) {
  28459. if (true) {
  28460. // CommonJS
  28461. module.exports = exports = factory(__webpack_require__(1));
  28462. }
  28463. else {}
  28464. }(this, function (CryptoJS) {
  28465. (function () {
  28466. // Check if typed arrays are supported
  28467. if (typeof ArrayBuffer != 'function') {
  28468. return;
  28469. }
  28470. // Shortcuts
  28471. var C = CryptoJS;
  28472. var C_lib = C.lib;
  28473. var WordArray = C_lib.WordArray;
  28474. // Reference original init
  28475. var superInit = WordArray.init;
  28476. // Augment WordArray.init to handle typed arrays
  28477. var subInit = WordArray.init = function (typedArray) {
  28478. // Convert buffers to uint8
  28479. if (typedArray instanceof ArrayBuffer) {
  28480. typedArray = new Uint8Array(typedArray);
  28481. }
  28482. // Convert other array views to uint8
  28483. if (
  28484. typedArray instanceof Int8Array ||
  28485. (typeof Uint8ClampedArray !== "undefined" && typedArray instanceof Uint8ClampedArray) ||
  28486. typedArray instanceof Int16Array ||
  28487. typedArray instanceof Uint16Array ||
  28488. typedArray instanceof Int32Array ||
  28489. typedArray instanceof Uint32Array ||
  28490. typedArray instanceof Float32Array ||
  28491. typedArray instanceof Float64Array
  28492. ) {
  28493. typedArray = new Uint8Array(typedArray.buffer, typedArray.byteOffset, typedArray.byteLength);
  28494. }
  28495. // Handle Uint8Array
  28496. if (typedArray instanceof Uint8Array) {
  28497. // Shortcut
  28498. var typedArrayByteLength = typedArray.byteLength;
  28499. // Extract bytes
  28500. var words = [];
  28501. for (var i = 0; i < typedArrayByteLength; i++) {
  28502. words[i >>> 2] |= typedArray[i] << (24 - (i % 4) * 8);
  28503. }
  28504. // Initialize this word array
  28505. superInit.call(this, words, typedArrayByteLength);
  28506. } else {
  28507. // Else call normal init
  28508. superInit.apply(this, arguments);
  28509. }
  28510. };
  28511. subInit.prototype = WordArray;
  28512. }());
  28513. return CryptoJS.lib.WordArray;
  28514. }));
  28515. /***/ }),
  28516. /* 279 */
  28517. /***/ (function(module, exports, __webpack_require__) {
  28518. ;(function (root, factory) {
  28519. if (true) {
  28520. // CommonJS
  28521. module.exports = exports = factory(__webpack_require__(1));
  28522. }
  28523. else {}
  28524. }(this, function (CryptoJS) {
  28525. (function () {
  28526. // Shortcuts
  28527. var C = CryptoJS;
  28528. var C_lib = C.lib;
  28529. var WordArray = C_lib.WordArray;
  28530. var C_enc = C.enc;
  28531. /**
  28532. * UTF-16 BE encoding strategy.
  28533. */
  28534. var Utf16BE = C_enc.Utf16 = C_enc.Utf16BE = {
  28535. /**
  28536. * Converts a word array to a UTF-16 BE string.
  28537. *
  28538. * @param {WordArray} wordArray The word array.
  28539. *
  28540. * @return {string} The UTF-16 BE string.
  28541. *
  28542. * @static
  28543. *
  28544. * @example
  28545. *
  28546. * var utf16String = CryptoJS.enc.Utf16.stringify(wordArray);
  28547. */
  28548. stringify: function (wordArray) {
  28549. // Shortcuts
  28550. var words = wordArray.words;
  28551. var sigBytes = wordArray.sigBytes;
  28552. // Convert
  28553. var utf16Chars = [];
  28554. for (var i = 0; i < sigBytes; i += 2) {
  28555. var codePoint = (words[i >>> 2] >>> (16 - (i % 4) * 8)) & 0xffff;
  28556. utf16Chars.push(String.fromCharCode(codePoint));
  28557. }
  28558. return utf16Chars.join('');
  28559. },
  28560. /**
  28561. * Converts a UTF-16 BE string to a word array.
  28562. *
  28563. * @param {string} utf16Str The UTF-16 BE string.
  28564. *
  28565. * @return {WordArray} The word array.
  28566. *
  28567. * @static
  28568. *
  28569. * @example
  28570. *
  28571. * var wordArray = CryptoJS.enc.Utf16.parse(utf16String);
  28572. */
  28573. parse: function (utf16Str) {
  28574. // Shortcut
  28575. var utf16StrLength = utf16Str.length;
  28576. // Convert
  28577. var words = [];
  28578. for (var i = 0; i < utf16StrLength; i++) {
  28579. words[i >>> 1] |= utf16Str.charCodeAt(i) << (16 - (i % 2) * 16);
  28580. }
  28581. return WordArray.create(words, utf16StrLength * 2);
  28582. }
  28583. };
  28584. /**
  28585. * UTF-16 LE encoding strategy.
  28586. */
  28587. C_enc.Utf16LE = {
  28588. /**
  28589. * Converts a word array to a UTF-16 LE string.
  28590. *
  28591. * @param {WordArray} wordArray The word array.
  28592. *
  28593. * @return {string} The UTF-16 LE string.
  28594. *
  28595. * @static
  28596. *
  28597. * @example
  28598. *
  28599. * var utf16Str = CryptoJS.enc.Utf16LE.stringify(wordArray);
  28600. */
  28601. stringify: function (wordArray) {
  28602. // Shortcuts
  28603. var words = wordArray.words;
  28604. var sigBytes = wordArray.sigBytes;
  28605. // Convert
  28606. var utf16Chars = [];
  28607. for (var i = 0; i < sigBytes; i += 2) {
  28608. var codePoint = swapEndian((words[i >>> 2] >>> (16 - (i % 4) * 8)) & 0xffff);
  28609. utf16Chars.push(String.fromCharCode(codePoint));
  28610. }
  28611. return utf16Chars.join('');
  28612. },
  28613. /**
  28614. * Converts a UTF-16 LE string to a word array.
  28615. *
  28616. * @param {string} utf16Str The UTF-16 LE string.
  28617. *
  28618. * @return {WordArray} The word array.
  28619. *
  28620. * @static
  28621. *
  28622. * @example
  28623. *
  28624. * var wordArray = CryptoJS.enc.Utf16LE.parse(utf16Str);
  28625. */
  28626. parse: function (utf16Str) {
  28627. // Shortcut
  28628. var utf16StrLength = utf16Str.length;
  28629. // Convert
  28630. var words = [];
  28631. for (var i = 0; i < utf16StrLength; i++) {
  28632. words[i >>> 1] |= swapEndian(utf16Str.charCodeAt(i) << (16 - (i % 2) * 16));
  28633. }
  28634. return WordArray.create(words, utf16StrLength * 2);
  28635. }
  28636. };
  28637. function swapEndian(word) {
  28638. return ((word << 8) & 0xff00ff00) | ((word >>> 8) & 0x00ff00ff);
  28639. }
  28640. }());
  28641. return CryptoJS.enc.Utf16;
  28642. }));
  28643. /***/ }),
  28644. /* 280 */
  28645. /***/ (function(module, exports, __webpack_require__) {
  28646. ;(function (root, factory, undef) {
  28647. if (true) {
  28648. // CommonJS
  28649. module.exports = exports = factory(__webpack_require__(1), __webpack_require__(174));
  28650. }
  28651. else {}
  28652. }(this, function (CryptoJS) {
  28653. (function () {
  28654. // Shortcuts
  28655. var C = CryptoJS;
  28656. var C_lib = C.lib;
  28657. var WordArray = C_lib.WordArray;
  28658. var C_algo = C.algo;
  28659. var SHA256 = C_algo.SHA256;
  28660. /**
  28661. * SHA-224 hash algorithm.
  28662. */
  28663. var SHA224 = C_algo.SHA224 = SHA256.extend({
  28664. _doReset: function () {
  28665. this._hash = new WordArray.init([
  28666. 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939,
  28667. 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4
  28668. ]);
  28669. },
  28670. _doFinalize: function () {
  28671. var hash = SHA256._doFinalize.call(this);
  28672. hash.sigBytes -= 4;
  28673. return hash;
  28674. }
  28675. });
  28676. /**
  28677. * Shortcut function to the hasher's object interface.
  28678. *
  28679. * @param {WordArray|string} message The message to hash.
  28680. *
  28681. * @return {WordArray} The hash.
  28682. *
  28683. * @static
  28684. *
  28685. * @example
  28686. *
  28687. * var hash = CryptoJS.SHA224('message');
  28688. * var hash = CryptoJS.SHA224(wordArray);
  28689. */
  28690. C.SHA224 = SHA256._createHelper(SHA224);
  28691. /**
  28692. * Shortcut function to the HMAC's object interface.
  28693. *
  28694. * @param {WordArray|string} message The message to hash.
  28695. * @param {WordArray|string} key The secret key.
  28696. *
  28697. * @return {WordArray} The HMAC.
  28698. *
  28699. * @static
  28700. *
  28701. * @example
  28702. *
  28703. * var hmac = CryptoJS.HmacSHA224(message, key);
  28704. */
  28705. C.HmacSHA224 = SHA256._createHmacHelper(SHA224);
  28706. }());
  28707. return CryptoJS.SHA224;
  28708. }));
  28709. /***/ }),
  28710. /* 281 */
  28711. /***/ (function(module, exports, __webpack_require__) {
  28712. ;(function (root, factory, undef) {
  28713. if (true) {
  28714. // CommonJS
  28715. module.exports = exports = factory(__webpack_require__(1), __webpack_require__(72), __webpack_require__(175));
  28716. }
  28717. else {}
  28718. }(this, function (CryptoJS) {
  28719. (function () {
  28720. // Shortcuts
  28721. var C = CryptoJS;
  28722. var C_x64 = C.x64;
  28723. var X64Word = C_x64.Word;
  28724. var X64WordArray = C_x64.WordArray;
  28725. var C_algo = C.algo;
  28726. var SHA512 = C_algo.SHA512;
  28727. /**
  28728. * SHA-384 hash algorithm.
  28729. */
  28730. var SHA384 = C_algo.SHA384 = SHA512.extend({
  28731. _doReset: function () {
  28732. this._hash = new X64WordArray.init([
  28733. new X64Word.init(0xcbbb9d5d, 0xc1059ed8), new X64Word.init(0x629a292a, 0x367cd507),
  28734. new X64Word.init(0x9159015a, 0x3070dd17), new X64Word.init(0x152fecd8, 0xf70e5939),
  28735. new X64Word.init(0x67332667, 0xffc00b31), new X64Word.init(0x8eb44a87, 0x68581511),
  28736. new X64Word.init(0xdb0c2e0d, 0x64f98fa7), new X64Word.init(0x47b5481d, 0xbefa4fa4)
  28737. ]);
  28738. },
  28739. _doFinalize: function () {
  28740. var hash = SHA512._doFinalize.call(this);
  28741. hash.sigBytes -= 16;
  28742. return hash;
  28743. }
  28744. });
  28745. /**
  28746. * Shortcut function to the hasher's object interface.
  28747. *
  28748. * @param {WordArray|string} message The message to hash.
  28749. *
  28750. * @return {WordArray} The hash.
  28751. *
  28752. * @static
  28753. *
  28754. * @example
  28755. *
  28756. * var hash = CryptoJS.SHA384('message');
  28757. * var hash = CryptoJS.SHA384(wordArray);
  28758. */
  28759. C.SHA384 = SHA512._createHelper(SHA384);
  28760. /**
  28761. * Shortcut function to the HMAC's object interface.
  28762. *
  28763. * @param {WordArray|string} message The message to hash.
  28764. * @param {WordArray|string} key The secret key.
  28765. *
  28766. * @return {WordArray} The HMAC.
  28767. *
  28768. * @static
  28769. *
  28770. * @example
  28771. *
  28772. * var hmac = CryptoJS.HmacSHA384(message, key);
  28773. */
  28774. C.HmacSHA384 = SHA512._createHmacHelper(SHA384);
  28775. }());
  28776. return CryptoJS.SHA384;
  28777. }));
  28778. /***/ }),
  28779. /* 282 */
  28780. /***/ (function(module, exports, __webpack_require__) {
  28781. ;(function (root, factory, undef) {
  28782. if (true) {
  28783. // CommonJS
  28784. module.exports = exports = factory(__webpack_require__(1), __webpack_require__(72));
  28785. }
  28786. else {}
  28787. }(this, function (CryptoJS) {
  28788. (function (Math) {
  28789. // Shortcuts
  28790. var C = CryptoJS;
  28791. var C_lib = C.lib;
  28792. var WordArray = C_lib.WordArray;
  28793. var Hasher = C_lib.Hasher;
  28794. var C_x64 = C.x64;
  28795. var X64Word = C_x64.Word;
  28796. var C_algo = C.algo;
  28797. // Constants tables
  28798. var RHO_OFFSETS = [];
  28799. var PI_INDEXES = [];
  28800. var ROUND_CONSTANTS = [];
  28801. // Compute Constants
  28802. (function () {
  28803. // Compute rho offset constants
  28804. var x = 1, y = 0;
  28805. for (var t = 0; t < 24; t++) {
  28806. RHO_OFFSETS[x + 5 * y] = ((t + 1) * (t + 2) / 2) % 64;
  28807. var newX = y % 5;
  28808. var newY = (2 * x + 3 * y) % 5;
  28809. x = newX;
  28810. y = newY;
  28811. }
  28812. // Compute pi index constants
  28813. for (var x = 0; x < 5; x++) {
  28814. for (var y = 0; y < 5; y++) {
  28815. PI_INDEXES[x + 5 * y] = y + ((2 * x + 3 * y) % 5) * 5;
  28816. }
  28817. }
  28818. // Compute round constants
  28819. var LFSR = 0x01;
  28820. for (var i = 0; i < 24; i++) {
  28821. var roundConstantMsw = 0;
  28822. var roundConstantLsw = 0;
  28823. for (var j = 0; j < 7; j++) {
  28824. if (LFSR & 0x01) {
  28825. var bitPosition = (1 << j) - 1;
  28826. if (bitPosition < 32) {
  28827. roundConstantLsw ^= 1 << bitPosition;
  28828. } else /* if (bitPosition >= 32) */ {
  28829. roundConstantMsw ^= 1 << (bitPosition - 32);
  28830. }
  28831. }
  28832. // Compute next LFSR
  28833. if (LFSR & 0x80) {
  28834. // Primitive polynomial over GF(2): x^8 + x^6 + x^5 + x^4 + 1
  28835. LFSR = (LFSR << 1) ^ 0x71;
  28836. } else {
  28837. LFSR <<= 1;
  28838. }
  28839. }
  28840. ROUND_CONSTANTS[i] = X64Word.create(roundConstantMsw, roundConstantLsw);
  28841. }
  28842. }());
  28843. // Reusable objects for temporary values
  28844. var T = [];
  28845. (function () {
  28846. for (var i = 0; i < 25; i++) {
  28847. T[i] = X64Word.create();
  28848. }
  28849. }());
  28850. /**
  28851. * SHA-3 hash algorithm.
  28852. */
  28853. var SHA3 = C_algo.SHA3 = Hasher.extend({
  28854. /**
  28855. * Configuration options.
  28856. *
  28857. * @property {number} outputLength
  28858. * The desired number of bits in the output hash.
  28859. * Only values permitted are: 224, 256, 384, 512.
  28860. * Default: 512
  28861. */
  28862. cfg: Hasher.cfg.extend({
  28863. outputLength: 512
  28864. }),
  28865. _doReset: function () {
  28866. var state = this._state = []
  28867. for (var i = 0; i < 25; i++) {
  28868. state[i] = new X64Word.init();
  28869. }
  28870. this.blockSize = (1600 - 2 * this.cfg.outputLength) / 32;
  28871. },
  28872. _doProcessBlock: function (M, offset) {
  28873. // Shortcuts
  28874. var state = this._state;
  28875. var nBlockSizeLanes = this.blockSize / 2;
  28876. // Absorb
  28877. for (var i = 0; i < nBlockSizeLanes; i++) {
  28878. // Shortcuts
  28879. var M2i = M[offset + 2 * i];
  28880. var M2i1 = M[offset + 2 * i + 1];
  28881. // Swap endian
  28882. M2i = (
  28883. (((M2i << 8) | (M2i >>> 24)) & 0x00ff00ff) |
  28884. (((M2i << 24) | (M2i >>> 8)) & 0xff00ff00)
  28885. );
  28886. M2i1 = (
  28887. (((M2i1 << 8) | (M2i1 >>> 24)) & 0x00ff00ff) |
  28888. (((M2i1 << 24) | (M2i1 >>> 8)) & 0xff00ff00)
  28889. );
  28890. // Absorb message into state
  28891. var lane = state[i];
  28892. lane.high ^= M2i1;
  28893. lane.low ^= M2i;
  28894. }
  28895. // Rounds
  28896. for (var round = 0; round < 24; round++) {
  28897. // Theta
  28898. for (var x = 0; x < 5; x++) {
  28899. // Mix column lanes
  28900. var tMsw = 0, tLsw = 0;
  28901. for (var y = 0; y < 5; y++) {
  28902. var lane = state[x + 5 * y];
  28903. tMsw ^= lane.high;
  28904. tLsw ^= lane.low;
  28905. }
  28906. // Temporary values
  28907. var Tx = T[x];
  28908. Tx.high = tMsw;
  28909. Tx.low = tLsw;
  28910. }
  28911. for (var x = 0; x < 5; x++) {
  28912. // Shortcuts
  28913. var Tx4 = T[(x + 4) % 5];
  28914. var Tx1 = T[(x + 1) % 5];
  28915. var Tx1Msw = Tx1.high;
  28916. var Tx1Lsw = Tx1.low;
  28917. // Mix surrounding columns
  28918. var tMsw = Tx4.high ^ ((Tx1Msw << 1) | (Tx1Lsw >>> 31));
  28919. var tLsw = Tx4.low ^ ((Tx1Lsw << 1) | (Tx1Msw >>> 31));
  28920. for (var y = 0; y < 5; y++) {
  28921. var lane = state[x + 5 * y];
  28922. lane.high ^= tMsw;
  28923. lane.low ^= tLsw;
  28924. }
  28925. }
  28926. // Rho Pi
  28927. for (var laneIndex = 1; laneIndex < 25; laneIndex++) {
  28928. // Shortcuts
  28929. var lane = state[laneIndex];
  28930. var laneMsw = lane.high;
  28931. var laneLsw = lane.low;
  28932. var rhoOffset = RHO_OFFSETS[laneIndex];
  28933. // Rotate lanes
  28934. if (rhoOffset < 32) {
  28935. var tMsw = (laneMsw << rhoOffset) | (laneLsw >>> (32 - rhoOffset));
  28936. var tLsw = (laneLsw << rhoOffset) | (laneMsw >>> (32 - rhoOffset));
  28937. } else /* if (rhoOffset >= 32) */ {
  28938. var tMsw = (laneLsw << (rhoOffset - 32)) | (laneMsw >>> (64 - rhoOffset));
  28939. var tLsw = (laneMsw << (rhoOffset - 32)) | (laneLsw >>> (64 - rhoOffset));
  28940. }
  28941. // Transpose lanes
  28942. var TPiLane = T[PI_INDEXES[laneIndex]];
  28943. TPiLane.high = tMsw;
  28944. TPiLane.low = tLsw;
  28945. }
  28946. // Rho pi at x = y = 0
  28947. var T0 = T[0];
  28948. var state0 = state[0];
  28949. T0.high = state0.high;
  28950. T0.low = state0.low;
  28951. // Chi
  28952. for (var x = 0; x < 5; x++) {
  28953. for (var y = 0; y < 5; y++) {
  28954. // Shortcuts
  28955. var laneIndex = x + 5 * y;
  28956. var lane = state[laneIndex];
  28957. var TLane = T[laneIndex];
  28958. var Tx1Lane = T[((x + 1) % 5) + 5 * y];
  28959. var Tx2Lane = T[((x + 2) % 5) + 5 * y];
  28960. // Mix rows
  28961. lane.high = TLane.high ^ (~Tx1Lane.high & Tx2Lane.high);
  28962. lane.low = TLane.low ^ (~Tx1Lane.low & Tx2Lane.low);
  28963. }
  28964. }
  28965. // Iota
  28966. var lane = state[0];
  28967. var roundConstant = ROUND_CONSTANTS[round];
  28968. lane.high ^= roundConstant.high;
  28969. lane.low ^= roundConstant.low;;
  28970. }
  28971. },
  28972. _doFinalize: function () {
  28973. // Shortcuts
  28974. var data = this._data;
  28975. var dataWords = data.words;
  28976. var nBitsTotal = this._nDataBytes * 8;
  28977. var nBitsLeft = data.sigBytes * 8;
  28978. var blockSizeBits = this.blockSize * 32;
  28979. // Add padding
  28980. dataWords[nBitsLeft >>> 5] |= 0x1 << (24 - nBitsLeft % 32);
  28981. dataWords[((Math.ceil((nBitsLeft + 1) / blockSizeBits) * blockSizeBits) >>> 5) - 1] |= 0x80;
  28982. data.sigBytes = dataWords.length * 4;
  28983. // Hash final blocks
  28984. this._process();
  28985. // Shortcuts
  28986. var state = this._state;
  28987. var outputLengthBytes = this.cfg.outputLength / 8;
  28988. var outputLengthLanes = outputLengthBytes / 8;
  28989. // Squeeze
  28990. var hashWords = [];
  28991. for (var i = 0; i < outputLengthLanes; i++) {
  28992. // Shortcuts
  28993. var lane = state[i];
  28994. var laneMsw = lane.high;
  28995. var laneLsw = lane.low;
  28996. // Swap endian
  28997. laneMsw = (
  28998. (((laneMsw << 8) | (laneMsw >>> 24)) & 0x00ff00ff) |
  28999. (((laneMsw << 24) | (laneMsw >>> 8)) & 0xff00ff00)
  29000. );
  29001. laneLsw = (
  29002. (((laneLsw << 8) | (laneLsw >>> 24)) & 0x00ff00ff) |
  29003. (((laneLsw << 24) | (laneLsw >>> 8)) & 0xff00ff00)
  29004. );
  29005. // Squeeze state to retrieve hash
  29006. hashWords.push(laneLsw);
  29007. hashWords.push(laneMsw);
  29008. }
  29009. // Return final computed hash
  29010. return new WordArray.init(hashWords, outputLengthBytes);
  29011. },
  29012. clone: function () {
  29013. var clone = Hasher.clone.call(this);
  29014. var state = clone._state = this._state.slice(0);
  29015. for (var i = 0; i < 25; i++) {
  29016. state[i] = state[i].clone();
  29017. }
  29018. return clone;
  29019. }
  29020. });
  29021. /**
  29022. * Shortcut function to the hasher's object interface.
  29023. *
  29024. * @param {WordArray|string} message The message to hash.
  29025. *
  29026. * @return {WordArray} The hash.
  29027. *
  29028. * @static
  29029. *
  29030. * @example
  29031. *
  29032. * var hash = CryptoJS.SHA3('message');
  29033. * var hash = CryptoJS.SHA3(wordArray);
  29034. */
  29035. C.SHA3 = Hasher._createHelper(SHA3);
  29036. /**
  29037. * Shortcut function to the HMAC's object interface.
  29038. *
  29039. * @param {WordArray|string} message The message to hash.
  29040. * @param {WordArray|string} key The secret key.
  29041. *
  29042. * @return {WordArray} The HMAC.
  29043. *
  29044. * @static
  29045. *
  29046. * @example
  29047. *
  29048. * var hmac = CryptoJS.HmacSHA3(message, key);
  29049. */
  29050. C.HmacSHA3 = Hasher._createHmacHelper(SHA3);
  29051. }(Math));
  29052. return CryptoJS.SHA3;
  29053. }));
  29054. /***/ }),
  29055. /* 283 */
  29056. /***/ (function(module, exports, __webpack_require__) {
  29057. ;(function (root, factory) {
  29058. if (true) {
  29059. // CommonJS
  29060. module.exports = exports = factory(__webpack_require__(1));
  29061. }
  29062. else {}
  29063. }(this, function (CryptoJS) {
  29064. /** @preserve
  29065. (c) 2012 by Cédric Mesnil. All rights reserved.
  29066. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
  29067. - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  29068. - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  29069. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  29070. */
  29071. (function (Math) {
  29072. // Shortcuts
  29073. var C = CryptoJS;
  29074. var C_lib = C.lib;
  29075. var WordArray = C_lib.WordArray;
  29076. var Hasher = C_lib.Hasher;
  29077. var C_algo = C.algo;
  29078. // Constants table
  29079. var _zl = WordArray.create([
  29080. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  29081. 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8,
  29082. 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12,
  29083. 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2,
  29084. 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13]);
  29085. var _zr = WordArray.create([
  29086. 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12,
  29087. 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2,
  29088. 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13,
  29089. 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14,
  29090. 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11]);
  29091. var _sl = WordArray.create([
  29092. 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8,
  29093. 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12,
  29094. 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5,
  29095. 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12,
  29096. 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6 ]);
  29097. var _sr = WordArray.create([
  29098. 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6,
  29099. 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11,
  29100. 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5,
  29101. 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8,
  29102. 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11 ]);
  29103. var _hl = WordArray.create([ 0x00000000, 0x5A827999, 0x6ED9EBA1, 0x8F1BBCDC, 0xA953FD4E]);
  29104. var _hr = WordArray.create([ 0x50A28BE6, 0x5C4DD124, 0x6D703EF3, 0x7A6D76E9, 0x00000000]);
  29105. /**
  29106. * RIPEMD160 hash algorithm.
  29107. */
  29108. var RIPEMD160 = C_algo.RIPEMD160 = Hasher.extend({
  29109. _doReset: function () {
  29110. this._hash = WordArray.create([0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0]);
  29111. },
  29112. _doProcessBlock: function (M, offset) {
  29113. // Swap endian
  29114. for (var i = 0; i < 16; i++) {
  29115. // Shortcuts
  29116. var offset_i = offset + i;
  29117. var M_offset_i = M[offset_i];
  29118. // Swap
  29119. M[offset_i] = (
  29120. (((M_offset_i << 8) | (M_offset_i >>> 24)) & 0x00ff00ff) |
  29121. (((M_offset_i << 24) | (M_offset_i >>> 8)) & 0xff00ff00)
  29122. );
  29123. }
  29124. // Shortcut
  29125. var H = this._hash.words;
  29126. var hl = _hl.words;
  29127. var hr = _hr.words;
  29128. var zl = _zl.words;
  29129. var zr = _zr.words;
  29130. var sl = _sl.words;
  29131. var sr = _sr.words;
  29132. // Working variables
  29133. var al, bl, cl, dl, el;
  29134. var ar, br, cr, dr, er;
  29135. ar = al = H[0];
  29136. br = bl = H[1];
  29137. cr = cl = H[2];
  29138. dr = dl = H[3];
  29139. er = el = H[4];
  29140. // Computation
  29141. var t;
  29142. for (var i = 0; i < 80; i += 1) {
  29143. t = (al + M[offset+zl[i]])|0;
  29144. if (i<16){
  29145. t += f1(bl,cl,dl) + hl[0];
  29146. } else if (i<32) {
  29147. t += f2(bl,cl,dl) + hl[1];
  29148. } else if (i<48) {
  29149. t += f3(bl,cl,dl) + hl[2];
  29150. } else if (i<64) {
  29151. t += f4(bl,cl,dl) + hl[3];
  29152. } else {// if (i<80) {
  29153. t += f5(bl,cl,dl) + hl[4];
  29154. }
  29155. t = t|0;
  29156. t = rotl(t,sl[i]);
  29157. t = (t+el)|0;
  29158. al = el;
  29159. el = dl;
  29160. dl = rotl(cl, 10);
  29161. cl = bl;
  29162. bl = t;
  29163. t = (ar + M[offset+zr[i]])|0;
  29164. if (i<16){
  29165. t += f5(br,cr,dr) + hr[0];
  29166. } else if (i<32) {
  29167. t += f4(br,cr,dr) + hr[1];
  29168. } else if (i<48) {
  29169. t += f3(br,cr,dr) + hr[2];
  29170. } else if (i<64) {
  29171. t += f2(br,cr,dr) + hr[3];
  29172. } else {// if (i<80) {
  29173. t += f1(br,cr,dr) + hr[4];
  29174. }
  29175. t = t|0;
  29176. t = rotl(t,sr[i]) ;
  29177. t = (t+er)|0;
  29178. ar = er;
  29179. er = dr;
  29180. dr = rotl(cr, 10);
  29181. cr = br;
  29182. br = t;
  29183. }
  29184. // Intermediate hash value
  29185. t = (H[1] + cl + dr)|0;
  29186. H[1] = (H[2] + dl + er)|0;
  29187. H[2] = (H[3] + el + ar)|0;
  29188. H[3] = (H[4] + al + br)|0;
  29189. H[4] = (H[0] + bl + cr)|0;
  29190. H[0] = t;
  29191. },
  29192. _doFinalize: function () {
  29193. // Shortcuts
  29194. var data = this._data;
  29195. var dataWords = data.words;
  29196. var nBitsTotal = this._nDataBytes * 8;
  29197. var nBitsLeft = data.sigBytes * 8;
  29198. // Add padding
  29199. dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);
  29200. dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = (
  29201. (((nBitsTotal << 8) | (nBitsTotal >>> 24)) & 0x00ff00ff) |
  29202. (((nBitsTotal << 24) | (nBitsTotal >>> 8)) & 0xff00ff00)
  29203. );
  29204. data.sigBytes = (dataWords.length + 1) * 4;
  29205. // Hash final blocks
  29206. this._process();
  29207. // Shortcuts
  29208. var hash = this._hash;
  29209. var H = hash.words;
  29210. // Swap endian
  29211. for (var i = 0; i < 5; i++) {
  29212. // Shortcut
  29213. var H_i = H[i];
  29214. // Swap
  29215. H[i] = (((H_i << 8) | (H_i >>> 24)) & 0x00ff00ff) |
  29216. (((H_i << 24) | (H_i >>> 8)) & 0xff00ff00);
  29217. }
  29218. // Return final computed hash
  29219. return hash;
  29220. },
  29221. clone: function () {
  29222. var clone = Hasher.clone.call(this);
  29223. clone._hash = this._hash.clone();
  29224. return clone;
  29225. }
  29226. });
  29227. function f1(x, y, z) {
  29228. return ((x) ^ (y) ^ (z));
  29229. }
  29230. function f2(x, y, z) {
  29231. return (((x)&(y)) | ((~x)&(z)));
  29232. }
  29233. function f3(x, y, z) {
  29234. return (((x) | (~(y))) ^ (z));
  29235. }
  29236. function f4(x, y, z) {
  29237. return (((x) & (z)) | ((y)&(~(z))));
  29238. }
  29239. function f5(x, y, z) {
  29240. return ((x) ^ ((y) |(~(z))));
  29241. }
  29242. function rotl(x,n) {
  29243. return (x<<n) | (x>>>(32-n));
  29244. }
  29245. /**
  29246. * Shortcut function to the hasher's object interface.
  29247. *
  29248. * @param {WordArray|string} message The message to hash.
  29249. *
  29250. * @return {WordArray} The hash.
  29251. *
  29252. * @static
  29253. *
  29254. * @example
  29255. *
  29256. * var hash = CryptoJS.RIPEMD160('message');
  29257. * var hash = CryptoJS.RIPEMD160(wordArray);
  29258. */
  29259. C.RIPEMD160 = Hasher._createHelper(RIPEMD160);
  29260. /**
  29261. * Shortcut function to the HMAC's object interface.
  29262. *
  29263. * @param {WordArray|string} message The message to hash.
  29264. * @param {WordArray|string} key The secret key.
  29265. *
  29266. * @return {WordArray} The HMAC.
  29267. *
  29268. * @static
  29269. *
  29270. * @example
  29271. *
  29272. * var hmac = CryptoJS.HmacRIPEMD160(message, key);
  29273. */
  29274. C.HmacRIPEMD160 = Hasher._createHmacHelper(RIPEMD160);
  29275. }(Math));
  29276. return CryptoJS.RIPEMD160;
  29277. }));
  29278. /***/ }),
  29279. /* 284 */
  29280. /***/ (function(module, exports, __webpack_require__) {
  29281. ;(function (root, factory, undef) {
  29282. if (true) {
  29283. // CommonJS
  29284. module.exports = exports = factory(__webpack_require__(1), __webpack_require__(105), __webpack_require__(106));
  29285. }
  29286. else {}
  29287. }(this, function (CryptoJS) {
  29288. (function () {
  29289. // Shortcuts
  29290. var C = CryptoJS;
  29291. var C_lib = C.lib;
  29292. var Base = C_lib.Base;
  29293. var WordArray = C_lib.WordArray;
  29294. var C_algo = C.algo;
  29295. var SHA1 = C_algo.SHA1;
  29296. var HMAC = C_algo.HMAC;
  29297. /**
  29298. * Password-Based Key Derivation Function 2 algorithm.
  29299. */
  29300. var PBKDF2 = C_algo.PBKDF2 = Base.extend({
  29301. /**
  29302. * Configuration options.
  29303. *
  29304. * @property {number} keySize The key size in words to generate. Default: 4 (128 bits)
  29305. * @property {Hasher} hasher The hasher to use. Default: SHA1
  29306. * @property {number} iterations The number of iterations to perform. Default: 1
  29307. */
  29308. cfg: Base.extend({
  29309. keySize: 128/32,
  29310. hasher: SHA1,
  29311. iterations: 1
  29312. }),
  29313. /**
  29314. * Initializes a newly created key derivation function.
  29315. *
  29316. * @param {Object} cfg (Optional) The configuration options to use for the derivation.
  29317. *
  29318. * @example
  29319. *
  29320. * var kdf = CryptoJS.algo.PBKDF2.create();
  29321. * var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8 });
  29322. * var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8, iterations: 1000 });
  29323. */
  29324. init: function (cfg) {
  29325. this.cfg = this.cfg.extend(cfg);
  29326. },
  29327. /**
  29328. * Computes the Password-Based Key Derivation Function 2.
  29329. *
  29330. * @param {WordArray|string} password The password.
  29331. * @param {WordArray|string} salt A salt.
  29332. *
  29333. * @return {WordArray} The derived key.
  29334. *
  29335. * @example
  29336. *
  29337. * var key = kdf.compute(password, salt);
  29338. */
  29339. compute: function (password, salt) {
  29340. // Shortcut
  29341. var cfg = this.cfg;
  29342. // Init HMAC
  29343. var hmac = HMAC.create(cfg.hasher, password);
  29344. // Initial values
  29345. var derivedKey = WordArray.create();
  29346. var blockIndex = WordArray.create([0x00000001]);
  29347. // Shortcuts
  29348. var derivedKeyWords = derivedKey.words;
  29349. var blockIndexWords = blockIndex.words;
  29350. var keySize = cfg.keySize;
  29351. var iterations = cfg.iterations;
  29352. // Generate key
  29353. while (derivedKeyWords.length < keySize) {
  29354. var block = hmac.update(salt).finalize(blockIndex);
  29355. hmac.reset();
  29356. // Shortcuts
  29357. var blockWords = block.words;
  29358. var blockWordsLength = blockWords.length;
  29359. // Iterations
  29360. var intermediate = block;
  29361. for (var i = 1; i < iterations; i++) {
  29362. intermediate = hmac.finalize(intermediate);
  29363. hmac.reset();
  29364. // Shortcut
  29365. var intermediateWords = intermediate.words;
  29366. // XOR intermediate with block
  29367. for (var j = 0; j < blockWordsLength; j++) {
  29368. blockWords[j] ^= intermediateWords[j];
  29369. }
  29370. }
  29371. derivedKey.concat(block);
  29372. blockIndexWords[0]++;
  29373. }
  29374. derivedKey.sigBytes = keySize * 4;
  29375. return derivedKey;
  29376. }
  29377. });
  29378. /**
  29379. * Computes the Password-Based Key Derivation Function 2.
  29380. *
  29381. * @param {WordArray|string} password The password.
  29382. * @param {WordArray|string} salt A salt.
  29383. * @param {Object} cfg (Optional) The configuration options to use for this computation.
  29384. *
  29385. * @return {WordArray} The derived key.
  29386. *
  29387. * @static
  29388. *
  29389. * @example
  29390. *
  29391. * var key = CryptoJS.PBKDF2(password, salt);
  29392. * var key = CryptoJS.PBKDF2(password, salt, { keySize: 8 });
  29393. * var key = CryptoJS.PBKDF2(password, salt, { keySize: 8, iterations: 1000 });
  29394. */
  29395. C.PBKDF2 = function (password, salt, cfg) {
  29396. return PBKDF2.create(cfg).compute(password, salt);
  29397. };
  29398. }());
  29399. return CryptoJS.PBKDF2;
  29400. }));
  29401. /***/ }),
  29402. /* 285 */
  29403. /***/ (function(module, exports, __webpack_require__) {
  29404. ;(function (root, factory, undef) {
  29405. if (true) {
  29406. // CommonJS
  29407. module.exports = exports = factory(__webpack_require__(1), __webpack_require__(6));
  29408. }
  29409. else {}
  29410. }(this, function (CryptoJS) {
  29411. /**
  29412. * Cipher Feedback block mode.
  29413. */
  29414. CryptoJS.mode.CFB = (function () {
  29415. var CFB = CryptoJS.lib.BlockCipherMode.extend();
  29416. CFB.Encryptor = CFB.extend({
  29417. processBlock: function (words, offset) {
  29418. // Shortcuts
  29419. var cipher = this._cipher;
  29420. var blockSize = cipher.blockSize;
  29421. generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher);
  29422. // Remember this block to use with next block
  29423. this._prevBlock = words.slice(offset, offset + blockSize);
  29424. }
  29425. });
  29426. CFB.Decryptor = CFB.extend({
  29427. processBlock: function (words, offset) {
  29428. // Shortcuts
  29429. var cipher = this._cipher;
  29430. var blockSize = cipher.blockSize;
  29431. // Remember this block to use with next block
  29432. var thisBlock = words.slice(offset, offset + blockSize);
  29433. generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher);
  29434. // This block becomes the previous block
  29435. this._prevBlock = thisBlock;
  29436. }
  29437. });
  29438. function generateKeystreamAndEncrypt(words, offset, blockSize, cipher) {
  29439. // Shortcut
  29440. var iv = this._iv;
  29441. // Generate keystream
  29442. if (iv) {
  29443. var keystream = iv.slice(0);
  29444. // Remove IV for subsequent blocks
  29445. this._iv = undefined;
  29446. } else {
  29447. var keystream = this._prevBlock;
  29448. }
  29449. cipher.encryptBlock(keystream, 0);
  29450. // Encrypt
  29451. for (var i = 0; i < blockSize; i++) {
  29452. words[offset + i] ^= keystream[i];
  29453. }
  29454. }
  29455. return CFB;
  29456. }());
  29457. return CryptoJS.mode.CFB;
  29458. }));
  29459. /***/ }),
  29460. /* 286 */
  29461. /***/ (function(module, exports, __webpack_require__) {
  29462. ;(function (root, factory, undef) {
  29463. if (true) {
  29464. // CommonJS
  29465. module.exports = exports = factory(__webpack_require__(1), __webpack_require__(6));
  29466. }
  29467. else {}
  29468. }(this, function (CryptoJS) {
  29469. /**
  29470. * Counter block mode.
  29471. */
  29472. CryptoJS.mode.CTR = (function () {
  29473. var CTR = CryptoJS.lib.BlockCipherMode.extend();
  29474. var Encryptor = CTR.Encryptor = CTR.extend({
  29475. processBlock: function (words, offset) {
  29476. // Shortcuts
  29477. var cipher = this._cipher
  29478. var blockSize = cipher.blockSize;
  29479. var iv = this._iv;
  29480. var counter = this._counter;
  29481. // Generate keystream
  29482. if (iv) {
  29483. counter = this._counter = iv.slice(0);
  29484. // Remove IV for subsequent blocks
  29485. this._iv = undefined;
  29486. }
  29487. var keystream = counter.slice(0);
  29488. cipher.encryptBlock(keystream, 0);
  29489. // Increment counter
  29490. counter[blockSize - 1] = (counter[blockSize - 1] + 1) | 0
  29491. // Encrypt
  29492. for (var i = 0; i < blockSize; i++) {
  29493. words[offset + i] ^= keystream[i];
  29494. }
  29495. }
  29496. });
  29497. CTR.Decryptor = Encryptor;
  29498. return CTR;
  29499. }());
  29500. return CryptoJS.mode.CTR;
  29501. }));
  29502. /***/ }),
  29503. /* 287 */
  29504. /***/ (function(module, exports, __webpack_require__) {
  29505. ;(function (root, factory, undef) {
  29506. if (true) {
  29507. // CommonJS
  29508. module.exports = exports = factory(__webpack_require__(1), __webpack_require__(6));
  29509. }
  29510. else {}
  29511. }(this, function (CryptoJS) {
  29512. /** @preserve
  29513. * Counter block mode compatible with Dr Brian Gladman fileenc.c
  29514. * derived from CryptoJS.mode.CTR
  29515. * Jan Hruby jhruby.web@gmail.com
  29516. */
  29517. CryptoJS.mode.CTRGladman = (function () {
  29518. var CTRGladman = CryptoJS.lib.BlockCipherMode.extend();
  29519. function incWord(word)
  29520. {
  29521. if (((word >> 24) & 0xff) === 0xff) { //overflow
  29522. var b1 = (word >> 16)&0xff;
  29523. var b2 = (word >> 8)&0xff;
  29524. var b3 = word & 0xff;
  29525. if (b1 === 0xff) // overflow b1
  29526. {
  29527. b1 = 0;
  29528. if (b2 === 0xff)
  29529. {
  29530. b2 = 0;
  29531. if (b3 === 0xff)
  29532. {
  29533. b3 = 0;
  29534. }
  29535. else
  29536. {
  29537. ++b3;
  29538. }
  29539. }
  29540. else
  29541. {
  29542. ++b2;
  29543. }
  29544. }
  29545. else
  29546. {
  29547. ++b1;
  29548. }
  29549. word = 0;
  29550. word += (b1 << 16);
  29551. word += (b2 << 8);
  29552. word += b3;
  29553. }
  29554. else
  29555. {
  29556. word += (0x01 << 24);
  29557. }
  29558. return word;
  29559. }
  29560. function incCounter(counter)
  29561. {
  29562. if ((counter[0] = incWord(counter[0])) === 0)
  29563. {
  29564. // encr_data in fileenc.c from Dr Brian Gladman's counts only with DWORD j < 8
  29565. counter[1] = incWord(counter[1]);
  29566. }
  29567. return counter;
  29568. }
  29569. var Encryptor = CTRGladman.Encryptor = CTRGladman.extend({
  29570. processBlock: function (words, offset) {
  29571. // Shortcuts
  29572. var cipher = this._cipher
  29573. var blockSize = cipher.blockSize;
  29574. var iv = this._iv;
  29575. var counter = this._counter;
  29576. // Generate keystream
  29577. if (iv) {
  29578. counter = this._counter = iv.slice(0);
  29579. // Remove IV for subsequent blocks
  29580. this._iv = undefined;
  29581. }
  29582. incCounter(counter);
  29583. var keystream = counter.slice(0);
  29584. cipher.encryptBlock(keystream, 0);
  29585. // Encrypt
  29586. for (var i = 0; i < blockSize; i++) {
  29587. words[offset + i] ^= keystream[i];
  29588. }
  29589. }
  29590. });
  29591. CTRGladman.Decryptor = Encryptor;
  29592. return CTRGladman;
  29593. }());
  29594. return CryptoJS.mode.CTRGladman;
  29595. }));
  29596. /***/ }),
  29597. /* 288 */
  29598. /***/ (function(module, exports, __webpack_require__) {
  29599. ;(function (root, factory, undef) {
  29600. if (true) {
  29601. // CommonJS
  29602. module.exports = exports = factory(__webpack_require__(1), __webpack_require__(6));
  29603. }
  29604. else {}
  29605. }(this, function (CryptoJS) {
  29606. /**
  29607. * Output Feedback block mode.
  29608. */
  29609. CryptoJS.mode.OFB = (function () {
  29610. var OFB = CryptoJS.lib.BlockCipherMode.extend();
  29611. var Encryptor = OFB.Encryptor = OFB.extend({
  29612. processBlock: function (words, offset) {
  29613. // Shortcuts
  29614. var cipher = this._cipher
  29615. var blockSize = cipher.blockSize;
  29616. var iv = this._iv;
  29617. var keystream = this._keystream;
  29618. // Generate keystream
  29619. if (iv) {
  29620. keystream = this._keystream = iv.slice(0);
  29621. // Remove IV for subsequent blocks
  29622. this._iv = undefined;
  29623. }
  29624. cipher.encryptBlock(keystream, 0);
  29625. // Encrypt
  29626. for (var i = 0; i < blockSize; i++) {
  29627. words[offset + i] ^= keystream[i];
  29628. }
  29629. }
  29630. });
  29631. OFB.Decryptor = Encryptor;
  29632. return OFB;
  29633. }());
  29634. return CryptoJS.mode.OFB;
  29635. }));
  29636. /***/ }),
  29637. /* 289 */
  29638. /***/ (function(module, exports, __webpack_require__) {
  29639. ;(function (root, factory, undef) {
  29640. if (true) {
  29641. // CommonJS
  29642. module.exports = exports = factory(__webpack_require__(1), __webpack_require__(6));
  29643. }
  29644. else {}
  29645. }(this, function (CryptoJS) {
  29646. /**
  29647. * Electronic Codebook block mode.
  29648. */
  29649. CryptoJS.mode.ECB = (function () {
  29650. var ECB = CryptoJS.lib.BlockCipherMode.extend();
  29651. ECB.Encryptor = ECB.extend({
  29652. processBlock: function (words, offset) {
  29653. this._cipher.encryptBlock(words, offset);
  29654. }
  29655. });
  29656. ECB.Decryptor = ECB.extend({
  29657. processBlock: function (words, offset) {
  29658. this._cipher.decryptBlock(words, offset);
  29659. }
  29660. });
  29661. return ECB;
  29662. }());
  29663. return CryptoJS.mode.ECB;
  29664. }));
  29665. /***/ }),
  29666. /* 290 */
  29667. /***/ (function(module, exports, __webpack_require__) {
  29668. ;(function (root, factory, undef) {
  29669. if (true) {
  29670. // CommonJS
  29671. module.exports = exports = factory(__webpack_require__(1), __webpack_require__(6));
  29672. }
  29673. else {}
  29674. }(this, function (CryptoJS) {
  29675. /**
  29676. * ANSI X.923 padding strategy.
  29677. */
  29678. CryptoJS.pad.AnsiX923 = {
  29679. pad: function (data, blockSize) {
  29680. // Shortcuts
  29681. var dataSigBytes = data.sigBytes;
  29682. var blockSizeBytes = blockSize * 4;
  29683. // Count padding bytes
  29684. var nPaddingBytes = blockSizeBytes - dataSigBytes % blockSizeBytes;
  29685. // Compute last byte position
  29686. var lastBytePos = dataSigBytes + nPaddingBytes - 1;
  29687. // Pad
  29688. data.clamp();
  29689. data.words[lastBytePos >>> 2] |= nPaddingBytes << (24 - (lastBytePos % 4) * 8);
  29690. data.sigBytes += nPaddingBytes;
  29691. },
  29692. unpad: function (data) {
  29693. // Get number of padding bytes from last byte
  29694. var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff;
  29695. // Remove padding
  29696. data.sigBytes -= nPaddingBytes;
  29697. }
  29698. };
  29699. return CryptoJS.pad.Ansix923;
  29700. }));
  29701. /***/ }),
  29702. /* 291 */
  29703. /***/ (function(module, exports, __webpack_require__) {
  29704. ;(function (root, factory, undef) {
  29705. if (true) {
  29706. // CommonJS
  29707. module.exports = exports = factory(__webpack_require__(1), __webpack_require__(6));
  29708. }
  29709. else {}
  29710. }(this, function (CryptoJS) {
  29711. /**
  29712. * ISO 10126 padding strategy.
  29713. */
  29714. CryptoJS.pad.Iso10126 = {
  29715. pad: function (data, blockSize) {
  29716. // Shortcut
  29717. var blockSizeBytes = blockSize * 4;
  29718. // Count padding bytes
  29719. var nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes;
  29720. // Pad
  29721. data.concat(CryptoJS.lib.WordArray.random(nPaddingBytes - 1)).
  29722. concat(CryptoJS.lib.WordArray.create([nPaddingBytes << 24], 1));
  29723. },
  29724. unpad: function (data) {
  29725. // Get number of padding bytes from last byte
  29726. var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff;
  29727. // Remove padding
  29728. data.sigBytes -= nPaddingBytes;
  29729. }
  29730. };
  29731. return CryptoJS.pad.Iso10126;
  29732. }));
  29733. /***/ }),
  29734. /* 292 */
  29735. /***/ (function(module, exports, __webpack_require__) {
  29736. ;(function (root, factory, undef) {
  29737. if (true) {
  29738. // CommonJS
  29739. module.exports = exports = factory(__webpack_require__(1), __webpack_require__(6));
  29740. }
  29741. else {}
  29742. }(this, function (CryptoJS) {
  29743. /**
  29744. * ISO/IEC 9797-1 Padding Method 2.
  29745. */
  29746. CryptoJS.pad.Iso97971 = {
  29747. pad: function (data, blockSize) {
  29748. // Add 0x80 byte
  29749. data.concat(CryptoJS.lib.WordArray.create([0x80000000], 1));
  29750. // Zero pad the rest
  29751. CryptoJS.pad.ZeroPadding.pad(data, blockSize);
  29752. },
  29753. unpad: function (data) {
  29754. // Remove zero padding
  29755. CryptoJS.pad.ZeroPadding.unpad(data);
  29756. // Remove one more byte -- the 0x80 byte
  29757. data.sigBytes--;
  29758. }
  29759. };
  29760. return CryptoJS.pad.Iso97971;
  29761. }));
  29762. /***/ }),
  29763. /* 293 */
  29764. /***/ (function(module, exports, __webpack_require__) {
  29765. ;(function (root, factory, undef) {
  29766. if (true) {
  29767. // CommonJS
  29768. module.exports = exports = factory(__webpack_require__(1), __webpack_require__(6));
  29769. }
  29770. else {}
  29771. }(this, function (CryptoJS) {
  29772. /**
  29773. * Zero padding strategy.
  29774. */
  29775. CryptoJS.pad.ZeroPadding = {
  29776. pad: function (data, blockSize) {
  29777. // Shortcut
  29778. var blockSizeBytes = blockSize * 4;
  29779. // Pad
  29780. data.clamp();
  29781. data.sigBytes += blockSizeBytes - ((data.sigBytes % blockSizeBytes) || blockSizeBytes);
  29782. },
  29783. unpad: function (data) {
  29784. // Shortcut
  29785. var dataWords = data.words;
  29786. // Unpad
  29787. var i = data.sigBytes - 1;
  29788. while (!((dataWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff)) {
  29789. i--;
  29790. }
  29791. data.sigBytes = i + 1;
  29792. }
  29793. };
  29794. return CryptoJS.pad.ZeroPadding;
  29795. }));
  29796. /***/ }),
  29797. /* 294 */
  29798. /***/ (function(module, exports, __webpack_require__) {
  29799. ;(function (root, factory, undef) {
  29800. if (true) {
  29801. // CommonJS
  29802. module.exports = exports = factory(__webpack_require__(1), __webpack_require__(6));
  29803. }
  29804. else {}
  29805. }(this, function (CryptoJS) {
  29806. /**
  29807. * A noop padding strategy.
  29808. */
  29809. CryptoJS.pad.NoPadding = {
  29810. pad: function () {
  29811. },
  29812. unpad: function () {
  29813. }
  29814. };
  29815. return CryptoJS.pad.NoPadding;
  29816. }));
  29817. /***/ }),
  29818. /* 295 */
  29819. /***/ (function(module, exports, __webpack_require__) {
  29820. ;(function (root, factory, undef) {
  29821. if (true) {
  29822. // CommonJS
  29823. module.exports = exports = factory(__webpack_require__(1), __webpack_require__(6));
  29824. }
  29825. else {}
  29826. }(this, function (CryptoJS) {
  29827. (function (undefined) {
  29828. // Shortcuts
  29829. var C = CryptoJS;
  29830. var C_lib = C.lib;
  29831. var CipherParams = C_lib.CipherParams;
  29832. var C_enc = C.enc;
  29833. var Hex = C_enc.Hex;
  29834. var C_format = C.format;
  29835. var HexFormatter = C_format.Hex = {
  29836. /**
  29837. * Converts the ciphertext of a cipher params object to a hexadecimally encoded string.
  29838. *
  29839. * @param {CipherParams} cipherParams The cipher params object.
  29840. *
  29841. * @return {string} The hexadecimally encoded string.
  29842. *
  29843. * @static
  29844. *
  29845. * @example
  29846. *
  29847. * var hexString = CryptoJS.format.Hex.stringify(cipherParams);
  29848. */
  29849. stringify: function (cipherParams) {
  29850. return cipherParams.ciphertext.toString(Hex);
  29851. },
  29852. /**
  29853. * Converts a hexadecimally encoded ciphertext string to a cipher params object.
  29854. *
  29855. * @param {string} input The hexadecimally encoded string.
  29856. *
  29857. * @return {CipherParams} The cipher params object.
  29858. *
  29859. * @static
  29860. *
  29861. * @example
  29862. *
  29863. * var cipherParams = CryptoJS.format.Hex.parse(hexString);
  29864. */
  29865. parse: function (input) {
  29866. var ciphertext = Hex.parse(input);
  29867. return CipherParams.create({ ciphertext: ciphertext });
  29868. }
  29869. };
  29870. }());
  29871. return CryptoJS.format.Hex;
  29872. }));
  29873. /***/ }),
  29874. /* 296 */
  29875. /***/ (function(module, exports, __webpack_require__) {
  29876. ;(function (root, factory, undef) {
  29877. if (true) {
  29878. // CommonJS
  29879. module.exports = exports = factory(__webpack_require__(1), __webpack_require__(47), __webpack_require__(48), __webpack_require__(33), __webpack_require__(6));
  29880. }
  29881. else {}
  29882. }(this, function (CryptoJS) {
  29883. (function () {
  29884. // Shortcuts
  29885. var C = CryptoJS;
  29886. var C_lib = C.lib;
  29887. var BlockCipher = C_lib.BlockCipher;
  29888. var C_algo = C.algo;
  29889. // Lookup tables
  29890. var SBOX = [];
  29891. var INV_SBOX = [];
  29892. var SUB_MIX_0 = [];
  29893. var SUB_MIX_1 = [];
  29894. var SUB_MIX_2 = [];
  29895. var SUB_MIX_3 = [];
  29896. var INV_SUB_MIX_0 = [];
  29897. var INV_SUB_MIX_1 = [];
  29898. var INV_SUB_MIX_2 = [];
  29899. var INV_SUB_MIX_3 = [];
  29900. // Compute lookup tables
  29901. (function () {
  29902. // Compute double table
  29903. var d = [];
  29904. for (var i = 0; i < 256; i++) {
  29905. if (i < 128) {
  29906. d[i] = i << 1;
  29907. } else {
  29908. d[i] = (i << 1) ^ 0x11b;
  29909. }
  29910. }
  29911. // Walk GF(2^8)
  29912. var x = 0;
  29913. var xi = 0;
  29914. for (var i = 0; i < 256; i++) {
  29915. // Compute sbox
  29916. var sx = xi ^ (xi << 1) ^ (xi << 2) ^ (xi << 3) ^ (xi << 4);
  29917. sx = (sx >>> 8) ^ (sx & 0xff) ^ 0x63;
  29918. SBOX[x] = sx;
  29919. INV_SBOX[sx] = x;
  29920. // Compute multiplication
  29921. var x2 = d[x];
  29922. var x4 = d[x2];
  29923. var x8 = d[x4];
  29924. // Compute sub bytes, mix columns tables
  29925. var t = (d[sx] * 0x101) ^ (sx * 0x1010100);
  29926. SUB_MIX_0[x] = (t << 24) | (t >>> 8);
  29927. SUB_MIX_1[x] = (t << 16) | (t >>> 16);
  29928. SUB_MIX_2[x] = (t << 8) | (t >>> 24);
  29929. SUB_MIX_3[x] = t;
  29930. // Compute inv sub bytes, inv mix columns tables
  29931. var t = (x8 * 0x1010101) ^ (x4 * 0x10001) ^ (x2 * 0x101) ^ (x * 0x1010100);
  29932. INV_SUB_MIX_0[sx] = (t << 24) | (t >>> 8);
  29933. INV_SUB_MIX_1[sx] = (t << 16) | (t >>> 16);
  29934. INV_SUB_MIX_2[sx] = (t << 8) | (t >>> 24);
  29935. INV_SUB_MIX_3[sx] = t;
  29936. // Compute next counter
  29937. if (!x) {
  29938. x = xi = 1;
  29939. } else {
  29940. x = x2 ^ d[d[d[x8 ^ x2]]];
  29941. xi ^= d[d[xi]];
  29942. }
  29943. }
  29944. }());
  29945. // Precomputed Rcon lookup
  29946. var RCON = [0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36];
  29947. /**
  29948. * AES block cipher algorithm.
  29949. */
  29950. var AES = C_algo.AES = BlockCipher.extend({
  29951. _doReset: function () {
  29952. // Skip reset of nRounds has been set before and key did not change
  29953. if (this._nRounds && this._keyPriorReset === this._key) {
  29954. return;
  29955. }
  29956. // Shortcuts
  29957. var key = this._keyPriorReset = this._key;
  29958. var keyWords = key.words;
  29959. var keySize = key.sigBytes / 4;
  29960. // Compute number of rounds
  29961. var nRounds = this._nRounds = keySize + 6;
  29962. // Compute number of key schedule rows
  29963. var ksRows = (nRounds + 1) * 4;
  29964. // Compute key schedule
  29965. var keySchedule = this._keySchedule = [];
  29966. for (var ksRow = 0; ksRow < ksRows; ksRow++) {
  29967. if (ksRow < keySize) {
  29968. keySchedule[ksRow] = keyWords[ksRow];
  29969. } else {
  29970. var t = keySchedule[ksRow - 1];
  29971. if (!(ksRow % keySize)) {
  29972. // Rot word
  29973. t = (t << 8) | (t >>> 24);
  29974. // Sub word
  29975. t = (SBOX[t >>> 24] << 24) | (SBOX[(t >>> 16) & 0xff] << 16) | (SBOX[(t >>> 8) & 0xff] << 8) | SBOX[t & 0xff];
  29976. // Mix Rcon
  29977. t ^= RCON[(ksRow / keySize) | 0] << 24;
  29978. } else if (keySize > 6 && ksRow % keySize == 4) {
  29979. // Sub word
  29980. t = (SBOX[t >>> 24] << 24) | (SBOX[(t >>> 16) & 0xff] << 16) | (SBOX[(t >>> 8) & 0xff] << 8) | SBOX[t & 0xff];
  29981. }
  29982. keySchedule[ksRow] = keySchedule[ksRow - keySize] ^ t;
  29983. }
  29984. }
  29985. // Compute inv key schedule
  29986. var invKeySchedule = this._invKeySchedule = [];
  29987. for (var invKsRow = 0; invKsRow < ksRows; invKsRow++) {
  29988. var ksRow = ksRows - invKsRow;
  29989. if (invKsRow % 4) {
  29990. var t = keySchedule[ksRow];
  29991. } else {
  29992. var t = keySchedule[ksRow - 4];
  29993. }
  29994. if (invKsRow < 4 || ksRow <= 4) {
  29995. invKeySchedule[invKsRow] = t;
  29996. } else {
  29997. invKeySchedule[invKsRow] = INV_SUB_MIX_0[SBOX[t >>> 24]] ^ INV_SUB_MIX_1[SBOX[(t >>> 16) & 0xff]] ^
  29998. INV_SUB_MIX_2[SBOX[(t >>> 8) & 0xff]] ^ INV_SUB_MIX_3[SBOX[t & 0xff]];
  29999. }
  30000. }
  30001. },
  30002. encryptBlock: function (M, offset) {
  30003. this._doCryptBlock(M, offset, this._keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX);
  30004. },
  30005. decryptBlock: function (M, offset) {
  30006. // Swap 2nd and 4th rows
  30007. var t = M[offset + 1];
  30008. M[offset + 1] = M[offset + 3];
  30009. M[offset + 3] = t;
  30010. this._doCryptBlock(M, offset, this._invKeySchedule, INV_SUB_MIX_0, INV_SUB_MIX_1, INV_SUB_MIX_2, INV_SUB_MIX_3, INV_SBOX);
  30011. // Inv swap 2nd and 4th rows
  30012. var t = M[offset + 1];
  30013. M[offset + 1] = M[offset + 3];
  30014. M[offset + 3] = t;
  30015. },
  30016. _doCryptBlock: function (M, offset, keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX) {
  30017. // Shortcut
  30018. var nRounds = this._nRounds;
  30019. // Get input, add round key
  30020. var s0 = M[offset] ^ keySchedule[0];
  30021. var s1 = M[offset + 1] ^ keySchedule[1];
  30022. var s2 = M[offset + 2] ^ keySchedule[2];
  30023. var s3 = M[offset + 3] ^ keySchedule[3];
  30024. // Key schedule row counter
  30025. var ksRow = 4;
  30026. // Rounds
  30027. for (var round = 1; round < nRounds; round++) {
  30028. // Shift rows, sub bytes, mix columns, add round key
  30029. var t0 = SUB_MIX_0[s0 >>> 24] ^ SUB_MIX_1[(s1 >>> 16) & 0xff] ^ SUB_MIX_2[(s2 >>> 8) & 0xff] ^ SUB_MIX_3[s3 & 0xff] ^ keySchedule[ksRow++];
  30030. var t1 = SUB_MIX_0[s1 >>> 24] ^ SUB_MIX_1[(s2 >>> 16) & 0xff] ^ SUB_MIX_2[(s3 >>> 8) & 0xff] ^ SUB_MIX_3[s0 & 0xff] ^ keySchedule[ksRow++];
  30031. var t2 = SUB_MIX_0[s2 >>> 24] ^ SUB_MIX_1[(s3 >>> 16) & 0xff] ^ SUB_MIX_2[(s0 >>> 8) & 0xff] ^ SUB_MIX_3[s1 & 0xff] ^ keySchedule[ksRow++];
  30032. var t3 = SUB_MIX_0[s3 >>> 24] ^ SUB_MIX_1[(s0 >>> 16) & 0xff] ^ SUB_MIX_2[(s1 >>> 8) & 0xff] ^ SUB_MIX_3[s2 & 0xff] ^ keySchedule[ksRow++];
  30033. // Update state
  30034. s0 = t0;
  30035. s1 = t1;
  30036. s2 = t2;
  30037. s3 = t3;
  30038. }
  30039. // Shift rows, sub bytes, add round key
  30040. var t0 = ((SBOX[s0 >>> 24] << 24) | (SBOX[(s1 >>> 16) & 0xff] << 16) | (SBOX[(s2 >>> 8) & 0xff] << 8) | SBOX[s3 & 0xff]) ^ keySchedule[ksRow++];
  30041. var t1 = ((SBOX[s1 >>> 24] << 24) | (SBOX[(s2 >>> 16) & 0xff] << 16) | (SBOX[(s3 >>> 8) & 0xff] << 8) | SBOX[s0 & 0xff]) ^ keySchedule[ksRow++];
  30042. var t2 = ((SBOX[s2 >>> 24] << 24) | (SBOX[(s3 >>> 16) & 0xff] << 16) | (SBOX[(s0 >>> 8) & 0xff] << 8) | SBOX[s1 & 0xff]) ^ keySchedule[ksRow++];
  30043. var t3 = ((SBOX[s3 >>> 24] << 24) | (SBOX[(s0 >>> 16) & 0xff] << 16) | (SBOX[(s1 >>> 8) & 0xff] << 8) | SBOX[s2 & 0xff]) ^ keySchedule[ksRow++];
  30044. // Set output
  30045. M[offset] = t0;
  30046. M[offset + 1] = t1;
  30047. M[offset + 2] = t2;
  30048. M[offset + 3] = t3;
  30049. },
  30050. keySize: 256/32
  30051. });
  30052. /**
  30053. * Shortcut functions to the cipher's object interface.
  30054. *
  30055. * @example
  30056. *
  30057. * var ciphertext = CryptoJS.AES.encrypt(message, key, cfg);
  30058. * var plaintext = CryptoJS.AES.decrypt(ciphertext, key, cfg);
  30059. */
  30060. C.AES = BlockCipher._createHelper(AES);
  30061. }());
  30062. return CryptoJS.AES;
  30063. }));
  30064. /***/ }),
  30065. /* 297 */
  30066. /***/ (function(module, exports, __webpack_require__) {
  30067. ;(function (root, factory, undef) {
  30068. if (true) {
  30069. // CommonJS
  30070. module.exports = exports = factory(__webpack_require__(1), __webpack_require__(47), __webpack_require__(48), __webpack_require__(33), __webpack_require__(6));
  30071. }
  30072. else {}
  30073. }(this, function (CryptoJS) {
  30074. (function () {
  30075. // Shortcuts
  30076. var C = CryptoJS;
  30077. var C_lib = C.lib;
  30078. var WordArray = C_lib.WordArray;
  30079. var BlockCipher = C_lib.BlockCipher;
  30080. var C_algo = C.algo;
  30081. // Permuted Choice 1 constants
  30082. var PC1 = [
  30083. 57, 49, 41, 33, 25, 17, 9, 1,
  30084. 58, 50, 42, 34, 26, 18, 10, 2,
  30085. 59, 51, 43, 35, 27, 19, 11, 3,
  30086. 60, 52, 44, 36, 63, 55, 47, 39,
  30087. 31, 23, 15, 7, 62, 54, 46, 38,
  30088. 30, 22, 14, 6, 61, 53, 45, 37,
  30089. 29, 21, 13, 5, 28, 20, 12, 4
  30090. ];
  30091. // Permuted Choice 2 constants
  30092. var PC2 = [
  30093. 14, 17, 11, 24, 1, 5,
  30094. 3, 28, 15, 6, 21, 10,
  30095. 23, 19, 12, 4, 26, 8,
  30096. 16, 7, 27, 20, 13, 2,
  30097. 41, 52, 31, 37, 47, 55,
  30098. 30, 40, 51, 45, 33, 48,
  30099. 44, 49, 39, 56, 34, 53,
  30100. 46, 42, 50, 36, 29, 32
  30101. ];
  30102. // Cumulative bit shift constants
  30103. var BIT_SHIFTS = [1, 2, 4, 6, 8, 10, 12, 14, 15, 17, 19, 21, 23, 25, 27, 28];
  30104. // SBOXes and round permutation constants
  30105. var SBOX_P = [
  30106. {
  30107. 0x0: 0x808200,
  30108. 0x10000000: 0x8000,
  30109. 0x20000000: 0x808002,
  30110. 0x30000000: 0x2,
  30111. 0x40000000: 0x200,
  30112. 0x50000000: 0x808202,
  30113. 0x60000000: 0x800202,
  30114. 0x70000000: 0x800000,
  30115. 0x80000000: 0x202,
  30116. 0x90000000: 0x800200,
  30117. 0xa0000000: 0x8200,
  30118. 0xb0000000: 0x808000,
  30119. 0xc0000000: 0x8002,
  30120. 0xd0000000: 0x800002,
  30121. 0xe0000000: 0x0,
  30122. 0xf0000000: 0x8202,
  30123. 0x8000000: 0x0,
  30124. 0x18000000: 0x808202,
  30125. 0x28000000: 0x8202,
  30126. 0x38000000: 0x8000,
  30127. 0x48000000: 0x808200,
  30128. 0x58000000: 0x200,
  30129. 0x68000000: 0x808002,
  30130. 0x78000000: 0x2,
  30131. 0x88000000: 0x800200,
  30132. 0x98000000: 0x8200,
  30133. 0xa8000000: 0x808000,
  30134. 0xb8000000: 0x800202,
  30135. 0xc8000000: 0x800002,
  30136. 0xd8000000: 0x8002,
  30137. 0xe8000000: 0x202,
  30138. 0xf8000000: 0x800000,
  30139. 0x1: 0x8000,
  30140. 0x10000001: 0x2,
  30141. 0x20000001: 0x808200,
  30142. 0x30000001: 0x800000,
  30143. 0x40000001: 0x808002,
  30144. 0x50000001: 0x8200,
  30145. 0x60000001: 0x200,
  30146. 0x70000001: 0x800202,
  30147. 0x80000001: 0x808202,
  30148. 0x90000001: 0x808000,
  30149. 0xa0000001: 0x800002,
  30150. 0xb0000001: 0x8202,
  30151. 0xc0000001: 0x202,
  30152. 0xd0000001: 0x800200,
  30153. 0xe0000001: 0x8002,
  30154. 0xf0000001: 0x0,
  30155. 0x8000001: 0x808202,
  30156. 0x18000001: 0x808000,
  30157. 0x28000001: 0x800000,
  30158. 0x38000001: 0x200,
  30159. 0x48000001: 0x8000,
  30160. 0x58000001: 0x800002,
  30161. 0x68000001: 0x2,
  30162. 0x78000001: 0x8202,
  30163. 0x88000001: 0x8002,
  30164. 0x98000001: 0x800202,
  30165. 0xa8000001: 0x202,
  30166. 0xb8000001: 0x808200,
  30167. 0xc8000001: 0x800200,
  30168. 0xd8000001: 0x0,
  30169. 0xe8000001: 0x8200,
  30170. 0xf8000001: 0x808002
  30171. },
  30172. {
  30173. 0x0: 0x40084010,
  30174. 0x1000000: 0x4000,
  30175. 0x2000000: 0x80000,
  30176. 0x3000000: 0x40080010,
  30177. 0x4000000: 0x40000010,
  30178. 0x5000000: 0x40084000,
  30179. 0x6000000: 0x40004000,
  30180. 0x7000000: 0x10,
  30181. 0x8000000: 0x84000,
  30182. 0x9000000: 0x40004010,
  30183. 0xa000000: 0x40000000,
  30184. 0xb000000: 0x84010,
  30185. 0xc000000: 0x80010,
  30186. 0xd000000: 0x0,
  30187. 0xe000000: 0x4010,
  30188. 0xf000000: 0x40080000,
  30189. 0x800000: 0x40004000,
  30190. 0x1800000: 0x84010,
  30191. 0x2800000: 0x10,
  30192. 0x3800000: 0x40004010,
  30193. 0x4800000: 0x40084010,
  30194. 0x5800000: 0x40000000,
  30195. 0x6800000: 0x80000,
  30196. 0x7800000: 0x40080010,
  30197. 0x8800000: 0x80010,
  30198. 0x9800000: 0x0,
  30199. 0xa800000: 0x4000,
  30200. 0xb800000: 0x40080000,
  30201. 0xc800000: 0x40000010,
  30202. 0xd800000: 0x84000,
  30203. 0xe800000: 0x40084000,
  30204. 0xf800000: 0x4010,
  30205. 0x10000000: 0x0,
  30206. 0x11000000: 0x40080010,
  30207. 0x12000000: 0x40004010,
  30208. 0x13000000: 0x40084000,
  30209. 0x14000000: 0x40080000,
  30210. 0x15000000: 0x10,
  30211. 0x16000000: 0x84010,
  30212. 0x17000000: 0x4000,
  30213. 0x18000000: 0x4010,
  30214. 0x19000000: 0x80000,
  30215. 0x1a000000: 0x80010,
  30216. 0x1b000000: 0x40000010,
  30217. 0x1c000000: 0x84000,
  30218. 0x1d000000: 0x40004000,
  30219. 0x1e000000: 0x40000000,
  30220. 0x1f000000: 0x40084010,
  30221. 0x10800000: 0x84010,
  30222. 0x11800000: 0x80000,
  30223. 0x12800000: 0x40080000,
  30224. 0x13800000: 0x4000,
  30225. 0x14800000: 0x40004000,
  30226. 0x15800000: 0x40084010,
  30227. 0x16800000: 0x10,
  30228. 0x17800000: 0x40000000,
  30229. 0x18800000: 0x40084000,
  30230. 0x19800000: 0x40000010,
  30231. 0x1a800000: 0x40004010,
  30232. 0x1b800000: 0x80010,
  30233. 0x1c800000: 0x0,
  30234. 0x1d800000: 0x4010,
  30235. 0x1e800000: 0x40080010,
  30236. 0x1f800000: 0x84000
  30237. },
  30238. {
  30239. 0x0: 0x104,
  30240. 0x100000: 0x0,
  30241. 0x200000: 0x4000100,
  30242. 0x300000: 0x10104,
  30243. 0x400000: 0x10004,
  30244. 0x500000: 0x4000004,
  30245. 0x600000: 0x4010104,
  30246. 0x700000: 0x4010000,
  30247. 0x800000: 0x4000000,
  30248. 0x900000: 0x4010100,
  30249. 0xa00000: 0x10100,
  30250. 0xb00000: 0x4010004,
  30251. 0xc00000: 0x4000104,
  30252. 0xd00000: 0x10000,
  30253. 0xe00000: 0x4,
  30254. 0xf00000: 0x100,
  30255. 0x80000: 0x4010100,
  30256. 0x180000: 0x4010004,
  30257. 0x280000: 0x0,
  30258. 0x380000: 0x4000100,
  30259. 0x480000: 0x4000004,
  30260. 0x580000: 0x10000,
  30261. 0x680000: 0x10004,
  30262. 0x780000: 0x104,
  30263. 0x880000: 0x4,
  30264. 0x980000: 0x100,
  30265. 0xa80000: 0x4010000,
  30266. 0xb80000: 0x10104,
  30267. 0xc80000: 0x10100,
  30268. 0xd80000: 0x4000104,
  30269. 0xe80000: 0x4010104,
  30270. 0xf80000: 0x4000000,
  30271. 0x1000000: 0x4010100,
  30272. 0x1100000: 0x10004,
  30273. 0x1200000: 0x10000,
  30274. 0x1300000: 0x4000100,
  30275. 0x1400000: 0x100,
  30276. 0x1500000: 0x4010104,
  30277. 0x1600000: 0x4000004,
  30278. 0x1700000: 0x0,
  30279. 0x1800000: 0x4000104,
  30280. 0x1900000: 0x4000000,
  30281. 0x1a00000: 0x4,
  30282. 0x1b00000: 0x10100,
  30283. 0x1c00000: 0x4010000,
  30284. 0x1d00000: 0x104,
  30285. 0x1e00000: 0x10104,
  30286. 0x1f00000: 0x4010004,
  30287. 0x1080000: 0x4000000,
  30288. 0x1180000: 0x104,
  30289. 0x1280000: 0x4010100,
  30290. 0x1380000: 0x0,
  30291. 0x1480000: 0x10004,
  30292. 0x1580000: 0x4000100,
  30293. 0x1680000: 0x100,
  30294. 0x1780000: 0x4010004,
  30295. 0x1880000: 0x10000,
  30296. 0x1980000: 0x4010104,
  30297. 0x1a80000: 0x10104,
  30298. 0x1b80000: 0x4000004,
  30299. 0x1c80000: 0x4000104,
  30300. 0x1d80000: 0x4010000,
  30301. 0x1e80000: 0x4,
  30302. 0x1f80000: 0x10100
  30303. },
  30304. {
  30305. 0x0: 0x80401000,
  30306. 0x10000: 0x80001040,
  30307. 0x20000: 0x401040,
  30308. 0x30000: 0x80400000,
  30309. 0x40000: 0x0,
  30310. 0x50000: 0x401000,
  30311. 0x60000: 0x80000040,
  30312. 0x70000: 0x400040,
  30313. 0x80000: 0x80000000,
  30314. 0x90000: 0x400000,
  30315. 0xa0000: 0x40,
  30316. 0xb0000: 0x80001000,
  30317. 0xc0000: 0x80400040,
  30318. 0xd0000: 0x1040,
  30319. 0xe0000: 0x1000,
  30320. 0xf0000: 0x80401040,
  30321. 0x8000: 0x80001040,
  30322. 0x18000: 0x40,
  30323. 0x28000: 0x80400040,
  30324. 0x38000: 0x80001000,
  30325. 0x48000: 0x401000,
  30326. 0x58000: 0x80401040,
  30327. 0x68000: 0x0,
  30328. 0x78000: 0x80400000,
  30329. 0x88000: 0x1000,
  30330. 0x98000: 0x80401000,
  30331. 0xa8000: 0x400000,
  30332. 0xb8000: 0x1040,
  30333. 0xc8000: 0x80000000,
  30334. 0xd8000: 0x400040,
  30335. 0xe8000: 0x401040,
  30336. 0xf8000: 0x80000040,
  30337. 0x100000: 0x400040,
  30338. 0x110000: 0x401000,
  30339. 0x120000: 0x80000040,
  30340. 0x130000: 0x0,
  30341. 0x140000: 0x1040,
  30342. 0x150000: 0x80400040,
  30343. 0x160000: 0x80401000,
  30344. 0x170000: 0x80001040,
  30345. 0x180000: 0x80401040,
  30346. 0x190000: 0x80000000,
  30347. 0x1a0000: 0x80400000,
  30348. 0x1b0000: 0x401040,
  30349. 0x1c0000: 0x80001000,
  30350. 0x1d0000: 0x400000,
  30351. 0x1e0000: 0x40,
  30352. 0x1f0000: 0x1000,
  30353. 0x108000: 0x80400000,
  30354. 0x118000: 0x80401040,
  30355. 0x128000: 0x0,
  30356. 0x138000: 0x401000,
  30357. 0x148000: 0x400040,
  30358. 0x158000: 0x80000000,
  30359. 0x168000: 0x80001040,
  30360. 0x178000: 0x40,
  30361. 0x188000: 0x80000040,
  30362. 0x198000: 0x1000,
  30363. 0x1a8000: 0x80001000,
  30364. 0x1b8000: 0x80400040,
  30365. 0x1c8000: 0x1040,
  30366. 0x1d8000: 0x80401000,
  30367. 0x1e8000: 0x400000,
  30368. 0x1f8000: 0x401040
  30369. },
  30370. {
  30371. 0x0: 0x80,
  30372. 0x1000: 0x1040000,
  30373. 0x2000: 0x40000,
  30374. 0x3000: 0x20000000,
  30375. 0x4000: 0x20040080,
  30376. 0x5000: 0x1000080,
  30377. 0x6000: 0x21000080,
  30378. 0x7000: 0x40080,
  30379. 0x8000: 0x1000000,
  30380. 0x9000: 0x20040000,
  30381. 0xa000: 0x20000080,
  30382. 0xb000: 0x21040080,
  30383. 0xc000: 0x21040000,
  30384. 0xd000: 0x0,
  30385. 0xe000: 0x1040080,
  30386. 0xf000: 0x21000000,
  30387. 0x800: 0x1040080,
  30388. 0x1800: 0x21000080,
  30389. 0x2800: 0x80,
  30390. 0x3800: 0x1040000,
  30391. 0x4800: 0x40000,
  30392. 0x5800: 0x20040080,
  30393. 0x6800: 0x21040000,
  30394. 0x7800: 0x20000000,
  30395. 0x8800: 0x20040000,
  30396. 0x9800: 0x0,
  30397. 0xa800: 0x21040080,
  30398. 0xb800: 0x1000080,
  30399. 0xc800: 0x20000080,
  30400. 0xd800: 0x21000000,
  30401. 0xe800: 0x1000000,
  30402. 0xf800: 0x40080,
  30403. 0x10000: 0x40000,
  30404. 0x11000: 0x80,
  30405. 0x12000: 0x20000000,
  30406. 0x13000: 0x21000080,
  30407. 0x14000: 0x1000080,
  30408. 0x15000: 0x21040000,
  30409. 0x16000: 0x20040080,
  30410. 0x17000: 0x1000000,
  30411. 0x18000: 0x21040080,
  30412. 0x19000: 0x21000000,
  30413. 0x1a000: 0x1040000,
  30414. 0x1b000: 0x20040000,
  30415. 0x1c000: 0x40080,
  30416. 0x1d000: 0x20000080,
  30417. 0x1e000: 0x0,
  30418. 0x1f000: 0x1040080,
  30419. 0x10800: 0x21000080,
  30420. 0x11800: 0x1000000,
  30421. 0x12800: 0x1040000,
  30422. 0x13800: 0x20040080,
  30423. 0x14800: 0x20000000,
  30424. 0x15800: 0x1040080,
  30425. 0x16800: 0x80,
  30426. 0x17800: 0x21040000,
  30427. 0x18800: 0x40080,
  30428. 0x19800: 0x21040080,
  30429. 0x1a800: 0x0,
  30430. 0x1b800: 0x21000000,
  30431. 0x1c800: 0x1000080,
  30432. 0x1d800: 0x40000,
  30433. 0x1e800: 0x20040000,
  30434. 0x1f800: 0x20000080
  30435. },
  30436. {
  30437. 0x0: 0x10000008,
  30438. 0x100: 0x2000,
  30439. 0x200: 0x10200000,
  30440. 0x300: 0x10202008,
  30441. 0x400: 0x10002000,
  30442. 0x500: 0x200000,
  30443. 0x600: 0x200008,
  30444. 0x700: 0x10000000,
  30445. 0x800: 0x0,
  30446. 0x900: 0x10002008,
  30447. 0xa00: 0x202000,
  30448. 0xb00: 0x8,
  30449. 0xc00: 0x10200008,
  30450. 0xd00: 0x202008,
  30451. 0xe00: 0x2008,
  30452. 0xf00: 0x10202000,
  30453. 0x80: 0x10200000,
  30454. 0x180: 0x10202008,
  30455. 0x280: 0x8,
  30456. 0x380: 0x200000,
  30457. 0x480: 0x202008,
  30458. 0x580: 0x10000008,
  30459. 0x680: 0x10002000,
  30460. 0x780: 0x2008,
  30461. 0x880: 0x200008,
  30462. 0x980: 0x2000,
  30463. 0xa80: 0x10002008,
  30464. 0xb80: 0x10200008,
  30465. 0xc80: 0x0,
  30466. 0xd80: 0x10202000,
  30467. 0xe80: 0x202000,
  30468. 0xf80: 0x10000000,
  30469. 0x1000: 0x10002000,
  30470. 0x1100: 0x10200008,
  30471. 0x1200: 0x10202008,
  30472. 0x1300: 0x2008,
  30473. 0x1400: 0x200000,
  30474. 0x1500: 0x10000000,
  30475. 0x1600: 0x10000008,
  30476. 0x1700: 0x202000,
  30477. 0x1800: 0x202008,
  30478. 0x1900: 0x0,
  30479. 0x1a00: 0x8,
  30480. 0x1b00: 0x10200000,
  30481. 0x1c00: 0x2000,
  30482. 0x1d00: 0x10002008,
  30483. 0x1e00: 0x10202000,
  30484. 0x1f00: 0x200008,
  30485. 0x1080: 0x8,
  30486. 0x1180: 0x202000,
  30487. 0x1280: 0x200000,
  30488. 0x1380: 0x10000008,
  30489. 0x1480: 0x10002000,
  30490. 0x1580: 0x2008,
  30491. 0x1680: 0x10202008,
  30492. 0x1780: 0x10200000,
  30493. 0x1880: 0x10202000,
  30494. 0x1980: 0x10200008,
  30495. 0x1a80: 0x2000,
  30496. 0x1b80: 0x202008,
  30497. 0x1c80: 0x200008,
  30498. 0x1d80: 0x0,
  30499. 0x1e80: 0x10000000,
  30500. 0x1f80: 0x10002008
  30501. },
  30502. {
  30503. 0x0: 0x100000,
  30504. 0x10: 0x2000401,
  30505. 0x20: 0x400,
  30506. 0x30: 0x100401,
  30507. 0x40: 0x2100401,
  30508. 0x50: 0x0,
  30509. 0x60: 0x1,
  30510. 0x70: 0x2100001,
  30511. 0x80: 0x2000400,
  30512. 0x90: 0x100001,
  30513. 0xa0: 0x2000001,
  30514. 0xb0: 0x2100400,
  30515. 0xc0: 0x2100000,
  30516. 0xd0: 0x401,
  30517. 0xe0: 0x100400,
  30518. 0xf0: 0x2000000,
  30519. 0x8: 0x2100001,
  30520. 0x18: 0x0,
  30521. 0x28: 0x2000401,
  30522. 0x38: 0x2100400,
  30523. 0x48: 0x100000,
  30524. 0x58: 0x2000001,
  30525. 0x68: 0x2000000,
  30526. 0x78: 0x401,
  30527. 0x88: 0x100401,
  30528. 0x98: 0x2000400,
  30529. 0xa8: 0x2100000,
  30530. 0xb8: 0x100001,
  30531. 0xc8: 0x400,
  30532. 0xd8: 0x2100401,
  30533. 0xe8: 0x1,
  30534. 0xf8: 0x100400,
  30535. 0x100: 0x2000000,
  30536. 0x110: 0x100000,
  30537. 0x120: 0x2000401,
  30538. 0x130: 0x2100001,
  30539. 0x140: 0x100001,
  30540. 0x150: 0x2000400,
  30541. 0x160: 0x2100400,
  30542. 0x170: 0x100401,
  30543. 0x180: 0x401,
  30544. 0x190: 0x2100401,
  30545. 0x1a0: 0x100400,
  30546. 0x1b0: 0x1,
  30547. 0x1c0: 0x0,
  30548. 0x1d0: 0x2100000,
  30549. 0x1e0: 0x2000001,
  30550. 0x1f0: 0x400,
  30551. 0x108: 0x100400,
  30552. 0x118: 0x2000401,
  30553. 0x128: 0x2100001,
  30554. 0x138: 0x1,
  30555. 0x148: 0x2000000,
  30556. 0x158: 0x100000,
  30557. 0x168: 0x401,
  30558. 0x178: 0x2100400,
  30559. 0x188: 0x2000001,
  30560. 0x198: 0x2100000,
  30561. 0x1a8: 0x0,
  30562. 0x1b8: 0x2100401,
  30563. 0x1c8: 0x100401,
  30564. 0x1d8: 0x400,
  30565. 0x1e8: 0x2000400,
  30566. 0x1f8: 0x100001
  30567. },
  30568. {
  30569. 0x0: 0x8000820,
  30570. 0x1: 0x20000,
  30571. 0x2: 0x8000000,
  30572. 0x3: 0x20,
  30573. 0x4: 0x20020,
  30574. 0x5: 0x8020820,
  30575. 0x6: 0x8020800,
  30576. 0x7: 0x800,
  30577. 0x8: 0x8020000,
  30578. 0x9: 0x8000800,
  30579. 0xa: 0x20800,
  30580. 0xb: 0x8020020,
  30581. 0xc: 0x820,
  30582. 0xd: 0x0,
  30583. 0xe: 0x8000020,
  30584. 0xf: 0x20820,
  30585. 0x80000000: 0x800,
  30586. 0x80000001: 0x8020820,
  30587. 0x80000002: 0x8000820,
  30588. 0x80000003: 0x8000000,
  30589. 0x80000004: 0x8020000,
  30590. 0x80000005: 0x20800,
  30591. 0x80000006: 0x20820,
  30592. 0x80000007: 0x20,
  30593. 0x80000008: 0x8000020,
  30594. 0x80000009: 0x820,
  30595. 0x8000000a: 0x20020,
  30596. 0x8000000b: 0x8020800,
  30597. 0x8000000c: 0x0,
  30598. 0x8000000d: 0x8020020,
  30599. 0x8000000e: 0x8000800,
  30600. 0x8000000f: 0x20000,
  30601. 0x10: 0x20820,
  30602. 0x11: 0x8020800,
  30603. 0x12: 0x20,
  30604. 0x13: 0x800,
  30605. 0x14: 0x8000800,
  30606. 0x15: 0x8000020,
  30607. 0x16: 0x8020020,
  30608. 0x17: 0x20000,
  30609. 0x18: 0x0,
  30610. 0x19: 0x20020,
  30611. 0x1a: 0x8020000,
  30612. 0x1b: 0x8000820,
  30613. 0x1c: 0x8020820,
  30614. 0x1d: 0x20800,
  30615. 0x1e: 0x820,
  30616. 0x1f: 0x8000000,
  30617. 0x80000010: 0x20000,
  30618. 0x80000011: 0x800,
  30619. 0x80000012: 0x8020020,
  30620. 0x80000013: 0x20820,
  30621. 0x80000014: 0x20,
  30622. 0x80000015: 0x8020000,
  30623. 0x80000016: 0x8000000,
  30624. 0x80000017: 0x8000820,
  30625. 0x80000018: 0x8020820,
  30626. 0x80000019: 0x8000020,
  30627. 0x8000001a: 0x8000800,
  30628. 0x8000001b: 0x0,
  30629. 0x8000001c: 0x20800,
  30630. 0x8000001d: 0x820,
  30631. 0x8000001e: 0x20020,
  30632. 0x8000001f: 0x8020800
  30633. }
  30634. ];
  30635. // Masks that select the SBOX input
  30636. var SBOX_MASK = [
  30637. 0xf8000001, 0x1f800000, 0x01f80000, 0x001f8000,
  30638. 0x0001f800, 0x00001f80, 0x000001f8, 0x8000001f
  30639. ];
  30640. /**
  30641. * DES block cipher algorithm.
  30642. */
  30643. var DES = C_algo.DES = BlockCipher.extend({
  30644. _doReset: function () {
  30645. // Shortcuts
  30646. var key = this._key;
  30647. var keyWords = key.words;
  30648. // Select 56 bits according to PC1
  30649. var keyBits = [];
  30650. for (var i = 0; i < 56; i++) {
  30651. var keyBitPos = PC1[i] - 1;
  30652. keyBits[i] = (keyWords[keyBitPos >>> 5] >>> (31 - keyBitPos % 32)) & 1;
  30653. }
  30654. // Assemble 16 subkeys
  30655. var subKeys = this._subKeys = [];
  30656. for (var nSubKey = 0; nSubKey < 16; nSubKey++) {
  30657. // Create subkey
  30658. var subKey = subKeys[nSubKey] = [];
  30659. // Shortcut
  30660. var bitShift = BIT_SHIFTS[nSubKey];
  30661. // Select 48 bits according to PC2
  30662. for (var i = 0; i < 24; i++) {
  30663. // Select from the left 28 key bits
  30664. subKey[(i / 6) | 0] |= keyBits[((PC2[i] - 1) + bitShift) % 28] << (31 - i % 6);
  30665. // Select from the right 28 key bits
  30666. subKey[4 + ((i / 6) | 0)] |= keyBits[28 + (((PC2[i + 24] - 1) + bitShift) % 28)] << (31 - i % 6);
  30667. }
  30668. // Since each subkey is applied to an expanded 32-bit input,
  30669. // the subkey can be broken into 8 values scaled to 32-bits,
  30670. // which allows the key to be used without expansion
  30671. subKey[0] = (subKey[0] << 1) | (subKey[0] >>> 31);
  30672. for (var i = 1; i < 7; i++) {
  30673. subKey[i] = subKey[i] >>> ((i - 1) * 4 + 3);
  30674. }
  30675. subKey[7] = (subKey[7] << 5) | (subKey[7] >>> 27);
  30676. }
  30677. // Compute inverse subkeys
  30678. var invSubKeys = this._invSubKeys = [];
  30679. for (var i = 0; i < 16; i++) {
  30680. invSubKeys[i] = subKeys[15 - i];
  30681. }
  30682. },
  30683. encryptBlock: function (M, offset) {
  30684. this._doCryptBlock(M, offset, this._subKeys);
  30685. },
  30686. decryptBlock: function (M, offset) {
  30687. this._doCryptBlock(M, offset, this._invSubKeys);
  30688. },
  30689. _doCryptBlock: function (M, offset, subKeys) {
  30690. // Get input
  30691. this._lBlock = M[offset];
  30692. this._rBlock = M[offset + 1];
  30693. // Initial permutation
  30694. exchangeLR.call(this, 4, 0x0f0f0f0f);
  30695. exchangeLR.call(this, 16, 0x0000ffff);
  30696. exchangeRL.call(this, 2, 0x33333333);
  30697. exchangeRL.call(this, 8, 0x00ff00ff);
  30698. exchangeLR.call(this, 1, 0x55555555);
  30699. // Rounds
  30700. for (var round = 0; round < 16; round++) {
  30701. // Shortcuts
  30702. var subKey = subKeys[round];
  30703. var lBlock = this._lBlock;
  30704. var rBlock = this._rBlock;
  30705. // Feistel function
  30706. var f = 0;
  30707. for (var i = 0; i < 8; i++) {
  30708. f |= SBOX_P[i][((rBlock ^ subKey[i]) & SBOX_MASK[i]) >>> 0];
  30709. }
  30710. this._lBlock = rBlock;
  30711. this._rBlock = lBlock ^ f;
  30712. }
  30713. // Undo swap from last round
  30714. var t = this._lBlock;
  30715. this._lBlock = this._rBlock;
  30716. this._rBlock = t;
  30717. // Final permutation
  30718. exchangeLR.call(this, 1, 0x55555555);
  30719. exchangeRL.call(this, 8, 0x00ff00ff);
  30720. exchangeRL.call(this, 2, 0x33333333);
  30721. exchangeLR.call(this, 16, 0x0000ffff);
  30722. exchangeLR.call(this, 4, 0x0f0f0f0f);
  30723. // Set output
  30724. M[offset] = this._lBlock;
  30725. M[offset + 1] = this._rBlock;
  30726. },
  30727. keySize: 64/32,
  30728. ivSize: 64/32,
  30729. blockSize: 64/32
  30730. });
  30731. // Swap bits across the left and right words
  30732. function exchangeLR(offset, mask) {
  30733. var t = ((this._lBlock >>> offset) ^ this._rBlock) & mask;
  30734. this._rBlock ^= t;
  30735. this._lBlock ^= t << offset;
  30736. }
  30737. function exchangeRL(offset, mask) {
  30738. var t = ((this._rBlock >>> offset) ^ this._lBlock) & mask;
  30739. this._lBlock ^= t;
  30740. this._rBlock ^= t << offset;
  30741. }
  30742. /**
  30743. * Shortcut functions to the cipher's object interface.
  30744. *
  30745. * @example
  30746. *
  30747. * var ciphertext = CryptoJS.DES.encrypt(message, key, cfg);
  30748. * var plaintext = CryptoJS.DES.decrypt(ciphertext, key, cfg);
  30749. */
  30750. C.DES = BlockCipher._createHelper(DES);
  30751. /**
  30752. * Triple-DES block cipher algorithm.
  30753. */
  30754. var TripleDES = C_algo.TripleDES = BlockCipher.extend({
  30755. _doReset: function () {
  30756. // Shortcuts
  30757. var key = this._key;
  30758. var keyWords = key.words;
  30759. // Create DES instances
  30760. this._des1 = DES.createEncryptor(WordArray.create(keyWords.slice(0, 2)));
  30761. this._des2 = DES.createEncryptor(WordArray.create(keyWords.slice(2, 4)));
  30762. this._des3 = DES.createEncryptor(WordArray.create(keyWords.slice(4, 6)));
  30763. },
  30764. encryptBlock: function (M, offset) {
  30765. this._des1.encryptBlock(M, offset);
  30766. this._des2.decryptBlock(M, offset);
  30767. this._des3.encryptBlock(M, offset);
  30768. },
  30769. decryptBlock: function (M, offset) {
  30770. this._des3.decryptBlock(M, offset);
  30771. this._des2.encryptBlock(M, offset);
  30772. this._des1.decryptBlock(M, offset);
  30773. },
  30774. keySize: 192/32,
  30775. ivSize: 64/32,
  30776. blockSize: 64/32
  30777. });
  30778. /**
  30779. * Shortcut functions to the cipher's object interface.
  30780. *
  30781. * @example
  30782. *
  30783. * var ciphertext = CryptoJS.TripleDES.encrypt(message, key, cfg);
  30784. * var plaintext = CryptoJS.TripleDES.decrypt(ciphertext, key, cfg);
  30785. */
  30786. C.TripleDES = BlockCipher._createHelper(TripleDES);
  30787. }());
  30788. return CryptoJS.TripleDES;
  30789. }));
  30790. /***/ }),
  30791. /* 298 */
  30792. /***/ (function(module, exports, __webpack_require__) {
  30793. ;(function (root, factory, undef) {
  30794. if (true) {
  30795. // CommonJS
  30796. module.exports = exports = factory(__webpack_require__(1), __webpack_require__(47), __webpack_require__(48), __webpack_require__(33), __webpack_require__(6));
  30797. }
  30798. else {}
  30799. }(this, function (CryptoJS) {
  30800. (function () {
  30801. // Shortcuts
  30802. var C = CryptoJS;
  30803. var C_lib = C.lib;
  30804. var StreamCipher = C_lib.StreamCipher;
  30805. var C_algo = C.algo;
  30806. /**
  30807. * RC4 stream cipher algorithm.
  30808. */
  30809. var RC4 = C_algo.RC4 = StreamCipher.extend({
  30810. _doReset: function () {
  30811. // Shortcuts
  30812. var key = this._key;
  30813. var keyWords = key.words;
  30814. var keySigBytes = key.sigBytes;
  30815. // Init sbox
  30816. var S = this._S = [];
  30817. for (var i = 0; i < 256; i++) {
  30818. S[i] = i;
  30819. }
  30820. // Key setup
  30821. for (var i = 0, j = 0; i < 256; i++) {
  30822. var keyByteIndex = i % keySigBytes;
  30823. var keyByte = (keyWords[keyByteIndex >>> 2] >>> (24 - (keyByteIndex % 4) * 8)) & 0xff;
  30824. j = (j + S[i] + keyByte) % 256;
  30825. // Swap
  30826. var t = S[i];
  30827. S[i] = S[j];
  30828. S[j] = t;
  30829. }
  30830. // Counters
  30831. this._i = this._j = 0;
  30832. },
  30833. _doProcessBlock: function (M, offset) {
  30834. M[offset] ^= generateKeystreamWord.call(this);
  30835. },
  30836. keySize: 256/32,
  30837. ivSize: 0
  30838. });
  30839. function generateKeystreamWord() {
  30840. // Shortcuts
  30841. var S = this._S;
  30842. var i = this._i;
  30843. var j = this._j;
  30844. // Generate keystream word
  30845. var keystreamWord = 0;
  30846. for (var n = 0; n < 4; n++) {
  30847. i = (i + 1) % 256;
  30848. j = (j + S[i]) % 256;
  30849. // Swap
  30850. var t = S[i];
  30851. S[i] = S[j];
  30852. S[j] = t;
  30853. keystreamWord |= S[(S[i] + S[j]) % 256] << (24 - n * 8);
  30854. }
  30855. // Update counters
  30856. this._i = i;
  30857. this._j = j;
  30858. return keystreamWord;
  30859. }
  30860. /**
  30861. * Shortcut functions to the cipher's object interface.
  30862. *
  30863. * @example
  30864. *
  30865. * var ciphertext = CryptoJS.RC4.encrypt(message, key, cfg);
  30866. * var plaintext = CryptoJS.RC4.decrypt(ciphertext, key, cfg);
  30867. */
  30868. C.RC4 = StreamCipher._createHelper(RC4);
  30869. /**
  30870. * Modified RC4 stream cipher algorithm.
  30871. */
  30872. var RC4Drop = C_algo.RC4Drop = RC4.extend({
  30873. /**
  30874. * Configuration options.
  30875. *
  30876. * @property {number} drop The number of keystream words to drop. Default 192
  30877. */
  30878. cfg: RC4.cfg.extend({
  30879. drop: 192
  30880. }),
  30881. _doReset: function () {
  30882. RC4._doReset.call(this);
  30883. // Drop
  30884. for (var i = this.cfg.drop; i > 0; i--) {
  30885. generateKeystreamWord.call(this);
  30886. }
  30887. }
  30888. });
  30889. /**
  30890. * Shortcut functions to the cipher's object interface.
  30891. *
  30892. * @example
  30893. *
  30894. * var ciphertext = CryptoJS.RC4Drop.encrypt(message, key, cfg);
  30895. * var plaintext = CryptoJS.RC4Drop.decrypt(ciphertext, key, cfg);
  30896. */
  30897. C.RC4Drop = StreamCipher._createHelper(RC4Drop);
  30898. }());
  30899. return CryptoJS.RC4;
  30900. }));
  30901. /***/ }),
  30902. /* 299 */
  30903. /***/ (function(module, exports, __webpack_require__) {
  30904. ;(function (root, factory, undef) {
  30905. if (true) {
  30906. // CommonJS
  30907. module.exports = exports = factory(__webpack_require__(1), __webpack_require__(47), __webpack_require__(48), __webpack_require__(33), __webpack_require__(6));
  30908. }
  30909. else {}
  30910. }(this, function (CryptoJS) {
  30911. (function () {
  30912. // Shortcuts
  30913. var C = CryptoJS;
  30914. var C_lib = C.lib;
  30915. var StreamCipher = C_lib.StreamCipher;
  30916. var C_algo = C.algo;
  30917. // Reusable objects
  30918. var S = [];
  30919. var C_ = [];
  30920. var G = [];
  30921. /**
  30922. * Rabbit stream cipher algorithm
  30923. */
  30924. var Rabbit = C_algo.Rabbit = StreamCipher.extend({
  30925. _doReset: function () {
  30926. // Shortcuts
  30927. var K = this._key.words;
  30928. var iv = this.cfg.iv;
  30929. // Swap endian
  30930. for (var i = 0; i < 4; i++) {
  30931. K[i] = (((K[i] << 8) | (K[i] >>> 24)) & 0x00ff00ff) |
  30932. (((K[i] << 24) | (K[i] >>> 8)) & 0xff00ff00);
  30933. }
  30934. // Generate initial state values
  30935. var X = this._X = [
  30936. K[0], (K[3] << 16) | (K[2] >>> 16),
  30937. K[1], (K[0] << 16) | (K[3] >>> 16),
  30938. K[2], (K[1] << 16) | (K[0] >>> 16),
  30939. K[3], (K[2] << 16) | (K[1] >>> 16)
  30940. ];
  30941. // Generate initial counter values
  30942. var C = this._C = [
  30943. (K[2] << 16) | (K[2] >>> 16), (K[0] & 0xffff0000) | (K[1] & 0x0000ffff),
  30944. (K[3] << 16) | (K[3] >>> 16), (K[1] & 0xffff0000) | (K[2] & 0x0000ffff),
  30945. (K[0] << 16) | (K[0] >>> 16), (K[2] & 0xffff0000) | (K[3] & 0x0000ffff),
  30946. (K[1] << 16) | (K[1] >>> 16), (K[3] & 0xffff0000) | (K[0] & 0x0000ffff)
  30947. ];
  30948. // Carry bit
  30949. this._b = 0;
  30950. // Iterate the system four times
  30951. for (var i = 0; i < 4; i++) {
  30952. nextState.call(this);
  30953. }
  30954. // Modify the counters
  30955. for (var i = 0; i < 8; i++) {
  30956. C[i] ^= X[(i + 4) & 7];
  30957. }
  30958. // IV setup
  30959. if (iv) {
  30960. // Shortcuts
  30961. var IV = iv.words;
  30962. var IV_0 = IV[0];
  30963. var IV_1 = IV[1];
  30964. // Generate four subvectors
  30965. var i0 = (((IV_0 << 8) | (IV_0 >>> 24)) & 0x00ff00ff) | (((IV_0 << 24) | (IV_0 >>> 8)) & 0xff00ff00);
  30966. var i2 = (((IV_1 << 8) | (IV_1 >>> 24)) & 0x00ff00ff) | (((IV_1 << 24) | (IV_1 >>> 8)) & 0xff00ff00);
  30967. var i1 = (i0 >>> 16) | (i2 & 0xffff0000);
  30968. var i3 = (i2 << 16) | (i0 & 0x0000ffff);
  30969. // Modify counter values
  30970. C[0] ^= i0;
  30971. C[1] ^= i1;
  30972. C[2] ^= i2;
  30973. C[3] ^= i3;
  30974. C[4] ^= i0;
  30975. C[5] ^= i1;
  30976. C[6] ^= i2;
  30977. C[7] ^= i3;
  30978. // Iterate the system four times
  30979. for (var i = 0; i < 4; i++) {
  30980. nextState.call(this);
  30981. }
  30982. }
  30983. },
  30984. _doProcessBlock: function (M, offset) {
  30985. // Shortcut
  30986. var X = this._X;
  30987. // Iterate the system
  30988. nextState.call(this);
  30989. // Generate four keystream words
  30990. S[0] = X[0] ^ (X[5] >>> 16) ^ (X[3] << 16);
  30991. S[1] = X[2] ^ (X[7] >>> 16) ^ (X[5] << 16);
  30992. S[2] = X[4] ^ (X[1] >>> 16) ^ (X[7] << 16);
  30993. S[3] = X[6] ^ (X[3] >>> 16) ^ (X[1] << 16);
  30994. for (var i = 0; i < 4; i++) {
  30995. // Swap endian
  30996. S[i] = (((S[i] << 8) | (S[i] >>> 24)) & 0x00ff00ff) |
  30997. (((S[i] << 24) | (S[i] >>> 8)) & 0xff00ff00);
  30998. // Encrypt
  30999. M[offset + i] ^= S[i];
  31000. }
  31001. },
  31002. blockSize: 128/32,
  31003. ivSize: 64/32
  31004. });
  31005. function nextState() {
  31006. // Shortcuts
  31007. var X = this._X;
  31008. var C = this._C;
  31009. // Save old counter values
  31010. for (var i = 0; i < 8; i++) {
  31011. C_[i] = C[i];
  31012. }
  31013. // Calculate new counter values
  31014. C[0] = (C[0] + 0x4d34d34d + this._b) | 0;
  31015. C[1] = (C[1] + 0xd34d34d3 + ((C[0] >>> 0) < (C_[0] >>> 0) ? 1 : 0)) | 0;
  31016. C[2] = (C[2] + 0x34d34d34 + ((C[1] >>> 0) < (C_[1] >>> 0) ? 1 : 0)) | 0;
  31017. C[3] = (C[3] + 0x4d34d34d + ((C[2] >>> 0) < (C_[2] >>> 0) ? 1 : 0)) | 0;
  31018. C[4] = (C[4] + 0xd34d34d3 + ((C[3] >>> 0) < (C_[3] >>> 0) ? 1 : 0)) | 0;
  31019. C[5] = (C[5] + 0x34d34d34 + ((C[4] >>> 0) < (C_[4] >>> 0) ? 1 : 0)) | 0;
  31020. C[6] = (C[6] + 0x4d34d34d + ((C[5] >>> 0) < (C_[5] >>> 0) ? 1 : 0)) | 0;
  31021. C[7] = (C[7] + 0xd34d34d3 + ((C[6] >>> 0) < (C_[6] >>> 0) ? 1 : 0)) | 0;
  31022. this._b = (C[7] >>> 0) < (C_[7] >>> 0) ? 1 : 0;
  31023. // Calculate the g-values
  31024. for (var i = 0; i < 8; i++) {
  31025. var gx = X[i] + C[i];
  31026. // Construct high and low argument for squaring
  31027. var ga = gx & 0xffff;
  31028. var gb = gx >>> 16;
  31029. // Calculate high and low result of squaring
  31030. var gh = ((((ga * ga) >>> 17) + ga * gb) >>> 15) + gb * gb;
  31031. var gl = (((gx & 0xffff0000) * gx) | 0) + (((gx & 0x0000ffff) * gx) | 0);
  31032. // High XOR low
  31033. G[i] = gh ^ gl;
  31034. }
  31035. // Calculate new state values
  31036. X[0] = (G[0] + ((G[7] << 16) | (G[7] >>> 16)) + ((G[6] << 16) | (G[6] >>> 16))) | 0;
  31037. X[1] = (G[1] + ((G[0] << 8) | (G[0] >>> 24)) + G[7]) | 0;
  31038. X[2] = (G[2] + ((G[1] << 16) | (G[1] >>> 16)) + ((G[0] << 16) | (G[0] >>> 16))) | 0;
  31039. X[3] = (G[3] + ((G[2] << 8) | (G[2] >>> 24)) + G[1]) | 0;
  31040. X[4] = (G[4] + ((G[3] << 16) | (G[3] >>> 16)) + ((G[2] << 16) | (G[2] >>> 16))) | 0;
  31041. X[5] = (G[5] + ((G[4] << 8) | (G[4] >>> 24)) + G[3]) | 0;
  31042. X[6] = (G[6] + ((G[5] << 16) | (G[5] >>> 16)) + ((G[4] << 16) | (G[4] >>> 16))) | 0;
  31043. X[7] = (G[7] + ((G[6] << 8) | (G[6] >>> 24)) + G[5]) | 0;
  31044. }
  31045. /**
  31046. * Shortcut functions to the cipher's object interface.
  31047. *
  31048. * @example
  31049. *
  31050. * var ciphertext = CryptoJS.Rabbit.encrypt(message, key, cfg);
  31051. * var plaintext = CryptoJS.Rabbit.decrypt(ciphertext, key, cfg);
  31052. */
  31053. C.Rabbit = StreamCipher._createHelper(Rabbit);
  31054. }());
  31055. return CryptoJS.Rabbit;
  31056. }));
  31057. /***/ }),
  31058. /* 300 */
  31059. /***/ (function(module, exports, __webpack_require__) {
  31060. ;(function (root, factory, undef) {
  31061. if (true) {
  31062. // CommonJS
  31063. module.exports = exports = factory(__webpack_require__(1), __webpack_require__(47), __webpack_require__(48), __webpack_require__(33), __webpack_require__(6));
  31064. }
  31065. else {}
  31066. }(this, function (CryptoJS) {
  31067. (function () {
  31068. // Shortcuts
  31069. var C = CryptoJS;
  31070. var C_lib = C.lib;
  31071. var StreamCipher = C_lib.StreamCipher;
  31072. var C_algo = C.algo;
  31073. // Reusable objects
  31074. var S = [];
  31075. var C_ = [];
  31076. var G = [];
  31077. /**
  31078. * Rabbit stream cipher algorithm.
  31079. *
  31080. * This is a legacy version that neglected to convert the key to little-endian.
  31081. * This error doesn't affect the cipher's security,
  31082. * but it does affect its compatibility with other implementations.
  31083. */
  31084. var RabbitLegacy = C_algo.RabbitLegacy = StreamCipher.extend({
  31085. _doReset: function () {
  31086. // Shortcuts
  31087. var K = this._key.words;
  31088. var iv = this.cfg.iv;
  31089. // Generate initial state values
  31090. var X = this._X = [
  31091. K[0], (K[3] << 16) | (K[2] >>> 16),
  31092. K[1], (K[0] << 16) | (K[3] >>> 16),
  31093. K[2], (K[1] << 16) | (K[0] >>> 16),
  31094. K[3], (K[2] << 16) | (K[1] >>> 16)
  31095. ];
  31096. // Generate initial counter values
  31097. var C = this._C = [
  31098. (K[2] << 16) | (K[2] >>> 16), (K[0] & 0xffff0000) | (K[1] & 0x0000ffff),
  31099. (K[3] << 16) | (K[3] >>> 16), (K[1] & 0xffff0000) | (K[2] & 0x0000ffff),
  31100. (K[0] << 16) | (K[0] >>> 16), (K[2] & 0xffff0000) | (K[3] & 0x0000ffff),
  31101. (K[1] << 16) | (K[1] >>> 16), (K[3] & 0xffff0000) | (K[0] & 0x0000ffff)
  31102. ];
  31103. // Carry bit
  31104. this._b = 0;
  31105. // Iterate the system four times
  31106. for (var i = 0; i < 4; i++) {
  31107. nextState.call(this);
  31108. }
  31109. // Modify the counters
  31110. for (var i = 0; i < 8; i++) {
  31111. C[i] ^= X[(i + 4) & 7];
  31112. }
  31113. // IV setup
  31114. if (iv) {
  31115. // Shortcuts
  31116. var IV = iv.words;
  31117. var IV_0 = IV[0];
  31118. var IV_1 = IV[1];
  31119. // Generate four subvectors
  31120. var i0 = (((IV_0 << 8) | (IV_0 >>> 24)) & 0x00ff00ff) | (((IV_0 << 24) | (IV_0 >>> 8)) & 0xff00ff00);
  31121. var i2 = (((IV_1 << 8) | (IV_1 >>> 24)) & 0x00ff00ff) | (((IV_1 << 24) | (IV_1 >>> 8)) & 0xff00ff00);
  31122. var i1 = (i0 >>> 16) | (i2 & 0xffff0000);
  31123. var i3 = (i2 << 16) | (i0 & 0x0000ffff);
  31124. // Modify counter values
  31125. C[0] ^= i0;
  31126. C[1] ^= i1;
  31127. C[2] ^= i2;
  31128. C[3] ^= i3;
  31129. C[4] ^= i0;
  31130. C[5] ^= i1;
  31131. C[6] ^= i2;
  31132. C[7] ^= i3;
  31133. // Iterate the system four times
  31134. for (var i = 0; i < 4; i++) {
  31135. nextState.call(this);
  31136. }
  31137. }
  31138. },
  31139. _doProcessBlock: function (M, offset) {
  31140. // Shortcut
  31141. var X = this._X;
  31142. // Iterate the system
  31143. nextState.call(this);
  31144. // Generate four keystream words
  31145. S[0] = X[0] ^ (X[5] >>> 16) ^ (X[3] << 16);
  31146. S[1] = X[2] ^ (X[7] >>> 16) ^ (X[5] << 16);
  31147. S[2] = X[4] ^ (X[1] >>> 16) ^ (X[7] << 16);
  31148. S[3] = X[6] ^ (X[3] >>> 16) ^ (X[1] << 16);
  31149. for (var i = 0; i < 4; i++) {
  31150. // Swap endian
  31151. S[i] = (((S[i] << 8) | (S[i] >>> 24)) & 0x00ff00ff) |
  31152. (((S[i] << 24) | (S[i] >>> 8)) & 0xff00ff00);
  31153. // Encrypt
  31154. M[offset + i] ^= S[i];
  31155. }
  31156. },
  31157. blockSize: 128/32,
  31158. ivSize: 64/32
  31159. });
  31160. function nextState() {
  31161. // Shortcuts
  31162. var X = this._X;
  31163. var C = this._C;
  31164. // Save old counter values
  31165. for (var i = 0; i < 8; i++) {
  31166. C_[i] = C[i];
  31167. }
  31168. // Calculate new counter values
  31169. C[0] = (C[0] + 0x4d34d34d + this._b) | 0;
  31170. C[1] = (C[1] + 0xd34d34d3 + ((C[0] >>> 0) < (C_[0] >>> 0) ? 1 : 0)) | 0;
  31171. C[2] = (C[2] + 0x34d34d34 + ((C[1] >>> 0) < (C_[1] >>> 0) ? 1 : 0)) | 0;
  31172. C[3] = (C[3] + 0x4d34d34d + ((C[2] >>> 0) < (C_[2] >>> 0) ? 1 : 0)) | 0;
  31173. C[4] = (C[4] + 0xd34d34d3 + ((C[3] >>> 0) < (C_[3] >>> 0) ? 1 : 0)) | 0;
  31174. C[5] = (C[5] + 0x34d34d34 + ((C[4] >>> 0) < (C_[4] >>> 0) ? 1 : 0)) | 0;
  31175. C[6] = (C[6] + 0x4d34d34d + ((C[5] >>> 0) < (C_[5] >>> 0) ? 1 : 0)) | 0;
  31176. C[7] = (C[7] + 0xd34d34d3 + ((C[6] >>> 0) < (C_[6] >>> 0) ? 1 : 0)) | 0;
  31177. this._b = (C[7] >>> 0) < (C_[7] >>> 0) ? 1 : 0;
  31178. // Calculate the g-values
  31179. for (var i = 0; i < 8; i++) {
  31180. var gx = X[i] + C[i];
  31181. // Construct high and low argument for squaring
  31182. var ga = gx & 0xffff;
  31183. var gb = gx >>> 16;
  31184. // Calculate high and low result of squaring
  31185. var gh = ((((ga * ga) >>> 17) + ga * gb) >>> 15) + gb * gb;
  31186. var gl = (((gx & 0xffff0000) * gx) | 0) + (((gx & 0x0000ffff) * gx) | 0);
  31187. // High XOR low
  31188. G[i] = gh ^ gl;
  31189. }
  31190. // Calculate new state values
  31191. X[0] = (G[0] + ((G[7] << 16) | (G[7] >>> 16)) + ((G[6] << 16) | (G[6] >>> 16))) | 0;
  31192. X[1] = (G[1] + ((G[0] << 8) | (G[0] >>> 24)) + G[7]) | 0;
  31193. X[2] = (G[2] + ((G[1] << 16) | (G[1] >>> 16)) + ((G[0] << 16) | (G[0] >>> 16))) | 0;
  31194. X[3] = (G[3] + ((G[2] << 8) | (G[2] >>> 24)) + G[1]) | 0;
  31195. X[4] = (G[4] + ((G[3] << 16) | (G[3] >>> 16)) + ((G[2] << 16) | (G[2] >>> 16))) | 0;
  31196. X[5] = (G[5] + ((G[4] << 8) | (G[4] >>> 24)) + G[3]) | 0;
  31197. X[6] = (G[6] + ((G[5] << 16) | (G[5] >>> 16)) + ((G[4] << 16) | (G[4] >>> 16))) | 0;
  31198. X[7] = (G[7] + ((G[6] << 8) | (G[6] >>> 24)) + G[5]) | 0;
  31199. }
  31200. /**
  31201. * Shortcut functions to the cipher's object interface.
  31202. *
  31203. * @example
  31204. *
  31205. * var ciphertext = CryptoJS.RabbitLegacy.encrypt(message, key, cfg);
  31206. * var plaintext = CryptoJS.RabbitLegacy.decrypt(ciphertext, key, cfg);
  31207. */
  31208. C.RabbitLegacy = StreamCipher._createHelper(RabbitLegacy);
  31209. }());
  31210. return CryptoJS.RabbitLegacy;
  31211. }));
  31212. /***/ }),
  31213. /* 301 */
  31214. /***/ (function(module, exports, __webpack_require__) {
  31215. "use strict";
  31216. /* WEBPACK VAR INJECTION */(function(Buffer, process) {
  31217. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  31218. var r = _interopDefault(__webpack_require__(302));
  31219. var _Object$getOwnPropertyDescriptor = _interopDefault(__webpack_require__(332));
  31220. var _getIterator = _interopDefault(__webpack_require__(335));
  31221. var _Object$freeze = _interopDefault(__webpack_require__(345));
  31222. var _typeof = _interopDefault(__webpack_require__(122));
  31223. var _Object$keys = _interopDefault(__webpack_require__(357));
  31224. var _Object$defineProperty = _interopDefault(__webpack_require__(191));
  31225. var _classCallCheck = _interopDefault(__webpack_require__(362));
  31226. var _createClass = _interopDefault(__webpack_require__(363));
  31227. var _Map = _interopDefault(__webpack_require__(364));
  31228. var _possibleConstructorReturn = _interopDefault(__webpack_require__(375));
  31229. var _inherits = _interopDefault(__webpack_require__(376));
  31230. var restructure_src_utils = __webpack_require__(26);
  31231. var _Object$defineProperties = _interopDefault(__webpack_require__(384));
  31232. var isEqual = _interopDefault(__webpack_require__(387));
  31233. var _Object$assign = _interopDefault(__webpack_require__(401));
  31234. var _String$fromCodePoint = _interopDefault(__webpack_require__(405));
  31235. var _Array$from = _interopDefault(__webpack_require__(408));
  31236. var _Set = _interopDefault(__webpack_require__(413));
  31237. var unicode = _interopDefault(__webpack_require__(419));
  31238. var UnicodeTrie = _interopDefault(__webpack_require__(424));
  31239. var StateMachine = _interopDefault(__webpack_require__(425));
  31240. var _Number$EPSILON = _interopDefault(__webpack_require__(427));
  31241. var cloneDeep = _interopDefault(__webpack_require__(430));
  31242. var inflate = _interopDefault(__webpack_require__(83));
  31243. var brotli = _interopDefault(__webpack_require__(431));
  31244. var fontkit = {};
  31245. fontkit.logErrors = false;
  31246. var formats = [];
  31247. fontkit.registerFormat = function (format) {
  31248. formats.push(format);
  31249. };
  31250. fontkit.openSync = function (filename, postscriptName) {
  31251. var buffer = fs.readFileSync(filename);
  31252. return fontkit.create(buffer, postscriptName);
  31253. };
  31254. fontkit.open = function (filename, postscriptName, callback) {
  31255. if (typeof postscriptName === 'function') {
  31256. callback = postscriptName;
  31257. postscriptName = null;
  31258. }
  31259. fs.readFile(filename, function (err, buffer) {
  31260. if (err) {
  31261. return callback(err);
  31262. }
  31263. try {
  31264. var font = fontkit.create(buffer, postscriptName);
  31265. } catch (e) {
  31266. return callback(e);
  31267. }
  31268. return callback(null, font);
  31269. });
  31270. return;
  31271. };
  31272. fontkit.create = function (buffer, postscriptName) {
  31273. for (var i = 0; i < formats.length; i++) {
  31274. var format = formats[i];
  31275. if (format.probe(buffer)) {
  31276. var font = new format(new r.DecodeStream(buffer));
  31277. if (postscriptName) {
  31278. return font.getFont(postscriptName);
  31279. }
  31280. return font;
  31281. }
  31282. }
  31283. throw new Error('Unknown font format');
  31284. };
  31285. fontkit.defaultLanguage = 'en';
  31286. fontkit.setDefaultLanguage = function () {
  31287. var lang = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'en';
  31288. fontkit.defaultLanguage = lang;
  31289. };
  31290. /**
  31291. * This decorator caches the results of a getter or method such that
  31292. * the results are lazily computed once, and then cached.
  31293. * @private
  31294. */
  31295. function cache(target, key, descriptor) {
  31296. if (descriptor.get) {
  31297. var get = descriptor.get;
  31298. descriptor.get = function () {
  31299. var value = get.call(this);
  31300. _Object$defineProperty(this, key, { value: value });
  31301. return value;
  31302. };
  31303. } else if (typeof descriptor.value === 'function') {
  31304. var fn = descriptor.value;
  31305. return {
  31306. get: function get() {
  31307. var cache = new _Map();
  31308. function memoized() {
  31309. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  31310. args[_key] = arguments[_key];
  31311. }
  31312. var key = args.length > 0 ? args[0] : 'value';
  31313. if (cache.has(key)) {
  31314. return cache.get(key);
  31315. }
  31316. var result = fn.apply(this, args);
  31317. cache.set(key, result);
  31318. return result;
  31319. };
  31320. _Object$defineProperty(this, key, { value: memoized });
  31321. return memoized;
  31322. }
  31323. };
  31324. }
  31325. }
  31326. var SubHeader = new r.Struct({
  31327. firstCode: r.uint16,
  31328. entryCount: r.uint16,
  31329. idDelta: r.int16,
  31330. idRangeOffset: r.uint16
  31331. });
  31332. var CmapGroup = new r.Struct({
  31333. startCharCode: r.uint32,
  31334. endCharCode: r.uint32,
  31335. glyphID: r.uint32
  31336. });
  31337. var UnicodeValueRange = new r.Struct({
  31338. startUnicodeValue: r.uint24,
  31339. additionalCount: r.uint8
  31340. });
  31341. var UVSMapping = new r.Struct({
  31342. unicodeValue: r.uint24,
  31343. glyphID: r.uint16
  31344. });
  31345. var DefaultUVS = new r.Array(UnicodeValueRange, r.uint32);
  31346. var NonDefaultUVS = new r.Array(UVSMapping, r.uint32);
  31347. var VarSelectorRecord = new r.Struct({
  31348. varSelector: r.uint24,
  31349. defaultUVS: new r.Pointer(r.uint32, DefaultUVS, { type: 'parent' }),
  31350. nonDefaultUVS: new r.Pointer(r.uint32, NonDefaultUVS, { type: 'parent' })
  31351. });
  31352. var CmapSubtable = new r.VersionedStruct(r.uint16, {
  31353. 0: { // Byte encoding
  31354. length: r.uint16, // Total table length in bytes (set to 262 for format 0)
  31355. language: r.uint16, // Language code for this encoding subtable, or zero if language-independent
  31356. codeMap: new r.LazyArray(r.uint8, 256)
  31357. },
  31358. 2: { // High-byte mapping (CJK)
  31359. length: r.uint16,
  31360. language: r.uint16,
  31361. subHeaderKeys: new r.Array(r.uint16, 256),
  31362. subHeaderCount: function subHeaderCount(t) {
  31363. return Math.max.apply(Math, t.subHeaderKeys);
  31364. },
  31365. subHeaders: new r.LazyArray(SubHeader, 'subHeaderCount'),
  31366. glyphIndexArray: new r.LazyArray(r.uint16, 'subHeaderCount')
  31367. },
  31368. 4: { // Segment mapping to delta values
  31369. length: r.uint16, // Total table length in bytes
  31370. language: r.uint16, // Language code
  31371. segCountX2: r.uint16,
  31372. segCount: function segCount(t) {
  31373. return t.segCountX2 >> 1;
  31374. },
  31375. searchRange: r.uint16,
  31376. entrySelector: r.uint16,
  31377. rangeShift: r.uint16,
  31378. endCode: new r.LazyArray(r.uint16, 'segCount'),
  31379. reservedPad: new r.Reserved(r.uint16), // This value should be zero
  31380. startCode: new r.LazyArray(r.uint16, 'segCount'),
  31381. idDelta: new r.LazyArray(r.int16, 'segCount'),
  31382. idRangeOffset: new r.LazyArray(r.uint16, 'segCount'),
  31383. glyphIndexArray: new r.LazyArray(r.uint16, function (t) {
  31384. return (t.length - t._currentOffset) / 2;
  31385. })
  31386. },
  31387. 6: { // Trimmed table
  31388. length: r.uint16,
  31389. language: r.uint16,
  31390. firstCode: r.uint16,
  31391. entryCount: r.uint16,
  31392. glyphIndices: new r.LazyArray(r.uint16, 'entryCount')
  31393. },
  31394. 8: { // mixed 16-bit and 32-bit coverage
  31395. reserved: new r.Reserved(r.uint16),
  31396. length: r.uint32,
  31397. language: r.uint16,
  31398. is32: new r.LazyArray(r.uint8, 8192),
  31399. nGroups: r.uint32,
  31400. groups: new r.LazyArray(CmapGroup, 'nGroups')
  31401. },
  31402. 10: { // Trimmed Array
  31403. reserved: new r.Reserved(r.uint16),
  31404. length: r.uint32,
  31405. language: r.uint32,
  31406. firstCode: r.uint32,
  31407. entryCount: r.uint32,
  31408. glyphIndices: new r.LazyArray(r.uint16, 'numChars')
  31409. },
  31410. 12: { // Segmented coverage
  31411. reserved: new r.Reserved(r.uint16),
  31412. length: r.uint32,
  31413. language: r.uint32,
  31414. nGroups: r.uint32,
  31415. groups: new r.LazyArray(CmapGroup, 'nGroups')
  31416. },
  31417. 13: { // Many-to-one range mappings (same as 12 except for group.startGlyphID)
  31418. reserved: new r.Reserved(r.uint16),
  31419. length: r.uint32,
  31420. language: r.uint32,
  31421. nGroups: r.uint32,
  31422. groups: new r.LazyArray(CmapGroup, 'nGroups')
  31423. },
  31424. 14: { // Unicode Variation Sequences
  31425. length: r.uint32,
  31426. numRecords: r.uint32,
  31427. varSelectors: new r.LazyArray(VarSelectorRecord, 'numRecords')
  31428. }
  31429. });
  31430. var CmapEntry = new r.Struct({
  31431. platformID: r.uint16, // Platform identifier
  31432. encodingID: r.uint16, // Platform-specific encoding identifier
  31433. table: new r.Pointer(r.uint32, CmapSubtable, { type: 'parent', lazy: true })
  31434. });
  31435. // character to glyph mapping
  31436. var cmap = new r.Struct({
  31437. version: r.uint16,
  31438. numSubtables: r.uint16,
  31439. tables: new r.Array(CmapEntry, 'numSubtables')
  31440. });
  31441. // font header
  31442. var head = new r.Struct({
  31443. version: r.int32, // 0x00010000 (version 1.0)
  31444. revision: r.int32, // set by font manufacturer
  31445. checkSumAdjustment: r.uint32,
  31446. magicNumber: r.uint32, // set to 0x5F0F3CF5
  31447. flags: r.uint16,
  31448. unitsPerEm: r.uint16, // range from 64 to 16384
  31449. created: new r.Array(r.int32, 2),
  31450. modified: new r.Array(r.int32, 2),
  31451. xMin: r.int16, // for all glyph bounding boxes
  31452. yMin: r.int16, // for all glyph bounding boxes
  31453. xMax: r.int16, // for all glyph bounding boxes
  31454. yMax: r.int16, // for all glyph bounding boxes
  31455. macStyle: new r.Bitfield(r.uint16, ['bold', 'italic', 'underline', 'outline', 'shadow', 'condensed', 'extended']),
  31456. lowestRecPPEM: r.uint16, // smallest readable size in pixels
  31457. fontDirectionHint: r.int16,
  31458. indexToLocFormat: r.int16, // 0 for short offsets, 1 for long
  31459. glyphDataFormat: r.int16 // 0 for current format
  31460. });
  31461. // horizontal header
  31462. var hhea = new r.Struct({
  31463. version: r.int32,
  31464. ascent: r.int16, // Distance from baseline of highest ascender
  31465. descent: r.int16, // Distance from baseline of lowest descender
  31466. lineGap: r.int16, // Typographic line gap
  31467. advanceWidthMax: r.uint16, // Maximum advance width value in 'hmtx' table
  31468. minLeftSideBearing: r.int16, // Maximum advance width value in 'hmtx' table
  31469. minRightSideBearing: r.int16, // Minimum right sidebearing value
  31470. xMaxExtent: r.int16,
  31471. caretSlopeRise: r.int16, // Used to calculate the slope of the cursor (rise/run); 1 for vertical
  31472. caretSlopeRun: r.int16, // 0 for vertical
  31473. caretOffset: r.int16, // Set to 0 for non-slanted fonts
  31474. reserved: new r.Reserved(r.int16, 4),
  31475. metricDataFormat: r.int16, // 0 for current format
  31476. numberOfMetrics: r.uint16 // Number of advance widths in 'hmtx' table
  31477. });
  31478. var HmtxEntry = new r.Struct({
  31479. advance: r.uint16,
  31480. bearing: r.int16
  31481. });
  31482. var hmtx = new r.Struct({
  31483. metrics: new r.LazyArray(HmtxEntry, function (t) {
  31484. return t.parent.hhea.numberOfMetrics;
  31485. }),
  31486. bearings: new r.LazyArray(r.int16, function (t) {
  31487. return t.parent.maxp.numGlyphs - t.parent.hhea.numberOfMetrics;
  31488. })
  31489. });
  31490. // maxiumum profile
  31491. var maxp = new r.Struct({
  31492. version: r.int32,
  31493. numGlyphs: r.uint16, // The number of glyphs in the font
  31494. maxPoints: r.uint16, // Maximum points in a non-composite glyph
  31495. maxContours: r.uint16, // Maximum contours in a non-composite glyph
  31496. maxComponentPoints: r.uint16, // Maximum points in a composite glyph
  31497. maxComponentContours: r.uint16, // Maximum contours in a composite glyph
  31498. maxZones: r.uint16, // 1 if instructions do not use the twilight zone, 2 otherwise
  31499. maxTwilightPoints: r.uint16, // Maximum points used in Z0
  31500. maxStorage: r.uint16, // Number of Storage Area locations
  31501. maxFunctionDefs: r.uint16, // Number of FDEFs
  31502. maxInstructionDefs: r.uint16, // Number of IDEFs
  31503. maxStackElements: r.uint16, // Maximum stack depth
  31504. maxSizeOfInstructions: r.uint16, // Maximum byte count for glyph instructions
  31505. maxComponentElements: r.uint16, // Maximum number of components referenced at “top level” for any composite glyph
  31506. maxComponentDepth: r.uint16 // Maximum levels of recursion; 1 for simple components
  31507. });
  31508. /**
  31509. * Gets an encoding name from platform, encoding, and language ids.
  31510. * Returned encoding names can be used in iconv-lite to decode text.
  31511. */
  31512. function getEncoding(platformID, encodingID) {
  31513. var languageID = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
  31514. if (platformID === 1 && MAC_LANGUAGE_ENCODINGS[languageID]) {
  31515. return MAC_LANGUAGE_ENCODINGS[languageID];
  31516. }
  31517. return ENCODINGS[platformID][encodingID];
  31518. }
  31519. // Map of platform ids to encoding ids.
  31520. var ENCODINGS = [
  31521. // unicode
  31522. ['utf16be', 'utf16be', 'utf16be', 'utf16be', 'utf16be', 'utf16be'],
  31523. // macintosh
  31524. // Mappings available at http://unicode.org/Public/MAPPINGS/VENDORS/APPLE/
  31525. // 0 Roman 17 Malayalam
  31526. // 1 Japanese 18 Sinhalese
  31527. // 2 Traditional Chinese 19 Burmese
  31528. // 3 Korean 20 Khmer
  31529. // 4 Arabic 21 Thai
  31530. // 5 Hebrew 22 Laotian
  31531. // 6 Greek 23 Georgian
  31532. // 7 Russian 24 Armenian
  31533. // 8 RSymbol 25 Simplified Chinese
  31534. // 9 Devanagari 26 Tibetan
  31535. // 10 Gurmukhi 27 Mongolian
  31536. // 11 Gujarati 28 Geez
  31537. // 12 Oriya 29 Slavic
  31538. // 13 Bengali 30 Vietnamese
  31539. // 14 Tamil 31 Sindhi
  31540. // 15 Telugu 32 (Uninterpreted)
  31541. // 16 Kannada
  31542. ['macroman', 'shift-jis', 'big5', 'euc-kr', 'iso-8859-6', 'iso-8859-8', 'macgreek', 'maccyrillic', 'symbol', 'Devanagari', 'Gurmukhi', 'Gujarati', 'Oriya', 'Bengali', 'Tamil', 'Telugu', 'Kannada', 'Malayalam', 'Sinhalese', 'Burmese', 'Khmer', 'macthai', 'Laotian', 'Georgian', 'Armenian', 'gb-2312-80', 'Tibetan', 'Mongolian', 'Geez', 'maccenteuro', 'Vietnamese', 'Sindhi'],
  31543. // ISO (deprecated)
  31544. ['ascii'],
  31545. // windows
  31546. // Docs here: http://msdn.microsoft.com/en-us/library/system.text.encoding(v=vs.110).aspx
  31547. ['symbol', 'utf16be', 'shift-jis', 'gb18030', 'big5', 'wansung', 'johab', null, null, null, 'utf16be']];
  31548. // Overrides for Mac scripts by language id.
  31549. // See http://unicode.org/Public/MAPPINGS/VENDORS/APPLE/Readme.txt
  31550. var MAC_LANGUAGE_ENCODINGS = {
  31551. 15: 'maciceland',
  31552. 17: 'macturkish',
  31553. 18: 'maccroatian',
  31554. 24: 'maccenteuro',
  31555. 25: 'maccenteuro',
  31556. 26: 'maccenteuro',
  31557. 27: 'maccenteuro',
  31558. 28: 'maccenteuro',
  31559. 30: 'maciceland',
  31560. 37: 'macromania',
  31561. 38: 'maccenteuro',
  31562. 39: 'maccenteuro',
  31563. 40: 'maccenteuro',
  31564. 143: 'macinuit', // Unsupported by iconv-lite
  31565. 146: 'macgaelic' // Unsupported by iconv-lite
  31566. };
  31567. // Map of platform ids to BCP-47 language codes.
  31568. var LANGUAGES = [
  31569. // unicode
  31570. [], { // macintosh
  31571. 0: 'en', 30: 'fo', 60: 'ks', 90: 'rw',
  31572. 1: 'fr', 31: 'fa', 61: 'ku', 91: 'rn',
  31573. 2: 'de', 32: 'ru', 62: 'sd', 92: 'ny',
  31574. 3: 'it', 33: 'zh', 63: 'bo', 93: 'mg',
  31575. 4: 'nl', 34: 'nl-BE', 64: 'ne', 94: 'eo',
  31576. 5: 'sv', 35: 'ga', 65: 'sa', 128: 'cy',
  31577. 6: 'es', 36: 'sq', 66: 'mr', 129: 'eu',
  31578. 7: 'da', 37: 'ro', 67: 'bn', 130: 'ca',
  31579. 8: 'pt', 38: 'cz', 68: 'as', 131: 'la',
  31580. 9: 'no', 39: 'sk', 69: 'gu', 132: 'qu',
  31581. 10: 'he', 40: 'si', 70: 'pa', 133: 'gn',
  31582. 11: 'ja', 41: 'yi', 71: 'or', 134: 'ay',
  31583. 12: 'ar', 42: 'sr', 72: 'ml', 135: 'tt',
  31584. 13: 'fi', 43: 'mk', 73: 'kn', 136: 'ug',
  31585. 14: 'el', 44: 'bg', 74: 'ta', 137: 'dz',
  31586. 15: 'is', 45: 'uk', 75: 'te', 138: 'jv',
  31587. 16: 'mt', 46: 'be', 76: 'si', 139: 'su',
  31588. 17: 'tr', 47: 'uz', 77: 'my', 140: 'gl',
  31589. 18: 'hr', 48: 'kk', 78: 'km', 141: 'af',
  31590. 19: 'zh-Hant', 49: 'az-Cyrl', 79: 'lo', 142: 'br',
  31591. 20: 'ur', 50: 'az-Arab', 80: 'vi', 143: 'iu',
  31592. 21: 'hi', 51: 'hy', 81: 'id', 144: 'gd',
  31593. 22: 'th', 52: 'ka', 82: 'tl', 145: 'gv',
  31594. 23: 'ko', 53: 'mo', 83: 'ms', 146: 'ga',
  31595. 24: 'lt', 54: 'ky', 84: 'ms-Arab', 147: 'to',
  31596. 25: 'pl', 55: 'tg', 85: 'am', 148: 'el-polyton',
  31597. 26: 'hu', 56: 'tk', 86: 'ti', 149: 'kl',
  31598. 27: 'es', 57: 'mn-CN', 87: 'om', 150: 'az',
  31599. 28: 'lv', 58: 'mn', 88: 'so', 151: 'nn',
  31600. 29: 'se', 59: 'ps', 89: 'sw'
  31601. },
  31602. // ISO (deprecated)
  31603. [], { // windows
  31604. 0x0436: 'af', 0x4009: 'en-IN', 0x0487: 'rw', 0x0432: 'tn',
  31605. 0x041C: 'sq', 0x1809: 'en-IE', 0x0441: 'sw', 0x045B: 'si',
  31606. 0x0484: 'gsw', 0x2009: 'en-JM', 0x0457: 'kok', 0x041B: 'sk',
  31607. 0x045E: 'am', 0x4409: 'en-MY', 0x0412: 'ko', 0x0424: 'sl',
  31608. 0x1401: 'ar-DZ', 0x1409: 'en-NZ', 0x0440: 'ky', 0x2C0A: 'es-AR',
  31609. 0x3C01: 'ar-BH', 0x3409: 'en-PH', 0x0454: 'lo', 0x400A: 'es-BO',
  31610. 0x0C01: 'ar', 0x4809: 'en-SG', 0x0426: 'lv', 0x340A: 'es-CL',
  31611. 0x0801: 'ar-IQ', 0x1C09: 'en-ZA', 0x0427: 'lt', 0x240A: 'es-CO',
  31612. 0x2C01: 'ar-JO', 0x2C09: 'en-TT', 0x082E: 'dsb', 0x140A: 'es-CR',
  31613. 0x3401: 'ar-KW', 0x0809: 'en-GB', 0x046E: 'lb', 0x1C0A: 'es-DO',
  31614. 0x3001: 'ar-LB', 0x0409: 'en', 0x042F: 'mk', 0x300A: 'es-EC',
  31615. 0x1001: 'ar-LY', 0x3009: 'en-ZW', 0x083E: 'ms-BN', 0x440A: 'es-SV',
  31616. 0x1801: 'ary', 0x0425: 'et', 0x043E: 'ms', 0x100A: 'es-GT',
  31617. 0x2001: 'ar-OM', 0x0438: 'fo', 0x044C: 'ml', 0x480A: 'es-HN',
  31618. 0x4001: 'ar-QA', 0x0464: 'fil', 0x043A: 'mt', 0x080A: 'es-MX',
  31619. 0x0401: 'ar-SA', 0x040B: 'fi', 0x0481: 'mi', 0x4C0A: 'es-NI',
  31620. 0x2801: 'ar-SY', 0x080C: 'fr-BE', 0x047A: 'arn', 0x180A: 'es-PA',
  31621. 0x1C01: 'aeb', 0x0C0C: 'fr-CA', 0x044E: 'mr', 0x3C0A: 'es-PY',
  31622. 0x3801: 'ar-AE', 0x040C: 'fr', 0x047C: 'moh', 0x280A: 'es-PE',
  31623. 0x2401: 'ar-YE', 0x140C: 'fr-LU', 0x0450: 'mn', 0x500A: 'es-PR',
  31624. 0x042B: 'hy', 0x180C: 'fr-MC', 0x0850: 'mn-CN', 0x0C0A: 'es',
  31625. 0x044D: 'as', 0x100C: 'fr-CH', 0x0461: 'ne', 0x040A: 'es',
  31626. 0x082C: 'az-Cyrl', 0x0462: 'fy', 0x0414: 'nb', 0x540A: 'es-US',
  31627. 0x042C: 'az', 0x0456: 'gl', 0x0814: 'nn', 0x380A: 'es-UY',
  31628. 0x046D: 'ba', 0x0437: 'ka', 0x0482: 'oc', 0x200A: 'es-VE',
  31629. 0x042D: 'eu', 0x0C07: 'de-AT', 0x0448: 'or', 0x081D: 'sv-FI',
  31630. 0x0423: 'be', 0x0407: 'de', 0x0463: 'ps', 0x041D: 'sv',
  31631. 0x0845: 'bn', 0x1407: 'de-LI', 0x0415: 'pl', 0x045A: 'syr',
  31632. 0x0445: 'bn-IN', 0x1007: 'de-LU', 0x0416: 'pt', 0x0428: 'tg',
  31633. 0x201A: 'bs-Cyrl', 0x0807: 'de-CH', 0x0816: 'pt-PT', 0x085F: 'tzm',
  31634. 0x141A: 'bs', 0x0408: 'el', 0x0446: 'pa', 0x0449: 'ta',
  31635. 0x047E: 'br', 0x046F: 'kl', 0x046B: 'qu-BO', 0x0444: 'tt',
  31636. 0x0402: 'bg', 0x0447: 'gu', 0x086B: 'qu-EC', 0x044A: 'te',
  31637. 0x0403: 'ca', 0x0468: 'ha', 0x0C6B: 'qu', 0x041E: 'th',
  31638. 0x0C04: 'zh-HK', 0x040D: 'he', 0x0418: 'ro', 0x0451: 'bo',
  31639. 0x1404: 'zh-MO', 0x0439: 'hi', 0x0417: 'rm', 0x041F: 'tr',
  31640. 0x0804: 'zh', 0x040E: 'hu', 0x0419: 'ru', 0x0442: 'tk',
  31641. 0x1004: 'zh-SG', 0x040F: 'is', 0x243B: 'smn', 0x0480: 'ug',
  31642. 0x0404: 'zh-TW', 0x0470: 'ig', 0x103B: 'smj-NO', 0x0422: 'uk',
  31643. 0x0483: 'co', 0x0421: 'id', 0x143B: 'smj', 0x042E: 'hsb',
  31644. 0x041A: 'hr', 0x045D: 'iu', 0x0C3B: 'se-FI', 0x0420: 'ur',
  31645. 0x101A: 'hr-BA', 0x085D: 'iu-Latn', 0x043B: 'se', 0x0843: 'uz-Cyrl',
  31646. 0x0405: 'cs', 0x083C: 'ga', 0x083B: 'se-SE', 0x0443: 'uz',
  31647. 0x0406: 'da', 0x0434: 'xh', 0x203B: 'sms', 0x042A: 'vi',
  31648. 0x048C: 'prs', 0x0435: 'zu', 0x183B: 'sma-NO', 0x0452: 'cy',
  31649. 0x0465: 'dv', 0x0410: 'it', 0x1C3B: 'sms', 0x0488: 'wo',
  31650. 0x0813: 'nl-BE', 0x0810: 'it-CH', 0x044F: 'sa', 0x0485: 'sah',
  31651. 0x0413: 'nl', 0x0411: 'ja', 0x1C1A: 'sr-Cyrl-BA', 0x0478: 'ii',
  31652. 0x0C09: 'en-AU', 0x044B: 'kn', 0x0C1A: 'sr', 0x046A: 'yo',
  31653. 0x2809: 'en-BZ', 0x043F: 'kk', 0x181A: 'sr-Latn-BA',
  31654. 0x1009: 'en-CA', 0x0453: 'km', 0x081A: 'sr-Latn',
  31655. 0x2409: 'en-029', 0x0486: 'quc', 0x046C: 'nso'
  31656. }];
  31657. var NameRecord = new r.Struct({
  31658. platformID: r.uint16,
  31659. encodingID: r.uint16,
  31660. languageID: r.uint16,
  31661. nameID: r.uint16,
  31662. length: r.uint16,
  31663. string: new r.Pointer(r.uint16, new r.String('length', function (t) {
  31664. return getEncoding(t.platformID, t.encodingID, t.languageID);
  31665. }), { type: 'parent', relativeTo: 'parent.stringOffset', allowNull: false })
  31666. });
  31667. var LangTagRecord = new r.Struct({
  31668. length: r.uint16,
  31669. tag: new r.Pointer(r.uint16, new r.String('length', 'utf16be'), { type: 'parent', relativeTo: 'stringOffset' })
  31670. });
  31671. var NameTable = new r.VersionedStruct(r.uint16, {
  31672. 0: {
  31673. count: r.uint16,
  31674. stringOffset: r.uint16,
  31675. records: new r.Array(NameRecord, 'count')
  31676. },
  31677. 1: {
  31678. count: r.uint16,
  31679. stringOffset: r.uint16,
  31680. records: new r.Array(NameRecord, 'count'),
  31681. langTagCount: r.uint16,
  31682. langTags: new r.Array(LangTagRecord, 'langTagCount')
  31683. }
  31684. });
  31685. var NAMES = ['copyright', 'fontFamily', 'fontSubfamily', 'uniqueSubfamily', 'fullName', 'version', 'postscriptName', // Note: A font may have only one PostScript name and that name must be ASCII.
  31686. 'trademark', 'manufacturer', 'designer', 'description', 'vendorURL', 'designerURL', 'license', 'licenseURL', null, // reserved
  31687. 'preferredFamily', 'preferredSubfamily', 'compatibleFull', 'sampleText', 'postscriptCIDFontName', 'wwsFamilyName', 'wwsSubfamilyName'];
  31688. NameTable.process = function (stream) {
  31689. var records = {};
  31690. for (var _iterator = this.records, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _getIterator(_iterator);;) {
  31691. var _ref;
  31692. if (_isArray) {
  31693. if (_i >= _iterator.length) break;
  31694. _ref = _iterator[_i++];
  31695. } else {
  31696. _i = _iterator.next();
  31697. if (_i.done) break;
  31698. _ref = _i.value;
  31699. }
  31700. var record = _ref;
  31701. // find out what language this is for
  31702. var language = LANGUAGES[record.platformID][record.languageID];
  31703. if (language == null && this.langTags != null && record.languageID >= 0x8000) {
  31704. language = this.langTags[record.languageID - 0x8000].tag;
  31705. }
  31706. if (language == null) {
  31707. language = record.platformID + '-' + record.languageID;
  31708. }
  31709. // if the nameID is >= 256, it is a font feature record (AAT)
  31710. var key = record.nameID >= 256 ? 'fontFeatures' : NAMES[record.nameID] || record.nameID;
  31711. if (records[key] == null) {
  31712. records[key] = {};
  31713. }
  31714. var obj = records[key];
  31715. if (record.nameID >= 256) {
  31716. obj = obj[record.nameID] || (obj[record.nameID] = {});
  31717. }
  31718. if (typeof record.string === 'string' || typeof obj[language] !== 'string') {
  31719. obj[language] = record.string;
  31720. }
  31721. }
  31722. this.records = records;
  31723. };
  31724. NameTable.preEncode = function () {
  31725. if (Array.isArray(this.records)) return;
  31726. this.version = 0;
  31727. var records = [];
  31728. for (var key in this.records) {
  31729. var val = this.records[key];
  31730. if (key === 'fontFeatures') continue;
  31731. records.push({
  31732. platformID: 3,
  31733. encodingID: 1,
  31734. languageID: 0x409,
  31735. nameID: NAMES.indexOf(key),
  31736. length: Buffer.byteLength(val.en, 'utf16le'),
  31737. string: val.en
  31738. });
  31739. if (key === 'postscriptName') {
  31740. records.push({
  31741. platformID: 1,
  31742. encodingID: 0,
  31743. languageID: 0,
  31744. nameID: NAMES.indexOf(key),
  31745. length: val.en.length,
  31746. string: val.en
  31747. });
  31748. }
  31749. }
  31750. this.records = records;
  31751. this.count = records.length;
  31752. this.stringOffset = NameTable.size(this, null, false);
  31753. };
  31754. var OS2 = new r.VersionedStruct(r.uint16, {
  31755. header: {
  31756. xAvgCharWidth: r.int16, // average weighted advance width of lower case letters and space
  31757. usWeightClass: r.uint16, // visual weight of stroke in glyphs
  31758. usWidthClass: r.uint16, // relative change from the normal aspect ratio (width to height ratio)
  31759. fsType: new r.Bitfield(r.uint16, [// Indicates font embedding licensing rights
  31760. null, 'noEmbedding', 'viewOnly', 'editable', null, null, null, null, 'noSubsetting', 'bitmapOnly']),
  31761. ySubscriptXSize: r.int16, // recommended horizontal size in pixels for subscripts
  31762. ySubscriptYSize: r.int16, // recommended vertical size in pixels for subscripts
  31763. ySubscriptXOffset: r.int16, // recommended horizontal offset for subscripts
  31764. ySubscriptYOffset: r.int16, // recommended vertical offset form the baseline for subscripts
  31765. ySuperscriptXSize: r.int16, // recommended horizontal size in pixels for superscripts
  31766. ySuperscriptYSize: r.int16, // recommended vertical size in pixels for superscripts
  31767. ySuperscriptXOffset: r.int16, // recommended horizontal offset for superscripts
  31768. ySuperscriptYOffset: r.int16, // recommended vertical offset from the baseline for superscripts
  31769. yStrikeoutSize: r.int16, // width of the strikeout stroke
  31770. yStrikeoutPosition: r.int16, // position of the strikeout stroke relative to the baseline
  31771. sFamilyClass: r.int16, // classification of font-family design
  31772. panose: new r.Array(r.uint8, 10), // describe the visual characteristics of a given typeface
  31773. ulCharRange: new r.Array(r.uint32, 4),
  31774. vendorID: new r.String(4), // four character identifier for the font vendor
  31775. fsSelection: new r.Bitfield(r.uint16, [// bit field containing information about the font
  31776. 'italic', 'underscore', 'negative', 'outlined', 'strikeout', 'bold', 'regular', 'useTypoMetrics', 'wws', 'oblique']),
  31777. usFirstCharIndex: r.uint16, // The minimum Unicode index in this font
  31778. usLastCharIndex: r.uint16 // The maximum Unicode index in this font
  31779. },
  31780. // The Apple version of this table ends here, but the Microsoft one continues on...
  31781. 0: {},
  31782. 1: {
  31783. typoAscender: r.int16,
  31784. typoDescender: r.int16,
  31785. typoLineGap: r.int16,
  31786. winAscent: r.uint16,
  31787. winDescent: r.uint16,
  31788. codePageRange: new r.Array(r.uint32, 2)
  31789. },
  31790. 2: {
  31791. // these should be common with version 1 somehow
  31792. typoAscender: r.int16,
  31793. typoDescender: r.int16,
  31794. typoLineGap: r.int16,
  31795. winAscent: r.uint16,
  31796. winDescent: r.uint16,
  31797. codePageRange: new r.Array(r.uint32, 2),
  31798. xHeight: r.int16,
  31799. capHeight: r.int16,
  31800. defaultChar: r.uint16,
  31801. breakChar: r.uint16,
  31802. maxContent: r.uint16
  31803. },
  31804. 5: {
  31805. typoAscender: r.int16,
  31806. typoDescender: r.int16,
  31807. typoLineGap: r.int16,
  31808. winAscent: r.uint16,
  31809. winDescent: r.uint16,
  31810. codePageRange: new r.Array(r.uint32, 2),
  31811. xHeight: r.int16,
  31812. capHeight: r.int16,
  31813. defaultChar: r.uint16,
  31814. breakChar: r.uint16,
  31815. maxContent: r.uint16,
  31816. usLowerOpticalPointSize: r.uint16,
  31817. usUpperOpticalPointSize: r.uint16
  31818. }
  31819. });
  31820. var versions = OS2.versions;
  31821. versions[3] = versions[4] = versions[2];
  31822. // PostScript information
  31823. var post = new r.VersionedStruct(r.fixed32, {
  31824. header: { // these fields exist at the top of all versions
  31825. italicAngle: r.fixed32, // Italic angle in counter-clockwise degrees from the vertical.
  31826. underlinePosition: r.int16, // Suggested distance of the top of the underline from the baseline
  31827. underlineThickness: r.int16, // Suggested values for the underline thickness
  31828. isFixedPitch: r.uint32, // Whether the font is monospaced
  31829. minMemType42: r.uint32, // Minimum memory usage when a TrueType font is downloaded as a Type 42 font
  31830. maxMemType42: r.uint32, // Maximum memory usage when a TrueType font is downloaded as a Type 42 font
  31831. minMemType1: r.uint32, // Minimum memory usage when a TrueType font is downloaded as a Type 1 font
  31832. maxMemType1: r.uint32 // Maximum memory usage when a TrueType font is downloaded as a Type 1 font
  31833. },
  31834. 1: {}, // version 1 has no additional fields
  31835. 2: {
  31836. numberOfGlyphs: r.uint16,
  31837. glyphNameIndex: new r.Array(r.uint16, 'numberOfGlyphs'),
  31838. names: new r.Array(new r.String(r.uint8))
  31839. },
  31840. 2.5: {
  31841. numberOfGlyphs: r.uint16,
  31842. offsets: new r.Array(r.uint8, 'numberOfGlyphs')
  31843. },
  31844. 3: {}, // version 3 has no additional fields
  31845. 4: {
  31846. map: new r.Array(r.uint32, function (t) {
  31847. return t.parent.maxp.numGlyphs;
  31848. })
  31849. }
  31850. });
  31851. // An array of predefined values accessible by instructions
  31852. var cvt = new r.Struct({
  31853. controlValues: new r.Array(r.int16)
  31854. });
  31855. // A list of instructions that are executed once when a font is first used.
  31856. // These instructions are known as the font program. The main use of this table
  31857. // is for the definition of functions that are used in many different glyph programs.
  31858. var fpgm = new r.Struct({
  31859. instructions: new r.Array(r.uint8)
  31860. });
  31861. var loca = new r.VersionedStruct('head.indexToLocFormat', {
  31862. 0: {
  31863. offsets: new r.Array(r.uint16)
  31864. },
  31865. 1: {
  31866. offsets: new r.Array(r.uint32)
  31867. }
  31868. });
  31869. loca.process = function () {
  31870. if (this.version === 0) {
  31871. for (var i = 0; i < this.offsets.length; i++) {
  31872. this.offsets[i] <<= 1;
  31873. }
  31874. }
  31875. };
  31876. loca.preEncode = function () {
  31877. if (this.version === 0) {
  31878. for (var i = 0; i < this.offsets.length; i++) {
  31879. this.offsets[i] >>>= 1;
  31880. }
  31881. }
  31882. };
  31883. // Set of instructions executed whenever the point size or font transformation change
  31884. var prep = new r.Struct({
  31885. controlValueProgram: new r.Array(r.uint8)
  31886. });
  31887. // only used for encoding
  31888. var glyf = new r.Array(new r.Buffer());
  31889. var CFFIndex = function () {
  31890. function CFFIndex(type) {
  31891. _classCallCheck(this, CFFIndex);
  31892. this.type = type;
  31893. }
  31894. CFFIndex.prototype.getCFFVersion = function getCFFVersion(ctx) {
  31895. while (ctx && !ctx.hdrSize) {
  31896. ctx = ctx.parent;
  31897. }
  31898. return ctx ? ctx.version : -1;
  31899. };
  31900. CFFIndex.prototype.decode = function decode(stream, parent) {
  31901. var version = this.getCFFVersion(parent);
  31902. var count = version >= 2 ? stream.readUInt32BE() : stream.readUInt16BE();
  31903. if (count === 0) {
  31904. return [];
  31905. }
  31906. var offSize = stream.readUInt8();
  31907. var offsetType = void 0;
  31908. if (offSize === 1) {
  31909. offsetType = r.uint8;
  31910. } else if (offSize === 2) {
  31911. offsetType = r.uint16;
  31912. } else if (offSize === 3) {
  31913. offsetType = r.uint24;
  31914. } else if (offSize === 4) {
  31915. offsetType = r.uint32;
  31916. } else {
  31917. throw new Error("Bad offset size in CFFIndex: " + offSize + " " + stream.pos);
  31918. }
  31919. var ret = [];
  31920. var startPos = stream.pos + (count + 1) * offSize - 1;
  31921. var start = offsetType.decode(stream);
  31922. for (var i = 0; i < count; i++) {
  31923. var end = offsetType.decode(stream);
  31924. if (this.type != null) {
  31925. var pos = stream.pos;
  31926. stream.pos = startPos + start;
  31927. parent.length = end - start;
  31928. ret.push(this.type.decode(stream, parent));
  31929. stream.pos = pos;
  31930. } else {
  31931. ret.push({
  31932. offset: startPos + start,
  31933. length: end - start
  31934. });
  31935. }
  31936. start = end;
  31937. }
  31938. stream.pos = startPos + start;
  31939. return ret;
  31940. };
  31941. CFFIndex.prototype.size = function size(arr, parent) {
  31942. var size = 2;
  31943. if (arr.length === 0) {
  31944. return size;
  31945. }
  31946. var type = this.type || new r.Buffer();
  31947. // find maximum offset to detminine offset type
  31948. var offset = 1;
  31949. for (var i = 0; i < arr.length; i++) {
  31950. var item = arr[i];
  31951. offset += type.size(item, parent);
  31952. }
  31953. var offsetType = void 0;
  31954. if (offset <= 0xff) {
  31955. offsetType = r.uint8;
  31956. } else if (offset <= 0xffff) {
  31957. offsetType = r.uint16;
  31958. } else if (offset <= 0xffffff) {
  31959. offsetType = r.uint24;
  31960. } else if (offset <= 0xffffffff) {
  31961. offsetType = r.uint32;
  31962. } else {
  31963. throw new Error("Bad offset in CFFIndex");
  31964. }
  31965. size += 1 + offsetType.size() * (arr.length + 1);
  31966. size += offset - 1;
  31967. return size;
  31968. };
  31969. CFFIndex.prototype.encode = function encode(stream, arr, parent) {
  31970. stream.writeUInt16BE(arr.length);
  31971. if (arr.length === 0) {
  31972. return;
  31973. }
  31974. var type = this.type || new r.Buffer();
  31975. // find maximum offset to detminine offset type
  31976. var sizes = [];
  31977. var offset = 1;
  31978. for (var _iterator = arr, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _getIterator(_iterator);;) {
  31979. var _ref;
  31980. if (_isArray) {
  31981. if (_i >= _iterator.length) break;
  31982. _ref = _iterator[_i++];
  31983. } else {
  31984. _i = _iterator.next();
  31985. if (_i.done) break;
  31986. _ref = _i.value;
  31987. }
  31988. var item = _ref;
  31989. var s = type.size(item, parent);
  31990. sizes.push(s);
  31991. offset += s;
  31992. }
  31993. var offsetType = void 0;
  31994. if (offset <= 0xff) {
  31995. offsetType = r.uint8;
  31996. } else if (offset <= 0xffff) {
  31997. offsetType = r.uint16;
  31998. } else if (offset <= 0xffffff) {
  31999. offsetType = r.uint24;
  32000. } else if (offset <= 0xffffffff) {
  32001. offsetType = r.uint32;
  32002. } else {
  32003. throw new Error("Bad offset in CFFIndex");
  32004. }
  32005. // write offset size
  32006. stream.writeUInt8(offsetType.size());
  32007. // write elements
  32008. offset = 1;
  32009. offsetType.encode(stream, offset);
  32010. for (var _iterator2 = sizes, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _getIterator(_iterator2);;) {
  32011. var _ref2;
  32012. if (_isArray2) {
  32013. if (_i2 >= _iterator2.length) break;
  32014. _ref2 = _iterator2[_i2++];
  32015. } else {
  32016. _i2 = _iterator2.next();
  32017. if (_i2.done) break;
  32018. _ref2 = _i2.value;
  32019. }
  32020. var size = _ref2;
  32021. offset += size;
  32022. offsetType.encode(stream, offset);
  32023. }
  32024. for (var _iterator3 = arr, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _getIterator(_iterator3);;) {
  32025. var _ref3;
  32026. if (_isArray3) {
  32027. if (_i3 >= _iterator3.length) break;
  32028. _ref3 = _iterator3[_i3++];
  32029. } else {
  32030. _i3 = _iterator3.next();
  32031. if (_i3.done) break;
  32032. _ref3 = _i3.value;
  32033. }
  32034. var _item = _ref3;
  32035. type.encode(stream, _item, parent);
  32036. }
  32037. return;
  32038. };
  32039. return CFFIndex;
  32040. }();
  32041. var FLOAT_EOF = 0xf;
  32042. var FLOAT_LOOKUP = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '.', 'E', 'E-', null, '-'];
  32043. var FLOAT_ENCODE_LOOKUP = {
  32044. '.': 10,
  32045. 'E': 11,
  32046. 'E-': 12,
  32047. '-': 14
  32048. };
  32049. var CFFOperand = function () {
  32050. function CFFOperand() {
  32051. _classCallCheck(this, CFFOperand);
  32052. }
  32053. CFFOperand.decode = function decode(stream, value) {
  32054. if (32 <= value && value <= 246) {
  32055. return value - 139;
  32056. }
  32057. if (247 <= value && value <= 250) {
  32058. return (value - 247) * 256 + stream.readUInt8() + 108;
  32059. }
  32060. if (251 <= value && value <= 254) {
  32061. return -(value - 251) * 256 - stream.readUInt8() - 108;
  32062. }
  32063. if (value === 28) {
  32064. return stream.readInt16BE();
  32065. }
  32066. if (value === 29) {
  32067. return stream.readInt32BE();
  32068. }
  32069. if (value === 30) {
  32070. var str = '';
  32071. while (true) {
  32072. var b = stream.readUInt8();
  32073. var n1 = b >> 4;
  32074. if (n1 === FLOAT_EOF) {
  32075. break;
  32076. }
  32077. str += FLOAT_LOOKUP[n1];
  32078. var n2 = b & 15;
  32079. if (n2 === FLOAT_EOF) {
  32080. break;
  32081. }
  32082. str += FLOAT_LOOKUP[n2];
  32083. }
  32084. return parseFloat(str);
  32085. }
  32086. return null;
  32087. };
  32088. CFFOperand.size = function size(value) {
  32089. // if the value needs to be forced to the largest size (32 bit)
  32090. // e.g. for unknown pointers, set to 32768
  32091. if (value.forceLarge) {
  32092. value = 32768;
  32093. }
  32094. if ((value | 0) !== value) {
  32095. // floating point
  32096. var str = '' + value;
  32097. return 1 + Math.ceil((str.length + 1) / 2);
  32098. } else if (-107 <= value && value <= 107) {
  32099. return 1;
  32100. } else if (108 <= value && value <= 1131 || -1131 <= value && value <= -108) {
  32101. return 2;
  32102. } else if (-32768 <= value && value <= 32767) {
  32103. return 3;
  32104. } else {
  32105. return 5;
  32106. }
  32107. };
  32108. CFFOperand.encode = function encode(stream, value) {
  32109. // if the value needs to be forced to the largest size (32 bit)
  32110. // e.g. for unknown pointers, save the old value and set to 32768
  32111. var val = Number(value);
  32112. if (value.forceLarge) {
  32113. stream.writeUInt8(29);
  32114. return stream.writeInt32BE(val);
  32115. } else if ((val | 0) !== val) {
  32116. // floating point
  32117. stream.writeUInt8(30);
  32118. var str = '' + val;
  32119. for (var i = 0; i < str.length; i += 2) {
  32120. var c1 = str[i];
  32121. var n1 = FLOAT_ENCODE_LOOKUP[c1] || +c1;
  32122. if (i === str.length - 1) {
  32123. var n2 = FLOAT_EOF;
  32124. } else {
  32125. var c2 = str[i + 1];
  32126. var n2 = FLOAT_ENCODE_LOOKUP[c2] || +c2;
  32127. }
  32128. stream.writeUInt8(n1 << 4 | n2 & 15);
  32129. }
  32130. if (n2 !== FLOAT_EOF) {
  32131. return stream.writeUInt8(FLOAT_EOF << 4);
  32132. }
  32133. } else if (-107 <= val && val <= 107) {
  32134. return stream.writeUInt8(val + 139);
  32135. } else if (108 <= val && val <= 1131) {
  32136. val -= 108;
  32137. stream.writeUInt8((val >> 8) + 247);
  32138. return stream.writeUInt8(val & 0xff);
  32139. } else if (-1131 <= val && val <= -108) {
  32140. val = -val - 108;
  32141. stream.writeUInt8((val >> 8) + 251);
  32142. return stream.writeUInt8(val & 0xff);
  32143. } else if (-32768 <= val && val <= 32767) {
  32144. stream.writeUInt8(28);
  32145. return stream.writeInt16BE(val);
  32146. } else {
  32147. stream.writeUInt8(29);
  32148. return stream.writeInt32BE(val);
  32149. }
  32150. };
  32151. return CFFOperand;
  32152. }();
  32153. var CFFDict = function () {
  32154. function CFFDict() {
  32155. var ops = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  32156. _classCallCheck(this, CFFDict);
  32157. this.ops = ops;
  32158. this.fields = {};
  32159. for (var _iterator = ops, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _getIterator(_iterator);;) {
  32160. var _ref;
  32161. if (_isArray) {
  32162. if (_i >= _iterator.length) break;
  32163. _ref = _iterator[_i++];
  32164. } else {
  32165. _i = _iterator.next();
  32166. if (_i.done) break;
  32167. _ref = _i.value;
  32168. }
  32169. var field = _ref;
  32170. var key = Array.isArray(field[0]) ? field[0][0] << 8 | field[0][1] : field[0];
  32171. this.fields[key] = field;
  32172. }
  32173. }
  32174. CFFDict.prototype.decodeOperands = function decodeOperands(type, stream, ret, operands) {
  32175. var _this = this;
  32176. if (Array.isArray(type)) {
  32177. return operands.map(function (op, i) {
  32178. return _this.decodeOperands(type[i], stream, ret, [op]);
  32179. });
  32180. } else if (type.decode != null) {
  32181. return type.decode(stream, ret, operands);
  32182. } else {
  32183. switch (type) {
  32184. case 'number':
  32185. case 'offset':
  32186. case 'sid':
  32187. return operands[0];
  32188. case 'boolean':
  32189. return !!operands[0];
  32190. default:
  32191. return operands;
  32192. }
  32193. }
  32194. };
  32195. CFFDict.prototype.encodeOperands = function encodeOperands(type, stream, ctx, operands) {
  32196. var _this2 = this;
  32197. if (Array.isArray(type)) {
  32198. return operands.map(function (op, i) {
  32199. return _this2.encodeOperands(type[i], stream, ctx, op)[0];
  32200. });
  32201. } else if (type.encode != null) {
  32202. return type.encode(stream, operands, ctx);
  32203. } else if (typeof operands === 'number') {
  32204. return [operands];
  32205. } else if (typeof operands === 'boolean') {
  32206. return [+operands];
  32207. } else if (Array.isArray(operands)) {
  32208. return operands;
  32209. } else {
  32210. return [operands];
  32211. }
  32212. };
  32213. CFFDict.prototype.decode = function decode(stream, parent) {
  32214. var end = stream.pos + parent.length;
  32215. var ret = {};
  32216. var operands = [];
  32217. // define hidden properties
  32218. _Object$defineProperties(ret, {
  32219. parent: { value: parent },
  32220. _startOffset: { value: stream.pos }
  32221. });
  32222. // fill in defaults
  32223. for (var key in this.fields) {
  32224. var field = this.fields[key];
  32225. ret[field[1]] = field[3];
  32226. }
  32227. while (stream.pos < end) {
  32228. var b = stream.readUInt8();
  32229. if (b < 28) {
  32230. if (b === 12) {
  32231. b = b << 8 | stream.readUInt8();
  32232. }
  32233. var _field = this.fields[b];
  32234. if (!_field) {
  32235. throw new Error('Unknown operator ' + b);
  32236. }
  32237. var val = this.decodeOperands(_field[2], stream, ret, operands);
  32238. if (val != null) {
  32239. if (val instanceof restructure_src_utils.PropertyDescriptor) {
  32240. _Object$defineProperty(ret, _field[1], val);
  32241. } else {
  32242. ret[_field[1]] = val;
  32243. }
  32244. }
  32245. operands = [];
  32246. } else {
  32247. operands.push(CFFOperand.decode(stream, b));
  32248. }
  32249. }
  32250. return ret;
  32251. };
  32252. CFFDict.prototype.size = function size(dict, parent) {
  32253. var includePointers = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  32254. var ctx = {
  32255. parent: parent,
  32256. val: dict,
  32257. pointerSize: 0,
  32258. startOffset: parent.startOffset || 0
  32259. };
  32260. var len = 0;
  32261. for (var k in this.fields) {
  32262. var field = this.fields[k];
  32263. var val = dict[field[1]];
  32264. if (val == null || isEqual(val, field[3])) {
  32265. continue;
  32266. }
  32267. var operands = this.encodeOperands(field[2], null, ctx, val);
  32268. for (var _iterator2 = operands, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _getIterator(_iterator2);;) {
  32269. var _ref2;
  32270. if (_isArray2) {
  32271. if (_i2 >= _iterator2.length) break;
  32272. _ref2 = _iterator2[_i2++];
  32273. } else {
  32274. _i2 = _iterator2.next();
  32275. if (_i2.done) break;
  32276. _ref2 = _i2.value;
  32277. }
  32278. var op = _ref2;
  32279. len += CFFOperand.size(op);
  32280. }
  32281. var key = Array.isArray(field[0]) ? field[0] : [field[0]];
  32282. len += key.length;
  32283. }
  32284. if (includePointers) {
  32285. len += ctx.pointerSize;
  32286. }
  32287. return len;
  32288. };
  32289. CFFDict.prototype.encode = function encode(stream, dict, parent) {
  32290. var ctx = {
  32291. pointers: [],
  32292. startOffset: stream.pos,
  32293. parent: parent,
  32294. val: dict,
  32295. pointerSize: 0
  32296. };
  32297. ctx.pointerOffset = stream.pos + this.size(dict, ctx, false);
  32298. for (var _iterator3 = this.ops, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _getIterator(_iterator3);;) {
  32299. var _ref3;
  32300. if (_isArray3) {
  32301. if (_i3 >= _iterator3.length) break;
  32302. _ref3 = _iterator3[_i3++];
  32303. } else {
  32304. _i3 = _iterator3.next();
  32305. if (_i3.done) break;
  32306. _ref3 = _i3.value;
  32307. }
  32308. var field = _ref3;
  32309. var val = dict[field[1]];
  32310. if (val == null || isEqual(val, field[3])) {
  32311. continue;
  32312. }
  32313. var operands = this.encodeOperands(field[2], stream, ctx, val);
  32314. for (var _iterator4 = operands, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _getIterator(_iterator4);;) {
  32315. var _ref4;
  32316. if (_isArray4) {
  32317. if (_i4 >= _iterator4.length) break;
  32318. _ref4 = _iterator4[_i4++];
  32319. } else {
  32320. _i4 = _iterator4.next();
  32321. if (_i4.done) break;
  32322. _ref4 = _i4.value;
  32323. }
  32324. var op = _ref4;
  32325. CFFOperand.encode(stream, op);
  32326. }
  32327. var key = Array.isArray(field[0]) ? field[0] : [field[0]];
  32328. for (var _iterator5 = key, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : _getIterator(_iterator5);;) {
  32329. var _ref5;
  32330. if (_isArray5) {
  32331. if (_i5 >= _iterator5.length) break;
  32332. _ref5 = _iterator5[_i5++];
  32333. } else {
  32334. _i5 = _iterator5.next();
  32335. if (_i5.done) break;
  32336. _ref5 = _i5.value;
  32337. }
  32338. var _op = _ref5;
  32339. stream.writeUInt8(_op);
  32340. }
  32341. }
  32342. var i = 0;
  32343. while (i < ctx.pointers.length) {
  32344. var ptr = ctx.pointers[i++];
  32345. ptr.type.encode(stream, ptr.val, ptr.parent);
  32346. }
  32347. return;
  32348. };
  32349. return CFFDict;
  32350. }();
  32351. var CFFPointer = function (_r$Pointer) {
  32352. _inherits(CFFPointer, _r$Pointer);
  32353. function CFFPointer(type) {
  32354. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  32355. _classCallCheck(this, CFFPointer);
  32356. if (options.type == null) {
  32357. options.type = 'global';
  32358. }
  32359. return _possibleConstructorReturn(this, _r$Pointer.call(this, null, type, options));
  32360. }
  32361. CFFPointer.prototype.decode = function decode(stream, parent, operands) {
  32362. this.offsetType = {
  32363. decode: function decode() {
  32364. return operands[0];
  32365. }
  32366. };
  32367. return _r$Pointer.prototype.decode.call(this, stream, parent, operands);
  32368. };
  32369. CFFPointer.prototype.encode = function encode(stream, value, ctx) {
  32370. if (!stream) {
  32371. // compute the size (so ctx.pointerSize is correct)
  32372. this.offsetType = {
  32373. size: function size() {
  32374. return 0;
  32375. }
  32376. };
  32377. this.size(value, ctx);
  32378. return [new Ptr(0)];
  32379. }
  32380. var ptr = null;
  32381. this.offsetType = {
  32382. encode: function encode(stream, val) {
  32383. return ptr = val;
  32384. }
  32385. };
  32386. _r$Pointer.prototype.encode.call(this, stream, value, ctx);
  32387. return [new Ptr(ptr)];
  32388. };
  32389. return CFFPointer;
  32390. }(r.Pointer);
  32391. var Ptr = function () {
  32392. function Ptr(val) {
  32393. _classCallCheck(this, Ptr);
  32394. this.val = val;
  32395. this.forceLarge = true;
  32396. }
  32397. Ptr.prototype.valueOf = function valueOf() {
  32398. return this.val;
  32399. };
  32400. return Ptr;
  32401. }();
  32402. var CFFBlendOp = function () {
  32403. function CFFBlendOp() {
  32404. _classCallCheck(this, CFFBlendOp);
  32405. }
  32406. CFFBlendOp.decode = function decode(stream, parent, operands) {
  32407. var numBlends = operands.pop();
  32408. // TODO: actually blend. For now just consume the deltas
  32409. // since we don't use any of the values anyway.
  32410. while (operands.length > numBlends) {
  32411. operands.pop();
  32412. }
  32413. };
  32414. return CFFBlendOp;
  32415. }();
  32416. var CFFPrivateDict = new CFFDict([
  32417. // key name type default
  32418. [6, 'BlueValues', 'delta', null], [7, 'OtherBlues', 'delta', null], [8, 'FamilyBlues', 'delta', null], [9, 'FamilyOtherBlues', 'delta', null], [[12, 9], 'BlueScale', 'number', 0.039625], [[12, 10], 'BlueShift', 'number', 7], [[12, 11], 'BlueFuzz', 'number', 1], [10, 'StdHW', 'number', null], [11, 'StdVW', 'number', null], [[12, 12], 'StemSnapH', 'delta', null], [[12, 13], 'StemSnapV', 'delta', null], [[12, 14], 'ForceBold', 'boolean', false], [[12, 17], 'LanguageGroup', 'number', 0], [[12, 18], 'ExpansionFactor', 'number', 0.06], [[12, 19], 'initialRandomSeed', 'number', 0], [20, 'defaultWidthX', 'number', 0], [21, 'nominalWidthX', 'number', 0], [22, 'vsindex', 'number', 0], [23, 'blend', CFFBlendOp, null], [19, 'Subrs', new CFFPointer(new CFFIndex(), { type: 'local' }), null]]);
  32419. // Automatically generated from Appendix A of the CFF specification; do
  32420. // not edit. Length should be 391.
  32421. var standardStrings = [".notdef", "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quoteright", "parenleft", "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash", "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question", "at", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "bracketleft", "backslash", "bracketright", "asciicircum", "underscore", "quoteleft", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "braceleft", "bar", "braceright", "asciitilde", "exclamdown", "cent", "sterling", "fraction", "yen", "florin", "section", "currency", "quotesingle", "quotedblleft", "guillemotleft", "guilsinglleft", "guilsinglright", "fi", "fl", "endash", "dagger", "daggerdbl", "periodcentered", "paragraph", "bullet", "quotesinglbase", "quotedblbase", "quotedblright", "guillemotright", "ellipsis", "perthousand", "questiondown", "grave", "acute", "circumflex", "tilde", "macron", "breve", "dotaccent", "dieresis", "ring", "cedilla", "hungarumlaut", "ogonek", "caron", "emdash", "AE", "ordfeminine", "Lslash", "Oslash", "OE", "ordmasculine", "ae", "dotlessi", "lslash", "oslash", "oe", "germandbls", "onesuperior", "logicalnot", "mu", "trademark", "Eth", "onehalf", "plusminus", "Thorn", "onequarter", "divide", "brokenbar", "degree", "thorn", "threequarters", "twosuperior", "registered", "minus", "eth", "multiply", "threesuperior", "copyright", "Aacute", "Acircumflex", "Adieresis", "Agrave", "Aring", "Atilde", "Ccedilla", "Eacute", "Ecircumflex", "Edieresis", "Egrave", "Iacute", "Icircumflex", "Idieresis", "Igrave", "Ntilde", "Oacute", "Ocircumflex", "Odieresis", "Ograve", "Otilde", "Scaron", "Uacute", "Ucircumflex", "Udieresis", "Ugrave", "Yacute", "Ydieresis", "Zcaron", "aacute", "acircumflex", "adieresis", "agrave", "aring", "atilde", "ccedilla", "eacute", "ecircumflex", "edieresis", "egrave", "iacute", "icircumflex", "idieresis", "igrave", "ntilde", "oacute", "ocircumflex", "odieresis", "ograve", "otilde", "scaron", "uacute", "ucircumflex", "udieresis", "ugrave", "yacute", "ydieresis", "zcaron", "exclamsmall", "Hungarumlautsmall", "dollaroldstyle", "dollarsuperior", "ampersandsmall", "Acutesmall", "parenleftsuperior", "parenrightsuperior", "twodotenleader", "onedotenleader", "zerooldstyle", "oneoldstyle", "twooldstyle", "threeoldstyle", "fouroldstyle", "fiveoldstyle", "sixoldstyle", "sevenoldstyle", "eightoldstyle", "nineoldstyle", "commasuperior", "threequartersemdash", "periodsuperior", "questionsmall", "asuperior", "bsuperior", "centsuperior", "dsuperior", "esuperior", "isuperior", "lsuperior", "msuperior", "nsuperior", "osuperior", "rsuperior", "ssuperior", "tsuperior", "ff", "ffi", "ffl", "parenleftinferior", "parenrightinferior", "Circumflexsmall", "hyphensuperior", "Gravesmall", "Asmall", "Bsmall", "Csmall", "Dsmall", "Esmall", "Fsmall", "Gsmall", "Hsmall", "Ismall", "Jsmall", "Ksmall", "Lsmall", "Msmall", "Nsmall", "Osmall", "Psmall", "Qsmall", "Rsmall", "Ssmall", "Tsmall", "Usmall", "Vsmall", "Wsmall", "Xsmall", "Ysmall", "Zsmall", "colonmonetary", "onefitted", "rupiah", "Tildesmall", "exclamdownsmall", "centoldstyle", "Lslashsmall", "Scaronsmall", "Zcaronsmall", "Dieresissmall", "Brevesmall", "Caronsmall", "Dotaccentsmall", "Macronsmall", "figuredash", "hypheninferior", "Ogoneksmall", "Ringsmall", "Cedillasmall", "questiondownsmall", "oneeighth", "threeeighths", "fiveeighths", "seveneighths", "onethird", "twothirds", "zerosuperior", "foursuperior", "fivesuperior", "sixsuperior", "sevensuperior", "eightsuperior", "ninesuperior", "zeroinferior", "oneinferior", "twoinferior", "threeinferior", "fourinferior", "fiveinferior", "sixinferior", "seveninferior", "eightinferior", "nineinferior", "centinferior", "dollarinferior", "periodinferior", "commainferior", "Agravesmall", "Aacutesmall", "Acircumflexsmall", "Atildesmall", "Adieresissmall", "Aringsmall", "AEsmall", "Ccedillasmall", "Egravesmall", "Eacutesmall", "Ecircumflexsmall", "Edieresissmall", "Igravesmall", "Iacutesmall", "Icircumflexsmall", "Idieresissmall", "Ethsmall", "Ntildesmall", "Ogravesmall", "Oacutesmall", "Ocircumflexsmall", "Otildesmall", "Odieresissmall", "OEsmall", "Oslashsmall", "Ugravesmall", "Uacutesmall", "Ucircumflexsmall", "Udieresissmall", "Yacutesmall", "Thornsmall", "Ydieresissmall", "001.000", "001.001", "001.002", "001.003", "Black", "Bold", "Book", "Light", "Medium", "Regular", "Roman", "Semibold"];
  32422. var StandardEncoding = ['', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'space', 'exclam', 'quotedbl', 'numbersign', 'dollar', 'percent', 'ampersand', 'quoteright', 'parenleft', 'parenright', 'asterisk', 'plus', 'comma', 'hyphen', 'period', 'slash', 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'colon', 'semicolon', 'less', 'equal', 'greater', 'question', 'at', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'bracketleft', 'backslash', 'bracketright', 'asciicircum', 'underscore', 'quoteleft', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'braceleft', 'bar', 'braceright', 'asciitilde', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'exclamdown', 'cent', 'sterling', 'fraction', 'yen', 'florin', 'section', 'currency', 'quotesingle', 'quotedblleft', 'guillemotleft', 'guilsinglleft', 'guilsinglright', 'fi', 'fl', '', 'endash', 'dagger', 'daggerdbl', 'periodcentered', '', 'paragraph', 'bullet', 'quotesinglbase', 'quotedblbase', 'quotedblright', 'guillemotright', 'ellipsis', 'perthousand', '', 'questiondown', '', 'grave', 'acute', 'circumflex', 'tilde', 'macron', 'breve', 'dotaccent', 'dieresis', '', 'ring', 'cedilla', '', 'hungarumlaut', 'ogonek', 'caron', 'emdash', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'AE', '', 'ordfeminine', '', '', '', '', 'Lslash', 'Oslash', 'OE', 'ordmasculine', '', '', '', '', '', 'ae', '', '', '', 'dotlessi', '', '', 'lslash', 'oslash', 'oe', 'germandbls'];
  32423. var ExpertEncoding = ['', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'space', 'exclamsmall', 'Hungarumlautsmall', '', 'dollaroldstyle', 'dollarsuperior', 'ampersandsmall', 'Acutesmall', 'parenleftsuperior', 'parenrightsuperior', 'twodotenleader', 'onedotenleader', 'comma', 'hyphen', 'period', 'fraction', 'zerooldstyle', 'oneoldstyle', 'twooldstyle', 'threeoldstyle', 'fouroldstyle', 'fiveoldstyle', 'sixoldstyle', 'sevenoldstyle', 'eightoldstyle', 'nineoldstyle', 'colon', 'semicolon', 'commasuperior', 'threequartersemdash', 'periodsuperior', 'questionsmall', '', 'asuperior', 'bsuperior', 'centsuperior', 'dsuperior', 'esuperior', '', '', 'isuperior', '', '', 'lsuperior', 'msuperior', 'nsuperior', 'osuperior', '', '', 'rsuperior', 'ssuperior', 'tsuperior', '', 'ff', 'fi', 'fl', 'ffi', 'ffl', 'parenleftinferior', '', 'parenrightinferior', 'Circumflexsmall', 'hyphensuperior', 'Gravesmall', 'Asmall', 'Bsmall', 'Csmall', 'Dsmall', 'Esmall', 'Fsmall', 'Gsmall', 'Hsmall', 'Ismall', 'Jsmall', 'Ksmall', 'Lsmall', 'Msmall', 'Nsmall', 'Osmall', 'Psmall', 'Qsmall', 'Rsmall', 'Ssmall', 'Tsmall', 'Usmall', 'Vsmall', 'Wsmall', 'Xsmall', 'Ysmall', 'Zsmall', 'colonmonetary', 'onefitted', 'rupiah', 'Tildesmall', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'exclamdownsmall', 'centoldstyle', 'Lslashsmall', '', '', 'Scaronsmall', 'Zcaronsmall', 'Dieresissmall', 'Brevesmall', 'Caronsmall', '', 'Dotaccentsmall', '', '', 'Macronsmall', '', '', 'figuredash', 'hypheninferior', '', '', 'Ogoneksmall', 'Ringsmall', 'Cedillasmall', '', '', '', 'onequarter', 'onehalf', 'threequarters', 'questiondownsmall', 'oneeighth', 'threeeighths', 'fiveeighths', 'seveneighths', 'onethird', 'twothirds', '', '', 'zerosuperior', 'onesuperior', 'twosuperior', 'threesuperior', 'foursuperior', 'fivesuperior', 'sixsuperior', 'sevensuperior', 'eightsuperior', 'ninesuperior', 'zeroinferior', 'oneinferior', 'twoinferior', 'threeinferior', 'fourinferior', 'fiveinferior', 'sixinferior', 'seveninferior', 'eightinferior', 'nineinferior', 'centinferior', 'dollarinferior', 'periodinferior', 'commainferior', 'Agravesmall', 'Aacutesmall', 'Acircumflexsmall', 'Atildesmall', 'Adieresissmall', 'Aringsmall', 'AEsmall', 'Ccedillasmall', 'Egravesmall', 'Eacutesmall', 'Ecircumflexsmall', 'Edieresissmall', 'Igravesmall', 'Iacutesmall', 'Icircumflexsmall', 'Idieresissmall', 'Ethsmall', 'Ntildesmall', 'Ogravesmall', 'Oacutesmall', 'Ocircumflexsmall', 'Otildesmall', 'Odieresissmall', 'OEsmall', 'Oslashsmall', 'Ugravesmall', 'Uacutesmall', 'Ucircumflexsmall', 'Udieresissmall', 'Yacutesmall', 'Thornsmall', 'Ydieresissmall'];
  32424. var ISOAdobeCharset = ['.notdef', 'space', 'exclam', 'quotedbl', 'numbersign', 'dollar', 'percent', 'ampersand', 'quoteright', 'parenleft', 'parenright', 'asterisk', 'plus', 'comma', 'hyphen', 'period', 'slash', 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'colon', 'semicolon', 'less', 'equal', 'greater', 'question', 'at', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'bracketleft', 'backslash', 'bracketright', 'asciicircum', 'underscore', 'quoteleft', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'braceleft', 'bar', 'braceright', 'asciitilde', 'exclamdown', 'cent', 'sterling', 'fraction', 'yen', 'florin', 'section', 'currency', 'quotesingle', 'quotedblleft', 'guillemotleft', 'guilsinglleft', 'guilsinglright', 'fi', 'fl', 'endash', 'dagger', 'daggerdbl', 'periodcentered', 'paragraph', 'bullet', 'quotesinglbase', 'quotedblbase', 'quotedblright', 'guillemotright', 'ellipsis', 'perthousand', 'questiondown', 'grave', 'acute', 'circumflex', 'tilde', 'macron', 'breve', 'dotaccent', 'dieresis', 'ring', 'cedilla', 'hungarumlaut', 'ogonek', 'caron', 'emdash', 'AE', 'ordfeminine', 'Lslash', 'Oslash', 'OE', 'ordmasculine', 'ae', 'dotlessi', 'lslash', 'oslash', 'oe', 'germandbls', 'onesuperior', 'logicalnot', 'mu', 'trademark', 'Eth', 'onehalf', 'plusminus', 'Thorn', 'onequarter', 'divide', 'brokenbar', 'degree', 'thorn', 'threequarters', 'twosuperior', 'registered', 'minus', 'eth', 'multiply', 'threesuperior', 'copyright', 'Aacute', 'Acircumflex', 'Adieresis', 'Agrave', 'Aring', 'Atilde', 'Ccedilla', 'Eacute', 'Ecircumflex', 'Edieresis', 'Egrave', 'Iacute', 'Icircumflex', 'Idieresis', 'Igrave', 'Ntilde', 'Oacute', 'Ocircumflex', 'Odieresis', 'Ograve', 'Otilde', 'Scaron', 'Uacute', 'Ucircumflex', 'Udieresis', 'Ugrave', 'Yacute', 'Ydieresis', 'Zcaron', 'aacute', 'acircumflex', 'adieresis', 'agrave', 'aring', 'atilde', 'ccedilla', 'eacute', 'ecircumflex', 'edieresis', 'egrave', 'iacute', 'icircumflex', 'idieresis', 'igrave', 'ntilde', 'oacute', 'ocircumflex', 'odieresis', 'ograve', 'otilde', 'scaron', 'uacute', 'ucircumflex', 'udieresis', 'ugrave', 'yacute', 'ydieresis', 'zcaron'];
  32425. var ExpertCharset = ['.notdef', 'space', 'exclamsmall', 'Hungarumlautsmall', 'dollaroldstyle', 'dollarsuperior', 'ampersandsmall', 'Acutesmall', 'parenleftsuperior', 'parenrightsuperior', 'twodotenleader', 'onedotenleader', 'comma', 'hyphen', 'period', 'fraction', 'zerooldstyle', 'oneoldstyle', 'twooldstyle', 'threeoldstyle', 'fouroldstyle', 'fiveoldstyle', 'sixoldstyle', 'sevenoldstyle', 'eightoldstyle', 'nineoldstyle', 'colon', 'semicolon', 'commasuperior', 'threequartersemdash', 'periodsuperior', 'questionsmall', 'asuperior', 'bsuperior', 'centsuperior', 'dsuperior', 'esuperior', 'isuperior', 'lsuperior', 'msuperior', 'nsuperior', 'osuperior', 'rsuperior', 'ssuperior', 'tsuperior', 'ff', 'fi', 'fl', 'ffi', 'ffl', 'parenleftinferior', 'parenrightinferior', 'Circumflexsmall', 'hyphensuperior', 'Gravesmall', 'Asmall', 'Bsmall', 'Csmall', 'Dsmall', 'Esmall', 'Fsmall', 'Gsmall', 'Hsmall', 'Ismall', 'Jsmall', 'Ksmall', 'Lsmall', 'Msmall', 'Nsmall', 'Osmall', 'Psmall', 'Qsmall', 'Rsmall', 'Ssmall', 'Tsmall', 'Usmall', 'Vsmall', 'Wsmall', 'Xsmall', 'Ysmall', 'Zsmall', 'colonmonetary', 'onefitted', 'rupiah', 'Tildesmall', 'exclamdownsmall', 'centoldstyle', 'Lslashsmall', 'Scaronsmall', 'Zcaronsmall', 'Dieresissmall', 'Brevesmall', 'Caronsmall', 'Dotaccentsmall', 'Macronsmall', 'figuredash', 'hypheninferior', 'Ogoneksmall', 'Ringsmall', 'Cedillasmall', 'onequarter', 'onehalf', 'threequarters', 'questiondownsmall', 'oneeighth', 'threeeighths', 'fiveeighths', 'seveneighths', 'onethird', 'twothirds', 'zerosuperior', 'onesuperior', 'twosuperior', 'threesuperior', 'foursuperior', 'fivesuperior', 'sixsuperior', 'sevensuperior', 'eightsuperior', 'ninesuperior', 'zeroinferior', 'oneinferior', 'twoinferior', 'threeinferior', 'fourinferior', 'fiveinferior', 'sixinferior', 'seveninferior', 'eightinferior', 'nineinferior', 'centinferior', 'dollarinferior', 'periodinferior', 'commainferior', 'Agravesmall', 'Aacutesmall', 'Acircumflexsmall', 'Atildesmall', 'Adieresissmall', 'Aringsmall', 'AEsmall', 'Ccedillasmall', 'Egravesmall', 'Eacutesmall', 'Ecircumflexsmall', 'Edieresissmall', 'Igravesmall', 'Iacutesmall', 'Icircumflexsmall', 'Idieresissmall', 'Ethsmall', 'Ntildesmall', 'Ogravesmall', 'Oacutesmall', 'Ocircumflexsmall', 'Otildesmall', 'Odieresissmall', 'OEsmall', 'Oslashsmall', 'Ugravesmall', 'Uacutesmall', 'Ucircumflexsmall', 'Udieresissmall', 'Yacutesmall', 'Thornsmall', 'Ydieresissmall'];
  32426. var ExpertSubsetCharset = ['.notdef', 'space', 'dollaroldstyle', 'dollarsuperior', 'parenleftsuperior', 'parenrightsuperior', 'twodotenleader', 'onedotenleader', 'comma', 'hyphen', 'period', 'fraction', 'zerooldstyle', 'oneoldstyle', 'twooldstyle', 'threeoldstyle', 'fouroldstyle', 'fiveoldstyle', 'sixoldstyle', 'sevenoldstyle', 'eightoldstyle', 'nineoldstyle', 'colon', 'semicolon', 'commasuperior', 'threequartersemdash', 'periodsuperior', 'asuperior', 'bsuperior', 'centsuperior', 'dsuperior', 'esuperior', 'isuperior', 'lsuperior', 'msuperior', 'nsuperior', 'osuperior', 'rsuperior', 'ssuperior', 'tsuperior', 'ff', 'fi', 'fl', 'ffi', 'ffl', 'parenleftinferior', 'parenrightinferior', 'hyphensuperior', 'colonmonetary', 'onefitted', 'rupiah', 'centoldstyle', 'figuredash', 'hypheninferior', 'onequarter', 'onehalf', 'threequarters', 'oneeighth', 'threeeighths', 'fiveeighths', 'seveneighths', 'onethird', 'twothirds', 'zerosuperior', 'onesuperior', 'twosuperior', 'threesuperior', 'foursuperior', 'fivesuperior', 'sixsuperior', 'sevensuperior', 'eightsuperior', 'ninesuperior', 'zeroinferior', 'oneinferior', 'twoinferior', 'threeinferior', 'fourinferior', 'fiveinferior', 'sixinferior', 'seveninferior', 'eightinferior', 'nineinferior', 'centinferior', 'dollarinferior', 'periodinferior', 'commainferior'];
  32427. //########################
  32428. // Scripts and Languages #
  32429. //########################
  32430. var LangSysTable = new r.Struct({
  32431. reserved: new r.Reserved(r.uint16),
  32432. reqFeatureIndex: r.uint16,
  32433. featureCount: r.uint16,
  32434. featureIndexes: new r.Array(r.uint16, 'featureCount')
  32435. });
  32436. var LangSysRecord = new r.Struct({
  32437. tag: new r.String(4),
  32438. langSys: new r.Pointer(r.uint16, LangSysTable, { type: 'parent' })
  32439. });
  32440. var Script = new r.Struct({
  32441. defaultLangSys: new r.Pointer(r.uint16, LangSysTable),
  32442. count: r.uint16,
  32443. langSysRecords: new r.Array(LangSysRecord, 'count')
  32444. });
  32445. var ScriptRecord = new r.Struct({
  32446. tag: new r.String(4),
  32447. script: new r.Pointer(r.uint16, Script, { type: 'parent' })
  32448. });
  32449. var ScriptList = new r.Array(ScriptRecord, r.uint16);
  32450. //#######################
  32451. // Features and Lookups #
  32452. //#######################
  32453. var Feature = new r.Struct({
  32454. featureParams: r.uint16, // pointer
  32455. lookupCount: r.uint16,
  32456. lookupListIndexes: new r.Array(r.uint16, 'lookupCount')
  32457. });
  32458. var FeatureRecord = new r.Struct({
  32459. tag: new r.String(4),
  32460. feature: new r.Pointer(r.uint16, Feature, { type: 'parent' })
  32461. });
  32462. var FeatureList = new r.Array(FeatureRecord, r.uint16);
  32463. var LookupFlags = new r.Struct({
  32464. markAttachmentType: r.uint8,
  32465. flags: new r.Bitfield(r.uint8, ['rightToLeft', 'ignoreBaseGlyphs', 'ignoreLigatures', 'ignoreMarks', 'useMarkFilteringSet'])
  32466. });
  32467. function LookupList(SubTable) {
  32468. var Lookup = new r.Struct({
  32469. lookupType: r.uint16,
  32470. flags: LookupFlags,
  32471. subTableCount: r.uint16,
  32472. subTables: new r.Array(new r.Pointer(r.uint16, SubTable), 'subTableCount'),
  32473. markFilteringSet: new r.Optional(r.uint16, function (t) {
  32474. return t.flags.flags.useMarkFilteringSet;
  32475. })
  32476. });
  32477. return new r.LazyArray(new r.Pointer(r.uint16, Lookup), r.uint16);
  32478. }
  32479. //#################
  32480. // Coverage Table #
  32481. //#################
  32482. var RangeRecord = new r.Struct({
  32483. start: r.uint16,
  32484. end: r.uint16,
  32485. startCoverageIndex: r.uint16
  32486. });
  32487. var Coverage = new r.VersionedStruct(r.uint16, {
  32488. 1: {
  32489. glyphCount: r.uint16,
  32490. glyphs: new r.Array(r.uint16, 'glyphCount')
  32491. },
  32492. 2: {
  32493. rangeCount: r.uint16,
  32494. rangeRecords: new r.Array(RangeRecord, 'rangeCount')
  32495. }
  32496. });
  32497. //#########################
  32498. // Class Definition Table #
  32499. //#########################
  32500. var ClassRangeRecord = new r.Struct({
  32501. start: r.uint16,
  32502. end: r.uint16,
  32503. class: r.uint16
  32504. });
  32505. var ClassDef = new r.VersionedStruct(r.uint16, {
  32506. 1: { // Class array
  32507. startGlyph: r.uint16,
  32508. glyphCount: r.uint16,
  32509. classValueArray: new r.Array(r.uint16, 'glyphCount')
  32510. },
  32511. 2: { // Class ranges
  32512. classRangeCount: r.uint16,
  32513. classRangeRecord: new r.Array(ClassRangeRecord, 'classRangeCount')
  32514. }
  32515. });
  32516. //###############
  32517. // Device Table #
  32518. //###############
  32519. var Device = new r.Struct({
  32520. a: r.uint16, // startSize for hinting Device, outerIndex for VariationIndex
  32521. b: r.uint16, // endSize for Device, innerIndex for VariationIndex
  32522. deltaFormat: r.uint16
  32523. });
  32524. //#############################################
  32525. // Contextual Substitution/Positioning Tables #
  32526. //#############################################
  32527. var LookupRecord = new r.Struct({
  32528. sequenceIndex: r.uint16,
  32529. lookupListIndex: r.uint16
  32530. });
  32531. var Rule = new r.Struct({
  32532. glyphCount: r.uint16,
  32533. lookupCount: r.uint16,
  32534. input: new r.Array(r.uint16, function (t) {
  32535. return t.glyphCount - 1;
  32536. }),
  32537. lookupRecords: new r.Array(LookupRecord, 'lookupCount')
  32538. });
  32539. var RuleSet = new r.Array(new r.Pointer(r.uint16, Rule), r.uint16);
  32540. var ClassRule = new r.Struct({
  32541. glyphCount: r.uint16,
  32542. lookupCount: r.uint16,
  32543. classes: new r.Array(r.uint16, function (t) {
  32544. return t.glyphCount - 1;
  32545. }),
  32546. lookupRecords: new r.Array(LookupRecord, 'lookupCount')
  32547. });
  32548. var ClassSet = new r.Array(new r.Pointer(r.uint16, ClassRule), r.uint16);
  32549. var Context = new r.VersionedStruct(r.uint16, {
  32550. 1: { // Simple context
  32551. coverage: new r.Pointer(r.uint16, Coverage),
  32552. ruleSetCount: r.uint16,
  32553. ruleSets: new r.Array(new r.Pointer(r.uint16, RuleSet), 'ruleSetCount')
  32554. },
  32555. 2: { // Class-based context
  32556. coverage: new r.Pointer(r.uint16, Coverage),
  32557. classDef: new r.Pointer(r.uint16, ClassDef),
  32558. classSetCnt: r.uint16,
  32559. classSet: new r.Array(new r.Pointer(r.uint16, ClassSet), 'classSetCnt')
  32560. },
  32561. 3: {
  32562. glyphCount: r.uint16,
  32563. lookupCount: r.uint16,
  32564. coverages: new r.Array(new r.Pointer(r.uint16, Coverage), 'glyphCount'),
  32565. lookupRecords: new r.Array(LookupRecord, 'lookupCount')
  32566. }
  32567. });
  32568. //######################################################
  32569. // Chaining Contextual Substitution/Positioning Tables #
  32570. //######################################################
  32571. var ChainRule = new r.Struct({
  32572. backtrackGlyphCount: r.uint16,
  32573. backtrack: new r.Array(r.uint16, 'backtrackGlyphCount'),
  32574. inputGlyphCount: r.uint16,
  32575. input: new r.Array(r.uint16, function (t) {
  32576. return t.inputGlyphCount - 1;
  32577. }),
  32578. lookaheadGlyphCount: r.uint16,
  32579. lookahead: new r.Array(r.uint16, 'lookaheadGlyphCount'),
  32580. lookupCount: r.uint16,
  32581. lookupRecords: new r.Array(LookupRecord, 'lookupCount')
  32582. });
  32583. var ChainRuleSet = new r.Array(new r.Pointer(r.uint16, ChainRule), r.uint16);
  32584. var ChainingContext = new r.VersionedStruct(r.uint16, {
  32585. 1: { // Simple context glyph substitution
  32586. coverage: new r.Pointer(r.uint16, Coverage),
  32587. chainCount: r.uint16,
  32588. chainRuleSets: new r.Array(new r.Pointer(r.uint16, ChainRuleSet), 'chainCount')
  32589. },
  32590. 2: { // Class-based chaining context
  32591. coverage: new r.Pointer(r.uint16, Coverage),
  32592. backtrackClassDef: new r.Pointer(r.uint16, ClassDef),
  32593. inputClassDef: new r.Pointer(r.uint16, ClassDef),
  32594. lookaheadClassDef: new r.Pointer(r.uint16, ClassDef),
  32595. chainCount: r.uint16,
  32596. chainClassSet: new r.Array(new r.Pointer(r.uint16, ChainRuleSet), 'chainCount')
  32597. },
  32598. 3: { // Coverage-based chaining context
  32599. backtrackGlyphCount: r.uint16,
  32600. backtrackCoverage: new r.Array(new r.Pointer(r.uint16, Coverage), 'backtrackGlyphCount'),
  32601. inputGlyphCount: r.uint16,
  32602. inputCoverage: new r.Array(new r.Pointer(r.uint16, Coverage), 'inputGlyphCount'),
  32603. lookaheadGlyphCount: r.uint16,
  32604. lookaheadCoverage: new r.Array(new r.Pointer(r.uint16, Coverage), 'lookaheadGlyphCount'),
  32605. lookupCount: r.uint16,
  32606. lookupRecords: new r.Array(LookupRecord, 'lookupCount')
  32607. }
  32608. });
  32609. var _;
  32610. /*******************
  32611. * Variation Store *
  32612. *******************/
  32613. var F2DOT14 = new r.Fixed(16, 'BE', 14);
  32614. var RegionAxisCoordinates = new r.Struct({
  32615. startCoord: F2DOT14,
  32616. peakCoord: F2DOT14,
  32617. endCoord: F2DOT14
  32618. });
  32619. var VariationRegionList = new r.Struct({
  32620. axisCount: r.uint16,
  32621. regionCount: r.uint16,
  32622. variationRegions: new r.Array(new r.Array(RegionAxisCoordinates, 'axisCount'), 'regionCount')
  32623. });
  32624. var DeltaSet = new r.Struct({
  32625. shortDeltas: new r.Array(r.int16, function (t) {
  32626. return t.parent.shortDeltaCount;
  32627. }),
  32628. regionDeltas: new r.Array(r.int8, function (t) {
  32629. return t.parent.regionIndexCount - t.parent.shortDeltaCount;
  32630. }),
  32631. deltas: function deltas(t) {
  32632. return t.shortDeltas.concat(t.regionDeltas);
  32633. }
  32634. });
  32635. var ItemVariationData = new r.Struct({
  32636. itemCount: r.uint16,
  32637. shortDeltaCount: r.uint16,
  32638. regionIndexCount: r.uint16,
  32639. regionIndexes: new r.Array(r.uint16, 'regionIndexCount'),
  32640. deltaSets: new r.Array(DeltaSet, 'itemCount')
  32641. });
  32642. var ItemVariationStore = new r.Struct({
  32643. format: r.uint16,
  32644. variationRegionList: new r.Pointer(r.uint32, VariationRegionList),
  32645. variationDataCount: r.uint16,
  32646. itemVariationData: new r.Array(new r.Pointer(r.uint32, ItemVariationData), 'variationDataCount')
  32647. });
  32648. /**********************
  32649. * Feature Variations *
  32650. **********************/
  32651. var ConditionTable = new r.VersionedStruct(r.uint16, {
  32652. 1: (_ = {
  32653. axisIndex: r.uint16
  32654. }, _['axisIndex'] = r.uint16, _.filterRangeMinValue = F2DOT14, _.filterRangeMaxValue = F2DOT14, _)
  32655. });
  32656. var ConditionSet = new r.Struct({
  32657. conditionCount: r.uint16,
  32658. conditionTable: new r.Array(new r.Pointer(r.uint32, ConditionTable), 'conditionCount')
  32659. });
  32660. var FeatureTableSubstitutionRecord = new r.Struct({
  32661. featureIndex: r.uint16,
  32662. alternateFeatureTable: new r.Pointer(r.uint32, Feature, { type: 'parent' })
  32663. });
  32664. var FeatureTableSubstitution = new r.Struct({
  32665. version: r.fixed32,
  32666. substitutionCount: r.uint16,
  32667. substitutions: new r.Array(FeatureTableSubstitutionRecord, 'substitutionCount')
  32668. });
  32669. var FeatureVariationRecord = new r.Struct({
  32670. conditionSet: new r.Pointer(r.uint32, ConditionSet, { type: 'parent' }),
  32671. featureTableSubstitution: new r.Pointer(r.uint32, FeatureTableSubstitution, { type: 'parent' })
  32672. });
  32673. var FeatureVariations = new r.Struct({
  32674. majorVersion: r.uint16,
  32675. minorVersion: r.uint16,
  32676. featureVariationRecordCount: r.uint32,
  32677. featureVariationRecords: new r.Array(FeatureVariationRecord, 'featureVariationRecordCount')
  32678. });
  32679. // Checks if an operand is an index of a predefined value,
  32680. // otherwise delegates to the provided type.
  32681. var PredefinedOp = function () {
  32682. function PredefinedOp(predefinedOps, type) {
  32683. _classCallCheck(this, PredefinedOp);
  32684. this.predefinedOps = predefinedOps;
  32685. this.type = type;
  32686. }
  32687. PredefinedOp.prototype.decode = function decode(stream, parent, operands) {
  32688. if (this.predefinedOps[operands[0]]) {
  32689. return this.predefinedOps[operands[0]];
  32690. }
  32691. return this.type.decode(stream, parent, operands);
  32692. };
  32693. PredefinedOp.prototype.size = function size(value, ctx) {
  32694. return this.type.size(value, ctx);
  32695. };
  32696. PredefinedOp.prototype.encode = function encode(stream, value, ctx) {
  32697. var index = this.predefinedOps.indexOf(value);
  32698. if (index !== -1) {
  32699. return index;
  32700. }
  32701. return this.type.encode(stream, value, ctx);
  32702. };
  32703. return PredefinedOp;
  32704. }();
  32705. var CFFEncodingVersion = function (_r$Number) {
  32706. _inherits(CFFEncodingVersion, _r$Number);
  32707. function CFFEncodingVersion() {
  32708. _classCallCheck(this, CFFEncodingVersion);
  32709. return _possibleConstructorReturn(this, _r$Number.call(this, 'UInt8'));
  32710. }
  32711. CFFEncodingVersion.prototype.decode = function decode(stream) {
  32712. return r.uint8.decode(stream) & 0x7f;
  32713. };
  32714. return CFFEncodingVersion;
  32715. }(r.Number);
  32716. var Range1 = new r.Struct({
  32717. first: r.uint16,
  32718. nLeft: r.uint8
  32719. });
  32720. var Range2 = new r.Struct({
  32721. first: r.uint16,
  32722. nLeft: r.uint16
  32723. });
  32724. var CFFCustomEncoding = new r.VersionedStruct(new CFFEncodingVersion(), {
  32725. 0: {
  32726. nCodes: r.uint8,
  32727. codes: new r.Array(r.uint8, 'nCodes')
  32728. },
  32729. 1: {
  32730. nRanges: r.uint8,
  32731. ranges: new r.Array(Range1, 'nRanges')
  32732. // TODO: supplement?
  32733. } });
  32734. var CFFEncoding = new PredefinedOp([StandardEncoding, ExpertEncoding], new CFFPointer(CFFCustomEncoding, { lazy: true }));
  32735. // Decodes an array of ranges until the total
  32736. // length is equal to the provided length.
  32737. var RangeArray = function (_r$Array) {
  32738. _inherits(RangeArray, _r$Array);
  32739. function RangeArray() {
  32740. _classCallCheck(this, RangeArray);
  32741. return _possibleConstructorReturn(this, _r$Array.apply(this, arguments));
  32742. }
  32743. RangeArray.prototype.decode = function decode(stream, parent) {
  32744. var length = restructure_src_utils.resolveLength(this.length, stream, parent);
  32745. var count = 0;
  32746. var res = [];
  32747. while (count < length) {
  32748. var range = this.type.decode(stream, parent);
  32749. range.offset = count;
  32750. count += range.nLeft + 1;
  32751. res.push(range);
  32752. }
  32753. return res;
  32754. };
  32755. return RangeArray;
  32756. }(r.Array);
  32757. var CFFCustomCharset = new r.VersionedStruct(r.uint8, {
  32758. 0: {
  32759. glyphs: new r.Array(r.uint16, function (t) {
  32760. return t.parent.CharStrings.length - 1;
  32761. })
  32762. },
  32763. 1: {
  32764. ranges: new RangeArray(Range1, function (t) {
  32765. return t.parent.CharStrings.length - 1;
  32766. })
  32767. },
  32768. 2: {
  32769. ranges: new RangeArray(Range2, function (t) {
  32770. return t.parent.CharStrings.length - 1;
  32771. })
  32772. }
  32773. });
  32774. var CFFCharset = new PredefinedOp([ISOAdobeCharset, ExpertCharset, ExpertSubsetCharset], new CFFPointer(CFFCustomCharset, { lazy: true }));
  32775. var FDRange3 = new r.Struct({
  32776. first: r.uint16,
  32777. fd: r.uint8
  32778. });
  32779. var FDRange4 = new r.Struct({
  32780. first: r.uint32,
  32781. fd: r.uint16
  32782. });
  32783. var FDSelect = new r.VersionedStruct(r.uint8, {
  32784. 0: {
  32785. fds: new r.Array(r.uint8, function (t) {
  32786. return t.parent.CharStrings.length;
  32787. })
  32788. },
  32789. 3: {
  32790. nRanges: r.uint16,
  32791. ranges: new r.Array(FDRange3, 'nRanges'),
  32792. sentinel: r.uint16
  32793. },
  32794. 4: {
  32795. nRanges: r.uint32,
  32796. ranges: new r.Array(FDRange4, 'nRanges'),
  32797. sentinel: r.uint32
  32798. }
  32799. });
  32800. var ptr = new CFFPointer(CFFPrivateDict);
  32801. var CFFPrivateOp = function () {
  32802. function CFFPrivateOp() {
  32803. _classCallCheck(this, CFFPrivateOp);
  32804. }
  32805. CFFPrivateOp.prototype.decode = function decode(stream, parent, operands) {
  32806. parent.length = operands[0];
  32807. return ptr.decode(stream, parent, [operands[1]]);
  32808. };
  32809. CFFPrivateOp.prototype.size = function size(dict, ctx) {
  32810. return [CFFPrivateDict.size(dict, ctx, false), ptr.size(dict, ctx)[0]];
  32811. };
  32812. CFFPrivateOp.prototype.encode = function encode(stream, dict, ctx) {
  32813. return [CFFPrivateDict.size(dict, ctx, false), ptr.encode(stream, dict, ctx)[0]];
  32814. };
  32815. return CFFPrivateOp;
  32816. }();
  32817. var FontDict = new CFFDict([
  32818. // key name type(s) default
  32819. [18, 'Private', new CFFPrivateOp(), null], [[12, 38], 'FontName', 'sid', null]]);
  32820. var CFFTopDict = new CFFDict([
  32821. // key name type(s) default
  32822. [[12, 30], 'ROS', ['sid', 'sid', 'number'], null], [0, 'version', 'sid', null], [1, 'Notice', 'sid', null], [[12, 0], 'Copyright', 'sid', null], [2, 'FullName', 'sid', null], [3, 'FamilyName', 'sid', null], [4, 'Weight', 'sid', null], [[12, 1], 'isFixedPitch', 'boolean', false], [[12, 2], 'ItalicAngle', 'number', 0], [[12, 3], 'UnderlinePosition', 'number', -100], [[12, 4], 'UnderlineThickness', 'number', 50], [[12, 5], 'PaintType', 'number', 0], [[12, 6], 'CharstringType', 'number', 2], [[12, 7], 'FontMatrix', 'array', [0.001, 0, 0, 0.001, 0, 0]], [13, 'UniqueID', 'number', null], [5, 'FontBBox', 'array', [0, 0, 0, 0]], [[12, 8], 'StrokeWidth', 'number', 0], [14, 'XUID', 'array', null], [15, 'charset', CFFCharset, ISOAdobeCharset], [16, 'Encoding', CFFEncoding, StandardEncoding], [17, 'CharStrings', new CFFPointer(new CFFIndex()), null], [18, 'Private', new CFFPrivateOp(), null], [[12, 20], 'SyntheticBase', 'number', null], [[12, 21], 'PostScript', 'sid', null], [[12, 22], 'BaseFontName', 'sid', null], [[12, 23], 'BaseFontBlend', 'delta', null],
  32823. // CID font specific
  32824. [[12, 31], 'CIDFontVersion', 'number', 0], [[12, 32], 'CIDFontRevision', 'number', 0], [[12, 33], 'CIDFontType', 'number', 0], [[12, 34], 'CIDCount', 'number', 8720], [[12, 35], 'UIDBase', 'number', null], [[12, 37], 'FDSelect', new CFFPointer(FDSelect), null], [[12, 36], 'FDArray', new CFFPointer(new CFFIndex(FontDict)), null], [[12, 38], 'FontName', 'sid', null]]);
  32825. var VariationStore = new r.Struct({
  32826. length: r.uint16,
  32827. itemVariationStore: ItemVariationStore
  32828. });
  32829. var CFF2TopDict = new CFFDict([[[12, 7], 'FontMatrix', 'array', [0.001, 0, 0, 0.001, 0, 0]], [17, 'CharStrings', new CFFPointer(new CFFIndex()), null], [[12, 37], 'FDSelect', new CFFPointer(FDSelect), null], [[12, 36], 'FDArray', new CFFPointer(new CFFIndex(FontDict)), null], [24, 'vstore', new CFFPointer(VariationStore), null], [25, 'maxstack', 'number', 193]]);
  32830. var CFFTop = new r.VersionedStruct(r.fixed16, {
  32831. 1: {
  32832. hdrSize: r.uint8,
  32833. offSize: r.uint8,
  32834. nameIndex: new CFFIndex(new r.String('length')),
  32835. topDictIndex: new CFFIndex(CFFTopDict),
  32836. stringIndex: new CFFIndex(new r.String('length')),
  32837. globalSubrIndex: new CFFIndex()
  32838. },
  32839. 2: {
  32840. hdrSize: r.uint8,
  32841. length: r.uint16,
  32842. topDict: CFF2TopDict,
  32843. globalSubrIndex: new CFFIndex()
  32844. }
  32845. });
  32846. var CFFFont = function () {
  32847. function CFFFont(stream) {
  32848. _classCallCheck(this, CFFFont);
  32849. this.stream = stream;
  32850. this.decode();
  32851. }
  32852. CFFFont.decode = function decode(stream) {
  32853. return new CFFFont(stream);
  32854. };
  32855. CFFFont.prototype.decode = function decode() {
  32856. var start = this.stream.pos;
  32857. var top = CFFTop.decode(this.stream);
  32858. for (var key in top) {
  32859. var val = top[key];
  32860. this[key] = val;
  32861. }
  32862. if (this.version < 2) {
  32863. if (this.topDictIndex.length !== 1) {
  32864. throw new Error("Only a single font is allowed in CFF");
  32865. }
  32866. this.topDict = this.topDictIndex[0];
  32867. }
  32868. this.isCIDFont = this.topDict.ROS != null;
  32869. return this;
  32870. };
  32871. CFFFont.prototype.string = function string(sid) {
  32872. if (this.version >= 2) {
  32873. return null;
  32874. }
  32875. if (sid < standardStrings.length) {
  32876. return standardStrings[sid];
  32877. }
  32878. return this.stringIndex[sid - standardStrings.length];
  32879. };
  32880. CFFFont.prototype.getCharString = function getCharString(glyph) {
  32881. this.stream.pos = this.topDict.CharStrings[glyph].offset;
  32882. return this.stream.readBuffer(this.topDict.CharStrings[glyph].length);
  32883. };
  32884. CFFFont.prototype.getGlyphName = function getGlyphName(gid) {
  32885. // CFF2 glyph names are in the post table.
  32886. if (this.version >= 2) {
  32887. return null;
  32888. }
  32889. // CID-keyed fonts don't have glyph names
  32890. if (this.isCIDFont) {
  32891. return null;
  32892. }
  32893. var charset = this.topDict.charset;
  32894. if (Array.isArray(charset)) {
  32895. return charset[gid];
  32896. }
  32897. if (gid === 0) {
  32898. return '.notdef';
  32899. }
  32900. gid -= 1;
  32901. switch (charset.version) {
  32902. case 0:
  32903. return this.string(charset.glyphs[gid]);
  32904. case 1:
  32905. case 2:
  32906. for (var i = 0; i < charset.ranges.length; i++) {
  32907. var range = charset.ranges[i];
  32908. if (range.offset <= gid && gid <= range.offset + range.nLeft) {
  32909. return this.string(range.first + (gid - range.offset));
  32910. }
  32911. }
  32912. break;
  32913. }
  32914. return null;
  32915. };
  32916. CFFFont.prototype.fdForGlyph = function fdForGlyph(gid) {
  32917. if (!this.topDict.FDSelect) {
  32918. return null;
  32919. }
  32920. switch (this.topDict.FDSelect.version) {
  32921. case 0:
  32922. return this.topDict.FDSelect.fds[gid];
  32923. case 3:
  32924. case 4:
  32925. var ranges = this.topDict.FDSelect.ranges;
  32926. var low = 0;
  32927. var high = ranges.length - 1;
  32928. while (low <= high) {
  32929. var mid = low + high >> 1;
  32930. if (gid < ranges[mid].first) {
  32931. high = mid - 1;
  32932. } else if (mid < high && gid > ranges[mid + 1].first) {
  32933. low = mid + 1;
  32934. } else {
  32935. return ranges[mid].fd;
  32936. }
  32937. }
  32938. default:
  32939. throw new Error('Unknown FDSelect version: ' + this.topDict.FDSelect.version);
  32940. }
  32941. };
  32942. CFFFont.prototype.privateDictForGlyph = function privateDictForGlyph(gid) {
  32943. if (this.topDict.FDSelect) {
  32944. var fd = this.fdForGlyph(gid);
  32945. if (this.topDict.FDArray[fd]) {
  32946. return this.topDict.FDArray[fd].Private;
  32947. }
  32948. return null;
  32949. }
  32950. if (this.version < 2) {
  32951. return this.topDict.Private;
  32952. }
  32953. return this.topDict.FDArray[0].Private;
  32954. };
  32955. _createClass(CFFFont, [{
  32956. key: 'postscriptName',
  32957. get: function get() {
  32958. if (this.version < 2) {
  32959. return this.nameIndex[0];
  32960. }
  32961. return null;
  32962. }
  32963. }, {
  32964. key: 'fullName',
  32965. get: function get() {
  32966. return this.string(this.topDict.FullName);
  32967. }
  32968. }, {
  32969. key: 'familyName',
  32970. get: function get() {
  32971. return this.string(this.topDict.FamilyName);
  32972. }
  32973. }]);
  32974. return CFFFont;
  32975. }();
  32976. var VerticalOrigin = new r.Struct({
  32977. glyphIndex: r.uint16,
  32978. vertOriginY: r.int16
  32979. });
  32980. var VORG = new r.Struct({
  32981. majorVersion: r.uint16,
  32982. minorVersion: r.uint16,
  32983. defaultVertOriginY: r.int16,
  32984. numVertOriginYMetrics: r.uint16,
  32985. metrics: new r.Array(VerticalOrigin, 'numVertOriginYMetrics')
  32986. });
  32987. var BigMetrics = new r.Struct({
  32988. height: r.uint8,
  32989. width: r.uint8,
  32990. horiBearingX: r.int8,
  32991. horiBearingY: r.int8,
  32992. horiAdvance: r.uint8,
  32993. vertBearingX: r.int8,
  32994. vertBearingY: r.int8,
  32995. vertAdvance: r.uint8
  32996. });
  32997. var SmallMetrics = new r.Struct({
  32998. height: r.uint8,
  32999. width: r.uint8,
  33000. bearingX: r.int8,
  33001. bearingY: r.int8,
  33002. advance: r.uint8
  33003. });
  33004. var EBDTComponent = new r.Struct({
  33005. glyph: r.uint16,
  33006. xOffset: r.int8,
  33007. yOffset: r.int8
  33008. });
  33009. var ByteAligned = function ByteAligned() {
  33010. _classCallCheck(this, ByteAligned);
  33011. };
  33012. var BitAligned = function BitAligned() {
  33013. _classCallCheck(this, BitAligned);
  33014. };
  33015. var glyph = new r.VersionedStruct('version', {
  33016. 1: {
  33017. metrics: SmallMetrics,
  33018. data: ByteAligned
  33019. },
  33020. 2: {
  33021. metrics: SmallMetrics,
  33022. data: BitAligned
  33023. },
  33024. // format 3 is deprecated
  33025. // format 4 is not supported by Microsoft
  33026. 5: {
  33027. data: BitAligned
  33028. },
  33029. 6: {
  33030. metrics: BigMetrics,
  33031. data: ByteAligned
  33032. },
  33033. 7: {
  33034. metrics: BigMetrics,
  33035. data: BitAligned
  33036. },
  33037. 8: {
  33038. metrics: SmallMetrics,
  33039. pad: new r.Reserved(r.uint8),
  33040. numComponents: r.uint16,
  33041. components: new r.Array(EBDTComponent, 'numComponents')
  33042. },
  33043. 9: {
  33044. metrics: BigMetrics,
  33045. pad: new r.Reserved(r.uint8),
  33046. numComponents: r.uint16,
  33047. components: new r.Array(EBDTComponent, 'numComponents')
  33048. },
  33049. 17: {
  33050. metrics: SmallMetrics,
  33051. dataLen: r.uint32,
  33052. data: new r.Buffer('dataLen')
  33053. },
  33054. 18: {
  33055. metrics: BigMetrics,
  33056. dataLen: r.uint32,
  33057. data: new r.Buffer('dataLen')
  33058. },
  33059. 19: {
  33060. dataLen: r.uint32,
  33061. data: new r.Buffer('dataLen')
  33062. }
  33063. });
  33064. var SBitLineMetrics = new r.Struct({
  33065. ascender: r.int8,
  33066. descender: r.int8,
  33067. widthMax: r.uint8,
  33068. caretSlopeNumerator: r.int8,
  33069. caretSlopeDenominator: r.int8,
  33070. caretOffset: r.int8,
  33071. minOriginSB: r.int8,
  33072. minAdvanceSB: r.int8,
  33073. maxBeforeBL: r.int8,
  33074. minAfterBL: r.int8,
  33075. pad: new r.Reserved(r.int8, 2)
  33076. });
  33077. var CodeOffsetPair = new r.Struct({
  33078. glyphCode: r.uint16,
  33079. offset: r.uint16
  33080. });
  33081. var IndexSubtable = new r.VersionedStruct(r.uint16, {
  33082. header: {
  33083. imageFormat: r.uint16,
  33084. imageDataOffset: r.uint32
  33085. },
  33086. 1: {
  33087. offsetArray: new r.Array(r.uint32, function (t) {
  33088. return t.parent.lastGlyphIndex - t.parent.firstGlyphIndex + 1;
  33089. })
  33090. },
  33091. 2: {
  33092. imageSize: r.uint32,
  33093. bigMetrics: BigMetrics
  33094. },
  33095. 3: {
  33096. offsetArray: new r.Array(r.uint16, function (t) {
  33097. return t.parent.lastGlyphIndex - t.parent.firstGlyphIndex + 1;
  33098. })
  33099. },
  33100. 4: {
  33101. numGlyphs: r.uint32,
  33102. glyphArray: new r.Array(CodeOffsetPair, function (t) {
  33103. return t.numGlyphs + 1;
  33104. })
  33105. },
  33106. 5: {
  33107. imageSize: r.uint32,
  33108. bigMetrics: BigMetrics,
  33109. numGlyphs: r.uint32,
  33110. glyphCodeArray: new r.Array(r.uint16, 'numGlyphs')
  33111. }
  33112. });
  33113. var IndexSubtableArray = new r.Struct({
  33114. firstGlyphIndex: r.uint16,
  33115. lastGlyphIndex: r.uint16,
  33116. subtable: new r.Pointer(r.uint32, IndexSubtable)
  33117. });
  33118. var BitmapSizeTable = new r.Struct({
  33119. indexSubTableArray: new r.Pointer(r.uint32, new r.Array(IndexSubtableArray, 1), { type: 'parent' }),
  33120. indexTablesSize: r.uint32,
  33121. numberOfIndexSubTables: r.uint32,
  33122. colorRef: r.uint32,
  33123. hori: SBitLineMetrics,
  33124. vert: SBitLineMetrics,
  33125. startGlyphIndex: r.uint16,
  33126. endGlyphIndex: r.uint16,
  33127. ppemX: r.uint8,
  33128. ppemY: r.uint8,
  33129. bitDepth: r.uint8,
  33130. flags: new r.Bitfield(r.uint8, ['horizontal', 'vertical'])
  33131. });
  33132. var EBLC = new r.Struct({
  33133. version: r.uint32, // 0x00020000
  33134. numSizes: r.uint32,
  33135. sizes: new r.Array(BitmapSizeTable, 'numSizes')
  33136. });
  33137. var ImageTable = new r.Struct({
  33138. ppem: r.uint16,
  33139. resolution: r.uint16,
  33140. imageOffsets: new r.Array(new r.Pointer(r.uint32, 'void'), function (t) {
  33141. return t.parent.parent.maxp.numGlyphs + 1;
  33142. })
  33143. });
  33144. // This is the Apple sbix table, used by the "Apple Color Emoji" font.
  33145. // It includes several image tables with images for each bitmap glyph
  33146. // of several different sizes.
  33147. var sbix = new r.Struct({
  33148. version: r.uint16,
  33149. flags: new r.Bitfield(r.uint16, ['renderOutlines']),
  33150. numImgTables: r.uint32,
  33151. imageTables: new r.Array(new r.Pointer(r.uint32, ImageTable), 'numImgTables')
  33152. });
  33153. var LayerRecord = new r.Struct({
  33154. gid: r.uint16, // Glyph ID of layer glyph (must be in z-order from bottom to top).
  33155. paletteIndex: r.uint16 // Index value to use in the appropriate palette. This value must
  33156. }); // be less than numPaletteEntries in the CPAL table, except for
  33157. // the special case noted below. Each palette entry is 16 bits.
  33158. // A palette index of 0xFFFF is a special case indicating that
  33159. // the text foreground color should be used.
  33160. var BaseGlyphRecord = new r.Struct({
  33161. gid: r.uint16, // Glyph ID of reference glyph. This glyph is for reference only
  33162. // and is not rendered for color.
  33163. firstLayerIndex: r.uint16, // Index (from beginning of the Layer Records) to the layer record.
  33164. // There will be numLayers consecutive entries for this base glyph.
  33165. numLayers: r.uint16
  33166. });
  33167. var COLR = new r.Struct({
  33168. version: r.uint16,
  33169. numBaseGlyphRecords: r.uint16,
  33170. baseGlyphRecord: new r.Pointer(r.uint32, new r.Array(BaseGlyphRecord, 'numBaseGlyphRecords')),
  33171. layerRecords: new r.Pointer(r.uint32, new r.Array(LayerRecord, 'numLayerRecords'), { lazy: true }),
  33172. numLayerRecords: r.uint16
  33173. });
  33174. var ColorRecord = new r.Struct({
  33175. blue: r.uint8,
  33176. green: r.uint8,
  33177. red: r.uint8,
  33178. alpha: r.uint8
  33179. });
  33180. var CPAL = new r.VersionedStruct(r.uint16, {
  33181. header: {
  33182. numPaletteEntries: r.uint16,
  33183. numPalettes: r.uint16,
  33184. numColorRecords: r.uint16,
  33185. colorRecords: new r.Pointer(r.uint32, new r.Array(ColorRecord, 'numColorRecords')),
  33186. colorRecordIndices: new r.Array(r.uint16, 'numPalettes')
  33187. },
  33188. 0: {},
  33189. 1: {
  33190. offsetPaletteTypeArray: new r.Pointer(r.uint32, new r.Array(r.uint32, 'numPalettes')),
  33191. offsetPaletteLabelArray: new r.Pointer(r.uint32, new r.Array(r.uint16, 'numPalettes')),
  33192. offsetPaletteEntryLabelArray: new r.Pointer(r.uint32, new r.Array(r.uint16, 'numPaletteEntries'))
  33193. }
  33194. });
  33195. var BaseCoord = new r.VersionedStruct(r.uint16, {
  33196. 1: { // Design units only
  33197. coordinate: r.int16 // X or Y value, in design units
  33198. },
  33199. 2: { // Design units plus contour point
  33200. coordinate: r.int16, // X or Y value, in design units
  33201. referenceGlyph: r.uint16, // GlyphID of control glyph
  33202. baseCoordPoint: r.uint16 // Index of contour point on the referenceGlyph
  33203. },
  33204. 3: { // Design units plus Device table
  33205. coordinate: r.int16, // X or Y value, in design units
  33206. deviceTable: new r.Pointer(r.uint16, Device) // Device table for X or Y value
  33207. }
  33208. });
  33209. var BaseValues = new r.Struct({
  33210. defaultIndex: r.uint16, // Index of default baseline for this script-same index in the BaseTagList
  33211. baseCoordCount: r.uint16,
  33212. baseCoords: new r.Array(new r.Pointer(r.uint16, BaseCoord), 'baseCoordCount')
  33213. });
  33214. var FeatMinMaxRecord = new r.Struct({
  33215. tag: new r.String(4), // 4-byte feature identification tag-must match FeatureTag in FeatureList
  33216. minCoord: new r.Pointer(r.uint16, BaseCoord, { type: 'parent' }), // May be NULL
  33217. maxCoord: new r.Pointer(r.uint16, BaseCoord, { type: 'parent' }) // May be NULL
  33218. });
  33219. var MinMax = new r.Struct({
  33220. minCoord: new r.Pointer(r.uint16, BaseCoord), // May be NULL
  33221. maxCoord: new r.Pointer(r.uint16, BaseCoord), // May be NULL
  33222. featMinMaxCount: r.uint16, // May be 0
  33223. featMinMaxRecords: new r.Array(FeatMinMaxRecord, 'featMinMaxCount') // In alphabetical order
  33224. });
  33225. var BaseLangSysRecord = new r.Struct({
  33226. tag: new r.String(4), // 4-byte language system identification tag
  33227. minMax: new r.Pointer(r.uint16, MinMax, { type: 'parent' })
  33228. });
  33229. var BaseScript = new r.Struct({
  33230. baseValues: new r.Pointer(r.uint16, BaseValues), // May be NULL
  33231. defaultMinMax: new r.Pointer(r.uint16, MinMax), // May be NULL
  33232. baseLangSysCount: r.uint16, // May be 0
  33233. baseLangSysRecords: new r.Array(BaseLangSysRecord, 'baseLangSysCount') // in alphabetical order by BaseLangSysTag
  33234. });
  33235. var BaseScriptRecord = new r.Struct({
  33236. tag: new r.String(4), // 4-byte script identification tag
  33237. script: new r.Pointer(r.uint16, BaseScript, { type: 'parent' })
  33238. });
  33239. var BaseScriptList = new r.Array(BaseScriptRecord, r.uint16);
  33240. // Array of 4-byte baseline identification tags-must be in alphabetical order
  33241. var BaseTagList = new r.Array(new r.String(4), r.uint16);
  33242. var Axis = new r.Struct({
  33243. baseTagList: new r.Pointer(r.uint16, BaseTagList), // May be NULL
  33244. baseScriptList: new r.Pointer(r.uint16, BaseScriptList)
  33245. });
  33246. var BASE = new r.VersionedStruct(r.uint32, {
  33247. header: {
  33248. horizAxis: new r.Pointer(r.uint16, Axis), // May be NULL
  33249. vertAxis: new r.Pointer(r.uint16, Axis) // May be NULL
  33250. },
  33251. 0x00010000: {},
  33252. 0x00010001: {
  33253. itemVariationStore: new r.Pointer(r.uint32, ItemVariationStore)
  33254. }
  33255. });
  33256. var AttachPoint = new r.Array(r.uint16, r.uint16);
  33257. var AttachList = new r.Struct({
  33258. coverage: new r.Pointer(r.uint16, Coverage),
  33259. glyphCount: r.uint16,
  33260. attachPoints: new r.Array(new r.Pointer(r.uint16, AttachPoint), 'glyphCount')
  33261. });
  33262. var CaretValue = new r.VersionedStruct(r.uint16, {
  33263. 1: { // Design units only
  33264. coordinate: r.int16
  33265. },
  33266. 2: { // Contour point
  33267. caretValuePoint: r.uint16
  33268. },
  33269. 3: { // Design units plus Device table
  33270. coordinate: r.int16,
  33271. deviceTable: new r.Pointer(r.uint16, Device)
  33272. }
  33273. });
  33274. var LigGlyph = new r.Array(new r.Pointer(r.uint16, CaretValue), r.uint16);
  33275. var LigCaretList = new r.Struct({
  33276. coverage: new r.Pointer(r.uint16, Coverage),
  33277. ligGlyphCount: r.uint16,
  33278. ligGlyphs: new r.Array(new r.Pointer(r.uint16, LigGlyph), 'ligGlyphCount')
  33279. });
  33280. var MarkGlyphSetsDef = new r.Struct({
  33281. markSetTableFormat: r.uint16,
  33282. markSetCount: r.uint16,
  33283. coverage: new r.Array(new r.Pointer(r.uint32, Coverage), 'markSetCount')
  33284. });
  33285. var GDEF = new r.VersionedStruct(r.uint32, {
  33286. header: {
  33287. glyphClassDef: new r.Pointer(r.uint16, ClassDef),
  33288. attachList: new r.Pointer(r.uint16, AttachList),
  33289. ligCaretList: new r.Pointer(r.uint16, LigCaretList),
  33290. markAttachClassDef: new r.Pointer(r.uint16, ClassDef)
  33291. },
  33292. 0x00010000: {},
  33293. 0x00010002: {
  33294. markGlyphSetsDef: new r.Pointer(r.uint16, MarkGlyphSetsDef)
  33295. },
  33296. 0x00010003: {
  33297. markGlyphSetsDef: new r.Pointer(r.uint16, MarkGlyphSetsDef),
  33298. itemVariationStore: new r.Pointer(r.uint32, ItemVariationStore)
  33299. }
  33300. });
  33301. var ValueFormat = new r.Bitfield(r.uint16, ['xPlacement', 'yPlacement', 'xAdvance', 'yAdvance', 'xPlaDevice', 'yPlaDevice', 'xAdvDevice', 'yAdvDevice']);
  33302. var types = {
  33303. xPlacement: r.int16,
  33304. yPlacement: r.int16,
  33305. xAdvance: r.int16,
  33306. yAdvance: r.int16,
  33307. xPlaDevice: new r.Pointer(r.uint16, Device, { type: 'global', relativeTo: 'rel' }),
  33308. yPlaDevice: new r.Pointer(r.uint16, Device, { type: 'global', relativeTo: 'rel' }),
  33309. xAdvDevice: new r.Pointer(r.uint16, Device, { type: 'global', relativeTo: 'rel' }),
  33310. yAdvDevice: new r.Pointer(r.uint16, Device, { type: 'global', relativeTo: 'rel' })
  33311. };
  33312. var ValueRecord = function () {
  33313. function ValueRecord() {
  33314. var key = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'valueFormat';
  33315. _classCallCheck(this, ValueRecord);
  33316. this.key = key;
  33317. }
  33318. ValueRecord.prototype.buildStruct = function buildStruct(parent) {
  33319. var struct = parent;
  33320. while (!struct[this.key] && struct.parent) {
  33321. struct = struct.parent;
  33322. }
  33323. if (!struct[this.key]) return;
  33324. var fields = {};
  33325. fields.rel = function () {
  33326. return struct._startOffset;
  33327. };
  33328. var format = struct[this.key];
  33329. for (var key in format) {
  33330. if (format[key]) {
  33331. fields[key] = types[key];
  33332. }
  33333. }
  33334. return new r.Struct(fields);
  33335. };
  33336. ValueRecord.prototype.size = function size(val, ctx) {
  33337. return this.buildStruct(ctx).size(val, ctx);
  33338. };
  33339. ValueRecord.prototype.decode = function decode(stream, parent) {
  33340. var res = this.buildStruct(parent).decode(stream, parent);
  33341. delete res.rel;
  33342. return res;
  33343. };
  33344. return ValueRecord;
  33345. }();
  33346. var PairValueRecord = new r.Struct({
  33347. secondGlyph: r.uint16,
  33348. value1: new ValueRecord('valueFormat1'),
  33349. value2: new ValueRecord('valueFormat2')
  33350. });
  33351. var PairSet = new r.Array(PairValueRecord, r.uint16);
  33352. var Class2Record = new r.Struct({
  33353. value1: new ValueRecord('valueFormat1'),
  33354. value2: new ValueRecord('valueFormat2')
  33355. });
  33356. var Anchor = new r.VersionedStruct(r.uint16, {
  33357. 1: { // Design units only
  33358. xCoordinate: r.int16,
  33359. yCoordinate: r.int16
  33360. },
  33361. 2: { // Design units plus contour point
  33362. xCoordinate: r.int16,
  33363. yCoordinate: r.int16,
  33364. anchorPoint: r.uint16
  33365. },
  33366. 3: { // Design units plus Device tables
  33367. xCoordinate: r.int16,
  33368. yCoordinate: r.int16,
  33369. xDeviceTable: new r.Pointer(r.uint16, Device),
  33370. yDeviceTable: new r.Pointer(r.uint16, Device)
  33371. }
  33372. });
  33373. var EntryExitRecord = new r.Struct({
  33374. entryAnchor: new r.Pointer(r.uint16, Anchor, { type: 'parent' }),
  33375. exitAnchor: new r.Pointer(r.uint16, Anchor, { type: 'parent' })
  33376. });
  33377. var MarkRecord = new r.Struct({
  33378. class: r.uint16,
  33379. markAnchor: new r.Pointer(r.uint16, Anchor, { type: 'parent' })
  33380. });
  33381. var MarkArray = new r.Array(MarkRecord, r.uint16);
  33382. var BaseRecord = new r.Array(new r.Pointer(r.uint16, Anchor), function (t) {
  33383. return t.parent.classCount;
  33384. });
  33385. var BaseArray = new r.Array(BaseRecord, r.uint16);
  33386. var ComponentRecord = new r.Array(new r.Pointer(r.uint16, Anchor), function (t) {
  33387. return t.parent.parent.classCount;
  33388. });
  33389. var LigatureAttach = new r.Array(ComponentRecord, r.uint16);
  33390. var LigatureArray = new r.Array(new r.Pointer(r.uint16, LigatureAttach), r.uint16);
  33391. var GPOSLookup = new r.VersionedStruct('lookupType', {
  33392. 1: new r.VersionedStruct(r.uint16, { // Single Adjustment
  33393. 1: { // Single positioning value
  33394. coverage: new r.Pointer(r.uint16, Coverage),
  33395. valueFormat: ValueFormat,
  33396. value: new ValueRecord()
  33397. },
  33398. 2: {
  33399. coverage: new r.Pointer(r.uint16, Coverage),
  33400. valueFormat: ValueFormat,
  33401. valueCount: r.uint16,
  33402. values: new r.LazyArray(new ValueRecord(), 'valueCount')
  33403. }
  33404. }),
  33405. 2: new r.VersionedStruct(r.uint16, { // Pair Adjustment Positioning
  33406. 1: { // Adjustments for glyph pairs
  33407. coverage: new r.Pointer(r.uint16, Coverage),
  33408. valueFormat1: ValueFormat,
  33409. valueFormat2: ValueFormat,
  33410. pairSetCount: r.uint16,
  33411. pairSets: new r.LazyArray(new r.Pointer(r.uint16, PairSet), 'pairSetCount')
  33412. },
  33413. 2: { // Class pair adjustment
  33414. coverage: new r.Pointer(r.uint16, Coverage),
  33415. valueFormat1: ValueFormat,
  33416. valueFormat2: ValueFormat,
  33417. classDef1: new r.Pointer(r.uint16, ClassDef),
  33418. classDef2: new r.Pointer(r.uint16, ClassDef),
  33419. class1Count: r.uint16,
  33420. class2Count: r.uint16,
  33421. classRecords: new r.LazyArray(new r.LazyArray(Class2Record, 'class2Count'), 'class1Count')
  33422. }
  33423. }),
  33424. 3: { // Cursive Attachment Positioning
  33425. format: r.uint16,
  33426. coverage: new r.Pointer(r.uint16, Coverage),
  33427. entryExitCount: r.uint16,
  33428. entryExitRecords: new r.Array(EntryExitRecord, 'entryExitCount')
  33429. },
  33430. 4: { // MarkToBase Attachment Positioning
  33431. format: r.uint16,
  33432. markCoverage: new r.Pointer(r.uint16, Coverage),
  33433. baseCoverage: new r.Pointer(r.uint16, Coverage),
  33434. classCount: r.uint16,
  33435. markArray: new r.Pointer(r.uint16, MarkArray),
  33436. baseArray: new r.Pointer(r.uint16, BaseArray)
  33437. },
  33438. 5: { // MarkToLigature Attachment Positioning
  33439. format: r.uint16,
  33440. markCoverage: new r.Pointer(r.uint16, Coverage),
  33441. ligatureCoverage: new r.Pointer(r.uint16, Coverage),
  33442. classCount: r.uint16,
  33443. markArray: new r.Pointer(r.uint16, MarkArray),
  33444. ligatureArray: new r.Pointer(r.uint16, LigatureArray)
  33445. },
  33446. 6: { // MarkToMark Attachment Positioning
  33447. format: r.uint16,
  33448. mark1Coverage: new r.Pointer(r.uint16, Coverage),
  33449. mark2Coverage: new r.Pointer(r.uint16, Coverage),
  33450. classCount: r.uint16,
  33451. mark1Array: new r.Pointer(r.uint16, MarkArray),
  33452. mark2Array: new r.Pointer(r.uint16, BaseArray)
  33453. },
  33454. 7: Context, // Contextual positioning
  33455. 8: ChainingContext, // Chaining contextual positioning
  33456. 9: { // Extension Positioning
  33457. posFormat: r.uint16,
  33458. lookupType: r.uint16, // cannot also be 9
  33459. extension: new r.Pointer(r.uint32, GPOSLookup)
  33460. }
  33461. });
  33462. // Fix circular reference
  33463. GPOSLookup.versions[9].extension.type = GPOSLookup;
  33464. var GPOS = new r.VersionedStruct(r.uint32, {
  33465. header: {
  33466. scriptList: new r.Pointer(r.uint16, ScriptList),
  33467. featureList: new r.Pointer(r.uint16, FeatureList),
  33468. lookupList: new r.Pointer(r.uint16, new LookupList(GPOSLookup))
  33469. },
  33470. 0x00010000: {},
  33471. 0x00010001: {
  33472. featureVariations: new r.Pointer(r.uint32, FeatureVariations)
  33473. }
  33474. });
  33475. var Sequence = new r.Array(r.uint16, r.uint16);
  33476. var AlternateSet = Sequence;
  33477. var Ligature = new r.Struct({
  33478. glyph: r.uint16,
  33479. compCount: r.uint16,
  33480. components: new r.Array(r.uint16, function (t) {
  33481. return t.compCount - 1;
  33482. })
  33483. });
  33484. var LigatureSet = new r.Array(new r.Pointer(r.uint16, Ligature), r.uint16);
  33485. var GSUBLookup = new r.VersionedStruct('lookupType', {
  33486. 1: new r.VersionedStruct(r.uint16, { // Single Substitution
  33487. 1: {
  33488. coverage: new r.Pointer(r.uint16, Coverage),
  33489. deltaGlyphID: r.int16
  33490. },
  33491. 2: {
  33492. coverage: new r.Pointer(r.uint16, Coverage),
  33493. glyphCount: r.uint16,
  33494. substitute: new r.LazyArray(r.uint16, 'glyphCount')
  33495. }
  33496. }),
  33497. 2: { // Multiple Substitution
  33498. substFormat: r.uint16,
  33499. coverage: new r.Pointer(r.uint16, Coverage),
  33500. count: r.uint16,
  33501. sequences: new r.LazyArray(new r.Pointer(r.uint16, Sequence), 'count')
  33502. },
  33503. 3: { // Alternate Substitution
  33504. substFormat: r.uint16,
  33505. coverage: new r.Pointer(r.uint16, Coverage),
  33506. count: r.uint16,
  33507. alternateSet: new r.LazyArray(new r.Pointer(r.uint16, AlternateSet), 'count')
  33508. },
  33509. 4: { // Ligature Substitution
  33510. substFormat: r.uint16,
  33511. coverage: new r.Pointer(r.uint16, Coverage),
  33512. count: r.uint16,
  33513. ligatureSets: new r.LazyArray(new r.Pointer(r.uint16, LigatureSet), 'count')
  33514. },
  33515. 5: Context, // Contextual Substitution
  33516. 6: ChainingContext, // Chaining Contextual Substitution
  33517. 7: { // Extension Substitution
  33518. substFormat: r.uint16,
  33519. lookupType: r.uint16, // cannot also be 7
  33520. extension: new r.Pointer(r.uint32, GSUBLookup)
  33521. },
  33522. 8: { // Reverse Chaining Contextual Single Substitution
  33523. substFormat: r.uint16,
  33524. coverage: new r.Pointer(r.uint16, Coverage),
  33525. backtrackCoverage: new r.Array(new r.Pointer(r.uint16, Coverage), 'backtrackGlyphCount'),
  33526. lookaheadGlyphCount: r.uint16,
  33527. lookaheadCoverage: new r.Array(new r.Pointer(r.uint16, Coverage), 'lookaheadGlyphCount'),
  33528. glyphCount: r.uint16,
  33529. substitutes: new r.Array(r.uint16, 'glyphCount')
  33530. }
  33531. });
  33532. // Fix circular reference
  33533. GSUBLookup.versions[7].extension.type = GSUBLookup;
  33534. var GSUB = new r.VersionedStruct(r.uint32, {
  33535. header: {
  33536. scriptList: new r.Pointer(r.uint16, ScriptList),
  33537. featureList: new r.Pointer(r.uint16, FeatureList),
  33538. lookupList: new r.Pointer(r.uint16, new LookupList(GSUBLookup))
  33539. },
  33540. 0x00010000: {},
  33541. 0x00010001: {
  33542. featureVariations: new r.Pointer(r.uint32, FeatureVariations)
  33543. }
  33544. });
  33545. var JstfGSUBModList = new r.Array(r.uint16, r.uint16);
  33546. var JstfPriority = new r.Struct({
  33547. shrinkageEnableGSUB: new r.Pointer(r.uint16, JstfGSUBModList),
  33548. shrinkageDisableGSUB: new r.Pointer(r.uint16, JstfGSUBModList),
  33549. shrinkageEnableGPOS: new r.Pointer(r.uint16, JstfGSUBModList),
  33550. shrinkageDisableGPOS: new r.Pointer(r.uint16, JstfGSUBModList),
  33551. shrinkageJstfMax: new r.Pointer(r.uint16, new LookupList(GPOSLookup)),
  33552. extensionEnableGSUB: new r.Pointer(r.uint16, JstfGSUBModList),
  33553. extensionDisableGSUB: new r.Pointer(r.uint16, JstfGSUBModList),
  33554. extensionEnableGPOS: new r.Pointer(r.uint16, JstfGSUBModList),
  33555. extensionDisableGPOS: new r.Pointer(r.uint16, JstfGSUBModList),
  33556. extensionJstfMax: new r.Pointer(r.uint16, new LookupList(GPOSLookup))
  33557. });
  33558. var JstfLangSys = new r.Array(new r.Pointer(r.uint16, JstfPriority), r.uint16);
  33559. var JstfLangSysRecord = new r.Struct({
  33560. tag: new r.String(4),
  33561. jstfLangSys: new r.Pointer(r.uint16, JstfLangSys)
  33562. });
  33563. var JstfScript = new r.Struct({
  33564. extenderGlyphs: new r.Pointer(r.uint16, new r.Array(r.uint16, r.uint16)), // array of glyphs to extend line length
  33565. defaultLangSys: new r.Pointer(r.uint16, JstfLangSys),
  33566. langSysCount: r.uint16,
  33567. langSysRecords: new r.Array(JstfLangSysRecord, 'langSysCount')
  33568. });
  33569. var JstfScriptRecord = new r.Struct({
  33570. tag: new r.String(4),
  33571. script: new r.Pointer(r.uint16, JstfScript, { type: 'parent' })
  33572. });
  33573. var JSTF = new r.Struct({
  33574. version: r.uint32, // should be 0x00010000
  33575. scriptCount: r.uint16,
  33576. scriptList: new r.Array(JstfScriptRecord, 'scriptCount')
  33577. });
  33578. // TODO: add this to restructure
  33579. var VariableSizeNumber = function () {
  33580. function VariableSizeNumber(size) {
  33581. _classCallCheck(this, VariableSizeNumber);
  33582. this._size = size;
  33583. }
  33584. VariableSizeNumber.prototype.decode = function decode(stream, parent) {
  33585. switch (this.size(0, parent)) {
  33586. case 1:
  33587. return stream.readUInt8();
  33588. case 2:
  33589. return stream.readUInt16BE();
  33590. case 3:
  33591. return stream.readUInt24BE();
  33592. case 4:
  33593. return stream.readUInt32BE();
  33594. }
  33595. };
  33596. VariableSizeNumber.prototype.size = function size(val, parent) {
  33597. return restructure_src_utils.resolveLength(this._size, null, parent);
  33598. };
  33599. return VariableSizeNumber;
  33600. }();
  33601. var MapDataEntry = new r.Struct({
  33602. entry: new VariableSizeNumber(function (t) {
  33603. return ((t.parent.entryFormat & 0x0030) >> 4) + 1;
  33604. }),
  33605. outerIndex: function outerIndex(t) {
  33606. return t.entry >> (t.parent.entryFormat & 0x000F) + 1;
  33607. },
  33608. innerIndex: function innerIndex(t) {
  33609. return t.entry & (1 << (t.parent.entryFormat & 0x000F) + 1) - 1;
  33610. }
  33611. });
  33612. var DeltaSetIndexMap = new r.Struct({
  33613. entryFormat: r.uint16,
  33614. mapCount: r.uint16,
  33615. mapData: new r.Array(MapDataEntry, 'mapCount')
  33616. });
  33617. var HVAR = new r.Struct({
  33618. majorVersion: r.uint16,
  33619. minorVersion: r.uint16,
  33620. itemVariationStore: new r.Pointer(r.uint32, ItemVariationStore),
  33621. advanceWidthMapping: new r.Pointer(r.uint32, DeltaSetIndexMap),
  33622. LSBMapping: new r.Pointer(r.uint32, DeltaSetIndexMap),
  33623. RSBMapping: new r.Pointer(r.uint32, DeltaSetIndexMap)
  33624. });
  33625. var Signature = new r.Struct({
  33626. format: r.uint32,
  33627. length: r.uint32,
  33628. offset: r.uint32
  33629. });
  33630. var SignatureBlock = new r.Struct({
  33631. reserved: new r.Reserved(r.uint16, 2),
  33632. cbSignature: r.uint32, // Length (in bytes) of the PKCS#7 packet in pbSignature
  33633. signature: new r.Buffer('cbSignature')
  33634. });
  33635. var DSIG = new r.Struct({
  33636. ulVersion: r.uint32, // Version number of the DSIG table (0x00000001)
  33637. usNumSigs: r.uint16, // Number of signatures in the table
  33638. usFlag: r.uint16, // Permission flags
  33639. signatures: new r.Array(Signature, 'usNumSigs'),
  33640. signatureBlocks: new r.Array(SignatureBlock, 'usNumSigs')
  33641. });
  33642. var GaspRange = new r.Struct({
  33643. rangeMaxPPEM: r.uint16, // Upper limit of range, in ppem
  33644. rangeGaspBehavior: new r.Bitfield(r.uint16, [// Flags describing desired rasterizer behavior
  33645. 'grayscale', 'gridfit', 'symmetricSmoothing', 'symmetricGridfit' // only in version 1, for ClearType
  33646. ])
  33647. });
  33648. var gasp = new r.Struct({
  33649. version: r.uint16, // set to 0
  33650. numRanges: r.uint16,
  33651. gaspRanges: new r.Array(GaspRange, 'numRanges') // Sorted by ppem
  33652. });
  33653. var DeviceRecord = new r.Struct({
  33654. pixelSize: r.uint8,
  33655. maximumWidth: r.uint8,
  33656. widths: new r.Array(r.uint8, function (t) {
  33657. return t.parent.parent.maxp.numGlyphs;
  33658. })
  33659. });
  33660. // The Horizontal Device Metrics table stores integer advance widths scaled to particular pixel sizes
  33661. var hdmx = new r.Struct({
  33662. version: r.uint16,
  33663. numRecords: r.int16,
  33664. sizeDeviceRecord: r.int32,
  33665. records: new r.Array(DeviceRecord, 'numRecords')
  33666. });
  33667. var KernPair = new r.Struct({
  33668. left: r.uint16,
  33669. right: r.uint16,
  33670. value: r.int16
  33671. });
  33672. var ClassTable = new r.Struct({
  33673. firstGlyph: r.uint16,
  33674. nGlyphs: r.uint16,
  33675. offsets: new r.Array(r.uint16, 'nGlyphs'),
  33676. max: function max(t) {
  33677. return t.offsets.length && Math.max.apply(Math, t.offsets);
  33678. }
  33679. });
  33680. var Kern2Array = new r.Struct({
  33681. off: function off(t) {
  33682. return t._startOffset - t.parent.parent._startOffset;
  33683. },
  33684. len: function len(t) {
  33685. return ((t.parent.leftTable.max - t.off) / t.parent.rowWidth + 1) * (t.parent.rowWidth / 2);
  33686. },
  33687. values: new r.LazyArray(r.int16, 'len')
  33688. });
  33689. var KernSubtable = new r.VersionedStruct('format', {
  33690. 0: {
  33691. nPairs: r.uint16,
  33692. searchRange: r.uint16,
  33693. entrySelector: r.uint16,
  33694. rangeShift: r.uint16,
  33695. pairs: new r.Array(KernPair, 'nPairs')
  33696. },
  33697. 2: {
  33698. rowWidth: r.uint16,
  33699. leftTable: new r.Pointer(r.uint16, ClassTable, { type: 'parent' }),
  33700. rightTable: new r.Pointer(r.uint16, ClassTable, { type: 'parent' }),
  33701. array: new r.Pointer(r.uint16, Kern2Array, { type: 'parent' })
  33702. },
  33703. 3: {
  33704. glyphCount: r.uint16,
  33705. kernValueCount: r.uint8,
  33706. leftClassCount: r.uint8,
  33707. rightClassCount: r.uint8,
  33708. flags: r.uint8,
  33709. kernValue: new r.Array(r.int16, 'kernValueCount'),
  33710. leftClass: new r.Array(r.uint8, 'glyphCount'),
  33711. rightClass: new r.Array(r.uint8, 'glyphCount'),
  33712. kernIndex: new r.Array(r.uint8, function (t) {
  33713. return t.leftClassCount * t.rightClassCount;
  33714. })
  33715. }
  33716. });
  33717. var KernTable = new r.VersionedStruct('version', {
  33718. 0: { // Microsoft uses this format
  33719. subVersion: r.uint16, // Microsoft has an extra sub-table version number
  33720. length: r.uint16, // Length of the subtable, in bytes
  33721. format: r.uint8, // Format of subtable
  33722. coverage: new r.Bitfield(r.uint8, ['horizontal', // 1 if table has horizontal data, 0 if vertical
  33723. 'minimum', // If set to 1, the table has minimum values. If set to 0, the table has kerning values.
  33724. 'crossStream', // If set to 1, kerning is perpendicular to the flow of the text
  33725. 'override' // If set to 1 the value in this table replaces the accumulated value
  33726. ]),
  33727. subtable: KernSubtable,
  33728. padding: new r.Reserved(r.uint8, function (t) {
  33729. return t.length - t._currentOffset;
  33730. })
  33731. },
  33732. 1: { // Apple uses this format
  33733. length: r.uint32,
  33734. coverage: new r.Bitfield(r.uint8, [null, null, null, null, null, 'variation', // Set if table has variation kerning values
  33735. 'crossStream', // Set if table has cross-stream kerning values
  33736. 'vertical' // Set if table has vertical kerning values
  33737. ]),
  33738. format: r.uint8,
  33739. tupleIndex: r.uint16,
  33740. subtable: KernSubtable,
  33741. padding: new r.Reserved(r.uint8, function (t) {
  33742. return t.length - t._currentOffset;
  33743. })
  33744. }
  33745. });
  33746. var kern = new r.VersionedStruct(r.uint16, {
  33747. 0: { // Microsoft Version
  33748. nTables: r.uint16,
  33749. tables: new r.Array(KernTable, 'nTables')
  33750. },
  33751. 1: { // Apple Version
  33752. reserved: new r.Reserved(r.uint16), // the other half of the version number
  33753. nTables: r.uint32,
  33754. tables: new r.Array(KernTable, 'nTables')
  33755. }
  33756. });
  33757. // Linear Threshold table
  33758. // Records the ppem for each glyph at which the scaling becomes linear again,
  33759. // despite instructions effecting the advance width
  33760. var LTSH = new r.Struct({
  33761. version: r.uint16,
  33762. numGlyphs: r.uint16,
  33763. yPels: new r.Array(r.uint8, 'numGlyphs')
  33764. });
  33765. // PCL 5 Table
  33766. // NOTE: The PCLT table is strongly discouraged for OpenType fonts with TrueType outlines
  33767. var PCLT = new r.Struct({
  33768. version: r.uint16,
  33769. fontNumber: r.uint32,
  33770. pitch: r.uint16,
  33771. xHeight: r.uint16,
  33772. style: r.uint16,
  33773. typeFamily: r.uint16,
  33774. capHeight: r.uint16,
  33775. symbolSet: r.uint16,
  33776. typeface: new r.String(16),
  33777. characterComplement: new r.String(8),
  33778. fileName: new r.String(6),
  33779. strokeWeight: new r.String(1),
  33780. widthType: new r.String(1),
  33781. serifStyle: r.uint8,
  33782. reserved: new r.Reserved(r.uint8)
  33783. });
  33784. // VDMX tables contain ascender/descender overrides for certain (usually small)
  33785. // sizes. This is needed in order to match font metrics on Windows.
  33786. var Ratio = new r.Struct({
  33787. bCharSet: r.uint8, // Character set
  33788. xRatio: r.uint8, // Value to use for x-Ratio
  33789. yStartRatio: r.uint8, // Starting y-Ratio value
  33790. yEndRatio: r.uint8 // Ending y-Ratio value
  33791. });
  33792. var vTable = new r.Struct({
  33793. yPelHeight: r.uint16, // yPelHeight to which values apply
  33794. yMax: r.int16, // Maximum value (in pels) for this yPelHeight
  33795. yMin: r.int16 // Minimum value (in pels) for this yPelHeight
  33796. });
  33797. var VdmxGroup = new r.Struct({
  33798. recs: r.uint16, // Number of height records in this group
  33799. startsz: r.uint8, // Starting yPelHeight
  33800. endsz: r.uint8, // Ending yPelHeight
  33801. entries: new r.Array(vTable, 'recs') // The VDMX records
  33802. });
  33803. var VDMX = new r.Struct({
  33804. version: r.uint16, // Version number (0 or 1)
  33805. numRecs: r.uint16, // Number of VDMX groups present
  33806. numRatios: r.uint16, // Number of aspect ratio groupings
  33807. ratioRanges: new r.Array(Ratio, 'numRatios'), // Ratio ranges
  33808. offsets: new r.Array(r.uint16, 'numRatios'), // Offset to the VDMX group for this ratio range
  33809. groups: new r.Array(VdmxGroup, 'numRecs') // The actual VDMX groupings
  33810. });
  33811. // Vertical Header Table
  33812. var vhea = new r.Struct({
  33813. version: r.uint16, // Version number of the Vertical Header Table
  33814. ascent: r.int16, // The vertical typographic ascender for this font
  33815. descent: r.int16, // The vertical typographic descender for this font
  33816. lineGap: r.int16, // The vertical typographic line gap for this font
  33817. advanceHeightMax: r.int16, // The maximum advance height measurement found in the font
  33818. minTopSideBearing: r.int16, // The minimum top side bearing measurement found in the font
  33819. minBottomSideBearing: r.int16, // The minimum bottom side bearing measurement found in the font
  33820. yMaxExtent: r.int16,
  33821. caretSlopeRise: r.int16, // Caret slope (rise/run)
  33822. caretSlopeRun: r.int16,
  33823. caretOffset: r.int16, // Set value equal to 0 for nonslanted fonts
  33824. reserved: new r.Reserved(r.int16, 4),
  33825. metricDataFormat: r.int16, // Set to 0
  33826. numberOfMetrics: r.uint16 // Number of advance heights in the Vertical Metrics table
  33827. });
  33828. var VmtxEntry = new r.Struct({
  33829. advance: r.uint16, // The advance height of the glyph
  33830. bearing: r.int16 // The top sidebearing of the glyph
  33831. });
  33832. // Vertical Metrics Table
  33833. var vmtx = new r.Struct({
  33834. metrics: new r.LazyArray(VmtxEntry, function (t) {
  33835. return t.parent.vhea.numberOfMetrics;
  33836. }),
  33837. bearings: new r.LazyArray(r.int16, function (t) {
  33838. return t.parent.maxp.numGlyphs - t.parent.vhea.numberOfMetrics;
  33839. })
  33840. });
  33841. var shortFrac = new r.Fixed(16, 'BE', 14);
  33842. var Correspondence = new r.Struct({
  33843. fromCoord: shortFrac,
  33844. toCoord: shortFrac
  33845. });
  33846. var Segment = new r.Struct({
  33847. pairCount: r.uint16,
  33848. correspondence: new r.Array(Correspondence, 'pairCount')
  33849. });
  33850. var avar = new r.Struct({
  33851. version: r.fixed32,
  33852. axisCount: r.uint32,
  33853. segment: new r.Array(Segment, 'axisCount')
  33854. });
  33855. var UnboundedArrayAccessor = function () {
  33856. function UnboundedArrayAccessor(type, stream, parent) {
  33857. _classCallCheck(this, UnboundedArrayAccessor);
  33858. this.type = type;
  33859. this.stream = stream;
  33860. this.parent = parent;
  33861. this.base = this.stream.pos;
  33862. this._items = [];
  33863. }
  33864. UnboundedArrayAccessor.prototype.getItem = function getItem(index) {
  33865. if (this._items[index] == null) {
  33866. var pos = this.stream.pos;
  33867. this.stream.pos = this.base + this.type.size(null, this.parent) * index;
  33868. this._items[index] = this.type.decode(this.stream, this.parent);
  33869. this.stream.pos = pos;
  33870. }
  33871. return this._items[index];
  33872. };
  33873. UnboundedArrayAccessor.prototype.inspect = function inspect() {
  33874. return '[UnboundedArray ' + this.type.constructor.name + ']';
  33875. };
  33876. return UnboundedArrayAccessor;
  33877. }();
  33878. var UnboundedArray = function (_r$Array) {
  33879. _inherits(UnboundedArray, _r$Array);
  33880. function UnboundedArray(type) {
  33881. _classCallCheck(this, UnboundedArray);
  33882. return _possibleConstructorReturn(this, _r$Array.call(this, type, 0));
  33883. }
  33884. UnboundedArray.prototype.decode = function decode(stream, parent) {
  33885. return new UnboundedArrayAccessor(this.type, stream, parent);
  33886. };
  33887. return UnboundedArray;
  33888. }(r.Array);
  33889. var LookupTable = function LookupTable() {
  33890. var ValueType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : r.uint16;
  33891. // Helper class that makes internal structures invisible to pointers
  33892. var Shadow = function () {
  33893. function Shadow(type) {
  33894. _classCallCheck(this, Shadow);
  33895. this.type = type;
  33896. }
  33897. Shadow.prototype.decode = function decode(stream, ctx) {
  33898. ctx = ctx.parent.parent;
  33899. return this.type.decode(stream, ctx);
  33900. };
  33901. Shadow.prototype.size = function size(val, ctx) {
  33902. ctx = ctx.parent.parent;
  33903. return this.type.size(val, ctx);
  33904. };
  33905. Shadow.prototype.encode = function encode(stream, val, ctx) {
  33906. ctx = ctx.parent.parent;
  33907. return this.type.encode(stream, val, ctx);
  33908. };
  33909. return Shadow;
  33910. }();
  33911. ValueType = new Shadow(ValueType);
  33912. var BinarySearchHeader = new r.Struct({
  33913. unitSize: r.uint16,
  33914. nUnits: r.uint16,
  33915. searchRange: r.uint16,
  33916. entrySelector: r.uint16,
  33917. rangeShift: r.uint16
  33918. });
  33919. var LookupSegmentSingle = new r.Struct({
  33920. lastGlyph: r.uint16,
  33921. firstGlyph: r.uint16,
  33922. value: ValueType
  33923. });
  33924. var LookupSegmentArray = new r.Struct({
  33925. lastGlyph: r.uint16,
  33926. firstGlyph: r.uint16,
  33927. values: new r.Pointer(r.uint16, new r.Array(ValueType, function (t) {
  33928. return t.lastGlyph - t.firstGlyph + 1;
  33929. }), { type: 'parent' })
  33930. });
  33931. var LookupSingle = new r.Struct({
  33932. glyph: r.uint16,
  33933. value: ValueType
  33934. });
  33935. return new r.VersionedStruct(r.uint16, {
  33936. 0: {
  33937. values: new UnboundedArray(ValueType) // length == number of glyphs maybe?
  33938. },
  33939. 2: {
  33940. binarySearchHeader: BinarySearchHeader,
  33941. segments: new r.Array(LookupSegmentSingle, function (t) {
  33942. return t.binarySearchHeader.nUnits;
  33943. })
  33944. },
  33945. 4: {
  33946. binarySearchHeader: BinarySearchHeader,
  33947. segments: new r.Array(LookupSegmentArray, function (t) {
  33948. return t.binarySearchHeader.nUnits;
  33949. })
  33950. },
  33951. 6: {
  33952. binarySearchHeader: BinarySearchHeader,
  33953. segments: new r.Array(LookupSingle, function (t) {
  33954. return t.binarySearchHeader.nUnits;
  33955. })
  33956. },
  33957. 8: {
  33958. firstGlyph: r.uint16,
  33959. count: r.uint16,
  33960. values: new r.Array(ValueType, 'count')
  33961. }
  33962. });
  33963. };
  33964. function StateTable() {
  33965. var entryData = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  33966. var lookupType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : r.uint16;
  33967. var entry = _Object$assign({
  33968. newState: r.uint16,
  33969. flags: r.uint16
  33970. }, entryData);
  33971. var Entry = new r.Struct(entry);
  33972. var StateArray = new UnboundedArray(new r.Array(r.uint16, function (t) {
  33973. return t.nClasses;
  33974. }));
  33975. var StateHeader = new r.Struct({
  33976. nClasses: r.uint32,
  33977. classTable: new r.Pointer(r.uint32, new LookupTable(lookupType)),
  33978. stateArray: new r.Pointer(r.uint32, StateArray),
  33979. entryTable: new r.Pointer(r.uint32, new UnboundedArray(Entry))
  33980. });
  33981. return StateHeader;
  33982. }
  33983. // This is the old version of the StateTable structure
  33984. function StateTable1() {
  33985. var entryData = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  33986. var lookupType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : r.uint16;
  33987. var ClassLookupTable = new r.Struct({
  33988. version: function version() {
  33989. return 8;
  33990. },
  33991. // simulate LookupTable
  33992. firstGlyph: r.uint16,
  33993. values: new r.Array(r.uint8, r.uint16)
  33994. });
  33995. var entry = _Object$assign({
  33996. newStateOffset: r.uint16,
  33997. // convert offset to stateArray index
  33998. newState: function newState(t) {
  33999. return (t.newStateOffset - (t.parent.stateArray.base - t.parent._startOffset)) / t.parent.nClasses;
  34000. },
  34001. flags: r.uint16
  34002. }, entryData);
  34003. var Entry = new r.Struct(entry);
  34004. var StateArray = new UnboundedArray(new r.Array(r.uint8, function (t) {
  34005. return t.nClasses;
  34006. }));
  34007. var StateHeader1 = new r.Struct({
  34008. nClasses: r.uint16,
  34009. classTable: new r.Pointer(r.uint16, ClassLookupTable),
  34010. stateArray: new r.Pointer(r.uint16, StateArray),
  34011. entryTable: new r.Pointer(r.uint16, new UnboundedArray(Entry))
  34012. });
  34013. return StateHeader1;
  34014. }
  34015. var BslnSubtable = new r.VersionedStruct('format', {
  34016. 0: { // Distance-based, no mapping
  34017. deltas: new r.Array(r.int16, 32)
  34018. },
  34019. 1: { // Distance-based, with mapping
  34020. deltas: new r.Array(r.int16, 32),
  34021. mappingData: new LookupTable(r.uint16)
  34022. },
  34023. 2: { // Control point-based, no mapping
  34024. standardGlyph: r.uint16,
  34025. controlPoints: new r.Array(r.uint16, 32)
  34026. },
  34027. 3: { // Control point-based, with mapping
  34028. standardGlyph: r.uint16,
  34029. controlPoints: new r.Array(r.uint16, 32),
  34030. mappingData: new LookupTable(r.uint16)
  34031. }
  34032. });
  34033. var bsln = new r.Struct({
  34034. version: r.fixed32,
  34035. format: r.uint16,
  34036. defaultBaseline: r.uint16,
  34037. subtable: BslnSubtable
  34038. });
  34039. var Setting = new r.Struct({
  34040. setting: r.uint16,
  34041. nameIndex: r.int16,
  34042. name: function name(t) {
  34043. return t.parent.parent.parent.name.records.fontFeatures[t.nameIndex];
  34044. }
  34045. });
  34046. var FeatureName = new r.Struct({
  34047. feature: r.uint16,
  34048. nSettings: r.uint16,
  34049. settingTable: new r.Pointer(r.uint32, new r.Array(Setting, 'nSettings'), { type: 'parent' }),
  34050. featureFlags: new r.Bitfield(r.uint8, [null, null, null, null, null, null, 'hasDefault', 'exclusive']),
  34051. defaultSetting: r.uint8,
  34052. nameIndex: r.int16,
  34053. name: function name(t) {
  34054. return t.parent.parent.name.records.fontFeatures[t.nameIndex];
  34055. }
  34056. });
  34057. var feat = new r.Struct({
  34058. version: r.fixed32,
  34059. featureNameCount: r.uint16,
  34060. reserved1: new r.Reserved(r.uint16),
  34061. reserved2: new r.Reserved(r.uint32),
  34062. featureNames: new r.Array(FeatureName, 'featureNameCount')
  34063. });
  34064. var Axis$1 = new r.Struct({
  34065. axisTag: new r.String(4),
  34066. minValue: r.fixed32,
  34067. defaultValue: r.fixed32,
  34068. maxValue: r.fixed32,
  34069. flags: r.uint16,
  34070. nameID: r.uint16,
  34071. name: function name(t) {
  34072. return t.parent.parent.name.records.fontFeatures[t.nameID];
  34073. }
  34074. });
  34075. var Instance = new r.Struct({
  34076. nameID: r.uint16,
  34077. name: function name(t) {
  34078. return t.parent.parent.name.records.fontFeatures[t.nameID];
  34079. },
  34080. flags: r.uint16,
  34081. coord: new r.Array(r.fixed32, function (t) {
  34082. return t.parent.axisCount;
  34083. }),
  34084. postscriptNameID: new r.Optional(r.uint16, function (t) {
  34085. return t.parent.instanceSize - t._currentOffset > 0;
  34086. })
  34087. });
  34088. var fvar = new r.Struct({
  34089. version: r.fixed32,
  34090. offsetToData: r.uint16,
  34091. countSizePairs: r.uint16,
  34092. axisCount: r.uint16,
  34093. axisSize: r.uint16,
  34094. instanceCount: r.uint16,
  34095. instanceSize: r.uint16,
  34096. axis: new r.Array(Axis$1, 'axisCount'),
  34097. instance: new r.Array(Instance, 'instanceCount')
  34098. });
  34099. var shortFrac$1 = new r.Fixed(16, 'BE', 14);
  34100. var Offset = function () {
  34101. function Offset() {
  34102. _classCallCheck(this, Offset);
  34103. }
  34104. Offset.decode = function decode(stream, parent) {
  34105. // In short format, offsets are multiplied by 2.
  34106. // This doesn't seem to be documented by Apple, but it
  34107. // is implemented this way in Freetype.
  34108. return parent.flags ? stream.readUInt32BE() : stream.readUInt16BE() * 2;
  34109. };
  34110. return Offset;
  34111. }();
  34112. var gvar = new r.Struct({
  34113. version: r.uint16,
  34114. reserved: new r.Reserved(r.uint16),
  34115. axisCount: r.uint16,
  34116. globalCoordCount: r.uint16,
  34117. globalCoords: new r.Pointer(r.uint32, new r.Array(new r.Array(shortFrac$1, 'axisCount'), 'globalCoordCount')),
  34118. glyphCount: r.uint16,
  34119. flags: r.uint16,
  34120. offsetToData: r.uint32,
  34121. offsets: new r.Array(new r.Pointer(Offset, 'void', { relativeTo: 'offsetToData', allowNull: false }), function (t) {
  34122. return t.glyphCount + 1;
  34123. })
  34124. });
  34125. var ClassTable$1 = new r.Struct({
  34126. length: r.uint16,
  34127. coverage: r.uint16,
  34128. subFeatureFlags: r.uint32,
  34129. stateTable: new StateTable1()
  34130. });
  34131. var WidthDeltaRecord = new r.Struct({
  34132. justClass: r.uint32,
  34133. beforeGrowLimit: r.fixed32,
  34134. beforeShrinkLimit: r.fixed32,
  34135. afterGrowLimit: r.fixed32,
  34136. afterShrinkLimit: r.fixed32,
  34137. growFlags: r.uint16,
  34138. shrinkFlags: r.uint16
  34139. });
  34140. var WidthDeltaCluster = new r.Array(WidthDeltaRecord, r.uint32);
  34141. var ActionData = new r.VersionedStruct('actionType', {
  34142. 0: { // Decomposition action
  34143. lowerLimit: r.fixed32,
  34144. upperLimit: r.fixed32,
  34145. order: r.uint16,
  34146. glyphs: new r.Array(r.uint16, r.uint16)
  34147. },
  34148. 1: { // Unconditional add glyph action
  34149. addGlyph: r.uint16
  34150. },
  34151. 2: { // Conditional add glyph action
  34152. substThreshold: r.fixed32,
  34153. addGlyph: r.uint16,
  34154. substGlyph: r.uint16
  34155. },
  34156. 3: {}, // Stretch glyph action (no data, not supported by CoreText)
  34157. 4: { // Ductile glyph action (not supported by CoreText)
  34158. variationAxis: r.uint32,
  34159. minimumLimit: r.fixed32,
  34160. noStretchValue: r.fixed32,
  34161. maximumLimit: r.fixed32
  34162. },
  34163. 5: { // Repeated add glyph action
  34164. flags: r.uint16,
  34165. glyph: r.uint16
  34166. }
  34167. });
  34168. var Action = new r.Struct({
  34169. actionClass: r.uint16,
  34170. actionType: r.uint16,
  34171. actionLength: r.uint32,
  34172. actionData: ActionData,
  34173. padding: new r.Reserved(r.uint8, function (t) {
  34174. return t.actionLength - t._currentOffset;
  34175. })
  34176. });
  34177. var PostcompensationAction = new r.Array(Action, r.uint32);
  34178. var PostCompensationTable = new r.Struct({
  34179. lookupTable: new LookupTable(new r.Pointer(r.uint16, PostcompensationAction))
  34180. });
  34181. var JustificationTable = new r.Struct({
  34182. classTable: new r.Pointer(r.uint16, ClassTable$1, { type: 'parent' }),
  34183. wdcOffset: r.uint16,
  34184. postCompensationTable: new r.Pointer(r.uint16, PostCompensationTable, { type: 'parent' }),
  34185. widthDeltaClusters: new LookupTable(new r.Pointer(r.uint16, WidthDeltaCluster, { type: 'parent', relativeTo: 'wdcOffset' }))
  34186. });
  34187. var just = new r.Struct({
  34188. version: r.uint32,
  34189. format: r.uint16,
  34190. horizontal: new r.Pointer(r.uint16, JustificationTable),
  34191. vertical: new r.Pointer(r.uint16, JustificationTable)
  34192. });
  34193. var LigatureData = {
  34194. action: r.uint16
  34195. };
  34196. var ContextualData = {
  34197. markIndex: r.uint16,
  34198. currentIndex: r.uint16
  34199. };
  34200. var InsertionData = {
  34201. currentInsertIndex: r.uint16,
  34202. markedInsertIndex: r.uint16
  34203. };
  34204. var SubstitutionTable = new r.Struct({
  34205. items: new UnboundedArray(new r.Pointer(r.uint32, new LookupTable()))
  34206. });
  34207. var SubtableData = new r.VersionedStruct('type', {
  34208. 0: { // Indic Rearrangement Subtable
  34209. stateTable: new StateTable()
  34210. },
  34211. 1: { // Contextual Glyph Substitution Subtable
  34212. stateTable: new StateTable(ContextualData),
  34213. substitutionTable: new r.Pointer(r.uint32, SubstitutionTable)
  34214. },
  34215. 2: { // Ligature subtable
  34216. stateTable: new StateTable(LigatureData),
  34217. ligatureActions: new r.Pointer(r.uint32, new UnboundedArray(r.uint32)),
  34218. components: new r.Pointer(r.uint32, new UnboundedArray(r.uint16)),
  34219. ligatureList: new r.Pointer(r.uint32, new UnboundedArray(r.uint16))
  34220. },
  34221. 4: { // Non-contextual Glyph Substitution Subtable
  34222. lookupTable: new LookupTable()
  34223. },
  34224. 5: { // Glyph Insertion Subtable
  34225. stateTable: new StateTable(InsertionData),
  34226. insertionActions: new r.Pointer(r.uint32, new UnboundedArray(r.uint16))
  34227. }
  34228. });
  34229. var Subtable = new r.Struct({
  34230. length: r.uint32,
  34231. coverage: r.uint24,
  34232. type: r.uint8,
  34233. subFeatureFlags: r.uint32,
  34234. table: SubtableData,
  34235. padding: new r.Reserved(r.uint8, function (t) {
  34236. return t.length - t._currentOffset;
  34237. })
  34238. });
  34239. var FeatureEntry = new r.Struct({
  34240. featureType: r.uint16,
  34241. featureSetting: r.uint16,
  34242. enableFlags: r.uint32,
  34243. disableFlags: r.uint32
  34244. });
  34245. var MorxChain = new r.Struct({
  34246. defaultFlags: r.uint32,
  34247. chainLength: r.uint32,
  34248. nFeatureEntries: r.uint32,
  34249. nSubtables: r.uint32,
  34250. features: new r.Array(FeatureEntry, 'nFeatureEntries'),
  34251. subtables: new r.Array(Subtable, 'nSubtables')
  34252. });
  34253. var morx = new r.Struct({
  34254. version: r.uint16,
  34255. unused: new r.Reserved(r.uint16),
  34256. nChains: r.uint32,
  34257. chains: new r.Array(MorxChain, 'nChains')
  34258. });
  34259. var OpticalBounds = new r.Struct({
  34260. left: r.int16,
  34261. top: r.int16,
  34262. right: r.int16,
  34263. bottom: r.int16
  34264. });
  34265. var opbd = new r.Struct({
  34266. version: r.fixed32,
  34267. format: r.uint16,
  34268. lookupTable: new LookupTable(OpticalBounds)
  34269. });
  34270. var tables = {};
  34271. // Required Tables
  34272. tables.cmap = cmap;
  34273. tables.head = head;
  34274. tables.hhea = hhea;
  34275. tables.hmtx = hmtx;
  34276. tables.maxp = maxp;
  34277. tables.name = NameTable;
  34278. tables['OS/2'] = OS2;
  34279. tables.post = post;
  34280. // TrueType Outlines
  34281. tables.fpgm = fpgm;
  34282. tables.loca = loca;
  34283. tables.prep = prep;
  34284. tables['cvt '] = cvt;
  34285. tables.glyf = glyf;
  34286. // PostScript Outlines
  34287. tables['CFF '] = CFFFont;
  34288. tables['CFF2'] = CFFFont;
  34289. tables.VORG = VORG;
  34290. // Bitmap Glyphs
  34291. tables.EBLC = EBLC;
  34292. tables.CBLC = tables.EBLC;
  34293. tables.sbix = sbix;
  34294. tables.COLR = COLR;
  34295. tables.CPAL = CPAL;
  34296. // Advanced OpenType Tables
  34297. tables.BASE = BASE;
  34298. tables.GDEF = GDEF;
  34299. tables.GPOS = GPOS;
  34300. tables.GSUB = GSUB;
  34301. tables.JSTF = JSTF;
  34302. // OpenType variations tables
  34303. tables.HVAR = HVAR;
  34304. // Other OpenType Tables
  34305. tables.DSIG = DSIG;
  34306. tables.gasp = gasp;
  34307. tables.hdmx = hdmx;
  34308. tables.kern = kern;
  34309. tables.LTSH = LTSH;
  34310. tables.PCLT = PCLT;
  34311. tables.VDMX = VDMX;
  34312. tables.vhea = vhea;
  34313. tables.vmtx = vmtx;
  34314. // Apple Advanced Typography Tables
  34315. tables.avar = avar;
  34316. tables.bsln = bsln;
  34317. tables.feat = feat;
  34318. tables.fvar = fvar;
  34319. tables.gvar = gvar;
  34320. tables.just = just;
  34321. tables.morx = morx;
  34322. tables.opbd = opbd;
  34323. var TableEntry = new r.Struct({
  34324. tag: new r.String(4),
  34325. checkSum: r.uint32,
  34326. offset: new r.Pointer(r.uint32, 'void', { type: 'global' }),
  34327. length: r.uint32
  34328. });
  34329. var Directory = new r.Struct({
  34330. tag: new r.String(4),
  34331. numTables: r.uint16,
  34332. searchRange: r.uint16,
  34333. entrySelector: r.uint16,
  34334. rangeShift: r.uint16,
  34335. tables: new r.Array(TableEntry, 'numTables')
  34336. });
  34337. Directory.process = function () {
  34338. var tables = {};
  34339. for (var _iterator = this.tables, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _getIterator(_iterator);;) {
  34340. var _ref;
  34341. if (_isArray) {
  34342. if (_i >= _iterator.length) break;
  34343. _ref = _iterator[_i++];
  34344. } else {
  34345. _i = _iterator.next();
  34346. if (_i.done) break;
  34347. _ref = _i.value;
  34348. }
  34349. var table = _ref;
  34350. tables[table.tag] = table;
  34351. }
  34352. this.tables = tables;
  34353. };
  34354. Directory.preEncode = function (stream) {
  34355. var tables$$ = [];
  34356. for (var tag in this.tables) {
  34357. var table = this.tables[tag];
  34358. if (table) {
  34359. tables$$.push({
  34360. tag: tag,
  34361. checkSum: 0,
  34362. offset: new r.VoidPointer(tables[tag], table),
  34363. length: tables[tag].size(table)
  34364. });
  34365. }
  34366. }
  34367. this.tag = 'true';
  34368. this.numTables = tables$$.length;
  34369. this.tables = tables$$;
  34370. var maxExponentFor2 = Math.floor(Math.log(this.numTables) / Math.LN2);
  34371. var maxPowerOf2 = Math.pow(2, maxExponentFor2);
  34372. this.searchRange = maxPowerOf2 * 16;
  34373. this.entrySelector = Math.log(maxPowerOf2) / Math.LN2;
  34374. this.rangeShift = this.numTables * 16 - this.searchRange;
  34375. };
  34376. function binarySearch(arr, cmp) {
  34377. var min = 0;
  34378. var max = arr.length - 1;
  34379. while (min <= max) {
  34380. var mid = min + max >> 1;
  34381. var res = cmp(arr[mid]);
  34382. if (res < 0) {
  34383. max = mid - 1;
  34384. } else if (res > 0) {
  34385. min = mid + 1;
  34386. } else {
  34387. return mid;
  34388. }
  34389. }
  34390. return -1;
  34391. }
  34392. function range(index, end) {
  34393. var range = [];
  34394. while (index < end) {
  34395. range.push(index++);
  34396. }
  34397. return range;
  34398. }
  34399. var _class$1;
  34400. function _applyDecoratedDescriptor$1(target, property, decorators, descriptor, context) {
  34401. var desc = {};
  34402. Object['ke' + 'ys'](descriptor).forEach(function (key) {
  34403. desc[key] = descriptor[key];
  34404. });
  34405. desc.enumerable = !!desc.enumerable;
  34406. desc.configurable = !!desc.configurable;
  34407. if ('value' in desc || desc.initializer) {
  34408. desc.writable = true;
  34409. }
  34410. desc = decorators.slice().reverse().reduce(function (desc, decorator) {
  34411. return decorator(target, property, desc) || desc;
  34412. }, desc);
  34413. if (context && desc.initializer !== void 0) {
  34414. desc.value = desc.initializer ? desc.initializer.call(context) : void 0;
  34415. desc.initializer = undefined;
  34416. }
  34417. if (desc.initializer === void 0) {
  34418. Object['define' + 'Property'](target, property, desc);
  34419. desc = null;
  34420. }
  34421. return desc;
  34422. }
  34423. // iconv-lite is an optional dependency.
  34424. try {
  34425. var iconv = __webpack_require__(108);
  34426. } catch (err) {}
  34427. var CmapProcessor = (_class$1 = function () {
  34428. function CmapProcessor(cmapTable) {
  34429. _classCallCheck(this, CmapProcessor);
  34430. // Attempt to find a Unicode cmap first
  34431. this.encoding = null;
  34432. this.cmap = this.findSubtable(cmapTable, [
  34433. // 32-bit subtables
  34434. [3, 10], [0, 6], [0, 4],
  34435. // 16-bit subtables
  34436. [3, 1], [0, 3], [0, 2], [0, 1], [0, 0]]);
  34437. // If not unicode cmap was found, and iconv-lite is installed,
  34438. // take the first table with a supported encoding.
  34439. if (!this.cmap && iconv) {
  34440. for (var _iterator = cmapTable.tables, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _getIterator(_iterator);;) {
  34441. var _ref;
  34442. if (_isArray) {
  34443. if (_i >= _iterator.length) break;
  34444. _ref = _iterator[_i++];
  34445. } else {
  34446. _i = _iterator.next();
  34447. if (_i.done) break;
  34448. _ref = _i.value;
  34449. }
  34450. var cmap = _ref;
  34451. var encoding = getEncoding(cmap.platformID, cmap.encodingID, cmap.table.language - 1);
  34452. if (iconv.encodingExists(encoding)) {
  34453. this.cmap = cmap.table;
  34454. this.encoding = encoding;
  34455. }
  34456. }
  34457. }
  34458. if (!this.cmap) {
  34459. throw new Error("Could not find a supported cmap table");
  34460. }
  34461. this.uvs = this.findSubtable(cmapTable, [[0, 5]]);
  34462. if (this.uvs && this.uvs.version !== 14) {
  34463. this.uvs = null;
  34464. }
  34465. }
  34466. CmapProcessor.prototype.findSubtable = function findSubtable(cmapTable, pairs) {
  34467. for (var _iterator2 = pairs, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _getIterator(_iterator2);;) {
  34468. var _ref2;
  34469. if (_isArray2) {
  34470. if (_i2 >= _iterator2.length) break;
  34471. _ref2 = _iterator2[_i2++];
  34472. } else {
  34473. _i2 = _iterator2.next();
  34474. if (_i2.done) break;
  34475. _ref2 = _i2.value;
  34476. }
  34477. var _ref3 = _ref2,
  34478. platformID = _ref3[0],
  34479. encodingID = _ref3[1];
  34480. for (var _iterator3 = cmapTable.tables, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _getIterator(_iterator3);;) {
  34481. var _ref4;
  34482. if (_isArray3) {
  34483. if (_i3 >= _iterator3.length) break;
  34484. _ref4 = _iterator3[_i3++];
  34485. } else {
  34486. _i3 = _iterator3.next();
  34487. if (_i3.done) break;
  34488. _ref4 = _i3.value;
  34489. }
  34490. var cmap = _ref4;
  34491. if (cmap.platformID === platformID && cmap.encodingID === encodingID) {
  34492. return cmap.table;
  34493. }
  34494. }
  34495. }
  34496. return null;
  34497. };
  34498. CmapProcessor.prototype.lookup = function lookup(codepoint, variationSelector) {
  34499. // If there is no Unicode cmap in this font, we need to re-encode
  34500. // the codepoint in the encoding that the cmap supports.
  34501. if (this.encoding) {
  34502. var buf = iconv.encode(_String$fromCodePoint(codepoint), this.encoding);
  34503. codepoint = 0;
  34504. for (var i = 0; i < buf.length; i++) {
  34505. codepoint = codepoint << 8 | buf[i];
  34506. }
  34507. // Otherwise, try to get a Unicode variation selector for this codepoint if one is provided.
  34508. } else if (variationSelector) {
  34509. var gid = this.getVariationSelector(codepoint, variationSelector);
  34510. if (gid) {
  34511. return gid;
  34512. }
  34513. }
  34514. var cmap = this.cmap;
  34515. switch (cmap.version) {
  34516. case 0:
  34517. return cmap.codeMap.get(codepoint) || 0;
  34518. case 4:
  34519. {
  34520. var min = 0;
  34521. var max = cmap.segCount - 1;
  34522. while (min <= max) {
  34523. var mid = min + max >> 1;
  34524. if (codepoint < cmap.startCode.get(mid)) {
  34525. max = mid - 1;
  34526. } else if (codepoint > cmap.endCode.get(mid)) {
  34527. min = mid + 1;
  34528. } else {
  34529. var rangeOffset = cmap.idRangeOffset.get(mid);
  34530. var _gid = void 0;
  34531. if (rangeOffset === 0) {
  34532. _gid = codepoint + cmap.idDelta.get(mid);
  34533. } else {
  34534. var index = rangeOffset / 2 + (codepoint - cmap.startCode.get(mid)) - (cmap.segCount - mid);
  34535. _gid = cmap.glyphIndexArray.get(index) || 0;
  34536. if (_gid !== 0) {
  34537. _gid += cmap.idDelta.get(mid);
  34538. }
  34539. }
  34540. return _gid & 0xffff;
  34541. }
  34542. }
  34543. return 0;
  34544. }
  34545. case 8:
  34546. throw new Error('TODO: cmap format 8');
  34547. case 6:
  34548. case 10:
  34549. return cmap.glyphIndices.get(codepoint - cmap.firstCode) || 0;
  34550. case 12:
  34551. case 13:
  34552. {
  34553. var _min = 0;
  34554. var _max = cmap.nGroups - 1;
  34555. while (_min <= _max) {
  34556. var _mid = _min + _max >> 1;
  34557. var group = cmap.groups.get(_mid);
  34558. if (codepoint < group.startCharCode) {
  34559. _max = _mid - 1;
  34560. } else if (codepoint > group.endCharCode) {
  34561. _min = _mid + 1;
  34562. } else {
  34563. if (cmap.version === 12) {
  34564. return group.glyphID + (codepoint - group.startCharCode);
  34565. } else {
  34566. return group.glyphID;
  34567. }
  34568. }
  34569. }
  34570. return 0;
  34571. }
  34572. case 14:
  34573. throw new Error('TODO: cmap format 14');
  34574. default:
  34575. throw new Error('Unknown cmap format ' + cmap.version);
  34576. }
  34577. };
  34578. CmapProcessor.prototype.getVariationSelector = function getVariationSelector(codepoint, variationSelector) {
  34579. if (!this.uvs) {
  34580. return 0;
  34581. }
  34582. var selectors = this.uvs.varSelectors.toArray();
  34583. var i = binarySearch(selectors, function (x) {
  34584. return variationSelector - x.varSelector;
  34585. });
  34586. var sel = selectors[i];
  34587. if (i !== -1 && sel.defaultUVS) {
  34588. i = binarySearch(sel.defaultUVS, function (x) {
  34589. return codepoint < x.startUnicodeValue ? -1 : codepoint > x.startUnicodeValue + x.additionalCount ? +1 : 0;
  34590. });
  34591. }
  34592. if (i !== -1 && sel.nonDefaultUVS) {
  34593. i = binarySearch(sel.nonDefaultUVS, function (x) {
  34594. return codepoint - x.unicodeValue;
  34595. });
  34596. if (i !== -1) {
  34597. return sel.nonDefaultUVS[i].glyphID;
  34598. }
  34599. }
  34600. return 0;
  34601. };
  34602. CmapProcessor.prototype.getCharacterSet = function getCharacterSet() {
  34603. var cmap = this.cmap;
  34604. switch (cmap.version) {
  34605. case 0:
  34606. return range(0, cmap.codeMap.length);
  34607. case 4:
  34608. {
  34609. var res = [];
  34610. var endCodes = cmap.endCode.toArray();
  34611. for (var i = 0; i < endCodes.length; i++) {
  34612. var tail = endCodes[i] + 1;
  34613. var start = cmap.startCode.get(i);
  34614. res.push.apply(res, range(start, tail));
  34615. }
  34616. return res;
  34617. }
  34618. case 8:
  34619. throw new Error('TODO: cmap format 8');
  34620. case 6:
  34621. case 10:
  34622. return range(cmap.firstCode, cmap.firstCode + cmap.glyphIndices.length);
  34623. case 12:
  34624. case 13:
  34625. {
  34626. var _res = [];
  34627. for (var _iterator4 = cmap.groups.toArray(), _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _getIterator(_iterator4);;) {
  34628. var _ref5;
  34629. if (_isArray4) {
  34630. if (_i4 >= _iterator4.length) break;
  34631. _ref5 = _iterator4[_i4++];
  34632. } else {
  34633. _i4 = _iterator4.next();
  34634. if (_i4.done) break;
  34635. _ref5 = _i4.value;
  34636. }
  34637. var group = _ref5;
  34638. _res.push.apply(_res, range(group.startCharCode, group.endCharCode + 1));
  34639. }
  34640. return _res;
  34641. }
  34642. case 14:
  34643. throw new Error('TODO: cmap format 14');
  34644. default:
  34645. throw new Error('Unknown cmap format ' + cmap.version);
  34646. }
  34647. };
  34648. CmapProcessor.prototype.codePointsForGlyph = function codePointsForGlyph(gid) {
  34649. var cmap = this.cmap;
  34650. switch (cmap.version) {
  34651. case 0:
  34652. {
  34653. var res = [];
  34654. for (var i = 0; i < 256; i++) {
  34655. if (cmap.codeMap.get(i) === gid) {
  34656. res.push(i);
  34657. }
  34658. }
  34659. return res;
  34660. }
  34661. case 4:
  34662. {
  34663. var _res2 = [];
  34664. for (var _i5 = 0; _i5 < cmap.segCount; _i5++) {
  34665. var end = cmap.endCode.get(_i5);
  34666. var start = cmap.startCode.get(_i5);
  34667. var rangeOffset = cmap.idRangeOffset.get(_i5);
  34668. var delta = cmap.idDelta.get(_i5);
  34669. for (var c = start; c <= end; c++) {
  34670. var g = 0;
  34671. if (rangeOffset === 0) {
  34672. g = c + delta;
  34673. } else {
  34674. var index = rangeOffset / 2 + (c - start) - (cmap.segCount - _i5);
  34675. g = cmap.glyphIndexArray.get(index) || 0;
  34676. if (g !== 0) {
  34677. g += delta;
  34678. }
  34679. }
  34680. if (g === gid) {
  34681. _res2.push(c);
  34682. }
  34683. }
  34684. }
  34685. return _res2;
  34686. }
  34687. case 12:
  34688. {
  34689. var _res3 = [];
  34690. for (var _iterator5 = cmap.groups.toArray(), _isArray5 = Array.isArray(_iterator5), _i6 = 0, _iterator5 = _isArray5 ? _iterator5 : _getIterator(_iterator5);;) {
  34691. var _ref6;
  34692. if (_isArray5) {
  34693. if (_i6 >= _iterator5.length) break;
  34694. _ref6 = _iterator5[_i6++];
  34695. } else {
  34696. _i6 = _iterator5.next();
  34697. if (_i6.done) break;
  34698. _ref6 = _i6.value;
  34699. }
  34700. var group = _ref6;
  34701. if (gid >= group.glyphID && gid <= group.glyphID + (group.endCharCode - group.startCharCode)) {
  34702. _res3.push(group.startCharCode + (gid - group.glyphID));
  34703. }
  34704. }
  34705. return _res3;
  34706. }
  34707. case 13:
  34708. {
  34709. var _res4 = [];
  34710. for (var _iterator6 = cmap.groups.toArray(), _isArray6 = Array.isArray(_iterator6), _i7 = 0, _iterator6 = _isArray6 ? _iterator6 : _getIterator(_iterator6);;) {
  34711. var _ref7;
  34712. if (_isArray6) {
  34713. if (_i7 >= _iterator6.length) break;
  34714. _ref7 = _iterator6[_i7++];
  34715. } else {
  34716. _i7 = _iterator6.next();
  34717. if (_i7.done) break;
  34718. _ref7 = _i7.value;
  34719. }
  34720. var _group = _ref7;
  34721. if (gid === _group.glyphID) {
  34722. _res4.push.apply(_res4, range(_group.startCharCode, _group.endCharCode + 1));
  34723. }
  34724. }
  34725. return _res4;
  34726. }
  34727. default:
  34728. throw new Error('Unknown cmap format ' + cmap.version);
  34729. }
  34730. };
  34731. return CmapProcessor;
  34732. }(), (_applyDecoratedDescriptor$1(_class$1.prototype, 'getCharacterSet', [cache], _Object$getOwnPropertyDescriptor(_class$1.prototype, 'getCharacterSet'), _class$1.prototype), _applyDecoratedDescriptor$1(_class$1.prototype, 'codePointsForGlyph', [cache], _Object$getOwnPropertyDescriptor(_class$1.prototype, 'codePointsForGlyph'), _class$1.prototype)), _class$1);
  34733. var KernProcessor = function () {
  34734. function KernProcessor(font) {
  34735. _classCallCheck(this, KernProcessor);
  34736. this.kern = font.kern;
  34737. }
  34738. KernProcessor.prototype.process = function process(glyphs, positions) {
  34739. for (var glyphIndex = 0; glyphIndex < glyphs.length - 1; glyphIndex++) {
  34740. var left = glyphs[glyphIndex].id;
  34741. var right = glyphs[glyphIndex + 1].id;
  34742. positions[glyphIndex].xAdvance += this.getKerning(left, right);
  34743. }
  34744. };
  34745. KernProcessor.prototype.getKerning = function getKerning(left, right) {
  34746. var res = 0;
  34747. for (var _iterator = this.kern.tables, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _getIterator(_iterator);;) {
  34748. var _ref;
  34749. if (_isArray) {
  34750. if (_i >= _iterator.length) break;
  34751. _ref = _iterator[_i++];
  34752. } else {
  34753. _i = _iterator.next();
  34754. if (_i.done) break;
  34755. _ref = _i.value;
  34756. }
  34757. var table = _ref;
  34758. if (table.coverage.crossStream) {
  34759. continue;
  34760. }
  34761. switch (table.version) {
  34762. case 0:
  34763. if (!table.coverage.horizontal) {
  34764. continue;
  34765. }
  34766. break;
  34767. case 1:
  34768. if (table.coverage.vertical || table.coverage.variation) {
  34769. continue;
  34770. }
  34771. break;
  34772. default:
  34773. throw new Error('Unsupported kerning table version ' + table.version);
  34774. }
  34775. var val = 0;
  34776. var s = table.subtable;
  34777. switch (table.format) {
  34778. case 0:
  34779. var pairIdx = binarySearch(s.pairs, function (pair) {
  34780. return left - pair.left || right - pair.right;
  34781. });
  34782. if (pairIdx >= 0) {
  34783. val = s.pairs[pairIdx].value;
  34784. }
  34785. break;
  34786. case 2:
  34787. var leftOffset = 0,
  34788. rightOffset = 0;
  34789. if (left >= s.leftTable.firstGlyph && left < s.leftTable.firstGlyph + s.leftTable.nGlyphs) {
  34790. leftOffset = s.leftTable.offsets[left - s.leftTable.firstGlyph];
  34791. } else {
  34792. leftOffset = s.array.off;
  34793. }
  34794. if (right >= s.rightTable.firstGlyph && right < s.rightTable.firstGlyph + s.rightTable.nGlyphs) {
  34795. rightOffset = s.rightTable.offsets[right - s.rightTable.firstGlyph];
  34796. }
  34797. var index = (leftOffset + rightOffset - s.array.off) / 2;
  34798. val = s.array.values.get(index);
  34799. break;
  34800. case 3:
  34801. if (left >= s.glyphCount || right >= s.glyphCount) {
  34802. return 0;
  34803. }
  34804. val = s.kernValue[s.kernIndex[s.leftClass[left] * s.rightClassCount + s.rightClass[right]]];
  34805. break;
  34806. default:
  34807. throw new Error('Unsupported kerning sub-table format ' + table.format);
  34808. }
  34809. // Microsoft supports the override flag, which resets the result
  34810. // Otherwise, the sum of the results from all subtables is returned
  34811. if (table.coverage.override) {
  34812. res = val;
  34813. } else {
  34814. res += val;
  34815. }
  34816. }
  34817. return res;
  34818. };
  34819. return KernProcessor;
  34820. }();
  34821. /**
  34822. * This class is used when GPOS does not define 'mark' or 'mkmk' features
  34823. * for positioning marks relative to base glyphs. It uses the unicode
  34824. * combining class property to position marks.
  34825. *
  34826. * Based on code from Harfbuzz, thanks!
  34827. * https://github.com/behdad/harfbuzz/blob/master/src/hb-ot-shape-fallback.cc
  34828. */
  34829. var UnicodeLayoutEngine = function () {
  34830. function UnicodeLayoutEngine(font) {
  34831. _classCallCheck(this, UnicodeLayoutEngine);
  34832. this.font = font;
  34833. }
  34834. UnicodeLayoutEngine.prototype.positionGlyphs = function positionGlyphs(glyphs, positions) {
  34835. // find each base + mark cluster, and position the marks relative to the base
  34836. var clusterStart = 0;
  34837. var clusterEnd = 0;
  34838. for (var index = 0; index < glyphs.length; index++) {
  34839. var glyph = glyphs[index];
  34840. if (glyph.isMark) {
  34841. // TODO: handle ligatures
  34842. clusterEnd = index;
  34843. } else {
  34844. if (clusterStart !== clusterEnd) {
  34845. this.positionCluster(glyphs, positions, clusterStart, clusterEnd);
  34846. }
  34847. clusterStart = clusterEnd = index;
  34848. }
  34849. }
  34850. if (clusterStart !== clusterEnd) {
  34851. this.positionCluster(glyphs, positions, clusterStart, clusterEnd);
  34852. }
  34853. return positions;
  34854. };
  34855. UnicodeLayoutEngine.prototype.positionCluster = function positionCluster(glyphs, positions, clusterStart, clusterEnd) {
  34856. var base = glyphs[clusterStart];
  34857. var baseBox = base.cbox.copy();
  34858. // adjust bounding box for ligature glyphs
  34859. if (base.codePoints.length > 1) {
  34860. // LTR. TODO: RTL support.
  34861. baseBox.minX += (base.codePoints.length - 1) * baseBox.width / base.codePoints.length;
  34862. }
  34863. var xOffset = -positions[clusterStart].xAdvance;
  34864. var yOffset = 0;
  34865. var yGap = this.font.unitsPerEm / 16;
  34866. // position each of the mark glyphs relative to the base glyph
  34867. for (var index = clusterStart + 1; index <= clusterEnd; index++) {
  34868. var mark = glyphs[index];
  34869. var markBox = mark.cbox;
  34870. var position = positions[index];
  34871. var combiningClass = this.getCombiningClass(mark.codePoints[0]);
  34872. if (combiningClass !== 'Not_Reordered') {
  34873. position.xOffset = position.yOffset = 0;
  34874. // x positioning
  34875. switch (combiningClass) {
  34876. case 'Double_Above':
  34877. case 'Double_Below':
  34878. // LTR. TODO: RTL support.
  34879. position.xOffset += baseBox.minX - markBox.width / 2 - markBox.minX;
  34880. break;
  34881. case 'Attached_Below_Left':
  34882. case 'Below_Left':
  34883. case 'Above_Left':
  34884. // left align
  34885. position.xOffset += baseBox.minX - markBox.minX;
  34886. break;
  34887. case 'Attached_Above_Right':
  34888. case 'Below_Right':
  34889. case 'Above_Right':
  34890. // right align
  34891. position.xOffset += baseBox.maxX - markBox.width - markBox.minX;
  34892. break;
  34893. default:
  34894. // Attached_Below, Attached_Above, Below, Above, other
  34895. // center align
  34896. position.xOffset += baseBox.minX + (baseBox.width - markBox.width) / 2 - markBox.minX;
  34897. }
  34898. // y positioning
  34899. switch (combiningClass) {
  34900. case 'Double_Below':
  34901. case 'Below_Left':
  34902. case 'Below':
  34903. case 'Below_Right':
  34904. case 'Attached_Below_Left':
  34905. case 'Attached_Below':
  34906. // add a small gap between the glyphs if they are not attached
  34907. if (combiningClass === 'Attached_Below_Left' || combiningClass === 'Attached_Below') {
  34908. baseBox.minY += yGap;
  34909. }
  34910. position.yOffset = -baseBox.minY - markBox.maxY;
  34911. baseBox.minY += markBox.height;
  34912. break;
  34913. case 'Double_Above':
  34914. case 'Above_Left':
  34915. case 'Above':
  34916. case 'Above_Right':
  34917. case 'Attached_Above':
  34918. case 'Attached_Above_Right':
  34919. // add a small gap between the glyphs if they are not attached
  34920. if (combiningClass === 'Attached_Above' || combiningClass === 'Attached_Above_Right') {
  34921. baseBox.maxY += yGap;
  34922. }
  34923. position.yOffset = baseBox.maxY - markBox.minY;
  34924. baseBox.maxY += markBox.height;
  34925. break;
  34926. }
  34927. position.xAdvance = position.yAdvance = 0;
  34928. position.xOffset += xOffset;
  34929. position.yOffset += yOffset;
  34930. } else {
  34931. xOffset -= position.xAdvance;
  34932. yOffset -= position.yAdvance;
  34933. }
  34934. }
  34935. return;
  34936. };
  34937. UnicodeLayoutEngine.prototype.getCombiningClass = function getCombiningClass(codePoint) {
  34938. var combiningClass = unicode.getCombiningClass(codePoint);
  34939. // Thai / Lao need some per-character work
  34940. if ((codePoint & ~0xff) === 0x0e00) {
  34941. if (combiningClass === 'Not_Reordered') {
  34942. switch (codePoint) {
  34943. case 0x0e31:
  34944. case 0x0e34:
  34945. case 0x0e35:
  34946. case 0x0e36:
  34947. case 0x0e37:
  34948. case 0x0e47:
  34949. case 0x0e4c:
  34950. case 0x0e3d:
  34951. case 0x0e4e:
  34952. return 'Above_Right';
  34953. case 0x0eb1:
  34954. case 0x0eb4:
  34955. case 0x0eb5:
  34956. case 0x0eb6:
  34957. case 0x0eb7:
  34958. case 0x0ebb:
  34959. case 0x0ecc:
  34960. case 0x0ecd:
  34961. return 'Above';
  34962. case 0x0ebc:
  34963. return 'Below';
  34964. }
  34965. } else if (codePoint === 0x0e3a) {
  34966. // virama
  34967. return 'Below_Right';
  34968. }
  34969. }
  34970. switch (combiningClass) {
  34971. // Hebrew
  34972. case 'CCC10': // sheva
  34973. case 'CCC11': // hataf segol
  34974. case 'CCC12': // hataf patah
  34975. case 'CCC13': // hataf qamats
  34976. case 'CCC14': // hiriq
  34977. case 'CCC15': // tsere
  34978. case 'CCC16': // segol
  34979. case 'CCC17': // patah
  34980. case 'CCC18': // qamats
  34981. case 'CCC20': // qubuts
  34982. case 'CCC22':
  34983. // meteg
  34984. return 'Below';
  34985. case 'CCC23':
  34986. // rafe
  34987. return 'Attached_Above';
  34988. case 'CCC24':
  34989. // shin dot
  34990. return 'Above_Right';
  34991. case 'CCC25': // sin dot
  34992. case 'CCC19':
  34993. // holam
  34994. return 'Above_Left';
  34995. case 'CCC26':
  34996. // point varika
  34997. return 'Above';
  34998. case 'CCC21':
  34999. // dagesh
  35000. break;
  35001. // Arabic and Syriac
  35002. case 'CCC27': // fathatan
  35003. case 'CCC28': // dammatan
  35004. case 'CCC30': // fatha
  35005. case 'CCC31': // damma
  35006. case 'CCC33': // shadda
  35007. case 'CCC34': // sukun
  35008. case 'CCC35': // superscript alef
  35009. case 'CCC36':
  35010. // superscript alaph
  35011. return 'Above';
  35012. case 'CCC29': // kasratan
  35013. case 'CCC32':
  35014. // kasra
  35015. return 'Below';
  35016. // Thai
  35017. case 'CCC103':
  35018. // sara u / sara uu
  35019. return 'Below_Right';
  35020. case 'CCC107':
  35021. // mai
  35022. return 'Above_Right';
  35023. // Lao
  35024. case 'CCC118':
  35025. // sign u / sign uu
  35026. return 'Below';
  35027. case 'CCC122':
  35028. // mai
  35029. return 'Above';
  35030. // Tibetan
  35031. case 'CCC129': // sign aa
  35032. case 'CCC132':
  35033. // sign u
  35034. return 'Below';
  35035. case 'CCC130':
  35036. // sign i
  35037. return 'Above';
  35038. }
  35039. return combiningClass;
  35040. };
  35041. return UnicodeLayoutEngine;
  35042. }();
  35043. /**
  35044. * Represents a glyph bounding box
  35045. */
  35046. var BBox = function () {
  35047. function BBox() {
  35048. var minX = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : Infinity;
  35049. var minY = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Infinity;
  35050. var maxX = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : -Infinity;
  35051. var maxY = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : -Infinity;
  35052. _classCallCheck(this, BBox);
  35053. /**
  35054. * The minimum X position in the bounding box
  35055. * @type {number}
  35056. */
  35057. this.minX = minX;
  35058. /**
  35059. * The minimum Y position in the bounding box
  35060. * @type {number}
  35061. */
  35062. this.minY = minY;
  35063. /**
  35064. * The maxmimum X position in the bounding box
  35065. * @type {number}
  35066. */
  35067. this.maxX = maxX;
  35068. /**
  35069. * The maxmimum Y position in the bounding box
  35070. * @type {number}
  35071. */
  35072. this.maxY = maxY;
  35073. }
  35074. /**
  35075. * The width of the bounding box
  35076. * @type {number}
  35077. */
  35078. BBox.prototype.addPoint = function addPoint(x, y) {
  35079. if (Math.abs(x) !== Infinity) {
  35080. if (x < this.minX) {
  35081. this.minX = x;
  35082. }
  35083. if (x > this.maxX) {
  35084. this.maxX = x;
  35085. }
  35086. }
  35087. if (Math.abs(y) !== Infinity) {
  35088. if (y < this.minY) {
  35089. this.minY = y;
  35090. }
  35091. if (y > this.maxY) {
  35092. this.maxY = y;
  35093. }
  35094. }
  35095. };
  35096. BBox.prototype.copy = function copy() {
  35097. return new BBox(this.minX, this.minY, this.maxX, this.maxY);
  35098. };
  35099. _createClass(BBox, [{
  35100. key: "width",
  35101. get: function get() {
  35102. return this.maxX - this.minX;
  35103. }
  35104. /**
  35105. * The height of the bounding box
  35106. * @type {number}
  35107. */
  35108. }, {
  35109. key: "height",
  35110. get: function get() {
  35111. return this.maxY - this.minY;
  35112. }
  35113. }]);
  35114. return BBox;
  35115. }();
  35116. // This maps the Unicode Script property to an OpenType script tag
  35117. // Data from http://www.microsoft.com/typography/otspec/scripttags.htm
  35118. // and http://www.unicode.org/Public/UNIDATA/PropertyValueAliases.txt.
  35119. var UNICODE_SCRIPTS = {
  35120. Caucasian_Albanian: 'aghb',
  35121. Arabic: 'arab',
  35122. Imperial_Aramaic: 'armi',
  35123. Armenian: 'armn',
  35124. Avestan: 'avst',
  35125. Balinese: 'bali',
  35126. Bamum: 'bamu',
  35127. Bassa_Vah: 'bass',
  35128. Batak: 'batk',
  35129. Bengali: ['bng2', 'beng'],
  35130. Bopomofo: 'bopo',
  35131. Brahmi: 'brah',
  35132. Braille: 'brai',
  35133. Buginese: 'bugi',
  35134. Buhid: 'buhd',
  35135. Chakma: 'cakm',
  35136. Canadian_Aboriginal: 'cans',
  35137. Carian: 'cari',
  35138. Cham: 'cham',
  35139. Cherokee: 'cher',
  35140. Coptic: 'copt',
  35141. Cypriot: 'cprt',
  35142. Cyrillic: 'cyrl',
  35143. Devanagari: ['dev2', 'deva'],
  35144. Deseret: 'dsrt',
  35145. Duployan: 'dupl',
  35146. Egyptian_Hieroglyphs: 'egyp',
  35147. Elbasan: 'elba',
  35148. Ethiopic: 'ethi',
  35149. Georgian: 'geor',
  35150. Glagolitic: 'glag',
  35151. Gothic: 'goth',
  35152. Grantha: 'gran',
  35153. Greek: 'grek',
  35154. Gujarati: ['gjr2', 'gujr'],
  35155. Gurmukhi: ['gur2', 'guru'],
  35156. Hangul: 'hang',
  35157. Han: 'hani',
  35158. Hanunoo: 'hano',
  35159. Hebrew: 'hebr',
  35160. Hiragana: 'hira',
  35161. Pahawh_Hmong: 'hmng',
  35162. Katakana_Or_Hiragana: 'hrkt',
  35163. Old_Italic: 'ital',
  35164. Javanese: 'java',
  35165. Kayah_Li: 'kali',
  35166. Katakana: 'kana',
  35167. Kharoshthi: 'khar',
  35168. Khmer: 'khmr',
  35169. Khojki: 'khoj',
  35170. Kannada: ['knd2', 'knda'],
  35171. Kaithi: 'kthi',
  35172. Tai_Tham: 'lana',
  35173. Lao: 'lao ',
  35174. Latin: 'latn',
  35175. Lepcha: 'lepc',
  35176. Limbu: 'limb',
  35177. Linear_A: 'lina',
  35178. Linear_B: 'linb',
  35179. Lisu: 'lisu',
  35180. Lycian: 'lyci',
  35181. Lydian: 'lydi',
  35182. Mahajani: 'mahj',
  35183. Mandaic: 'mand',
  35184. Manichaean: 'mani',
  35185. Mende_Kikakui: 'mend',
  35186. Meroitic_Cursive: 'merc',
  35187. Meroitic_Hieroglyphs: 'mero',
  35188. Malayalam: ['mlm2', 'mlym'],
  35189. Modi: 'modi',
  35190. Mongolian: 'mong',
  35191. Mro: 'mroo',
  35192. Meetei_Mayek: 'mtei',
  35193. Myanmar: ['mym2', 'mymr'],
  35194. Old_North_Arabian: 'narb',
  35195. Nabataean: 'nbat',
  35196. Nko: 'nko ',
  35197. Ogham: 'ogam',
  35198. Ol_Chiki: 'olck',
  35199. Old_Turkic: 'orkh',
  35200. Oriya: ['ory2', 'orya'],
  35201. Osmanya: 'osma',
  35202. Palmyrene: 'palm',
  35203. Pau_Cin_Hau: 'pauc',
  35204. Old_Permic: 'perm',
  35205. Phags_Pa: 'phag',
  35206. Inscriptional_Pahlavi: 'phli',
  35207. Psalter_Pahlavi: 'phlp',
  35208. Phoenician: 'phnx',
  35209. Miao: 'plrd',
  35210. Inscriptional_Parthian: 'prti',
  35211. Rejang: 'rjng',
  35212. Runic: 'runr',
  35213. Samaritan: 'samr',
  35214. Old_South_Arabian: 'sarb',
  35215. Saurashtra: 'saur',
  35216. Shavian: 'shaw',
  35217. Sharada: 'shrd',
  35218. Siddham: 'sidd',
  35219. Khudawadi: 'sind',
  35220. Sinhala: 'sinh',
  35221. Sora_Sompeng: 'sora',
  35222. Sundanese: 'sund',
  35223. Syloti_Nagri: 'sylo',
  35224. Syriac: 'syrc',
  35225. Tagbanwa: 'tagb',
  35226. Takri: 'takr',
  35227. Tai_Le: 'tale',
  35228. New_Tai_Lue: 'talu',
  35229. Tamil: ['tml2', 'taml'],
  35230. Tai_Viet: 'tavt',
  35231. Telugu: ['tel2', 'telu'],
  35232. Tifinagh: 'tfng',
  35233. Tagalog: 'tglg',
  35234. Thaana: 'thaa',
  35235. Thai: 'thai',
  35236. Tibetan: 'tibt',
  35237. Tirhuta: 'tirh',
  35238. Ugaritic: 'ugar',
  35239. Vai: 'vai ',
  35240. Warang_Citi: 'wara',
  35241. Old_Persian: 'xpeo',
  35242. Cuneiform: 'xsux',
  35243. Yi: 'yi ',
  35244. Inherited: 'zinh',
  35245. Common: 'zyyy',
  35246. Unknown: 'zzzz'
  35247. };
  35248. var OPENTYPE_SCRIPTS = {};
  35249. for (var script in UNICODE_SCRIPTS) {
  35250. var tag = UNICODE_SCRIPTS[script];
  35251. if (Array.isArray(tag)) {
  35252. for (var _iterator = tag, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _getIterator(_iterator);;) {
  35253. var _ref;
  35254. if (_isArray) {
  35255. if (_i >= _iterator.length) break;
  35256. _ref = _iterator[_i++];
  35257. } else {
  35258. _i = _iterator.next();
  35259. if (_i.done) break;
  35260. _ref = _i.value;
  35261. }
  35262. var t = _ref;
  35263. OPENTYPE_SCRIPTS[t] = script;
  35264. }
  35265. } else {
  35266. OPENTYPE_SCRIPTS[tag] = script;
  35267. }
  35268. }
  35269. function fromOpenType(tag) {
  35270. return OPENTYPE_SCRIPTS[tag];
  35271. }
  35272. function forString(string) {
  35273. var len = string.length;
  35274. var idx = 0;
  35275. while (idx < len) {
  35276. var code = string.charCodeAt(idx++);
  35277. // Check if this is a high surrogate
  35278. if (0xd800 <= code && code <= 0xdbff && idx < len) {
  35279. var next = string.charCodeAt(idx);
  35280. // Check if this is a low surrogate
  35281. if (0xdc00 <= next && next <= 0xdfff) {
  35282. idx++;
  35283. code = ((code & 0x3FF) << 10) + (next & 0x3FF) + 0x10000;
  35284. }
  35285. }
  35286. var _script = unicode.getScript(code);
  35287. if (_script !== 'Common' && _script !== 'Inherited' && _script !== 'Unknown') {
  35288. return UNICODE_SCRIPTS[_script];
  35289. }
  35290. }
  35291. return UNICODE_SCRIPTS.Unknown;
  35292. }
  35293. function forCodePoints(codePoints) {
  35294. for (var i = 0; i < codePoints.length; i++) {
  35295. var codePoint = codePoints[i];
  35296. var _script2 = unicode.getScript(codePoint);
  35297. if (_script2 !== 'Common' && _script2 !== 'Inherited' && _script2 !== 'Unknown') {
  35298. return UNICODE_SCRIPTS[_script2];
  35299. }
  35300. }
  35301. return UNICODE_SCRIPTS.Unknown;
  35302. }
  35303. // The scripts in this map are written from right to left
  35304. var RTL = {
  35305. arab: true, // Arabic
  35306. hebr: true, // Hebrew
  35307. syrc: true, // Syriac
  35308. thaa: true, // Thaana
  35309. cprt: true, // Cypriot Syllabary
  35310. khar: true, // Kharosthi
  35311. phnx: true, // Phoenician
  35312. 'nko ': true, // N'Ko
  35313. lydi: true, // Lydian
  35314. avst: true, // Avestan
  35315. armi: true, // Imperial Aramaic
  35316. phli: true, // Inscriptional Pahlavi
  35317. prti: true, // Inscriptional Parthian
  35318. sarb: true, // Old South Arabian
  35319. orkh: true, // Old Turkic, Orkhon Runic
  35320. samr: true, // Samaritan
  35321. mand: true, // Mandaic, Mandaean
  35322. merc: true, // Meroitic Cursive
  35323. mero: true, // Meroitic Hieroglyphs
  35324. // Unicode 7.0 (not listed on http://www.microsoft.com/typography/otspec/scripttags.htm)
  35325. mani: true, // Manichaean
  35326. mend: true, // Mende Kikakui
  35327. nbat: true, // Nabataean
  35328. narb: true, // Old North Arabian
  35329. palm: true, // Palmyrene
  35330. phlp: true // Psalter Pahlavi
  35331. };
  35332. function direction(script) {
  35333. if (RTL[script]) {
  35334. return 'rtl';
  35335. }
  35336. return 'ltr';
  35337. }
  35338. /**
  35339. * Represents a run of Glyph and GlyphPosition objects.
  35340. * Returned by the font layout method.
  35341. */
  35342. var GlyphRun = function () {
  35343. function GlyphRun(glyphs, features, script, language, direction$$) {
  35344. _classCallCheck(this, GlyphRun);
  35345. /**
  35346. * An array of Glyph objects in the run
  35347. * @type {Glyph[]}
  35348. */
  35349. this.glyphs = glyphs;
  35350. /**
  35351. * An array of GlyphPosition objects for each glyph in the run
  35352. * @type {GlyphPosition[]}
  35353. */
  35354. this.positions = null;
  35355. /**
  35356. * The script that was requested for shaping. This was either passed in or detected automatically.
  35357. * @type {string}
  35358. */
  35359. this.script = script;
  35360. /**
  35361. * The language requested for shaping, as passed in. If `null`, the default language for the
  35362. * script was used.
  35363. * @type {string}
  35364. */
  35365. this.language = language || null;
  35366. /**
  35367. * The direction requested for shaping, as passed in (either ltr or rtl).
  35368. * If `null`, the default direction of the script is used.
  35369. * @type {string}
  35370. */
  35371. this.direction = direction$$ || direction(script);
  35372. /**
  35373. * The features requested during shaping. This is a combination of user
  35374. * specified features and features chosen by the shaper.
  35375. * @type {object}
  35376. */
  35377. this.features = {};
  35378. // Convert features to an object
  35379. if (Array.isArray(features)) {
  35380. for (var _iterator = features, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _getIterator(_iterator);;) {
  35381. var _ref;
  35382. if (_isArray) {
  35383. if (_i >= _iterator.length) break;
  35384. _ref = _iterator[_i++];
  35385. } else {
  35386. _i = _iterator.next();
  35387. if (_i.done) break;
  35388. _ref = _i.value;
  35389. }
  35390. var tag = _ref;
  35391. this.features[tag] = true;
  35392. }
  35393. } else if ((typeof features === 'undefined' ? 'undefined' : _typeof(features)) === 'object') {
  35394. this.features = features;
  35395. }
  35396. }
  35397. /**
  35398. * The total advance width of the run.
  35399. * @type {number}
  35400. */
  35401. _createClass(GlyphRun, [{
  35402. key: 'advanceWidth',
  35403. get: function get() {
  35404. var width = 0;
  35405. for (var _iterator2 = this.positions, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _getIterator(_iterator2);;) {
  35406. var _ref2;
  35407. if (_isArray2) {
  35408. if (_i2 >= _iterator2.length) break;
  35409. _ref2 = _iterator2[_i2++];
  35410. } else {
  35411. _i2 = _iterator2.next();
  35412. if (_i2.done) break;
  35413. _ref2 = _i2.value;
  35414. }
  35415. var position = _ref2;
  35416. width += position.xAdvance;
  35417. }
  35418. return width;
  35419. }
  35420. /**
  35421. * The total advance height of the run.
  35422. * @type {number}
  35423. */
  35424. }, {
  35425. key: 'advanceHeight',
  35426. get: function get() {
  35427. var height = 0;
  35428. for (var _iterator3 = this.positions, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _getIterator(_iterator3);;) {
  35429. var _ref3;
  35430. if (_isArray3) {
  35431. if (_i3 >= _iterator3.length) break;
  35432. _ref3 = _iterator3[_i3++];
  35433. } else {
  35434. _i3 = _iterator3.next();
  35435. if (_i3.done) break;
  35436. _ref3 = _i3.value;
  35437. }
  35438. var position = _ref3;
  35439. height += position.yAdvance;
  35440. }
  35441. return height;
  35442. }
  35443. /**
  35444. * The bounding box containing all glyphs in the run.
  35445. * @type {BBox}
  35446. */
  35447. }, {
  35448. key: 'bbox',
  35449. get: function get() {
  35450. var bbox = new BBox();
  35451. var x = 0;
  35452. var y = 0;
  35453. for (var index = 0; index < this.glyphs.length; index++) {
  35454. var glyph = this.glyphs[index];
  35455. var p = this.positions[index];
  35456. var b = glyph.bbox;
  35457. bbox.addPoint(b.minX + x + p.xOffset, b.minY + y + p.yOffset);
  35458. bbox.addPoint(b.maxX + x + p.xOffset, b.maxY + y + p.yOffset);
  35459. x += p.xAdvance;
  35460. y += p.yAdvance;
  35461. }
  35462. return bbox;
  35463. }
  35464. }]);
  35465. return GlyphRun;
  35466. }();
  35467. /**
  35468. * Represents positioning information for a glyph in a GlyphRun.
  35469. */
  35470. var GlyphPosition = function GlyphPosition() {
  35471. var xAdvance = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
  35472. var yAdvance = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  35473. var xOffset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
  35474. var yOffset = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
  35475. _classCallCheck(this, GlyphPosition);
  35476. /**
  35477. * The amount to move the virtual pen in the X direction after rendering this glyph.
  35478. * @type {number}
  35479. */
  35480. this.xAdvance = xAdvance;
  35481. /**
  35482. * The amount to move the virtual pen in the Y direction after rendering this glyph.
  35483. * @type {number}
  35484. */
  35485. this.yAdvance = yAdvance;
  35486. /**
  35487. * The offset from the pen position in the X direction at which to render this glyph.
  35488. * @type {number}
  35489. */
  35490. this.xOffset = xOffset;
  35491. /**
  35492. * The offset from the pen position in the Y direction at which to render this glyph.
  35493. * @type {number}
  35494. */
  35495. this.yOffset = yOffset;
  35496. };
  35497. // see https://developer.apple.com/fonts/TrueType-Reference-Manual/RM09/AppendixF.html
  35498. // and /System/Library/Frameworks/CoreText.framework/Versions/A/Headers/SFNTLayoutTypes.h on a Mac
  35499. var features = {
  35500. allTypographicFeatures: {
  35501. code: 0,
  35502. exclusive: false,
  35503. allTypeFeatures: 0
  35504. },
  35505. ligatures: {
  35506. code: 1,
  35507. exclusive: false,
  35508. requiredLigatures: 0,
  35509. commonLigatures: 2,
  35510. rareLigatures: 4,
  35511. // logos: 6
  35512. rebusPictures: 8,
  35513. diphthongLigatures: 10,
  35514. squaredLigatures: 12,
  35515. abbrevSquaredLigatures: 14,
  35516. symbolLigatures: 16,
  35517. contextualLigatures: 18,
  35518. historicalLigatures: 20
  35519. },
  35520. cursiveConnection: {
  35521. code: 2,
  35522. exclusive: true,
  35523. unconnected: 0,
  35524. partiallyConnected: 1,
  35525. cursive: 2
  35526. },
  35527. letterCase: {
  35528. code: 3,
  35529. exclusive: true
  35530. },
  35531. // upperAndLowerCase: 0 # deprecated
  35532. // allCaps: 1 # deprecated
  35533. // allLowerCase: 2 # deprecated
  35534. // smallCaps: 3 # deprecated
  35535. // initialCaps: 4 # deprecated
  35536. // initialCapsAndSmallCaps: 5 # deprecated
  35537. verticalSubstitution: {
  35538. code: 4,
  35539. exclusive: false,
  35540. substituteVerticalForms: 0
  35541. },
  35542. linguisticRearrangement: {
  35543. code: 5,
  35544. exclusive: false,
  35545. linguisticRearrangement: 0
  35546. },
  35547. numberSpacing: {
  35548. code: 6,
  35549. exclusive: true,
  35550. monospacedNumbers: 0,
  35551. proportionalNumbers: 1,
  35552. thirdWidthNumbers: 2,
  35553. quarterWidthNumbers: 3
  35554. },
  35555. smartSwash: {
  35556. code: 8,
  35557. exclusive: false,
  35558. wordInitialSwashes: 0,
  35559. wordFinalSwashes: 2,
  35560. // lineInitialSwashes: 4
  35561. // lineFinalSwashes: 6
  35562. nonFinalSwashes: 8
  35563. },
  35564. diacritics: {
  35565. code: 9,
  35566. exclusive: true,
  35567. showDiacritics: 0,
  35568. hideDiacritics: 1,
  35569. decomposeDiacritics: 2
  35570. },
  35571. verticalPosition: {
  35572. code: 10,
  35573. exclusive: true,
  35574. normalPosition: 0,
  35575. superiors: 1,
  35576. inferiors: 2,
  35577. ordinals: 3,
  35578. scientificInferiors: 4
  35579. },
  35580. fractions: {
  35581. code: 11,
  35582. exclusive: true,
  35583. noFractions: 0,
  35584. verticalFractions: 1,
  35585. diagonalFractions: 2
  35586. },
  35587. overlappingCharacters: {
  35588. code: 13,
  35589. exclusive: false,
  35590. preventOverlap: 0
  35591. },
  35592. typographicExtras: {
  35593. code: 14,
  35594. exclusive: false,
  35595. // hyphensToEmDash: 0
  35596. // hyphenToEnDash: 2
  35597. slashedZero: 4
  35598. },
  35599. // formInterrobang: 6
  35600. // smartQuotes: 8
  35601. // periodsToEllipsis: 10
  35602. mathematicalExtras: {
  35603. code: 15,
  35604. exclusive: false,
  35605. // hyphenToMinus: 0
  35606. // asteristoMultiply: 2
  35607. // slashToDivide: 4
  35608. // inequalityLigatures: 6
  35609. // exponents: 8
  35610. mathematicalGreek: 10
  35611. },
  35612. ornamentSets: {
  35613. code: 16,
  35614. exclusive: true,
  35615. noOrnaments: 0,
  35616. dingbats: 1,
  35617. piCharacters: 2,
  35618. fleurons: 3,
  35619. decorativeBorders: 4,
  35620. internationalSymbols: 5,
  35621. mathSymbols: 6
  35622. },
  35623. characterAlternatives: {
  35624. code: 17,
  35625. exclusive: true,
  35626. noAlternates: 0
  35627. },
  35628. // user defined options
  35629. designComplexity: {
  35630. code: 18,
  35631. exclusive: true,
  35632. designLevel1: 0,
  35633. designLevel2: 1,
  35634. designLevel3: 2,
  35635. designLevel4: 3,
  35636. designLevel5: 4
  35637. },
  35638. styleOptions: {
  35639. code: 19,
  35640. exclusive: true,
  35641. noStyleOptions: 0,
  35642. displayText: 1,
  35643. engravedText: 2,
  35644. illuminatedCaps: 3,
  35645. titlingCaps: 4,
  35646. tallCaps: 5
  35647. },
  35648. characterShape: {
  35649. code: 20,
  35650. exclusive: true,
  35651. traditionalCharacters: 0,
  35652. simplifiedCharacters: 1,
  35653. JIS1978Characters: 2,
  35654. JIS1983Characters: 3,
  35655. JIS1990Characters: 4,
  35656. traditionalAltOne: 5,
  35657. traditionalAltTwo: 6,
  35658. traditionalAltThree: 7,
  35659. traditionalAltFour: 8,
  35660. traditionalAltFive: 9,
  35661. expertCharacters: 10,
  35662. JIS2004Characters: 11,
  35663. hojoCharacters: 12,
  35664. NLCCharacters: 13,
  35665. traditionalNamesCharacters: 14
  35666. },
  35667. numberCase: {
  35668. code: 21,
  35669. exclusive: true,
  35670. lowerCaseNumbers: 0,
  35671. upperCaseNumbers: 1
  35672. },
  35673. textSpacing: {
  35674. code: 22,
  35675. exclusive: true,
  35676. proportionalText: 0,
  35677. monospacedText: 1,
  35678. halfWidthText: 2,
  35679. thirdWidthText: 3,
  35680. quarterWidthText: 4,
  35681. altProportionalText: 5,
  35682. altHalfWidthText: 6
  35683. },
  35684. transliteration: {
  35685. code: 23,
  35686. exclusive: true,
  35687. noTransliteration: 0
  35688. },
  35689. // hanjaToHangul: 1
  35690. // hiraganaToKatakana: 2
  35691. // katakanaToHiragana: 3
  35692. // kanaToRomanization: 4
  35693. // romanizationToHiragana: 5
  35694. // romanizationToKatakana: 6
  35695. // hanjaToHangulAltOne: 7
  35696. // hanjaToHangulAltTwo: 8
  35697. // hanjaToHangulAltThree: 9
  35698. annotation: {
  35699. code: 24,
  35700. exclusive: true,
  35701. noAnnotation: 0,
  35702. boxAnnotation: 1,
  35703. roundedBoxAnnotation: 2,
  35704. circleAnnotation: 3,
  35705. invertedCircleAnnotation: 4,
  35706. parenthesisAnnotation: 5,
  35707. periodAnnotation: 6,
  35708. romanNumeralAnnotation: 7,
  35709. diamondAnnotation: 8,
  35710. invertedBoxAnnotation: 9,
  35711. invertedRoundedBoxAnnotation: 10
  35712. },
  35713. kanaSpacing: {
  35714. code: 25,
  35715. exclusive: true,
  35716. fullWidthKana: 0,
  35717. proportionalKana: 1
  35718. },
  35719. ideographicSpacing: {
  35720. code: 26,
  35721. exclusive: true,
  35722. fullWidthIdeographs: 0,
  35723. proportionalIdeographs: 1,
  35724. halfWidthIdeographs: 2
  35725. },
  35726. unicodeDecomposition: {
  35727. code: 27,
  35728. exclusive: false,
  35729. canonicalComposition: 0,
  35730. compatibilityComposition: 2,
  35731. transcodingComposition: 4
  35732. },
  35733. rubyKana: {
  35734. code: 28,
  35735. exclusive: false,
  35736. // noRubyKana: 0 # deprecated - use rubyKanaOff instead
  35737. // rubyKana: 1 # deprecated - use rubyKanaOn instead
  35738. rubyKana: 2
  35739. },
  35740. CJKSymbolAlternatives: {
  35741. code: 29,
  35742. exclusive: true,
  35743. noCJKSymbolAlternatives: 0,
  35744. CJKSymbolAltOne: 1,
  35745. CJKSymbolAltTwo: 2,
  35746. CJKSymbolAltThree: 3,
  35747. CJKSymbolAltFour: 4,
  35748. CJKSymbolAltFive: 5
  35749. },
  35750. ideographicAlternatives: {
  35751. code: 30,
  35752. exclusive: true,
  35753. noIdeographicAlternatives: 0,
  35754. ideographicAltOne: 1,
  35755. ideographicAltTwo: 2,
  35756. ideographicAltThree: 3,
  35757. ideographicAltFour: 4,
  35758. ideographicAltFive: 5
  35759. },
  35760. CJKVerticalRomanPlacement: {
  35761. code: 31,
  35762. exclusive: true,
  35763. CJKVerticalRomanCentered: 0,
  35764. CJKVerticalRomanHBaseline: 1
  35765. },
  35766. italicCJKRoman: {
  35767. code: 32,
  35768. exclusive: false,
  35769. // noCJKItalicRoman: 0 # deprecated - use CJKItalicRomanOff instead
  35770. // CJKItalicRoman: 1 # deprecated - use CJKItalicRomanOn instead
  35771. CJKItalicRoman: 2
  35772. },
  35773. caseSensitiveLayout: {
  35774. code: 33,
  35775. exclusive: false,
  35776. caseSensitiveLayout: 0,
  35777. caseSensitiveSpacing: 2
  35778. },
  35779. alternateKana: {
  35780. code: 34,
  35781. exclusive: false,
  35782. alternateHorizKana: 0,
  35783. alternateVertKana: 2
  35784. },
  35785. stylisticAlternatives: {
  35786. code: 35,
  35787. exclusive: false,
  35788. noStylisticAlternates: 0,
  35789. stylisticAltOne: 2,
  35790. stylisticAltTwo: 4,
  35791. stylisticAltThree: 6,
  35792. stylisticAltFour: 8,
  35793. stylisticAltFive: 10,
  35794. stylisticAltSix: 12,
  35795. stylisticAltSeven: 14,
  35796. stylisticAltEight: 16,
  35797. stylisticAltNine: 18,
  35798. stylisticAltTen: 20,
  35799. stylisticAltEleven: 22,
  35800. stylisticAltTwelve: 24,
  35801. stylisticAltThirteen: 26,
  35802. stylisticAltFourteen: 28,
  35803. stylisticAltFifteen: 30,
  35804. stylisticAltSixteen: 32,
  35805. stylisticAltSeventeen: 34,
  35806. stylisticAltEighteen: 36,
  35807. stylisticAltNineteen: 38,
  35808. stylisticAltTwenty: 40
  35809. },
  35810. contextualAlternates: {
  35811. code: 36,
  35812. exclusive: false,
  35813. contextualAlternates: 0,
  35814. swashAlternates: 2,
  35815. contextualSwashAlternates: 4
  35816. },
  35817. lowerCase: {
  35818. code: 37,
  35819. exclusive: true,
  35820. defaultLowerCase: 0,
  35821. lowerCaseSmallCaps: 1,
  35822. lowerCasePetiteCaps: 2
  35823. },
  35824. upperCase: {
  35825. code: 38,
  35826. exclusive: true,
  35827. defaultUpperCase: 0,
  35828. upperCaseSmallCaps: 1,
  35829. upperCasePetiteCaps: 2
  35830. },
  35831. languageTag: { // indices into ltag table
  35832. code: 39,
  35833. exclusive: true
  35834. },
  35835. CJKRomanSpacing: {
  35836. code: 103,
  35837. exclusive: true,
  35838. halfWidthCJKRoman: 0,
  35839. proportionalCJKRoman: 1,
  35840. defaultCJKRoman: 2,
  35841. fullWidthCJKRoman: 3
  35842. }
  35843. };
  35844. var feature = function feature(name, selector) {
  35845. return [features[name].code, features[name][selector]];
  35846. };
  35847. var OTMapping = {
  35848. rlig: feature('ligatures', 'requiredLigatures'),
  35849. clig: feature('ligatures', 'contextualLigatures'),
  35850. dlig: feature('ligatures', 'rareLigatures'),
  35851. hlig: feature('ligatures', 'historicalLigatures'),
  35852. liga: feature('ligatures', 'commonLigatures'),
  35853. hist: feature('ligatures', 'historicalLigatures'), // ??
  35854. smcp: feature('lowerCase', 'lowerCaseSmallCaps'),
  35855. pcap: feature('lowerCase', 'lowerCasePetiteCaps'),
  35856. frac: feature('fractions', 'diagonalFractions'),
  35857. dnom: feature('fractions', 'diagonalFractions'), // ??
  35858. numr: feature('fractions', 'diagonalFractions'), // ??
  35859. afrc: feature('fractions', 'verticalFractions'),
  35860. // aalt
  35861. // abvf, abvm, abvs, akhn, blwf, blwm, blws, cfar, cjct, cpsp, falt, isol, jalt, ljmo, mset?
  35862. // ltra, ltrm, nukt, pref, pres, pstf, psts, rand, rkrf, rphf, rtla, rtlm, size, tjmo, tnum?
  35863. // unic, vatu, vhal, vjmo, vpal, vrt2
  35864. // dist -> trak table?
  35865. // kern, vkrn -> kern table
  35866. // lfbd + opbd + rtbd -> opbd table?
  35867. // mark, mkmk -> acnt table?
  35868. // locl -> languageTag + ltag table
  35869. case: feature('caseSensitiveLayout', 'caseSensitiveLayout'), // also caseSensitiveSpacing
  35870. ccmp: feature('unicodeDecomposition', 'canonicalComposition'), // compatibilityComposition?
  35871. cpct: feature('CJKVerticalRomanPlacement', 'CJKVerticalRomanCentered'), // guess..., probably not given below
  35872. valt: feature('CJKVerticalRomanPlacement', 'CJKVerticalRomanCentered'),
  35873. swsh: feature('contextualAlternates', 'swashAlternates'),
  35874. cswh: feature('contextualAlternates', 'contextualSwashAlternates'),
  35875. curs: feature('cursiveConnection', 'cursive'), // ??
  35876. c2pc: feature('upperCase', 'upperCasePetiteCaps'),
  35877. c2sc: feature('upperCase', 'upperCaseSmallCaps'),
  35878. init: feature('smartSwash', 'wordInitialSwashes'), // ??
  35879. fin2: feature('smartSwash', 'wordFinalSwashes'), // ??
  35880. medi: feature('smartSwash', 'nonFinalSwashes'), // ??
  35881. med2: feature('smartSwash', 'nonFinalSwashes'), // ??
  35882. fin3: feature('smartSwash', 'wordFinalSwashes'), // ??
  35883. fina: feature('smartSwash', 'wordFinalSwashes'), // ??
  35884. pkna: feature('kanaSpacing', 'proportionalKana'),
  35885. half: feature('textSpacing', 'halfWidthText'), // also HalfWidthCJKRoman, HalfWidthIdeographs?
  35886. halt: feature('textSpacing', 'altHalfWidthText'),
  35887. hkna: feature('alternateKana', 'alternateHorizKana'),
  35888. vkna: feature('alternateKana', 'alternateVertKana'),
  35889. // hngl: feature 'transliteration', 'hanjaToHangulSelector' # deprecated
  35890. ital: feature('italicCJKRoman', 'CJKItalicRoman'),
  35891. lnum: feature('numberCase', 'upperCaseNumbers'),
  35892. onum: feature('numberCase', 'lowerCaseNumbers'),
  35893. mgrk: feature('mathematicalExtras', 'mathematicalGreek'),
  35894. // nalt: not enough info. what type of annotation?
  35895. // ornm: ditto, which ornament style?
  35896. calt: feature('contextualAlternates', 'contextualAlternates'), // or more?
  35897. vrt2: feature('verticalSubstitution', 'substituteVerticalForms'), // oh... below?
  35898. vert: feature('verticalSubstitution', 'substituteVerticalForms'),
  35899. tnum: feature('numberSpacing', 'monospacedNumbers'),
  35900. pnum: feature('numberSpacing', 'proportionalNumbers'),
  35901. sups: feature('verticalPosition', 'superiors'),
  35902. subs: feature('verticalPosition', 'inferiors'),
  35903. ordn: feature('verticalPosition', 'ordinals'),
  35904. pwid: feature('textSpacing', 'proportionalText'),
  35905. hwid: feature('textSpacing', 'halfWidthText'),
  35906. qwid: feature('textSpacing', 'quarterWidthText'), // also QuarterWidthNumbers?
  35907. twid: feature('textSpacing', 'thirdWidthText'), // also ThirdWidthNumbers?
  35908. fwid: feature('textSpacing', 'proportionalText'), //??
  35909. palt: feature('textSpacing', 'altProportionalText'),
  35910. trad: feature('characterShape', 'traditionalCharacters'),
  35911. smpl: feature('characterShape', 'simplifiedCharacters'),
  35912. jp78: feature('characterShape', 'JIS1978Characters'),
  35913. jp83: feature('characterShape', 'JIS1983Characters'),
  35914. jp90: feature('characterShape', 'JIS1990Characters'),
  35915. jp04: feature('characterShape', 'JIS2004Characters'),
  35916. expt: feature('characterShape', 'expertCharacters'),
  35917. hojo: feature('characterShape', 'hojoCharacters'),
  35918. nlck: feature('characterShape', 'NLCCharacters'),
  35919. tnam: feature('characterShape', 'traditionalNamesCharacters'),
  35920. ruby: feature('rubyKana', 'rubyKana'),
  35921. titl: feature('styleOptions', 'titlingCaps'),
  35922. zero: feature('typographicExtras', 'slashedZero'),
  35923. ss01: feature('stylisticAlternatives', 'stylisticAltOne'),
  35924. ss02: feature('stylisticAlternatives', 'stylisticAltTwo'),
  35925. ss03: feature('stylisticAlternatives', 'stylisticAltThree'),
  35926. ss04: feature('stylisticAlternatives', 'stylisticAltFour'),
  35927. ss05: feature('stylisticAlternatives', 'stylisticAltFive'),
  35928. ss06: feature('stylisticAlternatives', 'stylisticAltSix'),
  35929. ss07: feature('stylisticAlternatives', 'stylisticAltSeven'),
  35930. ss08: feature('stylisticAlternatives', 'stylisticAltEight'),
  35931. ss09: feature('stylisticAlternatives', 'stylisticAltNine'),
  35932. ss10: feature('stylisticAlternatives', 'stylisticAltTen'),
  35933. ss11: feature('stylisticAlternatives', 'stylisticAltEleven'),
  35934. ss12: feature('stylisticAlternatives', 'stylisticAltTwelve'),
  35935. ss13: feature('stylisticAlternatives', 'stylisticAltThirteen'),
  35936. ss14: feature('stylisticAlternatives', 'stylisticAltFourteen'),
  35937. ss15: feature('stylisticAlternatives', 'stylisticAltFifteen'),
  35938. ss16: feature('stylisticAlternatives', 'stylisticAltSixteen'),
  35939. ss17: feature('stylisticAlternatives', 'stylisticAltSeventeen'),
  35940. ss18: feature('stylisticAlternatives', 'stylisticAltEighteen'),
  35941. ss19: feature('stylisticAlternatives', 'stylisticAltNineteen'),
  35942. ss20: feature('stylisticAlternatives', 'stylisticAltTwenty')
  35943. };
  35944. // salt: feature 'stylisticAlternatives', 'stylisticAltOne' # hmm, which one to choose
  35945. // Add cv01-cv99 features
  35946. for (var i = 1; i <= 99; i++) {
  35947. OTMapping['cv' + ('00' + i).slice(-2)] = [features.characterAlternatives.code, i];
  35948. }
  35949. // create inverse mapping
  35950. var AATMapping = {};
  35951. for (var ot in OTMapping) {
  35952. var aat = OTMapping[ot];
  35953. if (AATMapping[aat[0]] == null) {
  35954. AATMapping[aat[0]] = {};
  35955. }
  35956. AATMapping[aat[0]][aat[1]] = ot;
  35957. }
  35958. // Maps an array of OpenType features to AAT features
  35959. // in the form of {featureType:{featureSetting:true}}
  35960. function mapOTToAAT(features) {
  35961. var res = {};
  35962. for (var k in features) {
  35963. var r = void 0;
  35964. if (r = OTMapping[k]) {
  35965. if (res[r[0]] == null) {
  35966. res[r[0]] = {};
  35967. }
  35968. res[r[0]][r[1]] = features[k];
  35969. }
  35970. }
  35971. return res;
  35972. }
  35973. // Maps strings in a [featureType, featureSetting]
  35974. // to their equivalent number codes
  35975. function mapFeatureStrings(f) {
  35976. var type = f[0],
  35977. setting = f[1];
  35978. if (isNaN(type)) {
  35979. var typeCode = features[type] && features[type].code;
  35980. } else {
  35981. var typeCode = type;
  35982. }
  35983. if (isNaN(setting)) {
  35984. var settingCode = features[type] && features[type][setting];
  35985. } else {
  35986. var settingCode = setting;
  35987. }
  35988. return [typeCode, settingCode];
  35989. }
  35990. // Maps AAT features to an array of OpenType features
  35991. // Supports both arrays in the form of [[featureType, featureSetting]]
  35992. // and objects in the form of {featureType:{featureSetting:true}}
  35993. // featureTypes and featureSettings can be either strings or number codes
  35994. function mapAATToOT(features) {
  35995. var res = {};
  35996. if (Array.isArray(features)) {
  35997. for (var k = 0; k < features.length; k++) {
  35998. var r = void 0;
  35999. var f = mapFeatureStrings(features[k]);
  36000. if (r = AATMapping[f[0]] && AATMapping[f[0]][f[1]]) {
  36001. res[r] = true;
  36002. }
  36003. }
  36004. } else if ((typeof features === 'undefined' ? 'undefined' : _typeof(features)) === 'object') {
  36005. for (var type in features) {
  36006. var _feature = features[type];
  36007. for (var setting in _feature) {
  36008. var _r = void 0;
  36009. var _f = mapFeatureStrings([type, setting]);
  36010. if (_feature[setting] && (_r = AATMapping[_f[0]] && AATMapping[_f[0]][_f[1]])) {
  36011. res[_r] = true;
  36012. }
  36013. }
  36014. }
  36015. }
  36016. return _Object$keys(res);
  36017. }
  36018. var _class$3;
  36019. function _applyDecoratedDescriptor$3(target, property, decorators, descriptor, context) {
  36020. var desc = {};
  36021. Object['ke' + 'ys'](descriptor).forEach(function (key) {
  36022. desc[key] = descriptor[key];
  36023. });
  36024. desc.enumerable = !!desc.enumerable;
  36025. desc.configurable = !!desc.configurable;
  36026. if ('value' in desc || desc.initializer) {
  36027. desc.writable = true;
  36028. }
  36029. desc = decorators.slice().reverse().reduce(function (desc, decorator) {
  36030. return decorator(target, property, desc) || desc;
  36031. }, desc);
  36032. if (context && desc.initializer !== void 0) {
  36033. desc.value = desc.initializer ? desc.initializer.call(context) : void 0;
  36034. desc.initializer = undefined;
  36035. }
  36036. if (desc.initializer === void 0) {
  36037. Object['define' + 'Property'](target, property, desc);
  36038. desc = null;
  36039. }
  36040. return desc;
  36041. }
  36042. var AATLookupTable = (_class$3 = function () {
  36043. function AATLookupTable(table) {
  36044. _classCallCheck(this, AATLookupTable);
  36045. this.table = table;
  36046. }
  36047. AATLookupTable.prototype.lookup = function lookup(glyph) {
  36048. switch (this.table.version) {
  36049. case 0:
  36050. // simple array format
  36051. return this.table.values.getItem(glyph);
  36052. case 2: // segment format
  36053. case 4:
  36054. {
  36055. var min = 0;
  36056. var max = this.table.binarySearchHeader.nUnits - 1;
  36057. while (min <= max) {
  36058. var mid = min + max >> 1;
  36059. var seg = this.table.segments[mid];
  36060. // special end of search value
  36061. if (seg.firstGlyph === 0xffff) {
  36062. return null;
  36063. }
  36064. if (glyph < seg.firstGlyph) {
  36065. max = mid - 1;
  36066. } else if (glyph > seg.lastGlyph) {
  36067. min = mid + 1;
  36068. } else {
  36069. if (this.table.version === 2) {
  36070. return seg.value;
  36071. } else {
  36072. return seg.values[glyph - seg.firstGlyph];
  36073. }
  36074. }
  36075. }
  36076. return null;
  36077. }
  36078. case 6:
  36079. {
  36080. // lookup single
  36081. var _min = 0;
  36082. var _max = this.table.binarySearchHeader.nUnits - 1;
  36083. while (_min <= _max) {
  36084. var mid = _min + _max >> 1;
  36085. var seg = this.table.segments[mid];
  36086. // special end of search value
  36087. if (seg.glyph === 0xffff) {
  36088. return null;
  36089. }
  36090. if (glyph < seg.glyph) {
  36091. _max = mid - 1;
  36092. } else if (glyph > seg.glyph) {
  36093. _min = mid + 1;
  36094. } else {
  36095. return seg.value;
  36096. }
  36097. }
  36098. return null;
  36099. }
  36100. case 8:
  36101. // lookup trimmed
  36102. return this.table.values[glyph - this.table.firstGlyph];
  36103. default:
  36104. throw new Error('Unknown lookup table format: ' + this.table.version);
  36105. }
  36106. };
  36107. AATLookupTable.prototype.glyphsForValue = function glyphsForValue(classValue) {
  36108. var res = [];
  36109. switch (this.table.version) {
  36110. case 2: // segment format
  36111. case 4:
  36112. {
  36113. for (var _iterator = this.table.segments, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _getIterator(_iterator);;) {
  36114. var _ref;
  36115. if (_isArray) {
  36116. if (_i >= _iterator.length) break;
  36117. _ref = _iterator[_i++];
  36118. } else {
  36119. _i = _iterator.next();
  36120. if (_i.done) break;
  36121. _ref = _i.value;
  36122. }
  36123. var segment = _ref;
  36124. if (this.table.version === 2 && segment.value === classValue) {
  36125. res.push.apply(res, range(segment.firstGlyph, segment.lastGlyph + 1));
  36126. } else {
  36127. for (var index = 0; index < segment.values.length; index++) {
  36128. if (segment.values[index] === classValue) {
  36129. res.push(segment.firstGlyph + index);
  36130. }
  36131. }
  36132. }
  36133. }
  36134. break;
  36135. }
  36136. case 6:
  36137. {
  36138. // lookup single
  36139. for (var _iterator2 = this.table.segments, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _getIterator(_iterator2);;) {
  36140. var _ref2;
  36141. if (_isArray2) {
  36142. if (_i2 >= _iterator2.length) break;
  36143. _ref2 = _iterator2[_i2++];
  36144. } else {
  36145. _i2 = _iterator2.next();
  36146. if (_i2.done) break;
  36147. _ref2 = _i2.value;
  36148. }
  36149. var _segment = _ref2;
  36150. if (_segment.value === classValue) {
  36151. res.push(_segment.glyph);
  36152. }
  36153. }
  36154. break;
  36155. }
  36156. case 8:
  36157. {
  36158. // lookup trimmed
  36159. for (var i = 0; i < this.table.values.length; i++) {
  36160. if (this.table.values[i] === classValue) {
  36161. res.push(this.table.firstGlyph + i);
  36162. }
  36163. }
  36164. break;
  36165. }
  36166. default:
  36167. throw new Error('Unknown lookup table format: ' + this.table.version);
  36168. }
  36169. return res;
  36170. };
  36171. return AATLookupTable;
  36172. }(), (_applyDecoratedDescriptor$3(_class$3.prototype, 'glyphsForValue', [cache], _Object$getOwnPropertyDescriptor(_class$3.prototype, 'glyphsForValue'), _class$3.prototype)), _class$3);
  36173. var START_OF_TEXT_STATE = 0;
  36174. var END_OF_TEXT_CLASS = 0;
  36175. var OUT_OF_BOUNDS_CLASS = 1;
  36176. var DELETED_GLYPH_CLASS = 2;
  36177. var DONT_ADVANCE = 0x4000;
  36178. var AATStateMachine = function () {
  36179. function AATStateMachine(stateTable) {
  36180. _classCallCheck(this, AATStateMachine);
  36181. this.stateTable = stateTable;
  36182. this.lookupTable = new AATLookupTable(stateTable.classTable);
  36183. }
  36184. AATStateMachine.prototype.process = function process(glyphs, reverse, processEntry) {
  36185. var currentState = START_OF_TEXT_STATE; // START_OF_LINE_STATE is used for kashida glyph insertions sometimes I think?
  36186. var index = reverse ? glyphs.length - 1 : 0;
  36187. var dir = reverse ? -1 : 1;
  36188. while (dir === 1 && index <= glyphs.length || dir === -1 && index >= -1) {
  36189. var glyph = null;
  36190. var classCode = OUT_OF_BOUNDS_CLASS;
  36191. var shouldAdvance = true;
  36192. if (index === glyphs.length || index === -1) {
  36193. classCode = END_OF_TEXT_CLASS;
  36194. } else {
  36195. glyph = glyphs[index];
  36196. if (glyph.id === 0xffff) {
  36197. // deleted glyph
  36198. classCode = DELETED_GLYPH_CLASS;
  36199. } else {
  36200. classCode = this.lookupTable.lookup(glyph.id);
  36201. if (classCode == null) {
  36202. classCode = OUT_OF_BOUNDS_CLASS;
  36203. }
  36204. }
  36205. }
  36206. var row = this.stateTable.stateArray.getItem(currentState);
  36207. var entryIndex = row[classCode];
  36208. var entry = this.stateTable.entryTable.getItem(entryIndex);
  36209. if (classCode !== END_OF_TEXT_CLASS && classCode !== DELETED_GLYPH_CLASS) {
  36210. processEntry(glyph, entry, index);
  36211. shouldAdvance = !(entry.flags & DONT_ADVANCE);
  36212. }
  36213. currentState = entry.newState;
  36214. if (shouldAdvance) {
  36215. index += dir;
  36216. }
  36217. }
  36218. return glyphs;
  36219. };
  36220. /**
  36221. * Performs a depth-first traversal of the glyph strings
  36222. * represented by the state machine.
  36223. */
  36224. AATStateMachine.prototype.traverse = function traverse(opts) {
  36225. var state = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  36226. var visited = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : new _Set();
  36227. if (visited.has(state)) {
  36228. return;
  36229. }
  36230. visited.add(state);
  36231. var _stateTable = this.stateTable,
  36232. nClasses = _stateTable.nClasses,
  36233. stateArray = _stateTable.stateArray,
  36234. entryTable = _stateTable.entryTable;
  36235. var row = stateArray.getItem(state);
  36236. // Skip predefined classes
  36237. for (var classCode = 4; classCode < nClasses; classCode++) {
  36238. var entryIndex = row[classCode];
  36239. var entry = entryTable.getItem(entryIndex);
  36240. // Try all glyphs in the class
  36241. for (var _iterator = this.lookupTable.glyphsForValue(classCode), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _getIterator(_iterator);;) {
  36242. var _ref;
  36243. if (_isArray) {
  36244. if (_i >= _iterator.length) break;
  36245. _ref = _iterator[_i++];
  36246. } else {
  36247. _i = _iterator.next();
  36248. if (_i.done) break;
  36249. _ref = _i.value;
  36250. }
  36251. var glyph = _ref;
  36252. if (opts.enter) {
  36253. opts.enter(glyph, entry);
  36254. }
  36255. if (entry.newState !== 0) {
  36256. this.traverse(opts, entry.newState, visited);
  36257. }
  36258. if (opts.exit) {
  36259. opts.exit(glyph, entry);
  36260. }
  36261. }
  36262. }
  36263. };
  36264. return AATStateMachine;
  36265. }();
  36266. var _class$2;
  36267. function _applyDecoratedDescriptor$2(target, property, decorators, descriptor, context) {
  36268. var desc = {};
  36269. Object['ke' + 'ys'](descriptor).forEach(function (key) {
  36270. desc[key] = descriptor[key];
  36271. });
  36272. desc.enumerable = !!desc.enumerable;
  36273. desc.configurable = !!desc.configurable;
  36274. if ('value' in desc || desc.initializer) {
  36275. desc.writable = true;
  36276. }
  36277. desc = decorators.slice().reverse().reduce(function (desc, decorator) {
  36278. return decorator(target, property, desc) || desc;
  36279. }, desc);
  36280. if (context && desc.initializer !== void 0) {
  36281. desc.value = desc.initializer ? desc.initializer.call(context) : void 0;
  36282. desc.initializer = undefined;
  36283. }
  36284. if (desc.initializer === void 0) {
  36285. Object['define' + 'Property'](target, property, desc);
  36286. desc = null;
  36287. }
  36288. return desc;
  36289. }
  36290. // indic replacement flags
  36291. var MARK_FIRST = 0x8000;
  36292. var MARK_LAST = 0x2000;
  36293. var VERB = 0x000F;
  36294. // contextual substitution and glyph insertion flag
  36295. var SET_MARK = 0x8000;
  36296. // ligature entry flags
  36297. var SET_COMPONENT = 0x8000;
  36298. var PERFORM_ACTION = 0x2000;
  36299. // ligature action masks
  36300. var LAST_MASK = 0x80000000;
  36301. var STORE_MASK = 0x40000000;
  36302. var OFFSET_MASK = 0x3FFFFFFF;
  36303. var REVERSE_DIRECTION = 0x400000;
  36304. var CURRENT_INSERT_BEFORE = 0x0800;
  36305. var MARKED_INSERT_BEFORE = 0x0400;
  36306. var CURRENT_INSERT_COUNT = 0x03E0;
  36307. var MARKED_INSERT_COUNT = 0x001F;
  36308. var AATMorxProcessor = (_class$2 = function () {
  36309. function AATMorxProcessor(font) {
  36310. _classCallCheck(this, AATMorxProcessor);
  36311. this.processIndicRearragement = this.processIndicRearragement.bind(this);
  36312. this.processContextualSubstitution = this.processContextualSubstitution.bind(this);
  36313. this.processLigature = this.processLigature.bind(this);
  36314. this.processNoncontextualSubstitutions = this.processNoncontextualSubstitutions.bind(this);
  36315. this.processGlyphInsertion = this.processGlyphInsertion.bind(this);
  36316. this.font = font;
  36317. this.morx = font.morx;
  36318. this.inputCache = null;
  36319. }
  36320. // Processes an array of glyphs and applies the specified features
  36321. // Features should be in the form of {featureType:{featureSetting:true}}
  36322. AATMorxProcessor.prototype.process = function process(glyphs) {
  36323. var features = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  36324. for (var _iterator = this.morx.chains, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _getIterator(_iterator);;) {
  36325. var _ref;
  36326. if (_isArray) {
  36327. if (_i >= _iterator.length) break;
  36328. _ref = _iterator[_i++];
  36329. } else {
  36330. _i = _iterator.next();
  36331. if (_i.done) break;
  36332. _ref = _i.value;
  36333. }
  36334. var chain = _ref;
  36335. var flags = chain.defaultFlags;
  36336. // enable/disable the requested features
  36337. for (var _iterator2 = chain.features, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _getIterator(_iterator2);;) {
  36338. var _ref2;
  36339. if (_isArray2) {
  36340. if (_i2 >= _iterator2.length) break;
  36341. _ref2 = _iterator2[_i2++];
  36342. } else {
  36343. _i2 = _iterator2.next();
  36344. if (_i2.done) break;
  36345. _ref2 = _i2.value;
  36346. }
  36347. var feature = _ref2;
  36348. var f = void 0;
  36349. if ((f = features[feature.featureType]) && f[feature.featureSetting]) {
  36350. flags &= feature.disableFlags;
  36351. flags |= feature.enableFlags;
  36352. }
  36353. }
  36354. for (var _iterator3 = chain.subtables, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _getIterator(_iterator3);;) {
  36355. var _ref3;
  36356. if (_isArray3) {
  36357. if (_i3 >= _iterator3.length) break;
  36358. _ref3 = _iterator3[_i3++];
  36359. } else {
  36360. _i3 = _iterator3.next();
  36361. if (_i3.done) break;
  36362. _ref3 = _i3.value;
  36363. }
  36364. var subtable = _ref3;
  36365. if (subtable.subFeatureFlags & flags) {
  36366. this.processSubtable(subtable, glyphs);
  36367. }
  36368. }
  36369. }
  36370. // remove deleted glyphs
  36371. var index = glyphs.length - 1;
  36372. while (index >= 0) {
  36373. if (glyphs[index].id === 0xffff) {
  36374. glyphs.splice(index, 1);
  36375. }
  36376. index--;
  36377. }
  36378. return glyphs;
  36379. };
  36380. AATMorxProcessor.prototype.processSubtable = function processSubtable(subtable, glyphs) {
  36381. this.subtable = subtable;
  36382. this.glyphs = glyphs;
  36383. if (this.subtable.type === 4) {
  36384. this.processNoncontextualSubstitutions(this.subtable, this.glyphs);
  36385. return;
  36386. }
  36387. this.ligatureStack = [];
  36388. this.markedGlyph = null;
  36389. this.firstGlyph = null;
  36390. this.lastGlyph = null;
  36391. this.markedIndex = null;
  36392. var stateMachine = this.getStateMachine(subtable);
  36393. var process = this.getProcessor();
  36394. var reverse = !!(this.subtable.coverage & REVERSE_DIRECTION);
  36395. return stateMachine.process(this.glyphs, reverse, process);
  36396. };
  36397. AATMorxProcessor.prototype.getStateMachine = function getStateMachine(subtable) {
  36398. return new AATStateMachine(subtable.table.stateTable);
  36399. };
  36400. AATMorxProcessor.prototype.getProcessor = function getProcessor() {
  36401. switch (this.subtable.type) {
  36402. case 0:
  36403. return this.processIndicRearragement;
  36404. case 1:
  36405. return this.processContextualSubstitution;
  36406. case 2:
  36407. return this.processLigature;
  36408. case 4:
  36409. return this.processNoncontextualSubstitutions;
  36410. case 5:
  36411. return this.processGlyphInsertion;
  36412. default:
  36413. throw new Error('Invalid morx subtable type: ' + this.subtable.type);
  36414. }
  36415. };
  36416. AATMorxProcessor.prototype.processIndicRearragement = function processIndicRearragement(glyph, entry, index) {
  36417. if (entry.flags & MARK_FIRST) {
  36418. this.firstGlyph = index;
  36419. }
  36420. if (entry.flags & MARK_LAST) {
  36421. this.lastGlyph = index;
  36422. }
  36423. reorderGlyphs(this.glyphs, entry.flags & VERB, this.firstGlyph, this.lastGlyph);
  36424. };
  36425. AATMorxProcessor.prototype.processContextualSubstitution = function processContextualSubstitution(glyph, entry, index) {
  36426. var subsitutions = this.subtable.table.substitutionTable.items;
  36427. if (entry.markIndex !== 0xffff) {
  36428. var lookup = subsitutions.getItem(entry.markIndex);
  36429. var lookupTable = new AATLookupTable(lookup);
  36430. glyph = this.glyphs[this.markedGlyph];
  36431. var gid = lookupTable.lookup(glyph.id);
  36432. if (gid) {
  36433. this.glyphs[this.markedGlyph] = this.font.getGlyph(gid, glyph.codePoints);
  36434. }
  36435. }
  36436. if (entry.currentIndex !== 0xffff) {
  36437. var _lookup = subsitutions.getItem(entry.currentIndex);
  36438. var _lookupTable = new AATLookupTable(_lookup);
  36439. glyph = this.glyphs[index];
  36440. var gid = _lookupTable.lookup(glyph.id);
  36441. if (gid) {
  36442. this.glyphs[index] = this.font.getGlyph(gid, glyph.codePoints);
  36443. }
  36444. }
  36445. if (entry.flags & SET_MARK) {
  36446. this.markedGlyph = index;
  36447. }
  36448. };
  36449. AATMorxProcessor.prototype.processLigature = function processLigature(glyph, entry, index) {
  36450. if (entry.flags & SET_COMPONENT) {
  36451. this.ligatureStack.push(index);
  36452. }
  36453. if (entry.flags & PERFORM_ACTION) {
  36454. var _ligatureStack;
  36455. var actions = this.subtable.table.ligatureActions;
  36456. var components = this.subtable.table.components;
  36457. var ligatureList = this.subtable.table.ligatureList;
  36458. var actionIndex = entry.action;
  36459. var last = false;
  36460. var ligatureIndex = 0;
  36461. var codePoints = [];
  36462. var ligatureGlyphs = [];
  36463. while (!last) {
  36464. var _codePoints;
  36465. var componentGlyph = this.ligatureStack.pop();
  36466. (_codePoints = codePoints).unshift.apply(_codePoints, this.glyphs[componentGlyph].codePoints);
  36467. var action = actions.getItem(actionIndex++);
  36468. last = !!(action & LAST_MASK);
  36469. var store = !!(action & STORE_MASK);
  36470. var offset = (action & OFFSET_MASK) << 2 >> 2; // sign extend 30 to 32 bits
  36471. offset += this.glyphs[componentGlyph].id;
  36472. var component = components.getItem(offset);
  36473. ligatureIndex += component;
  36474. if (last || store) {
  36475. var ligatureEntry = ligatureList.getItem(ligatureIndex);
  36476. this.glyphs[componentGlyph] = this.font.getGlyph(ligatureEntry, codePoints);
  36477. ligatureGlyphs.push(componentGlyph);
  36478. ligatureIndex = 0;
  36479. codePoints = [];
  36480. } else {
  36481. this.glyphs[componentGlyph] = this.font.getGlyph(0xffff);
  36482. }
  36483. }
  36484. // Put ligature glyph indexes back on the stack
  36485. (_ligatureStack = this.ligatureStack).push.apply(_ligatureStack, ligatureGlyphs);
  36486. }
  36487. };
  36488. AATMorxProcessor.prototype.processNoncontextualSubstitutions = function processNoncontextualSubstitutions(subtable, glyphs, index) {
  36489. var lookupTable = new AATLookupTable(subtable.table.lookupTable);
  36490. for (index = 0; index < glyphs.length; index++) {
  36491. var glyph = glyphs[index];
  36492. if (glyph.id !== 0xffff) {
  36493. var gid = lookupTable.lookup(glyph.id);
  36494. if (gid) {
  36495. // 0 means do nothing
  36496. glyphs[index] = this.font.getGlyph(gid, glyph.codePoints);
  36497. }
  36498. }
  36499. }
  36500. };
  36501. AATMorxProcessor.prototype._insertGlyphs = function _insertGlyphs(glyphIndex, insertionActionIndex, count, isBefore) {
  36502. var _glyphs;
  36503. var insertions = [];
  36504. while (count--) {
  36505. var gid = this.subtable.table.insertionActions.getItem(insertionActionIndex++);
  36506. insertions.push(this.font.getGlyph(gid));
  36507. }
  36508. if (!isBefore) {
  36509. glyphIndex++;
  36510. }
  36511. (_glyphs = this.glyphs).splice.apply(_glyphs, [glyphIndex, 0].concat(insertions));
  36512. };
  36513. AATMorxProcessor.prototype.processGlyphInsertion = function processGlyphInsertion(glyph, entry, index) {
  36514. if (entry.flags & SET_MARK) {
  36515. this.markedIndex = index;
  36516. }
  36517. if (entry.markedInsertIndex !== 0xffff) {
  36518. var count = (entry.flags & MARKED_INSERT_COUNT) >>> 5;
  36519. var isBefore = !!(entry.flags & MARKED_INSERT_BEFORE);
  36520. this._insertGlyphs(this.markedIndex, entry.markedInsertIndex, count, isBefore);
  36521. }
  36522. if (entry.currentInsertIndex !== 0xffff) {
  36523. var _count = (entry.flags & CURRENT_INSERT_COUNT) >>> 5;
  36524. var _isBefore = !!(entry.flags & CURRENT_INSERT_BEFORE);
  36525. this._insertGlyphs(index, entry.currentInsertIndex, _count, _isBefore);
  36526. }
  36527. };
  36528. AATMorxProcessor.prototype.getSupportedFeatures = function getSupportedFeatures() {
  36529. var features = [];
  36530. for (var _iterator4 = this.morx.chains, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _getIterator(_iterator4);;) {
  36531. var _ref4;
  36532. if (_isArray4) {
  36533. if (_i4 >= _iterator4.length) break;
  36534. _ref4 = _iterator4[_i4++];
  36535. } else {
  36536. _i4 = _iterator4.next();
  36537. if (_i4.done) break;
  36538. _ref4 = _i4.value;
  36539. }
  36540. var chain = _ref4;
  36541. for (var _iterator5 = chain.features, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : _getIterator(_iterator5);;) {
  36542. var _ref5;
  36543. if (_isArray5) {
  36544. if (_i5 >= _iterator5.length) break;
  36545. _ref5 = _iterator5[_i5++];
  36546. } else {
  36547. _i5 = _iterator5.next();
  36548. if (_i5.done) break;
  36549. _ref5 = _i5.value;
  36550. }
  36551. var feature = _ref5;
  36552. features.push([feature.featureType, feature.featureSetting]);
  36553. }
  36554. }
  36555. return features;
  36556. };
  36557. AATMorxProcessor.prototype.generateInputs = function generateInputs(gid) {
  36558. if (!this.inputCache) {
  36559. this.generateInputCache();
  36560. }
  36561. return this.inputCache[gid] || [];
  36562. };
  36563. AATMorxProcessor.prototype.generateInputCache = function generateInputCache() {
  36564. this.inputCache = {};
  36565. for (var _iterator6 = this.morx.chains, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : _getIterator(_iterator6);;) {
  36566. var _ref6;
  36567. if (_isArray6) {
  36568. if (_i6 >= _iterator6.length) break;
  36569. _ref6 = _iterator6[_i6++];
  36570. } else {
  36571. _i6 = _iterator6.next();
  36572. if (_i6.done) break;
  36573. _ref6 = _i6.value;
  36574. }
  36575. var chain = _ref6;
  36576. var flags = chain.defaultFlags;
  36577. for (var _iterator7 = chain.subtables, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : _getIterator(_iterator7);;) {
  36578. var _ref7;
  36579. if (_isArray7) {
  36580. if (_i7 >= _iterator7.length) break;
  36581. _ref7 = _iterator7[_i7++];
  36582. } else {
  36583. _i7 = _iterator7.next();
  36584. if (_i7.done) break;
  36585. _ref7 = _i7.value;
  36586. }
  36587. var subtable = _ref7;
  36588. if (subtable.subFeatureFlags & flags) {
  36589. this.generateInputsForSubtable(subtable);
  36590. }
  36591. }
  36592. }
  36593. };
  36594. AATMorxProcessor.prototype.generateInputsForSubtable = function generateInputsForSubtable(subtable) {
  36595. var _this = this;
  36596. // Currently, only supporting ligature subtables.
  36597. if (subtable.type !== 2) {
  36598. return;
  36599. }
  36600. var reverse = !!(subtable.coverage & REVERSE_DIRECTION);
  36601. if (reverse) {
  36602. throw new Error('Reverse subtable, not supported.');
  36603. }
  36604. this.subtable = subtable;
  36605. this.ligatureStack = [];
  36606. var stateMachine = this.getStateMachine(subtable);
  36607. var process = this.getProcessor();
  36608. var input = [];
  36609. var stack = [];
  36610. this.glyphs = [];
  36611. stateMachine.traverse({
  36612. enter: function enter(glyph, entry) {
  36613. var glyphs = _this.glyphs;
  36614. stack.push({
  36615. glyphs: glyphs.slice(),
  36616. ligatureStack: _this.ligatureStack.slice()
  36617. });
  36618. // Add glyph to input and glyphs to process.
  36619. var g = _this.font.getGlyph(glyph);
  36620. input.push(g);
  36621. glyphs.push(input[input.length - 1]);
  36622. // Process ligature substitution
  36623. process(glyphs[glyphs.length - 1], entry, glyphs.length - 1);
  36624. // Add input to result if only one matching (non-deleted) glyph remains.
  36625. var count = 0;
  36626. var found = 0;
  36627. for (var i = 0; i < glyphs.length && count <= 1; i++) {
  36628. if (glyphs[i].id !== 0xffff) {
  36629. count++;
  36630. found = glyphs[i].id;
  36631. }
  36632. }
  36633. if (count === 1) {
  36634. var result = input.map(function (g) {
  36635. return g.id;
  36636. });
  36637. var _cache = _this.inputCache[found];
  36638. if (_cache) {
  36639. _cache.push(result);
  36640. } else {
  36641. _this.inputCache[found] = [result];
  36642. }
  36643. }
  36644. },
  36645. exit: function exit() {
  36646. var _stack$pop = stack.pop();
  36647. _this.glyphs = _stack$pop.glyphs;
  36648. _this.ligatureStack = _stack$pop.ligatureStack;
  36649. input.pop();
  36650. }
  36651. });
  36652. };
  36653. return AATMorxProcessor;
  36654. }(), (_applyDecoratedDescriptor$2(_class$2.prototype, 'getStateMachine', [cache], _Object$getOwnPropertyDescriptor(_class$2.prototype, 'getStateMachine'), _class$2.prototype)), _class$2);
  36655. function swap(glyphs, rangeA, rangeB) {
  36656. var reverseA = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  36657. var reverseB = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  36658. var end = glyphs.splice(rangeB[0] - (rangeB[1] - 1), rangeB[1]);
  36659. if (reverseB) {
  36660. end.reverse();
  36661. }
  36662. var start = glyphs.splice.apply(glyphs, [rangeA[0], rangeA[1]].concat(end));
  36663. if (reverseA) {
  36664. start.reverse();
  36665. }
  36666. glyphs.splice.apply(glyphs, [rangeB[0] - (rangeA[1] - 1), 0].concat(start));
  36667. return glyphs;
  36668. }
  36669. function reorderGlyphs(glyphs, verb, firstGlyph, lastGlyph) {
  36670. var length = lastGlyph - firstGlyph + 1;
  36671. switch (verb) {
  36672. case 0:
  36673. // no change
  36674. return glyphs;
  36675. case 1:
  36676. // Ax => xA
  36677. return swap(glyphs, [firstGlyph, 1], [lastGlyph, 0]);
  36678. case 2:
  36679. // xD => Dx
  36680. return swap(glyphs, [firstGlyph, 0], [lastGlyph, 1]);
  36681. case 3:
  36682. // AxD => DxA
  36683. return swap(glyphs, [firstGlyph, 1], [lastGlyph, 1]);
  36684. case 4:
  36685. // ABx => xAB
  36686. return swap(glyphs, [firstGlyph, 2], [lastGlyph, 0]);
  36687. case 5:
  36688. // ABx => xBA
  36689. return swap(glyphs, [firstGlyph, 2], [lastGlyph, 0], true, false);
  36690. case 6:
  36691. // xCD => CDx
  36692. return swap(glyphs, [firstGlyph, 0], [lastGlyph, 2]);
  36693. case 7:
  36694. // xCD => DCx
  36695. return swap(glyphs, [firstGlyph, 0], [lastGlyph, 2], false, true);
  36696. case 8:
  36697. // AxCD => CDxA
  36698. return swap(glyphs, [firstGlyph, 1], [lastGlyph, 2]);
  36699. case 9:
  36700. // AxCD => DCxA
  36701. return swap(glyphs, [firstGlyph, 1], [lastGlyph, 2], false, true);
  36702. case 10:
  36703. // ABxD => DxAB
  36704. return swap(glyphs, [firstGlyph, 2], [lastGlyph, 1]);
  36705. case 11:
  36706. // ABxD => DxBA
  36707. return swap(glyphs, [firstGlyph, 2], [lastGlyph, 1], true, false);
  36708. case 12:
  36709. // ABxCD => CDxAB
  36710. return swap(glyphs, [firstGlyph, 2], [lastGlyph, 2]);
  36711. case 13:
  36712. // ABxCD => CDxBA
  36713. return swap(glyphs, [firstGlyph, 2], [lastGlyph, 2], true, false);
  36714. case 14:
  36715. // ABxCD => DCxAB
  36716. return swap(glyphs, [firstGlyph, 2], [lastGlyph, 2], false, true);
  36717. case 15:
  36718. // ABxCD => DCxBA
  36719. return swap(glyphs, [firstGlyph, 2], [lastGlyph, 2], true, true);
  36720. default:
  36721. throw new Error('Unknown verb: ' + verb);
  36722. }
  36723. }
  36724. var AATLayoutEngine = function () {
  36725. function AATLayoutEngine(font) {
  36726. _classCallCheck(this, AATLayoutEngine);
  36727. this.font = font;
  36728. this.morxProcessor = new AATMorxProcessor(font);
  36729. this.fallbackPosition = false;
  36730. }
  36731. AATLayoutEngine.prototype.substitute = function substitute(glyphRun) {
  36732. // AAT expects the glyphs to be in visual order prior to morx processing,
  36733. // so reverse the glyphs if the script is right-to-left.
  36734. if (glyphRun.direction === 'rtl') {
  36735. glyphRun.glyphs.reverse();
  36736. }
  36737. this.morxProcessor.process(glyphRun.glyphs, mapOTToAAT(glyphRun.features));
  36738. };
  36739. AATLayoutEngine.prototype.getAvailableFeatures = function getAvailableFeatures(script, language) {
  36740. return mapAATToOT(this.morxProcessor.getSupportedFeatures());
  36741. };
  36742. AATLayoutEngine.prototype.stringsForGlyph = function stringsForGlyph(gid) {
  36743. var glyphStrings = this.morxProcessor.generateInputs(gid);
  36744. var result = new _Set();
  36745. for (var _iterator = glyphStrings, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _getIterator(_iterator);;) {
  36746. var _ref;
  36747. if (_isArray) {
  36748. if (_i >= _iterator.length) break;
  36749. _ref = _iterator[_i++];
  36750. } else {
  36751. _i = _iterator.next();
  36752. if (_i.done) break;
  36753. _ref = _i.value;
  36754. }
  36755. var glyphs = _ref;
  36756. this._addStrings(glyphs, 0, result, '');
  36757. }
  36758. return result;
  36759. };
  36760. AATLayoutEngine.prototype._addStrings = function _addStrings(glyphs, index, strings, string) {
  36761. var codePoints = this.font._cmapProcessor.codePointsForGlyph(glyphs[index]);
  36762. for (var _iterator2 = codePoints, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _getIterator(_iterator2);;) {
  36763. var _ref2;
  36764. if (_isArray2) {
  36765. if (_i2 >= _iterator2.length) break;
  36766. _ref2 = _iterator2[_i2++];
  36767. } else {
  36768. _i2 = _iterator2.next();
  36769. if (_i2.done) break;
  36770. _ref2 = _i2.value;
  36771. }
  36772. var codePoint = _ref2;
  36773. var s = string + _String$fromCodePoint(codePoint);
  36774. if (index < glyphs.length - 1) {
  36775. this._addStrings(glyphs, index + 1, strings, s);
  36776. } else {
  36777. strings.add(s);
  36778. }
  36779. }
  36780. };
  36781. return AATLayoutEngine;
  36782. }();
  36783. /**
  36784. * ShapingPlans are used by the OpenType shapers to store which
  36785. * features should by applied, and in what order to apply them.
  36786. * The features are applied in groups called stages. A feature
  36787. * can be applied globally to all glyphs, or locally to only
  36788. * specific glyphs.
  36789. *
  36790. * @private
  36791. */
  36792. var ShapingPlan = function () {
  36793. function ShapingPlan(font, script, direction) {
  36794. _classCallCheck(this, ShapingPlan);
  36795. this.font = font;
  36796. this.script = script;
  36797. this.direction = direction;
  36798. this.stages = [];
  36799. this.globalFeatures = {};
  36800. this.allFeatures = {};
  36801. }
  36802. /**
  36803. * Adds the given features to the last stage.
  36804. * Ignores features that have already been applied.
  36805. */
  36806. ShapingPlan.prototype._addFeatures = function _addFeatures(features, global) {
  36807. var stageIndex = this.stages.length - 1;
  36808. var stage = this.stages[stageIndex];
  36809. for (var _iterator = features, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _getIterator(_iterator);;) {
  36810. var _ref;
  36811. if (_isArray) {
  36812. if (_i >= _iterator.length) break;
  36813. _ref = _iterator[_i++];
  36814. } else {
  36815. _i = _iterator.next();
  36816. if (_i.done) break;
  36817. _ref = _i.value;
  36818. }
  36819. var feature = _ref;
  36820. if (this.allFeatures[feature] == null) {
  36821. stage.push(feature);
  36822. this.allFeatures[feature] = stageIndex;
  36823. if (global) {
  36824. this.globalFeatures[feature] = true;
  36825. }
  36826. }
  36827. }
  36828. };
  36829. /**
  36830. * Add features to the last stage
  36831. */
  36832. ShapingPlan.prototype.add = function add(arg) {
  36833. var global = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  36834. if (this.stages.length === 0) {
  36835. this.stages.push([]);
  36836. }
  36837. if (typeof arg === 'string') {
  36838. arg = [arg];
  36839. }
  36840. if (Array.isArray(arg)) {
  36841. this._addFeatures(arg, global);
  36842. } else if ((typeof arg === 'undefined' ? 'undefined' : _typeof(arg)) === 'object') {
  36843. this._addFeatures(arg.global || [], true);
  36844. this._addFeatures(arg.local || [], false);
  36845. } else {
  36846. throw new Error("Unsupported argument to ShapingPlan#add");
  36847. }
  36848. };
  36849. /**
  36850. * Add a new stage
  36851. */
  36852. ShapingPlan.prototype.addStage = function addStage(arg, global) {
  36853. if (typeof arg === 'function') {
  36854. this.stages.push(arg, []);
  36855. } else {
  36856. this.stages.push([]);
  36857. this.add(arg, global);
  36858. }
  36859. };
  36860. ShapingPlan.prototype.setFeatureOverrides = function setFeatureOverrides(features) {
  36861. if (Array.isArray(features)) {
  36862. this.add(features);
  36863. } else if ((typeof features === 'undefined' ? 'undefined' : _typeof(features)) === 'object') {
  36864. for (var tag in features) {
  36865. if (features[tag]) {
  36866. this.add(tag);
  36867. } else if (this.allFeatures[tag] != null) {
  36868. var stage = this.stages[this.allFeatures[tag]];
  36869. stage.splice(stage.indexOf(tag), 1);
  36870. delete this.allFeatures[tag];
  36871. delete this.globalFeatures[tag];
  36872. }
  36873. }
  36874. }
  36875. };
  36876. /**
  36877. * Assigns the global features to the given glyphs
  36878. */
  36879. ShapingPlan.prototype.assignGlobalFeatures = function assignGlobalFeatures(glyphs) {
  36880. for (var _iterator2 = glyphs, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _getIterator(_iterator2);;) {
  36881. var _ref2;
  36882. if (_isArray2) {
  36883. if (_i2 >= _iterator2.length) break;
  36884. _ref2 = _iterator2[_i2++];
  36885. } else {
  36886. _i2 = _iterator2.next();
  36887. if (_i2.done) break;
  36888. _ref2 = _i2.value;
  36889. }
  36890. var glyph = _ref2;
  36891. for (var feature in this.globalFeatures) {
  36892. glyph.features[feature] = true;
  36893. }
  36894. }
  36895. };
  36896. /**
  36897. * Executes the planned stages using the given OTProcessor
  36898. */
  36899. ShapingPlan.prototype.process = function process(processor, glyphs, positions) {
  36900. for (var _iterator3 = this.stages, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _getIterator(_iterator3);;) {
  36901. var _ref3;
  36902. if (_isArray3) {
  36903. if (_i3 >= _iterator3.length) break;
  36904. _ref3 = _iterator3[_i3++];
  36905. } else {
  36906. _i3 = _iterator3.next();
  36907. if (_i3.done) break;
  36908. _ref3 = _i3.value;
  36909. }
  36910. var stage = _ref3;
  36911. if (typeof stage === 'function') {
  36912. if (!positions) {
  36913. stage(this.font, glyphs, this);
  36914. }
  36915. } else if (stage.length > 0) {
  36916. processor.applyFeatures(stage, glyphs, positions);
  36917. }
  36918. }
  36919. };
  36920. return ShapingPlan;
  36921. }();
  36922. var _class$4;
  36923. var _temp;
  36924. var VARIATION_FEATURES = ['rvrn'];
  36925. var COMMON_FEATURES = ['ccmp', 'locl', 'rlig', 'mark', 'mkmk'];
  36926. var FRACTIONAL_FEATURES = ['frac', 'numr', 'dnom'];
  36927. var HORIZONTAL_FEATURES = ['calt', 'clig', 'liga', 'rclt', 'curs', 'kern'];
  36928. var DIRECTIONAL_FEATURES = {
  36929. ltr: ['ltra', 'ltrm'],
  36930. rtl: ['rtla', 'rtlm']
  36931. };
  36932. var DefaultShaper = (_temp = _class$4 = function () {
  36933. function DefaultShaper() {
  36934. _classCallCheck(this, DefaultShaper);
  36935. }
  36936. DefaultShaper.plan = function plan(_plan, glyphs, features) {
  36937. // Plan the features we want to apply
  36938. this.planPreprocessing(_plan);
  36939. this.planFeatures(_plan);
  36940. this.planPostprocessing(_plan, features);
  36941. // Assign the global features to all the glyphs
  36942. _plan.assignGlobalFeatures(glyphs);
  36943. // Assign local features to glyphs
  36944. this.assignFeatures(_plan, glyphs);
  36945. };
  36946. DefaultShaper.planPreprocessing = function planPreprocessing(plan) {
  36947. plan.add({
  36948. global: [].concat(VARIATION_FEATURES, DIRECTIONAL_FEATURES[plan.direction]),
  36949. local: FRACTIONAL_FEATURES
  36950. });
  36951. };
  36952. DefaultShaper.planFeatures = function planFeatures(plan) {
  36953. // Do nothing by default. Let subclasses override this.
  36954. };
  36955. DefaultShaper.planPostprocessing = function planPostprocessing(plan, userFeatures) {
  36956. plan.add([].concat(COMMON_FEATURES, HORIZONTAL_FEATURES));
  36957. plan.setFeatureOverrides(userFeatures);
  36958. };
  36959. DefaultShaper.assignFeatures = function assignFeatures(plan, glyphs) {
  36960. // Enable contextual fractions
  36961. for (var i = 0; i < glyphs.length; i++) {
  36962. var glyph = glyphs[i];
  36963. if (glyph.codePoints[0] === 0x2044) {
  36964. // fraction slash
  36965. var start = i;
  36966. var end = i + 1;
  36967. // Apply numerator
  36968. while (start > 0 && unicode.isDigit(glyphs[start - 1].codePoints[0])) {
  36969. glyphs[start - 1].features.numr = true;
  36970. glyphs[start - 1].features.frac = true;
  36971. start--;
  36972. }
  36973. // Apply denominator
  36974. while (end < glyphs.length && unicode.isDigit(glyphs[end].codePoints[0])) {
  36975. glyphs[end].features.dnom = true;
  36976. glyphs[end].features.frac = true;
  36977. end++;
  36978. }
  36979. // Apply fraction slash
  36980. glyph.features.frac = true;
  36981. i = end - 1;
  36982. }
  36983. }
  36984. };
  36985. return DefaultShaper;
  36986. }(), _class$4.zeroMarkWidths = 'AFTER_GPOS', _temp);
  36987. var trie = new UnicodeTrie(Buffer("AAEQAAAAAAAAADGgAZUBav7t2CtPA0EUBeDZB00pin9AJZIEgyUEj0QhweDAgQOJxCBRBElQSBwSicLgkOAwnNKZ5GaY2c7uzj4o5yZfZrrbefbuIx2nSq3CGmzAWH/+K+UO7MIe7MMhHMMpnMMFXMIVXIt2t3CnP088iPqjqNN8e4Ij7Rle4LUH82rLm6i/92A+RERERERERERNmfz/89GDeRARERERzbN8ceps2Iwt9H0C9/AJ6yOlDkbTczcot5VSm8Pm1vcFWfb7+BKOLTuOd2UlTX4wGP85Eg953lWPFbnuN7PkjtLmalOWbNenkHOSa7T3KmR9MVTZ2zZkVj1kHa68MueVKH0R4zqQ44WEXLM8VjcWHP0PtKLfPzQnMtGn3W4QYf6qxFxceVI394r2xnV+1rih0fV1Vzf3fO1n3evL5J78ruvZ5ptX2Rwy92Tfb1wlEqut3U+sZ3HXOeJ7/zDrbyuP6+Zz0fqa6Nv3vhY7Yu1xWnGevmsvsUpTT/RYIe8waUH/rvHMWKFzLfN8L+rTfp645mfX7ftlnfDtYxN59w0=","base64"));
  36988. var FEATURES = ['isol', 'fina', 'fin2', 'fin3', 'medi', 'med2', 'init'];
  36989. var ShapingClasses = {
  36990. Non_Joining: 0,
  36991. Left_Joining: 1,
  36992. Right_Joining: 2,
  36993. Dual_Joining: 3,
  36994. Join_Causing: 3,
  36995. ALAPH: 4,
  36996. 'DALATH RISH': 5,
  36997. Transparent: 6
  36998. };
  36999. var ISOL = 'isol';
  37000. var FINA = 'fina';
  37001. var FIN2 = 'fin2';
  37002. var FIN3 = 'fin3';
  37003. var MEDI = 'medi';
  37004. var MED2 = 'med2';
  37005. var INIT = 'init';
  37006. var NONE = null;
  37007. // Each entry is [prevAction, curAction, nextState]
  37008. var STATE_TABLE = [
  37009. // Non_Joining, Left_Joining, Right_Joining, Dual_Joining, ALAPH, DALATH RISH
  37010. // State 0: prev was U, not willing to join.
  37011. [[NONE, NONE, 0], [NONE, ISOL, 2], [NONE, ISOL, 1], [NONE, ISOL, 2], [NONE, ISOL, 1], [NONE, ISOL, 6]],
  37012. // State 1: prev was R or ISOL/ALAPH, not willing to join.
  37013. [[NONE, NONE, 0], [NONE, ISOL, 2], [NONE, ISOL, 1], [NONE, ISOL, 2], [NONE, FIN2, 5], [NONE, ISOL, 6]],
  37014. // State 2: prev was D/L in ISOL form, willing to join.
  37015. [[NONE, NONE, 0], [NONE, ISOL, 2], [INIT, FINA, 1], [INIT, FINA, 3], [INIT, FINA, 4], [INIT, FINA, 6]],
  37016. // State 3: prev was D in FINA form, willing to join.
  37017. [[NONE, NONE, 0], [NONE, ISOL, 2], [MEDI, FINA, 1], [MEDI, FINA, 3], [MEDI, FINA, 4], [MEDI, FINA, 6]],
  37018. // State 4: prev was FINA ALAPH, not willing to join.
  37019. [[NONE, NONE, 0], [NONE, ISOL, 2], [MED2, ISOL, 1], [MED2, ISOL, 2], [MED2, FIN2, 5], [MED2, ISOL, 6]],
  37020. // State 5: prev was FIN2/FIN3 ALAPH, not willing to join.
  37021. [[NONE, NONE, 0], [NONE, ISOL, 2], [ISOL, ISOL, 1], [ISOL, ISOL, 2], [ISOL, FIN2, 5], [ISOL, ISOL, 6]],
  37022. // State 6: prev was DALATH/RISH, not willing to join.
  37023. [[NONE, NONE, 0], [NONE, ISOL, 2], [NONE, ISOL, 1], [NONE, ISOL, 2], [NONE, FIN3, 5], [NONE, ISOL, 6]]];
  37024. /**
  37025. * This is a shaper for Arabic, and other cursive scripts.
  37026. * It uses data from ArabicShaping.txt in the Unicode database,
  37027. * compiled to a UnicodeTrie by generate-data.coffee.
  37028. *
  37029. * The shaping state machine was ported from Harfbuzz.
  37030. * https://github.com/behdad/harfbuzz/blob/master/src/hb-ot-shape-complex-arabic.cc
  37031. */
  37032. var ArabicShaper = function (_DefaultShaper) {
  37033. _inherits(ArabicShaper, _DefaultShaper);
  37034. function ArabicShaper() {
  37035. _classCallCheck(this, ArabicShaper);
  37036. return _possibleConstructorReturn(this, _DefaultShaper.apply(this, arguments));
  37037. }
  37038. ArabicShaper.planFeatures = function planFeatures(plan) {
  37039. plan.add(['ccmp', 'locl']);
  37040. for (var i = 0; i < FEATURES.length; i++) {
  37041. var feature = FEATURES[i];
  37042. plan.addStage(feature, false);
  37043. }
  37044. plan.addStage('mset');
  37045. };
  37046. ArabicShaper.assignFeatures = function assignFeatures(plan, glyphs) {
  37047. _DefaultShaper.assignFeatures.call(this, plan, glyphs);
  37048. var prev = -1;
  37049. var state = 0;
  37050. var actions = [];
  37051. // Apply the state machine to map glyphs to features
  37052. for (var i = 0; i < glyphs.length; i++) {
  37053. var curAction = void 0,
  37054. prevAction = void 0;
  37055. var glyph = glyphs[i];
  37056. var type = getShapingClass(glyph.codePoints[0]);
  37057. if (type === ShapingClasses.Transparent) {
  37058. actions[i] = NONE;
  37059. continue;
  37060. }
  37061. var _STATE_TABLE$state$ty = STATE_TABLE[state][type];
  37062. prevAction = _STATE_TABLE$state$ty[0];
  37063. curAction = _STATE_TABLE$state$ty[1];
  37064. state = _STATE_TABLE$state$ty[2];
  37065. if (prevAction !== NONE && prev !== -1) {
  37066. actions[prev] = prevAction;
  37067. }
  37068. actions[i] = curAction;
  37069. prev = i;
  37070. }
  37071. // Apply the chosen features to their respective glyphs
  37072. for (var index = 0; index < glyphs.length; index++) {
  37073. var feature = void 0;
  37074. var glyph = glyphs[index];
  37075. if (feature = actions[index]) {
  37076. glyph.features[feature] = true;
  37077. }
  37078. }
  37079. };
  37080. return ArabicShaper;
  37081. }(DefaultShaper);
  37082. function getShapingClass(codePoint) {
  37083. var res = trie.get(codePoint);
  37084. if (res) {
  37085. return res - 1;
  37086. }
  37087. var category = unicode.getCategory(codePoint);
  37088. if (category === 'Mn' || category === 'Me' || category === 'Cf') {
  37089. return ShapingClasses.Transparent;
  37090. }
  37091. return ShapingClasses.Non_Joining;
  37092. }
  37093. var GlyphIterator = function () {
  37094. function GlyphIterator(glyphs, options) {
  37095. _classCallCheck(this, GlyphIterator);
  37096. this.glyphs = glyphs;
  37097. this.reset(options);
  37098. }
  37099. GlyphIterator.prototype.reset = function reset() {
  37100. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  37101. var index = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  37102. this.options = options;
  37103. this.flags = options.flags || {};
  37104. this.markAttachmentType = options.markAttachmentType || 0;
  37105. this.index = index;
  37106. };
  37107. GlyphIterator.prototype.shouldIgnore = function shouldIgnore(glyph) {
  37108. return this.flags.ignoreMarks && glyph.isMark || this.flags.ignoreBaseGlyphs && glyph.isBase || this.flags.ignoreLigatures && glyph.isLigature || this.markAttachmentType && glyph.isMark && glyph.markAttachmentType !== this.markAttachmentType;
  37109. };
  37110. GlyphIterator.prototype.move = function move(dir) {
  37111. this.index += dir;
  37112. while (0 <= this.index && this.index < this.glyphs.length && this.shouldIgnore(this.glyphs[this.index])) {
  37113. this.index += dir;
  37114. }
  37115. if (0 > this.index || this.index >= this.glyphs.length) {
  37116. return null;
  37117. }
  37118. return this.glyphs[this.index];
  37119. };
  37120. GlyphIterator.prototype.next = function next() {
  37121. return this.move(+1);
  37122. };
  37123. GlyphIterator.prototype.prev = function prev() {
  37124. return this.move(-1);
  37125. };
  37126. GlyphIterator.prototype.peek = function peek() {
  37127. var count = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
  37128. var idx = this.index;
  37129. var res = this.increment(count);
  37130. this.index = idx;
  37131. return res;
  37132. };
  37133. GlyphIterator.prototype.peekIndex = function peekIndex() {
  37134. var count = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
  37135. var idx = this.index;
  37136. this.increment(count);
  37137. var res = this.index;
  37138. this.index = idx;
  37139. return res;
  37140. };
  37141. GlyphIterator.prototype.increment = function increment() {
  37142. var count = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
  37143. var dir = count < 0 ? -1 : 1;
  37144. count = Math.abs(count);
  37145. while (count--) {
  37146. this.move(dir);
  37147. }
  37148. return this.glyphs[this.index];
  37149. };
  37150. _createClass(GlyphIterator, [{
  37151. key: "cur",
  37152. get: function get() {
  37153. return this.glyphs[this.index] || null;
  37154. }
  37155. }]);
  37156. return GlyphIterator;
  37157. }();
  37158. var DEFAULT_SCRIPTS = ['DFLT', 'dflt', 'latn'];
  37159. var OTProcessor = function () {
  37160. function OTProcessor(font, table) {
  37161. _classCallCheck(this, OTProcessor);
  37162. this.font = font;
  37163. this.table = table;
  37164. this.script = null;
  37165. this.scriptTag = null;
  37166. this.language = null;
  37167. this.languageTag = null;
  37168. this.features = {};
  37169. this.lookups = {};
  37170. // Setup variation substitutions
  37171. this.variationsIndex = font._variationProcessor ? this.findVariationsIndex(font._variationProcessor.normalizedCoords) : -1;
  37172. // initialize to default script + language
  37173. this.selectScript();
  37174. // current context (set by applyFeatures)
  37175. this.glyphs = [];
  37176. this.positions = []; // only used by GPOS
  37177. this.ligatureID = 1;
  37178. this.currentFeature = null;
  37179. }
  37180. OTProcessor.prototype.findScript = function findScript(script) {
  37181. if (this.table.scriptList == null) {
  37182. return null;
  37183. }
  37184. if (!Array.isArray(script)) {
  37185. script = [script];
  37186. }
  37187. for (var _iterator = script, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _getIterator(_iterator);;) {
  37188. var _ref;
  37189. if (_isArray) {
  37190. if (_i >= _iterator.length) break;
  37191. _ref = _iterator[_i++];
  37192. } else {
  37193. _i = _iterator.next();
  37194. if (_i.done) break;
  37195. _ref = _i.value;
  37196. }
  37197. var s = _ref;
  37198. for (var _iterator2 = this.table.scriptList, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _getIterator(_iterator2);;) {
  37199. var _ref2;
  37200. if (_isArray2) {
  37201. if (_i2 >= _iterator2.length) break;
  37202. _ref2 = _iterator2[_i2++];
  37203. } else {
  37204. _i2 = _iterator2.next();
  37205. if (_i2.done) break;
  37206. _ref2 = _i2.value;
  37207. }
  37208. var entry = _ref2;
  37209. if (entry.tag === s) {
  37210. return entry;
  37211. }
  37212. }
  37213. }
  37214. return null;
  37215. };
  37216. OTProcessor.prototype.selectScript = function selectScript(script, language, direction$$) {
  37217. var changed = false;
  37218. var entry = void 0;
  37219. if (!this.script || script !== this.scriptTag) {
  37220. entry = this.findScript(script);
  37221. if (!entry) {
  37222. entry = this.findScript(DEFAULT_SCRIPTS);
  37223. }
  37224. if (!entry) {
  37225. return this.scriptTag;
  37226. }
  37227. this.scriptTag = entry.tag;
  37228. this.script = entry.script;
  37229. this.language = null;
  37230. this.languageTag = null;
  37231. changed = true;
  37232. }
  37233. if (!direction$$ || direction$$ !== this.direction) {
  37234. this.direction = direction$$ || direction(script);
  37235. }
  37236. if (language && language.length < 4) {
  37237. language += ' '.repeat(4 - language.length);
  37238. }
  37239. if (!language || language !== this.languageTag) {
  37240. this.language = null;
  37241. for (var _iterator3 = this.script.langSysRecords, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _getIterator(_iterator3);;) {
  37242. var _ref3;
  37243. if (_isArray3) {
  37244. if (_i3 >= _iterator3.length) break;
  37245. _ref3 = _iterator3[_i3++];
  37246. } else {
  37247. _i3 = _iterator3.next();
  37248. if (_i3.done) break;
  37249. _ref3 = _i3.value;
  37250. }
  37251. var lang = _ref3;
  37252. if (lang.tag === language) {
  37253. this.language = lang.langSys;
  37254. this.languageTag = lang.tag;
  37255. break;
  37256. }
  37257. }
  37258. if (!this.language) {
  37259. this.language = this.script.defaultLangSys;
  37260. this.languageTag = null;
  37261. }
  37262. changed = true;
  37263. }
  37264. // Build a feature lookup table
  37265. if (changed) {
  37266. this.features = {};
  37267. if (this.language) {
  37268. for (var _iterator4 = this.language.featureIndexes, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _getIterator(_iterator4);;) {
  37269. var _ref4;
  37270. if (_isArray4) {
  37271. if (_i4 >= _iterator4.length) break;
  37272. _ref4 = _iterator4[_i4++];
  37273. } else {
  37274. _i4 = _iterator4.next();
  37275. if (_i4.done) break;
  37276. _ref4 = _i4.value;
  37277. }
  37278. var featureIndex = _ref4;
  37279. var record = this.table.featureList[featureIndex];
  37280. var substituteFeature = this.substituteFeatureForVariations(featureIndex);
  37281. this.features[record.tag] = substituteFeature || record.feature;
  37282. }
  37283. }
  37284. }
  37285. return this.scriptTag;
  37286. };
  37287. OTProcessor.prototype.lookupsForFeatures = function lookupsForFeatures() {
  37288. var userFeatures = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  37289. var exclude = arguments[1];
  37290. var lookups = [];
  37291. for (var _iterator5 = userFeatures, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : _getIterator(_iterator5);;) {
  37292. var _ref5;
  37293. if (_isArray5) {
  37294. if (_i5 >= _iterator5.length) break;
  37295. _ref5 = _iterator5[_i5++];
  37296. } else {
  37297. _i5 = _iterator5.next();
  37298. if (_i5.done) break;
  37299. _ref5 = _i5.value;
  37300. }
  37301. var tag = _ref5;
  37302. var feature = this.features[tag];
  37303. if (!feature) {
  37304. continue;
  37305. }
  37306. for (var _iterator6 = feature.lookupListIndexes, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : _getIterator(_iterator6);;) {
  37307. var _ref6;
  37308. if (_isArray6) {
  37309. if (_i6 >= _iterator6.length) break;
  37310. _ref6 = _iterator6[_i6++];
  37311. } else {
  37312. _i6 = _iterator6.next();
  37313. if (_i6.done) break;
  37314. _ref6 = _i6.value;
  37315. }
  37316. var lookupIndex = _ref6;
  37317. if (exclude && exclude.indexOf(lookupIndex) !== -1) {
  37318. continue;
  37319. }
  37320. lookups.push({
  37321. feature: tag,
  37322. index: lookupIndex,
  37323. lookup: this.table.lookupList.get(lookupIndex)
  37324. });
  37325. }
  37326. }
  37327. lookups.sort(function (a, b) {
  37328. return a.index - b.index;
  37329. });
  37330. return lookups;
  37331. };
  37332. OTProcessor.prototype.substituteFeatureForVariations = function substituteFeatureForVariations(featureIndex) {
  37333. if (this.variationsIndex === -1) {
  37334. return null;
  37335. }
  37336. var record = this.table.featureVariations.featureVariationRecords[this.variationsIndex];
  37337. var substitutions = record.featureTableSubstitution.substitutions;
  37338. for (var _iterator7 = substitutions, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : _getIterator(_iterator7);;) {
  37339. var _ref7;
  37340. if (_isArray7) {
  37341. if (_i7 >= _iterator7.length) break;
  37342. _ref7 = _iterator7[_i7++];
  37343. } else {
  37344. _i7 = _iterator7.next();
  37345. if (_i7.done) break;
  37346. _ref7 = _i7.value;
  37347. }
  37348. var substitution = _ref7;
  37349. if (substitution.featureIndex === featureIndex) {
  37350. return substitution.alternateFeatureTable;
  37351. }
  37352. }
  37353. return null;
  37354. };
  37355. OTProcessor.prototype.findVariationsIndex = function findVariationsIndex(coords) {
  37356. var variations = this.table.featureVariations;
  37357. if (!variations) {
  37358. return -1;
  37359. }
  37360. var records = variations.featureVariationRecords;
  37361. for (var i = 0; i < records.length; i++) {
  37362. var conditions = records[i].conditionSet.conditionTable;
  37363. if (this.variationConditionsMatch(conditions, coords)) {
  37364. return i;
  37365. }
  37366. }
  37367. return -1;
  37368. };
  37369. OTProcessor.prototype.variationConditionsMatch = function variationConditionsMatch(conditions, coords) {
  37370. return conditions.every(function (condition) {
  37371. var coord = condition.axisIndex < coords.length ? coords[condition.axisIndex] : 0;
  37372. return condition.filterRangeMinValue <= coord && coord <= condition.filterRangeMaxValue;
  37373. });
  37374. };
  37375. OTProcessor.prototype.applyFeatures = function applyFeatures(userFeatures, glyphs, advances) {
  37376. var lookups = this.lookupsForFeatures(userFeatures);
  37377. this.applyLookups(lookups, glyphs, advances);
  37378. };
  37379. OTProcessor.prototype.applyLookups = function applyLookups(lookups, glyphs, positions) {
  37380. this.glyphs = glyphs;
  37381. this.positions = positions;
  37382. this.glyphIterator = new GlyphIterator(glyphs);
  37383. for (var _iterator8 = lookups, _isArray8 = Array.isArray(_iterator8), _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : _getIterator(_iterator8);;) {
  37384. var _ref8;
  37385. if (_isArray8) {
  37386. if (_i8 >= _iterator8.length) break;
  37387. _ref8 = _iterator8[_i8++];
  37388. } else {
  37389. _i8 = _iterator8.next();
  37390. if (_i8.done) break;
  37391. _ref8 = _i8.value;
  37392. }
  37393. var _ref9 = _ref8,
  37394. feature = _ref9.feature,
  37395. lookup = _ref9.lookup;
  37396. this.currentFeature = feature;
  37397. this.glyphIterator.reset(lookup.flags);
  37398. while (this.glyphIterator.index < glyphs.length) {
  37399. if (!(feature in this.glyphIterator.cur.features)) {
  37400. this.glyphIterator.next();
  37401. continue;
  37402. }
  37403. for (var _iterator9 = lookup.subTables, _isArray9 = Array.isArray(_iterator9), _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : _getIterator(_iterator9);;) {
  37404. var _ref10;
  37405. if (_isArray9) {
  37406. if (_i9 >= _iterator9.length) break;
  37407. _ref10 = _iterator9[_i9++];
  37408. } else {
  37409. _i9 = _iterator9.next();
  37410. if (_i9.done) break;
  37411. _ref10 = _i9.value;
  37412. }
  37413. var table = _ref10;
  37414. var res = this.applyLookup(lookup.lookupType, table);
  37415. if (res) {
  37416. break;
  37417. }
  37418. }
  37419. this.glyphIterator.next();
  37420. }
  37421. }
  37422. };
  37423. OTProcessor.prototype.applyLookup = function applyLookup(lookup, table) {
  37424. throw new Error("applyLookup must be implemented by subclasses");
  37425. };
  37426. OTProcessor.prototype.applyLookupList = function applyLookupList(lookupRecords) {
  37427. var options = this.glyphIterator.options;
  37428. var glyphIndex = this.glyphIterator.index;
  37429. for (var _iterator10 = lookupRecords, _isArray10 = Array.isArray(_iterator10), _i10 = 0, _iterator10 = _isArray10 ? _iterator10 : _getIterator(_iterator10);;) {
  37430. var _ref11;
  37431. if (_isArray10) {
  37432. if (_i10 >= _iterator10.length) break;
  37433. _ref11 = _iterator10[_i10++];
  37434. } else {
  37435. _i10 = _iterator10.next();
  37436. if (_i10.done) break;
  37437. _ref11 = _i10.value;
  37438. }
  37439. var lookupRecord = _ref11;
  37440. // Reset flags and find glyph index for this lookup record
  37441. this.glyphIterator.reset(options, glyphIndex);
  37442. this.glyphIterator.increment(lookupRecord.sequenceIndex);
  37443. // Get the lookup and setup flags for subtables
  37444. var lookup = this.table.lookupList.get(lookupRecord.lookupListIndex);
  37445. this.glyphIterator.reset(lookup.flags, this.glyphIterator.index);
  37446. // Apply lookup subtables until one matches
  37447. for (var _iterator11 = lookup.subTables, _isArray11 = Array.isArray(_iterator11), _i11 = 0, _iterator11 = _isArray11 ? _iterator11 : _getIterator(_iterator11);;) {
  37448. var _ref12;
  37449. if (_isArray11) {
  37450. if (_i11 >= _iterator11.length) break;
  37451. _ref12 = _iterator11[_i11++];
  37452. } else {
  37453. _i11 = _iterator11.next();
  37454. if (_i11.done) break;
  37455. _ref12 = _i11.value;
  37456. }
  37457. var table = _ref12;
  37458. if (this.applyLookup(lookup.lookupType, table)) {
  37459. break;
  37460. }
  37461. }
  37462. }
  37463. this.glyphIterator.reset(options, glyphIndex);
  37464. return true;
  37465. };
  37466. OTProcessor.prototype.coverageIndex = function coverageIndex(coverage, glyph) {
  37467. if (glyph == null) {
  37468. glyph = this.glyphIterator.cur.id;
  37469. }
  37470. switch (coverage.version) {
  37471. case 1:
  37472. return coverage.glyphs.indexOf(glyph);
  37473. case 2:
  37474. for (var _iterator12 = coverage.rangeRecords, _isArray12 = Array.isArray(_iterator12), _i12 = 0, _iterator12 = _isArray12 ? _iterator12 : _getIterator(_iterator12);;) {
  37475. var _ref13;
  37476. if (_isArray12) {
  37477. if (_i12 >= _iterator12.length) break;
  37478. _ref13 = _iterator12[_i12++];
  37479. } else {
  37480. _i12 = _iterator12.next();
  37481. if (_i12.done) break;
  37482. _ref13 = _i12.value;
  37483. }
  37484. var range = _ref13;
  37485. if (range.start <= glyph && glyph <= range.end) {
  37486. return range.startCoverageIndex + glyph - range.start;
  37487. }
  37488. }
  37489. break;
  37490. }
  37491. return -1;
  37492. };
  37493. OTProcessor.prototype.match = function match(sequenceIndex, sequence, fn, matched) {
  37494. var pos = this.glyphIterator.index;
  37495. var glyph = this.glyphIterator.increment(sequenceIndex);
  37496. var idx = 0;
  37497. while (idx < sequence.length && glyph && fn(sequence[idx], glyph)) {
  37498. if (matched) {
  37499. matched.push(this.glyphIterator.index);
  37500. }
  37501. idx++;
  37502. glyph = this.glyphIterator.next();
  37503. }
  37504. this.glyphIterator.index = pos;
  37505. if (idx < sequence.length) {
  37506. return false;
  37507. }
  37508. return matched || true;
  37509. };
  37510. OTProcessor.prototype.sequenceMatches = function sequenceMatches(sequenceIndex, sequence) {
  37511. return this.match(sequenceIndex, sequence, function (component, glyph) {
  37512. return component === glyph.id;
  37513. });
  37514. };
  37515. OTProcessor.prototype.sequenceMatchIndices = function sequenceMatchIndices(sequenceIndex, sequence) {
  37516. var _this = this;
  37517. return this.match(sequenceIndex, sequence, function (component, glyph) {
  37518. // If the current feature doesn't apply to this glyph,
  37519. if (!(_this.currentFeature in glyph.features)) {
  37520. return false;
  37521. }
  37522. return component === glyph.id;
  37523. }, []);
  37524. };
  37525. OTProcessor.prototype.coverageSequenceMatches = function coverageSequenceMatches(sequenceIndex, sequence) {
  37526. var _this2 = this;
  37527. return this.match(sequenceIndex, sequence, function (coverage, glyph) {
  37528. return _this2.coverageIndex(coverage, glyph.id) >= 0;
  37529. });
  37530. };
  37531. OTProcessor.prototype.getClassID = function getClassID(glyph, classDef) {
  37532. switch (classDef.version) {
  37533. case 1:
  37534. // Class array
  37535. var i = glyph - classDef.startGlyph;
  37536. if (i >= 0 && i < classDef.classValueArray.length) {
  37537. return classDef.classValueArray[i];
  37538. }
  37539. break;
  37540. case 2:
  37541. for (var _iterator13 = classDef.classRangeRecord, _isArray13 = Array.isArray(_iterator13), _i13 = 0, _iterator13 = _isArray13 ? _iterator13 : _getIterator(_iterator13);;) {
  37542. var _ref14;
  37543. if (_isArray13) {
  37544. if (_i13 >= _iterator13.length) break;
  37545. _ref14 = _iterator13[_i13++];
  37546. } else {
  37547. _i13 = _iterator13.next();
  37548. if (_i13.done) break;
  37549. _ref14 = _i13.value;
  37550. }
  37551. var range = _ref14;
  37552. if (range.start <= glyph && glyph <= range.end) {
  37553. return range.class;
  37554. }
  37555. }
  37556. break;
  37557. }
  37558. return 0;
  37559. };
  37560. OTProcessor.prototype.classSequenceMatches = function classSequenceMatches(sequenceIndex, sequence, classDef) {
  37561. var _this3 = this;
  37562. return this.match(sequenceIndex, sequence, function (classID, glyph) {
  37563. return classID === _this3.getClassID(glyph.id, classDef);
  37564. });
  37565. };
  37566. OTProcessor.prototype.applyContext = function applyContext(table) {
  37567. switch (table.version) {
  37568. case 1:
  37569. var index = this.coverageIndex(table.coverage);
  37570. if (index === -1) {
  37571. return false;
  37572. }
  37573. var set = table.ruleSets[index];
  37574. for (var _iterator14 = set, _isArray14 = Array.isArray(_iterator14), _i14 = 0, _iterator14 = _isArray14 ? _iterator14 : _getIterator(_iterator14);;) {
  37575. var _ref15;
  37576. if (_isArray14) {
  37577. if (_i14 >= _iterator14.length) break;
  37578. _ref15 = _iterator14[_i14++];
  37579. } else {
  37580. _i14 = _iterator14.next();
  37581. if (_i14.done) break;
  37582. _ref15 = _i14.value;
  37583. }
  37584. var rule = _ref15;
  37585. if (this.sequenceMatches(1, rule.input)) {
  37586. return this.applyLookupList(rule.lookupRecords);
  37587. }
  37588. }
  37589. break;
  37590. case 2:
  37591. if (this.coverageIndex(table.coverage) === -1) {
  37592. return false;
  37593. }
  37594. index = this.getClassID(this.glyphIterator.cur.id, table.classDef);
  37595. if (index === -1) {
  37596. return false;
  37597. }
  37598. set = table.classSet[index];
  37599. for (var _iterator15 = set, _isArray15 = Array.isArray(_iterator15), _i15 = 0, _iterator15 = _isArray15 ? _iterator15 : _getIterator(_iterator15);;) {
  37600. var _ref16;
  37601. if (_isArray15) {
  37602. if (_i15 >= _iterator15.length) break;
  37603. _ref16 = _iterator15[_i15++];
  37604. } else {
  37605. _i15 = _iterator15.next();
  37606. if (_i15.done) break;
  37607. _ref16 = _i15.value;
  37608. }
  37609. var _rule = _ref16;
  37610. if (this.classSequenceMatches(1, _rule.classes, table.classDef)) {
  37611. return this.applyLookupList(_rule.lookupRecords);
  37612. }
  37613. }
  37614. break;
  37615. case 3:
  37616. if (this.coverageSequenceMatches(0, table.coverages)) {
  37617. return this.applyLookupList(table.lookupRecords);
  37618. }
  37619. break;
  37620. }
  37621. return false;
  37622. };
  37623. OTProcessor.prototype.applyChainingContext = function applyChainingContext(table) {
  37624. switch (table.version) {
  37625. case 1:
  37626. var index = this.coverageIndex(table.coverage);
  37627. if (index === -1) {
  37628. return false;
  37629. }
  37630. var set = table.chainRuleSets[index];
  37631. for (var _iterator16 = set, _isArray16 = Array.isArray(_iterator16), _i16 = 0, _iterator16 = _isArray16 ? _iterator16 : _getIterator(_iterator16);;) {
  37632. var _ref17;
  37633. if (_isArray16) {
  37634. if (_i16 >= _iterator16.length) break;
  37635. _ref17 = _iterator16[_i16++];
  37636. } else {
  37637. _i16 = _iterator16.next();
  37638. if (_i16.done) break;
  37639. _ref17 = _i16.value;
  37640. }
  37641. var rule = _ref17;
  37642. if (this.sequenceMatches(-rule.backtrack.length, rule.backtrack) && this.sequenceMatches(1, rule.input) && this.sequenceMatches(1 + rule.input.length, rule.lookahead)) {
  37643. return this.applyLookupList(rule.lookupRecords);
  37644. }
  37645. }
  37646. break;
  37647. case 2:
  37648. if (this.coverageIndex(table.coverage) === -1) {
  37649. return false;
  37650. }
  37651. index = this.getClassID(this.glyphIterator.cur.id, table.inputClassDef);
  37652. var rules = table.chainClassSet[index];
  37653. if (!rules) {
  37654. return false;
  37655. }
  37656. for (var _iterator17 = rules, _isArray17 = Array.isArray(_iterator17), _i17 = 0, _iterator17 = _isArray17 ? _iterator17 : _getIterator(_iterator17);;) {
  37657. var _ref18;
  37658. if (_isArray17) {
  37659. if (_i17 >= _iterator17.length) break;
  37660. _ref18 = _iterator17[_i17++];
  37661. } else {
  37662. _i17 = _iterator17.next();
  37663. if (_i17.done) break;
  37664. _ref18 = _i17.value;
  37665. }
  37666. var _rule2 = _ref18;
  37667. if (this.classSequenceMatches(-_rule2.backtrack.length, _rule2.backtrack, table.backtrackClassDef) && this.classSequenceMatches(1, _rule2.input, table.inputClassDef) && this.classSequenceMatches(1 + _rule2.input.length, _rule2.lookahead, table.lookaheadClassDef)) {
  37668. return this.applyLookupList(_rule2.lookupRecords);
  37669. }
  37670. }
  37671. break;
  37672. case 3:
  37673. if (this.coverageSequenceMatches(-table.backtrackGlyphCount, table.backtrackCoverage) && this.coverageSequenceMatches(0, table.inputCoverage) && this.coverageSequenceMatches(table.inputGlyphCount, table.lookaheadCoverage)) {
  37674. return this.applyLookupList(table.lookupRecords);
  37675. }
  37676. break;
  37677. }
  37678. return false;
  37679. };
  37680. return OTProcessor;
  37681. }();
  37682. var GlyphInfo = function () {
  37683. function GlyphInfo(font, id) {
  37684. var codePoints = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
  37685. var features = arguments[3];
  37686. _classCallCheck(this, GlyphInfo);
  37687. this._font = font;
  37688. this.codePoints = codePoints;
  37689. this.id = id;
  37690. this.features = {};
  37691. if (Array.isArray(features)) {
  37692. for (var i = 0; i < features.length; i++) {
  37693. var feature = features[i];
  37694. this.features[feature] = true;
  37695. }
  37696. } else if ((typeof features === 'undefined' ? 'undefined' : _typeof(features)) === 'object') {
  37697. _Object$assign(this.features, features);
  37698. }
  37699. this.ligatureID = null;
  37700. this.ligatureComponent = null;
  37701. this.isLigated = false;
  37702. this.cursiveAttachment = null;
  37703. this.markAttachment = null;
  37704. this.shaperInfo = null;
  37705. this.substituted = false;
  37706. this.isMultiplied = false;
  37707. }
  37708. GlyphInfo.prototype.copy = function copy() {
  37709. return new GlyphInfo(this._font, this.id, this.codePoints, this.features);
  37710. };
  37711. _createClass(GlyphInfo, [{
  37712. key: 'id',
  37713. get: function get() {
  37714. return this._id;
  37715. },
  37716. set: function set(id) {
  37717. this._id = id;
  37718. this.substituted = true;
  37719. var GDEF = this._font.GDEF;
  37720. if (GDEF && GDEF.glyphClassDef) {
  37721. // TODO: clean this up
  37722. var classID = OTProcessor.prototype.getClassID(id, GDEF.glyphClassDef);
  37723. this.isBase = classID === 1;
  37724. this.isLigature = classID === 2;
  37725. this.isMark = classID === 3;
  37726. this.markAttachmentType = GDEF.markAttachClassDef ? OTProcessor.prototype.getClassID(id, GDEF.markAttachClassDef) : 0;
  37727. } else {
  37728. this.isMark = this.codePoints.length > 0 && this.codePoints.every(unicode.isMark);
  37729. this.isBase = !this.isMark;
  37730. this.isLigature = this.codePoints.length > 1;
  37731. this.markAttachmentType = 0;
  37732. }
  37733. }
  37734. }]);
  37735. return GlyphInfo;
  37736. }();
  37737. var _class$5;
  37738. var _temp$1;
  37739. /**
  37740. * This is a shaper for the Hangul script, used by the Korean language.
  37741. * It does the following:
  37742. * - decompose if unsupported by the font:
  37743. * <LV> -> <L,V>
  37744. * <LVT> -> <L,V,T>
  37745. * <LV,T> -> <L,V,T>
  37746. *
  37747. * - compose if supported by the font:
  37748. * <L,V> -> <LV>
  37749. * <L,V,T> -> <LVT>
  37750. * <LV,T> -> <LVT>
  37751. *
  37752. * - reorder tone marks (S is any valid syllable):
  37753. * <S, M> -> <M, S>
  37754. *
  37755. * - apply ljmo, vjmo, and tjmo OpenType features to decomposed Jamo sequences.
  37756. *
  37757. * This logic is based on the following documents:
  37758. * - http://www.microsoft.com/typography/OpenTypeDev/hangul/intro.htm
  37759. * - http://ktug.org/~nomos/harfbuzz-hangul/hangulshaper.pdf
  37760. */
  37761. var HangulShaper = (_temp$1 = _class$5 = function (_DefaultShaper) {
  37762. _inherits(HangulShaper, _DefaultShaper);
  37763. function HangulShaper() {
  37764. _classCallCheck(this, HangulShaper);
  37765. return _possibleConstructorReturn(this, _DefaultShaper.apply(this, arguments));
  37766. }
  37767. HangulShaper.planFeatures = function planFeatures(plan) {
  37768. plan.add(['ljmo', 'vjmo', 'tjmo'], false);
  37769. };
  37770. HangulShaper.assignFeatures = function assignFeatures(plan, glyphs) {
  37771. var state = 0;
  37772. var i = 0;
  37773. while (i < glyphs.length) {
  37774. var action = void 0;
  37775. var glyph = glyphs[i];
  37776. var code = glyph.codePoints[0];
  37777. var type = getType(code);
  37778. var _STATE_TABLE$state$ty = STATE_TABLE$1[state][type];
  37779. action = _STATE_TABLE$state$ty[0];
  37780. state = _STATE_TABLE$state$ty[1];
  37781. switch (action) {
  37782. case DECOMPOSE:
  37783. // Decompose the composed syllable if it is not supported by the font.
  37784. if (!plan.font.hasGlyphForCodePoint(code)) {
  37785. i = decompose(glyphs, i, plan.font);
  37786. }
  37787. break;
  37788. case COMPOSE:
  37789. // Found a decomposed syllable. Try to compose if supported by the font.
  37790. i = compose(glyphs, i, plan.font);
  37791. break;
  37792. case TONE_MARK:
  37793. // Got a valid syllable, followed by a tone mark. Move the tone mark to the beginning of the syllable.
  37794. reorderToneMark(glyphs, i, plan.font);
  37795. break;
  37796. case INVALID:
  37797. // Tone mark has no valid syllable to attach to, so insert a dotted circle
  37798. i = insertDottedCircle(glyphs, i, plan.font);
  37799. break;
  37800. }
  37801. i++;
  37802. }
  37803. };
  37804. return HangulShaper;
  37805. }(DefaultShaper), _class$5.zeroMarkWidths = 'NONE', _temp$1);
  37806. var HANGUL_BASE = 0xac00;
  37807. var HANGUL_END = 0xd7a4;
  37808. var HANGUL_COUNT = HANGUL_END - HANGUL_BASE + 1;
  37809. var L_BASE = 0x1100; // lead
  37810. var V_BASE = 0x1161; // vowel
  37811. var T_BASE = 0x11a7; // trail
  37812. var L_COUNT = 19;
  37813. var V_COUNT = 21;
  37814. var T_COUNT = 28;
  37815. var L_END = L_BASE + L_COUNT - 1;
  37816. var V_END = V_BASE + V_COUNT - 1;
  37817. var T_END = T_BASE + T_COUNT - 1;
  37818. var DOTTED_CIRCLE = 0x25cc;
  37819. var isL = function isL(code) {
  37820. return 0x1100 <= code && code <= 0x115f || 0xa960 <= code && code <= 0xa97c;
  37821. };
  37822. var isV = function isV(code) {
  37823. return 0x1160 <= code && code <= 0x11a7 || 0xd7b0 <= code && code <= 0xd7c6;
  37824. };
  37825. var isT = function isT(code) {
  37826. return 0x11a8 <= code && code <= 0x11ff || 0xd7cb <= code && code <= 0xd7fb;
  37827. };
  37828. var isTone = function isTone(code) {
  37829. return 0x302e <= code && code <= 0x302f;
  37830. };
  37831. var isLVT = function isLVT(code) {
  37832. return HANGUL_BASE <= code && code <= HANGUL_END;
  37833. };
  37834. var isLV = function isLV(code) {
  37835. return code - HANGUL_BASE < HANGUL_COUNT && (code - HANGUL_BASE) % T_COUNT === 0;
  37836. };
  37837. var isCombiningL = function isCombiningL(code) {
  37838. return L_BASE <= code && code <= L_END;
  37839. };
  37840. var isCombiningV = function isCombiningV(code) {
  37841. return V_BASE <= code && code <= V_END;
  37842. };
  37843. var isCombiningT = function isCombiningT(code) {
  37844. return T_BASE + 1 && 1 <= code && code <= T_END;
  37845. };
  37846. // Character categories
  37847. var X = 0; // Other character
  37848. var L = 1; // Leading consonant
  37849. var V = 2; // Medial vowel
  37850. var T = 3; // Trailing consonant
  37851. var LV = 4; // Composed <LV> syllable
  37852. var LVT = 5; // Composed <LVT> syllable
  37853. var M = 6; // Tone mark
  37854. // This function classifies a character using the above categories.
  37855. function getType(code) {
  37856. if (isL(code)) {
  37857. return L;
  37858. }
  37859. if (isV(code)) {
  37860. return V;
  37861. }
  37862. if (isT(code)) {
  37863. return T;
  37864. }
  37865. if (isLV(code)) {
  37866. return LV;
  37867. }
  37868. if (isLVT(code)) {
  37869. return LVT;
  37870. }
  37871. if (isTone(code)) {
  37872. return M;
  37873. }
  37874. return X;
  37875. }
  37876. // State machine actions
  37877. var NO_ACTION = 0;
  37878. var DECOMPOSE = 1;
  37879. var COMPOSE = 2;
  37880. var TONE_MARK = 4;
  37881. var INVALID = 5;
  37882. // Build a state machine that accepts valid syllables, and applies actions along the way.
  37883. // The logic this is implementing is documented at the top of the file.
  37884. var STATE_TABLE$1 = [
  37885. // X L V T LV LVT M
  37886. // State 0: start state
  37887. [[NO_ACTION, 0], [NO_ACTION, 1], [NO_ACTION, 0], [NO_ACTION, 0], [DECOMPOSE, 2], [DECOMPOSE, 3], [INVALID, 0]],
  37888. // State 1: <L>
  37889. [[NO_ACTION, 0], [NO_ACTION, 1], [COMPOSE, 2], [NO_ACTION, 0], [DECOMPOSE, 2], [DECOMPOSE, 3], [INVALID, 0]],
  37890. // State 2: <L,V> or <LV>
  37891. [[NO_ACTION, 0], [NO_ACTION, 1], [NO_ACTION, 0], [COMPOSE, 3], [DECOMPOSE, 2], [DECOMPOSE, 3], [TONE_MARK, 0]],
  37892. // State 3: <L,V,T> or <LVT>
  37893. [[NO_ACTION, 0], [NO_ACTION, 1], [NO_ACTION, 0], [NO_ACTION, 0], [DECOMPOSE, 2], [DECOMPOSE, 3], [TONE_MARK, 0]]];
  37894. function getGlyph(font, code, features) {
  37895. return new GlyphInfo(font, font.glyphForCodePoint(code).id, [code], features);
  37896. }
  37897. function decompose(glyphs, i, font) {
  37898. var glyph = glyphs[i];
  37899. var code = glyph.codePoints[0];
  37900. var s = code - HANGUL_BASE;
  37901. var t = T_BASE + s % T_COUNT;
  37902. s = s / T_COUNT | 0;
  37903. var l = L_BASE + s / V_COUNT | 0;
  37904. var v = V_BASE + s % V_COUNT;
  37905. // Don't decompose if all of the components are not available
  37906. if (!font.hasGlyphForCodePoint(l) || !font.hasGlyphForCodePoint(v) || t !== T_BASE && !font.hasGlyphForCodePoint(t)) {
  37907. return i;
  37908. }
  37909. // Replace the current glyph with decomposed L, V, and T glyphs,
  37910. // and apply the proper OpenType features to each component.
  37911. var ljmo = getGlyph(font, l, glyph.features);
  37912. ljmo.features.ljmo = true;
  37913. var vjmo = getGlyph(font, v, glyph.features);
  37914. vjmo.features.vjmo = true;
  37915. var insert = [ljmo, vjmo];
  37916. if (t > T_BASE) {
  37917. var tjmo = getGlyph(font, t, glyph.features);
  37918. tjmo.features.tjmo = true;
  37919. insert.push(tjmo);
  37920. }
  37921. glyphs.splice.apply(glyphs, [i, 1].concat(insert));
  37922. return i + insert.length - 1;
  37923. }
  37924. function compose(glyphs, i, font) {
  37925. var glyph = glyphs[i];
  37926. var code = glyphs[i].codePoints[0];
  37927. var type = getType(code);
  37928. var prev = glyphs[i - 1].codePoints[0];
  37929. var prevType = getType(prev);
  37930. // Figure out what type of syllable we're dealing with
  37931. var lv = void 0,
  37932. ljmo = void 0,
  37933. vjmo = void 0,
  37934. tjmo = void 0;
  37935. if (prevType === LV && type === T) {
  37936. // <LV,T>
  37937. lv = prev;
  37938. tjmo = glyph;
  37939. } else {
  37940. if (type === V) {
  37941. // <L,V>
  37942. ljmo = glyphs[i - 1];
  37943. vjmo = glyph;
  37944. } else {
  37945. // <L,V,T>
  37946. ljmo = glyphs[i - 2];
  37947. vjmo = glyphs[i - 1];
  37948. tjmo = glyph;
  37949. }
  37950. var l = ljmo.codePoints[0];
  37951. var v = vjmo.codePoints[0];
  37952. // Make sure L and V are combining characters
  37953. if (isCombiningL(l) && isCombiningV(v)) {
  37954. lv = HANGUL_BASE + ((l - L_BASE) * V_COUNT + (v - V_BASE)) * T_COUNT;
  37955. }
  37956. }
  37957. var t = tjmo && tjmo.codePoints[0] || T_BASE;
  37958. if (lv != null && (t === T_BASE || isCombiningT(t))) {
  37959. var s = lv + (t - T_BASE);
  37960. // Replace with a composed glyph if supported by the font,
  37961. // otherwise apply the proper OpenType features to each component.
  37962. if (font.hasGlyphForCodePoint(s)) {
  37963. var del = prevType === V ? 3 : 2;
  37964. glyphs.splice(i - del + 1, del, getGlyph(font, s, glyph.features));
  37965. return i - del + 1;
  37966. }
  37967. }
  37968. // Didn't compose (either a non-combining component or unsupported by font).
  37969. if (ljmo) {
  37970. ljmo.features.ljmo = true;
  37971. }
  37972. if (vjmo) {
  37973. vjmo.features.vjmo = true;
  37974. }
  37975. if (tjmo) {
  37976. tjmo.features.tjmo = true;
  37977. }
  37978. if (prevType === LV) {
  37979. // Sequence was originally <L,V>, which got combined earlier.
  37980. // Either the T was non-combining, or the LVT glyph wasn't supported.
  37981. // Decompose the glyph again and apply OT features.
  37982. decompose(glyphs, i - 1, font);
  37983. return i + 1;
  37984. }
  37985. return i;
  37986. }
  37987. function getLength(code) {
  37988. switch (getType(code)) {
  37989. case LV:
  37990. case LVT:
  37991. return 1;
  37992. case V:
  37993. return 2;
  37994. case T:
  37995. return 3;
  37996. }
  37997. }
  37998. function reorderToneMark(glyphs, i, font) {
  37999. var glyph = glyphs[i];
  38000. var code = glyphs[i].codePoints[0];
  38001. // Move tone mark to the beginning of the previous syllable, unless it is zero width
  38002. if (font.glyphForCodePoint(code).advanceWidth === 0) {
  38003. return;
  38004. }
  38005. var prev = glyphs[i - 1].codePoints[0];
  38006. var len = getLength(prev);
  38007. glyphs.splice(i, 1);
  38008. return glyphs.splice(i - len, 0, glyph);
  38009. }
  38010. function insertDottedCircle(glyphs, i, font) {
  38011. var glyph = glyphs[i];
  38012. var code = glyphs[i].codePoints[0];
  38013. if (font.hasGlyphForCodePoint(DOTTED_CIRCLE)) {
  38014. var dottedCircle = getGlyph(font, DOTTED_CIRCLE, glyph.features);
  38015. // If the tone mark is zero width, insert the dotted circle before, otherwise after
  38016. var idx = font.glyphForCodePoint(code).advanceWidth === 0 ? i : i + 1;
  38017. glyphs.splice(idx, 0, dottedCircle);
  38018. i++;
  38019. }
  38020. return i;
  38021. }
  38022. var stateTable = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 2, 3, 4, 5, 6, 7, 8, 9, 0, 10, 11, 11, 12, 13, 14, 15, 16, 17], [0, 0, 0, 18, 19, 20, 21, 22, 23, 0, 24, 0, 0, 25, 26, 0, 0, 27, 0], [0, 0, 0, 28, 29, 30, 31, 32, 33, 0, 34, 0, 0, 35, 36, 0, 0, 37, 0], [0, 0, 0, 38, 5, 7, 7, 8, 9, 0, 10, 0, 0, 0, 13, 0, 0, 16, 0], [0, 39, 0, 0, 0, 40, 41, 0, 9, 0, 10, 0, 0, 0, 42, 0, 39, 0, 0], [0, 0, 0, 0, 43, 44, 44, 8, 9, 0, 0, 0, 0, 12, 43, 0, 0, 0, 0], [0, 0, 0, 0, 43, 44, 44, 8, 9, 0, 0, 0, 0, 0, 43, 0, 0, 0, 0], [0, 0, 0, 45, 46, 47, 48, 49, 9, 0, 10, 0, 0, 0, 42, 0, 0, 0, 0], [0, 0, 0, 0, 0, 50, 0, 0, 51, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 52, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 53, 54, 55, 56, 57, 58, 0, 59, 0, 0, 60, 61, 0, 0, 62, 0], [0, 0, 0, 4, 5, 7, 7, 8, 9, 0, 10, 0, 0, 0, 13, 0, 0, 16, 0], [0, 63, 64, 0, 0, 40, 41, 0, 9, 0, 10, 0, 0, 0, 42, 0, 63, 0, 0], [0, 2, 3, 4, 5, 6, 7, 8, 9, 0, 10, 11, 11, 12, 13, 0, 2, 16, 0], [0, 0, 0, 18, 65, 20, 21, 22, 23, 0, 24, 0, 0, 25, 26, 0, 0, 27, 0], [0, 0, 0, 0, 66, 67, 67, 8, 9, 0, 10, 0, 0, 0, 68, 0, 0, 0, 0], [0, 0, 0, 69, 0, 70, 70, 0, 71, 0, 72, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 73, 19, 74, 74, 22, 23, 0, 24, 0, 0, 0, 26, 0, 0, 27, 0], [0, 75, 0, 0, 0, 76, 77, 0, 23, 0, 24, 0, 0, 0, 78, 0, 75, 0, 0], [0, 0, 0, 0, 79, 80, 80, 22, 23, 0, 0, 0, 0, 25, 79, 0, 0, 0, 0], [0, 0, 0, 18, 19, 20, 74, 22, 23, 0, 24, 0, 0, 25, 26, 0, 0, 27, 0], [0, 0, 0, 81, 82, 83, 84, 85, 23, 0, 24, 0, 0, 0, 78, 0, 0, 0, 0], [0, 0, 0, 0, 0, 86, 0, 0, 87, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 88, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 18, 19, 74, 74, 22, 23, 0, 24, 0, 0, 0, 26, 0, 0, 27, 0], [0, 89, 90, 0, 0, 76, 77, 0, 23, 0, 24, 0, 0, 0, 78, 0, 89, 0, 0], [0, 0, 0, 0, 91, 92, 92, 22, 23, 0, 24, 0, 0, 0, 93, 0, 0, 0, 0], [0, 0, 0, 94, 29, 95, 31, 32, 33, 0, 34, 0, 0, 0, 36, 0, 0, 37, 0], [0, 96, 0, 0, 0, 97, 98, 0, 33, 0, 34, 0, 0, 0, 99, 0, 96, 0, 0], [0, 0, 0, 0, 100, 101, 101, 32, 33, 0, 0, 0, 0, 35, 100, 0, 0, 0, 0], [0, 0, 0, 0, 100, 101, 101, 32, 33, 0, 0, 0, 0, 0, 100, 0, 0, 0, 0], [0, 0, 0, 102, 103, 104, 105, 106, 33, 0, 34, 0, 0, 0, 99, 0, 0, 0, 0], [0, 0, 0, 0, 0, 107, 0, 0, 108, 0, 34, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 109, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 28, 29, 95, 31, 32, 33, 0, 34, 0, 0, 0, 36, 0, 0, 37, 0], [0, 110, 111, 0, 0, 97, 98, 0, 33, 0, 34, 0, 0, 0, 99, 0, 110, 0, 0], [0, 0, 0, 0, 112, 113, 113, 32, 33, 0, 34, 0, 0, 0, 114, 0, 0, 0, 0], [0, 0, 0, 0, 5, 7, 7, 8, 9, 0, 10, 0, 0, 0, 13, 0, 0, 16, 0], [0, 0, 0, 115, 116, 117, 118, 8, 9, 0, 10, 0, 0, 119, 120, 0, 0, 16, 0], [0, 0, 0, 0, 0, 121, 121, 0, 9, 0, 10, 0, 0, 0, 42, 0, 0, 0, 0], [0, 39, 0, 122, 0, 123, 123, 8, 9, 0, 10, 0, 0, 0, 42, 0, 39, 0, 0], [0, 124, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 124, 0, 0], [0, 39, 0, 0, 0, 121, 125, 0, 9, 0, 10, 0, 0, 0, 42, 0, 39, 0, 0], [0, 0, 0, 0, 0, 126, 126, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 46, 47, 48, 49, 9, 0, 10, 0, 0, 0, 42, 0, 0, 0, 0], [0, 0, 0, 0, 0, 47, 47, 49, 9, 0, 10, 0, 0, 0, 42, 0, 0, 0, 0], [0, 0, 0, 0, 0, 127, 127, 49, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 128, 127, 127, 49, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 129, 130, 131, 132, 133, 9, 0, 10, 0, 0, 0, 42, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 50, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 135, 54, 56, 56, 57, 58, 0, 59, 0, 0, 0, 61, 0, 0, 62, 0], [0, 136, 0, 0, 0, 137, 138, 0, 58, 0, 59, 0, 0, 0, 139, 0, 136, 0, 0], [0, 0, 0, 0, 140, 141, 141, 57, 58, 0, 0, 0, 0, 60, 140, 0, 0, 0, 0], [0, 0, 0, 0, 140, 141, 141, 57, 58, 0, 0, 0, 0, 0, 140, 0, 0, 0, 0], [0, 0, 0, 142, 143, 144, 145, 146, 58, 0, 59, 0, 0, 0, 139, 0, 0, 0, 0], [0, 0, 0, 0, 0, 147, 0, 0, 148, 0, 59, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 149, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 53, 54, 56, 56, 57, 58, 0, 59, 0, 0, 0, 61, 0, 0, 62, 0], [0, 150, 151, 0, 0, 137, 138, 0, 58, 0, 59, 0, 0, 0, 139, 0, 150, 0, 0], [0, 0, 0, 0, 152, 153, 153, 57, 58, 0, 59, 0, 0, 0, 154, 0, 0, 0, 0], [0, 0, 0, 155, 116, 156, 157, 8, 9, 0, 10, 0, 0, 158, 120, 0, 0, 16, 0], [0, 0, 0, 0, 0, 121, 121, 0, 9, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0], [0, 75, 3, 4, 5, 159, 160, 8, 161, 0, 162, 0, 11, 12, 163, 0, 75, 16, 0], [0, 0, 0, 0, 0, 40, 164, 0, 9, 0, 10, 0, 0, 0, 42, 0, 0, 0, 0], [0, 0, 0, 0, 165, 44, 44, 8, 9, 0, 0, 0, 0, 0, 165, 0, 0, 0, 0], [0, 124, 64, 0, 0, 40, 164, 0, 9, 0, 10, 0, 0, 0, 42, 0, 124, 0, 0], [0, 0, 0, 0, 0, 70, 70, 0, 71, 0, 72, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 71, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 166, 0, 0, 167, 0, 72, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 168, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 19, 74, 74, 22, 23, 0, 24, 0, 0, 0, 26, 0, 0, 27, 0], [0, 0, 0, 0, 79, 80, 80, 22, 23, 0, 0, 0, 0, 0, 79, 0, 0, 0, 0], [0, 0, 0, 169, 170, 171, 172, 22, 23, 0, 24, 0, 0, 173, 174, 0, 0, 27, 0], [0, 0, 0, 0, 0, 175, 175, 0, 23, 0, 24, 0, 0, 0, 78, 0, 0, 0, 0], [0, 75, 0, 176, 0, 177, 177, 22, 23, 0, 24, 0, 0, 0, 78, 0, 75, 0, 0], [0, 178, 90, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 178, 0, 0], [0, 75, 0, 0, 0, 175, 179, 0, 23, 0, 24, 0, 0, 0, 78, 0, 75, 0, 0], [0, 0, 0, 0, 0, 180, 180, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 82, 83, 84, 85, 23, 0, 24, 0, 0, 0, 78, 0, 0, 0, 0], [0, 0, 0, 0, 0, 83, 83, 85, 23, 0, 24, 0, 0, 0, 78, 0, 0, 0, 0], [0, 0, 0, 0, 0, 181, 181, 85, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 182, 181, 181, 85, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 183, 184, 185, 186, 187, 23, 0, 24, 0, 0, 0, 78, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 86, 0, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 188, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 189, 170, 190, 191, 22, 23, 0, 24, 0, 0, 192, 174, 0, 0, 27, 0], [0, 0, 0, 0, 0, 175, 175, 0, 23, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 76, 193, 0, 23, 0, 24, 0, 0, 0, 78, 0, 0, 0, 0], [0, 0, 0, 0, 194, 80, 80, 22, 23, 0, 0, 0, 0, 0, 194, 0, 0, 0, 0], [0, 178, 90, 0, 0, 76, 193, 0, 23, 0, 24, 0, 0, 0, 78, 0, 178, 0, 0], [0, 0, 0, 0, 29, 95, 31, 32, 33, 0, 34, 0, 0, 0, 36, 0, 0, 37, 0], [0, 0, 0, 0, 100, 101, 101, 32, 33, 0, 0, 0, 0, 0, 100, 0, 0, 0, 0], [0, 0, 0, 195, 196, 197, 198, 32, 33, 0, 34, 0, 0, 199, 200, 0, 0, 37, 0], [0, 0, 0, 0, 0, 201, 201, 0, 33, 0, 34, 0, 0, 0, 99, 0, 0, 0, 0], [0, 96, 0, 202, 0, 203, 203, 32, 33, 0, 34, 0, 0, 0, 99, 0, 96, 0, 0], [0, 204, 111, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 204, 0, 0], [0, 96, 0, 0, 0, 201, 205, 0, 33, 0, 34, 0, 0, 0, 99, 0, 96, 0, 0], [0, 0, 0, 0, 0, 206, 206, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 103, 104, 105, 106, 33, 0, 34, 0, 0, 0, 99, 0, 0, 0, 0], [0, 0, 0, 0, 0, 104, 104, 106, 33, 0, 34, 0, 0, 0, 99, 0, 0, 0, 0], [0, 0, 0, 0, 0, 207, 207, 106, 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 208, 207, 207, 106, 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 209, 210, 211, 212, 213, 33, 0, 34, 0, 0, 0, 99, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 107, 0, 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 214, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 215, 196, 216, 217, 32, 33, 0, 34, 0, 0, 218, 200, 0, 0, 37, 0], [0, 0, 0, 0, 0, 201, 201, 0, 33, 0, 34, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 97, 219, 0, 33, 0, 34, 0, 0, 0, 99, 0, 0, 0, 0], [0, 0, 0, 0, 220, 101, 101, 32, 33, 0, 0, 0, 0, 0, 220, 0, 0, 0, 0], [0, 204, 111, 0, 0, 97, 219, 0, 33, 0, 34, 0, 0, 0, 99, 0, 204, 0, 0], [0, 0, 0, 221, 116, 222, 222, 8, 9, 0, 10, 0, 0, 0, 120, 0, 0, 16, 0], [0, 223, 0, 0, 0, 40, 224, 0, 9, 0, 10, 0, 0, 0, 42, 0, 223, 0, 0], [0, 0, 0, 0, 225, 44, 44, 8, 9, 0, 0, 0, 0, 119, 225, 0, 0, 0, 0], [0, 0, 0, 115, 116, 117, 222, 8, 9, 0, 10, 0, 0, 119, 120, 0, 0, 16, 0], [0, 0, 0, 115, 116, 222, 222, 8, 9, 0, 10, 0, 0, 0, 120, 0, 0, 16, 0], [0, 226, 64, 0, 0, 40, 224, 0, 9, 0, 10, 0, 0, 0, 42, 0, 226, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 39, 0, 0, 0, 121, 121, 0, 9, 0, 10, 0, 0, 0, 42, 0, 39, 0, 0], [0, 0, 0, 0, 0, 44, 44, 8, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 227, 0, 228, 229, 0, 9, 0, 10, 0, 0, 230, 0, 0, 0, 0, 0], [0, 39, 0, 122, 0, 121, 121, 0, 9, 0, 10, 0, 0, 0, 42, 0, 39, 0, 0], [0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 231, 231, 49, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 232, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 130, 131, 132, 133, 9, 0, 10, 0, 0, 0, 42, 0, 0, 0, 0], [0, 0, 0, 0, 0, 131, 131, 133, 9, 0, 10, 0, 0, 0, 42, 0, 0, 0, 0], [0, 0, 0, 0, 0, 233, 233, 133, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 234, 233, 233, 133, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 235, 236, 237, 238, 239, 9, 0, 10, 0, 0, 0, 42, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 54, 56, 56, 57, 58, 0, 59, 0, 0, 0, 61, 0, 0, 62, 0], [0, 0, 0, 240, 241, 242, 243, 57, 58, 0, 59, 0, 0, 244, 245, 0, 0, 62, 0], [0, 0, 0, 0, 0, 246, 246, 0, 58, 0, 59, 0, 0, 0, 139, 0, 0, 0, 0], [0, 136, 0, 247, 0, 248, 248, 57, 58, 0, 59, 0, 0, 0, 139, 0, 136, 0, 0], [0, 249, 151, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 249, 0, 0], [0, 136, 0, 0, 0, 246, 250, 0, 58, 0, 59, 0, 0, 0, 139, 0, 136, 0, 0], [0, 0, 0, 0, 0, 251, 251, 57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 143, 144, 145, 146, 58, 0, 59, 0, 0, 0, 139, 0, 0, 0, 0], [0, 0, 0, 0, 0, 144, 144, 146, 58, 0, 59, 0, 0, 0, 139, 0, 0, 0, 0], [0, 0, 0, 0, 0, 252, 252, 146, 58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 253, 252, 252, 146, 58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 254, 255, 256, 257, 258, 58, 0, 59, 0, 0, 0, 139, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 59, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 147, 0, 0, 0, 0, 59, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 259, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 260, 241, 261, 262, 57, 58, 0, 59, 0, 0, 263, 245, 0, 0, 62, 0], [0, 0, 0, 0, 0, 246, 246, 0, 58, 0, 59, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 137, 264, 0, 58, 0, 59, 0, 0, 0, 139, 0, 0, 0, 0], [0, 0, 0, 0, 265, 141, 141, 57, 58, 0, 0, 0, 0, 0, 265, 0, 0, 0, 0], [0, 249, 151, 0, 0, 137, 264, 0, 58, 0, 59, 0, 0, 0, 139, 0, 249, 0, 0], [0, 0, 0, 221, 116, 222, 222, 8, 9, 0, 10, 0, 0, 0, 120, 0, 0, 16, 0], [0, 0, 0, 0, 225, 44, 44, 8, 9, 0, 0, 0, 0, 158, 225, 0, 0, 0, 0], [0, 0, 0, 155, 116, 156, 222, 8, 9, 0, 10, 0, 0, 158, 120, 0, 0, 16, 0], [0, 0, 0, 155, 116, 222, 222, 8, 9, 0, 10, 0, 0, 0, 120, 0, 0, 16, 0], [0, 0, 0, 0, 43, 266, 266, 8, 161, 0, 24, 0, 0, 12, 267, 0, 0, 0, 0], [0, 75, 0, 176, 43, 268, 268, 269, 161, 0, 24, 0, 0, 0, 267, 0, 75, 0, 0], [0, 0, 0, 0, 0, 270, 0, 0, 271, 0, 162, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 272, 0, 0, 0, 0, 0, 0, 0, 0], [0, 273, 274, 0, 0, 40, 41, 0, 9, 0, 10, 0, 0, 0, 42, 0, 273, 0, 0], [0, 0, 0, 40, 0, 123, 123, 8, 9, 0, 10, 0, 0, 0, 42, 0, 0, 0, 0], [0, 0, 0, 0, 0, 121, 275, 0, 9, 0, 10, 0, 0, 0, 42, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 166, 0, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 276, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 277, 170, 278, 278, 22, 23, 0, 24, 0, 0, 0, 174, 0, 0, 27, 0], [0, 279, 0, 0, 0, 76, 280, 0, 23, 0, 24, 0, 0, 0, 78, 0, 279, 0, 0], [0, 0, 0, 0, 281, 80, 80, 22, 23, 0, 0, 0, 0, 173, 281, 0, 0, 0, 0], [0, 0, 0, 169, 170, 171, 278, 22, 23, 0, 24, 0, 0, 173, 174, 0, 0, 27, 0], [0, 0, 0, 169, 170, 278, 278, 22, 23, 0, 24, 0, 0, 0, 174, 0, 0, 27, 0], [0, 282, 90, 0, 0, 76, 280, 0, 23, 0, 24, 0, 0, 0, 78, 0, 282, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 75, 0, 0, 0, 175, 175, 0, 23, 0, 24, 0, 0, 0, 78, 0, 75, 0, 0], [0, 0, 0, 0, 0, 80, 80, 22, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 283, 0, 284, 285, 0, 23, 0, 24, 0, 0, 286, 0, 0, 0, 0, 0], [0, 75, 0, 176, 0, 175, 175, 0, 23, 0, 24, 0, 0, 0, 78, 0, 75, 0, 0], [0, 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 287, 287, 85, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 288, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 184, 185, 186, 187, 23, 0, 24, 0, 0, 0, 78, 0, 0, 0, 0], [0, 0, 0, 0, 0, 185, 185, 187, 23, 0, 24, 0, 0, 0, 78, 0, 0, 0, 0], [0, 0, 0, 0, 0, 289, 289, 187, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 290, 289, 289, 187, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 291, 292, 293, 294, 295, 23, 0, 24, 0, 0, 0, 78, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 277, 170, 278, 278, 22, 23, 0, 24, 0, 0, 0, 174, 0, 0, 27, 0], [0, 0, 0, 0, 281, 80, 80, 22, 23, 0, 0, 0, 0, 192, 281, 0, 0, 0, 0], [0, 0, 0, 189, 170, 190, 278, 22, 23, 0, 24, 0, 0, 192, 174, 0, 0, 27, 0], [0, 0, 0, 189, 170, 278, 278, 22, 23, 0, 24, 0, 0, 0, 174, 0, 0, 27, 0], [0, 0, 0, 76, 0, 177, 177, 22, 23, 0, 24, 0, 0, 0, 78, 0, 0, 0, 0], [0, 0, 0, 0, 0, 175, 296, 0, 23, 0, 24, 0, 0, 0, 78, 0, 0, 0, 0], [0, 0, 0, 297, 196, 298, 298, 32, 33, 0, 34, 0, 0, 0, 200, 0, 0, 37, 0], [0, 299, 0, 0, 0, 97, 300, 0, 33, 0, 34, 0, 0, 0, 99, 0, 299, 0, 0], [0, 0, 0, 0, 301, 101, 101, 32, 33, 0, 0, 0, 0, 199, 301, 0, 0, 0, 0], [0, 0, 0, 195, 196, 197, 298, 32, 33, 0, 34, 0, 0, 199, 200, 0, 0, 37, 0], [0, 0, 0, 195, 196, 298, 298, 32, 33, 0, 34, 0, 0, 0, 200, 0, 0, 37, 0], [0, 302, 111, 0, 0, 97, 300, 0, 33, 0, 34, 0, 0, 0, 99, 0, 302, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 96, 0, 0, 0, 201, 201, 0, 33, 0, 34, 0, 0, 0, 99, 0, 96, 0, 0], [0, 0, 0, 0, 0, 101, 101, 32, 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 303, 0, 304, 305, 0, 33, 0, 34, 0, 0, 306, 0, 0, 0, 0, 0], [0, 96, 0, 202, 0, 201, 201, 0, 33, 0, 34, 0, 0, 0, 99, 0, 96, 0, 0], [0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 307, 307, 106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 308, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 210, 211, 212, 213, 33, 0, 34, 0, 0, 0, 99, 0, 0, 0, 0], [0, 0, 0, 0, 0, 211, 211, 213, 33, 0, 34, 0, 0, 0, 99, 0, 0, 0, 0], [0, 0, 0, 0, 0, 309, 309, 213, 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 310, 309, 309, 213, 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 311, 312, 313, 314, 315, 33, 0, 34, 0, 0, 0, 99, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 297, 196, 298, 298, 32, 33, 0, 34, 0, 0, 0, 200, 0, 0, 37, 0], [0, 0, 0, 0, 301, 101, 101, 32, 33, 0, 0, 0, 0, 218, 301, 0, 0, 0, 0], [0, 0, 0, 215, 196, 216, 298, 32, 33, 0, 34, 0, 0, 218, 200, 0, 0, 37, 0], [0, 0, 0, 215, 196, 298, 298, 32, 33, 0, 34, 0, 0, 0, 200, 0, 0, 37, 0], [0, 0, 0, 97, 0, 203, 203, 32, 33, 0, 34, 0, 0, 0, 99, 0, 0, 0, 0], [0, 0, 0, 0, 0, 201, 316, 0, 33, 0, 34, 0, 0, 0, 99, 0, 0, 0, 0], [0, 0, 0, 0, 116, 222, 222, 8, 9, 0, 10, 0, 0, 0, 120, 0, 0, 16, 0], [0, 0, 0, 0, 225, 44, 44, 8, 9, 0, 0, 0, 0, 0, 225, 0, 0, 0, 0], [0, 0, 0, 317, 318, 319, 320, 8, 9, 0, 10, 0, 0, 321, 322, 0, 0, 16, 0], [0, 223, 0, 323, 0, 123, 123, 8, 9, 0, 10, 0, 0, 0, 42, 0, 223, 0, 0], [0, 223, 0, 0, 0, 121, 324, 0, 9, 0, 10, 0, 0, 0, 42, 0, 223, 0, 0], [0, 0, 0, 325, 318, 326, 327, 8, 9, 0, 10, 0, 0, 328, 322, 0, 0, 16, 0], [0, 0, 0, 64, 0, 121, 121, 0, 9, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 230, 0, 0, 0, 0, 0], [0, 0, 0, 227, 0, 228, 121, 0, 9, 0, 10, 0, 0, 230, 0, 0, 0, 0, 0], [0, 0, 0, 227, 0, 121, 121, 0, 9, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 49, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 46, 0, 0], [0, 0, 0, 0, 0, 329, 329, 133, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 330, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 236, 237, 238, 239, 9, 0, 10, 0, 0, 0, 42, 0, 0, 0, 0], [0, 0, 0, 0, 0, 237, 237, 239, 9, 0, 10, 0, 0, 0, 42, 0, 0, 0, 0], [0, 0, 0, 0, 0, 331, 331, 239, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 332, 331, 331, 239, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 333, 40, 121, 334, 0, 9, 0, 10, 0, 0, 0, 42, 0, 0, 0, 0], [0, 0, 0, 335, 241, 336, 336, 57, 58, 0, 59, 0, 0, 0, 245, 0, 0, 62, 0], [0, 337, 0, 0, 0, 137, 338, 0, 58, 0, 59, 0, 0, 0, 139, 0, 337, 0, 0], [0, 0, 0, 0, 339, 141, 141, 57, 58, 0, 0, 0, 0, 244, 339, 0, 0, 0, 0], [0, 0, 0, 240, 241, 242, 336, 57, 58, 0, 59, 0, 0, 244, 245, 0, 0, 62, 0], [0, 0, 0, 240, 241, 336, 336, 57, 58, 0, 59, 0, 0, 0, 245, 0, 0, 62, 0], [0, 340, 151, 0, 0, 137, 338, 0, 58, 0, 59, 0, 0, 0, 139, 0, 340, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 136, 0, 0, 0, 246, 246, 0, 58, 0, 59, 0, 0, 0, 139, 0, 136, 0, 0], [0, 0, 0, 0, 0, 141, 141, 57, 58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 341, 0, 342, 343, 0, 58, 0, 59, 0, 0, 344, 0, 0, 0, 0, 0], [0, 136, 0, 247, 0, 246, 246, 0, 58, 0, 59, 0, 0, 0, 139, 0, 136, 0, 0], [0, 0, 0, 0, 0, 0, 0, 57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 345, 345, 146, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 346, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 255, 256, 257, 258, 58, 0, 59, 0, 0, 0, 139, 0, 0, 0, 0], [0, 0, 0, 0, 0, 256, 256, 258, 58, 0, 59, 0, 0, 0, 139, 0, 0, 0, 0], [0, 0, 0, 0, 0, 347, 347, 258, 58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 348, 347, 347, 258, 58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 349, 350, 351, 352, 353, 58, 0, 59, 0, 0, 0, 139, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 335, 241, 336, 336, 57, 58, 0, 59, 0, 0, 0, 245, 0, 0, 62, 0], [0, 0, 0, 0, 339, 141, 141, 57, 58, 0, 0, 0, 0, 263, 339, 0, 0, 0, 0], [0, 0, 0, 260, 241, 261, 336, 57, 58, 0, 59, 0, 0, 263, 245, 0, 0, 62, 0], [0, 0, 0, 260, 241, 336, 336, 57, 58, 0, 59, 0, 0, 0, 245, 0, 0, 62, 0], [0, 0, 0, 137, 0, 248, 248, 57, 58, 0, 59, 0, 0, 0, 139, 0, 0, 0, 0], [0, 0, 0, 0, 0, 246, 354, 0, 58, 0, 59, 0, 0, 0, 139, 0, 0, 0, 0], [0, 0, 0, 0, 0, 126, 126, 8, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 355, 90, 0, 0, 121, 125, 0, 9, 0, 10, 0, 0, 0, 42, 0, 355, 0, 0], [0, 0, 0, 0, 0, 356, 356, 269, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 357, 358, 359, 360, 361, 161, 0, 162, 0, 0, 0, 362, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 162, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 270, 0, 0, 0, 0, 162, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 363, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 364, 116, 365, 366, 8, 161, 0, 162, 0, 0, 367, 120, 0, 0, 16, 0], [0, 0, 0, 0, 0, 368, 368, 0, 161, 0, 162, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 40, 0, 121, 121, 0, 9, 0, 10, 0, 0, 0, 42, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 170, 278, 278, 22, 23, 0, 24, 0, 0, 0, 174, 0, 0, 27, 0], [0, 0, 0, 0, 281, 80, 80, 22, 23, 0, 0, 0, 0, 0, 281, 0, 0, 0, 0], [0, 0, 0, 369, 370, 371, 372, 22, 23, 0, 24, 0, 0, 373, 374, 0, 0, 27, 0], [0, 279, 0, 375, 0, 177, 177, 22, 23, 0, 24, 0, 0, 0, 78, 0, 279, 0, 0], [0, 279, 0, 0, 0, 175, 376, 0, 23, 0, 24, 0, 0, 0, 78, 0, 279, 0, 0], [0, 0, 0, 377, 370, 378, 379, 22, 23, 0, 24, 0, 0, 380, 374, 0, 0, 27, 0], [0, 0, 0, 90, 0, 175, 175, 0, 23, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 23, 0, 0, 0, 0, 286, 0, 0, 0, 0, 0], [0, 0, 0, 283, 0, 284, 175, 0, 23, 0, 24, 0, 0, 286, 0, 0, 0, 0, 0], [0, 0, 0, 283, 0, 175, 175, 0, 23, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 85, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 0, 0], [0, 0, 0, 0, 0, 381, 381, 187, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 382, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 292, 293, 294, 295, 23, 0, 24, 0, 0, 0, 78, 0, 0, 0, 0], [0, 0, 0, 0, 0, 293, 293, 295, 23, 0, 24, 0, 0, 0, 78, 0, 0, 0, 0], [0, 0, 0, 0, 0, 383, 383, 295, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 384, 383, 383, 295, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 385, 76, 175, 386, 0, 23, 0, 24, 0, 0, 0, 78, 0, 0, 0, 0], [0, 0, 0, 76, 0, 175, 175, 0, 23, 0, 24, 0, 0, 0, 78, 0, 0, 0, 0], [0, 0, 0, 0, 196, 298, 298, 32, 33, 0, 34, 0, 0, 0, 200, 0, 0, 37, 0], [0, 0, 0, 0, 301, 101, 101, 32, 33, 0, 0, 0, 0, 0, 301, 0, 0, 0, 0], [0, 0, 0, 387, 388, 389, 390, 32, 33, 0, 34, 0, 0, 391, 392, 0, 0, 37, 0], [0, 299, 0, 393, 0, 203, 203, 32, 33, 0, 34, 0, 0, 0, 99, 0, 299, 0, 0], [0, 299, 0, 0, 0, 201, 394, 0, 33, 0, 34, 0, 0, 0, 99, 0, 299, 0, 0], [0, 0, 0, 395, 388, 396, 397, 32, 33, 0, 34, 0, 0, 398, 392, 0, 0, 37, 0], [0, 0, 0, 111, 0, 201, 201, 0, 33, 0, 34, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 33, 0, 0, 0, 0, 306, 0, 0, 0, 0, 0], [0, 0, 0, 303, 0, 304, 201, 0, 33, 0, 34, 0, 0, 306, 0, 0, 0, 0, 0], [0, 0, 0, 303, 0, 201, 201, 0, 33, 0, 34, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 103, 0, 0], [0, 0, 0, 0, 0, 399, 399, 213, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 400, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 312, 313, 314, 315, 33, 0, 34, 0, 0, 0, 99, 0, 0, 0, 0], [0, 0, 0, 0, 0, 313, 313, 315, 33, 0, 34, 0, 0, 0, 99, 0, 0, 0, 0], [0, 0, 0, 0, 0, 401, 401, 315, 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 402, 401, 401, 315, 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 403, 97, 201, 404, 0, 33, 0, 34, 0, 0, 0, 99, 0, 0, 0, 0], [0, 0, 0, 97, 0, 201, 201, 0, 33, 0, 34, 0, 0, 0, 99, 0, 0, 0, 0], [0, 0, 0, 405, 318, 406, 406, 8, 9, 0, 10, 0, 0, 0, 322, 0, 0, 16, 0], [0, 407, 0, 0, 0, 40, 408, 0, 9, 0, 10, 0, 0, 0, 42, 0, 407, 0, 0], [0, 0, 0, 0, 409, 44, 44, 8, 9, 0, 0, 0, 0, 321, 409, 0, 0, 0, 0], [0, 0, 0, 317, 318, 319, 406, 8, 9, 0, 10, 0, 0, 321, 322, 0, 0, 16, 0], [0, 0, 0, 317, 318, 406, 406, 8, 9, 0, 10, 0, 0, 0, 322, 0, 0, 16, 0], [0, 410, 64, 0, 0, 40, 408, 0, 9, 0, 10, 0, 0, 0, 42, 0, 410, 0, 0], [0, 223, 0, 0, 0, 121, 121, 0, 9, 0, 10, 0, 0, 0, 42, 0, 223, 0, 0], [0, 223, 0, 323, 0, 121, 121, 0, 9, 0, 10, 0, 0, 0, 42, 0, 223, 0, 0], [0, 0, 0, 405, 318, 406, 406, 8, 9, 0, 10, 0, 0, 0, 322, 0, 0, 16, 0], [0, 0, 0, 0, 409, 44, 44, 8, 9, 0, 0, 0, 0, 328, 409, 0, 0, 0, 0], [0, 0, 0, 325, 318, 326, 406, 8, 9, 0, 10, 0, 0, 328, 322, 0, 0, 16, 0], [0, 0, 0, 325, 318, 406, 406, 8, 9, 0, 10, 0, 0, 0, 322, 0, 0, 16, 0], [0, 0, 0, 0, 0, 0, 0, 133, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 130, 0, 0], [0, 0, 0, 0, 0, 411, 411, 239, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 412, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 40, 121, 334, 0, 9, 0, 10, 0, 0, 0, 42, 0, 0, 0, 0], [0, 0, 0, 0, 413, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 241, 336, 336, 57, 58, 0, 59, 0, 0, 0, 245, 0, 0, 62, 0], [0, 0, 0, 0, 339, 141, 141, 57, 58, 0, 0, 0, 0, 0, 339, 0, 0, 0, 0], [0, 0, 0, 414, 415, 416, 417, 57, 58, 0, 59, 0, 0, 418, 419, 0, 0, 62, 0], [0, 337, 0, 420, 0, 248, 248, 57, 58, 0, 59, 0, 0, 0, 139, 0, 337, 0, 0], [0, 337, 0, 0, 0, 246, 421, 0, 58, 0, 59, 0, 0, 0, 139, 0, 337, 0, 0], [0, 0, 0, 422, 415, 423, 424, 57, 58, 0, 59, 0, 0, 425, 419, 0, 0, 62, 0], [0, 0, 0, 151, 0, 246, 246, 0, 58, 0, 59, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 58, 0, 0, 0, 0, 344, 0, 0, 0, 0, 0], [0, 0, 0, 341, 0, 342, 246, 0, 58, 0, 59, 0, 0, 344, 0, 0, 0, 0, 0], [0, 0, 0, 341, 0, 246, 246, 0, 58, 0, 59, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 146, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 143, 0, 0], [0, 0, 0, 0, 0, 426, 426, 258, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 350, 351, 352, 353, 58, 0, 59, 0, 0, 0, 139, 0, 0, 0, 0], [0, 0, 0, 0, 0, 351, 351, 353, 58, 0, 59, 0, 0, 0, 139, 0, 0, 0, 0], [0, 0, 0, 0, 0, 428, 428, 353, 58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 429, 428, 428, 353, 58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 430, 137, 246, 431, 0, 58, 0, 59, 0, 0, 0, 139, 0, 0, 0, 0], [0, 0, 0, 137, 0, 246, 246, 0, 58, 0, 59, 0, 0, 0, 139, 0, 0, 0, 0], [0, 0, 0, 432, 116, 433, 434, 8, 161, 0, 162, 0, 0, 435, 120, 0, 0, 16, 0], [0, 0, 0, 0, 0, 180, 180, 269, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 358, 359, 360, 361, 161, 0, 162, 0, 0, 0, 362, 0, 0, 0, 0], [0, 0, 0, 0, 0, 359, 359, 361, 161, 0, 162, 0, 0, 0, 362, 0, 0, 0, 0], [0, 0, 0, 0, 0, 436, 436, 361, 161, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 437, 436, 436, 361, 161, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 438, 439, 440, 441, 442, 161, 0, 162, 0, 0, 0, 362, 0, 0, 0, 0], [0, 443, 274, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 443, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 444, 116, 445, 445, 8, 161, 0, 162, 0, 0, 0, 120, 0, 0, 16, 0], [0, 0, 0, 0, 225, 44, 44, 8, 161, 0, 0, 0, 0, 367, 225, 0, 0, 0, 0], [0, 0, 0, 364, 116, 365, 445, 8, 161, 0, 162, 0, 0, 367, 120, 0, 0, 16, 0], [0, 0, 0, 364, 116, 445, 445, 8, 161, 0, 162, 0, 0, 0, 120, 0, 0, 16, 0], [0, 0, 0, 0, 0, 0, 0, 0, 161, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 446, 370, 447, 447, 22, 23, 0, 24, 0, 0, 0, 374, 0, 0, 27, 0], [0, 448, 0, 0, 0, 76, 449, 0, 23, 0, 24, 0, 0, 0, 78, 0, 448, 0, 0], [0, 0, 0, 0, 450, 80, 80, 22, 23, 0, 0, 0, 0, 373, 450, 0, 0, 0, 0], [0, 0, 0, 369, 370, 371, 447, 22, 23, 0, 24, 0, 0, 373, 374, 0, 0, 27, 0], [0, 0, 0, 369, 370, 447, 447, 22, 23, 0, 24, 0, 0, 0, 374, 0, 0, 27, 0], [0, 451, 90, 0, 0, 76, 449, 0, 23, 0, 24, 0, 0, 0, 78, 0, 451, 0, 0], [0, 279, 0, 0, 0, 175, 175, 0, 23, 0, 24, 0, 0, 0, 78, 0, 279, 0, 0], [0, 279, 0, 375, 0, 175, 175, 0, 23, 0, 24, 0, 0, 0, 78, 0, 279, 0, 0], [0, 0, 0, 446, 370, 447, 447, 22, 23, 0, 24, 0, 0, 0, 374, 0, 0, 27, 0], [0, 0, 0, 0, 450, 80, 80, 22, 23, 0, 0, 0, 0, 380, 450, 0, 0, 0, 0], [0, 0, 0, 377, 370, 378, 447, 22, 23, 0, 24, 0, 0, 380, 374, 0, 0, 27, 0], [0, 0, 0, 377, 370, 447, 447, 22, 23, 0, 24, 0, 0, 0, 374, 0, 0, 27, 0], [0, 0, 0, 0, 0, 0, 0, 187, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 184, 0, 0], [0, 0, 0, 0, 0, 452, 452, 295, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 453, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 76, 175, 386, 0, 23, 0, 24, 0, 0, 0, 78, 0, 0, 0, 0], [0, 0, 0, 0, 454, 0, 0, 0, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 455, 388, 456, 456, 32, 33, 0, 34, 0, 0, 0, 392, 0, 0, 37, 0], [0, 457, 0, 0, 0, 97, 458, 0, 33, 0, 34, 0, 0, 0, 99, 0, 457, 0, 0], [0, 0, 0, 0, 459, 101, 101, 32, 33, 0, 0, 0, 0, 391, 459, 0, 0, 0, 0], [0, 0, 0, 387, 388, 389, 456, 32, 33, 0, 34, 0, 0, 391, 392, 0, 0, 37, 0], [0, 0, 0, 387, 388, 456, 456, 32, 33, 0, 34, 0, 0, 0, 392, 0, 0, 37, 0], [0, 460, 111, 0, 0, 97, 458, 0, 33, 0, 34, 0, 0, 0, 99, 0, 460, 0, 0], [0, 299, 0, 0, 0, 201, 201, 0, 33, 0, 34, 0, 0, 0, 99, 0, 299, 0, 0], [0, 299, 0, 393, 0, 201, 201, 0, 33, 0, 34, 0, 0, 0, 99, 0, 299, 0, 0], [0, 0, 0, 455, 388, 456, 456, 32, 33, 0, 34, 0, 0, 0, 392, 0, 0, 37, 0], [0, 0, 0, 0, 459, 101, 101, 32, 33, 0, 0, 0, 0, 398, 459, 0, 0, 0, 0], [0, 0, 0, 395, 388, 396, 456, 32, 33, 0, 34, 0, 0, 398, 392, 0, 0, 37, 0], [0, 0, 0, 395, 388, 456, 456, 32, 33, 0, 34, 0, 0, 0, 392, 0, 0, 37, 0], [0, 0, 0, 0, 0, 0, 0, 213, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 210, 0, 0], [0, 0, 0, 0, 0, 461, 461, 315, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 462, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 97, 201, 404, 0, 33, 0, 34, 0, 0, 0, 99, 0, 0, 0, 0], [0, 0, 0, 0, 463, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 318, 406, 406, 8, 9, 0, 10, 0, 0, 0, 322, 0, 0, 16, 0], [0, 0, 0, 0, 409, 44, 44, 8, 9, 0, 0, 0, 0, 0, 409, 0, 0, 0, 0], [0, 0, 0, 464, 465, 466, 467, 8, 9, 0, 10, 0, 0, 468, 469, 0, 0, 16, 0], [0, 407, 0, 470, 0, 123, 123, 8, 9, 0, 10, 0, 0, 0, 42, 0, 407, 0, 0], [0, 407, 0, 0, 0, 121, 471, 0, 9, 0, 10, 0, 0, 0, 42, 0, 407, 0, 0], [0, 0, 0, 472, 465, 473, 474, 8, 9, 0, 10, 0, 0, 475, 469, 0, 0, 16, 0], [0, 0, 0, 0, 0, 0, 0, 239, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 0, 0], [0, 0, 0, 0, 0, 0, 476, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 477, 415, 478, 478, 57, 58, 0, 59, 0, 0, 0, 419, 0, 0, 62, 0], [0, 479, 0, 0, 0, 137, 480, 0, 58, 0, 59, 0, 0, 0, 139, 0, 479, 0, 0], [0, 0, 0, 0, 481, 141, 141, 57, 58, 0, 0, 0, 0, 418, 481, 0, 0, 0, 0], [0, 0, 0, 414, 415, 416, 478, 57, 58, 0, 59, 0, 0, 418, 419, 0, 0, 62, 0], [0, 0, 0, 414, 415, 478, 478, 57, 58, 0, 59, 0, 0, 0, 419, 0, 0, 62, 0], [0, 482, 151, 0, 0, 137, 480, 0, 58, 0, 59, 0, 0, 0, 139, 0, 482, 0, 0], [0, 337, 0, 0, 0, 246, 246, 0, 58, 0, 59, 0, 0, 0, 139, 0, 337, 0, 0], [0, 337, 0, 420, 0, 246, 246, 0, 58, 0, 59, 0, 0, 0, 139, 0, 337, 0, 0], [0, 0, 0, 477, 415, 478, 478, 57, 58, 0, 59, 0, 0, 0, 419, 0, 0, 62, 0], [0, 0, 0, 0, 481, 141, 141, 57, 58, 0, 0, 0, 0, 425, 481, 0, 0, 0, 0], [0, 0, 0, 422, 415, 423, 478, 57, 58, 0, 59, 0, 0, 425, 419, 0, 0, 62, 0], [0, 0, 0, 422, 415, 478, 478, 57, 58, 0, 59, 0, 0, 0, 419, 0, 0, 62, 0], [0, 0, 0, 0, 0, 0, 0, 258, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 0, 0], [0, 0, 0, 0, 0, 483, 483, 353, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 484, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 137, 246, 431, 0, 58, 0, 59, 0, 0, 0, 139, 0, 0, 0, 0], [0, 0, 0, 0, 485, 0, 0, 0, 58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 444, 116, 445, 445, 8, 161, 0, 162, 0, 0, 0, 120, 0, 0, 16, 0], [0, 0, 0, 0, 225, 44, 44, 8, 161, 0, 0, 0, 0, 435, 225, 0, 0, 0, 0], [0, 0, 0, 432, 116, 433, 445, 8, 161, 0, 162, 0, 0, 435, 120, 0, 0, 16, 0], [0, 0, 0, 432, 116, 445, 445, 8, 161, 0, 162, 0, 0, 0, 120, 0, 0, 16, 0], [0, 0, 0, 0, 0, 486, 486, 361, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 487, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 439, 440, 441, 442, 161, 0, 162, 0, 0, 0, 362, 0, 0, 0, 0], [0, 0, 0, 0, 0, 440, 440, 442, 161, 0, 162, 0, 0, 0, 362, 0, 0, 0, 0], [0, 0, 0, 0, 0, 488, 488, 442, 161, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 489, 488, 488, 442, 161, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 490, 491, 492, 493, 494, 161, 0, 162, 0, 0, 0, 362, 0, 0, 0, 0], [0, 0, 0, 495, 0, 496, 497, 0, 161, 0, 162, 0, 0, 498, 0, 0, 0, 0, 0], [0, 0, 0, 0, 116, 445, 445, 8, 161, 0, 162, 0, 0, 0, 120, 0, 0, 16, 0], [0, 0, 0, 0, 225, 44, 44, 8, 161, 0, 0, 0, 0, 0, 225, 0, 0, 0, 0], [0, 0, 0, 0, 370, 447, 447, 22, 23, 0, 24, 0, 0, 0, 374, 0, 0, 27, 0], [0, 0, 0, 0, 450, 80, 80, 22, 23, 0, 0, 0, 0, 0, 450, 0, 0, 0, 0], [0, 0, 0, 499, 500, 501, 502, 22, 23, 0, 24, 0, 0, 503, 504, 0, 0, 27, 0], [0, 448, 0, 505, 0, 177, 177, 22, 23, 0, 24, 0, 0, 0, 78, 0, 448, 0, 0], [0, 448, 0, 0, 0, 175, 506, 0, 23, 0, 24, 0, 0, 0, 78, 0, 448, 0, 0], [0, 0, 0, 507, 500, 508, 509, 22, 23, 0, 24, 0, 0, 510, 504, 0, 0, 27, 0], [0, 0, 0, 0, 0, 0, 0, 295, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 292, 0, 0], [0, 0, 0, 0, 0, 0, 511, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 388, 456, 456, 32, 33, 0, 34, 0, 0, 0, 392, 0, 0, 37, 0], [0, 0, 0, 0, 459, 101, 101, 32, 33, 0, 0, 0, 0, 0, 459, 0, 0, 0, 0], [0, 0, 0, 512, 513, 514, 515, 32, 33, 0, 34, 0, 0, 516, 517, 0, 0, 37, 0], [0, 457, 0, 518, 0, 203, 203, 32, 33, 0, 34, 0, 0, 0, 99, 0, 457, 0, 0], [0, 457, 0, 0, 0, 201, 519, 0, 33, 0, 34, 0, 0, 0, 99, 0, 457, 0, 0], [0, 0, 0, 520, 513, 521, 522, 32, 33, 0, 34, 0, 0, 523, 517, 0, 0, 37, 0], [0, 0, 0, 0, 0, 0, 0, 315, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 312, 0, 0], [0, 0, 0, 0, 0, 0, 524, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 525, 465, 526, 526, 8, 9, 0, 10, 0, 0, 0, 469, 0, 0, 16, 0], [0, 527, 0, 0, 0, 40, 528, 0, 9, 0, 10, 0, 0, 0, 42, 0, 527, 0, 0], [0, 0, 0, 0, 529, 44, 44, 8, 9, 0, 0, 0, 0, 468, 529, 0, 0, 0, 0], [0, 0, 0, 464, 465, 466, 526, 8, 9, 0, 10, 0, 0, 468, 469, 0, 0, 16, 0], [0, 0, 0, 464, 465, 526, 526, 8, 9, 0, 10, 0, 0, 0, 469, 0, 0, 16, 0], [0, 530, 64, 0, 0, 40, 528, 0, 9, 0, 10, 0, 0, 0, 42, 0, 530, 0, 0], [0, 407, 0, 0, 0, 121, 121, 0, 9, 0, 10, 0, 0, 0, 42, 0, 407, 0, 0], [0, 407, 0, 470, 0, 121, 121, 0, 9, 0, 10, 0, 0, 0, 42, 0, 407, 0, 0], [0, 0, 0, 525, 465, 526, 526, 8, 9, 0, 10, 0, 0, 0, 469, 0, 0, 16, 0], [0, 0, 0, 0, 529, 44, 44, 8, 9, 0, 0, 0, 0, 475, 529, 0, 0, 0, 0], [0, 0, 0, 472, 465, 473, 526, 8, 9, 0, 10, 0, 0, 475, 469, 0, 0, 16, 0], [0, 0, 0, 472, 465, 526, 526, 8, 9, 0, 10, 0, 0, 0, 469, 0, 0, 16, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 0, 0], [0, 0, 0, 0, 415, 478, 478, 57, 58, 0, 59, 0, 0, 0, 419, 0, 0, 62, 0], [0, 0, 0, 0, 481, 141, 141, 57, 58, 0, 0, 0, 0, 0, 481, 0, 0, 0, 0], [0, 0, 0, 531, 532, 533, 534, 57, 58, 0, 59, 0, 0, 535, 536, 0, 0, 62, 0], [0, 479, 0, 537, 0, 248, 248, 57, 58, 0, 59, 0, 0, 0, 139, 0, 479, 0, 0], [0, 479, 0, 0, 0, 246, 538, 0, 58, 0, 59, 0, 0, 0, 139, 0, 479, 0, 0], [0, 0, 0, 539, 532, 540, 541, 57, 58, 0, 59, 0, 0, 542, 536, 0, 0, 62, 0], [0, 0, 0, 0, 0, 0, 0, 353, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 350, 0, 0], [0, 0, 0, 0, 0, 0, 543, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 361, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 358, 0, 0], [0, 0, 0, 0, 0, 544, 544, 442, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 545, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 491, 492, 493, 494, 161, 0, 162, 0, 0, 0, 362, 0, 0, 0, 0], [0, 0, 0, 0, 0, 492, 492, 494, 161, 0, 162, 0, 0, 0, 362, 0, 0, 0, 0], [0, 0, 0, 0, 0, 546, 546, 494, 161, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 547, 546, 546, 494, 161, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 548, 549, 368, 550, 0, 161, 0, 162, 0, 0, 0, 362, 0, 0, 0, 0], [0, 0, 0, 274, 0, 368, 368, 0, 161, 0, 162, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 161, 0, 0, 0, 0, 498, 0, 0, 0, 0, 0], [0, 0, 0, 495, 0, 496, 368, 0, 161, 0, 162, 0, 0, 498, 0, 0, 0, 0, 0], [0, 0, 0, 495, 0, 368, 368, 0, 161, 0, 162, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 551, 500, 552, 552, 22, 23, 0, 24, 0, 0, 0, 504, 0, 0, 27, 0], [0, 553, 0, 0, 0, 76, 554, 0, 23, 0, 24, 0, 0, 0, 78, 0, 553, 0, 0], [0, 0, 0, 0, 555, 80, 80, 22, 23, 0, 0, 0, 0, 503, 555, 0, 0, 0, 0], [0, 0, 0, 499, 500, 501, 552, 22, 23, 0, 24, 0, 0, 503, 504, 0, 0, 27, 0], [0, 0, 0, 499, 500, 552, 552, 22, 23, 0, 24, 0, 0, 0, 504, 0, 0, 27, 0], [0, 556, 90, 0, 0, 76, 554, 0, 23, 0, 24, 0, 0, 0, 78, 0, 556, 0, 0], [0, 448, 0, 0, 0, 175, 175, 0, 23, 0, 24, 0, 0, 0, 78, 0, 448, 0, 0], [0, 448, 0, 505, 0, 175, 175, 0, 23, 0, 24, 0, 0, 0, 78, 0, 448, 0, 0], [0, 0, 0, 551, 500, 552, 552, 22, 23, 0, 24, 0, 0, 0, 504, 0, 0, 27, 0], [0, 0, 0, 0, 555, 80, 80, 22, 23, 0, 0, 0, 0, 510, 555, 0, 0, 0, 0], [0, 0, 0, 507, 500, 508, 552, 22, 23, 0, 24, 0, 0, 510, 504, 0, 0, 27, 0], [0, 0, 0, 507, 500, 552, 552, 22, 23, 0, 24, 0, 0, 0, 504, 0, 0, 27, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 0, 0], [0, 0, 0, 557, 513, 558, 558, 32, 33, 0, 34, 0, 0, 0, 517, 0, 0, 37, 0], [0, 559, 0, 0, 0, 97, 560, 0, 33, 0, 34, 0, 0, 0, 99, 0, 559, 0, 0], [0, 0, 0, 0, 561, 101, 101, 32, 33, 0, 0, 0, 0, 516, 561, 0, 0, 0, 0], [0, 0, 0, 512, 513, 514, 558, 32, 33, 0, 34, 0, 0, 516, 517, 0, 0, 37, 0], [0, 0, 0, 512, 513, 558, 558, 32, 33, 0, 34, 0, 0, 0, 517, 0, 0, 37, 0], [0, 562, 111, 0, 0, 97, 560, 0, 33, 0, 34, 0, 0, 0, 99, 0, 562, 0, 0], [0, 457, 0, 0, 0, 201, 201, 0, 33, 0, 34, 0, 0, 0, 99, 0, 457, 0, 0], [0, 457, 0, 518, 0, 201, 201, 0, 33, 0, 34, 0, 0, 0, 99, 0, 457, 0, 0], [0, 0, 0, 557, 513, 558, 558, 32, 33, 0, 34, 0, 0, 0, 517, 0, 0, 37, 0], [0, 0, 0, 0, 561, 101, 101, 32, 33, 0, 0, 0, 0, 523, 561, 0, 0, 0, 0], [0, 0, 0, 520, 513, 521, 558, 32, 33, 0, 34, 0, 0, 523, 517, 0, 0, 37, 0], [0, 0, 0, 520, 513, 558, 558, 32, 33, 0, 34, 0, 0, 0, 517, 0, 0, 37, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 97, 0, 0], [0, 0, 0, 0, 465, 526, 526, 8, 9, 0, 10, 0, 0, 0, 469, 0, 0, 16, 0], [0, 0, 0, 0, 529, 44, 44, 8, 9, 0, 0, 0, 0, 0, 529, 0, 0, 0, 0], [0, 0, 0, 563, 66, 564, 565, 8, 9, 0, 10, 0, 0, 566, 68, 0, 0, 16, 0], [0, 527, 0, 567, 0, 123, 123, 8, 9, 0, 10, 0, 0, 0, 42, 0, 527, 0, 0], [0, 527, 0, 0, 0, 121, 568, 0, 9, 0, 10, 0, 0, 0, 42, 0, 527, 0, 0], [0, 0, 0, 569, 66, 570, 571, 8, 9, 0, 10, 0, 0, 572, 68, 0, 0, 16, 0], [0, 0, 0, 573, 532, 574, 574, 57, 58, 0, 59, 0, 0, 0, 536, 0, 0, 62, 0], [0, 575, 0, 0, 0, 137, 576, 0, 58, 0, 59, 0, 0, 0, 139, 0, 575, 0, 0], [0, 0, 0, 0, 577, 141, 141, 57, 58, 0, 0, 0, 0, 535, 577, 0, 0, 0, 0], [0, 0, 0, 531, 532, 533, 574, 57, 58, 0, 59, 0, 0, 535, 536, 0, 0, 62, 0], [0, 0, 0, 531, 532, 574, 574, 57, 58, 0, 59, 0, 0, 0, 536, 0, 0, 62, 0], [0, 578, 151, 0, 0, 137, 576, 0, 58, 0, 59, 0, 0, 0, 139, 0, 578, 0, 0], [0, 479, 0, 0, 0, 246, 246, 0, 58, 0, 59, 0, 0, 0, 139, 0, 479, 0, 0], [0, 479, 0, 537, 0, 246, 246, 0, 58, 0, 59, 0, 0, 0, 139, 0, 479, 0, 0], [0, 0, 0, 573, 532, 574, 574, 57, 58, 0, 59, 0, 0, 0, 536, 0, 0, 62, 0], [0, 0, 0, 0, 577, 141, 141, 57, 58, 0, 0, 0, 0, 542, 577, 0, 0, 0, 0], [0, 0, 0, 539, 532, 540, 574, 57, 58, 0, 59, 0, 0, 542, 536, 0, 0, 62, 0], [0, 0, 0, 539, 532, 574, 574, 57, 58, 0, 59, 0, 0, 0, 536, 0, 0, 62, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 137, 0, 0], [0, 0, 0, 0, 0, 0, 0, 442, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 439, 0, 0], [0, 0, 0, 0, 0, 579, 579, 494, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 580, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 549, 368, 550, 0, 161, 0, 162, 0, 0, 0, 362, 0, 0, 0, 0], [0, 0, 0, 0, 0, 368, 368, 0, 161, 0, 162, 0, 0, 0, 362, 0, 0, 0, 0], [0, 0, 0, 0, 581, 0, 0, 0, 161, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 500, 552, 552, 22, 23, 0, 24, 0, 0, 0, 504, 0, 0, 27, 0], [0, 0, 0, 0, 555, 80, 80, 22, 23, 0, 0, 0, 0, 0, 555, 0, 0, 0, 0], [0, 0, 0, 582, 91, 583, 584, 22, 23, 0, 24, 0, 0, 585, 93, 0, 0, 27, 0], [0, 553, 0, 586, 0, 177, 177, 22, 23, 0, 24, 0, 0, 0, 78, 0, 553, 0, 0], [0, 553, 0, 0, 0, 175, 587, 0, 23, 0, 24, 0, 0, 0, 78, 0, 553, 0, 0], [0, 0, 0, 588, 91, 589, 590, 22, 23, 0, 24, 0, 0, 591, 93, 0, 0, 27, 0], [0, 0, 0, 0, 513, 558, 558, 32, 33, 0, 34, 0, 0, 0, 517, 0, 0, 37, 0], [0, 0, 0, 0, 561, 101, 101, 32, 33, 0, 0, 0, 0, 0, 561, 0, 0, 0, 0], [0, 0, 0, 592, 112, 593, 594, 32, 33, 0, 34, 0, 0, 595, 114, 0, 0, 37, 0], [0, 559, 0, 596, 0, 203, 203, 32, 33, 0, 34, 0, 0, 0, 99, 0, 559, 0, 0], [0, 559, 0, 0, 0, 201, 597, 0, 33, 0, 34, 0, 0, 0, 99, 0, 559, 0, 0], [0, 0, 0, 598, 112, 599, 600, 32, 33, 0, 34, 0, 0, 601, 114, 0, 0, 37, 0], [0, 0, 0, 602, 66, 67, 67, 8, 9, 0, 10, 0, 0, 0, 68, 0, 0, 16, 0], [0, 0, 0, 0, 165, 44, 44, 8, 9, 0, 0, 0, 0, 566, 165, 0, 0, 0, 0], [0, 0, 0, 563, 66, 564, 67, 8, 9, 0, 10, 0, 0, 566, 68, 0, 0, 16, 0], [0, 0, 0, 563, 66, 67, 67, 8, 9, 0, 10, 0, 0, 0, 68, 0, 0, 16, 0], [0, 527, 0, 0, 0, 121, 121, 0, 9, 0, 10, 0, 0, 0, 42, 0, 527, 0, 0], [0, 527, 0, 567, 0, 121, 121, 0, 9, 0, 10, 0, 0, 0, 42, 0, 527, 0, 0], [0, 0, 0, 602, 66, 67, 67, 8, 9, 0, 10, 0, 0, 0, 68, 0, 0, 16, 0], [0, 0, 0, 0, 165, 44, 44, 8, 9, 0, 0, 0, 0, 572, 165, 0, 0, 0, 0], [0, 0, 0, 569, 66, 570, 67, 8, 9, 0, 10, 0, 0, 572, 68, 0, 0, 16, 0], [0, 0, 0, 569, 66, 67, 67, 8, 9, 0, 10, 0, 0, 0, 68, 0, 0, 16, 0], [0, 0, 0, 0, 532, 574, 574, 57, 58, 0, 59, 0, 0, 0, 536, 0, 0, 62, 0], [0, 0, 0, 0, 577, 141, 141, 57, 58, 0, 0, 0, 0, 0, 577, 0, 0, 0, 0], [0, 0, 0, 603, 152, 604, 605, 57, 58, 0, 59, 0, 0, 606, 154, 0, 0, 62, 0], [0, 575, 0, 607, 0, 248, 248, 57, 58, 0, 59, 0, 0, 0, 139, 0, 575, 0, 0], [0, 575, 0, 0, 0, 246, 608, 0, 58, 0, 59, 0, 0, 0, 139, 0, 575, 0, 0], [0, 0, 0, 609, 152, 610, 611, 57, 58, 0, 59, 0, 0, 612, 154, 0, 0, 62, 0], [0, 0, 0, 0, 0, 0, 0, 494, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 491, 0, 0], [0, 0, 0, 0, 0, 0, 613, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 614, 91, 92, 92, 22, 23, 0, 24, 0, 0, 0, 93, 0, 0, 27, 0], [0, 0, 0, 0, 194, 80, 80, 22, 23, 0, 0, 0, 0, 585, 194, 0, 0, 0, 0], [0, 0, 0, 582, 91, 583, 92, 22, 23, 0, 24, 0, 0, 585, 93, 0, 0, 27, 0], [0, 0, 0, 582, 91, 92, 92, 22, 23, 0, 24, 0, 0, 0, 93, 0, 0, 27, 0], [0, 553, 0, 0, 0, 175, 175, 0, 23, 0, 24, 0, 0, 0, 78, 0, 553, 0, 0], [0, 553, 0, 586, 0, 175, 175, 0, 23, 0, 24, 0, 0, 0, 78, 0, 553, 0, 0], [0, 0, 0, 614, 91, 92, 92, 22, 23, 0, 24, 0, 0, 0, 93, 0, 0, 27, 0], [0, 0, 0, 0, 194, 80, 80, 22, 23, 0, 0, 0, 0, 591, 194, 0, 0, 0, 0], [0, 0, 0, 588, 91, 589, 92, 22, 23, 0, 24, 0, 0, 591, 93, 0, 0, 27, 0], [0, 0, 0, 588, 91, 92, 92, 22, 23, 0, 24, 0, 0, 0, 93, 0, 0, 27, 0], [0, 0, 0, 615, 112, 113, 113, 32, 33, 0, 34, 0, 0, 0, 114, 0, 0, 37, 0], [0, 0, 0, 0, 220, 101, 101, 32, 33, 0, 0, 0, 0, 595, 220, 0, 0, 0, 0], [0, 0, 0, 592, 112, 593, 113, 32, 33, 0, 34, 0, 0, 595, 114, 0, 0, 37, 0], [0, 0, 0, 592, 112, 113, 113, 32, 33, 0, 34, 0, 0, 0, 114, 0, 0, 37, 0], [0, 559, 0, 0, 0, 201, 201, 0, 33, 0, 34, 0, 0, 0, 99, 0, 559, 0, 0], [0, 559, 0, 596, 0, 201, 201, 0, 33, 0, 34, 0, 0, 0, 99, 0, 559, 0, 0], [0, 0, 0, 615, 112, 113, 113, 32, 33, 0, 34, 0, 0, 0, 114, 0, 0, 37, 0], [0, 0, 0, 0, 220, 101, 101, 32, 33, 0, 0, 0, 0, 601, 220, 0, 0, 0, 0], [0, 0, 0, 598, 112, 599, 113, 32, 33, 0, 34, 0, 0, 601, 114, 0, 0, 37, 0], [0, 0, 0, 598, 112, 113, 113, 32, 33, 0, 34, 0, 0, 0, 114, 0, 0, 37, 0], [0, 0, 0, 0, 66, 67, 67, 8, 9, 0, 10, 0, 0, 0, 68, 0, 0, 16, 0], [0, 0, 0, 616, 152, 153, 153, 57, 58, 0, 59, 0, 0, 0, 154, 0, 0, 62, 0], [0, 0, 0, 0, 265, 141, 141, 57, 58, 0, 0, 0, 0, 606, 265, 0, 0, 0, 0], [0, 0, 0, 603, 152, 604, 153, 57, 58, 0, 59, 0, 0, 606, 154, 0, 0, 62, 0], [0, 0, 0, 603, 152, 153, 153, 57, 58, 0, 59, 0, 0, 0, 154, 0, 0, 62, 0], [0, 575, 0, 0, 0, 246, 246, 0, 58, 0, 59, 0, 0, 0, 139, 0, 575, 0, 0], [0, 575, 0, 607, 0, 246, 246, 0, 58, 0, 59, 0, 0, 0, 139, 0, 575, 0, 0], [0, 0, 0, 616, 152, 153, 153, 57, 58, 0, 59, 0, 0, 0, 154, 0, 0, 62, 0], [0, 0, 0, 0, 265, 141, 141, 57, 58, 0, 0, 0, 0, 612, 265, 0, 0, 0, 0], [0, 0, 0, 609, 152, 610, 153, 57, 58, 0, 59, 0, 0, 612, 154, 0, 0, 62, 0], [0, 0, 0, 609, 152, 153, 153, 57, 58, 0, 59, 0, 0, 0, 154, 0, 0, 62, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 549, 0, 0], [0, 0, 0, 0, 91, 92, 92, 22, 23, 0, 24, 0, 0, 0, 93, 0, 0, 27, 0], [0, 0, 0, 0, 112, 113, 113, 32, 33, 0, 34, 0, 0, 0, 114, 0, 0, 37, 0], [0, 0, 0, 0, 152, 153, 153, 57, 58, 0, 59, 0, 0, 0, 154, 0, 0, 62, 0]];
  38023. var accepting = [false, true, true, true, true, true, false, false, true, true, true, true, true, true, true, true, true, true, true, true, false, true, true, true, true, true, true, true, true, true, false, true, true, true, true, true, true, true, true, true, true, true, false, true, false, true, true, false, false, true, true, true, true, true, true, false, false, true, true, true, true, true, true, true, true, true, true, false, true, true, false, true, true, true, false, true, true, true, false, true, false, true, true, false, false, true, true, true, true, true, true, true, false, true, true, false, true, true, true, false, true, false, true, true, false, false, true, true, true, true, true, true, true, false, true, true, true, false, true, true, true, false, true, false, true, true, false, false, false, true, true, false, false, true, true, true, true, true, true, false, true, false, true, true, false, false, true, true, true, true, true, true, true, false, true, true, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false, true, true, true, false, true, false, true, true, false, false, false, true, true, false, false, true, true, true, false, true, true, true, true, true, true, false, true, true, true, false, true, false, true, true, false, false, false, true, true, false, false, true, true, true, false, true, true, true, true, true, false, true, true, true, true, true, false, true, true, false, false, false, false, true, true, false, false, true, true, true, false, true, true, true, false, true, false, true, true, false, false, false, true, true, false, false, true, true, true, false, true, true, true, true, false, true, false, true, true, true, true, true, true, true, true, true, false, true, true, true, true, true, false, true, true, false, false, false, false, true, true, false, false, true, true, true, false, true, true, true, true, true, false, true, true, false, false, false, false, true, true, false, false, true, true, true, true, false, true, true, true, true, true, true, false, true, true, false, false, false, false, true, false, true, false, true, true, true, true, true, false, true, true, false, false, false, false, true, true, false, false, true, true, true, false, true, true, false, false, true, false, true, true, false, true, true, false, true, true, false, true, true, true, true, true, true, false, true, true, false, false, false, false, true, false, true, true, false, true, true, true, true, true, true, false, true, true, false, false, false, false, true, false, true, false, true, true, true, true, false, false, false, true, true, false, true, true, true, true, true, true, false, true, true, false, false, false, false, true, false, true, false, true, true, false, false, true, true, false, false, true, true, true, false, true, false, true, true, true, true, false, false, false, true, false, true, true, true, true, false, false, false, true, true, false, true, true, true, true, true, true, false, true, true, false, true, false, true, true, true, true, false, false, false, false, false, false, false, true, true, false, false, true, true, false, true, true, true, true, false, true, true, true, true, true, true, false, true, true, false, true, true, false, true, true, true, true, true, true, false, true, true, false, true, false, true, true, true, true, true, true, false, true, true, true, true, true, true, false, true, true, false, false, false, false, false, true, true, false, true, false, true, true, true, true, true, false, true, true, true, true, true, false, true, true, true, true, true, false, true, true, true, false, true, true, true, true, false, false, false, true, false, true, true, true, true, true, false, true, true, true, false, true, true, true, true, true, false, true, true, true, true, false, true, true, true, true, true, false, true, true, false, true, true, true];
  38024. var tags = [[], ["broken_cluster"], ["consonant_syllable"], ["vowel_syllable"], ["broken_cluster"], ["broken_cluster"], [], [], ["broken_cluster"], ["broken_cluster"], ["broken_cluster"], ["standalone_cluster"], ["broken_cluster"], ["broken_cluster"], ["broken_cluster"], ["consonant_syllable"], ["broken_cluster"], ["symbol_cluster"], ["consonant_syllable"], ["consonant_syllable"], [], ["consonant_syllable"], ["consonant_syllable"], ["consonant_syllable"], ["consonant_syllable"], ["consonant_syllable"], ["consonant_syllable"], ["consonant_syllable"], ["vowel_syllable"], ["vowel_syllable"], [], ["vowel_syllable"], ["vowel_syllable"], ["vowel_syllable"], ["vowel_syllable"], ["vowel_syllable"], ["vowel_syllable"], ["vowel_syllable"], ["broken_cluster"], ["broken_cluster"], ["broken_cluster"], ["broken_cluster"], [], ["broken_cluster"], [], ["broken_cluster"], ["broken_cluster"], [], [], ["broken_cluster"], ["broken_cluster"], ["broken_cluster"], ["broken_cluster"], ["standalone_cluster"], ["standalone_cluster"], [], [], ["standalone_cluster"], ["standalone_cluster"], ["standalone_cluster"], ["standalone_cluster"], ["standalone_cluster"], ["standalone_cluster"], ["broken_cluster"], ["broken_cluster"], ["consonant_syllable", "broken_cluster"], ["broken_cluster"], [], ["broken_cluster"], ["symbol_cluster"], [], ["symbol_cluster"], ["symbol_cluster"], ["consonant_syllable"], [], ["consonant_syllable"], ["consonant_syllable"], ["consonant_syllable"], [], ["consonant_syllable"], [], ["consonant_syllable"], ["consonant_syllable"], [], [], ["consonant_syllable"], ["consonant_syllable"], ["consonant_syllable"], ["consonant_syllable"], ["consonant_syllable"], ["consonant_syllable"], ["consonant_syllable"], [], ["consonant_syllable"], ["vowel_syllable"], [], ["vowel_syllable"], ["vowel_syllable"], ["vowel_syllable"], [], ["vowel_syllable"], [], ["vowel_syllable"], ["vowel_syllable"], [], [], ["vowel_syllable"], ["vowel_syllable"], ["vowel_syllable"], ["vowel_syllable"], ["vowel_syllable"], ["vowel_syllable"], ["vowel_syllable"], [], ["vowel_syllable"], ["broken_cluster"], ["broken_cluster"], [], ["broken_cluster"], ["broken_cluster"], ["broken_cluster"], [], ["broken_cluster"], [], ["broken_cluster"], ["broken_cluster"], [], [], [], ["broken_cluster"], ["broken_cluster"], [], [], ["broken_cluster"], ["broken_cluster"], ["standalone_cluster"], ["standalone_cluster"], ["standalone_cluster"], ["standalone_cluster"], [], ["standalone_cluster"], [], ["standalone_cluster"], ["standalone_cluster"], [], [], ["standalone_cluster"], ["standalone_cluster"], ["standalone_cluster"], ["standalone_cluster"], ["standalone_cluster"], ["standalone_cluster"], ["standalone_cluster"], [], ["standalone_cluster"], ["broken_cluster"], [], ["broken_cluster"], ["broken_cluster"], ["consonant_syllable"], ["consonant_syllable"], ["consonant_syllable", "broken_cluster"], ["consonant_syllable", "broken_cluster"], ["broken_cluster"], ["broken_cluster"], ["broken_cluster"], ["symbol_cluster"], ["symbol_cluster"], ["symbol_cluster"], ["consonant_syllable"], ["consonant_syllable"], [], ["consonant_syllable"], ["consonant_syllable"], ["consonant_syllable"], [], ["consonant_syllable"], [], ["consonant_syllable"], ["consonant_syllable"], [], [], [], ["consonant_syllable"], ["consonant_syllable"], [], [], ["consonant_syllable"], ["consonant_syllable"], ["consonant_syllable"], [], ["consonant_syllable"], ["consonant_syllable"], ["consonant_syllable"], ["consonant_syllable"], ["vowel_syllable"], ["vowel_syllable"], [], ["vowel_syllable"], ["vowel_syllable"], ["vowel_syllable"], [], ["vowel_syllable"], [], ["vowel_syllable"], ["vowel_syllable"], [], [], [], ["vowel_syllable"], ["vowel_syllable"], [], [], ["vowel_syllable"], ["vowel_syllable"], ["vowel_syllable"], [], ["vowel_syllable"], ["vowel_syllable"], ["vowel_syllable"], ["vowel_syllable"], ["broken_cluster"], [], ["broken_cluster"], ["broken_cluster"], ["broken_cluster"], ["broken_cluster"], ["broken_cluster"], [], ["broken_cluster"], ["broken_cluster"], [], [], [], [], ["broken_cluster"], ["broken_cluster"], [], [], ["broken_cluster"], ["standalone_cluster"], ["standalone_cluster"], [], ["standalone_cluster"], ["standalone_cluster"], ["standalone_cluster"], [], ["standalone_cluster"], [], ["standalone_cluster"], ["standalone_cluster"], [], [], [], ["standalone_cluster"], ["standalone_cluster"], [], [], ["standalone_cluster"], ["standalone_cluster"], ["standalone_cluster"], [], ["standalone_cluster"], ["standalone_cluster"], ["standalone_cluster"], ["standalone_cluster"], [], ["broken_cluster"], [], ["consonant_syllable", "broken_cluster"], ["consonant_syllable", "broken_cluster"], ["consonant_syllable", "broken_cluster"], ["consonant_syllable", "broken_cluster"], ["consonant_syllable", "broken_cluster"], ["consonant_syllable", "broken_cluster"], ["broken_cluster"], ["symbol_cluster"], ["consonant_syllable"], [], ["consonant_syllable"], ["consonant_syllable"], ["consonant_syllable"], ["consonant_syllable"], ["consonant_syllable"], [], ["consonant_syllable"], ["consonant_syllable"], [], [], [], [], ["consonant_syllable"], ["consonant_syllable"], [], [], ["consonant_syllable"], ["consonant_syllable"], ["vowel_syllable"], [], ["vowel_syllable"], ["vowel_syllable"], ["vowel_syllable"], ["vowel_syllable"], ["vowel_syllable"], [], ["vowel_syllable"], ["vowel_syllable"], [], [], [], [], ["vowel_syllable"], ["vowel_syllable"], [], [], ["vowel_syllable"], ["vowel_syllable"], ["broken_cluster"], ["broken_cluster"], [], ["broken_cluster"], ["broken_cluster"], ["broken_cluster"], ["broken_cluster"], ["broken_cluster"], ["broken_cluster"], [], ["broken_cluster"], ["broken_cluster"], [], [], [], [], ["broken_cluster"], [], ["standalone_cluster"], [], ["standalone_cluster"], ["standalone_cluster"], ["standalone_cluster"], ["standalone_cluster"], ["standalone_cluster"], [], ["standalone_cluster"], ["standalone_cluster"], [], [], [], [], ["standalone_cluster"], ["standalone_cluster"], [], [], ["standalone_cluster"], ["standalone_cluster"], ["consonant_syllable", "broken_cluster"], [], ["consonant_syllable", "broken_cluster"], ["consonant_syllable", "broken_cluster"], [], [], ["consonant_syllable", "broken_cluster"], [], ["consonant_syllable", "broken_cluster"], ["consonant_syllable", "broken_cluster"], [], ["consonant_syllable", "broken_cluster"], ["consonant_syllable", "broken_cluster"], [], ["consonant_syllable"], ["consonant_syllable"], [], ["consonant_syllable"], ["consonant_syllable"], ["consonant_syllable"], ["consonant_syllable"], ["consonant_syllable"], ["consonant_syllable"], [], ["consonant_syllable"], ["consonant_syllable"], [], [], [], [], ["consonant_syllable"], [], ["vowel_syllable"], ["vowel_syllable"], [], ["vowel_syllable"], ["vowel_syllable"], ["vowel_syllable"], ["vowel_syllable"], ["vowel_syllable"], ["vowel_syllable"], [], ["vowel_syllable"], ["vowel_syllable"], [], [], [], [], ["vowel_syllable"], [], ["broken_cluster"], [], ["broken_cluster"], ["broken_cluster"], ["broken_cluster"], ["broken_cluster"], [], [], [], ["standalone_cluster"], ["standalone_cluster"], [], ["standalone_cluster"], ["standalone_cluster"], ["standalone_cluster"], ["standalone_cluster"], ["standalone_cluster"], ["standalone_cluster"], [], ["standalone_cluster"], ["standalone_cluster"], [], [], [], [], ["standalone_cluster"], [], ["consonant_syllable", "broken_cluster"], [], ["consonant_syllable", "broken_cluster"], ["consonant_syllable", "broken_cluster"], [], [], ["consonant_syllable", "broken_cluster"], ["consonant_syllable", "broken_cluster"], [], [], ["consonant_syllable", "broken_cluster"], ["consonant_syllable", "broken_cluster"], ["consonant_syllable", "broken_cluster"], [], ["consonant_syllable"], [], ["consonant_syllable"], ["consonant_syllable"], ["consonant_syllable"], ["consonant_syllable"], [], [], [], ["vowel_syllable"], [], ["vowel_syllable"], ["vowel_syllable"], ["vowel_syllable"], ["vowel_syllable"], [], [], [], ["broken_cluster"], ["broken_cluster"], [], ["broken_cluster"], ["broken_cluster"], ["broken_cluster"], ["broken_cluster"], ["broken_cluster"], ["broken_cluster"], [], ["broken_cluster"], ["broken_cluster"], [], ["standalone_cluster"], [], ["standalone_cluster"], ["standalone_cluster"], ["standalone_cluster"], ["standalone_cluster"], [], [], [], [], [], [], [], ["consonant_syllable", "broken_cluster"], ["consonant_syllable", "broken_cluster"], [], [], ["consonant_syllable", "broken_cluster"], ["consonant_syllable", "broken_cluster"], [], ["consonant_syllable", "broken_cluster"], ["consonant_syllable", "broken_cluster"], ["consonant_syllable"], ["consonant_syllable"], [], ["consonant_syllable"], ["consonant_syllable"], ["consonant_syllable"], ["consonant_syllable"], ["consonant_syllable"], ["consonant_syllable"], [], ["consonant_syllable"], ["consonant_syllable"], [], ["vowel_syllable"], ["vowel_syllable"], [], ["vowel_syllable"], ["vowel_syllable"], ["vowel_syllable"], ["vowel_syllable"], ["vowel_syllable"], ["vowel_syllable"], [], ["vowel_syllable"], ["vowel_syllable"], [], ["broken_cluster"], [], ["broken_cluster"], ["broken_cluster"], ["broken_cluster"], ["broken_cluster"], ["standalone_cluster"], ["standalone_cluster"], [], ["standalone_cluster"], ["standalone_cluster"], ["standalone_cluster"], ["standalone_cluster"], ["standalone_cluster"], ["standalone_cluster"], [], ["standalone_cluster"], ["standalone_cluster"], [], [], [], [], [], ["consonant_syllable", "broken_cluster"], ["consonant_syllable", "broken_cluster"], [], ["consonant_syllable"], [], ["consonant_syllable"], ["consonant_syllable"], ["consonant_syllable"], ["consonant_syllable"], ["vowel_syllable"], [], ["vowel_syllable"], ["vowel_syllable"], ["vowel_syllable"], ["vowel_syllable"], ["broken_cluster"], [], ["broken_cluster"], ["broken_cluster"], ["broken_cluster"], ["broken_cluster"], ["broken_cluster"], [], ["broken_cluster"], ["broken_cluster"], ["standalone_cluster"], [], ["standalone_cluster"], ["standalone_cluster"], ["standalone_cluster"], ["standalone_cluster"], [], [], [], ["consonant_syllable"], [], ["consonant_syllable"], ["consonant_syllable"], ["consonant_syllable"], ["consonant_syllable"], ["consonant_syllable"], [], ["consonant_syllable"], ["consonant_syllable"], ["vowel_syllable"], [], ["vowel_syllable"], ["vowel_syllable"], ["vowel_syllable"], ["vowel_syllable"], ["vowel_syllable"], [], ["vowel_syllable"], ["vowel_syllable"], ["broken_cluster"], ["standalone_cluster"], [], ["standalone_cluster"], ["standalone_cluster"], ["standalone_cluster"], ["standalone_cluster"], ["standalone_cluster"], [], ["standalone_cluster"], ["standalone_cluster"], [], ["consonant_syllable"], ["vowel_syllable"], ["standalone_cluster"]];
  38025. var indicMachine = {
  38026. stateTable: stateTable,
  38027. accepting: accepting,
  38028. tags: tags
  38029. };
  38030. var categories = ["O", "IND", "S", "GB", "B", "FM", "CGJ", "VMAbv", "VMPst", "VAbv", "VPst", "CMBlw", "VPre", "VBlw", "H", "VMBlw", "CMAbv", "MBlw", "CS", "R", "SUB", "MPst", "MPre", "FAbv", "FPst", "FBlw", "SMAbv", "SMBlw", "VMPre", "ZWNJ", "ZWJ", "WJ", "VS", "N", "HN", "MAbv"];
  38031. var decompositions$1 = { "2507": [2503, 2494], "2508": [2503, 2519], "2888": [2887, 2902], "2891": [2887, 2878], "2892": [2887, 2903], "3018": [3014, 3006], "3019": [3015, 3006], "3020": [3014, 3031], "3144": [3142, 3158], "3264": [3263, 3285], "3271": [3270, 3285], "3272": [3270, 3286], "3274": [3270, 3266], "3275": [3270, 3266, 3285], "3402": [3398, 3390], "3403": [3399, 3390], "3404": [3398, 3415], "3546": [3545, 3530], "3548": [3545, 3535], "3549": [3545, 3535, 3530], "3550": [3545, 3551], "3635": [3661, 3634], "3763": [3789, 3762], "3955": [3953, 3954], "3957": [3953, 3956], "3958": [4018, 3968], "3959": [4018, 3953, 3968], "3960": [4019, 3968], "3961": [4019, 3953, 3968], "3969": [3953, 3968], "6971": [6970, 6965], "6973": [6972, 6965], "6976": [6974, 6965], "6977": [6975, 6965], "6979": [6978, 6965], "69934": [69937, 69927], "69935": [69938, 69927], "70475": [70471, 70462], "70476": [70471, 70487], "70843": [70841, 70842], "70844": [70841, 70832], "70846": [70841, 70845], "71098": [71096, 71087], "71099": [71097, 71087] };
  38032. var stateTable$1 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [2, 2, 3, 4, 4, 5, 0, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 0, 17, 18, 11, 19, 20, 21, 22, 0, 0, 23, 0, 0, 2, 0, 24, 0, 25], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 28, 0, 0, 0, 0, 27, 0, 0, 0], [0, 0, 0, 0, 0, 29, 0, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 0, 0, 41, 35, 42, 43, 44, 45, 0, 0, 46, 0, 0, 0, 39, 0, 0, 47], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 5, 0, 6, 7, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 20, 21, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 5, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 21, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 5, 0, 6, 7, 8, 9, 0, 0, 12, 0, 14, 0, 0, 0, 0, 0, 0, 0, 20, 21, 22, 0, 0, 23, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 5, 0, 6, 7, 0, 9, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 20, 21, 22, 0, 0, 23, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 5, 0, 6, 7, 8, 9, 10, 11, 12, 13, 14, 0, 16, 0, 0, 18, 11, 19, 20, 21, 22, 0, 0, 23, 0, 0, 0, 0, 0, 0, 25], [0, 0, 0, 0, 0, 5, 0, 6, 7, 8, 9, 0, 11, 12, 0, 14, 0, 0, 0, 0, 0, 0, 0, 20, 21, 22, 0, 0, 23, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 5, 0, 6, 7, 0, 9, 0, 0, 12, 0, 14, 0, 0, 0, 0, 0, 0, 0, 20, 21, 22, 0, 0, 23, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 5, 0, 0, 7, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 20, 21, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 5, 0, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 0, 0, 18, 11, 19, 20, 21, 22, 0, 0, 23, 0, 0, 0, 0, 0, 0, 25], [0, 0, 0, 0, 0, 5, 0, 6, 7, 8, 9, 0, 11, 12, 0, 14, 0, 0, 0, 0, 0, 11, 0, 20, 21, 22, 0, 0, 23, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 4, 4, 5, 0, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 0, 0, 18, 11, 19, 20, 21, 22, 0, 0, 23, 0, 0, 0, 0, 0, 0, 25], [0, 0, 0, 0, 0, 5, 0, 6, 7, 8, 9, 48, 11, 12, 13, 14, 48, 16, 0, 0, 18, 11, 19, 20, 21, 22, 0, 0, 23, 0, 0, 0, 49, 0, 0, 25], [0, 0, 0, 0, 0, 5, 0, 6, 7, 8, 9, 0, 11, 12, 0, 14, 0, 16, 0, 0, 0, 11, 0, 20, 21, 22, 0, 0, 23, 0, 0, 0, 0, 0, 0, 25], [0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 21, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 5, 0, 6, 7, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 20, 21, 22, 0, 0, 23, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 0, 51, 0], [0, 0, 0, 0, 0, 5, 0, 6, 7, 8, 9, 0, 11, 12, 0, 14, 0, 16, 0, 0, 0, 11, 0, 20, 21, 22, 0, 0, 23, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 28, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 29, 0, 30, 31, 0, 0, 0, 0, 0, 0, 38, 0, 0, 0, 0, 0, 0, 0, 43, 44, 45, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 29, 0, 0, 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 43, 44, 45, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 29, 0, 30, 31, 32, 33, 0, 0, 36, 0, 38, 0, 0, 0, 0, 0, 0, 0, 43, 44, 45, 0, 0, 46, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 29, 0, 30, 31, 0, 33, 0, 0, 0, 0, 38, 0, 0, 0, 0, 0, 0, 0, 43, 44, 45, 0, 0, 46, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 29, 0, 30, 31, 32, 33, 34, 35, 36, 37, 38, 0, 40, 0, 0, 41, 35, 42, 43, 44, 45, 0, 0, 46, 0, 0, 0, 0, 0, 0, 47], [0, 0, 0, 0, 0, 29, 0, 30, 31, 32, 33, 0, 35, 36, 0, 38, 0, 0, 0, 0, 0, 0, 0, 43, 44, 45, 0, 0, 46, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 29, 0, 30, 31, 0, 33, 0, 0, 36, 0, 38, 0, 0, 0, 0, 0, 0, 0, 43, 44, 45, 0, 0, 46, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 29, 0, 0, 31, 0, 0, 0, 0, 0, 0, 38, 0, 0, 0, 0, 0, 0, 0, 43, 44, 45, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 29, 0, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 0, 0, 41, 35, 42, 43, 44, 45, 0, 0, 46, 0, 0, 0, 0, 0, 0, 47], [0, 0, 0, 0, 0, 29, 0, 30, 31, 32, 33, 0, 35, 36, 0, 38, 0, 0, 0, 0, 0, 35, 0, 43, 44, 45, 0, 0, 46, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 29, 0, 30, 31, 32, 33, 52, 35, 36, 37, 38, 52, 40, 0, 0, 41, 35, 42, 43, 44, 45, 0, 0, 46, 0, 0, 0, 53, 0, 0, 47], [0, 0, 0, 0, 0, 29, 0, 30, 31, 32, 33, 0, 35, 36, 0, 38, 0, 40, 0, 0, 0, 35, 0, 43, 44, 45, 0, 0, 46, 0, 0, 0, 0, 0, 0, 47], [0, 0, 0, 0, 0, 29, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 43, 44, 45, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 29, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 44, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 29, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 44, 45, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 29, 0, 30, 31, 0, 0, 0, 0, 0, 0, 38, 0, 0, 0, 0, 0, 0, 0, 43, 44, 45, 0, 0, 46, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 29, 0, 30, 31, 32, 33, 0, 35, 36, 0, 38, 0, 40, 0, 0, 0, 35, 0, 43, 44, 45, 0, 0, 46, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 5, 0, 6, 7, 8, 9, 48, 11, 12, 13, 14, 0, 16, 0, 0, 18, 11, 19, 20, 21, 22, 0, 0, 23, 0, 0, 0, 0, 0, 0, 25], [0, 0, 0, 0, 0, 5, 0, 6, 7, 8, 9, 48, 11, 12, 13, 14, 48, 16, 0, 0, 18, 11, 19, 20, 21, 22, 0, 0, 23, 0, 0, 0, 0, 0, 0, 25], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 51, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0], [0, 0, 0, 0, 0, 29, 0, 30, 31, 32, 33, 52, 35, 36, 37, 38, 0, 40, 0, 0, 41, 35, 42, 43, 44, 45, 0, 0, 46, 0, 0, 0, 0, 0, 0, 47], [0, 0, 0, 0, 0, 29, 0, 30, 31, 32, 33, 52, 35, 36, 37, 38, 52, 40, 0, 0, 41, 35, 42, 43, 44, 45, 0, 0, 46, 0, 0, 0, 0, 0, 0, 47], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 0, 51, 0]];
  38033. var accepting$1 = [false, true, true, true, true, true, true, true, true, true, true, true, true, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true];
  38034. var tags$1 = [[], ["broken_cluster"], ["independent_cluster"], ["symbol_cluster"], ["standard_cluster"], ["broken_cluster"], ["broken_cluster"], ["broken_cluster"], ["broken_cluster"], ["broken_cluster"], ["broken_cluster"], ["broken_cluster"], ["broken_cluster"], [], ["broken_cluster"], ["broken_cluster"], ["broken_cluster"], ["broken_cluster"], ["broken_cluster"], ["broken_cluster"], ["broken_cluster"], ["broken_cluster"], ["broken_cluster"], ["broken_cluster"], ["numeral_cluster"], ["broken_cluster"], ["independent_cluster"], ["symbol_cluster"], ["symbol_cluster"], ["standard_cluster"], ["standard_cluster"], ["standard_cluster"], ["standard_cluster"], ["standard_cluster"], ["standard_cluster"], ["standard_cluster"], ["standard_cluster"], ["virama_terminated_cluster"], ["standard_cluster"], ["standard_cluster"], ["standard_cluster"], ["standard_cluster"], ["standard_cluster"], ["standard_cluster"], ["standard_cluster"], ["standard_cluster"], ["standard_cluster"], ["standard_cluster"], ["broken_cluster"], ["broken_cluster"], ["numeral_cluster"], ["number_joiner_terminated_cluster"], ["standard_cluster"], ["standard_cluster"], ["numeral_cluster"]];
  38035. var useData = {
  38036. categories: categories,
  38037. decompositions: decompositions$1,
  38038. stateTable: stateTable$1,
  38039. accepting: accepting$1,
  38040. tags: tags$1
  38041. };
  38042. // Cateories used in the OpenType spec:
  38043. // https://www.microsoft.com/typography/otfntdev/devanot/shaping.aspx
  38044. var CATEGORIES = {
  38045. X: 1 << 0,
  38046. C: 1 << 1,
  38047. V: 1 << 2,
  38048. N: 1 << 3,
  38049. H: 1 << 4,
  38050. ZWNJ: 1 << 5,
  38051. ZWJ: 1 << 6,
  38052. M: 1 << 7,
  38053. SM: 1 << 8,
  38054. VD: 1 << 9,
  38055. A: 1 << 10,
  38056. Placeholder: 1 << 11,
  38057. Dotted_Circle: 1 << 12,
  38058. RS: 1 << 13, // Register Shifter, used in Khmer OT spec.
  38059. Coeng: 1 << 14, // Khmer-style Virama.
  38060. Repha: 1 << 15, // Atomically-encoded logical or visual repha.
  38061. Ra: 1 << 16,
  38062. CM: 1 << 17, // Consonant-Medial.
  38063. Symbol: 1 << 18 // Avagraha, etc that take marks (SM,A,VD).
  38064. };
  38065. // Visual positions in a syllable from left to right.
  38066. var POSITIONS = {
  38067. Start: 1 << 0,
  38068. Ra_To_Become_Reph: 1 << 1,
  38069. Pre_M: 1 << 2,
  38070. Pre_C: 1 << 3,
  38071. Base_C: 1 << 4,
  38072. After_Main: 1 << 5,
  38073. Above_C: 1 << 6,
  38074. Before_Sub: 1 << 7,
  38075. Below_C: 1 << 8,
  38076. After_Sub: 1 << 9,
  38077. Before_Post: 1 << 10,
  38078. Post_C: 1 << 11,
  38079. After_Post: 1 << 12,
  38080. Final_C: 1 << 13,
  38081. SMVD: 1 << 14,
  38082. End: 1 << 15
  38083. };
  38084. var CONSONANT_FLAGS = CATEGORIES.C | CATEGORIES.Ra | CATEGORIES.CM | CATEGORIES.V | CATEGORIES.Placeholder | CATEGORIES.Dotted_Circle;
  38085. var JOINER_FLAGS = CATEGORIES.ZWJ | CATEGORIES.ZWNJ;
  38086. var HALANT_OR_COENG_FLAGS = CATEGORIES.H | CATEGORIES.Coeng;
  38087. var INDIC_CONFIGS = {
  38088. Default: {
  38089. hasOldSpec: false,
  38090. virama: 0,
  38091. basePos: 'Last',
  38092. rephPos: POSITIONS.Before_Post,
  38093. rephMode: 'Implicit',
  38094. blwfMode: 'Pre_And_Post'
  38095. },
  38096. Devanagari: {
  38097. hasOldSpec: true,
  38098. virama: 0x094D,
  38099. basePos: 'Last',
  38100. rephPos: POSITIONS.Before_Post,
  38101. rephMode: 'Implicit',
  38102. blwfMode: 'Pre_And_Post'
  38103. },
  38104. Bengali: {
  38105. hasOldSpec: true,
  38106. virama: 0x09CD,
  38107. basePos: 'Last',
  38108. rephPos: POSITIONS.After_Sub,
  38109. rephMode: 'Implicit',
  38110. blwfMode: 'Pre_And_Post'
  38111. },
  38112. Gurmukhi: {
  38113. hasOldSpec: true,
  38114. virama: 0x0A4D,
  38115. basePos: 'Last',
  38116. rephPos: POSITIONS.Before_Sub,
  38117. rephMode: 'Implicit',
  38118. blwfMode: 'Pre_And_Post'
  38119. },
  38120. Gujarati: {
  38121. hasOldSpec: true,
  38122. virama: 0x0ACD,
  38123. basePos: 'Last',
  38124. rephPos: POSITIONS.Before_Post,
  38125. rephMode: 'Implicit',
  38126. blwfMode: 'Pre_And_Post'
  38127. },
  38128. Oriya: {
  38129. hasOldSpec: true,
  38130. virama: 0x0B4D,
  38131. basePos: 'Last',
  38132. rephPos: POSITIONS.After_Main,
  38133. rephMode: 'Implicit',
  38134. blwfMode: 'Pre_And_Post'
  38135. },
  38136. Tamil: {
  38137. hasOldSpec: true,
  38138. virama: 0x0BCD,
  38139. basePos: 'Last',
  38140. rephPos: POSITIONS.After_Post,
  38141. rephMode: 'Implicit',
  38142. blwfMode: 'Pre_And_Post'
  38143. },
  38144. Telugu: {
  38145. hasOldSpec: true,
  38146. virama: 0x0C4D,
  38147. basePos: 'Last',
  38148. rephPos: POSITIONS.After_Post,
  38149. rephMode: 'Explicit',
  38150. blwfMode: 'Post_Only'
  38151. },
  38152. Kannada: {
  38153. hasOldSpec: true,
  38154. virama: 0x0CCD,
  38155. basePos: 'Last',
  38156. rephPos: POSITIONS.After_Post,
  38157. rephMode: 'Implicit',
  38158. blwfMode: 'Post_Only'
  38159. },
  38160. Malayalam: {
  38161. hasOldSpec: true,
  38162. virama: 0x0D4D,
  38163. basePos: 'Last',
  38164. rephPos: POSITIONS.After_Main,
  38165. rephMode: 'Log_Repha',
  38166. blwfMode: 'Pre_And_Post'
  38167. },
  38168. // Handled by UniversalShaper
  38169. // Sinhala: {
  38170. // hasOldSpec: false,
  38171. // virama: 0x0DCA,
  38172. // basePos: 'Last_Sinhala',
  38173. // rephPos: POSITIONS.After_Main,
  38174. // rephMode: 'Explicit',
  38175. // blwfMode: 'Pre_And_Post'
  38176. // },
  38177. Khmer: {
  38178. hasOldSpec: false,
  38179. virama: 0x17D2,
  38180. basePos: 'First',
  38181. rephPos: POSITIONS.Ra_To_Become_Reph,
  38182. rephMode: 'Vis_Repha',
  38183. blwfMode: 'Pre_And_Post'
  38184. }
  38185. };
  38186. // Additional decompositions that aren't in Unicode
  38187. var INDIC_DECOMPOSITIONS = {
  38188. // Khmer
  38189. 0x17BE: [0x17C1, 0x17BE],
  38190. 0x17BF: [0x17C1, 0x17BF],
  38191. 0x17C0: [0x17C1, 0x17C0],
  38192. 0x17C4: [0x17C1, 0x17C4],
  38193. 0x17C5: [0x17C1, 0x17C5]
  38194. };
  38195. var _class$6;
  38196. var _temp$2;
  38197. var decompositions = useData.decompositions;
  38198. var trie$1 = new UnicodeTrie(Buffer("ABEAAAAAAAAAAMKgAbENTvLtnX+sHUUVx/f13nd/vHf7bl+FRGL7R0OJMcWYphBrimkVCSJR2xiEaLEGQ7AkBGowbYRSgj8K2B/GkpRYE6wlQSyJKCagrSlGkmqsqUZMY7S2CWkgqQViQSkt4Hfuzrx77tyZ2fm1u+/RPcknuzs7O3PmnDOzs7N73zteS5KXwKvgDTCnniTvBfPBJeAVpP2vFr69GGUtAkvAModyr0DeT4BrwCpwPVgDbga3ga+DjYbyluLcCvBN8F2wGWwHO8Ej4DjyPIbtz0DCeZpvD4CD4E/gb+AoOAFOgtPgLKiNJkkbTIKLwALwfvAh8GGwHFwFPg2uAzeCm8Ft4E5wN7gPPAi+D34AfgR+Ap7kx8+AZ8HvwZ/BEXAMvAheAa+Bc6OpzvVGknTABY30eB62C8GlYDFYCpaDq/n5z2J7PVgDbgG3N1KbrOdbWzby/N/G9i6wlR8/wLebUNcOll7vX7PLsQ4bdpAy92B/L3gK7AO/A38EfwX/AC+AkyT/m3x7mqdtYz7Gfq2ZJOPgPc3UXu/D9uJmmmcRT1uC7TJwZTONJxFL1+J4JbgBrAG3gNv5Nev5dhO2m3l54rqtON7RNLd1V8Z5auMfI+8Wbvv12P4Ux78AvyZl/Bb7fwD34HwH/EVR/t8t6rRlrYgFlHnMsdyXIupRFP+Gzv8Bb4CklSSjrTR9bz21uZx/Nj8v+uIFOJ4HFnJo3kWtNG6WkPSzBl1YbC8jeVfx+q+R9Pg48lxN8jFdhd8+01LrLTCdq6io8GNb1a8qKioqKioqKioc2cbXGcrWQ2Ynf9a9rmV/zVua9Dc16V/gz8pfxvar4A6wAdwL7gdbwUPgh+BR8AR4qpWuLe3D9gA4CA6DI+AoOAFOtdL1nNexfYs937fxDA8ubKf1zmv3dViI/Uvb9m2sqKioqAiHrVtehrH3TK2/3l4WZduioqIiDq+Rd1Jbef9ehnHmSnCtNNf7nOPcr8PHilO8jrfBF9v996lfwf6tUpl3tPvvdSjsvcwGnLt3Gsw/kzkpK8CdYH83my3Id0iT91WkL5xMktXgIfD85OD54zjfmYu5OFgN7h1LkmdBMg5fgbvAChzv49ujfEuZ3xlOk7kReTaSfL/B/jl+fMXsJLkb7AcPj8TlHC/zsgnYcyLd3zSh1vGAJr2ioqKiIn/eKXkMjn3/cWF5t/z6y37+K5urwP2YB36vPfw8yr7zeRjpu8g8cTf2H2+n89EtivLE93fs27Ez/Br2vM2+qWPl/ZyX9StFfQxW5v724PPxzXz7XHu4Pps5Jvtmiq13szmzfP0hlHkYHGn358bHeD0vYvsy+K+kz9vt/jy8gT40G1w4Rua0PN98nnaGf/e1G+mXIO2DY8P6Xz7WPz7Ky/7omJ0PBff4+B91fAqsAp8HXwI3gR04txbbdWDDWDpP/g7Yxs6BXWAP2AueJHo+M5bOpw+Cw+AIOApOgFMW7Xkdec6AkXH1+QfgyzbOTY73jy/C/gJ+/CCOP4D9xfz4I9h+TFMWtf9SRWzZwq7f0yi/L9voWSRbDfV/clx/3TuKfjoT26/iX813URx4tiVG3ay/sfFuJenb7J50A4mr1di/CZzLKZ6y2reunup4qzT+fM0wHp0PUD9+A7bYNJ5fn3eNP/Ft5bc0+S4n9/l1Gj+K82zesd1wfj3fZ79h2YyyVvLj7djfCR4xjJEyuy1+S/FyDt/MPwodn5hB8axrxy9nSBtYjOyHrs+BQ+B58E+u+wsWbWBtpb/hYL8RuA/pJ8fT2GffX+wl+daSa08jz9nxNG2k4963XBG/ZVhpUS573mh3BtPo7x/Eb7pE2yd5XvZssY/M/RZLc9SLeDsfD5gfTidi9//pwrzWu7t9lKcN7dxynthAh8vcKrQu1frHTGKBNF662KfoOXU1FsaFxe6x2kjClkBnGvXxwX0bytZ5unK+S9n2jxabTc5M0HUaIyTrfFa+Ljmflc9Xz7JtNdPa4eKz6WAPlb5l6xfLBzopWxcfncvSf7rHRJk2KSN2bKRsvcu2UZmxVIb9qd551e8rZcTERGuQ+qwIjERkjl2+djOlhWfpibnp/qxmP92FVr1/bc9GYxxuI5o3UzdukzYpj+H6nOxra9nHiaksjhDdsasPe9ca/CvOU1GVwUT4t8P921H4T8gsnkdIh+dn/pXrU0mnOZw21CbJv1P5LP0r4jtkbLH171BbCvavnFfeZ8L8K2wv/CuQRU6n/qWSNSbr2mO8xtK/U+Mq6Y/1yQyFJHHtv8Kn2uOC/Gvbf2VEPxJ9SvhY5d+Q+y21iRxLruOzsY6MWGrOkPHZ1b+jFuPzqEX/VcmoZkyIPT53k36/DZnrMd+K/Dbjs6kv6+6VYl9OU+WT07TplvMvWWhfVo3f4t48S+rbjIZl/1b5Xyd5vJdQiTyf7tUdMlbn0J9d/cn6c7M5DO1TNF0+bmT0Z3qdKaaoXeg1Lv7NEhufzyT/6vIKEeO1jX/psdi38a889qpkStcI/u12U3zE1Re+/Yv6QNwvdTDJGi9t2ps1XtKYDJ0PmcZKcU812sRxvms7J47mZ5c+SWJD5LPRg4qqj+nWL8Q5sRVrGar1EG0sOI6ndH3DVWL7wpeuwaY6O1Nh19N+Oqs5uI7Eto3aICxNrCn5rAuZ7Cn2bdJtfZPlL/k8Ld+ki6v9E56XPUvT52mV/YVvmMj2Zz8TEuNMTxfHuFfFUJ60OLrz1utODnFG47fLbSjXy0xSy4gN63EywlhMxWcNmK71svszi5OGTvdJe3rtd8ifB6I/mKBr1ap7uU/sqqTsMb+H5fxBFyuq+yqLnd7cmj33TwyOVVOwuj3nVXRtQtUGWR9jzI6kecZrKSKPuFakU2hZmXXZMDlsS1W9jBavv6eHpf3EtfJ7mKwYV0lX2g9FVY5N+Ung9aH1590+n3KLgEredfiez6u9svisY/Suk9Jsnkli1a+C1m/T7rzqd5UY9mfiXX9R92ibdZUIawTC96b1GBn6rDG1JsPv/b392SkiXVUGmyN0LO5LYi46Zf/Adc/QMaCo8TtG/bH1Z/TsW1QfUPRjm2cZee5PRaT33lEbnhlMax4qe1o/Y8a0icdaoOv9bsh+Hj6jonueoGtHumcMlX9lxLxXq7/D84fSzznGt6rtUerXxYU47/IcPeG3vqBbJ1StETZqg9fS2Akd/0Ovp+/CxD3P+/6bQwzJtsvyh5w+XjeXH9KfXGH3/VbSX4tS4XoftPZbnvcyxX1G5QvW1wbWTkbs7c3mTco6NWODbdxk3R9lGZo/aGxhiknTmETXLVs1c90u9+mBGCf6hs6fsmTq29sxPv8d82CuhCpNjGNjg31blGHrz1i41hd6nuYzbU3XhLQzj7Jt67Otw0uXUdDoH8e4F/joMdVui2dMJc3E+Tetvr6jEtPnPhJaVwz9Y7TDVlx1qnfitlEbtzlTVD0qX/pcm1esxI65PO3mU4eNrr5SZMz46FDE+aIlb5tntb1o/WOUETsW847pvNpaZH225eUpNnrS9yDy9wTysyr9XVOe63+qd3M6e4X6Ptd1Dpc1SdV53ZqFag1hpP+bE5f4ivY74BzXilzWWW1+S0TjJng91Gd9wmbNgpMVz6W8d7GJZwWtWp8p++c8fpjW0Vzff3dJfzGuoersEtnmpjVLupY48H6o7n8/C+kvJn+Lcd6q3QHx3usvZax3W8apvP6rev+UJSHfiCYe/h2aTwTaRi5DO28ZSd9zNhTfJ8b2je7drOo9HtNNbPMW03zOpq2qNqnKFN+0huhlMye2Pe9TdzfCedfxMlRfG7xjncaJ7fiXMYZk3X+ZvuKbXCGh8y8XH8TybajPTfq4tjG2/qb0RJO3SB19ba2SMuoNbW8R/g653qa9sdsRYsssu+ZxPss+tnayFd94yjofEi+hZdvo73q9jd3yisUYbfEpQ9XmMqUIm2fFZh4xkZeE1BNDL5v+ZcqXh/90bSwjflz8U0QcFWHzPOpy0amM+stqf1ad7LltVPqWmG3p3+GiIvLJf8duYA3NcBwbWRpkDXmo7RP+z5E6+8Xswz512dbrW2aMNrpKaBt9y45VR2j9efhAQL/PF38Xadq907NYC5dpZLy3kMX6PUHgeGGS3nfoPn9rObJ9s/4uMntnSt/J5TX+2ZRhtFcB8ZgVmyZbit8GCd/7/C7EOcYK7LdyjNhIlL81nqN/Xf9mOHt/anovP4X0tyem/OUZF9TmscY2nzEulq96ZeVwv2Bxxnwk3s9njT8m/YWOKl199fe53tTXyu5DLojfKWXej6R3RAPtDf1ex/PvtdJ8Q7aP7Ht6XpdXSJf8/wMdQuS/j0/HtKny9KbT+oT2K2ETuW7Tt09Uss5nCdWhjPuMTXzrztO4FHMy+V6TJaH9I6+2C5HPq9oc8xlKRva5rF8M/7tC26/6BsNFivQ//e1pVsyP19VrNrH1D5Wi7oUDdVp8Q5HVr1ztlzXPtH2Gc30+lMX3edH3ecm3fp0+Ps/IPvWH6OpiV7meEMlbzyIkpi1jtDU0Pmm6nMd0jU8bXK7N0jWkb/joHyNebfWgtrJpc0h7QiQP24aKqcwYPnTRIUmG63fRQ5VXLsekgy5NtVXVadLfpjzV9S6xYnuNri159ZmsmLCpJ8/6XSRGOaH659H+GLYtwhd51xvq31B9Qm0UavM84qhoKaNOnfwf","base64"));
  38199. var stateMachine = new StateMachine(indicMachine);
  38200. /**
  38201. * The IndicShaper supports indic scripts e.g. Devanagari, Kannada, etc.
  38202. * Based on code from Harfbuzz: https://github.com/behdad/harfbuzz/blob/master/src/hb-ot-shape-complex-indic.cc
  38203. */
  38204. var IndicShaper = (_temp$2 = _class$6 = function (_DefaultShaper) {
  38205. _inherits(IndicShaper, _DefaultShaper);
  38206. function IndicShaper() {
  38207. _classCallCheck(this, IndicShaper);
  38208. return _possibleConstructorReturn(this, _DefaultShaper.apply(this, arguments));
  38209. }
  38210. IndicShaper.planFeatures = function planFeatures(plan) {
  38211. plan.addStage(setupSyllables);
  38212. plan.addStage(['locl', 'ccmp']);
  38213. plan.addStage(initialReordering);
  38214. plan.addStage('nukt');
  38215. plan.addStage('akhn');
  38216. plan.addStage('rphf', false);
  38217. plan.addStage('rkrf');
  38218. plan.addStage('pref', false);
  38219. plan.addStage('blwf', false);
  38220. plan.addStage('abvf', false);
  38221. plan.addStage('half', false);
  38222. plan.addStage('pstf', false);
  38223. plan.addStage('vatu');
  38224. plan.addStage('cjct');
  38225. plan.addStage('cfar', false);
  38226. plan.addStage(finalReordering);
  38227. plan.addStage({
  38228. local: ['init'],
  38229. global: ['pres', 'abvs', 'blws', 'psts', 'haln', 'dist', 'abvm', 'blwm', 'calt', 'clig']
  38230. });
  38231. // Setup the indic config for the selected script
  38232. plan.unicodeScript = fromOpenType(plan.script);
  38233. plan.indicConfig = INDIC_CONFIGS[plan.unicodeScript] || INDIC_CONFIGS.Default;
  38234. plan.isOldSpec = plan.indicConfig.hasOldSpec && plan.script[plan.script.length - 1] !== '2';
  38235. // TODO: turn off kern (Khmer) and liga features.
  38236. };
  38237. IndicShaper.assignFeatures = function assignFeatures(plan, glyphs) {
  38238. var _loop = function _loop(i) {
  38239. var codepoint = glyphs[i].codePoints[0];
  38240. var d = INDIC_DECOMPOSITIONS[codepoint] || decompositions[codepoint];
  38241. if (d) {
  38242. var decomposed = d.map(function (c) {
  38243. var g = plan.font.glyphForCodePoint(c);
  38244. return new GlyphInfo(plan.font, g.id, [c], glyphs[i].features);
  38245. });
  38246. glyphs.splice.apply(glyphs, [i, 1].concat(decomposed));
  38247. }
  38248. };
  38249. // Decompose split matras
  38250. // TODO: do this in a more general unicode normalizer
  38251. for (var i = glyphs.length - 1; i >= 0; i--) {
  38252. _loop(i);
  38253. }
  38254. };
  38255. return IndicShaper;
  38256. }(DefaultShaper), _class$6.zeroMarkWidths = 'NONE', _temp$2);
  38257. function indicCategory(glyph) {
  38258. return trie$1.get(glyph.codePoints[0]) >> 8;
  38259. }
  38260. function indicPosition(glyph) {
  38261. return 1 << (trie$1.get(glyph.codePoints[0]) & 0xff);
  38262. }
  38263. var IndicInfo = function IndicInfo(category, position, syllableType, syllable) {
  38264. _classCallCheck(this, IndicInfo);
  38265. this.category = category;
  38266. this.position = position;
  38267. this.syllableType = syllableType;
  38268. this.syllable = syllable;
  38269. };
  38270. function setupSyllables(font, glyphs) {
  38271. var syllable = 0;
  38272. var last = 0;
  38273. for (var _iterator = stateMachine.match(glyphs.map(indicCategory)), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _getIterator(_iterator);;) {
  38274. var _ref;
  38275. if (_isArray) {
  38276. if (_i >= _iterator.length) break;
  38277. _ref = _iterator[_i++];
  38278. } else {
  38279. _i = _iterator.next();
  38280. if (_i.done) break;
  38281. _ref = _i.value;
  38282. }
  38283. var _ref2 = _ref,
  38284. start = _ref2[0],
  38285. end = _ref2[1],
  38286. tags = _ref2[2];
  38287. if (start > last) {
  38288. ++syllable;
  38289. for (var _i2 = last; _i2 < start; _i2++) {
  38290. glyphs[_i2].shaperInfo = new IndicInfo(CATEGORIES.X, POSITIONS.End, 'non_indic_cluster', syllable);
  38291. }
  38292. }
  38293. ++syllable;
  38294. // Create shaper info
  38295. for (var _i3 = start; _i3 <= end; _i3++) {
  38296. glyphs[_i3].shaperInfo = new IndicInfo(1 << indicCategory(glyphs[_i3]), indicPosition(glyphs[_i3]), tags[0], syllable);
  38297. }
  38298. last = end + 1;
  38299. }
  38300. if (last < glyphs.length) {
  38301. ++syllable;
  38302. for (var i = last; i < glyphs.length; i++) {
  38303. glyphs[i].shaperInfo = new IndicInfo(CATEGORIES.X, POSITIONS.End, 'non_indic_cluster', syllable);
  38304. }
  38305. }
  38306. }
  38307. function isConsonant(glyph) {
  38308. return glyph.shaperInfo.category & CONSONANT_FLAGS;
  38309. }
  38310. function isJoiner(glyph) {
  38311. return glyph.shaperInfo.category & JOINER_FLAGS;
  38312. }
  38313. function isHalantOrCoeng(glyph) {
  38314. return glyph.shaperInfo.category & HALANT_OR_COENG_FLAGS;
  38315. }
  38316. function wouldSubstitute(glyphs, feature) {
  38317. for (var _iterator2 = glyphs, _isArray2 = Array.isArray(_iterator2), _i4 = 0, _iterator2 = _isArray2 ? _iterator2 : _getIterator(_iterator2);;) {
  38318. var _glyph$features;
  38319. var _ref3;
  38320. if (_isArray2) {
  38321. if (_i4 >= _iterator2.length) break;
  38322. _ref3 = _iterator2[_i4++];
  38323. } else {
  38324. _i4 = _iterator2.next();
  38325. if (_i4.done) break;
  38326. _ref3 = _i4.value;
  38327. }
  38328. var glyph = _ref3;
  38329. glyph.features = (_glyph$features = {}, _glyph$features[feature] = true, _glyph$features);
  38330. }
  38331. var GSUB = glyphs[0]._font._layoutEngine.engine.GSUBProcessor;
  38332. GSUB.applyFeatures([feature], glyphs);
  38333. return glyphs.length === 1;
  38334. }
  38335. function consonantPosition(font, consonant, virama) {
  38336. var glyphs = [virama, consonant, virama];
  38337. if (wouldSubstitute(glyphs.slice(0, 2), 'blwf') || wouldSubstitute(glyphs.slice(1, 3), 'blwf')) {
  38338. return POSITIONS.Below_C;
  38339. } else if (wouldSubstitute(glyphs.slice(0, 2), 'pstf') || wouldSubstitute(glyphs.slice(1, 3), 'pstf')) {
  38340. return POSITIONS.Post_C;
  38341. } else if (wouldSubstitute(glyphs.slice(0, 2), 'pref') || wouldSubstitute(glyphs.slice(1, 3), 'pref')) {
  38342. return POSITIONS.Post_C;
  38343. }
  38344. return POSITIONS.Base_C;
  38345. }
  38346. function initialReordering(font, glyphs, plan) {
  38347. var indicConfig = plan.indicConfig;
  38348. var features = font._layoutEngine.engine.GSUBProcessor.features;
  38349. var dottedCircle = font.glyphForCodePoint(0x25cc).id;
  38350. var virama = font.glyphForCodePoint(indicConfig.virama).id;
  38351. if (virama) {
  38352. var info = new GlyphInfo(font, virama, [indicConfig.virama]);
  38353. for (var i = 0; i < glyphs.length; i++) {
  38354. if (glyphs[i].shaperInfo.position === POSITIONS.Base_C) {
  38355. glyphs[i].shaperInfo.position = consonantPosition(font, glyphs[i].copy(), info);
  38356. }
  38357. }
  38358. }
  38359. for (var start = 0, end = nextSyllable(glyphs, 0); start < glyphs.length; start = end, end = nextSyllable(glyphs, start)) {
  38360. var _glyphs$start$shaperI = glyphs[start].shaperInfo,
  38361. category = _glyphs$start$shaperI.category,
  38362. syllableType = _glyphs$start$shaperI.syllableType;
  38363. if (syllableType === 'symbol_cluster' || syllableType === 'non_indic_cluster') {
  38364. continue;
  38365. }
  38366. if (syllableType === 'broken_cluster' && dottedCircle) {
  38367. var g = new GlyphInfo(font, dottedCircle, [0x25cc]);
  38368. g.shaperInfo = new IndicInfo(1 << indicCategory(g), indicPosition(g), glyphs[start].shaperInfo.syllableType, glyphs[start].shaperInfo.syllable);
  38369. // Insert after possible Repha.
  38370. var _i5 = start;
  38371. while (_i5 < end && glyphs[_i5].shaperInfo.category === CATEGORIES.Repha) {
  38372. _i5++;
  38373. }
  38374. glyphs.splice(_i5++, 0, g);
  38375. end++;
  38376. }
  38377. // 1. Find base consonant:
  38378. //
  38379. // The shaping engine finds the base consonant of the syllable, using the
  38380. // following algorithm: starting from the end of the syllable, move backwards
  38381. // until a consonant is found that does not have a below-base or post-base
  38382. // form (post-base forms have to follow below-base forms), or that is not a
  38383. // pre-base reordering Ra, or arrive at the first consonant. The consonant
  38384. // stopped at will be the base.
  38385. var base = end;
  38386. var limit = start;
  38387. var hasReph = false;
  38388. // If the syllable starts with Ra + Halant (in a script that has Reph)
  38389. // and has more than one consonant, Ra is excluded from candidates for
  38390. // base consonants.
  38391. if (indicConfig.rephPos !== POSITIONS.Ra_To_Become_Reph && features.rphf && start + 3 <= end && (indicConfig.rephMode === 'Implicit' && !isJoiner(glyphs[start + 2]) || indicConfig.rephMode === 'Explicit' && glyphs[start + 2].shaperInfo.category === CATEGORIES.ZWJ)) {
  38392. // See if it matches the 'rphf' feature.
  38393. var _g = [glyphs[start].copy(), glyphs[start + 1].copy(), glyphs[start + 2].copy()];
  38394. if (wouldSubstitute(_g.slice(0, 2), 'rphf') || indicConfig.rephMode === 'Explicit' && wouldSubstitute(_g, 'rphf')) {
  38395. limit += 2;
  38396. while (limit < end && isJoiner(glyphs[limit])) {
  38397. limit++;
  38398. }
  38399. base = start;
  38400. hasReph = true;
  38401. }
  38402. } else if (indicConfig.rephMode === 'Log_Repha' && glyphs[start].shaperInfo.category === CATEGORIES.Repha) {
  38403. limit++;
  38404. while (limit < end && isJoiner(glyphs[limit])) {
  38405. limit++;
  38406. }
  38407. base = start;
  38408. hasReph = true;
  38409. }
  38410. switch (indicConfig.basePos) {
  38411. case 'Last':
  38412. {
  38413. // starting from the end of the syllable, move backwards
  38414. var _i6 = end;
  38415. var seenBelow = false;
  38416. do {
  38417. var _info = glyphs[--_i6].shaperInfo;
  38418. // until a consonant is found
  38419. if (isConsonant(glyphs[_i6])) {
  38420. // that does not have a below-base or post-base form
  38421. // (post-base forms have to follow below-base forms),
  38422. if (_info.position !== POSITIONS.Below_C && (_info.position !== POSITIONS.Post_C || seenBelow)) {
  38423. base = _i6;
  38424. break;
  38425. }
  38426. // or that is not a pre-base reordering Ra,
  38427. //
  38428. // IMPLEMENTATION NOTES:
  38429. //
  38430. // Our pre-base reordering Ra's are marked POS_POST_C, so will be skipped
  38431. // by the logic above already.
  38432. //
  38433. // or arrive at the first consonant. The consonant stopped at will
  38434. // be the base.
  38435. if (_info.position === POSITIONS.Below_C) {
  38436. seenBelow = true;
  38437. }
  38438. base = _i6;
  38439. } else if (start < _i6 && _info.category === CATEGORIES.ZWJ && glyphs[_i6 - 1].shaperInfo.category === CATEGORIES.H) {
  38440. // A ZWJ after a Halant stops the base search, and requests an explicit
  38441. // half form.
  38442. // A ZWJ before a Halant, requests a subjoined form instead, and hence
  38443. // search continues. This is particularly important for Bengali
  38444. // sequence Ra,H,Ya that should form Ya-Phalaa by subjoining Ya.
  38445. break;
  38446. }
  38447. } while (_i6 > limit);
  38448. break;
  38449. }
  38450. case 'First':
  38451. {
  38452. // The first consonant is always the base.
  38453. base = start;
  38454. // Mark all subsequent consonants as below.
  38455. for (var _i7 = base + 1; _i7 < end; _i7++) {
  38456. if (isConsonant(glyphs[_i7])) {
  38457. glyphs[_i7].shaperInfo.position = POSITIONS.Below_C;
  38458. }
  38459. }
  38460. }
  38461. }
  38462. // If the syllable starts with Ra + Halant (in a script that has Reph)
  38463. // and has more than one consonant, Ra is excluded from candidates for
  38464. // base consonants.
  38465. //
  38466. // Only do this for unforced Reph. (ie. not for Ra,H,ZWJ)
  38467. if (hasReph && base === start && limit - base <= 2) {
  38468. hasReph = false;
  38469. }
  38470. // 2. Decompose and reorder Matras:
  38471. //
  38472. // Each matra and any syllable modifier sign in the cluster are moved to the
  38473. // appropriate position relative to the consonant(s) in the cluster. The
  38474. // shaping engine decomposes two- or three-part matras into their constituent
  38475. // parts before any repositioning. Matra characters are classified by which
  38476. // consonant in a conjunct they have affinity for and are reordered to the
  38477. // following positions:
  38478. //
  38479. // o Before first half form in the syllable
  38480. // o After subjoined consonants
  38481. // o After post-form consonant
  38482. // o After main consonant (for above marks)
  38483. //
  38484. // IMPLEMENTATION NOTES:
  38485. //
  38486. // The normalize() routine has already decomposed matras for us, so we don't
  38487. // need to worry about that.
  38488. // 3. Reorder marks to canonical order:
  38489. //
  38490. // Adjacent nukta and halant or nukta and vedic sign are always repositioned
  38491. // if necessary, so that the nukta is first.
  38492. //
  38493. // IMPLEMENTATION NOTES:
  38494. //
  38495. // We don't need to do this: the normalize() routine already did this for us.
  38496. // Reorder characters
  38497. for (var _i8 = start; _i8 < base; _i8++) {
  38498. var _info2 = glyphs[_i8].shaperInfo;
  38499. _info2.position = Math.min(POSITIONS.Pre_C, _info2.position);
  38500. }
  38501. if (base < end) {
  38502. glyphs[base].shaperInfo.position = POSITIONS.Base_C;
  38503. }
  38504. // Mark final consonants. A final consonant is one appearing after a matra,
  38505. // like in Khmer.
  38506. for (var _i9 = base + 1; _i9 < end; _i9++) {
  38507. if (glyphs[_i9].shaperInfo.category === CATEGORIES.M) {
  38508. for (var j = _i9 + 1; j < end; j++) {
  38509. if (isConsonant(glyphs[j])) {
  38510. glyphs[j].shaperInfo.position = POSITIONS.Final_C;
  38511. break;
  38512. }
  38513. }
  38514. break;
  38515. }
  38516. }
  38517. // Handle beginning Ra
  38518. if (hasReph) {
  38519. glyphs[start].shaperInfo.position = POSITIONS.Ra_To_Become_Reph;
  38520. }
  38521. // For old-style Indic script tags, move the first post-base Halant after
  38522. // last consonant.
  38523. //
  38524. // Reports suggest that in some scripts Uniscribe does this only if there
  38525. // is *not* a Halant after last consonant already (eg. Kannada), while it
  38526. // does it unconditionally in other scripts (eg. Malayalam). We don't
  38527. // currently know about other scripts, so we single out Malayalam for now.
  38528. //
  38529. // Kannada test case:
  38530. // U+0C9A,U+0CCD,U+0C9A,U+0CCD
  38531. // With some versions of Lohit Kannada.
  38532. // https://bugs.freedesktop.org/show_bug.cgi?id=59118
  38533. //
  38534. // Malayalam test case:
  38535. // U+0D38,U+0D4D,U+0D31,U+0D4D,U+0D31,U+0D4D
  38536. // With lohit-ttf-20121122/Lohit-Malayalam.ttf
  38537. if (plan.isOldSpec) {
  38538. var disallowDoubleHalants = plan.unicodeScript !== 'Malayalam';
  38539. for (var _i10 = base + 1; _i10 < end; _i10++) {
  38540. if (glyphs[_i10].shaperInfo.category === CATEGORIES.H) {
  38541. var _j = void 0;
  38542. for (_j = end - 1; _j > _i10; _j--) {
  38543. if (isConsonant(glyphs[_j]) || disallowDoubleHalants && glyphs[_j].shaperInfo.category === CATEGORIES.H) {
  38544. break;
  38545. }
  38546. }
  38547. if (glyphs[_j].shaperInfo.category !== CATEGORIES.H && _j > _i10) {
  38548. // Move Halant to after last consonant.
  38549. var t = glyphs[_i10];
  38550. glyphs.splice.apply(glyphs, [_i10, 0].concat(glyphs.splice(_i10 + 1, _j - _i10)));
  38551. glyphs[_j] = t;
  38552. }
  38553. break;
  38554. }
  38555. }
  38556. }
  38557. // Attach misc marks to previous char to move with them.
  38558. var lastPos = POSITIONS.Start;
  38559. for (var _i11 = start; _i11 < end; _i11++) {
  38560. var _info3 = glyphs[_i11].shaperInfo;
  38561. if (_info3.category & (JOINER_FLAGS | CATEGORIES.N | CATEGORIES.RS | CATEGORIES.CM | HALANT_OR_COENG_FLAGS & _info3.category)) {
  38562. _info3.position = lastPos;
  38563. if (_info3.category === CATEGORIES.H && _info3.position === POSITIONS.Pre_M) {
  38564. // Uniscribe doesn't move the Halant with Left Matra.
  38565. // TEST: U+092B,U+093F,U+094DE
  38566. // We follow. This is important for the Sinhala
  38567. // U+0DDA split matra since it decomposes to U+0DD9,U+0DCA
  38568. // where U+0DD9 is a left matra and U+0DCA is the virama.
  38569. // We don't want to move the virama with the left matra.
  38570. // TEST: U+0D9A,U+0DDA
  38571. for (var _j2 = _i11; _j2 > start; _j2--) {
  38572. if (glyphs[_j2 - 1].shaperInfo.position !== POSITIONS.Pre_M) {
  38573. _info3.position = glyphs[_j2 - 1].shaperInfo.position;
  38574. break;
  38575. }
  38576. }
  38577. }
  38578. } else if (_info3.position !== POSITIONS.SMVD) {
  38579. lastPos = _info3.position;
  38580. }
  38581. }
  38582. // For post-base consonants let them own anything before them
  38583. // since the last consonant or matra.
  38584. var last = base;
  38585. for (var _i12 = base + 1; _i12 < end; _i12++) {
  38586. if (isConsonant(glyphs[_i12])) {
  38587. for (var _j3 = last + 1; _j3 < _i12; _j3++) {
  38588. if (glyphs[_j3].shaperInfo.position < POSITIONS.SMVD) {
  38589. glyphs[_j3].shaperInfo.position = glyphs[_i12].shaperInfo.position;
  38590. }
  38591. }
  38592. last = _i12;
  38593. } else if (glyphs[_i12].shaperInfo.category === CATEGORIES.M) {
  38594. last = _i12;
  38595. }
  38596. }
  38597. var arr = glyphs.slice(start, end);
  38598. arr.sort(function (a, b) {
  38599. return a.shaperInfo.position - b.shaperInfo.position;
  38600. });
  38601. glyphs.splice.apply(glyphs, [start, arr.length].concat(arr));
  38602. // Find base again
  38603. for (var _i13 = start; _i13 < end; _i13++) {
  38604. if (glyphs[_i13].shaperInfo.position === POSITIONS.Base_C) {
  38605. base = _i13;
  38606. break;
  38607. }
  38608. }
  38609. // Setup features now
  38610. // Reph
  38611. for (var _i14 = start; _i14 < end && glyphs[_i14].shaperInfo.position === POSITIONS.Ra_To_Become_Reph; _i14++) {
  38612. glyphs[_i14].features.rphf = true;
  38613. }
  38614. // Pre-base
  38615. var blwf = !plan.isOldSpec && indicConfig.blwfMode === 'Pre_And_Post';
  38616. for (var _i15 = start; _i15 < base; _i15++) {
  38617. glyphs[_i15].features.half = true;
  38618. if (blwf) {
  38619. glyphs[_i15].features.blwf = true;
  38620. }
  38621. }
  38622. // Post-base
  38623. for (var _i16 = base + 1; _i16 < end; _i16++) {
  38624. glyphs[_i16].features.abvf = true;
  38625. glyphs[_i16].features.pstf = true;
  38626. glyphs[_i16].features.blwf = true;
  38627. }
  38628. if (plan.isOldSpec && plan.unicodeScript === 'Devanagari') {
  38629. // Old-spec eye-lash Ra needs special handling. From the
  38630. // spec:
  38631. //
  38632. // "The feature 'below-base form' is applied to consonants
  38633. // having below-base forms and following the base consonant.
  38634. // The exception is vattu, which may appear below half forms
  38635. // as well as below the base glyph. The feature 'below-base
  38636. // form' will be applied to all such occurrences of Ra as well."
  38637. //
  38638. // Test case: U+0924,U+094D,U+0930,U+094d,U+0915
  38639. // with Sanskrit 2003 font.
  38640. //
  38641. // However, note that Ra,Halant,ZWJ is the correct way to
  38642. // request eyelash form of Ra, so we wouldbn't inhibit it
  38643. // in that sequence.
  38644. //
  38645. // Test case: U+0924,U+094D,U+0930,U+094d,U+200D,U+0915
  38646. for (var _i17 = start; _i17 + 1 < base; _i17++) {
  38647. if (glyphs[_i17].shaperInfo.category === CATEGORIES.Ra && glyphs[_i17 + 1].shaperInfo.category === CATEGORIES.H && (_i17 + 1 === base || glyphs[_i17 + 2].shaperInfo.category === CATEGORIES.ZWJ)) {
  38648. glyphs[_i17].features.blwf = true;
  38649. glyphs[_i17 + 1].features.blwf = true;
  38650. }
  38651. }
  38652. }
  38653. var prefLen = 2;
  38654. if (features.pref && base + prefLen < end) {
  38655. // Find a Halant,Ra sequence and mark it for pre-base reordering processing.
  38656. for (var _i18 = base + 1; _i18 + prefLen - 1 < end; _i18++) {
  38657. var _g2 = [glyphs[_i18].copy(), glyphs[_i18 + 1].copy()];
  38658. if (wouldSubstitute(_g2, 'pref')) {
  38659. for (var _j4 = 0; _j4 < prefLen; _j4++) {
  38660. glyphs[_i18++].features.pref = true;
  38661. }
  38662. // Mark the subsequent stuff with 'cfar'. Used in Khmer.
  38663. // Read the feature spec.
  38664. // This allows distinguishing the following cases with MS Khmer fonts:
  38665. // U+1784,U+17D2,U+179A,U+17D2,U+1782
  38666. // U+1784,U+17D2,U+1782,U+17D2,U+179A
  38667. if (features.cfar) {
  38668. for (; _i18 < end; _i18++) {
  38669. glyphs[_i18].features.cfar = true;
  38670. }
  38671. }
  38672. break;
  38673. }
  38674. }
  38675. }
  38676. // Apply ZWJ/ZWNJ effects
  38677. for (var _i19 = start + 1; _i19 < end; _i19++) {
  38678. if (isJoiner(glyphs[_i19])) {
  38679. var nonJoiner = glyphs[_i19].shaperInfo.category === CATEGORIES.ZWNJ;
  38680. var _j5 = _i19;
  38681. do {
  38682. _j5--;
  38683. // ZWJ/ZWNJ should disable CJCT. They do that by simply
  38684. // being there, since we don't skip them for the CJCT
  38685. // feature (ie. F_MANUAL_ZWJ)
  38686. // A ZWNJ disables HALF.
  38687. if (nonJoiner) {
  38688. delete glyphs[_j5].features.half;
  38689. }
  38690. } while (_j5 > start && !isConsonant(glyphs[_j5]));
  38691. }
  38692. }
  38693. }
  38694. }
  38695. function finalReordering(font, glyphs, plan) {
  38696. var indicConfig = plan.indicConfig;
  38697. var features = font._layoutEngine.engine.GSUBProcessor.features;
  38698. for (var start = 0, end = nextSyllable(glyphs, 0); start < glyphs.length; start = end, end = nextSyllable(glyphs, start)) {
  38699. // 4. Final reordering:
  38700. //
  38701. // After the localized forms and basic shaping forms GSUB features have been
  38702. // applied (see below), the shaping engine performs some final glyph
  38703. // reordering before applying all the remaining font features to the entire
  38704. // cluster.
  38705. var tryPref = !!features.pref;
  38706. // Find base again
  38707. var base = start;
  38708. for (; base < end; base++) {
  38709. if (glyphs[base].shaperInfo.position >= POSITIONS.Base_C) {
  38710. if (tryPref && base + 1 < end) {
  38711. for (var i = base + 1; i < end; i++) {
  38712. if (glyphs[i].features.pref) {
  38713. if (!(glyphs[i].substituted && glyphs[i].isLigated && !glyphs[i].isMultiplied)) {
  38714. // Ok, this was a 'pref' candidate but didn't form any.
  38715. // Base is around here...
  38716. base = i;
  38717. while (base < end && isHalantOrCoeng(glyphs[base])) {
  38718. base++;
  38719. }
  38720. glyphs[base].shaperInfo.position = POSITIONS.BASE_C;
  38721. tryPref = false;
  38722. }
  38723. break;
  38724. }
  38725. }
  38726. }
  38727. // For Malayalam, skip over unformed below- (but NOT post-) forms.
  38728. if (plan.unicodeScript === 'Malayalam') {
  38729. for (var _i20 = base + 1; _i20 < end; _i20++) {
  38730. while (_i20 < end && isJoiner(glyphs[_i20])) {
  38731. _i20++;
  38732. }
  38733. if (_i20 === end || !isHalantOrCoeng(glyphs[_i20])) {
  38734. break;
  38735. }
  38736. _i20++; // Skip halant.
  38737. while (_i20 < end && isJoiner(glyphs[_i20])) {
  38738. _i20++;
  38739. }
  38740. if (_i20 < end && isConsonant(glyphs[_i20]) && glyphs[_i20].shaperInfo.position === POSITIONS.Below_C) {
  38741. base = _i20;
  38742. glyphs[base].shaperInfo.position = POSITIONS.Base_C;
  38743. }
  38744. }
  38745. }
  38746. if (start < base && glyphs[base].shaperInfo.position > POSITIONS.Base_C) {
  38747. base--;
  38748. }
  38749. break;
  38750. }
  38751. }
  38752. if (base === end && start < base && glyphs[base - 1].shaperInfo.category === CATEGORIES.ZWJ) {
  38753. base--;
  38754. }
  38755. if (base < end) {
  38756. while (start < base && glyphs[base].shaperInfo.category & (CATEGORIES.N | HALANT_OR_COENG_FLAGS)) {
  38757. base--;
  38758. }
  38759. }
  38760. // o Reorder matras:
  38761. //
  38762. // If a pre-base matra character had been reordered before applying basic
  38763. // features, the glyph can be moved closer to the main consonant based on
  38764. // whether half-forms had been formed. Actual position for the matra is
  38765. // defined as “after last standalone halant glyph, after initial matra
  38766. // position and before the main consonant”. If ZWJ or ZWNJ follow this
  38767. // halant, position is moved after it.
  38768. //
  38769. if (start + 1 < end && start < base) {
  38770. // Otherwise there can't be any pre-base matra characters.
  38771. // If we lost track of base, alas, position before last thingy.
  38772. var newPos = base === end ? base - 2 : base - 1;
  38773. // Malayalam / Tamil do not have "half" forms or explicit virama forms.
  38774. // The glyphs formed by 'half' are Chillus or ligated explicit viramas.
  38775. // We want to position matra after them.
  38776. if (plan.unicodeScript !== 'Malayalam' && plan.unicodeScript !== 'Tamil') {
  38777. while (newPos > start && !(glyphs[newPos].shaperInfo.category & (CATEGORIES.M | HALANT_OR_COENG_FLAGS))) {
  38778. newPos--;
  38779. }
  38780. // If we found no Halant we are done.
  38781. // Otherwise only proceed if the Halant does
  38782. // not belong to the Matra itself!
  38783. if (isHalantOrCoeng(glyphs[newPos]) && glyphs[newPos].shaperInfo.position !== POSITIONS.Pre_M) {
  38784. // If ZWJ or ZWNJ follow this halant, position is moved after it.
  38785. if (newPos + 1 < end && isJoiner(glyphs[newPos + 1])) {
  38786. newPos++;
  38787. }
  38788. } else {
  38789. newPos = start; // No move.
  38790. }
  38791. }
  38792. if (start < newPos && glyphs[newPos].shaperInfo.position !== POSITIONS.Pre_M) {
  38793. // Now go see if there's actually any matras...
  38794. for (var _i21 = newPos; _i21 > start; _i21--) {
  38795. if (glyphs[_i21 - 1].shaperInfo.position === POSITIONS.Pre_M) {
  38796. var oldPos = _i21 - 1;
  38797. if (oldPos < base && base <= newPos) {
  38798. // Shouldn't actually happen.
  38799. base--;
  38800. }
  38801. var tmp = glyphs[oldPos];
  38802. glyphs.splice.apply(glyphs, [oldPos, 0].concat(glyphs.splice(oldPos + 1, newPos - oldPos)));
  38803. glyphs[newPos] = tmp;
  38804. newPos--;
  38805. }
  38806. }
  38807. }
  38808. }
  38809. // o Reorder reph:
  38810. //
  38811. // Reph’s original position is always at the beginning of the syllable,
  38812. // (i.e. it is not reordered at the character reordering stage). However,
  38813. // it will be reordered according to the basic-forms shaping results.
  38814. // Possible positions for reph, depending on the script, are; after main,
  38815. // before post-base consonant forms, and after post-base consonant forms.
  38816. // Two cases:
  38817. //
  38818. // - If repha is encoded as a sequence of characters (Ra,H or Ra,H,ZWJ), then
  38819. // we should only move it if the sequence ligated to the repha form.
  38820. //
  38821. // - If repha is encoded separately and in the logical position, we should only
  38822. // move it if it did NOT ligate. If it ligated, it's probably the font trying
  38823. // to make it work without the reordering.
  38824. if (start + 1 < end && glyphs[start].shaperInfo.position === POSITIONS.Ra_To_Become_Reph && glyphs[start].shaperInfo.category === CATEGORIES.Repha !== (glyphs[start].isLigated && !glyphs[start].isMultiplied)) {
  38825. var newRephPos = void 0;
  38826. var rephPos = indicConfig.rephPos;
  38827. var found = false;
  38828. // 1. If reph should be positioned after post-base consonant forms,
  38829. // proceed to step 5.
  38830. if (rephPos !== POSITIONS.After_Post) {
  38831. // 2. If the reph repositioning class is not after post-base: target
  38832. // position is after the first explicit halant glyph between the
  38833. // first post-reph consonant and last main consonant. If ZWJ or ZWNJ
  38834. // are following this halant, position is moved after it. If such
  38835. // position is found, this is the target position. Otherwise,
  38836. // proceed to the next step.
  38837. //
  38838. // Note: in old-implementation fonts, where classifications were
  38839. // fixed in shaping engine, there was no case where reph position
  38840. // will be found on this step.
  38841. newRephPos = start + 1;
  38842. while (newRephPos < base && !isHalantOrCoeng(glyphs[newRephPos])) {
  38843. newRephPos++;
  38844. }
  38845. if (newRephPos < base && isHalantOrCoeng(glyphs[newRephPos])) {
  38846. // ->If ZWJ or ZWNJ are following this halant, position is moved after it.
  38847. if (newRephPos + 1 < base && isJoiner(glyphs[newRephPos + 1])) {
  38848. newRephPos++;
  38849. }
  38850. found = true;
  38851. }
  38852. // 3. If reph should be repositioned after the main consonant: find the
  38853. // first consonant not ligated with main, or find the first
  38854. // consonant that is not a potential pre-base reordering Ra.
  38855. if (!found && rephPos === POSITIONS.After_Main) {
  38856. newRephPos = base;
  38857. while (newRephPos + 1 < end && glyphs[newRephPos + 1].shaperInfo.position <= POSITIONS.After_Main) {
  38858. newRephPos++;
  38859. }
  38860. found = newRephPos < end;
  38861. }
  38862. // 4. If reph should be positioned before post-base consonant, find
  38863. // first post-base classified consonant not ligated with main. If no
  38864. // consonant is found, the target position should be before the
  38865. // first matra, syllable modifier sign or vedic sign.
  38866. //
  38867. // This is our take on what step 4 is trying to say (and failing, BADLY).
  38868. if (!found && rephPos === POSITIONS.After_Sub) {
  38869. newRephPos = base;
  38870. while (newRephPos + 1 < end && !(glyphs[newRephPos + 1].shaperInfo.position & (POSITIONS.Post_C | POSITIONS.After_Post | POSITIONS.SMVD))) {
  38871. newRephPos++;
  38872. }
  38873. found = newRephPos < end;
  38874. }
  38875. }
  38876. // 5. If no consonant is found in steps 3 or 4, move reph to a position
  38877. // immediately before the first post-base matra, syllable modifier
  38878. // sign or vedic sign that has a reordering class after the intended
  38879. // reph position. For example, if the reordering position for reph
  38880. // is post-main, it will skip above-base matras that also have a
  38881. // post-main position.
  38882. if (!found) {
  38883. // Copied from step 2.
  38884. newRephPos = start + 1;
  38885. while (newRephPos < base && !isHalantOrCoeng(glyphs[newRephPos])) {
  38886. newRephPos++;
  38887. }
  38888. if (newRephPos < base && isHalantOrCoeng(glyphs[newRephPos])) {
  38889. // ->If ZWJ or ZWNJ are following this halant, position is moved after it.
  38890. if (newRephPos + 1 < base && isJoiner(glyphs[newRephPos + 1])) {
  38891. newRephPos++;
  38892. }
  38893. found = true;
  38894. }
  38895. }
  38896. // 6. Otherwise, reorder reph to the end of the syllable.
  38897. if (!found) {
  38898. newRephPos = end - 1;
  38899. while (newRephPos > start && glyphs[newRephPos].shaperInfo.position === POSITIONS.SMVD) {
  38900. newRephPos--;
  38901. }
  38902. // If the Reph is to be ending up after a Matra,Halant sequence,
  38903. // position it before that Halant so it can interact with the Matra.
  38904. // However, if it's a plain Consonant,Halant we shouldn't do that.
  38905. // Uniscribe doesn't do this.
  38906. // TEST: U+0930,U+094D,U+0915,U+094B,U+094D
  38907. if (isHalantOrCoeng(glyphs[newRephPos])) {
  38908. for (var _i22 = base + 1; _i22 < newRephPos; _i22++) {
  38909. if (glyphs[_i22].shaperInfo.category === CATEGORIES.M) {
  38910. newRephPos--;
  38911. }
  38912. }
  38913. }
  38914. }
  38915. var reph = glyphs[start];
  38916. glyphs.splice.apply(glyphs, [start, 0].concat(glyphs.splice(start + 1, newRephPos - start)));
  38917. glyphs[newRephPos] = reph;
  38918. if (start < base && base <= newRephPos) {
  38919. base--;
  38920. }
  38921. }
  38922. // o Reorder pre-base reordering consonants:
  38923. //
  38924. // If a pre-base reordering consonant is found, reorder it according to
  38925. // the following rules:
  38926. if (tryPref && base + 1 < end) {
  38927. for (var _i23 = base + 1; _i23 < end; _i23++) {
  38928. if (glyphs[_i23].features.pref) {
  38929. // 1. Only reorder a glyph produced by substitution during application
  38930. // of the <pref> feature. (Note that a font may shape a Ra consonant with
  38931. // the feature generally but block it in certain contexts.)
  38932. // Note: We just check that something got substituted. We don't check that
  38933. // the <pref> feature actually did it...
  38934. //
  38935. // Reorder pref only if it ligated.
  38936. if (glyphs[_i23].isLigated && !glyphs[_i23].isMultiplied) {
  38937. // 2. Try to find a target position the same way as for pre-base matra.
  38938. // If it is found, reorder pre-base consonant glyph.
  38939. //
  38940. // 3. If position is not found, reorder immediately before main
  38941. // consonant.
  38942. var _newPos = base;
  38943. // Malayalam / Tamil do not have "half" forms or explicit virama forms.
  38944. // The glyphs formed by 'half' are Chillus or ligated explicit viramas.
  38945. // We want to position matra after them.
  38946. if (plan.unicodeScript !== 'Malayalam' && plan.unicodeScript !== 'Tamil') {
  38947. while (_newPos > start && !(glyphs[_newPos - 1].shaperInfo.category & (CATEGORIES.M | HALANT_OR_COENG_FLAGS))) {
  38948. _newPos--;
  38949. }
  38950. // In Khmer coeng model, a H,Ra can go *after* matras. If it goes after a
  38951. // split matra, it should be reordered to *before* the left part of such matra.
  38952. if (_newPos > start && glyphs[_newPos - 1].shaperInfo.category === CATEGORIES.M) {
  38953. var _oldPos2 = _i23;
  38954. for (var j = base + 1; j < _oldPos2; j++) {
  38955. if (glyphs[j].shaperInfo.category === CATEGORIES.M) {
  38956. _newPos--;
  38957. break;
  38958. }
  38959. }
  38960. }
  38961. }
  38962. if (_newPos > start && isHalantOrCoeng(glyphs[_newPos - 1])) {
  38963. // -> If ZWJ or ZWNJ follow this halant, position is moved after it.
  38964. if (_newPos < end && isJoiner(glyphs[_newPos])) {
  38965. _newPos++;
  38966. }
  38967. }
  38968. var _oldPos = _i23;
  38969. var _tmp = glyphs[_oldPos];
  38970. glyphs.splice.apply(glyphs, [_newPos + 1, 0].concat(glyphs.splice(_newPos, _oldPos - _newPos)));
  38971. glyphs[_newPos] = _tmp;
  38972. if (_newPos <= base && base < _oldPos) {
  38973. base++;
  38974. }
  38975. }
  38976. break;
  38977. }
  38978. }
  38979. }
  38980. // Apply 'init' to the Left Matra if it's a word start.
  38981. if (glyphs[start].shaperInfo.position === POSITIONS.Pre_M && (!start || !/Cf|Mn/.test(unicode.getCategory(glyphs[start - 1].codePoints[0])))) {
  38982. glyphs[start].features.init = true;
  38983. }
  38984. }
  38985. }
  38986. function nextSyllable(glyphs, start) {
  38987. if (start >= glyphs.length) return start;
  38988. var syllable = glyphs[start].shaperInfo.syllable;
  38989. while (++start < glyphs.length && glyphs[start].shaperInfo.syllable === syllable) {}
  38990. return start;
  38991. }
  38992. var _class$7;
  38993. var _temp$3;
  38994. var categories$1 = useData.categories;
  38995. var decompositions$2 = useData.decompositions;
  38996. var trie$2 = new UnicodeTrie(Buffer("AAIAAAAAAAAAAKnQAVEMrvPtnH+oHUcVx+fd99799W5e8mx+9NkYm7YUI2KtimkVDG3FWgVTFY1Fqa2VJirYB0IaUFLBaKGJViXir6oxKCSBoi0UTKtg2yA26h+milYNtMH+0WK1VQyvtBS/487hnncyMzuzu7N7n7kHPszu7OzMmTNzdmdmfzzfUmpiUqkemAMbwSZwKbjcxM1XEL4VvB28G3zAk+56cLMlfgdYADvBbvBF8GWwH9xl+CFLfwj8BPwU/MKS38/AMfA86v9ro9ucQcdR+CjCP4CT4EnwDPg3eAFMTik1A+bAPNgINoFLwGawZSpLfzXCrWAb+AjYDm4BO8FusAfsA/vBXeAgOALuNfv3g4fAcXACPAaeAE+B58Bp8NJUpnN7WqlZsHY629+A8GLwWvAG8BZwJXinOf5ehB8EN4AdYGE6q7dmF9uugs8hvz0V58nZK/L+Kva/BX4ADoN7prP6HgUPgkfA73L0eQzHnwBPgX+Y80+DF8FUW6lBO4tbjXA9uAi8pj3sS2/E9mawBVwNtoJt5pzrTXgzwk+B7awP7sT+7nY6WxFfQBlfAl8H3wU/Anezcu/D9s/BMRN3HOEJ8EdwMkC/J5HmmXZmq2fBIjgEVEepbieLX4Fw0MnSrzRxmrVsm7MB8ReDV4vjr3ekJy7rZGVPMb196Xm6oug83oRyt4CrwDVgK9gGPtzxn3uTOD6YPDPNJ5Hm0+AznazffJ7Z4KSnXncg3VfAN8EBhx42/z/UGdbrx52sr9yH8AFTrt5+2GzfnWPbKuw7ZszZyNh/xowZM2bMmDFjxsQyZ5lPNs3h9nBNYHuAfr9ic9ffiHnsJzznU91/j3P+2snWYf6G8O/gn+A0eMnEt7vQp5ulX4NwHmwEm7rZ8UsRXg6uMPvXIHwPuK7rLl+nu9FzfMyYMWPGpGVuslmarv+YMWPSkNq/d2D8uNDNngvdivA2y3jy9m72bF9v3ymOf2MExp8fG2TsAcfA2wJYBJetWBq3i+0fwPafwLmzSl0LFmZNPMLHZ4fpnsX2AdjgcXB+T6kPge+AG7D/vXYW/tLsc9r9M+MkVyLNR1m6g9g+ZfYvmMExcHCm+ftP0+T5y/e17Uw/PYLwHnC0m80TH+zG30/3mjSDnPS2/B4pUJ4rX3n+b5H3o92l6UjfvZ7y/oJzToGnu8O66XTPYf8/Jr8XWL6TPXf9bPnHtmVs+89AnxVgDVgPLgKvAg+Y/F6H7c1gC7jKHH8XeJ/x15vAjt4wvwVs7wKfBXvAPvA18G1wsJevj36f5gjS3etIq+ft9+PYQ73h/nFsn2D7f+5l75bo/VPYftpTblFb2/Jo2pdjfL0uXOX/qxfnp8vZVk2Xv9hbmu+LxvYt3A/7/WZsPoptPkr9bdCv1ya+d4TuMO8Tre5n4XkILwSbzP4l/WHazX1//r2O/z7cFHnvSYW8R/Vm02ZXIHxHze1Xdf9bbn7p0z2kDroNr2X9WL+7937sX9fP+v9h9n6jTrfI3jG9EfsfN3G35PR/G4uRfY3eMTwdkFa/C3hrf2kcfy/xYTOmprrfZsLbEe7rDPW/U9Rrv9k/ahmTL0cWWxP/YxRkgtES+zwNhZPs+FQgMj/liEsto2HxsZBQX2pZoLZqWc5riXDaQBLSt1L3hcnE+Vct7aYVKCEhbXk2+b7NZ84mmXAwCiL14Ne85S62MYPcXi5StM/YxlJF2lfabznZsC6/C807xvZV+yFve9d1KY//d3HNO8pKUXuTDh0Gpp7B852q6QFMgdWM2dfbAxOuEPQEfcEsO5fquJLZrMfyCtWP0heZF6oSdiH9u4aQvJRIJ/eL6BBynItLp5D2JRkY5L5u3xAf6lviXHWSZcfaKO/+5zvO/c9Xtq8uRXSObd+8bS0zJrS1rxTyX7k/a0nrk5D+mHeOC90uq1Q216X57lykfqHt62uTGJ2rat+i/kttyq/RSi29PlclZf2Xxq55ZeSV34T96d5X5PqZJ9I3ZX2lnkXt3xL1Kyrav/LutbZ6uGxuS6ss6V3pXOXY4kP7EBfyJT7+4TJQS9uf74f6n+3+6ZIi9bCtieatFfCxUMx4KMYfy/pzrB30vm88q9SZ11K+n9eeNN612UFKWX8uI9TmRca7TbWvKy2JvF6naF+b/0uRupZp35cZikhZvyniY2R/CbdB3vXynIC6hbRBHf4l1xps6w4x/lVEtxRtGZMuRA8uNh/jfYV8kdpsBUszcODrD7E2JT2KrB3V6XMhbdNjcXItxzaOJWkpf976/I5glQn1sbLP86U9FQvz4l0S28/lcWUJbbrE2l+Z/TlHvi4/kvZXLMyrmy1PW7x8hl6UFgvlmNM1Jq3aJ3Se0yJcpdwS6mOp/ZgLX5N1rdFKaIzH9ztquMbqq+/qCFRk+hRoyZvrTHuO8fNd/djmEzZJ3TdisN1bNQNl7y96DV/3mVkTtwasVdk1ai6ybGlDek8nT1fXc4M5tVSPvhqOsWQeXQs8L1n3IradU8OxCeVjK7dr7Dpl0cMHnUvt18TzfVsfb/pZY56fV2GnVPVIYaOi9xcZJ8cmKcu3wcuPsVHV5cdKFfZXNZefp5sWft+wzR1cczKCxh99NRx76HvwOpWNv6YZtAajt6WPyPswtVVs/VOJ7xpYx3VR31er7gMxNuV9Q443CDlW43KuYSXblsybfKYt58trfez7A1X7Tdm+V7TcoudL+LpVGf2khN63U5OyD5Af0NoUv06l7Jc0Rte+so4xL9Ayy3Rz+SufY5Jf267xcm7J4dd3kumIOrmk7Pl549bUY1puI91Gdb8Tpu+9tjmhXFdwtfVsTv5SQvXKW0cK4eXgPBO6iJ07NNVOHH7/tF1jyJdnWbrU/Uau3VNI156QZ2ZaZFu76i6vQXy9YJ2H9QZ97aF3p1xlx1yfuYRcd0Kl7NyaX190+pUOKI0tvus5j7/nSWKLo3FER8R3LHEx8gqwge1POgi1l1yfirV3zHpISHxs3vLeFXOellcG1DFGbGP00PPkeKEOaXIsqhzbruOh9Qk5L08nW2grJ0avsvWocv0zRh/fGCG0TV35hB4v0rds5Vddjm/sFCKx+aXSt2yalPZsolxXW46CDnXp0YQ0rdso9OUYPSYT6+yzuxxzlrVfFfavQ/LKqsP+dbVzE/0qRb8pKin6V9U6Fnn24pqHufLMWy90nV+0DkXmcrb0Uq+6pU7/qcs/67SHTeTaaBk9ipyXQvLqW1U7uPKpux/ESlP9umydR8H3UjzHoXxj0/J1Yr5ubHsPrWOJqxK+hk5r+EVtH3pe1XWIXa+1vQ9YJ/oZre1bGReh3xKWeX7BxfYstwh5errGJi59be8482cSsfUPQT4Xlc9K+XMmatcY0fo2+SxYQs/4XO8M03Ng/TxujYH+FRELSdH+6mtveu8itb1Cy7C9X8GfsVOcfN86RHg56wJ0ob5qOz/E/rIdq7YhF34/0cfoeWKVftJjIbWDbDfXeXR/prBOKWJ/3dd43+sr+32TvgEIEZ6/7Zt5/l7ghMm77u+ey4gcz5xfktA5vE9C5vy2Y3lpXeX40tHcLMX42qZHS/ltZluXiSlDxillt3VdIvufbc0j75wy5aWaOxWRUZmfl5nDSh3LzoWbXJOg8uumKkndp1PnH2IPfe+U33z7vjWhdPQuWMh4raqxWMh9X89RZtSZ7/JpyXs3NWQcETN3CZHU/lmVnstZB1+ZfM5A/1VJ2V9t8wTXN1S+f27mzaulbCxJHePwC1Tz/0K1/VdPvtOsba+vL7ZxM1/jakJ/V9/yfdtNx+i7bhVRRll/rrK+sk3qLt/3T0afH+tzz1HDfxzZ/HlGDduK1y/GL21zvKptQGWFSpVlFm0z+ZxD/vdAt9EqQ971NkRHW7qytog53+cfVfeFGLStfddfYka5x6dl+yi//4z6/559aUn4/+/k2pv8BqfM/0qVCnu+If2OJPRZUcyzJF/5RQm5xtM9ln+LRN+8U9+iMQS1Veg9q2z/TlV3Ett3/rLOIXOookidy/5X3GYD+S8a1z2e0vH695T9vhEqdbY//0dU3jWZ2rYq/cvCRT8r08/NLlT5/zySdSurv1ybLiup5tAp5+NNzfPJ5r61warapajItfTQNeK610/rWEMPyb+uOo/ierRNbGU01Z+rqneIPWNsT9t1rD+OYr8rm0eKvp/Ch1P4Yepyy+hWVD/f+VWXX5X+TZdfZZ+KLb9J+S8=","base64"));
  38997. var stateMachine$1 = new StateMachine(useData);
  38998. /**
  38999. * This shaper is an implementation of the Universal Shaping Engine, which
  39000. * uses Unicode data to shape a number of scripts without a dedicated shaping engine.
  39001. * See https://www.microsoft.com/typography/OpenTypeDev/USE/intro.htm.
  39002. */
  39003. var UniversalShaper = (_temp$3 = _class$7 = function (_DefaultShaper) {
  39004. _inherits(UniversalShaper, _DefaultShaper);
  39005. function UniversalShaper() {
  39006. _classCallCheck(this, UniversalShaper);
  39007. return _possibleConstructorReturn(this, _DefaultShaper.apply(this, arguments));
  39008. }
  39009. UniversalShaper.planFeatures = function planFeatures(plan) {
  39010. plan.addStage(setupSyllables$1);
  39011. // Default glyph pre-processing group
  39012. plan.addStage(['locl', 'ccmp', 'nukt', 'akhn']);
  39013. // Reordering group
  39014. plan.addStage(clearSubstitutionFlags);
  39015. plan.addStage(['rphf'], false);
  39016. plan.addStage(recordRphf);
  39017. plan.addStage(clearSubstitutionFlags);
  39018. plan.addStage(['pref']);
  39019. plan.addStage(recordPref);
  39020. // Orthographic unit shaping group
  39021. plan.addStage(['rkrf', 'abvf', 'blwf', 'half', 'pstf', 'vatu', 'cjct']);
  39022. plan.addStage(reorder);
  39023. // Topographical features
  39024. // Scripts that need this are handled by the Arabic shaper, not implemented here for now.
  39025. // plan.addStage(['isol', 'init', 'medi', 'fina', 'med2', 'fin2', 'fin3'], false);
  39026. // Standard topographic presentation and positional feature application
  39027. plan.addStage(['abvs', 'blws', 'pres', 'psts', 'dist', 'abvm', 'blwm']);
  39028. };
  39029. UniversalShaper.assignFeatures = function assignFeatures(plan, glyphs) {
  39030. var _loop = function _loop(i) {
  39031. var codepoint = glyphs[i].codePoints[0];
  39032. if (decompositions$2[codepoint]) {
  39033. var decomposed = decompositions$2[codepoint].map(function (c) {
  39034. var g = plan.font.glyphForCodePoint(c);
  39035. return new GlyphInfo(plan.font, g.id, [c], glyphs[i].features);
  39036. });
  39037. glyphs.splice.apply(glyphs, [i, 1].concat(decomposed));
  39038. }
  39039. };
  39040. // Decompose split vowels
  39041. // TODO: do this in a more general unicode normalizer
  39042. for (var i = glyphs.length - 1; i >= 0; i--) {
  39043. _loop(i);
  39044. }
  39045. };
  39046. return UniversalShaper;
  39047. }(DefaultShaper), _class$7.zeroMarkWidths = 'BEFORE_GPOS', _temp$3);
  39048. function useCategory(glyph) {
  39049. return trie$2.get(glyph.codePoints[0]);
  39050. }
  39051. var USEInfo = function USEInfo(category, syllableType, syllable) {
  39052. _classCallCheck(this, USEInfo);
  39053. this.category = category;
  39054. this.syllableType = syllableType;
  39055. this.syllable = syllable;
  39056. };
  39057. function setupSyllables$1(font, glyphs) {
  39058. var syllable = 0;
  39059. for (var _iterator = stateMachine$1.match(glyphs.map(useCategory)), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _getIterator(_iterator);;) {
  39060. var _ref;
  39061. if (_isArray) {
  39062. if (_i >= _iterator.length) break;
  39063. _ref = _iterator[_i++];
  39064. } else {
  39065. _i = _iterator.next();
  39066. if (_i.done) break;
  39067. _ref = _i.value;
  39068. }
  39069. var _ref2 = _ref,
  39070. start = _ref2[0],
  39071. end = _ref2[1],
  39072. tags = _ref2[2];
  39073. ++syllable;
  39074. // Create shaper info
  39075. for (var i = start; i <= end; i++) {
  39076. glyphs[i].shaperInfo = new USEInfo(categories$1[useCategory(glyphs[i])], tags[0], syllable);
  39077. }
  39078. // Assign rphf feature
  39079. var limit = glyphs[start].shaperInfo.category === 'R' ? 1 : Math.min(3, end - start);
  39080. for (var _i2 = start; _i2 < start + limit; _i2++) {
  39081. glyphs[_i2].features.rphf = true;
  39082. }
  39083. }
  39084. }
  39085. function clearSubstitutionFlags(font, glyphs) {
  39086. for (var _iterator2 = glyphs, _isArray2 = Array.isArray(_iterator2), _i3 = 0, _iterator2 = _isArray2 ? _iterator2 : _getIterator(_iterator2);;) {
  39087. var _ref3;
  39088. if (_isArray2) {
  39089. if (_i3 >= _iterator2.length) break;
  39090. _ref3 = _iterator2[_i3++];
  39091. } else {
  39092. _i3 = _iterator2.next();
  39093. if (_i3.done) break;
  39094. _ref3 = _i3.value;
  39095. }
  39096. var glyph = _ref3;
  39097. glyph.substituted = false;
  39098. }
  39099. }
  39100. function recordRphf(font, glyphs) {
  39101. for (var _iterator3 = glyphs, _isArray3 = Array.isArray(_iterator3), _i4 = 0, _iterator3 = _isArray3 ? _iterator3 : _getIterator(_iterator3);;) {
  39102. var _ref4;
  39103. if (_isArray3) {
  39104. if (_i4 >= _iterator3.length) break;
  39105. _ref4 = _iterator3[_i4++];
  39106. } else {
  39107. _i4 = _iterator3.next();
  39108. if (_i4.done) break;
  39109. _ref4 = _i4.value;
  39110. }
  39111. var glyph = _ref4;
  39112. if (glyph.substituted && glyph.features.rphf) {
  39113. // Mark a substituted repha.
  39114. glyph.shaperInfo.category = 'R';
  39115. }
  39116. }
  39117. }
  39118. function recordPref(font, glyphs) {
  39119. for (var _iterator4 = glyphs, _isArray4 = Array.isArray(_iterator4), _i5 = 0, _iterator4 = _isArray4 ? _iterator4 : _getIterator(_iterator4);;) {
  39120. var _ref5;
  39121. if (_isArray4) {
  39122. if (_i5 >= _iterator4.length) break;
  39123. _ref5 = _iterator4[_i5++];
  39124. } else {
  39125. _i5 = _iterator4.next();
  39126. if (_i5.done) break;
  39127. _ref5 = _i5.value;
  39128. }
  39129. var glyph = _ref5;
  39130. if (glyph.substituted) {
  39131. // Mark a substituted pref as VPre, as they behave the same way.
  39132. glyph.shaperInfo.category = 'VPre';
  39133. }
  39134. }
  39135. }
  39136. function reorder(font, glyphs) {
  39137. var dottedCircle = font.glyphForCodePoint(0x25cc).id;
  39138. for (var start = 0, end = nextSyllable$1(glyphs, 0); start < glyphs.length; start = end, end = nextSyllable$1(glyphs, start)) {
  39139. var i = void 0,
  39140. j = void 0;
  39141. var info = glyphs[start].shaperInfo;
  39142. var type = info.syllableType;
  39143. // Only a few syllable types need reordering.
  39144. if (type !== 'virama_terminated_cluster' && type !== 'standard_cluster' && type !== 'broken_cluster') {
  39145. continue;
  39146. }
  39147. // Insert a dotted circle glyph in broken clusters.
  39148. if (type === 'broken_cluster' && dottedCircle) {
  39149. var g = new GlyphInfo(font, dottedCircle, [0x25cc]);
  39150. g.shaperInfo = info;
  39151. // Insert after possible Repha.
  39152. for (i = start; i < end && glyphs[i].shaperInfo.category === 'R'; i++) {}
  39153. glyphs.splice(++i, 0, g);
  39154. end++;
  39155. }
  39156. // Move things forward.
  39157. if (info.category === 'R' && end - start > 1) {
  39158. // Got a repha. Reorder it to after first base, before first halant.
  39159. for (i = start + 1; i < end; i++) {
  39160. info = glyphs[i].shaperInfo;
  39161. if (isBase(info) || isHalant(glyphs[i])) {
  39162. // If we hit a halant, move before it; otherwise it's a base: move to it's
  39163. // place, and shift things in between backward.
  39164. if (isHalant(glyphs[i])) {
  39165. i--;
  39166. }
  39167. glyphs.splice.apply(glyphs, [start, 0].concat(glyphs.splice(start + 1, i - start), [glyphs[i]]));
  39168. break;
  39169. }
  39170. }
  39171. }
  39172. // Move things back.
  39173. for (i = start, j = end; i < end; i++) {
  39174. info = glyphs[i].shaperInfo;
  39175. if (isBase(info) || isHalant(glyphs[i])) {
  39176. // If we hit a halant, move after it; otherwise it's a base: move to it's
  39177. // place, and shift things in between backward.
  39178. j = isHalant(glyphs[i]) ? i + 1 : i;
  39179. } else if ((info.category === 'VPre' || info.category === 'VMPre') && j < i) {
  39180. glyphs.splice.apply(glyphs, [j, 1, glyphs[i]].concat(glyphs.splice(j, i - j)));
  39181. }
  39182. }
  39183. }
  39184. }
  39185. function nextSyllable$1(glyphs, start) {
  39186. if (start >= glyphs.length) return start;
  39187. var syllable = glyphs[start].shaperInfo.syllable;
  39188. while (++start < glyphs.length && glyphs[start].shaperInfo.syllable === syllable) {}
  39189. return start;
  39190. }
  39191. function isHalant(glyph) {
  39192. return glyph.shaperInfo.category === 'H' && !glyph.isLigated;
  39193. }
  39194. function isBase(info) {
  39195. return info.category === 'B' || info.category === 'GB';
  39196. }
  39197. var SHAPERS = {
  39198. arab: ArabicShaper, // Arabic
  39199. mong: ArabicShaper, // Mongolian
  39200. syrc: ArabicShaper, // Syriac
  39201. 'nko ': ArabicShaper, // N'Ko
  39202. phag: ArabicShaper, // Phags Pa
  39203. mand: ArabicShaper, // Mandaic
  39204. mani: ArabicShaper, // Manichaean
  39205. phlp: ArabicShaper, // Psalter Pahlavi
  39206. hang: HangulShaper, // Hangul
  39207. bng2: IndicShaper, // Bengali
  39208. beng: IndicShaper, // Bengali
  39209. dev2: IndicShaper, // Devanagari
  39210. deva: IndicShaper, // Devanagari
  39211. gjr2: IndicShaper, // Gujarati
  39212. gujr: IndicShaper, // Gujarati
  39213. guru: IndicShaper, // Gurmukhi
  39214. gur2: IndicShaper, // Gurmukhi
  39215. knda: IndicShaper, // Kannada
  39216. knd2: IndicShaper, // Kannada
  39217. mlm2: IndicShaper, // Malayalam
  39218. mlym: IndicShaper, // Malayalam
  39219. ory2: IndicShaper, // Oriya
  39220. orya: IndicShaper, // Oriya
  39221. taml: IndicShaper, // Tamil
  39222. tml2: IndicShaper, // Tamil
  39223. telu: IndicShaper, // Telugu
  39224. tel2: IndicShaper, // Telugu
  39225. khmr: IndicShaper, // Khmer
  39226. bali: UniversalShaper, // Balinese
  39227. batk: UniversalShaper, // Batak
  39228. brah: UniversalShaper, // Brahmi
  39229. bugi: UniversalShaper, // Buginese
  39230. buhd: UniversalShaper, // Buhid
  39231. cakm: UniversalShaper, // Chakma
  39232. cham: UniversalShaper, // Cham
  39233. dupl: UniversalShaper, // Duployan
  39234. egyp: UniversalShaper, // Egyptian Hieroglyphs
  39235. gran: UniversalShaper, // Grantha
  39236. hano: UniversalShaper, // Hanunoo
  39237. java: UniversalShaper, // Javanese
  39238. kthi: UniversalShaper, // Kaithi
  39239. kali: UniversalShaper, // Kayah Li
  39240. khar: UniversalShaper, // Kharoshthi
  39241. khoj: UniversalShaper, // Khojki
  39242. sind: UniversalShaper, // Khudawadi
  39243. lepc: UniversalShaper, // Lepcha
  39244. limb: UniversalShaper, // Limbu
  39245. mahj: UniversalShaper, // Mahajani
  39246. // mand: UniversalShaper, // Mandaic
  39247. // mani: UniversalShaper, // Manichaean
  39248. mtei: UniversalShaper, // Meitei Mayek
  39249. modi: UniversalShaper, // Modi
  39250. // mong: UniversalShaper, // Mongolian
  39251. // 'nko ': UniversalShaper, // N’Ko
  39252. hmng: UniversalShaper, // Pahawh Hmong
  39253. // phag: UniversalShaper, // Phags-pa
  39254. // phlp: UniversalShaper, // Psalter Pahlavi
  39255. rjng: UniversalShaper, // Rejang
  39256. saur: UniversalShaper, // Saurashtra
  39257. shrd: UniversalShaper, // Sharada
  39258. sidd: UniversalShaper, // Siddham
  39259. sinh: UniversalShaper, // Sinhala
  39260. sund: UniversalShaper, // Sundanese
  39261. sylo: UniversalShaper, // Syloti Nagri
  39262. tglg: UniversalShaper, // Tagalog
  39263. tagb: UniversalShaper, // Tagbanwa
  39264. tale: UniversalShaper, // Tai Le
  39265. lana: UniversalShaper, // Tai Tham
  39266. tavt: UniversalShaper, // Tai Viet
  39267. takr: UniversalShaper, // Takri
  39268. tibt: UniversalShaper, // Tibetan
  39269. tfng: UniversalShaper, // Tifinagh
  39270. tirh: UniversalShaper, // Tirhuta
  39271. latn: DefaultShaper, // Latin
  39272. DFLT: DefaultShaper // Default
  39273. };
  39274. function choose(script) {
  39275. if (!Array.isArray(script)) {
  39276. script = [script];
  39277. }
  39278. for (var _iterator = script, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _getIterator(_iterator);;) {
  39279. var _ref;
  39280. if (_isArray) {
  39281. if (_i >= _iterator.length) break;
  39282. _ref = _iterator[_i++];
  39283. } else {
  39284. _i = _iterator.next();
  39285. if (_i.done) break;
  39286. _ref = _i.value;
  39287. }
  39288. var s = _ref;
  39289. var shaper = SHAPERS[s];
  39290. if (shaper) {
  39291. return shaper;
  39292. }
  39293. }
  39294. return DefaultShaper;
  39295. }
  39296. var GSUBProcessor = function (_OTProcessor) {
  39297. _inherits(GSUBProcessor, _OTProcessor);
  39298. function GSUBProcessor() {
  39299. _classCallCheck(this, GSUBProcessor);
  39300. return _possibleConstructorReturn(this, _OTProcessor.apply(this, arguments));
  39301. }
  39302. GSUBProcessor.prototype.applyLookup = function applyLookup(lookupType, table) {
  39303. var _this2 = this;
  39304. switch (lookupType) {
  39305. case 1:
  39306. {
  39307. // Single Substitution
  39308. var index = this.coverageIndex(table.coverage);
  39309. if (index === -1) {
  39310. return false;
  39311. }
  39312. var glyph = this.glyphIterator.cur;
  39313. switch (table.version) {
  39314. case 1:
  39315. glyph.id = glyph.id + table.deltaGlyphID & 0xffff;
  39316. break;
  39317. case 2:
  39318. glyph.id = table.substitute.get(index);
  39319. break;
  39320. }
  39321. return true;
  39322. }
  39323. case 2:
  39324. {
  39325. // Multiple Substitution
  39326. var _index = this.coverageIndex(table.coverage);
  39327. if (_index !== -1) {
  39328. var _glyphs;
  39329. var sequence = table.sequences.get(_index);
  39330. if (sequence.length === 0) {
  39331. // If the sequence length is zero, delete the glyph.
  39332. // The OpenType spec disallows this, but seems like Harfbuzz and Uniscribe allow it.
  39333. this.glyphs.splice(this.glyphIterator.index, 1);
  39334. return true;
  39335. }
  39336. this.glyphIterator.cur.id = sequence[0];
  39337. this.glyphIterator.cur.ligatureComponent = 0;
  39338. var features = this.glyphIterator.cur.features;
  39339. var curGlyph = this.glyphIterator.cur;
  39340. var replacement = sequence.slice(1).map(function (gid, i) {
  39341. var glyph = new GlyphInfo(_this2.font, gid, undefined, features);
  39342. glyph.shaperInfo = curGlyph.shaperInfo;
  39343. glyph.isLigated = curGlyph.isLigated;
  39344. glyph.ligatureComponent = i + 1;
  39345. glyph.substituted = true;
  39346. glyph.isMultiplied = true;
  39347. return glyph;
  39348. });
  39349. (_glyphs = this.glyphs).splice.apply(_glyphs, [this.glyphIterator.index + 1, 0].concat(replacement));
  39350. return true;
  39351. }
  39352. return false;
  39353. }
  39354. case 3:
  39355. {
  39356. // Alternate Substitution
  39357. var _index2 = this.coverageIndex(table.coverage);
  39358. if (_index2 !== -1) {
  39359. var USER_INDEX = 0; // TODO
  39360. this.glyphIterator.cur.id = table.alternateSet.get(_index2)[USER_INDEX];
  39361. return true;
  39362. }
  39363. return false;
  39364. }
  39365. case 4:
  39366. {
  39367. // Ligature Substitution
  39368. var _index3 = this.coverageIndex(table.coverage);
  39369. if (_index3 === -1) {
  39370. return false;
  39371. }
  39372. for (var _iterator = table.ligatureSets.get(_index3), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _getIterator(_iterator);;) {
  39373. var _ref;
  39374. if (_isArray) {
  39375. if (_i >= _iterator.length) break;
  39376. _ref = _iterator[_i++];
  39377. } else {
  39378. _i = _iterator.next();
  39379. if (_i.done) break;
  39380. _ref = _i.value;
  39381. }
  39382. var ligature = _ref;
  39383. var matched = this.sequenceMatchIndices(1, ligature.components);
  39384. if (!matched) {
  39385. continue;
  39386. }
  39387. var _curGlyph = this.glyphIterator.cur;
  39388. // Concatenate all of the characters the new ligature will represent
  39389. var characters = _curGlyph.codePoints.slice();
  39390. for (var _iterator2 = matched, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _getIterator(_iterator2);;) {
  39391. var _ref2;
  39392. if (_isArray2) {
  39393. if (_i2 >= _iterator2.length) break;
  39394. _ref2 = _iterator2[_i2++];
  39395. } else {
  39396. _i2 = _iterator2.next();
  39397. if (_i2.done) break;
  39398. _ref2 = _i2.value;
  39399. }
  39400. var _index4 = _ref2;
  39401. characters.push.apply(characters, this.glyphs[_index4].codePoints);
  39402. }
  39403. // Create the replacement ligature glyph
  39404. var ligatureGlyph = new GlyphInfo(this.font, ligature.glyph, characters, _curGlyph.features);
  39405. ligatureGlyph.shaperInfo = _curGlyph.shaperInfo;
  39406. ligatureGlyph.isLigated = true;
  39407. ligatureGlyph.substituted = true;
  39408. // From Harfbuzz:
  39409. // - If it *is* a mark ligature, we don't allocate a new ligature id, and leave
  39410. // the ligature to keep its old ligature id. This will allow it to attach to
  39411. // a base ligature in GPOS. Eg. if the sequence is: LAM,LAM,SHADDA,FATHA,HEH,
  39412. // and LAM,LAM,HEH for a ligature, they will leave SHADDA and FATHA with a
  39413. // ligature id and component value of 2. Then if SHADDA,FATHA form a ligature
  39414. // later, we don't want them to lose their ligature id/component, otherwise
  39415. // GPOS will fail to correctly position the mark ligature on top of the
  39416. // LAM,LAM,HEH ligature. See https://bugzilla.gnome.org/show_bug.cgi?id=676343
  39417. //
  39418. // - If a ligature is formed of components that some of which are also ligatures
  39419. // themselves, and those ligature components had marks attached to *their*
  39420. // components, we have to attach the marks to the new ligature component
  39421. // positions! Now *that*'s tricky! And these marks may be following the
  39422. // last component of the whole sequence, so we should loop forward looking
  39423. // for them and update them.
  39424. //
  39425. // Eg. the sequence is LAM,LAM,SHADDA,FATHA,HEH, and the font first forms a
  39426. // 'calt' ligature of LAM,HEH, leaving the SHADDA and FATHA with a ligature
  39427. // id and component == 1. Now, during 'liga', the LAM and the LAM-HEH ligature
  39428. // form a LAM-LAM-HEH ligature. We need to reassign the SHADDA and FATHA to
  39429. // the new ligature with a component value of 2.
  39430. //
  39431. // This in fact happened to a font... See https://bugzilla.gnome.org/show_bug.cgi?id=437633
  39432. var isMarkLigature = _curGlyph.isMark;
  39433. for (var i = 0; i < matched.length && isMarkLigature; i++) {
  39434. isMarkLigature = this.glyphs[matched[i]].isMark;
  39435. }
  39436. ligatureGlyph.ligatureID = isMarkLigature ? null : this.ligatureID++;
  39437. var lastLigID = _curGlyph.ligatureID;
  39438. var lastNumComps = _curGlyph.codePoints.length;
  39439. var curComps = lastNumComps;
  39440. var idx = this.glyphIterator.index + 1;
  39441. // Set ligatureID and ligatureComponent on glyphs that were skipped in the matched sequence.
  39442. // This allows GPOS to attach marks to the correct ligature components.
  39443. for (var _iterator3 = matched, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _getIterator(_iterator3);;) {
  39444. var _ref3;
  39445. if (_isArray3) {
  39446. if (_i3 >= _iterator3.length) break;
  39447. _ref3 = _iterator3[_i3++];
  39448. } else {
  39449. _i3 = _iterator3.next();
  39450. if (_i3.done) break;
  39451. _ref3 = _i3.value;
  39452. }
  39453. var matchIndex = _ref3;
  39454. // Don't assign new ligature components for mark ligatures (see above)
  39455. if (isMarkLigature) {
  39456. idx = matchIndex;
  39457. } else {
  39458. while (idx < matchIndex) {
  39459. var ligatureComponent = curComps - lastNumComps + Math.min(this.glyphs[idx].ligatureComponent || 1, lastNumComps);
  39460. this.glyphs[idx].ligatureID = ligatureGlyph.ligatureID;
  39461. this.glyphs[idx].ligatureComponent = ligatureComponent;
  39462. idx++;
  39463. }
  39464. }
  39465. lastLigID = this.glyphs[idx].ligatureID;
  39466. lastNumComps = this.glyphs[idx].codePoints.length;
  39467. curComps += lastNumComps;
  39468. idx++; // skip base glyph
  39469. }
  39470. // Adjust ligature components for any marks following
  39471. if (lastLigID && !isMarkLigature) {
  39472. for (var _i4 = idx; _i4 < this.glyphs.length; _i4++) {
  39473. if (this.glyphs[_i4].ligatureID === lastLigID) {
  39474. var ligatureComponent = curComps - lastNumComps + Math.min(this.glyphs[_i4].ligatureComponent || 1, lastNumComps);
  39475. this.glyphs[_i4].ligatureComponent = ligatureComponent;
  39476. } else {
  39477. break;
  39478. }
  39479. }
  39480. }
  39481. // Delete the matched glyphs, and replace the current glyph with the ligature glyph
  39482. for (var _i5 = matched.length - 1; _i5 >= 0; _i5--) {
  39483. this.glyphs.splice(matched[_i5], 1);
  39484. }
  39485. this.glyphs[this.glyphIterator.index] = ligatureGlyph;
  39486. return true;
  39487. }
  39488. return false;
  39489. }
  39490. case 5:
  39491. // Contextual Substitution
  39492. return this.applyContext(table);
  39493. case 6:
  39494. // Chaining Contextual Substitution
  39495. return this.applyChainingContext(table);
  39496. case 7:
  39497. // Extension Substitution
  39498. return this.applyLookup(table.lookupType, table.extension);
  39499. default:
  39500. throw new Error('GSUB lookupType ' + lookupType + ' is not supported');
  39501. }
  39502. };
  39503. return GSUBProcessor;
  39504. }(OTProcessor);
  39505. var GPOSProcessor = function (_OTProcessor) {
  39506. _inherits(GPOSProcessor, _OTProcessor);
  39507. function GPOSProcessor() {
  39508. _classCallCheck(this, GPOSProcessor);
  39509. return _possibleConstructorReturn(this, _OTProcessor.apply(this, arguments));
  39510. }
  39511. GPOSProcessor.prototype.applyPositionValue = function applyPositionValue(sequenceIndex, value) {
  39512. var position = this.positions[this.glyphIterator.peekIndex(sequenceIndex)];
  39513. if (value.xAdvance != null) {
  39514. position.xAdvance += value.xAdvance;
  39515. }
  39516. if (value.yAdvance != null) {
  39517. position.yAdvance += value.yAdvance;
  39518. }
  39519. if (value.xPlacement != null) {
  39520. position.xOffset += value.xPlacement;
  39521. }
  39522. if (value.yPlacement != null) {
  39523. position.yOffset += value.yPlacement;
  39524. }
  39525. // Adjustments for font variations
  39526. var variationProcessor = this.font._variationProcessor;
  39527. var variationStore = this.font.GDEF && this.font.GDEF.itemVariationStore;
  39528. if (variationProcessor && variationStore) {
  39529. if (value.xPlaDevice) {
  39530. position.xOffset += variationProcessor.getDelta(variationStore, value.xPlaDevice.a, value.xPlaDevice.b);
  39531. }
  39532. if (value.yPlaDevice) {
  39533. position.yOffset += variationProcessor.getDelta(variationStore, value.yPlaDevice.a, value.yPlaDevice.b);
  39534. }
  39535. if (value.xAdvDevice) {
  39536. position.xAdvance += variationProcessor.getDelta(variationStore, value.xAdvDevice.a, value.xAdvDevice.b);
  39537. }
  39538. if (value.yAdvDevice) {
  39539. position.yAdvance += variationProcessor.getDelta(variationStore, value.yAdvDevice.a, value.yAdvDevice.b);
  39540. }
  39541. }
  39542. // TODO: device tables
  39543. };
  39544. GPOSProcessor.prototype.applyLookup = function applyLookup(lookupType, table) {
  39545. switch (lookupType) {
  39546. case 1:
  39547. {
  39548. // Single positioning value
  39549. var index = this.coverageIndex(table.coverage);
  39550. if (index === -1) {
  39551. return false;
  39552. }
  39553. switch (table.version) {
  39554. case 1:
  39555. this.applyPositionValue(0, table.value);
  39556. break;
  39557. case 2:
  39558. this.applyPositionValue(0, table.values.get(index));
  39559. break;
  39560. }
  39561. return true;
  39562. }
  39563. case 2:
  39564. {
  39565. // Pair Adjustment Positioning
  39566. var nextGlyph = this.glyphIterator.peek();
  39567. if (!nextGlyph) {
  39568. return false;
  39569. }
  39570. var _index = this.coverageIndex(table.coverage);
  39571. if (_index === -1) {
  39572. return false;
  39573. }
  39574. switch (table.version) {
  39575. case 1:
  39576. // Adjustments for glyph pairs
  39577. var set = table.pairSets.get(_index);
  39578. for (var _iterator = set, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _getIterator(_iterator);;) {
  39579. var _ref;
  39580. if (_isArray) {
  39581. if (_i >= _iterator.length) break;
  39582. _ref = _iterator[_i++];
  39583. } else {
  39584. _i = _iterator.next();
  39585. if (_i.done) break;
  39586. _ref = _i.value;
  39587. }
  39588. var _pair = _ref;
  39589. if (_pair.secondGlyph === nextGlyph.id) {
  39590. this.applyPositionValue(0, _pair.value1);
  39591. this.applyPositionValue(1, _pair.value2);
  39592. return true;
  39593. }
  39594. }
  39595. return false;
  39596. case 2:
  39597. // Class pair adjustment
  39598. var class1 = this.getClassID(this.glyphIterator.cur.id, table.classDef1);
  39599. var class2 = this.getClassID(nextGlyph.id, table.classDef2);
  39600. if (class1 === -1 || class2 === -1) {
  39601. return false;
  39602. }
  39603. var pair = table.classRecords.get(class1).get(class2);
  39604. this.applyPositionValue(0, pair.value1);
  39605. this.applyPositionValue(1, pair.value2);
  39606. return true;
  39607. }
  39608. }
  39609. case 3:
  39610. {
  39611. // Cursive Attachment Positioning
  39612. var nextIndex = this.glyphIterator.peekIndex();
  39613. var _nextGlyph = this.glyphs[nextIndex];
  39614. if (!_nextGlyph) {
  39615. return false;
  39616. }
  39617. var curRecord = table.entryExitRecords[this.coverageIndex(table.coverage)];
  39618. if (!curRecord || !curRecord.exitAnchor) {
  39619. return false;
  39620. }
  39621. var nextRecord = table.entryExitRecords[this.coverageIndex(table.coverage, _nextGlyph.id)];
  39622. if (!nextRecord || !nextRecord.entryAnchor) {
  39623. return false;
  39624. }
  39625. var entry = this.getAnchor(nextRecord.entryAnchor);
  39626. var exit = this.getAnchor(curRecord.exitAnchor);
  39627. var cur = this.positions[this.glyphIterator.index];
  39628. var next = this.positions[nextIndex];
  39629. switch (this.direction) {
  39630. case 'ltr':
  39631. cur.xAdvance = exit.x + cur.xOffset;
  39632. var d = entry.x + next.xOffset;
  39633. next.xAdvance -= d;
  39634. next.xOffset -= d;
  39635. break;
  39636. case 'rtl':
  39637. d = exit.x + cur.xOffset;
  39638. cur.xAdvance -= d;
  39639. cur.xOffset -= d;
  39640. next.xAdvance = entry.x + next.xOffset;
  39641. break;
  39642. }
  39643. if (this.glyphIterator.flags.rightToLeft) {
  39644. this.glyphIterator.cur.cursiveAttachment = nextIndex;
  39645. cur.yOffset = entry.y - exit.y;
  39646. } else {
  39647. _nextGlyph.cursiveAttachment = this.glyphIterator.index;
  39648. cur.yOffset = exit.y - entry.y;
  39649. }
  39650. return true;
  39651. }
  39652. case 4:
  39653. {
  39654. // Mark to base positioning
  39655. var markIndex = this.coverageIndex(table.markCoverage);
  39656. if (markIndex === -1) {
  39657. return false;
  39658. }
  39659. // search backward for a base glyph
  39660. var baseGlyphIndex = this.glyphIterator.index;
  39661. while (--baseGlyphIndex >= 0 && (this.glyphs[baseGlyphIndex].isMark || this.glyphs[baseGlyphIndex].ligatureComponent > 0)) {}
  39662. if (baseGlyphIndex < 0) {
  39663. return false;
  39664. }
  39665. var baseIndex = this.coverageIndex(table.baseCoverage, this.glyphs[baseGlyphIndex].id);
  39666. if (baseIndex === -1) {
  39667. return false;
  39668. }
  39669. var markRecord = table.markArray[markIndex];
  39670. var baseAnchor = table.baseArray[baseIndex][markRecord.class];
  39671. this.applyAnchor(markRecord, baseAnchor, baseGlyphIndex);
  39672. return true;
  39673. }
  39674. case 5:
  39675. {
  39676. // Mark to ligature positioning
  39677. var _markIndex = this.coverageIndex(table.markCoverage);
  39678. if (_markIndex === -1) {
  39679. return false;
  39680. }
  39681. // search backward for a base glyph
  39682. var _baseGlyphIndex = this.glyphIterator.index;
  39683. while (--_baseGlyphIndex >= 0 && this.glyphs[_baseGlyphIndex].isMark) {}
  39684. if (_baseGlyphIndex < 0) {
  39685. return false;
  39686. }
  39687. var ligIndex = this.coverageIndex(table.ligatureCoverage, this.glyphs[_baseGlyphIndex].id);
  39688. if (ligIndex === -1) {
  39689. return false;
  39690. }
  39691. var ligAttach = table.ligatureArray[ligIndex];
  39692. var markGlyph = this.glyphIterator.cur;
  39693. var ligGlyph = this.glyphs[_baseGlyphIndex];
  39694. var compIndex = ligGlyph.ligatureID && ligGlyph.ligatureID === markGlyph.ligatureID && markGlyph.ligatureComponent > 0 ? Math.min(markGlyph.ligatureComponent, ligGlyph.codePoints.length) - 1 : ligGlyph.codePoints.length - 1;
  39695. var _markRecord = table.markArray[_markIndex];
  39696. var _baseAnchor = ligAttach[compIndex][_markRecord.class];
  39697. this.applyAnchor(_markRecord, _baseAnchor, _baseGlyphIndex);
  39698. return true;
  39699. }
  39700. case 6:
  39701. {
  39702. // Mark to mark positioning
  39703. var mark1Index = this.coverageIndex(table.mark1Coverage);
  39704. if (mark1Index === -1) {
  39705. return false;
  39706. }
  39707. // get the previous mark to attach to
  39708. var prevIndex = this.glyphIterator.peekIndex(-1);
  39709. var prev = this.glyphs[prevIndex];
  39710. if (!prev || !prev.isMark) {
  39711. return false;
  39712. }
  39713. var _cur = this.glyphIterator.cur;
  39714. // The following logic was borrowed from Harfbuzz
  39715. var good = false;
  39716. if (_cur.ligatureID === prev.ligatureID) {
  39717. if (!_cur.ligatureID) {
  39718. // Marks belonging to the same base
  39719. good = true;
  39720. } else if (_cur.ligatureComponent === prev.ligatureComponent) {
  39721. // Marks belonging to the same ligature component
  39722. good = true;
  39723. }
  39724. } else {
  39725. // If ligature ids don't match, it may be the case that one of the marks
  39726. // itself is a ligature, in which case match.
  39727. if (_cur.ligatureID && !_cur.ligatureComponent || prev.ligatureID && !prev.ligatureComponent) {
  39728. good = true;
  39729. }
  39730. }
  39731. if (!good) {
  39732. return false;
  39733. }
  39734. var mark2Index = this.coverageIndex(table.mark2Coverage, prev.id);
  39735. if (mark2Index === -1) {
  39736. return false;
  39737. }
  39738. var _markRecord2 = table.mark1Array[mark1Index];
  39739. var _baseAnchor2 = table.mark2Array[mark2Index][_markRecord2.class];
  39740. this.applyAnchor(_markRecord2, _baseAnchor2, prevIndex);
  39741. return true;
  39742. }
  39743. case 7:
  39744. // Contextual positioning
  39745. return this.applyContext(table);
  39746. case 8:
  39747. // Chaining contextual positioning
  39748. return this.applyChainingContext(table);
  39749. case 9:
  39750. // Extension positioning
  39751. return this.applyLookup(table.lookupType, table.extension);
  39752. default:
  39753. throw new Error('Unsupported GPOS table: ' + lookupType);
  39754. }
  39755. };
  39756. GPOSProcessor.prototype.applyAnchor = function applyAnchor(markRecord, baseAnchor, baseGlyphIndex) {
  39757. var baseCoords = this.getAnchor(baseAnchor);
  39758. var markCoords = this.getAnchor(markRecord.markAnchor);
  39759. var basePos = this.positions[baseGlyphIndex];
  39760. var markPos = this.positions[this.glyphIterator.index];
  39761. markPos.xOffset = baseCoords.x - markCoords.x;
  39762. markPos.yOffset = baseCoords.y - markCoords.y;
  39763. this.glyphIterator.cur.markAttachment = baseGlyphIndex;
  39764. };
  39765. GPOSProcessor.prototype.getAnchor = function getAnchor(anchor) {
  39766. // TODO: contour point, device tables
  39767. var x = anchor.xCoordinate;
  39768. var y = anchor.yCoordinate;
  39769. // Adjustments for font variations
  39770. var variationProcessor = this.font._variationProcessor;
  39771. var variationStore = this.font.GDEF && this.font.GDEF.itemVariationStore;
  39772. if (variationProcessor && variationStore) {
  39773. if (anchor.xDeviceTable) {
  39774. x += variationProcessor.getDelta(variationStore, anchor.xDeviceTable.a, anchor.xDeviceTable.b);
  39775. }
  39776. if (anchor.yDeviceTable) {
  39777. y += variationProcessor.getDelta(variationStore, anchor.yDeviceTable.a, anchor.yDeviceTable.b);
  39778. }
  39779. }
  39780. return { x: x, y: y };
  39781. };
  39782. GPOSProcessor.prototype.applyFeatures = function applyFeatures(userFeatures, glyphs, advances) {
  39783. _OTProcessor.prototype.applyFeatures.call(this, userFeatures, glyphs, advances);
  39784. for (var i = 0; i < this.glyphs.length; i++) {
  39785. this.fixCursiveAttachment(i);
  39786. }
  39787. this.fixMarkAttachment();
  39788. };
  39789. GPOSProcessor.prototype.fixCursiveAttachment = function fixCursiveAttachment(i) {
  39790. var glyph = this.glyphs[i];
  39791. if (glyph.cursiveAttachment != null) {
  39792. var j = glyph.cursiveAttachment;
  39793. glyph.cursiveAttachment = null;
  39794. this.fixCursiveAttachment(j);
  39795. this.positions[i].yOffset += this.positions[j].yOffset;
  39796. }
  39797. };
  39798. GPOSProcessor.prototype.fixMarkAttachment = function fixMarkAttachment() {
  39799. for (var i = 0; i < this.glyphs.length; i++) {
  39800. var glyph = this.glyphs[i];
  39801. if (glyph.markAttachment != null) {
  39802. var j = glyph.markAttachment;
  39803. this.positions[i].xOffset += this.positions[j].xOffset;
  39804. this.positions[i].yOffset += this.positions[j].yOffset;
  39805. if (this.direction === 'ltr') {
  39806. for (var k = j; k < i; k++) {
  39807. this.positions[i].xOffset -= this.positions[k].xAdvance;
  39808. this.positions[i].yOffset -= this.positions[k].yAdvance;
  39809. }
  39810. } else {
  39811. for (var _k = j + 1; _k < i + 1; _k++) {
  39812. this.positions[i].xOffset += this.positions[_k].xAdvance;
  39813. this.positions[i].yOffset += this.positions[_k].yAdvance;
  39814. }
  39815. }
  39816. }
  39817. }
  39818. };
  39819. return GPOSProcessor;
  39820. }(OTProcessor);
  39821. var OTLayoutEngine = function () {
  39822. function OTLayoutEngine(font) {
  39823. _classCallCheck(this, OTLayoutEngine);
  39824. this.font = font;
  39825. this.glyphInfos = null;
  39826. this.plan = null;
  39827. this.GSUBProcessor = null;
  39828. this.GPOSProcessor = null;
  39829. this.fallbackPosition = true;
  39830. if (font.GSUB) {
  39831. this.GSUBProcessor = new GSUBProcessor(font, font.GSUB);
  39832. }
  39833. if (font.GPOS) {
  39834. this.GPOSProcessor = new GPOSProcessor(font, font.GPOS);
  39835. }
  39836. }
  39837. OTLayoutEngine.prototype.setup = function setup(glyphRun) {
  39838. var _this = this;
  39839. // Map glyphs to GlyphInfo objects so data can be passed between
  39840. // GSUB and GPOS without mutating the real (shared) Glyph objects.
  39841. this.glyphInfos = glyphRun.glyphs.map(function (glyph) {
  39842. return new GlyphInfo(_this.font, glyph.id, [].concat(glyph.codePoints));
  39843. });
  39844. // Select a script based on what is available in GSUB/GPOS.
  39845. var script = null;
  39846. if (this.GPOSProcessor) {
  39847. script = this.GPOSProcessor.selectScript(glyphRun.script, glyphRun.language, glyphRun.direction);
  39848. }
  39849. if (this.GSUBProcessor) {
  39850. script = this.GSUBProcessor.selectScript(glyphRun.script, glyphRun.language, glyphRun.direction);
  39851. }
  39852. // Choose a shaper based on the script, and setup a shaping plan.
  39853. // This determines which features to apply to which glyphs.
  39854. this.shaper = choose(script);
  39855. this.plan = new ShapingPlan(this.font, script, glyphRun.direction);
  39856. this.shaper.plan(this.plan, this.glyphInfos, glyphRun.features);
  39857. // Assign chosen features to output glyph run
  39858. for (var key in this.plan.allFeatures) {
  39859. glyphRun.features[key] = true;
  39860. }
  39861. };
  39862. OTLayoutEngine.prototype.substitute = function substitute(glyphRun) {
  39863. var _this2 = this;
  39864. if (this.GSUBProcessor) {
  39865. this.plan.process(this.GSUBProcessor, this.glyphInfos);
  39866. // Map glyph infos back to normal Glyph objects
  39867. glyphRun.glyphs = this.glyphInfos.map(function (glyphInfo) {
  39868. return _this2.font.getGlyph(glyphInfo.id, glyphInfo.codePoints);
  39869. });
  39870. }
  39871. };
  39872. OTLayoutEngine.prototype.position = function position(glyphRun) {
  39873. if (this.shaper.zeroMarkWidths === 'BEFORE_GPOS') {
  39874. this.zeroMarkAdvances(glyphRun.positions);
  39875. }
  39876. if (this.GPOSProcessor) {
  39877. this.plan.process(this.GPOSProcessor, this.glyphInfos, glyphRun.positions);
  39878. }
  39879. if (this.shaper.zeroMarkWidths === 'AFTER_GPOS') {
  39880. this.zeroMarkAdvances(glyphRun.positions);
  39881. }
  39882. // Reverse the glyphs and positions if the script is right-to-left
  39883. if (glyphRun.direction === 'rtl') {
  39884. glyphRun.glyphs.reverse();
  39885. glyphRun.positions.reverse();
  39886. }
  39887. return this.GPOSProcessor && this.GPOSProcessor.features;
  39888. };
  39889. OTLayoutEngine.prototype.zeroMarkAdvances = function zeroMarkAdvances(positions) {
  39890. for (var i = 0; i < this.glyphInfos.length; i++) {
  39891. if (this.glyphInfos[i].isMark) {
  39892. positions[i].xAdvance = 0;
  39893. positions[i].yAdvance = 0;
  39894. }
  39895. }
  39896. };
  39897. OTLayoutEngine.prototype.cleanup = function cleanup() {
  39898. this.glyphInfos = null;
  39899. this.plan = null;
  39900. this.shaper = null;
  39901. };
  39902. OTLayoutEngine.prototype.getAvailableFeatures = function getAvailableFeatures(script, language) {
  39903. var features = [];
  39904. if (this.GSUBProcessor) {
  39905. this.GSUBProcessor.selectScript(script, language);
  39906. features.push.apply(features, _Object$keys(this.GSUBProcessor.features));
  39907. }
  39908. if (this.GPOSProcessor) {
  39909. this.GPOSProcessor.selectScript(script, language);
  39910. features.push.apply(features, _Object$keys(this.GPOSProcessor.features));
  39911. }
  39912. return features;
  39913. };
  39914. return OTLayoutEngine;
  39915. }();
  39916. var LayoutEngine = function () {
  39917. function LayoutEngine(font) {
  39918. _classCallCheck(this, LayoutEngine);
  39919. this.font = font;
  39920. this.unicodeLayoutEngine = null;
  39921. this.kernProcessor = null;
  39922. // Choose an advanced layout engine. We try the AAT morx table first since more
  39923. // scripts are currently supported because the shaping logic is built into the font.
  39924. if (this.font.morx) {
  39925. this.engine = new AATLayoutEngine(this.font);
  39926. } else if (this.font.GSUB || this.font.GPOS) {
  39927. this.engine = new OTLayoutEngine(this.font);
  39928. }
  39929. }
  39930. LayoutEngine.prototype.layout = function layout(string, features, script, language, direction) {
  39931. // Make the features parameter optional
  39932. if (typeof features === 'string') {
  39933. direction = language;
  39934. language = script;
  39935. script = features;
  39936. features = [];
  39937. }
  39938. // Map string to glyphs if needed
  39939. if (typeof string === 'string') {
  39940. // Attempt to detect the script from the string if not provided.
  39941. if (script == null) {
  39942. script = forString(string);
  39943. }
  39944. var glyphs = this.font.glyphsForString(string);
  39945. } else {
  39946. // Attempt to detect the script from the glyph code points if not provided.
  39947. if (script == null) {
  39948. var codePoints = [];
  39949. for (var _iterator = string, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _getIterator(_iterator);;) {
  39950. var _ref;
  39951. if (_isArray) {
  39952. if (_i >= _iterator.length) break;
  39953. _ref = _iterator[_i++];
  39954. } else {
  39955. _i = _iterator.next();
  39956. if (_i.done) break;
  39957. _ref = _i.value;
  39958. }
  39959. var glyph = _ref;
  39960. codePoints.push.apply(codePoints, glyph.codePoints);
  39961. }
  39962. script = forCodePoints(codePoints);
  39963. }
  39964. var glyphs = string;
  39965. }
  39966. var glyphRun = new GlyphRun(glyphs, features, script, language, direction);
  39967. // Return early if there are no glyphs
  39968. if (glyphs.length === 0) {
  39969. glyphRun.positions = [];
  39970. return glyphRun;
  39971. }
  39972. // Setup the advanced layout engine
  39973. if (this.engine && this.engine.setup) {
  39974. this.engine.setup(glyphRun);
  39975. }
  39976. // Substitute and position the glyphs
  39977. this.substitute(glyphRun);
  39978. this.position(glyphRun);
  39979. this.hideDefaultIgnorables(glyphRun.glyphs, glyphRun.positions);
  39980. // Let the layout engine clean up any state it might have
  39981. if (this.engine && this.engine.cleanup) {
  39982. this.engine.cleanup();
  39983. }
  39984. return glyphRun;
  39985. };
  39986. LayoutEngine.prototype.substitute = function substitute(glyphRun) {
  39987. // Call the advanced layout engine to make substitutions
  39988. if (this.engine && this.engine.substitute) {
  39989. this.engine.substitute(glyphRun);
  39990. }
  39991. };
  39992. LayoutEngine.prototype.position = function position(glyphRun) {
  39993. // Get initial glyph positions
  39994. glyphRun.positions = glyphRun.glyphs.map(function (glyph) {
  39995. return new GlyphPosition(glyph.advanceWidth);
  39996. });
  39997. var positioned = null;
  39998. // Call the advanced layout engine. Returns the features applied.
  39999. if (this.engine && this.engine.position) {
  40000. positioned = this.engine.position(glyphRun);
  40001. }
  40002. // if there is no GPOS table, use unicode properties to position marks.
  40003. if (!positioned && (!this.engine || this.engine.fallbackPosition)) {
  40004. if (!this.unicodeLayoutEngine) {
  40005. this.unicodeLayoutEngine = new UnicodeLayoutEngine(this.font);
  40006. }
  40007. this.unicodeLayoutEngine.positionGlyphs(glyphRun.glyphs, glyphRun.positions);
  40008. }
  40009. // if kerning is not supported by GPOS, do kerning with the TrueType/AAT kern table
  40010. if ((!positioned || !positioned.kern) && glyphRun.features.kern !== false && this.font.kern) {
  40011. if (!this.kernProcessor) {
  40012. this.kernProcessor = new KernProcessor(this.font);
  40013. }
  40014. this.kernProcessor.process(glyphRun.glyphs, glyphRun.positions);
  40015. glyphRun.features.kern = true;
  40016. }
  40017. };
  40018. LayoutEngine.prototype.hideDefaultIgnorables = function hideDefaultIgnorables(glyphs, positions) {
  40019. var space = this.font.glyphForCodePoint(0x20);
  40020. for (var i = 0; i < glyphs.length; i++) {
  40021. if (this.isDefaultIgnorable(glyphs[i].codePoints[0])) {
  40022. glyphs[i] = space;
  40023. positions[i].xAdvance = 0;
  40024. positions[i].yAdvance = 0;
  40025. }
  40026. }
  40027. };
  40028. LayoutEngine.prototype.isDefaultIgnorable = function isDefaultIgnorable(ch) {
  40029. // From DerivedCoreProperties.txt in the Unicode database,
  40030. // minus U+115F, U+1160, U+3164 and U+FFA0, which is what
  40031. // Harfbuzz and Uniscribe do.
  40032. var plane = ch >> 16;
  40033. if (plane === 0) {
  40034. // BMP
  40035. switch (ch >> 8) {
  40036. case 0x00:
  40037. return ch === 0x00AD;
  40038. case 0x03:
  40039. return ch === 0x034F;
  40040. case 0x06:
  40041. return ch === 0x061C;
  40042. case 0x17:
  40043. return 0x17B4 <= ch && ch <= 0x17B5;
  40044. case 0x18:
  40045. return 0x180B <= ch && ch <= 0x180E;
  40046. case 0x20:
  40047. return 0x200B <= ch && ch <= 0x200F || 0x202A <= ch && ch <= 0x202E || 0x2060 <= ch && ch <= 0x206F;
  40048. case 0xFE:
  40049. return 0xFE00 <= ch && ch <= 0xFE0F || ch === 0xFEFF;
  40050. case 0xFF:
  40051. return 0xFFF0 <= ch && ch <= 0xFFF8;
  40052. default:
  40053. return false;
  40054. }
  40055. } else {
  40056. // Other planes
  40057. switch (plane) {
  40058. case 0x01:
  40059. return 0x1BCA0 <= ch && ch <= 0x1BCA3 || 0x1D173 <= ch && ch <= 0x1D17A;
  40060. case 0x0E:
  40061. return 0xE0000 <= ch && ch <= 0xE0FFF;
  40062. default:
  40063. return false;
  40064. }
  40065. }
  40066. };
  40067. LayoutEngine.prototype.getAvailableFeatures = function getAvailableFeatures(script, language) {
  40068. var features = [];
  40069. if (this.engine) {
  40070. features.push.apply(features, this.engine.getAvailableFeatures(script, language));
  40071. }
  40072. if (this.font.kern && features.indexOf('kern') === -1) {
  40073. features.push('kern');
  40074. }
  40075. return features;
  40076. };
  40077. LayoutEngine.prototype.stringsForGlyph = function stringsForGlyph(gid) {
  40078. var result = new _Set();
  40079. var codePoints = this.font._cmapProcessor.codePointsForGlyph(gid);
  40080. for (var _iterator2 = codePoints, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _getIterator(_iterator2);;) {
  40081. var _ref2;
  40082. if (_isArray2) {
  40083. if (_i2 >= _iterator2.length) break;
  40084. _ref2 = _iterator2[_i2++];
  40085. } else {
  40086. _i2 = _iterator2.next();
  40087. if (_i2.done) break;
  40088. _ref2 = _i2.value;
  40089. }
  40090. var codePoint = _ref2;
  40091. result.add(_String$fromCodePoint(codePoint));
  40092. }
  40093. if (this.engine && this.engine.stringsForGlyph) {
  40094. for (var _iterator3 = this.engine.stringsForGlyph(gid), _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _getIterator(_iterator3);;) {
  40095. var _ref3;
  40096. if (_isArray3) {
  40097. if (_i3 >= _iterator3.length) break;
  40098. _ref3 = _iterator3[_i3++];
  40099. } else {
  40100. _i3 = _iterator3.next();
  40101. if (_i3.done) break;
  40102. _ref3 = _i3.value;
  40103. }
  40104. var string = _ref3;
  40105. result.add(string);
  40106. }
  40107. }
  40108. return _Array$from(result);
  40109. };
  40110. return LayoutEngine;
  40111. }();
  40112. var SVG_COMMANDS = {
  40113. moveTo: 'M',
  40114. lineTo: 'L',
  40115. quadraticCurveTo: 'Q',
  40116. bezierCurveTo: 'C',
  40117. closePath: 'Z'
  40118. };
  40119. /**
  40120. * Path objects are returned by glyphs and represent the actual
  40121. * vector outlines for each glyph in the font. Paths can be converted
  40122. * to SVG path data strings, or to functions that can be applied to
  40123. * render the path to a graphics context.
  40124. */
  40125. var Path = function () {
  40126. function Path() {
  40127. _classCallCheck(this, Path);
  40128. this.commands = [];
  40129. this._bbox = null;
  40130. this._cbox = null;
  40131. }
  40132. /**
  40133. * Compiles the path to a JavaScript function that can be applied with
  40134. * a graphics context in order to render the path.
  40135. * @return {string}
  40136. */
  40137. Path.prototype.toFunction = function toFunction() {
  40138. var cmds = this.commands.map(function (c) {
  40139. return ' ctx.' + c.command + '(' + c.args.join(', ') + ');';
  40140. });
  40141. return new Function('ctx', cmds.join('\n'));
  40142. };
  40143. /**
  40144. * Converts the path to an SVG path data string
  40145. * @return {string}
  40146. */
  40147. Path.prototype.toSVG = function toSVG() {
  40148. var cmds = this.commands.map(function (c) {
  40149. var args = c.args.map(function (arg) {
  40150. return Math.round(arg * 100) / 100;
  40151. });
  40152. return '' + SVG_COMMANDS[c.command] + args.join(' ');
  40153. });
  40154. return cmds.join('');
  40155. };
  40156. /**
  40157. * Gets the "control box" of a path.
  40158. * This is like the bounding box, but it includes all points including
  40159. * control points of bezier segments and is much faster to compute than
  40160. * the real bounding box.
  40161. * @type {BBox}
  40162. */
  40163. /**
  40164. * Applies a mapping function to each point in the path.
  40165. * @param {function} fn
  40166. * @return {Path}
  40167. */
  40168. Path.prototype.mapPoints = function mapPoints(fn) {
  40169. var path = new Path();
  40170. for (var _iterator = this.commands, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _getIterator(_iterator);;) {
  40171. var _ref;
  40172. if (_isArray) {
  40173. if (_i >= _iterator.length) break;
  40174. _ref = _iterator[_i++];
  40175. } else {
  40176. _i = _iterator.next();
  40177. if (_i.done) break;
  40178. _ref = _i.value;
  40179. }
  40180. var c = _ref;
  40181. var args = [];
  40182. for (var _i2 = 0; _i2 < c.args.length; _i2 += 2) {
  40183. var _fn = fn(c.args[_i2], c.args[_i2 + 1]),
  40184. x = _fn[0],
  40185. y = _fn[1];
  40186. args.push(x, y);
  40187. }
  40188. path[c.command].apply(path, args);
  40189. }
  40190. return path;
  40191. };
  40192. /**
  40193. * Transforms the path by the given matrix.
  40194. */
  40195. Path.prototype.transform = function transform(m0, m1, m2, m3, m4, m5) {
  40196. return this.mapPoints(function (x, y) {
  40197. x = m0 * x + m2 * y + m4;
  40198. y = m1 * x + m3 * y + m5;
  40199. return [x, y];
  40200. });
  40201. };
  40202. /**
  40203. * Translates the path by the given offset.
  40204. */
  40205. Path.prototype.translate = function translate(x, y) {
  40206. return this.transform(1, 0, 0, 1, x, y);
  40207. };
  40208. /**
  40209. * Rotates the path by the given angle (in radians).
  40210. */
  40211. Path.prototype.rotate = function rotate(angle) {
  40212. var cos = Math.cos(angle);
  40213. var sin = Math.sin(angle);
  40214. return this.transform(cos, sin, -sin, cos, 0, 0);
  40215. };
  40216. /**
  40217. * Scales the path.
  40218. */
  40219. Path.prototype.scale = function scale(scaleX) {
  40220. var scaleY = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : scaleX;
  40221. return this.transform(scaleX, 0, 0, scaleY, 0, 0);
  40222. };
  40223. _createClass(Path, [{
  40224. key: 'cbox',
  40225. get: function get() {
  40226. if (!this._cbox) {
  40227. var cbox = new BBox();
  40228. for (var _iterator2 = this.commands, _isArray2 = Array.isArray(_iterator2), _i3 = 0, _iterator2 = _isArray2 ? _iterator2 : _getIterator(_iterator2);;) {
  40229. var _ref2;
  40230. if (_isArray2) {
  40231. if (_i3 >= _iterator2.length) break;
  40232. _ref2 = _iterator2[_i3++];
  40233. } else {
  40234. _i3 = _iterator2.next();
  40235. if (_i3.done) break;
  40236. _ref2 = _i3.value;
  40237. }
  40238. var command = _ref2;
  40239. for (var _i4 = 0; _i4 < command.args.length; _i4 += 2) {
  40240. cbox.addPoint(command.args[_i4], command.args[_i4 + 1]);
  40241. }
  40242. }
  40243. this._cbox = _Object$freeze(cbox);
  40244. }
  40245. return this._cbox;
  40246. }
  40247. /**
  40248. * Gets the exact bounding box of the path by evaluating curve segments.
  40249. * Slower to compute than the control box, but more accurate.
  40250. * @type {BBox}
  40251. */
  40252. }, {
  40253. key: 'bbox',
  40254. get: function get() {
  40255. if (this._bbox) {
  40256. return this._bbox;
  40257. }
  40258. var bbox = new BBox();
  40259. var cx = 0,
  40260. cy = 0;
  40261. var f = function f(t) {
  40262. return Math.pow(1 - t, 3) * p0[i] + 3 * Math.pow(1 - t, 2) * t * p1[i] + 3 * (1 - t) * Math.pow(t, 2) * p2[i] + Math.pow(t, 3) * p3[i];
  40263. };
  40264. for (var _iterator3 = this.commands, _isArray3 = Array.isArray(_iterator3), _i5 = 0, _iterator3 = _isArray3 ? _iterator3 : _getIterator(_iterator3);;) {
  40265. var _ref3;
  40266. if (_isArray3) {
  40267. if (_i5 >= _iterator3.length) break;
  40268. _ref3 = _iterator3[_i5++];
  40269. } else {
  40270. _i5 = _iterator3.next();
  40271. if (_i5.done) break;
  40272. _ref3 = _i5.value;
  40273. }
  40274. var c = _ref3;
  40275. switch (c.command) {
  40276. case 'moveTo':
  40277. case 'lineTo':
  40278. var _c$args = c.args,
  40279. x = _c$args[0],
  40280. y = _c$args[1];
  40281. bbox.addPoint(x, y);
  40282. cx = x;
  40283. cy = y;
  40284. break;
  40285. case 'quadraticCurveTo':
  40286. case 'bezierCurveTo':
  40287. if (c.command === 'quadraticCurveTo') {
  40288. // http://fontforge.org/bezier.html
  40289. var _c$args2 = c.args,
  40290. qp1x = _c$args2[0],
  40291. qp1y = _c$args2[1],
  40292. p3x = _c$args2[2],
  40293. p3y = _c$args2[3];
  40294. var cp1x = cx + 2 / 3 * (qp1x - cx); // CP1 = QP0 + 2/3 * (QP1-QP0)
  40295. var cp1y = cy + 2 / 3 * (qp1y - cy);
  40296. var cp2x = p3x + 2 / 3 * (qp1x - p3x); // CP2 = QP2 + 2/3 * (QP1-QP2)
  40297. var cp2y = p3y + 2 / 3 * (qp1y - p3y);
  40298. } else {
  40299. var _c$args3 = c.args,
  40300. cp1x = _c$args3[0],
  40301. cp1y = _c$args3[1],
  40302. cp2x = _c$args3[2],
  40303. cp2y = _c$args3[3],
  40304. p3x = _c$args3[4],
  40305. p3y = _c$args3[5];
  40306. }
  40307. // http://blog.hackers-cafe.net/2009/06/how-to-calculate-bezier-curves-bounding.html
  40308. bbox.addPoint(p3x, p3y);
  40309. var p0 = [cx, cy];
  40310. var p1 = [cp1x, cp1y];
  40311. var p2 = [cp2x, cp2y];
  40312. var p3 = [p3x, p3y];
  40313. for (var i = 0; i <= 1; i++) {
  40314. var b = 6 * p0[i] - 12 * p1[i] + 6 * p2[i];
  40315. var a = -3 * p0[i] + 9 * p1[i] - 9 * p2[i] + 3 * p3[i];
  40316. c = 3 * p1[i] - 3 * p0[i];
  40317. if (a === 0) {
  40318. if (b === 0) {
  40319. continue;
  40320. }
  40321. var t = -c / b;
  40322. if (0 < t && t < 1) {
  40323. if (i === 0) {
  40324. bbox.addPoint(f(t), bbox.maxY);
  40325. } else if (i === 1) {
  40326. bbox.addPoint(bbox.maxX, f(t));
  40327. }
  40328. }
  40329. continue;
  40330. }
  40331. var b2ac = Math.pow(b, 2) - 4 * c * a;
  40332. if (b2ac < 0) {
  40333. continue;
  40334. }
  40335. var t1 = (-b + Math.sqrt(b2ac)) / (2 * a);
  40336. if (0 < t1 && t1 < 1) {
  40337. if (i === 0) {
  40338. bbox.addPoint(f(t1), bbox.maxY);
  40339. } else if (i === 1) {
  40340. bbox.addPoint(bbox.maxX, f(t1));
  40341. }
  40342. }
  40343. var t2 = (-b - Math.sqrt(b2ac)) / (2 * a);
  40344. if (0 < t2 && t2 < 1) {
  40345. if (i === 0) {
  40346. bbox.addPoint(f(t2), bbox.maxY);
  40347. } else if (i === 1) {
  40348. bbox.addPoint(bbox.maxX, f(t2));
  40349. }
  40350. }
  40351. }
  40352. cx = p3x;
  40353. cy = p3y;
  40354. break;
  40355. }
  40356. }
  40357. return this._bbox = _Object$freeze(bbox);
  40358. }
  40359. }]);
  40360. return Path;
  40361. }();
  40362. var _arr = ['moveTo', 'lineTo', 'quadraticCurveTo', 'bezierCurveTo', 'closePath'];
  40363. var _loop = function _loop() {
  40364. var command = _arr[_i6];
  40365. Path.prototype[command] = function () {
  40366. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  40367. args[_key] = arguments[_key];
  40368. }
  40369. this._bbox = this._cbox = null;
  40370. this.commands.push({
  40371. command: command,
  40372. args: args
  40373. });
  40374. return this;
  40375. };
  40376. };
  40377. for (var _i6 = 0; _i6 < _arr.length; _i6++) {
  40378. _loop();
  40379. }
  40380. var StandardNames = ['.notdef', '.null', 'nonmarkingreturn', 'space', 'exclam', 'quotedbl', 'numbersign', 'dollar', 'percent', 'ampersand', 'quotesingle', 'parenleft', 'parenright', 'asterisk', 'plus', 'comma', 'hyphen', 'period', 'slash', 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'colon', 'semicolon', 'less', 'equal', 'greater', 'question', 'at', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'bracketleft', 'backslash', 'bracketright', 'asciicircum', 'underscore', 'grave', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'braceleft', 'bar', 'braceright', 'asciitilde', 'Adieresis', 'Aring', 'Ccedilla', 'Eacute', 'Ntilde', 'Odieresis', 'Udieresis', 'aacute', 'agrave', 'acircumflex', 'adieresis', 'atilde', 'aring', 'ccedilla', 'eacute', 'egrave', 'ecircumflex', 'edieresis', 'iacute', 'igrave', 'icircumflex', 'idieresis', 'ntilde', 'oacute', 'ograve', 'ocircumflex', 'odieresis', 'otilde', 'uacute', 'ugrave', 'ucircumflex', 'udieresis', 'dagger', 'degree', 'cent', 'sterling', 'section', 'bullet', 'paragraph', 'germandbls', 'registered', 'copyright', 'trademark', 'acute', 'dieresis', 'notequal', 'AE', 'Oslash', 'infinity', 'plusminus', 'lessequal', 'greaterequal', 'yen', 'mu', 'partialdiff', 'summation', 'product', 'pi', 'integral', 'ordfeminine', 'ordmasculine', 'Omega', 'ae', 'oslash', 'questiondown', 'exclamdown', 'logicalnot', 'radical', 'florin', 'approxequal', 'Delta', 'guillemotleft', 'guillemotright', 'ellipsis', 'nonbreakingspace', 'Agrave', 'Atilde', 'Otilde', 'OE', 'oe', 'endash', 'emdash', 'quotedblleft', 'quotedblright', 'quoteleft', 'quoteright', 'divide', 'lozenge', 'ydieresis', 'Ydieresis', 'fraction', 'currency', 'guilsinglleft', 'guilsinglright', 'fi', 'fl', 'daggerdbl', 'periodcentered', 'quotesinglbase', 'quotedblbase', 'perthousand', 'Acircumflex', 'Ecircumflex', 'Aacute', 'Edieresis', 'Egrave', 'Iacute', 'Icircumflex', 'Idieresis', 'Igrave', 'Oacute', 'Ocircumflex', 'apple', 'Ograve', 'Uacute', 'Ucircumflex', 'Ugrave', 'dotlessi', 'circumflex', 'tilde', 'macron', 'breve', 'dotaccent', 'ring', 'cedilla', 'hungarumlaut', 'ogonek', 'caron', 'Lslash', 'lslash', 'Scaron', 'scaron', 'Zcaron', 'zcaron', 'brokenbar', 'Eth', 'eth', 'Yacute', 'yacute', 'Thorn', 'thorn', 'minus', 'multiply', 'onesuperior', 'twosuperior', 'threesuperior', 'onehalf', 'onequarter', 'threequarters', 'franc', 'Gbreve', 'gbreve', 'Idotaccent', 'Scedilla', 'scedilla', 'Cacute', 'cacute', 'Ccaron', 'ccaron', 'dcroat'];
  40381. var _class$8;
  40382. function _applyDecoratedDescriptor$4(target, property, decorators, descriptor, context) {
  40383. var desc = {};
  40384. Object['ke' + 'ys'](descriptor).forEach(function (key) {
  40385. desc[key] = descriptor[key];
  40386. });
  40387. desc.enumerable = !!desc.enumerable;
  40388. desc.configurable = !!desc.configurable;
  40389. if ('value' in desc || desc.initializer) {
  40390. desc.writable = true;
  40391. }
  40392. desc = decorators.slice().reverse().reduce(function (desc, decorator) {
  40393. return decorator(target, property, desc) || desc;
  40394. }, desc);
  40395. if (context && desc.initializer !== void 0) {
  40396. desc.value = desc.initializer ? desc.initializer.call(context) : void 0;
  40397. desc.initializer = undefined;
  40398. }
  40399. if (desc.initializer === void 0) {
  40400. Object['define' + 'Property'](target, property, desc);
  40401. desc = null;
  40402. }
  40403. return desc;
  40404. }
  40405. /**
  40406. * Glyph objects represent a glyph in the font. They have various properties for accessing metrics and
  40407. * the actual vector path the glyph represents, and methods for rendering the glyph to a graphics context.
  40408. *
  40409. * You do not create glyph objects directly. They are created by various methods on the font object.
  40410. * There are several subclasses of the base Glyph class internally that may be returned depending
  40411. * on the font format, but they all inherit from this class.
  40412. */
  40413. var Glyph = (_class$8 = function () {
  40414. function Glyph(id, codePoints, font) {
  40415. _classCallCheck(this, Glyph);
  40416. /**
  40417. * The glyph id in the font
  40418. * @type {number}
  40419. */
  40420. this.id = id;
  40421. /**
  40422. * An array of unicode code points that are represented by this glyph.
  40423. * There can be multiple code points in the case of ligatures and other glyphs
  40424. * that represent multiple visual characters.
  40425. * @type {number[]}
  40426. */
  40427. this.codePoints = codePoints;
  40428. this._font = font;
  40429. // TODO: get this info from GDEF if available
  40430. this.isMark = this.codePoints.length > 0 && this.codePoints.every(unicode.isMark);
  40431. this.isLigature = this.codePoints.length > 1;
  40432. }
  40433. Glyph.prototype._getPath = function _getPath() {
  40434. return new Path();
  40435. };
  40436. Glyph.prototype._getCBox = function _getCBox() {
  40437. return this.path.cbox;
  40438. };
  40439. Glyph.prototype._getBBox = function _getBBox() {
  40440. return this.path.bbox;
  40441. };
  40442. Glyph.prototype._getTableMetrics = function _getTableMetrics(table) {
  40443. if (this.id < table.metrics.length) {
  40444. return table.metrics.get(this.id);
  40445. }
  40446. var metric = table.metrics.get(table.metrics.length - 1);
  40447. var res = {
  40448. advance: metric ? metric.advance : 0,
  40449. bearing: table.bearings.get(this.id - table.metrics.length) || 0
  40450. };
  40451. return res;
  40452. };
  40453. Glyph.prototype._getMetrics = function _getMetrics(cbox) {
  40454. if (this._metrics) {
  40455. return this._metrics;
  40456. }
  40457. var _getTableMetrics2 = this._getTableMetrics(this._font.hmtx),
  40458. advanceWidth = _getTableMetrics2.advance,
  40459. leftBearing = _getTableMetrics2.bearing;
  40460. // For vertical metrics, use vmtx if available, or fall back to global data from OS/2 or hhea
  40461. if (this._font.vmtx) {
  40462. var _getTableMetrics3 = this._getTableMetrics(this._font.vmtx),
  40463. advanceHeight = _getTableMetrics3.advance,
  40464. topBearing = _getTableMetrics3.bearing;
  40465. } else {
  40466. var os2 = void 0;
  40467. if (typeof cbox === 'undefined' || cbox === null) {
  40468. cbox = this.cbox;
  40469. }
  40470. if ((os2 = this._font['OS/2']) && os2.version > 0) {
  40471. var advanceHeight = Math.abs(os2.typoAscender - os2.typoDescender);
  40472. var topBearing = os2.typoAscender - cbox.maxY;
  40473. } else {
  40474. var hhea = this._font.hhea;
  40475. var advanceHeight = Math.abs(hhea.ascent - hhea.descent);
  40476. var topBearing = hhea.ascent - cbox.maxY;
  40477. }
  40478. }
  40479. if (this._font._variationProcessor && this._font.HVAR) {
  40480. advanceWidth += this._font._variationProcessor.getAdvanceAdjustment(this.id, this._font.HVAR);
  40481. }
  40482. return this._metrics = { advanceWidth: advanceWidth, advanceHeight: advanceHeight, leftBearing: leftBearing, topBearing: topBearing };
  40483. };
  40484. /**
  40485. * The glyph’s control box.
  40486. * This is often the same as the bounding box, but is faster to compute.
  40487. * Because of the way bezier curves are defined, some of the control points
  40488. * can be outside of the bounding box. Where `bbox` takes this into account,
  40489. * `cbox` does not. Thus, cbox is less accurate, but faster to compute.
  40490. * See [here](http://www.freetype.org/freetype2/docs/glyphs/glyphs-6.html#section-2)
  40491. * for a more detailed description.
  40492. *
  40493. * @type {BBox}
  40494. */
  40495. /**
  40496. * Returns a path scaled to the given font size.
  40497. * @param {number} size
  40498. * @return {Path}
  40499. */
  40500. Glyph.prototype.getScaledPath = function getScaledPath(size) {
  40501. var scale = 1 / this._font.unitsPerEm * size;
  40502. return this.path.scale(scale);
  40503. };
  40504. /**
  40505. * The glyph's advance width.
  40506. * @type {number}
  40507. */
  40508. Glyph.prototype._getName = function _getName() {
  40509. var post = this._font.post;
  40510. if (!post) {
  40511. return null;
  40512. }
  40513. switch (post.version) {
  40514. case 1:
  40515. return StandardNames[this.id];
  40516. case 2:
  40517. var id = post.glyphNameIndex[this.id];
  40518. if (id < StandardNames.length) {
  40519. return StandardNames[id];
  40520. }
  40521. return post.names[id - StandardNames.length];
  40522. case 2.5:
  40523. return StandardNames[this.id + post.offsets[this.id]];
  40524. case 4:
  40525. return String.fromCharCode(post.map[this.id]);
  40526. }
  40527. };
  40528. /**
  40529. * The glyph's name
  40530. * @type {string}
  40531. */
  40532. /**
  40533. * Renders the glyph to the given graphics context, at the specified font size.
  40534. * @param {CanvasRenderingContext2d} ctx
  40535. * @param {number} size
  40536. */
  40537. Glyph.prototype.render = function render(ctx, size) {
  40538. ctx.save();
  40539. var scale = 1 / this._font.head.unitsPerEm * size;
  40540. ctx.scale(scale, scale);
  40541. var fn = this.path.toFunction();
  40542. fn(ctx);
  40543. ctx.fill();
  40544. ctx.restore();
  40545. };
  40546. _createClass(Glyph, [{
  40547. key: 'cbox',
  40548. get: function get() {
  40549. return this._getCBox();
  40550. }
  40551. /**
  40552. * The glyph’s bounding box, i.e. the rectangle that encloses the
  40553. * glyph outline as tightly as possible.
  40554. * @type {BBox}
  40555. */
  40556. }, {
  40557. key: 'bbox',
  40558. get: function get() {
  40559. return this._getBBox();
  40560. }
  40561. /**
  40562. * A vector Path object representing the glyph outline.
  40563. * @type {Path}
  40564. */
  40565. }, {
  40566. key: 'path',
  40567. get: function get() {
  40568. // Cache the path so we only decode it once
  40569. // Decoding is actually performed by subclasses
  40570. return this._getPath();
  40571. }
  40572. }, {
  40573. key: 'advanceWidth',
  40574. get: function get() {
  40575. return this._getMetrics().advanceWidth;
  40576. }
  40577. /**
  40578. * The glyph's advance height.
  40579. * @type {number}
  40580. */
  40581. }, {
  40582. key: 'advanceHeight',
  40583. get: function get() {
  40584. return this._getMetrics().advanceHeight;
  40585. }
  40586. }, {
  40587. key: 'ligatureCaretPositions',
  40588. get: function get() {}
  40589. }, {
  40590. key: 'name',
  40591. get: function get() {
  40592. return this._getName();
  40593. }
  40594. }]);
  40595. return Glyph;
  40596. }(), (_applyDecoratedDescriptor$4(_class$8.prototype, 'cbox', [cache], _Object$getOwnPropertyDescriptor(_class$8.prototype, 'cbox'), _class$8.prototype), _applyDecoratedDescriptor$4(_class$8.prototype, 'bbox', [cache], _Object$getOwnPropertyDescriptor(_class$8.prototype, 'bbox'), _class$8.prototype), _applyDecoratedDescriptor$4(_class$8.prototype, 'path', [cache], _Object$getOwnPropertyDescriptor(_class$8.prototype, 'path'), _class$8.prototype), _applyDecoratedDescriptor$4(_class$8.prototype, 'advanceWidth', [cache], _Object$getOwnPropertyDescriptor(_class$8.prototype, 'advanceWidth'), _class$8.prototype), _applyDecoratedDescriptor$4(_class$8.prototype, 'advanceHeight', [cache], _Object$getOwnPropertyDescriptor(_class$8.prototype, 'advanceHeight'), _class$8.prototype), _applyDecoratedDescriptor$4(_class$8.prototype, 'name', [cache], _Object$getOwnPropertyDescriptor(_class$8.prototype, 'name'), _class$8.prototype)), _class$8);
  40597. // The header for both simple and composite glyphs
  40598. var GlyfHeader = new r.Struct({
  40599. numberOfContours: r.int16, // if negative, this is a composite glyph
  40600. xMin: r.int16,
  40601. yMin: r.int16,
  40602. xMax: r.int16,
  40603. yMax: r.int16
  40604. });
  40605. // Flags for simple glyphs
  40606. var ON_CURVE = 1 << 0;
  40607. var X_SHORT_VECTOR = 1 << 1;
  40608. var Y_SHORT_VECTOR = 1 << 2;
  40609. var REPEAT = 1 << 3;
  40610. var SAME_X = 1 << 4;
  40611. var SAME_Y = 1 << 5;
  40612. // Flags for composite glyphs
  40613. var ARG_1_AND_2_ARE_WORDS = 1 << 0;
  40614. var WE_HAVE_A_SCALE = 1 << 3;
  40615. var MORE_COMPONENTS = 1 << 5;
  40616. var WE_HAVE_AN_X_AND_Y_SCALE = 1 << 6;
  40617. var WE_HAVE_A_TWO_BY_TWO = 1 << 7;
  40618. var WE_HAVE_INSTRUCTIONS = 1 << 8;
  40619. // Represents a point in a simple glyph
  40620. var Point = function () {
  40621. function Point(onCurve, endContour) {
  40622. var x = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
  40623. var y = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
  40624. _classCallCheck(this, Point);
  40625. this.onCurve = onCurve;
  40626. this.endContour = endContour;
  40627. this.x = x;
  40628. this.y = y;
  40629. }
  40630. Point.prototype.copy = function copy() {
  40631. return new Point(this.onCurve, this.endContour, this.x, this.y);
  40632. };
  40633. return Point;
  40634. }();
  40635. // Represents a component in a composite glyph
  40636. var Component = function Component(glyphID, dx, dy) {
  40637. _classCallCheck(this, Component);
  40638. this.glyphID = glyphID;
  40639. this.dx = dx;
  40640. this.dy = dy;
  40641. this.pos = 0;
  40642. this.scaleX = this.scaleY = 1;
  40643. this.scale01 = this.scale10 = 0;
  40644. };
  40645. /**
  40646. * Represents a TrueType glyph.
  40647. */
  40648. var TTFGlyph = function (_Glyph) {
  40649. _inherits(TTFGlyph, _Glyph);
  40650. function TTFGlyph() {
  40651. _classCallCheck(this, TTFGlyph);
  40652. return _possibleConstructorReturn(this, _Glyph.apply(this, arguments));
  40653. }
  40654. // Parses just the glyph header and returns the bounding box
  40655. TTFGlyph.prototype._getCBox = function _getCBox(internal) {
  40656. // We need to decode the glyph if variation processing is requested,
  40657. // so it's easier just to recompute the path's cbox after decoding.
  40658. if (this._font._variationProcessor && !internal) {
  40659. return this.path.cbox;
  40660. }
  40661. var stream = this._font._getTableStream('glyf');
  40662. stream.pos += this._font.loca.offsets[this.id];
  40663. var glyph = GlyfHeader.decode(stream);
  40664. var cbox = new BBox(glyph.xMin, glyph.yMin, glyph.xMax, glyph.yMax);
  40665. return _Object$freeze(cbox);
  40666. };
  40667. // Parses a single glyph coordinate
  40668. TTFGlyph.prototype._parseGlyphCoord = function _parseGlyphCoord(stream, prev, short, same) {
  40669. if (short) {
  40670. var val = stream.readUInt8();
  40671. if (!same) {
  40672. val = -val;
  40673. }
  40674. val += prev;
  40675. } else {
  40676. if (same) {
  40677. var val = prev;
  40678. } else {
  40679. var val = prev + stream.readInt16BE();
  40680. }
  40681. }
  40682. return val;
  40683. };
  40684. // Decodes the glyph data into points for simple glyphs,
  40685. // or components for composite glyphs
  40686. TTFGlyph.prototype._decode = function _decode() {
  40687. var glyfPos = this._font.loca.offsets[this.id];
  40688. var nextPos = this._font.loca.offsets[this.id + 1];
  40689. // Nothing to do if there is no data for this glyph
  40690. if (glyfPos === nextPos) {
  40691. return null;
  40692. }
  40693. var stream = this._font._getTableStream('glyf');
  40694. stream.pos += glyfPos;
  40695. var startPos = stream.pos;
  40696. var glyph = GlyfHeader.decode(stream);
  40697. if (glyph.numberOfContours > 0) {
  40698. this._decodeSimple(glyph, stream);
  40699. } else if (glyph.numberOfContours < 0) {
  40700. this._decodeComposite(glyph, stream, startPos);
  40701. }
  40702. return glyph;
  40703. };
  40704. TTFGlyph.prototype._decodeSimple = function _decodeSimple(glyph, stream) {
  40705. // this is a simple glyph
  40706. glyph.points = [];
  40707. var endPtsOfContours = new r.Array(r.uint16, glyph.numberOfContours).decode(stream);
  40708. glyph.instructions = new r.Array(r.uint8, r.uint16).decode(stream);
  40709. var flags = [];
  40710. var numCoords = endPtsOfContours[endPtsOfContours.length - 1] + 1;
  40711. while (flags.length < numCoords) {
  40712. var flag = stream.readUInt8();
  40713. flags.push(flag);
  40714. // check for repeat flag
  40715. if (flag & REPEAT) {
  40716. var count = stream.readUInt8();
  40717. for (var j = 0; j < count; j++) {
  40718. flags.push(flag);
  40719. }
  40720. }
  40721. }
  40722. for (var i = 0; i < flags.length; i++) {
  40723. var flag = flags[i];
  40724. var point = new Point(!!(flag & ON_CURVE), endPtsOfContours.indexOf(i) >= 0, 0, 0);
  40725. glyph.points.push(point);
  40726. }
  40727. var px = 0;
  40728. for (var i = 0; i < flags.length; i++) {
  40729. var flag = flags[i];
  40730. glyph.points[i].x = px = this._parseGlyphCoord(stream, px, flag & X_SHORT_VECTOR, flag & SAME_X);
  40731. }
  40732. var py = 0;
  40733. for (var i = 0; i < flags.length; i++) {
  40734. var flag = flags[i];
  40735. glyph.points[i].y = py = this._parseGlyphCoord(stream, py, flag & Y_SHORT_VECTOR, flag & SAME_Y);
  40736. }
  40737. if (this._font._variationProcessor) {
  40738. var points = glyph.points.slice();
  40739. points.push.apply(points, this._getPhantomPoints(glyph));
  40740. this._font._variationProcessor.transformPoints(this.id, points);
  40741. glyph.phantomPoints = points.slice(-4);
  40742. }
  40743. return;
  40744. };
  40745. TTFGlyph.prototype._decodeComposite = function _decodeComposite(glyph, stream) {
  40746. var offset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
  40747. // this is a composite glyph
  40748. glyph.components = [];
  40749. var haveInstructions = false;
  40750. var flags = MORE_COMPONENTS;
  40751. while (flags & MORE_COMPONENTS) {
  40752. flags = stream.readUInt16BE();
  40753. var gPos = stream.pos - offset;
  40754. var glyphID = stream.readUInt16BE();
  40755. if (!haveInstructions) {
  40756. haveInstructions = (flags & WE_HAVE_INSTRUCTIONS) !== 0;
  40757. }
  40758. if (flags & ARG_1_AND_2_ARE_WORDS) {
  40759. var dx = stream.readInt16BE();
  40760. var dy = stream.readInt16BE();
  40761. } else {
  40762. var dx = stream.readInt8();
  40763. var dy = stream.readInt8();
  40764. }
  40765. var component = new Component(glyphID, dx, dy);
  40766. component.pos = gPos;
  40767. if (flags & WE_HAVE_A_SCALE) {
  40768. // fixed number with 14 bits of fraction
  40769. component.scaleX = component.scaleY = (stream.readUInt8() << 24 | stream.readUInt8() << 16) / 1073741824;
  40770. } else if (flags & WE_HAVE_AN_X_AND_Y_SCALE) {
  40771. component.scaleX = (stream.readUInt8() << 24 | stream.readUInt8() << 16) / 1073741824;
  40772. component.scaleY = (stream.readUInt8() << 24 | stream.readUInt8() << 16) / 1073741824;
  40773. } else if (flags & WE_HAVE_A_TWO_BY_TWO) {
  40774. component.scaleX = (stream.readUInt8() << 24 | stream.readUInt8() << 16) / 1073741824;
  40775. component.scale01 = (stream.readUInt8() << 24 | stream.readUInt8() << 16) / 1073741824;
  40776. component.scale10 = (stream.readUInt8() << 24 | stream.readUInt8() << 16) / 1073741824;
  40777. component.scaleY = (stream.readUInt8() << 24 | stream.readUInt8() << 16) / 1073741824;
  40778. }
  40779. glyph.components.push(component);
  40780. }
  40781. if (this._font._variationProcessor) {
  40782. var points = [];
  40783. for (var j = 0; j < glyph.components.length; j++) {
  40784. var component = glyph.components[j];
  40785. points.push(new Point(true, true, component.dx, component.dy));
  40786. }
  40787. points.push.apply(points, this._getPhantomPoints(glyph));
  40788. this._font._variationProcessor.transformPoints(this.id, points);
  40789. glyph.phantomPoints = points.splice(-4, 4);
  40790. for (var i = 0; i < points.length; i++) {
  40791. var point = points[i];
  40792. glyph.components[i].dx = point.x;
  40793. glyph.components[i].dy = point.y;
  40794. }
  40795. }
  40796. return haveInstructions;
  40797. };
  40798. TTFGlyph.prototype._getPhantomPoints = function _getPhantomPoints(glyph) {
  40799. var cbox = this._getCBox(true);
  40800. if (this._metrics == null) {
  40801. this._metrics = Glyph.prototype._getMetrics.call(this, cbox);
  40802. }
  40803. var _metrics = this._metrics,
  40804. advanceWidth = _metrics.advanceWidth,
  40805. advanceHeight = _metrics.advanceHeight,
  40806. leftBearing = _metrics.leftBearing,
  40807. topBearing = _metrics.topBearing;
  40808. return [new Point(false, true, glyph.xMin - leftBearing, 0), new Point(false, true, glyph.xMin - leftBearing + advanceWidth, 0), new Point(false, true, 0, glyph.yMax + topBearing), new Point(false, true, 0, glyph.yMax + topBearing + advanceHeight)];
  40809. };
  40810. // Decodes font data, resolves composite glyphs, and returns an array of contours
  40811. TTFGlyph.prototype._getContours = function _getContours() {
  40812. var glyph = this._decode();
  40813. if (!glyph) {
  40814. return [];
  40815. }
  40816. var points = [];
  40817. if (glyph.numberOfContours < 0) {
  40818. // resolve composite glyphs
  40819. for (var _iterator = glyph.components, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _getIterator(_iterator);;) {
  40820. var _ref;
  40821. if (_isArray) {
  40822. if (_i >= _iterator.length) break;
  40823. _ref = _iterator[_i++];
  40824. } else {
  40825. _i = _iterator.next();
  40826. if (_i.done) break;
  40827. _ref = _i.value;
  40828. }
  40829. var component = _ref;
  40830. var _contours = this._font.getGlyph(component.glyphID)._getContours();
  40831. for (var i = 0; i < _contours.length; i++) {
  40832. var contour = _contours[i];
  40833. for (var j = 0; j < contour.length; j++) {
  40834. var _point = contour[j];
  40835. var x = _point.x * component.scaleX + _point.y * component.scale01 + component.dx;
  40836. var y = _point.y * component.scaleY + _point.x * component.scale10 + component.dy;
  40837. points.push(new Point(_point.onCurve, _point.endContour, x, y));
  40838. }
  40839. }
  40840. }
  40841. } else {
  40842. points = glyph.points || [];
  40843. }
  40844. // Recompute and cache metrics if we performed variation processing, and don't have an HVAR table
  40845. if (glyph.phantomPoints && !this._font.directory.tables.HVAR) {
  40846. this._metrics.advanceWidth = glyph.phantomPoints[1].x - glyph.phantomPoints[0].x;
  40847. this._metrics.advanceHeight = glyph.phantomPoints[3].y - glyph.phantomPoints[2].y;
  40848. this._metrics.leftBearing = glyph.xMin - glyph.phantomPoints[0].x;
  40849. this._metrics.topBearing = glyph.phantomPoints[2].y - glyph.yMax;
  40850. }
  40851. var contours = [];
  40852. var cur = [];
  40853. for (var k = 0; k < points.length; k++) {
  40854. var point = points[k];
  40855. cur.push(point);
  40856. if (point.endContour) {
  40857. contours.push(cur);
  40858. cur = [];
  40859. }
  40860. }
  40861. return contours;
  40862. };
  40863. TTFGlyph.prototype._getMetrics = function _getMetrics() {
  40864. if (this._metrics) {
  40865. return this._metrics;
  40866. }
  40867. var cbox = this._getCBox(true);
  40868. _Glyph.prototype._getMetrics.call(this, cbox);
  40869. if (this._font._variationProcessor && !this._font.HVAR) {
  40870. // No HVAR table, decode the glyph. This triggers recomputation of metrics.
  40871. this.path;
  40872. }
  40873. return this._metrics;
  40874. };
  40875. // Converts contours to a Path object that can be rendered
  40876. TTFGlyph.prototype._getPath = function _getPath() {
  40877. var contours = this._getContours();
  40878. var path = new Path();
  40879. for (var i = 0; i < contours.length; i++) {
  40880. var contour = contours[i];
  40881. var firstPt = contour[0];
  40882. var lastPt = contour[contour.length - 1];
  40883. var start = 0;
  40884. if (firstPt.onCurve) {
  40885. // The first point will be consumed by the moveTo command, so skip in the loop
  40886. var curvePt = null;
  40887. start = 1;
  40888. } else {
  40889. if (lastPt.onCurve) {
  40890. // Start at the last point if the first point is off curve and the last point is on curve
  40891. firstPt = lastPt;
  40892. } else {
  40893. // Start at the middle if both the first and last points are off curve
  40894. firstPt = new Point(false, false, (firstPt.x + lastPt.x) / 2, (firstPt.y + lastPt.y) / 2);
  40895. }
  40896. var curvePt = firstPt;
  40897. }
  40898. path.moveTo(firstPt.x, firstPt.y);
  40899. for (var j = start; j < contour.length; j++) {
  40900. var pt = contour[j];
  40901. var prevPt = j === 0 ? firstPt : contour[j - 1];
  40902. if (prevPt.onCurve && pt.onCurve) {
  40903. path.lineTo(pt.x, pt.y);
  40904. } else if (prevPt.onCurve && !pt.onCurve) {
  40905. var curvePt = pt;
  40906. } else if (!prevPt.onCurve && !pt.onCurve) {
  40907. var midX = (prevPt.x + pt.x) / 2;
  40908. var midY = (prevPt.y + pt.y) / 2;
  40909. path.quadraticCurveTo(prevPt.x, prevPt.y, midX, midY);
  40910. var curvePt = pt;
  40911. } else if (!prevPt.onCurve && pt.onCurve) {
  40912. path.quadraticCurveTo(curvePt.x, curvePt.y, pt.x, pt.y);
  40913. var curvePt = null;
  40914. } else {
  40915. throw new Error("Unknown TTF path state");
  40916. }
  40917. }
  40918. // Connect the first and last points
  40919. if (curvePt) {
  40920. path.quadraticCurveTo(curvePt.x, curvePt.y, firstPt.x, firstPt.y);
  40921. }
  40922. path.closePath();
  40923. }
  40924. return path;
  40925. };
  40926. return TTFGlyph;
  40927. }(Glyph);
  40928. /**
  40929. * Represents an OpenType PostScript glyph, in the Compact Font Format.
  40930. */
  40931. var CFFGlyph = function (_Glyph) {
  40932. _inherits(CFFGlyph, _Glyph);
  40933. function CFFGlyph() {
  40934. _classCallCheck(this, CFFGlyph);
  40935. return _possibleConstructorReturn(this, _Glyph.apply(this, arguments));
  40936. }
  40937. CFFGlyph.prototype._getName = function _getName() {
  40938. if (this._font.CFF2) {
  40939. return _Glyph.prototype._getName.call(this);
  40940. }
  40941. return this._font['CFF '].getGlyphName(this.id);
  40942. };
  40943. CFFGlyph.prototype.bias = function bias(s) {
  40944. if (s.length < 1240) {
  40945. return 107;
  40946. } else if (s.length < 33900) {
  40947. return 1131;
  40948. } else {
  40949. return 32768;
  40950. }
  40951. };
  40952. CFFGlyph.prototype._getPath = function _getPath() {
  40953. var stream = this._font.stream;
  40954. var pos = stream.pos;
  40955. var cff = this._font.CFF2 || this._font['CFF '];
  40956. var str = cff.topDict.CharStrings[this.id];
  40957. var end = str.offset + str.length;
  40958. stream.pos = str.offset;
  40959. var path = new Path();
  40960. var stack = [];
  40961. var trans = [];
  40962. var width = null;
  40963. var nStems = 0;
  40964. var x = 0,
  40965. y = 0;
  40966. var usedGsubrs = void 0;
  40967. var usedSubrs = void 0;
  40968. var open = false;
  40969. this._usedGsubrs = usedGsubrs = {};
  40970. this._usedSubrs = usedSubrs = {};
  40971. var gsubrs = cff.globalSubrIndex || [];
  40972. var gsubrsBias = this.bias(gsubrs);
  40973. var privateDict = cff.privateDictForGlyph(this.id) || {};
  40974. var subrs = privateDict.Subrs || [];
  40975. var subrsBias = this.bias(subrs);
  40976. var vstore = cff.topDict.vstore && cff.topDict.vstore.itemVariationStore;
  40977. var vsindex = privateDict.vsindex;
  40978. var variationProcessor = this._font._variationProcessor;
  40979. function checkWidth() {
  40980. if (width == null) {
  40981. width = stack.shift() + privateDict.nominalWidthX;
  40982. }
  40983. }
  40984. function parseStems() {
  40985. if (stack.length % 2 !== 0) {
  40986. checkWidth();
  40987. }
  40988. nStems += stack.length >> 1;
  40989. return stack.length = 0;
  40990. }
  40991. function moveTo(x, y) {
  40992. if (open) {
  40993. path.closePath();
  40994. }
  40995. path.moveTo(x, y);
  40996. open = true;
  40997. }
  40998. var parse = function parse() {
  40999. while (stream.pos < end) {
  41000. var op = stream.readUInt8();
  41001. if (op < 32) {
  41002. switch (op) {
  41003. case 1: // hstem
  41004. case 3: // vstem
  41005. case 18: // hstemhm
  41006. case 23:
  41007. // vstemhm
  41008. parseStems();
  41009. break;
  41010. case 4:
  41011. // vmoveto
  41012. if (stack.length > 1) {
  41013. checkWidth();
  41014. }
  41015. y += stack.shift();
  41016. moveTo(x, y);
  41017. break;
  41018. case 5:
  41019. // rlineto
  41020. while (stack.length >= 2) {
  41021. x += stack.shift();
  41022. y += stack.shift();
  41023. path.lineTo(x, y);
  41024. }
  41025. break;
  41026. case 6: // hlineto
  41027. case 7:
  41028. // vlineto
  41029. var phase = op === 6;
  41030. while (stack.length >= 1) {
  41031. if (phase) {
  41032. x += stack.shift();
  41033. } else {
  41034. y += stack.shift();
  41035. }
  41036. path.lineTo(x, y);
  41037. phase = !phase;
  41038. }
  41039. break;
  41040. case 8:
  41041. // rrcurveto
  41042. while (stack.length > 0) {
  41043. var c1x = x + stack.shift();
  41044. var c1y = y + stack.shift();
  41045. var c2x = c1x + stack.shift();
  41046. var c2y = c1y + stack.shift();
  41047. x = c2x + stack.shift();
  41048. y = c2y + stack.shift();
  41049. path.bezierCurveTo(c1x, c1y, c2x, c2y, x, y);
  41050. }
  41051. break;
  41052. case 10:
  41053. // callsubr
  41054. var index = stack.pop() + subrsBias;
  41055. var subr = subrs[index];
  41056. if (subr) {
  41057. usedSubrs[index] = true;
  41058. var p = stream.pos;
  41059. var e = end;
  41060. stream.pos = subr.offset;
  41061. end = subr.offset + subr.length;
  41062. parse();
  41063. stream.pos = p;
  41064. end = e;
  41065. }
  41066. break;
  41067. case 11:
  41068. // return
  41069. if (cff.version >= 2) {
  41070. break;
  41071. }
  41072. return;
  41073. case 14:
  41074. // endchar
  41075. if (cff.version >= 2) {
  41076. break;
  41077. }
  41078. if (stack.length > 0) {
  41079. checkWidth();
  41080. }
  41081. if (open) {
  41082. path.closePath();
  41083. open = false;
  41084. }
  41085. break;
  41086. case 15:
  41087. {
  41088. // vsindex
  41089. if (cff.version < 2) {
  41090. throw new Error('vsindex operator not supported in CFF v1');
  41091. }
  41092. vsindex = stack.pop();
  41093. break;
  41094. }
  41095. case 16:
  41096. {
  41097. // blend
  41098. if (cff.version < 2) {
  41099. throw new Error('blend operator not supported in CFF v1');
  41100. }
  41101. if (!variationProcessor) {
  41102. throw new Error('blend operator in non-variation font');
  41103. }
  41104. var blendVector = variationProcessor.getBlendVector(vstore, vsindex);
  41105. var numBlends = stack.pop();
  41106. var numOperands = numBlends * blendVector.length;
  41107. var delta = stack.length - numOperands;
  41108. var base = delta - numBlends;
  41109. for (var i = 0; i < numBlends; i++) {
  41110. var sum = stack[base + i];
  41111. for (var j = 0; j < blendVector.length; j++) {
  41112. sum += blendVector[j] * stack[delta++];
  41113. }
  41114. stack[base + i] = sum;
  41115. }
  41116. while (numOperands--) {
  41117. stack.pop();
  41118. }
  41119. break;
  41120. }
  41121. case 19: // hintmask
  41122. case 20:
  41123. // cntrmask
  41124. parseStems();
  41125. stream.pos += nStems + 7 >> 3;
  41126. break;
  41127. case 21:
  41128. // rmoveto
  41129. if (stack.length > 2) {
  41130. checkWidth();
  41131. }
  41132. x += stack.shift();
  41133. y += stack.shift();
  41134. moveTo(x, y);
  41135. break;
  41136. case 22:
  41137. // hmoveto
  41138. if (stack.length > 1) {
  41139. checkWidth();
  41140. }
  41141. x += stack.shift();
  41142. moveTo(x, y);
  41143. break;
  41144. case 24:
  41145. // rcurveline
  41146. while (stack.length >= 8) {
  41147. var c1x = x + stack.shift();
  41148. var c1y = y + stack.shift();
  41149. var c2x = c1x + stack.shift();
  41150. var c2y = c1y + stack.shift();
  41151. x = c2x + stack.shift();
  41152. y = c2y + stack.shift();
  41153. path.bezierCurveTo(c1x, c1y, c2x, c2y, x, y);
  41154. }
  41155. x += stack.shift();
  41156. y += stack.shift();
  41157. path.lineTo(x, y);
  41158. break;
  41159. case 25:
  41160. // rlinecurve
  41161. while (stack.length >= 8) {
  41162. x += stack.shift();
  41163. y += stack.shift();
  41164. path.lineTo(x, y);
  41165. }
  41166. var c1x = x + stack.shift();
  41167. var c1y = y + stack.shift();
  41168. var c2x = c1x + stack.shift();
  41169. var c2y = c1y + stack.shift();
  41170. x = c2x + stack.shift();
  41171. y = c2y + stack.shift();
  41172. path.bezierCurveTo(c1x, c1y, c2x, c2y, x, y);
  41173. break;
  41174. case 26:
  41175. // vvcurveto
  41176. if (stack.length % 2) {
  41177. x += stack.shift();
  41178. }
  41179. while (stack.length >= 4) {
  41180. c1x = x;
  41181. c1y = y + stack.shift();
  41182. c2x = c1x + stack.shift();
  41183. c2y = c1y + stack.shift();
  41184. x = c2x;
  41185. y = c2y + stack.shift();
  41186. path.bezierCurveTo(c1x, c1y, c2x, c2y, x, y);
  41187. }
  41188. break;
  41189. case 27:
  41190. // hhcurveto
  41191. if (stack.length % 2) {
  41192. y += stack.shift();
  41193. }
  41194. while (stack.length >= 4) {
  41195. c1x = x + stack.shift();
  41196. c1y = y;
  41197. c2x = c1x + stack.shift();
  41198. c2y = c1y + stack.shift();
  41199. x = c2x + stack.shift();
  41200. y = c2y;
  41201. path.bezierCurveTo(c1x, c1y, c2x, c2y, x, y);
  41202. }
  41203. break;
  41204. case 28:
  41205. // shortint
  41206. stack.push(stream.readInt16BE());
  41207. break;
  41208. case 29:
  41209. // callgsubr
  41210. index = stack.pop() + gsubrsBias;
  41211. subr = gsubrs[index];
  41212. if (subr) {
  41213. usedGsubrs[index] = true;
  41214. var p = stream.pos;
  41215. var e = end;
  41216. stream.pos = subr.offset;
  41217. end = subr.offset + subr.length;
  41218. parse();
  41219. stream.pos = p;
  41220. end = e;
  41221. }
  41222. break;
  41223. case 30: // vhcurveto
  41224. case 31:
  41225. // hvcurveto
  41226. phase = op === 31;
  41227. while (stack.length >= 4) {
  41228. if (phase) {
  41229. c1x = x + stack.shift();
  41230. c1y = y;
  41231. c2x = c1x + stack.shift();
  41232. c2y = c1y + stack.shift();
  41233. y = c2y + stack.shift();
  41234. x = c2x + (stack.length === 1 ? stack.shift() : 0);
  41235. } else {
  41236. c1x = x;
  41237. c1y = y + stack.shift();
  41238. c2x = c1x + stack.shift();
  41239. c2y = c1y + stack.shift();
  41240. x = c2x + stack.shift();
  41241. y = c2y + (stack.length === 1 ? stack.shift() : 0);
  41242. }
  41243. path.bezierCurveTo(c1x, c1y, c2x, c2y, x, y);
  41244. phase = !phase;
  41245. }
  41246. break;
  41247. case 12:
  41248. op = stream.readUInt8();
  41249. switch (op) {
  41250. case 3:
  41251. // and
  41252. var a = stack.pop();
  41253. var b = stack.pop();
  41254. stack.push(a && b ? 1 : 0);
  41255. break;
  41256. case 4:
  41257. // or
  41258. a = stack.pop();
  41259. b = stack.pop();
  41260. stack.push(a || b ? 1 : 0);
  41261. break;
  41262. case 5:
  41263. // not
  41264. a = stack.pop();
  41265. stack.push(a ? 0 : 1);
  41266. break;
  41267. case 9:
  41268. // abs
  41269. a = stack.pop();
  41270. stack.push(Math.abs(a));
  41271. break;
  41272. case 10:
  41273. // add
  41274. a = stack.pop();
  41275. b = stack.pop();
  41276. stack.push(a + b);
  41277. break;
  41278. case 11:
  41279. // sub
  41280. a = stack.pop();
  41281. b = stack.pop();
  41282. stack.push(a - b);
  41283. break;
  41284. case 12:
  41285. // div
  41286. a = stack.pop();
  41287. b = stack.pop();
  41288. stack.push(a / b);
  41289. break;
  41290. case 14:
  41291. // neg
  41292. a = stack.pop();
  41293. stack.push(-a);
  41294. break;
  41295. case 15:
  41296. // eq
  41297. a = stack.pop();
  41298. b = stack.pop();
  41299. stack.push(a === b ? 1 : 0);
  41300. break;
  41301. case 18:
  41302. // drop
  41303. stack.pop();
  41304. break;
  41305. case 20:
  41306. // put
  41307. var val = stack.pop();
  41308. var idx = stack.pop();
  41309. trans[idx] = val;
  41310. break;
  41311. case 21:
  41312. // get
  41313. idx = stack.pop();
  41314. stack.push(trans[idx] || 0);
  41315. break;
  41316. case 22:
  41317. // ifelse
  41318. var s1 = stack.pop();
  41319. var s2 = stack.pop();
  41320. var v1 = stack.pop();
  41321. var v2 = stack.pop();
  41322. stack.push(v1 <= v2 ? s1 : s2);
  41323. break;
  41324. case 23:
  41325. // random
  41326. stack.push(Math.random());
  41327. break;
  41328. case 24:
  41329. // mul
  41330. a = stack.pop();
  41331. b = stack.pop();
  41332. stack.push(a * b);
  41333. break;
  41334. case 26:
  41335. // sqrt
  41336. a = stack.pop();
  41337. stack.push(Math.sqrt(a));
  41338. break;
  41339. case 27:
  41340. // dup
  41341. a = stack.pop();
  41342. stack.push(a, a);
  41343. break;
  41344. case 28:
  41345. // exch
  41346. a = stack.pop();
  41347. b = stack.pop();
  41348. stack.push(b, a);
  41349. break;
  41350. case 29:
  41351. // index
  41352. idx = stack.pop();
  41353. if (idx < 0) {
  41354. idx = 0;
  41355. } else if (idx > stack.length - 1) {
  41356. idx = stack.length - 1;
  41357. }
  41358. stack.push(stack[idx]);
  41359. break;
  41360. case 30:
  41361. // roll
  41362. var n = stack.pop();
  41363. var _j = stack.pop();
  41364. if (_j >= 0) {
  41365. while (_j > 0) {
  41366. var t = stack[n - 1];
  41367. for (var _i = n - 2; _i >= 0; _i--) {
  41368. stack[_i + 1] = stack[_i];
  41369. }
  41370. stack[0] = t;
  41371. _j--;
  41372. }
  41373. } else {
  41374. while (_j < 0) {
  41375. var t = stack[0];
  41376. for (var _i2 = 0; _i2 <= n; _i2++) {
  41377. stack[_i2] = stack[_i2 + 1];
  41378. }
  41379. stack[n - 1] = t;
  41380. _j++;
  41381. }
  41382. }
  41383. break;
  41384. case 34:
  41385. // hflex
  41386. c1x = x + stack.shift();
  41387. c1y = y;
  41388. c2x = c1x + stack.shift();
  41389. c2y = c1y + stack.shift();
  41390. var c3x = c2x + stack.shift();
  41391. var c3y = c2y;
  41392. var c4x = c3x + stack.shift();
  41393. var c4y = c3y;
  41394. var c5x = c4x + stack.shift();
  41395. var c5y = c4y;
  41396. var c6x = c5x + stack.shift();
  41397. var c6y = c5y;
  41398. x = c6x;
  41399. y = c6y;
  41400. path.bezierCurveTo(c1x, c1y, c2x, c2y, c3x, c3y);
  41401. path.bezierCurveTo(c4x, c4y, c5x, c5y, c6x, c6y);
  41402. break;
  41403. case 35:
  41404. // flex
  41405. var pts = [];
  41406. for (var _i3 = 0; _i3 <= 5; _i3++) {
  41407. x += stack.shift();
  41408. y += stack.shift();
  41409. pts.push(x, y);
  41410. }
  41411. path.bezierCurveTo.apply(path, pts.slice(0, 6));
  41412. path.bezierCurveTo.apply(path, pts.slice(6));
  41413. stack.shift(); // fd
  41414. break;
  41415. case 36:
  41416. // hflex1
  41417. c1x = x + stack.shift();
  41418. c1y = y + stack.shift();
  41419. c2x = c1x + stack.shift();
  41420. c2y = c1y + stack.shift();
  41421. c3x = c2x + stack.shift();
  41422. c3y = c2y;
  41423. c4x = c3x + stack.shift();
  41424. c4y = c3y;
  41425. c5x = c4x + stack.shift();
  41426. c5y = c4y + stack.shift();
  41427. c6x = c5x + stack.shift();
  41428. c6y = c5y;
  41429. x = c6x;
  41430. y = c6y;
  41431. path.bezierCurveTo(c1x, c1y, c2x, c2y, c3x, c3y);
  41432. path.bezierCurveTo(c4x, c4y, c5x, c5y, c6x, c6y);
  41433. break;
  41434. case 37:
  41435. // flex1
  41436. var startx = x;
  41437. var starty = y;
  41438. pts = [];
  41439. for (var _i4 = 0; _i4 <= 4; _i4++) {
  41440. x += stack.shift();
  41441. y += stack.shift();
  41442. pts.push(x, y);
  41443. }
  41444. if (Math.abs(x - startx) > Math.abs(y - starty)) {
  41445. // horizontal
  41446. x += stack.shift();
  41447. y = starty;
  41448. } else {
  41449. x = startx;
  41450. y += stack.shift();
  41451. }
  41452. pts.push(x, y);
  41453. path.bezierCurveTo.apply(path, pts.slice(0, 6));
  41454. path.bezierCurveTo.apply(path, pts.slice(6));
  41455. break;
  41456. default:
  41457. throw new Error('Unknown op: 12 ' + op);
  41458. }
  41459. break;
  41460. default:
  41461. throw new Error('Unknown op: ' + op);
  41462. }
  41463. } else if (op < 247) {
  41464. stack.push(op - 139);
  41465. } else if (op < 251) {
  41466. var b1 = stream.readUInt8();
  41467. stack.push((op - 247) * 256 + b1 + 108);
  41468. } else if (op < 255) {
  41469. var b1 = stream.readUInt8();
  41470. stack.push(-(op - 251) * 256 - b1 - 108);
  41471. } else {
  41472. stack.push(stream.readInt32BE() / 65536);
  41473. }
  41474. }
  41475. };
  41476. parse();
  41477. if (open) {
  41478. path.closePath();
  41479. }
  41480. return path;
  41481. };
  41482. return CFFGlyph;
  41483. }(Glyph);
  41484. var SBIXImage = new r.Struct({
  41485. originX: r.uint16,
  41486. originY: r.uint16,
  41487. type: new r.String(4),
  41488. data: new r.Buffer(function (t) {
  41489. return t.parent.buflen - t._currentOffset;
  41490. })
  41491. });
  41492. /**
  41493. * Represents a color (e.g. emoji) glyph in Apple's SBIX format.
  41494. */
  41495. var SBIXGlyph = function (_TTFGlyph) {
  41496. _inherits(SBIXGlyph, _TTFGlyph);
  41497. function SBIXGlyph() {
  41498. _classCallCheck(this, SBIXGlyph);
  41499. return _possibleConstructorReturn(this, _TTFGlyph.apply(this, arguments));
  41500. }
  41501. /**
  41502. * Returns an object representing a glyph image at the given point size.
  41503. * The object has a data property with a Buffer containing the actual image data,
  41504. * along with the image type, and origin.
  41505. *
  41506. * @param {number} size
  41507. * @return {object}
  41508. */
  41509. SBIXGlyph.prototype.getImageForSize = function getImageForSize(size) {
  41510. for (var i = 0; i < this._font.sbix.imageTables.length; i++) {
  41511. var table = this._font.sbix.imageTables[i];
  41512. if (table.ppem >= size) {
  41513. break;
  41514. }
  41515. }
  41516. var offsets = table.imageOffsets;
  41517. var start = offsets[this.id];
  41518. var end = offsets[this.id + 1];
  41519. if (start === end) {
  41520. return null;
  41521. }
  41522. this._font.stream.pos = start;
  41523. return SBIXImage.decode(this._font.stream, { buflen: end - start });
  41524. };
  41525. SBIXGlyph.prototype.render = function render(ctx, size) {
  41526. var img = this.getImageForSize(size);
  41527. if (img != null) {
  41528. var scale = size / this._font.unitsPerEm;
  41529. ctx.image(img.data, { height: size, x: img.originX, y: (this.bbox.minY - img.originY) * scale });
  41530. }
  41531. if (this._font.sbix.flags.renderOutlines) {
  41532. _TTFGlyph.prototype.render.call(this, ctx, size);
  41533. }
  41534. };
  41535. return SBIXGlyph;
  41536. }(TTFGlyph);
  41537. var COLRLayer = function COLRLayer(glyph, color) {
  41538. _classCallCheck(this, COLRLayer);
  41539. this.glyph = glyph;
  41540. this.color = color;
  41541. };
  41542. /**
  41543. * Represents a color (e.g. emoji) glyph in Microsoft's COLR format.
  41544. * Each glyph in this format contain a list of colored layers, each
  41545. * of which is another vector glyph.
  41546. */
  41547. var COLRGlyph = function (_Glyph) {
  41548. _inherits(COLRGlyph, _Glyph);
  41549. function COLRGlyph() {
  41550. _classCallCheck(this, COLRGlyph);
  41551. return _possibleConstructorReturn(this, _Glyph.apply(this, arguments));
  41552. }
  41553. COLRGlyph.prototype._getBBox = function _getBBox() {
  41554. var bbox = new BBox();
  41555. for (var i = 0; i < this.layers.length; i++) {
  41556. var layer = this.layers[i];
  41557. var b = layer.glyph.bbox;
  41558. bbox.addPoint(b.minX, b.minY);
  41559. bbox.addPoint(b.maxX, b.maxY);
  41560. }
  41561. return bbox;
  41562. };
  41563. /**
  41564. * Returns an array of objects containing the glyph and color for
  41565. * each layer in the composite color glyph.
  41566. * @type {object[]}
  41567. */
  41568. COLRGlyph.prototype.render = function render(ctx, size) {
  41569. for (var _iterator = this.layers, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _getIterator(_iterator);;) {
  41570. var _ref;
  41571. if (_isArray) {
  41572. if (_i >= _iterator.length) break;
  41573. _ref = _iterator[_i++];
  41574. } else {
  41575. _i = _iterator.next();
  41576. if (_i.done) break;
  41577. _ref = _i.value;
  41578. }
  41579. var _ref2 = _ref,
  41580. glyph = _ref2.glyph,
  41581. color = _ref2.color;
  41582. ctx.fillColor([color.red, color.green, color.blue], color.alpha / 255 * 100);
  41583. glyph.render(ctx, size);
  41584. }
  41585. return;
  41586. };
  41587. _createClass(COLRGlyph, [{
  41588. key: 'layers',
  41589. get: function get() {
  41590. var cpal = this._font.CPAL;
  41591. var colr = this._font.COLR;
  41592. var low = 0;
  41593. var high = colr.baseGlyphRecord.length - 1;
  41594. while (low <= high) {
  41595. var mid = low + high >> 1;
  41596. var rec = colr.baseGlyphRecord[mid];
  41597. if (this.id < rec.gid) {
  41598. high = mid - 1;
  41599. } else if (this.id > rec.gid) {
  41600. low = mid + 1;
  41601. } else {
  41602. var baseLayer = rec;
  41603. break;
  41604. }
  41605. }
  41606. // if base glyph not found in COLR table,
  41607. // default to normal glyph from glyf or CFF
  41608. if (baseLayer == null) {
  41609. var g = this._font._getBaseGlyph(this.id);
  41610. var color = {
  41611. red: 0,
  41612. green: 0,
  41613. blue: 0,
  41614. alpha: 255
  41615. };
  41616. return [new COLRLayer(g, color)];
  41617. }
  41618. // otherwise, return an array of all the layers
  41619. var layers = [];
  41620. for (var i = baseLayer.firstLayerIndex; i < baseLayer.firstLayerIndex + baseLayer.numLayers; i++) {
  41621. var rec = colr.layerRecords[i];
  41622. var color = cpal.colorRecords[rec.paletteIndex];
  41623. var g = this._font._getBaseGlyph(rec.gid);
  41624. layers.push(new COLRLayer(g, color));
  41625. }
  41626. return layers;
  41627. }
  41628. }]);
  41629. return COLRGlyph;
  41630. }(Glyph);
  41631. var TUPLES_SHARE_POINT_NUMBERS = 0x8000;
  41632. var TUPLE_COUNT_MASK = 0x0fff;
  41633. var EMBEDDED_TUPLE_COORD = 0x8000;
  41634. var INTERMEDIATE_TUPLE = 0x4000;
  41635. var PRIVATE_POINT_NUMBERS = 0x2000;
  41636. var TUPLE_INDEX_MASK = 0x0fff;
  41637. var POINTS_ARE_WORDS = 0x80;
  41638. var POINT_RUN_COUNT_MASK = 0x7f;
  41639. var DELTAS_ARE_ZERO = 0x80;
  41640. var DELTAS_ARE_WORDS = 0x40;
  41641. var DELTA_RUN_COUNT_MASK = 0x3f;
  41642. /**
  41643. * This class is transforms TrueType glyphs according to the data from
  41644. * the Apple Advanced Typography variation tables (fvar, gvar, and avar).
  41645. * These tables allow infinite adjustments to glyph weight, width, slant,
  41646. * and optical size without the designer needing to specify every exact style.
  41647. *
  41648. * Apple's documentation for these tables is not great, so thanks to the
  41649. * Freetype project for figuring much of this out.
  41650. *
  41651. * @private
  41652. */
  41653. var GlyphVariationProcessor = function () {
  41654. function GlyphVariationProcessor(font, coords) {
  41655. _classCallCheck(this, GlyphVariationProcessor);
  41656. this.font = font;
  41657. this.normalizedCoords = this.normalizeCoords(coords);
  41658. this.blendVectors = new _Map();
  41659. }
  41660. GlyphVariationProcessor.prototype.normalizeCoords = function normalizeCoords(coords) {
  41661. // the default mapping is linear along each axis, in two segments:
  41662. // from the minValue to defaultValue, and from defaultValue to maxValue.
  41663. var normalized = [];
  41664. for (var i = 0; i < this.font.fvar.axis.length; i++) {
  41665. var axis = this.font.fvar.axis[i];
  41666. if (coords[i] < axis.defaultValue) {
  41667. normalized.push((coords[i] - axis.defaultValue + _Number$EPSILON) / (axis.defaultValue - axis.minValue + _Number$EPSILON));
  41668. } else {
  41669. normalized.push((coords[i] - axis.defaultValue + _Number$EPSILON) / (axis.maxValue - axis.defaultValue + _Number$EPSILON));
  41670. }
  41671. }
  41672. // if there is an avar table, the normalized value is calculated
  41673. // by interpolating between the two nearest mapped values.
  41674. if (this.font.avar) {
  41675. for (var i = 0; i < this.font.avar.segment.length; i++) {
  41676. var segment = this.font.avar.segment[i];
  41677. for (var j = 0; j < segment.correspondence.length; j++) {
  41678. var pair = segment.correspondence[j];
  41679. if (j >= 1 && normalized[i] < pair.fromCoord) {
  41680. var prev = segment.correspondence[j - 1];
  41681. normalized[i] = ((normalized[i] - prev.fromCoord) * (pair.toCoord - prev.toCoord) + _Number$EPSILON) / (pair.fromCoord - prev.fromCoord + _Number$EPSILON) + prev.toCoord;
  41682. break;
  41683. }
  41684. }
  41685. }
  41686. }
  41687. return normalized;
  41688. };
  41689. GlyphVariationProcessor.prototype.transformPoints = function transformPoints(gid, glyphPoints) {
  41690. if (!this.font.fvar || !this.font.gvar) {
  41691. return;
  41692. }
  41693. var gvar = this.font.gvar;
  41694. if (gid >= gvar.glyphCount) {
  41695. return;
  41696. }
  41697. var offset = gvar.offsets[gid];
  41698. if (offset === gvar.offsets[gid + 1]) {
  41699. return;
  41700. }
  41701. // Read the gvar data for this glyph
  41702. var stream = this.font.stream;
  41703. stream.pos = offset;
  41704. if (stream.pos >= stream.length) {
  41705. return;
  41706. }
  41707. var tupleCount = stream.readUInt16BE();
  41708. var offsetToData = offset + stream.readUInt16BE();
  41709. if (tupleCount & TUPLES_SHARE_POINT_NUMBERS) {
  41710. var here = stream.pos;
  41711. stream.pos = offsetToData;
  41712. var sharedPoints = this.decodePoints();
  41713. offsetToData = stream.pos;
  41714. stream.pos = here;
  41715. }
  41716. var origPoints = glyphPoints.map(function (pt) {
  41717. return pt.copy();
  41718. });
  41719. tupleCount &= TUPLE_COUNT_MASK;
  41720. for (var i = 0; i < tupleCount; i++) {
  41721. var tupleDataSize = stream.readUInt16BE();
  41722. var tupleIndex = stream.readUInt16BE();
  41723. if (tupleIndex & EMBEDDED_TUPLE_COORD) {
  41724. var tupleCoords = [];
  41725. for (var a = 0; a < gvar.axisCount; a++) {
  41726. tupleCoords.push(stream.readInt16BE() / 16384);
  41727. }
  41728. } else {
  41729. if ((tupleIndex & TUPLE_INDEX_MASK) >= gvar.globalCoordCount) {
  41730. throw new Error('Invalid gvar table');
  41731. }
  41732. var tupleCoords = gvar.globalCoords[tupleIndex & TUPLE_INDEX_MASK];
  41733. }
  41734. if (tupleIndex & INTERMEDIATE_TUPLE) {
  41735. var startCoords = [];
  41736. for (var _a = 0; _a < gvar.axisCount; _a++) {
  41737. startCoords.push(stream.readInt16BE() / 16384);
  41738. }
  41739. var endCoords = [];
  41740. for (var _a2 = 0; _a2 < gvar.axisCount; _a2++) {
  41741. endCoords.push(stream.readInt16BE() / 16384);
  41742. }
  41743. }
  41744. // Get the factor at which to apply this tuple
  41745. var factor = this.tupleFactor(tupleIndex, tupleCoords, startCoords, endCoords);
  41746. if (factor === 0) {
  41747. offsetToData += tupleDataSize;
  41748. continue;
  41749. }
  41750. var here = stream.pos;
  41751. stream.pos = offsetToData;
  41752. if (tupleIndex & PRIVATE_POINT_NUMBERS) {
  41753. var points = this.decodePoints();
  41754. } else {
  41755. var points = sharedPoints;
  41756. }
  41757. // points.length = 0 means there are deltas for all points
  41758. var nPoints = points.length === 0 ? glyphPoints.length : points.length;
  41759. var xDeltas = this.decodeDeltas(nPoints);
  41760. var yDeltas = this.decodeDeltas(nPoints);
  41761. if (points.length === 0) {
  41762. // all points
  41763. for (var _i = 0; _i < glyphPoints.length; _i++) {
  41764. var point = glyphPoints[_i];
  41765. point.x += Math.round(xDeltas[_i] * factor);
  41766. point.y += Math.round(yDeltas[_i] * factor);
  41767. }
  41768. } else {
  41769. var outPoints = origPoints.map(function (pt) {
  41770. return pt.copy();
  41771. });
  41772. var hasDelta = glyphPoints.map(function () {
  41773. return false;
  41774. });
  41775. for (var _i2 = 0; _i2 < points.length; _i2++) {
  41776. var idx = points[_i2];
  41777. if (idx < glyphPoints.length) {
  41778. var _point = outPoints[idx];
  41779. hasDelta[idx] = true;
  41780. _point.x += Math.round(xDeltas[_i2] * factor);
  41781. _point.y += Math.round(yDeltas[_i2] * factor);
  41782. }
  41783. }
  41784. this.interpolateMissingDeltas(outPoints, origPoints, hasDelta);
  41785. for (var _i3 = 0; _i3 < glyphPoints.length; _i3++) {
  41786. var deltaX = outPoints[_i3].x - origPoints[_i3].x;
  41787. var deltaY = outPoints[_i3].y - origPoints[_i3].y;
  41788. glyphPoints[_i3].x += deltaX;
  41789. glyphPoints[_i3].y += deltaY;
  41790. }
  41791. }
  41792. offsetToData += tupleDataSize;
  41793. stream.pos = here;
  41794. }
  41795. };
  41796. GlyphVariationProcessor.prototype.decodePoints = function decodePoints() {
  41797. var stream = this.font.stream;
  41798. var count = stream.readUInt8();
  41799. if (count & POINTS_ARE_WORDS) {
  41800. count = (count & POINT_RUN_COUNT_MASK) << 8 | stream.readUInt8();
  41801. }
  41802. var points = new Uint16Array(count);
  41803. var i = 0;
  41804. var point = 0;
  41805. while (i < count) {
  41806. var run = stream.readUInt8();
  41807. var runCount = (run & POINT_RUN_COUNT_MASK) + 1;
  41808. var fn = run & POINTS_ARE_WORDS ? stream.readUInt16 : stream.readUInt8;
  41809. for (var j = 0; j < runCount && i < count; j++) {
  41810. point += fn.call(stream);
  41811. points[i++] = point;
  41812. }
  41813. }
  41814. return points;
  41815. };
  41816. GlyphVariationProcessor.prototype.decodeDeltas = function decodeDeltas(count) {
  41817. var stream = this.font.stream;
  41818. var i = 0;
  41819. var deltas = new Int16Array(count);
  41820. while (i < count) {
  41821. var run = stream.readUInt8();
  41822. var runCount = (run & DELTA_RUN_COUNT_MASK) + 1;
  41823. if (run & DELTAS_ARE_ZERO) {
  41824. i += runCount;
  41825. } else {
  41826. var fn = run & DELTAS_ARE_WORDS ? stream.readInt16BE : stream.readInt8;
  41827. for (var j = 0; j < runCount && i < count; j++) {
  41828. deltas[i++] = fn.call(stream);
  41829. }
  41830. }
  41831. }
  41832. return deltas;
  41833. };
  41834. GlyphVariationProcessor.prototype.tupleFactor = function tupleFactor(tupleIndex, tupleCoords, startCoords, endCoords) {
  41835. var normalized = this.normalizedCoords;
  41836. var gvar = this.font.gvar;
  41837. var factor = 1;
  41838. for (var i = 0; i < gvar.axisCount; i++) {
  41839. if (tupleCoords[i] === 0) {
  41840. continue;
  41841. }
  41842. if (normalized[i] === 0) {
  41843. return 0;
  41844. }
  41845. if ((tupleIndex & INTERMEDIATE_TUPLE) === 0) {
  41846. if (normalized[i] < Math.min(0, tupleCoords[i]) || normalized[i] > Math.max(0, tupleCoords[i])) {
  41847. return 0;
  41848. }
  41849. factor = (factor * normalized[i] + _Number$EPSILON) / (tupleCoords[i] + _Number$EPSILON);
  41850. } else {
  41851. if (normalized[i] < startCoords[i] || normalized[i] > endCoords[i]) {
  41852. return 0;
  41853. } else if (normalized[i] < tupleCoords[i]) {
  41854. factor = factor * (normalized[i] - startCoords[i] + _Number$EPSILON) / (tupleCoords[i] - startCoords[i] + _Number$EPSILON);
  41855. } else {
  41856. factor = factor * (endCoords[i] - normalized[i] + _Number$EPSILON) / (endCoords[i] - tupleCoords[i] + _Number$EPSILON);
  41857. }
  41858. }
  41859. }
  41860. return factor;
  41861. };
  41862. // Interpolates points without delta values.
  41863. // Needed for the Ø and Q glyphs in Skia.
  41864. // Algorithm from Freetype.
  41865. GlyphVariationProcessor.prototype.interpolateMissingDeltas = function interpolateMissingDeltas(points, inPoints, hasDelta) {
  41866. if (points.length === 0) {
  41867. return;
  41868. }
  41869. var point = 0;
  41870. while (point < points.length) {
  41871. var firstPoint = point;
  41872. // find the end point of the contour
  41873. var endPoint = point;
  41874. var pt = points[endPoint];
  41875. while (!pt.endContour) {
  41876. pt = points[++endPoint];
  41877. }
  41878. // find the first point that has a delta
  41879. while (point <= endPoint && !hasDelta[point]) {
  41880. point++;
  41881. }
  41882. if (point > endPoint) {
  41883. continue;
  41884. }
  41885. var firstDelta = point;
  41886. var curDelta = point;
  41887. point++;
  41888. while (point <= endPoint) {
  41889. // find the next point with a delta, and interpolate intermediate points
  41890. if (hasDelta[point]) {
  41891. this.deltaInterpolate(curDelta + 1, point - 1, curDelta, point, inPoints, points);
  41892. curDelta = point;
  41893. }
  41894. point++;
  41895. }
  41896. // shift contour if we only have a single delta
  41897. if (curDelta === firstDelta) {
  41898. this.deltaShift(firstPoint, endPoint, curDelta, inPoints, points);
  41899. } else {
  41900. // otherwise, handle the remaining points at the end and beginning of the contour
  41901. this.deltaInterpolate(curDelta + 1, endPoint, curDelta, firstDelta, inPoints, points);
  41902. if (firstDelta > 0) {
  41903. this.deltaInterpolate(firstPoint, firstDelta - 1, curDelta, firstDelta, inPoints, points);
  41904. }
  41905. }
  41906. point = endPoint + 1;
  41907. }
  41908. };
  41909. GlyphVariationProcessor.prototype.deltaInterpolate = function deltaInterpolate(p1, p2, ref1, ref2, inPoints, outPoints) {
  41910. if (p1 > p2) {
  41911. return;
  41912. }
  41913. var iterable = ['x', 'y'];
  41914. for (var i = 0; i < iterable.length; i++) {
  41915. var k = iterable[i];
  41916. if (inPoints[ref1][k] > inPoints[ref2][k]) {
  41917. var p = ref1;
  41918. ref1 = ref2;
  41919. ref2 = p;
  41920. }
  41921. var in1 = inPoints[ref1][k];
  41922. var in2 = inPoints[ref2][k];
  41923. var out1 = outPoints[ref1][k];
  41924. var out2 = outPoints[ref2][k];
  41925. // If the reference points have the same coordinate but different
  41926. // delta, inferred delta is zero. Otherwise interpolate.
  41927. if (in1 !== in2 || out1 === out2) {
  41928. var scale = in1 === in2 ? 0 : (out2 - out1) / (in2 - in1);
  41929. for (var _p = p1; _p <= p2; _p++) {
  41930. var out = inPoints[_p][k];
  41931. if (out <= in1) {
  41932. out += out1 - in1;
  41933. } else if (out >= in2) {
  41934. out += out2 - in2;
  41935. } else {
  41936. out = out1 + (out - in1) * scale;
  41937. }
  41938. outPoints[_p][k] = out;
  41939. }
  41940. }
  41941. }
  41942. };
  41943. GlyphVariationProcessor.prototype.deltaShift = function deltaShift(p1, p2, ref, inPoints, outPoints) {
  41944. var deltaX = outPoints[ref].x - inPoints[ref].x;
  41945. var deltaY = outPoints[ref].y - inPoints[ref].y;
  41946. if (deltaX === 0 && deltaY === 0) {
  41947. return;
  41948. }
  41949. for (var p = p1; p <= p2; p++) {
  41950. if (p !== ref) {
  41951. outPoints[p].x += deltaX;
  41952. outPoints[p].y += deltaY;
  41953. }
  41954. }
  41955. };
  41956. GlyphVariationProcessor.prototype.getAdvanceAdjustment = function getAdvanceAdjustment(gid, table) {
  41957. var outerIndex = void 0,
  41958. innerIndex = void 0;
  41959. if (table.advanceWidthMapping) {
  41960. var idx = gid;
  41961. if (idx >= table.advanceWidthMapping.mapCount) {
  41962. idx = table.advanceWidthMapping.mapCount - 1;
  41963. }
  41964. var entryFormat = table.advanceWidthMapping.entryFormat;
  41965. var _table$advanceWidthMa = table.advanceWidthMapping.mapData[idx];
  41966. outerIndex = _table$advanceWidthMa.outerIndex;
  41967. innerIndex = _table$advanceWidthMa.innerIndex;
  41968. } else {
  41969. outerIndex = 0;
  41970. innerIndex = gid;
  41971. }
  41972. return this.getDelta(table.itemVariationStore, outerIndex, innerIndex);
  41973. };
  41974. // See pseudo code from `Font Variations Overview'
  41975. // in the OpenType specification.
  41976. GlyphVariationProcessor.prototype.getDelta = function getDelta(itemStore, outerIndex, innerIndex) {
  41977. if (outerIndex >= itemStore.itemVariationData.length) {
  41978. return 0;
  41979. }
  41980. var varData = itemStore.itemVariationData[outerIndex];
  41981. if (innerIndex >= varData.deltaSets.length) {
  41982. return 0;
  41983. }
  41984. var deltaSet = varData.deltaSets[innerIndex];
  41985. var blendVector = this.getBlendVector(itemStore, outerIndex);
  41986. var netAdjustment = 0;
  41987. for (var master = 0; master < varData.regionIndexCount; master++) {
  41988. netAdjustment += deltaSet.deltas[master] * blendVector[master];
  41989. }
  41990. return netAdjustment;
  41991. };
  41992. GlyphVariationProcessor.prototype.getBlendVector = function getBlendVector(itemStore, outerIndex) {
  41993. var varData = itemStore.itemVariationData[outerIndex];
  41994. if (this.blendVectors.has(varData)) {
  41995. return this.blendVectors.get(varData);
  41996. }
  41997. var normalizedCoords = this.normalizedCoords;
  41998. var blendVector = [];
  41999. // outer loop steps through master designs to be blended
  42000. for (var master = 0; master < varData.regionIndexCount; master++) {
  42001. var scalar = 1;
  42002. var regionIndex = varData.regionIndexes[master];
  42003. var axes = itemStore.variationRegionList.variationRegions[regionIndex];
  42004. // inner loop steps through axes in this region
  42005. for (var j = 0; j < axes.length; j++) {
  42006. var axis = axes[j];
  42007. var axisScalar = void 0;
  42008. // compute the scalar contribution of this axis
  42009. // ignore invalid ranges
  42010. if (axis.startCoord > axis.peakCoord || axis.peakCoord > axis.endCoord) {
  42011. axisScalar = 1;
  42012. } else if (axis.startCoord < 0 && axis.endCoord > 0 && axis.peakCoord !== 0) {
  42013. axisScalar = 1;
  42014. // peak of 0 means ignore this axis
  42015. } else if (axis.peakCoord === 0) {
  42016. axisScalar = 1;
  42017. // ignore this region if coords are out of range
  42018. } else if (normalizedCoords[j] < axis.startCoord || normalizedCoords[j] > axis.endCoord) {
  42019. axisScalar = 0;
  42020. // calculate a proportional factor
  42021. } else {
  42022. if (normalizedCoords[j] === axis.peakCoord) {
  42023. axisScalar = 1;
  42024. } else if (normalizedCoords[j] < axis.peakCoord) {
  42025. axisScalar = (normalizedCoords[j] - axis.startCoord + _Number$EPSILON) / (axis.peakCoord - axis.startCoord + _Number$EPSILON);
  42026. } else {
  42027. axisScalar = (axis.endCoord - normalizedCoords[j] + _Number$EPSILON) / (axis.endCoord - axis.peakCoord + _Number$EPSILON);
  42028. }
  42029. }
  42030. // take product of all the axis scalars
  42031. scalar *= axisScalar;
  42032. }
  42033. blendVector[master] = scalar;
  42034. }
  42035. this.blendVectors.set(varData, blendVector);
  42036. return blendVector;
  42037. };
  42038. return GlyphVariationProcessor;
  42039. }();
  42040. var Subset = function () {
  42041. function Subset(font) {
  42042. _classCallCheck(this, Subset);
  42043. this.font = font;
  42044. this.glyphs = [];
  42045. this.mapping = {};
  42046. // always include the missing glyph
  42047. this.includeGlyph(0);
  42048. }
  42049. Subset.prototype.includeGlyph = function includeGlyph(glyph) {
  42050. if ((typeof glyph === 'undefined' ? 'undefined' : _typeof(glyph)) === 'object') {
  42051. glyph = glyph.id;
  42052. }
  42053. if (this.mapping[glyph] == null) {
  42054. this.glyphs.push(glyph);
  42055. this.mapping[glyph] = this.glyphs.length - 1;
  42056. }
  42057. return this.mapping[glyph];
  42058. };
  42059. Subset.prototype.encodeStream = function encodeStream() {
  42060. var _this = this;
  42061. var s = new r.EncodeStream();
  42062. process.nextTick(function () {
  42063. _this.encode(s);
  42064. return s.end();
  42065. });
  42066. return s;
  42067. };
  42068. return Subset;
  42069. }();
  42070. // Flags for simple glyphs
  42071. var ON_CURVE$1 = 1 << 0;
  42072. var X_SHORT_VECTOR$1 = 1 << 1;
  42073. var Y_SHORT_VECTOR$1 = 1 << 2;
  42074. var REPEAT$1 = 1 << 3;
  42075. var SAME_X$1 = 1 << 4;
  42076. var SAME_Y$1 = 1 << 5;
  42077. var Point$1 = function () {
  42078. function Point() {
  42079. _classCallCheck(this, Point);
  42080. }
  42081. Point.size = function size(val) {
  42082. return val >= 0 && val <= 255 ? 1 : 2;
  42083. };
  42084. Point.encode = function encode(stream, value) {
  42085. if (value >= 0 && value <= 255) {
  42086. stream.writeUInt8(value);
  42087. } else {
  42088. stream.writeInt16BE(value);
  42089. }
  42090. };
  42091. return Point;
  42092. }();
  42093. var Glyf = new r.Struct({
  42094. numberOfContours: r.int16, // if negative, this is a composite glyph
  42095. xMin: r.int16,
  42096. yMin: r.int16,
  42097. xMax: r.int16,
  42098. yMax: r.int16,
  42099. endPtsOfContours: new r.Array(r.uint16, 'numberOfContours'),
  42100. instructions: new r.Array(r.uint8, r.uint16),
  42101. flags: new r.Array(r.uint8, 0),
  42102. xPoints: new r.Array(Point$1, 0),
  42103. yPoints: new r.Array(Point$1, 0)
  42104. });
  42105. /**
  42106. * Encodes TrueType glyph outlines
  42107. */
  42108. var TTFGlyphEncoder = function () {
  42109. function TTFGlyphEncoder() {
  42110. _classCallCheck(this, TTFGlyphEncoder);
  42111. }
  42112. TTFGlyphEncoder.prototype.encodeSimple = function encodeSimple(path) {
  42113. var instructions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  42114. var endPtsOfContours = [];
  42115. var xPoints = [];
  42116. var yPoints = [];
  42117. var flags = [];
  42118. var same = 0;
  42119. var lastX = 0,
  42120. lastY = 0,
  42121. lastFlag = 0;
  42122. var pointCount = 0;
  42123. for (var i = 0; i < path.commands.length; i++) {
  42124. var c = path.commands[i];
  42125. for (var j = 0; j < c.args.length; j += 2) {
  42126. var x = c.args[j];
  42127. var y = c.args[j + 1];
  42128. var flag = 0;
  42129. // If the ending point of a quadratic curve is the midpoint
  42130. // between the control point and the control point of the next
  42131. // quadratic curve, we can omit the ending point.
  42132. if (c.command === 'quadraticCurveTo' && j === 2) {
  42133. var next = path.commands[i + 1];
  42134. if (next && next.command === 'quadraticCurveTo') {
  42135. var midX = (lastX + next.args[0]) / 2;
  42136. var midY = (lastY + next.args[1]) / 2;
  42137. if (x === midX && y === midY) {
  42138. continue;
  42139. }
  42140. }
  42141. }
  42142. // All points except control points are on curve.
  42143. if (!(c.command === 'quadraticCurveTo' && j === 0)) {
  42144. flag |= ON_CURVE$1;
  42145. }
  42146. flag = this._encodePoint(x, lastX, xPoints, flag, X_SHORT_VECTOR$1, SAME_X$1);
  42147. flag = this._encodePoint(y, lastY, yPoints, flag, Y_SHORT_VECTOR$1, SAME_Y$1);
  42148. if (flag === lastFlag && same < 255) {
  42149. flags[flags.length - 1] |= REPEAT$1;
  42150. same++;
  42151. } else {
  42152. if (same > 0) {
  42153. flags.push(same);
  42154. same = 0;
  42155. }
  42156. flags.push(flag);
  42157. lastFlag = flag;
  42158. }
  42159. lastX = x;
  42160. lastY = y;
  42161. pointCount++;
  42162. }
  42163. if (c.command === 'closePath') {
  42164. endPtsOfContours.push(pointCount - 1);
  42165. }
  42166. }
  42167. // Close the path if the last command didn't already
  42168. if (path.commands.length > 1 && path.commands[path.commands.length - 1].command !== 'closePath') {
  42169. endPtsOfContours.push(pointCount - 1);
  42170. }
  42171. var bbox = path.bbox;
  42172. var glyf = {
  42173. numberOfContours: endPtsOfContours.length,
  42174. xMin: bbox.minX,
  42175. yMin: bbox.minY,
  42176. xMax: bbox.maxX,
  42177. yMax: bbox.maxY,
  42178. endPtsOfContours: endPtsOfContours,
  42179. instructions: instructions,
  42180. flags: flags,
  42181. xPoints: xPoints,
  42182. yPoints: yPoints
  42183. };
  42184. var size = Glyf.size(glyf);
  42185. var tail = 4 - size % 4;
  42186. var stream = new r.EncodeStream(size + tail);
  42187. Glyf.encode(stream, glyf);
  42188. // Align to 4-byte length
  42189. if (tail !== 0) {
  42190. stream.fill(0, tail);
  42191. }
  42192. return stream.buffer;
  42193. };
  42194. TTFGlyphEncoder.prototype._encodePoint = function _encodePoint(value, last, points, flag, shortFlag, sameFlag) {
  42195. var diff = value - last;
  42196. if (value === last) {
  42197. flag |= sameFlag;
  42198. } else {
  42199. if (-255 <= diff && diff <= 255) {
  42200. flag |= shortFlag;
  42201. if (diff < 0) {
  42202. diff = -diff;
  42203. } else {
  42204. flag |= sameFlag;
  42205. }
  42206. }
  42207. points.push(diff);
  42208. }
  42209. return flag;
  42210. };
  42211. return TTFGlyphEncoder;
  42212. }();
  42213. var TTFSubset = function (_Subset) {
  42214. _inherits(TTFSubset, _Subset);
  42215. function TTFSubset(font) {
  42216. _classCallCheck(this, TTFSubset);
  42217. var _this = _possibleConstructorReturn(this, _Subset.call(this, font));
  42218. _this.glyphEncoder = new TTFGlyphEncoder();
  42219. return _this;
  42220. }
  42221. TTFSubset.prototype._addGlyph = function _addGlyph(gid) {
  42222. var glyph = this.font.getGlyph(gid);
  42223. var glyf = glyph._decode();
  42224. // get the offset to the glyph from the loca table
  42225. var curOffset = this.font.loca.offsets[gid];
  42226. var nextOffset = this.font.loca.offsets[gid + 1];
  42227. var stream = this.font._getTableStream('glyf');
  42228. stream.pos += curOffset;
  42229. var buffer = stream.readBuffer(nextOffset - curOffset);
  42230. // if it is a compound glyph, include its components
  42231. if (glyf && glyf.numberOfContours < 0) {
  42232. buffer = new Buffer(buffer);
  42233. for (var _iterator = glyf.components, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _getIterator(_iterator);;) {
  42234. var _ref;
  42235. if (_isArray) {
  42236. if (_i >= _iterator.length) break;
  42237. _ref = _iterator[_i++];
  42238. } else {
  42239. _i = _iterator.next();
  42240. if (_i.done) break;
  42241. _ref = _i.value;
  42242. }
  42243. var component = _ref;
  42244. gid = this.includeGlyph(component.glyphID);
  42245. buffer.writeUInt16BE(gid, component.pos);
  42246. }
  42247. } else if (glyf && this.font._variationProcessor) {
  42248. // If this is a TrueType variation glyph, re-encode the path
  42249. buffer = this.glyphEncoder.encodeSimple(glyph.path, glyf.instructions);
  42250. }
  42251. this.glyf.push(buffer);
  42252. this.loca.offsets.push(this.offset);
  42253. this.hmtx.metrics.push({
  42254. advance: glyph.advanceWidth,
  42255. bearing: glyph._getMetrics().leftBearing
  42256. });
  42257. this.offset += buffer.length;
  42258. return this.glyf.length - 1;
  42259. };
  42260. TTFSubset.prototype.encode = function encode(stream) {
  42261. // tables required by PDF spec:
  42262. // head, hhea, loca, maxp, cvt , prep, glyf, hmtx, fpgm
  42263. //
  42264. // additional tables required for standalone fonts:
  42265. // name, cmap, OS/2, post
  42266. this.glyf = [];
  42267. this.offset = 0;
  42268. this.loca = {
  42269. offsets: [],
  42270. version: this.font.loca.version
  42271. };
  42272. this.hmtx = {
  42273. metrics: [],
  42274. bearings: []
  42275. };
  42276. // include all the glyphs
  42277. // not using a for loop because we need to support adding more
  42278. // glyphs to the array as we go, and CoffeeScript caches the length.
  42279. var i = 0;
  42280. while (i < this.glyphs.length) {
  42281. this._addGlyph(this.glyphs[i++]);
  42282. }
  42283. var maxp = cloneDeep(this.font.maxp);
  42284. maxp.numGlyphs = this.glyf.length;
  42285. this.loca.offsets.push(this.offset);
  42286. var head = cloneDeep(this.font.head);
  42287. head.indexToLocFormat = this.loca.version;
  42288. var hhea = cloneDeep(this.font.hhea);
  42289. hhea.numberOfMetrics = this.hmtx.metrics.length;
  42290. // map = []
  42291. // for index in [0...256]
  42292. // if index < @numGlyphs
  42293. // map[index] = index
  42294. // else
  42295. // map[index] = 0
  42296. //
  42297. // cmapTable =
  42298. // version: 0
  42299. // length: 262
  42300. // language: 0
  42301. // codeMap: map
  42302. //
  42303. // cmap =
  42304. // version: 0
  42305. // numSubtables: 1
  42306. // tables: [
  42307. // platformID: 1
  42308. // encodingID: 0
  42309. // table: cmapTable
  42310. // ]
  42311. // TODO: subset prep, cvt, fpgm?
  42312. Directory.encode(stream, {
  42313. tables: {
  42314. head: head,
  42315. hhea: hhea,
  42316. loca: this.loca,
  42317. maxp: maxp,
  42318. 'cvt ': this.font['cvt '],
  42319. prep: this.font.prep,
  42320. glyf: this.glyf,
  42321. hmtx: this.hmtx,
  42322. fpgm: this.font.fpgm
  42323. // name: clone @font.name
  42324. // 'OS/2': clone @font['OS/2']
  42325. // post: clone @font.post
  42326. // cmap: cmap
  42327. }
  42328. });
  42329. };
  42330. return TTFSubset;
  42331. }(Subset);
  42332. var CFFSubset = function (_Subset) {
  42333. _inherits(CFFSubset, _Subset);
  42334. function CFFSubset(font) {
  42335. _classCallCheck(this, CFFSubset);
  42336. var _this = _possibleConstructorReturn(this, _Subset.call(this, font));
  42337. _this.cff = _this.font['CFF '];
  42338. if (!_this.cff) {
  42339. throw new Error('Not a CFF Font');
  42340. }
  42341. return _this;
  42342. }
  42343. CFFSubset.prototype.subsetCharstrings = function subsetCharstrings() {
  42344. this.charstrings = [];
  42345. var gsubrs = {};
  42346. for (var _iterator = this.glyphs, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _getIterator(_iterator);;) {
  42347. var _ref;
  42348. if (_isArray) {
  42349. if (_i >= _iterator.length) break;
  42350. _ref = _iterator[_i++];
  42351. } else {
  42352. _i = _iterator.next();
  42353. if (_i.done) break;
  42354. _ref = _i.value;
  42355. }
  42356. var gid = _ref;
  42357. this.charstrings.push(this.cff.getCharString(gid));
  42358. var glyph = this.font.getGlyph(gid);
  42359. var path = glyph.path; // this causes the glyph to be parsed
  42360. for (var subr in glyph._usedGsubrs) {
  42361. gsubrs[subr] = true;
  42362. }
  42363. }
  42364. this.gsubrs = this.subsetSubrs(this.cff.globalSubrIndex, gsubrs);
  42365. };
  42366. CFFSubset.prototype.subsetSubrs = function subsetSubrs(subrs, used) {
  42367. var res = [];
  42368. for (var i = 0; i < subrs.length; i++) {
  42369. var subr = subrs[i];
  42370. if (used[i]) {
  42371. this.cff.stream.pos = subr.offset;
  42372. res.push(this.cff.stream.readBuffer(subr.length));
  42373. } else {
  42374. res.push(new Buffer([11])); // return
  42375. }
  42376. }
  42377. return res;
  42378. };
  42379. CFFSubset.prototype.subsetFontdict = function subsetFontdict(topDict) {
  42380. topDict.FDArray = [];
  42381. topDict.FDSelect = {
  42382. version: 0,
  42383. fds: []
  42384. };
  42385. var used_fds = {};
  42386. var used_subrs = [];
  42387. for (var _iterator2 = this.glyphs, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _getIterator(_iterator2);;) {
  42388. var _ref2;
  42389. if (_isArray2) {
  42390. if (_i2 >= _iterator2.length) break;
  42391. _ref2 = _iterator2[_i2++];
  42392. } else {
  42393. _i2 = _iterator2.next();
  42394. if (_i2.done) break;
  42395. _ref2 = _i2.value;
  42396. }
  42397. var gid = _ref2;
  42398. var fd = this.cff.fdForGlyph(gid);
  42399. if (fd == null) {
  42400. continue;
  42401. }
  42402. if (!used_fds[fd]) {
  42403. topDict.FDArray.push(_Object$assign({}, this.cff.topDict.FDArray[fd]));
  42404. used_subrs.push({});
  42405. }
  42406. used_fds[fd] = true;
  42407. topDict.FDSelect.fds.push(topDict.FDArray.length - 1);
  42408. var glyph = this.font.getGlyph(gid);
  42409. var path = glyph.path; // this causes the glyph to be parsed
  42410. for (var subr in glyph._usedSubrs) {
  42411. used_subrs[used_subrs.length - 1][subr] = true;
  42412. }
  42413. }
  42414. for (var i = 0; i < topDict.FDArray.length; i++) {
  42415. var dict = topDict.FDArray[i];
  42416. delete dict.FontName;
  42417. if (dict.Private && dict.Private.Subrs) {
  42418. dict.Private = _Object$assign({}, dict.Private);
  42419. dict.Private.Subrs = this.subsetSubrs(dict.Private.Subrs, used_subrs[i]);
  42420. }
  42421. }
  42422. return;
  42423. };
  42424. CFFSubset.prototype.createCIDFontdict = function createCIDFontdict(topDict) {
  42425. var used_subrs = {};
  42426. for (var _iterator3 = this.glyphs, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _getIterator(_iterator3);;) {
  42427. var _ref3;
  42428. if (_isArray3) {
  42429. if (_i3 >= _iterator3.length) break;
  42430. _ref3 = _iterator3[_i3++];
  42431. } else {
  42432. _i3 = _iterator3.next();
  42433. if (_i3.done) break;
  42434. _ref3 = _i3.value;
  42435. }
  42436. var gid = _ref3;
  42437. var glyph = this.font.getGlyph(gid);
  42438. var path = glyph.path; // this causes the glyph to be parsed
  42439. for (var subr in glyph._usedSubrs) {
  42440. used_subrs[subr] = true;
  42441. }
  42442. }
  42443. var privateDict = _Object$assign({}, this.cff.topDict.Private);
  42444. if (this.cff.topDict.Private && this.cff.topDict.Private.Subrs) {
  42445. privateDict.Subrs = this.subsetSubrs(this.cff.topDict.Private.Subrs, used_subrs);
  42446. }
  42447. topDict.FDArray = [{ Private: privateDict }];
  42448. return topDict.FDSelect = {
  42449. version: 3,
  42450. nRanges: 1,
  42451. ranges: [{ first: 0, fd: 0 }],
  42452. sentinel: this.charstrings.length
  42453. };
  42454. };
  42455. CFFSubset.prototype.addString = function addString(string) {
  42456. if (!string) {
  42457. return null;
  42458. }
  42459. if (!this.strings) {
  42460. this.strings = [];
  42461. }
  42462. this.strings.push(string);
  42463. return standardStrings.length + this.strings.length - 1;
  42464. };
  42465. CFFSubset.prototype.encode = function encode(stream) {
  42466. this.subsetCharstrings();
  42467. var charset = {
  42468. version: this.charstrings.length > 255 ? 2 : 1,
  42469. ranges: [{ first: 1, nLeft: this.charstrings.length - 2 }]
  42470. };
  42471. var topDict = _Object$assign({}, this.cff.topDict);
  42472. topDict.Private = null;
  42473. topDict.charset = charset;
  42474. topDict.Encoding = null;
  42475. topDict.CharStrings = this.charstrings;
  42476. var _arr = ['version', 'Notice', 'Copyright', 'FullName', 'FamilyName', 'Weight', 'PostScript', 'BaseFontName', 'FontName'];
  42477. for (var _i4 = 0; _i4 < _arr.length; _i4++) {
  42478. var key = _arr[_i4];
  42479. topDict[key] = this.addString(this.cff.string(topDict[key]));
  42480. }
  42481. topDict.ROS = [this.addString('Adobe'), this.addString('Identity'), 0];
  42482. topDict.CIDCount = this.charstrings.length;
  42483. if (this.cff.isCIDFont) {
  42484. this.subsetFontdict(topDict);
  42485. } else {
  42486. this.createCIDFontdict(topDict);
  42487. }
  42488. var top = {
  42489. version: 1,
  42490. hdrSize: this.cff.hdrSize,
  42491. offSize: 4,
  42492. header: this.cff.header,
  42493. nameIndex: [this.cff.postscriptName],
  42494. topDictIndex: [topDict],
  42495. stringIndex: this.strings,
  42496. globalSubrIndex: this.gsubrs
  42497. };
  42498. CFFTop.encode(stream, top);
  42499. };
  42500. return CFFSubset;
  42501. }(Subset);
  42502. var _class;
  42503. function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) {
  42504. var desc = {};
  42505. Object['ke' + 'ys'](descriptor).forEach(function (key) {
  42506. desc[key] = descriptor[key];
  42507. });
  42508. desc.enumerable = !!desc.enumerable;
  42509. desc.configurable = !!desc.configurable;
  42510. if ('value' in desc || desc.initializer) {
  42511. desc.writable = true;
  42512. }
  42513. desc = decorators.slice().reverse().reduce(function (desc, decorator) {
  42514. return decorator(target, property, desc) || desc;
  42515. }, desc);
  42516. if (context && desc.initializer !== void 0) {
  42517. desc.value = desc.initializer ? desc.initializer.call(context) : void 0;
  42518. desc.initializer = undefined;
  42519. }
  42520. if (desc.initializer === void 0) {
  42521. Object['define' + 'Property'](target, property, desc);
  42522. desc = null;
  42523. }
  42524. return desc;
  42525. }
  42526. /**
  42527. * This is the base class for all SFNT-based font formats in fontkit.
  42528. * It supports TrueType, and PostScript glyphs, and several color glyph formats.
  42529. */
  42530. var TTFFont = (_class = function () {
  42531. TTFFont.probe = function probe(buffer) {
  42532. var format = buffer.toString('ascii', 0, 4);
  42533. return format === 'true' || format === 'OTTO' || format === String.fromCharCode(0, 1, 0, 0);
  42534. };
  42535. function TTFFont(stream) {
  42536. var variationCoords = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
  42537. _classCallCheck(this, TTFFont);
  42538. this.defaultLanguage = null;
  42539. this.stream = stream;
  42540. this.variationCoords = variationCoords;
  42541. this._directoryPos = this.stream.pos;
  42542. this._tables = {};
  42543. this._glyphs = {};
  42544. this._decodeDirectory();
  42545. // define properties for each table to lazily parse
  42546. for (var tag in this.directory.tables) {
  42547. var table = this.directory.tables[tag];
  42548. if (tables[tag] && table.length > 0) {
  42549. _Object$defineProperty(this, tag, {
  42550. get: this._getTable.bind(this, table)
  42551. });
  42552. }
  42553. }
  42554. }
  42555. TTFFont.prototype.setDefaultLanguage = function setDefaultLanguage() {
  42556. var lang = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  42557. this.defaultLanguage = lang;
  42558. };
  42559. TTFFont.prototype._getTable = function _getTable(table) {
  42560. if (!(table.tag in this._tables)) {
  42561. try {
  42562. this._tables[table.tag] = this._decodeTable(table);
  42563. } catch (e) {
  42564. if (fontkit.logErrors) {
  42565. console.error('Error decoding table ' + table.tag);
  42566. console.error(e.stack);
  42567. }
  42568. }
  42569. }
  42570. return this._tables[table.tag];
  42571. };
  42572. TTFFont.prototype._getTableStream = function _getTableStream(tag) {
  42573. var table = this.directory.tables[tag];
  42574. if (table) {
  42575. this.stream.pos = table.offset;
  42576. return this.stream;
  42577. }
  42578. return null;
  42579. };
  42580. TTFFont.prototype._decodeDirectory = function _decodeDirectory() {
  42581. return this.directory = Directory.decode(this.stream, { _startOffset: 0 });
  42582. };
  42583. TTFFont.prototype._decodeTable = function _decodeTable(table) {
  42584. var pos = this.stream.pos;
  42585. var stream = this._getTableStream(table.tag);
  42586. var result = tables[table.tag].decode(stream, this, table.length);
  42587. this.stream.pos = pos;
  42588. return result;
  42589. };
  42590. /**
  42591. * Gets a string from the font's `name` table
  42592. * `lang` is a BCP-47 language code.
  42593. * @return {string}
  42594. */
  42595. TTFFont.prototype.getName = function getName(key) {
  42596. var lang = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.defaultLanguage || fontkit.defaultLanguage;
  42597. var record = this.name && this.name.records[key];
  42598. if (record) {
  42599. // Attempt to retrieve the entry, depending on which translation is available:
  42600. return record[lang] || record[this.defaultLanguage] || record[fontkit.defaultLanguage] || record['en'] || record[_Object$keys(record)[0]] // Seriously, ANY language would be fine
  42601. || null;
  42602. }
  42603. return null;
  42604. };
  42605. /**
  42606. * The unique PostScript name for this font, e.g. "Helvetica-Bold"
  42607. * @type {string}
  42608. */
  42609. /**
  42610. * Returns whether there is glyph in the font for the given unicode code point.
  42611. *
  42612. * @param {number} codePoint
  42613. * @return {boolean}
  42614. */
  42615. TTFFont.prototype.hasGlyphForCodePoint = function hasGlyphForCodePoint(codePoint) {
  42616. return !!this._cmapProcessor.lookup(codePoint);
  42617. };
  42618. /**
  42619. * Maps a single unicode code point to a Glyph object.
  42620. * Does not perform any advanced substitutions (there is no context to do so).
  42621. *
  42622. * @param {number} codePoint
  42623. * @return {Glyph}
  42624. */
  42625. TTFFont.prototype.glyphForCodePoint = function glyphForCodePoint(codePoint) {
  42626. return this.getGlyph(this._cmapProcessor.lookup(codePoint), [codePoint]);
  42627. };
  42628. /**
  42629. * Returns an array of Glyph objects for the given string.
  42630. * This is only a one-to-one mapping from characters to glyphs.
  42631. * For most uses, you should use font.layout (described below), which
  42632. * provides a much more advanced mapping supporting AAT and OpenType shaping.
  42633. *
  42634. * @param {string} string
  42635. * @return {Glyph[]}
  42636. */
  42637. TTFFont.prototype.glyphsForString = function glyphsForString(string) {
  42638. var glyphs = [];
  42639. var len = string.length;
  42640. var idx = 0;
  42641. var last = -1;
  42642. var state = -1;
  42643. while (idx <= len) {
  42644. var code = 0;
  42645. var nextState = 0;
  42646. if (idx < len) {
  42647. // Decode the next codepoint from UTF 16
  42648. code = string.charCodeAt(idx++);
  42649. if (0xd800 <= code && code <= 0xdbff && idx < len) {
  42650. var next = string.charCodeAt(idx);
  42651. if (0xdc00 <= next && next <= 0xdfff) {
  42652. idx++;
  42653. code = ((code & 0x3ff) << 10) + (next & 0x3ff) + 0x10000;
  42654. }
  42655. }
  42656. // Compute the next state: 1 if the next codepoint is a variation selector, 0 otherwise.
  42657. nextState = 0xfe00 <= code && code <= 0xfe0f || 0xe0100 <= code && code <= 0xe01ef ? 1 : 0;
  42658. } else {
  42659. idx++;
  42660. }
  42661. if (state === 0 && nextState === 1) {
  42662. // Variation selector following normal codepoint.
  42663. glyphs.push(this.getGlyph(this._cmapProcessor.lookup(last, code), [last, code]));
  42664. } else if (state === 0 && nextState === 0) {
  42665. // Normal codepoint following normal codepoint.
  42666. glyphs.push(this.glyphForCodePoint(last));
  42667. }
  42668. last = code;
  42669. state = nextState;
  42670. }
  42671. return glyphs;
  42672. };
  42673. /**
  42674. * Returns a GlyphRun object, which includes an array of Glyphs and GlyphPositions for the given string.
  42675. *
  42676. * @param {string} string
  42677. * @param {string[]} [userFeatures]
  42678. * @param {string} [script]
  42679. * @param {string} [language]
  42680. * @param {string} [direction]
  42681. * @return {GlyphRun}
  42682. */
  42683. TTFFont.prototype.layout = function layout(string, userFeatures, script, language, direction) {
  42684. return this._layoutEngine.layout(string, userFeatures, script, language, direction);
  42685. };
  42686. /**
  42687. * Returns an array of strings that map to the given glyph id.
  42688. * @param {number} gid - glyph id
  42689. */
  42690. TTFFont.prototype.stringsForGlyph = function stringsForGlyph(gid) {
  42691. return this._layoutEngine.stringsForGlyph(gid);
  42692. };
  42693. /**
  42694. * An array of all [OpenType feature tags](https://www.microsoft.com/typography/otspec/featuretags.htm)
  42695. * (or mapped AAT tags) supported by the font.
  42696. * The features parameter is an array of OpenType feature tags to be applied in addition to the default set.
  42697. * If this is an AAT font, the OpenType feature tags are mapped to AAT features.
  42698. *
  42699. * @type {string[]}
  42700. */
  42701. TTFFont.prototype.getAvailableFeatures = function getAvailableFeatures(script, language) {
  42702. return this._layoutEngine.getAvailableFeatures(script, language);
  42703. };
  42704. TTFFont.prototype._getBaseGlyph = function _getBaseGlyph(glyph) {
  42705. var characters = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  42706. if (!this._glyphs[glyph]) {
  42707. if (this.directory.tables.glyf) {
  42708. this._glyphs[glyph] = new TTFGlyph(glyph, characters, this);
  42709. } else if (this.directory.tables['CFF '] || this.directory.tables.CFF2) {
  42710. this._glyphs[glyph] = new CFFGlyph(glyph, characters, this);
  42711. }
  42712. }
  42713. return this._glyphs[glyph] || null;
  42714. };
  42715. /**
  42716. * Returns a glyph object for the given glyph id.
  42717. * You can pass the array of code points this glyph represents for
  42718. * your use later, and it will be stored in the glyph object.
  42719. *
  42720. * @param {number} glyph
  42721. * @param {number[]} characters
  42722. * @return {Glyph}
  42723. */
  42724. TTFFont.prototype.getGlyph = function getGlyph(glyph) {
  42725. var characters = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  42726. if (!this._glyphs[glyph]) {
  42727. if (this.directory.tables.sbix) {
  42728. this._glyphs[glyph] = new SBIXGlyph(glyph, characters, this);
  42729. } else if (this.directory.tables.COLR && this.directory.tables.CPAL) {
  42730. this._glyphs[glyph] = new COLRGlyph(glyph, characters, this);
  42731. } else {
  42732. this._getBaseGlyph(glyph, characters);
  42733. }
  42734. }
  42735. return this._glyphs[glyph] || null;
  42736. };
  42737. /**
  42738. * Returns a Subset for this font.
  42739. * @return {Subset}
  42740. */
  42741. TTFFont.prototype.createSubset = function createSubset() {
  42742. if (this.directory.tables['CFF ']) {
  42743. return new CFFSubset(this);
  42744. }
  42745. return new TTFSubset(this);
  42746. };
  42747. /**
  42748. * Returns an object describing the available variation axes
  42749. * that this font supports. Keys are setting tags, and values
  42750. * contain the axis name, range, and default value.
  42751. *
  42752. * @type {object}
  42753. */
  42754. /**
  42755. * Returns a new font with the given variation settings applied.
  42756. * Settings can either be an instance name, or an object containing
  42757. * variation tags as specified by the `variationAxes` property.
  42758. *
  42759. * @param {object} settings
  42760. * @return {TTFFont}
  42761. */
  42762. TTFFont.prototype.getVariation = function getVariation(settings) {
  42763. if (!(this.directory.tables.fvar && (this.directory.tables.gvar && this.directory.tables.glyf || this.directory.tables.CFF2))) {
  42764. throw new Error('Variations require a font with the fvar, gvar and glyf, or CFF2 tables.');
  42765. }
  42766. if (typeof settings === 'string') {
  42767. settings = this.namedVariations[settings];
  42768. }
  42769. if ((typeof settings === 'undefined' ? 'undefined' : _typeof(settings)) !== 'object') {
  42770. throw new Error('Variation settings must be either a variation name or settings object.');
  42771. }
  42772. // normalize the coordinates
  42773. var coords = this.fvar.axis.map(function (axis, i) {
  42774. var axisTag = axis.axisTag.trim();
  42775. if (axisTag in settings) {
  42776. return Math.max(axis.minValue, Math.min(axis.maxValue, settings[axisTag]));
  42777. } else {
  42778. return axis.defaultValue;
  42779. }
  42780. });
  42781. var stream = new r.DecodeStream(this.stream.buffer);
  42782. stream.pos = this._directoryPos;
  42783. var font = new TTFFont(stream, coords);
  42784. font._tables = this._tables;
  42785. return font;
  42786. };
  42787. // Standardized format plugin API
  42788. TTFFont.prototype.getFont = function getFont(name) {
  42789. return this.getVariation(name);
  42790. };
  42791. _createClass(TTFFont, [{
  42792. key: 'postscriptName',
  42793. get: function get() {
  42794. return this.getName('postscriptName');
  42795. }
  42796. /**
  42797. * The font's full name, e.g. "Helvetica Bold"
  42798. * @type {string}
  42799. */
  42800. }, {
  42801. key: 'fullName',
  42802. get: function get() {
  42803. return this.getName('fullName');
  42804. }
  42805. /**
  42806. * The font's family name, e.g. "Helvetica"
  42807. * @type {string}
  42808. */
  42809. }, {
  42810. key: 'familyName',
  42811. get: function get() {
  42812. return this.getName('fontFamily');
  42813. }
  42814. /**
  42815. * The font's sub-family, e.g. "Bold".
  42816. * @type {string}
  42817. */
  42818. }, {
  42819. key: 'subfamilyName',
  42820. get: function get() {
  42821. return this.getName('fontSubfamily');
  42822. }
  42823. /**
  42824. * The font's copyright information
  42825. * @type {string}
  42826. */
  42827. }, {
  42828. key: 'copyright',
  42829. get: function get() {
  42830. return this.getName('copyright');
  42831. }
  42832. /**
  42833. * The font's version number
  42834. * @type {string}
  42835. */
  42836. }, {
  42837. key: 'version',
  42838. get: function get() {
  42839. return this.getName('version');
  42840. }
  42841. /**
  42842. * The font’s [ascender](https://en.wikipedia.org/wiki/Ascender_(typography))
  42843. * @type {number}
  42844. */
  42845. }, {
  42846. key: 'ascent',
  42847. get: function get() {
  42848. return this.hhea.ascent;
  42849. }
  42850. /**
  42851. * The font’s [descender](https://en.wikipedia.org/wiki/Descender)
  42852. * @type {number}
  42853. */
  42854. }, {
  42855. key: 'descent',
  42856. get: function get() {
  42857. return this.hhea.descent;
  42858. }
  42859. /**
  42860. * The amount of space that should be included between lines
  42861. * @type {number}
  42862. */
  42863. }, {
  42864. key: 'lineGap',
  42865. get: function get() {
  42866. return this.hhea.lineGap;
  42867. }
  42868. /**
  42869. * The offset from the normal underline position that should be used
  42870. * @type {number}
  42871. */
  42872. }, {
  42873. key: 'underlinePosition',
  42874. get: function get() {
  42875. return this.post.underlinePosition;
  42876. }
  42877. /**
  42878. * The weight of the underline that should be used
  42879. * @type {number}
  42880. */
  42881. }, {
  42882. key: 'underlineThickness',
  42883. get: function get() {
  42884. return this.post.underlineThickness;
  42885. }
  42886. /**
  42887. * If this is an italic font, the angle the cursor should be drawn at to match the font design
  42888. * @type {number}
  42889. */
  42890. }, {
  42891. key: 'italicAngle',
  42892. get: function get() {
  42893. return this.post.italicAngle;
  42894. }
  42895. /**
  42896. * The height of capital letters above the baseline.
  42897. * See [here](https://en.wikipedia.org/wiki/Cap_height) for more details.
  42898. * @type {number}
  42899. */
  42900. }, {
  42901. key: 'capHeight',
  42902. get: function get() {
  42903. var os2 = this['OS/2'];
  42904. return os2 ? os2.capHeight : this.ascent;
  42905. }
  42906. /**
  42907. * The height of lower case letters in the font.
  42908. * See [here](https://en.wikipedia.org/wiki/X-height) for more details.
  42909. * @type {number}
  42910. */
  42911. }, {
  42912. key: 'xHeight',
  42913. get: function get() {
  42914. var os2 = this['OS/2'];
  42915. return os2 ? os2.xHeight : 0;
  42916. }
  42917. /**
  42918. * The number of glyphs in the font.
  42919. * @type {number}
  42920. */
  42921. }, {
  42922. key: 'numGlyphs',
  42923. get: function get() {
  42924. return this.maxp.numGlyphs;
  42925. }
  42926. /**
  42927. * The size of the font’s internal coordinate grid
  42928. * @type {number}
  42929. */
  42930. }, {
  42931. key: 'unitsPerEm',
  42932. get: function get() {
  42933. return this.head.unitsPerEm;
  42934. }
  42935. /**
  42936. * The font’s bounding box, i.e. the box that encloses all glyphs in the font.
  42937. * @type {BBox}
  42938. */
  42939. }, {
  42940. key: 'bbox',
  42941. get: function get() {
  42942. return _Object$freeze(new BBox(this.head.xMin, this.head.yMin, this.head.xMax, this.head.yMax));
  42943. }
  42944. }, {
  42945. key: '_cmapProcessor',
  42946. get: function get() {
  42947. return new CmapProcessor(this.cmap);
  42948. }
  42949. /**
  42950. * An array of all of the unicode code points supported by the font.
  42951. * @type {number[]}
  42952. */
  42953. }, {
  42954. key: 'characterSet',
  42955. get: function get() {
  42956. return this._cmapProcessor.getCharacterSet();
  42957. }
  42958. }, {
  42959. key: '_layoutEngine',
  42960. get: function get() {
  42961. return new LayoutEngine(this);
  42962. }
  42963. }, {
  42964. key: 'availableFeatures',
  42965. get: function get() {
  42966. return this._layoutEngine.getAvailableFeatures();
  42967. }
  42968. }, {
  42969. key: 'variationAxes',
  42970. get: function get() {
  42971. var res = {};
  42972. if (!this.fvar) {
  42973. return res;
  42974. }
  42975. for (var _iterator = this.fvar.axis, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _getIterator(_iterator);;) {
  42976. var _ref;
  42977. if (_isArray) {
  42978. if (_i >= _iterator.length) break;
  42979. _ref = _iterator[_i++];
  42980. } else {
  42981. _i = _iterator.next();
  42982. if (_i.done) break;
  42983. _ref = _i.value;
  42984. }
  42985. var axis = _ref;
  42986. res[axis.axisTag.trim()] = {
  42987. name: axis.name.en,
  42988. min: axis.minValue,
  42989. default: axis.defaultValue,
  42990. max: axis.maxValue
  42991. };
  42992. }
  42993. return res;
  42994. }
  42995. /**
  42996. * Returns an object describing the named variation instances
  42997. * that the font designer has specified. Keys are variation names
  42998. * and values are the variation settings for this instance.
  42999. *
  43000. * @type {object}
  43001. */
  43002. }, {
  43003. key: 'namedVariations',
  43004. get: function get() {
  43005. var res = {};
  43006. if (!this.fvar) {
  43007. return res;
  43008. }
  43009. for (var _iterator2 = this.fvar.instance, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _getIterator(_iterator2);;) {
  43010. var _ref2;
  43011. if (_isArray2) {
  43012. if (_i2 >= _iterator2.length) break;
  43013. _ref2 = _iterator2[_i2++];
  43014. } else {
  43015. _i2 = _iterator2.next();
  43016. if (_i2.done) break;
  43017. _ref2 = _i2.value;
  43018. }
  43019. var instance = _ref2;
  43020. var settings = {};
  43021. for (var i = 0; i < this.fvar.axis.length; i++) {
  43022. var axis = this.fvar.axis[i];
  43023. settings[axis.axisTag.trim()] = instance.coord[i];
  43024. }
  43025. res[instance.name.en] = settings;
  43026. }
  43027. return res;
  43028. }
  43029. }, {
  43030. key: '_variationProcessor',
  43031. get: function get() {
  43032. if (!this.fvar) {
  43033. return null;
  43034. }
  43035. var variationCoords = this.variationCoords;
  43036. // Ignore if no variation coords and not CFF2
  43037. if (!variationCoords && !this.CFF2) {
  43038. return null;
  43039. }
  43040. if (!variationCoords) {
  43041. variationCoords = this.fvar.axis.map(function (axis) {
  43042. return axis.defaultValue;
  43043. });
  43044. }
  43045. return new GlyphVariationProcessor(this, variationCoords);
  43046. }
  43047. }]);
  43048. return TTFFont;
  43049. }(), (_applyDecoratedDescriptor(_class.prototype, 'bbox', [cache], _Object$getOwnPropertyDescriptor(_class.prototype, 'bbox'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, '_cmapProcessor', [cache], _Object$getOwnPropertyDescriptor(_class.prototype, '_cmapProcessor'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'characterSet', [cache], _Object$getOwnPropertyDescriptor(_class.prototype, 'characterSet'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, '_layoutEngine', [cache], _Object$getOwnPropertyDescriptor(_class.prototype, '_layoutEngine'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'variationAxes', [cache], _Object$getOwnPropertyDescriptor(_class.prototype, 'variationAxes'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'namedVariations', [cache], _Object$getOwnPropertyDescriptor(_class.prototype, 'namedVariations'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, '_variationProcessor', [cache], _Object$getOwnPropertyDescriptor(_class.prototype, '_variationProcessor'), _class.prototype)), _class);
  43050. var WOFFDirectoryEntry = new r.Struct({
  43051. tag: new r.String(4),
  43052. offset: new r.Pointer(r.uint32, 'void', { type: 'global' }),
  43053. compLength: r.uint32,
  43054. length: r.uint32,
  43055. origChecksum: r.uint32
  43056. });
  43057. var WOFFDirectory = new r.Struct({
  43058. tag: new r.String(4), // should be 'wOFF'
  43059. flavor: r.uint32,
  43060. length: r.uint32,
  43061. numTables: r.uint16,
  43062. reserved: new r.Reserved(r.uint16),
  43063. totalSfntSize: r.uint32,
  43064. majorVersion: r.uint16,
  43065. minorVersion: r.uint16,
  43066. metaOffset: r.uint32,
  43067. metaLength: r.uint32,
  43068. metaOrigLength: r.uint32,
  43069. privOffset: r.uint32,
  43070. privLength: r.uint32,
  43071. tables: new r.Array(WOFFDirectoryEntry, 'numTables')
  43072. });
  43073. WOFFDirectory.process = function () {
  43074. var tables = {};
  43075. for (var _iterator = this.tables, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _getIterator(_iterator);;) {
  43076. var _ref;
  43077. if (_isArray) {
  43078. if (_i >= _iterator.length) break;
  43079. _ref = _iterator[_i++];
  43080. } else {
  43081. _i = _iterator.next();
  43082. if (_i.done) break;
  43083. _ref = _i.value;
  43084. }
  43085. var table = _ref;
  43086. tables[table.tag] = table;
  43087. }
  43088. this.tables = tables;
  43089. };
  43090. var WOFFFont = function (_TTFFont) {
  43091. _inherits(WOFFFont, _TTFFont);
  43092. function WOFFFont() {
  43093. _classCallCheck(this, WOFFFont);
  43094. return _possibleConstructorReturn(this, _TTFFont.apply(this, arguments));
  43095. }
  43096. WOFFFont.probe = function probe(buffer) {
  43097. return buffer.toString('ascii', 0, 4) === 'wOFF';
  43098. };
  43099. WOFFFont.prototype._decodeDirectory = function _decodeDirectory() {
  43100. this.directory = WOFFDirectory.decode(this.stream, { _startOffset: 0 });
  43101. };
  43102. WOFFFont.prototype._getTableStream = function _getTableStream(tag) {
  43103. var table = this.directory.tables[tag];
  43104. if (table) {
  43105. this.stream.pos = table.offset;
  43106. if (table.compLength < table.length) {
  43107. this.stream.pos += 2; // skip deflate header
  43108. var outBuffer = new Buffer(table.length);
  43109. var buf = inflate(this.stream.readBuffer(table.compLength - 2), outBuffer);
  43110. return new r.DecodeStream(buf);
  43111. } else {
  43112. return this.stream;
  43113. }
  43114. }
  43115. return null;
  43116. };
  43117. return WOFFFont;
  43118. }(TTFFont);
  43119. /**
  43120. * Represents a TrueType glyph in the WOFF2 format, which compresses glyphs differently.
  43121. */
  43122. var WOFF2Glyph = function (_TTFGlyph) {
  43123. _inherits(WOFF2Glyph, _TTFGlyph);
  43124. function WOFF2Glyph() {
  43125. _classCallCheck(this, WOFF2Glyph);
  43126. return _possibleConstructorReturn(this, _TTFGlyph.apply(this, arguments));
  43127. }
  43128. WOFF2Glyph.prototype._decode = function _decode() {
  43129. // We have to decode in advance (in WOFF2Font), so just return the pre-decoded data.
  43130. return this._font._transformedGlyphs[this.id];
  43131. };
  43132. WOFF2Glyph.prototype._getCBox = function _getCBox() {
  43133. return this.path.bbox;
  43134. };
  43135. return WOFF2Glyph;
  43136. }(TTFGlyph);
  43137. var Base128 = {
  43138. decode: function decode(stream) {
  43139. var result = 0;
  43140. var iterable = [0, 1, 2, 3, 4];
  43141. for (var j = 0; j < iterable.length; j++) {
  43142. var i = iterable[j];
  43143. var code = stream.readUInt8();
  43144. // If any of the top seven bits are set then we're about to overflow.
  43145. if (result & 0xe0000000) {
  43146. throw new Error('Overflow');
  43147. }
  43148. result = result << 7 | code & 0x7f;
  43149. if ((code & 0x80) === 0) {
  43150. return result;
  43151. }
  43152. }
  43153. throw new Error('Bad base 128 number');
  43154. }
  43155. };
  43156. var knownTags = ['cmap', 'head', 'hhea', 'hmtx', 'maxp', 'name', 'OS/2', 'post', 'cvt ', 'fpgm', 'glyf', 'loca', 'prep', 'CFF ', 'VORG', 'EBDT', 'EBLC', 'gasp', 'hdmx', 'kern', 'LTSH', 'PCLT', 'VDMX', 'vhea', 'vmtx', 'BASE', 'GDEF', 'GPOS', 'GSUB', 'EBSC', 'JSTF', 'MATH', 'CBDT', 'CBLC', 'COLR', 'CPAL', 'SVG ', 'sbix', 'acnt', 'avar', 'bdat', 'bloc', 'bsln', 'cvar', 'fdsc', 'feat', 'fmtx', 'fvar', 'gvar', 'hsty', 'just', 'lcar', 'mort', 'morx', 'opbd', 'prop', 'trak', 'Zapf', 'Silf', 'Glat', 'Gloc', 'Feat', 'Sill'];
  43157. var WOFF2DirectoryEntry = new r.Struct({
  43158. flags: r.uint8,
  43159. customTag: new r.Optional(new r.String(4), function (t) {
  43160. return (t.flags & 0x3f) === 0x3f;
  43161. }),
  43162. tag: function tag(t) {
  43163. return t.customTag || knownTags[t.flags & 0x3f];
  43164. }, // || (() => { throw new Error(`Bad tag: ${flags & 0x3f}`); })(); },
  43165. length: Base128,
  43166. transformVersion: function transformVersion(t) {
  43167. return t.flags >>> 6 & 0x03;
  43168. },
  43169. transformed: function transformed(t) {
  43170. return t.tag === 'glyf' || t.tag === 'loca' ? t.transformVersion === 0 : t.transformVersion !== 0;
  43171. },
  43172. transformLength: new r.Optional(Base128, function (t) {
  43173. return t.transformed;
  43174. })
  43175. });
  43176. var WOFF2Directory = new r.Struct({
  43177. tag: new r.String(4), // should be 'wOF2'
  43178. flavor: r.uint32,
  43179. length: r.uint32,
  43180. numTables: r.uint16,
  43181. reserved: new r.Reserved(r.uint16),
  43182. totalSfntSize: r.uint32,
  43183. totalCompressedSize: r.uint32,
  43184. majorVersion: r.uint16,
  43185. minorVersion: r.uint16,
  43186. metaOffset: r.uint32,
  43187. metaLength: r.uint32,
  43188. metaOrigLength: r.uint32,
  43189. privOffset: r.uint32,
  43190. privLength: r.uint32,
  43191. tables: new r.Array(WOFF2DirectoryEntry, 'numTables')
  43192. });
  43193. WOFF2Directory.process = function () {
  43194. var tables = {};
  43195. for (var i = 0; i < this.tables.length; i++) {
  43196. var table = this.tables[i];
  43197. tables[table.tag] = table;
  43198. }
  43199. return this.tables = tables;
  43200. };
  43201. /**
  43202. * Subclass of TTFFont that represents a TTF/OTF font compressed by WOFF2
  43203. * See spec here: http://www.w3.org/TR/WOFF2/
  43204. */
  43205. var WOFF2Font = function (_TTFFont) {
  43206. _inherits(WOFF2Font, _TTFFont);
  43207. function WOFF2Font() {
  43208. _classCallCheck(this, WOFF2Font);
  43209. return _possibleConstructorReturn(this, _TTFFont.apply(this, arguments));
  43210. }
  43211. WOFF2Font.probe = function probe(buffer) {
  43212. return buffer.toString('ascii', 0, 4) === 'wOF2';
  43213. };
  43214. WOFF2Font.prototype._decodeDirectory = function _decodeDirectory() {
  43215. this.directory = WOFF2Directory.decode(this.stream);
  43216. this._dataPos = this.stream.pos;
  43217. };
  43218. WOFF2Font.prototype._decompress = function _decompress() {
  43219. // decompress data and setup table offsets if we haven't already
  43220. if (!this._decompressed) {
  43221. this.stream.pos = this._dataPos;
  43222. var buffer = this.stream.readBuffer(this.directory.totalCompressedSize);
  43223. var decompressedSize = 0;
  43224. for (var tag in this.directory.tables) {
  43225. var entry = this.directory.tables[tag];
  43226. entry.offset = decompressedSize;
  43227. decompressedSize += entry.transformLength != null ? entry.transformLength : entry.length;
  43228. }
  43229. var decompressed = brotli(buffer, decompressedSize);
  43230. if (!decompressed) {
  43231. throw new Error('Error decoding compressed data in WOFF2');
  43232. }
  43233. this.stream = new r.DecodeStream(new Buffer(decompressed));
  43234. this._decompressed = true;
  43235. }
  43236. };
  43237. WOFF2Font.prototype._decodeTable = function _decodeTable(table) {
  43238. this._decompress();
  43239. return _TTFFont.prototype._decodeTable.call(this, table);
  43240. };
  43241. // Override this method to get a glyph and return our
  43242. // custom subclass if there is a glyf table.
  43243. WOFF2Font.prototype._getBaseGlyph = function _getBaseGlyph(glyph) {
  43244. var characters = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  43245. if (!this._glyphs[glyph]) {
  43246. if (this.directory.tables.glyf && this.directory.tables.glyf.transformed) {
  43247. if (!this._transformedGlyphs) {
  43248. this._transformGlyfTable();
  43249. }
  43250. return this._glyphs[glyph] = new WOFF2Glyph(glyph, characters, this);
  43251. } else {
  43252. return _TTFFont.prototype._getBaseGlyph.call(this, glyph, characters);
  43253. }
  43254. }
  43255. };
  43256. WOFF2Font.prototype._transformGlyfTable = function _transformGlyfTable() {
  43257. this._decompress();
  43258. this.stream.pos = this.directory.tables.glyf.offset;
  43259. var table = GlyfTable.decode(this.stream);
  43260. var glyphs = [];
  43261. for (var index = 0; index < table.numGlyphs; index++) {
  43262. var glyph = {};
  43263. var nContours = table.nContours.readInt16BE();
  43264. glyph.numberOfContours = nContours;
  43265. if (nContours > 0) {
  43266. // simple glyph
  43267. var nPoints = [];
  43268. var totalPoints = 0;
  43269. for (var i = 0; i < nContours; i++) {
  43270. var _r = read255UInt16(table.nPoints);
  43271. totalPoints += _r;
  43272. nPoints.push(totalPoints);
  43273. }
  43274. glyph.points = decodeTriplet(table.flags, table.glyphs, totalPoints);
  43275. for (var _i = 0; _i < nContours; _i++) {
  43276. glyph.points[nPoints[_i] - 1].endContour = true;
  43277. }
  43278. var instructionSize = read255UInt16(table.glyphs);
  43279. } else if (nContours < 0) {
  43280. // composite glyph
  43281. var haveInstructions = TTFGlyph.prototype._decodeComposite.call({ _font: this }, glyph, table.composites);
  43282. if (haveInstructions) {
  43283. var instructionSize = read255UInt16(table.glyphs);
  43284. }
  43285. }
  43286. glyphs.push(glyph);
  43287. }
  43288. this._transformedGlyphs = glyphs;
  43289. };
  43290. return WOFF2Font;
  43291. }(TTFFont);
  43292. var Substream = function () {
  43293. function Substream(length) {
  43294. _classCallCheck(this, Substream);
  43295. this.length = length;
  43296. this._buf = new r.Buffer(length);
  43297. }
  43298. Substream.prototype.decode = function decode(stream, parent) {
  43299. return new r.DecodeStream(this._buf.decode(stream, parent));
  43300. };
  43301. return Substream;
  43302. }();
  43303. // This struct represents the entire glyf table
  43304. var GlyfTable = new r.Struct({
  43305. version: r.uint32,
  43306. numGlyphs: r.uint16,
  43307. indexFormat: r.uint16,
  43308. nContourStreamSize: r.uint32,
  43309. nPointsStreamSize: r.uint32,
  43310. flagStreamSize: r.uint32,
  43311. glyphStreamSize: r.uint32,
  43312. compositeStreamSize: r.uint32,
  43313. bboxStreamSize: r.uint32,
  43314. instructionStreamSize: r.uint32,
  43315. nContours: new Substream('nContourStreamSize'),
  43316. nPoints: new Substream('nPointsStreamSize'),
  43317. flags: new Substream('flagStreamSize'),
  43318. glyphs: new Substream('glyphStreamSize'),
  43319. composites: new Substream('compositeStreamSize'),
  43320. bboxes: new Substream('bboxStreamSize'),
  43321. instructions: new Substream('instructionStreamSize')
  43322. });
  43323. var WORD_CODE = 253;
  43324. var ONE_MORE_BYTE_CODE2 = 254;
  43325. var ONE_MORE_BYTE_CODE1 = 255;
  43326. var LOWEST_U_CODE = 253;
  43327. function read255UInt16(stream) {
  43328. var code = stream.readUInt8();
  43329. if (code === WORD_CODE) {
  43330. return stream.readUInt16BE();
  43331. }
  43332. if (code === ONE_MORE_BYTE_CODE1) {
  43333. return stream.readUInt8() + LOWEST_U_CODE;
  43334. }
  43335. if (code === ONE_MORE_BYTE_CODE2) {
  43336. return stream.readUInt8() + LOWEST_U_CODE * 2;
  43337. }
  43338. return code;
  43339. }
  43340. function withSign(flag, baseval) {
  43341. return flag & 1 ? baseval : -baseval;
  43342. }
  43343. function decodeTriplet(flags, glyphs, nPoints) {
  43344. var y = void 0;
  43345. var x = y = 0;
  43346. var res = [];
  43347. for (var i = 0; i < nPoints; i++) {
  43348. var dx = 0,
  43349. dy = 0;
  43350. var flag = flags.readUInt8();
  43351. var onCurve = !(flag >> 7);
  43352. flag &= 0x7f;
  43353. if (flag < 10) {
  43354. dx = 0;
  43355. dy = withSign(flag, ((flag & 14) << 7) + glyphs.readUInt8());
  43356. } else if (flag < 20) {
  43357. dx = withSign(flag, ((flag - 10 & 14) << 7) + glyphs.readUInt8());
  43358. dy = 0;
  43359. } else if (flag < 84) {
  43360. var b0 = flag - 20;
  43361. var b1 = glyphs.readUInt8();
  43362. dx = withSign(flag, 1 + (b0 & 0x30) + (b1 >> 4));
  43363. dy = withSign(flag >> 1, 1 + ((b0 & 0x0c) << 2) + (b1 & 0x0f));
  43364. } else if (flag < 120) {
  43365. var b0 = flag - 84;
  43366. dx = withSign(flag, 1 + (b0 / 12 << 8) + glyphs.readUInt8());
  43367. dy = withSign(flag >> 1, 1 + (b0 % 12 >> 2 << 8) + glyphs.readUInt8());
  43368. } else if (flag < 124) {
  43369. var b1 = glyphs.readUInt8();
  43370. var b2 = glyphs.readUInt8();
  43371. dx = withSign(flag, (b1 << 4) + (b2 >> 4));
  43372. dy = withSign(flag >> 1, ((b2 & 0x0f) << 8) + glyphs.readUInt8());
  43373. } else {
  43374. dx = withSign(flag, glyphs.readUInt16BE());
  43375. dy = withSign(flag >> 1, glyphs.readUInt16BE());
  43376. }
  43377. x += dx;
  43378. y += dy;
  43379. res.push(new Point(onCurve, false, x, y));
  43380. }
  43381. return res;
  43382. }
  43383. var TTCHeader = new r.VersionedStruct(r.uint32, {
  43384. 0x00010000: {
  43385. numFonts: r.uint32,
  43386. offsets: new r.Array(r.uint32, 'numFonts')
  43387. },
  43388. 0x00020000: {
  43389. numFonts: r.uint32,
  43390. offsets: new r.Array(r.uint32, 'numFonts'),
  43391. dsigTag: r.uint32,
  43392. dsigLength: r.uint32,
  43393. dsigOffset: r.uint32
  43394. }
  43395. });
  43396. var TrueTypeCollection = function () {
  43397. TrueTypeCollection.probe = function probe(buffer) {
  43398. return buffer.toString('ascii', 0, 4) === 'ttcf';
  43399. };
  43400. function TrueTypeCollection(stream) {
  43401. _classCallCheck(this, TrueTypeCollection);
  43402. this.stream = stream;
  43403. if (stream.readString(4) !== 'ttcf') {
  43404. throw new Error('Not a TrueType collection');
  43405. }
  43406. this.header = TTCHeader.decode(stream);
  43407. }
  43408. TrueTypeCollection.prototype.getFont = function getFont(name) {
  43409. for (var _iterator = this.header.offsets, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _getIterator(_iterator);;) {
  43410. var _ref;
  43411. if (_isArray) {
  43412. if (_i >= _iterator.length) break;
  43413. _ref = _iterator[_i++];
  43414. } else {
  43415. _i = _iterator.next();
  43416. if (_i.done) break;
  43417. _ref = _i.value;
  43418. }
  43419. var offset = _ref;
  43420. var stream = new r.DecodeStream(this.stream.buffer);
  43421. stream.pos = offset;
  43422. var font = new TTFFont(stream);
  43423. if (font.postscriptName === name) {
  43424. return font;
  43425. }
  43426. }
  43427. return null;
  43428. };
  43429. _createClass(TrueTypeCollection, [{
  43430. key: 'fonts',
  43431. get: function get() {
  43432. var fonts = [];
  43433. for (var _iterator2 = this.header.offsets, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _getIterator(_iterator2);;) {
  43434. var _ref2;
  43435. if (_isArray2) {
  43436. if (_i2 >= _iterator2.length) break;
  43437. _ref2 = _iterator2[_i2++];
  43438. } else {
  43439. _i2 = _iterator2.next();
  43440. if (_i2.done) break;
  43441. _ref2 = _i2.value;
  43442. }
  43443. var offset = _ref2;
  43444. var stream = new r.DecodeStream(this.stream.buffer);
  43445. stream.pos = offset;
  43446. fonts.push(new TTFFont(stream));
  43447. }
  43448. return fonts;
  43449. }
  43450. }]);
  43451. return TrueTypeCollection;
  43452. }();
  43453. var DFontName = new r.String(r.uint8);
  43454. var DFontData = new r.Struct({
  43455. len: r.uint32,
  43456. buf: new r.Buffer('len')
  43457. });
  43458. var Ref = new r.Struct({
  43459. id: r.uint16,
  43460. nameOffset: r.int16,
  43461. attr: r.uint8,
  43462. dataOffset: r.uint24,
  43463. handle: r.uint32
  43464. });
  43465. var Type = new r.Struct({
  43466. name: new r.String(4),
  43467. maxTypeIndex: r.uint16,
  43468. refList: new r.Pointer(r.uint16, new r.Array(Ref, function (t) {
  43469. return t.maxTypeIndex + 1;
  43470. }), { type: 'parent' })
  43471. });
  43472. var TypeList = new r.Struct({
  43473. length: r.uint16,
  43474. types: new r.Array(Type, function (t) {
  43475. return t.length + 1;
  43476. })
  43477. });
  43478. var DFontMap = new r.Struct({
  43479. reserved: new r.Reserved(r.uint8, 24),
  43480. typeList: new r.Pointer(r.uint16, TypeList),
  43481. nameListOffset: new r.Pointer(r.uint16, 'void')
  43482. });
  43483. var DFontHeader = new r.Struct({
  43484. dataOffset: r.uint32,
  43485. map: new r.Pointer(r.uint32, DFontMap),
  43486. dataLength: r.uint32,
  43487. mapLength: r.uint32
  43488. });
  43489. var DFont = function () {
  43490. DFont.probe = function probe(buffer) {
  43491. var stream = new r.DecodeStream(buffer);
  43492. try {
  43493. var header = DFontHeader.decode(stream);
  43494. } catch (e) {
  43495. return false;
  43496. }
  43497. for (var _iterator = header.map.typeList.types, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _getIterator(_iterator);;) {
  43498. var _ref;
  43499. if (_isArray) {
  43500. if (_i >= _iterator.length) break;
  43501. _ref = _iterator[_i++];
  43502. } else {
  43503. _i = _iterator.next();
  43504. if (_i.done) break;
  43505. _ref = _i.value;
  43506. }
  43507. var type = _ref;
  43508. if (type.name === 'sfnt') {
  43509. return true;
  43510. }
  43511. }
  43512. return false;
  43513. };
  43514. function DFont(stream) {
  43515. _classCallCheck(this, DFont);
  43516. this.stream = stream;
  43517. this.header = DFontHeader.decode(this.stream);
  43518. for (var _iterator2 = this.header.map.typeList.types, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _getIterator(_iterator2);;) {
  43519. var _ref2;
  43520. if (_isArray2) {
  43521. if (_i2 >= _iterator2.length) break;
  43522. _ref2 = _iterator2[_i2++];
  43523. } else {
  43524. _i2 = _iterator2.next();
  43525. if (_i2.done) break;
  43526. _ref2 = _i2.value;
  43527. }
  43528. var type = _ref2;
  43529. for (var _iterator3 = type.refList, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _getIterator(_iterator3);;) {
  43530. var _ref3;
  43531. if (_isArray3) {
  43532. if (_i3 >= _iterator3.length) break;
  43533. _ref3 = _iterator3[_i3++];
  43534. } else {
  43535. _i3 = _iterator3.next();
  43536. if (_i3.done) break;
  43537. _ref3 = _i3.value;
  43538. }
  43539. var ref = _ref3;
  43540. if (ref.nameOffset >= 0) {
  43541. this.stream.pos = ref.nameOffset + this.header.map.nameListOffset;
  43542. ref.name = DFontName.decode(this.stream);
  43543. } else {
  43544. ref.name = null;
  43545. }
  43546. }
  43547. if (type.name === 'sfnt') {
  43548. this.sfnt = type;
  43549. }
  43550. }
  43551. }
  43552. DFont.prototype.getFont = function getFont(name) {
  43553. if (!this.sfnt) {
  43554. return null;
  43555. }
  43556. for (var _iterator4 = this.sfnt.refList, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _getIterator(_iterator4);;) {
  43557. var _ref4;
  43558. if (_isArray4) {
  43559. if (_i4 >= _iterator4.length) break;
  43560. _ref4 = _iterator4[_i4++];
  43561. } else {
  43562. _i4 = _iterator4.next();
  43563. if (_i4.done) break;
  43564. _ref4 = _i4.value;
  43565. }
  43566. var ref = _ref4;
  43567. var pos = this.header.dataOffset + ref.dataOffset + 4;
  43568. var stream = new r.DecodeStream(this.stream.buffer.slice(pos));
  43569. var font = new TTFFont(stream);
  43570. if (font.postscriptName === name) {
  43571. return font;
  43572. }
  43573. }
  43574. return null;
  43575. };
  43576. _createClass(DFont, [{
  43577. key: 'fonts',
  43578. get: function get() {
  43579. var fonts = [];
  43580. for (var _iterator5 = this.sfnt.refList, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : _getIterator(_iterator5);;) {
  43581. var _ref5;
  43582. if (_isArray5) {
  43583. if (_i5 >= _iterator5.length) break;
  43584. _ref5 = _iterator5[_i5++];
  43585. } else {
  43586. _i5 = _iterator5.next();
  43587. if (_i5.done) break;
  43588. _ref5 = _i5.value;
  43589. }
  43590. var ref = _ref5;
  43591. var pos = this.header.dataOffset + ref.dataOffset + 4;
  43592. var stream = new r.DecodeStream(this.stream.buffer.slice(pos));
  43593. fonts.push(new TTFFont(stream));
  43594. }
  43595. return fonts;
  43596. }
  43597. }]);
  43598. return DFont;
  43599. }();
  43600. // Register font formats
  43601. fontkit.registerFormat(TTFFont);
  43602. fontkit.registerFormat(WOFFFont);
  43603. fontkit.registerFormat(WOFF2Font);
  43604. fontkit.registerFormat(TrueTypeCollection);
  43605. fontkit.registerFormat(DFont);
  43606. module.exports = fontkit;
  43607. //# sourceMappingURL=index.js.map
  43608. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(4).Buffer, __webpack_require__(25)))
  43609. /***/ }),
  43610. /* 302 */
  43611. /***/ (function(module, exports, __webpack_require__) {
  43612. // Generated by CoffeeScript 1.7.1
  43613. (function() {
  43614. var key, val, _ref, _ref1;
  43615. exports.EncodeStream = __webpack_require__(303);
  43616. exports.DecodeStream = __webpack_require__(107);
  43617. exports.Array = __webpack_require__(178);
  43618. exports.LazyArray = __webpack_require__(322);
  43619. exports.Bitfield = __webpack_require__(323);
  43620. exports.Boolean = __webpack_require__(324);
  43621. exports.Buffer = __webpack_require__(325);
  43622. exports.Enum = __webpack_require__(326);
  43623. exports.Optional = __webpack_require__(327);
  43624. exports.Reserved = __webpack_require__(328);
  43625. exports.String = __webpack_require__(329);
  43626. exports.Struct = __webpack_require__(179);
  43627. exports.VersionedStruct = __webpack_require__(330);
  43628. _ref = __webpack_require__(49);
  43629. for (key in _ref) {
  43630. val = _ref[key];
  43631. exports[key] = val;
  43632. }
  43633. _ref1 = __webpack_require__(331);
  43634. for (key in _ref1) {
  43635. val = _ref1[key];
  43636. exports[key] = val;
  43637. }
  43638. }).call(this);
  43639. /***/ }),
  43640. /* 303 */
  43641. /***/ (function(module, exports, __webpack_require__) {
  43642. /* WEBPACK VAR INJECTION */(function(Buffer) {// Generated by CoffeeScript 1.7.1
  43643. (function() {
  43644. var DecodeStream, EncodeStream, iconv, stream,
  43645. __hasProp = {}.hasOwnProperty,
  43646. __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
  43647. stream = __webpack_require__(100);
  43648. DecodeStream = __webpack_require__(107);
  43649. try {
  43650. iconv = __webpack_require__(108);
  43651. } catch (_error) {}
  43652. EncodeStream = (function(_super) {
  43653. var key;
  43654. __extends(EncodeStream, _super);
  43655. function EncodeStream(bufferSize) {
  43656. if (bufferSize == null) {
  43657. bufferSize = 65536;
  43658. }
  43659. EncodeStream.__super__.constructor.apply(this, arguments);
  43660. this.buffer = new Buffer(bufferSize);
  43661. this.bufferOffset = 0;
  43662. this.pos = 0;
  43663. }
  43664. for (key in Buffer.prototype) {
  43665. if (key.slice(0, 5) === 'write') {
  43666. (function(key) {
  43667. var bytes;
  43668. bytes = +DecodeStream.TYPES[key.replace(/write|[BL]E/g, '')];
  43669. return EncodeStream.prototype[key] = function(value) {
  43670. this.ensure(bytes);
  43671. this.buffer[key](value, this.bufferOffset);
  43672. this.bufferOffset += bytes;
  43673. return this.pos += bytes;
  43674. };
  43675. })(key);
  43676. }
  43677. }
  43678. EncodeStream.prototype._read = function() {};
  43679. EncodeStream.prototype.ensure = function(bytes) {
  43680. if (this.bufferOffset + bytes > this.buffer.length) {
  43681. return this.flush();
  43682. }
  43683. };
  43684. EncodeStream.prototype.flush = function() {
  43685. if (this.bufferOffset > 0) {
  43686. this.push(new Buffer(this.buffer.slice(0, this.bufferOffset)));
  43687. return this.bufferOffset = 0;
  43688. }
  43689. };
  43690. EncodeStream.prototype.writeBuffer = function(buffer) {
  43691. this.flush();
  43692. this.push(buffer);
  43693. return this.pos += buffer.length;
  43694. };
  43695. EncodeStream.prototype.writeString = function(string, encoding) {
  43696. var buf, byte, i, _i, _ref;
  43697. if (encoding == null) {
  43698. encoding = 'ascii';
  43699. }
  43700. switch (encoding) {
  43701. case 'utf16le':
  43702. case 'ucs2':
  43703. case 'utf8':
  43704. case 'ascii':
  43705. return this.writeBuffer(new Buffer(string, encoding));
  43706. case 'utf16be':
  43707. buf = new Buffer(string, 'utf16le');
  43708. for (i = _i = 0, _ref = buf.length - 1; _i < _ref; i = _i += 2) {
  43709. byte = buf[i];
  43710. buf[i] = buf[i + 1];
  43711. buf[i + 1] = byte;
  43712. }
  43713. return this.writeBuffer(buf);
  43714. default:
  43715. if (iconv) {
  43716. return this.writeBuffer(iconv.encode(string, encoding));
  43717. } else {
  43718. throw new Error('Install iconv-lite to enable additional string encodings.');
  43719. }
  43720. }
  43721. };
  43722. EncodeStream.prototype.writeUInt24BE = function(val) {
  43723. this.ensure(3);
  43724. this.buffer[this.bufferOffset++] = val >>> 16 & 0xff;
  43725. this.buffer[this.bufferOffset++] = val >>> 8 & 0xff;
  43726. this.buffer[this.bufferOffset++] = val & 0xff;
  43727. return this.pos += 3;
  43728. };
  43729. EncodeStream.prototype.writeUInt24LE = function(val) {
  43730. this.ensure(3);
  43731. this.buffer[this.bufferOffset++] = val & 0xff;
  43732. this.buffer[this.bufferOffset++] = val >>> 8 & 0xff;
  43733. this.buffer[this.bufferOffset++] = val >>> 16 & 0xff;
  43734. return this.pos += 3;
  43735. };
  43736. EncodeStream.prototype.writeInt24BE = function(val) {
  43737. if (val >= 0) {
  43738. return this.writeUInt24BE(val);
  43739. } else {
  43740. return this.writeUInt24BE(val + 0xffffff + 1);
  43741. }
  43742. };
  43743. EncodeStream.prototype.writeInt24LE = function(val) {
  43744. if (val >= 0) {
  43745. return this.writeUInt24LE(val);
  43746. } else {
  43747. return this.writeUInt24LE(val + 0xffffff + 1);
  43748. }
  43749. };
  43750. EncodeStream.prototype.fill = function(val, length) {
  43751. var buf;
  43752. if (length < this.buffer.length) {
  43753. this.ensure(length);
  43754. this.buffer.fill(val, this.bufferOffset, this.bufferOffset + length);
  43755. this.bufferOffset += length;
  43756. return this.pos += length;
  43757. } else {
  43758. buf = new Buffer(length);
  43759. buf.fill(val);
  43760. return this.writeBuffer(buf);
  43761. }
  43762. };
  43763. EncodeStream.prototype.end = function() {
  43764. this.flush();
  43765. return this.push(null);
  43766. };
  43767. return EncodeStream;
  43768. })(stream.Readable);
  43769. module.exports = EncodeStream;
  43770. }).call(this);
  43771. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(4).Buffer))
  43772. /***/ }),
  43773. /* 304 */
  43774. /***/ (function(module, exports, __webpack_require__) {
  43775. "use strict";
  43776. var BOMChar = '\uFEFF';
  43777. exports.PrependBOM = PrependBOMWrapper
  43778. function PrependBOMWrapper(encoder, options) {
  43779. this.encoder = encoder;
  43780. this.addBOM = true;
  43781. }
  43782. PrependBOMWrapper.prototype.write = function(str) {
  43783. if (this.addBOM) {
  43784. str = BOMChar + str;
  43785. this.addBOM = false;
  43786. }
  43787. return this.encoder.write(str);
  43788. }
  43789. PrependBOMWrapper.prototype.end = function() {
  43790. return this.encoder.end();
  43791. }
  43792. //------------------------------------------------------------------------------
  43793. exports.StripBOM = StripBOMWrapper;
  43794. function StripBOMWrapper(decoder, options) {
  43795. this.decoder = decoder;
  43796. this.pass = false;
  43797. this.options = options || {};
  43798. }
  43799. StripBOMWrapper.prototype.write = function(buf) {
  43800. var res = this.decoder.write(buf);
  43801. if (this.pass || !res)
  43802. return res;
  43803. if (res[0] === BOMChar) {
  43804. res = res.slice(1);
  43805. if (typeof this.options.stripBOM === 'function')
  43806. this.options.stripBOM();
  43807. }
  43808. this.pass = true;
  43809. return res;
  43810. }
  43811. StripBOMWrapper.prototype.end = function() {
  43812. return this.decoder.end();
  43813. }
  43814. /***/ }),
  43815. /* 305 */
  43816. /***/ (function(module, exports, __webpack_require__) {
  43817. "use strict";
  43818. // Update this array if you add/rename/remove files in this directory.
  43819. // We support Browserify by skipping automatic module discovery and requiring modules directly.
  43820. var modules = [
  43821. __webpack_require__(306),
  43822. __webpack_require__(307),
  43823. __webpack_require__(308),
  43824. __webpack_require__(309),
  43825. __webpack_require__(310),
  43826. __webpack_require__(311),
  43827. __webpack_require__(312),
  43828. __webpack_require__(313),
  43829. __webpack_require__(314),
  43830. ];
  43831. // Put all encoding/alias/codec definitions to single object and export it.
  43832. for (var i = 0; i < modules.length; i++) {
  43833. var module = modules[i];
  43834. for (var enc in module)
  43835. if (Object.prototype.hasOwnProperty.call(module, enc))
  43836. exports[enc] = module[enc];
  43837. }
  43838. /***/ }),
  43839. /* 306 */
  43840. /***/ (function(module, exports, __webpack_require__) {
  43841. "use strict";
  43842. var Buffer = __webpack_require__(34).Buffer;
  43843. // Export Node.js internal encodings.
  43844. module.exports = {
  43845. // Encodings
  43846. utf8: { type: "_internal", bomAware: true},
  43847. cesu8: { type: "_internal", bomAware: true},
  43848. unicode11utf8: "utf8",
  43849. ucs2: { type: "_internal", bomAware: true},
  43850. utf16le: "ucs2",
  43851. binary: { type: "_internal" },
  43852. base64: { type: "_internal" },
  43853. hex: { type: "_internal" },
  43854. // Codec.
  43855. _internal: InternalCodec,
  43856. };
  43857. //------------------------------------------------------------------------------
  43858. function InternalCodec(codecOptions, iconv) {
  43859. this.enc = codecOptions.encodingName;
  43860. this.bomAware = codecOptions.bomAware;
  43861. if (this.enc === "base64")
  43862. this.encoder = InternalEncoderBase64;
  43863. else if (this.enc === "cesu8") {
  43864. this.enc = "utf8"; // Use utf8 for decoding.
  43865. this.encoder = InternalEncoderCesu8;
  43866. // Add decoder for versions of Node not supporting CESU-8
  43867. if (Buffer.from('eda0bdedb2a9', 'hex').toString() !== '💩') {
  43868. this.decoder = InternalDecoderCesu8;
  43869. this.defaultCharUnicode = iconv.defaultCharUnicode;
  43870. }
  43871. }
  43872. }
  43873. InternalCodec.prototype.encoder = InternalEncoder;
  43874. InternalCodec.prototype.decoder = InternalDecoder;
  43875. //------------------------------------------------------------------------------
  43876. // We use node.js internal decoder. Its signature is the same as ours.
  43877. var StringDecoder = __webpack_require__(103).StringDecoder;
  43878. if (!StringDecoder.prototype.end) // Node v0.8 doesn't have this method.
  43879. StringDecoder.prototype.end = function() {};
  43880. function InternalDecoder(options, codec) {
  43881. StringDecoder.call(this, codec.enc);
  43882. }
  43883. InternalDecoder.prototype = StringDecoder.prototype;
  43884. //------------------------------------------------------------------------------
  43885. // Encoder is mostly trivial
  43886. function InternalEncoder(options, codec) {
  43887. this.enc = codec.enc;
  43888. }
  43889. InternalEncoder.prototype.write = function(str) {
  43890. return Buffer.from(str, this.enc);
  43891. }
  43892. InternalEncoder.prototype.end = function() {
  43893. }
  43894. //------------------------------------------------------------------------------
  43895. // Except base64 encoder, which must keep its state.
  43896. function InternalEncoderBase64(options, codec) {
  43897. this.prevStr = '';
  43898. }
  43899. InternalEncoderBase64.prototype.write = function(str) {
  43900. str = this.prevStr + str;
  43901. var completeQuads = str.length - (str.length % 4);
  43902. this.prevStr = str.slice(completeQuads);
  43903. str = str.slice(0, completeQuads);
  43904. return Buffer.from(str, "base64");
  43905. }
  43906. InternalEncoderBase64.prototype.end = function() {
  43907. return Buffer.from(this.prevStr, "base64");
  43908. }
  43909. //------------------------------------------------------------------------------
  43910. // CESU-8 encoder is also special.
  43911. function InternalEncoderCesu8(options, codec) {
  43912. }
  43913. InternalEncoderCesu8.prototype.write = function(str) {
  43914. var buf = Buffer.alloc(str.length * 3), bufIdx = 0;
  43915. for (var i = 0; i < str.length; i++) {
  43916. var charCode = str.charCodeAt(i);
  43917. // Naive implementation, but it works because CESU-8 is especially easy
  43918. // to convert from UTF-16 (which all JS strings are encoded in).
  43919. if (charCode < 0x80)
  43920. buf[bufIdx++] = charCode;
  43921. else if (charCode < 0x800) {
  43922. buf[bufIdx++] = 0xC0 + (charCode >>> 6);
  43923. buf[bufIdx++] = 0x80 + (charCode & 0x3f);
  43924. }
  43925. else { // charCode will always be < 0x10000 in javascript.
  43926. buf[bufIdx++] = 0xE0 + (charCode >>> 12);
  43927. buf[bufIdx++] = 0x80 + ((charCode >>> 6) & 0x3f);
  43928. buf[bufIdx++] = 0x80 + (charCode & 0x3f);
  43929. }
  43930. }
  43931. return buf.slice(0, bufIdx);
  43932. }
  43933. InternalEncoderCesu8.prototype.end = function() {
  43934. }
  43935. //------------------------------------------------------------------------------
  43936. // CESU-8 decoder is not implemented in Node v4.0+
  43937. function InternalDecoderCesu8(options, codec) {
  43938. this.acc = 0;
  43939. this.contBytes = 0;
  43940. this.accBytes = 0;
  43941. this.defaultCharUnicode = codec.defaultCharUnicode;
  43942. }
  43943. InternalDecoderCesu8.prototype.write = function(buf) {
  43944. var acc = this.acc, contBytes = this.contBytes, accBytes = this.accBytes,
  43945. res = '';
  43946. for (var i = 0; i < buf.length; i++) {
  43947. var curByte = buf[i];
  43948. if ((curByte & 0xC0) !== 0x80) { // Leading byte
  43949. if (contBytes > 0) { // Previous code is invalid
  43950. res += this.defaultCharUnicode;
  43951. contBytes = 0;
  43952. }
  43953. if (curByte < 0x80) { // Single-byte code
  43954. res += String.fromCharCode(curByte);
  43955. } else if (curByte < 0xE0) { // Two-byte code
  43956. acc = curByte & 0x1F;
  43957. contBytes = 1; accBytes = 1;
  43958. } else if (curByte < 0xF0) { // Three-byte code
  43959. acc = curByte & 0x0F;
  43960. contBytes = 2; accBytes = 1;
  43961. } else { // Four or more are not supported for CESU-8.
  43962. res += this.defaultCharUnicode;
  43963. }
  43964. } else { // Continuation byte
  43965. if (contBytes > 0) { // We're waiting for it.
  43966. acc = (acc << 6) | (curByte & 0x3f);
  43967. contBytes--; accBytes++;
  43968. if (contBytes === 0) {
  43969. // Check for overlong encoding, but support Modified UTF-8 (encoding NULL as C0 80)
  43970. if (accBytes === 2 && acc < 0x80 && acc > 0)
  43971. res += this.defaultCharUnicode;
  43972. else if (accBytes === 3 && acc < 0x800)
  43973. res += this.defaultCharUnicode;
  43974. else
  43975. // Actually add character.
  43976. res += String.fromCharCode(acc);
  43977. }
  43978. } else { // Unexpected continuation byte
  43979. res += this.defaultCharUnicode;
  43980. }
  43981. }
  43982. }
  43983. this.acc = acc; this.contBytes = contBytes; this.accBytes = accBytes;
  43984. return res;
  43985. }
  43986. InternalDecoderCesu8.prototype.end = function() {
  43987. var res = 0;
  43988. if (this.contBytes > 0)
  43989. res += this.defaultCharUnicode;
  43990. return res;
  43991. }
  43992. /***/ }),
  43993. /* 307 */
  43994. /***/ (function(module, exports, __webpack_require__) {
  43995. "use strict";
  43996. var Buffer = __webpack_require__(34).Buffer;
  43997. // == UTF32-LE/BE codec. ==========================================================
  43998. exports._utf32 = Utf32Codec;
  43999. function Utf32Codec(codecOptions, iconv) {
  44000. this.iconv = iconv;
  44001. this.bomAware = true;
  44002. this.isLE = codecOptions.isLE;
  44003. }
  44004. exports.utf32le = { type: '_utf32', isLE: true };
  44005. exports.utf32be = { type: '_utf32', isLE: false };
  44006. // Aliases
  44007. exports.ucs4le = 'utf32le';
  44008. exports.ucs4be = 'utf32be';
  44009. Utf32Codec.prototype.encoder = Utf32Encoder;
  44010. Utf32Codec.prototype.decoder = Utf32Decoder;
  44011. // -- Encoding
  44012. function Utf32Encoder(options, codec) {
  44013. this.isLE = codec.isLE;
  44014. this.highSurrogate = 0;
  44015. }
  44016. Utf32Encoder.prototype.write = function(str) {
  44017. var src = Buffer.from(str, 'ucs2');
  44018. var dst = Buffer.alloc(src.length * 2);
  44019. var write32 = this.isLE ? dst.writeUInt32LE : dst.writeUInt32BE;
  44020. var offset = 0;
  44021. for (var i = 0; i < src.length; i += 2) {
  44022. var code = src.readUInt16LE(i);
  44023. var isHighSurrogate = (0xD800 <= code && code < 0xDC00);
  44024. var isLowSurrogate = (0xDC00 <= code && code < 0xE000);
  44025. if (this.highSurrogate) {
  44026. if (isHighSurrogate || !isLowSurrogate) {
  44027. // There shouldn't be two high surrogates in a row, nor a high surrogate which isn't followed by a low
  44028. // surrogate. If this happens, keep the pending high surrogate as a stand-alone semi-invalid character
  44029. // (technically wrong, but expected by some applications, like Windows file names).
  44030. write32.call(dst, this.highSurrogate, offset);
  44031. offset += 4;
  44032. }
  44033. else {
  44034. // Create 32-bit value from high and low surrogates;
  44035. var codepoint = (((this.highSurrogate - 0xD800) << 10) | (code - 0xDC00)) + 0x10000;
  44036. write32.call(dst, codepoint, offset);
  44037. offset += 4;
  44038. this.highSurrogate = 0;
  44039. continue;
  44040. }
  44041. }
  44042. if (isHighSurrogate)
  44043. this.highSurrogate = code;
  44044. else {
  44045. // Even if the current character is a low surrogate, with no previous high surrogate, we'll
  44046. // encode it as a semi-invalid stand-alone character for the same reasons expressed above for
  44047. // unpaired high surrogates.
  44048. write32.call(dst, code, offset);
  44049. offset += 4;
  44050. this.highSurrogate = 0;
  44051. }
  44052. }
  44053. if (offset < dst.length)
  44054. dst = dst.slice(0, offset);
  44055. return dst;
  44056. };
  44057. Utf32Encoder.prototype.end = function() {
  44058. // Treat any leftover high surrogate as a semi-valid independent character.
  44059. if (!this.highSurrogate)
  44060. return;
  44061. var buf = Buffer.alloc(4);
  44062. if (this.isLE)
  44063. buf.writeUInt32LE(this.highSurrogate, 0);
  44064. else
  44065. buf.writeUInt32BE(this.highSurrogate, 0);
  44066. this.highSurrogate = 0;
  44067. return buf;
  44068. };
  44069. // -- Decoding
  44070. function Utf32Decoder(options, codec) {
  44071. this.isLE = codec.isLE;
  44072. this.badChar = codec.iconv.defaultCharUnicode.charCodeAt(0);
  44073. this.overflow = null;
  44074. }
  44075. Utf32Decoder.prototype.write = function(src) {
  44076. if (src.length === 0)
  44077. return '';
  44078. if (this.overflow)
  44079. src = Buffer.concat([this.overflow, src]);
  44080. var goodLength = src.length - src.length % 4;
  44081. if (src.length !== goodLength) {
  44082. this.overflow = src.slice(goodLength);
  44083. src = src.slice(0, goodLength);
  44084. }
  44085. else
  44086. this.overflow = null;
  44087. var dst = Buffer.alloc(goodLength);
  44088. var offset = 0;
  44089. for (var i = 0; i < goodLength; i += 4) {
  44090. var codepoint = this.isLE ? src.readUInt32LE(i) : src.readUInt32BE(i);
  44091. if (codepoint < 0x10000) {
  44092. // Simple 16-bit character
  44093. dst.writeUInt16LE(codepoint, offset);
  44094. offset += 2;
  44095. }
  44096. else {
  44097. if (codepoint > 0x10FFFF) {
  44098. // Not a valid Unicode codepoint
  44099. dst.writeUInt16LE(this.badChar, offset);
  44100. offset += 2;
  44101. }
  44102. else {
  44103. // Create high and low surrogates.
  44104. codepoint -= 0x10000;
  44105. var high = 0xD800 | (codepoint >> 10);
  44106. var low = 0xDC00 + (codepoint & 0x3FF);
  44107. dst.writeUInt16LE(high, offset);
  44108. offset += 2;
  44109. dst.writeUInt16LE(low, offset);
  44110. offset += 2;
  44111. }
  44112. }
  44113. }
  44114. return dst.slice(0, offset).toString('ucs2');
  44115. };
  44116. Utf32Decoder.prototype.end = function() {
  44117. this.overflow = null;
  44118. };
  44119. // == UTF-32 Auto codec =============================================================
  44120. // Decoder chooses automatically from UTF-32LE and UTF-32BE using BOM and space-based heuristic.
  44121. // Defaults to UTF-32LE. http://en.wikipedia.org/wiki/UTF-32
  44122. // Encoder/decoder default can be changed: iconv.decode(buf, 'utf32', {defaultEncoding: 'utf-32be'});
  44123. // Encoder prepends BOM (which can be overridden with (addBOM: false}).
  44124. exports.utf32 = Utf32AutoCodec;
  44125. exports.ucs4 = Utf32AutoCodec;
  44126. function Utf32AutoCodec(options, iconv) {
  44127. this.iconv = iconv;
  44128. }
  44129. Utf32AutoCodec.prototype.encoder = Utf32AutoEncoder;
  44130. Utf32AutoCodec.prototype.decoder = Utf32AutoDecoder;
  44131. // -- Encoding
  44132. function Utf32AutoEncoder(options, codec) {
  44133. options = options || {};
  44134. if (options.addBOM === undefined)
  44135. options.addBOM = true;
  44136. this.encoder = codec.iconv.getEncoder(options.defaultEncoding || 'utf-32le', options);
  44137. }
  44138. Utf32AutoEncoder.prototype.write = function(str) {
  44139. return this.encoder.write(str);
  44140. };
  44141. Utf32AutoEncoder.prototype.end = function() {
  44142. return this.encoder.end();
  44143. };
  44144. // -- Decoding
  44145. function Utf32AutoDecoder(options, codec) {
  44146. this.decoder = null;
  44147. this.initialBytes = [];
  44148. this.initialBytesLen = 0;
  44149. this.options = options || {};
  44150. this.iconv = codec.iconv;
  44151. }
  44152. Utf32AutoDecoder.prototype.write = function(buf) {
  44153. if (!this.decoder) {
  44154. // Codec is not chosen yet. Accumulate initial bytes.
  44155. this.initialBytes.push(buf);
  44156. this.initialBytesLen += buf.length;
  44157. if (this.initialBytesLen < 32) // We need more bytes to use space heuristic (see below)
  44158. return '';
  44159. // We have enough bytes -> detect endianness.
  44160. var buf2 = Buffer.concat(this.initialBytes),
  44161. encoding = detectEncoding(buf2, this.options.defaultEncoding);
  44162. this.decoder = this.iconv.getDecoder(encoding, this.options);
  44163. this.initialBytes.length = this.initialBytesLen = 0;
  44164. }
  44165. return this.decoder.write(buf);
  44166. };
  44167. Utf32AutoDecoder.prototype.end = function() {
  44168. if (!this.decoder) {
  44169. var buf = Buffer.concat(this.initialBytes),
  44170. encoding = detectEncoding(buf, this.options.defaultEncoding);
  44171. this.decoder = this.iconv.getDecoder(encoding, this.options);
  44172. var res = this.decoder.write(buf),
  44173. trail = this.decoder.end();
  44174. return trail ? (res + trail) : res;
  44175. }
  44176. return this.decoder.end();
  44177. };
  44178. function detectEncoding(buf, defaultEncoding) {
  44179. var enc = defaultEncoding || 'utf-32le';
  44180. if (buf.length >= 4) {
  44181. // Check BOM.
  44182. if (buf.readUInt32BE(0) === 0xFEFF) // UTF-32LE BOM
  44183. enc = 'utf-32be';
  44184. else if (buf.readUInt32LE(0) === 0xFEFF) // UTF-32LE BOM
  44185. enc = 'utf-32le';
  44186. else {
  44187. // No BOM found. Try to deduce encoding from initial content.
  44188. // Using the wrong endian-ism for UTF-32 will very often result in codepoints that are beyond
  44189. // the valid Unicode limit of 0x10FFFF. That will be used as the primary determinant.
  44190. //
  44191. // Further, we can suppose the content is mostly plain ASCII chars (U+00**).
  44192. // So, we count ASCII as if it was LE or BE, and decide from that.
  44193. var invalidLE = 0, invalidBE = 0;
  44194. var asciiCharsLE = 0, asciiCharsBE = 0, // Counts of chars in both positions
  44195. _len = Math.min(buf.length - (buf.length % 4), 128); // Len is always even.
  44196. for (var i = 0; i < _len; i += 4) {
  44197. var b0 = buf[i], b1 = buf[i + 1], b2 = buf[i + 2], b3 = buf[i + 3];
  44198. if (b0 !== 0 || b1 > 0x10) ++invalidBE;
  44199. if (b3 !== 0 || b2 > 0x10) ++invalidLE;
  44200. if (b0 === 0 && b1 === 0 && b2 === 0 && b3 !== 0) asciiCharsBE++;
  44201. if (b0 !== 0 && b1 === 0 && b2 === 0 && b3 === 0) asciiCharsLE++;
  44202. }
  44203. if (invalidBE < invalidLE)
  44204. enc = 'utf-32be';
  44205. else if (invalidLE < invalidBE)
  44206. enc = 'utf-32le';
  44207. if (asciiCharsBE > asciiCharsLE)
  44208. enc = 'utf-32be';
  44209. else if (asciiCharsBE < asciiCharsLE)
  44210. enc = 'utf-32le';
  44211. }
  44212. }
  44213. return enc;
  44214. }
  44215. /***/ }),
  44216. /* 308 */
  44217. /***/ (function(module, exports, __webpack_require__) {
  44218. "use strict";
  44219. var Buffer = __webpack_require__(34).Buffer;
  44220. // Note: UTF16-LE (or UCS2) codec is Node.js native. See encodings/internal.js
  44221. // == UTF16-BE codec. ==========================================================
  44222. exports.utf16be = Utf16BECodec;
  44223. function Utf16BECodec() {
  44224. }
  44225. Utf16BECodec.prototype.encoder = Utf16BEEncoder;
  44226. Utf16BECodec.prototype.decoder = Utf16BEDecoder;
  44227. Utf16BECodec.prototype.bomAware = true;
  44228. // -- Encoding
  44229. function Utf16BEEncoder() {
  44230. }
  44231. Utf16BEEncoder.prototype.write = function(str) {
  44232. var buf = Buffer.from(str, 'ucs2');
  44233. for (var i = 0; i < buf.length; i += 2) {
  44234. var tmp = buf[i]; buf[i] = buf[i+1]; buf[i+1] = tmp;
  44235. }
  44236. return buf;
  44237. }
  44238. Utf16BEEncoder.prototype.end = function() {
  44239. }
  44240. // -- Decoding
  44241. function Utf16BEDecoder() {
  44242. this.overflowByte = -1;
  44243. }
  44244. Utf16BEDecoder.prototype.write = function(buf) {
  44245. if (buf.length == 0)
  44246. return '';
  44247. var buf2 = Buffer.alloc(buf.length + 1),
  44248. i = 0, j = 0;
  44249. if (this.overflowByte !== -1) {
  44250. buf2[0] = buf[0];
  44251. buf2[1] = this.overflowByte;
  44252. i = 1; j = 2;
  44253. }
  44254. for (; i < buf.length-1; i += 2, j+= 2) {
  44255. buf2[j] = buf[i+1];
  44256. buf2[j+1] = buf[i];
  44257. }
  44258. this.overflowByte = (i == buf.length-1) ? buf[buf.length-1] : -1;
  44259. return buf2.slice(0, j).toString('ucs2');
  44260. }
  44261. Utf16BEDecoder.prototype.end = function() {
  44262. }
  44263. // == UTF-16 codec =============================================================
  44264. // Decoder chooses automatically from UTF-16LE and UTF-16BE using BOM and space-based heuristic.
  44265. // Defaults to UTF-16LE, as it's prevalent and default in Node.
  44266. // http://en.wikipedia.org/wiki/UTF-16 and http://encoding.spec.whatwg.org/#utf-16le
  44267. // Decoder default can be changed: iconv.decode(buf, 'utf16', {defaultEncoding: 'utf-16be'});
  44268. // Encoder uses UTF-16LE and prepends BOM (which can be overridden with addBOM: false).
  44269. exports.utf16 = Utf16Codec;
  44270. function Utf16Codec(codecOptions, iconv) {
  44271. this.iconv = iconv;
  44272. }
  44273. Utf16Codec.prototype.encoder = Utf16Encoder;
  44274. Utf16Codec.prototype.decoder = Utf16Decoder;
  44275. // -- Encoding (pass-through)
  44276. function Utf16Encoder(options, codec) {
  44277. options = options || {};
  44278. if (options.addBOM === undefined)
  44279. options.addBOM = true;
  44280. this.encoder = codec.iconv.getEncoder('utf-16le', options);
  44281. }
  44282. Utf16Encoder.prototype.write = function(str) {
  44283. return this.encoder.write(str);
  44284. }
  44285. Utf16Encoder.prototype.end = function() {
  44286. return this.encoder.end();
  44287. }
  44288. // -- Decoding
  44289. function Utf16Decoder(options, codec) {
  44290. this.decoder = null;
  44291. this.initialBytes = [];
  44292. this.initialBytesLen = 0;
  44293. this.options = options || {};
  44294. this.iconv = codec.iconv;
  44295. }
  44296. Utf16Decoder.prototype.write = function(buf) {
  44297. if (!this.decoder) {
  44298. // Codec is not chosen yet. Accumulate initial bytes.
  44299. this.initialBytes.push(buf);
  44300. this.initialBytesLen += buf.length;
  44301. if (this.initialBytesLen < 16) // We need more bytes to use space heuristic (see below)
  44302. return '';
  44303. // We have enough bytes -> detect endianness.
  44304. var buf = Buffer.concat(this.initialBytes),
  44305. encoding = detectEncoding(buf, this.options.defaultEncoding);
  44306. this.decoder = this.iconv.getDecoder(encoding, this.options);
  44307. this.initialBytes.length = this.initialBytesLen = 0;
  44308. }
  44309. return this.decoder.write(buf);
  44310. }
  44311. Utf16Decoder.prototype.end = function() {
  44312. if (!this.decoder) {
  44313. var buf = Buffer.concat(this.initialBytes),
  44314. encoding = detectEncoding(buf, this.options.defaultEncoding);
  44315. this.decoder = this.iconv.getDecoder(encoding, this.options);
  44316. var res = this.decoder.write(buf),
  44317. trail = this.decoder.end();
  44318. return trail ? (res + trail) : res;
  44319. }
  44320. return this.decoder.end();
  44321. }
  44322. function detectEncoding(buf, defaultEncoding) {
  44323. var enc = defaultEncoding || 'utf-16le';
  44324. if (buf.length >= 2) {
  44325. // Check BOM.
  44326. if (buf[0] == 0xFE && buf[1] == 0xFF) // UTF-16BE BOM
  44327. enc = 'utf-16be';
  44328. else if (buf[0] == 0xFF && buf[1] == 0xFE) // UTF-16LE BOM
  44329. enc = 'utf-16le';
  44330. else {
  44331. // No BOM found. Try to deduce encoding from initial content.
  44332. // Most of the time, the content has ASCII chars (U+00**), but the opposite (U+**00) is uncommon.
  44333. // So, we count ASCII as if it was LE or BE, and decide from that.
  44334. var asciiCharsLE = 0, asciiCharsBE = 0, // Counts of chars in both positions
  44335. _len = Math.min(buf.length - (buf.length % 2), 64); // Len is always even.
  44336. for (var i = 0; i < _len; i += 2) {
  44337. if (buf[i] === 0 && buf[i+1] !== 0) asciiCharsBE++;
  44338. if (buf[i] !== 0 && buf[i+1] === 0) asciiCharsLE++;
  44339. }
  44340. if (asciiCharsBE > asciiCharsLE)
  44341. enc = 'utf-16be';
  44342. else if (asciiCharsBE < asciiCharsLE)
  44343. enc = 'utf-16le';
  44344. }
  44345. }
  44346. return enc;
  44347. }
  44348. /***/ }),
  44349. /* 309 */
  44350. /***/ (function(module, exports, __webpack_require__) {
  44351. "use strict";
  44352. var Buffer = __webpack_require__(34).Buffer;
  44353. // UTF-7 codec, according to https://tools.ietf.org/html/rfc2152
  44354. // See also below a UTF-7-IMAP codec, according to http://tools.ietf.org/html/rfc3501#section-5.1.3
  44355. exports.utf7 = Utf7Codec;
  44356. exports.unicode11utf7 = 'utf7'; // Alias UNICODE-1-1-UTF-7
  44357. function Utf7Codec(codecOptions, iconv) {
  44358. this.iconv = iconv;
  44359. };
  44360. Utf7Codec.prototype.encoder = Utf7Encoder;
  44361. Utf7Codec.prototype.decoder = Utf7Decoder;
  44362. Utf7Codec.prototype.bomAware = true;
  44363. // -- Encoding
  44364. var nonDirectChars = /[^A-Za-z0-9'\(\),-\.\/:\? \n\r\t]+/g;
  44365. function Utf7Encoder(options, codec) {
  44366. this.iconv = codec.iconv;
  44367. }
  44368. Utf7Encoder.prototype.write = function(str) {
  44369. // Naive implementation.
  44370. // Non-direct chars are encoded as "+<base64>-"; single "+" char is encoded as "+-".
  44371. return Buffer.from(str.replace(nonDirectChars, function(chunk) {
  44372. return "+" + (chunk === '+' ? '' :
  44373. this.iconv.encode(chunk, 'utf16-be').toString('base64').replace(/=+$/, ''))
  44374. + "-";
  44375. }.bind(this)));
  44376. }
  44377. Utf7Encoder.prototype.end = function() {
  44378. }
  44379. // -- Decoding
  44380. function Utf7Decoder(options, codec) {
  44381. this.iconv = codec.iconv;
  44382. this.inBase64 = false;
  44383. this.base64Accum = '';
  44384. }
  44385. var base64Regex = /[A-Za-z0-9\/+]/;
  44386. var base64Chars = [];
  44387. for (var i = 0; i < 256; i++)
  44388. base64Chars[i] = base64Regex.test(String.fromCharCode(i));
  44389. var plusChar = '+'.charCodeAt(0),
  44390. minusChar = '-'.charCodeAt(0),
  44391. andChar = '&'.charCodeAt(0);
  44392. Utf7Decoder.prototype.write = function(buf) {
  44393. var res = "", lastI = 0,
  44394. inBase64 = this.inBase64,
  44395. base64Accum = this.base64Accum;
  44396. // The decoder is more involved as we must handle chunks in stream.
  44397. for (var i = 0; i < buf.length; i++) {
  44398. if (!inBase64) { // We're in direct mode.
  44399. // Write direct chars until '+'
  44400. if (buf[i] == plusChar) {
  44401. res += this.iconv.decode(buf.slice(lastI, i), "ascii"); // Write direct chars.
  44402. lastI = i+1;
  44403. inBase64 = true;
  44404. }
  44405. } else { // We decode base64.
  44406. if (!base64Chars[buf[i]]) { // Base64 ended.
  44407. if (i == lastI && buf[i] == minusChar) {// "+-" -> "+"
  44408. res += "+";
  44409. } else {
  44410. var b64str = base64Accum + buf.slice(lastI, i).toString();
  44411. res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be");
  44412. }
  44413. if (buf[i] != minusChar) // Minus is absorbed after base64.
  44414. i--;
  44415. lastI = i+1;
  44416. inBase64 = false;
  44417. base64Accum = '';
  44418. }
  44419. }
  44420. }
  44421. if (!inBase64) {
  44422. res += this.iconv.decode(buf.slice(lastI), "ascii"); // Write direct chars.
  44423. } else {
  44424. var b64str = base64Accum + buf.slice(lastI).toString();
  44425. var canBeDecoded = b64str.length - (b64str.length % 8); // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars.
  44426. base64Accum = b64str.slice(canBeDecoded); // The rest will be decoded in future.
  44427. b64str = b64str.slice(0, canBeDecoded);
  44428. res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be");
  44429. }
  44430. this.inBase64 = inBase64;
  44431. this.base64Accum = base64Accum;
  44432. return res;
  44433. }
  44434. Utf7Decoder.prototype.end = function() {
  44435. var res = "";
  44436. if (this.inBase64 && this.base64Accum.length > 0)
  44437. res = this.iconv.decode(Buffer.from(this.base64Accum, 'base64'), "utf16-be");
  44438. this.inBase64 = false;
  44439. this.base64Accum = '';
  44440. return res;
  44441. }
  44442. // UTF-7-IMAP codec.
  44443. // RFC3501 Sec. 5.1.3 Modified UTF-7 (http://tools.ietf.org/html/rfc3501#section-5.1.3)
  44444. // Differences:
  44445. // * Base64 part is started by "&" instead of "+"
  44446. // * Direct characters are 0x20-0x7E, except "&" (0x26)
  44447. // * In Base64, "," is used instead of "/"
  44448. // * Base64 must not be used to represent direct characters.
  44449. // * No implicit shift back from Base64 (should always end with '-')
  44450. // * String must end in non-shifted position.
  44451. // * "-&" while in base64 is not allowed.
  44452. exports.utf7imap = Utf7IMAPCodec;
  44453. function Utf7IMAPCodec(codecOptions, iconv) {
  44454. this.iconv = iconv;
  44455. };
  44456. Utf7IMAPCodec.prototype.encoder = Utf7IMAPEncoder;
  44457. Utf7IMAPCodec.prototype.decoder = Utf7IMAPDecoder;
  44458. Utf7IMAPCodec.prototype.bomAware = true;
  44459. // -- Encoding
  44460. function Utf7IMAPEncoder(options, codec) {
  44461. this.iconv = codec.iconv;
  44462. this.inBase64 = false;
  44463. this.base64Accum = Buffer.alloc(6);
  44464. this.base64AccumIdx = 0;
  44465. }
  44466. Utf7IMAPEncoder.prototype.write = function(str) {
  44467. var inBase64 = this.inBase64,
  44468. base64Accum = this.base64Accum,
  44469. base64AccumIdx = this.base64AccumIdx,
  44470. buf = Buffer.alloc(str.length*5 + 10), bufIdx = 0;
  44471. for (var i = 0; i < str.length; i++) {
  44472. var uChar = str.charCodeAt(i);
  44473. if (0x20 <= uChar && uChar <= 0x7E) { // Direct character or '&'.
  44474. if (inBase64) {
  44475. if (base64AccumIdx > 0) {
  44476. bufIdx += buf.write(base64Accum.slice(0, base64AccumIdx).toString('base64').replace(/\//g, ',').replace(/=+$/, ''), bufIdx);
  44477. base64AccumIdx = 0;
  44478. }
  44479. buf[bufIdx++] = minusChar; // Write '-', then go to direct mode.
  44480. inBase64 = false;
  44481. }
  44482. if (!inBase64) {
  44483. buf[bufIdx++] = uChar; // Write direct character
  44484. if (uChar === andChar) // Ampersand -> '&-'
  44485. buf[bufIdx++] = minusChar;
  44486. }
  44487. } else { // Non-direct character
  44488. if (!inBase64) {
  44489. buf[bufIdx++] = andChar; // Write '&', then go to base64 mode.
  44490. inBase64 = true;
  44491. }
  44492. if (inBase64) {
  44493. base64Accum[base64AccumIdx++] = uChar >> 8;
  44494. base64Accum[base64AccumIdx++] = uChar & 0xFF;
  44495. if (base64AccumIdx == base64Accum.length) {
  44496. bufIdx += buf.write(base64Accum.toString('base64').replace(/\//g, ','), bufIdx);
  44497. base64AccumIdx = 0;
  44498. }
  44499. }
  44500. }
  44501. }
  44502. this.inBase64 = inBase64;
  44503. this.base64AccumIdx = base64AccumIdx;
  44504. return buf.slice(0, bufIdx);
  44505. }
  44506. Utf7IMAPEncoder.prototype.end = function() {
  44507. var buf = Buffer.alloc(10), bufIdx = 0;
  44508. if (this.inBase64) {
  44509. if (this.base64AccumIdx > 0) {
  44510. bufIdx += buf.write(this.base64Accum.slice(0, this.base64AccumIdx).toString('base64').replace(/\//g, ',').replace(/=+$/, ''), bufIdx);
  44511. this.base64AccumIdx = 0;
  44512. }
  44513. buf[bufIdx++] = minusChar; // Write '-', then go to direct mode.
  44514. this.inBase64 = false;
  44515. }
  44516. return buf.slice(0, bufIdx);
  44517. }
  44518. // -- Decoding
  44519. function Utf7IMAPDecoder(options, codec) {
  44520. this.iconv = codec.iconv;
  44521. this.inBase64 = false;
  44522. this.base64Accum = '';
  44523. }
  44524. var base64IMAPChars = base64Chars.slice();
  44525. base64IMAPChars[','.charCodeAt(0)] = true;
  44526. Utf7IMAPDecoder.prototype.write = function(buf) {
  44527. var res = "", lastI = 0,
  44528. inBase64 = this.inBase64,
  44529. base64Accum = this.base64Accum;
  44530. // The decoder is more involved as we must handle chunks in stream.
  44531. // It is forgiving, closer to standard UTF-7 (for example, '-' is optional at the end).
  44532. for (var i = 0; i < buf.length; i++) {
  44533. if (!inBase64) { // We're in direct mode.
  44534. // Write direct chars until '&'
  44535. if (buf[i] == andChar) {
  44536. res += this.iconv.decode(buf.slice(lastI, i), "ascii"); // Write direct chars.
  44537. lastI = i+1;
  44538. inBase64 = true;
  44539. }
  44540. } else { // We decode base64.
  44541. if (!base64IMAPChars[buf[i]]) { // Base64 ended.
  44542. if (i == lastI && buf[i] == minusChar) { // "&-" -> "&"
  44543. res += "&";
  44544. } else {
  44545. var b64str = base64Accum + buf.slice(lastI, i).toString().replace(/,/g, '/');
  44546. res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be");
  44547. }
  44548. if (buf[i] != minusChar) // Minus may be absorbed after base64.
  44549. i--;
  44550. lastI = i+1;
  44551. inBase64 = false;
  44552. base64Accum = '';
  44553. }
  44554. }
  44555. }
  44556. if (!inBase64) {
  44557. res += this.iconv.decode(buf.slice(lastI), "ascii"); // Write direct chars.
  44558. } else {
  44559. var b64str = base64Accum + buf.slice(lastI).toString().replace(/,/g, '/');
  44560. var canBeDecoded = b64str.length - (b64str.length % 8); // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars.
  44561. base64Accum = b64str.slice(canBeDecoded); // The rest will be decoded in future.
  44562. b64str = b64str.slice(0, canBeDecoded);
  44563. res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be");
  44564. }
  44565. this.inBase64 = inBase64;
  44566. this.base64Accum = base64Accum;
  44567. return res;
  44568. }
  44569. Utf7IMAPDecoder.prototype.end = function() {
  44570. var res = "";
  44571. if (this.inBase64 && this.base64Accum.length > 0)
  44572. res = this.iconv.decode(Buffer.from(this.base64Accum, 'base64'), "utf16-be");
  44573. this.inBase64 = false;
  44574. this.base64Accum = '';
  44575. return res;
  44576. }
  44577. /***/ }),
  44578. /* 310 */
  44579. /***/ (function(module, exports, __webpack_require__) {
  44580. "use strict";
  44581. var Buffer = __webpack_require__(34).Buffer;
  44582. // Single-byte codec. Needs a 'chars' string parameter that contains 256 or 128 chars that
  44583. // correspond to encoded bytes (if 128 - then lower half is ASCII).
  44584. exports._sbcs = SBCSCodec;
  44585. function SBCSCodec(codecOptions, iconv) {
  44586. if (!codecOptions)
  44587. throw new Error("SBCS codec is called without the data.")
  44588. // Prepare char buffer for decoding.
  44589. if (!codecOptions.chars || (codecOptions.chars.length !== 128 && codecOptions.chars.length !== 256))
  44590. throw new Error("Encoding '"+codecOptions.type+"' has incorrect 'chars' (must be of len 128 or 256)");
  44591. if (codecOptions.chars.length === 128) {
  44592. var asciiString = "";
  44593. for (var i = 0; i < 128; i++)
  44594. asciiString += String.fromCharCode(i);
  44595. codecOptions.chars = asciiString + codecOptions.chars;
  44596. }
  44597. this.decodeBuf = Buffer.from(codecOptions.chars, 'ucs2');
  44598. // Encoding buffer.
  44599. var encodeBuf = Buffer.alloc(65536, iconv.defaultCharSingleByte.charCodeAt(0));
  44600. for (var i = 0; i < codecOptions.chars.length; i++)
  44601. encodeBuf[codecOptions.chars.charCodeAt(i)] = i;
  44602. this.encodeBuf = encodeBuf;
  44603. }
  44604. SBCSCodec.prototype.encoder = SBCSEncoder;
  44605. SBCSCodec.prototype.decoder = SBCSDecoder;
  44606. function SBCSEncoder(options, codec) {
  44607. this.encodeBuf = codec.encodeBuf;
  44608. }
  44609. SBCSEncoder.prototype.write = function(str) {
  44610. var buf = Buffer.alloc(str.length);
  44611. for (var i = 0; i < str.length; i++)
  44612. buf[i] = this.encodeBuf[str.charCodeAt(i)];
  44613. return buf;
  44614. }
  44615. SBCSEncoder.prototype.end = function() {
  44616. }
  44617. function SBCSDecoder(options, codec) {
  44618. this.decodeBuf = codec.decodeBuf;
  44619. }
  44620. SBCSDecoder.prototype.write = function(buf) {
  44621. // Strings are immutable in JS -> we use ucs2 buffer to speed up computations.
  44622. var decodeBuf = this.decodeBuf;
  44623. var newBuf = Buffer.alloc(buf.length*2);
  44624. var idx1 = 0, idx2 = 0;
  44625. for (var i = 0; i < buf.length; i++) {
  44626. idx1 = buf[i]*2; idx2 = i*2;
  44627. newBuf[idx2] = decodeBuf[idx1];
  44628. newBuf[idx2+1] = decodeBuf[idx1+1];
  44629. }
  44630. return newBuf.toString('ucs2');
  44631. }
  44632. SBCSDecoder.prototype.end = function() {
  44633. }
  44634. /***/ }),
  44635. /* 311 */
  44636. /***/ (function(module, exports, __webpack_require__) {
  44637. "use strict";
  44638. // Manually added data to be used by sbcs codec in addition to generated one.
  44639. module.exports = {
  44640. // Not supported by iconv, not sure why.
  44641. "10029": "maccenteuro",
  44642. "maccenteuro": {
  44643. "type": "_sbcs",
  44644. "chars": "ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ"
  44645. },
  44646. "808": "cp808",
  44647. "ibm808": "cp808",
  44648. "cp808": {
  44649. "type": "_sbcs",
  44650. "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№€■ "
  44651. },
  44652. "mik": {
  44653. "type": "_sbcs",
  44654. "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя└┴┬├─┼╣║╚╔╩╦╠═╬┐░▒▓│┤№§╗╝┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "
  44655. },
  44656. "cp720": {
  44657. "type": "_sbcs",
  44658. "chars": "\x80\x81éâ\x84à\x86çêëèïî\x8d\x8e\x8f\x90\u0651\u0652ô¤ـûùءآأؤ£إئابةتثجحخدذرزسشص«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ضطظعغفµقكلمنهوىي≡\u064b\u064c\u064d\u064e\u064f\u0650≈°∙·√ⁿ²■\u00a0"
  44659. },
  44660. // Aliases of generated encodings.
  44661. "ascii8bit": "ascii",
  44662. "usascii": "ascii",
  44663. "ansix34": "ascii",
  44664. "ansix341968": "ascii",
  44665. "ansix341986": "ascii",
  44666. "csascii": "ascii",
  44667. "cp367": "ascii",
  44668. "ibm367": "ascii",
  44669. "isoir6": "ascii",
  44670. "iso646us": "ascii",
  44671. "iso646irv": "ascii",
  44672. "us": "ascii",
  44673. "latin1": "iso88591",
  44674. "latin2": "iso88592",
  44675. "latin3": "iso88593",
  44676. "latin4": "iso88594",
  44677. "latin5": "iso88599",
  44678. "latin6": "iso885910",
  44679. "latin7": "iso885913",
  44680. "latin8": "iso885914",
  44681. "latin9": "iso885915",
  44682. "latin10": "iso885916",
  44683. "csisolatin1": "iso88591",
  44684. "csisolatin2": "iso88592",
  44685. "csisolatin3": "iso88593",
  44686. "csisolatin4": "iso88594",
  44687. "csisolatincyrillic": "iso88595",
  44688. "csisolatinarabic": "iso88596",
  44689. "csisolatingreek" : "iso88597",
  44690. "csisolatinhebrew": "iso88598",
  44691. "csisolatin5": "iso88599",
  44692. "csisolatin6": "iso885910",
  44693. "l1": "iso88591",
  44694. "l2": "iso88592",
  44695. "l3": "iso88593",
  44696. "l4": "iso88594",
  44697. "l5": "iso88599",
  44698. "l6": "iso885910",
  44699. "l7": "iso885913",
  44700. "l8": "iso885914",
  44701. "l9": "iso885915",
  44702. "l10": "iso885916",
  44703. "isoir14": "iso646jp",
  44704. "isoir57": "iso646cn",
  44705. "isoir100": "iso88591",
  44706. "isoir101": "iso88592",
  44707. "isoir109": "iso88593",
  44708. "isoir110": "iso88594",
  44709. "isoir144": "iso88595",
  44710. "isoir127": "iso88596",
  44711. "isoir126": "iso88597",
  44712. "isoir138": "iso88598",
  44713. "isoir148": "iso88599",
  44714. "isoir157": "iso885910",
  44715. "isoir166": "tis620",
  44716. "isoir179": "iso885913",
  44717. "isoir199": "iso885914",
  44718. "isoir203": "iso885915",
  44719. "isoir226": "iso885916",
  44720. "cp819": "iso88591",
  44721. "ibm819": "iso88591",
  44722. "cyrillic": "iso88595",
  44723. "arabic": "iso88596",
  44724. "arabic8": "iso88596",
  44725. "ecma114": "iso88596",
  44726. "asmo708": "iso88596",
  44727. "greek" : "iso88597",
  44728. "greek8" : "iso88597",
  44729. "ecma118" : "iso88597",
  44730. "elot928" : "iso88597",
  44731. "hebrew": "iso88598",
  44732. "hebrew8": "iso88598",
  44733. "turkish": "iso88599",
  44734. "turkish8": "iso88599",
  44735. "thai": "iso885911",
  44736. "thai8": "iso885911",
  44737. "celtic": "iso885914",
  44738. "celtic8": "iso885914",
  44739. "isoceltic": "iso885914",
  44740. "tis6200": "tis620",
  44741. "tis62025291": "tis620",
  44742. "tis62025330": "tis620",
  44743. "10000": "macroman",
  44744. "10006": "macgreek",
  44745. "10007": "maccyrillic",
  44746. "10079": "maciceland",
  44747. "10081": "macturkish",
  44748. "cspc8codepage437": "cp437",
  44749. "cspc775baltic": "cp775",
  44750. "cspc850multilingual": "cp850",
  44751. "cspcp852": "cp852",
  44752. "cspc862latinhebrew": "cp862",
  44753. "cpgr": "cp869",
  44754. "msee": "cp1250",
  44755. "mscyrl": "cp1251",
  44756. "msansi": "cp1252",
  44757. "msgreek": "cp1253",
  44758. "msturk": "cp1254",
  44759. "mshebr": "cp1255",
  44760. "msarab": "cp1256",
  44761. "winbaltrim": "cp1257",
  44762. "cp20866": "koi8r",
  44763. "20866": "koi8r",
  44764. "ibm878": "koi8r",
  44765. "cskoi8r": "koi8r",
  44766. "cp21866": "koi8u",
  44767. "21866": "koi8u",
  44768. "ibm1168": "koi8u",
  44769. "strk10482002": "rk1048",
  44770. "tcvn5712": "tcvn",
  44771. "tcvn57121": "tcvn",
  44772. "gb198880": "iso646cn",
  44773. "cn": "iso646cn",
  44774. "csiso14jisc6220ro": "iso646jp",
  44775. "jisc62201969ro": "iso646jp",
  44776. "jp": "iso646jp",
  44777. "cshproman8": "hproman8",
  44778. "r8": "hproman8",
  44779. "roman8": "hproman8",
  44780. "xroman8": "hproman8",
  44781. "ibm1051": "hproman8",
  44782. "mac": "macintosh",
  44783. "csmacintosh": "macintosh",
  44784. };
  44785. /***/ }),
  44786. /* 312 */
  44787. /***/ (function(module, exports, __webpack_require__) {
  44788. "use strict";
  44789. // Generated data for sbcs codec. Don't edit manually. Regenerate using generation/gen-sbcs.js script.
  44790. module.exports = {
  44791. "437": "cp437",
  44792. "737": "cp737",
  44793. "775": "cp775",
  44794. "850": "cp850",
  44795. "852": "cp852",
  44796. "855": "cp855",
  44797. "856": "cp856",
  44798. "857": "cp857",
  44799. "858": "cp858",
  44800. "860": "cp860",
  44801. "861": "cp861",
  44802. "862": "cp862",
  44803. "863": "cp863",
  44804. "864": "cp864",
  44805. "865": "cp865",
  44806. "866": "cp866",
  44807. "869": "cp869",
  44808. "874": "windows874",
  44809. "922": "cp922",
  44810. "1046": "cp1046",
  44811. "1124": "cp1124",
  44812. "1125": "cp1125",
  44813. "1129": "cp1129",
  44814. "1133": "cp1133",
  44815. "1161": "cp1161",
  44816. "1162": "cp1162",
  44817. "1163": "cp1163",
  44818. "1250": "windows1250",
  44819. "1251": "windows1251",
  44820. "1252": "windows1252",
  44821. "1253": "windows1253",
  44822. "1254": "windows1254",
  44823. "1255": "windows1255",
  44824. "1256": "windows1256",
  44825. "1257": "windows1257",
  44826. "1258": "windows1258",
  44827. "28591": "iso88591",
  44828. "28592": "iso88592",
  44829. "28593": "iso88593",
  44830. "28594": "iso88594",
  44831. "28595": "iso88595",
  44832. "28596": "iso88596",
  44833. "28597": "iso88597",
  44834. "28598": "iso88598",
  44835. "28599": "iso88599",
  44836. "28600": "iso885910",
  44837. "28601": "iso885911",
  44838. "28603": "iso885913",
  44839. "28604": "iso885914",
  44840. "28605": "iso885915",
  44841. "28606": "iso885916",
  44842. "windows874": {
  44843. "type": "_sbcs",
  44844. "chars": "€����…�����������‘’“”•–—�������� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����"
  44845. },
  44846. "win874": "windows874",
  44847. "cp874": "windows874",
  44848. "windows1250": {
  44849. "type": "_sbcs",
  44850. "chars": "€�‚�„…†‡�‰Š‹ŚŤŽŹ�‘’“”•–—�™š›śťžź ˇ˘Ł¤Ą¦§¨©Ş«¬­®Ż°±˛ł´µ¶·¸ąş»Ľ˝ľżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙"
  44851. },
  44852. "win1250": "windows1250",
  44853. "cp1250": "windows1250",
  44854. "windows1251": {
  44855. "type": "_sbcs",
  44856. "chars": "ЂЃ‚ѓ„…†‡€‰Љ‹ЊЌЋЏђ‘’“”•–—�™љ›њќћџ ЎўЈ¤Ґ¦§Ё©Є«¬­®Ї°±Ііґµ¶·ё№є»јЅѕїАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя"
  44857. },
  44858. "win1251": "windows1251",
  44859. "cp1251": "windows1251",
  44860. "windows1252": {
  44861. "type": "_sbcs",
  44862. "chars": "€�‚ƒ„…†‡ˆ‰Š‹Œ�Ž��‘’“”•–—˜™š›œ�žŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ"
  44863. },
  44864. "win1252": "windows1252",
  44865. "cp1252": "windows1252",
  44866. "windows1253": {
  44867. "type": "_sbcs",
  44868. "chars": "€�‚ƒ„…†‡�‰�‹�����‘’“”•–—�™�›���� ΅Ά£¤¥¦§¨©�«¬­®―°±²³΄µ¶·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�"
  44869. },
  44870. "win1253": "windows1253",
  44871. "cp1253": "windows1253",
  44872. "windows1254": {
  44873. "type": "_sbcs",
  44874. "chars": "€�‚ƒ„…†‡ˆ‰Š‹Œ����‘’“”•–—˜™š›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖ×ØÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ"
  44875. },
  44876. "win1254": "windows1254",
  44877. "cp1254": "windows1254",
  44878. "windows1255": {
  44879. "type": "_sbcs",
  44880. "chars": "€�‚ƒ„…†‡ˆ‰�‹�����‘’“”•–—˜™�›���� ¡¢£₪¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾¿ְֱֲֳִֵֶַָֹֺֻּֽ־ֿ׀ׁׂ׃װױײ׳״�������אבגדהוזחטיךכלםמןנסעףפץצקרשת��‎‏�"
  44881. },
  44882. "win1255": "windows1255",
  44883. "cp1255": "windows1255",
  44884. "windows1256": {
  44885. "type": "_sbcs",
  44886. "chars": "€پ‚ƒ„…†‡ˆ‰ٹ‹Œچژڈگ‘’“”•–—ک™ڑ›œ‌‍ں ،¢£¤¥¦§¨©ھ«¬­®¯°±²³´µ¶·¸¹؛»¼½¾؟ہءآأؤإئابةتثجحخدذرزسشصض×طظعغـفقكàلâمنهوçèéêëىيîïًٌٍَôُِ÷ّùْûü‎‏ے"
  44887. },
  44888. "win1256": "windows1256",
  44889. "cp1256": "windows1256",
  44890. "windows1257": {
  44891. "type": "_sbcs",
  44892. "chars": "€�‚�„…†‡�‰�‹�¨ˇ¸�‘’“”•–—�™�›�¯˛� �¢£¤�¦§Ø©Ŗ«¬­®Æ°±²³´µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž˙"
  44893. },
  44894. "win1257": "windows1257",
  44895. "cp1257": "windows1257",
  44896. "windows1258": {
  44897. "type": "_sbcs",
  44898. "chars": "€�‚ƒ„…†‡ˆ‰�‹Œ����‘’“”•–—˜™�›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖ×ØÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ"
  44899. },
  44900. "win1258": "windows1258",
  44901. "cp1258": "windows1258",
  44902. "iso88591": {
  44903. "type": "_sbcs",
  44904. "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ"
  44905. },
  44906. "cp28591": "iso88591",
  44907. "iso88592": {
  44908. "type": "_sbcs",
  44909. "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ą˘Ł¤ĽŚ§¨ŠŞŤŹ­ŽŻ°ą˛ł´ľśˇ¸šşťź˝žżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙"
  44910. },
  44911. "cp28592": "iso88592",
  44912. "iso88593": {
  44913. "type": "_sbcs",
  44914. "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ħ˘£¤�Ĥ§¨İŞĞĴ­�Ż°ħ²³´µĥ·¸ışğĵ½�żÀÁÂ�ÄĊĈÇÈÉÊËÌÍÎÏ�ÑÒÓÔĠÖ×ĜÙÚÛÜŬŜßàáâ�äċĉçèéêëìíîï�ñòóôġö÷ĝùúûüŭŝ˙"
  44915. },
  44916. "cp28593": "iso88593",
  44917. "iso88594": {
  44918. "type": "_sbcs",
  44919. "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĸŖ¤ĨĻ§¨ŠĒĢŦ­Ž¯°ą˛ŗ´ĩļˇ¸šēģŧŊžŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎĪĐŅŌĶÔÕÖ×ØŲÚÛÜŨŪßāáâãäåæįčéęëėíîīđņōķôõö÷øųúûüũū˙"
  44920. },
  44921. "cp28594": "iso88594",
  44922. "iso88595": {
  44923. "type": "_sbcs",
  44924. "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂЃЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђѓєѕіїјљњћќ§ўџ"
  44925. },
  44926. "cp28595": "iso88595",
  44927. "iso88596": {
  44928. "type": "_sbcs",
  44929. "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ���¤�������،­�������������؛���؟�ءآأؤإئابةتثجحخدذرزسشصضطظعغ�����ـفقكلمنهوىيًٌٍَُِّْ�������������"
  44930. },
  44931. "cp28596": "iso88596",
  44932. "iso88597": {
  44933. "type": "_sbcs",
  44934. "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ‘’£€₯¦§¨©ͺ«¬­�―°±²³΄΅Ά·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�"
  44935. },
  44936. "cp28597": "iso88597",
  44937. "iso88598": {
  44938. "type": "_sbcs",
  44939. "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ �¢£¤¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾��������������������������������‗אבגדהוזחטיךכלםמןנסעףפץצקרשת��‎‏�"
  44940. },
  44941. "cp28598": "iso88598",
  44942. "iso88599": {
  44943. "type": "_sbcs",
  44944. "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖ×ØÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ"
  44945. },
  44946. "cp28599": "iso88599",
  44947. "iso885910": {
  44948. "type": "_sbcs",
  44949. "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĒĢĪĨĶ§ĻĐŠŦŽ­ŪŊ°ąēģīĩķ·ļđšŧž―ūŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎÏÐŅŌÓÔÕÖŨØŲÚÛÜÝÞßāáâãäåæįčéęëėíîïðņōóôõöũøųúûüýþĸ"
  44950. },
  44951. "cp28600": "iso885910",
  44952. "iso885911": {
  44953. "type": "_sbcs",
  44954. "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����"
  44955. },
  44956. "cp28601": "iso885911",
  44957. "iso885913": {
  44958. "type": "_sbcs",
  44959. "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ”¢£¤„¦§Ø©Ŗ«¬­®Æ°±²³“µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž’"
  44960. },
  44961. "cp28603": "iso885913",
  44962. "iso885914": {
  44963. "type": "_sbcs",
  44964. "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ḃḃ£ĊċḊ§Ẁ©ẂḋỲ­®ŸḞḟĠġṀṁ¶ṖẁṗẃṠỳẄẅṡÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŴÑÒÓÔÕÖṪØÙÚÛÜÝŶßàáâãäåæçèéêëìíîïŵñòóôõöṫøùúûüýŷÿ"
  44965. },
  44966. "cp28604": "iso885914",
  44967. "iso885915": {
  44968. "type": "_sbcs",
  44969. "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥Š§š©ª«¬­®¯°±²³Žµ¶·ž¹º»ŒœŸ¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ"
  44970. },
  44971. "cp28605": "iso885915",
  44972. "iso885916": {
  44973. "type": "_sbcs",
  44974. "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄąŁ€„Š§š©Ș«Ź­źŻ°±ČłŽ”¶·žčș»ŒœŸżÀÁÂĂÄĆÆÇÈÉÊËÌÍÎÏĐŃÒÓÔŐÖŚŰÙÚÛÜĘȚßàáâăäćæçèéêëìíîïđńòóôőöśűùúûüęțÿ"
  44975. },
  44976. "cp28606": "iso885916",
  44977. "cp437": {
  44978. "type": "_sbcs",
  44979. "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "
  44980. },
  44981. "ibm437": "cp437",
  44982. "csibm437": "cp437",
  44983. "cp737": {
  44984. "type": "_sbcs",
  44985. "chars": "ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρσςτυφχψ░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ωάέήϊίόύϋώΆΈΉΊΌΎΏ±≥≤ΪΫ÷≈°∙·√ⁿ²■ "
  44986. },
  44987. "ibm737": "cp737",
  44988. "csibm737": "cp737",
  44989. "cp775": {
  44990. "type": "_sbcs",
  44991. "chars": "ĆüéāäģåćłēŖŗīŹÄÅÉæÆōöĢ¢ŚśÖÜø£ØפĀĪóŻżź”¦©®¬½¼Ł«»░▒▓│┤ĄČĘĖ╣║╗╝ĮŠ┐└┴┬├─┼ŲŪ╚╔╩╦╠═╬Žąčęėįšųūž┘┌█▄▌▐▀ÓßŌŃõÕµńĶķĻļņĒŅ’­±“¾¶§÷„°∙·¹³²■ "
  44992. },
  44993. "ibm775": "cp775",
  44994. "csibm775": "cp775",
  44995. "cp850": {
  44996. "type": "_sbcs",
  44997. "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø׃áíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈıÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ "
  44998. },
  44999. "ibm850": "cp850",
  45000. "csibm850": "cp850",
  45001. "cp852": {
  45002. "type": "_sbcs",
  45003. "chars": "ÇüéâäůćçłëŐőîŹÄĆÉĹĺôöĽľŚśÖÜŤťŁ×čáíóúĄąŽžĘ꬟Ⱥ«»░▒▓│┤ÁÂĚŞ╣║╗╝Żż┐└┴┬├─┼Ăă╚╔╩╦╠═╬¤đĐĎËďŇÍÎě┘┌█▄ŢŮ▀ÓßÔŃńňŠšŔÚŕŰýÝţ´­˝˛ˇ˘§÷¸°¨˙űŘř■ "
  45004. },
  45005. "ibm852": "cp852",
  45006. "csibm852": "cp852",
  45007. "cp855": {
  45008. "type": "_sbcs",
  45009. "chars": "ђЂѓЃёЁєЄѕЅіІїЇјЈљЉњЊћЋќЌўЎџЏюЮъЪаАбБцЦдДеЕфФгГ«»░▒▓│┤хХиИ╣║╗╝йЙ┐└┴┬├─┼кК╚╔╩╦╠═╬¤лЛмМнНоОп┘┌█▄Пя▀ЯрРсСтТуУжЖвВьЬ№­ыЫзЗшШэЭщЩчЧ§■ "
  45010. },
  45011. "ibm855": "cp855",
  45012. "csibm855": "cp855",
  45013. "cp856": {
  45014. "type": "_sbcs",
  45015. "chars": "אבגדהוזחטיךכלםמןנסעףפץצקרשת�£�×����������®¬½¼�«»░▒▓│┤���©╣║╗╝¢¥┐└┴┬├─┼��╚╔╩╦╠═╬¤���������┘┌█▄¦�▀������µ�������¯´­±‗¾¶§÷¸°¨·¹³²■ "
  45016. },
  45017. "ibm856": "cp856",
  45018. "csibm856": "cp856",
  45019. "cp857": {
  45020. "type": "_sbcs",
  45021. "chars": "ÇüéâäàåçêëèïîıÄÅÉæÆôöòûùİÖÜø£ØŞşáíóúñÑĞ𿮬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ºªÊËÈ�ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµ�×ÚÛÙìÿ¯´­±�¾¶§÷¸°¨·¹³²■ "
  45022. },
  45023. "ibm857": "cp857",
  45024. "csibm857": "cp857",
  45025. "cp858": {
  45026. "type": "_sbcs",
  45027. "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø׃áíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈ€ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ "
  45028. },
  45029. "ibm858": "cp858",
  45030. "csibm858": "cp858",
  45031. "cp860": {
  45032. "type": "_sbcs",
  45033. "chars": "ÇüéâãàÁçêÊèÍÔìÃÂÉÀÈôõòÚùÌÕÜ¢£Ù₧ÓáíóúñѪº¿Ò¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "
  45034. },
  45035. "ibm860": "cp860",
  45036. "csibm860": "cp860",
  45037. "cp861": {
  45038. "type": "_sbcs",
  45039. "chars": "ÇüéâäàåçêëèÐðÞÄÅÉæÆôöþûÝýÖÜø£Ø₧ƒáíóúÁÍÓÚ¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "
  45040. },
  45041. "ibm861": "cp861",
  45042. "csibm861": "cp861",
  45043. "cp862": {
  45044. "type": "_sbcs",
  45045. "chars": "אבגדהוזחטיךכלםמןנסעףפץצקרשת¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "
  45046. },
  45047. "ibm862": "cp862",
  45048. "csibm862": "cp862",
  45049. "cp863": {
  45050. "type": "_sbcs",
  45051. "chars": "ÇüéâÂà¶çêëèïî‗À§ÉÈÊôËÏûù¤ÔÜ¢£ÙÛƒ¦´óú¨¸³¯Î⌐¬½¼¾«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "
  45052. },
  45053. "ibm863": "cp863",
  45054. "csibm863": "cp863",
  45055. "cp864": {
  45056. "type": "_sbcs",
  45057. "chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$٪&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~°·∙√▒─│┼┤┬├┴┐┌└┘β∞φ±½¼≈«»ﻷﻸ��ﻻﻼ� ­ﺂ£¤ﺄ��ﺎﺏﺕﺙ،ﺝﺡﺥ٠١٢٣٤٥٦٧٨٩ﻑ؛ﺱﺵﺹ؟¢ﺀﺁﺃﺅﻊﺋﺍﺑﺓﺗﺛﺟﺣﺧﺩﺫﺭﺯﺳﺷﺻﺿﻁﻅﻋﻏ¦¬÷×ﻉـﻓﻗﻛﻟﻣﻧﻫﻭﻯﻳﺽﻌﻎﻍﻡﹽّﻥﻩﻬﻰﻲﻐﻕﻵﻶﻝﻙﻱ■�"
  45058. },
  45059. "ibm864": "cp864",
  45060. "csibm864": "cp864",
  45061. "cp865": {
  45062. "type": "_sbcs",
  45063. "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø₧ƒáíóúñѪº¿⌐¬½¼¡«¤░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "
  45064. },
  45065. "ibm865": "cp865",
  45066. "csibm865": "cp865",
  45067. "cp866": {
  45068. "type": "_sbcs",
  45069. "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№¤■ "
  45070. },
  45071. "ibm866": "cp866",
  45072. "csibm866": "cp866",
  45073. "cp869": {
  45074. "type": "_sbcs",
  45075. "chars": "������Ά�·¬¦‘’Έ―ΉΊΪΌ��ΎΫ©Ώ²³ά£έήίϊΐόύΑΒΓΔΕΖΗ½ΘΙ«»░▒▓│┤ΚΛΜΝ╣║╗╝ΞΟ┐└┴┬├─┼ΠΡ╚╔╩╦╠═╬ΣΤΥΦΧΨΩαβγ┘┌█▄δε▀ζηθικλμνξοπρσςτ΄­±υφχ§ψ΅°¨ωϋΰώ■ "
  45076. },
  45077. "ibm869": "cp869",
  45078. "csibm869": "cp869",
  45079. "cp922": {
  45080. "type": "_sbcs",
  45081. "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®‾°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŠÑÒÓÔÕÖ×ØÙÚÛÜÝŽßàáâãäåæçèéêëìíîïšñòóôõö÷øùúûüýžÿ"
  45082. },
  45083. "ibm922": "cp922",
  45084. "csibm922": "cp922",
  45085. "cp1046": {
  45086. "type": "_sbcs",
  45087. "chars": "ﺈ×÷ﹱˆ■│─┐┌└┘ﹹﹻﹽﹿﹷﺊﻰﻳﻲﻎﻏﻐﻶﻸﻺﻼ ¤ﺋﺑﺗﺛﺟﺣ،­ﺧﺳ٠١٢٣٤٥٦٧٨٩ﺷ؛ﺻﺿﻊ؟ﻋءآأؤإئابةتثجحخدذرزسشصضطﻇعغﻌﺂﺄﺎﻓـفقكلمنهوىيًٌٍَُِّْﻗﻛﻟﻵﻷﻹﻻﻣﻧﻬﻩ�"
  45088. },
  45089. "ibm1046": "cp1046",
  45090. "csibm1046": "cp1046",
  45091. "cp1124": {
  45092. "type": "_sbcs",
  45093. "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂҐЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђґєѕіїјљњћќ§ўџ"
  45094. },
  45095. "ibm1124": "cp1124",
  45096. "csibm1124": "cp1124",
  45097. "cp1125": {
  45098. "type": "_sbcs",
  45099. "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёҐґЄєІіЇї·√№¤■ "
  45100. },
  45101. "ibm1125": "cp1125",
  45102. "csibm1125": "cp1125",
  45103. "cp1129": {
  45104. "type": "_sbcs",
  45105. "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§œ©ª«¬­®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖ×ØÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ"
  45106. },
  45107. "ibm1129": "cp1129",
  45108. "csibm1129": "cp1129",
  45109. "cp1133": {
  45110. "type": "_sbcs",
  45111. "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ກຂຄງຈສຊຍດຕຖທນບປຜຝພຟມຢຣລວຫອຮ���ຯະາຳິີຶືຸູຼັົຽ���ເແໂໃໄ່້໊໋໌ໍໆ�ໜໝ₭����������������໐໑໒໓໔໕໖໗໘໙��¢¬¦�"
  45112. },
  45113. "ibm1133": "cp1133",
  45114. "csibm1133": "cp1133",
  45115. "cp1161": {
  45116. "type": "_sbcs",
  45117. "chars": "��������������������������������่กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู้๊๋€฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛¢¬¦ "
  45118. },
  45119. "ibm1161": "cp1161",
  45120. "csibm1161": "cp1161",
  45121. "cp1162": {
  45122. "type": "_sbcs",
  45123. "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����"
  45124. },
  45125. "ibm1162": "cp1162",
  45126. "csibm1162": "cp1162",
  45127. "cp1163": {
  45128. "type": "_sbcs",
  45129. "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥¦§œ©ª«¬­®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖ×ØÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ"
  45130. },
  45131. "ibm1163": "cp1163",
  45132. "csibm1163": "cp1163",
  45133. "maccroatian": {
  45134. "type": "_sbcs",
  45135. "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈Ć«Č… ÀÃÕŒœĐ—“”‘’÷◊�©⁄¤‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ"
  45136. },
  45137. "maccyrillic": {
  45138. "type": "_sbcs",
  45139. "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°¢£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµ∂ЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤"
  45140. },
  45141. "macgreek": {
  45142. "type": "_sbcs",
  45143. "chars": "Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦­ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ�"
  45144. },
  45145. "maciceland": {
  45146. "type": "_sbcs",
  45147. "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüÝ°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ"
  45148. },
  45149. "macroman": {
  45150. "type": "_sbcs",
  45151. "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ"
  45152. },
  45153. "macromania": {
  45154. "type": "_sbcs",
  45155. "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂŞ∞±≤≥¥µ∂∑∏π∫ªºΩăş¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›Ţţ‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ"
  45156. },
  45157. "macthai": {
  45158. "type": "_sbcs",
  45159. "chars": "«»…“”�•‘’� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู​–—฿เแโใไๅๆ็่้๊๋์ํ™๏๐๑๒๓๔๕๖๗๘๙®©����"
  45160. },
  45161. "macturkish": {
  45162. "type": "_sbcs",
  45163. "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙ�ˆ˜¯˘˙˚¸˝˛ˇ"
  45164. },
  45165. "macukraine": {
  45166. "type": "_sbcs",
  45167. "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤"
  45168. },
  45169. "koi8r": {
  45170. "type": "_sbcs",
  45171. "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ё╓╔╕╖╗╘╙╚╛╜╝╞╟╠╡Ё╢╣╤╥╦╧╨╩╪╫╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ"
  45172. },
  45173. "koi8u": {
  45174. "type": "_sbcs",
  45175. "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґ╝╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪Ґ╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ"
  45176. },
  45177. "koi8ru": {
  45178. "type": "_sbcs",
  45179. "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґў╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪ҐЎ©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ"
  45180. },
  45181. "koi8t": {
  45182. "type": "_sbcs",
  45183. "chars": "қғ‚Ғ„…†‡�‰ҳ‹ҲҷҶ�Қ‘’“”•–—�™�›�����ӯӮё¤ӣ¦§���«¬­®�°±²Ё�Ӣ¶·�№�»���©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ"
  45184. },
  45185. "armscii8": {
  45186. "type": "_sbcs",
  45187. "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ �և։)(»«—.՝,-֊…՜՛՞ԱաԲբԳգԴդԵեԶզԷէԸըԹթԺժԻիԼլԽխԾծԿկՀհՁձՂղՃճՄմՅյՆնՇշՈոՉչՊպՋջՌռՍսՎվՏտՐրՑցՒւՓփՔքՕօՖֆ՚�"
  45188. },
  45189. "rk1048": {
  45190. "type": "_sbcs",
  45191. "chars": "ЂЃ‚ѓ„…†‡€‰Љ‹ЊҚҺЏђ‘’“”•–—�™љ›њқһџ ҰұӘ¤Ө¦§Ё©Ғ«¬­®Ү°±Ііөµ¶·ё№ғ»әҢңүАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя"
  45192. },
  45193. "tcvn": {
  45194. "type": "_sbcs",
  45195. "chars": "\u0000ÚỤ\u0003ỪỬỮ\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010ỨỰỲỶỸÝỴ\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÀẢÃÁẠẶẬÈẺẼÉẸỆÌỈĨÍỊÒỎÕÓỌỘỜỞỠỚỢÙỦŨ ĂÂÊÔƠƯĐăâêôơưđẶ̀̀̉̃́àảãáạẲằẳẵắẴẮẦẨẪẤỀặầẩẫấậèỂẻẽéẹềểễếệìỉỄẾỒĩíịòỔỏõóọồổỗốộờởỡớợùỖủũúụừửữứựỳỷỹýỵỐ"
  45196. },
  45197. "georgianacademy": {
  45198. "type": "_sbcs",
  45199. "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზთიკლმნოპჟრსტუფქღყშჩცძწჭხჯჰჱჲჳჴჵჶçèéêëìíîïðñòóôõö÷øùúûüýþÿ"
  45200. },
  45201. "georgianps": {
  45202. "type": "_sbcs",
  45203. "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზჱთიკლმნჲოპჟრსტჳუფქღყშჩცძწჭხჴჯჰჵæçèéêëìíîïðñòóôõö÷øùúûüýþÿ"
  45204. },
  45205. "pt154": {
  45206. "type": "_sbcs",
  45207. "chars": "ҖҒӮғ„…ҶҮҲүҠӢҢҚҺҸҗ‘’“”•–—ҳҷҡӣңқһҹ ЎўЈӨҘҰ§Ё©Ә«¬ӯ®Ҝ°ұІіҙө¶·ё№ә»јҪҫҝАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя"
  45208. },
  45209. "viscii": {
  45210. "type": "_sbcs",
  45211. "chars": "\u0000\u0001Ẳ\u0003\u0004ẴẪ\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013Ỷ\u0015\u0016\u0017\u0018Ỹ\u001a\u001b\u001c\u001dỴ\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ẠẮẰẶẤẦẨẬẼẸẾỀỂỄỆỐỒỔỖỘỢỚỜỞỊỎỌỈỦŨỤỲÕắằặấầẩậẽẹếềểễệốồổỗỠƠộờởịỰỨỪỬơớƯÀÁÂÃẢĂẳẵÈÉÊẺÌÍĨỳĐứÒÓÔạỷừửÙÚỹỵÝỡưàáâãảăữẫèéêẻìíĩỉđựòóôõỏọụùúũủýợỮ"
  45212. },
  45213. "iso646cn": {
  45214. "type": "_sbcs",
  45215. "chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#¥%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������"
  45216. },
  45217. "iso646jp": {
  45218. "type": "_sbcs",
  45219. "chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[¥]^_`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������"
  45220. },
  45221. "hproman8": {
  45222. "type": "_sbcs",
  45223. "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ÀÂÈÊËÎÏ´ˋˆ¨˜ÙÛ₤¯Ýý°ÇçÑñ¡¿¤£¥§ƒ¢âêôûáéóúàèòùäëöüÅîØÆåíøæÄìÖÜÉïßÔÁÃãÐðÍÌÓÒÕõŠšÚŸÿÞþ·µ¶¾—¼½ªº«■»±�"
  45224. },
  45225. "macintosh": {
  45226. "type": "_sbcs",
  45227. "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ"
  45228. },
  45229. "ascii": {
  45230. "type": "_sbcs",
  45231. "chars": "��������������������������������������������������������������������������������������������������������������������������������"
  45232. },
  45233. "tis620": {
  45234. "type": "_sbcs",
  45235. "chars": "���������������������������������กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����"
  45236. }
  45237. }
  45238. /***/ }),
  45239. /* 313 */
  45240. /***/ (function(module, exports, __webpack_require__) {
  45241. "use strict";
  45242. var Buffer = __webpack_require__(34).Buffer;
  45243. // Multibyte codec. In this scheme, a character is represented by 1 or more bytes.
  45244. // Our codec supports UTF-16 surrogates, extensions for GB18030 and unicode sequences.
  45245. // To save memory and loading time, we read table files only when requested.
  45246. exports._dbcs = DBCSCodec;
  45247. var UNASSIGNED = -1,
  45248. GB18030_CODE = -2,
  45249. SEQ_START = -10,
  45250. NODE_START = -1000,
  45251. UNASSIGNED_NODE = new Array(0x100),
  45252. DEF_CHAR = -1;
  45253. for (var i = 0; i < 0x100; i++)
  45254. UNASSIGNED_NODE[i] = UNASSIGNED;
  45255. // Class DBCSCodec reads and initializes mapping tables.
  45256. function DBCSCodec(codecOptions, iconv) {
  45257. this.encodingName = codecOptions.encodingName;
  45258. if (!codecOptions)
  45259. throw new Error("DBCS codec is called without the data.")
  45260. if (!codecOptions.table)
  45261. throw new Error("Encoding '" + this.encodingName + "' has no data.");
  45262. // Load tables.
  45263. var mappingTable = codecOptions.table();
  45264. // Decode tables: MBCS -> Unicode.
  45265. // decodeTables is a trie, encoded as an array of arrays of integers. Internal arrays are trie nodes and all have len = 256.
  45266. // Trie root is decodeTables[0].
  45267. // Values: >= 0 -> unicode character code. can be > 0xFFFF
  45268. // == UNASSIGNED -> unknown/unassigned sequence.
  45269. // == GB18030_CODE -> this is the end of a GB18030 4-byte sequence.
  45270. // <= NODE_START -> index of the next node in our trie to process next byte.
  45271. // <= SEQ_START -> index of the start of a character code sequence, in decodeTableSeq.
  45272. this.decodeTables = [];
  45273. this.decodeTables[0] = UNASSIGNED_NODE.slice(0); // Create root node.
  45274. // Sometimes a MBCS char corresponds to a sequence of unicode chars. We store them as arrays of integers here.
  45275. this.decodeTableSeq = [];
  45276. // Actual mapping tables consist of chunks. Use them to fill up decode tables.
  45277. for (var i = 0; i < mappingTable.length; i++)
  45278. this._addDecodeChunk(mappingTable[i]);
  45279. this.defaultCharUnicode = iconv.defaultCharUnicode;
  45280. // Encode tables: Unicode -> DBCS.
  45281. // `encodeTable` is array mapping from unicode char to encoded char. All its values are integers for performance.
  45282. // Because it can be sparse, it is represented as array of buckets by 256 chars each. Bucket can be null.
  45283. // Values: >= 0 -> it is a normal char. Write the value (if <=256 then 1 byte, if <=65536 then 2 bytes, etc.).
  45284. // == UNASSIGNED -> no conversion found. Output a default char.
  45285. // <= SEQ_START -> it's an index in encodeTableSeq, see below. The character starts a sequence.
  45286. this.encodeTable = [];
  45287. // `encodeTableSeq` is used when a sequence of unicode characters is encoded as a single code. We use a tree of
  45288. // objects where keys correspond to characters in sequence and leafs are the encoded dbcs values. A special DEF_CHAR key
  45289. // means end of sequence (needed when one sequence is a strict subsequence of another).
  45290. // Objects are kept separately from encodeTable to increase performance.
  45291. this.encodeTableSeq = [];
  45292. // Some chars can be decoded, but need not be encoded.
  45293. var skipEncodeChars = {};
  45294. if (codecOptions.encodeSkipVals)
  45295. for (var i = 0; i < codecOptions.encodeSkipVals.length; i++) {
  45296. var val = codecOptions.encodeSkipVals[i];
  45297. if (typeof val === 'number')
  45298. skipEncodeChars[val] = true;
  45299. else
  45300. for (var j = val.from; j <= val.to; j++)
  45301. skipEncodeChars[j] = true;
  45302. }
  45303. // Use decode trie to recursively fill out encode tables.
  45304. this._fillEncodeTable(0, 0, skipEncodeChars);
  45305. // Add more encoding pairs when needed.
  45306. if (codecOptions.encodeAdd) {
  45307. for (var uChar in codecOptions.encodeAdd)
  45308. if (Object.prototype.hasOwnProperty.call(codecOptions.encodeAdd, uChar))
  45309. this._setEncodeChar(uChar.charCodeAt(0), codecOptions.encodeAdd[uChar]);
  45310. }
  45311. this.defCharSB = this.encodeTable[0][iconv.defaultCharSingleByte.charCodeAt(0)];
  45312. if (this.defCharSB === UNASSIGNED) this.defCharSB = this.encodeTable[0]['?'];
  45313. if (this.defCharSB === UNASSIGNED) this.defCharSB = "?".charCodeAt(0);
  45314. // Load & create GB18030 tables when needed.
  45315. if (typeof codecOptions.gb18030 === 'function') {
  45316. this.gb18030 = codecOptions.gb18030(); // Load GB18030 ranges.
  45317. // Add GB18030 decode tables.
  45318. var thirdByteNodeIdx = this.decodeTables.length;
  45319. var thirdByteNode = this.decodeTables[thirdByteNodeIdx] = UNASSIGNED_NODE.slice(0);
  45320. var fourthByteNodeIdx = this.decodeTables.length;
  45321. var fourthByteNode = this.decodeTables[fourthByteNodeIdx] = UNASSIGNED_NODE.slice(0);
  45322. for (var i = 0x81; i <= 0xFE; i++) {
  45323. var secondByteNodeIdx = NODE_START - this.decodeTables[0][i];
  45324. var secondByteNode = this.decodeTables[secondByteNodeIdx];
  45325. for (var j = 0x30; j <= 0x39; j++)
  45326. secondByteNode[j] = NODE_START - thirdByteNodeIdx;
  45327. }
  45328. for (var i = 0x81; i <= 0xFE; i++)
  45329. thirdByteNode[i] = NODE_START - fourthByteNodeIdx;
  45330. for (var i = 0x30; i <= 0x39; i++)
  45331. fourthByteNode[i] = GB18030_CODE
  45332. }
  45333. }
  45334. DBCSCodec.prototype.encoder = DBCSEncoder;
  45335. DBCSCodec.prototype.decoder = DBCSDecoder;
  45336. // Decoder helpers
  45337. DBCSCodec.prototype._getDecodeTrieNode = function(addr) {
  45338. var bytes = [];
  45339. for (; addr > 0; addr >>= 8)
  45340. bytes.push(addr & 0xFF);
  45341. if (bytes.length == 0)
  45342. bytes.push(0);
  45343. var node = this.decodeTables[0];
  45344. for (var i = bytes.length-1; i > 0; i--) { // Traverse nodes deeper into the trie.
  45345. var val = node[bytes[i]];
  45346. if (val == UNASSIGNED) { // Create new node.
  45347. node[bytes[i]] = NODE_START - this.decodeTables.length;
  45348. this.decodeTables.push(node = UNASSIGNED_NODE.slice(0));
  45349. }
  45350. else if (val <= NODE_START) { // Existing node.
  45351. node = this.decodeTables[NODE_START - val];
  45352. }
  45353. else
  45354. throw new Error("Overwrite byte in " + this.encodingName + ", addr: " + addr.toString(16));
  45355. }
  45356. return node;
  45357. }
  45358. DBCSCodec.prototype._addDecodeChunk = function(chunk) {
  45359. // First element of chunk is the hex mbcs code where we start.
  45360. var curAddr = parseInt(chunk[0], 16);
  45361. // Choose the decoding node where we'll write our chars.
  45362. var writeTable = this._getDecodeTrieNode(curAddr);
  45363. curAddr = curAddr & 0xFF;
  45364. // Write all other elements of the chunk to the table.
  45365. for (var k = 1; k < chunk.length; k++) {
  45366. var part = chunk[k];
  45367. if (typeof part === "string") { // String, write as-is.
  45368. for (var l = 0; l < part.length;) {
  45369. var code = part.charCodeAt(l++);
  45370. if (0xD800 <= code && code < 0xDC00) { // Decode surrogate
  45371. var codeTrail = part.charCodeAt(l++);
  45372. if (0xDC00 <= codeTrail && codeTrail < 0xE000)
  45373. writeTable[curAddr++] = 0x10000 + (code - 0xD800) * 0x400 + (codeTrail - 0xDC00);
  45374. else
  45375. throw new Error("Incorrect surrogate pair in " + this.encodingName + " at chunk " + chunk[0]);
  45376. }
  45377. else if (0x0FF0 < code && code <= 0x0FFF) { // Character sequence (our own encoding used)
  45378. var len = 0xFFF - code + 2;
  45379. var seq = [];
  45380. for (var m = 0; m < len; m++)
  45381. seq.push(part.charCodeAt(l++)); // Simple variation: don't support surrogates or subsequences in seq.
  45382. writeTable[curAddr++] = SEQ_START - this.decodeTableSeq.length;
  45383. this.decodeTableSeq.push(seq);
  45384. }
  45385. else
  45386. writeTable[curAddr++] = code; // Basic char
  45387. }
  45388. }
  45389. else if (typeof part === "number") { // Integer, meaning increasing sequence starting with prev character.
  45390. var charCode = writeTable[curAddr - 1] + 1;
  45391. for (var l = 0; l < part; l++)
  45392. writeTable[curAddr++] = charCode++;
  45393. }
  45394. else
  45395. throw new Error("Incorrect type '" + typeof part + "' given in " + this.encodingName + " at chunk " + chunk[0]);
  45396. }
  45397. if (curAddr > 0xFF)
  45398. throw new Error("Incorrect chunk in " + this.encodingName + " at addr " + chunk[0] + ": too long" + curAddr);
  45399. }
  45400. // Encoder helpers
  45401. DBCSCodec.prototype._getEncodeBucket = function(uCode) {
  45402. var high = uCode >> 8; // This could be > 0xFF because of astral characters.
  45403. if (this.encodeTable[high] === undefined)
  45404. this.encodeTable[high] = UNASSIGNED_NODE.slice(0); // Create bucket on demand.
  45405. return this.encodeTable[high];
  45406. }
  45407. DBCSCodec.prototype._setEncodeChar = function(uCode, dbcsCode) {
  45408. var bucket = this._getEncodeBucket(uCode);
  45409. var low = uCode & 0xFF;
  45410. if (bucket[low] <= SEQ_START)
  45411. this.encodeTableSeq[SEQ_START-bucket[low]][DEF_CHAR] = dbcsCode; // There's already a sequence, set a single-char subsequence of it.
  45412. else if (bucket[low] == UNASSIGNED)
  45413. bucket[low] = dbcsCode;
  45414. }
  45415. DBCSCodec.prototype._setEncodeSequence = function(seq, dbcsCode) {
  45416. // Get the root of character tree according to first character of the sequence.
  45417. var uCode = seq[0];
  45418. var bucket = this._getEncodeBucket(uCode);
  45419. var low = uCode & 0xFF;
  45420. var node;
  45421. if (bucket[low] <= SEQ_START) {
  45422. // There's already a sequence with - use it.
  45423. node = this.encodeTableSeq[SEQ_START-bucket[low]];
  45424. }
  45425. else {
  45426. // There was no sequence object - allocate a new one.
  45427. node = {};
  45428. if (bucket[low] !== UNASSIGNED) node[DEF_CHAR] = bucket[low]; // If a char was set before - make it a single-char subsequence.
  45429. bucket[low] = SEQ_START - this.encodeTableSeq.length;
  45430. this.encodeTableSeq.push(node);
  45431. }
  45432. // Traverse the character tree, allocating new nodes as needed.
  45433. for (var j = 1; j < seq.length-1; j++) {
  45434. var oldVal = node[uCode];
  45435. if (typeof oldVal === 'object')
  45436. node = oldVal;
  45437. else {
  45438. node = node[uCode] = {}
  45439. if (oldVal !== undefined)
  45440. node[DEF_CHAR] = oldVal
  45441. }
  45442. }
  45443. // Set the leaf to given dbcsCode.
  45444. uCode = seq[seq.length-1];
  45445. node[uCode] = dbcsCode;
  45446. }
  45447. DBCSCodec.prototype._fillEncodeTable = function(nodeIdx, prefix, skipEncodeChars) {
  45448. var node = this.decodeTables[nodeIdx];
  45449. for (var i = 0; i < 0x100; i++) {
  45450. var uCode = node[i];
  45451. var mbCode = prefix + i;
  45452. if (skipEncodeChars[mbCode])
  45453. continue;
  45454. if (uCode >= 0)
  45455. this._setEncodeChar(uCode, mbCode);
  45456. else if (uCode <= NODE_START)
  45457. this._fillEncodeTable(NODE_START - uCode, mbCode << 8, skipEncodeChars);
  45458. else if (uCode <= SEQ_START)
  45459. this._setEncodeSequence(this.decodeTableSeq[SEQ_START - uCode], mbCode);
  45460. }
  45461. }
  45462. // == Encoder ==================================================================
  45463. function DBCSEncoder(options, codec) {
  45464. // Encoder state
  45465. this.leadSurrogate = -1;
  45466. this.seqObj = undefined;
  45467. // Static data
  45468. this.encodeTable = codec.encodeTable;
  45469. this.encodeTableSeq = codec.encodeTableSeq;
  45470. this.defaultCharSingleByte = codec.defCharSB;
  45471. this.gb18030 = codec.gb18030;
  45472. }
  45473. DBCSEncoder.prototype.write = function(str) {
  45474. var newBuf = Buffer.alloc(str.length * (this.gb18030 ? 4 : 3)),
  45475. leadSurrogate = this.leadSurrogate,
  45476. seqObj = this.seqObj, nextChar = -1,
  45477. i = 0, j = 0;
  45478. while (true) {
  45479. // 0. Get next character.
  45480. if (nextChar === -1) {
  45481. if (i == str.length) break;
  45482. var uCode = str.charCodeAt(i++);
  45483. }
  45484. else {
  45485. var uCode = nextChar;
  45486. nextChar = -1;
  45487. }
  45488. // 1. Handle surrogates.
  45489. if (0xD800 <= uCode && uCode < 0xE000) { // Char is one of surrogates.
  45490. if (uCode < 0xDC00) { // We've got lead surrogate.
  45491. if (leadSurrogate === -1) {
  45492. leadSurrogate = uCode;
  45493. continue;
  45494. } else {
  45495. leadSurrogate = uCode;
  45496. // Double lead surrogate found.
  45497. uCode = UNASSIGNED;
  45498. }
  45499. } else { // We've got trail surrogate.
  45500. if (leadSurrogate !== -1) {
  45501. uCode = 0x10000 + (leadSurrogate - 0xD800) * 0x400 + (uCode - 0xDC00);
  45502. leadSurrogate = -1;
  45503. } else {
  45504. // Incomplete surrogate pair - only trail surrogate found.
  45505. uCode = UNASSIGNED;
  45506. }
  45507. }
  45508. }
  45509. else if (leadSurrogate !== -1) {
  45510. // Incomplete surrogate pair - only lead surrogate found.
  45511. nextChar = uCode; uCode = UNASSIGNED; // Write an error, then current char.
  45512. leadSurrogate = -1;
  45513. }
  45514. // 2. Convert uCode character.
  45515. var dbcsCode = UNASSIGNED;
  45516. if (seqObj !== undefined && uCode != UNASSIGNED) { // We are in the middle of the sequence
  45517. var resCode = seqObj[uCode];
  45518. if (typeof resCode === 'object') { // Sequence continues.
  45519. seqObj = resCode;
  45520. continue;
  45521. } else if (typeof resCode == 'number') { // Sequence finished. Write it.
  45522. dbcsCode = resCode;
  45523. } else if (resCode == undefined) { // Current character is not part of the sequence.
  45524. // Try default character for this sequence
  45525. resCode = seqObj[DEF_CHAR];
  45526. if (resCode !== undefined) {
  45527. dbcsCode = resCode; // Found. Write it.
  45528. nextChar = uCode; // Current character will be written too in the next iteration.
  45529. } else {
  45530. // TODO: What if we have no default? (resCode == undefined)
  45531. // Then, we should write first char of the sequence as-is and try the rest recursively.
  45532. // Didn't do it for now because no encoding has this situation yet.
  45533. // Currently, just skip the sequence and write current char.
  45534. }
  45535. }
  45536. seqObj = undefined;
  45537. }
  45538. else if (uCode >= 0) { // Regular character
  45539. var subtable = this.encodeTable[uCode >> 8];
  45540. if (subtable !== undefined)
  45541. dbcsCode = subtable[uCode & 0xFF];
  45542. if (dbcsCode <= SEQ_START) { // Sequence start
  45543. seqObj = this.encodeTableSeq[SEQ_START-dbcsCode];
  45544. continue;
  45545. }
  45546. if (dbcsCode == UNASSIGNED && this.gb18030) {
  45547. // Use GB18030 algorithm to find character(s) to write.
  45548. var idx = findIdx(this.gb18030.uChars, uCode);
  45549. if (idx != -1) {
  45550. var dbcsCode = this.gb18030.gbChars[idx] + (uCode - this.gb18030.uChars[idx]);
  45551. newBuf[j++] = 0x81 + Math.floor(dbcsCode / 12600); dbcsCode = dbcsCode % 12600;
  45552. newBuf[j++] = 0x30 + Math.floor(dbcsCode / 1260); dbcsCode = dbcsCode % 1260;
  45553. newBuf[j++] = 0x81 + Math.floor(dbcsCode / 10); dbcsCode = dbcsCode % 10;
  45554. newBuf[j++] = 0x30 + dbcsCode;
  45555. continue;
  45556. }
  45557. }
  45558. }
  45559. // 3. Write dbcsCode character.
  45560. if (dbcsCode === UNASSIGNED)
  45561. dbcsCode = this.defaultCharSingleByte;
  45562. if (dbcsCode < 0x100) {
  45563. newBuf[j++] = dbcsCode;
  45564. }
  45565. else if (dbcsCode < 0x10000) {
  45566. newBuf[j++] = dbcsCode >> 8; // high byte
  45567. newBuf[j++] = dbcsCode & 0xFF; // low byte
  45568. }
  45569. else {
  45570. newBuf[j++] = dbcsCode >> 16;
  45571. newBuf[j++] = (dbcsCode >> 8) & 0xFF;
  45572. newBuf[j++] = dbcsCode & 0xFF;
  45573. }
  45574. }
  45575. this.seqObj = seqObj;
  45576. this.leadSurrogate = leadSurrogate;
  45577. return newBuf.slice(0, j);
  45578. }
  45579. DBCSEncoder.prototype.end = function() {
  45580. if (this.leadSurrogate === -1 && this.seqObj === undefined)
  45581. return; // All clean. Most often case.
  45582. var newBuf = Buffer.alloc(10), j = 0;
  45583. if (this.seqObj) { // We're in the sequence.
  45584. var dbcsCode = this.seqObj[DEF_CHAR];
  45585. if (dbcsCode !== undefined) { // Write beginning of the sequence.
  45586. if (dbcsCode < 0x100) {
  45587. newBuf[j++] = dbcsCode;
  45588. }
  45589. else {
  45590. newBuf[j++] = dbcsCode >> 8; // high byte
  45591. newBuf[j++] = dbcsCode & 0xFF; // low byte
  45592. }
  45593. } else {
  45594. // See todo above.
  45595. }
  45596. this.seqObj = undefined;
  45597. }
  45598. if (this.leadSurrogate !== -1) {
  45599. // Incomplete surrogate pair - only lead surrogate found.
  45600. newBuf[j++] = this.defaultCharSingleByte;
  45601. this.leadSurrogate = -1;
  45602. }
  45603. return newBuf.slice(0, j);
  45604. }
  45605. // Export for testing
  45606. DBCSEncoder.prototype.findIdx = findIdx;
  45607. // == Decoder ==================================================================
  45608. function DBCSDecoder(options, codec) {
  45609. // Decoder state
  45610. this.nodeIdx = 0;
  45611. this.prevBuf = Buffer.alloc(0);
  45612. // Static data
  45613. this.decodeTables = codec.decodeTables;
  45614. this.decodeTableSeq = codec.decodeTableSeq;
  45615. this.defaultCharUnicode = codec.defaultCharUnicode;
  45616. this.gb18030 = codec.gb18030;
  45617. }
  45618. DBCSDecoder.prototype.write = function(buf) {
  45619. var newBuf = Buffer.alloc(buf.length*2),
  45620. nodeIdx = this.nodeIdx,
  45621. prevBuf = this.prevBuf, prevBufOffset = this.prevBuf.length,
  45622. seqStart = -this.prevBuf.length, // idx of the start of current parsed sequence.
  45623. uCode;
  45624. if (prevBufOffset > 0) // Make prev buf overlap a little to make it easier to slice later.
  45625. prevBuf = Buffer.concat([prevBuf, buf.slice(0, 10)]);
  45626. for (var i = 0, j = 0; i < buf.length; i++) {
  45627. var curByte = (i >= 0) ? buf[i] : prevBuf[i + prevBufOffset];
  45628. // Lookup in current trie node.
  45629. var uCode = this.decodeTables[nodeIdx][curByte];
  45630. if (uCode >= 0) {
  45631. // Normal character, just use it.
  45632. }
  45633. else if (uCode === UNASSIGNED) { // Unknown char.
  45634. // TODO: Callback with seq.
  45635. //var curSeq = (seqStart >= 0) ? buf.slice(seqStart, i+1) : prevBuf.slice(seqStart + prevBufOffset, i+1 + prevBufOffset);
  45636. i = seqStart; // Try to parse again, after skipping first byte of the sequence ('i' will be incremented by 'for' cycle).
  45637. uCode = this.defaultCharUnicode.charCodeAt(0);
  45638. }
  45639. else if (uCode === GB18030_CODE) {
  45640. var curSeq = (seqStart >= 0) ? buf.slice(seqStart, i+1) : prevBuf.slice(seqStart + prevBufOffset, i+1 + prevBufOffset);
  45641. var ptr = (curSeq[0]-0x81)*12600 + (curSeq[1]-0x30)*1260 + (curSeq[2]-0x81)*10 + (curSeq[3]-0x30);
  45642. var idx = findIdx(this.gb18030.gbChars, ptr);
  45643. uCode = this.gb18030.uChars[idx] + ptr - this.gb18030.gbChars[idx];
  45644. }
  45645. else if (uCode <= NODE_START) { // Go to next trie node.
  45646. nodeIdx = NODE_START - uCode;
  45647. continue;
  45648. }
  45649. else if (uCode <= SEQ_START) { // Output a sequence of chars.
  45650. var seq = this.decodeTableSeq[SEQ_START - uCode];
  45651. for (var k = 0; k < seq.length - 1; k++) {
  45652. uCode = seq[k];
  45653. newBuf[j++] = uCode & 0xFF;
  45654. newBuf[j++] = uCode >> 8;
  45655. }
  45656. uCode = seq[seq.length-1];
  45657. }
  45658. else
  45659. throw new Error("iconv-lite internal error: invalid decoding table value " + uCode + " at " + nodeIdx + "/" + curByte);
  45660. // Write the character to buffer, handling higher planes using surrogate pair.
  45661. if (uCode > 0xFFFF) {
  45662. uCode -= 0x10000;
  45663. var uCodeLead = 0xD800 + Math.floor(uCode / 0x400);
  45664. newBuf[j++] = uCodeLead & 0xFF;
  45665. newBuf[j++] = uCodeLead >> 8;
  45666. uCode = 0xDC00 + uCode % 0x400;
  45667. }
  45668. newBuf[j++] = uCode & 0xFF;
  45669. newBuf[j++] = uCode >> 8;
  45670. // Reset trie node.
  45671. nodeIdx = 0; seqStart = i+1;
  45672. }
  45673. this.nodeIdx = nodeIdx;
  45674. this.prevBuf = (seqStart >= 0) ? buf.slice(seqStart) : prevBuf.slice(seqStart + prevBufOffset);
  45675. return newBuf.slice(0, j).toString('ucs2');
  45676. }
  45677. DBCSDecoder.prototype.end = function() {
  45678. var ret = '';
  45679. // Try to parse all remaining chars.
  45680. while (this.prevBuf.length > 0) {
  45681. // Skip 1 character in the buffer.
  45682. ret += this.defaultCharUnicode;
  45683. var buf = this.prevBuf.slice(1);
  45684. // Parse remaining as usual.
  45685. this.prevBuf = Buffer.alloc(0);
  45686. this.nodeIdx = 0;
  45687. if (buf.length > 0)
  45688. ret += this.write(buf);
  45689. }
  45690. this.nodeIdx = 0;
  45691. return ret;
  45692. }
  45693. // Binary search for GB18030. Returns largest i such that table[i] <= val.
  45694. function findIdx(table, val) {
  45695. if (table[0] > val)
  45696. return -1;
  45697. var l = 0, r = table.length;
  45698. while (l < r-1) { // always table[l] <= val < table[r]
  45699. var mid = l + Math.floor((r-l+1)/2);
  45700. if (table[mid] <= val)
  45701. l = mid;
  45702. else
  45703. r = mid;
  45704. }
  45705. return l;
  45706. }
  45707. /***/ }),
  45708. /* 314 */
  45709. /***/ (function(module, exports, __webpack_require__) {
  45710. "use strict";
  45711. // Description of supported double byte encodings and aliases.
  45712. // Tables are not require()-d until they are needed to speed up library load.
  45713. // require()-s are direct to support Browserify.
  45714. module.exports = {
  45715. // == Japanese/ShiftJIS ====================================================
  45716. // All japanese encodings are based on JIS X set of standards:
  45717. // JIS X 0201 - Single-byte encoding of ASCII + ¥ + Kana chars at 0xA1-0xDF.
  45718. // JIS X 0208 - Main set of 6879 characters, placed in 94x94 plane, to be encoded by 2 bytes.
  45719. // Has several variations in 1978, 1983, 1990 and 1997.
  45720. // JIS X 0212 - Supplementary plane of 6067 chars in 94x94 plane. 1990. Effectively dead.
  45721. // JIS X 0213 - Extension and modern replacement of 0208 and 0212. Total chars: 11233.
  45722. // 2 planes, first is superset of 0208, second - revised 0212.
  45723. // Introduced in 2000, revised 2004. Some characters are in Unicode Plane 2 (0x2xxxx)
  45724. // Byte encodings are:
  45725. // * Shift_JIS: Compatible with 0201, uses not defined chars in top half as lead bytes for double-byte
  45726. // encoding of 0208. Lead byte ranges: 0x81-0x9F, 0xE0-0xEF; Trail byte ranges: 0x40-0x7E, 0x80-0x9E, 0x9F-0xFC.
  45727. // Windows CP932 is a superset of Shift_JIS. Some companies added more chars, notably KDDI.
  45728. // * EUC-JP: Up to 3 bytes per character. Used mostly on *nixes.
  45729. // 0x00-0x7F - lower part of 0201
  45730. // 0x8E, 0xA1-0xDF - upper part of 0201
  45731. // (0xA1-0xFE)x2 - 0208 plane (94x94).
  45732. // 0x8F, (0xA1-0xFE)x2 - 0212 plane (94x94).
  45733. // * JIS X 208: 7-bit, direct encoding of 0208. Byte ranges: 0x21-0x7E (94 values). Uncommon.
  45734. // Used as-is in ISO2022 family.
  45735. // * ISO2022-JP: Stateful encoding, with escape sequences to switch between ASCII,
  45736. // 0201-1976 Roman, 0208-1978, 0208-1983.
  45737. // * ISO2022-JP-1: Adds esc seq for 0212-1990.
  45738. // * ISO2022-JP-2: Adds esc seq for GB2313-1980, KSX1001-1992, ISO8859-1, ISO8859-7.
  45739. // * ISO2022-JP-3: Adds esc seq for 0201-1976 Kana set, 0213-2000 Planes 1, 2.
  45740. // * ISO2022-JP-2004: Adds 0213-2004 Plane 1.
  45741. //
  45742. // After JIS X 0213 appeared, Shift_JIS-2004, EUC-JISX0213 and ISO2022-JP-2004 followed, with just changing the planes.
  45743. //
  45744. // Overall, it seems that it's a mess :( http://www8.plala.or.jp/tkubota1/unicode-symbols-map2.html
  45745. 'shiftjis': {
  45746. type: '_dbcs',
  45747. table: function() { return __webpack_require__(315) },
  45748. encodeAdd: {'\u00a5': 0x5C, '\u203E': 0x7E},
  45749. encodeSkipVals: [{from: 0xED40, to: 0xF940}],
  45750. },
  45751. 'csshiftjis': 'shiftjis',
  45752. 'mskanji': 'shiftjis',
  45753. 'sjis': 'shiftjis',
  45754. 'windows31j': 'shiftjis',
  45755. 'ms31j': 'shiftjis',
  45756. 'xsjis': 'shiftjis',
  45757. 'windows932': 'shiftjis',
  45758. 'ms932': 'shiftjis',
  45759. '932': 'shiftjis',
  45760. 'cp932': 'shiftjis',
  45761. 'eucjp': {
  45762. type: '_dbcs',
  45763. table: function() { return __webpack_require__(316) },
  45764. encodeAdd: {'\u00a5': 0x5C, '\u203E': 0x7E},
  45765. },
  45766. // TODO: KDDI extension to Shift_JIS
  45767. // TODO: IBM CCSID 942 = CP932, but F0-F9 custom chars and other char changes.
  45768. // TODO: IBM CCSID 943 = Shift_JIS = CP932 with original Shift_JIS lower 128 chars.
  45769. // == Chinese/GBK ==========================================================
  45770. // http://en.wikipedia.org/wiki/GBK
  45771. // We mostly implement W3C recommendation: https://www.w3.org/TR/encoding/#gbk-encoder
  45772. // Oldest GB2312 (1981, ~7600 chars) is a subset of CP936
  45773. 'gb2312': 'cp936',
  45774. 'gb231280': 'cp936',
  45775. 'gb23121980': 'cp936',
  45776. 'csgb2312': 'cp936',
  45777. 'csiso58gb231280': 'cp936',
  45778. 'euccn': 'cp936',
  45779. // Microsoft's CP936 is a subset and approximation of GBK.
  45780. 'windows936': 'cp936',
  45781. 'ms936': 'cp936',
  45782. '936': 'cp936',
  45783. 'cp936': {
  45784. type: '_dbcs',
  45785. table: function() { return __webpack_require__(109) },
  45786. },
  45787. // GBK (~22000 chars) is an extension of CP936 that added user-mapped chars and some other.
  45788. 'gbk': {
  45789. type: '_dbcs',
  45790. table: function() { return __webpack_require__(109).concat(__webpack_require__(176)) },
  45791. },
  45792. 'xgbk': 'gbk',
  45793. 'isoir58': 'gbk',
  45794. // GB18030 is an algorithmic extension of GBK.
  45795. // Main source: https://www.w3.org/TR/encoding/#gbk-encoder
  45796. // http://icu-project.org/docs/papers/gb18030.html
  45797. // http://source.icu-project.org/repos/icu/data/trunk/charset/data/xml/gb-18030-2000.xml
  45798. // http://www.khngai.com/chinese/charmap/tblgbk.php?page=0
  45799. 'gb18030': {
  45800. type: '_dbcs',
  45801. table: function() { return __webpack_require__(109).concat(__webpack_require__(176)) },
  45802. gb18030: function() { return __webpack_require__(317) },
  45803. encodeSkipVals: [0x80],
  45804. encodeAdd: {'€': 0xA2E3},
  45805. },
  45806. 'chinese': 'gb18030',
  45807. // == Korean ===============================================================
  45808. // EUC-KR, KS_C_5601 and KS X 1001 are exactly the same.
  45809. 'windows949': 'cp949',
  45810. 'ms949': 'cp949',
  45811. '949': 'cp949',
  45812. 'cp949': {
  45813. type: '_dbcs',
  45814. table: function() { return __webpack_require__(318) },
  45815. },
  45816. 'cseuckr': 'cp949',
  45817. 'csksc56011987': 'cp949',
  45818. 'euckr': 'cp949',
  45819. 'isoir149': 'cp949',
  45820. 'korean': 'cp949',
  45821. 'ksc56011987': 'cp949',
  45822. 'ksc56011989': 'cp949',
  45823. 'ksc5601': 'cp949',
  45824. // == Big5/Taiwan/Hong Kong ================================================
  45825. // There are lots of tables for Big5 and cp950. Please see the following links for history:
  45826. // http://moztw.org/docs/big5/ http://www.haible.de/bruno/charsets/conversion-tables/Big5.html
  45827. // Variations, in roughly number of defined chars:
  45828. // * Windows CP 950: Microsoft variant of Big5. Canonical: http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP950.TXT
  45829. // * Windows CP 951: Microsoft variant of Big5-HKSCS-2001. Seems to be never public. http://me.abelcheung.org/articles/research/what-is-cp951/
  45830. // * Big5-2003 (Taiwan standard) almost superset of cp950.
  45831. // * Unicode-at-on (UAO) / Mozilla 1.8. Falling out of use on the Web. Not supported by other browsers.
  45832. // * Big5-HKSCS (-2001, -2004, -2008). Hong Kong standard.
  45833. // many unicode code points moved from PUA to Supplementary plane (U+2XXXX) over the years.
  45834. // Plus, it has 4 combining sequences.
  45835. // Seems that Mozilla refused to support it for 10 yrs. https://bugzilla.mozilla.org/show_bug.cgi?id=162431 https://bugzilla.mozilla.org/show_bug.cgi?id=310299
  45836. // because big5-hkscs is the only encoding to include astral characters in non-algorithmic way.
  45837. // Implementations are not consistent within browsers; sometimes labeled as just big5.
  45838. // MS Internet Explorer switches from big5 to big5-hkscs when a patch applied.
  45839. // Great discussion & recap of what's going on https://bugzilla.mozilla.org/show_bug.cgi?id=912470#c31
  45840. // In the encoder, it might make sense to support encoding old PUA mappings to Big5 bytes seq-s.
  45841. // Official spec: http://www.ogcio.gov.hk/en/business/tech_promotion/ccli/terms/doc/2003cmp_2008.txt
  45842. // http://www.ogcio.gov.hk/tc/business/tech_promotion/ccli/terms/doc/hkscs-2008-big5-iso.txt
  45843. //
  45844. // Current understanding of how to deal with Big5(-HKSCS) is in the Encoding Standard, http://encoding.spec.whatwg.org/#big5-encoder
  45845. // Unicode mapping (http://www.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/OTHER/BIG5.TXT) is said to be wrong.
  45846. 'windows950': 'cp950',
  45847. 'ms950': 'cp950',
  45848. '950': 'cp950',
  45849. 'cp950': {
  45850. type: '_dbcs',
  45851. table: function() { return __webpack_require__(177) },
  45852. },
  45853. // Big5 has many variations and is an extension of cp950. We use Encoding Standard's as a consensus.
  45854. 'big5': 'big5hkscs',
  45855. 'big5hkscs': {
  45856. type: '_dbcs',
  45857. table: function() { return __webpack_require__(177).concat(__webpack_require__(319)) },
  45858. encodeSkipVals: [0xa2cc],
  45859. },
  45860. 'cnbig5': 'big5hkscs',
  45861. 'csbig5': 'big5hkscs',
  45862. 'xxbig5': 'big5hkscs',
  45863. };
  45864. /***/ }),
  45865. /* 315 */
  45866. /***/ (function(module) {
  45867. module.exports = JSON.parse("[[\"0\",\"\\u0000\",128],[\"a1\",\"。\",62],[\"8140\",\" 、。,.・:;?!゛゜´`¨^ ̄_ヽヾゝゞ〃仝々〆〇ー―‐/\~∥|…‥‘’“”()〔〕[]{}〈\",9,\"+-±×\"],[\"8180\",\"÷=≠<>≦≧∞∴♂♀°′″℃¥$¢£%#&*@§☆★○●◎◇◆□■△▲▽▼※〒→←↑↓〓\"],[\"81b8\",\"∈∋⊆⊇⊂⊃∪∩\"],[\"81c8\",\"∧∨¬⇒⇔∀∃\"],[\"81da\",\"∠⊥⌒∂∇≡≒≪≫√∽∝∵∫∬\"],[\"81f0\",\"ʼn♯♭♪†‡¶\"],[\"81fc\",\"◯\"],[\"824f\",\"0\",9],[\"8260\",\"A\",25],[\"8281\",\"a\",25],[\"829f\",\"ぁ\",82],[\"8340\",\"ァ\",62],[\"8380\",\"ム\",22],[\"839f\",\"Α\",16,\"Σ\",6],[\"83bf\",\"α\",16,\"σ\",6],[\"8440\",\"А\",5,\"ЁЖ\",25],[\"8470\",\"а\",5,\"ёж\",7],[\"8480\",\"о\",17],[\"849f\",\"─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂\"],[\"8740\",\"①\",19,\"Ⅰ\",9],[\"875f\",\"㍉㌔㌢㍍㌘㌧㌃㌶㍑㍗㌍㌦㌣㌫㍊㌻㎜㎝㎞㎎㎏㏄㎡\"],[\"877e\",\"㍻\"],[\"8780\",\"〝〟№㏍℡㊤\",4,\"㈱㈲㈹㍾㍽㍼≒≡∫∮∑√⊥∠∟⊿∵∩∪\"],[\"889f\",\"亜唖娃阿哀愛挨姶逢葵茜穐悪握渥旭葦芦鯵梓圧斡扱宛姐虻飴絢綾鮎或粟袷安庵按暗案闇鞍杏以伊位依偉囲夷委威尉惟意慰易椅為畏異移維緯胃萎衣謂違遺医井亥域育郁磯一壱溢逸稲茨芋鰯允印咽員因姻引飲淫胤蔭\"],[\"8940\",\"院陰隠韻吋右宇烏羽迂雨卯鵜窺丑碓臼渦嘘唄欝蔚鰻姥厩浦瓜閏噂云運雲荏餌叡営嬰影映曳栄永泳洩瑛盈穎頴英衛詠鋭液疫益駅悦謁越閲榎厭円\"],[\"8980\",\"園堰奄宴延怨掩援沿演炎焔煙燕猿縁艶苑薗遠鉛鴛塩於汚甥凹央奥往応押旺横欧殴王翁襖鴬鴎黄岡沖荻億屋憶臆桶牡乙俺卸恩温穏音下化仮何伽価佳加可嘉夏嫁家寡科暇果架歌河火珂禍禾稼箇花苛茄荷華菓蝦課嘩貨迦過霞蚊俄峨我牙画臥芽蛾賀雅餓駕介会解回塊壊廻快怪悔恢懐戒拐改\"],[\"8a40\",\"魁晦械海灰界皆絵芥蟹開階貝凱劾外咳害崖慨概涯碍蓋街該鎧骸浬馨蛙垣柿蛎鈎劃嚇各廓拡撹格核殻獲確穫覚角赫較郭閣隔革学岳楽額顎掛笠樫\"],[\"8a80\",\"橿梶鰍潟割喝恰括活渇滑葛褐轄且鰹叶椛樺鞄株兜竃蒲釜鎌噛鴨栢茅萱粥刈苅瓦乾侃冠寒刊勘勧巻喚堪姦完官寛干幹患感慣憾換敢柑桓棺款歓汗漢澗潅環甘監看竿管簡緩缶翰肝艦莞観諌貫還鑑間閑関陥韓館舘丸含岸巌玩癌眼岩翫贋雁頑顔願企伎危喜器基奇嬉寄岐希幾忌揮机旗既期棋棄\"],[\"8b40\",\"機帰毅気汽畿祈季稀紀徽規記貴起軌輝飢騎鬼亀偽儀妓宜戯技擬欺犠疑祇義蟻誼議掬菊鞠吉吃喫桔橘詰砧杵黍却客脚虐逆丘久仇休及吸宮弓急救\"],[\"8b80\",\"朽求汲泣灸球究窮笈級糾給旧牛去居巨拒拠挙渠虚許距鋸漁禦魚亨享京供侠僑兇競共凶協匡卿叫喬境峡強彊怯恐恭挟教橋況狂狭矯胸脅興蕎郷鏡響饗驚仰凝尭暁業局曲極玉桐粁僅勤均巾錦斤欣欽琴禁禽筋緊芹菌衿襟謹近金吟銀九倶句区狗玖矩苦躯駆駈駒具愚虞喰空偶寓遇隅串櫛釧屑屈\"],[\"8c40\",\"掘窟沓靴轡窪熊隈粂栗繰桑鍬勲君薫訓群軍郡卦袈祁係傾刑兄啓圭珪型契形径恵慶慧憩掲携敬景桂渓畦稽系経継繋罫茎荊蛍計詣警軽頚鶏芸迎鯨\"],[\"8c80\",\"劇戟撃激隙桁傑欠決潔穴結血訣月件倹倦健兼券剣喧圏堅嫌建憲懸拳捲検権牽犬献研硯絹県肩見謙賢軒遣鍵険顕験鹸元原厳幻弦減源玄現絃舷言諺限乎個古呼固姑孤己庫弧戸故枯湖狐糊袴股胡菰虎誇跨鈷雇顧鼓五互伍午呉吾娯後御悟梧檎瑚碁語誤護醐乞鯉交佼侯候倖光公功効勾厚口向\"],[\"8d40\",\"后喉坑垢好孔孝宏工巧巷幸広庚康弘恒慌抗拘控攻昂晃更杭校梗構江洪浩港溝甲皇硬稿糠紅紘絞綱耕考肯肱腔膏航荒行衡講貢購郊酵鉱砿鋼閤降\"],[\"8d80\",\"項香高鴻剛劫号合壕拷濠豪轟麹克刻告国穀酷鵠黒獄漉腰甑忽惚骨狛込此頃今困坤墾婚恨懇昏昆根梱混痕紺艮魂些佐叉唆嵯左差査沙瑳砂詐鎖裟坐座挫債催再最哉塞妻宰彩才採栽歳済災采犀砕砦祭斎細菜裁載際剤在材罪財冴坂阪堺榊肴咲崎埼碕鷺作削咋搾昨朔柵窄策索錯桜鮭笹匙冊刷\"],[\"8e40\",\"察拶撮擦札殺薩雑皐鯖捌錆鮫皿晒三傘参山惨撒散桟燦珊産算纂蚕讃賛酸餐斬暫残仕仔伺使刺司史嗣四士始姉姿子屍市師志思指支孜斯施旨枝止\"],[\"8e80\",\"死氏獅祉私糸紙紫肢脂至視詞詩試誌諮資賜雌飼歯事似侍児字寺慈持時次滋治爾璽痔磁示而耳自蒔辞汐鹿式識鴫竺軸宍雫七叱執失嫉室悉湿漆疾質実蔀篠偲柴芝屡蕊縞舎写射捨赦斜煮社紗者謝車遮蛇邪借勺尺杓灼爵酌釈錫若寂弱惹主取守手朱殊狩珠種腫趣酒首儒受呪寿授樹綬需囚収周\"],[\"8f40\",\"宗就州修愁拾洲秀秋終繍習臭舟蒐衆襲讐蹴輯週酋酬集醜什住充十従戎柔汁渋獣縦重銃叔夙宿淑祝縮粛塾熟出術述俊峻春瞬竣舜駿准循旬楯殉淳\"],[\"8f80\",\"準潤盾純巡遵醇順処初所暑曙渚庶緒署書薯藷諸助叙女序徐恕鋤除傷償勝匠升召哨商唱嘗奨妾娼宵将小少尚庄床廠彰承抄招掌捷昇昌昭晶松梢樟樵沼消渉湘焼焦照症省硝礁祥称章笑粧紹肖菖蒋蕉衝裳訟証詔詳象賞醤鉦鍾鐘障鞘上丈丞乗冗剰城場壌嬢常情擾条杖浄状畳穣蒸譲醸錠嘱埴飾\"],[\"9040\",\"拭植殖燭織職色触食蝕辱尻伸信侵唇娠寝審心慎振新晋森榛浸深申疹真神秦紳臣芯薪親診身辛進針震人仁刃塵壬尋甚尽腎訊迅陣靭笥諏須酢図厨\"],[\"9080\",\"逗吹垂帥推水炊睡粋翠衰遂酔錐錘随瑞髄崇嵩数枢趨雛据杉椙菅頗雀裾澄摺寸世瀬畝是凄制勢姓征性成政整星晴棲栖正清牲生盛精聖声製西誠誓請逝醒青静斉税脆隻席惜戚斥昔析石積籍績脊責赤跡蹟碩切拙接摂折設窃節説雪絶舌蝉仙先千占宣専尖川戦扇撰栓栴泉浅洗染潜煎煽旋穿箭線\"],[\"9140\",\"繊羨腺舛船薦詮賎践選遷銭銑閃鮮前善漸然全禅繕膳糎噌塑岨措曾曽楚狙疏疎礎祖租粗素組蘇訴阻遡鼠僧創双叢倉喪壮奏爽宋層匝惣想捜掃挿掻\"],[\"9180\",\"操早曹巣槍槽漕燥争痩相窓糟総綜聡草荘葬蒼藻装走送遭鎗霜騒像増憎臓蔵贈造促側則即息捉束測足速俗属賊族続卒袖其揃存孫尊損村遜他多太汰詑唾堕妥惰打柁舵楕陀駄騨体堆対耐岱帯待怠態戴替泰滞胎腿苔袋貸退逮隊黛鯛代台大第醍題鷹滝瀧卓啄宅托択拓沢濯琢託鐸濁諾茸凧蛸只\"],[\"9240\",\"叩但達辰奪脱巽竪辿棚谷狸鱈樽誰丹単嘆坦担探旦歎淡湛炭短端箪綻耽胆蛋誕鍛団壇弾断暖檀段男談値知地弛恥智池痴稚置致蜘遅馳築畜竹筑蓄\"],[\"9280\",\"逐秩窒茶嫡着中仲宙忠抽昼柱注虫衷註酎鋳駐樗瀦猪苧著貯丁兆凋喋寵帖帳庁弔張彫徴懲挑暢朝潮牒町眺聴脹腸蝶調諜超跳銚長頂鳥勅捗直朕沈珍賃鎮陳津墜椎槌追鎚痛通塚栂掴槻佃漬柘辻蔦綴鍔椿潰坪壷嬬紬爪吊釣鶴亭低停偵剃貞呈堤定帝底庭廷弟悌抵挺提梯汀碇禎程締艇訂諦蹄逓\"],[\"9340\",\"邸鄭釘鼎泥摘擢敵滴的笛適鏑溺哲徹撤轍迭鉄典填天展店添纏甜貼転顛点伝殿澱田電兎吐堵塗妬屠徒斗杜渡登菟賭途都鍍砥砺努度土奴怒倒党冬\"],[\"9380\",\"凍刀唐塔塘套宕島嶋悼投搭東桃梼棟盗淘湯涛灯燈当痘祷等答筒糖統到董蕩藤討謄豆踏逃透鐙陶頭騰闘働動同堂導憧撞洞瞳童胴萄道銅峠鴇匿得徳涜特督禿篤毒独読栃橡凸突椴届鳶苫寅酉瀞噸屯惇敦沌豚遁頓呑曇鈍奈那内乍凪薙謎灘捺鍋楢馴縄畷南楠軟難汝二尼弐迩匂賑肉虹廿日乳入\"],[\"9440\",\"如尿韮任妊忍認濡禰祢寧葱猫熱年念捻撚燃粘乃廼之埜嚢悩濃納能脳膿農覗蚤巴把播覇杷波派琶破婆罵芭馬俳廃拝排敗杯盃牌背肺輩配倍培媒梅\"],[\"9480\",\"楳煤狽買売賠陪這蝿秤矧萩伯剥博拍柏泊白箔粕舶薄迫曝漠爆縛莫駁麦函箱硲箸肇筈櫨幡肌畑畠八鉢溌発醗髪伐罰抜筏閥鳩噺塙蛤隼伴判半反叛帆搬斑板氾汎版犯班畔繁般藩販範釆煩頒飯挽晩番盤磐蕃蛮匪卑否妃庇彼悲扉批披斐比泌疲皮碑秘緋罷肥被誹費避非飛樋簸備尾微枇毘琵眉美\"],[\"9540\",\"鼻柊稗匹疋髭彦膝菱肘弼必畢筆逼桧姫媛紐百謬俵彪標氷漂瓢票表評豹廟描病秒苗錨鋲蒜蛭鰭品彬斌浜瀕貧賓頻敏瓶不付埠夫婦富冨布府怖扶敷\"],[\"9580\",\"斧普浮父符腐膚芙譜負賦赴阜附侮撫武舞葡蕪部封楓風葺蕗伏副復幅服福腹複覆淵弗払沸仏物鮒分吻噴墳憤扮焚奮粉糞紛雰文聞丙併兵塀幣平弊柄並蔽閉陛米頁僻壁癖碧別瞥蔑箆偏変片篇編辺返遍便勉娩弁鞭保舗鋪圃捕歩甫補輔穂募墓慕戊暮母簿菩倣俸包呆報奉宝峰峯崩庖抱捧放方朋\"],[\"9640\",\"法泡烹砲縫胞芳萌蓬蜂褒訪豊邦鋒飽鳳鵬乏亡傍剖坊妨帽忘忙房暴望某棒冒紡肪膨謀貌貿鉾防吠頬北僕卜墨撲朴牧睦穆釦勃没殆堀幌奔本翻凡盆\"],[\"9680\",\"摩磨魔麻埋妹昧枚毎哩槙幕膜枕鮪柾鱒桝亦俣又抹末沫迄侭繭麿万慢満漫蔓味未魅巳箕岬密蜜湊蓑稔脈妙粍民眠務夢無牟矛霧鵡椋婿娘冥名命明盟迷銘鳴姪牝滅免棉綿緬面麺摸模茂妄孟毛猛盲網耗蒙儲木黙目杢勿餅尤戻籾貰問悶紋門匁也冶夜爺耶野弥矢厄役約薬訳躍靖柳薮鑓愉愈油癒\"],[\"9740\",\"諭輸唯佑優勇友宥幽悠憂揖有柚湧涌猶猷由祐裕誘遊邑郵雄融夕予余与誉輿預傭幼妖容庸揚揺擁曜楊様洋溶熔用窯羊耀葉蓉要謡踊遥陽養慾抑欲\"],[\"9780\",\"沃浴翌翼淀羅螺裸来莱頼雷洛絡落酪乱卵嵐欄濫藍蘭覧利吏履李梨理璃痢裏裡里離陸律率立葎掠略劉流溜琉留硫粒隆竜龍侶慮旅虜了亮僚両凌寮料梁涼猟療瞭稜糧良諒遼量陵領力緑倫厘林淋燐琳臨輪隣鱗麟瑠塁涙累類令伶例冷励嶺怜玲礼苓鈴隷零霊麗齢暦歴列劣烈裂廉恋憐漣煉簾練聯\"],[\"9840\",\"蓮連錬呂魯櫓炉賂路露労婁廊弄朗楼榔浪漏牢狼篭老聾蝋郎六麓禄肋録論倭和話歪賄脇惑枠鷲亙亘鰐詫藁蕨椀湾碗腕\"],[\"989f\",\"弌丐丕个丱丶丼丿乂乖乘亂亅豫亊舒弍于亞亟亠亢亰亳亶从仍仄仆仂仗仞仭仟价伉佚估佛佝佗佇佶侈侏侘佻佩佰侑佯來侖儘俔俟俎俘俛俑俚俐俤俥倚倨倔倪倥倅伜俶倡倩倬俾俯們倆偃假會偕偐偈做偖偬偸傀傚傅傴傲\"],[\"9940\",\"僉僊傳僂僖僞僥僭僣僮價僵儉儁儂儖儕儔儚儡儺儷儼儻儿兀兒兌兔兢竸兩兪兮冀冂囘册冉冏冑冓冕冖冤冦冢冩冪冫决冱冲冰况冽凅凉凛几處凩凭\"],[\"9980\",\"凰凵凾刄刋刔刎刧刪刮刳刹剏剄剋剌剞剔剪剴剩剳剿剽劍劔劒剱劈劑辨辧劬劭劼劵勁勍勗勞勣勦飭勠勳勵勸勹匆匈甸匍匐匏匕匚匣匯匱匳匸區卆卅丗卉卍凖卞卩卮夘卻卷厂厖厠厦厥厮厰厶參簒雙叟曼燮叮叨叭叺吁吽呀听吭吼吮吶吩吝呎咏呵咎呟呱呷呰咒呻咀呶咄咐咆哇咢咸咥咬哄哈咨\"],[\"9a40\",\"咫哂咤咾咼哘哥哦唏唔哽哮哭哺哢唹啀啣啌售啜啅啖啗唸唳啝喙喀咯喊喟啻啾喘喞單啼喃喩喇喨嗚嗅嗟嗄嗜嗤嗔嘔嗷嘖嗾嗽嘛嗹噎噐營嘴嘶嘲嘸\"],[\"9a80\",\"噫噤嘯噬噪嚆嚀嚊嚠嚔嚏嚥嚮嚶嚴囂嚼囁囃囀囈囎囑囓囗囮囹圀囿圄圉圈國圍圓團圖嗇圜圦圷圸坎圻址坏坩埀垈坡坿垉垓垠垳垤垪垰埃埆埔埒埓堊埖埣堋堙堝塲堡塢塋塰毀塒堽塹墅墹墟墫墺壞墻墸墮壅壓壑壗壙壘壥壜壤壟壯壺壹壻壼壽夂夊夐夛梦夥夬夭夲夸夾竒奕奐奎奚奘奢奠奧奬奩\"],[\"9b40\",\"奸妁妝佞侫妣妲姆姨姜妍姙姚娥娟娑娜娉娚婀婬婉娵娶婢婪媚媼媾嫋嫂媽嫣嫗嫦嫩嫖嫺嫻嬌嬋嬖嬲嫐嬪嬶嬾孃孅孀孑孕孚孛孥孩孰孳孵學斈孺宀\"],[\"9b80\",\"它宦宸寃寇寉寔寐寤實寢寞寥寫寰寶寳尅將專對尓尠尢尨尸尹屁屆屎屓屐屏孱屬屮乢屶屹岌岑岔妛岫岻岶岼岷峅岾峇峙峩峽峺峭嶌峪崋崕崗嵜崟崛崑崔崢崚崙崘嵌嵒嵎嵋嵬嵳嵶嶇嶄嶂嶢嶝嶬嶮嶽嶐嶷嶼巉巍巓巒巖巛巫已巵帋帚帙帑帛帶帷幄幃幀幎幗幔幟幢幤幇幵并幺麼广庠廁廂廈廐廏\"],[\"9c40\",\"廖廣廝廚廛廢廡廨廩廬廱廳廰廴廸廾弃弉彝彜弋弑弖弩弭弸彁彈彌彎弯彑彖彗彙彡彭彳彷徃徂彿徊很徑徇從徙徘徠徨徭徼忖忻忤忸忱忝悳忿怡恠\"],[\"9c80\",\"怙怐怩怎怱怛怕怫怦怏怺恚恁恪恷恟恊恆恍恣恃恤恂恬恫恙悁悍惧悃悚悄悛悖悗悒悧悋惡悸惠惓悴忰悽惆悵惘慍愕愆惶惷愀惴惺愃愡惻惱愍愎慇愾愨愧慊愿愼愬愴愽慂慄慳慷慘慙慚慫慴慯慥慱慟慝慓慵憙憖憇憬憔憚憊憑憫憮懌懊應懷懈懃懆憺懋罹懍懦懣懶懺懴懿懽懼懾戀戈戉戍戌戔戛\"],[\"9d40\",\"戞戡截戮戰戲戳扁扎扞扣扛扠扨扼抂抉找抒抓抖拔抃抔拗拑抻拏拿拆擔拈拜拌拊拂拇抛拉挌拮拱挧挂挈拯拵捐挾捍搜捏掖掎掀掫捶掣掏掉掟掵捫\"],[\"9d80\",\"捩掾揩揀揆揣揉插揶揄搖搴搆搓搦搶攝搗搨搏摧摯摶摎攪撕撓撥撩撈撼據擒擅擇撻擘擂擱擧舉擠擡抬擣擯攬擶擴擲擺攀擽攘攜攅攤攣攫攴攵攷收攸畋效敖敕敍敘敞敝敲數斂斃變斛斟斫斷旃旆旁旄旌旒旛旙无旡旱杲昊昃旻杳昵昶昴昜晏晄晉晁晞晝晤晧晨晟晢晰暃暈暎暉暄暘暝曁暹曉暾暼\"],[\"9e40\",\"曄暸曖曚曠昿曦曩曰曵曷朏朖朞朦朧霸朮朿朶杁朸朷杆杞杠杙杣杤枉杰枩杼杪枌枋枦枡枅枷柯枴柬枳柩枸柤柞柝柢柮枹柎柆柧檜栞框栩桀桍栲桎\"],[\"9e80\",\"梳栫桙档桷桿梟梏梭梔條梛梃檮梹桴梵梠梺椏梍桾椁棊椈棘椢椦棡椌棍棔棧棕椶椒椄棗棣椥棹棠棯椨椪椚椣椡棆楹楷楜楸楫楔楾楮椹楴椽楙椰楡楞楝榁楪榲榮槐榿槁槓榾槎寨槊槝榻槃榧樮榑榠榜榕榴槞槨樂樛槿權槹槲槧樅榱樞槭樔槫樊樒櫁樣樓橄樌橲樶橸橇橢橙橦橈樸樢檐檍檠檄檢檣\"],[\"9f40\",\"檗蘗檻櫃櫂檸檳檬櫞櫑櫟檪櫚櫪櫻欅蘖櫺欒欖鬱欟欸欷盜欹飮歇歃歉歐歙歔歛歟歡歸歹歿殀殄殃殍殘殕殞殤殪殫殯殲殱殳殷殼毆毋毓毟毬毫毳毯\"],[\"9f80\",\"麾氈氓气氛氤氣汞汕汢汪沂沍沚沁沛汾汨汳沒沐泄泱泓沽泗泅泝沮沱沾沺泛泯泙泪洟衍洶洫洽洸洙洵洳洒洌浣涓浤浚浹浙涎涕濤涅淹渕渊涵淇淦涸淆淬淞淌淨淒淅淺淙淤淕淪淮渭湮渮渙湲湟渾渣湫渫湶湍渟湃渺湎渤滿渝游溂溪溘滉溷滓溽溯滄溲滔滕溏溥滂溟潁漑灌滬滸滾漿滲漱滯漲滌\"],[\"e040\",\"漾漓滷澆潺潸澁澀潯潛濳潭澂潼潘澎澑濂潦澳澣澡澤澹濆澪濟濕濬濔濘濱濮濛瀉瀋濺瀑瀁瀏濾瀛瀚潴瀝瀘瀟瀰瀾瀲灑灣炙炒炯烱炬炸炳炮烟烋烝\"],[\"e080\",\"烙焉烽焜焙煥煕熈煦煢煌煖煬熏燻熄熕熨熬燗熹熾燒燉燔燎燠燬燧燵燼燹燿爍爐爛爨爭爬爰爲爻爼爿牀牆牋牘牴牾犂犁犇犒犖犢犧犹犲狃狆狄狎狒狢狠狡狹狷倏猗猊猜猖猝猴猯猩猥猾獎獏默獗獪獨獰獸獵獻獺珈玳珎玻珀珥珮珞璢琅瑯琥珸琲琺瑕琿瑟瑙瑁瑜瑩瑰瑣瑪瑶瑾璋璞璧瓊瓏瓔珱\"],[\"e140\",\"瓠瓣瓧瓩瓮瓲瓰瓱瓸瓷甄甃甅甌甎甍甕甓甞甦甬甼畄畍畊畉畛畆畚畩畤畧畫畭畸當疆疇畴疊疉疂疔疚疝疥疣痂疳痃疵疽疸疼疱痍痊痒痙痣痞痾痿\"],[\"e180\",\"痼瘁痰痺痲痳瘋瘍瘉瘟瘧瘠瘡瘢瘤瘴瘰瘻癇癈癆癜癘癡癢癨癩癪癧癬癰癲癶癸發皀皃皈皋皎皖皓皙皚皰皴皸皹皺盂盍盖盒盞盡盥盧盪蘯盻眈眇眄眩眤眞眥眦眛眷眸睇睚睨睫睛睥睿睾睹瞎瞋瞑瞠瞞瞰瞶瞹瞿瞼瞽瞻矇矍矗矚矜矣矮矼砌砒礦砠礪硅碎硴碆硼碚碌碣碵碪碯磑磆磋磔碾碼磅磊磬\"],[\"e240\",\"磧磚磽磴礇礒礑礙礬礫祀祠祗祟祚祕祓祺祿禊禝禧齋禪禮禳禹禺秉秕秧秬秡秣稈稍稘稙稠稟禀稱稻稾稷穃穗穉穡穢穩龝穰穹穽窈窗窕窘窖窩竈窰\"],[\"e280\",\"窶竅竄窿邃竇竊竍竏竕竓站竚竝竡竢竦竭竰笂笏笊笆笳笘笙笞笵笨笶筐筺笄筍笋筌筅筵筥筴筧筰筱筬筮箝箘箟箍箜箚箋箒箏筝箙篋篁篌篏箴篆篝篩簑簔篦篥籠簀簇簓篳篷簗簍篶簣簧簪簟簷簫簽籌籃籔籏籀籐籘籟籤籖籥籬籵粃粐粤粭粢粫粡粨粳粲粱粮粹粽糀糅糂糘糒糜糢鬻糯糲糴糶糺紆\"],[\"e340\",\"紂紜紕紊絅絋紮紲紿紵絆絳絖絎絲絨絮絏絣經綉絛綏絽綛綺綮綣綵緇綽綫總綢綯緜綸綟綰緘緝緤緞緻緲緡縅縊縣縡縒縱縟縉縋縢繆繦縻縵縹繃縷\"],[\"e380\",\"縲縺繧繝繖繞繙繚繹繪繩繼繻纃緕繽辮繿纈纉續纒纐纓纔纖纎纛纜缸缺罅罌罍罎罐网罕罔罘罟罠罨罩罧罸羂羆羃羈羇羌羔羞羝羚羣羯羲羹羮羶羸譱翅翆翊翕翔翡翦翩翳翹飜耆耄耋耒耘耙耜耡耨耿耻聊聆聒聘聚聟聢聨聳聲聰聶聹聽聿肄肆肅肛肓肚肭冐肬胛胥胙胝胄胚胖脉胯胱脛脩脣脯腋\"],[\"e440\",\"隋腆脾腓腑胼腱腮腥腦腴膃膈膊膀膂膠膕膤膣腟膓膩膰膵膾膸膽臀臂膺臉臍臑臙臘臈臚臟臠臧臺臻臾舁舂舅與舊舍舐舖舩舫舸舳艀艙艘艝艚艟艤\"],[\"e480\",\"艢艨艪艫舮艱艷艸艾芍芒芫芟芻芬苡苣苟苒苴苳苺莓范苻苹苞茆苜茉苙茵茴茖茲茱荀茹荐荅茯茫茗茘莅莚莪莟莢莖茣莎莇莊荼莵荳荵莠莉莨菴萓菫菎菽萃菘萋菁菷萇菠菲萍萢萠莽萸蔆菻葭萪萼蕚蒄葷葫蒭葮蒂葩葆萬葯葹萵蓊葢蒹蒿蒟蓙蓍蒻蓚蓐蓁蓆蓖蒡蔡蓿蓴蔗蔘蔬蔟蔕蔔蓼蕀蕣蕘蕈\"],[\"e540\",\"蕁蘂蕋蕕薀薤薈薑薊薨蕭薔薛藪薇薜蕷蕾薐藉薺藏薹藐藕藝藥藜藹蘊蘓蘋藾藺蘆蘢蘚蘰蘿虍乕虔號虧虱蚓蚣蚩蚪蚋蚌蚶蚯蛄蛆蚰蛉蠣蚫蛔蛞蛩蛬\"],[\"e580\",\"蛟蛛蛯蜒蜆蜈蜀蜃蛻蜑蜉蜍蛹蜊蜴蜿蜷蜻蜥蜩蜚蝠蝟蝸蝌蝎蝴蝗蝨蝮蝙蝓蝣蝪蠅螢螟螂螯蟋螽蟀蟐雖螫蟄螳蟇蟆螻蟯蟲蟠蠏蠍蟾蟶蟷蠎蟒蠑蠖蠕蠢蠡蠱蠶蠹蠧蠻衄衂衒衙衞衢衫袁衾袞衵衽袵衲袂袗袒袮袙袢袍袤袰袿袱裃裄裔裘裙裝裹褂裼裴裨裲褄褌褊褓襃褞褥褪褫襁襄褻褶褸襌褝襠襞\"],[\"e640\",\"襦襤襭襪襯襴襷襾覃覈覊覓覘覡覩覦覬覯覲覺覽覿觀觚觜觝觧觴觸訃訖訐訌訛訝訥訶詁詛詒詆詈詼詭詬詢誅誂誄誨誡誑誥誦誚誣諄諍諂諚諫諳諧\"],[\"e680\",\"諤諱謔諠諢諷諞諛謌謇謚諡謖謐謗謠謳鞫謦謫謾謨譁譌譏譎證譖譛譚譫譟譬譯譴譽讀讌讎讒讓讖讙讚谺豁谿豈豌豎豐豕豢豬豸豺貂貉貅貊貍貎貔豼貘戝貭貪貽貲貳貮貶賈賁賤賣賚賽賺賻贄贅贊贇贏贍贐齎贓賍贔贖赧赭赱赳趁趙跂趾趺跏跚跖跌跛跋跪跫跟跣跼踈踉跿踝踞踐踟蹂踵踰踴蹊\"],[\"e740\",\"蹇蹉蹌蹐蹈蹙蹤蹠踪蹣蹕蹶蹲蹼躁躇躅躄躋躊躓躑躔躙躪躡躬躰軆躱躾軅軈軋軛軣軼軻軫軾輊輅輕輒輙輓輜輟輛輌輦輳輻輹轅轂輾轌轉轆轎轗轜\"],[\"e780\",\"轢轣轤辜辟辣辭辯辷迚迥迢迪迯邇迴逅迹迺逑逕逡逍逞逖逋逧逶逵逹迸遏遐遑遒逎遉逾遖遘遞遨遯遶隨遲邂遽邁邀邊邉邏邨邯邱邵郢郤扈郛鄂鄒鄙鄲鄰酊酖酘酣酥酩酳酲醋醉醂醢醫醯醪醵醴醺釀釁釉釋釐釖釟釡釛釼釵釶鈞釿鈔鈬鈕鈑鉞鉗鉅鉉鉤鉈銕鈿鉋鉐銜銖銓銛鉚鋏銹銷鋩錏鋺鍄錮\"],[\"e840\",\"錙錢錚錣錺錵錻鍜鍠鍼鍮鍖鎰鎬鎭鎔鎹鏖鏗鏨鏥鏘鏃鏝鏐鏈鏤鐚鐔鐓鐃鐇鐐鐶鐫鐵鐡鐺鑁鑒鑄鑛鑠鑢鑞鑪鈩鑰鑵鑷鑽鑚鑼鑾钁鑿閂閇閊閔閖閘閙\"],[\"e880\",\"閠閨閧閭閼閻閹閾闊濶闃闍闌闕闔闖關闡闥闢阡阨阮阯陂陌陏陋陷陜陞陝陟陦陲陬隍隘隕隗險隧隱隲隰隴隶隸隹雎雋雉雍襍雜霍雕雹霄霆霈霓霎霑霏霖霙霤霪霰霹霽霾靄靆靈靂靉靜靠靤靦靨勒靫靱靹鞅靼鞁靺鞆鞋鞏鞐鞜鞨鞦鞣鞳鞴韃韆韈韋韜韭齏韲竟韶韵頏頌頸頤頡頷頽顆顏顋顫顯顰\"],[\"e940\",\"顱顴顳颪颯颱颶飄飃飆飩飫餃餉餒餔餘餡餝餞餤餠餬餮餽餾饂饉饅饐饋饑饒饌饕馗馘馥馭馮馼駟駛駝駘駑駭駮駱駲駻駸騁騏騅駢騙騫騷驅驂驀驃\"],[\"e980\",\"騾驕驍驛驗驟驢驥驤驩驫驪骭骰骼髀髏髑髓體髞髟髢髣髦髯髫髮髴髱髷髻鬆鬘鬚鬟鬢鬣鬥鬧鬨鬩鬪鬮鬯鬲魄魃魏魍魎魑魘魴鮓鮃鮑鮖鮗鮟鮠鮨鮴鯀鯊鮹鯆鯏鯑鯒鯣鯢鯤鯔鯡鰺鯲鯱鯰鰕鰔鰉鰓鰌鰆鰈鰒鰊鰄鰮鰛鰥鰤鰡鰰鱇鰲鱆鰾鱚鱠鱧鱶鱸鳧鳬鳰鴉鴈鳫鴃鴆鴪鴦鶯鴣鴟鵄鴕鴒鵁鴿鴾鵆鵈\"],[\"ea40\",\"鵝鵞鵤鵑鵐鵙鵲鶉鶇鶫鵯鵺鶚鶤鶩鶲鷄鷁鶻鶸鶺鷆鷏鷂鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽麁麈麋麌麒麕麑麝麥麩麸麪麭靡黌黎黏黐黔黜點黝黠黥黨黯\"],[\"ea80\",\"黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠堯槇遙瑤凜熙\"],[\"ed40\",\"纊褜鍈銈蓜俉炻昱棈鋹曻彅丨仡仼伀伃伹佖侒侊侚侔俍偀倢俿倞偆偰偂傔僴僘兊兤冝冾凬刕劜劦勀勛匀匇匤卲厓厲叝﨎咜咊咩哿喆坙坥垬埈埇﨏\"],[\"ed80\",\"塚增墲夋奓奛奝奣妤妺孖寀甯寘寬尞岦岺峵崧嵓﨑嵂嵭嶸嶹巐弡弴彧德忞恝悅悊惞惕愠惲愑愷愰憘戓抦揵摠撝擎敎昀昕昻昉昮昞昤晥晗晙晴晳暙暠暲暿曺朎朗杦枻桒柀栁桄棏﨓楨﨔榘槢樰橫橆橳橾櫢櫤毖氿汜沆汯泚洄涇浯涖涬淏淸淲淼渹湜渧渼溿澈澵濵瀅瀇瀨炅炫焏焄煜煆煇凞燁燾犱\"],[\"ee40\",\"犾猤猪獷玽珉珖珣珒琇珵琦琪琩琮瑢璉璟甁畯皂皜皞皛皦益睆劯砡硎硤硺礰礼神祥禔福禛竑竧靖竫箞精絈絜綷綠緖繒罇羡羽茁荢荿菇菶葈蒴蕓蕙\"],[\"ee80\",\"蕫﨟薰蘒﨡蠇裵訒訷詹誧誾諟諸諶譓譿賰賴贒赶﨣軏﨤逸遧郞都鄕鄧釚釗釞釭釮釤釥鈆鈐鈊鈺鉀鈼鉎鉙鉑鈹鉧銧鉷鉸鋧鋗鋙鋐﨧鋕鋠鋓錥錡鋻﨨錞鋿錝錂鍰鍗鎤鏆鏞鏸鐱鑅鑈閒隆﨩隝隯霳霻靃靍靏靑靕顗顥飯飼餧館馞驎髙髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑\"],[\"eeef\",\"ⅰ\",9,\"¬¦'"\"],[\"f040\",\"\",62],[\"f080\",\"\",124],[\"f140\",\"\",62],[\"f180\",\"\",124],[\"f240\",\"\",62],[\"f280\",\"\",124],[\"f340\",\"\",62],[\"f380\",\"\",124],[\"f440\",\"\",62],[\"f480\",\"\",124],[\"f540\",\"\",62],[\"f580\",\"\",124],[\"f640\",\"\",62],[\"f680\",\"\",124],[\"f740\",\"\",62],[\"f780\",\"\",124],[\"f840\",\"\",62],[\"f880\",\"\",124],[\"f940\",\"\"],[\"fa40\",\"ⅰ\",9,\"Ⅰ\",9,\"¬¦'"㈱№℡∵纊褜鍈銈蓜俉炻昱棈鋹曻彅丨仡仼伀伃伹佖侒侊侚侔俍偀倢俿倞偆偰偂傔僴僘兊\"],[\"fa80\",\"兤冝冾凬刕劜劦勀勛匀匇匤卲厓厲叝﨎咜咊咩哿喆坙坥垬埈埇﨏塚增墲夋奓奛奝奣妤妺孖寀甯寘寬尞岦岺峵崧嵓﨑嵂嵭嶸嶹巐弡弴彧德忞恝悅悊惞惕愠惲愑愷愰憘戓抦揵摠撝擎敎昀昕昻昉昮昞昤晥晗晙晴晳暙暠暲暿曺朎朗杦枻桒柀栁桄棏﨓楨﨔榘槢樰橫橆橳橾櫢櫤毖氿汜沆汯泚洄涇浯\"],[\"fb40\",\"涖涬淏淸淲淼渹湜渧渼溿澈澵濵瀅瀇瀨炅炫焏焄煜煆煇凞燁燾犱犾猤猪獷玽珉珖珣珒琇珵琦琪琩琮瑢璉璟甁畯皂皜皞皛皦益睆劯砡硎硤硺礰礼神\"],[\"fb80\",\"祥禔福禛竑竧靖竫箞精絈絜綷綠緖繒罇羡羽茁荢荿菇菶葈蒴蕓蕙蕫﨟薰蘒﨡蠇裵訒訷詹誧誾諟諸諶譓譿賰賴贒赶﨣軏﨤逸遧郞都鄕鄧釚釗釞釭釮釤釥鈆鈐鈊鈺鉀鈼鉎鉙鉑鈹鉧銧鉷鉸鋧鋗鋙鋐﨧鋕鋠鋓錥錡鋻﨨錞鋿錝錂鍰鍗鎤鏆鏞鏸鐱鑅鑈閒隆﨩隝隯霳霻靃靍靏靑靕顗顥飯飼餧館馞驎髙\"],[\"fc40\",\"髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑\"]]");
  45868. /***/ }),
  45869. /* 316 */
  45870. /***/ (function(module) {
  45871. module.exports = JSON.parse("[[\"0\",\"\\u0000\",127],[\"8ea1\",\"。\",62],[\"a1a1\",\" 、。,.・:;?!゛゜´`¨^ ̄_ヽヾゝゞ〃仝々〆〇ー―‐/\~∥|…‥‘’“”()〔〕[]{}〈\",9,\"+-±×÷=≠<>≦≧∞∴♂♀°′″℃¥$¢£%#&*@§☆★○●◎◇\"],[\"a2a1\",\"◆□■△▲▽▼※〒→←↑↓〓\"],[\"a2ba\",\"∈∋⊆⊇⊂⊃∪∩\"],[\"a2ca\",\"∧∨¬⇒⇔∀∃\"],[\"a2dc\",\"∠⊥⌒∂∇≡≒≪≫√∽∝∵∫∬\"],[\"a2f2\",\"ʼn♯♭♪†‡¶\"],[\"a2fe\",\"◯\"],[\"a3b0\",\"0\",9],[\"a3c1\",\"A\",25],[\"a3e1\",\"a\",25],[\"a4a1\",\"ぁ\",82],[\"a5a1\",\"ァ\",85],[\"a6a1\",\"Α\",16,\"Σ\",6],[\"a6c1\",\"α\",16,\"σ\",6],[\"a7a1\",\"А\",5,\"ЁЖ\",25],[\"a7d1\",\"а\",5,\"ёж\",25],[\"a8a1\",\"─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂\"],[\"ada1\",\"①\",19,\"Ⅰ\",9],[\"adc0\",\"㍉㌔㌢㍍㌘㌧㌃㌶㍑㍗㌍㌦㌣㌫㍊㌻㎜㎝㎞㎎㎏㏄㎡\"],[\"addf\",\"㍻〝〟№㏍℡㊤\",4,\"㈱㈲㈹㍾㍽㍼≒≡∫∮∑√⊥∠∟⊿∵∩∪\"],[\"b0a1\",\"亜唖娃阿哀愛挨姶逢葵茜穐悪握渥旭葦芦鯵梓圧斡扱宛姐虻飴絢綾鮎或粟袷安庵按暗案闇鞍杏以伊位依偉囲夷委威尉惟意慰易椅為畏異移維緯胃萎衣謂違遺医井亥域育郁磯一壱溢逸稲茨芋鰯允印咽員因姻引飲淫胤蔭\"],[\"b1a1\",\"院陰隠韻吋右宇烏羽迂雨卯鵜窺丑碓臼渦嘘唄欝蔚鰻姥厩浦瓜閏噂云運雲荏餌叡営嬰影映曳栄永泳洩瑛盈穎頴英衛詠鋭液疫益駅悦謁越閲榎厭円園堰奄宴延怨掩援沿演炎焔煙燕猿縁艶苑薗遠鉛鴛塩於汚甥凹央奥往応\"],[\"b2a1\",\"押旺横欧殴王翁襖鴬鴎黄岡沖荻億屋憶臆桶牡乙俺卸恩温穏音下化仮何伽価佳加可嘉夏嫁家寡科暇果架歌河火珂禍禾稼箇花苛茄荷華菓蝦課嘩貨迦過霞蚊俄峨我牙画臥芽蛾賀雅餓駕介会解回塊壊廻快怪悔恢懐戒拐改\"],[\"b3a1\",\"魁晦械海灰界皆絵芥蟹開階貝凱劾外咳害崖慨概涯碍蓋街該鎧骸浬馨蛙垣柿蛎鈎劃嚇各廓拡撹格核殻獲確穫覚角赫較郭閣隔革学岳楽額顎掛笠樫橿梶鰍潟割喝恰括活渇滑葛褐轄且鰹叶椛樺鞄株兜竃蒲釜鎌噛鴨栢茅萱\"],[\"b4a1\",\"粥刈苅瓦乾侃冠寒刊勘勧巻喚堪姦完官寛干幹患感慣憾換敢柑桓棺款歓汗漢澗潅環甘監看竿管簡緩缶翰肝艦莞観諌貫還鑑間閑関陥韓館舘丸含岸巌玩癌眼岩翫贋雁頑顔願企伎危喜器基奇嬉寄岐希幾忌揮机旗既期棋棄\"],[\"b5a1\",\"機帰毅気汽畿祈季稀紀徽規記貴起軌輝飢騎鬼亀偽儀妓宜戯技擬欺犠疑祇義蟻誼議掬菊鞠吉吃喫桔橘詰砧杵黍却客脚虐逆丘久仇休及吸宮弓急救朽求汲泣灸球究窮笈級糾給旧牛去居巨拒拠挙渠虚許距鋸漁禦魚亨享京\"],[\"b6a1\",\"供侠僑兇競共凶協匡卿叫喬境峡強彊怯恐恭挟教橋況狂狭矯胸脅興蕎郷鏡響饗驚仰凝尭暁業局曲極玉桐粁僅勤均巾錦斤欣欽琴禁禽筋緊芹菌衿襟謹近金吟銀九倶句区狗玖矩苦躯駆駈駒具愚虞喰空偶寓遇隅串櫛釧屑屈\"],[\"b7a1\",\"掘窟沓靴轡窪熊隈粂栗繰桑鍬勲君薫訓群軍郡卦袈祁係傾刑兄啓圭珪型契形径恵慶慧憩掲携敬景桂渓畦稽系経継繋罫茎荊蛍計詣警軽頚鶏芸迎鯨劇戟撃激隙桁傑欠決潔穴結血訣月件倹倦健兼券剣喧圏堅嫌建憲懸拳捲\"],[\"b8a1\",\"検権牽犬献研硯絹県肩見謙賢軒遣鍵険顕験鹸元原厳幻弦減源玄現絃舷言諺限乎個古呼固姑孤己庫弧戸故枯湖狐糊袴股胡菰虎誇跨鈷雇顧鼓五互伍午呉吾娯後御悟梧檎瑚碁語誤護醐乞鯉交佼侯候倖光公功効勾厚口向\"],[\"b9a1\",\"后喉坑垢好孔孝宏工巧巷幸広庚康弘恒慌抗拘控攻昂晃更杭校梗構江洪浩港溝甲皇硬稿糠紅紘絞綱耕考肯肱腔膏航荒行衡講貢購郊酵鉱砿鋼閤降項香高鴻剛劫号合壕拷濠豪轟麹克刻告国穀酷鵠黒獄漉腰甑忽惚骨狛込\"],[\"baa1\",\"此頃今困坤墾婚恨懇昏昆根梱混痕紺艮魂些佐叉唆嵯左差査沙瑳砂詐鎖裟坐座挫債催再最哉塞妻宰彩才採栽歳済災采犀砕砦祭斎細菜裁載際剤在材罪財冴坂阪堺榊肴咲崎埼碕鷺作削咋搾昨朔柵窄策索錯桜鮭笹匙冊刷\"],[\"bba1\",\"察拶撮擦札殺薩雑皐鯖捌錆鮫皿晒三傘参山惨撒散桟燦珊産算纂蚕讃賛酸餐斬暫残仕仔伺使刺司史嗣四士始姉姿子屍市師志思指支孜斯施旨枝止死氏獅祉私糸紙紫肢脂至視詞詩試誌諮資賜雌飼歯事似侍児字寺慈持時\"],[\"bca1\",\"次滋治爾璽痔磁示而耳自蒔辞汐鹿式識鴫竺軸宍雫七叱執失嫉室悉湿漆疾質実蔀篠偲柴芝屡蕊縞舎写射捨赦斜煮社紗者謝車遮蛇邪借勺尺杓灼爵酌釈錫若寂弱惹主取守手朱殊狩珠種腫趣酒首儒受呪寿授樹綬需囚収周\"],[\"bda1\",\"宗就州修愁拾洲秀秋終繍習臭舟蒐衆襲讐蹴輯週酋酬集醜什住充十従戎柔汁渋獣縦重銃叔夙宿淑祝縮粛塾熟出術述俊峻春瞬竣舜駿准循旬楯殉淳準潤盾純巡遵醇順処初所暑曙渚庶緒署書薯藷諸助叙女序徐恕鋤除傷償\"],[\"bea1\",\"勝匠升召哨商唱嘗奨妾娼宵将小少尚庄床廠彰承抄招掌捷昇昌昭晶松梢樟樵沼消渉湘焼焦照症省硝礁祥称章笑粧紹肖菖蒋蕉衝裳訟証詔詳象賞醤鉦鍾鐘障鞘上丈丞乗冗剰城場壌嬢常情擾条杖浄状畳穣蒸譲醸錠嘱埴飾\"],[\"bfa1\",\"拭植殖燭織職色触食蝕辱尻伸信侵唇娠寝審心慎振新晋森榛浸深申疹真神秦紳臣芯薪親診身辛進針震人仁刃塵壬尋甚尽腎訊迅陣靭笥諏須酢図厨逗吹垂帥推水炊睡粋翠衰遂酔錐錘随瑞髄崇嵩数枢趨雛据杉椙菅頗雀裾\"],[\"c0a1\",\"澄摺寸世瀬畝是凄制勢姓征性成政整星晴棲栖正清牲生盛精聖声製西誠誓請逝醒青静斉税脆隻席惜戚斥昔析石積籍績脊責赤跡蹟碩切拙接摂折設窃節説雪絶舌蝉仙先千占宣専尖川戦扇撰栓栴泉浅洗染潜煎煽旋穿箭線\"],[\"c1a1\",\"繊羨腺舛船薦詮賎践選遷銭銑閃鮮前善漸然全禅繕膳糎噌塑岨措曾曽楚狙疏疎礎祖租粗素組蘇訴阻遡鼠僧創双叢倉喪壮奏爽宋層匝惣想捜掃挿掻操早曹巣槍槽漕燥争痩相窓糟総綜聡草荘葬蒼藻装走送遭鎗霜騒像増憎\"],[\"c2a1\",\"臓蔵贈造促側則即息捉束測足速俗属賊族続卒袖其揃存孫尊損村遜他多太汰詑唾堕妥惰打柁舵楕陀駄騨体堆対耐岱帯待怠態戴替泰滞胎腿苔袋貸退逮隊黛鯛代台大第醍題鷹滝瀧卓啄宅托択拓沢濯琢託鐸濁諾茸凧蛸只\"],[\"c3a1\",\"叩但達辰奪脱巽竪辿棚谷狸鱈樽誰丹単嘆坦担探旦歎淡湛炭短端箪綻耽胆蛋誕鍛団壇弾断暖檀段男談値知地弛恥智池痴稚置致蜘遅馳築畜竹筑蓄逐秩窒茶嫡着中仲宙忠抽昼柱注虫衷註酎鋳駐樗瀦猪苧著貯丁兆凋喋寵\"],[\"c4a1\",\"帖帳庁弔張彫徴懲挑暢朝潮牒町眺聴脹腸蝶調諜超跳銚長頂鳥勅捗直朕沈珍賃鎮陳津墜椎槌追鎚痛通塚栂掴槻佃漬柘辻蔦綴鍔椿潰坪壷嬬紬爪吊釣鶴亭低停偵剃貞呈堤定帝底庭廷弟悌抵挺提梯汀碇禎程締艇訂諦蹄逓\"],[\"c5a1\",\"邸鄭釘鼎泥摘擢敵滴的笛適鏑溺哲徹撤轍迭鉄典填天展店添纏甜貼転顛点伝殿澱田電兎吐堵塗妬屠徒斗杜渡登菟賭途都鍍砥砺努度土奴怒倒党冬凍刀唐塔塘套宕島嶋悼投搭東桃梼棟盗淘湯涛灯燈当痘祷等答筒糖統到\"],[\"c6a1\",\"董蕩藤討謄豆踏逃透鐙陶頭騰闘働動同堂導憧撞洞瞳童胴萄道銅峠鴇匿得徳涜特督禿篤毒独読栃橡凸突椴届鳶苫寅酉瀞噸屯惇敦沌豚遁頓呑曇鈍奈那内乍凪薙謎灘捺鍋楢馴縄畷南楠軟難汝二尼弐迩匂賑肉虹廿日乳入\"],[\"c7a1\",\"如尿韮任妊忍認濡禰祢寧葱猫熱年念捻撚燃粘乃廼之埜嚢悩濃納能脳膿農覗蚤巴把播覇杷波派琶破婆罵芭馬俳廃拝排敗杯盃牌背肺輩配倍培媒梅楳煤狽買売賠陪這蝿秤矧萩伯剥博拍柏泊白箔粕舶薄迫曝漠爆縛莫駁麦\"],[\"c8a1\",\"函箱硲箸肇筈櫨幡肌畑畠八鉢溌発醗髪伐罰抜筏閥鳩噺塙蛤隼伴判半反叛帆搬斑板氾汎版犯班畔繁般藩販範釆煩頒飯挽晩番盤磐蕃蛮匪卑否妃庇彼悲扉批披斐比泌疲皮碑秘緋罷肥被誹費避非飛樋簸備尾微枇毘琵眉美\"],[\"c9a1\",\"鼻柊稗匹疋髭彦膝菱肘弼必畢筆逼桧姫媛紐百謬俵彪標氷漂瓢票表評豹廟描病秒苗錨鋲蒜蛭鰭品彬斌浜瀕貧賓頻敏瓶不付埠夫婦富冨布府怖扶敷斧普浮父符腐膚芙譜負賦赴阜附侮撫武舞葡蕪部封楓風葺蕗伏副復幅服\"],[\"caa1\",\"福腹複覆淵弗払沸仏物鮒分吻噴墳憤扮焚奮粉糞紛雰文聞丙併兵塀幣平弊柄並蔽閉陛米頁僻壁癖碧別瞥蔑箆偏変片篇編辺返遍便勉娩弁鞭保舗鋪圃捕歩甫補輔穂募墓慕戊暮母簿菩倣俸包呆報奉宝峰峯崩庖抱捧放方朋\"],[\"cba1\",\"法泡烹砲縫胞芳萌蓬蜂褒訪豊邦鋒飽鳳鵬乏亡傍剖坊妨帽忘忙房暴望某棒冒紡肪膨謀貌貿鉾防吠頬北僕卜墨撲朴牧睦穆釦勃没殆堀幌奔本翻凡盆摩磨魔麻埋妹昧枚毎哩槙幕膜枕鮪柾鱒桝亦俣又抹末沫迄侭繭麿万慢満\"],[\"cca1\",\"漫蔓味未魅巳箕岬密蜜湊蓑稔脈妙粍民眠務夢無牟矛霧鵡椋婿娘冥名命明盟迷銘鳴姪牝滅免棉綿緬面麺摸模茂妄孟毛猛盲網耗蒙儲木黙目杢勿餅尤戻籾貰問悶紋門匁也冶夜爺耶野弥矢厄役約薬訳躍靖柳薮鑓愉愈油癒\"],[\"cda1\",\"諭輸唯佑優勇友宥幽悠憂揖有柚湧涌猶猷由祐裕誘遊邑郵雄融夕予余与誉輿預傭幼妖容庸揚揺擁曜楊様洋溶熔用窯羊耀葉蓉要謡踊遥陽養慾抑欲沃浴翌翼淀羅螺裸来莱頼雷洛絡落酪乱卵嵐欄濫藍蘭覧利吏履李梨理璃\"],[\"cea1\",\"痢裏裡里離陸律率立葎掠略劉流溜琉留硫粒隆竜龍侶慮旅虜了亮僚両凌寮料梁涼猟療瞭稜糧良諒遼量陵領力緑倫厘林淋燐琳臨輪隣鱗麟瑠塁涙累類令伶例冷励嶺怜玲礼苓鈴隷零霊麗齢暦歴列劣烈裂廉恋憐漣煉簾練聯\"],[\"cfa1\",\"蓮連錬呂魯櫓炉賂路露労婁廊弄朗楼榔浪漏牢狼篭老聾蝋郎六麓禄肋録論倭和話歪賄脇惑枠鷲亙亘鰐詫藁蕨椀湾碗腕\"],[\"d0a1\",\"弌丐丕个丱丶丼丿乂乖乘亂亅豫亊舒弍于亞亟亠亢亰亳亶从仍仄仆仂仗仞仭仟价伉佚估佛佝佗佇佶侈侏侘佻佩佰侑佯來侖儘俔俟俎俘俛俑俚俐俤俥倚倨倔倪倥倅伜俶倡倩倬俾俯們倆偃假會偕偐偈做偖偬偸傀傚傅傴傲\"],[\"d1a1\",\"僉僊傳僂僖僞僥僭僣僮價僵儉儁儂儖儕儔儚儡儺儷儼儻儿兀兒兌兔兢竸兩兪兮冀冂囘册冉冏冑冓冕冖冤冦冢冩冪冫决冱冲冰况冽凅凉凛几處凩凭凰凵凾刄刋刔刎刧刪刮刳刹剏剄剋剌剞剔剪剴剩剳剿剽劍劔劒剱劈劑辨\"],[\"d2a1\",\"辧劬劭劼劵勁勍勗勞勣勦飭勠勳勵勸勹匆匈甸匍匐匏匕匚匣匯匱匳匸區卆卅丗卉卍凖卞卩卮夘卻卷厂厖厠厦厥厮厰厶參簒雙叟曼燮叮叨叭叺吁吽呀听吭吼吮吶吩吝呎咏呵咎呟呱呷呰咒呻咀呶咄咐咆哇咢咸咥咬哄哈咨\"],[\"d3a1\",\"咫哂咤咾咼哘哥哦唏唔哽哮哭哺哢唹啀啣啌售啜啅啖啗唸唳啝喙喀咯喊喟啻啾喘喞單啼喃喩喇喨嗚嗅嗟嗄嗜嗤嗔嘔嗷嘖嗾嗽嘛嗹噎噐營嘴嘶嘲嘸噫噤嘯噬噪嚆嚀嚊嚠嚔嚏嚥嚮嚶嚴囂嚼囁囃囀囈囎囑囓囗囮囹圀囿圄圉\"],[\"d4a1\",\"圈國圍圓團圖嗇圜圦圷圸坎圻址坏坩埀垈坡坿垉垓垠垳垤垪垰埃埆埔埒埓堊埖埣堋堙堝塲堡塢塋塰毀塒堽塹墅墹墟墫墺壞墻墸墮壅壓壑壗壙壘壥壜壤壟壯壺壹壻壼壽夂夊夐夛梦夥夬夭夲夸夾竒奕奐奎奚奘奢奠奧奬奩\"],[\"d5a1\",\"奸妁妝佞侫妣妲姆姨姜妍姙姚娥娟娑娜娉娚婀婬婉娵娶婢婪媚媼媾嫋嫂媽嫣嫗嫦嫩嫖嫺嫻嬌嬋嬖嬲嫐嬪嬶嬾孃孅孀孑孕孚孛孥孩孰孳孵學斈孺宀它宦宸寃寇寉寔寐寤實寢寞寥寫寰寶寳尅將專對尓尠尢尨尸尹屁屆屎屓\"],[\"d6a1\",\"屐屏孱屬屮乢屶屹岌岑岔妛岫岻岶岼岷峅岾峇峙峩峽峺峭嶌峪崋崕崗嵜崟崛崑崔崢崚崙崘嵌嵒嵎嵋嵬嵳嵶嶇嶄嶂嶢嶝嶬嶮嶽嶐嶷嶼巉巍巓巒巖巛巫已巵帋帚帙帑帛帶帷幄幃幀幎幗幔幟幢幤幇幵并幺麼广庠廁廂廈廐廏\"],[\"d7a1\",\"廖廣廝廚廛廢廡廨廩廬廱廳廰廴廸廾弃弉彝彜弋弑弖弩弭弸彁彈彌彎弯彑彖彗彙彡彭彳彷徃徂彿徊很徑徇從徙徘徠徨徭徼忖忻忤忸忱忝悳忿怡恠怙怐怩怎怱怛怕怫怦怏怺恚恁恪恷恟恊恆恍恣恃恤恂恬恫恙悁悍惧悃悚\"],[\"d8a1\",\"悄悛悖悗悒悧悋惡悸惠惓悴忰悽惆悵惘慍愕愆惶惷愀惴惺愃愡惻惱愍愎慇愾愨愧慊愿愼愬愴愽慂慄慳慷慘慙慚慫慴慯慥慱慟慝慓慵憙憖憇憬憔憚憊憑憫憮懌懊應懷懈懃懆憺懋罹懍懦懣懶懺懴懿懽懼懾戀戈戉戍戌戔戛\"],[\"d9a1\",\"戞戡截戮戰戲戳扁扎扞扣扛扠扨扼抂抉找抒抓抖拔抃抔拗拑抻拏拿拆擔拈拜拌拊拂拇抛拉挌拮拱挧挂挈拯拵捐挾捍搜捏掖掎掀掫捶掣掏掉掟掵捫捩掾揩揀揆揣揉插揶揄搖搴搆搓搦搶攝搗搨搏摧摯摶摎攪撕撓撥撩撈撼\"],[\"daa1\",\"據擒擅擇撻擘擂擱擧舉擠擡抬擣擯攬擶擴擲擺攀擽攘攜攅攤攣攫攴攵攷收攸畋效敖敕敍敘敞敝敲數斂斃變斛斟斫斷旃旆旁旄旌旒旛旙无旡旱杲昊昃旻杳昵昶昴昜晏晄晉晁晞晝晤晧晨晟晢晰暃暈暎暉暄暘暝曁暹曉暾暼\"],[\"dba1\",\"曄暸曖曚曠昿曦曩曰曵曷朏朖朞朦朧霸朮朿朶杁朸朷杆杞杠杙杣杤枉杰枩杼杪枌枋枦枡枅枷柯枴柬枳柩枸柤柞柝柢柮枹柎柆柧檜栞框栩桀桍栲桎梳栫桙档桷桿梟梏梭梔條梛梃檮梹桴梵梠梺椏梍桾椁棊椈棘椢椦棡椌棍\"],[\"dca1\",\"棔棧棕椶椒椄棗棣椥棹棠棯椨椪椚椣椡棆楹楷楜楸楫楔楾楮椹楴椽楙椰楡楞楝榁楪榲榮槐榿槁槓榾槎寨槊槝榻槃榧樮榑榠榜榕榴槞槨樂樛槿權槹槲槧樅榱樞槭樔槫樊樒櫁樣樓橄樌橲樶橸橇橢橙橦橈樸樢檐檍檠檄檢檣\"],[\"dda1\",\"檗蘗檻櫃櫂檸檳檬櫞櫑櫟檪櫚櫪櫻欅蘖櫺欒欖鬱欟欸欷盜欹飮歇歃歉歐歙歔歛歟歡歸歹歿殀殄殃殍殘殕殞殤殪殫殯殲殱殳殷殼毆毋毓毟毬毫毳毯麾氈氓气氛氤氣汞汕汢汪沂沍沚沁沛汾汨汳沒沐泄泱泓沽泗泅泝沮沱沾\"],[\"dea1\",\"沺泛泯泙泪洟衍洶洫洽洸洙洵洳洒洌浣涓浤浚浹浙涎涕濤涅淹渕渊涵淇淦涸淆淬淞淌淨淒淅淺淙淤淕淪淮渭湮渮渙湲湟渾渣湫渫湶湍渟湃渺湎渤滿渝游溂溪溘滉溷滓溽溯滄溲滔滕溏溥滂溟潁漑灌滬滸滾漿滲漱滯漲滌\"],[\"dfa1\",\"漾漓滷澆潺潸澁澀潯潛濳潭澂潼潘澎澑濂潦澳澣澡澤澹濆澪濟濕濬濔濘濱濮濛瀉瀋濺瀑瀁瀏濾瀛瀚潴瀝瀘瀟瀰瀾瀲灑灣炙炒炯烱炬炸炳炮烟烋烝烙焉烽焜焙煥煕熈煦煢煌煖煬熏燻熄熕熨熬燗熹熾燒燉燔燎燠燬燧燵燼\"],[\"e0a1\",\"燹燿爍爐爛爨爭爬爰爲爻爼爿牀牆牋牘牴牾犂犁犇犒犖犢犧犹犲狃狆狄狎狒狢狠狡狹狷倏猗猊猜猖猝猴猯猩猥猾獎獏默獗獪獨獰獸獵獻獺珈玳珎玻珀珥珮珞璢琅瑯琥珸琲琺瑕琿瑟瑙瑁瑜瑩瑰瑣瑪瑶瑾璋璞璧瓊瓏瓔珱\"],[\"e1a1\",\"瓠瓣瓧瓩瓮瓲瓰瓱瓸瓷甄甃甅甌甎甍甕甓甞甦甬甼畄畍畊畉畛畆畚畩畤畧畫畭畸當疆疇畴疊疉疂疔疚疝疥疣痂疳痃疵疽疸疼疱痍痊痒痙痣痞痾痿痼瘁痰痺痲痳瘋瘍瘉瘟瘧瘠瘡瘢瘤瘴瘰瘻癇癈癆癜癘癡癢癨癩癪癧癬癰\"],[\"e2a1\",\"癲癶癸發皀皃皈皋皎皖皓皙皚皰皴皸皹皺盂盍盖盒盞盡盥盧盪蘯盻眈眇眄眩眤眞眥眦眛眷眸睇睚睨睫睛睥睿睾睹瞎瞋瞑瞠瞞瞰瞶瞹瞿瞼瞽瞻矇矍矗矚矜矣矮矼砌砒礦砠礪硅碎硴碆硼碚碌碣碵碪碯磑磆磋磔碾碼磅磊磬\"],[\"e3a1\",\"磧磚磽磴礇礒礑礙礬礫祀祠祗祟祚祕祓祺祿禊禝禧齋禪禮禳禹禺秉秕秧秬秡秣稈稍稘稙稠稟禀稱稻稾稷穃穗穉穡穢穩龝穰穹穽窈窗窕窘窖窩竈窰窶竅竄窿邃竇竊竍竏竕竓站竚竝竡竢竦竭竰笂笏笊笆笳笘笙笞笵笨笶筐\"],[\"e4a1\",\"筺笄筍笋筌筅筵筥筴筧筰筱筬筮箝箘箟箍箜箚箋箒箏筝箙篋篁篌篏箴篆篝篩簑簔篦篥籠簀簇簓篳篷簗簍篶簣簧簪簟簷簫簽籌籃籔籏籀籐籘籟籤籖籥籬籵粃粐粤粭粢粫粡粨粳粲粱粮粹粽糀糅糂糘糒糜糢鬻糯糲糴糶糺紆\"],[\"e5a1\",\"紂紜紕紊絅絋紮紲紿紵絆絳絖絎絲絨絮絏絣經綉絛綏絽綛綺綮綣綵緇綽綫總綢綯緜綸綟綰緘緝緤緞緻緲緡縅縊縣縡縒縱縟縉縋縢繆繦縻縵縹繃縷縲縺繧繝繖繞繙繚繹繪繩繼繻纃緕繽辮繿纈纉續纒纐纓纔纖纎纛纜缸缺\"],[\"e6a1\",\"罅罌罍罎罐网罕罔罘罟罠罨罩罧罸羂羆羃羈羇羌羔羞羝羚羣羯羲羹羮羶羸譱翅翆翊翕翔翡翦翩翳翹飜耆耄耋耒耘耙耜耡耨耿耻聊聆聒聘聚聟聢聨聳聲聰聶聹聽聿肄肆肅肛肓肚肭冐肬胛胥胙胝胄胚胖脉胯胱脛脩脣脯腋\"],[\"e7a1\",\"隋腆脾腓腑胼腱腮腥腦腴膃膈膊膀膂膠膕膤膣腟膓膩膰膵膾膸膽臀臂膺臉臍臑臙臘臈臚臟臠臧臺臻臾舁舂舅與舊舍舐舖舩舫舸舳艀艙艘艝艚艟艤艢艨艪艫舮艱艷艸艾芍芒芫芟芻芬苡苣苟苒苴苳苺莓范苻苹苞茆苜茉苙\"],[\"e8a1\",\"茵茴茖茲茱荀茹荐荅茯茫茗茘莅莚莪莟莢莖茣莎莇莊荼莵荳荵莠莉莨菴萓菫菎菽萃菘萋菁菷萇菠菲萍萢萠莽萸蔆菻葭萪萼蕚蒄葷葫蒭葮蒂葩葆萬葯葹萵蓊葢蒹蒿蒟蓙蓍蒻蓚蓐蓁蓆蓖蒡蔡蓿蓴蔗蔘蔬蔟蔕蔔蓼蕀蕣蕘蕈\"],[\"e9a1\",\"蕁蘂蕋蕕薀薤薈薑薊薨蕭薔薛藪薇薜蕷蕾薐藉薺藏薹藐藕藝藥藜藹蘊蘓蘋藾藺蘆蘢蘚蘰蘿虍乕虔號虧虱蚓蚣蚩蚪蚋蚌蚶蚯蛄蛆蚰蛉蠣蚫蛔蛞蛩蛬蛟蛛蛯蜒蜆蜈蜀蜃蛻蜑蜉蜍蛹蜊蜴蜿蜷蜻蜥蜩蜚蝠蝟蝸蝌蝎蝴蝗蝨蝮蝙\"],[\"eaa1\",\"蝓蝣蝪蠅螢螟螂螯蟋螽蟀蟐雖螫蟄螳蟇蟆螻蟯蟲蟠蠏蠍蟾蟶蟷蠎蟒蠑蠖蠕蠢蠡蠱蠶蠹蠧蠻衄衂衒衙衞衢衫袁衾袞衵衽袵衲袂袗袒袮袙袢袍袤袰袿袱裃裄裔裘裙裝裹褂裼裴裨裲褄褌褊褓襃褞褥褪褫襁襄褻褶褸襌褝襠襞\"],[\"eba1\",\"襦襤襭襪襯襴襷襾覃覈覊覓覘覡覩覦覬覯覲覺覽覿觀觚觜觝觧觴觸訃訖訐訌訛訝訥訶詁詛詒詆詈詼詭詬詢誅誂誄誨誡誑誥誦誚誣諄諍諂諚諫諳諧諤諱謔諠諢諷諞諛謌謇謚諡謖謐謗謠謳鞫謦謫謾謨譁譌譏譎證譖譛譚譫\"],[\"eca1\",\"譟譬譯譴譽讀讌讎讒讓讖讙讚谺豁谿豈豌豎豐豕豢豬豸豺貂貉貅貊貍貎貔豼貘戝貭貪貽貲貳貮貶賈賁賤賣賚賽賺賻贄贅贊贇贏贍贐齎贓賍贔贖赧赭赱赳趁趙跂趾趺跏跚跖跌跛跋跪跫跟跣跼踈踉跿踝踞踐踟蹂踵踰踴蹊\"],[\"eda1\",\"蹇蹉蹌蹐蹈蹙蹤蹠踪蹣蹕蹶蹲蹼躁躇躅躄躋躊躓躑躔躙躪躡躬躰軆躱躾軅軈軋軛軣軼軻軫軾輊輅輕輒輙輓輜輟輛輌輦輳輻輹轅轂輾轌轉轆轎轗轜轢轣轤辜辟辣辭辯辷迚迥迢迪迯邇迴逅迹迺逑逕逡逍逞逖逋逧逶逵逹迸\"],[\"eea1\",\"遏遐遑遒逎遉逾遖遘遞遨遯遶隨遲邂遽邁邀邊邉邏邨邯邱邵郢郤扈郛鄂鄒鄙鄲鄰酊酖酘酣酥酩酳酲醋醉醂醢醫醯醪醵醴醺釀釁釉釋釐釖釟釡釛釼釵釶鈞釿鈔鈬鈕鈑鉞鉗鉅鉉鉤鉈銕鈿鉋鉐銜銖銓銛鉚鋏銹銷鋩錏鋺鍄錮\"],[\"efa1\",\"錙錢錚錣錺錵錻鍜鍠鍼鍮鍖鎰鎬鎭鎔鎹鏖鏗鏨鏥鏘鏃鏝鏐鏈鏤鐚鐔鐓鐃鐇鐐鐶鐫鐵鐡鐺鑁鑒鑄鑛鑠鑢鑞鑪鈩鑰鑵鑷鑽鑚鑼鑾钁鑿閂閇閊閔閖閘閙閠閨閧閭閼閻閹閾闊濶闃闍闌闕闔闖關闡闥闢阡阨阮阯陂陌陏陋陷陜陞\"],[\"f0a1\",\"陝陟陦陲陬隍隘隕隗險隧隱隲隰隴隶隸隹雎雋雉雍襍雜霍雕雹霄霆霈霓霎霑霏霖霙霤霪霰霹霽霾靄靆靈靂靉靜靠靤靦靨勒靫靱靹鞅靼鞁靺鞆鞋鞏鞐鞜鞨鞦鞣鞳鞴韃韆韈韋韜韭齏韲竟韶韵頏頌頸頤頡頷頽顆顏顋顫顯顰\"],[\"f1a1\",\"顱顴顳颪颯颱颶飄飃飆飩飫餃餉餒餔餘餡餝餞餤餠餬餮餽餾饂饉饅饐饋饑饒饌饕馗馘馥馭馮馼駟駛駝駘駑駭駮駱駲駻駸騁騏騅駢騙騫騷驅驂驀驃騾驕驍驛驗驟驢驥驤驩驫驪骭骰骼髀髏髑髓體髞髟髢髣髦髯髫髮髴髱髷\"],[\"f2a1\",\"髻鬆鬘鬚鬟鬢鬣鬥鬧鬨鬩鬪鬮鬯鬲魄魃魏魍魎魑魘魴鮓鮃鮑鮖鮗鮟鮠鮨鮴鯀鯊鮹鯆鯏鯑鯒鯣鯢鯤鯔鯡鰺鯲鯱鯰鰕鰔鰉鰓鰌鰆鰈鰒鰊鰄鰮鰛鰥鰤鰡鰰鱇鰲鱆鰾鱚鱠鱧鱶鱸鳧鳬鳰鴉鴈鳫鴃鴆鴪鴦鶯鴣鴟鵄鴕鴒鵁鴿鴾鵆鵈\"],[\"f3a1\",\"鵝鵞鵤鵑鵐鵙鵲鶉鶇鶫鵯鵺鶚鶤鶩鶲鷄鷁鶻鶸鶺鷆鷏鷂鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽麁麈麋麌麒麕麑麝麥麩麸麪麭靡黌黎黏黐黔黜點黝黠黥黨黯黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠\"],[\"f4a1\",\"堯槇遙瑤凜熙\"],[\"f9a1\",\"纊褜鍈銈蓜俉炻昱棈鋹曻彅丨仡仼伀伃伹佖侒侊侚侔俍偀倢俿倞偆偰偂傔僴僘兊兤冝冾凬刕劜劦勀勛匀匇匤卲厓厲叝﨎咜咊咩哿喆坙坥垬埈埇﨏塚增墲夋奓奛奝奣妤妺孖寀甯寘寬尞岦岺峵崧嵓﨑嵂嵭嶸嶹巐弡弴彧德\"],[\"faa1\",\"忞恝悅悊惞惕愠惲愑愷愰憘戓抦揵摠撝擎敎昀昕昻昉昮昞昤晥晗晙晴晳暙暠暲暿曺朎朗杦枻桒柀栁桄棏﨓楨﨔榘槢樰橫橆橳橾櫢櫤毖氿汜沆汯泚洄涇浯涖涬淏淸淲淼渹湜渧渼溿澈澵濵瀅瀇瀨炅炫焏焄煜煆煇凞燁燾犱\"],[\"fba1\",\"犾猤猪獷玽珉珖珣珒琇珵琦琪琩琮瑢璉璟甁畯皂皜皞皛皦益睆劯砡硎硤硺礰礼神祥禔福禛竑竧靖竫箞精絈絜綷綠緖繒罇羡羽茁荢荿菇菶葈蒴蕓蕙蕫﨟薰蘒﨡蠇裵訒訷詹誧誾諟諸諶譓譿賰賴贒赶﨣軏﨤逸遧郞都鄕鄧釚\"],[\"fca1\",\"釗釞釭釮釤釥鈆鈐鈊鈺鉀鈼鉎鉙鉑鈹鉧銧鉷鉸鋧鋗鋙鋐﨧鋕鋠鋓錥錡鋻﨨錞鋿錝錂鍰鍗鎤鏆鏞鏸鐱鑅鑈閒隆﨩隝隯霳霻靃靍靏靑靕顗顥飯飼餧館馞驎髙髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑\"],[\"fcf1\",\"ⅰ\",9,\"¬¦'"\"],[\"8fa2af\",\"˘ˇ¸˙˝¯˛˚~΄΅\"],[\"8fa2c2\",\"¡¦¿\"],[\"8fa2eb\",\"ºª©®™¤№\"],[\"8fa6e1\",\"ΆΈΉΊΪ\"],[\"8fa6e7\",\"Ό\"],[\"8fa6e9\",\"ΎΫ\"],[\"8fa6ec\",\"Ώ\"],[\"8fa6f1\",\"άέήίϊΐόςύϋΰώ\"],[\"8fa7c2\",\"Ђ\",10,\"ЎЏ\"],[\"8fa7f2\",\"ђ\",10,\"ўџ\"],[\"8fa9a1\",\"ÆĐ\"],[\"8fa9a4\",\"Ħ\"],[\"8fa9a6\",\"IJ\"],[\"8fa9a8\",\"ŁĿ\"],[\"8fa9ab\",\"ŊØŒ\"],[\"8fa9af\",\"ŦÞ\"],[\"8fa9c1\",\"æđðħıijĸłŀʼnŋøœßŧþ\"],[\"8faaa1\",\"ÁÀÄÂĂǍĀĄÅÃĆĈČÇĊĎÉÈËÊĚĖĒĘ\"],[\"8faaba\",\"ĜĞĢĠĤÍÌÏÎǏİĪĮĨĴĶĹĽĻŃŇŅÑÓÒÖÔǑŐŌÕŔŘŖŚŜŠŞŤŢÚÙÜÛŬǓŰŪŲŮŨǗǛǙǕŴÝŸŶŹŽŻ\"],[\"8faba1\",\"áàäâăǎāąåãćĉčçċďéèëêěėēęǵĝğ\"],[\"8fabbd\",\"ġĥíìïîǐ\"],[\"8fabc5\",\"īįĩĵķĺľļńňņñóòöôǒőōõŕřŗśŝšşťţúùüûŭǔűūųůũǘǜǚǖŵýÿŷźžż\"],[\"8fb0a1\",\"丂丄丅丌丒丟丣两丨丫丮丯丰丵乀乁乄乇乑乚乜乣乨乩乴乵乹乿亍亖亗亝亯亹仃仐仚仛仠仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众伙伮伱你伳伵伷伹伻伾佀佂佈佉佋佌佒佔佖佘佟佣佪佬佮佱佷佸佹佺佽佾侁侂侄\"],[\"8fb1a1\",\"侅侉侊侌侎侐侒侓侔侗侙侚侞侟侲侷侹侻侼侽侾俀俁俅俆俈俉俋俌俍俏俒俜俠俢俰俲俼俽俿倀倁倄倇倊倌倎倐倓倗倘倛倜倝倞倢倧倮倰倲倳倵偀偁偂偅偆偊偌偎偑偒偓偗偙偟偠偢偣偦偧偪偭偰偱倻傁傃傄傆傊傎傏傐\"],[\"8fb2a1\",\"傒傓傔傖傛傜傞\",4,\"傪傯傰傹傺傽僀僃僄僇僌僎僐僓僔僘僜僝僟僢僤僦僨僩僯僱僶僺僾儃儆儇儈儋儌儍儎僲儐儗儙儛儜儝儞儣儧儨儬儭儯儱儳儴儵儸儹兂兊兏兓兕兗兘兟兤兦兾冃冄冋冎冘冝冡冣冭冸冺冼冾冿凂\"],[\"8fb3a1\",\"凈减凑凒凓凕凘凞凢凥凮凲凳凴凷刁刂刅划刓刕刖刘刢刨刱刲刵刼剅剉剕剗剘剚剜剟剠剡剦剮剷剸剹劀劂劅劊劌劓劕劖劗劘劚劜劤劥劦劧劯劰劶劷劸劺劻劽勀勄勆勈勌勏勑勔勖勛勜勡勥勨勩勪勬勰勱勴勶勷匀匃匊匋\"],[\"8fb4a1\",\"匌匑匓匘匛匜匞匟匥匧匨匩匫匬匭匰匲匵匼匽匾卂卌卋卙卛卡卣卥卬卭卲卹卾厃厇厈厎厓厔厙厝厡厤厪厫厯厲厴厵厷厸厺厽叀叅叏叒叓叕叚叝叞叠另叧叵吂吓吚吡吧吨吪启吱吴吵呃呄呇呍呏呞呢呤呦呧呩呫呭呮呴呿\"],[\"8fb5a1\",\"咁咃咅咈咉咍咑咕咖咜咟咡咦咧咩咪咭咮咱咷咹咺咻咿哆哊响哎哠哪哬哯哶哼哾哿唀唁唅唈唉唌唍唎唕唪唫唲唵唶唻唼唽啁啇啉啊啍啐啑啘啚啛啞啠啡啤啦啿喁喂喆喈喎喏喑喒喓喔喗喣喤喭喲喿嗁嗃嗆嗉嗋嗌嗎嗑嗒\"],[\"8fb6a1\",\"嗓嗗嗘嗛嗞嗢嗩嗶嗿嘅嘈嘊嘍\",5,\"嘙嘬嘰嘳嘵嘷嘹嘻嘼嘽嘿噀噁噃噄噆噉噋噍噏噔噞噠噡噢噣噦噩噭噯噱噲噵嚄嚅嚈嚋嚌嚕嚙嚚嚝嚞嚟嚦嚧嚨嚩嚫嚬嚭嚱嚳嚷嚾囅囉囊囋囏囐囌囍囙囜囝囟囡囤\",4,\"囱囫园\"],[\"8fb7a1\",\"囶囷圁圂圇圊圌圑圕圚圛圝圠圢圣圤圥圩圪圬圮圯圳圴圽圾圿坅坆坌坍坒坢坥坧坨坫坭\",4,\"坳坴坵坷坹坺坻坼坾垁垃垌垔垗垙垚垜垝垞垟垡垕垧垨垩垬垸垽埇埈埌埏埕埝埞埤埦埧埩埭埰埵埶埸埽埾埿堃堄堈堉埡\"],[\"8fb8a1\",\"堌堍堛堞堟堠堦堧堭堲堹堿塉塌塍塏塐塕塟塡塤塧塨塸塼塿墀墁墇墈墉墊墌墍墏墐墔墖墝墠墡墢墦墩墱墲壄墼壂壈壍壎壐壒壔壖壚壝壡壢壩壳夅夆夋夌夒夓夔虁夝夡夣夤夨夯夰夳夵夶夿奃奆奒奓奙奛奝奞奟奡奣奫奭\"],[\"8fb9a1\",\"奯奲奵奶她奻奼妋妌妎妒妕妗妟妤妧妭妮妯妰妳妷妺妼姁姃姄姈姊姍姒姝姞姟姣姤姧姮姯姱姲姴姷娀娄娌娍娎娒娓娞娣娤娧娨娪娭娰婄婅婇婈婌婐婕婞婣婥婧婭婷婺婻婾媋媐媓媖媙媜媞媟媠媢媧媬媱媲媳媵媸媺媻媿\"],[\"8fbaa1\",\"嫄嫆嫈嫏嫚嫜嫠嫥嫪嫮嫵嫶嫽嬀嬁嬈嬗嬴嬙嬛嬝嬡嬥嬭嬸孁孋孌孒孖孞孨孮孯孼孽孾孿宁宄宆宊宎宐宑宓宔宖宨宩宬宭宯宱宲宷宺宼寀寁寍寏寖\",4,\"寠寯寱寴寽尌尗尞尟尣尦尩尫尬尮尰尲尵尶屙屚屜屢屣屧屨屩\"],[\"8fbba1\",\"屭屰屴屵屺屻屼屽岇岈岊岏岒岝岟岠岢岣岦岪岲岴岵岺峉峋峒峝峗峮峱峲峴崁崆崍崒崫崣崤崦崧崱崴崹崽崿嵂嵃嵆嵈嵕嵑嵙嵊嵟嵠嵡嵢嵤嵪嵭嵰嵹嵺嵾嵿嶁嶃嶈嶊嶒嶓嶔嶕嶙嶛嶟嶠嶧嶫嶰嶴嶸嶹巃巇巋巐巎巘巙巠巤\"],[\"8fbca1\",\"巩巸巹帀帇帍帒帔帕帘帟帠帮帨帲帵帾幋幐幉幑幖幘幛幜幞幨幪\",4,\"幰庀庋庎庢庤庥庨庪庬庱庳庽庾庿廆廌廋廎廑廒廔廕廜廞廥廫异弆弇弈弎弙弜弝弡弢弣弤弨弫弬弮弰弴弶弻弽弿彀彄彅彇彍彐彔彘彛彠彣彤彧\"],[\"8fbda1\",\"彯彲彴彵彸彺彽彾徉徍徏徖徜徝徢徧徫徤徬徯徰徱徸忄忇忈忉忋忐\",4,\"忞忡忢忨忩忪忬忭忮忯忲忳忶忺忼怇怊怍怓怔怗怘怚怟怤怭怳怵恀恇恈恉恌恑恔恖恗恝恡恧恱恾恿悂悆悈悊悎悑悓悕悘悝悞悢悤悥您悰悱悷\"],[\"8fbea1\",\"悻悾惂惄惈惉惊惋惎惏惔惕惙惛惝惞惢惥惲惵惸惼惽愂愇愊愌愐\",4,\"愖愗愙愜愞愢愪愫愰愱愵愶愷愹慁慅慆慉慞慠慬慲慸慻慼慿憀憁憃憄憋憍憒憓憗憘憜憝憟憠憥憨憪憭憸憹憼懀懁懂懎懏懕懜懝懞懟懡懢懧懩懥\"],[\"8fbfa1\",\"懬懭懯戁戃戄戇戓戕戜戠戢戣戧戩戫戹戽扂扃扄扆扌扐扑扒扔扖扚扜扤扭扯扳扺扽抍抎抏抐抦抨抳抶抷抺抾抿拄拎拕拖拚拪拲拴拼拽挃挄挊挋挍挐挓挖挘挩挪挭挵挶挹挼捁捂捃捄捆捊捋捎捒捓捔捘捛捥捦捬捭捱捴捵\"],[\"8fc0a1\",\"捸捼捽捿掂掄掇掊掐掔掕掙掚掞掤掦掭掮掯掽揁揅揈揎揑揓揔揕揜揠揥揪揬揲揳揵揸揹搉搊搐搒搔搘搞搠搢搤搥搩搪搯搰搵搽搿摋摏摑摒摓摔摚摛摜摝摟摠摡摣摭摳摴摻摽撅撇撏撐撑撘撙撛撝撟撡撣撦撨撬撳撽撾撿\"],[\"8fc1a1\",\"擄擉擊擋擌擎擐擑擕擗擤擥擩擪擭擰擵擷擻擿攁攄攈攉攊攏攓攔攖攙攛攞攟攢攦攩攮攱攺攼攽敃敇敉敐敒敔敟敠敧敫敺敽斁斅斊斒斕斘斝斠斣斦斮斲斳斴斿旂旈旉旎旐旔旖旘旟旰旲旴旵旹旾旿昀昄昈昉昍昑昒昕昖昝\"],[\"8fc2a1\",\"昞昡昢昣昤昦昩昪昫昬昮昰昱昳昹昷晀晅晆晊晌晑晎晗晘晙晛晜晠晡曻晪晫晬晾晳晵晿晷晸晹晻暀晼暋暌暍暐暒暙暚暛暜暟暠暤暭暱暲暵暻暿曀曂曃曈曌曎曏曔曛曟曨曫曬曮曺朅朇朎朓朙朜朠朢朳朾杅杇杈杌杔杕杝\"],[\"8fc3a1\",\"杦杬杮杴杶杻极构枎枏枑枓枖枘枙枛枰枱枲枵枻枼枽柹柀柂柃柅柈柉柒柗柙柜柡柦柰柲柶柷桒栔栙栝栟栨栧栬栭栯栰栱栳栻栿桄桅桊桌桕桗桘桛桫桮\",4,\"桵桹桺桻桼梂梄梆梈梖梘梚梜梡梣梥梩梪梮梲梻棅棈棌棏\"],[\"8fc4a1\",\"棐棑棓棖棙棜棝棥棨棪棫棬棭棰棱棵棶棻棼棽椆椉椊椐椑椓椖椗椱椳椵椸椻楂楅楉楎楗楛楣楤楥楦楨楩楬楰楱楲楺楻楿榀榍榒榖榘榡榥榦榨榫榭榯榷榸榺榼槅槈槑槖槗槢槥槮槯槱槳槵槾樀樁樃樏樑樕樚樝樠樤樨樰樲\"],[\"8fc5a1\",\"樴樷樻樾樿橅橆橉橊橎橐橑橒橕橖橛橤橧橪橱橳橾檁檃檆檇檉檋檑檛檝檞檟檥檫檯檰檱檴檽檾檿櫆櫉櫈櫌櫐櫔櫕櫖櫜櫝櫤櫧櫬櫰櫱櫲櫼櫽欂欃欆欇欉欏欐欑欗欛欞欤欨欫欬欯欵欶欻欿歆歊歍歒歖歘歝歠歧歫歮歰歵歽\"],[\"8fc6a1\",\"歾殂殅殗殛殟殠殢殣殨殩殬殭殮殰殸殹殽殾毃毄毉毌毖毚毡毣毦毧毮毱毷毹毿氂氄氅氉氍氎氐氒氙氟氦氧氨氬氮氳氵氶氺氻氿汊汋汍汏汒汔汙汛汜汫汭汯汴汶汸汹汻沅沆沇沉沔沕沗沘沜沟沰沲沴泂泆泍泏泐泑泒泔泖\"],[\"8fc7a1\",\"泚泜泠泧泩泫泬泮泲泴洄洇洊洎洏洑洓洚洦洧洨汧洮洯洱洹洼洿浗浞浟浡浥浧浯浰浼涂涇涑涒涔涖涗涘涪涬涴涷涹涽涿淄淈淊淎淏淖淛淝淟淠淢淥淩淯淰淴淶淼渀渄渞渢渧渲渶渹渻渼湄湅湈湉湋湏湑湒湓湔湗湜湝湞\"],[\"8fc8a1\",\"湢湣湨湳湻湽溍溓溙溠溧溭溮溱溳溻溿滀滁滃滇滈滊滍滎滏滫滭滮滹滻滽漄漈漊漌漍漖漘漚漛漦漩漪漯漰漳漶漻漼漭潏潑潒潓潗潙潚潝潞潡潢潨潬潽潾澃澇澈澋澌澍澐澒澓澔澖澚澟澠澥澦澧澨澮澯澰澵澶澼濅濇濈濊\"],[\"8fc9a1\",\"濚濞濨濩濰濵濹濼濽瀀瀅瀆瀇瀍瀗瀠瀣瀯瀴瀷瀹瀼灃灄灈灉灊灋灔灕灝灞灎灤灥灬灮灵灶灾炁炅炆炔\",4,\"炛炤炫炰炱炴炷烊烑烓烔烕烖烘烜烤烺焃\",4,\"焋焌焏焞焠焫焭焯焰焱焸煁煅煆煇煊煋煐煒煗煚煜煞煠\"],[\"8fcaa1\",\"煨煹熀熅熇熌熒熚熛熠熢熯熰熲熳熺熿燀燁燄燋燌燓燖燙燚燜燸燾爀爇爈爉爓爗爚爝爟爤爫爯爴爸爹牁牂牃牅牎牏牐牓牕牖牚牜牞牠牣牨牫牮牯牱牷牸牻牼牿犄犉犍犎犓犛犨犭犮犱犴犾狁狇狉狌狕狖狘狟狥狳狴狺狻\"],[\"8fcba1\",\"狾猂猄猅猇猋猍猒猓猘猙猞猢猤猧猨猬猱猲猵猺猻猽獃獍獐獒獖獘獝獞獟獠獦獧獩獫獬獮獯獱獷獹獼玀玁玃玅玆玎玐玓玕玗玘玜玞玟玠玢玥玦玪玫玭玵玷玹玼玽玿珅珆珉珋珌珏珒珓珖珙珝珡珣珦珧珩珴珵珷珹珺珻珽\"],[\"8fcca1\",\"珿琀琁琄琇琊琑琚琛琤琦琨\",9,\"琹瑀瑃瑄瑆瑇瑋瑍瑑瑒瑗瑝瑢瑦瑧瑨瑫瑭瑮瑱瑲璀璁璅璆璇璉璏璐璑璒璘璙璚璜璟璠璡璣璦璨璩璪璫璮璯璱璲璵璹璻璿瓈瓉瓌瓐瓓瓘瓚瓛瓞瓟瓤瓨瓪瓫瓯瓴瓺瓻瓼瓿甆\"],[\"8fcda1\",\"甒甖甗甠甡甤甧甩甪甯甶甹甽甾甿畀畃畇畈畎畐畒畗畞畟畡畯畱畹\",5,\"疁疅疐疒疓疕疙疜疢疤疴疺疿痀痁痄痆痌痎痏痗痜痟痠痡痤痧痬痮痯痱痹瘀瘂瘃瘄瘇瘈瘊瘌瘏瘒瘓瘕瘖瘙瘛瘜瘝瘞瘣瘥瘦瘩瘭瘲瘳瘵瘸瘹\"],[\"8fcea1\",\"瘺瘼癊癀癁癃癄癅癉癋癕癙癟癤癥癭癮癯癱癴皁皅皌皍皕皛皜皝皟皠皢\",6,\"皪皭皽盁盅盉盋盌盎盔盙盠盦盨盬盰盱盶盹盼眀眆眊眎眒眔眕眗眙眚眜眢眨眭眮眯眴眵眶眹眽眾睂睅睆睊睍睎睏睒睖睗睜睞睟睠睢\"],[\"8fcfa1\",\"睤睧睪睬睰睲睳睴睺睽瞀瞄瞌瞍瞔瞕瞖瞚瞟瞢瞧瞪瞮瞯瞱瞵瞾矃矉矑矒矕矙矞矟矠矤矦矪矬矰矱矴矸矻砅砆砉砍砎砑砝砡砢砣砭砮砰砵砷硃硄硇硈硌硎硒硜硞硠硡硣硤硨硪确硺硾碊碏碔碘碡碝碞碟碤碨碬碭碰碱碲碳\"],[\"8fd0a1\",\"碻碽碿磇磈磉磌磎磒磓磕磖磤磛磟磠磡磦磪磲磳礀磶磷磺磻磿礆礌礐礚礜礞礟礠礥礧礩礭礱礴礵礻礽礿祄祅祆祊祋祏祑祔祘祛祜祧祩祫祲祹祻祼祾禋禌禑禓禔禕禖禘禛禜禡禨禩禫禯禱禴禸离秂秄秇秈秊秏秔秖秚秝秞\"],[\"8fd1a1\",\"秠秢秥秪秫秭秱秸秼稂稃稇稉稊稌稑稕稛稞稡稧稫稭稯稰稴稵稸稹稺穄穅穇穈穌穕穖穙穜穝穟穠穥穧穪穭穵穸穾窀窂窅窆窊窋窐窑窔窞窠窣窬窳窵窹窻窼竆竉竌竎竑竛竨竩竫竬竱竴竻竽竾笇笔笟笣笧笩笪笫笭笮笯笰\"],[\"8fd2a1\",\"笱笴笽笿筀筁筇筎筕筠筤筦筩筪筭筯筲筳筷箄箉箎箐箑箖箛箞箠箥箬箯箰箲箵箶箺箻箼箽篂篅篈篊篔篖篗篙篚篛篨篪篲篴篵篸篹篺篼篾簁簂簃簄簆簉簋簌簎簏簙簛簠簥簦簨簬簱簳簴簶簹簺籆籊籕籑籒籓籙\",5],[\"8fd3a1\",\"籡籣籧籩籭籮籰籲籹籼籽粆粇粏粔粞粠粦粰粶粷粺粻粼粿糄糇糈糉糍糏糓糔糕糗糙糚糝糦糩糫糵紃紇紈紉紏紑紒紓紖紝紞紣紦紪紭紱紼紽紾絀絁絇絈絍絑絓絗絙絚絜絝絥絧絪絰絸絺絻絿綁綂綃綅綆綈綋綌綍綑綖綗綝\"],[\"8fd4a1\",\"綞綦綧綪綳綶綷綹緂\",4,\"緌緍緎緗緙縀緢緥緦緪緫緭緱緵緶緹緺縈縐縑縕縗縜縝縠縧縨縬縭縯縳縶縿繄繅繇繎繐繒繘繟繡繢繥繫繮繯繳繸繾纁纆纇纊纍纑纕纘纚纝纞缼缻缽缾缿罃罄罇罏罒罓罛罜罝罡罣罤罥罦罭\"],[\"8fd5a1\",\"罱罽罾罿羀羋羍羏羐羑羖羗羜羡羢羦羪羭羴羼羿翀翃翈翎翏翛翟翣翥翨翬翮翯翲翺翽翾翿耇耈耊耍耎耏耑耓耔耖耝耞耟耠耤耦耬耮耰耴耵耷耹耺耼耾聀聄聠聤聦聭聱聵肁肈肎肜肞肦肧肫肸肹胈胍胏胒胔胕胗胘胠胭胮\"],[\"8fd6a1\",\"胰胲胳胶胹胺胾脃脋脖脗脘脜脞脠脤脧脬脰脵脺脼腅腇腊腌腒腗腠腡腧腨腩腭腯腷膁膐膄膅膆膋膎膖膘膛膞膢膮膲膴膻臋臃臅臊臎臏臕臗臛臝臞臡臤臫臬臰臱臲臵臶臸臹臽臿舀舃舏舓舔舙舚舝舡舢舨舲舴舺艃艄艅艆\"],[\"8fd7a1\",\"艋艎艏艑艖艜艠艣艧艭艴艻艽艿芀芁芃芄芇芉芊芎芑芔芖芘芚芛芠芡芣芤芧芨芩芪芮芰芲芴芷芺芼芾芿苆苐苕苚苠苢苤苨苪苭苯苶苷苽苾茀茁茇茈茊茋荔茛茝茞茟茡茢茬茭茮茰茳茷茺茼茽荂荃荄荇荍荎荑荕荖荗荰荸\"],[\"8fd8a1\",\"荽荿莀莂莄莆莍莒莔莕莘莙莛莜莝莦莧莩莬莾莿菀菇菉菏菐菑菔菝荓菨菪菶菸菹菼萁萆萊萏萑萕萙莭萯萹葅葇葈葊葍葏葑葒葖葘葙葚葜葠葤葥葧葪葰葳葴葶葸葼葽蒁蒅蒒蒓蒕蒞蒦蒨蒩蒪蒯蒱蒴蒺蒽蒾蓀蓂蓇蓈蓌蓏蓓\"],[\"8fd9a1\",\"蓜蓧蓪蓯蓰蓱蓲蓷蔲蓺蓻蓽蔂蔃蔇蔌蔎蔐蔜蔞蔢蔣蔤蔥蔧蔪蔫蔯蔳蔴蔶蔿蕆蕏\",4,\"蕖蕙蕜\",6,\"蕤蕫蕯蕹蕺蕻蕽蕿薁薅薆薉薋薌薏薓薘薝薟薠薢薥薧薴薶薷薸薼薽薾薿藂藇藊藋藎薭藘藚藟藠藦藨藭藳藶藼\"],[\"8fdaa1\",\"藿蘀蘄蘅蘍蘎蘐蘑蘒蘘蘙蘛蘞蘡蘧蘩蘶蘸蘺蘼蘽虀虂虆虒虓虖虗虘虙虝虠\",4,\"虩虬虯虵虶虷虺蚍蚑蚖蚘蚚蚜蚡蚦蚧蚨蚭蚱蚳蚴蚵蚷蚸蚹蚿蛀蛁蛃蛅蛑蛒蛕蛗蛚蛜蛠蛣蛥蛧蚈蛺蛼蛽蜄蜅蜇蜋蜎蜏蜐蜓蜔蜙蜞蜟蜡蜣\"],[\"8fdba1\",\"蜨蜮蜯蜱蜲蜹蜺蜼蜽蜾蝀蝃蝅蝍蝘蝝蝡蝤蝥蝯蝱蝲蝻螃\",6,\"螋螌螐螓螕螗螘螙螞螠螣螧螬螭螮螱螵螾螿蟁蟈蟉蟊蟎蟕蟖蟙蟚蟜蟟蟢蟣蟤蟪蟫蟭蟱蟳蟸蟺蟿蠁蠃蠆蠉蠊蠋蠐蠙蠒蠓蠔蠘蠚蠛蠜蠞蠟蠨蠭蠮蠰蠲蠵\"],[\"8fdca1\",\"蠺蠼衁衃衅衈衉衊衋衎衑衕衖衘衚衜衟衠衤衩衱衹衻袀袘袚袛袜袟袠袨袪袺袽袾裀裊\",4,\"裑裒裓裛裞裧裯裰裱裵裷褁褆褍褎褏褕褖褘褙褚褜褠褦褧褨褰褱褲褵褹褺褾襀襂襅襆襉襏襒襗襚襛襜襡襢襣襫襮襰襳襵襺\"],[\"8fdda1\",\"襻襼襽覉覍覐覔覕覛覜覟覠覥覰覴覵覶覷覼觔\",4,\"觥觩觫觭觱觳觶觹觽觿訄訅訇訏訑訒訔訕訞訠訢訤訦訫訬訯訵訷訽訾詀詃詅詇詉詍詎詓詖詗詘詜詝詡詥詧詵詶詷詹詺詻詾詿誀誃誆誋誏誐誒誖誗誙誟誧誩誮誯誳\"],[\"8fdea1\",\"誶誷誻誾諃諆諈諉諊諑諓諔諕諗諝諟諬諰諴諵諶諼諿謅謆謋謑謜謞謟謊謭謰謷謼譂\",4,\"譈譒譓譔譙譍譞譣譭譶譸譹譼譾讁讄讅讋讍讏讔讕讜讞讟谸谹谽谾豅豇豉豋豏豑豓豔豗豘豛豝豙豣豤豦豨豩豭豳豵豶豻豾貆\"],[\"8fdfa1\",\"貇貋貐貒貓貙貛貜貤貹貺賅賆賉賋賏賖賕賙賝賡賨賬賯賰賲賵賷賸賾賿贁贃贉贒贗贛赥赩赬赮赿趂趄趈趍趐趑趕趞趟趠趦趫趬趯趲趵趷趹趻跀跅跆跇跈跊跎跑跔跕跗跙跤跥跧跬跰趼跱跲跴跽踁踄踅踆踋踑踔踖踠踡踢\"],[\"8fe0a1\",\"踣踦踧踱踳踶踷踸踹踽蹀蹁蹋蹍蹎蹏蹔蹛蹜蹝蹞蹡蹢蹩蹬蹭蹯蹰蹱蹹蹺蹻躂躃躉躐躒躕躚躛躝躞躢躧躩躭躮躳躵躺躻軀軁軃軄軇軏軑軔軜軨軮軰軱軷軹軺軭輀輂輇輈輏輐輖輗輘輞輠輡輣輥輧輨輬輭輮輴輵輶輷輺轀轁\"],[\"8fe1a1\",\"轃轇轏轑\",4,\"轘轝轞轥辝辠辡辤辥辦辵辶辸达迀迁迆迊迋迍运迒迓迕迠迣迤迨迮迱迵迶迻迾适逄逈逌逘逛逨逩逯逪逬逭逳逴逷逿遃遄遌遛遝遢遦遧遬遰遴遹邅邈邋邌邎邐邕邗邘邙邛邠邡邢邥邰邲邳邴邶邽郌邾郃\"],[\"8fe2a1\",\"郄郅郇郈郕郗郘郙郜郝郟郥郒郶郫郯郰郴郾郿鄀鄄鄅鄆鄈鄍鄐鄔鄖鄗鄘鄚鄜鄞鄠鄥鄢鄣鄧鄩鄮鄯鄱鄴鄶鄷鄹鄺鄼鄽酃酇酈酏酓酗酙酚酛酡酤酧酭酴酹酺酻醁醃醅醆醊醎醑醓醔醕醘醞醡醦醨醬醭醮醰醱醲醳醶醻醼醽醿\"],[\"8fe3a1\",\"釂釃釅釓釔釗釙釚釞釤釥釩釪釬\",5,\"釷釹釻釽鈀鈁鈄鈅鈆鈇鈉鈊鈌鈐鈒鈓鈖鈘鈜鈝鈣鈤鈥鈦鈨鈮鈯鈰鈳鈵鈶鈸鈹鈺鈼鈾鉀鉂鉃鉆鉇鉊鉍鉎鉏鉑鉘鉙鉜鉝鉠鉡鉥鉧鉨鉩鉮鉯鉰鉵\",4,\"鉻鉼鉽鉿銈銉銊銍銎銒銗\"],[\"8fe4a1\",\"銙銟銠銤銥銧銨銫銯銲銶銸銺銻銼銽銿\",4,\"鋅鋆鋇鋈鋋鋌鋍鋎鋐鋓鋕鋗鋘鋙鋜鋝鋟鋠鋡鋣鋥鋧鋨鋬鋮鋰鋹鋻鋿錀錂錈錍錑錔錕錜錝錞錟錡錤錥錧錩錪錳錴錶錷鍇鍈鍉鍐鍑鍒鍕鍗鍘鍚鍞鍤鍥鍧鍩鍪鍭鍯鍰鍱鍳鍴鍶\"],[\"8fe5a1\",\"鍺鍽鍿鎀鎁鎂鎈鎊鎋鎍鎏鎒鎕鎘鎛鎞鎡鎣鎤鎦鎨鎫鎴鎵鎶鎺鎩鏁鏄鏅鏆鏇鏉\",4,\"鏓鏙鏜鏞鏟鏢鏦鏧鏹鏷鏸鏺鏻鏽鐁鐂鐄鐈鐉鐍鐎鐏鐕鐖鐗鐟鐮鐯鐱鐲鐳鐴鐻鐿鐽鑃鑅鑈鑊鑌鑕鑙鑜鑟鑡鑣鑨鑫鑭鑮鑯鑱鑲钄钃镸镹\"],[\"8fe6a1\",\"镾閄閈閌閍閎閝閞閟閡閦閩閫閬閴閶閺閽閿闆闈闉闋闐闑闒闓闙闚闝闞闟闠闤闦阝阞阢阤阥阦阬阱阳阷阸阹阺阼阽陁陒陔陖陗陘陡陮陴陻陼陾陿隁隂隃隄隉隑隖隚隝隟隤隥隦隩隮隯隳隺雊雒嶲雘雚雝雞雟雩雯雱雺霂\"],[\"8fe7a1\",\"霃霅霉霚霛霝霡霢霣霨霱霳靁靃靊靎靏靕靗靘靚靛靣靧靪靮靳靶靷靸靻靽靿鞀鞉鞕鞖鞗鞙鞚鞞鞟鞢鞬鞮鞱鞲鞵鞶鞸鞹鞺鞼鞾鞿韁韄韅韇韉韊韌韍韎韐韑韔韗韘韙韝韞韠韛韡韤韯韱韴韷韸韺頇頊頙頍頎頔頖頜頞頠頣頦\"],[\"8fe8a1\",\"頫頮頯頰頲頳頵頥頾顄顇顊顑顒顓顖顗顙顚顢顣顥顦顪顬颫颭颮颰颴颷颸颺颻颿飂飅飈飌飡飣飥飦飧飪飳飶餂餇餈餑餕餖餗餚餛餜餟餢餦餧餫餱\",4,\"餹餺餻餼饀饁饆饇饈饍饎饔饘饙饛饜饞饟饠馛馝馟馦馰馱馲馵\"],[\"8fe9a1\",\"馹馺馽馿駃駉駓駔駙駚駜駞駧駪駫駬駰駴駵駹駽駾騂騃騄騋騌騐騑騖騞騠騢騣騤騧騭騮騳騵騶騸驇驁驄驊驋驌驎驑驔驖驝骪骬骮骯骲骴骵骶骹骻骾骿髁髃髆髈髎髐髒髕髖髗髛髜髠髤髥髧髩髬髲髳髵髹髺髽髿\",4],[\"8feaa1\",\"鬄鬅鬈鬉鬋鬌鬍鬎鬐鬒鬖鬙鬛鬜鬠鬦鬫鬭鬳鬴鬵鬷鬹鬺鬽魈魋魌魕魖魗魛魞魡魣魥魦魨魪\",4,\"魳魵魷魸魹魿鮀鮄鮅鮆鮇鮉鮊鮋鮍鮏鮐鮔鮚鮝鮞鮦鮧鮩鮬鮰鮱鮲鮷鮸鮻鮼鮾鮿鯁鯇鯈鯎鯐鯗鯘鯝鯟鯥鯧鯪鯫鯯鯳鯷鯸\"],[\"8feba1\",\"鯹鯺鯽鯿鰀鰂鰋鰏鰑鰖鰘鰙鰚鰜鰞鰢鰣鰦\",4,\"鰱鰵鰶鰷鰽鱁鱃鱄鱅鱉鱊鱎鱏鱐鱓鱔鱖鱘鱛鱝鱞鱟鱣鱩鱪鱜鱫鱨鱮鱰鱲鱵鱷鱻鳦鳲鳷鳹鴋鴂鴑鴗鴘鴜鴝鴞鴯鴰鴲鴳鴴鴺鴼鵅鴽鵂鵃鵇鵊鵓鵔鵟鵣鵢鵥鵩鵪鵫鵰鵶鵷鵻\"],[\"8feca1\",\"鵼鵾鶃鶄鶆鶊鶍鶎鶒鶓鶕鶖鶗鶘鶡鶪鶬鶮鶱鶵鶹鶼鶿鷃鷇鷉鷊鷔鷕鷖鷗鷚鷞鷟鷠鷥鷧鷩鷫鷮鷰鷳鷴鷾鸊鸂鸇鸎鸐鸑鸒鸕鸖鸙鸜鸝鹺鹻鹼麀麂麃麄麅麇麎麏麖麘麛麞麤麨麬麮麯麰麳麴麵黆黈黋黕黟黤黧黬黭黮黰黱黲黵\"],[\"8feda1\",\"黸黿鼂鼃鼉鼏鼐鼑鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿齁齃\",4,\"齓齕齖齗齘齚齝齞齨齩齭\",4,\"齳齵齺齽龏龐龑龒龔龖龗龞龡龢龣龥\"]]");
  45872. /***/ }),
  45873. /* 317 */
  45874. /***/ (function(module) {
  45875. module.exports = JSON.parse("{\"uChars\":[128,165,169,178,184,216,226,235,238,244,248,251,253,258,276,284,300,325,329,334,364,463,465,467,469,471,473,475,477,506,594,610,712,716,730,930,938,962,970,1026,1104,1106,8209,8215,8218,8222,8231,8241,8244,8246,8252,8365,8452,8454,8458,8471,8482,8556,8570,8596,8602,8713,8720,8722,8726,8731,8737,8740,8742,8748,8751,8760,8766,8777,8781,8787,8802,8808,8816,8854,8858,8870,8896,8979,9322,9372,9548,9588,9616,9622,9634,9652,9662,9672,9676,9680,9702,9735,9738,9793,9795,11906,11909,11913,11917,11928,11944,11947,11951,11956,11960,11964,11979,12284,12292,12312,12319,12330,12351,12436,12447,12535,12543,12586,12842,12850,12964,13200,13215,13218,13253,13263,13267,13270,13384,13428,13727,13839,13851,14617,14703,14801,14816,14964,15183,15471,15585,16471,16736,17208,17325,17330,17374,17623,17997,18018,18212,18218,18301,18318,18760,18811,18814,18820,18823,18844,18848,18872,19576,19620,19738,19887,40870,59244,59336,59367,59413,59417,59423,59431,59437,59443,59452,59460,59478,59493,63789,63866,63894,63976,63986,64016,64018,64021,64025,64034,64037,64042,65074,65093,65107,65112,65127,65132,65375,65510,65536],\"gbChars\":[0,36,38,45,50,81,89,95,96,100,103,104,105,109,126,133,148,172,175,179,208,306,307,308,309,310,311,312,313,341,428,443,544,545,558,741,742,749,750,805,819,820,7922,7924,7925,7927,7934,7943,7944,7945,7950,8062,8148,8149,8152,8164,8174,8236,8240,8262,8264,8374,8380,8381,8384,8388,8390,8392,8393,8394,8396,8401,8406,8416,8419,8424,8437,8439,8445,8482,8485,8496,8521,8603,8936,8946,9046,9050,9063,9066,9076,9092,9100,9108,9111,9113,9131,9162,9164,9218,9219,11329,11331,11334,11336,11346,11361,11363,11366,11370,11372,11375,11389,11682,11686,11687,11692,11694,11714,11716,11723,11725,11730,11736,11982,11989,12102,12336,12348,12350,12384,12393,12395,12397,12510,12553,12851,12962,12973,13738,13823,13919,13933,14080,14298,14585,14698,15583,15847,16318,16434,16438,16481,16729,17102,17122,17315,17320,17402,17418,17859,17909,17911,17915,17916,17936,17939,17961,18664,18703,18814,18962,19043,33469,33470,33471,33484,33485,33490,33497,33501,33505,33513,33520,33536,33550,37845,37921,37948,38029,38038,38064,38065,38066,38069,38075,38076,38078,39108,39109,39113,39114,39115,39116,39265,39394,189000]}");
  45876. /***/ }),
  45877. /* 318 */
  45878. /***/ (function(module) {
  45879. module.exports = JSON.parse("[[\"0\",\"\\u0000\",127],[\"8141\",\"갂갃갅갆갋\",4,\"갘갞갟갡갢갣갥\",6,\"갮갲갳갴\"],[\"8161\",\"갵갶갷갺갻갽갾갿걁\",9,\"걌걎\",5,\"걕\"],[\"8181\",\"걖걗걙걚걛걝\",18,\"걲걳걵걶걹걻\",4,\"겂겇겈겍겎겏겑겒겓겕\",6,\"겞겢\",5,\"겫겭겮겱\",6,\"겺겾겿곀곂곃곅곆곇곉곊곋곍\",7,\"곖곘\",7,\"곢곣곥곦곩곫곭곮곲곴곷\",4,\"곾곿괁괂괃괅괇\",4,\"괎괐괒괓\"],[\"8241\",\"괔괕괖괗괙괚괛괝괞괟괡\",7,\"괪괫괮\",5],[\"8261\",\"괶괷괹괺괻괽\",6,\"굆굈굊\",5,\"굑굒굓굕굖굗\"],[\"8281\",\"굙\",7,\"굢굤\",7,\"굮굯굱굲굷굸굹굺굾궀궃\",4,\"궊궋궍궎궏궑\",10,\"궞\",5,\"궥\",17,\"궸\",7,\"귂귃귅귆귇귉\",6,\"귒귔\",7,\"귝귞귟귡귢귣귥\",18],[\"8341\",\"귺귻귽귾긂\",5,\"긊긌긎\",5,\"긕\",7],[\"8361\",\"긝\",18,\"긲긳긵긶긹긻긼\"],[\"8381\",\"긽긾긿깂깄깇깈깉깋깏깑깒깓깕깗\",4,\"깞깢깣깤깦깧깪깫깭깮깯깱\",6,\"깺깾\",5,\"꺆\",5,\"꺍\",46,\"꺿껁껂껃껅\",6,\"껎껒\",5,\"껚껛껝\",8],[\"8441\",\"껦껧껩껪껬껮\",5,\"껵껶껷껹껺껻껽\",8],[\"8461\",\"꼆꼉꼊꼋꼌꼎꼏꼑\",18],[\"8481\",\"꼤\",7,\"꼮꼯꼱꼳꼵\",6,\"꼾꽀꽄꽅꽆꽇꽊\",5,\"꽑\",10,\"꽞\",5,\"꽦\",18,\"꽺\",5,\"꾁꾂꾃꾅꾆꾇꾉\",6,\"꾒꾓꾔꾖\",5,\"꾝\",26,\"꾺꾻꾽꾾\"],[\"8541\",\"꾿꿁\",5,\"꿊꿌꿏\",4,\"꿕\",6,\"꿝\",4],[\"8561\",\"꿢\",5,\"꿪\",5,\"꿲꿳꿵꿶꿷꿹\",6,\"뀂뀃\"],[\"8581\",\"뀅\",6,\"뀍뀎뀏뀑뀒뀓뀕\",6,\"뀞\",9,\"뀩\",26,\"끆끇끉끋끍끏끐끑끒끖끘끚끛끜끞\",29,\"끾끿낁낂낃낅\",6,\"낎낐낒\",5,\"낛낝낞낣낤\"],[\"8641\",\"낥낦낧낪낰낲낶낷낹낺낻낽\",6,\"냆냊\",5,\"냒\"],[\"8661\",\"냓냕냖냗냙\",6,\"냡냢냣냤냦\",10],[\"8681\",\"냱\",22,\"넊넍넎넏넑넔넕넖넗넚넞\",4,\"넦넧넩넪넫넭\",6,\"넶넺\",5,\"녂녃녅녆녇녉\",6,\"녒녓녖녗녙녚녛녝녞녟녡\",22,\"녺녻녽녾녿놁놃\",4,\"놊놌놎놏놐놑놕놖놗놙놚놛놝\"],[\"8741\",\"놞\",9,\"놩\",15],[\"8761\",\"놹\",18,\"뇍뇎뇏뇑뇒뇓뇕\"],[\"8781\",\"뇖\",5,\"뇞뇠\",7,\"뇪뇫뇭뇮뇯뇱\",7,\"뇺뇼뇾\",5,\"눆눇눉눊눍\",6,\"눖눘눚\",5,\"눡\",18,\"눵\",6,\"눽\",26,\"뉙뉚뉛뉝뉞뉟뉡\",6,\"뉪\",4],[\"8841\",\"뉯\",4,\"뉶\",5,\"뉽\",6,\"늆늇늈늊\",4],[\"8861\",\"늏늒늓늕늖늗늛\",4,\"늢늤늧늨늩늫늭늮늯늱늲늳늵늶늷\"],[\"8881\",\"늸\",15,\"닊닋닍닎닏닑닓\",4,\"닚닜닞닟닠닡닣닧닩닪닰닱닲닶닼닽닾댂댃댅댆댇댉\",6,\"댒댖\",5,\"댝\",54,\"덗덙덚덝덠덡덢덣\"],[\"8941\",\"덦덨덪덬덭덯덲덳덵덶덷덹\",6,\"뎂뎆\",5,\"뎍\"],[\"8961\",\"뎎뎏뎑뎒뎓뎕\",10,\"뎢\",5,\"뎩뎪뎫뎭\"],[\"8981\",\"뎮\",21,\"돆돇돉돊돍돏돑돒돓돖돘돚돜돞돟돡돢돣돥돦돧돩\",18,\"돽\",18,\"됑\",6,\"됙됚됛됝됞됟됡\",6,\"됪됬\",7,\"됵\",15],[\"8a41\",\"둅\",10,\"둒둓둕둖둗둙\",6,\"둢둤둦\"],[\"8a61\",\"둧\",4,\"둭\",18,\"뒁뒂\"],[\"8a81\",\"뒃\",4,\"뒉\",19,\"뒞\",5,\"뒥뒦뒧뒩뒪뒫뒭\",7,\"뒶뒸뒺\",5,\"듁듂듃듅듆듇듉\",6,\"듑듒듓듔듖\",5,\"듞듟듡듢듥듧\",4,\"듮듰듲\",5,\"듹\",26,\"딖딗딙딚딝\"],[\"8b41\",\"딞\",5,\"딦딫\",4,\"딲딳딵딶딷딹\",6,\"땂땆\"],[\"8b61\",\"땇땈땉땊땎땏땑땒땓땕\",6,\"땞땢\",8],[\"8b81\",\"땫\",52,\"떢떣떥떦떧떩떬떭떮떯떲떶\",4,\"떾떿뗁뗂뗃뗅\",6,\"뗎뗒\",5,\"뗙\",18,\"뗭\",18],[\"8c41\",\"똀\",15,\"똒똓똕똖똗똙\",4],[\"8c61\",\"똞\",6,\"똦\",5,\"똭\",6,\"똵\",5],[\"8c81\",\"똻\",12,\"뙉\",26,\"뙥뙦뙧뙩\",50,\"뚞뚟뚡뚢뚣뚥\",5,\"뚭뚮뚯뚰뚲\",16],[\"8d41\",\"뛃\",16,\"뛕\",8],[\"8d61\",\"뛞\",17,\"뛱뛲뛳뛵뛶뛷뛹뛺\"],[\"8d81\",\"뛻\",4,\"뜂뜃뜄뜆\",33,\"뜪뜫뜭뜮뜱\",6,\"뜺뜼\",7,\"띅띆띇띉띊띋띍\",6,\"띖\",9,\"띡띢띣띥띦띧띩\",6,\"띲띴띶\",5,\"띾띿랁랂랃랅\",6,\"랎랓랔랕랚랛랝랞\"],[\"8e41\",\"랟랡\",6,\"랪랮\",5,\"랶랷랹\",8],[\"8e61\",\"럂\",4,\"럈럊\",19],[\"8e81\",\"럞\",13,\"럮럯럱럲럳럵\",6,\"럾렂\",4,\"렊렋렍렎렏렑\",6,\"렚렜렞\",5,\"렦렧렩렪렫렭\",6,\"렶렺\",5,\"롁롂롃롅\",11,\"롒롔\",7,\"롞롟롡롢롣롥\",6,\"롮롰롲\",5,\"롹롺롻롽\",7],[\"8f41\",\"뢅\",7,\"뢎\",17],[\"8f61\",\"뢠\",7,\"뢩\",6,\"뢱뢲뢳뢵뢶뢷뢹\",4],[\"8f81\",\"뢾뢿룂룄룆\",5,\"룍룎룏룑룒룓룕\",7,\"룞룠룢\",5,\"룪룫룭룮룯룱\",6,\"룺룼룾\",5,\"뤅\",18,\"뤙\",6,\"뤡\",26,\"뤾뤿륁륂륃륅\",6,\"륍륎륐륒\",5],[\"9041\",\"륚륛륝륞륟륡\",6,\"륪륬륮\",5,\"륶륷륹륺륻륽\"],[\"9061\",\"륾\",5,\"릆릈릋릌릏\",15],[\"9081\",\"릟\",12,\"릮릯릱릲릳릵\",6,\"릾맀맂\",5,\"맊맋맍맓\",4,\"맚맜맟맠맢맦맧맩맪맫맭\",6,\"맶맻\",4,\"먂\",5,\"먉\",11,\"먖\",33,\"먺먻먽먾먿멁멃멄멅멆\"],[\"9141\",\"멇멊멌멏멐멑멒멖멗멙멚멛멝\",6,\"멦멪\",5],[\"9161\",\"멲멳멵멶멷멹\",9,\"몆몈몉몊몋몍\",5],[\"9181\",\"몓\",20,\"몪몭몮몯몱몳\",4,\"몺몼몾\",5,\"뫅뫆뫇뫉\",14,\"뫚\",33,\"뫽뫾뫿묁묂묃묅\",7,\"묎묐묒\",5,\"묙묚묛묝묞묟묡\",6],[\"9241\",\"묨묪묬\",7,\"묷묹묺묿\",4,\"뭆뭈뭊뭋뭌뭎뭑뭒\"],[\"9261\",\"뭓뭕뭖뭗뭙\",7,\"뭢뭤\",7,\"뭭\",4],[\"9281\",\"뭲\",21,\"뮉뮊뮋뮍뮎뮏뮑\",18,\"뮥뮦뮧뮩뮪뮫뮭\",6,\"뮵뮶뮸\",7,\"믁믂믃믅믆믇믉\",6,\"믑믒믔\",35,\"믺믻믽믾밁\"],[\"9341\",\"밃\",4,\"밊밎밐밒밓밙밚밠밡밢밣밦밨밪밫밬밮밯밲밳밵\"],[\"9361\",\"밶밷밹\",6,\"뱂뱆뱇뱈뱊뱋뱎뱏뱑\",8],[\"9381\",\"뱚뱛뱜뱞\",37,\"벆벇벉벊벍벏\",4,\"벖벘벛\",4,\"벢벣벥벦벩\",6,\"벲벶\",5,\"벾벿볁볂볃볅\",7,\"볎볒볓볔볖볗볙볚볛볝\",22,\"볷볹볺볻볽\"],[\"9441\",\"볾\",5,\"봆봈봊\",5,\"봑봒봓봕\",8],[\"9461\",\"봞\",5,\"봥\",6,\"봭\",12],[\"9481\",\"봺\",5,\"뵁\",6,\"뵊뵋뵍뵎뵏뵑\",6,\"뵚\",9,\"뵥뵦뵧뵩\",22,\"붂붃붅붆붋\",4,\"붒붔붖붗붘붛붝\",6,\"붥\",10,\"붱\",6,\"붹\",24],[\"9541\",\"뷒뷓뷖뷗뷙뷚뷛뷝\",11,\"뷪\",5,\"뷱\"],[\"9561\",\"뷲뷳뷵뷶뷷뷹\",6,\"븁븂븄븆\",5,\"븎븏븑븒븓\"],[\"9581\",\"븕\",6,\"븞븠\",35,\"빆빇빉빊빋빍빏\",4,\"빖빘빜빝빞빟빢빣빥빦빧빩빫\",4,\"빲빶\",4,\"빾빿뺁뺂뺃뺅\",6,\"뺎뺒\",5,\"뺚\",13,\"뺩\",14],[\"9641\",\"뺸\",23,\"뻒뻓\"],[\"9661\",\"뻕뻖뻙\",6,\"뻡뻢뻦\",5,\"뻭\",8],[\"9681\",\"뻶\",10,\"뼂\",5,\"뼊\",13,\"뼚뼞\",33,\"뽂뽃뽅뽆뽇뽉\",6,\"뽒뽓뽔뽖\",44],[\"9741\",\"뾃\",16,\"뾕\",8],[\"9761\",\"뾞\",17,\"뾱\",7],[\"9781\",\"뾹\",11,\"뿆\",5,\"뿎뿏뿑뿒뿓뿕\",6,\"뿝뿞뿠뿢\",89,\"쀽쀾쀿\"],[\"9841\",\"쁀\",16,\"쁒\",5,\"쁙쁚쁛\"],[\"9861\",\"쁝쁞쁟쁡\",6,\"쁪\",15],[\"9881\",\"쁺\",21,\"삒삓삕삖삗삙\",6,\"삢삤삦\",5,\"삮삱삲삷\",4,\"삾샂샃샄샆샇샊샋샍샎샏샑\",6,\"샚샞\",5,\"샦샧샩샪샫샭\",6,\"샶샸샺\",5,\"섁섂섃섅섆섇섉\",6,\"섑섒섓섔섖\",5,\"섡섢섥섨섩섪섫섮\"],[\"9941\",\"섲섳섴섵섷섺섻섽섾섿셁\",6,\"셊셎\",5,\"셖셗\"],[\"9961\",\"셙셚셛셝\",6,\"셦셪\",5,\"셱셲셳셵셶셷셹셺셻\"],[\"9981\",\"셼\",8,\"솆\",5,\"솏솑솒솓솕솗\",4,\"솞솠솢솣솤솦솧솪솫솭솮솯솱\",11,\"솾\",5,\"쇅쇆쇇쇉쇊쇋쇍\",6,\"쇕쇖쇙\",6,\"쇡쇢쇣쇥쇦쇧쇩\",6,\"쇲쇴\",7,\"쇾쇿숁숂숃숅\",6,\"숎숐숒\",5,\"숚숛숝숞숡숢숣\"],[\"9a41\",\"숤숥숦숧숪숬숮숰숳숵\",16],[\"9a61\",\"쉆쉇쉉\",6,\"쉒쉓쉕쉖쉗쉙\",6,\"쉡쉢쉣쉤쉦\"],[\"9a81\",\"쉧\",4,\"쉮쉯쉱쉲쉳쉵\",6,\"쉾슀슂\",5,\"슊\",5,\"슑\",6,\"슙슚슜슞\",5,\"슦슧슩슪슫슮\",5,\"슶슸슺\",33,\"싞싟싡싢싥\",5,\"싮싰싲싳싴싵싷싺싽싾싿쌁\",6,\"쌊쌋쌎쌏\"],[\"9b41\",\"쌐쌑쌒쌖쌗쌙쌚쌛쌝\",6,\"쌦쌧쌪\",8],[\"9b61\",\"쌳\",17,\"썆\",7],[\"9b81\",\"썎\",25,\"썪썫썭썮썯썱썳\",4,\"썺썻썾\",5,\"쎅쎆쎇쎉쎊쎋쎍\",50,\"쏁\",22,\"쏚\"],[\"9c41\",\"쏛쏝쏞쏡쏣\",4,\"쏪쏫쏬쏮\",5,\"쏶쏷쏹\",5],[\"9c61\",\"쏿\",8,\"쐉\",6,\"쐑\",9],[\"9c81\",\"쐛\",8,\"쐥\",6,\"쐭쐮쐯쐱쐲쐳쐵\",6,\"쐾\",9,\"쑉\",26,\"쑦쑧쑩쑪쑫쑭\",6,\"쑶쑷쑸쑺\",5,\"쒁\",18,\"쒕\",6,\"쒝\",12],[\"9d41\",\"쒪\",13,\"쒹쒺쒻쒽\",8],[\"9d61\",\"쓆\",25],[\"9d81\",\"쓠\",8,\"쓪\",5,\"쓲쓳쓵쓶쓷쓹쓻쓼쓽쓾씂\",9,\"씍씎씏씑씒씓씕\",6,\"씝\",10,\"씪씫씭씮씯씱\",6,\"씺씼씾\",5,\"앆앇앋앏앐앑앒앖앚앛앜앟앢앣앥앦앧앩\",6,\"앲앶\",5,\"앾앿얁얂얃얅얆얈얉얊얋얎얐얒얓얔\"],[\"9e41\",\"얖얙얚얛얝얞얟얡\",7,\"얪\",9,\"얶\"],[\"9e61\",\"얷얺얿\",4,\"엋엍엏엒엓엕엖엗엙\",6,\"엢엤엦엧\"],[\"9e81\",\"엨엩엪엫엯엱엲엳엵엸엹엺엻옂옃옄옉옊옋옍옎옏옑\",6,\"옚옝\",6,\"옦옧옩옪옫옯옱옲옶옸옺옼옽옾옿왂왃왅왆왇왉\",6,\"왒왖\",5,\"왞왟왡\",10,\"왭왮왰왲\",5,\"왺왻왽왾왿욁\",6,\"욊욌욎\",5,\"욖욗욙욚욛욝\",6,\"욦\"],[\"9f41\",\"욨욪\",5,\"욲욳욵욶욷욻\",4,\"웂웄웆\",5,\"웎\"],[\"9f61\",\"웏웑웒웓웕\",6,\"웞웟웢\",5,\"웪웫웭웮웯웱웲\"],[\"9f81\",\"웳\",4,\"웺웻웼웾\",5,\"윆윇윉윊윋윍\",6,\"윖윘윚\",5,\"윢윣윥윦윧윩\",6,\"윲윴윶윸윹윺윻윾윿읁읂읃읅\",4,\"읋읎읐읙읚읛읝읞읟읡\",6,\"읩읪읬\",7,\"읶읷읹읺읻읿잀잁잂잆잋잌잍잏잒잓잕잙잛\",4,\"잢잧\",4,\"잮잯잱잲잳잵잶잷\"],[\"a041\",\"잸잹잺잻잾쟂\",5,\"쟊쟋쟍쟏쟑\",6,\"쟙쟚쟛쟜\"],[\"a061\",\"쟞\",5,\"쟥쟦쟧쟩쟪쟫쟭\",13],[\"a081\",\"쟻\",4,\"젂젃젅젆젇젉젋\",4,\"젒젔젗\",4,\"젞젟젡젢젣젥\",6,\"젮젰젲\",5,\"젹젺젻젽젾젿졁\",6,\"졊졋졎\",5,\"졕\",26,\"졲졳졵졶졷졹졻\",4,\"좂좄좈좉좊좎\",5,\"좕\",7,\"좞좠좢좣좤\"],[\"a141\",\"좥좦좧좩\",18,\"좾좿죀죁\"],[\"a161\",\"죂죃죅죆죇죉죊죋죍\",6,\"죖죘죚\",5,\"죢죣죥\"],[\"a181\",\"죦\",14,\"죶\",5,\"죾죿줁줂줃줇\",4,\"줎 、。·‥…¨〃­―∥\∼‘’“”〔〕〈\",9,\"±×÷≠≤≥∞∴°′″℃Å¢£¥♂♀∠⊥⌒∂∇≡≒§※☆★○●◎◇◆□■△▲▽▼→←↑↓↔〓≪≫√∽∝∵∫∬∈∋⊆⊇⊂⊃∪∩∧∨¬\"],[\"a241\",\"줐줒\",5,\"줙\",18],[\"a261\",\"줭\",6,\"줵\",18],[\"a281\",\"쥈\",7,\"쥒쥓쥕쥖쥗쥙\",6,\"쥢쥤\",7,\"쥭쥮쥯⇒⇔∀∃´~ˇ˘˝˚˙¸˛¡¿ː∮∑∏¤℉‰◁◀▷▶♤♠♡♥♧♣⊙◈▣◐◑▒▤▥▨▧▦▩♨☏☎☜☞¶†‡↕↗↙↖↘♭♩♪♬㉿㈜№㏇™㏂㏘℡€®\"],[\"a341\",\"쥱쥲쥳쥵\",6,\"쥽\",10,\"즊즋즍즎즏\"],[\"a361\",\"즑\",6,\"즚즜즞\",16],[\"a381\",\"즯\",16,\"짂짃짅짆짉짋\",4,\"짒짔짗짘짛!\",58,\"₩]\",32,\" ̄\"],[\"a441\",\"짞짟짡짣짥짦짨짩짪짫짮짲\",5,\"짺짻짽짾짿쨁쨂쨃쨄\"],[\"a461\",\"쨅쨆쨇쨊쨎\",5,\"쨕쨖쨗쨙\",12],[\"a481\",\"쨦쨧쨨쨪\",28,\"ㄱ\",93],[\"a541\",\"쩇\",4,\"쩎쩏쩑쩒쩓쩕\",6,\"쩞쩢\",5,\"쩩쩪\"],[\"a561\",\"쩫\",17,\"쩾\",5,\"쪅쪆\"],[\"a581\",\"쪇\",16,\"쪙\",14,\"ⅰ\",9],[\"a5b0\",\"Ⅰ\",9],[\"a5c1\",\"Α\",16,\"Σ\",6],[\"a5e1\",\"α\",16,\"σ\",6],[\"a641\",\"쪨\",19,\"쪾쪿쫁쫂쫃쫅\"],[\"a661\",\"쫆\",5,\"쫎쫐쫒쫔쫕쫖쫗쫚\",5,\"쫡\",6],[\"a681\",\"쫨쫩쫪쫫쫭\",6,\"쫵\",18,\"쬉쬊─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂┒┑┚┙┖┕┎┍┞┟┡┢┦┧┩┪┭┮┱┲┵┶┹┺┽┾╀╁╃\",7],[\"a741\",\"쬋\",4,\"쬑쬒쬓쬕쬖쬗쬙\",6,\"쬢\",7],[\"a761\",\"쬪\",22,\"쭂쭃쭄\"],[\"a781\",\"쭅쭆쭇쭊쭋쭍쭎쭏쭑\",6,\"쭚쭛쭜쭞\",5,\"쭥\",7,\"㎕㎖㎗ℓ㎘㏄㎣㎤㎥㎦㎙\",9,\"㏊㎍㎎㎏㏏㎈㎉㏈㎧㎨㎰\",9,\"㎀\",4,\"㎺\",5,\"㎐\",4,\"Ω㏀㏁㎊㎋㎌㏖㏅㎭㎮㎯㏛㎩㎪㎫㎬㏝㏐㏓㏃㏉㏜㏆\"],[\"a841\",\"쭭\",10,\"쭺\",14],[\"a861\",\"쮉\",18,\"쮝\",6],[\"a881\",\"쮤\",19,\"쮹\",11,\"ÆЪĦ\"],[\"a8a6\",\"IJ\"],[\"a8a8\",\"ĿŁØŒºÞŦŊ\"],[\"a8b1\",\"㉠\",27,\"ⓐ\",25,\"①\",14,\"½⅓⅔¼¾⅛⅜⅝⅞\"],[\"a941\",\"쯅\",14,\"쯕\",10],[\"a961\",\"쯠쯡쯢쯣쯥쯦쯨쯪\",18],[\"a981\",\"쯽\",14,\"찎찏찑찒찓찕\",6,\"찞찟찠찣찤æđðħıijĸŀłøœßþŧŋʼn㈀\",27,\"⒜\",25,\"⑴\",14,\"¹²³⁴ⁿ₁₂₃₄\"],[\"aa41\",\"찥찦찪찫찭찯찱\",6,\"찺찿\",4,\"챆챇챉챊챋챍챎\"],[\"aa61\",\"챏\",4,\"챖챚\",5,\"챡챢챣챥챧챩\",6,\"챱챲\"],[\"aa81\",\"챳챴챶\",29,\"ぁ\",82],[\"ab41\",\"첔첕첖첗첚첛첝첞첟첡\",6,\"첪첮\",5,\"첶첷첹\"],[\"ab61\",\"첺첻첽\",6,\"쳆쳈쳊\",5,\"쳑쳒쳓쳕\",5],[\"ab81\",\"쳛\",8,\"쳥\",6,\"쳭쳮쳯쳱\",12,\"ァ\",85],[\"ac41\",\"쳾쳿촀촂\",5,\"촊촋촍촎촏촑\",6,\"촚촜촞촟촠\"],[\"ac61\",\"촡촢촣촥촦촧촩촪촫촭\",11,\"촺\",4],[\"ac81\",\"촿\",28,\"쵝쵞쵟А\",5,\"ЁЖ\",25],[\"acd1\",\"а\",5,\"ёж\",25],[\"ad41\",\"쵡쵢쵣쵥\",6,\"쵮쵰쵲\",5,\"쵹\",7],[\"ad61\",\"춁\",6,\"춉\",10,\"춖춗춙춚춛춝춞춟\"],[\"ad81\",\"춠춡춢춣춦춨춪\",5,\"춱\",18,\"췅\"],[\"ae41\",\"췆\",5,\"췍췎췏췑\",16],[\"ae61\",\"췢\",5,\"췩췪췫췭췮췯췱\",6,\"췺췼췾\",4],[\"ae81\",\"츃츅츆츇츉츊츋츍\",6,\"츕츖츗츘츚\",5,\"츢츣츥츦츧츩츪츫\"],[\"af41\",\"츬츭츮츯츲츴츶\",19],[\"af61\",\"칊\",13,\"칚칛칝칞칢\",5,\"칪칬\"],[\"af81\",\"칮\",5,\"칶칷칹칺칻칽\",6,\"캆캈캊\",5,\"캒캓캕캖캗캙\"],[\"b041\",\"캚\",5,\"캢캦\",5,\"캮\",12],[\"b061\",\"캻\",5,\"컂\",19],[\"b081\",\"컖\",13,\"컦컧컩컪컭\",6,\"컶컺\",5,\"가각간갇갈갉갊감\",7,\"같\",4,\"갠갤갬갭갯갰갱갸갹갼걀걋걍걔걘걜거걱건걷걸걺검겁것겄겅겆겉겊겋게겐겔겜겝겟겠겡겨격겪견겯결겸겹겻겼경곁계곈곌곕곗고곡곤곧골곪곬곯곰곱곳공곶과곽관괄괆\"],[\"b141\",\"켂켃켅켆켇켉\",6,\"켒켔켖\",5,\"켝켞켟켡켢켣\"],[\"b161\",\"켥\",6,\"켮켲\",5,\"켹\",11],[\"b181\",\"콅\",14,\"콖콗콙콚콛콝\",6,\"콦콨콪콫콬괌괍괏광괘괜괠괩괬괭괴괵괸괼굄굅굇굉교굔굘굡굣구국군굳굴굵굶굻굼굽굿궁궂궈궉권궐궜궝궤궷귀귁귄귈귐귑귓규균귤그극근귿글긁금급긋긍긔기긱긴긷길긺김깁깃깅깆깊까깍깎깐깔깖깜깝깟깠깡깥깨깩깬깰깸\"],[\"b241\",\"콭콮콯콲콳콵콶콷콹\",6,\"쾁쾂쾃쾄쾆\",5,\"쾍\"],[\"b261\",\"쾎\",18,\"쾢\",5,\"쾩\"],[\"b281\",\"쾪\",5,\"쾱\",18,\"쿅\",6,\"깹깻깼깽꺄꺅꺌꺼꺽꺾껀껄껌껍껏껐껑께껙껜껨껫껭껴껸껼꼇꼈꼍꼐꼬꼭꼰꼲꼴꼼꼽꼿꽁꽂꽃꽈꽉꽐꽜꽝꽤꽥꽹꾀꾄꾈꾐꾑꾕꾜꾸꾹꾼꿀꿇꿈꿉꿋꿍꿎꿔꿜꿨꿩꿰꿱꿴꿸뀀뀁뀄뀌뀐뀔뀜뀝뀨끄끅끈끊끌끎끓끔끕끗끙\"],[\"b341\",\"쿌\",19,\"쿢쿣쿥쿦쿧쿩\"],[\"b361\",\"쿪\",5,\"쿲쿴쿶\",5,\"쿽쿾쿿퀁퀂퀃퀅\",5],[\"b381\",\"퀋\",5,\"퀒\",5,\"퀙\",19,\"끝끼끽낀낄낌낍낏낑나낙낚난낟날낡낢남납낫\",4,\"낱낳내낵낸낼냄냅냇냈냉냐냑냔냘냠냥너넉넋넌널넒넓넘넙넛넜넝넣네넥넨넬넴넵넷넸넹녀녁년녈념녑녔녕녘녜녠노녹논놀놂놈놉놋농높놓놔놘놜놨뇌뇐뇔뇜뇝\"],[\"b441\",\"퀮\",5,\"퀶퀷퀹퀺퀻퀽\",6,\"큆큈큊\",5],[\"b461\",\"큑큒큓큕큖큗큙\",6,\"큡\",10,\"큮큯\"],[\"b481\",\"큱큲큳큵\",6,\"큾큿킀킂\",18,\"뇟뇨뇩뇬뇰뇹뇻뇽누눅눈눋눌눔눕눗눙눠눴눼뉘뉜뉠뉨뉩뉴뉵뉼늄늅늉느늑는늘늙늚늠늡늣능늦늪늬늰늴니닉닌닐닒님닙닛닝닢다닥닦단닫\",4,\"닳담답닷\",4,\"닿대댁댄댈댐댑댓댔댕댜더덕덖던덛덜덞덟덤덥\"],[\"b541\",\"킕\",14,\"킦킧킩킪킫킭\",5],[\"b561\",\"킳킶킸킺\",5,\"탂탃탅탆탇탊\",5,\"탒탖\",4],[\"b581\",\"탛탞탟탡탢탣탥\",6,\"탮탲\",5,\"탹\",11,\"덧덩덫덮데덱덴델뎀뎁뎃뎄뎅뎌뎐뎔뎠뎡뎨뎬도독돈돋돌돎돐돔돕돗동돛돝돠돤돨돼됐되된될됨됩됫됴두둑둔둘둠둡둣둥둬뒀뒈뒝뒤뒨뒬뒵뒷뒹듀듄듈듐듕드득든듣들듦듬듭듯등듸디딕딘딛딜딤딥딧딨딩딪따딱딴딸\"],[\"b641\",\"턅\",7,\"턎\",17],[\"b661\",\"턠\",15,\"턲턳턵턶턷턹턻턼턽턾\"],[\"b681\",\"턿텂텆\",5,\"텎텏텑텒텓텕\",6,\"텞텠텢\",5,\"텩텪텫텭땀땁땃땄땅땋때땍땐땔땜땝땟땠땡떠떡떤떨떪떫떰떱떳떴떵떻떼떽뗀뗄뗌뗍뗏뗐뗑뗘뗬또똑똔똘똥똬똴뙈뙤뙨뚜뚝뚠뚤뚫뚬뚱뛔뛰뛴뛸뜀뜁뜅뜨뜩뜬뜯뜰뜸뜹뜻띄띈띌띔띕띠띤띨띰띱띳띵라락란랄람랍랏랐랑랒랖랗\"],[\"b741\",\"텮\",13,\"텽\",6,\"톅톆톇톉톊\"],[\"b761\",\"톋\",20,\"톢톣톥톦톧\"],[\"b781\",\"톩\",6,\"톲톴톶톷톸톹톻톽톾톿퇁\",14,\"래랙랜랠램랩랫랬랭랴략랸럇량러럭런럴럼럽럿렀렁렇레렉렌렐렘렙렛렝려력련렬렴렵렷렸령례롄롑롓로록론롤롬롭롯롱롸롼뢍뢨뢰뢴뢸룀룁룃룅료룐룔룝룟룡루룩룬룰룸룹룻룽뤄뤘뤠뤼뤽륀륄륌륏륑류륙륜률륨륩\"],[\"b841\",\"퇐\",7,\"퇙\",17],[\"b861\",\"퇫\",8,\"퇵퇶퇷퇹\",13],[\"b881\",\"툈툊\",5,\"툑\",24,\"륫륭르륵른를름릅릇릉릊릍릎리릭린릴림립릿링마막만많\",4,\"맘맙맛망맞맡맣매맥맨맬맴맵맷맸맹맺먀먁먈먕머먹먼멀멂멈멉멋멍멎멓메멕멘멜멤멥멧멨멩며멱면멸몃몄명몇몌모목몫몬몰몲몸몹못몽뫄뫈뫘뫙뫼\"],[\"b941\",\"툪툫툮툯툱툲툳툵\",6,\"툾퉀퉂\",5,\"퉉퉊퉋퉌\"],[\"b961\",\"퉍\",14,\"퉝\",6,\"퉥퉦퉧퉨\"],[\"b981\",\"퉩\",22,\"튂튃튅튆튇튉튊튋튌묀묄묍묏묑묘묜묠묩묫무묵묶문묻물묽묾뭄뭅뭇뭉뭍뭏뭐뭔뭘뭡뭣뭬뮈뮌뮐뮤뮨뮬뮴뮷므믄믈믐믓미믹민믿밀밂밈밉밋밌밍및밑바\",4,\"받\",4,\"밤밥밧방밭배백밴밸뱀뱁뱃뱄뱅뱉뱌뱍뱐뱝버벅번벋벌벎범법벗\"],[\"ba41\",\"튍튎튏튒튓튔튖\",5,\"튝튞튟튡튢튣튥\",6,\"튭\"],[\"ba61\",\"튮튯튰튲\",5,\"튺튻튽튾틁틃\",4,\"틊틌\",5],[\"ba81\",\"틒틓틕틖틗틙틚틛틝\",6,\"틦\",9,\"틲틳틵틶틷틹틺벙벚베벡벤벧벨벰벱벳벴벵벼벽변별볍볏볐병볕볘볜보복볶본볼봄봅봇봉봐봔봤봬뵀뵈뵉뵌뵐뵘뵙뵤뵨부북분붇불붉붊붐붑붓붕붙붚붜붤붰붸뷔뷕뷘뷜뷩뷰뷴뷸븀븃븅브븍븐블븜븝븟비빅빈빌빎빔빕빗빙빚빛빠빡빤\"],[\"bb41\",\"틻\",4,\"팂팄팆\",5,\"팏팑팒팓팕팗\",4,\"팞팢팣\"],[\"bb61\",\"팤팦팧팪팫팭팮팯팱\",6,\"팺팾\",5,\"퍆퍇퍈퍉\"],[\"bb81\",\"퍊\",31,\"빨빪빰빱빳빴빵빻빼빽뺀뺄뺌뺍뺏뺐뺑뺘뺙뺨뻐뻑뻔뻗뻘뻠뻣뻤뻥뻬뼁뼈뼉뼘뼙뼛뼜뼝뽀뽁뽄뽈뽐뽑뽕뾔뾰뿅뿌뿍뿐뿔뿜뿟뿡쀼쁑쁘쁜쁠쁨쁩삐삑삔삘삠삡삣삥사삭삯산삳살삵삶삼삽삿샀상샅새색샌샐샘샙샛샜생샤\"],[\"bc41\",\"퍪\",17,\"퍾퍿펁펂펃펅펆펇\"],[\"bc61\",\"펈펉펊펋펎펒\",5,\"펚펛펝펞펟펡\",6,\"펪펬펮\"],[\"bc81\",\"펯\",4,\"펵펶펷펹펺펻펽\",6,\"폆폇폊\",5,\"폑\",5,\"샥샨샬샴샵샷샹섀섄섈섐섕서\",4,\"섣설섦섧섬섭섯섰성섶세섹센셀셈셉셋셌셍셔셕션셜셤셥셧셨셩셰셴셸솅소속솎손솔솖솜솝솟송솥솨솩솬솰솽쇄쇈쇌쇔쇗쇘쇠쇤쇨쇰쇱쇳쇼쇽숀숄숌숍숏숑수숙순숟술숨숩숫숭\"],[\"bd41\",\"폗폙\",7,\"폢폤\",7,\"폮폯폱폲폳폵폶폷\"],[\"bd61\",\"폸폹폺폻폾퐀퐂\",5,\"퐉\",13],[\"bd81\",\"퐗\",5,\"퐞\",25,\"숯숱숲숴쉈쉐쉑쉔쉘쉠쉥쉬쉭쉰쉴쉼쉽쉿슁슈슉슐슘슛슝스슥슨슬슭슴습슷승시식신싣실싫심십싯싱싶싸싹싻싼쌀쌈쌉쌌쌍쌓쌔쌕쌘쌜쌤쌥쌨쌩썅써썩썬썰썲썸썹썼썽쎄쎈쎌쏀쏘쏙쏜쏟쏠쏢쏨쏩쏭쏴쏵쏸쐈쐐쐤쐬쐰\"],[\"be41\",\"퐸\",7,\"푁푂푃푅\",14],[\"be61\",\"푔\",7,\"푝푞푟푡푢푣푥\",7,\"푮푰푱푲\"],[\"be81\",\"푳\",4,\"푺푻푽푾풁풃\",4,\"풊풌풎\",5,\"풕\",8,\"쐴쐼쐽쑈쑤쑥쑨쑬쑴쑵쑹쒀쒔쒜쒸쒼쓩쓰쓱쓴쓸쓺쓿씀씁씌씐씔씜씨씩씬씰씸씹씻씽아악안앉않알앍앎앓암압앗았앙앝앞애액앤앨앰앱앳앴앵야약얀얄얇얌얍얏양얕얗얘얜얠얩어억언얹얻얼얽얾엄\",6,\"엌엎\"],[\"bf41\",\"풞\",10,\"풪\",14],[\"bf61\",\"풹\",18,\"퓍퓎퓏퓑퓒퓓퓕\"],[\"bf81\",\"퓖\",5,\"퓝퓞퓠\",7,\"퓩퓪퓫퓭퓮퓯퓱\",6,\"퓹퓺퓼에엑엔엘엠엡엣엥여역엮연열엶엷염\",5,\"옅옆옇예옌옐옘옙옛옜오옥온올옭옮옰옳옴옵옷옹옻와왁완왈왐왑왓왔왕왜왝왠왬왯왱외왹왼욀욈욉욋욍요욕욘욜욤욥욧용우욱운울욹욺움웁웃웅워웍원월웜웝웠웡웨\"],[\"c041\",\"퓾\",5,\"픅픆픇픉픊픋픍\",6,\"픖픘\",5],[\"c061\",\"픞\",25],[\"c081\",\"픸픹픺픻픾픿핁핂핃핅\",6,\"핎핐핒\",5,\"핚핛핝핞핟핡핢핣웩웬웰웸웹웽위윅윈윌윔윕윗윙유육윤율윰윱윳융윷으윽은을읊음읍읏응\",7,\"읜읠읨읫이익인일읽읾잃임입잇있잉잊잎자작잔잖잗잘잚잠잡잣잤장잦재잭잰잴잼잽잿쟀쟁쟈쟉쟌쟎쟐쟘쟝쟤쟨쟬저적전절젊\"],[\"c141\",\"핤핦핧핪핬핮\",5,\"핶핷핹핺핻핽\",6,\"햆햊햋\"],[\"c161\",\"햌햍햎햏햑\",19,\"햦햧\"],[\"c181\",\"햨\",31,\"점접젓정젖제젝젠젤젬젭젯젱져젼졀졈졉졌졍졔조족존졸졺좀좁좃종좆좇좋좌좍좔좝좟좡좨좼좽죄죈죌죔죕죗죙죠죡죤죵주죽준줄줅줆줌줍줏중줘줬줴쥐쥑쥔쥘쥠쥡쥣쥬쥰쥴쥼즈즉즌즐즘즙즛증지직진짇질짊짐집짓\"],[\"c241\",\"헊헋헍헎헏헑헓\",4,\"헚헜헞\",5,\"헦헧헩헪헫헭헮\"],[\"c261\",\"헯\",4,\"헶헸헺\",5,\"혂혃혅혆혇혉\",6,\"혒\"],[\"c281\",\"혖\",5,\"혝혞혟혡혢혣혥\",7,\"혮\",9,\"혺혻징짖짙짚짜짝짠짢짤짧짬짭짯짰짱째짹짼쨀쨈쨉쨋쨌쨍쨔쨘쨩쩌쩍쩐쩔쩜쩝쩟쩠쩡쩨쩽쪄쪘쪼쪽쫀쫄쫌쫍쫏쫑쫓쫘쫙쫠쫬쫴쬈쬐쬔쬘쬠쬡쭁쭈쭉쭌쭐쭘쭙쭝쭤쭸쭹쮜쮸쯔쯤쯧쯩찌찍찐찔찜찝찡찢찧차착찬찮찰참찹찻\"],[\"c341\",\"혽혾혿홁홂홃홄홆홇홊홌홎홏홐홒홓홖홗홙홚홛홝\",4],[\"c361\",\"홢\",4,\"홨홪\",5,\"홲홳홵\",11],[\"c381\",\"횁횂횄횆\",5,\"횎횏횑횒횓횕\",7,\"횞횠횢\",5,\"횩횪찼창찾채책챈챌챔챕챗챘챙챠챤챦챨챰챵처척천철첨첩첫첬청체첵첸첼쳄쳅쳇쳉쳐쳔쳤쳬쳰촁초촉촌촐촘촙촛총촤촨촬촹최쵠쵤쵬쵭쵯쵱쵸춈추축춘출춤춥춧충춰췄췌췐취췬췰췸췹췻췽츄츈츌츔츙츠측츤츨츰츱츳층\"],[\"c441\",\"횫횭횮횯횱\",7,\"횺횼\",7,\"훆훇훉훊훋\"],[\"c461\",\"훍훎훏훐훒훓훕훖훘훚\",5,\"훡훢훣훥훦훧훩\",4],[\"c481\",\"훮훯훱훲훳훴훶\",5,\"훾훿휁휂휃휅\",11,\"휒휓휔치칙친칟칠칡침칩칫칭카칵칸칼캄캅캇캉캐캑캔캘캠캡캣캤캥캬캭컁커컥컨컫컬컴컵컷컸컹케켁켄켈켐켑켓켕켜켠켤켬켭켯켰켱켸코콕콘콜콤콥콧콩콰콱콴콸쾀쾅쾌쾡쾨쾰쿄쿠쿡쿤쿨쿰쿱쿳쿵쿼퀀퀄퀑퀘퀭퀴퀵퀸퀼\"],[\"c541\",\"휕휖휗휚휛휝휞휟휡\",6,\"휪휬휮\",5,\"휶휷휹\"],[\"c561\",\"휺휻휽\",6,\"흅흆흈흊\",5,\"흒흓흕흚\",4],[\"c581\",\"흟흢흤흦흧흨흪흫흭흮흯흱흲흳흵\",6,\"흾흿힀힂\",5,\"힊힋큄큅큇큉큐큔큘큠크큭큰클큼큽킁키킥킨킬킴킵킷킹타탁탄탈탉탐탑탓탔탕태택탠탤탬탭탯탰탱탸턍터턱턴털턺텀텁텃텄텅테텍텐텔템텝텟텡텨텬텼톄톈토톡톤톨톰톱톳통톺톼퇀퇘퇴퇸툇툉툐투툭툰툴툼툽툿퉁퉈퉜\"],[\"c641\",\"힍힎힏힑\",6,\"힚힜힞\",5],[\"c6a1\",\"퉤튀튁튄튈튐튑튕튜튠튤튬튱트특튼튿틀틂틈틉틋틔틘틜틤틥티틱틴틸팀팁팃팅파팍팎판팔팖팜팝팟팠팡팥패팩팬팰팸팹팻팼팽퍄퍅퍼퍽펀펄펌펍펏펐펑페펙펜펠펨펩펫펭펴편펼폄폅폈평폐폘폡폣포폭폰폴폼폽폿퐁\"],[\"c7a1\",\"퐈퐝푀푄표푠푤푭푯푸푹푼푿풀풂품풉풋풍풔풩퓌퓐퓔퓜퓟퓨퓬퓰퓸퓻퓽프픈플픔픕픗피픽핀필핌핍핏핑하학한할핥함합핫항해핵핸핼햄햅햇했행햐향허헉헌헐헒험헙헛헝헤헥헨헬헴헵헷헹혀혁현혈혐협혓혔형혜혠\"],[\"c8a1\",\"혤혭호혹혼홀홅홈홉홋홍홑화확환활홧황홰홱홴횃횅회획횐횔횝횟횡효횬횰횹횻후훅훈훌훑훔훗훙훠훤훨훰훵훼훽휀휄휑휘휙휜휠휨휩휫휭휴휵휸휼흄흇흉흐흑흔흖흗흘흙흠흡흣흥흩희흰흴흼흽힁히힉힌힐힘힙힛힝\"],[\"caa1\",\"伽佳假價加可呵哥嘉嫁家暇架枷柯歌珂痂稼苛茄街袈訶賈跏軻迦駕刻却各恪慤殼珏脚覺角閣侃刊墾奸姦干幹懇揀杆柬桿澗癎看磵稈竿簡肝艮艱諫間乫喝曷渴碣竭葛褐蝎鞨勘坎堪嵌感憾戡敢柑橄減甘疳監瞰紺邯鑑鑒龕\"],[\"cba1\",\"匣岬甲胛鉀閘剛堈姜岡崗康强彊慷江畺疆糠絳綱羌腔舡薑襁講鋼降鱇介价個凱塏愷愾慨改槪漑疥皆盖箇芥蓋豈鎧開喀客坑更粳羹醵倨去居巨拒据據擧渠炬祛距踞車遽鉅鋸乾件健巾建愆楗腱虔蹇鍵騫乞傑杰桀儉劍劒檢\"],[\"cca1\",\"瞼鈐黔劫怯迲偈憩揭擊格檄激膈覡隔堅牽犬甄絹繭肩見譴遣鵑抉決潔結缺訣兼慊箝謙鉗鎌京俓倞傾儆勁勍卿坰境庚徑慶憬擎敬景暻更梗涇炅烱璟璥瓊痙硬磬竟競絅經耕耿脛莖警輕逕鏡頃頸驚鯨係啓堺契季屆悸戒桂械\"],[\"cda1\",\"棨溪界癸磎稽系繫繼計誡谿階鷄古叩告呱固姑孤尻庫拷攷故敲暠枯槁沽痼皐睾稿羔考股膏苦苽菰藁蠱袴誥賈辜錮雇顧高鼓哭斛曲梏穀谷鵠困坤崑昆梱棍滾琨袞鯤汨滑骨供公共功孔工恐恭拱控攻珙空蚣貢鞏串寡戈果瓜\"],[\"cea1\",\"科菓誇課跨過鍋顆廓槨藿郭串冠官寬慣棺款灌琯瓘管罐菅觀貫關館刮恝括适侊光匡壙廣曠洸炚狂珖筐胱鑛卦掛罫乖傀塊壞怪愧拐槐魁宏紘肱轟交僑咬喬嬌嶠巧攪敎校橋狡皎矯絞翹膠蕎蛟較轎郊餃驕鮫丘久九仇俱具勾\"],[\"cfa1\",\"區口句咎嘔坵垢寇嶇廐懼拘救枸柩構歐毆毬求溝灸狗玖球瞿矩究絿耉臼舅舊苟衢謳購軀逑邱鉤銶駒驅鳩鷗龜國局菊鞠鞫麴君窘群裙軍郡堀屈掘窟宮弓穹窮芎躬倦券勸卷圈拳捲權淃眷厥獗蕨蹶闕机櫃潰詭軌饋句晷歸貴\"],[\"d0a1\",\"鬼龜叫圭奎揆槻珪硅窺竅糾葵規赳逵閨勻均畇筠菌鈞龜橘克剋劇戟棘極隙僅劤勤懃斤根槿瑾筋芹菫覲謹近饉契今妗擒昑檎琴禁禽芩衾衿襟金錦伋及急扱汲級給亘兢矜肯企伎其冀嗜器圻基埼夔奇妓寄岐崎己幾忌技旗旣\"],[\"d1a1\",\"朞期杞棋棄機欺氣汽沂淇玘琦琪璂璣畸畿碁磯祁祇祈祺箕紀綺羈耆耭肌記譏豈起錡錤飢饑騎騏驥麒緊佶吉拮桔金喫儺喇奈娜懦懶拏拿癩\",5,\"那樂\",4,\"諾酪駱亂卵暖欄煖爛蘭難鸞捏捺南嵐枏楠湳濫男藍襤拉\"],[\"d2a1\",\"納臘蠟衲囊娘廊\",4,\"乃來內奈柰耐冷女年撚秊念恬拈捻寧寗努勞奴弩怒擄櫓爐瑙盧\",5,\"駑魯\",10,\"濃籠聾膿農惱牢磊腦賂雷尿壘\",7,\"嫩訥杻紐勒\",5,\"能菱陵尼泥匿溺多茶\"],[\"d3a1\",\"丹亶但單團壇彖斷旦檀段湍短端簞緞蛋袒鄲鍛撻澾獺疸達啖坍憺擔曇淡湛潭澹痰聃膽蕁覃談譚錟沓畓答踏遝唐堂塘幢戇撞棠當糖螳黨代垈坮大對岱帶待戴擡玳臺袋貸隊黛宅德悳倒刀到圖堵塗導屠島嶋度徒悼挑掉搗桃\"],[\"d4a1\",\"棹櫂淘渡滔濤燾盜睹禱稻萄覩賭跳蹈逃途道都鍍陶韜毒瀆牘犢獨督禿篤纛讀墩惇敦旽暾沌焞燉豚頓乭突仝冬凍動同憧東桐棟洞潼疼瞳童胴董銅兜斗杜枓痘竇荳讀豆逗頭屯臀芚遁遯鈍得嶝橙燈登等藤謄鄧騰喇懶拏癩羅\"],[\"d5a1\",\"蘿螺裸邏樂洛烙珞絡落諾酪駱丹亂卵欄欒瀾爛蘭鸞剌辣嵐擥攬欖濫籃纜藍襤覽拉臘蠟廊朗浪狼琅瑯螂郞來崍徠萊冷掠略亮倆兩凉梁樑粮粱糧良諒輛量侶儷勵呂廬慮戾旅櫚濾礪藜蠣閭驢驪麗黎力曆歷瀝礫轢靂憐戀攣漣\"],[\"d6a1\",\"煉璉練聯蓮輦連鍊冽列劣洌烈裂廉斂殮濂簾獵令伶囹寧岺嶺怜玲笭羚翎聆逞鈴零靈領齡例澧禮醴隷勞怒撈擄櫓潞瀘爐盧老蘆虜路輅露魯鷺鹵碌祿綠菉錄鹿麓論壟弄朧瀧瓏籠聾儡瀨牢磊賂賚賴雷了僚寮廖料燎療瞭聊蓼\"],[\"d7a1\",\"遼鬧龍壘婁屢樓淚漏瘻累縷蔞褸鏤陋劉旒柳榴流溜瀏琉瑠留瘤硫謬類六戮陸侖倫崙淪綸輪律慄栗率隆勒肋凜凌楞稜綾菱陵俚利厘吏唎履悧李梨浬犁狸理璃異痢籬罹羸莉裏裡里釐離鯉吝潾燐璘藺躪隣鱗麟林淋琳臨霖砬\"],[\"d8a1\",\"立笠粒摩瑪痲碼磨馬魔麻寞幕漠膜莫邈万卍娩巒彎慢挽晩曼滿漫灣瞞萬蔓蠻輓饅鰻唜抹末沫茉襪靺亡妄忘忙望網罔芒茫莽輞邙埋妹媒寐昧枚梅每煤罵買賣邁魅脈貊陌驀麥孟氓猛盲盟萌冪覓免冕勉棉沔眄眠綿緬面麵滅\"],[\"d9a1\",\"蔑冥名命明暝椧溟皿瞑茗蓂螟酩銘鳴袂侮冒募姆帽慕摸摹暮某模母毛牟牡瑁眸矛耗芼茅謀謨貌木沐牧目睦穆鶩歿沒夢朦蒙卯墓妙廟描昴杳渺猫竗苗錨務巫憮懋戊拇撫无楙武毋無珷畝繆舞茂蕪誣貿霧鵡墨默們刎吻問文\"],[\"daa1\",\"汶紊紋聞蚊門雯勿沕物味媚尾嵋彌微未梶楣渼湄眉米美薇謎迷靡黴岷悶愍憫敏旻旼民泯玟珉緡閔密蜜謐剝博拍搏撲朴樸泊珀璞箔粕縛膊舶薄迫雹駁伴半反叛拌搬攀斑槃泮潘班畔瘢盤盼磐磻礬絆般蟠返頒飯勃拔撥渤潑\"],[\"dba1\",\"發跋醱鉢髮魃倣傍坊妨尨幇彷房放方旁昉枋榜滂磅紡肪膀舫芳蒡蚌訪謗邦防龐倍俳北培徘拜排杯湃焙盃背胚裴裵褙賠輩配陪伯佰帛柏栢白百魄幡樊煩燔番磻繁蕃藩飜伐筏罰閥凡帆梵氾汎泛犯範范法琺僻劈壁擘檗璧癖\"],[\"dca1\",\"碧蘗闢霹便卞弁變辨辯邊別瞥鱉鼈丙倂兵屛幷昞昺柄棅炳甁病秉竝輧餠騈保堡報寶普步洑湺潽珤甫菩補褓譜輔伏僕匐卜宓復服福腹茯蔔複覆輹輻馥鰒本乶俸奉封峯峰捧棒烽熢琫縫蓬蜂逢鋒鳳不付俯傅剖副否咐埠夫婦\"],[\"dda1\",\"孚孵富府復扶敷斧浮溥父符簿缶腐腑膚艀芙莩訃負賦賻赴趺部釜阜附駙鳧北分吩噴墳奔奮忿憤扮昐汾焚盆粉糞紛芬賁雰不佛弗彿拂崩朋棚硼繃鵬丕備匕匪卑妃婢庇悲憊扉批斐枇榧比毖毗毘沸泌琵痺砒碑秕秘粃緋翡肥\"],[\"dea1\",\"脾臂菲蜚裨誹譬費鄙非飛鼻嚬嬪彬斌檳殯浜濱瀕牝玭貧賓頻憑氷聘騁乍事些仕伺似使俟僿史司唆嗣四士奢娑寫寺射巳師徙思捨斜斯柶査梭死沙泗渣瀉獅砂社祀祠私篩紗絲肆舍莎蓑蛇裟詐詞謝賜赦辭邪飼駟麝削數朔索\"],[\"dfa1\",\"傘刪山散汕珊産疝算蒜酸霰乷撒殺煞薩三參杉森渗芟蔘衫揷澁鈒颯上傷像償商喪嘗孀尙峠常床庠廂想桑橡湘爽牀狀相祥箱翔裳觴詳象賞霜塞璽賽嗇塞穡索色牲生甥省笙墅壻嶼序庶徐恕抒捿敍暑曙書栖棲犀瑞筮絮緖署\"],[\"e0a1\",\"胥舒薯西誓逝鋤黍鼠夕奭席惜昔晳析汐淅潟石碩蓆釋錫仙僊先善嬋宣扇敾旋渲煽琁瑄璇璿癬禪線繕羨腺膳船蘚蟬詵跣選銑鐥饍鮮卨屑楔泄洩渫舌薛褻設說雪齧剡暹殲纖蟾贍閃陝攝涉燮葉城姓宬性惺成星晟猩珹盛省筬\"],[\"e1a1\",\"聖聲腥誠醒世勢歲洗稅笹細說貰召嘯塑宵小少巢所掃搔昭梳沼消溯瀟炤燒甦疏疎瘙笑篠簫素紹蔬蕭蘇訴逍遡邵銷韶騷俗屬束涑粟續謖贖速孫巽損蓀遜飡率宋悚松淞訟誦送頌刷殺灑碎鎖衰釗修受嗽囚垂壽嫂守岫峀帥愁\"],[\"e2a1\",\"戍手授搜收數樹殊水洙漱燧狩獸琇璲瘦睡秀穗竪粹綏綬繡羞脩茱蒐蓚藪袖誰讐輸遂邃酬銖銹隋隧隨雖需須首髓鬚叔塾夙孰宿淑潚熟琡璹肅菽巡徇循恂旬栒楯橓殉洵淳珣盾瞬筍純脣舜荀蓴蕣詢諄醇錞順馴戌術述鉥崇崧\"],[\"e3a1\",\"嵩瑟膝蝨濕拾習褶襲丞乘僧勝升承昇繩蠅陞侍匙嘶始媤尸屎屍市弑恃施是時枾柴猜矢示翅蒔蓍視試詩諡豕豺埴寔式息拭植殖湜熄篒蝕識軾食飾伸侁信呻娠宸愼新晨燼申神紳腎臣莘薪藎蜃訊身辛辰迅失室實悉審尋心沁\"],[\"e4a1\",\"沈深瀋甚芯諶什十拾雙氏亞俄兒啞娥峨我牙芽莪蛾衙訝阿雅餓鴉鵝堊岳嶽幄惡愕握樂渥鄂鍔顎鰐齷安岸按晏案眼雁鞍顔鮟斡謁軋閼唵岩巖庵暗癌菴闇壓押狎鴨仰央怏昻殃秧鴦厓哀埃崖愛曖涯碍艾隘靄厄扼掖液縊腋額\"],[\"e5a1\",\"櫻罌鶯鸚也倻冶夜惹揶椰爺耶若野弱掠略約若葯蒻藥躍亮佯兩凉壤孃恙揚攘敭暘梁楊樣洋瀁煬痒瘍禳穰糧羊良襄諒讓釀陽量養圄御於漁瘀禦語馭魚齬億憶抑檍臆偃堰彦焉言諺孼蘖俺儼嚴奄掩淹嶪業円予余勵呂女如廬\"],[\"e6a1\",\"旅歟汝濾璵礖礪與艅茹輿轝閭餘驪麗黎亦力域役易曆歷疫繹譯轢逆驛嚥堧姸娟宴年延憐戀捐挻撚椽沇沿涎涓淵演漣烟然煙煉燃燕璉硏硯秊筵緣練縯聯衍軟輦蓮連鉛鍊鳶列劣咽悅涅烈熱裂說閱厭廉念捻染殮炎焰琰艶苒\"],[\"e7a1\",\"簾閻髥鹽曄獵燁葉令囹塋寧嶺嶸影怜映暎楹榮永泳渶潁濚瀛瀯煐營獰玲瑛瑩瓔盈穎纓羚聆英詠迎鈴鍈零霙靈領乂倪例刈叡曳汭濊猊睿穢芮藝蘂禮裔詣譽豫醴銳隸霓預五伍俉傲午吾吳嗚塢墺奧娛寤悟惡懊敖旿晤梧汚澳\"],[\"e8a1\",\"烏熬獒筽蜈誤鰲鼇屋沃獄玉鈺溫瑥瘟穩縕蘊兀壅擁瓮甕癰翁邕雍饔渦瓦窩窪臥蛙蝸訛婉完宛梡椀浣玩琓琬碗緩翫脘腕莞豌阮頑曰往旺枉汪王倭娃歪矮外嵬巍猥畏了僚僥凹堯夭妖姚寥寮尿嶢拗搖撓擾料曜樂橈燎燿瑤療\"],[\"e9a1\",\"窈窯繇繞耀腰蓼蟯要謠遙遼邀饒慾欲浴縟褥辱俑傭冗勇埇墉容庸慂榕涌湧溶熔瑢用甬聳茸蓉踊鎔鏞龍于佑偶優又友右宇寓尤愚憂旴牛玗瑀盂祐禑禹紆羽芋藕虞迂遇郵釪隅雨雩勖彧旭昱栯煜稶郁頊云暈橒殞澐熉耘芸蕓\"],[\"eaa1\",\"運隕雲韻蔚鬱亐熊雄元原員圓園垣媛嫄寃怨愿援沅洹湲源爰猿瑗苑袁轅遠阮院願鴛月越鉞位偉僞危圍委威尉慰暐渭爲瑋緯胃萎葦蔿蝟衛褘謂違韋魏乳侑儒兪劉唯喩孺宥幼幽庾悠惟愈愉揄攸有杻柔柚柳楡楢油洧流游溜\"],[\"eba1\",\"濡猶猷琉瑜由留癒硫紐維臾萸裕誘諛諭踰蹂遊逾遺酉釉鍮類六堉戮毓肉育陸倫允奫尹崙淪潤玧胤贇輪鈗閏律慄栗率聿戎瀜絨融隆垠恩慇殷誾銀隱乙吟淫蔭陰音飮揖泣邑凝應膺鷹依倚儀宜意懿擬椅毅疑矣義艤薏蟻衣誼\"],[\"eca1\",\"議醫二以伊利吏夷姨履已弛彛怡易李梨泥爾珥理異痍痢移罹而耳肄苡荑裏裡貽貳邇里離飴餌匿溺瀷益翊翌翼謚人仁刃印吝咽因姻寅引忍湮燐璘絪茵藺蚓認隣靭靷鱗麟一佚佾壹日溢逸鎰馹任壬妊姙恁林淋稔臨荏賃入卄\"],[\"eda1\",\"立笠粒仍剩孕芿仔刺咨姉姿子字孜恣慈滋炙煮玆瓷疵磁紫者自茨蔗藉諮資雌作勺嚼斫昨灼炸爵綽芍酌雀鵲孱棧殘潺盞岑暫潛箴簪蠶雜丈仗匠場墻壯奬將帳庄張掌暲杖樟檣欌漿牆狀獐璋章粧腸臟臧莊葬蔣薔藏裝贓醬長\"],[\"eea1\",\"障再哉在宰才材栽梓渽滓災縡裁財載齋齎爭箏諍錚佇低儲咀姐底抵杵楮樗沮渚狙猪疽箸紵苧菹著藷詛貯躇這邸雎齟勣吊嫡寂摘敵滴狄炙的積笛籍績翟荻謫賊赤跡蹟迪迹適鏑佃佺傳全典前剪塡塼奠專展廛悛戰栓殿氈澱\"],[\"efa1\",\"煎琠田甸畑癲筌箋箭篆纏詮輾轉鈿銓錢鐫電顚顫餞切截折浙癤竊節絶占岾店漸点粘霑鮎點接摺蝶丁井亭停偵呈姃定幀庭廷征情挺政整旌晶晸柾楨檉正汀淀淨渟湞瀞炡玎珽町睛碇禎程穽精綎艇訂諪貞鄭酊釘鉦鋌錠霆靖\"],[\"f0a1\",\"靜頂鼎制劑啼堤帝弟悌提梯濟祭第臍薺製諸蹄醍除際霽題齊俎兆凋助嘲弔彫措操早晁曺曹朝條棗槽漕潮照燥爪璪眺祖祚租稠窕粗糟組繰肇藻蚤詔調趙躁造遭釣阻雕鳥族簇足鏃存尊卒拙猝倧宗從悰慫棕淙琮種終綜縱腫\"],[\"f1a1\",\"踪踵鍾鐘佐坐左座挫罪主住侏做姝胄呪周嗾奏宙州廚晝朱柱株注洲湊澍炷珠疇籌紂紬綢舟蛛註誅走躊輳週酎酒鑄駐竹粥俊儁准埈寯峻晙樽浚準濬焌畯竣蠢逡遵雋駿茁中仲衆重卽櫛楫汁葺增憎曾拯烝甑症繒蒸證贈之只\"],[\"f2a1\",\"咫地址志持指摯支旨智枝枳止池沚漬知砥祉祗紙肢脂至芝芷蜘誌識贄趾遲直稙稷織職唇嗔塵振搢晉晋桭榛殄津溱珍瑨璡畛疹盡眞瞋秦縉縝臻蔯袗診賑軫辰進鎭陣陳震侄叱姪嫉帙桎瓆疾秩窒膣蛭質跌迭斟朕什執潗緝輯\"],[\"f3a1\",\"鏶集徵懲澄且侘借叉嗟嵯差次此磋箚茶蹉車遮捉搾着窄錯鑿齪撰澯燦璨瓚竄簒纂粲纘讚贊鑽餐饌刹察擦札紮僭參塹慘慙懺斬站讒讖倉倡創唱娼廠彰愴敞昌昶暢槍滄漲猖瘡窓脹艙菖蒼債埰寀寨彩採砦綵菜蔡采釵冊柵策\"],[\"f4a1\",\"責凄妻悽處倜刺剔尺慽戚拓擲斥滌瘠脊蹠陟隻仟千喘天川擅泉淺玔穿舛薦賤踐遷釧闡阡韆凸哲喆徹撤澈綴輟轍鐵僉尖沾添甛瞻簽籤詹諂堞妾帖捷牒疊睫諜貼輒廳晴淸聽菁請靑鯖切剃替涕滯締諦逮遞體初剿哨憔抄招梢\"],[\"f5a1\",\"椒楚樵炒焦硝礁礎秒稍肖艸苕草蕉貂超酢醋醮促囑燭矗蜀觸寸忖村邨叢塚寵悤憁摠總聰蔥銃撮催崔最墜抽推椎楸樞湫皺秋芻萩諏趨追鄒酋醜錐錘鎚雛騶鰍丑畜祝竺筑築縮蓄蹙蹴軸逐春椿瑃出朮黜充忠沖蟲衝衷悴膵萃\"],[\"f6a1\",\"贅取吹嘴娶就炊翠聚脆臭趣醉驟鷲側仄厠惻測層侈値嗤峙幟恥梔治淄熾痔痴癡稚穉緇緻置致蚩輜雉馳齒則勅飭親七柒漆侵寢枕沈浸琛砧針鍼蟄秤稱快他咤唾墮妥惰打拖朶楕舵陀馱駝倬卓啄坼度托拓擢晫柝濁濯琢琸託\"],[\"f7a1\",\"鐸呑嘆坦彈憚歎灘炭綻誕奪脫探眈耽貪塔搭榻宕帑湯糖蕩兌台太怠態殆汰泰笞胎苔跆邰颱宅擇澤撑攄兎吐土討慟桶洞痛筒統通堆槌腿褪退頹偸套妬投透鬪慝特闖坡婆巴把播擺杷波派爬琶破罷芭跛頗判坂板版瓣販辦鈑\"],[\"f8a1\",\"阪八叭捌佩唄悖敗沛浿牌狽稗覇貝彭澎烹膨愎便偏扁片篇編翩遍鞭騙貶坪平枰萍評吠嬖幣廢弊斃肺蔽閉陛佈包匍匏咆哺圃布怖抛抱捕暴泡浦疱砲胞脯苞葡蒲袍褒逋鋪飽鮑幅暴曝瀑爆輻俵剽彪慓杓標漂瓢票表豹飇飄驃\"],[\"f9a1\",\"品稟楓諷豊風馮彼披疲皮被避陂匹弼必泌珌畢疋筆苾馝乏逼下何厦夏廈昰河瑕荷蝦賀遐霞鰕壑學虐謔鶴寒恨悍旱汗漢澣瀚罕翰閑閒限韓割轄函含咸啣喊檻涵緘艦銜陷鹹合哈盒蛤閤闔陜亢伉姮嫦巷恒抗杭桁沆港缸肛航\"],[\"faa1\",\"行降項亥偕咳垓奚孩害懈楷海瀣蟹解該諧邂駭骸劾核倖幸杏荇行享向嚮珦鄕響餉饗香噓墟虛許憲櫶獻軒歇險驗奕爀赫革俔峴弦懸晛泫炫玄玹現眩睍絃絢縣舷衒見賢鉉顯孑穴血頁嫌俠協夾峽挾浹狹脅脇莢鋏頰亨兄刑型\"],[\"fba1\",\"形泂滎瀅灐炯熒珩瑩荊螢衡逈邢鎣馨兮彗惠慧暳蕙蹊醯鞋乎互呼壕壺好岵弧戶扈昊晧毫浩淏湖滸澔濠濩灝狐琥瑚瓠皓祜糊縞胡芦葫蒿虎號蝴護豪鎬頀顥惑或酷婚昏混渾琿魂忽惚笏哄弘汞泓洪烘紅虹訌鴻化和嬅樺火畵\"],[\"fca1\",\"禍禾花華話譁貨靴廓擴攫確碻穫丸喚奐宦幻患換歡晥桓渙煥環紈還驩鰥活滑猾豁闊凰幌徨恍惶愰慌晃晄榥況湟滉潢煌璜皇篁簧荒蝗遑隍黃匯回廻徊恢悔懷晦會檜淮澮灰獪繪膾茴蛔誨賄劃獲宖橫鐄哮嚆孝效斅曉梟涍淆\"],[\"fda1\",\"爻肴酵驍侯候厚后吼喉嗅帿後朽煦珝逅勛勳塤壎焄熏燻薰訓暈薨喧暄煊萱卉喙毁彙徽揮暉煇諱輝麾休携烋畦虧恤譎鷸兇凶匈洶胸黑昕欣炘痕吃屹紇訖欠欽歆吸恰洽翕興僖凞喜噫囍姬嬉希憙憘戱晞曦熙熹熺犧禧稀羲詰\"]]");
  45880. /***/ }),
  45881. /* 319 */
  45882. /***/ (function(module) {
  45883. module.exports = JSON.parse("[[\"8740\",\"䏰䰲䘃䖦䕸𧉧䵷䖳𧲱䳢𧳅㮕䜶䝄䱇䱀𤊿𣘗𧍒𦺋𧃒䱗𪍑䝏䗚䲅𧱬䴇䪤䚡𦬣爥𥩔𡩣𣸆𣽡晍囻\"],[\"8767\",\"綕夝𨮹㷴霴𧯯寛𡵞媤㘥𩺰嫑宷峼杮薓𩥅瑡璝㡵𡵓𣚞𦀡㻬\"],[\"87a1\",\"𥣞㫵竼龗𤅡𨤍𣇪𠪊𣉞䌊蒄龖鐯䤰蘓墖靊鈘秐稲晠権袝瑌篅枂稬剏遆㓦珄𥶹瓆鿇垳䤯呌䄱𣚎堘穲𧭥讏䚮𦺈䆁𥶙箮𢒼鿈𢓁𢓉𢓌鿉蔄𣖻䂴鿊䓡𪷿拁灮鿋\"],[\"8840\",\"㇀\",4,\"𠄌㇅𠃑𠃍㇆㇇𠃋𡿨㇈𠃊㇉㇊㇋㇌𠄎㇍㇎ĀÁǍÀĒÉĚÈŌÓǑÒ࿿Ê̄Ế࿿Ê̌ỀÊāáǎàɑēéěèīíǐìōóǒòūúǔùǖǘǚ\"],[\"88a1\",\"ǜü࿿ê̄ế࿿ê̌ềêɡ⏚⏛\"],[\"8940\",\"𪎩𡅅\"],[\"8943\",\"攊\"],[\"8946\",\"丽滝鵎釟\"],[\"894c\",\"𧜵撑会伨侨兖兴农凤务动医华发变团声处备夲头学实実岚庆总斉柾栄桥济炼电纤纬纺织经统缆缷艺苏药视设询车轧轮\"],[\"89a1\",\"琑糼緍楆竉刧\"],[\"89ab\",\"醌碸酞肼\"],[\"89b0\",\"贋胶𠧧\"],[\"89b5\",\"肟黇䳍鷉鸌䰾𩷶𧀎鸊𪄳㗁\"],[\"89c1\",\"溚舾甙\"],[\"89c5\",\"䤑马骏龙禇𨑬𡷊𠗐𢫦两亁亀亇亿仫伷㑌侽㹈倃傈㑽㒓㒥円夅凛凼刅争剹劐匧㗇厩㕑厰㕓参吣㕭㕲㚁咓咣咴咹哐哯唘唣唨㖘唿㖥㖿嗗㗅\"],[\"8a40\",\"𧶄唥\"],[\"8a43\",\"𠱂𠴕𥄫喐𢳆㧬𠍁蹆𤶸𩓥䁓𨂾睺𢰸㨴䟕𨅝𦧲𤷪擝𠵼𠾴𠳕𡃴撍蹾𠺖𠰋𠽤𢲩𨉖𤓓\"],[\"8a64\",\"𠵆𩩍𨃩䟴𤺧𢳂骲㩧𩗴㿭㔆𥋇𩟔𧣈𢵄鵮頕\"],[\"8a76\",\"䏙𦂥撴哣𢵌𢯊𡁷㧻𡁯\"],[\"8aa1\",\"𦛚𦜖𧦠擪𥁒𠱃蹨𢆡𨭌𠜱\"],[\"8aac\",\"䠋𠆩㿺塳𢶍\"],[\"8ab2\",\"𤗈𠓼𦂗𠽌𠶖啹䂻䎺\"],[\"8abb\",\"䪴𢩦𡂝膪飵𠶜捹㧾𢝵跀嚡摼㹃\"],[\"8ac9\",\"𪘁𠸉𢫏𢳉\"],[\"8ace\",\"𡃈𣧂㦒㨆𨊛㕸𥹉𢃇噒𠼱𢲲𩜠㒼氽𤸻\"],[\"8adf\",\"𧕴𢺋𢈈𪙛𨳍𠹺𠰴𦠜羓𡃏𢠃𢤹㗻𥇣𠺌𠾍𠺪㾓𠼰𠵇𡅏𠹌\"],[\"8af6\",\"𠺫𠮩𠵈𡃀𡄽㿹𢚖搲𠾭\"],[\"8b40\",\"𣏴𧘹𢯎𠵾𠵿𢱑𢱕㨘𠺘𡃇𠼮𪘲𦭐𨳒𨶙𨳊閪哌苄喹\"],[\"8b55\",\"𩻃鰦骶𧝞𢷮煀腭胬尜𦕲脴㞗卟𨂽醶𠻺𠸏𠹷𠻻㗝𤷫㘉𠳖嚯𢞵𡃉𠸐𠹸𡁸𡅈𨈇𡑕𠹹𤹐𢶤婔𡀝𡀞𡃵𡃶垜𠸑\"],[\"8ba1\",\"𧚔𨋍𠾵𠹻𥅾㜃𠾶𡆀𥋘𪊽𤧚𡠺𤅷𨉼墙剨㘚𥜽箲孨䠀䬬鼧䧧鰟鮍𥭴𣄽嗻㗲嚉丨夂𡯁屮靑𠂆乛亻㔾尣彑忄㣺扌攵歺氵氺灬爫丬犭𤣩罒礻糹罓𦉪㓁\"],[\"8bde\",\"𦍋耂肀𦘒𦥑卝衤见𧢲讠贝钅镸长门𨸏韦页风飞饣𩠐鱼鸟黄歯龜丷𠂇阝户钢\"],[\"8c40\",\"倻淾𩱳龦㷉袏𤅎灷峵䬠𥇍㕙𥴰愢𨨲辧釶熑朙玺𣊁𪄇㲋𡦀䬐磤琂冮𨜏䀉橣𪊺䈣蘏𠩯稪𩥇𨫪靕灍匤𢁾鏴盙𨧣龧矝亣俰傼丯众龨吴綋墒壐𡶶庒庙忂𢜒斋\"],[\"8ca1\",\"𣏹椙橃𣱣泿\"],[\"8ca7\",\"爀𤔅玌㻛𤨓嬕璹讃𥲤𥚕窓篬糃繬苸薗龩袐龪躹龫迏蕟駠鈡龬𨶹𡐿䁱䊢娚\"],[\"8cc9\",\"顨杫䉶圽\"],[\"8cce\",\"藖𤥻芿𧄍䲁𦵴嵻𦬕𦾾龭龮宖龯曧繛湗秊㶈䓃𣉖𢞖䎚䔶\"],[\"8ce6\",\"峕𣬚諹屸㴒𣕑嵸龲煗䕘𤃬𡸣䱷㥸㑊𠆤𦱁諌侴𠈹妿腬顖𩣺弻\"],[\"8d40\",\"𠮟\"],[\"8d42\",\"𢇁𨥭䄂䚻𩁹㼇龳𪆵䃸㟖䛷𦱆䅼𨚲𧏿䕭㣔𥒚䕡䔛䶉䱻䵶䗪㿈𤬏㙡䓞䒽䇭崾嵈嵖㷼㠏嶤嶹㠠㠸幂庽弥徃㤈㤔㤿㥍惗愽峥㦉憷憹懏㦸戬抐拥挘㧸嚱\"],[\"8da1\",\"㨃揢揻搇摚㩋擀崕嘡龟㪗斆㪽旿晓㫲暒㬢朖㭂枤栀㭘桊梄㭲㭱㭻椉楃牜楤榟榅㮼槖㯝橥橴橱檂㯬檙㯲檫檵櫔櫶殁毁毪汵沪㳋洂洆洦涁㳯涤涱渕渘温溆𨧀溻滢滚齿滨滩漤漴㵆𣽁澁澾㵪㵵熷岙㶊瀬㶑灐灔灯灿炉𠌥䏁㗱𠻘\"],[\"8e40\",\"𣻗垾𦻓焾𥟠㙎榢𨯩孴穉𥣡𩓙穥穽𥦬窻窰竂竃燑𦒍䇊竚竝竪䇯咲𥰁笋筕笩𥌎𥳾箢筯莜𥮴𦱿篐萡箒箸𥴠㶭𥱥蒒篺簆簵𥳁籄粃𤢂粦晽𤕸糉糇糦籴糳糵糎\"],[\"8ea1\",\"繧䔝𦹄絝𦻖璍綉綫焵綳緒𤁗𦀩緤㴓緵𡟹緥𨍭縝𦄡𦅚繮纒䌫鑬縧罀罁罇礶𦋐駡羗𦍑羣𡙡𠁨䕜𣝦䔃𨌺翺𦒉者耈耝耨耯𪂇𦳃耻耼聡𢜔䦉𦘦𣷣𦛨朥肧𨩈脇脚墰𢛶汿𦒘𤾸擧𡒊舘𡡞橓𤩥𤪕䑺舩𠬍𦩒𣵾俹𡓽蓢荢𦬊𤦧𣔰𡝳𣷸芪椛芳䇛\"],[\"8f40\",\"蕋苐茚𠸖𡞴㛁𣅽𣕚艻苢茘𣺋𦶣𦬅𦮗𣗎㶿茝嗬莅䔋𦶥莬菁菓㑾𦻔橗蕚㒖𦹂𢻯葘𥯤葱㷓䓤檧葊𣲵祘蒨𦮖𦹷𦹃蓞萏莑䒠蒓蓤𥲑䉀𥳀䕃蔴嫲𦺙䔧蕳䔖枿蘖\"],[\"8fa1\",\"𨘥𨘻藁𧂈蘂𡖂𧃍䕫䕪蘨㙈𡢢号𧎚虾蝱𪃸蟮𢰧螱蟚蠏噡虬桖䘏衅衆𧗠𣶹𧗤衞袜䙛袴袵揁装睷𧜏覇覊覦覩覧覼𨨥觧𧤤𧪽誜瞓釾誐𧩙竩𧬺𣾏䜓𧬸煼謌謟𥐰𥕥謿譌譍誩𤩺讐讛誯𡛟䘕衏貛𧵔𧶏貫㜥𧵓賖𧶘𧶽贒贃𡤐賛灜贑𤳉㻐起\"],[\"9040\",\"趩𨀂𡀔𤦊㭼𨆼𧄌竧躭躶軃鋔輙輭𨍥𨐒辥錃𪊟𠩐辳䤪𨧞𨔽𣶻廸𣉢迹𪀔𨚼𨔁𢌥㦀𦻗逷𨔼𧪾遡𨕬𨘋邨𨜓郄𨛦邮都酧㫰醩釄粬𨤳𡺉鈎沟鉁鉢𥖹銹𨫆𣲛𨬌𥗛\"],[\"90a1\",\"𠴱錬鍫𨫡𨯫炏嫃𨫢𨫥䥥鉄𨯬𨰹𨯿鍳鑛躼閅閦鐦閠濶䊹𢙺𨛘𡉼𣸮䧟氜陻隖䅬隣𦻕懚隶磵𨫠隽双䦡𦲸𠉴𦐐𩂯𩃥𤫑𡤕𣌊霱虂霶䨏䔽䖅𤫩灵孁霛靜𩇕靗孊𩇫靟鐥僐𣂷𣂼鞉鞟鞱鞾韀韒韠𥑬韮琜𩐳響韵𩐝𧥺䫑頴頳顋顦㬎𧅵㵑𠘰𤅜\"],[\"9140\",\"𥜆飊颷飈飇䫿𦴧𡛓喰飡飦飬鍸餹𤨩䭲𩡗𩤅駵騌騻騐驘𥜥㛄𩂱𩯕髠髢𩬅髴䰎鬔鬭𨘀倴鬴𦦨㣃𣁽魐魀𩴾婅𡡣鮎𤉋鰂鯿鰌𩹨鷔𩾷𪆒𪆫𪃡𪄣𪇟鵾鶃𪄴鸎梈\"],[\"91a1\",\"鷄𢅛𪆓𪈠𡤻𪈳鴹𪂹𪊴麐麕麞麢䴴麪麯𤍤黁㭠㧥㴝伲㞾𨰫鼂鼈䮖鐤𦶢鼗鼖鼹嚟嚊齅馸𩂋韲葿齢齩竜龎爖䮾𤥵𤦻煷𤧸𤍈𤩑玞𨯚𡣺禟𨥾𨸶鍩鏳𨩄鋬鎁鏋𨥬𤒹爗㻫睲穃烐𤑳𤏸煾𡟯炣𡢾𣖙㻇𡢅𥐯𡟸㜢𡛻𡠹㛡𡝴𡣑𥽋㜣𡛀坛𤨥𡏾𡊨\"],[\"9240\",\"𡏆𡒶蔃𣚦蔃葕𤦔𧅥𣸱𥕜𣻻𧁒䓴𣛮𩦝𦼦柹㜳㰕㷧塬𡤢栐䁗𣜿𤃡𤂋𤄏𦰡哋嚞𦚱嚒𠿟𠮨𠸍鏆𨬓鎜仸儫㠙𤐶亼𠑥𠍿佋侊𥙑婨𠆫𠏋㦙𠌊𠐔㐵伩𠋀𨺳𠉵諚𠈌亘\"],[\"92a1\",\"働儍侢伃𤨎𣺊佂倮偬傁俌俥偘僼兙兛兝兞湶𣖕𣸹𣺿浲𡢄𣺉冨凃𠗠䓝𠒣𠒒𠒑赺𨪜𠜎剙劤𠡳勡鍮䙺熌𤎌𠰠𤦬𡃤槑𠸝瑹㻞璙琔瑖玘䮎𤪼𤂍叐㖄爏𤃉喴𠍅响𠯆圝鉝雴鍦埝垍坿㘾壋媙𨩆𡛺𡝯𡜐娬妸銏婾嫏娒𥥆𡧳𡡡𤊕㛵洅瑃娡𥺃\"],[\"9340\",\"媁𨯗𠐓鏠璌𡌃焅䥲鐈𨧻鎽㞠尞岞幞幈𡦖𡥼𣫮廍孏𡤃𡤄㜁𡢠㛝𡛾㛓脪𨩇𡶺𣑲𨦨弌弎𡤧𡞫婫𡜻孄蘔𧗽衠恾𢡠𢘫忛㺸𢖯𢖾𩂈𦽳懀𠀾𠁆𢘛憙憘恵𢲛𢴇𤛔𩅍\"],[\"93a1\",\"摱𤙥𢭪㨩𢬢𣑐𩣪𢹸挷𪑛撶挱揑𤧣𢵧护𢲡搻敫楲㯴𣂎𣊭𤦉𣊫唍𣋠𡣙𩐿曎𣊉𣆳㫠䆐𥖄𨬢𥖏𡛼𥕛𥐥磮𣄃𡠪𣈴㑤𣈏𣆂𤋉暎𦴤晫䮓昰𧡰𡷫晣𣋒𣋡昞𥡲㣑𣠺𣞼㮙𣞢𣏾瓐㮖枏𤘪梶栞㯄檾㡣𣟕𤒇樳橒櫉欅𡤒攑梘橌㯗橺歗𣿀𣲚鎠鋲𨯪𨫋\"],[\"9440\",\"銉𨀞𨧜鑧涥漋𤧬浧𣽿㶏渄𤀼娽渊塇洤硂焻𤌚𤉶烱牐犇犔𤞏𤜥兹𤪤𠗫瑺𣻸𣙟𤩊𤤗𥿡㼆㺱𤫟𨰣𣼵悧㻳瓌琼鎇琷䒟𦷪䕑疃㽣𤳙𤴆㽘畕癳𪗆㬙瑨𨫌𤦫𤦎㫻\"],[\"94a1\",\"㷍𤩎㻿𤧅𤣳釺圲鍂𨫣𡡤僟𥈡𥇧睸𣈲眎眏睻𤚗𣞁㩞𤣰琸璛㺿𤪺𤫇䃈𤪖𦆮錇𥖁砞碍碈磒珐祙𧝁𥛣䄎禛蒖禥樭𣻺稺秴䅮𡛦䄲鈵秱𠵌𤦌𠊙𣶺𡝮㖗啫㕰㚪𠇔𠰍竢婙𢛵𥪯𥪜娍𠉛磰娪𥯆竾䇹籝籭䈑𥮳𥺼𥺦糍𤧹𡞰粎籼粮檲緜縇緓罎𦉡\"],[\"9540\",\"𦅜𧭈綗𥺂䉪𦭵𠤖柖𠁎𣗏埄𦐒𦏸𤥢翝笧𠠬𥫩𥵃笌𥸎駦虅驣樜𣐿㧢𤧷𦖭騟𦖠蒀𧄧𦳑䓪脷䐂胆脉腂𦞴飃𦩂艢艥𦩑葓𦶧蘐𧈛媆䅿𡡀嬫𡢡嫤𡣘蚠蜨𣶏蠭𧐢娂\"],[\"95a1\",\"衮佅袇袿裦襥襍𥚃襔𧞅𧞄𨯵𨯙𨮜𨧹㺭蒣䛵䛏㟲訽訜𩑈彍鈫𤊄旔焩烄𡡅鵭貟賩𧷜妚矃姰䍮㛔踪躧𤰉輰轊䋴汘澻𢌡䢛潹溋𡟚鯩㚵𤤯邻邗啱䤆醻鐄𨩋䁢𨫼鐧𨰝𨰻蓥訫閙閧閗閖𨴴瑅㻂𤣿𤩂𤏪㻧𣈥随𨻧𨹦𨹥㻌𤧭𤩸𣿮琒瑫㻼靁𩂰\"],[\"9640\",\"桇䨝𩂓𥟟靝鍨𨦉𨰦𨬯𦎾銺嬑譩䤼珹𤈛鞛靱餸𠼦巁𨯅𤪲頟𩓚鋶𩗗釥䓀𨭐𤩧𨭤飜𨩅㼀鈪䤥萔餻饍𧬆㷽馛䭯馪驜𨭥𥣈檏騡嫾騯𩣱䮐𩥈馼䮽䮗鍽塲𡌂堢𤦸\"],[\"96a1\",\"𡓨硄𢜟𣶸棅㵽鑘㤧慐𢞁𢥫愇鱏鱓鱻鰵鰐魿鯏𩸭鮟𪇵𪃾鴡䲮𤄄鸘䲰鴌𪆴𪃭𪃳𩤯鶥蒽𦸒𦿟𦮂藼䔳𦶤𦺄𦷰萠藮𦸀𣟗𦁤秢𣖜𣙀䤭𤧞㵢鏛銾鍈𠊿碹鉷鑍俤㑀遤𥕝砽硔碶硋𡝗𣇉𤥁㚚佲濚濙瀞瀞吔𤆵垻壳垊鴖埗焴㒯𤆬燫𦱀𤾗嬨𡞵𨩉\"],[\"9740\",\"愌嫎娋䊼𤒈㜬䭻𨧼鎻鎸𡣖𠼝葲𦳀𡐓𤋺𢰦𤏁妔𣶷𦝁綨𦅛𦂤𤦹𤦋𨧺鋥珢㻩璴𨭣𡢟㻡𤪳櫘珳珻㻖𤨾𤪔𡟙𤩦𠎧𡐤𤧥瑈𤤖炥𤥶銄珦鍟𠓾錱𨫎𨨖鎆𨯧𥗕䤵𨪂煫\"],[\"97a1\",\"𤥃𠳿嚤𠘚𠯫𠲸唂秄𡟺緾𡛂𤩐𡡒䔮鐁㜊𨫀𤦭妰𡢿𡢃𧒄媡㛢𣵛㚰鉟婹𨪁𡡢鍴㳍𠪴䪖㦊僴㵩㵌𡎜煵䋻𨈘渏𩃤䓫浗𧹏灧沯㳖𣿭𣸭渂漌㵯𠏵畑㚼㓈䚀㻚䡱姄鉮䤾轁𨰜𦯀堒埈㛖𡑒烾𤍢𤩱𢿣𡊰𢎽梹楧𡎘𣓥𧯴𣛟𨪃𣟖𣏺𤲟樚𣚭𦲷萾䓟䓎\"],[\"9840\",\"𦴦𦵑𦲂𦿞漗𧄉茽𡜺菭𦲀𧁓𡟛妉媂𡞳婡婱𡤅𤇼㜭姯𡜼㛇熎鎐暚𤊥婮娫𤊓樫𣻹𧜶𤑛𤋊焝𤉙𨧡侰𦴨峂𤓎𧹍𤎽樌𤉖𡌄炦焳𤏩㶥泟勇𤩏繥姫崯㷳彜𤩝𡟟綤萦\"],[\"98a1\",\"咅𣫺𣌀𠈔坾𠣕𠘙㿥𡾞𪊶瀃𩅛嵰玏糓𨩙𩐠俈翧狍猐𧫴猸猹𥛶獁獈㺩𧬘遬燵𤣲珡臶㻊県㻑沢国琙琞琟㻢㻰㻴㻺瓓㼎㽓畂畭畲疍㽼痈痜㿀癍㿗癴㿜発𤽜熈嘣覀塩䀝睃䀹条䁅㗛瞘䁪䁯属瞾矋売砘点砜䂨砹硇硑硦葈𥔵礳栃礲䄃\"],[\"9940\",\"䄉禑禙辻稆込䅧窑䆲窼艹䇄竏竛䇏両筢筬筻簒簛䉠䉺类粜䊌粸䊔糭输烀𠳏総緔緐緽羮羴犟䎗耠耥笹耮耱联㷌垴炠肷胩䏭脌猪脎脒畠脔䐁㬹腖腙腚\"],[\"99a1\",\"䐓堺腼膄䐥膓䐭膥埯臁臤艔䒏芦艶苊苘苿䒰荗险榊萅烵葤惣蒈䔄蒾蓡蓸蔐蔸蕒䔻蕯蕰藠䕷虲蚒蚲蛯际螋䘆䘗袮裿褤襇覑𧥧訩訸誔誴豑賔賲贜䞘塟跃䟭仮踺嗘坔蹱嗵躰䠷軎転軤軭軲辷迁迊迌逳駄䢭飠鈓䤞鈨鉘鉫銱銮銿\"],[\"9a40\",\"鋣鋫鋳鋴鋽鍃鎄鎭䥅䥑麿鐗匁鐝鐭鐾䥪鑔鑹锭関䦧间阳䧥枠䨤靀䨵鞲韂噔䫤惨颹䬙飱塄餎餙冴餜餷饂饝饢䭰駅䮝騼鬏窃魩鮁鯝鯱鯴䱭鰠㝯𡯂鵉鰺\"],[\"9aa1\",\"黾噐鶓鶽鷀鷼银辶鹻麬麱麽黆铜黢黱黸竈齄𠂔𠊷𠎠椚铃妬𠓗塀铁㞹𠗕𠘕𠙶𡚺块煳𠫂𠫍𠮿呪吆𠯋咞𠯻𠰻𠱓𠱥𠱼惧𠲍噺𠲵𠳝𠳭𠵯𠶲𠷈楕鰯螥𠸄𠸎𠻗𠾐𠼭𠹳尠𠾼帋𡁜𡁏𡁶朞𡁻𡂈𡂖㙇𡂿𡃓𡄯𡄻卤蒭𡋣𡍵𡌶讁𡕷𡘙𡟃𡟇乸炻𡠭𡥪\"],[\"9b40\",\"𡨭𡩅𡰪𡱰𡲬𡻈拃𡻕𡼕熘桕𢁅槩㛈𢉼𢏗𢏺𢜪𢡱𢥏苽𢥧𢦓𢫕覥𢫨辠𢬎鞸𢬿顇骽𢱌\"],[\"9b62\",\"𢲈𢲷𥯨𢴈𢴒𢶷𢶕𢹂𢽴𢿌𣀳𣁦𣌟𣏞徱晈暿𧩹𣕧𣗳爁𤦺矗𣘚𣜖纇𠍆墵朎\"],[\"9ba1\",\"椘𣪧𧙗𥿢𣸑𣺹𧗾𢂚䣐䪸𤄙𨪚𤋮𤌍𤀻𤌴𤎖𤩅𠗊凒𠘑妟𡺨㮾𣳿𤐄𤓖垈𤙴㦛𤜯𨗨𩧉㝢𢇃譞𨭎駖𤠒𤣻𤨕爉𤫀𠱸奥𤺥𤾆𠝹軚𥀬劏圿煱𥊙𥐙𣽊𤪧喼𥑆𥑮𦭒釔㑳𥔿𧘲𥕞䜘𥕢𥕦𥟇𤤿𥡝偦㓻𣏌惞𥤃䝼𨥈𥪮𥮉𥰆𡶐垡煑澶𦄂𧰒遖𦆲𤾚譢𦐂𦑊\"],[\"9c40\",\"嵛𦯷輶𦒄𡤜諪𤧶𦒈𣿯𦔒䯀𦖿𦚵𢜛鑥𥟡憕娧晉侻嚹𤔡𦛼乪𤤴陖涏𦲽㘘襷𦞙𦡮𦐑𦡞營𦣇筂𩃀𠨑𦤦鄄𦤹穅鷰𦧺騦𦨭㙟𦑩𠀡禃𦨴𦭛崬𣔙菏𦮝䛐𦲤画补𦶮墶\"],[\"9ca1\",\"㜜𢖍𧁋𧇍㱔𧊀𧊅銁𢅺𧊋錰𧋦𤧐氹钟𧑐𠻸蠧裵𢤦𨑳𡞱溸𤨪𡠠㦤㚹尐秣䔿暶𩲭𩢤襃𧟌𧡘囖䃟𡘊㦡𣜯𨃨𡏅熭荦𧧝𩆨婧䲷𧂯𨦫𧧽𧨊𧬋𧵦𤅺筃祾𨀉澵𪋟樃𨌘厢𦸇鎿栶靝𨅯𨀣𦦵𡏭𣈯𨁈嶅𨰰𨂃圕頣𨥉嶫𤦈斾槕叒𤪥𣾁㰑朶𨂐𨃴𨄮𡾡𨅏\"],[\"9d40\",\"𨆉𨆯𨈚𨌆𨌯𨎊㗊𨑨𨚪䣺揦𨥖砈鉕𨦸䏲𨧧䏟𨧨𨭆𨯔姸𨰉輋𨿅𩃬筑𩄐𩄼㷷𩅞𤫊运犏嚋𩓧𩗩𩖰𩖸𩜲𩣑𩥉𩥪𩧃𩨨𩬎𩵚𩶛纟𩻸𩼣䲤镇𪊓熢𪋿䶑递𪗋䶜𠲜达嗁\"],[\"9da1\",\"辺𢒰边𤪓䔉繿潖檱仪㓤𨬬𧢝㜺躀𡟵𨀤𨭬𨮙𧨾𦚯㷫𧙕𣲷𥘵𥥖亚𥺁𦉘嚿𠹭踎孭𣺈𤲞揞拐𡟶𡡻攰嘭𥱊吚𥌑㷆𩶘䱽嘢嘞罉𥻘奵𣵀蝰东𠿪𠵉𣚺脗鵞贘瘻鱅癎瞹鍅吲腈苷嘥脲萘肽嗪祢噃吖𠺝㗎嘅嗱曱𨋢㘭甴嗰喺咗啲𠱁𠲖廐𥅈𠹶𢱢\"],[\"9e40\",\"𠺢麫絚嗞𡁵抝靭咔賍燶酶揼掹揾啩𢭃鱲𢺳冚㓟𠶧冧呍唞唓癦踭𦢊疱肶蠄螆裇膶萜𡃁䓬猄𤜆宐茋𦢓噻𢛴𧴯𤆣𧵳𦻐𧊶酰𡇙鈈𣳼𪚩𠺬𠻹牦𡲢䝎𤿂𧿹𠿫䃺\"],[\"9ea1\",\"鱝攟𢶠䣳𤟠𩵼𠿬𠸊恢𧖣𠿭\"],[\"9ead\",\"𦁈𡆇熣纎鵐业丄㕷嬍沲卧㚬㧜卽㚥𤘘墚𤭮舭呋垪𥪕𠥹\"],[\"9ec5\",\"㩒𢑥獴𩺬䴉鯭𣳾𩼰䱛𤾩𩖞𩿞葜𣶶𧊲𦞳𣜠挮紥𣻷𣸬㨪逈勌㹴㙺䗩𠒎癀嫰𠺶硺𧼮墧䂿噼鮋嵴癔𪐴麅䳡痹㟻愙𣃚𤏲\"],[\"9ef5\",\"噝𡊩垧𤥣𩸆刴𧂮㖭汊鵼\"],[\"9f40\",\"籖鬹埞𡝬屓擓𩓐𦌵𧅤蚭𠴨𦴢𤫢𠵱\"],[\"9f4f\",\"凾𡼏嶎霃𡷑麁遌笟鬂峑箣扨挵髿篏鬪籾鬮籂粆鰕篼鬉鼗鰛𤤾齚啳寃俽麘俲剠㸆勑坧偖妷帒韈鶫轜呩鞴饀鞺匬愰\"],[\"9fa1\",\"椬叚鰊鴂䰻陁榀傦畆𡝭駚剳\"],[\"9fae\",\"酙隁酜\"],[\"9fb2\",\"酑𨺗捿𦴣櫊嘑醎畺抅𠏼獏籰𥰡𣳽\"],[\"9fc1\",\"𤤙盖鮝个𠳔莾衂\"],[\"9fc9\",\"届槀僭坺刟巵从氱𠇲伹咜哚劚趂㗾弌㗳\"],[\"9fdb\",\"歒酼龥鮗頮颴骺麨麄煺笔\"],[\"9fe7\",\"毺蠘罸\"],[\"9feb\",\"嘠𪙊蹷齓\"],[\"9ff0\",\"跔蹏鸜踁抂𨍽踨蹵竓𤩷稾磘泪詧瘇\"],[\"a040\",\"𨩚鼦泎蟖痃𪊲硓咢贌狢獱謭猂瓱賫𤪻蘯徺袠䒷\"],[\"a055\",\"𡠻𦸅\"],[\"a058\",\"詾𢔛\"],[\"a05b\",\"惽癧髗鵄鍮鮏蟵\"],[\"a063\",\"蠏賷猬霡鮰㗖犲䰇籑饊𦅙慙䰄麖慽\"],[\"a073\",\"坟慯抦戹拎㩜懢厪𣏵捤栂㗒\"],[\"a0a1\",\"嵗𨯂迚𨸹\"],[\"a0a6\",\"僙𡵆礆匲阸𠼻䁥\"],[\"a0ae\",\"矾\"],[\"a0b0\",\"糂𥼚糚稭聦聣絍甅瓲覔舚朌聢𧒆聛瓰脃眤覉𦟌畓𦻑螩蟎臈螌詉貭譃眫瓸蓚㘵榲趦\"],[\"a0d4\",\"覩瑨涹蟁𤀑瓧㷛煶悤憜㳑煢恷\"],[\"a0e2\",\"罱𨬭牐惩䭾删㰘𣳇𥻗𧙖𥔱𡥄𡋾𩤃𦷜𧂭峁𦆭𨨏𣙷𠃮𦡆𤼎䕢嬟𦍌齐麦𦉫\"],[\"a3c0\",\"␀\",31,\"␡\"],[\"c6a1\",\"①\",9,\"⑴\",9,\"ⅰ\",9,\"丶丿亅亠冂冖冫勹匸卩厶夊宀巛⼳广廴彐彡攴无疒癶辵隶¨ˆヽヾゝゞ〃仝々〆〇ー[]✽ぁ\",23],[\"c740\",\"す\",58,\"ァアィイ\"],[\"c7a1\",\"ゥ\",81,\"А\",5,\"ЁЖ\",4],[\"c840\",\"Л\",26,\"ёж\",25,\"⇧↸↹㇏𠃌乚𠂊刂䒑\"],[\"c8a1\",\"龰冈龱𧘇\"],[\"c8cd\",\"¬¦'"㈱№℡゛゜⺀⺄⺆⺇⺈⺊⺌⺍⺕⺜⺝⺥⺧⺪⺬⺮⺶⺼⺾⻆⻊⻌⻍⻏⻖⻗⻞⻣\"],[\"c8f5\",\"ʃɐɛɔɵœøŋʊɪ\"],[\"f9fe\",\"■\"],[\"fa40\",\"𠕇鋛𠗟𣿅蕌䊵珯况㙉𤥂𨧤鍄𡧛苮𣳈砼杄拟𤤳𨦪𠊠𦮳𡌅侫𢓭倈𦴩𧪄𣘀𤪱𢔓倩𠍾徤𠎀𠍇滛𠐟偽儁㑺儎顬㝃萖𤦤𠒇兠𣎴兪𠯿𢃼𠋥𢔰𠖎𣈳𡦃宂蝽𠖳𣲙冲冸\"],[\"faa1\",\"鴴凉减凑㳜凓𤪦决凢卂凭菍椾𣜭彻刋刦刼劵剗劔効勅簕蕂勠蘍𦬓包𨫞啉滙𣾀𠥔𣿬匳卄𠯢泋𡜦栛珕恊㺪㣌𡛨燝䒢卭却𨚫卾卿𡖖𡘓矦厓𨪛厠厫厮玧𥝲㽙玜叁叅汉义埾叙㪫𠮏叠𣿫𢶣叶𠱷吓灹唫晗浛呭𦭓𠵴啝咏咤䞦𡜍𠻝㶴𠵍\"],[\"fb40\",\"𨦼𢚘啇䳭启琗喆喩嘅𡣗𤀺䕒𤐵暳𡂴嘷曍𣊊暤暭噍噏磱囱鞇叾圀囯园𨭦㘣𡉏坆𤆥汮炋坂㚱𦱾埦𡐖堃𡑔𤍣堦𤯵塜墪㕡壠壜𡈼壻寿坃𪅐𤉸鏓㖡够梦㛃湙\"],[\"fba1\",\"𡘾娤啓𡚒蔅姉𠵎𦲁𦴪𡟜姙𡟻𡞲𦶦浱𡠨𡛕姹𦹅媫婣㛦𤦩婷㜈媖瑥嫓𦾡𢕔㶅𡤑㜲𡚸広勐孶斈孼𧨎䀄䡝𠈄寕慠𡨴𥧌𠖥寳宝䴐尅𡭄尓珎尔𡲥𦬨屉䣝岅峩峯嶋𡷹𡸷崐崘嵆𡺤岺巗苼㠭𤤁𢁉𢅳芇㠶㯂帮檊幵幺𤒼𠳓厦亷廐厨𡝱帉廴𨒂\"],[\"fc40\",\"廹廻㢠廼栾鐛弍𠇁弢㫞䢮𡌺强𦢈𢏐彘𢑱彣鞽𦹮彲鍀𨨶徧嶶㵟𥉐𡽪𧃸𢙨釖𠊞𨨩怱暅𡡷㥣㷇㘹垐𢞴祱㹀悞悤悳𤦂𤦏𧩓璤僡媠慤萤慂慈𦻒憁凴𠙖憇宪𣾷\"],[\"fca1\",\"𢡟懓𨮝𩥝懐㤲𢦀𢣁怣慜攞掋𠄘担𡝰拕𢸍捬𤧟㨗搸揸𡎎𡟼撐澊𢸶頔𤂌𥜝擡擥鑻㩦携㩗敍漖𤨨𤨣斅敭敟𣁾斵𤥀䬷旑䃘𡠩无旣忟𣐀昘𣇷𣇸晄𣆤𣆥晋𠹵晧𥇦晳晴𡸽𣈱𨗴𣇈𥌓矅𢣷馤朂𤎜𤨡㬫槺𣟂杞杧杢𤇍𩃭柗䓩栢湐鈼栁𣏦𦶠桝\"],[\"fd40\",\"𣑯槡樋𨫟楳棃𣗍椁椀㴲㨁𣘼㮀枬楡𨩊䋼椶榘㮡𠏉荣傐槹𣙙𢄪橅𣜃檝㯳枱櫈𩆜㰍欝𠤣惞欵歴𢟍溵𣫛𠎵𡥘㝀吡𣭚毡𣻼毜氷𢒋𤣱𦭑汚舦汹𣶼䓅𣶽𤆤𤤌𤤀\"],[\"fda1\",\"𣳉㛥㳫𠴲鮃𣇹𢒑羏样𦴥𦶡𦷫涖浜湼漄𤥿𤂅𦹲蔳𦽴凇沜渝萮𨬡港𣸯瑓𣾂秌湏媑𣁋濸㜍澝𣸰滺𡒗𤀽䕕鏰潄潜㵎潴𩅰㴻澟𤅄濓𤂑𤅕𤀹𣿰𣾴𤄿凟𤅖𤅗𤅀𦇝灋灾炧炁烌烕烖烟䄄㷨熴熖𤉷焫煅媈煊煮岜𤍥煏鍢𤋁焬𤑚𤨧𤨢熺𨯨炽爎\"],[\"fe40\",\"鑂爕夑鑃爤鍁𥘅爮牀𤥴梽牕牗㹕𣁄栍漽犂猪猫𤠣𨠫䣭𨠄猨献珏玪𠰺𦨮珉瑉𤇢𡛧𤨤昣㛅𤦷𤦍𤧻珷琕椃𤨦琹𠗃㻗瑜𢢭瑠𨺲瑇珤瑶莹瑬㜰瑴鏱樬璂䥓𤪌\"],[\"fea1\",\"𤅟𤩹𨮏孆𨰃𡢞瓈𡦈甎瓩甞𨻙𡩋寗𨺬鎅畍畊畧畮𤾂㼄𤴓疎瑝疞疴瘂瘬癑癏癯癶𦏵皐臯㟸𦤑𦤎皡皥皷盌𦾟葢𥂝𥅽𡸜眞眦着撯𥈠睘𣊬瞯𨥤𨥨𡛁矴砉𡍶𤨒棊碯磇磓隥礮𥗠磗礴碱𧘌辸袄𨬫𦂃𢘜禆褀椂禀𥡗禝𧬹礼禩渪𧄦㺨秆𩄍秔\"]]");
  45884. /***/ }),
  45885. /* 320 */
  45886. /***/ (function(module, exports) {
  45887. /* (ignored) */
  45888. /***/ }),
  45889. /* 321 */
  45890. /***/ (function(module, exports) {
  45891. /* (ignored) */
  45892. /***/ }),
  45893. /* 322 */
  45894. /***/ (function(module, exports, __webpack_require__) {
  45895. // Generated by CoffeeScript 1.7.1
  45896. (function() {
  45897. var ArrayT, LazyArray, LazyArrayT, NumberT, inspect, utils,
  45898. __hasProp = {}.hasOwnProperty,
  45899. __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
  45900. ArrayT = __webpack_require__(178);
  45901. NumberT = __webpack_require__(49).Number;
  45902. utils = __webpack_require__(26);
  45903. inspect = __webpack_require__(104).inspect;
  45904. LazyArrayT = (function(_super) {
  45905. __extends(LazyArrayT, _super);
  45906. function LazyArrayT() {
  45907. return LazyArrayT.__super__.constructor.apply(this, arguments);
  45908. }
  45909. LazyArrayT.prototype.decode = function(stream, parent) {
  45910. var length, pos, res;
  45911. pos = stream.pos;
  45912. length = utils.resolveLength(this.length, stream, parent);
  45913. if (this.length instanceof NumberT) {
  45914. parent = {
  45915. parent: parent,
  45916. _startOffset: pos,
  45917. _currentOffset: 0,
  45918. _length: length
  45919. };
  45920. }
  45921. res = new LazyArray(this.type, length, stream, parent);
  45922. stream.pos += length * this.type.size(null, parent);
  45923. return res;
  45924. };
  45925. LazyArrayT.prototype.size = function(val, ctx) {
  45926. if (val instanceof LazyArray) {
  45927. val = val.toArray();
  45928. }
  45929. return LazyArrayT.__super__.size.call(this, val, ctx);
  45930. };
  45931. LazyArrayT.prototype.encode = function(stream, val, ctx) {
  45932. if (val instanceof LazyArray) {
  45933. val = val.toArray();
  45934. }
  45935. return LazyArrayT.__super__.encode.call(this, stream, val, ctx);
  45936. };
  45937. return LazyArrayT;
  45938. })(ArrayT);
  45939. LazyArray = (function() {
  45940. function LazyArray(type, length, stream, ctx) {
  45941. this.type = type;
  45942. this.length = length;
  45943. this.stream = stream;
  45944. this.ctx = ctx;
  45945. this.base = this.stream.pos;
  45946. this.items = [];
  45947. }
  45948. LazyArray.prototype.get = function(index) {
  45949. var pos;
  45950. if (index < 0 || index >= this.length) {
  45951. return void 0;
  45952. }
  45953. if (this.items[index] == null) {
  45954. pos = this.stream.pos;
  45955. this.stream.pos = this.base + this.type.size(null, this.ctx) * index;
  45956. this.items[index] = this.type.decode(this.stream, this.ctx);
  45957. this.stream.pos = pos;
  45958. }
  45959. return this.items[index];
  45960. };
  45961. LazyArray.prototype.toArray = function() {
  45962. var i, _i, _ref, _results;
  45963. _results = [];
  45964. for (i = _i = 0, _ref = this.length; _i < _ref; i = _i += 1) {
  45965. _results.push(this.get(i));
  45966. }
  45967. return _results;
  45968. };
  45969. LazyArray.prototype.inspect = function() {
  45970. return inspect(this.toArray());
  45971. };
  45972. return LazyArray;
  45973. })();
  45974. module.exports = LazyArrayT;
  45975. }).call(this);
  45976. /***/ }),
  45977. /* 323 */
  45978. /***/ (function(module, exports) {
  45979. // Generated by CoffeeScript 1.7.1
  45980. (function() {
  45981. var Bitfield;
  45982. Bitfield = (function() {
  45983. function Bitfield(type, flags) {
  45984. this.type = type;
  45985. this.flags = flags != null ? flags : [];
  45986. }
  45987. Bitfield.prototype.decode = function(stream) {
  45988. var flag, i, res, val, _i, _len, _ref;
  45989. val = this.type.decode(stream);
  45990. res = {};
  45991. _ref = this.flags;
  45992. for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) {
  45993. flag = _ref[i];
  45994. if (flag != null) {
  45995. res[flag] = !!(val & (1 << i));
  45996. }
  45997. }
  45998. return res;
  45999. };
  46000. Bitfield.prototype.size = function() {
  46001. return this.type.size();
  46002. };
  46003. Bitfield.prototype.encode = function(stream, keys) {
  46004. var flag, i, val, _i, _len, _ref;
  46005. val = 0;
  46006. _ref = this.flags;
  46007. for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) {
  46008. flag = _ref[i];
  46009. if (flag != null) {
  46010. if (keys[flag]) {
  46011. val |= 1 << i;
  46012. }
  46013. }
  46014. }
  46015. return this.type.encode(stream, val);
  46016. };
  46017. return Bitfield;
  46018. })();
  46019. module.exports = Bitfield;
  46020. }).call(this);
  46021. /***/ }),
  46022. /* 324 */
  46023. /***/ (function(module, exports) {
  46024. // Generated by CoffeeScript 1.7.1
  46025. (function() {
  46026. var BooleanT;
  46027. BooleanT = (function() {
  46028. function BooleanT(type) {
  46029. this.type = type;
  46030. }
  46031. BooleanT.prototype.decode = function(stream, parent) {
  46032. return !!this.type.decode(stream, parent);
  46033. };
  46034. BooleanT.prototype.size = function(val, parent) {
  46035. return this.type.size(val, parent);
  46036. };
  46037. BooleanT.prototype.encode = function(stream, val, parent) {
  46038. return this.type.encode(stream, +val, parent);
  46039. };
  46040. return BooleanT;
  46041. })();
  46042. module.exports = BooleanT;
  46043. }).call(this);
  46044. /***/ }),
  46045. /* 325 */
  46046. /***/ (function(module, exports, __webpack_require__) {
  46047. // Generated by CoffeeScript 1.7.1
  46048. (function() {
  46049. var BufferT, NumberT, utils;
  46050. utils = __webpack_require__(26);
  46051. NumberT = __webpack_require__(49).Number;
  46052. BufferT = (function() {
  46053. function BufferT(length) {
  46054. this.length = length;
  46055. }
  46056. BufferT.prototype.decode = function(stream, parent) {
  46057. var length;
  46058. length = utils.resolveLength(this.length, stream, parent);
  46059. return stream.readBuffer(length);
  46060. };
  46061. BufferT.prototype.size = function(val, parent) {
  46062. if (!val) {
  46063. return utils.resolveLength(this.length, null, parent);
  46064. }
  46065. return val.length;
  46066. };
  46067. BufferT.prototype.encode = function(stream, buf, parent) {
  46068. if (this.length instanceof NumberT) {
  46069. this.length.encode(stream, buf.length);
  46070. }
  46071. return stream.writeBuffer(buf);
  46072. };
  46073. return BufferT;
  46074. })();
  46075. module.exports = BufferT;
  46076. }).call(this);
  46077. /***/ }),
  46078. /* 326 */
  46079. /***/ (function(module, exports) {
  46080. // Generated by CoffeeScript 1.7.1
  46081. (function() {
  46082. var Enum;
  46083. Enum = (function() {
  46084. function Enum(type, options) {
  46085. this.type = type;
  46086. this.options = options != null ? options : [];
  46087. }
  46088. Enum.prototype.decode = function(stream) {
  46089. var index;
  46090. index = this.type.decode(stream);
  46091. return this.options[index] || index;
  46092. };
  46093. Enum.prototype.size = function() {
  46094. return this.type.size();
  46095. };
  46096. Enum.prototype.encode = function(stream, val) {
  46097. var index;
  46098. index = this.options.indexOf(val);
  46099. if (index === -1) {
  46100. throw new Error("Unknown option in enum: " + val);
  46101. }
  46102. return this.type.encode(stream, index);
  46103. };
  46104. return Enum;
  46105. })();
  46106. module.exports = Enum;
  46107. }).call(this);
  46108. /***/ }),
  46109. /* 327 */
  46110. /***/ (function(module, exports) {
  46111. // Generated by CoffeeScript 1.7.1
  46112. (function() {
  46113. var Optional;
  46114. Optional = (function() {
  46115. function Optional(type, condition) {
  46116. this.type = type;
  46117. this.condition = condition != null ? condition : true;
  46118. }
  46119. Optional.prototype.decode = function(stream, parent) {
  46120. var condition;
  46121. condition = this.condition;
  46122. if (typeof condition === 'function') {
  46123. condition = condition.call(parent, parent);
  46124. }
  46125. if (condition) {
  46126. return this.type.decode(stream, parent);
  46127. }
  46128. };
  46129. Optional.prototype.size = function(val, parent) {
  46130. var condition;
  46131. condition = this.condition;
  46132. if (typeof condition === 'function') {
  46133. condition = condition.call(parent, parent);
  46134. }
  46135. if (condition) {
  46136. return this.type.size(val, parent);
  46137. } else {
  46138. return 0;
  46139. }
  46140. };
  46141. Optional.prototype.encode = function(stream, val, parent) {
  46142. var condition;
  46143. condition = this.condition;
  46144. if (typeof condition === 'function') {
  46145. condition = condition.call(parent, parent);
  46146. }
  46147. if (condition) {
  46148. return this.type.encode(stream, val, parent);
  46149. }
  46150. };
  46151. return Optional;
  46152. })();
  46153. module.exports = Optional;
  46154. }).call(this);
  46155. /***/ }),
  46156. /* 328 */
  46157. /***/ (function(module, exports, __webpack_require__) {
  46158. // Generated by CoffeeScript 1.7.1
  46159. (function() {
  46160. var Reserved, utils;
  46161. utils = __webpack_require__(26);
  46162. Reserved = (function() {
  46163. function Reserved(type, count) {
  46164. this.type = type;
  46165. this.count = count != null ? count : 1;
  46166. }
  46167. Reserved.prototype.decode = function(stream, parent) {
  46168. stream.pos += this.size(null, parent);
  46169. return void 0;
  46170. };
  46171. Reserved.prototype.size = function(data, parent) {
  46172. var count;
  46173. count = utils.resolveLength(this.count, null, parent);
  46174. return this.type.size() * count;
  46175. };
  46176. Reserved.prototype.encode = function(stream, val, parent) {
  46177. return stream.fill(0, this.size(val, parent));
  46178. };
  46179. return Reserved;
  46180. })();
  46181. module.exports = Reserved;
  46182. }).call(this);
  46183. /***/ }),
  46184. /* 329 */
  46185. /***/ (function(module, exports, __webpack_require__) {
  46186. /* WEBPACK VAR INJECTION */(function(Buffer) {// Generated by CoffeeScript 1.7.1
  46187. (function() {
  46188. var NumberT, StringT, utils;
  46189. NumberT = __webpack_require__(49).Number;
  46190. utils = __webpack_require__(26);
  46191. StringT = (function() {
  46192. function StringT(length, encoding) {
  46193. this.length = length;
  46194. this.encoding = encoding != null ? encoding : 'ascii';
  46195. }
  46196. StringT.prototype.decode = function(stream, parent) {
  46197. var buffer, encoding, length, pos, string;
  46198. length = (function() {
  46199. if (this.length != null) {
  46200. return utils.resolveLength(this.length, stream, parent);
  46201. } else {
  46202. buffer = stream.buffer, length = stream.length, pos = stream.pos;
  46203. while (pos < length && buffer[pos] !== 0x00) {
  46204. ++pos;
  46205. }
  46206. return pos - stream.pos;
  46207. }
  46208. }).call(this);
  46209. encoding = this.encoding;
  46210. if (typeof encoding === 'function') {
  46211. encoding = encoding.call(parent, parent) || 'ascii';
  46212. }
  46213. string = stream.readString(length, encoding);
  46214. if ((this.length == null) && stream.pos < stream.length) {
  46215. stream.pos++;
  46216. }
  46217. return string;
  46218. };
  46219. StringT.prototype.size = function(val, parent) {
  46220. var encoding, size;
  46221. if (!val) {
  46222. return utils.resolveLength(this.length, null, parent);
  46223. }
  46224. encoding = this.encoding;
  46225. if (typeof encoding === 'function') {
  46226. encoding = encoding.call(parent != null ? parent.val : void 0, parent != null ? parent.val : void 0) || 'ascii';
  46227. }
  46228. if (encoding === 'utf16be') {
  46229. encoding = 'utf16le';
  46230. }
  46231. size = Buffer.byteLength(val, encoding);
  46232. if (this.length instanceof NumberT) {
  46233. size += this.length.size();
  46234. }
  46235. if (this.length == null) {
  46236. size++;
  46237. }
  46238. return size;
  46239. };
  46240. StringT.prototype.encode = function(stream, val, parent) {
  46241. var encoding;
  46242. encoding = this.encoding;
  46243. if (typeof encoding === 'function') {
  46244. encoding = encoding.call(parent != null ? parent.val : void 0, parent != null ? parent.val : void 0) || 'ascii';
  46245. }
  46246. if (this.length instanceof NumberT) {
  46247. this.length.encode(stream, Buffer.byteLength(val, encoding));
  46248. }
  46249. stream.writeString(val, encoding);
  46250. if (this.length == null) {
  46251. return stream.writeUInt8(0x00);
  46252. }
  46253. };
  46254. return StringT;
  46255. })();
  46256. module.exports = StringT;
  46257. }).call(this);
  46258. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(4).Buffer))
  46259. /***/ }),
  46260. /* 330 */
  46261. /***/ (function(module, exports, __webpack_require__) {
  46262. // Generated by CoffeeScript 1.7.1
  46263. (function() {
  46264. var Struct, VersionedStruct,
  46265. __hasProp = {}.hasOwnProperty,
  46266. __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
  46267. Struct = __webpack_require__(179);
  46268. VersionedStruct = (function(_super) {
  46269. __extends(VersionedStruct, _super);
  46270. function VersionedStruct(type, versions) {
  46271. this.type = type;
  46272. this.versions = versions != null ? versions : {};
  46273. if (typeof this.type === 'string') {
  46274. this.versionGetter = new Function('parent', "return parent." + this.type);
  46275. this.versionSetter = new Function('parent', 'version', "return parent." + this.type + " = version");
  46276. }
  46277. }
  46278. VersionedStruct.prototype.decode = function(stream, parent, length) {
  46279. var fields, res, _ref;
  46280. if (length == null) {
  46281. length = 0;
  46282. }
  46283. res = this._setup(stream, parent, length);
  46284. if (typeof this.type === 'string') {
  46285. res.version = this.versionGetter(parent);
  46286. } else {
  46287. res.version = this.type.decode(stream);
  46288. }
  46289. if (this.versions.header) {
  46290. this._parseFields(stream, res, this.versions.header);
  46291. }
  46292. fields = this.versions[res.version];
  46293. if (fields == null) {
  46294. throw new Error("Unknown version " + res.version);
  46295. }
  46296. if (fields instanceof VersionedStruct) {
  46297. return fields.decode(stream, parent);
  46298. }
  46299. this._parseFields(stream, res, fields);
  46300. if ((_ref = this.process) != null) {
  46301. _ref.call(res, stream);
  46302. }
  46303. return res;
  46304. };
  46305. VersionedStruct.prototype.size = function(val, parent, includePointers) {
  46306. var ctx, fields, key, size, type, _ref;
  46307. if (includePointers == null) {
  46308. includePointers = true;
  46309. }
  46310. if (!val) {
  46311. throw new Error('Not a fixed size');
  46312. }
  46313. ctx = {
  46314. parent: parent,
  46315. val: val,
  46316. pointerSize: 0
  46317. };
  46318. size = 0;
  46319. if (typeof this.type !== 'string') {
  46320. size += this.type.size(val.version, ctx);
  46321. }
  46322. if (this.versions.header) {
  46323. _ref = this.versions.header;
  46324. for (key in _ref) {
  46325. type = _ref[key];
  46326. if (type.size != null) {
  46327. size += type.size(val[key], ctx);
  46328. }
  46329. }
  46330. }
  46331. fields = this.versions[val.version];
  46332. if (fields == null) {
  46333. throw new Error("Unknown version " + val.version);
  46334. }
  46335. for (key in fields) {
  46336. type = fields[key];
  46337. if (type.size != null) {
  46338. size += type.size(val[key], ctx);
  46339. }
  46340. }
  46341. if (includePointers) {
  46342. size += ctx.pointerSize;
  46343. }
  46344. return size;
  46345. };
  46346. VersionedStruct.prototype.encode = function(stream, val, parent) {
  46347. var ctx, fields, i, key, ptr, type, _ref, _ref1;
  46348. if ((_ref = this.preEncode) != null) {
  46349. _ref.call(val, stream);
  46350. }
  46351. ctx = {
  46352. pointers: [],
  46353. startOffset: stream.pos,
  46354. parent: parent,
  46355. val: val,
  46356. pointerSize: 0
  46357. };
  46358. ctx.pointerOffset = stream.pos + this.size(val, ctx, false);
  46359. if (typeof this.type !== 'string') {
  46360. this.type.encode(stream, val.version);
  46361. }
  46362. if (this.versions.header) {
  46363. _ref1 = this.versions.header;
  46364. for (key in _ref1) {
  46365. type = _ref1[key];
  46366. if (type.encode != null) {
  46367. type.encode(stream, val[key], ctx);
  46368. }
  46369. }
  46370. }
  46371. fields = this.versions[val.version];
  46372. for (key in fields) {
  46373. type = fields[key];
  46374. if (type.encode != null) {
  46375. type.encode(stream, val[key], ctx);
  46376. }
  46377. }
  46378. i = 0;
  46379. while (i < ctx.pointers.length) {
  46380. ptr = ctx.pointers[i++];
  46381. ptr.type.encode(stream, ptr.val, ptr.parent);
  46382. }
  46383. };
  46384. return VersionedStruct;
  46385. })(Struct);
  46386. module.exports = VersionedStruct;
  46387. }).call(this);
  46388. /***/ }),
  46389. /* 331 */
  46390. /***/ (function(module, exports, __webpack_require__) {
  46391. // Generated by CoffeeScript 1.7.1
  46392. (function() {
  46393. var Pointer, VoidPointer, utils;
  46394. utils = __webpack_require__(26);
  46395. Pointer = (function() {
  46396. function Pointer(offsetType, type, options) {
  46397. var _base, _base1, _base2, _base3;
  46398. this.offsetType = offsetType;
  46399. this.type = type;
  46400. this.options = options != null ? options : {};
  46401. if (this.type === 'void') {
  46402. this.type = null;
  46403. }
  46404. if ((_base = this.options).type == null) {
  46405. _base.type = 'local';
  46406. }
  46407. if ((_base1 = this.options).allowNull == null) {
  46408. _base1.allowNull = true;
  46409. }
  46410. if ((_base2 = this.options).nullValue == null) {
  46411. _base2.nullValue = 0;
  46412. }
  46413. if ((_base3 = this.options).lazy == null) {
  46414. _base3.lazy = false;
  46415. }
  46416. if (this.options.relativeTo) {
  46417. this.relativeToGetter = new Function('ctx', "return ctx." + this.options.relativeTo);
  46418. }
  46419. }
  46420. Pointer.prototype.decode = function(stream, ctx) {
  46421. var c, decodeValue, offset, ptr, relative, val;
  46422. offset = this.offsetType.decode(stream, ctx);
  46423. if (offset === this.options.nullValue && this.options.allowNull) {
  46424. return null;
  46425. }
  46426. relative = (function() {
  46427. switch (this.options.type) {
  46428. case 'local':
  46429. return ctx._startOffset;
  46430. case 'immediate':
  46431. return stream.pos - this.offsetType.size();
  46432. case 'parent':
  46433. return ctx.parent._startOffset;
  46434. default:
  46435. c = ctx;
  46436. while (c.parent) {
  46437. c = c.parent;
  46438. }
  46439. return c._startOffset || 0;
  46440. }
  46441. }).call(this);
  46442. if (this.options.relativeTo) {
  46443. relative += this.relativeToGetter(ctx);
  46444. }
  46445. ptr = offset + relative;
  46446. if (this.type != null) {
  46447. val = null;
  46448. decodeValue = (function(_this) {
  46449. return function() {
  46450. var pos;
  46451. if (val != null) {
  46452. return val;
  46453. }
  46454. pos = stream.pos;
  46455. stream.pos = ptr;
  46456. val = _this.type.decode(stream, ctx);
  46457. stream.pos = pos;
  46458. return val;
  46459. };
  46460. })(this);
  46461. if (this.options.lazy) {
  46462. return new utils.PropertyDescriptor({
  46463. get: decodeValue
  46464. });
  46465. }
  46466. return decodeValue();
  46467. } else {
  46468. return ptr;
  46469. }
  46470. };
  46471. Pointer.prototype.size = function(val, ctx) {
  46472. var parent, type;
  46473. parent = ctx;
  46474. switch (this.options.type) {
  46475. case 'local':
  46476. case 'immediate':
  46477. break;
  46478. case 'parent':
  46479. ctx = ctx.parent;
  46480. break;
  46481. default:
  46482. while (ctx.parent) {
  46483. ctx = ctx.parent;
  46484. }
  46485. }
  46486. type = this.type;
  46487. if (type == null) {
  46488. if (!(val instanceof VoidPointer)) {
  46489. throw new Error("Must be a VoidPointer");
  46490. }
  46491. type = val.type;
  46492. val = val.value;
  46493. }
  46494. if (val && ctx) {
  46495. ctx.pointerSize += type.size(val, parent);
  46496. }
  46497. return this.offsetType.size();
  46498. };
  46499. Pointer.prototype.encode = function(stream, val, ctx) {
  46500. var parent, relative, type;
  46501. parent = ctx;
  46502. if (val == null) {
  46503. this.offsetType.encode(stream, this.options.nullValue);
  46504. return;
  46505. }
  46506. switch (this.options.type) {
  46507. case 'local':
  46508. relative = ctx.startOffset;
  46509. break;
  46510. case 'immediate':
  46511. relative = stream.pos + this.offsetType.size(val, parent);
  46512. break;
  46513. case 'parent':
  46514. ctx = ctx.parent;
  46515. relative = ctx.startOffset;
  46516. break;
  46517. default:
  46518. relative = 0;
  46519. while (ctx.parent) {
  46520. ctx = ctx.parent;
  46521. }
  46522. }
  46523. if (this.options.relativeTo) {
  46524. relative += this.relativeToGetter(parent.val);
  46525. }
  46526. this.offsetType.encode(stream, ctx.pointerOffset - relative);
  46527. type = this.type;
  46528. if (type == null) {
  46529. if (!(val instanceof VoidPointer)) {
  46530. throw new Error("Must be a VoidPointer");
  46531. }
  46532. type = val.type;
  46533. val = val.value;
  46534. }
  46535. ctx.pointers.push({
  46536. type: type,
  46537. val: val,
  46538. parent: parent
  46539. });
  46540. return ctx.pointerOffset += type.size(val, parent);
  46541. };
  46542. return Pointer;
  46543. })();
  46544. VoidPointer = (function() {
  46545. function VoidPointer(type, value) {
  46546. this.type = type;
  46547. this.value = value;
  46548. }
  46549. return VoidPointer;
  46550. })();
  46551. exports.Pointer = Pointer;
  46552. exports.VoidPointer = VoidPointer;
  46553. }).call(this);
  46554. /***/ }),
  46555. /* 332 */
  46556. /***/ (function(module, exports, __webpack_require__) {
  46557. module.exports = { "default": __webpack_require__(333), __esModule: true };
  46558. /***/ }),
  46559. /* 333 */
  46560. /***/ (function(module, exports, __webpack_require__) {
  46561. __webpack_require__(334);
  46562. var $Object = __webpack_require__(2).Object;
  46563. module.exports = function getOwnPropertyDescriptor(it, key) {
  46564. return $Object.getOwnPropertyDescriptor(it, key);
  46565. };
  46566. /***/ }),
  46567. /* 334 */
  46568. /***/ (function(module, exports, __webpack_require__) {
  46569. // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
  46570. var toIObject = __webpack_require__(35);
  46571. var $getOwnPropertyDescriptor = __webpack_require__(113).f;
  46572. __webpack_require__(115)('getOwnPropertyDescriptor', function () {
  46573. return function getOwnPropertyDescriptor(it, key) {
  46574. return $getOwnPropertyDescriptor(toIObject(it), key);
  46575. };
  46576. });
  46577. /***/ }),
  46578. /* 335 */
  46579. /***/ (function(module, exports, __webpack_require__) {
  46580. module.exports = { "default": __webpack_require__(336), __esModule: true };
  46581. /***/ }),
  46582. /* 336 */
  46583. /***/ (function(module, exports, __webpack_require__) {
  46584. __webpack_require__(74);
  46585. __webpack_require__(60);
  46586. module.exports = __webpack_require__(344);
  46587. /***/ }),
  46588. /* 337 */
  46589. /***/ (function(module, exports, __webpack_require__) {
  46590. "use strict";
  46591. var addToUnscopables = __webpack_require__(338);
  46592. var step = __webpack_require__(183);
  46593. var Iterators = __webpack_require__(58);
  46594. var toIObject = __webpack_require__(35);
  46595. // 22.1.3.4 Array.prototype.entries()
  46596. // 22.1.3.13 Array.prototype.keys()
  46597. // 22.1.3.29 Array.prototype.values()
  46598. // 22.1.3.30 Array.prototype[@@iterator]()
  46599. module.exports = __webpack_require__(116)(Array, 'Array', function (iterated, kind) {
  46600. this._t = toIObject(iterated); // target
  46601. this._i = 0; // next index
  46602. this._k = kind; // kind
  46603. // 22.1.5.2.1 %ArrayIteratorPrototype%.next()
  46604. }, function () {
  46605. var O = this._t;
  46606. var kind = this._k;
  46607. var index = this._i++;
  46608. if (!O || index >= O.length) {
  46609. this._t = undefined;
  46610. return step(1);
  46611. }
  46612. if (kind == 'keys') return step(0, index);
  46613. if (kind == 'values') return step(0, O[index]);
  46614. return step(0, [index, O[index]]);
  46615. }, 'values');
  46616. // argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)
  46617. Iterators.Arguments = Iterators.Array;
  46618. addToUnscopables('keys');
  46619. addToUnscopables('values');
  46620. addToUnscopables('entries');
  46621. /***/ }),
  46622. /* 338 */
  46623. /***/ (function(module, exports) {
  46624. module.exports = function () { /* empty */ };
  46625. /***/ }),
  46626. /* 339 */
  46627. /***/ (function(module, exports, __webpack_require__) {
  46628. "use strict";
  46629. var create = __webpack_require__(76);
  46630. var descriptor = __webpack_require__(57);
  46631. var setToStringTag = __webpack_require__(79);
  46632. var IteratorPrototype = {};
  46633. // 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
  46634. __webpack_require__(27)(IteratorPrototype, __webpack_require__(14)('iterator'), function () { return this; });
  46635. module.exports = function (Constructor, NAME, next) {
  46636. Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });
  46637. setToStringTag(Constructor, NAME + ' Iterator');
  46638. };
  46639. /***/ }),
  46640. /* 340 */
  46641. /***/ (function(module, exports, __webpack_require__) {
  46642. // false -> Array#indexOf
  46643. // true -> Array#includes
  46644. var toIObject = __webpack_require__(35);
  46645. var toLength = __webpack_require__(77);
  46646. var toAbsoluteIndex = __webpack_require__(187);
  46647. module.exports = function (IS_INCLUDES) {
  46648. return function ($this, el, fromIndex) {
  46649. var O = toIObject($this);
  46650. var length = toLength(O.length);
  46651. var index = toAbsoluteIndex(fromIndex, length);
  46652. var value;
  46653. // Array#includes uses SameValueZero equality algorithm
  46654. // eslint-disable-next-line no-self-compare
  46655. if (IS_INCLUDES && el != el) while (length > index) {
  46656. value = O[index++];
  46657. // eslint-disable-next-line no-self-compare
  46658. if (value != value) return true;
  46659. // Array#indexOf ignores holes, Array#includes - not
  46660. } else for (;length > index; index++) if (IS_INCLUDES || index in O) {
  46661. if (O[index] === el) return IS_INCLUDES || index || 0;
  46662. } return !IS_INCLUDES && -1;
  46663. };
  46664. };
  46665. /***/ }),
  46666. /* 341 */
  46667. /***/ (function(module, exports, __webpack_require__) {
  46668. var document = __webpack_require__(21).document;
  46669. module.exports = document && document.documentElement;
  46670. /***/ }),
  46671. /* 342 */
  46672. /***/ (function(module, exports, __webpack_require__) {
  46673. // 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)
  46674. var has = __webpack_require__(36);
  46675. var toObject = __webpack_require__(50);
  46676. var IE_PROTO = __webpack_require__(118)('IE_PROTO');
  46677. var ObjectProto = Object.prototype;
  46678. module.exports = Object.getPrototypeOf || function (O) {
  46679. O = toObject(O);
  46680. if (has(O, IE_PROTO)) return O[IE_PROTO];
  46681. if (typeof O.constructor == 'function' && O instanceof O.constructor) {
  46682. return O.constructor.prototype;
  46683. } return O instanceof Object ? ObjectProto : null;
  46684. };
  46685. /***/ }),
  46686. /* 343 */
  46687. /***/ (function(module, exports, __webpack_require__) {
  46688. var toInteger = __webpack_require__(117);
  46689. var defined = __webpack_require__(112);
  46690. // true -> String#at
  46691. // false -> String#codePointAt
  46692. module.exports = function (TO_STRING) {
  46693. return function (that, pos) {
  46694. var s = String(defined(that));
  46695. var i = toInteger(pos);
  46696. var l = s.length;
  46697. var a, b;
  46698. if (i < 0 || i >= l) return TO_STRING ? '' : undefined;
  46699. a = s.charCodeAt(i);
  46700. return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff
  46701. ? TO_STRING ? s.charAt(i) : a
  46702. : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;
  46703. };
  46704. };
  46705. /***/ }),
  46706. /* 344 */
  46707. /***/ (function(module, exports, __webpack_require__) {
  46708. var anObject = __webpack_require__(28);
  46709. var get = __webpack_require__(121);
  46710. module.exports = __webpack_require__(2).getIterator = function (it) {
  46711. var iterFn = get(it);
  46712. if (typeof iterFn != 'function') throw TypeError(it + ' is not iterable!');
  46713. return anObject(iterFn.call(it));
  46714. };
  46715. /***/ }),
  46716. /* 345 */
  46717. /***/ (function(module, exports, __webpack_require__) {
  46718. module.exports = { "default": __webpack_require__(346), __esModule: true };
  46719. /***/ }),
  46720. /* 346 */
  46721. /***/ (function(module, exports, __webpack_require__) {
  46722. __webpack_require__(347);
  46723. module.exports = __webpack_require__(2).Object.freeze;
  46724. /***/ }),
  46725. /* 347 */
  46726. /***/ (function(module, exports, __webpack_require__) {
  46727. // 19.1.2.5 Object.freeze(O)
  46728. var isObject = __webpack_require__(20);
  46729. var meta = __webpack_require__(80).onFreeze;
  46730. __webpack_require__(115)('freeze', function ($freeze) {
  46731. return function freeze(it) {
  46732. return $freeze && isObject(it) ? $freeze(meta(it)) : it;
  46733. };
  46734. });
  46735. /***/ }),
  46736. /* 348 */
  46737. /***/ (function(module, exports, __webpack_require__) {
  46738. module.exports = { "default": __webpack_require__(349), __esModule: true };
  46739. /***/ }),
  46740. /* 349 */
  46741. /***/ (function(module, exports, __webpack_require__) {
  46742. __webpack_require__(60);
  46743. __webpack_require__(74);
  46744. module.exports = __webpack_require__(123).f('iterator');
  46745. /***/ }),
  46746. /* 350 */
  46747. /***/ (function(module, exports, __webpack_require__) {
  46748. module.exports = { "default": __webpack_require__(351), __esModule: true };
  46749. /***/ }),
  46750. /* 351 */
  46751. /***/ (function(module, exports, __webpack_require__) {
  46752. __webpack_require__(352);
  46753. __webpack_require__(126);
  46754. __webpack_require__(355);
  46755. __webpack_require__(356);
  46756. module.exports = __webpack_require__(2).Symbol;
  46757. /***/ }),
  46758. /* 352 */
  46759. /***/ (function(module, exports, __webpack_require__) {
  46760. "use strict";
  46761. // ECMAScript 6 symbols shim
  46762. var global = __webpack_require__(21);
  46763. var has = __webpack_require__(36);
  46764. var DESCRIPTORS = __webpack_require__(13);
  46765. var $export = __webpack_require__(7);
  46766. var redefine = __webpack_require__(184);
  46767. var META = __webpack_require__(80).KEY;
  46768. var $fails = __webpack_require__(37);
  46769. var shared = __webpack_require__(119);
  46770. var setToStringTag = __webpack_require__(79);
  46771. var uid = __webpack_require__(78);
  46772. var wks = __webpack_require__(14);
  46773. var wksExt = __webpack_require__(123);
  46774. var wksDefine = __webpack_require__(124);
  46775. var enumKeys = __webpack_require__(353);
  46776. var isArray = __webpack_require__(189);
  46777. var anObject = __webpack_require__(28);
  46778. var isObject = __webpack_require__(20);
  46779. var toObject = __webpack_require__(50);
  46780. var toIObject = __webpack_require__(35);
  46781. var toPrimitive = __webpack_require__(114);
  46782. var createDesc = __webpack_require__(57);
  46783. var _create = __webpack_require__(76);
  46784. var gOPNExt = __webpack_require__(354);
  46785. var $GOPD = __webpack_require__(113);
  46786. var $GOPS = __webpack_require__(125);
  46787. var $DP = __webpack_require__(17);
  46788. var $keys = __webpack_require__(59);
  46789. var gOPD = $GOPD.f;
  46790. var dP = $DP.f;
  46791. var gOPN = gOPNExt.f;
  46792. var $Symbol = global.Symbol;
  46793. var $JSON = global.JSON;
  46794. var _stringify = $JSON && $JSON.stringify;
  46795. var PROTOTYPE = 'prototype';
  46796. var HIDDEN = wks('_hidden');
  46797. var TO_PRIMITIVE = wks('toPrimitive');
  46798. var isEnum = {}.propertyIsEnumerable;
  46799. var SymbolRegistry = shared('symbol-registry');
  46800. var AllSymbols = shared('symbols');
  46801. var OPSymbols = shared('op-symbols');
  46802. var ObjectProto = Object[PROTOTYPE];
  46803. var USE_NATIVE = typeof $Symbol == 'function' && !!$GOPS.f;
  46804. var QObject = global.QObject;
  46805. // Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
  46806. var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;
  46807. // fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687
  46808. var setSymbolDesc = DESCRIPTORS && $fails(function () {
  46809. return _create(dP({}, 'a', {
  46810. get: function () { return dP(this, 'a', { value: 7 }).a; }
  46811. })).a != 7;
  46812. }) ? function (it, key, D) {
  46813. var protoDesc = gOPD(ObjectProto, key);
  46814. if (protoDesc) delete ObjectProto[key];
  46815. dP(it, key, D);
  46816. if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc);
  46817. } : dP;
  46818. var wrap = function (tag) {
  46819. var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]);
  46820. sym._k = tag;
  46821. return sym;
  46822. };
  46823. var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) {
  46824. return typeof it == 'symbol';
  46825. } : function (it) {
  46826. return it instanceof $Symbol;
  46827. };
  46828. var $defineProperty = function defineProperty(it, key, D) {
  46829. if (it === ObjectProto) $defineProperty(OPSymbols, key, D);
  46830. anObject(it);
  46831. key = toPrimitive(key, true);
  46832. anObject(D);
  46833. if (has(AllSymbols, key)) {
  46834. if (!D.enumerable) {
  46835. if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {}));
  46836. it[HIDDEN][key] = true;
  46837. } else {
  46838. if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false;
  46839. D = _create(D, { enumerable: createDesc(0, false) });
  46840. } return setSymbolDesc(it, key, D);
  46841. } return dP(it, key, D);
  46842. };
  46843. var $defineProperties = function defineProperties(it, P) {
  46844. anObject(it);
  46845. var keys = enumKeys(P = toIObject(P));
  46846. var i = 0;
  46847. var l = keys.length;
  46848. var key;
  46849. while (l > i) $defineProperty(it, key = keys[i++], P[key]);
  46850. return it;
  46851. };
  46852. var $create = function create(it, P) {
  46853. return P === undefined ? _create(it) : $defineProperties(_create(it), P);
  46854. };
  46855. var $propertyIsEnumerable = function propertyIsEnumerable(key) {
  46856. var E = isEnum.call(this, key = toPrimitive(key, true));
  46857. if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false;
  46858. return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;
  46859. };
  46860. var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) {
  46861. it = toIObject(it);
  46862. key = toPrimitive(key, true);
  46863. if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return;
  46864. var D = gOPD(it, key);
  46865. if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true;
  46866. return D;
  46867. };
  46868. var $getOwnPropertyNames = function getOwnPropertyNames(it) {
  46869. var names = gOPN(toIObject(it));
  46870. var result = [];
  46871. var i = 0;
  46872. var key;
  46873. while (names.length > i) {
  46874. if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key);
  46875. } return result;
  46876. };
  46877. var $getOwnPropertySymbols = function getOwnPropertySymbols(it) {
  46878. var IS_OP = it === ObjectProto;
  46879. var names = gOPN(IS_OP ? OPSymbols : toIObject(it));
  46880. var result = [];
  46881. var i = 0;
  46882. var key;
  46883. while (names.length > i) {
  46884. if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]);
  46885. } return result;
  46886. };
  46887. // 19.4.1.1 Symbol([description])
  46888. if (!USE_NATIVE) {
  46889. $Symbol = function Symbol() {
  46890. if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!');
  46891. var tag = uid(arguments.length > 0 ? arguments[0] : undefined);
  46892. var $set = function (value) {
  46893. if (this === ObjectProto) $set.call(OPSymbols, value);
  46894. if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;
  46895. setSymbolDesc(this, tag, createDesc(1, value));
  46896. };
  46897. if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set });
  46898. return wrap(tag);
  46899. };
  46900. redefine($Symbol[PROTOTYPE], 'toString', function toString() {
  46901. return this._k;
  46902. });
  46903. $GOPD.f = $getOwnPropertyDescriptor;
  46904. $DP.f = $defineProperty;
  46905. __webpack_require__(190).f = gOPNExt.f = $getOwnPropertyNames;
  46906. __webpack_require__(73).f = $propertyIsEnumerable;
  46907. $GOPS.f = $getOwnPropertySymbols;
  46908. if (DESCRIPTORS && !__webpack_require__(75)) {
  46909. redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);
  46910. }
  46911. wksExt.f = function (name) {
  46912. return wrap(wks(name));
  46913. };
  46914. }
  46915. $export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol });
  46916. for (var es6Symbols = (
  46917. // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14
  46918. 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'
  46919. ).split(','), j = 0; es6Symbols.length > j;)wks(es6Symbols[j++]);
  46920. for (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]);
  46921. $export($export.S + $export.F * !USE_NATIVE, 'Symbol', {
  46922. // 19.4.2.1 Symbol.for(key)
  46923. 'for': function (key) {
  46924. return has(SymbolRegistry, key += '')
  46925. ? SymbolRegistry[key]
  46926. : SymbolRegistry[key] = $Symbol(key);
  46927. },
  46928. // 19.4.2.5 Symbol.keyFor(sym)
  46929. keyFor: function keyFor(sym) {
  46930. if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!');
  46931. for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key;
  46932. },
  46933. useSetter: function () { setter = true; },
  46934. useSimple: function () { setter = false; }
  46935. });
  46936. $export($export.S + $export.F * !USE_NATIVE, 'Object', {
  46937. // 19.1.2.2 Object.create(O [, Properties])
  46938. create: $create,
  46939. // 19.1.2.4 Object.defineProperty(O, P, Attributes)
  46940. defineProperty: $defineProperty,
  46941. // 19.1.2.3 Object.defineProperties(O, Properties)
  46942. defineProperties: $defineProperties,
  46943. // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
  46944. getOwnPropertyDescriptor: $getOwnPropertyDescriptor,
  46945. // 19.1.2.7 Object.getOwnPropertyNames(O)
  46946. getOwnPropertyNames: $getOwnPropertyNames,
  46947. // 19.1.2.8 Object.getOwnPropertySymbols(O)
  46948. getOwnPropertySymbols: $getOwnPropertySymbols
  46949. });
  46950. // Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives
  46951. // https://bugs.chromium.org/p/v8/issues/detail?id=3443
  46952. var FAILS_ON_PRIMITIVES = $fails(function () { $GOPS.f(1); });
  46953. $export($export.S + $export.F * FAILS_ON_PRIMITIVES, 'Object', {
  46954. getOwnPropertySymbols: function getOwnPropertySymbols(it) {
  46955. return $GOPS.f(toObject(it));
  46956. }
  46957. });
  46958. // 24.3.2 JSON.stringify(value [, replacer [, space]])
  46959. $JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () {
  46960. var S = $Symbol();
  46961. // MS Edge converts symbol values to JSON as {}
  46962. // WebKit converts symbol values to JSON as null
  46963. // V8 throws on boxed symbols
  46964. return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}';
  46965. })), 'JSON', {
  46966. stringify: function stringify(it) {
  46967. var args = [it];
  46968. var i = 1;
  46969. var replacer, $replacer;
  46970. while (arguments.length > i) args.push(arguments[i++]);
  46971. $replacer = replacer = args[1];
  46972. if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined
  46973. if (!isArray(replacer)) replacer = function (key, value) {
  46974. if (typeof $replacer == 'function') value = $replacer.call(this, key, value);
  46975. if (!isSymbol(value)) return value;
  46976. };
  46977. args[1] = replacer;
  46978. return _stringify.apply($JSON, args);
  46979. }
  46980. });
  46981. // 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)
  46982. $Symbol[PROTOTYPE][TO_PRIMITIVE] || __webpack_require__(27)($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);
  46983. // 19.4.3.5 Symbol.prototype[@@toStringTag]
  46984. setToStringTag($Symbol, 'Symbol');
  46985. // 20.2.1.9 Math[@@toStringTag]
  46986. setToStringTag(Math, 'Math', true);
  46987. // 24.3.3 JSON[@@toStringTag]
  46988. setToStringTag(global.JSON, 'JSON', true);
  46989. /***/ }),
  46990. /* 353 */
  46991. /***/ (function(module, exports, __webpack_require__) {
  46992. // all enumerable object keys, includes symbols
  46993. var getKeys = __webpack_require__(59);
  46994. var gOPS = __webpack_require__(125);
  46995. var pIE = __webpack_require__(73);
  46996. module.exports = function (it) {
  46997. var result = getKeys(it);
  46998. var getSymbols = gOPS.f;
  46999. if (getSymbols) {
  47000. var symbols = getSymbols(it);
  47001. var isEnum = pIE.f;
  47002. var i = 0;
  47003. var key;
  47004. while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key);
  47005. } return result;
  47006. };
  47007. /***/ }),
  47008. /* 354 */
  47009. /***/ (function(module, exports, __webpack_require__) {
  47010. // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
  47011. var toIObject = __webpack_require__(35);
  47012. var gOPN = __webpack_require__(190).f;
  47013. var toString = {}.toString;
  47014. var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
  47015. ? Object.getOwnPropertyNames(window) : [];
  47016. var getWindowNames = function (it) {
  47017. try {
  47018. return gOPN(it);
  47019. } catch (e) {
  47020. return windowNames.slice();
  47021. }
  47022. };
  47023. module.exports.f = function getOwnPropertyNames(it) {
  47024. return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it));
  47025. };
  47026. /***/ }),
  47027. /* 355 */
  47028. /***/ (function(module, exports, __webpack_require__) {
  47029. __webpack_require__(124)('asyncIterator');
  47030. /***/ }),
  47031. /* 356 */
  47032. /***/ (function(module, exports, __webpack_require__) {
  47033. __webpack_require__(124)('observable');
  47034. /***/ }),
  47035. /* 357 */
  47036. /***/ (function(module, exports, __webpack_require__) {
  47037. module.exports = { "default": __webpack_require__(358), __esModule: true };
  47038. /***/ }),
  47039. /* 358 */
  47040. /***/ (function(module, exports, __webpack_require__) {
  47041. __webpack_require__(359);
  47042. module.exports = __webpack_require__(2).Object.keys;
  47043. /***/ }),
  47044. /* 359 */
  47045. /***/ (function(module, exports, __webpack_require__) {
  47046. // 19.1.2.14 Object.keys(O)
  47047. var toObject = __webpack_require__(50);
  47048. var $keys = __webpack_require__(59);
  47049. __webpack_require__(115)('keys', function () {
  47050. return function keys(it) {
  47051. return $keys(toObject(it));
  47052. };
  47053. });
  47054. /***/ }),
  47055. /* 360 */
  47056. /***/ (function(module, exports, __webpack_require__) {
  47057. __webpack_require__(361);
  47058. var $Object = __webpack_require__(2).Object;
  47059. module.exports = function defineProperty(it, key, desc) {
  47060. return $Object.defineProperty(it, key, desc);
  47061. };
  47062. /***/ }),
  47063. /* 361 */
  47064. /***/ (function(module, exports, __webpack_require__) {
  47065. var $export = __webpack_require__(7);
  47066. // 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)
  47067. $export($export.S + $export.F * !__webpack_require__(13), 'Object', { defineProperty: __webpack_require__(17).f });
  47068. /***/ }),
  47069. /* 362 */
  47070. /***/ (function(module, exports, __webpack_require__) {
  47071. "use strict";
  47072. exports.__esModule = true;
  47073. exports.default = function (instance, Constructor) {
  47074. if (!(instance instanceof Constructor)) {
  47075. throw new TypeError("Cannot call a class as a function");
  47076. }
  47077. };
  47078. /***/ }),
  47079. /* 363 */
  47080. /***/ (function(module, exports, __webpack_require__) {
  47081. "use strict";
  47082. exports.__esModule = true;
  47083. var _defineProperty = __webpack_require__(191);
  47084. var _defineProperty2 = _interopRequireDefault(_defineProperty);
  47085. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  47086. exports.default = function () {
  47087. function defineProperties(target, props) {
  47088. for (var i = 0; i < props.length; i++) {
  47089. var descriptor = props[i];
  47090. descriptor.enumerable = descriptor.enumerable || false;
  47091. descriptor.configurable = true;
  47092. if ("value" in descriptor) descriptor.writable = true;
  47093. (0, _defineProperty2.default)(target, descriptor.key, descriptor);
  47094. }
  47095. }
  47096. return function (Constructor, protoProps, staticProps) {
  47097. if (protoProps) defineProperties(Constructor.prototype, protoProps);
  47098. if (staticProps) defineProperties(Constructor, staticProps);
  47099. return Constructor;
  47100. };
  47101. }();
  47102. /***/ }),
  47103. /* 364 */
  47104. /***/ (function(module, exports, __webpack_require__) {
  47105. module.exports = { "default": __webpack_require__(365), __esModule: true };
  47106. /***/ }),
  47107. /* 365 */
  47108. /***/ (function(module, exports, __webpack_require__) {
  47109. __webpack_require__(126);
  47110. __webpack_require__(60);
  47111. __webpack_require__(74);
  47112. __webpack_require__(366);
  47113. __webpack_require__(371);
  47114. __webpack_require__(373);
  47115. __webpack_require__(374);
  47116. module.exports = __webpack_require__(2).Map;
  47117. /***/ }),
  47118. /* 366 */
  47119. /***/ (function(module, exports, __webpack_require__) {
  47120. "use strict";
  47121. var strong = __webpack_require__(192);
  47122. var validate = __webpack_require__(127);
  47123. var MAP = 'Map';
  47124. // 23.1 Map Objects
  47125. module.exports = __webpack_require__(197)(MAP, function (get) {
  47126. return function Map() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };
  47127. }, {
  47128. // 23.1.3.6 Map.prototype.get(key)
  47129. get: function get(key) {
  47130. var entry = strong.getEntry(validate(this, MAP), key);
  47131. return entry && entry.v;
  47132. },
  47133. // 23.1.3.9 Map.prototype.set(key, value)
  47134. set: function set(key, value) {
  47135. return strong.def(validate(this, MAP), key === 0 ? 0 : key, value);
  47136. }
  47137. }, strong, true);
  47138. /***/ }),
  47139. /* 367 */
  47140. /***/ (function(module, exports, __webpack_require__) {
  47141. "use strict";
  47142. var global = __webpack_require__(21);
  47143. var core = __webpack_require__(2);
  47144. var dP = __webpack_require__(17);
  47145. var DESCRIPTORS = __webpack_require__(13);
  47146. var SPECIES = __webpack_require__(14)('species');
  47147. module.exports = function (KEY) {
  47148. var C = typeof core[KEY] == 'function' ? core[KEY] : global[KEY];
  47149. if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, {
  47150. configurable: true,
  47151. get: function () { return this; }
  47152. });
  47153. };
  47154. /***/ }),
  47155. /* 368 */
  47156. /***/ (function(module, exports, __webpack_require__) {
  47157. // 0 -> Array#forEach
  47158. // 1 -> Array#map
  47159. // 2 -> Array#filter
  47160. // 3 -> Array#some
  47161. // 4 -> Array#every
  47162. // 5 -> Array#find
  47163. // 6 -> Array#findIndex
  47164. var ctx = __webpack_require__(38);
  47165. var IObject = __webpack_require__(110);
  47166. var toObject = __webpack_require__(50);
  47167. var toLength = __webpack_require__(77);
  47168. var asc = __webpack_require__(369);
  47169. module.exports = function (TYPE, $create) {
  47170. var IS_MAP = TYPE == 1;
  47171. var IS_FILTER = TYPE == 2;
  47172. var IS_SOME = TYPE == 3;
  47173. var IS_EVERY = TYPE == 4;
  47174. var IS_FIND_INDEX = TYPE == 6;
  47175. var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
  47176. var create = $create || asc;
  47177. return function ($this, callbackfn, that) {
  47178. var O = toObject($this);
  47179. var self = IObject(O);
  47180. var f = ctx(callbackfn, that, 3);
  47181. var length = toLength(self.length);
  47182. var index = 0;
  47183. var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;
  47184. var val, res;
  47185. for (;length > index; index++) if (NO_HOLES || index in self) {
  47186. val = self[index];
  47187. res = f(val, index, O);
  47188. if (TYPE) {
  47189. if (IS_MAP) result[index] = res; // map
  47190. else if (res) switch (TYPE) {
  47191. case 3: return true; // some
  47192. case 5: return val; // find
  47193. case 6: return index; // findIndex
  47194. case 2: result.push(val); // filter
  47195. } else if (IS_EVERY) return false; // every
  47196. }
  47197. }
  47198. return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result;
  47199. };
  47200. };
  47201. /***/ }),
  47202. /* 369 */
  47203. /***/ (function(module, exports, __webpack_require__) {
  47204. // 9.4.2.3 ArraySpeciesCreate(originalArray, length)
  47205. var speciesConstructor = __webpack_require__(370);
  47206. module.exports = function (original, length) {
  47207. return new (speciesConstructor(original))(length);
  47208. };
  47209. /***/ }),
  47210. /* 370 */
  47211. /***/ (function(module, exports, __webpack_require__) {
  47212. var isObject = __webpack_require__(20);
  47213. var isArray = __webpack_require__(189);
  47214. var SPECIES = __webpack_require__(14)('species');
  47215. module.exports = function (original) {
  47216. var C;
  47217. if (isArray(original)) {
  47218. C = original.constructor;
  47219. // cross-realm fallback
  47220. if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
  47221. if (isObject(C)) {
  47222. C = C[SPECIES];
  47223. if (C === null) C = undefined;
  47224. }
  47225. } return C === undefined ? Array : C;
  47226. };
  47227. /***/ }),
  47228. /* 371 */
  47229. /***/ (function(module, exports, __webpack_require__) {
  47230. // https://github.com/DavidBruant/Map-Set.prototype.toJSON
  47231. var $export = __webpack_require__(7);
  47232. $export($export.P + $export.R, 'Map', { toJSON: __webpack_require__(198)('Map') });
  47233. /***/ }),
  47234. /* 372 */
  47235. /***/ (function(module, exports, __webpack_require__) {
  47236. var forOf = __webpack_require__(81);
  47237. module.exports = function (iter, ITERATOR) {
  47238. var result = [];
  47239. forOf(iter, false, result.push, result, ITERATOR);
  47240. return result;
  47241. };
  47242. /***/ }),
  47243. /* 373 */
  47244. /***/ (function(module, exports, __webpack_require__) {
  47245. // https://tc39.github.io/proposal-setmap-offrom/#sec-map.of
  47246. __webpack_require__(199)('Map');
  47247. /***/ }),
  47248. /* 374 */
  47249. /***/ (function(module, exports, __webpack_require__) {
  47250. // https://tc39.github.io/proposal-setmap-offrom/#sec-map.from
  47251. __webpack_require__(200)('Map');
  47252. /***/ }),
  47253. /* 375 */
  47254. /***/ (function(module, exports, __webpack_require__) {
  47255. "use strict";
  47256. exports.__esModule = true;
  47257. var _typeof2 = __webpack_require__(122);
  47258. var _typeof3 = _interopRequireDefault(_typeof2);
  47259. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  47260. exports.default = function (self, call) {
  47261. if (!self) {
  47262. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  47263. }
  47264. return call && ((typeof call === "undefined" ? "undefined" : (0, _typeof3.default)(call)) === "object" || typeof call === "function") ? call : self;
  47265. };
  47266. /***/ }),
  47267. /* 376 */
  47268. /***/ (function(module, exports, __webpack_require__) {
  47269. "use strict";
  47270. exports.__esModule = true;
  47271. var _setPrototypeOf = __webpack_require__(377);
  47272. var _setPrototypeOf2 = _interopRequireDefault(_setPrototypeOf);
  47273. var _create = __webpack_require__(381);
  47274. var _create2 = _interopRequireDefault(_create);
  47275. var _typeof2 = __webpack_require__(122);
  47276. var _typeof3 = _interopRequireDefault(_typeof2);
  47277. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  47278. exports.default = function (subClass, superClass) {
  47279. if (typeof superClass !== "function" && superClass !== null) {
  47280. throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === "undefined" ? "undefined" : (0, _typeof3.default)(superClass)));
  47281. }
  47282. subClass.prototype = (0, _create2.default)(superClass && superClass.prototype, {
  47283. constructor: {
  47284. value: subClass,
  47285. enumerable: false,
  47286. writable: true,
  47287. configurable: true
  47288. }
  47289. });
  47290. if (superClass) _setPrototypeOf2.default ? (0, _setPrototypeOf2.default)(subClass, superClass) : subClass.__proto__ = superClass;
  47291. };
  47292. /***/ }),
  47293. /* 377 */
  47294. /***/ (function(module, exports, __webpack_require__) {
  47295. module.exports = { "default": __webpack_require__(378), __esModule: true };
  47296. /***/ }),
  47297. /* 378 */
  47298. /***/ (function(module, exports, __webpack_require__) {
  47299. __webpack_require__(379);
  47300. module.exports = __webpack_require__(2).Object.setPrototypeOf;
  47301. /***/ }),
  47302. /* 379 */
  47303. /***/ (function(module, exports, __webpack_require__) {
  47304. // 19.1.3.19 Object.setPrototypeOf(O, proto)
  47305. var $export = __webpack_require__(7);
  47306. $export($export.S, 'Object', { setPrototypeOf: __webpack_require__(380).set });
  47307. /***/ }),
  47308. /* 380 */
  47309. /***/ (function(module, exports, __webpack_require__) {
  47310. // Works with __proto__ only. Old v8 can't work with null proto objects.
  47311. /* eslint-disable no-proto */
  47312. var isObject = __webpack_require__(20);
  47313. var anObject = __webpack_require__(28);
  47314. var check = function (O, proto) {
  47315. anObject(O);
  47316. if (!isObject(proto) && proto !== null) throw TypeError(proto + ": can't set as prototype!");
  47317. };
  47318. module.exports = {
  47319. set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line
  47320. function (test, buggy, set) {
  47321. try {
  47322. set = __webpack_require__(38)(Function.call, __webpack_require__(113).f(Object.prototype, '__proto__').set, 2);
  47323. set(test, []);
  47324. buggy = !(test instanceof Array);
  47325. } catch (e) { buggy = true; }
  47326. return function setPrototypeOf(O, proto) {
  47327. check(O, proto);
  47328. if (buggy) O.__proto__ = proto;
  47329. else set(O, proto);
  47330. return O;
  47331. };
  47332. }({}, false) : undefined),
  47333. check: check
  47334. };
  47335. /***/ }),
  47336. /* 381 */
  47337. /***/ (function(module, exports, __webpack_require__) {
  47338. module.exports = { "default": __webpack_require__(382), __esModule: true };
  47339. /***/ }),
  47340. /* 382 */
  47341. /***/ (function(module, exports, __webpack_require__) {
  47342. __webpack_require__(383);
  47343. var $Object = __webpack_require__(2).Object;
  47344. module.exports = function create(P, D) {
  47345. return $Object.create(P, D);
  47346. };
  47347. /***/ }),
  47348. /* 383 */
  47349. /***/ (function(module, exports, __webpack_require__) {
  47350. var $export = __webpack_require__(7);
  47351. // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
  47352. $export($export.S, 'Object', { create: __webpack_require__(76) });
  47353. /***/ }),
  47354. /* 384 */
  47355. /***/ (function(module, exports, __webpack_require__) {
  47356. module.exports = { "default": __webpack_require__(385), __esModule: true };
  47357. /***/ }),
  47358. /* 385 */
  47359. /***/ (function(module, exports, __webpack_require__) {
  47360. __webpack_require__(386);
  47361. var $Object = __webpack_require__(2).Object;
  47362. module.exports = function defineProperties(T, D) {
  47363. return $Object.defineProperties(T, D);
  47364. };
  47365. /***/ }),
  47366. /* 386 */
  47367. /***/ (function(module, exports, __webpack_require__) {
  47368. var $export = __webpack_require__(7);
  47369. // 19.1.2.3 / 15.2.3.7 Object.defineProperties(O, Properties)
  47370. $export($export.S + $export.F * !__webpack_require__(13), 'Object', { defineProperties: __webpack_require__(185) });
  47371. /***/ }),
  47372. /* 387 */
  47373. /***/ (function(module, exports, __webpack_require__) {
  47374. var objectKeys = __webpack_require__(201);
  47375. var isArguments = __webpack_require__(389);
  47376. var is = __webpack_require__(390);
  47377. var isRegex = __webpack_require__(391);
  47378. var flags = __webpack_require__(394);
  47379. var isDate = __webpack_require__(400);
  47380. var getTime = Date.prototype.getTime;
  47381. function deepEqual(actual, expected, options) {
  47382. var opts = options || {};
  47383. // 7.1. All identical values are equivalent, as determined by ===.
  47384. if (opts.strict ? is(actual, expected) : actual === expected) {
  47385. return true;
  47386. }
  47387. // 7.3. Other pairs that do not both pass typeof value == 'object', equivalence is determined by ==.
  47388. if (!actual || !expected || (typeof actual !== 'object' && typeof expected !== 'object')) {
  47389. return opts.strict ? is(actual, expected) : actual == expected;
  47390. }
  47391. /*
  47392. * 7.4. For all other Object pairs, including Array objects, equivalence is
  47393. * determined by having the same number of owned properties (as verified
  47394. * with Object.prototype.hasOwnProperty.call), the same set of keys
  47395. * (although not necessarily the same order), equivalent values for every
  47396. * corresponding key, and an identical 'prototype' property. Note: this
  47397. * accounts for both named and indexed properties on Arrays.
  47398. */
  47399. // eslint-disable-next-line no-use-before-define
  47400. return objEquiv(actual, expected, opts);
  47401. }
  47402. function isUndefinedOrNull(value) {
  47403. return value === null || value === undefined;
  47404. }
  47405. function isBuffer(x) {
  47406. if (!x || typeof x !== 'object' || typeof x.length !== 'number') {
  47407. return false;
  47408. }
  47409. if (typeof x.copy !== 'function' || typeof x.slice !== 'function') {
  47410. return false;
  47411. }
  47412. if (x.length > 0 && typeof x[0] !== 'number') {
  47413. return false;
  47414. }
  47415. return true;
  47416. }
  47417. function objEquiv(a, b, opts) {
  47418. /* eslint max-statements: [2, 50] */
  47419. var i, key;
  47420. if (typeof a !== typeof b) { return false; }
  47421. if (isUndefinedOrNull(a) || isUndefinedOrNull(b)) { return false; }
  47422. // an identical 'prototype' property.
  47423. if (a.prototype !== b.prototype) { return false; }
  47424. if (isArguments(a) !== isArguments(b)) { return false; }
  47425. var aIsRegex = isRegex(a);
  47426. var bIsRegex = isRegex(b);
  47427. if (aIsRegex !== bIsRegex) { return false; }
  47428. if (aIsRegex || bIsRegex) {
  47429. return a.source === b.source && flags(a) === flags(b);
  47430. }
  47431. if (isDate(a) && isDate(b)) {
  47432. return getTime.call(a) === getTime.call(b);
  47433. }
  47434. var aIsBuffer = isBuffer(a);
  47435. var bIsBuffer = isBuffer(b);
  47436. if (aIsBuffer !== bIsBuffer) { return false; }
  47437. if (aIsBuffer || bIsBuffer) { // && would work too, because both are true or both false here
  47438. if (a.length !== b.length) { return false; }
  47439. for (i = 0; i < a.length; i++) {
  47440. if (a[i] !== b[i]) { return false; }
  47441. }
  47442. return true;
  47443. }
  47444. if (typeof a !== typeof b) { return false; }
  47445. try {
  47446. var ka = objectKeys(a);
  47447. var kb = objectKeys(b);
  47448. } catch (e) { // happens when one is a string literal and the other isn't
  47449. return false;
  47450. }
  47451. // having the same number of owned properties (keys incorporates hasOwnProperty)
  47452. if (ka.length !== kb.length) { return false; }
  47453. // the same set of keys (although not necessarily the same order),
  47454. ka.sort();
  47455. kb.sort();
  47456. // ~~~cheap key test
  47457. for (i = ka.length - 1; i >= 0; i--) {
  47458. if (ka[i] != kb[i]) { return false; }
  47459. }
  47460. // equivalent values for every corresponding key, and ~~~possibly expensive deep test
  47461. for (i = ka.length - 1; i >= 0; i--) {
  47462. key = ka[i];
  47463. if (!deepEqual(a[key], b[key], opts)) { return false; }
  47464. }
  47465. return true;
  47466. }
  47467. module.exports = deepEqual;
  47468. /***/ }),
  47469. /* 388 */
  47470. /***/ (function(module, exports, __webpack_require__) {
  47471. "use strict";
  47472. var keysShim;
  47473. if (!Object.keys) {
  47474. // modified from https://github.com/es-shims/es5-shim
  47475. var has = Object.prototype.hasOwnProperty;
  47476. var toStr = Object.prototype.toString;
  47477. var isArgs = __webpack_require__(202); // eslint-disable-line global-require
  47478. var isEnumerable = Object.prototype.propertyIsEnumerable;
  47479. var hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString');
  47480. var hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype');
  47481. var dontEnums = [
  47482. 'toString',
  47483. 'toLocaleString',
  47484. 'valueOf',
  47485. 'hasOwnProperty',
  47486. 'isPrototypeOf',
  47487. 'propertyIsEnumerable',
  47488. 'constructor'
  47489. ];
  47490. var equalsConstructorPrototype = function (o) {
  47491. var ctor = o.constructor;
  47492. return ctor && ctor.prototype === o;
  47493. };
  47494. var excludedKeys = {
  47495. $applicationCache: true,
  47496. $console: true,
  47497. $external: true,
  47498. $frame: true,
  47499. $frameElement: true,
  47500. $frames: true,
  47501. $innerHeight: true,
  47502. $innerWidth: true,
  47503. $onmozfullscreenchange: true,
  47504. $onmozfullscreenerror: true,
  47505. $outerHeight: true,
  47506. $outerWidth: true,
  47507. $pageXOffset: true,
  47508. $pageYOffset: true,
  47509. $parent: true,
  47510. $scrollLeft: true,
  47511. $scrollTop: true,
  47512. $scrollX: true,
  47513. $scrollY: true,
  47514. $self: true,
  47515. $webkitIndexedDB: true,
  47516. $webkitStorageInfo: true,
  47517. $window: true
  47518. };
  47519. var hasAutomationEqualityBug = (function () {
  47520. /* global window */
  47521. if (typeof window === 'undefined') { return false; }
  47522. for (var k in window) {
  47523. try {
  47524. if (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') {
  47525. try {
  47526. equalsConstructorPrototype(window[k]);
  47527. } catch (e) {
  47528. return true;
  47529. }
  47530. }
  47531. } catch (e) {
  47532. return true;
  47533. }
  47534. }
  47535. return false;
  47536. }());
  47537. var equalsConstructorPrototypeIfNotBuggy = function (o) {
  47538. /* global window */
  47539. if (typeof window === 'undefined' || !hasAutomationEqualityBug) {
  47540. return equalsConstructorPrototype(o);
  47541. }
  47542. try {
  47543. return equalsConstructorPrototype(o);
  47544. } catch (e) {
  47545. return false;
  47546. }
  47547. };
  47548. keysShim = function keys(object) {
  47549. var isObject = object !== null && typeof object === 'object';
  47550. var isFunction = toStr.call(object) === '[object Function]';
  47551. var isArguments = isArgs(object);
  47552. var isString = isObject && toStr.call(object) === '[object String]';
  47553. var theKeys = [];
  47554. if (!isObject && !isFunction && !isArguments) {
  47555. throw new TypeError('Object.keys called on a non-object');
  47556. }
  47557. var skipProto = hasProtoEnumBug && isFunction;
  47558. if (isString && object.length > 0 && !has.call(object, 0)) {
  47559. for (var i = 0; i < object.length; ++i) {
  47560. theKeys.push(String(i));
  47561. }
  47562. }
  47563. if (isArguments && object.length > 0) {
  47564. for (var j = 0; j < object.length; ++j) {
  47565. theKeys.push(String(j));
  47566. }
  47567. } else {
  47568. for (var name in object) {
  47569. if (!(skipProto && name === 'prototype') && has.call(object, name)) {
  47570. theKeys.push(String(name));
  47571. }
  47572. }
  47573. }
  47574. if (hasDontEnumBug) {
  47575. var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object);
  47576. for (var k = 0; k < dontEnums.length; ++k) {
  47577. if (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) {
  47578. theKeys.push(dontEnums[k]);
  47579. }
  47580. }
  47581. }
  47582. return theKeys;
  47583. };
  47584. }
  47585. module.exports = keysShim;
  47586. /***/ }),
  47587. /* 389 */
  47588. /***/ (function(module, exports, __webpack_require__) {
  47589. "use strict";
  47590. var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol';
  47591. var toStr = Object.prototype.toString;
  47592. var isStandardArguments = function isArguments(value) {
  47593. if (hasToStringTag && value && typeof value === 'object' && Symbol.toStringTag in value) {
  47594. return false;
  47595. }
  47596. return toStr.call(value) === '[object Arguments]';
  47597. };
  47598. var isLegacyArguments = function isArguments(value) {
  47599. if (isStandardArguments(value)) {
  47600. return true;
  47601. }
  47602. return value !== null &&
  47603. typeof value === 'object' &&
  47604. typeof value.length === 'number' &&
  47605. value.length >= 0 &&
  47606. toStr.call(value) !== '[object Array]' &&
  47607. toStr.call(value.callee) === '[object Function]';
  47608. };
  47609. var supportsStandardArguments = (function () {
  47610. return isStandardArguments(arguments);
  47611. }());
  47612. isStandardArguments.isLegacyArguments = isLegacyArguments; // for tests
  47613. module.exports = supportsStandardArguments ? isStandardArguments : isLegacyArguments;
  47614. /***/ }),
  47615. /* 390 */
  47616. /***/ (function(module, exports, __webpack_require__) {
  47617. "use strict";
  47618. // http://www.ecma-international.org/ecma-262/6.0/#sec-object.is
  47619. var numberIsNaN = function (value) {
  47620. return value !== value;
  47621. };
  47622. module.exports = function is(a, b) {
  47623. if (a === 0 && b === 0) {
  47624. return 1 / a === 1 / b;
  47625. }
  47626. if (a === b) {
  47627. return true;
  47628. }
  47629. if (numberIsNaN(a) && numberIsNaN(b)) {
  47630. return true;
  47631. }
  47632. return false;
  47633. };
  47634. /***/ }),
  47635. /* 391 */
  47636. /***/ (function(module, exports, __webpack_require__) {
  47637. "use strict";
  47638. var has = __webpack_require__(392);
  47639. var regexExec = RegExp.prototype.exec;
  47640. var gOPD = Object.getOwnPropertyDescriptor;
  47641. var tryRegexExecCall = function tryRegexExec(value) {
  47642. try {
  47643. var lastIndex = value.lastIndex;
  47644. value.lastIndex = 0; // eslint-disable-line no-param-reassign
  47645. regexExec.call(value);
  47646. return true;
  47647. } catch (e) {
  47648. return false;
  47649. } finally {
  47650. value.lastIndex = lastIndex; // eslint-disable-line no-param-reassign
  47651. }
  47652. };
  47653. var toStr = Object.prototype.toString;
  47654. var regexClass = '[object RegExp]';
  47655. var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol';
  47656. module.exports = function isRegex(value) {
  47657. if (!value || typeof value !== 'object') {
  47658. return false;
  47659. }
  47660. if (!hasToStringTag) {
  47661. return toStr.call(value) === regexClass;
  47662. }
  47663. var descriptor = gOPD(value, 'lastIndex');
  47664. var hasLastIndexDataProperty = descriptor && has(descriptor, 'value');
  47665. if (!hasLastIndexDataProperty) {
  47666. return false;
  47667. }
  47668. return tryRegexExecCall(value);
  47669. };
  47670. /***/ }),
  47671. /* 392 */
  47672. /***/ (function(module, exports, __webpack_require__) {
  47673. "use strict";
  47674. var bind = __webpack_require__(128);
  47675. module.exports = bind.call(Function.call, Object.prototype.hasOwnProperty);
  47676. /***/ }),
  47677. /* 393 */
  47678. /***/ (function(module, exports, __webpack_require__) {
  47679. "use strict";
  47680. /* eslint no-invalid-this: 1 */
  47681. var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
  47682. var slice = Array.prototype.slice;
  47683. var toStr = Object.prototype.toString;
  47684. var funcType = '[object Function]';
  47685. module.exports = function bind(that) {
  47686. var target = this;
  47687. if (typeof target !== 'function' || toStr.call(target) !== funcType) {
  47688. throw new TypeError(ERROR_MESSAGE + target);
  47689. }
  47690. var args = slice.call(arguments, 1);
  47691. var bound;
  47692. var binder = function () {
  47693. if (this instanceof bound) {
  47694. var result = target.apply(
  47695. this,
  47696. args.concat(slice.call(arguments))
  47697. );
  47698. if (Object(result) === result) {
  47699. return result;
  47700. }
  47701. return this;
  47702. } else {
  47703. return target.apply(
  47704. that,
  47705. args.concat(slice.call(arguments))
  47706. );
  47707. }
  47708. };
  47709. var boundLength = Math.max(0, target.length - args.length);
  47710. var boundArgs = [];
  47711. for (var i = 0; i < boundLength; i++) {
  47712. boundArgs.push('$' + i);
  47713. }
  47714. bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);
  47715. if (target.prototype) {
  47716. var Empty = function Empty() {};
  47717. Empty.prototype = target.prototype;
  47718. bound.prototype = new Empty();
  47719. Empty.prototype = null;
  47720. }
  47721. return bound;
  47722. };
  47723. /***/ }),
  47724. /* 394 */
  47725. /***/ (function(module, exports, __webpack_require__) {
  47726. "use strict";
  47727. var define = __webpack_require__(129);
  47728. var callBind = __webpack_require__(395);
  47729. var implementation = __webpack_require__(203);
  47730. var getPolyfill = __webpack_require__(204);
  47731. var shim = __webpack_require__(399);
  47732. var flagsBound = callBind(implementation);
  47733. define(flagsBound, {
  47734. getPolyfill: getPolyfill,
  47735. implementation: implementation,
  47736. shim: shim
  47737. });
  47738. module.exports = flagsBound;
  47739. /***/ }),
  47740. /* 395 */
  47741. /***/ (function(module, exports, __webpack_require__) {
  47742. "use strict";
  47743. var bind = __webpack_require__(128);
  47744. var GetIntrinsic = __webpack_require__(396);
  47745. var $Function = GetIntrinsic('%Function%');
  47746. var $apply = $Function.apply;
  47747. var $call = $Function.call;
  47748. module.exports = function callBind() {
  47749. return bind.apply($call, arguments);
  47750. };
  47751. module.exports.apply = function applyBind() {
  47752. return bind.apply($apply, arguments);
  47753. };
  47754. /***/ }),
  47755. /* 396 */
  47756. /***/ (function(module, exports, __webpack_require__) {
  47757. "use strict";
  47758. /* globals
  47759. Atomics,
  47760. SharedArrayBuffer,
  47761. */
  47762. var undefined;
  47763. var $TypeError = TypeError;
  47764. var $gOPD = Object.getOwnPropertyDescriptor;
  47765. if ($gOPD) {
  47766. try {
  47767. $gOPD({}, '');
  47768. } catch (e) {
  47769. $gOPD = null; // this is IE 8, which has a broken gOPD
  47770. }
  47771. }
  47772. var throwTypeError = function () { throw new $TypeError(); };
  47773. var ThrowTypeError = $gOPD
  47774. ? (function () {
  47775. try {
  47776. // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties
  47777. arguments.callee; // IE 8 does not throw here
  47778. return throwTypeError;
  47779. } catch (calleeThrows) {
  47780. try {
  47781. // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')
  47782. return $gOPD(arguments, 'callee').get;
  47783. } catch (gOPDthrows) {
  47784. return throwTypeError;
  47785. }
  47786. }
  47787. }())
  47788. : throwTypeError;
  47789. var hasSymbols = __webpack_require__(397)();
  47790. var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto
  47791. var generator; // = function * () {};
  47792. var generatorFunction = generator ? getProto(generator) : undefined;
  47793. var asyncFn; // async function() {};
  47794. var asyncFunction = asyncFn ? asyncFn.constructor : undefined;
  47795. var asyncGen; // async function * () {};
  47796. var asyncGenFunction = asyncGen ? getProto(asyncGen) : undefined;
  47797. var asyncGenIterator = asyncGen ? asyncGen() : undefined;
  47798. var TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array);
  47799. var INTRINSICS = {
  47800. '%Array%': Array,
  47801. '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,
  47802. '%ArrayBufferPrototype%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer.prototype,
  47803. '%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined,
  47804. '%ArrayPrototype%': Array.prototype,
  47805. '%ArrayProto_entries%': Array.prototype.entries,
  47806. '%ArrayProto_forEach%': Array.prototype.forEach,
  47807. '%ArrayProto_keys%': Array.prototype.keys,
  47808. '%ArrayProto_values%': Array.prototype.values,
  47809. '%AsyncFromSyncIteratorPrototype%': undefined,
  47810. '%AsyncFunction%': asyncFunction,
  47811. '%AsyncFunctionPrototype%': asyncFunction ? asyncFunction.prototype : undefined,
  47812. '%AsyncGenerator%': asyncGen ? getProto(asyncGenIterator) : undefined,
  47813. '%AsyncGeneratorFunction%': asyncGenFunction,
  47814. '%AsyncGeneratorPrototype%': asyncGenFunction ? asyncGenFunction.prototype : undefined,
  47815. '%AsyncIteratorPrototype%': asyncGenIterator && hasSymbols && Symbol.asyncIterator ? asyncGenIterator[Symbol.asyncIterator]() : undefined,
  47816. '%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,
  47817. '%Boolean%': Boolean,
  47818. '%BooleanPrototype%': Boolean.prototype,
  47819. '%DataView%': typeof DataView === 'undefined' ? undefined : DataView,
  47820. '%DataViewPrototype%': typeof DataView === 'undefined' ? undefined : DataView.prototype,
  47821. '%Date%': Date,
  47822. '%DatePrototype%': Date.prototype,
  47823. '%decodeURI%': decodeURI,
  47824. '%decodeURIComponent%': decodeURIComponent,
  47825. '%encodeURI%': encodeURI,
  47826. '%encodeURIComponent%': encodeURIComponent,
  47827. '%Error%': Error,
  47828. '%ErrorPrototype%': Error.prototype,
  47829. '%eval%': eval, // eslint-disable-line no-eval
  47830. '%EvalError%': EvalError,
  47831. '%EvalErrorPrototype%': EvalError.prototype,
  47832. '%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,
  47833. '%Float32ArrayPrototype%': typeof Float32Array === 'undefined' ? undefined : Float32Array.prototype,
  47834. '%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,
  47835. '%Float64ArrayPrototype%': typeof Float64Array === 'undefined' ? undefined : Float64Array.prototype,
  47836. '%Function%': Function,
  47837. '%FunctionPrototype%': Function.prototype,
  47838. '%Generator%': generator ? getProto(generator()) : undefined,
  47839. '%GeneratorFunction%': generatorFunction,
  47840. '%GeneratorPrototype%': generatorFunction ? generatorFunction.prototype : undefined,
  47841. '%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array,
  47842. '%Int8ArrayPrototype%': typeof Int8Array === 'undefined' ? undefined : Int8Array.prototype,
  47843. '%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array,
  47844. '%Int16ArrayPrototype%': typeof Int16Array === 'undefined' ? undefined : Int8Array.prototype,
  47845. '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,
  47846. '%Int32ArrayPrototype%': typeof Int32Array === 'undefined' ? undefined : Int32Array.prototype,
  47847. '%isFinite%': isFinite,
  47848. '%isNaN%': isNaN,
  47849. '%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined,
  47850. '%JSON%': typeof JSON === 'object' ? JSON : undefined,
  47851. '%JSONParse%': typeof JSON === 'object' ? JSON.parse : undefined,
  47852. '%Map%': typeof Map === 'undefined' ? undefined : Map,
  47853. '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()),
  47854. '%MapPrototype%': typeof Map === 'undefined' ? undefined : Map.prototype,
  47855. '%Math%': Math,
  47856. '%Number%': Number,
  47857. '%NumberPrototype%': Number.prototype,
  47858. '%Object%': Object,
  47859. '%ObjectPrototype%': Object.prototype,
  47860. '%ObjProto_toString%': Object.prototype.toString,
  47861. '%ObjProto_valueOf%': Object.prototype.valueOf,
  47862. '%parseFloat%': parseFloat,
  47863. '%parseInt%': parseInt,
  47864. '%Promise%': typeof Promise === 'undefined' ? undefined : Promise,
  47865. '%PromisePrototype%': typeof Promise === 'undefined' ? undefined : Promise.prototype,
  47866. '%PromiseProto_then%': typeof Promise === 'undefined' ? undefined : Promise.prototype.then,
  47867. '%Promise_all%': typeof Promise === 'undefined' ? undefined : Promise.all,
  47868. '%Promise_reject%': typeof Promise === 'undefined' ? undefined : Promise.reject,
  47869. '%Promise_resolve%': typeof Promise === 'undefined' ? undefined : Promise.resolve,
  47870. '%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,
  47871. '%RangeError%': RangeError,
  47872. '%RangeErrorPrototype%': RangeError.prototype,
  47873. '%ReferenceError%': ReferenceError,
  47874. '%ReferenceErrorPrototype%': ReferenceError.prototype,
  47875. '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,
  47876. '%RegExp%': RegExp,
  47877. '%RegExpPrototype%': RegExp.prototype,
  47878. '%Set%': typeof Set === 'undefined' ? undefined : Set,
  47879. '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()),
  47880. '%SetPrototype%': typeof Set === 'undefined' ? undefined : Set.prototype,
  47881. '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,
  47882. '%SharedArrayBufferPrototype%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer.prototype,
  47883. '%String%': String,
  47884. '%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined,
  47885. '%StringPrototype%': String.prototype,
  47886. '%Symbol%': hasSymbols ? Symbol : undefined,
  47887. '%SymbolPrototype%': hasSymbols ? Symbol.prototype : undefined,
  47888. '%SyntaxError%': SyntaxError,
  47889. '%SyntaxErrorPrototype%': SyntaxError.prototype,
  47890. '%ThrowTypeError%': ThrowTypeError,
  47891. '%TypedArray%': TypedArray,
  47892. '%TypedArrayPrototype%': TypedArray ? TypedArray.prototype : undefined,
  47893. '%TypeError%': $TypeError,
  47894. '%TypeErrorPrototype%': $TypeError.prototype,
  47895. '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array,
  47896. '%Uint8ArrayPrototype%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array.prototype,
  47897. '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,
  47898. '%Uint8ClampedArrayPrototype%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray.prototype,
  47899. '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,
  47900. '%Uint16ArrayPrototype%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array.prototype,
  47901. '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,
  47902. '%Uint32ArrayPrototype%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array.prototype,
  47903. '%URIError%': URIError,
  47904. '%URIErrorPrototype%': URIError.prototype,
  47905. '%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,
  47906. '%WeakMapPrototype%': typeof WeakMap === 'undefined' ? undefined : WeakMap.prototype,
  47907. '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet,
  47908. '%WeakSetPrototype%': typeof WeakSet === 'undefined' ? undefined : WeakSet.prototype
  47909. };
  47910. var bind = __webpack_require__(128);
  47911. var $replace = bind.call(Function.call, String.prototype.replace);
  47912. /* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
  47913. var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
  47914. var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */
  47915. var stringToPath = function stringToPath(string) {
  47916. var result = [];
  47917. $replace(string, rePropName, function (match, number, quote, subString) {
  47918. result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : (number || match);
  47919. });
  47920. return result;
  47921. };
  47922. /* end adaptation */
  47923. var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
  47924. if (!(name in INTRINSICS)) {
  47925. throw new SyntaxError('intrinsic ' + name + ' does not exist!');
  47926. }
  47927. // istanbul ignore if // hopefully this is impossible to test :-)
  47928. if (typeof INTRINSICS[name] === 'undefined' && !allowMissing) {
  47929. throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
  47930. }
  47931. return INTRINSICS[name];
  47932. };
  47933. module.exports = function GetIntrinsic(name, allowMissing) {
  47934. if (typeof name !== 'string' || name.length === 0) {
  47935. throw new TypeError('intrinsic name must be a non-empty string');
  47936. }
  47937. if (arguments.length > 1 && typeof allowMissing !== 'boolean') {
  47938. throw new TypeError('"allowMissing" argument must be a boolean');
  47939. }
  47940. var parts = stringToPath(name);
  47941. var value = getBaseIntrinsic('%' + (parts.length > 0 ? parts[0] : '') + '%', allowMissing);
  47942. for (var i = 1; i < parts.length; i += 1) {
  47943. if (value != null) {
  47944. if ($gOPD && (i + 1) >= parts.length) {
  47945. var desc = $gOPD(value, parts[i]);
  47946. if (!allowMissing && !(parts[i] in value)) {
  47947. throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');
  47948. }
  47949. value = desc ? (desc.get || desc.value) : value[parts[i]];
  47950. } else {
  47951. value = value[parts[i]];
  47952. }
  47953. }
  47954. }
  47955. return value;
  47956. };
  47957. /***/ }),
  47958. /* 397 */
  47959. /***/ (function(module, exports, __webpack_require__) {
  47960. "use strict";
  47961. /* WEBPACK VAR INJECTION */(function(global) {
  47962. var origSymbol = global.Symbol;
  47963. var hasSymbolSham = __webpack_require__(398);
  47964. module.exports = function hasNativeSymbols() {
  47965. if (typeof origSymbol !== 'function') { return false; }
  47966. if (typeof Symbol !== 'function') { return false; }
  47967. if (typeof origSymbol('foo') !== 'symbol') { return false; }
  47968. if (typeof Symbol('bar') !== 'symbol') { return false; }
  47969. return hasSymbolSham();
  47970. };
  47971. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(22)))
  47972. /***/ }),
  47973. /* 398 */
  47974. /***/ (function(module, exports, __webpack_require__) {
  47975. "use strict";
  47976. /* eslint complexity: [2, 18], max-statements: [2, 33] */
  47977. module.exports = function hasSymbols() {
  47978. if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }
  47979. if (typeof Symbol.iterator === 'symbol') { return true; }
  47980. var obj = {};
  47981. var sym = Symbol('test');
  47982. var symObj = Object(sym);
  47983. if (typeof sym === 'string') { return false; }
  47984. if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }
  47985. if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }
  47986. // temp disabled per https://github.com/ljharb/object.assign/issues/17
  47987. // if (sym instanceof Symbol) { return false; }
  47988. // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4
  47989. // if (!(symObj instanceof Symbol)) { return false; }
  47990. // if (typeof Symbol.prototype.toString !== 'function') { return false; }
  47991. // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }
  47992. var symVal = 42;
  47993. obj[sym] = symVal;
  47994. for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax
  47995. if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }
  47996. if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }
  47997. var syms = Object.getOwnPropertySymbols(obj);
  47998. if (syms.length !== 1 || syms[0] !== sym) { return false; }
  47999. if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }
  48000. if (typeof Object.getOwnPropertyDescriptor === 'function') {
  48001. var descriptor = Object.getOwnPropertyDescriptor(obj, sym);
  48002. if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }
  48003. }
  48004. return true;
  48005. };
  48006. /***/ }),
  48007. /* 399 */
  48008. /***/ (function(module, exports, __webpack_require__) {
  48009. "use strict";
  48010. var supportsDescriptors = __webpack_require__(129).supportsDescriptors;
  48011. var getPolyfill = __webpack_require__(204);
  48012. var gOPD = Object.getOwnPropertyDescriptor;
  48013. var defineProperty = Object.defineProperty;
  48014. var TypeErr = TypeError;
  48015. var getProto = Object.getPrototypeOf;
  48016. var regex = /a/;
  48017. module.exports = function shimFlags() {
  48018. if (!supportsDescriptors || !getProto) {
  48019. throw new TypeErr('RegExp.prototype.flags requires a true ES5 environment that supports property descriptors');
  48020. }
  48021. var polyfill = getPolyfill();
  48022. var proto = getProto(regex);
  48023. var descriptor = gOPD(proto, 'flags');
  48024. if (!descriptor || descriptor.get !== polyfill) {
  48025. defineProperty(proto, 'flags', {
  48026. configurable: true,
  48027. enumerable: false,
  48028. get: polyfill
  48029. });
  48030. }
  48031. return polyfill;
  48032. };
  48033. /***/ }),
  48034. /* 400 */
  48035. /***/ (function(module, exports, __webpack_require__) {
  48036. "use strict";
  48037. var getDay = Date.prototype.getDay;
  48038. var tryDateObject = function tryDateGetDayCall(value) {
  48039. try {
  48040. getDay.call(value);
  48041. return true;
  48042. } catch (e) {
  48043. return false;
  48044. }
  48045. };
  48046. var toStr = Object.prototype.toString;
  48047. var dateClass = '[object Date]';
  48048. var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol';
  48049. module.exports = function isDateObject(value) {
  48050. if (typeof value !== 'object' || value === null) {
  48051. return false;
  48052. }
  48053. return hasToStringTag ? tryDateObject(value) : toStr.call(value) === dateClass;
  48054. };
  48055. /***/ }),
  48056. /* 401 */
  48057. /***/ (function(module, exports, __webpack_require__) {
  48058. module.exports = { "default": __webpack_require__(402), __esModule: true };
  48059. /***/ }),
  48060. /* 402 */
  48061. /***/ (function(module, exports, __webpack_require__) {
  48062. __webpack_require__(403);
  48063. module.exports = __webpack_require__(2).Object.assign;
  48064. /***/ }),
  48065. /* 403 */
  48066. /***/ (function(module, exports, __webpack_require__) {
  48067. // 19.1.3.1 Object.assign(target, source)
  48068. var $export = __webpack_require__(7);
  48069. $export($export.S + $export.F, 'Object', { assign: __webpack_require__(404) });
  48070. /***/ }),
  48071. /* 404 */
  48072. /***/ (function(module, exports, __webpack_require__) {
  48073. "use strict";
  48074. // 19.1.2.1 Object.assign(target, source, ...)
  48075. var DESCRIPTORS = __webpack_require__(13);
  48076. var getKeys = __webpack_require__(59);
  48077. var gOPS = __webpack_require__(125);
  48078. var pIE = __webpack_require__(73);
  48079. var toObject = __webpack_require__(50);
  48080. var IObject = __webpack_require__(110);
  48081. var $assign = Object.assign;
  48082. // should work with symbols and should have deterministic property order (V8 bug)
  48083. module.exports = !$assign || __webpack_require__(37)(function () {
  48084. var A = {};
  48085. var B = {};
  48086. // eslint-disable-next-line no-undef
  48087. var S = Symbol();
  48088. var K = 'abcdefghijklmnopqrst';
  48089. A[S] = 7;
  48090. K.split('').forEach(function (k) { B[k] = k; });
  48091. return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;
  48092. }) ? function assign(target, source) { // eslint-disable-line no-unused-vars
  48093. var T = toObject(target);
  48094. var aLen = arguments.length;
  48095. var index = 1;
  48096. var getSymbols = gOPS.f;
  48097. var isEnum = pIE.f;
  48098. while (aLen > index) {
  48099. var S = IObject(arguments[index++]);
  48100. var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S);
  48101. var length = keys.length;
  48102. var j = 0;
  48103. var key;
  48104. while (length > j) {
  48105. key = keys[j++];
  48106. if (!DESCRIPTORS || isEnum.call(S, key)) T[key] = S[key];
  48107. }
  48108. } return T;
  48109. } : $assign;
  48110. /***/ }),
  48111. /* 405 */
  48112. /***/ (function(module, exports, __webpack_require__) {
  48113. module.exports = { "default": __webpack_require__(406), __esModule: true };
  48114. /***/ }),
  48115. /* 406 */
  48116. /***/ (function(module, exports, __webpack_require__) {
  48117. __webpack_require__(407);
  48118. module.exports = __webpack_require__(2).String.fromCodePoint;
  48119. /***/ }),
  48120. /* 407 */
  48121. /***/ (function(module, exports, __webpack_require__) {
  48122. var $export = __webpack_require__(7);
  48123. var toAbsoluteIndex = __webpack_require__(187);
  48124. var fromCharCode = String.fromCharCode;
  48125. var $fromCodePoint = String.fromCodePoint;
  48126. // length should be 1, old FF problem
  48127. $export($export.S + $export.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', {
  48128. // 21.1.2.2 String.fromCodePoint(...codePoints)
  48129. fromCodePoint: function fromCodePoint(x) { // eslint-disable-line no-unused-vars
  48130. var res = [];
  48131. var aLen = arguments.length;
  48132. var i = 0;
  48133. var code;
  48134. while (aLen > i) {
  48135. code = +arguments[i++];
  48136. if (toAbsoluteIndex(code, 0x10ffff) !== code) throw RangeError(code + ' is not a valid code point');
  48137. res.push(code < 0x10000
  48138. ? fromCharCode(code)
  48139. : fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00)
  48140. );
  48141. } return res.join('');
  48142. }
  48143. });
  48144. /***/ }),
  48145. /* 408 */
  48146. /***/ (function(module, exports, __webpack_require__) {
  48147. module.exports = { "default": __webpack_require__(409), __esModule: true };
  48148. /***/ }),
  48149. /* 409 */
  48150. /***/ (function(module, exports, __webpack_require__) {
  48151. __webpack_require__(60);
  48152. __webpack_require__(410);
  48153. module.exports = __webpack_require__(2).Array.from;
  48154. /***/ }),
  48155. /* 410 */
  48156. /***/ (function(module, exports, __webpack_require__) {
  48157. "use strict";
  48158. var ctx = __webpack_require__(38);
  48159. var $export = __webpack_require__(7);
  48160. var toObject = __webpack_require__(50);
  48161. var call = __webpack_require__(195);
  48162. var isArrayIter = __webpack_require__(196);
  48163. var toLength = __webpack_require__(77);
  48164. var createProperty = __webpack_require__(411);
  48165. var getIterFn = __webpack_require__(121);
  48166. $export($export.S + $export.F * !__webpack_require__(412)(function (iter) { Array.from(iter); }), 'Array', {
  48167. // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined)
  48168. from: function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {
  48169. var O = toObject(arrayLike);
  48170. var C = typeof this == 'function' ? this : Array;
  48171. var aLen = arguments.length;
  48172. var mapfn = aLen > 1 ? arguments[1] : undefined;
  48173. var mapping = mapfn !== undefined;
  48174. var index = 0;
  48175. var iterFn = getIterFn(O);
  48176. var length, result, step, iterator;
  48177. if (mapping) mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2);
  48178. // if object isn't iterable or it's array with default iterator - use simple case
  48179. if (iterFn != undefined && !(C == Array && isArrayIter(iterFn))) {
  48180. for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) {
  48181. createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value);
  48182. }
  48183. } else {
  48184. length = toLength(O.length);
  48185. for (result = new C(length); length > index; index++) {
  48186. createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]);
  48187. }
  48188. }
  48189. result.length = index;
  48190. return result;
  48191. }
  48192. });
  48193. /***/ }),
  48194. /* 411 */
  48195. /***/ (function(module, exports, __webpack_require__) {
  48196. "use strict";
  48197. var $defineProperty = __webpack_require__(17);
  48198. var createDesc = __webpack_require__(57);
  48199. module.exports = function (object, index, value) {
  48200. if (index in object) $defineProperty.f(object, index, createDesc(0, value));
  48201. else object[index] = value;
  48202. };
  48203. /***/ }),
  48204. /* 412 */
  48205. /***/ (function(module, exports, __webpack_require__) {
  48206. var ITERATOR = __webpack_require__(14)('iterator');
  48207. var SAFE_CLOSING = false;
  48208. try {
  48209. var riter = [7][ITERATOR]();
  48210. riter['return'] = function () { SAFE_CLOSING = true; };
  48211. // eslint-disable-next-line no-throw-literal
  48212. Array.from(riter, function () { throw 2; });
  48213. } catch (e) { /* empty */ }
  48214. module.exports = function (exec, skipClosing) {
  48215. if (!skipClosing && !SAFE_CLOSING) return false;
  48216. var safe = false;
  48217. try {
  48218. var arr = [7];
  48219. var iter = arr[ITERATOR]();
  48220. iter.next = function () { return { done: safe = true }; };
  48221. arr[ITERATOR] = function () { return iter; };
  48222. exec(arr);
  48223. } catch (e) { /* empty */ }
  48224. return safe;
  48225. };
  48226. /***/ }),
  48227. /* 413 */
  48228. /***/ (function(module, exports, __webpack_require__) {
  48229. module.exports = { "default": __webpack_require__(414), __esModule: true };
  48230. /***/ }),
  48231. /* 414 */
  48232. /***/ (function(module, exports, __webpack_require__) {
  48233. __webpack_require__(126);
  48234. __webpack_require__(60);
  48235. __webpack_require__(74);
  48236. __webpack_require__(415);
  48237. __webpack_require__(416);
  48238. __webpack_require__(417);
  48239. __webpack_require__(418);
  48240. module.exports = __webpack_require__(2).Set;
  48241. /***/ }),
  48242. /* 415 */
  48243. /***/ (function(module, exports, __webpack_require__) {
  48244. "use strict";
  48245. var strong = __webpack_require__(192);
  48246. var validate = __webpack_require__(127);
  48247. var SET = 'Set';
  48248. // 23.2 Set Objects
  48249. module.exports = __webpack_require__(197)(SET, function (get) {
  48250. return function Set() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };
  48251. }, {
  48252. // 23.2.3.1 Set.prototype.add(value)
  48253. add: function add(value) {
  48254. return strong.def(validate(this, SET), value = value === 0 ? 0 : value, value);
  48255. }
  48256. }, strong);
  48257. /***/ }),
  48258. /* 416 */
  48259. /***/ (function(module, exports, __webpack_require__) {
  48260. // https://github.com/DavidBruant/Map-Set.prototype.toJSON
  48261. var $export = __webpack_require__(7);
  48262. $export($export.P + $export.R, 'Set', { toJSON: __webpack_require__(198)('Set') });
  48263. /***/ }),
  48264. /* 417 */
  48265. /***/ (function(module, exports, __webpack_require__) {
  48266. // https://tc39.github.io/proposal-setmap-offrom/#sec-set.of
  48267. __webpack_require__(199)('Set');
  48268. /***/ }),
  48269. /* 418 */
  48270. /***/ (function(module, exports, __webpack_require__) {
  48271. // https://tc39.github.io/proposal-setmap-offrom/#sec-set.from
  48272. __webpack_require__(200)('Set');
  48273. /***/ }),
  48274. /* 419 */
  48275. /***/ (function(module, exports, __webpack_require__) {
  48276. "use strict";
  48277. Object.defineProperty(exports, "__esModule", {
  48278. value: true
  48279. });
  48280. exports.default = void 0;
  48281. __webpack_require__(420);
  48282. var _unicodeTrie = _interopRequireDefault(__webpack_require__(421));
  48283. var _base64Js = _interopRequireDefault(__webpack_require__(423));
  48284. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  48285. var categories = ["Cc", "Zs", "Po", "Sc", "Ps", "Pe", "Sm", "Pd", "Nd", "Lu", "Sk", "Pc", "Ll", "So", "Lo", "Pi", "Cf", "No", "Pf", "Lt", "Lm", "Mn", "Me", "Mc", "Nl", "Zl", "Zp", "Cs", "Co"];
  48286. var combiningClasses = ["Not_Reordered", "Above", "Above_Right", "Below", "Attached_Above_Right", "Attached_Below", "Overlay", "Iota_Subscript", "Double_Below", "Double_Above", "Below_Right", "Above_Left", "CCC10", "CCC11", "CCC12", "CCC13", "CCC14", "CCC15", "CCC16", "CCC17", "CCC18", "CCC19", "CCC20", "CCC21", "CCC22", "CCC23", "CCC24", "CCC25", "CCC30", "CCC31", "CCC32", "CCC27", "CCC28", "CCC29", "CCC33", "CCC34", "CCC35", "CCC36", "Nukta", "Virama", "CCC84", "CCC91", "CCC103", "CCC107", "CCC118", "CCC122", "CCC129", "CCC130", "CCC132", "Attached_Above", "Below_Left", "Left", "Kana_Voicing", "CCC26", "Right"];
  48287. var scripts = ["Common", "Latin", "Bopomofo", "Inherited", "Greek", "Coptic", "Cyrillic", "Armenian", "Hebrew", "Arabic", "Syriac", "Thaana", "Nko", "Samaritan", "Mandaic", "Devanagari", "Bengali", "Gurmukhi", "Gujarati", "Oriya", "Tamil", "Telugu", "Kannada", "Malayalam", "Sinhala", "Thai", "Lao", "Tibetan", "Myanmar", "Georgian", "Hangul", "Ethiopic", "Cherokee", "Canadian_Aboriginal", "Ogham", "Runic", "Tagalog", "Hanunoo", "Buhid", "Tagbanwa", "Khmer", "Mongolian", "Limbu", "Tai_Le", "New_Tai_Lue", "Buginese", "Tai_Tham", "Balinese", "Sundanese", "Batak", "Lepcha", "Ol_Chiki", "Braille", "Glagolitic", "Tifinagh", "Han", "Hiragana", "Katakana", "Yi", "Lisu", "Vai", "Bamum", "Syloti_Nagri", "Phags_Pa", "Saurashtra", "Kayah_Li", "Rejang", "Javanese", "Cham", "Tai_Viet", "Meetei_Mayek", "null", "Linear_B", "Lycian", "Carian", "Old_Italic", "Gothic", "Old_Permic", "Ugaritic", "Old_Persian", "Deseret", "Shavian", "Osmanya", "Osage", "Elbasan", "Caucasian_Albanian", "Linear_A", "Cypriot", "Imperial_Aramaic", "Palmyrene", "Nabataean", "Hatran", "Phoenician", "Lydian", "Meroitic_Hieroglyphs", "Meroitic_Cursive", "Kharoshthi", "Old_South_Arabian", "Old_North_Arabian", "Manichaean", "Avestan", "Inscriptional_Parthian", "Inscriptional_Pahlavi", "Psalter_Pahlavi", "Old_Turkic", "Old_Hungarian", "Hanifi_Rohingya", "Old_Sogdian", "Sogdian", "Elymaic", "Brahmi", "Kaithi", "Sora_Sompeng", "Chakma", "Mahajani", "Sharada", "Khojki", "Multani", "Khudawadi", "Grantha", "Newa", "Tirhuta", "Siddham", "Modi", "Takri", "Ahom", "Dogra", "Warang_Citi", "Nandinagari", "Zanabazar_Square", "Soyombo", "Pau_Cin_Hau", "Bhaiksuki", "Marchen", "Masaram_Gondi", "Gunjala_Gondi", "Makasar", "Cuneiform", "Egyptian_Hieroglyphs", "Anatolian_Hieroglyphs", "Mro", "Bassa_Vah", "Pahawh_Hmong", "Medefaidrin", "Miao", "Tangut", "Nushu", "Duployan", "SignWriting", "Nyiakeng_Puachue_Hmong", "Wancho", "Mende_Kikakui", "Adlam"];
  48288. var eaw = ["N", "Na", "A", "W", "H", "F"];
  48289. var data = {
  48290. categories: categories,
  48291. combiningClasses: combiningClasses,
  48292. scripts: scripts,
  48293. eaw: eaw
  48294. };
  48295. var data$1 = "AAARAAAAAADwfAEAZXl5ONRt+/5bPVFZimRfKoTQJNm37CGE7Iw0j3UsTWKsoyI7kwyyTiEUzSD7NiEzhWYijH0wMVkHE4Mx49fzfo+3nuP4/fdZjvv+XNd5n/d9nef1WZvmKhTxiZndzDQBSEYQqxqKwnsKvGQucFh+6t6cJ792ePQBZv5S9yXSwkyjf/P4T7mTNnIAv1dOVhMlR9lflbUL9JeJguqsjvG9NTj/wLb566VAURnLo2vvRi89S3gW/33ihh2eXpDn40BIW7REl/7coRKIhAFlAiOtbLDTt6mMb4GzMF1gNnvX/sBxtbsAIjfztCNcQjcNDtLThRvuXu5M5g/CBjaLBE4lJm4qy/oZD97+IJryApcXfgWYlkvWbhfXgujOJKVu8B+ozqTLbxyJ5kNiR75CxDqfBM9eOlDMmGeoZ0iQbbS5VUplIwI+ZNXEKQVJxlwqjhOY7w3XwPesbLK5JZE+Tt4X8q8km0dzInsPPzbscrjBMVjF5mOHSeRdJVgKUjLTHiHqXSPkep8N/zFk8167KLp75f6RndkvzdfB6Uz3MmqvRArzdCbs1/iRZjYPLLF3U8Qs+H+Rb8iK51a6NIV2V9+07uJsTGFWpPz8J++7iRu2B6eAKlK/kujrLthwaD/7a6J5w90TusnH1JMAc+gNrql4aspOUG/RrsxUKmPzhHgP4Bleru+6Vfc/MBjgXVx7who94nPn7MPFrnwQP7g0k0Dq0h2GSKO6fTZ8nLodN1SiOUj/5EL/Xo1DBvRm0wmrh3x6phcJ20/9CuMr5h8WPqXMSasLoLHoufTmE7mzYrs6B0dY7KjuCogKqsvxnxAwXWvd9Puc9PnE8DOHT2INHxRlIyVHrqZahtfV2E/A2PDdtA3ewlRHMtFIBKO/T4IozWTQZ+mb+gdKuk/ZHrqloucKdsOSJmlWTSntWjcxVMjUmroXLM10I6TwDLnBq4LP69TxgVeyGsd8yHvhF8ydPlrNRSNs9EP7WmeuSE7Lu10JbOuQcJw/63sDp68wB9iwP5AO+mBpV0R5VDDeyQUFCel1G+4KHBgEVFS0YK+m2sXLWLuGTlkVAd97WwKKdacjWElRCuDRauf33l/yVcDF6sVPKeTes99FC1NpNWcpieGSV/IbO8PCTy5pbUR1U8lxzf4T+y6fZMxOz3LshkQLeeDSd0WmUrQgajmbktrxsb2AZ0ACw2Vgni+gV/m+KvCRWLg08Clx7uhql+v9XySGcjjOHlsp8vBw/e8HS7dtiqF6T/XcSXuaMW66GF1g4q9YyBadHqy3Y5jin1c7yZos6BBr6dsomSHxiUHanYtcYQwnMMZhRhOnaYJeyJzaRuukyCUh48+e/BUvk/aEfDp8ag+jD64BHxNnQ5v/E7WRk7eLjGV13I3oqy45YNONi/1op1oDr7rPjkhPsTXgUpQtGDPlIs55KhQaic9kSGs/UrZ2QKQOflB8MTEQxRF9pullToWO7Eplan6mcMRFnUu2441yxi23x+KqKlr7RWWsi9ZXMWlr8vfP3llk1m2PRj0yudccxBuoa7VfIgRmnFPGX6Pm1WIfMm/Rm4n/xTn8IGqA0GWuqgu48pEUO0U9nN+ZdIvFpPb7VDPphIfRZxznlHeVFebkd9l+raXy9BpTMcIUIvBfgHEb6ndGo8VUkxpief14KjzFOcaANfgvFpvyY8lE8lE4raHizLpluPzMks1hx/e1Hok5yV0p7qQH7GaYeMzzZTFvRpv6k6iaJ4yNqzBvN8J7B430h2wFm1IBPcqbou33G7/NWPgopl4Mllla6e24L3TOTVNkza2zv3QKuDWTeDpClCEYgTQ+5vEBSQZs/rMF50+sm4jofTgWLqgX1x3TkrDEVaRqfY/xZizFZ3Y8/DFEFD31VSfBQ5raEB6nHnZh6ddehtclQJ8fBrldyIh99LNnV32HzKEej04hk6SYjdauCa4aYW0ru/QxvQRGzLKOAQszf3ixJypTW3WWL6BLSF2EMCMIw7OUvWBC6A/gDc2D1jvBapMCc7ztx6jYczwTKsRLL6dMNXb83HS8kdD0pTMMj161zbVHkU0mhSHo9SlBDDXdN6hDvRGizmohtIyR3ot8tF5iUG4GLNcXeGvBudSFrHu+bVZb9jirNVG+rQPI51A7Hu8/b0UeaIaZ4UgDO68PkYx3PE2HWpKapJ764Kxt5TFYpywMy4DLQqVRy11I7SOLhxUFmqiEK52NaijWArIfCg6qG8q5eSiwRCJb1R7GDJG74TrYgx/lVq7w9++Kh929xSJEaoSse5fUOQg9nMAnIZv+7fwVRcNv3gOHI46Vb5jYUC66PYHO6lS+TOmvEQjuYmx4RkffYGxqZIp/DPWNHAixbRBc+XKE3JEOgs4jIwu/dSAwhydruOGF39co91aTs85JJ3Z/LpXoF43hUwJsb/M1Chzdn8HX8vLXnqWUKvRhNLpfAF4PTFqva1sBQG0J+59HyYfmQ3oa4/sxZdapVLlo/fooxSXi/dOEQWIWq8E0FkttEyTFXR2aNMPINMIzZwCNEheYTVltsdaLkMyKoEUluPNAYCM2IG3br0DLy0fVNWKHtbSKbBjfiw7Lu06gQFalC7RC9BwRMSpLYDUo9pDtDfzwUiPJKLJ2LGcSphWBadOI/iJjNqUHV7ucG8yC6+iNM9QYElqBR7ECFXrcTgWQ3eG/tCWacT9bxIkfmxPmi3vOd36KxihAJA73vWNJ+Y9oapXNscVSVqS5g15xOWND/WuUCcA9YAAg6WFbjHamrblZ5c0L6Zx1X58ZittGcfDKU697QRSqW/g+RofNRyvrWMrBn44cPvkRe2HdTu/Cq01C5/riWPHZyXPKHuSDDdW8c1XPgd6ogvLh20qEIu8c19sqr4ufyHrwh37ZN5MkvY1dsGmEz9pUBTxWrvvhNyODyX2Q1k/fbX/T/vbHNcBrmjgDtvBdtZrVtiIg5iXQuzO/DEMvRX8Mi1zymSlt92BGILeKItjoShJXE/H7xwnf0Iewb8BFieJ9MflEBCQYEDm8eZniiEPfGoaYiiEdhQxHQNr2AuRdmbL9mcl18Kumh+HEZLp6z+j35ML9zTbUwahUZCyQQOgQrGfdfQtaR/OYJ/9dYXb2TWZFMijfCA8Nov4sa5FFDUe1T68h4q08WDE7JbbDiej4utRMR9ontevxlXv6LuJTXt1YEv8bDzEt683PuSsIN0afvu0rcBu9AbXZbkOG3K3AhtqQ28N23lXm7S3Yn6KXmAhBhz+GeorJJ4XxO/b3vZk2LXp42+QvsVxGSNVpfSctIFMTR1bD9t70i6sfNF3WKz/uKDEDCpzzztwhL45lsw89H2IpWN10sXHRlhDse9KCdpP5qNNpU84cTY+aiqswqR8XZ9ea0KbVRwRuOGQU3csAtV2fSbnq47U6es6rKlWLWhg3s/B9C9g+oTyp6RtIldR51OOkP5/6nSy6itUVPcMNOp4M/hDdKOz3uK6srbdxOrc2cJgr1Sg02oBxxSky6V7JaG+ziNwlfqnjnvh2/uq1lKfbp+qpwq/D/5OI5gkFl5CejKGxfc2YVJfGqc4E0x5e9PHK2ukbHNI7/RZV6LNe65apbTGjoCaQls0txPPbmQbCQn+/upCoXRZy9yzorWJvZ0KWcbXlBxU/d5I4ERUTxMuVWhSMmF677LNN7NnLwsmKawXkCgbrpcluOl0WChR1qhtSrxGXHu251dEItYhYX3snvn1gS2uXuzdTxCJjZtjsip0iT2sDC0qMS7Bk9su2NyXjFK5/f5ZoWwofg3DtTyjaFqspnOOTSh8xK/CKUFS57guVEkw9xoQuRCwwEO9Lu9z2vYxSa9NFV8DvSxv2C4WYLYF8Nrc4DzWkzNsk81JJOlZ/LYJrGCoj4MmZpnf3AXmzxT4rtl9jsqljEyedz468SGKdBiQzyz/qWKEhFg45ZczlZZ3KGL3l6sn+3TTa3zMVMhPa1obGp/z+fvY0QXTrJTf1XAT3EtQdUfYYlmWZyvPZ/6rWwU7UOQei7pVE0osgN94Iy+T1+omE6z4Rh2O20FjgBeK2y1mcoFiMDOJvuZPn5Moy9fmFH3wyfKvn4+TwfLvt/lHTTVnvrtoUWRBiQXhiNM8nE6ZoWeux/Z0b2unRcdUzdDpmL7CAgd1ToRXwgmHTZOgiGtVT+xr1QH9ObebRTT4NzL+XSpLuuWp62GqQvJVTPoZOeJCb6gIwd9XHMftQ+Kc08IKKdKQANSJ1a2gve3JdRhO0+tNiYzWAZfd7isoeBu67W7xuK8WX7nhJURld98Inb0t/dWOSau/kDvV4DJo/cImw9AO2Gvq0F2n0M7yIZKL8amMbjYld+qFls7hq8Acvq97K2PrCaomuUiesu7qNanGupEl6J/iem8lyr/NMnsTr6o41PO0yhQh3hPFN0wJP7S830je9iTBLzUNgYH+gUZpROo3rN2qgCI+6GewpX8w8CH+ro6QrWiStqmcMzVa3vEel+3/dDxMp0rDv1Q6wTMS3K64zTT6RWzK1y643im25Ja7X2ePCV2mTswd/4jshZPo4bLnerqIosq/hy2bKUAmVn9n4oun1+a0DIZ56UhVwmZHdUNpLa8gmPvxS1eNvCF1T0wo1wKPdCJi0qOrWz7oYRTzgTtkzEzZn308XSLwUog4OWGKJzCn/3FfF9iA32dZHSv30pRCM3KBY9WZoRhtdK/ChHk6DEQBsfV6tN2o1Cn0mLtPBfnkS+qy1L2xfFe9TQPtDE1Be44RTl82E9hPT2rS2+93LFbzhQQO3C/hD2jRFH3BWWbasAfuMhRJFcTri73eE835y016s22DjoFJ862WvLj69fu2TgSF3RHia9D5DSitlQAXYCnbdqjPkR287Lh6dCHDapos+eFDvcZPP2edPmTFxznJE/EBLoQQ0Qmn9EkZOyJmHxMbvKYb8o21ZHmv5YLqgsEPk9gWZwYQY9wLqGXuax/8QlV5qDaPbq9pLPT1yp+zOWKmraEy1OUJI7zdEcEmvBpbdwLrDCgEb2xX8S/nxZgjK4bRi+pbOmbh8bEeoPvU/L9ndx9kntlDALbdAvp0O8ZC3zSUnFg4cePsw7jxewWvL7HRSBLUn6J7vTH9uld5N76JFPgBCdXGF221oEJk++XfRwXplLSyrVO7HFWBEs99nTazKveW3HpbD4dH/YmdAl+lwbSt8BQWyTG7jAsACI7bPPUU9hI9XUHWqQOuezHzUjnx5Qqs6T1qNHfTTHleDtmqK7flA9a0gz2nycIpz1FHBuWxKNtUeTdqP29Fb3tv+tl5JyBqXoR+vCsdzZwZUhf6Lu8bvkB9yQP4x7GGegB0ym0Lpl03Q7e+C0cDsm9GSDepCDji7nUslLyYyluPfvLyKaDSX4xpR+nVYQjQQn5F8KbY1gbIVLiK1J3mW90zTyR1bqApX2BlWh7KG8LAY9/S9nWC0XXh9pZZo6xuir12T43rkaGfQssbQyIslA7uJnSHOV22NhlNtUo0czxPAsXhh8tIQYaTM4l/yAlZlydTcXhlG22Gs/n3BxKBd/3ZjYwg3NaUurVXhNB+afVnFfNr9TbC9ksNdvwpNfeHanyJ8M6GrIVfLlYAPv0ILe4dn0Z+BJSbJkN7eZY/c6+6ttDYcIDeUKIDXqUSE42Xdh5nRbuaObozjht0HJ5H1e+em+NJi/+8kQlyjCbJpPckwThZeIF9/u7lrVIKNeJLCN/TpPAeXxvd31/CUDWHK9MuP1V1TJgngzi4V0qzS3SW3Qy5UiGHqg02wQa5tsEl9s/X9nNMosgLlUgZSfCBj1DiypLfhr9/r0nR0XY2tmhDOcUS4E7cqa4EJBhzqvpbZa35Q5Iz5EqmhYiOGDAYk606Tv74+KGfPjKVuP15rIzgW0I7/niOu9el/sn2bRye0gV+GrePDRDMHjwO1lEdeXH8N+UTO3IoN18kpI3tPxz+fY+n2MGMSGFHAx/83tKeJOl+2i+f1O9v6FfEDBbqrw+lpM8Anav7zHNr7hE78nXUtPNodMbCnITWA7Ma/IHlZ50F9hWge/wzOvSbtqFVFtkS8Of2nssjZwbSFdU+VO8z6tCEc9UA9ACxT5zIUeSrkBB/v1krOpm7bVMrGxEKfI6LcnpB4D8bvn2hDKGqKrJaVAJuDaBEY3F7eXyqnFWlOoFV/8ZLspZiZd7orXLhd4mhHQgbuKbHjJWUzrnm0Dxw/LJLzXCkh7slMxKo8uxZIWZfdKHlfI7uj3LP6ARAuWdF7ZmZ7daOKqKGbz5LxOggTgS39oEioYmrqkCeUDvbxkBYKeHhcLmMN8dMF01ZMb32IpL/cH8R7VHQSI5I0YfL14g9d7P/6cjB1JXXxbozEDbsrPdmL8ph7QW10jio+v7YsqHKQ6xrBbOVtxU0/nFfzUGZwIBLwyUvg49ii+54nv9FyECBpURnQK4Ox6N7lw5fsjdd5l/2SwBcAHMJoyjO1Pifye2dagaOwCVMqdJWAo77pvBe0zdJcTWu5fdzPNfV2p1pc7/JKQ8zhKkwsOELUDhXygPJ5oR8Vpk2lsCen3D3QOQp2zdrSZHjVBstDF/wWO98rrkQ6/7zt/Drip7OHIug1lomNdmRaHRrjmqeodn22sesQQPgzimPOMqC60a5+i/UYh51uZm+ijWkkaI2xjrBO2558DZNZMiuDQlaVAvBy2wLn/bR3FrNzfnO/9oDztYqxZrr7JMIhqmrochbqmQnKowxW29bpqTaJu7kW1VotC72QkYX8OoDDdMDwV1kJRk3mufgJBzf+iwFRJ7XWQwO5ujVglgFgHtycWiMLx5N+6XU+TulLabWjOzoao03fniUW0xvIJNPbk7CQlFZd/RCOPvgQbLjh5ITE8NVJeKt3HGr6JTnFdIzcVOlEtwqbIIX0IM7saC+4N5047MTJ9+Wn11EhyEPIlwsHE5utCeXRjQzlrR+R1Cf/qDzcNbqLXdk3J7gQ39VUrrEkS/VMWjjg+t2oYrqB0tUZClcUF6+LBC3EQ7KnGIwm/qjZX4GKPtjTX1zQKV6nPAb2t/Rza5IqKRf8i2DFEhV/YSifX0YwsiF6TQnp48Gr65TFq0zUe6LGjiY7fq0LSGKL1VnC6ESI2yxvt3XqBx53B3gSlGFeJcPbUbonW1E9E9m4NfuwPh+t5QjRxX34lvBPVxwQd7aeTd+r9dw5CiP1pt8wMZoMdni7GapYdo6KPgeQKcmlFfq4UYhvV0IBgeiR3RnTMBaqDqpZrTRyLdsp4l0IXZTdErfH0sN3dqBG5vRIx3VgCYcHmmkqJ8Hyu3s9K9uBD1d8cZUEx3qYcF5vsqeRpF1GOg8emeWM2OmBlWPdZ6qAXwm3nENFyh+kvXk132PfWAlN0kb7yh4fz2T7VWUY/hEXX5DvxGABC03XRpyOG8t/u3Gh5tZdpsSV9AWaxJN7zwhVglgII1gV28tUViyqn4UMdIh5t+Ea2zo7PO48oba0TwQbiSZOH4YhD578kPF3reuaP7LujPMsjHmaDuId9XEaZBCJhbXJbRg5VCk3KJpryH/+8S3wdhR47pdFcmpZG2p0Bpjp/VbvalgIZMllYX5L31aMPdt1J7r/7wbixt0Mnz2ZvNGTARHPVD+2O1D8SGpWXlVnP2ekgon55YiinADDynyaXtZDXueVqbuTi8z8cHHK325pgqM+mWZwzHeEreMvhZopAScXM14SJHpGwZyRljMlDvcMm9FZ/1e9+r/puOnpXOtc9Iu2fmgBfEP9cGW1Fzb1rGlfJ08pACtq1ZW18bf2cevebzVeHbaA50G9qoUp39JWdPHbYkPCRXjt4gzlq3Cxge28Mky8MoS/+On72kc+ZI2xBtgJytpAQHQ1zrEddMIVyR5urX6yBNu8v5lKC8eLdGKTJtbgIZ3ZyTzSfWmx9f+cvcJe8yM39K/djkp2aUTE/9m2Lj5jg7b8vdRAer7DO3SyLNHs1CAm5x5iAdh2yGJYivArZbCBNY88Tw+w+C1Tbt7wK3zl2rzTHo/D8/gb3c3mYrnEIEipYqPUcdWjnTsSw471O3EUN7Gtg4NOAs9PJrxm03VuZKa5xwXAYCjt7Gs01Km6T2DhOYUMoFcCSu7Hk1p3yP1eG+M3v3Q5luAze6WwBnZIYO0TCucPWK+UJ36KoJ8Y+vpavhLO8g5ed704IjlQdfemrMu//EvPYXTQSGIPPfiagJS9nMqP5IvkxN9pvuJz7h8carPXTKMq8jnTeL0STan6dnLTAqwIswcIwWDR2KwbGddAVN8SYWRB7kfBfBRkSXzvHlIF8D6jo64kUzYk5o/n8oLjKqat0rdXvQ86MkwQGMnnlcasqPPT2+mVtUGb32KuH6cyZQenrRG11TArcAl27+nvOMBDe++EKHf4YdyGf7mznzOz33cFFGEcv329p4qG2hoaQ8ULiMyVz6ENcxhoqGnFIdupcn7GICQWuw3yO3W8S33mzCcMYJ8ywc7U7rmaQf/W5K63Gr4bVTpXOyOp4tbaPyIaatBNpXqlmQUTSZXjxPr19+73PSaT+QnI35YsWn6WpfJjRtK8vlJZoTSgjaRU39AGCkWOZtifJrnefCrqwTKDFmuWUCukEsYcRrMzCoit28wYpP7kSVjMD8WJYQiNc2blMjuqYegmf6SsfC1jqz8XzghMlOX+gn/MKZmgljszrmehEa4V98VreJDxYvHr3j7IeJB9/sBZV41BWT/AZAjuC5XorlIPnZgBAniBEhanp0/0+qZmEWDpu8ige1hUPIyTo6T6gDEcFhWSoduNh8YSu65KgMOGBw7VlNYzNIgwHtq9KP2yyTVysqX5v12sf7D+vQUdR2dRDvCV40rIInXSLWT/yrC6ExOQxBJwIDbeZcl3z1yR5Rj3l8IGpxspapnvBL+fwupA3b6fkFceID9wgiM1ILB0cHVdvo/R4xg8yqKXT8efl0GnGX1/27FUYeUW2L/GNRGGWVGp3i91oaJkb4rybENHre9a2P5viz/yqk8ngWUUS+Kv+fu+9BLFnfLiLXOFcIeBJLhnayCiuDRSqcx0Qu68gVsGYc6EHD500Fkt+gpDj6gvr884n8wZ5o6q7xtL5wA0beXQnffWYkZrs2NGIRgQbsc5NB302SVx+R4ROvmgZaR8wBcji128BMfJ9kcvJ4DC+bQ57kRmv5yxgU4ngZfn0/JNZ8JBwxjTqS+s9kjJFG1unGUGLwMiIuXUD9EFhNIJuyCEAmVZSIGKH4G6v1gRR1LyzQKH2ZqiI1DnHMoDEZspbDjTeaFIAbSvjSq3A+n46y9hhVM8wIpnARSXyzmOD96d9UXvFroSPgGw1dq2vdEqDq9fJN1EbL2WulNmHkFDvxSO9ZT/RX/Bw2gA/BrF90XrJACereVfbV/YXaKfp77Nmx5NjEIUlxojsy7iN7nBHSZigfsbFyVOX1ZTeCCxvqnRSExP4lk5ZeYlRu9caaa743TWNdchRIhEWwadsBIe245C8clpaZ4zrPsk+OwXzxWCvRRumyNSLW5KWaSJyJU95cwheK76gr7228spZ3hmTtLyrfM2QRFqZFMR8/Q6yWfVgwTdfX2Ry4w3+eAO/5VT5nFb5NlzXPvBEAWrNZ6Q3jbH0RF4vcbp+fDngf/ywpoyNQtjrfvcq93AVb1RDWRghvyqgI2BkMr1rwYi8gizZ0G9GmPpMeqPerAQ0dJbzx+KAFM4IBq6iSLpZHUroeyfd9o5o+4fR2EtsZBoJORQEA4SW0CmeXSnblx2e9QkCHIodyqV6+g5ETEpZsLqnd/Na60EKPX/tQpPEcO+COIBPcQdszDzSiHGyQFPly/7KciUh1u+mFfxTCHGv9nn2WqndGgeGjQ/kr02qmTBX7Hc1qiEvgiSz1Tz/sy7Es29wvn6FrDGPP7asXlhOaiHxOctPvTptFA1kHFUk8bME7SsTSnGbFbUrssxrq70LhoSh5OwvQna+w84XdXhZb2sloJ4ZsCg3j+PrjJL08/JBi5zGd6ud/ZxhmcGKLOXPcNunQq5ESW92iJvfsuRrNYtawWwSmNhPYoFj2QqWNF0ffLpGt/ad24RJ8vkb5sXkpyKXmvFG5Vcdzf/44k3PBL/ojJ52+kWGzOArnyp5f969oV3J2c4Li27Nkova9VwRNVKqN0V+gV+mTHitgkXV30aWd3A1RSildEleiNPA+5cp+3+T7X+xfHiRZXQ1s4FA9TxIcnveQs9JSZ5r5qNmgqlW4zMtZ6rYNvgmyVcywKtu8ZxnSbS5vXlBV+NXdIfi3+xzrnJ0TkFL+Un8v1PWOC2PPFCjVPq7qTH7mOpzOYj/b4h0ceT+eHgr97Jqhb1ziVfeANzfN8bFUhPKBi7hJBCukQnB0aGjFTYLJPXL26lQ2b80xrOD5cFWgA8hz3St0e69kwNnD3+nX3gy12FjrjO+ddRvvvfyV3SWbXcxqNHfmsb9u1TV+wHTb9B07/L2sB8WUHJ9eeNomDyysEWZ0deqEhH/oWI2oiEh526gvAK1Nx2kIhNvkYR+tPYHEa9j+nd1VBpQP1uzSjIDO+fDDB7uy029rRjDC5Sk6aKczyz1D5uA9Lu+Rrrapl8JXNL3VRllNQH2K1ZFxOpX8LprttfqQ56MbPM0IttUheXWD/mROOeFqGUbL+kUOVlXLTFX/525g4faLEFO4qWWdmOXMNvVjpIVTWt650HfQjX9oT3Dg5Au6+v1/Ci78La6ZOngYCFPT1AUwxQuZ0yt5xKdNXLaDTISMTeCj16XTryhM36K2mfGRIgot71voWs8tTpL/f1rvcwv3LSDf+/G8THCT7NpfHWcW+lsF/ol8q9Bi6MezNTqp0rpp/kJRiVfNrX/w27cRRTu8RIIqtUblBMkxy4jwAVqCjUJkiPBj2cAoVloG8B2/N5deLdMhDb7xs5nhd3dubJhuj8WbaFRyu1L678DHhhA+rMimNo4C1kGpp0tD/qnCfCFHejpf0LJX43OTr578PY0tnIIrlWyNYyuR/ie6j2xNb1OV6u0dOX/1Dtcd7+ya9W+rY2LmnyQMtk8SMLTon8RAdwOaN2tNg5zVnDKlmVeOxPV2vhHIo9QEPV7jc3f+zVDquiNg1OaHX3cZXJDRY5MJpo+VanAcmqp4oasYLG+wrXUL5vJU0kqk2hGEskhP+Jjigrz1l6QnEwp6n8PMVeJp70Ii6ppeaK9GhF6fJE00ceLyxv08tKiPat4QdxZFgSbQknnEiCLD8Qc1rjazVKM3r3gXnnMeONgdz/yFV1q+haaN+wnF3Fn4uYCI9XsKOuVwDD0LsCO/f0gj5cmxCFcr7sclIcefWjvore+3aSU474cyqDVxH7w1RX3CHsaqsMRX17ZLgjsDXws3kLm2XJdM3Ku383UXqaHqsywzPhx7NFir0Fqjym/w6cxD2U9ypa3dx7Z12w/fi3Jps8sqJ8f8Ah8aZAvkHXvIRyrsxK7rrFaNNdNvjI8+3Emri195DCNa858anj2Qdny6Czshkn4N2+1m+k5S8sunX3Ja7I+JutRzg1mc2e9Yc0Zv9PZn1SwhxIdU9sXwZRTd/J5FoUm0e+PYREeHg3oc2YYzGf2xfJxXExt4pT3RfDRHvMXLUmoXOy63xv5pLuhOEax0dRgSywZ/GH+YBXFgCeTU0hZ8SPEFsn8punp1Kurd1KgXxUZ+la3R5+4ePGR4ZF5UQtOa83+Vj8zh80dfzbhxWCeoJnQ4dkZJM4drzknZOOKx2n3WrvJnzFIS8p0xeic+M3ZRVXIp10tV2DyYKwRxLzulPwzHcLlYTxl4PF7v8l106Azr+6wBFejbq/3P72C/0j78cepY9990/d4eAurn2lqdGKLU8FffnMw7cY7pVeXJRMU73Oxwi2g2vh/+4gX8dvbjfojn/eLVhhYl8GthwCQ50KcZq4z2JeW5eeOnJWFQEnVxDoG459TaC4zXybECEoJ0V5q1tXrQbDMtUxeTV6Pdt1/zJuc7TJoV/9YZFWxUtCf6Ou3Vd/vR/vG0138hJQrHkNeoep5dLe+6umcSquKvMaFpm3EZHDBOvCi0XYyIFHMgX7Cqp3JVXlxJFwQfHSaIUEbI2u1lBVUdlNw4Qa9UsLPEK94Qiln3pyKxQVCeNlx8yd7EegVNQBkFLabKvnietYVB4IPZ1fSor82arbgYec8aSdFMaIluYTYuNx32SxfrjKUdPGq+UNp5YpydoEG3xVLixtmHO9zXxKAnHnPuH2fPGrjx0GcuCDEU+yXUtXh6nfUL+cykws1gJ5vkfYFaFBr9PdCXvVf35OJQxzUMmWjv0W6uGJK11uAGDqSpOwCf6rouSIjPVgw57cJCOQ4b9tkI/Y5WNon9Swe72aZryKo8d+HyHBEdWJKrkary0LIGczA4Irq353Wc0Zga3om7UQiAGCvIl8GGyaqz5zH+1gMP5phWUCpKtttWIyicz09vXg76GxkmiGSMQ06Z9X8BUwqOtauDbPIf4rpK/yYoeAHxJ9soXS9VDe1Aw+awOOxaN8foLrif0TXBvQ55dtRtulRq9emFDBxlQcqKCaD8NeTSE7FOHvcjf/+oKbbtRqz9gbofoc2EzQ3pL6W5JdfJzAWmOk8oeoECe90lVMruwl/ltM015P/zIPazqvdvFmLNVHMIZrwiQ2tIKtGh6PDVH+85ew3caqVt2BsDv5rOcu3G9srQWd7NmgtzCRUXLYknYRSwtH9oUtkqyN3CfP20xQ1faXQl4MEmjQehWR6GmGnkdpYNQYeIG408yAX7uCZmYUic9juOfb+Re28+OVOB+scYK4DaPcBe+5wmji9gymtkMpKo4UKqCz7yxzuN8VIlx9yNozpRJpNaWHtaZVEqP45n2JemTlYBSmNIK1FuSYAUQ1yBLnKxevrjayd+h2i8PjdB3YY6b0nr3JuOXGpPMyh4V2dslpR3DFEvgpsBLqhqLDOWP4yEvIL6f21PpA7/8B";
  48296. var trieData = {
  48297. data: data$1
  48298. };
  48299. var log2 = Math.log2 || function (n) {
  48300. return Math.log(n) / Math.LN2;
  48301. };
  48302. var bits = function bits(n) {
  48303. return log2(n) + 1 | 0;
  48304. };
  48305. var buildUnicodeProperties = function buildUnicodeProperties(data, trie) {
  48306. // compute the number of bits stored for each field
  48307. var CATEGORY_BITS = bits(data.categories.length - 1);
  48308. var COMBINING_BITS = bits(data.combiningClasses.length - 1);
  48309. var SCRIPT_BITS = bits(data.scripts.length - 1);
  48310. var EAW_BITS = bits(data.eaw.length - 1);
  48311. var NUMBER_BITS = 10; // compute shift and mask values for each field
  48312. var CATEGORY_SHIFT = COMBINING_BITS + SCRIPT_BITS + EAW_BITS + NUMBER_BITS;
  48313. var COMBINING_SHIFT = SCRIPT_BITS + EAW_BITS + NUMBER_BITS;
  48314. var SCRIPT_SHIFT = EAW_BITS + NUMBER_BITS;
  48315. var EAW_SHIFT = NUMBER_BITS;
  48316. var CATEGORY_MASK = (1 << CATEGORY_BITS) - 1;
  48317. var COMBINING_MASK = (1 << COMBINING_BITS) - 1;
  48318. var SCRIPT_MASK = (1 << SCRIPT_BITS) - 1;
  48319. var EAW_MASK = (1 << EAW_BITS) - 1;
  48320. var NUMBER_MASK = (1 << NUMBER_BITS) - 1;
  48321. var getCategory = function getCategory(codePoint) {
  48322. var val = trie.get(codePoint);
  48323. return data.categories[val >> CATEGORY_SHIFT & CATEGORY_MASK];
  48324. };
  48325. var getCombiningClass = function getCombiningClass(codePoint) {
  48326. var val = trie.get(codePoint);
  48327. return data.combiningClasses[val >> COMBINING_SHIFT & COMBINING_MASK];
  48328. };
  48329. var getScript = function getScript(codePoint) {
  48330. var val = trie.get(codePoint);
  48331. return data.scripts[val >> SCRIPT_SHIFT & SCRIPT_MASK];
  48332. };
  48333. var getEastAsianWidth = function getEastAsianWidth(codePoint) {
  48334. var val = trie.get(codePoint);
  48335. return data.eaw[val >> EAW_SHIFT & EAW_MASK];
  48336. };
  48337. var getNumericValue = function getNumericValue(codePoint) {
  48338. var val = trie.get(codePoint);
  48339. var num = val & NUMBER_MASK;
  48340. if (num === 0) {
  48341. return null;
  48342. } else if (num <= 50) {
  48343. return num - 1;
  48344. } else if (num < 0x1e0) {
  48345. var numerator = (num >> 4) - 12;
  48346. var denominator = (num & 0xf) + 1;
  48347. return numerator / denominator;
  48348. } else if (num < 0x300) {
  48349. val = (num >> 5) - 14;
  48350. var exp = (num & 0x1f) + 2;
  48351. while (exp > 0) {
  48352. val *= 10;
  48353. exp--;
  48354. }
  48355. return val;
  48356. } else {
  48357. val = (num >> 2) - 0xbf;
  48358. var _exp = (num & 3) + 1;
  48359. while (_exp > 0) {
  48360. val *= 60;
  48361. _exp--;
  48362. }
  48363. return val;
  48364. }
  48365. };
  48366. var isAlphabetic = function isAlphabetic(codePoint) {
  48367. var category = getCategory(codePoint);
  48368. return category === 'Lu' || category === 'Ll' || category === 'Lt' || category === 'Lm' || category === 'Lo' || category === 'Nl';
  48369. };
  48370. var isDigit = function isDigit(codePoint) {
  48371. return getCategory(codePoint) === 'Nd';
  48372. };
  48373. var isPunctuation = function isPunctuation(codePoint) {
  48374. var category = getCategory(codePoint);
  48375. return category === 'Pc' || category === 'Pd' || category === 'Pe' || category === 'Pf' || category === 'Pi' || category === 'Po' || category === 'Ps';
  48376. };
  48377. var isLowerCase = function isLowerCase(codePoint) {
  48378. return getCategory(codePoint) === 'Ll';
  48379. };
  48380. var isUpperCase = function isUpperCase(codePoint) {
  48381. return getCategory(codePoint) === 'Lu';
  48382. };
  48383. var isTitleCase = function isTitleCase(codePoint) {
  48384. return getCategory(codePoint) === 'Lt';
  48385. };
  48386. var isWhiteSpace = function isWhiteSpace(codePoint) {
  48387. var category = getCategory(codePoint);
  48388. return category === 'Zs' || category === 'Zl' || category === 'Zp';
  48389. };
  48390. var isBaseForm = function isBaseForm(codePoint) {
  48391. var category = getCategory(codePoint);
  48392. return category === 'Nd' || category === 'No' || category === 'Nl' || category === 'Lu' || category === 'Ll' || category === 'Lt' || category === 'Lm' || category === 'Lo' || category === 'Me' || category === 'Mc';
  48393. };
  48394. var isMark = function isMark(codePoint) {
  48395. var category = getCategory(codePoint);
  48396. return category === 'Mn' || category === 'Me' || category === 'Mc';
  48397. };
  48398. return {
  48399. getCategory: getCategory,
  48400. getCombiningClass: getCombiningClass,
  48401. getScript: getScript,
  48402. getEastAsianWidth: getEastAsianWidth,
  48403. getNumericValue: getNumericValue,
  48404. isAlphabetic: isAlphabetic,
  48405. isDigit: isDigit,
  48406. isPunctuation: isPunctuation,
  48407. isLowerCase: isLowerCase,
  48408. isUpperCase: isUpperCase,
  48409. isTitleCase: isTitleCase,
  48410. isWhiteSpace: isWhiteSpace,
  48411. isBaseForm: isBaseForm,
  48412. isMark: isMark
  48413. };
  48414. };
  48415. var trie = new _unicodeTrie.default(_base64Js.default.toByteArray(trieData.data));
  48416. var unicodeProperties = buildUnicodeProperties(data, trie);
  48417. var _default = unicodeProperties;
  48418. exports.default = _default;
  48419. /***/ }),
  48420. /* 420 */
  48421. /***/ (function(module, exports, __webpack_require__) {
  48422. // 20.2.2.22 Math.log2(x)
  48423. var $export = __webpack_require__(5);
  48424. $export($export.S, 'Math', {
  48425. log2: function log2(x) {
  48426. return Math.log(x) / Math.LN2;
  48427. }
  48428. });
  48429. /***/ }),
  48430. /* 421 */
  48431. /***/ (function(module, exports, __webpack_require__) {
  48432. "use strict";
  48433. __webpack_require__(82);
  48434. __webpack_require__(44);
  48435. var inflate = __webpack_require__(83);
  48436. var _require = __webpack_require__(422),
  48437. swap32LE = _require.swap32LE; // Shift size for getting the index-1 table offset.
  48438. var SHIFT_1 = 6 + 5; // Shift size for getting the index-2 table offset.
  48439. var SHIFT_2 = 5; // Difference between the two shift sizes,
  48440. // for getting an index-1 offset from an index-2 offset. 6=11-5
  48441. var SHIFT_1_2 = SHIFT_1 - SHIFT_2; // Number of index-1 entries for the BMP. 32=0x20
  48442. // This part of the index-1 table is omitted from the serialized form.
  48443. var OMITTED_BMP_INDEX_1_LENGTH = 0x10000 >> SHIFT_1; // Number of entries in an index-2 block. 64=0x40
  48444. var INDEX_2_BLOCK_LENGTH = 1 << SHIFT_1_2; // Mask for getting the lower bits for the in-index-2-block offset. */
  48445. var INDEX_2_MASK = INDEX_2_BLOCK_LENGTH - 1; // Shift size for shifting left the index array values.
  48446. // Increases possible data size with 16-bit index values at the cost
  48447. // of compactability.
  48448. // This requires data blocks to be aligned by DATA_GRANULARITY.
  48449. var INDEX_SHIFT = 2; // Number of entries in a data block. 32=0x20
  48450. var DATA_BLOCK_LENGTH = 1 << SHIFT_2; // Mask for getting the lower bits for the in-data-block offset.
  48451. var DATA_MASK = DATA_BLOCK_LENGTH - 1; // The part of the index-2 table for U+D800..U+DBFF stores values for
  48452. // lead surrogate code _units_ not code _points_.
  48453. // Values for lead surrogate code _points_ are indexed with this portion of the table.
  48454. // Length=32=0x20=0x400>>SHIFT_2. (There are 1024=0x400 lead surrogates.)
  48455. var LSCP_INDEX_2_OFFSET = 0x10000 >> SHIFT_2;
  48456. var LSCP_INDEX_2_LENGTH = 0x400 >> SHIFT_2; // Count the lengths of both BMP pieces. 2080=0x820
  48457. var INDEX_2_BMP_LENGTH = LSCP_INDEX_2_OFFSET + LSCP_INDEX_2_LENGTH; // The 2-byte UTF-8 version of the index-2 table follows at offset 2080=0x820.
  48458. // Length 32=0x20 for lead bytes C0..DF, regardless of SHIFT_2.
  48459. var UTF8_2B_INDEX_2_OFFSET = INDEX_2_BMP_LENGTH;
  48460. var UTF8_2B_INDEX_2_LENGTH = 0x800 >> 6; // U+0800 is the first code point after 2-byte UTF-8
  48461. // The index-1 table, only used for supplementary code points, at offset 2112=0x840.
  48462. // Variable length, for code points up to highStart, where the last single-value range starts.
  48463. // Maximum length 512=0x200=0x100000>>SHIFT_1.
  48464. // (For 0x100000 supplementary code points U+10000..U+10ffff.)
  48465. //
  48466. // The part of the index-2 table for supplementary code points starts
  48467. // after this index-1 table.
  48468. //
  48469. // Both the index-1 table and the following part of the index-2 table
  48470. // are omitted completely if there is only BMP data.
  48471. var INDEX_1_OFFSET = UTF8_2B_INDEX_2_OFFSET + UTF8_2B_INDEX_2_LENGTH; // The alignment size of a data block. Also the granularity for compaction.
  48472. var DATA_GRANULARITY = 1 << INDEX_SHIFT;
  48473. var UnicodeTrie = /*#__PURE__*/function () {
  48474. function UnicodeTrie(data) {
  48475. var isBuffer = typeof data.readUInt32BE === 'function' && typeof data.slice === 'function';
  48476. if (isBuffer || data instanceof Uint8Array) {
  48477. // read binary format
  48478. var uncompressedLength;
  48479. if (isBuffer) {
  48480. this.highStart = data.readUInt32LE(0);
  48481. this.errorValue = data.readUInt32LE(4);
  48482. uncompressedLength = data.readUInt32LE(8);
  48483. data = data.slice(12);
  48484. } else {
  48485. var view = new DataView(data.buffer);
  48486. this.highStart = view.getUint32(0, true);
  48487. this.errorValue = view.getUint32(4, true);
  48488. uncompressedLength = view.getUint32(8, true);
  48489. data = data.subarray(12);
  48490. } // double inflate the actual trie data
  48491. data = inflate(data, new Uint8Array(uncompressedLength));
  48492. data = inflate(data, new Uint8Array(uncompressedLength)); // swap bytes from little-endian
  48493. swap32LE(data);
  48494. this.data = new Uint32Array(data.buffer);
  48495. } else {
  48496. // pre-parsed data
  48497. var _data = data;
  48498. this.data = _data.data;
  48499. this.highStart = _data.highStart;
  48500. this.errorValue = _data.errorValue;
  48501. }
  48502. }
  48503. var _proto = UnicodeTrie.prototype;
  48504. _proto.get = function get(codePoint) {
  48505. var index;
  48506. if (codePoint < 0 || codePoint > 0x10ffff) {
  48507. return this.errorValue;
  48508. }
  48509. if (codePoint < 0xd800 || codePoint > 0xdbff && codePoint <= 0xffff) {
  48510. // Ordinary BMP code point, excluding leading surrogates.
  48511. // BMP uses a single level lookup. BMP index starts at offset 0 in the index.
  48512. // data is stored in the index array itself.
  48513. index = (this.data[codePoint >> SHIFT_2] << INDEX_SHIFT) + (codePoint & DATA_MASK);
  48514. return this.data[index];
  48515. }
  48516. if (codePoint <= 0xffff) {
  48517. // Lead Surrogate Code Point. A Separate index section is stored for
  48518. // lead surrogate code units and code points.
  48519. // The main index has the code unit data.
  48520. // For this function, we need the code point data.
  48521. index = (this.data[LSCP_INDEX_2_OFFSET + (codePoint - 0xd800 >> SHIFT_2)] << INDEX_SHIFT) + (codePoint & DATA_MASK);
  48522. return this.data[index];
  48523. }
  48524. if (codePoint < this.highStart) {
  48525. // Supplemental code point, use two-level lookup.
  48526. index = this.data[INDEX_1_OFFSET - OMITTED_BMP_INDEX_1_LENGTH + (codePoint >> SHIFT_1)];
  48527. index = this.data[index + (codePoint >> SHIFT_2 & INDEX_2_MASK)];
  48528. index = (index << INDEX_SHIFT) + (codePoint & DATA_MASK);
  48529. return this.data[index];
  48530. }
  48531. return this.data[this.data.length - DATA_GRANULARITY];
  48532. };
  48533. return UnicodeTrie;
  48534. }();
  48535. module.exports = UnicodeTrie;
  48536. /***/ }),
  48537. /* 422 */
  48538. /***/ (function(module, exports, __webpack_require__) {
  48539. "use strict";
  48540. __webpack_require__(82);
  48541. __webpack_require__(44);
  48542. var isBigEndian = new Uint8Array(new Uint32Array([0x12345678]).buffer)[0] === 0x12;
  48543. var swap = function swap(b, n, m) {
  48544. var i = b[n];
  48545. b[n] = b[m];
  48546. b[m] = i;
  48547. };
  48548. var swap32 = function swap32(array) {
  48549. var len = array.length;
  48550. for (var i = 0; i < len; i += 4) {
  48551. swap(array, i, i + 3);
  48552. swap(array, i + 1, i + 2);
  48553. }
  48554. };
  48555. var swap32LE = function swap32LE(array) {
  48556. if (isBigEndian) {
  48557. swap32(array);
  48558. }
  48559. };
  48560. module.exports = {
  48561. swap32LE: swap32LE
  48562. };
  48563. /***/ }),
  48564. /* 423 */
  48565. /***/ (function(module, exports, __webpack_require__) {
  48566. "use strict";
  48567. __webpack_require__(44);
  48568. exports.byteLength = byteLength;
  48569. exports.toByteArray = toByteArray;
  48570. exports.fromByteArray = fromByteArray;
  48571. var lookup = [];
  48572. var revLookup = [];
  48573. var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array;
  48574. var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
  48575. for (var i = 0, len = code.length; i < len; ++i) {
  48576. lookup[i] = code[i];
  48577. revLookup[code.charCodeAt(i)] = i;
  48578. } // Support decoding URL-safe base64 strings, as Node.js does.
  48579. // See: https://en.wikipedia.org/wiki/Base64#URL_applications
  48580. revLookup['-'.charCodeAt(0)] = 62;
  48581. revLookup['_'.charCodeAt(0)] = 63;
  48582. function getLens(b64) {
  48583. var len = b64.length;
  48584. if (len % 4 > 0) {
  48585. throw new Error('Invalid string. Length must be a multiple of 4');
  48586. } // Trim off extra bytes after placeholder bytes are found
  48587. // See: https://github.com/beatgammit/base64-js/issues/42
  48588. var validLen = b64.indexOf('=');
  48589. if (validLen === -1) validLen = len;
  48590. var placeHoldersLen = validLen === len ? 0 : 4 - validLen % 4;
  48591. return [validLen, placeHoldersLen];
  48592. } // base64 is 4/3 + up to two characters of the original data
  48593. function byteLength(b64) {
  48594. var lens = getLens(b64);
  48595. var validLen = lens[0];
  48596. var placeHoldersLen = lens[1];
  48597. return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen;
  48598. }
  48599. function _byteLength(b64, validLen, placeHoldersLen) {
  48600. return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen;
  48601. }
  48602. function toByteArray(b64) {
  48603. var tmp;
  48604. var lens = getLens(b64);
  48605. var validLen = lens[0];
  48606. var placeHoldersLen = lens[1];
  48607. var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen));
  48608. var curByte = 0; // if there are placeholders, only get up to the last complete 4 chars
  48609. var len = placeHoldersLen > 0 ? validLen - 4 : validLen;
  48610. var i;
  48611. for (i = 0; i < len; i += 4) {
  48612. tmp = revLookup[b64.charCodeAt(i)] << 18 | revLookup[b64.charCodeAt(i + 1)] << 12 | revLookup[b64.charCodeAt(i + 2)] << 6 | revLookup[b64.charCodeAt(i + 3)];
  48613. arr[curByte++] = tmp >> 16 & 0xFF;
  48614. arr[curByte++] = tmp >> 8 & 0xFF;
  48615. arr[curByte++] = tmp & 0xFF;
  48616. }
  48617. if (placeHoldersLen === 2) {
  48618. tmp = revLookup[b64.charCodeAt(i)] << 2 | revLookup[b64.charCodeAt(i + 1)] >> 4;
  48619. arr[curByte++] = tmp & 0xFF;
  48620. }
  48621. if (placeHoldersLen === 1) {
  48622. tmp = revLookup[b64.charCodeAt(i)] << 10 | revLookup[b64.charCodeAt(i + 1)] << 4 | revLookup[b64.charCodeAt(i + 2)] >> 2;
  48623. arr[curByte++] = tmp >> 8 & 0xFF;
  48624. arr[curByte++] = tmp & 0xFF;
  48625. }
  48626. return arr;
  48627. }
  48628. function tripletToBase64(num) {
  48629. return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F];
  48630. }
  48631. function encodeChunk(uint8, start, end) {
  48632. var tmp;
  48633. var output = [];
  48634. for (var i = start; i < end; i += 3) {
  48635. tmp = (uint8[i] << 16 & 0xFF0000) + (uint8[i + 1] << 8 & 0xFF00) + (uint8[i + 2] & 0xFF);
  48636. output.push(tripletToBase64(tmp));
  48637. }
  48638. return output.join('');
  48639. }
  48640. function fromByteArray(uint8) {
  48641. var tmp;
  48642. var len = uint8.length;
  48643. var extraBytes = len % 3; // if we have 1 byte left, pad 2 bytes
  48644. var parts = [];
  48645. var maxChunkLength = 16383; // must be multiple of 3
  48646. // go through the array every three bytes, we'll deal with trailing stuff later
  48647. for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
  48648. parts.push(encodeChunk(uint8, i, i + maxChunkLength > len2 ? len2 : i + maxChunkLength));
  48649. } // pad the end with zeros, but make sure to not forget the extra bytes
  48650. if (extraBytes === 1) {
  48651. tmp = uint8[len - 1];
  48652. parts.push(lookup[tmp >> 2] + lookup[tmp << 4 & 0x3F] + '==');
  48653. } else if (extraBytes === 2) {
  48654. tmp = (uint8[len - 2] << 8) + uint8[len - 1];
  48655. parts.push(lookup[tmp >> 10] + lookup[tmp >> 4 & 0x3F] + lookup[tmp << 2 & 0x3F] + '=');
  48656. }
  48657. return parts.join('');
  48658. }
  48659. /***/ }),
  48660. /* 424 */
  48661. /***/ (function(module, exports, __webpack_require__) {
  48662. "use strict";
  48663. __webpack_require__(82);
  48664. __webpack_require__(44);
  48665. // Generated by CoffeeScript 1.7.1
  48666. var UnicodeTrie, inflate;
  48667. inflate = __webpack_require__(83);
  48668. UnicodeTrie = function () {
  48669. var DATA_BLOCK_LENGTH, DATA_GRANULARITY, DATA_MASK, INDEX_1_OFFSET, INDEX_2_BLOCK_LENGTH, INDEX_2_BMP_LENGTH, INDEX_2_MASK, INDEX_SHIFT, LSCP_INDEX_2_LENGTH, LSCP_INDEX_2_OFFSET, OMITTED_BMP_INDEX_1_LENGTH, SHIFT_1, SHIFT_1_2, SHIFT_2, UTF8_2B_INDEX_2_LENGTH, UTF8_2B_INDEX_2_OFFSET;
  48670. SHIFT_1 = 6 + 5;
  48671. SHIFT_2 = 5;
  48672. SHIFT_1_2 = SHIFT_1 - SHIFT_2;
  48673. OMITTED_BMP_INDEX_1_LENGTH = 0x10000 >> SHIFT_1;
  48674. INDEX_2_BLOCK_LENGTH = 1 << SHIFT_1_2;
  48675. INDEX_2_MASK = INDEX_2_BLOCK_LENGTH - 1;
  48676. INDEX_SHIFT = 2;
  48677. DATA_BLOCK_LENGTH = 1 << SHIFT_2;
  48678. DATA_MASK = DATA_BLOCK_LENGTH - 1;
  48679. LSCP_INDEX_2_OFFSET = 0x10000 >> SHIFT_2;
  48680. LSCP_INDEX_2_LENGTH = 0x400 >> SHIFT_2;
  48681. INDEX_2_BMP_LENGTH = LSCP_INDEX_2_OFFSET + LSCP_INDEX_2_LENGTH;
  48682. UTF8_2B_INDEX_2_OFFSET = INDEX_2_BMP_LENGTH;
  48683. UTF8_2B_INDEX_2_LENGTH = 0x800 >> 6;
  48684. INDEX_1_OFFSET = UTF8_2B_INDEX_2_OFFSET + UTF8_2B_INDEX_2_LENGTH;
  48685. DATA_GRANULARITY = 1 << INDEX_SHIFT;
  48686. function UnicodeTrie(data) {
  48687. var isBuffer, uncompressedLength, view;
  48688. isBuffer = typeof data.readUInt32BE === 'function' && typeof data.slice === 'function';
  48689. if (isBuffer || data instanceof Uint8Array) {
  48690. if (isBuffer) {
  48691. this.highStart = data.readUInt32BE(0);
  48692. this.errorValue = data.readUInt32BE(4);
  48693. uncompressedLength = data.readUInt32BE(8);
  48694. data = data.slice(12);
  48695. } else {
  48696. view = new DataView(data.buffer);
  48697. this.highStart = view.getUint32(0);
  48698. this.errorValue = view.getUint32(4);
  48699. uncompressedLength = view.getUint32(8);
  48700. data = data.subarray(12);
  48701. }
  48702. data = inflate(data, new Uint8Array(uncompressedLength));
  48703. data = inflate(data, new Uint8Array(uncompressedLength));
  48704. this.data = new Uint32Array(data.buffer);
  48705. } else {
  48706. this.data = data.data, this.highStart = data.highStart, this.errorValue = data.errorValue;
  48707. }
  48708. }
  48709. UnicodeTrie.prototype.get = function (codePoint) {
  48710. var index;
  48711. if (codePoint < 0 || codePoint > 0x10ffff) {
  48712. return this.errorValue;
  48713. }
  48714. if (codePoint < 0xd800 || codePoint > 0xdbff && codePoint <= 0xffff) {
  48715. index = (this.data[codePoint >> SHIFT_2] << INDEX_SHIFT) + (codePoint & DATA_MASK);
  48716. return this.data[index];
  48717. }
  48718. if (codePoint <= 0xffff) {
  48719. index = (this.data[LSCP_INDEX_2_OFFSET + (codePoint - 0xd800 >> SHIFT_2)] << INDEX_SHIFT) + (codePoint & DATA_MASK);
  48720. return this.data[index];
  48721. }
  48722. if (codePoint < this.highStart) {
  48723. index = this.data[INDEX_1_OFFSET - OMITTED_BMP_INDEX_1_LENGTH + (codePoint >> SHIFT_1)];
  48724. index = this.data[index + (codePoint >> SHIFT_2 & INDEX_2_MASK)];
  48725. index = (index << INDEX_SHIFT) + (codePoint & DATA_MASK);
  48726. return this.data[index];
  48727. }
  48728. return this.data[this.data.length - DATA_GRANULARITY];
  48729. };
  48730. return UnicodeTrie;
  48731. }();
  48732. module.exports = UnicodeTrie;
  48733. /***/ }),
  48734. /* 425 */
  48735. /***/ (function(module, exports, __webpack_require__) {
  48736. "use strict";
  48737. __webpack_require__(99);
  48738. __webpack_require__(426);
  48739. __webpack_require__(162);
  48740. __webpack_require__(165);
  48741. __webpack_require__(92);
  48742. var INITIAL_STATE = 1;
  48743. var FAIL_STATE = 0;
  48744. /**
  48745. * A StateMachine represents a deterministic finite automaton.
  48746. * It can perform matches over a sequence of values, similar to a regular expression.
  48747. */
  48748. var StateMachine = /*#__PURE__*/function () {
  48749. function StateMachine(dfa) {
  48750. this.stateTable = dfa.stateTable;
  48751. this.accepting = dfa.accepting;
  48752. this.tags = dfa.tags;
  48753. }
  48754. /**
  48755. * Returns an iterable object that yields pattern matches over the input sequence.
  48756. * Matches are of the form [startIndex, endIndex, tags].
  48757. */
  48758. var _proto = StateMachine.prototype;
  48759. _proto.match = function match(str) {
  48760. var _ref;
  48761. var self = this;
  48762. return _ref = {}, _ref[Symbol.iterator] = /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
  48763. var state, startRun, lastAccepting, lastState, p, c;
  48764. return regeneratorRuntime.wrap(function _callee$(_context) {
  48765. while (1) {
  48766. switch (_context.prev = _context.next) {
  48767. case 0:
  48768. state = INITIAL_STATE;
  48769. startRun = null;
  48770. lastAccepting = null;
  48771. lastState = null;
  48772. p = 0;
  48773. case 5:
  48774. if (!(p < str.length)) {
  48775. _context.next = 21;
  48776. break;
  48777. }
  48778. c = str[p];
  48779. lastState = state;
  48780. state = self.stateTable[state][c];
  48781. if (!(state === FAIL_STATE)) {
  48782. _context.next = 15;
  48783. break;
  48784. }
  48785. if (!(startRun != null && lastAccepting != null && lastAccepting >= startRun)) {
  48786. _context.next = 13;
  48787. break;
  48788. }
  48789. _context.next = 13;
  48790. return [startRun, lastAccepting, self.tags[lastState]];
  48791. case 13:
  48792. // reset the state as if we started over from the initial state
  48793. state = self.stateTable[INITIAL_STATE][c];
  48794. startRun = null;
  48795. case 15:
  48796. // start a run if not in the failure state
  48797. if (state !== FAIL_STATE && startRun == null) {
  48798. startRun = p;
  48799. } // if accepting, mark the potential match end
  48800. if (self.accepting[state]) {
  48801. lastAccepting = p;
  48802. } // reset the state to the initial state if we get into the failure state
  48803. if (state === FAIL_STATE) {
  48804. state = INITIAL_STATE;
  48805. }
  48806. case 18:
  48807. p++;
  48808. _context.next = 5;
  48809. break;
  48810. case 21:
  48811. if (!(startRun != null && lastAccepting != null && lastAccepting >= startRun)) {
  48812. _context.next = 24;
  48813. break;
  48814. }
  48815. _context.next = 24;
  48816. return [startRun, lastAccepting, self.tags[state]];
  48817. case 24:
  48818. case "end":
  48819. return _context.stop();
  48820. }
  48821. }
  48822. }, _callee);
  48823. }), _ref;
  48824. }
  48825. /**
  48826. * For each match over the input sequence, action functions matching
  48827. * the tag definitions in the input pattern are called with the startIndex,
  48828. * endIndex, and sub-match sequence.
  48829. */
  48830. ;
  48831. _proto.apply = function apply(str, actions) {
  48832. for (var _iterator = this.match(str), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
  48833. var _ref2;
  48834. if (_isArray) {
  48835. if (_i >= _iterator.length) break;
  48836. _ref2 = _iterator[_i++];
  48837. } else {
  48838. _i = _iterator.next();
  48839. if (_i.done) break;
  48840. _ref2 = _i.value;
  48841. }
  48842. var _ref3 = _ref2,
  48843. start = _ref3[0],
  48844. end = _ref3[1],
  48845. tags = _ref3[2];
  48846. for (var _iterator2 = tags, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
  48847. var _ref4;
  48848. if (_isArray2) {
  48849. if (_i2 >= _iterator2.length) break;
  48850. _ref4 = _iterator2[_i2++];
  48851. } else {
  48852. _i2 = _iterator2.next();
  48853. if (_i2.done) break;
  48854. _ref4 = _i2.value;
  48855. }
  48856. var tag = _ref4;
  48857. if (typeof actions[tag] === 'function') {
  48858. actions[tag](start, end, str.slice(start, end + 1));
  48859. }
  48860. }
  48861. }
  48862. };
  48863. return StateMachine;
  48864. }();
  48865. module.exports = StateMachine;
  48866. /***/ }),
  48867. /* 426 */
  48868. /***/ (function(module, exports) {
  48869. /**
  48870. * Copyright (c) 2014-present, Facebook, Inc.
  48871. *
  48872. * This source code is licensed under the MIT license found in the
  48873. * LICENSE file in the root directory of this source tree.
  48874. */
  48875. !(function(global) {
  48876. "use strict";
  48877. var Op = Object.prototype;
  48878. var hasOwn = Op.hasOwnProperty;
  48879. var undefined; // More compressible than void 0.
  48880. var $Symbol = typeof Symbol === "function" ? Symbol : {};
  48881. var iteratorSymbol = $Symbol.iterator || "@@iterator";
  48882. var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
  48883. var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
  48884. var inModule = typeof module === "object";
  48885. var runtime = global.regeneratorRuntime;
  48886. if (runtime) {
  48887. if (inModule) {
  48888. // If regeneratorRuntime is defined globally and we're in a module,
  48889. // make the exports object identical to regeneratorRuntime.
  48890. module.exports = runtime;
  48891. }
  48892. // Don't bother evaluating the rest of this file if the runtime was
  48893. // already defined globally.
  48894. return;
  48895. }
  48896. // Define the runtime globally (as expected by generated code) as either
  48897. // module.exports (if we're in a module) or a new, empty object.
  48898. runtime = global.regeneratorRuntime = inModule ? module.exports : {};
  48899. function wrap(innerFn, outerFn, self, tryLocsList) {
  48900. // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
  48901. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
  48902. var generator = Object.create(protoGenerator.prototype);
  48903. var context = new Context(tryLocsList || []);
  48904. // The ._invoke method unifies the implementations of the .next,
  48905. // .throw, and .return methods.
  48906. generator._invoke = makeInvokeMethod(innerFn, self, context);
  48907. return generator;
  48908. }
  48909. runtime.wrap = wrap;
  48910. // Try/catch helper to minimize deoptimizations. Returns a completion
  48911. // record like context.tryEntries[i].completion. This interface could
  48912. // have been (and was previously) designed to take a closure to be
  48913. // invoked without arguments, but in all the cases we care about we
  48914. // already have an existing method we want to call, so there's no need
  48915. // to create a new function object. We can even get away with assuming
  48916. // the method takes exactly one argument, since that happens to be true
  48917. // in every case, so we don't have to touch the arguments object. The
  48918. // only additional allocation required is the completion record, which
  48919. // has a stable shape and so hopefully should be cheap to allocate.
  48920. function tryCatch(fn, obj, arg) {
  48921. try {
  48922. return { type: "normal", arg: fn.call(obj, arg) };
  48923. } catch (err) {
  48924. return { type: "throw", arg: err };
  48925. }
  48926. }
  48927. var GenStateSuspendedStart = "suspendedStart";
  48928. var GenStateSuspendedYield = "suspendedYield";
  48929. var GenStateExecuting = "executing";
  48930. var GenStateCompleted = "completed";
  48931. // Returning this object from the innerFn has the same effect as
  48932. // breaking out of the dispatch switch statement.
  48933. var ContinueSentinel = {};
  48934. // Dummy constructor functions that we use as the .constructor and
  48935. // .constructor.prototype properties for functions that return Generator
  48936. // objects. For full spec compliance, you may wish to configure your
  48937. // minifier not to mangle the names of these two functions.
  48938. function Generator() {}
  48939. function GeneratorFunction() {}
  48940. function GeneratorFunctionPrototype() {}
  48941. // This is a polyfill for %IteratorPrototype% for environments that
  48942. // don't natively support it.
  48943. var IteratorPrototype = {};
  48944. IteratorPrototype[iteratorSymbol] = function () {
  48945. return this;
  48946. };
  48947. var getProto = Object.getPrototypeOf;
  48948. var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
  48949. if (NativeIteratorPrototype &&
  48950. NativeIteratorPrototype !== Op &&
  48951. hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
  48952. // This environment has a native %IteratorPrototype%; use it instead
  48953. // of the polyfill.
  48954. IteratorPrototype = NativeIteratorPrototype;
  48955. }
  48956. var Gp = GeneratorFunctionPrototype.prototype =
  48957. Generator.prototype = Object.create(IteratorPrototype);
  48958. GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
  48959. GeneratorFunctionPrototype.constructor = GeneratorFunction;
  48960. GeneratorFunctionPrototype[toStringTagSymbol] =
  48961. GeneratorFunction.displayName = "GeneratorFunction";
  48962. // Helper for defining the .next, .throw, and .return methods of the
  48963. // Iterator interface in terms of a single ._invoke method.
  48964. function defineIteratorMethods(prototype) {
  48965. ["next", "throw", "return"].forEach(function(method) {
  48966. prototype[method] = function(arg) {
  48967. return this._invoke(method, arg);
  48968. };
  48969. });
  48970. }
  48971. runtime.isGeneratorFunction = function(genFun) {
  48972. var ctor = typeof genFun === "function" && genFun.constructor;
  48973. return ctor
  48974. ? ctor === GeneratorFunction ||
  48975. // For the native GeneratorFunction constructor, the best we can
  48976. // do is to check its .name property.
  48977. (ctor.displayName || ctor.name) === "GeneratorFunction"
  48978. : false;
  48979. };
  48980. runtime.mark = function(genFun) {
  48981. if (Object.setPrototypeOf) {
  48982. Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
  48983. } else {
  48984. genFun.__proto__ = GeneratorFunctionPrototype;
  48985. if (!(toStringTagSymbol in genFun)) {
  48986. genFun[toStringTagSymbol] = "GeneratorFunction";
  48987. }
  48988. }
  48989. genFun.prototype = Object.create(Gp);
  48990. return genFun;
  48991. };
  48992. // Within the body of any async function, `await x` is transformed to
  48993. // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
  48994. // `hasOwn.call(value, "__await")` to determine if the yielded value is
  48995. // meant to be awaited.
  48996. runtime.awrap = function(arg) {
  48997. return { __await: arg };
  48998. };
  48999. function AsyncIterator(generator) {
  49000. function invoke(method, arg, resolve, reject) {
  49001. var record = tryCatch(generator[method], generator, arg);
  49002. if (record.type === "throw") {
  49003. reject(record.arg);
  49004. } else {
  49005. var result = record.arg;
  49006. var value = result.value;
  49007. if (value &&
  49008. typeof value === "object" &&
  49009. hasOwn.call(value, "__await")) {
  49010. return Promise.resolve(value.__await).then(function(value) {
  49011. invoke("next", value, resolve, reject);
  49012. }, function(err) {
  49013. invoke("throw", err, resolve, reject);
  49014. });
  49015. }
  49016. return Promise.resolve(value).then(function(unwrapped) {
  49017. // When a yielded Promise is resolved, its final value becomes
  49018. // the .value of the Promise<{value,done}> result for the
  49019. // current iteration. If the Promise is rejected, however, the
  49020. // result for this iteration will be rejected with the same
  49021. // reason. Note that rejections of yielded Promises are not
  49022. // thrown back into the generator function, as is the case
  49023. // when an awaited Promise is rejected. This difference in
  49024. // behavior between yield and await is important, because it
  49025. // allows the consumer to decide what to do with the yielded
  49026. // rejection (swallow it and continue, manually .throw it back
  49027. // into the generator, abandon iteration, whatever). With
  49028. // await, by contrast, there is no opportunity to examine the
  49029. // rejection reason outside the generator function, so the
  49030. // only option is to throw it from the await expression, and
  49031. // let the generator function handle the exception.
  49032. result.value = unwrapped;
  49033. resolve(result);
  49034. }, reject);
  49035. }
  49036. }
  49037. var previousPromise;
  49038. function enqueue(method, arg) {
  49039. function callInvokeWithMethodAndArg() {
  49040. return new Promise(function(resolve, reject) {
  49041. invoke(method, arg, resolve, reject);
  49042. });
  49043. }
  49044. return previousPromise =
  49045. // If enqueue has been called before, then we want to wait until
  49046. // all previous Promises have been resolved before calling invoke,
  49047. // so that results are always delivered in the correct order. If
  49048. // enqueue has not been called before, then it is important to
  49049. // call invoke immediately, without waiting on a callback to fire,
  49050. // so that the async generator function has the opportunity to do
  49051. // any necessary setup in a predictable way. This predictability
  49052. // is why the Promise constructor synchronously invokes its
  49053. // executor callback, and why async functions synchronously
  49054. // execute code before the first await. Since we implement simple
  49055. // async functions in terms of async generators, it is especially
  49056. // important to get this right, even though it requires care.
  49057. previousPromise ? previousPromise.then(
  49058. callInvokeWithMethodAndArg,
  49059. // Avoid propagating failures to Promises returned by later
  49060. // invocations of the iterator.
  49061. callInvokeWithMethodAndArg
  49062. ) : callInvokeWithMethodAndArg();
  49063. }
  49064. // Define the unified helper method that is used to implement .next,
  49065. // .throw, and .return (see defineIteratorMethods).
  49066. this._invoke = enqueue;
  49067. }
  49068. defineIteratorMethods(AsyncIterator.prototype);
  49069. AsyncIterator.prototype[asyncIteratorSymbol] = function () {
  49070. return this;
  49071. };
  49072. runtime.AsyncIterator = AsyncIterator;
  49073. // Note that simple async functions are implemented on top of
  49074. // AsyncIterator objects; they just return a Promise for the value of
  49075. // the final result produced by the iterator.
  49076. runtime.async = function(innerFn, outerFn, self, tryLocsList) {
  49077. var iter = new AsyncIterator(
  49078. wrap(innerFn, outerFn, self, tryLocsList)
  49079. );
  49080. return runtime.isGeneratorFunction(outerFn)
  49081. ? iter // If outerFn is a generator, return the full iterator.
  49082. : iter.next().then(function(result) {
  49083. return result.done ? result.value : iter.next();
  49084. });
  49085. };
  49086. function makeInvokeMethod(innerFn, self, context) {
  49087. var state = GenStateSuspendedStart;
  49088. return function invoke(method, arg) {
  49089. if (state === GenStateExecuting) {
  49090. throw new Error("Generator is already running");
  49091. }
  49092. if (state === GenStateCompleted) {
  49093. if (method === "throw") {
  49094. throw arg;
  49095. }
  49096. // Be forgiving, per 25.3.3.3.3 of the spec:
  49097. // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
  49098. return doneResult();
  49099. }
  49100. context.method = method;
  49101. context.arg = arg;
  49102. while (true) {
  49103. var delegate = context.delegate;
  49104. if (delegate) {
  49105. var delegateResult = maybeInvokeDelegate(delegate, context);
  49106. if (delegateResult) {
  49107. if (delegateResult === ContinueSentinel) continue;
  49108. return delegateResult;
  49109. }
  49110. }
  49111. if (context.method === "next") {
  49112. // Setting context._sent for legacy support of Babel's
  49113. // function.sent implementation.
  49114. context.sent = context._sent = context.arg;
  49115. } else if (context.method === "throw") {
  49116. if (state === GenStateSuspendedStart) {
  49117. state = GenStateCompleted;
  49118. throw context.arg;
  49119. }
  49120. context.dispatchException(context.arg);
  49121. } else if (context.method === "return") {
  49122. context.abrupt("return", context.arg);
  49123. }
  49124. state = GenStateExecuting;
  49125. var record = tryCatch(innerFn, self, context);
  49126. if (record.type === "normal") {
  49127. // If an exception is thrown from innerFn, we leave state ===
  49128. // GenStateExecuting and loop back for another invocation.
  49129. state = context.done
  49130. ? GenStateCompleted
  49131. : GenStateSuspendedYield;
  49132. if (record.arg === ContinueSentinel) {
  49133. continue;
  49134. }
  49135. return {
  49136. value: record.arg,
  49137. done: context.done
  49138. };
  49139. } else if (record.type === "throw") {
  49140. state = GenStateCompleted;
  49141. // Dispatch the exception by looping back around to the
  49142. // context.dispatchException(context.arg) call above.
  49143. context.method = "throw";
  49144. context.arg = record.arg;
  49145. }
  49146. }
  49147. };
  49148. }
  49149. // Call delegate.iterator[context.method](context.arg) and handle the
  49150. // result, either by returning a { value, done } result from the
  49151. // delegate iterator, or by modifying context.method and context.arg,
  49152. // setting context.delegate to null, and returning the ContinueSentinel.
  49153. function maybeInvokeDelegate(delegate, context) {
  49154. var method = delegate.iterator[context.method];
  49155. if (method === undefined) {
  49156. // A .throw or .return when the delegate iterator has no .throw
  49157. // method always terminates the yield* loop.
  49158. context.delegate = null;
  49159. if (context.method === "throw") {
  49160. if (delegate.iterator.return) {
  49161. // If the delegate iterator has a return method, give it a
  49162. // chance to clean up.
  49163. context.method = "return";
  49164. context.arg = undefined;
  49165. maybeInvokeDelegate(delegate, context);
  49166. if (context.method === "throw") {
  49167. // If maybeInvokeDelegate(context) changed context.method from
  49168. // "return" to "throw", let that override the TypeError below.
  49169. return ContinueSentinel;
  49170. }
  49171. }
  49172. context.method = "throw";
  49173. context.arg = new TypeError(
  49174. "The iterator does not provide a 'throw' method");
  49175. }
  49176. return ContinueSentinel;
  49177. }
  49178. var record = tryCatch(method, delegate.iterator, context.arg);
  49179. if (record.type === "throw") {
  49180. context.method = "throw";
  49181. context.arg = record.arg;
  49182. context.delegate = null;
  49183. return ContinueSentinel;
  49184. }
  49185. var info = record.arg;
  49186. if (! info) {
  49187. context.method = "throw";
  49188. context.arg = new TypeError("iterator result is not an object");
  49189. context.delegate = null;
  49190. return ContinueSentinel;
  49191. }
  49192. if (info.done) {
  49193. // Assign the result of the finished delegate to the temporary
  49194. // variable specified by delegate.resultName (see delegateYield).
  49195. context[delegate.resultName] = info.value;
  49196. // Resume execution at the desired location (see delegateYield).
  49197. context.next = delegate.nextLoc;
  49198. // If context.method was "throw" but the delegate handled the
  49199. // exception, let the outer generator proceed normally. If
  49200. // context.method was "next", forget context.arg since it has been
  49201. // "consumed" by the delegate iterator. If context.method was
  49202. // "return", allow the original .return call to continue in the
  49203. // outer generator.
  49204. if (context.method !== "return") {
  49205. context.method = "next";
  49206. context.arg = undefined;
  49207. }
  49208. } else {
  49209. // Re-yield the result returned by the delegate method.
  49210. return info;
  49211. }
  49212. // The delegate iterator is finished, so forget it and continue with
  49213. // the outer generator.
  49214. context.delegate = null;
  49215. return ContinueSentinel;
  49216. }
  49217. // Define Generator.prototype.{next,throw,return} in terms of the
  49218. // unified ._invoke helper method.
  49219. defineIteratorMethods(Gp);
  49220. Gp[toStringTagSymbol] = "Generator";
  49221. // A Generator should always return itself as the iterator object when the
  49222. // @@iterator function is called on it. Some browsers' implementations of the
  49223. // iterator prototype chain incorrectly implement this, causing the Generator
  49224. // object to not be returned from this call. This ensures that doesn't happen.
  49225. // See https://github.com/facebook/regenerator/issues/274 for more details.
  49226. Gp[iteratorSymbol] = function() {
  49227. return this;
  49228. };
  49229. Gp.toString = function() {
  49230. return "[object Generator]";
  49231. };
  49232. function pushTryEntry(locs) {
  49233. var entry = { tryLoc: locs[0] };
  49234. if (1 in locs) {
  49235. entry.catchLoc = locs[1];
  49236. }
  49237. if (2 in locs) {
  49238. entry.finallyLoc = locs[2];
  49239. entry.afterLoc = locs[3];
  49240. }
  49241. this.tryEntries.push(entry);
  49242. }
  49243. function resetTryEntry(entry) {
  49244. var record = entry.completion || {};
  49245. record.type = "normal";
  49246. delete record.arg;
  49247. entry.completion = record;
  49248. }
  49249. function Context(tryLocsList) {
  49250. // The root entry object (effectively a try statement without a catch
  49251. // or a finally block) gives us a place to store values thrown from
  49252. // locations where there is no enclosing try statement.
  49253. this.tryEntries = [{ tryLoc: "root" }];
  49254. tryLocsList.forEach(pushTryEntry, this);
  49255. this.reset(true);
  49256. }
  49257. runtime.keys = function(object) {
  49258. var keys = [];
  49259. for (var key in object) {
  49260. keys.push(key);
  49261. }
  49262. keys.reverse();
  49263. // Rather than returning an object with a next method, we keep
  49264. // things simple and return the next function itself.
  49265. return function next() {
  49266. while (keys.length) {
  49267. var key = keys.pop();
  49268. if (key in object) {
  49269. next.value = key;
  49270. next.done = false;
  49271. return next;
  49272. }
  49273. }
  49274. // To avoid creating an additional object, we just hang the .value
  49275. // and .done properties off the next function object itself. This
  49276. // also ensures that the minifier will not anonymize the function.
  49277. next.done = true;
  49278. return next;
  49279. };
  49280. };
  49281. function values(iterable) {
  49282. if (iterable) {
  49283. var iteratorMethod = iterable[iteratorSymbol];
  49284. if (iteratorMethod) {
  49285. return iteratorMethod.call(iterable);
  49286. }
  49287. if (typeof iterable.next === "function") {
  49288. return iterable;
  49289. }
  49290. if (!isNaN(iterable.length)) {
  49291. var i = -1, next = function next() {
  49292. while (++i < iterable.length) {
  49293. if (hasOwn.call(iterable, i)) {
  49294. next.value = iterable[i];
  49295. next.done = false;
  49296. return next;
  49297. }
  49298. }
  49299. next.value = undefined;
  49300. next.done = true;
  49301. return next;
  49302. };
  49303. return next.next = next;
  49304. }
  49305. }
  49306. // Return an iterator with no values.
  49307. return { next: doneResult };
  49308. }
  49309. runtime.values = values;
  49310. function doneResult() {
  49311. return { value: undefined, done: true };
  49312. }
  49313. Context.prototype = {
  49314. constructor: Context,
  49315. reset: function(skipTempReset) {
  49316. this.prev = 0;
  49317. this.next = 0;
  49318. // Resetting context._sent for legacy support of Babel's
  49319. // function.sent implementation.
  49320. this.sent = this._sent = undefined;
  49321. this.done = false;
  49322. this.delegate = null;
  49323. this.method = "next";
  49324. this.arg = undefined;
  49325. this.tryEntries.forEach(resetTryEntry);
  49326. if (!skipTempReset) {
  49327. for (var name in this) {
  49328. // Not sure about the optimal order of these conditions:
  49329. if (name.charAt(0) === "t" &&
  49330. hasOwn.call(this, name) &&
  49331. !isNaN(+name.slice(1))) {
  49332. this[name] = undefined;
  49333. }
  49334. }
  49335. }
  49336. },
  49337. stop: function() {
  49338. this.done = true;
  49339. var rootEntry = this.tryEntries[0];
  49340. var rootRecord = rootEntry.completion;
  49341. if (rootRecord.type === "throw") {
  49342. throw rootRecord.arg;
  49343. }
  49344. return this.rval;
  49345. },
  49346. dispatchException: function(exception) {
  49347. if (this.done) {
  49348. throw exception;
  49349. }
  49350. var context = this;
  49351. function handle(loc, caught) {
  49352. record.type = "throw";
  49353. record.arg = exception;
  49354. context.next = loc;
  49355. if (caught) {
  49356. // If the dispatched exception was caught by a catch block,
  49357. // then let that catch block handle the exception normally.
  49358. context.method = "next";
  49359. context.arg = undefined;
  49360. }
  49361. return !! caught;
  49362. }
  49363. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  49364. var entry = this.tryEntries[i];
  49365. var record = entry.completion;
  49366. if (entry.tryLoc === "root") {
  49367. // Exception thrown outside of any try block that could handle
  49368. // it, so set the completion value of the entire function to
  49369. // throw the exception.
  49370. return handle("end");
  49371. }
  49372. if (entry.tryLoc <= this.prev) {
  49373. var hasCatch = hasOwn.call(entry, "catchLoc");
  49374. var hasFinally = hasOwn.call(entry, "finallyLoc");
  49375. if (hasCatch && hasFinally) {
  49376. if (this.prev < entry.catchLoc) {
  49377. return handle(entry.catchLoc, true);
  49378. } else if (this.prev < entry.finallyLoc) {
  49379. return handle(entry.finallyLoc);
  49380. }
  49381. } else if (hasCatch) {
  49382. if (this.prev < entry.catchLoc) {
  49383. return handle(entry.catchLoc, true);
  49384. }
  49385. } else if (hasFinally) {
  49386. if (this.prev < entry.finallyLoc) {
  49387. return handle(entry.finallyLoc);
  49388. }
  49389. } else {
  49390. throw new Error("try statement without catch or finally");
  49391. }
  49392. }
  49393. }
  49394. },
  49395. abrupt: function(type, arg) {
  49396. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  49397. var entry = this.tryEntries[i];
  49398. if (entry.tryLoc <= this.prev &&
  49399. hasOwn.call(entry, "finallyLoc") &&
  49400. this.prev < entry.finallyLoc) {
  49401. var finallyEntry = entry;
  49402. break;
  49403. }
  49404. }
  49405. if (finallyEntry &&
  49406. (type === "break" ||
  49407. type === "continue") &&
  49408. finallyEntry.tryLoc <= arg &&
  49409. arg <= finallyEntry.finallyLoc) {
  49410. // Ignore the finally entry if control is not jumping to a
  49411. // location outside the try/catch block.
  49412. finallyEntry = null;
  49413. }
  49414. var record = finallyEntry ? finallyEntry.completion : {};
  49415. record.type = type;
  49416. record.arg = arg;
  49417. if (finallyEntry) {
  49418. this.method = "next";
  49419. this.next = finallyEntry.finallyLoc;
  49420. return ContinueSentinel;
  49421. }
  49422. return this.complete(record);
  49423. },
  49424. complete: function(record, afterLoc) {
  49425. if (record.type === "throw") {
  49426. throw record.arg;
  49427. }
  49428. if (record.type === "break" ||
  49429. record.type === "continue") {
  49430. this.next = record.arg;
  49431. } else if (record.type === "return") {
  49432. this.rval = this.arg = record.arg;
  49433. this.method = "return";
  49434. this.next = "end";
  49435. } else if (record.type === "normal" && afterLoc) {
  49436. this.next = afterLoc;
  49437. }
  49438. return ContinueSentinel;
  49439. },
  49440. finish: function(finallyLoc) {
  49441. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  49442. var entry = this.tryEntries[i];
  49443. if (entry.finallyLoc === finallyLoc) {
  49444. this.complete(entry.completion, entry.afterLoc);
  49445. resetTryEntry(entry);
  49446. return ContinueSentinel;
  49447. }
  49448. }
  49449. },
  49450. "catch": function(tryLoc) {
  49451. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  49452. var entry = this.tryEntries[i];
  49453. if (entry.tryLoc === tryLoc) {
  49454. var record = entry.completion;
  49455. if (record.type === "throw") {
  49456. var thrown = record.arg;
  49457. resetTryEntry(entry);
  49458. }
  49459. return thrown;
  49460. }
  49461. }
  49462. // The context.catch method must only be called with a location
  49463. // argument that corresponds to a known catch block.
  49464. throw new Error("illegal catch attempt");
  49465. },
  49466. delegateYield: function(iterable, resultName, nextLoc) {
  49467. this.delegate = {
  49468. iterator: values(iterable),
  49469. resultName: resultName,
  49470. nextLoc: nextLoc
  49471. };
  49472. if (this.method === "next") {
  49473. // Deliberately forget the last sent value so that we don't
  49474. // accidentally pass it on to the delegate.
  49475. this.arg = undefined;
  49476. }
  49477. return ContinueSentinel;
  49478. }
  49479. };
  49480. })(
  49481. // In sloppy mode, unbound `this` refers to the global object, fallback to
  49482. // Function constructor if we're in global strict mode. That is sadly a form
  49483. // of indirect eval which violates Content Security Policy.
  49484. (function() { return this })() || Function("return this")()
  49485. );
  49486. /***/ }),
  49487. /* 427 */
  49488. /***/ (function(module, exports, __webpack_require__) {
  49489. module.exports = { "default": __webpack_require__(428), __esModule: true };
  49490. /***/ }),
  49491. /* 428 */
  49492. /***/ (function(module, exports, __webpack_require__) {
  49493. __webpack_require__(429);
  49494. module.exports = Math.pow(2, -52);
  49495. /***/ }),
  49496. /* 429 */
  49497. /***/ (function(module, exports, __webpack_require__) {
  49498. // 20.1.2.1 Number.EPSILON
  49499. var $export = __webpack_require__(7);
  49500. $export($export.S, 'Number', { EPSILON: Math.pow(2, -52) });
  49501. /***/ }),
  49502. /* 430 */
  49503. /***/ (function(module, exports, __webpack_require__) {
  49504. /* WEBPACK VAR INJECTION */(function(Buffer) {var clone = (function() {
  49505. 'use strict';
  49506. /**
  49507. * Clones (copies) an Object using deep copying.
  49508. *
  49509. * This function supports circular references by default, but if you are certain
  49510. * there are no circular references in your object, you can save some CPU time
  49511. * by calling clone(obj, false).
  49512. *
  49513. * Caution: if `circular` is false and `parent` contains circular references,
  49514. * your program may enter an infinite loop and crash.
  49515. *
  49516. * @param `parent` - the object to be cloned
  49517. * @param `circular` - set to true if the object to be cloned may contain
  49518. * circular references. (optional - true by default)
  49519. * @param `depth` - set to a number if the object is only to be cloned to
  49520. * a particular depth. (optional - defaults to Infinity)
  49521. * @param `prototype` - sets the prototype to be used when cloning an object.
  49522. * (optional - defaults to parent prototype).
  49523. */
  49524. function clone(parent, circular, depth, prototype) {
  49525. var filter;
  49526. if (typeof circular === 'object') {
  49527. depth = circular.depth;
  49528. prototype = circular.prototype;
  49529. filter = circular.filter;
  49530. circular = circular.circular
  49531. }
  49532. // maintain two arrays for circular references, where corresponding parents
  49533. // and children have the same index
  49534. var allParents = [];
  49535. var allChildren = [];
  49536. var useBuffer = typeof Buffer != 'undefined';
  49537. if (typeof circular == 'undefined')
  49538. circular = true;
  49539. if (typeof depth == 'undefined')
  49540. depth = Infinity;
  49541. // recurse this function so we don't reset allParents and allChildren
  49542. function _clone(parent, depth) {
  49543. // cloning null always returns null
  49544. if (parent === null)
  49545. return null;
  49546. if (depth == 0)
  49547. return parent;
  49548. var child;
  49549. var proto;
  49550. if (typeof parent != 'object') {
  49551. return parent;
  49552. }
  49553. if (clone.__isArray(parent)) {
  49554. child = [];
  49555. } else if (clone.__isRegExp(parent)) {
  49556. child = new RegExp(parent.source, __getRegExpFlags(parent));
  49557. if (parent.lastIndex) child.lastIndex = parent.lastIndex;
  49558. } else if (clone.__isDate(parent)) {
  49559. child = new Date(parent.getTime());
  49560. } else if (useBuffer && Buffer.isBuffer(parent)) {
  49561. if (Buffer.allocUnsafe) {
  49562. // Node.js >= 4.5.0
  49563. child = Buffer.allocUnsafe(parent.length);
  49564. } else {
  49565. // Older Node.js versions
  49566. child = new Buffer(parent.length);
  49567. }
  49568. parent.copy(child);
  49569. return child;
  49570. } else {
  49571. if (typeof prototype == 'undefined') {
  49572. proto = Object.getPrototypeOf(parent);
  49573. child = Object.create(proto);
  49574. }
  49575. else {
  49576. child = Object.create(prototype);
  49577. proto = prototype;
  49578. }
  49579. }
  49580. if (circular) {
  49581. var index = allParents.indexOf(parent);
  49582. if (index != -1) {
  49583. return allChildren[index];
  49584. }
  49585. allParents.push(parent);
  49586. allChildren.push(child);
  49587. }
  49588. for (var i in parent) {
  49589. var attrs;
  49590. if (proto) {
  49591. attrs = Object.getOwnPropertyDescriptor(proto, i);
  49592. }
  49593. if (attrs && attrs.set == null) {
  49594. continue;
  49595. }
  49596. child[i] = _clone(parent[i], depth - 1);
  49597. }
  49598. return child;
  49599. }
  49600. return _clone(parent, depth);
  49601. }
  49602. /**
  49603. * Simple flat clone using prototype, accepts only objects, usefull for property
  49604. * override on FLAT configuration object (no nested props).
  49605. *
  49606. * USE WITH CAUTION! This may not behave as you wish if you do not know how this
  49607. * works.
  49608. */
  49609. clone.clonePrototype = function clonePrototype(parent) {
  49610. if (parent === null)
  49611. return null;
  49612. var c = function () {};
  49613. c.prototype = parent;
  49614. return new c();
  49615. };
  49616. // private utility functions
  49617. function __objToStr(o) {
  49618. return Object.prototype.toString.call(o);
  49619. };
  49620. clone.__objToStr = __objToStr;
  49621. function __isDate(o) {
  49622. return typeof o === 'object' && __objToStr(o) === '[object Date]';
  49623. };
  49624. clone.__isDate = __isDate;
  49625. function __isArray(o) {
  49626. return typeof o === 'object' && __objToStr(o) === '[object Array]';
  49627. };
  49628. clone.__isArray = __isArray;
  49629. function __isRegExp(o) {
  49630. return typeof o === 'object' && __objToStr(o) === '[object RegExp]';
  49631. };
  49632. clone.__isRegExp = __isRegExp;
  49633. function __getRegExpFlags(re) {
  49634. var flags = '';
  49635. if (re.global) flags += 'g';
  49636. if (re.ignoreCase) flags += 'i';
  49637. if (re.multiline) flags += 'm';
  49638. return flags;
  49639. };
  49640. clone.__getRegExpFlags = __getRegExpFlags;
  49641. return clone;
  49642. })();
  49643. if ( true && module.exports) {
  49644. module.exports = clone;
  49645. }
  49646. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(4).Buffer))
  49647. /***/ }),
  49648. /* 431 */
  49649. /***/ (function(module, exports, __webpack_require__) {
  49650. module.exports = __webpack_require__(205).BrotliDecompressBuffer;
  49651. /***/ }),
  49652. /* 432 */
  49653. /***/ (function(module, exports) {
  49654. /* Copyright 2013 Google Inc. All Rights Reserved.
  49655. Licensed under the Apache License, Version 2.0 (the "License");
  49656. you may not use this file except in compliance with the License.
  49657. You may obtain a copy of the License at
  49658. http://www.apache.org/licenses/LICENSE-2.0
  49659. Unless required by applicable law or agreed to in writing, software
  49660. distributed under the License is distributed on an "AS IS" BASIS,
  49661. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  49662. See the License for the specific language governing permissions and
  49663. limitations under the License.
  49664. Bit reading helpers
  49665. */
  49666. var BROTLI_READ_SIZE = 4096;
  49667. var BROTLI_IBUF_SIZE = (2 * BROTLI_READ_SIZE + 32);
  49668. var BROTLI_IBUF_MASK = (2 * BROTLI_READ_SIZE - 1);
  49669. var kBitMask = new Uint32Array([
  49670. 0, 1, 3, 7, 15, 31, 63, 127, 255, 511, 1023, 2047, 4095, 8191, 16383, 32767,
  49671. 65535, 131071, 262143, 524287, 1048575, 2097151, 4194303, 8388607, 16777215
  49672. ]);
  49673. /* Input byte buffer, consist of a ringbuffer and a "slack" region where */
  49674. /* bytes from the start of the ringbuffer are copied. */
  49675. function BrotliBitReader(input) {
  49676. this.buf_ = new Uint8Array(BROTLI_IBUF_SIZE);
  49677. this.input_ = input; /* input callback */
  49678. this.reset();
  49679. }
  49680. BrotliBitReader.READ_SIZE = BROTLI_READ_SIZE;
  49681. BrotliBitReader.IBUF_MASK = BROTLI_IBUF_MASK;
  49682. BrotliBitReader.prototype.reset = function() {
  49683. this.buf_ptr_ = 0; /* next input will write here */
  49684. this.val_ = 0; /* pre-fetched bits */
  49685. this.pos_ = 0; /* byte position in stream */
  49686. this.bit_pos_ = 0; /* current bit-reading position in val_ */
  49687. this.bit_end_pos_ = 0; /* bit-reading end position from LSB of val_ */
  49688. this.eos_ = 0; /* input stream is finished */
  49689. this.readMoreInput();
  49690. for (var i = 0; i < 4; i++) {
  49691. this.val_ |= this.buf_[this.pos_] << (8 * i);
  49692. ++this.pos_;
  49693. }
  49694. return this.bit_end_pos_ > 0;
  49695. };
  49696. /* Fills up the input ringbuffer by calling the input callback.
  49697. Does nothing if there are at least 32 bytes present after current position.
  49698. Returns 0 if either:
  49699. - the input callback returned an error, or
  49700. - there is no more input and the position is past the end of the stream.
  49701. After encountering the end of the input stream, 32 additional zero bytes are
  49702. copied to the ringbuffer, therefore it is safe to call this function after
  49703. every 32 bytes of input is read.
  49704. */
  49705. BrotliBitReader.prototype.readMoreInput = function() {
  49706. if (this.bit_end_pos_ > 256) {
  49707. return;
  49708. } else if (this.eos_) {
  49709. if (this.bit_pos_ > this.bit_end_pos_)
  49710. throw new Error('Unexpected end of input ' + this.bit_pos_ + ' ' + this.bit_end_pos_);
  49711. } else {
  49712. var dst = this.buf_ptr_;
  49713. var bytes_read = this.input_.read(this.buf_, dst, BROTLI_READ_SIZE);
  49714. if (bytes_read < 0) {
  49715. throw new Error('Unexpected end of input');
  49716. }
  49717. if (bytes_read < BROTLI_READ_SIZE) {
  49718. this.eos_ = 1;
  49719. /* Store 32 bytes of zero after the stream end. */
  49720. for (var p = 0; p < 32; p++)
  49721. this.buf_[dst + bytes_read + p] = 0;
  49722. }
  49723. if (dst === 0) {
  49724. /* Copy the head of the ringbuffer to the slack region. */
  49725. for (var p = 0; p < 32; p++)
  49726. this.buf_[(BROTLI_READ_SIZE << 1) + p] = this.buf_[p];
  49727. this.buf_ptr_ = BROTLI_READ_SIZE;
  49728. } else {
  49729. this.buf_ptr_ = 0;
  49730. }
  49731. this.bit_end_pos_ += bytes_read << 3;
  49732. }
  49733. };
  49734. /* Guarantees that there are at least 24 bits in the buffer. */
  49735. BrotliBitReader.prototype.fillBitWindow = function() {
  49736. while (this.bit_pos_ >= 8) {
  49737. this.val_ >>>= 8;
  49738. this.val_ |= this.buf_[this.pos_ & BROTLI_IBUF_MASK] << 24;
  49739. ++this.pos_;
  49740. this.bit_pos_ = this.bit_pos_ - 8 >>> 0;
  49741. this.bit_end_pos_ = this.bit_end_pos_ - 8 >>> 0;
  49742. }
  49743. };
  49744. /* Reads the specified number of bits from Read Buffer. */
  49745. BrotliBitReader.prototype.readBits = function(n_bits) {
  49746. if (32 - this.bit_pos_ < n_bits) {
  49747. this.fillBitWindow();
  49748. }
  49749. var val = ((this.val_ >>> this.bit_pos_) & kBitMask[n_bits]);
  49750. this.bit_pos_ += n_bits;
  49751. return val;
  49752. };
  49753. module.exports = BrotliBitReader;
  49754. /***/ }),
  49755. /* 433 */
  49756. /***/ (function(module, exports, __webpack_require__) {
  49757. var base64 = __webpack_require__(434);
  49758. var fs = __webpack_require__(84);
  49759. /**
  49760. * The normal dictionary-data.js is quite large, which makes it
  49761. * unsuitable for browser usage. In order to make it smaller,
  49762. * we read dictionary.bin, which is a compressed version of
  49763. * the dictionary, and on initial load, Brotli decompresses
  49764. * it's own dictionary. 😜
  49765. */
  49766. exports.init = function() {
  49767. var BrotliDecompressBuffer = __webpack_require__(205).BrotliDecompressBuffer;
  49768. var compressed = base64.toByteArray(__webpack_require__(435));
  49769. return BrotliDecompressBuffer(compressed);
  49770. };
  49771. /***/ }),
  49772. /* 434 */
  49773. /***/ (function(module, exports, __webpack_require__) {
  49774. "use strict";
  49775. exports.byteLength = byteLength
  49776. exports.toByteArray = toByteArray
  49777. exports.fromByteArray = fromByteArray
  49778. var lookup = []
  49779. var revLookup = []
  49780. var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array
  49781. var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
  49782. for (var i = 0, len = code.length; i < len; ++i) {
  49783. lookup[i] = code[i]
  49784. revLookup[code.charCodeAt(i)] = i
  49785. }
  49786. // Support decoding URL-safe base64 strings, as Node.js does.
  49787. // See: https://en.wikipedia.org/wiki/Base64#URL_applications
  49788. revLookup['-'.charCodeAt(0)] = 62
  49789. revLookup['_'.charCodeAt(0)] = 63
  49790. function getLens (b64) {
  49791. var len = b64.length
  49792. if (len % 4 > 0) {
  49793. throw new Error('Invalid string. Length must be a multiple of 4')
  49794. }
  49795. // Trim off extra bytes after placeholder bytes are found
  49796. // See: https://github.com/beatgammit/base64-js/issues/42
  49797. var validLen = b64.indexOf('=')
  49798. if (validLen === -1) validLen = len
  49799. var placeHoldersLen = validLen === len
  49800. ? 0
  49801. : 4 - (validLen % 4)
  49802. return [validLen, placeHoldersLen]
  49803. }
  49804. // base64 is 4/3 + up to two characters of the original data
  49805. function byteLength (b64) {
  49806. var lens = getLens(b64)
  49807. var validLen = lens[0]
  49808. var placeHoldersLen = lens[1]
  49809. return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
  49810. }
  49811. function _byteLength (b64, validLen, placeHoldersLen) {
  49812. return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
  49813. }
  49814. function toByteArray (b64) {
  49815. var tmp
  49816. var lens = getLens(b64)
  49817. var validLen = lens[0]
  49818. var placeHoldersLen = lens[1]
  49819. var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))
  49820. var curByte = 0
  49821. // if there are placeholders, only get up to the last complete 4 chars
  49822. var len = placeHoldersLen > 0
  49823. ? validLen - 4
  49824. : validLen
  49825. var i
  49826. for (i = 0; i < len; i += 4) {
  49827. tmp =
  49828. (revLookup[b64.charCodeAt(i)] << 18) |
  49829. (revLookup[b64.charCodeAt(i + 1)] << 12) |
  49830. (revLookup[b64.charCodeAt(i + 2)] << 6) |
  49831. revLookup[b64.charCodeAt(i + 3)]
  49832. arr[curByte++] = (tmp >> 16) & 0xFF
  49833. arr[curByte++] = (tmp >> 8) & 0xFF
  49834. arr[curByte++] = tmp & 0xFF
  49835. }
  49836. if (placeHoldersLen === 2) {
  49837. tmp =
  49838. (revLookup[b64.charCodeAt(i)] << 2) |
  49839. (revLookup[b64.charCodeAt(i + 1)] >> 4)
  49840. arr[curByte++] = tmp & 0xFF
  49841. }
  49842. if (placeHoldersLen === 1) {
  49843. tmp =
  49844. (revLookup[b64.charCodeAt(i)] << 10) |
  49845. (revLookup[b64.charCodeAt(i + 1)] << 4) |
  49846. (revLookup[b64.charCodeAt(i + 2)] >> 2)
  49847. arr[curByte++] = (tmp >> 8) & 0xFF
  49848. arr[curByte++] = tmp & 0xFF
  49849. }
  49850. return arr
  49851. }
  49852. function tripletToBase64 (num) {
  49853. return lookup[num >> 18 & 0x3F] +
  49854. lookup[num >> 12 & 0x3F] +
  49855. lookup[num >> 6 & 0x3F] +
  49856. lookup[num & 0x3F]
  49857. }
  49858. function encodeChunk (uint8, start, end) {
  49859. var tmp
  49860. var output = []
  49861. for (var i = start; i < end; i += 3) {
  49862. tmp =
  49863. ((uint8[i] << 16) & 0xFF0000) +
  49864. ((uint8[i + 1] << 8) & 0xFF00) +
  49865. (uint8[i + 2] & 0xFF)
  49866. output.push(tripletToBase64(tmp))
  49867. }
  49868. return output.join('')
  49869. }
  49870. function fromByteArray (uint8) {
  49871. var tmp
  49872. var len = uint8.length
  49873. var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
  49874. var parts = []
  49875. var maxChunkLength = 16383 // must be multiple of 3
  49876. // go through the array every three bytes, we'll deal with trailing stuff later
  49877. for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
  49878. parts.push(encodeChunk(
  49879. uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)
  49880. ))
  49881. }
  49882. // pad the end with zeros, but make sure to not forget the extra bytes
  49883. if (extraBytes === 1) {
  49884. tmp = uint8[len - 1]
  49885. parts.push(
  49886. lookup[tmp >> 2] +
  49887. lookup[(tmp << 4) & 0x3F] +
  49888. '=='
  49889. )
  49890. } else if (extraBytes === 2) {
  49891. tmp = (uint8[len - 2] << 8) + uint8[len - 1]
  49892. parts.push(
  49893. lookup[tmp >> 10] +
  49894. lookup[(tmp >> 4) & 0x3F] +
  49895. lookup[(tmp << 2) & 0x3F] +
  49896. '='
  49897. )
  49898. }
  49899. return parts.join('')
  49900. }
  49901. /***/ }),
  49902. /* 435 */
  49903. /***/ (function(module, exports) {
  49904. module.exports="W5/fcQLn5gKf2XUbAiQ1XULX+TZz6ADToDsgqk6qVfeC0e4m6OO2wcQ1J76ZBVRV1fRkEsdu//62zQsFEZWSTCnMhcsQKlS2qOhuVYYMGCkV0fXWEoMFbESXrKEZ9wdUEsyw9g4bJlEt1Y6oVMxMRTEVbCIwZzJzboK5j8m4YH02qgXYhv1V+PM435sLVxyHJihaJREEhZGqL03txGFQLm76caGO/ovxKvzCby/3vMTtX/459f0igi7WutnKiMQ6wODSoRh/8Lx1V3Q99MvKtwB6bHdERYRY0hStJoMjNeTsNX7bn+Y7e4EQ3bf8xBc7L0BsyfFPK43dGSXpL6clYC/I328h54/VYrQ5i0648FgbGtl837svJ35L3Mot/+nPlNpWgKx1gGXQYqX6n+bbZ7wuyCHKcUok12Xjqub7NXZGzqBx0SD+uziNf87t7ve42jxSKQoW3nyxVrWIGlFShhCKxjpZZ5MeGna0+lBkk+kaN8F9qFBAFgEogyMBdcX/T1W/WnMOi/7ycWUQloEBKGeC48MkiwqJkJO+12eQiOFHMmck6q/IjWW3RZlany23TBm+cNr/84/oi5GGmGBZWrZ6j+zykVozz5fT/QH/Da6WTbZYYPynVNO7kxzuNN2kxKKWche5WveitPKAecB8YcAHz/+zXLjcLzkdDSktNIDwZE9J9X+tto43oJy65wApM3mDzYtCwX9lM+N5VR3kXYo0Z3t0TtXfgBFg7gU8oN0Dgl7fZlUbhNll+0uuohRVKjrEd8egrSndy5/Tgd2gqjA4CAVuC7ESUmL3DZoGnfhQV8uwnpi8EGvAVVsowNRxPudck7+oqAUDkwZopWqFnW1riss0t1z6iCISVKreYGNvQcXv+1L9+jbP8cd/dPUiqBso2q+7ZyFBvENCkkVr44iyPbtOoOoCecWsiuqMSML5lv+vN5MzUr+Dnh73G7Q1YnRYJVYXHRJaNAOByiaK6CusgFdBPE40r0rvqXV7tksKO2DrHYXBTv8P5ysqxEx8VDXUDDqkPH6NNOV/a2WH8zlkXRELSa8P+heNyJBBP7PgsG1EtWtNef6/i+lcayzQwQCsduidpbKfhWUDgAEmyhGu/zVTacI6RS0zTABrOYueemnVa19u9fT23N/Ta6RvTpof5DWygqreCqrDAgM4LID1+1T/taU6yTFVLqXOv+/MuQOFnaF8vLMKD7tKWDoBdALgxF33zQccCcdHx8fKIVdW69O7qHtXpeGr9jbbpFA+qRMWr5hp0s67FPc7HAiLV0g0/peZlW7hJPYEhZyhpSwahnf93/tZgfqZWXFdmdXBzqxGHLrQKxoAY6fRoBhgCRPmmGueYZ5JexTVDKUIXzkG/fqp/0U3hAgQdJ9zumutK6nqWbaqvm1pgu03IYR+G+8s0jDBBz8cApZFSBeuWasyqo2OMDKAZCozS+GWSvL/HsE9rHxooe17U3s/lTE+VZAk4j3dp6uIGaC0JMiqR5CUsabPyM0dOYDR7Ea7ip4USZlya38YfPtvrX/tBlhHilj55nZ1nfN24AOAi9BVtz/Mbn8AEDJCqJgsVUa6nQnSxv2Fs7l/NlCzpfYEjmPrNyib/+t0ei2eEMjvNhLkHCZlci4WhBe7ePZTmzYqlY9+1pxtS4GB+5lM1BHT9tS270EWUDYFq1I0yY/fNiAk4bk9yBgmef/f2k6AlYQZHsNFnW8wBQxCd68iWv7/35bXfz3JZmfGligWAKRjIs3IpzxQ27vAglHSiOzCYzJ9L9A1CdiyFvyR66ucA4jKifu5ehwER26yV7HjKqn5Mfozo7Coxxt8LWWPT47BeMxX8p0Pjb7hZn+6bw7z3Lw+7653j5sI8CLu5kThpMlj1m4c2ch3jGcP1FsT13vuK3qjecKTZk2kHcOZY40UX+qdaxstZqsqQqgXz+QGF99ZJLqr3VYu4aecl1Ab5GmqS8k/GV5b95zxQ5d4EfXUJ6kTS/CXF/aiqKDOT1T7Jz5z0PwDUcwr9clLN1OJGCiKfqvah+h3XzrBOiLOW8wvn8gW6qE8vPxi+Efv+UH55T7PQFVMh6cZ1pZQlzJpKZ7P7uWvwPGJ6DTlR6wbyj3Iv2HyefnRo/dv7dNx+qaa0N38iBsR++Uil7Wd4afwDNsrzDAK4fXZwvEY/jdKuIKXlfrQd2C39dW7ntnRbIp9OtGy9pPBn/V2ASoi/2UJZfS+xuGLH8bnLuPlzdTNS6zdyk8Dt/h6sfOW5myxh1f+zf3zZ3MX/mO9cQPp5pOx967ZA6/pqHvclNfnUFF+rq+Vd7alKr6KWPcIDhpn6v2K6NlUu6LrKo8b/pYpU/Gazfvtwhn7tEOUuXht5rUJdSf6sLjYf0VTYDgwJ81yaqKTUYej/tbHckSRb/HZicwGJqh1mAHB/IuNs9dc9yuvF3D5Xocm3elWFdq5oEy70dYFit79yaLiNjPj5UUcVmZUVhQEhW5V2Z6Cm4HVH/R8qlamRYwBileuh07CbEce3TXa2JmXWBf+ozt319psboobeZhVnwhMZzOeQJzhpTDbP71Tv8HuZxxUI/+ma3XW6DFDDs4+qmpERwHGBd2edxwUKlODRdUWZ/g0GOezrbzOZauFMai4QU6GVHV6aPNBiBndHSsV4IzpvUiiYyg6OyyrL4Dj5q/Lw3N5kAwftEVl9rNd7Jk5PDij2hTH6wIXnsyXkKePxbmHYgC8A6an5Fob/KH5GtC0l4eFso+VpxedtJHdHpNm+Bvy4C79yVOkrZsLrQ3OHCeB0Ra+kBIRldUGlDCEmq2RwXnfyh6Dz+alk6eftI2n6sastRrGwbwszBeDRS/Fa/KwRJkCzTsLr/JCs5hOPE/MPLYdZ1F1fv7D+VmysX6NpOC8aU9F4Qs6HvDyUy9PvFGDKZ/P5101TYHFl8pjj6wm/qyS75etZhhfg0UEL4OYmHk6m6dO192AzoIyPSV9QedDA4Ml23rRbqxMPMxf7FJnDc5FTElVS/PyqgePzmwVZ26NWhRDQ+oaT7ly7ell4s3DypS1s0g+tOr7XHrrkZj9+x/mJBttrLx98lFIaRZzHz4aC7r52/JQ4VjHahY2/YVXZn/QC2ztQb/sY3uRlyc5vQS8nLPGT/n27495i8HPA152z7Fh5aFpyn1GPJKHuPL8Iw94DuW3KjkURAWZXn4EQy89xiKEHN1mk/tkM4gYDBxwNoYvRfE6LFqsxWJtPrDGbsnLMap3Ka3MUoytW0cvieozOmdERmhcqzG+3HmZv2yZeiIeQTKGdRT4HHNxekm1tY+/n06rGmFleqLscSERzctTKM6G9P0Pc1RmVvrascIxaO1CQCiYPE15bD7c3xSeW7gXxYjgxcrUlcbIvO0r+Yplhx0kTt3qafDOmFyMjgGxXu73rddMHpV1wMubyAGcf/v5dLr5P72Ta9lBF+fzMJrMycwv+9vnU3ANIl1cH9tfW7af8u0/HG0vV47jNFXzFTtaha1xvze/s8KMtCYucXc1nzfd/MQydUXn/b72RBt5wO/3jRcMH9BdhC/yctKBIveRYPrNpDWqBsO8VMmP+WvRaOcA4zRMR1PvSoO92rS7pYEv+fZfEfTMzEdM+6X5tLlyxExhqLRkms5EuLovLfx66de5fL2/yX02H52FPVwahrPqmN/E0oVXnsCKhbi/yRxX83nRbUKWhzYceXOntfuXn51NszJ6MO73pQf5Pl4in3ec4JU8hF7ppV34+mm9r1LY0ee/i1O1wpd8+zfLztE0cqBxggiBi5Bu95v9l3r9r/U5hweLn+TbfxowrWDqdJauKd8+q/dH8sbPkc9ttuyO94f7/XK/nHX46MPFLEb5qQlNPvhJ50/59t9ft3LXu7uVaWaO2bDrDCnRSzZyWvFKxO1+vT8MwwunR3bX0CkfPjqb4K9O19tn5X50PvmYpEwHtiW9WtzuV/s76B1zvLLNkViNd8ySxIl/3orfqP90TyTGaf7/rx8jQzeHJXdmh/N6YDvbvmTBwCdxfEQ1NcL6wNMdSIXNq7b1EUzRy1/Axsyk5p22GMG1b+GxFgbHErZh92wuvco0AuOLXct9hvw2nw/LqIcDRRmJmmZzcgUa7JpM/WV/S9IUfbF56TL2orzqwebdRD8nIYNJ41D/hz37Fo11p2Y21wzPcn713qVGhqtevStYfGH4n69OEJtPvbbLYWvscDqc3Hgnu166+tAyLnxrX0Y5zoYjV++1sI7t5kMr02KT/+uwtkc+rZLOf/qn/s3nYCf13Dg8/sB2diJgjGqjQ+TLhxbzyue2Ob7X6/9lUwW7a+lbznHzOYy8LKW1C/uRPbQY3KW/0gO9LXunHLvPL97afba9bFtc9hmz7GAttjVYlCvQAiOwAk/gC5+hkLEs6tr3AZKxLJtOEwk2dLxTYWsIB/j/ToWtIWzo906FrSG8iaqqqqqqiIiIiAgzMzMzNz+AyK+01/zi8n8S+Y1MjoRaQ80WU/G8MBlO+53VPXANrWm4wzGUVZUjjBJZVdhpcfkjsmcWaO+UEldXi1e+zq+HOsCpknYshuh8pOLISJun7TN0EIGW2xTnlOImeecnoGW4raxe2G1T3HEvfYUYMhG+gAFOAwh5nK8mZhwJMmN7r224QVsNFvZ87Z0qatvknklyPDK3Hy45PgVKXji52Wen4d4PlFVVYGnNap+fSpFbK90rYnhUc6n91Q3AY9E0tJOFrcfZtm/491XbcG/jsViUPPX76qmeuiz+qY1Hk7/1VPM405zWVuoheLUimpWYdVzCmUdKHebMdzgrYrb8mL2eeLSnRWHdonfZa8RsOU9F37w+591l5FLYHiOqWeHtE/lWrBHcRKp3uhtr8yXm8LU/5ms+NM6ZKsqu90cFZ4o58+k4rdrtB97NADFbwmEG7lXqvirhOTOqU14xuUF2myIjURcPHrPOQ4lmM3PeMg7bUuk0nnZi67bXsU6H8lhqIo8TaOrEafCO1ARK9PjC0QOoq2BxmMdgYB9G/lIb9++fqNJ2s7BHGFyBNmZAR8J3KCo012ikaSP8BCrf6VI0X5xdnbhHIO+B5rbOyB54zXkzfObyJ4ecwxfqBJMLFc7m59rNcw7hoHnFZ0b00zee+gTqvjm61Pb4xn0kcDX4jvHM0rBXZypG3DCKnD/Waa/ZtHmtFPgO5eETx+k7RrVg3aSwm2YoNXnCs3XPQDhNn+Fia6IlOOuIG6VJH7TP6ava26ehKHQa2T4N0tcZ9dPCGo3ZdnNltsHQbeYt5vPnJezV/cAeNypdml1vCHI8M81nSRP5Qi2+mI8v/sxiZru9187nRtp3f/42NemcONa+4eVC3PCZzc88aZh851CqSsshe70uPxeN/dmYwlwb3trwMrN1Gq8jbnApcVDx/yDPeYs5/7r62tsQ6lLg+DiFXTEhzR9dHqv0iT4tgj825W+H3XiRUNUZT2kR9Ri0+lp+UM3iQtS8uOE23Ly4KYtvqH13jghUntJRAewuzNLDXp8RxdcaA3cMY6TO2IeSFRXezeWIjCqyhsUdMYuCgYTZSKpBype1zRfq8FshvfBPc6BAQWl7/QxIDp3VGo1J3vn42OEs3qznws+YLRXbymyB19a9XBx6n/owcyxlEYyFWCi+kG9F+EyD/4yn80+agaZ9P7ay2Dny99aK2o91FkfEOY8hBwyfi5uwx2y5SaHmG+oq/zl1FX/8irOf8Y3vAcX/6uLP6A6nvMO24edSGPjQc827Rw2atX+z2bKq0CmW9mOtYnr5/AfDa1ZfPaXnKtlWborup7QYx+Or2uWb+N3N//2+yDcXMqIJdf55xl7/vsj4WoPPlxLxtVrkJ4w/tTe3mLdATOOYwxcq52w5Wxz5MbPdVs5O8/lhfE7dPj0bIiPQ3QV0iqm4m3YX8hRfc6jQ3fWepevMqUDJd86Z4vwM40CWHnn+WphsGHfieF02D3tmZvpWD+kBpNCFcLnZhcmmrhpGzzbdA+sQ1ar18OJD87IOKOFoRNznaHPNHUfUNhvY1iU+uhvEvpKHaUn3qK3exVVyX4joipp3um7FmYJWmA+WbIDshRpbVRx5/nqstCgy87FGbfVB8yDGCqS+2qCsnRwnSAN6zgzxfdB2nBT/vZ4/6uxb6oH8b4VBRxiIB93wLa47hG3w2SL/2Z27yOXJFwZpSJaBYyvajA7vRRYNKqljXKpt/CFD/tSMr18DKKbwB0xggBePatl1nki0yvqW5zchlyZmJ0OTxJ3D+fsYJs/mxYN5+Le5oagtcl+YsVvy8kSjI2YGvGjvmpkRS9W2dtXqWnVuxUhURm1lKtou/hdEq19VBp9OjGvHEQSmrpuf2R24mXGheil8KeiANY8fW1VERUfBImb64j12caBZmRViZHbeVMjCrPDg9A90IXrtnsYCuZtRQ0PyrKDjBNOsPfKsg1pA02gHlVr0OXiFhtp6nJqXVzcbfM0KnzC3ggOENPE9VBdmHKN6LYaijb4wXxJn5A0FSDF5j+h1ooZx885Jt3ZKzO5n7Z5WfNEOtyyPqQEnn7WLv5Fis3PdgMshjF1FRydbNyeBbyKI1oN1TRVrVK7kgsb/zjX4NDPIRMctVeaxVB38Vh1x5KbeJbU138AM5KzmZu3uny0ErygxiJF7GVXUrPzFxrlx1uFdAaZFDN9cvIb74qD9tzBMo7L7WIEYK+sla1DVMHpF0F7b3+Y6S+zjvLeDMCpapmJo1weBWuxKF3rOocih1gun4BoJh1kWnV/Jmiq6uOhK3VfKxEHEkafjLgK3oujaPzY6SXg8phhL4TNR1xvJd1Wa0aYFfPUMLrNBDCh4AuGRTbtKMc6Z1Udj8evY/ZpCuMAUefdo69DZUngoqE1P9A3PJfOf7WixCEj+Y6t7fYeHbbxUAoFV3M89cCKfma3fc1+jKRe7MFWEbQqEfyzO2x/wrO2VYH7iYdQ9BkPyI8/3kXBpLaCpU7eC0Yv/am/tEDu7HZpqg0EvHo0nf/R/gRzUWy33/HXMJQeu1GylKmOkXzlCfGFruAcPPhaGqZOtu19zsJ1SO2Jz4Ztth5cBX6mRQwWmDwryG9FUMlZzNckMdK+IoMJv1rOWnBamS2w2KHiaPMPLC15hCZm4KTpoZyj4E2TqC/P6r7/EhnDMhKicZZ1ZwxuC7DPzDGs53q8gXaI9kFTK+2LTq7bhwsTbrMV8Rsfua5lMS0FwbTitUVnVa1yTb5IX51mmYnUcP9wPr8Ji1tiYJeJV9GZTrQhF7vvdU2OTU42ogJ9FDwhmycI2LIg++03C6scYhUyUuMV5tkw6kGUoL+mjNC38+wMdWNljn6tGPpRES7veqrSn5TRuv+dh6JVL/iDHU1db4c9WK3++OrH3PqziF916UMUKn8G67nN60GfWiHrXYhUG3yVWmyYak59NHj8t1smG4UDiWz2rPHNrKnN4Zo1LBbr2/eF9YZ0n0blx2nG4X+EKFxvS3W28JESD+FWk61VCD3z/URGHiJl++7TdBwkCj6tGOH3qDb0QqcOF9Kzpj0HUb/KyFW3Yhj2VMKJqGZleFBH7vqvf7WqLC3XMuHV8q8a4sTFuxUtkD/6JIBvKaVjv96ndgruKZ1k/BHzqf2K9fLk7HGXANyLDd1vxkK/i055pnzl+zw6zLnwXlVYVtfmacJgEpRP1hbGgrYPVN6v2lG+idQNGmwcKXu/8xEj/P6qe/sB2WmwNp6pp8jaISMkwdleFXYK55NHWLTTbutSUqjBfDGWo/Yg918qQ+8BRZSAHZbfuNZz2O0sov1Ue4CWlVg3rFhM3Kljj9ksGd/NUhk4nH+a5UN2+1i8+NM3vRNp7uQ6sqexSCukEVlVZriHNqFi5rLm9TMWa4qm3idJqppQACol2l4VSuvWLfta4JcXy3bROPNbXOgdOhG47LC0CwW/dMlSx4Jf17aEU3yA1x9p+Yc0jupXgcMuYNku64iYOkGToVDuJvlbEKlJqsmiHbvNrIVZEH+yFdF8DbleZ6iNiWwMqvtMp/mSpwx5KxRrT9p3MAPTHGtMbfvdFhyj9vhaKcn3At8Lc16Ai+vBcSp1ztXi7rCJZx/ql7TXcclq6Q76UeKWDy9boS0WHIjUuWhPG8LBmW5y2rhuTpM5vsLt+HOLh1Yf0DqXa9tsfC+kaKt2htA0ai/L2i7RKoNjEwztkmRU0GfgW1TxUvPFhg0V7DdfWJk5gfrccpYv+MA9M0dkGTLECeYwUixRzjRFdmjG7zdZIl3XKB9YliNKI31lfa7i2JG5C8Ss+rHe0D7Z696/V3DEAOWHnQ9yNahMUl5kENWS6pHKKp2D1BaSrrHdE1w2qNxIztpXgUIrF0bm15YML4b6V1k+GpNysTahKMVrrS85lTVo9OGJ96I47eAy5rYWpRf/mIzeoYU1DKaQCTUVwrhHeyNoDqHel+lLxr9WKzhSYw7vrR6+V5q0pfi2k3L1zqkubY6rrd9ZLvSuWNf0uqnkY+FpTvFzSW9Fp0b9l8JA7THV9eCi/PY/SCZIUYx3BU2alj7Cm3VV6eYpios4b6WuNOJdYXUK3zTqj5CVG2FqYM4Z7CuIU0qO05XR0d71FHM0YhZmJmTRfLlXEumN82BGtzdX0S19t1e+bUieK8zRmqpa4Qc5TSjifmaQsY2ETLjhI36gMR1+7qpjdXXHiceUekfBaucHShAOiFXmv3sNmGQyU5iVgnoocuonQXEPTFwslHtS8R+A47StI9wj0iSrtbi5rMysczFiImsQ+bdFClnFjjpXXwMy6O7qfjOr8Fb0a7ODItisjnn3EQO16+ypd1cwyaAW5Yzxz5QknfMO7643fXW/I9y3U2xH27Oapqr56Z/tEzglj6IbT6HEHjopiXqeRbe5mQQvxtcbDOVverN0ZgMdzqRYRjaXtMRd56Q4cZSmdPvZJdSrhJ1D9zNXPqAEqPIavPdfubt5oke2kmv0dztIszSv2VYuoyf1UuopbsYb+uX9h6WpwjpgtZ6fNNawNJ4q8O3CFoSbioAaOSZMx2GYaPYB+rEb6qjQiNRFQ76TvwNFVKD+BhH9VhcKGsXzmMI7BptU/CNWolM7YzROvpFAntsiWJp6eR2d3GarcYShVYSUqhmYOWj5E96NK2WvmYNTeY7Zs4RUEdv9h9QT4EseKt6LzLrqEOs3hxAY1MaNWpSa6zZx8F3YOVeCYMS88W+CYHDuWe4yoc6YK+djDuEOrBR5lvh0r+Q9uM88lrjx9x9AtgpQVNE8r+3O6Gvw59D+kBF/UMXyhliYUtPjmvXGY6Dk3x+kEOW+GtdMVC4EZTqoS/jmR0P0LS75DOc/w2vnri97M4SdbZ8qeU7gg8DVbERkU5geaMQO3mYrSYyAngeUQqrN0C0/vsFmcgWNXNeidsTAj7/4MncJR0caaBUpbLK1yBCBNRjEv6KvuVSdpPnEMJdsRRtqJ+U8tN1gXA4ePHc6ZT0eviI73UOJF0fEZ8YaneAQqQdGphNvwM4nIqPnXxV0xA0fnCT+oAhJuyw/q8jO0y8CjSteZExwBpIN6SvNp6A5G/abi6egeND/1GTguhuNjaUbbnSbGd4L8937Ezm34Eyi6n1maeOBxh3PI0jzJDf5mh/BsLD7F2GOKvlA/5gtvxI3/eV4sLfKW5Wy+oio+es/u6T8UU+nsofy57Icb/JlZHPFtCgd/x+bwt3ZT+xXTtTtTrGAb4QehC6X9G+8YT+ozcLxDsdCjsuOqwPFnrdLYaFc92Ui0m4fr39lYmlCaqTit7G6O/3kWDkgtXjNH4BiEm/+jegQnihOtfffn33WxsFjhfMd48HT+f6o6X65j7XR8WLSHMFkxbvOYsrRsF1bowDuSQ18Mkxk4qz2zoGPL5fu9h2Hqmt1asl3Q3Yu3szOc+spiCmX4AETBM3pLoTYSp3sVxahyhL8eC4mPN9k2x3o0xkiixIzM3CZFzf5oR4mecQ5+ax2wCah3/crmnHoqR0+KMaOPxRif1oEFRFOO/kTPPmtww+NfMXxEK6gn6iU32U6fFruIz8Q4WgljtnaCVTBgWx7diUdshC9ZEa5yKpRBBeW12r/iNc/+EgNqmhswNB8SBoihHXeDF7rrWDLcmt3V8GYYN7pXRy4DZjj4DJuUBL5iC3DQAaoo4vkftqVTYRGLS3mHZ7gdmdTTqbgNN/PTdTCOTgXolc88MhXAEUMdX0iy1JMuk5wLsgeu0QUYlz2S4skTWwJz6pOm/8ihrmgGfFgri+ZWUK2gAPHgbWa8jaocdSuM4FJYoKicYX/ZSENkg9Q1ZzJfwScfVnR2DegOGwCvmogaWJCLQepv9WNlU6QgsmOwICquU28Mlk3d9W5E81lU/5Ez0LcX6lwKMWDNluNKfBDUy/phJgBcMnfkh9iRxrdOzgs08JdPB85Lwo+GUSb4t3nC+0byqMZtO2fQJ4U2zGIr49t/28qmmGv2RanDD7a3FEcdtutkW8twwwlUSpb8QalodddbBfNHKDQ828BdE7OBgFdiKYohLawFYqpybQoxATZrheLhdI7+0Zlu9Q1myRcd15r9UIm8K2LGJxqTegntqNVMKnf1a8zQiyUR1rxoqjiFxeHxqFcYUTHfDu7rhbWng6qOxOsI+5A1p9mRyEPdVkTlE24vY54W7bWc6jMgZvNXdfC9/9q7408KDsbdL7Utz7QFSDetz2picArzrdpL8OaCHC9V26RroemtDZ5yNM/KGkWMyTmfnInEvwtSD23UcFcjhaE3VKzkoaEMKGBft4XbIO6forTY1lmGQwVmKicBCiArDzE+1oIxE08fWeviIOD5TznqH+OoHadvoOP20drMPe5Irg3XBQziW2XDuHYzjqQQ4wySssjXUs5H+t3FWYMHppUnBHMx/nYIT5d7OmjDbgD9F6na3m4l7KdkeSO3kTEPXafiWinogag7b52taiZhL1TSvBFmEZafFq2H8khQaZXuitCewT5FBgVtPK0j4xUHPfUz3Q28eac1Z139DAP23dgki94EC8vbDPTQC97HPPSWjUNG5tWKMsaxAEMKC0665Xvo1Ntd07wCLNf8Q56mrEPVpCxlIMVlQlWRxM3oAfpgIc+8KC3rEXUog5g06vt7zgXY8grH7hhwVSaeuvC06YYRAwpbyk/Unzj9hLEZNs2oxPQB9yc+GnL6zTgq7rI++KDJwX2SP8Sd6YzTuw5lV/kU6eQxRD12omfQAW6caTR4LikYkBB1CMOrvgRr/VY75+NSB40Cni6bADAtaK+vyxVWpf9NeKJxN2KYQ8Q2xPB3K1s7fuhvWbr2XpgW044VD6DRs0qXoqKf1NFsaGvKJc47leUV3pppP/5VTKFhaGuol4Esfjf5zyCyUHmHthChcYh4hYLQF+AFWsuq4t0wJyWgdwQVOZiV0efRHPoK5+E1vjz9wTJmVkITC9oEstAsyZSgE/dbicwKr89YUxKZI+owD205Tm5lnnmDRuP/JnzxX3gMtlrcX0UesZdxyQqYQuEW4R51vmQ5xOZteUd8SJruMlTUzhtVw/Nq7eUBcqN2/HVotgfngif60yKEtoUx3WYOZlVJuJOh8u59fzSDPFYtQgqDUAGyGhQOAvKroXMcOYY0qjnStJR/G3aP+Jt1sLVlGV8POwr/6OGsqetnyF3TmTqZjENfnXh51oxe9qVUw2M78EzAJ+IM8lZ1MBPQ9ZWSVc4J3mWSrLKrMHReA5qdGoz0ODRsaA+vwxXA2cAM4qlfzBJA6581m4hzxItQw5dxrrBL3Y6kCbUcFxo1S8jyV44q//+7ASNNudZ6xeaNOSIUffqMn4A9lIjFctYn2gpEPAb3f7p3iIBN8H14FUGQ9ct2hPsL+cEsTgUrR47uJVN4n4wt/wgfwwHuOnLd4yobkofy8JvxSQTA7rMpDIc608SlZFJfZYcmbT0tAHpPE8MrtQ42siTUNWxqvWZOmvu9f0JPoQmg+6l7sZWwyfi6PXkxJnwBraUG0MYG4zYHQz3igy/XsFkx5tNQxw43qvI9dU3f0DdhOUlHKjmi1VAr2Kiy0HZwD8VeEbhh0OiDdMYspolQsYdSwjCcjeowIXNZVUPmL2wwIkYhmXKhGozdCJ4lRKbsf4NBh/XnQoS92NJEWOVOFs2YhN8c5QZFeK0pRdAG40hqvLbmoSA8xQmzOOEc7wLcme9JOsjPCEgpCwUs9E2DohMHRhUeyGIN6TFvrbny8nDuilsDpzrH5mS76APoIEJmItS67sQJ+nfwddzmjPxcBEBBCw0kWDwd0EZCkNeOD7NNQhtBm7KHL9mRxj6U1yWU2puzlIDtpYxdH4ZPeXBJkTGAJfUr/oTCz/iypY6uXaR2V1doPxJYlrw2ghH0D5gbrhFcIxzYwi4a/4hqVdf2DdxBp6vGYDjavxMAAoy+1+3aiO6S3W/QAKNVXagDtvsNtx7Ks+HKgo6U21B+QSZgIogV5Bt+BnXisdVfy9VyXV+2P5fMuvdpAjM1o/K9Z+XnE4EOCrue+kcdYHqAQ0/Y/OmNlQ6OI33jH/uD1RalPaHpJAm2av0/xtpqdXVKNDrc9F2izo23Wu7firgbURFDNX9eGGeYBhiypyXZft2j3hTvzE6PMWKsod//rEILDkzBXfi7xh0eFkfb3/1zzPK/PI5Nk3FbZyTl4mq5BfBoVoqiPHO4Q4QKZAlrQ3MdNfi3oxIjvsM3kAFv3fdufurqYR3PSwX/mpGy/GFI/B2MNPiNdOppWVbs/gjF3YH+QA9jMhlAbhvasAHstB0IJew09iAkmXHl1/TEj+jvHOpOGrPRQXbPADM+Ig2/OEcUcpgPTItMtW4DdqgfYVI/+4hAFWYjUGpOP/UwNuB7+BbKOcALbjobdgzeBQfjgNSp2GOpxzGLj70Vvq5cw2AoYENwKLUtJUX8sGRox4dVa/TN4xKwaKcl9XawQR/uNus700Hf17pyNnezrUgaY9e4MADhEDBpsJT6y1gDJs1q6wlwGhuUzGR7C8kgpjPyHWwsvrf3yn1zJEIRa5eSxoLAZOCR9xbuztxFRJW9ZmMYfCFJ0evm9F2fVnuje92Rc4Pl6A8bluN8MZyyJGZ0+sNSb//DvAFxC2BqlEsFwccWeAl6CyBcQV1bx4mQMBP1Jxqk1EUADNLeieS2dUFbQ/c/kvwItbZ7tx0st16viqd53WsRmPTKv2AD8CUnhtPWg5aUegNpsYgasaw2+EVooeNKmrW3MFtj76bYHJm5K9gpAXZXsE5U8DM8XmVOSJ1F1WnLy6nQup+jx52bAb+rCq6y9WXl2B2oZDhfDkW7H3oYfT/4xx5VncBuxMXP2lNfhUVQjSSzSRbuZFE4vFawlzveXxaYKVs8LpvAb8IRYF3ZHiRnm0ADeNPWocwxSzNseG7NrSEVZoHdKWqaGEBz1N8Pt7kFbqh3LYmAbm9i1IChIpLpM5AS6mr6OAPHMwwznVy61YpBYX8xZDN/a+lt7n+x5j4bNOVteZ8lj3hpAHSx1VR8vZHec4AHO9XFCdjZ9eRkSV65ljMmZVzaej2qFn/qt1lvWzNZEfHxK3qOJrHL6crr0CRzMox5f2e8ALBB4UGFZKA3tN6F6IXd32GTJXGQ7DTi9j/dNcLF9jCbDcWGKxoKTYblIwbLDReL00LRcDPMcQuXLMh5YzgtfjkFK1DP1iDzzYYVZz5M/kWYRlRpig1htVRjVCknm+h1M5LiEDXOyHREhvzCGpFZjHS0RsK27o2avgdilrJkalWqPW3D9gmwV37HKmfM3F8YZj2ar+vHFvf3B8CRoH4kDHIK9mrAg+owiEwNjjd9V+FsQKYR8czJrUkf7Qoi2YaW6EVDZp5zYlqiYtuXOTHk4fAcZ7qBbdLDiJq0WNV1l2+Hntk1mMWvxrYmc8kIx8G3rW36J6Ra4lLrTOCgiOihmow+YnzUT19jbV2B3RWqSHyxkhmgsBqMYWvOcUom1jDQ436+fcbu3xf2bbeqU/ca+C4DOKE+e3qvmeMqW3AxejfzBRFVcwVYPq4L0APSWWoJu+5UYX4qg5U6YTioqQGPG9XrnuZ/BkxuYpe6Li87+18EskyQW/uA+uk2rpHpr6hut2TlVbKgWkFpx+AZffweiw2+VittkEyf/ifinS/0ItRL2Jq3tQOcxPaWO2xrG68GdFoUpZgFXaP2wYVtRc6xYCfI1CaBqyWpg4bx8OHBQwsV4XWMibZZ0LYjWEy2IxQ1mZrf1/UNbYCJplWu3nZ4WpodIGVA05d+RWSS+ET9tH3RfGGmNI1cIY7evZZq7o+a0bjjygpmR3mVfalkT/SZGT27Q8QGalwGlDOS9VHCyFAIL0a1Q7JiW3saz9gqY8lqKynFrPCzxkU4SIfLc9VfCI5edgRhDXs0edO992nhTKHriREP1NJC6SROMgQ0xO5kNNZOhMOIT99AUElbxqeZF8A3xrfDJsWtDnUenAHdYWSwAbYjFqQZ+D5gi3hNK8CSxU9i6f6ClL9IGlj1OPMQAsr84YG6ijsJpCaGWj75c3yOZKBB9mNpQNPUKkK0D6wgLH8MGoyRxTX6Y05Q4AnYNXMZwXM4eij/9WpsM/9CoRnFQXGR6MEaY+FXvXEO3RO0JaStk6OXuHVATHJE+1W+TU3bSZ2ksMtqjO0zfSJCdBv7y2d8DMx6TfVme3q0ZpTKMMu4YL/t7ciTNtdDkwPogh3Cnjx7qk08SHwf+dksZ7M2vCOlfsF0hQ6J4ehPCaHTNrM/zBSOqD83dBEBCW/F/LEmeh0nOHd7oVl3/Qo/9GUDkkbj7yz+9cvvu+dDAtx8NzCDTP4iKdZvk9MWiizvtILLepysflSvTLFBZ37RLwiriqyRxYv/zrgFd/9XVHh/OmzBvDX4mitMR/lUavs2Vx6cR94lzAkplm3IRNy4TFfu47tuYs9EQPIPVta4P64tV+sZ7n3ued3cgEx2YK+QL5+xms6osk8qQbTyuKVGdaX9FQqk6qfDnT5ykxk0VK7KZ62b6DNDUfQlqGHxSMKv1P0XN5BqMeKG1P4Wp5QfZDUCEldppoX0U6ss2jIko2XpURKCIhfaOqLPfShdtS37ZrT+jFRSH2xYVV1rmT/MBtRQhxiO4MQ3iAGlaZi+9PWBEIXOVnu9jN1f921lWLZky9bqbM3J2MAAI9jmuAx3gyoEUa6P2ivs0EeNv/OR+AX6q5SW6l5HaoFuS6jr6yg9limu+P0KYKzfMXWcQSfTXzpOzKEKpwI3YGXZpSSy2LTlMgfmFA3CF6R5c9xWEtRuCg2ZPUQ2Nb6dRFTNd4TfGHrnEWSKHPuRyiJSDAZ+KX0VxmSHjGPbQTLVpqixia2uyhQ394gBMt7C3ZAmxn/DJS+l1fBsAo2Eir/C0jG9csd4+/tp12pPc/BVJGaK9mfvr7M/CeztrmCO5qY06Edi4xAGtiEhnWAbzLy2VEyazE1J5nPmgU4RpW4Sa0TnOT6w5lgt3/tMpROigHHmexBGAMY0mdcDbDxWIz41NgdD6oxgHsJRgr5RnT6wZAkTOcStU4NMOQNemSO7gxGahdEsC+NRVGxMUhQmmM0llWRbbmFGHzEqLM4Iw0H7577Kyo+Zf+2cUFIOw93gEY171vQaM0HLwpjpdRR6Jz7V0ckE7XzYJ0TmY9znLdzkva0vNrAGGT5SUZ5uaHDkcGvI0ySpwkasEgZPMseYcu85w8HPdSNi+4T6A83iAwDbxgeFcB1ZM2iGXzFcEOUlYVrEckaOyodfvaYSQ7GuB4ISE0nYJc15X/1ciDTPbPCgYJK55VkEor4LvzL9S2WDy4xj+6FOqVyTAC2ZNowheeeSI5hA/02l8UYkv4nk9iaVn+kCVEUstgk5Hyq+gJm6R9vG3rhuM904he/hFmNQaUIATB1y3vw+OmxP4X5Yi6A5I5jJufHCjF9+AGNwnEllZjUco6XhsO5T5+R3yxz5yLVOnAn0zuS+6zdj0nTJbEZCbXJdtpfYZfCeCOqJHoE2vPPFS6eRLjIJlG69X93nfR0mxSFXzp1Zc0lt/VafDaImhUMtbnqWVb9M4nGNQLN68BHP7AR8Il9dkcxzmBv8PCZlw9guY0lurbBsmNYlwJZsA/B15/HfkbjbwPddaVecls/elmDHNW2r4crAx43feNkfRwsaNq/yyJ0d/p5hZ6AZajz7DBfUok0ZU62gCzz7x8eVfJTKA8IWn45vINLSM1q+HF9CV9qF3zP6Ml21kPPL3CXzkuYUlnSqT+Ij4tI/od5KwIs+tDajDs64owN7tOAd6eucGz+KfO26iNcBFpbWA5732bBNWO4kHNpr9D955L61bvHCF/mwSrz6eQaDjfDEANqGMkFc+NGxpKZzCD2sj/JrHd+zlPQ8Iz7Q+2JVIiVCuCKoK/hlAEHzvk/Piq3mRL1rT/fEh9hoT5GJmeYswg1otiKydizJ/fS2SeKHVu6Z3JEHjiW8NaTQgP5xdBli8nC57XiN9hrquBu99hn9zqwo92+PM2JXtpeVZS0PdqR5mDyDreMMtEws+CpwaRyyzoYtfcvt9PJIW0fJVNNi/FFyRsea7peLvJrL+5b4GOXJ8tAr+ATk9f8KmiIsRhqRy0vFzwRV3Z5dZ3QqIU8JQ/uQpkJbjMUMFj2F9sCFeaBjI4+fL/oN3+LQgjI4zuAfQ+3IPIPFQBccf0clJpsfpnBxD84atwtupkGqKvrH7cGNl/QcWcSi6wcVDML6ljOgYbo+2BOAWNNjlUBPiyitUAwbnhFvLbnqw42kR3Yp2kv2dMeDdcGOX5kT4S6M44KHEB/SpCfl7xgsUvs+JNY9G3O2X/6FEt9FyAn57lrbiu+tl83sCymSvq9eZbe9mchL7MTf/Ta78e80zSf0hYY5eUU7+ff14jv7Xy8qjzfzzzvaJnrIdvFb5BLWKcWGy5/w7+vV2cvIfwHqdTB+RuJK5oj9mbt0Hy94AmjMjjwYNZlNS6uiyxNnwNyt3gdreLb64p/3+08nXkb92LTkkRgFOwk1oGEVllcOj5lv1hfAZywDows0944U8vUFw+A/nuVq/UCygsrmWIBnHyU01d0XJPwriEOvx/ISK6Pk4y2w0gmojZs7lU8TtakBAdne4v/aNxmMpK4VcGMp7si0yqsiolXRuOi1Z1P7SqD3Zmp0CWcyK4Ubmp2SXiXuI5nGLCieFHKHNRIlcY3Pys2dwMTYCaqlyWSITwr2oGXvyU3h1Pf8eQ3w1bnD7ilocVjYDkcXR3Oo1BXgMLTUjNw2xMVwjtp99NhSVc5aIWrDQT5DHPKtCtheBP4zHcw4dz2eRdTMamhlHhtfgqJJHI7NGDUw1XL8vsSeSHyKqDtqoAmrQqsYwvwi7HW3ojWyhIa5oz5xJTaq14NAzFLjVLR12rRNUQ6xohDnrWFb5bG9yf8aCD8d5phoackcNJp+Dw3Due3RM+5Rid7EuIgsnwgpX0rUWh/nqPtByMhMZZ69NpgvRTKZ62ViZ+Q7Dp5r4K0d7EfJuiy06KuIYauRh5Ecrhdt2QpTS1k1AscEHvapNbU3HL1F2TFyR33Wxb5MvH5iZsrn3SDcsxlnnshO8PLwmdGN+paWnQuORtZGX37uhFT64SeuPsx8UOokY6ON85WdQ1dki5zErsJGazcBOddWJEKqNPiJpsMD1GrVLrVY+AOdPWQneTyyP1hRX/lMM4ZogGGOhYuAdr7F/DOiAoc++cn5vlf0zkMUJ40Z1rlgv9BelPqVOpxKeOpzKdF8maK+1Vv23MO9k/8+qpLoxrIGH2EDQlnGmH8CD31G8QqlyQIcpmR5bwmSVw9/Ns6IHgulCRehvZ/+VrM60Cu/r3AontFfrljew74skYe2uyn7JKQtFQBQRJ9ryGic/zQOsbS4scUBctA8cPToQ3x6ZBQu6DPu5m1bnCtP8TllLYA0UTQNVqza5nfew3Mopy1GPUwG5jsl0OVXniPmAcmLqO5HG8Hv3nSLecE9oOjPDXcsTxoCBxYyzBdj4wmnyEV4kvFDunipS8SSkvdaMnTBN9brHUR8xdmmEAp/Pdqk9uextp1t+JrtXwpN/MG2w/qhRMpSNxQ1uhg/kKO30eQ/FyHUDkWHT8V6gGRU4DhDMxZu7xXij9Ui6jlpWmQCqJg3FkOTq3WKneCRYZxBXMNAVLQgHXSCGSqNdjebY94oyIpVjMYehAiFx/tqzBXFHZaL5PeeD74rW5OysFoUXY8sebUZleFTUa/+zBKVTFDopTReXNuZq47QjkWnxjirCommO4L/GrFtVV21EpMyw8wyThL5Y59d88xtlx1g1ttSICDwnof6lt/6zliPzgVUL8jWBjC0o2D6Kg+jNuThkAlaDJsq/AG2aKA//A76avw2KNqtv223P+Wq3StRDDNKFFgtsFukYt1GFDWooFVXitaNhb3RCyJi4cMeNjROiPEDb4k+G3+hD8tsg+5hhmSc/8t2JTSwYoCzAI75doq8QTHe+E/Tw0RQSUDlU+6uBeNN3h6jJGX/mH8oj0i3caCNsjvTnoh73BtyZpsflHLq6AfwJNCDX4S98h4+pCOhGKDhV3rtkKHMa3EG4J9y8zFWI4UsfNzC/Rl5midNn7gwoN9j23HGCQQ+OAZpTTPMdiVow740gIyuEtd0qVxMyNXhHcnuXRKdw5wDUSL358ktjMXmAkvIB73BLa1vfF9BAUZInPYJiwxqFWQQBVk7gQH4ojfUQ/KEjn+A/WR6EEe4CtbpoLe1mzHkajgTIoE0SLDHVauKhrq12zrAXBGbPPWKCt4DGedq3JyGRbmPFW32bE7T20+73BatV/qQhhBWfWBFHfhYWXjALts38FemnoT+9bn1jDBMcUMmYgSc0e7GQjv2MUBwLU8ionCpgV+Qrhg7iUIfUY6JFxR0Y+ZTCPM+rVuq0GNLyJXX6nrUTt8HzFBRY1E/FIm2EeVA9NcXrj7S6YYIChVQCWr/m2fYUjC4j0XLkzZ8GCSLfmkW3PB/xq+nlXsKVBOj7vTvqKCOMq7Ztqr3cQ+N8gBnPaAps+oGwWOkbuxnRYj/x/WjiDclVrs22xMK4qArE1Ztk1456kiJriw6abkNeRHogaPRBgbgF9Z8i/tbzWELN4CvbqtrqV9TtGSnmPS2F9kqOIBaazHYaJ9bi3AoDBvlZasMluxt0BDXfhp02Jn411aVt6S4TUB8ZgFDkI6TP6gwPY85w+oUQSsjIeXVminrwIdK2ZAawb8Se6XOJbOaliQxHSrnAeONDLuCnFejIbp4YDtBcQCwMsYiRZfHefuEJqJcwKTTJ8sx5hjHmJI1sPFHOr6W9AhZ2NAod38mnLQk1gOz2LCAohoQbgMbUK9RMEA3LkiF7Sr9tLZp6lkciIGhE2V546w3Mam53VtVkGbB9w0Yk2XiRnCmbpxmHr2k4eSC0RuNbjNsUfDIfc8DZvRvgUDe1IlKdZTzcT4ZGEb53dp8VtsoZlyXzLHOdAbsp1LPTVaHvLA0GYDFMbAW/WUBfUAdHwqLFAV+3uHvYWrCfhUOR2i89qvCBoOb48usAGdcF2M4aKn79k/43WzBZ+xR1L0uZfia70XP9soQReeuhZiUnXFDG1T8/OXNmssTSnYO+3kVLAgeiY719uDwL9FQycgLPessNihMZbAKG7qwPZyG11G1+ZA3jAX2yddpYfmaKBlmfcK/V0mwIRUDC0nJSOPUl2KB8h13F4dlVZiRhdGY5farwN+f9hEb1cRi41ZcGDn6Xe9MMSTOY81ULJyXIHSWFIQHstVYLiJEiUjktlHiGjntN5/btB8Fu+vp28zl2fZXN+dJDyN6EXhS+0yzqpl/LSJNEUVxmu7BsNdjAY0jVsAhkNuuY0E1G48ej25mSt+00yPbQ4SRCVkIwb6ISvYtmJRPz9Zt5dk76blf+lJwAPH5KDF+vHAmACLoCdG2Adii6dOHnNJnTmZtoOGO8Q1jy1veMw6gbLFToQmfJa7nT7Al89mRbRkZZQxJTKgK5Kc9INzmTJFp0tpAPzNmyL/F08bX3nhCumM/cR/2RPn9emZ3VljokttZD1zVWXlUIqEU7SLk5I0lFRU0AcENXBYazNaVzsVHA/sD3o9hm42wbHIRb/BBQTKzAi8s3+bMtpOOZgLdQzCYPfX3UUxKd1WYVkGH7lh/RBBgMZZwXzU9+GYxdBqlGs0LP+DZ5g2BWNh6FAcR944B+K/JTWI3t9YyVyRhlP4CCoUk/mmF7+r2pilVBjxXBHFaBfBtr9hbVn2zDuI0kEOG3kBx8CGdPOjX1ph1POOZJUO1JEGG0jzUy2tK4X0CgVNYhmkqqQysRNtKuPdCJqK3WW57kaV17vXgiyPrl4KEEWgiGF1euI4QkSFHFf0TDroQiLNKJiLbdhH0YBhriRNCHPxSqJmNNoketaioohqMglh6wLtEGWSM1EZbQg72h0UJAIPVFCAJOThpQGGdKfFovcwEeiBuZHN2Ob4uVM7+gwZLz1D9E7ta4RmMZ24OBBAg7Eh6dLXGofZ4U2TFOCQMKjwhVckjrydRS+YaqCw1kYt6UexuzbNEDyYLTZnrY1PzsHZJT4U+awO2xlqTSYu6n/U29O2wPXgGOEKDMSq+zTUtyc8+6iLp0ivav4FKx+xxVy4FxhIF/pucVDqpsVe2jFOfdZhTzLz2QjtzvsTCvDPU7bzDH2eXVKUV9TZ+qFtaSSxnYgYdXKwVreIgvWhT9eGDB2OvnWyPLfIIIfNnfIxU8nW7MbcH05nhlsYtaW9EZRsxWcKdEqInq1DiZPKCz7iGmAU9/ccnnQud2pNgIGFYOTAWjhIrd63aPDgfj8/sdlD4l+UTlcxTI9jbaMqqN0gQxSHs60IAcW3cH4p3V1aSciTKB29L1tz2eUQhRiTgTvmqc+sGtBNh4ky0mQJGsdycBREP+fAaSs1EREDVo5gvgi5+aCN7NECw30owbCc1mSpjiahyNVwJd1jiGgzSwfTpzf2c5XJvG/g1n0fH88KHNnf+u7ZiRMlXueSIsloJBUtW9ezvsx9grfsX/FNxnbxU1Lvg0hLxixypHKGFAaPu0xCD8oDTeFSyfRT6s8109GMUZL8m2xXp8X2dpPCWWdX84iga4BrTlOfqox4shqEgh/Ht4qRst52cA1xOIUuOxgfUivp6v5f8IVyaryEdpVk72ERAwdT4aoY1usBgmP+0m06Q216H/nubtNYxHaOIYjcach3A8Ez/zc0KcShhel0HCYjFsA0FjYqyJ5ZUH1aZw3+zWC0hLpM6GDfcAdn9fq2orPmZbW6XXrf+Krc9RtvII5jeD3dFoT1KwZJwxfUMvc5KLfn8rROW23Jw89sJ2a5dpB3qWDUBWF2iX8OCuKprHosJ2mflBR+Wqs86VvgI/XMnsqb97+VlKdPVysczPj8Jhzf+WCvGBHijAqYlavbF60soMWlHbvKT+ScvhprgeTln51xX0sF+Eadc/l2s2a5BgkVbHYyz0E85p0LstqH+gEGiR84nBRRFIn8hLSZrGwqjZ3E29cuGi+5Z5bp7EM8MWFa9ssS/vy4VrDfECSv7DSU84DaP0sXI3Ap4lWznQ65nQoTKRWU30gd7Nn8ZowUvGIx4aqyXGwmA/PB4qN8msJUODezUHEl0VP9uo+cZ8vPFodSIB4C7lQYjEFj8yu49C2KIV3qxMFYTevG8KqAr0TPlkbzHHnTpDpvpzziAiNFh8xiT7C/TiyH0EguUw4vxAgpnE27WIypV+uFN2zW7xniF/n75trs9IJ5amB1zXXZ1LFkJ6GbS/dFokzl4cc2mamVwhL4XU0Av5gDWAl+aEWhAP7t2VIwU+EpvfOPDcLASX7H7lZpXA2XQfbSlD4qU18NffNPoAKMNSccBfO9YVVgmlW4RydBqfHAV7+hrZ84WJGho6bNT0YMhxxLdOx/dwGj0oyak9aAkNJ8lRJzUuA8sR+fPyiyTgUHio5+Pp+YaKlHrhR41jY5NESPS3x+zTMe0S2HnLOKCOQPpdxKyviBvdHrCDRqO+l96HhhNBLXWv4yEMuEUYo8kXnYJM8oIgVM4XJ+xXOev4YbWeqsvgq0lmw4/PiYr9sYLt+W5EAuYSFnJEan8CwJwbtASBfLBBpJZiRPor/aCJBZsM+MhvS7ZepyHvU8m5WSmaZnxuLts8ojl6KkS8oSAHkq5GWlCB/NgJ5W3rO2Cj1MK7ahxsCrbTT3a0V/QQH+sErxV4XUWDHx0kkFy25bPmBMBQ6BU3HoHhhYcJB9JhP6NXUWKxnE0raXHB6U9KHpWdQCQI72qevp5fMzcm+AvC85rsynVQhruDA9fp9COe7N56cg1UKGSas89vrN+WlGLYTwi5W+0xYdKEGtGCeNJwXKDU0XqU5uQYnWsMwTENLGtbQMvoGjIFIEMzCRal4rnBAg7D/CSn8MsCvS+FDJJAzoiioJEhZJgAp9n2+1Yznr7H+6eT4YkJ9Mpj60ImcW4i4iHDLn9RydB8dx3QYm3rsX6n4VRrZDsYK6DCGwkwd5n3/INFEpk16fYpP6JtMQpqEMzcOfQGAHXBTEGzuLJ03GYQL9bmV2/7ExDlRf+Uvf1sM2frRtCWmal12pMgtonvSCtR4n1CLUZRdTHDHP1Otwqd+rcdlavnKjUB/OYXQHUJzpNyFoKpQK+2OgrEKpGyIgIBgn2y9QHnTJihZOpEvOKIoHAMGAXHmj21Lym39Mbiow4IF+77xNuewziNVBxr6KD5e+9HzZSBIlUa/AmsDFJFXeyrQakR3FwowTGcADJHcEfhGkXYNGSYo4dh4bxwLM+28xjiqkdn0/3R4UEkvcBrBfn/SzBc1XhKM2VPlJgKSorjDac96V2UnQYXl1/yZPT4DVelgO+soMjexXwYO58VLl5xInQUZI8jc3H2CPnCNb9X05nOxIy4MlecasTqGK6s2az4RjpF2cQP2G28R+7wDPsZDZC/kWtjdoHC7SpdPmqQrUAhMwKVuxCmYTiD9q/O7GHtZvPSN0CAUQN/rymXZNniYLlJDE70bsk6Xxsh4kDOdxe7A2wo7P9F5YvqqRDI6brf79yPCSp4I0jVoO4YnLYtX5nzspR5WB4AKOYtR1ujXbOQpPyYDvfRE3FN5zw0i7reehdi7yV0YDRKRllGCGRk5Yz+Uv1fYl2ZwrnGsqsjgAVo0xEUba8ohjaNMJNwTwZA/wBDWFSCpg1eUH8MYL2zdioxRTqgGQrDZxQyNzyBJPXZF0+oxITJAbj7oNC5JwgDMUJaM5GqlGCWc//KCIrI+aclEe4IA0uzv7cuj6GCdaJONpi13O544vbtIHBF+A+JeDFUQNy61Gki3rtyQ4aUywn6ru314/dkGiP8Iwjo0J/2Txs49ZkwEl4mx+iYUUO55I6pJzU4P+7RRs+DXZkyKUYZqVWrPF4I94m4Wx1tXeE74o9GuX977yvJ/jkdak8+AmoHVjI15V+WwBdARFV2IPirJgVMdsg1Pez2VNHqa7EHWdTkl3XTcyjG9BiueWFvQfXI8aWSkuuRmqi/HUuzqyvLJfNfs0txMqldYYflWB1BS31WkuPJGGwXUCpjiQSktkuBMWwHjSkQxeehqw1Kgz0Trzm7QbtgxiEPDVmWCNCAeCfROTphd1ZNOhzLy6XfJyG6Xgd5MCAZw4xie0Sj5AnY1/akDgNS9YFl3Y06vd6FAsg2gVQJtzG7LVq1OH2frbXNHWH/NY89NNZ4QUSJqL2yEcGADbT38X0bGdukqYlSoliKOcsSTuqhcaemUeYLLoI8+MZor2RxXTRThF1LrHfqf/5LcLAjdl4EERgUysYS2geE+yFdasU91UgUDsc2cSQ1ZoT9+uLOwdgAmifwQqF028INc2IQEDfTmUw3eZxvz7Ud1z3xc1PQfeCvfKsB9jOhRj7rFyb9XcDWLcYj0bByosychMezMLVkFiYcdBBQtvI6K0KRuOZQH2kBsYHJaXTkup8F0eIhO1/GcIwWKpr2mouB7g5TUDJNvORXPXa/mU8bh27TAZYBe2sKx4NSv5OjnHIWD2RuysCzBlUfeNXhDd2jxnHoUlheJ3jBApzURy0fwm2FwwsSU0caQGl0Kv8hopRQE211NnvtLRsmCNrhhpEDoNiZEzD2QdJWKbRRWnaFedXHAELSN0t0bfsCsMf0ktfBoXBoNA+nZN9+pSlmuzspFevmsqqcMllzzvkyXrzoA+Ryo1ePXpdGOoJvhyru+EBRsmOp7MXZ0vNUMUqHLUoKglg1p73sWeZmPc+KAw0pE2zIsFFE5H4192KwDvDxdxEYoDBDNZjbg2bmADTeUKK57IPD4fTYF4c6EnXx/teYMORBDtIhPJneiZny7Nv/zG+YmekIKCoxr6kauE2bZtBLufetNG0BtBY7f+/ImUypMBvdWu/Q7vTMRzw5aQGZWuc1V0HEsItFYMIBnoKGZ0xcarba/TYZq50kCaflFysYjA4EDKHqGdpYWdKYmm+a7TADmW35yfnOYpZYrkpVEtiqF0EujI00aeplNs2k+qyFZNeE3CDPL9P6b4PQ/kataHkVpLSEVGK7EX6rAa7IVNrvZtFvOA6okKvBgMtFDAGZOx88MeBcJ8AR3AgUUeIznAN6tjCUipGDZONm1FjWJp4A3QIzSaIOmZ7DvF/ysYYbM/fFDOV0jntAjRdapxJxL0eThpEhKOjCDDq2ks+3GrwxqIFKLe1WdOzII8XIOPGnwy6LKXVfpSDOTEfaRsGujhpS4hBIsMOqHbl16PJxc4EkaVu9wpEYlF/84NSv5Zum4drMfp9yXbzzAOJqqS4YkI4cBrFrC7bMPiCfgI3nNZAqkk3QOZqR+yyqx+nDQKBBBZ7QKrfGMCL+XpqFaBJU0wpkBdAhbR4hJsmT5aynlvkouoxm/NjD5oe6BzVIO9uktM+/5dEC5P7vZvarmuO/lKXz4sBabVPIATuKTrwbJP8XUkdM6uEctHKXICUJGjaZIWRbZp8czquQYfY6ynBUCfIU+gG6wqSIBmYIm9pZpXdaL121V7q0VjDjmQnXvMe7ysoEZnZL15B0SpxS1jjd83uNIOKZwu5MPzg2NhOx3xMOPYwEn2CUzbSrwAs5OAtrz3GAaUkJOU74XwjaYUmGJdZBS1NJVkGYrToINLKDjxcuIlyfVsKQSG/G4DyiO2SlQvJ0d0Ot1uOG5IFSAkq+PRVMgVMDvOIJMdqjeCFKUGRWBW9wigYvcbU7CQL/7meF2KZAaWl+4y9uhowAX7elogAvItAAxo2+SFxGRsHGEW9BnhlTuWigYxRcnVUBRQHV41LV+Fr5CJYV7sHfeywswx4XMtUx6EkBhR+q8AXXUA8uPJ73Pb49i9KG9fOljvXeyFj9ixgbo6CcbAJ7WHWqKHy/h+YjBwp6VcN7M89FGzQ04qbrQtgrOFybg3gQRTYG5xn73ArkfQWjCJROwy3J38Dx/D7jOa6BBNsitEw1wGq780EEioOeD+ZGp2J66ADiVGMayiHYucMk8nTK2zzT9CnEraAk95kQjy4k0GRElLL5YAKLQErJ5rp1eay9O4Fb6yJGm9U4FaMwPGxtKD6odIIHKoWnhKo1U8KIpFC+MVn59ZXmc7ZTBZfsg6FQ8W10YfTr4u0nYrpHZbZ1jXiLmooF0cOm0+mPnJBXQtepc7n0BqOipNCqI6yyloTeRShNKH04FIo0gcMk0H/xThyN4pPAWjDDkEp3lNNPRNVfpMI44CWRlRgViP64eK0JSRp0WUvCWYumlW/c58Vcz/yMwVcW5oYb9+26TEhwvbxiNg48hl1VI1UXTU//Eta+BMKnGUivctfL5wINDD0giQL1ipt6U7C9cd4+lgqY2lMUZ02Uv6Prs+ZEZer7ZfWBXVghlfOOrClwsoOFKzWEfz6RZu1eCs+K8fLvkts5+BX0gyrFYve0C3qHrn5U/Oh6D/CihmWIrY7HUZRhJaxde+tldu6adYJ+LeXupQw0XExC36RETdNFxcq9glMu4cNQSX9cqR/GQYp+IxUkIcNGWVU7ZtGa6P3XAyodRt0XeS3Tp01AnCh0ZbUh4VrSZeV9RWfSoWyxnY3hzcZ30G/InDq4wxRrEejreBxnhIQbkxenxkaxl+k7eLUQkUR6vKJ2iDFNGX3WmVA1yaOH+mvhBd+sE6vacQzFobwY5BqEAFmejwW5ne7HtVNolOUgJc8CsUxmc/LBi8N5mu9VsIA5HyErnS6zeCz7VLI9+n/hbT6hTokMXTVyXJRKSG2hd2labXTbtmK4fNH3IZBPreSA4FMeVouVN3zG5x9CiGpLw/3pceo4qGqp+rVp+z+7yQ98oEf+nyH4F3+J9IheDBa94Wi63zJbLBCIZm7P0asHGpIJt3PzE3m0S4YIWyXBCVXGikj8MudDPB/6Nm2v4IxJ5gU0ii0guy5SUHqGUYzTP0jIJU5E82RHUXtX4lDdrihBLdP1YaG1AGUC12rQKuIaGvCpMjZC9bWSCYnjDlvpWbkdXMTNeBHLKiuoozMGIvkczmP0aRJSJ8PYnLCVNhKHXBNckH79e8Z8Kc2wUej4sQZoH8qDRGkg86maW/ZQWGNnLcXmq3FlXM6ssR/3P6E/bHMvm6HLrv1yRixit25JsH3/IOr2UV4BWJhxXW5BJ6Xdr07n9kF3ZNAk6/Xpc5MSFmYJ2R7bdL8Kk7q1OU9Elg/tCxJ8giT27wSTySF0GOxg4PbYJdi/Nyia9Nn89CGDulfJemm1aiEr/eleGSN+5MRrVJ4K6lgyTTIW3i9cQ0dAi6FHt0YMbH3wDSAtGLSAccezzxHitt1QdhW36CQgPcA8vIIBh3/JNjf/Obmc2yzpk8edSlS4lVdwgW5vzbYEyFoF4GCBBby1keVNueHAH+evi+H7oOVfS3XuPQSNTXOONAbzJeSb5stwdQHl1ZjrGoE49I8+A9j3t+ahhQj74FCSWpZrj7wRSFJJnnwi1T9HL5qrCFW/JZq6P62XkMWTb+u4lGpKfmmwiJWx178GOG7KbrZGqyWwmuyKWPkNswkZ1q8uptUlviIi+AXh2bOOTOLsrtNkfqbQJeh24reebkINLkjut5r4d9GR/r8CBa9SU0UQhsnZp5cP+RqWCixRm7i4YRFbtZ4EAkhtNa6jHb6gPYQv7MKqkPLRmX3dFsK8XsRLVZ6IEVrCbmNDc8o5mqsogjAQfoC9Bc7R6gfw03m+lQpv6kTfhxscDIX6s0w+fBxtkhjXAXr10UouWCx3C/p/FYwJRS/AXRKkjOb5CLmK4XRe0+xeDDwVkJPZau52bzLEDHCqV0f44pPgKOkYKgTZJ33fmk3Tu8SdxJ02SHM8Fem5SMsWqRyi2F1ynfRJszcFKykdWlNqgDA/L9lKYBmc7Zu/q9ii1FPF47VJkqhirUob53zoiJtVVRVwMR34gV9iqcBaHbRu9kkvqk3yMpfRFG49pKKjIiq7h/VpRwPGTHoY4cg05X5028iHsLvUW/uz+kjPyIEhhcKUwCkJAwbR9pIEGOn8z6svAO8i89sJ3dL5qDWFYbS+HGPRMxYwJItFQN86YESeJQhn2urGiLRffQeLptDl8dAgb+Tp47UQPxWOw17OeChLN1WnzlkPL1T5O+O3Menpn4C3IY5LEepHpnPeZHbvuWfeVtPlkH4LZjPbBrkJT3NoRJzBt86CO0Xq59oQ+8dsm0ymRcmQyn8w71mhmcuEI5byuF+C88VPYly2sEzjlzAQ3vdn/1+Hzguw6qFNNbqenhZGbdiG6RwZaTG7jTA2X9RdXjDN9yj1uQpyO4Lx8KRAcZcbZMafp4wPOd5MdXoFY52V1A8M9hi3sso93+uprE0qYNMjkE22CvK4HuUxqN7oIz5pWuETq1lQAjqlSlqdD2Rnr/ggp/TVkQYjn9lMfYelk2sH5HPdopYo7MHwlV1or9Bxf+QCyLzm92vzG2wjiIjC/ZHEJzeroJl6bdFPTpZho5MV2U86fLQqxNlGIMqCGy+9WYhJ8ob1r0+Whxde9L2PdysETv97O+xVw+VNN1TZSQN5I6l9m5Ip6pLIqLm4a1B1ffH6gHyqT9p82NOjntRWGIofO3bJz5GhkvSWbsXueTAMaJDou99kGLqDlhwBZNEQ4mKPuDvVwSK4WmLluHyhA97pZiVe8g+JxmnJF8IkV/tCs4Jq/HgOoAEGR9tCDsDbDmi3OviUQpG5D8XmKcSAUaFLRXb2lmJTNYdhtYyfjBYZQmN5qT5CNuaD3BVnlkCk7bsMW3AtXkNMMTuW4HjUERSJnVQ0vsBGa1wo3Qh7115XGeTF3NTz8w0440AgU7c3bSXO/KMINaIWXd0oLpoq/0/QJxCQSJ9XnYy1W7TYLBJpHsVWD1ahsA7FjNvRd6mxCiHsm8g6Z0pnzqIpF1dHUtP2ITU5Z1hZHbu+L3BEEStBbL9XYvGfEakv1bmf+bOZGnoiuHEdlBnaChxYKNzB23b8sw8YyT7Ajxfk49eJIAvdbVkdFCe2J0gMefhQ0bIZxhx3fzMIysQNiN8PgOUKxOMur10LduigREDRMZyP4oGWrP1GFY4t6groASsZ421os48wAdnrbovNhLt7ScNULkwZ5AIZJTrbaKYTLjA1oJ3sIuN/aYocm/9uoQHEIlacF1s/TM1fLcPTL38O9fOsjMEIwoPKfvt7opuI9G2Hf/PR4aCLDQ7wNmIdEuXJ/QNL72k5q4NejAldPfe3UVVqzkys8YZ/jYOGOp6c+YzRCrCuq0M11y7TiN6qk7YXRMn/gukxrEimbMQjr3jwRM6dKVZ4RUfWQr8noPXLJq6yh5R3EH1IVOHESst/LItbG2D2vRsZRkAObzvQAAD3mb3/G4NzopI0FAiHfbpq0X72adg6SRj+8OHMShtFxxLZlf/nLgRLbClwl5WmaYSs+yEjkq48tY7Z2bE0N91mJwt+ua0NlRJIDh0HikF4UvSVorFj2YVu9YeS5tfvlVjPSoNu/Zu6dEUfBOT555hahBdN3Sa5Xuj2Rvau1lQNIaC944y0RWj9UiNDskAK1WoL+EfXcC6IbBXFRyVfX/WKXxPAwUyIAGW8ggZ08hcijKTt1YKnUO6QPvcrmDVAb0FCLIXn5id4fD/Jx4tw/gbXs7WF9b2RgXtPhLBG9vF5FEkdHAKrQHZAJC/HWvk7nvzzDzIXZlfFTJoC3JpGgLPBY7SQTjGlUvG577yNutZ1hTfs9/1nkSXK9zzKLRZ3VODeKUovJe0WCq1zVMYxCJMenmNzPIU2S8TA4E7wWmbNkxq9rI2dd6v0VpcAPVMxnDsvWTWFayyqvKZO7Z08a62i/oH2/jxf8rpmfO64in3FLiL1GX8IGtVE9M23yGsIqJbxDTy+LtaMWDaPqkymb5VrQdzOvqldeU0SUi6IirG8UZ3jcpRbwHa1C0Dww9G/SFX3gPvTJQE+kyz+g1BeMILKKO+olcHzctOWgzxYHnOD7dpCRtuZEXACjgqesZMasoPgnuDC4nUviAAxDc5pngjoAITIkvhKwg5d608pdrZcA+qn5TMT6Uo/QzBaOxBCLTJX3Mgk85rMfsnWx86oLxf7p2PX5ONqieTa/qM3tPw4ZXvlAp83NSD8F7+ZgctK1TpoYwtiU2h02HCGioH5tkVCqNVTMH5p00sRy2JU1qyDBP2CII/Dg4WDsIl+zgeX7589srx6YORRQMBfKbodbB743Tl4WLKOEnwWUVBsm94SOlCracU72MSyj068wdpYjyz1FwC2bjQnxnB6Mp/pZ+yyZXtguEaYB+kqhjQ6UUmwSFazOb+rhYjLaoiM+aN9/8KKn0zaCTFpN9eKwWy7/u4EHzO46TdFSNjMfn2iPSJwDPCFHc0I1+vjdAZw5ZjqR/uzi9Zn20oAa5JnLEk/EA3VRWE7J/XrupfFJPtCUuqHPpnlL7ISJtRpSVcB8qsZCm2QEkWoROtCKKxUh3yEcMbWYJwk6DlEBG0bZP6eg06FL3v6RPb7odGuwm7FN8fG4woqtB8e7M5klPpo97GoObNwt+ludTAmxyC5hmcFx+dIvEZKI6igFKHqLH01iY1o7903VzG9QGetyVx5RNmBYUU+zIuSva/yIcECUi4pRmE3VkF2avqulQEUY4yZ/wmNboBzPmAPey3+dSYtBZUjeWWT0pPwCz4Vozxp9xeClIU60qvEFMQCaPvPaA70WlOP9f/ey39macvpGCVa+zfa8gO44wbxpJUlC8GN/pRMTQtzY8Z8/hiNrU+Zq64ZfFGIkdj7m7abcK1EBtws1X4J/hnqvasPvvDSDYWN+QcQVGMqXalkDtTad5rYY0TIR1Eqox3czwPMjKPvF5sFv17Thujr1IZ1Ytl4VX1J0vjXKmLY4lmXipRAro0qVGEcXxEVMMEl54jQMd4J7RjgomU0j1ptjyxY+cLiSyXPfiEcIS2lWDK3ISAy6UZ3Hb5vnPncA94411jcy75ay6B6DSTzK6UTCZR9uDANtPBrvIDgjsfarMiwoax2OlLxaSoYn4iRgkpEGqEkwox5tyI8aKkLlfZ12lO11TxsqRMY89j5JaO55XfPJPDL1LGSnC88Re9Ai+Nu5bZjtwRrvFITUFHPR4ZmxGslQMecgbZO7nHk32qHxYkdvWpup07ojcMCaVrpFAyFZJJbNvBpZfdf39Hdo2kPtT7v0/f8R/B5Nz4f1t9/3zNM/7n6SUHfcWk5dfQFJvcJMgPolGCpOFb/WC0FGWU2asuQyT+rm88ZKZ78Cei/CAh939CH0JYbpZIPtxc2ufXqjS3pHH9lnWK4iJ7OjR/EESpCo2R3MYKyE7rHfhTvWho4cL1QdN4jFTyR6syMwFm124TVDDRXMNveI1Dp/ntwdz8k8kxw7iFSx6+Yx6O+1LzMVrN0BBzziZi9kneZSzgollBnVwBh6oSOPHXrglrOj+QmR/AESrhDpKrWT+8/AiMDxS/5wwRNuGQPLlJ9ovomhJWn8sMLVItQ8N/7IXvtD8kdOoHaw+vBSbFImQsv/OCAIui99E+YSIOMlMvBXkAt+NAZK8wB9Jf8CPtB+TOUOR+z71d/AFXpPBT6+A5FLjxMjLIEoJzrQfquvxEIi+WoUzGR1IzQFNvbYOnxb2PyQ0kGdyXKzW2axQL8lNAXPk6NEjqrRD1oZtKLlFoofrXw0dCNWASHzy+7PSzOUJ3XtaPZsxLDjr+o41fKuKWNmjiZtfkOzItvlV2MDGSheGF0ma04qE3TUEfqJMrXFm7DpK+27DSvCUVf7rbNoljPhha5W7KBqVq0ShUSTbRmuqPtQreVWH4JET5yMhuqMoSd4r/N8sDmeQiQQvi1tcZv7Moc7dT5X5AtCD6kNEGZOzVcNYlpX4AbTsLgSYYliiPyVoniuYYySxsBy5cgb3pD+EK0Gpb0wJg031dPgaL8JZt6sIvzNPEHfVPOjXmaXj4bd4voXzpZ5GApMhILgMbCEWZ2zwgdeQgjNHLbPIt+KqxRwWPLTN6HwZ0Ouijj4UF+Sg0Au8XuIKW0WxlexdrFrDcZJ8Shauat3X0XmHygqgL1nAu2hrJFb4wZXkcS+i36KMyU1yFvYv23bQUJi/3yQpqr/naUOoiEWOxckyq/gq43dFou1DVDaYMZK9tho7+IXXokBCs5GRfOcBK7g3A+jXQ39K4YA8PBRW4m5+yR0ZAxWJncjRVbITvIAPHYRt1EJ3YLiUbqIvoKHtzHKtUy1ddRUQ0AUO41vonZDUOW+mrszw+SW/6Q/IUgNpcXFjkM7F4CSSQ2ExZg85otsMs7kqsQD4OxYeBNDcSpifjMoLb7GEbGWTwasVObmB/bfPcUlq0wYhXCYEDWRW02TP5bBrYsKTGWjnWDDJ1F7zWai0zW/2XsCuvBQjPFcTYaQX3tSXRSm8hsAoDdjArK/OFp6vcWYOE7lizP0Yc+8p16i7/NiXIiiQTp7c7Xus925VEtlKAjUdFhyaiLT7VxDagprMFwix4wZ05u0qj7cDWFd0W9OYHIu3JbJKMXRJ1aYNovugg+QqRN7fNHSi26VSgBpn+JfMuPo3aeqPWik/wI5Rz3BWarPQX4i5+dM0npwVOsX+KsOhC7vDg+OJsz4Q5zlnIeflUWL6QYMbf9WDfLmosLF4Qev3mJiOuHjoor/dMeBpA9iKDkMjYBNbRo414HCxjsHrB4EXNbHzNMDHCLuNBG6Sf+J4MZ/ElVsDSLxjIiGsTPhw8BPjxbfQtskj+dyNMKOOcUYIRBEIqbazz3lmjlRQhplxq673VklMMY6597vu+d89ec/zq7Mi4gQvh87ehYbpOuZEXj5g/Q7S7BFDAAB9DzG35SC853xtWVcnZQoH54jeOqYLR9NDuwxsVthTV7V99n/B7HSbAytbEyVTz/5NhJ8gGIjG0E5j3griULUd5Rg7tQR+90hJgNQKQH2btbSfPcaTOfIexc1db1BxUOhM1vWCpLaYuKr3FdNTt/T3PWCpEUWDKEtzYrjpzlL/wri3MITKsFvtF8QVV/NhVo97aKIBgdliNc10dWdXVDpVtsNn+2UIolrgqdWA4EY8so0YvB4a+aLzMXiMAuOHQrXY0tr+CL10JbvZzgjJJuB1cRkdT7DUqTvnswVUp5kkUSFVtIIFYK05+tQxT6992HHNWVhWxUsD1PkceIrlXuUVRogwmfdhyrf6zzaL8+c0L7GXMZOteAhAVQVwdJh+7nrX7x4LaIIfz2F2v7Dg/uDfz2Fa+4gFm2zHAor8UqimJG3VTJtZEoFXhnDYXvxMJFc6ku2bhbCxzij2z5UNuK0jmp1mnvkVNUfR+SEmj1Lr94Lym75PO7Fs0MIr3GdsWXRXSfgLTVY0FLqba97u1In8NAcY7IC6TjWLigwKEIm43NxTdaVTv9mcKkzuzBkKd8x/xt1p/9BbP7Wyb4bpo1K1gnOpbLvKz58pWl3B55RJ/Z5mRDLPtNQg14jdOEs9+h/V5UVpwrAI8kGbX8KPVPDIMfIqKDjJD9UyDOPhjZ3vFAyecwyq4akUE9mDOtJEK1hpDyi6Ae87sWAClXGTiwPwN7PXWwjxaR79ArHRIPeYKTunVW24sPr/3HPz2IwH8oKH4OlWEmt4BLM6W5g4kMcYbLwj2usodD1088stZA7VOsUSpEVl4w7NMb1EUHMRxAxLF0CIV+0L3iZb+ekB1vSDSFjAZ3hfLJf7gFaXrOKn+mhR+rWw/eTXIcAgl4HvFuBg1LOmOAwJH3eoVEjjwheKA4icbrQCmvAtpQ0mXG0agYp5mj4Rb6mdQ+RV4QBPbxMqh9C7o8nP0Wko2ocnCHeRGhN1XVyT2b9ACsL+6ylUy+yC3QEnaKRIJK91YtaoSrcWZMMwxuM0E9J68Z+YyjA0g8p1PfHAAIROy6Sa04VXOuT6A351FOWhKfTGsFJ3RTJGWYPoLk5FVK4OaYR9hkJvezwF9vQN1126r6isMGXWTqFW+3HL3I/jurlIdDWIVvYY+s6yq7lrFSPAGRdnU7PVwY/SvWbZGpXzy3BQ2LmAJlrONUsZs4oGkly0V267xbD5KMY8woNNsmWG1VVgLCra8aQBBcI4DP2BlNwxhiCtHlaz6OWFoCW0vMR3ErrG7JyMjTSCnvRcsEHgmPnwA6iNpJ2DrFb4gLlhKJyZGaWkA97H6FFdwEcLT6DRQQL++fOkVC4cYGW1TG/3iK5dShRSuiBulmihqgjR45Vi03o2RbQbP3sxt90VxQ6vzdlGfkXmmKmjOi080JSHkLntjvsBJnv7gKscOaTOkEaRQqAnCA4HWtB4XnMtOhpRmH2FH8tTXrIjAGNWEmudQLCkcVlGTQ965Kh0H6ixXbgImQP6b42B49sO5C8pc7iRlgyvSYvcnH9FgQ3azLbQG2cUW96SDojTQStxkOJyOuDGTHAnnWkz29aEwN9FT8EJ4yhXOg+jLTrCPKeEoJ9a7lDXOjEr8AgX4BmnMQ668oW0zYPyQiVMPxKRHtpfnEEyaKhdzNVThlxxDQNdrHeZiUFb6NoY2KwvSb7BnRcpJy+/g/zAYx3fYSN5QEaVD2Y1VsNWxB0BSO12MRsRY8JLfAezRMz5lURuLUnG1ToKk6Q30FughqWN6gBNcFxP/nY/iv+iaUQOa+2Nuym46wtI/DvSfzSp1jEi4SdYBE7YhTiVV5cX9gwboVDMVgZp5YBQlHOQvaDNfcCoCJuYhf5kz5kwiIKPjzgpcRJHPbOhJajeoeRL53cuMahhV8Z7IRr6M4hW0JzT7mzaMUzQpm866zwM7Cs07fJYXuWvjAMkbe5O6V4bu71sOG6JQ4oL8zIeXHheFVavzxmlIyBkgc9IZlEDplMPr8xlcyss4pVUdwK1e7CK2kTsSdq7g5SHRAl3pYUB9Ko4fsh4qleOyJv1z3KFSTSvwEcRO/Ew8ozEDYZSqpfoVW9uhJfYrNAXR0Z3VmeoAD+rVWtwP/13sE/3ICX3HhDG3CMc476dEEC0K3umSAD4j+ZQLVdFOsWL2C1TH5+4KiSWH+lMibo+B55hR3Gq40G1n25sGcN0mEcoU2wN9FCVyQLBhYOu9aHVLWjEKx2JIUZi5ySoHUAI9b8hGzaLMxCZDMLhv8MkcpTqEwz9KFDpCpqQhVmsGQN8m24wyB82FAKNmjgfKRsXRmsSESovAwXjBIoMKSG51p6Um8b3i7GISs7kjTq/PZoioCfJzfKdJTN0Q45kQEQuh9H88M3yEs3DbtRTKALraM0YC8laiMiOOe6ADmTcCiREeAWZelBaEXRaSuj2lx0xHaRYqF65O0Lo5OCFU18A8cMDE4MLYm9w2QSr9NgQAIcRxZsNpA7UJR0e71JL+VU+ISWFk5I97lra8uGg7GlQYhGd4Gc6rxsLFRiIeGO4abP4S4ekQ1fiqDCy87GZHd52fn5aaDGuvOmIofrzpVwMvtbreZ/855OaXTRcNiNE0wzGZSxbjg26v8ko8L537v/XCCWP2MFaArJpvnkep0pA+O86MWjRAZPQRfznZiSIaTppy6m3p6HrNSsY7fDtz7Cl4V/DJAjQDoyiL2uwf1UHVd2AIrzBUSlJaTj4k6NL97a/GqhWKU9RUmjnYKpm2r+JYUcrkCuZKvcYvrg8pDoUKQywY9GDWg03DUFSirlUXBS5SWn/KAntnf0IdHGL/7mwXqDG+LZYjbEdQmqUqq4y54TNmWUP7IgcAw5816YBzwiNIJiE9M4lPCzeI/FGBeYy3p6IAmH4AjXXmvQ4Iy0Y82NTobcAggT2Cdqz6Mx4TdGoq9fn2etrWKUNFyatAHydQTVUQ2S5OWVUlugcNvoUrlA8cJJz9MqOa/W3iVno4zDHfE7zhoY5f5lRTVZDhrQbR8LS4eRLz8iPMyBL6o4PiLlp89FjdokQLaSBmKHUwWp0na5fE3v9zny2YcDXG/jfI9sctulHRbdkI5a4GOPJx4oAJQzVZ/yYAado8KNZUdEFs9ZPiBsausotXMNebEgr0dyopuqfScFJ3ODNPHgclACPdccwv0YJGQdsN2lhoV4HVGBxcEUeUX/alr4nqpcc1CCR3vR7g40zteQg/JvWmFlUE4mAiTpHlYGrB7w+U2KdSwQz2QJKBe/5eiixWipmfP15AFWrK8Sh1GBBYLgzki1wTMhGQmagXqJ2+FuqJ8f0XzXCVJFHQdMAw8xco11HhM347alrAu+wmX3pDFABOvkC+WPX0Uhg1Z5MVHKNROxaR84YV3s12UcM+70cJ460SzEaKLyh472vOMD3XnaK7zxZcXlWqenEvcjmgGNR2OKbI1s8U+iwiW+HotHalp3e1MGDy6BMVIvajnAzkFHbeVsgjmJUkrP9OAwnEHYXVBqYx3q7LvXjoVR0mY8h+ZaOnh053pdsGkmbqhyryN01eVHySr+CkDYkSMeZ1xjPNVM+gVLTDKu2VGsMUJqWO4TwPDP0VOg2/8ITbAUaMGb4LjL7L+Pi11lEVMXTYIlAZ/QHmTENjyx3kDkBdfcvvQt6tKk6jYFM4EG5UXDTaF5+1ZjRz6W7MdJPC+wTkbDUim4p5QQH3b9kGk2Bkilyeur8Bc20wm5uJSBO95GfYDI1EZipoRaH7uVveneqz43tlTZGRQ4a7CNmMHgXyOQQOL6WQkgMUTQDT8vh21aSdz7ERiZT1jK9F+v6wgFvuEmGngSvIUR2CJkc5tx1QygfZnAruONobB1idCLB1FCfO7N1ZdRocT8/Wye+EnDiO9pzqIpnLDl4bkaRKW+ekBVwHn46Shw1X0tclt/0ROijuUB4kIInrVJU4buWf4YITJtjOJ6iKdr1u+flgQeFH70GxKjhdgt/MrwfB4K/sXczQ+9zYcrD4dhY6qZhZ010rrxggWA8JaZyg2pYij8ieYEg1aZJkZK9O1Re7sB0iouf60rK0Gd+AYlp7soqCBCDGwfKeUQhCBn0E0o0GS6PdmjLi0TtCYZeqazqwN+yNINIA8Lk3iPDnWUiIPLGNcHmZDxfeK0iAdxm/T7LnN+gemRL61hHIc0NCAZaiYJR+OHnLWSe8sLrK905B5eEJHNlWq4RmEXIaFTmo49f8w61+NwfEUyuJAwVqZCLFcyHBKAcIVj3sNzfEOXzVKIndxHw+AR93owhbCxUZf6Gs8cz6/1VdrFEPrv330+9s6BtMVPJ3zl/Uf9rUi0Z/opexfdL3ykF76e999GPfVv8fJv/Y/+/5hEMon1tqNFyVRevV9y9/uIvsG3dbB8GRRrgaEXfhx+2xeOFt+cEn3RZanNxdEe2+B6MHpNbrRE53PlDifPvFcp4kO78ILR0T4xyW/WGPyBsqGdoA7zJJCu1TKbGfhnqgnRbxbB2B3UZoeQ2bz2sTVnUwokTcTU21RxN1PYPS3Sar7T0eRIsyCNowr9amwoMU/od9s2APtiKNL6ENOlyKADstAEWKA+sdKDhrJ6BOhRJmZ+QJbAaZ3/5Fq0/lumCgEzGEbu3yi0Y4I4EgVAjqxh4HbuQn0GrRhOWyAfsglQJAVL1y/6yezS2k8RE2MstJLh92NOB3GCYgFXznF4d25qiP4ZCyI4RYGesut6FXK6GwPpKK8WHEkhYui0AyEmr5Ml3uBFtPFdnioI8RiCooa7Z1G1WuyIi3nSNglutc+xY8BkeW3JJXPK6jd2VIMpaSxpVtFq+R+ySK9J6WG5Qvt+C+QH1hyYUOVK7857nFmyDBYgZ/o+AnibzNVqyYCJQvyDXDTK+iXdkA71bY7TL3bvuLxLBQ8kbTvTEY9aqkQ3+MiLWbEgjLzOH+lXgco1ERgzd80rDCymlpaRQbOYnKG/ODoFl46lzT0cjM5FYVvv0qLUbD5lyJtMUaC1pFlTkNONx6lliaX9o0i/1vws5bNKn5OuENQEKmLlcP4o2ZmJjD4zzd3Fk32uQ4uRWkPSUqb4LBe3EXHdORNB2BWsws5daRnMfNVX7isPSb1hMQdAJi1/qmDMfRUlCU74pmnzjbXfL8PVG8NsW6IQM2Ne23iCPIpryJjYbVnm5hCvKpMa7HLViNiNc+xTfDIaKm3jctViD8A1M9YPJNk003VVr4Zo2MuGW8vil8SLaGpPXqG7I4DLdtl8a4Rbx1Lt4w5Huqaa1XzZBtj208EJVGcmKYEuaeN27zT9EE6a09JerXdEbpaNgNqYJdhP1NdqiPKsbDRUi86XvvNC7rME5mrSQtrzAZVndtSjCMqd8BmaeGR4l4YFULGRBeXIV9Y4yxLFdyoUNpiy2IhePSWzBofYPP0eIa2q5JP4j9G8at/AqoSsLAUuRXtvgsqX/zYwsE+of6oSDbUOo4RMJw+DOUTJq+hnqwKim9Yy/napyZNTc2rCq6V9jHtJbxGPDwlzWj/Sk3zF/BHOlT/fSjSq7FqlPI1q6J+ru8Aku008SFINXZfOfnZNOvGPMtEmn2gLPt+H4QLA+/SYe4j398auzhKIp2Pok3mPC5q1IN1HgR+mnEfc4NeeHYwd2/kpszR3cBn7ni9NbIqhtSWFW8xbUJuUPVOeeXu3j0IGZmFNiwaNZ6rH4/zQ2ODz6tFxRLsUYZu1bfd1uIvfQDt4YD/efKYv8VF8bHGDgK22w2Wqwpi43vNCOXFJZCGMqWiPbL8mil6tsmOTXAWCyMCw73e2rADZj2IK6rqksM3EXF2cbLb4vjB14wa/yXK5vwU+05MzERJ5nXsXsW21o7M+gO0js2OyKciP5uF2iXyb2DiptwQeHeqygkrNsqVCSlldxBMpwHi1vfc8RKpP/4L3Lmpq6DZcvhDDfxTCE3splacTcOtXdK2g303dIWBVe2wD/Gvja1cClFQ67gw0t1ZUttsUgQ1Veky8oOpS6ksYEc4bqseCbZy766SvL3FodmnahlWJRgVCNjPxhL/fk2wyvlKhITH/VQCipOI0dNcRa5B1M5HmOBjTLeZQJy237e2mobwmDyJNHePhdDmiknvLKaDbShL+Is1XTCJuLQd2wmdJL7+mKvs294whXQD+vtd88KKk0DXP8B1Xu9J+xo69VOuFgexgTrcvI6SyltuLix9OPuE6/iRJYoBMEXxU4shQMf4Fjqwf1PtnJ/wWSZd29rhZjRmTGgiGTAUQqRz+nCdjeMfYhsBD5Lv60KILWEvNEHfmsDs2L0A252351eUoYxAysVaCJVLdH9QFWAmqJDCODUcdoo12+gd6bW2boY0pBVHWL6LQDK5bYWh1V8vFvi0cRpfwv7cJiMX3AZNJuTddHehTIdU0YQ/sQ1dLoF2xQPcCuHKiuCWOY30DHe1OwcClLAhqAKyqlnIbH/8u9ScJpcS4kgp6HKDUdiOgRaRGSiUCRBjzI5gSksMZKqy7Sd51aeg0tgJ+x0TH9YH2Mgsap9N7ENZdEB0bey2DMTrBA1hn56SErNHf3tKtqyL9b6yXEP97/rc+jgD2N1LNUH6RM9AzP3kSipr06RkKOolR7HO768jjWiH1X92jA7dkg7gcNcjqsZCgfqWw0tPXdLg20cF6vnQypg7gLtkazrHAodyYfENPQZsdfnjMZiNu4nJO97D1/sQE+3vNFzrSDOKw+keLECYf7RJwVHeP/j79833oZ0egonYB2FlFE5qj02B/LVOMJQlsB8uNg3Leg4qtZwntsOSNidR0abbZmAK4sCzvt8Yiuz2yrNCJoH5O8XvX/vLeR/BBYTWj0sOPYM/jyxRd5+/JziKAABaPcw/34UA3aj/gLZxZgRCWN6m4m3demanNgsx0P237/Q+Ew5VYnJPkyCY0cIVHoFn2Ay/e7U4P19APbPFXEHX94N6KhEMPG7iwB3+I+O1jd5n6VSgHegxgaSawO6iQCYFgDsPSMsNOcUj4q3sF6KzGaH/0u5PQoAj/8zq6Uc9MoNrGqhYeb2jQo0WlGlXjxtanZLS24/OIN5Gx/2g684BPDQpwlqnkFcxpmP/osnOXrFuu4PqifouQH0eF5qCkvITQbJw/Zvy5mAHWC9oU+cTiYhJmSfKsCyt1cGVxisKu+NymEQIAyaCgud/V09qT3nk/9s/SWsYtha7yNpzBIMM40rCSGaJ9u6lEkl00vXBiEt7p9P5IBCiavynEOv7FgLqPdeqxRiCwuFVMolSIUBcoyfUC2e2FJSAUgYdVGFf0b0Kn2EZlK97yyxrT2MVgvtRikfdaAW8RwEEfN+B7/eK8bBdp7URpbqn1xcrC6d2UjdsKbzCjBFqkKkoZt7Mrhg6YagE7spkqj0jOrWM+UGQ0MUlG2evP1uE1p2xSv4dMK0dna6ENcNUF+xkaJ7B764NdxLCpuvhblltVRAf7vK5qPttJ/9RYFUUSGcLdibnz6mf7WkPO3MkUUhR2mAOuGv8IWw5XG1ZvoVMnjSAZe6T7WYA99GENxoHkMiKxHlCuK5Gd0INrISImHQrQmv6F4mqU/TTQ8nHMDzCRivKySQ8dqkpQgnUMnwIkaAuc6/FGq1hw3b2Sba398BhUwUZSAIO8XZvnuLdY2n6hOXws+gq9BHUKcKFA6kz6FDnpxLPICa3qGhnc97bo1FT/XJk48LrkHJ2CAtBv0RtN97N21plfpXHvZ8gMJb7Zc4cfI6MbPwsW7AilCSXMFIEUEmir8XLEklA0ztYbGpTTGqttp5hpFTTIqUyaAIqvMT9A/x+Ji5ejA4Bhxb/cl1pUdOD6epd3yilIdO6j297xInoiBPuEDW2/UfslDyhGkQs7Wy253bVnlT+SWg89zYIK/9KXFl5fe+jow2rd5FXv8zDPrmfMXiUPt9QBO/iK4QGbX5j/7Rx1c1vzsY8ONbP3lVIaPrhL4+1QrECTN3nyKavGG0gBBtHvTKhGoBHgMXHStFowN+HKrPriYu+OZ05Frn8okQrPaaxoKP1ULCS/cmKFN3gcH7HQlVjraCeQmtjg1pSQxeuqXiSKgLpxc/1OiZsU4+n4lz4hpahGyWBURLi4642n1gn9qz9bIsaCeEPJ0uJmenMWp2tJmIwLQ6VSgDYErOeBCfSj9P4G/vI7oIF+l/n5fp956QgxGvur77ynawAu3G9MdFbJbu49NZnWnnFcQHjxRuhUYvg1U/e84N4JTecciDAKb/KYIFXzloyuE1eYXf54MmhjTq7B/yBToDzzpx3tJCTo3HCmVPYfmtBRe3mPYEE/6RlTIxbf4fSOcaKFGk4gbaUWe44hVk9SZzhW80yfW5QWBHxmtUzvMhfVQli4gZTktIOZd9mjJ5hsbmzttaHQB29Am3dZkmx3g/qvYocyhZ2PXAWsNQiIaf+Q8W/MWPIK7/TjvCx5q2XRp4lVWydMc2wIQkhadDB0xsnw/kSEyGjLKjI4coVIwtubTF3E7MJ6LS6UOsJKj82XVAVPJJcepfewbzE91ivXZvOvYfsmMevwtPpfMzGmC7WJlyW2j0jh7AF1JLmwEJSKYwIvu6DHc3YnyLH9ZdIBnQ+nOVDRiP+REpqv++typYHIvoJyICGA40d8bR7HR2k7do6UQTHF4oriYeIQbxKe4Th6+/l1BjUtS9hqORh3MbgvYrStXTfSwaBOmAVQZzpYNqsAmQyjY56MUqty3c/xH6GuhNvNaG9vGbG6cPtBM8UA3e8r51D0AR9kozKuGGSMgLz3nAHxDNnc7GTwpLj7/6HeWp1iksDeTjwCLpxejuMtpMnGJgsiku1sOACwQ9ukzESiDRN77YNESxR5LphOlcASXA5uIts1LnBIcn1J7BLWs49DMALSnuz95gdOrTZr0u1SeYHinno/pE58xYoXbVO/S+FEMMs5qyWkMnp8Q3ClyTlZP52Y9nq7b8fITPuVXUk9ohG5EFHw4gAEcjFxfKb3xuAsEjx2z1wxNbSZMcgS9GKyW3R6KwJONgtA64LTyxWm8Bvudp0M1FdJPEGopM4Fvg7G/hsptkhCfHFegv4ENwxPeXmYhxwZy7js+BeM27t9ODBMynVCLJ7RWcBMteZJtvjOYHb5lOnCLYWNEMKC59BA7covu1cANa2PXL05iGdufOzkgFqqHBOrgQVUmLEc+Mkz4Rq8O6WkNr7atNkH4M8d+SD1t/tSzt3oFql+neVs+AwEI5JaBJaxARtY2Z4mKoUqxds4UpZ0sv3zIbNoo0J4fihldQTX3XNcuNcZmcrB5LTWMdzeRuAtBk3cZHYQF6gTi3PNuDJ0nmR+4LPLoHvxQIxRgJ9iNNXqf2SYJhcvCtJiVWo85TsyFOuq7EyBPJrAdhEgE0cTq16FQXhYPJFqSfiVn0IQnPOy0LbU4BeG94QjdYNB0CiQ3QaxQqD2ebSMiNjaVaw8WaM4Z5WnzcVDsr4eGweSLa2DE3BWViaxhZFIcSTjgxNCAfelg+hznVOYoe5VqTYs1g7WtfTm3e4/WduC6p+qqAM8H4ZyrJCGpewThTDPe6H7CzX/zQ8Tm+r65HeZn+MsmxUciEWPlAVaK/VBaQBWfoG/aRL/jSZIQfep/89GjasWmbaWzeEZ2R1FOjvyJT37O9B8046SRSKVEnXWlBqbkb5XCS3qFeuE9xb9+frEknxWB5h1D/hruz2iVDEAS7+qkEz5Ot5agHJc7WCdY94Ws61sURcX5nG8UELGBAHZ3i+3VulAyT0nKNNz4K2LBHBWJcTBX1wzf+//u/j/9+//v87+9/l9Lbh/L/uyNYiTsWV2LwsjaA6MxTuzFMqmxW8Jw/+IppdX8t/Clgi1rI1SN0UC/r6tX/4lUc2VV1OQReSeCsjUpKZchw4XUcjHfw6ryCV3R8s6VXm67vp4n+lcPV9gJwmbKQEsmrJi9c2vkwrm8HFbVYNTaRGq8D91t9n5+U+aD/hNtN3HjC/nC/vUoGFSCkXP+NlRcmLUqLbiUBl4LYf1U/CCvwtd3ryCH8gUmGITAxiH1O5rnGTz7y1LuFjmnFGQ1UWuM7HwfXtWl2fPFKklYwNUpF2IL/TmaRETjQiM5SJacI+3Gv5MBU8lP5Io6gWkawpyzNEVGqOdx4YlO1dCvjbWFZWbCmeiFKPSlMKtKcMFLs/KQxtgAHi7NZNCQ32bBAW2mbHflVZ8wXKi1JKVHkW20bnYnl3dKWJeWJOiX3oKPBD6Zbi0ZvSIuWktUHB8qDR8DMMh1ZfkBL9FS9x5r0hBGLJ8pUCJv3NYH+Ae8p40mZWd5m5fhobFjQeQvqTT4VKWIYfRL0tfaXKiVl75hHReuTJEcqVlug+eOIIc4bdIydtn2K0iNZPsYWQvQio2qbO3OqAlPHDDOB7DfjGEfVF51FqqNacd6QmgFKJpMfLp5DHTv4wXlONKVXF9zTJpDV4m1sYZqJPhotcsliZM8yksKkCkzpiXt+EcRQvSQqmBS9WdWkxMTJXPSw94jqI3varCjQxTazjlMH8jTS8ilaW8014/vwA/LNa+YiFoyyx3s/KswP3O8QW1jtq45yTM/DX9a8M4voTVaO2ebvw1EooDw/yg6Y1faY+WwrdVs5Yt0hQ5EwRfYXSFxray1YvSM+kYmlpLG2/9mm1MfmbKHXr44Ih8nVKb1M537ZANUkCtdsPZ80JVKVKabVHCadaLXg+IV8i5GSwpZti0h6diTaKs9sdpUKEpd7jDUpYmHtiX33SKiO3tuydkaxA7pEc9XIQEOfWJlszj5YpL5bKeQyT7aZSBOamvSHl8xsWvgo26IP/bqk+0EJUz+gkkcvlUlyPp2kdKFtt7y5aCdks9ZJJcFp5ZWeaWKgtnXMN3ORwGLBE0PtkEIek5FY2aVssUZHtsWIvnljMVJtuVIjpZup/5VL1yPOHWWHkOMc6YySWMckczD5jUj2mlLVquFaMU8leGVaqeXis+aRRL8zm4WuBk6cyWfGMxgtr8useQEx7k/PvRoZyd9nde1GUCV84gMX8Ogu/BWezYPSR27llzQnA97oo0pYyxobYUJfsj+ysTm9zJ+S4pk0TGo9VTG0KjqYhTmALfoDZVKla2b5yhv241PxFaLJs3i05K0AAIdcGxCJZmT3ZdT7CliR7q+kur7WdQjygYtOWRL9B8E4s4LI8KpAj7bE0dg7DLOaX+MGeAi0hMMSSWZEz+RudXbZCsGYS0QqiXjH9XQbd8sCB+nIVTq7/T/FDS+zWY9q7Z2fdq1tdLb6v3hKKVDAw5gjj6o9r1wHFROdHc18MJp4SJ2Ucvu+iQ9EgkekW8VCM+psM6y+/2SBy8tNN4a3L1MzP+OLsyvESo5gS7IQOnIqMmviJBVc6zbVG1n8eXiA3j46kmvvtJlewwNDrxk4SbJOtP/TV/lIVK9ueShNbbMHfwnLTLLhbZuO79ec5XvfgRwLFK+w1r5ZWW15rVFZrE+wKqNRv5KqsLNfpGgnoUU6Y71NxEmN7MyqwqAQqoIULOw/LbuUB2+uE75gJt+kq1qY4LoxV+qR/zalupea3D5+WMeaRIn0sAI6DDWDh158fqUb4YhAxhREbUN0qyyJYkBU4V2KARXDT65gW3gRsiv7xSPYEKLwzgriWcWgPr0sbZnv7m1XHNFW6xPdGNZUdxFiUYlmXNjDVWuu7LCkX/nVkrXaJhiYktBISC2xgBXQnNEP+cptWl1eG62a7CPXrnrkTQ5BQASbEqUZWMDiZUisKyHDeLFOaJILUo5f6iDt4ZO8MlqaKLto0AmTHVVbkGuyPa1R/ywZsWRoRDoRdNMMHwYTsklMVnlAd2S0282bgMI8fiJpDh69OSL6K3qbo20KfpNMurnYGQSr/stFqZ7hYsxKlLnKAKhsmB8AIpEQ4bd/NrTLTXefsE6ChRmKWjXKVgpGoPs8GAicgKVw4K0qgDgy1A6hFq1WRat3fHF+FkU+b6H4NWpOU3KXTxrIb2qSHAb+qhm8hiSROi/9ofapjxhyKxxntPpge6KL5Z4+WBMYkAcE6+0Hd3Yh2zBsK2MV3iW0Y6cvOCroXlRb2MMJtdWx+3dkFzGh2Pe3DZ9QpSqpaR/rE1ImOrHqYYyccpiLC22amJIjRWVAherTfpQLmo6/K2pna85GrDuQPlH1Tsar8isAJbXLafSwOof4gg9RkAGm/oYpBQQiPUoyDk2BCQ1k+KILq48ErFo4WSRhHLq/y7mgw3+L85PpP6xWr6cgp9sOjYjKagOrxF148uhuaWtjet953fh1IQiEzgC+d2IgBCcUZqgTAICm2bR8oCjDLBsmg+ThyhfD+zBalsKBY1Ce54Y/t9cwfbLu9SFwEgphfopNA3yNxgyDafUM3mYTovZNgPGdd4ZFFOj1vtfFW3u7N+iHEN1HkeesDMXKPyoCDCGVMo4GCCD6PBhQ3dRZIHy0Y/3MaE5zU9mTCrwwnZojtE+qNpMSkJSpmGe0EzLyFelMJqhfFQ7a50uXxZ8pCc2wxtAKWgHoeamR2O7R+bq7IbPYItO0esdRgoTaY38hZLJ5y02oIVwoPokGIzxAMDuanQ1vn2WDQ00Rh6o5QOaCRu99fwDbQcN0XAuqkFpxT/cfz3slGRVokrNU0iqiMAJFEbKScZdmSkTUznC0U+MfwFOGdLgsewRyPKwBZYSmy6U325iUhBQNxbAC3FLKDV9VSOuQpOOukJ/GAmu/tyEbX9DgEp6dv1zoU0IqzpG6gssSjIYRVPGgU1QAQYRgIT8gEV0EXr1sqeh2I6rXjtmoCYyEDCe/PkFEi/Q48FuT29p557iN+LCwk5CK/CZ2WdAdfQZh2Z9QGrzPLSNRj5igUWzl9Vi0rCqH8G1Kp4QMLkuwMCAypdviDXyOIk0AHTM8HBYKh3b0/F+DxoNj4ZdoZfCpQVdnZarqoMaHWnMLNVcyevytGsrXQEoIbubqWYNo7NRHzdc0zvT21fWVirj7g36iy6pxogfvgHp1xH1Turbz8QyyHnXeBJicpYUctbzApwzZ1HT+FPEXMAgUZetgeGMwt4G+DHiDT2Lu+PT21fjJCAfV16a/Wu1PqOkUHSTKYhWW6PhhHUlNtWzFnA7MbY+r64vkwdpfNB2JfWgWXAvkzd42K4lN9x7Wrg4kIKgXCb4mcW595MCPJ/cTfPAMQMFWwnqwde4w8HZYJFpQwcSMhjVz4B8p6ncSCN1X4klxoIH4BN2J6taBMj6lHkAOs8JJAmXq5xsQtrPIPIIp/HG6i21xMGcFgqDXSRF0xQg14d2uy6HgKE13LSvQe52oShF5Jx1R6avyL4thhXQZHfC94oZzuPUBKFYf1VvDaxIrtV6dNGSx7DO0i1p6CzBkuAmEqyWceQY7F9+U0ObYDzoa1iKao/cOD/v6Q9gHrrr1uCeOk8fST9MG23Ul0KmM3r+Wn6Hi6WAcL7gEeaykicvgjzkjSwFsAXIR81Zx4QJ6oosVyJkCcT+4xAldCcihqvTf94HHUPXYp3REIaR4dhpQF6+FK1H0i9i7Pvh8owu3lO4PT1iuqu+DkL2Bj9+kdfGAg2TXw03iNHyobxofLE2ibjsYDPgeEQlRMR7afXbSGQcnPjI2D+sdtmuQ771dbASUsDndU7t58jrrNGRzISvwioAlHs5FA+cBE5Ccznkd8NMV6BR6ksnKLPZnMUawRDU1MZ/ib3xCdkTblHKu4blNiylH5n213yM0zubEie0o4JhzcfAy3H5qh2l17uLooBNLaO+gzonTH2uF8PQu9EyH+pjGsACTMy4cHzsPdymUSXYJOMP3yTkXqvO/lpvt0cX5ekDEu9PUfBeZODkFuAjXCaGdi6ew4qxJ8PmFfwmPpkgQjQlWqomFY6UkjmcnAtJG75EVR+NpzGpP1Ef5qUUbfowrC3zcSLX3BxgWEgEx/v9cP8H8u1Mvt9/rMDYf6sjwU1xSOPBgzFEeJLMRVFtKo5QHsUYT8ZRLCah27599EuqoC9PYjYO6aoAMHB8X1OHwEAYouHfHB3nyb2B+SnZxM/vw/bCtORjLMSy5aZoEpvgdGvlJfNPFUu/p7Z4VVK1hiI0/UTuB3ZPq4ohEbm7Mntgc1evEtknaosgZSwnDC2BdMmibpeg48X8Ixl+/8+xXdbshQXUPPvx8jT3fkELivHSmqbhblfNFShWAyQnJ3WBU6SMYSIpTDmHjdLVAdlADdz9gCplZw6mTiHqDwIsxbm9ErGusiVpg2w8Q3khKV/R9Oj8PFeF43hmW/nSd99nZzhyjCX3QOZkkB6BsH4H866WGyv9E0hVAzPYah2tkRfQZMmP2rinfOeQalge0ovhduBjJs9a1GBwReerceify49ctOh5/65ATYuMsAkVltmvTLBk4oHpdl6i+p8DoNj4Fb2vhdFYer2JSEilEwPd5n5zNoGBXEjreg/wh2NFnNRaIUHSOXa4eJRwygZoX6vnWnqVdCRT1ARxeFrNBJ+tsdooMwqnYhE7zIxnD8pZH+P0Nu1wWxCPTADfNWmqx626IBJJq6NeapcGeOmbtXvl0TeWG0Y7OGGV4+EHTtNBIT5Wd0Bujl7inXgZgfXTM5efD3qDTJ54O9v3Bkv+tdIRlq1kXcVD0BEMirmFxglNPt5pedb1AnxuCYMChUykwsTIWqT23XDpvTiKEru1cTcEMeniB+HQDehxPXNmkotFdwUPnilB/u4Nx5Xc6l8J9jH1EgKZUUt8t8cyoZleDBEt8oibDmJRAoMKJ5Oe9CSWS5ZMEJvacsGVdXDWjp/Ype5x0p9PXB2PAwt2LRD3d+ftNgpuyvxlP8pB84oB1i73vAVpwyrmXW72hfW6Dzn9Jkj4++0VQ4d0KSx1AsDA4OtXXDo63/w+GD+zC7w5SJaxsmnlYRQ4dgdjA7tTl2KNLnpJ+mvkoDxtt1a4oPaX3EVqj96o9sRKBQqU7ZOiupeAIyLMD+Y3YwHx30XWHB5CQiw7q3mj1EDlP2eBsZbz79ayUMbyHQ7s8gu4Lgip1LiGJj7NQj905/+rgUYKAA5qdrlHKIknWmqfuR+PB8RdBkDg/NgnlT89G72h2NvySnj7UyBwD+mi/IWs1xWbxuVwUIVXun5cMqBtFbrccI+DILjsVQg6eeq0itiRfedn89CvyFtpkxaauEvSANuZmB1p8FGPbU94J9medwsZ9HkUYjmI7OH5HuxendLbxTaYrPuIfE2ffXFKhoNBUp33HsFAXmCV/Vxpq5AYgFoRr5Ay93ZLRlgaIPjhZjXZZChT+aE5iWAXMX0oSFQEtwjiuhQQItTQX5IYrKfKB+queTNplR1Hoflo5/I6aPPmACwQCE2jTOYo5Dz1cs7Sod0KTG/3kEDGk3kUaUCON19xSJCab3kNpWZhSWkO8l+SpW70Wn3g0ciOIJO5JXma6dbos6jyisuxXwUUhj2+1uGhcvuliKtWwsUTw4gi1c/diEEpZHoKoxTBeMDmhPhKTx7TXWRakV8imJR355DcIHkR9IREHxohP4TbyR5LtFU24umRPRmEYHbpe1LghyxPx7YgUHjNbbQFRQhh4KeU1EabXx8FS3JAxp2rwRDoeWkJgWRUSKw6gGP5U2PuO9V4ZuiKXGGzFQuRuf+tkSSsbBtRJKhCi3ENuLlXhPbjTKD4djXVnfXFds6Zb+1XiUrRfyayGxJq1+SYBEfbKlgjiSmk0orgTqzSS+DZ5rTqsJbttiNtp+KMqGE2AHGFw6jQqM5vD6vMptmXV9OAjq49Uf/Lx9Opam+Hn5O9p8qoBBAQixzQZ4eNVkO9sPzJAMyR1y4/RCQQ1s0pV5KAU5sKLw3tkcFbI/JqrjCsK4Mw+W8aod4lioYuawUiCyVWBE/qPaFi5bnkgpfu/ae47174rI1fqQoTbW0HrU6FAejq7ByM0V4zkZTg02/YJK2N7hUQRCeZ4BIgSEqgD8XsjzG6LIsSbuHoIdz/LhFzbNn1clci1NHWJ0/6/O8HJMdIpEZbqi1RrrFfoo/rI/7ufm2MPG5lUI0IYJ4MAiHRTSOFJ2oTverFHYXThkYFIoyFx6rMYFgaOKM4xNWdlOnIcKb/suptptgTOTdVIf4YgdaAjJnIAm4qNNHNQqqAzvi53GkyRCEoseUBrHohZsjUbkR8gfKtc/+Oa72lwxJ8Mq6HDfDATbfbJhzeIuFQJSiw1uZprHlzUf90WgqG76zO0eCB1WdPv1IT6sNxxh91GEL2YpgC97ikFHyoaH92ndwduqZ6IYjkg20DX33MWdoZk7QkcKUCgisIYslOaaLyvIIqRKWQj16jE1DlQWJJaPopWTJjXfixEjRJJo8g4++wuQjbq+WVYjsqCuNIQW3YjnxKe2M5ZKEqq+cX7ZVgnkbsU3RWIyXA1rxv4kGersYJjD//auldXGmcEbcfTeF16Y1708FB1HIfmWv6dSFi6oD4E+RIjCsEZ+kY7dKnwReJJw3xCjKvi3kGN42rvyhUlIz0Bp+fNSV5xwFiuBzG296e5s/oHoFtUyUplmPulIPl+e1CQIQVtjlzLzzzbV+D/OVQtYzo5ixtMi5BmHuG4N/uKfJk5UIREp7+12oZlKtPBomXSzAY0KgtbPzzZoHQxujnREUgBU+O/jKKhgxVhRPtbqyHiUaRwRpHv7pgRPyUrnE7fYkVblGmfTY28tFCvlILC04Tz3ivkNWVazA+OsYrxvRM/hiNn8Fc4bQBeUZABGx5S/xFf9Lbbmk298X7iFg2yeimvsQqqJ+hYbt6uq+Zf9jC+Jcwiccd61NKQtFvGWrgJiHB5lwi6fR8KzYS7EaEHf/ka9EC7H8D+WEa3TEACHBkNSj/cXxFeq4RllC+fUFm2xtstYLL2nos1DfzsC9vqDDdRVcPA3Ho95aEQHvExVThXPqym65llkKlfRXbPTRiDepdylHjmV9YTWAEjlD9DdQnCem7Aj/ml58On366392214B5zrmQz/9ySG2mFqEwjq5sFl5tYJPw5hNz8lyZPUTsr5E0F2C9VMPnZckWP7+mbwp/BiN7f4kf7vtGnZF2JGvjK/sDX1RtcFY5oPQnE4lIAYV49U3C9SP0LCY/9i/WIFK9ORjzM9kG/KGrAuwFmgdEpdLaiqQNpCTGZVuAO65afkY1h33hrqyLjZy92JK3/twdj9pafFcwfXONmPQWldPlMe7jlP24Js0v9m8bIJ9TgS2IuRvE9ZVRaCwSJYOtAfL5H/YS4FfzKWKbek+GFulheyKtDNlBtrdmr+KU+ibHTdalzFUmMfxw3f36x+3cQbJLItSilW9cuvZEMjKw987jykZRlsH/UI+HlKfo2tLwemBEeBFtmxF2xmItA/dAIfQ+rXnm88dqvXa+GapOYVt/2waFimXFx3TC2MUiOi5/Ml+3rj/YU6Ihx2hXgiDXFsUeQkRAD6wF3SCPi2flk7XwKAA4zboqynuELD312EJ88lmDEVOMa1W/K/a8tGylZRMrMoILyoMQzzbDJHNZrhH77L9qSC42HVmKiZ5S0016UTp83gOhCwz9XItK9fgXfK3F5d7nZCBUekoLxrutQaPHa16Rjsa0gTrzyjqTnmcIcrxg6X6dkKiucudc0DD5W4pJPf0vuDW8r5/uw24YfMuxFRpD2ovT2mFX79xH6Jf+MVdv2TYqR6/955QgVPe3JCD/WjAYcLA9tpXgFiEjge2J5ljeI/iUzg91KQuHkII4mmHZxC3XQORLAC6G7uFn5LOmlnXkjFdoO976moNTxElS8HdxWoPAkjjocDR136m2l+f5t6xaaNgdodOvTu0rievnhNAB79WNrVs6EsPgkgfahF9gSFzzAd+rJSraw5Mllit7vUP5YxA843lUpu6/5jAR0RvH4rRXkSg3nE+O5GFyfe+L0s5r3k05FyghSFnKo4TTgs07qj4nTLqOYj6qaW9knJTDkF5OFMYbmCP+8H16Ty482OjvERV6OFyw043L9w3hoJi408sR+SGo1WviXUu8d7qS+ehKjpKwxeCthsm2LBFSFeetx0x4AaKPxtp3CxdWqCsLrB1s/j5TAhc1jNZsXWl6tjo/WDoewxzg8T8NnhZ1niUwL/nhfygLanCnRwaFGDyLw+sfZhyZ1UtYTp8TYB6dE7R3VsKKH95CUxJ8u8N+9u2/9HUNKHW3x3w5GQrfOPafk2w5qZq8MaHT0ebeY3wIsp3rN9lrpIsW9c1ws3VNV+JwNz0Lo9+V7zZr6GD56We6gWVIvtmam5GPPkVAbr74r6SwhuL+TRXtW/0pgyX16VNl4/EAD50TnUPuwrW6OcUO2VlWXS0inq872kk7GUlW6o/ozFKq+Sip6LcTtSDfDrPTcCHhx75H8BeRon+KG2wRwzfDgWhALmiWOMO6h3pm1UCZEPEjScyk7tdLx6WrdA2N1QTPENvNnhCQjW6kl057/qv7IwRryHrZBCwVSbLLnFRiHdTwk8mlYixFt1slEcPD7FVht13HyqVeyD55HOXrh2ElAxJyinGeoFzwKA91zfrdLvDxJSjzmImfvTisreI25EDcVfGsmxLVbfU8PGe/7NmWWKjXcdTJ11jAlVIY/Bv/mcxg/Q10vCHwKG1GW/XbJq5nxDhyLqiorn7Wd7VEVL8UgVzpHMjQ+Z8DUgSukiVwWAKkeTlVVeZ7t1DGnCgJVIdBPZAEK5f8CDyDNo7tK4/5DBjdD5MPV86TaEhGsLVFPQSI68KlBYy84FievdU9gWh6XZrugvtCZmi9vfd6db6V7FmoEcRHnG36VZH8N4aZaldq9zZawt1uBFgxYYx+Gs/qW1jwANeFy+LCoymyM6zgG7j8bGzUyLhvrbJkTYAEdICEb4kMKusKT9V3eIwMLsjdUdgijMc+7iKrr+TxrVWG0U+W95SGrxnxGrE4eaJFfgvAjUM4SAy8UaRwE9j6ZQH5qYAWGtXByvDiLSDfOD0yFA3UCMKSyQ30fyy1mIRg4ZcgZHLNHWl+c9SeijOvbOJxoQy7lTN2r3Y8p6ovxvUY74aOYbuVezryqXA6U+fcp6wSV9X5/OZKP18tB56Ua0gMyxJI7XyNT7IrqN8GsB9rL/kP5KMrjXxgqKLDa+V5OCH6a5hmOWemMUsea9vQl9t5Oce76PrTyTv50ExOqngE3PHPfSL//AItPdB7kGnyTRhVUUFNdJJ2z7RtktZwgmQzhBG/G7QsjZmJfCE7k75EmdIKH7xlnmDrNM/XbTT6FzldcH/rcRGxlPrv4qDScqE7JSmQABJWqRT/TUcJSwoQM+1jvDigvrjjH8oeK2in1S+/yO1j8xAws/T5u0VnIvAPqaE1atNuN0cuRliLcH2j0nTL4JpcR7w9Qya0JoaHgsOiALLCCzRkl1UUESz+ze/gIXHGtDwgYrK6pCFKJ1webSDog4zTlPkgXZqxlQDiYMjhDpwTtBW2WxthWbov9dt2X9XFLFmcF+eEc1UaQ74gqZiZsdj63pH1qcv3Vy8JYciogIVKsJ8Yy3J9w/GhjWVSQAmrS0BPOWK+RKV+0lWqXgYMnIFwpcZVD7zPSp547i9HlflB8gVnSTGmmq1ClO081OW/UH11pEQMfkEdDFzjLC1Cdo/BdL3s7cXb8J++Hzz1rhOUVZFIPehRiZ8VYu6+7Er7j5PSZu9g/GBdmNzJmyCD9wiswj9BZw+T3iBrg81re36ihMLjoVLoWc+62a1U/7qVX5CpvTVF7rocSAKwv4cBVqZm7lLDS/qoXs4fMs/VQi6BtVbNA3uSzKpQfjH1o3x4LrvkOn40zhm6hjduDglzJUwA0POabgdXIndp9fzhOo23Pe+Rk9GSLX0d71Poqry8NQDTzNlsa+JTNG9+UrEf+ngxCjGEsDCc0bz+udVRyHQI1jmEO3S+IOQycEq7XwB6z3wfMfa73m8PVRp+iOgtZfeSBl01xn03vMaQJkyj7vnhGCklsCWVRUl4y+5oNUzQ63B2dbjDF3vikd/3RUMifPYnX5Glfuk2FsV/7RqjI9yKTbE8wJY+74p7qXO8+dIYgjtLD/N8TJtRh04N9tXJA4H59IkMmLElgvr0Q5OCeVfdAt+5hkh4pQgfRMHpL74XatLQpPiOyHRs/OdmHtBf8nOZcxVKzdGclIN16lE7kJ+pVMjspOI+5+TqLRO6m0ZpNXJoZRv9MPDRcAfJUtNZHyig/s2wwReakFgPPJwCQmu1I30/tcBbji+Na53i1W1N+BqoY7Zxo+U/M9XyJ4Ok2SSkBtoOrwuhAY3a03Eu6l8wFdIG1cN+e8hopTkiKF093KuH/BcB39rMiGDLn6XVhGKEaaT/vqb/lufuAdpGExevF1+J9itkFhCfymWr9vGb3BTK4j598zRH7+e+MU9maruZqb0pkGxRDRE1CD4Z8LV4vhgPidk5w2Bq816g3nHw1//j3JStz7NR9HIWELO8TMn3QrP/zZp//+Dv9p429/ogv+GATR+n/UdF+ns9xNkXZQJXY4t9jMkJNUFygAtzndXwjss+yWH9HAnLQQfhAskdZS2l01HLWv7L7us5uTH409pqitvfSOQg/c+Zt7k879P3K9+WV68n7+3cZfuRd/dDPP/03rn+d+/nBvWfgDlt8+LzjqJ/vx3CnNOwiXhho778C96iD+1TBvRZYeP+EH81LE0vVwOOrmCLB3iKzI1x+vJEsrPH4uF0UB4TJ4X3uDfOCo3PYpYe0MF4bouh0DQ/l43fxUF7Y+dpWuvTSffB0yO2UQUETI/LwCZE3BvnevJ7c9zUlY3H58xzke6DNFDQG8n0WtDN4LAYN4nogKav1ezOfK/z+t6tsCTp+dhx4ymjWuCJk1dEUifDP+HyS4iP/Vg9B2jTo9L4NbiBuDS4nuuHW6H+JDQn2JtqRKGkEQPEYE7uzazXIkcxIAqUq1esasZBETlEZY7y7Jo+RoV/IsjY9eIMkUvr42Hc0xqtsavZvhz1OLwSxMOTuqzlhb0WbdOwBH9EYiyBjatz40bUxTHbiWxqJ0uma19qhPruvcWJlbiSSH48OLDDpaHPszvyct41ZfTu10+vjox6kOqK6v0K/gEPphEvMl/vwSv+A4Hhm36JSP9IXTyCZDm4kKsqD5ay8b1Sad/vaiyO5N/sDfEV6Z4q95E+yfjxpqBoBETW2C7xl4pIO2bDODDFurUPwE7EWC2Uplq+AHmBHvir2PSgkR12/Ry65O0aZtQPeXi9mTlF/Wj5GQ+vFkYyhXsLTjrBSP9hwk4GPqDP5rBn5/l8b0mLRAvRSzXHc293bs3s8EsdE3m2exxidWVB4joHR+S+dz5/W+v00K3TqN14CDBth8eWcsTbiwXPsygHdGid0PEdy6HHm2v/IUuV5RVapYmzGsX90mpnIdNGcOOq64Dbc5GUbYpD9M7S+6cLY//QmjxFLP5cuTFRm3vA5rkFZroFnO3bjHF35uU3s8mvL7Tp9nyTc4mymTJ5sLIp7umSnGkO23faehtz3mmTS7fbVx5rP7x3HXIjRNeq/A3xCs9JNB08c9S9BF2O3bOur0ItslFxXgRPdaapBIi4dRpKGxVz7ir69t/bc9qTxjvtOyGOfiLGDhR4fYywHv1WdOplxIV87TpLBy3Wc0QP0P9s4G7FBNOdITS/tep3o3h1TEa5XDDii7fWtqRzUEReP2fbxz7bHWWJdbIOxOUJZtItNZpTFRfj6vm9sYjRxQVO+WTdiOhdPeTJ+8YirPvoeL88l5iLYOHd3b/Imkq+1ZN1El3UikhftuteEYxf1Wujof8Pr4ICTu5ezZyZ4tHQMxlzUHLYO2VMOoNMGL/20S5i2o2obfk+8qqdR7xzbRDbgU0lnuIgz4LelQ5XS7xbLuSQtNS95v3ZUOdaUx/Qd8qxCt6xf2E62yb/HukLO6RyorV8KgYl5YNc75y+KvefrxY+lc/64y9kvWP0a0bDz/rojq+RWjO06WeruWqNFU7r3HPIcLWRql8ICZsz2Ls/qOm/CLn6++X+Qf7mGspYCrZod/lpl6Rw4xN/yuq8gqV4B6aHk1hVE1SfILxWu5gvXqbfARYQpspcxKp1F/c8XOPzkZvmoSw+vEqBLdrq1fr3wAPv5NnM9i8F+jdAuxkP5Z71c6uhK3enlnGymr7UsWZKC12qgUiG8XXGQ9mxnqz4GSIlybF9eXmbqj2sHX+a1jf0gRoONHRdRSrIq03Ty89eQ1GbV/Bk+du4+V15zls+vvERvZ4E7ZbnxWTVjDjb4o/k8jlw44pTIrUGxxuJvBeO+heuhOjpFsO6lVJ/aXnJDa/bM0Ql1cLbXE/Pbv3EZ3vj3iVrB5irjupZTzlnv677NrI9UNYNqbPgp/HZXS+lJmk87wec+7YOxTDo2aw2l3NfDr34VNlvqWJBknuK7oSlZ6/T10zuOoPZOeoIk81N+sL843WJ2Q4Z0fZ3scsqC/JV2fuhWi1jGURSKZV637lf53Xnnx16/vKEXY89aVJ0fv91jGdfG+G4+sniwHes4hS+udOr4RfhFhG/F5gUG35QaU+McuLmclb5ZWmR+sG5V6nf+PxYzlrnFGxpZaK8eqqVo0NfmAWoGfXDiT/FnUbWvzGDOTr8aktOZWg4BYvz5YH12ZbfCcGtNk+dDAZNGWvHov+PIOnY9Prjg8h/wLRrT69suaMVZ5bNuK00lSVpnqSX1NON/81FoP92rYndionwgOiA8WMf4vc8l15KqEEG4yAm2+WAN5Brfu1sq9suWYqgoajgOYt/JCk1gC8wPkK+XKCtRX6TAtgvrnuBgNRmn6I8lVDipOVB9kX6Oxkp4ZKyd1M6Gj8/v2U7k+YQBL95Kb9PQENucJb0JlW3b5tObN7m/Z1j1ev388d7o15zgXsI9CikAGAViR6lkJv7nb4Ak40M2G8TJ447kN+pvfHiOFjSUSP6PM+QfbAywKJCBaxSVxpizHseZUyUBhq59vFwrkyGoRiHbo0apweEZeSLuNiQ+HAekOnarFg00dZNXaPeoHPTRR0FmEyqYExOVaaaO8c0uFUh7U4e/UxdBmthlBDgg257Q33j1hA7HTxSeTTSuVnPZbgW1nodwmG16aKBDKxEetv7D9OjO0JhrbJTnoe+kcGoDJazFSO8/fUN9Jy/g4XK5PUkw2dgPDGpJqBfhe7GA+cjzfE/EGsMM+FV9nj9IAhrSfT/J3QE5TEIYyk5UjsI6ZZcCPr6A8FZUF4g9nnpVmjX90MLSQysIPD0nFzqwCcSJmIb5mYv2Cmk+C1MDFkZQyCBq4c/Yai9LJ6xYkGS/x2s5/frIW2vmG2Wrv0APpCdgCA9snFvfpe8uc0OwdRs4G9973PGEBnQB5qKrCQ6m6X/H7NInZ7y/1674/ZXOVp7OeuCRk8JFS516VHrnH1HkIUIlTIljjHaQtEtkJtosYul77cVwjk3gW1Ajaa6zWeyHGLlpk3VHE2VFzT2yI/EvlGUSz2H9zYE1s4nsKMtMqNyKNtL/59CpFJki5Fou6VXGm8vWATEPwrUVOLvoA8jLuwOzVBCgHB2Cr5V6OwEWtJEKokJkfc87h+sNHTvMb0KVTp5284QTPupoWvQVUwUeogZR3kBMESYo0mfukewRVPKh5+rzLQb7HKjFFIgWhj1w3yN/qCNoPI8XFiUgBNT1hCHBsAz8L7Oyt8wQWUFj92ONn/APyJFg8hzueqoJdNj57ROrFbffuS/XxrSXLTRgj5uxZjpgQYceeMc2wJrahReSKpm3QjHfqExTLAB2ipVumE8pqcZv8LYXQiPHHsgb5BMW8zM5pvQit+mQx8XGaVDcfVbLyMTlY8xcfmm/RSAT/H09UQol5gIz7rESDmnrQ4bURIB4iRXMDQwxgex1GgtDxKp2HayIkR+E/aDmCttNm2C6lytWdfOVzD6X2SpDWjQDlMRvAp1symWv4my1bPCD+E1EmGnMGWhNwmycJnDV2WrQNxO45ukEb08AAffizYKVULp15I4vbNK5DzWwCSUADfmKhfGSUqii1L2UsE8rB7mLuHuUJZOx4+WiizHBJ/hwboaBzhpNOVvgFTf5cJsHef7L1HCI9dOUUbb+YxUJWn6dYOLz+THi91kzY5dtO5c+grX7v0jEbsuoOGnoIreDIg/sFMyG+TyCLIcAWd1IZ1UNFxE8Uie13ucm40U2fcxC0u3WLvLOxwu+F7MWUsHsdtFQZ7W+nlfCASiAKyh8rnP3EyDByvtJb6Kax6/HkLzT9SyEyTMVM1zPtM0MJY14DmsWh4MgD15Ea9Hd00AdkTZ0EiG5NAGuIBzQJJ0JR0na+OB7lQA6UKxMfihIQ7GCCnVz694QvykWXTxpS2soDu+smru1UdIxSvAszBFD1c8c6ZOobA8bJiJIvuycgIXBQIXWwhyTgZDQxJTRXgEwRNAawGSXO0a1DKjdihLVNp/taE/xYhsgwe+VpKEEB4LlraQyE84gEihxCnbfoyOuJIEXy2FIYw+JjRusybKlU2g/vhTSGTydvCvXhYBdtAXtS2v7LkHtmXh/8fly1do8FI/D0f8UbzVb5h+KRhMGSAmR2mhi0YG/uj7wgxcfzCrMvdjitUIpXDX8ae2JcF/36qUWIMwN6JsjaRGNj+jEteGDcFyTUb8X/NHSucKMJp7pduxtD6KuxVlyxxwaeiC1FbGBESO84lbyrAugYxdl+2N8/6AgWpo/IeoAOcsG35IA/b3AuSyoa55L7llBLlaWlEWvuCFd8f8NfcTUgzJv6CbB+6ohWwodlk9nGWFpBAOaz5uEW5xBvmjnHFeDsb0mXwayj3mdYq5gxxNf3H3/tnCgHwjSrpSgVxLmiTtuszdRUFIsn6LiMPjL808vL1uQhDbM7aA43mISXReqjSskynIRcHCJ9qeFopJfx9tqyUoGbSwJex/0aDE3plBPGtNBYgWbdLom3+Q/bjdizR2/AS/c/dH/d3G7pyl1qDXgtOFtEqidwLqxPYtrNEveasWq3vPUUtqTeu8gpov4bdOQRI2kneFvRNMrShyVeEupK1PoLDPMSfWMIJcs267mGB8X9CehQCF0gIyhpP10mbyM7lwW1e6TGvHBV1sg/UyTghHPGRqMyaebC6pbB1WKNCQtlai1GGvmq9zUKaUzLaXsXEBYtHxmFbEZ2kJhR164LhWW2Tlp1dhsGE7ZgIWRBOx3Zcu2DxgH+G83WTPceKG0TgQKKiiNNOlWgvqNEbnrk6fVD+AqRam2OguZb0YWSTX88N+i/ELSxbaUUpPx4vJUzYg/WonSeA8xUK6u7DPHgpqWpEe6D4cXg5uK9FIYVba47V/nb+wyOtk+zG8RrS4EA0ouwa04iByRLSvoJA2FzaobbZtXnq8GdbfqEp5I2dpfpj59TCVif6+E75p665faiX8gS213RqBxTZqfHP46nF6NSenOneuT+vgbLUbdTH2/t0REFXZJOEB6DHvx6N6g9956CYrY/AYcm9gELJXYkrSi+0F0geKDZgOCIYkLU/+GOW5aGj8mvLFgtFH5+XC8hvAE3CvHRfl4ofM/Qwk4x2A+R+nyc9gNu/9Tem7XW4XRnyRymf52z09cTOdr+PG6+P/Vb4QiXlwauc5WB1z3o+IJjlbxI8MyWtSzT+k4sKVbhF3xa+vDts3NxXa87iiu+xRH9cAprnOL2h6vV54iQRXuOAj1s8nLFK8gZ70ThIQcWdF19/2xaJmT0efrkNDkWbpAQPdo92Z8+Hn/aLjbOzB9AI/k12fPs9HhUNDJ1u6ax2VxD3R6PywN7BrLJ26z6s3QoMp76qzzwetrDABKSGkfW5PwS1GvYNUbK6uRqxfyVGNyFB0E+OugMM8kKwmJmupuRWO8XkXXXQECyRVw9UyIrtCtcc4oNqXqr7AURBmKn6Khz3eBN96LwIJrAGP9mr/59uTOSx631suyT+QujDd4beUFpZ0kJEEnjlP+X/Kr2kCKhnENTg4BsMTOmMqlj2WMFLRUlVG0fzdCBgUta9odrJfpVdFomTi6ak0tFjXTcdqqvWBAzjY6hVrH9sbt3Z9gn+AVDpTcQImefbB4edirjzrsNievve4ZT4EUZWV3TxEsIW+9MT/RJoKfZZYSRGfC1CwPG/9rdMOM8qR/LUYvw5f/emUSoD7YSFuOoqchdUg2UePd1eCtFSKgxLSZ764oy4lvRCIH6bowPxZWwxNFctksLeil47pfevcBipkkBIc4ngZG+kxGZ71a72KQ7VaZ6MZOZkQJZXM6kb/Ac0/XkJx8dvyfJcWbI3zONEaEPIW8GbkYjsZcwy+eMoKrYjDmvEEixHzkCSCRPRzhOfJZuLdcbx19EL23MA8rnjTZZ787FGMnkqnpuzB5/90w1gtUSRaWcb0eta8198VEeZMUSfIhyuc4/nywFQ9uqn7jdqXh+5wwv+RK9XouNPbYdoEelNGo34KyySwigsrfCe0v/PlWPvQvQg8R0KgHO18mTVThhQrlbEQ0Kp/JxPdjHyR7E1QPw/ut0r+HDDG7BwZFm9IqEUZRpv2WpzlMkOemeLcAt5CsrzskLGaVOAxyySzZV/D2EY7ydNZMf8e8VhHcKGHAWNszf1EOq8fNstijMY4JXyATwTdncFFqcNDfDo+mWFvxJJpc4sEZtjXyBdoFcxbUmniCoKq5jydUHNjYJxMqN1KzYV62MugcELVhS3Bnd+TLLOh7dws/zSXWzxEb4Nj4aFun5x4kDWLK5TUF/yCXB/cZYvI9kPgVsG2jShtXkxfgT+xzjJofXqPEnIXIQ1lnIdmVzBOM90EXvJUW6a0nZ/7XjJGl8ToO3H/fdxnxmTNKBZxnkpXLVgLXCZywGT3YyS75w/PAH5I/jMuRspej8xZObU9kREbRA+kqjmKRFaKGWAmFQspC+QLbKPf0RaK3OXvBSWqo46p70ws/eZpu6jCtZUgQy6r4tHMPUdAgWGGUYNbuv/1a6K+MVFsd3T183+T8capSo6m0+Sh57fEeG/95dykGJBQMj09DSW2bY0mUonDy9a8trLnnL5B5LW3Nl8rJZNysO8Zb+80zXxqUGFpud3Qzwb7bf+8mq6x0TAnJU9pDQR9YQmZhlna2xuxJt0aCO/f1SU8gblOrbIyMsxTlVUW69VJPzYU2HlRXcqE2lLLxnObZuz2tT9CivfTAUYfmzJlt/lOPgsR6VN64/xQd4Jlk/RV7UKVv2Gx/AWsmTAuCWKhdwC+4HmKEKYZh2Xis4KsUR1BeObs1c13wqFRnocdmuheaTV30gvVXZcouzHKK5zwrN52jXJEuX6dGx3BCpV/++4f3hyaW/cQJLFKqasjsMuO3B3WlMq2gyYfdK1e7L2pO/tRye2mwzwZPfdUMrl5wdLqdd2Kv/wVtnpyWYhd49L6rsOV+8HXPrWH2Kup89l2tz6bf80iYSd+V4LROSOHeamvexR524q4r43rTmtFzQvArpvWfLYFZrbFspBsXNUqqenjxNNsFXatZvlIhk7teUPfK+YL32F8McTnjv0BZNppb+vshoCrtLXjIWq3EJXpVXIlG6ZNL0dh6qEm2WMwDjD3LfOfkGh1/czYc/0qhiD2ozNnH4882MVVt3JbVFkbwowNCO3KL5IoYW5wlVeGCViOuv1svZx7FbzxKzA4zGqBlRRaRWCobXaVq4yYCWbZf8eiJwt3OY+MFiSJengcFP2t0JMfzOiJ7cECvpx7neg1Rc5x+7myPJOXt2FohVRyXtD+/rDoTOyGYInJelZMjolecVHUhUNqvdZWg2J2t0jPmiLFeRD/8fOT4o+NGILb+TufCo9ceBBm3JLVn+MO2675n7qiEX/6W+188cYg3Zn5NSTjgOKfWFSAANa6raCxSoVU851oJLY11WIoYK0du0ec5E4tCnAPoKh71riTsjVIp3gKvBbEYQiNYrmH22oLQWA2AdwMnID6PX9b58dR2QKo4qag1D1Z+L/FwEKTR7osOZPWECPJIHQqPUsM5i/CH5YupVPfFA5pHUBcsesh8eO5YhyWnaVRPZn/BmdXVumZWPxMP5e28zm2uqHgFoT9CymHYNNrzrrjlXZM06HnzDxYNlI5b/QosxLmmrqDFqmogQdqk0WLkUceoAvQxHgkIyvWU69BPFr24VB6+lx75Rna6dGtrmOxDnvBojvi1/4dHjVeg8owofPe1cOnxU1ioh016s/Vudv9mhV9f35At+Sh28h1bpp8xhr09+vf47Elx3Ms6hyp6QvB3t0vnLbOhwo660cp7K0vvepabK7YJfxEWWfrC2YzJfYOjygPwfwd/1amTqa0hZ5ueebhWYVMubRTwIjj+0Oq0ohU3zfRfuL8gt59XsHdwKtxTQQ4Y2qz6gisxnm2UdlmpEkgOsZz7iEk6QOt8BuPwr+NR01LTqXmJo1C76o1N274twJvl+I069TiLpenK/miRxhyY8jvYV6W1WuSwhH9q7kuwnJMtm7IWcqs7HsnyHSqWXLSpYtZGaR1V3t0gauninFPZGtWskF65rtti48UV9uV9KM8kfDYs0pgB00S+TlzTXV6P8mxq15b9En8sz3jWSszcifZa/NuufPNnNTb031pptt0+sRSH/7UG8pzbsgtt3OG3ut7B9JzDMt2mTZuyRNIV8D54TuTrpNcHtgmMlYJeiY9XS83NYJicjRjtJSf9BZLsQv629QdDsKQhTK5CnXhpk7vMNkHzPhm0ExW/VCGApHfPyBagtZQTQmPHx7g5IXXsrQDPzIVhv2LB6Ih138iSDww1JNHrDvzUxvp73MsQBVhW8EbrReaVUcLB1R3PUXyaYG4HpJUcLVxMgDxcPkVRQpL7VTAGabDzbKcvg12t5P8TSGQkrj/gOrpnbiDHwluA73xbXts/L7u468cRWSWRtgTwlQnA47EKg0OiZDgFxAKQQUcsbGomITgeXUAAyKe03eA7Mp4gnyKQmm0LXJtEk6ddksMJCuxDmmHzmVhO+XaN2A54MIh3niw5CF7PwiXFZrnA8wOdeHLvvhdoqIDG9PDI7UnWWHq526T8y6ixJPhkuVKZnoUruOpUgOOp3iIKBjk+yi1vHo5cItHXb1PIKzGaZlRS0g5d3MV2pD8FQdGYLZ73aae/eEIUePMc4NFz8pIUfLCrrF4jVWH5gQneN3S8vANBmUXrEcKGn6hIUN95y1vpsvLwbGpzV9L0ZKTan6TDXM05236uLJcIEMKVAxKNT0K8WljuwNny3BNQRfzovA85beI9zr1AGNYnYCVkR1aGngWURUrgqR+gRrQhxW81l3CHevjvGEPzPMTxdsIfB9dfGRbZU0cg/1mcubtECX4tvaedmNAvTxCJtc2QaoUalGfENCGK7IS/O8CRpdOVca8EWCRwv2sSWE8CJPW5PCugjCXPd3h6U60cPD+bdhtXZuYB6stcoveE7Sm5MM2yvfUHXFSW7KzLmi7/EeEWL0wqcOH9MOSKjhCHHmw+JGLcYE/7SBZQCRggox0ZZTAxrlzNNXYXL5fNIjkdT4YMqVUz6p8YDt049v4OXGdg3qTrtLBUXOZf7ahPlZAY/O+7Sp0bvGSHdyQ8B1LOsplqMb9Se8VAE7gIdSZvxbRSrfl+Lk5Qaqi5QJceqjitdErcHXg/3MryljPSIAMaaloFm1cVwBJ8DNmkDqoGROSHFetrgjQ5CahuKkdH5pRPigMrgTtlFI8ufJPJSUlGgTjbBSvpRc0zypiUn6U5KZqcRoyrtzhmJ7/caeZkmVRwJQeLOG8LY6vP5ChpKhc8Js0El+n6FXqbx9ItdtLtYP92kKfaTLtCi8StLZdENJa9Ex1nOoz1kQ7qxoiZFKRyLf4O4CHRT0T/0W9F8epNKVoeyxUXhy3sQMMsJjQJEyMOjmOhMFgOmmlscV4eFi1CldU92yjwleirEKPW3bPAuEhRZV7JsKV3Lr5cETAiFuX5Nw5UlF7d2HZ96Bh0sgFIL5KGaKSoVYVlvdKpZJVP5+NZ7xDEkQhmDgsDKciazJCXJ6ZN2B3FY2f6VZyGl/t4aunGIAk/BHaS+i+SpdRfnB/OktOvyjinWNfM9Ksr6WwtCa1hCmeRI6icpFM4o8quCLsikU0tMoZI/9EqXRMpKGaWzofl4nQuVQm17d5fU5qXCQeCDqVaL9XJ9qJ08n3G3EFZS28SHEb3cdRBdtO0YcTzil3QknNKEe/smQ1fTb0XbpyNB5xAeuIlf+5KWlEY0DqJbsnzJlQxJPOVyHiKMx5Xu9FcEv1Fbg6Fhm4t+Jyy5JC1W3YO8dYLsO0PXPbxodBgttTbH3rt9Cp1lJIk2r3O1Zqu94eRbnIz2f50lWolYzuKsj4PMok4abHLO8NAC884hiXx5Fy5pWKO0bWL7uEGXaJCtznhP67SlQ4xjWIfgq6EpZ28QMtuZK7JC0RGbl9nA4XtFLug/NLMoH1pGt9IonAJqcEDLyH6TDROcbsmGPaGIxMo41IUAnQVPMPGByp4mOmh9ZQMkBAcksUK55LsZj7E5z5XuZoyWCKu6nHmDq22xI/9Z8YdxJy4kWpD16jLVrpwGLWfyOD0Wd+cBzFBxVaGv7S5k9qwh/5t/LQEXsRqI3Q9Rm3QIoaZW9GlsDaKOUyykyWuhNOprSEi0s1G4rgoiX1V743EELti+pJu5og6X0g6oTynUqlhH9k6ezyRi05NGZHz0nvp3HOJr7ebrAUFrDjbkFBObEvdQWkkUbL0pEvMU46X58vF9j9F3j6kpyetNUBItrEubW9ZvMPM4qNqLlsSBJqOH3XbNwv/cXDXNxN8iFLzUhteisYY+RlHYOuP29/Cb+L+xv+35Rv7xudnZ6ohK4cMPfCG8KI7dNmjNk/H4e84pOxn/sZHK9psfvj8ncA8qJz7O8xqbxESDivGJOZzF7o5PJLQ7g34qAWoyuA+x3btU98LT6ZyGyceIXjrqob2CAVql4VOTQPUQYvHV/g4zAuCZGvYQBtf0wmd5lilrvuEn1BXLny01B4h4SMDlYsnNpm9d7m9h578ufpef9Z4WplqWQvqo52fyUA7J24eZD5av6SyGIV9kpmHNqyvdfzcpEMw97BvknV2fq+MFHun9BT3Lsf8pbzvisWiIQvYkng+8Vxk1V+dli1u56kY50LRjaPdotvT5BwqtwyF+emo/z9J3yVUVGfKrxQtJMOAQWoQii/4dp9wgybSa5mkucmRLtEQZ/pz0tL/NVcgWAd95nEQ3Tg6tNbuyn3Iepz65L3huMUUBntllWuu4DbtOFSMSbpILV4fy6wlM0SOvi6CpLh81c1LreIvKd61uEWBcDw1lUBUW1I0Z+m/PaRlX+PQ/oxg0Ye6KUiIiTF4ADNk59Ydpt5/rkxmq9tV5Kcp/eQLUVVmBzQNVuytQCP6Ezd0G8eLxWyHpmZWJ3bAzkWTtg4lZlw42SQezEmiUPaJUuR/qklVA/87S4ArFCpALdY3QRdUw3G3XbWUp6aq9z0zUizcPa7351p9JXOZyfdZBFnqt90VzQndXB/mwf8LC9STj5kenVpNuqOQQP3mIRJj7eV21FxG8VAxKrEn3c+XfmZ800EPb9/5lIlijscUbB6da0RQaMook0zug1G0tKi/JBC4rw7/D3m4ARzAkzMcVrDcT2SyFtUdWAsFlsPDFqV3N+EjyXaoEePwroaZCiLqEzb8MW+PNE9TmTC01EzWli51PzZvUqkmyuROU+V6ik+Le/9qT6nwzUzf9tP68tYei0YaDGx6kAd7jn1cKqOCuYbiELH9zYqcc4MnRJjkeGiqaGwLImhyeKs+xKJMBlOJ05ow9gGCKZ1VpnMKoSCTbMS+X+23y042zOb5MtcY/6oBeAo1Vy89OTyhpavFP78jXCcFH0t7Gx24hMEOm2gsEfGabVpQgvFqbQKMsknFRRmuPHcZu0Su/WMFphZvB2r/EGbG72rpGGho3h+Msz0uGzJ7hNK2uqQiE1qmn0zgacKYYZBCqsxV+sjbpoVdSilW/b94n2xNb648VmNIoizqEWhBnsen+d0kbCPmRItfWqSBeOd9Wne3c6bcd6uvXOJ6WdiSsuXq0ndhqrQ4QoWUjCjYtZ0EAhnSOP1m44xkf0O7jXghrzSJWxP4a/t72jU29Vu2rvu4n7HfHkkmQOMGSS+NPeLGO5I73mC2B7+lMiBQQZRM9/9liLIfowupUFAbPBbR+lxDM6M8Ptgh1paJq5Rvs7yEuLQv/7d1oU2woFSb3FMPWQOKMuCuJ7pDDjpIclus5TeEoMBy2YdVB4fxmesaCeMNsEgTHKS5WDSGyNUOoEpcC2OFWtIRf0w27ck34/DjxRTVIcc9+kqZE6iMSiVDsiKdP/Xz5XfEhm/sBhO50p1rvJDlkyyxuJ9SPgs7YeUJBjXdeAkE+P9OQJm6SZnn1svcduI78dYmbkE2mtziPrcjVisXG78spLvbZaSFx/Rks9zP4LKn0Cdz/3JsetkT06A8f/yCgMO6Mb1Hme0JJ7b2wZz1qleqTuKBGokhPVUZ0dVu+tnQYNEY1fmkZSz6+EGZ5EzL7657mreZGR3jUfaEk458PDniBzsSmBKhDRzfXameryJv9/D5m6HIqZ0R+ouCE54Dzp4IJuuD1e4Dc5i+PpSORJfG23uVgqixAMDvchMR0nZdH5brclYwRoJRWv/rlxGRI5ffD5NPGmIDt7vDE1434pYdVZIFh89Bs94HGGJbTwrN8T6lh1HZFTOB4lWzWj6EVqxSMvC0/ljWBQ3F2kc/mO2b6tWonT2JEqEwFts8rz2h+oWNds9ceR2cb7zZvJTDppHaEhK5avWqsseWa2Dt5BBhabdWSktS80oMQrL4TvAM9b5HMmyDnO+OkkbMXfUJG7eXqTIG6lqSOEbqVR+qYdP7uWb57WEJqzyh411GAVsDinPs7KvUeXItlcMdOUWzXBH6zscymV1LLVCtc8IePojzXHF9m5b5zGwBRdzcyUJkiu938ApmAayRdJrX1PmVguWUvt2ThQ62czItTyWJMW2An/hdDfMK7SiFQlGIdAbltHz3ycoh7j9V7GxNWBpbtcSdqm4XxRwTawc3cbZ+xfSv9qQfEkDKfZTwCkqWGI/ur250ItXlMlh6vUNWEYIg9A3GzbgmbqvTN8js2YMo87CU5y6nZ4dbJLDQJj9fc7yM7tZzJDZFtqOcU8+mZjYlq4VmifI23iHb1ZoT9E+kT2dolnP1AfiOkt7PQCSykBiXy5mv637IegWSKj9IKrYZf4Lu9+I7ub+mkRdlvYzehh/jaJ9n7HUH5b2IbgeNdkY7wx1yVzxS7pbvky6+nmVUtRllEFfweUQ0/nG017WoUYSxs+j2B4FV/F62EtHlMWZXYrjGHpthnNb1x66LKZ0Qe92INWHdfR/vqp02wMS8r1G4dJqHok8KmQ7947G13a4YXbsGgHcBvRuVu1eAi4/A5+ZixmdSXM73LupB/LH7O9yxLTVXJTyBbI1S49TIROrfVCOb/czZ9pM4JsZx8kUz8dQGv7gUWKxXvTH7QM/3J2OuXXgciUhqY+cgtaOliQQVOYthBLV3xpESZT3rmfEYNZxmpBbb24CRao86prn+i9TNOh8VxRJGXJfXHATJHs1T5txgc/opYrY8XjlGQQbRcoxIBcnVsMjmU1ymmIUL4dviJXndMAJ0Yet+c7O52/p98ytlmAsGBaTAmMhimAnvp1TWNGM9BpuitGj+t810CU2UhorrjPKGtThVC8WaXw04WFnT5fTjqmPyrQ0tN3CkLsctVy2xr0ZWgiWVZ1OrlFjjxJYsOiZv2cAoOvE+7sY0I/TwWcZqMoyIKNOftwP7w++Rfg67ljfovKYa50if3fzE/8aPYVey/Nq35+nH2sLPh/fP5TsylSKGOZ4k69d2PnH43+kq++sRXHQqGArWdwhx+hpwQC6JgT2uxehYU4Zbw7oNb6/HLikPyJROGK2ouyr+vzseESp9G50T4AyFrSqOQ0rroCYP4sMDFBrHn342EyZTMlSyk47rHSq89Y9/nI3zG5lX16Z5lxphguLOcZUndL8wNcrkyjH82jqg8Bo8OYkynrxZvbFno5lUS3OPr8Ko3mX9NoRPdYOKKjD07bvgFgpZ/RF+YzkWvJ/Hs/tUbfeGzGWLxNAjfDzHHMVSDwB5SabQLsIZHiBp43FjGkaienYoDd18hu2BGwOK7U3o70K/WY/kuuKdmdrykIBUdG2mvE91L1JtTbh20mOLbk1vCAamu7utlXeGU2ooVikbU/actcgmsC1FKk2qmj3GWeIWbj4tGIxE7BLcBWUvvcnd/lYxsMV4F917fWeFB/XbINN3qGvIyTpCalz1lVewdIGqeAS/gB8Mi+sA+BqDiX3VGD2eUunTRbSY+AuDy4E3Qx3hAhwnSXX+B0zuj3eQ1miS8Vux2z/l6/BkWtjKGU72aJkOCWhGcSf3+kFkkB15vGOsQrSdFr6qTj0gBYiOlnBO41170gOWHSUoBVRU2JjwppYdhIFDfu7tIRHccSNM5KZOFDPz0TGMAjzzEpeLwTWp+kn201kU6NjbiMQJx83+LX1e1tZ10kuChJZ/XBUQ1dwaBHjTDJDqOympEk8X2M3VtVw21JksChA8w1tTefO3RJ1FMbqZ01bHHkudDB/OhLfe7P5GOHaI28ZXKTMuqo0hLWQ4HabBsGG7NbP1RiXtETz074er6w/OerJWEqjmkq2y51q1BVI+JUudnVa3ogBpzdhFE7fC7kybrAt2Z6RqDjATAUEYeYK45WMupBKQRtQlU+uNsjnzj6ZmGrezA+ASrWxQ6LMkHRXqXwNq7ftv28dUx/ZSJciDXP2SWJsWaN0FjPX9Yko6LobZ7aYW/IdUktI9apTLyHS8DyWPyuoZyxN1TK/vtfxk3HwWh6JczZC8Ftn0bIJay2g+n5wd7lm9rEsKO+svqVmi+c1j88hSCxbzrg4+HEP0Nt1/B6YW1XVm09T1CpAKjc9n18hjqsaFGdfyva1ZG0Xu3ip6N6JGpyTSqY5h4BOlpLPaOnyw45PdXTN+DtAKg7DLrLFTnWusoSBHk3s0d7YouJHq85/R09Tfc37ENXZF48eAYLnq9GLioNcwDZrC6FW6godB8JnqYUPvn0pWLfQz0lM0Yy8Mybgn84Ds3Q9bDP10bLyOV+qzxa4Rd9Dhu7cju8mMaONXK3UqmBQ9qIg7etIwEqM/kECk/Dzja4Bs1xR+Q/tCbc8IKrSGsTdJJ0vge7IG20W687uVmK6icWQ6cD3lwFzgNMGtFvO5qyJeKflGLAAcQZOrkxVwy3cWvqlGpvjmf9Qe6Ap20MPbV92DPV0OhFM4kz8Yr0ffC2zLWSQ1kqY6QdQrttR3kh1YLtQd1kCEv5hVoPIRWl5ERcUTttBIrWp6Xs5Ehh5OUUwI5aEBvuiDmUoENmnVw1FohCrbRp1A1E+XSlWVOTi7ADW+5Ohb9z1vK4qx5R5lPdGCPBJZ00mC+Ssp8VUbgpGAvXWMuWQQRbCqI6Rr2jtxZxtfP7W/8onz+yz0Gs76LaT5HX9ecyiZCB/ZR/gFtMxPsDwohoeCRtiuLxE1GM1vUEUgBv86+eehL58/P56QFGQ/MqOe/vC76L63jzmeax4exd/OKTUvkXg+fOJUHych9xt/9goJMrapSgvXrj8+8vk/N80f22Sewj6cyGqt1B6mztoeklVHHraouhvHJaG/OuBz6DHKMpFmQULU1bRWlyYE0RPXYYkUycIemN7TLtgNCJX6BqdyxDKkegO7nJK5xQ7OVYDZTMf9bVHidtk6DQX9Et+V9M7esgbsYBdEeUpsB0Xvw2kd9+rI7V+m47u+O/tq7mw7262HU1WlS9uFzsV6JxIHNmUCy0QS9e077JGRFbG65z3/dOKB/Zk+yDdKpUmdXjn/aS3N5nv4fK7bMHHmPlHd4E2+iTbV5rpzScRnxk6KARuDTJ8Q1LpK2mP8gj1EbuJ9RIyY+EWK4hCiIDBAS1Tm2IEXAFfgKPgdL9O6mAa06wjCcUAL6EsxPQWO9VNegBPm/0GgkZbDxCynxujX/92vmGcjZRMAY45puak2sFLCLSwXpEsyy5fnF0jGJBhm+fNSHKKUUfy+276A7/feLOFxxUuHRNJI2Osenxyvf8DAGObT60pfTTlhEg9u/KKkhJqm5U1/+BEcSkpFDA5XeCqxwXmPac1jcuZ3JWQ+p0NdWzb/5v1ZvF8GtMTFFEdQjpLO0bwPb0BHNWnip3liDXI2fXf05jjvfJ0NpjLCUgfTh9CMFYVFKEd4Z/OG/2C+N435mnK+9t1gvCiVcaaH7rK4+PjCvpVNiz+t2QyqH1O8x3JKZVl6Q+Lp/XK8wMjVMslOq9FdSw5FtUs/CptXH9PW+wbWHgrV17R5jTVOtGtKFu3nb80T+E0tv9QkzW3J2dbaw/8ddAKZ0pxIaEqLjlPrji3VgJ3GvdFvlqD8075woxh4fVt0JZE0KVFsAvqhe0dqN9b35jtSpnYMXkU+vZq+IAHad3IHc2s/LYrnD1anfG46IFiMIr9oNbZDWvwthqYNqOigaKd/XlLU4XHfk/PXIjPsLy/9/kAtQ+/wKH+hI/IROWj5FPvTZAT9f7j4ZXQyG4M0TujMAFXYkKvEHv1xhySekgXGGqNxWeWKlf8dDAlLuB1cb/qOD+rk7cmwt+1yKpk9cudqBanTi6zTbXRtV8qylNtjyOVKy1HTz0GW9rjt6sSjAZcT5R+KdtyYb0zyqG9pSLuCw5WBwAn7fjBjKLLoxLXMI+52L9cLwIR2B6OllJZLHJ8vDxmWdtF+QJnmt1rsHPIWY20lftk8fYePkAIg6Hgn532QoIpegMxiWgAOfe5/U44APR8Ac0NeZrVh3gEhs12W+tVSiWiUQekf/YBECUy5fdYbA08dd7VzPAP9aiVcIB9k6tY7WdJ1wNV+bHeydNtmC6G5ICtFC1ZwmJU/j8hf0I8TRVKSiz5oYIa93EpUI78X8GYIAZabx47/n8LDAAJ0nNtP1rpROprqKMBRecShca6qXuTSI3jZBLOB3Vp381B5rCGhjSvh/NSVkYp2qIdP/Bg=";
  49905. /***/ }),
  49906. /* 436 */
  49907. /***/ (function(module, exports) {
  49908. /* Copyright 2013 Google Inc. All Rights Reserved.
  49909. Licensed under the Apache License, Version 2.0 (the "License");
  49910. you may not use this file except in compliance with the License.
  49911. You may obtain a copy of the License at
  49912. http://www.apache.org/licenses/LICENSE-2.0
  49913. Unless required by applicable law or agreed to in writing, software
  49914. distributed under the License is distributed on an "AS IS" BASIS,
  49915. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  49916. See the License for the specific language governing permissions and
  49917. limitations under the License.
  49918. Lookup table to map the previous two bytes to a context id.
  49919. There are four different context modeling modes defined here:
  49920. CONTEXT_LSB6: context id is the least significant 6 bits of the last byte,
  49921. CONTEXT_MSB6: context id is the most significant 6 bits of the last byte,
  49922. CONTEXT_UTF8: second-order context model tuned for UTF8-encoded text,
  49923. CONTEXT_SIGNED: second-order context model tuned for signed integers.
  49924. The context id for the UTF8 context model is calculated as follows. If p1
  49925. and p2 are the previous two bytes, we calcualte the context as
  49926. context = kContextLookup[p1] | kContextLookup[p2 + 256].
  49927. If the previous two bytes are ASCII characters (i.e. < 128), this will be
  49928. equivalent to
  49929. context = 4 * context1(p1) + context2(p2),
  49930. where context1 is based on the previous byte in the following way:
  49931. 0 : non-ASCII control
  49932. 1 : \t, \n, \r
  49933. 2 : space
  49934. 3 : other punctuation
  49935. 4 : " '
  49936. 5 : %
  49937. 6 : ( < [ {
  49938. 7 : ) > ] }
  49939. 8 : , ; :
  49940. 9 : .
  49941. 10 : =
  49942. 11 : number
  49943. 12 : upper-case vowel
  49944. 13 : upper-case consonant
  49945. 14 : lower-case vowel
  49946. 15 : lower-case consonant
  49947. and context2 is based on the second last byte:
  49948. 0 : control, space
  49949. 1 : punctuation
  49950. 2 : upper-case letter, number
  49951. 3 : lower-case letter
  49952. If the last byte is ASCII, and the second last byte is not (in a valid UTF8
  49953. stream it will be a continuation byte, value between 128 and 191), the
  49954. context is the same as if the second last byte was an ASCII control or space.
  49955. If the last byte is a UTF8 lead byte (value >= 192), then the next byte will
  49956. be a continuation byte and the context id is 2 or 3 depending on the LSB of
  49957. the last byte and to a lesser extent on the second last byte if it is ASCII.
  49958. If the last byte is a UTF8 continuation byte, the second last byte can be:
  49959. - continuation byte: the next byte is probably ASCII or lead byte (assuming
  49960. 4-byte UTF8 characters are rare) and the context id is 0 or 1.
  49961. - lead byte (192 - 207): next byte is ASCII or lead byte, context is 0 or 1
  49962. - lead byte (208 - 255): next byte is continuation byte, context is 2 or 3
  49963. The possible value combinations of the previous two bytes, the range of
  49964. context ids and the type of the next byte is summarized in the table below:
  49965. |--------\-----------------------------------------------------------------|
  49966. | \ Last byte |
  49967. | Second \---------------------------------------------------------------|
  49968. | last byte \ ASCII | cont. byte | lead byte |
  49969. | \ (0-127) | (128-191) | (192-) |
  49970. |=============|===================|=====================|==================|
  49971. | ASCII | next: ASCII/lead | not valid | next: cont. |
  49972. | (0-127) | context: 4 - 63 | | context: 2 - 3 |
  49973. |-------------|-------------------|---------------------|------------------|
  49974. | cont. byte | next: ASCII/lead | next: ASCII/lead | next: cont. |
  49975. | (128-191) | context: 4 - 63 | context: 0 - 1 | context: 2 - 3 |
  49976. |-------------|-------------------|---------------------|------------------|
  49977. | lead byte | not valid | next: ASCII/lead | not valid |
  49978. | (192-207) | | context: 0 - 1 | |
  49979. |-------------|-------------------|---------------------|------------------|
  49980. | lead byte | not valid | next: cont. | not valid |
  49981. | (208-) | | context: 2 - 3 | |
  49982. |-------------|-------------------|---------------------|------------------|
  49983. The context id for the signed context mode is calculated as:
  49984. context = (kContextLookup[512 + p1] << 3) | kContextLookup[512 + p2].
  49985. For any context modeling modes, the context ids can be calculated by |-ing
  49986. together two lookups from one table using context model dependent offsets:
  49987. context = kContextLookup[offset1 + p1] | kContextLookup[offset2 + p2].
  49988. where offset1 and offset2 are dependent on the context mode.
  49989. */
  49990. var CONTEXT_LSB6 = 0;
  49991. var CONTEXT_MSB6 = 1;
  49992. var CONTEXT_UTF8 = 2;
  49993. var CONTEXT_SIGNED = 3;
  49994. /* Common context lookup table for all context modes. */
  49995. exports.lookup = new Uint8Array([
  49996. /* CONTEXT_UTF8, last byte. */
  49997. /* ASCII range. */
  49998. 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 0, 0, 4, 0, 0,
  49999. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  50000. 8, 12, 16, 12, 12, 20, 12, 16, 24, 28, 12, 12, 32, 12, 36, 12,
  50001. 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 32, 32, 24, 40, 28, 12,
  50002. 12, 48, 52, 52, 52, 48, 52, 52, 52, 48, 52, 52, 52, 52, 52, 48,
  50003. 52, 52, 52, 52, 52, 48, 52, 52, 52, 52, 52, 24, 12, 28, 12, 12,
  50004. 12, 56, 60, 60, 60, 56, 60, 60, 60, 56, 60, 60, 60, 60, 60, 56,
  50005. 60, 60, 60, 60, 60, 56, 60, 60, 60, 60, 60, 24, 12, 28, 12, 0,
  50006. /* UTF8 continuation byte range. */
  50007. 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1,
  50008. 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1,
  50009. 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1,
  50010. 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1,
  50011. /* UTF8 lead byte range. */
  50012. 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3,
  50013. 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3,
  50014. 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3,
  50015. 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3,
  50016. /* CONTEXT_UTF8 second last byte. */
  50017. /* ASCII range. */
  50018. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  50019. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  50020. 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  50021. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1,
  50022. 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  50023. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1,
  50024. 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
  50025. 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1, 1, 1, 1, 0,
  50026. /* UTF8 continuation byte range. */
  50027. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  50028. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  50029. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  50030. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  50031. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  50032. /* UTF8 lead byte range. */
  50033. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  50034. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  50035. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  50036. /* CONTEXT_SIGNED, second last byte. */
  50037. 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  50038. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  50039. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  50040. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  50041. 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
  50042. 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
  50043. 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
  50044. 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
  50045. 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
  50046. 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
  50047. 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
  50048. 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
  50049. 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
  50050. 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
  50051. 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
  50052. 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7,
  50053. /* CONTEXT_SIGNED, last byte, same as the above values shifted by 3 bits. */
  50054. 0, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
  50055. 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
  50056. 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
  50057. 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
  50058. 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
  50059. 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
  50060. 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
  50061. 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
  50062. 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
  50063. 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
  50064. 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
  50065. 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
  50066. 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
  50067. 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
  50068. 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
  50069. 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 56,
  50070. /* CONTEXT_LSB6, last byte. */
  50071. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  50072. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  50073. 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  50074. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  50075. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  50076. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  50077. 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  50078. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  50079. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  50080. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  50081. 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  50082. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  50083. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  50084. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  50085. 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  50086. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  50087. /* CONTEXT_MSB6, last byte. */
  50088. 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3,
  50089. 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7,
  50090. 8, 8, 8, 8, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 11,
  50091. 12, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15,
  50092. 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19,
  50093. 20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 23, 23, 23, 23,
  50094. 24, 24, 24, 24, 25, 25, 25, 25, 26, 26, 26, 26, 27, 27, 27, 27,
  50095. 28, 28, 28, 28, 29, 29, 29, 29, 30, 30, 30, 30, 31, 31, 31, 31,
  50096. 32, 32, 32, 32, 33, 33, 33, 33, 34, 34, 34, 34, 35, 35, 35, 35,
  50097. 36, 36, 36, 36, 37, 37, 37, 37, 38, 38, 38, 38, 39, 39, 39, 39,
  50098. 40, 40, 40, 40, 41, 41, 41, 41, 42, 42, 42, 42, 43, 43, 43, 43,
  50099. 44, 44, 44, 44, 45, 45, 45, 45, 46, 46, 46, 46, 47, 47, 47, 47,
  50100. 48, 48, 48, 48, 49, 49, 49, 49, 50, 50, 50, 50, 51, 51, 51, 51,
  50101. 52, 52, 52, 52, 53, 53, 53, 53, 54, 54, 54, 54, 55, 55, 55, 55,
  50102. 56, 56, 56, 56, 57, 57, 57, 57, 58, 58, 58, 58, 59, 59, 59, 59,
  50103. 60, 60, 60, 60, 61, 61, 61, 61, 62, 62, 62, 62, 63, 63, 63, 63,
  50104. /* CONTEXT_{M,L}SB6, second last byte, */
  50105. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  50106. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  50107. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  50108. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  50109. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  50110. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  50111. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  50112. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  50113. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  50114. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  50115. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  50116. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  50117. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  50118. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  50119. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  50120. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  50121. ]);
  50122. exports.lookupOffsets = new Uint16Array([
  50123. /* CONTEXT_LSB6 */
  50124. 1024, 1536,
  50125. /* CONTEXT_MSB6 */
  50126. 1280, 1536,
  50127. /* CONTEXT_UTF8 */
  50128. 0, 256,
  50129. /* CONTEXT_SIGNED */
  50130. 768, 512,
  50131. ]);
  50132. /***/ }),
  50133. /* 437 */
  50134. /***/ (function(module, exports) {
  50135. /* Copyright 2013 Google Inc. All Rights Reserved.
  50136. Licensed under the Apache License, Version 2.0 (the "License");
  50137. you may not use this file except in compliance with the License.
  50138. You may obtain a copy of the License at
  50139. http://www.apache.org/licenses/LICENSE-2.0
  50140. Unless required by applicable law or agreed to in writing, software
  50141. distributed under the License is distributed on an "AS IS" BASIS,
  50142. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  50143. See the License for the specific language governing permissions and
  50144. limitations under the License.
  50145. Lookup tables to map prefix codes to value ranges. This is used during
  50146. decoding of the block lengths, literal insertion lengths and copy lengths.
  50147. */
  50148. /* Represents the range of values belonging to a prefix code: */
  50149. /* [offset, offset + 2^nbits) */
  50150. function PrefixCodeRange(offset, nbits) {
  50151. this.offset = offset;
  50152. this.nbits = nbits;
  50153. }
  50154. exports.kBlockLengthPrefixCode = [
  50155. new PrefixCodeRange(1, 2), new PrefixCodeRange(5, 2), new PrefixCodeRange(9, 2), new PrefixCodeRange(13, 2),
  50156. new PrefixCodeRange(17, 3), new PrefixCodeRange(25, 3), new PrefixCodeRange(33, 3), new PrefixCodeRange(41, 3),
  50157. new PrefixCodeRange(49, 4), new PrefixCodeRange(65, 4), new PrefixCodeRange(81, 4), new PrefixCodeRange(97, 4),
  50158. new PrefixCodeRange(113, 5), new PrefixCodeRange(145, 5), new PrefixCodeRange(177, 5), new PrefixCodeRange(209, 5),
  50159. new PrefixCodeRange(241, 6), new PrefixCodeRange(305, 6), new PrefixCodeRange(369, 7), new PrefixCodeRange(497, 8),
  50160. new PrefixCodeRange(753, 9), new PrefixCodeRange(1265, 10), new PrefixCodeRange(2289, 11), new PrefixCodeRange(4337, 12),
  50161. new PrefixCodeRange(8433, 13), new PrefixCodeRange(16625, 24)
  50162. ];
  50163. exports.kInsertLengthPrefixCode = [
  50164. new PrefixCodeRange(0, 0), new PrefixCodeRange(1, 0), new PrefixCodeRange(2, 0), new PrefixCodeRange(3, 0),
  50165. new PrefixCodeRange(4, 0), new PrefixCodeRange(5, 0), new PrefixCodeRange(6, 1), new PrefixCodeRange(8, 1),
  50166. new PrefixCodeRange(10, 2), new PrefixCodeRange(14, 2), new PrefixCodeRange(18, 3), new PrefixCodeRange(26, 3),
  50167. new PrefixCodeRange(34, 4), new PrefixCodeRange(50, 4), new PrefixCodeRange(66, 5), new PrefixCodeRange(98, 5),
  50168. new PrefixCodeRange(130, 6), new PrefixCodeRange(194, 7), new PrefixCodeRange(322, 8), new PrefixCodeRange(578, 9),
  50169. new PrefixCodeRange(1090, 10), new PrefixCodeRange(2114, 12), new PrefixCodeRange(6210, 14), new PrefixCodeRange(22594, 24),
  50170. ];
  50171. exports.kCopyLengthPrefixCode = [
  50172. new PrefixCodeRange(2, 0), new PrefixCodeRange(3, 0), new PrefixCodeRange(4, 0), new PrefixCodeRange(5, 0),
  50173. new PrefixCodeRange(6, 0), new PrefixCodeRange(7, 0), new PrefixCodeRange(8, 0), new PrefixCodeRange(9, 0),
  50174. new PrefixCodeRange(10, 1), new PrefixCodeRange(12, 1), new PrefixCodeRange(14, 2), new PrefixCodeRange(18, 2),
  50175. new PrefixCodeRange(22, 3), new PrefixCodeRange(30, 3), new PrefixCodeRange(38, 4), new PrefixCodeRange(54, 4),
  50176. new PrefixCodeRange(70, 5), new PrefixCodeRange(102, 5), new PrefixCodeRange(134, 6), new PrefixCodeRange(198, 7),
  50177. new PrefixCodeRange(326, 8), new PrefixCodeRange(582, 9), new PrefixCodeRange(1094, 10), new PrefixCodeRange(2118, 24),
  50178. ];
  50179. exports.kInsertRangeLut = [
  50180. 0, 0, 8, 8, 0, 16, 8, 16, 16,
  50181. ];
  50182. exports.kCopyRangeLut = [
  50183. 0, 8, 0, 8, 16, 0, 16, 8, 16,
  50184. ];
  50185. /***/ }),
  50186. /* 438 */
  50187. /***/ (function(module, exports, __webpack_require__) {
  50188. /* Copyright 2013 Google Inc. All Rights Reserved.
  50189. Licensed under the Apache License, Version 2.0 (the "License");
  50190. you may not use this file except in compliance with the License.
  50191. You may obtain a copy of the License at
  50192. http://www.apache.org/licenses/LICENSE-2.0
  50193. Unless required by applicable law or agreed to in writing, software
  50194. distributed under the License is distributed on an "AS IS" BASIS,
  50195. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  50196. See the License for the specific language governing permissions and
  50197. limitations under the License.
  50198. Transformations on dictionary words.
  50199. */
  50200. var BrotliDictionary = __webpack_require__(207);
  50201. var kIdentity = 0;
  50202. var kOmitLast1 = 1;
  50203. var kOmitLast2 = 2;
  50204. var kOmitLast3 = 3;
  50205. var kOmitLast4 = 4;
  50206. var kOmitLast5 = 5;
  50207. var kOmitLast6 = 6;
  50208. var kOmitLast7 = 7;
  50209. var kOmitLast8 = 8;
  50210. var kOmitLast9 = 9;
  50211. var kUppercaseFirst = 10;
  50212. var kUppercaseAll = 11;
  50213. var kOmitFirst1 = 12;
  50214. var kOmitFirst2 = 13;
  50215. var kOmitFirst3 = 14;
  50216. var kOmitFirst4 = 15;
  50217. var kOmitFirst5 = 16;
  50218. var kOmitFirst6 = 17;
  50219. var kOmitFirst7 = 18;
  50220. var kOmitFirst8 = 19;
  50221. var kOmitFirst9 = 20;
  50222. function Transform(prefix, transform, suffix) {
  50223. this.prefix = new Uint8Array(prefix.length);
  50224. this.transform = transform;
  50225. this.suffix = new Uint8Array(suffix.length);
  50226. for (var i = 0; i < prefix.length; i++)
  50227. this.prefix[i] = prefix.charCodeAt(i);
  50228. for (var i = 0; i < suffix.length; i++)
  50229. this.suffix[i] = suffix.charCodeAt(i);
  50230. }
  50231. var kTransforms = [
  50232. new Transform( "", kIdentity, "" ),
  50233. new Transform( "", kIdentity, " " ),
  50234. new Transform( " ", kIdentity, " " ),
  50235. new Transform( "", kOmitFirst1, "" ),
  50236. new Transform( "", kUppercaseFirst, " " ),
  50237. new Transform( "", kIdentity, " the " ),
  50238. new Transform( " ", kIdentity, "" ),
  50239. new Transform( "s ", kIdentity, " " ),
  50240. new Transform( "", kIdentity, " of " ),
  50241. new Transform( "", kUppercaseFirst, "" ),
  50242. new Transform( "", kIdentity, " and " ),
  50243. new Transform( "", kOmitFirst2, "" ),
  50244. new Transform( "", kOmitLast1, "" ),
  50245. new Transform( ", ", kIdentity, " " ),
  50246. new Transform( "", kIdentity, ", " ),
  50247. new Transform( " ", kUppercaseFirst, " " ),
  50248. new Transform( "", kIdentity, " in " ),
  50249. new Transform( "", kIdentity, " to " ),
  50250. new Transform( "e ", kIdentity, " " ),
  50251. new Transform( "", kIdentity, "\"" ),
  50252. new Transform( "", kIdentity, "." ),
  50253. new Transform( "", kIdentity, "\">" ),
  50254. new Transform( "", kIdentity, "\n" ),
  50255. new Transform( "", kOmitLast3, "" ),
  50256. new Transform( "", kIdentity, "]" ),
  50257. new Transform( "", kIdentity, " for " ),
  50258. new Transform( "", kOmitFirst3, "" ),
  50259. new Transform( "", kOmitLast2, "" ),
  50260. new Transform( "", kIdentity, " a " ),
  50261. new Transform( "", kIdentity, " that " ),
  50262. new Transform( " ", kUppercaseFirst, "" ),
  50263. new Transform( "", kIdentity, ". " ),
  50264. new Transform( ".", kIdentity, "" ),
  50265. new Transform( " ", kIdentity, ", " ),
  50266. new Transform( "", kOmitFirst4, "" ),
  50267. new Transform( "", kIdentity, " with " ),
  50268. new Transform( "", kIdentity, "'" ),
  50269. new Transform( "", kIdentity, " from " ),
  50270. new Transform( "", kIdentity, " by " ),
  50271. new Transform( "", kOmitFirst5, "" ),
  50272. new Transform( "", kOmitFirst6, "" ),
  50273. new Transform( " the ", kIdentity, "" ),
  50274. new Transform( "", kOmitLast4, "" ),
  50275. new Transform( "", kIdentity, ". The " ),
  50276. new Transform( "", kUppercaseAll, "" ),
  50277. new Transform( "", kIdentity, " on " ),
  50278. new Transform( "", kIdentity, " as " ),
  50279. new Transform( "", kIdentity, " is " ),
  50280. new Transform( "", kOmitLast7, "" ),
  50281. new Transform( "", kOmitLast1, "ing " ),
  50282. new Transform( "", kIdentity, "\n\t" ),
  50283. new Transform( "", kIdentity, ":" ),
  50284. new Transform( " ", kIdentity, ". " ),
  50285. new Transform( "", kIdentity, "ed " ),
  50286. new Transform( "", kOmitFirst9, "" ),
  50287. new Transform( "", kOmitFirst7, "" ),
  50288. new Transform( "", kOmitLast6, "" ),
  50289. new Transform( "", kIdentity, "(" ),
  50290. new Transform( "", kUppercaseFirst, ", " ),
  50291. new Transform( "", kOmitLast8, "" ),
  50292. new Transform( "", kIdentity, " at " ),
  50293. new Transform( "", kIdentity, "ly " ),
  50294. new Transform( " the ", kIdentity, " of " ),
  50295. new Transform( "", kOmitLast5, "" ),
  50296. new Transform( "", kOmitLast9, "" ),
  50297. new Transform( " ", kUppercaseFirst, ", " ),
  50298. new Transform( "", kUppercaseFirst, "\"" ),
  50299. new Transform( ".", kIdentity, "(" ),
  50300. new Transform( "", kUppercaseAll, " " ),
  50301. new Transform( "", kUppercaseFirst, "\">" ),
  50302. new Transform( "", kIdentity, "=\"" ),
  50303. new Transform( " ", kIdentity, "." ),
  50304. new Transform( ".com/", kIdentity, "" ),
  50305. new Transform( " the ", kIdentity, " of the " ),
  50306. new Transform( "", kUppercaseFirst, "'" ),
  50307. new Transform( "", kIdentity, ". This " ),
  50308. new Transform( "", kIdentity, "," ),
  50309. new Transform( ".", kIdentity, " " ),
  50310. new Transform( "", kUppercaseFirst, "(" ),
  50311. new Transform( "", kUppercaseFirst, "." ),
  50312. new Transform( "", kIdentity, " not " ),
  50313. new Transform( " ", kIdentity, "=\"" ),
  50314. new Transform( "", kIdentity, "er " ),
  50315. new Transform( " ", kUppercaseAll, " " ),
  50316. new Transform( "", kIdentity, "al " ),
  50317. new Transform( " ", kUppercaseAll, "" ),
  50318. new Transform( "", kIdentity, "='" ),
  50319. new Transform( "", kUppercaseAll, "\"" ),
  50320. new Transform( "", kUppercaseFirst, ". " ),
  50321. new Transform( " ", kIdentity, "(" ),
  50322. new Transform( "", kIdentity, "ful " ),
  50323. new Transform( " ", kUppercaseFirst, ". " ),
  50324. new Transform( "", kIdentity, "ive " ),
  50325. new Transform( "", kIdentity, "less " ),
  50326. new Transform( "", kUppercaseAll, "'" ),
  50327. new Transform( "", kIdentity, "est " ),
  50328. new Transform( " ", kUppercaseFirst, "." ),
  50329. new Transform( "", kUppercaseAll, "\">" ),
  50330. new Transform( " ", kIdentity, "='" ),
  50331. new Transform( "", kUppercaseFirst, "," ),
  50332. new Transform( "", kIdentity, "ize " ),
  50333. new Transform( "", kUppercaseAll, "." ),
  50334. new Transform( "\xc2\xa0", kIdentity, "" ),
  50335. new Transform( " ", kIdentity, "," ),
  50336. new Transform( "", kUppercaseFirst, "=\"" ),
  50337. new Transform( "", kUppercaseAll, "=\"" ),
  50338. new Transform( "", kIdentity, "ous " ),
  50339. new Transform( "", kUppercaseAll, ", " ),
  50340. new Transform( "", kUppercaseFirst, "='" ),
  50341. new Transform( " ", kUppercaseFirst, "," ),
  50342. new Transform( " ", kUppercaseAll, "=\"" ),
  50343. new Transform( " ", kUppercaseAll, ", " ),
  50344. new Transform( "", kUppercaseAll, "," ),
  50345. new Transform( "", kUppercaseAll, "(" ),
  50346. new Transform( "", kUppercaseAll, ". " ),
  50347. new Transform( " ", kUppercaseAll, "." ),
  50348. new Transform( "", kUppercaseAll, "='" ),
  50349. new Transform( " ", kUppercaseAll, ". " ),
  50350. new Transform( " ", kUppercaseFirst, "=\"" ),
  50351. new Transform( " ", kUppercaseAll, "='" ),
  50352. new Transform( " ", kUppercaseFirst, "='" )
  50353. ];
  50354. exports.kTransforms = kTransforms;
  50355. exports.kNumTransforms = kTransforms.length;
  50356. function ToUpperCase(p, i) {
  50357. if (p[i] < 0xc0) {
  50358. if (p[i] >= 97 && p[i] <= 122) {
  50359. p[i] ^= 32;
  50360. }
  50361. return 1;
  50362. }
  50363. /* An overly simplified uppercasing model for utf-8. */
  50364. if (p[i] < 0xe0) {
  50365. p[i + 1] ^= 32;
  50366. return 2;
  50367. }
  50368. /* An arbitrary transform for three byte characters. */
  50369. p[i + 2] ^= 5;
  50370. return 3;
  50371. }
  50372. exports.transformDictionaryWord = function(dst, idx, word, len, transform) {
  50373. var prefix = kTransforms[transform].prefix;
  50374. var suffix = kTransforms[transform].suffix;
  50375. var t = kTransforms[transform].transform;
  50376. var skip = t < kOmitFirst1 ? 0 : t - (kOmitFirst1 - 1);
  50377. var i = 0;
  50378. var start_idx = idx;
  50379. var uppercase;
  50380. if (skip > len) {
  50381. skip = len;
  50382. }
  50383. var prefix_pos = 0;
  50384. while (prefix_pos < prefix.length) {
  50385. dst[idx++] = prefix[prefix_pos++];
  50386. }
  50387. word += skip;
  50388. len -= skip;
  50389. if (t <= kOmitLast9) {
  50390. len -= t;
  50391. }
  50392. for (i = 0; i < len; i++) {
  50393. dst[idx++] = BrotliDictionary.dictionary[word + i];
  50394. }
  50395. uppercase = idx - len;
  50396. if (t === kUppercaseFirst) {
  50397. ToUpperCase(dst, uppercase);
  50398. } else if (t === kUppercaseAll) {
  50399. while (len > 0) {
  50400. var step = ToUpperCase(dst, uppercase);
  50401. uppercase += step;
  50402. len -= step;
  50403. }
  50404. }
  50405. var suffix_pos = 0;
  50406. while (suffix_pos < suffix.length) {
  50407. dst[idx++] = suffix[suffix_pos++];
  50408. }
  50409. return idx - start_idx;
  50410. }
  50411. /***/ }),
  50412. /* 439 */
  50413. /***/ (function(module, exports, __webpack_require__) {
  50414. "use strict";
  50415. __webpack_require__(82);
  50416. __webpack_require__(44);
  50417. var inflate = __webpack_require__(83); // Shift size for getting the index-1 table offset.
  50418. var SHIFT_1 = 6 + 5; // Shift size for getting the index-2 table offset.
  50419. var SHIFT_2 = 5; // Difference between the two shift sizes,
  50420. // for getting an index-1 offset from an index-2 offset. 6=11-5
  50421. var SHIFT_1_2 = SHIFT_1 - SHIFT_2; // Number of index-1 entries for the BMP. 32=0x20
  50422. // This part of the index-1 table is omitted from the serialized form.
  50423. var OMITTED_BMP_INDEX_1_LENGTH = 0x10000 >> SHIFT_1; // Number of entries in an index-2 block. 64=0x40
  50424. var INDEX_2_BLOCK_LENGTH = 1 << SHIFT_1_2; // Mask for getting the lower bits for the in-index-2-block offset. */
  50425. var INDEX_2_MASK = INDEX_2_BLOCK_LENGTH - 1; // Shift size for shifting left the index array values.
  50426. // Increases possible data size with 16-bit index values at the cost
  50427. // of compactability.
  50428. // This requires data blocks to be aligned by DATA_GRANULARITY.
  50429. var INDEX_SHIFT = 2; // Number of entries in a data block. 32=0x20
  50430. var DATA_BLOCK_LENGTH = 1 << SHIFT_2; // Mask for getting the lower bits for the in-data-block offset.
  50431. var DATA_MASK = DATA_BLOCK_LENGTH - 1; // The part of the index-2 table for U+D800..U+DBFF stores values for
  50432. // lead surrogate code _units_ not code _points_.
  50433. // Values for lead surrogate code _points_ are indexed with this portion of the table.
  50434. // Length=32=0x20=0x400>>SHIFT_2. (There are 1024=0x400 lead surrogates.)
  50435. var LSCP_INDEX_2_OFFSET = 0x10000 >> SHIFT_2;
  50436. var LSCP_INDEX_2_LENGTH = 0x400 >> SHIFT_2; // Count the lengths of both BMP pieces. 2080=0x820
  50437. var INDEX_2_BMP_LENGTH = LSCP_INDEX_2_OFFSET + LSCP_INDEX_2_LENGTH; // The 2-byte UTF-8 version of the index-2 table follows at offset 2080=0x820.
  50438. // Length 32=0x20 for lead bytes C0..DF, regardless of SHIFT_2.
  50439. var UTF8_2B_INDEX_2_OFFSET = INDEX_2_BMP_LENGTH;
  50440. var UTF8_2B_INDEX_2_LENGTH = 0x800 >> 6; // U+0800 is the first code point after 2-byte UTF-8
  50441. // The index-1 table, only used for supplementary code points, at offset 2112=0x840.
  50442. // Variable length, for code points up to highStart, where the last single-value range starts.
  50443. // Maximum length 512=0x200=0x100000>>SHIFT_1.
  50444. // (For 0x100000 supplementary code points U+10000..U+10ffff.)
  50445. //
  50446. // The part of the index-2 table for supplementary code points starts
  50447. // after this index-1 table.
  50448. //
  50449. // Both the index-1 table and the following part of the index-2 table
  50450. // are omitted completely if there is only BMP data.
  50451. var INDEX_1_OFFSET = UTF8_2B_INDEX_2_OFFSET + UTF8_2B_INDEX_2_LENGTH; // The alignment size of a data block. Also the granularity for compaction.
  50452. var DATA_GRANULARITY = 1 << INDEX_SHIFT;
  50453. var UnicodeTrie = /*#__PURE__*/function () {
  50454. function UnicodeTrie(data) {
  50455. var isBuffer = typeof data.readUInt32BE === 'function' && typeof data.slice === 'function';
  50456. if (isBuffer || data instanceof Uint8Array) {
  50457. // read binary format
  50458. var uncompressedLength;
  50459. if (isBuffer) {
  50460. this.highStart = data.readUInt32BE(0);
  50461. this.errorValue = data.readUInt32BE(4);
  50462. uncompressedLength = data.readUInt32BE(8);
  50463. data = data.slice(12);
  50464. } else {
  50465. var view = new DataView(data.buffer);
  50466. this.highStart = view.getUint32(0);
  50467. this.errorValue = view.getUint32(4);
  50468. uncompressedLength = view.getUint32(8);
  50469. data = data.subarray(12);
  50470. } // double inflate the actual trie data
  50471. data = inflate(data, new Uint8Array(uncompressedLength));
  50472. data = inflate(data, new Uint8Array(uncompressedLength));
  50473. this.data = new Uint32Array(data.buffer);
  50474. } else {
  50475. // pre-parsed data
  50476. var _data = data;
  50477. this.data = _data.data;
  50478. this.highStart = _data.highStart;
  50479. this.errorValue = _data.errorValue;
  50480. }
  50481. }
  50482. var _proto = UnicodeTrie.prototype;
  50483. _proto.get = function get(codePoint) {
  50484. var index;
  50485. if (codePoint < 0 || codePoint > 0x10ffff) {
  50486. return this.errorValue;
  50487. }
  50488. if (codePoint < 0xd800 || codePoint > 0xdbff && codePoint <= 0xffff) {
  50489. // Ordinary BMP code point, excluding leading surrogates.
  50490. // BMP uses a single level lookup. BMP index starts at offset 0 in the index.
  50491. // data is stored in the index array itself.
  50492. index = (this.data[codePoint >> SHIFT_2] << INDEX_SHIFT) + (codePoint & DATA_MASK);
  50493. return this.data[index];
  50494. }
  50495. if (codePoint <= 0xffff) {
  50496. // Lead Surrogate Code Point. A Separate index section is stored for
  50497. // lead surrogate code units and code points.
  50498. // The main index has the code unit data.
  50499. // For this function, we need the code point data.
  50500. index = (this.data[LSCP_INDEX_2_OFFSET + (codePoint - 0xd800 >> SHIFT_2)] << INDEX_SHIFT) + (codePoint & DATA_MASK);
  50501. return this.data[index];
  50502. }
  50503. if (codePoint < this.highStart) {
  50504. // Supplemental code point, use two-level lookup.
  50505. index = this.data[INDEX_1_OFFSET - OMITTED_BMP_INDEX_1_LENGTH + (codePoint >> SHIFT_1)];
  50506. index = this.data[index + (codePoint >> SHIFT_2 & INDEX_2_MASK)];
  50507. index = (index << INDEX_SHIFT) + (codePoint & DATA_MASK);
  50508. return this.data[index];
  50509. }
  50510. return this.data[this.data.length - DATA_GRANULARITY];
  50511. };
  50512. return UnicodeTrie;
  50513. }();
  50514. module.exports = UnicodeTrie;
  50515. /***/ }),
  50516. /* 440 */
  50517. /***/ (function(module, exports, __webpack_require__) {
  50518. var lookup = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
  50519. ;(function (exports) {
  50520. 'use strict';
  50521. var Arr = (typeof Uint8Array !== 'undefined')
  50522. ? Uint8Array
  50523. : Array
  50524. var PLUS = '+'.charCodeAt(0)
  50525. var SLASH = '/'.charCodeAt(0)
  50526. var NUMBER = '0'.charCodeAt(0)
  50527. var LOWER = 'a'.charCodeAt(0)
  50528. var UPPER = 'A'.charCodeAt(0)
  50529. var PLUS_URL_SAFE = '-'.charCodeAt(0)
  50530. var SLASH_URL_SAFE = '_'.charCodeAt(0)
  50531. function decode (elt) {
  50532. var code = elt.charCodeAt(0)
  50533. if (code === PLUS ||
  50534. code === PLUS_URL_SAFE)
  50535. return 62 // '+'
  50536. if (code === SLASH ||
  50537. code === SLASH_URL_SAFE)
  50538. return 63 // '/'
  50539. if (code < NUMBER)
  50540. return -1 //no match
  50541. if (code < NUMBER + 10)
  50542. return code - NUMBER + 26 + 26
  50543. if (code < UPPER + 26)
  50544. return code - UPPER
  50545. if (code < LOWER + 26)
  50546. return code - LOWER + 26
  50547. }
  50548. function b64ToByteArray (b64) {
  50549. var i, j, l, tmp, placeHolders, arr
  50550. if (b64.length % 4 > 0) {
  50551. throw new Error('Invalid string. Length must be a multiple of 4')
  50552. }
  50553. // the number of equal signs (place holders)
  50554. // if there are two placeholders, than the two characters before it
  50555. // represent one byte
  50556. // if there is only one, then the three characters before it represent 2 bytes
  50557. // this is just a cheap hack to not do indexOf twice
  50558. var len = b64.length
  50559. placeHolders = '=' === b64.charAt(len - 2) ? 2 : '=' === b64.charAt(len - 1) ? 1 : 0
  50560. // base64 is 4/3 + up to two characters of the original data
  50561. arr = new Arr(b64.length * 3 / 4 - placeHolders)
  50562. // if there are placeholders, only get up to the last complete 4 chars
  50563. l = placeHolders > 0 ? b64.length - 4 : b64.length
  50564. var L = 0
  50565. function push (v) {
  50566. arr[L++] = v
  50567. }
  50568. for (i = 0, j = 0; i < l; i += 4, j += 3) {
  50569. tmp = (decode(b64.charAt(i)) << 18) | (decode(b64.charAt(i + 1)) << 12) | (decode(b64.charAt(i + 2)) << 6) | decode(b64.charAt(i + 3))
  50570. push((tmp & 0xFF0000) >> 16)
  50571. push((tmp & 0xFF00) >> 8)
  50572. push(tmp & 0xFF)
  50573. }
  50574. if (placeHolders === 2) {
  50575. tmp = (decode(b64.charAt(i)) << 2) | (decode(b64.charAt(i + 1)) >> 4)
  50576. push(tmp & 0xFF)
  50577. } else if (placeHolders === 1) {
  50578. tmp = (decode(b64.charAt(i)) << 10) | (decode(b64.charAt(i + 1)) << 4) | (decode(b64.charAt(i + 2)) >> 2)
  50579. push((tmp >> 8) & 0xFF)
  50580. push(tmp & 0xFF)
  50581. }
  50582. return arr
  50583. }
  50584. function uint8ToBase64 (uint8) {
  50585. var i,
  50586. extraBytes = uint8.length % 3, // if we have 1 byte left, pad 2 bytes
  50587. output = "",
  50588. temp, length
  50589. function encode (num) {
  50590. return lookup.charAt(num)
  50591. }
  50592. function tripletToBase64 (num) {
  50593. return encode(num >> 18 & 0x3F) + encode(num >> 12 & 0x3F) + encode(num >> 6 & 0x3F) + encode(num & 0x3F)
  50594. }
  50595. // go through the array every three bytes, we'll deal with trailing stuff later
  50596. for (i = 0, length = uint8.length - extraBytes; i < length; i += 3) {
  50597. temp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2])
  50598. output += tripletToBase64(temp)
  50599. }
  50600. // pad the end with zeros, but make sure to not forget the extra bytes
  50601. switch (extraBytes) {
  50602. case 1:
  50603. temp = uint8[uint8.length - 1]
  50604. output += encode(temp >> 2)
  50605. output += encode((temp << 4) & 0x3F)
  50606. output += '=='
  50607. break
  50608. case 2:
  50609. temp = (uint8[uint8.length - 2] << 8) + (uint8[uint8.length - 1])
  50610. output += encode(temp >> 10)
  50611. output += encode((temp >> 4) & 0x3F)
  50612. output += encode((temp << 2) & 0x3F)
  50613. output += '='
  50614. break
  50615. }
  50616. return output
  50617. }
  50618. exports.toByteArray = b64ToByteArray
  50619. exports.fromByteArray = uint8ToBase64
  50620. }( false ? (undefined) : exports))
  50621. /***/ }),
  50622. /* 441 */
  50623. /***/ (function(module, exports, __webpack_require__) {
  50624. "use strict";
  50625. // The following break classes are handled by the pair table
  50626. exports.OP = 0; // Opening punctuation
  50627. exports.CL = 1; // Closing punctuation
  50628. exports.CP = 2; // Closing parenthesis
  50629. exports.QU = 3; // Ambiguous quotation
  50630. exports.GL = 4; // Glue
  50631. exports.NS = 5; // Non-starters
  50632. exports.EX = 6; // Exclamation/Interrogation
  50633. exports.SY = 7; // Symbols allowing break after
  50634. exports.IS = 8; // Infix separator
  50635. exports.PR = 9; // Prefix
  50636. exports.PO = 10; // Postfix
  50637. exports.NU = 11; // Numeric
  50638. exports.AL = 12; // Alphabetic
  50639. exports.HL = 13; // Hebrew Letter
  50640. exports.ID = 14; // Ideographic
  50641. exports.IN = 15; // Inseparable characters
  50642. exports.HY = 16; // Hyphen
  50643. exports.BA = 17; // Break after
  50644. exports.BB = 18; // Break before
  50645. exports.B2 = 19; // Break on either side (but not pair)
  50646. exports.ZW = 20; // Zero-width space
  50647. exports.CM = 21; // Combining marks
  50648. exports.WJ = 22; // Word joiner
  50649. exports.H2 = 23; // Hangul LV
  50650. exports.H3 = 24; // Hangul LVT
  50651. exports.JL = 25; // Hangul L Jamo
  50652. exports.JV = 26; // Hangul V Jamo
  50653. exports.JT = 27; // Hangul T Jamo
  50654. exports.RI = 28; // Regional Indicator
  50655. // The following break classes are not handled by the pair table
  50656. exports.AI = 29; // Ambiguous (Alphabetic or Ideograph)
  50657. exports.BK = 30; // Break (mandatory)
  50658. exports.CB = 31; // Contingent break
  50659. exports.CJ = 32; // Conditional Japanese Starter
  50660. exports.CR = 33; // Carriage return
  50661. exports.LF = 34; // Line feed
  50662. exports.NL = 35; // Next line
  50663. exports.SA = 36; // South-East Asian
  50664. exports.SG = 37; // Surrogates
  50665. exports.SP = 38; // Space
  50666. exports.XX = 39; // Unknown
  50667. /***/ }),
  50668. /* 442 */
  50669. /***/ (function(module, exports, __webpack_require__) {
  50670. "use strict";
  50671. var CI_BRK, CP_BRK, DI_BRK, IN_BRK, PR_BRK;
  50672. exports.DI_BRK = DI_BRK = 0; // Direct break opportunity
  50673. exports.IN_BRK = IN_BRK = 1; // Indirect break opportunity
  50674. exports.CI_BRK = CI_BRK = 2; // Indirect break opportunity for combining marks
  50675. exports.CP_BRK = CP_BRK = 3; // Prohibited break for combining marks
  50676. exports.PR_BRK = PR_BRK = 4; // Prohibited break
  50677. // table generated from http://www.unicode.org/reports/tr14/#Table2
  50678. exports.pairTable = [[PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, CP_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK], [DI_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK], [DI_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK], [PR_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, CI_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK], [IN_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, CI_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK], [DI_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK], [DI_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK], [DI_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, DI_BRK, IN_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK], [DI_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK], [IN_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK], [IN_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK], [IN_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK], [IN_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK], [IN_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK], [DI_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, IN_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK], [DI_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK], [DI_BRK, PR_BRK, PR_BRK, IN_BRK, DI_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, DI_BRK, IN_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK], [DI_BRK, PR_BRK, PR_BRK, IN_BRK, DI_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK], [IN_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, CI_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK], [DI_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, DI_BRK, PR_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK], [DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK], [IN_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK], [IN_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, CI_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK], [DI_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, IN_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, DI_BRK], [DI_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, IN_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, DI_BRK], [DI_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, IN_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK], [DI_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, IN_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, DI_BRK], [DI_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, IN_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, DI_BRK], [DI_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK]];
  50679. /***/ }),
  50680. /* 443 */
  50681. /***/ (function(module, exports, __webpack_require__) {
  50682. "use strict";
  50683. /* WEBPACK VAR INJECTION */(function(Buffer) {
  50684. __webpack_require__(157);
  50685. __webpack_require__(158);
  50686. /*
  50687. * MIT LICENSE
  50688. * Copyright (c) 2011 Devon Govett
  50689. *
  50690. * Permission is hereby granted, free of charge, to any person obtaining a copy of this
  50691. * software and associated documentation files (the "Software"), to deal in the Software
  50692. * without restriction, including without limitation the rights to use, copy, modify, merge,
  50693. * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
  50694. * to whom the Software is furnished to do so, subject to the following conditions:
  50695. *
  50696. * The above copyright notice and this permission notice shall be included in all copies or
  50697. * substantial portions of the Software.
  50698. *
  50699. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
  50700. * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  50701. * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  50702. * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  50703. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  50704. */
  50705. var fs = __webpack_require__(84);
  50706. var zlib = __webpack_require__(170);
  50707. module.exports = /*#__PURE__*/function () {
  50708. PNG.decode = function decode(path, fn) {
  50709. return fs.readFile(path, function (err, file) {
  50710. var png = new PNG(file);
  50711. return png.decode(function (pixels) {
  50712. return fn(pixels);
  50713. });
  50714. });
  50715. };
  50716. PNG.load = function load(path) {
  50717. var file = fs.readFileSync(path);
  50718. return new PNG(file);
  50719. };
  50720. function PNG(data) {
  50721. var i;
  50722. this.data = data;
  50723. this.pos = 8; // Skip the default header
  50724. this.palette = [];
  50725. this.imgData = [];
  50726. this.transparency = {};
  50727. this.text = {};
  50728. while (true) {
  50729. var chunkSize = this.readUInt32();
  50730. var section = '';
  50731. for (i = 0; i < 4; i++) {
  50732. section += String.fromCharCode(this.data[this.pos++]);
  50733. }
  50734. switch (section) {
  50735. case 'IHDR':
  50736. // we can grab interesting values from here (like width, height, etc)
  50737. this.width = this.readUInt32();
  50738. this.height = this.readUInt32();
  50739. this.bits = this.data[this.pos++];
  50740. this.colorType = this.data[this.pos++];
  50741. this.compressionMethod = this.data[this.pos++];
  50742. this.filterMethod = this.data[this.pos++];
  50743. this.interlaceMethod = this.data[this.pos++];
  50744. break;
  50745. case 'PLTE':
  50746. this.palette = this.read(chunkSize);
  50747. break;
  50748. case 'IDAT':
  50749. for (i = 0; i < chunkSize; i++) {
  50750. this.imgData.push(this.data[this.pos++]);
  50751. }
  50752. break;
  50753. case 'tRNS':
  50754. // This chunk can only occur once and it must occur after the
  50755. // PLTE chunk and before the IDAT chunk.
  50756. this.transparency = {};
  50757. switch (this.colorType) {
  50758. case 3:
  50759. // Indexed color, RGB. Each byte in this chunk is an alpha for
  50760. // the palette index in the PLTE ("palette") chunk up until the
  50761. // last non-opaque entry. Set up an array, stretching over all
  50762. // palette entries which will be 0 (opaque) or 1 (transparent).
  50763. this.transparency.indexed = this.read(chunkSize);
  50764. var short = 255 - this.transparency.indexed.length;
  50765. if (short > 0) {
  50766. for (i = 0; i < short; i++) {
  50767. this.transparency.indexed.push(255);
  50768. }
  50769. }
  50770. break;
  50771. case 0:
  50772. // Greyscale. Corresponding to entries in the PLTE chunk.
  50773. // Grey is two bytes, range 0 .. (2 ^ bit-depth) - 1
  50774. this.transparency.grayscale = this.read(chunkSize)[0];
  50775. break;
  50776. case 2:
  50777. // True color with proper alpha channel.
  50778. this.transparency.rgb = this.read(chunkSize);
  50779. break;
  50780. }
  50781. break;
  50782. case 'tEXt':
  50783. var text = this.read(chunkSize);
  50784. var index = text.indexOf(0);
  50785. var key = String.fromCharCode.apply(String, text.slice(0, index));
  50786. this.text[key] = String.fromCharCode.apply(String, text.slice(index + 1));
  50787. break;
  50788. case 'IEND':
  50789. // we've got everything we need!
  50790. switch (this.colorType) {
  50791. case 0:
  50792. case 3:
  50793. case 4:
  50794. this.colors = 1;
  50795. break;
  50796. case 2:
  50797. case 6:
  50798. this.colors = 3;
  50799. break;
  50800. }
  50801. this.hasAlphaChannel = [4, 6].includes(this.colorType);
  50802. var colors = this.colors + (this.hasAlphaChannel ? 1 : 0);
  50803. this.pixelBitlength = this.bits * colors;
  50804. switch (this.colors) {
  50805. case 1:
  50806. this.colorSpace = 'DeviceGray';
  50807. break;
  50808. case 3:
  50809. this.colorSpace = 'DeviceRGB';
  50810. break;
  50811. }
  50812. this.imgData = new Buffer(this.imgData);
  50813. return;
  50814. break;
  50815. default:
  50816. // unknown (or unimportant) section, skip it
  50817. this.pos += chunkSize;
  50818. }
  50819. this.pos += 4; // Skip the CRC
  50820. if (this.pos > this.data.length) {
  50821. throw new Error('Incomplete or corrupt PNG file');
  50822. }
  50823. }
  50824. }
  50825. var _proto = PNG.prototype;
  50826. _proto.read = function read(bytes) {
  50827. var result = new Array(bytes);
  50828. for (var _i = 0; _i < bytes; _i++) {
  50829. result[_i] = this.data[this.pos++];
  50830. }
  50831. return result;
  50832. };
  50833. _proto.readUInt32 = function readUInt32() {
  50834. var b1 = this.data[this.pos++] << 24;
  50835. var b2 = this.data[this.pos++] << 16;
  50836. var b3 = this.data[this.pos++] << 8;
  50837. var b4 = this.data[this.pos++];
  50838. return b1 | b2 | b3 | b4;
  50839. };
  50840. _proto.readUInt16 = function readUInt16() {
  50841. var b1 = this.data[this.pos++] << 8;
  50842. var b2 = this.data[this.pos++];
  50843. return b1 | b2;
  50844. };
  50845. _proto.decodePixels = function decodePixels(fn) {
  50846. var _this = this;
  50847. return zlib.inflate(this.imgData, function (err, data) {
  50848. if (err) {
  50849. throw err;
  50850. }
  50851. var width = _this.width,
  50852. height = _this.height;
  50853. var pixelBytes = _this.pixelBitlength / 8;
  50854. var pixels = new Buffer(width * height * pixelBytes);
  50855. var length = data.length;
  50856. var pos = 0;
  50857. function pass(x0, y0, dx, dy, singlePass) {
  50858. if (singlePass === void 0) {
  50859. singlePass = false;
  50860. }
  50861. var w = Math.ceil((width - x0) / dx);
  50862. var h = Math.ceil((height - y0) / dy);
  50863. var scanlineLength = pixelBytes * w;
  50864. var buffer = singlePass ? pixels : new Buffer(scanlineLength * h);
  50865. var row = 0;
  50866. var c = 0;
  50867. while (row < h && pos < length) {
  50868. var byte, col, i, left, upper;
  50869. switch (data[pos++]) {
  50870. case 0:
  50871. // None
  50872. for (i = 0; i < scanlineLength; i++) {
  50873. buffer[c++] = data[pos++];
  50874. }
  50875. break;
  50876. case 1:
  50877. // Sub
  50878. for (i = 0; i < scanlineLength; i++) {
  50879. byte = data[pos++];
  50880. left = i < pixelBytes ? 0 : buffer[c - pixelBytes];
  50881. buffer[c++] = (byte + left) % 256;
  50882. }
  50883. break;
  50884. case 2:
  50885. // Up
  50886. for (i = 0; i < scanlineLength; i++) {
  50887. byte = data[pos++];
  50888. col = (i - i % pixelBytes) / pixelBytes;
  50889. upper = row && buffer[(row - 1) * scanlineLength + col * pixelBytes + i % pixelBytes];
  50890. buffer[c++] = (upper + byte) % 256;
  50891. }
  50892. break;
  50893. case 3:
  50894. // Average
  50895. for (i = 0; i < scanlineLength; i++) {
  50896. byte = data[pos++];
  50897. col = (i - i % pixelBytes) / pixelBytes;
  50898. left = i < pixelBytes ? 0 : buffer[c - pixelBytes];
  50899. upper = row && buffer[(row - 1) * scanlineLength + col * pixelBytes + i % pixelBytes];
  50900. buffer[c++] = (byte + Math.floor((left + upper) / 2)) % 256;
  50901. }
  50902. break;
  50903. case 4:
  50904. // Paeth
  50905. for (i = 0; i < scanlineLength; i++) {
  50906. var paeth, upperLeft;
  50907. byte = data[pos++];
  50908. col = (i - i % pixelBytes) / pixelBytes;
  50909. left = i < pixelBytes ? 0 : buffer[c - pixelBytes];
  50910. if (row === 0) {
  50911. upper = upperLeft = 0;
  50912. } else {
  50913. upper = buffer[(row - 1) * scanlineLength + col * pixelBytes + i % pixelBytes];
  50914. upperLeft = col && buffer[(row - 1) * scanlineLength + (col - 1) * pixelBytes + i % pixelBytes];
  50915. }
  50916. var p = left + upper - upperLeft;
  50917. var pa = Math.abs(p - left);
  50918. var pb = Math.abs(p - upper);
  50919. var pc = Math.abs(p - upperLeft);
  50920. if (pa <= pb && pa <= pc) {
  50921. paeth = left;
  50922. } else if (pb <= pc) {
  50923. paeth = upper;
  50924. } else {
  50925. paeth = upperLeft;
  50926. }
  50927. buffer[c++] = (byte + paeth) % 256;
  50928. }
  50929. break;
  50930. default:
  50931. throw new Error("Invalid filter algorithm: " + data[pos - 1]);
  50932. }
  50933. if (!singlePass) {
  50934. var pixelsPos = ((y0 + row * dy) * width + x0) * pixelBytes;
  50935. var bufferPos = row * scanlineLength;
  50936. for (i = 0; i < w; i++) {
  50937. for (var j = 0; j < pixelBytes; j++) {
  50938. pixels[pixelsPos++] = buffer[bufferPos++];
  50939. }
  50940. pixelsPos += (dx - 1) * pixelBytes;
  50941. }
  50942. }
  50943. row++;
  50944. }
  50945. }
  50946. if (_this.interlaceMethod === 1) {
  50947. /*
  50948. 1 6 4 6 2 6 4 6
  50949. 7 7 7 7 7 7 7 7
  50950. 5 6 5 6 5 6 5 6
  50951. 7 7 7 7 7 7 7 7
  50952. 3 6 4 6 3 6 4 6
  50953. 7 7 7 7 7 7 7 7
  50954. 5 6 5 6 5 6 5 6
  50955. 7 7 7 7 7 7 7 7
  50956. */
  50957. pass(0, 0, 8, 8); // 1
  50958. pass(4, 0, 8, 8); // 2
  50959. pass(0, 4, 4, 8); // 3
  50960. pass(2, 0, 4, 4); // 4
  50961. pass(0, 2, 2, 4); // 5
  50962. pass(1, 0, 2, 2); // 6
  50963. pass(0, 1, 1, 2); // 7
  50964. } else {
  50965. pass(0, 0, 1, 1, true);
  50966. }
  50967. return fn(pixels);
  50968. });
  50969. };
  50970. _proto.decodePalette = function decodePalette() {
  50971. var palette = this.palette;
  50972. var length = palette.length;
  50973. var transparency = this.transparency.indexed || [];
  50974. var ret = new Buffer(transparency.length + length);
  50975. var pos = 0;
  50976. var c = 0;
  50977. for (var _i2 = 0; _i2 < length; _i2 += 3) {
  50978. var left;
  50979. ret[pos++] = palette[_i2];
  50980. ret[pos++] = palette[_i2 + 1];
  50981. ret[pos++] = palette[_i2 + 2];
  50982. ret[pos++] = (left = transparency[c++]) != null ? left : 255;
  50983. }
  50984. return ret;
  50985. };
  50986. _proto.copyToImageData = function copyToImageData(imageData, pixels) {
  50987. var j, k;
  50988. var colors = this.colors;
  50989. var palette = null;
  50990. var alpha = this.hasAlphaChannel;
  50991. if (this.palette.length) {
  50992. palette = this._decodedPalette || (this._decodedPalette = this.decodePalette());
  50993. colors = 4;
  50994. alpha = true;
  50995. }
  50996. var data = imageData.data || imageData;
  50997. var length = data.length;
  50998. var input = palette || pixels;
  50999. var i = j = 0;
  51000. if (colors === 1) {
  51001. while (i < length) {
  51002. k = palette ? pixels[i / 4] * 4 : j;
  51003. var v = input[k++];
  51004. data[i++] = v;
  51005. data[i++] = v;
  51006. data[i++] = v;
  51007. data[i++] = alpha ? input[k++] : 255;
  51008. j = k;
  51009. }
  51010. } else {
  51011. while (i < length) {
  51012. k = palette ? pixels[i / 4] * 4 : j;
  51013. data[i++] = input[k++];
  51014. data[i++] = input[k++];
  51015. data[i++] = input[k++];
  51016. data[i++] = alpha ? input[k++] : 255;
  51017. j = k;
  51018. }
  51019. }
  51020. };
  51021. _proto.decode = function decode(fn) {
  51022. var _this2 = this;
  51023. var ret = new Buffer(this.width * this.height * 4);
  51024. return this.decodePixels(function (pixels) {
  51025. _this2.copyToImageData(ret, pixels);
  51026. return fn(ret);
  51027. });
  51028. };
  51029. return PNG;
  51030. }();
  51031. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(4).Buffer))
  51032. /***/ }),
  51033. /* 444 */
  51034. /***/ (function(module, exports, __webpack_require__) {
  51035. "use strict";
  51036. var isArray = __webpack_require__(0).isArray;
  51037. function typeName(bold, italics) {
  51038. var type = 'normal';
  51039. if (bold && italics) {
  51040. type = 'bolditalics';
  51041. } else if (bold) {
  51042. type = 'bold';
  51043. } else if (italics) {
  51044. type = 'italics';
  51045. }
  51046. return type;
  51047. }
  51048. function FontProvider(fontDescriptors, pdfKitDoc) {
  51049. this.fonts = {};
  51050. this.pdfKitDoc = pdfKitDoc;
  51051. this.fontCache = {};
  51052. for (var font in fontDescriptors) {
  51053. if (fontDescriptors.hasOwnProperty(font)) {
  51054. var fontDef = fontDescriptors[font];
  51055. this.fonts[font] = {
  51056. normal: fontDef.normal,
  51057. bold: fontDef.bold,
  51058. italics: fontDef.italics,
  51059. bolditalics: fontDef.bolditalics
  51060. };
  51061. }
  51062. }
  51063. }
  51064. FontProvider.prototype.getFontType = function (bold, italics) {
  51065. return typeName(bold, italics);
  51066. }
  51067. FontProvider.prototype.getFontFile = function (familyName, bold, italics) {
  51068. var type = this.getFontType(bold, italics);
  51069. if (!this.fonts[familyName] || !this.fonts[familyName][type]) {
  51070. return null;
  51071. }
  51072. return this.fonts[familyName][type];
  51073. }
  51074. FontProvider.prototype.provideFont = function (familyName, bold, italics) {
  51075. var type = this.getFontType(bold, italics);
  51076. if (this.getFontFile(familyName, bold, italics) === null) {
  51077. throw new Error('Font \'' + familyName + '\' in style \'' + type + '\' is not defined in the font section of the document definition.');
  51078. }
  51079. this.fontCache[familyName] = this.fontCache[familyName] || {};
  51080. if (!this.fontCache[familyName][type]) {
  51081. var def = this.fonts[familyName][type];
  51082. if (!isArray(def)) {
  51083. def = [def];
  51084. }
  51085. this.fontCache[familyName][type] = this.pdfKitDoc.font.apply(this.pdfKitDoc, def)._font;
  51086. }
  51087. return this.fontCache[familyName][type];
  51088. };
  51089. module.exports = FontProvider;
  51090. /***/ }),
  51091. /* 445 */
  51092. /***/ (function(module, exports, __webpack_require__) {
  51093. "use strict";
  51094. var TraversalTracker = __webpack_require__(210);
  51095. var DocPreprocessor = __webpack_require__(446);
  51096. var DocMeasure = __webpack_require__(447);
  51097. var DocumentContext = __webpack_require__(212);
  51098. var PageElementWriter = __webpack_require__(449);
  51099. var ColumnCalculator = __webpack_require__(131);
  51100. var TableProcessor = __webpack_require__(451);
  51101. var Line = __webpack_require__(213);
  51102. var isString = __webpack_require__(0).isString;
  51103. var isArray = __webpack_require__(0).isArray;
  51104. var isUndefined = __webpack_require__(0).isUndefined;
  51105. var isNull = __webpack_require__(0).isNull;
  51106. var pack = __webpack_require__(0).pack;
  51107. var offsetVector = __webpack_require__(0).offsetVector;
  51108. var fontStringify = __webpack_require__(0).fontStringify;
  51109. var getNodeId = __webpack_require__(0).getNodeId;
  51110. var isFunction = __webpack_require__(0).isFunction;
  51111. var TextTools = __webpack_require__(130);
  51112. var StyleContextStack = __webpack_require__(211);
  51113. var isNumber = __webpack_require__(0).isNumber;
  51114. function addAll(target, otherArray) {
  51115. otherArray.forEach(function (item) {
  51116. target.push(item);
  51117. });
  51118. }
  51119. /**
  51120. * Creates an instance of LayoutBuilder - layout engine which turns document-definition-object
  51121. * into a set of pages, lines, inlines and vectors ready to be rendered into a PDF
  51122. *
  51123. * @param {Object} pageSize - an object defining page width and height
  51124. * @param {Object} pageMargins - an object defining top, left, right and bottom margins
  51125. */
  51126. function LayoutBuilder(pageSize, pageMargins, imageMeasure, svgMeasure) {
  51127. this.pageSize = pageSize;
  51128. this.pageMargins = pageMargins;
  51129. this.tracker = new TraversalTracker();
  51130. this.imageMeasure = imageMeasure;
  51131. this.svgMeasure = svgMeasure;
  51132. this.tableLayouts = {};
  51133. }
  51134. LayoutBuilder.prototype.registerTableLayouts = function (tableLayouts) {
  51135. this.tableLayouts = pack(this.tableLayouts, tableLayouts);
  51136. };
  51137. /**
  51138. * Executes layout engine on document-definition-object and creates an array of pages
  51139. * containing positioned Blocks, Lines and inlines
  51140. *
  51141. * @param {Object} docStructure document-definition-object
  51142. * @param {Object} fontProvider font provider
  51143. * @param {Object} styleDictionary dictionary with style definitions
  51144. * @param {Object} defaultStyle default style definition
  51145. * @return {Array} an array of pages
  51146. */
  51147. LayoutBuilder.prototype.layoutDocument = function (docStructure, fontProvider, styleDictionary, defaultStyle, background, header, footer, images, watermark, pageBreakBeforeFct) {
  51148. function addPageBreaksIfNecessary(linearNodeList, pages) {
  51149. if (!isFunction(pageBreakBeforeFct)) {
  51150. return false;
  51151. }
  51152. linearNodeList = linearNodeList.filter(function (node) {
  51153. return node.positions.length > 0;
  51154. });
  51155. linearNodeList.forEach(function (node) {
  51156. var nodeInfo = {};
  51157. [
  51158. 'id', 'text', 'ul', 'ol', 'table', 'image', 'qr', 'canvas', 'svg', 'columns',
  51159. 'headlineLevel', 'style', 'pageBreak', 'pageOrientation',
  51160. 'width', 'height'
  51161. ].forEach(function (key) {
  51162. if (node[key] !== undefined) {
  51163. nodeInfo[key] = node[key];
  51164. }
  51165. });
  51166. nodeInfo.startPosition = node.positions[0];
  51167. nodeInfo.pageNumbers = node.positions.map(function (node) {
  51168. return node.pageNumber;
  51169. }).filter(function (element, position, array) {
  51170. return array.indexOf(element) === position;
  51171. });
  51172. nodeInfo.pages = pages.length;
  51173. nodeInfo.stack = isArray(node.stack);
  51174. node.nodeInfo = nodeInfo;
  51175. });
  51176. for (var index = 0; index < linearNodeList.length; index++) {
  51177. var node = linearNodeList[index];
  51178. if (node.pageBreak !== 'before' && !node.pageBreakCalculated) {
  51179. node.pageBreakCalculated = true;
  51180. var pageNumber = node.nodeInfo.pageNumbers[0];
  51181. var followingNodesOnPage = [];
  51182. var nodesOnNextPage = [];
  51183. var previousNodesOnPage = [];
  51184. for (var ii = index + 1, l = linearNodeList.length; ii < l; ii++) {
  51185. if (linearNodeList[ii].nodeInfo.pageNumbers.indexOf(pageNumber) > -1) {
  51186. followingNodesOnPage.push(linearNodeList[ii].nodeInfo);
  51187. }
  51188. if (linearNodeList[ii].nodeInfo.pageNumbers.indexOf(pageNumber + 1) > -1) {
  51189. nodesOnNextPage.push(linearNodeList[ii].nodeInfo);
  51190. }
  51191. }
  51192. for (var ii = 0; ii < index; ii++) {
  51193. if (linearNodeList[ii].nodeInfo.pageNumbers.indexOf(pageNumber) > -1) {
  51194. previousNodesOnPage.push(linearNodeList[ii].nodeInfo);
  51195. }
  51196. }
  51197. if (pageBreakBeforeFct(node.nodeInfo, followingNodesOnPage, nodesOnNextPage, previousNodesOnPage)) {
  51198. node.pageBreak = 'before';
  51199. return true;
  51200. }
  51201. }
  51202. }
  51203. return false;
  51204. }
  51205. this.docPreprocessor = new DocPreprocessor();
  51206. this.docMeasure = new DocMeasure(fontProvider, styleDictionary, defaultStyle, this.imageMeasure, this.svgMeasure, this.tableLayouts, images);
  51207. function resetXYs(result) {
  51208. result.linearNodeList.forEach(function (node) {
  51209. node.resetXY();
  51210. });
  51211. }
  51212. var result = this.tryLayoutDocument(docStructure, fontProvider, styleDictionary, defaultStyle, background, header, footer, images, watermark);
  51213. while (addPageBreaksIfNecessary(result.linearNodeList, result.pages)) {
  51214. resetXYs(result);
  51215. result = this.tryLayoutDocument(docStructure, fontProvider, styleDictionary, defaultStyle, background, header, footer, images, watermark);
  51216. }
  51217. return result.pages;
  51218. };
  51219. LayoutBuilder.prototype.tryLayoutDocument = function (docStructure, fontProvider, styleDictionary, defaultStyle, background, header, footer, images, watermark, pageBreakBeforeFct) {
  51220. this.linearNodeList = [];
  51221. docStructure = this.docPreprocessor.preprocessDocument(docStructure);
  51222. docStructure = this.docMeasure.measureDocument(docStructure);
  51223. this.writer = new PageElementWriter(
  51224. new DocumentContext(this.pageSize, this.pageMargins), this.tracker);
  51225. var _this = this;
  51226. this.writer.context().tracker.startTracking('pageAdded', function () {
  51227. _this.addBackground(background);
  51228. });
  51229. this.addBackground(background);
  51230. this.processNode(docStructure);
  51231. this.addHeadersAndFooters(header, footer);
  51232. if (watermark != null) {
  51233. this.addWatermark(watermark, fontProvider, defaultStyle);
  51234. }
  51235. return { pages: this.writer.context().pages, linearNodeList: this.linearNodeList };
  51236. };
  51237. LayoutBuilder.prototype.addBackground = function (background) {
  51238. var backgroundGetter = isFunction(background) ? background : function () {
  51239. return background;
  51240. };
  51241. var context = this.writer.context();
  51242. var pageSize = context.getCurrentPage().pageSize;
  51243. var pageBackground = backgroundGetter(context.page + 1, pageSize);
  51244. if (pageBackground) {
  51245. this.writer.beginUnbreakableBlock(pageSize.width, pageSize.height);
  51246. pageBackground = this.docPreprocessor.preprocessDocument(pageBackground);
  51247. this.processNode(this.docMeasure.measureDocument(pageBackground));
  51248. this.writer.commitUnbreakableBlock(0, 0);
  51249. context.backgroundLength[context.page] += pageBackground.positions.length;
  51250. }
  51251. };
  51252. LayoutBuilder.prototype.addStaticRepeatable = function (headerOrFooter, sizeFunction) {
  51253. this.addDynamicRepeatable(function () {
  51254. return JSON.parse(JSON.stringify(headerOrFooter)); // copy to new object
  51255. }, sizeFunction);
  51256. };
  51257. LayoutBuilder.prototype.addDynamicRepeatable = function (nodeGetter, sizeFunction) {
  51258. var pages = this.writer.context().pages;
  51259. for (var pageIndex = 0, l = pages.length; pageIndex < l; pageIndex++) {
  51260. this.writer.context().page = pageIndex;
  51261. var node = nodeGetter(pageIndex + 1, l, this.writer.context().pages[pageIndex].pageSize);
  51262. if (node) {
  51263. var sizes = sizeFunction(this.writer.context().getCurrentPage().pageSize, this.pageMargins);
  51264. this.writer.beginUnbreakableBlock(sizes.width, sizes.height);
  51265. node = this.docPreprocessor.preprocessDocument(node);
  51266. this.processNode(this.docMeasure.measureDocument(node));
  51267. this.writer.commitUnbreakableBlock(sizes.x, sizes.y);
  51268. }
  51269. }
  51270. };
  51271. LayoutBuilder.prototype.addHeadersAndFooters = function (header, footer) {
  51272. var headerSizeFct = function (pageSize, pageMargins) {
  51273. return {
  51274. x: 0,
  51275. y: 0,
  51276. width: pageSize.width,
  51277. height: pageMargins.top
  51278. };
  51279. };
  51280. var footerSizeFct = function (pageSize, pageMargins) {
  51281. return {
  51282. x: 0,
  51283. y: pageSize.height - pageMargins.bottom,
  51284. width: pageSize.width,
  51285. height: pageMargins.bottom
  51286. };
  51287. };
  51288. if (isFunction(header)) {
  51289. this.addDynamicRepeatable(header, headerSizeFct);
  51290. } else if (header) {
  51291. this.addStaticRepeatable(header, headerSizeFct);
  51292. }
  51293. if (isFunction(footer)) {
  51294. this.addDynamicRepeatable(footer, footerSizeFct);
  51295. } else if (footer) {
  51296. this.addStaticRepeatable(footer, footerSizeFct);
  51297. }
  51298. };
  51299. LayoutBuilder.prototype.addWatermark = function (watermark, fontProvider, defaultStyle) {
  51300. if (isString(watermark)) {
  51301. watermark = { 'text': watermark };
  51302. }
  51303. if (!watermark.text) { // empty watermark text
  51304. return;
  51305. }
  51306. watermark.font = watermark.font || defaultStyle.font || 'Roboto';
  51307. watermark.fontSize = watermark.fontSize || 'auto';
  51308. watermark.color = watermark.color || 'black';
  51309. watermark.opacity = isNumber(watermark.opacity) ? watermark.opacity : 0.6;
  51310. watermark.bold = watermark.bold || false;
  51311. watermark.italics = watermark.italics || false;
  51312. watermark.angle = !isUndefined(watermark.angle) && !isNull(watermark.angle) ? watermark.angle : null;
  51313. if (watermark.angle === null) {
  51314. watermark.angle = Math.atan2(this.pageSize.height, this.pageSize.width) * -180 / Math.PI;
  51315. }
  51316. if (watermark.fontSize === 'auto') {
  51317. watermark.fontSize = getWatermarkFontSize(this.pageSize, watermark, fontProvider);
  51318. }
  51319. var watermarkObject = {
  51320. text: watermark.text,
  51321. font: fontProvider.provideFont(watermark.font, watermark.bold, watermark.italics),
  51322. fontSize: watermark.fontSize,
  51323. color: watermark.color,
  51324. opacity: watermark.opacity,
  51325. angle: watermark.angle
  51326. };
  51327. watermarkObject._size = getWatermarkSize(watermark, fontProvider);
  51328. var pages = this.writer.context().pages;
  51329. for (var i = 0, l = pages.length; i < l; i++) {
  51330. pages[i].watermark = watermarkObject;
  51331. }
  51332. function getWatermarkSize(watermark, fontProvider) {
  51333. var textTools = new TextTools(fontProvider);
  51334. var styleContextStack = new StyleContextStack(null, { font: watermark.font, bold: watermark.bold, italics: watermark.italics });
  51335. styleContextStack.push({
  51336. fontSize: watermark.fontSize
  51337. });
  51338. var size = textTools.sizeOfString(watermark.text, styleContextStack);
  51339. var rotatedSize = textTools.sizeOfRotatedText(watermark.text, watermark.angle, styleContextStack);
  51340. return { size: size, rotatedSize: rotatedSize };
  51341. }
  51342. function getWatermarkFontSize(pageSize, watermark, fontProvider) {
  51343. var textTools = new TextTools(fontProvider);
  51344. var styleContextStack = new StyleContextStack(null, { font: watermark.font, bold: watermark.bold, italics: watermark.italics });
  51345. var rotatedSize;
  51346. /**
  51347. * Binary search the best font size.
  51348. * Initial bounds [0, 1000]
  51349. * Break when range < 1
  51350. */
  51351. var a = 0;
  51352. var b = 1000;
  51353. var c = (a + b) / 2;
  51354. while (Math.abs(a - b) > 1) {
  51355. styleContextStack.push({
  51356. fontSize: c
  51357. });
  51358. rotatedSize = textTools.sizeOfRotatedText(watermark.text, watermark.angle, styleContextStack);
  51359. if (rotatedSize.width > pageSize.width) {
  51360. b = c;
  51361. c = (a + b) / 2;
  51362. } else if (rotatedSize.width < pageSize.width) {
  51363. if (rotatedSize.height > pageSize.height) {
  51364. b = c;
  51365. c = (a + b) / 2;
  51366. } else {
  51367. a = c;
  51368. c = (a + b) / 2;
  51369. }
  51370. }
  51371. styleContextStack.pop();
  51372. }
  51373. /*
  51374. End binary search
  51375. */
  51376. return c;
  51377. }
  51378. };
  51379. function decorateNode(node) {
  51380. var x = node.x, y = node.y;
  51381. node.positions = [];
  51382. if (isArray(node.canvas)) {
  51383. node.canvas.forEach(function (vector) {
  51384. var x = vector.x, y = vector.y, x1 = vector.x1, y1 = vector.y1, x2 = vector.x2, y2 = vector.y2;
  51385. vector.resetXY = function () {
  51386. vector.x = x;
  51387. vector.y = y;
  51388. vector.x1 = x1;
  51389. vector.y1 = y1;
  51390. vector.x2 = x2;
  51391. vector.y2 = y2;
  51392. };
  51393. });
  51394. }
  51395. node.resetXY = function () {
  51396. node.x = x;
  51397. node.y = y;
  51398. if (isArray(node.canvas)) {
  51399. node.canvas.forEach(function (vector) {
  51400. vector.resetXY();
  51401. });
  51402. }
  51403. };
  51404. }
  51405. LayoutBuilder.prototype.processNode = function (node) {
  51406. var self = this;
  51407. this.linearNodeList.push(node);
  51408. decorateNode(node);
  51409. applyMargins(function () {
  51410. var unbreakable = node.unbreakable;
  51411. if (unbreakable) {
  51412. self.writer.beginUnbreakableBlock();
  51413. }
  51414. var absPosition = node.absolutePosition;
  51415. if (absPosition) {
  51416. self.writer.context().beginDetachedBlock();
  51417. self.writer.context().moveTo(absPosition.x || 0, absPosition.y || 0);
  51418. }
  51419. var relPosition = node.relativePosition;
  51420. if (relPosition) {
  51421. self.writer.context().beginDetachedBlock();
  51422. self.writer.context().moveToRelative(relPosition.x || 0, relPosition.y || 0);
  51423. }
  51424. if (node.stack) {
  51425. self.processVerticalContainer(node);
  51426. } else if (node.columns) {
  51427. self.processColumns(node);
  51428. } else if (node.ul) {
  51429. self.processList(false, node);
  51430. } else if (node.ol) {
  51431. self.processList(true, node);
  51432. } else if (node.table) {
  51433. self.processTable(node);
  51434. } else if (node.text !== undefined) {
  51435. self.processLeaf(node);
  51436. } else if (node.toc) {
  51437. self.processToc(node);
  51438. } else if (node.image) {
  51439. self.processImage(node);
  51440. } else if (node.svg) {
  51441. self.processSVG(node);
  51442. } else if (node.canvas) {
  51443. self.processCanvas(node);
  51444. } else if (node.qr) {
  51445. self.processQr(node);
  51446. } else if (!node._span) {
  51447. throw 'Unrecognized document structure: ' + JSON.stringify(node, fontStringify);
  51448. }
  51449. if (absPosition || relPosition) {
  51450. self.writer.context().endDetachedBlock();
  51451. }
  51452. if (unbreakable) {
  51453. self.writer.commitUnbreakableBlock();
  51454. }
  51455. });
  51456. function applyMargins(callback) {
  51457. var margin = node._margin;
  51458. if (node.pageBreak === 'before') {
  51459. self.writer.moveToNextPage(node.pageOrientation);
  51460. } else if (node.pageBreak === 'beforeOdd') {
  51461. self.writer.moveToNextPage(node.pageOrientation);
  51462. if ((self.writer.context().page + 1) % 2 === 1) {
  51463. self.writer.moveToNextPage(node.pageOrientation);
  51464. }
  51465. } else if (node.pageBreak === 'beforeEven') {
  51466. self.writer.moveToNextPage(node.pageOrientation);
  51467. if ((self.writer.context().page + 1) % 2 === 0) {
  51468. self.writer.moveToNextPage(node.pageOrientation);
  51469. }
  51470. }
  51471. if (margin) {
  51472. self.writer.context().moveDown(margin[1]);
  51473. self.writer.context().addMargin(margin[0], margin[2]);
  51474. }
  51475. callback();
  51476. if (margin) {
  51477. self.writer.context().addMargin(-margin[0], -margin[2]);
  51478. self.writer.context().moveDown(margin[3]);
  51479. }
  51480. if (node.pageBreak === 'after') {
  51481. self.writer.moveToNextPage(node.pageOrientation);
  51482. } else if (node.pageBreak === 'afterOdd') {
  51483. self.writer.moveToNextPage(node.pageOrientation);
  51484. if ((self.writer.context().page + 1) % 2 === 1) {
  51485. self.writer.moveToNextPage(node.pageOrientation);
  51486. }
  51487. } else if (node.pageBreak === 'afterEven') {
  51488. self.writer.moveToNextPage(node.pageOrientation);
  51489. if ((self.writer.context().page + 1) % 2 === 0) {
  51490. self.writer.moveToNextPage(node.pageOrientation);
  51491. }
  51492. }
  51493. }
  51494. };
  51495. // vertical container
  51496. LayoutBuilder.prototype.processVerticalContainer = function (node) {
  51497. var self = this;
  51498. node.stack.forEach(function (item) {
  51499. self.processNode(item);
  51500. addAll(node.positions, item.positions);
  51501. //TODO: paragraph gap
  51502. });
  51503. };
  51504. // columns
  51505. LayoutBuilder.prototype.processColumns = function (columnNode) {
  51506. var columns = columnNode.columns;
  51507. var availableWidth = this.writer.context().availableWidth;
  51508. var gaps = gapArray(columnNode._gap);
  51509. if (gaps) {
  51510. availableWidth -= (gaps.length - 1) * columnNode._gap;
  51511. }
  51512. ColumnCalculator.buildColumnWidths(columns, availableWidth);
  51513. var result = this.processRow(columns, columns, gaps);
  51514. addAll(columnNode.positions, result.positions);
  51515. function gapArray(gap) {
  51516. if (!gap) {
  51517. return null;
  51518. }
  51519. var gaps = [];
  51520. gaps.push(0);
  51521. for (var i = columns.length - 1; i > 0; i--) {
  51522. gaps.push(gap);
  51523. }
  51524. return gaps;
  51525. }
  51526. };
  51527. LayoutBuilder.prototype.processRow = function (columns, widths, gaps, tableBody, tableRow, height) {
  51528. var self = this;
  51529. var pageBreaks = [], positions = [];
  51530. this.tracker.auto('pageChanged', storePageBreakData, function () {
  51531. widths = widths || columns;
  51532. self.writer.context().beginColumnGroup();
  51533. for (var i = 0, l = columns.length; i < l; i++) {
  51534. var column = columns[i];
  51535. var width = widths[i]._calcWidth;
  51536. var leftOffset = colLeftOffset(i);
  51537. if (column.colSpan && column.colSpan > 1) {
  51538. for (var j = 1; j < column.colSpan; j++) {
  51539. width += widths[++i]._calcWidth + gaps[i];
  51540. }
  51541. }
  51542. self.writer.context().beginColumn(width, leftOffset, getEndingCell(column, i));
  51543. if (!column._span) {
  51544. self.processNode(column);
  51545. addAll(positions, column.positions);
  51546. } else if (column._columnEndingContext) {
  51547. // row-span ending
  51548. self.writer.context().markEnding(column);
  51549. }
  51550. }
  51551. self.writer.context().completeColumnGroup(height);
  51552. });
  51553. return { pageBreaks: pageBreaks, positions: positions };
  51554. function storePageBreakData(data) {
  51555. var pageDesc;
  51556. for (var i = 0, l = pageBreaks.length; i < l; i++) {
  51557. var desc = pageBreaks[i];
  51558. if (desc.prevPage === data.prevPage) {
  51559. pageDesc = desc;
  51560. break;
  51561. }
  51562. }
  51563. if (!pageDesc) {
  51564. pageDesc = data;
  51565. pageBreaks.push(pageDesc);
  51566. }
  51567. pageDesc.prevY = Math.max(pageDesc.prevY, data.prevY);
  51568. pageDesc.y = Math.min(pageDesc.y, data.y);
  51569. }
  51570. function colLeftOffset(i) {
  51571. if (gaps && gaps.length > i) {
  51572. return gaps[i];
  51573. }
  51574. return 0;
  51575. }
  51576. function getEndingCell(column, columnIndex) {
  51577. if (column.rowSpan && column.rowSpan > 1) {
  51578. var endingRow = tableRow + column.rowSpan - 1;
  51579. if (endingRow >= tableBody.length) {
  51580. throw 'Row span for column ' + columnIndex + ' (with indexes starting from 0) exceeded row count';
  51581. }
  51582. return tableBody[endingRow][columnIndex];
  51583. }
  51584. return null;
  51585. }
  51586. };
  51587. // lists
  51588. LayoutBuilder.prototype.processList = function (orderedList, node) {
  51589. var self = this,
  51590. items = orderedList ? node.ol : node.ul,
  51591. gapSize = node._gapSize;
  51592. this.writer.context().addMargin(gapSize.width);
  51593. var nextMarker;
  51594. this.tracker.auto('lineAdded', addMarkerToFirstLeaf, function () {
  51595. items.forEach(function (item) {
  51596. nextMarker = item.listMarker;
  51597. self.processNode(item);
  51598. addAll(node.positions, item.positions);
  51599. });
  51600. });
  51601. this.writer.context().addMargin(-gapSize.width);
  51602. function addMarkerToFirstLeaf(line) {
  51603. // I'm not very happy with the way list processing is implemented
  51604. // (both code and algorithm should be rethinked)
  51605. if (nextMarker) {
  51606. var marker = nextMarker;
  51607. nextMarker = null;
  51608. if (marker.canvas) {
  51609. var vector = marker.canvas[0];
  51610. offsetVector(vector, -marker._minWidth, 0);
  51611. self.writer.addVector(vector);
  51612. } else if (marker._inlines) {
  51613. var markerLine = new Line(self.pageSize.width);
  51614. markerLine.addInline(marker._inlines[0]);
  51615. markerLine.x = -marker._minWidth;
  51616. markerLine.y = line.getAscenderHeight() - markerLine.getAscenderHeight();
  51617. self.writer.addLine(markerLine, true);
  51618. }
  51619. }
  51620. }
  51621. };
  51622. // tables
  51623. LayoutBuilder.prototype.processTable = function (tableNode) {
  51624. var processor = new TableProcessor(tableNode);
  51625. processor.beginTable(this.writer);
  51626. var rowHeights = tableNode.table.heights;
  51627. for (var i = 0, l = tableNode.table.body.length; i < l; i++) {
  51628. processor.beginRow(i, this.writer);
  51629. var height;
  51630. if (isFunction(rowHeights)) {
  51631. height = rowHeights(i);
  51632. } else if (isArray(rowHeights)) {
  51633. height = rowHeights[i];
  51634. } else {
  51635. height = rowHeights;
  51636. }
  51637. if (height === 'auto') {
  51638. height = undefined;
  51639. }
  51640. var result = this.processRow(tableNode.table.body[i], tableNode.table.widths, tableNode._offsets.offsets, tableNode.table.body, i, height);
  51641. addAll(tableNode.positions, result.positions);
  51642. processor.endRow(i, this.writer, result.pageBreaks);
  51643. }
  51644. processor.endTable(this.writer);
  51645. };
  51646. // leafs (texts)
  51647. LayoutBuilder.prototype.processLeaf = function (node) {
  51648. var line = this.buildNextLine(node);
  51649. if (line && (node.tocItem || node.id)) {
  51650. line._node = node;
  51651. }
  51652. var currentHeight = (line) ? line.getHeight() : 0;
  51653. var maxHeight = node.maxHeight || -1;
  51654. if (line) {
  51655. var nodeId = getNodeId(node);
  51656. if (nodeId) {
  51657. line.id = nodeId;
  51658. }
  51659. }
  51660. if (node._tocItemRef) {
  51661. line._pageNodeRef = node._tocItemRef;
  51662. }
  51663. if (node._pageRef) {
  51664. line._pageNodeRef = node._pageRef._nodeRef;
  51665. }
  51666. if (line && line.inlines && isArray(line.inlines)) {
  51667. for (var i = 0, l = line.inlines.length; i < l; i++) {
  51668. if (line.inlines[i]._tocItemRef) {
  51669. line.inlines[i]._pageNodeRef = line.inlines[i]._tocItemRef;
  51670. }
  51671. if (line.inlines[i]._pageRef) {
  51672. line.inlines[i]._pageNodeRef = line.inlines[i]._pageRef._nodeRef;
  51673. }
  51674. }
  51675. }
  51676. while (line && (maxHeight === -1 || currentHeight < maxHeight)) {
  51677. var positions = this.writer.addLine(line);
  51678. node.positions.push(positions);
  51679. line = this.buildNextLine(node);
  51680. if (line) {
  51681. currentHeight += line.getHeight();
  51682. }
  51683. }
  51684. };
  51685. LayoutBuilder.prototype.processToc = function (node) {
  51686. if (node.toc.title) {
  51687. this.processNode(node.toc.title);
  51688. }
  51689. if (node.toc._table) {
  51690. this.processNode(node.toc._table);
  51691. }
  51692. };
  51693. LayoutBuilder.prototype.buildNextLine = function (textNode) {
  51694. function cloneInline(inline) {
  51695. var newInline = inline.constructor();
  51696. for (var key in inline) {
  51697. newInline[key] = inline[key];
  51698. }
  51699. return newInline;
  51700. }
  51701. if (!textNode._inlines || textNode._inlines.length === 0) {
  51702. return null;
  51703. }
  51704. var line = new Line(this.writer.context().availableWidth);
  51705. var textTools = new TextTools(null);
  51706. var isForceContinue = false;
  51707. while (textNode._inlines && textNode._inlines.length > 0 &&
  51708. (line.hasEnoughSpaceForInline(textNode._inlines[0], textNode._inlines.slice(1)) || isForceContinue)) {
  51709. var isHardWrap = false;
  51710. var inline = textNode._inlines.shift();
  51711. isForceContinue = false;
  51712. if (!inline.noWrap && inline.text.length > 1 && inline.width > line.getAvailableWidth()) {
  51713. var widthPerChar = inline.width / inline.text.length;
  51714. var maxChars = Math.floor(line.getAvailableWidth() / widthPerChar);
  51715. if (maxChars < 1) {
  51716. maxChars = 1;
  51717. }
  51718. if (maxChars < inline.text.length) {
  51719. var newInline = cloneInline(inline);
  51720. newInline.text = inline.text.substr(maxChars);
  51721. inline.text = inline.text.substr(0, maxChars);
  51722. newInline.width = textTools.widthOfString(newInline.text, newInline.font, newInline.fontSize, newInline.characterSpacing, newInline.fontFeatures);
  51723. inline.width = textTools.widthOfString(inline.text, inline.font, inline.fontSize, inline.characterSpacing, inline.fontFeatures);
  51724. textNode._inlines.unshift(newInline);
  51725. isHardWrap = true;
  51726. }
  51727. }
  51728. line.addInline(inline);
  51729. isForceContinue = inline.noNewLine && !isHardWrap;
  51730. }
  51731. line.lastLineInParagraph = textNode._inlines.length === 0;
  51732. return line;
  51733. };
  51734. // images
  51735. LayoutBuilder.prototype.processImage = function (node) {
  51736. var position = this.writer.addImage(node);
  51737. node.positions.push(position);
  51738. };
  51739. LayoutBuilder.prototype.processSVG = function (node) {
  51740. var position = this.writer.addSVG(node);
  51741. node.positions.push(position);
  51742. };
  51743. LayoutBuilder.prototype.processCanvas = function (node) {
  51744. var height = node._minHeight;
  51745. if (node.absolutePosition === undefined && this.writer.context().availableHeight < height) {
  51746. // TODO: support for canvas larger than a page
  51747. // TODO: support for other overflow methods
  51748. this.writer.moveToNextPage();
  51749. }
  51750. this.writer.alignCanvas(node);
  51751. node.canvas.forEach(function (vector) {
  51752. var position = this.writer.addVector(vector);
  51753. node.positions.push(position);
  51754. }, this);
  51755. this.writer.context().moveDown(height);
  51756. };
  51757. LayoutBuilder.prototype.processQr = function (node) {
  51758. var position = this.writer.addQr(node);
  51759. node.positions.push(position);
  51760. };
  51761. module.exports = LayoutBuilder;
  51762. /***/ }),
  51763. /* 446 */
  51764. /***/ (function(module, exports, __webpack_require__) {
  51765. "use strict";
  51766. /* WEBPACK VAR INJECTION */(function(Buffer) {
  51767. var isString = __webpack_require__(0).isString;
  51768. var isNumber = __webpack_require__(0).isNumber;
  51769. var isBoolean = __webpack_require__(0).isBoolean;
  51770. var isArray = __webpack_require__(0).isArray;
  51771. var isUndefined = __webpack_require__(0).isUndefined;
  51772. var fontStringify = __webpack_require__(0).fontStringify;
  51773. function DocPreprocessor() {
  51774. }
  51775. DocPreprocessor.prototype.preprocessDocument = function (docStructure) {
  51776. this.parentNode = null;
  51777. this.tocs = [];
  51778. this.nodeReferences = [];
  51779. return this.preprocessNode(docStructure);
  51780. };
  51781. DocPreprocessor.prototype.preprocessNode = function (node) {
  51782. // expand shortcuts and casting values
  51783. if (isArray(node)) {
  51784. node = { stack: node };
  51785. } else if (isString(node)) {
  51786. node = { text: node };
  51787. } else if (isNumber(node) || isBoolean(node)) {
  51788. node = { text: node.toString() };
  51789. } else if (node === undefined || node === null) {
  51790. node = { text: '' };
  51791. } else if (Object.keys(node).length === 0) { // empty object
  51792. node = { text: '' };
  51793. } else if ('text' in node && (node.text === undefined || node.text === null)) {
  51794. node.text = '';
  51795. }
  51796. if (node.columns) {
  51797. return this.preprocessColumns(node);
  51798. } else if (node.stack) {
  51799. return this.preprocessVerticalContainer(node);
  51800. } else if (node.ul) {
  51801. return this.preprocessList(node);
  51802. } else if (node.ol) {
  51803. return this.preprocessList(node);
  51804. } else if (node.table) {
  51805. return this.preprocessTable(node);
  51806. } else if (node.text !== undefined) {
  51807. return this.preprocessText(node);
  51808. } else if (node.toc) {
  51809. return this.preprocessToc(node);
  51810. } else if (node.image) {
  51811. return this.preprocessImage(node);
  51812. } else if (node.svg) {
  51813. return this.preprocessSVG(node);
  51814. } else if (node.canvas) {
  51815. return this.preprocessCanvas(node);
  51816. } else if (node.qr) {
  51817. return this.preprocessQr(node);
  51818. } else if (node.pageReference || node.textReference) {
  51819. return this.preprocessText(node);
  51820. } else {
  51821. throw 'Unrecognized document structure: ' + JSON.stringify(node, fontStringify);
  51822. }
  51823. };
  51824. DocPreprocessor.prototype.preprocessColumns = function (node) {
  51825. var columns = node.columns;
  51826. for (var i = 0, l = columns.length; i < l; i++) {
  51827. columns[i] = this.preprocessNode(columns[i]);
  51828. }
  51829. return node;
  51830. };
  51831. DocPreprocessor.prototype.preprocessVerticalContainer = function (node) {
  51832. var items = node.stack;
  51833. for (var i = 0, l = items.length; i < l; i++) {
  51834. items[i] = this.preprocessNode(items[i]);
  51835. }
  51836. return node;
  51837. };
  51838. DocPreprocessor.prototype.preprocessList = function (node) {
  51839. var items = node.ul || node.ol;
  51840. for (var i = 0, l = items.length; i < l; i++) {
  51841. items[i] = this.preprocessNode(items[i]);
  51842. }
  51843. return node;
  51844. };
  51845. DocPreprocessor.prototype.preprocessTable = function (node) {
  51846. var col, row, cols, rows;
  51847. for (col = 0, cols = node.table.body[0].length; col < cols; col++) {
  51848. for (row = 0, rows = node.table.body.length; row < rows; row++) {
  51849. var rowData = node.table.body[row];
  51850. var data = rowData[col];
  51851. if (data !== undefined) {
  51852. if (data === null) { // transform to object
  51853. data = '';
  51854. }
  51855. if (!data._span) {
  51856. rowData[col] = this.preprocessNode(data);
  51857. }
  51858. }
  51859. }
  51860. }
  51861. return node;
  51862. };
  51863. DocPreprocessor.prototype.preprocessText = function (node) {
  51864. if (node.tocItem) {
  51865. if (!isArray(node.tocItem)) {
  51866. node.tocItem = [node.tocItem];
  51867. }
  51868. for (var i = 0, l = node.tocItem.length; i < l; i++) {
  51869. if (!isString(node.tocItem[i])) {
  51870. node.tocItem[i] = '_default_';
  51871. }
  51872. var tocItemId = node.tocItem[i];
  51873. if (!this.tocs[tocItemId]) {
  51874. this.tocs[tocItemId] = { toc: { _items: [], _pseudo: true } };
  51875. }
  51876. if (!node.id) {
  51877. node.id = 'toc-' + tocItemId + '-' + this.tocs[tocItemId].toc._items.length;
  51878. }
  51879. var tocItemRef = {
  51880. _nodeRef: this._getNodeForNodeRef(node),
  51881. _textNodeRef: node
  51882. };
  51883. this.tocs[tocItemId].toc._items.push(tocItemRef);
  51884. }
  51885. }
  51886. if (node.id) {
  51887. if (this.nodeReferences[node.id]) {
  51888. if (!this.nodeReferences[node.id]._pseudo) {
  51889. throw "Node id '" + node.id + "' already exists";
  51890. }
  51891. this.nodeReferences[node.id]._nodeRef = this._getNodeForNodeRef(node);
  51892. this.nodeReferences[node.id]._textNodeRef = node;
  51893. this.nodeReferences[node.id]._pseudo = false;
  51894. } else {
  51895. this.nodeReferences[node.id] = {
  51896. _nodeRef: this._getNodeForNodeRef(node),
  51897. _textNodeRef: node
  51898. };
  51899. }
  51900. }
  51901. if (node.pageReference) {
  51902. if (!this.nodeReferences[node.pageReference]) {
  51903. this.nodeReferences[node.pageReference] = {
  51904. _nodeRef: {},
  51905. _textNodeRef: {},
  51906. _pseudo: true
  51907. };
  51908. }
  51909. node.text = '00000';
  51910. node.linkToDestination = node.pageReference;
  51911. node._pageRef = this.nodeReferences[node.pageReference];
  51912. }
  51913. if (node.textReference) {
  51914. if (!this.nodeReferences[node.textReference]) {
  51915. this.nodeReferences[node.textReference] = { _nodeRef: {}, _pseudo: true };
  51916. }
  51917. node.text = '';
  51918. node.linkToDestination = node.textReference;
  51919. node._textRef = this.nodeReferences[node.textReference];
  51920. }
  51921. if (node.text && node.text.text) {
  51922. node.text = [this.preprocessNode(node.text)];
  51923. } else if (isArray(node.text)) {
  51924. var isSetParentNode = false;
  51925. if (this.parentNode === null) {
  51926. this.parentNode = node;
  51927. isSetParentNode = true;
  51928. }
  51929. for (var i = 0, l = node.text.length; i < l; i++) {
  51930. node.text[i] = this.preprocessNode(node.text[i]);
  51931. }
  51932. if (isSetParentNode) {
  51933. this.parentNode = null;
  51934. }
  51935. }
  51936. return node;
  51937. };
  51938. DocPreprocessor.prototype.preprocessToc = function (node) {
  51939. if (!node.toc.id) {
  51940. node.toc.id = '_default_';
  51941. }
  51942. node.toc.title = node.toc.title ? this.preprocessNode(node.toc.title) : null;
  51943. node.toc._items = [];
  51944. if (this.tocs[node.toc.id]) {
  51945. if (!this.tocs[node.toc.id].toc._pseudo) {
  51946. throw "TOC '" + node.toc.id + "' already exists";
  51947. }
  51948. node.toc._items = this.tocs[node.toc.id].toc._items;
  51949. }
  51950. this.tocs[node.toc.id] = node;
  51951. return node;
  51952. };
  51953. DocPreprocessor.prototype.preprocessImage = function (node) {
  51954. if (!isUndefined(node.image.type) && !isUndefined(node.image.data) && (node.image.type === 'Buffer') && isArray(node.image.data)) {
  51955. node.image = Buffer.from(node.image.data);
  51956. }
  51957. return node;
  51958. };
  51959. DocPreprocessor.prototype.preprocessSVG = function (node) {
  51960. return node;
  51961. };
  51962. DocPreprocessor.prototype.preprocessCanvas = function (node) {
  51963. return node;
  51964. };
  51965. DocPreprocessor.prototype.preprocessQr = function (node) {
  51966. return node;
  51967. };
  51968. DocPreprocessor.prototype._getNodeForNodeRef = function (node) {
  51969. if (this.parentNode) {
  51970. return this.parentNode;
  51971. }
  51972. return node;
  51973. }
  51974. module.exports = DocPreprocessor;
  51975. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(4).Buffer))
  51976. /***/ }),
  51977. /* 447 */
  51978. /***/ (function(module, exports, __webpack_require__) {
  51979. "use strict";
  51980. /*eslint no-unused-vars: ["error", {"args": "none"}]*/
  51981. var TextTools = __webpack_require__(130);
  51982. var StyleContextStack = __webpack_require__(211);
  51983. var ColumnCalculator = __webpack_require__(131);
  51984. var isString = __webpack_require__(0).isString;
  51985. var isNumber = __webpack_require__(0).isNumber;
  51986. var isObject = __webpack_require__(0).isObject;
  51987. var isArray = __webpack_require__(0).isArray;
  51988. var fontStringify = __webpack_require__(0).fontStringify;
  51989. var getNodeId = __webpack_require__(0).getNodeId;
  51990. var pack = __webpack_require__(0).pack;
  51991. var qrEncoder = __webpack_require__(448);
  51992. /**
  51993. * @private
  51994. */
  51995. function DocMeasure(fontProvider, styleDictionary, defaultStyle, imageMeasure, svgMeasure, tableLayouts, images) {
  51996. this.textTools = new TextTools(fontProvider);
  51997. this.styleStack = new StyleContextStack(styleDictionary, defaultStyle);
  51998. this.imageMeasure = imageMeasure;
  51999. this.svgMeasure = svgMeasure;
  52000. this.tableLayouts = tableLayouts;
  52001. this.images = images;
  52002. this.autoImageIndex = 1;
  52003. }
  52004. /**
  52005. * Measures all nodes and sets min/max-width properties required for the second
  52006. * layout-pass.
  52007. * @param {Object} docStructure document-definition-object
  52008. * @return {Object} document-measurement-object
  52009. */
  52010. DocMeasure.prototype.measureDocument = function (docStructure) {
  52011. return this.measureNode(docStructure);
  52012. };
  52013. DocMeasure.prototype.measureNode = function (node) {
  52014. var self = this;
  52015. return this.styleStack.auto(node, function () {
  52016. // TODO: refactor + rethink whether this is the proper way to handle margins
  52017. node._margin = getNodeMargin(node);
  52018. if (node.columns) {
  52019. return extendMargins(self.measureColumns(node));
  52020. } else if (node.stack) {
  52021. return extendMargins(self.measureVerticalContainer(node));
  52022. } else if (node.ul) {
  52023. return extendMargins(self.measureUnorderedList(node));
  52024. } else if (node.ol) {
  52025. return extendMargins(self.measureOrderedList(node));
  52026. } else if (node.table) {
  52027. return extendMargins(self.measureTable(node));
  52028. } else if (node.text !== undefined) {
  52029. return extendMargins(self.measureLeaf(node));
  52030. } else if (node.toc) {
  52031. return extendMargins(self.measureToc(node));
  52032. } else if (node.image) {
  52033. return extendMargins(self.measureImage(node));
  52034. } else if (node.svg) {
  52035. return extendMargins(self.measureSVG(node));
  52036. } else if (node.canvas) {
  52037. return extendMargins(self.measureCanvas(node));
  52038. } else if (node.qr) {
  52039. return extendMargins(self.measureQr(node));
  52040. } else {
  52041. throw 'Unrecognized document structure: ' + JSON.stringify(node, fontStringify);
  52042. }
  52043. });
  52044. function extendMargins(node) {
  52045. var margin = node._margin;
  52046. if (margin) {
  52047. node._minWidth += margin[0] + margin[2];
  52048. node._maxWidth += margin[0] + margin[2];
  52049. }
  52050. return node;
  52051. }
  52052. function getNodeMargin() {
  52053. function processSingleMargins(node, currentMargin) {
  52054. if (node.marginLeft || node.marginTop || node.marginRight || node.marginBottom) {
  52055. return [
  52056. node.marginLeft || currentMargin[0] || 0,
  52057. node.marginTop || currentMargin[1] || 0,
  52058. node.marginRight || currentMargin[2] || 0,
  52059. node.marginBottom || currentMargin[3] || 0
  52060. ];
  52061. }
  52062. return currentMargin;
  52063. }
  52064. function flattenStyleArray(styleArray) {
  52065. var flattenedStyles = {};
  52066. for (var i = styleArray.length - 1; i >= 0; i--) {
  52067. var styleName = styleArray[i];
  52068. var style = self.styleStack.styleDictionary[styleName];
  52069. for (var key in style) {
  52070. if (style.hasOwnProperty(key)) {
  52071. flattenedStyles[key] = style[key];
  52072. }
  52073. }
  52074. }
  52075. return flattenedStyles;
  52076. }
  52077. function convertMargin(margin) {
  52078. if (isNumber(margin)) {
  52079. margin = [margin, margin, margin, margin];
  52080. } else if (isArray(margin)) {
  52081. if (margin.length === 2) {
  52082. margin = [margin[0], margin[1], margin[0], margin[1]];
  52083. }
  52084. }
  52085. return margin;
  52086. }
  52087. var margin = [undefined, undefined, undefined, undefined];
  52088. if (node.style) {
  52089. var styleArray = isArray(node.style) ? node.style : [node.style];
  52090. var flattenedStyleArray = flattenStyleArray(styleArray);
  52091. if (flattenedStyleArray) {
  52092. margin = processSingleMargins(flattenedStyleArray, margin);
  52093. }
  52094. if (flattenedStyleArray.margin) {
  52095. margin = convertMargin(flattenedStyleArray.margin);
  52096. }
  52097. }
  52098. margin = processSingleMargins(node, margin);
  52099. if (node.margin) {
  52100. margin = convertMargin(node.margin);
  52101. }
  52102. if (margin[0] === undefined && margin[1] === undefined && margin[2] === undefined && margin[3] === undefined) {
  52103. return null;
  52104. } else {
  52105. return margin;
  52106. }
  52107. }
  52108. };
  52109. DocMeasure.prototype.convertIfBase64Image = function (node) {
  52110. if (/^data:image\/(jpeg|jpg|png);base64,/.test(node.image)) {
  52111. var label = '$$pdfmake$$' + this.autoImageIndex++;
  52112. this.images[label] = node.image;
  52113. node.image = label;
  52114. }
  52115. };
  52116. DocMeasure.prototype.measureImageWithDimensions = function (node, dimensions) {
  52117. if (node.fit) {
  52118. var factor = (dimensions.width / dimensions.height > node.fit[0] / node.fit[1]) ? node.fit[0] / dimensions.width : node.fit[1] / dimensions.height;
  52119. node._width = node._minWidth = node._maxWidth = dimensions.width * factor;
  52120. node._height = dimensions.height * factor;
  52121. } else {
  52122. node._width = node._minWidth = node._maxWidth = node.width || dimensions.width;
  52123. node._height = node.height || (dimensions.height * node._width / dimensions.width);
  52124. if (isNumber(node.maxWidth) && node.maxWidth < node._width) {
  52125. node._width = node._minWidth = node._maxWidth = node.maxWidth;
  52126. node._height = node._width * dimensions.height / dimensions.width;
  52127. }
  52128. if (isNumber(node.maxHeight) && node.maxHeight < node._height) {
  52129. node._height = node.maxHeight;
  52130. node._width = node._minWidth = node._maxWidth = node._height * dimensions.width / dimensions.height;
  52131. }
  52132. if (isNumber(node.minWidth) && node.minWidth > node._width) {
  52133. node._width = node._minWidth = node._maxWidth = node.minWidth;
  52134. node._height = node._width * dimensions.height / dimensions.width;
  52135. }
  52136. if (isNumber(node.minHeight) && node.minHeight > node._height) {
  52137. node._height = node.minHeight;
  52138. node._width = node._minWidth = node._maxWidth = node._height * dimensions.width / dimensions.height;
  52139. }
  52140. }
  52141. node._alignment = this.styleStack.getProperty('alignment');
  52142. };
  52143. DocMeasure.prototype.measureImage = function (node) {
  52144. if (this.images) {
  52145. this.convertIfBase64Image(node);
  52146. }
  52147. var dimensions = this.imageMeasure.measureImage(node.image);
  52148. this.measureImageWithDimensions(node, dimensions);
  52149. return node;
  52150. };
  52151. DocMeasure.prototype.measureSVG = function (node) {
  52152. var dimensions = this.svgMeasure.measureSVG(node.svg);
  52153. this.measureImageWithDimensions(node, dimensions);
  52154. node.font = this.styleStack.getProperty('font');
  52155. // scale SVG based on final dimension
  52156. node.svg = this.svgMeasure.writeDimensions(node.svg, {
  52157. width: node._width,
  52158. height: node._height
  52159. });
  52160. return node;
  52161. };
  52162. DocMeasure.prototype.measureLeaf = function (node) {
  52163. if (node._textRef && node._textRef._textNodeRef.text) {
  52164. node.text = node._textRef._textNodeRef.text;
  52165. }
  52166. // Make sure style properties of the node itself are considered when building inlines.
  52167. // We could also just pass [node] to buildInlines, but that fails for bullet points.
  52168. var styleStack = this.styleStack.clone();
  52169. styleStack.push(node);
  52170. var data = this.textTools.buildInlines(node.text, styleStack);
  52171. node._inlines = data.items;
  52172. node._minWidth = data.minWidth;
  52173. node._maxWidth = data.maxWidth;
  52174. return node;
  52175. };
  52176. DocMeasure.prototype.measureToc = function (node) {
  52177. if (node.toc.title) {
  52178. node.toc.title = this.measureNode(node.toc.title);
  52179. }
  52180. if (node.toc._items.length > 0) {
  52181. var body = [];
  52182. var textStyle = node.toc.textStyle || {};
  52183. var numberStyle = node.toc.numberStyle || textStyle;
  52184. var textMargin = node.toc.textMargin || [0, 0, 0, 0];
  52185. for (var i = 0, l = node.toc._items.length; i < l; i++) {
  52186. var item = node.toc._items[i];
  52187. var lineStyle = item._textNodeRef.tocStyle || textStyle;
  52188. var lineMargin = item._textNodeRef.tocMargin || textMargin;
  52189. var lineNumberStyle = item._textNodeRef.tocNumberStyle || numberStyle;
  52190. var destination = getNodeId(item._nodeRef);
  52191. body.push([
  52192. { text: item._textNodeRef.text, linkToDestination: destination, alignment: 'left', style: lineStyle, margin: lineMargin },
  52193. { text: '00000', linkToDestination: destination, alignment: 'right', _tocItemRef: item._nodeRef, style: lineNumberStyle, margin: [0, lineMargin[1], 0, lineMargin[3]] }
  52194. ]);
  52195. }
  52196. node.toc._table = {
  52197. table: {
  52198. dontBreakRows: true,
  52199. widths: ['*', 'auto'],
  52200. body: body
  52201. },
  52202. layout: 'noBorders'
  52203. };
  52204. node.toc._table = this.measureNode(node.toc._table);
  52205. }
  52206. return node;
  52207. };
  52208. DocMeasure.prototype.measureVerticalContainer = function (node) {
  52209. var items = node.stack;
  52210. node._minWidth = 0;
  52211. node._maxWidth = 0;
  52212. for (var i = 0, l = items.length; i < l; i++) {
  52213. items[i] = this.measureNode(items[i]);
  52214. node._minWidth = Math.max(node._minWidth, items[i]._minWidth);
  52215. node._maxWidth = Math.max(node._maxWidth, items[i]._maxWidth);
  52216. }
  52217. return node;
  52218. };
  52219. DocMeasure.prototype.gapSizeForList = function () {
  52220. return this.textTools.sizeOfString('9. ', this.styleStack);
  52221. };
  52222. DocMeasure.prototype.buildUnorderedMarker = function (styleStack, gapSize, type) {
  52223. function buildDisc(gapSize, color) {
  52224. // TODO: ascender-based calculations
  52225. var radius = gapSize.fontSize / 6;
  52226. return {
  52227. canvas: [{
  52228. x: radius,
  52229. y: (gapSize.height / gapSize.lineHeight) + gapSize.descender - gapSize.fontSize / 3,
  52230. r1: radius,
  52231. r2: radius,
  52232. type: 'ellipse',
  52233. color: color
  52234. }]
  52235. };
  52236. }
  52237. function buildSquare(gapSize, color) {
  52238. // TODO: ascender-based calculations
  52239. var size = gapSize.fontSize / 3;
  52240. return {
  52241. canvas: [{
  52242. x: 0,
  52243. y: (gapSize.height / gapSize.lineHeight) + gapSize.descender - (gapSize.fontSize / 3) - (size / 2),
  52244. h: size,
  52245. w: size,
  52246. type: 'rect',
  52247. color: color
  52248. }]
  52249. };
  52250. }
  52251. function buildCircle(gapSize, color) {
  52252. // TODO: ascender-based calculations
  52253. var radius = gapSize.fontSize / 6;
  52254. return {
  52255. canvas: [{
  52256. x: radius,
  52257. y: (gapSize.height / gapSize.lineHeight) + gapSize.descender - gapSize.fontSize / 3,
  52258. r1: radius,
  52259. r2: radius,
  52260. type: 'ellipse',
  52261. lineColor: color
  52262. }]
  52263. };
  52264. }
  52265. var marker;
  52266. var color = styleStack.getProperty('markerColor') || styleStack.getProperty('color') || 'black';
  52267. switch (type) {
  52268. case 'circle':
  52269. marker = buildCircle(gapSize, color);
  52270. break;
  52271. case 'square':
  52272. marker = buildSquare(gapSize, color);
  52273. break;
  52274. case 'none':
  52275. marker = {};
  52276. break;
  52277. case 'disc':
  52278. default:
  52279. marker = buildDisc(gapSize, color);
  52280. break;
  52281. }
  52282. marker._minWidth = marker._maxWidth = gapSize.width;
  52283. marker._minHeight = marker._maxHeight = gapSize.height;
  52284. return marker;
  52285. };
  52286. DocMeasure.prototype.buildOrderedMarker = function (counter, styleStack, type, separator) {
  52287. function prepareAlpha(counter) {
  52288. function toAlpha(num) {
  52289. return (num >= 26 ? toAlpha((num / 26 >> 0) - 1) : '') + 'abcdefghijklmnopqrstuvwxyz'[num % 26 >> 0];
  52290. }
  52291. if (counter < 1) {
  52292. return counter.toString();
  52293. }
  52294. return toAlpha(counter - 1);
  52295. }
  52296. function prepareRoman(counter) {
  52297. if (counter < 1 || counter > 4999) {
  52298. return counter.toString();
  52299. }
  52300. var num = counter;
  52301. var lookup = { M: 1000, CM: 900, D: 500, CD: 400, C: 100, XC: 90, L: 50, XL: 40, X: 10, IX: 9, V: 5, IV: 4, I: 1 }, roman = '', i;
  52302. for (i in lookup) {
  52303. while (num >= lookup[i]) {
  52304. roman += i;
  52305. num -= lookup[i];
  52306. }
  52307. }
  52308. return roman;
  52309. }
  52310. function prepareDecimal(counter) {
  52311. return counter.toString();
  52312. }
  52313. var counterText;
  52314. switch (type) {
  52315. case 'none':
  52316. counterText = null;
  52317. break;
  52318. case 'upper-alpha':
  52319. counterText = prepareAlpha(counter).toUpperCase();
  52320. break;
  52321. case 'lower-alpha':
  52322. counterText = prepareAlpha(counter);
  52323. break;
  52324. case 'upper-roman':
  52325. counterText = prepareRoman(counter);
  52326. break;
  52327. case 'lower-roman':
  52328. counterText = prepareRoman(counter).toLowerCase();
  52329. break;
  52330. case 'decimal':
  52331. default:
  52332. counterText = prepareDecimal(counter);
  52333. break;
  52334. }
  52335. if (counterText === null) {
  52336. return {};
  52337. }
  52338. if (separator) {
  52339. if (isArray(separator)) {
  52340. if (separator[0]) {
  52341. counterText = separator[0] + counterText;
  52342. }
  52343. if (separator[1]) {
  52344. counterText += separator[1];
  52345. }
  52346. counterText += ' ';
  52347. } else {
  52348. counterText += separator + ' ';
  52349. }
  52350. }
  52351. var textArray = { text: counterText };
  52352. var markerColor = styleStack.getProperty('markerColor');
  52353. if (markerColor) {
  52354. textArray.color = markerColor;
  52355. }
  52356. return { _inlines: this.textTools.buildInlines(textArray, styleStack).items };
  52357. };
  52358. DocMeasure.prototype.measureUnorderedList = function (node) {
  52359. var style = this.styleStack.clone();
  52360. var items = node.ul;
  52361. node.type = node.type || 'disc';
  52362. node._gapSize = this.gapSizeForList();
  52363. node._minWidth = 0;
  52364. node._maxWidth = 0;
  52365. for (var i = 0, l = items.length; i < l; i++) {
  52366. var item = items[i] = this.measureNode(items[i]);
  52367. if (!item.ol && !item.ul) {
  52368. item.listMarker = this.buildUnorderedMarker(style, node._gapSize, item.listType || node.type);
  52369. }
  52370. node._minWidth = Math.max(node._minWidth, items[i]._minWidth + node._gapSize.width);
  52371. node._maxWidth = Math.max(node._maxWidth, items[i]._maxWidth + node._gapSize.width);
  52372. }
  52373. return node;
  52374. };
  52375. DocMeasure.prototype.measureOrderedList = function (node) {
  52376. var style = this.styleStack.clone();
  52377. var items = node.ol;
  52378. node.type = node.type || 'decimal';
  52379. node.separator = node.separator || '.';
  52380. node.reversed = node.reversed || false;
  52381. if (!isNumber(node.start)) {
  52382. node.start = node.reversed ? items.length : 1;
  52383. }
  52384. node._gapSize = this.gapSizeForList();
  52385. node._minWidth = 0;
  52386. node._maxWidth = 0;
  52387. var counter = node.start;
  52388. for (var i = 0, l = items.length; i < l; i++) {
  52389. var item = items[i] = this.measureNode(items[i]);
  52390. if (!item.ol && !item.ul) {
  52391. var counterValue = isNumber(item.counter) ? item.counter : counter;
  52392. item.listMarker = this.buildOrderedMarker(counterValue, style, item.listType || node.type, node.separator);
  52393. if (item.listMarker._inlines) {
  52394. node._gapSize.width = Math.max(node._gapSize.width, item.listMarker._inlines[0].width);
  52395. }
  52396. } // TODO: else - nested lists numbering
  52397. node._minWidth = Math.max(node._minWidth, items[i]._minWidth);
  52398. node._maxWidth = Math.max(node._maxWidth, items[i]._maxWidth);
  52399. if (node.reversed) {
  52400. counter--;
  52401. } else {
  52402. counter++;
  52403. }
  52404. }
  52405. node._minWidth += node._gapSize.width;
  52406. node._maxWidth += node._gapSize.width;
  52407. for (var i = 0, l = items.length; i < l; i++) {
  52408. var item = items[i];
  52409. if (!item.ol && !item.ul) {
  52410. item.listMarker._minWidth = item.listMarker._maxWidth = node._gapSize.width;
  52411. }
  52412. }
  52413. return node;
  52414. };
  52415. DocMeasure.prototype.measureColumns = function (node) {
  52416. var columns = node.columns;
  52417. node._gap = this.styleStack.getProperty('columnGap') || 0;
  52418. for (var i = 0, l = columns.length; i < l; i++) {
  52419. columns[i] = this.measureNode(columns[i]);
  52420. }
  52421. var measures = ColumnCalculator.measureMinMax(columns);
  52422. var numGaps = (columns.length > 0) ? (columns.length - 1) : 0;
  52423. node._minWidth = measures.min + node._gap * numGaps;
  52424. node._maxWidth = measures.max + node._gap * numGaps;
  52425. return node;
  52426. };
  52427. DocMeasure.prototype.measureTable = function (node) {
  52428. extendTableWidths(node);
  52429. node._layout = getLayout(this.tableLayouts);
  52430. node._offsets = getOffsets(node._layout);
  52431. var colSpans = [];
  52432. var col, row, cols, rows;
  52433. for (col = 0, cols = node.table.body[0].length; col < cols; col++) {
  52434. var c = node.table.widths[col];
  52435. c._minWidth = 0;
  52436. c._maxWidth = 0;
  52437. for (row = 0, rows = node.table.body.length; row < rows; row++) {
  52438. var rowData = node.table.body[row];
  52439. var data = rowData[col];
  52440. if (data === undefined) {
  52441. console.error('Malformed table row ', rowData, 'in node ', node);
  52442. throw 'Malformed table row, a cell is undefined.';
  52443. }
  52444. if (data === null) { // transform to object
  52445. data = '';
  52446. }
  52447. if (!data._span) {
  52448. data = rowData[col] = this.styleStack.auto(data, measureCb(this, data));
  52449. if (data.colSpan && data.colSpan > 1) {
  52450. markSpans(rowData, col, data.colSpan);
  52451. colSpans.push({ col: col, span: data.colSpan, minWidth: data._minWidth, maxWidth: data._maxWidth });
  52452. } else {
  52453. c._minWidth = Math.max(c._minWidth, data._minWidth);
  52454. c._maxWidth = Math.max(c._maxWidth, data._maxWidth);
  52455. }
  52456. }
  52457. if (data.rowSpan && data.rowSpan > 1) {
  52458. markVSpans(node.table, row, col, data.rowSpan);
  52459. }
  52460. }
  52461. }
  52462. extendWidthsForColSpans();
  52463. var measures = ColumnCalculator.measureMinMax(node.table.widths);
  52464. node._minWidth = measures.min + node._offsets.total;
  52465. node._maxWidth = measures.max + node._offsets.total;
  52466. return node;
  52467. function measureCb(_this, data) {
  52468. return function () {
  52469. if (isObject(data)) {
  52470. data.fillColor = _this.styleStack.getProperty('fillColor');
  52471. data.fillOpacity = _this.styleStack.getProperty('fillOpacity');
  52472. }
  52473. return _this.measureNode(data);
  52474. };
  52475. }
  52476. function getLayout(tableLayouts) {
  52477. var layout = node.layout;
  52478. if (isString(layout)) {
  52479. layout = tableLayouts[layout];
  52480. }
  52481. var defaultLayout = {
  52482. hLineWidth: function (i, node) {
  52483. return 1;
  52484. },
  52485. vLineWidth: function (i, node) {
  52486. return 1;
  52487. },
  52488. hLineColor: function (i, node) {
  52489. return 'black';
  52490. },
  52491. vLineColor: function (i, node) {
  52492. return 'black';
  52493. },
  52494. hLineStyle: function (i, node) {
  52495. return null;
  52496. },
  52497. vLineStyle: function (i, node) {
  52498. return null;
  52499. },
  52500. paddingLeft: function (i, node) {
  52501. return 4;
  52502. },
  52503. paddingRight: function (i, node) {
  52504. return 4;
  52505. },
  52506. paddingTop: function (i, node) {
  52507. return 2;
  52508. },
  52509. paddingBottom: function (i, node) {
  52510. return 2;
  52511. },
  52512. fillColor: function (i, node) {
  52513. return null;
  52514. },
  52515. fillOpacity: function (i, node) {
  52516. return 1;
  52517. },
  52518. defaultBorder: true
  52519. };
  52520. return pack(defaultLayout, layout);
  52521. }
  52522. function getOffsets(layout) {
  52523. var offsets = [];
  52524. var totalOffset = 0;
  52525. var prevRightPadding = 0;
  52526. for (var i = 0, l = node.table.widths.length; i < l; i++) {
  52527. var lOffset = prevRightPadding + layout.vLineWidth(i, node) + layout.paddingLeft(i, node);
  52528. offsets.push(lOffset);
  52529. totalOffset += lOffset;
  52530. prevRightPadding = layout.paddingRight(i, node);
  52531. }
  52532. totalOffset += prevRightPadding + layout.vLineWidth(node.table.widths.length, node);
  52533. return {
  52534. total: totalOffset,
  52535. offsets: offsets
  52536. };
  52537. }
  52538. function extendWidthsForColSpans() {
  52539. var q, j;
  52540. for (var i = 0, l = colSpans.length; i < l; i++) {
  52541. var span = colSpans[i];
  52542. var currentMinMax = getMinMax(span.col, span.span, node._offsets);
  52543. var minDifference = span.minWidth - currentMinMax.minWidth;
  52544. var maxDifference = span.maxWidth - currentMinMax.maxWidth;
  52545. if (minDifference > 0) {
  52546. q = minDifference / span.span;
  52547. for (j = 0; j < span.span; j++) {
  52548. node.table.widths[span.col + j]._minWidth += q;
  52549. }
  52550. }
  52551. if (maxDifference > 0) {
  52552. q = maxDifference / span.span;
  52553. for (j = 0; j < span.span; j++) {
  52554. node.table.widths[span.col + j]._maxWidth += q;
  52555. }
  52556. }
  52557. }
  52558. }
  52559. function getMinMax(col, span, offsets) {
  52560. var result = { minWidth: 0, maxWidth: 0 };
  52561. for (var i = 0; i < span; i++) {
  52562. result.minWidth += node.table.widths[col + i]._minWidth + (i ? offsets.offsets[col + i] : 0);
  52563. result.maxWidth += node.table.widths[col + i]._maxWidth + (i ? offsets.offsets[col + i] : 0);
  52564. }
  52565. return result;
  52566. }
  52567. function markSpans(rowData, col, span) {
  52568. for (var i = 1; i < span; i++) {
  52569. rowData[col + i] = {
  52570. _span: true,
  52571. _minWidth: 0,
  52572. _maxWidth: 0,
  52573. rowSpan: rowData[col].rowSpan
  52574. };
  52575. }
  52576. }
  52577. function markVSpans(table, row, col, span) {
  52578. for (var i = 1; i < span; i++) {
  52579. table.body[row + i][col] = {
  52580. _span: true,
  52581. _minWidth: 0,
  52582. _maxWidth: 0,
  52583. fillColor: table.body[row][col].fillColor,
  52584. fillOpacity: table.body[row][col].fillOpacity
  52585. };
  52586. }
  52587. }
  52588. function extendTableWidths(node) {
  52589. if (!node.table.widths) {
  52590. node.table.widths = 'auto';
  52591. }
  52592. if (isString(node.table.widths)) {
  52593. node.table.widths = [node.table.widths];
  52594. while (node.table.widths.length < node.table.body[0].length) {
  52595. node.table.widths.push(node.table.widths[node.table.widths.length - 1]);
  52596. }
  52597. }
  52598. for (var i = 0, l = node.table.widths.length; i < l; i++) {
  52599. var w = node.table.widths[i];
  52600. if (isNumber(w) || isString(w)) {
  52601. node.table.widths[i] = { width: w };
  52602. }
  52603. }
  52604. }
  52605. };
  52606. DocMeasure.prototype.measureCanvas = function (node) {
  52607. var w = 0, h = 0;
  52608. for (var i = 0, l = node.canvas.length; i < l; i++) {
  52609. var vector = node.canvas[i];
  52610. switch (vector.type) {
  52611. case 'ellipse':
  52612. w = Math.max(w, vector.x + vector.r1);
  52613. h = Math.max(h, vector.y + vector.r2);
  52614. break;
  52615. case 'rect':
  52616. w = Math.max(w, vector.x + vector.w);
  52617. h = Math.max(h, vector.y + vector.h);
  52618. break;
  52619. case 'line':
  52620. w = Math.max(w, vector.x1, vector.x2);
  52621. h = Math.max(h, vector.y1, vector.y2);
  52622. break;
  52623. case 'polyline':
  52624. for (var i2 = 0, l2 = vector.points.length; i2 < l2; i2++) {
  52625. w = Math.max(w, vector.points[i2].x);
  52626. h = Math.max(h, vector.points[i2].y);
  52627. }
  52628. break;
  52629. }
  52630. }
  52631. node._minWidth = node._maxWidth = w;
  52632. node._minHeight = node._maxHeight = h;
  52633. node._alignment = this.styleStack.getProperty('alignment');
  52634. return node;
  52635. };
  52636. DocMeasure.prototype.measureQr = function (node) {
  52637. node = qrEncoder.measure(node);
  52638. node._alignment = this.styleStack.getProperty('alignment');
  52639. return node;
  52640. };
  52641. module.exports = DocMeasure;
  52642. /***/ }),
  52643. /* 448 */
  52644. /***/ (function(module, exports, __webpack_require__) {
  52645. "use strict";
  52646. /*eslint no-unused-vars: ["error", {"args": "none"}]*/
  52647. /*eslint no-redeclare: "off"*/
  52648. /* qr.js -- QR code generator in Javascript (revision 2011-01-19)
  52649. * Written by Kang Seonghoon <public+qrjs@mearie.org>.
  52650. *
  52651. * This source code is in the public domain; if your jurisdiction does not
  52652. * recognize the public domain the terms of Creative Commons CC0 license
  52653. * apply. In the other words, you can always do what you want.
  52654. */
  52655. // per-version information (cf. JIS X 0510:2004 pp. 30--36, 71)
  52656. //
  52657. // [0]: the degree of generator polynomial by ECC levels
  52658. // [1]: # of code blocks by ECC levels
  52659. // [2]: left-top positions of alignment patterns
  52660. //
  52661. // the number in this table (in particular, [0]) does not exactly match with
  52662. // the numbers in the specficiation. see augumenteccs below for the reason.
  52663. var VERSIONS = [
  52664. null,
  52665. [[10, 7, 17, 13], [1, 1, 1, 1], []],
  52666. [[16, 10, 28, 22], [1, 1, 1, 1], [4, 16]],
  52667. [[26, 15, 22, 18], [1, 1, 2, 2], [4, 20]],
  52668. [[18, 20, 16, 26], [2, 1, 4, 2], [4, 24]],
  52669. [[24, 26, 22, 18], [2, 1, 4, 4], [4, 28]],
  52670. [[16, 18, 28, 24], [4, 2, 4, 4], [4, 32]],
  52671. [[18, 20, 26, 18], [4, 2, 5, 6], [4, 20, 36]],
  52672. [[22, 24, 26, 22], [4, 2, 6, 6], [4, 22, 40]],
  52673. [[22, 30, 24, 20], [5, 2, 8, 8], [4, 24, 44]],
  52674. [[26, 18, 28, 24], [5, 4, 8, 8], [4, 26, 48]],
  52675. [[30, 20, 24, 28], [5, 4, 11, 8], [4, 28, 52]],
  52676. [[22, 24, 28, 26], [8, 4, 11, 10], [4, 30, 56]],
  52677. [[22, 26, 22, 24], [9, 4, 16, 12], [4, 32, 60]],
  52678. [[24, 30, 24, 20], [9, 4, 16, 16], [4, 24, 44, 64]],
  52679. [[24, 22, 24, 30], [10, 6, 18, 12], [4, 24, 46, 68]],
  52680. [[28, 24, 30, 24], [10, 6, 16, 17], [4, 24, 48, 72]],
  52681. [[28, 28, 28, 28], [11, 6, 19, 16], [4, 28, 52, 76]],
  52682. [[26, 30, 28, 28], [13, 6, 21, 18], [4, 28, 54, 80]],
  52683. [[26, 28, 26, 26], [14, 7, 25, 21], [4, 28, 56, 84]],
  52684. [[26, 28, 28, 30], [16, 8, 25, 20], [4, 32, 60, 88]],
  52685. [[26, 28, 30, 28], [17, 8, 25, 23], [4, 26, 48, 70, 92]],
  52686. [[28, 28, 24, 30], [17, 9, 34, 23], [4, 24, 48, 72, 96]],
  52687. [[28, 30, 30, 30], [18, 9, 30, 25], [4, 28, 52, 76, 100]],
  52688. [[28, 30, 30, 30], [20, 10, 32, 27], [4, 26, 52, 78, 104]],
  52689. [[28, 26, 30, 30], [21, 12, 35, 29], [4, 30, 56, 82, 108]],
  52690. [[28, 28, 30, 28], [23, 12, 37, 34], [4, 28, 56, 84, 112]],
  52691. [[28, 30, 30, 30], [25, 12, 40, 34], [4, 32, 60, 88, 116]],
  52692. [[28, 30, 30, 30], [26, 13, 42, 35], [4, 24, 48, 72, 96, 120]],
  52693. [[28, 30, 30, 30], [28, 14, 45, 38], [4, 28, 52, 76, 100, 124]],
  52694. [[28, 30, 30, 30], [29, 15, 48, 40], [4, 24, 50, 76, 102, 128]],
  52695. [[28, 30, 30, 30], [31, 16, 51, 43], [4, 28, 54, 80, 106, 132]],
  52696. [[28, 30, 30, 30], [33, 17, 54, 45], [4, 32, 58, 84, 110, 136]],
  52697. [[28, 30, 30, 30], [35, 18, 57, 48], [4, 28, 56, 84, 112, 140]],
  52698. [[28, 30, 30, 30], [37, 19, 60, 51], [4, 32, 60, 88, 116, 144]],
  52699. [[28, 30, 30, 30], [38, 19, 63, 53], [4, 28, 52, 76, 100, 124, 148]],
  52700. [[28, 30, 30, 30], [40, 20, 66, 56], [4, 22, 48, 74, 100, 126, 152]],
  52701. [[28, 30, 30, 30], [43, 21, 70, 59], [4, 26, 52, 78, 104, 130, 156]],
  52702. [[28, 30, 30, 30], [45, 22, 74, 62], [4, 30, 56, 82, 108, 134, 160]],
  52703. [[28, 30, 30, 30], [47, 24, 77, 65], [4, 24, 52, 80, 108, 136, 164]],
  52704. [[28, 30, 30, 30], [49, 25, 81, 68], [4, 28, 56, 84, 112, 140, 168]]];
  52705. // mode constants (cf. Table 2 in JIS X 0510:2004 p. 16)
  52706. var MODE_TERMINATOR = 0;
  52707. var MODE_NUMERIC = 1, MODE_ALPHANUMERIC = 2, MODE_OCTET = 4, MODE_KANJI = 8;
  52708. // validation regexps
  52709. var NUMERIC_REGEXP = /^\d*$/;
  52710. var ALPHANUMERIC_REGEXP = /^[A-Za-z0-9 $%*+\-./:]*$/;
  52711. var ALPHANUMERIC_OUT_REGEXP = /^[A-Z0-9 $%*+\-./:]*$/;
  52712. // ECC levels (cf. Table 22 in JIS X 0510:2004 p. 45)
  52713. var ECCLEVEL_L = 1, ECCLEVEL_M = 0, ECCLEVEL_Q = 3, ECCLEVEL_H = 2;
  52714. // GF(2^8)-to-integer mapping with a reducing polynomial x^8+x^4+x^3+x^2+1
  52715. // invariant: GF256_MAP[GF256_INVMAP[i]] == i for all i in [1,256)
  52716. var GF256_MAP = [], GF256_INVMAP = [-1];
  52717. for (var i = 0, v = 1; i < 255; ++i) {
  52718. GF256_MAP.push(v);
  52719. GF256_INVMAP[v] = i;
  52720. v = (v * 2) ^ (v >= 128 ? 0x11d : 0);
  52721. }
  52722. // generator polynomials up to degree 30
  52723. // (should match with polynomials in JIS X 0510:2004 Appendix A)
  52724. //
  52725. // generator polynomial of degree K is product of (x-\alpha^0), (x-\alpha^1),
  52726. // ..., (x-\alpha^(K-1)). by convention, we omit the K-th coefficient (always 1)
  52727. // from the result; also other coefficients are written in terms of the exponent
  52728. // to \alpha to avoid the redundant calculation. (see also calculateecc below.)
  52729. var GF256_GENPOLY = [[]];
  52730. for (var i = 0; i < 30; ++i) {
  52731. var prevpoly = GF256_GENPOLY[i], poly = [];
  52732. for (var j = 0; j <= i; ++j) {
  52733. var a = (j < i ? GF256_MAP[prevpoly[j]] : 0);
  52734. var b = GF256_MAP[(i + (prevpoly[j - 1] || 0)) % 255];
  52735. poly.push(GF256_INVMAP[a ^ b]);
  52736. }
  52737. GF256_GENPOLY.push(poly);
  52738. }
  52739. // alphanumeric character mapping (cf. Table 5 in JIS X 0510:2004 p. 19)
  52740. var ALPHANUMERIC_MAP = {};
  52741. for (var i = 0; i < 45; ++i) {
  52742. ALPHANUMERIC_MAP['0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:'.charAt(i)] = i;
  52743. }
  52744. // mask functions in terms of row # and column #
  52745. // (cf. Table 20 in JIS X 0510:2004 p. 42)
  52746. /*jshint unused: false */
  52747. var MASKFUNCS = [
  52748. function (i, j) {
  52749. return (i + j) % 2 === 0;
  52750. },
  52751. function (i, j) {
  52752. return i % 2 === 0;
  52753. },
  52754. function (i, j) {
  52755. return j % 3 === 0;
  52756. },
  52757. function (i, j) {
  52758. return (i + j) % 3 === 0;
  52759. },
  52760. function (i, j) {
  52761. return (((i / 2) | 0) + ((j / 3) | 0)) % 2 === 0;
  52762. },
  52763. function (i, j) {
  52764. return (i * j) % 2 + (i * j) % 3 === 0;
  52765. },
  52766. function (i, j) {
  52767. return ((i * j) % 2 + (i * j) % 3) % 2 === 0;
  52768. },
  52769. function (i, j) {
  52770. return ((i + j) % 2 + (i * j) % 3) % 2 === 0;
  52771. }];
  52772. // returns true when the version information has to be embeded.
  52773. var needsverinfo = function (ver) {
  52774. return ver > 6;
  52775. };
  52776. // returns the size of entire QR code for given version.
  52777. var getsizebyver = function (ver) {
  52778. return 4 * ver + 17;
  52779. };
  52780. // returns the number of bits available for code words in this version.
  52781. var nfullbits = function (ver) {
  52782. /*
  52783. * |<--------------- n --------------->|
  52784. * | |<----- n-17 ---->| |
  52785. * +-------+ ///+-------+ ----
  52786. * | | ///| | ^
  52787. * | 9x9 | @@@@@ ///| 9x8 | |
  52788. * | | # # # @5x5@ # # # | | |
  52789. * +-------+ @@@@@ +-------+ |
  52790. * # ---|
  52791. * ^ |
  52792. * # |
  52793. * @@@@@ @@@@@ @@@@@ | n
  52794. * @5x5@ @5x5@ @5x5@ n-17
  52795. * @@@@@ @@@@@ @@@@@ | |
  52796. * # | |
  52797. * ////// v |
  52798. * //////# ---|
  52799. * +-------+ @@@@@ @@@@@ |
  52800. * | | @5x5@ @5x5@ |
  52801. * | 8x9 | @@@@@ @@@@@ |
  52802. * | | v
  52803. * +-------+ ----
  52804. *
  52805. * when the entire code has n^2 modules and there are m^2-3 alignment
  52806. * patterns, we have:
  52807. * - 225 (= 9x9 + 9x8 + 8x9) modules for finder patterns and
  52808. * format information;
  52809. * - 2n-34 (= 2(n-17)) modules for timing patterns;
  52810. * - 36 (= 3x6 + 6x3) modules for version information, if any;
  52811. * - 25m^2-75 (= (m^2-3)(5x5)) modules for alignment patterns
  52812. * if any, but 10m-20 (= 2(m-2)x5) of them overlaps with
  52813. * timing patterns.
  52814. */
  52815. var v = VERSIONS[ver];
  52816. var nbits = 16 * ver * ver + 128 * ver + 64; // finder, timing and format info.
  52817. if (needsverinfo(ver))
  52818. nbits -= 36; // version information
  52819. if (v[2].length) { // alignment patterns
  52820. nbits -= 25 * v[2].length * v[2].length - 10 * v[2].length - 55;
  52821. }
  52822. return nbits;
  52823. };
  52824. // returns the number of bits available for data portions (i.e. excludes ECC
  52825. // bits but includes mode and length bits) in this version and ECC level.
  52826. var ndatabits = function (ver, ecclevel) {
  52827. var nbits = nfullbits(ver) & ~7; // no sub-octet code words
  52828. var v = VERSIONS[ver];
  52829. nbits -= 8 * v[0][ecclevel] * v[1][ecclevel]; // ecc bits
  52830. return nbits;
  52831. };
  52832. // returns the number of bits required for the length of data.
  52833. // (cf. Table 3 in JIS X 0510:2004 p. 16)
  52834. var ndatalenbits = function (ver, mode) {
  52835. switch (mode) {
  52836. case MODE_NUMERIC:
  52837. return (ver < 10 ? 10 : ver < 27 ? 12 : 14);
  52838. case MODE_ALPHANUMERIC:
  52839. return (ver < 10 ? 9 : ver < 27 ? 11 : 13);
  52840. case MODE_OCTET:
  52841. return (ver < 10 ? 8 : 16);
  52842. case MODE_KANJI:
  52843. return (ver < 10 ? 8 : ver < 27 ? 10 : 12);
  52844. }
  52845. };
  52846. // returns the maximum length of data possible in given configuration.
  52847. var getmaxdatalen = function (ver, mode, ecclevel) {
  52848. var nbits = ndatabits(ver, ecclevel) - 4 - ndatalenbits(ver, mode); // 4 for mode bits
  52849. switch (mode) {
  52850. case MODE_NUMERIC:
  52851. return ((nbits / 10) | 0) * 3 + (nbits % 10 < 4 ? 0 : nbits % 10 < 7 ? 1 : 2);
  52852. case MODE_ALPHANUMERIC:
  52853. return ((nbits / 11) | 0) * 2 + (nbits % 11 < 6 ? 0 : 1);
  52854. case MODE_OCTET:
  52855. return (nbits / 8) | 0;
  52856. case MODE_KANJI:
  52857. return (nbits / 13) | 0;
  52858. }
  52859. };
  52860. // checks if the given data can be encoded in given mode, and returns
  52861. // the converted data for the further processing if possible. otherwise
  52862. // returns null.
  52863. //
  52864. // this function does not check the length of data; it is a duty of
  52865. // encode function below (as it depends on the version and ECC level too).
  52866. var validatedata = function (mode, data) {
  52867. switch (mode) {
  52868. case MODE_NUMERIC:
  52869. if (!data.match(NUMERIC_REGEXP))
  52870. return null;
  52871. return data;
  52872. case MODE_ALPHANUMERIC:
  52873. if (!data.match(ALPHANUMERIC_REGEXP))
  52874. return null;
  52875. return data.toUpperCase();
  52876. case MODE_OCTET:
  52877. if (typeof data === 'string') { // encode as utf-8 string
  52878. var newdata = [];
  52879. for (var i = 0; i < data.length; ++i) {
  52880. var ch = data.charCodeAt(i);
  52881. if (ch < 0x80) {
  52882. newdata.push(ch);
  52883. } else if (ch < 0x800) {
  52884. newdata.push(0xc0 | (ch >> 6),
  52885. 0x80 | (ch & 0x3f));
  52886. } else if (ch < 0x10000) {
  52887. newdata.push(0xe0 | (ch >> 12),
  52888. 0x80 | ((ch >> 6) & 0x3f),
  52889. 0x80 | (ch & 0x3f));
  52890. } else {
  52891. newdata.push(0xf0 | (ch >> 18),
  52892. 0x80 | ((ch >> 12) & 0x3f),
  52893. 0x80 | ((ch >> 6) & 0x3f),
  52894. 0x80 | (ch & 0x3f));
  52895. }
  52896. }
  52897. return newdata;
  52898. } else {
  52899. return data;
  52900. }
  52901. }
  52902. };
  52903. // returns the code words (sans ECC bits) for given data and configurations.
  52904. // requires data to be preprocessed by validatedata. no length check is
  52905. // performed, and everything has to be checked before calling this function.
  52906. var encode = function (ver, mode, data, maxbuflen) {
  52907. var buf = [];
  52908. var bits = 0, remaining = 8;
  52909. var datalen = data.length;
  52910. // this function is intentionally no-op when n=0.
  52911. var pack = function (x, n) {
  52912. if (n >= remaining) {
  52913. buf.push(bits | (x >> (n -= remaining)));
  52914. while (n >= 8)
  52915. buf.push((x >> (n -= 8)) & 255);
  52916. bits = 0;
  52917. remaining = 8;
  52918. }
  52919. if (n > 0)
  52920. bits |= (x & ((1 << n) - 1)) << (remaining -= n);
  52921. };
  52922. var nlenbits = ndatalenbits(ver, mode);
  52923. pack(mode, 4);
  52924. pack(datalen, nlenbits);
  52925. switch (mode) {
  52926. case MODE_NUMERIC:
  52927. for (var i = 2; i < datalen; i += 3) {
  52928. pack(parseInt(data.substring(i - 2, i + 1), 10), 10);
  52929. }
  52930. pack(parseInt(data.substring(i - 2), 10), [0, 4, 7][datalen % 3]);
  52931. break;
  52932. case MODE_ALPHANUMERIC:
  52933. for (var i = 1; i < datalen; i += 2) {
  52934. pack(ALPHANUMERIC_MAP[data.charAt(i - 1)] * 45 +
  52935. ALPHANUMERIC_MAP[data.charAt(i)], 11);
  52936. }
  52937. if (datalen % 2 == 1) {
  52938. pack(ALPHANUMERIC_MAP[data.charAt(i - 1)], 6);
  52939. }
  52940. break;
  52941. case MODE_OCTET:
  52942. for (var i = 0; i < datalen; ++i) {
  52943. pack(data[i], 8);
  52944. }
  52945. break;
  52946. }
  52947. // final bits. it is possible that adding terminator causes the buffer
  52948. // to overflow, but then the buffer truncated to the maximum size will
  52949. // be valid as the truncated terminator mode bits and padding is
  52950. // identical in appearance (cf. JIS X 0510:2004 sec 8.4.8).
  52951. pack(MODE_TERMINATOR, 4);
  52952. if (remaining < 8)
  52953. buf.push(bits);
  52954. // the padding to fill up the remaining space. we should not add any
  52955. // words when the overflow already occurred.
  52956. while (buf.length + 1 < maxbuflen)
  52957. buf.push(0xec, 0x11);
  52958. if (buf.length < maxbuflen)
  52959. buf.push(0xec);
  52960. return buf;
  52961. };
  52962. // calculates ECC code words for given code words and generator polynomial.
  52963. //
  52964. // this is quite similar to CRC calculation as both Reed-Solomon and CRC use
  52965. // the certain kind of cyclic codes, which is effectively the division of
  52966. // zero-augumented polynomial by the generator polynomial. the only difference
  52967. // is that Reed-Solomon uses GF(2^8), instead of CRC's GF(2), and Reed-Solomon
  52968. // uses the different generator polynomial than CRC's.
  52969. var calculateecc = function (poly, genpoly) {
  52970. var modulus = poly.slice(0);
  52971. var polylen = poly.length, genpolylen = genpoly.length;
  52972. for (var i = 0; i < genpolylen; ++i)
  52973. modulus.push(0);
  52974. for (var i = 0; i < polylen; ) {
  52975. var quotient = GF256_INVMAP[modulus[i++]];
  52976. if (quotient >= 0) {
  52977. for (var j = 0; j < genpolylen; ++j) {
  52978. modulus[i + j] ^= GF256_MAP[(quotient + genpoly[j]) % 255];
  52979. }
  52980. }
  52981. }
  52982. return modulus.slice(polylen);
  52983. };
  52984. // auguments ECC code words to given code words. the resulting words are
  52985. // ready to be encoded in the matrix.
  52986. //
  52987. // the much of actual augumenting procedure follows JIS X 0510:2004 sec 8.7.
  52988. // the code is simplified using the fact that the size of each code & ECC
  52989. // blocks is almost same; for example, when we have 4 blocks and 46 data words
  52990. // the number of code words in those blocks are 11, 11, 12, 12 respectively.
  52991. var augumenteccs = function (poly, nblocks, genpoly) {
  52992. var subsizes = [];
  52993. var subsize = (poly.length / nblocks) | 0, subsize0 = 0;
  52994. var pivot = nblocks - poly.length % nblocks;
  52995. for (var i = 0; i < pivot; ++i) {
  52996. subsizes.push(subsize0);
  52997. subsize0 += subsize;
  52998. }
  52999. for (var i = pivot; i < nblocks; ++i) {
  53000. subsizes.push(subsize0);
  53001. subsize0 += subsize + 1;
  53002. }
  53003. subsizes.push(subsize0);
  53004. var eccs = [];
  53005. for (var i = 0; i < nblocks; ++i) {
  53006. eccs.push(calculateecc(poly.slice(subsizes[i], subsizes[i + 1]), genpoly));
  53007. }
  53008. var result = [];
  53009. var nitemsperblock = (poly.length / nblocks) | 0;
  53010. for (var i = 0; i < nitemsperblock; ++i) {
  53011. for (var j = 0; j < nblocks; ++j) {
  53012. result.push(poly[subsizes[j] + i]);
  53013. }
  53014. }
  53015. for (var j = pivot; j < nblocks; ++j) {
  53016. result.push(poly[subsizes[j + 1] - 1]);
  53017. }
  53018. for (var i = 0; i < genpoly.length; ++i) {
  53019. for (var j = 0; j < nblocks; ++j) {
  53020. result.push(eccs[j][i]);
  53021. }
  53022. }
  53023. return result;
  53024. };
  53025. // auguments BCH(p+q,q) code to the polynomial over GF(2), given the proper
  53026. // genpoly. the both input and output are in binary numbers, and unlike
  53027. // calculateecc genpoly should include the 1 bit for the highest degree.
  53028. //
  53029. // actual polynomials used for this procedure are as follows:
  53030. // - p=10, q=5, genpoly=x^10+x^8+x^5+x^4+x^2+x+1 (JIS X 0510:2004 Appendix C)
  53031. // - p=18, q=6, genpoly=x^12+x^11+x^10+x^9+x^8+x^5+x^2+1 (ibid. Appendix D)
  53032. var augumentbch = function (poly, p, genpoly, q) {
  53033. var modulus = poly << q;
  53034. for (var i = p - 1; i >= 0; --i) {
  53035. if ((modulus >> (q + i)) & 1)
  53036. modulus ^= genpoly << i;
  53037. }
  53038. return (poly << q) | modulus;
  53039. };
  53040. // creates the base matrix for given version. it returns two matrices, one of
  53041. // them is the actual one and the another represents the "reserved" portion
  53042. // (e.g. finder and timing patterns) of the matrix.
  53043. //
  53044. // some entries in the matrix may be undefined, rather than 0 or 1. this is
  53045. // intentional (no initialization needed!), and putdata below will fill
  53046. // the remaining ones.
  53047. var makebasematrix = function (ver) {
  53048. var v = VERSIONS[ver], n = getsizebyver(ver);
  53049. var matrix = [], reserved = [];
  53050. for (var i = 0; i < n; ++i) {
  53051. matrix.push([]);
  53052. reserved.push([]);
  53053. }
  53054. var blit = function (y, x, h, w, bits) {
  53055. for (var i = 0; i < h; ++i) {
  53056. for (var j = 0; j < w; ++j) {
  53057. matrix[y + i][x + j] = (bits[i] >> j) & 1;
  53058. reserved[y + i][x + j] = 1;
  53059. }
  53060. }
  53061. };
  53062. // finder patterns and a part of timing patterns
  53063. // will also mark the format information area (not yet written) as reserved.
  53064. blit(0, 0, 9, 9, [0x7f, 0x41, 0x5d, 0x5d, 0x5d, 0x41, 0x17f, 0x00, 0x40]);
  53065. blit(n - 8, 0, 8, 9, [0x100, 0x7f, 0x41, 0x5d, 0x5d, 0x5d, 0x41, 0x7f]);
  53066. blit(0, n - 8, 9, 8, [0xfe, 0x82, 0xba, 0xba, 0xba, 0x82, 0xfe, 0x00, 0x00]);
  53067. // the rest of timing patterns
  53068. for (var i = 9; i < n - 8; ++i) {
  53069. matrix[6][i] = matrix[i][6] = ~i & 1;
  53070. reserved[6][i] = reserved[i][6] = 1;
  53071. }
  53072. // alignment patterns
  53073. var aligns = v[2], m = aligns.length;
  53074. for (var i = 0; i < m; ++i) {
  53075. var minj = (i === 0 || i === m - 1 ? 1 : 0), maxj = (i === 0 ? m - 1 : m);
  53076. for (var j = minj; j < maxj; ++j) {
  53077. blit(aligns[i], aligns[j], 5, 5, [0x1f, 0x11, 0x15, 0x11, 0x1f]);
  53078. }
  53079. }
  53080. // version information
  53081. if (needsverinfo(ver)) {
  53082. var code = augumentbch(ver, 6, 0x1f25, 12);
  53083. var k = 0;
  53084. for (var i = 0; i < 6; ++i) {
  53085. for (var j = 0; j < 3; ++j) {
  53086. matrix[i][(n - 11) + j] = matrix[(n - 11) + j][i] = (code >> k++) & 1;
  53087. reserved[i][(n - 11) + j] = reserved[(n - 11) + j][i] = 1;
  53088. }
  53089. }
  53090. }
  53091. return {matrix: matrix, reserved: reserved};
  53092. };
  53093. // fills the data portion (i.e. unmarked in reserved) of the matrix with given
  53094. // code words. the size of code words should be no more than available bits,
  53095. // and remaining bits are padded to 0 (cf. JIS X 0510:2004 sec 8.7.3).
  53096. var putdata = function (matrix, reserved, buf) {
  53097. var n = matrix.length;
  53098. var k = 0, dir = -1;
  53099. for (var i = n - 1; i >= 0; i -= 2) {
  53100. if (i == 6)
  53101. --i; // skip the entire timing pattern column
  53102. var jj = (dir < 0 ? n - 1 : 0);
  53103. for (var j = 0; j < n; ++j) {
  53104. for (var ii = i; ii > i - 2; --ii) {
  53105. if (!reserved[jj][ii]) {
  53106. // may overflow, but (undefined >> x)
  53107. // is 0 so it will auto-pad to zero.
  53108. matrix[jj][ii] = (buf[k >> 3] >> (~k & 7)) & 1;
  53109. ++k;
  53110. }
  53111. }
  53112. jj += dir;
  53113. }
  53114. dir = -dir;
  53115. }
  53116. return matrix;
  53117. };
  53118. // XOR-masks the data portion of the matrix. repeating the call with the same
  53119. // arguments will revert the prior call (convenient in the matrix evaluation).
  53120. var maskdata = function (matrix, reserved, mask) {
  53121. var maskf = MASKFUNCS[mask];
  53122. var n = matrix.length;
  53123. for (var i = 0; i < n; ++i) {
  53124. for (var j = 0; j < n; ++j) {
  53125. if (!reserved[i][j])
  53126. matrix[i][j] ^= maskf(i, j);
  53127. }
  53128. }
  53129. return matrix;
  53130. };
  53131. // puts the format information.
  53132. var putformatinfo = function (matrix, reserved, ecclevel, mask) {
  53133. var n = matrix.length;
  53134. var code = augumentbch((ecclevel << 3) | mask, 5, 0x537, 10) ^ 0x5412;
  53135. for (var i = 0; i < 15; ++i) {
  53136. var r = [0, 1, 2, 3, 4, 5, 7, 8, n - 7, n - 6, n - 5, n - 4, n - 3, n - 2, n - 1][i];
  53137. var c = [n - 1, n - 2, n - 3, n - 4, n - 5, n - 6, n - 7, n - 8, 7, 5, 4, 3, 2, 1, 0][i];
  53138. matrix[r][8] = matrix[8][c] = (code >> i) & 1;
  53139. // we don't have to mark those bits reserved; always done
  53140. // in makebasematrix above.
  53141. }
  53142. return matrix;
  53143. };
  53144. // evaluates the resulting matrix and returns the score (lower is better).
  53145. // (cf. JIS X 0510:2004 sec 8.8.2)
  53146. //
  53147. // the evaluation procedure tries to avoid the problematic patterns naturally
  53148. // occuring from the original matrix. for example, it penaltizes the patterns
  53149. // which just look like the finder pattern which will confuse the decoder.
  53150. // we choose the mask which results in the lowest score among 8 possible ones.
  53151. //
  53152. // note: zxing seems to use the same procedure and in many cases its choice
  53153. // agrees to ours, but sometimes it does not. practically it doesn't matter.
  53154. var evaluatematrix = function (matrix) {
  53155. // N1+(k-5) points for each consecutive row of k same-colored modules,
  53156. // where k >= 5. no overlapping row counts.
  53157. var PENALTY_CONSECUTIVE = 3;
  53158. // N2 points for each 2x2 block of same-colored modules.
  53159. // overlapping block does count.
  53160. var PENALTY_TWOBYTWO = 3;
  53161. // N3 points for each pattern with >4W:1B:1W:3B:1W:1B or
  53162. // 1B:1W:3B:1W:1B:>4W, or their multiples (e.g. highly unlikely,
  53163. // but 13W:3B:3W:9B:3W:3B counts).
  53164. var PENALTY_FINDERLIKE = 40;
  53165. // N4*k points for every (5*k)% deviation from 50% black density.
  53166. // i.e. k=1 for 55~60% and 40~45%, k=2 for 60~65% and 35~40%, etc.
  53167. var PENALTY_DENSITY = 10;
  53168. var evaluategroup = function (groups) { // assumes [W,B,W,B,W,...,B,W]
  53169. var score = 0;
  53170. for (var i = 0; i < groups.length; ++i) {
  53171. if (groups[i] >= 5)
  53172. score += PENALTY_CONSECUTIVE + (groups[i] - 5);
  53173. }
  53174. for (var i = 5; i < groups.length; i += 2) {
  53175. var p = groups[i];
  53176. if (groups[i - 1] == p && groups[i - 2] == 3 * p && groups[i - 3] == p &&
  53177. groups[i - 4] == p && (groups[i - 5] >= 4 * p || groups[i + 1] >= 4 * p)) {
  53178. // this part differs from zxing...
  53179. score += PENALTY_FINDERLIKE;
  53180. }
  53181. }
  53182. return score;
  53183. };
  53184. var n = matrix.length;
  53185. var score = 0, nblacks = 0;
  53186. for (var i = 0; i < n; ++i) {
  53187. var row = matrix[i];
  53188. var groups;
  53189. // evaluate the current row
  53190. groups = [0]; // the first empty group of white
  53191. for (var j = 0; j < n; ) {
  53192. var k;
  53193. for (k = 0; j < n && row[j]; ++k)
  53194. ++j;
  53195. groups.push(k);
  53196. for (k = 0; j < n && !row[j]; ++k)
  53197. ++j;
  53198. groups.push(k);
  53199. }
  53200. score += evaluategroup(groups);
  53201. // evaluate the current column
  53202. groups = [0];
  53203. for (var j = 0; j < n; ) {
  53204. var k;
  53205. for (k = 0; j < n && matrix[j][i]; ++k)
  53206. ++j;
  53207. groups.push(k);
  53208. for (k = 0; j < n && !matrix[j][i]; ++k)
  53209. ++j;
  53210. groups.push(k);
  53211. }
  53212. score += evaluategroup(groups);
  53213. // check the 2x2 box and calculate the density
  53214. var nextrow = matrix[i + 1] || [];
  53215. nblacks += row[0];
  53216. for (var j = 1; j < n; ++j) {
  53217. var p = row[j];
  53218. nblacks += p;
  53219. // at least comparison with next row should be strict...
  53220. if (row[j - 1] == p && nextrow[j] === p && nextrow[j - 1] === p) {
  53221. score += PENALTY_TWOBYTWO;
  53222. }
  53223. }
  53224. }
  53225. score += PENALTY_DENSITY * ((Math.abs(nblacks / n / n - 0.5) / 0.05) | 0);
  53226. return score;
  53227. };
  53228. // returns the fully encoded QR code matrix which contains given data.
  53229. // it also chooses the best mask automatically when mask is -1.
  53230. var generate = function (data, ver, mode, ecclevel, mask) {
  53231. var v = VERSIONS[ver];
  53232. var buf = encode(ver, mode, data, ndatabits(ver, ecclevel) >> 3);
  53233. buf = augumenteccs(buf, v[1][ecclevel], GF256_GENPOLY[v[0][ecclevel]]);
  53234. var result = makebasematrix(ver);
  53235. var matrix = result.matrix, reserved = result.reserved;
  53236. putdata(matrix, reserved, buf);
  53237. if (mask < 0) {
  53238. // find the best mask
  53239. maskdata(matrix, reserved, 0);
  53240. putformatinfo(matrix, reserved, ecclevel, 0);
  53241. var bestmask = 0, bestscore = evaluatematrix(matrix);
  53242. maskdata(matrix, reserved, 0);
  53243. for (mask = 1; mask < 8; ++mask) {
  53244. maskdata(matrix, reserved, mask);
  53245. putformatinfo(matrix, reserved, ecclevel, mask);
  53246. var score = evaluatematrix(matrix);
  53247. if (bestscore > score) {
  53248. bestscore = score;
  53249. bestmask = mask;
  53250. }
  53251. maskdata(matrix, reserved, mask);
  53252. }
  53253. mask = bestmask;
  53254. }
  53255. maskdata(matrix, reserved, mask);
  53256. putformatinfo(matrix, reserved, ecclevel, mask);
  53257. return matrix;
  53258. };
  53259. // the public interface is trivial; the options available are as follows:
  53260. //
  53261. // - version: an integer in [1,40]. when omitted (or -1) the smallest possible
  53262. // version is chosen.
  53263. // - mode: one of 'numeric', 'alphanumeric', 'octet'. when omitted the smallest
  53264. // possible mode is chosen.
  53265. // - eccLevel: one of 'L', 'M', 'Q', 'H'. defaults to 'L'.
  53266. // - mask: an integer in [0,7]. when omitted (or -1) the best mask is chosen.
  53267. //
  53268. function generateFrame(data, options) {
  53269. var MODES = {'numeric': MODE_NUMERIC, 'alphanumeric': MODE_ALPHANUMERIC,
  53270. 'octet': MODE_OCTET};
  53271. var ECCLEVELS = {'L': ECCLEVEL_L, 'M': ECCLEVEL_M, 'Q': ECCLEVEL_Q,
  53272. 'H': ECCLEVEL_H};
  53273. options = options || {};
  53274. var ver = options.version || -1;
  53275. var ecclevel = ECCLEVELS[(options.eccLevel || 'L').toUpperCase()];
  53276. var mode = options.mode ? MODES[options.mode.toLowerCase()] : -1;
  53277. var mask = 'mask' in options ? options.mask : -1;
  53278. if (mode < 0) {
  53279. if (typeof data === 'string') {
  53280. if (data.match(NUMERIC_REGEXP)) {
  53281. mode = MODE_NUMERIC;
  53282. } else if (data.match(ALPHANUMERIC_OUT_REGEXP)) {
  53283. // while encode supports case-insensitive encoding, we restrict the data to be uppercased when auto-selecting the mode.
  53284. mode = MODE_ALPHANUMERIC;
  53285. } else {
  53286. mode = MODE_OCTET;
  53287. }
  53288. } else {
  53289. mode = MODE_OCTET;
  53290. }
  53291. } else if (!(mode == MODE_NUMERIC || mode == MODE_ALPHANUMERIC ||
  53292. mode == MODE_OCTET)) {
  53293. throw 'invalid or unsupported mode';
  53294. }
  53295. data = validatedata(mode, data);
  53296. if (data === null)
  53297. throw 'invalid data format';
  53298. if (ecclevel < 0 || ecclevel > 3)
  53299. throw 'invalid ECC level';
  53300. if (ver < 0) {
  53301. for (ver = 1; ver <= 40; ++ver) {
  53302. if (data.length <= getmaxdatalen(ver, mode, ecclevel))
  53303. break;
  53304. }
  53305. if (ver > 40)
  53306. throw 'too large data for the Qr format';
  53307. } else if (ver < 1 || ver > 40) {
  53308. throw 'invalid Qr version! should be between 1 and 40';
  53309. }
  53310. if (mask != -1 && (mask < 0 || mask > 8))
  53311. throw 'invalid mask';
  53312. //console.log('version:', ver, 'mode:', mode, 'ECC:', ecclevel, 'mask:', mask )
  53313. return generate(data, ver, mode, ecclevel, mask);
  53314. }
  53315. // options
  53316. // - modulesize: a number. this is a size of each modules in pixels, and
  53317. // defaults to 5px.
  53318. // - margin: a number. this is a size of margin in *modules*, and defaults to
  53319. // 4 (white modules). the specficiation mandates the margin no less than 4
  53320. // modules, so it is better not to alter this value unless you know what
  53321. // you're doing.
  53322. function buildCanvas(data, options) {
  53323. var canvas = [];
  53324. var background = options.background || '#fff';
  53325. var foreground = options.foreground || '#000';
  53326. //var margin = options.margin || 4;
  53327. var matrix = generateFrame(data, options);
  53328. var n = matrix.length;
  53329. var modSize = Math.floor(options.fit ? options.fit / n : 5);
  53330. var size = n * modSize;
  53331. canvas.push({
  53332. type: 'rect',
  53333. x: 0, y: 0, w: size, h: size, lineWidth: 0, color: background
  53334. });
  53335. for (var i = 0; i < n; ++i) {
  53336. for (var j = 0; j < n; ++j) {
  53337. if (matrix[i][j]) {
  53338. canvas.push({
  53339. type: 'rect',
  53340. x: modSize * j,
  53341. y: modSize * i,
  53342. w: modSize,
  53343. h: modSize,
  53344. lineWidth: 0,
  53345. color: foreground
  53346. });
  53347. }
  53348. }
  53349. }
  53350. return {
  53351. canvas: canvas,
  53352. size: size
  53353. };
  53354. }
  53355. function measure(node) {
  53356. var cd = buildCanvas(node.qr, node);
  53357. node._canvas = cd.canvas;
  53358. node._width = node._height = node._minWidth = node._maxWidth = node._minHeight = node._maxHeight = cd.size;
  53359. return node;
  53360. }
  53361. module.exports = {
  53362. measure: measure
  53363. };
  53364. /***/ }),
  53365. /* 449 */
  53366. /***/ (function(module, exports, __webpack_require__) {
  53367. "use strict";
  53368. var isUndefined = __webpack_require__(0).isUndefined;
  53369. var ElementWriter = __webpack_require__(450);
  53370. /**
  53371. * Creates an instance of PageElementWriter - an extended ElementWriter
  53372. * which can handle:
  53373. * - page-breaks (it adds new pages when there's not enough space left),
  53374. * - repeatable fragments (like table-headers, which are repeated everytime
  53375. * a page-break occurs)
  53376. * - transactions (used for unbreakable-blocks when we want to make sure
  53377. * whole block will be rendered on the same page)
  53378. */
  53379. function PageElementWriter(context, tracker) {
  53380. this.transactionLevel = 0;
  53381. this.repeatables = [];
  53382. this.tracker = tracker;
  53383. this.writer = new ElementWriter(context, tracker);
  53384. }
  53385. function fitOnPage(self, addFct) {
  53386. var position = addFct(self);
  53387. if (!position) {
  53388. self.moveToNextPage();
  53389. position = addFct(self);
  53390. }
  53391. return position;
  53392. }
  53393. PageElementWriter.prototype.addLine = function (line, dontUpdateContextPosition, index) {
  53394. return fitOnPage(this, function (self) {
  53395. return self.writer.addLine(line, dontUpdateContextPosition, index);
  53396. });
  53397. };
  53398. PageElementWriter.prototype.addImage = function (image, index) {
  53399. return fitOnPage(this, function (self) {
  53400. return self.writer.addImage(image, index);
  53401. });
  53402. };
  53403. PageElementWriter.prototype.addSVG = function (image, index) {
  53404. return fitOnPage(this, function (self) {
  53405. return self.writer.addSVG(image, index);
  53406. });
  53407. };
  53408. PageElementWriter.prototype.addQr = function (qr, index) {
  53409. return fitOnPage(this, function (self) {
  53410. return self.writer.addQr(qr, index);
  53411. });
  53412. };
  53413. PageElementWriter.prototype.addVector = function (vector, ignoreContextX, ignoreContextY, index) {
  53414. return this.writer.addVector(vector, ignoreContextX, ignoreContextY, index);
  53415. };
  53416. PageElementWriter.prototype.beginClip = function (width, height) {
  53417. return this.writer.beginClip(width, height);
  53418. };
  53419. PageElementWriter.prototype.endClip = function () {
  53420. return this.writer.endClip();
  53421. };
  53422. PageElementWriter.prototype.alignCanvas = function (node) {
  53423. this.writer.alignCanvas(node);
  53424. };
  53425. PageElementWriter.prototype.addFragment = function (fragment, useBlockXOffset, useBlockYOffset, dontUpdateContextPosition) {
  53426. if (!this.writer.addFragment(fragment, useBlockXOffset, useBlockYOffset, dontUpdateContextPosition)) {
  53427. this.moveToNextPage();
  53428. this.writer.addFragment(fragment, useBlockXOffset, useBlockYOffset, dontUpdateContextPosition);
  53429. }
  53430. };
  53431. PageElementWriter.prototype.moveToNextPage = function (pageOrientation) {
  53432. var nextPage = this.writer.context.moveToNextPage(pageOrientation);
  53433. // moveToNextPage is called multiple times for table, because is called for each column
  53434. // and repeatables are inserted only in the first time. If columns are used, is needed
  53435. // call for table in first column and then for table in the second column (is other repeatables).
  53436. this.repeatables.forEach(function (rep) {
  53437. if (isUndefined(rep.insertedOnPages[this.writer.context.page])) {
  53438. rep.insertedOnPages[this.writer.context.page] = true;
  53439. this.writer.addFragment(rep, true);
  53440. } else {
  53441. this.writer.context.moveDown(rep.height);
  53442. }
  53443. }, this);
  53444. this.writer.tracker.emit('pageChanged', {
  53445. prevPage: nextPage.prevPage,
  53446. prevY: nextPage.prevY,
  53447. y: this.writer.context.y
  53448. });
  53449. };
  53450. PageElementWriter.prototype.beginUnbreakableBlock = function (width, height) {
  53451. if (this.transactionLevel++ === 0) {
  53452. this.originalX = this.writer.context.x;
  53453. this.writer.pushContext(width, height);
  53454. }
  53455. };
  53456. PageElementWriter.prototype.commitUnbreakableBlock = function (forcedX, forcedY) {
  53457. if (--this.transactionLevel === 0) {
  53458. var unbreakableContext = this.writer.context;
  53459. this.writer.popContext();
  53460. var nbPages = unbreakableContext.pages.length;
  53461. if (nbPages > 0) {
  53462. // no support for multi-page unbreakableBlocks
  53463. var fragment = unbreakableContext.pages[0];
  53464. fragment.xOffset = forcedX;
  53465. fragment.yOffset = forcedY;
  53466. //TODO: vectors can influence height in some situations
  53467. if (nbPages > 1) {
  53468. // on out-of-context blocs (headers, footers, background) height should be the whole DocumentContext height
  53469. if (forcedX !== undefined || forcedY !== undefined) {
  53470. fragment.height = unbreakableContext.getCurrentPage().pageSize.height - unbreakableContext.pageMargins.top - unbreakableContext.pageMargins.bottom;
  53471. } else {
  53472. fragment.height = this.writer.context.getCurrentPage().pageSize.height - this.writer.context.pageMargins.top - this.writer.context.pageMargins.bottom;
  53473. for (var i = 0, l = this.repeatables.length; i < l; i++) {
  53474. fragment.height -= this.repeatables[i].height;
  53475. }
  53476. }
  53477. } else {
  53478. fragment.height = unbreakableContext.y;
  53479. }
  53480. if (forcedX !== undefined || forcedY !== undefined) {
  53481. this.writer.addFragment(fragment, true, true, true);
  53482. } else {
  53483. this.addFragment(fragment);
  53484. }
  53485. }
  53486. }
  53487. };
  53488. PageElementWriter.prototype.currentBlockToRepeatable = function () {
  53489. var unbreakableContext = this.writer.context;
  53490. var rep = { items: [] };
  53491. unbreakableContext.pages[0].items.forEach(function (item) {
  53492. rep.items.push(item);
  53493. });
  53494. rep.xOffset = this.originalX;
  53495. //TODO: vectors can influence height in some situations
  53496. rep.height = unbreakableContext.y;
  53497. rep.insertedOnPages = [];
  53498. return rep;
  53499. };
  53500. PageElementWriter.prototype.pushToRepeatables = function (rep) {
  53501. this.repeatables.push(rep);
  53502. };
  53503. PageElementWriter.prototype.popFromRepeatables = function () {
  53504. this.repeatables.pop();
  53505. };
  53506. PageElementWriter.prototype.context = function () {
  53507. return this.writer.context;
  53508. };
  53509. module.exports = PageElementWriter;
  53510. /***/ }),
  53511. /* 450 */
  53512. /***/ (function(module, exports, __webpack_require__) {
  53513. "use strict";
  53514. var Line = __webpack_require__(213);
  53515. var isNumber = __webpack_require__(0).isNumber;
  53516. var pack = __webpack_require__(0).pack;
  53517. var offsetVector = __webpack_require__(0).offsetVector;
  53518. var DocumentContext = __webpack_require__(212);
  53519. /**
  53520. * Creates an instance of ElementWriter - a line/vector writer, which adds
  53521. * elements to current page and sets their positions based on the context
  53522. */
  53523. function ElementWriter(context, tracker) {
  53524. this.context = context;
  53525. this.contextStack = [];
  53526. this.tracker = tracker;
  53527. }
  53528. function addPageItem(page, item, index) {
  53529. if (index === null || index === undefined || index < 0 || index > page.items.length) {
  53530. page.items.push(item);
  53531. } else {
  53532. page.items.splice(index, 0, item);
  53533. }
  53534. }
  53535. ElementWriter.prototype.addLine = function (line, dontUpdateContextPosition, index) {
  53536. var height = line.getHeight();
  53537. var context = this.context;
  53538. var page = context.getCurrentPage(),
  53539. position = this.getCurrentPositionOnPage();
  53540. if (context.availableHeight < height || !page) {
  53541. return false;
  53542. }
  53543. line.x = context.x + (line.x || 0);
  53544. line.y = context.y + (line.y || 0);
  53545. this.alignLine(line);
  53546. addPageItem(page, {
  53547. type: 'line',
  53548. item: line
  53549. }, index);
  53550. this.tracker.emit('lineAdded', line);
  53551. if (!dontUpdateContextPosition) {
  53552. context.moveDown(height);
  53553. }
  53554. return position;
  53555. };
  53556. ElementWriter.prototype.alignLine = function (line) {
  53557. var width = this.context.availableWidth;
  53558. var lineWidth = line.getWidth();
  53559. var alignment = line.inlines && line.inlines.length > 0 && line.inlines[0].alignment;
  53560. var offset = 0;
  53561. switch (alignment) {
  53562. case 'right':
  53563. offset = width - lineWidth;
  53564. break;
  53565. case 'center':
  53566. offset = (width - lineWidth) / 2;
  53567. break;
  53568. }
  53569. if (offset) {
  53570. line.x = (line.x || 0) + offset;
  53571. }
  53572. if (alignment === 'justify' &&
  53573. !line.newLineForced &&
  53574. !line.lastLineInParagraph &&
  53575. line.inlines.length > 1) {
  53576. var additionalSpacing = (width - lineWidth) / (line.inlines.length - 1);
  53577. for (var i = 1, l = line.inlines.length; i < l; i++) {
  53578. offset = i * additionalSpacing;
  53579. line.inlines[i].x += offset;
  53580. line.inlines[i].justifyShift = additionalSpacing;
  53581. }
  53582. }
  53583. };
  53584. ElementWriter.prototype.addImage = function (image, index, type) {
  53585. var context = this.context;
  53586. var page = context.getCurrentPage(),
  53587. position = this.getCurrentPositionOnPage();
  53588. if (!page || (image.absolutePosition === undefined && context.availableHeight < image._height && page.items.length > 0)) {
  53589. return false;
  53590. }
  53591. if (image._x === undefined) {
  53592. image._x = image.x || 0;
  53593. }
  53594. image.x = context.x + image._x;
  53595. image.y = context.y;
  53596. this.alignImage(image);
  53597. addPageItem(page, {
  53598. type: type || 'image',
  53599. item: image
  53600. }, index);
  53601. context.moveDown(image._height);
  53602. return position;
  53603. };
  53604. ElementWriter.prototype.addSVG = function (image, index) {
  53605. return this.addImage(image, index, 'svg')
  53606. };
  53607. ElementWriter.prototype.addQr = function (qr, index) {
  53608. var context = this.context;
  53609. var page = context.getCurrentPage(),
  53610. position = this.getCurrentPositionOnPage();
  53611. if (!page || (qr.absolutePosition === undefined && context.availableHeight < qr._height)) {
  53612. return false;
  53613. }
  53614. if (qr._x === undefined) {
  53615. qr._x = qr.x || 0;
  53616. }
  53617. qr.x = context.x + qr._x;
  53618. qr.y = context.y;
  53619. this.alignImage(qr);
  53620. for (var i = 0, l = qr._canvas.length; i < l; i++) {
  53621. var vector = qr._canvas[i];
  53622. vector.x += qr.x;
  53623. vector.y += qr.y;
  53624. this.addVector(vector, true, true, index);
  53625. }
  53626. context.moveDown(qr._height);
  53627. return position;
  53628. };
  53629. ElementWriter.prototype.alignImage = function (image) {
  53630. var width = this.context.availableWidth;
  53631. var imageWidth = image._minWidth;
  53632. var offset = 0;
  53633. switch (image._alignment) {
  53634. case 'right':
  53635. offset = width - imageWidth;
  53636. break;
  53637. case 'center':
  53638. offset = (width - imageWidth) / 2;
  53639. break;
  53640. }
  53641. if (offset) {
  53642. image.x = (image.x || 0) + offset;
  53643. }
  53644. };
  53645. ElementWriter.prototype.alignCanvas = function (node) {
  53646. var width = this.context.availableWidth;
  53647. var canvasWidth = node._minWidth;
  53648. var offset = 0;
  53649. switch (node._alignment) {
  53650. case 'right':
  53651. offset = width - canvasWidth;
  53652. break;
  53653. case 'center':
  53654. offset = (width - canvasWidth) / 2;
  53655. break;
  53656. }
  53657. if (offset) {
  53658. node.canvas.forEach(function (vector) {
  53659. offsetVector(vector, offset, 0);
  53660. });
  53661. }
  53662. };
  53663. ElementWriter.prototype.addVector = function (vector, ignoreContextX, ignoreContextY, index) {
  53664. var context = this.context;
  53665. var page = context.getCurrentPage(),
  53666. position = this.getCurrentPositionOnPage();
  53667. if (page) {
  53668. offsetVector(vector, ignoreContextX ? 0 : context.x, ignoreContextY ? 0 : context.y);
  53669. addPageItem(page, {
  53670. type: 'vector',
  53671. item: vector
  53672. }, index);
  53673. return position;
  53674. }
  53675. };
  53676. ElementWriter.prototype.beginClip = function (width, height) {
  53677. var ctx = this.context;
  53678. var page = ctx.getCurrentPage();
  53679. page.items.push({
  53680. type: 'beginClip',
  53681. item: { x: ctx.x, y: ctx.y, width: width, height: height }
  53682. });
  53683. return true;
  53684. };
  53685. ElementWriter.prototype.endClip = function () {
  53686. var ctx = this.context;
  53687. var page = ctx.getCurrentPage();
  53688. page.items.push({
  53689. type: 'endClip'
  53690. });
  53691. return true;
  53692. };
  53693. function cloneLine(line) {
  53694. var result = new Line(line.maxWidth);
  53695. for (var key in line) {
  53696. if (line.hasOwnProperty(key)) {
  53697. result[key] = line[key];
  53698. }
  53699. }
  53700. return result;
  53701. }
  53702. ElementWriter.prototype.addFragment = function (block, useBlockXOffset, useBlockYOffset, dontUpdateContextPosition) {
  53703. var ctx = this.context;
  53704. var page = ctx.getCurrentPage();
  53705. if (!useBlockXOffset && block.height > ctx.availableHeight) {
  53706. return false;
  53707. }
  53708. block.items.forEach(function (item) {
  53709. switch (item.type) {
  53710. case 'line':
  53711. var l = cloneLine(item.item);
  53712. if (l._node) {
  53713. l._node.positions[0].pageNumber = ctx.page + 1;
  53714. }
  53715. l.x = (l.x || 0) + (useBlockXOffset ? (block.xOffset || 0) : ctx.x);
  53716. l.y = (l.y || 0) + (useBlockYOffset ? (block.yOffset || 0) : ctx.y);
  53717. page.items.push({
  53718. type: 'line',
  53719. item: l
  53720. });
  53721. break;
  53722. case 'vector':
  53723. var v = pack(item.item);
  53724. offsetVector(v, useBlockXOffset ? (block.xOffset || 0) : ctx.x, useBlockYOffset ? (block.yOffset || 0) : ctx.y);
  53725. page.items.push({
  53726. type: 'vector',
  53727. item: v
  53728. });
  53729. break;
  53730. case 'image':
  53731. case 'svg':
  53732. var img = pack(item.item);
  53733. img.x = (img.x || 0) + (useBlockXOffset ? (block.xOffset || 0) : ctx.x);
  53734. img.y = (img.y || 0) + (useBlockYOffset ? (block.yOffset || 0) : ctx.y);
  53735. page.items.push({
  53736. type: item.type,
  53737. item: img
  53738. });
  53739. break;
  53740. }
  53741. });
  53742. if (!dontUpdateContextPosition) {
  53743. ctx.moveDown(block.height);
  53744. }
  53745. return true;
  53746. };
  53747. /**
  53748. * Pushes the provided context onto the stack or creates a new one
  53749. *
  53750. * pushContext(context) - pushes the provided context and makes it current
  53751. * pushContext(width, height) - creates and pushes a new context with the specified width and height
  53752. * pushContext() - creates a new context for unbreakable blocks (with current availableWidth and full-page-height)
  53753. */
  53754. ElementWriter.prototype.pushContext = function (contextOrWidth, height) {
  53755. if (contextOrWidth === undefined) {
  53756. height = this.context.getCurrentPage().height - this.context.pageMargins.top - this.context.pageMargins.bottom;
  53757. contextOrWidth = this.context.availableWidth;
  53758. }
  53759. if (isNumber(contextOrWidth)) {
  53760. contextOrWidth = new DocumentContext({ width: contextOrWidth, height: height }, { left: 0, right: 0, top: 0, bottom: 0 });
  53761. }
  53762. this.contextStack.push(this.context);
  53763. this.context = contextOrWidth;
  53764. };
  53765. ElementWriter.prototype.popContext = function () {
  53766. this.context = this.contextStack.pop();
  53767. };
  53768. ElementWriter.prototype.getCurrentPositionOnPage = function () {
  53769. return (this.contextStack[0] || this.context).getCurrentPosition();
  53770. };
  53771. module.exports = ElementWriter;
  53772. /***/ }),
  53773. /* 451 */
  53774. /***/ (function(module, exports, __webpack_require__) {
  53775. "use strict";
  53776. var ColumnCalculator = __webpack_require__(131);
  53777. var isFunction = __webpack_require__(0).isFunction;
  53778. var isNumber = __webpack_require__(0).isNumber;
  53779. function TableProcessor(tableNode) {
  53780. this.tableNode = tableNode;
  53781. }
  53782. TableProcessor.prototype.beginTable = function (writer) {
  53783. var tableNode;
  53784. var availableWidth;
  53785. var self = this;
  53786. tableNode = this.tableNode;
  53787. this.offsets = tableNode._offsets;
  53788. this.layout = tableNode._layout;
  53789. availableWidth = writer.context().availableWidth - this.offsets.total;
  53790. ColumnCalculator.buildColumnWidths(tableNode.table.widths, availableWidth);
  53791. this.tableWidth = tableNode._offsets.total + getTableInnerContentWidth();
  53792. this.rowSpanData = prepareRowSpanData();
  53793. this.cleanUpRepeatables = false;
  53794. this.headerRows = tableNode.table.headerRows || 0;
  53795. this.rowsWithoutPageBreak = this.headerRows + (tableNode.table.keepWithHeaderRows || 0);
  53796. this.dontBreakRows = tableNode.table.dontBreakRows || false;
  53797. if (this.rowsWithoutPageBreak) {
  53798. writer.beginUnbreakableBlock();
  53799. }
  53800. // update the border properties of all cells before drawing any lines
  53801. prepareCellBorders(this.tableNode.table.body);
  53802. this.drawHorizontalLine(0, writer);
  53803. function getTableInnerContentWidth() {
  53804. var width = 0;
  53805. tableNode.table.widths.forEach(function (w) {
  53806. width += w._calcWidth;
  53807. });
  53808. return width;
  53809. }
  53810. function prepareRowSpanData() {
  53811. var rsd = [];
  53812. var x = 0;
  53813. var lastWidth = 0;
  53814. rsd.push({ left: 0, rowSpan: 0 });
  53815. for (var i = 0, l = self.tableNode.table.body[0].length; i < l; i++) {
  53816. var paddings = self.layout.paddingLeft(i, self.tableNode) + self.layout.paddingRight(i, self.tableNode);
  53817. var lBorder = self.layout.vLineWidth(i, self.tableNode);
  53818. lastWidth = paddings + lBorder + self.tableNode.table.widths[i]._calcWidth;
  53819. rsd[rsd.length - 1].width = lastWidth;
  53820. x += lastWidth;
  53821. rsd.push({ left: x, rowSpan: 0, width: 0 });
  53822. }
  53823. return rsd;
  53824. }
  53825. // Iterate through all cells. If the current cell is the start of a
  53826. // rowSpan/colSpan, update the border property of the cells on its
  53827. // bottom/right accordingly. This is needed since each iteration of the
  53828. // line-drawing loops draws lines for a single cell, not for an entire
  53829. // rowSpan/colSpan.
  53830. function prepareCellBorders(body) {
  53831. for (var rowIndex = 0; rowIndex < body.length; rowIndex++) {
  53832. var row = body[rowIndex];
  53833. for (var colIndex = 0; colIndex < row.length; colIndex++) {
  53834. var cell = row[colIndex];
  53835. if (cell.border) {
  53836. var rowSpan = cell.rowSpan || 1;
  53837. var colSpan = cell.colSpan || 1;
  53838. for (var rowOffset = 0; rowOffset < rowSpan; rowOffset++) {
  53839. // set left border
  53840. if (cell.border[0] !== undefined && rowOffset > 0) {
  53841. setBorder(rowIndex + rowOffset, colIndex, 0, cell.border[0]);
  53842. }
  53843. // set right border
  53844. if (cell.border[2] !== undefined) {
  53845. setBorder(rowIndex + rowOffset, colIndex + colSpan - 1, 2, cell.border[2]);
  53846. }
  53847. }
  53848. for (var colOffset = 0; colOffset < colSpan; colOffset++) {
  53849. // set top border
  53850. if (cell.border[1] !== undefined && colOffset > 0) {
  53851. setBorder(rowIndex, colIndex + colOffset, 1, cell.border[1]);
  53852. }
  53853. // set bottom border
  53854. if (cell.border[3] !== undefined) {
  53855. setBorder(rowIndex + rowSpan - 1, colIndex + colOffset, 3, cell.border[3]);
  53856. }
  53857. }
  53858. }
  53859. }
  53860. }
  53861. // helper function to set the border for a given cell
  53862. function setBorder(rowIndex, colIndex, borderIndex, borderValue) {
  53863. var cell = body[rowIndex][colIndex];
  53864. cell.border = cell.border || {};
  53865. cell.border[borderIndex] = borderValue;
  53866. }
  53867. }
  53868. };
  53869. TableProcessor.prototype.onRowBreak = function (rowIndex, writer) {
  53870. var self = this;
  53871. return function () {
  53872. var offset = self.rowPaddingTop + (!self.headerRows ? self.topLineWidth : 0);
  53873. writer.context().availableHeight -= self.reservedAtBottom;
  53874. writer.context().moveDown(offset);
  53875. };
  53876. };
  53877. TableProcessor.prototype.beginRow = function (rowIndex, writer) {
  53878. this.topLineWidth = this.layout.hLineWidth(rowIndex, this.tableNode);
  53879. this.rowPaddingTop = this.layout.paddingTop(rowIndex, this.tableNode);
  53880. this.bottomLineWidth = this.layout.hLineWidth(rowIndex + 1, this.tableNode);
  53881. this.rowPaddingBottom = this.layout.paddingBottom(rowIndex, this.tableNode);
  53882. this.rowCallback = this.onRowBreak(rowIndex, writer);
  53883. writer.tracker.startTracking('pageChanged', this.rowCallback);
  53884. if (this.dontBreakRows) {
  53885. writer.beginUnbreakableBlock();
  53886. }
  53887. this.rowTopY = writer.context().y;
  53888. this.reservedAtBottom = this.bottomLineWidth + this.rowPaddingBottom;
  53889. writer.context().availableHeight -= this.reservedAtBottom;
  53890. writer.context().moveDown(this.rowPaddingTop);
  53891. };
  53892. TableProcessor.prototype.drawHorizontalLine = function (lineIndex, writer, overrideY) {
  53893. var lineWidth = this.layout.hLineWidth(lineIndex, this.tableNode);
  53894. if (lineWidth) {
  53895. var style = this.layout.hLineStyle(lineIndex, this.tableNode);
  53896. var dash;
  53897. if (style && style.dash) {
  53898. dash = style.dash;
  53899. }
  53900. var offset = lineWidth / 2;
  53901. var currentLine = null;
  53902. var body = this.tableNode.table.body;
  53903. var cellAbove;
  53904. var currentCell;
  53905. var rowCellAbove;
  53906. for (var i = 0, l = this.rowSpanData.length; i < l; i++) {
  53907. var data = this.rowSpanData[i];
  53908. var shouldDrawLine = !data.rowSpan;
  53909. var borderColor = null;
  53910. // draw only if the current cell requires a top border or the cell in the
  53911. // row above requires a bottom border
  53912. if (shouldDrawLine && i < l - 1) {
  53913. var topBorder = false, bottomBorder = false, rowBottomBorder = false;
  53914. // the cell in the row above
  53915. if (lineIndex > 0) {
  53916. cellAbove = body[lineIndex - 1][i];
  53917. bottomBorder = cellAbove.border ? cellAbove.border[3] : this.layout.defaultBorder;
  53918. if (bottomBorder && cellAbove.borderColor) {
  53919. borderColor = cellAbove.borderColor[3];
  53920. }
  53921. }
  53922. // the current cell
  53923. if (lineIndex < body.length) {
  53924. currentCell = body[lineIndex][i];
  53925. topBorder = currentCell.border ? currentCell.border[1] : this.layout.defaultBorder;
  53926. if (topBorder && borderColor == null && currentCell.borderColor) {
  53927. borderColor = currentCell.borderColor[1];
  53928. }
  53929. }
  53930. shouldDrawLine = topBorder || bottomBorder;
  53931. }
  53932. if (cellAbove && cellAbove._rowSpanCurrentOffset) {
  53933. rowCellAbove = body[lineIndex - 1 - cellAbove._rowSpanCurrentOffset][i];
  53934. rowBottomBorder = rowCellAbove && rowCellAbove.border ? rowCellAbove.border[3] : this.layout.defaultBorder;
  53935. if (rowBottomBorder && rowCellAbove && rowCellAbove.borderColor) {
  53936. borderColor = rowCellAbove.borderColor[3];
  53937. }
  53938. }
  53939. if (borderColor == null) {
  53940. borderColor = isFunction(this.layout.hLineColor) ? this.layout.hLineColor(lineIndex, this.tableNode, i) : this.layout.hLineColor;
  53941. }
  53942. if (!currentLine && shouldDrawLine) {
  53943. currentLine = { left: data.left, width: 0 };
  53944. }
  53945. if (shouldDrawLine) {
  53946. var colSpanIndex = 0;
  53947. if (rowCellAbove && rowCellAbove.colSpan && rowBottomBorder) {
  53948. while (rowCellAbove.colSpan > colSpanIndex) {
  53949. currentLine.width += (this.rowSpanData[i + colSpanIndex++].width || 0);
  53950. }
  53951. i += colSpanIndex - 1;
  53952. } else if (cellAbove && cellAbove.colSpan && bottomBorder) {
  53953. while (cellAbove.colSpan > colSpanIndex) {
  53954. currentLine.width += (this.rowSpanData[i + colSpanIndex++].width || 0);
  53955. }
  53956. i += colSpanIndex - 1;
  53957. } else if (currentCell && currentCell.colSpan && topBorder) {
  53958. while (currentCell.colSpan > colSpanIndex) {
  53959. currentLine.width += (this.rowSpanData[i + colSpanIndex++].width || 0);
  53960. }
  53961. i += colSpanIndex - 1;
  53962. } else {
  53963. currentLine.width += (this.rowSpanData[i].width || 0);
  53964. }
  53965. }
  53966. var y = (overrideY || 0) + offset;
  53967. if (shouldDrawLine) {
  53968. if (currentLine && currentLine.width) {
  53969. writer.addVector({
  53970. type: 'line',
  53971. x1: currentLine.left,
  53972. x2: currentLine.left + currentLine.width,
  53973. y1: y,
  53974. y2: y,
  53975. lineWidth: lineWidth,
  53976. dash: dash,
  53977. lineColor: borderColor
  53978. }, false, overrideY);
  53979. currentLine = null;
  53980. borderColor = null;
  53981. cellAbove = null;
  53982. currentCell = null;
  53983. rowCellAbove = null;
  53984. }
  53985. }
  53986. }
  53987. writer.context().moveDown(lineWidth);
  53988. }
  53989. };
  53990. TableProcessor.prototype.drawVerticalLine = function (x, y0, y1, vLineColIndex, writer, vLineRowIndex, beforeVLineColIndex) {
  53991. var width = this.layout.vLineWidth(vLineColIndex, this.tableNode);
  53992. if (width === 0) {
  53993. return;
  53994. }
  53995. var style = this.layout.vLineStyle(vLineColIndex, this.tableNode);
  53996. var dash;
  53997. if (style && style.dash) {
  53998. dash = style.dash;
  53999. }
  54000. var body = this.tableNode.table.body;
  54001. var cellBefore;
  54002. var currentCell;
  54003. var borderColor;
  54004. // the cell in the col before
  54005. if (vLineColIndex > 0) {
  54006. cellBefore = body[vLineRowIndex][beforeVLineColIndex];
  54007. if (cellBefore && cellBefore.borderColor) {
  54008. if (cellBefore.border ? cellBefore.border[2] : this.layout.defaultBorder) {
  54009. borderColor = cellBefore.borderColor[2];
  54010. }
  54011. }
  54012. }
  54013. // the current cell
  54014. if (borderColor == null && vLineColIndex < body.length) {
  54015. currentCell = body[vLineRowIndex][vLineColIndex];
  54016. if (currentCell && currentCell.borderColor) {
  54017. if (currentCell.border ? currentCell.border[0] : this.layout.defaultBorder) {
  54018. borderColor = currentCell.borderColor[0];
  54019. }
  54020. }
  54021. }
  54022. if (borderColor == null && cellBefore && cellBefore._rowSpanCurrentOffset) {
  54023. var rowCellBeforeAbove = body[vLineRowIndex - cellBefore._rowSpanCurrentOffset][beforeVLineColIndex];
  54024. if (rowCellBeforeAbove.borderColor) {
  54025. if (rowCellBeforeAbove.border ? rowCellBeforeAbove.border[2] : this.layout.defaultBorder) {
  54026. borderColor = rowCellBeforeAbove.borderColor[2];
  54027. }
  54028. }
  54029. }
  54030. if (borderColor == null && currentCell && currentCell._rowSpanCurrentOffset) {
  54031. var rowCurrentCellAbove = body[vLineRowIndex - currentCell._rowSpanCurrentOffset][vLineColIndex];
  54032. if (rowCurrentCellAbove.borderColor) {
  54033. if (rowCurrentCellAbove.border ? rowCurrentCellAbove.border[2] : this.layout.defaultBorder) {
  54034. borderColor = rowCurrentCellAbove.borderColor[2];
  54035. }
  54036. }
  54037. }
  54038. if (borderColor == null) {
  54039. borderColor = isFunction(this.layout.vLineColor) ? this.layout.vLineColor(vLineColIndex, this.tableNode, vLineRowIndex) : this.layout.vLineColor;
  54040. }
  54041. writer.addVector({
  54042. type: 'line',
  54043. x1: x + width / 2,
  54044. x2: x + width / 2,
  54045. y1: y0,
  54046. y2: y1,
  54047. lineWidth: width,
  54048. dash: dash,
  54049. lineColor: borderColor
  54050. }, false, true);
  54051. cellBefore = null;
  54052. currentCell = null;
  54053. borderColor = null;
  54054. };
  54055. TableProcessor.prototype.endTable = function (writer) {
  54056. if (this.cleanUpRepeatables) {
  54057. writer.popFromRepeatables();
  54058. }
  54059. };
  54060. TableProcessor.prototype.endRow = function (rowIndex, writer, pageBreaks) {
  54061. var l, i;
  54062. var self = this;
  54063. writer.tracker.stopTracking('pageChanged', this.rowCallback);
  54064. writer.context().moveDown(this.layout.paddingBottom(rowIndex, this.tableNode));
  54065. writer.context().availableHeight += this.reservedAtBottom;
  54066. var endingPage = writer.context().page;
  54067. var endingY = writer.context().y;
  54068. var xs = getLineXs();
  54069. var ys = [];
  54070. var hasBreaks = pageBreaks && pageBreaks.length > 0;
  54071. var body = this.tableNode.table.body;
  54072. ys.push({
  54073. y0: this.rowTopY,
  54074. page: hasBreaks ? pageBreaks[0].prevPage : endingPage
  54075. });
  54076. if (hasBreaks) {
  54077. for (i = 0, l = pageBreaks.length; i < l; i++) {
  54078. var pageBreak = pageBreaks[i];
  54079. ys[ys.length - 1].y1 = pageBreak.prevY;
  54080. ys.push({ y0: pageBreak.y, page: pageBreak.prevPage + 1 });
  54081. }
  54082. }
  54083. ys[ys.length - 1].y1 = endingY;
  54084. var skipOrphanePadding = (ys[0].y1 - ys[0].y0 === this.rowPaddingTop);
  54085. for (var yi = (skipOrphanePadding ? 1 : 0), yl = ys.length; yi < yl; yi++) {
  54086. var willBreak = yi < ys.length - 1;
  54087. var rowBreakWithoutHeader = (yi > 0 && !this.headerRows);
  54088. var hzLineOffset = rowBreakWithoutHeader ? 0 : this.topLineWidth;
  54089. var y1 = ys[yi].y0;
  54090. var y2 = ys[yi].y1;
  54091. if (willBreak) {
  54092. y2 = y2 + this.rowPaddingBottom;
  54093. }
  54094. if (writer.context().page != ys[yi].page) {
  54095. writer.context().page = ys[yi].page;
  54096. //TODO: buggy, availableHeight should be updated on every pageChanged event
  54097. // TableProcessor should be pageChanged listener, instead of processRow
  54098. this.reservedAtBottom = 0;
  54099. }
  54100. for (i = 0, l = xs.length; i < l; i++) {
  54101. var leftCellBorder = false;
  54102. var rightCellBorder = false;
  54103. var colIndex = xs[i].index;
  54104. // current cell
  54105. if (colIndex < body[rowIndex].length) {
  54106. var cell = body[rowIndex][colIndex];
  54107. leftCellBorder = cell.border ? cell.border[0] : this.layout.defaultBorder;
  54108. rightCellBorder = cell.border ? cell.border[2] : this.layout.defaultBorder;
  54109. }
  54110. // before cell
  54111. if (colIndex > 0 && !leftCellBorder) {
  54112. var cell = body[rowIndex][colIndex - 1];
  54113. leftCellBorder = cell.border ? cell.border[2] : this.layout.defaultBorder;
  54114. }
  54115. // after cell
  54116. if (colIndex + 1 < body[rowIndex].length && !rightCellBorder) {
  54117. var cell = body[rowIndex][colIndex + 1];
  54118. rightCellBorder = cell.border ? cell.border[0] : this.layout.defaultBorder;
  54119. }
  54120. if (leftCellBorder) {
  54121. this.drawVerticalLine(xs[i].x, y1 - hzLineOffset, y2 + this.bottomLineWidth, xs[i].index, writer, rowIndex, xs[i - 1] ? xs[i - 1].index : null);
  54122. }
  54123. if (i < l - 1) {
  54124. var fillColor = body[rowIndex][colIndex].fillColor;
  54125. var fillOpacity = body[rowIndex][colIndex].fillOpacity;
  54126. if (!fillColor) {
  54127. fillColor = isFunction(this.layout.fillColor) ? this.layout.fillColor(rowIndex, this.tableNode, colIndex) : this.layout.fillColor;
  54128. }
  54129. if (!isNumber(fillOpacity)) {
  54130. fillOpacity = isFunction(this.layout.fillOpacity) ? this.layout.fillOpacity(rowIndex, this.tableNode, colIndex) : this.layout.fillOpacity;
  54131. }
  54132. if (fillColor) {
  54133. var widthLeftBorder = leftCellBorder ? this.layout.vLineWidth(colIndex, this.tableNode) : 0;
  54134. var widthRightBorder;
  54135. if ((colIndex === 0 || colIndex + 1 == body[rowIndex].length) && !rightCellBorder) {
  54136. widthRightBorder = this.layout.vLineWidth(colIndex + 1, this.tableNode);
  54137. } else if (rightCellBorder) {
  54138. widthRightBorder = this.layout.vLineWidth(colIndex + 1, this.tableNode) / 2;
  54139. } else {
  54140. widthRightBorder = 0;
  54141. }
  54142. var x1f = this.dontBreakRows ? xs[i].x + widthLeftBorder : xs[i].x + (widthLeftBorder / 2);
  54143. var y1f = this.dontBreakRows ? y1 : y1 - (hzLineOffset / 2);
  54144. var x2f = xs[i + 1].x + widthRightBorder;
  54145. var y2f = this.dontBreakRows ? y2 + this.bottomLineWidth : y2 + (this.bottomLineWidth / 2);
  54146. writer.addVector({
  54147. type: 'rect',
  54148. x: x1f,
  54149. y: y1f,
  54150. w: x2f - x1f,
  54151. h: y2f - y1f,
  54152. lineWidth: 0,
  54153. color: fillColor,
  54154. fillOpacity: fillOpacity
  54155. }, false, true, writer.context().backgroundLength[writer.context().page]);
  54156. }
  54157. }
  54158. }
  54159. if (willBreak && this.layout.hLineWhenBroken !== false) {
  54160. this.drawHorizontalLine(rowIndex + 1, writer, y2);
  54161. }
  54162. if (rowBreakWithoutHeader && this.layout.hLineWhenBroken !== false) {
  54163. this.drawHorizontalLine(rowIndex, writer, y1);
  54164. }
  54165. }
  54166. writer.context().page = endingPage;
  54167. writer.context().y = endingY;
  54168. var row = this.tableNode.table.body[rowIndex];
  54169. for (i = 0, l = row.length; i < l; i++) {
  54170. if (row[i].rowSpan) {
  54171. this.rowSpanData[i].rowSpan = row[i].rowSpan;
  54172. // fix colSpans
  54173. if (row[i].colSpan && row[i].colSpan > 1) {
  54174. for (var j = 1; j < row[i].rowSpan; j++) {
  54175. this.tableNode.table.body[rowIndex + j][i]._colSpan = row[i].colSpan;
  54176. }
  54177. }
  54178. // fix rowSpans
  54179. if (row[i].rowSpan && row[i].rowSpan > 1) {
  54180. for (var j = 1; j < row[i].rowSpan; j++) {
  54181. this.tableNode.table.body[rowIndex + j][i]._rowSpanCurrentOffset = j;
  54182. }
  54183. }
  54184. }
  54185. if (this.rowSpanData[i].rowSpan > 0) {
  54186. this.rowSpanData[i].rowSpan--;
  54187. }
  54188. }
  54189. this.drawHorizontalLine(rowIndex + 1, writer);
  54190. if (this.headerRows && rowIndex === this.headerRows - 1) {
  54191. this.headerRepeatable = writer.currentBlockToRepeatable();
  54192. }
  54193. if (this.dontBreakRows) {
  54194. writer.tracker.auto('pageChanged',
  54195. function () {
  54196. if (!self.headerRows && self.layout.hLineWhenBroken !== false) {
  54197. self.drawHorizontalLine(rowIndex, writer);
  54198. }
  54199. },
  54200. function () {
  54201. writer.commitUnbreakableBlock();
  54202. }
  54203. );
  54204. }
  54205. if (this.headerRepeatable && (rowIndex === (this.rowsWithoutPageBreak - 1) || rowIndex === this.tableNode.table.body.length - 1)) {
  54206. writer.commitUnbreakableBlock();
  54207. writer.pushToRepeatables(this.headerRepeatable);
  54208. this.cleanUpRepeatables = true;
  54209. this.headerRepeatable = null;
  54210. }
  54211. function getLineXs() {
  54212. var result = [];
  54213. var cols = 0;
  54214. for (var i = 0, l = self.tableNode.table.body[rowIndex].length; i < l; i++) {
  54215. if (!cols) {
  54216. result.push({ x: self.rowSpanData[i].left, index: i });
  54217. var item = self.tableNode.table.body[rowIndex][i];
  54218. cols = (item._colSpan || item.colSpan || 0);
  54219. }
  54220. if (cols > 0) {
  54221. cols--;
  54222. }
  54223. }
  54224. result.push({ x: self.rowSpanData[self.rowSpanData.length - 1].left, index: self.rowSpanData.length - 1 });
  54225. return result;
  54226. }
  54227. };
  54228. module.exports = TableProcessor;
  54229. /***/ }),
  54230. /* 452 */
  54231. /***/ (function(module, exports, __webpack_require__) {
  54232. "use strict";
  54233. module.exports = {
  54234. '4A0': [4767.87, 6740.79],
  54235. '2A0': [3370.39, 4767.87],
  54236. A0: [2383.94, 3370.39],
  54237. A1: [1683.78, 2383.94],
  54238. A2: [1190.55, 1683.78],
  54239. A3: [841.89, 1190.55],
  54240. A4: [595.28, 841.89],
  54241. A5: [419.53, 595.28],
  54242. A6: [297.64, 419.53],
  54243. A7: [209.76, 297.64],
  54244. A8: [147.40, 209.76],
  54245. A9: [104.88, 147.40],
  54246. A10: [73.70, 104.88],
  54247. B0: [2834.65, 4008.19],
  54248. B1: [2004.09, 2834.65],
  54249. B2: [1417.32, 2004.09],
  54250. B3: [1000.63, 1417.32],
  54251. B4: [708.66, 1000.63],
  54252. B5: [498.90, 708.66],
  54253. B6: [354.33, 498.90],
  54254. B7: [249.45, 354.33],
  54255. B8: [175.75, 249.45],
  54256. B9: [124.72, 175.75],
  54257. B10: [87.87, 124.72],
  54258. C0: [2599.37, 3676.54],
  54259. C1: [1836.85, 2599.37],
  54260. C2: [1298.27, 1836.85],
  54261. C3: [918.43, 1298.27],
  54262. C4: [649.13, 918.43],
  54263. C5: [459.21, 649.13],
  54264. C6: [323.15, 459.21],
  54265. C7: [229.61, 323.15],
  54266. C8: [161.57, 229.61],
  54267. C9: [113.39, 161.57],
  54268. C10: [79.37, 113.39],
  54269. RA0: [2437.80, 3458.27],
  54270. RA1: [1729.13, 2437.80],
  54271. RA2: [1218.90, 1729.13],
  54272. RA3: [864.57, 1218.90],
  54273. RA4: [609.45, 864.57],
  54274. SRA0: [2551.18, 3628.35],
  54275. SRA1: [1814.17, 2551.18],
  54276. SRA2: [1275.59, 1814.17],
  54277. SRA3: [907.09, 1275.59],
  54278. SRA4: [637.80, 907.09],
  54279. EXECUTIVE: [521.86, 756.00],
  54280. FOLIO: [612.00, 936.00],
  54281. LEGAL: [612.00, 1008.00],
  54282. LETTER: [612.00, 792.00],
  54283. TABLOID: [792.00, 1224.00]
  54284. };
  54285. /***/ }),
  54286. /* 453 */
  54287. /***/ (function(module, exports, __webpack_require__) {
  54288. "use strict";
  54289. /* WEBPACK VAR INJECTION */(function(Buffer) {
  54290. function ImageMeasure(pdfKitDoc, imageDictionary) {
  54291. this.pdfKitDoc = pdfKitDoc;
  54292. this.imageDictionary = imageDictionary || {};
  54293. }
  54294. ImageMeasure.prototype.measureImage = function (src) {
  54295. var image;
  54296. var that = this;
  54297. if (!this.pdfKitDoc._imageRegistry[src]) {
  54298. try {
  54299. image = this.pdfKitDoc.openImage(realImageSrc(src));
  54300. if (!image) {
  54301. throw 'No image';
  54302. }
  54303. } catch (error) {
  54304. throw 'Invalid image: ' + error.toString() + '\nImages dictionary should contain dataURL entries (or local file paths in node.js)';
  54305. }
  54306. image.embed(this.pdfKitDoc);
  54307. this.pdfKitDoc._imageRegistry[src] = image;
  54308. } else {
  54309. image = this.pdfKitDoc._imageRegistry[src];
  54310. }
  54311. return { width: image.width, height: image.height };
  54312. function realImageSrc(src) {
  54313. var img = that.imageDictionary[src];
  54314. if (!img) {
  54315. return src;
  54316. }
  54317. var index = img.indexOf('base64,');
  54318. if (index < 0) {
  54319. return that.imageDictionary[src];
  54320. }
  54321. return Buffer.from(img.substring(index + 7), 'base64');
  54322. }
  54323. };
  54324. module.exports = ImageMeasure;
  54325. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(4).Buffer))
  54326. /***/ }),
  54327. /* 454 */
  54328. /***/ (function(module, exports, __webpack_require__) {
  54329. "use strict";
  54330. function SVGMeasure() {
  54331. }
  54332. SVGMeasure.prototype.getSVGNode = function (svgString) {
  54333. // remove newlines
  54334. svgString = svgString.replace(/\r?\n|\r/g, "");
  54335. var svgNodeMatches = svgString.match(/<svg(.*?)>/);
  54336. if (svgNodeMatches) {
  54337. // extract svg node <svg ... >
  54338. return svgNodeMatches[0];
  54339. }
  54340. return "";
  54341. };
  54342. SVGMeasure.prototype.getHeightAndWidth = function (svgString) {
  54343. var svgNode = this.getSVGNode(svgString);
  54344. var widthMatches = svgNode.match(/width="([0-9]+(\.[0-9]+)?)(em|ex|px|in|cm|mm|pt|pc|%)?"/);
  54345. var heightMatches = svgNode.match(/height="([0-9]+(\.[0-9]+)?)(em|ex|px|in|cm|mm|pt|pc|%)?"/);
  54346. if (widthMatches || heightMatches) {
  54347. return {
  54348. width: widthMatches ? +widthMatches[1] : undefined,
  54349. height: heightMatches ? +heightMatches[1] : undefined
  54350. };
  54351. }
  54352. };
  54353. SVGMeasure.prototype.getViewboxHeightAndWidth = function (svgString) {
  54354. var svgNode = this.getSVGNode(svgString);
  54355. var viewboxMatches = svgNode.match(/viewBox="([+-]?(\d*\.)?\d+(,|\s+|,\s+)[+-]?(\d*\.)?\d+(,|\s+|,\s+)[+-]?(\d*\.)?\d+(,|\s+|,\s+)[+-]?(\d*\.)?\d+)"/);
  54356. if (viewboxMatches) {
  54357. var viewboxStr = viewboxMatches[1];
  54358. var allVieboxEntries = viewboxStr.split(" ");
  54359. var viewboxEntries = []; // weeding out empty strings
  54360. for (var i = 0; i < allVieboxEntries.length; i++) {
  54361. if (allVieboxEntries[i]) {
  54362. viewboxEntries.push(allVieboxEntries[i]);
  54363. }
  54364. }
  54365. if (viewboxEntries.length === 4) {
  54366. return { width: +viewboxEntries[2], height: +viewboxEntries[3] };
  54367. }
  54368. throw new Error("Unexpected svg viewbox format, should have 4 entries but found: '" + viewboxStr + "'");
  54369. }
  54370. };
  54371. SVGMeasure.prototype.measureSVG = function (svgString) {
  54372. var heightAndWidth = this.getHeightAndWidth(svgString);
  54373. var viewboxHeightAndWidth = this.getViewboxHeightAndWidth(svgString);
  54374. return heightAndWidth || viewboxHeightAndWidth || {};
  54375. };
  54376. SVGMeasure.prototype.writeDimensions = function (svgString, dimensions) {
  54377. var svgNode = this.getSVGNode(svgString);
  54378. if (svgNode) {
  54379. var nodeDimensions = this.getHeightAndWidth(svgString);
  54380. if (dimensions.width) {
  54381. var newWidth = 'width="' + dimensions.width + '"';
  54382. if (nodeDimensions && nodeDimensions.width) {
  54383. // replace existing width
  54384. svgNode = svgNode.replace(/width="[0-9]+(\.[0-9]+)?(em|ex|px|in|cm|mm|pt|pc|%)?"/, newWidth);
  54385. } else {
  54386. // insert new width
  54387. svgNode = svgNode.replace(">", " " + newWidth + ">");
  54388. }
  54389. }
  54390. if (dimensions.height) {
  54391. var newHeight = 'height="' + dimensions.height + '"';
  54392. if (nodeDimensions && nodeDimensions.height) {
  54393. // replace existing height
  54394. svgNode = svgNode.replace(/height="[0-9]+(\.[0-9]+)?(em|ex|px|in|cm|mm|pt|pc|%)?"/, newHeight);
  54395. } else {
  54396. // insert new height
  54397. svgNode = svgNode.replace(">", " " + newHeight + ">");
  54398. }
  54399. }
  54400. // insert updated svg node
  54401. return svgString.replace(/<svg(.*?)>/, svgNode);
  54402. }
  54403. return svgString;
  54404. };
  54405. module.exports = SVGMeasure;
  54406. /***/ }),
  54407. /* 455 */
  54408. /***/ (function(module, exports, __webpack_require__) {
  54409. "use strict";
  54410. var isArray = __webpack_require__(0).isArray;
  54411. function groupDecorations(line) {
  54412. var groups = [], currentGroup = null;
  54413. for (var i = 0, l = line.inlines.length; i < l; i++) {
  54414. var inline = line.inlines[i];
  54415. var decoration = inline.decoration;
  54416. if (!decoration) {
  54417. currentGroup = null;
  54418. continue;
  54419. }
  54420. if (!isArray(decoration)) {
  54421. decoration = [decoration];
  54422. }
  54423. var color = inline.decorationColor || inline.color || 'black';
  54424. var style = inline.decorationStyle || 'solid';
  54425. for (var ii = 0, ll = decoration.length; ii < ll; ii++) {
  54426. var decorationItem = decoration[ii];
  54427. if (!currentGroup || decorationItem !== currentGroup.decoration ||
  54428. style !== currentGroup.decorationStyle || color !== currentGroup.decorationColor) {
  54429. currentGroup = {
  54430. line: line,
  54431. decoration: decorationItem,
  54432. decorationColor: color,
  54433. decorationStyle: style,
  54434. inlines: [inline]
  54435. };
  54436. groups.push(currentGroup);
  54437. } else {
  54438. currentGroup.inlines.push(inline);
  54439. }
  54440. }
  54441. }
  54442. return groups;
  54443. }
  54444. function drawDecoration(group, x, y, pdfKitDoc) {
  54445. function maxInline() {
  54446. var max = 0;
  54447. for (var i = 0, l = group.inlines.length; i < l; i++) {
  54448. var inline = group.inlines[i];
  54449. max = inline.fontSize > max ? i : max;
  54450. }
  54451. return group.inlines[max];
  54452. }
  54453. function width() {
  54454. var sum = 0;
  54455. for (var i = 0, l = group.inlines.length; i < l; i++) {
  54456. var justifyShift = (group.inlines[i].justifyShift || 0);
  54457. sum += group.inlines[i].width + justifyShift;
  54458. }
  54459. return sum;
  54460. }
  54461. var firstInline = group.inlines[0],
  54462. biggerInline = maxInline(),
  54463. totalWidth = width(),
  54464. lineAscent = group.line.getAscenderHeight(),
  54465. ascent = biggerInline.font.ascender / 1000 * biggerInline.fontSize,
  54466. height = biggerInline.height,
  54467. descent = height - ascent;
  54468. var lw = 0.5 + Math.floor(Math.max(biggerInline.fontSize - 8, 0) / 2) * 0.12;
  54469. switch (group.decoration) {
  54470. case 'underline':
  54471. y += lineAscent + descent * 0.45;
  54472. break;
  54473. case 'overline':
  54474. y += lineAscent - (ascent * 0.85);
  54475. break;
  54476. case 'lineThrough':
  54477. y += lineAscent - (ascent * 0.25);
  54478. break;
  54479. default:
  54480. throw 'Unkown decoration : ' + group.decoration;
  54481. }
  54482. pdfKitDoc.save();
  54483. if (group.decorationStyle === 'double') {
  54484. var gap = Math.max(0.5, lw * 2);
  54485. pdfKitDoc.fillColor(group.decorationColor)
  54486. .rect(x + firstInline.x, y - lw / 2, totalWidth, lw / 2).fill()
  54487. .rect(x + firstInline.x, y + gap - lw / 2, totalWidth, lw / 2).fill();
  54488. } else if (group.decorationStyle === 'dashed') {
  54489. var nbDashes = Math.ceil(totalWidth / (3.96 + 2.84));
  54490. var rdx = x + firstInline.x;
  54491. pdfKitDoc.rect(rdx, y, totalWidth, lw).clip();
  54492. pdfKitDoc.fillColor(group.decorationColor);
  54493. for (var i = 0; i < nbDashes; i++) {
  54494. pdfKitDoc.rect(rdx, y - lw / 2, 3.96, lw).fill();
  54495. rdx += 3.96 + 2.84;
  54496. }
  54497. } else if (group.decorationStyle === 'dotted') {
  54498. var nbDots = Math.ceil(totalWidth / (lw * 3));
  54499. var rx = x + firstInline.x;
  54500. pdfKitDoc.rect(rx, y, totalWidth, lw).clip();
  54501. pdfKitDoc.fillColor(group.decorationColor);
  54502. for (var ii = 0; ii < nbDots; ii++) {
  54503. pdfKitDoc.rect(rx, y - lw / 2, lw, lw).fill();
  54504. rx += (lw * 3);
  54505. }
  54506. } else if (group.decorationStyle === 'wavy') {
  54507. var sh = 0.7, sv = 1;
  54508. var nbWaves = Math.ceil(totalWidth / (sh * 2)) + 1;
  54509. var rwx = x + firstInline.x - 1;
  54510. pdfKitDoc.rect(x + firstInline.x, y - sv, totalWidth, y + sv).clip();
  54511. pdfKitDoc.lineWidth(0.24);
  54512. pdfKitDoc.moveTo(rwx, y);
  54513. for (var iii = 0; iii < nbWaves; iii++) {
  54514. pdfKitDoc.bezierCurveTo(rwx + sh, y - sv, rwx + sh * 2, y - sv, rwx + sh * 3, y)
  54515. .bezierCurveTo(rwx + sh * 4, y + sv, rwx + sh * 5, y + sv, rwx + sh * 6, y);
  54516. rwx += sh * 6;
  54517. }
  54518. pdfKitDoc.stroke(group.decorationColor);
  54519. } else {
  54520. pdfKitDoc.fillColor(group.decorationColor)
  54521. .rect(x + firstInline.x, y - lw / 2, totalWidth, lw)
  54522. .fill();
  54523. }
  54524. pdfKitDoc.restore();
  54525. }
  54526. function drawDecorations(line, x, y, pdfKitDoc) {
  54527. var groups = groupDecorations(line);
  54528. for (var i = 0, l = groups.length; i < l; i++) {
  54529. drawDecoration(groups[i], x, y, pdfKitDoc);
  54530. }
  54531. }
  54532. function drawBackground(line, x, y, pdfKitDoc) {
  54533. var height = line.getHeight();
  54534. for (var i = 0, l = line.inlines.length; i < l; i++) {
  54535. var inline = line.inlines[i];
  54536. if (!inline.background) {
  54537. continue;
  54538. }
  54539. var justifyShift = (inline.justifyShift || 0);
  54540. pdfKitDoc.fillColor(inline.background)
  54541. .rect(x + inline.x - justifyShift, y, inline.width + justifyShift, height)
  54542. .fill();
  54543. }
  54544. }
  54545. module.exports = {
  54546. drawBackground: drawBackground,
  54547. drawDecorations: drawDecorations
  54548. };
  54549. /***/ }),
  54550. /* 456 */
  54551. /***/ (function(module, exports, __webpack_require__) {
  54552. "use strict";
  54553. /* WEBPACK VAR INJECTION */(function(module) {
  54554. __webpack_require__(139);
  54555. __webpack_require__(137);
  54556. __webpack_require__(155);
  54557. __webpack_require__(159);
  54558. __webpack_require__(153);
  54559. __webpack_require__(92);
  54560. __webpack_require__(99);
  54561. __webpack_require__(66);
  54562. __webpack_require__(161);
  54563. __webpack_require__(160);
  54564. __webpack_require__(152);
  54565. var SVGtoPDF = function SVGtoPDF(doc, svg, x, y, options) {
  54566. "use strict";
  54567. var NamedColors = {
  54568. aliceblue: [240, 248, 255],
  54569. antiquewhite: [250, 235, 215],
  54570. aqua: [0, 255, 255],
  54571. aquamarine: [127, 255, 212],
  54572. azure: [240, 255, 255],
  54573. beige: [245, 245, 220],
  54574. bisque: [255, 228, 196],
  54575. black: [0, 0, 0],
  54576. blanchedalmond: [255, 235, 205],
  54577. blue: [0, 0, 255],
  54578. blueviolet: [138, 43, 226],
  54579. brown: [165, 42, 42],
  54580. burlywood: [222, 184, 135],
  54581. cadetblue: [95, 158, 160],
  54582. chartreuse: [127, 255, 0],
  54583. chocolate: [210, 105, 30],
  54584. coral: [255, 127, 80],
  54585. cornflowerblue: [100, 149, 237],
  54586. cornsilk: [255, 248, 220],
  54587. crimson: [220, 20, 60],
  54588. cyan: [0, 255, 255],
  54589. darkblue: [0, 0, 139],
  54590. darkcyan: [0, 139, 139],
  54591. darkgoldenrod: [184, 134, 11],
  54592. darkgray: [169, 169, 169],
  54593. darkgrey: [169, 169, 169],
  54594. darkgreen: [0, 100, 0],
  54595. darkkhaki: [189, 183, 107],
  54596. darkmagenta: [139, 0, 139],
  54597. darkolivegreen: [85, 107, 47],
  54598. darkorange: [255, 140, 0],
  54599. darkorchid: [153, 50, 204],
  54600. darkred: [139, 0, 0],
  54601. darksalmon: [233, 150, 122],
  54602. darkseagreen: [143, 188, 143],
  54603. darkslateblue: [72, 61, 139],
  54604. darkslategray: [47, 79, 79],
  54605. darkslategrey: [47, 79, 79],
  54606. darkturquoise: [0, 206, 209],
  54607. darkviolet: [148, 0, 211],
  54608. deeppink: [255, 20, 147],
  54609. deepskyblue: [0, 191, 255],
  54610. dimgray: [105, 105, 105],
  54611. dimgrey: [105, 105, 105],
  54612. dodgerblue: [30, 144, 255],
  54613. firebrick: [178, 34, 34],
  54614. floralwhite: [255, 250, 240],
  54615. forestgreen: [34, 139, 34],
  54616. fuchsia: [255, 0, 255],
  54617. gainsboro: [220, 220, 220],
  54618. ghostwhite: [248, 248, 255],
  54619. gold: [255, 215, 0],
  54620. goldenrod: [218, 165, 32],
  54621. gray: [128, 128, 128],
  54622. grey: [128, 128, 128],
  54623. green: [0, 128, 0],
  54624. greenyellow: [173, 255, 47],
  54625. honeydew: [240, 255, 240],
  54626. hotpink: [255, 105, 180],
  54627. indianred: [205, 92, 92],
  54628. indigo: [75, 0, 130],
  54629. ivory: [255, 255, 240],
  54630. khaki: [240, 230, 140],
  54631. lavender: [230, 230, 250],
  54632. lavenderblush: [255, 240, 245],
  54633. lawngreen: [124, 252, 0],
  54634. lemonchiffon: [255, 250, 205],
  54635. lightblue: [173, 216, 230],
  54636. lightcoral: [240, 128, 128],
  54637. lightcyan: [224, 255, 255],
  54638. lightgoldenrodyellow: [250, 250, 210],
  54639. lightgray: [211, 211, 211],
  54640. lightgrey: [211, 211, 211],
  54641. lightgreen: [144, 238, 144],
  54642. lightpink: [255, 182, 193],
  54643. lightsalmon: [255, 160, 122],
  54644. lightseagreen: [32, 178, 170],
  54645. lightskyblue: [135, 206, 250],
  54646. lightslategray: [119, 136, 153],
  54647. lightslategrey: [119, 136, 153],
  54648. lightsteelblue: [176, 196, 222],
  54649. lightyellow: [255, 255, 224],
  54650. lime: [0, 255, 0],
  54651. limegreen: [50, 205, 50],
  54652. linen: [250, 240, 230],
  54653. magenta: [255, 0, 255],
  54654. maroon: [128, 0, 0],
  54655. mediumaquamarine: [102, 205, 170],
  54656. mediumblue: [0, 0, 205],
  54657. mediumorchid: [186, 85, 211],
  54658. mediumpurple: [147, 112, 219],
  54659. mediumseagreen: [60, 179, 113],
  54660. mediumslateblue: [123, 104, 238],
  54661. mediumspringgreen: [0, 250, 154],
  54662. mediumturquoise: [72, 209, 204],
  54663. mediumvioletred: [199, 21, 133],
  54664. midnightblue: [25, 25, 112],
  54665. mintcream: [245, 255, 250],
  54666. mistyrose: [255, 228, 225],
  54667. moccasin: [255, 228, 181],
  54668. navajowhite: [255, 222, 173],
  54669. navy: [0, 0, 128],
  54670. oldlace: [253, 245, 230],
  54671. olive: [128, 128, 0],
  54672. olivedrab: [107, 142, 35],
  54673. orange: [255, 165, 0],
  54674. orangered: [255, 69, 0],
  54675. orchid: [218, 112, 214],
  54676. palegoldenrod: [238, 232, 170],
  54677. palegreen: [152, 251, 152],
  54678. paleturquoise: [175, 238, 238],
  54679. palevioletred: [219, 112, 147],
  54680. papayawhip: [255, 239, 213],
  54681. peachpuff: [255, 218, 185],
  54682. peru: [205, 133, 63],
  54683. pink: [255, 192, 203],
  54684. plum: [221, 160, 221],
  54685. powderblue: [176, 224, 230],
  54686. purple: [128, 0, 128],
  54687. rebeccapurple: [102, 51, 153],
  54688. red: [255, 0, 0],
  54689. rosybrown: [188, 143, 143],
  54690. royalblue: [65, 105, 225],
  54691. saddlebrown: [139, 69, 19],
  54692. salmon: [250, 128, 114],
  54693. sandybrown: [244, 164, 96],
  54694. seagreen: [46, 139, 87],
  54695. seashell: [255, 245, 238],
  54696. sienna: [160, 82, 45],
  54697. silver: [192, 192, 192],
  54698. skyblue: [135, 206, 235],
  54699. slateblue: [106, 90, 205],
  54700. slategray: [112, 128, 144],
  54701. slategrey: [112, 128, 144],
  54702. snow: [255, 250, 250],
  54703. springgreen: [0, 255, 127],
  54704. steelblue: [70, 130, 180],
  54705. tan: [210, 180, 140],
  54706. teal: [0, 128, 128],
  54707. thistle: [216, 191, 216],
  54708. tomato: [255, 99, 71],
  54709. turquoise: [64, 224, 208],
  54710. violet: [238, 130, 238],
  54711. wheat: [245, 222, 179],
  54712. white: [255, 255, 255],
  54713. whitesmoke: [245, 245, 245],
  54714. yellow: [255, 255, 0]
  54715. };
  54716. var DefaultColors = {
  54717. black: [NamedColors.black, 1],
  54718. white: [NamedColors.white, 1],
  54719. transparent: [NamedColors.black, 0]
  54720. };
  54721. var Entities = {
  54722. quot: 34,
  54723. amp: 38,
  54724. lt: 60,
  54725. gt: 62,
  54726. apos: 39,
  54727. OElig: 338,
  54728. oelig: 339,
  54729. Scaron: 352,
  54730. scaron: 353,
  54731. Yuml: 376,
  54732. circ: 710,
  54733. tilde: 732,
  54734. ensp: 8194,
  54735. emsp: 8195,
  54736. thinsp: 8201,
  54737. zwnj: 8204,
  54738. zwj: 8205,
  54739. lrm: 8206,
  54740. rlm: 8207,
  54741. ndash: 8211,
  54742. mdash: 8212,
  54743. lsquo: 8216,
  54744. rsquo: 8217,
  54745. sbquo: 8218,
  54746. ldquo: 8220,
  54747. rdquo: 8221,
  54748. bdquo: 8222,
  54749. dagger: 8224,
  54750. Dagger: 8225,
  54751. permil: 8240,
  54752. lsaquo: 8249,
  54753. rsaquo: 8250,
  54754. euro: 8364,
  54755. nbsp: 160,
  54756. iexcl: 161,
  54757. cent: 162,
  54758. pound: 163,
  54759. curren: 164,
  54760. yen: 165,
  54761. brvbar: 166,
  54762. sect: 167,
  54763. uml: 168,
  54764. copy: 169,
  54765. ordf: 170,
  54766. laquo: 171,
  54767. not: 172,
  54768. shy: 173,
  54769. reg: 174,
  54770. macr: 175,
  54771. deg: 176,
  54772. plusmn: 177,
  54773. sup2: 178,
  54774. sup3: 179,
  54775. acute: 180,
  54776. micro: 181,
  54777. para: 182,
  54778. middot: 183,
  54779. cedil: 184,
  54780. sup1: 185,
  54781. ordm: 186,
  54782. raquo: 187,
  54783. frac14: 188,
  54784. frac12: 189,
  54785. frac34: 190,
  54786. iquest: 191,
  54787. Agrave: 192,
  54788. Aacute: 193,
  54789. Acirc: 194,
  54790. Atilde: 195,
  54791. Auml: 196,
  54792. Aring: 197,
  54793. AElig: 198,
  54794. Ccedil: 199,
  54795. Egrave: 200,
  54796. Eacute: 201,
  54797. Ecirc: 202,
  54798. Euml: 203,
  54799. Igrave: 204,
  54800. Iacute: 205,
  54801. Icirc: 206,
  54802. Iuml: 207,
  54803. ETH: 208,
  54804. Ntilde: 209,
  54805. Ograve: 210,
  54806. Oacute: 211,
  54807. Ocirc: 212,
  54808. Otilde: 213,
  54809. Ouml: 214,
  54810. times: 215,
  54811. Oslash: 216,
  54812. Ugrave: 217,
  54813. Uacute: 218,
  54814. Ucirc: 219,
  54815. Uuml: 220,
  54816. Yacute: 221,
  54817. THORN: 222,
  54818. szlig: 223,
  54819. agrave: 224,
  54820. aacute: 225,
  54821. acirc: 226,
  54822. atilde: 227,
  54823. auml: 228,
  54824. aring: 229,
  54825. aelig: 230,
  54826. ccedil: 231,
  54827. egrave: 232,
  54828. eacute: 233,
  54829. ecirc: 234,
  54830. euml: 235,
  54831. igrave: 236,
  54832. iacute: 237,
  54833. icirc: 238,
  54834. iuml: 239,
  54835. eth: 240,
  54836. ntilde: 241,
  54837. ograve: 242,
  54838. oacute: 243,
  54839. ocirc: 244,
  54840. otilde: 245,
  54841. ouml: 246,
  54842. divide: 247,
  54843. oslash: 248,
  54844. ugrave: 249,
  54845. uacute: 250,
  54846. ucirc: 251,
  54847. uuml: 252,
  54848. yacute: 253,
  54849. thorn: 254,
  54850. yuml: 255,
  54851. fnof: 402,
  54852. Alpha: 913,
  54853. Beta: 914,
  54854. Gamma: 915,
  54855. Delta: 916,
  54856. Epsilon: 917,
  54857. Zeta: 918,
  54858. Eta: 919,
  54859. Theta: 920,
  54860. Iota: 921,
  54861. Kappa: 922,
  54862. Lambda: 923,
  54863. Mu: 924,
  54864. Nu: 925,
  54865. Xi: 926,
  54866. Omicron: 927,
  54867. Pi: 928,
  54868. Rho: 929,
  54869. Sigma: 931,
  54870. Tau: 932,
  54871. Upsilon: 933,
  54872. Phi: 934,
  54873. Chi: 935,
  54874. Psi: 936,
  54875. Omega: 937,
  54876. alpha: 945,
  54877. beta: 946,
  54878. gamma: 947,
  54879. delta: 948,
  54880. epsilon: 949,
  54881. zeta: 950,
  54882. eta: 951,
  54883. theta: 952,
  54884. iota: 953,
  54885. kappa: 954,
  54886. lambda: 955,
  54887. mu: 956,
  54888. nu: 957,
  54889. xi: 958,
  54890. omicron: 959,
  54891. pi: 960,
  54892. rho: 961,
  54893. sigmaf: 962,
  54894. sigma: 963,
  54895. tau: 964,
  54896. upsilon: 965,
  54897. phi: 966,
  54898. chi: 967,
  54899. psi: 968,
  54900. omega: 969,
  54901. thetasym: 977,
  54902. upsih: 978,
  54903. piv: 982,
  54904. bull: 8226,
  54905. hellip: 8230,
  54906. prime: 8242,
  54907. Prime: 8243,
  54908. oline: 8254,
  54909. frasl: 8260,
  54910. weierp: 8472,
  54911. image: 8465,
  54912. real: 8476,
  54913. trade: 8482,
  54914. alefsym: 8501,
  54915. larr: 8592,
  54916. uarr: 8593,
  54917. rarr: 8594,
  54918. darr: 8595,
  54919. harr: 8596,
  54920. crarr: 8629,
  54921. lArr: 8656,
  54922. uArr: 8657,
  54923. rArr: 8658,
  54924. dArr: 8659,
  54925. hArr: 8660,
  54926. forall: 8704,
  54927. part: 8706,
  54928. exist: 8707,
  54929. empty: 8709,
  54930. nabla: 8711,
  54931. isin: 8712,
  54932. notin: 8713,
  54933. ni: 8715,
  54934. prod: 8719,
  54935. sum: 8721,
  54936. minus: 8722,
  54937. lowast: 8727,
  54938. radic: 8730,
  54939. prop: 8733,
  54940. infin: 8734,
  54941. ang: 8736,
  54942. and: 8743,
  54943. or: 8744,
  54944. cap: 8745,
  54945. cup: 8746,
  54946. int: 8747,
  54947. there4: 8756,
  54948. sim: 8764,
  54949. cong: 8773,
  54950. asymp: 8776,
  54951. ne: 8800,
  54952. equiv: 8801,
  54953. le: 8804,
  54954. ge: 8805,
  54955. sub: 8834,
  54956. sup: 8835,
  54957. nsub: 8836,
  54958. sube: 8838,
  54959. supe: 8839,
  54960. oplus: 8853,
  54961. otimes: 8855,
  54962. perp: 8869,
  54963. sdot: 8901,
  54964. lceil: 8968,
  54965. rceil: 8969,
  54966. lfloor: 8970,
  54967. rfloor: 8971,
  54968. lang: 9001,
  54969. rang: 9002,
  54970. loz: 9674,
  54971. spades: 9824,
  54972. clubs: 9827,
  54973. hearts: 9829,
  54974. diams: 9830
  54975. };
  54976. var PathArguments = {
  54977. A: 7,
  54978. a: 7,
  54979. C: 6,
  54980. c: 6,
  54981. H: 1,
  54982. h: 1,
  54983. L: 2,
  54984. l: 2,
  54985. M: 2,
  54986. m: 2,
  54987. Q: 4,
  54988. q: 4,
  54989. S: 4,
  54990. s: 4,
  54991. T: 2,
  54992. t: 2,
  54993. V: 1,
  54994. v: 1,
  54995. Z: 0,
  54996. z: 0
  54997. };
  54998. var PathFlags = {
  54999. A3: true,
  55000. A4: true,
  55001. a3: true,
  55002. a4: true
  55003. };
  55004. var Properties = {
  55005. 'color': {
  55006. inherit: true,
  55007. initial: undefined
  55008. },
  55009. 'visibility': {
  55010. inherit: true,
  55011. initial: 'visible',
  55012. values: {
  55013. 'hidden': 'hidden',
  55014. 'collapse': 'hidden',
  55015. 'visible': 'visible'
  55016. }
  55017. },
  55018. 'fill': {
  55019. inherit: true,
  55020. initial: DefaultColors.black
  55021. },
  55022. 'stroke': {
  55023. inherit: true,
  55024. initial: 'none'
  55025. },
  55026. 'stop-color': {
  55027. inherit: false,
  55028. initial: DefaultColors.black
  55029. },
  55030. 'fill-opacity': {
  55031. inherit: true,
  55032. initial: 1
  55033. },
  55034. 'stroke-opacity': {
  55035. inherit: true,
  55036. initial: 1
  55037. },
  55038. 'stop-opacity': {
  55039. inherit: false,
  55040. initial: 1
  55041. },
  55042. 'fill-rule': {
  55043. inherit: true,
  55044. initial: 'nonzero',
  55045. values: {
  55046. 'nonzero': 'nonzero',
  55047. 'evenodd': 'evenodd'
  55048. }
  55049. },
  55050. 'clip-rule': {
  55051. inherit: true,
  55052. initial: 'nonzero',
  55053. values: {
  55054. 'nonzero': 'nonzero',
  55055. 'evenodd': 'evenodd'
  55056. }
  55057. },
  55058. 'stroke-width': {
  55059. inherit: true,
  55060. initial: 1
  55061. },
  55062. 'stroke-dasharray': {
  55063. inherit: true,
  55064. initial: []
  55065. },
  55066. 'stroke-dashoffset': {
  55067. inherit: true,
  55068. initial: 0
  55069. },
  55070. 'stroke-miterlimit': {
  55071. inherit: true,
  55072. initial: 4
  55073. },
  55074. 'stroke-linejoin': {
  55075. inherit: true,
  55076. initial: 'miter',
  55077. values: {
  55078. 'miter': 'miter',
  55079. 'round': 'round',
  55080. 'bevel': 'bevel'
  55081. }
  55082. },
  55083. 'stroke-linecap': {
  55084. inherit: true,
  55085. initial: 'butt',
  55086. values: {
  55087. 'butt': 'butt',
  55088. 'round': 'round',
  55089. 'square': 'square'
  55090. }
  55091. },
  55092. 'font-size': {
  55093. inherit: true,
  55094. initial: 16,
  55095. values: {
  55096. 'xx-small': 9,
  55097. 'x-small': 10,
  55098. 'small': 13,
  55099. 'medium': 16,
  55100. 'large': 18,
  55101. 'x-large': 24,
  55102. 'xx-large': 32
  55103. }
  55104. },
  55105. 'font-family': {
  55106. inherit: true,
  55107. initial: 'sans-serif'
  55108. },
  55109. 'font-weight': {
  55110. inherit: true,
  55111. initial: 'normal',
  55112. values: {
  55113. '600': 'bold',
  55114. '700': 'bold',
  55115. '800': 'bold',
  55116. '900': 'bold',
  55117. 'bold': 'bold',
  55118. 'bolder': 'bold',
  55119. '500': 'normal',
  55120. '400': 'normal',
  55121. '300': 'normal',
  55122. '200': 'normal',
  55123. '100': 'normal',
  55124. 'normal': 'normal',
  55125. 'lighter': 'normal'
  55126. }
  55127. },
  55128. 'font-style': {
  55129. inherit: true,
  55130. initial: 'normal',
  55131. values: {
  55132. 'italic': 'italic',
  55133. 'oblique': 'italic',
  55134. 'normal': 'normal'
  55135. }
  55136. },
  55137. 'text-anchor': {
  55138. inherit: true,
  55139. initial: 'start',
  55140. values: {
  55141. 'start': 'start',
  55142. 'middle': 'middle',
  55143. 'end': 'end'
  55144. }
  55145. },
  55146. 'direction': {
  55147. inherit: true,
  55148. initial: 'ltr',
  55149. values: {
  55150. 'ltr': 'ltr',
  55151. 'rtl': 'rtl'
  55152. }
  55153. },
  55154. 'dominant-baseline': {
  55155. inherit: true,
  55156. initial: 'baseline',
  55157. values: {
  55158. 'auto': 'baseline',
  55159. 'baseline': 'baseline',
  55160. 'before-edge': 'before-edge',
  55161. 'text-before-edge': 'before-edge',
  55162. 'middle': 'middle',
  55163. 'central': 'central',
  55164. 'after-edge': 'after-edge',
  55165. 'text-after-edge': 'after-edge',
  55166. 'ideographic': 'ideographic',
  55167. 'alphabetic': 'alphabetic',
  55168. 'hanging': 'hanging',
  55169. 'mathematical': 'mathematical'
  55170. }
  55171. },
  55172. 'alignment-baseline': {
  55173. inherit: false,
  55174. initial: undefined,
  55175. values: {
  55176. 'auto': 'baseline',
  55177. 'baseline': 'baseline',
  55178. 'before-edge': 'before-edge',
  55179. 'text-before-edge': 'before-edge',
  55180. 'middle': 'middle',
  55181. 'central': 'central',
  55182. 'after-edge': 'after-edge',
  55183. 'text-after-edge': 'after-edge',
  55184. 'ideographic': 'ideographic',
  55185. 'alphabetic': 'alphabetic',
  55186. 'hanging': 'hanging',
  55187. 'mathematical': 'mathematical'
  55188. }
  55189. },
  55190. 'baseline-shift': {
  55191. inherit: true,
  55192. initial: 'baseline',
  55193. values: {
  55194. 'baseline': 'baseline',
  55195. 'sub': 'sub',
  55196. 'super': 'super'
  55197. }
  55198. },
  55199. 'word-spacing': {
  55200. inherit: true,
  55201. initial: 0,
  55202. values: {
  55203. normal: 0
  55204. }
  55205. },
  55206. 'letter-spacing': {
  55207. inherit: true,
  55208. initial: 0,
  55209. values: {
  55210. normal: 0
  55211. }
  55212. },
  55213. 'text-decoration': {
  55214. inherit: false,
  55215. initial: 'none',
  55216. values: {
  55217. 'none': 'none',
  55218. 'underline': 'underline',
  55219. 'overline': 'overline',
  55220. 'line-through': 'line-through'
  55221. }
  55222. },
  55223. 'xml:space': {
  55224. inherit: true,
  55225. initial: 'default',
  55226. css: 'white-space',
  55227. values: {
  55228. 'preserve': 'preserve',
  55229. 'default': 'default',
  55230. 'pre': 'preserve',
  55231. 'pre-line': 'preserve',
  55232. 'pre-wrap': 'preserve',
  55233. 'nowrap': 'default'
  55234. }
  55235. },
  55236. 'marker-start': {
  55237. inherit: true,
  55238. initial: 'none'
  55239. },
  55240. 'marker-mid': {
  55241. inherit: true,
  55242. initial: 'none'
  55243. },
  55244. 'marker-end': {
  55245. inherit: true,
  55246. initial: 'none'
  55247. },
  55248. 'opacity': {
  55249. inherit: false,
  55250. initial: 1
  55251. },
  55252. 'transform': {
  55253. inherit: false,
  55254. initial: [1, 0, 0, 1, 0, 0]
  55255. },
  55256. 'display': {
  55257. inherit: false,
  55258. initial: 'inline',
  55259. values: {
  55260. 'none': 'none',
  55261. 'inline': 'inline',
  55262. 'block': 'inline'
  55263. }
  55264. },
  55265. 'clip-path': {
  55266. inherit: false,
  55267. initial: 'none'
  55268. },
  55269. 'mask': {
  55270. inherit: false,
  55271. initial: 'none'
  55272. },
  55273. 'overflow': {
  55274. inherit: false,
  55275. initial: 'hidden',
  55276. values: {
  55277. 'hidden': 'hidden',
  55278. 'scroll': 'hidden',
  55279. 'visible': 'visible'
  55280. }
  55281. }
  55282. };
  55283. function docBeginGroup(bbox) {
  55284. var group = new function PDFGroup() {}();
  55285. group.name = 'G' + (doc._groupCount = (doc._groupCount || 0) + 1);
  55286. group.resources = doc.ref();
  55287. group.xobj = doc.ref({
  55288. Type: 'XObject',
  55289. Subtype: 'Form',
  55290. FormType: 1,
  55291. BBox: bbox,
  55292. Group: {
  55293. S: 'Transparency',
  55294. CS: 'DeviceRGB',
  55295. I: true,
  55296. K: false
  55297. },
  55298. Resources: group.resources
  55299. });
  55300. group.xobj.write('');
  55301. group.savedMatrix = doc._ctm;
  55302. group.savedPage = doc.page;
  55303. groupStack.push(group);
  55304. doc._ctm = [1, 0, 0, 1, 0, 0];
  55305. doc.page = {
  55306. width: doc.page.width,
  55307. height: doc.page.height,
  55308. write: function write(data) {
  55309. group.xobj.write(data);
  55310. },
  55311. fonts: {},
  55312. xobjects: {},
  55313. ext_gstates: {},
  55314. patterns: {}
  55315. };
  55316. return group;
  55317. }
  55318. function docEndGroup(group) {
  55319. if (group !== groupStack.pop()) {
  55320. throw 'Group not matching';
  55321. }
  55322. if (Object.keys(doc.page.fonts).length) {
  55323. group.resources.data.Font = doc.page.fonts;
  55324. }
  55325. if (Object.keys(doc.page.xobjects).length) {
  55326. group.resources.data.XObject = doc.page.xobjects;
  55327. }
  55328. if (Object.keys(doc.page.ext_gstates).length) {
  55329. group.resources.data.ExtGState = doc.page.ext_gstates;
  55330. }
  55331. if (Object.keys(doc.page.patterns).length) {
  55332. group.resources.data.Pattern = doc.page.patterns;
  55333. }
  55334. group.resources.end();
  55335. group.xobj.end();
  55336. doc._ctm = group.savedMatrix;
  55337. doc.page = group.savedPage;
  55338. }
  55339. function docInsertGroup(group) {
  55340. doc.page.xobjects[group.name] = group.xobj;
  55341. doc.addContent('/' + group.name + ' Do');
  55342. }
  55343. function docApplyMask(group, clip) {
  55344. var name = 'M' + (doc._maskCount = (doc._maskCount || 0) + 1);
  55345. var gstate = doc.ref({
  55346. Type: 'ExtGState',
  55347. CA: 1,
  55348. ca: 1,
  55349. BM: 'Normal',
  55350. SMask: {
  55351. S: 'Luminosity',
  55352. G: group.xobj,
  55353. BC: clip ? [0, 0, 0] : [1, 1, 1]
  55354. }
  55355. });
  55356. gstate.end();
  55357. doc.page.ext_gstates[name] = gstate;
  55358. doc.addContent('/' + name + ' gs');
  55359. }
  55360. function docCreatePattern(group, dx, dy, matrix) {
  55361. var pattern = new function PDFPattern() {}();
  55362. pattern.group = group;
  55363. pattern.dx = dx;
  55364. pattern.dy = dy;
  55365. pattern.matrix = matrix || [1, 0, 0, 1, 0, 0];
  55366. return pattern;
  55367. }
  55368. function docUsePattern(pattern, stroke) {
  55369. var name = 'P' + (doc._patternCount = (doc._patternCount || 0) + 1);
  55370. var ref = doc.ref({
  55371. Type: 'Pattern',
  55372. PatternType: 1,
  55373. PaintType: 1,
  55374. TilingType: 2,
  55375. BBox: [0, 0, pattern.dx, pattern.dy],
  55376. XStep: pattern.dx,
  55377. YStep: pattern.dy,
  55378. Matrix: multiplyMatrix(doc._ctm, pattern.matrix),
  55379. Resources: {
  55380. ProcSet: ['PDF', 'Text', 'ImageB', 'ImageC', 'ImageI'],
  55381. XObject: function () {
  55382. var temp = {};
  55383. temp[pattern.group.name] = pattern.group.xobj;
  55384. return temp;
  55385. }()
  55386. }
  55387. });
  55388. ref.write('/' + pattern.group.name + ' Do');
  55389. ref.end();
  55390. doc.page.patterns[name] = ref;
  55391. if (stroke) {
  55392. doc.addContent('/Pattern CS');
  55393. doc.addContent('/' + name + ' SCN');
  55394. } else {
  55395. doc.addContent('/Pattern cs');
  55396. doc.addContent('/' + name + ' scn');
  55397. }
  55398. }
  55399. function docBeginText(font, size) {
  55400. if (!doc.page.fonts[font.id]) {
  55401. doc.page.fonts[font.id] = font.ref();
  55402. }
  55403. doc.addContent('BT').addContent('/' + font.id + ' ' + size + ' Tf');
  55404. }
  55405. function docSetTextMatrix(a, b, c, d, e, f) {
  55406. doc.addContent(validateNumber(a) + ' ' + validateNumber(b) + ' ' + validateNumber(-c) + ' ' + validateNumber(-d) + ' ' + validateNumber(e) + ' ' + validateNumber(f) + ' Tm');
  55407. }
  55408. function docSetTextMode(fill, stroke) {
  55409. var mode = fill && stroke ? 2 : stroke ? 1 : fill ? 0 : 3;
  55410. doc.addContent(mode + ' Tr');
  55411. }
  55412. function docWriteGlyph(glyph) {
  55413. doc.addContent('<' + glyph + '> Tj');
  55414. }
  55415. function docEndText() {
  55416. doc.addContent('ET');
  55417. }
  55418. function docFillColor(color) {
  55419. if (color[0].constructor.name === 'PDFPattern') {
  55420. doc.fillOpacity(color[1]);
  55421. docUsePattern(color[0], false);
  55422. } else {
  55423. doc.fillColor(color[0], color[1]);
  55424. }
  55425. }
  55426. function docStrokeColor(color) {
  55427. if (color[0].constructor.name === 'PDFPattern') {
  55428. doc.strokeOpacity(color[1]);
  55429. docUsePattern(color[0], true);
  55430. } else {
  55431. doc.strokeColor(color[0], color[1]);
  55432. }
  55433. }
  55434. function docInsertLink(x, y, w, h, url) {
  55435. var ref = doc.ref({
  55436. Type: 'Annot',
  55437. Subtype: 'Link',
  55438. Rect: [x, y, w, h],
  55439. Border: [0, 0, 0],
  55440. A: {
  55441. S: 'URI',
  55442. URI: new String(url)
  55443. }
  55444. });
  55445. ref.end();
  55446. links.push(ref);
  55447. }
  55448. function parseXml(xml) {
  55449. var SvgNode = function SvgNode(tag, type, value, error) {
  55450. this.error = error;
  55451. this.nodeName = tag;
  55452. this.nodeValue = value;
  55453. this.nodeType = type;
  55454. this.attributes = Object.create(null);
  55455. this.childNodes = [];
  55456. this.parentNode = null;
  55457. this.id = '';
  55458. this.textContent = '';
  55459. this.classList = [];
  55460. };
  55461. SvgNode.prototype.getAttribute = function (attr) {
  55462. return this.attributes[attr] != null ? this.attributes[attr] : null;
  55463. };
  55464. SvgNode.prototype.getElementById = function (id) {
  55465. var result = null;
  55466. (function recursive(node) {
  55467. if (result) {
  55468. return;
  55469. }
  55470. if (node.nodeType === 1) {
  55471. if (node.id === id) {
  55472. result = node;
  55473. }
  55474. for (var i = 0; i < node.childNodes.length; i++) {
  55475. recursive(node.childNodes[i]);
  55476. }
  55477. }
  55478. })(this);
  55479. return result;
  55480. };
  55481. SvgNode.prototype.getElementsByTagName = function (tag) {
  55482. var result = [];
  55483. (function recursive(node) {
  55484. if (node.nodeType === 1) {
  55485. if (node.nodeName === tag) {
  55486. result.push(node);
  55487. }
  55488. for (var i = 0; i < node.childNodes.length; i++) {
  55489. recursive(node.childNodes[i]);
  55490. }
  55491. }
  55492. })(this);
  55493. return result;
  55494. };
  55495. var parser = new StringParser(xml.trim()),
  55496. result,
  55497. child,
  55498. error = false;
  55499. var recursive = function recursive() {
  55500. var temp, child;
  55501. if (temp = parser.match(/^<([\w:.-]+)\s*/, true)) {
  55502. // Opening tag
  55503. var node = new SvgNode(temp[1], 1, null, error);
  55504. while (temp = parser.match(/^([\w:.-]+)(?:\s*=\s*"([^"]*)"|\s*=\s*'([^']*)')?\s*/, true)) {
  55505. // Attribute
  55506. var attr = temp[1],
  55507. value = decodeEntities(temp[2] || temp[3] || '');
  55508. if (!node.attributes[attr]) {
  55509. node.attributes[attr] = value;
  55510. if (attr === 'id') {
  55511. node.id = value;
  55512. }
  55513. if (attr === 'class') {
  55514. node.classList = value.split(' ');
  55515. }
  55516. } else {
  55517. warningCallback('parseXml: duplicate attribute "' + attr + '"');
  55518. error = true;
  55519. }
  55520. }
  55521. if (parser.match(/^>/)) {
  55522. // End of opening tag
  55523. while (child = recursive()) {
  55524. node.childNodes.push(child);
  55525. child.parentNode = node;
  55526. node.textContent += child.nodeType === 3 || child.nodeType === 4 ? child.nodeValue : child.textContent;
  55527. }
  55528. if (temp = parser.match(/^<\/([\w:.-]+)\s*>/, true)) {
  55529. // Closing tag
  55530. if (temp[1] === node.nodeName) {
  55531. return node;
  55532. } else {
  55533. warningCallback('parseXml: tag not matching, opening "' + node.nodeName + '" & closing "' + temp[1] + '"');
  55534. error = true;
  55535. return node;
  55536. }
  55537. } else {
  55538. warningCallback('parseXml: tag not matching, opening "' + node.nodeName + '" & not closing');
  55539. error = true;
  55540. return node;
  55541. }
  55542. } else if (parser.match(/^\/>/)) {
  55543. // Self-closing tag
  55544. return node;
  55545. } else {
  55546. warningCallback('parseXml: tag could not be parsed "' + node.nodeName + '"');
  55547. error = true;
  55548. }
  55549. } else if (temp = parser.match(/^<!--[\s\S]*?-->/)) {
  55550. // Comment
  55551. return new SvgNode(null, 8, temp, error);
  55552. } else if (temp = parser.match(/^<\?[\s\S]*?\?>/)) {
  55553. // Processing instructions
  55554. return new SvgNode(null, 7, temp, error);
  55555. } else if (temp = parser.match(/^<!DOCTYPE\s*([\s\S]*?)>/)) {
  55556. // Doctype
  55557. return new SvgNode(null, 10, temp, error);
  55558. } else if (temp = parser.match(/^<!\[CDATA\[([\s\S]*?)\]\]>/, true)) {
  55559. // Cdata node
  55560. return new SvgNode('#cdata-section', 4, temp[1], error);
  55561. } else if (temp = parser.match(/^([^<]+)/, true)) {
  55562. // Text node
  55563. return new SvgNode('#text', 3, decodeEntities(temp[1]), error);
  55564. }
  55565. };
  55566. while (child = recursive()) {
  55567. if (child.nodeType === 1 && !result) {
  55568. result = child;
  55569. } else if (child.nodeType === 1 || child.nodeType === 3 && child.nodeValue.trim() !== '') {
  55570. warningCallback('parseXml: data after document end has been discarded');
  55571. }
  55572. }
  55573. if (parser.matchAll()) {
  55574. warningCallback('parseXml: parsing error');
  55575. }
  55576. return result;
  55577. }
  55578. ;
  55579. function decodeEntities(str) {
  55580. return str.replace(/&(?:#([0-9]+)|#[xX]([0-9A-Fa-f]+)|([0-9A-Za-z]+));/g, function (mt, m0, m1, m2) {
  55581. if (m0) {
  55582. return String.fromCharCode(parseInt(m0, 10));
  55583. } else if (m1) {
  55584. return String.fromCharCode(parseInt(m1, 16));
  55585. } else if (m2 && Entities[m2]) {
  55586. return String.fromCharCode(Entities[m2]);
  55587. } else {
  55588. return mt;
  55589. }
  55590. });
  55591. }
  55592. function parseColor(raw) {
  55593. var temp, result;
  55594. raw = (raw || '').trim();
  55595. if (temp = NamedColors[raw]) {
  55596. result = [temp.slice(), 1];
  55597. } else if (temp = raw.match(/^rgba\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9.]+)\s*\)$/i)) {
  55598. temp[1] = parseInt(temp[1]);
  55599. temp[2] = parseInt(temp[2]);
  55600. temp[3] = parseInt(temp[3]);
  55601. temp[4] = parseFloat(temp[4]);
  55602. if (temp[1] < 256 && temp[2] < 256 && temp[3] < 256 && temp[4] <= 1) {
  55603. result = [temp.slice(1, 4), temp[4]];
  55604. }
  55605. } else if (temp = raw.match(/^rgb\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)$/i)) {
  55606. temp[1] = parseInt(temp[1]);
  55607. temp[2] = parseInt(temp[2]);
  55608. temp[3] = parseInt(temp[3]);
  55609. if (temp[1] < 256 && temp[2] < 256 && temp[3] < 256) {
  55610. result = [temp.slice(1, 4), 1];
  55611. }
  55612. } else if (temp = raw.match(/^rgb\(\s*([0-9.]+)%\s*,\s*([0-9.]+)%\s*,\s*([0-9.]+)%\s*\)$/i)) {
  55613. temp[1] = 2.55 * parseFloat(temp[1]);
  55614. temp[2] = 2.55 * parseFloat(temp[2]);
  55615. temp[3] = 2.55 * parseFloat(temp[3]);
  55616. if (temp[1] < 256 && temp[2] < 256 && temp[3] < 256) {
  55617. result = [temp.slice(1, 4), 1];
  55618. }
  55619. } else if (temp = raw.match(/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i)) {
  55620. result = [[parseInt(temp[1], 16), parseInt(temp[2], 16), parseInt(temp[3], 16)], 1];
  55621. } else if (temp = raw.match(/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i)) {
  55622. result = [[0x11 * parseInt(temp[1], 16), 0x11 * parseInt(temp[2], 16), 0x11 * parseInt(temp[3], 16)], 1];
  55623. }
  55624. return colorCallback ? colorCallback(result, raw) : result;
  55625. }
  55626. function opacityToColor(color, opacity, isMask) {
  55627. var newColor = color[0].slice(),
  55628. newOpacity = color[1] * opacity;
  55629. if (isMask) {
  55630. for (var i = 0; i < color.length; i++) {
  55631. newColor[i] *= newOpacity;
  55632. }
  55633. return [newColor, 1];
  55634. } else {
  55635. return [newColor, newOpacity];
  55636. }
  55637. }
  55638. function multiplyMatrix() {
  55639. function multiply(a, b) {
  55640. return [a[0] * b[0] + a[2] * b[1], a[1] * b[0] + a[3] * b[1], a[0] * b[2] + a[2] * b[3], a[1] * b[2] + a[3] * b[3], a[0] * b[4] + a[2] * b[5] + a[4], a[1] * b[4] + a[3] * b[5] + a[5]];
  55641. }
  55642. var result = arguments[0];
  55643. for (var i = 1; i < arguments.length; i++) {
  55644. result = multiply(result, arguments[i]);
  55645. }
  55646. return result;
  55647. }
  55648. function transformPoint(p, m) {
  55649. return [m[0] * p[0] + m[2] * p[1] + m[4], m[1] * p[0] + m[3] * p[1] + m[5]];
  55650. }
  55651. function getGlobalMatrix() {
  55652. var ctm = doc._ctm;
  55653. for (var i = groupStack.length - 1; i >= 0; i--) {
  55654. ctm = multiplyMatrix(groupStack[i].savedMatrix, ctm);
  55655. }
  55656. return ctm;
  55657. }
  55658. function getPageBBox() {
  55659. return new SvgShape().M(0, 0).L(doc.page.width, 0).L(doc.page.width, doc.page.height).L(0, doc.page.height).transform(inverseMatrix(getGlobalMatrix())).getBoundingBox();
  55660. }
  55661. function inverseMatrix(m) {
  55662. var dt = m[0] * m[3] - m[1] * m[2];
  55663. return [m[3] / dt, -m[1] / dt, -m[2] / dt, m[0] / dt, (m[2] * m[5] - m[3] * m[4]) / dt, (m[1] * m[4] - m[0] * m[5]) / dt];
  55664. }
  55665. function validateMatrix(m) {
  55666. var m0 = validateNumber(m[0]),
  55667. m1 = validateNumber(m[1]),
  55668. m2 = validateNumber(m[2]),
  55669. m3 = validateNumber(m[3]),
  55670. m4 = validateNumber(m[4]),
  55671. m5 = validateNumber(m[5]);
  55672. if (isNotEqual(m0 * m3 - m1 * m2, 0)) {
  55673. return [m0, m1, m2, m3, m4, m5];
  55674. }
  55675. }
  55676. function solveEquation(curve) {
  55677. var a = curve[2] || 0,
  55678. b = curve[1] || 0,
  55679. c = curve[0] || 0;
  55680. if (isEqual(a, 0) && isEqual(b, 0)) {
  55681. return [];
  55682. } else if (isEqual(a, 0)) {
  55683. return [-c / b];
  55684. } else {
  55685. var d = b * b - 4 * a * c;
  55686. if (isNotEqual(d, 0) && d > 0) {
  55687. return [(-b + Math.sqrt(d)) / (2 * a), (-b - Math.sqrt(d)) / (2 * a)];
  55688. } else if (isEqual(d, 0)) {
  55689. return [-b / (2 * a)];
  55690. } else {
  55691. return [];
  55692. }
  55693. }
  55694. }
  55695. function getCurveValue(t, curve) {
  55696. return (curve[0] || 0) + (curve[1] || 0) * t + (curve[2] || 0) * t * t + (curve[3] || 0) * t * t * t;
  55697. }
  55698. function isEqual(number, ref) {
  55699. return Math.abs(number - ref) < 1e-10;
  55700. }
  55701. function isNotEqual(number, ref) {
  55702. return Math.abs(number - ref) >= 1e-10;
  55703. }
  55704. function validateNumber(n) {
  55705. return n > -1e21 && n < 1e21 ? Math.round(n * 1e6) / 1e6 : 0;
  55706. }
  55707. function isArrayLike(v) {
  55708. return typeof v === 'object' && v !== null && typeof v.length === 'number';
  55709. }
  55710. function parseTranform(v) {
  55711. var parser = new StringParser((v || '').trim()),
  55712. result = [1, 0, 0, 1, 0, 0],
  55713. temp;
  55714. while (temp = parser.match(/^([A-Za-z]+)\s*[(]([^(]+)[)]/, true)) {
  55715. var func = temp[1],
  55716. nums = [],
  55717. parser2 = new StringParser(temp[2].trim()),
  55718. temp2 = void 0;
  55719. while (temp2 = parser2.matchNumber()) {
  55720. nums.push(Number(temp2));
  55721. parser2.matchSeparator();
  55722. }
  55723. if (func === 'matrix' && nums.length === 6) {
  55724. result = multiplyMatrix(result, [nums[0], nums[1], nums[2], nums[3], nums[4], nums[5]]);
  55725. } else if (func === 'translate' && nums.length === 2) {
  55726. result = multiplyMatrix(result, [1, 0, 0, 1, nums[0], nums[1]]);
  55727. } else if (func === 'translate' && nums.length === 1) {
  55728. result = multiplyMatrix(result, [1, 0, 0, 1, nums[0], 0]);
  55729. } else if (func === 'scale' && nums.length === 2) {
  55730. result = multiplyMatrix(result, [nums[0], 0, 0, nums[1], 0, 0]);
  55731. } else if (func === 'scale' && nums.length === 1) {
  55732. result = multiplyMatrix(result, [nums[0], 0, 0, nums[0], 0, 0]);
  55733. } else if (func === 'rotate' && nums.length === 3) {
  55734. var a = nums[0] * Math.PI / 180;
  55735. result = multiplyMatrix(result, [1, 0, 0, 1, nums[1], nums[2]], [Math.cos(a), Math.sin(a), -Math.sin(a), Math.cos(a), 0, 0], [1, 0, 0, 1, -nums[1], -nums[2]]);
  55736. } else if (func === 'rotate' && nums.length === 1) {
  55737. var _a = nums[0] * Math.PI / 180;
  55738. result = multiplyMatrix(result, [Math.cos(_a), Math.sin(_a), -Math.sin(_a), Math.cos(_a), 0, 0]);
  55739. } else if (func === 'skewX' && nums.length === 1) {
  55740. var _a2 = nums[0] * Math.PI / 180;
  55741. result = multiplyMatrix(result, [1, 0, Math.tan(_a2), 1, 0, 0]);
  55742. } else if (func === 'skewY' && nums.length === 1) {
  55743. var _a3 = nums[0] * Math.PI / 180;
  55744. result = multiplyMatrix(result, [1, Math.tan(_a3), 0, 1, 0, 0]);
  55745. } else {
  55746. return;
  55747. }
  55748. parser.matchSeparator();
  55749. }
  55750. if (parser.matchAll()) {
  55751. return;
  55752. }
  55753. return result;
  55754. }
  55755. function parseAspectRatio(aspectRatio, availWidth, availHeight, elemWidth, elemHeight, initAlign) {
  55756. var temp = (aspectRatio || '').trim().match(/^(none)$|^x(Min|Mid|Max)Y(Min|Mid|Max)(?:\s+(meet|slice))?$/) || [],
  55757. ratioType = temp[1] || temp[4] || 'meet',
  55758. xAlign = temp[2] || 'Mid',
  55759. yAlign = temp[3] || 'Mid',
  55760. scaleX = availWidth / elemWidth,
  55761. scaleY = availHeight / elemHeight,
  55762. dx = {
  55763. 'Min': 0,
  55764. 'Mid': 0.5,
  55765. 'Max': 1
  55766. }[xAlign] - (initAlign || 0),
  55767. dy = {
  55768. 'Min': 0,
  55769. 'Mid': 0.5,
  55770. 'Max': 1
  55771. }[yAlign] - (initAlign || 0);
  55772. if (ratioType === 'slice') {
  55773. scaleY = scaleX = Math.max(scaleX, scaleY);
  55774. } else if (ratioType === 'meet') {
  55775. scaleY = scaleX = Math.min(scaleX, scaleY);
  55776. }
  55777. return [scaleX, 0, 0, scaleY, dx * (availWidth - elemWidth * scaleX), dy * (availHeight - elemHeight * scaleY)];
  55778. }
  55779. function parseStyleAttr(v) {
  55780. var result = Object.create(null);
  55781. v = (v || '').trim().split(/;/);
  55782. for (var i = 0; i < v.length; i++) {
  55783. var key = (v[i].split(':')[0] || '').trim(),
  55784. value = (v[i].split(':')[1] || '').trim();
  55785. if (key) {
  55786. result[key] = value;
  55787. }
  55788. }
  55789. if (result['marker']) {
  55790. if (!result['marker-start']) {
  55791. result['marker-start'] = result['marker'];
  55792. }
  55793. if (!result['marker-mid']) {
  55794. result['marker-mid'] = result['marker'];
  55795. }
  55796. if (!result['marker-end']) {
  55797. result['marker-end'] = result['marker'];
  55798. }
  55799. }
  55800. if (result['font']) {
  55801. var fontFamily = null,
  55802. fontSize = null,
  55803. fontStyle = "normal",
  55804. fontWeight = "normal",
  55805. fontVariant = "normal";
  55806. var parts = result['font'].split(/\s+/);
  55807. for (var _i = 0; _i < parts.length; _i++) {
  55808. switch (parts[_i]) {
  55809. case "normal":
  55810. break;
  55811. case "italic":
  55812. case "oblique":
  55813. fontStyle = parts[_i];
  55814. break;
  55815. case "small-caps":
  55816. fontVariant = parts[_i];
  55817. break;
  55818. case "bold":
  55819. case "bolder":
  55820. case "lighter":
  55821. case "100":
  55822. case "200":
  55823. case "300":
  55824. case "400":
  55825. case "500":
  55826. case "600":
  55827. case "700":
  55828. case "800":
  55829. case "900":
  55830. fontWeight = parts[_i];
  55831. break;
  55832. default:
  55833. if (!fontSize) {
  55834. fontSize = parts[_i].split('/')[0];
  55835. } else {
  55836. if (!fontFamily) {
  55837. fontFamily = parts[_i];
  55838. } else {
  55839. fontFamily += ' ' + parts[_i];
  55840. }
  55841. }
  55842. break;
  55843. }
  55844. }
  55845. if (!result['font-style']) {
  55846. result['font-style'] = fontStyle;
  55847. }
  55848. if (!result['font-variant']) {
  55849. result['font-variant'] = fontVariant;
  55850. }
  55851. if (!result['font-weight']) {
  55852. result['font-weight'] = fontWeight;
  55853. }
  55854. if (!result['font-size']) {
  55855. result['font-size'] = fontSize;
  55856. }
  55857. if (!result['font-family']) {
  55858. result['font-family'] = fontFamily;
  55859. }
  55860. }
  55861. return result;
  55862. }
  55863. function parseSelector(v) {
  55864. var parts = v.split(/(?=[.#])/g),
  55865. ids = [],
  55866. classes = [],
  55867. tags = [],
  55868. temp;
  55869. for (var i = 0; i < parts.length; i++) {
  55870. if (temp = parts[i].match(/^[#]([_A-Za-z0-9-]+)$/)) {
  55871. ids.push(temp[1]);
  55872. } else if (temp = parts[i].match(/^[.]([_A-Za-z0-9-]+)$/)) {
  55873. classes.push(temp[1]);
  55874. } else if (temp = parts[i].match(/^([_A-Za-z0-9-]+)$/)) {
  55875. tags.push(temp[1]);
  55876. } else if (parts[i] !== '*') {
  55877. return;
  55878. }
  55879. }
  55880. return {
  55881. tags: tags,
  55882. ids: ids,
  55883. classes: classes,
  55884. specificity: ids.length * 10000 + classes.length * 100 + tags.length
  55885. };
  55886. }
  55887. function parseStyleSheet(v) {
  55888. var parser = new StringParser(v.trim()),
  55889. rules = [],
  55890. rule;
  55891. while (rule = parser.match(/^\s*([^\{\}]*?)\s*\{([^\{\}]*?)\}/, true)) {
  55892. var selectors = rule[1].split(/\s*,\s*/g),
  55893. css = parseStyleAttr(rule[2]);
  55894. for (var i = 0; i < selectors.length; i++) {
  55895. var selector = parseSelector(selectors[i]);
  55896. if (selector) {
  55897. rules.push({
  55898. selector: selector,
  55899. css: css
  55900. });
  55901. }
  55902. }
  55903. }
  55904. return rules;
  55905. }
  55906. function matchesSelector(elem, selector) {
  55907. if (elem.nodeType !== 1) {
  55908. return false;
  55909. }
  55910. for (var i = 0; i < selector.tags.length; i++) {
  55911. if (selector.tags[i] !== elem.nodeName) {
  55912. return false;
  55913. }
  55914. }
  55915. for (var _i2 = 0; _i2 < selector.ids.length; _i2++) {
  55916. if (selector.ids[_i2] !== elem.id) {
  55917. return false;
  55918. }
  55919. }
  55920. for (var _i3 = 0; _i3 < selector.classes.length; _i3++) {
  55921. if (elem.classList.indexOf(selector.classes[_i3]) === -1) {
  55922. return false;
  55923. }
  55924. }
  55925. return true;
  55926. }
  55927. function getStyle(elem) {
  55928. var result = Object.create(null);
  55929. var specificities = Object.create(null);
  55930. for (var i = 0; i < styleRules.length; i++) {
  55931. var rule = styleRules[i];
  55932. if (matchesSelector(elem, rule.selector)) {
  55933. for (var key in rule.css) {
  55934. if (!(specificities[key] > rule.selector.specificity)) {
  55935. result[key] = rule.css[key];
  55936. specificities[key] = rule.selector.specificity;
  55937. }
  55938. }
  55939. }
  55940. }
  55941. return result;
  55942. }
  55943. function combineArrays(array1, array2) {
  55944. return array1.concat(array2.slice(array1.length));
  55945. }
  55946. function getAscent(font, size) {
  55947. return Math.max(font.ascender, (font.bbox[3] || font.bbox.maxY) * (font.scale || 1)) * size / 1000;
  55948. }
  55949. function getDescent(font, size) {
  55950. return Math.min(font.descender, (font.bbox[1] || font.bbox.minY) * (font.scale || 1)) * size / 1000;
  55951. }
  55952. function getXHeight(font, size) {
  55953. return (font.xHeight || 0.5 * (font.ascender - font.descender)) * size / 1000;
  55954. }
  55955. function getBaseline(font, size, baseline, shift) {
  55956. var dy1, dy2;
  55957. switch (baseline) {
  55958. case 'middle':
  55959. dy1 = 0.5 * getXHeight(font, size);
  55960. break;
  55961. case 'central':
  55962. dy1 = 0.5 * (getDescent(font, size) + getAscent(font, size));
  55963. break;
  55964. case 'after-edge':
  55965. case 'text-after-edge':
  55966. dy1 = getDescent(font, size);
  55967. break;
  55968. case 'alphabetic':
  55969. case 'auto':
  55970. case 'baseline':
  55971. dy1 = 0;
  55972. break;
  55973. case 'mathematical':
  55974. dy1 = 0.5 * getAscent(font, size);
  55975. break;
  55976. case 'hanging':
  55977. dy1 = 0.8 * getAscent(font, size);
  55978. break;
  55979. case 'before-edge':
  55980. case 'text-before-edge':
  55981. dy1 = getAscent(font, size);
  55982. break;
  55983. default:
  55984. dy1 = 0;
  55985. break;
  55986. }
  55987. switch (shift) {
  55988. case 'baseline':
  55989. dy2 = 0;
  55990. break;
  55991. case 'super':
  55992. dy2 = 0.6 * size;
  55993. break;
  55994. case 'sub':
  55995. dy2 = -0.6 * size;
  55996. break;
  55997. default:
  55998. dy2 = shift;
  55999. break;
  56000. }
  56001. return dy1 - dy2;
  56002. }
  56003. function getTextPos(font, size, text) {
  56004. var encoded = font.encode('' + text),
  56005. hex = encoded[0],
  56006. pos = encoded[1],
  56007. data = [];
  56008. for (var i = 0; i < hex.length; i++) {
  56009. var unicode = font.unicode ? font.unicode[parseInt(hex[i], 16)] : [text.charCodeAt(i)];
  56010. data.push({
  56011. glyph: hex[i],
  56012. unicode: unicode,
  56013. width: pos[i].advanceWidth * size / 1000,
  56014. xOffset: pos[i].xOffset * size / 1000,
  56015. yOffset: pos[i].yOffset * size / 1000,
  56016. xAdvance: pos[i].xAdvance * size / 1000,
  56017. yAdvance: pos[i].yAdvance * size / 1000
  56018. });
  56019. }
  56020. return data;
  56021. }
  56022. function createSVGElement(obj, inherits) {
  56023. switch (obj.nodeName) {
  56024. case 'use':
  56025. return new SvgElemUse(obj, inherits);
  56026. case 'symbol':
  56027. return new SvgElemSymbol(obj, inherits);
  56028. case 'g':
  56029. return new SvgElemGroup(obj, inherits);
  56030. case 'a':
  56031. return new SvgElemLink(obj, inherits);
  56032. case 'svg':
  56033. return new SvgElemSvg(obj, inherits);
  56034. case 'image':
  56035. return new SVGElemImage(obj, inherits);
  56036. case 'rect':
  56037. return new SvgElemRect(obj, inherits);
  56038. case 'circle':
  56039. return new SvgElemCircle(obj, inherits);
  56040. case 'ellipse':
  56041. return new SvgElemEllipse(obj, inherits);
  56042. case 'line':
  56043. return new SvgElemLine(obj, inherits);
  56044. case 'polyline':
  56045. return new SvgElemPolyline(obj, inherits);
  56046. case 'polygon':
  56047. return new SvgElemPolygon(obj, inherits);
  56048. case 'path':
  56049. return new SvgElemPath(obj, inherits);
  56050. case 'text':
  56051. return new SvgElemText(obj, inherits);
  56052. case 'tspan':
  56053. return new SvgElemTspan(obj, inherits);
  56054. case 'textPath':
  56055. return new SvgElemTextPath(obj, inherits);
  56056. case '#text':
  56057. case '#cdata-section':
  56058. return new SvgElemTextNode(obj, inherits);
  56059. default:
  56060. return new SvgElem(obj, inherits);
  56061. }
  56062. }
  56063. var StringParser = function StringParser(str) {
  56064. this.match = function (exp, all) {
  56065. var temp = str.match(exp);
  56066. if (!temp || temp.index !== 0) {
  56067. return;
  56068. }
  56069. str = str.substring(temp[0].length);
  56070. return all ? temp : temp[0];
  56071. };
  56072. this.matchSeparator = function () {
  56073. return this.match(/^(?:\s*,\s*|\s*|)/);
  56074. };
  56075. this.matchSpace = function () {
  56076. return this.match(/^(?:\s*)/);
  56077. };
  56078. this.matchLengthUnit = function () {
  56079. return this.match(/^(?:px|pt|cm|mm|in|pc|em|ex|%|)/);
  56080. };
  56081. this.matchNumber = function () {
  56082. return this.match(/^(?:[-+]?(?:[0-9]+[.][0-9]+|[0-9]+[.]|[.][0-9]+|[0-9]+)(?:[eE][-+]?[0-9]+)?)/);
  56083. };
  56084. this.matchAll = function () {
  56085. return this.match(/^[\s\S]+/);
  56086. };
  56087. };
  56088. var BezierSegment = function BezierSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y) {
  56089. var divisions = 6 * precision;
  56090. var equationX = [p1x, -3 * p1x + 3 * c1x, 3 * p1x - 6 * c1x + 3 * c2x, -p1x + 3 * c1x - 3 * c2x + p2x];
  56091. var equationY = [p1y, -3 * p1y + 3 * c1y, 3 * p1y - 6 * c1y + 3 * c2y, -p1y + 3 * c1y - 3 * c2y + p2y];
  56092. var derivativeX = [-3 * p1x + 3 * c1x, 6 * p1x - 12 * c1x + 6 * c2x, -3 * p1x + 9 * c1x - 9 * c2x + 3 * p2x];
  56093. var derivativeY = [-3 * p1y + 3 * c1y, 6 * p1y - 12 * c1y + 6 * c2y, -3 * p1y + 9 * c1y - 9 * c2y + 3 * p2y];
  56094. var lengthMap = [0];
  56095. for (var i = 1; i <= divisions; i++) {
  56096. var t = (i - 0.5) / divisions;
  56097. var dx = getCurveValue(t, derivativeX) / divisions,
  56098. dy = getCurveValue(t, derivativeY) / divisions,
  56099. l = Math.sqrt(dx * dx + dy * dy);
  56100. lengthMap[i] = lengthMap[i - 1] + l;
  56101. }
  56102. this.totalLength = lengthMap[divisions];
  56103. this.startPoint = [p1x, p1y, isEqual(p1x, c1x) && isEqual(p1y, c1y) ? Math.atan2(c2y - c1y, c2x - c1x) : Math.atan2(c1y - p1y, c1x - p1x)];
  56104. this.endPoint = [p2x, p2y, isEqual(c2x, p2x) && isEqual(c2y, p2y) ? Math.atan2(c2y - c1y, c2x - c1x) : Math.atan2(p2y - c2y, p2x - c2x)];
  56105. this.getBoundingBox = function () {
  56106. var temp;
  56107. var minX = getCurveValue(0, equationX),
  56108. minY = getCurveValue(0, equationY),
  56109. maxX = getCurveValue(1, equationX),
  56110. maxY = getCurveValue(1, equationY);
  56111. if (minX > maxX) {
  56112. temp = maxX;
  56113. maxX = minX;
  56114. minX = temp;
  56115. }
  56116. if (minY > maxY) {
  56117. temp = maxY;
  56118. maxY = minY;
  56119. minY = temp;
  56120. }
  56121. var rootsX = solveEquation(derivativeX);
  56122. for (var _i4 = 0; _i4 < rootsX.length; _i4++) {
  56123. if (rootsX[_i4] >= 0 && rootsX[_i4] <= 1) {
  56124. var _x = getCurveValue(rootsX[_i4], equationX);
  56125. if (_x < minX) {
  56126. minX = _x;
  56127. }
  56128. if (_x > maxX) {
  56129. maxX = _x;
  56130. }
  56131. }
  56132. }
  56133. var rootsY = solveEquation(derivativeY);
  56134. for (var _i5 = 0; _i5 < rootsY.length; _i5++) {
  56135. if (rootsY[_i5] >= 0 && rootsY[_i5] <= 1) {
  56136. var _y = getCurveValue(rootsY[_i5], equationY);
  56137. if (_y < minY) {
  56138. minY = _y;
  56139. }
  56140. if (_y > maxY) {
  56141. maxY = _y;
  56142. }
  56143. }
  56144. }
  56145. return [minX, minY, maxX, maxY];
  56146. };
  56147. this.getPointAtLength = function (l) {
  56148. if (isEqual(l, 0)) {
  56149. return this.startPoint;
  56150. }
  56151. if (isEqual(l, this.totalLength)) {
  56152. return this.endPoint;
  56153. }
  56154. if (l < 0 || l > this.totalLength) {
  56155. return;
  56156. }
  56157. for (var _i6 = 1; _i6 <= divisions; _i6++) {
  56158. var l1 = lengthMap[_i6 - 1],
  56159. l2 = lengthMap[_i6];
  56160. if (l1 <= l && l <= l2) {
  56161. var _t = (_i6 - (l2 - l) / (l2 - l1)) / divisions,
  56162. _x2 = getCurveValue(_t, equationX),
  56163. _y2 = getCurveValue(_t, equationY),
  56164. _dx = getCurveValue(_t, derivativeX),
  56165. _dy = getCurveValue(_t, derivativeY);
  56166. return [_x2, _y2, Math.atan2(_dy, _dx)];
  56167. }
  56168. }
  56169. };
  56170. };
  56171. var LineSegment = function LineSegment(p1x, p1y, p2x, p2y) {
  56172. this.totalLength = Math.sqrt((p2x - p1x) * (p2x - p1x) + (p2y - p1y) * (p2y - p1y));
  56173. this.startPoint = [p1x, p1y, Math.atan2(p2y - p1y, p2x - p1x)];
  56174. this.endPoint = [p2x, p2y, Math.atan2(p2y - p1y, p2x - p1x)];
  56175. this.getBoundingBox = function () {
  56176. return [Math.min(this.startPoint[0], this.endPoint[0]), Math.min(this.startPoint[1], this.endPoint[1]), Math.max(this.startPoint[0], this.endPoint[0]), Math.max(this.startPoint[1], this.endPoint[1])];
  56177. };
  56178. this.getPointAtLength = function (l) {
  56179. if (l >= 0 && l <= this.totalLength) {
  56180. var r = l / this.totalLength || 0,
  56181. _x3 = this.startPoint[0] + r * (this.endPoint[0] - this.startPoint[0]),
  56182. _y3 = this.startPoint[1] + r * (this.endPoint[1] - this.startPoint[1]);
  56183. return [_x3, _y3, this.startPoint[2]];
  56184. }
  56185. };
  56186. };
  56187. var SvgShape = function SvgShape() {
  56188. this.pathCommands = [];
  56189. this.pathSegments = [];
  56190. this.startPoint = null;
  56191. this.endPoint = null;
  56192. this.totalLength = 0;
  56193. var startX = 0,
  56194. startY = 0,
  56195. currX = 0,
  56196. currY = 0,
  56197. lastCom,
  56198. lastCtrlX,
  56199. lastCtrlY;
  56200. this.move = function (x, y) {
  56201. startX = currX = x;
  56202. startY = currY = y;
  56203. return null;
  56204. };
  56205. this.line = function (x, y) {
  56206. var segment = new LineSegment(currX, currY, x, y);
  56207. currX = x;
  56208. currY = y;
  56209. return segment;
  56210. };
  56211. this.curve = function (c1x, c1y, c2x, c2y, x, y) {
  56212. var segment = new BezierSegment(currX, currY, c1x, c1y, c2x, c2y, x, y);
  56213. currX = x;
  56214. currY = y;
  56215. return segment;
  56216. };
  56217. this.close = function () {
  56218. var segment = new LineSegment(currX, currY, startX, startY);
  56219. currX = startX;
  56220. currY = startY;
  56221. return segment;
  56222. };
  56223. this.addCommand = function (data) {
  56224. this.pathCommands.push(data);
  56225. var segment = this[data[0]].apply(this, data.slice(3));
  56226. if (segment) {
  56227. segment.hasStart = data[1];
  56228. segment.hasEnd = data[2];
  56229. this.startPoint = this.startPoint || segment.startPoint;
  56230. this.endPoint = segment.endPoint;
  56231. this.pathSegments.push(segment);
  56232. this.totalLength += segment.totalLength;
  56233. }
  56234. };
  56235. this.M = function (x, y) {
  56236. this.addCommand(['move', true, true, x, y]);
  56237. lastCom = 'M';
  56238. return this;
  56239. };
  56240. this.m = function (x, y) {
  56241. return this.M(currX + x, currY + y);
  56242. };
  56243. this.Z = this.z = function () {
  56244. this.addCommand(['close', true, true]);
  56245. lastCom = 'Z';
  56246. return this;
  56247. };
  56248. this.L = function (x, y) {
  56249. this.addCommand(['line', true, true, x, y]);
  56250. lastCom = 'L';
  56251. return this;
  56252. };
  56253. this.l = function (x, y) {
  56254. return this.L(currX + x, currY + y);
  56255. };
  56256. this.H = function (x) {
  56257. return this.L(x, currY);
  56258. };
  56259. this.h = function (x) {
  56260. return this.L(currX + x, currY);
  56261. };
  56262. this.V = function (y) {
  56263. return this.L(currX, y);
  56264. };
  56265. this.v = function (y) {
  56266. return this.L(currX, currY + y);
  56267. };
  56268. this.C = function (c1x, c1y, c2x, c2y, x, y) {
  56269. this.addCommand(['curve', true, true, c1x, c1y, c2x, c2y, x, y]);
  56270. lastCom = 'C';
  56271. lastCtrlX = c2x;
  56272. lastCtrlY = c2y;
  56273. return this;
  56274. };
  56275. this.c = function (c1x, c1y, c2x, c2y, x, y) {
  56276. return this.C(currX + c1x, currY + c1y, currX + c2x, currY + c2y, currX + x, currY + y);
  56277. };
  56278. this.S = function (c1x, c1y, x, y) {
  56279. return this.C(currX + (lastCom === 'C' ? currX - lastCtrlX : 0), currY + (lastCom === 'C' ? currY - lastCtrlY : 0), c1x, c1y, x, y);
  56280. };
  56281. this.s = function (c1x, c1y, x, y) {
  56282. return this.C(currX + (lastCom === 'C' ? currX - lastCtrlX : 0), currY + (lastCom === 'C' ? currY - lastCtrlY : 0), currX + c1x, currY + c1y, currX + x, currY + y);
  56283. };
  56284. this.Q = function (cx, cy, x, y) {
  56285. var c1x = currX + 2 / 3 * (cx - currX),
  56286. c1y = currY + 2 / 3 * (cy - currY),
  56287. c2x = x + 2 / 3 * (cx - x),
  56288. c2y = y + 2 / 3 * (cy - y);
  56289. this.addCommand(['curve', true, true, c1x, c1y, c2x, c2y, x, y]);
  56290. lastCom = 'Q';
  56291. lastCtrlX = cx;
  56292. lastCtrlY = cy;
  56293. return this;
  56294. };
  56295. this.q = function (c1x, c1y, x, y) {
  56296. return this.Q(currX + c1x, currY + c1y, currX + x, currY + y);
  56297. };
  56298. this.T = function (x, y) {
  56299. return this.Q(currX + (lastCom === 'Q' ? currX - lastCtrlX : 0), currY + (lastCom === 'Q' ? currY - lastCtrlY : 0), x, y);
  56300. };
  56301. this.t = function (x, y) {
  56302. return this.Q(currX + (lastCom === 'Q' ? currX - lastCtrlX : 0), currY + (lastCom === 'Q' ? currY - lastCtrlY : 0), currX + x, currY + y);
  56303. };
  56304. this.A = function (rx, ry, fi, fa, fs, x, y) {
  56305. if (isEqual(rx, 0) || isEqual(ry, 0)) {
  56306. this.addCommand(['line', true, true, x, y]);
  56307. } else {
  56308. fi = fi * (Math.PI / 180);
  56309. rx = Math.abs(rx);
  56310. ry = Math.abs(ry);
  56311. fa = 1 * !!fa;
  56312. fs = 1 * !!fs;
  56313. var x1 = Math.cos(fi) * (currX - x) / 2 + Math.sin(fi) * (currY - y) / 2,
  56314. y1 = Math.cos(fi) * (currY - y) / 2 - Math.sin(fi) * (currX - x) / 2,
  56315. lambda = x1 * x1 / (rx * rx) + y1 * y1 / (ry * ry);
  56316. if (lambda > 1) {
  56317. rx *= Math.sqrt(lambda);
  56318. ry *= Math.sqrt(lambda);
  56319. }
  56320. var r = Math.sqrt(Math.max(0, rx * rx * ry * ry - rx * rx * y1 * y1 - ry * ry * x1 * x1) / (rx * rx * y1 * y1 + ry * ry * x1 * x1)),
  56321. x2 = (fa === fs ? -1 : 1) * r * rx * y1 / ry,
  56322. y2 = (fa === fs ? 1 : -1) * r * ry * x1 / rx;
  56323. var cx = Math.cos(fi) * x2 - Math.sin(fi) * y2 + (currX + x) / 2,
  56324. cy = Math.sin(fi) * x2 + Math.cos(fi) * y2 + (currY + y) / 2,
  56325. th1 = Math.atan2((y1 - y2) / ry, (x1 - x2) / rx),
  56326. th2 = Math.atan2((-y1 - y2) / ry, (-x1 - x2) / rx);
  56327. if (fs === 0 && th2 - th1 > 0) {
  56328. th2 -= 2 * Math.PI;
  56329. } else if (fs === 1 && th2 - th1 < 0) {
  56330. th2 += 2 * Math.PI;
  56331. }
  56332. var segms = Math.ceil(Math.abs(th2 - th1) / (Math.PI / precision));
  56333. for (var i = 0; i < segms; i++) {
  56334. var th3 = th1 + i * (th2 - th1) / segms,
  56335. th4 = th1 + (i + 1) * (th2 - th1) / segms,
  56336. t = 4 / 3 * Math.tan((th4 - th3) / 4);
  56337. var c1x = cx + Math.cos(fi) * rx * (Math.cos(th3) - t * Math.sin(th3)) - Math.sin(fi) * ry * (Math.sin(th3) + t * Math.cos(th3)),
  56338. c1y = cy + Math.sin(fi) * rx * (Math.cos(th3) - t * Math.sin(th3)) + Math.cos(fi) * ry * (Math.sin(th3) + t * Math.cos(th3)),
  56339. c2x = cx + Math.cos(fi) * rx * (Math.cos(th4) + t * Math.sin(th4)) - Math.sin(fi) * ry * (Math.sin(th4) - t * Math.cos(th4)),
  56340. c2y = cy + Math.sin(fi) * rx * (Math.cos(th4) + t * Math.sin(th4)) + Math.cos(fi) * ry * (Math.sin(th4) - t * Math.cos(th4)),
  56341. endX = cx + Math.cos(fi) * rx * Math.cos(th4) - Math.sin(fi) * ry * Math.sin(th4),
  56342. endY = cy + Math.sin(fi) * rx * Math.cos(th4) + Math.cos(fi) * ry * Math.sin(th4);
  56343. this.addCommand(['curve', i === 0, i === segms - 1, c1x, c1y, c2x, c2y, endX, endY]);
  56344. }
  56345. }
  56346. lastCom = 'A';
  56347. return this;
  56348. };
  56349. this.a = function (rx, ry, fi, fa, fs, x, y) {
  56350. return this.A(rx, ry, fi, fa, fs, currX + x, currY + y);
  56351. };
  56352. this.path = function (d) {
  56353. var command,
  56354. value,
  56355. temp,
  56356. parser = new StringParser((d || '').trim());
  56357. while (command = parser.match(/^[astvzqmhlcASTVZQMHLC]/)) {
  56358. parser.matchSeparator();
  56359. var values = [];
  56360. while (value = PathFlags[command + values.length] ? parser.match(/^[01]/) : parser.matchNumber()) {
  56361. parser.matchSeparator();
  56362. if (values.length === PathArguments[command]) {
  56363. this[command].apply(this, values);
  56364. values = [];
  56365. if (command === 'M') {
  56366. command = 'L';
  56367. } else if (command === 'm') {
  56368. command = 'l';
  56369. }
  56370. }
  56371. values.push(Number(value));
  56372. }
  56373. if (values.length === PathArguments[command]) {
  56374. this[command].apply(this, values);
  56375. } else {
  56376. warningCallback('SvgPath: command ' + command + ' with ' + values.length + ' numbers');
  56377. return;
  56378. }
  56379. }
  56380. if (temp = parser.matchAll()) {
  56381. warningCallback('SvgPath: unexpected string ' + temp);
  56382. }
  56383. return this;
  56384. };
  56385. this.getBoundingBox = function () {
  56386. var bbox = [Infinity, Infinity, -Infinity, -Infinity];
  56387. function addBounds(bbox1) {
  56388. if (bbox1[0] < bbox[0]) {
  56389. bbox[0] = bbox1[0];
  56390. }
  56391. if (bbox1[2] > bbox[2]) {
  56392. bbox[2] = bbox1[2];
  56393. }
  56394. if (bbox1[1] < bbox[1]) {
  56395. bbox[1] = bbox1[1];
  56396. }
  56397. if (bbox1[3] > bbox[3]) {
  56398. bbox[3] = bbox1[3];
  56399. }
  56400. }
  56401. for (var i = 0; i < this.pathSegments.length; i++) {
  56402. addBounds(this.pathSegments[i].getBoundingBox());
  56403. }
  56404. if (bbox[0] === Infinity) {
  56405. bbox[0] = 0;
  56406. }
  56407. if (bbox[1] === Infinity) {
  56408. bbox[1] = 0;
  56409. }
  56410. if (bbox[2] === -Infinity) {
  56411. bbox[2] = 0;
  56412. }
  56413. if (bbox[3] === -Infinity) {
  56414. bbox[3] = 0;
  56415. }
  56416. return bbox;
  56417. };
  56418. this.getPointAtLength = function (l) {
  56419. if (l >= 0 && l <= this.totalLength) {
  56420. var temp;
  56421. for (var i = 0; i < this.pathSegments.length; i++) {
  56422. if (temp = this.pathSegments[i].getPointAtLength(l)) {
  56423. return temp;
  56424. }
  56425. l -= this.pathSegments[i].totalLength;
  56426. }
  56427. return this.endPoint;
  56428. }
  56429. };
  56430. this.transform = function (m) {
  56431. this.pathSegments = [];
  56432. this.startPoint = null;
  56433. this.endPoint = null;
  56434. this.totalLength = 0;
  56435. for (var i = 0; i < this.pathCommands.length; i++) {
  56436. var data = this.pathCommands.shift();
  56437. for (var j = 3; j < data.length; j += 2) {
  56438. var p = transformPoint([data[j], data[j + 1]], m);
  56439. data[j] = p[0];
  56440. data[j + 1] = p[1];
  56441. }
  56442. this.addCommand(data);
  56443. }
  56444. return this;
  56445. };
  56446. this.mergeShape = function (shape) {
  56447. for (var i = 0; i < shape.pathCommands.length; i++) {
  56448. this.addCommand(shape.pathCommands[i].slice());
  56449. }
  56450. return this;
  56451. };
  56452. this.clone = function () {
  56453. return new SvgShape().mergeShape(this);
  56454. };
  56455. this.insertInDocument = function () {
  56456. for (var i = 0; i < this.pathCommands.length; i++) {
  56457. var command = this.pathCommands[i][0],
  56458. values = this.pathCommands[i].slice(3);
  56459. switch (command) {
  56460. case 'move':
  56461. doc.moveTo(values[0], values[1]);
  56462. break;
  56463. case 'line':
  56464. doc.lineTo(values[0], values[1]);
  56465. break;
  56466. case 'curve':
  56467. doc.bezierCurveTo(values[0], values[1], values[2], values[3], values[4], values[5]);
  56468. break;
  56469. case 'close':
  56470. doc.closePath();
  56471. break;
  56472. }
  56473. }
  56474. };
  56475. this.getSubPaths = function () {
  56476. var subPaths = [],
  56477. shape = new SvgShape();
  56478. for (var i = 0; i < this.pathCommands.length; i++) {
  56479. var data = this.pathCommands[i],
  56480. command = this.pathCommands[i][0];
  56481. if (command === 'move' && i !== 0) {
  56482. subPaths.push(shape);
  56483. shape = new SvgShape();
  56484. }
  56485. shape.addCommand(data);
  56486. }
  56487. subPaths.push(shape);
  56488. return subPaths;
  56489. };
  56490. this.getMarkers = function () {
  56491. var markers = [],
  56492. subPaths = this.getSubPaths();
  56493. for (var i = 0; i < subPaths.length; i++) {
  56494. var subPath = subPaths[i],
  56495. subPathMarkers = [];
  56496. for (var j = 0; j < subPath.pathSegments.length; j++) {
  56497. var segment = subPath.pathSegments[j];
  56498. if (isNotEqual(segment.totalLength, 0) || j === 0 || j === subPath.pathSegments.length - 1) {
  56499. if (segment.hasStart) {
  56500. var startMarker = segment.getPointAtLength(0),
  56501. prevEndMarker = subPathMarkers.pop();
  56502. if (prevEndMarker) {
  56503. startMarker[2] = 0.5 * (prevEndMarker[2] + startMarker[2]);
  56504. }
  56505. subPathMarkers.push(startMarker);
  56506. }
  56507. if (segment.hasEnd) {
  56508. var endMarker = segment.getPointAtLength(segment.totalLength);
  56509. subPathMarkers.push(endMarker);
  56510. }
  56511. }
  56512. }
  56513. markers = markers.concat(subPathMarkers);
  56514. }
  56515. return markers;
  56516. };
  56517. };
  56518. var SvgElem = function SvgElem(obj, inherits) {
  56519. var styleCache = Object.create(null);
  56520. var childrenCache = null;
  56521. this.name = obj.nodeName;
  56522. this.isOuterElement = obj === svg || !obj.parentNode;
  56523. this.inherits = inherits || (!this.isOuterElement ? createSVGElement(obj.parentNode, null) : null);
  56524. this.stack = this.inherits ? this.inherits.stack.concat(obj) : [obj];
  56525. this.style = parseStyleAttr(typeof obj.getAttribute === 'function' && obj.getAttribute('style'));
  56526. this.css = useCSS ? getComputedStyle(obj) : getStyle(obj);
  56527. this.allowedChildren = [];
  56528. this.attr = function (key) {
  56529. if (typeof obj.getAttribute === 'function') {
  56530. return obj.getAttribute(key);
  56531. }
  56532. };
  56533. this.resolveUrl = function (value) {
  56534. var temp = (value || '').match(/^\s*(?:url\("(.*)#(.*)"\)|url\('(.*)#(.*)'\)|url\((.*)#(.*)\)|(.*)#(.*))\s*$/) || [];
  56535. var file = temp[1] || temp[3] || temp[5] || temp[7],
  56536. id = temp[2] || temp[4] || temp[6] || temp[8];
  56537. if (id) {
  56538. if (!file) {
  56539. var svgObj = svg.getElementById(id);
  56540. if (svgObj) {
  56541. if (this.stack.indexOf(svgObj) === -1) {
  56542. return svgObj;
  56543. } else {
  56544. warningCallback('SVGtoPDF: loop of circular references for id "' + id + '"');
  56545. return;
  56546. }
  56547. }
  56548. }
  56549. if (documentCallback) {
  56550. var svgs = documentCache[file];
  56551. if (!svgs) {
  56552. svgs = documentCallback(file);
  56553. if (!isArrayLike(svgs)) {
  56554. svgs = [svgs];
  56555. }
  56556. for (var i = 0; i < svgs.length; i++) {
  56557. if (typeof svgs[i] === 'string') {
  56558. svgs[i] = parseXml(svgs[i]);
  56559. }
  56560. }
  56561. documentCache[file] = svgs;
  56562. }
  56563. for (var _i7 = 0; _i7 < svgs.length; _i7++) {
  56564. var _svgObj = svgs[_i7].getElementById(id);
  56565. if (_svgObj) {
  56566. if (this.stack.indexOf(_svgObj) === -1) {
  56567. return _svgObj;
  56568. } else {
  56569. warningCallback('SVGtoPDF: loop of circular references for id "' + file + '#' + id + '"');
  56570. return;
  56571. }
  56572. }
  56573. }
  56574. }
  56575. }
  56576. };
  56577. this.computeUnits = function (value, unit, percent, isFontSize) {
  56578. if (unit === '%') {
  56579. return parseFloat(value) / 100 * (isFontSize || percent != null ? percent : this.getViewport());
  56580. } else if (unit === 'ex' || unit === 'em') {
  56581. return value * {
  56582. 'em': 1,
  56583. 'ex': 0.5
  56584. }[unit] * (isFontSize ? percent : this.get('font-size'));
  56585. } else {
  56586. return value * {
  56587. '': 1,
  56588. 'px': 1,
  56589. 'pt': 96 / 72,
  56590. 'cm': 96 / 2.54,
  56591. 'mm': 96 / 25.4,
  56592. 'in': 96,
  56593. 'pc': 96 / 6
  56594. }[unit];
  56595. }
  56596. };
  56597. this.computeLength = function (value, percent, initial, isFontSize) {
  56598. var parser = new StringParser((value || '').trim()),
  56599. temp1,
  56600. temp2;
  56601. if (typeof (temp1 = parser.matchNumber()) === 'string' && typeof (temp2 = parser.matchLengthUnit()) === 'string' && !parser.matchAll()) {
  56602. return this.computeUnits(temp1, temp2, percent, isFontSize);
  56603. }
  56604. return initial;
  56605. };
  56606. this.computeLengthList = function (value, percent, strict) {
  56607. var parser = new StringParser((value || '').trim()),
  56608. result = [],
  56609. temp1,
  56610. temp2;
  56611. while (typeof (temp1 = parser.matchNumber()) === 'string' && typeof (temp2 = parser.matchLengthUnit()) === 'string') {
  56612. result.push(this.computeUnits(temp1, temp2, percent));
  56613. parser.matchSeparator();
  56614. }
  56615. if (strict && parser.matchAll()) {
  56616. return;
  56617. }
  56618. return result;
  56619. };
  56620. this.getLength = function (key, percent, initial) {
  56621. return this.computeLength(this.attr(key), percent, initial);
  56622. };
  56623. this.getLengthList = function (key, percent) {
  56624. return this.computeLengthList(this.attr(key), percent);
  56625. };
  56626. this.getUrl = function (key) {
  56627. return this.resolveUrl(this.attr(key));
  56628. };
  56629. this.getNumberList = function (key) {
  56630. var parser = new StringParser((this.attr(key) || '').trim()),
  56631. result = [],
  56632. temp;
  56633. while (temp = parser.matchNumber()) {
  56634. result.push(Number(temp));
  56635. parser.matchSeparator();
  56636. }
  56637. result.error = parser.matchAll();
  56638. return result;
  56639. };
  56640. this.getViewbox = function (key, initial) {
  56641. var viewBox = this.getNumberList(key);
  56642. if (viewBox.length === 4 && viewBox[2] >= 0 && viewBox[3] >= 0) {
  56643. return viewBox;
  56644. }
  56645. return initial;
  56646. };
  56647. this.getPercent = function (key, initial) {
  56648. var value = this.attr(key);
  56649. var parser = new StringParser((value || '').trim()),
  56650. temp1,
  56651. temp2;
  56652. var number = parser.matchNumber();
  56653. if (!number) {
  56654. return initial;
  56655. }
  56656. if (parser.match('%')) {
  56657. number *= 0.01;
  56658. }
  56659. if (parser.matchAll()) {
  56660. return initial;
  56661. }
  56662. return Math.max(0, Math.min(1, number));
  56663. };
  56664. this.chooseValue = function (args) {
  56665. for (var i = 0; i < arguments.length; i++) {
  56666. if (arguments[i] != null && arguments[i] === arguments[i]) {
  56667. return arguments[i];
  56668. }
  56669. }
  56670. return arguments[arguments.length - 1];
  56671. };
  56672. this.get = function (key) {
  56673. if (styleCache[key] !== undefined) {
  56674. return styleCache[key];
  56675. }
  56676. var keyInfo = Properties[key] || {},
  56677. value,
  56678. result;
  56679. for (var i = 0; i < 3; i++) {
  56680. switch (i) {
  56681. case 0:
  56682. if (key !== 'transform') {
  56683. // the CSS transform behaves strangely
  56684. value = this.css[keyInfo.css || key];
  56685. }
  56686. break;
  56687. case 1:
  56688. value = this.style[key];
  56689. break;
  56690. case 2:
  56691. value = this.attr(key);
  56692. break;
  56693. }
  56694. if (value === 'inherit') {
  56695. result = this.inherits ? this.inherits.get(key) : keyInfo.initial;
  56696. if (result != null) {
  56697. return styleCache[key] = result;
  56698. }
  56699. }
  56700. if (keyInfo.values != null) {
  56701. result = keyInfo.values[value];
  56702. if (result != null) {
  56703. return styleCache[key] = result;
  56704. }
  56705. }
  56706. if (value != null) {
  56707. var parsed = void 0;
  56708. switch (key) {
  56709. case 'font-size':
  56710. result = this.computeLength(value, this.inherits ? this.inherits.get(key) : keyInfo.initial, undefined, true);
  56711. break;
  56712. case 'baseline-shift':
  56713. result = this.computeLength(value, this.get('font-size'));
  56714. break;
  56715. case 'font-family':
  56716. result = value || undefined;
  56717. break;
  56718. case 'opacity':
  56719. case 'stroke-opacity':
  56720. case 'fill-opacity':
  56721. case 'stop-opacity':
  56722. parsed = parseFloat(value);
  56723. if (!isNaN(parsed)) {
  56724. result = Math.max(0, Math.min(1, parsed));
  56725. }
  56726. break;
  56727. case 'transform':
  56728. result = parseTranform(value);
  56729. break;
  56730. case 'stroke-dasharray':
  56731. if (value === 'none') {
  56732. result = [];
  56733. } else if (parsed = this.computeLengthList(value, this.getViewport(), true)) {
  56734. var sum = 0,
  56735. error = false;
  56736. for (var j = 0; j < parsed.length; j++) {
  56737. if (parsed[j] < 0) {
  56738. error = true;
  56739. }
  56740. sum += parsed[j];
  56741. }
  56742. if (!error) {
  56743. if (parsed.length % 2 === 1) {
  56744. parsed = parsed.concat(parsed);
  56745. }
  56746. result = sum === 0 ? [] : parsed;
  56747. }
  56748. }
  56749. break;
  56750. case 'color':
  56751. if (value === 'none' || value === 'transparent') {
  56752. result = 'none';
  56753. } else {
  56754. result = parseColor(value);
  56755. }
  56756. break;
  56757. case 'fill':
  56758. case 'stroke':
  56759. if (value === 'none' || value === 'transparent') {
  56760. result = 'none';
  56761. } else if (value === 'currentColor') {
  56762. result = this.get('color');
  56763. } else if (parsed = parseColor(value)) {
  56764. return parsed;
  56765. } else if (parsed = (value || '').split(' ')) {
  56766. var object = this.resolveUrl(parsed[0]),
  56767. fallbackColor = parseColor(parsed[1]);
  56768. if (object == null) {
  56769. result = fallbackColor;
  56770. } else if (object.nodeName === 'linearGradient' || object.nodeName === 'radialGradient') {
  56771. result = new SvgElemGradient(object, null, fallbackColor);
  56772. } else if (object.nodeName === 'pattern') {
  56773. result = new SvgElemPattern(object, null, fallbackColor);
  56774. } else {
  56775. result = fallbackColor;
  56776. }
  56777. }
  56778. break;
  56779. case 'stop-color':
  56780. if (value === 'none' || value === 'transparent') {
  56781. result = 'none';
  56782. } else if (value === 'currentColor') {
  56783. result = this.get('color');
  56784. } else {
  56785. result = parseColor(value);
  56786. }
  56787. break;
  56788. case 'marker-start':
  56789. case 'marker-mid':
  56790. case 'marker-end':
  56791. case 'clip-path':
  56792. case 'mask':
  56793. if (value === 'none') {
  56794. result = 'none';
  56795. } else {
  56796. result = this.resolveUrl(value);
  56797. }
  56798. break;
  56799. case 'stroke-width':
  56800. parsed = this.computeLength(value, this.getViewport());
  56801. if (parsed != null && parsed >= 0) {
  56802. result = parsed;
  56803. }
  56804. break;
  56805. case 'stroke-miterlimit':
  56806. parsed = parseFloat(value);
  56807. if (parsed != null && parsed >= 1) {
  56808. result = parsed;
  56809. }
  56810. break;
  56811. case 'word-spacing':
  56812. case 'letter-spacing':
  56813. result = this.computeLength(value, this.getViewport());
  56814. break;
  56815. case 'stroke-dashoffset':
  56816. result = this.computeLength(value, this.getViewport());
  56817. if (result != null) {
  56818. if (result < 0) {
  56819. // fix for crbug.com/660850
  56820. var dasharray = this.get('stroke-dasharray');
  56821. for (var _j = 0; _j < dasharray.length; _j++) {
  56822. result += dasharray[_j];
  56823. }
  56824. }
  56825. }
  56826. break;
  56827. }
  56828. if (result != null) {
  56829. return styleCache[key] = result;
  56830. }
  56831. }
  56832. }
  56833. return styleCache[key] = keyInfo.inherit && this.inherits ? this.inherits.get(key) : keyInfo.initial;
  56834. };
  56835. this.getChildren = function () {
  56836. if (childrenCache != null) {
  56837. return childrenCache;
  56838. }
  56839. var children = [];
  56840. for (var i = 0; i < obj.childNodes.length; i++) {
  56841. var child = obj.childNodes[i];
  56842. if (!child.error && this.allowedChildren.indexOf(child.nodeName) !== -1) {
  56843. children.push(createSVGElement(child, this));
  56844. }
  56845. }
  56846. return childrenCache = children;
  56847. };
  56848. this.getParentVWidth = function () {
  56849. return this.inherits ? this.inherits.getVWidth() : viewportWidth;
  56850. };
  56851. this.getParentVHeight = function () {
  56852. return this.inherits ? this.inherits.getVHeight() : viewportHeight;
  56853. };
  56854. this.getParentViewport = function () {
  56855. return Math.sqrt(0.5 * this.getParentVWidth() * this.getParentVWidth() + 0.5 * this.getParentVHeight() * this.getParentVHeight());
  56856. };
  56857. this.getVWidth = function () {
  56858. return this.getParentVWidth();
  56859. };
  56860. this.getVHeight = function () {
  56861. return this.getParentVHeight();
  56862. };
  56863. this.getViewport = function () {
  56864. return Math.sqrt(0.5 * this.getVWidth() * this.getVWidth() + 0.5 * this.getVHeight() * this.getVHeight());
  56865. };
  56866. this.getBoundingBox = function () {
  56867. var shape = this.getBoundingShape();
  56868. return shape.getBoundingBox();
  56869. };
  56870. };
  56871. var SvgElemStylable = function SvgElemStylable(obj, inherits) {
  56872. SvgElem.call(this, obj, inherits);
  56873. this.transform = function () {
  56874. doc.transform.apply(doc, this.getTransformation());
  56875. };
  56876. this.clip = function () {
  56877. if (this.get('clip-path') !== 'none') {
  56878. var clipPath = new SvgElemClipPath(this.get('clip-path'), null);
  56879. clipPath.useMask(this.getBoundingBox());
  56880. return true;
  56881. }
  56882. };
  56883. this.mask = function () {
  56884. if (this.get('mask') !== 'none') {
  56885. var mask = new SvgElemMask(this.get('mask'), null);
  56886. mask.useMask(this.getBoundingBox());
  56887. return true;
  56888. }
  56889. };
  56890. this.getFill = function (isClip, isMask) {
  56891. var opacity = this.get('opacity'),
  56892. fill = this.get('fill'),
  56893. fillOpacity = this.get('fill-opacity');
  56894. if (isClip) {
  56895. return DefaultColors.white;
  56896. }
  56897. if (fill !== 'none' && opacity && fillOpacity) {
  56898. if (fill instanceof SvgElemGradient || fill instanceof SvgElemPattern) {
  56899. return fill.getPaint(this.getBoundingBox(), fillOpacity * opacity, isClip, isMask);
  56900. }
  56901. return opacityToColor(fill, fillOpacity * opacity, isMask);
  56902. }
  56903. };
  56904. this.getStroke = function (isClip, isMask) {
  56905. var opacity = this.get('opacity'),
  56906. stroke = this.get('stroke'),
  56907. strokeOpacity = this.get('stroke-opacity');
  56908. if (isClip || isEqual(this.get('stroke-width'), 0)) {
  56909. return;
  56910. }
  56911. if (stroke !== 'none' && opacity && strokeOpacity) {
  56912. if (stroke instanceof SvgElemGradient || stroke instanceof SvgElemPattern) {
  56913. return stroke.getPaint(this.getBoundingBox(), strokeOpacity * opacity, isClip, isMask);
  56914. }
  56915. return opacityToColor(stroke, strokeOpacity * opacity, isMask);
  56916. }
  56917. };
  56918. };
  56919. var SvgElemHasChildren = function SvgElemHasChildren(obj, inherits) {
  56920. SvgElemStylable.call(this, obj, inherits);
  56921. this.allowedChildren = ['use', 'g', 'a', 'svg', 'image', 'rect', 'circle', 'ellipse', 'line', 'polyline', 'polygon', 'path', 'text'];
  56922. this.getBoundingShape = function () {
  56923. var shape = new SvgShape(),
  56924. children = this.getChildren();
  56925. for (var i = 0; i < children.length; i++) {
  56926. if (children[i].get('display') !== 'none') {
  56927. if (typeof children[i].getBoundingShape === 'function') {
  56928. var childShape = children[i].getBoundingShape().clone();
  56929. if (typeof children[i].getTransformation === 'function') {
  56930. childShape.transform(children[i].getTransformation());
  56931. }
  56932. shape.mergeShape(childShape);
  56933. }
  56934. }
  56935. }
  56936. return shape;
  56937. };
  56938. this.drawChildren = function (isClip, isMask) {
  56939. var children = this.getChildren();
  56940. for (var i = 0; i < children.length; i++) {
  56941. if (children[i].get('display') !== 'none') {
  56942. if (typeof children[i].drawInDocument === 'function') {
  56943. children[i].drawInDocument(isClip, isMask);
  56944. }
  56945. }
  56946. }
  56947. };
  56948. };
  56949. var SvgElemContainer = function SvgElemContainer(obj, inherits) {
  56950. SvgElemHasChildren.call(this, obj, inherits);
  56951. this.drawContent = function (isClip, isMask) {
  56952. this.transform();
  56953. var clipped = this.clip(),
  56954. masked = this.mask(),
  56955. group;
  56956. if ((this.get('opacity') < 1 || clipped || masked) && !isClip) {
  56957. group = docBeginGroup(getPageBBox());
  56958. }
  56959. this.drawChildren(isClip, isMask);
  56960. if (group) {
  56961. docEndGroup(group);
  56962. doc.fillOpacity(this.get('opacity'));
  56963. docInsertGroup(group);
  56964. }
  56965. };
  56966. };
  56967. var SvgElemUse = function SvgElemUse(obj, inherits) {
  56968. SvgElemContainer.call(this, obj, inherits);
  56969. var x = this.getLength('x', this.getVWidth(), 0),
  56970. y = this.getLength('y', this.getVHeight(), 0),
  56971. child = this.getUrl('href') || this.getUrl('xlink:href');
  56972. if (child) {
  56973. child = createSVGElement(child, this);
  56974. }
  56975. this.getChildren = function () {
  56976. return child ? [child] : [];
  56977. };
  56978. this.drawInDocument = function (isClip, isMask) {
  56979. doc.save();
  56980. this.drawContent(isClip, isMask);
  56981. doc.restore();
  56982. };
  56983. this.getTransformation = function () {
  56984. return multiplyMatrix(this.get('transform'), [1, 0, 0, 1, x, y]);
  56985. };
  56986. };
  56987. var SvgElemSymbol = function SvgElemSymbol(obj, inherits) {
  56988. SvgElemContainer.call(this, obj, inherits);
  56989. var width = this.getLength('width', this.getParentVWidth(), this.getParentVWidth()),
  56990. height = this.getLength('height', this.getParentVHeight(), this.getParentVHeight());
  56991. if (inherits instanceof SvgElemUse) {
  56992. width = inherits.getLength('width', inherits.getParentVWidth(), width);
  56993. height = inherits.getLength('height', inherits.getParentVHeight(), height);
  56994. }
  56995. var aspectRatio = (this.attr('preserveAspectRatio') || '').trim(),
  56996. viewBox = this.getViewbox('viewBox', [0, 0, width, height]);
  56997. this.getVWidth = function () {
  56998. return viewBox[2];
  56999. };
  57000. this.getVHeight = function () {
  57001. return viewBox[3];
  57002. };
  57003. this.drawInDocument = function (isClip, isMask) {
  57004. doc.save();
  57005. this.drawContent(isClip, isMask);
  57006. doc.restore();
  57007. };
  57008. this.getTransformation = function () {
  57009. return multiplyMatrix(parseAspectRatio(aspectRatio, width, height, viewBox[2], viewBox[3]), [1, 0, 0, 1, -viewBox[0], -viewBox[1]]);
  57010. };
  57011. };
  57012. var SvgElemGroup = function SvgElemGroup(obj, inherits) {
  57013. SvgElemContainer.call(this, obj, inherits);
  57014. this.drawInDocument = function (isClip, isMask) {
  57015. doc.save();
  57016. if (this.link && !isClip && !isMask) {
  57017. this.addLink();
  57018. }
  57019. this.drawContent(isClip, isMask);
  57020. doc.restore();
  57021. };
  57022. this.getTransformation = function () {
  57023. return this.get('transform');
  57024. };
  57025. };
  57026. var SvgElemLink = function SvgElemLink(obj, inherits) {
  57027. if (inherits && inherits.isText) {
  57028. SvgElemTspan.call(this, obj, inherits);
  57029. this.allowedChildren = ['textPath', 'tspan', '#text', '#cdata-section', 'a'];
  57030. } else {
  57031. SvgElemGroup.call(this, obj, inherits);
  57032. }
  57033. this.link = this.attr('href') || this.attr('xlink:href');
  57034. this.addLink = function () {
  57035. if (this.link.match(/^(?:[a-z][a-z0-9+.-]*:|\/\/)?/i) && this.getChildren().length) {
  57036. var bbox = this.getBoundingShape().transform(getGlobalMatrix()).getBoundingBox();
  57037. docInsertLink(bbox[0], bbox[1], bbox[2], bbox[3], this.link);
  57038. }
  57039. };
  57040. };
  57041. var SvgElemSvg = function SvgElemSvg(obj, inherits) {
  57042. SvgElemContainer.call(this, obj, inherits);
  57043. var width = this.getLength('width', this.getParentVWidth(), this.getParentVWidth()),
  57044. height = this.getLength('height', this.getParentVHeight(), this.getParentVHeight()),
  57045. x = this.getLength('x', this.getParentVWidth(), 0),
  57046. y = this.getLength('y', this.getParentVHeight(), 0);
  57047. if (inherits instanceof SvgElemUse) {
  57048. width = inherits.getLength('width', inherits.getParentVWidth(), width);
  57049. height = inherits.getLength('height', inherits.getParentVHeight(), height);
  57050. }
  57051. var aspectRatio = this.attr('preserveAspectRatio'),
  57052. viewBox = this.getViewbox('viewBox', [0, 0, width, height]);
  57053. if (this.isOuterElement && preserveAspectRatio) {
  57054. x = y = 0;
  57055. width = viewportWidth;
  57056. height = viewportHeight;
  57057. aspectRatio = preserveAspectRatio;
  57058. }
  57059. this.getVWidth = function () {
  57060. return viewBox[2];
  57061. };
  57062. this.getVHeight = function () {
  57063. return viewBox[3];
  57064. };
  57065. this.drawInDocument = function (isClip, isMask) {
  57066. doc.save();
  57067. if (this.get('overflow') === 'hidden') {
  57068. new SvgShape().M(x, y).L(x + width, y).L(x + width, y + height).L(x, y + height).Z().transform(this.get('transform')).insertInDocument();
  57069. doc.clip();
  57070. }
  57071. this.drawContent(isClip, isMask);
  57072. doc.restore();
  57073. };
  57074. this.getTransformation = function () {
  57075. return multiplyMatrix(this.get('transform'), [1, 0, 0, 1, x, y], parseAspectRatio(aspectRatio, width, height, viewBox[2], viewBox[3]), [1, 0, 0, 1, -viewBox[0], -viewBox[1]]);
  57076. };
  57077. };
  57078. var SVGElemImage = function SVGElemImage(obj, inherits) {
  57079. SvgElemStylable.call(this, obj, inherits);
  57080. var link = imageCallback(this.attr('href') || this.attr('xlink:href') || ''),
  57081. x = this.getLength('x', this.getVWidth(), 0),
  57082. y = this.getLength('y', this.getVHeight(), 0),
  57083. width = this.getLength('width', this.getVWidth(), 'auto'),
  57084. height = this.getLength('height', this.getVHeight(), 'auto'),
  57085. image;
  57086. try {
  57087. image = doc.openImage(link);
  57088. } catch (e) {
  57089. warningCallback('SVGElemImage: failed to open image "' + link + '" in PDFKit');
  57090. }
  57091. if (image) {
  57092. if (width === 'auto' && height !== 'auto') {
  57093. width = height * image.width / image.height;
  57094. } else if (height === 'auto' && width !== 'auto') {
  57095. height = width * image.height / image.width;
  57096. } else if (width === 'auto' && height === 'auto') {
  57097. width = image.width;
  57098. height = image.height;
  57099. }
  57100. }
  57101. if (width === 'auto' || width < 0) {
  57102. width = 0;
  57103. }
  57104. if (height === 'auto' || height < 0) {
  57105. height = 0;
  57106. }
  57107. this.getTransformation = function () {
  57108. return this.get('transform');
  57109. };
  57110. this.getBoundingShape = function () {
  57111. return new SvgShape().M(x, y).L(x + width, y).M(x + width, y + height).L(x, y + height);
  57112. };
  57113. this.drawInDocument = function (isClip, isMask) {
  57114. if (this.get('visibility') === 'hidden' || !image) {
  57115. return;
  57116. }
  57117. doc.save();
  57118. this.transform();
  57119. if (this.get('overflow') === 'hidden') {
  57120. doc.rect(x, y, width, height).clip();
  57121. }
  57122. this.clip();
  57123. this.mask();
  57124. doc.translate(x, y);
  57125. doc.transform.apply(doc, parseAspectRatio(this.attr('preserveAspectRatio'), width, height, image ? image.width : width, image ? image.height : height));
  57126. if (!isClip) {
  57127. doc.fillOpacity(this.get('opacity'));
  57128. doc.image(image, 0, 0);
  57129. } else {
  57130. doc.rect(0, 0, image.width, image.height);
  57131. docFillColor(DefaultColors.white).fill();
  57132. }
  57133. doc.restore();
  57134. };
  57135. };
  57136. var SvgElemPattern = function SvgElemPattern(obj, inherits, fallback) {
  57137. SvgElemHasChildren.call(this, obj, inherits);
  57138. this.ref = function () {
  57139. var ref = this.getUrl('href') || this.getUrl('xlink:href');
  57140. if (ref && ref.nodeName === obj.nodeName) {
  57141. return new SvgElemPattern(ref, inherits, fallback);
  57142. }
  57143. }.call(this);
  57144. var _attr = this.attr;
  57145. this.attr = function (key) {
  57146. var attr = _attr.call(this, key);
  57147. if (attr != null || key === 'href' || key === 'xlink:href') {
  57148. return attr;
  57149. }
  57150. return this.ref ? this.ref.attr(key) : null;
  57151. };
  57152. var _getChildren = this.getChildren;
  57153. this.getChildren = function () {
  57154. var children = _getChildren.call(this);
  57155. if (children.length > 0) {
  57156. return children;
  57157. }
  57158. return this.ref ? this.ref.getChildren() : [];
  57159. };
  57160. this.getPaint = function (bBox, gOpacity, isClip, isMask) {
  57161. var bBoxUnitsPattern = this.attr('patternUnits') !== 'userSpaceOnUse',
  57162. bBoxUnitsContent = this.attr('patternContentUnits') === 'objectBoundingBox',
  57163. x = this.getLength('x', bBoxUnitsPattern ? 1 : this.getParentVWidth(), 0),
  57164. y = this.getLength('y', bBoxUnitsPattern ? 1 : this.getParentVHeight(), 0),
  57165. width = this.getLength('width', bBoxUnitsPattern ? 1 : this.getParentVWidth(), 0),
  57166. height = this.getLength('height', bBoxUnitsPattern ? 1 : this.getParentVHeight(), 0);
  57167. if (bBoxUnitsContent && !bBoxUnitsPattern) {
  57168. // Use the same units for pattern & pattern content
  57169. x = (x - bBox[0]) / (bBox[2] - bBox[0]) || 0;
  57170. y = (y - bBox[1]) / (bBox[3] - bBox[1]) || 0;
  57171. width = width / (bBox[2] - bBox[0]) || 0;
  57172. height = height / (bBox[3] - bBox[1]) || 0;
  57173. } else if (!bBoxUnitsContent && bBoxUnitsPattern) {
  57174. x = bBox[0] + x * (bBox[2] - bBox[0]);
  57175. y = bBox[1] + y * (bBox[3] - bBox[1]);
  57176. width = width * (bBox[2] - bBox[0]);
  57177. height = height * (bBox[3] - bBox[1]);
  57178. }
  57179. var viewBox = this.getViewbox('viewBox', [0, 0, width, height]),
  57180. aspectRatio = (this.attr('preserveAspectRatio') || '').trim(),
  57181. aspectRatioMatrix = multiplyMatrix(parseAspectRatio(aspectRatio, width, height, viewBox[2], viewBox[3], 0), [1, 0, 0, 1, -viewBox[0], -viewBox[1]]),
  57182. matrix = parseTranform(this.attr('patternTransform'));
  57183. if (bBoxUnitsContent) {
  57184. matrix = multiplyMatrix([bBox[2] - bBox[0], 0, 0, bBox[3] - bBox[1], bBox[0], bBox[1]], matrix);
  57185. }
  57186. matrix = multiplyMatrix(matrix, [1, 0, 0, 1, x, y]);
  57187. if ((matrix = validateMatrix(matrix)) && (aspectRatioMatrix = validateMatrix(aspectRatioMatrix)) && (width = validateNumber(width)) && (height = validateNumber(height))) {
  57188. var group = docBeginGroup([0, 0, width, height]);
  57189. doc.transform.apply(doc, aspectRatioMatrix);
  57190. this.drawChildren(isClip, isMask);
  57191. docEndGroup(group);
  57192. return [docCreatePattern(group, width, height, matrix), gOpacity];
  57193. } else {
  57194. return fallback ? [fallback[0], fallback[1] * gOpacity] : undefined;
  57195. }
  57196. };
  57197. this.getVWidth = function () {
  57198. var bBoxUnitsPattern = this.attr('patternUnits') !== 'userSpaceOnUse',
  57199. width = this.getLength('width', bBoxUnitsPattern ? 1 : this.getParentVWidth(), 0);
  57200. return this.getViewbox('viewBox', [0, 0, width, 0])[2];
  57201. };
  57202. this.getVHeight = function () {
  57203. var bBoxUnitsPattern = this.attr('patternUnits') !== 'userSpaceOnUse',
  57204. height = this.getLength('height', bBoxUnitsPattern ? 1 : this.getParentVHeight(), 0);
  57205. return this.getViewbox('viewBox', [0, 0, 0, height])[3];
  57206. };
  57207. };
  57208. var SvgElemGradient = function SvgElemGradient(obj, inherits, fallback) {
  57209. SvgElem.call(this, obj, inherits);
  57210. this.allowedChildren = ['stop'];
  57211. this.ref = function () {
  57212. var ref = this.getUrl('href') || this.getUrl('xlink:href');
  57213. if (ref && ref.nodeName === obj.nodeName) {
  57214. return new SvgElemGradient(ref, inherits, fallback);
  57215. }
  57216. }.call(this);
  57217. var _attr = this.attr;
  57218. this.attr = function (key) {
  57219. var attr = _attr.call(this, key);
  57220. if (attr != null || key === 'href' || key === 'xlink:href') {
  57221. return attr;
  57222. }
  57223. return this.ref ? this.ref.attr(key) : null;
  57224. };
  57225. var _getChildren = this.getChildren;
  57226. this.getChildren = function () {
  57227. var children = _getChildren.call(this);
  57228. if (children.length > 0) {
  57229. return children;
  57230. }
  57231. return this.ref ? this.ref.getChildren() : [];
  57232. };
  57233. this.getPaint = function (bBox, gOpacity, isClip, isMask) {
  57234. var children = this.getChildren();
  57235. if (children.length === 0) {
  57236. return;
  57237. }
  57238. if (children.length === 1) {
  57239. var child = children[0],
  57240. stopColor = child.get('stop-color');
  57241. if (stopColor === 'none') {
  57242. return;
  57243. }
  57244. return opacityToColor(stopColor, child.get('stop-opacity') * gOpacity, isMask);
  57245. }
  57246. var bBoxUnits = this.attr('gradientUnits') !== 'userSpaceOnUse',
  57247. matrix = parseTranform(this.attr('gradientTransform')),
  57248. spread = this.attr('spreadMethod'),
  57249. grad,
  57250. x1,
  57251. x2,
  57252. y1,
  57253. y2,
  57254. r2,
  57255. nAfter = 0,
  57256. nBefore = 0,
  57257. nTotal = 1;
  57258. if (bBoxUnits) {
  57259. matrix = multiplyMatrix([bBox[2] - bBox[0], 0, 0, bBox[3] - bBox[1], bBox[0], bBox[1]], matrix);
  57260. }
  57261. if (matrix = validateMatrix(matrix)) {
  57262. if (this.name === 'linearGradient') {
  57263. x1 = this.getLength('x1', bBoxUnits ? 1 : this.getVWidth(), 0);
  57264. x2 = this.getLength('x2', bBoxUnits ? 1 : this.getVWidth(), bBoxUnits ? 1 : this.getVWidth());
  57265. y1 = this.getLength('y1', bBoxUnits ? 1 : this.getVHeight(), 0);
  57266. y2 = this.getLength('y2', bBoxUnits ? 1 : this.getVHeight(), 0);
  57267. } else {
  57268. x2 = this.getLength('cx', bBoxUnits ? 1 : this.getVWidth(), bBoxUnits ? 0.5 : 0.5 * this.getVWidth());
  57269. y2 = this.getLength('cy', bBoxUnits ? 1 : this.getVHeight(), bBoxUnits ? 0.5 : 0.5 * this.getVHeight());
  57270. r2 = this.getLength('r', bBoxUnits ? 1 : this.getViewport(), bBoxUnits ? 0.5 : 0.5 * this.getViewport());
  57271. x1 = this.getLength('fx', bBoxUnits ? 1 : this.getVWidth(), x2);
  57272. y1 = this.getLength('fy', bBoxUnits ? 1 : this.getVHeight(), y2);
  57273. if (r2 < 0) {
  57274. warningCallback('SvgElemGradient: negative r value');
  57275. }
  57276. var d = Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2)),
  57277. multiplier = 1;
  57278. if (d > r2) {
  57279. // according to specification
  57280. multiplier = r2 / d;
  57281. x1 = x2 + (x1 - x2) * multiplier;
  57282. y1 = y2 + (y1 - y2) * multiplier;
  57283. }
  57284. r2 = Math.max(r2, d * multiplier * (1 + 1e-6)); // fix for edge-case gradients see issue #84
  57285. }
  57286. if (spread === 'reflect' || spread === 'repeat') {
  57287. var inv = inverseMatrix(matrix),
  57288. corner1 = transformPoint([bBox[0], bBox[1]], inv),
  57289. corner2 = transformPoint([bBox[2], bBox[1]], inv),
  57290. corner3 = transformPoint([bBox[2], bBox[3]], inv),
  57291. corner4 = transformPoint([bBox[0], bBox[3]], inv);
  57292. if (this.name === 'linearGradient') {
  57293. // See file 'gradient-repeat-maths.png'
  57294. nAfter = Math.max((corner1[0] - x2) * (x2 - x1) + (corner1[1] - y2) * (y2 - y1), (corner2[0] - x2) * (x2 - x1) + (corner2[1] - y2) * (y2 - y1), (corner3[0] - x2) * (x2 - x1) + (corner3[1] - y2) * (y2 - y1), (corner4[0] - x2) * (x2 - x1) + (corner4[1] - y2) * (y2 - y1)) / (Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));
  57295. nBefore = Math.max((corner1[0] - x1) * (x1 - x2) + (corner1[1] - y1) * (y1 - y2), (corner2[0] - x1) * (x1 - x2) + (corner2[1] - y1) * (y1 - y2), (corner3[0] - x1) * (x1 - x2) + (corner3[1] - y1) * (y1 - y2), (corner4[0] - x1) * (x1 - x2) + (corner4[1] - y1) * (y1 - y2)) / (Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));
  57296. } else {
  57297. nAfter = Math.sqrt(Math.max(Math.pow(corner1[0] - x2, 2) + Math.pow(corner1[1] - y2, 2), Math.pow(corner2[0] - x2, 2) + Math.pow(corner2[1] - y2, 2), Math.pow(corner3[0] - x2, 2) + Math.pow(corner3[1] - y2, 2), Math.pow(corner4[0] - x2, 2) + Math.pow(corner4[1] - y2, 2))) / r2 - 1;
  57298. }
  57299. nAfter = Math.ceil(nAfter + 0.5); // Add a little more because the stroke can extend outside of the bounding box
  57300. nBefore = Math.ceil(nBefore + 0.5);
  57301. nTotal = nBefore + 1 + nAfter; // How many times the gradient needs to be repeated to fill the object bounding box
  57302. }
  57303. if (this.name === 'linearGradient') {
  57304. grad = doc.linearGradient(x1 - nBefore * (x2 - x1), y1 - nBefore * (y2 - y1), x2 + nAfter * (x2 - x1), y2 + nAfter * (y2 - y1));
  57305. } else {
  57306. grad = doc.radialGradient(x1, y1, 0, x2, y2, r2 + nAfter * r2);
  57307. }
  57308. for (var n = 0; n < nTotal; n++) {
  57309. var offset = 0,
  57310. inOrder = spread !== 'reflect' || (n - nBefore) % 2 === 0;
  57311. for (var i = 0; i < children.length; i++) {
  57312. var _child = children[inOrder ? i : children.length - 1 - i],
  57313. _stopColor = _child.get('stop-color');
  57314. if (_stopColor === 'none') {
  57315. _stopColor = DefaultColors.transparent;
  57316. }
  57317. _stopColor = opacityToColor(_stopColor, _child.get('stop-opacity') * gOpacity, isMask);
  57318. offset = Math.max(offset, inOrder ? _child.getPercent('offset', 0) : 1 - _child.getPercent('offset', 0));
  57319. if (i === 0 && _stopColor[0].length === 4) {
  57320. grad._colorSpace = 'DeviceCMYK';
  57321. } // Fix until PR #763 is merged into PDFKit
  57322. if (i === 0 && offset > 0) {
  57323. grad.stop((n + 0) / nTotal, _stopColor[0], _stopColor[1]);
  57324. }
  57325. grad.stop((n + offset) / (nAfter + nBefore + 1), _stopColor[0], _stopColor[1]);
  57326. if (i === children.length - 1 && offset < 1) {
  57327. grad.stop((n + 1) / nTotal, _stopColor[0], _stopColor[1]);
  57328. }
  57329. }
  57330. }
  57331. grad.setTransform.apply(grad, matrix);
  57332. return [grad, 1];
  57333. } else {
  57334. return fallback ? [fallback[0], fallback[1] * gOpacity] : undefined;
  57335. }
  57336. };
  57337. };
  57338. var SvgElemBasicShape = function SvgElemBasicShape(obj, inherits) {
  57339. SvgElemStylable.call(this, obj, inherits);
  57340. this.dashScale = 1;
  57341. this.getBoundingShape = function () {
  57342. return this.shape;
  57343. };
  57344. this.getTransformation = function () {
  57345. return this.get('transform');
  57346. };
  57347. this.drawInDocument = function (isClip, isMask) {
  57348. if (this.get('visibility') === 'hidden' || !this.shape) {
  57349. return;
  57350. }
  57351. doc.save();
  57352. this.transform();
  57353. this.clip();
  57354. if (!isClip) {
  57355. var masked = this.mask(),
  57356. group;
  57357. if (masked) {
  57358. group = docBeginGroup(getPageBBox());
  57359. }
  57360. var subPaths = this.shape.getSubPaths(),
  57361. fill = this.getFill(isClip, isMask),
  57362. stroke = this.getStroke(isClip, isMask),
  57363. lineWidth = this.get('stroke-width'),
  57364. lineCap = this.get('stroke-linecap');
  57365. if (fill || stroke) {
  57366. if (fill) {
  57367. docFillColor(fill);
  57368. }
  57369. if (stroke) {
  57370. for (var j = 0; j < subPaths.length; j++) {
  57371. if (isEqual(subPaths[j].totalLength, 0)) {
  57372. if ((lineCap === 'square' || lineCap === 'round') && lineWidth > 0) {
  57373. if (subPaths[j].startPoint && subPaths[j].startPoint.length > 1) {
  57374. var _x4 = subPaths[j].startPoint[0],
  57375. _y4 = subPaths[j].startPoint[1];
  57376. docFillColor(stroke);
  57377. if (lineCap === 'square') {
  57378. doc.rect(_x4 - 0.5 * lineWidth, _y4 - 0.5 * lineWidth, lineWidth, lineWidth);
  57379. } else if (lineCap === 'round') {
  57380. doc.circle(_x4, _y4, 0.5 * lineWidth);
  57381. }
  57382. doc.fill();
  57383. }
  57384. }
  57385. }
  57386. }
  57387. var dashArray = this.get('stroke-dasharray'),
  57388. dashOffset = this.get('stroke-dashoffset');
  57389. if (isNotEqual(this.dashScale, 1)) {
  57390. for (var _j2 = 0; _j2 < dashArray.length; _j2++) {
  57391. dashArray[_j2] *= this.dashScale;
  57392. }
  57393. dashOffset *= this.dashScale;
  57394. }
  57395. docStrokeColor(stroke);
  57396. doc.lineWidth(lineWidth).miterLimit(this.get('stroke-miterlimit')).lineJoin(this.get('stroke-linejoin')).lineCap(lineCap).dash(dashArray, {
  57397. phase: dashOffset
  57398. });
  57399. }
  57400. for (var _j3 = 0; _j3 < subPaths.length; _j3++) {
  57401. if (subPaths[_j3].totalLength > 0) {
  57402. subPaths[_j3].insertInDocument();
  57403. }
  57404. }
  57405. if (fill && stroke) {
  57406. doc.fillAndStroke(this.get('fill-rule'));
  57407. } else if (fill) {
  57408. doc.fill(this.get('fill-rule'));
  57409. } else if (stroke) {
  57410. doc.stroke();
  57411. }
  57412. }
  57413. var markerStart = this.get('marker-start'),
  57414. markerMid = this.get('marker-mid'),
  57415. markerEnd = this.get('marker-end');
  57416. if (markerStart !== 'none' || markerMid !== 'none' || markerEnd !== 'none') {
  57417. var markersPos = this.shape.getMarkers();
  57418. if (markerStart !== 'none') {
  57419. var marker = new SvgElemMarker(markerStart, null);
  57420. marker.drawMarker(false, isMask, markersPos[0], lineWidth);
  57421. }
  57422. if (markerMid !== 'none') {
  57423. for (var i = 1; i < markersPos.length - 1; i++) {
  57424. var _marker = new SvgElemMarker(markerMid, null);
  57425. _marker.drawMarker(false, isMask, markersPos[i], lineWidth);
  57426. }
  57427. }
  57428. if (markerEnd !== 'none') {
  57429. var _marker2 = new SvgElemMarker(markerEnd, null);
  57430. _marker2.drawMarker(false, isMask, markersPos[markersPos.length - 1], lineWidth);
  57431. }
  57432. }
  57433. if (group) {
  57434. docEndGroup(group);
  57435. docInsertGroup(group);
  57436. }
  57437. } else {
  57438. this.shape.insertInDocument();
  57439. docFillColor(DefaultColors.white);
  57440. doc.fill(this.get('clip-rule'));
  57441. }
  57442. doc.restore();
  57443. };
  57444. };
  57445. var SvgElemRect = function SvgElemRect(obj, inherits) {
  57446. SvgElemBasicShape.call(this, obj, inherits);
  57447. var x = this.getLength('x', this.getVWidth(), 0),
  57448. y = this.getLength('y', this.getVHeight(), 0),
  57449. w = this.getLength('width', this.getVWidth(), 0),
  57450. h = this.getLength('height', this.getVHeight(), 0),
  57451. rx = this.getLength('rx', this.getVWidth()),
  57452. ry = this.getLength('ry', this.getVHeight());
  57453. if (rx === undefined && ry === undefined) {
  57454. rx = ry = 0;
  57455. } else if (rx === undefined && ry !== undefined) {
  57456. rx = ry;
  57457. } else if (rx !== undefined && ry === undefined) {
  57458. ry = rx;
  57459. }
  57460. if (w > 0 && h > 0) {
  57461. if (rx && ry) {
  57462. rx = Math.min(rx, 0.5 * w);
  57463. ry = Math.min(ry, 0.5 * h);
  57464. this.shape = new SvgShape().M(x + rx, y).L(x + w - rx, y).A(rx, ry, 0, 0, 1, x + w, y + ry).L(x + w, y + h - ry).A(rx, ry, 0, 0, 1, x + w - rx, y + h).L(x + rx, y + h).A(rx, ry, 0, 0, 1, x, y + h - ry).L(x, y + ry).A(rx, ry, 0, 0, 1, x + rx, y).Z();
  57465. } else {
  57466. this.shape = new SvgShape().M(x, y).L(x + w, y).L(x + w, y + h).L(x, y + h).Z();
  57467. }
  57468. } else {
  57469. this.shape = new SvgShape();
  57470. }
  57471. };
  57472. var SvgElemCircle = function SvgElemCircle(obj, inherits) {
  57473. SvgElemBasicShape.call(this, obj, inherits);
  57474. var cx = this.getLength('cx', this.getVWidth(), 0),
  57475. cy = this.getLength('cy', this.getVHeight(), 0),
  57476. r = this.getLength('r', this.getViewport(), 0);
  57477. if (r > 0) {
  57478. this.shape = new SvgShape().M(cx + r, cy).A(r, r, 0, 0, 1, cx - r, cy).A(r, r, 0, 0, 1, cx + r, cy).Z();
  57479. } else {
  57480. this.shape = new SvgShape();
  57481. }
  57482. };
  57483. var SvgElemEllipse = function SvgElemEllipse(obj, inherits) {
  57484. SvgElemBasicShape.call(this, obj, inherits);
  57485. var cx = this.getLength('cx', this.getVWidth(), 0),
  57486. cy = this.getLength('cy', this.getVHeight(), 0),
  57487. rx = this.getLength('rx', this.getVWidth(), 0),
  57488. ry = this.getLength('ry', this.getVHeight(), 0);
  57489. if (rx > 0 && ry > 0) {
  57490. this.shape = new SvgShape().M(cx + rx, cy).A(rx, ry, 0, 0, 1, cx - rx, cy).A(rx, ry, 0, 0, 1, cx + rx, cy).Z();
  57491. } else {
  57492. this.shape = new SvgShape();
  57493. }
  57494. };
  57495. var SvgElemLine = function SvgElemLine(obj, inherits) {
  57496. SvgElemBasicShape.call(this, obj, inherits);
  57497. var x1 = this.getLength('x1', this.getVWidth(), 0),
  57498. y1 = this.getLength('y1', this.getVHeight(), 0),
  57499. x2 = this.getLength('x2', this.getVWidth(), 0),
  57500. y2 = this.getLength('y2', this.getVHeight(), 0);
  57501. this.shape = new SvgShape().M(x1, y1).L(x2, y2);
  57502. };
  57503. var SvgElemPolyline = function SvgElemPolyline(obj, inherits) {
  57504. SvgElemBasicShape.call(this, obj, inherits);
  57505. var points = this.getNumberList('points');
  57506. this.shape = new SvgShape();
  57507. for (var i = 0; i < points.length - 1; i += 2) {
  57508. if (i === 0) {
  57509. this.shape.M(points[i], points[i + 1]);
  57510. } else {
  57511. this.shape.L(points[i], points[i + 1]);
  57512. }
  57513. }
  57514. if (points.error) {
  57515. warningCallback('SvgElemPolygon: unexpected string ' + points.error);
  57516. }
  57517. if (points.length % 2 === 1) {
  57518. warningCallback('SvgElemPolyline: uneven number of coordinates');
  57519. }
  57520. };
  57521. var SvgElemPolygon = function SvgElemPolygon(obj, inherits) {
  57522. SvgElemBasicShape.call(this, obj, inherits);
  57523. var points = this.getNumberList('points');
  57524. this.shape = new SvgShape();
  57525. for (var i = 0; i < points.length - 1; i += 2) {
  57526. if (i === 0) {
  57527. this.shape.M(points[i], points[i + 1]);
  57528. } else {
  57529. this.shape.L(points[i], points[i + 1]);
  57530. }
  57531. }
  57532. this.shape.Z();
  57533. if (points.error) {
  57534. warningCallback('SvgElemPolygon: unexpected string ' + points.error);
  57535. }
  57536. if (points.length % 2 === 1) {
  57537. warningCallback('SvgElemPolygon: uneven number of coordinates');
  57538. }
  57539. };
  57540. var SvgElemPath = function SvgElemPath(obj, inherits) {
  57541. SvgElemBasicShape.call(this, obj, inherits);
  57542. this.shape = new SvgShape().path(this.attr('d'));
  57543. var pathLength = this.getLength('pathLength', this.getViewport());
  57544. this.pathLength = pathLength > 0 ? pathLength : undefined;
  57545. this.dashScale = this.pathLength !== undefined ? this.shape.totalLength / this.pathLength : 1;
  57546. };
  57547. var SvgElemMarker = function SvgElemMarker(obj, inherits) {
  57548. SvgElemHasChildren.call(this, obj, inherits);
  57549. var width = this.getLength('markerWidth', this.getParentVWidth(), 3),
  57550. height = this.getLength('markerHeight', this.getParentVHeight(), 3),
  57551. viewBox = this.getViewbox('viewBox', [0, 0, width, height]);
  57552. this.getVWidth = function () {
  57553. return viewBox[2];
  57554. };
  57555. this.getVHeight = function () {
  57556. return viewBox[3];
  57557. };
  57558. this.drawMarker = function (isClip, isMask, posArray, strokeWidth) {
  57559. doc.save();
  57560. var orient = this.attr('orient'),
  57561. units = this.attr('markerUnits'),
  57562. rotate = orient === 'auto' ? posArray[2] : (parseFloat(orient) || 0) * Math.PI / 180,
  57563. scale = units === 'userSpaceOnUse' ? 1 : strokeWidth;
  57564. doc.transform(Math.cos(rotate) * scale, Math.sin(rotate) * scale, -Math.sin(rotate) * scale, Math.cos(rotate) * scale, posArray[0], posArray[1]);
  57565. var refX = this.getLength('refX', this.getVWidth(), 0),
  57566. refY = this.getLength('refY', this.getVHeight(), 0),
  57567. aspectRatioMatrix = parseAspectRatio(this.attr('preserveAspectRatio'), width, height, viewBox[2], viewBox[3], 0.5);
  57568. if (this.get('overflow') === 'hidden') {
  57569. doc.rect(aspectRatioMatrix[0] * (viewBox[0] + viewBox[2] / 2 - refX) - width / 2, aspectRatioMatrix[3] * (viewBox[1] + viewBox[3] / 2 - refY) - height / 2, width, height).clip();
  57570. }
  57571. doc.transform.apply(doc, aspectRatioMatrix);
  57572. doc.translate(-refX, -refY);
  57573. var group;
  57574. if (this.get('opacity') < 1 && !isClip) {
  57575. group = docBeginGroup(getPageBBox());
  57576. }
  57577. this.drawChildren(isClip, isMask);
  57578. if (group) {
  57579. docEndGroup(group);
  57580. doc.fillOpacity(this.get('opacity'));
  57581. docInsertGroup(group);
  57582. }
  57583. doc.restore();
  57584. };
  57585. };
  57586. var SvgElemClipPath = function SvgElemClipPath(obj, inherits) {
  57587. SvgElemHasChildren.call(this, obj, inherits);
  57588. this.useMask = function (bBox) {
  57589. var group = docBeginGroup(getPageBBox());
  57590. doc.save();
  57591. if (this.attr('clipPathUnits') === 'objectBoundingBox') {
  57592. doc.transform(bBox[2] - bBox[0], 0, 0, bBox[3] - bBox[1], bBox[0], bBox[1]);
  57593. }
  57594. this.clip();
  57595. this.drawChildren(true, false);
  57596. doc.restore();
  57597. docEndGroup(group);
  57598. docApplyMask(group, true);
  57599. };
  57600. };
  57601. var SvgElemMask = function SvgElemMask(obj, inherits) {
  57602. SvgElemHasChildren.call(this, obj, inherits);
  57603. this.useMask = function (bBox) {
  57604. var group = docBeginGroup(getPageBBox());
  57605. doc.save();
  57606. var x, y, w, h;
  57607. if (this.attr('maskUnits') === 'userSpaceOnUse') {
  57608. x = this.getLength('x', this.getVWidth(), -0.1 * (bBox[2] - bBox[0]) + bBox[0]);
  57609. y = this.getLength('y', this.getVHeight(), -0.1 * (bBox[3] - bBox[1]) + bBox[1]);
  57610. w = this.getLength('width', this.getVWidth(), 1.2 * (bBox[2] - bBox[0]));
  57611. h = this.getLength('height', this.getVHeight(), 1.2 * (bBox[3] - bBox[1]));
  57612. } else {
  57613. x = this.getLength('x', this.getVWidth(), -0.1) * (bBox[2] - bBox[0]) + bBox[0];
  57614. y = this.getLength('y', this.getVHeight(), -0.1) * (bBox[3] - bBox[1]) + bBox[1];
  57615. w = this.getLength('width', this.getVWidth(), 1.2) * (bBox[2] - bBox[0]);
  57616. h = this.getLength('height', this.getVHeight(), 1.2) * (bBox[3] - bBox[1]);
  57617. }
  57618. doc.rect(x, y, w, h).clip();
  57619. if (this.attr('maskContentUnits') === 'objectBoundingBox') {
  57620. doc.transform(bBox[2] - bBox[0], 0, 0, bBox[3] - bBox[1], bBox[0], bBox[1]);
  57621. }
  57622. this.clip();
  57623. this.drawChildren(false, true);
  57624. doc.restore();
  57625. docEndGroup(group);
  57626. docApplyMask(group, true);
  57627. };
  57628. };
  57629. var SvgElemTextContainer = function SvgElemTextContainer(obj, inherits) {
  57630. SvgElemStylable.call(this, obj, inherits);
  57631. this.allowedChildren = ['tspan', '#text', '#cdata-section', 'a'];
  57632. this.isText = true;
  57633. this.getBoundingShape = function () {
  57634. var shape = new SvgShape();
  57635. for (var i = 0; i < this._pos.length; i++) {
  57636. var pos = this._pos[i];
  57637. if (!pos.hidden) {
  57638. var dx0 = pos.ascent * Math.sin(pos.rotate),
  57639. dy0 = -pos.ascent * Math.cos(pos.rotate),
  57640. dx1 = pos.descent * Math.sin(pos.rotate),
  57641. dy1 = -pos.descent * Math.cos(pos.rotate),
  57642. dx2 = pos.width * Math.cos(pos.rotate),
  57643. dy2 = pos.width * Math.sin(pos.rotate);
  57644. shape.M(pos.x + dx0, pos.y + dy0).L(pos.x + dx0 + dx2, pos.y + dy0 + dy2).M(pos.x + dx1 + dx2, pos.y + dy1 + dy2).L(pos.x + dx1, pos.y + dy1);
  57645. }
  57646. }
  57647. return shape;
  57648. };
  57649. this.drawTextInDocument = function (isClip, isMask) {
  57650. if (this.link && !isClip && !isMask) {
  57651. this.addLink();
  57652. }
  57653. if (this.get('text-decoration') === 'underline') {
  57654. this.decorate(0.05 * this._font.size, -0.075 * this._font.size, isClip, isMask);
  57655. }
  57656. if (this.get('text-decoration') === 'overline') {
  57657. this.decorate(0.05 * this._font.size, getAscent(this._font.font, this._font.size) + 0.075 * this._font.size, isClip, isMask);
  57658. }
  57659. var fill = this.getFill(isClip, isMask),
  57660. stroke = this.getStroke(isClip, isMask),
  57661. strokeWidth = this.get('stroke-width');
  57662. if (this._font.fauxBold) {
  57663. if (!stroke) {
  57664. stroke = fill;
  57665. strokeWidth = this._font.size * 0.03;
  57666. } else {
  57667. strokeWidth += this._font.size * 0.03;
  57668. }
  57669. }
  57670. var children = this.getChildren();
  57671. for (var i = 0; i < children.length; i++) {
  57672. var childElem = children[i];
  57673. switch (childElem.name) {
  57674. case 'tspan':
  57675. case 'textPath':
  57676. case 'a':
  57677. if (childElem.get('display') !== 'none') {
  57678. childElem.drawTextInDocument(isClip, isMask);
  57679. }
  57680. break;
  57681. case '#text':
  57682. case '#cdata-section':
  57683. if (this.get('visibility') === 'hidden') {
  57684. continue;
  57685. }
  57686. if (fill || stroke || isClip) {
  57687. if (fill) {
  57688. docFillColor(fill);
  57689. }
  57690. if (stroke && strokeWidth) {
  57691. docStrokeColor(stroke);
  57692. doc.lineWidth(strokeWidth).miterLimit(this.get('stroke-miterlimit')).lineJoin(this.get('stroke-linejoin')).lineCap(this.get('stroke-linecap')).dash(this.get('stroke-dasharray'), {
  57693. phase: this.get('stroke-dashoffset')
  57694. });
  57695. }
  57696. docBeginText(this._font.font, this._font.size);
  57697. docSetTextMode(!!fill, !!stroke);
  57698. for (var j = 0, pos = childElem._pos; j < pos.length; j++) {
  57699. if (!pos[j].hidden && isNotEqual(pos[j].width, 0)) {
  57700. var cos = Math.cos(pos[j].rotate),
  57701. sin = Math.sin(pos[j].rotate),
  57702. skew = this._font.fauxItalic ? -0.25 : 0;
  57703. docSetTextMatrix(cos * pos[j].scale, sin * pos[j].scale, cos * skew - sin, sin * skew + cos, pos[j].x, pos[j].y);
  57704. docWriteGlyph(pos[j].glyph);
  57705. }
  57706. }
  57707. docEndText();
  57708. }
  57709. break;
  57710. }
  57711. }
  57712. if (this.get('text-decoration') === 'line-through') {
  57713. this.decorate(0.05 * this._font.size, 0.5 * (getAscent(this._font.font, this._font.size) + getDescent(this._font.font, this._font.size)), isClip, isMask);
  57714. }
  57715. };
  57716. this.decorate = function (lineWidth, linePosition, isClip, isMask) {
  57717. var fill = this.getFill(isClip, isMask),
  57718. stroke = this.getStroke(isClip, isMask);
  57719. if (fill) {
  57720. docFillColor(fill);
  57721. }
  57722. if (stroke) {
  57723. docStrokeColor(stroke);
  57724. doc.lineWidth(this.get('stroke-width')).miterLimit(this.get('stroke-miterlimit')).lineJoin(this.get('stroke-linejoin')).lineCap(this.get('stroke-linecap')).dash(this.get('stroke-dasharray'), {
  57725. phase: this.get('stroke-dashoffset')
  57726. });
  57727. }
  57728. for (var j = 0, pos = this._pos; j < pos.length; j++) {
  57729. if (!pos[j].hidden && isNotEqual(pos[j].width, 0)) {
  57730. var dx0 = (linePosition + lineWidth / 2) * Math.sin(pos[j].rotate),
  57731. dy0 = -(linePosition + lineWidth / 2) * Math.cos(pos[j].rotate),
  57732. dx1 = (linePosition - lineWidth / 2) * Math.sin(pos[j].rotate),
  57733. dy1 = -(linePosition - lineWidth / 2) * Math.cos(pos[j].rotate),
  57734. dx2 = pos[j].width * Math.cos(pos[j].rotate),
  57735. dy2 = pos[j].width * Math.sin(pos[j].rotate);
  57736. new SvgShape().M(pos[j].x + dx0, pos[j].y + dy0).L(pos[j].x + dx0 + dx2, pos[j].y + dy0 + dy2).L(pos[j].x + dx1 + dx2, pos[j].y + dy1 + dy2).L(pos[j].x + dx1, pos[j].y + dy1).Z().insertInDocument();
  57737. if (fill && stroke) {
  57738. doc.fillAndStroke();
  57739. } else if (fill) {
  57740. doc.fill();
  57741. } else if (stroke) {
  57742. doc.stroke();
  57743. }
  57744. }
  57745. }
  57746. };
  57747. };
  57748. var SvgElemTextNode = function SvgElemTextNode(obj, inherits) {
  57749. this.name = obj.nodeName;
  57750. this.textContent = obj.nodeValue;
  57751. };
  57752. var SvgElemTspan = function SvgElemTspan(obj, inherits) {
  57753. SvgElemTextContainer.call(this, obj, inherits);
  57754. };
  57755. var SvgElemTextPath = function SvgElemTextPath(obj, inherits) {
  57756. SvgElemTextContainer.call(this, obj, inherits);
  57757. var pathObject, pathLength, temp;
  57758. if ((temp = this.attr('path')) && temp.trim() !== '') {
  57759. var _pathLength = this.getLength('pathLength', this.getViewport());
  57760. this.pathObject = new SvgShape().path(temp);
  57761. this.pathLength = _pathLength > 0 ? _pathLength : this.pathObject.totalLength;
  57762. this.pathScale = this.pathObject.totalLength / this.pathLength;
  57763. } else if ((temp = this.getUrl('href') || this.getUrl('xlink:href')) && temp.nodeName === 'path') {
  57764. var pathElem = new SvgElemPath(temp, this);
  57765. this.pathObject = pathElem.shape.clone().transform(pathElem.get('transform'));
  57766. this.pathLength = this.chooseValue(pathElem.pathLength, this.pathObject.totalLength);
  57767. this.pathScale = this.pathObject.totalLength / this.pathLength;
  57768. }
  57769. };
  57770. var SvgElemText = function SvgElemText(obj, inherits) {
  57771. SvgElemTextContainer.call(this, obj, inherits);
  57772. this.allowedChildren = ['textPath', 'tspan', '#text', '#cdata-section', 'a'];
  57773. (function (textParentElem) {
  57774. var processedText = '',
  57775. remainingText = obj.textContent,
  57776. textPaths = [],
  57777. currentChunk = [],
  57778. currentAnchor,
  57779. currentDirection,
  57780. currentX = 0,
  57781. currentY = 0;
  57782. function doAnchoring() {
  57783. if (currentChunk.length) {
  57784. var last = currentChunk[currentChunk.length - 1];
  57785. var first = currentChunk[0];
  57786. var width = last.x + last.width - first.x;
  57787. var anchordx = {
  57788. 'startltr': 0,
  57789. 'middleltr': 0.5,
  57790. 'endltr': 1,
  57791. 'startrtl': 1,
  57792. 'middlertl': 0.5,
  57793. 'endrtl': 0
  57794. }[currentAnchor + currentDirection] * width || 0;
  57795. for (var i = 0; i < currentChunk.length; i++) {
  57796. currentChunk[i].x -= anchordx;
  57797. }
  57798. }
  57799. currentChunk = [];
  57800. }
  57801. function adjustLength(pos, length, spacingAndGlyphs) {
  57802. var firstChar = pos[0],
  57803. lastChar = pos[pos.length - 1],
  57804. startX = firstChar.x,
  57805. endX = lastChar.x + lastChar.width;
  57806. if (spacingAndGlyphs) {
  57807. var textScale = length / (endX - startX);
  57808. if (textScale > 0 && textScale < Infinity) {
  57809. for (var j = 0; j < pos.length; j++) {
  57810. pos[j].x = startX + textScale * (pos[j].x - startX);
  57811. pos[j].scale *= textScale;
  57812. pos[j].width *= textScale;
  57813. }
  57814. }
  57815. } else {
  57816. if (pos.length >= 2) {
  57817. var spaceDiff = (length - (endX - startX)) / (pos.length - 1);
  57818. for (var _j4 = 0; _j4 < pos.length; _j4++) {
  57819. pos[_j4].x += _j4 * spaceDiff;
  57820. }
  57821. }
  57822. }
  57823. currentX += length - (endX - startX);
  57824. }
  57825. function recursive(currentElem, parentElem) {
  57826. currentElem._x = combineArrays(currentElem.getLengthList('x', currentElem.getVWidth()), parentElem ? parentElem._x.slice(parentElem._pos.length) : []);
  57827. currentElem._y = combineArrays(currentElem.getLengthList('y', currentElem.getVHeight()), parentElem ? parentElem._y.slice(parentElem._pos.length) : []);
  57828. currentElem._dx = combineArrays(currentElem.getLengthList('dx', currentElem.getVWidth()), parentElem ? parentElem._dx.slice(parentElem._pos.length) : []);
  57829. currentElem._dy = combineArrays(currentElem.getLengthList('dy', currentElem.getVHeight()), parentElem ? parentElem._dy.slice(parentElem._pos.length) : []);
  57830. currentElem._rot = combineArrays(currentElem.getNumberList('rotate'), parentElem ? parentElem._rot.slice(parentElem._pos.length) : []);
  57831. currentElem._defRot = currentElem.chooseValue(currentElem._rot[currentElem._rot.length - 1], parentElem && parentElem._defRot, 0);
  57832. if (currentElem.name === 'textPath') {
  57833. currentElem._y = [];
  57834. }
  57835. var fontOptions = {
  57836. fauxItalic: false,
  57837. fauxBold: false
  57838. },
  57839. fontNameorLink = fontCallback(currentElem.get('font-family'), currentElem.get('font-weight') === 'bold', currentElem.get('font-style') === 'italic', fontOptions);
  57840. try {
  57841. doc.font(fontNameorLink);
  57842. } catch (e) {
  57843. warningCallback('SVGElemText: failed to open font "' + fontNameorLink + '" in PDFKit');
  57844. }
  57845. currentElem._pos = [];
  57846. currentElem._index = 0;
  57847. currentElem._font = {
  57848. font: doc._font,
  57849. size: currentElem.get('font-size'),
  57850. fauxItalic: fontOptions.fauxItalic,
  57851. fauxBold: fontOptions.fauxBold
  57852. };
  57853. var textLength = currentElem.getLength('textLength', currentElem.getVWidth(), undefined),
  57854. spacingAndGlyphs = currentElem.attr('lengthAdjust') === 'spacingAndGlyphs',
  57855. wordSpacing = currentElem.get('word-spacing'),
  57856. letterSpacing = currentElem.get('letter-spacing'),
  57857. textAnchor = currentElem.get('text-anchor'),
  57858. textDirection = currentElem.get('direction'),
  57859. baseline = getBaseline(currentElem._font.font, currentElem._font.size, currentElem.get('alignment-baseline') || currentElem.get('dominant-baseline'), currentElem.get('baseline-shift'));
  57860. if (currentElem.name === 'textPath') {
  57861. doAnchoring();
  57862. currentX = currentY = 0;
  57863. }
  57864. var children = currentElem.getChildren();
  57865. for (var i = 0; i < children.length; i++) {
  57866. var childElem = children[i];
  57867. switch (childElem.name) {
  57868. case 'tspan':
  57869. case 'textPath':
  57870. case 'a':
  57871. recursive(childElem, currentElem);
  57872. break;
  57873. case '#text':
  57874. case '#cdata-section':
  57875. var rawText = childElem.textContent,
  57876. renderedText = rawText,
  57877. words = void 0;
  57878. childElem._font = currentElem._font;
  57879. childElem._pos = [];
  57880. remainingText = remainingText.substring(rawText.length);
  57881. if (currentElem.get('xml:space') === 'preserve') {
  57882. renderedText = renderedText.replace(/[\s]/g, ' ');
  57883. } else {
  57884. renderedText = renderedText.replace(/[\s]+/g, ' ');
  57885. if (processedText.match(/[\s]$|^$/)) {
  57886. renderedText = renderedText.replace(/^[\s]/, '');
  57887. }
  57888. if (remainingText.match(/^[\s]*$/)) {
  57889. renderedText = renderedText.replace(/[\s]$/, '');
  57890. }
  57891. }
  57892. processedText += rawText;
  57893. if (wordSpacing === 0) {
  57894. words = [renderedText];
  57895. } else {
  57896. words = renderedText.split(/(\s)/);
  57897. }
  57898. for (var w = 0; w < words.length; w++) {
  57899. var pos = getTextPos(currentElem._font.font, currentElem._font.size, words[w]);
  57900. for (var j = 0; j < pos.length; j++) {
  57901. var index = currentElem._index,
  57902. xAttr = currentElem._x[index],
  57903. yAttr = currentElem._y[index],
  57904. dxAttr = currentElem._dx[index],
  57905. dyAttr = currentElem._dy[index],
  57906. rotAttr = currentElem._rot[index],
  57907. continuous = !(w === 0 && j === 0);
  57908. if (xAttr !== undefined) {
  57909. continuous = false;
  57910. doAnchoring();
  57911. currentX = xAttr;
  57912. }
  57913. if (yAttr !== undefined) {
  57914. continuous = false;
  57915. doAnchoring();
  57916. currentY = yAttr;
  57917. }
  57918. if (dxAttr !== undefined) {
  57919. continuous = false;
  57920. currentX += dxAttr;
  57921. }
  57922. if (dyAttr !== undefined) {
  57923. continuous = false;
  57924. currentY += dyAttr;
  57925. }
  57926. if (rotAttr !== undefined || currentElem._defRot !== 0) {
  57927. continuous = false;
  57928. }
  57929. var position = {
  57930. glyph: pos[j].glyph,
  57931. rotate: Math.PI / 180 * currentElem.chooseValue(rotAttr, currentElem._defRot),
  57932. x: currentX + pos[j].xOffset,
  57933. y: currentY + baseline + pos[j].yOffset,
  57934. width: pos[j].width,
  57935. ascent: getAscent(currentElem._font.font, currentElem._font.size),
  57936. descent: getDescent(currentElem._font.font, currentElem._font.size),
  57937. scale: 1,
  57938. hidden: false,
  57939. continuous: continuous
  57940. };
  57941. currentChunk.push(position);
  57942. childElem._pos.push(position);
  57943. currentElem._pos.push(position);
  57944. currentElem._index += pos[j].unicode.length;
  57945. if (currentChunk.length === 1) {
  57946. currentAnchor = textAnchor;
  57947. currentDirection = textDirection;
  57948. }
  57949. currentX += pos[j].xAdvance + letterSpacing;
  57950. currentY += pos[j].yAdvance;
  57951. }
  57952. if (words[w] === ' ') {
  57953. currentX += wordSpacing;
  57954. }
  57955. }
  57956. break;
  57957. default:
  57958. remainingText = remainingText.substring(childElem.textContent.length);
  57959. }
  57960. }
  57961. if (textLength && currentElem._pos.length) {
  57962. adjustLength(currentElem._pos, textLength, spacingAndGlyphs);
  57963. }
  57964. if (currentElem.name === 'textPath' || currentElem.name === 'text') {
  57965. doAnchoring();
  57966. }
  57967. if (currentElem.name === 'textPath') {
  57968. textPaths.push(currentElem);
  57969. var pathObject = currentElem.pathObject;
  57970. if (pathObject) {
  57971. currentX = pathObject.endPoint[0];
  57972. currentY = pathObject.endPoint[1];
  57973. }
  57974. }
  57975. if (parentElem) {
  57976. parentElem._pos = parentElem._pos.concat(currentElem._pos);
  57977. parentElem._index += currentElem._index;
  57978. }
  57979. }
  57980. function textOnPath(currentElem) {
  57981. var pathObject = currentElem.pathObject,
  57982. pathLength = currentElem.pathLength,
  57983. pathScale = currentElem.pathScale;
  57984. if (pathObject) {
  57985. var textOffset = currentElem.getLength('startOffset', pathLength, 0);
  57986. for (var j = 0; j < currentElem._pos.length; j++) {
  57987. var charMidX = textOffset + currentElem._pos[j].x + 0.5 * currentElem._pos[j].width;
  57988. if (charMidX > pathLength || charMidX < 0) {
  57989. currentElem._pos[j].hidden = true;
  57990. } else {
  57991. var pointOnPath = pathObject.getPointAtLength(charMidX * pathScale);
  57992. if (isNotEqual(pathScale, 1)) {
  57993. currentElem._pos[j].scale *= pathScale;
  57994. currentElem._pos[j].width *= pathScale;
  57995. }
  57996. currentElem._pos[j].x = pointOnPath[0] - 0.5 * currentElem._pos[j].width * Math.cos(pointOnPath[2]) - currentElem._pos[j].y * Math.sin(pointOnPath[2]);
  57997. currentElem._pos[j].y = pointOnPath[1] - 0.5 * currentElem._pos[j].width * Math.sin(pointOnPath[2]) + currentElem._pos[j].y * Math.cos(pointOnPath[2]);
  57998. currentElem._pos[j].rotate = pointOnPath[2] + currentElem._pos[j].rotate;
  57999. currentElem._pos[j].continuous = false;
  58000. }
  58001. }
  58002. } else {
  58003. for (var _j5 = 0; _j5 < currentElem._pos.length; _j5++) {
  58004. currentElem._pos[_j5].hidden = true;
  58005. }
  58006. }
  58007. }
  58008. recursive(textParentElem, null);
  58009. for (var i = 0; i < textPaths.length; i++) {
  58010. textOnPath(textPaths[i]);
  58011. }
  58012. })(this);
  58013. this.getTransformation = function () {
  58014. return this.get('transform');
  58015. };
  58016. this.drawInDocument = function (isClip, isMask) {
  58017. doc.save();
  58018. this.transform();
  58019. this.clip();
  58020. var masked = this.mask(),
  58021. group;
  58022. if (masked) {
  58023. group = docBeginGroup(getPageBBox());
  58024. }
  58025. this.drawTextInDocument(isClip, isMask);
  58026. if (group) {
  58027. docEndGroup(group);
  58028. docInsertGroup(group);
  58029. }
  58030. doc.restore();
  58031. };
  58032. };
  58033. options = options || {};
  58034. var pxToPt = options.assumePt ? 1 : 72 / 96,
  58035. // 1px = 72/96pt, but only if assumePt is false
  58036. viewportWidth = (options.width || doc.page.width) / pxToPt,
  58037. viewportHeight = (options.height || doc.page.height) / pxToPt,
  58038. preserveAspectRatio = options.preserveAspectRatio || null,
  58039. // default to null so that the attr can override if not passed
  58040. useCSS = options.useCSS && typeof SVGElement !== 'undefined' && svg instanceof SVGElement && typeof getComputedStyle === 'function',
  58041. warningCallback = options.warningCallback,
  58042. fontCallback = options.fontCallback,
  58043. imageCallback = options.imageCallback,
  58044. colorCallback = options.colorCallback,
  58045. documentCallback = options.documentCallback,
  58046. precision = Math.ceil(Math.max(1, options.precision)) || 3,
  58047. groupStack = [],
  58048. documentCache = {},
  58049. links = [],
  58050. styleRules = [];
  58051. if (typeof warningCallback !== 'function') {
  58052. warningCallback = function warningCallback(str) {
  58053. if (typeof console !== undefined && typeof console.warn === 'function') {
  58054. console.warn(str);
  58055. }
  58056. };
  58057. }
  58058. if (typeof fontCallback !== 'function') {
  58059. fontCallback = function fontCallback(family, bold, italic, fontOptions) {
  58060. // Check if the font is already registered in the document
  58061. if (bold && italic) {
  58062. if (doc._registeredFonts.hasOwnProperty(family + '-BoldItalic')) {
  58063. return family + '-BoldItalic';
  58064. } else if (doc._registeredFonts.hasOwnProperty(family + '-Italic')) {
  58065. fontOptions.fauxBold = true;
  58066. return family + '-Italic';
  58067. } else if (doc._registeredFonts.hasOwnProperty(family + '-Bold')) {
  58068. fontOptions.fauxItalic = true;
  58069. return family + '-Bold';
  58070. } else if (doc._registeredFonts.hasOwnProperty(family)) {
  58071. fontOptions.fauxBold = true;
  58072. fontOptions.fauxItalic = true;
  58073. return family;
  58074. }
  58075. }
  58076. if (bold && !italic) {
  58077. if (doc._registeredFonts.hasOwnProperty(family + '-Bold')) {
  58078. return family + '-Bold';
  58079. } else if (doc._registeredFonts.hasOwnProperty(family)) {
  58080. fontOptions.fauxBold = true;
  58081. return family;
  58082. }
  58083. }
  58084. if (!bold && italic) {
  58085. if (doc._registeredFonts.hasOwnProperty(family + '-Italic')) {
  58086. return family + '-Italic';
  58087. } else if (doc._registeredFonts.hasOwnProperty(family)) {
  58088. fontOptions.fauxItalic = true;
  58089. return family;
  58090. }
  58091. }
  58092. if (!bold && !italic) {
  58093. if (doc._registeredFonts.hasOwnProperty(family)) {
  58094. return family;
  58095. }
  58096. } // Use standard fonts as fallback
  58097. if (family.match(/(?:^|,)\s*serif\s*$/)) {
  58098. if (bold && italic) {
  58099. return 'Times-BoldItalic';
  58100. }
  58101. if (bold && !italic) {
  58102. return 'Times-Bold';
  58103. }
  58104. if (!bold && italic) {
  58105. return 'Times-Italic';
  58106. }
  58107. if (!bold && !italic) {
  58108. return 'Times-Roman';
  58109. }
  58110. } else if (family.match(/(?:^|,)\s*monospace\s*$/)) {
  58111. if (bold && italic) {
  58112. return 'Courier-BoldOblique';
  58113. }
  58114. if (bold && !italic) {
  58115. return 'Courier-Bold';
  58116. }
  58117. if (!bold && italic) {
  58118. return 'Courier-Oblique';
  58119. }
  58120. if (!bold && !italic) {
  58121. return 'Courier';
  58122. }
  58123. } else if (family.match(/(?:^|,)\s*sans-serif\s*$/) || true) {
  58124. if (bold && italic) {
  58125. return 'Helvetica-BoldOblique';
  58126. }
  58127. if (bold && !italic) {
  58128. return 'Helvetica-Bold';
  58129. }
  58130. if (!bold && italic) {
  58131. return 'Helvetica-Oblique';
  58132. }
  58133. if (!bold && !italic) {
  58134. return 'Helvetica';
  58135. }
  58136. }
  58137. };
  58138. }
  58139. if (typeof imageCallback !== 'function') {
  58140. imageCallback = function imageCallback(link) {
  58141. return link.replace(/\s+/g, '');
  58142. };
  58143. }
  58144. if (typeof colorCallback !== 'function') {
  58145. colorCallback = null;
  58146. } else {
  58147. for (var color in DefaultColors) {
  58148. var newColor = colorCallback(DefaultColors[color]);
  58149. DefaultColors[color][0] = newColor[0];
  58150. DefaultColors[color][1] = newColor[1];
  58151. }
  58152. }
  58153. if (typeof documentCallback !== 'function') {
  58154. documentCallback = null;
  58155. }
  58156. if (typeof svg === 'string') {
  58157. svg = parseXml(svg);
  58158. }
  58159. if (svg) {
  58160. var styles = svg.getElementsByTagName('style');
  58161. for (var i = 0; i < styles.length; i++) {
  58162. styleRules = styleRules.concat(parseStyleSheet(styles[i].textContent));
  58163. }
  58164. var elem = createSVGElement(svg, null);
  58165. if (typeof elem.drawInDocument === 'function') {
  58166. if (options.useCSS && !useCSS) {
  58167. warningCallback('SVGtoPDF: useCSS option can only be used for SVG *elements* in compatible browsers');
  58168. }
  58169. var savedFillColor = doc._fillColor;
  58170. doc.save().translate(x || 0, y || 0).scale(pxToPt);
  58171. elem.drawInDocument();
  58172. for (var _i8 = 0; _i8 < links.length; _i8++) {
  58173. doc.page.annotations.push(links[_i8]);
  58174. }
  58175. doc.restore();
  58176. doc._fillColor = savedFillColor;
  58177. } else {
  58178. warningCallback('SVGtoPDF: this element can\'t be rendered directly: ' + svg.nodeName);
  58179. }
  58180. } else {
  58181. warningCallback('SVGtoPDF: the input does not look like a valid SVG');
  58182. }
  58183. };
  58184. if ( true && module && typeof module.exports !== 'undefined') {
  58185. module.exports = SVGtoPDF;
  58186. }
  58187. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(457)(module)))
  58188. /***/ }),
  58189. /* 457 */
  58190. /***/ (function(module, exports) {
  58191. module.exports = function(module) {
  58192. if (!module.webpackPolyfill) {
  58193. module.deprecate = function() {};
  58194. module.paths = [];
  58195. // module.parent = undefined by default
  58196. if (!module.children) module.children = [];
  58197. Object.defineProperty(module, "loaded", {
  58198. enumerable: true,
  58199. get: function() {
  58200. return module.l;
  58201. }
  58202. });
  58203. Object.defineProperty(module, "id", {
  58204. enumerable: true,
  58205. get: function() {
  58206. return module.i;
  58207. }
  58208. });
  58209. module.webpackPolyfill = 1;
  58210. }
  58211. return module;
  58212. };
  58213. /***/ })
  58214. /******/ ]);
  58215. });
  58216. //# sourceMappingURL=pdfmake.js.map