main.js 349 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606
  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 = 85);
  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__(83);
  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__(81).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':'lat', 'db':'0-LAT-ethicadb.json'},
  1542. {'lc':'fr', 'label':'fr', 'db':'2-Appuhn-FR-ethicadb.json'},
  1543. {'lc':'bra', 'label':'bra', 'db':'ethica-bresilen.json'},
  1544. {'lc':'en', 'label':'en', '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. // __ __ __
  2166. // / / / /__ ____ _____/ /__ _____
  2167. // / /_/ / _ \/ __ `/ __ / _ \/ ___/
  2168. // / __ / __/ /_/ / /_/ / __/ /
  2169. // /_/ /_/\___/\__,_/\__,_/\___/_/
  2170. module.exports = {
  2171. view: function(vn){
  2172. return m('header', [
  2173. m('h1', 'Ethica'),
  2174. m('nav', {'id':"menus"}, [
  2175. m(_RouteMenu),
  2176. m(_LangMenu)
  2177. ])
  2178. ]);
  2179. }
  2180. }
  2181. var _RouteMenu = {
  2182. view: function(){
  2183. // create ul dom
  2184. return m('ul', {id:"routes"}, [
  2185. m('li', m('a', {'href':'#!/inline'}, "inline")),
  2186. m('li', m('a', {'href':'#!/tree'}, "tree")),
  2187. ]
  2188. );
  2189. }
  2190. }
  2191. // __ __ ___
  2192. // / / ____ _____ ____ _/ |/ /__ ____ __ __
  2193. // / / / __ `/ __ \/ __ `/ /|_/ / _ \/ __ \/ / / /
  2194. // / /___/ /_/ / / / / /_/ / / / / __/ / / / /_/ /
  2195. // /_____/\__,_/_/ /_/\__, /_/ /_/\___/_/ /_/\__,_/
  2196. // /____/
  2197. var _LangMenu = {
  2198. view: function(){
  2199. // create ul dom
  2200. return m('ul', {id:"languages"}, _dbs.langs.map(function(lang){
  2201. // create li dom for each lank link
  2202. return m('li',
  2203. // create a dom
  2204. m('a', {
  2205. 'lang':lang.lc,
  2206. 'href':'/?lang='+lang.lc,
  2207. onclick:function(e){
  2208. e.preventDefault();
  2209. // console.log('click lang', e);
  2210. var lang = e.target.getAttribute('lang');
  2211. console.log(lang);
  2212. if(lang != _dbs.lang){
  2213. // change url variable
  2214. // change db
  2215. _dbs.lang = lang;
  2216. // redraw UI
  2217. // m.redraw();
  2218. }
  2219. return false;
  2220. }
  2221. }, lang.label)
  2222. );
  2223. })
  2224. );
  2225. }
  2226. }
  2227. /***/ }),
  2228. /* 9 */
  2229. /***/ (function(module, exports, __webpack_require__) {
  2230. "use strict";
  2231. // Process footnotes
  2232. //
  2233. ////////////////////////////////////////////////////////////////////////////////
  2234. // Renderer partials
  2235. function render_footnote_anchor_name(tokens, idx, options, env/*, slf*/) {
  2236. var n = Number(tokens[idx].meta.id + 1).toString();
  2237. var prefix = '';
  2238. if (typeof env.docId === 'string') {
  2239. prefix = '-' + env.docId + '-';
  2240. }
  2241. return prefix + n;
  2242. }
  2243. function render_footnote_caption(tokens, idx/*, options, env, slf*/) {
  2244. var n = Number(tokens[idx].meta.id + 1).toString();
  2245. if (tokens[idx].meta.subId > 0) {
  2246. n += ':' + tokens[idx].meta.subId;
  2247. }
  2248. return '[' + n + ']';
  2249. }
  2250. function render_footnote_ref(tokens, idx, options, env, slf) {
  2251. var id = slf.rules.footnote_anchor_name(tokens, idx, options, env, slf);
  2252. var caption = slf.rules.footnote_caption(tokens, idx, options, env, slf);
  2253. var refid = id;
  2254. if (tokens[idx].meta.subId > 0) {
  2255. refid += ':' + tokens[idx].meta.subId;
  2256. }
  2257. return '<sup class="footnote-ref"><a href="#fn' + id + '" id="fnref' + refid + '">' + caption + '</a></sup>';
  2258. }
  2259. function render_footnote_block_open(tokens, idx, options) {
  2260. return (options.xhtmlOut ? '<hr class="footnotes-sep" />\n' : '<hr class="footnotes-sep">\n') +
  2261. '<section class="footnotes">\n' +
  2262. '<ol class="footnotes-list">\n';
  2263. }
  2264. function render_footnote_block_close() {
  2265. return '</ol>\n</section>\n';
  2266. }
  2267. function render_footnote_open(tokens, idx, options, env, slf) {
  2268. var id = slf.rules.footnote_anchor_name(tokens, idx, options, env, slf);
  2269. if (tokens[idx].meta.subId > 0) {
  2270. id += ':' + tokens[idx].meta.subId;
  2271. }
  2272. return '<li id="fn' + id + '" class="footnote-item">';
  2273. }
  2274. function render_footnote_close() {
  2275. return '</li>\n';
  2276. }
  2277. function render_footnote_anchor(tokens, idx, options, env, slf) {
  2278. var id = slf.rules.footnote_anchor_name(tokens, idx, options, env, slf);
  2279. if (tokens[idx].meta.subId > 0) {
  2280. id += ':' + tokens[idx].meta.subId;
  2281. }
  2282. /* ↩ with escape code to prevent display as Apple Emoji on iOS */
  2283. return ' <a href="#fnref' + id + '" class="footnote-backref">\u21a9\uFE0E</a>';
  2284. }
  2285. module.exports = function footnote_plugin(md) {
  2286. var parseLinkLabel = md.helpers.parseLinkLabel,
  2287. isSpace = md.utils.isSpace;
  2288. md.renderer.rules.footnote_ref = render_footnote_ref;
  2289. md.renderer.rules.footnote_block_open = render_footnote_block_open;
  2290. md.renderer.rules.footnote_block_close = render_footnote_block_close;
  2291. md.renderer.rules.footnote_open = render_footnote_open;
  2292. md.renderer.rules.footnote_close = render_footnote_close;
  2293. md.renderer.rules.footnote_anchor = render_footnote_anchor;
  2294. // helpers (only used in other rules, no tokens are attached to those)
  2295. md.renderer.rules.footnote_caption = render_footnote_caption;
  2296. md.renderer.rules.footnote_anchor_name = render_footnote_anchor_name;
  2297. // Process footnote block definition
  2298. function footnote_def(state, startLine, endLine, silent) {
  2299. var oldBMark, oldTShift, oldSCount, oldParentType, pos, label, token,
  2300. initial, offset, ch, posAfterColon,
  2301. start = state.bMarks[startLine] + state.tShift[startLine],
  2302. max = state.eMarks[startLine];
  2303. // line should be at least 5 chars - "[^x]:"
  2304. if (start + 4 > max) { return false; }
  2305. if (state.src.charCodeAt(start) !== 0x5B/* [ */) { return false; }
  2306. if (state.src.charCodeAt(start + 1) !== 0x5E/* ^ */) { return false; }
  2307. for (pos = start + 2; pos < max; pos++) {
  2308. if (state.src.charCodeAt(pos) === 0x20) { return false; }
  2309. if (state.src.charCodeAt(pos) === 0x5D /* ] */) {
  2310. break;
  2311. }
  2312. }
  2313. if (pos === start + 2) { return false; } // no empty footnote labels
  2314. if (pos + 1 >= max || state.src.charCodeAt(++pos) !== 0x3A /* : */) { return false; }
  2315. if (silent) { return true; }
  2316. pos++;
  2317. if (!state.env.footnotes) { state.env.footnotes = {}; }
  2318. if (!state.env.footnotes.refs) { state.env.footnotes.refs = {}; }
  2319. label = state.src.slice(start + 2, pos - 2);
  2320. state.env.footnotes.refs[':' + label] = -1;
  2321. token = new state.Token('footnote_reference_open', '', 1);
  2322. token.meta = { label: label };
  2323. token.level = state.level++;
  2324. state.tokens.push(token);
  2325. oldBMark = state.bMarks[startLine];
  2326. oldTShift = state.tShift[startLine];
  2327. oldSCount = state.sCount[startLine];
  2328. oldParentType = state.parentType;
  2329. posAfterColon = pos;
  2330. initial = offset = state.sCount[startLine] + pos - (state.bMarks[startLine] + state.tShift[startLine]);
  2331. while (pos < max) {
  2332. ch = state.src.charCodeAt(pos);
  2333. if (isSpace(ch)) {
  2334. if (ch === 0x09) {
  2335. offset += 4 - offset % 4;
  2336. } else {
  2337. offset++;
  2338. }
  2339. } else {
  2340. break;
  2341. }
  2342. pos++;
  2343. }
  2344. state.tShift[startLine] = pos - posAfterColon;
  2345. state.sCount[startLine] = offset - initial;
  2346. state.bMarks[startLine] = posAfterColon;
  2347. state.blkIndent += 4;
  2348. state.parentType = 'footnote';
  2349. if (state.sCount[startLine] < state.blkIndent) {
  2350. state.sCount[startLine] += state.blkIndent;
  2351. }
  2352. state.md.block.tokenize(state, startLine, endLine, true);
  2353. state.parentType = oldParentType;
  2354. state.blkIndent -= 4;
  2355. state.tShift[startLine] = oldTShift;
  2356. state.sCount[startLine] = oldSCount;
  2357. state.bMarks[startLine] = oldBMark;
  2358. token = new state.Token('footnote_reference_close', '', -1);
  2359. token.level = --state.level;
  2360. state.tokens.push(token);
  2361. return true;
  2362. }
  2363. // Process inline footnotes (^[...])
  2364. function footnote_inline(state, silent) {
  2365. var labelStart,
  2366. labelEnd,
  2367. footnoteId,
  2368. token,
  2369. tokens,
  2370. max = state.posMax,
  2371. start = state.pos;
  2372. if (start + 2 >= max) { return false; }
  2373. if (state.src.charCodeAt(start) !== 0x5E/* ^ */) { return false; }
  2374. if (state.src.charCodeAt(start + 1) !== 0x5B/* [ */) { return false; }
  2375. labelStart = start + 2;
  2376. labelEnd = parseLinkLabel(state, start + 1);
  2377. // parser failed to find ']', so it's not a valid note
  2378. if (labelEnd < 0) { return false; }
  2379. // We found the end of the link, and know for a fact it's a valid link;
  2380. // so all that's left to do is to call tokenizer.
  2381. //
  2382. if (!silent) {
  2383. if (!state.env.footnotes) { state.env.footnotes = {}; }
  2384. if (!state.env.footnotes.list) { state.env.footnotes.list = []; }
  2385. footnoteId = state.env.footnotes.list.length;
  2386. state.md.inline.parse(
  2387. state.src.slice(labelStart, labelEnd),
  2388. state.md,
  2389. state.env,
  2390. tokens = []
  2391. );
  2392. token = state.push('footnote_ref', '', 0);
  2393. token.meta = { id: footnoteId };
  2394. state.env.footnotes.list[footnoteId] = { tokens: tokens };
  2395. }
  2396. state.pos = labelEnd + 1;
  2397. state.posMax = max;
  2398. return true;
  2399. }
  2400. // Process footnote references ([^...])
  2401. function footnote_ref(state, silent) {
  2402. var label,
  2403. pos,
  2404. footnoteId,
  2405. footnoteSubId,
  2406. token,
  2407. max = state.posMax,
  2408. start = state.pos;
  2409. // should be at least 4 chars - "[^x]"
  2410. if (start + 3 > max) { return false; }
  2411. if (!state.env.footnotes || !state.env.footnotes.refs) { return false; }
  2412. if (state.src.charCodeAt(start) !== 0x5B/* [ */) { return false; }
  2413. if (state.src.charCodeAt(start + 1) !== 0x5E/* ^ */) { return false; }
  2414. for (pos = start + 2; pos < max; pos++) {
  2415. if (state.src.charCodeAt(pos) === 0x20) { return false; }
  2416. if (state.src.charCodeAt(pos) === 0x0A) { return false; }
  2417. if (state.src.charCodeAt(pos) === 0x5D /* ] */) {
  2418. break;
  2419. }
  2420. }
  2421. if (pos === start + 2) { return false; } // no empty footnote labels
  2422. if (pos >= max) { return false; }
  2423. pos++;
  2424. label = state.src.slice(start + 2, pos - 1);
  2425. if (typeof state.env.footnotes.refs[':' + label] === 'undefined') { return false; }
  2426. if (!silent) {
  2427. if (!state.env.footnotes.list) { state.env.footnotes.list = []; }
  2428. if (state.env.footnotes.refs[':' + label] < 0) {
  2429. footnoteId = state.env.footnotes.list.length;
  2430. state.env.footnotes.list[footnoteId] = { label: label, count: 0 };
  2431. state.env.footnotes.refs[':' + label] = footnoteId;
  2432. } else {
  2433. footnoteId = state.env.footnotes.refs[':' + label];
  2434. }
  2435. footnoteSubId = state.env.footnotes.list[footnoteId].count;
  2436. state.env.footnotes.list[footnoteId].count++;
  2437. token = state.push('footnote_ref', '', 0);
  2438. token.meta = { id: footnoteId, subId: footnoteSubId, label: label };
  2439. }
  2440. state.pos = pos;
  2441. state.posMax = max;
  2442. return true;
  2443. }
  2444. // Glue footnote tokens to end of token stream
  2445. function footnote_tail(state) {
  2446. var i, l, j, t, lastParagraph, list, token, tokens, current, currentLabel,
  2447. insideRef = false,
  2448. refTokens = {};
  2449. if (!state.env.footnotes) { return; }
  2450. state.tokens = state.tokens.filter(function (tok) {
  2451. if (tok.type === 'footnote_reference_open') {
  2452. insideRef = true;
  2453. current = [];
  2454. currentLabel = tok.meta.label;
  2455. return false;
  2456. }
  2457. if (tok.type === 'footnote_reference_close') {
  2458. insideRef = false;
  2459. // prepend ':' to avoid conflict with Object.prototype members
  2460. refTokens[':' + currentLabel] = current;
  2461. return false;
  2462. }
  2463. if (insideRef) { current.push(tok); }
  2464. return !insideRef;
  2465. });
  2466. if (!state.env.footnotes.list) { return; }
  2467. list = state.env.footnotes.list;
  2468. token = new state.Token('footnote_block_open', '', 1);
  2469. state.tokens.push(token);
  2470. for (i = 0, l = list.length; i < l; i++) {
  2471. token = new state.Token('footnote_open', '', 1);
  2472. token.meta = { id: i, label: list[i].label };
  2473. state.tokens.push(token);
  2474. if (list[i].tokens) {
  2475. tokens = [];
  2476. token = new state.Token('paragraph_open', 'p', 1);
  2477. token.block = true;
  2478. tokens.push(token);
  2479. token = new state.Token('inline', '', 0);
  2480. token.children = list[i].tokens;
  2481. token.content = '';
  2482. tokens.push(token);
  2483. token = new state.Token('paragraph_close', 'p', -1);
  2484. token.block = true;
  2485. tokens.push(token);
  2486. } else if (list[i].label) {
  2487. tokens = refTokens[':' + list[i].label];
  2488. }
  2489. state.tokens = state.tokens.concat(tokens);
  2490. if (state.tokens[state.tokens.length - 1].type === 'paragraph_close') {
  2491. lastParagraph = state.tokens.pop();
  2492. } else {
  2493. lastParagraph = null;
  2494. }
  2495. t = list[i].count > 0 ? list[i].count : 1;
  2496. for (j = 0; j < t; j++) {
  2497. token = new state.Token('footnote_anchor', '', 0);
  2498. token.meta = { id: i, subId: j, label: list[i].label };
  2499. state.tokens.push(token);
  2500. }
  2501. if (lastParagraph) {
  2502. state.tokens.push(lastParagraph);
  2503. }
  2504. token = new state.Token('footnote_close', '', -1);
  2505. state.tokens.push(token);
  2506. }
  2507. token = new state.Token('footnote_block_close', '', -1);
  2508. state.tokens.push(token);
  2509. }
  2510. md.block.ruler.before('reference', 'footnote_def', footnote_def, { alt: [ 'paragraph', 'reference' ] });
  2511. md.inline.ruler.after('image', 'footnote_inline', footnote_inline);
  2512. md.inline.ruler.after('footnote_inline', 'footnote_ref', footnote_ref);
  2513. md.core.ruler.after('inline', 'footnote_tail', footnote_tail);
  2514. };
  2515. /***/ }),
  2516. /* 10 */
  2517. /***/ (function(module, exports, __webpack_require__) {
  2518. "use strict";
  2519. module.exports = __webpack_require__(35);
  2520. /***/ }),
  2521. /* 11 */
  2522. /***/ (function(module, exports, __webpack_require__) {
  2523. "use strict";
  2524. // HTML5 entities map: { name -> utf16string }
  2525. //
  2526. /*eslint quotes:0*/
  2527. module.exports = __webpack_require__(23);
  2528. /***/ }),
  2529. /* 12 */
  2530. /***/ (function(module, exports, __webpack_require__) {
  2531. "use strict";
  2532. // Regexps to match html elements
  2533. var attr_name = '[a-zA-Z_:][a-zA-Z0-9:._-]*';
  2534. var unquoted = '[^"\'=<>`\\x00-\\x20]+';
  2535. var single_quoted = "'[^']*'";
  2536. var double_quoted = '"[^"]*"';
  2537. var attr_value = '(?:' + unquoted + '|' + single_quoted + '|' + double_quoted + ')';
  2538. var attribute = '(?:\\s+' + attr_name + '(?:\\s*=\\s*' + attr_value + ')?)';
  2539. var open_tag = '<[A-Za-z][A-Za-z0-9\\-]*' + attribute + '*\\s*\\/?>';
  2540. var close_tag = '<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>';
  2541. var comment = '<!---->|<!--(?:-?[^>-])(?:-?[^-])*-->';
  2542. var processing = '<[?].*?[?]>';
  2543. var declaration = '<![A-Z]+\\s+[^>]*>';
  2544. var cdata = '<!\\[CDATA\\[[\\s\\S]*?\\]\\]>';
  2545. var HTML_TAG_RE = new RegExp('^(?:' + open_tag + '|' + close_tag + '|' + comment +
  2546. '|' + processing + '|' + declaration + '|' + cdata + ')');
  2547. var HTML_OPEN_CLOSE_TAG_RE = new RegExp('^(?:' + open_tag + '|' + close_tag + ')');
  2548. module.exports.HTML_TAG_RE = HTML_TAG_RE;
  2549. module.exports.HTML_OPEN_CLOSE_TAG_RE = HTML_OPEN_CLOSE_TAG_RE;
  2550. /***/ }),
  2551. /* 13 */
  2552. /***/ (function(module, exports, __webpack_require__) {
  2553. "use strict";
  2554. // Process *this* and _that_
  2555. //
  2556. // Insert each marker as a separate text token, and add it to delimiter list
  2557. //
  2558. module.exports.tokenize = function emphasis(state, silent) {
  2559. var i, scanned, token,
  2560. start = state.pos,
  2561. marker = state.src.charCodeAt(start);
  2562. if (silent) { return false; }
  2563. if (marker !== 0x5F /* _ */ && marker !== 0x2A /* * */) { return false; }
  2564. scanned = state.scanDelims(state.pos, marker === 0x2A);
  2565. for (i = 0; i < scanned.length; i++) {
  2566. token = state.push('text', '', 0);
  2567. token.content = String.fromCharCode(marker);
  2568. state.delimiters.push({
  2569. // Char code of the starting marker (number).
  2570. //
  2571. marker: marker,
  2572. // Total length of these series of delimiters.
  2573. //
  2574. length: scanned.length,
  2575. // An amount of characters before this one that's equivalent to
  2576. // current one. In plain English: if this delimiter does not open
  2577. // an emphasis, neither do previous `jump` characters.
  2578. //
  2579. // Used to skip sequences like "*****" in one step, for 1st asterisk
  2580. // value will be 0, for 2nd it's 1 and so on.
  2581. //
  2582. jump: i,
  2583. // A position of the token this delimiter corresponds to.
  2584. //
  2585. token: state.tokens.length - 1,
  2586. // Token level.
  2587. //
  2588. level: state.level,
  2589. // If this delimiter is matched as a valid opener, `end` will be
  2590. // equal to its position, otherwise it's `-1`.
  2591. //
  2592. end: -1,
  2593. // Boolean flags that determine if this delimiter could open or close
  2594. // an emphasis.
  2595. //
  2596. open: scanned.can_open,
  2597. close: scanned.can_close
  2598. });
  2599. }
  2600. state.pos += scanned.length;
  2601. return true;
  2602. };
  2603. // Walk through delimiter list and replace text tokens with tags
  2604. //
  2605. module.exports.postProcess = function emphasis(state) {
  2606. var i,
  2607. startDelim,
  2608. endDelim,
  2609. token,
  2610. ch,
  2611. isStrong,
  2612. delimiters = state.delimiters,
  2613. max = state.delimiters.length;
  2614. for (i = 0; i < max; i++) {
  2615. startDelim = delimiters[i];
  2616. if (startDelim.marker !== 0x5F/* _ */ && startDelim.marker !== 0x2A/* * */) {
  2617. continue;
  2618. }
  2619. // Process only opening markers
  2620. if (startDelim.end === -1) {
  2621. continue;
  2622. }
  2623. endDelim = delimiters[startDelim.end];
  2624. // If the next delimiter has the same marker and is adjacent to this one,
  2625. // merge those into one strong delimiter.
  2626. //
  2627. // `<em><em>whatever</em></em>` -> `<strong>whatever</strong>`
  2628. //
  2629. isStrong = i + 1 < max &&
  2630. delimiters[i + 1].end === startDelim.end - 1 &&
  2631. delimiters[i + 1].token === startDelim.token + 1 &&
  2632. delimiters[startDelim.end - 1].token === endDelim.token - 1 &&
  2633. delimiters[i + 1].marker === startDelim.marker;
  2634. ch = String.fromCharCode(startDelim.marker);
  2635. token = state.tokens[startDelim.token];
  2636. token.type = isStrong ? 'strong_open' : 'em_open';
  2637. token.tag = isStrong ? 'strong' : 'em';
  2638. token.nesting = 1;
  2639. token.markup = isStrong ? ch + ch : ch;
  2640. token.content = '';
  2641. token = state.tokens[endDelim.token];
  2642. token.type = isStrong ? 'strong_close' : 'em_close';
  2643. token.tag = isStrong ? 'strong' : 'em';
  2644. token.nesting = -1;
  2645. token.markup = isStrong ? ch + ch : ch;
  2646. token.content = '';
  2647. if (isStrong) {
  2648. state.tokens[delimiters[i + 1].token].content = '';
  2649. state.tokens[delimiters[startDelim.end - 1].token].content = '';
  2650. i++;
  2651. }
  2652. }
  2653. };
  2654. /***/ }),
  2655. /* 14 */
  2656. /***/ (function(module, exports, __webpack_require__) {
  2657. "use strict";
  2658. // ~~strike through~~
  2659. //
  2660. // Insert each marker as a separate text token, and add it to delimiter list
  2661. //
  2662. module.exports.tokenize = function strikethrough(state, silent) {
  2663. var i, scanned, token, len, ch,
  2664. start = state.pos,
  2665. marker = state.src.charCodeAt(start);
  2666. if (silent) { return false; }
  2667. if (marker !== 0x7E/* ~ */) { return false; }
  2668. scanned = state.scanDelims(state.pos, true);
  2669. len = scanned.length;
  2670. ch = String.fromCharCode(marker);
  2671. if (len < 2) { return false; }
  2672. if (len % 2) {
  2673. token = state.push('text', '', 0);
  2674. token.content = ch;
  2675. len--;
  2676. }
  2677. for (i = 0; i < len; i += 2) {
  2678. token = state.push('text', '', 0);
  2679. token.content = ch + ch;
  2680. state.delimiters.push({
  2681. marker: marker,
  2682. jump: i,
  2683. token: state.tokens.length - 1,
  2684. level: state.level,
  2685. end: -1,
  2686. open: scanned.can_open,
  2687. close: scanned.can_close
  2688. });
  2689. }
  2690. state.pos += scanned.length;
  2691. return true;
  2692. };
  2693. // Walk through delimiter list and replace text tokens with tags
  2694. //
  2695. module.exports.postProcess = function strikethrough(state) {
  2696. var i, j,
  2697. startDelim,
  2698. endDelim,
  2699. token,
  2700. loneMarkers = [],
  2701. delimiters = state.delimiters,
  2702. max = state.delimiters.length;
  2703. for (i = 0; i < max; i++) {
  2704. startDelim = delimiters[i];
  2705. if (startDelim.marker !== 0x7E/* ~ */) {
  2706. continue;
  2707. }
  2708. if (startDelim.end === -1) {
  2709. continue;
  2710. }
  2711. endDelim = delimiters[startDelim.end];
  2712. token = state.tokens[startDelim.token];
  2713. token.type = 's_open';
  2714. token.tag = 's';
  2715. token.nesting = 1;
  2716. token.markup = '~~';
  2717. token.content = '';
  2718. token = state.tokens[endDelim.token];
  2719. token.type = 's_close';
  2720. token.tag = 's';
  2721. token.nesting = -1;
  2722. token.markup = '~~';
  2723. token.content = '';
  2724. if (state.tokens[endDelim.token - 1].type === 'text' &&
  2725. state.tokens[endDelim.token - 1].content === '~') {
  2726. loneMarkers.push(endDelim.token - 1);
  2727. }
  2728. }
  2729. // If a marker sequence has an odd number of characters, it's splitted
  2730. // like this: `~~~~~` -> `~` + `~~` + `~~`, leaving one marker at the
  2731. // start of the sequence.
  2732. //
  2733. // So, we have to move all those markers after subsequent s_close tags.
  2734. //
  2735. while (loneMarkers.length) {
  2736. i = loneMarkers.pop();
  2737. j = i + 1;
  2738. while (j < state.tokens.length && state.tokens[j].type === 's_close') {
  2739. j++;
  2740. }
  2741. j--;
  2742. if (i !== j) {
  2743. token = state.tokens[j];
  2744. state.tokens[j] = state.tokens[i];
  2745. state.tokens[i] = token;
  2746. }
  2747. }
  2748. };
  2749. /***/ }),
  2750. /* 15 */
  2751. /***/ (function(module, exports, __webpack_require__) {
  2752. "use strict";
  2753. module.exports.encode = __webpack_require__(75);
  2754. module.exports.decode = __webpack_require__(74);
  2755. module.exports.format = __webpack_require__(76);
  2756. module.exports.parse = __webpack_require__(77);
  2757. /***/ }),
  2758. /* 16 */
  2759. /***/ (function(module, exports) {
  2760. module.exports=/[\0-\x1F\x7F-\x9F]/
  2761. /***/ }),
  2762. /* 17 */
  2763. /***/ (function(module, exports) {
  2764. module.exports=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/
  2765. /***/ }),
  2766. /* 18 */
  2767. /***/ (function(module, exports) {
  2768. module.exports=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/
  2769. /***/ }),
  2770. /* 19 */
  2771. /***/ (function(module, exports, __webpack_require__) {
  2772. /**
  2773. * @Author: Bachir Soussi Chiadmi <bach>
  2774. * @Date: 16-04-2017
  2775. * @Email: bachir@figureslibres.io
  2776. * @Last modified by: bach
  2777. * @Last modified time: 18-04-2017
  2778. * @License: GPL-V3
  2779. */
  2780. __webpack_require__(27);
  2781. __webpack_require__(24);
  2782. __webpack_require__(25);
  2783. __webpack_require__(26);
  2784. var m = __webpack_require__(1);
  2785. // var marked = require('marked');
  2786. // var _helpers = require('modules/helpers');
  2787. var _dbs = __webpack_require__(2);
  2788. var _Inline = __webpack_require__(86);
  2789. var _Tree = __webpack_require__(22);
  2790. function init(){
  2791. _dbs.load(function(){
  2792. console.log("Init _dbs.data", _dbs.data);
  2793. console.log("Init _dbs.data_byid", _dbs.data_byid);
  2794. console.log("Init _dbs.data_strct", _dbs.data_strct);
  2795. m.route(document.body, "/inline", {
  2796. "/inline": _Inline,
  2797. "/tree": _Tree,
  2798. });
  2799. });
  2800. };
  2801. // ___
  2802. // / | ____ ____
  2803. // / /| | / __ \/ __ \
  2804. // / ___ |/ /_/ / /_/ /
  2805. // /_/ |_/ .___/ .___/
  2806. // /_/ /_/
  2807. // var _App = {
  2808. // view: function(){
  2809. // console.log('_App view', _lang);
  2810. // return [
  2811. // m('header', [
  2812. // m('h1', 'Ethica'),
  2813. // m('aside', {'id':"menus"}, m(_LangMenu) )
  2814. // ]),
  2815. // m(_Tree),
  2816. // m('footer', [
  2817. // m('p', m.trust('© 2017 <a href="./">Ethica Spinoza</a>'))
  2818. // ])
  2819. // ]
  2820. // }
  2821. // }
  2822. // _ _ __
  2823. // (_)___ (_) /_
  2824. // / / __ \/ / __/
  2825. // / / / / / / /_
  2826. // /_/_/ /_/_/\__/
  2827. init()
  2828. /***/ }),
  2829. /* 20 */
  2830. /***/ (function(module, exports) {
  2831. // removed by extract-text-webpack-plugin
  2832. /***/ }),
  2833. /* 21 */,
  2834. /* 22 */
  2835. /***/ (function(module, exports, __webpack_require__) {
  2836. var m = __webpack_require__(1);
  2837. // https://github.com/markdown-it/markdown-it
  2838. var markdown = __webpack_require__(10)()
  2839. .use(__webpack_require__(9));
  2840. var _dbs = __webpack_require__(2);
  2841. var _Header = __webpack_require__(8);
  2842. var _Footer = __webpack_require__(7);
  2843. // var _lang = require('../main.js')._langs;
  2844. // ____ __
  2845. // / __ \____ / /_
  2846. // / / / / __ \/ __/
  2847. // / /_/ / /_/ / /_
  2848. // /_____/\____/\__/
  2849. var _Dot = {
  2850. id:null,
  2851. type:'',
  2852. text:'',
  2853. summary:'',
  2854. active:true,
  2855. opened:false,
  2856. links:null,
  2857. parents:[],
  2858. lang:_dbs.lang,
  2859. setuptext:function(vn){
  2860. // console.log('setuptext', vn);
  2861. // construct text
  2862. this.text = markdown.render(vn.attrs.text);
  2863. // construct summary
  2864. // TODO: summary needs more work (strip tags, markdown render)
  2865. this.summary = vn.attrs.text.match('([^ ]*[ ]{0,1}){1,6}')[0];
  2866. this.summary = this.summary.trim().replace(/_([^_]+)$/g, "_$1_");
  2867. this.summary = this.summary.replace(/\[([^\]]+)$/g, "$1");
  2868. this.summary = markdown.renderInline(this.summary) + "&nbsp;…";
  2869. },
  2870. oninit: function(vn){
  2871. this.id = vn.attrs.id;
  2872. this.type = vn.attrs.type;
  2873. this.setuptext(vn);
  2874. if(typeof vn.attrs.active !== 'undefined')
  2875. this.active = vn.attrs.active;
  2876. // links
  2877. this.links = _dbs.data_strct[this.id];
  2878. // console.log(this.links);
  2879. // parents memorize where do we come from to avoid duplicates and looping nav
  2880. if(vn.attrs.parents){
  2881. this.parents = this.parents.concat(vn.attrs.parents);
  2882. // console.log('_Dot init '+this.id+' parents :',this.parents);
  2883. }
  2884. },
  2885. oncreate: function(vn){
  2886. if(this.active){
  2887. vn.dom.classList.remove('disabled');
  2888. }else{
  2889. vn.dom.classList.add('disabled');
  2890. }
  2891. },
  2892. onbeforeupdate: function(vn){
  2893. // console.log('onbeforeupdate');
  2894. if(this.lang != _dbs.lang){
  2895. this.lang = _dbs.lang;
  2896. this.setuptext(vn);
  2897. }
  2898. },
  2899. view: function(vn){
  2900. if (this.active && this.opened) {
  2901. // full view of dot with linked dots
  2902. // console.log('_Dot view '+this.id+' parents :',this.parents);
  2903. var dot_content = [
  2904. // links to
  2905. this.links.to.length
  2906. ? m('nav', {'class':'links to'}, this.links.to.map(function(id){
  2907. // console.log(id);
  2908. if(typeof _dbs.data_byid[_dbs.lang][id] !== 'undefined'){
  2909. return m(_Dot, {
  2910. "id":id,
  2911. 'text':_dbs.data_byid[_dbs.lang][id].text,
  2912. 'type':'',
  2913. // passe the memory of crossed dots plus the current one
  2914. 'parents':vn.state.parents.concat([vn.state.id]),
  2915. // activate link only if not in parents (already went through it)
  2916. 'active':vn.state.parents.indexOf(id) == -1 ? true:false
  2917. });
  2918. }
  2919. })
  2920. )
  2921. : null,
  2922. // id
  2923. m('span', {'class':'id'}, this.id), // this.type+' '+
  2924. // bullet
  2925. m('span', {'class':'bullet'}, m.trust('&#9899;')),
  2926. // full text
  2927. m('section', {
  2928. 'class':'text',
  2929. onmouseover: function(e){
  2930. e.preventDefault();
  2931. if(e.target.nodeName == "A" ){
  2932. // console.log("over e.target", e.target);
  2933. // console.log('over vn', vn);
  2934. var id = e.target.getAttribute("href");
  2935. // add highlight class
  2936. vn.dom.querySelector('nav.links>div[uid="'+id+'"]').classList.add('highlight');
  2937. }else{
  2938. // remove all hilight class
  2939. for (link of vn.dom.querySelectorAll('nav.links>div.dot')) {
  2940. link.classList.remove('highlight');
  2941. }
  2942. }
  2943. },
  2944. onclick:function(e){
  2945. e.preventDefault();
  2946. if(e.target.nodeName == "A" ){
  2947. // console.log("over e.target", e.target);
  2948. // console.log('over vn', vn);
  2949. var id = e.target.getAttribute("href");
  2950. // add highlight class
  2951. vn.dom.querySelector('nav.links>div[uid="'+id+'"]>.summary').click();
  2952. }
  2953. }
  2954. }, m.trust(this.text)),
  2955. // links from
  2956. this.links.from.length
  2957. ? m('nav', {'class':'links from'}, this.links.from.map(function(id){
  2958. // retrun a dot
  2959. return m(_Dot, {
  2960. "id":id,
  2961. 'text':_dbs.data_byid[_dbs.lang][id].text,
  2962. 'type':'',
  2963. // passe the memory of crossed dots plus the current one
  2964. 'parents':vn.state.parents.concat([vn.state.id]),
  2965. // activate link only if not in parents (already went through it)
  2966. 'active':vn.state.parents.indexOf(id) == -1 ? true:false
  2967. });
  2968. })
  2969. )
  2970. : null
  2971. ];
  2972. }else{
  2973. // preview dot
  2974. var dot_content = [
  2975. m('span', {'class':'id'}, this.id), // this.type+' '+
  2976. m('span', {'class':'bullet'}, m.trust('&#8226;')),
  2977. m('p', {
  2978. 'class':'summary',
  2979. onclick:function(e){
  2980. // TODO: animate openening (text and links separatly)
  2981. vn.state.opened = true;
  2982. }
  2983. }, m.trust(this.summary))
  2984. ];
  2985. }
  2986. return m('div',{
  2987. 'uid':this.id,
  2988. 'class':'dot'
  2989. },
  2990. dot_content
  2991. );
  2992. },
  2993. onupdate: function(vn){
  2994. // console.log('_Dot : onupdate', vn);
  2995. if(this.active){
  2996. if (this.opened){
  2997. vn.dom.classList.add('opened');
  2998. if(this.links.to.length)
  2999. vn.dom.classList.add('to-links');
  3000. if(this.links.from.length)
  3001. vn.dom.classList.add('from-links');
  3002. }else{
  3003. vn.dom.classList.remove('opened');
  3004. }
  3005. }
  3006. }
  3007. }
  3008. /*
  3009. down vote
  3010. Here's full list of black dotlikes from unicode
  3011. ● - &#9679; - Black Circle
  3012. ⏺ - &#9210; - Black Circle for Record
  3013. ⚫ - &#9899; - Medium Black Circle
  3014. ⬤ - &#11044; - Black Large Circle
  3015. ⧭ - &#10733; - Black Circle with Down Arrow
  3016. 🞄 - &#128900; - Black Slightly Small Circle
  3017. • - &#8226; - Bullet
  3018. ∙ - &#8729; - Bullet Operator
  3019. ⋅ - &#8901; - Dot Operator
  3020. 🌑 - &#127761; - New Moon Symbol
  3021. */
  3022. // _______ _ __ __
  3023. // / ___/ / (_) /__/ /
  3024. // / /__/ _ \/ / / _ /
  3025. // \___/_//_/_/_/\_,_/
  3026. var _Child = {
  3027. id:null,
  3028. part:null,
  3029. type:null,
  3030. // nested:false,
  3031. text:'',
  3032. oninit: function(vn){
  3033. // console.log('vn.attrs', vn.attrs);
  3034. this.id = vn.attrs.id;
  3035. this.type = vn.attrs.type;
  3036. // vn.state.part = vn.state.slug.match(/^(\d)(.+)/)[1];
  3037. this.text = vn.attrs.text;
  3038. // this.nested = vn.attrs.nested || false;
  3039. },
  3040. onbeforeupdate: function(vn, old){
  3041. // this.nested = vn.attrs.nested || false;
  3042. this.type = vn.attrs.type;
  3043. this.text = vn.attrs.text;
  3044. },
  3045. view: function(vn){
  3046. return m(_Dot, {"id":this.id, 'text':this.text, 'type':this.type});
  3047. }
  3048. };
  3049. // ______
  3050. // / ____/___ ____ ____ ________
  3051. // / __/ / __ \/ __ \/ __ \/ ___/ _ \
  3052. // / /___/ / / / /_/ / / / / /__/ __/
  3053. // /_____/_/ /_/\____/_/ /_/\___/\___/
  3054. var _Enonce = {
  3055. partid:null,
  3056. id:null,
  3057. title:null,
  3058. text:null,
  3059. // nested:false,
  3060. childs:[],
  3061. oninit:function(vn){
  3062. // // console.log('Enonce on init', vn);
  3063. this.partid = vn.attrs.partid;
  3064. this.id = vn.attrs.id;
  3065. this.title = vn.attrs.title;
  3066. this.text = vn.attrs.text;
  3067. this.childs = vn.attrs.childs;
  3068. // this.nested = vn.attrs.nested || false;
  3069. },
  3070. onbeforeupdate:function(vn, old) {
  3071. // console.log(vn.attrs.childs);
  3072. this.title = vn.attrs.title;
  3073. this.text = vn.attrs.text;
  3074. this.childs = vn.attrs.childs;
  3075. // this.nested = vn.attrs.nested || false;
  3076. // if(vn.attrs.id == '1d1') console.log('_Enonce UPDATE, text :', vn.attrs.text);
  3077. },
  3078. view: function(vn){
  3079. // if(vn.attrs.id == '1d1') console.log('_Enonce VIEW, text :', vn.attrs.text);
  3080. return [
  3081. // create dot
  3082. m(_Dot, {"id":this.id, 'text':this.text,'type':this.title}),
  3083. // addd children
  3084. this.childs.map(function(c){
  3085. return m(_Child, c);
  3086. })
  3087. ]
  3088. }
  3089. }
  3090. // ____ __
  3091. // / __ \____ ______/ /_
  3092. // / /_/ / __ `/ ___/ __/
  3093. // / ____/ /_/ / / / /_
  3094. // /_/ \__,_/_/ \__/
  3095. var _Part = {
  3096. oninit: function(vn){
  3097. this.id = vn.attrs.id;
  3098. this.title = vn.attrs.title;
  3099. this.enonces = vn.attrs.enonces;
  3100. },
  3101. onbeforeupdate: function(vn, old){
  3102. // console.log('_Part, onbeforeupdate old',old);
  3103. this.title = vn.attrs.title;
  3104. this.enonces = vn.attrs.enonces;
  3105. },
  3106. view: function(vn){
  3107. // console.log(vn.attrs.enonces);
  3108. return m("section", {
  3109. 'id' :this.id,
  3110. 'class' :'part'
  3111. },
  3112. [
  3113. // create title node
  3114. m("h1", {'class':'part'}, m.trust(markdown.renderInline(this.title))),
  3115. // create text node
  3116. this.enonces.map(function(e){
  3117. // console.log(e.text);
  3118. // return m(_Enonce, Object.assign({"partid":this.id},e))
  3119. switch (e.type) {
  3120. case "title":
  3121. // handle titles
  3122. return m("h2", {'class':'title'}, m.trust(markdown.renderInline(e.title)));
  3123. break;
  3124. case "filet":
  3125. // handle filets
  3126. return m("h4", {'class':'filet'}, m.trust(markdown.renderInline(e.title)));
  3127. break;
  3128. default:
  3129. // or build structure
  3130. return m(_Enonce, Object.assign({"partid":this.id},e));
  3131. }
  3132. })
  3133. ]
  3134. )
  3135. }
  3136. }
  3137. // ______
  3138. // /_ __/_______ ___
  3139. // / / / ___/ _ \/ _ \
  3140. // / / / / / __/ __/
  3141. // /_/ /_/ \___/\___/
  3142. module.exports = {
  3143. view: function(){
  3144. // console.log('_Tree view', _dbs.lang);
  3145. return [
  3146. m(_Header),
  3147. m('main', {id:"content", 'class':'tree'}, _dbs.data[_dbs.lang].map(function(p){
  3148. return m(_Part,p);
  3149. })
  3150. ),
  3151. m(_Footer)
  3152. ];
  3153. }
  3154. }
  3155. // function(){
  3156. // switch(_dbs.lang){
  3157. // case 'fr':
  3158. // return "Hello dots !";
  3159. // break;
  3160. // case 'bra':
  3161. // return '"Hola dots !"'
  3162. // break;
  3163. // }
  3164. // }
  3165. /***/ }),
  3166. /* 23 */
  3167. /***/ (function(module, exports) {
  3168. module.exports = {
  3169. "Aacute": "Á",
  3170. "aacute": "á",
  3171. "Abreve": "Ă",
  3172. "abreve": "ă",
  3173. "ac": "∾",
  3174. "acd": "∿",
  3175. "acE": "∾̳",
  3176. "Acirc": "Â",
  3177. "acirc": "â",
  3178. "acute": "´",
  3179. "Acy": "А",
  3180. "acy": "а",
  3181. "AElig": "Æ",
  3182. "aelig": "æ",
  3183. "af": "⁡",
  3184. "Afr": "𝔄",
  3185. "afr": "𝔞",
  3186. "Agrave": "À",
  3187. "agrave": "à",
  3188. "alefsym": "ℵ",
  3189. "aleph": "ℵ",
  3190. "Alpha": "Α",
  3191. "alpha": "α",
  3192. "Amacr": "Ā",
  3193. "amacr": "ā",
  3194. "amalg": "⨿",
  3195. "amp": "&",
  3196. "AMP": "&",
  3197. "andand": "⩕",
  3198. "And": "⩓",
  3199. "and": "∧",
  3200. "andd": "⩜",
  3201. "andslope": "⩘",
  3202. "andv": "⩚",
  3203. "ang": "∠",
  3204. "ange": "⦤",
  3205. "angle": "∠",
  3206. "angmsdaa": "⦨",
  3207. "angmsdab": "⦩",
  3208. "angmsdac": "⦪",
  3209. "angmsdad": "⦫",
  3210. "angmsdae": "⦬",
  3211. "angmsdaf": "⦭",
  3212. "angmsdag": "⦮",
  3213. "angmsdah": "⦯",
  3214. "angmsd": "∡",
  3215. "angrt": "∟",
  3216. "angrtvb": "⊾",
  3217. "angrtvbd": "⦝",
  3218. "angsph": "∢",
  3219. "angst": "Å",
  3220. "angzarr": "⍼",
  3221. "Aogon": "Ą",
  3222. "aogon": "ą",
  3223. "Aopf": "𝔸",
  3224. "aopf": "𝕒",
  3225. "apacir": "⩯",
  3226. "ap": "≈",
  3227. "apE": "⩰",
  3228. "ape": "≊",
  3229. "apid": "≋",
  3230. "apos": "'",
  3231. "ApplyFunction": "⁡",
  3232. "approx": "≈",
  3233. "approxeq": "≊",
  3234. "Aring": "Å",
  3235. "aring": "å",
  3236. "Ascr": "𝒜",
  3237. "ascr": "𝒶",
  3238. "Assign": "≔",
  3239. "ast": "*",
  3240. "asymp": "≈",
  3241. "asympeq": "≍",
  3242. "Atilde": "Ã",
  3243. "atilde": "ã",
  3244. "Auml": "Ä",
  3245. "auml": "ä",
  3246. "awconint": "∳",
  3247. "awint": "⨑",
  3248. "backcong": "≌",
  3249. "backepsilon": "϶",
  3250. "backprime": "‵",
  3251. "backsim": "∽",
  3252. "backsimeq": "⋍",
  3253. "Backslash": "∖",
  3254. "Barv": "⫧",
  3255. "barvee": "⊽",
  3256. "barwed": "⌅",
  3257. "Barwed": "⌆",
  3258. "barwedge": "⌅",
  3259. "bbrk": "⎵",
  3260. "bbrktbrk": "⎶",
  3261. "bcong": "≌",
  3262. "Bcy": "Б",
  3263. "bcy": "б",
  3264. "bdquo": "„",
  3265. "becaus": "∵",
  3266. "because": "∵",
  3267. "Because": "∵",
  3268. "bemptyv": "⦰",
  3269. "bepsi": "϶",
  3270. "bernou": "ℬ",
  3271. "Bernoullis": "ℬ",
  3272. "Beta": "Β",
  3273. "beta": "β",
  3274. "beth": "ℶ",
  3275. "between": "≬",
  3276. "Bfr": "𝔅",
  3277. "bfr": "𝔟",
  3278. "bigcap": "⋂",
  3279. "bigcirc": "◯",
  3280. "bigcup": "⋃",
  3281. "bigodot": "⨀",
  3282. "bigoplus": "⨁",
  3283. "bigotimes": "⨂",
  3284. "bigsqcup": "⨆",
  3285. "bigstar": "★",
  3286. "bigtriangledown": "▽",
  3287. "bigtriangleup": "△",
  3288. "biguplus": "⨄",
  3289. "bigvee": "⋁",
  3290. "bigwedge": "⋀",
  3291. "bkarow": "⤍",
  3292. "blacklozenge": "⧫",
  3293. "blacksquare": "▪",
  3294. "blacktriangle": "▴",
  3295. "blacktriangledown": "▾",
  3296. "blacktriangleleft": "◂",
  3297. "blacktriangleright": "▸",
  3298. "blank": "␣",
  3299. "blk12": "▒",
  3300. "blk14": "░",
  3301. "blk34": "▓",
  3302. "block": "█",
  3303. "bne": "=⃥",
  3304. "bnequiv": "≡⃥",
  3305. "bNot": "⫭",
  3306. "bnot": "⌐",
  3307. "Bopf": "𝔹",
  3308. "bopf": "𝕓",
  3309. "bot": "⊥",
  3310. "bottom": "⊥",
  3311. "bowtie": "⋈",
  3312. "boxbox": "⧉",
  3313. "boxdl": "┐",
  3314. "boxdL": "╕",
  3315. "boxDl": "╖",
  3316. "boxDL": "╗",
  3317. "boxdr": "┌",
  3318. "boxdR": "╒",
  3319. "boxDr": "╓",
  3320. "boxDR": "╔",
  3321. "boxh": "─",
  3322. "boxH": "═",
  3323. "boxhd": "┬",
  3324. "boxHd": "╤",
  3325. "boxhD": "╥",
  3326. "boxHD": "╦",
  3327. "boxhu": "┴",
  3328. "boxHu": "╧",
  3329. "boxhU": "╨",
  3330. "boxHU": "╩",
  3331. "boxminus": "⊟",
  3332. "boxplus": "⊞",
  3333. "boxtimes": "⊠",
  3334. "boxul": "┘",
  3335. "boxuL": "╛",
  3336. "boxUl": "╜",
  3337. "boxUL": "╝",
  3338. "boxur": "└",
  3339. "boxuR": "╘",
  3340. "boxUr": "╙",
  3341. "boxUR": "╚",
  3342. "boxv": "│",
  3343. "boxV": "║",
  3344. "boxvh": "┼",
  3345. "boxvH": "╪",
  3346. "boxVh": "╫",
  3347. "boxVH": "╬",
  3348. "boxvl": "┤",
  3349. "boxvL": "╡",
  3350. "boxVl": "╢",
  3351. "boxVL": "╣",
  3352. "boxvr": "├",
  3353. "boxvR": "╞",
  3354. "boxVr": "╟",
  3355. "boxVR": "╠",
  3356. "bprime": "‵",
  3357. "breve": "˘",
  3358. "Breve": "˘",
  3359. "brvbar": "¦",
  3360. "bscr": "𝒷",
  3361. "Bscr": "ℬ",
  3362. "bsemi": "⁏",
  3363. "bsim": "∽",
  3364. "bsime": "⋍",
  3365. "bsolb": "⧅",
  3366. "bsol": "\\",
  3367. "bsolhsub": "⟈",
  3368. "bull": "•",
  3369. "bullet": "•",
  3370. "bump": "≎",
  3371. "bumpE": "⪮",
  3372. "bumpe": "≏",
  3373. "Bumpeq": "≎",
  3374. "bumpeq": "≏",
  3375. "Cacute": "Ć",
  3376. "cacute": "ć",
  3377. "capand": "⩄",
  3378. "capbrcup": "⩉",
  3379. "capcap": "⩋",
  3380. "cap": "∩",
  3381. "Cap": "⋒",
  3382. "capcup": "⩇",
  3383. "capdot": "⩀",
  3384. "CapitalDifferentialD": "ⅅ",
  3385. "caps": "∩︀",
  3386. "caret": "⁁",
  3387. "caron": "ˇ",
  3388. "Cayleys": "ℭ",
  3389. "ccaps": "⩍",
  3390. "Ccaron": "Č",
  3391. "ccaron": "č",
  3392. "Ccedil": "Ç",
  3393. "ccedil": "ç",
  3394. "Ccirc": "Ĉ",
  3395. "ccirc": "ĉ",
  3396. "Cconint": "∰",
  3397. "ccups": "⩌",
  3398. "ccupssm": "⩐",
  3399. "Cdot": "Ċ",
  3400. "cdot": "ċ",
  3401. "cedil": "¸",
  3402. "Cedilla": "¸",
  3403. "cemptyv": "⦲",
  3404. "cent": "¢",
  3405. "centerdot": "·",
  3406. "CenterDot": "·",
  3407. "cfr": "𝔠",
  3408. "Cfr": "ℭ",
  3409. "CHcy": "Ч",
  3410. "chcy": "ч",
  3411. "check": "✓",
  3412. "checkmark": "✓",
  3413. "Chi": "Χ",
  3414. "chi": "χ",
  3415. "circ": "ˆ",
  3416. "circeq": "≗",
  3417. "circlearrowleft": "↺",
  3418. "circlearrowright": "↻",
  3419. "circledast": "⊛",
  3420. "circledcirc": "⊚",
  3421. "circleddash": "⊝",
  3422. "CircleDot": "⊙",
  3423. "circledR": "®",
  3424. "circledS": "Ⓢ",
  3425. "CircleMinus": "⊖",
  3426. "CirclePlus": "⊕",
  3427. "CircleTimes": "⊗",
  3428. "cir": "○",
  3429. "cirE": "⧃",
  3430. "cire": "≗",
  3431. "cirfnint": "⨐",
  3432. "cirmid": "⫯",
  3433. "cirscir": "⧂",
  3434. "ClockwiseContourIntegral": "∲",
  3435. "CloseCurlyDoubleQuote": "”",
  3436. "CloseCurlyQuote": "’",
  3437. "clubs": "♣",
  3438. "clubsuit": "♣",
  3439. "colon": ":",
  3440. "Colon": "∷",
  3441. "Colone": "⩴",
  3442. "colone": "≔",
  3443. "coloneq": "≔",
  3444. "comma": ",",
  3445. "commat": "@",
  3446. "comp": "∁",
  3447. "compfn": "∘",
  3448. "complement": "∁",
  3449. "complexes": "ℂ",
  3450. "cong": "≅",
  3451. "congdot": "⩭",
  3452. "Congruent": "≡",
  3453. "conint": "∮",
  3454. "Conint": "∯",
  3455. "ContourIntegral": "∮",
  3456. "copf": "𝕔",
  3457. "Copf": "ℂ",
  3458. "coprod": "∐",
  3459. "Coproduct": "∐",
  3460. "copy": "©",
  3461. "COPY": "©",
  3462. "copysr": "℗",
  3463. "CounterClockwiseContourIntegral": "∳",
  3464. "crarr": "↵",
  3465. "cross": "✗",
  3466. "Cross": "⨯",
  3467. "Cscr": "𝒞",
  3468. "cscr": "𝒸",
  3469. "csub": "⫏",
  3470. "csube": "⫑",
  3471. "csup": "⫐",
  3472. "csupe": "⫒",
  3473. "ctdot": "⋯",
  3474. "cudarrl": "⤸",
  3475. "cudarrr": "⤵",
  3476. "cuepr": "⋞",
  3477. "cuesc": "⋟",
  3478. "cularr": "↶",
  3479. "cularrp": "⤽",
  3480. "cupbrcap": "⩈",
  3481. "cupcap": "⩆",
  3482. "CupCap": "≍",
  3483. "cup": "∪",
  3484. "Cup": "⋓",
  3485. "cupcup": "⩊",
  3486. "cupdot": "⊍",
  3487. "cupor": "⩅",
  3488. "cups": "∪︀",
  3489. "curarr": "↷",
  3490. "curarrm": "⤼",
  3491. "curlyeqprec": "⋞",
  3492. "curlyeqsucc": "⋟",
  3493. "curlyvee": "⋎",
  3494. "curlywedge": "⋏",
  3495. "curren": "¤",
  3496. "curvearrowleft": "↶",
  3497. "curvearrowright": "↷",
  3498. "cuvee": "⋎",
  3499. "cuwed": "⋏",
  3500. "cwconint": "∲",
  3501. "cwint": "∱",
  3502. "cylcty": "⌭",
  3503. "dagger": "†",
  3504. "Dagger": "‡",
  3505. "daleth": "ℸ",
  3506. "darr": "↓",
  3507. "Darr": "↡",
  3508. "dArr": "⇓",
  3509. "dash": "‐",
  3510. "Dashv": "⫤",
  3511. "dashv": "⊣",
  3512. "dbkarow": "⤏",
  3513. "dblac": "˝",
  3514. "Dcaron": "Ď",
  3515. "dcaron": "ď",
  3516. "Dcy": "Д",
  3517. "dcy": "д",
  3518. "ddagger": "‡",
  3519. "ddarr": "⇊",
  3520. "DD": "ⅅ",
  3521. "dd": "ⅆ",
  3522. "DDotrahd": "⤑",
  3523. "ddotseq": "⩷",
  3524. "deg": "°",
  3525. "Del": "∇",
  3526. "Delta": "Δ",
  3527. "delta": "δ",
  3528. "demptyv": "⦱",
  3529. "dfisht": "⥿",
  3530. "Dfr": "𝔇",
  3531. "dfr": "𝔡",
  3532. "dHar": "⥥",
  3533. "dharl": "⇃",
  3534. "dharr": "⇂",
  3535. "DiacriticalAcute": "´",
  3536. "DiacriticalDot": "˙",
  3537. "DiacriticalDoubleAcute": "˝",
  3538. "DiacriticalGrave": "`",
  3539. "DiacriticalTilde": "˜",
  3540. "diam": "⋄",
  3541. "diamond": "⋄",
  3542. "Diamond": "⋄",
  3543. "diamondsuit": "♦",
  3544. "diams": "♦",
  3545. "die": "¨",
  3546. "DifferentialD": "ⅆ",
  3547. "digamma": "ϝ",
  3548. "disin": "⋲",
  3549. "div": "÷",
  3550. "divide": "÷",
  3551. "divideontimes": "⋇",
  3552. "divonx": "⋇",
  3553. "DJcy": "Ђ",
  3554. "djcy": "ђ",
  3555. "dlcorn": "⌞",
  3556. "dlcrop": "⌍",
  3557. "dollar": "$",
  3558. "Dopf": "𝔻",
  3559. "dopf": "𝕕",
  3560. "Dot": "¨",
  3561. "dot": "˙",
  3562. "DotDot": "⃜",
  3563. "doteq": "≐",
  3564. "doteqdot": "≑",
  3565. "DotEqual": "≐",
  3566. "dotminus": "∸",
  3567. "dotplus": "∔",
  3568. "dotsquare": "⊡",
  3569. "doublebarwedge": "⌆",
  3570. "DoubleContourIntegral": "∯",
  3571. "DoubleDot": "¨",
  3572. "DoubleDownArrow": "⇓",
  3573. "DoubleLeftArrow": "⇐",
  3574. "DoubleLeftRightArrow": "⇔",
  3575. "DoubleLeftTee": "⫤",
  3576. "DoubleLongLeftArrow": "⟸",
  3577. "DoubleLongLeftRightArrow": "⟺",
  3578. "DoubleLongRightArrow": "⟹",
  3579. "DoubleRightArrow": "⇒",
  3580. "DoubleRightTee": "⊨",
  3581. "DoubleUpArrow": "⇑",
  3582. "DoubleUpDownArrow": "⇕",
  3583. "DoubleVerticalBar": "∥",
  3584. "DownArrowBar": "⤓",
  3585. "downarrow": "↓",
  3586. "DownArrow": "↓",
  3587. "Downarrow": "⇓",
  3588. "DownArrowUpArrow": "⇵",
  3589. "DownBreve": "̑",
  3590. "downdownarrows": "⇊",
  3591. "downharpoonleft": "⇃",
  3592. "downharpoonright": "⇂",
  3593. "DownLeftRightVector": "⥐",
  3594. "DownLeftTeeVector": "⥞",
  3595. "DownLeftVectorBar": "⥖",
  3596. "DownLeftVector": "↽",
  3597. "DownRightTeeVector": "⥟",
  3598. "DownRightVectorBar": "⥗",
  3599. "DownRightVector": "⇁",
  3600. "DownTeeArrow": "↧",
  3601. "DownTee": "⊤",
  3602. "drbkarow": "⤐",
  3603. "drcorn": "⌟",
  3604. "drcrop": "⌌",
  3605. "Dscr": "𝒟",
  3606. "dscr": "𝒹",
  3607. "DScy": "Ѕ",
  3608. "dscy": "ѕ",
  3609. "dsol": "⧶",
  3610. "Dstrok": "Đ",
  3611. "dstrok": "đ",
  3612. "dtdot": "⋱",
  3613. "dtri": "▿",
  3614. "dtrif": "▾",
  3615. "duarr": "⇵",
  3616. "duhar": "⥯",
  3617. "dwangle": "⦦",
  3618. "DZcy": "Џ",
  3619. "dzcy": "џ",
  3620. "dzigrarr": "⟿",
  3621. "Eacute": "É",
  3622. "eacute": "é",
  3623. "easter": "⩮",
  3624. "Ecaron": "Ě",
  3625. "ecaron": "ě",
  3626. "Ecirc": "Ê",
  3627. "ecirc": "ê",
  3628. "ecir": "≖",
  3629. "ecolon": "≕",
  3630. "Ecy": "Э",
  3631. "ecy": "э",
  3632. "eDDot": "⩷",
  3633. "Edot": "Ė",
  3634. "edot": "ė",
  3635. "eDot": "≑",
  3636. "ee": "ⅇ",
  3637. "efDot": "≒",
  3638. "Efr": "𝔈",
  3639. "efr": "𝔢",
  3640. "eg": "⪚",
  3641. "Egrave": "È",
  3642. "egrave": "è",
  3643. "egs": "⪖",
  3644. "egsdot": "⪘",
  3645. "el": "⪙",
  3646. "Element": "∈",
  3647. "elinters": "⏧",
  3648. "ell": "ℓ",
  3649. "els": "⪕",
  3650. "elsdot": "⪗",
  3651. "Emacr": "Ē",
  3652. "emacr": "ē",
  3653. "empty": "∅",
  3654. "emptyset": "∅",
  3655. "EmptySmallSquare": "◻",
  3656. "emptyv": "∅",
  3657. "EmptyVerySmallSquare": "▫",
  3658. "emsp13": " ",
  3659. "emsp14": " ",
  3660. "emsp": " ",
  3661. "ENG": "Ŋ",
  3662. "eng": "ŋ",
  3663. "ensp": " ",
  3664. "Eogon": "Ę",
  3665. "eogon": "ę",
  3666. "Eopf": "𝔼",
  3667. "eopf": "𝕖",
  3668. "epar": "⋕",
  3669. "eparsl": "⧣",
  3670. "eplus": "⩱",
  3671. "epsi": "ε",
  3672. "Epsilon": "Ε",
  3673. "epsilon": "ε",
  3674. "epsiv": "ϵ",
  3675. "eqcirc": "≖",
  3676. "eqcolon": "≕",
  3677. "eqsim": "≂",
  3678. "eqslantgtr": "⪖",
  3679. "eqslantless": "⪕",
  3680. "Equal": "⩵",
  3681. "equals": "=",
  3682. "EqualTilde": "≂",
  3683. "equest": "≟",
  3684. "Equilibrium": "⇌",
  3685. "equiv": "≡",
  3686. "equivDD": "⩸",
  3687. "eqvparsl": "⧥",
  3688. "erarr": "⥱",
  3689. "erDot": "≓",
  3690. "escr": "ℯ",
  3691. "Escr": "ℰ",
  3692. "esdot": "≐",
  3693. "Esim": "⩳",
  3694. "esim": "≂",
  3695. "Eta": "Η",
  3696. "eta": "η",
  3697. "ETH": "Ð",
  3698. "eth": "ð",
  3699. "Euml": "Ë",
  3700. "euml": "ë",
  3701. "euro": "€",
  3702. "excl": "!",
  3703. "exist": "∃",
  3704. "Exists": "∃",
  3705. "expectation": "ℰ",
  3706. "exponentiale": "ⅇ",
  3707. "ExponentialE": "ⅇ",
  3708. "fallingdotseq": "≒",
  3709. "Fcy": "Ф",
  3710. "fcy": "ф",
  3711. "female": "♀",
  3712. "ffilig": "ffi",
  3713. "fflig": "ff",
  3714. "ffllig": "ffl",
  3715. "Ffr": "𝔉",
  3716. "ffr": "𝔣",
  3717. "filig": "fi",
  3718. "FilledSmallSquare": "◼",
  3719. "FilledVerySmallSquare": "▪",
  3720. "fjlig": "fj",
  3721. "flat": "♭",
  3722. "fllig": "fl",
  3723. "fltns": "▱",
  3724. "fnof": "ƒ",
  3725. "Fopf": "𝔽",
  3726. "fopf": "𝕗",
  3727. "forall": "∀",
  3728. "ForAll": "∀",
  3729. "fork": "⋔",
  3730. "forkv": "⫙",
  3731. "Fouriertrf": "ℱ",
  3732. "fpartint": "⨍",
  3733. "frac12": "½",
  3734. "frac13": "⅓",
  3735. "frac14": "¼",
  3736. "frac15": "⅕",
  3737. "frac16": "⅙",
  3738. "frac18": "⅛",
  3739. "frac23": "⅔",
  3740. "frac25": "⅖",
  3741. "frac34": "¾",
  3742. "frac35": "⅗",
  3743. "frac38": "⅜",
  3744. "frac45": "⅘",
  3745. "frac56": "⅚",
  3746. "frac58": "⅝",
  3747. "frac78": "⅞",
  3748. "frasl": "⁄",
  3749. "frown": "⌢",
  3750. "fscr": "𝒻",
  3751. "Fscr": "ℱ",
  3752. "gacute": "ǵ",
  3753. "Gamma": "Γ",
  3754. "gamma": "γ",
  3755. "Gammad": "Ϝ",
  3756. "gammad": "ϝ",
  3757. "gap": "⪆",
  3758. "Gbreve": "Ğ",
  3759. "gbreve": "ğ",
  3760. "Gcedil": "Ģ",
  3761. "Gcirc": "Ĝ",
  3762. "gcirc": "ĝ",
  3763. "Gcy": "Г",
  3764. "gcy": "г",
  3765. "Gdot": "Ġ",
  3766. "gdot": "ġ",
  3767. "ge": "≥",
  3768. "gE": "≧",
  3769. "gEl": "⪌",
  3770. "gel": "⋛",
  3771. "geq": "≥",
  3772. "geqq": "≧",
  3773. "geqslant": "⩾",
  3774. "gescc": "⪩",
  3775. "ges": "⩾",
  3776. "gesdot": "⪀",
  3777. "gesdoto": "⪂",
  3778. "gesdotol": "⪄",
  3779. "gesl": "⋛︀",
  3780. "gesles": "⪔",
  3781. "Gfr": "𝔊",
  3782. "gfr": "𝔤",
  3783. "gg": "≫",
  3784. "Gg": "⋙",
  3785. "ggg": "⋙",
  3786. "gimel": "ℷ",
  3787. "GJcy": "Ѓ",
  3788. "gjcy": "ѓ",
  3789. "gla": "⪥",
  3790. "gl": "≷",
  3791. "glE": "⪒",
  3792. "glj": "⪤",
  3793. "gnap": "⪊",
  3794. "gnapprox": "⪊",
  3795. "gne": "⪈",
  3796. "gnE": "≩",
  3797. "gneq": "⪈",
  3798. "gneqq": "≩",
  3799. "gnsim": "⋧",
  3800. "Gopf": "𝔾",
  3801. "gopf": "𝕘",
  3802. "grave": "`",
  3803. "GreaterEqual": "≥",
  3804. "GreaterEqualLess": "⋛",
  3805. "GreaterFullEqual": "≧",
  3806. "GreaterGreater": "⪢",
  3807. "GreaterLess": "≷",
  3808. "GreaterSlantEqual": "⩾",
  3809. "GreaterTilde": "≳",
  3810. "Gscr": "𝒢",
  3811. "gscr": "ℊ",
  3812. "gsim": "≳",
  3813. "gsime": "⪎",
  3814. "gsiml": "⪐",
  3815. "gtcc": "⪧",
  3816. "gtcir": "⩺",
  3817. "gt": ">",
  3818. "GT": ">",
  3819. "Gt": "≫",
  3820. "gtdot": "⋗",
  3821. "gtlPar": "⦕",
  3822. "gtquest": "⩼",
  3823. "gtrapprox": "⪆",
  3824. "gtrarr": "⥸",
  3825. "gtrdot": "⋗",
  3826. "gtreqless": "⋛",
  3827. "gtreqqless": "⪌",
  3828. "gtrless": "≷",
  3829. "gtrsim": "≳",
  3830. "gvertneqq": "≩︀",
  3831. "gvnE": "≩︀",
  3832. "Hacek": "ˇ",
  3833. "hairsp": " ",
  3834. "half": "½",
  3835. "hamilt": "ℋ",
  3836. "HARDcy": "Ъ",
  3837. "hardcy": "ъ",
  3838. "harrcir": "⥈",
  3839. "harr": "↔",
  3840. "hArr": "⇔",
  3841. "harrw": "↭",
  3842. "Hat": "^",
  3843. "hbar": "ℏ",
  3844. "Hcirc": "Ĥ",
  3845. "hcirc": "ĥ",
  3846. "hearts": "♥",
  3847. "heartsuit": "♥",
  3848. "hellip": "…",
  3849. "hercon": "⊹",
  3850. "hfr": "𝔥",
  3851. "Hfr": "ℌ",
  3852. "HilbertSpace": "ℋ",
  3853. "hksearow": "⤥",
  3854. "hkswarow": "⤦",
  3855. "hoarr": "⇿",
  3856. "homtht": "∻",
  3857. "hookleftarrow": "↩",
  3858. "hookrightarrow": "↪",
  3859. "hopf": "𝕙",
  3860. "Hopf": "ℍ",
  3861. "horbar": "―",
  3862. "HorizontalLine": "─",
  3863. "hscr": "𝒽",
  3864. "Hscr": "ℋ",
  3865. "hslash": "ℏ",
  3866. "Hstrok": "Ħ",
  3867. "hstrok": "ħ",
  3868. "HumpDownHump": "≎",
  3869. "HumpEqual": "≏",
  3870. "hybull": "⁃",
  3871. "hyphen": "‐",
  3872. "Iacute": "Í",
  3873. "iacute": "í",
  3874. "ic": "⁣",
  3875. "Icirc": "Î",
  3876. "icirc": "î",
  3877. "Icy": "И",
  3878. "icy": "и",
  3879. "Idot": "İ",
  3880. "IEcy": "Е",
  3881. "iecy": "е",
  3882. "iexcl": "¡",
  3883. "iff": "⇔",
  3884. "ifr": "𝔦",
  3885. "Ifr": "ℑ",
  3886. "Igrave": "Ì",
  3887. "igrave": "ì",
  3888. "ii": "ⅈ",
  3889. "iiiint": "⨌",
  3890. "iiint": "∭",
  3891. "iinfin": "⧜",
  3892. "iiota": "℩",
  3893. "IJlig": "IJ",
  3894. "ijlig": "ij",
  3895. "Imacr": "Ī",
  3896. "imacr": "ī",
  3897. "image": "ℑ",
  3898. "ImaginaryI": "ⅈ",
  3899. "imagline": "ℐ",
  3900. "imagpart": "ℑ",
  3901. "imath": "ı",
  3902. "Im": "ℑ",
  3903. "imof": "⊷",
  3904. "imped": "Ƶ",
  3905. "Implies": "⇒",
  3906. "incare": "℅",
  3907. "in": "∈",
  3908. "infin": "∞",
  3909. "infintie": "⧝",
  3910. "inodot": "ı",
  3911. "intcal": "⊺",
  3912. "int": "∫",
  3913. "Int": "∬",
  3914. "integers": "ℤ",
  3915. "Integral": "∫",
  3916. "intercal": "⊺",
  3917. "Intersection": "⋂",
  3918. "intlarhk": "⨗",
  3919. "intprod": "⨼",
  3920. "InvisibleComma": "⁣",
  3921. "InvisibleTimes": "⁢",
  3922. "IOcy": "Ё",
  3923. "iocy": "ё",
  3924. "Iogon": "Į",
  3925. "iogon": "į",
  3926. "Iopf": "𝕀",
  3927. "iopf": "𝕚",
  3928. "Iota": "Ι",
  3929. "iota": "ι",
  3930. "iprod": "⨼",
  3931. "iquest": "¿",
  3932. "iscr": "𝒾",
  3933. "Iscr": "ℐ",
  3934. "isin": "∈",
  3935. "isindot": "⋵",
  3936. "isinE": "⋹",
  3937. "isins": "⋴",
  3938. "isinsv": "⋳",
  3939. "isinv": "∈",
  3940. "it": "⁢",
  3941. "Itilde": "Ĩ",
  3942. "itilde": "ĩ",
  3943. "Iukcy": "І",
  3944. "iukcy": "і",
  3945. "Iuml": "Ï",
  3946. "iuml": "ï",
  3947. "Jcirc": "Ĵ",
  3948. "jcirc": "ĵ",
  3949. "Jcy": "Й",
  3950. "jcy": "й",
  3951. "Jfr": "𝔍",
  3952. "jfr": "𝔧",
  3953. "jmath": "ȷ",
  3954. "Jopf": "𝕁",
  3955. "jopf": "𝕛",
  3956. "Jscr": "𝒥",
  3957. "jscr": "𝒿",
  3958. "Jsercy": "Ј",
  3959. "jsercy": "ј",
  3960. "Jukcy": "Є",
  3961. "jukcy": "є",
  3962. "Kappa": "Κ",
  3963. "kappa": "κ",
  3964. "kappav": "ϰ",
  3965. "Kcedil": "Ķ",
  3966. "kcedil": "ķ",
  3967. "Kcy": "К",
  3968. "kcy": "к",
  3969. "Kfr": "𝔎",
  3970. "kfr": "𝔨",
  3971. "kgreen": "ĸ",
  3972. "KHcy": "Х",
  3973. "khcy": "х",
  3974. "KJcy": "Ќ",
  3975. "kjcy": "ќ",
  3976. "Kopf": "𝕂",
  3977. "kopf": "𝕜",
  3978. "Kscr": "𝒦",
  3979. "kscr": "𝓀",
  3980. "lAarr": "⇚",
  3981. "Lacute": "Ĺ",
  3982. "lacute": "ĺ",
  3983. "laemptyv": "⦴",
  3984. "lagran": "ℒ",
  3985. "Lambda": "Λ",
  3986. "lambda": "λ",
  3987. "lang": "⟨",
  3988. "Lang": "⟪",
  3989. "langd": "⦑",
  3990. "langle": "⟨",
  3991. "lap": "⪅",
  3992. "Laplacetrf": "ℒ",
  3993. "laquo": "«",
  3994. "larrb": "⇤",
  3995. "larrbfs": "⤟",
  3996. "larr": "←",
  3997. "Larr": "↞",
  3998. "lArr": "⇐",
  3999. "larrfs": "⤝",
  4000. "larrhk": "↩",
  4001. "larrlp": "↫",
  4002. "larrpl": "⤹",
  4003. "larrsim": "⥳",
  4004. "larrtl": "↢",
  4005. "latail": "⤙",
  4006. "lAtail": "⤛",
  4007. "lat": "⪫",
  4008. "late": "⪭",
  4009. "lates": "⪭︀",
  4010. "lbarr": "⤌",
  4011. "lBarr": "⤎",
  4012. "lbbrk": "❲",
  4013. "lbrace": "{",
  4014. "lbrack": "[",
  4015. "lbrke": "⦋",
  4016. "lbrksld": "⦏",
  4017. "lbrkslu": "⦍",
  4018. "Lcaron": "Ľ",
  4019. "lcaron": "ľ",
  4020. "Lcedil": "Ļ",
  4021. "lcedil": "ļ",
  4022. "lceil": "⌈",
  4023. "lcub": "{",
  4024. "Lcy": "Л",
  4025. "lcy": "л",
  4026. "ldca": "⤶",
  4027. "ldquo": "“",
  4028. "ldquor": "„",
  4029. "ldrdhar": "⥧",
  4030. "ldrushar": "⥋",
  4031. "ldsh": "↲",
  4032. "le": "≤",
  4033. "lE": "≦",
  4034. "LeftAngleBracket": "⟨",
  4035. "LeftArrowBar": "⇤",
  4036. "leftarrow": "←",
  4037. "LeftArrow": "←",
  4038. "Leftarrow": "⇐",
  4039. "LeftArrowRightArrow": "⇆",
  4040. "leftarrowtail": "↢",
  4041. "LeftCeiling": "⌈",
  4042. "LeftDoubleBracket": "⟦",
  4043. "LeftDownTeeVector": "⥡",
  4044. "LeftDownVectorBar": "⥙",
  4045. "LeftDownVector": "⇃",
  4046. "LeftFloor": "⌊",
  4047. "leftharpoondown": "↽",
  4048. "leftharpoonup": "↼",
  4049. "leftleftarrows": "⇇",
  4050. "leftrightarrow": "↔",
  4051. "LeftRightArrow": "↔",
  4052. "Leftrightarrow": "⇔",
  4053. "leftrightarrows": "⇆",
  4054. "leftrightharpoons": "⇋",
  4055. "leftrightsquigarrow": "↭",
  4056. "LeftRightVector": "⥎",
  4057. "LeftTeeArrow": "↤",
  4058. "LeftTee": "⊣",
  4059. "LeftTeeVector": "⥚",
  4060. "leftthreetimes": "⋋",
  4061. "LeftTriangleBar": "⧏",
  4062. "LeftTriangle": "⊲",
  4063. "LeftTriangleEqual": "⊴",
  4064. "LeftUpDownVector": "⥑",
  4065. "LeftUpTeeVector": "⥠",
  4066. "LeftUpVectorBar": "⥘",
  4067. "LeftUpVector": "↿",
  4068. "LeftVectorBar": "⥒",
  4069. "LeftVector": "↼",
  4070. "lEg": "⪋",
  4071. "leg": "⋚",
  4072. "leq": "≤",
  4073. "leqq": "≦",
  4074. "leqslant": "⩽",
  4075. "lescc": "⪨",
  4076. "les": "⩽",
  4077. "lesdot": "⩿",
  4078. "lesdoto": "⪁",
  4079. "lesdotor": "⪃",
  4080. "lesg": "⋚︀",
  4081. "lesges": "⪓",
  4082. "lessapprox": "⪅",
  4083. "lessdot": "⋖",
  4084. "lesseqgtr": "⋚",
  4085. "lesseqqgtr": "⪋",
  4086. "LessEqualGreater": "⋚",
  4087. "LessFullEqual": "≦",
  4088. "LessGreater": "≶",
  4089. "lessgtr": "≶",
  4090. "LessLess": "⪡",
  4091. "lesssim": "≲",
  4092. "LessSlantEqual": "⩽",
  4093. "LessTilde": "≲",
  4094. "lfisht": "⥼",
  4095. "lfloor": "⌊",
  4096. "Lfr": "𝔏",
  4097. "lfr": "𝔩",
  4098. "lg": "≶",
  4099. "lgE": "⪑",
  4100. "lHar": "⥢",
  4101. "lhard": "↽",
  4102. "lharu": "↼",
  4103. "lharul": "⥪",
  4104. "lhblk": "▄",
  4105. "LJcy": "Љ",
  4106. "ljcy": "љ",
  4107. "llarr": "⇇",
  4108. "ll": "≪",
  4109. "Ll": "⋘",
  4110. "llcorner": "⌞",
  4111. "Lleftarrow": "⇚",
  4112. "llhard": "⥫",
  4113. "lltri": "◺",
  4114. "Lmidot": "Ŀ",
  4115. "lmidot": "ŀ",
  4116. "lmoustache": "⎰",
  4117. "lmoust": "⎰",
  4118. "lnap": "⪉",
  4119. "lnapprox": "⪉",
  4120. "lne": "⪇",
  4121. "lnE": "≨",
  4122. "lneq": "⪇",
  4123. "lneqq": "≨",
  4124. "lnsim": "⋦",
  4125. "loang": "⟬",
  4126. "loarr": "⇽",
  4127. "lobrk": "⟦",
  4128. "longleftarrow": "⟵",
  4129. "LongLeftArrow": "⟵",
  4130. "Longleftarrow": "⟸",
  4131. "longleftrightarrow": "⟷",
  4132. "LongLeftRightArrow": "⟷",
  4133. "Longleftrightarrow": "⟺",
  4134. "longmapsto": "⟼",
  4135. "longrightarrow": "⟶",
  4136. "LongRightArrow": "⟶",
  4137. "Longrightarrow": "⟹",
  4138. "looparrowleft": "↫",
  4139. "looparrowright": "↬",
  4140. "lopar": "⦅",
  4141. "Lopf": "𝕃",
  4142. "lopf": "𝕝",
  4143. "loplus": "⨭",
  4144. "lotimes": "⨴",
  4145. "lowast": "∗",
  4146. "lowbar": "_",
  4147. "LowerLeftArrow": "↙",
  4148. "LowerRightArrow": "↘",
  4149. "loz": "◊",
  4150. "lozenge": "◊",
  4151. "lozf": "⧫",
  4152. "lpar": "(",
  4153. "lparlt": "⦓",
  4154. "lrarr": "⇆",
  4155. "lrcorner": "⌟",
  4156. "lrhar": "⇋",
  4157. "lrhard": "⥭",
  4158. "lrm": "‎",
  4159. "lrtri": "⊿",
  4160. "lsaquo": "‹",
  4161. "lscr": "𝓁",
  4162. "Lscr": "ℒ",
  4163. "lsh": "↰",
  4164. "Lsh": "↰",
  4165. "lsim": "≲",
  4166. "lsime": "⪍",
  4167. "lsimg": "⪏",
  4168. "lsqb": "[",
  4169. "lsquo": "‘",
  4170. "lsquor": "‚",
  4171. "Lstrok": "Ł",
  4172. "lstrok": "ł",
  4173. "ltcc": "⪦",
  4174. "ltcir": "⩹",
  4175. "lt": "<",
  4176. "LT": "<",
  4177. "Lt": "≪",
  4178. "ltdot": "⋖",
  4179. "lthree": "⋋",
  4180. "ltimes": "⋉",
  4181. "ltlarr": "⥶",
  4182. "ltquest": "⩻",
  4183. "ltri": "◃",
  4184. "ltrie": "⊴",
  4185. "ltrif": "◂",
  4186. "ltrPar": "⦖",
  4187. "lurdshar": "⥊",
  4188. "luruhar": "⥦",
  4189. "lvertneqq": "≨︀",
  4190. "lvnE": "≨︀",
  4191. "macr": "¯",
  4192. "male": "♂",
  4193. "malt": "✠",
  4194. "maltese": "✠",
  4195. "Map": "⤅",
  4196. "map": "↦",
  4197. "mapsto": "↦",
  4198. "mapstodown": "↧",
  4199. "mapstoleft": "↤",
  4200. "mapstoup": "↥",
  4201. "marker": "▮",
  4202. "mcomma": "⨩",
  4203. "Mcy": "М",
  4204. "mcy": "м",
  4205. "mdash": "—",
  4206. "mDDot": "∺",
  4207. "measuredangle": "∡",
  4208. "MediumSpace": " ",
  4209. "Mellintrf": "ℳ",
  4210. "Mfr": "𝔐",
  4211. "mfr": "𝔪",
  4212. "mho": "℧",
  4213. "micro": "µ",
  4214. "midast": "*",
  4215. "midcir": "⫰",
  4216. "mid": "∣",
  4217. "middot": "·",
  4218. "minusb": "⊟",
  4219. "minus": "−",
  4220. "minusd": "∸",
  4221. "minusdu": "⨪",
  4222. "MinusPlus": "∓",
  4223. "mlcp": "⫛",
  4224. "mldr": "…",
  4225. "mnplus": "∓",
  4226. "models": "⊧",
  4227. "Mopf": "𝕄",
  4228. "mopf": "𝕞",
  4229. "mp": "∓",
  4230. "mscr": "𝓂",
  4231. "Mscr": "ℳ",
  4232. "mstpos": "∾",
  4233. "Mu": "Μ",
  4234. "mu": "μ",
  4235. "multimap": "⊸",
  4236. "mumap": "⊸",
  4237. "nabla": "∇",
  4238. "Nacute": "Ń",
  4239. "nacute": "ń",
  4240. "nang": "∠⃒",
  4241. "nap": "≉",
  4242. "napE": "⩰̸",
  4243. "napid": "≋̸",
  4244. "napos": "ʼn",
  4245. "napprox": "≉",
  4246. "natural": "♮",
  4247. "naturals": "ℕ",
  4248. "natur": "♮",
  4249. "nbsp": " ",
  4250. "nbump": "≎̸",
  4251. "nbumpe": "≏̸",
  4252. "ncap": "⩃",
  4253. "Ncaron": "Ň",
  4254. "ncaron": "ň",
  4255. "Ncedil": "Ņ",
  4256. "ncedil": "ņ",
  4257. "ncong": "≇",
  4258. "ncongdot": "⩭̸",
  4259. "ncup": "⩂",
  4260. "Ncy": "Н",
  4261. "ncy": "н",
  4262. "ndash": "–",
  4263. "nearhk": "⤤",
  4264. "nearr": "↗",
  4265. "neArr": "⇗",
  4266. "nearrow": "↗",
  4267. "ne": "≠",
  4268. "nedot": "≐̸",
  4269. "NegativeMediumSpace": "​",
  4270. "NegativeThickSpace": "​",
  4271. "NegativeThinSpace": "​",
  4272. "NegativeVeryThinSpace": "​",
  4273. "nequiv": "≢",
  4274. "nesear": "⤨",
  4275. "nesim": "≂̸",
  4276. "NestedGreaterGreater": "≫",
  4277. "NestedLessLess": "≪",
  4278. "NewLine": "\n",
  4279. "nexist": "∄",
  4280. "nexists": "∄",
  4281. "Nfr": "𝔑",
  4282. "nfr": "𝔫",
  4283. "ngE": "≧̸",
  4284. "nge": "≱",
  4285. "ngeq": "≱",
  4286. "ngeqq": "≧̸",
  4287. "ngeqslant": "⩾̸",
  4288. "nges": "⩾̸",
  4289. "nGg": "⋙̸",
  4290. "ngsim": "≵",
  4291. "nGt": "≫⃒",
  4292. "ngt": "≯",
  4293. "ngtr": "≯",
  4294. "nGtv": "≫̸",
  4295. "nharr": "↮",
  4296. "nhArr": "⇎",
  4297. "nhpar": "⫲",
  4298. "ni": "∋",
  4299. "nis": "⋼",
  4300. "nisd": "⋺",
  4301. "niv": "∋",
  4302. "NJcy": "Њ",
  4303. "njcy": "њ",
  4304. "nlarr": "↚",
  4305. "nlArr": "⇍",
  4306. "nldr": "‥",
  4307. "nlE": "≦̸",
  4308. "nle": "≰",
  4309. "nleftarrow": "↚",
  4310. "nLeftarrow": "⇍",
  4311. "nleftrightarrow": "↮",
  4312. "nLeftrightarrow": "⇎",
  4313. "nleq": "≰",
  4314. "nleqq": "≦̸",
  4315. "nleqslant": "⩽̸",
  4316. "nles": "⩽̸",
  4317. "nless": "≮",
  4318. "nLl": "⋘̸",
  4319. "nlsim": "≴",
  4320. "nLt": "≪⃒",
  4321. "nlt": "≮",
  4322. "nltri": "⋪",
  4323. "nltrie": "⋬",
  4324. "nLtv": "≪̸",
  4325. "nmid": "∤",
  4326. "NoBreak": "⁠",
  4327. "NonBreakingSpace": " ",
  4328. "nopf": "𝕟",
  4329. "Nopf": "ℕ",
  4330. "Not": "⫬",
  4331. "not": "¬",
  4332. "NotCongruent": "≢",
  4333. "NotCupCap": "≭",
  4334. "NotDoubleVerticalBar": "∦",
  4335. "NotElement": "∉",
  4336. "NotEqual": "≠",
  4337. "NotEqualTilde": "≂̸",
  4338. "NotExists": "∄",
  4339. "NotGreater": "≯",
  4340. "NotGreaterEqual": "≱",
  4341. "NotGreaterFullEqual": "≧̸",
  4342. "NotGreaterGreater": "≫̸",
  4343. "NotGreaterLess": "≹",
  4344. "NotGreaterSlantEqual": "⩾̸",
  4345. "NotGreaterTilde": "≵",
  4346. "NotHumpDownHump": "≎̸",
  4347. "NotHumpEqual": "≏̸",
  4348. "notin": "∉",
  4349. "notindot": "⋵̸",
  4350. "notinE": "⋹̸",
  4351. "notinva": "∉",
  4352. "notinvb": "⋷",
  4353. "notinvc": "⋶",
  4354. "NotLeftTriangleBar": "⧏̸",
  4355. "NotLeftTriangle": "⋪",
  4356. "NotLeftTriangleEqual": "⋬",
  4357. "NotLess": "≮",
  4358. "NotLessEqual": "≰",
  4359. "NotLessGreater": "≸",
  4360. "NotLessLess": "≪̸",
  4361. "NotLessSlantEqual": "⩽̸",
  4362. "NotLessTilde": "≴",
  4363. "NotNestedGreaterGreater": "⪢̸",
  4364. "NotNestedLessLess": "⪡̸",
  4365. "notni": "∌",
  4366. "notniva": "∌",
  4367. "notnivb": "⋾",
  4368. "notnivc": "⋽",
  4369. "NotPrecedes": "⊀",
  4370. "NotPrecedesEqual": "⪯̸",
  4371. "NotPrecedesSlantEqual": "⋠",
  4372. "NotReverseElement": "∌",
  4373. "NotRightTriangleBar": "⧐̸",
  4374. "NotRightTriangle": "⋫",
  4375. "NotRightTriangleEqual": "⋭",
  4376. "NotSquareSubset": "⊏̸",
  4377. "NotSquareSubsetEqual": "⋢",
  4378. "NotSquareSuperset": "⊐̸",
  4379. "NotSquareSupersetEqual": "⋣",
  4380. "NotSubset": "⊂⃒",
  4381. "NotSubsetEqual": "⊈",
  4382. "NotSucceeds": "⊁",
  4383. "NotSucceedsEqual": "⪰̸",
  4384. "NotSucceedsSlantEqual": "⋡",
  4385. "NotSucceedsTilde": "≿̸",
  4386. "NotSuperset": "⊃⃒",
  4387. "NotSupersetEqual": "⊉",
  4388. "NotTilde": "≁",
  4389. "NotTildeEqual": "≄",
  4390. "NotTildeFullEqual": "≇",
  4391. "NotTildeTilde": "≉",
  4392. "NotVerticalBar": "∤",
  4393. "nparallel": "∦",
  4394. "npar": "∦",
  4395. "nparsl": "⫽⃥",
  4396. "npart": "∂̸",
  4397. "npolint": "⨔",
  4398. "npr": "⊀",
  4399. "nprcue": "⋠",
  4400. "nprec": "⊀",
  4401. "npreceq": "⪯̸",
  4402. "npre": "⪯̸",
  4403. "nrarrc": "⤳̸",
  4404. "nrarr": "↛",
  4405. "nrArr": "⇏",
  4406. "nrarrw": "↝̸",
  4407. "nrightarrow": "↛",
  4408. "nRightarrow": "⇏",
  4409. "nrtri": "⋫",
  4410. "nrtrie": "⋭",
  4411. "nsc": "⊁",
  4412. "nsccue": "⋡",
  4413. "nsce": "⪰̸",
  4414. "Nscr": "𝒩",
  4415. "nscr": "𝓃",
  4416. "nshortmid": "∤",
  4417. "nshortparallel": "∦",
  4418. "nsim": "≁",
  4419. "nsime": "≄",
  4420. "nsimeq": "≄",
  4421. "nsmid": "∤",
  4422. "nspar": "∦",
  4423. "nsqsube": "⋢",
  4424. "nsqsupe": "⋣",
  4425. "nsub": "⊄",
  4426. "nsubE": "⫅̸",
  4427. "nsube": "⊈",
  4428. "nsubset": "⊂⃒",
  4429. "nsubseteq": "⊈",
  4430. "nsubseteqq": "⫅̸",
  4431. "nsucc": "⊁",
  4432. "nsucceq": "⪰̸",
  4433. "nsup": "⊅",
  4434. "nsupE": "⫆̸",
  4435. "nsupe": "⊉",
  4436. "nsupset": "⊃⃒",
  4437. "nsupseteq": "⊉",
  4438. "nsupseteqq": "⫆̸",
  4439. "ntgl": "≹",
  4440. "Ntilde": "Ñ",
  4441. "ntilde": "ñ",
  4442. "ntlg": "≸",
  4443. "ntriangleleft": "⋪",
  4444. "ntrianglelefteq": "⋬",
  4445. "ntriangleright": "⋫",
  4446. "ntrianglerighteq": "⋭",
  4447. "Nu": "Ν",
  4448. "nu": "ν",
  4449. "num": "#",
  4450. "numero": "№",
  4451. "numsp": " ",
  4452. "nvap": "≍⃒",
  4453. "nvdash": "⊬",
  4454. "nvDash": "⊭",
  4455. "nVdash": "⊮",
  4456. "nVDash": "⊯",
  4457. "nvge": "≥⃒",
  4458. "nvgt": ">⃒",
  4459. "nvHarr": "⤄",
  4460. "nvinfin": "⧞",
  4461. "nvlArr": "⤂",
  4462. "nvle": "≤⃒",
  4463. "nvlt": "<⃒",
  4464. "nvltrie": "⊴⃒",
  4465. "nvrArr": "⤃",
  4466. "nvrtrie": "⊵⃒",
  4467. "nvsim": "∼⃒",
  4468. "nwarhk": "⤣",
  4469. "nwarr": "↖",
  4470. "nwArr": "⇖",
  4471. "nwarrow": "↖",
  4472. "nwnear": "⤧",
  4473. "Oacute": "Ó",
  4474. "oacute": "ó",
  4475. "oast": "⊛",
  4476. "Ocirc": "Ô",
  4477. "ocirc": "ô",
  4478. "ocir": "⊚",
  4479. "Ocy": "О",
  4480. "ocy": "о",
  4481. "odash": "⊝",
  4482. "Odblac": "Ő",
  4483. "odblac": "ő",
  4484. "odiv": "⨸",
  4485. "odot": "⊙",
  4486. "odsold": "⦼",
  4487. "OElig": "Œ",
  4488. "oelig": "œ",
  4489. "ofcir": "⦿",
  4490. "Ofr": "𝔒",
  4491. "ofr": "𝔬",
  4492. "ogon": "˛",
  4493. "Ograve": "Ò",
  4494. "ograve": "ò",
  4495. "ogt": "⧁",
  4496. "ohbar": "⦵",
  4497. "ohm": "Ω",
  4498. "oint": "∮",
  4499. "olarr": "↺",
  4500. "olcir": "⦾",
  4501. "olcross": "⦻",
  4502. "oline": "‾",
  4503. "olt": "⧀",
  4504. "Omacr": "Ō",
  4505. "omacr": "ō",
  4506. "Omega": "Ω",
  4507. "omega": "ω",
  4508. "Omicron": "Ο",
  4509. "omicron": "ο",
  4510. "omid": "⦶",
  4511. "ominus": "⊖",
  4512. "Oopf": "𝕆",
  4513. "oopf": "𝕠",
  4514. "opar": "⦷",
  4515. "OpenCurlyDoubleQuote": "“",
  4516. "OpenCurlyQuote": "‘",
  4517. "operp": "⦹",
  4518. "oplus": "⊕",
  4519. "orarr": "↻",
  4520. "Or": "⩔",
  4521. "or": "∨",
  4522. "ord": "⩝",
  4523. "order": "ℴ",
  4524. "orderof": "ℴ",
  4525. "ordf": "ª",
  4526. "ordm": "º",
  4527. "origof": "⊶",
  4528. "oror": "⩖",
  4529. "orslope": "⩗",
  4530. "orv": "⩛",
  4531. "oS": "Ⓢ",
  4532. "Oscr": "𝒪",
  4533. "oscr": "ℴ",
  4534. "Oslash": "Ø",
  4535. "oslash": "ø",
  4536. "osol": "⊘",
  4537. "Otilde": "Õ",
  4538. "otilde": "õ",
  4539. "otimesas": "⨶",
  4540. "Otimes": "⨷",
  4541. "otimes": "⊗",
  4542. "Ouml": "Ö",
  4543. "ouml": "ö",
  4544. "ovbar": "⌽",
  4545. "OverBar": "‾",
  4546. "OverBrace": "⏞",
  4547. "OverBracket": "⎴",
  4548. "OverParenthesis": "⏜",
  4549. "para": "¶",
  4550. "parallel": "∥",
  4551. "par": "∥",
  4552. "parsim": "⫳",
  4553. "parsl": "⫽",
  4554. "part": "∂",
  4555. "PartialD": "∂",
  4556. "Pcy": "П",
  4557. "pcy": "п",
  4558. "percnt": "%",
  4559. "period": ".",
  4560. "permil": "‰",
  4561. "perp": "⊥",
  4562. "pertenk": "‱",
  4563. "Pfr": "𝔓",
  4564. "pfr": "𝔭",
  4565. "Phi": "Φ",
  4566. "phi": "φ",
  4567. "phiv": "ϕ",
  4568. "phmmat": "ℳ",
  4569. "phone": "☎",
  4570. "Pi": "Π",
  4571. "pi": "π",
  4572. "pitchfork": "⋔",
  4573. "piv": "ϖ",
  4574. "planck": "ℏ",
  4575. "planckh": "ℎ",
  4576. "plankv": "ℏ",
  4577. "plusacir": "⨣",
  4578. "plusb": "⊞",
  4579. "pluscir": "⨢",
  4580. "plus": "+",
  4581. "plusdo": "∔",
  4582. "plusdu": "⨥",
  4583. "pluse": "⩲",
  4584. "PlusMinus": "±",
  4585. "plusmn": "±",
  4586. "plussim": "⨦",
  4587. "plustwo": "⨧",
  4588. "pm": "±",
  4589. "Poincareplane": "ℌ",
  4590. "pointint": "⨕",
  4591. "popf": "𝕡",
  4592. "Popf": "ℙ",
  4593. "pound": "£",
  4594. "prap": "⪷",
  4595. "Pr": "⪻",
  4596. "pr": "≺",
  4597. "prcue": "≼",
  4598. "precapprox": "⪷",
  4599. "prec": "≺",
  4600. "preccurlyeq": "≼",
  4601. "Precedes": "≺",
  4602. "PrecedesEqual": "⪯",
  4603. "PrecedesSlantEqual": "≼",
  4604. "PrecedesTilde": "≾",
  4605. "preceq": "⪯",
  4606. "precnapprox": "⪹",
  4607. "precneqq": "⪵",
  4608. "precnsim": "⋨",
  4609. "pre": "⪯",
  4610. "prE": "⪳",
  4611. "precsim": "≾",
  4612. "prime": "′",
  4613. "Prime": "″",
  4614. "primes": "ℙ",
  4615. "prnap": "⪹",
  4616. "prnE": "⪵",
  4617. "prnsim": "⋨",
  4618. "prod": "∏",
  4619. "Product": "∏",
  4620. "profalar": "⌮",
  4621. "profline": "⌒",
  4622. "profsurf": "⌓",
  4623. "prop": "∝",
  4624. "Proportional": "∝",
  4625. "Proportion": "∷",
  4626. "propto": "∝",
  4627. "prsim": "≾",
  4628. "prurel": "⊰",
  4629. "Pscr": "𝒫",
  4630. "pscr": "𝓅",
  4631. "Psi": "Ψ",
  4632. "psi": "ψ",
  4633. "puncsp": " ",
  4634. "Qfr": "𝔔",
  4635. "qfr": "𝔮",
  4636. "qint": "⨌",
  4637. "qopf": "𝕢",
  4638. "Qopf": "ℚ",
  4639. "qprime": "⁗",
  4640. "Qscr": "𝒬",
  4641. "qscr": "𝓆",
  4642. "quaternions": "ℍ",
  4643. "quatint": "⨖",
  4644. "quest": "?",
  4645. "questeq": "≟",
  4646. "quot": "\"",
  4647. "QUOT": "\"",
  4648. "rAarr": "⇛",
  4649. "race": "∽̱",
  4650. "Racute": "Ŕ",
  4651. "racute": "ŕ",
  4652. "radic": "√",
  4653. "raemptyv": "⦳",
  4654. "rang": "⟩",
  4655. "Rang": "⟫",
  4656. "rangd": "⦒",
  4657. "range": "⦥",
  4658. "rangle": "⟩",
  4659. "raquo": "»",
  4660. "rarrap": "⥵",
  4661. "rarrb": "⇥",
  4662. "rarrbfs": "⤠",
  4663. "rarrc": "⤳",
  4664. "rarr": "→",
  4665. "Rarr": "↠",
  4666. "rArr": "⇒",
  4667. "rarrfs": "⤞",
  4668. "rarrhk": "↪",
  4669. "rarrlp": "↬",
  4670. "rarrpl": "⥅",
  4671. "rarrsim": "⥴",
  4672. "Rarrtl": "⤖",
  4673. "rarrtl": "↣",
  4674. "rarrw": "↝",
  4675. "ratail": "⤚",
  4676. "rAtail": "⤜",
  4677. "ratio": "∶",
  4678. "rationals": "ℚ",
  4679. "rbarr": "⤍",
  4680. "rBarr": "⤏",
  4681. "RBarr": "⤐",
  4682. "rbbrk": "❳",
  4683. "rbrace": "}",
  4684. "rbrack": "]",
  4685. "rbrke": "⦌",
  4686. "rbrksld": "⦎",
  4687. "rbrkslu": "⦐",
  4688. "Rcaron": "Ř",
  4689. "rcaron": "ř",
  4690. "Rcedil": "Ŗ",
  4691. "rcedil": "ŗ",
  4692. "rceil": "⌉",
  4693. "rcub": "}",
  4694. "Rcy": "Р",
  4695. "rcy": "р",
  4696. "rdca": "⤷",
  4697. "rdldhar": "⥩",
  4698. "rdquo": "”",
  4699. "rdquor": "”",
  4700. "rdsh": "↳",
  4701. "real": "ℜ",
  4702. "realine": "ℛ",
  4703. "realpart": "ℜ",
  4704. "reals": "ℝ",
  4705. "Re": "ℜ",
  4706. "rect": "▭",
  4707. "reg": "®",
  4708. "REG": "®",
  4709. "ReverseElement": "∋",
  4710. "ReverseEquilibrium": "⇋",
  4711. "ReverseUpEquilibrium": "⥯",
  4712. "rfisht": "⥽",
  4713. "rfloor": "⌋",
  4714. "rfr": "𝔯",
  4715. "Rfr": "ℜ",
  4716. "rHar": "⥤",
  4717. "rhard": "⇁",
  4718. "rharu": "⇀",
  4719. "rharul": "⥬",
  4720. "Rho": "Ρ",
  4721. "rho": "ρ",
  4722. "rhov": "ϱ",
  4723. "RightAngleBracket": "⟩",
  4724. "RightArrowBar": "⇥",
  4725. "rightarrow": "→",
  4726. "RightArrow": "→",
  4727. "Rightarrow": "⇒",
  4728. "RightArrowLeftArrow": "⇄",
  4729. "rightarrowtail": "↣",
  4730. "RightCeiling": "⌉",
  4731. "RightDoubleBracket": "⟧",
  4732. "RightDownTeeVector": "⥝",
  4733. "RightDownVectorBar": "⥕",
  4734. "RightDownVector": "⇂",
  4735. "RightFloor": "⌋",
  4736. "rightharpoondown": "⇁",
  4737. "rightharpoonup": "⇀",
  4738. "rightleftarrows": "⇄",
  4739. "rightleftharpoons": "⇌",
  4740. "rightrightarrows": "⇉",
  4741. "rightsquigarrow": "↝",
  4742. "RightTeeArrow": "↦",
  4743. "RightTee": "⊢",
  4744. "RightTeeVector": "⥛",
  4745. "rightthreetimes": "⋌",
  4746. "RightTriangleBar": "⧐",
  4747. "RightTriangle": "⊳",
  4748. "RightTriangleEqual": "⊵",
  4749. "RightUpDownVector": "⥏",
  4750. "RightUpTeeVector": "⥜",
  4751. "RightUpVectorBar": "⥔",
  4752. "RightUpVector": "↾",
  4753. "RightVectorBar": "⥓",
  4754. "RightVector": "⇀",
  4755. "ring": "˚",
  4756. "risingdotseq": "≓",
  4757. "rlarr": "⇄",
  4758. "rlhar": "⇌",
  4759. "rlm": "‏",
  4760. "rmoustache": "⎱",
  4761. "rmoust": "⎱",
  4762. "rnmid": "⫮",
  4763. "roang": "⟭",
  4764. "roarr": "⇾",
  4765. "robrk": "⟧",
  4766. "ropar": "⦆",
  4767. "ropf": "𝕣",
  4768. "Ropf": "ℝ",
  4769. "roplus": "⨮",
  4770. "rotimes": "⨵",
  4771. "RoundImplies": "⥰",
  4772. "rpar": ")",
  4773. "rpargt": "⦔",
  4774. "rppolint": "⨒",
  4775. "rrarr": "⇉",
  4776. "Rrightarrow": "⇛",
  4777. "rsaquo": "›",
  4778. "rscr": "𝓇",
  4779. "Rscr": "ℛ",
  4780. "rsh": "↱",
  4781. "Rsh": "↱",
  4782. "rsqb": "]",
  4783. "rsquo": "’",
  4784. "rsquor": "’",
  4785. "rthree": "⋌",
  4786. "rtimes": "⋊",
  4787. "rtri": "▹",
  4788. "rtrie": "⊵",
  4789. "rtrif": "▸",
  4790. "rtriltri": "⧎",
  4791. "RuleDelayed": "⧴",
  4792. "ruluhar": "⥨",
  4793. "rx": "℞",
  4794. "Sacute": "Ś",
  4795. "sacute": "ś",
  4796. "sbquo": "‚",
  4797. "scap": "⪸",
  4798. "Scaron": "Š",
  4799. "scaron": "š",
  4800. "Sc": "⪼",
  4801. "sc": "≻",
  4802. "sccue": "≽",
  4803. "sce": "⪰",
  4804. "scE": "⪴",
  4805. "Scedil": "Ş",
  4806. "scedil": "ş",
  4807. "Scirc": "Ŝ",
  4808. "scirc": "ŝ",
  4809. "scnap": "⪺",
  4810. "scnE": "⪶",
  4811. "scnsim": "⋩",
  4812. "scpolint": "⨓",
  4813. "scsim": "≿",
  4814. "Scy": "С",
  4815. "scy": "с",
  4816. "sdotb": "⊡",
  4817. "sdot": "⋅",
  4818. "sdote": "⩦",
  4819. "searhk": "⤥",
  4820. "searr": "↘",
  4821. "seArr": "⇘",
  4822. "searrow": "↘",
  4823. "sect": "§",
  4824. "semi": ";",
  4825. "seswar": "⤩",
  4826. "setminus": "∖",
  4827. "setmn": "∖",
  4828. "sext": "✶",
  4829. "Sfr": "𝔖",
  4830. "sfr": "𝔰",
  4831. "sfrown": "⌢",
  4832. "sharp": "♯",
  4833. "SHCHcy": "Щ",
  4834. "shchcy": "щ",
  4835. "SHcy": "Ш",
  4836. "shcy": "ш",
  4837. "ShortDownArrow": "↓",
  4838. "ShortLeftArrow": "←",
  4839. "shortmid": "∣",
  4840. "shortparallel": "∥",
  4841. "ShortRightArrow": "→",
  4842. "ShortUpArrow": "↑",
  4843. "shy": "­",
  4844. "Sigma": "Σ",
  4845. "sigma": "σ",
  4846. "sigmaf": "ς",
  4847. "sigmav": "ς",
  4848. "sim": "∼",
  4849. "simdot": "⩪",
  4850. "sime": "≃",
  4851. "simeq": "≃",
  4852. "simg": "⪞",
  4853. "simgE": "⪠",
  4854. "siml": "⪝",
  4855. "simlE": "⪟",
  4856. "simne": "≆",
  4857. "simplus": "⨤",
  4858. "simrarr": "⥲",
  4859. "slarr": "←",
  4860. "SmallCircle": "∘",
  4861. "smallsetminus": "∖",
  4862. "smashp": "⨳",
  4863. "smeparsl": "⧤",
  4864. "smid": "∣",
  4865. "smile": "⌣",
  4866. "smt": "⪪",
  4867. "smte": "⪬",
  4868. "smtes": "⪬︀",
  4869. "SOFTcy": "Ь",
  4870. "softcy": "ь",
  4871. "solbar": "⌿",
  4872. "solb": "⧄",
  4873. "sol": "/",
  4874. "Sopf": "𝕊",
  4875. "sopf": "𝕤",
  4876. "spades": "♠",
  4877. "spadesuit": "♠",
  4878. "spar": "∥",
  4879. "sqcap": "⊓",
  4880. "sqcaps": "⊓︀",
  4881. "sqcup": "⊔",
  4882. "sqcups": "⊔︀",
  4883. "Sqrt": "√",
  4884. "sqsub": "⊏",
  4885. "sqsube": "⊑",
  4886. "sqsubset": "⊏",
  4887. "sqsubseteq": "⊑",
  4888. "sqsup": "⊐",
  4889. "sqsupe": "⊒",
  4890. "sqsupset": "⊐",
  4891. "sqsupseteq": "⊒",
  4892. "square": "□",
  4893. "Square": "□",
  4894. "SquareIntersection": "⊓",
  4895. "SquareSubset": "⊏",
  4896. "SquareSubsetEqual": "⊑",
  4897. "SquareSuperset": "⊐",
  4898. "SquareSupersetEqual": "⊒",
  4899. "SquareUnion": "⊔",
  4900. "squarf": "▪",
  4901. "squ": "□",
  4902. "squf": "▪",
  4903. "srarr": "→",
  4904. "Sscr": "𝒮",
  4905. "sscr": "𝓈",
  4906. "ssetmn": "∖",
  4907. "ssmile": "⌣",
  4908. "sstarf": "⋆",
  4909. "Star": "⋆",
  4910. "star": "☆",
  4911. "starf": "★",
  4912. "straightepsilon": "ϵ",
  4913. "straightphi": "ϕ",
  4914. "strns": "¯",
  4915. "sub": "⊂",
  4916. "Sub": "⋐",
  4917. "subdot": "⪽",
  4918. "subE": "⫅",
  4919. "sube": "⊆",
  4920. "subedot": "⫃",
  4921. "submult": "⫁",
  4922. "subnE": "⫋",
  4923. "subne": "⊊",
  4924. "subplus": "⪿",
  4925. "subrarr": "⥹",
  4926. "subset": "⊂",
  4927. "Subset": "⋐",
  4928. "subseteq": "⊆",
  4929. "subseteqq": "⫅",
  4930. "SubsetEqual": "⊆",
  4931. "subsetneq": "⊊",
  4932. "subsetneqq": "⫋",
  4933. "subsim": "⫇",
  4934. "subsub": "⫕",
  4935. "subsup": "⫓",
  4936. "succapprox": "⪸",
  4937. "succ": "≻",
  4938. "succcurlyeq": "≽",
  4939. "Succeeds": "≻",
  4940. "SucceedsEqual": "⪰",
  4941. "SucceedsSlantEqual": "≽",
  4942. "SucceedsTilde": "≿",
  4943. "succeq": "⪰",
  4944. "succnapprox": "⪺",
  4945. "succneqq": "⪶",
  4946. "succnsim": "⋩",
  4947. "succsim": "≿",
  4948. "SuchThat": "∋",
  4949. "sum": "∑",
  4950. "Sum": "∑",
  4951. "sung": "♪",
  4952. "sup1": "¹",
  4953. "sup2": "²",
  4954. "sup3": "³",
  4955. "sup": "⊃",
  4956. "Sup": "⋑",
  4957. "supdot": "⪾",
  4958. "supdsub": "⫘",
  4959. "supE": "⫆",
  4960. "supe": "⊇",
  4961. "supedot": "⫄",
  4962. "Superset": "⊃",
  4963. "SupersetEqual": "⊇",
  4964. "suphsol": "⟉",
  4965. "suphsub": "⫗",
  4966. "suplarr": "⥻",
  4967. "supmult": "⫂",
  4968. "supnE": "⫌",
  4969. "supne": "⊋",
  4970. "supplus": "⫀",
  4971. "supset": "⊃",
  4972. "Supset": "⋑",
  4973. "supseteq": "⊇",
  4974. "supseteqq": "⫆",
  4975. "supsetneq": "⊋",
  4976. "supsetneqq": "⫌",
  4977. "supsim": "⫈",
  4978. "supsub": "⫔",
  4979. "supsup": "⫖",
  4980. "swarhk": "⤦",
  4981. "swarr": "↙",
  4982. "swArr": "⇙",
  4983. "swarrow": "↙",
  4984. "swnwar": "⤪",
  4985. "szlig": "ß",
  4986. "Tab": "\t",
  4987. "target": "⌖",
  4988. "Tau": "Τ",
  4989. "tau": "τ",
  4990. "tbrk": "⎴",
  4991. "Tcaron": "Ť",
  4992. "tcaron": "ť",
  4993. "Tcedil": "Ţ",
  4994. "tcedil": "ţ",
  4995. "Tcy": "Т",
  4996. "tcy": "т",
  4997. "tdot": "⃛",
  4998. "telrec": "⌕",
  4999. "Tfr": "𝔗",
  5000. "tfr": "𝔱",
  5001. "there4": "∴",
  5002. "therefore": "∴",
  5003. "Therefore": "∴",
  5004. "Theta": "Θ",
  5005. "theta": "θ",
  5006. "thetasym": "ϑ",
  5007. "thetav": "ϑ",
  5008. "thickapprox": "≈",
  5009. "thicksim": "∼",
  5010. "ThickSpace": "  ",
  5011. "ThinSpace": " ",
  5012. "thinsp": " ",
  5013. "thkap": "≈",
  5014. "thksim": "∼",
  5015. "THORN": "Þ",
  5016. "thorn": "þ",
  5017. "tilde": "˜",
  5018. "Tilde": "∼",
  5019. "TildeEqual": "≃",
  5020. "TildeFullEqual": "≅",
  5021. "TildeTilde": "≈",
  5022. "timesbar": "⨱",
  5023. "timesb": "⊠",
  5024. "times": "×",
  5025. "timesd": "⨰",
  5026. "tint": "∭",
  5027. "toea": "⤨",
  5028. "topbot": "⌶",
  5029. "topcir": "⫱",
  5030. "top": "⊤",
  5031. "Topf": "𝕋",
  5032. "topf": "𝕥",
  5033. "topfork": "⫚",
  5034. "tosa": "⤩",
  5035. "tprime": "‴",
  5036. "trade": "™",
  5037. "TRADE": "™",
  5038. "triangle": "▵",
  5039. "triangledown": "▿",
  5040. "triangleleft": "◃",
  5041. "trianglelefteq": "⊴",
  5042. "triangleq": "≜",
  5043. "triangleright": "▹",
  5044. "trianglerighteq": "⊵",
  5045. "tridot": "◬",
  5046. "trie": "≜",
  5047. "triminus": "⨺",
  5048. "TripleDot": "⃛",
  5049. "triplus": "⨹",
  5050. "trisb": "⧍",
  5051. "tritime": "⨻",
  5052. "trpezium": "⏢",
  5053. "Tscr": "𝒯",
  5054. "tscr": "𝓉",
  5055. "TScy": "Ц",
  5056. "tscy": "ц",
  5057. "TSHcy": "Ћ",
  5058. "tshcy": "ћ",
  5059. "Tstrok": "Ŧ",
  5060. "tstrok": "ŧ",
  5061. "twixt": "≬",
  5062. "twoheadleftarrow": "↞",
  5063. "twoheadrightarrow": "↠",
  5064. "Uacute": "Ú",
  5065. "uacute": "ú",
  5066. "uarr": "↑",
  5067. "Uarr": "↟",
  5068. "uArr": "⇑",
  5069. "Uarrocir": "⥉",
  5070. "Ubrcy": "Ў",
  5071. "ubrcy": "ў",
  5072. "Ubreve": "Ŭ",
  5073. "ubreve": "ŭ",
  5074. "Ucirc": "Û",
  5075. "ucirc": "û",
  5076. "Ucy": "У",
  5077. "ucy": "у",
  5078. "udarr": "⇅",
  5079. "Udblac": "Ű",
  5080. "udblac": "ű",
  5081. "udhar": "⥮",
  5082. "ufisht": "⥾",
  5083. "Ufr": "𝔘",
  5084. "ufr": "𝔲",
  5085. "Ugrave": "Ù",
  5086. "ugrave": "ù",
  5087. "uHar": "⥣",
  5088. "uharl": "↿",
  5089. "uharr": "↾",
  5090. "uhblk": "▀",
  5091. "ulcorn": "⌜",
  5092. "ulcorner": "⌜",
  5093. "ulcrop": "⌏",
  5094. "ultri": "◸",
  5095. "Umacr": "Ū",
  5096. "umacr": "ū",
  5097. "uml": "¨",
  5098. "UnderBar": "_",
  5099. "UnderBrace": "⏟",
  5100. "UnderBracket": "⎵",
  5101. "UnderParenthesis": "⏝",
  5102. "Union": "⋃",
  5103. "UnionPlus": "⊎",
  5104. "Uogon": "Ų",
  5105. "uogon": "ų",
  5106. "Uopf": "𝕌",
  5107. "uopf": "𝕦",
  5108. "UpArrowBar": "⤒",
  5109. "uparrow": "↑",
  5110. "UpArrow": "↑",
  5111. "Uparrow": "⇑",
  5112. "UpArrowDownArrow": "⇅",
  5113. "updownarrow": "↕",
  5114. "UpDownArrow": "↕",
  5115. "Updownarrow": "⇕",
  5116. "UpEquilibrium": "⥮",
  5117. "upharpoonleft": "↿",
  5118. "upharpoonright": "↾",
  5119. "uplus": "⊎",
  5120. "UpperLeftArrow": "↖",
  5121. "UpperRightArrow": "↗",
  5122. "upsi": "υ",
  5123. "Upsi": "ϒ",
  5124. "upsih": "ϒ",
  5125. "Upsilon": "Υ",
  5126. "upsilon": "υ",
  5127. "UpTeeArrow": "↥",
  5128. "UpTee": "⊥",
  5129. "upuparrows": "⇈",
  5130. "urcorn": "⌝",
  5131. "urcorner": "⌝",
  5132. "urcrop": "⌎",
  5133. "Uring": "Ů",
  5134. "uring": "ů",
  5135. "urtri": "◹",
  5136. "Uscr": "𝒰",
  5137. "uscr": "𝓊",
  5138. "utdot": "⋰",
  5139. "Utilde": "Ũ",
  5140. "utilde": "ũ",
  5141. "utri": "▵",
  5142. "utrif": "▴",
  5143. "uuarr": "⇈",
  5144. "Uuml": "Ü",
  5145. "uuml": "ü",
  5146. "uwangle": "⦧",
  5147. "vangrt": "⦜",
  5148. "varepsilon": "ϵ",
  5149. "varkappa": "ϰ",
  5150. "varnothing": "∅",
  5151. "varphi": "ϕ",
  5152. "varpi": "ϖ",
  5153. "varpropto": "∝",
  5154. "varr": "↕",
  5155. "vArr": "⇕",
  5156. "varrho": "ϱ",
  5157. "varsigma": "ς",
  5158. "varsubsetneq": "⊊︀",
  5159. "varsubsetneqq": "⫋︀",
  5160. "varsupsetneq": "⊋︀",
  5161. "varsupsetneqq": "⫌︀",
  5162. "vartheta": "ϑ",
  5163. "vartriangleleft": "⊲",
  5164. "vartriangleright": "⊳",
  5165. "vBar": "⫨",
  5166. "Vbar": "⫫",
  5167. "vBarv": "⫩",
  5168. "Vcy": "В",
  5169. "vcy": "в",
  5170. "vdash": "⊢",
  5171. "vDash": "⊨",
  5172. "Vdash": "⊩",
  5173. "VDash": "⊫",
  5174. "Vdashl": "⫦",
  5175. "veebar": "⊻",
  5176. "vee": "∨",
  5177. "Vee": "⋁",
  5178. "veeeq": "≚",
  5179. "vellip": "⋮",
  5180. "verbar": "|",
  5181. "Verbar": "‖",
  5182. "vert": "|",
  5183. "Vert": "‖",
  5184. "VerticalBar": "∣",
  5185. "VerticalLine": "|",
  5186. "VerticalSeparator": "❘",
  5187. "VerticalTilde": "≀",
  5188. "VeryThinSpace": " ",
  5189. "Vfr": "𝔙",
  5190. "vfr": "𝔳",
  5191. "vltri": "⊲",
  5192. "vnsub": "⊂⃒",
  5193. "vnsup": "⊃⃒",
  5194. "Vopf": "𝕍",
  5195. "vopf": "𝕧",
  5196. "vprop": "∝",
  5197. "vrtri": "⊳",
  5198. "Vscr": "𝒱",
  5199. "vscr": "𝓋",
  5200. "vsubnE": "⫋︀",
  5201. "vsubne": "⊊︀",
  5202. "vsupnE": "⫌︀",
  5203. "vsupne": "⊋︀",
  5204. "Vvdash": "⊪",
  5205. "vzigzag": "⦚",
  5206. "Wcirc": "Ŵ",
  5207. "wcirc": "ŵ",
  5208. "wedbar": "⩟",
  5209. "wedge": "∧",
  5210. "Wedge": "⋀",
  5211. "wedgeq": "≙",
  5212. "weierp": "℘",
  5213. "Wfr": "𝔚",
  5214. "wfr": "𝔴",
  5215. "Wopf": "𝕎",
  5216. "wopf": "𝕨",
  5217. "wp": "℘",
  5218. "wr": "≀",
  5219. "wreath": "≀",
  5220. "Wscr": "𝒲",
  5221. "wscr": "𝓌",
  5222. "xcap": "⋂",
  5223. "xcirc": "◯",
  5224. "xcup": "⋃",
  5225. "xdtri": "▽",
  5226. "Xfr": "𝔛",
  5227. "xfr": "𝔵",
  5228. "xharr": "⟷",
  5229. "xhArr": "⟺",
  5230. "Xi": "Ξ",
  5231. "xi": "ξ",
  5232. "xlarr": "⟵",
  5233. "xlArr": "⟸",
  5234. "xmap": "⟼",
  5235. "xnis": "⋻",
  5236. "xodot": "⨀",
  5237. "Xopf": "𝕏",
  5238. "xopf": "𝕩",
  5239. "xoplus": "⨁",
  5240. "xotime": "⨂",
  5241. "xrarr": "⟶",
  5242. "xrArr": "⟹",
  5243. "Xscr": "𝒳",
  5244. "xscr": "𝓍",
  5245. "xsqcup": "⨆",
  5246. "xuplus": "⨄",
  5247. "xutri": "△",
  5248. "xvee": "⋁",
  5249. "xwedge": "⋀",
  5250. "Yacute": "Ý",
  5251. "yacute": "ý",
  5252. "YAcy": "Я",
  5253. "yacy": "я",
  5254. "Ycirc": "Ŷ",
  5255. "ycirc": "ŷ",
  5256. "Ycy": "Ы",
  5257. "ycy": "ы",
  5258. "yen": "¥",
  5259. "Yfr": "𝔜",
  5260. "yfr": "𝔶",
  5261. "YIcy": "Ї",
  5262. "yicy": "ї",
  5263. "Yopf": "𝕐",
  5264. "yopf": "𝕪",
  5265. "Yscr": "𝒴",
  5266. "yscr": "𝓎",
  5267. "YUcy": "Ю",
  5268. "yucy": "ю",
  5269. "yuml": "ÿ",
  5270. "Yuml": "Ÿ",
  5271. "Zacute": "Ź",
  5272. "zacute": "ź",
  5273. "Zcaron": "Ž",
  5274. "zcaron": "ž",
  5275. "Zcy": "З",
  5276. "zcy": "з",
  5277. "Zdot": "Ż",
  5278. "zdot": "ż",
  5279. "zeetrf": "ℨ",
  5280. "ZeroWidthSpace": "​",
  5281. "Zeta": "Ζ",
  5282. "zeta": "ζ",
  5283. "zfr": "𝔷",
  5284. "Zfr": "ℨ",
  5285. "ZHcy": "Ж",
  5286. "zhcy": "ж",
  5287. "zigrarr": "⇝",
  5288. "zopf": "𝕫",
  5289. "Zopf": "ℤ",
  5290. "Zscr": "𝒵",
  5291. "zscr": "𝓏",
  5292. "zwj": "‍",
  5293. "zwnj": "‌"
  5294. };
  5295. /***/ }),
  5296. /* 24 */
  5297. /***/ (function(module, exports) {
  5298. // removed by extract-text-webpack-plugin
  5299. /***/ }),
  5300. /* 25 */
  5301. /***/ (function(module, exports) {
  5302. // removed by extract-text-webpack-plugin
  5303. /***/ }),
  5304. /* 26 */
  5305. /***/ (function(module, exports) {
  5306. // removed by extract-text-webpack-plugin
  5307. /***/ }),
  5308. /* 27 */
  5309. /***/ (function(module, exports) {
  5310. // removed by extract-text-webpack-plugin
  5311. /***/ }),
  5312. /* 28 */
  5313. /***/ (function(module, exports, __webpack_require__) {
  5314. "use strict";
  5315. ////////////////////////////////////////////////////////////////////////////////
  5316. // Helpers
  5317. // Merge objects
  5318. //
  5319. function assign(obj /*from1, from2, from3, ...*/) {
  5320. var sources = Array.prototype.slice.call(arguments, 1);
  5321. sources.forEach(function (source) {
  5322. if (!source) { return; }
  5323. Object.keys(source).forEach(function (key) {
  5324. obj[key] = source[key];
  5325. });
  5326. });
  5327. return obj;
  5328. }
  5329. function _class(obj) { return Object.prototype.toString.call(obj); }
  5330. function isString(obj) { return _class(obj) === '[object String]'; }
  5331. function isObject(obj) { return _class(obj) === '[object Object]'; }
  5332. function isRegExp(obj) { return _class(obj) === '[object RegExp]'; }
  5333. function isFunction(obj) { return _class(obj) === '[object Function]'; }
  5334. function escapeRE(str) { return str.replace(/[.?*+^$[\]\\(){}|-]/g, '\\$&'); }
  5335. ////////////////////////////////////////////////////////////////////////////////
  5336. var defaultOptions = {
  5337. fuzzyLink: true,
  5338. fuzzyEmail: true,
  5339. fuzzyIP: false
  5340. };
  5341. function isOptionsObj(obj) {
  5342. return Object.keys(obj || {}).reduce(function (acc, k) {
  5343. return acc || defaultOptions.hasOwnProperty(k);
  5344. }, false);
  5345. }
  5346. var defaultSchemas = {
  5347. 'http:': {
  5348. validate: function (text, pos, self) {
  5349. var tail = text.slice(pos);
  5350. if (!self.re.http) {
  5351. // compile lazily, because "host"-containing variables can change on tlds update.
  5352. self.re.http = new RegExp(
  5353. '^\\/\\/' + self.re.src_auth + self.re.src_host_port_strict + self.re.src_path, 'i'
  5354. );
  5355. }
  5356. if (self.re.http.test(tail)) {
  5357. return tail.match(self.re.http)[0].length;
  5358. }
  5359. return 0;
  5360. }
  5361. },
  5362. 'https:': 'http:',
  5363. 'ftp:': 'http:',
  5364. '//': {
  5365. validate: function (text, pos, self) {
  5366. var tail = text.slice(pos);
  5367. if (!self.re.no_http) {
  5368. // compile lazily, because "host"-containing variables can change on tlds update.
  5369. self.re.no_http = new RegExp(
  5370. '^' +
  5371. self.re.src_auth +
  5372. // Don't allow single-level domains, because of false positives like '//test'
  5373. // with code comments
  5374. '(?:localhost|(?:(?:' + self.re.src_domain + ')\\.)+' + self.re.src_domain_root + ')' +
  5375. self.re.src_port +
  5376. self.re.src_host_terminator +
  5377. self.re.src_path,
  5378. 'i'
  5379. );
  5380. }
  5381. if (self.re.no_http.test(tail)) {
  5382. // should not be `://` & `///`, that protects from errors in protocol name
  5383. if (pos >= 3 && text[pos - 3] === ':') { return 0; }
  5384. if (pos >= 3 && text[pos - 3] === '/') { return 0; }
  5385. return tail.match(self.re.no_http)[0].length;
  5386. }
  5387. return 0;
  5388. }
  5389. },
  5390. 'mailto:': {
  5391. validate: function (text, pos, self) {
  5392. var tail = text.slice(pos);
  5393. if (!self.re.mailto) {
  5394. self.re.mailto = new RegExp(
  5395. '^' + self.re.src_email_name + '@' + self.re.src_host_strict, 'i'
  5396. );
  5397. }
  5398. if (self.re.mailto.test(tail)) {
  5399. return tail.match(self.re.mailto)[0].length;
  5400. }
  5401. return 0;
  5402. }
  5403. }
  5404. };
  5405. /*eslint-disable max-len*/
  5406. // RE pattern for 2-character tlds (autogenerated by ./support/tlds_2char_gen.js)
  5407. 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]';
  5408. // DON'T try to make PRs with changes. Extend TLDs with LinkifyIt.tlds() instead
  5409. var tlds_default = 'biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф'.split('|');
  5410. /*eslint-enable max-len*/
  5411. ////////////////////////////////////////////////////////////////////////////////
  5412. function resetScanCache(self) {
  5413. self.__index__ = -1;
  5414. self.__text_cache__ = '';
  5415. }
  5416. function createValidator(re) {
  5417. return function (text, pos) {
  5418. var tail = text.slice(pos);
  5419. if (re.test(tail)) {
  5420. return tail.match(re)[0].length;
  5421. }
  5422. return 0;
  5423. };
  5424. }
  5425. function createNormalizer() {
  5426. return function (match, self) {
  5427. self.normalize(match);
  5428. };
  5429. }
  5430. // Schemas compiler. Build regexps.
  5431. //
  5432. function compile(self) {
  5433. // Load & clone RE patterns.
  5434. var re = self.re = __webpack_require__(29)(self.__opts__);
  5435. // Define dynamic patterns
  5436. var tlds = self.__tlds__.slice();
  5437. self.onCompile();
  5438. if (!self.__tlds_replaced__) {
  5439. tlds.push(tlds_2ch_src_re);
  5440. }
  5441. tlds.push(re.src_xn);
  5442. re.src_tlds = tlds.join('|');
  5443. function untpl(tpl) { return tpl.replace('%TLDS%', re.src_tlds); }
  5444. re.email_fuzzy = RegExp(untpl(re.tpl_email_fuzzy), 'i');
  5445. re.link_fuzzy = RegExp(untpl(re.tpl_link_fuzzy), 'i');
  5446. re.link_no_ip_fuzzy = RegExp(untpl(re.tpl_link_no_ip_fuzzy), 'i');
  5447. re.host_fuzzy_test = RegExp(untpl(re.tpl_host_fuzzy_test), 'i');
  5448. //
  5449. // Compile each schema
  5450. //
  5451. var aliases = [];
  5452. self.__compiled__ = {}; // Reset compiled data
  5453. function schemaError(name, val) {
  5454. throw new Error('(LinkifyIt) Invalid schema "' + name + '": ' + val);
  5455. }
  5456. Object.keys(self.__schemas__).forEach(function (name) {
  5457. var val = self.__schemas__[name];
  5458. // skip disabled methods
  5459. if (val === null) { return; }
  5460. var compiled = { validate: null, link: null };
  5461. self.__compiled__[name] = compiled;
  5462. if (isObject(val)) {
  5463. if (isRegExp(val.validate)) {
  5464. compiled.validate = createValidator(val.validate);
  5465. } else if (isFunction(val.validate)) {
  5466. compiled.validate = val.validate;
  5467. } else {
  5468. schemaError(name, val);
  5469. }
  5470. if (isFunction(val.normalize)) {
  5471. compiled.normalize = val.normalize;
  5472. } else if (!val.normalize) {
  5473. compiled.normalize = createNormalizer();
  5474. } else {
  5475. schemaError(name, val);
  5476. }
  5477. return;
  5478. }
  5479. if (isString(val)) {
  5480. aliases.push(name);
  5481. return;
  5482. }
  5483. schemaError(name, val);
  5484. });
  5485. //
  5486. // Compile postponed aliases
  5487. //
  5488. aliases.forEach(function (alias) {
  5489. if (!self.__compiled__[self.__schemas__[alias]]) {
  5490. // Silently fail on missed schemas to avoid errons on disable.
  5491. // schemaError(alias, self.__schemas__[alias]);
  5492. return;
  5493. }
  5494. self.__compiled__[alias].validate =
  5495. self.__compiled__[self.__schemas__[alias]].validate;
  5496. self.__compiled__[alias].normalize =
  5497. self.__compiled__[self.__schemas__[alias]].normalize;
  5498. });
  5499. //
  5500. // Fake record for guessed links
  5501. //
  5502. self.__compiled__[''] = { validate: null, normalize: createNormalizer() };
  5503. //
  5504. // Build schema condition
  5505. //
  5506. var slist = Object.keys(self.__compiled__)
  5507. .filter(function (name) {
  5508. // Filter disabled & fake schemas
  5509. return name.length > 0 && self.__compiled__[name];
  5510. })
  5511. .map(escapeRE)
  5512. .join('|');
  5513. // (?!_) cause 1.5x slowdown
  5514. self.re.schema_test = RegExp('(^|(?!_)(?:[><\uff5c]|' + re.src_ZPCc + '))(' + slist + ')', 'i');
  5515. self.re.schema_search = RegExp('(^|(?!_)(?:[><\uff5c]|' + re.src_ZPCc + '))(' + slist + ')', 'ig');
  5516. self.re.pretest = RegExp(
  5517. '(' + self.re.schema_test.source + ')|' +
  5518. '(' + self.re.host_fuzzy_test.source + ')|' +
  5519. '@',
  5520. 'i');
  5521. //
  5522. // Cleanup
  5523. //
  5524. resetScanCache(self);
  5525. }
  5526. /**
  5527. * class Match
  5528. *
  5529. * Match result. Single element of array, returned by [[LinkifyIt#match]]
  5530. **/
  5531. function Match(self, shift) {
  5532. var start = self.__index__,
  5533. end = self.__last_index__,
  5534. text = self.__text_cache__.slice(start, end);
  5535. /**
  5536. * Match#schema -> String
  5537. *
  5538. * Prefix (protocol) for matched string.
  5539. **/
  5540. this.schema = self.__schema__.toLowerCase();
  5541. /**
  5542. * Match#index -> Number
  5543. *
  5544. * First position of matched string.
  5545. **/
  5546. this.index = start + shift;
  5547. /**
  5548. * Match#lastIndex -> Number
  5549. *
  5550. * Next position after matched string.
  5551. **/
  5552. this.lastIndex = end + shift;
  5553. /**
  5554. * Match#raw -> String
  5555. *
  5556. * Matched string.
  5557. **/
  5558. this.raw = text;
  5559. /**
  5560. * Match#text -> String
  5561. *
  5562. * Notmalized text of matched string.
  5563. **/
  5564. this.text = text;
  5565. /**
  5566. * Match#url -> String
  5567. *
  5568. * Normalized url of matched string.
  5569. **/
  5570. this.url = text;
  5571. }
  5572. function createMatch(self, shift) {
  5573. var match = new Match(self, shift);
  5574. self.__compiled__[match.schema].normalize(match, self);
  5575. return match;
  5576. }
  5577. /**
  5578. * class LinkifyIt
  5579. **/
  5580. /**
  5581. * new LinkifyIt(schemas, options)
  5582. * - schemas (Object): Optional. Additional schemas to validate (prefix/validator)
  5583. * - options (Object): { fuzzyLink|fuzzyEmail|fuzzyIP: true|false }
  5584. *
  5585. * Creates new linkifier instance with optional additional schemas.
  5586. * Can be called without `new` keyword for convenience.
  5587. *
  5588. * By default understands:
  5589. *
  5590. * - `http(s)://...` , `ftp://...`, `mailto:...` & `//...` links
  5591. * - "fuzzy" links and emails (example.com, foo@bar.com).
  5592. *
  5593. * `schemas` is an object, where each key/value describes protocol/rule:
  5594. *
  5595. * - __key__ - link prefix (usually, protocol name with `:` at the end, `skype:`
  5596. * for example). `linkify-it` makes shure that prefix is not preceeded with
  5597. * alphanumeric char and symbols. Only whitespaces and punctuation allowed.
  5598. * - __value__ - rule to check tail after link prefix
  5599. * - _String_ - just alias to existing rule
  5600. * - _Object_
  5601. * - _validate_ - validator function (should return matched length on success),
  5602. * or `RegExp`.
  5603. * - _normalize_ - optional function to normalize text & url of matched result
  5604. * (for example, for @twitter mentions).
  5605. *
  5606. * `options`:
  5607. *
  5608. * - __fuzzyLink__ - recognige URL-s without `http(s):` prefix. Default `true`.
  5609. * - __fuzzyIP__ - allow IPs in fuzzy links above. Can conflict with some texts
  5610. * like version numbers. Default `false`.
  5611. * - __fuzzyEmail__ - recognize emails without `mailto:` prefix.
  5612. *
  5613. **/
  5614. function LinkifyIt(schemas, options) {
  5615. if (!(this instanceof LinkifyIt)) {
  5616. return new LinkifyIt(schemas, options);
  5617. }
  5618. if (!options) {
  5619. if (isOptionsObj(schemas)) {
  5620. options = schemas;
  5621. schemas = {};
  5622. }
  5623. }
  5624. this.__opts__ = assign({}, defaultOptions, options);
  5625. // Cache last tested result. Used to skip repeating steps on next `match` call.
  5626. this.__index__ = -1;
  5627. this.__last_index__ = -1; // Next scan position
  5628. this.__schema__ = '';
  5629. this.__text_cache__ = '';
  5630. this.__schemas__ = assign({}, defaultSchemas, schemas);
  5631. this.__compiled__ = {};
  5632. this.__tlds__ = tlds_default;
  5633. this.__tlds_replaced__ = false;
  5634. this.re = {};
  5635. compile(this);
  5636. }
  5637. /** chainable
  5638. * LinkifyIt#add(schema, definition)
  5639. * - schema (String): rule name (fixed pattern prefix)
  5640. * - definition (String|RegExp|Object): schema definition
  5641. *
  5642. * Add new rule definition. See constructor description for details.
  5643. **/
  5644. LinkifyIt.prototype.add = function add(schema, definition) {
  5645. this.__schemas__[schema] = definition;
  5646. compile(this);
  5647. return this;
  5648. };
  5649. /** chainable
  5650. * LinkifyIt#set(options)
  5651. * - options (Object): { fuzzyLink|fuzzyEmail|fuzzyIP: true|false }
  5652. *
  5653. * Set recognition options for links without schema.
  5654. **/
  5655. LinkifyIt.prototype.set = function set(options) {
  5656. this.__opts__ = assign(this.__opts__, options);
  5657. return this;
  5658. };
  5659. /**
  5660. * LinkifyIt#test(text) -> Boolean
  5661. *
  5662. * Searches linkifiable pattern and returns `true` on success or `false` on fail.
  5663. **/
  5664. LinkifyIt.prototype.test = function test(text) {
  5665. // Reset scan cache
  5666. this.__text_cache__ = text;
  5667. this.__index__ = -1;
  5668. if (!text.length) { return false; }
  5669. var m, ml, me, len, shift, next, re, tld_pos, at_pos;
  5670. // try to scan for link with schema - that's the most simple rule
  5671. if (this.re.schema_test.test(text)) {
  5672. re = this.re.schema_search;
  5673. re.lastIndex = 0;
  5674. while ((m = re.exec(text)) !== null) {
  5675. len = this.testSchemaAt(text, m[2], re.lastIndex);
  5676. if (len) {
  5677. this.__schema__ = m[2];
  5678. this.__index__ = m.index + m[1].length;
  5679. this.__last_index__ = m.index + m[0].length + len;
  5680. break;
  5681. }
  5682. }
  5683. }
  5684. if (this.__opts__.fuzzyLink && this.__compiled__['http:']) {
  5685. // guess schemaless links
  5686. tld_pos = text.search(this.re.host_fuzzy_test);
  5687. if (tld_pos >= 0) {
  5688. // if tld is located after found link - no need to check fuzzy pattern
  5689. if (this.__index__ < 0 || tld_pos < this.__index__) {
  5690. if ((ml = text.match(this.__opts__.fuzzyIP ? this.re.link_fuzzy : this.re.link_no_ip_fuzzy)) !== null) {
  5691. shift = ml.index + ml[1].length;
  5692. if (this.__index__ < 0 || shift < this.__index__) {
  5693. this.__schema__ = '';
  5694. this.__index__ = shift;
  5695. this.__last_index__ = ml.index + ml[0].length;
  5696. }
  5697. }
  5698. }
  5699. }
  5700. }
  5701. if (this.__opts__.fuzzyEmail && this.__compiled__['mailto:']) {
  5702. // guess schemaless emails
  5703. at_pos = text.indexOf('@');
  5704. if (at_pos >= 0) {
  5705. // We can't skip this check, because this cases are possible:
  5706. // 192.168.1.1@gmail.com, my.in@example.com
  5707. if ((me = text.match(this.re.email_fuzzy)) !== null) {
  5708. shift = me.index + me[1].length;
  5709. next = me.index + me[0].length;
  5710. if (this.__index__ < 0 || shift < this.__index__ ||
  5711. (shift === this.__index__ && next > this.__last_index__)) {
  5712. this.__schema__ = 'mailto:';
  5713. this.__index__ = shift;
  5714. this.__last_index__ = next;
  5715. }
  5716. }
  5717. }
  5718. }
  5719. return this.__index__ >= 0;
  5720. };
  5721. /**
  5722. * LinkifyIt#pretest(text) -> Boolean
  5723. *
  5724. * Very quick check, that can give false positives. Returns true if link MAY BE
  5725. * can exists. Can be used for speed optimization, when you need to check that
  5726. * link NOT exists.
  5727. **/
  5728. LinkifyIt.prototype.pretest = function pretest(text) {
  5729. return this.re.pretest.test(text);
  5730. };
  5731. /**
  5732. * LinkifyIt#testSchemaAt(text, name, position) -> Number
  5733. * - text (String): text to scan
  5734. * - name (String): rule (schema) name
  5735. * - position (Number): text offset to check from
  5736. *
  5737. * Similar to [[LinkifyIt#test]] but checks only specific protocol tail exactly
  5738. * at given position. Returns length of found pattern (0 on fail).
  5739. **/
  5740. LinkifyIt.prototype.testSchemaAt = function testSchemaAt(text, schema, pos) {
  5741. // If not supported schema check requested - terminate
  5742. if (!this.__compiled__[schema.toLowerCase()]) {
  5743. return 0;
  5744. }
  5745. return this.__compiled__[schema.toLowerCase()].validate(text, pos, this);
  5746. };
  5747. /**
  5748. * LinkifyIt#match(text) -> Array|null
  5749. *
  5750. * Returns array of found link descriptions or `null` on fail. We strongly
  5751. * recommend to use [[LinkifyIt#test]] first, for best speed.
  5752. *
  5753. * ##### Result match description
  5754. *
  5755. * - __schema__ - link schema, can be empty for fuzzy links, or `//` for
  5756. * protocol-neutral links.
  5757. * - __index__ - offset of matched text
  5758. * - __lastIndex__ - index of next char after mathch end
  5759. * - __raw__ - matched text
  5760. * - __text__ - normalized text
  5761. * - __url__ - link, generated from matched text
  5762. **/
  5763. LinkifyIt.prototype.match = function match(text) {
  5764. var shift = 0, result = [];
  5765. // Try to take previous element from cache, if .test() called before
  5766. if (this.__index__ >= 0 && this.__text_cache__ === text) {
  5767. result.push(createMatch(this, shift));
  5768. shift = this.__last_index__;
  5769. }
  5770. // Cut head if cache was used
  5771. var tail = shift ? text.slice(shift) : text;
  5772. // Scan string until end reached
  5773. while (this.test(tail)) {
  5774. result.push(createMatch(this, shift));
  5775. tail = tail.slice(this.__last_index__);
  5776. shift += this.__last_index__;
  5777. }
  5778. if (result.length) {
  5779. return result;
  5780. }
  5781. return null;
  5782. };
  5783. /** chainable
  5784. * LinkifyIt#tlds(list [, keepOld]) -> this
  5785. * - list (Array): list of tlds
  5786. * - keepOld (Boolean): merge with current list if `true` (`false` by default)
  5787. *
  5788. * Load (or merge) new tlds list. Those are user for fuzzy links (without prefix)
  5789. * to avoid false positives. By default this algorythm used:
  5790. *
  5791. * - hostname with any 2-letter root zones are ok.
  5792. * - biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф
  5793. * are ok.
  5794. * - encoded (`xn--...`) root zones are ok.
  5795. *
  5796. * If list is replaced, then exact match for 2-chars root zones will be checked.
  5797. **/
  5798. LinkifyIt.prototype.tlds = function tlds(list, keepOld) {
  5799. list = Array.isArray(list) ? list : [ list ];
  5800. if (!keepOld) {
  5801. this.__tlds__ = list.slice();
  5802. this.__tlds_replaced__ = true;
  5803. compile(this);
  5804. return this;
  5805. }
  5806. this.__tlds__ = this.__tlds__.concat(list)
  5807. .sort()
  5808. .filter(function (el, idx, arr) {
  5809. return el !== arr[idx - 1];
  5810. })
  5811. .reverse();
  5812. compile(this);
  5813. return this;
  5814. };
  5815. /**
  5816. * LinkifyIt#normalize(match)
  5817. *
  5818. * Default normalizer (if schema does not define it's own).
  5819. **/
  5820. LinkifyIt.prototype.normalize = function normalize(match) {
  5821. // Do minimal possible changes by default. Need to collect feedback prior
  5822. // to move forward https://github.com/markdown-it/linkify-it/issues/1
  5823. if (!match.schema) { match.url = 'http://' + match.url; }
  5824. if (match.schema === 'mailto:' && !/^mailto:/i.test(match.url)) {
  5825. match.url = 'mailto:' + match.url;
  5826. }
  5827. };
  5828. /**
  5829. * LinkifyIt#onCompile()
  5830. *
  5831. * Override to modify basic RegExp-s.
  5832. **/
  5833. LinkifyIt.prototype.onCompile = function onCompile() {
  5834. };
  5835. module.exports = LinkifyIt;
  5836. /***/ }),
  5837. /* 29 */
  5838. /***/ (function(module, exports, __webpack_require__) {
  5839. "use strict";
  5840. module.exports = function (opts) {
  5841. var re = {};
  5842. // Use direct extract instead of `regenerate` to reduse browserified size
  5843. re.src_Any = __webpack_require__(18).source;
  5844. re.src_Cc = __webpack_require__(16).source;
  5845. re.src_Z = __webpack_require__(17).source;
  5846. re.src_P = __webpack_require__(5).source;
  5847. // \p{\Z\P\Cc\CF} (white spaces + control + format + punctuation)
  5848. re.src_ZPCc = [ re.src_Z, re.src_P, re.src_Cc ].join('|');
  5849. // \p{\Z\Cc} (white spaces + control)
  5850. re.src_ZCc = [ re.src_Z, re.src_Cc ].join('|');
  5851. // Experimental. List of chars, completely prohibited in links
  5852. // because can separate it from other part of text
  5853. var text_separators = '[><\uff5c]';
  5854. // All possible word characters (everything without punctuation, spaces & controls)
  5855. // Defined via punctuation & spaces to save space
  5856. // Should be something like \p{\L\N\S\M} (\w but without `_`)
  5857. re.src_pseudo_letter = '(?:(?!' + text_separators + '|' + re.src_ZPCc + ')' + re.src_Any + ')';
  5858. // The same as abothe but without [0-9]
  5859. // var src_pseudo_letter_non_d = '(?:(?![0-9]|' + src_ZPCc + ')' + src_Any + ')';
  5860. ////////////////////////////////////////////////////////////////////////////////
  5861. re.src_ip4 =
  5862. '(?:(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]?)';
  5863. // Prohibit any of "@/[]()" in user/pass to avoid wrong domain fetch.
  5864. re.src_auth = '(?:(?:(?!' + re.src_ZCc + '|[@/\\[\\]()]).)+@)?';
  5865. re.src_port =
  5866. '(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?';
  5867. re.src_host_terminator =
  5868. '(?=$|' + text_separators + '|' + re.src_ZPCc + ')(?!-|_|:\\d|\\.-|\\.(?!$|' + re.src_ZPCc + '))';
  5869. re.src_path =
  5870. '(?:' +
  5871. '[/?#]' +
  5872. '(?:' +
  5873. '(?!' + re.src_ZCc + '|' + text_separators + '|[()[\\]{}.,"\'?!\\-]).|' +
  5874. '\\[(?:(?!' + re.src_ZCc + '|\\]).)*\\]|' +
  5875. '\\((?:(?!' + re.src_ZCc + '|[)]).)*\\)|' +
  5876. '\\{(?:(?!' + re.src_ZCc + '|[}]).)*\\}|' +
  5877. '\\"(?:(?!' + re.src_ZCc + '|["]).)+\\"|' +
  5878. "\\'(?:(?!" + re.src_ZCc + "|[']).)+\\'|" +
  5879. "\\'(?=" + re.src_pseudo_letter + '|[-]).|' + // allow `I'm_king` if no pair found
  5880. '\\.{2,3}[a-zA-Z0-9%/]|' + // github has ... in commit range links. Restrict to
  5881. // - english
  5882. // - percent-encoded
  5883. // - parts of file path
  5884. // until more examples found.
  5885. '\\.(?!' + re.src_ZCc + '|[.]).|' +
  5886. (opts && opts['---'] ?
  5887. '\\-(?!--(?:[^-]|$))(?:-*)|' // `---` => long dash, terminate
  5888. :
  5889. '\\-+|'
  5890. ) +
  5891. '\\,(?!' + re.src_ZCc + ').|' + // allow `,,,` in paths
  5892. '\\!(?!' + re.src_ZCc + '|[!]).|' +
  5893. '\\?(?!' + re.src_ZCc + '|[?]).' +
  5894. ')+' +
  5895. '|\\/' +
  5896. ')?';
  5897. re.src_email_name =
  5898. '[\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]+';
  5899. re.src_xn =
  5900. 'xn--[a-z0-9\\-]{1,59}';
  5901. // More to read about domain names
  5902. // http://serverfault.com/questions/638260/
  5903. re.src_domain_root =
  5904. // Allow letters & digits (http://test1)
  5905. '(?:' +
  5906. re.src_xn +
  5907. '|' +
  5908. re.src_pseudo_letter + '{1,63}' +
  5909. ')';
  5910. re.src_domain =
  5911. '(?:' +
  5912. re.src_xn +
  5913. '|' +
  5914. '(?:' + re.src_pseudo_letter + ')' +
  5915. '|' +
  5916. // don't allow `--` in domain names, because:
  5917. // - that can conflict with markdown &mdash; / &ndash;
  5918. // - nobody use those anyway
  5919. '(?:' + re.src_pseudo_letter + '(?:-(?!-)|' + re.src_pseudo_letter + '){0,61}' + re.src_pseudo_letter + ')' +
  5920. ')';
  5921. re.src_host =
  5922. '(?:' +
  5923. // Don't need IP check, because digits are already allowed in normal domain names
  5924. // src_ip4 +
  5925. // '|' +
  5926. '(?:(?:(?:' + re.src_domain + ')\\.)*' + re.src_domain/*_root*/ + ')' +
  5927. ')';
  5928. re.tpl_host_fuzzy =
  5929. '(?:' +
  5930. re.src_ip4 +
  5931. '|' +
  5932. '(?:(?:(?:' + re.src_domain + ')\\.)+(?:%TLDS%))' +
  5933. ')';
  5934. re.tpl_host_no_ip_fuzzy =
  5935. '(?:(?:(?:' + re.src_domain + ')\\.)+(?:%TLDS%))';
  5936. re.src_host_strict =
  5937. re.src_host + re.src_host_terminator;
  5938. re.tpl_host_fuzzy_strict =
  5939. re.tpl_host_fuzzy + re.src_host_terminator;
  5940. re.src_host_port_strict =
  5941. re.src_host + re.src_port + re.src_host_terminator;
  5942. re.tpl_host_port_fuzzy_strict =
  5943. re.tpl_host_fuzzy + re.src_port + re.src_host_terminator;
  5944. re.tpl_host_port_no_ip_fuzzy_strict =
  5945. re.tpl_host_no_ip_fuzzy + re.src_port + re.src_host_terminator;
  5946. ////////////////////////////////////////////////////////////////////////////////
  5947. // Main rules
  5948. // Rude test fuzzy links by host, for quick deny
  5949. re.tpl_host_fuzzy_test =
  5950. 'localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:' + re.src_ZPCc + '|>|$))';
  5951. re.tpl_email_fuzzy =
  5952. '(^|' + text_separators + '|\\(|' + re.src_ZCc + ')(' + re.src_email_name + '@' + re.tpl_host_fuzzy_strict + ')';
  5953. re.tpl_link_fuzzy =
  5954. // Fuzzy link can't be prepended with .:/\- and non punctuation.
  5955. // but can start with > (markdown blockquote)
  5956. '(^|(?![.:/\\-_@])(?:[$+<=>^`|\uff5c]|' + re.src_ZPCc + '))' +
  5957. '((?![$+<=>^`|\uff5c])' + re.tpl_host_port_fuzzy_strict + re.src_path + ')';
  5958. re.tpl_link_no_ip_fuzzy =
  5959. // Fuzzy link can't be prepended with .:/\- and non punctuation.
  5960. // but can start with > (markdown blockquote)
  5961. '(^|(?![.:/\\-_@])(?:[$+<=>^`|\uff5c]|' + re.src_ZPCc + '))' +
  5962. '((?![$+<=>^`|\uff5c])' + re.tpl_host_port_no_ip_fuzzy_strict + re.src_path + ')';
  5963. return re;
  5964. };
  5965. /***/ }),
  5966. /* 30 */
  5967. /***/ (function(module, exports, __webpack_require__) {
  5968. "use strict";
  5969. // List of valid html blocks names, accorting to commonmark spec
  5970. // http://jgm.github.io/CommonMark/spec.html#html-blocks
  5971. module.exports = [
  5972. 'address',
  5973. 'article',
  5974. 'aside',
  5975. 'base',
  5976. 'basefont',
  5977. 'blockquote',
  5978. 'body',
  5979. 'caption',
  5980. 'center',
  5981. 'col',
  5982. 'colgroup',
  5983. 'dd',
  5984. 'details',
  5985. 'dialog',
  5986. 'dir',
  5987. 'div',
  5988. 'dl',
  5989. 'dt',
  5990. 'fieldset',
  5991. 'figcaption',
  5992. 'figure',
  5993. 'footer',
  5994. 'form',
  5995. 'frame',
  5996. 'frameset',
  5997. 'h1',
  5998. 'h2',
  5999. 'h3',
  6000. 'h4',
  6001. 'h5',
  6002. 'h6',
  6003. 'head',
  6004. 'header',
  6005. 'hr',
  6006. 'html',
  6007. 'iframe',
  6008. 'legend',
  6009. 'li',
  6010. 'link',
  6011. 'main',
  6012. 'menu',
  6013. 'menuitem',
  6014. 'meta',
  6015. 'nav',
  6016. 'noframes',
  6017. 'ol',
  6018. 'optgroup',
  6019. 'option',
  6020. 'p',
  6021. 'param',
  6022. 'pre',
  6023. 'section',
  6024. 'source',
  6025. 'title',
  6026. 'summary',
  6027. 'table',
  6028. 'tbody',
  6029. 'td',
  6030. 'tfoot',
  6031. 'th',
  6032. 'thead',
  6033. 'title',
  6034. 'tr',
  6035. 'track',
  6036. 'ul'
  6037. ];
  6038. /***/ }),
  6039. /* 31 */
  6040. /***/ (function(module, exports, __webpack_require__) {
  6041. "use strict";
  6042. // Just a shortcut for bulk export
  6043. exports.parseLinkLabel = __webpack_require__(33);
  6044. exports.parseLinkDestination = __webpack_require__(32);
  6045. exports.parseLinkTitle = __webpack_require__(34);
  6046. /***/ }),
  6047. /* 32 */
  6048. /***/ (function(module, exports, __webpack_require__) {
  6049. "use strict";
  6050. // Parse link destination
  6051. //
  6052. var isSpace = __webpack_require__(0).isSpace;
  6053. var unescapeAll = __webpack_require__(0).unescapeAll;
  6054. module.exports = function parseLinkDestination(str, pos, max) {
  6055. var code, level,
  6056. lines = 0,
  6057. start = pos,
  6058. result = {
  6059. ok: false,
  6060. pos: 0,
  6061. lines: 0,
  6062. str: ''
  6063. };
  6064. if (str.charCodeAt(pos) === 0x3C /* < */) {
  6065. pos++;
  6066. while (pos < max) {
  6067. code = str.charCodeAt(pos);
  6068. if (code === 0x0A /* \n */ || isSpace(code)) { return result; }
  6069. if (code === 0x3E /* > */) {
  6070. result.pos = pos + 1;
  6071. result.str = unescapeAll(str.slice(start + 1, pos));
  6072. result.ok = true;
  6073. return result;
  6074. }
  6075. if (code === 0x5C /* \ */ && pos + 1 < max) {
  6076. pos += 2;
  6077. continue;
  6078. }
  6079. pos++;
  6080. }
  6081. // no closing '>'
  6082. return result;
  6083. }
  6084. // this should be ... } else { ... branch
  6085. level = 0;
  6086. while (pos < max) {
  6087. code = str.charCodeAt(pos);
  6088. if (code === 0x20) { break; }
  6089. // ascii control characters
  6090. if (code < 0x20 || code === 0x7F) { break; }
  6091. if (code === 0x5C /* \ */ && pos + 1 < max) {
  6092. pos += 2;
  6093. continue;
  6094. }
  6095. if (code === 0x28 /* ( */) {
  6096. level++;
  6097. if (level > 1) { break; }
  6098. }
  6099. if (code === 0x29 /* ) */) {
  6100. level--;
  6101. if (level < 0) { break; }
  6102. }
  6103. pos++;
  6104. }
  6105. if (start === pos) { return result; }
  6106. result.str = unescapeAll(str.slice(start, pos));
  6107. result.lines = lines;
  6108. result.pos = pos;
  6109. result.ok = true;
  6110. return result;
  6111. };
  6112. /***/ }),
  6113. /* 33 */
  6114. /***/ (function(module, exports, __webpack_require__) {
  6115. "use strict";
  6116. // Parse link label
  6117. //
  6118. // this function assumes that first character ("[") already matches;
  6119. // returns the end of the label
  6120. //
  6121. module.exports = function parseLinkLabel(state, start, disableNested) {
  6122. var level, found, marker, prevPos,
  6123. labelEnd = -1,
  6124. max = state.posMax,
  6125. oldPos = state.pos;
  6126. state.pos = start + 1;
  6127. level = 1;
  6128. while (state.pos < max) {
  6129. marker = state.src.charCodeAt(state.pos);
  6130. if (marker === 0x5D /* ] */) {
  6131. level--;
  6132. if (level === 0) {
  6133. found = true;
  6134. break;
  6135. }
  6136. }
  6137. prevPos = state.pos;
  6138. state.md.inline.skipToken(state);
  6139. if (marker === 0x5B /* [ */) {
  6140. if (prevPos === state.pos - 1) {
  6141. // increase level if we find text `[`, which is not a part of any token
  6142. level++;
  6143. } else if (disableNested) {
  6144. state.pos = oldPos;
  6145. return -1;
  6146. }
  6147. }
  6148. }
  6149. if (found) {
  6150. labelEnd = state.pos;
  6151. }
  6152. // restore old state
  6153. state.pos = oldPos;
  6154. return labelEnd;
  6155. };
  6156. /***/ }),
  6157. /* 34 */
  6158. /***/ (function(module, exports, __webpack_require__) {
  6159. "use strict";
  6160. // Parse link title
  6161. //
  6162. var unescapeAll = __webpack_require__(0).unescapeAll;
  6163. module.exports = function parseLinkTitle(str, pos, max) {
  6164. var code,
  6165. marker,
  6166. lines = 0,
  6167. start = pos,
  6168. result = {
  6169. ok: false,
  6170. pos: 0,
  6171. lines: 0,
  6172. str: ''
  6173. };
  6174. if (pos >= max) { return result; }
  6175. marker = str.charCodeAt(pos);
  6176. if (marker !== 0x22 /* " */ && marker !== 0x27 /* ' */ && marker !== 0x28 /* ( */) { return result; }
  6177. pos++;
  6178. // if opening marker is "(", switch it to closing marker ")"
  6179. if (marker === 0x28) { marker = 0x29; }
  6180. while (pos < max) {
  6181. code = str.charCodeAt(pos);
  6182. if (code === marker) {
  6183. result.pos = pos + 1;
  6184. result.lines = lines;
  6185. result.str = unescapeAll(str.slice(start + 1, pos));
  6186. result.ok = true;
  6187. return result;
  6188. } else if (code === 0x0A) {
  6189. lines++;
  6190. } else if (code === 0x5C /* \ */ && pos + 1 < max) {
  6191. pos++;
  6192. if (str.charCodeAt(pos) === 0x0A) {
  6193. lines++;
  6194. }
  6195. }
  6196. pos++;
  6197. }
  6198. return result;
  6199. };
  6200. /***/ }),
  6201. /* 35 */
  6202. /***/ (function(module, exports, __webpack_require__) {
  6203. "use strict";
  6204. // Main parser class
  6205. var utils = __webpack_require__(0);
  6206. var helpers = __webpack_require__(31);
  6207. var Renderer = __webpack_require__(42);
  6208. var ParserCore = __webpack_require__(37);
  6209. var ParserBlock = __webpack_require__(36);
  6210. var ParserInline = __webpack_require__(38);
  6211. var LinkifyIt = __webpack_require__(28);
  6212. var mdurl = __webpack_require__(15);
  6213. var punycode = __webpack_require__(79);
  6214. var config = {
  6215. 'default': __webpack_require__(40),
  6216. zero: __webpack_require__(41),
  6217. commonmark: __webpack_require__(39)
  6218. };
  6219. ////////////////////////////////////////////////////////////////////////////////
  6220. //
  6221. // This validator can prohibit more than really needed to prevent XSS. It's a
  6222. // tradeoff to keep code simple and to be secure by default.
  6223. //
  6224. // If you need different setup - override validator method as you wish. Or
  6225. // replace it with dummy function and use external sanitizer.
  6226. //
  6227. var BAD_PROTO_RE = /^(vbscript|javascript|file|data):/;
  6228. var GOOD_DATA_RE = /^data:image\/(gif|png|jpeg|webp);/;
  6229. function validateLink(url) {
  6230. // url should be normalized at this point, and existing entities are decoded
  6231. var str = url.trim().toLowerCase();
  6232. return BAD_PROTO_RE.test(str) ? (GOOD_DATA_RE.test(str) ? true : false) : true;
  6233. }
  6234. ////////////////////////////////////////////////////////////////////////////////
  6235. var RECODE_HOSTNAME_FOR = [ 'http:', 'https:', 'mailto:' ];
  6236. function normalizeLink(url) {
  6237. var parsed = mdurl.parse(url, true);
  6238. if (parsed.hostname) {
  6239. // Encode hostnames in urls like:
  6240. // `http://host/`, `https://host/`, `mailto:user@host`, `//host/`
  6241. //
  6242. // We don't encode unknown schemas, because it's likely that we encode
  6243. // something we shouldn't (e.g. `skype:name` treated as `skype:host`)
  6244. //
  6245. if (!parsed.protocol || RECODE_HOSTNAME_FOR.indexOf(parsed.protocol) >= 0) {
  6246. try {
  6247. parsed.hostname = punycode.toASCII(parsed.hostname);
  6248. } catch (er) { /**/ }
  6249. }
  6250. }
  6251. return mdurl.encode(mdurl.format(parsed));
  6252. }
  6253. function normalizeLinkText(url) {
  6254. var parsed = mdurl.parse(url, true);
  6255. if (parsed.hostname) {
  6256. // Encode hostnames in urls like:
  6257. // `http://host/`, `https://host/`, `mailto:user@host`, `//host/`
  6258. //
  6259. // We don't encode unknown schemas, because it's likely that we encode
  6260. // something we shouldn't (e.g. `skype:name` treated as `skype:host`)
  6261. //
  6262. if (!parsed.protocol || RECODE_HOSTNAME_FOR.indexOf(parsed.protocol) >= 0) {
  6263. try {
  6264. parsed.hostname = punycode.toUnicode(parsed.hostname);
  6265. } catch (er) { /**/ }
  6266. }
  6267. }
  6268. return mdurl.decode(mdurl.format(parsed));
  6269. }
  6270. /**
  6271. * class MarkdownIt
  6272. *
  6273. * Main parser/renderer class.
  6274. *
  6275. * ##### Usage
  6276. *
  6277. * ```javascript
  6278. * // node.js, "classic" way:
  6279. * var MarkdownIt = require('markdown-it'),
  6280. * md = new MarkdownIt();
  6281. * var result = md.render('# markdown-it rulezz!');
  6282. *
  6283. * // node.js, the same, but with sugar:
  6284. * var md = require('markdown-it')();
  6285. * var result = md.render('# markdown-it rulezz!');
  6286. *
  6287. * // browser without AMD, added to "window" on script load
  6288. * // Note, there are no dash.
  6289. * var md = window.markdownit();
  6290. * var result = md.render('# markdown-it rulezz!');
  6291. * ```
  6292. *
  6293. * Single line rendering, without paragraph wrap:
  6294. *
  6295. * ```javascript
  6296. * var md = require('markdown-it')();
  6297. * var result = md.renderInline('__markdown-it__ rulezz!');
  6298. * ```
  6299. **/
  6300. /**
  6301. * new MarkdownIt([presetName, options])
  6302. * - presetName (String): optional, `commonmark` / `zero`
  6303. * - options (Object)
  6304. *
  6305. * Creates parser instanse with given config. Can be called without `new`.
  6306. *
  6307. * ##### presetName
  6308. *
  6309. * MarkdownIt provides named presets as a convenience to quickly
  6310. * enable/disable active syntax rules and options for common use cases.
  6311. *
  6312. * - ["commonmark"](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/commonmark.js) -
  6313. * configures parser to strict [CommonMark](http://commonmark.org/) mode.
  6314. * - [default](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/default.js) -
  6315. * similar to GFM, used when no preset name given. Enables all available rules,
  6316. * but still without html, typographer & autolinker.
  6317. * - ["zero"](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/zero.js) -
  6318. * all rules disabled. Useful to quickly setup your config via `.enable()`.
  6319. * For example, when you need only `bold` and `italic` markup and nothing else.
  6320. *
  6321. * ##### options:
  6322. *
  6323. * - __html__ - `false`. Set `true` to enable HTML tags in source. Be careful!
  6324. * That's not safe! You may need external sanitizer to protect output from XSS.
  6325. * It's better to extend features via plugins, instead of enabling HTML.
  6326. * - __xhtmlOut__ - `false`. Set `true` to add '/' when closing single tags
  6327. * (`<br />`). This is needed only for full CommonMark compatibility. In real
  6328. * world you will need HTML output.
  6329. * - __breaks__ - `false`. Set `true` to convert `\n` in paragraphs into `<br>`.
  6330. * - __langPrefix__ - `language-`. CSS language class prefix for fenced blocks.
  6331. * Can be useful for external highlighters.
  6332. * - __linkify__ - `false`. Set `true` to autoconvert URL-like text to links.
  6333. * - __typographer__ - `false`. Set `true` to enable [some language-neutral
  6334. * replacement](https://github.com/markdown-it/markdown-it/blob/master/lib/rules_core/replacements.js) +
  6335. * quotes beautification (smartquotes).
  6336. * - __quotes__ - `“”‘’`, String or Array. Double + single quotes replacement
  6337. * pairs, when typographer enabled and smartquotes on. For example, you can
  6338. * use `'«»„“'` for Russian, `'„“‚‘'` for German, and
  6339. * `['«\xA0', '\xA0»', '‹\xA0', '\xA0›']` for French (including nbsp).
  6340. * - __highlight__ - `null`. Highlighter function for fenced code blocks.
  6341. * Highlighter `function (str, lang)` should return escaped HTML. It can also
  6342. * return empty string if the source was not changed and should be escaped
  6343. * externaly. If result starts with <pre... internal wrapper is skipped.
  6344. *
  6345. * ##### Example
  6346. *
  6347. * ```javascript
  6348. * // commonmark mode
  6349. * var md = require('markdown-it')('commonmark');
  6350. *
  6351. * // default mode
  6352. * var md = require('markdown-it')();
  6353. *
  6354. * // enable everything
  6355. * var md = require('markdown-it')({
  6356. * html: true,
  6357. * linkify: true,
  6358. * typographer: true
  6359. * });
  6360. * ```
  6361. *
  6362. * ##### Syntax highlighting
  6363. *
  6364. * ```js
  6365. * var hljs = require('highlight.js') // https://highlightjs.org/
  6366. *
  6367. * var md = require('markdown-it')({
  6368. * highlight: function (str, lang) {
  6369. * if (lang && hljs.getLanguage(lang)) {
  6370. * try {
  6371. * return hljs.highlight(lang, str, true).value;
  6372. * } catch (__) {}
  6373. * }
  6374. *
  6375. * return ''; // use external default escaping
  6376. * }
  6377. * });
  6378. * ```
  6379. *
  6380. * Or with full wrapper override (if you need assign class to `<pre>`):
  6381. *
  6382. * ```javascript
  6383. * var hljs = require('highlight.js') // https://highlightjs.org/
  6384. *
  6385. * // Actual default values
  6386. * var md = require('markdown-it')({
  6387. * highlight: function (str, lang) {
  6388. * if (lang && hljs.getLanguage(lang)) {
  6389. * try {
  6390. * return '<pre class="hljs"><code>' +
  6391. * hljs.highlight(lang, str, true).value +
  6392. * '</code></pre>';
  6393. * } catch (__) {}
  6394. * }
  6395. *
  6396. * return '<pre class="hljs"><code>' + md.utils.escapeHtml(str) + '</code></pre>';
  6397. * }
  6398. * });
  6399. * ```
  6400. *
  6401. **/
  6402. function MarkdownIt(presetName, options) {
  6403. if (!(this instanceof MarkdownIt)) {
  6404. return new MarkdownIt(presetName, options);
  6405. }
  6406. if (!options) {
  6407. if (!utils.isString(presetName)) {
  6408. options = presetName || {};
  6409. presetName = 'default';
  6410. }
  6411. }
  6412. /**
  6413. * MarkdownIt#inline -> ParserInline
  6414. *
  6415. * Instance of [[ParserInline]]. You may need it to add new rules when
  6416. * writing plugins. For simple rules control use [[MarkdownIt.disable]] and
  6417. * [[MarkdownIt.enable]].
  6418. **/
  6419. this.inline = new ParserInline();
  6420. /**
  6421. * MarkdownIt#block -> ParserBlock
  6422. *
  6423. * Instance of [[ParserBlock]]. You may need it to add new rules when
  6424. * writing plugins. For simple rules control use [[MarkdownIt.disable]] and
  6425. * [[MarkdownIt.enable]].
  6426. **/
  6427. this.block = new ParserBlock();
  6428. /**
  6429. * MarkdownIt#core -> Core
  6430. *
  6431. * Instance of [[Core]] chain executor. You may need it to add new rules when
  6432. * writing plugins. For simple rules control use [[MarkdownIt.disable]] and
  6433. * [[MarkdownIt.enable]].
  6434. **/
  6435. this.core = new ParserCore();
  6436. /**
  6437. * MarkdownIt#renderer -> Renderer
  6438. *
  6439. * Instance of [[Renderer]]. Use it to modify output look. Or to add rendering
  6440. * rules for new token types, generated by plugins.
  6441. *
  6442. * ##### Example
  6443. *
  6444. * ```javascript
  6445. * var md = require('markdown-it')();
  6446. *
  6447. * function myToken(tokens, idx, options, env, self) {
  6448. * //...
  6449. * return result;
  6450. * };
  6451. *
  6452. * md.renderer.rules['my_token'] = myToken
  6453. * ```
  6454. *
  6455. * See [[Renderer]] docs and [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.js).
  6456. **/
  6457. this.renderer = new Renderer();
  6458. /**
  6459. * MarkdownIt#linkify -> LinkifyIt
  6460. *
  6461. * [linkify-it](https://github.com/markdown-it/linkify-it) instance.
  6462. * Used by [linkify](https://github.com/markdown-it/markdown-it/blob/master/lib/rules_core/linkify.js)
  6463. * rule.
  6464. **/
  6465. this.linkify = new LinkifyIt();
  6466. /**
  6467. * MarkdownIt#validateLink(url) -> Boolean
  6468. *
  6469. * Link validation function. CommonMark allows too much in links. By default
  6470. * we disable `javascript:`, `vbscript:`, `file:` schemas, and almost all `data:...` schemas
  6471. * except some embedded image types.
  6472. *
  6473. * You can change this behaviour:
  6474. *
  6475. * ```javascript
  6476. * var md = require('markdown-it')();
  6477. * // enable everything
  6478. * md.validateLink = function () { return true; }
  6479. * ```
  6480. **/
  6481. this.validateLink = validateLink;
  6482. /**
  6483. * MarkdownIt#normalizeLink(url) -> String
  6484. *
  6485. * Function used to encode link url to a machine-readable format,
  6486. * which includes url-encoding, punycode, etc.
  6487. **/
  6488. this.normalizeLink = normalizeLink;
  6489. /**
  6490. * MarkdownIt#normalizeLinkText(url) -> String
  6491. *
  6492. * Function used to decode link url to a human-readable format`
  6493. **/
  6494. this.normalizeLinkText = normalizeLinkText;
  6495. // Expose utils & helpers for easy acces from plugins
  6496. /**
  6497. * MarkdownIt#utils -> utils
  6498. *
  6499. * Assorted utility functions, useful to write plugins. See details
  6500. * [here](https://github.com/markdown-it/markdown-it/blob/master/lib/common/utils.js).
  6501. **/
  6502. this.utils = utils;
  6503. /**
  6504. * MarkdownIt#helpers -> helpers
  6505. *
  6506. * Link components parser functions, useful to write plugins. See details
  6507. * [here](https://github.com/markdown-it/markdown-it/blob/master/lib/helpers).
  6508. **/
  6509. this.helpers = utils.assign({}, helpers);
  6510. this.options = {};
  6511. this.configure(presetName);
  6512. if (options) { this.set(options); }
  6513. }
  6514. /** chainable
  6515. * MarkdownIt.set(options)
  6516. *
  6517. * Set parser options (in the same format as in constructor). Probably, you
  6518. * will never need it, but you can change options after constructor call.
  6519. *
  6520. * ##### Example
  6521. *
  6522. * ```javascript
  6523. * var md = require('markdown-it')()
  6524. * .set({ html: true, breaks: true })
  6525. * .set({ typographer, true });
  6526. * ```
  6527. *
  6528. * __Note:__ To achieve the best possible performance, don't modify a
  6529. * `markdown-it` instance options on the fly. If you need multiple configurations
  6530. * it's best to create multiple instances and initialize each with separate
  6531. * config.
  6532. **/
  6533. MarkdownIt.prototype.set = function (options) {
  6534. utils.assign(this.options, options);
  6535. return this;
  6536. };
  6537. /** chainable, internal
  6538. * MarkdownIt.configure(presets)
  6539. *
  6540. * Batch load of all options and compenent settings. This is internal method,
  6541. * and you probably will not need it. But if you with - see available presets
  6542. * and data structure [here](https://github.com/markdown-it/markdown-it/tree/master/lib/presets)
  6543. *
  6544. * We strongly recommend to use presets instead of direct config loads. That
  6545. * will give better compatibility with next versions.
  6546. **/
  6547. MarkdownIt.prototype.configure = function (presets) {
  6548. var self = this, presetName;
  6549. if (utils.isString(presets)) {
  6550. presetName = presets;
  6551. presets = config[presetName];
  6552. if (!presets) { throw new Error('Wrong `markdown-it` preset "' + presetName + '", check name'); }
  6553. }
  6554. if (!presets) { throw new Error('Wrong `markdown-it` preset, can\'t be empty'); }
  6555. if (presets.options) { self.set(presets.options); }
  6556. if (presets.components) {
  6557. Object.keys(presets.components).forEach(function (name) {
  6558. if (presets.components[name].rules) {
  6559. self[name].ruler.enableOnly(presets.components[name].rules);
  6560. }
  6561. if (presets.components[name].rules2) {
  6562. self[name].ruler2.enableOnly(presets.components[name].rules2);
  6563. }
  6564. });
  6565. }
  6566. return this;
  6567. };
  6568. /** chainable
  6569. * MarkdownIt.enable(list, ignoreInvalid)
  6570. * - list (String|Array): rule name or list of rule names to enable
  6571. * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found.
  6572. *
  6573. * Enable list or rules. It will automatically find appropriate components,
  6574. * containing rules with given names. If rule not found, and `ignoreInvalid`
  6575. * not set - throws exception.
  6576. *
  6577. * ##### Example
  6578. *
  6579. * ```javascript
  6580. * var md = require('markdown-it')()
  6581. * .enable(['sub', 'sup'])
  6582. * .disable('smartquotes');
  6583. * ```
  6584. **/
  6585. MarkdownIt.prototype.enable = function (list, ignoreInvalid) {
  6586. var result = [];
  6587. if (!Array.isArray(list)) { list = [ list ]; }
  6588. [ 'core', 'block', 'inline' ].forEach(function (chain) {
  6589. result = result.concat(this[chain].ruler.enable(list, true));
  6590. }, this);
  6591. result = result.concat(this.inline.ruler2.enable(list, true));
  6592. var missed = list.filter(function (name) { return result.indexOf(name) < 0; });
  6593. if (missed.length && !ignoreInvalid) {
  6594. throw new Error('MarkdownIt. Failed to enable unknown rule(s): ' + missed);
  6595. }
  6596. return this;
  6597. };
  6598. /** chainable
  6599. * MarkdownIt.disable(list, ignoreInvalid)
  6600. * - list (String|Array): rule name or list of rule names to disable.
  6601. * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found.
  6602. *
  6603. * The same as [[MarkdownIt.enable]], but turn specified rules off.
  6604. **/
  6605. MarkdownIt.prototype.disable = function (list, ignoreInvalid) {
  6606. var result = [];
  6607. if (!Array.isArray(list)) { list = [ list ]; }
  6608. [ 'core', 'block', 'inline' ].forEach(function (chain) {
  6609. result = result.concat(this[chain].ruler.disable(list, true));
  6610. }, this);
  6611. result = result.concat(this.inline.ruler2.disable(list, true));
  6612. var missed = list.filter(function (name) { return result.indexOf(name) < 0; });
  6613. if (missed.length && !ignoreInvalid) {
  6614. throw new Error('MarkdownIt. Failed to disable unknown rule(s): ' + missed);
  6615. }
  6616. return this;
  6617. };
  6618. /** chainable
  6619. * MarkdownIt.use(plugin, params)
  6620. *
  6621. * Load specified plugin with given params into current parser instance.
  6622. * It's just a sugar to call `plugin(md, params)` with curring.
  6623. *
  6624. * ##### Example
  6625. *
  6626. * ```javascript
  6627. * var iterator = require('markdown-it-for-inline');
  6628. * var md = require('markdown-it')()
  6629. * .use(iterator, 'foo_replace', 'text', function (tokens, idx) {
  6630. * tokens[idx].content = tokens[idx].content.replace(/foo/g, 'bar');
  6631. * });
  6632. * ```
  6633. **/
  6634. MarkdownIt.prototype.use = function (plugin /*, params, ... */) {
  6635. var args = [ this ].concat(Array.prototype.slice.call(arguments, 1));
  6636. plugin.apply(plugin, args);
  6637. return this;
  6638. };
  6639. /** internal
  6640. * MarkdownIt.parse(src, env) -> Array
  6641. * - src (String): source string
  6642. * - env (Object): environment sandbox
  6643. *
  6644. * Parse input string and returns list of block tokens (special token type
  6645. * "inline" will contain list of inline tokens). You should not call this
  6646. * method directly, until you write custom renderer (for example, to produce
  6647. * AST).
  6648. *
  6649. * `env` is used to pass data between "distributed" rules and return additional
  6650. * metadata like reference info, needed for the renderer. It also can be used to
  6651. * inject data in specific cases. Usually, you will be ok to pass `{}`,
  6652. * and then pass updated object to renderer.
  6653. **/
  6654. MarkdownIt.prototype.parse = function (src, env) {
  6655. if (typeof src !== 'string') {
  6656. throw new Error('Input data should be a String');
  6657. }
  6658. var state = new this.core.State(src, this, env);
  6659. this.core.process(state);
  6660. return state.tokens;
  6661. };
  6662. /**
  6663. * MarkdownIt.render(src [, env]) -> String
  6664. * - src (String): source string
  6665. * - env (Object): environment sandbox
  6666. *
  6667. * Render markdown string into html. It does all magic for you :).
  6668. *
  6669. * `env` can be used to inject additional metadata (`{}` by default).
  6670. * But you will not need it with high probability. See also comment
  6671. * in [[MarkdownIt.parse]].
  6672. **/
  6673. MarkdownIt.prototype.render = function (src, env) {
  6674. env = env || {};
  6675. return this.renderer.render(this.parse(src, env), this.options, env);
  6676. };
  6677. /** internal
  6678. * MarkdownIt.parseInline(src, env) -> Array
  6679. * - src (String): source string
  6680. * - env (Object): environment sandbox
  6681. *
  6682. * The same as [[MarkdownIt.parse]] but skip all block rules. It returns the
  6683. * block tokens list with the single `inline` element, containing parsed inline
  6684. * tokens in `children` property. Also updates `env` object.
  6685. **/
  6686. MarkdownIt.prototype.parseInline = function (src, env) {
  6687. var state = new this.core.State(src, this, env);
  6688. state.inlineMode = true;
  6689. this.core.process(state);
  6690. return state.tokens;
  6691. };
  6692. /**
  6693. * MarkdownIt.renderInline(src [, env]) -> String
  6694. * - src (String): source string
  6695. * - env (Object): environment sandbox
  6696. *
  6697. * Similar to [[MarkdownIt.render]] but for single paragraph content. Result
  6698. * will NOT be wrapped into `<p>` tags.
  6699. **/
  6700. MarkdownIt.prototype.renderInline = function (src, env) {
  6701. env = env || {};
  6702. return this.renderer.render(this.parseInline(src, env), this.options, env);
  6703. };
  6704. module.exports = MarkdownIt;
  6705. /***/ }),
  6706. /* 36 */
  6707. /***/ (function(module, exports, __webpack_require__) {
  6708. "use strict";
  6709. /** internal
  6710. * class ParserBlock
  6711. *
  6712. * Block-level tokenizer.
  6713. **/
  6714. var Ruler = __webpack_require__(3);
  6715. var _rules = [
  6716. // First 2 params - rule name & source. Secondary array - list of rules,
  6717. // which can be terminated by this one.
  6718. [ 'table', __webpack_require__(54), [ 'paragraph', 'reference' ] ],
  6719. [ 'code', __webpack_require__(44) ],
  6720. [ 'fence', __webpack_require__(45), [ 'paragraph', 'reference', 'blockquote', 'list' ] ],
  6721. [ 'blockquote', __webpack_require__(43), [ 'paragraph', 'reference', 'list' ] ],
  6722. [ 'hr', __webpack_require__(47), [ 'paragraph', 'reference', 'blockquote', 'list' ] ],
  6723. [ 'list', __webpack_require__(50), [ 'paragraph', 'reference', 'blockquote' ] ],
  6724. [ 'reference', __webpack_require__(52) ],
  6725. [ 'heading', __webpack_require__(46), [ 'paragraph', 'reference', 'blockquote' ] ],
  6726. [ 'lheading', __webpack_require__(49) ],
  6727. [ 'html_block', __webpack_require__(48), [ 'paragraph', 'reference', 'blockquote' ] ],
  6728. [ 'paragraph', __webpack_require__(51) ]
  6729. ];
  6730. /**
  6731. * new ParserBlock()
  6732. **/
  6733. function ParserBlock() {
  6734. /**
  6735. * ParserBlock#ruler -> Ruler
  6736. *
  6737. * [[Ruler]] instance. Keep configuration of block rules.
  6738. **/
  6739. this.ruler = new Ruler();
  6740. for (var i = 0; i < _rules.length; i++) {
  6741. this.ruler.push(_rules[i][0], _rules[i][1], { alt: (_rules[i][2] || []).slice() });
  6742. }
  6743. }
  6744. // Generate tokens for input range
  6745. //
  6746. ParserBlock.prototype.tokenize = function (state, startLine, endLine) {
  6747. var ok, i,
  6748. rules = this.ruler.getRules(''),
  6749. len = rules.length,
  6750. line = startLine,
  6751. hasEmptyLines = false,
  6752. maxNesting = state.md.options.maxNesting;
  6753. while (line < endLine) {
  6754. state.line = line = state.skipEmptyLines(line);
  6755. if (line >= endLine) { break; }
  6756. // Termination condition for nested calls.
  6757. // Nested calls currently used for blockquotes & lists
  6758. if (state.sCount[line] < state.blkIndent) { break; }
  6759. // If nesting level exceeded - skip tail to the end. That's not ordinary
  6760. // situation and we should not care about content.
  6761. if (state.level >= maxNesting) {
  6762. state.line = endLine;
  6763. break;
  6764. }
  6765. // Try all possible rules.
  6766. // On success, rule should:
  6767. //
  6768. // - update `state.line`
  6769. // - update `state.tokens`
  6770. // - return true
  6771. for (i = 0; i < len; i++) {
  6772. ok = rules[i](state, line, endLine, false);
  6773. if (ok) { break; }
  6774. }
  6775. // set state.tight iff we had an empty line before current tag
  6776. // i.e. latest empty line should not count
  6777. state.tight = !hasEmptyLines;
  6778. // paragraph might "eat" one newline after it in nested lists
  6779. if (state.isEmpty(state.line - 1)) {
  6780. hasEmptyLines = true;
  6781. }
  6782. line = state.line;
  6783. if (line < endLine && state.isEmpty(line)) {
  6784. hasEmptyLines = true;
  6785. line++;
  6786. state.line = line;
  6787. }
  6788. }
  6789. };
  6790. /**
  6791. * ParserBlock.parse(str, md, env, outTokens)
  6792. *
  6793. * Process input string and push block tokens into `outTokens`
  6794. **/
  6795. ParserBlock.prototype.parse = function (src, md, env, outTokens) {
  6796. var state;
  6797. if (!src) { return; }
  6798. state = new this.State(src, md, env, outTokens);
  6799. this.tokenize(state, state.line, state.lineMax);
  6800. };
  6801. ParserBlock.prototype.State = __webpack_require__(53);
  6802. module.exports = ParserBlock;
  6803. /***/ }),
  6804. /* 37 */
  6805. /***/ (function(module, exports, __webpack_require__) {
  6806. "use strict";
  6807. /** internal
  6808. * class Core
  6809. *
  6810. * Top-level rules executor. Glues block/inline parsers and does intermediate
  6811. * transformations.
  6812. **/
  6813. var Ruler = __webpack_require__(3);
  6814. var _rules = [
  6815. [ 'normalize', __webpack_require__(58) ],
  6816. [ 'block', __webpack_require__(55) ],
  6817. [ 'inline', __webpack_require__(56) ],
  6818. [ 'linkify', __webpack_require__(57) ],
  6819. [ 'replacements', __webpack_require__(59) ],
  6820. [ 'smartquotes', __webpack_require__(60) ]
  6821. ];
  6822. /**
  6823. * new Core()
  6824. **/
  6825. function Core() {
  6826. /**
  6827. * Core#ruler -> Ruler
  6828. *
  6829. * [[Ruler]] instance. Keep configuration of core rules.
  6830. **/
  6831. this.ruler = new Ruler();
  6832. for (var i = 0; i < _rules.length; i++) {
  6833. this.ruler.push(_rules[i][0], _rules[i][1]);
  6834. }
  6835. }
  6836. /**
  6837. * Core.process(state)
  6838. *
  6839. * Executes core chain rules.
  6840. **/
  6841. Core.prototype.process = function (state) {
  6842. var i, l, rules;
  6843. rules = this.ruler.getRules('');
  6844. for (i = 0, l = rules.length; i < l; i++) {
  6845. rules[i](state);
  6846. }
  6847. };
  6848. Core.prototype.State = __webpack_require__(61);
  6849. module.exports = Core;
  6850. /***/ }),
  6851. /* 38 */
  6852. /***/ (function(module, exports, __webpack_require__) {
  6853. "use strict";
  6854. /** internal
  6855. * class ParserInline
  6856. *
  6857. * Tokenizes paragraph content.
  6858. **/
  6859. var Ruler = __webpack_require__(3);
  6860. ////////////////////////////////////////////////////////////////////////////////
  6861. // Parser rules
  6862. var _rules = [
  6863. [ 'text', __webpack_require__(72) ],
  6864. [ 'newline', __webpack_require__(70) ],
  6865. [ 'escape', __webpack_require__(66) ],
  6866. [ 'backticks', __webpack_require__(63) ],
  6867. [ 'strikethrough', __webpack_require__(14).tokenize ],
  6868. [ 'emphasis', __webpack_require__(13).tokenize ],
  6869. [ 'link', __webpack_require__(69) ],
  6870. [ 'image', __webpack_require__(68) ],
  6871. [ 'autolink', __webpack_require__(62) ],
  6872. [ 'html_inline', __webpack_require__(67) ],
  6873. [ 'entity', __webpack_require__(65) ]
  6874. ];
  6875. var _rules2 = [
  6876. [ 'balance_pairs', __webpack_require__(64) ],
  6877. [ 'strikethrough', __webpack_require__(14).postProcess ],
  6878. [ 'emphasis', __webpack_require__(13).postProcess ],
  6879. [ 'text_collapse', __webpack_require__(73) ]
  6880. ];
  6881. /**
  6882. * new ParserInline()
  6883. **/
  6884. function ParserInline() {
  6885. var i;
  6886. /**
  6887. * ParserInline#ruler -> Ruler
  6888. *
  6889. * [[Ruler]] instance. Keep configuration of inline rules.
  6890. **/
  6891. this.ruler = new Ruler();
  6892. for (i = 0; i < _rules.length; i++) {
  6893. this.ruler.push(_rules[i][0], _rules[i][1]);
  6894. }
  6895. /**
  6896. * ParserInline#ruler2 -> Ruler
  6897. *
  6898. * [[Ruler]] instance. Second ruler used for post-processing
  6899. * (e.g. in emphasis-like rules).
  6900. **/
  6901. this.ruler2 = new Ruler();
  6902. for (i = 0; i < _rules2.length; i++) {
  6903. this.ruler2.push(_rules2[i][0], _rules2[i][1]);
  6904. }
  6905. }
  6906. // Skip single token by running all rules in validation mode;
  6907. // returns `true` if any rule reported success
  6908. //
  6909. ParserInline.prototype.skipToken = function (state) {
  6910. var ok, i, pos = state.pos,
  6911. rules = this.ruler.getRules(''),
  6912. len = rules.length,
  6913. maxNesting = state.md.options.maxNesting,
  6914. cache = state.cache;
  6915. if (typeof cache[pos] !== 'undefined') {
  6916. state.pos = cache[pos];
  6917. return;
  6918. }
  6919. if (state.level < maxNesting) {
  6920. for (i = 0; i < len; i++) {
  6921. // Increment state.level and decrement it later to limit recursion.
  6922. // It's harmless to do here, because no tokens are created. But ideally,
  6923. // we'd need a separate private state variable for this purpose.
  6924. //
  6925. state.level++;
  6926. ok = rules[i](state, true);
  6927. state.level--;
  6928. if (ok) { break; }
  6929. }
  6930. } else {
  6931. // Too much nesting, just skip until the end of the paragraph.
  6932. //
  6933. // NOTE: this will cause links to behave incorrectly in the following case,
  6934. // when an amount of `[` is exactly equal to `maxNesting + 1`:
  6935. //
  6936. // [[[[[[[[[[[[[[[[[[[[[foo]()
  6937. //
  6938. // TODO: remove this workaround when CM standard will allow nested links
  6939. // (we can replace it by preventing links from being parsed in
  6940. // validation mode)
  6941. //
  6942. state.pos = state.posMax;
  6943. }
  6944. if (!ok) { state.pos++; }
  6945. cache[pos] = state.pos;
  6946. };
  6947. // Generate tokens for input range
  6948. //
  6949. ParserInline.prototype.tokenize = function (state) {
  6950. var ok, i,
  6951. rules = this.ruler.getRules(''),
  6952. len = rules.length,
  6953. end = state.posMax,
  6954. maxNesting = state.md.options.maxNesting;
  6955. while (state.pos < end) {
  6956. // Try all possible rules.
  6957. // On success, rule should:
  6958. //
  6959. // - update `state.pos`
  6960. // - update `state.tokens`
  6961. // - return true
  6962. if (state.level < maxNesting) {
  6963. for (i = 0; i < len; i++) {
  6964. ok = rules[i](state, false);
  6965. if (ok) { break; }
  6966. }
  6967. }
  6968. if (ok) {
  6969. if (state.pos >= end) { break; }
  6970. continue;
  6971. }
  6972. state.pending += state.src[state.pos++];
  6973. }
  6974. if (state.pending) {
  6975. state.pushPending();
  6976. }
  6977. };
  6978. /**
  6979. * ParserInline.parse(str, md, env, outTokens)
  6980. *
  6981. * Process input string and push inline tokens into `outTokens`
  6982. **/
  6983. ParserInline.prototype.parse = function (str, md, env, outTokens) {
  6984. var i, rules, len;
  6985. var state = new this.State(str, md, env, outTokens);
  6986. this.tokenize(state);
  6987. rules = this.ruler2.getRules('');
  6988. len = rules.length;
  6989. for (i = 0; i < len; i++) {
  6990. rules[i](state);
  6991. }
  6992. };
  6993. ParserInline.prototype.State = __webpack_require__(71);
  6994. module.exports = ParserInline;
  6995. /***/ }),
  6996. /* 39 */
  6997. /***/ (function(module, exports, __webpack_require__) {
  6998. "use strict";
  6999. // Commonmark default options
  7000. module.exports = {
  7001. options: {
  7002. html: true, // Enable HTML tags in source
  7003. xhtmlOut: true, // Use '/' to close single tags (<br />)
  7004. breaks: false, // Convert '\n' in paragraphs into <br>
  7005. langPrefix: 'language-', // CSS language prefix for fenced blocks
  7006. linkify: false, // autoconvert URL-like texts to links
  7007. // Enable some language-neutral replacements + quotes beautification
  7008. typographer: false,
  7009. // Double + single quotes replacement pairs, when typographer enabled,
  7010. // and smartquotes on. Could be either a String or an Array.
  7011. //
  7012. // For example, you can use '«»„“' for Russian, '„“‚‘' for German,
  7013. // and ['«\xA0', '\xA0»', '‹\xA0', '\xA0›'] for French (including nbsp).
  7014. quotes: '\u201c\u201d\u2018\u2019', /* “”‘’ */
  7015. // Highlighter function. Should return escaped HTML,
  7016. // or '' if the source string is not changed and should be escaped externaly.
  7017. // If result starts with <pre... internal wrapper is skipped.
  7018. //
  7019. // function (/*str, lang*/) { return ''; }
  7020. //
  7021. highlight: null,
  7022. maxNesting: 20 // Internal protection, recursion limit
  7023. },
  7024. components: {
  7025. core: {
  7026. rules: [
  7027. 'normalize',
  7028. 'block',
  7029. 'inline'
  7030. ]
  7031. },
  7032. block: {
  7033. rules: [
  7034. 'blockquote',
  7035. 'code',
  7036. 'fence',
  7037. 'heading',
  7038. 'hr',
  7039. 'html_block',
  7040. 'lheading',
  7041. 'list',
  7042. 'reference',
  7043. 'paragraph'
  7044. ]
  7045. },
  7046. inline: {
  7047. rules: [
  7048. 'autolink',
  7049. 'backticks',
  7050. 'emphasis',
  7051. 'entity',
  7052. 'escape',
  7053. 'html_inline',
  7054. 'image',
  7055. 'link',
  7056. 'newline',
  7057. 'text'
  7058. ],
  7059. rules2: [
  7060. 'balance_pairs',
  7061. 'emphasis',
  7062. 'text_collapse'
  7063. ]
  7064. }
  7065. }
  7066. };
  7067. /***/ }),
  7068. /* 40 */
  7069. /***/ (function(module, exports, __webpack_require__) {
  7070. "use strict";
  7071. // markdown-it default options
  7072. module.exports = {
  7073. options: {
  7074. html: false, // Enable HTML tags in source
  7075. xhtmlOut: false, // Use '/' to close single tags (<br />)
  7076. breaks: false, // Convert '\n' in paragraphs into <br>
  7077. langPrefix: 'language-', // CSS language prefix for fenced blocks
  7078. linkify: false, // autoconvert URL-like texts to links
  7079. // Enable some language-neutral replacements + quotes beautification
  7080. typographer: false,
  7081. // Double + single quotes replacement pairs, when typographer enabled,
  7082. // and smartquotes on. Could be either a String or an Array.
  7083. //
  7084. // For example, you can use '«»„“' for Russian, '„“‚‘' for German,
  7085. // and ['«\xA0', '\xA0»', '‹\xA0', '\xA0›'] for French (including nbsp).
  7086. quotes: '\u201c\u201d\u2018\u2019', /* “”‘’ */
  7087. // Highlighter function. Should return escaped HTML,
  7088. // or '' if the source string is not changed and should be escaped externaly.
  7089. // If result starts with <pre... internal wrapper is skipped.
  7090. //
  7091. // function (/*str, lang*/) { return ''; }
  7092. //
  7093. highlight: null,
  7094. maxNesting: 100 // Internal protection, recursion limit
  7095. },
  7096. components: {
  7097. core: {},
  7098. block: {},
  7099. inline: {}
  7100. }
  7101. };
  7102. /***/ }),
  7103. /* 41 */
  7104. /***/ (function(module, exports, __webpack_require__) {
  7105. "use strict";
  7106. // "Zero" preset, with nothing enabled. Useful for manual configuring of simple
  7107. // modes. For example, to parse bold/italic only.
  7108. module.exports = {
  7109. options: {
  7110. html: false, // Enable HTML tags in source
  7111. xhtmlOut: false, // Use '/' to close single tags (<br />)
  7112. breaks: false, // Convert '\n' in paragraphs into <br>
  7113. langPrefix: 'language-', // CSS language prefix for fenced blocks
  7114. linkify: false, // autoconvert URL-like texts to links
  7115. // Enable some language-neutral replacements + quotes beautification
  7116. typographer: false,
  7117. // Double + single quotes replacement pairs, when typographer enabled,
  7118. // and smartquotes on. Could be either a String or an Array.
  7119. //
  7120. // For example, you can use '«»„“' for Russian, '„“‚‘' for German,
  7121. // and ['«\xA0', '\xA0»', '‹\xA0', '\xA0›'] for French (including nbsp).
  7122. quotes: '\u201c\u201d\u2018\u2019', /* “”‘’ */
  7123. // Highlighter function. Should return escaped HTML,
  7124. // or '' if the source string is not changed and should be escaped externaly.
  7125. // If result starts with <pre... internal wrapper is skipped.
  7126. //
  7127. // function (/*str, lang*/) { return ''; }
  7128. //
  7129. highlight: null,
  7130. maxNesting: 20 // Internal protection, recursion limit
  7131. },
  7132. components: {
  7133. core: {
  7134. rules: [
  7135. 'normalize',
  7136. 'block',
  7137. 'inline'
  7138. ]
  7139. },
  7140. block: {
  7141. rules: [
  7142. 'paragraph'
  7143. ]
  7144. },
  7145. inline: {
  7146. rules: [
  7147. 'text'
  7148. ],
  7149. rules2: [
  7150. 'balance_pairs',
  7151. 'text_collapse'
  7152. ]
  7153. }
  7154. }
  7155. };
  7156. /***/ }),
  7157. /* 42 */
  7158. /***/ (function(module, exports, __webpack_require__) {
  7159. "use strict";
  7160. /**
  7161. * class Renderer
  7162. *
  7163. * Generates HTML from parsed token stream. Each instance has independent
  7164. * copy of rules. Those can be rewritten with ease. Also, you can add new
  7165. * rules if you create plugin and adds new token types.
  7166. **/
  7167. var assign = __webpack_require__(0).assign;
  7168. var unescapeAll = __webpack_require__(0).unescapeAll;
  7169. var escapeHtml = __webpack_require__(0).escapeHtml;
  7170. ////////////////////////////////////////////////////////////////////////////////
  7171. var default_rules = {};
  7172. default_rules.code_inline = function (tokens, idx, options, env, slf) {
  7173. var token = tokens[idx];
  7174. return '<code' + slf.renderAttrs(token) + '>' +
  7175. escapeHtml(tokens[idx].content) +
  7176. '</code>';
  7177. };
  7178. default_rules.code_block = function (tokens, idx, options, env, slf) {
  7179. var token = tokens[idx];
  7180. return '<pre' + slf.renderAttrs(token) + '><code>' +
  7181. escapeHtml(tokens[idx].content) +
  7182. '</code></pre>\n';
  7183. };
  7184. default_rules.fence = function (tokens, idx, options, env, slf) {
  7185. var token = tokens[idx],
  7186. info = token.info ? unescapeAll(token.info).trim() : '',
  7187. langName = '',
  7188. highlighted, i, tmpAttrs, tmpToken;
  7189. if (info) {
  7190. langName = info.split(/\s+/g)[0];
  7191. }
  7192. if (options.highlight) {
  7193. highlighted = options.highlight(token.content, langName) || escapeHtml(token.content);
  7194. } else {
  7195. highlighted = escapeHtml(token.content);
  7196. }
  7197. if (highlighted.indexOf('<pre') === 0) {
  7198. return highlighted + '\n';
  7199. }
  7200. // If language exists, inject class gently, without mudofying original token.
  7201. // May be, one day we will add .clone() for token and simplify this part, but
  7202. // now we prefer to keep things local.
  7203. if (info) {
  7204. i = token.attrIndex('class');
  7205. tmpAttrs = token.attrs ? token.attrs.slice() : [];
  7206. if (i < 0) {
  7207. tmpAttrs.push([ 'class', options.langPrefix + langName ]);
  7208. } else {
  7209. tmpAttrs[i][1] += ' ' + options.langPrefix + langName;
  7210. }
  7211. // Fake token just to render attributes
  7212. tmpToken = {
  7213. attrs: tmpAttrs
  7214. };
  7215. return '<pre><code' + slf.renderAttrs(tmpToken) + '>'
  7216. + highlighted
  7217. + '</code></pre>\n';
  7218. }
  7219. return '<pre><code' + slf.renderAttrs(token) + '>'
  7220. + highlighted
  7221. + '</code></pre>\n';
  7222. };
  7223. default_rules.image = function (tokens, idx, options, env, slf) {
  7224. var token = tokens[idx];
  7225. // "alt" attr MUST be set, even if empty. Because it's mandatory and
  7226. // should be placed on proper position for tests.
  7227. //
  7228. // Replace content with actual value
  7229. token.attrs[token.attrIndex('alt')][1] =
  7230. slf.renderInlineAsText(token.children, options, env);
  7231. return slf.renderToken(tokens, idx, options);
  7232. };
  7233. default_rules.hardbreak = function (tokens, idx, options /*, env */) {
  7234. return options.xhtmlOut ? '<br />\n' : '<br>\n';
  7235. };
  7236. default_rules.softbreak = function (tokens, idx, options /*, env */) {
  7237. return options.breaks ? (options.xhtmlOut ? '<br />\n' : '<br>\n') : '\n';
  7238. };
  7239. default_rules.text = function (tokens, idx /*, options, env */) {
  7240. return escapeHtml(tokens[idx].content);
  7241. };
  7242. default_rules.html_block = function (tokens, idx /*, options, env */) {
  7243. return tokens[idx].content;
  7244. };
  7245. default_rules.html_inline = function (tokens, idx /*, options, env */) {
  7246. return tokens[idx].content;
  7247. };
  7248. /**
  7249. * new Renderer()
  7250. *
  7251. * Creates new [[Renderer]] instance and fill [[Renderer#rules]] with defaults.
  7252. **/
  7253. function Renderer() {
  7254. /**
  7255. * Renderer#rules -> Object
  7256. *
  7257. * Contains render rules for tokens. Can be updated and extended.
  7258. *
  7259. * ##### Example
  7260. *
  7261. * ```javascript
  7262. * var md = require('markdown-it')();
  7263. *
  7264. * md.renderer.rules.strong_open = function () { return '<b>'; };
  7265. * md.renderer.rules.strong_close = function () { return '</b>'; };
  7266. *
  7267. * var result = md.renderInline(...);
  7268. * ```
  7269. *
  7270. * Each rule is called as independed static function with fixed signature:
  7271. *
  7272. * ```javascript
  7273. * function my_token_render(tokens, idx, options, env, renderer) {
  7274. * // ...
  7275. * return renderedHTML;
  7276. * }
  7277. * ```
  7278. *
  7279. * See [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.js)
  7280. * for more details and examples.
  7281. **/
  7282. this.rules = assign({}, default_rules);
  7283. }
  7284. /**
  7285. * Renderer.renderAttrs(token) -> String
  7286. *
  7287. * Render token attributes to string.
  7288. **/
  7289. Renderer.prototype.renderAttrs = function renderAttrs(token) {
  7290. var i, l, result;
  7291. if (!token.attrs) { return ''; }
  7292. result = '';
  7293. for (i = 0, l = token.attrs.length; i < l; i++) {
  7294. result += ' ' + escapeHtml(token.attrs[i][0]) + '="' + escapeHtml(token.attrs[i][1]) + '"';
  7295. }
  7296. return result;
  7297. };
  7298. /**
  7299. * Renderer.renderToken(tokens, idx, options) -> String
  7300. * - tokens (Array): list of tokens
  7301. * - idx (Numbed): token index to render
  7302. * - options (Object): params of parser instance
  7303. *
  7304. * Default token renderer. Can be overriden by custom function
  7305. * in [[Renderer#rules]].
  7306. **/
  7307. Renderer.prototype.renderToken = function renderToken(tokens, idx, options) {
  7308. var nextToken,
  7309. result = '',
  7310. needLf = false,
  7311. token = tokens[idx];
  7312. // Tight list paragraphs
  7313. if (token.hidden) {
  7314. return '';
  7315. }
  7316. // Insert a newline between hidden paragraph and subsequent opening
  7317. // block-level tag.
  7318. //
  7319. // For example, here we should insert a newline before blockquote:
  7320. // - a
  7321. // >
  7322. //
  7323. if (token.block && token.nesting !== -1 && idx && tokens[idx - 1].hidden) {
  7324. result += '\n';
  7325. }
  7326. // Add token name, e.g. `<img`
  7327. result += (token.nesting === -1 ? '</' : '<') + token.tag;
  7328. // Encode attributes, e.g. `<img src="foo"`
  7329. result += this.renderAttrs(token);
  7330. // Add a slash for self-closing tags, e.g. `<img src="foo" /`
  7331. if (token.nesting === 0 && options.xhtmlOut) {
  7332. result += ' /';
  7333. }
  7334. // Check if we need to add a newline after this tag
  7335. if (token.block) {
  7336. needLf = true;
  7337. if (token.nesting === 1) {
  7338. if (idx + 1 < tokens.length) {
  7339. nextToken = tokens[idx + 1];
  7340. if (nextToken.type === 'inline' || nextToken.hidden) {
  7341. // Block-level tag containing an inline tag.
  7342. //
  7343. needLf = false;
  7344. } else if (nextToken.nesting === -1 && nextToken.tag === token.tag) {
  7345. // Opening tag + closing tag of the same type. E.g. `<li></li>`.
  7346. //
  7347. needLf = false;
  7348. }
  7349. }
  7350. }
  7351. }
  7352. result += needLf ? '>\n' : '>';
  7353. return result;
  7354. };
  7355. /**
  7356. * Renderer.renderInline(tokens, options, env) -> String
  7357. * - tokens (Array): list on block tokens to renter
  7358. * - options (Object): params of parser instance
  7359. * - env (Object): additional data from parsed input (references, for example)
  7360. *
  7361. * The same as [[Renderer.render]], but for single token of `inline` type.
  7362. **/
  7363. Renderer.prototype.renderInline = function (tokens, options, env) {
  7364. var type,
  7365. result = '',
  7366. rules = this.rules;
  7367. for (var i = 0, len = tokens.length; i < len; i++) {
  7368. type = tokens[i].type;
  7369. if (typeof rules[type] !== 'undefined') {
  7370. result += rules[type](tokens, i, options, env, this);
  7371. } else {
  7372. result += this.renderToken(tokens, i, options);
  7373. }
  7374. }
  7375. return result;
  7376. };
  7377. /** internal
  7378. * Renderer.renderInlineAsText(tokens, options, env) -> String
  7379. * - tokens (Array): list on block tokens to renter
  7380. * - options (Object): params of parser instance
  7381. * - env (Object): additional data from parsed input (references, for example)
  7382. *
  7383. * Special kludge for image `alt` attributes to conform CommonMark spec.
  7384. * Don't try to use it! Spec requires to show `alt` content with stripped markup,
  7385. * instead of simple escaping.
  7386. **/
  7387. Renderer.prototype.renderInlineAsText = function (tokens, options, env) {
  7388. var result = '';
  7389. for (var i = 0, len = tokens.length; i < len; i++) {
  7390. if (tokens[i].type === 'text') {
  7391. result += tokens[i].content;
  7392. } else if (tokens[i].type === 'image') {
  7393. result += this.renderInlineAsText(tokens[i].children, options, env);
  7394. }
  7395. }
  7396. return result;
  7397. };
  7398. /**
  7399. * Renderer.render(tokens, options, env) -> String
  7400. * - tokens (Array): list on block tokens to renter
  7401. * - options (Object): params of parser instance
  7402. * - env (Object): additional data from parsed input (references, for example)
  7403. *
  7404. * Takes token stream and generates HTML. Probably, you will never need to call
  7405. * this method directly.
  7406. **/
  7407. Renderer.prototype.render = function (tokens, options, env) {
  7408. var i, len, type,
  7409. result = '',
  7410. rules = this.rules;
  7411. for (i = 0, len = tokens.length; i < len; i++) {
  7412. type = tokens[i].type;
  7413. if (type === 'inline') {
  7414. result += this.renderInline(tokens[i].children, options, env);
  7415. } else if (typeof rules[type] !== 'undefined') {
  7416. result += rules[tokens[i].type](tokens, i, options, env, this);
  7417. } else {
  7418. result += this.renderToken(tokens, i, options, env);
  7419. }
  7420. }
  7421. return result;
  7422. };
  7423. module.exports = Renderer;
  7424. /***/ }),
  7425. /* 43 */
  7426. /***/ (function(module, exports, __webpack_require__) {
  7427. "use strict";
  7428. // Block quotes
  7429. var isSpace = __webpack_require__(0).isSpace;
  7430. module.exports = function blockquote(state, startLine, endLine, silent) {
  7431. var adjustTab,
  7432. ch,
  7433. i,
  7434. initial,
  7435. isOutdented,
  7436. l,
  7437. lastLineEmpty,
  7438. lines,
  7439. nextLine,
  7440. offset,
  7441. oldBMarks,
  7442. oldBSCount,
  7443. oldIndent,
  7444. oldParentType,
  7445. oldSCount,
  7446. oldTShift,
  7447. spaceAfterMarker,
  7448. terminate,
  7449. terminatorRules,
  7450. token,
  7451. oldLineMax = state.lineMax,
  7452. pos = state.bMarks[startLine] + state.tShift[startLine],
  7453. max = state.eMarks[startLine];
  7454. // if it's indented more than 3 spaces, it should be a code block
  7455. if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
  7456. // check the block quote marker
  7457. if (state.src.charCodeAt(pos++) !== 0x3E/* > */) { return false; }
  7458. // we know that it's going to be a valid blockquote,
  7459. // so no point trying to find the end of it in silent mode
  7460. if (silent) { return true; }
  7461. // skip spaces after ">" and re-calculate offset
  7462. initial = offset = state.sCount[startLine] + pos - (state.bMarks[startLine] + state.tShift[startLine]);
  7463. // skip one optional space after '>'
  7464. if (state.src.charCodeAt(pos) === 0x20 /* space */) {
  7465. // ' > test '
  7466. // ^ -- position start of line here:
  7467. pos++;
  7468. initial++;
  7469. offset++;
  7470. adjustTab = false;
  7471. spaceAfterMarker = true;
  7472. } else if (state.src.charCodeAt(pos) === 0x09 /* tab */) {
  7473. spaceAfterMarker = true;
  7474. if ((state.bsCount[startLine] + offset) % 4 === 3) {
  7475. // ' >\t test '
  7476. // ^ -- position start of line here (tab has width===1)
  7477. pos++;
  7478. initial++;
  7479. offset++;
  7480. adjustTab = false;
  7481. } else {
  7482. // ' >\t test '
  7483. // ^ -- position start of line here + shift bsCount slightly
  7484. // to make extra space appear
  7485. adjustTab = true;
  7486. }
  7487. } else {
  7488. spaceAfterMarker = false;
  7489. }
  7490. oldBMarks = [ state.bMarks[startLine] ];
  7491. state.bMarks[startLine] = pos;
  7492. while (pos < max) {
  7493. ch = state.src.charCodeAt(pos);
  7494. if (isSpace(ch)) {
  7495. if (ch === 0x09) {
  7496. offset += 4 - (offset + state.bsCount[startLine] + (adjustTab ? 1 : 0)) % 4;
  7497. } else {
  7498. offset++;
  7499. }
  7500. } else {
  7501. break;
  7502. }
  7503. pos++;
  7504. }
  7505. oldBSCount = [ state.bsCount[startLine] ];
  7506. state.bsCount[startLine] = state.sCount[startLine] + 1 + (spaceAfterMarker ? 1 : 0);
  7507. lastLineEmpty = pos >= max;
  7508. oldSCount = [ state.sCount[startLine] ];
  7509. state.sCount[startLine] = offset - initial;
  7510. oldTShift = [ state.tShift[startLine] ];
  7511. state.tShift[startLine] = pos - state.bMarks[startLine];
  7512. terminatorRules = state.md.block.ruler.getRules('blockquote');
  7513. oldParentType = state.parentType;
  7514. state.parentType = 'blockquote';
  7515. // Search the end of the block
  7516. //
  7517. // Block ends with either:
  7518. // 1. an empty line outside:
  7519. // ```
  7520. // > test
  7521. //
  7522. // ```
  7523. // 2. an empty line inside:
  7524. // ```
  7525. // >
  7526. // test
  7527. // ```
  7528. // 3. another tag:
  7529. // ```
  7530. // > test
  7531. // - - -
  7532. // ```
  7533. for (nextLine = startLine + 1; nextLine < endLine; nextLine++) {
  7534. // check if it's outdented, i.e. it's inside list item and indented
  7535. // less than said list item:
  7536. //
  7537. // ```
  7538. // 1. anything
  7539. // > current blockquote
  7540. // 2. checking this line
  7541. // ```
  7542. isOutdented = state.sCount[nextLine] < state.blkIndent;
  7543. pos = state.bMarks[nextLine] + state.tShift[nextLine];
  7544. max = state.eMarks[nextLine];
  7545. if (pos >= max) {
  7546. // Case 1: line is not inside the blockquote, and this line is empty.
  7547. break;
  7548. }
  7549. if (state.src.charCodeAt(pos++) === 0x3E/* > */ && !isOutdented) {
  7550. // This line is inside the blockquote.
  7551. // skip spaces after ">" and re-calculate offset
  7552. initial = offset = state.sCount[nextLine] + pos - (state.bMarks[nextLine] + state.tShift[nextLine]);
  7553. // skip one optional space after '>'
  7554. if (state.src.charCodeAt(pos) === 0x20 /* space */) {
  7555. // ' > test '
  7556. // ^ -- position start of line here:
  7557. pos++;
  7558. initial++;
  7559. offset++;
  7560. adjustTab = false;
  7561. spaceAfterMarker = true;
  7562. } else if (state.src.charCodeAt(pos) === 0x09 /* tab */) {
  7563. spaceAfterMarker = true;
  7564. if ((state.bsCount[nextLine] + offset) % 4 === 3) {
  7565. // ' >\t test '
  7566. // ^ -- position start of line here (tab has width===1)
  7567. pos++;
  7568. initial++;
  7569. offset++;
  7570. adjustTab = false;
  7571. } else {
  7572. // ' >\t test '
  7573. // ^ -- position start of line here + shift bsCount slightly
  7574. // to make extra space appear
  7575. adjustTab = true;
  7576. }
  7577. } else {
  7578. spaceAfterMarker = false;
  7579. }
  7580. oldBMarks.push(state.bMarks[nextLine]);
  7581. state.bMarks[nextLine] = pos;
  7582. while (pos < max) {
  7583. ch = state.src.charCodeAt(pos);
  7584. if (isSpace(ch)) {
  7585. if (ch === 0x09) {
  7586. offset += 4 - (offset + state.bsCount[nextLine] + (adjustTab ? 1 : 0)) % 4;
  7587. } else {
  7588. offset++;
  7589. }
  7590. } else {
  7591. break;
  7592. }
  7593. pos++;
  7594. }
  7595. lastLineEmpty = pos >= max;
  7596. oldBSCount.push(state.bsCount[nextLine]);
  7597. state.bsCount[nextLine] = state.sCount[nextLine] + 1 + (spaceAfterMarker ? 1 : 0);
  7598. oldSCount.push(state.sCount[nextLine]);
  7599. state.sCount[nextLine] = offset - initial;
  7600. oldTShift.push(state.tShift[nextLine]);
  7601. state.tShift[nextLine] = pos - state.bMarks[nextLine];
  7602. continue;
  7603. }
  7604. // Case 2: line is not inside the blockquote, and the last line was empty.
  7605. if (lastLineEmpty) { break; }
  7606. // Case 3: another tag found.
  7607. terminate = false;
  7608. for (i = 0, l = terminatorRules.length; i < l; i++) {
  7609. if (terminatorRules[i](state, nextLine, endLine, true)) {
  7610. terminate = true;
  7611. break;
  7612. }
  7613. }
  7614. if (terminate) {
  7615. // Quirk to enforce "hard termination mode" for paragraphs;
  7616. // normally if you call `tokenize(state, startLine, nextLine)`,
  7617. // paragraphs will look below nextLine for paragraph continuation,
  7618. // but if blockquote is terminated by another tag, they shouldn't
  7619. state.lineMax = nextLine;
  7620. if (state.blkIndent !== 0) {
  7621. // state.blkIndent was non-zero, we now set it to zero,
  7622. // so we need to re-calculate all offsets to appear as
  7623. // if indent wasn't changed
  7624. oldBMarks.push(state.bMarks[nextLine]);
  7625. oldBSCount.push(state.bsCount[nextLine]);
  7626. oldTShift.push(state.tShift[nextLine]);
  7627. oldSCount.push(state.sCount[nextLine]);
  7628. state.sCount[nextLine] -= state.blkIndent;
  7629. }
  7630. break;
  7631. }
  7632. if (isOutdented) break;
  7633. oldBMarks.push(state.bMarks[nextLine]);
  7634. oldBSCount.push(state.bsCount[nextLine]);
  7635. oldTShift.push(state.tShift[nextLine]);
  7636. oldSCount.push(state.sCount[nextLine]);
  7637. // A negative indentation means that this is a paragraph continuation
  7638. //
  7639. state.sCount[nextLine] = -1;
  7640. }
  7641. oldIndent = state.blkIndent;
  7642. state.blkIndent = 0;
  7643. token = state.push('blockquote_open', 'blockquote', 1);
  7644. token.markup = '>';
  7645. token.map = lines = [ startLine, 0 ];
  7646. state.md.block.tokenize(state, startLine, nextLine);
  7647. token = state.push('blockquote_close', 'blockquote', -1);
  7648. token.markup = '>';
  7649. state.lineMax = oldLineMax;
  7650. state.parentType = oldParentType;
  7651. lines[1] = state.line;
  7652. // Restore original tShift; this might not be necessary since the parser
  7653. // has already been here, but just to make sure we can do that.
  7654. for (i = 0; i < oldTShift.length; i++) {
  7655. state.bMarks[i + startLine] = oldBMarks[i];
  7656. state.tShift[i + startLine] = oldTShift[i];
  7657. state.sCount[i + startLine] = oldSCount[i];
  7658. state.bsCount[i + startLine] = oldBSCount[i];
  7659. }
  7660. state.blkIndent = oldIndent;
  7661. return true;
  7662. };
  7663. /***/ }),
  7664. /* 44 */
  7665. /***/ (function(module, exports, __webpack_require__) {
  7666. "use strict";
  7667. // Code block (4 spaces padded)
  7668. module.exports = function code(state, startLine, endLine/*, silent*/) {
  7669. var nextLine, last, token;
  7670. if (state.sCount[startLine] - state.blkIndent < 4) { return false; }
  7671. last = nextLine = startLine + 1;
  7672. while (nextLine < endLine) {
  7673. if (state.isEmpty(nextLine)) {
  7674. nextLine++;
  7675. continue;
  7676. }
  7677. if (state.sCount[nextLine] - state.blkIndent >= 4) {
  7678. nextLine++;
  7679. last = nextLine;
  7680. continue;
  7681. }
  7682. break;
  7683. }
  7684. state.line = last;
  7685. token = state.push('code_block', 'code', 0);
  7686. token.content = state.getLines(startLine, last, 4 + state.blkIndent, true);
  7687. token.map = [ startLine, state.line ];
  7688. return true;
  7689. };
  7690. /***/ }),
  7691. /* 45 */
  7692. /***/ (function(module, exports, __webpack_require__) {
  7693. "use strict";
  7694. // fences (``` lang, ~~~ lang)
  7695. module.exports = function fence(state, startLine, endLine, silent) {
  7696. var marker, len, params, nextLine, mem, token, markup,
  7697. haveEndMarker = false,
  7698. pos = state.bMarks[startLine] + state.tShift[startLine],
  7699. max = state.eMarks[startLine];
  7700. // if it's indented more than 3 spaces, it should be a code block
  7701. if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
  7702. if (pos + 3 > max) { return false; }
  7703. marker = state.src.charCodeAt(pos);
  7704. if (marker !== 0x7E/* ~ */ && marker !== 0x60 /* ` */) {
  7705. return false;
  7706. }
  7707. // scan marker length
  7708. mem = pos;
  7709. pos = state.skipChars(pos, marker);
  7710. len = pos - mem;
  7711. if (len < 3) { return false; }
  7712. markup = state.src.slice(mem, pos);
  7713. params = state.src.slice(pos, max);
  7714. if (params.indexOf(String.fromCharCode(marker)) >= 0) { return false; }
  7715. // Since start is found, we can report success here in validation mode
  7716. if (silent) { return true; }
  7717. // search end of block
  7718. nextLine = startLine;
  7719. for (;;) {
  7720. nextLine++;
  7721. if (nextLine >= endLine) {
  7722. // unclosed block should be autoclosed by end of document.
  7723. // also block seems to be autoclosed by end of parent
  7724. break;
  7725. }
  7726. pos = mem = state.bMarks[nextLine] + state.tShift[nextLine];
  7727. max = state.eMarks[nextLine];
  7728. if (pos < max && state.sCount[nextLine] < state.blkIndent) {
  7729. // non-empty line with negative indent should stop the list:
  7730. // - ```
  7731. // test
  7732. break;
  7733. }
  7734. if (state.src.charCodeAt(pos) !== marker) { continue; }
  7735. if (state.sCount[nextLine] - state.blkIndent >= 4) {
  7736. // closing fence should be indented less than 4 spaces
  7737. continue;
  7738. }
  7739. pos = state.skipChars(pos, marker);
  7740. // closing code fence must be at least as long as the opening one
  7741. if (pos - mem < len) { continue; }
  7742. // make sure tail has spaces only
  7743. pos = state.skipSpaces(pos);
  7744. if (pos < max) { continue; }
  7745. haveEndMarker = true;
  7746. // found!
  7747. break;
  7748. }
  7749. // If a fence has heading spaces, they should be removed from its inner block
  7750. len = state.sCount[startLine];
  7751. state.line = nextLine + (haveEndMarker ? 1 : 0);
  7752. token = state.push('fence', 'code', 0);
  7753. token.info = params;
  7754. token.content = state.getLines(startLine + 1, nextLine, len, true);
  7755. token.markup = markup;
  7756. token.map = [ startLine, state.line ];
  7757. return true;
  7758. };
  7759. /***/ }),
  7760. /* 46 */
  7761. /***/ (function(module, exports, __webpack_require__) {
  7762. "use strict";
  7763. // heading (#, ##, ...)
  7764. var isSpace = __webpack_require__(0).isSpace;
  7765. module.exports = function heading(state, startLine, endLine, silent) {
  7766. var ch, level, tmp, token,
  7767. pos = state.bMarks[startLine] + state.tShift[startLine],
  7768. max = state.eMarks[startLine];
  7769. // if it's indented more than 3 spaces, it should be a code block
  7770. if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
  7771. ch = state.src.charCodeAt(pos);
  7772. if (ch !== 0x23/* # */ || pos >= max) { return false; }
  7773. // count heading level
  7774. level = 1;
  7775. ch = state.src.charCodeAt(++pos);
  7776. while (ch === 0x23/* # */ && pos < max && level <= 6) {
  7777. level++;
  7778. ch = state.src.charCodeAt(++pos);
  7779. }
  7780. if (level > 6 || (pos < max && !isSpace(ch))) { return false; }
  7781. if (silent) { return true; }
  7782. // Let's cut tails like ' ### ' from the end of string
  7783. max = state.skipSpacesBack(max, pos);
  7784. tmp = state.skipCharsBack(max, 0x23, pos); // #
  7785. if (tmp > pos && isSpace(state.src.charCodeAt(tmp - 1))) {
  7786. max = tmp;
  7787. }
  7788. state.line = startLine + 1;
  7789. token = state.push('heading_open', 'h' + String(level), 1);
  7790. token.markup = '########'.slice(0, level);
  7791. token.map = [ startLine, state.line ];
  7792. token = state.push('inline', '', 0);
  7793. token.content = state.src.slice(pos, max).trim();
  7794. token.map = [ startLine, state.line ];
  7795. token.children = [];
  7796. token = state.push('heading_close', 'h' + String(level), -1);
  7797. token.markup = '########'.slice(0, level);
  7798. return true;
  7799. };
  7800. /***/ }),
  7801. /* 47 */
  7802. /***/ (function(module, exports, __webpack_require__) {
  7803. "use strict";
  7804. // Horizontal rule
  7805. var isSpace = __webpack_require__(0).isSpace;
  7806. module.exports = function hr(state, startLine, endLine, silent) {
  7807. var marker, cnt, ch, token,
  7808. pos = state.bMarks[startLine] + state.tShift[startLine],
  7809. max = state.eMarks[startLine];
  7810. // if it's indented more than 3 spaces, it should be a code block
  7811. if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
  7812. marker = state.src.charCodeAt(pos++);
  7813. // Check hr marker
  7814. if (marker !== 0x2A/* * */ &&
  7815. marker !== 0x2D/* - */ &&
  7816. marker !== 0x5F/* _ */) {
  7817. return false;
  7818. }
  7819. // markers can be mixed with spaces, but there should be at least 3 of them
  7820. cnt = 1;
  7821. while (pos < max) {
  7822. ch = state.src.charCodeAt(pos++);
  7823. if (ch !== marker && !isSpace(ch)) { return false; }
  7824. if (ch === marker) { cnt++; }
  7825. }
  7826. if (cnt < 3) { return false; }
  7827. if (silent) { return true; }
  7828. state.line = startLine + 1;
  7829. token = state.push('hr', 'hr', 0);
  7830. token.map = [ startLine, state.line ];
  7831. token.markup = Array(cnt + 1).join(String.fromCharCode(marker));
  7832. return true;
  7833. };
  7834. /***/ }),
  7835. /* 48 */
  7836. /***/ (function(module, exports, __webpack_require__) {
  7837. "use strict";
  7838. // HTML block
  7839. var block_names = __webpack_require__(30);
  7840. var HTML_OPEN_CLOSE_TAG_RE = __webpack_require__(12).HTML_OPEN_CLOSE_TAG_RE;
  7841. // An array of opening and corresponding closing sequences for html tags,
  7842. // last argument defines whether it can terminate a paragraph or not
  7843. //
  7844. var HTML_SEQUENCES = [
  7845. [ /^<(script|pre|style)(?=(\s|>|$))/i, /<\/(script|pre|style)>/i, true ],
  7846. [ /^<!--/, /-->/, true ],
  7847. [ /^<\?/, /\?>/, true ],
  7848. [ /^<![A-Z]/, />/, true ],
  7849. [ /^<!\[CDATA\[/, /\]\]>/, true ],
  7850. [ new RegExp('^</?(' + block_names.join('|') + ')(?=(\\s|/?>|$))', 'i'), /^$/, true ],
  7851. [ new RegExp(HTML_OPEN_CLOSE_TAG_RE.source + '\\s*$'), /^$/, false ]
  7852. ];
  7853. module.exports = function html_block(state, startLine, endLine, silent) {
  7854. var i, nextLine, token, lineText,
  7855. pos = state.bMarks[startLine] + state.tShift[startLine],
  7856. max = state.eMarks[startLine];
  7857. // if it's indented more than 3 spaces, it should be a code block
  7858. if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
  7859. if (!state.md.options.html) { return false; }
  7860. if (state.src.charCodeAt(pos) !== 0x3C/* < */) { return false; }
  7861. lineText = state.src.slice(pos, max);
  7862. for (i = 0; i < HTML_SEQUENCES.length; i++) {
  7863. if (HTML_SEQUENCES[i][0].test(lineText)) { break; }
  7864. }
  7865. if (i === HTML_SEQUENCES.length) { return false; }
  7866. if (silent) {
  7867. // true if this sequence can be a terminator, false otherwise
  7868. return HTML_SEQUENCES[i][2];
  7869. }
  7870. nextLine = startLine + 1;
  7871. // If we are here - we detected HTML block.
  7872. // Let's roll down till block end.
  7873. if (!HTML_SEQUENCES[i][1].test(lineText)) {
  7874. for (; nextLine < endLine; nextLine++) {
  7875. if (state.sCount[nextLine] < state.blkIndent) { break; }
  7876. pos = state.bMarks[nextLine] + state.tShift[nextLine];
  7877. max = state.eMarks[nextLine];
  7878. lineText = state.src.slice(pos, max);
  7879. if (HTML_SEQUENCES[i][1].test(lineText)) {
  7880. if (lineText.length !== 0) { nextLine++; }
  7881. break;
  7882. }
  7883. }
  7884. }
  7885. state.line = nextLine;
  7886. token = state.push('html_block', '', 0);
  7887. token.map = [ startLine, nextLine ];
  7888. token.content = state.getLines(startLine, nextLine, state.blkIndent, true);
  7889. return true;
  7890. };
  7891. /***/ }),
  7892. /* 49 */
  7893. /***/ (function(module, exports, __webpack_require__) {
  7894. "use strict";
  7895. // lheading (---, ===)
  7896. module.exports = function lheading(state, startLine, endLine/*, silent*/) {
  7897. var content, terminate, i, l, token, pos, max, level, marker,
  7898. nextLine = startLine + 1, oldParentType,
  7899. terminatorRules = state.md.block.ruler.getRules('paragraph');
  7900. // if it's indented more than 3 spaces, it should be a code block
  7901. if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
  7902. oldParentType = state.parentType;
  7903. state.parentType = 'paragraph'; // use paragraph to match terminatorRules
  7904. // jump line-by-line until empty one or EOF
  7905. for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) {
  7906. // this would be a code block normally, but after paragraph
  7907. // it's considered a lazy continuation regardless of what's there
  7908. if (state.sCount[nextLine] - state.blkIndent > 3) { continue; }
  7909. //
  7910. // Check for underline in setext header
  7911. //
  7912. if (state.sCount[nextLine] >= state.blkIndent) {
  7913. pos = state.bMarks[nextLine] + state.tShift[nextLine];
  7914. max = state.eMarks[nextLine];
  7915. if (pos < max) {
  7916. marker = state.src.charCodeAt(pos);
  7917. if (marker === 0x2D/* - */ || marker === 0x3D/* = */) {
  7918. pos = state.skipChars(pos, marker);
  7919. pos = state.skipSpaces(pos);
  7920. if (pos >= max) {
  7921. level = (marker === 0x3D/* = */ ? 1 : 2);
  7922. break;
  7923. }
  7924. }
  7925. }
  7926. }
  7927. // quirk for blockquotes, this line should already be checked by that rule
  7928. if (state.sCount[nextLine] < 0) { continue; }
  7929. // Some tags can terminate paragraph without empty line.
  7930. terminate = false;
  7931. for (i = 0, l = terminatorRules.length; i < l; i++) {
  7932. if (terminatorRules[i](state, nextLine, endLine, true)) {
  7933. terminate = true;
  7934. break;
  7935. }
  7936. }
  7937. if (terminate) { break; }
  7938. }
  7939. if (!level) {
  7940. // Didn't find valid underline
  7941. return false;
  7942. }
  7943. content = state.getLines(startLine, nextLine, state.blkIndent, false).trim();
  7944. state.line = nextLine + 1;
  7945. token = state.push('heading_open', 'h' + String(level), 1);
  7946. token.markup = String.fromCharCode(marker);
  7947. token.map = [ startLine, state.line ];
  7948. token = state.push('inline', '', 0);
  7949. token.content = content;
  7950. token.map = [ startLine, state.line - 1 ];
  7951. token.children = [];
  7952. token = state.push('heading_close', 'h' + String(level), -1);
  7953. token.markup = String.fromCharCode(marker);
  7954. state.parentType = oldParentType;
  7955. return true;
  7956. };
  7957. /***/ }),
  7958. /* 50 */
  7959. /***/ (function(module, exports, __webpack_require__) {
  7960. "use strict";
  7961. // Lists
  7962. var isSpace = __webpack_require__(0).isSpace;
  7963. // Search `[-+*][\n ]`, returns next pos arter marker on success
  7964. // or -1 on fail.
  7965. function skipBulletListMarker(state, startLine) {
  7966. var marker, pos, max, ch;
  7967. pos = state.bMarks[startLine] + state.tShift[startLine];
  7968. max = state.eMarks[startLine];
  7969. marker = state.src.charCodeAt(pos++);
  7970. // Check bullet
  7971. if (marker !== 0x2A/* * */ &&
  7972. marker !== 0x2D/* - */ &&
  7973. marker !== 0x2B/* + */) {
  7974. return -1;
  7975. }
  7976. if (pos < max) {
  7977. ch = state.src.charCodeAt(pos);
  7978. if (!isSpace(ch)) {
  7979. // " -test " - is not a list item
  7980. return -1;
  7981. }
  7982. }
  7983. return pos;
  7984. }
  7985. // Search `\d+[.)][\n ]`, returns next pos arter marker on success
  7986. // or -1 on fail.
  7987. function skipOrderedListMarker(state, startLine) {
  7988. var ch,
  7989. start = state.bMarks[startLine] + state.tShift[startLine],
  7990. pos = start,
  7991. max = state.eMarks[startLine];
  7992. // List marker should have at least 2 chars (digit + dot)
  7993. if (pos + 1 >= max) { return -1; }
  7994. ch = state.src.charCodeAt(pos++);
  7995. if (ch < 0x30/* 0 */ || ch > 0x39/* 9 */) { return -1; }
  7996. for (;;) {
  7997. // EOL -> fail
  7998. if (pos >= max) { return -1; }
  7999. ch = state.src.charCodeAt(pos++);
  8000. if (ch >= 0x30/* 0 */ && ch <= 0x39/* 9 */) {
  8001. // List marker should have no more than 9 digits
  8002. // (prevents integer overflow in browsers)
  8003. if (pos - start >= 10) { return -1; }
  8004. continue;
  8005. }
  8006. // found valid marker
  8007. if (ch === 0x29/* ) */ || ch === 0x2e/* . */) {
  8008. break;
  8009. }
  8010. return -1;
  8011. }
  8012. if (pos < max) {
  8013. ch = state.src.charCodeAt(pos);
  8014. if (!isSpace(ch)) {
  8015. // " 1.test " - is not a list item
  8016. return -1;
  8017. }
  8018. }
  8019. return pos;
  8020. }
  8021. function markTightParagraphs(state, idx) {
  8022. var i, l,
  8023. level = state.level + 2;
  8024. for (i = idx + 2, l = state.tokens.length - 2; i < l; i++) {
  8025. if (state.tokens[i].level === level && state.tokens[i].type === 'paragraph_open') {
  8026. state.tokens[i + 2].hidden = true;
  8027. state.tokens[i].hidden = true;
  8028. i += 2;
  8029. }
  8030. }
  8031. }
  8032. module.exports = function list(state, startLine, endLine, silent) {
  8033. var ch,
  8034. contentStart,
  8035. i,
  8036. indent,
  8037. indentAfterMarker,
  8038. initial,
  8039. isOrdered,
  8040. itemLines,
  8041. l,
  8042. listLines,
  8043. listTokIdx,
  8044. markerCharCode,
  8045. markerValue,
  8046. max,
  8047. nextLine,
  8048. offset,
  8049. oldIndent,
  8050. oldLIndent,
  8051. oldParentType,
  8052. oldTShift,
  8053. oldTight,
  8054. pos,
  8055. posAfterMarker,
  8056. prevEmptyEnd,
  8057. start,
  8058. terminate,
  8059. terminatorRules,
  8060. token,
  8061. isTerminatingParagraph = false,
  8062. tight = true;
  8063. // if it's indented more than 3 spaces, it should be a code block
  8064. if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
  8065. // limit conditions when list can interrupt
  8066. // a paragraph (validation mode only)
  8067. if (silent && state.parentType === 'paragraph') {
  8068. // Next list item should still terminate previous list item;
  8069. //
  8070. // This code can fail if plugins use blkIndent as well as lists,
  8071. // but I hope the spec gets fixed long before that happens.
  8072. //
  8073. if (state.tShift[startLine] >= state.blkIndent) {
  8074. isTerminatingParagraph = true;
  8075. }
  8076. }
  8077. // Detect list type and position after marker
  8078. if ((posAfterMarker = skipOrderedListMarker(state, startLine)) >= 0) {
  8079. isOrdered = true;
  8080. start = state.bMarks[startLine] + state.tShift[startLine];
  8081. markerValue = Number(state.src.substr(start, posAfterMarker - start - 1));
  8082. // If we're starting a new ordered list right after
  8083. // a paragraph, it should start with 1.
  8084. if (isTerminatingParagraph && markerValue !== 1) return false;
  8085. } else if ((posAfterMarker = skipBulletListMarker(state, startLine)) >= 0) {
  8086. isOrdered = false;
  8087. } else {
  8088. return false;
  8089. }
  8090. // If we're starting a new unordered list right after
  8091. // a paragraph, first line should not be empty.
  8092. if (isTerminatingParagraph) {
  8093. if (state.skipSpaces(posAfterMarker) >= state.eMarks[startLine]) return false;
  8094. }
  8095. // We should terminate list on style change. Remember first one to compare.
  8096. markerCharCode = state.src.charCodeAt(posAfterMarker - 1);
  8097. // For validation mode we can terminate immediately
  8098. if (silent) { return true; }
  8099. // Start list
  8100. listTokIdx = state.tokens.length;
  8101. if (isOrdered) {
  8102. token = state.push('ordered_list_open', 'ol', 1);
  8103. if (markerValue !== 1) {
  8104. token.attrs = [ [ 'start', markerValue ] ];
  8105. }
  8106. } else {
  8107. token = state.push('bullet_list_open', 'ul', 1);
  8108. }
  8109. token.map = listLines = [ startLine, 0 ];
  8110. token.markup = String.fromCharCode(markerCharCode);
  8111. //
  8112. // Iterate list items
  8113. //
  8114. nextLine = startLine;
  8115. prevEmptyEnd = false;
  8116. terminatorRules = state.md.block.ruler.getRules('list');
  8117. oldParentType = state.parentType;
  8118. state.parentType = 'list';
  8119. while (nextLine < endLine) {
  8120. pos = posAfterMarker;
  8121. max = state.eMarks[nextLine];
  8122. initial = offset = state.sCount[nextLine] + posAfterMarker - (state.bMarks[startLine] + state.tShift[startLine]);
  8123. while (pos < max) {
  8124. ch = state.src.charCodeAt(pos);
  8125. if (isSpace(ch)) {
  8126. if (ch === 0x09) {
  8127. offset += 4 - (offset + state.bsCount[nextLine]) % 4;
  8128. } else {
  8129. offset++;
  8130. }
  8131. } else {
  8132. break;
  8133. }
  8134. pos++;
  8135. }
  8136. contentStart = pos;
  8137. if (contentStart >= max) {
  8138. // trimming space in "- \n 3" case, indent is 1 here
  8139. indentAfterMarker = 1;
  8140. } else {
  8141. indentAfterMarker = offset - initial;
  8142. }
  8143. // If we have more than 4 spaces, the indent is 1
  8144. // (the rest is just indented code block)
  8145. if (indentAfterMarker > 4) { indentAfterMarker = 1; }
  8146. // " - test"
  8147. // ^^^^^ - calculating total length of this thing
  8148. indent = initial + indentAfterMarker;
  8149. // Run subparser & write tokens
  8150. token = state.push('list_item_open', 'li', 1);
  8151. token.markup = String.fromCharCode(markerCharCode);
  8152. token.map = itemLines = [ startLine, 0 ];
  8153. oldIndent = state.blkIndent;
  8154. oldTight = state.tight;
  8155. oldTShift = state.tShift[startLine];
  8156. oldLIndent = state.sCount[startLine];
  8157. state.blkIndent = indent;
  8158. state.tight = true;
  8159. state.tShift[startLine] = contentStart - state.bMarks[startLine];
  8160. state.sCount[startLine] = offset;
  8161. if (contentStart >= max && state.isEmpty(startLine + 1)) {
  8162. // workaround for this case
  8163. // (list item is empty, list terminates before "foo"):
  8164. // ~~~~~~~~
  8165. // -
  8166. //
  8167. // foo
  8168. // ~~~~~~~~
  8169. state.line = Math.min(state.line + 2, endLine);
  8170. } else {
  8171. state.md.block.tokenize(state, startLine, endLine, true);
  8172. }
  8173. // If any of list item is tight, mark list as tight
  8174. if (!state.tight || prevEmptyEnd) {
  8175. tight = false;
  8176. }
  8177. // Item become loose if finish with empty line,
  8178. // but we should filter last element, because it means list finish
  8179. prevEmptyEnd = (state.line - startLine) > 1 && state.isEmpty(state.line - 1);
  8180. state.blkIndent = oldIndent;
  8181. state.tShift[startLine] = oldTShift;
  8182. state.sCount[startLine] = oldLIndent;
  8183. state.tight = oldTight;
  8184. token = state.push('list_item_close', 'li', -1);
  8185. token.markup = String.fromCharCode(markerCharCode);
  8186. nextLine = startLine = state.line;
  8187. itemLines[1] = nextLine;
  8188. contentStart = state.bMarks[startLine];
  8189. if (nextLine >= endLine) { break; }
  8190. //
  8191. // Try to check if list is terminated or continued.
  8192. //
  8193. if (state.sCount[nextLine] < state.blkIndent) { break; }
  8194. // fail if terminating block found
  8195. terminate = false;
  8196. for (i = 0, l = terminatorRules.length; i < l; i++) {
  8197. if (terminatorRules[i](state, nextLine, endLine, true)) {
  8198. terminate = true;
  8199. break;
  8200. }
  8201. }
  8202. if (terminate) { break; }
  8203. // fail if list has another type
  8204. if (isOrdered) {
  8205. posAfterMarker = skipOrderedListMarker(state, nextLine);
  8206. if (posAfterMarker < 0) { break; }
  8207. } else {
  8208. posAfterMarker = skipBulletListMarker(state, nextLine);
  8209. if (posAfterMarker < 0) { break; }
  8210. }
  8211. if (markerCharCode !== state.src.charCodeAt(posAfterMarker - 1)) { break; }
  8212. }
  8213. // Finilize list
  8214. if (isOrdered) {
  8215. token = state.push('ordered_list_close', 'ol', -1);
  8216. } else {
  8217. token = state.push('bullet_list_close', 'ul', -1);
  8218. }
  8219. token.markup = String.fromCharCode(markerCharCode);
  8220. listLines[1] = nextLine;
  8221. state.line = nextLine;
  8222. state.parentType = oldParentType;
  8223. // mark paragraphs tight if needed
  8224. if (tight) {
  8225. markTightParagraphs(state, listTokIdx);
  8226. }
  8227. return true;
  8228. };
  8229. /***/ }),
  8230. /* 51 */
  8231. /***/ (function(module, exports, __webpack_require__) {
  8232. "use strict";
  8233. // Paragraph
  8234. module.exports = function paragraph(state, startLine/*, endLine*/) {
  8235. var content, terminate, i, l, token, oldParentType,
  8236. nextLine = startLine + 1,
  8237. terminatorRules = state.md.block.ruler.getRules('paragraph'),
  8238. endLine = state.lineMax;
  8239. oldParentType = state.parentType;
  8240. state.parentType = 'paragraph';
  8241. // jump line-by-line until empty one or EOF
  8242. for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) {
  8243. // this would be a code block normally, but after paragraph
  8244. // it's considered a lazy continuation regardless of what's there
  8245. if (state.sCount[nextLine] - state.blkIndent > 3) { continue; }
  8246. // quirk for blockquotes, this line should already be checked by that rule
  8247. if (state.sCount[nextLine] < 0) { continue; }
  8248. // Some tags can terminate paragraph without empty line.
  8249. terminate = false;
  8250. for (i = 0, l = terminatorRules.length; i < l; i++) {
  8251. if (terminatorRules[i](state, nextLine, endLine, true)) {
  8252. terminate = true;
  8253. break;
  8254. }
  8255. }
  8256. if (terminate) { break; }
  8257. }
  8258. content = state.getLines(startLine, nextLine, state.blkIndent, false).trim();
  8259. state.line = nextLine;
  8260. token = state.push('paragraph_open', 'p', 1);
  8261. token.map = [ startLine, state.line ];
  8262. token = state.push('inline', '', 0);
  8263. token.content = content;
  8264. token.map = [ startLine, state.line ];
  8265. token.children = [];
  8266. token = state.push('paragraph_close', 'p', -1);
  8267. state.parentType = oldParentType;
  8268. return true;
  8269. };
  8270. /***/ }),
  8271. /* 52 */
  8272. /***/ (function(module, exports, __webpack_require__) {
  8273. "use strict";
  8274. var normalizeReference = __webpack_require__(0).normalizeReference;
  8275. var isSpace = __webpack_require__(0).isSpace;
  8276. module.exports = function reference(state, startLine, _endLine, silent) {
  8277. var ch,
  8278. destEndPos,
  8279. destEndLineNo,
  8280. endLine,
  8281. href,
  8282. i,
  8283. l,
  8284. label,
  8285. labelEnd,
  8286. oldParentType,
  8287. res,
  8288. start,
  8289. str,
  8290. terminate,
  8291. terminatorRules,
  8292. title,
  8293. lines = 0,
  8294. pos = state.bMarks[startLine] + state.tShift[startLine],
  8295. max = state.eMarks[startLine],
  8296. nextLine = startLine + 1;
  8297. // if it's indented more than 3 spaces, it should be a code block
  8298. if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
  8299. if (state.src.charCodeAt(pos) !== 0x5B/* [ */) { return false; }
  8300. // Simple check to quickly interrupt scan on [link](url) at the start of line.
  8301. // Can be useful on practice: https://github.com/markdown-it/markdown-it/issues/54
  8302. while (++pos < max) {
  8303. if (state.src.charCodeAt(pos) === 0x5D /* ] */ &&
  8304. state.src.charCodeAt(pos - 1) !== 0x5C/* \ */) {
  8305. if (pos + 1 === max) { return false; }
  8306. if (state.src.charCodeAt(pos + 1) !== 0x3A/* : */) { return false; }
  8307. break;
  8308. }
  8309. }
  8310. endLine = state.lineMax;
  8311. // jump line-by-line until empty one or EOF
  8312. terminatorRules = state.md.block.ruler.getRules('reference');
  8313. oldParentType = state.parentType;
  8314. state.parentType = 'reference';
  8315. for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) {
  8316. // this would be a code block normally, but after paragraph
  8317. // it's considered a lazy continuation regardless of what's there
  8318. if (state.sCount[nextLine] - state.blkIndent > 3) { continue; }
  8319. // quirk for blockquotes, this line should already be checked by that rule
  8320. if (state.sCount[nextLine] < 0) { continue; }
  8321. // Some tags can terminate paragraph without empty line.
  8322. terminate = false;
  8323. for (i = 0, l = terminatorRules.length; i < l; i++) {
  8324. if (terminatorRules[i](state, nextLine, endLine, true)) {
  8325. terminate = true;
  8326. break;
  8327. }
  8328. }
  8329. if (terminate) { break; }
  8330. }
  8331. str = state.getLines(startLine, nextLine, state.blkIndent, false).trim();
  8332. max = str.length;
  8333. for (pos = 1; pos < max; pos++) {
  8334. ch = str.charCodeAt(pos);
  8335. if (ch === 0x5B /* [ */) {
  8336. return false;
  8337. } else if (ch === 0x5D /* ] */) {
  8338. labelEnd = pos;
  8339. break;
  8340. } else if (ch === 0x0A /* \n */) {
  8341. lines++;
  8342. } else if (ch === 0x5C /* \ */) {
  8343. pos++;
  8344. if (pos < max && str.charCodeAt(pos) === 0x0A) {
  8345. lines++;
  8346. }
  8347. }
  8348. }
  8349. if (labelEnd < 0 || str.charCodeAt(labelEnd + 1) !== 0x3A/* : */) { return false; }
  8350. // [label]: destination 'title'
  8351. // ^^^ skip optional whitespace here
  8352. for (pos = labelEnd + 2; pos < max; pos++) {
  8353. ch = str.charCodeAt(pos);
  8354. if (ch === 0x0A) {
  8355. lines++;
  8356. } else if (isSpace(ch)) {
  8357. /*eslint no-empty:0*/
  8358. } else {
  8359. break;
  8360. }
  8361. }
  8362. // [label]: destination 'title'
  8363. // ^^^^^^^^^^^ parse this
  8364. res = state.md.helpers.parseLinkDestination(str, pos, max);
  8365. if (!res.ok) { return false; }
  8366. href = state.md.normalizeLink(res.str);
  8367. if (!state.md.validateLink(href)) { return false; }
  8368. pos = res.pos;
  8369. lines += res.lines;
  8370. // save cursor state, we could require to rollback later
  8371. destEndPos = pos;
  8372. destEndLineNo = lines;
  8373. // [label]: destination 'title'
  8374. // ^^^ skipping those spaces
  8375. start = pos;
  8376. for (; pos < max; pos++) {
  8377. ch = str.charCodeAt(pos);
  8378. if (ch === 0x0A) {
  8379. lines++;
  8380. } else if (isSpace(ch)) {
  8381. /*eslint no-empty:0*/
  8382. } else {
  8383. break;
  8384. }
  8385. }
  8386. // [label]: destination 'title'
  8387. // ^^^^^^^ parse this
  8388. res = state.md.helpers.parseLinkTitle(str, pos, max);
  8389. if (pos < max && start !== pos && res.ok) {
  8390. title = res.str;
  8391. pos = res.pos;
  8392. lines += res.lines;
  8393. } else {
  8394. title = '';
  8395. pos = destEndPos;
  8396. lines = destEndLineNo;
  8397. }
  8398. // skip trailing spaces until the rest of the line
  8399. while (pos < max) {
  8400. ch = str.charCodeAt(pos);
  8401. if (!isSpace(ch)) { break; }
  8402. pos++;
  8403. }
  8404. if (pos < max && str.charCodeAt(pos) !== 0x0A) {
  8405. if (title) {
  8406. // garbage at the end of the line after title,
  8407. // but it could still be a valid reference if we roll back
  8408. title = '';
  8409. pos = destEndPos;
  8410. lines = destEndLineNo;
  8411. while (pos < max) {
  8412. ch = str.charCodeAt(pos);
  8413. if (!isSpace(ch)) { break; }
  8414. pos++;
  8415. }
  8416. }
  8417. }
  8418. if (pos < max && str.charCodeAt(pos) !== 0x0A) {
  8419. // garbage at the end of the line
  8420. return false;
  8421. }
  8422. label = normalizeReference(str.slice(1, labelEnd));
  8423. if (!label) {
  8424. // CommonMark 0.20 disallows empty labels
  8425. return false;
  8426. }
  8427. // Reference can not terminate anything. This check is for safety only.
  8428. /*istanbul ignore if*/
  8429. if (silent) { return true; }
  8430. if (typeof state.env.references === 'undefined') {
  8431. state.env.references = {};
  8432. }
  8433. if (typeof state.env.references[label] === 'undefined') {
  8434. state.env.references[label] = { title: title, href: href };
  8435. }
  8436. state.parentType = oldParentType;
  8437. state.line = startLine + lines + 1;
  8438. return true;
  8439. };
  8440. /***/ }),
  8441. /* 53 */
  8442. /***/ (function(module, exports, __webpack_require__) {
  8443. "use strict";
  8444. // Parser state class
  8445. var Token = __webpack_require__(4);
  8446. var isSpace = __webpack_require__(0).isSpace;
  8447. function StateBlock(src, md, env, tokens) {
  8448. var ch, s, start, pos, len, indent, offset, indent_found;
  8449. this.src = src;
  8450. // link to parser instance
  8451. this.md = md;
  8452. this.env = env;
  8453. //
  8454. // Internal state vartiables
  8455. //
  8456. this.tokens = tokens;
  8457. this.bMarks = []; // line begin offsets for fast jumps
  8458. this.eMarks = []; // line end offsets for fast jumps
  8459. this.tShift = []; // offsets of the first non-space characters (tabs not expanded)
  8460. this.sCount = []; // indents for each line (tabs expanded)
  8461. // An amount of virtual spaces (tabs expanded) between beginning
  8462. // of each line (bMarks) and real beginning of that line.
  8463. //
  8464. // It exists only as a hack because blockquotes override bMarks
  8465. // losing information in the process.
  8466. //
  8467. // It's used only when expanding tabs, you can think about it as
  8468. // an initial tab length, e.g. bsCount=21 applied to string `\t123`
  8469. // means first tab should be expanded to 4-21%4 === 3 spaces.
  8470. //
  8471. this.bsCount = [];
  8472. // block parser variables
  8473. this.blkIndent = 0; // required block content indent
  8474. // (for example, if we are in list)
  8475. this.line = 0; // line index in src
  8476. this.lineMax = 0; // lines count
  8477. this.tight = false; // loose/tight mode for lists
  8478. this.ddIndent = -1; // indent of the current dd block (-1 if there isn't any)
  8479. // can be 'blockquote', 'list', 'root', 'paragraph' or 'reference'
  8480. // used in lists to determine if they interrupt a paragraph
  8481. this.parentType = 'root';
  8482. this.level = 0;
  8483. // renderer
  8484. this.result = '';
  8485. // Create caches
  8486. // Generate markers.
  8487. s = this.src;
  8488. indent_found = false;
  8489. for (start = pos = indent = offset = 0, len = s.length; pos < len; pos++) {
  8490. ch = s.charCodeAt(pos);
  8491. if (!indent_found) {
  8492. if (isSpace(ch)) {
  8493. indent++;
  8494. if (ch === 0x09) {
  8495. offset += 4 - offset % 4;
  8496. } else {
  8497. offset++;
  8498. }
  8499. continue;
  8500. } else {
  8501. indent_found = true;
  8502. }
  8503. }
  8504. if (ch === 0x0A || pos === len - 1) {
  8505. if (ch !== 0x0A) { pos++; }
  8506. this.bMarks.push(start);
  8507. this.eMarks.push(pos);
  8508. this.tShift.push(indent);
  8509. this.sCount.push(offset);
  8510. this.bsCount.push(0);
  8511. indent_found = false;
  8512. indent = 0;
  8513. offset = 0;
  8514. start = pos + 1;
  8515. }
  8516. }
  8517. // Push fake entry to simplify cache bounds checks
  8518. this.bMarks.push(s.length);
  8519. this.eMarks.push(s.length);
  8520. this.tShift.push(0);
  8521. this.sCount.push(0);
  8522. this.bsCount.push(0);
  8523. this.lineMax = this.bMarks.length - 1; // don't count last fake line
  8524. }
  8525. // Push new token to "stream".
  8526. //
  8527. StateBlock.prototype.push = function (type, tag, nesting) {
  8528. var token = new Token(type, tag, nesting);
  8529. token.block = true;
  8530. if (nesting < 0) { this.level--; }
  8531. token.level = this.level;
  8532. if (nesting > 0) { this.level++; }
  8533. this.tokens.push(token);
  8534. return token;
  8535. };
  8536. StateBlock.prototype.isEmpty = function isEmpty(line) {
  8537. return this.bMarks[line] + this.tShift[line] >= this.eMarks[line];
  8538. };
  8539. StateBlock.prototype.skipEmptyLines = function skipEmptyLines(from) {
  8540. for (var max = this.lineMax; from < max; from++) {
  8541. if (this.bMarks[from] + this.tShift[from] < this.eMarks[from]) {
  8542. break;
  8543. }
  8544. }
  8545. return from;
  8546. };
  8547. // Skip spaces from given position.
  8548. StateBlock.prototype.skipSpaces = function skipSpaces(pos) {
  8549. var ch;
  8550. for (var max = this.src.length; pos < max; pos++) {
  8551. ch = this.src.charCodeAt(pos);
  8552. if (!isSpace(ch)) { break; }
  8553. }
  8554. return pos;
  8555. };
  8556. // Skip spaces from given position in reverse.
  8557. StateBlock.prototype.skipSpacesBack = function skipSpacesBack(pos, min) {
  8558. if (pos <= min) { return pos; }
  8559. while (pos > min) {
  8560. if (!isSpace(this.src.charCodeAt(--pos))) { return pos + 1; }
  8561. }
  8562. return pos;
  8563. };
  8564. // Skip char codes from given position
  8565. StateBlock.prototype.skipChars = function skipChars(pos, code) {
  8566. for (var max = this.src.length; pos < max; pos++) {
  8567. if (this.src.charCodeAt(pos) !== code) { break; }
  8568. }
  8569. return pos;
  8570. };
  8571. // Skip char codes reverse from given position - 1
  8572. StateBlock.prototype.skipCharsBack = function skipCharsBack(pos, code, min) {
  8573. if (pos <= min) { return pos; }
  8574. while (pos > min) {
  8575. if (code !== this.src.charCodeAt(--pos)) { return pos + 1; }
  8576. }
  8577. return pos;
  8578. };
  8579. // cut lines range from source.
  8580. StateBlock.prototype.getLines = function getLines(begin, end, indent, keepLastLF) {
  8581. var i, lineIndent, ch, first, last, queue, lineStart,
  8582. line = begin;
  8583. if (begin >= end) {
  8584. return '';
  8585. }
  8586. queue = new Array(end - begin);
  8587. for (i = 0; line < end; line++, i++) {
  8588. lineIndent = 0;
  8589. lineStart = first = this.bMarks[line];
  8590. if (line + 1 < end || keepLastLF) {
  8591. // No need for bounds check because we have fake entry on tail.
  8592. last = this.eMarks[line] + 1;
  8593. } else {
  8594. last = this.eMarks[line];
  8595. }
  8596. while (first < last && lineIndent < indent) {
  8597. ch = this.src.charCodeAt(first);
  8598. if (isSpace(ch)) {
  8599. if (ch === 0x09) {
  8600. lineIndent += 4 - (lineIndent + this.bsCount[line]) % 4;
  8601. } else {
  8602. lineIndent++;
  8603. }
  8604. } else if (first - lineStart < this.tShift[line]) {
  8605. // patched tShift masked characters to look like spaces (blockquotes, list markers)
  8606. lineIndent++;
  8607. } else {
  8608. break;
  8609. }
  8610. first++;
  8611. }
  8612. if (lineIndent > indent) {
  8613. // partially expanding tabs in code blocks, e.g '\t\tfoobar'
  8614. // with indent=2 becomes ' \tfoobar'
  8615. queue[i] = new Array(lineIndent - indent + 1).join(' ') + this.src.slice(first, last);
  8616. } else {
  8617. queue[i] = this.src.slice(first, last);
  8618. }
  8619. }
  8620. return queue.join('');
  8621. };
  8622. // re-export Token class to use in block rules
  8623. StateBlock.prototype.Token = Token;
  8624. module.exports = StateBlock;
  8625. /***/ }),
  8626. /* 54 */
  8627. /***/ (function(module, exports, __webpack_require__) {
  8628. "use strict";
  8629. // GFM table, non-standard
  8630. var isSpace = __webpack_require__(0).isSpace;
  8631. function getLine(state, line) {
  8632. var pos = state.bMarks[line] + state.blkIndent,
  8633. max = state.eMarks[line];
  8634. return state.src.substr(pos, max - pos);
  8635. }
  8636. function escapedSplit(str) {
  8637. var result = [],
  8638. pos = 0,
  8639. max = str.length,
  8640. ch,
  8641. escapes = 0,
  8642. lastPos = 0,
  8643. backTicked = false,
  8644. lastBackTick = 0;
  8645. ch = str.charCodeAt(pos);
  8646. while (pos < max) {
  8647. if (ch === 0x60/* ` */) {
  8648. if (backTicked) {
  8649. // make \` close code sequence, but not open it;
  8650. // the reason is: `\` is correct code block
  8651. backTicked = false;
  8652. lastBackTick = pos;
  8653. } else if (escapes % 2 === 0) {
  8654. backTicked = true;
  8655. lastBackTick = pos;
  8656. }
  8657. } else if (ch === 0x7c/* | */ && (escapes % 2 === 0) && !backTicked) {
  8658. result.push(str.substring(lastPos, pos));
  8659. lastPos = pos + 1;
  8660. }
  8661. if (ch === 0x5c/* \ */) {
  8662. escapes++;
  8663. } else {
  8664. escapes = 0;
  8665. }
  8666. pos++;
  8667. // If there was an un-closed backtick, go back to just after
  8668. // the last backtick, but as if it was a normal character
  8669. if (pos === max && backTicked) {
  8670. backTicked = false;
  8671. pos = lastBackTick + 1;
  8672. }
  8673. ch = str.charCodeAt(pos);
  8674. }
  8675. result.push(str.substring(lastPos));
  8676. return result;
  8677. }
  8678. module.exports = function table(state, startLine, endLine, silent) {
  8679. var ch, lineText, pos, i, nextLine, columns, columnCount, token,
  8680. aligns, t, tableLines, tbodyLines;
  8681. // should have at least two lines
  8682. if (startLine + 2 > endLine) { return false; }
  8683. nextLine = startLine + 1;
  8684. if (state.sCount[nextLine] < state.blkIndent) { return false; }
  8685. // if it's indented more than 3 spaces, it should be a code block
  8686. if (state.sCount[nextLine] - state.blkIndent >= 4) { return false; }
  8687. // first character of the second line should be '|', '-', ':',
  8688. // and no other characters are allowed but spaces;
  8689. // basically, this is the equivalent of /^[-:|][-:|\s]*$/ regexp
  8690. pos = state.bMarks[nextLine] + state.tShift[nextLine];
  8691. if (pos >= state.eMarks[nextLine]) { return false; }
  8692. ch = state.src.charCodeAt(pos++);
  8693. if (ch !== 0x7C/* | */ && ch !== 0x2D/* - */ && ch !== 0x3A/* : */) { return false; }
  8694. while (pos < state.eMarks[nextLine]) {
  8695. ch = state.src.charCodeAt(pos);
  8696. if (ch !== 0x7C/* | */ && ch !== 0x2D/* - */ && ch !== 0x3A/* : */ && !isSpace(ch)) { return false; }
  8697. pos++;
  8698. }
  8699. lineText = getLine(state, startLine + 1);
  8700. columns = lineText.split('|');
  8701. aligns = [];
  8702. for (i = 0; i < columns.length; i++) {
  8703. t = columns[i].trim();
  8704. if (!t) {
  8705. // allow empty columns before and after table, but not in between columns;
  8706. // e.g. allow ` |---| `, disallow ` ---||--- `
  8707. if (i === 0 || i === columns.length - 1) {
  8708. continue;
  8709. } else {
  8710. return false;
  8711. }
  8712. }
  8713. if (!/^:?-+:?$/.test(t)) { return false; }
  8714. if (t.charCodeAt(t.length - 1) === 0x3A/* : */) {
  8715. aligns.push(t.charCodeAt(0) === 0x3A/* : */ ? 'center' : 'right');
  8716. } else if (t.charCodeAt(0) === 0x3A/* : */) {
  8717. aligns.push('left');
  8718. } else {
  8719. aligns.push('');
  8720. }
  8721. }
  8722. lineText = getLine(state, startLine).trim();
  8723. if (lineText.indexOf('|') === -1) { return false; }
  8724. if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
  8725. columns = escapedSplit(lineText.replace(/^\||\|$/g, ''));
  8726. // header row will define an amount of columns in the entire table,
  8727. // and align row shouldn't be smaller than that (the rest of the rows can)
  8728. columnCount = columns.length;
  8729. if (columnCount > aligns.length) { return false; }
  8730. if (silent) { return true; }
  8731. token = state.push('table_open', 'table', 1);
  8732. token.map = tableLines = [ startLine, 0 ];
  8733. token = state.push('thead_open', 'thead', 1);
  8734. token.map = [ startLine, startLine + 1 ];
  8735. token = state.push('tr_open', 'tr', 1);
  8736. token.map = [ startLine, startLine + 1 ];
  8737. for (i = 0; i < columns.length; i++) {
  8738. token = state.push('th_open', 'th', 1);
  8739. token.map = [ startLine, startLine + 1 ];
  8740. if (aligns[i]) {
  8741. token.attrs = [ [ 'style', 'text-align:' + aligns[i] ] ];
  8742. }
  8743. token = state.push('inline', '', 0);
  8744. token.content = columns[i].trim();
  8745. token.map = [ startLine, startLine + 1 ];
  8746. token.children = [];
  8747. token = state.push('th_close', 'th', -1);
  8748. }
  8749. token = state.push('tr_close', 'tr', -1);
  8750. token = state.push('thead_close', 'thead', -1);
  8751. token = state.push('tbody_open', 'tbody', 1);
  8752. token.map = tbodyLines = [ startLine + 2, 0 ];
  8753. for (nextLine = startLine + 2; nextLine < endLine; nextLine++) {
  8754. if (state.sCount[nextLine] < state.blkIndent) { break; }
  8755. lineText = getLine(state, nextLine).trim();
  8756. if (lineText.indexOf('|') === -1) { break; }
  8757. if (state.sCount[nextLine] - state.blkIndent >= 4) { break; }
  8758. columns = escapedSplit(lineText.replace(/^\||\|$/g, ''));
  8759. token = state.push('tr_open', 'tr', 1);
  8760. for (i = 0; i < columnCount; i++) {
  8761. token = state.push('td_open', 'td', 1);
  8762. if (aligns[i]) {
  8763. token.attrs = [ [ 'style', 'text-align:' + aligns[i] ] ];
  8764. }
  8765. token = state.push('inline', '', 0);
  8766. token.content = columns[i] ? columns[i].trim() : '';
  8767. token.children = [];
  8768. token = state.push('td_close', 'td', -1);
  8769. }
  8770. token = state.push('tr_close', 'tr', -1);
  8771. }
  8772. token = state.push('tbody_close', 'tbody', -1);
  8773. token = state.push('table_close', 'table', -1);
  8774. tableLines[1] = tbodyLines[1] = nextLine;
  8775. state.line = nextLine;
  8776. return true;
  8777. };
  8778. /***/ }),
  8779. /* 55 */
  8780. /***/ (function(module, exports, __webpack_require__) {
  8781. "use strict";
  8782. module.exports = function block(state) {
  8783. var token;
  8784. if (state.inlineMode) {
  8785. token = new state.Token('inline', '', 0);
  8786. token.content = state.src;
  8787. token.map = [ 0, 1 ];
  8788. token.children = [];
  8789. state.tokens.push(token);
  8790. } else {
  8791. state.md.block.parse(state.src, state.md, state.env, state.tokens);
  8792. }
  8793. };
  8794. /***/ }),
  8795. /* 56 */
  8796. /***/ (function(module, exports, __webpack_require__) {
  8797. "use strict";
  8798. module.exports = function inline(state) {
  8799. var tokens = state.tokens, tok, i, l;
  8800. // Parse inlines
  8801. for (i = 0, l = tokens.length; i < l; i++) {
  8802. tok = tokens[i];
  8803. if (tok.type === 'inline') {
  8804. state.md.inline.parse(tok.content, state.md, state.env, tok.children);
  8805. }
  8806. }
  8807. };
  8808. /***/ }),
  8809. /* 57 */
  8810. /***/ (function(module, exports, __webpack_require__) {
  8811. "use strict";
  8812. // Replace link-like texts with link nodes.
  8813. //
  8814. // Currently restricted by `md.validateLink()` to http/https/ftp
  8815. //
  8816. var arrayReplaceAt = __webpack_require__(0).arrayReplaceAt;
  8817. function isLinkOpen(str) {
  8818. return /^<a[>\s]/i.test(str);
  8819. }
  8820. function isLinkClose(str) {
  8821. return /^<\/a\s*>/i.test(str);
  8822. }
  8823. module.exports = function linkify(state) {
  8824. var i, j, l, tokens, token, currentToken, nodes, ln, text, pos, lastPos,
  8825. level, htmlLinkLevel, url, fullUrl, urlText,
  8826. blockTokens = state.tokens,
  8827. links;
  8828. if (!state.md.options.linkify) { return; }
  8829. for (j = 0, l = blockTokens.length; j < l; j++) {
  8830. if (blockTokens[j].type !== 'inline' ||
  8831. !state.md.linkify.pretest(blockTokens[j].content)) {
  8832. continue;
  8833. }
  8834. tokens = blockTokens[j].children;
  8835. htmlLinkLevel = 0;
  8836. // We scan from the end, to keep position when new tags added.
  8837. // Use reversed logic in links start/end match
  8838. for (i = tokens.length - 1; i >= 0; i--) {
  8839. currentToken = tokens[i];
  8840. // Skip content of markdown links
  8841. if (currentToken.type === 'link_close') {
  8842. i--;
  8843. while (tokens[i].level !== currentToken.level && tokens[i].type !== 'link_open') {
  8844. i--;
  8845. }
  8846. continue;
  8847. }
  8848. // Skip content of html tag links
  8849. if (currentToken.type === 'html_inline') {
  8850. if (isLinkOpen(currentToken.content) && htmlLinkLevel > 0) {
  8851. htmlLinkLevel--;
  8852. }
  8853. if (isLinkClose(currentToken.content)) {
  8854. htmlLinkLevel++;
  8855. }
  8856. }
  8857. if (htmlLinkLevel > 0) { continue; }
  8858. if (currentToken.type === 'text' && state.md.linkify.test(currentToken.content)) {
  8859. text = currentToken.content;
  8860. links = state.md.linkify.match(text);
  8861. // Now split string to nodes
  8862. nodes = [];
  8863. level = currentToken.level;
  8864. lastPos = 0;
  8865. for (ln = 0; ln < links.length; ln++) {
  8866. url = links[ln].url;
  8867. fullUrl = state.md.normalizeLink(url);
  8868. if (!state.md.validateLink(fullUrl)) { continue; }
  8869. urlText = links[ln].text;
  8870. // Linkifier might send raw hostnames like "example.com", where url
  8871. // starts with domain name. So we prepend http:// in those cases,
  8872. // and remove it afterwards.
  8873. //
  8874. if (!links[ln].schema) {
  8875. urlText = state.md.normalizeLinkText('http://' + urlText).replace(/^http:\/\//, '');
  8876. } else if (links[ln].schema === 'mailto:' && !/^mailto:/i.test(urlText)) {
  8877. urlText = state.md.normalizeLinkText('mailto:' + urlText).replace(/^mailto:/, '');
  8878. } else {
  8879. urlText = state.md.normalizeLinkText(urlText);
  8880. }
  8881. pos = links[ln].index;
  8882. if (pos > lastPos) {
  8883. token = new state.Token('text', '', 0);
  8884. token.content = text.slice(lastPos, pos);
  8885. token.level = level;
  8886. nodes.push(token);
  8887. }
  8888. token = new state.Token('link_open', 'a', 1);
  8889. token.attrs = [ [ 'href', fullUrl ] ];
  8890. token.level = level++;
  8891. token.markup = 'linkify';
  8892. token.info = 'auto';
  8893. nodes.push(token);
  8894. token = new state.Token('text', '', 0);
  8895. token.content = urlText;
  8896. token.level = level;
  8897. nodes.push(token);
  8898. token = new state.Token('link_close', 'a', -1);
  8899. token.level = --level;
  8900. token.markup = 'linkify';
  8901. token.info = 'auto';
  8902. nodes.push(token);
  8903. lastPos = links[ln].lastIndex;
  8904. }
  8905. if (lastPos < text.length) {
  8906. token = new state.Token('text', '', 0);
  8907. token.content = text.slice(lastPos);
  8908. token.level = level;
  8909. nodes.push(token);
  8910. }
  8911. // replace current node
  8912. blockTokens[j].children = tokens = arrayReplaceAt(tokens, i, nodes);
  8913. }
  8914. }
  8915. }
  8916. };
  8917. /***/ }),
  8918. /* 58 */
  8919. /***/ (function(module, exports, __webpack_require__) {
  8920. "use strict";
  8921. // Normalize input string
  8922. var NEWLINES_RE = /\r[\n\u0085]?|[\u2424\u2028\u0085]/g;
  8923. var NULL_RE = /\u0000/g;
  8924. module.exports = function inline(state) {
  8925. var str;
  8926. // Normalize newlines
  8927. str = state.src.replace(NEWLINES_RE, '\n');
  8928. // Replace NULL characters
  8929. str = str.replace(NULL_RE, '\uFFFD');
  8930. state.src = str;
  8931. };
  8932. /***/ }),
  8933. /* 59 */
  8934. /***/ (function(module, exports, __webpack_require__) {
  8935. "use strict";
  8936. // Simple typographyc replacements
  8937. //
  8938. // (c) (C) → ©
  8939. // (tm) (TM) → ™
  8940. // (r) (R) → ®
  8941. // +- → ±
  8942. // (p) (P) -> §
  8943. // ... → … (also ?.... → ?.., !.... → !..)
  8944. // ???????? → ???, !!!!! → !!!, `,,` → `,`
  8945. // -- → &ndash;, --- → &mdash;
  8946. //
  8947. // TODO:
  8948. // - fractionals 1/2, 1/4, 3/4 -> ½, ¼, ¾
  8949. // - miltiplication 2 x 4 -> 2 × 4
  8950. var RARE_RE = /\+-|\.\.|\?\?\?\?|!!!!|,,|--/;
  8951. // Workaround for phantomjs - need regex without /g flag,
  8952. // or root check will fail every second time
  8953. var SCOPED_ABBR_TEST_RE = /\((c|tm|r|p)\)/i;
  8954. var SCOPED_ABBR_RE = /\((c|tm|r|p)\)/ig;
  8955. var SCOPED_ABBR = {
  8956. c: '©',
  8957. r: '®',
  8958. p: '§',
  8959. tm: '™'
  8960. };
  8961. function replaceFn(match, name) {
  8962. return SCOPED_ABBR[name.toLowerCase()];
  8963. }
  8964. function replace_scoped(inlineTokens) {
  8965. var i, token, inside_autolink = 0;
  8966. for (i = inlineTokens.length - 1; i >= 0; i--) {
  8967. token = inlineTokens[i];
  8968. if (token.type === 'text' && !inside_autolink) {
  8969. token.content = token.content.replace(SCOPED_ABBR_RE, replaceFn);
  8970. }
  8971. if (token.type === 'link_open' && token.info === 'auto') {
  8972. inside_autolink--;
  8973. }
  8974. if (token.type === 'link_close' && token.info === 'auto') {
  8975. inside_autolink++;
  8976. }
  8977. }
  8978. }
  8979. function replace_rare(inlineTokens) {
  8980. var i, token, inside_autolink = 0;
  8981. for (i = inlineTokens.length - 1; i >= 0; i--) {
  8982. token = inlineTokens[i];
  8983. if (token.type === 'text' && !inside_autolink) {
  8984. if (RARE_RE.test(token.content)) {
  8985. token.content = token.content
  8986. .replace(/\+-/g, '±')
  8987. // .., ..., ....... -> …
  8988. // but ?..... & !..... -> ?.. & !..
  8989. .replace(/\.{2,}/g, '…').replace(/([?!])…/g, '$1..')
  8990. .replace(/([?!]){4,}/g, '$1$1$1').replace(/,{2,}/g, ',')
  8991. // em-dash
  8992. .replace(/(^|[^-])---([^-]|$)/mg, '$1\u2014$2')
  8993. // en-dash
  8994. .replace(/(^|\s)--(\s|$)/mg, '$1\u2013$2')
  8995. .replace(/(^|[^-\s])--([^-\s]|$)/mg, '$1\u2013$2');
  8996. }
  8997. }
  8998. if (token.type === 'link_open' && token.info === 'auto') {
  8999. inside_autolink--;
  9000. }
  9001. if (token.type === 'link_close' && token.info === 'auto') {
  9002. inside_autolink++;
  9003. }
  9004. }
  9005. }
  9006. module.exports = function replace(state) {
  9007. var blkIdx;
  9008. if (!state.md.options.typographer) { return; }
  9009. for (blkIdx = state.tokens.length - 1; blkIdx >= 0; blkIdx--) {
  9010. if (state.tokens[blkIdx].type !== 'inline') { continue; }
  9011. if (SCOPED_ABBR_TEST_RE.test(state.tokens[blkIdx].content)) {
  9012. replace_scoped(state.tokens[blkIdx].children);
  9013. }
  9014. if (RARE_RE.test(state.tokens[blkIdx].content)) {
  9015. replace_rare(state.tokens[blkIdx].children);
  9016. }
  9017. }
  9018. };
  9019. /***/ }),
  9020. /* 60 */
  9021. /***/ (function(module, exports, __webpack_require__) {
  9022. "use strict";
  9023. // Convert straight quotation marks to typographic ones
  9024. //
  9025. var isWhiteSpace = __webpack_require__(0).isWhiteSpace;
  9026. var isPunctChar = __webpack_require__(0).isPunctChar;
  9027. var isMdAsciiPunct = __webpack_require__(0).isMdAsciiPunct;
  9028. var QUOTE_TEST_RE = /['"]/;
  9029. var QUOTE_RE = /['"]/g;
  9030. var APOSTROPHE = '\u2019'; /* ’ */
  9031. function replaceAt(str, index, ch) {
  9032. return str.substr(0, index) + ch + str.substr(index + 1);
  9033. }
  9034. function process_inlines(tokens, state) {
  9035. var i, token, text, t, pos, max, thisLevel, item, lastChar, nextChar,
  9036. isLastPunctChar, isNextPunctChar, isLastWhiteSpace, isNextWhiteSpace,
  9037. canOpen, canClose, j, isSingle, stack, openQuote, closeQuote;
  9038. stack = [];
  9039. for (i = 0; i < tokens.length; i++) {
  9040. token = tokens[i];
  9041. thisLevel = tokens[i].level;
  9042. for (j = stack.length - 1; j >= 0; j--) {
  9043. if (stack[j].level <= thisLevel) { break; }
  9044. }
  9045. stack.length = j + 1;
  9046. if (token.type !== 'text') { continue; }
  9047. text = token.content;
  9048. pos = 0;
  9049. max = text.length;
  9050. /*eslint no-labels:0,block-scoped-var:0*/
  9051. OUTER:
  9052. while (pos < max) {
  9053. QUOTE_RE.lastIndex = pos;
  9054. t = QUOTE_RE.exec(text);
  9055. if (!t) { break; }
  9056. canOpen = canClose = true;
  9057. pos = t.index + 1;
  9058. isSingle = (t[0] === "'");
  9059. // Find previous character,
  9060. // default to space if it's the beginning of the line
  9061. //
  9062. lastChar = 0x20;
  9063. if (t.index - 1 >= 0) {
  9064. lastChar = text.charCodeAt(t.index - 1);
  9065. } else {
  9066. for (j = i - 1; j >= 0; j--) {
  9067. if (tokens[j].type !== 'text') { continue; }
  9068. lastChar = tokens[j].content.charCodeAt(tokens[j].content.length - 1);
  9069. break;
  9070. }
  9071. }
  9072. // Find next character,
  9073. // default to space if it's the end of the line
  9074. //
  9075. nextChar = 0x20;
  9076. if (pos < max) {
  9077. nextChar = text.charCodeAt(pos);
  9078. } else {
  9079. for (j = i + 1; j < tokens.length; j++) {
  9080. if (tokens[j].type !== 'text') { continue; }
  9081. nextChar = tokens[j].content.charCodeAt(0);
  9082. break;
  9083. }
  9084. }
  9085. isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctChar(String.fromCharCode(lastChar));
  9086. isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctChar(String.fromCharCode(nextChar));
  9087. isLastWhiteSpace = isWhiteSpace(lastChar);
  9088. isNextWhiteSpace = isWhiteSpace(nextChar);
  9089. if (isNextWhiteSpace) {
  9090. canOpen = false;
  9091. } else if (isNextPunctChar) {
  9092. if (!(isLastWhiteSpace || isLastPunctChar)) {
  9093. canOpen = false;
  9094. }
  9095. }
  9096. if (isLastWhiteSpace) {
  9097. canClose = false;
  9098. } else if (isLastPunctChar) {
  9099. if (!(isNextWhiteSpace || isNextPunctChar)) {
  9100. canClose = false;
  9101. }
  9102. }
  9103. if (nextChar === 0x22 /* " */ && t[0] === '"') {
  9104. if (lastChar >= 0x30 /* 0 */ && lastChar <= 0x39 /* 9 */) {
  9105. // special case: 1"" - count first quote as an inch
  9106. canClose = canOpen = false;
  9107. }
  9108. }
  9109. if (canOpen && canClose) {
  9110. // treat this as the middle of the word
  9111. canOpen = false;
  9112. canClose = isNextPunctChar;
  9113. }
  9114. if (!canOpen && !canClose) {
  9115. // middle of word
  9116. if (isSingle) {
  9117. token.content = replaceAt(token.content, t.index, APOSTROPHE);
  9118. }
  9119. continue;
  9120. }
  9121. if (canClose) {
  9122. // this could be a closing quote, rewind the stack to get a match
  9123. for (j = stack.length - 1; j >= 0; j--) {
  9124. item = stack[j];
  9125. if (stack[j].level < thisLevel) { break; }
  9126. if (item.single === isSingle && stack[j].level === thisLevel) {
  9127. item = stack[j];
  9128. if (isSingle) {
  9129. openQuote = state.md.options.quotes[2];
  9130. closeQuote = state.md.options.quotes[3];
  9131. } else {
  9132. openQuote = state.md.options.quotes[0];
  9133. closeQuote = state.md.options.quotes[1];
  9134. }
  9135. // replace token.content *before* tokens[item.token].content,
  9136. // because, if they are pointing at the same token, replaceAt
  9137. // could mess up indices when quote length != 1
  9138. token.content = replaceAt(token.content, t.index, closeQuote);
  9139. tokens[item.token].content = replaceAt(
  9140. tokens[item.token].content, item.pos, openQuote);
  9141. pos += closeQuote.length - 1;
  9142. if (item.token === i) { pos += openQuote.length - 1; }
  9143. text = token.content;
  9144. max = text.length;
  9145. stack.length = j;
  9146. continue OUTER;
  9147. }
  9148. }
  9149. }
  9150. if (canOpen) {
  9151. stack.push({
  9152. token: i,
  9153. pos: t.index,
  9154. single: isSingle,
  9155. level: thisLevel
  9156. });
  9157. } else if (canClose && isSingle) {
  9158. token.content = replaceAt(token.content, t.index, APOSTROPHE);
  9159. }
  9160. }
  9161. }
  9162. }
  9163. module.exports = function smartquotes(state) {
  9164. /*eslint max-depth:0*/
  9165. var blkIdx;
  9166. if (!state.md.options.typographer) { return; }
  9167. for (blkIdx = state.tokens.length - 1; blkIdx >= 0; blkIdx--) {
  9168. if (state.tokens[blkIdx].type !== 'inline' ||
  9169. !QUOTE_TEST_RE.test(state.tokens[blkIdx].content)) {
  9170. continue;
  9171. }
  9172. process_inlines(state.tokens[blkIdx].children, state);
  9173. }
  9174. };
  9175. /***/ }),
  9176. /* 61 */
  9177. /***/ (function(module, exports, __webpack_require__) {
  9178. "use strict";
  9179. // Core state object
  9180. //
  9181. var Token = __webpack_require__(4);
  9182. function StateCore(src, md, env) {
  9183. this.src = src;
  9184. this.env = env;
  9185. this.tokens = [];
  9186. this.inlineMode = false;
  9187. this.md = md; // link to parser instance
  9188. }
  9189. // re-export Token class to use in core rules
  9190. StateCore.prototype.Token = Token;
  9191. module.exports = StateCore;
  9192. /***/ }),
  9193. /* 62 */
  9194. /***/ (function(module, exports, __webpack_require__) {
  9195. "use strict";
  9196. // Process autolinks '<protocol:...>'
  9197. /*eslint max-len:0*/
  9198. 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])?)*)>/;
  9199. var AUTOLINK_RE = /^<([a-zA-Z][a-zA-Z0-9+.\-]{1,31}):([^<>\x00-\x20]*)>/;
  9200. module.exports = function autolink(state, silent) {
  9201. var tail, linkMatch, emailMatch, url, fullUrl, token,
  9202. pos = state.pos;
  9203. if (state.src.charCodeAt(pos) !== 0x3C/* < */) { return false; }
  9204. tail = state.src.slice(pos);
  9205. if (tail.indexOf('>') < 0) { return false; }
  9206. if (AUTOLINK_RE.test(tail)) {
  9207. linkMatch = tail.match(AUTOLINK_RE);
  9208. url = linkMatch[0].slice(1, -1);
  9209. fullUrl = state.md.normalizeLink(url);
  9210. if (!state.md.validateLink(fullUrl)) { return false; }
  9211. if (!silent) {
  9212. token = state.push('link_open', 'a', 1);
  9213. token.attrs = [ [ 'href', fullUrl ] ];
  9214. token.markup = 'autolink';
  9215. token.info = 'auto';
  9216. token = state.push('text', '', 0);
  9217. token.content = state.md.normalizeLinkText(url);
  9218. token = state.push('link_close', 'a', -1);
  9219. token.markup = 'autolink';
  9220. token.info = 'auto';
  9221. }
  9222. state.pos += linkMatch[0].length;
  9223. return true;
  9224. }
  9225. if (EMAIL_RE.test(tail)) {
  9226. emailMatch = tail.match(EMAIL_RE);
  9227. url = emailMatch[0].slice(1, -1);
  9228. fullUrl = state.md.normalizeLink('mailto:' + url);
  9229. if (!state.md.validateLink(fullUrl)) { return false; }
  9230. if (!silent) {
  9231. token = state.push('link_open', 'a', 1);
  9232. token.attrs = [ [ 'href', fullUrl ] ];
  9233. token.markup = 'autolink';
  9234. token.info = 'auto';
  9235. token = state.push('text', '', 0);
  9236. token.content = state.md.normalizeLinkText(url);
  9237. token = state.push('link_close', 'a', -1);
  9238. token.markup = 'autolink';
  9239. token.info = 'auto';
  9240. }
  9241. state.pos += emailMatch[0].length;
  9242. return true;
  9243. }
  9244. return false;
  9245. };
  9246. /***/ }),
  9247. /* 63 */
  9248. /***/ (function(module, exports, __webpack_require__) {
  9249. "use strict";
  9250. // Parse backticks
  9251. module.exports = function backtick(state, silent) {
  9252. var start, max, marker, matchStart, matchEnd, token,
  9253. pos = state.pos,
  9254. ch = state.src.charCodeAt(pos);
  9255. if (ch !== 0x60/* ` */) { return false; }
  9256. start = pos;
  9257. pos++;
  9258. max = state.posMax;
  9259. while (pos < max && state.src.charCodeAt(pos) === 0x60/* ` */) { pos++; }
  9260. marker = state.src.slice(start, pos);
  9261. matchStart = matchEnd = pos;
  9262. while ((matchStart = state.src.indexOf('`', matchEnd)) !== -1) {
  9263. matchEnd = matchStart + 1;
  9264. while (matchEnd < max && state.src.charCodeAt(matchEnd) === 0x60/* ` */) { matchEnd++; }
  9265. if (matchEnd - matchStart === marker.length) {
  9266. if (!silent) {
  9267. token = state.push('code_inline', 'code', 0);
  9268. token.markup = marker;
  9269. token.content = state.src.slice(pos, matchStart)
  9270. .replace(/[ \n]+/g, ' ')
  9271. .trim();
  9272. }
  9273. state.pos = matchEnd;
  9274. return true;
  9275. }
  9276. }
  9277. if (!silent) { state.pending += marker; }
  9278. state.pos += marker.length;
  9279. return true;
  9280. };
  9281. /***/ }),
  9282. /* 64 */
  9283. /***/ (function(module, exports, __webpack_require__) {
  9284. "use strict";
  9285. // For each opening emphasis-like marker find a matching closing one
  9286. //
  9287. module.exports = function link_pairs(state) {
  9288. var i, j, lastDelim, currDelim,
  9289. delimiters = state.delimiters,
  9290. max = state.delimiters.length;
  9291. for (i = 0; i < max; i++) {
  9292. lastDelim = delimiters[i];
  9293. if (!lastDelim.close) { continue; }
  9294. j = i - lastDelim.jump - 1;
  9295. while (j >= 0) {
  9296. currDelim = delimiters[j];
  9297. if (currDelim.open &&
  9298. currDelim.marker === lastDelim.marker &&
  9299. currDelim.end < 0 &&
  9300. currDelim.level === lastDelim.level) {
  9301. // typeofs are for backward compatibility with plugins
  9302. var odd_match = (currDelim.close || lastDelim.open) &&
  9303. typeof currDelim.length !== 'undefined' &&
  9304. typeof lastDelim.length !== 'undefined' &&
  9305. (currDelim.length + lastDelim.length) % 3 === 0;
  9306. if (!odd_match) {
  9307. lastDelim.jump = i - j;
  9308. lastDelim.open = false;
  9309. currDelim.end = i;
  9310. currDelim.jump = 0;
  9311. break;
  9312. }
  9313. }
  9314. j -= currDelim.jump + 1;
  9315. }
  9316. }
  9317. };
  9318. /***/ }),
  9319. /* 65 */
  9320. /***/ (function(module, exports, __webpack_require__) {
  9321. "use strict";
  9322. // Process html entity - &#123;, &#xAF;, &quot;, ...
  9323. var entities = __webpack_require__(11);
  9324. var has = __webpack_require__(0).has;
  9325. var isValidEntityCode = __webpack_require__(0).isValidEntityCode;
  9326. var fromCodePoint = __webpack_require__(0).fromCodePoint;
  9327. var DIGITAL_RE = /^&#((?:x[a-f0-9]{1,8}|[0-9]{1,8}));/i;
  9328. var NAMED_RE = /^&([a-z][a-z0-9]{1,31});/i;
  9329. module.exports = function entity(state, silent) {
  9330. var ch, code, match, pos = state.pos, max = state.posMax;
  9331. if (state.src.charCodeAt(pos) !== 0x26/* & */) { return false; }
  9332. if (pos + 1 < max) {
  9333. ch = state.src.charCodeAt(pos + 1);
  9334. if (ch === 0x23 /* # */) {
  9335. match = state.src.slice(pos).match(DIGITAL_RE);
  9336. if (match) {
  9337. if (!silent) {
  9338. code = match[1][0].toLowerCase() === 'x' ? parseInt(match[1].slice(1), 16) : parseInt(match[1], 10);
  9339. state.pending += isValidEntityCode(code) ? fromCodePoint(code) : fromCodePoint(0xFFFD);
  9340. }
  9341. state.pos += match[0].length;
  9342. return true;
  9343. }
  9344. } else {
  9345. match = state.src.slice(pos).match(NAMED_RE);
  9346. if (match) {
  9347. if (has(entities, match[1])) {
  9348. if (!silent) { state.pending += entities[match[1]]; }
  9349. state.pos += match[0].length;
  9350. return true;
  9351. }
  9352. }
  9353. }
  9354. }
  9355. if (!silent) { state.pending += '&'; }
  9356. state.pos++;
  9357. return true;
  9358. };
  9359. /***/ }),
  9360. /* 66 */
  9361. /***/ (function(module, exports, __webpack_require__) {
  9362. "use strict";
  9363. // Proceess escaped chars and hardbreaks
  9364. var isSpace = __webpack_require__(0).isSpace;
  9365. var ESCAPED = [];
  9366. for (var i = 0; i < 256; i++) { ESCAPED.push(0); }
  9367. '\\!"#$%&\'()*+,./:;<=>?@[]^_`{|}~-'
  9368. .split('').forEach(function (ch) { ESCAPED[ch.charCodeAt(0)] = 1; });
  9369. module.exports = function escape(state, silent) {
  9370. var ch, pos = state.pos, max = state.posMax;
  9371. if (state.src.charCodeAt(pos) !== 0x5C/* \ */) { return false; }
  9372. pos++;
  9373. if (pos < max) {
  9374. ch = state.src.charCodeAt(pos);
  9375. if (ch < 256 && ESCAPED[ch] !== 0) {
  9376. if (!silent) { state.pending += state.src[pos]; }
  9377. state.pos += 2;
  9378. return true;
  9379. }
  9380. if (ch === 0x0A) {
  9381. if (!silent) {
  9382. state.push('hardbreak', 'br', 0);
  9383. }
  9384. pos++;
  9385. // skip leading whitespaces from next line
  9386. while (pos < max) {
  9387. ch = state.src.charCodeAt(pos);
  9388. if (!isSpace(ch)) { break; }
  9389. pos++;
  9390. }
  9391. state.pos = pos;
  9392. return true;
  9393. }
  9394. }
  9395. if (!silent) { state.pending += '\\'; }
  9396. state.pos++;
  9397. return true;
  9398. };
  9399. /***/ }),
  9400. /* 67 */
  9401. /***/ (function(module, exports, __webpack_require__) {
  9402. "use strict";
  9403. // Process html tags
  9404. var HTML_TAG_RE = __webpack_require__(12).HTML_TAG_RE;
  9405. function isLetter(ch) {
  9406. /*eslint no-bitwise:0*/
  9407. var lc = ch | 0x20; // to lower case
  9408. return (lc >= 0x61/* a */) && (lc <= 0x7a/* z */);
  9409. }
  9410. module.exports = function html_inline(state, silent) {
  9411. var ch, match, max, token,
  9412. pos = state.pos;
  9413. if (!state.md.options.html) { return false; }
  9414. // Check start
  9415. max = state.posMax;
  9416. if (state.src.charCodeAt(pos) !== 0x3C/* < */ ||
  9417. pos + 2 >= max) {
  9418. return false;
  9419. }
  9420. // Quick fail on second char
  9421. ch = state.src.charCodeAt(pos + 1);
  9422. if (ch !== 0x21/* ! */ &&
  9423. ch !== 0x3F/* ? */ &&
  9424. ch !== 0x2F/* / */ &&
  9425. !isLetter(ch)) {
  9426. return false;
  9427. }
  9428. match = state.src.slice(pos).match(HTML_TAG_RE);
  9429. if (!match) { return false; }
  9430. if (!silent) {
  9431. token = state.push('html_inline', '', 0);
  9432. token.content = state.src.slice(pos, pos + match[0].length);
  9433. }
  9434. state.pos += match[0].length;
  9435. return true;
  9436. };
  9437. /***/ }),
  9438. /* 68 */
  9439. /***/ (function(module, exports, __webpack_require__) {
  9440. "use strict";
  9441. // Process ![image](<src> "title")
  9442. var normalizeReference = __webpack_require__(0).normalizeReference;
  9443. var isSpace = __webpack_require__(0).isSpace;
  9444. module.exports = function image(state, silent) {
  9445. var attrs,
  9446. code,
  9447. content,
  9448. label,
  9449. labelEnd,
  9450. labelStart,
  9451. pos,
  9452. ref,
  9453. res,
  9454. title,
  9455. token,
  9456. tokens,
  9457. start,
  9458. href = '',
  9459. oldPos = state.pos,
  9460. max = state.posMax;
  9461. if (state.src.charCodeAt(state.pos) !== 0x21/* ! */) { return false; }
  9462. if (state.src.charCodeAt(state.pos + 1) !== 0x5B/* [ */) { return false; }
  9463. labelStart = state.pos + 2;
  9464. labelEnd = state.md.helpers.parseLinkLabel(state, state.pos + 1, false);
  9465. // parser failed to find ']', so it's not a valid link
  9466. if (labelEnd < 0) { return false; }
  9467. pos = labelEnd + 1;
  9468. if (pos < max && state.src.charCodeAt(pos) === 0x28/* ( */) {
  9469. //
  9470. // Inline link
  9471. //
  9472. // [link]( <href> "title" )
  9473. // ^^ skipping these spaces
  9474. pos++;
  9475. for (; pos < max; pos++) {
  9476. code = state.src.charCodeAt(pos);
  9477. if (!isSpace(code) && code !== 0x0A) { break; }
  9478. }
  9479. if (pos >= max) { return false; }
  9480. // [link]( <href> "title" )
  9481. // ^^^^^^ parsing link destination
  9482. start = pos;
  9483. res = state.md.helpers.parseLinkDestination(state.src, pos, state.posMax);
  9484. if (res.ok) {
  9485. href = state.md.normalizeLink(res.str);
  9486. if (state.md.validateLink(href)) {
  9487. pos = res.pos;
  9488. } else {
  9489. href = '';
  9490. }
  9491. }
  9492. // [link]( <href> "title" )
  9493. // ^^ skipping these spaces
  9494. start = pos;
  9495. for (; pos < max; pos++) {
  9496. code = state.src.charCodeAt(pos);
  9497. if (!isSpace(code) && code !== 0x0A) { break; }
  9498. }
  9499. // [link]( <href> "title" )
  9500. // ^^^^^^^ parsing link title
  9501. res = state.md.helpers.parseLinkTitle(state.src, pos, state.posMax);
  9502. if (pos < max && start !== pos && res.ok) {
  9503. title = res.str;
  9504. pos = res.pos;
  9505. // [link]( <href> "title" )
  9506. // ^^ skipping these spaces
  9507. for (; pos < max; pos++) {
  9508. code = state.src.charCodeAt(pos);
  9509. if (!isSpace(code) && code !== 0x0A) { break; }
  9510. }
  9511. } else {
  9512. title = '';
  9513. }
  9514. if (pos >= max || state.src.charCodeAt(pos) !== 0x29/* ) */) {
  9515. state.pos = oldPos;
  9516. return false;
  9517. }
  9518. pos++;
  9519. } else {
  9520. //
  9521. // Link reference
  9522. //
  9523. if (typeof state.env.references === 'undefined') { return false; }
  9524. if (pos < max && state.src.charCodeAt(pos) === 0x5B/* [ */) {
  9525. start = pos + 1;
  9526. pos = state.md.helpers.parseLinkLabel(state, pos);
  9527. if (pos >= 0) {
  9528. label = state.src.slice(start, pos++);
  9529. } else {
  9530. pos = labelEnd + 1;
  9531. }
  9532. } else {
  9533. pos = labelEnd + 1;
  9534. }
  9535. // covers label === '' and label === undefined
  9536. // (collapsed reference link and shortcut reference link respectively)
  9537. if (!label) { label = state.src.slice(labelStart, labelEnd); }
  9538. ref = state.env.references[normalizeReference(label)];
  9539. if (!ref) {
  9540. state.pos = oldPos;
  9541. return false;
  9542. }
  9543. href = ref.href;
  9544. title = ref.title;
  9545. }
  9546. //
  9547. // We found the end of the link, and know for a fact it's a valid link;
  9548. // so all that's left to do is to call tokenizer.
  9549. //
  9550. if (!silent) {
  9551. content = state.src.slice(labelStart, labelEnd);
  9552. state.md.inline.parse(
  9553. content,
  9554. state.md,
  9555. state.env,
  9556. tokens = []
  9557. );
  9558. token = state.push('image', 'img', 0);
  9559. token.attrs = attrs = [ [ 'src', href ], [ 'alt', '' ] ];
  9560. token.children = tokens;
  9561. token.content = content;
  9562. if (title) {
  9563. attrs.push([ 'title', title ]);
  9564. }
  9565. }
  9566. state.pos = pos;
  9567. state.posMax = max;
  9568. return true;
  9569. };
  9570. /***/ }),
  9571. /* 69 */
  9572. /***/ (function(module, exports, __webpack_require__) {
  9573. "use strict";
  9574. // Process [link](<to> "stuff")
  9575. var normalizeReference = __webpack_require__(0).normalizeReference;
  9576. var isSpace = __webpack_require__(0).isSpace;
  9577. module.exports = function link(state, silent) {
  9578. var attrs,
  9579. code,
  9580. label,
  9581. labelEnd,
  9582. labelStart,
  9583. pos,
  9584. res,
  9585. ref,
  9586. title,
  9587. token,
  9588. href = '',
  9589. oldPos = state.pos,
  9590. max = state.posMax,
  9591. start = state.pos,
  9592. parseReference = true;
  9593. if (state.src.charCodeAt(state.pos) !== 0x5B/* [ */) { return false; }
  9594. labelStart = state.pos + 1;
  9595. labelEnd = state.md.helpers.parseLinkLabel(state, state.pos, true);
  9596. // parser failed to find ']', so it's not a valid link
  9597. if (labelEnd < 0) { return false; }
  9598. pos = labelEnd + 1;
  9599. if (pos < max && state.src.charCodeAt(pos) === 0x28/* ( */) {
  9600. //
  9601. // Inline link
  9602. //
  9603. // might have found a valid shortcut link, disable reference parsing
  9604. parseReference = false;
  9605. // [link]( <href> "title" )
  9606. // ^^ skipping these spaces
  9607. pos++;
  9608. for (; pos < max; pos++) {
  9609. code = state.src.charCodeAt(pos);
  9610. if (!isSpace(code) && code !== 0x0A) { break; }
  9611. }
  9612. if (pos >= max) { return false; }
  9613. // [link]( <href> "title" )
  9614. // ^^^^^^ parsing link destination
  9615. start = pos;
  9616. res = state.md.helpers.parseLinkDestination(state.src, pos, state.posMax);
  9617. if (res.ok) {
  9618. href = state.md.normalizeLink(res.str);
  9619. if (state.md.validateLink(href)) {
  9620. pos = res.pos;
  9621. } else {
  9622. href = '';
  9623. }
  9624. }
  9625. // [link]( <href> "title" )
  9626. // ^^ skipping these spaces
  9627. start = pos;
  9628. for (; pos < max; pos++) {
  9629. code = state.src.charCodeAt(pos);
  9630. if (!isSpace(code) && code !== 0x0A) { break; }
  9631. }
  9632. // [link]( <href> "title" )
  9633. // ^^^^^^^ parsing link title
  9634. res = state.md.helpers.parseLinkTitle(state.src, pos, state.posMax);
  9635. if (pos < max && start !== pos && res.ok) {
  9636. title = res.str;
  9637. pos = res.pos;
  9638. // [link]( <href> "title" )
  9639. // ^^ skipping these spaces
  9640. for (; pos < max; pos++) {
  9641. code = state.src.charCodeAt(pos);
  9642. if (!isSpace(code) && code !== 0x0A) { break; }
  9643. }
  9644. } else {
  9645. title = '';
  9646. }
  9647. if (pos >= max || state.src.charCodeAt(pos) !== 0x29/* ) */) {
  9648. // parsing a valid shortcut link failed, fallback to reference
  9649. parseReference = true;
  9650. }
  9651. pos++;
  9652. }
  9653. if (parseReference) {
  9654. //
  9655. // Link reference
  9656. //
  9657. if (typeof state.env.references === 'undefined') { return false; }
  9658. if (pos < max && state.src.charCodeAt(pos) === 0x5B/* [ */) {
  9659. start = pos + 1;
  9660. pos = state.md.helpers.parseLinkLabel(state, pos);
  9661. if (pos >= 0) {
  9662. label = state.src.slice(start, pos++);
  9663. } else {
  9664. pos = labelEnd + 1;
  9665. }
  9666. } else {
  9667. pos = labelEnd + 1;
  9668. }
  9669. // covers label === '' and label === undefined
  9670. // (collapsed reference link and shortcut reference link respectively)
  9671. if (!label) { label = state.src.slice(labelStart, labelEnd); }
  9672. ref = state.env.references[normalizeReference(label)];
  9673. if (!ref) {
  9674. state.pos = oldPos;
  9675. return false;
  9676. }
  9677. href = ref.href;
  9678. title = ref.title;
  9679. }
  9680. //
  9681. // We found the end of the link, and know for a fact it's a valid link;
  9682. // so all that's left to do is to call tokenizer.
  9683. //
  9684. if (!silent) {
  9685. state.pos = labelStart;
  9686. state.posMax = labelEnd;
  9687. token = state.push('link_open', 'a', 1);
  9688. token.attrs = attrs = [ [ 'href', href ] ];
  9689. if (title) {
  9690. attrs.push([ 'title', title ]);
  9691. }
  9692. state.md.inline.tokenize(state);
  9693. token = state.push('link_close', 'a', -1);
  9694. }
  9695. state.pos = pos;
  9696. state.posMax = max;
  9697. return true;
  9698. };
  9699. /***/ }),
  9700. /* 70 */
  9701. /***/ (function(module, exports, __webpack_require__) {
  9702. "use strict";
  9703. // Proceess '\n'
  9704. var isSpace = __webpack_require__(0).isSpace;
  9705. module.exports = function newline(state, silent) {
  9706. var pmax, max, pos = state.pos;
  9707. if (state.src.charCodeAt(pos) !== 0x0A/* \n */) { return false; }
  9708. pmax = state.pending.length - 1;
  9709. max = state.posMax;
  9710. // ' \n' -> hardbreak
  9711. // Lookup in pending chars is bad practice! Don't copy to other rules!
  9712. // Pending string is stored in concat mode, indexed lookups will cause
  9713. // convertion to flat mode.
  9714. if (!silent) {
  9715. if (pmax >= 0 && state.pending.charCodeAt(pmax) === 0x20) {
  9716. if (pmax >= 1 && state.pending.charCodeAt(pmax - 1) === 0x20) {
  9717. state.pending = state.pending.replace(/ +$/, '');
  9718. state.push('hardbreak', 'br', 0);
  9719. } else {
  9720. state.pending = state.pending.slice(0, -1);
  9721. state.push('softbreak', 'br', 0);
  9722. }
  9723. } else {
  9724. state.push('softbreak', 'br', 0);
  9725. }
  9726. }
  9727. pos++;
  9728. // skip heading spaces for next line
  9729. while (pos < max && isSpace(state.src.charCodeAt(pos))) { pos++; }
  9730. state.pos = pos;
  9731. return true;
  9732. };
  9733. /***/ }),
  9734. /* 71 */
  9735. /***/ (function(module, exports, __webpack_require__) {
  9736. "use strict";
  9737. // Inline parser state
  9738. var Token = __webpack_require__(4);
  9739. var isWhiteSpace = __webpack_require__(0).isWhiteSpace;
  9740. var isPunctChar = __webpack_require__(0).isPunctChar;
  9741. var isMdAsciiPunct = __webpack_require__(0).isMdAsciiPunct;
  9742. function StateInline(src, md, env, outTokens) {
  9743. this.src = src;
  9744. this.env = env;
  9745. this.md = md;
  9746. this.tokens = outTokens;
  9747. this.pos = 0;
  9748. this.posMax = this.src.length;
  9749. this.level = 0;
  9750. this.pending = '';
  9751. this.pendingLevel = 0;
  9752. this.cache = {}; // Stores { start: end } pairs. Useful for backtrack
  9753. // optimization of pairs parse (emphasis, strikes).
  9754. this.delimiters = []; // Emphasis-like delimiters
  9755. }
  9756. // Flush pending text
  9757. //
  9758. StateInline.prototype.pushPending = function () {
  9759. var token = new Token('text', '', 0);
  9760. token.content = this.pending;
  9761. token.level = this.pendingLevel;
  9762. this.tokens.push(token);
  9763. this.pending = '';
  9764. return token;
  9765. };
  9766. // Push new token to "stream".
  9767. // If pending text exists - flush it as text token
  9768. //
  9769. StateInline.prototype.push = function (type, tag, nesting) {
  9770. if (this.pending) {
  9771. this.pushPending();
  9772. }
  9773. var token = new Token(type, tag, nesting);
  9774. if (nesting < 0) { this.level--; }
  9775. token.level = this.level;
  9776. if (nesting > 0) { this.level++; }
  9777. this.pendingLevel = this.level;
  9778. this.tokens.push(token);
  9779. return token;
  9780. };
  9781. // Scan a sequence of emphasis-like markers, and determine whether
  9782. // it can start an emphasis sequence or end an emphasis sequence.
  9783. //
  9784. // - start - position to scan from (it should point at a valid marker);
  9785. // - canSplitWord - determine if these markers can be found inside a word
  9786. //
  9787. StateInline.prototype.scanDelims = function (start, canSplitWord) {
  9788. var pos = start, lastChar, nextChar, count, can_open, can_close,
  9789. isLastWhiteSpace, isLastPunctChar,
  9790. isNextWhiteSpace, isNextPunctChar,
  9791. left_flanking = true,
  9792. right_flanking = true,
  9793. max = this.posMax,
  9794. marker = this.src.charCodeAt(start);
  9795. // treat beginning of the line as a whitespace
  9796. lastChar = start > 0 ? this.src.charCodeAt(start - 1) : 0x20;
  9797. while (pos < max && this.src.charCodeAt(pos) === marker) { pos++; }
  9798. count = pos - start;
  9799. // treat end of the line as a whitespace
  9800. nextChar = pos < max ? this.src.charCodeAt(pos) : 0x20;
  9801. isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctChar(String.fromCharCode(lastChar));
  9802. isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctChar(String.fromCharCode(nextChar));
  9803. isLastWhiteSpace = isWhiteSpace(lastChar);
  9804. isNextWhiteSpace = isWhiteSpace(nextChar);
  9805. if (isNextWhiteSpace) {
  9806. left_flanking = false;
  9807. } else if (isNextPunctChar) {
  9808. if (!(isLastWhiteSpace || isLastPunctChar)) {
  9809. left_flanking = false;
  9810. }
  9811. }
  9812. if (isLastWhiteSpace) {
  9813. right_flanking = false;
  9814. } else if (isLastPunctChar) {
  9815. if (!(isNextWhiteSpace || isNextPunctChar)) {
  9816. right_flanking = false;
  9817. }
  9818. }
  9819. if (!canSplitWord) {
  9820. can_open = left_flanking && (!right_flanking || isLastPunctChar);
  9821. can_close = right_flanking && (!left_flanking || isNextPunctChar);
  9822. } else {
  9823. can_open = left_flanking;
  9824. can_close = right_flanking;
  9825. }
  9826. return {
  9827. can_open: can_open,
  9828. can_close: can_close,
  9829. length: count
  9830. };
  9831. };
  9832. // re-export Token class to use in block rules
  9833. StateInline.prototype.Token = Token;
  9834. module.exports = StateInline;
  9835. /***/ }),
  9836. /* 72 */
  9837. /***/ (function(module, exports, __webpack_require__) {
  9838. "use strict";
  9839. // Skip text characters for text token, place those to pending buffer
  9840. // and increment current pos
  9841. // Rule to skip pure text
  9842. // '{}$%@~+=:' reserved for extentions
  9843. // !, ", #, $, %, &, ', (, ), *, +, ,, -, ., /, :, ;, <, =, >, ?, @, [, \, ], ^, _, `, {, |, }, or ~
  9844. // !!!! Don't confuse with "Markdown ASCII Punctuation" chars
  9845. // http://spec.commonmark.org/0.15/#ascii-punctuation-character
  9846. function isTerminatorChar(ch) {
  9847. switch (ch) {
  9848. case 0x0A/* \n */:
  9849. case 0x21/* ! */:
  9850. case 0x23/* # */:
  9851. case 0x24/* $ */:
  9852. case 0x25/* % */:
  9853. case 0x26/* & */:
  9854. case 0x2A/* * */:
  9855. case 0x2B/* + */:
  9856. case 0x2D/* - */:
  9857. case 0x3A/* : */:
  9858. case 0x3C/* < */:
  9859. case 0x3D/* = */:
  9860. case 0x3E/* > */:
  9861. case 0x40/* @ */:
  9862. case 0x5B/* [ */:
  9863. case 0x5C/* \ */:
  9864. case 0x5D/* ] */:
  9865. case 0x5E/* ^ */:
  9866. case 0x5F/* _ */:
  9867. case 0x60/* ` */:
  9868. case 0x7B/* { */:
  9869. case 0x7D/* } */:
  9870. case 0x7E/* ~ */:
  9871. return true;
  9872. default:
  9873. return false;
  9874. }
  9875. }
  9876. module.exports = function text(state, silent) {
  9877. var pos = state.pos;
  9878. while (pos < state.posMax && !isTerminatorChar(state.src.charCodeAt(pos))) {
  9879. pos++;
  9880. }
  9881. if (pos === state.pos) { return false; }
  9882. if (!silent) { state.pending += state.src.slice(state.pos, pos); }
  9883. state.pos = pos;
  9884. return true;
  9885. };
  9886. // Alternative implementation, for memory.
  9887. //
  9888. // It costs 10% of performance, but allows extend terminators list, if place it
  9889. // to `ParcerInline` property. Probably, will switch to it sometime, such
  9890. // flexibility required.
  9891. /*
  9892. var TERMINATOR_RE = /[\n!#$%&*+\-:<=>@[\\\]^_`{}~]/;
  9893. module.exports = function text(state, silent) {
  9894. var pos = state.pos,
  9895. idx = state.src.slice(pos).search(TERMINATOR_RE);
  9896. // first char is terminator -> empty text
  9897. if (idx === 0) { return false; }
  9898. // no terminator -> text till end of string
  9899. if (idx < 0) {
  9900. if (!silent) { state.pending += state.src.slice(pos); }
  9901. state.pos = state.src.length;
  9902. return true;
  9903. }
  9904. if (!silent) { state.pending += state.src.slice(pos, pos + idx); }
  9905. state.pos += idx;
  9906. return true;
  9907. };*/
  9908. /***/ }),
  9909. /* 73 */
  9910. /***/ (function(module, exports, __webpack_require__) {
  9911. "use strict";
  9912. // Merge adjacent text nodes into one, and re-calculate all token levels
  9913. //
  9914. module.exports = function text_collapse(state) {
  9915. var curr, last,
  9916. level = 0,
  9917. tokens = state.tokens,
  9918. max = state.tokens.length;
  9919. for (curr = last = 0; curr < max; curr++) {
  9920. // re-calculate levels
  9921. level += tokens[curr].nesting;
  9922. tokens[curr].level = level;
  9923. if (tokens[curr].type === 'text' &&
  9924. curr + 1 < max &&
  9925. tokens[curr + 1].type === 'text') {
  9926. // collapse two adjacent text nodes
  9927. tokens[curr + 1].content = tokens[curr].content + tokens[curr + 1].content;
  9928. } else {
  9929. if (curr !== last) { tokens[last] = tokens[curr]; }
  9930. last++;
  9931. }
  9932. }
  9933. if (curr !== last) {
  9934. tokens.length = last;
  9935. }
  9936. };
  9937. /***/ }),
  9938. /* 74 */
  9939. /***/ (function(module, exports, __webpack_require__) {
  9940. "use strict";
  9941. /* eslint-disable no-bitwise */
  9942. var decodeCache = {};
  9943. function getDecodeCache(exclude) {
  9944. var i, ch, cache = decodeCache[exclude];
  9945. if (cache) { return cache; }
  9946. cache = decodeCache[exclude] = [];
  9947. for (i = 0; i < 128; i++) {
  9948. ch = String.fromCharCode(i);
  9949. cache.push(ch);
  9950. }
  9951. for (i = 0; i < exclude.length; i++) {
  9952. ch = exclude.charCodeAt(i);
  9953. cache[ch] = '%' + ('0' + ch.toString(16).toUpperCase()).slice(-2);
  9954. }
  9955. return cache;
  9956. }
  9957. // Decode percent-encoded string.
  9958. //
  9959. function decode(string, exclude) {
  9960. var cache;
  9961. if (typeof exclude !== 'string') {
  9962. exclude = decode.defaultChars;
  9963. }
  9964. cache = getDecodeCache(exclude);
  9965. return string.replace(/(%[a-f0-9]{2})+/gi, function(seq) {
  9966. var i, l, b1, b2, b3, b4, chr,
  9967. result = '';
  9968. for (i = 0, l = seq.length; i < l; i += 3) {
  9969. b1 = parseInt(seq.slice(i + 1, i + 3), 16);
  9970. if (b1 < 0x80) {
  9971. result += cache[b1];
  9972. continue;
  9973. }
  9974. if ((b1 & 0xE0) === 0xC0 && (i + 3 < l)) {
  9975. // 110xxxxx 10xxxxxx
  9976. b2 = parseInt(seq.slice(i + 4, i + 6), 16);
  9977. if ((b2 & 0xC0) === 0x80) {
  9978. chr = ((b1 << 6) & 0x7C0) | (b2 & 0x3F);
  9979. if (chr < 0x80) {
  9980. result += '\ufffd\ufffd';
  9981. } else {
  9982. result += String.fromCharCode(chr);
  9983. }
  9984. i += 3;
  9985. continue;
  9986. }
  9987. }
  9988. if ((b1 & 0xF0) === 0xE0 && (i + 6 < l)) {
  9989. // 1110xxxx 10xxxxxx 10xxxxxx
  9990. b2 = parseInt(seq.slice(i + 4, i + 6), 16);
  9991. b3 = parseInt(seq.slice(i + 7, i + 9), 16);
  9992. if ((b2 & 0xC0) === 0x80 && (b3 & 0xC0) === 0x80) {
  9993. chr = ((b1 << 12) & 0xF000) | ((b2 << 6) & 0xFC0) | (b3 & 0x3F);
  9994. if (chr < 0x800 || (chr >= 0xD800 && chr <= 0xDFFF)) {
  9995. result += '\ufffd\ufffd\ufffd';
  9996. } else {
  9997. result += String.fromCharCode(chr);
  9998. }
  9999. i += 6;
  10000. continue;
  10001. }
  10002. }
  10003. if ((b1 & 0xF8) === 0xF0 && (i + 9 < l)) {
  10004. // 111110xx 10xxxxxx 10xxxxxx 10xxxxxx
  10005. b2 = parseInt(seq.slice(i + 4, i + 6), 16);
  10006. b3 = parseInt(seq.slice(i + 7, i + 9), 16);
  10007. b4 = parseInt(seq.slice(i + 10, i + 12), 16);
  10008. if ((b2 & 0xC0) === 0x80 && (b3 & 0xC0) === 0x80 && (b4 & 0xC0) === 0x80) {
  10009. chr = ((b1 << 18) & 0x1C0000) | ((b2 << 12) & 0x3F000) | ((b3 << 6) & 0xFC0) | (b4 & 0x3F);
  10010. if (chr < 0x10000 || chr > 0x10FFFF) {
  10011. result += '\ufffd\ufffd\ufffd\ufffd';
  10012. } else {
  10013. chr -= 0x10000;
  10014. result += String.fromCharCode(0xD800 + (chr >> 10), 0xDC00 + (chr & 0x3FF));
  10015. }
  10016. i += 9;
  10017. continue;
  10018. }
  10019. }
  10020. result += '\ufffd';
  10021. }
  10022. return result;
  10023. });
  10024. }
  10025. decode.defaultChars = ';/?:@&=+$,#';
  10026. decode.componentChars = '';
  10027. module.exports = decode;
  10028. /***/ }),
  10029. /* 75 */
  10030. /***/ (function(module, exports, __webpack_require__) {
  10031. "use strict";
  10032. var encodeCache = {};
  10033. // Create a lookup array where anything but characters in `chars` string
  10034. // and alphanumeric chars is percent-encoded.
  10035. //
  10036. function getEncodeCache(exclude) {
  10037. var i, ch, cache = encodeCache[exclude];
  10038. if (cache) { return cache; }
  10039. cache = encodeCache[exclude] = [];
  10040. for (i = 0; i < 128; i++) {
  10041. ch = String.fromCharCode(i);
  10042. if (/^[0-9a-z]$/i.test(ch)) {
  10043. // always allow unencoded alphanumeric characters
  10044. cache.push(ch);
  10045. } else {
  10046. cache.push('%' + ('0' + i.toString(16).toUpperCase()).slice(-2));
  10047. }
  10048. }
  10049. for (i = 0; i < exclude.length; i++) {
  10050. cache[exclude.charCodeAt(i)] = exclude[i];
  10051. }
  10052. return cache;
  10053. }
  10054. // Encode unsafe characters with percent-encoding, skipping already
  10055. // encoded sequences.
  10056. //
  10057. // - string - string to encode
  10058. // - exclude - list of characters to ignore (in addition to a-zA-Z0-9)
  10059. // - keepEscaped - don't encode '%' in a correct escape sequence (default: true)
  10060. //
  10061. function encode(string, exclude, keepEscaped) {
  10062. var i, l, code, nextCode, cache,
  10063. result = '';
  10064. if (typeof exclude !== 'string') {
  10065. // encode(string, keepEscaped)
  10066. keepEscaped = exclude;
  10067. exclude = encode.defaultChars;
  10068. }
  10069. if (typeof keepEscaped === 'undefined') {
  10070. keepEscaped = true;
  10071. }
  10072. cache = getEncodeCache(exclude);
  10073. for (i = 0, l = string.length; i < l; i++) {
  10074. code = string.charCodeAt(i);
  10075. if (keepEscaped && code === 0x25 /* % */ && i + 2 < l) {
  10076. if (/^[0-9a-f]{2}$/i.test(string.slice(i + 1, i + 3))) {
  10077. result += string.slice(i, i + 3);
  10078. i += 2;
  10079. continue;
  10080. }
  10081. }
  10082. if (code < 128) {
  10083. result += cache[code];
  10084. continue;
  10085. }
  10086. if (code >= 0xD800 && code <= 0xDFFF) {
  10087. if (code >= 0xD800 && code <= 0xDBFF && i + 1 < l) {
  10088. nextCode = string.charCodeAt(i + 1);
  10089. if (nextCode >= 0xDC00 && nextCode <= 0xDFFF) {
  10090. result += encodeURIComponent(string[i] + string[i + 1]);
  10091. i++;
  10092. continue;
  10093. }
  10094. }
  10095. result += '%EF%BF%BD';
  10096. continue;
  10097. }
  10098. result += encodeURIComponent(string[i]);
  10099. }
  10100. return result;
  10101. }
  10102. encode.defaultChars = ";/?:@&=+$,-_.!~*'()#";
  10103. encode.componentChars = "-_.!~*'()";
  10104. module.exports = encode;
  10105. /***/ }),
  10106. /* 76 */
  10107. /***/ (function(module, exports, __webpack_require__) {
  10108. "use strict";
  10109. module.exports = function format(url) {
  10110. var result = '';
  10111. result += url.protocol || '';
  10112. result += url.slashes ? '//' : '';
  10113. result += url.auth ? url.auth + '@' : '';
  10114. if (url.hostname && url.hostname.indexOf(':') !== -1) {
  10115. // ipv6 address
  10116. result += '[' + url.hostname + ']';
  10117. } else {
  10118. result += url.hostname || '';
  10119. }
  10120. result += url.port ? ':' + url.port : '';
  10121. result += url.pathname || '';
  10122. result += url.search || '';
  10123. result += url.hash || '';
  10124. return result;
  10125. };
  10126. /***/ }),
  10127. /* 77 */
  10128. /***/ (function(module, exports, __webpack_require__) {
  10129. "use strict";
  10130. // Copyright Joyent, Inc. and other Node contributors.
  10131. //
  10132. // Permission is hereby granted, free of charge, to any person obtaining a
  10133. // copy of this software and associated documentation files (the
  10134. // "Software"), to deal in the Software without restriction, including
  10135. // without limitation the rights to use, copy, modify, merge, publish,
  10136. // distribute, sublicense, and/or sell copies of the Software, and to permit
  10137. // persons to whom the Software is furnished to do so, subject to the
  10138. // following conditions:
  10139. //
  10140. // The above copyright notice and this permission notice shall be included
  10141. // in all copies or substantial portions of the Software.
  10142. //
  10143. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  10144. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  10145. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  10146. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  10147. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  10148. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  10149. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  10150. //
  10151. // Changes from joyent/node:
  10152. //
  10153. // 1. No leading slash in paths,
  10154. // e.g. in `url.parse('http://foo?bar')` pathname is ``, not `/`
  10155. //
  10156. // 2. Backslashes are not replaced with slashes,
  10157. // so `http:\\example.org\` is treated like a relative path
  10158. //
  10159. // 3. Trailing colon is treated like a part of the path,
  10160. // i.e. in `http://example.org:foo` pathname is `:foo`
  10161. //
  10162. // 4. Nothing is URL-encoded in the resulting object,
  10163. // (in joyent/node some chars in auth and paths are encoded)
  10164. //
  10165. // 5. `url.parse()` does not have `parseQueryString` argument
  10166. //
  10167. // 6. Removed extraneous result properties: `host`, `path`, `query`, etc.,
  10168. // which can be constructed using other parts of the url.
  10169. //
  10170. function Url() {
  10171. this.protocol = null;
  10172. this.slashes = null;
  10173. this.auth = null;
  10174. this.port = null;
  10175. this.hostname = null;
  10176. this.hash = null;
  10177. this.search = null;
  10178. this.pathname = null;
  10179. }
  10180. // Reference: RFC 3986, RFC 1808, RFC 2396
  10181. // define these here so at least they only have to be
  10182. // compiled once on the first module load.
  10183. var protocolPattern = /^([a-z0-9.+-]+:)/i,
  10184. portPattern = /:[0-9]*$/,
  10185. // Special case for a simple path URL
  10186. simplePathPattern = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,
  10187. // RFC 2396: characters reserved for delimiting URLs.
  10188. // We actually just auto-escape these.
  10189. delims = [ '<', '>', '"', '`', ' ', '\r', '\n', '\t' ],
  10190. // RFC 2396: characters not allowed for various reasons.
  10191. unwise = [ '{', '}', '|', '\\', '^', '`' ].concat(delims),
  10192. // Allowed by RFCs, but cause of XSS attacks. Always escape these.
  10193. autoEscape = [ '\'' ].concat(unwise),
  10194. // Characters that are never ever allowed in a hostname.
  10195. // Note that any invalid chars are also handled, but these
  10196. // are the ones that are *expected* to be seen, so we fast-path
  10197. // them.
  10198. nonHostChars = [ '%', '/', '?', ';', '#' ].concat(autoEscape),
  10199. hostEndingChars = [ '/', '?', '#' ],
  10200. hostnameMaxLen = 255,
  10201. hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/,
  10202. hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/,
  10203. // protocols that can allow "unsafe" and "unwise" chars.
  10204. /* eslint-disable no-script-url */
  10205. // protocols that never have a hostname.
  10206. hostlessProtocol = {
  10207. 'javascript': true,
  10208. 'javascript:': true
  10209. },
  10210. // protocols that always contain a // bit.
  10211. slashedProtocol = {
  10212. 'http': true,
  10213. 'https': true,
  10214. 'ftp': true,
  10215. 'gopher': true,
  10216. 'file': true,
  10217. 'http:': true,
  10218. 'https:': true,
  10219. 'ftp:': true,
  10220. 'gopher:': true,
  10221. 'file:': true
  10222. };
  10223. /* eslint-enable no-script-url */
  10224. function urlParse(url, slashesDenoteHost) {
  10225. if (url && url instanceof Url) { return url; }
  10226. var u = new Url();
  10227. u.parse(url, slashesDenoteHost);
  10228. return u;
  10229. }
  10230. Url.prototype.parse = function(url, slashesDenoteHost) {
  10231. var i, l, lowerProto, hec, slashes,
  10232. rest = url;
  10233. // trim before proceeding.
  10234. // This is to support parse stuff like " http://foo.com \n"
  10235. rest = rest.trim();
  10236. if (!slashesDenoteHost && url.split('#').length === 1) {
  10237. // Try fast path regexp
  10238. var simplePath = simplePathPattern.exec(rest);
  10239. if (simplePath) {
  10240. this.pathname = simplePath[1];
  10241. if (simplePath[2]) {
  10242. this.search = simplePath[2];
  10243. }
  10244. return this;
  10245. }
  10246. }
  10247. var proto = protocolPattern.exec(rest);
  10248. if (proto) {
  10249. proto = proto[0];
  10250. lowerProto = proto.toLowerCase();
  10251. this.protocol = proto;
  10252. rest = rest.substr(proto.length);
  10253. }
  10254. // figure out if it's got a host
  10255. // user@server is *always* interpreted as a hostname, and url
  10256. // resolution will treat //foo/bar as host=foo,path=bar because that's
  10257. // how the browser resolves relative URLs.
  10258. if (slashesDenoteHost || proto || rest.match(/^\/\/[^@\/]+@[^@\/]+/)) {
  10259. slashes = rest.substr(0, 2) === '//';
  10260. if (slashes && !(proto && hostlessProtocol[proto])) {
  10261. rest = rest.substr(2);
  10262. this.slashes = true;
  10263. }
  10264. }
  10265. if (!hostlessProtocol[proto] &&
  10266. (slashes || (proto && !slashedProtocol[proto]))) {
  10267. // there's a hostname.
  10268. // the first instance of /, ?, ;, or # ends the host.
  10269. //
  10270. // If there is an @ in the hostname, then non-host chars *are* allowed
  10271. // to the left of the last @ sign, unless some host-ending character
  10272. // comes *before* the @-sign.
  10273. // URLs are obnoxious.
  10274. //
  10275. // ex:
  10276. // http://a@b@c/ => user:a@b host:c
  10277. // http://a@b?@c => user:a host:c path:/?@c
  10278. // v0.12 TODO(isaacs): This is not quite how Chrome does things.
  10279. // Review our test case against browsers more comprehensively.
  10280. // find the first instance of any hostEndingChars
  10281. var hostEnd = -1;
  10282. for (i = 0; i < hostEndingChars.length; i++) {
  10283. hec = rest.indexOf(hostEndingChars[i]);
  10284. if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) {
  10285. hostEnd = hec;
  10286. }
  10287. }
  10288. // at this point, either we have an explicit point where the
  10289. // auth portion cannot go past, or the last @ char is the decider.
  10290. var auth, atSign;
  10291. if (hostEnd === -1) {
  10292. // atSign can be anywhere.
  10293. atSign = rest.lastIndexOf('@');
  10294. } else {
  10295. // atSign must be in auth portion.
  10296. // http://a@b/c@d => host:b auth:a path:/c@d
  10297. atSign = rest.lastIndexOf('@', hostEnd);
  10298. }
  10299. // Now we have a portion which is definitely the auth.
  10300. // Pull that off.
  10301. if (atSign !== -1) {
  10302. auth = rest.slice(0, atSign);
  10303. rest = rest.slice(atSign + 1);
  10304. this.auth = auth;
  10305. }
  10306. // the host is the remaining to the left of the first non-host char
  10307. hostEnd = -1;
  10308. for (i = 0; i < nonHostChars.length; i++) {
  10309. hec = rest.indexOf(nonHostChars[i]);
  10310. if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) {
  10311. hostEnd = hec;
  10312. }
  10313. }
  10314. // if we still have not hit it, then the entire thing is a host.
  10315. if (hostEnd === -1) {
  10316. hostEnd = rest.length;
  10317. }
  10318. if (rest[hostEnd - 1] === ':') { hostEnd--; }
  10319. var host = rest.slice(0, hostEnd);
  10320. rest = rest.slice(hostEnd);
  10321. // pull out port.
  10322. this.parseHost(host);
  10323. // we've indicated that there is a hostname,
  10324. // so even if it's empty, it has to be present.
  10325. this.hostname = this.hostname || '';
  10326. // if hostname begins with [ and ends with ]
  10327. // assume that it's an IPv6 address.
  10328. var ipv6Hostname = this.hostname[0] === '[' &&
  10329. this.hostname[this.hostname.length - 1] === ']';
  10330. // validate a little.
  10331. if (!ipv6Hostname) {
  10332. var hostparts = this.hostname.split(/\./);
  10333. for (i = 0, l = hostparts.length; i < l; i++) {
  10334. var part = hostparts[i];
  10335. if (!part) { continue; }
  10336. if (!part.match(hostnamePartPattern)) {
  10337. var newpart = '';
  10338. for (var j = 0, k = part.length; j < k; j++) {
  10339. if (part.charCodeAt(j) > 127) {
  10340. // we replace non-ASCII char with a temporary placeholder
  10341. // we need this to make sure size of hostname is not
  10342. // broken by replacing non-ASCII by nothing
  10343. newpart += 'x';
  10344. } else {
  10345. newpart += part[j];
  10346. }
  10347. }
  10348. // we test again with ASCII char only
  10349. if (!newpart.match(hostnamePartPattern)) {
  10350. var validParts = hostparts.slice(0, i);
  10351. var notHost = hostparts.slice(i + 1);
  10352. var bit = part.match(hostnamePartStart);
  10353. if (bit) {
  10354. validParts.push(bit[1]);
  10355. notHost.unshift(bit[2]);
  10356. }
  10357. if (notHost.length) {
  10358. rest = notHost.join('.') + rest;
  10359. }
  10360. this.hostname = validParts.join('.');
  10361. break;
  10362. }
  10363. }
  10364. }
  10365. }
  10366. if (this.hostname.length > hostnameMaxLen) {
  10367. this.hostname = '';
  10368. }
  10369. // strip [ and ] from the hostname
  10370. // the host field still retains them, though
  10371. if (ipv6Hostname) {
  10372. this.hostname = this.hostname.substr(1, this.hostname.length - 2);
  10373. }
  10374. }
  10375. // chop off from the tail first.
  10376. var hash = rest.indexOf('#');
  10377. if (hash !== -1) {
  10378. // got a fragment string.
  10379. this.hash = rest.substr(hash);
  10380. rest = rest.slice(0, hash);
  10381. }
  10382. var qm = rest.indexOf('?');
  10383. if (qm !== -1) {
  10384. this.search = rest.substr(qm);
  10385. rest = rest.slice(0, qm);
  10386. }
  10387. if (rest) { this.pathname = rest; }
  10388. if (slashedProtocol[lowerProto] &&
  10389. this.hostname && !this.pathname) {
  10390. this.pathname = '';
  10391. }
  10392. return this;
  10393. };
  10394. Url.prototype.parseHost = function(host) {
  10395. var port = portPattern.exec(host);
  10396. if (port) {
  10397. port = port[0];
  10398. if (port !== ':') {
  10399. this.port = port.substr(1);
  10400. }
  10401. host = host.substr(0, host.length - port.length);
  10402. }
  10403. if (host) { this.hostname = host; }
  10404. };
  10405. module.exports = urlParse;
  10406. /***/ }),
  10407. /* 78 */
  10408. /***/ (function(module, exports) {
  10409. // shim for using process in browser
  10410. var process = module.exports = {};
  10411. // cached from whatever global is present so that test runners that stub it
  10412. // don't break things. But we need to wrap it in a try catch in case it is
  10413. // wrapped in strict mode code which doesn't define any globals. It's inside a
  10414. // function because try/catches deoptimize in certain engines.
  10415. var cachedSetTimeout;
  10416. var cachedClearTimeout;
  10417. function defaultSetTimout() {
  10418. throw new Error('setTimeout has not been defined');
  10419. }
  10420. function defaultClearTimeout () {
  10421. throw new Error('clearTimeout has not been defined');
  10422. }
  10423. (function () {
  10424. try {
  10425. if (typeof setTimeout === 'function') {
  10426. cachedSetTimeout = setTimeout;
  10427. } else {
  10428. cachedSetTimeout = defaultSetTimout;
  10429. }
  10430. } catch (e) {
  10431. cachedSetTimeout = defaultSetTimout;
  10432. }
  10433. try {
  10434. if (typeof clearTimeout === 'function') {
  10435. cachedClearTimeout = clearTimeout;
  10436. } else {
  10437. cachedClearTimeout = defaultClearTimeout;
  10438. }
  10439. } catch (e) {
  10440. cachedClearTimeout = defaultClearTimeout;
  10441. }
  10442. } ())
  10443. function runTimeout(fun) {
  10444. if (cachedSetTimeout === setTimeout) {
  10445. //normal enviroments in sane situations
  10446. return setTimeout(fun, 0);
  10447. }
  10448. // if setTimeout wasn't available but was latter defined
  10449. if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
  10450. cachedSetTimeout = setTimeout;
  10451. return setTimeout(fun, 0);
  10452. }
  10453. try {
  10454. // when when somebody has screwed with setTimeout but no I.E. maddness
  10455. return cachedSetTimeout(fun, 0);
  10456. } catch(e){
  10457. try {
  10458. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  10459. return cachedSetTimeout.call(null, fun, 0);
  10460. } catch(e){
  10461. // 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
  10462. return cachedSetTimeout.call(this, fun, 0);
  10463. }
  10464. }
  10465. }
  10466. function runClearTimeout(marker) {
  10467. if (cachedClearTimeout === clearTimeout) {
  10468. //normal enviroments in sane situations
  10469. return clearTimeout(marker);
  10470. }
  10471. // if clearTimeout wasn't available but was latter defined
  10472. if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
  10473. cachedClearTimeout = clearTimeout;
  10474. return clearTimeout(marker);
  10475. }
  10476. try {
  10477. // when when somebody has screwed with setTimeout but no I.E. maddness
  10478. return cachedClearTimeout(marker);
  10479. } catch (e){
  10480. try {
  10481. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  10482. return cachedClearTimeout.call(null, marker);
  10483. } catch (e){
  10484. // 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.
  10485. // Some versions of I.E. have different rules for clearTimeout vs setTimeout
  10486. return cachedClearTimeout.call(this, marker);
  10487. }
  10488. }
  10489. }
  10490. var queue = [];
  10491. var draining = false;
  10492. var currentQueue;
  10493. var queueIndex = -1;
  10494. function cleanUpNextTick() {
  10495. if (!draining || !currentQueue) {
  10496. return;
  10497. }
  10498. draining = false;
  10499. if (currentQueue.length) {
  10500. queue = currentQueue.concat(queue);
  10501. } else {
  10502. queueIndex = -1;
  10503. }
  10504. if (queue.length) {
  10505. drainQueue();
  10506. }
  10507. }
  10508. function drainQueue() {
  10509. if (draining) {
  10510. return;
  10511. }
  10512. var timeout = runTimeout(cleanUpNextTick);
  10513. draining = true;
  10514. var len = queue.length;
  10515. while(len) {
  10516. currentQueue = queue;
  10517. queue = [];
  10518. while (++queueIndex < len) {
  10519. if (currentQueue) {
  10520. currentQueue[queueIndex].run();
  10521. }
  10522. }
  10523. queueIndex = -1;
  10524. len = queue.length;
  10525. }
  10526. currentQueue = null;
  10527. draining = false;
  10528. runClearTimeout(timeout);
  10529. }
  10530. process.nextTick = function (fun) {
  10531. var args = new Array(arguments.length - 1);
  10532. if (arguments.length > 1) {
  10533. for (var i = 1; i < arguments.length; i++) {
  10534. args[i - 1] = arguments[i];
  10535. }
  10536. }
  10537. queue.push(new Item(fun, args));
  10538. if (queue.length === 1 && !draining) {
  10539. runTimeout(drainQueue);
  10540. }
  10541. };
  10542. // v8 likes predictible objects
  10543. function Item(fun, array) {
  10544. this.fun = fun;
  10545. this.array = array;
  10546. }
  10547. Item.prototype.run = function () {
  10548. this.fun.apply(null, this.array);
  10549. };
  10550. process.title = 'browser';
  10551. process.browser = true;
  10552. process.env = {};
  10553. process.argv = [];
  10554. process.version = ''; // empty string to avoid regexp issues
  10555. process.versions = {};
  10556. function noop() {}
  10557. process.on = noop;
  10558. process.addListener = noop;
  10559. process.once = noop;
  10560. process.off = noop;
  10561. process.removeListener = noop;
  10562. process.removeAllListeners = noop;
  10563. process.emit = noop;
  10564. process.binding = function (name) {
  10565. throw new Error('process.binding is not supported');
  10566. };
  10567. process.cwd = function () { return '/' };
  10568. process.chdir = function (dir) {
  10569. throw new Error('process.chdir is not supported');
  10570. };
  10571. process.umask = function() { return 0; };
  10572. /***/ }),
  10573. /* 79 */
  10574. /***/ (function(module, exports, __webpack_require__) {
  10575. /* WEBPACK VAR INJECTION */(function(module, global) {var __WEBPACK_AMD_DEFINE_RESULT__;/*! https://mths.be/punycode v1.4.1 by @mathias */
  10576. ;(function(root) {
  10577. /** Detect free variables */
  10578. var freeExports = typeof exports == 'object' && exports &&
  10579. !exports.nodeType && exports;
  10580. var freeModule = typeof module == 'object' && module &&
  10581. !module.nodeType && module;
  10582. var freeGlobal = typeof global == 'object' && global;
  10583. if (
  10584. freeGlobal.global === freeGlobal ||
  10585. freeGlobal.window === freeGlobal ||
  10586. freeGlobal.self === freeGlobal
  10587. ) {
  10588. root = freeGlobal;
  10589. }
  10590. /**
  10591. * The `punycode` object.
  10592. * @name punycode
  10593. * @type Object
  10594. */
  10595. var punycode,
  10596. /** Highest positive signed 32-bit float value */
  10597. maxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1
  10598. /** Bootstring parameters */
  10599. base = 36,
  10600. tMin = 1,
  10601. tMax = 26,
  10602. skew = 38,
  10603. damp = 700,
  10604. initialBias = 72,
  10605. initialN = 128, // 0x80
  10606. delimiter = '-', // '\x2D'
  10607. /** Regular expressions */
  10608. regexPunycode = /^xn--/,
  10609. regexNonASCII = /[^\x20-\x7E]/, // unprintable ASCII chars + non-ASCII chars
  10610. regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g, // RFC 3490 separators
  10611. /** Error messages */
  10612. errors = {
  10613. 'overflow': 'Overflow: input needs wider integers to process',
  10614. 'not-basic': 'Illegal input >= 0x80 (not a basic code point)',
  10615. 'invalid-input': 'Invalid input'
  10616. },
  10617. /** Convenience shortcuts */
  10618. baseMinusTMin = base - tMin,
  10619. floor = Math.floor,
  10620. stringFromCharCode = String.fromCharCode,
  10621. /** Temporary variable */
  10622. key;
  10623. /*--------------------------------------------------------------------------*/
  10624. /**
  10625. * A generic error utility function.
  10626. * @private
  10627. * @param {String} type The error type.
  10628. * @returns {Error} Throws a `RangeError` with the applicable error message.
  10629. */
  10630. function error(type) {
  10631. throw new RangeError(errors[type]);
  10632. }
  10633. /**
  10634. * A generic `Array#map` utility function.
  10635. * @private
  10636. * @param {Array} array The array to iterate over.
  10637. * @param {Function} callback The function that gets called for every array
  10638. * item.
  10639. * @returns {Array} A new array of values returned by the callback function.
  10640. */
  10641. function map(array, fn) {
  10642. var length = array.length;
  10643. var result = [];
  10644. while (length--) {
  10645. result[length] = fn(array[length]);
  10646. }
  10647. return result;
  10648. }
  10649. /**
  10650. * A simple `Array#map`-like wrapper to work with domain name strings or email
  10651. * addresses.
  10652. * @private
  10653. * @param {String} domain The domain name or email address.
  10654. * @param {Function} callback The function that gets called for every
  10655. * character.
  10656. * @returns {Array} A new string of characters returned by the callback
  10657. * function.
  10658. */
  10659. function mapDomain(string, fn) {
  10660. var parts = string.split('@');
  10661. var result = '';
  10662. if (parts.length > 1) {
  10663. // In email addresses, only the domain name should be punycoded. Leave
  10664. // the local part (i.e. everything up to `@`) intact.
  10665. result = parts[0] + '@';
  10666. string = parts[1];
  10667. }
  10668. // Avoid `split(regex)` for IE8 compatibility. See #17.
  10669. string = string.replace(regexSeparators, '\x2E');
  10670. var labels = string.split('.');
  10671. var encoded = map(labels, fn).join('.');
  10672. return result + encoded;
  10673. }
  10674. /**
  10675. * Creates an array containing the numeric code points of each Unicode
  10676. * character in the string. While JavaScript uses UCS-2 internally,
  10677. * this function will convert a pair of surrogate halves (each of which
  10678. * UCS-2 exposes as separate characters) into a single code point,
  10679. * matching UTF-16.
  10680. * @see `punycode.ucs2.encode`
  10681. * @see <https://mathiasbynens.be/notes/javascript-encoding>
  10682. * @memberOf punycode.ucs2
  10683. * @name decode
  10684. * @param {String} string The Unicode input string (UCS-2).
  10685. * @returns {Array} The new array of code points.
  10686. */
  10687. function ucs2decode(string) {
  10688. var output = [],
  10689. counter = 0,
  10690. length = string.length,
  10691. value,
  10692. extra;
  10693. while (counter < length) {
  10694. value = string.charCodeAt(counter++);
  10695. if (value >= 0xD800 && value <= 0xDBFF && counter < length) {
  10696. // high surrogate, and there is a next character
  10697. extra = string.charCodeAt(counter++);
  10698. if ((extra & 0xFC00) == 0xDC00) { // low surrogate
  10699. output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
  10700. } else {
  10701. // unmatched surrogate; only append this code unit, in case the next
  10702. // code unit is the high surrogate of a surrogate pair
  10703. output.push(value);
  10704. counter--;
  10705. }
  10706. } else {
  10707. output.push(value);
  10708. }
  10709. }
  10710. return output;
  10711. }
  10712. /**
  10713. * Creates a string based on an array of numeric code points.
  10714. * @see `punycode.ucs2.decode`
  10715. * @memberOf punycode.ucs2
  10716. * @name encode
  10717. * @param {Array} codePoints The array of numeric code points.
  10718. * @returns {String} The new Unicode string (UCS-2).
  10719. */
  10720. function ucs2encode(array) {
  10721. return map(array, function(value) {
  10722. var output = '';
  10723. if (value > 0xFFFF) {
  10724. value -= 0x10000;
  10725. output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);
  10726. value = 0xDC00 | value & 0x3FF;
  10727. }
  10728. output += stringFromCharCode(value);
  10729. return output;
  10730. }).join('');
  10731. }
  10732. /**
  10733. * Converts a basic code point into a digit/integer.
  10734. * @see `digitToBasic()`
  10735. * @private
  10736. * @param {Number} codePoint The basic numeric code point value.
  10737. * @returns {Number} The numeric value of a basic code point (for use in
  10738. * representing integers) in the range `0` to `base - 1`, or `base` if
  10739. * the code point does not represent a value.
  10740. */
  10741. function basicToDigit(codePoint) {
  10742. if (codePoint - 48 < 10) {
  10743. return codePoint - 22;
  10744. }
  10745. if (codePoint - 65 < 26) {
  10746. return codePoint - 65;
  10747. }
  10748. if (codePoint - 97 < 26) {
  10749. return codePoint - 97;
  10750. }
  10751. return base;
  10752. }
  10753. /**
  10754. * Converts a digit/integer into a basic code point.
  10755. * @see `basicToDigit()`
  10756. * @private
  10757. * @param {Number} digit The numeric value of a basic code point.
  10758. * @returns {Number} The basic code point whose value (when used for
  10759. * representing integers) is `digit`, which needs to be in the range
  10760. * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is
  10761. * used; else, the lowercase form is used. The behavior is undefined
  10762. * if `flag` is non-zero and `digit` has no uppercase form.
  10763. */
  10764. function digitToBasic(digit, flag) {
  10765. // 0..25 map to ASCII a..z or A..Z
  10766. // 26..35 map to ASCII 0..9
  10767. return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);
  10768. }
  10769. /**
  10770. * Bias adaptation function as per section 3.4 of RFC 3492.
  10771. * https://tools.ietf.org/html/rfc3492#section-3.4
  10772. * @private
  10773. */
  10774. function adapt(delta, numPoints, firstTime) {
  10775. var k = 0;
  10776. delta = firstTime ? floor(delta / damp) : delta >> 1;
  10777. delta += floor(delta / numPoints);
  10778. for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {
  10779. delta = floor(delta / baseMinusTMin);
  10780. }
  10781. return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));
  10782. }
  10783. /**
  10784. * Converts a Punycode string of ASCII-only symbols to a string of Unicode
  10785. * symbols.
  10786. * @memberOf punycode
  10787. * @param {String} input The Punycode string of ASCII-only symbols.
  10788. * @returns {String} The resulting string of Unicode symbols.
  10789. */
  10790. function decode(input) {
  10791. // Don't use UCS-2
  10792. var output = [],
  10793. inputLength = input.length,
  10794. out,
  10795. i = 0,
  10796. n = initialN,
  10797. bias = initialBias,
  10798. basic,
  10799. j,
  10800. index,
  10801. oldi,
  10802. w,
  10803. k,
  10804. digit,
  10805. t,
  10806. /** Cached calculation results */
  10807. baseMinusT;
  10808. // Handle the basic code points: let `basic` be the number of input code
  10809. // points before the last delimiter, or `0` if there is none, then copy
  10810. // the first basic code points to the output.
  10811. basic = input.lastIndexOf(delimiter);
  10812. if (basic < 0) {
  10813. basic = 0;
  10814. }
  10815. for (j = 0; j < basic; ++j) {
  10816. // if it's not a basic code point
  10817. if (input.charCodeAt(j) >= 0x80) {
  10818. error('not-basic');
  10819. }
  10820. output.push(input.charCodeAt(j));
  10821. }
  10822. // Main decoding loop: start just after the last delimiter if any basic code
  10823. // points were copied; start at the beginning otherwise.
  10824. for (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {
  10825. // `index` is the index of the next character to be consumed.
  10826. // Decode a generalized variable-length integer into `delta`,
  10827. // which gets added to `i`. The overflow checking is easier
  10828. // if we increase `i` as we go, then subtract off its starting
  10829. // value at the end to obtain `delta`.
  10830. for (oldi = i, w = 1, k = base; /* no condition */; k += base) {
  10831. if (index >= inputLength) {
  10832. error('invalid-input');
  10833. }
  10834. digit = basicToDigit(input.charCodeAt(index++));
  10835. if (digit >= base || digit > floor((maxInt - i) / w)) {
  10836. error('overflow');
  10837. }
  10838. i += digit * w;
  10839. t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);
  10840. if (digit < t) {
  10841. break;
  10842. }
  10843. baseMinusT = base - t;
  10844. if (w > floor(maxInt / baseMinusT)) {
  10845. error('overflow');
  10846. }
  10847. w *= baseMinusT;
  10848. }
  10849. out = output.length + 1;
  10850. bias = adapt(i - oldi, out, oldi == 0);
  10851. // `i` was supposed to wrap around from `out` to `0`,
  10852. // incrementing `n` each time, so we'll fix that now:
  10853. if (floor(i / out) > maxInt - n) {
  10854. error('overflow');
  10855. }
  10856. n += floor(i / out);
  10857. i %= out;
  10858. // Insert `n` at position `i` of the output
  10859. output.splice(i++, 0, n);
  10860. }
  10861. return ucs2encode(output);
  10862. }
  10863. /**
  10864. * Converts a string of Unicode symbols (e.g. a domain name label) to a
  10865. * Punycode string of ASCII-only symbols.
  10866. * @memberOf punycode
  10867. * @param {String} input The string of Unicode symbols.
  10868. * @returns {String} The resulting Punycode string of ASCII-only symbols.
  10869. */
  10870. function encode(input) {
  10871. var n,
  10872. delta,
  10873. handledCPCount,
  10874. basicLength,
  10875. bias,
  10876. j,
  10877. m,
  10878. q,
  10879. k,
  10880. t,
  10881. currentValue,
  10882. output = [],
  10883. /** `inputLength` will hold the number of code points in `input`. */
  10884. inputLength,
  10885. /** Cached calculation results */
  10886. handledCPCountPlusOne,
  10887. baseMinusT,
  10888. qMinusT;
  10889. // Convert the input in UCS-2 to Unicode
  10890. input = ucs2decode(input);
  10891. // Cache the length
  10892. inputLength = input.length;
  10893. // Initialize the state
  10894. n = initialN;
  10895. delta = 0;
  10896. bias = initialBias;
  10897. // Handle the basic code points
  10898. for (j = 0; j < inputLength; ++j) {
  10899. currentValue = input[j];
  10900. if (currentValue < 0x80) {
  10901. output.push(stringFromCharCode(currentValue));
  10902. }
  10903. }
  10904. handledCPCount = basicLength = output.length;
  10905. // `handledCPCount` is the number of code points that have been handled;
  10906. // `basicLength` is the number of basic code points.
  10907. // Finish the basic string - if it is not empty - with a delimiter
  10908. if (basicLength) {
  10909. output.push(delimiter);
  10910. }
  10911. // Main encoding loop:
  10912. while (handledCPCount < inputLength) {
  10913. // All non-basic code points < n have been handled already. Find the next
  10914. // larger one:
  10915. for (m = maxInt, j = 0; j < inputLength; ++j) {
  10916. currentValue = input[j];
  10917. if (currentValue >= n && currentValue < m) {
  10918. m = currentValue;
  10919. }
  10920. }
  10921. // Increase `delta` enough to advance the decoder's <n,i> state to <m,0>,
  10922. // but guard against overflow
  10923. handledCPCountPlusOne = handledCPCount + 1;
  10924. if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {
  10925. error('overflow');
  10926. }
  10927. delta += (m - n) * handledCPCountPlusOne;
  10928. n = m;
  10929. for (j = 0; j < inputLength; ++j) {
  10930. currentValue = input[j];
  10931. if (currentValue < n && ++delta > maxInt) {
  10932. error('overflow');
  10933. }
  10934. if (currentValue == n) {
  10935. // Represent delta as a generalized variable-length integer
  10936. for (q = delta, k = base; /* no condition */; k += base) {
  10937. t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);
  10938. if (q < t) {
  10939. break;
  10940. }
  10941. qMinusT = q - t;
  10942. baseMinusT = base - t;
  10943. output.push(
  10944. stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))
  10945. );
  10946. q = floor(qMinusT / baseMinusT);
  10947. }
  10948. output.push(stringFromCharCode(digitToBasic(q, 0)));
  10949. bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);
  10950. delta = 0;
  10951. ++handledCPCount;
  10952. }
  10953. }
  10954. ++delta;
  10955. ++n;
  10956. }
  10957. return output.join('');
  10958. }
  10959. /**
  10960. * Converts a Punycode string representing a domain name or an email address
  10961. * to Unicode. Only the Punycoded parts of the input will be converted, i.e.
  10962. * it doesn't matter if you call it on a string that has already been
  10963. * converted to Unicode.
  10964. * @memberOf punycode
  10965. * @param {String} input The Punycoded domain name or email address to
  10966. * convert to Unicode.
  10967. * @returns {String} The Unicode representation of the given Punycode
  10968. * string.
  10969. */
  10970. function toUnicode(input) {
  10971. return mapDomain(input, function(string) {
  10972. return regexPunycode.test(string)
  10973. ? decode(string.slice(4).toLowerCase())
  10974. : string;
  10975. });
  10976. }
  10977. /**
  10978. * Converts a Unicode string representing a domain name or an email address to
  10979. * Punycode. Only the non-ASCII parts of the domain name will be converted,
  10980. * i.e. it doesn't matter if you call it with a domain that's already in
  10981. * ASCII.
  10982. * @memberOf punycode
  10983. * @param {String} input The domain name or email address to convert, as a
  10984. * Unicode string.
  10985. * @returns {String} The Punycode representation of the given domain name or
  10986. * email address.
  10987. */
  10988. function toASCII(input) {
  10989. return mapDomain(input, function(string) {
  10990. return regexNonASCII.test(string)
  10991. ? 'xn--' + encode(string)
  10992. : string;
  10993. });
  10994. }
  10995. /*--------------------------------------------------------------------------*/
  10996. /** Define the public API */
  10997. punycode = {
  10998. /**
  10999. * A string representing the current Punycode.js version number.
  11000. * @memberOf punycode
  11001. * @type String
  11002. */
  11003. 'version': '1.4.1',
  11004. /**
  11005. * An object of methods to convert from JavaScript's internal character
  11006. * representation (UCS-2) to Unicode code points, and back.
  11007. * @see <https://mathiasbynens.be/notes/javascript-encoding>
  11008. * @memberOf punycode
  11009. * @type Object
  11010. */
  11011. 'ucs2': {
  11012. 'decode': ucs2decode,
  11013. 'encode': ucs2encode
  11014. },
  11015. 'decode': decode,
  11016. 'encode': encode,
  11017. 'toASCII': toASCII,
  11018. 'toUnicode': toUnicode
  11019. };
  11020. /** Expose `punycode` */
  11021. // Some AMD build optimizers, like r.js, check for specific condition patterns
  11022. // like the following:
  11023. if (
  11024. true
  11025. ) {
  11026. !(__WEBPACK_AMD_DEFINE_RESULT__ = function() {
  11027. return punycode;
  11028. }.call(exports, __webpack_require__, exports, module),
  11029. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  11030. } else if (freeExports && freeModule) {
  11031. if (module.exports == freeExports) {
  11032. // in Node.js, io.js, or RingoJS v0.8.0+
  11033. freeModule.exports = punycode;
  11034. } else {
  11035. // in Narwhal or RingoJS v0.7.0-
  11036. for (key in punycode) {
  11037. punycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]);
  11038. }
  11039. }
  11040. } else {
  11041. // in Rhino or a web browser
  11042. root.punycode = punycode;
  11043. }
  11044. }(this));
  11045. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(84)(module), __webpack_require__(6)))
  11046. /***/ }),
  11047. /* 80 */
  11048. /***/ (function(module, exports, __webpack_require__) {
  11049. /* WEBPACK VAR INJECTION */(function(global, process) {(function (global, undefined) {
  11050. "use strict";
  11051. if (global.setImmediate) {
  11052. return;
  11053. }
  11054. var nextHandle = 1; // Spec says greater than zero
  11055. var tasksByHandle = {};
  11056. var currentlyRunningATask = false;
  11057. var doc = global.document;
  11058. var registerImmediate;
  11059. function setImmediate(callback) {
  11060. // Callback can either be a function or a string
  11061. if (typeof callback !== "function") {
  11062. callback = new Function("" + callback);
  11063. }
  11064. // Copy function arguments
  11065. var args = new Array(arguments.length - 1);
  11066. for (var i = 0; i < args.length; i++) {
  11067. args[i] = arguments[i + 1];
  11068. }
  11069. // Store and register the task
  11070. var task = { callback: callback, args: args };
  11071. tasksByHandle[nextHandle] = task;
  11072. registerImmediate(nextHandle);
  11073. return nextHandle++;
  11074. }
  11075. function clearImmediate(handle) {
  11076. delete tasksByHandle[handle];
  11077. }
  11078. function run(task) {
  11079. var callback = task.callback;
  11080. var args = task.args;
  11081. switch (args.length) {
  11082. case 0:
  11083. callback();
  11084. break;
  11085. case 1:
  11086. callback(args[0]);
  11087. break;
  11088. case 2:
  11089. callback(args[0], args[1]);
  11090. break;
  11091. case 3:
  11092. callback(args[0], args[1], args[2]);
  11093. break;
  11094. default:
  11095. callback.apply(undefined, args);
  11096. break;
  11097. }
  11098. }
  11099. function runIfPresent(handle) {
  11100. // From the spec: "Wait until any invocations of this algorithm started before this one have completed."
  11101. // So if we're currently running a task, we'll need to delay this invocation.
  11102. if (currentlyRunningATask) {
  11103. // Delay by doing a setTimeout. setImmediate was tried instead, but in Firefox 7 it generated a
  11104. // "too much recursion" error.
  11105. setTimeout(runIfPresent, 0, handle);
  11106. } else {
  11107. var task = tasksByHandle[handle];
  11108. if (task) {
  11109. currentlyRunningATask = true;
  11110. try {
  11111. run(task);
  11112. } finally {
  11113. clearImmediate(handle);
  11114. currentlyRunningATask = false;
  11115. }
  11116. }
  11117. }
  11118. }
  11119. function installNextTickImplementation() {
  11120. registerImmediate = function(handle) {
  11121. process.nextTick(function () { runIfPresent(handle); });
  11122. };
  11123. }
  11124. function canUsePostMessage() {
  11125. // The test against `importScripts` prevents this implementation from being installed inside a web worker,
  11126. // where `global.postMessage` means something completely different and can't be used for this purpose.
  11127. if (global.postMessage && !global.importScripts) {
  11128. var postMessageIsAsynchronous = true;
  11129. var oldOnMessage = global.onmessage;
  11130. global.onmessage = function() {
  11131. postMessageIsAsynchronous = false;
  11132. };
  11133. global.postMessage("", "*");
  11134. global.onmessage = oldOnMessage;
  11135. return postMessageIsAsynchronous;
  11136. }
  11137. }
  11138. function installPostMessageImplementation() {
  11139. // Installs an event handler on `global` for the `message` event: see
  11140. // * https://developer.mozilla.org/en/DOM/window.postMessage
  11141. // * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages
  11142. var messagePrefix = "setImmediate$" + Math.random() + "$";
  11143. var onGlobalMessage = function(event) {
  11144. if (event.source === global &&
  11145. typeof event.data === "string" &&
  11146. event.data.indexOf(messagePrefix) === 0) {
  11147. runIfPresent(+event.data.slice(messagePrefix.length));
  11148. }
  11149. };
  11150. if (global.addEventListener) {
  11151. global.addEventListener("message", onGlobalMessage, false);
  11152. } else {
  11153. global.attachEvent("onmessage", onGlobalMessage);
  11154. }
  11155. registerImmediate = function(handle) {
  11156. global.postMessage(messagePrefix + handle, "*");
  11157. };
  11158. }
  11159. function installMessageChannelImplementation() {
  11160. var channel = new MessageChannel();
  11161. channel.port1.onmessage = function(event) {
  11162. var handle = event.data;
  11163. runIfPresent(handle);
  11164. };
  11165. registerImmediate = function(handle) {
  11166. channel.port2.postMessage(handle);
  11167. };
  11168. }
  11169. function installReadyStateChangeImplementation() {
  11170. var html = doc.documentElement;
  11171. registerImmediate = function(handle) {
  11172. // Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted
  11173. // into the document. Do so, thus queuing up the task. Remember to clean up once it's been called.
  11174. var script = doc.createElement("script");
  11175. script.onreadystatechange = function () {
  11176. runIfPresent(handle);
  11177. script.onreadystatechange = null;
  11178. html.removeChild(script);
  11179. script = null;
  11180. };
  11181. html.appendChild(script);
  11182. };
  11183. }
  11184. function installSetTimeoutImplementation() {
  11185. registerImmediate = function(handle) {
  11186. setTimeout(runIfPresent, 0, handle);
  11187. };
  11188. }
  11189. // If supported, we should attach to the prototype of global, since that is where setTimeout et al. live.
  11190. var attachTo = Object.getPrototypeOf && Object.getPrototypeOf(global);
  11191. attachTo = attachTo && attachTo.setTimeout ? attachTo : global;
  11192. // Don't get fooled by e.g. browserify environments.
  11193. if ({}.toString.call(global.process) === "[object process]") {
  11194. // For Node.js before 0.9
  11195. installNextTickImplementation();
  11196. } else if (canUsePostMessage()) {
  11197. // For non-IE10 modern browsers
  11198. installPostMessageImplementation();
  11199. } else if (global.MessageChannel) {
  11200. // For web workers, where supported
  11201. installMessageChannelImplementation();
  11202. } else if (doc && "onreadystatechange" in doc.createElement("script")) {
  11203. // For IE 6–8
  11204. installReadyStateChangeImplementation();
  11205. } else {
  11206. // For older browsers
  11207. installSetTimeoutImplementation();
  11208. }
  11209. attachTo.setImmediate = setImmediate;
  11210. attachTo.clearImmediate = clearImmediate;
  11211. }(typeof self === "undefined" ? typeof global === "undefined" ? this : global : self));
  11212. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6), __webpack_require__(78)))
  11213. /***/ }),
  11214. /* 81 */
  11215. /***/ (function(module, exports, __webpack_require__) {
  11216. var apply = Function.prototype.apply;
  11217. // DOM APIs, for completeness
  11218. exports.setTimeout = function() {
  11219. return new Timeout(apply.call(setTimeout, window, arguments), clearTimeout);
  11220. };
  11221. exports.setInterval = function() {
  11222. return new Timeout(apply.call(setInterval, window, arguments), clearInterval);
  11223. };
  11224. exports.clearTimeout =
  11225. exports.clearInterval = function(timeout) {
  11226. if (timeout) {
  11227. timeout.close();
  11228. }
  11229. };
  11230. function Timeout(id, clearFn) {
  11231. this._id = id;
  11232. this._clearFn = clearFn;
  11233. }
  11234. Timeout.prototype.unref = Timeout.prototype.ref = function() {};
  11235. Timeout.prototype.close = function() {
  11236. this._clearFn.call(window, this._id);
  11237. };
  11238. // Does not start the time, just sets up the members needed.
  11239. exports.enroll = function(item, msecs) {
  11240. clearTimeout(item._idleTimeoutId);
  11241. item._idleTimeout = msecs;
  11242. };
  11243. exports.unenroll = function(item) {
  11244. clearTimeout(item._idleTimeoutId);
  11245. item._idleTimeout = -1;
  11246. };
  11247. exports._unrefActive = exports.active = function(item) {
  11248. clearTimeout(item._idleTimeoutId);
  11249. var msecs = item._idleTimeout;
  11250. if (msecs >= 0) {
  11251. item._idleTimeoutId = setTimeout(function onTimeout() {
  11252. if (item._onTimeout)
  11253. item._onTimeout();
  11254. }, msecs);
  11255. }
  11256. };
  11257. // setimmediate attaches itself to the global object
  11258. __webpack_require__(80);
  11259. exports.setImmediate = setImmediate;
  11260. exports.clearImmediate = clearImmediate;
  11261. /***/ }),
  11262. /* 82 */
  11263. /***/ (function(module, exports) {
  11264. 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]/
  11265. /***/ }),
  11266. /* 83 */
  11267. /***/ (function(module, exports, __webpack_require__) {
  11268. "use strict";
  11269. exports.Any = __webpack_require__(18);
  11270. exports.Cc = __webpack_require__(16);
  11271. exports.Cf = __webpack_require__(82);
  11272. exports.P = __webpack_require__(5);
  11273. exports.Z = __webpack_require__(17);
  11274. /***/ }),
  11275. /* 84 */
  11276. /***/ (function(module, exports) {
  11277. module.exports = function(module) {
  11278. if(!module.webpackPolyfill) {
  11279. module.deprecate = function() {};
  11280. module.paths = [];
  11281. // module.parent = undefined by default
  11282. if(!module.children) module.children = [];
  11283. Object.defineProperty(module, "loaded", {
  11284. enumerable: true,
  11285. get: function() {
  11286. return module.l;
  11287. }
  11288. });
  11289. Object.defineProperty(module, "id", {
  11290. enumerable: true,
  11291. get: function() {
  11292. return module.i;
  11293. }
  11294. });
  11295. module.webpackPolyfill = 1;
  11296. }
  11297. return module;
  11298. };
  11299. /***/ }),
  11300. /* 85 */
  11301. /***/ (function(module, exports, __webpack_require__) {
  11302. __webpack_require__(19);
  11303. module.exports = __webpack_require__(20);
  11304. /***/ }),
  11305. /* 86 */
  11306. /***/ (function(module, exports, __webpack_require__) {
  11307. var m = __webpack_require__(1);
  11308. // https://github.com/markdown-it/markdown-it
  11309. var markdown = __webpack_require__(10)()
  11310. .use(__webpack_require__(9));
  11311. var _dbs = __webpack_require__(2);
  11312. var _Header = __webpack_require__(8);
  11313. var _Footer = __webpack_require__(7);
  11314. // __ _ __
  11315. // / / (_)___ / /__
  11316. // / / / / __ \/ //_/
  11317. // / /___/ / / / / ,<
  11318. // /_____/_/_/ /_/_/|_|
  11319. var _Link = {
  11320. tid:"",
  11321. opened:false,
  11322. oninit: function(vn){
  11323. // console.log("INIT LINK : vn", vn);
  11324. // define target id
  11325. this.tid = vn.attrs.href;
  11326. },
  11327. onbeforeupdate: function(vn){
  11328. this.tid = vn.attrs.href;
  11329. },
  11330. view: function(vn){
  11331. this.tid_known = typeof _dbs.data_byid[_dbs.lang][this.tid] === 'undefined' ? false : true;
  11332. if (!this.tid_known) {
  11333. console.log('!! target id '+this.tid+' unkonwn !!');
  11334. }
  11335. if(this.opened && this.tid_known){
  11336. // console.log('this.tid', vn.state);
  11337. return m('div', {'class':'opened-link'},
  11338. [
  11339. m('span', {'class':"link text"}, vn.children),
  11340. typeof _dbs.data_byid[_dbs.lang][this.tid].childs != "undefined"
  11341. ? m(_Enonce, _dbs.data_byid[_dbs.lang][this.tid])
  11342. : m(_Item, _dbs.data_byid[_dbs.lang][this.tid])
  11343. ]
  11344. );
  11345. }else{
  11346. // console.log(vn);
  11347. return m('a', {
  11348. 'class':'link',
  11349. 'href':'#'+this.tid,
  11350. 'rel':this.tid,
  11351. onclick:function(e){
  11352. e.preventDefault();
  11353. console.log('click', this);
  11354. vn.state.opened = true;
  11355. return false;
  11356. }
  11357. }, vn.children); // c'est quoi ce vn.children ?
  11358. }
  11359. }
  11360. }
  11361. // ______ __
  11362. // /_ __/__ _ __/ /_
  11363. // / / / _ \| |/_/ __/
  11364. // / / / __/> </ /_
  11365. // /_/ \___/_/|_|\__/
  11366. // recusive function to record information of all subnodes
  11367. function parseTextDom(nodes){
  11368. var list = [];
  11369. // loop through childNodes
  11370. for (var i = 0; i < nodes.length; i++) {
  11371. var n = {};
  11372. if(typeof nodes[i].localName != "undefined"){
  11373. n.tag=nodes[i].localName;
  11374. if (n.tag == 'p') {
  11375. // replace p by div as we will insert other div in them
  11376. n.tag = 'div';
  11377. n.attrs = {'class':'paragraph'};
  11378. }
  11379. if (n.tag == 'a') {
  11380. // record the href attribute for cross reference
  11381. n.attrs = {'href':nodes[i].attributes.href.value};
  11382. }
  11383. if(nodes[i].childNodes.length){
  11384. // again parse node's childs
  11385. n.childs = parseTextDom(nodes[i].childNodes);
  11386. }
  11387. }else if (nodes[i].textContent.length > 1){
  11388. // if node has no localName it is probably a #text node
  11389. // we record it if it's not empty
  11390. n.tag='#text';
  11391. n.text=nodes[i].textContent;
  11392. }
  11393. // add the node to the list if it has a tag
  11394. if(typeof n.tag != "undefined")
  11395. list.push(n);
  11396. }
  11397. return list;
  11398. }
  11399. // recusive fucntion to generate mithril object from information recorded with parseTextDom()
  11400. function populateTextDom(n,i){
  11401. // console.log('populateTextDom : '+i,n);
  11402. return n.tag == "#text"
  11403. ? m.trust(n.text)
  11404. : m(
  11405. n.tag != 'a' ? n.tag : _Link,
  11406. typeof n.attrs != "undefined" ? n.attrs : {},
  11407. typeof n.childs != "undefined"
  11408. ? n.childs.map(populateTextDom)
  11409. : typeof n.text != "undefined"
  11410. ? m.trust(n.text)
  11411. : null
  11412. );
  11413. }
  11414. var _Text = {
  11415. id:null,
  11416. text:"",
  11417. texthtml:"",
  11418. textdom:null,
  11419. textchilds:[],
  11420. parsetext: function(){
  11421. // console.log('parsetext', this);
  11422. // !! we need to convert markdown to html here because parseTextDom() is recursive through nodes tree
  11423. // convert markdown to html
  11424. this.texthtml = markdown.render(this.text)
  11425. // TODO: fixe number link text disapear [3](1d3) ( in 104d )
  11426. // TODO: fixe parenthèse disparait _(par les Défin. [test 3](1d3) et [test 5](1d5))_ ( in 104d )
  11427. // parse html string to virtual dom
  11428. this.textdom = new DOMParser().parseFromString(this.texthtml, "text/html");
  11429. // get the text nodes (avoid html document extra)
  11430. this.textchilds = parseTextDom(this.textdom.getElementsByTagName('body')[0].childNodes);
  11431. },
  11432. oninit: function(vn){
  11433. this.id = vn.attrs.id;
  11434. this.text = vn.attrs.text;
  11435. this.parsetext();
  11436. },
  11437. onbeforeupdate: function(vn,old){
  11438. this.text = vn.attrs.text;
  11439. this.parsetext();
  11440. },
  11441. view: function(vn){
  11442. // console.log('_Text :: view : '+vn.attrs.slug, vn);
  11443. return m('div',
  11444. {'class':'text'},
  11445. // loop through childNodes list generated by parseTextDom() in init
  11446. this.textchilds.map(populateTextDom)
  11447. ); // /m.div.text
  11448. } // view:
  11449. }
  11450. // ______
  11451. // / _/ /____ ____ ___
  11452. // / // __/ _ \/ __ `__ \
  11453. // _/ // /_/ __/ / / / / /
  11454. // /___/\__/\___/_/ /_/ /_/
  11455. var _Item = {
  11456. id:null,
  11457. part:null,
  11458. type:null,
  11459. nested:false,
  11460. oninit: function(vn){
  11461. // console.log('vn.attrs', vn.attrs);
  11462. this.id = vn.attrs.id;
  11463. this.type = vn.attrs.type;
  11464. // vn.state.part = vn.state.slug.match(/^(\d)(.+)/)[1];
  11465. this.text = vn.attrs.text;
  11466. this.nested = vn.attrs.nested || false;
  11467. },
  11468. onbeforeupdate: function(vn, old){
  11469. this.nested = vn.attrs.nested || false;
  11470. this.type = vn.attrs.type;
  11471. this.text = vn.attrs.text;
  11472. },
  11473. view: function(vn){
  11474. return m("section", {
  11475. 'id':this.id,
  11476. 'class':'item'+(this.nested ? ' nested':'')
  11477. },
  11478. [
  11479. // create title node
  11480. m("h3", {
  11481. // 'ref':vn.attrs.href,
  11482. onclick: function(e){
  11483. vn.state.active = vn.state.active ? 0 : 1;
  11484. }
  11485. }, this.type),
  11486. // create text node
  11487. m(_Text, {'text':this.text, 'id':this.id})
  11488. ]
  11489. )
  11490. }
  11491. };
  11492. // ______
  11493. // / ____/___ ____ ____ ________
  11494. // / __/ / __ \/ __ \/ __ \/ ___/ _ \
  11495. // / /___/ / / / /_/ / / / / /__/ __/
  11496. // /_____/_/ /_/\____/_/ /_/\___/\___/
  11497. var _Enonce = {
  11498. partid:null,
  11499. id:null,
  11500. title:null,
  11501. text:null,
  11502. nested:false,
  11503. childs:[],
  11504. oninit:function(vn){
  11505. // // console.log('Enonce on init', vn);
  11506. this.partid = vn.attrs.partid;
  11507. this.id = vn.attrs.id;
  11508. this.title = vn.attrs.title;
  11509. this.text = vn.attrs.text;
  11510. this.childs = vn.attrs.childs;
  11511. this.nested = vn.attrs.nested || false;
  11512. },
  11513. onbeforeupdate:function(vn, old) {
  11514. // console.log(vn.attrs.childs);
  11515. this.title = vn.attrs.title;
  11516. this.text = vn.attrs.text;
  11517. this.childs = vn.attrs.childs;
  11518. this.nested = vn.attrs.nested || false;
  11519. // if(vn.attrs.id == '1d1') console.log('_Enonce UPDATE, text :', vn.attrs.text);
  11520. },
  11521. view: function(vn){
  11522. // if(vn.attrs.id == '1d1') console.log('_Enonce VIEW, text :', vn.attrs.text);
  11523. return m("section", {
  11524. 'id' :this.id,
  11525. 'class' :'enonce'+(this.nested ? ' nested':'')
  11526. },
  11527. [
  11528. // create title node
  11529. m("h2", {}, this.title),
  11530. // create text node
  11531. m(_Text, {'text':this.text, 'id':this.id}),
  11532. // addd children
  11533. this.childs.map(function(c){
  11534. return m(_Item, c)
  11535. })
  11536. ])
  11537. }
  11538. }
  11539. // ____ __
  11540. // / __ \____ ______/ /_
  11541. // / /_/ / __ `/ ___/ __/
  11542. // / ____/ /_/ / / / /_
  11543. // /_/ \__,_/_/ \__/
  11544. var _Part = {
  11545. oninit: function(vn){
  11546. this.id = vn.attrs.id;
  11547. this.title = vn.attrs.title;
  11548. this.enonces = vn.attrs.enonces;
  11549. },
  11550. onbeforeupdate: function(vn, old){
  11551. // console.log('_Part, onbeforeupdate old',old);
  11552. this.title = vn.attrs.title;
  11553. this.enonces = vn.attrs.enonces;
  11554. },
  11555. view: function(vn){
  11556. // console.log(vn.attrs.enonces);
  11557. return m("section", {
  11558. 'id' :this.id,
  11559. 'class' :'part'
  11560. },
  11561. [
  11562. // create title node
  11563. m("h1", {'class':'part'}, m.trust(markdown.renderInline(this.title))),
  11564. // create text node
  11565. this.enonces.map(function(e){
  11566. console.log(e.type);
  11567. switch (e.type) {
  11568. case "title":
  11569. // handle titles
  11570. return m("h2", {'class':'title'}, m.trust(markdown.renderInline(e.title)));
  11571. break;
  11572. case "filet":
  11573. // handle filets
  11574. return m("h4", {'class':'filet'}, m.trust(markdown.renderInline(e.title)));
  11575. break;
  11576. default:
  11577. // or build structure
  11578. return m(_Enonce, Object.assign({"partid":this.id},e));
  11579. }
  11580. })
  11581. ]
  11582. )
  11583. }
  11584. }
  11585. // ____ __ _
  11586. // / _/___ / / (_)___ ___
  11587. // / // __ \/ / / / __ \/ _ \
  11588. // _/ // / / / /___/ / / / / __/
  11589. // /___/_/ /_/_____/_/_/ /_/\___/
  11590. module.exports = {
  11591. view: function(){
  11592. console.log('_Inline view', _dbs.lang);
  11593. return [
  11594. m(_Header),
  11595. m('main', {id:"content", 'class':'inline'}, _dbs.data[_dbs.lang].map(function(p){
  11596. // console.log("MAP _dbs", p);
  11597. return m(_Part,p);
  11598. })
  11599. ),
  11600. m(_Footer)
  11601. ]
  11602. }
  11603. }
  11604. /***/ })
  11605. /******/ ]);
  11606. //# sourceMappingURL=main.js.map