main.js 355 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796
  1. /******/ (function(modules) { // webpackBootstrap
  2. /******/ // The module cache
  3. /******/ var installedModules = {};
  4. /******/
  5. /******/ // The require function
  6. /******/ function __webpack_require__(moduleId) {
  7. /******/
  8. /******/ // Check if module is in cache
  9. /******/ if(installedModules[moduleId])
  10. /******/ return installedModules[moduleId].exports;
  11. /******/
  12. /******/ // Create a new module (and put it into the cache)
  13. /******/ var module = installedModules[moduleId] = {
  14. /******/ i: moduleId,
  15. /******/ l: false,
  16. /******/ exports: {}
  17. /******/ };
  18. /******/
  19. /******/ // Execute the module function
  20. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  21. /******/
  22. /******/ // Flag the module as loaded
  23. /******/ module.l = true;
  24. /******/
  25. /******/ // Return the exports of the module
  26. /******/ return module.exports;
  27. /******/ }
  28. /******/
  29. /******/
  30. /******/ // expose the modules object (__webpack_modules__)
  31. /******/ __webpack_require__.m = modules;
  32. /******/
  33. /******/ // expose the module cache
  34. /******/ __webpack_require__.c = installedModules;
  35. /******/
  36. /******/ // identity function for calling harmony imports with the correct context
  37. /******/ __webpack_require__.i = function(value) { return value; };
  38. /******/
  39. /******/ // define getter function for harmony exports
  40. /******/ __webpack_require__.d = function(exports, name, getter) {
  41. /******/ if(!__webpack_require__.o(exports, name)) {
  42. /******/ Object.defineProperty(exports, name, {
  43. /******/ configurable: false,
  44. /******/ enumerable: true,
  45. /******/ get: getter
  46. /******/ });
  47. /******/ }
  48. /******/ };
  49. /******/
  50. /******/ // getDefaultExport function for compatibility with non-harmony modules
  51. /******/ __webpack_require__.n = function(module) {
  52. /******/ var getter = module && module.__esModule ?
  53. /******/ function getDefault() { return module['default']; } :
  54. /******/ function getModuleExports() { return module; };
  55. /******/ __webpack_require__.d(getter, 'a', getter);
  56. /******/ return getter;
  57. /******/ };
  58. /******/
  59. /******/ // Object.prototype.hasOwnProperty.call
  60. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  61. /******/
  62. /******/ // __webpack_public_path__
  63. /******/ __webpack_require__.p = "";
  64. /******/
  65. /******/ // Load entry module and return exports
  66. /******/ return __webpack_require__(__webpack_require__.s = 87);
  67. /******/ })
  68. /************************************************************************/
  69. /******/ ([
  70. /* 0 */
  71. /***/ (function(module, exports, __webpack_require__) {
  72. "use strict";
  73. // Utilities
  74. //
  75. function _class(obj) { return Object.prototype.toString.call(obj); }
  76. function isString(obj) { return _class(obj) === '[object String]'; }
  77. var _hasOwnProperty = Object.prototype.hasOwnProperty;
  78. function has(object, key) {
  79. return _hasOwnProperty.call(object, key);
  80. }
  81. // Merge objects
  82. //
  83. function assign(obj /*from1, from2, from3, ...*/) {
  84. var sources = Array.prototype.slice.call(arguments, 1);
  85. sources.forEach(function (source) {
  86. if (!source) { return; }
  87. if (typeof source !== 'object') {
  88. throw new TypeError(source + 'must be object');
  89. }
  90. Object.keys(source).forEach(function (key) {
  91. obj[key] = source[key];
  92. });
  93. });
  94. return obj;
  95. }
  96. // Remove element from array and put another array at those position.
  97. // Useful for some operations with tokens
  98. function arrayReplaceAt(src, pos, newElements) {
  99. return [].concat(src.slice(0, pos), newElements, src.slice(pos + 1));
  100. }
  101. ////////////////////////////////////////////////////////////////////////////////
  102. function isValidEntityCode(c) {
  103. /*eslint no-bitwise:0*/
  104. // broken sequence
  105. if (c >= 0xD800 && c <= 0xDFFF) { return false; }
  106. // never used
  107. if (c >= 0xFDD0 && c <= 0xFDEF) { return false; }
  108. if ((c & 0xFFFF) === 0xFFFF || (c & 0xFFFF) === 0xFFFE) { return false; }
  109. // control codes
  110. if (c >= 0x00 && c <= 0x08) { return false; }
  111. if (c === 0x0B) { return false; }
  112. if (c >= 0x0E && c <= 0x1F) { return false; }
  113. if (c >= 0x7F && c <= 0x9F) { return false; }
  114. // out of range
  115. if (c > 0x10FFFF) { return false; }
  116. return true;
  117. }
  118. function fromCodePoint(c) {
  119. /*eslint no-bitwise:0*/
  120. if (c > 0xffff) {
  121. c -= 0x10000;
  122. var surrogate1 = 0xd800 + (c >> 10),
  123. surrogate2 = 0xdc00 + (c & 0x3ff);
  124. return String.fromCharCode(surrogate1, surrogate2);
  125. }
  126. return String.fromCharCode(c);
  127. }
  128. var UNESCAPE_MD_RE = /\\([!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~])/g;
  129. var ENTITY_RE = /&([a-z#][a-z0-9]{1,31});/gi;
  130. var UNESCAPE_ALL_RE = new RegExp(UNESCAPE_MD_RE.source + '|' + ENTITY_RE.source, 'gi');
  131. var DIGITAL_ENTITY_TEST_RE = /^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i;
  132. var entities = __webpack_require__(11);
  133. function replaceEntityPattern(match, name) {
  134. var code = 0;
  135. if (has(entities, name)) {
  136. return entities[name];
  137. }
  138. if (name.charCodeAt(0) === 0x23/* # */ && DIGITAL_ENTITY_TEST_RE.test(name)) {
  139. code = name[1].toLowerCase() === 'x' ?
  140. parseInt(name.slice(2), 16)
  141. :
  142. parseInt(name.slice(1), 10);
  143. if (isValidEntityCode(code)) {
  144. return fromCodePoint(code);
  145. }
  146. }
  147. return match;
  148. }
  149. /*function replaceEntities(str) {
  150. if (str.indexOf('&') < 0) { return str; }
  151. return str.replace(ENTITY_RE, replaceEntityPattern);
  152. }*/
  153. function unescapeMd(str) {
  154. if (str.indexOf('\\') < 0) { return str; }
  155. return str.replace(UNESCAPE_MD_RE, '$1');
  156. }
  157. function unescapeAll(str) {
  158. if (str.indexOf('\\') < 0 && str.indexOf('&') < 0) { return str; }
  159. return str.replace(UNESCAPE_ALL_RE, function (match, escaped, entity) {
  160. if (escaped) { return escaped; }
  161. return replaceEntityPattern(match, entity);
  162. });
  163. }
  164. ////////////////////////////////////////////////////////////////////////////////
  165. var HTML_ESCAPE_TEST_RE = /[&<>"]/;
  166. var HTML_ESCAPE_REPLACE_RE = /[&<>"]/g;
  167. var HTML_REPLACEMENTS = {
  168. '&': '&amp;',
  169. '<': '&lt;',
  170. '>': '&gt;',
  171. '"': '&quot;'
  172. };
  173. function replaceUnsafeChar(ch) {
  174. return HTML_REPLACEMENTS[ch];
  175. }
  176. function escapeHtml(str) {
  177. if (HTML_ESCAPE_TEST_RE.test(str)) {
  178. return str.replace(HTML_ESCAPE_REPLACE_RE, replaceUnsafeChar);
  179. }
  180. return str;
  181. }
  182. ////////////////////////////////////////////////////////////////////////////////
  183. var REGEXP_ESCAPE_RE = /[.?*+^$[\]\\(){}|-]/g;
  184. function escapeRE(str) {
  185. return str.replace(REGEXP_ESCAPE_RE, '\\$&');
  186. }
  187. ////////////////////////////////////////////////////////////////////////////////
  188. function isSpace(code) {
  189. switch (code) {
  190. case 0x09:
  191. case 0x20:
  192. return true;
  193. }
  194. return false;
  195. }
  196. // Zs (unicode class) || [\t\f\v\r\n]
  197. function isWhiteSpace(code) {
  198. if (code >= 0x2000 && code <= 0x200A) { return true; }
  199. switch (code) {
  200. case 0x09: // \t
  201. case 0x0A: // \n
  202. case 0x0B: // \v
  203. case 0x0C: // \f
  204. case 0x0D: // \r
  205. case 0x20:
  206. case 0xA0:
  207. case 0x1680:
  208. case 0x202F:
  209. case 0x205F:
  210. case 0x3000:
  211. return true;
  212. }
  213. return false;
  214. }
  215. ////////////////////////////////////////////////////////////////////////////////
  216. /*eslint-disable max-len*/
  217. var UNICODE_PUNCT_RE = __webpack_require__(5);
  218. // Currently without astral characters support.
  219. function isPunctChar(ch) {
  220. return UNICODE_PUNCT_RE.test(ch);
  221. }
  222. // Markdown ASCII punctuation characters.
  223. //
  224. // !, ", #, $, %, &, ', (, ), *, +, ,, -, ., /, :, ;, <, =, >, ?, @, [, \, ], ^, _, `, {, |, }, or ~
  225. // http://spec.commonmark.org/0.15/#ascii-punctuation-character
  226. //
  227. // Don't confuse with unicode punctuation !!! It lacks some chars in ascii range.
  228. //
  229. function isMdAsciiPunct(ch) {
  230. switch (ch) {
  231. case 0x21/* ! */:
  232. case 0x22/* " */:
  233. case 0x23/* # */:
  234. case 0x24/* $ */:
  235. case 0x25/* % */:
  236. case 0x26/* & */:
  237. case 0x27/* ' */:
  238. case 0x28/* ( */:
  239. case 0x29/* ) */:
  240. case 0x2A/* * */:
  241. case 0x2B/* + */:
  242. case 0x2C/* , */:
  243. case 0x2D/* - */:
  244. case 0x2E/* . */:
  245. case 0x2F/* / */:
  246. case 0x3A/* : */:
  247. case 0x3B/* ; */:
  248. case 0x3C/* < */:
  249. case 0x3D/* = */:
  250. case 0x3E/* > */:
  251. case 0x3F/* ? */:
  252. case 0x40/* @ */:
  253. case 0x5B/* [ */:
  254. case 0x5C/* \ */:
  255. case 0x5D/* ] */:
  256. case 0x5E/* ^ */:
  257. case 0x5F/* _ */:
  258. case 0x60/* ` */:
  259. case 0x7B/* { */:
  260. case 0x7C/* | */:
  261. case 0x7D/* } */:
  262. case 0x7E/* ~ */:
  263. return true;
  264. default:
  265. return false;
  266. }
  267. }
  268. // Hepler to unify [reference labels].
  269. //
  270. function normalizeReference(str) {
  271. // use .toUpperCase() instead of .toLowerCase()
  272. // here to avoid a conflict with Object.prototype
  273. // members (most notably, `__proto__`)
  274. return str.trim().replace(/\s+/g, ' ').toUpperCase();
  275. }
  276. ////////////////////////////////////////////////////////////////////////////////
  277. // Re-export libraries commonly used in both markdown-it and its plugins,
  278. // so plugins won't have to depend on them explicitly, which reduces their
  279. // bundled size (e.g. a browser build).
  280. //
  281. exports.lib = {};
  282. exports.lib.mdurl = __webpack_require__(15);
  283. exports.lib.ucmicro = __webpack_require__(85);
  284. exports.assign = assign;
  285. exports.isString = isString;
  286. exports.has = has;
  287. exports.unescapeMd = unescapeMd;
  288. exports.unescapeAll = unescapeAll;
  289. exports.isValidEntityCode = isValidEntityCode;
  290. exports.fromCodePoint = fromCodePoint;
  291. // exports.replaceEntities = replaceEntities;
  292. exports.escapeHtml = escapeHtml;
  293. exports.arrayReplaceAt = arrayReplaceAt;
  294. exports.isSpace = isSpace;
  295. exports.isWhiteSpace = isWhiteSpace;
  296. exports.isMdAsciiPunct = isMdAsciiPunct;
  297. exports.isPunctChar = isPunctChar;
  298. exports.escapeRE = escapeRE;
  299. exports.normalizeReference = normalizeReference;
  300. /***/ }),
  301. /* 1 */
  302. /***/ (function(module, exports, __webpack_require__) {
  303. /* WEBPACK VAR INJECTION */(function(setImmediate, global) {;(function() {
  304. "use strict"
  305. function Vnode(tag, key, attrs0, children, text, dom) {
  306. return {tag: tag, key: key, attrs: attrs0, children: children, text: text, dom: dom, domSize: undefined, state: undefined, _state: undefined, events: undefined, instance: undefined, skip: false}
  307. }
  308. Vnode.normalize = function(node) {
  309. if (Array.isArray(node)) return Vnode("[", undefined, undefined, Vnode.normalizeChildren(node), undefined, undefined)
  310. if (node != null && typeof node !== "object") return Vnode("#", undefined, undefined, node === false ? "" : node, undefined, undefined)
  311. return node
  312. }
  313. Vnode.normalizeChildren = function normalizeChildren(children) {
  314. for (var i = 0; i < children.length; i++) {
  315. children[i] = Vnode.normalize(children[i])
  316. }
  317. return children
  318. }
  319. var selectorParser = /(?:(^|#|\.)([^#\.\[\]]+))|(\[(.+?)(?:\s*=\s*("|'|)((?:\\["'\]]|.)*?)\5)?\])/g
  320. var selectorCache = {}
  321. var hasOwn = {}.hasOwnProperty
  322. function compileSelector(selector) {
  323. var match, tag = "div", classes = [], attrs = {}
  324. while (match = selectorParser.exec(selector)) {
  325. var type = match[1], value = match[2]
  326. if (type === "" && value !== "") tag = value
  327. else if (type === "#") attrs.id = value
  328. else if (type === ".") classes.push(value)
  329. else if (match[3][0] === "[") {
  330. var attrValue = match[6]
  331. if (attrValue) attrValue = attrValue.replace(/\\(["'])/g, "$1").replace(/\\\\/g, "\\")
  332. if (match[4] === "class") classes.push(attrValue)
  333. else attrs[match[4]] = attrValue || true
  334. }
  335. }
  336. if (classes.length > 0) attrs.className = classes.join(" ")
  337. return selectorCache[selector] = {tag: tag, attrs: attrs}
  338. }
  339. function execSelector(state, attrs, children) {
  340. var hasAttrs = false, childList, text
  341. var className = attrs.className || attrs.class
  342. for (var key in state.attrs) {
  343. if (hasOwn.call(state.attrs, key)) {
  344. attrs[key] = state.attrs[key]
  345. }
  346. }
  347. if (className !== undefined) {
  348. if (attrs.class !== undefined) {
  349. attrs.class = undefined
  350. attrs.className = className
  351. }
  352. if (state.attrs.className != null) {
  353. attrs.className = state.attrs.className + " " + className
  354. }
  355. }
  356. for (var key in attrs) {
  357. if (hasOwn.call(attrs, key) && key !== "key") {
  358. hasAttrs = true
  359. break
  360. }
  361. }
  362. if (Array.isArray(children) && children.length === 1 && children[0] != null && children[0].tag === "#") {
  363. text = children[0].children
  364. } else {
  365. childList = children
  366. }
  367. return Vnode(state.tag, attrs.key, hasAttrs ? attrs : undefined, childList, text)
  368. }
  369. function hyperscript(selector) {
  370. // Because sloppy mode sucks
  371. var attrs = arguments[1], start = 2, children
  372. if (selector == null || typeof selector !== "string" && typeof selector !== "function" && typeof selector.view !== "function") {
  373. throw Error("The selector must be either a string or a component.");
  374. }
  375. if (typeof selector === "string") {
  376. var cached = selectorCache[selector] || compileSelector(selector)
  377. }
  378. if (attrs == null) {
  379. attrs = {}
  380. } else if (typeof attrs !== "object" || attrs.tag != null || Array.isArray(attrs)) {
  381. attrs = {}
  382. start = 1
  383. }
  384. if (arguments.length === start + 1) {
  385. children = arguments[start]
  386. if (!Array.isArray(children)) children = [children]
  387. } else {
  388. children = []
  389. while (start < arguments.length) children.push(arguments[start++])
  390. }
  391. var normalized = Vnode.normalizeChildren(children)
  392. if (typeof selector === "string") {
  393. return execSelector(cached, attrs, normalized)
  394. } else {
  395. return Vnode(selector, attrs.key, attrs, normalized)
  396. }
  397. }
  398. hyperscript.trust = function(html) {
  399. if (html == null) html = ""
  400. return Vnode("<", undefined, undefined, html, undefined, undefined)
  401. }
  402. hyperscript.fragment = function(attrs1, children) {
  403. return Vnode("[", attrs1.key, attrs1, Vnode.normalizeChildren(children), undefined, undefined)
  404. }
  405. var m = hyperscript
  406. /** @constructor */
  407. var PromisePolyfill = function(executor) {
  408. if (!(this instanceof PromisePolyfill)) throw new Error("Promise must be called with `new`")
  409. if (typeof executor !== "function") throw new TypeError("executor must be a function")
  410. var self = this, resolvers = [], rejectors = [], resolveCurrent = handler(resolvers, true), rejectCurrent = handler(rejectors, false)
  411. var instance = self._instance = {resolvers: resolvers, rejectors: rejectors}
  412. var callAsync = typeof setImmediate === "function" ? setImmediate : setTimeout
  413. function handler(list, shouldAbsorb) {
  414. return function execute(value) {
  415. var then
  416. try {
  417. if (shouldAbsorb && value != null && (typeof value === "object" || typeof value === "function") && typeof (then = value.then) === "function") {
  418. if (value === self) throw new TypeError("Promise can't be resolved w/ itself")
  419. executeOnce(then.bind(value))
  420. }
  421. else {
  422. callAsync(function() {
  423. if (!shouldAbsorb && list.length === 0) console.error("Possible unhandled promise rejection:", value)
  424. for (var i = 0; i < list.length; i++) list[i](value)
  425. resolvers.length = 0, rejectors.length = 0
  426. instance.state = shouldAbsorb
  427. instance.retry = function() {execute(value)}
  428. })
  429. }
  430. }
  431. catch (e) {
  432. rejectCurrent(e)
  433. }
  434. }
  435. }
  436. function executeOnce(then) {
  437. var runs = 0
  438. function run(fn) {
  439. return function(value) {
  440. if (runs++ > 0) return
  441. fn(value)
  442. }
  443. }
  444. var onerror = run(rejectCurrent)
  445. try {then(run(resolveCurrent), onerror)} catch (e) {onerror(e)}
  446. }
  447. executeOnce(executor)
  448. }
  449. PromisePolyfill.prototype.then = function(onFulfilled, onRejection) {
  450. var self = this, instance = self._instance
  451. function handle(callback, list, next, state) {
  452. list.push(function(value) {
  453. if (typeof callback !== "function") next(value)
  454. else try {resolveNext(callback(value))} catch (e) {if (rejectNext) rejectNext(e)}
  455. })
  456. if (typeof instance.retry === "function" && state === instance.state) instance.retry()
  457. }
  458. var resolveNext, rejectNext
  459. var promise = new PromisePolyfill(function(resolve, reject) {resolveNext = resolve, rejectNext = reject})
  460. handle(onFulfilled, instance.resolvers, resolveNext, true), handle(onRejection, instance.rejectors, rejectNext, false)
  461. return promise
  462. }
  463. PromisePolyfill.prototype.catch = function(onRejection) {
  464. return this.then(null, onRejection)
  465. }
  466. PromisePolyfill.resolve = function(value) {
  467. if (value instanceof PromisePolyfill) return value
  468. return new PromisePolyfill(function(resolve) {resolve(value)})
  469. }
  470. PromisePolyfill.reject = function(value) {
  471. return new PromisePolyfill(function(resolve, reject) {reject(value)})
  472. }
  473. PromisePolyfill.all = function(list) {
  474. return new PromisePolyfill(function(resolve, reject) {
  475. var total = list.length, count = 0, values = []
  476. if (list.length === 0) resolve([])
  477. else for (var i = 0; i < list.length; i++) {
  478. (function(i) {
  479. function consume(value) {
  480. count++
  481. values[i] = value
  482. if (count === total) resolve(values)
  483. }
  484. if (list[i] != null && (typeof list[i] === "object" || typeof list[i] === "function") && typeof list[i].then === "function") {
  485. list[i].then(consume, reject)
  486. }
  487. else consume(list[i])
  488. })(i)
  489. }
  490. })
  491. }
  492. PromisePolyfill.race = function(list) {
  493. return new PromisePolyfill(function(resolve, reject) {
  494. for (var i = 0; i < list.length; i++) {
  495. list[i].then(resolve, reject)
  496. }
  497. })
  498. }
  499. if (typeof window !== "undefined") {
  500. if (typeof window.Promise === "undefined") window.Promise = PromisePolyfill
  501. var PromisePolyfill = window.Promise
  502. } else if (typeof global !== "undefined") {
  503. if (typeof global.Promise === "undefined") global.Promise = PromisePolyfill
  504. var PromisePolyfill = global.Promise
  505. } else {
  506. }
  507. var buildQueryString = function(object) {
  508. if (Object.prototype.toString.call(object) !== "[object Object]") return ""
  509. var args = []
  510. for (var key0 in object) {
  511. destructure(key0, object[key0])
  512. }
  513. return args.join("&")
  514. function destructure(key0, value) {
  515. if (Array.isArray(value)) {
  516. for (var i = 0; i < value.length; i++) {
  517. destructure(key0 + "[" + i + "]", value[i])
  518. }
  519. }
  520. else if (Object.prototype.toString.call(value) === "[object Object]") {
  521. for (var i in value) {
  522. destructure(key0 + "[" + i + "]", value[i])
  523. }
  524. }
  525. else args.push(encodeURIComponent(key0) + (value != null && value !== "" ? "=" + encodeURIComponent(value) : ""))
  526. }
  527. }
  528. var FILE_PROTOCOL_REGEX = new RegExp("^file://", "i")
  529. var _8 = function($window, Promise) {
  530. var callbackCount = 0
  531. var oncompletion
  532. function setCompletionCallback(callback) {oncompletion = callback}
  533. function finalizer() {
  534. var count = 0
  535. function complete() {if (--count === 0 && typeof oncompletion === "function") oncompletion()}
  536. return function finalize(promise0) {
  537. var then0 = promise0.then
  538. promise0.then = function() {
  539. count++
  540. var next = then0.apply(promise0, arguments)
  541. next.then(complete, function(e) {
  542. complete()
  543. if (count === 0) throw e
  544. })
  545. return finalize(next)
  546. }
  547. return promise0
  548. }
  549. }
  550. function normalize(args, extra) {
  551. if (typeof args === "string") {
  552. var url = args
  553. args = extra || {}
  554. if (args.url == null) args.url = url
  555. }
  556. return args
  557. }
  558. function request(args, extra) {
  559. var finalize = finalizer()
  560. args = normalize(args, extra)
  561. var promise0 = new Promise(function(resolve, reject) {
  562. if (args.method == null) args.method = "GET"
  563. args.method = args.method.toUpperCase()
  564. var useBody = (args.method === "GET" || args.method === "TRACE") ? false : (typeof args.useBody === "boolean" ? args.useBody : true)
  565. if (typeof args.serialize !== "function") args.serialize = typeof FormData !== "undefined" && args.data instanceof FormData ? function(value) {return value} : JSON.stringify
  566. if (typeof args.deserialize !== "function") args.deserialize = deserialize
  567. if (typeof args.extract !== "function") args.extract = extract
  568. args.url = interpolate(args.url, args.data)
  569. if (useBody) args.data = args.serialize(args.data)
  570. else args.url = assemble(args.url, args.data)
  571. var xhr = new $window.XMLHttpRequest(),
  572. aborted = false,
  573. _abort = xhr.abort
  574. xhr.abort = function abort() {
  575. aborted = true
  576. _abort.call(xhr)
  577. }
  578. xhr.open(args.method, args.url, typeof args.async === "boolean" ? args.async : true, typeof args.user === "string" ? args.user : undefined, typeof args.password === "string" ? args.password : undefined)
  579. if (args.serialize === JSON.stringify && useBody) {
  580. xhr.setRequestHeader("Content-Type", "application/json; charset=utf-8")
  581. }
  582. if (args.deserialize === deserialize) {
  583. xhr.setRequestHeader("Accept", "application/json, text/*")
  584. }
  585. if (args.withCredentials) xhr.withCredentials = args.withCredentials
  586. for (var key in args.headers) if ({}.hasOwnProperty.call(args.headers, key)) {
  587. xhr.setRequestHeader(key, args.headers[key])
  588. }
  589. if (typeof args.config === "function") xhr = args.config(xhr, args) || xhr
  590. xhr.onreadystatechange = function() {
  591. // Don't throw errors on xhr.abort().
  592. if(aborted) return
  593. if (xhr.readyState === 4) {
  594. try {
  595. var response = (args.extract !== extract) ? args.extract(xhr, args) : args.deserialize(args.extract(xhr, args))
  596. if ((xhr.status >= 200 && xhr.status < 300) || xhr.status === 304 || FILE_PROTOCOL_REGEX.test(args.url)) {
  597. resolve(cast(args.type, response))
  598. }
  599. else {
  600. var error = new Error(xhr.responseText)
  601. for (var key in response) error[key] = response[key]
  602. reject(error)
  603. }
  604. }
  605. catch (e) {
  606. reject(e)
  607. }
  608. }
  609. }
  610. if (useBody && (args.data != null)) xhr.send(args.data)
  611. else xhr.send()
  612. })
  613. return args.background === true ? promise0 : finalize(promise0)
  614. }
  615. function jsonp(args, extra) {
  616. var finalize = finalizer()
  617. args = normalize(args, extra)
  618. var promise0 = new Promise(function(resolve, reject) {
  619. var callbackName = args.callbackName || "_mithril_" + Math.round(Math.random() * 1e16) + "_" + callbackCount++
  620. var script = $window.document.createElement("script")
  621. $window[callbackName] = function(data) {
  622. script.parentNode.removeChild(script)
  623. resolve(cast(args.type, data))
  624. delete $window[callbackName]
  625. }
  626. script.onerror = function() {
  627. script.parentNode.removeChild(script)
  628. reject(new Error("JSONP request failed"))
  629. delete $window[callbackName]
  630. }
  631. if (args.data == null) args.data = {}
  632. args.url = interpolate(args.url, args.data)
  633. args.data[args.callbackKey || "callback"] = callbackName
  634. script.src = assemble(args.url, args.data)
  635. $window.document.documentElement.appendChild(script)
  636. })
  637. return args.background === true? promise0 : finalize(promise0)
  638. }
  639. function interpolate(url, data) {
  640. if (data == null) return url
  641. var tokens = url.match(/:[^\/]+/gi) || []
  642. for (var i = 0; i < tokens.length; i++) {
  643. var key = tokens[i].slice(1)
  644. if (data[key] != null) {
  645. url = url.replace(tokens[i], data[key])
  646. }
  647. }
  648. return url
  649. }
  650. function assemble(url, data) {
  651. var querystring = buildQueryString(data)
  652. if (querystring !== "") {
  653. var prefix = url.indexOf("?") < 0 ? "?" : "&"
  654. url += prefix + querystring
  655. }
  656. return url
  657. }
  658. function deserialize(data) {
  659. try {return data !== "" ? JSON.parse(data) : null}
  660. catch (e) {throw new Error(data)}
  661. }
  662. function extract(xhr) {return xhr.responseText}
  663. function cast(type0, data) {
  664. if (typeof type0 === "function") {
  665. if (Array.isArray(data)) {
  666. for (var i = 0; i < data.length; i++) {
  667. data[i] = new type0(data[i])
  668. }
  669. }
  670. else return new type0(data)
  671. }
  672. return data
  673. }
  674. return {request: request, jsonp: jsonp, setCompletionCallback: setCompletionCallback}
  675. }
  676. var requestService = _8(window, PromisePolyfill)
  677. var coreRenderer = function($window) {
  678. var $doc = $window.document
  679. var $emptyFragment = $doc.createDocumentFragment()
  680. var onevent
  681. function setEventCallback(callback) {return onevent = callback}
  682. //create
  683. function createNodes(parent, vnodes, start, end, hooks, nextSibling, ns) {
  684. for (var i = start; i < end; i++) {
  685. var vnode = vnodes[i]
  686. if (vnode != null) {
  687. createNode(parent, vnode, hooks, ns, nextSibling)
  688. }
  689. }
  690. }
  691. function createNode(parent, vnode, hooks, ns, nextSibling) {
  692. var tag = vnode.tag
  693. if (typeof tag === "string") {
  694. vnode.state = {}
  695. if (vnode.attrs != null) initLifecycle(vnode.attrs, vnode, hooks)
  696. switch (tag) {
  697. case "#": return createText(parent, vnode, nextSibling)
  698. case "<": return createHTML(parent, vnode, nextSibling)
  699. case "[": return createFragment(parent, vnode, hooks, ns, nextSibling)
  700. default: return createElement(parent, vnode, hooks, ns, nextSibling)
  701. }
  702. }
  703. else return createComponent(parent, vnode, hooks, ns, nextSibling)
  704. }
  705. function createText(parent, vnode, nextSibling) {
  706. vnode.dom = $doc.createTextNode(vnode.children)
  707. insertNode(parent, vnode.dom, nextSibling)
  708. return vnode.dom
  709. }
  710. function createHTML(parent, vnode, nextSibling) {
  711. var match1 = vnode.children.match(/^\s*?<(\w+)/im) || []
  712. var parent1 = {caption: "table", thead: "table", tbody: "table", tfoot: "table", tr: "tbody", th: "tr", td: "tr", colgroup: "table", col: "colgroup"}[match1[1]] || "div"
  713. var temp = $doc.createElement(parent1)
  714. temp.innerHTML = vnode.children
  715. vnode.dom = temp.firstChild
  716. vnode.domSize = temp.childNodes.length
  717. var fragment = $doc.createDocumentFragment()
  718. var child
  719. while (child = temp.firstChild) {
  720. fragment.appendChild(child)
  721. }
  722. insertNode(parent, fragment, nextSibling)
  723. return fragment
  724. }
  725. function createFragment(parent, vnode, hooks, ns, nextSibling) {
  726. var fragment = $doc.createDocumentFragment()
  727. if (vnode.children != null) {
  728. var children = vnode.children
  729. createNodes(fragment, children, 0, children.length, hooks, null, ns)
  730. }
  731. vnode.dom = fragment.firstChild
  732. vnode.domSize = fragment.childNodes.length
  733. insertNode(parent, fragment, nextSibling)
  734. return fragment
  735. }
  736. function createElement(parent, vnode, hooks, ns, nextSibling) {
  737. var tag = vnode.tag
  738. switch (vnode.tag) {
  739. case "svg": ns = "http://www.w3.org/2000/svg"; break
  740. case "math": ns = "http://www.w3.org/1998/Math/MathML"; break
  741. }
  742. var attrs2 = vnode.attrs
  743. var is = attrs2 && attrs2.is
  744. var element = ns ?
  745. is ? $doc.createElementNS(ns, tag, {is: is}) : $doc.createElementNS(ns, tag) :
  746. is ? $doc.createElement(tag, {is: is}) : $doc.createElement(tag)
  747. vnode.dom = element
  748. if (attrs2 != null) {
  749. setAttrs(vnode, attrs2, ns)
  750. }
  751. insertNode(parent, element, nextSibling)
  752. if (vnode.attrs != null && vnode.attrs.contenteditable != null) {
  753. setContentEditable(vnode)
  754. }
  755. else {
  756. if (vnode.text != null) {
  757. if (vnode.text !== "") element.textContent = vnode.text
  758. else vnode.children = [Vnode("#", undefined, undefined, vnode.text, undefined, undefined)]
  759. }
  760. if (vnode.children != null) {
  761. var children = vnode.children
  762. createNodes(element, children, 0, children.length, hooks, null, ns)
  763. setLateAttrs(vnode)
  764. }
  765. }
  766. return element
  767. }
  768. function initComponent(vnode, hooks) {
  769. var sentinel
  770. if (typeof vnode.tag.view === "function") {
  771. vnode.state = Object.create(vnode.tag)
  772. sentinel = vnode.state.view
  773. if (sentinel.$$reentrantLock$$ != null) return $emptyFragment
  774. sentinel.$$reentrantLock$$ = true
  775. } else {
  776. vnode.state = void 0
  777. sentinel = vnode.tag
  778. if (sentinel.$$reentrantLock$$ != null) return $emptyFragment
  779. sentinel.$$reentrantLock$$ = true
  780. vnode.state = (vnode.tag.prototype != null && typeof vnode.tag.prototype.view === "function") ? new vnode.tag(vnode) : vnode.tag(vnode)
  781. }
  782. vnode._state = vnode.state
  783. if (vnode.attrs != null) initLifecycle(vnode.attrs, vnode, hooks)
  784. initLifecycle(vnode._state, vnode, hooks)
  785. vnode.instance = Vnode.normalize(vnode._state.view.call(vnode.state, vnode))
  786. if (vnode.instance === vnode) throw Error("A view cannot return the vnode it received as argument")
  787. sentinel.$$reentrantLock$$ = null
  788. }
  789. function createComponent(parent, vnode, hooks, ns, nextSibling) {
  790. initComponent(vnode, hooks)
  791. if (vnode.instance != null) {
  792. var element = createNode(parent, vnode.instance, hooks, ns, nextSibling)
  793. vnode.dom = vnode.instance.dom
  794. vnode.domSize = vnode.dom != null ? vnode.instance.domSize : 0
  795. insertNode(parent, element, nextSibling)
  796. return element
  797. }
  798. else {
  799. vnode.domSize = 0
  800. return $emptyFragment
  801. }
  802. }
  803. //update
  804. function updateNodes(parent, old, vnodes, recycling, hooks, nextSibling, ns) {
  805. if (old === vnodes || old == null && vnodes == null) return
  806. else if (old == null) createNodes(parent, vnodes, 0, vnodes.length, hooks, nextSibling, undefined)
  807. else if (vnodes == null) removeNodes(old, 0, old.length, vnodes)
  808. else {
  809. if (old.length === vnodes.length) {
  810. var isUnkeyed = false
  811. for (var i = 0; i < vnodes.length; i++) {
  812. if (vnodes[i] != null && old[i] != null) {
  813. isUnkeyed = vnodes[i].key == null && old[i].key == null
  814. break
  815. }
  816. }
  817. if (isUnkeyed) {
  818. for (var i = 0; i < old.length; i++) {
  819. if (old[i] === vnodes[i]) continue
  820. else if (old[i] == null && vnodes[i] != null) createNode(parent, vnodes[i], hooks, ns, getNextSibling(old, i + 1, nextSibling))
  821. else if (vnodes[i] == null) removeNodes(old, i, i + 1, vnodes)
  822. else updateNode(parent, old[i], vnodes[i], hooks, getNextSibling(old, i + 1, nextSibling), recycling, ns)
  823. }
  824. return
  825. }
  826. }
  827. recycling = recycling || isRecyclable(old, vnodes)
  828. if (recycling) {
  829. var pool = old.pool
  830. old = old.concat(old.pool)
  831. }
  832. var oldStart = 0, start = 0, oldEnd = old.length - 1, end = vnodes.length - 1, map
  833. while (oldEnd >= oldStart && end >= start) {
  834. var o = old[oldStart], v = vnodes[start]
  835. if (o === v && !recycling) oldStart++, start++
  836. else if (o == null) oldStart++
  837. else if (v == null) start++
  838. else if (o.key === v.key) {
  839. var shouldRecycle = (pool != null && oldStart >= old.length - pool.length) || ((pool == null) && recycling)
  840. oldStart++, start++
  841. updateNode(parent, o, v, hooks, getNextSibling(old, oldStart, nextSibling), shouldRecycle, ns)
  842. if (recycling && o.tag === v.tag) insertNode(parent, toFragment(o), nextSibling)
  843. }
  844. else {
  845. var o = old[oldEnd]
  846. if (o === v && !recycling) oldEnd--, start++
  847. else if (o == null) oldEnd--
  848. else if (v == null) start++
  849. else if (o.key === v.key) {
  850. var shouldRecycle = (pool != null && oldEnd >= old.length - pool.length) || ((pool == null) && recycling)
  851. updateNode(parent, o, v, hooks, getNextSibling(old, oldEnd + 1, nextSibling), shouldRecycle, ns)
  852. if (recycling || start < end) insertNode(parent, toFragment(o), getNextSibling(old, oldStart, nextSibling))
  853. oldEnd--, start++
  854. }
  855. else break
  856. }
  857. }
  858. while (oldEnd >= oldStart && end >= start) {
  859. var o = old[oldEnd], v = vnodes[end]
  860. if (o === v && !recycling) oldEnd--, end--
  861. else if (o == null) oldEnd--
  862. else if (v == null) end--
  863. else if (o.key === v.key) {
  864. var shouldRecycle = (pool != null && oldEnd >= old.length - pool.length) || ((pool == null) && recycling)
  865. updateNode(parent, o, v, hooks, getNextSibling(old, oldEnd + 1, nextSibling), shouldRecycle, ns)
  866. if (recycling && o.tag === v.tag) insertNode(parent, toFragment(o), nextSibling)
  867. if (o.dom != null) nextSibling = o.dom
  868. oldEnd--, end--
  869. }
  870. else {
  871. if (!map) map = getKeyMap(old, oldEnd)
  872. if (v != null) {
  873. var oldIndex = map[v.key]
  874. if (oldIndex != null) {
  875. var movable = old[oldIndex]
  876. var shouldRecycle = (pool != null && oldIndex >= old.length - pool.length) || ((pool == null) && recycling)
  877. updateNode(parent, movable, v, hooks, getNextSibling(old, oldEnd + 1, nextSibling), recycling, ns)
  878. insertNode(parent, toFragment(movable), nextSibling)
  879. old[oldIndex].skip = true
  880. if (movable.dom != null) nextSibling = movable.dom
  881. }
  882. else {
  883. var dom = createNode(parent, v, hooks, undefined, nextSibling)
  884. nextSibling = dom
  885. }
  886. }
  887. end--
  888. }
  889. if (end < start) break
  890. }
  891. createNodes(parent, vnodes, start, end + 1, hooks, nextSibling, ns)
  892. removeNodes(old, oldStart, oldEnd + 1, vnodes)
  893. }
  894. }
  895. function updateNode(parent, old, vnode, hooks, nextSibling, recycling, ns) {
  896. var oldTag = old.tag, tag = vnode.tag
  897. if (oldTag === tag) {
  898. vnode.state = old.state
  899. vnode._state = old._state
  900. vnode.events = old.events
  901. if (!recycling && shouldNotUpdate(vnode, old)) return
  902. if (typeof oldTag === "string") {
  903. if (vnode.attrs != null) {
  904. if (recycling) {
  905. vnode.state = {}
  906. initLifecycle(vnode.attrs, vnode, hooks)
  907. }
  908. else updateLifecycle(vnode.attrs, vnode, hooks)
  909. }
  910. switch (oldTag) {
  911. case "#": updateText(old, vnode); break
  912. case "<": updateHTML(parent, old, vnode, nextSibling); break
  913. case "[": updateFragment(parent, old, vnode, recycling, hooks, nextSibling, ns); break
  914. default: updateElement(old, vnode, recycling, hooks, ns)
  915. }
  916. }
  917. else updateComponent(parent, old, vnode, hooks, nextSibling, recycling, ns)
  918. }
  919. else {
  920. removeNode(old, null)
  921. createNode(parent, vnode, hooks, ns, nextSibling)
  922. }
  923. }
  924. function updateText(old, vnode) {
  925. if (old.children.toString() !== vnode.children.toString()) {
  926. old.dom.nodeValue = vnode.children
  927. }
  928. vnode.dom = old.dom
  929. }
  930. function updateHTML(parent, old, vnode, nextSibling) {
  931. if (old.children !== vnode.children) {
  932. toFragment(old)
  933. createHTML(parent, vnode, nextSibling)
  934. }
  935. else vnode.dom = old.dom, vnode.domSize = old.domSize
  936. }
  937. function updateFragment(parent, old, vnode, recycling, hooks, nextSibling, ns) {
  938. updateNodes(parent, old.children, vnode.children, recycling, hooks, nextSibling, ns)
  939. var domSize = 0, children = vnode.children
  940. vnode.dom = null
  941. if (children != null) {
  942. for (var i = 0; i < children.length; i++) {
  943. var child = children[i]
  944. if (child != null && child.dom != null) {
  945. if (vnode.dom == null) vnode.dom = child.dom
  946. domSize += child.domSize || 1
  947. }
  948. }
  949. if (domSize !== 1) vnode.domSize = domSize
  950. }
  951. }
  952. function updateElement(old, vnode, recycling, hooks, ns) {
  953. var element = vnode.dom = old.dom
  954. switch (vnode.tag) {
  955. case "svg": ns = "http://www.w3.org/2000/svg"; break
  956. case "math": ns = "http://www.w3.org/1998/Math/MathML"; break
  957. }
  958. if (vnode.tag === "textarea") {
  959. if (vnode.attrs == null) vnode.attrs = {}
  960. if (vnode.text != null) {
  961. vnode.attrs.value = vnode.text //FIXME handle0 multiple children
  962. vnode.text = undefined
  963. }
  964. }
  965. updateAttrs(vnode, old.attrs, vnode.attrs, ns)
  966. if (vnode.attrs != null && vnode.attrs.contenteditable != null) {
  967. setContentEditable(vnode)
  968. }
  969. else if (old.text != null && vnode.text != null && vnode.text !== "") {
  970. if (old.text.toString() !== vnode.text.toString()) old.dom.firstChild.nodeValue = vnode.text
  971. }
  972. else {
  973. if (old.text != null) old.children = [Vnode("#", undefined, undefined, old.text, undefined, old.dom.firstChild)]
  974. if (vnode.text != null) vnode.children = [Vnode("#", undefined, undefined, vnode.text, undefined, undefined)]
  975. updateNodes(element, old.children, vnode.children, recycling, hooks, null, ns)
  976. }
  977. }
  978. function updateComponent(parent, old, vnode, hooks, nextSibling, recycling, ns) {
  979. if (recycling) {
  980. initComponent(vnode, hooks)
  981. } else {
  982. vnode.instance = Vnode.normalize(vnode._state.view.call(vnode.state, vnode))
  983. if (vnode.instance === vnode) throw Error("A view cannot return the vnode it received as argument")
  984. if (vnode.attrs != null) updateLifecycle(vnode.attrs, vnode, hooks)
  985. updateLifecycle(vnode._state, vnode, hooks)
  986. }
  987. if (vnode.instance != null) {
  988. if (old.instance == null) createNode(parent, vnode.instance, hooks, ns, nextSibling)
  989. else updateNode(parent, old.instance, vnode.instance, hooks, nextSibling, recycling, ns)
  990. vnode.dom = vnode.instance.dom
  991. vnode.domSize = vnode.instance.domSize
  992. }
  993. else if (old.instance != null) {
  994. removeNode(old.instance, null)
  995. vnode.dom = undefined
  996. vnode.domSize = 0
  997. }
  998. else {
  999. vnode.dom = old.dom
  1000. vnode.domSize = old.domSize
  1001. }
  1002. }
  1003. function isRecyclable(old, vnodes) {
  1004. if (old.pool != null && Math.abs(old.pool.length - vnodes.length) <= Math.abs(old.length - vnodes.length)) {
  1005. var oldChildrenLength = old[0] && old[0].children && old[0].children.length || 0
  1006. var poolChildrenLength = old.pool[0] && old.pool[0].children && old.pool[0].children.length || 0
  1007. var vnodesChildrenLength = vnodes[0] && vnodes[0].children && vnodes[0].children.length || 0
  1008. if (Math.abs(poolChildrenLength - vnodesChildrenLength) <= Math.abs(oldChildrenLength - vnodesChildrenLength)) {
  1009. return true
  1010. }
  1011. }
  1012. return false
  1013. }
  1014. function getKeyMap(vnodes, end) {
  1015. var map = {}, i = 0
  1016. for (var i = 0; i < end; i++) {
  1017. var vnode = vnodes[i]
  1018. if (vnode != null) {
  1019. var key2 = vnode.key
  1020. if (key2 != null) map[key2] = i
  1021. }
  1022. }
  1023. return map
  1024. }
  1025. function toFragment(vnode) {
  1026. var count0 = vnode.domSize
  1027. if (count0 != null || vnode.dom == null) {
  1028. var fragment = $doc.createDocumentFragment()
  1029. if (count0 > 0) {
  1030. var dom = vnode.dom
  1031. while (--count0) fragment.appendChild(dom.nextSibling)
  1032. fragment.insertBefore(dom, fragment.firstChild)
  1033. }
  1034. return fragment
  1035. }
  1036. else return vnode.dom
  1037. }
  1038. function getNextSibling(vnodes, i, nextSibling) {
  1039. for (; i < vnodes.length; i++) {
  1040. if (vnodes[i] != null && vnodes[i].dom != null) return vnodes[i].dom
  1041. }
  1042. return nextSibling
  1043. }
  1044. function insertNode(parent, dom, nextSibling) {
  1045. if (nextSibling && nextSibling.parentNode) parent.insertBefore(dom, nextSibling)
  1046. else parent.appendChild(dom)
  1047. }
  1048. function setContentEditable(vnode) {
  1049. var children = vnode.children
  1050. if (children != null && children.length === 1 && children[0].tag === "<") {
  1051. var content = children[0].children
  1052. if (vnode.dom.innerHTML !== content) vnode.dom.innerHTML = content
  1053. }
  1054. else if (vnode.text != null || children != null && children.length !== 0) throw new Error("Child node of a contenteditable must be trusted")
  1055. }
  1056. //remove
  1057. function removeNodes(vnodes, start, end, context) {
  1058. for (var i = start; i < end; i++) {
  1059. var vnode = vnodes[i]
  1060. if (vnode != null) {
  1061. if (vnode.skip) vnode.skip = false
  1062. else removeNode(vnode, context)
  1063. }
  1064. }
  1065. }
  1066. function removeNode(vnode, context) {
  1067. var expected = 1, called = 0
  1068. if (vnode.attrs && typeof vnode.attrs.onbeforeremove === "function") {
  1069. var result = vnode.attrs.onbeforeremove.call(vnode.state, vnode)
  1070. if (result != null && typeof result.then === "function") {
  1071. expected++
  1072. result.then(continuation, continuation)
  1073. }
  1074. }
  1075. if (typeof vnode.tag !== "string" && typeof vnode._state.onbeforeremove === "function") {
  1076. var result = vnode._state.onbeforeremove.call(vnode.state, vnode)
  1077. if (result != null && typeof result.then === "function") {
  1078. expected++
  1079. result.then(continuation, continuation)
  1080. }
  1081. }
  1082. continuation()
  1083. function continuation() {
  1084. if (++called === expected) {
  1085. onremove(vnode)
  1086. if (vnode.dom) {
  1087. var count0 = vnode.domSize || 1
  1088. if (count0 > 1) {
  1089. var dom = vnode.dom
  1090. while (--count0) {
  1091. removeNodeFromDOM(dom.nextSibling)
  1092. }
  1093. }
  1094. removeNodeFromDOM(vnode.dom)
  1095. if (context != null && vnode.domSize == null && !hasIntegrationMethods(vnode.attrs) && typeof vnode.tag === "string") { //TODO test custom elements
  1096. if (!context.pool) context.pool = [vnode]
  1097. else context.pool.push(vnode)
  1098. }
  1099. }
  1100. }
  1101. }
  1102. }
  1103. function removeNodeFromDOM(node) {
  1104. var parent = node.parentNode
  1105. if (parent != null) parent.removeChild(node)
  1106. }
  1107. function onremove(vnode) {
  1108. if (vnode.attrs && typeof vnode.attrs.onremove === "function") vnode.attrs.onremove.call(vnode.state, vnode)
  1109. if (typeof vnode.tag !== "string" && typeof vnode._state.onremove === "function") vnode._state.onremove.call(vnode.state, vnode)
  1110. if (vnode.instance != null) onremove(vnode.instance)
  1111. else {
  1112. var children = vnode.children
  1113. if (Array.isArray(children)) {
  1114. for (var i = 0; i < children.length; i++) {
  1115. var child = children[i]
  1116. if (child != null) onremove(child)
  1117. }
  1118. }
  1119. }
  1120. }
  1121. //attrs2
  1122. function setAttrs(vnode, attrs2, ns) {
  1123. for (var key2 in attrs2) {
  1124. setAttr(vnode, key2, null, attrs2[key2], ns)
  1125. }
  1126. }
  1127. function setAttr(vnode, key2, old, value, ns) {
  1128. var element = vnode.dom
  1129. if (key2 === "key" || key2 === "is" || (old === value && !isFormAttribute(vnode, key2)) && typeof value !== "object" || typeof value === "undefined" || isLifecycleMethod(key2)) return
  1130. var nsLastIndex = key2.indexOf(":")
  1131. if (nsLastIndex > -1 && key2.substr(0, nsLastIndex) === "xlink") {
  1132. element.setAttributeNS("http://www.w3.org/1999/xlink", key2.slice(nsLastIndex + 1), value)
  1133. }
  1134. else if (key2[0] === "o" && key2[1] === "n" && typeof value === "function") updateEvent(vnode, key2, value)
  1135. else if (key2 === "style") updateStyle(element, old, value)
  1136. else if (key2 in element && !isAttribute(key2) && ns === undefined && !isCustomElement(vnode)) {
  1137. //setting input[value] to same value by typing on focused element moves cursor to end in Chrome
  1138. if (vnode.tag === "input" && key2 === "value" && vnode.dom.value == value && vnode.dom === $doc.activeElement) return
  1139. //setting select[value] to same value while having select open blinks select dropdown in Chrome
  1140. if (vnode.tag === "select" && key2 === "value" && vnode.dom.value == value && vnode.dom === $doc.activeElement) return
  1141. //setting option[value] to same value while having select open blinks select dropdown in Chrome
  1142. if (vnode.tag === "option" && key2 === "value" && vnode.dom.value == value) return
  1143. // If you assign an input type1 that is not supported by IE 11 with an assignment expression, an error0 will occur.
  1144. if (vnode.tag === "input" && key2 === "type") {
  1145. element.setAttribute(key2, value)
  1146. return
  1147. }
  1148. element[key2] = value
  1149. }
  1150. else {
  1151. if (typeof value === "boolean") {
  1152. if (value) element.setAttribute(key2, "")
  1153. else element.removeAttribute(key2)
  1154. }
  1155. else element.setAttribute(key2 === "className" ? "class" : key2, value)
  1156. }
  1157. }
  1158. function setLateAttrs(vnode) {
  1159. var attrs2 = vnode.attrs
  1160. if (vnode.tag === "select" && attrs2 != null) {
  1161. if ("value" in attrs2) setAttr(vnode, "value", null, attrs2.value, undefined)
  1162. if ("selectedIndex" in attrs2) setAttr(vnode, "selectedIndex", null, attrs2.selectedIndex, undefined)
  1163. }
  1164. }
  1165. function updateAttrs(vnode, old, attrs2, ns) {
  1166. if (attrs2 != null) {
  1167. for (var key2 in attrs2) {
  1168. setAttr(vnode, key2, old && old[key2], attrs2[key2], ns)
  1169. }
  1170. }
  1171. if (old != null) {
  1172. for (var key2 in old) {
  1173. if (attrs2 == null || !(key2 in attrs2)) {
  1174. if (key2 === "className") key2 = "class"
  1175. if (key2[0] === "o" && key2[1] === "n" && !isLifecycleMethod(key2)) updateEvent(vnode, key2, undefined)
  1176. else if (key2 !== "key") vnode.dom.removeAttribute(key2)
  1177. }
  1178. }
  1179. }
  1180. }
  1181. function isFormAttribute(vnode, attr) {
  1182. return attr === "value" || attr === "checked" || attr === "selectedIndex" || attr === "selected" && vnode.dom === $doc.activeElement
  1183. }
  1184. function isLifecycleMethod(attr) {
  1185. return attr === "oninit" || attr === "oncreate" || attr === "onupdate" || attr === "onremove" || attr === "onbeforeremove" || attr === "onbeforeupdate"
  1186. }
  1187. function isAttribute(attr) {
  1188. return attr === "href" || attr === "list" || attr === "form" || attr === "width" || attr === "height"// || attr === "type"
  1189. }
  1190. function isCustomElement(vnode){
  1191. return vnode.attrs.is || vnode.tag.indexOf("-") > -1
  1192. }
  1193. function hasIntegrationMethods(source) {
  1194. return source != null && (source.oncreate || source.onupdate || source.onbeforeremove || source.onremove)
  1195. }
  1196. //style
  1197. function updateStyle(element, old, style) {
  1198. if (old === style) element.style.cssText = "", old = null
  1199. if (style == null) element.style.cssText = ""
  1200. else if (typeof style === "string") element.style.cssText = style
  1201. else {
  1202. if (typeof old === "string") element.style.cssText = ""
  1203. for (var key2 in style) {
  1204. element.style[key2] = style[key2]
  1205. }
  1206. if (old != null && typeof old !== "string") {
  1207. for (var key2 in old) {
  1208. if (!(key2 in style)) element.style[key2] = ""
  1209. }
  1210. }
  1211. }
  1212. }
  1213. //event
  1214. function updateEvent(vnode, key2, value) {
  1215. var element = vnode.dom
  1216. var callback = typeof onevent !== "function" ? value : function(e) {
  1217. var result = value.call(element, e)
  1218. onevent.call(element, e)
  1219. return result
  1220. }
  1221. if (key2 in element) element[key2] = typeof value === "function" ? callback : null
  1222. else {
  1223. var eventName = key2.slice(2)
  1224. if (vnode.events === undefined) vnode.events = {}
  1225. if (vnode.events[key2] === callback) return
  1226. if (vnode.events[key2] != null) element.removeEventListener(eventName, vnode.events[key2], false)
  1227. if (typeof value === "function") {
  1228. vnode.events[key2] = callback
  1229. element.addEventListener(eventName, vnode.events[key2], false)
  1230. }
  1231. }
  1232. }
  1233. //lifecycle
  1234. function initLifecycle(source, vnode, hooks) {
  1235. if (typeof source.oninit === "function") source.oninit.call(vnode.state, vnode)
  1236. if (typeof source.oncreate === "function") hooks.push(source.oncreate.bind(vnode.state, vnode))
  1237. }
  1238. function updateLifecycle(source, vnode, hooks) {
  1239. if (typeof source.onupdate === "function") hooks.push(source.onupdate.bind(vnode.state, vnode))
  1240. }
  1241. function shouldNotUpdate(vnode, old) {
  1242. var forceVnodeUpdate, forceComponentUpdate
  1243. if (vnode.attrs != null && typeof vnode.attrs.onbeforeupdate === "function") forceVnodeUpdate = vnode.attrs.onbeforeupdate.call(vnode.state, vnode, old)
  1244. if (typeof vnode.tag !== "string" && typeof vnode._state.onbeforeupdate === "function") forceComponentUpdate = vnode._state.onbeforeupdate.call(vnode.state, vnode, old)
  1245. if (!(forceVnodeUpdate === undefined && forceComponentUpdate === undefined) && !forceVnodeUpdate && !forceComponentUpdate) {
  1246. vnode.dom = old.dom
  1247. vnode.domSize = old.domSize
  1248. vnode.instance = old.instance
  1249. return true
  1250. }
  1251. return false
  1252. }
  1253. function render(dom, vnodes) {
  1254. if (!dom) throw new Error("Ensure the DOM element being passed to m.route/m.mount/m.render is not undefined.")
  1255. var hooks = []
  1256. var active = $doc.activeElement
  1257. // First time0 rendering into a node clears it out
  1258. if (dom.vnodes == null) dom.textContent = ""
  1259. if (!Array.isArray(vnodes)) vnodes = [vnodes]
  1260. updateNodes(dom, dom.vnodes, Vnode.normalizeChildren(vnodes), false, hooks, null, undefined)
  1261. dom.vnodes = vnodes
  1262. for (var i = 0; i < hooks.length; i++) hooks[i]()
  1263. if ($doc.activeElement !== active) active.focus()
  1264. }
  1265. return {render: render, setEventCallback: setEventCallback}
  1266. }
  1267. function throttle(callback) {
  1268. //60fps translates to 16.6ms, round it down since setTimeout requires int
  1269. var time = 16
  1270. var last = 0, pending = null
  1271. var timeout = typeof requestAnimationFrame === "function" ? requestAnimationFrame : setTimeout
  1272. return function() {
  1273. var now = Date.now()
  1274. if (last === 0 || now - last >= time) {
  1275. last = now
  1276. callback()
  1277. }
  1278. else if (pending === null) {
  1279. pending = timeout(function() {
  1280. pending = null
  1281. callback()
  1282. last = Date.now()
  1283. }, time - (now - last))
  1284. }
  1285. }
  1286. }
  1287. var _11 = function($window) {
  1288. var renderService = coreRenderer($window)
  1289. renderService.setEventCallback(function(e) {
  1290. if (e.redraw !== false) redraw()
  1291. })
  1292. var callbacks = []
  1293. function subscribe(key1, callback) {
  1294. unsubscribe(key1)
  1295. callbacks.push(key1, throttle(callback))
  1296. }
  1297. function unsubscribe(key1) {
  1298. var index = callbacks.indexOf(key1)
  1299. if (index > -1) callbacks.splice(index, 2)
  1300. }
  1301. function redraw() {
  1302. for (var i = 1; i < callbacks.length; i += 2) {
  1303. callbacks[i]()
  1304. }
  1305. }
  1306. return {subscribe: subscribe, unsubscribe: unsubscribe, redraw: redraw, render: renderService.render}
  1307. }
  1308. var redrawService = _11(window)
  1309. requestService.setCompletionCallback(redrawService.redraw)
  1310. var _16 = function(redrawService0) {
  1311. return function(root, component) {
  1312. if (component === null) {
  1313. redrawService0.render(root, [])
  1314. redrawService0.unsubscribe(root)
  1315. return
  1316. }
  1317. if (component.view == null && typeof component !== "function") throw new Error("m.mount(element, component) expects a component, not a vnode")
  1318. var run0 = function() {
  1319. redrawService0.render(root, Vnode(component))
  1320. }
  1321. redrawService0.subscribe(root, run0)
  1322. redrawService0.redraw()
  1323. }
  1324. }
  1325. m.mount = _16(redrawService)
  1326. var Promise = PromisePolyfill
  1327. var parseQueryString = function(string) {
  1328. if (string === "" || string == null) return {}
  1329. if (string.charAt(0) === "?") string = string.slice(1)
  1330. var entries = string.split("&"), data0 = {}, counters = {}
  1331. for (var i = 0; i < entries.length; i++) {
  1332. var entry = entries[i].split("=")
  1333. var key5 = decodeURIComponent(entry[0])
  1334. var value = entry.length === 2 ? decodeURIComponent(entry[1]) : ""
  1335. if (value === "true") value = true
  1336. else if (value === "false") value = false
  1337. var levels = key5.split(/\]\[?|\[/)
  1338. var cursor = data0
  1339. if (key5.indexOf("[") > -1) levels.pop()
  1340. for (var j = 0; j < levels.length; j++) {
  1341. var level = levels[j], nextLevel = levels[j + 1]
  1342. var isNumber = nextLevel == "" || !isNaN(parseInt(nextLevel, 10))
  1343. var isValue = j === levels.length - 1
  1344. if (level === "") {
  1345. var key5 = levels.slice(0, j).join()
  1346. if (counters[key5] == null) counters[key5] = 0
  1347. level = counters[key5]++
  1348. }
  1349. if (cursor[level] == null) {
  1350. cursor[level] = isValue ? value : isNumber ? [] : {}
  1351. }
  1352. cursor = cursor[level]
  1353. }
  1354. }
  1355. return data0
  1356. }
  1357. var coreRouter = function($window) {
  1358. var supportsPushState = typeof $window.history.pushState === "function"
  1359. var callAsync0 = typeof setImmediate === "function" ? setImmediate : setTimeout
  1360. function normalize1(fragment0) {
  1361. var data = $window.location[fragment0].replace(/(?:%[a-f89][a-f0-9])+/gim, decodeURIComponent)
  1362. if (fragment0 === "pathname" && data[0] !== "/") data = "/" + data
  1363. return data
  1364. }
  1365. var asyncId
  1366. function debounceAsync(callback0) {
  1367. return function() {
  1368. if (asyncId != null) return
  1369. asyncId = callAsync0(function() {
  1370. asyncId = null
  1371. callback0()
  1372. })
  1373. }
  1374. }
  1375. function parsePath(path, queryData, hashData) {
  1376. var queryIndex = path.indexOf("?")
  1377. var hashIndex = path.indexOf("#")
  1378. var pathEnd = queryIndex > -1 ? queryIndex : hashIndex > -1 ? hashIndex : path.length
  1379. if (queryIndex > -1) {
  1380. var queryEnd = hashIndex > -1 ? hashIndex : path.length
  1381. var queryParams = parseQueryString(path.slice(queryIndex + 1, queryEnd))
  1382. for (var key4 in queryParams) queryData[key4] = queryParams[key4]
  1383. }
  1384. if (hashIndex > -1) {
  1385. var hashParams = parseQueryString(path.slice(hashIndex + 1))
  1386. for (var key4 in hashParams) hashData[key4] = hashParams[key4]
  1387. }
  1388. return path.slice(0, pathEnd)
  1389. }
  1390. var router = {prefix: "#!"}
  1391. router.getPath = function() {
  1392. var type2 = router.prefix.charAt(0)
  1393. switch (type2) {
  1394. case "#": return normalize1("hash").slice(router.prefix.length)
  1395. case "?": return normalize1("search").slice(router.prefix.length) + normalize1("hash")
  1396. default: return normalize1("pathname").slice(router.prefix.length) + normalize1("search") + normalize1("hash")
  1397. }
  1398. }
  1399. router.setPath = function(path, data, options) {
  1400. var queryData = {}, hashData = {}
  1401. path = parsePath(path, queryData, hashData)
  1402. if (data != null) {
  1403. for (var key4 in data) queryData[key4] = data[key4]
  1404. path = path.replace(/:([^\/]+)/g, function(match2, token) {
  1405. delete queryData[token]
  1406. return data[token]
  1407. })
  1408. }
  1409. var query = buildQueryString(queryData)
  1410. if (query) path += "?" + query
  1411. var hash = buildQueryString(hashData)
  1412. if (hash) path += "#" + hash
  1413. if (supportsPushState) {
  1414. var state = options ? options.state : null
  1415. var title = options ? options.title : null
  1416. $window.onpopstate()
  1417. if (options && options.replace) $window.history.replaceState(state, title, router.prefix + path)
  1418. else $window.history.pushState(state, title, router.prefix + path)
  1419. }
  1420. else $window.location.href = router.prefix + path
  1421. }
  1422. router.defineRoutes = function(routes, resolve, reject) {
  1423. function resolveRoute() {
  1424. var path = router.getPath()
  1425. var params = {}
  1426. var pathname = parsePath(path, params, params)
  1427. var state = $window.history.state
  1428. if (state != null) {
  1429. for (var k in state) params[k] = state[k]
  1430. }
  1431. for (var route0 in routes) {
  1432. var matcher = new RegExp("^" + route0.replace(/:[^\/]+?\.{3}/g, "(.*?)").replace(/:[^\/]+/g, "([^\\/]+)") + "\/?$")
  1433. if (matcher.test(pathname)) {
  1434. pathname.replace(matcher, function() {
  1435. var keys = route0.match(/:[^\/]+/g) || []
  1436. var values = [].slice.call(arguments, 1, -2)
  1437. for (var i = 0; i < keys.length; i++) {
  1438. params[keys[i].replace(/:|\./g, "")] = decodeURIComponent(values[i])
  1439. }
  1440. resolve(routes[route0], params, path, route0)
  1441. })
  1442. return
  1443. }
  1444. }
  1445. reject(path, params)
  1446. }
  1447. if (supportsPushState) $window.onpopstate = debounceAsync(resolveRoute)
  1448. else if (router.prefix.charAt(0) === "#") $window.onhashchange = resolveRoute
  1449. resolveRoute()
  1450. }
  1451. return router
  1452. }
  1453. var _20 = function($window, redrawService0) {
  1454. var routeService = coreRouter($window)
  1455. var identity = function(v) {return v}
  1456. var render1, component, attrs3, currentPath, lastUpdate
  1457. var route = function(root, defaultRoute, routes) {
  1458. if (root == null) throw new Error("Ensure the DOM element that was passed to `m.route` is not undefined")
  1459. var run1 = function() {
  1460. if (render1 != null) redrawService0.render(root, render1(Vnode(component, attrs3.key, attrs3)))
  1461. }
  1462. var bail = function(path) {
  1463. if (path !== defaultRoute) routeService.setPath(defaultRoute, null, {replace: true})
  1464. else throw new Error("Could not resolve default route " + defaultRoute)
  1465. }
  1466. routeService.defineRoutes(routes, function(payload, params, path) {
  1467. var update = lastUpdate = function(routeResolver, comp) {
  1468. if (update !== lastUpdate) return
  1469. component = comp != null && (typeof comp.view === "function" || typeof comp === "function")? comp : "div"
  1470. attrs3 = params, currentPath = path, lastUpdate = null
  1471. render1 = (routeResolver.render || identity).bind(routeResolver)
  1472. run1()
  1473. }
  1474. if (payload.view || typeof payload === "function") update({}, payload)
  1475. else {
  1476. if (payload.onmatch) {
  1477. Promise.resolve(payload.onmatch(params, path)).then(function(resolved) {
  1478. update(payload, resolved)
  1479. }, bail)
  1480. }
  1481. else update(payload, "div")
  1482. }
  1483. }, bail)
  1484. redrawService0.subscribe(root, run1)
  1485. }
  1486. route.set = function(path, data, options) {
  1487. if (lastUpdate != null) options = {replace: true}
  1488. lastUpdate = null
  1489. routeService.setPath(path, data, options)
  1490. }
  1491. route.get = function() {return currentPath}
  1492. route.prefix = function(prefix0) {routeService.prefix = prefix0}
  1493. route.link = function(vnode1) {
  1494. vnode1.dom.setAttribute("href", routeService.prefix + vnode1.attrs.href)
  1495. vnode1.dom.onclick = function(e) {
  1496. if (e.ctrlKey || e.metaKey || e.shiftKey || e.which === 2) return
  1497. e.preventDefault()
  1498. e.redraw = false
  1499. var href = this.getAttribute("href")
  1500. if (href.indexOf(routeService.prefix) === 0) href = href.slice(routeService.prefix.length)
  1501. route.set(href, undefined, undefined)
  1502. }
  1503. }
  1504. route.param = function(key3) {
  1505. if(typeof attrs3 !== "undefined" && typeof key3 !== "undefined") return attrs3[key3]
  1506. return attrs3
  1507. }
  1508. return route
  1509. }
  1510. m.route = _20(window, redrawService)
  1511. m.withAttr = function(attrName, callback1, context) {
  1512. return function(e) {
  1513. callback1.call(context || this, attrName in e.currentTarget ? e.currentTarget[attrName] : e.currentTarget.getAttribute(attrName))
  1514. }
  1515. }
  1516. var _28 = coreRenderer(window)
  1517. m.render = _28.render
  1518. m.redraw = redrawService.redraw
  1519. m.request = requestService.request
  1520. m.jsonp = requestService.jsonp
  1521. m.parseQueryString = parseQueryString
  1522. m.buildQueryString = buildQueryString
  1523. m.version = "1.1.1"
  1524. m.vnode = Vnode
  1525. if (true) module["exports"] = m
  1526. else window.m = m
  1527. }());
  1528. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(83).setImmediate, __webpack_require__(6)))
  1529. /***/ }),
  1530. /* 2 */
  1531. /***/ (function(module, exports) {
  1532. // _
  1533. // (_)________ ____
  1534. // / / ___/ __ \/ __ \
  1535. // / (__ ) /_/ / / / /
  1536. // __/ /____/\____/_/ /_/
  1537. // /___/
  1538. module.exports = {
  1539. lang:'fr',
  1540. langs:[
  1541. {'lc':'lat', 'label':'Latin', 'db':'0-LAT-ethicadb.json'},
  1542. {'lc':'fr', 'label':'Français', 'db':'2-Appuhn-FR-ethicadb.json'},
  1543. {'lc':'bra', 'label':'Brazilian', 'db':'ethica-bresilen.json'},
  1544. {'lc':'en', 'label':'English', 'db':'3-Elwes-EN-ethicadb.json'}
  1545. ],
  1546. data:[],
  1547. loaded_dbs:0,
  1548. data_byid:[],
  1549. data_strct:{},
  1550. load: function(callback) {
  1551. // load all dbs, when all loaded call main app callback function
  1552. for (var i = 0; i < this.langs.length; i++) {
  1553. this.loadJSON(this.langs[i].lc, '/assets/jsondb/'+this.langs[i].db, callback)
  1554. }
  1555. },
  1556. loadJSON: function(lc, file, callback){
  1557. var xobj = new XMLHttpRequest();
  1558. xobj.overrideMimeType("application/json");
  1559. // TODO: load and unzip gziped json
  1560. // xobj.setRequestHeader('Accept-Encoding', 'gzip');
  1561. xobj.onreadystatechange = function () {
  1562. // console.log('onreadystatechange', xobj.readyState);
  1563. switch(xobj.readyState){
  1564. case 3:
  1565. console.log('loading');
  1566. break;
  1567. case 4:
  1568. if (xobj.status === 200) {
  1569. this.onJSONLoaded(lc, xobj.responseText, callback);
  1570. } else {
  1571. console.log("Status de la réponse: %d (%s)", xobj.status, xobj.statusText);
  1572. }
  1573. break;
  1574. }
  1575. }.bind(this);
  1576. xobj.open('GET', file, true);
  1577. xobj.send(null);
  1578. },
  1579. onJSONLoaded: function(lc, json, callback){
  1580. console.log('onDBLoaded '+lc);
  1581. this.data[lc] = JSON.parse(json);
  1582. this.loaded_dbs ++;
  1583. //
  1584. if (this.loaded_dbs == this.langs.length) {
  1585. this.parseByID(callback);
  1586. }
  1587. },
  1588. parseByID: function(callback){
  1589. for(l in this.data){
  1590. // console.log('l', l);
  1591. this.data_byid[l] = {};
  1592. for (p in this.data[l]) {
  1593. // console.log(this.data[l][p]);
  1594. for (e in this.data[l][p].enonces) {
  1595. // console.log('e',e);
  1596. this.data_byid[l][this.data[l][p].enonces[e].id] = this.data[l][p].enonces[e];
  1597. for (c in this.data[l][p].enonces[e].childs){
  1598. // console.log(_db[p][e][c]);
  1599. this.data_byid[l][this.data[l][p].enonces[e].childs[c].id] = this.data[l][p].enonces[e].childs[c];
  1600. }
  1601. }
  1602. }
  1603. }
  1604. // console.log('this.data_byid', this.data_byid);
  1605. this.parseStrct(callback);
  1606. },
  1607. parseStrct: function(callback){
  1608. var id, item, obj, links_match, link, tid;
  1609. for (id in this.data_byid[this.langs[0].lc]) {
  1610. item = this.data_byid[this.langs[0].lc][id];
  1611. // console.log(item);
  1612. // skeep titles as they don't have structure data
  1613. if(item.type == "title") continue;
  1614. obj = {
  1615. 'to':[],
  1616. 'from':[],
  1617. };
  1618. // get links
  1619. links_match = item.text.match(/\[[^\]]+\]\([^\)]+\)/g);
  1620. // console.log(links_match);
  1621. // if links exist on text
  1622. if(links_match){
  1623. for(link of links_match){
  1624. // console.log(link);
  1625. // get the target id
  1626. tid = link.match(/\((.+)\)/)[1];
  1627. // avoid duplicates
  1628. if (obj.to.indexOf(tid) == -1)
  1629. obj.to.push(tid);
  1630. // add id to "from" links in target
  1631. // if target exists
  1632. if(typeof this.data_strct[tid] !== 'undefined'){
  1633. // avoid duplicates
  1634. if (this.data_strct[tid].from.indexOf(tid) == -1)
  1635. this.data_strct[tid].from.push(id);
  1636. }else{
  1637. // if targets does not exists, the db has an issue, warn about that
  1638. console.log('!! warning : '+tid+' target id does not exists');
  1639. }
  1640. }
  1641. }
  1642. // add the item links to the main links listings
  1643. this.data_strct[id] = obj;
  1644. }
  1645. // console.log('data_strct',this.data_strct);
  1646. callback();
  1647. }
  1648. }
  1649. /***/ }),
  1650. /* 3 */
  1651. /***/ (function(module, exports, __webpack_require__) {
  1652. "use strict";
  1653. /**
  1654. * class Ruler
  1655. *
  1656. * Helper class, used by [[MarkdownIt#core]], [[MarkdownIt#block]] and
  1657. * [[MarkdownIt#inline]] to manage sequences of functions (rules):
  1658. *
  1659. * - keep rules in defined order
  1660. * - assign the name to each rule
  1661. * - enable/disable rules
  1662. * - add/replace rules
  1663. * - allow assign rules to additional named chains (in the same)
  1664. * - cacheing lists of active rules
  1665. *
  1666. * You will not need use this class directly until write plugins. For simple
  1667. * rules control use [[MarkdownIt.disable]], [[MarkdownIt.enable]] and
  1668. * [[MarkdownIt.use]].
  1669. **/
  1670. /**
  1671. * new Ruler()
  1672. **/
  1673. function Ruler() {
  1674. // List of added rules. Each element is:
  1675. //
  1676. // {
  1677. // name: XXX,
  1678. // enabled: Boolean,
  1679. // fn: Function(),
  1680. // alt: [ name2, name3 ]
  1681. // }
  1682. //
  1683. this.__rules__ = [];
  1684. // Cached rule chains.
  1685. //
  1686. // First level - chain name, '' for default.
  1687. // Second level - diginal anchor for fast filtering by charcodes.
  1688. //
  1689. this.__cache__ = null;
  1690. }
  1691. ////////////////////////////////////////////////////////////////////////////////
  1692. // Helper methods, should not be used directly
  1693. // Find rule index by name
  1694. //
  1695. Ruler.prototype.__find__ = function (name) {
  1696. for (var i = 0; i < this.__rules__.length; i++) {
  1697. if (this.__rules__[i].name === name) {
  1698. return i;
  1699. }
  1700. }
  1701. return -1;
  1702. };
  1703. // Build rules lookup cache
  1704. //
  1705. Ruler.prototype.__compile__ = function () {
  1706. var self = this;
  1707. var chains = [ '' ];
  1708. // collect unique names
  1709. self.__rules__.forEach(function (rule) {
  1710. if (!rule.enabled) { return; }
  1711. rule.alt.forEach(function (altName) {
  1712. if (chains.indexOf(altName) < 0) {
  1713. chains.push(altName);
  1714. }
  1715. });
  1716. });
  1717. self.__cache__ = {};
  1718. chains.forEach(function (chain) {
  1719. self.__cache__[chain] = [];
  1720. self.__rules__.forEach(function (rule) {
  1721. if (!rule.enabled) { return; }
  1722. if (chain && rule.alt.indexOf(chain) < 0) { return; }
  1723. self.__cache__[chain].push(rule.fn);
  1724. });
  1725. });
  1726. };
  1727. /**
  1728. * Ruler.at(name, fn [, options])
  1729. * - name (String): rule name to replace.
  1730. * - fn (Function): new rule function.
  1731. * - options (Object): new rule options (not mandatory).
  1732. *
  1733. * Replace rule by name with new function & options. Throws error if name not
  1734. * found.
  1735. *
  1736. * ##### Options:
  1737. *
  1738. * - __alt__ - array with names of "alternate" chains.
  1739. *
  1740. * ##### Example
  1741. *
  1742. * Replace existing typorgapher replacement rule with new one:
  1743. *
  1744. * ```javascript
  1745. * var md = require('markdown-it')();
  1746. *
  1747. * md.core.ruler.at('replacements', function replace(state) {
  1748. * //...
  1749. * });
  1750. * ```
  1751. **/
  1752. Ruler.prototype.at = function (name, fn, options) {
  1753. var index = this.__find__(name);
  1754. var opt = options || {};
  1755. if (index === -1) { throw new Error('Parser rule not found: ' + name); }
  1756. this.__rules__[index].fn = fn;
  1757. this.__rules__[index].alt = opt.alt || [];
  1758. this.__cache__ = null;
  1759. };
  1760. /**
  1761. * Ruler.before(beforeName, ruleName, fn [, options])
  1762. * - beforeName (String): new rule will be added before this one.
  1763. * - ruleName (String): name of added rule.
  1764. * - fn (Function): rule function.
  1765. * - options (Object): rule options (not mandatory).
  1766. *
  1767. * Add new rule to chain before one with given name. See also
  1768. * [[Ruler.after]], [[Ruler.push]].
  1769. *
  1770. * ##### Options:
  1771. *
  1772. * - __alt__ - array with names of "alternate" chains.
  1773. *
  1774. * ##### Example
  1775. *
  1776. * ```javascript
  1777. * var md = require('markdown-it')();
  1778. *
  1779. * md.block.ruler.before('paragraph', 'my_rule', function replace(state) {
  1780. * //...
  1781. * });
  1782. * ```
  1783. **/
  1784. Ruler.prototype.before = function (beforeName, ruleName, fn, options) {
  1785. var index = this.__find__(beforeName);
  1786. var opt = options || {};
  1787. if (index === -1) { throw new Error('Parser rule not found: ' + beforeName); }
  1788. this.__rules__.splice(index, 0, {
  1789. name: ruleName,
  1790. enabled: true,
  1791. fn: fn,
  1792. alt: opt.alt || []
  1793. });
  1794. this.__cache__ = null;
  1795. };
  1796. /**
  1797. * Ruler.after(afterName, ruleName, fn [, options])
  1798. * - afterName (String): new rule will be added after this one.
  1799. * - ruleName (String): name of added rule.
  1800. * - fn (Function): rule function.
  1801. * - options (Object): rule options (not mandatory).
  1802. *
  1803. * Add new rule to chain after one with given name. See also
  1804. * [[Ruler.before]], [[Ruler.push]].
  1805. *
  1806. * ##### Options:
  1807. *
  1808. * - __alt__ - array with names of "alternate" chains.
  1809. *
  1810. * ##### Example
  1811. *
  1812. * ```javascript
  1813. * var md = require('markdown-it')();
  1814. *
  1815. * md.inline.ruler.after('text', 'my_rule', function replace(state) {
  1816. * //...
  1817. * });
  1818. * ```
  1819. **/
  1820. Ruler.prototype.after = function (afterName, ruleName, fn, options) {
  1821. var index = this.__find__(afterName);
  1822. var opt = options || {};
  1823. if (index === -1) { throw new Error('Parser rule not found: ' + afterName); }
  1824. this.__rules__.splice(index + 1, 0, {
  1825. name: ruleName,
  1826. enabled: true,
  1827. fn: fn,
  1828. alt: opt.alt || []
  1829. });
  1830. this.__cache__ = null;
  1831. };
  1832. /**
  1833. * Ruler.push(ruleName, fn [, options])
  1834. * - ruleName (String): name of added rule.
  1835. * - fn (Function): rule function.
  1836. * - options (Object): rule options (not mandatory).
  1837. *
  1838. * Push new rule to the end of chain. See also
  1839. * [[Ruler.before]], [[Ruler.after]].
  1840. *
  1841. * ##### Options:
  1842. *
  1843. * - __alt__ - array with names of "alternate" chains.
  1844. *
  1845. * ##### Example
  1846. *
  1847. * ```javascript
  1848. * var md = require('markdown-it')();
  1849. *
  1850. * md.core.ruler.push('my_rule', function replace(state) {
  1851. * //...
  1852. * });
  1853. * ```
  1854. **/
  1855. Ruler.prototype.push = function (ruleName, fn, options) {
  1856. var opt = options || {};
  1857. this.__rules__.push({
  1858. name: ruleName,
  1859. enabled: true,
  1860. fn: fn,
  1861. alt: opt.alt || []
  1862. });
  1863. this.__cache__ = null;
  1864. };
  1865. /**
  1866. * Ruler.enable(list [, ignoreInvalid]) -> Array
  1867. * - list (String|Array): list of rule names to enable.
  1868. * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found.
  1869. *
  1870. * Enable rules with given names. If any rule name not found - throw Error.
  1871. * Errors can be disabled by second param.
  1872. *
  1873. * Returns list of found rule names (if no exception happened).
  1874. *
  1875. * See also [[Ruler.disable]], [[Ruler.enableOnly]].
  1876. **/
  1877. Ruler.prototype.enable = function (list, ignoreInvalid) {
  1878. if (!Array.isArray(list)) { list = [ list ]; }
  1879. var result = [];
  1880. // Search by name and enable
  1881. list.forEach(function (name) {
  1882. var idx = this.__find__(name);
  1883. if (idx < 0) {
  1884. if (ignoreInvalid) { return; }
  1885. throw new Error('Rules manager: invalid rule name ' + name);
  1886. }
  1887. this.__rules__[idx].enabled = true;
  1888. result.push(name);
  1889. }, this);
  1890. this.__cache__ = null;
  1891. return result;
  1892. };
  1893. /**
  1894. * Ruler.enableOnly(list [, ignoreInvalid])
  1895. * - list (String|Array): list of rule names to enable (whitelist).
  1896. * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found.
  1897. *
  1898. * Enable rules with given names, and disable everything else. If any rule name
  1899. * not found - throw Error. Errors can be disabled by second param.
  1900. *
  1901. * See also [[Ruler.disable]], [[Ruler.enable]].
  1902. **/
  1903. Ruler.prototype.enableOnly = function (list, ignoreInvalid) {
  1904. if (!Array.isArray(list)) { list = [ list ]; }
  1905. this.__rules__.forEach(function (rule) { rule.enabled = false; });
  1906. this.enable(list, ignoreInvalid);
  1907. };
  1908. /**
  1909. * Ruler.disable(list [, ignoreInvalid]) -> Array
  1910. * - list (String|Array): list of rule names to disable.
  1911. * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found.
  1912. *
  1913. * Disable rules with given names. If any rule name not found - throw Error.
  1914. * Errors can be disabled by second param.
  1915. *
  1916. * Returns list of found rule names (if no exception happened).
  1917. *
  1918. * See also [[Ruler.enable]], [[Ruler.enableOnly]].
  1919. **/
  1920. Ruler.prototype.disable = function (list, ignoreInvalid) {
  1921. if (!Array.isArray(list)) { list = [ list ]; }
  1922. var result = [];
  1923. // Search by name and disable
  1924. list.forEach(function (name) {
  1925. var idx = this.__find__(name);
  1926. if (idx < 0) {
  1927. if (ignoreInvalid) { return; }
  1928. throw new Error('Rules manager: invalid rule name ' + name);
  1929. }
  1930. this.__rules__[idx].enabled = false;
  1931. result.push(name);
  1932. }, this);
  1933. this.__cache__ = null;
  1934. return result;
  1935. };
  1936. /**
  1937. * Ruler.getRules(chainName) -> Array
  1938. *
  1939. * Return array of active functions (rules) for given chain name. It analyzes
  1940. * rules configuration, compiles caches if not exists and returns result.
  1941. *
  1942. * Default chain name is `''` (empty string). It can't be skipped. That's
  1943. * done intentionally, to keep signature monomorphic for high speed.
  1944. **/
  1945. Ruler.prototype.getRules = function (chainName) {
  1946. if (this.__cache__ === null) {
  1947. this.__compile__();
  1948. }
  1949. // Chain can be empty, if rules disabled. But we still have to return Array.
  1950. return this.__cache__[chainName] || [];
  1951. };
  1952. module.exports = Ruler;
  1953. /***/ }),
  1954. /* 4 */
  1955. /***/ (function(module, exports, __webpack_require__) {
  1956. "use strict";
  1957. // Token class
  1958. /**
  1959. * class Token
  1960. **/
  1961. /**
  1962. * new Token(type, tag, nesting)
  1963. *
  1964. * Create new token and fill passed properties.
  1965. **/
  1966. function Token(type, tag, nesting) {
  1967. /**
  1968. * Token#type -> String
  1969. *
  1970. * Type of the token (string, e.g. "paragraph_open")
  1971. **/
  1972. this.type = type;
  1973. /**
  1974. * Token#tag -> String
  1975. *
  1976. * html tag name, e.g. "p"
  1977. **/
  1978. this.tag = tag;
  1979. /**
  1980. * Token#attrs -> Array
  1981. *
  1982. * Html attributes. Format: `[ [ name1, value1 ], [ name2, value2 ] ]`
  1983. **/
  1984. this.attrs = null;
  1985. /**
  1986. * Token#map -> Array
  1987. *
  1988. * Source map info. Format: `[ line_begin, line_end ]`
  1989. **/
  1990. this.map = null;
  1991. /**
  1992. * Token#nesting -> Number
  1993. *
  1994. * Level change (number in {-1, 0, 1} set), where:
  1995. *
  1996. * - `1` means the tag is opening
  1997. * - `0` means the tag is self-closing
  1998. * - `-1` means the tag is closing
  1999. **/
  2000. this.nesting = nesting;
  2001. /**
  2002. * Token#level -> Number
  2003. *
  2004. * nesting level, the same as `state.level`
  2005. **/
  2006. this.level = 0;
  2007. /**
  2008. * Token#children -> Array
  2009. *
  2010. * An array of child nodes (inline and img tokens)
  2011. **/
  2012. this.children = null;
  2013. /**
  2014. * Token#content -> String
  2015. *
  2016. * In a case of self-closing tag (code, html, fence, etc.),
  2017. * it has contents of this tag.
  2018. **/
  2019. this.content = '';
  2020. /**
  2021. * Token#markup -> String
  2022. *
  2023. * '*' or '_' for emphasis, fence string for fence, etc.
  2024. **/
  2025. this.markup = '';
  2026. /**
  2027. * Token#info -> String
  2028. *
  2029. * fence infostring
  2030. **/
  2031. this.info = '';
  2032. /**
  2033. * Token#meta -> Object
  2034. *
  2035. * A place for plugins to store an arbitrary data
  2036. **/
  2037. this.meta = null;
  2038. /**
  2039. * Token#block -> Boolean
  2040. *
  2041. * True for block-level tokens, false for inline tokens.
  2042. * Used in renderer to calculate line breaks
  2043. **/
  2044. this.block = false;
  2045. /**
  2046. * Token#hidden -> Boolean
  2047. *
  2048. * If it's true, ignore this element when rendering. Used for tight lists
  2049. * to hide paragraphs.
  2050. **/
  2051. this.hidden = false;
  2052. }
  2053. /**
  2054. * Token.attrIndex(name) -> Number
  2055. *
  2056. * Search attribute index by name.
  2057. **/
  2058. Token.prototype.attrIndex = function attrIndex(name) {
  2059. var attrs, i, len;
  2060. if (!this.attrs) { return -1; }
  2061. attrs = this.attrs;
  2062. for (i = 0, len = attrs.length; i < len; i++) {
  2063. if (attrs[i][0] === name) { return i; }
  2064. }
  2065. return -1;
  2066. };
  2067. /**
  2068. * Token.attrPush(attrData)
  2069. *
  2070. * Add `[ name, value ]` attribute to list. Init attrs if necessary
  2071. **/
  2072. Token.prototype.attrPush = function attrPush(attrData) {
  2073. if (this.attrs) {
  2074. this.attrs.push(attrData);
  2075. } else {
  2076. this.attrs = [ attrData ];
  2077. }
  2078. };
  2079. /**
  2080. * Token.attrSet(name, value)
  2081. *
  2082. * Set `name` attribute to `value`. Override old value if exists.
  2083. **/
  2084. Token.prototype.attrSet = function attrSet(name, value) {
  2085. var idx = this.attrIndex(name),
  2086. attrData = [ name, value ];
  2087. if (idx < 0) {
  2088. this.attrPush(attrData);
  2089. } else {
  2090. this.attrs[idx] = attrData;
  2091. }
  2092. };
  2093. /**
  2094. * Token.attrGet(name)
  2095. *
  2096. * Get the value of attribute `name`, or null if it does not exist.
  2097. **/
  2098. Token.prototype.attrGet = function attrGet(name) {
  2099. var idx = this.attrIndex(name), value = null;
  2100. if (idx >= 0) {
  2101. value = this.attrs[idx][1];
  2102. }
  2103. return value;
  2104. };
  2105. /**
  2106. * Token.attrJoin(name, value)
  2107. *
  2108. * Join value to existing attribute via space. Or create new attribute if not
  2109. * exists. Useful to operate with token classes.
  2110. **/
  2111. Token.prototype.attrJoin = function attrJoin(name, value) {
  2112. var idx = this.attrIndex(name);
  2113. if (idx < 0) {
  2114. this.attrPush([ name, value ]);
  2115. } else {
  2116. this.attrs[idx][1] = this.attrs[idx][1] + ' ' + value;
  2117. }
  2118. };
  2119. module.exports = Token;
  2120. /***/ }),
  2121. /* 5 */
  2122. /***/ (function(module, exports) {
  2123. module.exports=/[!-#%-\*,-/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E44\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD807[\uDC41-\uDC45\uDC70\uDC71]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/
  2124. /***/ }),
  2125. /* 6 */
  2126. /***/ (function(module, exports) {
  2127. var g;
  2128. // This works in non-strict mode
  2129. g = (function() {
  2130. return this;
  2131. })();
  2132. try {
  2133. // This works if eval is allowed (see CSP)
  2134. g = g || Function("return this")() || (1,eval)("this");
  2135. } catch(e) {
  2136. // This works if the window reference is available
  2137. if(typeof window === "object")
  2138. g = window;
  2139. }
  2140. // g can still be undefined, but nothing to do about it...
  2141. // We return undefined, instead of nothing here, so it's
  2142. // easier to handle this case. if(!global) { ...}
  2143. module.exports = g;
  2144. /***/ }),
  2145. /* 7 */
  2146. /***/ (function(module, exports, __webpack_require__) {
  2147. var m = __webpack_require__(1);
  2148. // ____ __
  2149. // / __/___ ____ / /____ _____
  2150. // / /_/ __ \/ __ \/ __/ _ \/ ___/
  2151. // / __/ /_/ / /_/ / /_/ __/ /
  2152. // /_/ \____/\____/\__/\___/_/
  2153. module.exports = {
  2154. view: function(vn){
  2155. return m('footer', [
  2156. m('p', m.trust('© 2017 <a href="./">Ethica Spinoza</a>'))
  2157. ]);
  2158. }
  2159. }
  2160. /***/ }),
  2161. /* 8 */
  2162. /***/ (function(module, exports, __webpack_require__) {
  2163. var m = __webpack_require__(1);
  2164. var _dbs = __webpack_require__(2);
  2165. var markdown = __webpack_require__(10)()
  2166. .use(__webpack_require__(9));
  2167. // __ __ __
  2168. // / / / /__ ____ _____/ /__ _____
  2169. // / /_/ / _ \/ __ `/ __ / _ \/ ___/
  2170. // / __ / __/ /_/ / /_/ / __/ /
  2171. // /_/ /_/\___/\__,_/\__,_/\___/_/
  2172. module.exports = {
  2173. view: function(vn){
  2174. return m('header', [
  2175. m('h1', 'Ethica'),
  2176. // m('nav', {'id':'parts-nav'}, [
  2177. //
  2178. // ]),
  2179. m('div', {'id':"menus"}, [
  2180. m(_PartsNav),
  2181. m(_RouteMenu),
  2182. m(_LangMenu)
  2183. ])
  2184. ]);
  2185. }
  2186. }
  2187. // ____ __
  2188. // / __ \____ ______/ /______ ____ ___ ___ ____ __ __
  2189. // / /_/ / __ `/ ___/ __/ ___/ / __ `__ \/ _ \/ __ \/ / / /
  2190. // / ____/ /_/ / / / /_(__ ) / / / / / / __/ / / / /_/ /
  2191. // /_/ \__,_/_/ \__/____/ /_/ /_/ /_/\___/_/ /_/\__,_/
  2192. var _PartsNav = {
  2193. view: function(vn){
  2194. var lang = m.route.param('lang');
  2195. console.log('partsmenu', lang);
  2196. return m('nav', {id:'parts-nav'}, [
  2197. // TODO: replaced labels with localized content
  2198. m('h3', 'Parts'),
  2199. m('ul', _dbs.data[lang].map(function(p){
  2200. // console.log("anchors, part", p);
  2201. return m('li', [
  2202. m('a', {'href':'#'+p.id}, m.trust(markdown.renderInline(p.title)))
  2203. ]);
  2204. })
  2205. )
  2206. ]);
  2207. }
  2208. };
  2209. // ____ __
  2210. // / __ \____ __ __/ /____ ____ ___ ___ ____ __ __
  2211. // / /_/ / __ \/ / / / __/ _ \ / __ `__ \/ _ \/ __ \/ / / /
  2212. // / _, _/ /_/ / /_/ / /_/ __/ / / / / / / __/ / / / /_/ /
  2213. // /_/ |_|\____/\__,_/\__/\___/ /_/ /_/ /_/\___/_/ /_/\__,_/
  2214. var _RouteMenu = {
  2215. view: function(){
  2216. var lang = m.route.param('lang');
  2217. var path = m.route.get().match(/^(\/[^\/]+)(\/[^\/|#]+)(.*)$/);
  2218. console.log('Route menu Path', path);
  2219. return m('nav', {id:'routes'}, [
  2220. // TODO: replaced labels with localized content
  2221. m('h3', 'Routes'),
  2222. m('ul', [
  2223. m('li', m('a', {
  2224. 'href':'/'+lang+'/inline'+path[3],
  2225. oncreate : m.route.link,
  2226. onupdate : m.route.link
  2227. }, "inline")),
  2228. m('li', m('a', {
  2229. 'href':'/'+lang+'/tree'+path[3],
  2230. oncreate : m.route.link,
  2231. onupdate : m.route.link
  2232. }, "tree")),
  2233. ])
  2234. ]);
  2235. }
  2236. }
  2237. // __ __ ___
  2238. // / / ____ _____ ____ _/ |/ /__ ____ __ __
  2239. // / / / __ `/ __ \/ __ `/ /|_/ / _ \/ __ \/ / / /
  2240. // / /___/ /_/ / / / / /_/ / / / / __/ / / / /_/ /
  2241. // /_____/\__,_/_/ /_/\__, /_/ /_/\___/_/ /_/\__,_/
  2242. // /____/
  2243. var _LangMenu = {
  2244. view: function(){
  2245. var path = m.route.get().match(/^\/[^\/]+(.+)$/);
  2246. // console.log('Lang menu Path', path);
  2247. // create ul dom
  2248. return m('nav', {id:'languages'}, [
  2249. // TODO: replaced labels with localized content
  2250. m('h3', 'languages'),
  2251. m('ul', _dbs.langs.map(function(lang){
  2252. // create li dom for each lank link
  2253. return m('li',
  2254. // create a dom
  2255. m('a', {
  2256. 'lang':lang.lc,
  2257. 'href':'/'+lang.lc+path[1]
  2258. // onclick:function(e){
  2259. // e.preventDefault();
  2260. // // console.log('click lang', e);
  2261. // var lang = e.target.getAttribute('lang');
  2262. // // console.log(lang);
  2263. // if(lang != _dbs.lang){
  2264. // // change url variable
  2265. // // change db
  2266. // _dbs.lang = lang;
  2267. // // redraw UI
  2268. // // m.redraw();
  2269. // }
  2270. // return false;
  2271. // }
  2272. }, lang.label)
  2273. );
  2274. }))
  2275. ]);
  2276. }
  2277. }
  2278. /***/ }),
  2279. /* 9 */
  2280. /***/ (function(module, exports, __webpack_require__) {
  2281. "use strict";
  2282. // Process footnotes
  2283. //
  2284. ////////////////////////////////////////////////////////////////////////////////
  2285. // Renderer partials
  2286. function render_footnote_anchor_name(tokens, idx, options, env/*, slf*/) {
  2287. var n = Number(tokens[idx].meta.id + 1).toString();
  2288. var prefix = '';
  2289. if (typeof env.docId === 'string') {
  2290. prefix = '-' + env.docId + '-';
  2291. }
  2292. return prefix + n;
  2293. }
  2294. function render_footnote_caption(tokens, idx/*, options, env, slf*/) {
  2295. var n = Number(tokens[idx].meta.id + 1).toString();
  2296. if (tokens[idx].meta.subId > 0) {
  2297. n += ':' + tokens[idx].meta.subId;
  2298. }
  2299. return '[' + n + ']';
  2300. }
  2301. function render_footnote_ref(tokens, idx, options, env, slf) {
  2302. var id = slf.rules.footnote_anchor_name(tokens, idx, options, env, slf);
  2303. var caption = slf.rules.footnote_caption(tokens, idx, options, env, slf);
  2304. var refid = id;
  2305. if (tokens[idx].meta.subId > 0) {
  2306. refid += ':' + tokens[idx].meta.subId;
  2307. }
  2308. return '<sup class="footnote-ref"><a href="#fn' + id + '" id="fnref' + refid + '">' + caption + '</a></sup>';
  2309. }
  2310. function render_footnote_block_open(tokens, idx, options) {
  2311. return (options.xhtmlOut ? '<hr class="footnotes-sep" />\n' : '<hr class="footnotes-sep">\n') +
  2312. '<section class="footnotes">\n' +
  2313. '<ol class="footnotes-list">\n';
  2314. }
  2315. function render_footnote_block_close() {
  2316. return '</ol>\n</section>\n';
  2317. }
  2318. function render_footnote_open(tokens, idx, options, env, slf) {
  2319. var id = slf.rules.footnote_anchor_name(tokens, idx, options, env, slf);
  2320. if (tokens[idx].meta.subId > 0) {
  2321. id += ':' + tokens[idx].meta.subId;
  2322. }
  2323. return '<li id="fn' + id + '" class="footnote-item">';
  2324. }
  2325. function render_footnote_close() {
  2326. return '</li>\n';
  2327. }
  2328. function render_footnote_anchor(tokens, idx, options, env, slf) {
  2329. var id = slf.rules.footnote_anchor_name(tokens, idx, options, env, slf);
  2330. if (tokens[idx].meta.subId > 0) {
  2331. id += ':' + tokens[idx].meta.subId;
  2332. }
  2333. /* ↩ with escape code to prevent display as Apple Emoji on iOS */
  2334. return ' <a href="#fnref' + id + '" class="footnote-backref">\u21a9\uFE0E</a>';
  2335. }
  2336. module.exports = function footnote_plugin(md) {
  2337. var parseLinkLabel = md.helpers.parseLinkLabel,
  2338. isSpace = md.utils.isSpace;
  2339. md.renderer.rules.footnote_ref = render_footnote_ref;
  2340. md.renderer.rules.footnote_block_open = render_footnote_block_open;
  2341. md.renderer.rules.footnote_block_close = render_footnote_block_close;
  2342. md.renderer.rules.footnote_open = render_footnote_open;
  2343. md.renderer.rules.footnote_close = render_footnote_close;
  2344. md.renderer.rules.footnote_anchor = render_footnote_anchor;
  2345. // helpers (only used in other rules, no tokens are attached to those)
  2346. md.renderer.rules.footnote_caption = render_footnote_caption;
  2347. md.renderer.rules.footnote_anchor_name = render_footnote_anchor_name;
  2348. // Process footnote block definition
  2349. function footnote_def(state, startLine, endLine, silent) {
  2350. var oldBMark, oldTShift, oldSCount, oldParentType, pos, label, token,
  2351. initial, offset, ch, posAfterColon,
  2352. start = state.bMarks[startLine] + state.tShift[startLine],
  2353. max = state.eMarks[startLine];
  2354. // line should be at least 5 chars - "[^x]:"
  2355. if (start + 4 > max) { return false; }
  2356. if (state.src.charCodeAt(start) !== 0x5B/* [ */) { return false; }
  2357. if (state.src.charCodeAt(start + 1) !== 0x5E/* ^ */) { return false; }
  2358. for (pos = start + 2; pos < max; pos++) {
  2359. if (state.src.charCodeAt(pos) === 0x20) { return false; }
  2360. if (state.src.charCodeAt(pos) === 0x5D /* ] */) {
  2361. break;
  2362. }
  2363. }
  2364. if (pos === start + 2) { return false; } // no empty footnote labels
  2365. if (pos + 1 >= max || state.src.charCodeAt(++pos) !== 0x3A /* : */) { return false; }
  2366. if (silent) { return true; }
  2367. pos++;
  2368. if (!state.env.footnotes) { state.env.footnotes = {}; }
  2369. if (!state.env.footnotes.refs) { state.env.footnotes.refs = {}; }
  2370. label = state.src.slice(start + 2, pos - 2);
  2371. state.env.footnotes.refs[':' + label] = -1;
  2372. token = new state.Token('footnote_reference_open', '', 1);
  2373. token.meta = { label: label };
  2374. token.level = state.level++;
  2375. state.tokens.push(token);
  2376. oldBMark = state.bMarks[startLine];
  2377. oldTShift = state.tShift[startLine];
  2378. oldSCount = state.sCount[startLine];
  2379. oldParentType = state.parentType;
  2380. posAfterColon = pos;
  2381. initial = offset = state.sCount[startLine] + pos - (state.bMarks[startLine] + state.tShift[startLine]);
  2382. while (pos < max) {
  2383. ch = state.src.charCodeAt(pos);
  2384. if (isSpace(ch)) {
  2385. if (ch === 0x09) {
  2386. offset += 4 - offset % 4;
  2387. } else {
  2388. offset++;
  2389. }
  2390. } else {
  2391. break;
  2392. }
  2393. pos++;
  2394. }
  2395. state.tShift[startLine] = pos - posAfterColon;
  2396. state.sCount[startLine] = offset - initial;
  2397. state.bMarks[startLine] = posAfterColon;
  2398. state.blkIndent += 4;
  2399. state.parentType = 'footnote';
  2400. if (state.sCount[startLine] < state.blkIndent) {
  2401. state.sCount[startLine] += state.blkIndent;
  2402. }
  2403. state.md.block.tokenize(state, startLine, endLine, true);
  2404. state.parentType = oldParentType;
  2405. state.blkIndent -= 4;
  2406. state.tShift[startLine] = oldTShift;
  2407. state.sCount[startLine] = oldSCount;
  2408. state.bMarks[startLine] = oldBMark;
  2409. token = new state.Token('footnote_reference_close', '', -1);
  2410. token.level = --state.level;
  2411. state.tokens.push(token);
  2412. return true;
  2413. }
  2414. // Process inline footnotes (^[...])
  2415. function footnote_inline(state, silent) {
  2416. var labelStart,
  2417. labelEnd,
  2418. footnoteId,
  2419. token,
  2420. tokens,
  2421. max = state.posMax,
  2422. start = state.pos;
  2423. if (start + 2 >= max) { return false; }
  2424. if (state.src.charCodeAt(start) !== 0x5E/* ^ */) { return false; }
  2425. if (state.src.charCodeAt(start + 1) !== 0x5B/* [ */) { return false; }
  2426. labelStart = start + 2;
  2427. labelEnd = parseLinkLabel(state, start + 1);
  2428. // parser failed to find ']', so it's not a valid note
  2429. if (labelEnd < 0) { return false; }
  2430. // We found the end of the link, and know for a fact it's a valid link;
  2431. // so all that's left to do is to call tokenizer.
  2432. //
  2433. if (!silent) {
  2434. if (!state.env.footnotes) { state.env.footnotes = {}; }
  2435. if (!state.env.footnotes.list) { state.env.footnotes.list = []; }
  2436. footnoteId = state.env.footnotes.list.length;
  2437. state.md.inline.parse(
  2438. state.src.slice(labelStart, labelEnd),
  2439. state.md,
  2440. state.env,
  2441. tokens = []
  2442. );
  2443. token = state.push('footnote_ref', '', 0);
  2444. token.meta = { id: footnoteId };
  2445. state.env.footnotes.list[footnoteId] = { tokens: tokens };
  2446. }
  2447. state.pos = labelEnd + 1;
  2448. state.posMax = max;
  2449. return true;
  2450. }
  2451. // Process footnote references ([^...])
  2452. function footnote_ref(state, silent) {
  2453. var label,
  2454. pos,
  2455. footnoteId,
  2456. footnoteSubId,
  2457. token,
  2458. max = state.posMax,
  2459. start = state.pos;
  2460. // should be at least 4 chars - "[^x]"
  2461. if (start + 3 > max) { return false; }
  2462. if (!state.env.footnotes || !state.env.footnotes.refs) { return false; }
  2463. if (state.src.charCodeAt(start) !== 0x5B/* [ */) { return false; }
  2464. if (state.src.charCodeAt(start + 1) !== 0x5E/* ^ */) { return false; }
  2465. for (pos = start + 2; pos < max; pos++) {
  2466. if (state.src.charCodeAt(pos) === 0x20) { return false; }
  2467. if (state.src.charCodeAt(pos) === 0x0A) { return false; }
  2468. if (state.src.charCodeAt(pos) === 0x5D /* ] */) {
  2469. break;
  2470. }
  2471. }
  2472. if (pos === start + 2) { return false; } // no empty footnote labels
  2473. if (pos >= max) { return false; }
  2474. pos++;
  2475. label = state.src.slice(start + 2, pos - 1);
  2476. if (typeof state.env.footnotes.refs[':' + label] === 'undefined') { return false; }
  2477. if (!silent) {
  2478. if (!state.env.footnotes.list) { state.env.footnotes.list = []; }
  2479. if (state.env.footnotes.refs[':' + label] < 0) {
  2480. footnoteId = state.env.footnotes.list.length;
  2481. state.env.footnotes.list[footnoteId] = { label: label, count: 0 };
  2482. state.env.footnotes.refs[':' + label] = footnoteId;
  2483. } else {
  2484. footnoteId = state.env.footnotes.refs[':' + label];
  2485. }
  2486. footnoteSubId = state.env.footnotes.list[footnoteId].count;
  2487. state.env.footnotes.list[footnoteId].count++;
  2488. token = state.push('footnote_ref', '', 0);
  2489. token.meta = { id: footnoteId, subId: footnoteSubId, label: label };
  2490. }
  2491. state.pos = pos;
  2492. state.posMax = max;
  2493. return true;
  2494. }
  2495. // Glue footnote tokens to end of token stream
  2496. function footnote_tail(state) {
  2497. var i, l, j, t, lastParagraph, list, token, tokens, current, currentLabel,
  2498. insideRef = false,
  2499. refTokens = {};
  2500. if (!state.env.footnotes) { return; }
  2501. state.tokens = state.tokens.filter(function (tok) {
  2502. if (tok.type === 'footnote_reference_open') {
  2503. insideRef = true;
  2504. current = [];
  2505. currentLabel = tok.meta.label;
  2506. return false;
  2507. }
  2508. if (tok.type === 'footnote_reference_close') {
  2509. insideRef = false;
  2510. // prepend ':' to avoid conflict with Object.prototype members
  2511. refTokens[':' + currentLabel] = current;
  2512. return false;
  2513. }
  2514. if (insideRef) { current.push(tok); }
  2515. return !insideRef;
  2516. });
  2517. if (!state.env.footnotes.list) { return; }
  2518. list = state.env.footnotes.list;
  2519. token = new state.Token('footnote_block_open', '', 1);
  2520. state.tokens.push(token);
  2521. for (i = 0, l = list.length; i < l; i++) {
  2522. token = new state.Token('footnote_open', '', 1);
  2523. token.meta = { id: i, label: list[i].label };
  2524. state.tokens.push(token);
  2525. if (list[i].tokens) {
  2526. tokens = [];
  2527. token = new state.Token('paragraph_open', 'p', 1);
  2528. token.block = true;
  2529. tokens.push(token);
  2530. token = new state.Token('inline', '', 0);
  2531. token.children = list[i].tokens;
  2532. token.content = '';
  2533. tokens.push(token);
  2534. token = new state.Token('paragraph_close', 'p', -1);
  2535. token.block = true;
  2536. tokens.push(token);
  2537. } else if (list[i].label) {
  2538. tokens = refTokens[':' + list[i].label];
  2539. }
  2540. state.tokens = state.tokens.concat(tokens);
  2541. if (state.tokens[state.tokens.length - 1].type === 'paragraph_close') {
  2542. lastParagraph = state.tokens.pop();
  2543. } else {
  2544. lastParagraph = null;
  2545. }
  2546. t = list[i].count > 0 ? list[i].count : 1;
  2547. for (j = 0; j < t; j++) {
  2548. token = new state.Token('footnote_anchor', '', 0);
  2549. token.meta = { id: i, subId: j, label: list[i].label };
  2550. state.tokens.push(token);
  2551. }
  2552. if (lastParagraph) {
  2553. state.tokens.push(lastParagraph);
  2554. }
  2555. token = new state.Token('footnote_close', '', -1);
  2556. state.tokens.push(token);
  2557. }
  2558. token = new state.Token('footnote_block_close', '', -1);
  2559. state.tokens.push(token);
  2560. }
  2561. md.block.ruler.before('reference', 'footnote_def', footnote_def, { alt: [ 'paragraph', 'reference' ] });
  2562. md.inline.ruler.after('image', 'footnote_inline', footnote_inline);
  2563. md.inline.ruler.after('footnote_inline', 'footnote_ref', footnote_ref);
  2564. md.core.ruler.after('inline', 'footnote_tail', footnote_tail);
  2565. };
  2566. /***/ }),
  2567. /* 10 */
  2568. /***/ (function(module, exports, __webpack_require__) {
  2569. "use strict";
  2570. module.exports = __webpack_require__(37);
  2571. /***/ }),
  2572. /* 11 */
  2573. /***/ (function(module, exports, __webpack_require__) {
  2574. "use strict";
  2575. // HTML5 entities map: { name -> utf16string }
  2576. //
  2577. /*eslint quotes:0*/
  2578. module.exports = __webpack_require__(24);
  2579. /***/ }),
  2580. /* 12 */
  2581. /***/ (function(module, exports, __webpack_require__) {
  2582. "use strict";
  2583. // Regexps to match html elements
  2584. var attr_name = '[a-zA-Z_:][a-zA-Z0-9:._-]*';
  2585. var unquoted = '[^"\'=<>`\\x00-\\x20]+';
  2586. var single_quoted = "'[^']*'";
  2587. var double_quoted = '"[^"]*"';
  2588. var attr_value = '(?:' + unquoted + '|' + single_quoted + '|' + double_quoted + ')';
  2589. var attribute = '(?:\\s+' + attr_name + '(?:\\s*=\\s*' + attr_value + ')?)';
  2590. var open_tag = '<[A-Za-z][A-Za-z0-9\\-]*' + attribute + '*\\s*\\/?>';
  2591. var close_tag = '<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>';
  2592. var comment = '<!---->|<!--(?:-?[^>-])(?:-?[^-])*-->';
  2593. var processing = '<[?].*?[?]>';
  2594. var declaration = '<![A-Z]+\\s+[^>]*>';
  2595. var cdata = '<!\\[CDATA\\[[\\s\\S]*?\\]\\]>';
  2596. var HTML_TAG_RE = new RegExp('^(?:' + open_tag + '|' + close_tag + '|' + comment +
  2597. '|' + processing + '|' + declaration + '|' + cdata + ')');
  2598. var HTML_OPEN_CLOSE_TAG_RE = new RegExp('^(?:' + open_tag + '|' + close_tag + ')');
  2599. module.exports.HTML_TAG_RE = HTML_TAG_RE;
  2600. module.exports.HTML_OPEN_CLOSE_TAG_RE = HTML_OPEN_CLOSE_TAG_RE;
  2601. /***/ }),
  2602. /* 13 */
  2603. /***/ (function(module, exports, __webpack_require__) {
  2604. "use strict";
  2605. // Process *this* and _that_
  2606. //
  2607. // Insert each marker as a separate text token, and add it to delimiter list
  2608. //
  2609. module.exports.tokenize = function emphasis(state, silent) {
  2610. var i, scanned, token,
  2611. start = state.pos,
  2612. marker = state.src.charCodeAt(start);
  2613. if (silent) { return false; }
  2614. if (marker !== 0x5F /* _ */ && marker !== 0x2A /* * */) { return false; }
  2615. scanned = state.scanDelims(state.pos, marker === 0x2A);
  2616. for (i = 0; i < scanned.length; i++) {
  2617. token = state.push('text', '', 0);
  2618. token.content = String.fromCharCode(marker);
  2619. state.delimiters.push({
  2620. // Char code of the starting marker (number).
  2621. //
  2622. marker: marker,
  2623. // Total length of these series of delimiters.
  2624. //
  2625. length: scanned.length,
  2626. // An amount of characters before this one that's equivalent to
  2627. // current one. In plain English: if this delimiter does not open
  2628. // an emphasis, neither do previous `jump` characters.
  2629. //
  2630. // Used to skip sequences like "*****" in one step, for 1st asterisk
  2631. // value will be 0, for 2nd it's 1 and so on.
  2632. //
  2633. jump: i,
  2634. // A position of the token this delimiter corresponds to.
  2635. //
  2636. token: state.tokens.length - 1,
  2637. // Token level.
  2638. //
  2639. level: state.level,
  2640. // If this delimiter is matched as a valid opener, `end` will be
  2641. // equal to its position, otherwise it's `-1`.
  2642. //
  2643. end: -1,
  2644. // Boolean flags that determine if this delimiter could open or close
  2645. // an emphasis.
  2646. //
  2647. open: scanned.can_open,
  2648. close: scanned.can_close
  2649. });
  2650. }
  2651. state.pos += scanned.length;
  2652. return true;
  2653. };
  2654. // Walk through delimiter list and replace text tokens with tags
  2655. //
  2656. module.exports.postProcess = function emphasis(state) {
  2657. var i,
  2658. startDelim,
  2659. endDelim,
  2660. token,
  2661. ch,
  2662. isStrong,
  2663. delimiters = state.delimiters,
  2664. max = state.delimiters.length;
  2665. for (i = 0; i < max; i++) {
  2666. startDelim = delimiters[i];
  2667. if (startDelim.marker !== 0x5F/* _ */ && startDelim.marker !== 0x2A/* * */) {
  2668. continue;
  2669. }
  2670. // Process only opening markers
  2671. if (startDelim.end === -1) {
  2672. continue;
  2673. }
  2674. endDelim = delimiters[startDelim.end];
  2675. // If the next delimiter has the same marker and is adjacent to this one,
  2676. // merge those into one strong delimiter.
  2677. //
  2678. // `<em><em>whatever</em></em>` -> `<strong>whatever</strong>`
  2679. //
  2680. isStrong = i + 1 < max &&
  2681. delimiters[i + 1].end === startDelim.end - 1 &&
  2682. delimiters[i + 1].token === startDelim.token + 1 &&
  2683. delimiters[startDelim.end - 1].token === endDelim.token - 1 &&
  2684. delimiters[i + 1].marker === startDelim.marker;
  2685. ch = String.fromCharCode(startDelim.marker);
  2686. token = state.tokens[startDelim.token];
  2687. token.type = isStrong ? 'strong_open' : 'em_open';
  2688. token.tag = isStrong ? 'strong' : 'em';
  2689. token.nesting = 1;
  2690. token.markup = isStrong ? ch + ch : ch;
  2691. token.content = '';
  2692. token = state.tokens[endDelim.token];
  2693. token.type = isStrong ? 'strong_close' : 'em_close';
  2694. token.tag = isStrong ? 'strong' : 'em';
  2695. token.nesting = -1;
  2696. token.markup = isStrong ? ch + ch : ch;
  2697. token.content = '';
  2698. if (isStrong) {
  2699. state.tokens[delimiters[i + 1].token].content = '';
  2700. state.tokens[delimiters[startDelim.end - 1].token].content = '';
  2701. i++;
  2702. }
  2703. }
  2704. };
  2705. /***/ }),
  2706. /* 14 */
  2707. /***/ (function(module, exports, __webpack_require__) {
  2708. "use strict";
  2709. // ~~strike through~~
  2710. //
  2711. // Insert each marker as a separate text token, and add it to delimiter list
  2712. //
  2713. module.exports.tokenize = function strikethrough(state, silent) {
  2714. var i, scanned, token, len, ch,
  2715. start = state.pos,
  2716. marker = state.src.charCodeAt(start);
  2717. if (silent) { return false; }
  2718. if (marker !== 0x7E/* ~ */) { return false; }
  2719. scanned = state.scanDelims(state.pos, true);
  2720. len = scanned.length;
  2721. ch = String.fromCharCode(marker);
  2722. if (len < 2) { return false; }
  2723. if (len % 2) {
  2724. token = state.push('text', '', 0);
  2725. token.content = ch;
  2726. len--;
  2727. }
  2728. for (i = 0; i < len; i += 2) {
  2729. token = state.push('text', '', 0);
  2730. token.content = ch + ch;
  2731. state.delimiters.push({
  2732. marker: marker,
  2733. jump: i,
  2734. token: state.tokens.length - 1,
  2735. level: state.level,
  2736. end: -1,
  2737. open: scanned.can_open,
  2738. close: scanned.can_close
  2739. });
  2740. }
  2741. state.pos += scanned.length;
  2742. return true;
  2743. };
  2744. // Walk through delimiter list and replace text tokens with tags
  2745. //
  2746. module.exports.postProcess = function strikethrough(state) {
  2747. var i, j,
  2748. startDelim,
  2749. endDelim,
  2750. token,
  2751. loneMarkers = [],
  2752. delimiters = state.delimiters,
  2753. max = state.delimiters.length;
  2754. for (i = 0; i < max; i++) {
  2755. startDelim = delimiters[i];
  2756. if (startDelim.marker !== 0x7E/* ~ */) {
  2757. continue;
  2758. }
  2759. if (startDelim.end === -1) {
  2760. continue;
  2761. }
  2762. endDelim = delimiters[startDelim.end];
  2763. token = state.tokens[startDelim.token];
  2764. token.type = 's_open';
  2765. token.tag = 's';
  2766. token.nesting = 1;
  2767. token.markup = '~~';
  2768. token.content = '';
  2769. token = state.tokens[endDelim.token];
  2770. token.type = 's_close';
  2771. token.tag = 's';
  2772. token.nesting = -1;
  2773. token.markup = '~~';
  2774. token.content = '';
  2775. if (state.tokens[endDelim.token - 1].type === 'text' &&
  2776. state.tokens[endDelim.token - 1].content === '~') {
  2777. loneMarkers.push(endDelim.token - 1);
  2778. }
  2779. }
  2780. // If a marker sequence has an odd number of characters, it's splitted
  2781. // like this: `~~~~~` -> `~` + `~~` + `~~`, leaving one marker at the
  2782. // start of the sequence.
  2783. //
  2784. // So, we have to move all those markers after subsequent s_close tags.
  2785. //
  2786. while (loneMarkers.length) {
  2787. i = loneMarkers.pop();
  2788. j = i + 1;
  2789. while (j < state.tokens.length && state.tokens[j].type === 's_close') {
  2790. j++;
  2791. }
  2792. j--;
  2793. if (i !== j) {
  2794. token = state.tokens[j];
  2795. state.tokens[j] = state.tokens[i];
  2796. state.tokens[i] = token;
  2797. }
  2798. }
  2799. };
  2800. /***/ }),
  2801. /* 15 */
  2802. /***/ (function(module, exports, __webpack_require__) {
  2803. "use strict";
  2804. module.exports.encode = __webpack_require__(77);
  2805. module.exports.decode = __webpack_require__(76);
  2806. module.exports.format = __webpack_require__(78);
  2807. module.exports.parse = __webpack_require__(79);
  2808. /***/ }),
  2809. /* 16 */
  2810. /***/ (function(module, exports) {
  2811. module.exports=/[\0-\x1F\x7F-\x9F]/
  2812. /***/ }),
  2813. /* 17 */
  2814. /***/ (function(module, exports) {
  2815. module.exports=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/
  2816. /***/ }),
  2817. /* 18 */
  2818. /***/ (function(module, exports) {
  2819. module.exports=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/
  2820. /***/ }),
  2821. /* 19 */
  2822. /***/ (function(module, exports, __webpack_require__) {
  2823. /**
  2824. * @Author: Bachir Soussi Chiadmi <bach>
  2825. * @Date: 16-04-2017
  2826. * @Email: bachir@figureslibres.io
  2827. * @Last modified by: bach
  2828. * @Last modified time: 18-04-2017
  2829. * @License: GPL-V3
  2830. */
  2831. __webpack_require__(28);
  2832. __webpack_require__(25);
  2833. __webpack_require__(26);
  2834. __webpack_require__(27);
  2835. var m = __webpack_require__(1);
  2836. // var marked = require('marked');
  2837. // var _helpers = require('modules/helpers');
  2838. var _dbs = __webpack_require__(2);
  2839. var _Inline = __webpack_require__(21);
  2840. var _Tree = __webpack_require__(22);
  2841. function init(){
  2842. _dbs.load(function(){
  2843. console.log("Init _dbs.data", _dbs.data);
  2844. console.log("Init _dbs.data_byid", _dbs.data_byid);
  2845. console.log("Init _dbs.data_strct", _dbs.data_strct);
  2846. m.route.prefix("");
  2847. m.route(document.body, "/lat/inline", {
  2848. "/:lang/inline": _Inline,
  2849. "/:lang/tree": _Tree,
  2850. });
  2851. });
  2852. };
  2853. // ___
  2854. // / | ____ ____
  2855. // / /| | / __ \/ __ \
  2856. // / ___ |/ /_/ / /_/ /
  2857. // /_/ |_/ .___/ .___/
  2858. // /_/ /_/
  2859. // var _App = {
  2860. // view: function(){
  2861. // console.log('_App view', _lang);
  2862. // return [
  2863. // m('header', [
  2864. // m('h1', 'Ethica'),
  2865. // m('aside', {'id':"menus"}, m(_LangMenu) )
  2866. // ]),
  2867. // m(_Tree),
  2868. // m('footer', [
  2869. // m('p', m.trust('© 2017 <a href="./">Ethica Spinoza</a>'))
  2870. // ])
  2871. // ]
  2872. // }
  2873. // }
  2874. // _ _ __
  2875. // (_)___ (_) /_
  2876. // / / __ \/ / __/
  2877. // / / / / / / /_
  2878. // /_/_/ /_/_/\__/
  2879. init()
  2880. /***/ }),
  2881. /* 20 */
  2882. /***/ (function(module, exports) {
  2883. // removed by extract-text-webpack-plugin
  2884. /***/ }),
  2885. /* 21 */
  2886. /***/ (function(module, exports, __webpack_require__) {
  2887. var m = __webpack_require__(1);
  2888. // https://github.com/markdown-it/markdown-it
  2889. var markdown = __webpack_require__(10)()
  2890. .use(__webpack_require__(9));
  2891. var _dbs = __webpack_require__(2);
  2892. var _Header = __webpack_require__(8);
  2893. var _Footer = __webpack_require__(7);
  2894. var _Ui = __webpack_require__(23);
  2895. // __ _ __
  2896. // / / (_)___ / /__
  2897. // / / / / __ \/ //_/
  2898. // / /___/ / / / / ,<
  2899. // /_____/_/_/ /_/_/|_|
  2900. var _Link = {
  2901. tid:"",
  2902. opened:false,
  2903. oninit: function(vn){
  2904. // console.log("INIT LINK : vn", vn);
  2905. // define target id
  2906. this.tid = vn.attrs.href;
  2907. },
  2908. onbeforeupdate: function(vn){
  2909. this.tid = vn.attrs.href;
  2910. },
  2911. view: function(vn){
  2912. this.tid_known = typeof _dbs.data_byid[_dbs.lang][this.tid] === 'undefined' ? false : true;
  2913. if (!this.tid_known) {
  2914. console.log('!! target id '+this.tid+' unkonwn !!');
  2915. }
  2916. if(this.opened && this.tid_known){
  2917. // console.log('this.tid', vn.state);
  2918. return m('div', {'class':'opened-link'},
  2919. [
  2920. m('span', {'class':"link text"}, vn.children),
  2921. typeof _dbs.data_byid[_dbs.lang][this.tid].childs != "undefined"
  2922. ? m(_Enonce, _dbs.data_byid[_dbs.lang][this.tid])
  2923. : m(_Item, _dbs.data_byid[_dbs.lang][this.tid])
  2924. ]
  2925. );
  2926. }else{
  2927. // console.log(vn);
  2928. return m('a', {
  2929. 'class':'link',
  2930. 'href':'#'+this.tid,
  2931. 'rel':this.tid,
  2932. onclick:function(e){
  2933. e.preventDefault();
  2934. console.log('click', this);
  2935. vn.state.opened = true;
  2936. return false;
  2937. }
  2938. }, vn.children); // c'est quoi ce vn.children ?
  2939. }
  2940. }
  2941. }
  2942. // ______ __
  2943. // /_ __/__ _ __/ /_
  2944. // / / / _ \| |/_/ __/
  2945. // / / / __/> </ /_
  2946. // /_/ \___/_/|_|\__/
  2947. // recusive function to record information of all subnodes
  2948. function parseTextDom(nodes){
  2949. var list = [];
  2950. // loop through childNodes
  2951. for (var i = 0; i < nodes.length; i++) {
  2952. var n = {};
  2953. if(typeof nodes[i].localName != "undefined"){
  2954. n.tag=nodes[i].localName;
  2955. if (n.tag == 'p') {
  2956. // replace p by div as we will insert other div in them
  2957. n.tag = 'div';
  2958. n.attrs = {'class':'paragraph'};
  2959. }
  2960. if (n.tag == 'a') {
  2961. // record the href attribute for cross reference
  2962. n.attrs = {'href':nodes[i].attributes.href.value};
  2963. }
  2964. if(nodes[i].childNodes.length){
  2965. // again parse node's childs
  2966. n.childs = parseTextDom(nodes[i].childNodes);
  2967. }
  2968. }else if (nodes[i].textContent.length > 1){
  2969. // if node has no localName it is probably a #text node
  2970. // we record it if it's not empty
  2971. n.tag='#text';
  2972. n.text=nodes[i].textContent;
  2973. }
  2974. // add the node to the list if it has a tag
  2975. if(typeof n.tag != "undefined")
  2976. list.push(n);
  2977. }
  2978. return list;
  2979. }
  2980. // recusive fucntion to generate mithril object from information recorded with parseTextDom()
  2981. function populateTextDom(n,i){
  2982. // console.log('populateTextDom : '+i,n);
  2983. return n.tag == "#text"
  2984. ? m.trust(n.text)
  2985. : m(
  2986. n.tag != 'a' ? n.tag : _Link,
  2987. typeof n.attrs != "undefined" ? n.attrs : {},
  2988. typeof n.childs != "undefined"
  2989. ? n.childs.map(populateTextDom)
  2990. : typeof n.text != "undefined"
  2991. ? m.trust(n.text)
  2992. : null
  2993. );
  2994. }
  2995. var _Text = {
  2996. id:null,
  2997. text:"",
  2998. texthtml:"",
  2999. textdom:null,
  3000. textchilds:[],
  3001. parsetext: function(){
  3002. // console.log('parsetext', this);
  3003. // !! we need to convert markdown to html here because parseTextDom() is recursive through nodes tree
  3004. // convert markdown to html
  3005. this.texthtml = markdown.render(this.text)
  3006. // TODO: fixe number link text disapear [3](1d3) ( in 104d )
  3007. // TODO: fixe parenthèse disparait _(par les Défin. [test 3](1d3) et [test 5](1d5))_ ( in 104d )
  3008. // parse html string to virtual dom
  3009. this.textdom = new DOMParser().parseFromString(this.texthtml, "text/html");
  3010. // get the text nodes (avoid html document extra)
  3011. this.textchilds = parseTextDom(this.textdom.getElementsByTagName('body')[0].childNodes);
  3012. },
  3013. oninit: function(vn){
  3014. this.id = vn.attrs.id;
  3015. this.text = vn.attrs.text || "";
  3016. this.parsetext();
  3017. },
  3018. onbeforeupdate: function(vn,old){
  3019. this.text = vn.attrs.text;
  3020. this.parsetext();
  3021. },
  3022. view: function(vn){
  3023. // console.log('_Text :: view : '+vn.attrs.slug, vn);
  3024. return m('div',
  3025. {'class':'text'},
  3026. // loop through childNodes list generated by parseTextDom() in init
  3027. this.textchilds.map(populateTextDom)
  3028. ); // /m.div.text
  3029. } // view:
  3030. }
  3031. // ______
  3032. // / _/ /____ ____ ___
  3033. // / // __/ _ \/ __ `__ \
  3034. // _/ // /_/ __/ / / / / /
  3035. // /___/\__/\___/_/ /_/ /_/
  3036. var _Item = {
  3037. id:null,
  3038. part:null,
  3039. type:null,
  3040. nested:false,
  3041. oninit: function(vn){
  3042. // console.log('vn.attrs', vn.attrs);
  3043. this.id = vn.attrs.id;
  3044. this.type = vn.attrs.type;
  3045. // vn.state.part = vn.state.slug.match(/^(\d)(.+)/)[1];
  3046. this.text = vn.attrs.text;
  3047. this.nested = vn.attrs.nested || false;
  3048. },
  3049. onbeforeupdate: function(vn, old){
  3050. this.nested = vn.attrs.nested || false;
  3051. this.type = vn.attrs.type;
  3052. this.text = vn.attrs.text;
  3053. },
  3054. view: function(vn){
  3055. return m("section", {
  3056. 'id':this.id,
  3057. 'class':'item'+(this.nested ? ' nested':'')
  3058. },
  3059. [
  3060. // create title node
  3061. m("h3", {
  3062. // 'ref':vn.attrs.href,
  3063. onclick: function(e){
  3064. vn.state.active = vn.state.active ? 0 : 1;
  3065. }
  3066. }, this.type),
  3067. // create text node
  3068. m(_Text, {'text':this.text, 'id':this.id})
  3069. ]
  3070. )
  3071. }
  3072. };
  3073. // ______
  3074. // / ____/___ ____ ____ ________
  3075. // / __/ / __ \/ __ \/ __ \/ ___/ _ \
  3076. // / /___/ / / / /_/ / / / / /__/ __/
  3077. // /_____/_/ /_/\____/_/ /_/\___/\___/
  3078. var _Enonce = {
  3079. partid:null,
  3080. id:null,
  3081. title:null,
  3082. text:null,
  3083. nested:false,
  3084. childs:[],
  3085. oninit:function(vn){
  3086. // // console.log('Enonce on init', vn);
  3087. this.partid = vn.attrs.partid;
  3088. this.id = vn.attrs.id;
  3089. this.title = vn.attrs.title;
  3090. this.text = vn.attrs.text;
  3091. this.childs = vn.attrs.childs || [];
  3092. this.nested = vn.attrs.nested || false;
  3093. },
  3094. onbeforeupdate:function(vn, old) {
  3095. // console.log(vn.attrs.childs);
  3096. this.title = vn.attrs.title;
  3097. this.text = vn.attrs.text;
  3098. this.childs = vn.attrs.childs;
  3099. this.nested = vn.attrs.nested || false;
  3100. // if(vn.attrs.id == '1d1') console.log('_Enonce UPDATE, text :', vn.attrs.text);
  3101. },
  3102. view: function(vn){
  3103. // if(vn.attrs.id == '1d1') console.log('_Enonce VIEW, text :', vn.attrs.text);
  3104. return m("section", {
  3105. 'id' :this.id,
  3106. 'class' :'enonce'+(this.nested ? ' nested':'')
  3107. },
  3108. [
  3109. // create title node
  3110. m("h2", {}, this.title),
  3111. // create text node
  3112. m(_Text, {'text':this.text, 'id':this.id}),
  3113. // addd children
  3114. this.childs.map(function(c){
  3115. return m(_Item, c)
  3116. })
  3117. ])
  3118. }
  3119. }
  3120. // ____ __
  3121. // / __ \____ ______/ /_
  3122. // / /_/ / __ `/ ___/ __/
  3123. // / ____/ /_/ / / / /_
  3124. // /_/ \__,_/_/ \__/
  3125. var _Part = {
  3126. oninit: function(vn){
  3127. this.id = vn.attrs.id;
  3128. this.title = vn.attrs.title || '';
  3129. this.enonces = vn.attrs.enonces;
  3130. },
  3131. onbeforeupdate: function(vn, old){
  3132. // console.log('_Part, onbeforeupdate old',old);
  3133. this.title = vn.attrs.title || '';
  3134. this.enonces = vn.attrs.enonces;
  3135. },
  3136. view: function(vn){
  3137. // console.log(vn.attrs.enonces);
  3138. return m("section", {
  3139. 'id' :this.id,
  3140. 'class' :'part'
  3141. },
  3142. [
  3143. // create title node
  3144. m("h1", {'class':'part-title', 'part':this.id}, m.trust(markdown.renderInline(this.title))),
  3145. // create text node
  3146. this.enonces.map(function(e){
  3147. // console.log(e.type);
  3148. // var title = e.title || '';
  3149. switch (e.type) {
  3150. case "title":
  3151. // handle titles
  3152. // console.log('title');
  3153. return m("h2", {'class':'title'}, m.trust(markdown.renderInline(e.title)));
  3154. break;
  3155. case "filet":
  3156. // handle filets
  3157. // console.log('filet');
  3158. return m("h4", {'class':'filet'}, m.trust(markdown.renderInline(e.title)));
  3159. break;
  3160. default:
  3161. // or build structure
  3162. return m(_Enonce, Object.assign({"partid":this.id},e));
  3163. }
  3164. })
  3165. ]
  3166. )
  3167. }
  3168. }
  3169. // ____ __ _
  3170. // / _/___ / / (_)___ ___
  3171. // / // __ \/ / / / __ \/ _ \
  3172. // _/ // / / / /___/ / / / / __/
  3173. // /___/_/ /_/_____/_/_/ /_/\___/
  3174. module.exports = {
  3175. // oninit : function(vn){
  3176. // this.lang = vn.attrs.lang;
  3177. // },
  3178. oncreate: function(vn){
  3179. document.body.classList.add('inline');
  3180. _Ui.init();
  3181. },
  3182. view: function(vn){
  3183. console.log('_Inline view', vn.attrs.lang);
  3184. return [
  3185. m(_Header),
  3186. m('main', {id:"content", 'class':'inline'}, _dbs.data[vn.attrs.lang].map(function(p){
  3187. // console.log("MAP _dbs", p);
  3188. return m(_Part,p);
  3189. })
  3190. ),
  3191. m(_Footer)
  3192. ]
  3193. }
  3194. }
  3195. /***/ }),
  3196. /* 22 */
  3197. /***/ (function(module, exports, __webpack_require__) {
  3198. var m = __webpack_require__(1);
  3199. // https://github.com/markdown-it/markdown-it
  3200. var markdown = __webpack_require__(10)()
  3201. .use(__webpack_require__(9));
  3202. var _dbs = __webpack_require__(2);
  3203. var _Header = __webpack_require__(8);
  3204. var _Footer = __webpack_require__(7);
  3205. var _Ui = __webpack_require__(23);
  3206. // ____ __
  3207. // / __ \____ / /_
  3208. // / / / / __ \/ __/
  3209. // / /_/ / /_/ / /_
  3210. // /_____/\____/\__/
  3211. var _Dot = {
  3212. id:null,
  3213. type:'',
  3214. text:'',
  3215. summary:'',
  3216. active:true,
  3217. opened:false,
  3218. links:null,
  3219. parents:[],
  3220. lang:_dbs.lang,
  3221. setuptext:function(vn){
  3222. // console.log('setuptext', vn);
  3223. // construct text
  3224. this.text = markdown.render(vn.attrs.text);
  3225. // construct summary
  3226. // TODO: summary needs more work (strip tags, markdown render)
  3227. this.summary = vn.attrs.text.match('([^ ]*[ ]{0,1}){1,6}')[0];
  3228. this.summary = this.summary.trim().replace(/_([^_]+)$/g, "_$1_");
  3229. this.summary = this.summary.replace(/\[([^\]]+)$/g, "$1");
  3230. this.summary = markdown.renderInline(this.summary) + "&nbsp;…";
  3231. },
  3232. oninit: function(vn){
  3233. this.id = vn.attrs.id;
  3234. this.type = vn.attrs.type;
  3235. this.setuptext(vn);
  3236. if(typeof vn.attrs.active !== 'undefined')
  3237. this.active = vn.attrs.active;
  3238. // links
  3239. this.links = _dbs.data_strct[this.id];
  3240. // console.log(this.links);
  3241. // parents memorize where do we come from to avoid duplicates and looping nav
  3242. if(vn.attrs.parents){
  3243. this.parents = this.parents.concat(vn.attrs.parents);
  3244. // console.log('_Dot init '+this.id+' parents :',this.parents);
  3245. }
  3246. },
  3247. oncreate: function(vn){
  3248. if(this.active){
  3249. vn.dom.classList.remove('disabled');
  3250. }else{
  3251. vn.dom.classList.add('disabled');
  3252. }
  3253. },
  3254. onbeforeupdate: function(vn){
  3255. // console.log('onbeforeupdate');
  3256. if(this.lang != _dbs.lang){
  3257. this.lang = _dbs.lang;
  3258. this.setuptext(vn);
  3259. }
  3260. },
  3261. view: function(vn){
  3262. if (this.active && this.opened) {
  3263. // full view of dot with linked dots
  3264. // console.log('_Dot view '+this.id+' parents :',this.parents);
  3265. var dot_content = [
  3266. // links to
  3267. this.links.to.length
  3268. ? m('nav', {'class':'links to'}, this.links.to.map(function(id){
  3269. // console.log(id);
  3270. if(typeof _dbs.data_byid[_dbs.lang][id] !== 'undefined'){
  3271. return m(_Dot, {
  3272. "id":id,
  3273. 'text':_dbs.data_byid[_dbs.lang][id].text,
  3274. 'type':'',
  3275. // passe the memory of crossed dots plus the current one
  3276. 'parents':vn.state.parents.concat([vn.state.id]),
  3277. // activate link only if not in parents (already went through it)
  3278. 'active':vn.state.parents.indexOf(id) == -1 ? true:false
  3279. });
  3280. }
  3281. })
  3282. )
  3283. : null,
  3284. // id
  3285. m('span', {'class':'id'}, this.id), // this.type+' '+
  3286. // bullet
  3287. m('span', {'class':'bullet'}, m.trust('&#9899;')),
  3288. // full text
  3289. m('section', {
  3290. 'class':'text',
  3291. onmouseover: function(e){
  3292. e.preventDefault();
  3293. if(e.target.nodeName == "A" ){
  3294. // console.log("over e.target", e.target);
  3295. // console.log('over vn', vn);
  3296. var id = e.target.getAttribute("href");
  3297. // add highlight class
  3298. vn.dom.querySelector('nav.links>div[uid="'+id+'"]').classList.add('highlight');
  3299. }else{
  3300. // remove all hilight class
  3301. for (link of vn.dom.querySelectorAll('nav.links>div.dot')) {
  3302. link.classList.remove('highlight');
  3303. }
  3304. }
  3305. },
  3306. onclick:function(e){
  3307. e.preventDefault();
  3308. if(e.target.nodeName == "A" ){
  3309. // console.log("over e.target", e.target);
  3310. // console.log('over vn', vn);
  3311. var id = e.target.getAttribute("href");
  3312. // add highlight class
  3313. vn.dom.querySelector('nav.links>div[uid="'+id+'"]>.summary').click();
  3314. }
  3315. }
  3316. }, m.trust(this.text)),
  3317. // links from
  3318. this.links.from.length
  3319. ? m('nav', {'class':'links from'}, this.links.from.map(function(id){
  3320. // retrun a dot
  3321. return m(_Dot, {
  3322. "id":id,
  3323. 'text':_dbs.data_byid[_dbs.lang][id].text,
  3324. 'type':'',
  3325. // passe the memory of crossed dots plus the current one
  3326. 'parents':vn.state.parents.concat([vn.state.id]),
  3327. // activate link only if not in parents (already went through it)
  3328. 'active':vn.state.parents.indexOf(id) == -1 ? true:false
  3329. });
  3330. })
  3331. )
  3332. : null
  3333. ];
  3334. }else{
  3335. // preview dot
  3336. var dot_content = [
  3337. m('span', {'class':'id'}, this.id), // this.type+' '+
  3338. m('span', {'class':'bullet'}, m.trust('&#8226;')),
  3339. m('p', {
  3340. 'class':'summary',
  3341. onclick:function(e){
  3342. // TODO: animate openening (text and links separatly)
  3343. vn.state.opened = true;
  3344. }
  3345. }, m.trust(this.summary))
  3346. ];
  3347. }
  3348. return m('div',{
  3349. 'uid':this.id,
  3350. 'class':'dot'
  3351. },
  3352. dot_content
  3353. );
  3354. },
  3355. onupdate: function(vn){
  3356. // console.log('_Dot : onupdate', vn);
  3357. if(this.active){
  3358. if (this.opened){
  3359. vn.dom.classList.add('opened');
  3360. if(this.links.to.length)
  3361. vn.dom.classList.add('to-links');
  3362. if(this.links.from.length)
  3363. vn.dom.classList.add('from-links');
  3364. }else{
  3365. vn.dom.classList.remove('opened');
  3366. }
  3367. }
  3368. }
  3369. }
  3370. /*
  3371. down vote
  3372. Here's full list of black dotlikes from unicode
  3373. ● - &#9679; - Black Circle
  3374. ⏺ - &#9210; - Black Circle for Record
  3375. ⚫ - &#9899; - Medium Black Circle
  3376. ⬤ - &#11044; - Black Large Circle
  3377. ⧭ - &#10733; - Black Circle with Down Arrow
  3378. 🞄 - &#128900; - Black Slightly Small Circle
  3379. • - &#8226; - Bullet
  3380. ∙ - &#8729; - Bullet Operator
  3381. ⋅ - &#8901; - Dot Operator
  3382. 🌑 - &#127761; - New Moon Symbol
  3383. */
  3384. // _______ _ __ __
  3385. // / ___/ / (_) /__/ /
  3386. // / /__/ _ \/ / / _ /
  3387. // \___/_//_/_/_/\_,_/
  3388. var _Child = {
  3389. id:null,
  3390. part:null,
  3391. type:null,
  3392. // nested:false,
  3393. text:'',
  3394. oninit: function(vn){
  3395. // console.log('vn.attrs', vn.attrs);
  3396. this.id = vn.attrs.id;
  3397. this.type = vn.attrs.type;
  3398. // vn.state.part = vn.state.slug.match(/^(\d)(.+)/)[1];
  3399. this.text = vn.attrs.text;
  3400. // this.nested = vn.attrs.nested || false;
  3401. },
  3402. onbeforeupdate: function(vn, old){
  3403. // this.nested = vn.attrs.nested || false;
  3404. this.type = vn.attrs.type;
  3405. this.text = vn.attrs.text;
  3406. },
  3407. view: function(vn){
  3408. return m(_Dot, {"id":this.id, 'text':this.text, 'type':this.type});
  3409. }
  3410. };
  3411. // ______
  3412. // / ____/___ ____ ____ ________
  3413. // / __/ / __ \/ __ \/ __ \/ ___/ _ \
  3414. // / /___/ / / / /_/ / / / / /__/ __/
  3415. // /_____/_/ /_/\____/_/ /_/\___/\___/
  3416. var _Enonce = {
  3417. partid:null,
  3418. id:null,
  3419. title:null,
  3420. text:null,
  3421. // nested:false,
  3422. childs:[],
  3423. oninit:function(vn){
  3424. // // console.log('Enonce on init', vn);
  3425. this.partid = vn.attrs.partid;
  3426. this.id = vn.attrs.id;
  3427. this.title = vn.attrs.title;
  3428. this.text = vn.attrs.text;
  3429. this.childs = vn.attrs.childs;
  3430. // this.nested = vn.attrs.nested || false;
  3431. },
  3432. onbeforeupdate:function(vn, old) {
  3433. // console.log(vn.attrs.childs);
  3434. this.title = vn.attrs.title;
  3435. this.text = vn.attrs.text;
  3436. this.childs = vn.attrs.childs;
  3437. // this.nested = vn.attrs.nested || false;
  3438. // if(vn.attrs.id == '1d1') console.log('_Enonce UPDATE, text :', vn.attrs.text);
  3439. },
  3440. view: function(vn){
  3441. // if(vn.attrs.id == '1d1') console.log('_Enonce VIEW, text :', vn.attrs.text);
  3442. return [
  3443. // create dot
  3444. m(_Dot, {"id":this.id, 'text':this.text,'type':this.title}),
  3445. // addd children
  3446. this.childs.map(function(c){
  3447. return m(_Child, c);
  3448. })
  3449. ]
  3450. }
  3451. }
  3452. // ____ __
  3453. // / __ \____ ______/ /_
  3454. // / /_/ / __ `/ ___/ __/
  3455. // / ____/ /_/ / / / /_
  3456. // /_/ \__,_/_/ \__/
  3457. var _Part = {
  3458. oninit: function(vn){
  3459. this.id = vn.attrs.id;
  3460. this.title = vn.attrs.title;
  3461. this.enonces = vn.attrs.enonces;
  3462. },
  3463. onbeforeupdate: function(vn, old){
  3464. // console.log('_Part, onbeforeupdate old',old);
  3465. this.title = vn.attrs.title;
  3466. this.enonces = vn.attrs.enonces;
  3467. },
  3468. view: function(vn){
  3469. // console.log(vn.attrs.enonces);
  3470. return m("section", {
  3471. 'id' :this.id,
  3472. 'class' :'part'
  3473. },
  3474. [
  3475. // create title node
  3476. m("h1", {'class':'part-title', 'part':this.id}, m.trust(markdown.renderInline(this.title))),
  3477. // create text node
  3478. this.enonces.map(function(e){
  3479. // console.log(e.text);
  3480. // return m(_Enonce, Object.assign({"partid":this.id},e))
  3481. switch (e.type) {
  3482. case "title":
  3483. // handle titles
  3484. return m("h2", {'class':'title'}, m.trust(markdown.renderInline(e.title)));
  3485. break;
  3486. case "filet":
  3487. // handle filets
  3488. return m("h4", {'class':'filet'}, m.trust(markdown.renderInline(e.title)));
  3489. break;
  3490. default:
  3491. // or build structure
  3492. return m(_Enonce, Object.assign({"partid":this.id},e));
  3493. }
  3494. })
  3495. ]
  3496. )
  3497. }
  3498. }
  3499. // ______
  3500. // /_ __/_______ ___
  3501. // / / / ___/ _ \/ _ \
  3502. // / / / / / __/ __/
  3503. // /_/ /_/ \___/\___/
  3504. module.exports = {
  3505. // oninit : function(vn){
  3506. // this.lang = vn.attrs.lang;
  3507. // },
  3508. oncreate: function(vn){
  3509. document.body.classList.add('tree');
  3510. _Ui.init();
  3511. },
  3512. view: function(vn){
  3513. console.log('_Tree view', vn.attrs.lang);
  3514. return [
  3515. m(_Header),
  3516. m('main', {id:"content", 'class':'tree'}, _dbs.data[vn.attrs.lang].map(function(p){
  3517. return m(_Part,p);
  3518. })
  3519. ),
  3520. m(_Footer)
  3521. ];
  3522. }
  3523. }
  3524. // function(){
  3525. // switch(_dbs.lang){
  3526. // case 'fr':
  3527. // return "Hello dots !";
  3528. // break;
  3529. // case 'bra':
  3530. // return '"Hola dots !"'
  3531. // break;
  3532. // }
  3533. // }
  3534. /***/ }),
  3535. /* 23 */
  3536. /***/ (function(module, exports) {
  3537. /**
  3538. * @Author: Bachir Soussi Chiadmi <bach>
  3539. * @Date: 12-09-2017
  3540. * @Email: bachir@figureslibres.io
  3541. * @Last modified by: bach
  3542. * @Last modified time: 12-09-2017
  3543. * @License: GPL-V3
  3544. */
  3545. // var $ = require('jquery');
  3546. // https://plainjs.com
  3547. // jQuery(document).ready(function($) {
  3548. // console.log('Hello Jquery');
  3549. // var $window;
  3550. var init = function(){
  3551. console.log('UI init');
  3552. // $window = $(window);
  3553. // _____ __ _ __ __ _ __ __
  3554. // / ___// /_(_)____/ /____ __ / /_(_) /_/ /__
  3555. // \__ \/ __/ / ___/ //_/ / / / / __/ / __/ / _ \
  3556. // ___/ / /_/ / /__/ ,< / /_/ / / /_/ / /_/ / __/
  3557. // /____/\__/_/\___/_/|_|\__, / \__/_/\__/_/\___/
  3558. // /____/
  3559. // https://codepen.io/chrissp26/pen/gBrdo?editors=0010
  3560. // var header_height = $('header').height();
  3561. var header_height = document.getElementsByTagName('header')[0].clientHeight;
  3562. console.log(header_height);
  3563. // var $sticky_clone_wrapper = $('<div>').addClass('sticky-clone-wrapper').appendTo('body');
  3564. var sticky_clone_wrapper = document.createElement('div');
  3565. sticky_clone_wrapper.classList.add('sticky-clone-wrapper');
  3566. document.body.append(sticky_clone_wrapper);
  3567. //
  3568. // var $stickies = $('h1.part-title').addClass('sticky').each(function(i){
  3569. // var $sticky = $(this);
  3570. // $sticky
  3571. // .data('originalPosition', $sticky.offset().top)
  3572. // .data('originalHeight', $sticky.outerHeight());
  3573. // });
  3574. var stickies = new Array();
  3575. Array.from(document.querySelectorAll('h1.part-title')).forEach(function(e){
  3576. // console.log('sticky', e);
  3577. e._part = e.getAttribute('part');
  3578. stickies.push(e)
  3579. });
  3580. console.log('stickies', stickies);
  3581. //
  3582. // var OnScroll = function(event){
  3583. // var $last_sticky;
  3584. // $stickies.each(function(i){
  3585. // var $sticky = $(this);
  3586. // var pos = $sticky.data('originalPosition');
  3587. // if(pos < $window.scrollTop()+header_height){
  3588. //
  3589. // }
  3590. // // if(i == 1){
  3591. // // console.log(pos +" | "+$window.scrollTop());
  3592. // // }
  3593. // // if(pos < $window.scrollTop()+header_height){
  3594. // // if(!$sticky.is('.sticked')){
  3595. // // $sticky.addClass('sticked').clone().appendTo($sticky_clone_wrapper.empty());
  3596. // // }
  3597. // // }else{
  3598. // // if($sticky.is('.sticked')){
  3599. // // $sticky.removeClass('sticked');
  3600. // // $('.part-title[part="'+$sticky.attr('part')+'"]', $sticky_clone_wrapper).remove();
  3601. // // }
  3602. // // }
  3603. // });
  3604. // };
  3605. var last_sticky = "", sticked_sticky, clone;
  3606. var OnScroll = function(event){
  3607. // console.log('on scrool', event);
  3608. sticked_sticky = false;
  3609. for (var i = stickies.length-1; i >= 0; i--) {
  3610. if(stickies[i].getBoundingClientRect().top < header_height){
  3611. sticked_sticky = stickies[i];
  3612. break;
  3613. }
  3614. }
  3615. if (sticked_sticky) {
  3616. // console.log('sticked_sticky', sticked_sticky._part);
  3617. if(last_sticky !== sticked_sticky._part){
  3618. // console.log('new sticky', last_sticky);
  3619. // fill sticky_clone_wrapper
  3620. clone = sticked_sticky.cloneNode(true);
  3621. sticky_clone_wrapper.innerHTML = '';
  3622. sticky_clone_wrapper.appendChild(clone);
  3623. last_sticky = sticked_sticky._part;
  3624. }
  3625. }else{
  3626. // empty sticky_clone_wrapper
  3627. sticky_clone_wrapper.innerHTML = '';
  3628. }
  3629. };
  3630. //
  3631. // $window.on('scroll', OnScroll);
  3632. // console.log('window', window);
  3633. window.onscroll = OnScroll;
  3634. }
  3635. // });
  3636. module.exports = {
  3637. init : init
  3638. }
  3639. /***/ }),
  3640. /* 24 */
  3641. /***/ (function(module, exports) {
  3642. module.exports = {
  3643. "Aacute": "Á",
  3644. "aacute": "á",
  3645. "Abreve": "Ă",
  3646. "abreve": "ă",
  3647. "ac": "∾",
  3648. "acd": "∿",
  3649. "acE": "∾̳",
  3650. "Acirc": "Â",
  3651. "acirc": "â",
  3652. "acute": "´",
  3653. "Acy": "А",
  3654. "acy": "а",
  3655. "AElig": "Æ",
  3656. "aelig": "æ",
  3657. "af": "⁡",
  3658. "Afr": "𝔄",
  3659. "afr": "𝔞",
  3660. "Agrave": "À",
  3661. "agrave": "à",
  3662. "alefsym": "ℵ",
  3663. "aleph": "ℵ",
  3664. "Alpha": "Α",
  3665. "alpha": "α",
  3666. "Amacr": "Ā",
  3667. "amacr": "ā",
  3668. "amalg": "⨿",
  3669. "amp": "&",
  3670. "AMP": "&",
  3671. "andand": "⩕",
  3672. "And": "⩓",
  3673. "and": "∧",
  3674. "andd": "⩜",
  3675. "andslope": "⩘",
  3676. "andv": "⩚",
  3677. "ang": "∠",
  3678. "ange": "⦤",
  3679. "angle": "∠",
  3680. "angmsdaa": "⦨",
  3681. "angmsdab": "⦩",
  3682. "angmsdac": "⦪",
  3683. "angmsdad": "⦫",
  3684. "angmsdae": "⦬",
  3685. "angmsdaf": "⦭",
  3686. "angmsdag": "⦮",
  3687. "angmsdah": "⦯",
  3688. "angmsd": "∡",
  3689. "angrt": "∟",
  3690. "angrtvb": "⊾",
  3691. "angrtvbd": "⦝",
  3692. "angsph": "∢",
  3693. "angst": "Å",
  3694. "angzarr": "⍼",
  3695. "Aogon": "Ą",
  3696. "aogon": "ą",
  3697. "Aopf": "𝔸",
  3698. "aopf": "𝕒",
  3699. "apacir": "⩯",
  3700. "ap": "≈",
  3701. "apE": "⩰",
  3702. "ape": "≊",
  3703. "apid": "≋",
  3704. "apos": "'",
  3705. "ApplyFunction": "⁡",
  3706. "approx": "≈",
  3707. "approxeq": "≊",
  3708. "Aring": "Å",
  3709. "aring": "å",
  3710. "Ascr": "𝒜",
  3711. "ascr": "𝒶",
  3712. "Assign": "≔",
  3713. "ast": "*",
  3714. "asymp": "≈",
  3715. "asympeq": "≍",
  3716. "Atilde": "Ã",
  3717. "atilde": "ã",
  3718. "Auml": "Ä",
  3719. "auml": "ä",
  3720. "awconint": "∳",
  3721. "awint": "⨑",
  3722. "backcong": "≌",
  3723. "backepsilon": "϶",
  3724. "backprime": "‵",
  3725. "backsim": "∽",
  3726. "backsimeq": "⋍",
  3727. "Backslash": "∖",
  3728. "Barv": "⫧",
  3729. "barvee": "⊽",
  3730. "barwed": "⌅",
  3731. "Barwed": "⌆",
  3732. "barwedge": "⌅",
  3733. "bbrk": "⎵",
  3734. "bbrktbrk": "⎶",
  3735. "bcong": "≌",
  3736. "Bcy": "Б",
  3737. "bcy": "б",
  3738. "bdquo": "„",
  3739. "becaus": "∵",
  3740. "because": "∵",
  3741. "Because": "∵",
  3742. "bemptyv": "⦰",
  3743. "bepsi": "϶",
  3744. "bernou": "ℬ",
  3745. "Bernoullis": "ℬ",
  3746. "Beta": "Β",
  3747. "beta": "β",
  3748. "beth": "ℶ",
  3749. "between": "≬",
  3750. "Bfr": "𝔅",
  3751. "bfr": "𝔟",
  3752. "bigcap": "⋂",
  3753. "bigcirc": "◯",
  3754. "bigcup": "⋃",
  3755. "bigodot": "⨀",
  3756. "bigoplus": "⨁",
  3757. "bigotimes": "⨂",
  3758. "bigsqcup": "⨆",
  3759. "bigstar": "★",
  3760. "bigtriangledown": "▽",
  3761. "bigtriangleup": "△",
  3762. "biguplus": "⨄",
  3763. "bigvee": "⋁",
  3764. "bigwedge": "⋀",
  3765. "bkarow": "⤍",
  3766. "blacklozenge": "⧫",
  3767. "blacksquare": "▪",
  3768. "blacktriangle": "▴",
  3769. "blacktriangledown": "▾",
  3770. "blacktriangleleft": "◂",
  3771. "blacktriangleright": "▸",
  3772. "blank": "␣",
  3773. "blk12": "▒",
  3774. "blk14": "░",
  3775. "blk34": "▓",
  3776. "block": "█",
  3777. "bne": "=⃥",
  3778. "bnequiv": "≡⃥",
  3779. "bNot": "⫭",
  3780. "bnot": "⌐",
  3781. "Bopf": "𝔹",
  3782. "bopf": "𝕓",
  3783. "bot": "⊥",
  3784. "bottom": "⊥",
  3785. "bowtie": "⋈",
  3786. "boxbox": "⧉",
  3787. "boxdl": "┐",
  3788. "boxdL": "╕",
  3789. "boxDl": "╖",
  3790. "boxDL": "╗",
  3791. "boxdr": "┌",
  3792. "boxdR": "╒",
  3793. "boxDr": "╓",
  3794. "boxDR": "╔",
  3795. "boxh": "─",
  3796. "boxH": "═",
  3797. "boxhd": "┬",
  3798. "boxHd": "╤",
  3799. "boxhD": "╥",
  3800. "boxHD": "╦",
  3801. "boxhu": "┴",
  3802. "boxHu": "╧",
  3803. "boxhU": "╨",
  3804. "boxHU": "╩",
  3805. "boxminus": "⊟",
  3806. "boxplus": "⊞",
  3807. "boxtimes": "⊠",
  3808. "boxul": "┘",
  3809. "boxuL": "╛",
  3810. "boxUl": "╜",
  3811. "boxUL": "╝",
  3812. "boxur": "└",
  3813. "boxuR": "╘",
  3814. "boxUr": "╙",
  3815. "boxUR": "╚",
  3816. "boxv": "│",
  3817. "boxV": "║",
  3818. "boxvh": "┼",
  3819. "boxvH": "╪",
  3820. "boxVh": "╫",
  3821. "boxVH": "╬",
  3822. "boxvl": "┤",
  3823. "boxvL": "╡",
  3824. "boxVl": "╢",
  3825. "boxVL": "╣",
  3826. "boxvr": "├",
  3827. "boxvR": "╞",
  3828. "boxVr": "╟",
  3829. "boxVR": "╠",
  3830. "bprime": "‵",
  3831. "breve": "˘",
  3832. "Breve": "˘",
  3833. "brvbar": "¦",
  3834. "bscr": "𝒷",
  3835. "Bscr": "ℬ",
  3836. "bsemi": "⁏",
  3837. "bsim": "∽",
  3838. "bsime": "⋍",
  3839. "bsolb": "⧅",
  3840. "bsol": "\\",
  3841. "bsolhsub": "⟈",
  3842. "bull": "•",
  3843. "bullet": "•",
  3844. "bump": "≎",
  3845. "bumpE": "⪮",
  3846. "bumpe": "≏",
  3847. "Bumpeq": "≎",
  3848. "bumpeq": "≏",
  3849. "Cacute": "Ć",
  3850. "cacute": "ć",
  3851. "capand": "⩄",
  3852. "capbrcup": "⩉",
  3853. "capcap": "⩋",
  3854. "cap": "∩",
  3855. "Cap": "⋒",
  3856. "capcup": "⩇",
  3857. "capdot": "⩀",
  3858. "CapitalDifferentialD": "ⅅ",
  3859. "caps": "∩︀",
  3860. "caret": "⁁",
  3861. "caron": "ˇ",
  3862. "Cayleys": "ℭ",
  3863. "ccaps": "⩍",
  3864. "Ccaron": "Č",
  3865. "ccaron": "č",
  3866. "Ccedil": "Ç",
  3867. "ccedil": "ç",
  3868. "Ccirc": "Ĉ",
  3869. "ccirc": "ĉ",
  3870. "Cconint": "∰",
  3871. "ccups": "⩌",
  3872. "ccupssm": "⩐",
  3873. "Cdot": "Ċ",
  3874. "cdot": "ċ",
  3875. "cedil": "¸",
  3876. "Cedilla": "¸",
  3877. "cemptyv": "⦲",
  3878. "cent": "¢",
  3879. "centerdot": "·",
  3880. "CenterDot": "·",
  3881. "cfr": "𝔠",
  3882. "Cfr": "ℭ",
  3883. "CHcy": "Ч",
  3884. "chcy": "ч",
  3885. "check": "✓",
  3886. "checkmark": "✓",
  3887. "Chi": "Χ",
  3888. "chi": "χ",
  3889. "circ": "ˆ",
  3890. "circeq": "≗",
  3891. "circlearrowleft": "↺",
  3892. "circlearrowright": "↻",
  3893. "circledast": "⊛",
  3894. "circledcirc": "⊚",
  3895. "circleddash": "⊝",
  3896. "CircleDot": "⊙",
  3897. "circledR": "®",
  3898. "circledS": "Ⓢ",
  3899. "CircleMinus": "⊖",
  3900. "CirclePlus": "⊕",
  3901. "CircleTimes": "⊗",
  3902. "cir": "○",
  3903. "cirE": "⧃",
  3904. "cire": "≗",
  3905. "cirfnint": "⨐",
  3906. "cirmid": "⫯",
  3907. "cirscir": "⧂",
  3908. "ClockwiseContourIntegral": "∲",
  3909. "CloseCurlyDoubleQuote": "”",
  3910. "CloseCurlyQuote": "’",
  3911. "clubs": "♣",
  3912. "clubsuit": "♣",
  3913. "colon": ":",
  3914. "Colon": "∷",
  3915. "Colone": "⩴",
  3916. "colone": "≔",
  3917. "coloneq": "≔",
  3918. "comma": ",",
  3919. "commat": "@",
  3920. "comp": "∁",
  3921. "compfn": "∘",
  3922. "complement": "∁",
  3923. "complexes": "ℂ",
  3924. "cong": "≅",
  3925. "congdot": "⩭",
  3926. "Congruent": "≡",
  3927. "conint": "∮",
  3928. "Conint": "∯",
  3929. "ContourIntegral": "∮",
  3930. "copf": "𝕔",
  3931. "Copf": "ℂ",
  3932. "coprod": "∐",
  3933. "Coproduct": "∐",
  3934. "copy": "©",
  3935. "COPY": "©",
  3936. "copysr": "℗",
  3937. "CounterClockwiseContourIntegral": "∳",
  3938. "crarr": "↵",
  3939. "cross": "✗",
  3940. "Cross": "⨯",
  3941. "Cscr": "𝒞",
  3942. "cscr": "𝒸",
  3943. "csub": "⫏",
  3944. "csube": "⫑",
  3945. "csup": "⫐",
  3946. "csupe": "⫒",
  3947. "ctdot": "⋯",
  3948. "cudarrl": "⤸",
  3949. "cudarrr": "⤵",
  3950. "cuepr": "⋞",
  3951. "cuesc": "⋟",
  3952. "cularr": "↶",
  3953. "cularrp": "⤽",
  3954. "cupbrcap": "⩈",
  3955. "cupcap": "⩆",
  3956. "CupCap": "≍",
  3957. "cup": "∪",
  3958. "Cup": "⋓",
  3959. "cupcup": "⩊",
  3960. "cupdot": "⊍",
  3961. "cupor": "⩅",
  3962. "cups": "∪︀",
  3963. "curarr": "↷",
  3964. "curarrm": "⤼",
  3965. "curlyeqprec": "⋞",
  3966. "curlyeqsucc": "⋟",
  3967. "curlyvee": "⋎",
  3968. "curlywedge": "⋏",
  3969. "curren": "¤",
  3970. "curvearrowleft": "↶",
  3971. "curvearrowright": "↷",
  3972. "cuvee": "⋎",
  3973. "cuwed": "⋏",
  3974. "cwconint": "∲",
  3975. "cwint": "∱",
  3976. "cylcty": "⌭",
  3977. "dagger": "†",
  3978. "Dagger": "‡",
  3979. "daleth": "ℸ",
  3980. "darr": "↓",
  3981. "Darr": "↡",
  3982. "dArr": "⇓",
  3983. "dash": "‐",
  3984. "Dashv": "⫤",
  3985. "dashv": "⊣",
  3986. "dbkarow": "⤏",
  3987. "dblac": "˝",
  3988. "Dcaron": "Ď",
  3989. "dcaron": "ď",
  3990. "Dcy": "Д",
  3991. "dcy": "д",
  3992. "ddagger": "‡",
  3993. "ddarr": "⇊",
  3994. "DD": "ⅅ",
  3995. "dd": "ⅆ",
  3996. "DDotrahd": "⤑",
  3997. "ddotseq": "⩷",
  3998. "deg": "°",
  3999. "Del": "∇",
  4000. "Delta": "Δ",
  4001. "delta": "δ",
  4002. "demptyv": "⦱",
  4003. "dfisht": "⥿",
  4004. "Dfr": "𝔇",
  4005. "dfr": "𝔡",
  4006. "dHar": "⥥",
  4007. "dharl": "⇃",
  4008. "dharr": "⇂",
  4009. "DiacriticalAcute": "´",
  4010. "DiacriticalDot": "˙",
  4011. "DiacriticalDoubleAcute": "˝",
  4012. "DiacriticalGrave": "`",
  4013. "DiacriticalTilde": "˜",
  4014. "diam": "⋄",
  4015. "diamond": "⋄",
  4016. "Diamond": "⋄",
  4017. "diamondsuit": "♦",
  4018. "diams": "♦",
  4019. "die": "¨",
  4020. "DifferentialD": "ⅆ",
  4021. "digamma": "ϝ",
  4022. "disin": "⋲",
  4023. "div": "÷",
  4024. "divide": "÷",
  4025. "divideontimes": "⋇",
  4026. "divonx": "⋇",
  4027. "DJcy": "Ђ",
  4028. "djcy": "ђ",
  4029. "dlcorn": "⌞",
  4030. "dlcrop": "⌍",
  4031. "dollar": "$",
  4032. "Dopf": "𝔻",
  4033. "dopf": "𝕕",
  4034. "Dot": "¨",
  4035. "dot": "˙",
  4036. "DotDot": "⃜",
  4037. "doteq": "≐",
  4038. "doteqdot": "≑",
  4039. "DotEqual": "≐",
  4040. "dotminus": "∸",
  4041. "dotplus": "∔",
  4042. "dotsquare": "⊡",
  4043. "doublebarwedge": "⌆",
  4044. "DoubleContourIntegral": "∯",
  4045. "DoubleDot": "¨",
  4046. "DoubleDownArrow": "⇓",
  4047. "DoubleLeftArrow": "⇐",
  4048. "DoubleLeftRightArrow": "⇔",
  4049. "DoubleLeftTee": "⫤",
  4050. "DoubleLongLeftArrow": "⟸",
  4051. "DoubleLongLeftRightArrow": "⟺",
  4052. "DoubleLongRightArrow": "⟹",
  4053. "DoubleRightArrow": "⇒",
  4054. "DoubleRightTee": "⊨",
  4055. "DoubleUpArrow": "⇑",
  4056. "DoubleUpDownArrow": "⇕",
  4057. "DoubleVerticalBar": "∥",
  4058. "DownArrowBar": "⤓",
  4059. "downarrow": "↓",
  4060. "DownArrow": "↓",
  4061. "Downarrow": "⇓",
  4062. "DownArrowUpArrow": "⇵",
  4063. "DownBreve": "̑",
  4064. "downdownarrows": "⇊",
  4065. "downharpoonleft": "⇃",
  4066. "downharpoonright": "⇂",
  4067. "DownLeftRightVector": "⥐",
  4068. "DownLeftTeeVector": "⥞",
  4069. "DownLeftVectorBar": "⥖",
  4070. "DownLeftVector": "↽",
  4071. "DownRightTeeVector": "⥟",
  4072. "DownRightVectorBar": "⥗",
  4073. "DownRightVector": "⇁",
  4074. "DownTeeArrow": "↧",
  4075. "DownTee": "⊤",
  4076. "drbkarow": "⤐",
  4077. "drcorn": "⌟",
  4078. "drcrop": "⌌",
  4079. "Dscr": "𝒟",
  4080. "dscr": "𝒹",
  4081. "DScy": "Ѕ",
  4082. "dscy": "ѕ",
  4083. "dsol": "⧶",
  4084. "Dstrok": "Đ",
  4085. "dstrok": "đ",
  4086. "dtdot": "⋱",
  4087. "dtri": "▿",
  4088. "dtrif": "▾",
  4089. "duarr": "⇵",
  4090. "duhar": "⥯",
  4091. "dwangle": "⦦",
  4092. "DZcy": "Џ",
  4093. "dzcy": "џ",
  4094. "dzigrarr": "⟿",
  4095. "Eacute": "É",
  4096. "eacute": "é",
  4097. "easter": "⩮",
  4098. "Ecaron": "Ě",
  4099. "ecaron": "ě",
  4100. "Ecirc": "Ê",
  4101. "ecirc": "ê",
  4102. "ecir": "≖",
  4103. "ecolon": "≕",
  4104. "Ecy": "Э",
  4105. "ecy": "э",
  4106. "eDDot": "⩷",
  4107. "Edot": "Ė",
  4108. "edot": "ė",
  4109. "eDot": "≑",
  4110. "ee": "ⅇ",
  4111. "efDot": "≒",
  4112. "Efr": "𝔈",
  4113. "efr": "𝔢",
  4114. "eg": "⪚",
  4115. "Egrave": "È",
  4116. "egrave": "è",
  4117. "egs": "⪖",
  4118. "egsdot": "⪘",
  4119. "el": "⪙",
  4120. "Element": "∈",
  4121. "elinters": "⏧",
  4122. "ell": "ℓ",
  4123. "els": "⪕",
  4124. "elsdot": "⪗",
  4125. "Emacr": "Ē",
  4126. "emacr": "ē",
  4127. "empty": "∅",
  4128. "emptyset": "∅",
  4129. "EmptySmallSquare": "◻",
  4130. "emptyv": "∅",
  4131. "EmptyVerySmallSquare": "▫",
  4132. "emsp13": " ",
  4133. "emsp14": " ",
  4134. "emsp": " ",
  4135. "ENG": "Ŋ",
  4136. "eng": "ŋ",
  4137. "ensp": " ",
  4138. "Eogon": "Ę",
  4139. "eogon": "ę",
  4140. "Eopf": "𝔼",
  4141. "eopf": "𝕖",
  4142. "epar": "⋕",
  4143. "eparsl": "⧣",
  4144. "eplus": "⩱",
  4145. "epsi": "ε",
  4146. "Epsilon": "Ε",
  4147. "epsilon": "ε",
  4148. "epsiv": "ϵ",
  4149. "eqcirc": "≖",
  4150. "eqcolon": "≕",
  4151. "eqsim": "≂",
  4152. "eqslantgtr": "⪖",
  4153. "eqslantless": "⪕",
  4154. "Equal": "⩵",
  4155. "equals": "=",
  4156. "EqualTilde": "≂",
  4157. "equest": "≟",
  4158. "Equilibrium": "⇌",
  4159. "equiv": "≡",
  4160. "equivDD": "⩸",
  4161. "eqvparsl": "⧥",
  4162. "erarr": "⥱",
  4163. "erDot": "≓",
  4164. "escr": "ℯ",
  4165. "Escr": "ℰ",
  4166. "esdot": "≐",
  4167. "Esim": "⩳",
  4168. "esim": "≂",
  4169. "Eta": "Η",
  4170. "eta": "η",
  4171. "ETH": "Ð",
  4172. "eth": "ð",
  4173. "Euml": "Ë",
  4174. "euml": "ë",
  4175. "euro": "€",
  4176. "excl": "!",
  4177. "exist": "∃",
  4178. "Exists": "∃",
  4179. "expectation": "ℰ",
  4180. "exponentiale": "ⅇ",
  4181. "ExponentialE": "ⅇ",
  4182. "fallingdotseq": "≒",
  4183. "Fcy": "Ф",
  4184. "fcy": "ф",
  4185. "female": "♀",
  4186. "ffilig": "ffi",
  4187. "fflig": "ff",
  4188. "ffllig": "ffl",
  4189. "Ffr": "𝔉",
  4190. "ffr": "𝔣",
  4191. "filig": "fi",
  4192. "FilledSmallSquare": "◼",
  4193. "FilledVerySmallSquare": "▪",
  4194. "fjlig": "fj",
  4195. "flat": "♭",
  4196. "fllig": "fl",
  4197. "fltns": "▱",
  4198. "fnof": "ƒ",
  4199. "Fopf": "𝔽",
  4200. "fopf": "𝕗",
  4201. "forall": "∀",
  4202. "ForAll": "∀",
  4203. "fork": "⋔",
  4204. "forkv": "⫙",
  4205. "Fouriertrf": "ℱ",
  4206. "fpartint": "⨍",
  4207. "frac12": "½",
  4208. "frac13": "⅓",
  4209. "frac14": "¼",
  4210. "frac15": "⅕",
  4211. "frac16": "⅙",
  4212. "frac18": "⅛",
  4213. "frac23": "⅔",
  4214. "frac25": "⅖",
  4215. "frac34": "¾",
  4216. "frac35": "⅗",
  4217. "frac38": "⅜",
  4218. "frac45": "⅘",
  4219. "frac56": "⅚",
  4220. "frac58": "⅝",
  4221. "frac78": "⅞",
  4222. "frasl": "⁄",
  4223. "frown": "⌢",
  4224. "fscr": "𝒻",
  4225. "Fscr": "ℱ",
  4226. "gacute": "ǵ",
  4227. "Gamma": "Γ",
  4228. "gamma": "γ",
  4229. "Gammad": "Ϝ",
  4230. "gammad": "ϝ",
  4231. "gap": "⪆",
  4232. "Gbreve": "Ğ",
  4233. "gbreve": "ğ",
  4234. "Gcedil": "Ģ",
  4235. "Gcirc": "Ĝ",
  4236. "gcirc": "ĝ",
  4237. "Gcy": "Г",
  4238. "gcy": "г",
  4239. "Gdot": "Ġ",
  4240. "gdot": "ġ",
  4241. "ge": "≥",
  4242. "gE": "≧",
  4243. "gEl": "⪌",
  4244. "gel": "⋛",
  4245. "geq": "≥",
  4246. "geqq": "≧",
  4247. "geqslant": "⩾",
  4248. "gescc": "⪩",
  4249. "ges": "⩾",
  4250. "gesdot": "⪀",
  4251. "gesdoto": "⪂",
  4252. "gesdotol": "⪄",
  4253. "gesl": "⋛︀",
  4254. "gesles": "⪔",
  4255. "Gfr": "𝔊",
  4256. "gfr": "𝔤",
  4257. "gg": "≫",
  4258. "Gg": "⋙",
  4259. "ggg": "⋙",
  4260. "gimel": "ℷ",
  4261. "GJcy": "Ѓ",
  4262. "gjcy": "ѓ",
  4263. "gla": "⪥",
  4264. "gl": "≷",
  4265. "glE": "⪒",
  4266. "glj": "⪤",
  4267. "gnap": "⪊",
  4268. "gnapprox": "⪊",
  4269. "gne": "⪈",
  4270. "gnE": "≩",
  4271. "gneq": "⪈",
  4272. "gneqq": "≩",
  4273. "gnsim": "⋧",
  4274. "Gopf": "𝔾",
  4275. "gopf": "𝕘",
  4276. "grave": "`",
  4277. "GreaterEqual": "≥",
  4278. "GreaterEqualLess": "⋛",
  4279. "GreaterFullEqual": "≧",
  4280. "GreaterGreater": "⪢",
  4281. "GreaterLess": "≷",
  4282. "GreaterSlantEqual": "⩾",
  4283. "GreaterTilde": "≳",
  4284. "Gscr": "𝒢",
  4285. "gscr": "ℊ",
  4286. "gsim": "≳",
  4287. "gsime": "⪎",
  4288. "gsiml": "⪐",
  4289. "gtcc": "⪧",
  4290. "gtcir": "⩺",
  4291. "gt": ">",
  4292. "GT": ">",
  4293. "Gt": "≫",
  4294. "gtdot": "⋗",
  4295. "gtlPar": "⦕",
  4296. "gtquest": "⩼",
  4297. "gtrapprox": "⪆",
  4298. "gtrarr": "⥸",
  4299. "gtrdot": "⋗",
  4300. "gtreqless": "⋛",
  4301. "gtreqqless": "⪌",
  4302. "gtrless": "≷",
  4303. "gtrsim": "≳",
  4304. "gvertneqq": "≩︀",
  4305. "gvnE": "≩︀",
  4306. "Hacek": "ˇ",
  4307. "hairsp": " ",
  4308. "half": "½",
  4309. "hamilt": "ℋ",
  4310. "HARDcy": "Ъ",
  4311. "hardcy": "ъ",
  4312. "harrcir": "⥈",
  4313. "harr": "↔",
  4314. "hArr": "⇔",
  4315. "harrw": "↭",
  4316. "Hat": "^",
  4317. "hbar": "ℏ",
  4318. "Hcirc": "Ĥ",
  4319. "hcirc": "ĥ",
  4320. "hearts": "♥",
  4321. "heartsuit": "♥",
  4322. "hellip": "…",
  4323. "hercon": "⊹",
  4324. "hfr": "𝔥",
  4325. "Hfr": "ℌ",
  4326. "HilbertSpace": "ℋ",
  4327. "hksearow": "⤥",
  4328. "hkswarow": "⤦",
  4329. "hoarr": "⇿",
  4330. "homtht": "∻",
  4331. "hookleftarrow": "↩",
  4332. "hookrightarrow": "↪",
  4333. "hopf": "𝕙",
  4334. "Hopf": "ℍ",
  4335. "horbar": "―",
  4336. "HorizontalLine": "─",
  4337. "hscr": "𝒽",
  4338. "Hscr": "ℋ",
  4339. "hslash": "ℏ",
  4340. "Hstrok": "Ħ",
  4341. "hstrok": "ħ",
  4342. "HumpDownHump": "≎",
  4343. "HumpEqual": "≏",
  4344. "hybull": "⁃",
  4345. "hyphen": "‐",
  4346. "Iacute": "Í",
  4347. "iacute": "í",
  4348. "ic": "⁣",
  4349. "Icirc": "Î",
  4350. "icirc": "î",
  4351. "Icy": "И",
  4352. "icy": "и",
  4353. "Idot": "İ",
  4354. "IEcy": "Е",
  4355. "iecy": "е",
  4356. "iexcl": "¡",
  4357. "iff": "⇔",
  4358. "ifr": "𝔦",
  4359. "Ifr": "ℑ",
  4360. "Igrave": "Ì",
  4361. "igrave": "ì",
  4362. "ii": "ⅈ",
  4363. "iiiint": "⨌",
  4364. "iiint": "∭",
  4365. "iinfin": "⧜",
  4366. "iiota": "℩",
  4367. "IJlig": "IJ",
  4368. "ijlig": "ij",
  4369. "Imacr": "Ī",
  4370. "imacr": "ī",
  4371. "image": "ℑ",
  4372. "ImaginaryI": "ⅈ",
  4373. "imagline": "ℐ",
  4374. "imagpart": "ℑ",
  4375. "imath": "ı",
  4376. "Im": "ℑ",
  4377. "imof": "⊷",
  4378. "imped": "Ƶ",
  4379. "Implies": "⇒",
  4380. "incare": "℅",
  4381. "in": "∈",
  4382. "infin": "∞",
  4383. "infintie": "⧝",
  4384. "inodot": "ı",
  4385. "intcal": "⊺",
  4386. "int": "∫",
  4387. "Int": "∬",
  4388. "integers": "ℤ",
  4389. "Integral": "∫",
  4390. "intercal": "⊺",
  4391. "Intersection": "⋂",
  4392. "intlarhk": "⨗",
  4393. "intprod": "⨼",
  4394. "InvisibleComma": "⁣",
  4395. "InvisibleTimes": "⁢",
  4396. "IOcy": "Ё",
  4397. "iocy": "ё",
  4398. "Iogon": "Į",
  4399. "iogon": "į",
  4400. "Iopf": "𝕀",
  4401. "iopf": "𝕚",
  4402. "Iota": "Ι",
  4403. "iota": "ι",
  4404. "iprod": "⨼",
  4405. "iquest": "¿",
  4406. "iscr": "𝒾",
  4407. "Iscr": "ℐ",
  4408. "isin": "∈",
  4409. "isindot": "⋵",
  4410. "isinE": "⋹",
  4411. "isins": "⋴",
  4412. "isinsv": "⋳",
  4413. "isinv": "∈",
  4414. "it": "⁢",
  4415. "Itilde": "Ĩ",
  4416. "itilde": "ĩ",
  4417. "Iukcy": "І",
  4418. "iukcy": "і",
  4419. "Iuml": "Ï",
  4420. "iuml": "ï",
  4421. "Jcirc": "Ĵ",
  4422. "jcirc": "ĵ",
  4423. "Jcy": "Й",
  4424. "jcy": "й",
  4425. "Jfr": "𝔍",
  4426. "jfr": "𝔧",
  4427. "jmath": "ȷ",
  4428. "Jopf": "𝕁",
  4429. "jopf": "𝕛",
  4430. "Jscr": "𝒥",
  4431. "jscr": "𝒿",
  4432. "Jsercy": "Ј",
  4433. "jsercy": "ј",
  4434. "Jukcy": "Є",
  4435. "jukcy": "є",
  4436. "Kappa": "Κ",
  4437. "kappa": "κ",
  4438. "kappav": "ϰ",
  4439. "Kcedil": "Ķ",
  4440. "kcedil": "ķ",
  4441. "Kcy": "К",
  4442. "kcy": "к",
  4443. "Kfr": "𝔎",
  4444. "kfr": "𝔨",
  4445. "kgreen": "ĸ",
  4446. "KHcy": "Х",
  4447. "khcy": "х",
  4448. "KJcy": "Ќ",
  4449. "kjcy": "ќ",
  4450. "Kopf": "𝕂",
  4451. "kopf": "𝕜",
  4452. "Kscr": "𝒦",
  4453. "kscr": "𝓀",
  4454. "lAarr": "⇚",
  4455. "Lacute": "Ĺ",
  4456. "lacute": "ĺ",
  4457. "laemptyv": "⦴",
  4458. "lagran": "ℒ",
  4459. "Lambda": "Λ",
  4460. "lambda": "λ",
  4461. "lang": "⟨",
  4462. "Lang": "⟪",
  4463. "langd": "⦑",
  4464. "langle": "⟨",
  4465. "lap": "⪅",
  4466. "Laplacetrf": "ℒ",
  4467. "laquo": "«",
  4468. "larrb": "⇤",
  4469. "larrbfs": "⤟",
  4470. "larr": "←",
  4471. "Larr": "↞",
  4472. "lArr": "⇐",
  4473. "larrfs": "⤝",
  4474. "larrhk": "↩",
  4475. "larrlp": "↫",
  4476. "larrpl": "⤹",
  4477. "larrsim": "⥳",
  4478. "larrtl": "↢",
  4479. "latail": "⤙",
  4480. "lAtail": "⤛",
  4481. "lat": "⪫",
  4482. "late": "⪭",
  4483. "lates": "⪭︀",
  4484. "lbarr": "⤌",
  4485. "lBarr": "⤎",
  4486. "lbbrk": "❲",
  4487. "lbrace": "{",
  4488. "lbrack": "[",
  4489. "lbrke": "⦋",
  4490. "lbrksld": "⦏",
  4491. "lbrkslu": "⦍",
  4492. "Lcaron": "Ľ",
  4493. "lcaron": "ľ",
  4494. "Lcedil": "Ļ",
  4495. "lcedil": "ļ",
  4496. "lceil": "⌈",
  4497. "lcub": "{",
  4498. "Lcy": "Л",
  4499. "lcy": "л",
  4500. "ldca": "⤶",
  4501. "ldquo": "“",
  4502. "ldquor": "„",
  4503. "ldrdhar": "⥧",
  4504. "ldrushar": "⥋",
  4505. "ldsh": "↲",
  4506. "le": "≤",
  4507. "lE": "≦",
  4508. "LeftAngleBracket": "⟨",
  4509. "LeftArrowBar": "⇤",
  4510. "leftarrow": "←",
  4511. "LeftArrow": "←",
  4512. "Leftarrow": "⇐",
  4513. "LeftArrowRightArrow": "⇆",
  4514. "leftarrowtail": "↢",
  4515. "LeftCeiling": "⌈",
  4516. "LeftDoubleBracket": "⟦",
  4517. "LeftDownTeeVector": "⥡",
  4518. "LeftDownVectorBar": "⥙",
  4519. "LeftDownVector": "⇃",
  4520. "LeftFloor": "⌊",
  4521. "leftharpoondown": "↽",
  4522. "leftharpoonup": "↼",
  4523. "leftleftarrows": "⇇",
  4524. "leftrightarrow": "↔",
  4525. "LeftRightArrow": "↔",
  4526. "Leftrightarrow": "⇔",
  4527. "leftrightarrows": "⇆",
  4528. "leftrightharpoons": "⇋",
  4529. "leftrightsquigarrow": "↭",
  4530. "LeftRightVector": "⥎",
  4531. "LeftTeeArrow": "↤",
  4532. "LeftTee": "⊣",
  4533. "LeftTeeVector": "⥚",
  4534. "leftthreetimes": "⋋",
  4535. "LeftTriangleBar": "⧏",
  4536. "LeftTriangle": "⊲",
  4537. "LeftTriangleEqual": "⊴",
  4538. "LeftUpDownVector": "⥑",
  4539. "LeftUpTeeVector": "⥠",
  4540. "LeftUpVectorBar": "⥘",
  4541. "LeftUpVector": "↿",
  4542. "LeftVectorBar": "⥒",
  4543. "LeftVector": "↼",
  4544. "lEg": "⪋",
  4545. "leg": "⋚",
  4546. "leq": "≤",
  4547. "leqq": "≦",
  4548. "leqslant": "⩽",
  4549. "lescc": "⪨",
  4550. "les": "⩽",
  4551. "lesdot": "⩿",
  4552. "lesdoto": "⪁",
  4553. "lesdotor": "⪃",
  4554. "lesg": "⋚︀",
  4555. "lesges": "⪓",
  4556. "lessapprox": "⪅",
  4557. "lessdot": "⋖",
  4558. "lesseqgtr": "⋚",
  4559. "lesseqqgtr": "⪋",
  4560. "LessEqualGreater": "⋚",
  4561. "LessFullEqual": "≦",
  4562. "LessGreater": "≶",
  4563. "lessgtr": "≶",
  4564. "LessLess": "⪡",
  4565. "lesssim": "≲",
  4566. "LessSlantEqual": "⩽",
  4567. "LessTilde": "≲",
  4568. "lfisht": "⥼",
  4569. "lfloor": "⌊",
  4570. "Lfr": "𝔏",
  4571. "lfr": "𝔩",
  4572. "lg": "≶",
  4573. "lgE": "⪑",
  4574. "lHar": "⥢",
  4575. "lhard": "↽",
  4576. "lharu": "↼",
  4577. "lharul": "⥪",
  4578. "lhblk": "▄",
  4579. "LJcy": "Љ",
  4580. "ljcy": "љ",
  4581. "llarr": "⇇",
  4582. "ll": "≪",
  4583. "Ll": "⋘",
  4584. "llcorner": "⌞",
  4585. "Lleftarrow": "⇚",
  4586. "llhard": "⥫",
  4587. "lltri": "◺",
  4588. "Lmidot": "Ŀ",
  4589. "lmidot": "ŀ",
  4590. "lmoustache": "⎰",
  4591. "lmoust": "⎰",
  4592. "lnap": "⪉",
  4593. "lnapprox": "⪉",
  4594. "lne": "⪇",
  4595. "lnE": "≨",
  4596. "lneq": "⪇",
  4597. "lneqq": "≨",
  4598. "lnsim": "⋦",
  4599. "loang": "⟬",
  4600. "loarr": "⇽",
  4601. "lobrk": "⟦",
  4602. "longleftarrow": "⟵",
  4603. "LongLeftArrow": "⟵",
  4604. "Longleftarrow": "⟸",
  4605. "longleftrightarrow": "⟷",
  4606. "LongLeftRightArrow": "⟷",
  4607. "Longleftrightarrow": "⟺",
  4608. "longmapsto": "⟼",
  4609. "longrightarrow": "⟶",
  4610. "LongRightArrow": "⟶",
  4611. "Longrightarrow": "⟹",
  4612. "looparrowleft": "↫",
  4613. "looparrowright": "↬",
  4614. "lopar": "⦅",
  4615. "Lopf": "𝕃",
  4616. "lopf": "𝕝",
  4617. "loplus": "⨭",
  4618. "lotimes": "⨴",
  4619. "lowast": "∗",
  4620. "lowbar": "_",
  4621. "LowerLeftArrow": "↙",
  4622. "LowerRightArrow": "↘",
  4623. "loz": "◊",
  4624. "lozenge": "◊",
  4625. "lozf": "⧫",
  4626. "lpar": "(",
  4627. "lparlt": "⦓",
  4628. "lrarr": "⇆",
  4629. "lrcorner": "⌟",
  4630. "lrhar": "⇋",
  4631. "lrhard": "⥭",
  4632. "lrm": "‎",
  4633. "lrtri": "⊿",
  4634. "lsaquo": "‹",
  4635. "lscr": "𝓁",
  4636. "Lscr": "ℒ",
  4637. "lsh": "↰",
  4638. "Lsh": "↰",
  4639. "lsim": "≲",
  4640. "lsime": "⪍",
  4641. "lsimg": "⪏",
  4642. "lsqb": "[",
  4643. "lsquo": "‘",
  4644. "lsquor": "‚",
  4645. "Lstrok": "Ł",
  4646. "lstrok": "ł",
  4647. "ltcc": "⪦",
  4648. "ltcir": "⩹",
  4649. "lt": "<",
  4650. "LT": "<",
  4651. "Lt": "≪",
  4652. "ltdot": "⋖",
  4653. "lthree": "⋋",
  4654. "ltimes": "⋉",
  4655. "ltlarr": "⥶",
  4656. "ltquest": "⩻",
  4657. "ltri": "◃",
  4658. "ltrie": "⊴",
  4659. "ltrif": "◂",
  4660. "ltrPar": "⦖",
  4661. "lurdshar": "⥊",
  4662. "luruhar": "⥦",
  4663. "lvertneqq": "≨︀",
  4664. "lvnE": "≨︀",
  4665. "macr": "¯",
  4666. "male": "♂",
  4667. "malt": "✠",
  4668. "maltese": "✠",
  4669. "Map": "⤅",
  4670. "map": "↦",
  4671. "mapsto": "↦",
  4672. "mapstodown": "↧",
  4673. "mapstoleft": "↤",
  4674. "mapstoup": "↥",
  4675. "marker": "▮",
  4676. "mcomma": "⨩",
  4677. "Mcy": "М",
  4678. "mcy": "м",
  4679. "mdash": "—",
  4680. "mDDot": "∺",
  4681. "measuredangle": "∡",
  4682. "MediumSpace": " ",
  4683. "Mellintrf": "ℳ",
  4684. "Mfr": "𝔐",
  4685. "mfr": "𝔪",
  4686. "mho": "℧",
  4687. "micro": "µ",
  4688. "midast": "*",
  4689. "midcir": "⫰",
  4690. "mid": "∣",
  4691. "middot": "·",
  4692. "minusb": "⊟",
  4693. "minus": "−",
  4694. "minusd": "∸",
  4695. "minusdu": "⨪",
  4696. "MinusPlus": "∓",
  4697. "mlcp": "⫛",
  4698. "mldr": "…",
  4699. "mnplus": "∓",
  4700. "models": "⊧",
  4701. "Mopf": "𝕄",
  4702. "mopf": "𝕞",
  4703. "mp": "∓",
  4704. "mscr": "𝓂",
  4705. "Mscr": "ℳ",
  4706. "mstpos": "∾",
  4707. "Mu": "Μ",
  4708. "mu": "μ",
  4709. "multimap": "⊸",
  4710. "mumap": "⊸",
  4711. "nabla": "∇",
  4712. "Nacute": "Ń",
  4713. "nacute": "ń",
  4714. "nang": "∠⃒",
  4715. "nap": "≉",
  4716. "napE": "⩰̸",
  4717. "napid": "≋̸",
  4718. "napos": "ʼn",
  4719. "napprox": "≉",
  4720. "natural": "♮",
  4721. "naturals": "ℕ",
  4722. "natur": "♮",
  4723. "nbsp": " ",
  4724. "nbump": "≎̸",
  4725. "nbumpe": "≏̸",
  4726. "ncap": "⩃",
  4727. "Ncaron": "Ň",
  4728. "ncaron": "ň",
  4729. "Ncedil": "Ņ",
  4730. "ncedil": "ņ",
  4731. "ncong": "≇",
  4732. "ncongdot": "⩭̸",
  4733. "ncup": "⩂",
  4734. "Ncy": "Н",
  4735. "ncy": "н",
  4736. "ndash": "–",
  4737. "nearhk": "⤤",
  4738. "nearr": "↗",
  4739. "neArr": "⇗",
  4740. "nearrow": "↗",
  4741. "ne": "≠",
  4742. "nedot": "≐̸",
  4743. "NegativeMediumSpace": "​",
  4744. "NegativeThickSpace": "​",
  4745. "NegativeThinSpace": "​",
  4746. "NegativeVeryThinSpace": "​",
  4747. "nequiv": "≢",
  4748. "nesear": "⤨",
  4749. "nesim": "≂̸",
  4750. "NestedGreaterGreater": "≫",
  4751. "NestedLessLess": "≪",
  4752. "NewLine": "\n",
  4753. "nexist": "∄",
  4754. "nexists": "∄",
  4755. "Nfr": "𝔑",
  4756. "nfr": "𝔫",
  4757. "ngE": "≧̸",
  4758. "nge": "≱",
  4759. "ngeq": "≱",
  4760. "ngeqq": "≧̸",
  4761. "ngeqslant": "⩾̸",
  4762. "nges": "⩾̸",
  4763. "nGg": "⋙̸",
  4764. "ngsim": "≵",
  4765. "nGt": "≫⃒",
  4766. "ngt": "≯",
  4767. "ngtr": "≯",
  4768. "nGtv": "≫̸",
  4769. "nharr": "↮",
  4770. "nhArr": "⇎",
  4771. "nhpar": "⫲",
  4772. "ni": "∋",
  4773. "nis": "⋼",
  4774. "nisd": "⋺",
  4775. "niv": "∋",
  4776. "NJcy": "Њ",
  4777. "njcy": "њ",
  4778. "nlarr": "↚",
  4779. "nlArr": "⇍",
  4780. "nldr": "‥",
  4781. "nlE": "≦̸",
  4782. "nle": "≰",
  4783. "nleftarrow": "↚",
  4784. "nLeftarrow": "⇍",
  4785. "nleftrightarrow": "↮",
  4786. "nLeftrightarrow": "⇎",
  4787. "nleq": "≰",
  4788. "nleqq": "≦̸",
  4789. "nleqslant": "⩽̸",
  4790. "nles": "⩽̸",
  4791. "nless": "≮",
  4792. "nLl": "⋘̸",
  4793. "nlsim": "≴",
  4794. "nLt": "≪⃒",
  4795. "nlt": "≮",
  4796. "nltri": "⋪",
  4797. "nltrie": "⋬",
  4798. "nLtv": "≪̸",
  4799. "nmid": "∤",
  4800. "NoBreak": "⁠",
  4801. "NonBreakingSpace": " ",
  4802. "nopf": "𝕟",
  4803. "Nopf": "ℕ",
  4804. "Not": "⫬",
  4805. "not": "¬",
  4806. "NotCongruent": "≢",
  4807. "NotCupCap": "≭",
  4808. "NotDoubleVerticalBar": "∦",
  4809. "NotElement": "∉",
  4810. "NotEqual": "≠",
  4811. "NotEqualTilde": "≂̸",
  4812. "NotExists": "∄",
  4813. "NotGreater": "≯",
  4814. "NotGreaterEqual": "≱",
  4815. "NotGreaterFullEqual": "≧̸",
  4816. "NotGreaterGreater": "≫̸",
  4817. "NotGreaterLess": "≹",
  4818. "NotGreaterSlantEqual": "⩾̸",
  4819. "NotGreaterTilde": "≵",
  4820. "NotHumpDownHump": "≎̸",
  4821. "NotHumpEqual": "≏̸",
  4822. "notin": "∉",
  4823. "notindot": "⋵̸",
  4824. "notinE": "⋹̸",
  4825. "notinva": "∉",
  4826. "notinvb": "⋷",
  4827. "notinvc": "⋶",
  4828. "NotLeftTriangleBar": "⧏̸",
  4829. "NotLeftTriangle": "⋪",
  4830. "NotLeftTriangleEqual": "⋬",
  4831. "NotLess": "≮",
  4832. "NotLessEqual": "≰",
  4833. "NotLessGreater": "≸",
  4834. "NotLessLess": "≪̸",
  4835. "NotLessSlantEqual": "⩽̸",
  4836. "NotLessTilde": "≴",
  4837. "NotNestedGreaterGreater": "⪢̸",
  4838. "NotNestedLessLess": "⪡̸",
  4839. "notni": "∌",
  4840. "notniva": "∌",
  4841. "notnivb": "⋾",
  4842. "notnivc": "⋽",
  4843. "NotPrecedes": "⊀",
  4844. "NotPrecedesEqual": "⪯̸",
  4845. "NotPrecedesSlantEqual": "⋠",
  4846. "NotReverseElement": "∌",
  4847. "NotRightTriangleBar": "⧐̸",
  4848. "NotRightTriangle": "⋫",
  4849. "NotRightTriangleEqual": "⋭",
  4850. "NotSquareSubset": "⊏̸",
  4851. "NotSquareSubsetEqual": "⋢",
  4852. "NotSquareSuperset": "⊐̸",
  4853. "NotSquareSupersetEqual": "⋣",
  4854. "NotSubset": "⊂⃒",
  4855. "NotSubsetEqual": "⊈",
  4856. "NotSucceeds": "⊁",
  4857. "NotSucceedsEqual": "⪰̸",
  4858. "NotSucceedsSlantEqual": "⋡",
  4859. "NotSucceedsTilde": "≿̸",
  4860. "NotSuperset": "⊃⃒",
  4861. "NotSupersetEqual": "⊉",
  4862. "NotTilde": "≁",
  4863. "NotTildeEqual": "≄",
  4864. "NotTildeFullEqual": "≇",
  4865. "NotTildeTilde": "≉",
  4866. "NotVerticalBar": "∤",
  4867. "nparallel": "∦",
  4868. "npar": "∦",
  4869. "nparsl": "⫽⃥",
  4870. "npart": "∂̸",
  4871. "npolint": "⨔",
  4872. "npr": "⊀",
  4873. "nprcue": "⋠",
  4874. "nprec": "⊀",
  4875. "npreceq": "⪯̸",
  4876. "npre": "⪯̸",
  4877. "nrarrc": "⤳̸",
  4878. "nrarr": "↛",
  4879. "nrArr": "⇏",
  4880. "nrarrw": "↝̸",
  4881. "nrightarrow": "↛",
  4882. "nRightarrow": "⇏",
  4883. "nrtri": "⋫",
  4884. "nrtrie": "⋭",
  4885. "nsc": "⊁",
  4886. "nsccue": "⋡",
  4887. "nsce": "⪰̸",
  4888. "Nscr": "𝒩",
  4889. "nscr": "𝓃",
  4890. "nshortmid": "∤",
  4891. "nshortparallel": "∦",
  4892. "nsim": "≁",
  4893. "nsime": "≄",
  4894. "nsimeq": "≄",
  4895. "nsmid": "∤",
  4896. "nspar": "∦",
  4897. "nsqsube": "⋢",
  4898. "nsqsupe": "⋣",
  4899. "nsub": "⊄",
  4900. "nsubE": "⫅̸",
  4901. "nsube": "⊈",
  4902. "nsubset": "⊂⃒",
  4903. "nsubseteq": "⊈",
  4904. "nsubseteqq": "⫅̸",
  4905. "nsucc": "⊁",
  4906. "nsucceq": "⪰̸",
  4907. "nsup": "⊅",
  4908. "nsupE": "⫆̸",
  4909. "nsupe": "⊉",
  4910. "nsupset": "⊃⃒",
  4911. "nsupseteq": "⊉",
  4912. "nsupseteqq": "⫆̸",
  4913. "ntgl": "≹",
  4914. "Ntilde": "Ñ",
  4915. "ntilde": "ñ",
  4916. "ntlg": "≸",
  4917. "ntriangleleft": "⋪",
  4918. "ntrianglelefteq": "⋬",
  4919. "ntriangleright": "⋫",
  4920. "ntrianglerighteq": "⋭",
  4921. "Nu": "Ν",
  4922. "nu": "ν",
  4923. "num": "#",
  4924. "numero": "№",
  4925. "numsp": " ",
  4926. "nvap": "≍⃒",
  4927. "nvdash": "⊬",
  4928. "nvDash": "⊭",
  4929. "nVdash": "⊮",
  4930. "nVDash": "⊯",
  4931. "nvge": "≥⃒",
  4932. "nvgt": ">⃒",
  4933. "nvHarr": "⤄",
  4934. "nvinfin": "⧞",
  4935. "nvlArr": "⤂",
  4936. "nvle": "≤⃒",
  4937. "nvlt": "<⃒",
  4938. "nvltrie": "⊴⃒",
  4939. "nvrArr": "⤃",
  4940. "nvrtrie": "⊵⃒",
  4941. "nvsim": "∼⃒",
  4942. "nwarhk": "⤣",
  4943. "nwarr": "↖",
  4944. "nwArr": "⇖",
  4945. "nwarrow": "↖",
  4946. "nwnear": "⤧",
  4947. "Oacute": "Ó",
  4948. "oacute": "ó",
  4949. "oast": "⊛",
  4950. "Ocirc": "Ô",
  4951. "ocirc": "ô",
  4952. "ocir": "⊚",
  4953. "Ocy": "О",
  4954. "ocy": "о",
  4955. "odash": "⊝",
  4956. "Odblac": "Ő",
  4957. "odblac": "ő",
  4958. "odiv": "⨸",
  4959. "odot": "⊙",
  4960. "odsold": "⦼",
  4961. "OElig": "Œ",
  4962. "oelig": "œ",
  4963. "ofcir": "⦿",
  4964. "Ofr": "𝔒",
  4965. "ofr": "𝔬",
  4966. "ogon": "˛",
  4967. "Ograve": "Ò",
  4968. "ograve": "ò",
  4969. "ogt": "⧁",
  4970. "ohbar": "⦵",
  4971. "ohm": "Ω",
  4972. "oint": "∮",
  4973. "olarr": "↺",
  4974. "olcir": "⦾",
  4975. "olcross": "⦻",
  4976. "oline": "‾",
  4977. "olt": "⧀",
  4978. "Omacr": "Ō",
  4979. "omacr": "ō",
  4980. "Omega": "Ω",
  4981. "omega": "ω",
  4982. "Omicron": "Ο",
  4983. "omicron": "ο",
  4984. "omid": "⦶",
  4985. "ominus": "⊖",
  4986. "Oopf": "𝕆",
  4987. "oopf": "𝕠",
  4988. "opar": "⦷",
  4989. "OpenCurlyDoubleQuote": "“",
  4990. "OpenCurlyQuote": "‘",
  4991. "operp": "⦹",
  4992. "oplus": "⊕",
  4993. "orarr": "↻",
  4994. "Or": "⩔",
  4995. "or": "∨",
  4996. "ord": "⩝",
  4997. "order": "ℴ",
  4998. "orderof": "ℴ",
  4999. "ordf": "ª",
  5000. "ordm": "º",
  5001. "origof": "⊶",
  5002. "oror": "⩖",
  5003. "orslope": "⩗",
  5004. "orv": "⩛",
  5005. "oS": "Ⓢ",
  5006. "Oscr": "𝒪",
  5007. "oscr": "ℴ",
  5008. "Oslash": "Ø",
  5009. "oslash": "ø",
  5010. "osol": "⊘",
  5011. "Otilde": "Õ",
  5012. "otilde": "õ",
  5013. "otimesas": "⨶",
  5014. "Otimes": "⨷",
  5015. "otimes": "⊗",
  5016. "Ouml": "Ö",
  5017. "ouml": "ö",
  5018. "ovbar": "⌽",
  5019. "OverBar": "‾",
  5020. "OverBrace": "⏞",
  5021. "OverBracket": "⎴",
  5022. "OverParenthesis": "⏜",
  5023. "para": "¶",
  5024. "parallel": "∥",
  5025. "par": "∥",
  5026. "parsim": "⫳",
  5027. "parsl": "⫽",
  5028. "part": "∂",
  5029. "PartialD": "∂",
  5030. "Pcy": "П",
  5031. "pcy": "п",
  5032. "percnt": "%",
  5033. "period": ".",
  5034. "permil": "‰",
  5035. "perp": "⊥",
  5036. "pertenk": "‱",
  5037. "Pfr": "𝔓",
  5038. "pfr": "𝔭",
  5039. "Phi": "Φ",
  5040. "phi": "φ",
  5041. "phiv": "ϕ",
  5042. "phmmat": "ℳ",
  5043. "phone": "☎",
  5044. "Pi": "Π",
  5045. "pi": "π",
  5046. "pitchfork": "⋔",
  5047. "piv": "ϖ",
  5048. "planck": "ℏ",
  5049. "planckh": "ℎ",
  5050. "plankv": "ℏ",
  5051. "plusacir": "⨣",
  5052. "plusb": "⊞",
  5053. "pluscir": "⨢",
  5054. "plus": "+",
  5055. "plusdo": "∔",
  5056. "plusdu": "⨥",
  5057. "pluse": "⩲",
  5058. "PlusMinus": "±",
  5059. "plusmn": "±",
  5060. "plussim": "⨦",
  5061. "plustwo": "⨧",
  5062. "pm": "±",
  5063. "Poincareplane": "ℌ",
  5064. "pointint": "⨕",
  5065. "popf": "𝕡",
  5066. "Popf": "ℙ",
  5067. "pound": "£",
  5068. "prap": "⪷",
  5069. "Pr": "⪻",
  5070. "pr": "≺",
  5071. "prcue": "≼",
  5072. "precapprox": "⪷",
  5073. "prec": "≺",
  5074. "preccurlyeq": "≼",
  5075. "Precedes": "≺",
  5076. "PrecedesEqual": "⪯",
  5077. "PrecedesSlantEqual": "≼",
  5078. "PrecedesTilde": "≾",
  5079. "preceq": "⪯",
  5080. "precnapprox": "⪹",
  5081. "precneqq": "⪵",
  5082. "precnsim": "⋨",
  5083. "pre": "⪯",
  5084. "prE": "⪳",
  5085. "precsim": "≾",
  5086. "prime": "′",
  5087. "Prime": "″",
  5088. "primes": "ℙ",
  5089. "prnap": "⪹",
  5090. "prnE": "⪵",
  5091. "prnsim": "⋨",
  5092. "prod": "∏",
  5093. "Product": "∏",
  5094. "profalar": "⌮",
  5095. "profline": "⌒",
  5096. "profsurf": "⌓",
  5097. "prop": "∝",
  5098. "Proportional": "∝",
  5099. "Proportion": "∷",
  5100. "propto": "∝",
  5101. "prsim": "≾",
  5102. "prurel": "⊰",
  5103. "Pscr": "𝒫",
  5104. "pscr": "𝓅",
  5105. "Psi": "Ψ",
  5106. "psi": "ψ",
  5107. "puncsp": " ",
  5108. "Qfr": "𝔔",
  5109. "qfr": "𝔮",
  5110. "qint": "⨌",
  5111. "qopf": "𝕢",
  5112. "Qopf": "ℚ",
  5113. "qprime": "⁗",
  5114. "Qscr": "𝒬",
  5115. "qscr": "𝓆",
  5116. "quaternions": "ℍ",
  5117. "quatint": "⨖",
  5118. "quest": "?",
  5119. "questeq": "≟",
  5120. "quot": "\"",
  5121. "QUOT": "\"",
  5122. "rAarr": "⇛",
  5123. "race": "∽̱",
  5124. "Racute": "Ŕ",
  5125. "racute": "ŕ",
  5126. "radic": "√",
  5127. "raemptyv": "⦳",
  5128. "rang": "⟩",
  5129. "Rang": "⟫",
  5130. "rangd": "⦒",
  5131. "range": "⦥",
  5132. "rangle": "⟩",
  5133. "raquo": "»",
  5134. "rarrap": "⥵",
  5135. "rarrb": "⇥",
  5136. "rarrbfs": "⤠",
  5137. "rarrc": "⤳",
  5138. "rarr": "→",
  5139. "Rarr": "↠",
  5140. "rArr": "⇒",
  5141. "rarrfs": "⤞",
  5142. "rarrhk": "↪",
  5143. "rarrlp": "↬",
  5144. "rarrpl": "⥅",
  5145. "rarrsim": "⥴",
  5146. "Rarrtl": "⤖",
  5147. "rarrtl": "↣",
  5148. "rarrw": "↝",
  5149. "ratail": "⤚",
  5150. "rAtail": "⤜",
  5151. "ratio": "∶",
  5152. "rationals": "ℚ",
  5153. "rbarr": "⤍",
  5154. "rBarr": "⤏",
  5155. "RBarr": "⤐",
  5156. "rbbrk": "❳",
  5157. "rbrace": "}",
  5158. "rbrack": "]",
  5159. "rbrke": "⦌",
  5160. "rbrksld": "⦎",
  5161. "rbrkslu": "⦐",
  5162. "Rcaron": "Ř",
  5163. "rcaron": "ř",
  5164. "Rcedil": "Ŗ",
  5165. "rcedil": "ŗ",
  5166. "rceil": "⌉",
  5167. "rcub": "}",
  5168. "Rcy": "Р",
  5169. "rcy": "р",
  5170. "rdca": "⤷",
  5171. "rdldhar": "⥩",
  5172. "rdquo": "”",
  5173. "rdquor": "”",
  5174. "rdsh": "↳",
  5175. "real": "ℜ",
  5176. "realine": "ℛ",
  5177. "realpart": "ℜ",
  5178. "reals": "ℝ",
  5179. "Re": "ℜ",
  5180. "rect": "▭",
  5181. "reg": "®",
  5182. "REG": "®",
  5183. "ReverseElement": "∋",
  5184. "ReverseEquilibrium": "⇋",
  5185. "ReverseUpEquilibrium": "⥯",
  5186. "rfisht": "⥽",
  5187. "rfloor": "⌋",
  5188. "rfr": "𝔯",
  5189. "Rfr": "ℜ",
  5190. "rHar": "⥤",
  5191. "rhard": "⇁",
  5192. "rharu": "⇀",
  5193. "rharul": "⥬",
  5194. "Rho": "Ρ",
  5195. "rho": "ρ",
  5196. "rhov": "ϱ",
  5197. "RightAngleBracket": "⟩",
  5198. "RightArrowBar": "⇥",
  5199. "rightarrow": "→",
  5200. "RightArrow": "→",
  5201. "Rightarrow": "⇒",
  5202. "RightArrowLeftArrow": "⇄",
  5203. "rightarrowtail": "↣",
  5204. "RightCeiling": "⌉",
  5205. "RightDoubleBracket": "⟧",
  5206. "RightDownTeeVector": "⥝",
  5207. "RightDownVectorBar": "⥕",
  5208. "RightDownVector": "⇂",
  5209. "RightFloor": "⌋",
  5210. "rightharpoondown": "⇁",
  5211. "rightharpoonup": "⇀",
  5212. "rightleftarrows": "⇄",
  5213. "rightleftharpoons": "⇌",
  5214. "rightrightarrows": "⇉",
  5215. "rightsquigarrow": "↝",
  5216. "RightTeeArrow": "↦",
  5217. "RightTee": "⊢",
  5218. "RightTeeVector": "⥛",
  5219. "rightthreetimes": "⋌",
  5220. "RightTriangleBar": "⧐",
  5221. "RightTriangle": "⊳",
  5222. "RightTriangleEqual": "⊵",
  5223. "RightUpDownVector": "⥏",
  5224. "RightUpTeeVector": "⥜",
  5225. "RightUpVectorBar": "⥔",
  5226. "RightUpVector": "↾",
  5227. "RightVectorBar": "⥓",
  5228. "RightVector": "⇀",
  5229. "ring": "˚",
  5230. "risingdotseq": "≓",
  5231. "rlarr": "⇄",
  5232. "rlhar": "⇌",
  5233. "rlm": "‏",
  5234. "rmoustache": "⎱",
  5235. "rmoust": "⎱",
  5236. "rnmid": "⫮",
  5237. "roang": "⟭",
  5238. "roarr": "⇾",
  5239. "robrk": "⟧",
  5240. "ropar": "⦆",
  5241. "ropf": "𝕣",
  5242. "Ropf": "ℝ",
  5243. "roplus": "⨮",
  5244. "rotimes": "⨵",
  5245. "RoundImplies": "⥰",
  5246. "rpar": ")",
  5247. "rpargt": "⦔",
  5248. "rppolint": "⨒",
  5249. "rrarr": "⇉",
  5250. "Rrightarrow": "⇛",
  5251. "rsaquo": "›",
  5252. "rscr": "𝓇",
  5253. "Rscr": "ℛ",
  5254. "rsh": "↱",
  5255. "Rsh": "↱",
  5256. "rsqb": "]",
  5257. "rsquo": "’",
  5258. "rsquor": "’",
  5259. "rthree": "⋌",
  5260. "rtimes": "⋊",
  5261. "rtri": "▹",
  5262. "rtrie": "⊵",
  5263. "rtrif": "▸",
  5264. "rtriltri": "⧎",
  5265. "RuleDelayed": "⧴",
  5266. "ruluhar": "⥨",
  5267. "rx": "℞",
  5268. "Sacute": "Ś",
  5269. "sacute": "ś",
  5270. "sbquo": "‚",
  5271. "scap": "⪸",
  5272. "Scaron": "Š",
  5273. "scaron": "š",
  5274. "Sc": "⪼",
  5275. "sc": "≻",
  5276. "sccue": "≽",
  5277. "sce": "⪰",
  5278. "scE": "⪴",
  5279. "Scedil": "Ş",
  5280. "scedil": "ş",
  5281. "Scirc": "Ŝ",
  5282. "scirc": "ŝ",
  5283. "scnap": "⪺",
  5284. "scnE": "⪶",
  5285. "scnsim": "⋩",
  5286. "scpolint": "⨓",
  5287. "scsim": "≿",
  5288. "Scy": "С",
  5289. "scy": "с",
  5290. "sdotb": "⊡",
  5291. "sdot": "⋅",
  5292. "sdote": "⩦",
  5293. "searhk": "⤥",
  5294. "searr": "↘",
  5295. "seArr": "⇘",
  5296. "searrow": "↘",
  5297. "sect": "§",
  5298. "semi": ";",
  5299. "seswar": "⤩",
  5300. "setminus": "∖",
  5301. "setmn": "∖",
  5302. "sext": "✶",
  5303. "Sfr": "𝔖",
  5304. "sfr": "𝔰",
  5305. "sfrown": "⌢",
  5306. "sharp": "♯",
  5307. "SHCHcy": "Щ",
  5308. "shchcy": "щ",
  5309. "SHcy": "Ш",
  5310. "shcy": "ш",
  5311. "ShortDownArrow": "↓",
  5312. "ShortLeftArrow": "←",
  5313. "shortmid": "∣",
  5314. "shortparallel": "∥",
  5315. "ShortRightArrow": "→",
  5316. "ShortUpArrow": "↑",
  5317. "shy": "­",
  5318. "Sigma": "Σ",
  5319. "sigma": "σ",
  5320. "sigmaf": "ς",
  5321. "sigmav": "ς",
  5322. "sim": "∼",
  5323. "simdot": "⩪",
  5324. "sime": "≃",
  5325. "simeq": "≃",
  5326. "simg": "⪞",
  5327. "simgE": "⪠",
  5328. "siml": "⪝",
  5329. "simlE": "⪟",
  5330. "simne": "≆",
  5331. "simplus": "⨤",
  5332. "simrarr": "⥲",
  5333. "slarr": "←",
  5334. "SmallCircle": "∘",
  5335. "smallsetminus": "∖",
  5336. "smashp": "⨳",
  5337. "smeparsl": "⧤",
  5338. "smid": "∣",
  5339. "smile": "⌣",
  5340. "smt": "⪪",
  5341. "smte": "⪬",
  5342. "smtes": "⪬︀",
  5343. "SOFTcy": "Ь",
  5344. "softcy": "ь",
  5345. "solbar": "⌿",
  5346. "solb": "⧄",
  5347. "sol": "/",
  5348. "Sopf": "𝕊",
  5349. "sopf": "𝕤",
  5350. "spades": "♠",
  5351. "spadesuit": "♠",
  5352. "spar": "∥",
  5353. "sqcap": "⊓",
  5354. "sqcaps": "⊓︀",
  5355. "sqcup": "⊔",
  5356. "sqcups": "⊔︀",
  5357. "Sqrt": "√",
  5358. "sqsub": "⊏",
  5359. "sqsube": "⊑",
  5360. "sqsubset": "⊏",
  5361. "sqsubseteq": "⊑",
  5362. "sqsup": "⊐",
  5363. "sqsupe": "⊒",
  5364. "sqsupset": "⊐",
  5365. "sqsupseteq": "⊒",
  5366. "square": "□",
  5367. "Square": "□",
  5368. "SquareIntersection": "⊓",
  5369. "SquareSubset": "⊏",
  5370. "SquareSubsetEqual": "⊑",
  5371. "SquareSuperset": "⊐",
  5372. "SquareSupersetEqual": "⊒",
  5373. "SquareUnion": "⊔",
  5374. "squarf": "▪",
  5375. "squ": "□",
  5376. "squf": "▪",
  5377. "srarr": "→",
  5378. "Sscr": "𝒮",
  5379. "sscr": "𝓈",
  5380. "ssetmn": "∖",
  5381. "ssmile": "⌣",
  5382. "sstarf": "⋆",
  5383. "Star": "⋆",
  5384. "star": "☆",
  5385. "starf": "★",
  5386. "straightepsilon": "ϵ",
  5387. "straightphi": "ϕ",
  5388. "strns": "¯",
  5389. "sub": "⊂",
  5390. "Sub": "⋐",
  5391. "subdot": "⪽",
  5392. "subE": "⫅",
  5393. "sube": "⊆",
  5394. "subedot": "⫃",
  5395. "submult": "⫁",
  5396. "subnE": "⫋",
  5397. "subne": "⊊",
  5398. "subplus": "⪿",
  5399. "subrarr": "⥹",
  5400. "subset": "⊂",
  5401. "Subset": "⋐",
  5402. "subseteq": "⊆",
  5403. "subseteqq": "⫅",
  5404. "SubsetEqual": "⊆",
  5405. "subsetneq": "⊊",
  5406. "subsetneqq": "⫋",
  5407. "subsim": "⫇",
  5408. "subsub": "⫕",
  5409. "subsup": "⫓",
  5410. "succapprox": "⪸",
  5411. "succ": "≻",
  5412. "succcurlyeq": "≽",
  5413. "Succeeds": "≻",
  5414. "SucceedsEqual": "⪰",
  5415. "SucceedsSlantEqual": "≽",
  5416. "SucceedsTilde": "≿",
  5417. "succeq": "⪰",
  5418. "succnapprox": "⪺",
  5419. "succneqq": "⪶",
  5420. "succnsim": "⋩",
  5421. "succsim": "≿",
  5422. "SuchThat": "∋",
  5423. "sum": "∑",
  5424. "Sum": "∑",
  5425. "sung": "♪",
  5426. "sup1": "¹",
  5427. "sup2": "²",
  5428. "sup3": "³",
  5429. "sup": "⊃",
  5430. "Sup": "⋑",
  5431. "supdot": "⪾",
  5432. "supdsub": "⫘",
  5433. "supE": "⫆",
  5434. "supe": "⊇",
  5435. "supedot": "⫄",
  5436. "Superset": "⊃",
  5437. "SupersetEqual": "⊇",
  5438. "suphsol": "⟉",
  5439. "suphsub": "⫗",
  5440. "suplarr": "⥻",
  5441. "supmult": "⫂",
  5442. "supnE": "⫌",
  5443. "supne": "⊋",
  5444. "supplus": "⫀",
  5445. "supset": "⊃",
  5446. "Supset": "⋑",
  5447. "supseteq": "⊇",
  5448. "supseteqq": "⫆",
  5449. "supsetneq": "⊋",
  5450. "supsetneqq": "⫌",
  5451. "supsim": "⫈",
  5452. "supsub": "⫔",
  5453. "supsup": "⫖",
  5454. "swarhk": "⤦",
  5455. "swarr": "↙",
  5456. "swArr": "⇙",
  5457. "swarrow": "↙",
  5458. "swnwar": "⤪",
  5459. "szlig": "ß",
  5460. "Tab": "\t",
  5461. "target": "⌖",
  5462. "Tau": "Τ",
  5463. "tau": "τ",
  5464. "tbrk": "⎴",
  5465. "Tcaron": "Ť",
  5466. "tcaron": "ť",
  5467. "Tcedil": "Ţ",
  5468. "tcedil": "ţ",
  5469. "Tcy": "Т",
  5470. "tcy": "т",
  5471. "tdot": "⃛",
  5472. "telrec": "⌕",
  5473. "Tfr": "𝔗",
  5474. "tfr": "𝔱",
  5475. "there4": "∴",
  5476. "therefore": "∴",
  5477. "Therefore": "∴",
  5478. "Theta": "Θ",
  5479. "theta": "θ",
  5480. "thetasym": "ϑ",
  5481. "thetav": "ϑ",
  5482. "thickapprox": "≈",
  5483. "thicksim": "∼",
  5484. "ThickSpace": "  ",
  5485. "ThinSpace": " ",
  5486. "thinsp": " ",
  5487. "thkap": "≈",
  5488. "thksim": "∼",
  5489. "THORN": "Þ",
  5490. "thorn": "þ",
  5491. "tilde": "˜",
  5492. "Tilde": "∼",
  5493. "TildeEqual": "≃",
  5494. "TildeFullEqual": "≅",
  5495. "TildeTilde": "≈",
  5496. "timesbar": "⨱",
  5497. "timesb": "⊠",
  5498. "times": "×",
  5499. "timesd": "⨰",
  5500. "tint": "∭",
  5501. "toea": "⤨",
  5502. "topbot": "⌶",
  5503. "topcir": "⫱",
  5504. "top": "⊤",
  5505. "Topf": "𝕋",
  5506. "topf": "𝕥",
  5507. "topfork": "⫚",
  5508. "tosa": "⤩",
  5509. "tprime": "‴",
  5510. "trade": "™",
  5511. "TRADE": "™",
  5512. "triangle": "▵",
  5513. "triangledown": "▿",
  5514. "triangleleft": "◃",
  5515. "trianglelefteq": "⊴",
  5516. "triangleq": "≜",
  5517. "triangleright": "▹",
  5518. "trianglerighteq": "⊵",
  5519. "tridot": "◬",
  5520. "trie": "≜",
  5521. "triminus": "⨺",
  5522. "TripleDot": "⃛",
  5523. "triplus": "⨹",
  5524. "trisb": "⧍",
  5525. "tritime": "⨻",
  5526. "trpezium": "⏢",
  5527. "Tscr": "𝒯",
  5528. "tscr": "𝓉",
  5529. "TScy": "Ц",
  5530. "tscy": "ц",
  5531. "TSHcy": "Ћ",
  5532. "tshcy": "ћ",
  5533. "Tstrok": "Ŧ",
  5534. "tstrok": "ŧ",
  5535. "twixt": "≬",
  5536. "twoheadleftarrow": "↞",
  5537. "twoheadrightarrow": "↠",
  5538. "Uacute": "Ú",
  5539. "uacute": "ú",
  5540. "uarr": "↑",
  5541. "Uarr": "↟",
  5542. "uArr": "⇑",
  5543. "Uarrocir": "⥉",
  5544. "Ubrcy": "Ў",
  5545. "ubrcy": "ў",
  5546. "Ubreve": "Ŭ",
  5547. "ubreve": "ŭ",
  5548. "Ucirc": "Û",
  5549. "ucirc": "û",
  5550. "Ucy": "У",
  5551. "ucy": "у",
  5552. "udarr": "⇅",
  5553. "Udblac": "Ű",
  5554. "udblac": "ű",
  5555. "udhar": "⥮",
  5556. "ufisht": "⥾",
  5557. "Ufr": "𝔘",
  5558. "ufr": "𝔲",
  5559. "Ugrave": "Ù",
  5560. "ugrave": "ù",
  5561. "uHar": "⥣",
  5562. "uharl": "↿",
  5563. "uharr": "↾",
  5564. "uhblk": "▀",
  5565. "ulcorn": "⌜",
  5566. "ulcorner": "⌜",
  5567. "ulcrop": "⌏",
  5568. "ultri": "◸",
  5569. "Umacr": "Ū",
  5570. "umacr": "ū",
  5571. "uml": "¨",
  5572. "UnderBar": "_",
  5573. "UnderBrace": "⏟",
  5574. "UnderBracket": "⎵",
  5575. "UnderParenthesis": "⏝",
  5576. "Union": "⋃",
  5577. "UnionPlus": "⊎",
  5578. "Uogon": "Ų",
  5579. "uogon": "ų",
  5580. "Uopf": "𝕌",
  5581. "uopf": "𝕦",
  5582. "UpArrowBar": "⤒",
  5583. "uparrow": "↑",
  5584. "UpArrow": "↑",
  5585. "Uparrow": "⇑",
  5586. "UpArrowDownArrow": "⇅",
  5587. "updownarrow": "↕",
  5588. "UpDownArrow": "↕",
  5589. "Updownarrow": "⇕",
  5590. "UpEquilibrium": "⥮",
  5591. "upharpoonleft": "↿",
  5592. "upharpoonright": "↾",
  5593. "uplus": "⊎",
  5594. "UpperLeftArrow": "↖",
  5595. "UpperRightArrow": "↗",
  5596. "upsi": "υ",
  5597. "Upsi": "ϒ",
  5598. "upsih": "ϒ",
  5599. "Upsilon": "Υ",
  5600. "upsilon": "υ",
  5601. "UpTeeArrow": "↥",
  5602. "UpTee": "⊥",
  5603. "upuparrows": "⇈",
  5604. "urcorn": "⌝",
  5605. "urcorner": "⌝",
  5606. "urcrop": "⌎",
  5607. "Uring": "Ů",
  5608. "uring": "ů",
  5609. "urtri": "◹",
  5610. "Uscr": "𝒰",
  5611. "uscr": "𝓊",
  5612. "utdot": "⋰",
  5613. "Utilde": "Ũ",
  5614. "utilde": "ũ",
  5615. "utri": "▵",
  5616. "utrif": "▴",
  5617. "uuarr": "⇈",
  5618. "Uuml": "Ü",
  5619. "uuml": "ü",
  5620. "uwangle": "⦧",
  5621. "vangrt": "⦜",
  5622. "varepsilon": "ϵ",
  5623. "varkappa": "ϰ",
  5624. "varnothing": "∅",
  5625. "varphi": "ϕ",
  5626. "varpi": "ϖ",
  5627. "varpropto": "∝",
  5628. "varr": "↕",
  5629. "vArr": "⇕",
  5630. "varrho": "ϱ",
  5631. "varsigma": "ς",
  5632. "varsubsetneq": "⊊︀",
  5633. "varsubsetneqq": "⫋︀",
  5634. "varsupsetneq": "⊋︀",
  5635. "varsupsetneqq": "⫌︀",
  5636. "vartheta": "ϑ",
  5637. "vartriangleleft": "⊲",
  5638. "vartriangleright": "⊳",
  5639. "vBar": "⫨",
  5640. "Vbar": "⫫",
  5641. "vBarv": "⫩",
  5642. "Vcy": "В",
  5643. "vcy": "в",
  5644. "vdash": "⊢",
  5645. "vDash": "⊨",
  5646. "Vdash": "⊩",
  5647. "VDash": "⊫",
  5648. "Vdashl": "⫦",
  5649. "veebar": "⊻",
  5650. "vee": "∨",
  5651. "Vee": "⋁",
  5652. "veeeq": "≚",
  5653. "vellip": "⋮",
  5654. "verbar": "|",
  5655. "Verbar": "‖",
  5656. "vert": "|",
  5657. "Vert": "‖",
  5658. "VerticalBar": "∣",
  5659. "VerticalLine": "|",
  5660. "VerticalSeparator": "❘",
  5661. "VerticalTilde": "≀",
  5662. "VeryThinSpace": " ",
  5663. "Vfr": "𝔙",
  5664. "vfr": "𝔳",
  5665. "vltri": "⊲",
  5666. "vnsub": "⊂⃒",
  5667. "vnsup": "⊃⃒",
  5668. "Vopf": "𝕍",
  5669. "vopf": "𝕧",
  5670. "vprop": "∝",
  5671. "vrtri": "⊳",
  5672. "Vscr": "𝒱",
  5673. "vscr": "𝓋",
  5674. "vsubnE": "⫋︀",
  5675. "vsubne": "⊊︀",
  5676. "vsupnE": "⫌︀",
  5677. "vsupne": "⊋︀",
  5678. "Vvdash": "⊪",
  5679. "vzigzag": "⦚",
  5680. "Wcirc": "Ŵ",
  5681. "wcirc": "ŵ",
  5682. "wedbar": "⩟",
  5683. "wedge": "∧",
  5684. "Wedge": "⋀",
  5685. "wedgeq": "≙",
  5686. "weierp": "℘",
  5687. "Wfr": "𝔚",
  5688. "wfr": "𝔴",
  5689. "Wopf": "𝕎",
  5690. "wopf": "𝕨",
  5691. "wp": "℘",
  5692. "wr": "≀",
  5693. "wreath": "≀",
  5694. "Wscr": "𝒲",
  5695. "wscr": "𝓌",
  5696. "xcap": "⋂",
  5697. "xcirc": "◯",
  5698. "xcup": "⋃",
  5699. "xdtri": "▽",
  5700. "Xfr": "𝔛",
  5701. "xfr": "𝔵",
  5702. "xharr": "⟷",
  5703. "xhArr": "⟺",
  5704. "Xi": "Ξ",
  5705. "xi": "ξ",
  5706. "xlarr": "⟵",
  5707. "xlArr": "⟸",
  5708. "xmap": "⟼",
  5709. "xnis": "⋻",
  5710. "xodot": "⨀",
  5711. "Xopf": "𝕏",
  5712. "xopf": "𝕩",
  5713. "xoplus": "⨁",
  5714. "xotime": "⨂",
  5715. "xrarr": "⟶",
  5716. "xrArr": "⟹",
  5717. "Xscr": "𝒳",
  5718. "xscr": "𝓍",
  5719. "xsqcup": "⨆",
  5720. "xuplus": "⨄",
  5721. "xutri": "△",
  5722. "xvee": "⋁",
  5723. "xwedge": "⋀",
  5724. "Yacute": "Ý",
  5725. "yacute": "ý",
  5726. "YAcy": "Я",
  5727. "yacy": "я",
  5728. "Ycirc": "Ŷ",
  5729. "ycirc": "ŷ",
  5730. "Ycy": "Ы",
  5731. "ycy": "ы",
  5732. "yen": "¥",
  5733. "Yfr": "𝔜",
  5734. "yfr": "𝔶",
  5735. "YIcy": "Ї",
  5736. "yicy": "ї",
  5737. "Yopf": "𝕐",
  5738. "yopf": "𝕪",
  5739. "Yscr": "𝒴",
  5740. "yscr": "𝓎",
  5741. "YUcy": "Ю",
  5742. "yucy": "ю",
  5743. "yuml": "ÿ",
  5744. "Yuml": "Ÿ",
  5745. "Zacute": "Ź",
  5746. "zacute": "ź",
  5747. "Zcaron": "Ž",
  5748. "zcaron": "ž",
  5749. "Zcy": "З",
  5750. "zcy": "з",
  5751. "Zdot": "Ż",
  5752. "zdot": "ż",
  5753. "zeetrf": "ℨ",
  5754. "ZeroWidthSpace": "​",
  5755. "Zeta": "Ζ",
  5756. "zeta": "ζ",
  5757. "zfr": "𝔷",
  5758. "Zfr": "ℨ",
  5759. "ZHcy": "Ж",
  5760. "zhcy": "ж",
  5761. "zigrarr": "⇝",
  5762. "zopf": "𝕫",
  5763. "Zopf": "ℤ",
  5764. "Zscr": "𝒵",
  5765. "zscr": "𝓏",
  5766. "zwj": "‍",
  5767. "zwnj": "‌"
  5768. };
  5769. /***/ }),
  5770. /* 25 */
  5771. /***/ (function(module, exports) {
  5772. // removed by extract-text-webpack-plugin
  5773. /***/ }),
  5774. /* 26 */
  5775. /***/ (function(module, exports) {
  5776. // removed by extract-text-webpack-plugin
  5777. /***/ }),
  5778. /* 27 */
  5779. /***/ (function(module, exports) {
  5780. // removed by extract-text-webpack-plugin
  5781. /***/ }),
  5782. /* 28 */
  5783. /***/ (function(module, exports) {
  5784. // removed by extract-text-webpack-plugin
  5785. /***/ }),
  5786. /* 29 */,
  5787. /* 30 */
  5788. /***/ (function(module, exports, __webpack_require__) {
  5789. "use strict";
  5790. ////////////////////////////////////////////////////////////////////////////////
  5791. // Helpers
  5792. // Merge objects
  5793. //
  5794. function assign(obj /*from1, from2, from3, ...*/) {
  5795. var sources = Array.prototype.slice.call(arguments, 1);
  5796. sources.forEach(function (source) {
  5797. if (!source) { return; }
  5798. Object.keys(source).forEach(function (key) {
  5799. obj[key] = source[key];
  5800. });
  5801. });
  5802. return obj;
  5803. }
  5804. function _class(obj) { return Object.prototype.toString.call(obj); }
  5805. function isString(obj) { return _class(obj) === '[object String]'; }
  5806. function isObject(obj) { return _class(obj) === '[object Object]'; }
  5807. function isRegExp(obj) { return _class(obj) === '[object RegExp]'; }
  5808. function isFunction(obj) { return _class(obj) === '[object Function]'; }
  5809. function escapeRE(str) { return str.replace(/[.?*+^$[\]\\(){}|-]/g, '\\$&'); }
  5810. ////////////////////////////////////////////////////////////////////////////////
  5811. var defaultOptions = {
  5812. fuzzyLink: true,
  5813. fuzzyEmail: true,
  5814. fuzzyIP: false
  5815. };
  5816. function isOptionsObj(obj) {
  5817. return Object.keys(obj || {}).reduce(function (acc, k) {
  5818. return acc || defaultOptions.hasOwnProperty(k);
  5819. }, false);
  5820. }
  5821. var defaultSchemas = {
  5822. 'http:': {
  5823. validate: function (text, pos, self) {
  5824. var tail = text.slice(pos);
  5825. if (!self.re.http) {
  5826. // compile lazily, because "host"-containing variables can change on tlds update.
  5827. self.re.http = new RegExp(
  5828. '^\\/\\/' + self.re.src_auth + self.re.src_host_port_strict + self.re.src_path, 'i'
  5829. );
  5830. }
  5831. if (self.re.http.test(tail)) {
  5832. return tail.match(self.re.http)[0].length;
  5833. }
  5834. return 0;
  5835. }
  5836. },
  5837. 'https:': 'http:',
  5838. 'ftp:': 'http:',
  5839. '//': {
  5840. validate: function (text, pos, self) {
  5841. var tail = text.slice(pos);
  5842. if (!self.re.no_http) {
  5843. // compile lazily, because "host"-containing variables can change on tlds update.
  5844. self.re.no_http = new RegExp(
  5845. '^' +
  5846. self.re.src_auth +
  5847. // Don't allow single-level domains, because of false positives like '//test'
  5848. // with code comments
  5849. '(?:localhost|(?:(?:' + self.re.src_domain + ')\\.)+' + self.re.src_domain_root + ')' +
  5850. self.re.src_port +
  5851. self.re.src_host_terminator +
  5852. self.re.src_path,
  5853. 'i'
  5854. );
  5855. }
  5856. if (self.re.no_http.test(tail)) {
  5857. // should not be `://` & `///`, that protects from errors in protocol name
  5858. if (pos >= 3 && text[pos - 3] === ':') { return 0; }
  5859. if (pos >= 3 && text[pos - 3] === '/') { return 0; }
  5860. return tail.match(self.re.no_http)[0].length;
  5861. }
  5862. return 0;
  5863. }
  5864. },
  5865. 'mailto:': {
  5866. validate: function (text, pos, self) {
  5867. var tail = text.slice(pos);
  5868. if (!self.re.mailto) {
  5869. self.re.mailto = new RegExp(
  5870. '^' + self.re.src_email_name + '@' + self.re.src_host_strict, 'i'
  5871. );
  5872. }
  5873. if (self.re.mailto.test(tail)) {
  5874. return tail.match(self.re.mailto)[0].length;
  5875. }
  5876. return 0;
  5877. }
  5878. }
  5879. };
  5880. /*eslint-disable max-len*/
  5881. // RE pattern for 2-character tlds (autogenerated by ./support/tlds_2char_gen.js)
  5882. var tlds_2ch_src_re = 'a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]';
  5883. // DON'T try to make PRs with changes. Extend TLDs with LinkifyIt.tlds() instead
  5884. var tlds_default = 'biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф'.split('|');
  5885. /*eslint-enable max-len*/
  5886. ////////////////////////////////////////////////////////////////////////////////
  5887. function resetScanCache(self) {
  5888. self.__index__ = -1;
  5889. self.__text_cache__ = '';
  5890. }
  5891. function createValidator(re) {
  5892. return function (text, pos) {
  5893. var tail = text.slice(pos);
  5894. if (re.test(tail)) {
  5895. return tail.match(re)[0].length;
  5896. }
  5897. return 0;
  5898. };
  5899. }
  5900. function createNormalizer() {
  5901. return function (match, self) {
  5902. self.normalize(match);
  5903. };
  5904. }
  5905. // Schemas compiler. Build regexps.
  5906. //
  5907. function compile(self) {
  5908. // Load & clone RE patterns.
  5909. var re = self.re = __webpack_require__(31)(self.__opts__);
  5910. // Define dynamic patterns
  5911. var tlds = self.__tlds__.slice();
  5912. self.onCompile();
  5913. if (!self.__tlds_replaced__) {
  5914. tlds.push(tlds_2ch_src_re);
  5915. }
  5916. tlds.push(re.src_xn);
  5917. re.src_tlds = tlds.join('|');
  5918. function untpl(tpl) { return tpl.replace('%TLDS%', re.src_tlds); }
  5919. re.email_fuzzy = RegExp(untpl(re.tpl_email_fuzzy), 'i');
  5920. re.link_fuzzy = RegExp(untpl(re.tpl_link_fuzzy), 'i');
  5921. re.link_no_ip_fuzzy = RegExp(untpl(re.tpl_link_no_ip_fuzzy), 'i');
  5922. re.host_fuzzy_test = RegExp(untpl(re.tpl_host_fuzzy_test), 'i');
  5923. //
  5924. // Compile each schema
  5925. //
  5926. var aliases = [];
  5927. self.__compiled__ = {}; // Reset compiled data
  5928. function schemaError(name, val) {
  5929. throw new Error('(LinkifyIt) Invalid schema "' + name + '": ' + val);
  5930. }
  5931. Object.keys(self.__schemas__).forEach(function (name) {
  5932. var val = self.__schemas__[name];
  5933. // skip disabled methods
  5934. if (val === null) { return; }
  5935. var compiled = { validate: null, link: null };
  5936. self.__compiled__[name] = compiled;
  5937. if (isObject(val)) {
  5938. if (isRegExp(val.validate)) {
  5939. compiled.validate = createValidator(val.validate);
  5940. } else if (isFunction(val.validate)) {
  5941. compiled.validate = val.validate;
  5942. } else {
  5943. schemaError(name, val);
  5944. }
  5945. if (isFunction(val.normalize)) {
  5946. compiled.normalize = val.normalize;
  5947. } else if (!val.normalize) {
  5948. compiled.normalize = createNormalizer();
  5949. } else {
  5950. schemaError(name, val);
  5951. }
  5952. return;
  5953. }
  5954. if (isString(val)) {
  5955. aliases.push(name);
  5956. return;
  5957. }
  5958. schemaError(name, val);
  5959. });
  5960. //
  5961. // Compile postponed aliases
  5962. //
  5963. aliases.forEach(function (alias) {
  5964. if (!self.__compiled__[self.__schemas__[alias]]) {
  5965. // Silently fail on missed schemas to avoid errons on disable.
  5966. // schemaError(alias, self.__schemas__[alias]);
  5967. return;
  5968. }
  5969. self.__compiled__[alias].validate =
  5970. self.__compiled__[self.__schemas__[alias]].validate;
  5971. self.__compiled__[alias].normalize =
  5972. self.__compiled__[self.__schemas__[alias]].normalize;
  5973. });
  5974. //
  5975. // Fake record for guessed links
  5976. //
  5977. self.__compiled__[''] = { validate: null, normalize: createNormalizer() };
  5978. //
  5979. // Build schema condition
  5980. //
  5981. var slist = Object.keys(self.__compiled__)
  5982. .filter(function (name) {
  5983. // Filter disabled & fake schemas
  5984. return name.length > 0 && self.__compiled__[name];
  5985. })
  5986. .map(escapeRE)
  5987. .join('|');
  5988. // (?!_) cause 1.5x slowdown
  5989. self.re.schema_test = RegExp('(^|(?!_)(?:[><\uff5c]|' + re.src_ZPCc + '))(' + slist + ')', 'i');
  5990. self.re.schema_search = RegExp('(^|(?!_)(?:[><\uff5c]|' + re.src_ZPCc + '))(' + slist + ')', 'ig');
  5991. self.re.pretest = RegExp(
  5992. '(' + self.re.schema_test.source + ')|' +
  5993. '(' + self.re.host_fuzzy_test.source + ')|' +
  5994. '@',
  5995. 'i');
  5996. //
  5997. // Cleanup
  5998. //
  5999. resetScanCache(self);
  6000. }
  6001. /**
  6002. * class Match
  6003. *
  6004. * Match result. Single element of array, returned by [[LinkifyIt#match]]
  6005. **/
  6006. function Match(self, shift) {
  6007. var start = self.__index__,
  6008. end = self.__last_index__,
  6009. text = self.__text_cache__.slice(start, end);
  6010. /**
  6011. * Match#schema -> String
  6012. *
  6013. * Prefix (protocol) for matched string.
  6014. **/
  6015. this.schema = self.__schema__.toLowerCase();
  6016. /**
  6017. * Match#index -> Number
  6018. *
  6019. * First position of matched string.
  6020. **/
  6021. this.index = start + shift;
  6022. /**
  6023. * Match#lastIndex -> Number
  6024. *
  6025. * Next position after matched string.
  6026. **/
  6027. this.lastIndex = end + shift;
  6028. /**
  6029. * Match#raw -> String
  6030. *
  6031. * Matched string.
  6032. **/
  6033. this.raw = text;
  6034. /**
  6035. * Match#text -> String
  6036. *
  6037. * Notmalized text of matched string.
  6038. **/
  6039. this.text = text;
  6040. /**
  6041. * Match#url -> String
  6042. *
  6043. * Normalized url of matched string.
  6044. **/
  6045. this.url = text;
  6046. }
  6047. function createMatch(self, shift) {
  6048. var match = new Match(self, shift);
  6049. self.__compiled__[match.schema].normalize(match, self);
  6050. return match;
  6051. }
  6052. /**
  6053. * class LinkifyIt
  6054. **/
  6055. /**
  6056. * new LinkifyIt(schemas, options)
  6057. * - schemas (Object): Optional. Additional schemas to validate (prefix/validator)
  6058. * - options (Object): { fuzzyLink|fuzzyEmail|fuzzyIP: true|false }
  6059. *
  6060. * Creates new linkifier instance with optional additional schemas.
  6061. * Can be called without `new` keyword for convenience.
  6062. *
  6063. * By default understands:
  6064. *
  6065. * - `http(s)://...` , `ftp://...`, `mailto:...` & `//...` links
  6066. * - "fuzzy" links and emails (example.com, foo@bar.com).
  6067. *
  6068. * `schemas` is an object, where each key/value describes protocol/rule:
  6069. *
  6070. * - __key__ - link prefix (usually, protocol name with `:` at the end, `skype:`
  6071. * for example). `linkify-it` makes shure that prefix is not preceeded with
  6072. * alphanumeric char and symbols. Only whitespaces and punctuation allowed.
  6073. * - __value__ - rule to check tail after link prefix
  6074. * - _String_ - just alias to existing rule
  6075. * - _Object_
  6076. * - _validate_ - validator function (should return matched length on success),
  6077. * or `RegExp`.
  6078. * - _normalize_ - optional function to normalize text & url of matched result
  6079. * (for example, for @twitter mentions).
  6080. *
  6081. * `options`:
  6082. *
  6083. * - __fuzzyLink__ - recognige URL-s without `http(s):` prefix. Default `true`.
  6084. * - __fuzzyIP__ - allow IPs in fuzzy links above. Can conflict with some texts
  6085. * like version numbers. Default `false`.
  6086. * - __fuzzyEmail__ - recognize emails without `mailto:` prefix.
  6087. *
  6088. **/
  6089. function LinkifyIt(schemas, options) {
  6090. if (!(this instanceof LinkifyIt)) {
  6091. return new LinkifyIt(schemas, options);
  6092. }
  6093. if (!options) {
  6094. if (isOptionsObj(schemas)) {
  6095. options = schemas;
  6096. schemas = {};
  6097. }
  6098. }
  6099. this.__opts__ = assign({}, defaultOptions, options);
  6100. // Cache last tested result. Used to skip repeating steps on next `match` call.
  6101. this.__index__ = -1;
  6102. this.__last_index__ = -1; // Next scan position
  6103. this.__schema__ = '';
  6104. this.__text_cache__ = '';
  6105. this.__schemas__ = assign({}, defaultSchemas, schemas);
  6106. this.__compiled__ = {};
  6107. this.__tlds__ = tlds_default;
  6108. this.__tlds_replaced__ = false;
  6109. this.re = {};
  6110. compile(this);
  6111. }
  6112. /** chainable
  6113. * LinkifyIt#add(schema, definition)
  6114. * - schema (String): rule name (fixed pattern prefix)
  6115. * - definition (String|RegExp|Object): schema definition
  6116. *
  6117. * Add new rule definition. See constructor description for details.
  6118. **/
  6119. LinkifyIt.prototype.add = function add(schema, definition) {
  6120. this.__schemas__[schema] = definition;
  6121. compile(this);
  6122. return this;
  6123. };
  6124. /** chainable
  6125. * LinkifyIt#set(options)
  6126. * - options (Object): { fuzzyLink|fuzzyEmail|fuzzyIP: true|false }
  6127. *
  6128. * Set recognition options for links without schema.
  6129. **/
  6130. LinkifyIt.prototype.set = function set(options) {
  6131. this.__opts__ = assign(this.__opts__, options);
  6132. return this;
  6133. };
  6134. /**
  6135. * LinkifyIt#test(text) -> Boolean
  6136. *
  6137. * Searches linkifiable pattern and returns `true` on success or `false` on fail.
  6138. **/
  6139. LinkifyIt.prototype.test = function test(text) {
  6140. // Reset scan cache
  6141. this.__text_cache__ = text;
  6142. this.__index__ = -1;
  6143. if (!text.length) { return false; }
  6144. var m, ml, me, len, shift, next, re, tld_pos, at_pos;
  6145. // try to scan for link with schema - that's the most simple rule
  6146. if (this.re.schema_test.test(text)) {
  6147. re = this.re.schema_search;
  6148. re.lastIndex = 0;
  6149. while ((m = re.exec(text)) !== null) {
  6150. len = this.testSchemaAt(text, m[2], re.lastIndex);
  6151. if (len) {
  6152. this.__schema__ = m[2];
  6153. this.__index__ = m.index + m[1].length;
  6154. this.__last_index__ = m.index + m[0].length + len;
  6155. break;
  6156. }
  6157. }
  6158. }
  6159. if (this.__opts__.fuzzyLink && this.__compiled__['http:']) {
  6160. // guess schemaless links
  6161. tld_pos = text.search(this.re.host_fuzzy_test);
  6162. if (tld_pos >= 0) {
  6163. // if tld is located after found link - no need to check fuzzy pattern
  6164. if (this.__index__ < 0 || tld_pos < this.__index__) {
  6165. if ((ml = text.match(this.__opts__.fuzzyIP ? this.re.link_fuzzy : this.re.link_no_ip_fuzzy)) !== null) {
  6166. shift = ml.index + ml[1].length;
  6167. if (this.__index__ < 0 || shift < this.__index__) {
  6168. this.__schema__ = '';
  6169. this.__index__ = shift;
  6170. this.__last_index__ = ml.index + ml[0].length;
  6171. }
  6172. }
  6173. }
  6174. }
  6175. }
  6176. if (this.__opts__.fuzzyEmail && this.__compiled__['mailto:']) {
  6177. // guess schemaless emails
  6178. at_pos = text.indexOf('@');
  6179. if (at_pos >= 0) {
  6180. // We can't skip this check, because this cases are possible:
  6181. // 192.168.1.1@gmail.com, my.in@example.com
  6182. if ((me = text.match(this.re.email_fuzzy)) !== null) {
  6183. shift = me.index + me[1].length;
  6184. next = me.index + me[0].length;
  6185. if (this.__index__ < 0 || shift < this.__index__ ||
  6186. (shift === this.__index__ && next > this.__last_index__)) {
  6187. this.__schema__ = 'mailto:';
  6188. this.__index__ = shift;
  6189. this.__last_index__ = next;
  6190. }
  6191. }
  6192. }
  6193. }
  6194. return this.__index__ >= 0;
  6195. };
  6196. /**
  6197. * LinkifyIt#pretest(text) -> Boolean
  6198. *
  6199. * Very quick check, that can give false positives. Returns true if link MAY BE
  6200. * can exists. Can be used for speed optimization, when you need to check that
  6201. * link NOT exists.
  6202. **/
  6203. LinkifyIt.prototype.pretest = function pretest(text) {
  6204. return this.re.pretest.test(text);
  6205. };
  6206. /**
  6207. * LinkifyIt#testSchemaAt(text, name, position) -> Number
  6208. * - text (String): text to scan
  6209. * - name (String): rule (schema) name
  6210. * - position (Number): text offset to check from
  6211. *
  6212. * Similar to [[LinkifyIt#test]] but checks only specific protocol tail exactly
  6213. * at given position. Returns length of found pattern (0 on fail).
  6214. **/
  6215. LinkifyIt.prototype.testSchemaAt = function testSchemaAt(text, schema, pos) {
  6216. // If not supported schema check requested - terminate
  6217. if (!this.__compiled__[schema.toLowerCase()]) {
  6218. return 0;
  6219. }
  6220. return this.__compiled__[schema.toLowerCase()].validate(text, pos, this);
  6221. };
  6222. /**
  6223. * LinkifyIt#match(text) -> Array|null
  6224. *
  6225. * Returns array of found link descriptions or `null` on fail. We strongly
  6226. * recommend to use [[LinkifyIt#test]] first, for best speed.
  6227. *
  6228. * ##### Result match description
  6229. *
  6230. * - __schema__ - link schema, can be empty for fuzzy links, or `//` for
  6231. * protocol-neutral links.
  6232. * - __index__ - offset of matched text
  6233. * - __lastIndex__ - index of next char after mathch end
  6234. * - __raw__ - matched text
  6235. * - __text__ - normalized text
  6236. * - __url__ - link, generated from matched text
  6237. **/
  6238. LinkifyIt.prototype.match = function match(text) {
  6239. var shift = 0, result = [];
  6240. // Try to take previous element from cache, if .test() called before
  6241. if (this.__index__ >= 0 && this.__text_cache__ === text) {
  6242. result.push(createMatch(this, shift));
  6243. shift = this.__last_index__;
  6244. }
  6245. // Cut head if cache was used
  6246. var tail = shift ? text.slice(shift) : text;
  6247. // Scan string until end reached
  6248. while (this.test(tail)) {
  6249. result.push(createMatch(this, shift));
  6250. tail = tail.slice(this.__last_index__);
  6251. shift += this.__last_index__;
  6252. }
  6253. if (result.length) {
  6254. return result;
  6255. }
  6256. return null;
  6257. };
  6258. /** chainable
  6259. * LinkifyIt#tlds(list [, keepOld]) -> this
  6260. * - list (Array): list of tlds
  6261. * - keepOld (Boolean): merge with current list if `true` (`false` by default)
  6262. *
  6263. * Load (or merge) new tlds list. Those are user for fuzzy links (without prefix)
  6264. * to avoid false positives. By default this algorythm used:
  6265. *
  6266. * - hostname with any 2-letter root zones are ok.
  6267. * - biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф
  6268. * are ok.
  6269. * - encoded (`xn--...`) root zones are ok.
  6270. *
  6271. * If list is replaced, then exact match for 2-chars root zones will be checked.
  6272. **/
  6273. LinkifyIt.prototype.tlds = function tlds(list, keepOld) {
  6274. list = Array.isArray(list) ? list : [ list ];
  6275. if (!keepOld) {
  6276. this.__tlds__ = list.slice();
  6277. this.__tlds_replaced__ = true;
  6278. compile(this);
  6279. return this;
  6280. }
  6281. this.__tlds__ = this.__tlds__.concat(list)
  6282. .sort()
  6283. .filter(function (el, idx, arr) {
  6284. return el !== arr[idx - 1];
  6285. })
  6286. .reverse();
  6287. compile(this);
  6288. return this;
  6289. };
  6290. /**
  6291. * LinkifyIt#normalize(match)
  6292. *
  6293. * Default normalizer (if schema does not define it's own).
  6294. **/
  6295. LinkifyIt.prototype.normalize = function normalize(match) {
  6296. // Do minimal possible changes by default. Need to collect feedback prior
  6297. // to move forward https://github.com/markdown-it/linkify-it/issues/1
  6298. if (!match.schema) { match.url = 'http://' + match.url; }
  6299. if (match.schema === 'mailto:' && !/^mailto:/i.test(match.url)) {
  6300. match.url = 'mailto:' + match.url;
  6301. }
  6302. };
  6303. /**
  6304. * LinkifyIt#onCompile()
  6305. *
  6306. * Override to modify basic RegExp-s.
  6307. **/
  6308. LinkifyIt.prototype.onCompile = function onCompile() {
  6309. };
  6310. module.exports = LinkifyIt;
  6311. /***/ }),
  6312. /* 31 */
  6313. /***/ (function(module, exports, __webpack_require__) {
  6314. "use strict";
  6315. module.exports = function (opts) {
  6316. var re = {};
  6317. // Use direct extract instead of `regenerate` to reduse browserified size
  6318. re.src_Any = __webpack_require__(18).source;
  6319. re.src_Cc = __webpack_require__(16).source;
  6320. re.src_Z = __webpack_require__(17).source;
  6321. re.src_P = __webpack_require__(5).source;
  6322. // \p{\Z\P\Cc\CF} (white spaces + control + format + punctuation)
  6323. re.src_ZPCc = [ re.src_Z, re.src_P, re.src_Cc ].join('|');
  6324. // \p{\Z\Cc} (white spaces + control)
  6325. re.src_ZCc = [ re.src_Z, re.src_Cc ].join('|');
  6326. // Experimental. List of chars, completely prohibited in links
  6327. // because can separate it from other part of text
  6328. var text_separators = '[><\uff5c]';
  6329. // All possible word characters (everything without punctuation, spaces & controls)
  6330. // Defined via punctuation & spaces to save space
  6331. // Should be something like \p{\L\N\S\M} (\w but without `_`)
  6332. re.src_pseudo_letter = '(?:(?!' + text_separators + '|' + re.src_ZPCc + ')' + re.src_Any + ')';
  6333. // The same as abothe but without [0-9]
  6334. // var src_pseudo_letter_non_d = '(?:(?![0-9]|' + src_ZPCc + ')' + src_Any + ')';
  6335. ////////////////////////////////////////////////////////////////////////////////
  6336. re.src_ip4 =
  6337. '(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)';
  6338. // Prohibit any of "@/[]()" in user/pass to avoid wrong domain fetch.
  6339. re.src_auth = '(?:(?:(?!' + re.src_ZCc + '|[@/\\[\\]()]).)+@)?';
  6340. re.src_port =
  6341. '(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?';
  6342. re.src_host_terminator =
  6343. '(?=$|' + text_separators + '|' + re.src_ZPCc + ')(?!-|_|:\\d|\\.-|\\.(?!$|' + re.src_ZPCc + '))';
  6344. re.src_path =
  6345. '(?:' +
  6346. '[/?#]' +
  6347. '(?:' +
  6348. '(?!' + re.src_ZCc + '|' + text_separators + '|[()[\\]{}.,"\'?!\\-]).|' +
  6349. '\\[(?:(?!' + re.src_ZCc + '|\\]).)*\\]|' +
  6350. '\\((?:(?!' + re.src_ZCc + '|[)]).)*\\)|' +
  6351. '\\{(?:(?!' + re.src_ZCc + '|[}]).)*\\}|' +
  6352. '\\"(?:(?!' + re.src_ZCc + '|["]).)+\\"|' +
  6353. "\\'(?:(?!" + re.src_ZCc + "|[']).)+\\'|" +
  6354. "\\'(?=" + re.src_pseudo_letter + '|[-]).|' + // allow `I'm_king` if no pair found
  6355. '\\.{2,3}[a-zA-Z0-9%/]|' + // github has ... in commit range links. Restrict to
  6356. // - english
  6357. // - percent-encoded
  6358. // - parts of file path
  6359. // until more examples found.
  6360. '\\.(?!' + re.src_ZCc + '|[.]).|' +
  6361. (opts && opts['---'] ?
  6362. '\\-(?!--(?:[^-]|$))(?:-*)|' // `---` => long dash, terminate
  6363. :
  6364. '\\-+|'
  6365. ) +
  6366. '\\,(?!' + re.src_ZCc + ').|' + // allow `,,,` in paths
  6367. '\\!(?!' + re.src_ZCc + '|[!]).|' +
  6368. '\\?(?!' + re.src_ZCc + '|[?]).' +
  6369. ')+' +
  6370. '|\\/' +
  6371. ')?';
  6372. re.src_email_name =
  6373. '[\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]+';
  6374. re.src_xn =
  6375. 'xn--[a-z0-9\\-]{1,59}';
  6376. // More to read about domain names
  6377. // http://serverfault.com/questions/638260/
  6378. re.src_domain_root =
  6379. // Allow letters & digits (http://test1)
  6380. '(?:' +
  6381. re.src_xn +
  6382. '|' +
  6383. re.src_pseudo_letter + '{1,63}' +
  6384. ')';
  6385. re.src_domain =
  6386. '(?:' +
  6387. re.src_xn +
  6388. '|' +
  6389. '(?:' + re.src_pseudo_letter + ')' +
  6390. '|' +
  6391. // don't allow `--` in domain names, because:
  6392. // - that can conflict with markdown &mdash; / &ndash;
  6393. // - nobody use those anyway
  6394. '(?:' + re.src_pseudo_letter + '(?:-(?!-)|' + re.src_pseudo_letter + '){0,61}' + re.src_pseudo_letter + ')' +
  6395. ')';
  6396. re.src_host =
  6397. '(?:' +
  6398. // Don't need IP check, because digits are already allowed in normal domain names
  6399. // src_ip4 +
  6400. // '|' +
  6401. '(?:(?:(?:' + re.src_domain + ')\\.)*' + re.src_domain/*_root*/ + ')' +
  6402. ')';
  6403. re.tpl_host_fuzzy =
  6404. '(?:' +
  6405. re.src_ip4 +
  6406. '|' +
  6407. '(?:(?:(?:' + re.src_domain + ')\\.)+(?:%TLDS%))' +
  6408. ')';
  6409. re.tpl_host_no_ip_fuzzy =
  6410. '(?:(?:(?:' + re.src_domain + ')\\.)+(?:%TLDS%))';
  6411. re.src_host_strict =
  6412. re.src_host + re.src_host_terminator;
  6413. re.tpl_host_fuzzy_strict =
  6414. re.tpl_host_fuzzy + re.src_host_terminator;
  6415. re.src_host_port_strict =
  6416. re.src_host + re.src_port + re.src_host_terminator;
  6417. re.tpl_host_port_fuzzy_strict =
  6418. re.tpl_host_fuzzy + re.src_port + re.src_host_terminator;
  6419. re.tpl_host_port_no_ip_fuzzy_strict =
  6420. re.tpl_host_no_ip_fuzzy + re.src_port + re.src_host_terminator;
  6421. ////////////////////////////////////////////////////////////////////////////////
  6422. // Main rules
  6423. // Rude test fuzzy links by host, for quick deny
  6424. re.tpl_host_fuzzy_test =
  6425. 'localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:' + re.src_ZPCc + '|>|$))';
  6426. re.tpl_email_fuzzy =
  6427. '(^|' + text_separators + '|\\(|' + re.src_ZCc + ')(' + re.src_email_name + '@' + re.tpl_host_fuzzy_strict + ')';
  6428. re.tpl_link_fuzzy =
  6429. // Fuzzy link can't be prepended with .:/\- and non punctuation.
  6430. // but can start with > (markdown blockquote)
  6431. '(^|(?![.:/\\-_@])(?:[$+<=>^`|\uff5c]|' + re.src_ZPCc + '))' +
  6432. '((?![$+<=>^`|\uff5c])' + re.tpl_host_port_fuzzy_strict + re.src_path + ')';
  6433. re.tpl_link_no_ip_fuzzy =
  6434. // Fuzzy link can't be prepended with .:/\- and non punctuation.
  6435. // but can start with > (markdown blockquote)
  6436. '(^|(?![.:/\\-_@])(?:[$+<=>^`|\uff5c]|' + re.src_ZPCc + '))' +
  6437. '((?![$+<=>^`|\uff5c])' + re.tpl_host_port_no_ip_fuzzy_strict + re.src_path + ')';
  6438. return re;
  6439. };
  6440. /***/ }),
  6441. /* 32 */
  6442. /***/ (function(module, exports, __webpack_require__) {
  6443. "use strict";
  6444. // List of valid html blocks names, accorting to commonmark spec
  6445. // http://jgm.github.io/CommonMark/spec.html#html-blocks
  6446. module.exports = [
  6447. 'address',
  6448. 'article',
  6449. 'aside',
  6450. 'base',
  6451. 'basefont',
  6452. 'blockquote',
  6453. 'body',
  6454. 'caption',
  6455. 'center',
  6456. 'col',
  6457. 'colgroup',
  6458. 'dd',
  6459. 'details',
  6460. 'dialog',
  6461. 'dir',
  6462. 'div',
  6463. 'dl',
  6464. 'dt',
  6465. 'fieldset',
  6466. 'figcaption',
  6467. 'figure',
  6468. 'footer',
  6469. 'form',
  6470. 'frame',
  6471. 'frameset',
  6472. 'h1',
  6473. 'h2',
  6474. 'h3',
  6475. 'h4',
  6476. 'h5',
  6477. 'h6',
  6478. 'head',
  6479. 'header',
  6480. 'hr',
  6481. 'html',
  6482. 'iframe',
  6483. 'legend',
  6484. 'li',
  6485. 'link',
  6486. 'main',
  6487. 'menu',
  6488. 'menuitem',
  6489. 'meta',
  6490. 'nav',
  6491. 'noframes',
  6492. 'ol',
  6493. 'optgroup',
  6494. 'option',
  6495. 'p',
  6496. 'param',
  6497. 'pre',
  6498. 'section',
  6499. 'source',
  6500. 'title',
  6501. 'summary',
  6502. 'table',
  6503. 'tbody',
  6504. 'td',
  6505. 'tfoot',
  6506. 'th',
  6507. 'thead',
  6508. 'title',
  6509. 'tr',
  6510. 'track',
  6511. 'ul'
  6512. ];
  6513. /***/ }),
  6514. /* 33 */
  6515. /***/ (function(module, exports, __webpack_require__) {
  6516. "use strict";
  6517. // Just a shortcut for bulk export
  6518. exports.parseLinkLabel = __webpack_require__(35);
  6519. exports.parseLinkDestination = __webpack_require__(34);
  6520. exports.parseLinkTitle = __webpack_require__(36);
  6521. /***/ }),
  6522. /* 34 */
  6523. /***/ (function(module, exports, __webpack_require__) {
  6524. "use strict";
  6525. // Parse link destination
  6526. //
  6527. var isSpace = __webpack_require__(0).isSpace;
  6528. var unescapeAll = __webpack_require__(0).unescapeAll;
  6529. module.exports = function parseLinkDestination(str, pos, max) {
  6530. var code, level,
  6531. lines = 0,
  6532. start = pos,
  6533. result = {
  6534. ok: false,
  6535. pos: 0,
  6536. lines: 0,
  6537. str: ''
  6538. };
  6539. if (str.charCodeAt(pos) === 0x3C /* < */) {
  6540. pos++;
  6541. while (pos < max) {
  6542. code = str.charCodeAt(pos);
  6543. if (code === 0x0A /* \n */ || isSpace(code)) { return result; }
  6544. if (code === 0x3E /* > */) {
  6545. result.pos = pos + 1;
  6546. result.str = unescapeAll(str.slice(start + 1, pos));
  6547. result.ok = true;
  6548. return result;
  6549. }
  6550. if (code === 0x5C /* \ */ && pos + 1 < max) {
  6551. pos += 2;
  6552. continue;
  6553. }
  6554. pos++;
  6555. }
  6556. // no closing '>'
  6557. return result;
  6558. }
  6559. // this should be ... } else { ... branch
  6560. level = 0;
  6561. while (pos < max) {
  6562. code = str.charCodeAt(pos);
  6563. if (code === 0x20) { break; }
  6564. // ascii control characters
  6565. if (code < 0x20 || code === 0x7F) { break; }
  6566. if (code === 0x5C /* \ */ && pos + 1 < max) {
  6567. pos += 2;
  6568. continue;
  6569. }
  6570. if (code === 0x28 /* ( */) {
  6571. level++;
  6572. if (level > 1) { break; }
  6573. }
  6574. if (code === 0x29 /* ) */) {
  6575. level--;
  6576. if (level < 0) { break; }
  6577. }
  6578. pos++;
  6579. }
  6580. if (start === pos) { return result; }
  6581. result.str = unescapeAll(str.slice(start, pos));
  6582. result.lines = lines;
  6583. result.pos = pos;
  6584. result.ok = true;
  6585. return result;
  6586. };
  6587. /***/ }),
  6588. /* 35 */
  6589. /***/ (function(module, exports, __webpack_require__) {
  6590. "use strict";
  6591. // Parse link label
  6592. //
  6593. // this function assumes that first character ("[") already matches;
  6594. // returns the end of the label
  6595. //
  6596. module.exports = function parseLinkLabel(state, start, disableNested) {
  6597. var level, found, marker, prevPos,
  6598. labelEnd = -1,
  6599. max = state.posMax,
  6600. oldPos = state.pos;
  6601. state.pos = start + 1;
  6602. level = 1;
  6603. while (state.pos < max) {
  6604. marker = state.src.charCodeAt(state.pos);
  6605. if (marker === 0x5D /* ] */) {
  6606. level--;
  6607. if (level === 0) {
  6608. found = true;
  6609. break;
  6610. }
  6611. }
  6612. prevPos = state.pos;
  6613. state.md.inline.skipToken(state);
  6614. if (marker === 0x5B /* [ */) {
  6615. if (prevPos === state.pos - 1) {
  6616. // increase level if we find text `[`, which is not a part of any token
  6617. level++;
  6618. } else if (disableNested) {
  6619. state.pos = oldPos;
  6620. return -1;
  6621. }
  6622. }
  6623. }
  6624. if (found) {
  6625. labelEnd = state.pos;
  6626. }
  6627. // restore old state
  6628. state.pos = oldPos;
  6629. return labelEnd;
  6630. };
  6631. /***/ }),
  6632. /* 36 */
  6633. /***/ (function(module, exports, __webpack_require__) {
  6634. "use strict";
  6635. // Parse link title
  6636. //
  6637. var unescapeAll = __webpack_require__(0).unescapeAll;
  6638. module.exports = function parseLinkTitle(str, pos, max) {
  6639. var code,
  6640. marker,
  6641. lines = 0,
  6642. start = pos,
  6643. result = {
  6644. ok: false,
  6645. pos: 0,
  6646. lines: 0,
  6647. str: ''
  6648. };
  6649. if (pos >= max) { return result; }
  6650. marker = str.charCodeAt(pos);
  6651. if (marker !== 0x22 /* " */ && marker !== 0x27 /* ' */ && marker !== 0x28 /* ( */) { return result; }
  6652. pos++;
  6653. // if opening marker is "(", switch it to closing marker ")"
  6654. if (marker === 0x28) { marker = 0x29; }
  6655. while (pos < max) {
  6656. code = str.charCodeAt(pos);
  6657. if (code === marker) {
  6658. result.pos = pos + 1;
  6659. result.lines = lines;
  6660. result.str = unescapeAll(str.slice(start + 1, pos));
  6661. result.ok = true;
  6662. return result;
  6663. } else if (code === 0x0A) {
  6664. lines++;
  6665. } else if (code === 0x5C /* \ */ && pos + 1 < max) {
  6666. pos++;
  6667. if (str.charCodeAt(pos) === 0x0A) {
  6668. lines++;
  6669. }
  6670. }
  6671. pos++;
  6672. }
  6673. return result;
  6674. };
  6675. /***/ }),
  6676. /* 37 */
  6677. /***/ (function(module, exports, __webpack_require__) {
  6678. "use strict";
  6679. // Main parser class
  6680. var utils = __webpack_require__(0);
  6681. var helpers = __webpack_require__(33);
  6682. var Renderer = __webpack_require__(44);
  6683. var ParserCore = __webpack_require__(39);
  6684. var ParserBlock = __webpack_require__(38);
  6685. var ParserInline = __webpack_require__(40);
  6686. var LinkifyIt = __webpack_require__(30);
  6687. var mdurl = __webpack_require__(15);
  6688. var punycode = __webpack_require__(81);
  6689. var config = {
  6690. 'default': __webpack_require__(42),
  6691. zero: __webpack_require__(43),
  6692. commonmark: __webpack_require__(41)
  6693. };
  6694. ////////////////////////////////////////////////////////////////////////////////
  6695. //
  6696. // This validator can prohibit more than really needed to prevent XSS. It's a
  6697. // tradeoff to keep code simple and to be secure by default.
  6698. //
  6699. // If you need different setup - override validator method as you wish. Or
  6700. // replace it with dummy function and use external sanitizer.
  6701. //
  6702. var BAD_PROTO_RE = /^(vbscript|javascript|file|data):/;
  6703. var GOOD_DATA_RE = /^data:image\/(gif|png|jpeg|webp);/;
  6704. function validateLink(url) {
  6705. // url should be normalized at this point, and existing entities are decoded
  6706. var str = url.trim().toLowerCase();
  6707. return BAD_PROTO_RE.test(str) ? (GOOD_DATA_RE.test(str) ? true : false) : true;
  6708. }
  6709. ////////////////////////////////////////////////////////////////////////////////
  6710. var RECODE_HOSTNAME_FOR = [ 'http:', 'https:', 'mailto:' ];
  6711. function normalizeLink(url) {
  6712. var parsed = mdurl.parse(url, true);
  6713. if (parsed.hostname) {
  6714. // Encode hostnames in urls like:
  6715. // `http://host/`, `https://host/`, `mailto:user@host`, `//host/`
  6716. //
  6717. // We don't encode unknown schemas, because it's likely that we encode
  6718. // something we shouldn't (e.g. `skype:name` treated as `skype:host`)
  6719. //
  6720. if (!parsed.protocol || RECODE_HOSTNAME_FOR.indexOf(parsed.protocol) >= 0) {
  6721. try {
  6722. parsed.hostname = punycode.toASCII(parsed.hostname);
  6723. } catch (er) { /**/ }
  6724. }
  6725. }
  6726. return mdurl.encode(mdurl.format(parsed));
  6727. }
  6728. function normalizeLinkText(url) {
  6729. var parsed = mdurl.parse(url, true);
  6730. if (parsed.hostname) {
  6731. // Encode hostnames in urls like:
  6732. // `http://host/`, `https://host/`, `mailto:user@host`, `//host/`
  6733. //
  6734. // We don't encode unknown schemas, because it's likely that we encode
  6735. // something we shouldn't (e.g. `skype:name` treated as `skype:host`)
  6736. //
  6737. if (!parsed.protocol || RECODE_HOSTNAME_FOR.indexOf(parsed.protocol) >= 0) {
  6738. try {
  6739. parsed.hostname = punycode.toUnicode(parsed.hostname);
  6740. } catch (er) { /**/ }
  6741. }
  6742. }
  6743. return mdurl.decode(mdurl.format(parsed));
  6744. }
  6745. /**
  6746. * class MarkdownIt
  6747. *
  6748. * Main parser/renderer class.
  6749. *
  6750. * ##### Usage
  6751. *
  6752. * ```javascript
  6753. * // node.js, "classic" way:
  6754. * var MarkdownIt = require('markdown-it'),
  6755. * md = new MarkdownIt();
  6756. * var result = md.render('# markdown-it rulezz!');
  6757. *
  6758. * // node.js, the same, but with sugar:
  6759. * var md = require('markdown-it')();
  6760. * var result = md.render('# markdown-it rulezz!');
  6761. *
  6762. * // browser without AMD, added to "window" on script load
  6763. * // Note, there are no dash.
  6764. * var md = window.markdownit();
  6765. * var result = md.render('# markdown-it rulezz!');
  6766. * ```
  6767. *
  6768. * Single line rendering, without paragraph wrap:
  6769. *
  6770. * ```javascript
  6771. * var md = require('markdown-it')();
  6772. * var result = md.renderInline('__markdown-it__ rulezz!');
  6773. * ```
  6774. **/
  6775. /**
  6776. * new MarkdownIt([presetName, options])
  6777. * - presetName (String): optional, `commonmark` / `zero`
  6778. * - options (Object)
  6779. *
  6780. * Creates parser instanse with given config. Can be called without `new`.
  6781. *
  6782. * ##### presetName
  6783. *
  6784. * MarkdownIt provides named presets as a convenience to quickly
  6785. * enable/disable active syntax rules and options for common use cases.
  6786. *
  6787. * - ["commonmark"](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/commonmark.js) -
  6788. * configures parser to strict [CommonMark](http://commonmark.org/) mode.
  6789. * - [default](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/default.js) -
  6790. * similar to GFM, used when no preset name given. Enables all available rules,
  6791. * but still without html, typographer & autolinker.
  6792. * - ["zero"](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/zero.js) -
  6793. * all rules disabled. Useful to quickly setup your config via `.enable()`.
  6794. * For example, when you need only `bold` and `italic` markup and nothing else.
  6795. *
  6796. * ##### options:
  6797. *
  6798. * - __html__ - `false`. Set `true` to enable HTML tags in source. Be careful!
  6799. * That's not safe! You may need external sanitizer to protect output from XSS.
  6800. * It's better to extend features via plugins, instead of enabling HTML.
  6801. * - __xhtmlOut__ - `false`. Set `true` to add '/' when closing single tags
  6802. * (`<br />`). This is needed only for full CommonMark compatibility. In real
  6803. * world you will need HTML output.
  6804. * - __breaks__ - `false`. Set `true` to convert `\n` in paragraphs into `<br>`.
  6805. * - __langPrefix__ - `language-`. CSS language class prefix for fenced blocks.
  6806. * Can be useful for external highlighters.
  6807. * - __linkify__ - `false`. Set `true` to autoconvert URL-like text to links.
  6808. * - __typographer__ - `false`. Set `true` to enable [some language-neutral
  6809. * replacement](https://github.com/markdown-it/markdown-it/blob/master/lib/rules_core/replacements.js) +
  6810. * quotes beautification (smartquotes).
  6811. * - __quotes__ - `“”‘’`, String or Array. Double + single quotes replacement
  6812. * pairs, when typographer enabled and smartquotes on. For example, you can
  6813. * use `'«»„“'` for Russian, `'„“‚‘'` for German, and
  6814. * `['«\xA0', '\xA0»', '‹\xA0', '\xA0›']` for French (including nbsp).
  6815. * - __highlight__ - `null`. Highlighter function for fenced code blocks.
  6816. * Highlighter `function (str, lang)` should return escaped HTML. It can also
  6817. * return empty string if the source was not changed and should be escaped
  6818. * externaly. If result starts with <pre... internal wrapper is skipped.
  6819. *
  6820. * ##### Example
  6821. *
  6822. * ```javascript
  6823. * // commonmark mode
  6824. * var md = require('markdown-it')('commonmark');
  6825. *
  6826. * // default mode
  6827. * var md = require('markdown-it')();
  6828. *
  6829. * // enable everything
  6830. * var md = require('markdown-it')({
  6831. * html: true,
  6832. * linkify: true,
  6833. * typographer: true
  6834. * });
  6835. * ```
  6836. *
  6837. * ##### Syntax highlighting
  6838. *
  6839. * ```js
  6840. * var hljs = require('highlight.js') // https://highlightjs.org/
  6841. *
  6842. * var md = require('markdown-it')({
  6843. * highlight: function (str, lang) {
  6844. * if (lang && hljs.getLanguage(lang)) {
  6845. * try {
  6846. * return hljs.highlight(lang, str, true).value;
  6847. * } catch (__) {}
  6848. * }
  6849. *
  6850. * return ''; // use external default escaping
  6851. * }
  6852. * });
  6853. * ```
  6854. *
  6855. * Or with full wrapper override (if you need assign class to `<pre>`):
  6856. *
  6857. * ```javascript
  6858. * var hljs = require('highlight.js') // https://highlightjs.org/
  6859. *
  6860. * // Actual default values
  6861. * var md = require('markdown-it')({
  6862. * highlight: function (str, lang) {
  6863. * if (lang && hljs.getLanguage(lang)) {
  6864. * try {
  6865. * return '<pre class="hljs"><code>' +
  6866. * hljs.highlight(lang, str, true).value +
  6867. * '</code></pre>';
  6868. * } catch (__) {}
  6869. * }
  6870. *
  6871. * return '<pre class="hljs"><code>' + md.utils.escapeHtml(str) + '</code></pre>';
  6872. * }
  6873. * });
  6874. * ```
  6875. *
  6876. **/
  6877. function MarkdownIt(presetName, options) {
  6878. if (!(this instanceof MarkdownIt)) {
  6879. return new MarkdownIt(presetName, options);
  6880. }
  6881. if (!options) {
  6882. if (!utils.isString(presetName)) {
  6883. options = presetName || {};
  6884. presetName = 'default';
  6885. }
  6886. }
  6887. /**
  6888. * MarkdownIt#inline -> ParserInline
  6889. *
  6890. * Instance of [[ParserInline]]. You may need it to add new rules when
  6891. * writing plugins. For simple rules control use [[MarkdownIt.disable]] and
  6892. * [[MarkdownIt.enable]].
  6893. **/
  6894. this.inline = new ParserInline();
  6895. /**
  6896. * MarkdownIt#block -> ParserBlock
  6897. *
  6898. * Instance of [[ParserBlock]]. You may need it to add new rules when
  6899. * writing plugins. For simple rules control use [[MarkdownIt.disable]] and
  6900. * [[MarkdownIt.enable]].
  6901. **/
  6902. this.block = new ParserBlock();
  6903. /**
  6904. * MarkdownIt#core -> Core
  6905. *
  6906. * Instance of [[Core]] chain executor. You may need it to add new rules when
  6907. * writing plugins. For simple rules control use [[MarkdownIt.disable]] and
  6908. * [[MarkdownIt.enable]].
  6909. **/
  6910. this.core = new ParserCore();
  6911. /**
  6912. * MarkdownIt#renderer -> Renderer
  6913. *
  6914. * Instance of [[Renderer]]. Use it to modify output look. Or to add rendering
  6915. * rules for new token types, generated by plugins.
  6916. *
  6917. * ##### Example
  6918. *
  6919. * ```javascript
  6920. * var md = require('markdown-it')();
  6921. *
  6922. * function myToken(tokens, idx, options, env, self) {
  6923. * //...
  6924. * return result;
  6925. * };
  6926. *
  6927. * md.renderer.rules['my_token'] = myToken
  6928. * ```
  6929. *
  6930. * See [[Renderer]] docs and [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.js).
  6931. **/
  6932. this.renderer = new Renderer();
  6933. /**
  6934. * MarkdownIt#linkify -> LinkifyIt
  6935. *
  6936. * [linkify-it](https://github.com/markdown-it/linkify-it) instance.
  6937. * Used by [linkify](https://github.com/markdown-it/markdown-it/blob/master/lib/rules_core/linkify.js)
  6938. * rule.
  6939. **/
  6940. this.linkify = new LinkifyIt();
  6941. /**
  6942. * MarkdownIt#validateLink(url) -> Boolean
  6943. *
  6944. * Link validation function. CommonMark allows too much in links. By default
  6945. * we disable `javascript:`, `vbscript:`, `file:` schemas, and almost all `data:...` schemas
  6946. * except some embedded image types.
  6947. *
  6948. * You can change this behaviour:
  6949. *
  6950. * ```javascript
  6951. * var md = require('markdown-it')();
  6952. * // enable everything
  6953. * md.validateLink = function () { return true; }
  6954. * ```
  6955. **/
  6956. this.validateLink = validateLink;
  6957. /**
  6958. * MarkdownIt#normalizeLink(url) -> String
  6959. *
  6960. * Function used to encode link url to a machine-readable format,
  6961. * which includes url-encoding, punycode, etc.
  6962. **/
  6963. this.normalizeLink = normalizeLink;
  6964. /**
  6965. * MarkdownIt#normalizeLinkText(url) -> String
  6966. *
  6967. * Function used to decode link url to a human-readable format`
  6968. **/
  6969. this.normalizeLinkText = normalizeLinkText;
  6970. // Expose utils & helpers for easy acces from plugins
  6971. /**
  6972. * MarkdownIt#utils -> utils
  6973. *
  6974. * Assorted utility functions, useful to write plugins. See details
  6975. * [here](https://github.com/markdown-it/markdown-it/blob/master/lib/common/utils.js).
  6976. **/
  6977. this.utils = utils;
  6978. /**
  6979. * MarkdownIt#helpers -> helpers
  6980. *
  6981. * Link components parser functions, useful to write plugins. See details
  6982. * [here](https://github.com/markdown-it/markdown-it/blob/master/lib/helpers).
  6983. **/
  6984. this.helpers = utils.assign({}, helpers);
  6985. this.options = {};
  6986. this.configure(presetName);
  6987. if (options) { this.set(options); }
  6988. }
  6989. /** chainable
  6990. * MarkdownIt.set(options)
  6991. *
  6992. * Set parser options (in the same format as in constructor). Probably, you
  6993. * will never need it, but you can change options after constructor call.
  6994. *
  6995. * ##### Example
  6996. *
  6997. * ```javascript
  6998. * var md = require('markdown-it')()
  6999. * .set({ html: true, breaks: true })
  7000. * .set({ typographer, true });
  7001. * ```
  7002. *
  7003. * __Note:__ To achieve the best possible performance, don't modify a
  7004. * `markdown-it` instance options on the fly. If you need multiple configurations
  7005. * it's best to create multiple instances and initialize each with separate
  7006. * config.
  7007. **/
  7008. MarkdownIt.prototype.set = function (options) {
  7009. utils.assign(this.options, options);
  7010. return this;
  7011. };
  7012. /** chainable, internal
  7013. * MarkdownIt.configure(presets)
  7014. *
  7015. * Batch load of all options and compenent settings. This is internal method,
  7016. * and you probably will not need it. But if you with - see available presets
  7017. * and data structure [here](https://github.com/markdown-it/markdown-it/tree/master/lib/presets)
  7018. *
  7019. * We strongly recommend to use presets instead of direct config loads. That
  7020. * will give better compatibility with next versions.
  7021. **/
  7022. MarkdownIt.prototype.configure = function (presets) {
  7023. var self = this, presetName;
  7024. if (utils.isString(presets)) {
  7025. presetName = presets;
  7026. presets = config[presetName];
  7027. if (!presets) { throw new Error('Wrong `markdown-it` preset "' + presetName + '", check name'); }
  7028. }
  7029. if (!presets) { throw new Error('Wrong `markdown-it` preset, can\'t be empty'); }
  7030. if (presets.options) { self.set(presets.options); }
  7031. if (presets.components) {
  7032. Object.keys(presets.components).forEach(function (name) {
  7033. if (presets.components[name].rules) {
  7034. self[name].ruler.enableOnly(presets.components[name].rules);
  7035. }
  7036. if (presets.components[name].rules2) {
  7037. self[name].ruler2.enableOnly(presets.components[name].rules2);
  7038. }
  7039. });
  7040. }
  7041. return this;
  7042. };
  7043. /** chainable
  7044. * MarkdownIt.enable(list, ignoreInvalid)
  7045. * - list (String|Array): rule name or list of rule names to enable
  7046. * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found.
  7047. *
  7048. * Enable list or rules. It will automatically find appropriate components,
  7049. * containing rules with given names. If rule not found, and `ignoreInvalid`
  7050. * not set - throws exception.
  7051. *
  7052. * ##### Example
  7053. *
  7054. * ```javascript
  7055. * var md = require('markdown-it')()
  7056. * .enable(['sub', 'sup'])
  7057. * .disable('smartquotes');
  7058. * ```
  7059. **/
  7060. MarkdownIt.prototype.enable = function (list, ignoreInvalid) {
  7061. var result = [];
  7062. if (!Array.isArray(list)) { list = [ list ]; }
  7063. [ 'core', 'block', 'inline' ].forEach(function (chain) {
  7064. result = result.concat(this[chain].ruler.enable(list, true));
  7065. }, this);
  7066. result = result.concat(this.inline.ruler2.enable(list, true));
  7067. var missed = list.filter(function (name) { return result.indexOf(name) < 0; });
  7068. if (missed.length && !ignoreInvalid) {
  7069. throw new Error('MarkdownIt. Failed to enable unknown rule(s): ' + missed);
  7070. }
  7071. return this;
  7072. };
  7073. /** chainable
  7074. * MarkdownIt.disable(list, ignoreInvalid)
  7075. * - list (String|Array): rule name or list of rule names to disable.
  7076. * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found.
  7077. *
  7078. * The same as [[MarkdownIt.enable]], but turn specified rules off.
  7079. **/
  7080. MarkdownIt.prototype.disable = function (list, ignoreInvalid) {
  7081. var result = [];
  7082. if (!Array.isArray(list)) { list = [ list ]; }
  7083. [ 'core', 'block', 'inline' ].forEach(function (chain) {
  7084. result = result.concat(this[chain].ruler.disable(list, true));
  7085. }, this);
  7086. result = result.concat(this.inline.ruler2.disable(list, true));
  7087. var missed = list.filter(function (name) { return result.indexOf(name) < 0; });
  7088. if (missed.length && !ignoreInvalid) {
  7089. throw new Error('MarkdownIt. Failed to disable unknown rule(s): ' + missed);
  7090. }
  7091. return this;
  7092. };
  7093. /** chainable
  7094. * MarkdownIt.use(plugin, params)
  7095. *
  7096. * Load specified plugin with given params into current parser instance.
  7097. * It's just a sugar to call `plugin(md, params)` with curring.
  7098. *
  7099. * ##### Example
  7100. *
  7101. * ```javascript
  7102. * var iterator = require('markdown-it-for-inline');
  7103. * var md = require('markdown-it')()
  7104. * .use(iterator, 'foo_replace', 'text', function (tokens, idx) {
  7105. * tokens[idx].content = tokens[idx].content.replace(/foo/g, 'bar');
  7106. * });
  7107. * ```
  7108. **/
  7109. MarkdownIt.prototype.use = function (plugin /*, params, ... */) {
  7110. var args = [ this ].concat(Array.prototype.slice.call(arguments, 1));
  7111. plugin.apply(plugin, args);
  7112. return this;
  7113. };
  7114. /** internal
  7115. * MarkdownIt.parse(src, env) -> Array
  7116. * - src (String): source string
  7117. * - env (Object): environment sandbox
  7118. *
  7119. * Parse input string and returns list of block tokens (special token type
  7120. * "inline" will contain list of inline tokens). You should not call this
  7121. * method directly, until you write custom renderer (for example, to produce
  7122. * AST).
  7123. *
  7124. * `env` is used to pass data between "distributed" rules and return additional
  7125. * metadata like reference info, needed for the renderer. It also can be used to
  7126. * inject data in specific cases. Usually, you will be ok to pass `{}`,
  7127. * and then pass updated object to renderer.
  7128. **/
  7129. MarkdownIt.prototype.parse = function (src, env) {
  7130. if (typeof src !== 'string') {
  7131. throw new Error('Input data should be a String');
  7132. }
  7133. var state = new this.core.State(src, this, env);
  7134. this.core.process(state);
  7135. return state.tokens;
  7136. };
  7137. /**
  7138. * MarkdownIt.render(src [, env]) -> String
  7139. * - src (String): source string
  7140. * - env (Object): environment sandbox
  7141. *
  7142. * Render markdown string into html. It does all magic for you :).
  7143. *
  7144. * `env` can be used to inject additional metadata (`{}` by default).
  7145. * But you will not need it with high probability. See also comment
  7146. * in [[MarkdownIt.parse]].
  7147. **/
  7148. MarkdownIt.prototype.render = function (src, env) {
  7149. env = env || {};
  7150. return this.renderer.render(this.parse(src, env), this.options, env);
  7151. };
  7152. /** internal
  7153. * MarkdownIt.parseInline(src, env) -> Array
  7154. * - src (String): source string
  7155. * - env (Object): environment sandbox
  7156. *
  7157. * The same as [[MarkdownIt.parse]] but skip all block rules. It returns the
  7158. * block tokens list with the single `inline` element, containing parsed inline
  7159. * tokens in `children` property. Also updates `env` object.
  7160. **/
  7161. MarkdownIt.prototype.parseInline = function (src, env) {
  7162. var state = new this.core.State(src, this, env);
  7163. state.inlineMode = true;
  7164. this.core.process(state);
  7165. return state.tokens;
  7166. };
  7167. /**
  7168. * MarkdownIt.renderInline(src [, env]) -> String
  7169. * - src (String): source string
  7170. * - env (Object): environment sandbox
  7171. *
  7172. * Similar to [[MarkdownIt.render]] but for single paragraph content. Result
  7173. * will NOT be wrapped into `<p>` tags.
  7174. **/
  7175. MarkdownIt.prototype.renderInline = function (src, env) {
  7176. env = env || {};
  7177. return this.renderer.render(this.parseInline(src, env), this.options, env);
  7178. };
  7179. module.exports = MarkdownIt;
  7180. /***/ }),
  7181. /* 38 */
  7182. /***/ (function(module, exports, __webpack_require__) {
  7183. "use strict";
  7184. /** internal
  7185. * class ParserBlock
  7186. *
  7187. * Block-level tokenizer.
  7188. **/
  7189. var Ruler = __webpack_require__(3);
  7190. var _rules = [
  7191. // First 2 params - rule name & source. Secondary array - list of rules,
  7192. // which can be terminated by this one.
  7193. [ 'table', __webpack_require__(56), [ 'paragraph', 'reference' ] ],
  7194. [ 'code', __webpack_require__(46) ],
  7195. [ 'fence', __webpack_require__(47), [ 'paragraph', 'reference', 'blockquote', 'list' ] ],
  7196. [ 'blockquote', __webpack_require__(45), [ 'paragraph', 'reference', 'list' ] ],
  7197. [ 'hr', __webpack_require__(49), [ 'paragraph', 'reference', 'blockquote', 'list' ] ],
  7198. [ 'list', __webpack_require__(52), [ 'paragraph', 'reference', 'blockquote' ] ],
  7199. [ 'reference', __webpack_require__(54) ],
  7200. [ 'heading', __webpack_require__(48), [ 'paragraph', 'reference', 'blockquote' ] ],
  7201. [ 'lheading', __webpack_require__(51) ],
  7202. [ 'html_block', __webpack_require__(50), [ 'paragraph', 'reference', 'blockquote' ] ],
  7203. [ 'paragraph', __webpack_require__(53) ]
  7204. ];
  7205. /**
  7206. * new ParserBlock()
  7207. **/
  7208. function ParserBlock() {
  7209. /**
  7210. * ParserBlock#ruler -> Ruler
  7211. *
  7212. * [[Ruler]] instance. Keep configuration of block rules.
  7213. **/
  7214. this.ruler = new Ruler();
  7215. for (var i = 0; i < _rules.length; i++) {
  7216. this.ruler.push(_rules[i][0], _rules[i][1], { alt: (_rules[i][2] || []).slice() });
  7217. }
  7218. }
  7219. // Generate tokens for input range
  7220. //
  7221. ParserBlock.prototype.tokenize = function (state, startLine, endLine) {
  7222. var ok, i,
  7223. rules = this.ruler.getRules(''),
  7224. len = rules.length,
  7225. line = startLine,
  7226. hasEmptyLines = false,
  7227. maxNesting = state.md.options.maxNesting;
  7228. while (line < endLine) {
  7229. state.line = line = state.skipEmptyLines(line);
  7230. if (line >= endLine) { break; }
  7231. // Termination condition for nested calls.
  7232. // Nested calls currently used for blockquotes & lists
  7233. if (state.sCount[line] < state.blkIndent) { break; }
  7234. // If nesting level exceeded - skip tail to the end. That's not ordinary
  7235. // situation and we should not care about content.
  7236. if (state.level >= maxNesting) {
  7237. state.line = endLine;
  7238. break;
  7239. }
  7240. // Try all possible rules.
  7241. // On success, rule should:
  7242. //
  7243. // - update `state.line`
  7244. // - update `state.tokens`
  7245. // - return true
  7246. for (i = 0; i < len; i++) {
  7247. ok = rules[i](state, line, endLine, false);
  7248. if (ok) { break; }
  7249. }
  7250. // set state.tight iff we had an empty line before current tag
  7251. // i.e. latest empty line should not count
  7252. state.tight = !hasEmptyLines;
  7253. // paragraph might "eat" one newline after it in nested lists
  7254. if (state.isEmpty(state.line - 1)) {
  7255. hasEmptyLines = true;
  7256. }
  7257. line = state.line;
  7258. if (line < endLine && state.isEmpty(line)) {
  7259. hasEmptyLines = true;
  7260. line++;
  7261. state.line = line;
  7262. }
  7263. }
  7264. };
  7265. /**
  7266. * ParserBlock.parse(str, md, env, outTokens)
  7267. *
  7268. * Process input string and push block tokens into `outTokens`
  7269. **/
  7270. ParserBlock.prototype.parse = function (src, md, env, outTokens) {
  7271. var state;
  7272. if (!src) { return; }
  7273. state = new this.State(src, md, env, outTokens);
  7274. this.tokenize(state, state.line, state.lineMax);
  7275. };
  7276. ParserBlock.prototype.State = __webpack_require__(55);
  7277. module.exports = ParserBlock;
  7278. /***/ }),
  7279. /* 39 */
  7280. /***/ (function(module, exports, __webpack_require__) {
  7281. "use strict";
  7282. /** internal
  7283. * class Core
  7284. *
  7285. * Top-level rules executor. Glues block/inline parsers and does intermediate
  7286. * transformations.
  7287. **/
  7288. var Ruler = __webpack_require__(3);
  7289. var _rules = [
  7290. [ 'normalize', __webpack_require__(60) ],
  7291. [ 'block', __webpack_require__(57) ],
  7292. [ 'inline', __webpack_require__(58) ],
  7293. [ 'linkify', __webpack_require__(59) ],
  7294. [ 'replacements', __webpack_require__(61) ],
  7295. [ 'smartquotes', __webpack_require__(62) ]
  7296. ];
  7297. /**
  7298. * new Core()
  7299. **/
  7300. function Core() {
  7301. /**
  7302. * Core#ruler -> Ruler
  7303. *
  7304. * [[Ruler]] instance. Keep configuration of core rules.
  7305. **/
  7306. this.ruler = new Ruler();
  7307. for (var i = 0; i < _rules.length; i++) {
  7308. this.ruler.push(_rules[i][0], _rules[i][1]);
  7309. }
  7310. }
  7311. /**
  7312. * Core.process(state)
  7313. *
  7314. * Executes core chain rules.
  7315. **/
  7316. Core.prototype.process = function (state) {
  7317. var i, l, rules;
  7318. rules = this.ruler.getRules('');
  7319. for (i = 0, l = rules.length; i < l; i++) {
  7320. rules[i](state);
  7321. }
  7322. };
  7323. Core.prototype.State = __webpack_require__(63);
  7324. module.exports = Core;
  7325. /***/ }),
  7326. /* 40 */
  7327. /***/ (function(module, exports, __webpack_require__) {
  7328. "use strict";
  7329. /** internal
  7330. * class ParserInline
  7331. *
  7332. * Tokenizes paragraph content.
  7333. **/
  7334. var Ruler = __webpack_require__(3);
  7335. ////////////////////////////////////////////////////////////////////////////////
  7336. // Parser rules
  7337. var _rules = [
  7338. [ 'text', __webpack_require__(74) ],
  7339. [ 'newline', __webpack_require__(72) ],
  7340. [ 'escape', __webpack_require__(68) ],
  7341. [ 'backticks', __webpack_require__(65) ],
  7342. [ 'strikethrough', __webpack_require__(14).tokenize ],
  7343. [ 'emphasis', __webpack_require__(13).tokenize ],
  7344. [ 'link', __webpack_require__(71) ],
  7345. [ 'image', __webpack_require__(70) ],
  7346. [ 'autolink', __webpack_require__(64) ],
  7347. [ 'html_inline', __webpack_require__(69) ],
  7348. [ 'entity', __webpack_require__(67) ]
  7349. ];
  7350. var _rules2 = [
  7351. [ 'balance_pairs', __webpack_require__(66) ],
  7352. [ 'strikethrough', __webpack_require__(14).postProcess ],
  7353. [ 'emphasis', __webpack_require__(13).postProcess ],
  7354. [ 'text_collapse', __webpack_require__(75) ]
  7355. ];
  7356. /**
  7357. * new ParserInline()
  7358. **/
  7359. function ParserInline() {
  7360. var i;
  7361. /**
  7362. * ParserInline#ruler -> Ruler
  7363. *
  7364. * [[Ruler]] instance. Keep configuration of inline rules.
  7365. **/
  7366. this.ruler = new Ruler();
  7367. for (i = 0; i < _rules.length; i++) {
  7368. this.ruler.push(_rules[i][0], _rules[i][1]);
  7369. }
  7370. /**
  7371. * ParserInline#ruler2 -> Ruler
  7372. *
  7373. * [[Ruler]] instance. Second ruler used for post-processing
  7374. * (e.g. in emphasis-like rules).
  7375. **/
  7376. this.ruler2 = new Ruler();
  7377. for (i = 0; i < _rules2.length; i++) {
  7378. this.ruler2.push(_rules2[i][0], _rules2[i][1]);
  7379. }
  7380. }
  7381. // Skip single token by running all rules in validation mode;
  7382. // returns `true` if any rule reported success
  7383. //
  7384. ParserInline.prototype.skipToken = function (state) {
  7385. var ok, i, pos = state.pos,
  7386. rules = this.ruler.getRules(''),
  7387. len = rules.length,
  7388. maxNesting = state.md.options.maxNesting,
  7389. cache = state.cache;
  7390. if (typeof cache[pos] !== 'undefined') {
  7391. state.pos = cache[pos];
  7392. return;
  7393. }
  7394. if (state.level < maxNesting) {
  7395. for (i = 0; i < len; i++) {
  7396. // Increment state.level and decrement it later to limit recursion.
  7397. // It's harmless to do here, because no tokens are created. But ideally,
  7398. // we'd need a separate private state variable for this purpose.
  7399. //
  7400. state.level++;
  7401. ok = rules[i](state, true);
  7402. state.level--;
  7403. if (ok) { break; }
  7404. }
  7405. } else {
  7406. // Too much nesting, just skip until the end of the paragraph.
  7407. //
  7408. // NOTE: this will cause links to behave incorrectly in the following case,
  7409. // when an amount of `[` is exactly equal to `maxNesting + 1`:
  7410. //
  7411. // [[[[[[[[[[[[[[[[[[[[[foo]()
  7412. //
  7413. // TODO: remove this workaround when CM standard will allow nested links
  7414. // (we can replace it by preventing links from being parsed in
  7415. // validation mode)
  7416. //
  7417. state.pos = state.posMax;
  7418. }
  7419. if (!ok) { state.pos++; }
  7420. cache[pos] = state.pos;
  7421. };
  7422. // Generate tokens for input range
  7423. //
  7424. ParserInline.prototype.tokenize = function (state) {
  7425. var ok, i,
  7426. rules = this.ruler.getRules(''),
  7427. len = rules.length,
  7428. end = state.posMax,
  7429. maxNesting = state.md.options.maxNesting;
  7430. while (state.pos < end) {
  7431. // Try all possible rules.
  7432. // On success, rule should:
  7433. //
  7434. // - update `state.pos`
  7435. // - update `state.tokens`
  7436. // - return true
  7437. if (state.level < maxNesting) {
  7438. for (i = 0; i < len; i++) {
  7439. ok = rules[i](state, false);
  7440. if (ok) { break; }
  7441. }
  7442. }
  7443. if (ok) {
  7444. if (state.pos >= end) { break; }
  7445. continue;
  7446. }
  7447. state.pending += state.src[state.pos++];
  7448. }
  7449. if (state.pending) {
  7450. state.pushPending();
  7451. }
  7452. };
  7453. /**
  7454. * ParserInline.parse(str, md, env, outTokens)
  7455. *
  7456. * Process input string and push inline tokens into `outTokens`
  7457. **/
  7458. ParserInline.prototype.parse = function (str, md, env, outTokens) {
  7459. var i, rules, len;
  7460. var state = new this.State(str, md, env, outTokens);
  7461. this.tokenize(state);
  7462. rules = this.ruler2.getRules('');
  7463. len = rules.length;
  7464. for (i = 0; i < len; i++) {
  7465. rules[i](state);
  7466. }
  7467. };
  7468. ParserInline.prototype.State = __webpack_require__(73);
  7469. module.exports = ParserInline;
  7470. /***/ }),
  7471. /* 41 */
  7472. /***/ (function(module, exports, __webpack_require__) {
  7473. "use strict";
  7474. // Commonmark default options
  7475. module.exports = {
  7476. options: {
  7477. html: true, // Enable HTML tags in source
  7478. xhtmlOut: true, // Use '/' to close single tags (<br />)
  7479. breaks: false, // Convert '\n' in paragraphs into <br>
  7480. langPrefix: 'language-', // CSS language prefix for fenced blocks
  7481. linkify: false, // autoconvert URL-like texts to links
  7482. // Enable some language-neutral replacements + quotes beautification
  7483. typographer: false,
  7484. // Double + single quotes replacement pairs, when typographer enabled,
  7485. // and smartquotes on. Could be either a String or an Array.
  7486. //
  7487. // For example, you can use '«»„“' for Russian, '„“‚‘' for German,
  7488. // and ['«\xA0', '\xA0»', '‹\xA0', '\xA0›'] for French (including nbsp).
  7489. quotes: '\u201c\u201d\u2018\u2019', /* “”‘’ */
  7490. // Highlighter function. Should return escaped HTML,
  7491. // or '' if the source string is not changed and should be escaped externaly.
  7492. // If result starts with <pre... internal wrapper is skipped.
  7493. //
  7494. // function (/*str, lang*/) { return ''; }
  7495. //
  7496. highlight: null,
  7497. maxNesting: 20 // Internal protection, recursion limit
  7498. },
  7499. components: {
  7500. core: {
  7501. rules: [
  7502. 'normalize',
  7503. 'block',
  7504. 'inline'
  7505. ]
  7506. },
  7507. block: {
  7508. rules: [
  7509. 'blockquote',
  7510. 'code',
  7511. 'fence',
  7512. 'heading',
  7513. 'hr',
  7514. 'html_block',
  7515. 'lheading',
  7516. 'list',
  7517. 'reference',
  7518. 'paragraph'
  7519. ]
  7520. },
  7521. inline: {
  7522. rules: [
  7523. 'autolink',
  7524. 'backticks',
  7525. 'emphasis',
  7526. 'entity',
  7527. 'escape',
  7528. 'html_inline',
  7529. 'image',
  7530. 'link',
  7531. 'newline',
  7532. 'text'
  7533. ],
  7534. rules2: [
  7535. 'balance_pairs',
  7536. 'emphasis',
  7537. 'text_collapse'
  7538. ]
  7539. }
  7540. }
  7541. };
  7542. /***/ }),
  7543. /* 42 */
  7544. /***/ (function(module, exports, __webpack_require__) {
  7545. "use strict";
  7546. // markdown-it default options
  7547. module.exports = {
  7548. options: {
  7549. html: false, // Enable HTML tags in source
  7550. xhtmlOut: false, // Use '/' to close single tags (<br />)
  7551. breaks: false, // Convert '\n' in paragraphs into <br>
  7552. langPrefix: 'language-', // CSS language prefix for fenced blocks
  7553. linkify: false, // autoconvert URL-like texts to links
  7554. // Enable some language-neutral replacements + quotes beautification
  7555. typographer: false,
  7556. // Double + single quotes replacement pairs, when typographer enabled,
  7557. // and smartquotes on. Could be either a String or an Array.
  7558. //
  7559. // For example, you can use '«»„“' for Russian, '„“‚‘' for German,
  7560. // and ['«\xA0', '\xA0»', '‹\xA0', '\xA0›'] for French (including nbsp).
  7561. quotes: '\u201c\u201d\u2018\u2019', /* “”‘’ */
  7562. // Highlighter function. Should return escaped HTML,
  7563. // or '' if the source string is not changed and should be escaped externaly.
  7564. // If result starts with <pre... internal wrapper is skipped.
  7565. //
  7566. // function (/*str, lang*/) { return ''; }
  7567. //
  7568. highlight: null,
  7569. maxNesting: 100 // Internal protection, recursion limit
  7570. },
  7571. components: {
  7572. core: {},
  7573. block: {},
  7574. inline: {}
  7575. }
  7576. };
  7577. /***/ }),
  7578. /* 43 */
  7579. /***/ (function(module, exports, __webpack_require__) {
  7580. "use strict";
  7581. // "Zero" preset, with nothing enabled. Useful for manual configuring of simple
  7582. // modes. For example, to parse bold/italic only.
  7583. module.exports = {
  7584. options: {
  7585. html: false, // Enable HTML tags in source
  7586. xhtmlOut: false, // Use '/' to close single tags (<br />)
  7587. breaks: false, // Convert '\n' in paragraphs into <br>
  7588. langPrefix: 'language-', // CSS language prefix for fenced blocks
  7589. linkify: false, // autoconvert URL-like texts to links
  7590. // Enable some language-neutral replacements + quotes beautification
  7591. typographer: false,
  7592. // Double + single quotes replacement pairs, when typographer enabled,
  7593. // and smartquotes on. Could be either a String or an Array.
  7594. //
  7595. // For example, you can use '«»„“' for Russian, '„“‚‘' for German,
  7596. // and ['«\xA0', '\xA0»', '‹\xA0', '\xA0›'] for French (including nbsp).
  7597. quotes: '\u201c\u201d\u2018\u2019', /* “”‘’ */
  7598. // Highlighter function. Should return escaped HTML,
  7599. // or '' if the source string is not changed and should be escaped externaly.
  7600. // If result starts with <pre... internal wrapper is skipped.
  7601. //
  7602. // function (/*str, lang*/) { return ''; }
  7603. //
  7604. highlight: null,
  7605. maxNesting: 20 // Internal protection, recursion limit
  7606. },
  7607. components: {
  7608. core: {
  7609. rules: [
  7610. 'normalize',
  7611. 'block',
  7612. 'inline'
  7613. ]
  7614. },
  7615. block: {
  7616. rules: [
  7617. 'paragraph'
  7618. ]
  7619. },
  7620. inline: {
  7621. rules: [
  7622. 'text'
  7623. ],
  7624. rules2: [
  7625. 'balance_pairs',
  7626. 'text_collapse'
  7627. ]
  7628. }
  7629. }
  7630. };
  7631. /***/ }),
  7632. /* 44 */
  7633. /***/ (function(module, exports, __webpack_require__) {
  7634. "use strict";
  7635. /**
  7636. * class Renderer
  7637. *
  7638. * Generates HTML from parsed token stream. Each instance has independent
  7639. * copy of rules. Those can be rewritten with ease. Also, you can add new
  7640. * rules if you create plugin and adds new token types.
  7641. **/
  7642. var assign = __webpack_require__(0).assign;
  7643. var unescapeAll = __webpack_require__(0).unescapeAll;
  7644. var escapeHtml = __webpack_require__(0).escapeHtml;
  7645. ////////////////////////////////////////////////////////////////////////////////
  7646. var default_rules = {};
  7647. default_rules.code_inline = function (tokens, idx, options, env, slf) {
  7648. var token = tokens[idx];
  7649. return '<code' + slf.renderAttrs(token) + '>' +
  7650. escapeHtml(tokens[idx].content) +
  7651. '</code>';
  7652. };
  7653. default_rules.code_block = function (tokens, idx, options, env, slf) {
  7654. var token = tokens[idx];
  7655. return '<pre' + slf.renderAttrs(token) + '><code>' +
  7656. escapeHtml(tokens[idx].content) +
  7657. '</code></pre>\n';
  7658. };
  7659. default_rules.fence = function (tokens, idx, options, env, slf) {
  7660. var token = tokens[idx],
  7661. info = token.info ? unescapeAll(token.info).trim() : '',
  7662. langName = '',
  7663. highlighted, i, tmpAttrs, tmpToken;
  7664. if (info) {
  7665. langName = info.split(/\s+/g)[0];
  7666. }
  7667. if (options.highlight) {
  7668. highlighted = options.highlight(token.content, langName) || escapeHtml(token.content);
  7669. } else {
  7670. highlighted = escapeHtml(token.content);
  7671. }
  7672. if (highlighted.indexOf('<pre') === 0) {
  7673. return highlighted + '\n';
  7674. }
  7675. // If language exists, inject class gently, without mudofying original token.
  7676. // May be, one day we will add .clone() for token and simplify this part, but
  7677. // now we prefer to keep things local.
  7678. if (info) {
  7679. i = token.attrIndex('class');
  7680. tmpAttrs = token.attrs ? token.attrs.slice() : [];
  7681. if (i < 0) {
  7682. tmpAttrs.push([ 'class', options.langPrefix + langName ]);
  7683. } else {
  7684. tmpAttrs[i][1] += ' ' + options.langPrefix + langName;
  7685. }
  7686. // Fake token just to render attributes
  7687. tmpToken = {
  7688. attrs: tmpAttrs
  7689. };
  7690. return '<pre><code' + slf.renderAttrs(tmpToken) + '>'
  7691. + highlighted
  7692. + '</code></pre>\n';
  7693. }
  7694. return '<pre><code' + slf.renderAttrs(token) + '>'
  7695. + highlighted
  7696. + '</code></pre>\n';
  7697. };
  7698. default_rules.image = function (tokens, idx, options, env, slf) {
  7699. var token = tokens[idx];
  7700. // "alt" attr MUST be set, even if empty. Because it's mandatory and
  7701. // should be placed on proper position for tests.
  7702. //
  7703. // Replace content with actual value
  7704. token.attrs[token.attrIndex('alt')][1] =
  7705. slf.renderInlineAsText(token.children, options, env);
  7706. return slf.renderToken(tokens, idx, options);
  7707. };
  7708. default_rules.hardbreak = function (tokens, idx, options /*, env */) {
  7709. return options.xhtmlOut ? '<br />\n' : '<br>\n';
  7710. };
  7711. default_rules.softbreak = function (tokens, idx, options /*, env */) {
  7712. return options.breaks ? (options.xhtmlOut ? '<br />\n' : '<br>\n') : '\n';
  7713. };
  7714. default_rules.text = function (tokens, idx /*, options, env */) {
  7715. return escapeHtml(tokens[idx].content);
  7716. };
  7717. default_rules.html_block = function (tokens, idx /*, options, env */) {
  7718. return tokens[idx].content;
  7719. };
  7720. default_rules.html_inline = function (tokens, idx /*, options, env */) {
  7721. return tokens[idx].content;
  7722. };
  7723. /**
  7724. * new Renderer()
  7725. *
  7726. * Creates new [[Renderer]] instance and fill [[Renderer#rules]] with defaults.
  7727. **/
  7728. function Renderer() {
  7729. /**
  7730. * Renderer#rules -> Object
  7731. *
  7732. * Contains render rules for tokens. Can be updated and extended.
  7733. *
  7734. * ##### Example
  7735. *
  7736. * ```javascript
  7737. * var md = require('markdown-it')();
  7738. *
  7739. * md.renderer.rules.strong_open = function () { return '<b>'; };
  7740. * md.renderer.rules.strong_close = function () { return '</b>'; };
  7741. *
  7742. * var result = md.renderInline(...);
  7743. * ```
  7744. *
  7745. * Each rule is called as independed static function with fixed signature:
  7746. *
  7747. * ```javascript
  7748. * function my_token_render(tokens, idx, options, env, renderer) {
  7749. * // ...
  7750. * return renderedHTML;
  7751. * }
  7752. * ```
  7753. *
  7754. * See [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.js)
  7755. * for more details and examples.
  7756. **/
  7757. this.rules = assign({}, default_rules);
  7758. }
  7759. /**
  7760. * Renderer.renderAttrs(token) -> String
  7761. *
  7762. * Render token attributes to string.
  7763. **/
  7764. Renderer.prototype.renderAttrs = function renderAttrs(token) {
  7765. var i, l, result;
  7766. if (!token.attrs) { return ''; }
  7767. result = '';
  7768. for (i = 0, l = token.attrs.length; i < l; i++) {
  7769. result += ' ' + escapeHtml(token.attrs[i][0]) + '="' + escapeHtml(token.attrs[i][1]) + '"';
  7770. }
  7771. return result;
  7772. };
  7773. /**
  7774. * Renderer.renderToken(tokens, idx, options) -> String
  7775. * - tokens (Array): list of tokens
  7776. * - idx (Numbed): token index to render
  7777. * - options (Object): params of parser instance
  7778. *
  7779. * Default token renderer. Can be overriden by custom function
  7780. * in [[Renderer#rules]].
  7781. **/
  7782. Renderer.prototype.renderToken = function renderToken(tokens, idx, options) {
  7783. var nextToken,
  7784. result = '',
  7785. needLf = false,
  7786. token = tokens[idx];
  7787. // Tight list paragraphs
  7788. if (token.hidden) {
  7789. return '';
  7790. }
  7791. // Insert a newline between hidden paragraph and subsequent opening
  7792. // block-level tag.
  7793. //
  7794. // For example, here we should insert a newline before blockquote:
  7795. // - a
  7796. // >
  7797. //
  7798. if (token.block && token.nesting !== -1 && idx && tokens[idx - 1].hidden) {
  7799. result += '\n';
  7800. }
  7801. // Add token name, e.g. `<img`
  7802. result += (token.nesting === -1 ? '</' : '<') + token.tag;
  7803. // Encode attributes, e.g. `<img src="foo"`
  7804. result += this.renderAttrs(token);
  7805. // Add a slash for self-closing tags, e.g. `<img src="foo" /`
  7806. if (token.nesting === 0 && options.xhtmlOut) {
  7807. result += ' /';
  7808. }
  7809. // Check if we need to add a newline after this tag
  7810. if (token.block) {
  7811. needLf = true;
  7812. if (token.nesting === 1) {
  7813. if (idx + 1 < tokens.length) {
  7814. nextToken = tokens[idx + 1];
  7815. if (nextToken.type === 'inline' || nextToken.hidden) {
  7816. // Block-level tag containing an inline tag.
  7817. //
  7818. needLf = false;
  7819. } else if (nextToken.nesting === -1 && nextToken.tag === token.tag) {
  7820. // Opening tag + closing tag of the same type. E.g. `<li></li>`.
  7821. //
  7822. needLf = false;
  7823. }
  7824. }
  7825. }
  7826. }
  7827. result += needLf ? '>\n' : '>';
  7828. return result;
  7829. };
  7830. /**
  7831. * Renderer.renderInline(tokens, options, env) -> String
  7832. * - tokens (Array): list on block tokens to renter
  7833. * - options (Object): params of parser instance
  7834. * - env (Object): additional data from parsed input (references, for example)
  7835. *
  7836. * The same as [[Renderer.render]], but for single token of `inline` type.
  7837. **/
  7838. Renderer.prototype.renderInline = function (tokens, options, env) {
  7839. var type,
  7840. result = '',
  7841. rules = this.rules;
  7842. for (var i = 0, len = tokens.length; i < len; i++) {
  7843. type = tokens[i].type;
  7844. if (typeof rules[type] !== 'undefined') {
  7845. result += rules[type](tokens, i, options, env, this);
  7846. } else {
  7847. result += this.renderToken(tokens, i, options);
  7848. }
  7849. }
  7850. return result;
  7851. };
  7852. /** internal
  7853. * Renderer.renderInlineAsText(tokens, options, env) -> String
  7854. * - tokens (Array): list on block tokens to renter
  7855. * - options (Object): params of parser instance
  7856. * - env (Object): additional data from parsed input (references, for example)
  7857. *
  7858. * Special kludge for image `alt` attributes to conform CommonMark spec.
  7859. * Don't try to use it! Spec requires to show `alt` content with stripped markup,
  7860. * instead of simple escaping.
  7861. **/
  7862. Renderer.prototype.renderInlineAsText = function (tokens, options, env) {
  7863. var result = '';
  7864. for (var i = 0, len = tokens.length; i < len; i++) {
  7865. if (tokens[i].type === 'text') {
  7866. result += tokens[i].content;
  7867. } else if (tokens[i].type === 'image') {
  7868. result += this.renderInlineAsText(tokens[i].children, options, env);
  7869. }
  7870. }
  7871. return result;
  7872. };
  7873. /**
  7874. * Renderer.render(tokens, options, env) -> String
  7875. * - tokens (Array): list on block tokens to renter
  7876. * - options (Object): params of parser instance
  7877. * - env (Object): additional data from parsed input (references, for example)
  7878. *
  7879. * Takes token stream and generates HTML. Probably, you will never need to call
  7880. * this method directly.
  7881. **/
  7882. Renderer.prototype.render = function (tokens, options, env) {
  7883. var i, len, type,
  7884. result = '',
  7885. rules = this.rules;
  7886. for (i = 0, len = tokens.length; i < len; i++) {
  7887. type = tokens[i].type;
  7888. if (type === 'inline') {
  7889. result += this.renderInline(tokens[i].children, options, env);
  7890. } else if (typeof rules[type] !== 'undefined') {
  7891. result += rules[tokens[i].type](tokens, i, options, env, this);
  7892. } else {
  7893. result += this.renderToken(tokens, i, options, env);
  7894. }
  7895. }
  7896. return result;
  7897. };
  7898. module.exports = Renderer;
  7899. /***/ }),
  7900. /* 45 */
  7901. /***/ (function(module, exports, __webpack_require__) {
  7902. "use strict";
  7903. // Block quotes
  7904. var isSpace = __webpack_require__(0).isSpace;
  7905. module.exports = function blockquote(state, startLine, endLine, silent) {
  7906. var adjustTab,
  7907. ch,
  7908. i,
  7909. initial,
  7910. isOutdented,
  7911. l,
  7912. lastLineEmpty,
  7913. lines,
  7914. nextLine,
  7915. offset,
  7916. oldBMarks,
  7917. oldBSCount,
  7918. oldIndent,
  7919. oldParentType,
  7920. oldSCount,
  7921. oldTShift,
  7922. spaceAfterMarker,
  7923. terminate,
  7924. terminatorRules,
  7925. token,
  7926. oldLineMax = state.lineMax,
  7927. pos = state.bMarks[startLine] + state.tShift[startLine],
  7928. max = state.eMarks[startLine];
  7929. // if it's indented more than 3 spaces, it should be a code block
  7930. if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
  7931. // check the block quote marker
  7932. if (state.src.charCodeAt(pos++) !== 0x3E/* > */) { return false; }
  7933. // we know that it's going to be a valid blockquote,
  7934. // so no point trying to find the end of it in silent mode
  7935. if (silent) { return true; }
  7936. // skip spaces after ">" and re-calculate offset
  7937. initial = offset = state.sCount[startLine] + pos - (state.bMarks[startLine] + state.tShift[startLine]);
  7938. // skip one optional space after '>'
  7939. if (state.src.charCodeAt(pos) === 0x20 /* space */) {
  7940. // ' > test '
  7941. // ^ -- position start of line here:
  7942. pos++;
  7943. initial++;
  7944. offset++;
  7945. adjustTab = false;
  7946. spaceAfterMarker = true;
  7947. } else if (state.src.charCodeAt(pos) === 0x09 /* tab */) {
  7948. spaceAfterMarker = true;
  7949. if ((state.bsCount[startLine] + offset) % 4 === 3) {
  7950. // ' >\t test '
  7951. // ^ -- position start of line here (tab has width===1)
  7952. pos++;
  7953. initial++;
  7954. offset++;
  7955. adjustTab = false;
  7956. } else {
  7957. // ' >\t test '
  7958. // ^ -- position start of line here + shift bsCount slightly
  7959. // to make extra space appear
  7960. adjustTab = true;
  7961. }
  7962. } else {
  7963. spaceAfterMarker = false;
  7964. }
  7965. oldBMarks = [ state.bMarks[startLine] ];
  7966. state.bMarks[startLine] = pos;
  7967. while (pos < max) {
  7968. ch = state.src.charCodeAt(pos);
  7969. if (isSpace(ch)) {
  7970. if (ch === 0x09) {
  7971. offset += 4 - (offset + state.bsCount[startLine] + (adjustTab ? 1 : 0)) % 4;
  7972. } else {
  7973. offset++;
  7974. }
  7975. } else {
  7976. break;
  7977. }
  7978. pos++;
  7979. }
  7980. oldBSCount = [ state.bsCount[startLine] ];
  7981. state.bsCount[startLine] = state.sCount[startLine] + 1 + (spaceAfterMarker ? 1 : 0);
  7982. lastLineEmpty = pos >= max;
  7983. oldSCount = [ state.sCount[startLine] ];
  7984. state.sCount[startLine] = offset - initial;
  7985. oldTShift = [ state.tShift[startLine] ];
  7986. state.tShift[startLine] = pos - state.bMarks[startLine];
  7987. terminatorRules = state.md.block.ruler.getRules('blockquote');
  7988. oldParentType = state.parentType;
  7989. state.parentType = 'blockquote';
  7990. // Search the end of the block
  7991. //
  7992. // Block ends with either:
  7993. // 1. an empty line outside:
  7994. // ```
  7995. // > test
  7996. //
  7997. // ```
  7998. // 2. an empty line inside:
  7999. // ```
  8000. // >
  8001. // test
  8002. // ```
  8003. // 3. another tag:
  8004. // ```
  8005. // > test
  8006. // - - -
  8007. // ```
  8008. for (nextLine = startLine + 1; nextLine < endLine; nextLine++) {
  8009. // check if it's outdented, i.e. it's inside list item and indented
  8010. // less than said list item:
  8011. //
  8012. // ```
  8013. // 1. anything
  8014. // > current blockquote
  8015. // 2. checking this line
  8016. // ```
  8017. isOutdented = state.sCount[nextLine] < state.blkIndent;
  8018. pos = state.bMarks[nextLine] + state.tShift[nextLine];
  8019. max = state.eMarks[nextLine];
  8020. if (pos >= max) {
  8021. // Case 1: line is not inside the blockquote, and this line is empty.
  8022. break;
  8023. }
  8024. if (state.src.charCodeAt(pos++) === 0x3E/* > */ && !isOutdented) {
  8025. // This line is inside the blockquote.
  8026. // skip spaces after ">" and re-calculate offset
  8027. initial = offset = state.sCount[nextLine] + pos - (state.bMarks[nextLine] + state.tShift[nextLine]);
  8028. // skip one optional space after '>'
  8029. if (state.src.charCodeAt(pos) === 0x20 /* space */) {
  8030. // ' > test '
  8031. // ^ -- position start of line here:
  8032. pos++;
  8033. initial++;
  8034. offset++;
  8035. adjustTab = false;
  8036. spaceAfterMarker = true;
  8037. } else if (state.src.charCodeAt(pos) === 0x09 /* tab */) {
  8038. spaceAfterMarker = true;
  8039. if ((state.bsCount[nextLine] + offset) % 4 === 3) {
  8040. // ' >\t test '
  8041. // ^ -- position start of line here (tab has width===1)
  8042. pos++;
  8043. initial++;
  8044. offset++;
  8045. adjustTab = false;
  8046. } else {
  8047. // ' >\t test '
  8048. // ^ -- position start of line here + shift bsCount slightly
  8049. // to make extra space appear
  8050. adjustTab = true;
  8051. }
  8052. } else {
  8053. spaceAfterMarker = false;
  8054. }
  8055. oldBMarks.push(state.bMarks[nextLine]);
  8056. state.bMarks[nextLine] = pos;
  8057. while (pos < max) {
  8058. ch = state.src.charCodeAt(pos);
  8059. if (isSpace(ch)) {
  8060. if (ch === 0x09) {
  8061. offset += 4 - (offset + state.bsCount[nextLine] + (adjustTab ? 1 : 0)) % 4;
  8062. } else {
  8063. offset++;
  8064. }
  8065. } else {
  8066. break;
  8067. }
  8068. pos++;
  8069. }
  8070. lastLineEmpty = pos >= max;
  8071. oldBSCount.push(state.bsCount[nextLine]);
  8072. state.bsCount[nextLine] = state.sCount[nextLine] + 1 + (spaceAfterMarker ? 1 : 0);
  8073. oldSCount.push(state.sCount[nextLine]);
  8074. state.sCount[nextLine] = offset - initial;
  8075. oldTShift.push(state.tShift[nextLine]);
  8076. state.tShift[nextLine] = pos - state.bMarks[nextLine];
  8077. continue;
  8078. }
  8079. // Case 2: line is not inside the blockquote, and the last line was empty.
  8080. if (lastLineEmpty) { break; }
  8081. // Case 3: another tag found.
  8082. terminate = false;
  8083. for (i = 0, l = terminatorRules.length; i < l; i++) {
  8084. if (terminatorRules[i](state, nextLine, endLine, true)) {
  8085. terminate = true;
  8086. break;
  8087. }
  8088. }
  8089. if (terminate) {
  8090. // Quirk to enforce "hard termination mode" for paragraphs;
  8091. // normally if you call `tokenize(state, startLine, nextLine)`,
  8092. // paragraphs will look below nextLine for paragraph continuation,
  8093. // but if blockquote is terminated by another tag, they shouldn't
  8094. state.lineMax = nextLine;
  8095. if (state.blkIndent !== 0) {
  8096. // state.blkIndent was non-zero, we now set it to zero,
  8097. // so we need to re-calculate all offsets to appear as
  8098. // if indent wasn't changed
  8099. oldBMarks.push(state.bMarks[nextLine]);
  8100. oldBSCount.push(state.bsCount[nextLine]);
  8101. oldTShift.push(state.tShift[nextLine]);
  8102. oldSCount.push(state.sCount[nextLine]);
  8103. state.sCount[nextLine] -= state.blkIndent;
  8104. }
  8105. break;
  8106. }
  8107. if (isOutdented) break;
  8108. oldBMarks.push(state.bMarks[nextLine]);
  8109. oldBSCount.push(state.bsCount[nextLine]);
  8110. oldTShift.push(state.tShift[nextLine]);
  8111. oldSCount.push(state.sCount[nextLine]);
  8112. // A negative indentation means that this is a paragraph continuation
  8113. //
  8114. state.sCount[nextLine] = -1;
  8115. }
  8116. oldIndent = state.blkIndent;
  8117. state.blkIndent = 0;
  8118. token = state.push('blockquote_open', 'blockquote', 1);
  8119. token.markup = '>';
  8120. token.map = lines = [ startLine, 0 ];
  8121. state.md.block.tokenize(state, startLine, nextLine);
  8122. token = state.push('blockquote_close', 'blockquote', -1);
  8123. token.markup = '>';
  8124. state.lineMax = oldLineMax;
  8125. state.parentType = oldParentType;
  8126. lines[1] = state.line;
  8127. // Restore original tShift; this might not be necessary since the parser
  8128. // has already been here, but just to make sure we can do that.
  8129. for (i = 0; i < oldTShift.length; i++) {
  8130. state.bMarks[i + startLine] = oldBMarks[i];
  8131. state.tShift[i + startLine] = oldTShift[i];
  8132. state.sCount[i + startLine] = oldSCount[i];
  8133. state.bsCount[i + startLine] = oldBSCount[i];
  8134. }
  8135. state.blkIndent = oldIndent;
  8136. return true;
  8137. };
  8138. /***/ }),
  8139. /* 46 */
  8140. /***/ (function(module, exports, __webpack_require__) {
  8141. "use strict";
  8142. // Code block (4 spaces padded)
  8143. module.exports = function code(state, startLine, endLine/*, silent*/) {
  8144. var nextLine, last, token;
  8145. if (state.sCount[startLine] - state.blkIndent < 4) { return false; }
  8146. last = nextLine = startLine + 1;
  8147. while (nextLine < endLine) {
  8148. if (state.isEmpty(nextLine)) {
  8149. nextLine++;
  8150. continue;
  8151. }
  8152. if (state.sCount[nextLine] - state.blkIndent >= 4) {
  8153. nextLine++;
  8154. last = nextLine;
  8155. continue;
  8156. }
  8157. break;
  8158. }
  8159. state.line = last;
  8160. token = state.push('code_block', 'code', 0);
  8161. token.content = state.getLines(startLine, last, 4 + state.blkIndent, true);
  8162. token.map = [ startLine, state.line ];
  8163. return true;
  8164. };
  8165. /***/ }),
  8166. /* 47 */
  8167. /***/ (function(module, exports, __webpack_require__) {
  8168. "use strict";
  8169. // fences (``` lang, ~~~ lang)
  8170. module.exports = function fence(state, startLine, endLine, silent) {
  8171. var marker, len, params, nextLine, mem, token, markup,
  8172. haveEndMarker = false,
  8173. pos = state.bMarks[startLine] + state.tShift[startLine],
  8174. max = state.eMarks[startLine];
  8175. // if it's indented more than 3 spaces, it should be a code block
  8176. if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
  8177. if (pos + 3 > max) { return false; }
  8178. marker = state.src.charCodeAt(pos);
  8179. if (marker !== 0x7E/* ~ */ && marker !== 0x60 /* ` */) {
  8180. return false;
  8181. }
  8182. // scan marker length
  8183. mem = pos;
  8184. pos = state.skipChars(pos, marker);
  8185. len = pos - mem;
  8186. if (len < 3) { return false; }
  8187. markup = state.src.slice(mem, pos);
  8188. params = state.src.slice(pos, max);
  8189. if (params.indexOf(String.fromCharCode(marker)) >= 0) { return false; }
  8190. // Since start is found, we can report success here in validation mode
  8191. if (silent) { return true; }
  8192. // search end of block
  8193. nextLine = startLine;
  8194. for (;;) {
  8195. nextLine++;
  8196. if (nextLine >= endLine) {
  8197. // unclosed block should be autoclosed by end of document.
  8198. // also block seems to be autoclosed by end of parent
  8199. break;
  8200. }
  8201. pos = mem = state.bMarks[nextLine] + state.tShift[nextLine];
  8202. max = state.eMarks[nextLine];
  8203. if (pos < max && state.sCount[nextLine] < state.blkIndent) {
  8204. // non-empty line with negative indent should stop the list:
  8205. // - ```
  8206. // test
  8207. break;
  8208. }
  8209. if (state.src.charCodeAt(pos) !== marker) { continue; }
  8210. if (state.sCount[nextLine] - state.blkIndent >= 4) {
  8211. // closing fence should be indented less than 4 spaces
  8212. continue;
  8213. }
  8214. pos = state.skipChars(pos, marker);
  8215. // closing code fence must be at least as long as the opening one
  8216. if (pos - mem < len) { continue; }
  8217. // make sure tail has spaces only
  8218. pos = state.skipSpaces(pos);
  8219. if (pos < max) { continue; }
  8220. haveEndMarker = true;
  8221. // found!
  8222. break;
  8223. }
  8224. // If a fence has heading spaces, they should be removed from its inner block
  8225. len = state.sCount[startLine];
  8226. state.line = nextLine + (haveEndMarker ? 1 : 0);
  8227. token = state.push('fence', 'code', 0);
  8228. token.info = params;
  8229. token.content = state.getLines(startLine + 1, nextLine, len, true);
  8230. token.markup = markup;
  8231. token.map = [ startLine, state.line ];
  8232. return true;
  8233. };
  8234. /***/ }),
  8235. /* 48 */
  8236. /***/ (function(module, exports, __webpack_require__) {
  8237. "use strict";
  8238. // heading (#, ##, ...)
  8239. var isSpace = __webpack_require__(0).isSpace;
  8240. module.exports = function heading(state, startLine, endLine, silent) {
  8241. var ch, level, tmp, token,
  8242. pos = state.bMarks[startLine] + state.tShift[startLine],
  8243. max = state.eMarks[startLine];
  8244. // if it's indented more than 3 spaces, it should be a code block
  8245. if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
  8246. ch = state.src.charCodeAt(pos);
  8247. if (ch !== 0x23/* # */ || pos >= max) { return false; }
  8248. // count heading level
  8249. level = 1;
  8250. ch = state.src.charCodeAt(++pos);
  8251. while (ch === 0x23/* # */ && pos < max && level <= 6) {
  8252. level++;
  8253. ch = state.src.charCodeAt(++pos);
  8254. }
  8255. if (level > 6 || (pos < max && !isSpace(ch))) { return false; }
  8256. if (silent) { return true; }
  8257. // Let's cut tails like ' ### ' from the end of string
  8258. max = state.skipSpacesBack(max, pos);
  8259. tmp = state.skipCharsBack(max, 0x23, pos); // #
  8260. if (tmp > pos && isSpace(state.src.charCodeAt(tmp - 1))) {
  8261. max = tmp;
  8262. }
  8263. state.line = startLine + 1;
  8264. token = state.push('heading_open', 'h' + String(level), 1);
  8265. token.markup = '########'.slice(0, level);
  8266. token.map = [ startLine, state.line ];
  8267. token = state.push('inline', '', 0);
  8268. token.content = state.src.slice(pos, max).trim();
  8269. token.map = [ startLine, state.line ];
  8270. token.children = [];
  8271. token = state.push('heading_close', 'h' + String(level), -1);
  8272. token.markup = '########'.slice(0, level);
  8273. return true;
  8274. };
  8275. /***/ }),
  8276. /* 49 */
  8277. /***/ (function(module, exports, __webpack_require__) {
  8278. "use strict";
  8279. // Horizontal rule
  8280. var isSpace = __webpack_require__(0).isSpace;
  8281. module.exports = function hr(state, startLine, endLine, silent) {
  8282. var marker, cnt, ch, token,
  8283. pos = state.bMarks[startLine] + state.tShift[startLine],
  8284. max = state.eMarks[startLine];
  8285. // if it's indented more than 3 spaces, it should be a code block
  8286. if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
  8287. marker = state.src.charCodeAt(pos++);
  8288. // Check hr marker
  8289. if (marker !== 0x2A/* * */ &&
  8290. marker !== 0x2D/* - */ &&
  8291. marker !== 0x5F/* _ */) {
  8292. return false;
  8293. }
  8294. // markers can be mixed with spaces, but there should be at least 3 of them
  8295. cnt = 1;
  8296. while (pos < max) {
  8297. ch = state.src.charCodeAt(pos++);
  8298. if (ch !== marker && !isSpace(ch)) { return false; }
  8299. if (ch === marker) { cnt++; }
  8300. }
  8301. if (cnt < 3) { return false; }
  8302. if (silent) { return true; }
  8303. state.line = startLine + 1;
  8304. token = state.push('hr', 'hr', 0);
  8305. token.map = [ startLine, state.line ];
  8306. token.markup = Array(cnt + 1).join(String.fromCharCode(marker));
  8307. return true;
  8308. };
  8309. /***/ }),
  8310. /* 50 */
  8311. /***/ (function(module, exports, __webpack_require__) {
  8312. "use strict";
  8313. // HTML block
  8314. var block_names = __webpack_require__(32);
  8315. var HTML_OPEN_CLOSE_TAG_RE = __webpack_require__(12).HTML_OPEN_CLOSE_TAG_RE;
  8316. // An array of opening and corresponding closing sequences for html tags,
  8317. // last argument defines whether it can terminate a paragraph or not
  8318. //
  8319. var HTML_SEQUENCES = [
  8320. [ /^<(script|pre|style)(?=(\s|>|$))/i, /<\/(script|pre|style)>/i, true ],
  8321. [ /^<!--/, /-->/, true ],
  8322. [ /^<\?/, /\?>/, true ],
  8323. [ /^<![A-Z]/, />/, true ],
  8324. [ /^<!\[CDATA\[/, /\]\]>/, true ],
  8325. [ new RegExp('^</?(' + block_names.join('|') + ')(?=(\\s|/?>|$))', 'i'), /^$/, true ],
  8326. [ new RegExp(HTML_OPEN_CLOSE_TAG_RE.source + '\\s*$'), /^$/, false ]
  8327. ];
  8328. module.exports = function html_block(state, startLine, endLine, silent) {
  8329. var i, nextLine, token, lineText,
  8330. pos = state.bMarks[startLine] + state.tShift[startLine],
  8331. max = state.eMarks[startLine];
  8332. // if it's indented more than 3 spaces, it should be a code block
  8333. if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
  8334. if (!state.md.options.html) { return false; }
  8335. if (state.src.charCodeAt(pos) !== 0x3C/* < */) { return false; }
  8336. lineText = state.src.slice(pos, max);
  8337. for (i = 0; i < HTML_SEQUENCES.length; i++) {
  8338. if (HTML_SEQUENCES[i][0].test(lineText)) { break; }
  8339. }
  8340. if (i === HTML_SEQUENCES.length) { return false; }
  8341. if (silent) {
  8342. // true if this sequence can be a terminator, false otherwise
  8343. return HTML_SEQUENCES[i][2];
  8344. }
  8345. nextLine = startLine + 1;
  8346. // If we are here - we detected HTML block.
  8347. // Let's roll down till block end.
  8348. if (!HTML_SEQUENCES[i][1].test(lineText)) {
  8349. for (; nextLine < endLine; nextLine++) {
  8350. if (state.sCount[nextLine] < state.blkIndent) { break; }
  8351. pos = state.bMarks[nextLine] + state.tShift[nextLine];
  8352. max = state.eMarks[nextLine];
  8353. lineText = state.src.slice(pos, max);
  8354. if (HTML_SEQUENCES[i][1].test(lineText)) {
  8355. if (lineText.length !== 0) { nextLine++; }
  8356. break;
  8357. }
  8358. }
  8359. }
  8360. state.line = nextLine;
  8361. token = state.push('html_block', '', 0);
  8362. token.map = [ startLine, nextLine ];
  8363. token.content = state.getLines(startLine, nextLine, state.blkIndent, true);
  8364. return true;
  8365. };
  8366. /***/ }),
  8367. /* 51 */
  8368. /***/ (function(module, exports, __webpack_require__) {
  8369. "use strict";
  8370. // lheading (---, ===)
  8371. module.exports = function lheading(state, startLine, endLine/*, silent*/) {
  8372. var content, terminate, i, l, token, pos, max, level, marker,
  8373. nextLine = startLine + 1, oldParentType,
  8374. terminatorRules = state.md.block.ruler.getRules('paragraph');
  8375. // if it's indented more than 3 spaces, it should be a code block
  8376. if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
  8377. oldParentType = state.parentType;
  8378. state.parentType = 'paragraph'; // use paragraph to match terminatorRules
  8379. // jump line-by-line until empty one or EOF
  8380. for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) {
  8381. // this would be a code block normally, but after paragraph
  8382. // it's considered a lazy continuation regardless of what's there
  8383. if (state.sCount[nextLine] - state.blkIndent > 3) { continue; }
  8384. //
  8385. // Check for underline in setext header
  8386. //
  8387. if (state.sCount[nextLine] >= state.blkIndent) {
  8388. pos = state.bMarks[nextLine] + state.tShift[nextLine];
  8389. max = state.eMarks[nextLine];
  8390. if (pos < max) {
  8391. marker = state.src.charCodeAt(pos);
  8392. if (marker === 0x2D/* - */ || marker === 0x3D/* = */) {
  8393. pos = state.skipChars(pos, marker);
  8394. pos = state.skipSpaces(pos);
  8395. if (pos >= max) {
  8396. level = (marker === 0x3D/* = */ ? 1 : 2);
  8397. break;
  8398. }
  8399. }
  8400. }
  8401. }
  8402. // quirk for blockquotes, this line should already be checked by that rule
  8403. if (state.sCount[nextLine] < 0) { continue; }
  8404. // Some tags can terminate paragraph without empty line.
  8405. terminate = false;
  8406. for (i = 0, l = terminatorRules.length; i < l; i++) {
  8407. if (terminatorRules[i](state, nextLine, endLine, true)) {
  8408. terminate = true;
  8409. break;
  8410. }
  8411. }
  8412. if (terminate) { break; }
  8413. }
  8414. if (!level) {
  8415. // Didn't find valid underline
  8416. return false;
  8417. }
  8418. content = state.getLines(startLine, nextLine, state.blkIndent, false).trim();
  8419. state.line = nextLine + 1;
  8420. token = state.push('heading_open', 'h' + String(level), 1);
  8421. token.markup = String.fromCharCode(marker);
  8422. token.map = [ startLine, state.line ];
  8423. token = state.push('inline', '', 0);
  8424. token.content = content;
  8425. token.map = [ startLine, state.line - 1 ];
  8426. token.children = [];
  8427. token = state.push('heading_close', 'h' + String(level), -1);
  8428. token.markup = String.fromCharCode(marker);
  8429. state.parentType = oldParentType;
  8430. return true;
  8431. };
  8432. /***/ }),
  8433. /* 52 */
  8434. /***/ (function(module, exports, __webpack_require__) {
  8435. "use strict";
  8436. // Lists
  8437. var isSpace = __webpack_require__(0).isSpace;
  8438. // Search `[-+*][\n ]`, returns next pos arter marker on success
  8439. // or -1 on fail.
  8440. function skipBulletListMarker(state, startLine) {
  8441. var marker, pos, max, ch;
  8442. pos = state.bMarks[startLine] + state.tShift[startLine];
  8443. max = state.eMarks[startLine];
  8444. marker = state.src.charCodeAt(pos++);
  8445. // Check bullet
  8446. if (marker !== 0x2A/* * */ &&
  8447. marker !== 0x2D/* - */ &&
  8448. marker !== 0x2B/* + */) {
  8449. return -1;
  8450. }
  8451. if (pos < max) {
  8452. ch = state.src.charCodeAt(pos);
  8453. if (!isSpace(ch)) {
  8454. // " -test " - is not a list item
  8455. return -1;
  8456. }
  8457. }
  8458. return pos;
  8459. }
  8460. // Search `\d+[.)][\n ]`, returns next pos arter marker on success
  8461. // or -1 on fail.
  8462. function skipOrderedListMarker(state, startLine) {
  8463. var ch,
  8464. start = state.bMarks[startLine] + state.tShift[startLine],
  8465. pos = start,
  8466. max = state.eMarks[startLine];
  8467. // List marker should have at least 2 chars (digit + dot)
  8468. if (pos + 1 >= max) { return -1; }
  8469. ch = state.src.charCodeAt(pos++);
  8470. if (ch < 0x30/* 0 */ || ch > 0x39/* 9 */) { return -1; }
  8471. for (;;) {
  8472. // EOL -> fail
  8473. if (pos >= max) { return -1; }
  8474. ch = state.src.charCodeAt(pos++);
  8475. if (ch >= 0x30/* 0 */ && ch <= 0x39/* 9 */) {
  8476. // List marker should have no more than 9 digits
  8477. // (prevents integer overflow in browsers)
  8478. if (pos - start >= 10) { return -1; }
  8479. continue;
  8480. }
  8481. // found valid marker
  8482. if (ch === 0x29/* ) */ || ch === 0x2e/* . */) {
  8483. break;
  8484. }
  8485. return -1;
  8486. }
  8487. if (pos < max) {
  8488. ch = state.src.charCodeAt(pos);
  8489. if (!isSpace(ch)) {
  8490. // " 1.test " - is not a list item
  8491. return -1;
  8492. }
  8493. }
  8494. return pos;
  8495. }
  8496. function markTightParagraphs(state, idx) {
  8497. var i, l,
  8498. level = state.level + 2;
  8499. for (i = idx + 2, l = state.tokens.length - 2; i < l; i++) {
  8500. if (state.tokens[i].level === level && state.tokens[i].type === 'paragraph_open') {
  8501. state.tokens[i + 2].hidden = true;
  8502. state.tokens[i].hidden = true;
  8503. i += 2;
  8504. }
  8505. }
  8506. }
  8507. module.exports = function list(state, startLine, endLine, silent) {
  8508. var ch,
  8509. contentStart,
  8510. i,
  8511. indent,
  8512. indentAfterMarker,
  8513. initial,
  8514. isOrdered,
  8515. itemLines,
  8516. l,
  8517. listLines,
  8518. listTokIdx,
  8519. markerCharCode,
  8520. markerValue,
  8521. max,
  8522. nextLine,
  8523. offset,
  8524. oldIndent,
  8525. oldLIndent,
  8526. oldParentType,
  8527. oldTShift,
  8528. oldTight,
  8529. pos,
  8530. posAfterMarker,
  8531. prevEmptyEnd,
  8532. start,
  8533. terminate,
  8534. terminatorRules,
  8535. token,
  8536. isTerminatingParagraph = false,
  8537. tight = true;
  8538. // if it's indented more than 3 spaces, it should be a code block
  8539. if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
  8540. // limit conditions when list can interrupt
  8541. // a paragraph (validation mode only)
  8542. if (silent && state.parentType === 'paragraph') {
  8543. // Next list item should still terminate previous list item;
  8544. //
  8545. // This code can fail if plugins use blkIndent as well as lists,
  8546. // but I hope the spec gets fixed long before that happens.
  8547. //
  8548. if (state.tShift[startLine] >= state.blkIndent) {
  8549. isTerminatingParagraph = true;
  8550. }
  8551. }
  8552. // Detect list type and position after marker
  8553. if ((posAfterMarker = skipOrderedListMarker(state, startLine)) >= 0) {
  8554. isOrdered = true;
  8555. start = state.bMarks[startLine] + state.tShift[startLine];
  8556. markerValue = Number(state.src.substr(start, posAfterMarker - start - 1));
  8557. // If we're starting a new ordered list right after
  8558. // a paragraph, it should start with 1.
  8559. if (isTerminatingParagraph && markerValue !== 1) return false;
  8560. } else if ((posAfterMarker = skipBulletListMarker(state, startLine)) >= 0) {
  8561. isOrdered = false;
  8562. } else {
  8563. return false;
  8564. }
  8565. // If we're starting a new unordered list right after
  8566. // a paragraph, first line should not be empty.
  8567. if (isTerminatingParagraph) {
  8568. if (state.skipSpaces(posAfterMarker) >= state.eMarks[startLine]) return false;
  8569. }
  8570. // We should terminate list on style change. Remember first one to compare.
  8571. markerCharCode = state.src.charCodeAt(posAfterMarker - 1);
  8572. // For validation mode we can terminate immediately
  8573. if (silent) { return true; }
  8574. // Start list
  8575. listTokIdx = state.tokens.length;
  8576. if (isOrdered) {
  8577. token = state.push('ordered_list_open', 'ol', 1);
  8578. if (markerValue !== 1) {
  8579. token.attrs = [ [ 'start', markerValue ] ];
  8580. }
  8581. } else {
  8582. token = state.push('bullet_list_open', 'ul', 1);
  8583. }
  8584. token.map = listLines = [ startLine, 0 ];
  8585. token.markup = String.fromCharCode(markerCharCode);
  8586. //
  8587. // Iterate list items
  8588. //
  8589. nextLine = startLine;
  8590. prevEmptyEnd = false;
  8591. terminatorRules = state.md.block.ruler.getRules('list');
  8592. oldParentType = state.parentType;
  8593. state.parentType = 'list';
  8594. while (nextLine < endLine) {
  8595. pos = posAfterMarker;
  8596. max = state.eMarks[nextLine];
  8597. initial = offset = state.sCount[nextLine] + posAfterMarker - (state.bMarks[startLine] + state.tShift[startLine]);
  8598. while (pos < max) {
  8599. ch = state.src.charCodeAt(pos);
  8600. if (isSpace(ch)) {
  8601. if (ch === 0x09) {
  8602. offset += 4 - (offset + state.bsCount[nextLine]) % 4;
  8603. } else {
  8604. offset++;
  8605. }
  8606. } else {
  8607. break;
  8608. }
  8609. pos++;
  8610. }
  8611. contentStart = pos;
  8612. if (contentStart >= max) {
  8613. // trimming space in "- \n 3" case, indent is 1 here
  8614. indentAfterMarker = 1;
  8615. } else {
  8616. indentAfterMarker = offset - initial;
  8617. }
  8618. // If we have more than 4 spaces, the indent is 1
  8619. // (the rest is just indented code block)
  8620. if (indentAfterMarker > 4) { indentAfterMarker = 1; }
  8621. // " - test"
  8622. // ^^^^^ - calculating total length of this thing
  8623. indent = initial + indentAfterMarker;
  8624. // Run subparser & write tokens
  8625. token = state.push('list_item_open', 'li', 1);
  8626. token.markup = String.fromCharCode(markerCharCode);
  8627. token.map = itemLines = [ startLine, 0 ];
  8628. oldIndent = state.blkIndent;
  8629. oldTight = state.tight;
  8630. oldTShift = state.tShift[startLine];
  8631. oldLIndent = state.sCount[startLine];
  8632. state.blkIndent = indent;
  8633. state.tight = true;
  8634. state.tShift[startLine] = contentStart - state.bMarks[startLine];
  8635. state.sCount[startLine] = offset;
  8636. if (contentStart >= max && state.isEmpty(startLine + 1)) {
  8637. // workaround for this case
  8638. // (list item is empty, list terminates before "foo"):
  8639. // ~~~~~~~~
  8640. // -
  8641. //
  8642. // foo
  8643. // ~~~~~~~~
  8644. state.line = Math.min(state.line + 2, endLine);
  8645. } else {
  8646. state.md.block.tokenize(state, startLine, endLine, true);
  8647. }
  8648. // If any of list item is tight, mark list as tight
  8649. if (!state.tight || prevEmptyEnd) {
  8650. tight = false;
  8651. }
  8652. // Item become loose if finish with empty line,
  8653. // but we should filter last element, because it means list finish
  8654. prevEmptyEnd = (state.line - startLine) > 1 && state.isEmpty(state.line - 1);
  8655. state.blkIndent = oldIndent;
  8656. state.tShift[startLine] = oldTShift;
  8657. state.sCount[startLine] = oldLIndent;
  8658. state.tight = oldTight;
  8659. token = state.push('list_item_close', 'li', -1);
  8660. token.markup = String.fromCharCode(markerCharCode);
  8661. nextLine = startLine = state.line;
  8662. itemLines[1] = nextLine;
  8663. contentStart = state.bMarks[startLine];
  8664. if (nextLine >= endLine) { break; }
  8665. //
  8666. // Try to check if list is terminated or continued.
  8667. //
  8668. if (state.sCount[nextLine] < state.blkIndent) { break; }
  8669. // fail if terminating block found
  8670. terminate = false;
  8671. for (i = 0, l = terminatorRules.length; i < l; i++) {
  8672. if (terminatorRules[i](state, nextLine, endLine, true)) {
  8673. terminate = true;
  8674. break;
  8675. }
  8676. }
  8677. if (terminate) { break; }
  8678. // fail if list has another type
  8679. if (isOrdered) {
  8680. posAfterMarker = skipOrderedListMarker(state, nextLine);
  8681. if (posAfterMarker < 0) { break; }
  8682. } else {
  8683. posAfterMarker = skipBulletListMarker(state, nextLine);
  8684. if (posAfterMarker < 0) { break; }
  8685. }
  8686. if (markerCharCode !== state.src.charCodeAt(posAfterMarker - 1)) { break; }
  8687. }
  8688. // Finilize list
  8689. if (isOrdered) {
  8690. token = state.push('ordered_list_close', 'ol', -1);
  8691. } else {
  8692. token = state.push('bullet_list_close', 'ul', -1);
  8693. }
  8694. token.markup = String.fromCharCode(markerCharCode);
  8695. listLines[1] = nextLine;
  8696. state.line = nextLine;
  8697. state.parentType = oldParentType;
  8698. // mark paragraphs tight if needed
  8699. if (tight) {
  8700. markTightParagraphs(state, listTokIdx);
  8701. }
  8702. return true;
  8703. };
  8704. /***/ }),
  8705. /* 53 */
  8706. /***/ (function(module, exports, __webpack_require__) {
  8707. "use strict";
  8708. // Paragraph
  8709. module.exports = function paragraph(state, startLine/*, endLine*/) {
  8710. var content, terminate, i, l, token, oldParentType,
  8711. nextLine = startLine + 1,
  8712. terminatorRules = state.md.block.ruler.getRules('paragraph'),
  8713. endLine = state.lineMax;
  8714. oldParentType = state.parentType;
  8715. state.parentType = 'paragraph';
  8716. // jump line-by-line until empty one or EOF
  8717. for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) {
  8718. // this would be a code block normally, but after paragraph
  8719. // it's considered a lazy continuation regardless of what's there
  8720. if (state.sCount[nextLine] - state.blkIndent > 3) { continue; }
  8721. // quirk for blockquotes, this line should already be checked by that rule
  8722. if (state.sCount[nextLine] < 0) { continue; }
  8723. // Some tags can terminate paragraph without empty line.
  8724. terminate = false;
  8725. for (i = 0, l = terminatorRules.length; i < l; i++) {
  8726. if (terminatorRules[i](state, nextLine, endLine, true)) {
  8727. terminate = true;
  8728. break;
  8729. }
  8730. }
  8731. if (terminate) { break; }
  8732. }
  8733. content = state.getLines(startLine, nextLine, state.blkIndent, false).trim();
  8734. state.line = nextLine;
  8735. token = state.push('paragraph_open', 'p', 1);
  8736. token.map = [ startLine, state.line ];
  8737. token = state.push('inline', '', 0);
  8738. token.content = content;
  8739. token.map = [ startLine, state.line ];
  8740. token.children = [];
  8741. token = state.push('paragraph_close', 'p', -1);
  8742. state.parentType = oldParentType;
  8743. return true;
  8744. };
  8745. /***/ }),
  8746. /* 54 */
  8747. /***/ (function(module, exports, __webpack_require__) {
  8748. "use strict";
  8749. var normalizeReference = __webpack_require__(0).normalizeReference;
  8750. var isSpace = __webpack_require__(0).isSpace;
  8751. module.exports = function reference(state, startLine, _endLine, silent) {
  8752. var ch,
  8753. destEndPos,
  8754. destEndLineNo,
  8755. endLine,
  8756. href,
  8757. i,
  8758. l,
  8759. label,
  8760. labelEnd,
  8761. oldParentType,
  8762. res,
  8763. start,
  8764. str,
  8765. terminate,
  8766. terminatorRules,
  8767. title,
  8768. lines = 0,
  8769. pos = state.bMarks[startLine] + state.tShift[startLine],
  8770. max = state.eMarks[startLine],
  8771. nextLine = startLine + 1;
  8772. // if it's indented more than 3 spaces, it should be a code block
  8773. if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
  8774. if (state.src.charCodeAt(pos) !== 0x5B/* [ */) { return false; }
  8775. // Simple check to quickly interrupt scan on [link](url) at the start of line.
  8776. // Can be useful on practice: https://github.com/markdown-it/markdown-it/issues/54
  8777. while (++pos < max) {
  8778. if (state.src.charCodeAt(pos) === 0x5D /* ] */ &&
  8779. state.src.charCodeAt(pos - 1) !== 0x5C/* \ */) {
  8780. if (pos + 1 === max) { return false; }
  8781. if (state.src.charCodeAt(pos + 1) !== 0x3A/* : */) { return false; }
  8782. break;
  8783. }
  8784. }
  8785. endLine = state.lineMax;
  8786. // jump line-by-line until empty one or EOF
  8787. terminatorRules = state.md.block.ruler.getRules('reference');
  8788. oldParentType = state.parentType;
  8789. state.parentType = 'reference';
  8790. for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) {
  8791. // this would be a code block normally, but after paragraph
  8792. // it's considered a lazy continuation regardless of what's there
  8793. if (state.sCount[nextLine] - state.blkIndent > 3) { continue; }
  8794. // quirk for blockquotes, this line should already be checked by that rule
  8795. if (state.sCount[nextLine] < 0) { continue; }
  8796. // Some tags can terminate paragraph without empty line.
  8797. terminate = false;
  8798. for (i = 0, l = terminatorRules.length; i < l; i++) {
  8799. if (terminatorRules[i](state, nextLine, endLine, true)) {
  8800. terminate = true;
  8801. break;
  8802. }
  8803. }
  8804. if (terminate) { break; }
  8805. }
  8806. str = state.getLines(startLine, nextLine, state.blkIndent, false).trim();
  8807. max = str.length;
  8808. for (pos = 1; pos < max; pos++) {
  8809. ch = str.charCodeAt(pos);
  8810. if (ch === 0x5B /* [ */) {
  8811. return false;
  8812. } else if (ch === 0x5D /* ] */) {
  8813. labelEnd = pos;
  8814. break;
  8815. } else if (ch === 0x0A /* \n */) {
  8816. lines++;
  8817. } else if (ch === 0x5C /* \ */) {
  8818. pos++;
  8819. if (pos < max && str.charCodeAt(pos) === 0x0A) {
  8820. lines++;
  8821. }
  8822. }
  8823. }
  8824. if (labelEnd < 0 || str.charCodeAt(labelEnd + 1) !== 0x3A/* : */) { return false; }
  8825. // [label]: destination 'title'
  8826. // ^^^ skip optional whitespace here
  8827. for (pos = labelEnd + 2; pos < max; pos++) {
  8828. ch = str.charCodeAt(pos);
  8829. if (ch === 0x0A) {
  8830. lines++;
  8831. } else if (isSpace(ch)) {
  8832. /*eslint no-empty:0*/
  8833. } else {
  8834. break;
  8835. }
  8836. }
  8837. // [label]: destination 'title'
  8838. // ^^^^^^^^^^^ parse this
  8839. res = state.md.helpers.parseLinkDestination(str, pos, max);
  8840. if (!res.ok) { return false; }
  8841. href = state.md.normalizeLink(res.str);
  8842. if (!state.md.validateLink(href)) { return false; }
  8843. pos = res.pos;
  8844. lines += res.lines;
  8845. // save cursor state, we could require to rollback later
  8846. destEndPos = pos;
  8847. destEndLineNo = lines;
  8848. // [label]: destination 'title'
  8849. // ^^^ skipping those spaces
  8850. start = pos;
  8851. for (; pos < max; pos++) {
  8852. ch = str.charCodeAt(pos);
  8853. if (ch === 0x0A) {
  8854. lines++;
  8855. } else if (isSpace(ch)) {
  8856. /*eslint no-empty:0*/
  8857. } else {
  8858. break;
  8859. }
  8860. }
  8861. // [label]: destination 'title'
  8862. // ^^^^^^^ parse this
  8863. res = state.md.helpers.parseLinkTitle(str, pos, max);
  8864. if (pos < max && start !== pos && res.ok) {
  8865. title = res.str;
  8866. pos = res.pos;
  8867. lines += res.lines;
  8868. } else {
  8869. title = '';
  8870. pos = destEndPos;
  8871. lines = destEndLineNo;
  8872. }
  8873. // skip trailing spaces until the rest of the line
  8874. while (pos < max) {
  8875. ch = str.charCodeAt(pos);
  8876. if (!isSpace(ch)) { break; }
  8877. pos++;
  8878. }
  8879. if (pos < max && str.charCodeAt(pos) !== 0x0A) {
  8880. if (title) {
  8881. // garbage at the end of the line after title,
  8882. // but it could still be a valid reference if we roll back
  8883. title = '';
  8884. pos = destEndPos;
  8885. lines = destEndLineNo;
  8886. while (pos < max) {
  8887. ch = str.charCodeAt(pos);
  8888. if (!isSpace(ch)) { break; }
  8889. pos++;
  8890. }
  8891. }
  8892. }
  8893. if (pos < max && str.charCodeAt(pos) !== 0x0A) {
  8894. // garbage at the end of the line
  8895. return false;
  8896. }
  8897. label = normalizeReference(str.slice(1, labelEnd));
  8898. if (!label) {
  8899. // CommonMark 0.20 disallows empty labels
  8900. return false;
  8901. }
  8902. // Reference can not terminate anything. This check is for safety only.
  8903. /*istanbul ignore if*/
  8904. if (silent) { return true; }
  8905. if (typeof state.env.references === 'undefined') {
  8906. state.env.references = {};
  8907. }
  8908. if (typeof state.env.references[label] === 'undefined') {
  8909. state.env.references[label] = { title: title, href: href };
  8910. }
  8911. state.parentType = oldParentType;
  8912. state.line = startLine + lines + 1;
  8913. return true;
  8914. };
  8915. /***/ }),
  8916. /* 55 */
  8917. /***/ (function(module, exports, __webpack_require__) {
  8918. "use strict";
  8919. // Parser state class
  8920. var Token = __webpack_require__(4);
  8921. var isSpace = __webpack_require__(0).isSpace;
  8922. function StateBlock(src, md, env, tokens) {
  8923. var ch, s, start, pos, len, indent, offset, indent_found;
  8924. this.src = src;
  8925. // link to parser instance
  8926. this.md = md;
  8927. this.env = env;
  8928. //
  8929. // Internal state vartiables
  8930. //
  8931. this.tokens = tokens;
  8932. this.bMarks = []; // line begin offsets for fast jumps
  8933. this.eMarks = []; // line end offsets for fast jumps
  8934. this.tShift = []; // offsets of the first non-space characters (tabs not expanded)
  8935. this.sCount = []; // indents for each line (tabs expanded)
  8936. // An amount of virtual spaces (tabs expanded) between beginning
  8937. // of each line (bMarks) and real beginning of that line.
  8938. //
  8939. // It exists only as a hack because blockquotes override bMarks
  8940. // losing information in the process.
  8941. //
  8942. // It's used only when expanding tabs, you can think about it as
  8943. // an initial tab length, e.g. bsCount=21 applied to string `\t123`
  8944. // means first tab should be expanded to 4-21%4 === 3 spaces.
  8945. //
  8946. this.bsCount = [];
  8947. // block parser variables
  8948. this.blkIndent = 0; // required block content indent
  8949. // (for example, if we are in list)
  8950. this.line = 0; // line index in src
  8951. this.lineMax = 0; // lines count
  8952. this.tight = false; // loose/tight mode for lists
  8953. this.ddIndent = -1; // indent of the current dd block (-1 if there isn't any)
  8954. // can be 'blockquote', 'list', 'root', 'paragraph' or 'reference'
  8955. // used in lists to determine if they interrupt a paragraph
  8956. this.parentType = 'root';
  8957. this.level = 0;
  8958. // renderer
  8959. this.result = '';
  8960. // Create caches
  8961. // Generate markers.
  8962. s = this.src;
  8963. indent_found = false;
  8964. for (start = pos = indent = offset = 0, len = s.length; pos < len; pos++) {
  8965. ch = s.charCodeAt(pos);
  8966. if (!indent_found) {
  8967. if (isSpace(ch)) {
  8968. indent++;
  8969. if (ch === 0x09) {
  8970. offset += 4 - offset % 4;
  8971. } else {
  8972. offset++;
  8973. }
  8974. continue;
  8975. } else {
  8976. indent_found = true;
  8977. }
  8978. }
  8979. if (ch === 0x0A || pos === len - 1) {
  8980. if (ch !== 0x0A) { pos++; }
  8981. this.bMarks.push(start);
  8982. this.eMarks.push(pos);
  8983. this.tShift.push(indent);
  8984. this.sCount.push(offset);
  8985. this.bsCount.push(0);
  8986. indent_found = false;
  8987. indent = 0;
  8988. offset = 0;
  8989. start = pos + 1;
  8990. }
  8991. }
  8992. // Push fake entry to simplify cache bounds checks
  8993. this.bMarks.push(s.length);
  8994. this.eMarks.push(s.length);
  8995. this.tShift.push(0);
  8996. this.sCount.push(0);
  8997. this.bsCount.push(0);
  8998. this.lineMax = this.bMarks.length - 1; // don't count last fake line
  8999. }
  9000. // Push new token to "stream".
  9001. //
  9002. StateBlock.prototype.push = function (type, tag, nesting) {
  9003. var token = new Token(type, tag, nesting);
  9004. token.block = true;
  9005. if (nesting < 0) { this.level--; }
  9006. token.level = this.level;
  9007. if (nesting > 0) { this.level++; }
  9008. this.tokens.push(token);
  9009. return token;
  9010. };
  9011. StateBlock.prototype.isEmpty = function isEmpty(line) {
  9012. return this.bMarks[line] + this.tShift[line] >= this.eMarks[line];
  9013. };
  9014. StateBlock.prototype.skipEmptyLines = function skipEmptyLines(from) {
  9015. for (var max = this.lineMax; from < max; from++) {
  9016. if (this.bMarks[from] + this.tShift[from] < this.eMarks[from]) {
  9017. break;
  9018. }
  9019. }
  9020. return from;
  9021. };
  9022. // Skip spaces from given position.
  9023. StateBlock.prototype.skipSpaces = function skipSpaces(pos) {
  9024. var ch;
  9025. for (var max = this.src.length; pos < max; pos++) {
  9026. ch = this.src.charCodeAt(pos);
  9027. if (!isSpace(ch)) { break; }
  9028. }
  9029. return pos;
  9030. };
  9031. // Skip spaces from given position in reverse.
  9032. StateBlock.prototype.skipSpacesBack = function skipSpacesBack(pos, min) {
  9033. if (pos <= min) { return pos; }
  9034. while (pos > min) {
  9035. if (!isSpace(this.src.charCodeAt(--pos))) { return pos + 1; }
  9036. }
  9037. return pos;
  9038. };
  9039. // Skip char codes from given position
  9040. StateBlock.prototype.skipChars = function skipChars(pos, code) {
  9041. for (var max = this.src.length; pos < max; pos++) {
  9042. if (this.src.charCodeAt(pos) !== code) { break; }
  9043. }
  9044. return pos;
  9045. };
  9046. // Skip char codes reverse from given position - 1
  9047. StateBlock.prototype.skipCharsBack = function skipCharsBack(pos, code, min) {
  9048. if (pos <= min) { return pos; }
  9049. while (pos > min) {
  9050. if (code !== this.src.charCodeAt(--pos)) { return pos + 1; }
  9051. }
  9052. return pos;
  9053. };
  9054. // cut lines range from source.
  9055. StateBlock.prototype.getLines = function getLines(begin, end, indent, keepLastLF) {
  9056. var i, lineIndent, ch, first, last, queue, lineStart,
  9057. line = begin;
  9058. if (begin >= end) {
  9059. return '';
  9060. }
  9061. queue = new Array(end - begin);
  9062. for (i = 0; line < end; line++, i++) {
  9063. lineIndent = 0;
  9064. lineStart = first = this.bMarks[line];
  9065. if (line + 1 < end || keepLastLF) {
  9066. // No need for bounds check because we have fake entry on tail.
  9067. last = this.eMarks[line] + 1;
  9068. } else {
  9069. last = this.eMarks[line];
  9070. }
  9071. while (first < last && lineIndent < indent) {
  9072. ch = this.src.charCodeAt(first);
  9073. if (isSpace(ch)) {
  9074. if (ch === 0x09) {
  9075. lineIndent += 4 - (lineIndent + this.bsCount[line]) % 4;
  9076. } else {
  9077. lineIndent++;
  9078. }
  9079. } else if (first - lineStart < this.tShift[line]) {
  9080. // patched tShift masked characters to look like spaces (blockquotes, list markers)
  9081. lineIndent++;
  9082. } else {
  9083. break;
  9084. }
  9085. first++;
  9086. }
  9087. if (lineIndent > indent) {
  9088. // partially expanding tabs in code blocks, e.g '\t\tfoobar'
  9089. // with indent=2 becomes ' \tfoobar'
  9090. queue[i] = new Array(lineIndent - indent + 1).join(' ') + this.src.slice(first, last);
  9091. } else {
  9092. queue[i] = this.src.slice(first, last);
  9093. }
  9094. }
  9095. return queue.join('');
  9096. };
  9097. // re-export Token class to use in block rules
  9098. StateBlock.prototype.Token = Token;
  9099. module.exports = StateBlock;
  9100. /***/ }),
  9101. /* 56 */
  9102. /***/ (function(module, exports, __webpack_require__) {
  9103. "use strict";
  9104. // GFM table, non-standard
  9105. var isSpace = __webpack_require__(0).isSpace;
  9106. function getLine(state, line) {
  9107. var pos = state.bMarks[line] + state.blkIndent,
  9108. max = state.eMarks[line];
  9109. return state.src.substr(pos, max - pos);
  9110. }
  9111. function escapedSplit(str) {
  9112. var result = [],
  9113. pos = 0,
  9114. max = str.length,
  9115. ch,
  9116. escapes = 0,
  9117. lastPos = 0,
  9118. backTicked = false,
  9119. lastBackTick = 0;
  9120. ch = str.charCodeAt(pos);
  9121. while (pos < max) {
  9122. if (ch === 0x60/* ` */) {
  9123. if (backTicked) {
  9124. // make \` close code sequence, but not open it;
  9125. // the reason is: `\` is correct code block
  9126. backTicked = false;
  9127. lastBackTick = pos;
  9128. } else if (escapes % 2 === 0) {
  9129. backTicked = true;
  9130. lastBackTick = pos;
  9131. }
  9132. } else if (ch === 0x7c/* | */ && (escapes % 2 === 0) && !backTicked) {
  9133. result.push(str.substring(lastPos, pos));
  9134. lastPos = pos + 1;
  9135. }
  9136. if (ch === 0x5c/* \ */) {
  9137. escapes++;
  9138. } else {
  9139. escapes = 0;
  9140. }
  9141. pos++;
  9142. // If there was an un-closed backtick, go back to just after
  9143. // the last backtick, but as if it was a normal character
  9144. if (pos === max && backTicked) {
  9145. backTicked = false;
  9146. pos = lastBackTick + 1;
  9147. }
  9148. ch = str.charCodeAt(pos);
  9149. }
  9150. result.push(str.substring(lastPos));
  9151. return result;
  9152. }
  9153. module.exports = function table(state, startLine, endLine, silent) {
  9154. var ch, lineText, pos, i, nextLine, columns, columnCount, token,
  9155. aligns, t, tableLines, tbodyLines;
  9156. // should have at least two lines
  9157. if (startLine + 2 > endLine) { return false; }
  9158. nextLine = startLine + 1;
  9159. if (state.sCount[nextLine] < state.blkIndent) { return false; }
  9160. // if it's indented more than 3 spaces, it should be a code block
  9161. if (state.sCount[nextLine] - state.blkIndent >= 4) { return false; }
  9162. // first character of the second line should be '|', '-', ':',
  9163. // and no other characters are allowed but spaces;
  9164. // basically, this is the equivalent of /^[-:|][-:|\s]*$/ regexp
  9165. pos = state.bMarks[nextLine] + state.tShift[nextLine];
  9166. if (pos >= state.eMarks[nextLine]) { return false; }
  9167. ch = state.src.charCodeAt(pos++);
  9168. if (ch !== 0x7C/* | */ && ch !== 0x2D/* - */ && ch !== 0x3A/* : */) { return false; }
  9169. while (pos < state.eMarks[nextLine]) {
  9170. ch = state.src.charCodeAt(pos);
  9171. if (ch !== 0x7C/* | */ && ch !== 0x2D/* - */ && ch !== 0x3A/* : */ && !isSpace(ch)) { return false; }
  9172. pos++;
  9173. }
  9174. lineText = getLine(state, startLine + 1);
  9175. columns = lineText.split('|');
  9176. aligns = [];
  9177. for (i = 0; i < columns.length; i++) {
  9178. t = columns[i].trim();
  9179. if (!t) {
  9180. // allow empty columns before and after table, but not in between columns;
  9181. // e.g. allow ` |---| `, disallow ` ---||--- `
  9182. if (i === 0 || i === columns.length - 1) {
  9183. continue;
  9184. } else {
  9185. return false;
  9186. }
  9187. }
  9188. if (!/^:?-+:?$/.test(t)) { return false; }
  9189. if (t.charCodeAt(t.length - 1) === 0x3A/* : */) {
  9190. aligns.push(t.charCodeAt(0) === 0x3A/* : */ ? 'center' : 'right');
  9191. } else if (t.charCodeAt(0) === 0x3A/* : */) {
  9192. aligns.push('left');
  9193. } else {
  9194. aligns.push('');
  9195. }
  9196. }
  9197. lineText = getLine(state, startLine).trim();
  9198. if (lineText.indexOf('|') === -1) { return false; }
  9199. if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
  9200. columns = escapedSplit(lineText.replace(/^\||\|$/g, ''));
  9201. // header row will define an amount of columns in the entire table,
  9202. // and align row shouldn't be smaller than that (the rest of the rows can)
  9203. columnCount = columns.length;
  9204. if (columnCount > aligns.length) { return false; }
  9205. if (silent) { return true; }
  9206. token = state.push('table_open', 'table', 1);
  9207. token.map = tableLines = [ startLine, 0 ];
  9208. token = state.push('thead_open', 'thead', 1);
  9209. token.map = [ startLine, startLine + 1 ];
  9210. token = state.push('tr_open', 'tr', 1);
  9211. token.map = [ startLine, startLine + 1 ];
  9212. for (i = 0; i < columns.length; i++) {
  9213. token = state.push('th_open', 'th', 1);
  9214. token.map = [ startLine, startLine + 1 ];
  9215. if (aligns[i]) {
  9216. token.attrs = [ [ 'style', 'text-align:' + aligns[i] ] ];
  9217. }
  9218. token = state.push('inline', '', 0);
  9219. token.content = columns[i].trim();
  9220. token.map = [ startLine, startLine + 1 ];
  9221. token.children = [];
  9222. token = state.push('th_close', 'th', -1);
  9223. }
  9224. token = state.push('tr_close', 'tr', -1);
  9225. token = state.push('thead_close', 'thead', -1);
  9226. token = state.push('tbody_open', 'tbody', 1);
  9227. token.map = tbodyLines = [ startLine + 2, 0 ];
  9228. for (nextLine = startLine + 2; nextLine < endLine; nextLine++) {
  9229. if (state.sCount[nextLine] < state.blkIndent) { break; }
  9230. lineText = getLine(state, nextLine).trim();
  9231. if (lineText.indexOf('|') === -1) { break; }
  9232. if (state.sCount[nextLine] - state.blkIndent >= 4) { break; }
  9233. columns = escapedSplit(lineText.replace(/^\||\|$/g, ''));
  9234. token = state.push('tr_open', 'tr', 1);
  9235. for (i = 0; i < columnCount; i++) {
  9236. token = state.push('td_open', 'td', 1);
  9237. if (aligns[i]) {
  9238. token.attrs = [ [ 'style', 'text-align:' + aligns[i] ] ];
  9239. }
  9240. token = state.push('inline', '', 0);
  9241. token.content = columns[i] ? columns[i].trim() : '';
  9242. token.children = [];
  9243. token = state.push('td_close', 'td', -1);
  9244. }
  9245. token = state.push('tr_close', 'tr', -1);
  9246. }
  9247. token = state.push('tbody_close', 'tbody', -1);
  9248. token = state.push('table_close', 'table', -1);
  9249. tableLines[1] = tbodyLines[1] = nextLine;
  9250. state.line = nextLine;
  9251. return true;
  9252. };
  9253. /***/ }),
  9254. /* 57 */
  9255. /***/ (function(module, exports, __webpack_require__) {
  9256. "use strict";
  9257. module.exports = function block(state) {
  9258. var token;
  9259. if (state.inlineMode) {
  9260. token = new state.Token('inline', '', 0);
  9261. token.content = state.src;
  9262. token.map = [ 0, 1 ];
  9263. token.children = [];
  9264. state.tokens.push(token);
  9265. } else {
  9266. state.md.block.parse(state.src, state.md, state.env, state.tokens);
  9267. }
  9268. };
  9269. /***/ }),
  9270. /* 58 */
  9271. /***/ (function(module, exports, __webpack_require__) {
  9272. "use strict";
  9273. module.exports = function inline(state) {
  9274. var tokens = state.tokens, tok, i, l;
  9275. // Parse inlines
  9276. for (i = 0, l = tokens.length; i < l; i++) {
  9277. tok = tokens[i];
  9278. if (tok.type === 'inline') {
  9279. state.md.inline.parse(tok.content, state.md, state.env, tok.children);
  9280. }
  9281. }
  9282. };
  9283. /***/ }),
  9284. /* 59 */
  9285. /***/ (function(module, exports, __webpack_require__) {
  9286. "use strict";
  9287. // Replace link-like texts with link nodes.
  9288. //
  9289. // Currently restricted by `md.validateLink()` to http/https/ftp
  9290. //
  9291. var arrayReplaceAt = __webpack_require__(0).arrayReplaceAt;
  9292. function isLinkOpen(str) {
  9293. return /^<a[>\s]/i.test(str);
  9294. }
  9295. function isLinkClose(str) {
  9296. return /^<\/a\s*>/i.test(str);
  9297. }
  9298. module.exports = function linkify(state) {
  9299. var i, j, l, tokens, token, currentToken, nodes, ln, text, pos, lastPos,
  9300. level, htmlLinkLevel, url, fullUrl, urlText,
  9301. blockTokens = state.tokens,
  9302. links;
  9303. if (!state.md.options.linkify) { return; }
  9304. for (j = 0, l = blockTokens.length; j < l; j++) {
  9305. if (blockTokens[j].type !== 'inline' ||
  9306. !state.md.linkify.pretest(blockTokens[j].content)) {
  9307. continue;
  9308. }
  9309. tokens = blockTokens[j].children;
  9310. htmlLinkLevel = 0;
  9311. // We scan from the end, to keep position when new tags added.
  9312. // Use reversed logic in links start/end match
  9313. for (i = tokens.length - 1; i >= 0; i--) {
  9314. currentToken = tokens[i];
  9315. // Skip content of markdown links
  9316. if (currentToken.type === 'link_close') {
  9317. i--;
  9318. while (tokens[i].level !== currentToken.level && tokens[i].type !== 'link_open') {
  9319. i--;
  9320. }
  9321. continue;
  9322. }
  9323. // Skip content of html tag links
  9324. if (currentToken.type === 'html_inline') {
  9325. if (isLinkOpen(currentToken.content) && htmlLinkLevel > 0) {
  9326. htmlLinkLevel--;
  9327. }
  9328. if (isLinkClose(currentToken.content)) {
  9329. htmlLinkLevel++;
  9330. }
  9331. }
  9332. if (htmlLinkLevel > 0) { continue; }
  9333. if (currentToken.type === 'text' && state.md.linkify.test(currentToken.content)) {
  9334. text = currentToken.content;
  9335. links = state.md.linkify.match(text);
  9336. // Now split string to nodes
  9337. nodes = [];
  9338. level = currentToken.level;
  9339. lastPos = 0;
  9340. for (ln = 0; ln < links.length; ln++) {
  9341. url = links[ln].url;
  9342. fullUrl = state.md.normalizeLink(url);
  9343. if (!state.md.validateLink(fullUrl)) { continue; }
  9344. urlText = links[ln].text;
  9345. // Linkifier might send raw hostnames like "example.com", where url
  9346. // starts with domain name. So we prepend http:// in those cases,
  9347. // and remove it afterwards.
  9348. //
  9349. if (!links[ln].schema) {
  9350. urlText = state.md.normalizeLinkText('http://' + urlText).replace(/^http:\/\//, '');
  9351. } else if (links[ln].schema === 'mailto:' && !/^mailto:/i.test(urlText)) {
  9352. urlText = state.md.normalizeLinkText('mailto:' + urlText).replace(/^mailto:/, '');
  9353. } else {
  9354. urlText = state.md.normalizeLinkText(urlText);
  9355. }
  9356. pos = links[ln].index;
  9357. if (pos > lastPos) {
  9358. token = new state.Token('text', '', 0);
  9359. token.content = text.slice(lastPos, pos);
  9360. token.level = level;
  9361. nodes.push(token);
  9362. }
  9363. token = new state.Token('link_open', 'a', 1);
  9364. token.attrs = [ [ 'href', fullUrl ] ];
  9365. token.level = level++;
  9366. token.markup = 'linkify';
  9367. token.info = 'auto';
  9368. nodes.push(token);
  9369. token = new state.Token('text', '', 0);
  9370. token.content = urlText;
  9371. token.level = level;
  9372. nodes.push(token);
  9373. token = new state.Token('link_close', 'a', -1);
  9374. token.level = --level;
  9375. token.markup = 'linkify';
  9376. token.info = 'auto';
  9377. nodes.push(token);
  9378. lastPos = links[ln].lastIndex;
  9379. }
  9380. if (lastPos < text.length) {
  9381. token = new state.Token('text', '', 0);
  9382. token.content = text.slice(lastPos);
  9383. token.level = level;
  9384. nodes.push(token);
  9385. }
  9386. // replace current node
  9387. blockTokens[j].children = tokens = arrayReplaceAt(tokens, i, nodes);
  9388. }
  9389. }
  9390. }
  9391. };
  9392. /***/ }),
  9393. /* 60 */
  9394. /***/ (function(module, exports, __webpack_require__) {
  9395. "use strict";
  9396. // Normalize input string
  9397. var NEWLINES_RE = /\r[\n\u0085]?|[\u2424\u2028\u0085]/g;
  9398. var NULL_RE = /\u0000/g;
  9399. module.exports = function inline(state) {
  9400. var str;
  9401. // Normalize newlines
  9402. str = state.src.replace(NEWLINES_RE, '\n');
  9403. // Replace NULL characters
  9404. str = str.replace(NULL_RE, '\uFFFD');
  9405. state.src = str;
  9406. };
  9407. /***/ }),
  9408. /* 61 */
  9409. /***/ (function(module, exports, __webpack_require__) {
  9410. "use strict";
  9411. // Simple typographyc replacements
  9412. //
  9413. // (c) (C) → ©
  9414. // (tm) (TM) → ™
  9415. // (r) (R) → ®
  9416. // +- → ±
  9417. // (p) (P) -> §
  9418. // ... → … (also ?.... → ?.., !.... → !..)
  9419. // ???????? → ???, !!!!! → !!!, `,,` → `,`
  9420. // -- → &ndash;, --- → &mdash;
  9421. //
  9422. // TODO:
  9423. // - fractionals 1/2, 1/4, 3/4 -> ½, ¼, ¾
  9424. // - miltiplication 2 x 4 -> 2 × 4
  9425. var RARE_RE = /\+-|\.\.|\?\?\?\?|!!!!|,,|--/;
  9426. // Workaround for phantomjs - need regex without /g flag,
  9427. // or root check will fail every second time
  9428. var SCOPED_ABBR_TEST_RE = /\((c|tm|r|p)\)/i;
  9429. var SCOPED_ABBR_RE = /\((c|tm|r|p)\)/ig;
  9430. var SCOPED_ABBR = {
  9431. c: '©',
  9432. r: '®',
  9433. p: '§',
  9434. tm: '™'
  9435. };
  9436. function replaceFn(match, name) {
  9437. return SCOPED_ABBR[name.toLowerCase()];
  9438. }
  9439. function replace_scoped(inlineTokens) {
  9440. var i, token, inside_autolink = 0;
  9441. for (i = inlineTokens.length - 1; i >= 0; i--) {
  9442. token = inlineTokens[i];
  9443. if (token.type === 'text' && !inside_autolink) {
  9444. token.content = token.content.replace(SCOPED_ABBR_RE, replaceFn);
  9445. }
  9446. if (token.type === 'link_open' && token.info === 'auto') {
  9447. inside_autolink--;
  9448. }
  9449. if (token.type === 'link_close' && token.info === 'auto') {
  9450. inside_autolink++;
  9451. }
  9452. }
  9453. }
  9454. function replace_rare(inlineTokens) {
  9455. var i, token, inside_autolink = 0;
  9456. for (i = inlineTokens.length - 1; i >= 0; i--) {
  9457. token = inlineTokens[i];
  9458. if (token.type === 'text' && !inside_autolink) {
  9459. if (RARE_RE.test(token.content)) {
  9460. token.content = token.content
  9461. .replace(/\+-/g, '±')
  9462. // .., ..., ....... -> …
  9463. // but ?..... & !..... -> ?.. & !..
  9464. .replace(/\.{2,}/g, '…').replace(/([?!])…/g, '$1..')
  9465. .replace(/([?!]){4,}/g, '$1$1$1').replace(/,{2,}/g, ',')
  9466. // em-dash
  9467. .replace(/(^|[^-])---([^-]|$)/mg, '$1\u2014$2')
  9468. // en-dash
  9469. .replace(/(^|\s)--(\s|$)/mg, '$1\u2013$2')
  9470. .replace(/(^|[^-\s])--([^-\s]|$)/mg, '$1\u2013$2');
  9471. }
  9472. }
  9473. if (token.type === 'link_open' && token.info === 'auto') {
  9474. inside_autolink--;
  9475. }
  9476. if (token.type === 'link_close' && token.info === 'auto') {
  9477. inside_autolink++;
  9478. }
  9479. }
  9480. }
  9481. module.exports = function replace(state) {
  9482. var blkIdx;
  9483. if (!state.md.options.typographer) { return; }
  9484. for (blkIdx = state.tokens.length - 1; blkIdx >= 0; blkIdx--) {
  9485. if (state.tokens[blkIdx].type !== 'inline') { continue; }
  9486. if (SCOPED_ABBR_TEST_RE.test(state.tokens[blkIdx].content)) {
  9487. replace_scoped(state.tokens[blkIdx].children);
  9488. }
  9489. if (RARE_RE.test(state.tokens[blkIdx].content)) {
  9490. replace_rare(state.tokens[blkIdx].children);
  9491. }
  9492. }
  9493. };
  9494. /***/ }),
  9495. /* 62 */
  9496. /***/ (function(module, exports, __webpack_require__) {
  9497. "use strict";
  9498. // Convert straight quotation marks to typographic ones
  9499. //
  9500. var isWhiteSpace = __webpack_require__(0).isWhiteSpace;
  9501. var isPunctChar = __webpack_require__(0).isPunctChar;
  9502. var isMdAsciiPunct = __webpack_require__(0).isMdAsciiPunct;
  9503. var QUOTE_TEST_RE = /['"]/;
  9504. var QUOTE_RE = /['"]/g;
  9505. var APOSTROPHE = '\u2019'; /* ’ */
  9506. function replaceAt(str, index, ch) {
  9507. return str.substr(0, index) + ch + str.substr(index + 1);
  9508. }
  9509. function process_inlines(tokens, state) {
  9510. var i, token, text, t, pos, max, thisLevel, item, lastChar, nextChar,
  9511. isLastPunctChar, isNextPunctChar, isLastWhiteSpace, isNextWhiteSpace,
  9512. canOpen, canClose, j, isSingle, stack, openQuote, closeQuote;
  9513. stack = [];
  9514. for (i = 0; i < tokens.length; i++) {
  9515. token = tokens[i];
  9516. thisLevel = tokens[i].level;
  9517. for (j = stack.length - 1; j >= 0; j--) {
  9518. if (stack[j].level <= thisLevel) { break; }
  9519. }
  9520. stack.length = j + 1;
  9521. if (token.type !== 'text') { continue; }
  9522. text = token.content;
  9523. pos = 0;
  9524. max = text.length;
  9525. /*eslint no-labels:0,block-scoped-var:0*/
  9526. OUTER:
  9527. while (pos < max) {
  9528. QUOTE_RE.lastIndex = pos;
  9529. t = QUOTE_RE.exec(text);
  9530. if (!t) { break; }
  9531. canOpen = canClose = true;
  9532. pos = t.index + 1;
  9533. isSingle = (t[0] === "'");
  9534. // Find previous character,
  9535. // default to space if it's the beginning of the line
  9536. //
  9537. lastChar = 0x20;
  9538. if (t.index - 1 >= 0) {
  9539. lastChar = text.charCodeAt(t.index - 1);
  9540. } else {
  9541. for (j = i - 1; j >= 0; j--) {
  9542. if (tokens[j].type !== 'text') { continue; }
  9543. lastChar = tokens[j].content.charCodeAt(tokens[j].content.length - 1);
  9544. break;
  9545. }
  9546. }
  9547. // Find next character,
  9548. // default to space if it's the end of the line
  9549. //
  9550. nextChar = 0x20;
  9551. if (pos < max) {
  9552. nextChar = text.charCodeAt(pos);
  9553. } else {
  9554. for (j = i + 1; j < tokens.length; j++) {
  9555. if (tokens[j].type !== 'text') { continue; }
  9556. nextChar = tokens[j].content.charCodeAt(0);
  9557. break;
  9558. }
  9559. }
  9560. isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctChar(String.fromCharCode(lastChar));
  9561. isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctChar(String.fromCharCode(nextChar));
  9562. isLastWhiteSpace = isWhiteSpace(lastChar);
  9563. isNextWhiteSpace = isWhiteSpace(nextChar);
  9564. if (isNextWhiteSpace) {
  9565. canOpen = false;
  9566. } else if (isNextPunctChar) {
  9567. if (!(isLastWhiteSpace || isLastPunctChar)) {
  9568. canOpen = false;
  9569. }
  9570. }
  9571. if (isLastWhiteSpace) {
  9572. canClose = false;
  9573. } else if (isLastPunctChar) {
  9574. if (!(isNextWhiteSpace || isNextPunctChar)) {
  9575. canClose = false;
  9576. }
  9577. }
  9578. if (nextChar === 0x22 /* " */ && t[0] === '"') {
  9579. if (lastChar >= 0x30 /* 0 */ && lastChar <= 0x39 /* 9 */) {
  9580. // special case: 1"" - count first quote as an inch
  9581. canClose = canOpen = false;
  9582. }
  9583. }
  9584. if (canOpen && canClose) {
  9585. // treat this as the middle of the word
  9586. canOpen = false;
  9587. canClose = isNextPunctChar;
  9588. }
  9589. if (!canOpen && !canClose) {
  9590. // middle of word
  9591. if (isSingle) {
  9592. token.content = replaceAt(token.content, t.index, APOSTROPHE);
  9593. }
  9594. continue;
  9595. }
  9596. if (canClose) {
  9597. // this could be a closing quote, rewind the stack to get a match
  9598. for (j = stack.length - 1; j >= 0; j--) {
  9599. item = stack[j];
  9600. if (stack[j].level < thisLevel) { break; }
  9601. if (item.single === isSingle && stack[j].level === thisLevel) {
  9602. item = stack[j];
  9603. if (isSingle) {
  9604. openQuote = state.md.options.quotes[2];
  9605. closeQuote = state.md.options.quotes[3];
  9606. } else {
  9607. openQuote = state.md.options.quotes[0];
  9608. closeQuote = state.md.options.quotes[1];
  9609. }
  9610. // replace token.content *before* tokens[item.token].content,
  9611. // because, if they are pointing at the same token, replaceAt
  9612. // could mess up indices when quote length != 1
  9613. token.content = replaceAt(token.content, t.index, closeQuote);
  9614. tokens[item.token].content = replaceAt(
  9615. tokens[item.token].content, item.pos, openQuote);
  9616. pos += closeQuote.length - 1;
  9617. if (item.token === i) { pos += openQuote.length - 1; }
  9618. text = token.content;
  9619. max = text.length;
  9620. stack.length = j;
  9621. continue OUTER;
  9622. }
  9623. }
  9624. }
  9625. if (canOpen) {
  9626. stack.push({
  9627. token: i,
  9628. pos: t.index,
  9629. single: isSingle,
  9630. level: thisLevel
  9631. });
  9632. } else if (canClose && isSingle) {
  9633. token.content = replaceAt(token.content, t.index, APOSTROPHE);
  9634. }
  9635. }
  9636. }
  9637. }
  9638. module.exports = function smartquotes(state) {
  9639. /*eslint max-depth:0*/
  9640. var blkIdx;
  9641. if (!state.md.options.typographer) { return; }
  9642. for (blkIdx = state.tokens.length - 1; blkIdx >= 0; blkIdx--) {
  9643. if (state.tokens[blkIdx].type !== 'inline' ||
  9644. !QUOTE_TEST_RE.test(state.tokens[blkIdx].content)) {
  9645. continue;
  9646. }
  9647. process_inlines(state.tokens[blkIdx].children, state);
  9648. }
  9649. };
  9650. /***/ }),
  9651. /* 63 */
  9652. /***/ (function(module, exports, __webpack_require__) {
  9653. "use strict";
  9654. // Core state object
  9655. //
  9656. var Token = __webpack_require__(4);
  9657. function StateCore(src, md, env) {
  9658. this.src = src;
  9659. this.env = env;
  9660. this.tokens = [];
  9661. this.inlineMode = false;
  9662. this.md = md; // link to parser instance
  9663. }
  9664. // re-export Token class to use in core rules
  9665. StateCore.prototype.Token = Token;
  9666. module.exports = StateCore;
  9667. /***/ }),
  9668. /* 64 */
  9669. /***/ (function(module, exports, __webpack_require__) {
  9670. "use strict";
  9671. // Process autolinks '<protocol:...>'
  9672. /*eslint max-len:0*/
  9673. var EMAIL_RE = /^<([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)>/;
  9674. var AUTOLINK_RE = /^<([a-zA-Z][a-zA-Z0-9+.\-]{1,31}):([^<>\x00-\x20]*)>/;
  9675. module.exports = function autolink(state, silent) {
  9676. var tail, linkMatch, emailMatch, url, fullUrl, token,
  9677. pos = state.pos;
  9678. if (state.src.charCodeAt(pos) !== 0x3C/* < */) { return false; }
  9679. tail = state.src.slice(pos);
  9680. if (tail.indexOf('>') < 0) { return false; }
  9681. if (AUTOLINK_RE.test(tail)) {
  9682. linkMatch = tail.match(AUTOLINK_RE);
  9683. url = linkMatch[0].slice(1, -1);
  9684. fullUrl = state.md.normalizeLink(url);
  9685. if (!state.md.validateLink(fullUrl)) { return false; }
  9686. if (!silent) {
  9687. token = state.push('link_open', 'a', 1);
  9688. token.attrs = [ [ 'href', fullUrl ] ];
  9689. token.markup = 'autolink';
  9690. token.info = 'auto';
  9691. token = state.push('text', '', 0);
  9692. token.content = state.md.normalizeLinkText(url);
  9693. token = state.push('link_close', 'a', -1);
  9694. token.markup = 'autolink';
  9695. token.info = 'auto';
  9696. }
  9697. state.pos += linkMatch[0].length;
  9698. return true;
  9699. }
  9700. if (EMAIL_RE.test(tail)) {
  9701. emailMatch = tail.match(EMAIL_RE);
  9702. url = emailMatch[0].slice(1, -1);
  9703. fullUrl = state.md.normalizeLink('mailto:' + url);
  9704. if (!state.md.validateLink(fullUrl)) { return false; }
  9705. if (!silent) {
  9706. token = state.push('link_open', 'a', 1);
  9707. token.attrs = [ [ 'href', fullUrl ] ];
  9708. token.markup = 'autolink';
  9709. token.info = 'auto';
  9710. token = state.push('text', '', 0);
  9711. token.content = state.md.normalizeLinkText(url);
  9712. token = state.push('link_close', 'a', -1);
  9713. token.markup = 'autolink';
  9714. token.info = 'auto';
  9715. }
  9716. state.pos += emailMatch[0].length;
  9717. return true;
  9718. }
  9719. return false;
  9720. };
  9721. /***/ }),
  9722. /* 65 */
  9723. /***/ (function(module, exports, __webpack_require__) {
  9724. "use strict";
  9725. // Parse backticks
  9726. module.exports = function backtick(state, silent) {
  9727. var start, max, marker, matchStart, matchEnd, token,
  9728. pos = state.pos,
  9729. ch = state.src.charCodeAt(pos);
  9730. if (ch !== 0x60/* ` */) { return false; }
  9731. start = pos;
  9732. pos++;
  9733. max = state.posMax;
  9734. while (pos < max && state.src.charCodeAt(pos) === 0x60/* ` */) { pos++; }
  9735. marker = state.src.slice(start, pos);
  9736. matchStart = matchEnd = pos;
  9737. while ((matchStart = state.src.indexOf('`', matchEnd)) !== -1) {
  9738. matchEnd = matchStart + 1;
  9739. while (matchEnd < max && state.src.charCodeAt(matchEnd) === 0x60/* ` */) { matchEnd++; }
  9740. if (matchEnd - matchStart === marker.length) {
  9741. if (!silent) {
  9742. token = state.push('code_inline', 'code', 0);
  9743. token.markup = marker;
  9744. token.content = state.src.slice(pos, matchStart)
  9745. .replace(/[ \n]+/g, ' ')
  9746. .trim();
  9747. }
  9748. state.pos = matchEnd;
  9749. return true;
  9750. }
  9751. }
  9752. if (!silent) { state.pending += marker; }
  9753. state.pos += marker.length;
  9754. return true;
  9755. };
  9756. /***/ }),
  9757. /* 66 */
  9758. /***/ (function(module, exports, __webpack_require__) {
  9759. "use strict";
  9760. // For each opening emphasis-like marker find a matching closing one
  9761. //
  9762. module.exports = function link_pairs(state) {
  9763. var i, j, lastDelim, currDelim,
  9764. delimiters = state.delimiters,
  9765. max = state.delimiters.length;
  9766. for (i = 0; i < max; i++) {
  9767. lastDelim = delimiters[i];
  9768. if (!lastDelim.close) { continue; }
  9769. j = i - lastDelim.jump - 1;
  9770. while (j >= 0) {
  9771. currDelim = delimiters[j];
  9772. if (currDelim.open &&
  9773. currDelim.marker === lastDelim.marker &&
  9774. currDelim.end < 0 &&
  9775. currDelim.level === lastDelim.level) {
  9776. // typeofs are for backward compatibility with plugins
  9777. var odd_match = (currDelim.close || lastDelim.open) &&
  9778. typeof currDelim.length !== 'undefined' &&
  9779. typeof lastDelim.length !== 'undefined' &&
  9780. (currDelim.length + lastDelim.length) % 3 === 0;
  9781. if (!odd_match) {
  9782. lastDelim.jump = i - j;
  9783. lastDelim.open = false;
  9784. currDelim.end = i;
  9785. currDelim.jump = 0;
  9786. break;
  9787. }
  9788. }
  9789. j -= currDelim.jump + 1;
  9790. }
  9791. }
  9792. };
  9793. /***/ }),
  9794. /* 67 */
  9795. /***/ (function(module, exports, __webpack_require__) {
  9796. "use strict";
  9797. // Process html entity - &#123;, &#xAF;, &quot;, ...
  9798. var entities = __webpack_require__(11);
  9799. var has = __webpack_require__(0).has;
  9800. var isValidEntityCode = __webpack_require__(0).isValidEntityCode;
  9801. var fromCodePoint = __webpack_require__(0).fromCodePoint;
  9802. var DIGITAL_RE = /^&#((?:x[a-f0-9]{1,8}|[0-9]{1,8}));/i;
  9803. var NAMED_RE = /^&([a-z][a-z0-9]{1,31});/i;
  9804. module.exports = function entity(state, silent) {
  9805. var ch, code, match, pos = state.pos, max = state.posMax;
  9806. if (state.src.charCodeAt(pos) !== 0x26/* & */) { return false; }
  9807. if (pos + 1 < max) {
  9808. ch = state.src.charCodeAt(pos + 1);
  9809. if (ch === 0x23 /* # */) {
  9810. match = state.src.slice(pos).match(DIGITAL_RE);
  9811. if (match) {
  9812. if (!silent) {
  9813. code = match[1][0].toLowerCase() === 'x' ? parseInt(match[1].slice(1), 16) : parseInt(match[1], 10);
  9814. state.pending += isValidEntityCode(code) ? fromCodePoint(code) : fromCodePoint(0xFFFD);
  9815. }
  9816. state.pos += match[0].length;
  9817. return true;
  9818. }
  9819. } else {
  9820. match = state.src.slice(pos).match(NAMED_RE);
  9821. if (match) {
  9822. if (has(entities, match[1])) {
  9823. if (!silent) { state.pending += entities[match[1]]; }
  9824. state.pos += match[0].length;
  9825. return true;
  9826. }
  9827. }
  9828. }
  9829. }
  9830. if (!silent) { state.pending += '&'; }
  9831. state.pos++;
  9832. return true;
  9833. };
  9834. /***/ }),
  9835. /* 68 */
  9836. /***/ (function(module, exports, __webpack_require__) {
  9837. "use strict";
  9838. // Proceess escaped chars and hardbreaks
  9839. var isSpace = __webpack_require__(0).isSpace;
  9840. var ESCAPED = [];
  9841. for (var i = 0; i < 256; i++) { ESCAPED.push(0); }
  9842. '\\!"#$%&\'()*+,./:;<=>?@[]^_`{|}~-'
  9843. .split('').forEach(function (ch) { ESCAPED[ch.charCodeAt(0)] = 1; });
  9844. module.exports = function escape(state, silent) {
  9845. var ch, pos = state.pos, max = state.posMax;
  9846. if (state.src.charCodeAt(pos) !== 0x5C/* \ */) { return false; }
  9847. pos++;
  9848. if (pos < max) {
  9849. ch = state.src.charCodeAt(pos);
  9850. if (ch < 256 && ESCAPED[ch] !== 0) {
  9851. if (!silent) { state.pending += state.src[pos]; }
  9852. state.pos += 2;
  9853. return true;
  9854. }
  9855. if (ch === 0x0A) {
  9856. if (!silent) {
  9857. state.push('hardbreak', 'br', 0);
  9858. }
  9859. pos++;
  9860. // skip leading whitespaces from next line
  9861. while (pos < max) {
  9862. ch = state.src.charCodeAt(pos);
  9863. if (!isSpace(ch)) { break; }
  9864. pos++;
  9865. }
  9866. state.pos = pos;
  9867. return true;
  9868. }
  9869. }
  9870. if (!silent) { state.pending += '\\'; }
  9871. state.pos++;
  9872. return true;
  9873. };
  9874. /***/ }),
  9875. /* 69 */
  9876. /***/ (function(module, exports, __webpack_require__) {
  9877. "use strict";
  9878. // Process html tags
  9879. var HTML_TAG_RE = __webpack_require__(12).HTML_TAG_RE;
  9880. function isLetter(ch) {
  9881. /*eslint no-bitwise:0*/
  9882. var lc = ch | 0x20; // to lower case
  9883. return (lc >= 0x61/* a */) && (lc <= 0x7a/* z */);
  9884. }
  9885. module.exports = function html_inline(state, silent) {
  9886. var ch, match, max, token,
  9887. pos = state.pos;
  9888. if (!state.md.options.html) { return false; }
  9889. // Check start
  9890. max = state.posMax;
  9891. if (state.src.charCodeAt(pos) !== 0x3C/* < */ ||
  9892. pos + 2 >= max) {
  9893. return false;
  9894. }
  9895. // Quick fail on second char
  9896. ch = state.src.charCodeAt(pos + 1);
  9897. if (ch !== 0x21/* ! */ &&
  9898. ch !== 0x3F/* ? */ &&
  9899. ch !== 0x2F/* / */ &&
  9900. !isLetter(ch)) {
  9901. return false;
  9902. }
  9903. match = state.src.slice(pos).match(HTML_TAG_RE);
  9904. if (!match) { return false; }
  9905. if (!silent) {
  9906. token = state.push('html_inline', '', 0);
  9907. token.content = state.src.slice(pos, pos + match[0].length);
  9908. }
  9909. state.pos += match[0].length;
  9910. return true;
  9911. };
  9912. /***/ }),
  9913. /* 70 */
  9914. /***/ (function(module, exports, __webpack_require__) {
  9915. "use strict";
  9916. // Process ![image](<src> "title")
  9917. var normalizeReference = __webpack_require__(0).normalizeReference;
  9918. var isSpace = __webpack_require__(0).isSpace;
  9919. module.exports = function image(state, silent) {
  9920. var attrs,
  9921. code,
  9922. content,
  9923. label,
  9924. labelEnd,
  9925. labelStart,
  9926. pos,
  9927. ref,
  9928. res,
  9929. title,
  9930. token,
  9931. tokens,
  9932. start,
  9933. href = '',
  9934. oldPos = state.pos,
  9935. max = state.posMax;
  9936. if (state.src.charCodeAt(state.pos) !== 0x21/* ! */) { return false; }
  9937. if (state.src.charCodeAt(state.pos + 1) !== 0x5B/* [ */) { return false; }
  9938. labelStart = state.pos + 2;
  9939. labelEnd = state.md.helpers.parseLinkLabel(state, state.pos + 1, false);
  9940. // parser failed to find ']', so it's not a valid link
  9941. if (labelEnd < 0) { return false; }
  9942. pos = labelEnd + 1;
  9943. if (pos < max && state.src.charCodeAt(pos) === 0x28/* ( */) {
  9944. //
  9945. // Inline link
  9946. //
  9947. // [link]( <href> "title" )
  9948. // ^^ skipping these spaces
  9949. pos++;
  9950. for (; pos < max; pos++) {
  9951. code = state.src.charCodeAt(pos);
  9952. if (!isSpace(code) && code !== 0x0A) { break; }
  9953. }
  9954. if (pos >= max) { return false; }
  9955. // [link]( <href> "title" )
  9956. // ^^^^^^ parsing link destination
  9957. start = pos;
  9958. res = state.md.helpers.parseLinkDestination(state.src, pos, state.posMax);
  9959. if (res.ok) {
  9960. href = state.md.normalizeLink(res.str);
  9961. if (state.md.validateLink(href)) {
  9962. pos = res.pos;
  9963. } else {
  9964. href = '';
  9965. }
  9966. }
  9967. // [link]( <href> "title" )
  9968. // ^^ skipping these spaces
  9969. start = pos;
  9970. for (; pos < max; pos++) {
  9971. code = state.src.charCodeAt(pos);
  9972. if (!isSpace(code) && code !== 0x0A) { break; }
  9973. }
  9974. // [link]( <href> "title" )
  9975. // ^^^^^^^ parsing link title
  9976. res = state.md.helpers.parseLinkTitle(state.src, pos, state.posMax);
  9977. if (pos < max && start !== pos && res.ok) {
  9978. title = res.str;
  9979. pos = res.pos;
  9980. // [link]( <href> "title" )
  9981. // ^^ skipping these spaces
  9982. for (; pos < max; pos++) {
  9983. code = state.src.charCodeAt(pos);
  9984. if (!isSpace(code) && code !== 0x0A) { break; }
  9985. }
  9986. } else {
  9987. title = '';
  9988. }
  9989. if (pos >= max || state.src.charCodeAt(pos) !== 0x29/* ) */) {
  9990. state.pos = oldPos;
  9991. return false;
  9992. }
  9993. pos++;
  9994. } else {
  9995. //
  9996. // Link reference
  9997. //
  9998. if (typeof state.env.references === 'undefined') { return false; }
  9999. if (pos < max && state.src.charCodeAt(pos) === 0x5B/* [ */) {
  10000. start = pos + 1;
  10001. pos = state.md.helpers.parseLinkLabel(state, pos);
  10002. if (pos >= 0) {
  10003. label = state.src.slice(start, pos++);
  10004. } else {
  10005. pos = labelEnd + 1;
  10006. }
  10007. } else {
  10008. pos = labelEnd + 1;
  10009. }
  10010. // covers label === '' and label === undefined
  10011. // (collapsed reference link and shortcut reference link respectively)
  10012. if (!label) { label = state.src.slice(labelStart, labelEnd); }
  10013. ref = state.env.references[normalizeReference(label)];
  10014. if (!ref) {
  10015. state.pos = oldPos;
  10016. return false;
  10017. }
  10018. href = ref.href;
  10019. title = ref.title;
  10020. }
  10021. //
  10022. // We found the end of the link, and know for a fact it's a valid link;
  10023. // so all that's left to do is to call tokenizer.
  10024. //
  10025. if (!silent) {
  10026. content = state.src.slice(labelStart, labelEnd);
  10027. state.md.inline.parse(
  10028. content,
  10029. state.md,
  10030. state.env,
  10031. tokens = []
  10032. );
  10033. token = state.push('image', 'img', 0);
  10034. token.attrs = attrs = [ [ 'src', href ], [ 'alt', '' ] ];
  10035. token.children = tokens;
  10036. token.content = content;
  10037. if (title) {
  10038. attrs.push([ 'title', title ]);
  10039. }
  10040. }
  10041. state.pos = pos;
  10042. state.posMax = max;
  10043. return true;
  10044. };
  10045. /***/ }),
  10046. /* 71 */
  10047. /***/ (function(module, exports, __webpack_require__) {
  10048. "use strict";
  10049. // Process [link](<to> "stuff")
  10050. var normalizeReference = __webpack_require__(0).normalizeReference;
  10051. var isSpace = __webpack_require__(0).isSpace;
  10052. module.exports = function link(state, silent) {
  10053. var attrs,
  10054. code,
  10055. label,
  10056. labelEnd,
  10057. labelStart,
  10058. pos,
  10059. res,
  10060. ref,
  10061. title,
  10062. token,
  10063. href = '',
  10064. oldPos = state.pos,
  10065. max = state.posMax,
  10066. start = state.pos,
  10067. parseReference = true;
  10068. if (state.src.charCodeAt(state.pos) !== 0x5B/* [ */) { return false; }
  10069. labelStart = state.pos + 1;
  10070. labelEnd = state.md.helpers.parseLinkLabel(state, state.pos, true);
  10071. // parser failed to find ']', so it's not a valid link
  10072. if (labelEnd < 0) { return false; }
  10073. pos = labelEnd + 1;
  10074. if (pos < max && state.src.charCodeAt(pos) === 0x28/* ( */) {
  10075. //
  10076. // Inline link
  10077. //
  10078. // might have found a valid shortcut link, disable reference parsing
  10079. parseReference = false;
  10080. // [link]( <href> "title" )
  10081. // ^^ skipping these spaces
  10082. pos++;
  10083. for (; pos < max; pos++) {
  10084. code = state.src.charCodeAt(pos);
  10085. if (!isSpace(code) && code !== 0x0A) { break; }
  10086. }
  10087. if (pos >= max) { return false; }
  10088. // [link]( <href> "title" )
  10089. // ^^^^^^ parsing link destination
  10090. start = pos;
  10091. res = state.md.helpers.parseLinkDestination(state.src, pos, state.posMax);
  10092. if (res.ok) {
  10093. href = state.md.normalizeLink(res.str);
  10094. if (state.md.validateLink(href)) {
  10095. pos = res.pos;
  10096. } else {
  10097. href = '';
  10098. }
  10099. }
  10100. // [link]( <href> "title" )
  10101. // ^^ skipping these spaces
  10102. start = pos;
  10103. for (; pos < max; pos++) {
  10104. code = state.src.charCodeAt(pos);
  10105. if (!isSpace(code) && code !== 0x0A) { break; }
  10106. }
  10107. // [link]( <href> "title" )
  10108. // ^^^^^^^ parsing link title
  10109. res = state.md.helpers.parseLinkTitle(state.src, pos, state.posMax);
  10110. if (pos < max && start !== pos && res.ok) {
  10111. title = res.str;
  10112. pos = res.pos;
  10113. // [link]( <href> "title" )
  10114. // ^^ skipping these spaces
  10115. for (; pos < max; pos++) {
  10116. code = state.src.charCodeAt(pos);
  10117. if (!isSpace(code) && code !== 0x0A) { break; }
  10118. }
  10119. } else {
  10120. title = '';
  10121. }
  10122. if (pos >= max || state.src.charCodeAt(pos) !== 0x29/* ) */) {
  10123. // parsing a valid shortcut link failed, fallback to reference
  10124. parseReference = true;
  10125. }
  10126. pos++;
  10127. }
  10128. if (parseReference) {
  10129. //
  10130. // Link reference
  10131. //
  10132. if (typeof state.env.references === 'undefined') { return false; }
  10133. if (pos < max && state.src.charCodeAt(pos) === 0x5B/* [ */) {
  10134. start = pos + 1;
  10135. pos = state.md.helpers.parseLinkLabel(state, pos);
  10136. if (pos >= 0) {
  10137. label = state.src.slice(start, pos++);
  10138. } else {
  10139. pos = labelEnd + 1;
  10140. }
  10141. } else {
  10142. pos = labelEnd + 1;
  10143. }
  10144. // covers label === '' and label === undefined
  10145. // (collapsed reference link and shortcut reference link respectively)
  10146. if (!label) { label = state.src.slice(labelStart, labelEnd); }
  10147. ref = state.env.references[normalizeReference(label)];
  10148. if (!ref) {
  10149. state.pos = oldPos;
  10150. return false;
  10151. }
  10152. href = ref.href;
  10153. title = ref.title;
  10154. }
  10155. //
  10156. // We found the end of the link, and know for a fact it's a valid link;
  10157. // so all that's left to do is to call tokenizer.
  10158. //
  10159. if (!silent) {
  10160. state.pos = labelStart;
  10161. state.posMax = labelEnd;
  10162. token = state.push('link_open', 'a', 1);
  10163. token.attrs = attrs = [ [ 'href', href ] ];
  10164. if (title) {
  10165. attrs.push([ 'title', title ]);
  10166. }
  10167. state.md.inline.tokenize(state);
  10168. token = state.push('link_close', 'a', -1);
  10169. }
  10170. state.pos = pos;
  10171. state.posMax = max;
  10172. return true;
  10173. };
  10174. /***/ }),
  10175. /* 72 */
  10176. /***/ (function(module, exports, __webpack_require__) {
  10177. "use strict";
  10178. // Proceess '\n'
  10179. var isSpace = __webpack_require__(0).isSpace;
  10180. module.exports = function newline(state, silent) {
  10181. var pmax, max, pos = state.pos;
  10182. if (state.src.charCodeAt(pos) !== 0x0A/* \n */) { return false; }
  10183. pmax = state.pending.length - 1;
  10184. max = state.posMax;
  10185. // ' \n' -> hardbreak
  10186. // Lookup in pending chars is bad practice! Don't copy to other rules!
  10187. // Pending string is stored in concat mode, indexed lookups will cause
  10188. // convertion to flat mode.
  10189. if (!silent) {
  10190. if (pmax >= 0 && state.pending.charCodeAt(pmax) === 0x20) {
  10191. if (pmax >= 1 && state.pending.charCodeAt(pmax - 1) === 0x20) {
  10192. state.pending = state.pending.replace(/ +$/, '');
  10193. state.push('hardbreak', 'br', 0);
  10194. } else {
  10195. state.pending = state.pending.slice(0, -1);
  10196. state.push('softbreak', 'br', 0);
  10197. }
  10198. } else {
  10199. state.push('softbreak', 'br', 0);
  10200. }
  10201. }
  10202. pos++;
  10203. // skip heading spaces for next line
  10204. while (pos < max && isSpace(state.src.charCodeAt(pos))) { pos++; }
  10205. state.pos = pos;
  10206. return true;
  10207. };
  10208. /***/ }),
  10209. /* 73 */
  10210. /***/ (function(module, exports, __webpack_require__) {
  10211. "use strict";
  10212. // Inline parser state
  10213. var Token = __webpack_require__(4);
  10214. var isWhiteSpace = __webpack_require__(0).isWhiteSpace;
  10215. var isPunctChar = __webpack_require__(0).isPunctChar;
  10216. var isMdAsciiPunct = __webpack_require__(0).isMdAsciiPunct;
  10217. function StateInline(src, md, env, outTokens) {
  10218. this.src = src;
  10219. this.env = env;
  10220. this.md = md;
  10221. this.tokens = outTokens;
  10222. this.pos = 0;
  10223. this.posMax = this.src.length;
  10224. this.level = 0;
  10225. this.pending = '';
  10226. this.pendingLevel = 0;
  10227. this.cache = {}; // Stores { start: end } pairs. Useful for backtrack
  10228. // optimization of pairs parse (emphasis, strikes).
  10229. this.delimiters = []; // Emphasis-like delimiters
  10230. }
  10231. // Flush pending text
  10232. //
  10233. StateInline.prototype.pushPending = function () {
  10234. var token = new Token('text', '', 0);
  10235. token.content = this.pending;
  10236. token.level = this.pendingLevel;
  10237. this.tokens.push(token);
  10238. this.pending = '';
  10239. return token;
  10240. };
  10241. // Push new token to "stream".
  10242. // If pending text exists - flush it as text token
  10243. //
  10244. StateInline.prototype.push = function (type, tag, nesting) {
  10245. if (this.pending) {
  10246. this.pushPending();
  10247. }
  10248. var token = new Token(type, tag, nesting);
  10249. if (nesting < 0) { this.level--; }
  10250. token.level = this.level;
  10251. if (nesting > 0) { this.level++; }
  10252. this.pendingLevel = this.level;
  10253. this.tokens.push(token);
  10254. return token;
  10255. };
  10256. // Scan a sequence of emphasis-like markers, and determine whether
  10257. // it can start an emphasis sequence or end an emphasis sequence.
  10258. //
  10259. // - start - position to scan from (it should point at a valid marker);
  10260. // - canSplitWord - determine if these markers can be found inside a word
  10261. //
  10262. StateInline.prototype.scanDelims = function (start, canSplitWord) {
  10263. var pos = start, lastChar, nextChar, count, can_open, can_close,
  10264. isLastWhiteSpace, isLastPunctChar,
  10265. isNextWhiteSpace, isNextPunctChar,
  10266. left_flanking = true,
  10267. right_flanking = true,
  10268. max = this.posMax,
  10269. marker = this.src.charCodeAt(start);
  10270. // treat beginning of the line as a whitespace
  10271. lastChar = start > 0 ? this.src.charCodeAt(start - 1) : 0x20;
  10272. while (pos < max && this.src.charCodeAt(pos) === marker) { pos++; }
  10273. count = pos - start;
  10274. // treat end of the line as a whitespace
  10275. nextChar = pos < max ? this.src.charCodeAt(pos) : 0x20;
  10276. isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctChar(String.fromCharCode(lastChar));
  10277. isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctChar(String.fromCharCode(nextChar));
  10278. isLastWhiteSpace = isWhiteSpace(lastChar);
  10279. isNextWhiteSpace = isWhiteSpace(nextChar);
  10280. if (isNextWhiteSpace) {
  10281. left_flanking = false;
  10282. } else if (isNextPunctChar) {
  10283. if (!(isLastWhiteSpace || isLastPunctChar)) {
  10284. left_flanking = false;
  10285. }
  10286. }
  10287. if (isLastWhiteSpace) {
  10288. right_flanking = false;
  10289. } else if (isLastPunctChar) {
  10290. if (!(isNextWhiteSpace || isNextPunctChar)) {
  10291. right_flanking = false;
  10292. }
  10293. }
  10294. if (!canSplitWord) {
  10295. can_open = left_flanking && (!right_flanking || isLastPunctChar);
  10296. can_close = right_flanking && (!left_flanking || isNextPunctChar);
  10297. } else {
  10298. can_open = left_flanking;
  10299. can_close = right_flanking;
  10300. }
  10301. return {
  10302. can_open: can_open,
  10303. can_close: can_close,
  10304. length: count
  10305. };
  10306. };
  10307. // re-export Token class to use in block rules
  10308. StateInline.prototype.Token = Token;
  10309. module.exports = StateInline;
  10310. /***/ }),
  10311. /* 74 */
  10312. /***/ (function(module, exports, __webpack_require__) {
  10313. "use strict";
  10314. // Skip text characters for text token, place those to pending buffer
  10315. // and increment current pos
  10316. // Rule to skip pure text
  10317. // '{}$%@~+=:' reserved for extentions
  10318. // !, ", #, $, %, &, ', (, ), *, +, ,, -, ., /, :, ;, <, =, >, ?, @, [, \, ], ^, _, `, {, |, }, or ~
  10319. // !!!! Don't confuse with "Markdown ASCII Punctuation" chars
  10320. // http://spec.commonmark.org/0.15/#ascii-punctuation-character
  10321. function isTerminatorChar(ch) {
  10322. switch (ch) {
  10323. case 0x0A/* \n */:
  10324. case 0x21/* ! */:
  10325. case 0x23/* # */:
  10326. case 0x24/* $ */:
  10327. case 0x25/* % */:
  10328. case 0x26/* & */:
  10329. case 0x2A/* * */:
  10330. case 0x2B/* + */:
  10331. case 0x2D/* - */:
  10332. case 0x3A/* : */:
  10333. case 0x3C/* < */:
  10334. case 0x3D/* = */:
  10335. case 0x3E/* > */:
  10336. case 0x40/* @ */:
  10337. case 0x5B/* [ */:
  10338. case 0x5C/* \ */:
  10339. case 0x5D/* ] */:
  10340. case 0x5E/* ^ */:
  10341. case 0x5F/* _ */:
  10342. case 0x60/* ` */:
  10343. case 0x7B/* { */:
  10344. case 0x7D/* } */:
  10345. case 0x7E/* ~ */:
  10346. return true;
  10347. default:
  10348. return false;
  10349. }
  10350. }
  10351. module.exports = function text(state, silent) {
  10352. var pos = state.pos;
  10353. while (pos < state.posMax && !isTerminatorChar(state.src.charCodeAt(pos))) {
  10354. pos++;
  10355. }
  10356. if (pos === state.pos) { return false; }
  10357. if (!silent) { state.pending += state.src.slice(state.pos, pos); }
  10358. state.pos = pos;
  10359. return true;
  10360. };
  10361. // Alternative implementation, for memory.
  10362. //
  10363. // It costs 10% of performance, but allows extend terminators list, if place it
  10364. // to `ParcerInline` property. Probably, will switch to it sometime, such
  10365. // flexibility required.
  10366. /*
  10367. var TERMINATOR_RE = /[\n!#$%&*+\-:<=>@[\\\]^_`{}~]/;
  10368. module.exports = function text(state, silent) {
  10369. var pos = state.pos,
  10370. idx = state.src.slice(pos).search(TERMINATOR_RE);
  10371. // first char is terminator -> empty text
  10372. if (idx === 0) { return false; }
  10373. // no terminator -> text till end of string
  10374. if (idx < 0) {
  10375. if (!silent) { state.pending += state.src.slice(pos); }
  10376. state.pos = state.src.length;
  10377. return true;
  10378. }
  10379. if (!silent) { state.pending += state.src.slice(pos, pos + idx); }
  10380. state.pos += idx;
  10381. return true;
  10382. };*/
  10383. /***/ }),
  10384. /* 75 */
  10385. /***/ (function(module, exports, __webpack_require__) {
  10386. "use strict";
  10387. // Merge adjacent text nodes into one, and re-calculate all token levels
  10388. //
  10389. module.exports = function text_collapse(state) {
  10390. var curr, last,
  10391. level = 0,
  10392. tokens = state.tokens,
  10393. max = state.tokens.length;
  10394. for (curr = last = 0; curr < max; curr++) {
  10395. // re-calculate levels
  10396. level += tokens[curr].nesting;
  10397. tokens[curr].level = level;
  10398. if (tokens[curr].type === 'text' &&
  10399. curr + 1 < max &&
  10400. tokens[curr + 1].type === 'text') {
  10401. // collapse two adjacent text nodes
  10402. tokens[curr + 1].content = tokens[curr].content + tokens[curr + 1].content;
  10403. } else {
  10404. if (curr !== last) { tokens[last] = tokens[curr]; }
  10405. last++;
  10406. }
  10407. }
  10408. if (curr !== last) {
  10409. tokens.length = last;
  10410. }
  10411. };
  10412. /***/ }),
  10413. /* 76 */
  10414. /***/ (function(module, exports, __webpack_require__) {
  10415. "use strict";
  10416. /* eslint-disable no-bitwise */
  10417. var decodeCache = {};
  10418. function getDecodeCache(exclude) {
  10419. var i, ch, cache = decodeCache[exclude];
  10420. if (cache) { return cache; }
  10421. cache = decodeCache[exclude] = [];
  10422. for (i = 0; i < 128; i++) {
  10423. ch = String.fromCharCode(i);
  10424. cache.push(ch);
  10425. }
  10426. for (i = 0; i < exclude.length; i++) {
  10427. ch = exclude.charCodeAt(i);
  10428. cache[ch] = '%' + ('0' + ch.toString(16).toUpperCase()).slice(-2);
  10429. }
  10430. return cache;
  10431. }
  10432. // Decode percent-encoded string.
  10433. //
  10434. function decode(string, exclude) {
  10435. var cache;
  10436. if (typeof exclude !== 'string') {
  10437. exclude = decode.defaultChars;
  10438. }
  10439. cache = getDecodeCache(exclude);
  10440. return string.replace(/(%[a-f0-9]{2})+/gi, function(seq) {
  10441. var i, l, b1, b2, b3, b4, chr,
  10442. result = '';
  10443. for (i = 0, l = seq.length; i < l; i += 3) {
  10444. b1 = parseInt(seq.slice(i + 1, i + 3), 16);
  10445. if (b1 < 0x80) {
  10446. result += cache[b1];
  10447. continue;
  10448. }
  10449. if ((b1 & 0xE0) === 0xC0 && (i + 3 < l)) {
  10450. // 110xxxxx 10xxxxxx
  10451. b2 = parseInt(seq.slice(i + 4, i + 6), 16);
  10452. if ((b2 & 0xC0) === 0x80) {
  10453. chr = ((b1 << 6) & 0x7C0) | (b2 & 0x3F);
  10454. if (chr < 0x80) {
  10455. result += '\ufffd\ufffd';
  10456. } else {
  10457. result += String.fromCharCode(chr);
  10458. }
  10459. i += 3;
  10460. continue;
  10461. }
  10462. }
  10463. if ((b1 & 0xF0) === 0xE0 && (i + 6 < l)) {
  10464. // 1110xxxx 10xxxxxx 10xxxxxx
  10465. b2 = parseInt(seq.slice(i + 4, i + 6), 16);
  10466. b3 = parseInt(seq.slice(i + 7, i + 9), 16);
  10467. if ((b2 & 0xC0) === 0x80 && (b3 & 0xC0) === 0x80) {
  10468. chr = ((b1 << 12) & 0xF000) | ((b2 << 6) & 0xFC0) | (b3 & 0x3F);
  10469. if (chr < 0x800 || (chr >= 0xD800 && chr <= 0xDFFF)) {
  10470. result += '\ufffd\ufffd\ufffd';
  10471. } else {
  10472. result += String.fromCharCode(chr);
  10473. }
  10474. i += 6;
  10475. continue;
  10476. }
  10477. }
  10478. if ((b1 & 0xF8) === 0xF0 && (i + 9 < l)) {
  10479. // 111110xx 10xxxxxx 10xxxxxx 10xxxxxx
  10480. b2 = parseInt(seq.slice(i + 4, i + 6), 16);
  10481. b3 = parseInt(seq.slice(i + 7, i + 9), 16);
  10482. b4 = parseInt(seq.slice(i + 10, i + 12), 16);
  10483. if ((b2 & 0xC0) === 0x80 && (b3 & 0xC0) === 0x80 && (b4 & 0xC0) === 0x80) {
  10484. chr = ((b1 << 18) & 0x1C0000) | ((b2 << 12) & 0x3F000) | ((b3 << 6) & 0xFC0) | (b4 & 0x3F);
  10485. if (chr < 0x10000 || chr > 0x10FFFF) {
  10486. result += '\ufffd\ufffd\ufffd\ufffd';
  10487. } else {
  10488. chr -= 0x10000;
  10489. result += String.fromCharCode(0xD800 + (chr >> 10), 0xDC00 + (chr & 0x3FF));
  10490. }
  10491. i += 9;
  10492. continue;
  10493. }
  10494. }
  10495. result += '\ufffd';
  10496. }
  10497. return result;
  10498. });
  10499. }
  10500. decode.defaultChars = ';/?:@&=+$,#';
  10501. decode.componentChars = '';
  10502. module.exports = decode;
  10503. /***/ }),
  10504. /* 77 */
  10505. /***/ (function(module, exports, __webpack_require__) {
  10506. "use strict";
  10507. var encodeCache = {};
  10508. // Create a lookup array where anything but characters in `chars` string
  10509. // and alphanumeric chars is percent-encoded.
  10510. //
  10511. function getEncodeCache(exclude) {
  10512. var i, ch, cache = encodeCache[exclude];
  10513. if (cache) { return cache; }
  10514. cache = encodeCache[exclude] = [];
  10515. for (i = 0; i < 128; i++) {
  10516. ch = String.fromCharCode(i);
  10517. if (/^[0-9a-z]$/i.test(ch)) {
  10518. // always allow unencoded alphanumeric characters
  10519. cache.push(ch);
  10520. } else {
  10521. cache.push('%' + ('0' + i.toString(16).toUpperCase()).slice(-2));
  10522. }
  10523. }
  10524. for (i = 0; i < exclude.length; i++) {
  10525. cache[exclude.charCodeAt(i)] = exclude[i];
  10526. }
  10527. return cache;
  10528. }
  10529. // Encode unsafe characters with percent-encoding, skipping already
  10530. // encoded sequences.
  10531. //
  10532. // - string - string to encode
  10533. // - exclude - list of characters to ignore (in addition to a-zA-Z0-9)
  10534. // - keepEscaped - don't encode '%' in a correct escape sequence (default: true)
  10535. //
  10536. function encode(string, exclude, keepEscaped) {
  10537. var i, l, code, nextCode, cache,
  10538. result = '';
  10539. if (typeof exclude !== 'string') {
  10540. // encode(string, keepEscaped)
  10541. keepEscaped = exclude;
  10542. exclude = encode.defaultChars;
  10543. }
  10544. if (typeof keepEscaped === 'undefined') {
  10545. keepEscaped = true;
  10546. }
  10547. cache = getEncodeCache(exclude);
  10548. for (i = 0, l = string.length; i < l; i++) {
  10549. code = string.charCodeAt(i);
  10550. if (keepEscaped && code === 0x25 /* % */ && i + 2 < l) {
  10551. if (/^[0-9a-f]{2}$/i.test(string.slice(i + 1, i + 3))) {
  10552. result += string.slice(i, i + 3);
  10553. i += 2;
  10554. continue;
  10555. }
  10556. }
  10557. if (code < 128) {
  10558. result += cache[code];
  10559. continue;
  10560. }
  10561. if (code >= 0xD800 && code <= 0xDFFF) {
  10562. if (code >= 0xD800 && code <= 0xDBFF && i + 1 < l) {
  10563. nextCode = string.charCodeAt(i + 1);
  10564. if (nextCode >= 0xDC00 && nextCode <= 0xDFFF) {
  10565. result += encodeURIComponent(string[i] + string[i + 1]);
  10566. i++;
  10567. continue;
  10568. }
  10569. }
  10570. result += '%EF%BF%BD';
  10571. continue;
  10572. }
  10573. result += encodeURIComponent(string[i]);
  10574. }
  10575. return result;
  10576. }
  10577. encode.defaultChars = ";/?:@&=+$,-_.!~*'()#";
  10578. encode.componentChars = "-_.!~*'()";
  10579. module.exports = encode;
  10580. /***/ }),
  10581. /* 78 */
  10582. /***/ (function(module, exports, __webpack_require__) {
  10583. "use strict";
  10584. module.exports = function format(url) {
  10585. var result = '';
  10586. result += url.protocol || '';
  10587. result += url.slashes ? '//' : '';
  10588. result += url.auth ? url.auth + '@' : '';
  10589. if (url.hostname && url.hostname.indexOf(':') !== -1) {
  10590. // ipv6 address
  10591. result += '[' + url.hostname + ']';
  10592. } else {
  10593. result += url.hostname || '';
  10594. }
  10595. result += url.port ? ':' + url.port : '';
  10596. result += url.pathname || '';
  10597. result += url.search || '';
  10598. result += url.hash || '';
  10599. return result;
  10600. };
  10601. /***/ }),
  10602. /* 79 */
  10603. /***/ (function(module, exports, __webpack_require__) {
  10604. "use strict";
  10605. // Copyright Joyent, Inc. and other Node contributors.
  10606. //
  10607. // Permission is hereby granted, free of charge, to any person obtaining a
  10608. // copy of this software and associated documentation files (the
  10609. // "Software"), to deal in the Software without restriction, including
  10610. // without limitation the rights to use, copy, modify, merge, publish,
  10611. // distribute, sublicense, and/or sell copies of the Software, and to permit
  10612. // persons to whom the Software is furnished to do so, subject to the
  10613. // following conditions:
  10614. //
  10615. // The above copyright notice and this permission notice shall be included
  10616. // in all copies or substantial portions of the Software.
  10617. //
  10618. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  10619. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  10620. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  10621. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  10622. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  10623. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  10624. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  10625. //
  10626. // Changes from joyent/node:
  10627. //
  10628. // 1. No leading slash in paths,
  10629. // e.g. in `url.parse('http://foo?bar')` pathname is ``, not `/`
  10630. //
  10631. // 2. Backslashes are not replaced with slashes,
  10632. // so `http:\\example.org\` is treated like a relative path
  10633. //
  10634. // 3. Trailing colon is treated like a part of the path,
  10635. // i.e. in `http://example.org:foo` pathname is `:foo`
  10636. //
  10637. // 4. Nothing is URL-encoded in the resulting object,
  10638. // (in joyent/node some chars in auth and paths are encoded)
  10639. //
  10640. // 5. `url.parse()` does not have `parseQueryString` argument
  10641. //
  10642. // 6. Removed extraneous result properties: `host`, `path`, `query`, etc.,
  10643. // which can be constructed using other parts of the url.
  10644. //
  10645. function Url() {
  10646. this.protocol = null;
  10647. this.slashes = null;
  10648. this.auth = null;
  10649. this.port = null;
  10650. this.hostname = null;
  10651. this.hash = null;
  10652. this.search = null;
  10653. this.pathname = null;
  10654. }
  10655. // Reference: RFC 3986, RFC 1808, RFC 2396
  10656. // define these here so at least they only have to be
  10657. // compiled once on the first module load.
  10658. var protocolPattern = /^([a-z0-9.+-]+:)/i,
  10659. portPattern = /:[0-9]*$/,
  10660. // Special case for a simple path URL
  10661. simplePathPattern = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,
  10662. // RFC 2396: characters reserved for delimiting URLs.
  10663. // We actually just auto-escape these.
  10664. delims = [ '<', '>', '"', '`', ' ', '\r', '\n', '\t' ],
  10665. // RFC 2396: characters not allowed for various reasons.
  10666. unwise = [ '{', '}', '|', '\\', '^', '`' ].concat(delims),
  10667. // Allowed by RFCs, but cause of XSS attacks. Always escape these.
  10668. autoEscape = [ '\'' ].concat(unwise),
  10669. // Characters that are never ever allowed in a hostname.
  10670. // Note that any invalid chars are also handled, but these
  10671. // are the ones that are *expected* to be seen, so we fast-path
  10672. // them.
  10673. nonHostChars = [ '%', '/', '?', ';', '#' ].concat(autoEscape),
  10674. hostEndingChars = [ '/', '?', '#' ],
  10675. hostnameMaxLen = 255,
  10676. hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/,
  10677. hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/,
  10678. // protocols that can allow "unsafe" and "unwise" chars.
  10679. /* eslint-disable no-script-url */
  10680. // protocols that never have a hostname.
  10681. hostlessProtocol = {
  10682. 'javascript': true,
  10683. 'javascript:': true
  10684. },
  10685. // protocols that always contain a // bit.
  10686. slashedProtocol = {
  10687. 'http': true,
  10688. 'https': true,
  10689. 'ftp': true,
  10690. 'gopher': true,
  10691. 'file': true,
  10692. 'http:': true,
  10693. 'https:': true,
  10694. 'ftp:': true,
  10695. 'gopher:': true,
  10696. 'file:': true
  10697. };
  10698. /* eslint-enable no-script-url */
  10699. function urlParse(url, slashesDenoteHost) {
  10700. if (url && url instanceof Url) { return url; }
  10701. var u = new Url();
  10702. u.parse(url, slashesDenoteHost);
  10703. return u;
  10704. }
  10705. Url.prototype.parse = function(url, slashesDenoteHost) {
  10706. var i, l, lowerProto, hec, slashes,
  10707. rest = url;
  10708. // trim before proceeding.
  10709. // This is to support parse stuff like " http://foo.com \n"
  10710. rest = rest.trim();
  10711. if (!slashesDenoteHost && url.split('#').length === 1) {
  10712. // Try fast path regexp
  10713. var simplePath = simplePathPattern.exec(rest);
  10714. if (simplePath) {
  10715. this.pathname = simplePath[1];
  10716. if (simplePath[2]) {
  10717. this.search = simplePath[2];
  10718. }
  10719. return this;
  10720. }
  10721. }
  10722. var proto = protocolPattern.exec(rest);
  10723. if (proto) {
  10724. proto = proto[0];
  10725. lowerProto = proto.toLowerCase();
  10726. this.protocol = proto;
  10727. rest = rest.substr(proto.length);
  10728. }
  10729. // figure out if it's got a host
  10730. // user@server is *always* interpreted as a hostname, and url
  10731. // resolution will treat //foo/bar as host=foo,path=bar because that's
  10732. // how the browser resolves relative URLs.
  10733. if (slashesDenoteHost || proto || rest.match(/^\/\/[^@\/]+@[^@\/]+/)) {
  10734. slashes = rest.substr(0, 2) === '//';
  10735. if (slashes && !(proto && hostlessProtocol[proto])) {
  10736. rest = rest.substr(2);
  10737. this.slashes = true;
  10738. }
  10739. }
  10740. if (!hostlessProtocol[proto] &&
  10741. (slashes || (proto && !slashedProtocol[proto]))) {
  10742. // there's a hostname.
  10743. // the first instance of /, ?, ;, or # ends the host.
  10744. //
  10745. // If there is an @ in the hostname, then non-host chars *are* allowed
  10746. // to the left of the last @ sign, unless some host-ending character
  10747. // comes *before* the @-sign.
  10748. // URLs are obnoxious.
  10749. //
  10750. // ex:
  10751. // http://a@b@c/ => user:a@b host:c
  10752. // http://a@b?@c => user:a host:c path:/?@c
  10753. // v0.12 TODO(isaacs): This is not quite how Chrome does things.
  10754. // Review our test case against browsers more comprehensively.
  10755. // find the first instance of any hostEndingChars
  10756. var hostEnd = -1;
  10757. for (i = 0; i < hostEndingChars.length; i++) {
  10758. hec = rest.indexOf(hostEndingChars[i]);
  10759. if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) {
  10760. hostEnd = hec;
  10761. }
  10762. }
  10763. // at this point, either we have an explicit point where the
  10764. // auth portion cannot go past, or the last @ char is the decider.
  10765. var auth, atSign;
  10766. if (hostEnd === -1) {
  10767. // atSign can be anywhere.
  10768. atSign = rest.lastIndexOf('@');
  10769. } else {
  10770. // atSign must be in auth portion.
  10771. // http://a@b/c@d => host:b auth:a path:/c@d
  10772. atSign = rest.lastIndexOf('@', hostEnd);
  10773. }
  10774. // Now we have a portion which is definitely the auth.
  10775. // Pull that off.
  10776. if (atSign !== -1) {
  10777. auth = rest.slice(0, atSign);
  10778. rest = rest.slice(atSign + 1);
  10779. this.auth = auth;
  10780. }
  10781. // the host is the remaining to the left of the first non-host char
  10782. hostEnd = -1;
  10783. for (i = 0; i < nonHostChars.length; i++) {
  10784. hec = rest.indexOf(nonHostChars[i]);
  10785. if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) {
  10786. hostEnd = hec;
  10787. }
  10788. }
  10789. // if we still have not hit it, then the entire thing is a host.
  10790. if (hostEnd === -1) {
  10791. hostEnd = rest.length;
  10792. }
  10793. if (rest[hostEnd - 1] === ':') { hostEnd--; }
  10794. var host = rest.slice(0, hostEnd);
  10795. rest = rest.slice(hostEnd);
  10796. // pull out port.
  10797. this.parseHost(host);
  10798. // we've indicated that there is a hostname,
  10799. // so even if it's empty, it has to be present.
  10800. this.hostname = this.hostname || '';
  10801. // if hostname begins with [ and ends with ]
  10802. // assume that it's an IPv6 address.
  10803. var ipv6Hostname = this.hostname[0] === '[' &&
  10804. this.hostname[this.hostname.length - 1] === ']';
  10805. // validate a little.
  10806. if (!ipv6Hostname) {
  10807. var hostparts = this.hostname.split(/\./);
  10808. for (i = 0, l = hostparts.length; i < l; i++) {
  10809. var part = hostparts[i];
  10810. if (!part) { continue; }
  10811. if (!part.match(hostnamePartPattern)) {
  10812. var newpart = '';
  10813. for (var j = 0, k = part.length; j < k; j++) {
  10814. if (part.charCodeAt(j) > 127) {
  10815. // we replace non-ASCII char with a temporary placeholder
  10816. // we need this to make sure size of hostname is not
  10817. // broken by replacing non-ASCII by nothing
  10818. newpart += 'x';
  10819. } else {
  10820. newpart += part[j];
  10821. }
  10822. }
  10823. // we test again with ASCII char only
  10824. if (!newpart.match(hostnamePartPattern)) {
  10825. var validParts = hostparts.slice(0, i);
  10826. var notHost = hostparts.slice(i + 1);
  10827. var bit = part.match(hostnamePartStart);
  10828. if (bit) {
  10829. validParts.push(bit[1]);
  10830. notHost.unshift(bit[2]);
  10831. }
  10832. if (notHost.length) {
  10833. rest = notHost.join('.') + rest;
  10834. }
  10835. this.hostname = validParts.join('.');
  10836. break;
  10837. }
  10838. }
  10839. }
  10840. }
  10841. if (this.hostname.length > hostnameMaxLen) {
  10842. this.hostname = '';
  10843. }
  10844. // strip [ and ] from the hostname
  10845. // the host field still retains them, though
  10846. if (ipv6Hostname) {
  10847. this.hostname = this.hostname.substr(1, this.hostname.length - 2);
  10848. }
  10849. }
  10850. // chop off from the tail first.
  10851. var hash = rest.indexOf('#');
  10852. if (hash !== -1) {
  10853. // got a fragment string.
  10854. this.hash = rest.substr(hash);
  10855. rest = rest.slice(0, hash);
  10856. }
  10857. var qm = rest.indexOf('?');
  10858. if (qm !== -1) {
  10859. this.search = rest.substr(qm);
  10860. rest = rest.slice(0, qm);
  10861. }
  10862. if (rest) { this.pathname = rest; }
  10863. if (slashedProtocol[lowerProto] &&
  10864. this.hostname && !this.pathname) {
  10865. this.pathname = '';
  10866. }
  10867. return this;
  10868. };
  10869. Url.prototype.parseHost = function(host) {
  10870. var port = portPattern.exec(host);
  10871. if (port) {
  10872. port = port[0];
  10873. if (port !== ':') {
  10874. this.port = port.substr(1);
  10875. }
  10876. host = host.substr(0, host.length - port.length);
  10877. }
  10878. if (host) { this.hostname = host; }
  10879. };
  10880. module.exports = urlParse;
  10881. /***/ }),
  10882. /* 80 */
  10883. /***/ (function(module, exports) {
  10884. // shim for using process in browser
  10885. var process = module.exports = {};
  10886. // cached from whatever global is present so that test runners that stub it
  10887. // don't break things. But we need to wrap it in a try catch in case it is
  10888. // wrapped in strict mode code which doesn't define any globals. It's inside a
  10889. // function because try/catches deoptimize in certain engines.
  10890. var cachedSetTimeout;
  10891. var cachedClearTimeout;
  10892. function defaultSetTimout() {
  10893. throw new Error('setTimeout has not been defined');
  10894. }
  10895. function defaultClearTimeout () {
  10896. throw new Error('clearTimeout has not been defined');
  10897. }
  10898. (function () {
  10899. try {
  10900. if (typeof setTimeout === 'function') {
  10901. cachedSetTimeout = setTimeout;
  10902. } else {
  10903. cachedSetTimeout = defaultSetTimout;
  10904. }
  10905. } catch (e) {
  10906. cachedSetTimeout = defaultSetTimout;
  10907. }
  10908. try {
  10909. if (typeof clearTimeout === 'function') {
  10910. cachedClearTimeout = clearTimeout;
  10911. } else {
  10912. cachedClearTimeout = defaultClearTimeout;
  10913. }
  10914. } catch (e) {
  10915. cachedClearTimeout = defaultClearTimeout;
  10916. }
  10917. } ())
  10918. function runTimeout(fun) {
  10919. if (cachedSetTimeout === setTimeout) {
  10920. //normal enviroments in sane situations
  10921. return setTimeout(fun, 0);
  10922. }
  10923. // if setTimeout wasn't available but was latter defined
  10924. if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
  10925. cachedSetTimeout = setTimeout;
  10926. return setTimeout(fun, 0);
  10927. }
  10928. try {
  10929. // when when somebody has screwed with setTimeout but no I.E. maddness
  10930. return cachedSetTimeout(fun, 0);
  10931. } catch(e){
  10932. try {
  10933. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  10934. return cachedSetTimeout.call(null, fun, 0);
  10935. } catch(e){
  10936. // 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
  10937. return cachedSetTimeout.call(this, fun, 0);
  10938. }
  10939. }
  10940. }
  10941. function runClearTimeout(marker) {
  10942. if (cachedClearTimeout === clearTimeout) {
  10943. //normal enviroments in sane situations
  10944. return clearTimeout(marker);
  10945. }
  10946. // if clearTimeout wasn't available but was latter defined
  10947. if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
  10948. cachedClearTimeout = clearTimeout;
  10949. return clearTimeout(marker);
  10950. }
  10951. try {
  10952. // when when somebody has screwed with setTimeout but no I.E. maddness
  10953. return cachedClearTimeout(marker);
  10954. } catch (e){
  10955. try {
  10956. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  10957. return cachedClearTimeout.call(null, marker);
  10958. } catch (e){
  10959. // 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.
  10960. // Some versions of I.E. have different rules for clearTimeout vs setTimeout
  10961. return cachedClearTimeout.call(this, marker);
  10962. }
  10963. }
  10964. }
  10965. var queue = [];
  10966. var draining = false;
  10967. var currentQueue;
  10968. var queueIndex = -1;
  10969. function cleanUpNextTick() {
  10970. if (!draining || !currentQueue) {
  10971. return;
  10972. }
  10973. draining = false;
  10974. if (currentQueue.length) {
  10975. queue = currentQueue.concat(queue);
  10976. } else {
  10977. queueIndex = -1;
  10978. }
  10979. if (queue.length) {
  10980. drainQueue();
  10981. }
  10982. }
  10983. function drainQueue() {
  10984. if (draining) {
  10985. return;
  10986. }
  10987. var timeout = runTimeout(cleanUpNextTick);
  10988. draining = true;
  10989. var len = queue.length;
  10990. while(len) {
  10991. currentQueue = queue;
  10992. queue = [];
  10993. while (++queueIndex < len) {
  10994. if (currentQueue) {
  10995. currentQueue[queueIndex].run();
  10996. }
  10997. }
  10998. queueIndex = -1;
  10999. len = queue.length;
  11000. }
  11001. currentQueue = null;
  11002. draining = false;
  11003. runClearTimeout(timeout);
  11004. }
  11005. process.nextTick = function (fun) {
  11006. var args = new Array(arguments.length - 1);
  11007. if (arguments.length > 1) {
  11008. for (var i = 1; i < arguments.length; i++) {
  11009. args[i - 1] = arguments[i];
  11010. }
  11011. }
  11012. queue.push(new Item(fun, args));
  11013. if (queue.length === 1 && !draining) {
  11014. runTimeout(drainQueue);
  11015. }
  11016. };
  11017. // v8 likes predictible objects
  11018. function Item(fun, array) {
  11019. this.fun = fun;
  11020. this.array = array;
  11021. }
  11022. Item.prototype.run = function () {
  11023. this.fun.apply(null, this.array);
  11024. };
  11025. process.title = 'browser';
  11026. process.browser = true;
  11027. process.env = {};
  11028. process.argv = [];
  11029. process.version = ''; // empty string to avoid regexp issues
  11030. process.versions = {};
  11031. function noop() {}
  11032. process.on = noop;
  11033. process.addListener = noop;
  11034. process.once = noop;
  11035. process.off = noop;
  11036. process.removeListener = noop;
  11037. process.removeAllListeners = noop;
  11038. process.emit = noop;
  11039. process.binding = function (name) {
  11040. throw new Error('process.binding is not supported');
  11041. };
  11042. process.cwd = function () { return '/' };
  11043. process.chdir = function (dir) {
  11044. throw new Error('process.chdir is not supported');
  11045. };
  11046. process.umask = function() { return 0; };
  11047. /***/ }),
  11048. /* 81 */
  11049. /***/ (function(module, exports, __webpack_require__) {
  11050. /* WEBPACK VAR INJECTION */(function(module, global) {var __WEBPACK_AMD_DEFINE_RESULT__;/*! https://mths.be/punycode v1.4.1 by @mathias */
  11051. ;(function(root) {
  11052. /** Detect free variables */
  11053. var freeExports = typeof exports == 'object' && exports &&
  11054. !exports.nodeType && exports;
  11055. var freeModule = typeof module == 'object' && module &&
  11056. !module.nodeType && module;
  11057. var freeGlobal = typeof global == 'object' && global;
  11058. if (
  11059. freeGlobal.global === freeGlobal ||
  11060. freeGlobal.window === freeGlobal ||
  11061. freeGlobal.self === freeGlobal
  11062. ) {
  11063. root = freeGlobal;
  11064. }
  11065. /**
  11066. * The `punycode` object.
  11067. * @name punycode
  11068. * @type Object
  11069. */
  11070. var punycode,
  11071. /** Highest positive signed 32-bit float value */
  11072. maxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1
  11073. /** Bootstring parameters */
  11074. base = 36,
  11075. tMin = 1,
  11076. tMax = 26,
  11077. skew = 38,
  11078. damp = 700,
  11079. initialBias = 72,
  11080. initialN = 128, // 0x80
  11081. delimiter = '-', // '\x2D'
  11082. /** Regular expressions */
  11083. regexPunycode = /^xn--/,
  11084. regexNonASCII = /[^\x20-\x7E]/, // unprintable ASCII chars + non-ASCII chars
  11085. regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g, // RFC 3490 separators
  11086. /** Error messages */
  11087. errors = {
  11088. 'overflow': 'Overflow: input needs wider integers to process',
  11089. 'not-basic': 'Illegal input >= 0x80 (not a basic code point)',
  11090. 'invalid-input': 'Invalid input'
  11091. },
  11092. /** Convenience shortcuts */
  11093. baseMinusTMin = base - tMin,
  11094. floor = Math.floor,
  11095. stringFromCharCode = String.fromCharCode,
  11096. /** Temporary variable */
  11097. key;
  11098. /*--------------------------------------------------------------------------*/
  11099. /**
  11100. * A generic error utility function.
  11101. * @private
  11102. * @param {String} type The error type.
  11103. * @returns {Error} Throws a `RangeError` with the applicable error message.
  11104. */
  11105. function error(type) {
  11106. throw new RangeError(errors[type]);
  11107. }
  11108. /**
  11109. * A generic `Array#map` utility function.
  11110. * @private
  11111. * @param {Array} array The array to iterate over.
  11112. * @param {Function} callback The function that gets called for every array
  11113. * item.
  11114. * @returns {Array} A new array of values returned by the callback function.
  11115. */
  11116. function map(array, fn) {
  11117. var length = array.length;
  11118. var result = [];
  11119. while (length--) {
  11120. result[length] = fn(array[length]);
  11121. }
  11122. return result;
  11123. }
  11124. /**
  11125. * A simple `Array#map`-like wrapper to work with domain name strings or email
  11126. * addresses.
  11127. * @private
  11128. * @param {String} domain The domain name or email address.
  11129. * @param {Function} callback The function that gets called for every
  11130. * character.
  11131. * @returns {Array} A new string of characters returned by the callback
  11132. * function.
  11133. */
  11134. function mapDomain(string, fn) {
  11135. var parts = string.split('@');
  11136. var result = '';
  11137. if (parts.length > 1) {
  11138. // In email addresses, only the domain name should be punycoded. Leave
  11139. // the local part (i.e. everything up to `@`) intact.
  11140. result = parts[0] + '@';
  11141. string = parts[1];
  11142. }
  11143. // Avoid `split(regex)` for IE8 compatibility. See #17.
  11144. string = string.replace(regexSeparators, '\x2E');
  11145. var labels = string.split('.');
  11146. var encoded = map(labels, fn).join('.');
  11147. return result + encoded;
  11148. }
  11149. /**
  11150. * Creates an array containing the numeric code points of each Unicode
  11151. * character in the string. While JavaScript uses UCS-2 internally,
  11152. * this function will convert a pair of surrogate halves (each of which
  11153. * UCS-2 exposes as separate characters) into a single code point,
  11154. * matching UTF-16.
  11155. * @see `punycode.ucs2.encode`
  11156. * @see <https://mathiasbynens.be/notes/javascript-encoding>
  11157. * @memberOf punycode.ucs2
  11158. * @name decode
  11159. * @param {String} string The Unicode input string (UCS-2).
  11160. * @returns {Array} The new array of code points.
  11161. */
  11162. function ucs2decode(string) {
  11163. var output = [],
  11164. counter = 0,
  11165. length = string.length,
  11166. value,
  11167. extra;
  11168. while (counter < length) {
  11169. value = string.charCodeAt(counter++);
  11170. if (value >= 0xD800 && value <= 0xDBFF && counter < length) {
  11171. // high surrogate, and there is a next character
  11172. extra = string.charCodeAt(counter++);
  11173. if ((extra & 0xFC00) == 0xDC00) { // low surrogate
  11174. output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
  11175. } else {
  11176. // unmatched surrogate; only append this code unit, in case the next
  11177. // code unit is the high surrogate of a surrogate pair
  11178. output.push(value);
  11179. counter--;
  11180. }
  11181. } else {
  11182. output.push(value);
  11183. }
  11184. }
  11185. return output;
  11186. }
  11187. /**
  11188. * Creates a string based on an array of numeric code points.
  11189. * @see `punycode.ucs2.decode`
  11190. * @memberOf punycode.ucs2
  11191. * @name encode
  11192. * @param {Array} codePoints The array of numeric code points.
  11193. * @returns {String} The new Unicode string (UCS-2).
  11194. */
  11195. function ucs2encode(array) {
  11196. return map(array, function(value) {
  11197. var output = '';
  11198. if (value > 0xFFFF) {
  11199. value -= 0x10000;
  11200. output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);
  11201. value = 0xDC00 | value & 0x3FF;
  11202. }
  11203. output += stringFromCharCode(value);
  11204. return output;
  11205. }).join('');
  11206. }
  11207. /**
  11208. * Converts a basic code point into a digit/integer.
  11209. * @see `digitToBasic()`
  11210. * @private
  11211. * @param {Number} codePoint The basic numeric code point value.
  11212. * @returns {Number} The numeric value of a basic code point (for use in
  11213. * representing integers) in the range `0` to `base - 1`, or `base` if
  11214. * the code point does not represent a value.
  11215. */
  11216. function basicToDigit(codePoint) {
  11217. if (codePoint - 48 < 10) {
  11218. return codePoint - 22;
  11219. }
  11220. if (codePoint - 65 < 26) {
  11221. return codePoint - 65;
  11222. }
  11223. if (codePoint - 97 < 26) {
  11224. return codePoint - 97;
  11225. }
  11226. return base;
  11227. }
  11228. /**
  11229. * Converts a digit/integer into a basic code point.
  11230. * @see `basicToDigit()`
  11231. * @private
  11232. * @param {Number} digit The numeric value of a basic code point.
  11233. * @returns {Number} The basic code point whose value (when used for
  11234. * representing integers) is `digit`, which needs to be in the range
  11235. * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is
  11236. * used; else, the lowercase form is used. The behavior is undefined
  11237. * if `flag` is non-zero and `digit` has no uppercase form.
  11238. */
  11239. function digitToBasic(digit, flag) {
  11240. // 0..25 map to ASCII a..z or A..Z
  11241. // 26..35 map to ASCII 0..9
  11242. return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);
  11243. }
  11244. /**
  11245. * Bias adaptation function as per section 3.4 of RFC 3492.
  11246. * https://tools.ietf.org/html/rfc3492#section-3.4
  11247. * @private
  11248. */
  11249. function adapt(delta, numPoints, firstTime) {
  11250. var k = 0;
  11251. delta = firstTime ? floor(delta / damp) : delta >> 1;
  11252. delta += floor(delta / numPoints);
  11253. for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {
  11254. delta = floor(delta / baseMinusTMin);
  11255. }
  11256. return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));
  11257. }
  11258. /**
  11259. * Converts a Punycode string of ASCII-only symbols to a string of Unicode
  11260. * symbols.
  11261. * @memberOf punycode
  11262. * @param {String} input The Punycode string of ASCII-only symbols.
  11263. * @returns {String} The resulting string of Unicode symbols.
  11264. */
  11265. function decode(input) {
  11266. // Don't use UCS-2
  11267. var output = [],
  11268. inputLength = input.length,
  11269. out,
  11270. i = 0,
  11271. n = initialN,
  11272. bias = initialBias,
  11273. basic,
  11274. j,
  11275. index,
  11276. oldi,
  11277. w,
  11278. k,
  11279. digit,
  11280. t,
  11281. /** Cached calculation results */
  11282. baseMinusT;
  11283. // Handle the basic code points: let `basic` be the number of input code
  11284. // points before the last delimiter, or `0` if there is none, then copy
  11285. // the first basic code points to the output.
  11286. basic = input.lastIndexOf(delimiter);
  11287. if (basic < 0) {
  11288. basic = 0;
  11289. }
  11290. for (j = 0; j < basic; ++j) {
  11291. // if it's not a basic code point
  11292. if (input.charCodeAt(j) >= 0x80) {
  11293. error('not-basic');
  11294. }
  11295. output.push(input.charCodeAt(j));
  11296. }
  11297. // Main decoding loop: start just after the last delimiter if any basic code
  11298. // points were copied; start at the beginning otherwise.
  11299. for (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {
  11300. // `index` is the index of the next character to be consumed.
  11301. // Decode a generalized variable-length integer into `delta`,
  11302. // which gets added to `i`. The overflow checking is easier
  11303. // if we increase `i` as we go, then subtract off its starting
  11304. // value at the end to obtain `delta`.
  11305. for (oldi = i, w = 1, k = base; /* no condition */; k += base) {
  11306. if (index >= inputLength) {
  11307. error('invalid-input');
  11308. }
  11309. digit = basicToDigit(input.charCodeAt(index++));
  11310. if (digit >= base || digit > floor((maxInt - i) / w)) {
  11311. error('overflow');
  11312. }
  11313. i += digit * w;
  11314. t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);
  11315. if (digit < t) {
  11316. break;
  11317. }
  11318. baseMinusT = base - t;
  11319. if (w > floor(maxInt / baseMinusT)) {
  11320. error('overflow');
  11321. }
  11322. w *= baseMinusT;
  11323. }
  11324. out = output.length + 1;
  11325. bias = adapt(i - oldi, out, oldi == 0);
  11326. // `i` was supposed to wrap around from `out` to `0`,
  11327. // incrementing `n` each time, so we'll fix that now:
  11328. if (floor(i / out) > maxInt - n) {
  11329. error('overflow');
  11330. }
  11331. n += floor(i / out);
  11332. i %= out;
  11333. // Insert `n` at position `i` of the output
  11334. output.splice(i++, 0, n);
  11335. }
  11336. return ucs2encode(output);
  11337. }
  11338. /**
  11339. * Converts a string of Unicode symbols (e.g. a domain name label) to a
  11340. * Punycode string of ASCII-only symbols.
  11341. * @memberOf punycode
  11342. * @param {String} input The string of Unicode symbols.
  11343. * @returns {String} The resulting Punycode string of ASCII-only symbols.
  11344. */
  11345. function encode(input) {
  11346. var n,
  11347. delta,
  11348. handledCPCount,
  11349. basicLength,
  11350. bias,
  11351. j,
  11352. m,
  11353. q,
  11354. k,
  11355. t,
  11356. currentValue,
  11357. output = [],
  11358. /** `inputLength` will hold the number of code points in `input`. */
  11359. inputLength,
  11360. /** Cached calculation results */
  11361. handledCPCountPlusOne,
  11362. baseMinusT,
  11363. qMinusT;
  11364. // Convert the input in UCS-2 to Unicode
  11365. input = ucs2decode(input);
  11366. // Cache the length
  11367. inputLength = input.length;
  11368. // Initialize the state
  11369. n = initialN;
  11370. delta = 0;
  11371. bias = initialBias;
  11372. // Handle the basic code points
  11373. for (j = 0; j < inputLength; ++j) {
  11374. currentValue = input[j];
  11375. if (currentValue < 0x80) {
  11376. output.push(stringFromCharCode(currentValue));
  11377. }
  11378. }
  11379. handledCPCount = basicLength = output.length;
  11380. // `handledCPCount` is the number of code points that have been handled;
  11381. // `basicLength` is the number of basic code points.
  11382. // Finish the basic string - if it is not empty - with a delimiter
  11383. if (basicLength) {
  11384. output.push(delimiter);
  11385. }
  11386. // Main encoding loop:
  11387. while (handledCPCount < inputLength) {
  11388. // All non-basic code points < n have been handled already. Find the next
  11389. // larger one:
  11390. for (m = maxInt, j = 0; j < inputLength; ++j) {
  11391. currentValue = input[j];
  11392. if (currentValue >= n && currentValue < m) {
  11393. m = currentValue;
  11394. }
  11395. }
  11396. // Increase `delta` enough to advance the decoder's <n,i> state to <m,0>,
  11397. // but guard against overflow
  11398. handledCPCountPlusOne = handledCPCount + 1;
  11399. if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {
  11400. error('overflow');
  11401. }
  11402. delta += (m - n) * handledCPCountPlusOne;
  11403. n = m;
  11404. for (j = 0; j < inputLength; ++j) {
  11405. currentValue = input[j];
  11406. if (currentValue < n && ++delta > maxInt) {
  11407. error('overflow');
  11408. }
  11409. if (currentValue == n) {
  11410. // Represent delta as a generalized variable-length integer
  11411. for (q = delta, k = base; /* no condition */; k += base) {
  11412. t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);
  11413. if (q < t) {
  11414. break;
  11415. }
  11416. qMinusT = q - t;
  11417. baseMinusT = base - t;
  11418. output.push(
  11419. stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))
  11420. );
  11421. q = floor(qMinusT / baseMinusT);
  11422. }
  11423. output.push(stringFromCharCode(digitToBasic(q, 0)));
  11424. bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);
  11425. delta = 0;
  11426. ++handledCPCount;
  11427. }
  11428. }
  11429. ++delta;
  11430. ++n;
  11431. }
  11432. return output.join('');
  11433. }
  11434. /**
  11435. * Converts a Punycode string representing a domain name or an email address
  11436. * to Unicode. Only the Punycoded parts of the input will be converted, i.e.
  11437. * it doesn't matter if you call it on a string that has already been
  11438. * converted to Unicode.
  11439. * @memberOf punycode
  11440. * @param {String} input The Punycoded domain name or email address to
  11441. * convert to Unicode.
  11442. * @returns {String} The Unicode representation of the given Punycode
  11443. * string.
  11444. */
  11445. function toUnicode(input) {
  11446. return mapDomain(input, function(string) {
  11447. return regexPunycode.test(string)
  11448. ? decode(string.slice(4).toLowerCase())
  11449. : string;
  11450. });
  11451. }
  11452. /**
  11453. * Converts a Unicode string representing a domain name or an email address to
  11454. * Punycode. Only the non-ASCII parts of the domain name will be converted,
  11455. * i.e. it doesn't matter if you call it with a domain that's already in
  11456. * ASCII.
  11457. * @memberOf punycode
  11458. * @param {String} input The domain name or email address to convert, as a
  11459. * Unicode string.
  11460. * @returns {String} The Punycode representation of the given domain name or
  11461. * email address.
  11462. */
  11463. function toASCII(input) {
  11464. return mapDomain(input, function(string) {
  11465. return regexNonASCII.test(string)
  11466. ? 'xn--' + encode(string)
  11467. : string;
  11468. });
  11469. }
  11470. /*--------------------------------------------------------------------------*/
  11471. /** Define the public API */
  11472. punycode = {
  11473. /**
  11474. * A string representing the current Punycode.js version number.
  11475. * @memberOf punycode
  11476. * @type String
  11477. */
  11478. 'version': '1.4.1',
  11479. /**
  11480. * An object of methods to convert from JavaScript's internal character
  11481. * representation (UCS-2) to Unicode code points, and back.
  11482. * @see <https://mathiasbynens.be/notes/javascript-encoding>
  11483. * @memberOf punycode
  11484. * @type Object
  11485. */
  11486. 'ucs2': {
  11487. 'decode': ucs2decode,
  11488. 'encode': ucs2encode
  11489. },
  11490. 'decode': decode,
  11491. 'encode': encode,
  11492. 'toASCII': toASCII,
  11493. 'toUnicode': toUnicode
  11494. };
  11495. /** Expose `punycode` */
  11496. // Some AMD build optimizers, like r.js, check for specific condition patterns
  11497. // like the following:
  11498. if (
  11499. true
  11500. ) {
  11501. !(__WEBPACK_AMD_DEFINE_RESULT__ = function() {
  11502. return punycode;
  11503. }.call(exports, __webpack_require__, exports, module),
  11504. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  11505. } else if (freeExports && freeModule) {
  11506. if (module.exports == freeExports) {
  11507. // in Node.js, io.js, or RingoJS v0.8.0+
  11508. freeModule.exports = punycode;
  11509. } else {
  11510. // in Narwhal or RingoJS v0.7.0-
  11511. for (key in punycode) {
  11512. punycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]);
  11513. }
  11514. }
  11515. } else {
  11516. // in Rhino or a web browser
  11517. root.punycode = punycode;
  11518. }
  11519. }(this));
  11520. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(86)(module), __webpack_require__(6)))
  11521. /***/ }),
  11522. /* 82 */
  11523. /***/ (function(module, exports, __webpack_require__) {
  11524. /* WEBPACK VAR INJECTION */(function(global, process) {(function (global, undefined) {
  11525. "use strict";
  11526. if (global.setImmediate) {
  11527. return;
  11528. }
  11529. var nextHandle = 1; // Spec says greater than zero
  11530. var tasksByHandle = {};
  11531. var currentlyRunningATask = false;
  11532. var doc = global.document;
  11533. var registerImmediate;
  11534. function setImmediate(callback) {
  11535. // Callback can either be a function or a string
  11536. if (typeof callback !== "function") {
  11537. callback = new Function("" + callback);
  11538. }
  11539. // Copy function arguments
  11540. var args = new Array(arguments.length - 1);
  11541. for (var i = 0; i < args.length; i++) {
  11542. args[i] = arguments[i + 1];
  11543. }
  11544. // Store and register the task
  11545. var task = { callback: callback, args: args };
  11546. tasksByHandle[nextHandle] = task;
  11547. registerImmediate(nextHandle);
  11548. return nextHandle++;
  11549. }
  11550. function clearImmediate(handle) {
  11551. delete tasksByHandle[handle];
  11552. }
  11553. function run(task) {
  11554. var callback = task.callback;
  11555. var args = task.args;
  11556. switch (args.length) {
  11557. case 0:
  11558. callback();
  11559. break;
  11560. case 1:
  11561. callback(args[0]);
  11562. break;
  11563. case 2:
  11564. callback(args[0], args[1]);
  11565. break;
  11566. case 3:
  11567. callback(args[0], args[1], args[2]);
  11568. break;
  11569. default:
  11570. callback.apply(undefined, args);
  11571. break;
  11572. }
  11573. }
  11574. function runIfPresent(handle) {
  11575. // From the spec: "Wait until any invocations of this algorithm started before this one have completed."
  11576. // So if we're currently running a task, we'll need to delay this invocation.
  11577. if (currentlyRunningATask) {
  11578. // Delay by doing a setTimeout. setImmediate was tried instead, but in Firefox 7 it generated a
  11579. // "too much recursion" error.
  11580. setTimeout(runIfPresent, 0, handle);
  11581. } else {
  11582. var task = tasksByHandle[handle];
  11583. if (task) {
  11584. currentlyRunningATask = true;
  11585. try {
  11586. run(task);
  11587. } finally {
  11588. clearImmediate(handle);
  11589. currentlyRunningATask = false;
  11590. }
  11591. }
  11592. }
  11593. }
  11594. function installNextTickImplementation() {
  11595. registerImmediate = function(handle) {
  11596. process.nextTick(function () { runIfPresent(handle); });
  11597. };
  11598. }
  11599. function canUsePostMessage() {
  11600. // The test against `importScripts` prevents this implementation from being installed inside a web worker,
  11601. // where `global.postMessage` means something completely different and can't be used for this purpose.
  11602. if (global.postMessage && !global.importScripts) {
  11603. var postMessageIsAsynchronous = true;
  11604. var oldOnMessage = global.onmessage;
  11605. global.onmessage = function() {
  11606. postMessageIsAsynchronous = false;
  11607. };
  11608. global.postMessage("", "*");
  11609. global.onmessage = oldOnMessage;
  11610. return postMessageIsAsynchronous;
  11611. }
  11612. }
  11613. function installPostMessageImplementation() {
  11614. // Installs an event handler on `global` for the `message` event: see
  11615. // * https://developer.mozilla.org/en/DOM/window.postMessage
  11616. // * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages
  11617. var messagePrefix = "setImmediate$" + Math.random() + "$";
  11618. var onGlobalMessage = function(event) {
  11619. if (event.source === global &&
  11620. typeof event.data === "string" &&
  11621. event.data.indexOf(messagePrefix) === 0) {
  11622. runIfPresent(+event.data.slice(messagePrefix.length));
  11623. }
  11624. };
  11625. if (global.addEventListener) {
  11626. global.addEventListener("message", onGlobalMessage, false);
  11627. } else {
  11628. global.attachEvent("onmessage", onGlobalMessage);
  11629. }
  11630. registerImmediate = function(handle) {
  11631. global.postMessage(messagePrefix + handle, "*");
  11632. };
  11633. }
  11634. function installMessageChannelImplementation() {
  11635. var channel = new MessageChannel();
  11636. channel.port1.onmessage = function(event) {
  11637. var handle = event.data;
  11638. runIfPresent(handle);
  11639. };
  11640. registerImmediate = function(handle) {
  11641. channel.port2.postMessage(handle);
  11642. };
  11643. }
  11644. function installReadyStateChangeImplementation() {
  11645. var html = doc.documentElement;
  11646. registerImmediate = function(handle) {
  11647. // Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted
  11648. // into the document. Do so, thus queuing up the task. Remember to clean up once it's been called.
  11649. var script = doc.createElement("script");
  11650. script.onreadystatechange = function () {
  11651. runIfPresent(handle);
  11652. script.onreadystatechange = null;
  11653. html.removeChild(script);
  11654. script = null;
  11655. };
  11656. html.appendChild(script);
  11657. };
  11658. }
  11659. function installSetTimeoutImplementation() {
  11660. registerImmediate = function(handle) {
  11661. setTimeout(runIfPresent, 0, handle);
  11662. };
  11663. }
  11664. // If supported, we should attach to the prototype of global, since that is where setTimeout et al. live.
  11665. var attachTo = Object.getPrototypeOf && Object.getPrototypeOf(global);
  11666. attachTo = attachTo && attachTo.setTimeout ? attachTo : global;
  11667. // Don't get fooled by e.g. browserify environments.
  11668. if ({}.toString.call(global.process) === "[object process]") {
  11669. // For Node.js before 0.9
  11670. installNextTickImplementation();
  11671. } else if (canUsePostMessage()) {
  11672. // For non-IE10 modern browsers
  11673. installPostMessageImplementation();
  11674. } else if (global.MessageChannel) {
  11675. // For web workers, where supported
  11676. installMessageChannelImplementation();
  11677. } else if (doc && "onreadystatechange" in doc.createElement("script")) {
  11678. // For IE 6–8
  11679. installReadyStateChangeImplementation();
  11680. } else {
  11681. // For older browsers
  11682. installSetTimeoutImplementation();
  11683. }
  11684. attachTo.setImmediate = setImmediate;
  11685. attachTo.clearImmediate = clearImmediate;
  11686. }(typeof self === "undefined" ? typeof global === "undefined" ? this : global : self));
  11687. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6), __webpack_require__(80)))
  11688. /***/ }),
  11689. /* 83 */
  11690. /***/ (function(module, exports, __webpack_require__) {
  11691. var apply = Function.prototype.apply;
  11692. // DOM APIs, for completeness
  11693. exports.setTimeout = function() {
  11694. return new Timeout(apply.call(setTimeout, window, arguments), clearTimeout);
  11695. };
  11696. exports.setInterval = function() {
  11697. return new Timeout(apply.call(setInterval, window, arguments), clearInterval);
  11698. };
  11699. exports.clearTimeout =
  11700. exports.clearInterval = function(timeout) {
  11701. if (timeout) {
  11702. timeout.close();
  11703. }
  11704. };
  11705. function Timeout(id, clearFn) {
  11706. this._id = id;
  11707. this._clearFn = clearFn;
  11708. }
  11709. Timeout.prototype.unref = Timeout.prototype.ref = function() {};
  11710. Timeout.prototype.close = function() {
  11711. this._clearFn.call(window, this._id);
  11712. };
  11713. // Does not start the time, just sets up the members needed.
  11714. exports.enroll = function(item, msecs) {
  11715. clearTimeout(item._idleTimeoutId);
  11716. item._idleTimeout = msecs;
  11717. };
  11718. exports.unenroll = function(item) {
  11719. clearTimeout(item._idleTimeoutId);
  11720. item._idleTimeout = -1;
  11721. };
  11722. exports._unrefActive = exports.active = function(item) {
  11723. clearTimeout(item._idleTimeoutId);
  11724. var msecs = item._idleTimeout;
  11725. if (msecs >= 0) {
  11726. item._idleTimeoutId = setTimeout(function onTimeout() {
  11727. if (item._onTimeout)
  11728. item._onTimeout();
  11729. }, msecs);
  11730. }
  11731. };
  11732. // setimmediate attaches itself to the global object
  11733. __webpack_require__(82);
  11734. exports.setImmediate = setImmediate;
  11735. exports.clearImmediate = clearImmediate;
  11736. /***/ }),
  11737. /* 84 */
  11738. /***/ (function(module, exports) {
  11739. module.exports=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804\uDCBD|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/
  11740. /***/ }),
  11741. /* 85 */
  11742. /***/ (function(module, exports, __webpack_require__) {
  11743. "use strict";
  11744. exports.Any = __webpack_require__(18);
  11745. exports.Cc = __webpack_require__(16);
  11746. exports.Cf = __webpack_require__(84);
  11747. exports.P = __webpack_require__(5);
  11748. exports.Z = __webpack_require__(17);
  11749. /***/ }),
  11750. /* 86 */
  11751. /***/ (function(module, exports) {
  11752. module.exports = function(module) {
  11753. if(!module.webpackPolyfill) {
  11754. module.deprecate = function() {};
  11755. module.paths = [];
  11756. // module.parent = undefined by default
  11757. if(!module.children) module.children = [];
  11758. Object.defineProperty(module, "loaded", {
  11759. enumerable: true,
  11760. get: function() {
  11761. return module.l;
  11762. }
  11763. });
  11764. Object.defineProperty(module, "id", {
  11765. enumerable: true,
  11766. get: function() {
  11767. return module.i;
  11768. }
  11769. });
  11770. module.webpackPolyfill = 1;
  11771. }
  11772. return module;
  11773. };
  11774. /***/ }),
  11775. /* 87 */
  11776. /***/ (function(module, exports, __webpack_require__) {
  11777. __webpack_require__(19);
  11778. module.exports = __webpack_require__(20);
  11779. /***/ })
  11780. /******/ ]);
  11781. //# sourceMappingURL=main.js.map