html2canvas.js 322 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250
  1. /*!
  2. * html2canvas 1.0.0-alpha.10 <https://html2canvas.hertzen.com>
  3. * Copyright (c) 2018 Niklas von Hertzen <https://hertzen.com>
  4. * Released under MIT License
  5. */
  6. (function webpackUniversalModuleDefinition(root, factory) {
  7. if(typeof exports === 'object' && typeof module === 'object')
  8. module.exports = factory();
  9. else if(typeof define === 'function' && define.amd)
  10. define([], factory);
  11. else if(typeof exports === 'object')
  12. exports["html2canvas"] = factory();
  13. else
  14. root["html2canvas"] = factory();
  15. })(this, function() {
  16. return /******/ (function(modules) { // webpackBootstrap
  17. /******/ // The module cache
  18. /******/ var installedModules = {};
  19. /******/
  20. /******/ // The require function
  21. /******/ function __webpack_require__(moduleId) {
  22. /******/
  23. /******/ // Check if module is in cache
  24. /******/ if(installedModules[moduleId]) {
  25. /******/ return installedModules[moduleId].exports;
  26. /******/ }
  27. /******/ // Create a new module (and put it into the cache)
  28. /******/ var module = installedModules[moduleId] = {
  29. /******/ i: moduleId,
  30. /******/ l: false,
  31. /******/ exports: {}
  32. /******/ };
  33. /******/
  34. /******/ // Execute the module function
  35. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  36. /******/
  37. /******/ // Flag the module as loaded
  38. /******/ module.l = true;
  39. /******/
  40. /******/ // Return the exports of the module
  41. /******/ return module.exports;
  42. /******/ }
  43. /******/
  44. /******/
  45. /******/ // expose the modules object (__webpack_modules__)
  46. /******/ __webpack_require__.m = modules;
  47. /******/
  48. /******/ // expose the module cache
  49. /******/ __webpack_require__.c = installedModules;
  50. /******/
  51. /******/ // define getter function for harmony exports
  52. /******/ __webpack_require__.d = function(exports, name, getter) {
  53. /******/ if(!__webpack_require__.o(exports, name)) {
  54. /******/ Object.defineProperty(exports, name, {
  55. /******/ configurable: false,
  56. /******/ enumerable: true,
  57. /******/ get: getter
  58. /******/ });
  59. /******/ }
  60. /******/ };
  61. /******/
  62. /******/ // getDefaultExport function for compatibility with non-harmony modules
  63. /******/ __webpack_require__.n = function(module) {
  64. /******/ var getter = module && module.__esModule ?
  65. /******/ function getDefault() { return module['default']; } :
  66. /******/ function getModuleExports() { return module; };
  67. /******/ __webpack_require__.d(getter, 'a', getter);
  68. /******/ return getter;
  69. /******/ };
  70. /******/
  71. /******/ // Object.prototype.hasOwnProperty.call
  72. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  73. /******/
  74. /******/ // __webpack_public_path__
  75. /******/ __webpack_require__.p = "";
  76. /******/
  77. /******/ // Load entry module and return exports
  78. /******/ return __webpack_require__(__webpack_require__.s = 27);
  79. /******/ })
  80. /************************************************************************/
  81. /******/ ([
  82. /* 0 */
  83. /***/ (function(module, exports, __webpack_require__) {
  84. "use strict";
  85. // http://dev.w3.org/csswg/css-color/
  86. Object.defineProperty(exports, "__esModule", {
  87. value: true
  88. });
  89. var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
  90. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  91. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  92. var HEX3 = /^#([a-f0-9]{3})$/i;
  93. var hex3 = function hex3(value) {
  94. var match = value.match(HEX3);
  95. if (match) {
  96. return [parseInt(match[1][0] + match[1][0], 16), parseInt(match[1][1] + match[1][1], 16), parseInt(match[1][2] + match[1][2], 16), null];
  97. }
  98. return false;
  99. };
  100. var HEX6 = /^#([a-f0-9]{6})$/i;
  101. var hex6 = function hex6(value) {
  102. var match = value.match(HEX6);
  103. if (match) {
  104. return [parseInt(match[1].substring(0, 2), 16), parseInt(match[1].substring(2, 4), 16), parseInt(match[1].substring(4, 6), 16), null];
  105. }
  106. return false;
  107. };
  108. var RGB = /^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/;
  109. var rgb = function rgb(value) {
  110. var match = value.match(RGB);
  111. if (match) {
  112. return [Number(match[1]), Number(match[2]), Number(match[3]), null];
  113. }
  114. return false;
  115. };
  116. var RGBA = /^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d?\.?\d+)\s*\)$/;
  117. var rgba = function rgba(value) {
  118. var match = value.match(RGBA);
  119. if (match && match.length > 4) {
  120. return [Number(match[1]), Number(match[2]), Number(match[3]), Number(match[4])];
  121. }
  122. return false;
  123. };
  124. var fromArray = function fromArray(array) {
  125. return [Math.min(array[0], 255), Math.min(array[1], 255), Math.min(array[2], 255), array.length > 3 ? array[3] : null];
  126. };
  127. var namedColor = function namedColor(name) {
  128. var color = NAMED_COLORS[name.toLowerCase()];
  129. return color ? color : false;
  130. };
  131. var Color = function () {
  132. function Color(value) {
  133. _classCallCheck(this, Color);
  134. var _ref = Array.isArray(value) ? fromArray(value) : hex3(value) || rgb(value) || rgba(value) || namedColor(value) || hex6(value) || [0, 0, 0, null],
  135. _ref2 = _slicedToArray(_ref, 4),
  136. r = _ref2[0],
  137. g = _ref2[1],
  138. b = _ref2[2],
  139. a = _ref2[3];
  140. this.r = r;
  141. this.g = g;
  142. this.b = b;
  143. this.a = a;
  144. }
  145. _createClass(Color, [{
  146. key: 'isTransparent',
  147. value: function isTransparent() {
  148. return this.a === 0;
  149. }
  150. }, {
  151. key: 'toString',
  152. value: function toString() {
  153. return this.a !== null && this.a !== 1 ? 'rgba(' + this.r + ',' + this.g + ',' + this.b + ',' + this.a + ')' : 'rgb(' + this.r + ',' + this.g + ',' + this.b + ')';
  154. }
  155. }]);
  156. return Color;
  157. }();
  158. exports.default = Color;
  159. var NAMED_COLORS = {
  160. transparent: [0, 0, 0, 0],
  161. aliceblue: [240, 248, 255, null],
  162. antiquewhite: [250, 235, 215, null],
  163. aqua: [0, 255, 255, null],
  164. aquamarine: [127, 255, 212, null],
  165. azure: [240, 255, 255, null],
  166. beige: [245, 245, 220, null],
  167. bisque: [255, 228, 196, null],
  168. black: [0, 0, 0, null],
  169. blanchedalmond: [255, 235, 205, null],
  170. blue: [0, 0, 255, null],
  171. blueviolet: [138, 43, 226, null],
  172. brown: [165, 42, 42, null],
  173. burlywood: [222, 184, 135, null],
  174. cadetblue: [95, 158, 160, null],
  175. chartreuse: [127, 255, 0, null],
  176. chocolate: [210, 105, 30, null],
  177. coral: [255, 127, 80, null],
  178. cornflowerblue: [100, 149, 237, null],
  179. cornsilk: [255, 248, 220, null],
  180. crimson: [220, 20, 60, null],
  181. cyan: [0, 255, 255, null],
  182. darkblue: [0, 0, 139, null],
  183. darkcyan: [0, 139, 139, null],
  184. darkgoldenrod: [184, 134, 11, null],
  185. darkgray: [169, 169, 169, null],
  186. darkgreen: [0, 100, 0, null],
  187. darkgrey: [169, 169, 169, null],
  188. darkkhaki: [189, 183, 107, null],
  189. darkmagenta: [139, 0, 139, null],
  190. darkolivegreen: [85, 107, 47, null],
  191. darkorange: [255, 140, 0, null],
  192. darkorchid: [153, 50, 204, null],
  193. darkred: [139, 0, 0, null],
  194. darksalmon: [233, 150, 122, null],
  195. darkseagreen: [143, 188, 143, null],
  196. darkslateblue: [72, 61, 139, null],
  197. darkslategray: [47, 79, 79, null],
  198. darkslategrey: [47, 79, 79, null],
  199. darkturquoise: [0, 206, 209, null],
  200. darkviolet: [148, 0, 211, null],
  201. deeppink: [255, 20, 147, null],
  202. deepskyblue: [0, 191, 255, null],
  203. dimgray: [105, 105, 105, null],
  204. dimgrey: [105, 105, 105, null],
  205. dodgerblue: [30, 144, 255, null],
  206. firebrick: [178, 34, 34, null],
  207. floralwhite: [255, 250, 240, null],
  208. forestgreen: [34, 139, 34, null],
  209. fuchsia: [255, 0, 255, null],
  210. gainsboro: [220, 220, 220, null],
  211. ghostwhite: [248, 248, 255, null],
  212. gold: [255, 215, 0, null],
  213. goldenrod: [218, 165, 32, null],
  214. gray: [128, 128, 128, null],
  215. green: [0, 128, 0, null],
  216. greenyellow: [173, 255, 47, null],
  217. grey: [128, 128, 128, null],
  218. honeydew: [240, 255, 240, null],
  219. hotpink: [255, 105, 180, null],
  220. indianred: [205, 92, 92, null],
  221. indigo: [75, 0, 130, null],
  222. ivory: [255, 255, 240, null],
  223. khaki: [240, 230, 140, null],
  224. lavender: [230, 230, 250, null],
  225. lavenderblush: [255, 240, 245, null],
  226. lawngreen: [124, 252, 0, null],
  227. lemonchiffon: [255, 250, 205, null],
  228. lightblue: [173, 216, 230, null],
  229. lightcoral: [240, 128, 128, null],
  230. lightcyan: [224, 255, 255, null],
  231. lightgoldenrodyellow: [250, 250, 210, null],
  232. lightgray: [211, 211, 211, null],
  233. lightgreen: [144, 238, 144, null],
  234. lightgrey: [211, 211, 211, null],
  235. lightpink: [255, 182, 193, null],
  236. lightsalmon: [255, 160, 122, null],
  237. lightseagreen: [32, 178, 170, null],
  238. lightskyblue: [135, 206, 250, null],
  239. lightslategray: [119, 136, 153, null],
  240. lightslategrey: [119, 136, 153, null],
  241. lightsteelblue: [176, 196, 222, null],
  242. lightyellow: [255, 255, 224, null],
  243. lime: [0, 255, 0, null],
  244. limegreen: [50, 205, 50, null],
  245. linen: [250, 240, 230, null],
  246. magenta: [255, 0, 255, null],
  247. maroon: [128, 0, 0, null],
  248. mediumaquamarine: [102, 205, 170, null],
  249. mediumblue: [0, 0, 205, null],
  250. mediumorchid: [186, 85, 211, null],
  251. mediumpurple: [147, 112, 219, null],
  252. mediumseagreen: [60, 179, 113, null],
  253. mediumslateblue: [123, 104, 238, null],
  254. mediumspringgreen: [0, 250, 154, null],
  255. mediumturquoise: [72, 209, 204, null],
  256. mediumvioletred: [199, 21, 133, null],
  257. midnightblue: [25, 25, 112, null],
  258. mintcream: [245, 255, 250, null],
  259. mistyrose: [255, 228, 225, null],
  260. moccasin: [255, 228, 181, null],
  261. navajowhite: [255, 222, 173, null],
  262. navy: [0, 0, 128, null],
  263. oldlace: [253, 245, 230, null],
  264. olive: [128, 128, 0, null],
  265. olivedrab: [107, 142, 35, null],
  266. orange: [255, 165, 0, null],
  267. orangered: [255, 69, 0, null],
  268. orchid: [218, 112, 214, null],
  269. palegoldenrod: [238, 232, 170, null],
  270. palegreen: [152, 251, 152, null],
  271. paleturquoise: [175, 238, 238, null],
  272. palevioletred: [219, 112, 147, null],
  273. papayawhip: [255, 239, 213, null],
  274. peachpuff: [255, 218, 185, null],
  275. peru: [205, 133, 63, null],
  276. pink: [255, 192, 203, null],
  277. plum: [221, 160, 221, null],
  278. powderblue: [176, 224, 230, null],
  279. purple: [128, 0, 128, null],
  280. rebeccapurple: [102, 51, 153, null],
  281. red: [255, 0, 0, null],
  282. rosybrown: [188, 143, 143, null],
  283. royalblue: [65, 105, 225, null],
  284. saddlebrown: [139, 69, 19, null],
  285. salmon: [250, 128, 114, null],
  286. sandybrown: [244, 164, 96, null],
  287. seagreen: [46, 139, 87, null],
  288. seashell: [255, 245, 238, null],
  289. sienna: [160, 82, 45, null],
  290. silver: [192, 192, 192, null],
  291. skyblue: [135, 206, 235, null],
  292. slateblue: [106, 90, 205, null],
  293. slategray: [112, 128, 144, null],
  294. slategrey: [112, 128, 144, null],
  295. snow: [255, 250, 250, null],
  296. springgreen: [0, 255, 127, null],
  297. steelblue: [70, 130, 180, null],
  298. tan: [210, 180, 140, null],
  299. teal: [0, 128, 128, null],
  300. thistle: [216, 191, 216, null],
  301. tomato: [255, 99, 71, null],
  302. turquoise: [64, 224, 208, null],
  303. violet: [238, 130, 238, null],
  304. wheat: [245, 222, 179, null],
  305. white: [255, 255, 255, null],
  306. whitesmoke: [245, 245, 245, null],
  307. yellow: [255, 255, 0, null],
  308. yellowgreen: [154, 205, 50, null]
  309. };
  310. var TRANSPARENT = exports.TRANSPARENT = new Color([0, 0, 0, 0]);
  311. /***/ }),
  312. /* 1 */
  313. /***/ (function(module, exports, __webpack_require__) {
  314. "use strict";
  315. Object.defineProperty(exports, "__esModule", {
  316. value: true
  317. });
  318. exports.parseBoundCurves = exports.calculatePaddingBoxPath = exports.calculateBorderBoxPath = exports.parsePathForBorder = exports.parseDocumentSize = exports.calculateContentBox = exports.calculatePaddingBox = exports.parseBounds = exports.Bounds = undefined;
  319. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  320. var _Vector = __webpack_require__(7);
  321. var _Vector2 = _interopRequireDefault(_Vector);
  322. var _BezierCurve = __webpack_require__(32);
  323. var _BezierCurve2 = _interopRequireDefault(_BezierCurve);
  324. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  325. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  326. var TOP = 0;
  327. var RIGHT = 1;
  328. var BOTTOM = 2;
  329. var LEFT = 3;
  330. var H = 0;
  331. var V = 1;
  332. var Bounds = exports.Bounds = function () {
  333. function Bounds(x, y, w, h) {
  334. _classCallCheck(this, Bounds);
  335. this.left = x;
  336. this.top = y;
  337. this.width = w;
  338. this.height = h;
  339. }
  340. _createClass(Bounds, null, [{
  341. key: 'fromClientRect',
  342. value: function fromClientRect(clientRect, scrollX, scrollY) {
  343. return new Bounds(clientRect.left + scrollX, clientRect.top + scrollY, clientRect.width, clientRect.height);
  344. }
  345. }]);
  346. return Bounds;
  347. }();
  348. var parseBounds = exports.parseBounds = function parseBounds(node, scrollX, scrollY) {
  349. return Bounds.fromClientRect(node.getBoundingClientRect(), scrollX, scrollY);
  350. };
  351. var calculatePaddingBox = exports.calculatePaddingBox = function calculatePaddingBox(bounds, borders) {
  352. return new Bounds(bounds.left + borders[LEFT].borderWidth, bounds.top + borders[TOP].borderWidth, bounds.width - (borders[RIGHT].borderWidth + borders[LEFT].borderWidth), bounds.height - (borders[TOP].borderWidth + borders[BOTTOM].borderWidth));
  353. };
  354. var calculateContentBox = exports.calculateContentBox = function calculateContentBox(bounds, padding, borders) {
  355. // TODO support percentage paddings
  356. var paddingTop = padding[TOP].value;
  357. var paddingRight = padding[RIGHT].value;
  358. var paddingBottom = padding[BOTTOM].value;
  359. var paddingLeft = padding[LEFT].value;
  360. return new Bounds(bounds.left + paddingLeft + borders[LEFT].borderWidth, bounds.top + paddingTop + borders[TOP].borderWidth, bounds.width - (borders[RIGHT].borderWidth + borders[LEFT].borderWidth + paddingLeft + paddingRight), bounds.height - (borders[TOP].borderWidth + borders[BOTTOM].borderWidth + paddingTop + paddingBottom));
  361. };
  362. var parseDocumentSize = exports.parseDocumentSize = function parseDocumentSize(document) {
  363. var body = document.body;
  364. var documentElement = document.documentElement;
  365. if (!body || !documentElement) {
  366. throw new Error( true ? 'Unable to get document size' : '');
  367. }
  368. var width = Math.max(Math.max(body.scrollWidth, documentElement.scrollWidth), Math.max(body.offsetWidth, documentElement.offsetWidth), Math.max(body.clientWidth, documentElement.clientWidth));
  369. var height = Math.max(Math.max(body.scrollHeight, documentElement.scrollHeight), Math.max(body.offsetHeight, documentElement.offsetHeight), Math.max(body.clientHeight, documentElement.clientHeight));
  370. return new Bounds(0, 0, width, height);
  371. };
  372. var parsePathForBorder = exports.parsePathForBorder = function parsePathForBorder(curves, borderSide) {
  373. switch (borderSide) {
  374. case TOP:
  375. return createPathFromCurves(curves.topLeftOuter, curves.topLeftInner, curves.topRightOuter, curves.topRightInner);
  376. case RIGHT:
  377. return createPathFromCurves(curves.topRightOuter, curves.topRightInner, curves.bottomRightOuter, curves.bottomRightInner);
  378. case BOTTOM:
  379. return createPathFromCurves(curves.bottomRightOuter, curves.bottomRightInner, curves.bottomLeftOuter, curves.bottomLeftInner);
  380. case LEFT:
  381. default:
  382. return createPathFromCurves(curves.bottomLeftOuter, curves.bottomLeftInner, curves.topLeftOuter, curves.topLeftInner);
  383. }
  384. };
  385. var createPathFromCurves = function createPathFromCurves(outer1, inner1, outer2, inner2) {
  386. var path = [];
  387. if (outer1 instanceof _BezierCurve2.default) {
  388. path.push(outer1.subdivide(0.5, false));
  389. } else {
  390. path.push(outer1);
  391. }
  392. if (outer2 instanceof _BezierCurve2.default) {
  393. path.push(outer2.subdivide(0.5, true));
  394. } else {
  395. path.push(outer2);
  396. }
  397. if (inner2 instanceof _BezierCurve2.default) {
  398. path.push(inner2.subdivide(0.5, true).reverse());
  399. } else {
  400. path.push(inner2);
  401. }
  402. if (inner1 instanceof _BezierCurve2.default) {
  403. path.push(inner1.subdivide(0.5, false).reverse());
  404. } else {
  405. path.push(inner1);
  406. }
  407. return path;
  408. };
  409. var calculateBorderBoxPath = exports.calculateBorderBoxPath = function calculateBorderBoxPath(curves) {
  410. return [curves.topLeftOuter, curves.topRightOuter, curves.bottomRightOuter, curves.bottomLeftOuter];
  411. };
  412. var calculatePaddingBoxPath = exports.calculatePaddingBoxPath = function calculatePaddingBoxPath(curves) {
  413. return [curves.topLeftInner, curves.topRightInner, curves.bottomRightInner, curves.bottomLeftInner];
  414. };
  415. var parseBoundCurves = exports.parseBoundCurves = function parseBoundCurves(bounds, borders, borderRadius) {
  416. var tlh = borderRadius[CORNER.TOP_LEFT][H].getAbsoluteValue(bounds.width);
  417. var tlv = borderRadius[CORNER.TOP_LEFT][V].getAbsoluteValue(bounds.height);
  418. var trh = borderRadius[CORNER.TOP_RIGHT][H].getAbsoluteValue(bounds.width);
  419. var trv = borderRadius[CORNER.TOP_RIGHT][V].getAbsoluteValue(bounds.height);
  420. var brh = borderRadius[CORNER.BOTTOM_RIGHT][H].getAbsoluteValue(bounds.width);
  421. var brv = borderRadius[CORNER.BOTTOM_RIGHT][V].getAbsoluteValue(bounds.height);
  422. var blh = borderRadius[CORNER.BOTTOM_LEFT][H].getAbsoluteValue(bounds.width);
  423. var blv = borderRadius[CORNER.BOTTOM_LEFT][V].getAbsoluteValue(bounds.height);
  424. var factors = [];
  425. factors.push((tlh + trh) / bounds.width);
  426. factors.push((blh + brh) / bounds.width);
  427. factors.push((tlv + blv) / bounds.height);
  428. factors.push((trv + brv) / bounds.height);
  429. var maxFactor = Math.max.apply(Math, factors);
  430. if (maxFactor > 1) {
  431. tlh /= maxFactor;
  432. tlv /= maxFactor;
  433. trh /= maxFactor;
  434. trv /= maxFactor;
  435. brh /= maxFactor;
  436. brv /= maxFactor;
  437. blh /= maxFactor;
  438. blv /= maxFactor;
  439. }
  440. var topWidth = bounds.width - trh;
  441. var rightHeight = bounds.height - brv;
  442. var bottomWidth = bounds.width - brh;
  443. var leftHeight = bounds.height - blv;
  444. return {
  445. topLeftOuter: tlh > 0 || tlv > 0 ? getCurvePoints(bounds.left, bounds.top, tlh, tlv, CORNER.TOP_LEFT) : new _Vector2.default(bounds.left, bounds.top),
  446. topLeftInner: tlh > 0 || tlv > 0 ? getCurvePoints(bounds.left + borders[LEFT].borderWidth, bounds.top + borders[TOP].borderWidth, Math.max(0, tlh - borders[LEFT].borderWidth), Math.max(0, tlv - borders[TOP].borderWidth), CORNER.TOP_LEFT) : new _Vector2.default(bounds.left + borders[LEFT].borderWidth, bounds.top + borders[TOP].borderWidth),
  447. topRightOuter: trh > 0 || trv > 0 ? getCurvePoints(bounds.left + topWidth, bounds.top, trh, trv, CORNER.TOP_RIGHT) : new _Vector2.default(bounds.left + bounds.width, bounds.top),
  448. topRightInner: trh > 0 || trv > 0 ? getCurvePoints(bounds.left + Math.min(topWidth, bounds.width + borders[LEFT].borderWidth), bounds.top + borders[TOP].borderWidth, topWidth > bounds.width + borders[LEFT].borderWidth ? 0 : trh - borders[LEFT].borderWidth, trv - borders[TOP].borderWidth, CORNER.TOP_RIGHT) : new _Vector2.default(bounds.left + bounds.width - borders[RIGHT].borderWidth, bounds.top + borders[TOP].borderWidth),
  449. bottomRightOuter: brh > 0 || brv > 0 ? getCurvePoints(bounds.left + bottomWidth, bounds.top + rightHeight, brh, brv, CORNER.BOTTOM_RIGHT) : new _Vector2.default(bounds.left + bounds.width, bounds.top + bounds.height),
  450. bottomRightInner: brh > 0 || brv > 0 ? getCurvePoints(bounds.left + Math.min(bottomWidth, bounds.width - borders[LEFT].borderWidth), bounds.top + Math.min(rightHeight, bounds.height + borders[TOP].borderWidth), Math.max(0, brh - borders[RIGHT].borderWidth), brv - borders[BOTTOM].borderWidth, CORNER.BOTTOM_RIGHT) : new _Vector2.default(bounds.left + bounds.width - borders[RIGHT].borderWidth, bounds.top + bounds.height - borders[BOTTOM].borderWidth),
  451. bottomLeftOuter: blh > 0 || blv > 0 ? getCurvePoints(bounds.left, bounds.top + leftHeight, blh, blv, CORNER.BOTTOM_LEFT) : new _Vector2.default(bounds.left, bounds.top + bounds.height),
  452. bottomLeftInner: blh > 0 || blv > 0 ? getCurvePoints(bounds.left + borders[LEFT].borderWidth, bounds.top + leftHeight, Math.max(0, blh - borders[LEFT].borderWidth), blv - borders[BOTTOM].borderWidth, CORNER.BOTTOM_LEFT) : new _Vector2.default(bounds.left + borders[LEFT].borderWidth, bounds.top + bounds.height - borders[BOTTOM].borderWidth)
  453. };
  454. };
  455. var CORNER = {
  456. TOP_LEFT: 0,
  457. TOP_RIGHT: 1,
  458. BOTTOM_RIGHT: 2,
  459. BOTTOM_LEFT: 3
  460. };
  461. var getCurvePoints = function getCurvePoints(x, y, r1, r2, position) {
  462. var kappa = 4 * ((Math.sqrt(2) - 1) / 3);
  463. var ox = r1 * kappa; // control point offset horizontal
  464. var oy = r2 * kappa; // control point offset vertical
  465. var xm = x + r1; // x-middle
  466. var ym = y + r2; // y-middle
  467. switch (position) {
  468. case CORNER.TOP_LEFT:
  469. return new _BezierCurve2.default(new _Vector2.default(x, ym), new _Vector2.default(x, ym - oy), new _Vector2.default(xm - ox, y), new _Vector2.default(xm, y));
  470. case CORNER.TOP_RIGHT:
  471. return new _BezierCurve2.default(new _Vector2.default(x, y), new _Vector2.default(x + ox, y), new _Vector2.default(xm, ym - oy), new _Vector2.default(xm, ym));
  472. case CORNER.BOTTOM_RIGHT:
  473. return new _BezierCurve2.default(new _Vector2.default(xm, y), new _Vector2.default(xm, y + oy), new _Vector2.default(x + ox, ym), new _Vector2.default(x, ym));
  474. case CORNER.BOTTOM_LEFT:
  475. default:
  476. return new _BezierCurve2.default(new _Vector2.default(xm, ym), new _Vector2.default(xm - ox, ym), new _Vector2.default(x, y + oy), new _Vector2.default(x, y));
  477. }
  478. };
  479. /***/ }),
  480. /* 2 */
  481. /***/ (function(module, exports, __webpack_require__) {
  482. "use strict";
  483. Object.defineProperty(exports, "__esModule", {
  484. value: true
  485. });
  486. exports.calculateLengthFromValueWithUnit = exports.LENGTH_TYPE = undefined;
  487. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  488. var _NodeContainer = __webpack_require__(3);
  489. var _NodeContainer2 = _interopRequireDefault(_NodeContainer);
  490. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  491. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  492. var LENGTH_WITH_UNIT = /([\d.]+)(px|r?em|%)/i;
  493. var LENGTH_TYPE = exports.LENGTH_TYPE = {
  494. PX: 0,
  495. PERCENTAGE: 1
  496. };
  497. var Length = function () {
  498. function Length(value) {
  499. _classCallCheck(this, Length);
  500. this.type = value.substr(value.length - 1) === '%' ? LENGTH_TYPE.PERCENTAGE : LENGTH_TYPE.PX;
  501. var parsedValue = parseFloat(value);
  502. if (true && isNaN(parsedValue)) {
  503. console.error('Invalid value given for Length: "' + value + '"');
  504. }
  505. this.value = isNaN(parsedValue) ? 0 : parsedValue;
  506. }
  507. _createClass(Length, [{
  508. key: 'isPercentage',
  509. value: function isPercentage() {
  510. return this.type === LENGTH_TYPE.PERCENTAGE;
  511. }
  512. }, {
  513. key: 'getAbsoluteValue',
  514. value: function getAbsoluteValue(parentLength) {
  515. return this.isPercentage() ? parentLength * (this.value / 100) : this.value;
  516. }
  517. }], [{
  518. key: 'create',
  519. value: function create(v) {
  520. return new Length(v);
  521. }
  522. }]);
  523. return Length;
  524. }();
  525. exports.default = Length;
  526. var getRootFontSize = function getRootFontSize(container) {
  527. var parent = container.parent;
  528. return parent ? getRootFontSize(parent) : parseFloat(container.style.font.fontSize);
  529. };
  530. var calculateLengthFromValueWithUnit = exports.calculateLengthFromValueWithUnit = function calculateLengthFromValueWithUnit(container, value, unit) {
  531. switch (unit) {
  532. case 'px':
  533. case '%':
  534. return new Length(value + unit);
  535. case 'em':
  536. case 'rem':
  537. var length = new Length(value);
  538. length.value *= unit === 'em' ? parseFloat(container.style.font.fontSize) : getRootFontSize(container);
  539. return length;
  540. default:
  541. // TODO: handle correctly if unknown unit is used
  542. return new Length('0');
  543. }
  544. };
  545. /***/ }),
  546. /* 3 */
  547. /***/ (function(module, exports, __webpack_require__) {
  548. "use strict";
  549. Object.defineProperty(exports, "__esModule", {
  550. value: true
  551. });
  552. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  553. var _Color = __webpack_require__(0);
  554. var _Color2 = _interopRequireDefault(_Color);
  555. var _Util = __webpack_require__(4);
  556. var _background = __webpack_require__(5);
  557. var _border = __webpack_require__(12);
  558. var _borderRadius = __webpack_require__(33);
  559. var _display = __webpack_require__(34);
  560. var _float = __webpack_require__(35);
  561. var _font = __webpack_require__(36);
  562. var _letterSpacing = __webpack_require__(37);
  563. var _lineBreak = __webpack_require__(38);
  564. var _listStyle = __webpack_require__(8);
  565. var _margin = __webpack_require__(39);
  566. var _overflow = __webpack_require__(40);
  567. var _overflowWrap = __webpack_require__(18);
  568. var _padding = __webpack_require__(17);
  569. var _position = __webpack_require__(19);
  570. var _textDecoration = __webpack_require__(11);
  571. var _textShadow = __webpack_require__(41);
  572. var _textTransform = __webpack_require__(20);
  573. var _transform = __webpack_require__(42);
  574. var _visibility = __webpack_require__(43);
  575. var _wordBreak = __webpack_require__(44);
  576. var _zIndex = __webpack_require__(45);
  577. var _Bounds = __webpack_require__(1);
  578. var _Input = __webpack_require__(21);
  579. var _ListItem = __webpack_require__(14);
  580. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  581. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  582. var INPUT_TAGS = ['INPUT', 'TEXTAREA', 'SELECT'];
  583. var NodeContainer = function () {
  584. function NodeContainer(node, parent, resourceLoader, index) {
  585. var _this = this;
  586. _classCallCheck(this, NodeContainer);
  587. this.parent = parent;
  588. this.tagName = node.tagName;
  589. this.index = index;
  590. this.childNodes = [];
  591. this.listItems = [];
  592. if (typeof node.start === 'number') {
  593. this.listStart = node.start;
  594. }
  595. var defaultView = node.ownerDocument.defaultView;
  596. var scrollX = defaultView.pageXOffset;
  597. var scrollY = defaultView.pageYOffset;
  598. var style = defaultView.getComputedStyle(node, null);
  599. var display = (0, _display.parseDisplay)(style.display);
  600. var IS_INPUT = node.type === 'radio' || node.type === 'checkbox';
  601. var position = (0, _position.parsePosition)(style.position);
  602. this.style = {
  603. background: IS_INPUT ? _Input.INPUT_BACKGROUND : (0, _background.parseBackground)(style, resourceLoader),
  604. border: IS_INPUT ? _Input.INPUT_BORDERS : (0, _border.parseBorder)(style),
  605. borderRadius: (node instanceof defaultView.HTMLInputElement || node instanceof HTMLInputElement) && IS_INPUT ? (0, _Input.getInputBorderRadius)(node) : (0, _borderRadius.parseBorderRadius)(style),
  606. color: IS_INPUT ? _Input.INPUT_COLOR : new _Color2.default(style.color),
  607. display: display,
  608. float: (0, _float.parseCSSFloat)(style.float),
  609. font: (0, _font.parseFont)(style),
  610. letterSpacing: (0, _letterSpacing.parseLetterSpacing)(style.letterSpacing),
  611. listStyle: display === _display.DISPLAY.LIST_ITEM ? (0, _listStyle.parseListStyle)(style) : null,
  612. lineBreak: (0, _lineBreak.parseLineBreak)(style.lineBreak),
  613. margin: (0, _margin.parseMargin)(style),
  614. opacity: parseFloat(style.opacity),
  615. overflow: INPUT_TAGS.indexOf(node.tagName) === -1 ? (0, _overflow.parseOverflow)(style.overflow) : _overflow.OVERFLOW.HIDDEN,
  616. overflowWrap: (0, _overflowWrap.parseOverflowWrap)(style.overflowWrap ? style.overflowWrap : style.wordWrap),
  617. padding: (0, _padding.parsePadding)(style),
  618. position: position,
  619. textDecoration: (0, _textDecoration.parseTextDecoration)(style),
  620. textShadow: (0, _textShadow.parseTextShadow)(style.textShadow),
  621. textTransform: (0, _textTransform.parseTextTransform)(style.textTransform),
  622. transform: (0, _transform.parseTransform)(style),
  623. visibility: (0, _visibility.parseVisibility)(style.visibility),
  624. wordBreak: (0, _wordBreak.parseWordBreak)(style.wordBreak),
  625. zIndex: (0, _zIndex.parseZIndex)(position !== _position.POSITION.STATIC ? style.zIndex : 'auto')
  626. };
  627. if (this.isTransformed()) {
  628. // getBoundingClientRect provides values post-transform, we want them without the transformation
  629. node.style.transform = 'matrix(1,0,0,1,0,0)';
  630. }
  631. if (display === _display.DISPLAY.LIST_ITEM) {
  632. var listOwner = (0, _ListItem.getListOwner)(this);
  633. if (listOwner) {
  634. var listIndex = listOwner.listItems.length;
  635. listOwner.listItems.push(this);
  636. this.listIndex = node.hasAttribute('value') && typeof node.value === 'number' ? node.value : listIndex === 0 ? typeof listOwner.listStart === 'number' ? listOwner.listStart : 1 : listOwner.listItems[listIndex - 1].listIndex + 1;
  637. }
  638. }
  639. // TODO move bound retrieval for all nodes to a later stage?
  640. if (node.tagName === 'IMG') {
  641. node.addEventListener('load', function () {
  642. _this.bounds = (0, _Bounds.parseBounds)(node, scrollX, scrollY);
  643. _this.curvedBounds = (0, _Bounds.parseBoundCurves)(_this.bounds, _this.style.border, _this.style.borderRadius);
  644. });
  645. }
  646. this.image = getImage(node, resourceLoader);
  647. this.bounds = IS_INPUT ? (0, _Input.reformatInputBounds)((0, _Bounds.parseBounds)(node, scrollX, scrollY)) : (0, _Bounds.parseBounds)(node, scrollX, scrollY);
  648. this.curvedBounds = (0, _Bounds.parseBoundCurves)(this.bounds, this.style.border, this.style.borderRadius);
  649. if (true) {
  650. this.name = '' + node.tagName.toLowerCase() + (node.id ? '#' + node.id : '') + node.className.toString().split(' ').map(function (s) {
  651. return s.length ? '.' + s : '';
  652. }).join('');
  653. }
  654. }
  655. _createClass(NodeContainer, [{
  656. key: 'getClipPaths',
  657. value: function getClipPaths() {
  658. var parentClips = this.parent ? this.parent.getClipPaths() : [];
  659. var isClipped = this.style.overflow !== _overflow.OVERFLOW.VISIBLE;
  660. return isClipped ? parentClips.concat([(0, _Bounds.calculatePaddingBoxPath)(this.curvedBounds)]) : parentClips;
  661. }
  662. }, {
  663. key: 'isInFlow',
  664. value: function isInFlow() {
  665. return this.isRootElement() && !this.isFloating() && !this.isAbsolutelyPositioned();
  666. }
  667. }, {
  668. key: 'isVisible',
  669. value: function isVisible() {
  670. return !(0, _Util.contains)(this.style.display, _display.DISPLAY.NONE) && this.style.opacity > 0 && this.style.visibility === _visibility.VISIBILITY.VISIBLE;
  671. }
  672. }, {
  673. key: 'isAbsolutelyPositioned',
  674. value: function isAbsolutelyPositioned() {
  675. return this.style.position !== _position.POSITION.STATIC && this.style.position !== _position.POSITION.RELATIVE;
  676. }
  677. }, {
  678. key: 'isPositioned',
  679. value: function isPositioned() {
  680. return this.style.position !== _position.POSITION.STATIC;
  681. }
  682. }, {
  683. key: 'isFloating',
  684. value: function isFloating() {
  685. return this.style.float !== _float.FLOAT.NONE;
  686. }
  687. }, {
  688. key: 'isRootElement',
  689. value: function isRootElement() {
  690. return this.parent === null;
  691. }
  692. }, {
  693. key: 'isTransformed',
  694. value: function isTransformed() {
  695. return this.style.transform !== null;
  696. }
  697. }, {
  698. key: 'isPositionedWithZIndex',
  699. value: function isPositionedWithZIndex() {
  700. return this.isPositioned() && !this.style.zIndex.auto;
  701. }
  702. }, {
  703. key: 'isInlineLevel',
  704. value: function isInlineLevel() {
  705. return (0, _Util.contains)(this.style.display, _display.DISPLAY.INLINE) || (0, _Util.contains)(this.style.display, _display.DISPLAY.INLINE_BLOCK) || (0, _Util.contains)(this.style.display, _display.DISPLAY.INLINE_FLEX) || (0, _Util.contains)(this.style.display, _display.DISPLAY.INLINE_GRID) || (0, _Util.contains)(this.style.display, _display.DISPLAY.INLINE_LIST_ITEM) || (0, _Util.contains)(this.style.display, _display.DISPLAY.INLINE_TABLE);
  706. }
  707. }, {
  708. key: 'isInlineBlockOrInlineTable',
  709. value: function isInlineBlockOrInlineTable() {
  710. return (0, _Util.contains)(this.style.display, _display.DISPLAY.INLINE_BLOCK) || (0, _Util.contains)(this.style.display, _display.DISPLAY.INLINE_TABLE);
  711. }
  712. }]);
  713. return NodeContainer;
  714. }();
  715. exports.default = NodeContainer;
  716. var getImage = function getImage(node, resourceLoader) {
  717. if (node instanceof node.ownerDocument.defaultView.SVGSVGElement || node instanceof SVGSVGElement) {
  718. var s = new XMLSerializer();
  719. return resourceLoader.loadImage('data:image/svg+xml,' + encodeURIComponent(s.serializeToString(node)));
  720. }
  721. switch (node.tagName) {
  722. case 'IMG':
  723. // $FlowFixMe
  724. var img = node;
  725. return resourceLoader.loadImage(img.currentSrc || img.src);
  726. case 'CANVAS':
  727. // $FlowFixMe
  728. var canvas = node;
  729. return resourceLoader.loadCanvas(canvas);
  730. case 'IFRAME':
  731. var iframeKey = node.getAttribute('data-html2canvas-internal-iframe-key');
  732. if (iframeKey) {
  733. return iframeKey;
  734. }
  735. break;
  736. }
  737. return null;
  738. };
  739. /***/ }),
  740. /* 4 */
  741. /***/ (function(module, exports, __webpack_require__) {
  742. "use strict";
  743. Object.defineProperty(exports, "__esModule", {
  744. value: true
  745. });
  746. var contains = exports.contains = function contains(bit, value) {
  747. return (bit & value) !== 0;
  748. };
  749. var distance = exports.distance = function distance(a, b) {
  750. return Math.sqrt(a * a + b * b);
  751. };
  752. var copyCSSStyles = exports.copyCSSStyles = function copyCSSStyles(style, target) {
  753. // Edge does not provide value for cssText
  754. for (var i = style.length - 1; i >= 0; i--) {
  755. var property = style.item(i);
  756. // Safari shows pseudoelements if content is set
  757. if (property !== 'content') {
  758. target.style.setProperty(property, style.getPropertyValue(property));
  759. }
  760. }
  761. return target;
  762. };
  763. var SMALL_IMAGE = exports.SMALL_IMAGE = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7';
  764. /***/ }),
  765. /* 5 */
  766. /***/ (function(module, exports, __webpack_require__) {
  767. "use strict";
  768. Object.defineProperty(exports, "__esModule", {
  769. value: true
  770. });
  771. exports.parseBackgroundImage = exports.parseBackground = exports.calculateBackgroundRepeatPath = exports.calculateBackgroundPosition = exports.calculateBackgroungPositioningArea = exports.calculateBackgroungPaintingArea = exports.calculateGradientBackgroundSize = exports.calculateBackgroundSize = exports.BACKGROUND_ORIGIN = exports.BACKGROUND_CLIP = exports.BACKGROUND_SIZE = exports.BACKGROUND_REPEAT = undefined;
  772. var _Color = __webpack_require__(0);
  773. var _Color2 = _interopRequireDefault(_Color);
  774. var _Length = __webpack_require__(2);
  775. var _Length2 = _interopRequireDefault(_Length);
  776. var _Size = __webpack_require__(31);
  777. var _Size2 = _interopRequireDefault(_Size);
  778. var _Vector = __webpack_require__(7);
  779. var _Vector2 = _interopRequireDefault(_Vector);
  780. var _Bounds = __webpack_require__(1);
  781. var _padding = __webpack_require__(17);
  782. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  783. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  784. var BACKGROUND_REPEAT = exports.BACKGROUND_REPEAT = {
  785. REPEAT: 0,
  786. NO_REPEAT: 1,
  787. REPEAT_X: 2,
  788. REPEAT_Y: 3
  789. };
  790. var BACKGROUND_SIZE = exports.BACKGROUND_SIZE = {
  791. AUTO: 0,
  792. CONTAIN: 1,
  793. COVER: 2,
  794. LENGTH: 3
  795. };
  796. var BACKGROUND_CLIP = exports.BACKGROUND_CLIP = {
  797. BORDER_BOX: 0,
  798. PADDING_BOX: 1,
  799. CONTENT_BOX: 2
  800. };
  801. var BACKGROUND_ORIGIN = exports.BACKGROUND_ORIGIN = BACKGROUND_CLIP;
  802. var AUTO = 'auto';
  803. var BackgroundSize = function BackgroundSize(size) {
  804. _classCallCheck(this, BackgroundSize);
  805. switch (size) {
  806. case 'contain':
  807. this.size = BACKGROUND_SIZE.CONTAIN;
  808. break;
  809. case 'cover':
  810. this.size = BACKGROUND_SIZE.COVER;
  811. break;
  812. case 'auto':
  813. this.size = BACKGROUND_SIZE.AUTO;
  814. break;
  815. default:
  816. this.value = new _Length2.default(size);
  817. }
  818. };
  819. var calculateBackgroundSize = exports.calculateBackgroundSize = function calculateBackgroundSize(backgroundImage, image, bounds) {
  820. var width = 0;
  821. var height = 0;
  822. var size = backgroundImage.size;
  823. if (size[0].size === BACKGROUND_SIZE.CONTAIN || size[0].size === BACKGROUND_SIZE.COVER) {
  824. var targetRatio = bounds.width / bounds.height;
  825. var currentRatio = image.width / image.height;
  826. return targetRatio < currentRatio !== (size[0].size === BACKGROUND_SIZE.COVER) ? new _Size2.default(bounds.width, bounds.width / currentRatio) : new _Size2.default(bounds.height * currentRatio, bounds.height);
  827. }
  828. if (size[0].value) {
  829. width = size[0].value.getAbsoluteValue(bounds.width);
  830. }
  831. if (size[0].size === BACKGROUND_SIZE.AUTO && size[1].size === BACKGROUND_SIZE.AUTO) {
  832. height = image.height;
  833. } else if (size[1].size === BACKGROUND_SIZE.AUTO) {
  834. height = width / image.width * image.height;
  835. } else if (size[1].value) {
  836. height = size[1].value.getAbsoluteValue(bounds.height);
  837. }
  838. if (size[0].size === BACKGROUND_SIZE.AUTO) {
  839. width = height / image.height * image.width;
  840. }
  841. return new _Size2.default(width, height);
  842. };
  843. var calculateGradientBackgroundSize = exports.calculateGradientBackgroundSize = function calculateGradientBackgroundSize(backgroundImage, bounds) {
  844. var size = backgroundImage.size;
  845. var width = size[0].value ? size[0].value.getAbsoluteValue(bounds.width) : bounds.width;
  846. var height = size[1].value ? size[1].value.getAbsoluteValue(bounds.height) : size[0].value ? width : bounds.height;
  847. return new _Size2.default(width, height);
  848. };
  849. var AUTO_SIZE = new BackgroundSize(AUTO);
  850. var calculateBackgroungPaintingArea = exports.calculateBackgroungPaintingArea = function calculateBackgroungPaintingArea(curves, clip) {
  851. switch (clip) {
  852. case BACKGROUND_CLIP.BORDER_BOX:
  853. return (0, _Bounds.calculateBorderBoxPath)(curves);
  854. case BACKGROUND_CLIP.PADDING_BOX:
  855. default:
  856. return (0, _Bounds.calculatePaddingBoxPath)(curves);
  857. }
  858. };
  859. var calculateBackgroungPositioningArea = exports.calculateBackgroungPositioningArea = function calculateBackgroungPositioningArea(backgroundOrigin, bounds, padding, border) {
  860. var paddingBox = (0, _Bounds.calculatePaddingBox)(bounds, border);
  861. switch (backgroundOrigin) {
  862. case BACKGROUND_ORIGIN.BORDER_BOX:
  863. return bounds;
  864. case BACKGROUND_ORIGIN.CONTENT_BOX:
  865. var paddingLeft = padding[_padding.PADDING_SIDES.LEFT].getAbsoluteValue(bounds.width);
  866. var paddingRight = padding[_padding.PADDING_SIDES.RIGHT].getAbsoluteValue(bounds.width);
  867. var paddingTop = padding[_padding.PADDING_SIDES.TOP].getAbsoluteValue(bounds.width);
  868. var paddingBottom = padding[_padding.PADDING_SIDES.BOTTOM].getAbsoluteValue(bounds.width);
  869. return new _Bounds.Bounds(paddingBox.left + paddingLeft, paddingBox.top + paddingTop, paddingBox.width - paddingLeft - paddingRight, paddingBox.height - paddingTop - paddingBottom);
  870. case BACKGROUND_ORIGIN.PADDING_BOX:
  871. default:
  872. return paddingBox;
  873. }
  874. };
  875. var calculateBackgroundPosition = exports.calculateBackgroundPosition = function calculateBackgroundPosition(position, size, bounds) {
  876. return new _Vector2.default(position[0].getAbsoluteValue(bounds.width - size.width), position[1].getAbsoluteValue(bounds.height - size.height));
  877. };
  878. var calculateBackgroundRepeatPath = exports.calculateBackgroundRepeatPath = function calculateBackgroundRepeatPath(background, position, size, backgroundPositioningArea, bounds) {
  879. var repeat = background.repeat;
  880. switch (repeat) {
  881. case BACKGROUND_REPEAT.REPEAT_X:
  882. return [new _Vector2.default(Math.round(bounds.left), Math.round(backgroundPositioningArea.top + position.y)), new _Vector2.default(Math.round(bounds.left + bounds.width), Math.round(backgroundPositioningArea.top + position.y)), new _Vector2.default(Math.round(bounds.left + bounds.width), Math.round(size.height + backgroundPositioningArea.top + position.y)), new _Vector2.default(Math.round(bounds.left), Math.round(size.height + backgroundPositioningArea.top + position.y))];
  883. case BACKGROUND_REPEAT.REPEAT_Y:
  884. return [new _Vector2.default(Math.round(backgroundPositioningArea.left + position.x), Math.round(bounds.top)), new _Vector2.default(Math.round(backgroundPositioningArea.left + position.x + size.width), Math.round(bounds.top)), new _Vector2.default(Math.round(backgroundPositioningArea.left + position.x + size.width), Math.round(bounds.height + bounds.top)), new _Vector2.default(Math.round(backgroundPositioningArea.left + position.x), Math.round(bounds.height + bounds.top))];
  885. case BACKGROUND_REPEAT.NO_REPEAT:
  886. return [new _Vector2.default(Math.round(backgroundPositioningArea.left + position.x), Math.round(backgroundPositioningArea.top + position.y)), new _Vector2.default(Math.round(backgroundPositioningArea.left + position.x + size.width), Math.round(backgroundPositioningArea.top + position.y)), new _Vector2.default(Math.round(backgroundPositioningArea.left + position.x + size.width), Math.round(backgroundPositioningArea.top + position.y + size.height)), new _Vector2.default(Math.round(backgroundPositioningArea.left + position.x), Math.round(backgroundPositioningArea.top + position.y + size.height))];
  887. default:
  888. return [new _Vector2.default(Math.round(bounds.left), Math.round(bounds.top)), new _Vector2.default(Math.round(bounds.left + bounds.width), Math.round(bounds.top)), new _Vector2.default(Math.round(bounds.left + bounds.width), Math.round(bounds.height + bounds.top)), new _Vector2.default(Math.round(bounds.left), Math.round(bounds.height + bounds.top))];
  889. }
  890. };
  891. var parseBackground = exports.parseBackground = function parseBackground(style, resourceLoader) {
  892. return {
  893. backgroundColor: new _Color2.default(style.backgroundColor),
  894. backgroundImage: parseBackgroundImages(style, resourceLoader),
  895. backgroundClip: parseBackgroundClip(style.backgroundClip),
  896. backgroundOrigin: parseBackgroundOrigin(style.backgroundOrigin)
  897. };
  898. };
  899. var parseBackgroundClip = function parseBackgroundClip(backgroundClip) {
  900. switch (backgroundClip) {
  901. case 'padding-box':
  902. return BACKGROUND_CLIP.PADDING_BOX;
  903. case 'content-box':
  904. return BACKGROUND_CLIP.CONTENT_BOX;
  905. }
  906. return BACKGROUND_CLIP.BORDER_BOX;
  907. };
  908. var parseBackgroundOrigin = function parseBackgroundOrigin(backgroundOrigin) {
  909. switch (backgroundOrigin) {
  910. case 'padding-box':
  911. return BACKGROUND_ORIGIN.PADDING_BOX;
  912. case 'content-box':
  913. return BACKGROUND_ORIGIN.CONTENT_BOX;
  914. }
  915. return BACKGROUND_ORIGIN.BORDER_BOX;
  916. };
  917. var parseBackgroundRepeat = function parseBackgroundRepeat(backgroundRepeat) {
  918. switch (backgroundRepeat.trim()) {
  919. case 'no-repeat':
  920. return BACKGROUND_REPEAT.NO_REPEAT;
  921. case 'repeat-x':
  922. case 'repeat no-repeat':
  923. return BACKGROUND_REPEAT.REPEAT_X;
  924. case 'repeat-y':
  925. case 'no-repeat repeat':
  926. return BACKGROUND_REPEAT.REPEAT_Y;
  927. case 'repeat':
  928. return BACKGROUND_REPEAT.REPEAT;
  929. }
  930. if (true) {
  931. console.error('Invalid background-repeat value "' + backgroundRepeat + '"');
  932. }
  933. return BACKGROUND_REPEAT.REPEAT;
  934. };
  935. var parseBackgroundImages = function parseBackgroundImages(style, resourceLoader) {
  936. var sources = parseBackgroundImage(style.backgroundImage).map(function (backgroundImage) {
  937. if (backgroundImage.method === 'url') {
  938. var key = resourceLoader.loadImage(backgroundImage.args[0]);
  939. backgroundImage.args = key ? [key] : [];
  940. }
  941. return backgroundImage;
  942. });
  943. var positions = style.backgroundPosition.split(',');
  944. var repeats = style.backgroundRepeat.split(',');
  945. var sizes = style.backgroundSize.split(',');
  946. return sources.map(function (source, index) {
  947. var size = (sizes[index] || AUTO).trim().split(' ').map(parseBackgroundSize);
  948. var position = (positions[index] || AUTO).trim().split(' ').map(parseBackgoundPosition);
  949. return {
  950. source: source,
  951. repeat: parseBackgroundRepeat(typeof repeats[index] === 'string' ? repeats[index] : repeats[0]),
  952. size: size.length < 2 ? [size[0], AUTO_SIZE] : [size[0], size[1]],
  953. position: position.length < 2 ? [position[0], position[0]] : [position[0], position[1]]
  954. };
  955. });
  956. };
  957. var parseBackgroundSize = function parseBackgroundSize(size) {
  958. return size === 'auto' ? AUTO_SIZE : new BackgroundSize(size);
  959. };
  960. var parseBackgoundPosition = function parseBackgoundPosition(position) {
  961. switch (position) {
  962. case 'bottom':
  963. case 'right':
  964. return new _Length2.default('100%');
  965. case 'left':
  966. case 'top':
  967. return new _Length2.default('0%');
  968. case 'auto':
  969. return new _Length2.default('0');
  970. }
  971. return new _Length2.default(position);
  972. };
  973. var parseBackgroundImage = exports.parseBackgroundImage = function parseBackgroundImage(image) {
  974. var whitespace = /^\s$/;
  975. var results = [];
  976. var args = [];
  977. var method = '';
  978. var quote = null;
  979. var definition = '';
  980. var mode = 0;
  981. var numParen = 0;
  982. var appendResult = function appendResult() {
  983. var prefix = '';
  984. if (method) {
  985. if (definition.substr(0, 1) === '"') {
  986. definition = definition.substr(1, definition.length - 2);
  987. }
  988. if (definition) {
  989. args.push(definition.trim());
  990. }
  991. var prefix_i = method.indexOf('-', 1) + 1;
  992. if (method.substr(0, 1) === '-' && prefix_i > 0) {
  993. prefix = method.substr(0, prefix_i).toLowerCase();
  994. method = method.substr(prefix_i);
  995. }
  996. method = method.toLowerCase();
  997. if (method !== 'none') {
  998. results.push({
  999. prefix: prefix,
  1000. method: method,
  1001. args: args
  1002. });
  1003. }
  1004. }
  1005. args = [];
  1006. method = definition = '';
  1007. };
  1008. image.split('').forEach(function (c) {
  1009. if (mode === 0 && whitespace.test(c)) {
  1010. return;
  1011. }
  1012. switch (c) {
  1013. case '"':
  1014. if (!quote) {
  1015. quote = c;
  1016. } else if (quote === c) {
  1017. quote = null;
  1018. }
  1019. break;
  1020. case '(':
  1021. if (quote) {
  1022. break;
  1023. } else if (mode === 0) {
  1024. mode = 1;
  1025. return;
  1026. } else {
  1027. numParen++;
  1028. }
  1029. break;
  1030. case ')':
  1031. if (quote) {
  1032. break;
  1033. } else if (mode === 1) {
  1034. if (numParen === 0) {
  1035. mode = 0;
  1036. appendResult();
  1037. return;
  1038. } else {
  1039. numParen--;
  1040. }
  1041. }
  1042. break;
  1043. case ',':
  1044. if (quote) {
  1045. break;
  1046. } else if (mode === 0) {
  1047. appendResult();
  1048. return;
  1049. } else if (mode === 1) {
  1050. if (numParen === 0 && !method.match(/^url$/i)) {
  1051. args.push(definition.trim());
  1052. definition = '';
  1053. return;
  1054. }
  1055. }
  1056. break;
  1057. }
  1058. if (mode === 0) {
  1059. method += c;
  1060. } else {
  1061. definition += c;
  1062. }
  1063. });
  1064. appendResult();
  1065. return results;
  1066. };
  1067. /***/ }),
  1068. /* 6 */
  1069. /***/ (function(module, exports, __webpack_require__) {
  1070. "use strict";
  1071. Object.defineProperty(exports, "__esModule", {
  1072. value: true
  1073. });
  1074. var PATH = exports.PATH = {
  1075. VECTOR: 0,
  1076. BEZIER_CURVE: 1,
  1077. CIRCLE: 2
  1078. };
  1079. /***/ }),
  1080. /* 7 */
  1081. /***/ (function(module, exports, __webpack_require__) {
  1082. "use strict";
  1083. Object.defineProperty(exports, "__esModule", {
  1084. value: true
  1085. });
  1086. var _Path = __webpack_require__(6);
  1087. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1088. var Vector = function Vector(x, y) {
  1089. _classCallCheck(this, Vector);
  1090. this.type = _Path.PATH.VECTOR;
  1091. this.x = x;
  1092. this.y = y;
  1093. if (true) {
  1094. if (isNaN(x)) {
  1095. console.error('Invalid x value given for Vector');
  1096. }
  1097. if (isNaN(y)) {
  1098. console.error('Invalid y value given for Vector');
  1099. }
  1100. }
  1101. };
  1102. exports.default = Vector;
  1103. /***/ }),
  1104. /* 8 */
  1105. /***/ (function(module, exports, __webpack_require__) {
  1106. "use strict";
  1107. Object.defineProperty(exports, "__esModule", {
  1108. value: true
  1109. });
  1110. exports.parseListStyle = exports.parseListStyleType = exports.LIST_STYLE_TYPE = exports.LIST_STYLE_POSITION = undefined;
  1111. var _background = __webpack_require__(5);
  1112. var LIST_STYLE_POSITION = exports.LIST_STYLE_POSITION = {
  1113. INSIDE: 0,
  1114. OUTSIDE: 1
  1115. };
  1116. var LIST_STYLE_TYPE = exports.LIST_STYLE_TYPE = {
  1117. NONE: -1,
  1118. DISC: 0,
  1119. CIRCLE: 1,
  1120. SQUARE: 2,
  1121. DECIMAL: 3,
  1122. CJK_DECIMAL: 4,
  1123. DECIMAL_LEADING_ZERO: 5,
  1124. LOWER_ROMAN: 6,
  1125. UPPER_ROMAN: 7,
  1126. LOWER_GREEK: 8,
  1127. LOWER_ALPHA: 9,
  1128. UPPER_ALPHA: 10,
  1129. ARABIC_INDIC: 11,
  1130. ARMENIAN: 12,
  1131. BENGALI: 13,
  1132. CAMBODIAN: 14,
  1133. CJK_EARTHLY_BRANCH: 15,
  1134. CJK_HEAVENLY_STEM: 16,
  1135. CJK_IDEOGRAPHIC: 17,
  1136. DEVANAGARI: 18,
  1137. ETHIOPIC_NUMERIC: 19,
  1138. GEORGIAN: 20,
  1139. GUJARATI: 21,
  1140. GURMUKHI: 22,
  1141. HEBREW: 22,
  1142. HIRAGANA: 23,
  1143. HIRAGANA_IROHA: 24,
  1144. JAPANESE_FORMAL: 25,
  1145. JAPANESE_INFORMAL: 26,
  1146. KANNADA: 27,
  1147. KATAKANA: 28,
  1148. KATAKANA_IROHA: 29,
  1149. KHMER: 30,
  1150. KOREAN_HANGUL_FORMAL: 31,
  1151. KOREAN_HANJA_FORMAL: 32,
  1152. KOREAN_HANJA_INFORMAL: 33,
  1153. LAO: 34,
  1154. LOWER_ARMENIAN: 35,
  1155. MALAYALAM: 36,
  1156. MONGOLIAN: 37,
  1157. MYANMAR: 38,
  1158. ORIYA: 39,
  1159. PERSIAN: 40,
  1160. SIMP_CHINESE_FORMAL: 41,
  1161. SIMP_CHINESE_INFORMAL: 42,
  1162. TAMIL: 43,
  1163. TELUGU: 44,
  1164. THAI: 45,
  1165. TIBETAN: 46,
  1166. TRAD_CHINESE_FORMAL: 47,
  1167. TRAD_CHINESE_INFORMAL: 48,
  1168. UPPER_ARMENIAN: 49,
  1169. DISCLOSURE_OPEN: 50,
  1170. DISCLOSURE_CLOSED: 51
  1171. };
  1172. var parseListStyleType = exports.parseListStyleType = function parseListStyleType(type) {
  1173. switch (type) {
  1174. case 'disc':
  1175. return LIST_STYLE_TYPE.DISC;
  1176. case 'circle':
  1177. return LIST_STYLE_TYPE.CIRCLE;
  1178. case 'square':
  1179. return LIST_STYLE_TYPE.SQUARE;
  1180. case 'decimal':
  1181. return LIST_STYLE_TYPE.DECIMAL;
  1182. case 'cjk-decimal':
  1183. return LIST_STYLE_TYPE.CJK_DECIMAL;
  1184. case 'decimal-leading-zero':
  1185. return LIST_STYLE_TYPE.DECIMAL_LEADING_ZERO;
  1186. case 'lower-roman':
  1187. return LIST_STYLE_TYPE.LOWER_ROMAN;
  1188. case 'upper-roman':
  1189. return LIST_STYLE_TYPE.UPPER_ROMAN;
  1190. case 'lower-greek':
  1191. return LIST_STYLE_TYPE.LOWER_GREEK;
  1192. case 'lower-alpha':
  1193. return LIST_STYLE_TYPE.LOWER_ALPHA;
  1194. case 'upper-alpha':
  1195. return LIST_STYLE_TYPE.UPPER_ALPHA;
  1196. case 'arabic-indic':
  1197. return LIST_STYLE_TYPE.ARABIC_INDIC;
  1198. case 'armenian':
  1199. return LIST_STYLE_TYPE.ARMENIAN;
  1200. case 'bengali':
  1201. return LIST_STYLE_TYPE.BENGALI;
  1202. case 'cambodian':
  1203. return LIST_STYLE_TYPE.CAMBODIAN;
  1204. case 'cjk-earthly-branch':
  1205. return LIST_STYLE_TYPE.CJK_EARTHLY_BRANCH;
  1206. case 'cjk-heavenly-stem':
  1207. return LIST_STYLE_TYPE.CJK_HEAVENLY_STEM;
  1208. case 'cjk-ideographic':
  1209. return LIST_STYLE_TYPE.CJK_IDEOGRAPHIC;
  1210. case 'devanagari':
  1211. return LIST_STYLE_TYPE.DEVANAGARI;
  1212. case 'ethiopic-numeric':
  1213. return LIST_STYLE_TYPE.ETHIOPIC_NUMERIC;
  1214. case 'georgian':
  1215. return LIST_STYLE_TYPE.GEORGIAN;
  1216. case 'gujarati':
  1217. return LIST_STYLE_TYPE.GUJARATI;
  1218. case 'gurmukhi':
  1219. return LIST_STYLE_TYPE.GURMUKHI;
  1220. case 'hebrew':
  1221. return LIST_STYLE_TYPE.HEBREW;
  1222. case 'hiragana':
  1223. return LIST_STYLE_TYPE.HIRAGANA;
  1224. case 'hiragana-iroha':
  1225. return LIST_STYLE_TYPE.HIRAGANA_IROHA;
  1226. case 'japanese-formal':
  1227. return LIST_STYLE_TYPE.JAPANESE_FORMAL;
  1228. case 'japanese-informal':
  1229. return LIST_STYLE_TYPE.JAPANESE_INFORMAL;
  1230. case 'kannada':
  1231. return LIST_STYLE_TYPE.KANNADA;
  1232. case 'katakana':
  1233. return LIST_STYLE_TYPE.KATAKANA;
  1234. case 'katakana-iroha':
  1235. return LIST_STYLE_TYPE.KATAKANA_IROHA;
  1236. case 'khmer':
  1237. return LIST_STYLE_TYPE.KHMER;
  1238. case 'korean-hangul-formal':
  1239. return LIST_STYLE_TYPE.KOREAN_HANGUL_FORMAL;
  1240. case 'korean-hanja-formal':
  1241. return LIST_STYLE_TYPE.KOREAN_HANJA_FORMAL;
  1242. case 'korean-hanja-informal':
  1243. return LIST_STYLE_TYPE.KOREAN_HANJA_INFORMAL;
  1244. case 'lao':
  1245. return LIST_STYLE_TYPE.LAO;
  1246. case 'lower-armenian':
  1247. return LIST_STYLE_TYPE.LOWER_ARMENIAN;
  1248. case 'malayalam':
  1249. return LIST_STYLE_TYPE.MALAYALAM;
  1250. case 'mongolian':
  1251. return LIST_STYLE_TYPE.MONGOLIAN;
  1252. case 'myanmar':
  1253. return LIST_STYLE_TYPE.MYANMAR;
  1254. case 'oriya':
  1255. return LIST_STYLE_TYPE.ORIYA;
  1256. case 'persian':
  1257. return LIST_STYLE_TYPE.PERSIAN;
  1258. case 'simp-chinese-formal':
  1259. return LIST_STYLE_TYPE.SIMP_CHINESE_FORMAL;
  1260. case 'simp-chinese-informal':
  1261. return LIST_STYLE_TYPE.SIMP_CHINESE_INFORMAL;
  1262. case 'tamil':
  1263. return LIST_STYLE_TYPE.TAMIL;
  1264. case 'telugu':
  1265. return LIST_STYLE_TYPE.TELUGU;
  1266. case 'thai':
  1267. return LIST_STYLE_TYPE.THAI;
  1268. case 'tibetan':
  1269. return LIST_STYLE_TYPE.TIBETAN;
  1270. case 'trad-chinese-formal':
  1271. return LIST_STYLE_TYPE.TRAD_CHINESE_FORMAL;
  1272. case 'trad-chinese-informal':
  1273. return LIST_STYLE_TYPE.TRAD_CHINESE_INFORMAL;
  1274. case 'upper-armenian':
  1275. return LIST_STYLE_TYPE.UPPER_ARMENIAN;
  1276. case 'disclosure-open':
  1277. return LIST_STYLE_TYPE.DISCLOSURE_OPEN;
  1278. case 'disclosure-closed':
  1279. return LIST_STYLE_TYPE.DISCLOSURE_CLOSED;
  1280. case 'none':
  1281. default:
  1282. return LIST_STYLE_TYPE.NONE;
  1283. }
  1284. };
  1285. var parseListStyle = exports.parseListStyle = function parseListStyle(style) {
  1286. var listStyleImage = (0, _background.parseBackgroundImage)(style.getPropertyValue('list-style-image'));
  1287. return {
  1288. listStyleType: parseListStyleType(style.getPropertyValue('list-style-type')),
  1289. listStyleImage: listStyleImage.length ? listStyleImage[0] : null,
  1290. listStylePosition: parseListStylePosition(style.getPropertyValue('list-style-position'))
  1291. };
  1292. };
  1293. var parseListStylePosition = function parseListStylePosition(position) {
  1294. switch (position) {
  1295. case 'inside':
  1296. return LIST_STYLE_POSITION.INSIDE;
  1297. case 'outside':
  1298. default:
  1299. return LIST_STYLE_POSITION.OUTSIDE;
  1300. }
  1301. };
  1302. /***/ }),
  1303. /* 9 */
  1304. /***/ (function(module, exports, __webpack_require__) {
  1305. "use strict";
  1306. Object.defineProperty(exports, "__esModule", {
  1307. value: true
  1308. });
  1309. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  1310. var _textTransform = __webpack_require__(20);
  1311. var _TextBounds = __webpack_require__(22);
  1312. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1313. var TextContainer = function () {
  1314. function TextContainer(text, parent, bounds) {
  1315. _classCallCheck(this, TextContainer);
  1316. this.text = text;
  1317. this.parent = parent;
  1318. this.bounds = bounds;
  1319. }
  1320. _createClass(TextContainer, null, [{
  1321. key: 'fromTextNode',
  1322. value: function fromTextNode(node, parent) {
  1323. var text = transform(node.data, parent.style.textTransform);
  1324. return new TextContainer(text, parent, (0, _TextBounds.parseTextBounds)(text, parent, node));
  1325. }
  1326. }]);
  1327. return TextContainer;
  1328. }();
  1329. exports.default = TextContainer;
  1330. var CAPITALIZE = /(^|\s|:|-|\(|\))([a-z])/g;
  1331. var transform = function transform(text, _transform) {
  1332. switch (_transform) {
  1333. case _textTransform.TEXT_TRANSFORM.LOWERCASE:
  1334. return text.toLowerCase();
  1335. case _textTransform.TEXT_TRANSFORM.CAPITALIZE:
  1336. return text.replace(CAPITALIZE, capitalize);
  1337. case _textTransform.TEXT_TRANSFORM.UPPERCASE:
  1338. return text.toUpperCase();
  1339. default:
  1340. return text;
  1341. }
  1342. };
  1343. function capitalize(m, p1, p2) {
  1344. if (m.length > 0) {
  1345. return p1 + p2.toUpperCase();
  1346. }
  1347. return m;
  1348. }
  1349. /***/ }),
  1350. /* 10 */
  1351. /***/ (function(module, exports, __webpack_require__) {
  1352. "use strict";
  1353. Object.defineProperty(exports, "__esModule", {
  1354. value: true
  1355. });
  1356. var _ForeignObjectRenderer = __webpack_require__(23);
  1357. var testRangeBounds = function testRangeBounds(document) {
  1358. var TEST_HEIGHT = 123;
  1359. if (document.createRange) {
  1360. var range = document.createRange();
  1361. if (range.getBoundingClientRect) {
  1362. var testElement = document.createElement('boundtest');
  1363. testElement.style.height = TEST_HEIGHT + 'px';
  1364. testElement.style.display = 'block';
  1365. document.body.appendChild(testElement);
  1366. range.selectNode(testElement);
  1367. var rangeBounds = range.getBoundingClientRect();
  1368. var rangeHeight = Math.round(rangeBounds.height);
  1369. document.body.removeChild(testElement);
  1370. if (rangeHeight === TEST_HEIGHT) {
  1371. return true;
  1372. }
  1373. }
  1374. }
  1375. return false;
  1376. };
  1377. // iOS 10.3 taints canvas with base64 images unless crossOrigin = 'anonymous'
  1378. var testBase64 = function testBase64(document, src) {
  1379. var img = new Image();
  1380. var canvas = document.createElement('canvas');
  1381. var ctx = canvas.getContext('2d');
  1382. return new Promise(function (resolve) {
  1383. // Single pixel base64 image renders fine on iOS 10.3???
  1384. img.src = src;
  1385. var onload = function onload() {
  1386. try {
  1387. ctx.drawImage(img, 0, 0);
  1388. canvas.toDataURL();
  1389. } catch (e) {
  1390. return resolve(false);
  1391. }
  1392. return resolve(true);
  1393. };
  1394. img.onload = onload;
  1395. img.onerror = function () {
  1396. return resolve(false);
  1397. };
  1398. if (img.complete === true) {
  1399. setTimeout(function () {
  1400. onload();
  1401. }, 500);
  1402. }
  1403. });
  1404. };
  1405. var testCORS = function testCORS() {
  1406. return typeof new Image().crossOrigin !== 'undefined';
  1407. };
  1408. var testResponseType = function testResponseType() {
  1409. return typeof new XMLHttpRequest().responseType === 'string';
  1410. };
  1411. var testSVG = function testSVG(document) {
  1412. var img = new Image();
  1413. var canvas = document.createElement('canvas');
  1414. var ctx = canvas.getContext('2d');
  1415. img.src = 'data:image/svg+xml,<svg xmlns=\'http://www.w3.org/2000/svg\'></svg>';
  1416. try {
  1417. ctx.drawImage(img, 0, 0);
  1418. canvas.toDataURL();
  1419. } catch (e) {
  1420. return false;
  1421. }
  1422. return true;
  1423. };
  1424. var isGreenPixel = function isGreenPixel(data) {
  1425. return data[0] === 0 && data[1] === 255 && data[2] === 0 && data[3] === 255;
  1426. };
  1427. var testForeignObject = function testForeignObject(document) {
  1428. var canvas = document.createElement('canvas');
  1429. var size = 100;
  1430. canvas.width = size;
  1431. canvas.height = size;
  1432. var ctx = canvas.getContext('2d');
  1433. ctx.fillStyle = 'rgb(0, 255, 0)';
  1434. ctx.fillRect(0, 0, size, size);
  1435. var img = new Image();
  1436. var greenImageSrc = canvas.toDataURL();
  1437. img.src = greenImageSrc;
  1438. var svg = (0, _ForeignObjectRenderer.createForeignObjectSVG)(size, size, 0, 0, img);
  1439. ctx.fillStyle = 'red';
  1440. ctx.fillRect(0, 0, size, size);
  1441. return (0, _ForeignObjectRenderer.loadSerializedSVG)(svg).then(function (img) {
  1442. ctx.drawImage(img, 0, 0);
  1443. var data = ctx.getImageData(0, 0, size, size).data;
  1444. ctx.fillStyle = 'red';
  1445. ctx.fillRect(0, 0, size, size);
  1446. var node = document.createElement('div');
  1447. node.style.backgroundImage = 'url(' + greenImageSrc + ')';
  1448. node.style.height = size + 'px';
  1449. // Firefox 55 does not render inline <img /> tags
  1450. return isGreenPixel(data) ? (0, _ForeignObjectRenderer.loadSerializedSVG)((0, _ForeignObjectRenderer.createForeignObjectSVG)(size, size, 0, 0, node)) : Promise.reject(false);
  1451. }).then(function (img) {
  1452. ctx.drawImage(img, 0, 0);
  1453. // Edge does not render background-images
  1454. return isGreenPixel(ctx.getImageData(0, 0, size, size).data);
  1455. }).catch(function (e) {
  1456. return false;
  1457. });
  1458. };
  1459. var FEATURES = {
  1460. // $FlowFixMe - get/set properties not yet supported
  1461. get SUPPORT_RANGE_BOUNDS() {
  1462. 'use strict';
  1463. var value = testRangeBounds(document);
  1464. Object.defineProperty(FEATURES, 'SUPPORT_RANGE_BOUNDS', { value: value });
  1465. return value;
  1466. },
  1467. // $FlowFixMe - get/set properties not yet supported
  1468. get SUPPORT_SVG_DRAWING() {
  1469. 'use strict';
  1470. var value = testSVG(document);
  1471. Object.defineProperty(FEATURES, 'SUPPORT_SVG_DRAWING', { value: value });
  1472. return value;
  1473. },
  1474. // $FlowFixMe - get/set properties not yet supported
  1475. get SUPPORT_BASE64_DRAWING() {
  1476. 'use strict';
  1477. return function (src) {
  1478. var _value = testBase64(document, src);
  1479. Object.defineProperty(FEATURES, 'SUPPORT_BASE64_DRAWING', { value: function value() {
  1480. return _value;
  1481. } });
  1482. return _value;
  1483. };
  1484. },
  1485. // $FlowFixMe - get/set properties not yet supported
  1486. get SUPPORT_FOREIGNOBJECT_DRAWING() {
  1487. 'use strict';
  1488. var value = typeof Array.from === 'function' && typeof window.fetch === 'function' ? testForeignObject(document) : Promise.resolve(false);
  1489. Object.defineProperty(FEATURES, 'SUPPORT_FOREIGNOBJECT_DRAWING', { value: value });
  1490. return value;
  1491. },
  1492. // $FlowFixMe - get/set properties not yet supported
  1493. get SUPPORT_CORS_IMAGES() {
  1494. 'use strict';
  1495. var value = testCORS();
  1496. Object.defineProperty(FEATURES, 'SUPPORT_CORS_IMAGES', { value: value });
  1497. return value;
  1498. },
  1499. // $FlowFixMe - get/set properties not yet supported
  1500. get SUPPORT_RESPONSE_TYPE() {
  1501. 'use strict';
  1502. var value = testResponseType();
  1503. Object.defineProperty(FEATURES, 'SUPPORT_RESPONSE_TYPE', { value: value });
  1504. return value;
  1505. },
  1506. // $FlowFixMe - get/set properties not yet supported
  1507. get SUPPORT_CORS_XHR() {
  1508. 'use strict';
  1509. var value = 'withCredentials' in new XMLHttpRequest();
  1510. Object.defineProperty(FEATURES, 'SUPPORT_CORS_XHR', { value: value });
  1511. return value;
  1512. }
  1513. };
  1514. exports.default = FEATURES;
  1515. /***/ }),
  1516. /* 11 */
  1517. /***/ (function(module, exports, __webpack_require__) {
  1518. "use strict";
  1519. Object.defineProperty(exports, "__esModule", {
  1520. value: true
  1521. });
  1522. exports.parseTextDecoration = exports.TEXT_DECORATION_LINE = exports.TEXT_DECORATION = exports.TEXT_DECORATION_STYLE = undefined;
  1523. var _Color = __webpack_require__(0);
  1524. var _Color2 = _interopRequireDefault(_Color);
  1525. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  1526. var TEXT_DECORATION_STYLE = exports.TEXT_DECORATION_STYLE = {
  1527. SOLID: 0,
  1528. DOUBLE: 1,
  1529. DOTTED: 2,
  1530. DASHED: 3,
  1531. WAVY: 4
  1532. };
  1533. var TEXT_DECORATION = exports.TEXT_DECORATION = {
  1534. NONE: null
  1535. };
  1536. var TEXT_DECORATION_LINE = exports.TEXT_DECORATION_LINE = {
  1537. UNDERLINE: 1,
  1538. OVERLINE: 2,
  1539. LINE_THROUGH: 3,
  1540. BLINK: 4
  1541. };
  1542. var parseLine = function parseLine(line) {
  1543. switch (line) {
  1544. case 'underline':
  1545. return TEXT_DECORATION_LINE.UNDERLINE;
  1546. case 'overline':
  1547. return TEXT_DECORATION_LINE.OVERLINE;
  1548. case 'line-through':
  1549. return TEXT_DECORATION_LINE.LINE_THROUGH;
  1550. }
  1551. return TEXT_DECORATION_LINE.BLINK;
  1552. };
  1553. var parseTextDecorationLine = function parseTextDecorationLine(line) {
  1554. if (line === 'none') {
  1555. return null;
  1556. }
  1557. return line.split(' ').map(parseLine);
  1558. };
  1559. var parseTextDecorationStyle = function parseTextDecorationStyle(style) {
  1560. switch (style) {
  1561. case 'double':
  1562. return TEXT_DECORATION_STYLE.DOUBLE;
  1563. case 'dotted':
  1564. return TEXT_DECORATION_STYLE.DOTTED;
  1565. case 'dashed':
  1566. return TEXT_DECORATION_STYLE.DASHED;
  1567. case 'wavy':
  1568. return TEXT_DECORATION_STYLE.WAVY;
  1569. }
  1570. return TEXT_DECORATION_STYLE.SOLID;
  1571. };
  1572. var parseTextDecoration = exports.parseTextDecoration = function parseTextDecoration(style) {
  1573. var textDecorationLine = parseTextDecorationLine(style.textDecorationLine ? style.textDecorationLine : style.textDecoration);
  1574. if (textDecorationLine === null) {
  1575. return TEXT_DECORATION.NONE;
  1576. }
  1577. var textDecorationColor = style.textDecorationColor ? new _Color2.default(style.textDecorationColor) : null;
  1578. var textDecorationStyle = parseTextDecorationStyle(style.textDecorationStyle);
  1579. return {
  1580. textDecorationLine: textDecorationLine,
  1581. textDecorationColor: textDecorationColor,
  1582. textDecorationStyle: textDecorationStyle
  1583. };
  1584. };
  1585. /***/ }),
  1586. /* 12 */
  1587. /***/ (function(module, exports, __webpack_require__) {
  1588. "use strict";
  1589. Object.defineProperty(exports, "__esModule", {
  1590. value: true
  1591. });
  1592. exports.parseBorder = exports.BORDER_SIDES = exports.BORDER_STYLE = undefined;
  1593. var _Color = __webpack_require__(0);
  1594. var _Color2 = _interopRequireDefault(_Color);
  1595. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  1596. var BORDER_STYLE = exports.BORDER_STYLE = {
  1597. NONE: 0,
  1598. SOLID: 1
  1599. };
  1600. var BORDER_SIDES = exports.BORDER_SIDES = {
  1601. TOP: 0,
  1602. RIGHT: 1,
  1603. BOTTOM: 2,
  1604. LEFT: 3
  1605. };
  1606. var SIDES = Object.keys(BORDER_SIDES).map(function (s) {
  1607. return s.toLowerCase();
  1608. });
  1609. var parseBorderStyle = function parseBorderStyle(style) {
  1610. switch (style) {
  1611. case 'none':
  1612. return BORDER_STYLE.NONE;
  1613. }
  1614. return BORDER_STYLE.SOLID;
  1615. };
  1616. var parseBorder = exports.parseBorder = function parseBorder(style) {
  1617. return SIDES.map(function (side) {
  1618. var borderColor = new _Color2.default(style.getPropertyValue('border-' + side + '-color'));
  1619. var borderStyle = parseBorderStyle(style.getPropertyValue('border-' + side + '-style'));
  1620. var borderWidth = parseFloat(style.getPropertyValue('border-' + side + '-width'));
  1621. return {
  1622. borderColor: borderColor,
  1623. borderStyle: borderStyle,
  1624. borderWidth: isNaN(borderWidth) ? 0 : borderWidth
  1625. };
  1626. });
  1627. };
  1628. /***/ }),
  1629. /* 13 */
  1630. /***/ (function(module, exports, __webpack_require__) {
  1631. "use strict";
  1632. Object.defineProperty(exports, "__esModule", {
  1633. value: true
  1634. });
  1635. var toCodePoints = exports.toCodePoints = function toCodePoints(str) {
  1636. var codePoints = [];
  1637. var i = 0;
  1638. var length = str.length;
  1639. while (i < length) {
  1640. var value = str.charCodeAt(i++);
  1641. if (value >= 0xd800 && value <= 0xdbff && i < length) {
  1642. var extra = str.charCodeAt(i++);
  1643. if ((extra & 0xfc00) === 0xdc00) {
  1644. codePoints.push(((value & 0x3ff) << 10) + (extra & 0x3ff) + 0x10000);
  1645. } else {
  1646. codePoints.push(value);
  1647. i--;
  1648. }
  1649. } else {
  1650. codePoints.push(value);
  1651. }
  1652. }
  1653. return codePoints;
  1654. };
  1655. var fromCodePoint = exports.fromCodePoint = function fromCodePoint() {
  1656. if (String.fromCodePoint) {
  1657. return String.fromCodePoint.apply(String, arguments);
  1658. }
  1659. var length = arguments.length;
  1660. if (!length) {
  1661. return '';
  1662. }
  1663. var codeUnits = [];
  1664. var index = -1;
  1665. var result = '';
  1666. while (++index < length) {
  1667. var codePoint = arguments.length <= index ? undefined : arguments[index];
  1668. if (codePoint <= 0xffff) {
  1669. codeUnits.push(codePoint);
  1670. } else {
  1671. codePoint -= 0x10000;
  1672. codeUnits.push((codePoint >> 10) + 0xd800, codePoint % 0x400 + 0xdc00);
  1673. }
  1674. if (index + 1 === length || codeUnits.length > 0x4000) {
  1675. result += String.fromCharCode.apply(String, codeUnits);
  1676. codeUnits.length = 0;
  1677. }
  1678. }
  1679. return result;
  1680. };
  1681. var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
  1682. // Use a lookup table to find the index.
  1683. var lookup = typeof Uint8Array === 'undefined' ? [] : new Uint8Array(256);
  1684. for (var i = 0; i < chars.length; i++) {
  1685. lookup[chars.charCodeAt(i)] = i;
  1686. }
  1687. var decode = exports.decode = function decode(base64) {
  1688. var bufferLength = base64.length * 0.75,
  1689. len = base64.length,
  1690. i = void 0,
  1691. p = 0,
  1692. encoded1 = void 0,
  1693. encoded2 = void 0,
  1694. encoded3 = void 0,
  1695. encoded4 = void 0;
  1696. if (base64[base64.length - 1] === '=') {
  1697. bufferLength--;
  1698. if (base64[base64.length - 2] === '=') {
  1699. bufferLength--;
  1700. }
  1701. }
  1702. var buffer = typeof ArrayBuffer !== 'undefined' && typeof Uint8Array !== 'undefined' && typeof Uint8Array.prototype.slice !== 'undefined' ? new ArrayBuffer(bufferLength) : new Array(bufferLength);
  1703. var bytes = Array.isArray(buffer) ? buffer : new Uint8Array(buffer);
  1704. for (i = 0; i < len; i += 4) {
  1705. encoded1 = lookup[base64.charCodeAt(i)];
  1706. encoded2 = lookup[base64.charCodeAt(i + 1)];
  1707. encoded3 = lookup[base64.charCodeAt(i + 2)];
  1708. encoded4 = lookup[base64.charCodeAt(i + 3)];
  1709. bytes[p++] = encoded1 << 2 | encoded2 >> 4;
  1710. bytes[p++] = (encoded2 & 15) << 4 | encoded3 >> 2;
  1711. bytes[p++] = (encoded3 & 3) << 6 | encoded4 & 63;
  1712. }
  1713. return buffer;
  1714. };
  1715. var polyUint16Array = exports.polyUint16Array = function polyUint16Array(buffer) {
  1716. var length = buffer.length;
  1717. var bytes = [];
  1718. for (var _i = 0; _i < length; _i += 2) {
  1719. bytes.push(buffer[_i + 1] << 8 | buffer[_i]);
  1720. }
  1721. return bytes;
  1722. };
  1723. var polyUint32Array = exports.polyUint32Array = function polyUint32Array(buffer) {
  1724. var length = buffer.length;
  1725. var bytes = [];
  1726. for (var _i2 = 0; _i2 < length; _i2 += 4) {
  1727. bytes.push(buffer[_i2 + 3] << 24 | buffer[_i2 + 2] << 16 | buffer[_i2 + 1] << 8 | buffer[_i2]);
  1728. }
  1729. return bytes;
  1730. };
  1731. /***/ }),
  1732. /* 14 */
  1733. /***/ (function(module, exports, __webpack_require__) {
  1734. "use strict";
  1735. Object.defineProperty(exports, "__esModule", {
  1736. value: true
  1737. });
  1738. exports.createCounterText = exports.inlineListItemElement = exports.getListOwner = undefined;
  1739. var _Util = __webpack_require__(4);
  1740. var _NodeContainer = __webpack_require__(3);
  1741. var _NodeContainer2 = _interopRequireDefault(_NodeContainer);
  1742. var _TextContainer = __webpack_require__(9);
  1743. var _TextContainer2 = _interopRequireDefault(_TextContainer);
  1744. var _listStyle = __webpack_require__(8);
  1745. var _Unicode = __webpack_require__(24);
  1746. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  1747. // Margin between the enumeration and the list item content
  1748. var MARGIN_RIGHT = 7;
  1749. var ancestorTypes = ['OL', 'UL', 'MENU'];
  1750. var getListOwner = exports.getListOwner = function getListOwner(container) {
  1751. var parent = container.parent;
  1752. if (!parent) {
  1753. return null;
  1754. }
  1755. do {
  1756. var isAncestor = ancestorTypes.indexOf(parent.tagName) !== -1;
  1757. if (isAncestor) {
  1758. return parent;
  1759. }
  1760. parent = parent.parent;
  1761. } while (parent);
  1762. return container.parent;
  1763. };
  1764. var inlineListItemElement = exports.inlineListItemElement = function inlineListItemElement(node, container, resourceLoader) {
  1765. var listStyle = container.style.listStyle;
  1766. if (!listStyle) {
  1767. return;
  1768. }
  1769. var style = node.ownerDocument.defaultView.getComputedStyle(node, null);
  1770. var wrapper = node.ownerDocument.createElement('html2canvaswrapper');
  1771. (0, _Util.copyCSSStyles)(style, wrapper);
  1772. wrapper.style.position = 'absolute';
  1773. wrapper.style.bottom = 'auto';
  1774. wrapper.style.display = 'block';
  1775. wrapper.style.letterSpacing = 'normal';
  1776. switch (listStyle.listStylePosition) {
  1777. case _listStyle.LIST_STYLE_POSITION.OUTSIDE:
  1778. wrapper.style.left = 'auto';
  1779. wrapper.style.right = node.ownerDocument.defaultView.innerWidth - container.bounds.left - container.style.margin[1].getAbsoluteValue(container.bounds.width) + MARGIN_RIGHT + 'px';
  1780. wrapper.style.textAlign = 'right';
  1781. break;
  1782. case _listStyle.LIST_STYLE_POSITION.INSIDE:
  1783. wrapper.style.left = container.bounds.left - container.style.margin[3].getAbsoluteValue(container.bounds.width) + 'px';
  1784. wrapper.style.right = 'auto';
  1785. wrapper.style.textAlign = 'left';
  1786. break;
  1787. }
  1788. var text = void 0;
  1789. var MARGIN_TOP = container.style.margin[0].getAbsoluteValue(container.bounds.width);
  1790. var styleImage = listStyle.listStyleImage;
  1791. if (styleImage) {
  1792. if (styleImage.method === 'url') {
  1793. var image = node.ownerDocument.createElement('img');
  1794. image.src = styleImage.args[0];
  1795. wrapper.style.top = container.bounds.top - MARGIN_TOP + 'px';
  1796. wrapper.style.width = 'auto';
  1797. wrapper.style.height = 'auto';
  1798. wrapper.appendChild(image);
  1799. } else {
  1800. var size = parseFloat(container.style.font.fontSize) * 0.5;
  1801. wrapper.style.top = container.bounds.top - MARGIN_TOP + container.bounds.height - 1.5 * size + 'px';
  1802. wrapper.style.width = size + 'px';
  1803. wrapper.style.height = size + 'px';
  1804. wrapper.style.backgroundImage = style.listStyleImage;
  1805. }
  1806. } else if (typeof container.listIndex === 'number') {
  1807. text = node.ownerDocument.createTextNode(createCounterText(container.listIndex, listStyle.listStyleType, true));
  1808. wrapper.appendChild(text);
  1809. wrapper.style.top = container.bounds.top - MARGIN_TOP + 'px';
  1810. }
  1811. // $FlowFixMe
  1812. var body = node.ownerDocument.body;
  1813. body.appendChild(wrapper);
  1814. if (text) {
  1815. container.childNodes.push(_TextContainer2.default.fromTextNode(text, container));
  1816. body.removeChild(wrapper);
  1817. } else {
  1818. // $FlowFixMe
  1819. container.childNodes.push(new _NodeContainer2.default(wrapper, container, resourceLoader, 0));
  1820. }
  1821. };
  1822. var ROMAN_UPPER = {
  1823. integers: [1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1],
  1824. values: ['M', 'CM', 'D', 'CD', 'C', 'XC', 'L', 'XL', 'X', 'IX', 'V', 'IV', 'I']
  1825. };
  1826. var ARMENIAN = {
  1827. integers: [9000, 8000, 7000, 6000, 5000, 4000, 3000, 2000, 1000, 900, 800, 700, 600, 500, 400, 300, 200, 100, 90, 80, 70, 60, 50, 40, 30, 20, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1],
  1828. values: ['Ք', 'Փ', 'Ւ', 'Ց', 'Ր', 'Տ', 'Վ', 'Ս', 'Ռ', 'Ջ', 'Պ', 'Չ', 'Ո', 'Շ', 'Ն', 'Յ', 'Մ', 'Ճ', 'Ղ', 'Ձ', 'Հ', 'Կ', 'Ծ', 'Խ', 'Լ', 'Ի', 'Ժ', 'Թ', 'Ը', 'Է', 'Զ', 'Ե', 'Դ', 'Գ', 'Բ', 'Ա']
  1829. };
  1830. var HEBREW = {
  1831. integers: [10000, 9000, 8000, 7000, 6000, 5000, 4000, 3000, 2000, 1000, 400, 300, 200, 100, 90, 80, 70, 60, 50, 40, 30, 20, 19, 18, 17, 16, 15, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1],
  1832. values: ['י׳', 'ט׳', 'ח׳', 'ז׳', 'ו׳', 'ה׳', 'ד׳', 'ג׳', 'ב׳', 'א׳', 'ת', 'ש', 'ר', 'ק', 'צ', 'פ', 'ע', 'ס', 'נ', 'מ', 'ל', 'כ', 'יט', 'יח', 'יז', 'טז', 'טו', 'י', 'ט', 'ח', 'ז', 'ו', 'ה', 'ד', 'ג', 'ב', 'א']
  1833. };
  1834. var GEORGIAN = {
  1835. integers: [10000, 9000, 8000, 7000, 6000, 5000, 4000, 3000, 2000, 1000, 900, 800, 700, 600, 500, 400, 300, 200, 100, 90, 80, 70, 60, 50, 40, 30, 20, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1],
  1836. values: ['ჵ', 'ჰ', 'ჯ', 'ჴ', 'ხ', 'ჭ', 'წ', 'ძ', 'ც', 'ჩ', 'შ', 'ყ', 'ღ', 'ქ', 'ფ', 'ჳ', 'ტ', 'ს', 'რ', 'ჟ', 'პ', 'ო', 'ჲ', 'ნ', 'მ', 'ლ', 'კ', 'ი', 'თ', 'ჱ', 'ზ', 'ვ', 'ე', 'დ', 'გ', 'ბ', 'ა']
  1837. };
  1838. var createAdditiveCounter = function createAdditiveCounter(value, min, max, symbols, fallback, suffix) {
  1839. if (value < min || value > max) {
  1840. return createCounterText(value, fallback, suffix.length > 0);
  1841. }
  1842. return symbols.integers.reduce(function (string, integer, index) {
  1843. while (value >= integer) {
  1844. value -= integer;
  1845. string += symbols.values[index];
  1846. }
  1847. return string;
  1848. }, '') + suffix;
  1849. };
  1850. var createCounterStyleWithSymbolResolver = function createCounterStyleWithSymbolResolver(value, codePointRangeLength, isNumeric, resolver) {
  1851. var string = '';
  1852. do {
  1853. if (!isNumeric) {
  1854. value--;
  1855. }
  1856. string = resolver(value) + string;
  1857. value /= codePointRangeLength;
  1858. } while (value * codePointRangeLength >= codePointRangeLength);
  1859. return string;
  1860. };
  1861. var createCounterStyleFromRange = function createCounterStyleFromRange(value, codePointRangeStart, codePointRangeEnd, isNumeric, suffix) {
  1862. var codePointRangeLength = codePointRangeEnd - codePointRangeStart + 1;
  1863. return (value < 0 ? '-' : '') + (createCounterStyleWithSymbolResolver(Math.abs(value), codePointRangeLength, isNumeric, function (codePoint) {
  1864. return (0, _Unicode.fromCodePoint)(Math.floor(codePoint % codePointRangeLength) + codePointRangeStart);
  1865. }) + suffix);
  1866. };
  1867. var createCounterStyleFromSymbols = function createCounterStyleFromSymbols(value, symbols) {
  1868. var suffix = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '. ';
  1869. var codePointRangeLength = symbols.length;
  1870. return createCounterStyleWithSymbolResolver(Math.abs(value), codePointRangeLength, false, function (codePoint) {
  1871. return symbols[Math.floor(codePoint % codePointRangeLength)];
  1872. }) + suffix;
  1873. };
  1874. var CJK_ZEROS = 1 << 0;
  1875. var CJK_TEN_COEFFICIENTS = 1 << 1;
  1876. var CJK_TEN_HIGH_COEFFICIENTS = 1 << 2;
  1877. var CJK_HUNDRED_COEFFICIENTS = 1 << 3;
  1878. var createCJKCounter = function createCJKCounter(value, numbers, multipliers, negativeSign, suffix, flags) {
  1879. if (value < -9999 || value > 9999) {
  1880. return createCounterText(value, _listStyle.LIST_STYLE_TYPE.CJK_DECIMAL, suffix.length > 0);
  1881. }
  1882. var tmp = Math.abs(value);
  1883. var string = suffix;
  1884. if (tmp === 0) {
  1885. return numbers[0] + string;
  1886. }
  1887. for (var digit = 0; tmp > 0 && digit <= 4; digit++) {
  1888. var coefficient = tmp % 10;
  1889. if (coefficient === 0 && (0, _Util.contains)(flags, CJK_ZEROS) && string !== '') {
  1890. string = numbers[coefficient] + string;
  1891. } else if (coefficient > 1 || coefficient === 1 && digit === 0 || coefficient === 1 && digit === 1 && (0, _Util.contains)(flags, CJK_TEN_COEFFICIENTS) || coefficient === 1 && digit === 1 && (0, _Util.contains)(flags, CJK_TEN_HIGH_COEFFICIENTS) && value > 100 || coefficient === 1 && digit > 1 && (0, _Util.contains)(flags, CJK_HUNDRED_COEFFICIENTS)) {
  1892. string = numbers[coefficient] + (digit > 0 ? multipliers[digit - 1] : '') + string;
  1893. } else if (coefficient === 1 && digit > 0) {
  1894. string = multipliers[digit - 1] + string;
  1895. }
  1896. tmp = Math.floor(tmp / 10);
  1897. }
  1898. return (value < 0 ? negativeSign : '') + string;
  1899. };
  1900. var CHINESE_INFORMAL_MULTIPLIERS = '十百千萬';
  1901. var CHINESE_FORMAL_MULTIPLIERS = '拾佰仟萬';
  1902. var JAPANESE_NEGATIVE = 'マイナス';
  1903. var KOREAN_NEGATIVE = '마이너스 ';
  1904. var createCounterText = exports.createCounterText = function createCounterText(value, type, appendSuffix) {
  1905. var defaultSuffix = appendSuffix ? '. ' : '';
  1906. var cjkSuffix = appendSuffix ? '、' : '';
  1907. var koreanSuffix = appendSuffix ? ', ' : '';
  1908. switch (type) {
  1909. case _listStyle.LIST_STYLE_TYPE.DISC:
  1910. return '•';
  1911. case _listStyle.LIST_STYLE_TYPE.CIRCLE:
  1912. return '◦';
  1913. case _listStyle.LIST_STYLE_TYPE.SQUARE:
  1914. return '◾';
  1915. case _listStyle.LIST_STYLE_TYPE.DECIMAL_LEADING_ZERO:
  1916. var string = createCounterStyleFromRange(value, 48, 57, true, defaultSuffix);
  1917. return string.length < 4 ? '0' + string : string;
  1918. case _listStyle.LIST_STYLE_TYPE.CJK_DECIMAL:
  1919. return createCounterStyleFromSymbols(value, '〇一二三四五六七八九', cjkSuffix);
  1920. case _listStyle.LIST_STYLE_TYPE.LOWER_ROMAN:
  1921. return createAdditiveCounter(value, 1, 3999, ROMAN_UPPER, _listStyle.LIST_STYLE_TYPE.DECIMAL, defaultSuffix).toLowerCase();
  1922. case _listStyle.LIST_STYLE_TYPE.UPPER_ROMAN:
  1923. return createAdditiveCounter(value, 1, 3999, ROMAN_UPPER, _listStyle.LIST_STYLE_TYPE.DECIMAL, defaultSuffix);
  1924. case _listStyle.LIST_STYLE_TYPE.LOWER_GREEK:
  1925. return createCounterStyleFromRange(value, 945, 969, false, defaultSuffix);
  1926. case _listStyle.LIST_STYLE_TYPE.LOWER_ALPHA:
  1927. return createCounterStyleFromRange(value, 97, 122, false, defaultSuffix);
  1928. case _listStyle.LIST_STYLE_TYPE.UPPER_ALPHA:
  1929. return createCounterStyleFromRange(value, 65, 90, false, defaultSuffix);
  1930. case _listStyle.LIST_STYLE_TYPE.ARABIC_INDIC:
  1931. return createCounterStyleFromRange(value, 1632, 1641, true, defaultSuffix);
  1932. case _listStyle.LIST_STYLE_TYPE.ARMENIAN:
  1933. case _listStyle.LIST_STYLE_TYPE.UPPER_ARMENIAN:
  1934. return createAdditiveCounter(value, 1, 9999, ARMENIAN, _listStyle.LIST_STYLE_TYPE.DECIMAL, defaultSuffix);
  1935. case _listStyle.LIST_STYLE_TYPE.LOWER_ARMENIAN:
  1936. return createAdditiveCounter(value, 1, 9999, ARMENIAN, _listStyle.LIST_STYLE_TYPE.DECIMAL, defaultSuffix).toLowerCase();
  1937. case _listStyle.LIST_STYLE_TYPE.BENGALI:
  1938. return createCounterStyleFromRange(value, 2534, 2543, true, defaultSuffix);
  1939. case _listStyle.LIST_STYLE_TYPE.CAMBODIAN:
  1940. case _listStyle.LIST_STYLE_TYPE.KHMER:
  1941. return createCounterStyleFromRange(value, 6112, 6121, true, defaultSuffix);
  1942. case _listStyle.LIST_STYLE_TYPE.CJK_EARTHLY_BRANCH:
  1943. return createCounterStyleFromSymbols(value, '子丑寅卯辰巳午未申酉戌亥', cjkSuffix);
  1944. case _listStyle.LIST_STYLE_TYPE.CJK_HEAVENLY_STEM:
  1945. return createCounterStyleFromSymbols(value, '甲乙丙丁戊己庚辛壬癸', cjkSuffix);
  1946. case _listStyle.LIST_STYLE_TYPE.CJK_IDEOGRAPHIC:
  1947. case _listStyle.LIST_STYLE_TYPE.TRAD_CHINESE_INFORMAL:
  1948. return createCJKCounter(value, '零一二三四五六七八九', CHINESE_INFORMAL_MULTIPLIERS, '負', cjkSuffix, CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS);
  1949. case _listStyle.LIST_STYLE_TYPE.TRAD_CHINESE_FORMAL:
  1950. return createCJKCounter(value, '零壹貳參肆伍陸柒捌玖', CHINESE_FORMAL_MULTIPLIERS, '負', cjkSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS);
  1951. case _listStyle.LIST_STYLE_TYPE.SIMP_CHINESE_INFORMAL:
  1952. return createCJKCounter(value, '零一二三四五六七八九', CHINESE_INFORMAL_MULTIPLIERS, '负', cjkSuffix, CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS);
  1953. case _listStyle.LIST_STYLE_TYPE.SIMP_CHINESE_FORMAL:
  1954. return createCJKCounter(value, '零壹贰叁肆伍陆柒捌玖', CHINESE_FORMAL_MULTIPLIERS, '负', cjkSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS);
  1955. case _listStyle.LIST_STYLE_TYPE.JAPANESE_INFORMAL:
  1956. return createCJKCounter(value, '〇一二三四五六七八九', '十百千万', JAPANESE_NEGATIVE, cjkSuffix, 0);
  1957. case _listStyle.LIST_STYLE_TYPE.JAPANESE_FORMAL:
  1958. return createCJKCounter(value, '零壱弐参四伍六七八九', '拾百千万', JAPANESE_NEGATIVE, cjkSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS);
  1959. case _listStyle.LIST_STYLE_TYPE.KOREAN_HANGUL_FORMAL:
  1960. return createCJKCounter(value, '영일이삼사오육칠팔구', '십백천만', KOREAN_NEGATIVE, koreanSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS);
  1961. case _listStyle.LIST_STYLE_TYPE.KOREAN_HANJA_INFORMAL:
  1962. return createCJKCounter(value, '零一二三四五六七八九', '十百千萬', KOREAN_NEGATIVE, koreanSuffix, 0);
  1963. case _listStyle.LIST_STYLE_TYPE.KOREAN_HANJA_FORMAL:
  1964. return createCJKCounter(value, '零壹貳參四五六七八九', '拾百千', KOREAN_NEGATIVE, koreanSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS);
  1965. case _listStyle.LIST_STYLE_TYPE.DEVANAGARI:
  1966. return createCounterStyleFromRange(value, 0x966, 0x96f, true, defaultSuffix);
  1967. case _listStyle.LIST_STYLE_TYPE.GEORGIAN:
  1968. return createAdditiveCounter(value, 1, 19999, GEORGIAN, _listStyle.LIST_STYLE_TYPE.DECIMAL, defaultSuffix);
  1969. case _listStyle.LIST_STYLE_TYPE.GUJARATI:
  1970. return createCounterStyleFromRange(value, 0xae6, 0xaef, true, defaultSuffix);
  1971. case _listStyle.LIST_STYLE_TYPE.GURMUKHI:
  1972. return createCounterStyleFromRange(value, 0xa66, 0xa6f, true, defaultSuffix);
  1973. case _listStyle.LIST_STYLE_TYPE.HEBREW:
  1974. return createAdditiveCounter(value, 1, 10999, HEBREW, _listStyle.LIST_STYLE_TYPE.DECIMAL, defaultSuffix);
  1975. case _listStyle.LIST_STYLE_TYPE.HIRAGANA:
  1976. return createCounterStyleFromSymbols(value, 'あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん');
  1977. case _listStyle.LIST_STYLE_TYPE.HIRAGANA_IROHA:
  1978. return createCounterStyleFromSymbols(value, 'いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす');
  1979. case _listStyle.LIST_STYLE_TYPE.KANNADA:
  1980. return createCounterStyleFromRange(value, 0xce6, 0xcef, true, defaultSuffix);
  1981. case _listStyle.LIST_STYLE_TYPE.KATAKANA:
  1982. return createCounterStyleFromSymbols(value, 'アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン', cjkSuffix);
  1983. case _listStyle.LIST_STYLE_TYPE.KATAKANA_IROHA:
  1984. return createCounterStyleFromSymbols(value, 'イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス', cjkSuffix);
  1985. case _listStyle.LIST_STYLE_TYPE.LAO:
  1986. return createCounterStyleFromRange(value, 0xed0, 0xed9, true, defaultSuffix);
  1987. case _listStyle.LIST_STYLE_TYPE.MONGOLIAN:
  1988. return createCounterStyleFromRange(value, 0x1810, 0x1819, true, defaultSuffix);
  1989. case _listStyle.LIST_STYLE_TYPE.MYANMAR:
  1990. return createCounterStyleFromRange(value, 0x1040, 0x1049, true, defaultSuffix);
  1991. case _listStyle.LIST_STYLE_TYPE.ORIYA:
  1992. return createCounterStyleFromRange(value, 0xb66, 0xb6f, true, defaultSuffix);
  1993. case _listStyle.LIST_STYLE_TYPE.PERSIAN:
  1994. return createCounterStyleFromRange(value, 0x6f0, 0x6f9, true, defaultSuffix);
  1995. case _listStyle.LIST_STYLE_TYPE.TAMIL:
  1996. return createCounterStyleFromRange(value, 0xbe6, 0xbef, true, defaultSuffix);
  1997. case _listStyle.LIST_STYLE_TYPE.TELUGU:
  1998. return createCounterStyleFromRange(value, 0xc66, 0xc6f, true, defaultSuffix);
  1999. case _listStyle.LIST_STYLE_TYPE.THAI:
  2000. return createCounterStyleFromRange(value, 0xe50, 0xe59, true, defaultSuffix);
  2001. case _listStyle.LIST_STYLE_TYPE.TIBETAN:
  2002. return createCounterStyleFromRange(value, 0xf20, 0xf29, true, defaultSuffix);
  2003. case _listStyle.LIST_STYLE_TYPE.DECIMAL:
  2004. default:
  2005. return createCounterStyleFromRange(value, 48, 57, true, defaultSuffix);
  2006. }
  2007. };
  2008. /***/ }),
  2009. /* 15 */
  2010. /***/ (function(module, exports, __webpack_require__) {
  2011. "use strict";
  2012. Object.defineProperty(exports, "__esModule", {
  2013. value: true
  2014. });
  2015. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  2016. var _Path = __webpack_require__(6);
  2017. var _textDecoration = __webpack_require__(11);
  2018. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2019. var addColorStops = function addColorStops(gradient, canvasGradient) {
  2020. var maxStop = Math.max.apply(null, gradient.colorStops.map(function (colorStop) {
  2021. return colorStop.stop;
  2022. }));
  2023. var f = 1 / Math.max(1, maxStop);
  2024. gradient.colorStops.forEach(function (colorStop) {
  2025. canvasGradient.addColorStop(f * colorStop.stop, colorStop.color.toString());
  2026. });
  2027. };
  2028. var CanvasRenderer = function () {
  2029. function CanvasRenderer(canvas) {
  2030. _classCallCheck(this, CanvasRenderer);
  2031. this.canvas = canvas ? canvas : document.createElement('canvas');
  2032. }
  2033. _createClass(CanvasRenderer, [{
  2034. key: 'render',
  2035. value: function render(options) {
  2036. this.ctx = this.canvas.getContext('2d');
  2037. this.options = options;
  2038. this.canvas.width = Math.floor(options.width * options.scale);
  2039. this.canvas.height = Math.floor(options.height * options.scale);
  2040. this.canvas.style.width = options.width + 'px';
  2041. this.canvas.style.height = options.height + 'px';
  2042. this.ctx.scale(this.options.scale, this.options.scale);
  2043. this.ctx.translate(-options.x, -options.y);
  2044. this.ctx.textBaseline = 'bottom';
  2045. options.logger.log('Canvas renderer initialized (' + options.width + 'x' + options.height + ' at ' + options.x + ',' + options.y + ') with scale ' + this.options.scale);
  2046. }
  2047. }, {
  2048. key: 'clip',
  2049. value: function clip(clipPaths, callback) {
  2050. var _this = this;
  2051. if (clipPaths.length) {
  2052. this.ctx.save();
  2053. clipPaths.forEach(function (path) {
  2054. _this.path(path);
  2055. _this.ctx.clip();
  2056. });
  2057. }
  2058. callback();
  2059. if (clipPaths.length) {
  2060. this.ctx.restore();
  2061. }
  2062. }
  2063. }, {
  2064. key: 'drawImage',
  2065. value: function drawImage(image, source, destination) {
  2066. this.ctx.drawImage(image, source.left, source.top, source.width, source.height, destination.left, destination.top, destination.width, destination.height);
  2067. }
  2068. }, {
  2069. key: 'drawShape',
  2070. value: function drawShape(path, color) {
  2071. this.path(path);
  2072. this.ctx.fillStyle = color.toString();
  2073. this.ctx.fill();
  2074. }
  2075. }, {
  2076. key: 'fill',
  2077. value: function fill(color) {
  2078. this.ctx.fillStyle = color.toString();
  2079. this.ctx.fill();
  2080. }
  2081. }, {
  2082. key: 'getTarget',
  2083. value: function getTarget() {
  2084. return Promise.resolve(this.canvas);
  2085. }
  2086. }, {
  2087. key: 'path',
  2088. value: function path(_path) {
  2089. var _this2 = this;
  2090. this.ctx.beginPath();
  2091. if (Array.isArray(_path)) {
  2092. _path.forEach(function (point, index) {
  2093. var start = point.type === _Path.PATH.VECTOR ? point : point.start;
  2094. if (index === 0) {
  2095. _this2.ctx.moveTo(start.x, start.y);
  2096. } else {
  2097. _this2.ctx.lineTo(start.x, start.y);
  2098. }
  2099. if (point.type === _Path.PATH.BEZIER_CURVE) {
  2100. _this2.ctx.bezierCurveTo(point.startControl.x, point.startControl.y, point.endControl.x, point.endControl.y, point.end.x, point.end.y);
  2101. }
  2102. });
  2103. } else {
  2104. this.ctx.arc(_path.x + _path.radius, _path.y + _path.radius, _path.radius, 0, Math.PI * 2, true);
  2105. }
  2106. this.ctx.closePath();
  2107. }
  2108. }, {
  2109. key: 'rectangle',
  2110. value: function rectangle(x, y, width, height, color) {
  2111. this.ctx.fillStyle = color.toString();
  2112. this.ctx.fillRect(x, y, width, height);
  2113. }
  2114. }, {
  2115. key: 'renderLinearGradient',
  2116. value: function renderLinearGradient(bounds, gradient) {
  2117. var linearGradient = this.ctx.createLinearGradient(bounds.left + gradient.direction.x1, bounds.top + gradient.direction.y1, bounds.left + gradient.direction.x0, bounds.top + gradient.direction.y0);
  2118. addColorStops(gradient, linearGradient);
  2119. this.ctx.fillStyle = linearGradient;
  2120. this.ctx.fillRect(bounds.left, bounds.top, bounds.width, bounds.height);
  2121. }
  2122. }, {
  2123. key: 'renderRadialGradient',
  2124. value: function renderRadialGradient(bounds, gradient) {
  2125. var _this3 = this;
  2126. var x = bounds.left + gradient.center.x;
  2127. var y = bounds.top + gradient.center.y;
  2128. var radialGradient = this.ctx.createRadialGradient(x, y, 0, x, y, gradient.radius.x);
  2129. if (!radialGradient) {
  2130. return;
  2131. }
  2132. addColorStops(gradient, radialGradient);
  2133. this.ctx.fillStyle = radialGradient;
  2134. if (gradient.radius.x !== gradient.radius.y) {
  2135. // transforms for elliptical radial gradient
  2136. var midX = bounds.left + 0.5 * bounds.width;
  2137. var midY = bounds.top + 0.5 * bounds.height;
  2138. var f = gradient.radius.y / gradient.radius.x;
  2139. var invF = 1 / f;
  2140. this.transform(midX, midY, [1, 0, 0, f, 0, 0], function () {
  2141. return _this3.ctx.fillRect(bounds.left, invF * (bounds.top - midY) + midY, bounds.width, bounds.height * invF);
  2142. });
  2143. } else {
  2144. this.ctx.fillRect(bounds.left, bounds.top, bounds.width, bounds.height);
  2145. }
  2146. }
  2147. }, {
  2148. key: 'renderRepeat',
  2149. value: function renderRepeat(path, image, imageSize, offsetX, offsetY) {
  2150. this.path(path);
  2151. this.ctx.fillStyle = this.ctx.createPattern(this.resizeImage(image, imageSize), 'repeat');
  2152. this.ctx.translate(offsetX, offsetY);
  2153. this.ctx.fill();
  2154. this.ctx.translate(-offsetX, -offsetY);
  2155. }
  2156. }, {
  2157. key: 'renderTextNode',
  2158. value: function renderTextNode(textBounds, color, font, textDecoration, textShadows) {
  2159. var _this4 = this;
  2160. this.ctx.font = [font.fontStyle, font.fontVariant, font.fontWeight, font.fontSize, font.fontFamily].join(' ');
  2161. textBounds.forEach(function (text) {
  2162. _this4.ctx.fillStyle = color.toString();
  2163. if (textShadows && text.text.trim().length) {
  2164. textShadows.slice(0).reverse().forEach(function (textShadow) {
  2165. _this4.ctx.shadowColor = textShadow.color.toString();
  2166. _this4.ctx.shadowOffsetX = textShadow.offsetX * _this4.options.scale;
  2167. _this4.ctx.shadowOffsetY = textShadow.offsetY * _this4.options.scale;
  2168. _this4.ctx.shadowBlur = textShadow.blur;
  2169. _this4.ctx.fillText(text.text, text.bounds.left, text.bounds.top + text.bounds.height);
  2170. });
  2171. } else {
  2172. _this4.ctx.fillText(text.text, text.bounds.left, text.bounds.top + text.bounds.height);
  2173. }
  2174. if (textDecoration !== null) {
  2175. var textDecorationColor = textDecoration.textDecorationColor || color;
  2176. textDecoration.textDecorationLine.forEach(function (textDecorationLine) {
  2177. switch (textDecorationLine) {
  2178. case _textDecoration.TEXT_DECORATION_LINE.UNDERLINE:
  2179. // Draws a line at the baseline of the font
  2180. // TODO As some browsers display the line as more than 1px if the font-size is big,
  2181. // need to take that into account both in position and size
  2182. var _options$fontMetrics$ = _this4.options.fontMetrics.getMetrics(font),
  2183. baseline = _options$fontMetrics$.baseline;
  2184. _this4.rectangle(text.bounds.left, Math.round(text.bounds.top + baseline), text.bounds.width, 1, textDecorationColor);
  2185. break;
  2186. case _textDecoration.TEXT_DECORATION_LINE.OVERLINE:
  2187. _this4.rectangle(text.bounds.left, Math.round(text.bounds.top), text.bounds.width, 1, textDecorationColor);
  2188. break;
  2189. case _textDecoration.TEXT_DECORATION_LINE.LINE_THROUGH:
  2190. // TODO try and find exact position for line-through
  2191. var _options$fontMetrics$2 = _this4.options.fontMetrics.getMetrics(font),
  2192. middle = _options$fontMetrics$2.middle;
  2193. _this4.rectangle(text.bounds.left, Math.ceil(text.bounds.top + middle), text.bounds.width, 1, textDecorationColor);
  2194. break;
  2195. }
  2196. });
  2197. }
  2198. });
  2199. }
  2200. }, {
  2201. key: 'resizeImage',
  2202. value: function resizeImage(image, size) {
  2203. if (image.width === size.width && image.height === size.height) {
  2204. return image;
  2205. }
  2206. var canvas = this.canvas.ownerDocument.createElement('canvas');
  2207. canvas.width = size.width;
  2208. canvas.height = size.height;
  2209. var ctx = canvas.getContext('2d');
  2210. ctx.drawImage(image, 0, 0, image.width, image.height, 0, 0, size.width, size.height);
  2211. return canvas;
  2212. }
  2213. }, {
  2214. key: 'setOpacity',
  2215. value: function setOpacity(opacity) {
  2216. this.ctx.globalAlpha = opacity;
  2217. }
  2218. }, {
  2219. key: 'transform',
  2220. value: function transform(offsetX, offsetY, matrix, callback) {
  2221. this.ctx.save();
  2222. this.ctx.translate(offsetX, offsetY);
  2223. this.ctx.transform(matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5]);
  2224. this.ctx.translate(-offsetX, -offsetY);
  2225. callback();
  2226. this.ctx.restore();
  2227. }
  2228. }]);
  2229. return CanvasRenderer;
  2230. }();
  2231. exports.default = CanvasRenderer;
  2232. /***/ }),
  2233. /* 16 */
  2234. /***/ (function(module, exports, __webpack_require__) {
  2235. "use strict";
  2236. Object.defineProperty(exports, "__esModule", {
  2237. value: true
  2238. });
  2239. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  2240. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2241. var Logger = function () {
  2242. function Logger(enabled, id, start) {
  2243. _classCallCheck(this, Logger);
  2244. this.enabled = typeof window !== 'undefined' && enabled;
  2245. this.start = start ? start : Date.now();
  2246. this.id = id;
  2247. }
  2248. _createClass(Logger, [{
  2249. key: 'child',
  2250. value: function child(id) {
  2251. return new Logger(this.enabled, id, this.start);
  2252. }
  2253. // eslint-disable-next-line flowtype/no-weak-types
  2254. }, {
  2255. key: 'log',
  2256. value: function log() {
  2257. if (this.enabled && window.console && window.console.log) {
  2258. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  2259. args[_key] = arguments[_key];
  2260. }
  2261. Function.prototype.bind.call(window.console.log, window.console).apply(window.console, [Date.now() - this.start + 'ms', this.id ? 'html2canvas (' + this.id + '):' : 'html2canvas:'].concat([].slice.call(args, 0)));
  2262. }
  2263. }
  2264. // eslint-disable-next-line flowtype/no-weak-types
  2265. }, {
  2266. key: 'error',
  2267. value: function error() {
  2268. if (this.enabled && window.console && window.console.error) {
  2269. for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  2270. args[_key2] = arguments[_key2];
  2271. }
  2272. Function.prototype.bind.call(window.console.error, window.console).apply(window.console, [Date.now() - this.start + 'ms', this.id ? 'html2canvas (' + this.id + '):' : 'html2canvas:'].concat([].slice.call(args, 0)));
  2273. }
  2274. }
  2275. }]);
  2276. return Logger;
  2277. }();
  2278. exports.default = Logger;
  2279. /***/ }),
  2280. /* 17 */
  2281. /***/ (function(module, exports, __webpack_require__) {
  2282. "use strict";
  2283. Object.defineProperty(exports, "__esModule", {
  2284. value: true
  2285. });
  2286. exports.parsePadding = exports.PADDING_SIDES = undefined;
  2287. var _Length = __webpack_require__(2);
  2288. var _Length2 = _interopRequireDefault(_Length);
  2289. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  2290. var PADDING_SIDES = exports.PADDING_SIDES = {
  2291. TOP: 0,
  2292. RIGHT: 1,
  2293. BOTTOM: 2,
  2294. LEFT: 3
  2295. };
  2296. var SIDES = ['top', 'right', 'bottom', 'left'];
  2297. var parsePadding = exports.parsePadding = function parsePadding(style) {
  2298. return SIDES.map(function (side) {
  2299. return new _Length2.default(style.getPropertyValue('padding-' + side));
  2300. });
  2301. };
  2302. /***/ }),
  2303. /* 18 */
  2304. /***/ (function(module, exports, __webpack_require__) {
  2305. "use strict";
  2306. Object.defineProperty(exports, "__esModule", {
  2307. value: true
  2308. });
  2309. var OVERFLOW_WRAP = exports.OVERFLOW_WRAP = {
  2310. NORMAL: 0,
  2311. BREAK_WORD: 1
  2312. };
  2313. var parseOverflowWrap = exports.parseOverflowWrap = function parseOverflowWrap(overflow) {
  2314. switch (overflow) {
  2315. case 'break-word':
  2316. return OVERFLOW_WRAP.BREAK_WORD;
  2317. case 'normal':
  2318. default:
  2319. return OVERFLOW_WRAP.NORMAL;
  2320. }
  2321. };
  2322. /***/ }),
  2323. /* 19 */
  2324. /***/ (function(module, exports, __webpack_require__) {
  2325. "use strict";
  2326. Object.defineProperty(exports, "__esModule", {
  2327. value: true
  2328. });
  2329. var POSITION = exports.POSITION = {
  2330. STATIC: 0,
  2331. RELATIVE: 1,
  2332. ABSOLUTE: 2,
  2333. FIXED: 3,
  2334. STICKY: 4
  2335. };
  2336. var parsePosition = exports.parsePosition = function parsePosition(position) {
  2337. switch (position) {
  2338. case 'relative':
  2339. return POSITION.RELATIVE;
  2340. case 'absolute':
  2341. return POSITION.ABSOLUTE;
  2342. case 'fixed':
  2343. return POSITION.FIXED;
  2344. case 'sticky':
  2345. return POSITION.STICKY;
  2346. }
  2347. return POSITION.STATIC;
  2348. };
  2349. /***/ }),
  2350. /* 20 */
  2351. /***/ (function(module, exports, __webpack_require__) {
  2352. "use strict";
  2353. Object.defineProperty(exports, "__esModule", {
  2354. value: true
  2355. });
  2356. var TEXT_TRANSFORM = exports.TEXT_TRANSFORM = {
  2357. NONE: 0,
  2358. LOWERCASE: 1,
  2359. UPPERCASE: 2,
  2360. CAPITALIZE: 3
  2361. };
  2362. var parseTextTransform = exports.parseTextTransform = function parseTextTransform(textTransform) {
  2363. switch (textTransform) {
  2364. case 'uppercase':
  2365. return TEXT_TRANSFORM.UPPERCASE;
  2366. case 'lowercase':
  2367. return TEXT_TRANSFORM.LOWERCASE;
  2368. case 'capitalize':
  2369. return TEXT_TRANSFORM.CAPITALIZE;
  2370. }
  2371. return TEXT_TRANSFORM.NONE;
  2372. };
  2373. /***/ }),
  2374. /* 21 */
  2375. /***/ (function(module, exports, __webpack_require__) {
  2376. "use strict";
  2377. Object.defineProperty(exports, "__esModule", {
  2378. value: true
  2379. });
  2380. exports.reformatInputBounds = exports.inlineSelectElement = exports.inlineTextAreaElement = exports.inlineInputElement = exports.getInputBorderRadius = exports.INPUT_BACKGROUND = exports.INPUT_BORDERS = exports.INPUT_COLOR = undefined;
  2381. var _TextContainer = __webpack_require__(9);
  2382. var _TextContainer2 = _interopRequireDefault(_TextContainer);
  2383. var _background = __webpack_require__(5);
  2384. var _border = __webpack_require__(12);
  2385. var _Circle = __webpack_require__(50);
  2386. var _Circle2 = _interopRequireDefault(_Circle);
  2387. var _Vector = __webpack_require__(7);
  2388. var _Vector2 = _interopRequireDefault(_Vector);
  2389. var _Color = __webpack_require__(0);
  2390. var _Color2 = _interopRequireDefault(_Color);
  2391. var _Length = __webpack_require__(2);
  2392. var _Length2 = _interopRequireDefault(_Length);
  2393. var _Bounds = __webpack_require__(1);
  2394. var _TextBounds = __webpack_require__(22);
  2395. var _Util = __webpack_require__(4);
  2396. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  2397. var INPUT_COLOR = exports.INPUT_COLOR = new _Color2.default([42, 42, 42]);
  2398. var INPUT_BORDER_COLOR = new _Color2.default([165, 165, 165]);
  2399. var INPUT_BACKGROUND_COLOR = new _Color2.default([222, 222, 222]);
  2400. var INPUT_BORDER = {
  2401. borderWidth: 1,
  2402. borderColor: INPUT_BORDER_COLOR,
  2403. borderStyle: _border.BORDER_STYLE.SOLID
  2404. };
  2405. var INPUT_BORDERS = exports.INPUT_BORDERS = [INPUT_BORDER, INPUT_BORDER, INPUT_BORDER, INPUT_BORDER];
  2406. var INPUT_BACKGROUND = exports.INPUT_BACKGROUND = {
  2407. backgroundColor: INPUT_BACKGROUND_COLOR,
  2408. backgroundImage: [],
  2409. backgroundClip: _background.BACKGROUND_CLIP.PADDING_BOX,
  2410. backgroundOrigin: _background.BACKGROUND_ORIGIN.PADDING_BOX
  2411. };
  2412. var RADIO_BORDER_RADIUS = new _Length2.default('50%');
  2413. var RADIO_BORDER_RADIUS_TUPLE = [RADIO_BORDER_RADIUS, RADIO_BORDER_RADIUS];
  2414. var INPUT_RADIO_BORDER_RADIUS = [RADIO_BORDER_RADIUS_TUPLE, RADIO_BORDER_RADIUS_TUPLE, RADIO_BORDER_RADIUS_TUPLE, RADIO_BORDER_RADIUS_TUPLE];
  2415. var CHECKBOX_BORDER_RADIUS = new _Length2.default('3px');
  2416. var CHECKBOX_BORDER_RADIUS_TUPLE = [CHECKBOX_BORDER_RADIUS, CHECKBOX_BORDER_RADIUS];
  2417. var INPUT_CHECKBOX_BORDER_RADIUS = [CHECKBOX_BORDER_RADIUS_TUPLE, CHECKBOX_BORDER_RADIUS_TUPLE, CHECKBOX_BORDER_RADIUS_TUPLE, CHECKBOX_BORDER_RADIUS_TUPLE];
  2418. var getInputBorderRadius = exports.getInputBorderRadius = function getInputBorderRadius(node) {
  2419. return node.type === 'radio' ? INPUT_RADIO_BORDER_RADIUS : INPUT_CHECKBOX_BORDER_RADIUS;
  2420. };
  2421. var inlineInputElement = exports.inlineInputElement = function inlineInputElement(node, container) {
  2422. if (node.type === 'radio' || node.type === 'checkbox') {
  2423. if (node.checked) {
  2424. var size = Math.min(container.bounds.width, container.bounds.height);
  2425. container.childNodes.push(node.type === 'checkbox' ? [new _Vector2.default(container.bounds.left + size * 0.39363, container.bounds.top + size * 0.79), new _Vector2.default(container.bounds.left + size * 0.16, container.bounds.top + size * 0.5549), new _Vector2.default(container.bounds.left + size * 0.27347, container.bounds.top + size * 0.44071), new _Vector2.default(container.bounds.left + size * 0.39694, container.bounds.top + size * 0.5649), new _Vector2.default(container.bounds.left + size * 0.72983, container.bounds.top + size * 0.23), new _Vector2.default(container.bounds.left + size * 0.84, container.bounds.top + size * 0.34085), new _Vector2.default(container.bounds.left + size * 0.39363, container.bounds.top + size * 0.79)] : new _Circle2.default(container.bounds.left + size / 4, container.bounds.top + size / 4, size / 4));
  2426. }
  2427. } else {
  2428. inlineFormElement(getInputValue(node), node, container, false);
  2429. }
  2430. };
  2431. var inlineTextAreaElement = exports.inlineTextAreaElement = function inlineTextAreaElement(node, container) {
  2432. inlineFormElement(node.value, node, container, true);
  2433. };
  2434. var inlineSelectElement = exports.inlineSelectElement = function inlineSelectElement(node, container) {
  2435. var option = node.options[node.selectedIndex || 0];
  2436. inlineFormElement(option ? option.text || '' : '', node, container, false);
  2437. };
  2438. var reformatInputBounds = exports.reformatInputBounds = function reformatInputBounds(bounds) {
  2439. if (bounds.width > bounds.height) {
  2440. bounds.left += (bounds.width - bounds.height) / 2;
  2441. bounds.width = bounds.height;
  2442. } else if (bounds.width < bounds.height) {
  2443. bounds.top += (bounds.height - bounds.width) / 2;
  2444. bounds.height = bounds.width;
  2445. }
  2446. return bounds;
  2447. };
  2448. var inlineFormElement = function inlineFormElement(value, node, container, allowLinebreak) {
  2449. var body = node.ownerDocument.body;
  2450. if (value.length > 0 && body) {
  2451. var wrapper = node.ownerDocument.createElement('html2canvaswrapper');
  2452. (0, _Util.copyCSSStyles)(node.ownerDocument.defaultView.getComputedStyle(node, null), wrapper);
  2453. wrapper.style.position = 'absolute';
  2454. wrapper.style.left = container.bounds.left + 'px';
  2455. wrapper.style.top = container.bounds.top + 'px';
  2456. if (!allowLinebreak) {
  2457. wrapper.style.whiteSpace = 'nowrap';
  2458. }
  2459. var text = node.ownerDocument.createTextNode(value);
  2460. wrapper.appendChild(text);
  2461. body.appendChild(wrapper);
  2462. container.childNodes.push(_TextContainer2.default.fromTextNode(text, container));
  2463. body.removeChild(wrapper);
  2464. }
  2465. };
  2466. var getInputValue = function getInputValue(node) {
  2467. var value = node.type === 'password' ? new Array(node.value.length + 1).join('\u2022') : node.value;
  2468. return value.length === 0 ? node.placeholder || '' : value;
  2469. };
  2470. /***/ }),
  2471. /* 22 */
  2472. /***/ (function(module, exports, __webpack_require__) {
  2473. "use strict";
  2474. Object.defineProperty(exports, "__esModule", {
  2475. value: true
  2476. });
  2477. exports.parseTextBounds = exports.TextBounds = undefined;
  2478. var _Bounds = __webpack_require__(1);
  2479. var _textDecoration = __webpack_require__(11);
  2480. var _Feature = __webpack_require__(10);
  2481. var _Feature2 = _interopRequireDefault(_Feature);
  2482. var _Unicode = __webpack_require__(24);
  2483. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  2484. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2485. var TextBounds = exports.TextBounds = function TextBounds(text, bounds) {
  2486. _classCallCheck(this, TextBounds);
  2487. this.text = text;
  2488. this.bounds = bounds;
  2489. };
  2490. var parseTextBounds = exports.parseTextBounds = function parseTextBounds(value, parent, node) {
  2491. var letterRendering = parent.style.letterSpacing !== 0;
  2492. var textList = letterRendering ? (0, _Unicode.toCodePoints)(value).map(function (i) {
  2493. return (0, _Unicode.fromCodePoint)(i);
  2494. }) : (0, _Unicode.breakWords)(value, parent);
  2495. var length = textList.length;
  2496. var defaultView = node.parentNode ? node.parentNode.ownerDocument.defaultView : null;
  2497. var scrollX = defaultView ? defaultView.pageXOffset : 0;
  2498. var scrollY = defaultView ? defaultView.pageYOffset : 0;
  2499. var textBounds = [];
  2500. var offset = 0;
  2501. for (var i = 0; i < length; i++) {
  2502. var text = textList[i];
  2503. if (parent.style.textDecoration !== _textDecoration.TEXT_DECORATION.NONE || text.trim().length > 0) {
  2504. if (_Feature2.default.SUPPORT_RANGE_BOUNDS) {
  2505. textBounds.push(new TextBounds(text, getRangeBounds(node, offset, text.length, scrollX, scrollY)));
  2506. } else {
  2507. var replacementNode = node.splitText(text.length);
  2508. textBounds.push(new TextBounds(text, getWrapperBounds(node, scrollX, scrollY)));
  2509. node = replacementNode;
  2510. }
  2511. } else if (!_Feature2.default.SUPPORT_RANGE_BOUNDS) {
  2512. node = node.splitText(text.length);
  2513. }
  2514. offset += text.length;
  2515. }
  2516. return textBounds;
  2517. };
  2518. var getWrapperBounds = function getWrapperBounds(node, scrollX, scrollY) {
  2519. var wrapper = node.ownerDocument.createElement('html2canvaswrapper');
  2520. wrapper.appendChild(node.cloneNode(true));
  2521. var parentNode = node.parentNode;
  2522. if (parentNode) {
  2523. parentNode.replaceChild(wrapper, node);
  2524. var bounds = (0, _Bounds.parseBounds)(wrapper, scrollX, scrollY);
  2525. if (wrapper.firstChild) {
  2526. parentNode.replaceChild(wrapper.firstChild, wrapper);
  2527. }
  2528. return bounds;
  2529. }
  2530. return new _Bounds.Bounds(0, 0, 0, 0);
  2531. };
  2532. var getRangeBounds = function getRangeBounds(node, offset, length, scrollX, scrollY) {
  2533. var range = node.ownerDocument.createRange();
  2534. range.setStart(node, offset);
  2535. range.setEnd(node, offset + length);
  2536. return _Bounds.Bounds.fromClientRect(range.getBoundingClientRect(), scrollX, scrollY);
  2537. };
  2538. /***/ }),
  2539. /* 23 */
  2540. /***/ (function(module, exports, __webpack_require__) {
  2541. "use strict";
  2542. Object.defineProperty(exports, "__esModule", {
  2543. value: true
  2544. });
  2545. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  2546. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2547. var ForeignObjectRenderer = function () {
  2548. function ForeignObjectRenderer(element) {
  2549. _classCallCheck(this, ForeignObjectRenderer);
  2550. this.element = element;
  2551. }
  2552. _createClass(ForeignObjectRenderer, [{
  2553. key: 'render',
  2554. value: function render(options) {
  2555. var _this = this;
  2556. this.options = options;
  2557. this.canvas = document.createElement('canvas');
  2558. this.ctx = this.canvas.getContext('2d');
  2559. this.canvas.width = Math.floor(options.width) * options.scale;
  2560. this.canvas.height = Math.floor(options.height) * options.scale;
  2561. this.canvas.style.width = options.width + 'px';
  2562. this.canvas.style.height = options.height + 'px';
  2563. options.logger.log('ForeignObject renderer initialized (' + options.width + 'x' + options.height + ' at ' + options.x + ',' + options.y + ') with scale ' + options.scale);
  2564. var svg = createForeignObjectSVG(Math.max(options.windowWidth, options.width) * options.scale, Math.max(options.windowHeight, options.height) * options.scale, options.scrollX * options.scale, options.scrollY * options.scale, this.element);
  2565. return loadSerializedSVG(svg).then(function (img) {
  2566. if (options.backgroundColor) {
  2567. _this.ctx.fillStyle = options.backgroundColor.toString();
  2568. _this.ctx.fillRect(0, 0, options.width * options.scale, options.height * options.scale);
  2569. }
  2570. _this.ctx.drawImage(img, -options.x * options.scale, -options.y * options.scale);
  2571. return _this.canvas;
  2572. });
  2573. }
  2574. }]);
  2575. return ForeignObjectRenderer;
  2576. }();
  2577. exports.default = ForeignObjectRenderer;
  2578. var createForeignObjectSVG = exports.createForeignObjectSVG = function createForeignObjectSVG(width, height, x, y, node) {
  2579. var xmlns = 'http://www.w3.org/2000/svg';
  2580. var svg = document.createElementNS(xmlns, 'svg');
  2581. var foreignObject = document.createElementNS(xmlns, 'foreignObject');
  2582. svg.setAttributeNS(null, 'width', width);
  2583. svg.setAttributeNS(null, 'height', height);
  2584. foreignObject.setAttributeNS(null, 'width', '100%');
  2585. foreignObject.setAttributeNS(null, 'height', '100%');
  2586. foreignObject.setAttributeNS(null, 'x', x);
  2587. foreignObject.setAttributeNS(null, 'y', y);
  2588. foreignObject.setAttributeNS(null, 'externalResourcesRequired', 'true');
  2589. svg.appendChild(foreignObject);
  2590. foreignObject.appendChild(node);
  2591. return svg;
  2592. };
  2593. var loadSerializedSVG = exports.loadSerializedSVG = function loadSerializedSVG(svg) {
  2594. return new Promise(function (resolve, reject) {
  2595. var img = new Image();
  2596. img.onload = function () {
  2597. return resolve(img);
  2598. };
  2599. img.onerror = reject;
  2600. img.src = 'data:image/svg+xml;charset=utf-8,' + encodeURIComponent(new XMLSerializer().serializeToString(svg));
  2601. });
  2602. };
  2603. /***/ }),
  2604. /* 24 */
  2605. /***/ (function(module, exports, __webpack_require__) {
  2606. "use strict";
  2607. Object.defineProperty(exports, "__esModule", {
  2608. value: true
  2609. });
  2610. exports.breakWords = exports.fromCodePoint = exports.toCodePoints = undefined;
  2611. var _cssLineBreak = __webpack_require__(46);
  2612. Object.defineProperty(exports, 'toCodePoints', {
  2613. enumerable: true,
  2614. get: function get() {
  2615. return _cssLineBreak.toCodePoints;
  2616. }
  2617. });
  2618. Object.defineProperty(exports, 'fromCodePoint', {
  2619. enumerable: true,
  2620. get: function get() {
  2621. return _cssLineBreak.fromCodePoint;
  2622. }
  2623. });
  2624. var _NodeContainer = __webpack_require__(3);
  2625. var _NodeContainer2 = _interopRequireDefault(_NodeContainer);
  2626. var _overflowWrap = __webpack_require__(18);
  2627. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  2628. var breakWords = exports.breakWords = function breakWords(str, parent) {
  2629. var breaker = (0, _cssLineBreak.LineBreaker)(str, {
  2630. lineBreak: parent.style.lineBreak,
  2631. wordBreak: parent.style.overflowWrap === _overflowWrap.OVERFLOW_WRAP.BREAK_WORD ? 'break-word' : parent.style.wordBreak
  2632. });
  2633. var words = [];
  2634. var bk = void 0;
  2635. while (!(bk = breaker.next()).done) {
  2636. words.push(bk.value.slice());
  2637. }
  2638. return words;
  2639. };
  2640. /***/ }),
  2641. /* 25 */
  2642. /***/ (function(module, exports, __webpack_require__) {
  2643. "use strict";
  2644. Object.defineProperty(exports, "__esModule", {
  2645. value: true
  2646. });
  2647. exports.FontMetrics = undefined;
  2648. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  2649. var _Util = __webpack_require__(4);
  2650. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2651. var SAMPLE_TEXT = 'Hidden Text';
  2652. var FontMetrics = exports.FontMetrics = function () {
  2653. function FontMetrics(document) {
  2654. _classCallCheck(this, FontMetrics);
  2655. this._data = {};
  2656. this._document = document;
  2657. }
  2658. _createClass(FontMetrics, [{
  2659. key: '_parseMetrics',
  2660. value: function _parseMetrics(font) {
  2661. var container = this._document.createElement('div');
  2662. var img = this._document.createElement('img');
  2663. var span = this._document.createElement('span');
  2664. var body = this._document.body;
  2665. if (!body) {
  2666. throw new Error( true ? 'No document found for font metrics' : '');
  2667. }
  2668. container.style.visibility = 'hidden';
  2669. container.style.fontFamily = font.fontFamily;
  2670. container.style.fontSize = font.fontSize;
  2671. container.style.margin = '0';
  2672. container.style.padding = '0';
  2673. body.appendChild(container);
  2674. img.src = _Util.SMALL_IMAGE;
  2675. img.width = 1;
  2676. img.height = 1;
  2677. img.style.margin = '0';
  2678. img.style.padding = '0';
  2679. img.style.verticalAlign = 'baseline';
  2680. span.style.fontFamily = font.fontFamily;
  2681. span.style.fontSize = font.fontSize;
  2682. span.style.margin = '0';
  2683. span.style.padding = '0';
  2684. span.appendChild(this._document.createTextNode(SAMPLE_TEXT));
  2685. container.appendChild(span);
  2686. container.appendChild(img);
  2687. var baseline = img.offsetTop - span.offsetTop + 2;
  2688. container.removeChild(span);
  2689. container.appendChild(this._document.createTextNode(SAMPLE_TEXT));
  2690. container.style.lineHeight = 'normal';
  2691. img.style.verticalAlign = 'super';
  2692. var middle = img.offsetTop - container.offsetTop + 2;
  2693. body.removeChild(container);
  2694. return { baseline: baseline, middle: middle };
  2695. }
  2696. }, {
  2697. key: 'getMetrics',
  2698. value: function getMetrics(font) {
  2699. var key = font.fontFamily + ' ' + font.fontSize;
  2700. if (this._data[key] === undefined) {
  2701. this._data[key] = this._parseMetrics(font);
  2702. }
  2703. return this._data[key];
  2704. }
  2705. }]);
  2706. return FontMetrics;
  2707. }();
  2708. /***/ }),
  2709. /* 26 */
  2710. /***/ (function(module, exports, __webpack_require__) {
  2711. "use strict";
  2712. Object.defineProperty(exports, "__esModule", {
  2713. value: true
  2714. });
  2715. exports.Proxy = undefined;
  2716. var _Feature = __webpack_require__(10);
  2717. var _Feature2 = _interopRequireDefault(_Feature);
  2718. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  2719. var Proxy = exports.Proxy = function Proxy(src, options) {
  2720. if (!options.proxy) {
  2721. return Promise.reject( true ? 'No proxy defined' : null);
  2722. }
  2723. var proxy = options.proxy;
  2724. return new Promise(function (resolve, reject) {
  2725. var responseType = _Feature2.default.SUPPORT_CORS_XHR && _Feature2.default.SUPPORT_RESPONSE_TYPE ? 'blob' : 'text';
  2726. var xhr = _Feature2.default.SUPPORT_CORS_XHR ? new XMLHttpRequest() : new XDomainRequest();
  2727. xhr.onload = function () {
  2728. if (xhr instanceof XMLHttpRequest) {
  2729. if (xhr.status === 200) {
  2730. if (responseType === 'text') {
  2731. resolve(xhr.response);
  2732. } else {
  2733. var reader = new FileReader();
  2734. // $FlowFixMe
  2735. reader.addEventListener('load', function () {
  2736. return resolve(reader.result);
  2737. }, false);
  2738. // $FlowFixMe
  2739. reader.addEventListener('error', function (e) {
  2740. return reject(e);
  2741. }, false);
  2742. reader.readAsDataURL(xhr.response);
  2743. }
  2744. } else {
  2745. reject( true ? 'Failed to proxy resource ' + src.substring(0, 256) + ' with status code ' + xhr.status : '');
  2746. }
  2747. } else {
  2748. resolve(xhr.responseText);
  2749. }
  2750. };
  2751. xhr.onerror = reject;
  2752. xhr.open('GET', proxy + '?url=' + encodeURIComponent(src) + '&responseType=' + responseType);
  2753. if (responseType !== 'text' && xhr instanceof XMLHttpRequest) {
  2754. xhr.responseType = responseType;
  2755. }
  2756. if (options.imageTimeout) {
  2757. var timeout = options.imageTimeout;
  2758. xhr.timeout = timeout;
  2759. xhr.ontimeout = function () {
  2760. return reject( true ? 'Timed out (' + timeout + 'ms) proxying ' + src.substring(0, 256) : '');
  2761. };
  2762. }
  2763. xhr.send();
  2764. });
  2765. };
  2766. /***/ }),
  2767. /* 27 */
  2768. /***/ (function(module, exports, __webpack_require__) {
  2769. "use strict";
  2770. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  2771. var _CanvasRenderer = __webpack_require__(15);
  2772. var _CanvasRenderer2 = _interopRequireDefault(_CanvasRenderer);
  2773. var _Logger = __webpack_require__(16);
  2774. var _Logger2 = _interopRequireDefault(_Logger);
  2775. var _Window = __webpack_require__(28);
  2776. var _Bounds = __webpack_require__(1);
  2777. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  2778. var html2canvas = function html2canvas(element, conf) {
  2779. var config = conf || {};
  2780. var logger = new _Logger2.default(typeof config.logging === 'boolean' ? config.logging : true);
  2781. logger.log('html2canvas ' + "1.0.0-alpha.10");
  2782. if (true && typeof config.onrendered === 'function') {
  2783. logger.error('onrendered option is deprecated, html2canvas returns a Promise with the canvas as the value');
  2784. }
  2785. var ownerDocument = element.ownerDocument;
  2786. if (!ownerDocument) {
  2787. return Promise.reject('Provided element is not within a Document');
  2788. }
  2789. var defaultView = ownerDocument.defaultView;
  2790. var scrollX = defaultView.pageXOffset;
  2791. var scrollY = defaultView.pageYOffset;
  2792. var isDocument = element.tagName === 'HTML' || element.tagName === 'BODY';
  2793. var _ref = isDocument ? (0, _Bounds.parseDocumentSize)(ownerDocument) : (0, _Bounds.parseBounds)(element, scrollX, scrollY),
  2794. width = _ref.width,
  2795. height = _ref.height,
  2796. left = _ref.left,
  2797. top = _ref.top;
  2798. var defaultOptions = {
  2799. async: true,
  2800. allowTaint: false,
  2801. backgroundColor: '#ffffff',
  2802. imageTimeout: 15000,
  2803. logging: true,
  2804. proxy: null,
  2805. removeContainer: true,
  2806. foreignObjectRendering: false,
  2807. scale: defaultView.devicePixelRatio || 1,
  2808. target: new _CanvasRenderer2.default(config.canvas),
  2809. useCORS: false,
  2810. x: left,
  2811. y: top,
  2812. width: Math.ceil(width),
  2813. height: Math.ceil(height),
  2814. windowWidth: defaultView.innerWidth,
  2815. windowHeight: defaultView.innerHeight,
  2816. scrollX: defaultView.pageXOffset,
  2817. scrollY: defaultView.pageYOffset
  2818. };
  2819. var result = (0, _Window.renderElement)(element, _extends({}, defaultOptions, config), logger);
  2820. if (true) {
  2821. return result.catch(function (e) {
  2822. logger.error(e);
  2823. throw e;
  2824. });
  2825. }
  2826. return result;
  2827. };
  2828. html2canvas.CanvasRenderer = _CanvasRenderer2.default;
  2829. module.exports = html2canvas;
  2830. /***/ }),
  2831. /* 28 */
  2832. /***/ (function(module, exports, __webpack_require__) {
  2833. "use strict";
  2834. Object.defineProperty(exports, "__esModule", {
  2835. value: true
  2836. });
  2837. exports.renderElement = undefined;
  2838. var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
  2839. var _Logger = __webpack_require__(16);
  2840. var _Logger2 = _interopRequireDefault(_Logger);
  2841. var _NodeParser = __webpack_require__(29);
  2842. var _Renderer = __webpack_require__(51);
  2843. var _Renderer2 = _interopRequireDefault(_Renderer);
  2844. var _ForeignObjectRenderer = __webpack_require__(23);
  2845. var _ForeignObjectRenderer2 = _interopRequireDefault(_ForeignObjectRenderer);
  2846. var _Feature = __webpack_require__(10);
  2847. var _Feature2 = _interopRequireDefault(_Feature);
  2848. var _Bounds = __webpack_require__(1);
  2849. var _Clone = __webpack_require__(54);
  2850. var _Font = __webpack_require__(25);
  2851. var _Color = __webpack_require__(0);
  2852. var _Color2 = _interopRequireDefault(_Color);
  2853. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  2854. var renderElement = exports.renderElement = function renderElement(element, options, logger) {
  2855. var ownerDocument = element.ownerDocument;
  2856. var windowBounds = new _Bounds.Bounds(options.scrollX, options.scrollY, options.windowWidth, options.windowHeight);
  2857. // http://www.w3.org/TR/css3-background/#special-backgrounds
  2858. var documentBackgroundColor = ownerDocument.documentElement ? new _Color2.default(getComputedStyle(ownerDocument.documentElement).backgroundColor) : _Color.TRANSPARENT;
  2859. var bodyBackgroundColor = ownerDocument.body ? new _Color2.default(getComputedStyle(ownerDocument.body).backgroundColor) : _Color.TRANSPARENT;
  2860. var backgroundColor = element === ownerDocument.documentElement ? documentBackgroundColor.isTransparent() ? bodyBackgroundColor.isTransparent() ? options.backgroundColor ? new _Color2.default(options.backgroundColor) : null : bodyBackgroundColor : documentBackgroundColor : options.backgroundColor ? new _Color2.default(options.backgroundColor) : null;
  2861. return (options.foreignObjectRendering ? // $FlowFixMe
  2862. _Feature2.default.SUPPORT_FOREIGNOBJECT_DRAWING : Promise.resolve(false)).then(function (supportForeignObject) {
  2863. return supportForeignObject ? function (cloner) {
  2864. if (true) {
  2865. logger.log('Document cloned, using foreignObject rendering');
  2866. }
  2867. return cloner.inlineFonts(ownerDocument).then(function () {
  2868. return cloner.resourceLoader.ready();
  2869. }).then(function () {
  2870. var renderer = new _ForeignObjectRenderer2.default(cloner.documentElement);
  2871. return renderer.render({
  2872. backgroundColor: backgroundColor,
  2873. logger: logger,
  2874. scale: options.scale,
  2875. x: options.x,
  2876. y: options.y,
  2877. width: options.width,
  2878. height: options.height,
  2879. windowWidth: options.windowWidth,
  2880. windowHeight: options.windowHeight,
  2881. scrollX: options.scrollX,
  2882. scrollY: options.scrollY
  2883. });
  2884. });
  2885. }(new _Clone.DocumentCloner(element, options, logger, true, renderElement)) : (0, _Clone.cloneWindow)(ownerDocument, windowBounds, element, options, logger, renderElement).then(function (_ref) {
  2886. var _ref2 = _slicedToArray(_ref, 3),
  2887. container = _ref2[0],
  2888. clonedElement = _ref2[1],
  2889. resourceLoader = _ref2[2];
  2890. if (true) {
  2891. logger.log('Document cloned, using computed rendering');
  2892. }
  2893. var stack = (0, _NodeParser.NodeParser)(clonedElement, resourceLoader, logger);
  2894. var clonedDocument = clonedElement.ownerDocument;
  2895. if (backgroundColor === stack.container.style.background.backgroundColor) {
  2896. stack.container.style.background.backgroundColor = _Color.TRANSPARENT;
  2897. }
  2898. return resourceLoader.ready().then(function (imageStore) {
  2899. var fontMetrics = new _Font.FontMetrics(clonedDocument);
  2900. if (true) {
  2901. logger.log('Starting renderer');
  2902. }
  2903. var renderOptions = {
  2904. backgroundColor: backgroundColor,
  2905. fontMetrics: fontMetrics,
  2906. imageStore: imageStore,
  2907. logger: logger,
  2908. scale: options.scale,
  2909. x: options.x,
  2910. y: options.y,
  2911. width: options.width,
  2912. height: options.height
  2913. };
  2914. if (Array.isArray(options.target)) {
  2915. return Promise.all(options.target.map(function (target) {
  2916. var renderer = new _Renderer2.default(target, renderOptions);
  2917. return renderer.render(stack);
  2918. }));
  2919. } else {
  2920. var renderer = new _Renderer2.default(options.target, renderOptions);
  2921. var canvas = renderer.render(stack);
  2922. if (options.removeContainer === true) {
  2923. if (container.parentNode) {
  2924. container.parentNode.removeChild(container);
  2925. } else if (true) {
  2926. logger.log('Cannot detach cloned iframe as it is not in the DOM anymore');
  2927. }
  2928. }
  2929. return canvas;
  2930. }
  2931. });
  2932. });
  2933. });
  2934. };
  2935. /***/ }),
  2936. /* 29 */
  2937. /***/ (function(module, exports, __webpack_require__) {
  2938. "use strict";
  2939. Object.defineProperty(exports, "__esModule", {
  2940. value: true
  2941. });
  2942. exports.NodeParser = undefined;
  2943. var _StackingContext = __webpack_require__(30);
  2944. var _StackingContext2 = _interopRequireDefault(_StackingContext);
  2945. var _NodeContainer = __webpack_require__(3);
  2946. var _NodeContainer2 = _interopRequireDefault(_NodeContainer);
  2947. var _TextContainer = __webpack_require__(9);
  2948. var _TextContainer2 = _interopRequireDefault(_TextContainer);
  2949. var _Input = __webpack_require__(21);
  2950. var _ListItem = __webpack_require__(14);
  2951. var _listStyle = __webpack_require__(8);
  2952. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  2953. var NodeParser = exports.NodeParser = function NodeParser(node, resourceLoader, logger) {
  2954. if (true) {
  2955. logger.log('Starting node parsing');
  2956. }
  2957. var index = 0;
  2958. var container = new _NodeContainer2.default(node, null, resourceLoader, index++);
  2959. var stack = new _StackingContext2.default(container, null, true);
  2960. parseNodeTree(node, container, stack, resourceLoader, index);
  2961. if (true) {
  2962. logger.log('Finished parsing node tree');
  2963. }
  2964. return stack;
  2965. };
  2966. var IGNORED_NODE_NAMES = ['SCRIPT', 'HEAD', 'TITLE', 'OBJECT', 'BR', 'OPTION'];
  2967. var parseNodeTree = function parseNodeTree(node, parent, stack, resourceLoader, index) {
  2968. if (true && index > 50000) {
  2969. throw new Error('Recursion error while parsing node tree');
  2970. }
  2971. for (var childNode = node.firstChild, nextNode; childNode; childNode = nextNode) {
  2972. nextNode = childNode.nextSibling;
  2973. var defaultView = childNode.ownerDocument.defaultView;
  2974. if (childNode instanceof defaultView.Text || childNode instanceof Text || defaultView.parent && childNode instanceof defaultView.parent.Text) {
  2975. if (childNode.data.trim().length > 0) {
  2976. parent.childNodes.push(_TextContainer2.default.fromTextNode(childNode, parent));
  2977. }
  2978. } else if (childNode instanceof defaultView.HTMLElement || childNode instanceof HTMLElement || defaultView.parent && childNode instanceof defaultView.parent.HTMLElement) {
  2979. if (IGNORED_NODE_NAMES.indexOf(childNode.nodeName) === -1) {
  2980. var container = new _NodeContainer2.default(childNode, parent, resourceLoader, index++);
  2981. if (container.isVisible()) {
  2982. if (childNode.tagName === 'INPUT') {
  2983. // $FlowFixMe
  2984. (0, _Input.inlineInputElement)(childNode, container);
  2985. } else if (childNode.tagName === 'TEXTAREA') {
  2986. // $FlowFixMe
  2987. (0, _Input.inlineTextAreaElement)(childNode, container);
  2988. } else if (childNode.tagName === 'SELECT') {
  2989. // $FlowFixMe
  2990. (0, _Input.inlineSelectElement)(childNode, container);
  2991. } else if (container.style.listStyle && container.style.listStyle.listStyleType !== _listStyle.LIST_STYLE_TYPE.NONE) {
  2992. (0, _ListItem.inlineListItemElement)(childNode, container, resourceLoader);
  2993. }
  2994. var SHOULD_TRAVERSE_CHILDREN = childNode.tagName !== 'TEXTAREA';
  2995. var treatAsRealStackingContext = createsRealStackingContext(container, childNode);
  2996. if (treatAsRealStackingContext || createsStackingContext(container)) {
  2997. // for treatAsRealStackingContext:false, any positioned descendants and descendants
  2998. // which actually create a new stacking context should be considered part of the parent stacking context
  2999. var parentStack = treatAsRealStackingContext || container.isPositioned() ? stack.getRealParentStackingContext() : stack;
  3000. var childStack = new _StackingContext2.default(container, parentStack, treatAsRealStackingContext);
  3001. parentStack.contexts.push(childStack);
  3002. if (SHOULD_TRAVERSE_CHILDREN) {
  3003. parseNodeTree(childNode, container, childStack, resourceLoader, index);
  3004. }
  3005. } else {
  3006. stack.children.push(container);
  3007. if (SHOULD_TRAVERSE_CHILDREN) {
  3008. parseNodeTree(childNode, container, stack, resourceLoader, index);
  3009. }
  3010. }
  3011. }
  3012. }
  3013. } else if (childNode instanceof defaultView.SVGSVGElement || childNode instanceof SVGSVGElement || defaultView.parent && childNode instanceof defaultView.parent.SVGSVGElement) {
  3014. var _container = new _NodeContainer2.default(childNode, parent, resourceLoader, index++);
  3015. var _treatAsRealStackingContext = createsRealStackingContext(_container, childNode);
  3016. if (_treatAsRealStackingContext || createsStackingContext(_container)) {
  3017. // for treatAsRealStackingContext:false, any positioned descendants and descendants
  3018. // which actually create a new stacking context should be considered part of the parent stacking context
  3019. var _parentStack = _treatAsRealStackingContext || _container.isPositioned() ? stack.getRealParentStackingContext() : stack;
  3020. var _childStack = new _StackingContext2.default(_container, _parentStack, _treatAsRealStackingContext);
  3021. _parentStack.contexts.push(_childStack);
  3022. } else {
  3023. stack.children.push(_container);
  3024. }
  3025. }
  3026. }
  3027. };
  3028. var createsRealStackingContext = function createsRealStackingContext(container, node) {
  3029. return container.isRootElement() || container.isPositionedWithZIndex() || container.style.opacity < 1 || container.isTransformed() || isBodyWithTransparentRoot(container, node);
  3030. };
  3031. var createsStackingContext = function createsStackingContext(container) {
  3032. return container.isPositioned() || container.isFloating();
  3033. };
  3034. var isBodyWithTransparentRoot = function isBodyWithTransparentRoot(container, node) {
  3035. return node.nodeName === 'BODY' && container.parent instanceof _NodeContainer2.default && container.parent.style.background.backgroundColor.isTransparent();
  3036. };
  3037. /***/ }),
  3038. /* 30 */
  3039. /***/ (function(module, exports, __webpack_require__) {
  3040. "use strict";
  3041. Object.defineProperty(exports, "__esModule", {
  3042. value: true
  3043. });
  3044. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  3045. var _NodeContainer = __webpack_require__(3);
  3046. var _NodeContainer2 = _interopRequireDefault(_NodeContainer);
  3047. var _position = __webpack_require__(19);
  3048. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3049. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3050. var StackingContext = function () {
  3051. function StackingContext(container, parent, treatAsRealStackingContext) {
  3052. _classCallCheck(this, StackingContext);
  3053. this.container = container;
  3054. this.parent = parent;
  3055. this.contexts = [];
  3056. this.children = [];
  3057. this.treatAsRealStackingContext = treatAsRealStackingContext;
  3058. }
  3059. _createClass(StackingContext, [{
  3060. key: 'getOpacity',
  3061. value: function getOpacity() {
  3062. return this.parent ? this.container.style.opacity * this.parent.getOpacity() : this.container.style.opacity;
  3063. }
  3064. }, {
  3065. key: 'getRealParentStackingContext',
  3066. value: function getRealParentStackingContext() {
  3067. return !this.parent || this.treatAsRealStackingContext ? this : this.parent.getRealParentStackingContext();
  3068. }
  3069. }]);
  3070. return StackingContext;
  3071. }();
  3072. exports.default = StackingContext;
  3073. /***/ }),
  3074. /* 31 */
  3075. /***/ (function(module, exports, __webpack_require__) {
  3076. "use strict";
  3077. Object.defineProperty(exports, "__esModule", {
  3078. value: true
  3079. });
  3080. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3081. var Size = function Size(width, height) {
  3082. _classCallCheck(this, Size);
  3083. this.width = width;
  3084. this.height = height;
  3085. };
  3086. exports.default = Size;
  3087. /***/ }),
  3088. /* 32 */
  3089. /***/ (function(module, exports, __webpack_require__) {
  3090. "use strict";
  3091. Object.defineProperty(exports, "__esModule", {
  3092. value: true
  3093. });
  3094. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  3095. var _Path = __webpack_require__(6);
  3096. var _Vector = __webpack_require__(7);
  3097. var _Vector2 = _interopRequireDefault(_Vector);
  3098. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3099. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3100. var lerp = function lerp(a, b, t) {
  3101. return new _Vector2.default(a.x + (b.x - a.x) * t, a.y + (b.y - a.y) * t);
  3102. };
  3103. var BezierCurve = function () {
  3104. function BezierCurve(start, startControl, endControl, end) {
  3105. _classCallCheck(this, BezierCurve);
  3106. this.type = _Path.PATH.BEZIER_CURVE;
  3107. this.start = start;
  3108. this.startControl = startControl;
  3109. this.endControl = endControl;
  3110. this.end = end;
  3111. }
  3112. _createClass(BezierCurve, [{
  3113. key: 'subdivide',
  3114. value: function subdivide(t, firstHalf) {
  3115. var ab = lerp(this.start, this.startControl, t);
  3116. var bc = lerp(this.startControl, this.endControl, t);
  3117. var cd = lerp(this.endControl, this.end, t);
  3118. var abbc = lerp(ab, bc, t);
  3119. var bccd = lerp(bc, cd, t);
  3120. var dest = lerp(abbc, bccd, t);
  3121. return firstHalf ? new BezierCurve(this.start, ab, abbc, dest) : new BezierCurve(dest, bccd, cd, this.end);
  3122. }
  3123. }, {
  3124. key: 'reverse',
  3125. value: function reverse() {
  3126. return new BezierCurve(this.end, this.endControl, this.startControl, this.start);
  3127. }
  3128. }]);
  3129. return BezierCurve;
  3130. }();
  3131. exports.default = BezierCurve;
  3132. /***/ }),
  3133. /* 33 */
  3134. /***/ (function(module, exports, __webpack_require__) {
  3135. "use strict";
  3136. Object.defineProperty(exports, "__esModule", {
  3137. value: true
  3138. });
  3139. exports.parseBorderRadius = undefined;
  3140. var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
  3141. var _Length = __webpack_require__(2);
  3142. var _Length2 = _interopRequireDefault(_Length);
  3143. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3144. var SIDES = ['top-left', 'top-right', 'bottom-right', 'bottom-left'];
  3145. var parseBorderRadius = exports.parseBorderRadius = function parseBorderRadius(style) {
  3146. return SIDES.map(function (side) {
  3147. var value = style.getPropertyValue('border-' + side + '-radius');
  3148. var _value$split$map = value.split(' ').map(_Length2.default.create),
  3149. _value$split$map2 = _slicedToArray(_value$split$map, 2),
  3150. horizontal = _value$split$map2[0],
  3151. vertical = _value$split$map2[1];
  3152. return typeof vertical === 'undefined' ? [horizontal, horizontal] : [horizontal, vertical];
  3153. });
  3154. };
  3155. /***/ }),
  3156. /* 34 */
  3157. /***/ (function(module, exports, __webpack_require__) {
  3158. "use strict";
  3159. Object.defineProperty(exports, "__esModule", {
  3160. value: true
  3161. });
  3162. var DISPLAY = exports.DISPLAY = {
  3163. NONE: 1 << 0,
  3164. BLOCK: 1 << 1,
  3165. INLINE: 1 << 2,
  3166. RUN_IN: 1 << 3,
  3167. FLOW: 1 << 4,
  3168. FLOW_ROOT: 1 << 5,
  3169. TABLE: 1 << 6,
  3170. FLEX: 1 << 7,
  3171. GRID: 1 << 8,
  3172. RUBY: 1 << 9,
  3173. SUBGRID: 1 << 10,
  3174. LIST_ITEM: 1 << 11,
  3175. TABLE_ROW_GROUP: 1 << 12,
  3176. TABLE_HEADER_GROUP: 1 << 13,
  3177. TABLE_FOOTER_GROUP: 1 << 14,
  3178. TABLE_ROW: 1 << 15,
  3179. TABLE_CELL: 1 << 16,
  3180. TABLE_COLUMN_GROUP: 1 << 17,
  3181. TABLE_COLUMN: 1 << 18,
  3182. TABLE_CAPTION: 1 << 19,
  3183. RUBY_BASE: 1 << 20,
  3184. RUBY_TEXT: 1 << 21,
  3185. RUBY_BASE_CONTAINER: 1 << 22,
  3186. RUBY_TEXT_CONTAINER: 1 << 23,
  3187. CONTENTS: 1 << 24,
  3188. INLINE_BLOCK: 1 << 25,
  3189. INLINE_LIST_ITEM: 1 << 26,
  3190. INLINE_TABLE: 1 << 27,
  3191. INLINE_FLEX: 1 << 28,
  3192. INLINE_GRID: 1 << 29
  3193. };
  3194. var parseDisplayValue = function parseDisplayValue(display) {
  3195. switch (display) {
  3196. case 'block':
  3197. return DISPLAY.BLOCK;
  3198. case 'inline':
  3199. return DISPLAY.INLINE;
  3200. case 'run-in':
  3201. return DISPLAY.RUN_IN;
  3202. case 'flow':
  3203. return DISPLAY.FLOW;
  3204. case 'flow-root':
  3205. return DISPLAY.FLOW_ROOT;
  3206. case 'table':
  3207. return DISPLAY.TABLE;
  3208. case 'flex':
  3209. return DISPLAY.FLEX;
  3210. case 'grid':
  3211. return DISPLAY.GRID;
  3212. case 'ruby':
  3213. return DISPLAY.RUBY;
  3214. case 'subgrid':
  3215. return DISPLAY.SUBGRID;
  3216. case 'list-item':
  3217. return DISPLAY.LIST_ITEM;
  3218. case 'table-row-group':
  3219. return DISPLAY.TABLE_ROW_GROUP;
  3220. case 'table-header-group':
  3221. return DISPLAY.TABLE_HEADER_GROUP;
  3222. case 'table-footer-group':
  3223. return DISPLAY.TABLE_FOOTER_GROUP;
  3224. case 'table-row':
  3225. return DISPLAY.TABLE_ROW;
  3226. case 'table-cell':
  3227. return DISPLAY.TABLE_CELL;
  3228. case 'table-column-group':
  3229. return DISPLAY.TABLE_COLUMN_GROUP;
  3230. case 'table-column':
  3231. return DISPLAY.TABLE_COLUMN;
  3232. case 'table-caption':
  3233. return DISPLAY.TABLE_CAPTION;
  3234. case 'ruby-base':
  3235. return DISPLAY.RUBY_BASE;
  3236. case 'ruby-text':
  3237. return DISPLAY.RUBY_TEXT;
  3238. case 'ruby-base-container':
  3239. return DISPLAY.RUBY_BASE_CONTAINER;
  3240. case 'ruby-text-container':
  3241. return DISPLAY.RUBY_TEXT_CONTAINER;
  3242. case 'contents':
  3243. return DISPLAY.CONTENTS;
  3244. case 'inline-block':
  3245. return DISPLAY.INLINE_BLOCK;
  3246. case 'inline-list-item':
  3247. return DISPLAY.INLINE_LIST_ITEM;
  3248. case 'inline-table':
  3249. return DISPLAY.INLINE_TABLE;
  3250. case 'inline-flex':
  3251. return DISPLAY.INLINE_FLEX;
  3252. case 'inline-grid':
  3253. return DISPLAY.INLINE_GRID;
  3254. }
  3255. return DISPLAY.NONE;
  3256. };
  3257. var setDisplayBit = function setDisplayBit(bit, display) {
  3258. return bit | parseDisplayValue(display);
  3259. };
  3260. var parseDisplay = exports.parseDisplay = function parseDisplay(display) {
  3261. return display.split(' ').reduce(setDisplayBit, 0);
  3262. };
  3263. /***/ }),
  3264. /* 35 */
  3265. /***/ (function(module, exports, __webpack_require__) {
  3266. "use strict";
  3267. Object.defineProperty(exports, "__esModule", {
  3268. value: true
  3269. });
  3270. var FLOAT = exports.FLOAT = {
  3271. NONE: 0,
  3272. LEFT: 1,
  3273. RIGHT: 2,
  3274. INLINE_START: 3,
  3275. INLINE_END: 4
  3276. };
  3277. var parseCSSFloat = exports.parseCSSFloat = function parseCSSFloat(float) {
  3278. switch (float) {
  3279. case 'left':
  3280. return FLOAT.LEFT;
  3281. case 'right':
  3282. return FLOAT.RIGHT;
  3283. case 'inline-start':
  3284. return FLOAT.INLINE_START;
  3285. case 'inline-end':
  3286. return FLOAT.INLINE_END;
  3287. }
  3288. return FLOAT.NONE;
  3289. };
  3290. /***/ }),
  3291. /* 36 */
  3292. /***/ (function(module, exports, __webpack_require__) {
  3293. "use strict";
  3294. Object.defineProperty(exports, "__esModule", {
  3295. value: true
  3296. });
  3297. var parseFontWeight = function parseFontWeight(weight) {
  3298. switch (weight) {
  3299. case 'normal':
  3300. return 400;
  3301. case 'bold':
  3302. return 700;
  3303. }
  3304. var value = parseInt(weight, 10);
  3305. return isNaN(value) ? 400 : value;
  3306. };
  3307. var parseFont = exports.parseFont = function parseFont(style) {
  3308. var fontFamily = style.fontFamily;
  3309. var fontSize = style.fontSize;
  3310. var fontStyle = style.fontStyle;
  3311. var fontVariant = style.fontVariant;
  3312. var fontWeight = parseFontWeight(style.fontWeight);
  3313. return {
  3314. fontFamily: fontFamily,
  3315. fontSize: fontSize,
  3316. fontStyle: fontStyle,
  3317. fontVariant: fontVariant,
  3318. fontWeight: fontWeight
  3319. };
  3320. };
  3321. /***/ }),
  3322. /* 37 */
  3323. /***/ (function(module, exports, __webpack_require__) {
  3324. "use strict";
  3325. Object.defineProperty(exports, "__esModule", {
  3326. value: true
  3327. });
  3328. var parseLetterSpacing = exports.parseLetterSpacing = function parseLetterSpacing(letterSpacing) {
  3329. if (letterSpacing === 'normal') {
  3330. return 0;
  3331. }
  3332. var value = parseFloat(letterSpacing);
  3333. return isNaN(value) ? 0 : value;
  3334. };
  3335. /***/ }),
  3336. /* 38 */
  3337. /***/ (function(module, exports, __webpack_require__) {
  3338. "use strict";
  3339. Object.defineProperty(exports, "__esModule", {
  3340. value: true
  3341. });
  3342. var LINE_BREAK = exports.LINE_BREAK = {
  3343. NORMAL: 'normal',
  3344. STRICT: 'strict'
  3345. };
  3346. var parseLineBreak = exports.parseLineBreak = function parseLineBreak(wordBreak) {
  3347. switch (wordBreak) {
  3348. case 'strict':
  3349. return LINE_BREAK.STRICT;
  3350. case 'normal':
  3351. default:
  3352. return LINE_BREAK.NORMAL;
  3353. }
  3354. };
  3355. /***/ }),
  3356. /* 39 */
  3357. /***/ (function(module, exports, __webpack_require__) {
  3358. "use strict";
  3359. Object.defineProperty(exports, "__esModule", {
  3360. value: true
  3361. });
  3362. exports.parseMargin = undefined;
  3363. var _Length = __webpack_require__(2);
  3364. var _Length2 = _interopRequireDefault(_Length);
  3365. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3366. var SIDES = ['top', 'right', 'bottom', 'left'];
  3367. var parseMargin = exports.parseMargin = function parseMargin(style) {
  3368. return SIDES.map(function (side) {
  3369. return new _Length2.default(style.getPropertyValue('margin-' + side));
  3370. });
  3371. };
  3372. /***/ }),
  3373. /* 40 */
  3374. /***/ (function(module, exports, __webpack_require__) {
  3375. "use strict";
  3376. Object.defineProperty(exports, "__esModule", {
  3377. value: true
  3378. });
  3379. var OVERFLOW = exports.OVERFLOW = {
  3380. VISIBLE: 0,
  3381. HIDDEN: 1,
  3382. SCROLL: 2,
  3383. AUTO: 3
  3384. };
  3385. var parseOverflow = exports.parseOverflow = function parseOverflow(overflow) {
  3386. switch (overflow) {
  3387. case 'hidden':
  3388. return OVERFLOW.HIDDEN;
  3389. case 'scroll':
  3390. return OVERFLOW.SCROLL;
  3391. case 'auto':
  3392. return OVERFLOW.AUTO;
  3393. case 'visible':
  3394. default:
  3395. return OVERFLOW.VISIBLE;
  3396. }
  3397. };
  3398. /***/ }),
  3399. /* 41 */
  3400. /***/ (function(module, exports, __webpack_require__) {
  3401. "use strict";
  3402. Object.defineProperty(exports, "__esModule", {
  3403. value: true
  3404. });
  3405. exports.parseTextShadow = undefined;
  3406. var _Color = __webpack_require__(0);
  3407. var _Color2 = _interopRequireDefault(_Color);
  3408. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3409. var NUMBER = /^([+-]|\d|\.)$/i;
  3410. var parseTextShadow = exports.parseTextShadow = function parseTextShadow(textShadow) {
  3411. if (textShadow === 'none' || typeof textShadow !== 'string') {
  3412. return null;
  3413. }
  3414. var currentValue = '';
  3415. var isLength = false;
  3416. var values = [];
  3417. var shadows = [];
  3418. var numParens = 0;
  3419. var color = null;
  3420. var appendValue = function appendValue() {
  3421. if (currentValue.length) {
  3422. if (isLength) {
  3423. values.push(parseFloat(currentValue));
  3424. } else {
  3425. color = new _Color2.default(currentValue);
  3426. }
  3427. }
  3428. isLength = false;
  3429. currentValue = '';
  3430. };
  3431. var appendShadow = function appendShadow() {
  3432. if (values.length && color !== null) {
  3433. shadows.push({
  3434. color: color,
  3435. offsetX: values[0] || 0,
  3436. offsetY: values[1] || 0,
  3437. blur: values[2] || 0
  3438. });
  3439. }
  3440. values.splice(0, values.length);
  3441. color = null;
  3442. };
  3443. for (var i = 0; i < textShadow.length; i++) {
  3444. var c = textShadow[i];
  3445. switch (c) {
  3446. case '(':
  3447. currentValue += c;
  3448. numParens++;
  3449. break;
  3450. case ')':
  3451. currentValue += c;
  3452. numParens--;
  3453. break;
  3454. case ',':
  3455. if (numParens === 0) {
  3456. appendValue();
  3457. appendShadow();
  3458. } else {
  3459. currentValue += c;
  3460. }
  3461. break;
  3462. case ' ':
  3463. if (numParens === 0) {
  3464. appendValue();
  3465. } else {
  3466. currentValue += c;
  3467. }
  3468. break;
  3469. default:
  3470. if (currentValue.length === 0 && NUMBER.test(c)) {
  3471. isLength = true;
  3472. }
  3473. currentValue += c;
  3474. }
  3475. }
  3476. appendValue();
  3477. appendShadow();
  3478. if (shadows.length === 0) {
  3479. return null;
  3480. }
  3481. return shadows;
  3482. };
  3483. /***/ }),
  3484. /* 42 */
  3485. /***/ (function(module, exports, __webpack_require__) {
  3486. "use strict";
  3487. Object.defineProperty(exports, "__esModule", {
  3488. value: true
  3489. });
  3490. exports.parseTransform = undefined;
  3491. var _Length = __webpack_require__(2);
  3492. var _Length2 = _interopRequireDefault(_Length);
  3493. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3494. var toFloat = function toFloat(s) {
  3495. return parseFloat(s.trim());
  3496. };
  3497. var MATRIX = /(matrix|matrix3d)\((.+)\)/;
  3498. var parseTransform = exports.parseTransform = function parseTransform(style) {
  3499. var transform = parseTransformMatrix(style.transform || style.webkitTransform || style.mozTransform ||
  3500. // $FlowFixMe
  3501. style.msTransform ||
  3502. // $FlowFixMe
  3503. style.oTransform);
  3504. if (transform === null) {
  3505. return null;
  3506. }
  3507. return {
  3508. transform: transform,
  3509. transformOrigin: parseTransformOrigin(style.transformOrigin || style.webkitTransformOrigin || style.mozTransformOrigin ||
  3510. // $FlowFixMe
  3511. style.msTransformOrigin ||
  3512. // $FlowFixMe
  3513. style.oTransformOrigin)
  3514. };
  3515. };
  3516. // $FlowFixMe
  3517. var parseTransformOrigin = function parseTransformOrigin(origin) {
  3518. if (typeof origin !== 'string') {
  3519. var v = new _Length2.default('0');
  3520. return [v, v];
  3521. }
  3522. var values = origin.split(' ').map(_Length2.default.create);
  3523. return [values[0], values[1]];
  3524. };
  3525. // $FlowFixMe
  3526. var parseTransformMatrix = function parseTransformMatrix(transform) {
  3527. if (transform === 'none' || typeof transform !== 'string') {
  3528. return null;
  3529. }
  3530. var match = transform.match(MATRIX);
  3531. if (match) {
  3532. if (match[1] === 'matrix') {
  3533. var matrix = match[2].split(',').map(toFloat);
  3534. return [matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5]];
  3535. } else {
  3536. var matrix3d = match[2].split(',').map(toFloat);
  3537. return [matrix3d[0], matrix3d[1], matrix3d[4], matrix3d[5], matrix3d[12], matrix3d[13]];
  3538. }
  3539. }
  3540. return null;
  3541. };
  3542. /***/ }),
  3543. /* 43 */
  3544. /***/ (function(module, exports, __webpack_require__) {
  3545. "use strict";
  3546. Object.defineProperty(exports, "__esModule", {
  3547. value: true
  3548. });
  3549. var VISIBILITY = exports.VISIBILITY = {
  3550. VISIBLE: 0,
  3551. HIDDEN: 1,
  3552. COLLAPSE: 2
  3553. };
  3554. var parseVisibility = exports.parseVisibility = function parseVisibility(visibility) {
  3555. switch (visibility) {
  3556. case 'hidden':
  3557. return VISIBILITY.HIDDEN;
  3558. case 'collapse':
  3559. return VISIBILITY.COLLAPSE;
  3560. case 'visible':
  3561. default:
  3562. return VISIBILITY.VISIBLE;
  3563. }
  3564. };
  3565. /***/ }),
  3566. /* 44 */
  3567. /***/ (function(module, exports, __webpack_require__) {
  3568. "use strict";
  3569. Object.defineProperty(exports, "__esModule", {
  3570. value: true
  3571. });
  3572. var WORD_BREAK = exports.WORD_BREAK = {
  3573. NORMAL: 'normal',
  3574. BREAK_ALL: 'break-all',
  3575. KEEP_ALL: 'keep-all'
  3576. };
  3577. var parseWordBreak = exports.parseWordBreak = function parseWordBreak(wordBreak) {
  3578. switch (wordBreak) {
  3579. case 'break-all':
  3580. return WORD_BREAK.BREAK_ALL;
  3581. case 'keep-all':
  3582. return WORD_BREAK.KEEP_ALL;
  3583. case 'normal':
  3584. default:
  3585. return WORD_BREAK.NORMAL;
  3586. }
  3587. };
  3588. /***/ }),
  3589. /* 45 */
  3590. /***/ (function(module, exports, __webpack_require__) {
  3591. "use strict";
  3592. Object.defineProperty(exports, "__esModule", {
  3593. value: true
  3594. });
  3595. var parseZIndex = exports.parseZIndex = function parseZIndex(zIndex) {
  3596. var auto = zIndex === 'auto';
  3597. return {
  3598. auto: auto,
  3599. order: auto ? 0 : parseInt(zIndex, 10)
  3600. };
  3601. };
  3602. /***/ }),
  3603. /* 46 */
  3604. /***/ (function(module, exports, __webpack_require__) {
  3605. "use strict";
  3606. Object.defineProperty(exports, "__esModule", {
  3607. value: true
  3608. });
  3609. var _Util = __webpack_require__(13);
  3610. Object.defineProperty(exports, 'toCodePoints', {
  3611. enumerable: true,
  3612. get: function get() {
  3613. return _Util.toCodePoints;
  3614. }
  3615. });
  3616. Object.defineProperty(exports, 'fromCodePoint', {
  3617. enumerable: true,
  3618. get: function get() {
  3619. return _Util.fromCodePoint;
  3620. }
  3621. });
  3622. var _LineBreak = __webpack_require__(47);
  3623. Object.defineProperty(exports, 'LineBreaker', {
  3624. enumerable: true,
  3625. get: function get() {
  3626. return _LineBreak.LineBreaker;
  3627. }
  3628. });
  3629. /***/ }),
  3630. /* 47 */
  3631. /***/ (function(module, exports, __webpack_require__) {
  3632. "use strict";
  3633. Object.defineProperty(exports, "__esModule", {
  3634. value: true
  3635. });
  3636. exports.LineBreaker = exports.inlineBreakOpportunities = exports.lineBreakAtIndex = exports.codePointsToCharacterClasses = exports.UnicodeTrie = exports.BREAK_ALLOWED = exports.BREAK_NOT_ALLOWED = exports.BREAK_MANDATORY = exports.classes = exports.LETTER_NUMBER_MODIFIER = undefined;
  3637. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  3638. var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
  3639. var _Trie = __webpack_require__(48);
  3640. var _linebreakTrie = __webpack_require__(49);
  3641. var _linebreakTrie2 = _interopRequireDefault(_linebreakTrie);
  3642. var _Util = __webpack_require__(13);
  3643. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3644. function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
  3645. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3646. var LETTER_NUMBER_MODIFIER = exports.LETTER_NUMBER_MODIFIER = 50;
  3647. // Non-tailorable Line Breaking Classes
  3648. var BK = 1; // Cause a line break (after)
  3649. var CR = 2; // Cause a line break (after), except between CR and LF
  3650. var LF = 3; // Cause a line break (after)
  3651. var CM = 4; // Prohibit a line break between the character and the preceding character
  3652. var NL = 5; // Cause a line break (after)
  3653. var SG = 6; // Do not occur in well-formed text
  3654. var WJ = 7; // Prohibit line breaks before and after
  3655. var ZW = 8; // Provide a break opportunity
  3656. var GL = 9; // Prohibit line breaks before and after
  3657. var SP = 10; // Enable indirect line breaks
  3658. var ZWJ = 11; // Prohibit line breaks within joiner sequences
  3659. // Break Opportunities
  3660. var B2 = 12; // Provide a line break opportunity before and after the character
  3661. var BA = 13; // Generally provide a line break opportunity after the character
  3662. var BB = 14; // Generally provide a line break opportunity before the character
  3663. var HY = 15; // Provide a line break opportunity after the character, except in numeric context
  3664. var CB = 16; // Provide a line break opportunity contingent on additional information
  3665. // Characters Prohibiting Certain Breaks
  3666. var CL = 17; // Prohibit line breaks before
  3667. var CP = 18; // Prohibit line breaks before
  3668. var EX = 19; // Prohibit line breaks before
  3669. var IN = 20; // Allow only indirect line breaks between pairs
  3670. var NS = 21; // Allow only indirect line breaks before
  3671. var OP = 22; // Prohibit line breaks after
  3672. var QU = 23; // Act like they are both opening and closing
  3673. // Numeric Context
  3674. var IS = 24; // Prevent breaks after any and before numeric
  3675. var NU = 25; // Form numeric expressions for line breaking purposes
  3676. var PO = 26; // Do not break following a numeric expression
  3677. var PR = 27; // Do not break in front of a numeric expression
  3678. var SY = 28; // Prevent a break before; and allow a break after
  3679. // Other Characters
  3680. var AI = 29; // Act like AL when the resolvedEAW is N; otherwise; act as ID
  3681. var AL = 30; // Are alphabetic characters or symbols that are used with alphabetic characters
  3682. var CJ = 31; // Treat as NS or ID for strict or normal breaking.
  3683. var EB = 32; // Do not break from following Emoji Modifier
  3684. var EM = 33; // Do not break from preceding Emoji Base
  3685. var H2 = 34; // Form Korean syllable blocks
  3686. var H3 = 35; // Form Korean syllable blocks
  3687. var HL = 36; // Do not break around a following hyphen; otherwise act as Alphabetic
  3688. var ID = 37; // Break before or after; except in some numeric context
  3689. var JL = 38; // Form Korean syllable blocks
  3690. var JV = 39; // Form Korean syllable blocks
  3691. var JT = 40; // Form Korean syllable blocks
  3692. var RI = 41; // Keep pairs together. For pairs; break before and after other classes
  3693. var SA = 42; // Provide a line break opportunity contingent on additional, language-specific context analysis
  3694. var XX = 43; // Have as yet unknown line breaking behavior or unassigned code positions
  3695. var classes = exports.classes = {
  3696. BK: BK,
  3697. CR: CR,
  3698. LF: LF,
  3699. CM: CM,
  3700. NL: NL,
  3701. SG: SG,
  3702. WJ: WJ,
  3703. ZW: ZW,
  3704. GL: GL,
  3705. SP: SP,
  3706. ZWJ: ZWJ,
  3707. B2: B2,
  3708. BA: BA,
  3709. BB: BB,
  3710. HY: HY,
  3711. CB: CB,
  3712. CL: CL,
  3713. CP: CP,
  3714. EX: EX,
  3715. IN: IN,
  3716. NS: NS,
  3717. OP: OP,
  3718. QU: QU,
  3719. IS: IS,
  3720. NU: NU,
  3721. PO: PO,
  3722. PR: PR,
  3723. SY: SY,
  3724. AI: AI,
  3725. AL: AL,
  3726. CJ: CJ,
  3727. EB: EB,
  3728. EM: EM,
  3729. H2: H2,
  3730. H3: H3,
  3731. HL: HL,
  3732. ID: ID,
  3733. JL: JL,
  3734. JV: JV,
  3735. JT: JT,
  3736. RI: RI,
  3737. SA: SA,
  3738. XX: XX
  3739. };
  3740. var BREAK_MANDATORY = exports.BREAK_MANDATORY = '!';
  3741. var BREAK_NOT_ALLOWED = exports.BREAK_NOT_ALLOWED = '×';
  3742. var BREAK_ALLOWED = exports.BREAK_ALLOWED = '÷';
  3743. var UnicodeTrie = exports.UnicodeTrie = (0, _Trie.createTrieFromBase64)(_linebreakTrie2.default);
  3744. var ALPHABETICS = [AL, HL];
  3745. var HARD_LINE_BREAKS = [BK, CR, LF, NL];
  3746. var SPACE = [SP, ZW];
  3747. var PREFIX_POSTFIX = [PR, PO];
  3748. var LINE_BREAKS = HARD_LINE_BREAKS.concat(SPACE);
  3749. var KOREAN_SYLLABLE_BLOCK = [JL, JV, JT, H2, H3];
  3750. var HYPHEN = [HY, BA];
  3751. var codePointsToCharacterClasses = exports.codePointsToCharacterClasses = function codePointsToCharacterClasses(codePoints) {
  3752. var lineBreak = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'strict';
  3753. var types = [];
  3754. var indicies = [];
  3755. var categories = [];
  3756. codePoints.forEach(function (codePoint, index) {
  3757. var classType = UnicodeTrie.get(codePoint);
  3758. if (classType > LETTER_NUMBER_MODIFIER) {
  3759. categories.push(true);
  3760. classType -= LETTER_NUMBER_MODIFIER;
  3761. } else {
  3762. categories.push(false);
  3763. }
  3764. if (['normal', 'auto', 'loose'].indexOf(lineBreak) !== -1) {
  3765. // U+2010, – U+2013, 〜 U+301C, ゠ U+30A0
  3766. if ([0x2010, 0x2013, 0x301c, 0x30a0].indexOf(codePoint) !== -1) {
  3767. indicies.push(index);
  3768. return types.push(CB);
  3769. }
  3770. }
  3771. if (classType === CM || classType === ZWJ) {
  3772. // LB10 Treat any remaining combining mark or ZWJ as AL.
  3773. if (index === 0) {
  3774. indicies.push(index);
  3775. return types.push(AL);
  3776. }
  3777. // LB9 Do not break a combining character sequence; treat it as if it has the line breaking class of
  3778. // the base character in all of the following rules. Treat ZWJ as if it were CM.
  3779. var prev = types[index - 1];
  3780. if (LINE_BREAKS.indexOf(prev) === -1) {
  3781. indicies.push(indicies[index - 1]);
  3782. return types.push(prev);
  3783. }
  3784. indicies.push(index);
  3785. return types.push(AL);
  3786. }
  3787. indicies.push(index);
  3788. if (classType === CJ) {
  3789. return types.push(lineBreak === 'strict' ? NS : ID);
  3790. }
  3791. if (classType === SA) {
  3792. return types.push(AL);
  3793. }
  3794. if (classType === AI) {
  3795. return types.push(AL);
  3796. }
  3797. // For supplementary characters, a useful default is to treat characters in the range 10000..1FFFD as AL
  3798. // and characters in the ranges 20000..2FFFD and 30000..3FFFD as ID, until the implementation can be revised
  3799. // to take into account the actual line breaking properties for these characters.
  3800. if (classType === XX) {
  3801. if (codePoint >= 0x20000 && codePoint <= 0x2fffd || codePoint >= 0x30000 && codePoint <= 0x3fffd) {
  3802. return types.push(ID);
  3803. } else {
  3804. return types.push(AL);
  3805. }
  3806. }
  3807. types.push(classType);
  3808. });
  3809. return [indicies, types, categories];
  3810. };
  3811. var isAdjacentWithSpaceIgnored = function isAdjacentWithSpaceIgnored(a, b, currentIndex, classTypes) {
  3812. var current = classTypes[currentIndex];
  3813. if (Array.isArray(a) ? a.indexOf(current) !== -1 : a === current) {
  3814. var i = currentIndex;
  3815. while (i <= classTypes.length) {
  3816. i++;
  3817. var next = classTypes[i];
  3818. if (next === b) {
  3819. return true;
  3820. }
  3821. if (next !== SP) {
  3822. break;
  3823. }
  3824. }
  3825. }
  3826. if (current === SP) {
  3827. var _i = currentIndex;
  3828. while (_i > 0) {
  3829. _i--;
  3830. var prev = classTypes[_i];
  3831. if (Array.isArray(a) ? a.indexOf(prev) !== -1 : a === prev) {
  3832. var n = currentIndex;
  3833. while (n <= classTypes.length) {
  3834. n++;
  3835. var _next = classTypes[n];
  3836. if (_next === b) {
  3837. return true;
  3838. }
  3839. if (_next !== SP) {
  3840. break;
  3841. }
  3842. }
  3843. }
  3844. if (prev !== SP) {
  3845. break;
  3846. }
  3847. }
  3848. }
  3849. return false;
  3850. };
  3851. var previousNonSpaceClassType = function previousNonSpaceClassType(currentIndex, classTypes) {
  3852. var i = currentIndex;
  3853. while (i >= 0) {
  3854. var type = classTypes[i];
  3855. if (type === SP) {
  3856. i--;
  3857. } else {
  3858. return type;
  3859. }
  3860. }
  3861. return 0;
  3862. };
  3863. var _lineBreakAtIndex = function _lineBreakAtIndex(codePoints, classTypes, indicies, index, forbiddenBreaks) {
  3864. if (indicies[index] === 0) {
  3865. return BREAK_NOT_ALLOWED;
  3866. }
  3867. var currentIndex = index - 1;
  3868. if (Array.isArray(forbiddenBreaks) && forbiddenBreaks[currentIndex] === true) {
  3869. return BREAK_NOT_ALLOWED;
  3870. }
  3871. var beforeIndex = currentIndex - 1;
  3872. var afterIndex = currentIndex + 1;
  3873. var current = classTypes[currentIndex];
  3874. // LB4 Always break after hard line breaks.
  3875. // LB5 Treat CR followed by LF, as well as CR, LF, and NL as hard line breaks.
  3876. var before = beforeIndex >= 0 ? classTypes[beforeIndex] : 0;
  3877. var next = classTypes[afterIndex];
  3878. if (current === CR && next === LF) {
  3879. return BREAK_NOT_ALLOWED;
  3880. }
  3881. if (HARD_LINE_BREAKS.indexOf(current) !== -1) {
  3882. return BREAK_MANDATORY;
  3883. }
  3884. // LB6 Do not break before hard line breaks.
  3885. if (HARD_LINE_BREAKS.indexOf(next) !== -1) {
  3886. return BREAK_NOT_ALLOWED;
  3887. }
  3888. // LB7 Do not break before spaces or zero width space.
  3889. if (SPACE.indexOf(next) !== -1) {
  3890. return BREAK_NOT_ALLOWED;
  3891. }
  3892. // LB8 Break before any character following a zero-width space, even if one or more spaces intervene.
  3893. if (previousNonSpaceClassType(currentIndex, classTypes) === ZW) {
  3894. return BREAK_ALLOWED;
  3895. }
  3896. // LB8a Do not break between a zero width joiner and an ideograph, emoji base or emoji modifier.
  3897. if (UnicodeTrie.get(codePoints[currentIndex]) === ZWJ && (next === ID || next === EB || next === EM)) {
  3898. return BREAK_NOT_ALLOWED;
  3899. }
  3900. // LB11 Do not break before or after Word joiner and related characters.
  3901. if (current === WJ || next === WJ) {
  3902. return BREAK_NOT_ALLOWED;
  3903. }
  3904. // LB12 Do not break after NBSP and related characters.
  3905. if (current === GL) {
  3906. return BREAK_NOT_ALLOWED;
  3907. }
  3908. // LB12a Do not break before NBSP and related characters, except after spaces and hyphens.
  3909. if ([SP, BA, HY].indexOf(current) === -1 && next === GL) {
  3910. return BREAK_NOT_ALLOWED;
  3911. }
  3912. // LB13 Do not break before ‘]’ or ‘!’ or ‘;’ or ‘/’, even after spaces.
  3913. if ([CL, CP, EX, IS, SY].indexOf(next) !== -1) {
  3914. return BREAK_NOT_ALLOWED;
  3915. }
  3916. // LB14 Do not break after ‘[’, even after spaces.
  3917. if (previousNonSpaceClassType(currentIndex, classTypes) === OP) {
  3918. return BREAK_NOT_ALLOWED;
  3919. }
  3920. // LB15 Do not break within ‘”[’, even with intervening spaces.
  3921. if (isAdjacentWithSpaceIgnored(QU, OP, currentIndex, classTypes)) {
  3922. return BREAK_NOT_ALLOWED;
  3923. }
  3924. // LB16 Do not break between closing punctuation and a nonstarter (lb=NS), even with intervening spaces.
  3925. if (isAdjacentWithSpaceIgnored([CL, CP], NS, currentIndex, classTypes)) {
  3926. return BREAK_NOT_ALLOWED;
  3927. }
  3928. // LB17 Do not break within ‘——’, even with intervening spaces.
  3929. if (isAdjacentWithSpaceIgnored(B2, B2, currentIndex, classTypes)) {
  3930. return BREAK_NOT_ALLOWED;
  3931. }
  3932. // LB18 Break after spaces.
  3933. if (current === SP) {
  3934. return BREAK_ALLOWED;
  3935. }
  3936. // LB19 Do not break before or after quotation marks, such as ‘ ” ’.
  3937. if (current === QU || next === QU) {
  3938. return BREAK_NOT_ALLOWED;
  3939. }
  3940. // LB20 Break before and after unresolved CB.
  3941. if (next === CB || current === CB) {
  3942. return BREAK_ALLOWED;
  3943. }
  3944. // LB21 Do not break before hyphen-minus, other hyphens, fixed-width spaces, small kana, and other non-starters, or after acute accents.
  3945. if ([BA, HY, NS].indexOf(next) !== -1 || current === BB) {
  3946. return BREAK_NOT_ALLOWED;
  3947. }
  3948. // LB21a Don't break after Hebrew + Hyphen.
  3949. if (before === HL && HYPHEN.indexOf(current) !== -1) {
  3950. return BREAK_NOT_ALLOWED;
  3951. }
  3952. // LB21b Don’t break between Solidus and Hebrew letters.
  3953. if (current === SY && next === HL) {
  3954. return BREAK_NOT_ALLOWED;
  3955. }
  3956. // LB22 Do not break between two ellipses, or between letters, numbers or exclamations and ellipsis.
  3957. if (next === IN && ALPHABETICS.concat(IN, EX, NU, ID, EB, EM).indexOf(current) !== -1) {
  3958. return BREAK_NOT_ALLOWED;
  3959. }
  3960. // LB23 Do not break between digits and letters.
  3961. if (ALPHABETICS.indexOf(next) !== -1 && current === NU || ALPHABETICS.indexOf(current) !== -1 && next === NU) {
  3962. return BREAK_NOT_ALLOWED;
  3963. }
  3964. // LB23a Do not break between numeric prefixes and ideographs, or between ideographs and numeric postfixes.
  3965. if (current === PR && [ID, EB, EM].indexOf(next) !== -1 || [ID, EB, EM].indexOf(current) !== -1 && next === PO) {
  3966. return BREAK_NOT_ALLOWED;
  3967. }
  3968. // LB24 Do not break between numeric prefix/postfix and letters, or between letters and prefix/postfix.
  3969. if (ALPHABETICS.indexOf(current) !== -1 && PREFIX_POSTFIX.indexOf(next) !== -1 || PREFIX_POSTFIX.indexOf(current) !== -1 && ALPHABETICS.indexOf(next) !== -1) {
  3970. return BREAK_NOT_ALLOWED;
  3971. }
  3972. // LB25 Do not break between the following pairs of classes relevant to numbers:
  3973. if (
  3974. // (PR | PO) × ( OP | HY )? NU
  3975. [PR, PO].indexOf(current) !== -1 && (next === NU || [OP, HY].indexOf(next) !== -1 && classTypes[afterIndex + 1] === NU) ||
  3976. // ( OP | HY ) × NU
  3977. [OP, HY].indexOf(current) !== -1 && next === NU ||
  3978. // NU × (NU | SY | IS)
  3979. current === NU && [NU, SY, IS].indexOf(next) !== -1) {
  3980. return BREAK_NOT_ALLOWED;
  3981. }
  3982. // NU (NU | SY | IS)* × (NU | SY | IS | CL | CP)
  3983. if ([NU, SY, IS, CL, CP].indexOf(next) !== -1) {
  3984. var prevIndex = currentIndex;
  3985. while (prevIndex >= 0) {
  3986. var type = classTypes[prevIndex];
  3987. if (type === NU) {
  3988. return BREAK_NOT_ALLOWED;
  3989. } else if ([SY, IS].indexOf(type) !== -1) {
  3990. prevIndex--;
  3991. } else {
  3992. break;
  3993. }
  3994. }
  3995. }
  3996. // NU (NU | SY | IS)* (CL | CP)? × (PO | PR))
  3997. if ([PR, PO].indexOf(next) !== -1) {
  3998. var _prevIndex = [CL, CP].indexOf(current) !== -1 ? beforeIndex : currentIndex;
  3999. while (_prevIndex >= 0) {
  4000. var _type = classTypes[_prevIndex];
  4001. if (_type === NU) {
  4002. return BREAK_NOT_ALLOWED;
  4003. } else if ([SY, IS].indexOf(_type) !== -1) {
  4004. _prevIndex--;
  4005. } else {
  4006. break;
  4007. }
  4008. }
  4009. }
  4010. // LB26 Do not break a Korean syllable.
  4011. if (JL === current && [JL, JV, H2, H3].indexOf(next) !== -1 || [JV, H2].indexOf(current) !== -1 && [JV, JT].indexOf(next) !== -1 || [JT, H3].indexOf(current) !== -1 && next === JT) {
  4012. return BREAK_NOT_ALLOWED;
  4013. }
  4014. // LB27 Treat a Korean Syllable Block the same as ID.
  4015. if (KOREAN_SYLLABLE_BLOCK.indexOf(current) !== -1 && [IN, PO].indexOf(next) !== -1 || KOREAN_SYLLABLE_BLOCK.indexOf(next) !== -1 && current === PR) {
  4016. return BREAK_NOT_ALLOWED;
  4017. }
  4018. // LB28 Do not break between alphabetics (“at”).
  4019. if (ALPHABETICS.indexOf(current) !== -1 && ALPHABETICS.indexOf(next) !== -1) {
  4020. return BREAK_NOT_ALLOWED;
  4021. }
  4022. // LB29 Do not break between numeric punctuation and alphabetics (“e.g.”).
  4023. if (current === IS && ALPHABETICS.indexOf(next) !== -1) {
  4024. return BREAK_NOT_ALLOWED;
  4025. }
  4026. // LB30 Do not break between letters, numbers, or ordinary symbols and opening or closing parentheses.
  4027. if (ALPHABETICS.concat(NU).indexOf(current) !== -1 && next === OP || ALPHABETICS.concat(NU).indexOf(next) !== -1 && current === CP) {
  4028. return BREAK_NOT_ALLOWED;
  4029. }
  4030. // LB30a Break between two regional indicator symbols if and only if there are an even number of regional
  4031. // indicators preceding the position of the break.
  4032. if (current === RI && next === RI) {
  4033. var i = indicies[currentIndex];
  4034. var count = 1;
  4035. while (i > 0) {
  4036. i--;
  4037. if (classTypes[i] === RI) {
  4038. count++;
  4039. } else {
  4040. break;
  4041. }
  4042. }
  4043. if (count % 2 !== 0) {
  4044. return BREAK_NOT_ALLOWED;
  4045. }
  4046. }
  4047. // LB30b Do not break between an emoji base and an emoji modifier.
  4048. if (current === EB && next === EM) {
  4049. return BREAK_NOT_ALLOWED;
  4050. }
  4051. return BREAK_ALLOWED;
  4052. };
  4053. var lineBreakAtIndex = exports.lineBreakAtIndex = function lineBreakAtIndex(codePoints, index) {
  4054. // LB2 Never break at the start of text.
  4055. if (index === 0) {
  4056. return BREAK_NOT_ALLOWED;
  4057. }
  4058. // LB3 Always break at the end of text.
  4059. if (index >= codePoints.length) {
  4060. return BREAK_MANDATORY;
  4061. }
  4062. var _codePointsToCharacte = codePointsToCharacterClasses(codePoints),
  4063. _codePointsToCharacte2 = _slicedToArray(_codePointsToCharacte, 2),
  4064. indicies = _codePointsToCharacte2[0],
  4065. classTypes = _codePointsToCharacte2[1];
  4066. return _lineBreakAtIndex(codePoints, classTypes, indicies, index);
  4067. };
  4068. var cssFormattedClasses = function cssFormattedClasses(codePoints, options) {
  4069. if (!options) {
  4070. options = { lineBreak: 'normal', wordBreak: 'normal' };
  4071. }
  4072. var _codePointsToCharacte3 = codePointsToCharacterClasses(codePoints, options.lineBreak),
  4073. _codePointsToCharacte4 = _slicedToArray(_codePointsToCharacte3, 3),
  4074. indicies = _codePointsToCharacte4[0],
  4075. classTypes = _codePointsToCharacte4[1],
  4076. isLetterNumber = _codePointsToCharacte4[2];
  4077. if (options.wordBreak === 'break-all' || options.wordBreak === 'break-word') {
  4078. classTypes = classTypes.map(function (type) {
  4079. return [NU, AL, SA].indexOf(type) !== -1 ? ID : type;
  4080. });
  4081. }
  4082. var forbiddenBreakpoints = options.wordBreak === 'keep-all' ? isLetterNumber.map(function (isLetterNumber, i) {
  4083. return isLetterNumber && codePoints[i] >= 0x4e00 && codePoints[i] <= 0x9fff;
  4084. }) : null;
  4085. return [indicies, classTypes, forbiddenBreakpoints];
  4086. };
  4087. var inlineBreakOpportunities = exports.inlineBreakOpportunities = function inlineBreakOpportunities(str, options) {
  4088. var codePoints = (0, _Util.toCodePoints)(str);
  4089. var output = BREAK_NOT_ALLOWED;
  4090. var _cssFormattedClasses = cssFormattedClasses(codePoints, options),
  4091. _cssFormattedClasses2 = _slicedToArray(_cssFormattedClasses, 3),
  4092. indicies = _cssFormattedClasses2[0],
  4093. classTypes = _cssFormattedClasses2[1],
  4094. forbiddenBreakpoints = _cssFormattedClasses2[2];
  4095. codePoints.forEach(function (codePoint, i) {
  4096. output += (0, _Util.fromCodePoint)(codePoint) + (i >= codePoints.length - 1 ? BREAK_MANDATORY : _lineBreakAtIndex(codePoints, classTypes, indicies, i + 1, forbiddenBreakpoints));
  4097. });
  4098. return output;
  4099. };
  4100. var Break = function () {
  4101. function Break(codePoints, lineBreak, start, end) {
  4102. _classCallCheck(this, Break);
  4103. this._codePoints = codePoints;
  4104. this.required = lineBreak === BREAK_MANDATORY;
  4105. this.start = start;
  4106. this.end = end;
  4107. }
  4108. _createClass(Break, [{
  4109. key: 'slice',
  4110. value: function slice() {
  4111. return _Util.fromCodePoint.apply(undefined, _toConsumableArray(this._codePoints.slice(this.start, this.end)));
  4112. }
  4113. }]);
  4114. return Break;
  4115. }();
  4116. var LineBreaker = exports.LineBreaker = function LineBreaker(str, options) {
  4117. var codePoints = (0, _Util.toCodePoints)(str);
  4118. var _cssFormattedClasses3 = cssFormattedClasses(codePoints, options),
  4119. _cssFormattedClasses4 = _slicedToArray(_cssFormattedClasses3, 3),
  4120. indicies = _cssFormattedClasses4[0],
  4121. classTypes = _cssFormattedClasses4[1],
  4122. forbiddenBreakpoints = _cssFormattedClasses4[2];
  4123. var length = codePoints.length;
  4124. var lastEnd = 0;
  4125. var nextIndex = 0;
  4126. return {
  4127. next: function next() {
  4128. if (nextIndex >= length) {
  4129. return { done: true };
  4130. }
  4131. var lineBreak = BREAK_NOT_ALLOWED;
  4132. while (nextIndex < length && (lineBreak = _lineBreakAtIndex(codePoints, classTypes, indicies, ++nextIndex, forbiddenBreakpoints)) === BREAK_NOT_ALLOWED) {}
  4133. if (lineBreak !== BREAK_NOT_ALLOWED || nextIndex === length) {
  4134. var value = new Break(codePoints, lineBreak, lastEnd, nextIndex);
  4135. lastEnd = nextIndex;
  4136. return { value: value, done: false };
  4137. }
  4138. return { done: true };
  4139. }
  4140. };
  4141. };
  4142. /***/ }),
  4143. /* 48 */
  4144. /***/ (function(module, exports, __webpack_require__) {
  4145. "use strict";
  4146. Object.defineProperty(exports, "__esModule", {
  4147. value: true
  4148. });
  4149. exports.Trie = exports.createTrieFromBase64 = exports.UTRIE2_INDEX_2_MASK = exports.UTRIE2_INDEX_2_BLOCK_LENGTH = exports.UTRIE2_OMITTED_BMP_INDEX_1_LENGTH = exports.UTRIE2_INDEX_1_OFFSET = exports.UTRIE2_UTF8_2B_INDEX_2_LENGTH = exports.UTRIE2_UTF8_2B_INDEX_2_OFFSET = exports.UTRIE2_INDEX_2_BMP_LENGTH = exports.UTRIE2_LSCP_INDEX_2_LENGTH = exports.UTRIE2_DATA_MASK = exports.UTRIE2_DATA_BLOCK_LENGTH = exports.UTRIE2_LSCP_INDEX_2_OFFSET = exports.UTRIE2_SHIFT_1_2 = exports.UTRIE2_INDEX_SHIFT = exports.UTRIE2_SHIFT_1 = exports.UTRIE2_SHIFT_2 = undefined;
  4150. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  4151. var _Util = __webpack_require__(13);
  4152. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  4153. /** Shift size for getting the index-2 table offset. */
  4154. var UTRIE2_SHIFT_2 = exports.UTRIE2_SHIFT_2 = 5;
  4155. /** Shift size for getting the index-1 table offset. */
  4156. var UTRIE2_SHIFT_1 = exports.UTRIE2_SHIFT_1 = 6 + 5;
  4157. /**
  4158. * Shift size for shifting left the index array values.
  4159. * Increases possible data size with 16-bit index values at the cost
  4160. * of compactability.
  4161. * This requires data blocks to be aligned by UTRIE2_DATA_GRANULARITY.
  4162. */
  4163. var UTRIE2_INDEX_SHIFT = exports.UTRIE2_INDEX_SHIFT = 2;
  4164. /**
  4165. * Difference between the two shift sizes,
  4166. * for getting an index-1 offset from an index-2 offset. 6=11-5
  4167. */
  4168. var UTRIE2_SHIFT_1_2 = exports.UTRIE2_SHIFT_1_2 = UTRIE2_SHIFT_1 - UTRIE2_SHIFT_2;
  4169. /**
  4170. * The part of the index-2 table for U+D800..U+DBFF stores values for
  4171. * lead surrogate code _units_ not code _points_.
  4172. * Values for lead surrogate code _points_ are indexed with this portion of the table.
  4173. * Length=32=0x20=0x400>>UTRIE2_SHIFT_2. (There are 1024=0x400 lead surrogates.)
  4174. */
  4175. var UTRIE2_LSCP_INDEX_2_OFFSET = exports.UTRIE2_LSCP_INDEX_2_OFFSET = 0x10000 >> UTRIE2_SHIFT_2;
  4176. /** Number of entries in a data block. 32=0x20 */
  4177. var UTRIE2_DATA_BLOCK_LENGTH = exports.UTRIE2_DATA_BLOCK_LENGTH = 1 << UTRIE2_SHIFT_2;
  4178. /** Mask for getting the lower bits for the in-data-block offset. */
  4179. var UTRIE2_DATA_MASK = exports.UTRIE2_DATA_MASK = UTRIE2_DATA_BLOCK_LENGTH - 1;
  4180. var UTRIE2_LSCP_INDEX_2_LENGTH = exports.UTRIE2_LSCP_INDEX_2_LENGTH = 0x400 >> UTRIE2_SHIFT_2;
  4181. /** Count the lengths of both BMP pieces. 2080=0x820 */
  4182. var UTRIE2_INDEX_2_BMP_LENGTH = exports.UTRIE2_INDEX_2_BMP_LENGTH = UTRIE2_LSCP_INDEX_2_OFFSET + UTRIE2_LSCP_INDEX_2_LENGTH;
  4183. /**
  4184. * The 2-byte UTF-8 version of the index-2 table follows at offset 2080=0x820.
  4185. * Length 32=0x20 for lead bytes C0..DF, regardless of UTRIE2_SHIFT_2.
  4186. */
  4187. var UTRIE2_UTF8_2B_INDEX_2_OFFSET = exports.UTRIE2_UTF8_2B_INDEX_2_OFFSET = UTRIE2_INDEX_2_BMP_LENGTH;
  4188. var UTRIE2_UTF8_2B_INDEX_2_LENGTH = exports.UTRIE2_UTF8_2B_INDEX_2_LENGTH = 0x800 >> 6; /* U+0800 is the first code point after 2-byte UTF-8 */
  4189. /**
  4190. * The index-1 table, only used for supplementary code points, at offset 2112=0x840.
  4191. * Variable length, for code points up to highStart, where the last single-value range starts.
  4192. * Maximum length 512=0x200=0x100000>>UTRIE2_SHIFT_1.
  4193. * (For 0x100000 supplementary code points U+10000..U+10ffff.)
  4194. *
  4195. * The part of the index-2 table for supplementary code points starts
  4196. * after this index-1 table.
  4197. *
  4198. * Both the index-1 table and the following part of the index-2 table
  4199. * are omitted completely if there is only BMP data.
  4200. */
  4201. var UTRIE2_INDEX_1_OFFSET = exports.UTRIE2_INDEX_1_OFFSET = UTRIE2_UTF8_2B_INDEX_2_OFFSET + UTRIE2_UTF8_2B_INDEX_2_LENGTH;
  4202. /**
  4203. * Number of index-1 entries for the BMP. 32=0x20
  4204. * This part of the index-1 table is omitted from the serialized form.
  4205. */
  4206. var UTRIE2_OMITTED_BMP_INDEX_1_LENGTH = exports.UTRIE2_OMITTED_BMP_INDEX_1_LENGTH = 0x10000 >> UTRIE2_SHIFT_1;
  4207. /** Number of entries in an index-2 block. 64=0x40 */
  4208. var UTRIE2_INDEX_2_BLOCK_LENGTH = exports.UTRIE2_INDEX_2_BLOCK_LENGTH = 1 << UTRIE2_SHIFT_1_2;
  4209. /** Mask for getting the lower bits for the in-index-2-block offset. */
  4210. var UTRIE2_INDEX_2_MASK = exports.UTRIE2_INDEX_2_MASK = UTRIE2_INDEX_2_BLOCK_LENGTH - 1;
  4211. var createTrieFromBase64 = exports.createTrieFromBase64 = function createTrieFromBase64(base64) {
  4212. var buffer = (0, _Util.decode)(base64);
  4213. var view32 = Array.isArray(buffer) ? (0, _Util.polyUint32Array)(buffer) : new Uint32Array(buffer);
  4214. var view16 = Array.isArray(buffer) ? (0, _Util.polyUint16Array)(buffer) : new Uint16Array(buffer);
  4215. var headerLength = 24;
  4216. var index = view16.slice(headerLength / 2, view32[4] / 2);
  4217. var data = view32[5] === 2 ? view16.slice((headerLength + view32[4]) / 2) : view32.slice(Math.ceil((headerLength + view32[4]) / 4));
  4218. return new Trie(view32[0], view32[1], view32[2], view32[3], index, data);
  4219. };
  4220. var Trie = exports.Trie = function () {
  4221. function Trie(initialValue, errorValue, highStart, highValueIndex, index, data) {
  4222. _classCallCheck(this, Trie);
  4223. this.initialValue = initialValue;
  4224. this.errorValue = errorValue;
  4225. this.highStart = highStart;
  4226. this.highValueIndex = highValueIndex;
  4227. this.index = index;
  4228. this.data = data;
  4229. }
  4230. /**
  4231. * Get the value for a code point as stored in the Trie.
  4232. *
  4233. * @param codePoint the code point
  4234. * @return the value
  4235. */
  4236. _createClass(Trie, [{
  4237. key: 'get',
  4238. value: function get(codePoint) {
  4239. var ix = void 0;
  4240. if (codePoint >= 0) {
  4241. if (codePoint < 0x0d800 || codePoint > 0x0dbff && codePoint <= 0x0ffff) {
  4242. // Ordinary BMP code point, excluding leading surrogates.
  4243. // BMP uses a single level lookup. BMP index starts at offset 0 in the Trie2 index.
  4244. // 16 bit data is stored in the index array itself.
  4245. ix = this.index[codePoint >> UTRIE2_SHIFT_2];
  4246. ix = (ix << UTRIE2_INDEX_SHIFT) + (codePoint & UTRIE2_DATA_MASK);
  4247. return this.data[ix];
  4248. }
  4249. if (codePoint <= 0xffff) {
  4250. // Lead Surrogate Code Point. A Separate index section is stored for
  4251. // lead surrogate code units and code points.
  4252. // The main index has the code unit data.
  4253. // For this function, we need the code point data.
  4254. // Note: this expression could be refactored for slightly improved efficiency, but
  4255. // surrogate code points will be so rare in practice that it's not worth it.
  4256. ix = this.index[UTRIE2_LSCP_INDEX_2_OFFSET + (codePoint - 0xd800 >> UTRIE2_SHIFT_2)];
  4257. ix = (ix << UTRIE2_INDEX_SHIFT) + (codePoint & UTRIE2_DATA_MASK);
  4258. return this.data[ix];
  4259. }
  4260. if (codePoint < this.highStart) {
  4261. // Supplemental code point, use two-level lookup.
  4262. ix = UTRIE2_INDEX_1_OFFSET - UTRIE2_OMITTED_BMP_INDEX_1_LENGTH + (codePoint >> UTRIE2_SHIFT_1);
  4263. ix = this.index[ix];
  4264. ix += codePoint >> UTRIE2_SHIFT_2 & UTRIE2_INDEX_2_MASK;
  4265. ix = this.index[ix];
  4266. ix = (ix << UTRIE2_INDEX_SHIFT) + (codePoint & UTRIE2_DATA_MASK);
  4267. return this.data[ix];
  4268. }
  4269. if (codePoint <= 0x10ffff) {
  4270. return this.data[this.highValueIndex];
  4271. }
  4272. }
  4273. // Fall through. The code point is outside of the legal range of 0..0x10ffff.
  4274. return this.errorValue;
  4275. }
  4276. }]);
  4277. return Trie;
  4278. }();
  4279. /***/ }),
  4280. /* 49 */
  4281. /***/ (function(module, exports, __webpack_require__) {
  4282. "use strict";
  4283. module.exports = 'KwAAAAAAAAAACA4AIDoAAPAfAAACAAAAAAAIABAAGABAAEgAUABYAF4AZgBeAGYAYABoAHAAeABeAGYAfACEAIAAiACQAJgAoACoAK0AtQC9AMUAXgBmAF4AZgBeAGYAzQDVAF4AZgDRANkA3gDmAOwA9AD8AAQBDAEUARoBIgGAAIgAJwEvATcBPwFFAU0BTAFUAVwBZAFsAXMBewGDATAAiwGTAZsBogGkAawBtAG8AcIBygHSAdoB4AHoAfAB+AH+AQYCDgIWAv4BHgImAi4CNgI+AkUCTQJTAlsCYwJrAnECeQKBAk0CiQKRApkCoQKoArACuALAAsQCzAIwANQC3ALkAjAA7AL0AvwCAQMJAxADGAMwACADJgMuAzYDPgOAAEYDSgNSA1IDUgNaA1oDYANiA2IDgACAAGoDgAByA3YDfgOAAIQDgACKA5IDmgOAAIAAogOqA4AAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAK8DtwOAAIAAvwPHA88D1wPfAyAD5wPsA/QD/AOAAIAABAQMBBIEgAAWBB4EJgQuBDMEIAM7BEEEXgBJBCADUQRZBGEEaQQwADAAcQQ+AXkEgQSJBJEEgACYBIAAoASoBK8EtwQwAL8ExQSAAIAAgACAAIAAgACgAM0EXgBeAF4AXgBeAF4AXgBeANUEXgDZBOEEXgDpBPEE+QQBBQkFEQUZBSEFKQUxBTUFPQVFBUwFVAVcBV4AYwVeAGsFcwV7BYMFiwWSBV4AmgWgBacFXgBeAF4AXgBeAKsFXgCyBbEFugW7BcIFwgXIBcIFwgXQBdQF3AXkBesF8wX7BQMGCwYTBhsGIwYrBjMGOwZeAD8GRwZNBl4AVAZbBl4AXgBeAF4AXgBeAF4AXgBeAF4AXgBeAGMGXgBqBnEGXgBeAF4AXgBeAF4AXgBeAF4AXgB5BoAG4wSGBo4GkwaAAIADHgR5AF4AXgBeAJsGgABGA4AAowarBrMGswagALsGwwbLBjAA0wbaBtoG3QbaBtoG2gbaBtoG2gblBusG8wb7BgMHCwcTBxsHCwcjBysHMAc1BzUHOgdCB9oGSgdSB1oHYAfaBloHaAfaBlIH2gbaBtoG2gbaBtoG2gbaBjUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHbQdeAF4ANQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQd1B30HNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1B4MH2gaKB68EgACAAIAAgACAAIAAgACAAI8HlwdeAJ8HpweAAIAArwe3B14AXgC/B8UHygcwANAH2AfgB4AA6AfwBz4B+AcACFwBCAgPCBcIogEYAR8IJwiAAC8INwg/CCADRwhPCFcIXwhnCEoDGgSAAIAAgABvCHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIhAiLCI4IMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlggwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAANQc1BzUHNQc1BzUHNQc1BzUHNQc1B54INQc1B6II2gaqCLIIugiAAIAAvgjGCIAAgACAAIAAgACAAIAAgACAAIAAywiHAYAA0wiAANkI3QjlCO0I9Aj8CIAAgACAAAIJCgkSCRoJIgknCTYHLwk3CZYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiAAIAAAAFAAXgBeAGAAcABeAHwAQACQAKAArQC9AJ4AXgBeAE0A3gBRAN4A7AD8AMwBGgEAAKcBNwEFAUwBXAF4QkhCmEKnArcCgAHHAsABz4LAAcABwAHAAd+C6ABoAG+C/4LAAcABwAHAAc+DF4MAAcAB54M3gweDV4Nng3eDaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAEeDqABVg6WDqABoQ6gAaABoAHXDvcONw/3DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DncPAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcAB7cPPwlGCU4JMACAAIAAgABWCV4JYQmAAGkJcAl4CXwJgAkwADAAMAAwAIgJgACLCZMJgACZCZ8JowmrCYAAswkwAF4AXgB8AIAAuwkABMMJyQmAAM4JgADVCTAAMAAwADAAgACAAIAAgACAAIAAgACAAIAAqwYWBNkIMAAwADAAMADdCeAJ6AnuCR4E9gkwAP4JBQoNCjAAMACAABUK0wiAAB0KJAosCjQKgAAwADwKQwqAAEsKvQmdCVMKWwowADAAgACAALcEMACAAGMKgABrCjAAMAAwADAAMAAwADAAMAAwADAAMAAeBDAAMAAwADAAMAAwADAAMAAwADAAMAAwAIkEPQFzCnoKiQSCCooKkAqJBJgKoAqkCokEGAGsCrQKvArBCjAAMADJCtEKFQHZCuEK/gHpCvEKMAAwADAAMACAAIwE+QowAIAAPwEBCzAAMAAwADAAMACAAAkLEQswAIAAPwEZCyELgAAOCCkLMAAxCzkLMAAwADAAMAAwADAAXgBeAEELMAAwADAAMAAwADAAMAAwAEkLTQtVC4AAXAtkC4AAiQkwADAAMAAwADAAMAAwADAAbAtxC3kLgAuFC4sLMAAwAJMLlwufCzAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAApwswADAAMACAAIAAgACvC4AAgACAAIAAgACAALcLMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAvwuAAMcLgACAAIAAgACAAIAAyguAAIAAgACAAIAA0QswADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAANkLgACAAIAA4AswADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACJCR4E6AswADAAhwHwC4AA+AsADAgMEAwwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMACAAIAAGAwdDCUMMAAwAC0MNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQw1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHPQwwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADUHNQc1BzUHNQc1BzUHNQc2BzAAMAA5DDUHNQc1BzUHNQc1BzUHNQc1BzUHNQdFDDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAgACAAIAATQxSDFoMMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAF4AXgBeAF4AXgBeAF4AYgxeAGoMXgBxDHkMfwxeAIUMXgBeAI0MMAAwADAAMAAwAF4AXgCVDJ0MMAAwADAAMABeAF4ApQxeAKsMswy7DF4Awgy9DMoMXgBeAF4AXgBeAF4AXgBeAF4AXgDRDNkMeQBqCeAM3Ax8AOYM7Az0DPgMXgBeAF4AXgBeAF4AXgBeAF4AXgBeAF4AXgBeAF4AXgCgAAANoAAHDQ4NFg0wADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAeDSYNMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIAAgACAAIAAgACAAC4NMABeAF4ANg0wADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAD4NRg1ODVYNXg1mDTAAbQ0wADAAMAAwADAAMAAwADAA2gbaBtoG2gbaBtoG2gbaBnUNeg3CBYANwgWFDdoGjA3aBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gaUDZwNpA2oDdoG2gawDbcNvw3HDdoG2gbPDdYN3A3fDeYN2gbsDfMN2gbaBvoN/g3aBgYODg7aBl4AXgBeABYOXgBeACUG2gYeDl4AJA5eACwO2w3aBtoGMQ45DtoG2gbaBtoGQQ7aBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gZJDjUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1B1EO2gY1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQdZDjUHNQc1BzUHNQc1B2EONQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHaA41BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1B3AO2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gY1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1B2EO2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gZJDtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBkkOeA6gAKAAoAAwADAAMAAwAKAAoACgAKAAoACgAKAAgA4wADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAD//wQABAAEAAQABAAEAAQABAAEAA0AAwABAAEAAgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAKABMAFwAeABsAGgAeABcAFgASAB4AGwAYAA8AGAAcAEsASwBLAEsASwBLAEsASwBLAEsAGAAYAB4AHgAeABMAHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAFgAbABIAHgAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABYADQARAB4ABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAUABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAkAFgAaABsAGwAbAB4AHQAdAB4ATwAXAB4ADQAeAB4AGgAbAE8ATwAOAFAAHQAdAB0ATwBPABcATwBPAE8AFgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAB4AUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAFAATwBAAE8ATwBPAEAATwBQAFAATwBQAB4AHgAeAB4AHgAeAB0AHQAdAB0AHgAdAB4ADgBQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgBQAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAkACQAJAAkACQAJAAkABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAFAAHgAeAB4AKwArAFAAUABQAFAAGABQACsAKwArACsAHgAeAFAAHgBQAFAAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUAAeAB4AHgAeAB4AHgArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAYAA0AKwArAB4AHgAbACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAB4ABAAEAB4ABAAEABMABAArACsAKwArACsAKwArACsAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAKwArACsAKwArAFYAVgBWAB4AHgArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AGgAaABoAGAAYAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQAEwAEACsAEwATAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABLAEsASwBLAEsASwBLAEsASwBLABoAGQAZAB4AUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABMAUAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABABQAFAABAAEAB4ABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUAAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAFAABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQAUABQAB4AHgAYABMAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAFAABAAEAAQABAAEAFAABAAEAAQAUAAEAAQABAAEAAQAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArACsAHgArAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAAQABAANAA0ASwBLAEsASwBLAEsASwBLAEsASwAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAKwArACsAUABQAFAAUAArACsABABQAAQABAAEAAQABAAEAAQAKwArAAQABAArACsABAAEAAQAUAArACsAKwArACsAKwArACsABAArACsAKwArAFAAUAArAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAGgAaAFAAUABQAFAAUABMAB4AGwBQAB4AKwArACsABAAEAAQAKwBQAFAAUABQAFAAUAArACsAKwArAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUAArAFAAUAArACsABAArAAQABAAEAAQABAArACsAKwArAAQABAArACsABAAEAAQAKwArACsABAArACsAKwArACsAKwArAFAAUABQAFAAKwBQACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwAEAAQAUABQAFAABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUABQAFAAUAArACsABABQAAQABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQAKwArAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwAeABsAKwArACsAKwArACsAKwBQAAQABAAEAAQABAAEACsABAAEAAQAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwArAAQABAArACsABAAEAAQAKwArACsAKwArACsAKwArAAQABAArACsAKwArAFAAUAArAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwAeAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwAEAFAAKwBQAFAAUABQAFAAUAArACsAKwBQAFAAUAArAFAAUABQAFAAKwArACsAUABQACsAUAArAFAAUAArACsAKwBQAFAAKwArACsAUABQAFAAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAAQABAAEAAQAKwArACsABAAEAAQAKwAEAAQABAAEACsAKwBQACsAKwArACsAKwArAAQAKwArACsAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAB4AHgAeAB4AHgAeABsAHgArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABAArACsAKwArACsAKwArAAQABAArAFAAUABQACsAKwArACsAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAB4AUAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABAArACsAKwArACsAKwArAAQABAArACsAKwArACsAKwArAFAAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABABQAB4AKwArACsAKwBQAFAAUAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQABoAUABQAFAAUABQAFAAKwArAAQABAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQACsAUAArACsAUABQAFAAUABQAFAAUAArACsAKwAEACsAKwArACsABAAEAAQABAAEAAQAKwAEACsABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgAqACsAKwArACsAGwBcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAeAEsASwBLAEsASwBLAEsASwBLAEsADQANACsAKwArACsAKwBcAFwAKwBcACsAKwBcAFwAKwBcACsAKwBcACsAKwArACsAKwArAFwAXABcAFwAKwBcAFwAXABcAFwAXABcACsAXABcAFwAKwBcACsAXAArACsAXABcACsAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgArACoAKgBcACsAKwBcAFwAXABcAFwAKwBcACsAKgAqACoAKgAqACoAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAFwAXABcAFwAUAAOAA4ADgAOAB4ADgAOAAkADgAOAA0ACQATABMAEwATABMACQAeABMAHgAeAB4ABAAEAB4AHgAeAB4AHgAeAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUAANAAQAHgAEAB4ABAAWABEAFgARAAQABABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAAQABAAEAAQABAANAAQABABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsADQANAB4AHgAeAB4AHgAeAAQAHgAeAB4AHgAeAB4AKwAeAB4ADgAOAA0ADgAeAB4AHgAeAB4ACQAJACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqAFwASwBLAEsASwBLAEsASwBLAEsASwANAA0AHgAeAB4AHgBcAFwAXABcAFwAXAAqACoAKgAqAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAKgAqACoAKgAqACoAKgBcAFwAXAAqACoAKgAqAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAXAAqAEsASwBLAEsASwBLAEsASwBLAEsAKgAqACoAKgAqACoAUABQAFAAUABQAFAAKwBQACsAKwArACsAKwBQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQACsAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwAEAAQABAAeAA0AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABYAEQArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAADQANAA0AUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAA0ADQArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQACsABAAEACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoADQANABUAXAANAB4ADQAbAFwAKgArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAB4AHgATABMADQANAA4AHgATABMAHgAEAAQABAAJACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAUABQAFAAUABQAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwAeACsAKwArABMAEwBLAEsASwBLAEsASwBLAEsASwBLAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwBcAFwAXABcAFwAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBcACsAKwArACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEACsAKwAeAB4AXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgArACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgArACsABABLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKgAqACoAKgAqACoAKgBcACoAKgAqACoAKgAqACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAUABQAFAAUABQAFAAUAArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsADQANAB4ADQANAA0ADQAeAB4AHgAeAB4AHgAeAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAHgAeAB4AHgBQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwANAA0ADQANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwBQAFAAUABLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAA0AUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsABAAEAAQAHgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAUABQAFAABABQAFAAUABQAAQABAAEAFAAUAAEAAQABAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAKwBQACsAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAHgAeAB4AHgAeAB4AHgAeAFAAHgAeAB4AUABQAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAKwArAB4AHgAeAB4AHgAeACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAUABQAFAAKwAeAB4AHgAeAB4AHgAeAA4AHgArAA0ADQANAA0ADQANAA0ACQANAA0ADQAIAAQACwAEAAQADQAJAA0ADQAMAB0AHQAeABcAFwAWABcAFwAXABYAFwAdAB0AHgAeABQAFAAUAA0AAQABAAQABAAEAAQABAAJABoAGgAaABoAGgAaABoAGgAeABcAFwAdABUAFQAeAB4AHgAeAB4AHgAYABYAEQAVABUAFQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgANAB4ADQANAA0ADQAeAA0ADQANAAcAHgAeAB4AHgArAAQABAAEAAQABAAEAAQABAAEAAQAUABQACsAKwBPAFAAUABQAFAAUAAeAB4AHgAWABEATwBQAE8ATwBPAE8AUABQAFAAUABQAB4AHgAeABYAEQArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAGwAbABsAGwAbABsAGwAaABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAaABsAGwAbABsAGgAbABsAGgAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgBQABoAHgAdAB4AUAAeABoAHgAeAB4AHgAeAB4AHgAeAB4ATwAeAFAAGwAeAB4AUABQAFAAUABQAB4AHgAeAB0AHQAeAFAAHgBQAB4AUAAeAFAATwBQAFAAHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AUABQAFAAUABPAE8AUABQAFAAUABQAE8AUABQAE8AUABPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBQAFAAUABQAE8ATwBPAE8ATwBPAE8ATwBPAE8AUABQAFAAUABQAFAAUABQAFAAHgAeAFAAUABQAFAATwAeAB4AKwArACsAKwAdAB0AHQAdAB0AHQAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAeAB0AHQAeAB4AHgAdAB0AHgAeAB0AHgAeAB4AHQAeAB0AGwAbAB4AHQAeAB4AHgAeAB0AHgAeAB0AHQAdAB0AHgAeAB0AHgAdAB4AHQAdAB0AHQAdAB0AHgAdAB4AHgAeAB4AHgAdAB0AHQAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAdAB4AHgAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB4AHgAdAB0AHQAdAB4AHgAdAB0AHgAeAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAeAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHQAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABQAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAlACUAHgAeAB4AHgAeAB4AHgAeAB4AFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBQAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB4AHgAeAB4AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAdAB0AHQAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAeAB0AHQAeAB4AHgAeAB0AHQAeAB4AHgAeAB0AHQAdAB4AHgAdAB4AHgAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB0AHQAeAB4AHQAeAB4AHgAeAB0AHQAeAB4AHgAeACUAJQAdAB0AJQAeACUAJQAlACAAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAHgAeAB4AHgAdAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB4AHQAdAB0AHgAdACUAHQAdAB4AHQAdAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAHQAdAB0AHQAlAB4AJQAlACUAHQAlACUAHQAdAB0AJQAlAB0AHQAlAB0AHQAlACUAJQAeAB0AHgAeAB4AHgAdAB0AJQAdAB0AHQAdAB0AHQAlACUAJQAlACUAHQAlACUAIAAlAB0AHQAlACUAJQAlACUAJQAlACUAHgAeAB4AJQAlACAAIAAgACAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeABcAFwAXABcAFwAXAB4AEwATACUAHgAeAB4AFgARABYAEQAWABEAFgARABYAEQAWABEAFgARAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARABYAEQAWABEAFgARABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAEAAQABAAeAB4AKwArACsAKwArABMADQANAA0AUAATAA0AUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUAANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAA0ADQANAA0ADQANAA0ADQAeAA0AFgANAB4AHgAXABcAHgAeABcAFwAWABEAFgARABYAEQAWABEADQANAA0ADQATAFAADQANAB4ADQANAB4AHgAeAB4AHgAMAAwADQANAA0AHgANAA0AFgANAA0ADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArAA0AEQARACUAJQBHAFcAVwAWABEAFgARABYAEQAWABEAFgARACUAJQAWABEAFgARABYAEQAWABEAFQAWABEAEQAlAFcAVwBXAFcAVwBXAFcAVwBXAAQABAAEAAQABAAEACUAVwBXAFcAVwA2ACUAJQBXAFcAVwBHAEcAJQAlACUAKwBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBRAFcAUQBXAFEAVwBXAFcAVwBXAFcAUQBXAFcAVwBXAFcAVwBRAFEAKwArAAQABAAVABUARwBHAFcAFQBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBRAFcAVwBXAFcAVwBXAFEAUQBXAFcAVwBXABUAUQBHAEcAVwArACsAKwArACsAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwArACUAJQBXAFcAVwBXACUAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAKwArACUAJQAlACUAKwArACsAKwArACsAKwArACsAKwArACsAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAE8ATwBPAE8ATwBPAE8ATwAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADQATAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABLAEsASwBLAEsASwBLAEsASwBLAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAABAAEAAQABAAeAAQABAAEAAQABAAEAAQABAAEAAQAHgBQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAeAA0ADQANAA0ADQArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAAQAUABQAFAABABQAFAAUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAeAB4AHgAeACsAKwArACsAUABQAFAAUABQAFAAHgAeABoAHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADgAOABMAEwArACsAKwArACsAKwArACsABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUAAeAB4AHgBQAA4AUAArACsAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAB4AWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYACsAKwArAAQAHgAeAB4AHgAeAB4ADQANAA0AHgAeAB4AHgArAFAASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArAB4AHgBcAFwAXABcAFwAKgBcAFwAXABcAFwAXABcAFwAXABcAEsASwBLAEsASwBLAEsASwBLAEsAXABcAFwAXABcACsAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAFAAUABQAAQAUABQAFAAUABQAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAHgANAA0ADQBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAKgAqACoAXABcACoAKgBcAFwAXABcAFwAKgAqAFwAKgBcACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAA0ADQBQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQADQAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAVABVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBUAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVACsAKwArACsAKwArACsAKwArACsAKwArAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAKwArACsAKwBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAKwArACsAKwAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAKwArACsAKwArAFYABABWAFYAVgBWAFYAVgBWAFYAVgBWAB4AVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgArAFYAVgBWAFYAVgArAFYAKwBWAFYAKwBWAFYAKwBWAFYAVgBWAFYAVgBWAFYAVgBWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAEQAWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAaAB4AKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAGAARABEAGAAYABMAEwAWABEAFAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACUAJQAlACUAJQAWABEAFgARABYAEQAWABEAFgARABYAEQAlACUAFgARACUAJQAlACUAJQAlACUAEQAlABEAKwAVABUAEwATACUAFgARABYAEQAWABEAJQAlACUAJQAlACUAJQAlACsAJQAbABoAJQArACsAKwArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAcAKwATACUAJQAbABoAJQAlABYAEQAlACUAEQAlABEAJQBXAFcAVwBXAFcAVwBXAFcAVwBXABUAFQAlACUAJQATACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXABYAJQARACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAWACUAEQAlABYAEQARABYAEQARABUAVwBRAFEAUQBRAFEAUQBRAFEAUQBRAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcARwArACsAVwBXAFcAVwBXAFcAKwArAFcAVwBXAFcAVwBXACsAKwBXAFcAVwBXAFcAVwArACsAVwBXAFcAKwArACsAGgAbACUAJQAlABsAGwArAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAAQAB0AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsADQANAA0AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQBQAFAAUABQACsAKwArACsAUABQAFAAUABQAFAAUABQAA0AUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQACsAKwArAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgBQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwBQAFAAUABQAFAABAAEAAQAKwAEAAQAKwArACsAKwArAAQABAAEAAQAUABQAFAAUAArAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsABAAEAAQAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsADQANAA0ADQANAA0ADQANAB4AKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AUABQAFAAUABQAFAAUABQAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwArACsAUABQAFAAUABQAA0ADQANAA0ADQANABQAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwANAA0ADQANAA0ADQANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQAeAB4AHgAeAB4AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsASwBLAEsASwBLAEsASwBLAEsASwANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAeAA4AUAArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAADQANAB4ADQAeAAQABAAEAB4AKwArAEsASwBLAEsASwBLAEsASwBLAEsAUAAOAFAADQANAA0AKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAA0AHgANAA0AHgAEACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAA0AKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAUAArACsAKwArACsAKwAEACsAKwArACsAKwBQAFAAUABQAFAABAAEACsAKwAEAAQABAAEAAQABAAEACsAKwArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABABQAFAAUABQAA0ADQANAA0AHgBLAEsASwBLAEsASwBLAEsASwBLACsADQArAB4AKwArAAQABAAEAAQAUABQAB4AUAArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEACsAKwAEAAQABAAEAAQABAAEAAQABAAOAA0ADQATABMAHgAeAB4ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0AUABQAFAAUAAEAAQAKwArAAQADQANAB4AUAArACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAKwAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAXABcAA0ADQANACoASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAOAB4ADQANAA0ADQAOAB4ABAArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAFAAUAArACsAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAA0ADQANACsADgAOAA4ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAFAADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAOABMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAArACsAKwAEACsABAAEACsABAAEAAQABAAEAAQABABQAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABIAEgAQwBDAEMAUABQAFAAUABDAFAAUABQAEgAQwBIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABDAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwANAA0AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAANACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQANAB4AHgAeAB4AHgAeAFAAUABQAFAADQAeACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEcARwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwArACsAKwArACsAKwArACsAKwArACsAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQACsAKwAeAAQABAANAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAHgAeAAQABAAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAEAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUAArACsAUAArACsAUABQACsAKwBQAFAAUABQACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQACsAUABQAFAAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwAeAB4AUABQAFAAUABQACsAUAArACsAKwBQAFAAUABQAFAAUABQACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AKwArAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAEAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAeAB4ADQANAA0ADQAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABAArAAQABAArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAEAAQABAAEAAQABAAEACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAFgAWAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArAFAAKwArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArAFAAKwBQACsAKwArACsAKwArAFAAKwArACsAKwBQACsAUAArAFAAKwBQAFAAUAArAFAAUAArAFAAKwArAFAAKwBQACsAUAArAFAAKwBQACsAUABQACsAUAArACsAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAUABQAFAAUAArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwBQAFAAUAArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAlACUAJQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeACUAJQAlACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeACUAJQAlACUAJQAeACUAJQAlACUAJQAgACAAIAAlACUAIAAlACUAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIQAhACEAIQAhACUAJQAgACAAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIAAgACAAIAAlACUAJQAlACAAJQAgACAAIAAgACAAIAAgACAAIAAlACUAJQAgACUAJQAlACUAIAAgACAAJQAgACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeACUAHgAlAB4AJQAlACUAJQAlACAAJQAlACUAJQAeACUAHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIAAgACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIAAlACUAJQAlACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAIAAgACAAJQAlACUAIAAgACAAIAAgAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFwAXABcAFQAVABUAHgAeAB4AHgAlACUAJQAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIAAgACAAJQAlACUAJQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAlACAAIAAlACUAJQAlACUAJQAgACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAIAAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsA';
  4284. /***/ }),
  4285. /* 50 */
  4286. /***/ (function(module, exports, __webpack_require__) {
  4287. "use strict";
  4288. Object.defineProperty(exports, "__esModule", {
  4289. value: true
  4290. });
  4291. var _Path = __webpack_require__(6);
  4292. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  4293. var Circle = function Circle(x, y, radius) {
  4294. _classCallCheck(this, Circle);
  4295. this.type = _Path.PATH.CIRCLE;
  4296. this.x = x;
  4297. this.y = y;
  4298. this.radius = radius;
  4299. if (true) {
  4300. if (isNaN(x)) {
  4301. console.error('Invalid x value given for Circle');
  4302. }
  4303. if (isNaN(y)) {
  4304. console.error('Invalid y value given for Circle');
  4305. }
  4306. if (isNaN(radius)) {
  4307. console.error('Invalid radius value given for Circle');
  4308. }
  4309. }
  4310. };
  4311. exports.default = Circle;
  4312. /***/ }),
  4313. /* 51 */
  4314. /***/ (function(module, exports, __webpack_require__) {
  4315. "use strict";
  4316. Object.defineProperty(exports, "__esModule", {
  4317. value: true
  4318. });
  4319. var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
  4320. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  4321. var _Bounds = __webpack_require__(1);
  4322. var _Font = __webpack_require__(25);
  4323. var _Gradient = __webpack_require__(52);
  4324. var _TextContainer = __webpack_require__(9);
  4325. var _TextContainer2 = _interopRequireDefault(_TextContainer);
  4326. var _background = __webpack_require__(5);
  4327. var _border = __webpack_require__(12);
  4328. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  4329. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  4330. var Renderer = function () {
  4331. function Renderer(target, options) {
  4332. _classCallCheck(this, Renderer);
  4333. this.target = target;
  4334. this.options = options;
  4335. target.render(options);
  4336. }
  4337. _createClass(Renderer, [{
  4338. key: 'renderNode',
  4339. value: function renderNode(container) {
  4340. if (container.isVisible()) {
  4341. this.renderNodeBackgroundAndBorders(container);
  4342. this.renderNodeContent(container);
  4343. }
  4344. }
  4345. }, {
  4346. key: 'renderNodeContent',
  4347. value: function renderNodeContent(container) {
  4348. var _this = this;
  4349. var callback = function callback() {
  4350. if (container.childNodes.length) {
  4351. container.childNodes.forEach(function (child) {
  4352. if (child instanceof _TextContainer2.default) {
  4353. var style = child.parent.style;
  4354. _this.target.renderTextNode(child.bounds, style.color, style.font, style.textDecoration, style.textShadow);
  4355. } else {
  4356. _this.target.drawShape(child, container.style.color);
  4357. }
  4358. });
  4359. }
  4360. if (container.image) {
  4361. var _image = _this.options.imageStore.get(container.image);
  4362. if (_image) {
  4363. var contentBox = (0, _Bounds.calculateContentBox)(container.bounds, container.style.padding, container.style.border);
  4364. var _width = typeof _image.width === 'number' && _image.width > 0 ? _image.width : contentBox.width;
  4365. var _height = typeof _image.height === 'number' && _image.height > 0 ? _image.height : contentBox.height;
  4366. if (_width > 0 && _height > 0) {
  4367. _this.target.clip([(0, _Bounds.calculatePaddingBoxPath)(container.curvedBounds)], function () {
  4368. _this.target.drawImage(_image, new _Bounds.Bounds(0, 0, _width, _height), contentBox);
  4369. });
  4370. }
  4371. }
  4372. }
  4373. };
  4374. var paths = container.getClipPaths();
  4375. if (paths.length) {
  4376. this.target.clip(paths, callback);
  4377. } else {
  4378. callback();
  4379. }
  4380. }
  4381. }, {
  4382. key: 'renderNodeBackgroundAndBorders',
  4383. value: function renderNodeBackgroundAndBorders(container) {
  4384. var _this2 = this;
  4385. var HAS_BACKGROUND = !container.style.background.backgroundColor.isTransparent() || container.style.background.backgroundImage.length;
  4386. var hasRenderableBorders = container.style.border.some(function (border) {
  4387. return border.borderStyle !== _border.BORDER_STYLE.NONE && !border.borderColor.isTransparent();
  4388. });
  4389. var callback = function callback() {
  4390. var backgroundPaintingArea = (0, _background.calculateBackgroungPaintingArea)(container.curvedBounds, container.style.background.backgroundClip);
  4391. if (HAS_BACKGROUND) {
  4392. _this2.target.clip([backgroundPaintingArea], function () {
  4393. if (!container.style.background.backgroundColor.isTransparent()) {
  4394. _this2.target.fill(container.style.background.backgroundColor);
  4395. }
  4396. _this2.renderBackgroundImage(container);
  4397. });
  4398. }
  4399. container.style.border.forEach(function (border, side) {
  4400. if (border.borderStyle !== _border.BORDER_STYLE.NONE && !border.borderColor.isTransparent()) {
  4401. _this2.renderBorder(border, side, container.curvedBounds);
  4402. }
  4403. });
  4404. };
  4405. if (HAS_BACKGROUND || hasRenderableBorders) {
  4406. var paths = container.parent ? container.parent.getClipPaths() : [];
  4407. if (paths.length) {
  4408. this.target.clip(paths, callback);
  4409. } else {
  4410. callback();
  4411. }
  4412. }
  4413. }
  4414. }, {
  4415. key: 'renderBackgroundImage',
  4416. value: function renderBackgroundImage(container) {
  4417. var _this3 = this;
  4418. container.style.background.backgroundImage.slice(0).reverse().forEach(function (backgroundImage) {
  4419. if (backgroundImage.source.method === 'url' && backgroundImage.source.args.length) {
  4420. _this3.renderBackgroundRepeat(container, backgroundImage);
  4421. } else if (/gradient/i.test(backgroundImage.source.method)) {
  4422. _this3.renderBackgroundGradient(container, backgroundImage);
  4423. }
  4424. });
  4425. }
  4426. }, {
  4427. key: 'renderBackgroundRepeat',
  4428. value: function renderBackgroundRepeat(container, background) {
  4429. var image = this.options.imageStore.get(background.source.args[0]);
  4430. if (image) {
  4431. var backgroundPositioningArea = (0, _background.calculateBackgroungPositioningArea)(container.style.background.backgroundOrigin, container.bounds, container.style.padding, container.style.border);
  4432. var backgroundImageSize = (0, _background.calculateBackgroundSize)(background, image, backgroundPositioningArea);
  4433. var position = (0, _background.calculateBackgroundPosition)(background.position, backgroundImageSize, backgroundPositioningArea);
  4434. var _path = (0, _background.calculateBackgroundRepeatPath)(background, position, backgroundImageSize, backgroundPositioningArea, container.bounds);
  4435. var _offsetX = Math.round(backgroundPositioningArea.left + position.x);
  4436. var _offsetY = Math.round(backgroundPositioningArea.top + position.y);
  4437. this.target.renderRepeat(_path, image, backgroundImageSize, _offsetX, _offsetY);
  4438. }
  4439. }
  4440. }, {
  4441. key: 'renderBackgroundGradient',
  4442. value: function renderBackgroundGradient(container, background) {
  4443. var backgroundPositioningArea = (0, _background.calculateBackgroungPositioningArea)(container.style.background.backgroundOrigin, container.bounds, container.style.padding, container.style.border);
  4444. var backgroundImageSize = (0, _background.calculateGradientBackgroundSize)(background, backgroundPositioningArea);
  4445. var position = (0, _background.calculateBackgroundPosition)(background.position, backgroundImageSize, backgroundPositioningArea);
  4446. var gradientBounds = new _Bounds.Bounds(Math.round(backgroundPositioningArea.left + position.x), Math.round(backgroundPositioningArea.top + position.y), backgroundImageSize.width, backgroundImageSize.height);
  4447. var gradient = (0, _Gradient.parseGradient)(container, background.source, gradientBounds);
  4448. if (gradient) {
  4449. switch (gradient.type) {
  4450. case _Gradient.GRADIENT_TYPE.LINEAR_GRADIENT:
  4451. // $FlowFixMe
  4452. this.target.renderLinearGradient(gradientBounds, gradient);
  4453. break;
  4454. case _Gradient.GRADIENT_TYPE.RADIAL_GRADIENT:
  4455. // $FlowFixMe
  4456. this.target.renderRadialGradient(gradientBounds, gradient);
  4457. break;
  4458. }
  4459. }
  4460. }
  4461. }, {
  4462. key: 'renderBorder',
  4463. value: function renderBorder(border, side, curvePoints) {
  4464. this.target.drawShape((0, _Bounds.parsePathForBorder)(curvePoints, side), border.borderColor);
  4465. }
  4466. }, {
  4467. key: 'renderStack',
  4468. value: function renderStack(stack) {
  4469. var _this4 = this;
  4470. if (stack.container.isVisible()) {
  4471. var _opacity = stack.getOpacity();
  4472. if (_opacity !== this._opacity) {
  4473. this.target.setOpacity(stack.getOpacity());
  4474. this._opacity = _opacity;
  4475. }
  4476. var _transform = stack.container.style.transform;
  4477. if (_transform !== null) {
  4478. this.target.transform(stack.container.bounds.left + _transform.transformOrigin[0].value, stack.container.bounds.top + _transform.transformOrigin[1].value, _transform.transform, function () {
  4479. return _this4.renderStackContent(stack);
  4480. });
  4481. } else {
  4482. this.renderStackContent(stack);
  4483. }
  4484. }
  4485. }
  4486. }, {
  4487. key: 'renderStackContent',
  4488. value: function renderStackContent(stack) {
  4489. var _splitStackingContext = splitStackingContexts(stack),
  4490. _splitStackingContext2 = _slicedToArray(_splitStackingContext, 5),
  4491. negativeZIndex = _splitStackingContext2[0],
  4492. zeroOrAutoZIndexOrTransformedOrOpacity = _splitStackingContext2[1],
  4493. positiveZIndex = _splitStackingContext2[2],
  4494. nonPositionedFloats = _splitStackingContext2[3],
  4495. nonPositionedInlineLevel = _splitStackingContext2[4];
  4496. var _splitDescendants = splitDescendants(stack),
  4497. _splitDescendants2 = _slicedToArray(_splitDescendants, 2),
  4498. inlineLevel = _splitDescendants2[0],
  4499. nonInlineLevel = _splitDescendants2[1];
  4500. // https://www.w3.org/TR/css-position-3/#painting-order
  4501. // 1. the background and borders of the element forming the stacking context.
  4502. this.renderNodeBackgroundAndBorders(stack.container);
  4503. // 2. the child stacking contexts with negative stack levels (most negative first).
  4504. negativeZIndex.sort(sortByZIndex).forEach(this.renderStack, this);
  4505. // 3. For all its in-flow, non-positioned, block-level descendants in tree order:
  4506. this.renderNodeContent(stack.container);
  4507. nonInlineLevel.forEach(this.renderNode, this);
  4508. // 4. All non-positioned floating descendants, in tree order. For each one of these,
  4509. // treat the element as if it created a new stacking context, but any positioned descendants and descendants
  4510. // which actually create a new stacking context should be considered part of the parent stacking context,
  4511. // not this new one.
  4512. nonPositionedFloats.forEach(this.renderStack, this);
  4513. // 5. the in-flow, inline-level, non-positioned descendants, including inline tables and inline blocks.
  4514. nonPositionedInlineLevel.forEach(this.renderStack, this);
  4515. inlineLevel.forEach(this.renderNode, this);
  4516. // 6. All positioned, opacity or transform descendants, in tree order that fall into the following categories:
  4517. // All positioned descendants with 'z-index: auto' or 'z-index: 0', in tree order.
  4518. // For those with 'z-index: auto', treat the element as if it created a new stacking context,
  4519. // but any positioned descendants and descendants which actually create a new stacking context should be
  4520. // considered part of the parent stacking context, not this new one. For those with 'z-index: 0',
  4521. // treat the stacking context generated atomically.
  4522. //
  4523. // All opacity descendants with opacity less than 1
  4524. //
  4525. // All transform descendants with transform other than none
  4526. zeroOrAutoZIndexOrTransformedOrOpacity.forEach(this.renderStack, this);
  4527. // 7. Stacking contexts formed by positioned descendants with z-indices greater than or equal to 1 in z-index
  4528. // order (smallest first) then tree order.
  4529. positiveZIndex.sort(sortByZIndex).forEach(this.renderStack, this);
  4530. }
  4531. }, {
  4532. key: 'render',
  4533. value: function render(stack) {
  4534. var _this5 = this;
  4535. if (this.options.backgroundColor) {
  4536. this.target.rectangle(this.options.x, this.options.y, this.options.width, this.options.height, this.options.backgroundColor);
  4537. }
  4538. this.renderStack(stack);
  4539. var target = this.target.getTarget();
  4540. if (true) {
  4541. return target.then(function (output) {
  4542. _this5.options.logger.log('Render completed');
  4543. return output;
  4544. });
  4545. }
  4546. return target;
  4547. }
  4548. }]);
  4549. return Renderer;
  4550. }();
  4551. exports.default = Renderer;
  4552. var splitDescendants = function splitDescendants(stack) {
  4553. var inlineLevel = [];
  4554. var nonInlineLevel = [];
  4555. var length = stack.children.length;
  4556. for (var i = 0; i < length; i++) {
  4557. var child = stack.children[i];
  4558. if (child.isInlineLevel()) {
  4559. inlineLevel.push(child);
  4560. } else {
  4561. nonInlineLevel.push(child);
  4562. }
  4563. }
  4564. return [inlineLevel, nonInlineLevel];
  4565. };
  4566. var splitStackingContexts = function splitStackingContexts(stack) {
  4567. var negativeZIndex = [];
  4568. var zeroOrAutoZIndexOrTransformedOrOpacity = [];
  4569. var positiveZIndex = [];
  4570. var nonPositionedFloats = [];
  4571. var nonPositionedInlineLevel = [];
  4572. var length = stack.contexts.length;
  4573. for (var i = 0; i < length; i++) {
  4574. var child = stack.contexts[i];
  4575. if (child.container.isPositioned() || child.container.style.opacity < 1 || child.container.isTransformed()) {
  4576. if (child.container.style.zIndex.order < 0) {
  4577. negativeZIndex.push(child);
  4578. } else if (child.container.style.zIndex.order > 0) {
  4579. positiveZIndex.push(child);
  4580. } else {
  4581. zeroOrAutoZIndexOrTransformedOrOpacity.push(child);
  4582. }
  4583. } else {
  4584. if (child.container.isFloating()) {
  4585. nonPositionedFloats.push(child);
  4586. } else {
  4587. nonPositionedInlineLevel.push(child);
  4588. }
  4589. }
  4590. }
  4591. return [negativeZIndex, zeroOrAutoZIndexOrTransformedOrOpacity, positiveZIndex, nonPositionedFloats, nonPositionedInlineLevel];
  4592. };
  4593. var sortByZIndex = function sortByZIndex(a, b) {
  4594. if (a.container.style.zIndex.order > b.container.style.zIndex.order) {
  4595. return 1;
  4596. } else if (a.container.style.zIndex.order < b.container.style.zIndex.order) {
  4597. return -1;
  4598. }
  4599. return a.container.index > b.container.index ? 1 : -1;
  4600. };
  4601. /***/ }),
  4602. /* 52 */
  4603. /***/ (function(module, exports, __webpack_require__) {
  4604. "use strict";
  4605. Object.defineProperty(exports, "__esModule", {
  4606. value: true
  4607. });
  4608. exports.transformWebkitRadialGradientArgs = exports.parseGradient = exports.RadialGradient = exports.LinearGradient = exports.RADIAL_GRADIENT_SHAPE = exports.GRADIENT_TYPE = undefined;
  4609. var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
  4610. var _NodeContainer = __webpack_require__(3);
  4611. var _NodeContainer2 = _interopRequireDefault(_NodeContainer);
  4612. var _Angle = __webpack_require__(53);
  4613. var _Color = __webpack_require__(0);
  4614. var _Color2 = _interopRequireDefault(_Color);
  4615. var _Length = __webpack_require__(2);
  4616. var _Length2 = _interopRequireDefault(_Length);
  4617. var _Util = __webpack_require__(4);
  4618. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  4619. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  4620. var SIDE_OR_CORNER = /^(to )?(left|top|right|bottom)( (left|top|right|bottom))?$/i;
  4621. var PERCENTAGE_ANGLES = /^([+-]?\d*\.?\d+)% ([+-]?\d*\.?\d+)%$/i;
  4622. var ENDS_WITH_LENGTH = /(px)|%|( 0)$/i;
  4623. var FROM_TO_COLORSTOP = /^(from|to|color-stop)\((?:([\d.]+)(%)?,\s*)?(.+?)\)$/i;
  4624. var RADIAL_SHAPE_DEFINITION = /^\s*(circle|ellipse)?\s*((?:([\d.]+)(px|r?em|%)\s*(?:([\d.]+)(px|r?em|%))?)|closest-side|closest-corner|farthest-side|farthest-corner)?\s*(?:at\s*(?:(left|center|right)|([\d.]+)(px|r?em|%))\s+(?:(top|center|bottom)|([\d.]+)(px|r?em|%)))?(?:\s|$)/i;
  4625. var GRADIENT_TYPE = exports.GRADIENT_TYPE = {
  4626. LINEAR_GRADIENT: 0,
  4627. RADIAL_GRADIENT: 1
  4628. };
  4629. var RADIAL_GRADIENT_SHAPE = exports.RADIAL_GRADIENT_SHAPE = {
  4630. CIRCLE: 0,
  4631. ELLIPSE: 1
  4632. };
  4633. var LENGTH_FOR_POSITION = {
  4634. left: new _Length2.default('0%'),
  4635. top: new _Length2.default('0%'),
  4636. center: new _Length2.default('50%'),
  4637. right: new _Length2.default('100%'),
  4638. bottom: new _Length2.default('100%')
  4639. };
  4640. var LinearGradient = exports.LinearGradient = function LinearGradient(colorStops, direction) {
  4641. _classCallCheck(this, LinearGradient);
  4642. this.type = GRADIENT_TYPE.LINEAR_GRADIENT;
  4643. this.colorStops = colorStops;
  4644. this.direction = direction;
  4645. };
  4646. var RadialGradient = exports.RadialGradient = function RadialGradient(colorStops, shape, center, radius) {
  4647. _classCallCheck(this, RadialGradient);
  4648. this.type = GRADIENT_TYPE.RADIAL_GRADIENT;
  4649. this.colorStops = colorStops;
  4650. this.shape = shape;
  4651. this.center = center;
  4652. this.radius = radius;
  4653. };
  4654. var parseGradient = exports.parseGradient = function parseGradient(container, _ref, bounds) {
  4655. var args = _ref.args,
  4656. method = _ref.method,
  4657. prefix = _ref.prefix;
  4658. if (method === 'linear-gradient') {
  4659. return parseLinearGradient(args, bounds, !!prefix);
  4660. } else if (method === 'gradient' && args[0] === 'linear') {
  4661. // TODO handle correct angle
  4662. return parseLinearGradient(['to bottom'].concat(transformObsoleteColorStops(args.slice(3))), bounds, !!prefix);
  4663. } else if (method === 'radial-gradient') {
  4664. return parseRadialGradient(container, prefix === '-webkit-' ? transformWebkitRadialGradientArgs(args) : args, bounds);
  4665. } else if (method === 'gradient' && args[0] === 'radial') {
  4666. return parseRadialGradient(container, transformObsoleteColorStops(transformWebkitRadialGradientArgs(args.slice(1))), bounds);
  4667. }
  4668. };
  4669. var parseColorStops = function parseColorStops(args, firstColorStopIndex, lineLength) {
  4670. var colorStops = [];
  4671. for (var i = firstColorStopIndex; i < args.length; i++) {
  4672. var value = args[i];
  4673. var HAS_LENGTH = ENDS_WITH_LENGTH.test(value);
  4674. var lastSpaceIndex = value.lastIndexOf(' ');
  4675. var _color = new _Color2.default(HAS_LENGTH ? value.substring(0, lastSpaceIndex) : value);
  4676. var _stop = HAS_LENGTH ? new _Length2.default(value.substring(lastSpaceIndex + 1)) : i === firstColorStopIndex ? new _Length2.default('0%') : i === args.length - 1 ? new _Length2.default('100%') : null;
  4677. colorStops.push({ color: _color, stop: _stop });
  4678. }
  4679. var absoluteValuedColorStops = colorStops.map(function (_ref2) {
  4680. var color = _ref2.color,
  4681. stop = _ref2.stop;
  4682. var absoluteStop = lineLength === 0 ? 0 : stop ? stop.getAbsoluteValue(lineLength) / lineLength : null;
  4683. return {
  4684. color: color,
  4685. // $FlowFixMe
  4686. stop: absoluteStop
  4687. };
  4688. });
  4689. var previousColorStop = absoluteValuedColorStops[0].stop;
  4690. for (var _i = 0; _i < absoluteValuedColorStops.length; _i++) {
  4691. if (previousColorStop !== null) {
  4692. var _stop2 = absoluteValuedColorStops[_i].stop;
  4693. if (_stop2 === null) {
  4694. var n = _i;
  4695. while (absoluteValuedColorStops[n].stop === null) {
  4696. n++;
  4697. }
  4698. var steps = n - _i + 1;
  4699. var nextColorStep = absoluteValuedColorStops[n].stop;
  4700. var stepSize = (nextColorStep - previousColorStop) / steps;
  4701. for (; _i < n; _i++) {
  4702. previousColorStop = absoluteValuedColorStops[_i].stop = previousColorStop + stepSize;
  4703. }
  4704. } else {
  4705. previousColorStop = _stop2;
  4706. }
  4707. }
  4708. }
  4709. return absoluteValuedColorStops;
  4710. };
  4711. var parseLinearGradient = function parseLinearGradient(args, bounds, hasPrefix) {
  4712. var angle = (0, _Angle.parseAngle)(args[0]);
  4713. var HAS_SIDE_OR_CORNER = SIDE_OR_CORNER.test(args[0]);
  4714. var HAS_DIRECTION = HAS_SIDE_OR_CORNER || angle !== null || PERCENTAGE_ANGLES.test(args[0]);
  4715. var direction = HAS_DIRECTION ? angle !== null ? calculateGradientDirection(
  4716. // if there is a prefix, the 0° angle points due East (instead of North per W3C)
  4717. hasPrefix ? angle - Math.PI * 0.5 : angle, bounds) : HAS_SIDE_OR_CORNER ? parseSideOrCorner(args[0], bounds) : parsePercentageAngle(args[0], bounds) : calculateGradientDirection(Math.PI, bounds);
  4718. var firstColorStopIndex = HAS_DIRECTION ? 1 : 0;
  4719. // TODO: Fix some inaccuracy with color stops with px values
  4720. var lineLength = Math.min((0, _Util.distance)(Math.abs(direction.x0) + Math.abs(direction.x1), Math.abs(direction.y0) + Math.abs(direction.y1)), bounds.width * 2, bounds.height * 2);
  4721. return new LinearGradient(parseColorStops(args, firstColorStopIndex, lineLength), direction);
  4722. };
  4723. var parseRadialGradient = function parseRadialGradient(container, args, bounds) {
  4724. var m = args[0].match(RADIAL_SHAPE_DEFINITION);
  4725. var shape = m && (m[1] === 'circle' || // explicit shape specification
  4726. m[3] !== undefined && m[5] === undefined) // only one radius coordinate
  4727. ? RADIAL_GRADIENT_SHAPE.CIRCLE : RADIAL_GRADIENT_SHAPE.ELLIPSE;
  4728. var radius = {};
  4729. var center = {};
  4730. if (m) {
  4731. // Radius
  4732. if (m[3] !== undefined) {
  4733. radius.x = (0, _Length.calculateLengthFromValueWithUnit)(container, m[3], m[4]).getAbsoluteValue(bounds.width);
  4734. }
  4735. if (m[5] !== undefined) {
  4736. radius.y = (0, _Length.calculateLengthFromValueWithUnit)(container, m[5], m[6]).getAbsoluteValue(bounds.height);
  4737. }
  4738. // Position
  4739. if (m[7]) {
  4740. center.x = LENGTH_FOR_POSITION[m[7].toLowerCase()];
  4741. } else if (m[8] !== undefined) {
  4742. center.x = (0, _Length.calculateLengthFromValueWithUnit)(container, m[8], m[9]);
  4743. }
  4744. if (m[10]) {
  4745. center.y = LENGTH_FOR_POSITION[m[10].toLowerCase()];
  4746. } else if (m[11] !== undefined) {
  4747. center.y = (0, _Length.calculateLengthFromValueWithUnit)(container, m[11], m[12]);
  4748. }
  4749. }
  4750. var gradientCenter = {
  4751. x: center.x === undefined ? bounds.width / 2 : center.x.getAbsoluteValue(bounds.width),
  4752. y: center.y === undefined ? bounds.height / 2 : center.y.getAbsoluteValue(bounds.height)
  4753. };
  4754. var gradientRadius = calculateRadius(m && m[2] || 'farthest-corner', shape, gradientCenter, radius, bounds);
  4755. return new RadialGradient(parseColorStops(args, m ? 1 : 0, Math.min(gradientRadius.x, gradientRadius.y)), shape, gradientCenter, gradientRadius);
  4756. };
  4757. var calculateGradientDirection = function calculateGradientDirection(radian, bounds) {
  4758. var width = bounds.width;
  4759. var height = bounds.height;
  4760. var HALF_WIDTH = width * 0.5;
  4761. var HALF_HEIGHT = height * 0.5;
  4762. var lineLength = Math.abs(width * Math.sin(radian)) + Math.abs(height * Math.cos(radian));
  4763. var HALF_LINE_LENGTH = lineLength / 2;
  4764. var x0 = HALF_WIDTH + Math.sin(radian) * HALF_LINE_LENGTH;
  4765. var y0 = HALF_HEIGHT - Math.cos(radian) * HALF_LINE_LENGTH;
  4766. var x1 = width - x0;
  4767. var y1 = height - y0;
  4768. return { x0: x0, x1: x1, y0: y0, y1: y1 };
  4769. };
  4770. var parseTopRight = function parseTopRight(bounds) {
  4771. return Math.acos(bounds.width / 2 / ((0, _Util.distance)(bounds.width, bounds.height) / 2));
  4772. };
  4773. var parseSideOrCorner = function parseSideOrCorner(side, bounds) {
  4774. switch (side) {
  4775. case 'bottom':
  4776. case 'to top':
  4777. return calculateGradientDirection(0, bounds);
  4778. case 'left':
  4779. case 'to right':
  4780. return calculateGradientDirection(Math.PI / 2, bounds);
  4781. case 'right':
  4782. case 'to left':
  4783. return calculateGradientDirection(3 * Math.PI / 2, bounds);
  4784. case 'top right':
  4785. case 'right top':
  4786. case 'to bottom left':
  4787. case 'to left bottom':
  4788. return calculateGradientDirection(Math.PI + parseTopRight(bounds), bounds);
  4789. case 'top left':
  4790. case 'left top':
  4791. case 'to bottom right':
  4792. case 'to right bottom':
  4793. return calculateGradientDirection(Math.PI - parseTopRight(bounds), bounds);
  4794. case 'bottom left':
  4795. case 'left bottom':
  4796. case 'to top right':
  4797. case 'to right top':
  4798. return calculateGradientDirection(parseTopRight(bounds), bounds);
  4799. case 'bottom right':
  4800. case 'right bottom':
  4801. case 'to top left':
  4802. case 'to left top':
  4803. return calculateGradientDirection(2 * Math.PI - parseTopRight(bounds), bounds);
  4804. case 'top':
  4805. case 'to bottom':
  4806. default:
  4807. return calculateGradientDirection(Math.PI, bounds);
  4808. }
  4809. };
  4810. var parsePercentageAngle = function parsePercentageAngle(angle, bounds) {
  4811. var _angle$split$map = angle.split(' ').map(parseFloat),
  4812. _angle$split$map2 = _slicedToArray(_angle$split$map, 2),
  4813. left = _angle$split$map2[0],
  4814. top = _angle$split$map2[1];
  4815. var ratio = left / 100 * bounds.width / (top / 100 * bounds.height);
  4816. return calculateGradientDirection(Math.atan(isNaN(ratio) ? 1 : ratio) + Math.PI / 2, bounds);
  4817. };
  4818. var findCorner = function findCorner(bounds, x, y, closest) {
  4819. var corners = [{ x: 0, y: 0 }, { x: 0, y: bounds.height }, { x: bounds.width, y: 0 }, { x: bounds.width, y: bounds.height }];
  4820. // $FlowFixMe
  4821. return corners.reduce(function (stat, corner) {
  4822. var d = (0, _Util.distance)(x - corner.x, y - corner.y);
  4823. if (closest ? d < stat.optimumDistance : d > stat.optimumDistance) {
  4824. return {
  4825. optimumCorner: corner,
  4826. optimumDistance: d
  4827. };
  4828. }
  4829. return stat;
  4830. }, {
  4831. optimumDistance: closest ? Infinity : -Infinity,
  4832. optimumCorner: null
  4833. }).optimumCorner;
  4834. };
  4835. var calculateRadius = function calculateRadius(extent, shape, center, radius, bounds) {
  4836. var x = center.x;
  4837. var y = center.y;
  4838. var rx = 0;
  4839. var ry = 0;
  4840. switch (extent) {
  4841. case 'closest-side':
  4842. // The ending shape is sized so that that it exactly meets the side of the gradient box closest to the gradient’s center.
  4843. // If the shape is an ellipse, it exactly meets the closest side in each dimension.
  4844. if (shape === RADIAL_GRADIENT_SHAPE.CIRCLE) {
  4845. rx = ry = Math.min(Math.abs(x), Math.abs(x - bounds.width), Math.abs(y), Math.abs(y - bounds.height));
  4846. } else if (shape === RADIAL_GRADIENT_SHAPE.ELLIPSE) {
  4847. rx = Math.min(Math.abs(x), Math.abs(x - bounds.width));
  4848. ry = Math.min(Math.abs(y), Math.abs(y - bounds.height));
  4849. }
  4850. break;
  4851. case 'closest-corner':
  4852. // The ending shape is sized so that that it passes through the corner of the gradient box closest to the gradient’s center.
  4853. // If the shape is an ellipse, the ending shape is given the same aspect-ratio it would have if closest-side were specified.
  4854. if (shape === RADIAL_GRADIENT_SHAPE.CIRCLE) {
  4855. rx = ry = Math.min((0, _Util.distance)(x, y), (0, _Util.distance)(x, y - bounds.height), (0, _Util.distance)(x - bounds.width, y), (0, _Util.distance)(x - bounds.width, y - bounds.height));
  4856. } else if (shape === RADIAL_GRADIENT_SHAPE.ELLIPSE) {
  4857. // Compute the ratio ry/rx (which is to be the same as for "closest-side")
  4858. var c = Math.min(Math.abs(y), Math.abs(y - bounds.height)) / Math.min(Math.abs(x), Math.abs(x - bounds.width));
  4859. var corner = findCorner(bounds, x, y, true);
  4860. rx = (0, _Util.distance)(corner.x - x, (corner.y - y) / c);
  4861. ry = c * rx;
  4862. }
  4863. break;
  4864. case 'farthest-side':
  4865. // Same as closest-side, except the ending shape is sized based on the farthest side(s)
  4866. if (shape === RADIAL_GRADIENT_SHAPE.CIRCLE) {
  4867. rx = ry = Math.max(Math.abs(x), Math.abs(x - bounds.width), Math.abs(y), Math.abs(y - bounds.height));
  4868. } else if (shape === RADIAL_GRADIENT_SHAPE.ELLIPSE) {
  4869. rx = Math.max(Math.abs(x), Math.abs(x - bounds.width));
  4870. ry = Math.max(Math.abs(y), Math.abs(y - bounds.height));
  4871. }
  4872. break;
  4873. case 'farthest-corner':
  4874. // Same as closest-corner, except the ending shape is sized based on the farthest corner.
  4875. // If the shape is an ellipse, the ending shape is given the same aspect ratio it would have if farthest-side were specified.
  4876. if (shape === RADIAL_GRADIENT_SHAPE.CIRCLE) {
  4877. rx = ry = Math.max((0, _Util.distance)(x, y), (0, _Util.distance)(x, y - bounds.height), (0, _Util.distance)(x - bounds.width, y), (0, _Util.distance)(x - bounds.width, y - bounds.height));
  4878. } else if (shape === RADIAL_GRADIENT_SHAPE.ELLIPSE) {
  4879. // Compute the ratio ry/rx (which is to be the same as for "farthest-side")
  4880. var _c = Math.max(Math.abs(y), Math.abs(y - bounds.height)) / Math.max(Math.abs(x), Math.abs(x - bounds.width));
  4881. var _corner = findCorner(bounds, x, y, false);
  4882. rx = (0, _Util.distance)(_corner.x - x, (_corner.y - y) / _c);
  4883. ry = _c * rx;
  4884. }
  4885. break;
  4886. default:
  4887. // pixel or percentage values
  4888. rx = radius.x || 0;
  4889. ry = radius.y !== undefined ? radius.y : rx;
  4890. break;
  4891. }
  4892. return {
  4893. x: rx,
  4894. y: ry
  4895. };
  4896. };
  4897. var transformWebkitRadialGradientArgs = exports.transformWebkitRadialGradientArgs = function transformWebkitRadialGradientArgs(args) {
  4898. var shape = '';
  4899. var radius = '';
  4900. var extent = '';
  4901. var position = '';
  4902. var idx = 0;
  4903. var POSITION = /^(left|center|right|\d+(?:px|r?em|%)?)(?:\s+(top|center|bottom|\d+(?:px|r?em|%)?))?$/i;
  4904. var SHAPE_AND_EXTENT = /^(circle|ellipse)?\s*(closest-side|closest-corner|farthest-side|farthest-corner|contain|cover)?$/i;
  4905. var RADIUS = /^\d+(px|r?em|%)?(?:\s+\d+(px|r?em|%)?)?$/i;
  4906. var matchStartPosition = args[idx].match(POSITION);
  4907. if (matchStartPosition) {
  4908. idx++;
  4909. }
  4910. var matchShapeExtent = args[idx].match(SHAPE_AND_EXTENT);
  4911. if (matchShapeExtent) {
  4912. shape = matchShapeExtent[1] || '';
  4913. extent = matchShapeExtent[2] || '';
  4914. if (extent === 'contain') {
  4915. extent = 'closest-side';
  4916. } else if (extent === 'cover') {
  4917. extent = 'farthest-corner';
  4918. }
  4919. idx++;
  4920. }
  4921. var matchStartRadius = args[idx].match(RADIUS);
  4922. if (matchStartRadius) {
  4923. idx++;
  4924. }
  4925. var matchEndPosition = args[idx].match(POSITION);
  4926. if (matchEndPosition) {
  4927. idx++;
  4928. }
  4929. var matchEndRadius = args[idx].match(RADIUS);
  4930. if (matchEndRadius) {
  4931. idx++;
  4932. }
  4933. var matchPosition = matchEndPosition || matchStartPosition;
  4934. if (matchPosition && matchPosition[1]) {
  4935. position = matchPosition[1] + (/^\d+$/.test(matchPosition[1]) ? 'px' : '');
  4936. if (matchPosition[2]) {
  4937. position += ' ' + matchPosition[2] + (/^\d+$/.test(matchPosition[2]) ? 'px' : '');
  4938. }
  4939. }
  4940. var matchRadius = matchEndRadius || matchStartRadius;
  4941. if (matchRadius) {
  4942. radius = matchRadius[0];
  4943. if (!matchRadius[1]) {
  4944. radius += 'px';
  4945. }
  4946. }
  4947. if (position && !shape && !radius && !extent) {
  4948. radius = position;
  4949. position = '';
  4950. }
  4951. if (position) {
  4952. position = 'at ' + position;
  4953. }
  4954. return [[shape, extent, radius, position].filter(function (s) {
  4955. return !!s;
  4956. }).join(' ')].concat(args.slice(idx));
  4957. };
  4958. var transformObsoleteColorStops = function transformObsoleteColorStops(args) {
  4959. return args.map(function (color) {
  4960. return color.match(FROM_TO_COLORSTOP);
  4961. })
  4962. // $FlowFixMe
  4963. .map(function (v, index) {
  4964. if (!v) {
  4965. return args[index];
  4966. }
  4967. switch (v[1]) {
  4968. case 'from':
  4969. return v[4] + ' 0%';
  4970. case 'to':
  4971. return v[4] + ' 100%';
  4972. case 'color-stop':
  4973. if (v[3] === '%') {
  4974. return v[4] + ' ' + v[2];
  4975. }
  4976. return v[4] + ' ' + parseFloat(v[2]) * 100 + '%';
  4977. }
  4978. });
  4979. };
  4980. /***/ }),
  4981. /* 53 */
  4982. /***/ (function(module, exports, __webpack_require__) {
  4983. "use strict";
  4984. Object.defineProperty(exports, "__esModule", {
  4985. value: true
  4986. });
  4987. var ANGLE = /([+-]?\d*\.?\d+)(deg|grad|rad|turn)/i;
  4988. var parseAngle = exports.parseAngle = function parseAngle(angle) {
  4989. var match = angle.match(ANGLE);
  4990. if (match) {
  4991. var value = parseFloat(match[1]);
  4992. switch (match[2].toLowerCase()) {
  4993. case 'deg':
  4994. return Math.PI * value / 180;
  4995. case 'grad':
  4996. return Math.PI / 200 * value;
  4997. case 'rad':
  4998. return value;
  4999. case 'turn':
  5000. return Math.PI * 2 * value;
  5001. }
  5002. }
  5003. return null;
  5004. };
  5005. /***/ }),
  5006. /* 54 */
  5007. /***/ (function(module, exports, __webpack_require__) {
  5008. "use strict";
  5009. Object.defineProperty(exports, "__esModule", {
  5010. value: true
  5011. });
  5012. exports.cloneWindow = exports.DocumentCloner = undefined;
  5013. var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
  5014. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  5015. var _Bounds = __webpack_require__(1);
  5016. var _Proxy = __webpack_require__(26);
  5017. var _ResourceLoader = __webpack_require__(55);
  5018. var _ResourceLoader2 = _interopRequireDefault(_ResourceLoader);
  5019. var _Util = __webpack_require__(4);
  5020. var _background = __webpack_require__(5);
  5021. var _CanvasRenderer = __webpack_require__(15);
  5022. var _CanvasRenderer2 = _interopRequireDefault(_CanvasRenderer);
  5023. var _PseudoNodeContent = __webpack_require__(56);
  5024. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  5025. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  5026. var IGNORE_ATTRIBUTE = 'data-html2canvas-ignore';
  5027. var DocumentCloner = exports.DocumentCloner = function () {
  5028. function DocumentCloner(element, options, logger, copyInline, renderer) {
  5029. _classCallCheck(this, DocumentCloner);
  5030. this.referenceElement = element;
  5031. this.scrolledElements = [];
  5032. this.copyStyles = copyInline;
  5033. this.inlineImages = copyInline;
  5034. this.logger = logger;
  5035. this.options = options;
  5036. this.renderer = renderer;
  5037. this.resourceLoader = new _ResourceLoader2.default(options, logger, window);
  5038. this.pseudoContentData = {
  5039. counters: {},
  5040. quoteDepth: 0
  5041. };
  5042. // $FlowFixMe
  5043. this.documentElement = this.cloneNode(element.ownerDocument.documentElement);
  5044. }
  5045. _createClass(DocumentCloner, [{
  5046. key: 'inlineAllImages',
  5047. value: function inlineAllImages(node) {
  5048. var _this = this;
  5049. if (this.inlineImages && node) {
  5050. var style = node.style;
  5051. Promise.all((0, _background.parseBackgroundImage)(style.backgroundImage).map(function (backgroundImage) {
  5052. if (backgroundImage.method === 'url') {
  5053. return _this.resourceLoader.inlineImage(backgroundImage.args[0]).then(function (img) {
  5054. return img && typeof img.src === 'string' ? 'url("' + img.src + '")' : 'none';
  5055. }).catch(function (e) {
  5056. if (true) {
  5057. _this.logger.log('Unable to load image', e);
  5058. }
  5059. });
  5060. }
  5061. return Promise.resolve('' + backgroundImage.prefix + backgroundImage.method + '(' + backgroundImage.args.join(',') + ')');
  5062. })).then(function (backgroundImages) {
  5063. if (backgroundImages.length > 1) {
  5064. // TODO Multiple backgrounds somehow broken in Chrome
  5065. style.backgroundColor = '';
  5066. }
  5067. style.backgroundImage = backgroundImages.join(',');
  5068. });
  5069. if (node instanceof HTMLImageElement) {
  5070. this.resourceLoader.inlineImage(node.src).then(function (img) {
  5071. if (img && node instanceof HTMLImageElement && node.parentNode) {
  5072. var parentNode = node.parentNode;
  5073. var clonedChild = (0, _Util.copyCSSStyles)(node.style, img.cloneNode(false));
  5074. parentNode.replaceChild(clonedChild, node);
  5075. }
  5076. }).catch(function (e) {
  5077. if (true) {
  5078. _this.logger.log('Unable to load image', e);
  5079. }
  5080. });
  5081. }
  5082. }
  5083. }
  5084. }, {
  5085. key: 'inlineFonts',
  5086. value: function inlineFonts(document) {
  5087. var _this2 = this;
  5088. return Promise.all(Array.from(document.styleSheets).map(function (sheet) {
  5089. if (sheet.href) {
  5090. return fetch(sheet.href).then(function (res) {
  5091. return res.text();
  5092. }).then(function (text) {
  5093. return createStyleSheetFontsFromText(text, sheet.href);
  5094. }).catch(function (e) {
  5095. if (true) {
  5096. _this2.logger.log('Unable to load stylesheet', e);
  5097. }
  5098. return [];
  5099. });
  5100. }
  5101. return getSheetFonts(sheet, document);
  5102. })).then(function (fonts) {
  5103. return fonts.reduce(function (acc, font) {
  5104. return acc.concat(font);
  5105. }, []);
  5106. }).then(function (fonts) {
  5107. return Promise.all(fonts.map(function (font) {
  5108. return fetch(font.formats[0].src).then(function (response) {
  5109. return response.blob();
  5110. }).then(function (blob) {
  5111. return new Promise(function (resolve, reject) {
  5112. var reader = new FileReader();
  5113. reader.onerror = reject;
  5114. reader.onload = function () {
  5115. // $FlowFixMe
  5116. var result = reader.result;
  5117. resolve(result);
  5118. };
  5119. reader.readAsDataURL(blob);
  5120. });
  5121. }).then(function (dataUri) {
  5122. font.fontFace.setProperty('src', 'url("' + dataUri + '")');
  5123. return '@font-face {' + font.fontFace.cssText + ' ';
  5124. });
  5125. }));
  5126. }).then(function (fontCss) {
  5127. var style = document.createElement('style');
  5128. style.textContent = fontCss.join('\n');
  5129. _this2.documentElement.appendChild(style);
  5130. });
  5131. }
  5132. }, {
  5133. key: 'createElementClone',
  5134. value: function createElementClone(node) {
  5135. var _this3 = this;
  5136. if (this.copyStyles && node instanceof HTMLCanvasElement) {
  5137. var img = node.ownerDocument.createElement('img');
  5138. try {
  5139. img.src = node.toDataURL();
  5140. return img;
  5141. } catch (e) {
  5142. if (true) {
  5143. this.logger.log('Unable to clone canvas contents, canvas is tainted');
  5144. }
  5145. }
  5146. }
  5147. if (node instanceof HTMLIFrameElement) {
  5148. var tempIframe = node.cloneNode(false);
  5149. var iframeKey = generateIframeKey();
  5150. tempIframe.setAttribute('data-html2canvas-internal-iframe-key', iframeKey);
  5151. var _parseBounds = (0, _Bounds.parseBounds)(node, 0, 0),
  5152. width = _parseBounds.width,
  5153. height = _parseBounds.height;
  5154. this.resourceLoader.cache[iframeKey] = getIframeDocumentElement(node, this.options).then(function (documentElement) {
  5155. return _this3.renderer(documentElement, {
  5156. async: _this3.options.async,
  5157. allowTaint: _this3.options.allowTaint,
  5158. backgroundColor: '#ffffff',
  5159. canvas: null,
  5160. imageTimeout: _this3.options.imageTimeout,
  5161. logging: _this3.options.logging,
  5162. proxy: _this3.options.proxy,
  5163. removeContainer: _this3.options.removeContainer,
  5164. scale: _this3.options.scale,
  5165. foreignObjectRendering: _this3.options.foreignObjectRendering,
  5166. useCORS: _this3.options.useCORS,
  5167. target: new _CanvasRenderer2.default(),
  5168. width: width,
  5169. height: height,
  5170. x: 0,
  5171. y: 0,
  5172. windowWidth: documentElement.ownerDocument.defaultView.innerWidth,
  5173. windowHeight: documentElement.ownerDocument.defaultView.innerHeight,
  5174. scrollX: documentElement.ownerDocument.defaultView.pageXOffset,
  5175. scrollY: documentElement.ownerDocument.defaultView.pageYOffset
  5176. }, _this3.logger.child(iframeKey));
  5177. }).then(function (canvas) {
  5178. return new Promise(function (resolve, reject) {
  5179. var iframeCanvas = document.createElement('img');
  5180. iframeCanvas.onload = function () {
  5181. return resolve(canvas);
  5182. };
  5183. iframeCanvas.onerror = reject;
  5184. iframeCanvas.src = canvas.toDataURL();
  5185. if (tempIframe.parentNode) {
  5186. tempIframe.parentNode.replaceChild((0, _Util.copyCSSStyles)(node.ownerDocument.defaultView.getComputedStyle(node), iframeCanvas), tempIframe);
  5187. }
  5188. });
  5189. });
  5190. return tempIframe;
  5191. }
  5192. if (node instanceof HTMLStyleElement && node.sheet && node.sheet.cssRules) {
  5193. var css = [].slice.call(node.sheet.cssRules, 0).reduce(function (css, rule) {
  5194. return css + rule.cssText;
  5195. }, '');
  5196. var style = node.cloneNode(false);
  5197. style.textContent = css;
  5198. return style;
  5199. }
  5200. return node.cloneNode(false);
  5201. }
  5202. }, {
  5203. key: 'cloneNode',
  5204. value: function cloneNode(node) {
  5205. var clone = node.nodeType === Node.TEXT_NODE ? document.createTextNode(node.nodeValue) : this.createElementClone(node);
  5206. var window = node.ownerDocument.defaultView;
  5207. var style = node instanceof window.HTMLElement ? window.getComputedStyle(node) : null;
  5208. var styleBefore = node instanceof window.HTMLElement ? window.getComputedStyle(node, ':before') : null;
  5209. var styleAfter = node instanceof window.HTMLElement ? window.getComputedStyle(node, ':after') : null;
  5210. if (this.referenceElement === node && clone instanceof window.HTMLElement) {
  5211. this.clonedReferenceElement = clone;
  5212. }
  5213. if (clone instanceof window.HTMLBodyElement) {
  5214. createPseudoHideStyles(clone);
  5215. }
  5216. var counters = (0, _PseudoNodeContent.parseCounterReset)(style, this.pseudoContentData);
  5217. var contentBefore = (0, _PseudoNodeContent.resolvePseudoContent)(node, styleBefore, this.pseudoContentData);
  5218. for (var child = node.firstChild; child; child = child.nextSibling) {
  5219. if (child.nodeType !== Node.ELEMENT_NODE || child.nodeName !== 'SCRIPT' &&
  5220. // $FlowFixMe
  5221. !child.hasAttribute(IGNORE_ATTRIBUTE) && (typeof this.options.ignoreElements !== 'function' ||
  5222. // $FlowFixMe
  5223. !this.options.ignoreElements(child))) {
  5224. if (!this.copyStyles || child.nodeName !== 'STYLE') {
  5225. clone.appendChild(this.cloneNode(child));
  5226. }
  5227. }
  5228. }
  5229. var contentAfter = (0, _PseudoNodeContent.resolvePseudoContent)(node, styleAfter, this.pseudoContentData);
  5230. (0, _PseudoNodeContent.popCounters)(counters, this.pseudoContentData);
  5231. if (node instanceof window.HTMLElement && clone instanceof window.HTMLElement) {
  5232. if (styleBefore) {
  5233. this.inlineAllImages(inlinePseudoElement(node, clone, styleBefore, contentBefore, PSEUDO_BEFORE));
  5234. }
  5235. if (styleAfter) {
  5236. this.inlineAllImages(inlinePseudoElement(node, clone, styleAfter, contentAfter, PSEUDO_AFTER));
  5237. }
  5238. if (style && this.copyStyles && !(node instanceof HTMLIFrameElement)) {
  5239. (0, _Util.copyCSSStyles)(style, clone);
  5240. }
  5241. this.inlineAllImages(clone);
  5242. if (node.scrollTop !== 0 || node.scrollLeft !== 0) {
  5243. this.scrolledElements.push([clone, node.scrollLeft, node.scrollTop]);
  5244. }
  5245. switch (node.nodeName) {
  5246. case 'CANVAS':
  5247. if (!this.copyStyles) {
  5248. cloneCanvasContents(node, clone);
  5249. }
  5250. break;
  5251. case 'TEXTAREA':
  5252. case 'SELECT':
  5253. clone.value = node.value;
  5254. break;
  5255. }
  5256. }
  5257. return clone;
  5258. }
  5259. }]);
  5260. return DocumentCloner;
  5261. }();
  5262. var getSheetFonts = function getSheetFonts(sheet, document) {
  5263. // $FlowFixMe
  5264. return (sheet.cssRules ? Array.from(sheet.cssRules) : []).filter(function (rule) {
  5265. return rule.type === CSSRule.FONT_FACE_RULE;
  5266. }).map(function (rule) {
  5267. var src = (0, _background.parseBackgroundImage)(rule.style.getPropertyValue('src'));
  5268. var formats = [];
  5269. for (var i = 0; i < src.length; i++) {
  5270. if (src[i].method === 'url' && src[i + 1] && src[i + 1].method === 'format') {
  5271. var a = document.createElement('a');
  5272. a.href = src[i].args[0];
  5273. if (document.body) {
  5274. document.body.appendChild(a);
  5275. }
  5276. var font = {
  5277. src: a.href,
  5278. format: src[i + 1].args[0]
  5279. };
  5280. formats.push(font);
  5281. }
  5282. }
  5283. return {
  5284. // TODO select correct format for browser),
  5285. formats: formats.filter(function (font) {
  5286. return (/^woff/i.test(font.format)
  5287. );
  5288. }),
  5289. fontFace: rule.style
  5290. };
  5291. }).filter(function (font) {
  5292. return font.formats.length;
  5293. });
  5294. };
  5295. var createStyleSheetFontsFromText = function createStyleSheetFontsFromText(text, baseHref) {
  5296. var doc = document.implementation.createHTMLDocument('');
  5297. var base = document.createElement('base');
  5298. // $FlowFixMe
  5299. base.href = baseHref;
  5300. var style = document.createElement('style');
  5301. style.textContent = text;
  5302. if (doc.head) {
  5303. doc.head.appendChild(base);
  5304. }
  5305. if (doc.body) {
  5306. doc.body.appendChild(style);
  5307. }
  5308. return style.sheet ? getSheetFonts(style.sheet, doc) : [];
  5309. };
  5310. var restoreOwnerScroll = function restoreOwnerScroll(ownerDocument, x, y) {
  5311. if (ownerDocument.defaultView && (x !== ownerDocument.defaultView.pageXOffset || y !== ownerDocument.defaultView.pageYOffset)) {
  5312. ownerDocument.defaultView.scrollTo(x, y);
  5313. }
  5314. };
  5315. var cloneCanvasContents = function cloneCanvasContents(canvas, clonedCanvas) {
  5316. try {
  5317. if (clonedCanvas) {
  5318. clonedCanvas.width = canvas.width;
  5319. clonedCanvas.height = canvas.height;
  5320. var ctx = canvas.getContext('2d');
  5321. var clonedCtx = clonedCanvas.getContext('2d');
  5322. if (ctx) {
  5323. clonedCtx.putImageData(ctx.getImageData(0, 0, canvas.width, canvas.height), 0, 0);
  5324. } else {
  5325. clonedCtx.drawImage(canvas, 0, 0);
  5326. }
  5327. }
  5328. } catch (e) {}
  5329. };
  5330. var inlinePseudoElement = function inlinePseudoElement(node, clone, style, contentItems, pseudoElt) {
  5331. if (!style || !style.content || style.content === 'none' || style.content === '-moz-alt-content' || style.display === 'none') {
  5332. return;
  5333. }
  5334. var anonymousReplacedElement = clone.ownerDocument.createElement('html2canvaspseudoelement');
  5335. (0, _Util.copyCSSStyles)(style, anonymousReplacedElement);
  5336. if (contentItems) {
  5337. var len = contentItems.length;
  5338. for (var i = 0; i < len; i++) {
  5339. var item = contentItems[i];
  5340. switch (item.type) {
  5341. case _PseudoNodeContent.PSEUDO_CONTENT_ITEM_TYPE.IMAGE:
  5342. var img = clone.ownerDocument.createElement('img');
  5343. img.src = (0, _background.parseBackgroundImage)('url(' + item.value + ')')[0].args[0];
  5344. img.style.opacity = '1';
  5345. anonymousReplacedElement.appendChild(img);
  5346. break;
  5347. case _PseudoNodeContent.PSEUDO_CONTENT_ITEM_TYPE.TEXT:
  5348. anonymousReplacedElement.appendChild(clone.ownerDocument.createTextNode(item.value));
  5349. break;
  5350. }
  5351. }
  5352. }
  5353. anonymousReplacedElement.className = PSEUDO_HIDE_ELEMENT_CLASS_BEFORE + ' ' + PSEUDO_HIDE_ELEMENT_CLASS_AFTER;
  5354. clone.className += pseudoElt === PSEUDO_BEFORE ? ' ' + PSEUDO_HIDE_ELEMENT_CLASS_BEFORE : ' ' + PSEUDO_HIDE_ELEMENT_CLASS_AFTER;
  5355. if (pseudoElt === PSEUDO_BEFORE) {
  5356. clone.insertBefore(anonymousReplacedElement, clone.firstChild);
  5357. } else {
  5358. clone.appendChild(anonymousReplacedElement);
  5359. }
  5360. return anonymousReplacedElement;
  5361. };
  5362. var URL_REGEXP = /^url\((.+)\)$/i;
  5363. var PSEUDO_BEFORE = ':before';
  5364. var PSEUDO_AFTER = ':after';
  5365. var PSEUDO_HIDE_ELEMENT_CLASS_BEFORE = '___html2canvas___pseudoelement_before';
  5366. var PSEUDO_HIDE_ELEMENT_CLASS_AFTER = '___html2canvas___pseudoelement_after';
  5367. var PSEUDO_HIDE_ELEMENT_STYLE = '{\n content: "" !important;\n display: none !important;\n}';
  5368. var createPseudoHideStyles = function createPseudoHideStyles(body) {
  5369. createStyles(body, '.' + PSEUDO_HIDE_ELEMENT_CLASS_BEFORE + PSEUDO_BEFORE + PSEUDO_HIDE_ELEMENT_STYLE + '\n .' + PSEUDO_HIDE_ELEMENT_CLASS_AFTER + PSEUDO_AFTER + PSEUDO_HIDE_ELEMENT_STYLE);
  5370. };
  5371. var createStyles = function createStyles(body, styles) {
  5372. var style = body.ownerDocument.createElement('style');
  5373. style.innerHTML = styles;
  5374. body.appendChild(style);
  5375. };
  5376. var initNode = function initNode(_ref) {
  5377. var _ref2 = _slicedToArray(_ref, 3),
  5378. element = _ref2[0],
  5379. x = _ref2[1],
  5380. y = _ref2[2];
  5381. element.scrollLeft = x;
  5382. element.scrollTop = y;
  5383. };
  5384. var generateIframeKey = function generateIframeKey() {
  5385. return Math.ceil(Date.now() + Math.random() * 10000000).toString(16);
  5386. };
  5387. var DATA_URI_REGEXP = /^data:text\/(.+);(base64)?,(.*)$/i;
  5388. var getIframeDocumentElement = function getIframeDocumentElement(node, options) {
  5389. try {
  5390. return Promise.resolve(node.contentWindow.document.documentElement);
  5391. } catch (e) {
  5392. return options.proxy ? (0, _Proxy.Proxy)(node.src, options).then(function (html) {
  5393. var match = html.match(DATA_URI_REGEXP);
  5394. if (!match) {
  5395. return Promise.reject();
  5396. }
  5397. return match[2] === 'base64' ? window.atob(decodeURIComponent(match[3])) : decodeURIComponent(match[3]);
  5398. }).then(function (html) {
  5399. return createIframeContainer(node.ownerDocument, (0, _Bounds.parseBounds)(node, 0, 0)).then(function (cloneIframeContainer) {
  5400. var cloneWindow = cloneIframeContainer.contentWindow;
  5401. var documentClone = cloneWindow.document;
  5402. documentClone.open();
  5403. documentClone.write(html);
  5404. var iframeLoad = iframeLoader(cloneIframeContainer).then(function () {
  5405. return documentClone.documentElement;
  5406. });
  5407. documentClone.close();
  5408. return iframeLoad;
  5409. });
  5410. }) : Promise.reject();
  5411. }
  5412. };
  5413. var createIframeContainer = function createIframeContainer(ownerDocument, bounds) {
  5414. var cloneIframeContainer = ownerDocument.createElement('iframe');
  5415. cloneIframeContainer.className = 'html2canvas-container';
  5416. cloneIframeContainer.style.visibility = 'hidden';
  5417. cloneIframeContainer.style.position = 'fixed';
  5418. cloneIframeContainer.style.left = '-10000px';
  5419. cloneIframeContainer.style.top = '0px';
  5420. cloneIframeContainer.style.border = '0';
  5421. cloneIframeContainer.width = bounds.width.toString();
  5422. cloneIframeContainer.height = bounds.height.toString();
  5423. cloneIframeContainer.scrolling = 'no'; // ios won't scroll without it
  5424. cloneIframeContainer.setAttribute(IGNORE_ATTRIBUTE, 'true');
  5425. if (!ownerDocument.body) {
  5426. return Promise.reject( true ? 'Body element not found in Document that is getting rendered' : '');
  5427. }
  5428. ownerDocument.body.appendChild(cloneIframeContainer);
  5429. return Promise.resolve(cloneIframeContainer);
  5430. };
  5431. var iframeLoader = function iframeLoader(cloneIframeContainer) {
  5432. var cloneWindow = cloneIframeContainer.contentWindow;
  5433. var documentClone = cloneWindow.document;
  5434. return new Promise(function (resolve, reject) {
  5435. cloneWindow.onload = cloneIframeContainer.onload = documentClone.onreadystatechange = function () {
  5436. var interval = setInterval(function () {
  5437. if (documentClone.body.childNodes.length > 0 && documentClone.readyState === 'complete') {
  5438. clearInterval(interval);
  5439. resolve(cloneIframeContainer);
  5440. }
  5441. }, 50);
  5442. };
  5443. });
  5444. };
  5445. var cloneWindow = exports.cloneWindow = function cloneWindow(ownerDocument, bounds, referenceElement, options, logger, renderer) {
  5446. var cloner = new DocumentCloner(referenceElement, options, logger, false, renderer);
  5447. var scrollX = ownerDocument.defaultView.pageXOffset;
  5448. var scrollY = ownerDocument.defaultView.pageYOffset;
  5449. return createIframeContainer(ownerDocument, bounds).then(function (cloneIframeContainer) {
  5450. var cloneWindow = cloneIframeContainer.contentWindow;
  5451. var documentClone = cloneWindow.document;
  5452. /* Chrome doesn't detect relative background-images assigned in inline <style> sheets when fetched through getComputedStyle
  5453. if window url is about:blank, we can assign the url to current by writing onto the document
  5454. */
  5455. var iframeLoad = iframeLoader(cloneIframeContainer).then(function () {
  5456. cloner.scrolledElements.forEach(initNode);
  5457. cloneWindow.scrollTo(bounds.left, bounds.top);
  5458. if (/(iPad|iPhone|iPod)/g.test(navigator.userAgent) && (cloneWindow.scrollY !== bounds.top || cloneWindow.scrollX !== bounds.left)) {
  5459. documentClone.documentElement.style.top = -bounds.top + 'px';
  5460. documentClone.documentElement.style.left = -bounds.left + 'px';
  5461. documentClone.documentElement.style.position = 'absolute';
  5462. }
  5463. var result = Promise.resolve([cloneIframeContainer, cloner.clonedReferenceElement, cloner.resourceLoader]);
  5464. var onclone = options.onclone;
  5465. return cloner.clonedReferenceElement instanceof cloneWindow.HTMLElement || cloner.clonedReferenceElement instanceof ownerDocument.defaultView.HTMLElement || cloner.clonedReferenceElement instanceof HTMLElement ? typeof onclone === 'function' ? Promise.resolve().then(function () {
  5466. return onclone(documentClone);
  5467. }).then(function () {
  5468. return result;
  5469. }) : result : Promise.reject( true ? 'Error finding the ' + referenceElement.nodeName + ' in the cloned document' : '');
  5470. });
  5471. documentClone.open();
  5472. documentClone.write(serializeDoctype(document.doctype) + '<html></html>');
  5473. // Chrome scrolls the parent document for some reason after the write to the cloned window???
  5474. restoreOwnerScroll(referenceElement.ownerDocument, scrollX, scrollY);
  5475. documentClone.replaceChild(documentClone.adoptNode(cloner.documentElement), documentClone.documentElement);
  5476. documentClone.close();
  5477. return iframeLoad;
  5478. });
  5479. };
  5480. var serializeDoctype = function serializeDoctype(doctype) {
  5481. var str = '';
  5482. if (doctype) {
  5483. str += '<!DOCTYPE ';
  5484. if (doctype.name) {
  5485. str += doctype.name;
  5486. }
  5487. if (doctype.internalSubset) {
  5488. str += doctype.internalSubset;
  5489. }
  5490. if (doctype.publicId) {
  5491. str += '"' + doctype.publicId + '"';
  5492. }
  5493. if (doctype.systemId) {
  5494. str += '"' + doctype.systemId + '"';
  5495. }
  5496. str += '>';
  5497. }
  5498. return str;
  5499. };
  5500. /***/ }),
  5501. /* 55 */
  5502. /***/ (function(module, exports, __webpack_require__) {
  5503. "use strict";
  5504. Object.defineProperty(exports, "__esModule", {
  5505. value: true
  5506. });
  5507. exports.ResourceStore = undefined;
  5508. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  5509. var _Feature = __webpack_require__(10);
  5510. var _Feature2 = _interopRequireDefault(_Feature);
  5511. var _Proxy = __webpack_require__(26);
  5512. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  5513. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  5514. var ResourceLoader = function () {
  5515. function ResourceLoader(options, logger, window) {
  5516. _classCallCheck(this, ResourceLoader);
  5517. this.options = options;
  5518. this._window = window;
  5519. this.origin = this.getOrigin(window.location.href);
  5520. this.cache = {};
  5521. this.logger = logger;
  5522. this._index = 0;
  5523. }
  5524. _createClass(ResourceLoader, [{
  5525. key: 'loadImage',
  5526. value: function loadImage(src) {
  5527. var _this = this;
  5528. if (this.hasResourceInCache(src)) {
  5529. return src;
  5530. }
  5531. if (!isSVG(src) || _Feature2.default.SUPPORT_SVG_DRAWING) {
  5532. if (this.options.allowTaint === true || isInlineImage(src) || this.isSameOrigin(src)) {
  5533. return this.addImage(src, src, false);
  5534. } else if (!this.isSameOrigin(src)) {
  5535. if (typeof this.options.proxy === 'string') {
  5536. this.cache[src] = (0, _Proxy.Proxy)(src, this.options).then(function (src) {
  5537. return _loadImage(src, _this.options.imageTimeout || 0);
  5538. });
  5539. return src;
  5540. } else if (this.options.useCORS === true && _Feature2.default.SUPPORT_CORS_IMAGES) {
  5541. return this.addImage(src, src, true);
  5542. }
  5543. }
  5544. }
  5545. }
  5546. }, {
  5547. key: 'inlineImage',
  5548. value: function inlineImage(src) {
  5549. var _this2 = this;
  5550. if (isInlineImage(src)) {
  5551. return _loadImage(src, this.options.imageTimeout || 0);
  5552. }
  5553. if (this.hasResourceInCache(src)) {
  5554. return this.cache[src];
  5555. }
  5556. if (!this.isSameOrigin(src) && typeof this.options.proxy === 'string') {
  5557. return this.cache[src] = (0, _Proxy.Proxy)(src, this.options).then(function (src) {
  5558. return _loadImage(src, _this2.options.imageTimeout || 0);
  5559. });
  5560. }
  5561. return this.xhrImage(src);
  5562. }
  5563. }, {
  5564. key: 'xhrImage',
  5565. value: function xhrImage(src) {
  5566. var _this3 = this;
  5567. this.cache[src] = new Promise(function (resolve, reject) {
  5568. var xhr = new XMLHttpRequest();
  5569. xhr.onreadystatechange = function () {
  5570. if (xhr.readyState === 4) {
  5571. if (xhr.status !== 200) {
  5572. reject('Failed to fetch image ' + src.substring(0, 256) + ' with status code ' + xhr.status);
  5573. } else {
  5574. var reader = new FileReader();
  5575. reader.addEventListener('load', function () {
  5576. // $FlowFixMe
  5577. var result = reader.result;
  5578. resolve(result);
  5579. }, false);
  5580. reader.addEventListener('error', function (e) {
  5581. return reject(e);
  5582. }, false);
  5583. reader.readAsDataURL(xhr.response);
  5584. }
  5585. }
  5586. };
  5587. xhr.responseType = 'blob';
  5588. if (_this3.options.imageTimeout) {
  5589. var timeout = _this3.options.imageTimeout;
  5590. xhr.timeout = timeout;
  5591. xhr.ontimeout = function () {
  5592. return reject( true ? 'Timed out (' + timeout + 'ms) fetching ' + src.substring(0, 256) : '');
  5593. };
  5594. }
  5595. xhr.open('GET', src, true);
  5596. xhr.send();
  5597. }).then(function (src) {
  5598. return _loadImage(src, _this3.options.imageTimeout || 0);
  5599. });
  5600. return this.cache[src];
  5601. }
  5602. }, {
  5603. key: 'loadCanvas',
  5604. value: function loadCanvas(node) {
  5605. var key = String(this._index++);
  5606. this.cache[key] = Promise.resolve(node);
  5607. return key;
  5608. }
  5609. }, {
  5610. key: 'hasResourceInCache',
  5611. value: function hasResourceInCache(key) {
  5612. return typeof this.cache[key] !== 'undefined';
  5613. }
  5614. }, {
  5615. key: 'addImage',
  5616. value: function addImage(key, src, useCORS) {
  5617. var _this4 = this;
  5618. if (true) {
  5619. this.logger.log('Added image ' + key.substring(0, 256));
  5620. }
  5621. var imageLoadHandler = function imageLoadHandler(supportsDataImages) {
  5622. return new Promise(function (resolve, reject) {
  5623. var img = new Image();
  5624. img.onload = function () {
  5625. return resolve(img);
  5626. };
  5627. //ios safari 10.3 taints canvas with data urls unless crossOrigin is set to anonymous
  5628. if (!supportsDataImages || useCORS) {
  5629. img.crossOrigin = 'anonymous';
  5630. }
  5631. img.onerror = reject;
  5632. img.src = src;
  5633. if (img.complete === true) {
  5634. // Inline XML images may fail to parse, throwing an Error later on
  5635. setTimeout(function () {
  5636. resolve(img);
  5637. }, 500);
  5638. }
  5639. if (_this4.options.imageTimeout) {
  5640. var timeout = _this4.options.imageTimeout;
  5641. setTimeout(function () {
  5642. return reject( true ? 'Timed out (' + timeout + 'ms) fetching ' + src.substring(0, 256) : '');
  5643. }, timeout);
  5644. }
  5645. });
  5646. };
  5647. this.cache[key] = isInlineBase64Image(src) && !isSVG(src) ? // $FlowFixMe
  5648. _Feature2.default.SUPPORT_BASE64_DRAWING(src).then(imageLoadHandler) : imageLoadHandler(true);
  5649. return key;
  5650. }
  5651. }, {
  5652. key: 'isSameOrigin',
  5653. value: function isSameOrigin(url) {
  5654. return this.getOrigin(url) === this.origin;
  5655. }
  5656. }, {
  5657. key: 'getOrigin',
  5658. value: function getOrigin(url) {
  5659. var link = this._link || (this._link = this._window.document.createElement('a'));
  5660. link.href = url;
  5661. link.href = link.href; // IE9, LOL! - http://jsfiddle.net/niklasvh/2e48b/
  5662. return link.protocol + link.hostname + link.port;
  5663. }
  5664. }, {
  5665. key: 'ready',
  5666. value: function ready() {
  5667. var _this5 = this;
  5668. var keys = Object.keys(this.cache);
  5669. var values = keys.map(function (str) {
  5670. return _this5.cache[str].catch(function (e) {
  5671. if (true) {
  5672. _this5.logger.log('Unable to load image', e);
  5673. }
  5674. return null;
  5675. });
  5676. });
  5677. return Promise.all(values).then(function (images) {
  5678. if (true) {
  5679. _this5.logger.log('Finished loading ' + images.length + ' images', images);
  5680. }
  5681. return new ResourceStore(keys, images);
  5682. });
  5683. }
  5684. }]);
  5685. return ResourceLoader;
  5686. }();
  5687. exports.default = ResourceLoader;
  5688. var ResourceStore = exports.ResourceStore = function () {
  5689. function ResourceStore(keys, resources) {
  5690. _classCallCheck(this, ResourceStore);
  5691. this._keys = keys;
  5692. this._resources = resources;
  5693. }
  5694. _createClass(ResourceStore, [{
  5695. key: 'get',
  5696. value: function get(key) {
  5697. var index = this._keys.indexOf(key);
  5698. return index === -1 ? null : this._resources[index];
  5699. }
  5700. }]);
  5701. return ResourceStore;
  5702. }();
  5703. var INLINE_SVG = /^data:image\/svg\+xml/i;
  5704. var INLINE_BASE64 = /^data:image\/.*;base64,/i;
  5705. var INLINE_IMG = /^data:image\/.*/i;
  5706. var isInlineImage = function isInlineImage(src) {
  5707. return INLINE_IMG.test(src);
  5708. };
  5709. var isInlineBase64Image = function isInlineBase64Image(src) {
  5710. return INLINE_BASE64.test(src);
  5711. };
  5712. var isSVG = function isSVG(src) {
  5713. return src.substr(-3).toLowerCase() === 'svg' || INLINE_SVG.test(src);
  5714. };
  5715. var _loadImage = function _loadImage(src, timeout) {
  5716. return new Promise(function (resolve, reject) {
  5717. var img = new Image();
  5718. img.onload = function () {
  5719. return resolve(img);
  5720. };
  5721. img.onerror = reject;
  5722. img.src = src;
  5723. if (img.complete === true) {
  5724. // Inline XML images may fail to parse, throwing an Error later on
  5725. setTimeout(function () {
  5726. resolve(img);
  5727. }, 500);
  5728. }
  5729. if (timeout) {
  5730. setTimeout(function () {
  5731. return reject( true ? 'Timed out (' + timeout + 'ms) loading image' : '');
  5732. }, timeout);
  5733. }
  5734. });
  5735. };
  5736. /***/ }),
  5737. /* 56 */
  5738. /***/ (function(module, exports, __webpack_require__) {
  5739. "use strict";
  5740. Object.defineProperty(exports, "__esModule", {
  5741. value: true
  5742. });
  5743. exports.parseContent = exports.resolvePseudoContent = exports.popCounters = exports.parseCounterReset = exports.TOKEN_TYPE = exports.PSEUDO_CONTENT_ITEM_TYPE = undefined;
  5744. var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
  5745. var _ListItem = __webpack_require__(14);
  5746. var _listStyle = __webpack_require__(8);
  5747. var PSEUDO_CONTENT_ITEM_TYPE = exports.PSEUDO_CONTENT_ITEM_TYPE = {
  5748. TEXT: 0,
  5749. IMAGE: 1
  5750. };
  5751. var TOKEN_TYPE = exports.TOKEN_TYPE = {
  5752. STRING: 0,
  5753. ATTRIBUTE: 1,
  5754. URL: 2,
  5755. COUNTER: 3,
  5756. COUNTERS: 4,
  5757. OPENQUOTE: 5,
  5758. CLOSEQUOTE: 6
  5759. };
  5760. var parseCounterReset = exports.parseCounterReset = function parseCounterReset(style, data) {
  5761. if (!style || !style.counterReset || style.counterReset === 'none') {
  5762. return [];
  5763. }
  5764. var counterNames = [];
  5765. var counterResets = style.counterReset.split(/\s*,\s*/);
  5766. var lenCounterResets = counterResets.length;
  5767. for (var i = 0; i < lenCounterResets; i++) {
  5768. var _counterResets$i$spli = counterResets[i].split(/\s+/),
  5769. _counterResets$i$spli2 = _slicedToArray(_counterResets$i$spli, 2),
  5770. counterName = _counterResets$i$spli2[0],
  5771. initialValue = _counterResets$i$spli2[1];
  5772. counterNames.push(counterName);
  5773. var counter = data.counters[counterName];
  5774. if (!counter) {
  5775. counter = data.counters[counterName] = [];
  5776. }
  5777. counter.push(parseInt(initialValue || 0, 10));
  5778. }
  5779. return counterNames;
  5780. };
  5781. var popCounters = exports.popCounters = function popCounters(counterNames, data) {
  5782. var lenCounters = counterNames.length;
  5783. for (var i = 0; i < lenCounters; i++) {
  5784. data.counters[counterNames[i]].pop();
  5785. }
  5786. };
  5787. var resolvePseudoContent = exports.resolvePseudoContent = function resolvePseudoContent(node, style, data) {
  5788. if (!style || !style.content || style.content === 'none' || style.content === '-moz-alt-content' || style.display === 'none') {
  5789. return null;
  5790. }
  5791. var tokens = parseContent(style.content);
  5792. var len = tokens.length;
  5793. var contentItems = [];
  5794. var s = '';
  5795. // increment the counter (if there is a "counter-increment" declaration)
  5796. var counterIncrement = style.counterIncrement;
  5797. if (counterIncrement && counterIncrement !== 'none') {
  5798. var _counterIncrement$spl = counterIncrement.split(/\s+/),
  5799. _counterIncrement$spl2 = _slicedToArray(_counterIncrement$spl, 2),
  5800. counterName = _counterIncrement$spl2[0],
  5801. incrementValue = _counterIncrement$spl2[1];
  5802. var counter = data.counters[counterName];
  5803. if (counter) {
  5804. counter[counter.length - 1] += incrementValue === undefined ? 1 : parseInt(incrementValue, 10);
  5805. }
  5806. }
  5807. // build the content string
  5808. for (var i = 0; i < len; i++) {
  5809. var token = tokens[i];
  5810. switch (token.type) {
  5811. case TOKEN_TYPE.STRING:
  5812. s += token.value || '';
  5813. break;
  5814. case TOKEN_TYPE.ATTRIBUTE:
  5815. if (node instanceof HTMLElement && token.value) {
  5816. s += node.getAttribute(token.value) || '';
  5817. }
  5818. break;
  5819. case TOKEN_TYPE.COUNTER:
  5820. var _counter = data.counters[token.name || ''];
  5821. if (_counter) {
  5822. s += formatCounterValue([_counter[_counter.length - 1]], '', token.format);
  5823. }
  5824. break;
  5825. case TOKEN_TYPE.COUNTERS:
  5826. var _counters = data.counters[token.name || ''];
  5827. if (_counters) {
  5828. s += formatCounterValue(_counters, token.glue, token.format);
  5829. }
  5830. break;
  5831. case TOKEN_TYPE.OPENQUOTE:
  5832. s += getQuote(style, true, data.quoteDepth);
  5833. data.quoteDepth++;
  5834. break;
  5835. case TOKEN_TYPE.CLOSEQUOTE:
  5836. data.quoteDepth--;
  5837. s += getQuote(style, false, data.quoteDepth);
  5838. break;
  5839. case TOKEN_TYPE.URL:
  5840. if (s) {
  5841. contentItems.push({ type: PSEUDO_CONTENT_ITEM_TYPE.TEXT, value: s });
  5842. s = '';
  5843. }
  5844. contentItems.push({ type: PSEUDO_CONTENT_ITEM_TYPE.IMAGE, value: token.value || '' });
  5845. break;
  5846. }
  5847. }
  5848. if (s) {
  5849. contentItems.push({ type: PSEUDO_CONTENT_ITEM_TYPE.TEXT, value: s });
  5850. }
  5851. return contentItems;
  5852. };
  5853. var parseContent = exports.parseContent = function parseContent(content, cache) {
  5854. if (cache && cache[content]) {
  5855. return cache[content];
  5856. }
  5857. var tokens = [];
  5858. var len = content.length;
  5859. var isString = false;
  5860. var isEscaped = false;
  5861. var isFunction = false;
  5862. var str = '';
  5863. var functionName = '';
  5864. var args = [];
  5865. for (var i = 0; i < len; i++) {
  5866. var c = content.charAt(i);
  5867. switch (c) {
  5868. case "'":
  5869. case '"':
  5870. if (isEscaped) {
  5871. str += c;
  5872. } else {
  5873. isString = !isString;
  5874. if (!isFunction && !isString) {
  5875. tokens.push({ type: TOKEN_TYPE.STRING, value: str });
  5876. str = '';
  5877. }
  5878. }
  5879. break;
  5880. case '\\':
  5881. if (isEscaped) {
  5882. str += c;
  5883. isEscaped = false;
  5884. } else {
  5885. isEscaped = true;
  5886. }
  5887. break;
  5888. case '(':
  5889. if (isString) {
  5890. str += c;
  5891. } else {
  5892. isFunction = true;
  5893. functionName = str;
  5894. str = '';
  5895. args = [];
  5896. }
  5897. break;
  5898. case ')':
  5899. if (isString) {
  5900. str += c;
  5901. } else if (isFunction) {
  5902. if (str) {
  5903. args.push(str);
  5904. }
  5905. switch (functionName) {
  5906. case 'attr':
  5907. if (args.length > 0) {
  5908. tokens.push({ type: TOKEN_TYPE.ATTRIBUTE, value: args[0] });
  5909. }
  5910. break;
  5911. case 'counter':
  5912. if (args.length > 0) {
  5913. var counter = {
  5914. type: TOKEN_TYPE.COUNTER,
  5915. name: args[0]
  5916. };
  5917. if (args.length > 1) {
  5918. counter.format = args[1];
  5919. }
  5920. tokens.push(counter);
  5921. }
  5922. break;
  5923. case 'counters':
  5924. if (args.length > 0) {
  5925. var _counters2 = {
  5926. type: TOKEN_TYPE.COUNTERS,
  5927. name: args[0]
  5928. };
  5929. if (args.length > 1) {
  5930. _counters2.glue = args[1];
  5931. }
  5932. if (args.length > 2) {
  5933. _counters2.format = args[2];
  5934. }
  5935. tokens.push(_counters2);
  5936. }
  5937. break;
  5938. case 'url':
  5939. if (args.length > 0) {
  5940. tokens.push({ type: TOKEN_TYPE.URL, value: args[0] });
  5941. }
  5942. break;
  5943. }
  5944. isFunction = false;
  5945. str = '';
  5946. }
  5947. break;
  5948. case ',':
  5949. if (isString) {
  5950. str += c;
  5951. } else if (isFunction) {
  5952. args.push(str);
  5953. str = '';
  5954. }
  5955. break;
  5956. case ' ':
  5957. case '\t':
  5958. if (isString) {
  5959. str += c;
  5960. } else if (str) {
  5961. addOtherToken(tokens, str);
  5962. str = '';
  5963. }
  5964. break;
  5965. default:
  5966. str += c;
  5967. }
  5968. if (c !== '\\') {
  5969. isEscaped = false;
  5970. }
  5971. }
  5972. if (str) {
  5973. addOtherToken(tokens, str);
  5974. }
  5975. if (cache) {
  5976. cache[content] = tokens;
  5977. }
  5978. return tokens;
  5979. };
  5980. var addOtherToken = function addOtherToken(tokens, identifier) {
  5981. switch (identifier) {
  5982. case 'open-quote':
  5983. tokens.push({ type: TOKEN_TYPE.OPENQUOTE });
  5984. break;
  5985. case 'close-quote':
  5986. tokens.push({ type: TOKEN_TYPE.CLOSEQUOTE });
  5987. break;
  5988. }
  5989. };
  5990. var getQuote = function getQuote(style, isOpening, quoteDepth) {
  5991. var quotes = style.quotes ? style.quotes.split(/\s+/) : ["'\"'", "'\"'"];
  5992. var idx = quoteDepth * 2;
  5993. if (idx >= quotes.length) {
  5994. idx = quotes.length - 2;
  5995. }
  5996. if (!isOpening) {
  5997. ++idx;
  5998. }
  5999. return quotes[idx].replace(/^["']|["']$/g, '');
  6000. };
  6001. var formatCounterValue = function formatCounterValue(counter, glue, format) {
  6002. var len = counter.length;
  6003. var result = '';
  6004. for (var i = 0; i < len; i++) {
  6005. if (i > 0) {
  6006. result += glue || '';
  6007. }
  6008. result += (0, _ListItem.createCounterText)(counter[i], (0, _listStyle.parseListStyleType)(format || 'decimal'), false);
  6009. }
  6010. return result;
  6011. };
  6012. /***/ })
  6013. /******/ ]);
  6014. });