25.js 391 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107
  1. (window["webpackJsonp"] = window["webpackJsonp"] || []).push([[25],{
  2. /***/ "../../node_modules/@babel/runtime/helpers/asyncToGenerator.js":
  3. /*!**************************************************************************************!*\
  4. !*** D:/web_src/4dkankan_v4/node_modules/@babel/runtime/helpers/asyncToGenerator.js ***!
  5. \**************************************************************************************/
  6. /*! no static exports found */
  7. /***/ (function(module, exports) {
  8. function asyncGeneratorStep(n, t, e, r, o, a, c) {
  9. try {
  10. var i = n[a](c),
  11. u = i.value;
  12. } catch (n) {
  13. return void e(n);
  14. }
  15. i.done ? t(u) : Promise.resolve(u).then(r, o);
  16. }
  17. function _asyncToGenerator(n) {
  18. return function () {
  19. var t = this,
  20. e = arguments;
  21. return new Promise(function (r, o) {
  22. var a = n.apply(t, e);
  23. function _next(n) {
  24. asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
  25. }
  26. function _throw(n) {
  27. asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
  28. }
  29. _next(void 0);
  30. });
  31. };
  32. }
  33. module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
  34. /***/ }),
  35. /***/ "../../node_modules/@babel/runtime/helpers/defineProperty.js":
  36. /*!************************************************************************************!*\
  37. !*** D:/web_src/4dkankan_v4/node_modules/@babel/runtime/helpers/defineProperty.js ***!
  38. \************************************************************************************/
  39. /*! no static exports found */
  40. /***/ (function(module, exports, __webpack_require__) {
  41. var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ "../../node_modules/@babel/runtime/helpers/toPropertyKey.js");
  42. function _defineProperty(e, r, t) {
  43. return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
  44. value: t,
  45. enumerable: !0,
  46. configurable: !0,
  47. writable: !0
  48. }) : e[r] = t, e;
  49. }
  50. module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
  51. /***/ }),
  52. /***/ "../../node_modules/@babel/runtime/helpers/toPrimitive.js":
  53. /*!*********************************************************************************!*\
  54. !*** D:/web_src/4dkankan_v4/node_modules/@babel/runtime/helpers/toPrimitive.js ***!
  55. \*********************************************************************************/
  56. /*! no static exports found */
  57. /***/ (function(module, exports, __webpack_require__) {
  58. __webpack_require__(/*! core-js/modules/es.error.cause.js */ "../../node_modules/core-js/modules/es.error.cause.js");
  59. var _typeof = __webpack_require__(/*! ./typeof.js */ "../../node_modules/@babel/runtime/helpers/typeof.js")["default"];
  60. function toPrimitive(t, r) {
  61. if ("object" != _typeof(t) || !t) return t;
  62. var e = t[Symbol.toPrimitive];
  63. if (void 0 !== e) {
  64. var i = e.call(t, r || "default");
  65. if ("object" != _typeof(i)) return i;
  66. throw new TypeError("@@toPrimitive must return a primitive value.");
  67. }
  68. return ("string" === r ? String : Number)(t);
  69. }
  70. module.exports = toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports;
  71. /***/ }),
  72. /***/ "../../node_modules/@babel/runtime/helpers/toPropertyKey.js":
  73. /*!***********************************************************************************!*\
  74. !*** D:/web_src/4dkankan_v4/node_modules/@babel/runtime/helpers/toPropertyKey.js ***!
  75. \***********************************************************************************/
  76. /*! no static exports found */
  77. /***/ (function(module, exports, __webpack_require__) {
  78. var _typeof = __webpack_require__(/*! ./typeof.js */ "../../node_modules/@babel/runtime/helpers/typeof.js")["default"];
  79. var toPrimitive = __webpack_require__(/*! ./toPrimitive.js */ "../../node_modules/@babel/runtime/helpers/toPrimitive.js");
  80. function toPropertyKey(t) {
  81. var i = toPrimitive(t, "string");
  82. return "symbol" == _typeof(i) ? i : i + "";
  83. }
  84. module.exports = toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports;
  85. /***/ }),
  86. /***/ "../../node_modules/canvg/lib/index.es.js":
  87. /*!*****************************************************************!*\
  88. !*** D:/web_src/4dkankan_v4/node_modules/canvg/lib/index.es.js ***!
  89. \*****************************************************************/
  90. /*! exports provided: AElement, AnimateColorElement, AnimateElement, AnimateTransformElement, BoundingBox, CB1, CB2, CB3, CB4, Canvg, CircleElement, ClipPathElement, DefsElement, DescElement, Document, Element, EllipseElement, FeColorMatrixElement, FeCompositeElement, FeDropShadowElement, FeGaussianBlurElement, FeMorphologyElement, FilterElement, Font, FontElement, FontFaceElement, GElement, GlyphElement, GradientElement, ImageElement, LineElement, LinearGradientElement, MarkerElement, MaskElement, Matrix, MissingGlyphElement, Mouse, PSEUDO_ZERO, Parser, PathElement, PathParser, PatternElement, Point, PolygonElement, PolylineElement, Property, QB1, QB2, QB3, RadialGradientElement, RectElement, RenderedElement, Rotate, SVGElement, SVGFontLoader, Scale, Screen, Skew, SkewX, SkewY, StopElement, StyleElement, SymbolElement, TRefElement, TSpanElement, TextElement, TextPathElement, TitleElement, Transform, Translate, UnknownElement, UseElement, ViewPort, compressSpaces, default, getSelectorSpecificity, normalizeAttributeName, normalizeColor, parseExternalUrl, presets, toNumbers, trimLeft, trimRight, vectorMagnitude, vectorsAngle, vectorsRatio */
  91. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  92. "use strict";
  93. __webpack_require__.r(__webpack_exports__);
  94. /* WEBPACK VAR INJECTION */(function(process) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AElement", function() { return AElement; });
  95. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AnimateColorElement", function() { return AnimateColorElement; });
  96. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AnimateElement", function() { return AnimateElement; });
  97. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AnimateTransformElement", function() { return AnimateTransformElement; });
  98. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BoundingBox", function() { return BoundingBox; });
  99. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CB1", function() { return CB1; });
  100. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CB2", function() { return CB2; });
  101. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CB3", function() { return CB3; });
  102. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CB4", function() { return CB4; });
  103. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Canvg", function() { return Canvg; });
  104. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CircleElement", function() { return CircleElement; });
  105. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ClipPathElement", function() { return ClipPathElement; });
  106. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DefsElement", function() { return DefsElement; });
  107. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DescElement", function() { return DescElement; });
  108. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Document", function() { return Document; });
  109. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Element", function() { return Element; });
  110. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EllipseElement", function() { return EllipseElement; });
  111. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FeColorMatrixElement", function() { return FeColorMatrixElement; });
  112. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FeCompositeElement", function() { return FeCompositeElement; });
  113. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FeDropShadowElement", function() { return FeDropShadowElement; });
  114. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FeGaussianBlurElement", function() { return FeGaussianBlurElement; });
  115. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FeMorphologyElement", function() { return FeMorphologyElement; });
  116. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FilterElement", function() { return FilterElement; });
  117. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Font", function() { return Font; });
  118. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FontElement", function() { return FontElement; });
  119. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FontFaceElement", function() { return FontFaceElement; });
  120. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GElement", function() { return GElement; });
  121. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GlyphElement", function() { return GlyphElement; });
  122. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GradientElement", function() { return GradientElement; });
  123. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ImageElement", function() { return ImageElement; });
  124. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LineElement", function() { return LineElement; });
  125. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LinearGradientElement", function() { return LinearGradientElement; });
  126. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MarkerElement", function() { return MarkerElement; });
  127. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MaskElement", function() { return MaskElement; });
  128. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Matrix", function() { return Matrix; });
  129. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MissingGlyphElement", function() { return MissingGlyphElement; });
  130. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Mouse", function() { return Mouse; });
  131. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PSEUDO_ZERO", function() { return PSEUDO_ZERO; });
  132. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Parser", function() { return Parser; });
  133. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PathElement", function() { return PathElement; });
  134. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PathParser", function() { return PathParser; });
  135. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PatternElement", function() { return PatternElement; });
  136. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Point", function() { return Point; });
  137. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PolygonElement", function() { return PolygonElement; });
  138. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PolylineElement", function() { return PolylineElement; });
  139. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Property", function() { return Property; });
  140. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "QB1", function() { return QB1; });
  141. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "QB2", function() { return QB2; });
  142. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "QB3", function() { return QB3; });
  143. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RadialGradientElement", function() { return RadialGradientElement; });
  144. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RectElement", function() { return RectElement; });
  145. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RenderedElement", function() { return RenderedElement; });
  146. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Rotate", function() { return Rotate; });
  147. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SVGElement", function() { return SVGElement; });
  148. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SVGFontLoader", function() { return SVGFontLoader; });
  149. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Scale", function() { return Scale; });
  150. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Screen", function() { return Screen; });
  151. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Skew", function() { return Skew; });
  152. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SkewX", function() { return SkewX; });
  153. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SkewY", function() { return SkewY; });
  154. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StopElement", function() { return StopElement; });
  155. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StyleElement", function() { return StyleElement; });
  156. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SymbolElement", function() { return SymbolElement; });
  157. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TRefElement", function() { return TRefElement; });
  158. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TSpanElement", function() { return TSpanElement; });
  159. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextElement", function() { return TextElement; });
  160. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextPathElement", function() { return TextPathElement; });
  161. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TitleElement", function() { return TitleElement; });
  162. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Transform", function() { return Transform; });
  163. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Translate", function() { return Translate; });
  164. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UnknownElement", function() { return UnknownElement; });
  165. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UseElement", function() { return UseElement; });
  166. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ViewPort", function() { return ViewPort; });
  167. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "compressSpaces", function() { return compressSpaces; });
  168. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Canvg; });
  169. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSelectorSpecificity", function() { return getSelectorSpecificity; });
  170. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalizeAttributeName", function() { return normalizeAttributeName; });
  171. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalizeColor", function() { return normalizeColor; });
  172. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseExternalUrl", function() { return parseExternalUrl; });
  173. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "presets", function() { return index; });
  174. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toNumbers", function() { return toNumbers; });
  175. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "trimLeft", function() { return trimLeft; });
  176. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "trimRight", function() { return trimRight; });
  177. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "vectorMagnitude", function() { return vectorMagnitude; });
  178. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "vectorsAngle", function() { return vectorsAngle; });
  179. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "vectorsRatio", function() { return vectorsRatio; });
  180. /* harmony import */ var core_js_modules_es_promise_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.promise.js */ "../../node_modules/core-js/modules/es.promise.js");
  181. /* harmony import */ var core_js_modules_es_promise_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_promise_js__WEBPACK_IMPORTED_MODULE_0__);
  182. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../../node_modules/@babel/runtime/helpers/asyncToGenerator.js");
  183. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);
  184. /* harmony import */ var core_js_modules_es_string_match_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.string.match.js */ "../../node_modules/core-js/modules/es.string.match.js");
  185. /* harmony import */ var core_js_modules_es_string_match_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_match_js__WEBPACK_IMPORTED_MODULE_2__);
  186. /* harmony import */ var core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.string.replace.js */ "../../node_modules/core-js/modules/es.string.replace.js");
  187. /* harmony import */ var core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_3__);
  188. /* harmony import */ var core_js_modules_es_string_starts_with_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.string.starts-with.js */ "../../node_modules/core-js/modules/es.string.starts-with.js");
  189. /* harmony import */ var core_js_modules_es_string_starts_with_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_starts_with_js__WEBPACK_IMPORTED_MODULE_4__);
  190. /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "../../node_modules/core-js/modules/es.array.iterator.js");
  191. /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_5__);
  192. /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "../../node_modules/core-js/modules/web.dom-collections.iterator.js");
  193. /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_6__);
  194. /* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../../node_modules/@babel/runtime/helpers/defineProperty.js");
  195. /* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_7__);
  196. /* harmony import */ var core_js_modules_es_array_reduce_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.array.reduce.js */ "../../node_modules/core-js/modules/es.array.reduce.js");
  197. /* harmony import */ var core_js_modules_es_array_reduce_js__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_reduce_js__WEBPACK_IMPORTED_MODULE_8__);
  198. /* harmony import */ var core_js_modules_es_string_ends_with_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.string.ends-with.js */ "../../node_modules/core-js/modules/es.string.ends-with.js");
  199. /* harmony import */ var core_js_modules_es_string_ends_with_js__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_ends_with_js__WEBPACK_IMPORTED_MODULE_9__);
  200. /* harmony import */ var core_js_modules_es_string_split_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.string.split.js */ "../../node_modules/core-js/modules/es.string.split.js");
  201. /* harmony import */ var core_js_modules_es_string_split_js__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_split_js__WEBPACK_IMPORTED_MODULE_10__);
  202. /* harmony import */ var raf__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! raf */ "../../node_modules/raf/index.js");
  203. /* harmony import */ var raf__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(raf__WEBPACK_IMPORTED_MODULE_11__);
  204. /* harmony import */ var core_js_modules_es_string_trim_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! core-js/modules/es.string.trim.js */ "../../node_modules/core-js/modules/es.string.trim.js");
  205. /* harmony import */ var core_js_modules_es_string_trim_js__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_trim_js__WEBPACK_IMPORTED_MODULE_12__);
  206. /* harmony import */ var rgbcolor__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! rgbcolor */ "../../node_modules/rgbcolor/index.js");
  207. /* harmony import */ var rgbcolor__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(rgbcolor__WEBPACK_IMPORTED_MODULE_13__);
  208. /* harmony import */ var core_js_modules_es_array_index_of_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! core-js/modules/es.array.index-of.js */ "../../node_modules/core-js/modules/es.array.index-of.js");
  209. /* harmony import */ var core_js_modules_es_array_index_of_js__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_index_of_js__WEBPACK_IMPORTED_MODULE_14__);
  210. /* harmony import */ var core_js_modules_es_string_includes_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! core-js/modules/es.string.includes.js */ "../../node_modules/core-js/modules/es.string.includes.js");
  211. /* harmony import */ var core_js_modules_es_string_includes_js__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_includes_js__WEBPACK_IMPORTED_MODULE_15__);
  212. /* harmony import */ var core_js_modules_es_array_reverse_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! core-js/modules/es.array.reverse.js */ "../../node_modules/core-js/modules/es.array.reverse.js");
  213. /* harmony import */ var core_js_modules_es_array_reverse_js__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_reverse_js__WEBPACK_IMPORTED_MODULE_16__);
  214. /* harmony import */ var svg_pathdata__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! svg-pathdata */ "../../node_modules/svg-pathdata/lib/SVGPathData.module.js");
  215. /* harmony import */ var core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! core-js/modules/es.regexp.to-string.js */ "../../node_modules/core-js/modules/es.regexp.to-string.js");
  216. /* harmony import */ var core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_18__);
  217. /* harmony import */ var stackblur_canvas__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! stackblur-canvas */ "../../node_modules/stackblur-canvas/dist/stackblur-es.js");
  218. /**
  219. * Options preset for `OffscreenCanvas`.
  220. * @param config - Preset requirements.
  221. * @param config.DOMParser - XML/HTML parser from string into DOM Document.
  222. * @returns Preset object.
  223. */
  224. function offscreen() {
  225. var {
  226. DOMParser: DOMParserFallback
  227. } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  228. var preset = {
  229. window: null,
  230. ignoreAnimation: true,
  231. ignoreMouse: true,
  232. DOMParser: DOMParserFallback,
  233. createCanvas(width, height) {
  234. return new OffscreenCanvas(width, height);
  235. },
  236. createImage(url) {
  237. return _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()(function* () {
  238. var response = yield fetch(url);
  239. var blob = yield response.blob();
  240. var img = yield createImageBitmap(blob);
  241. return img;
  242. })();
  243. }
  244. };
  245. if (typeof DOMParser !== 'undefined' || typeof DOMParserFallback === 'undefined') {
  246. Reflect.deleteProperty(preset, 'DOMParser');
  247. }
  248. return preset;
  249. }
  250. /**
  251. * Options preset for `node-canvas`.
  252. * @param config - Preset requirements.
  253. * @param config.DOMParser - XML/HTML parser from string into DOM Document.
  254. * @param config.canvas - `node-canvas` exports.
  255. * @param config.fetch - WHATWG-compatible `fetch` function.
  256. * @returns Preset object.
  257. */
  258. function node(_ref) {
  259. var {
  260. DOMParser,
  261. canvas,
  262. fetch
  263. } = _ref;
  264. return {
  265. window: null,
  266. ignoreAnimation: true,
  267. ignoreMouse: true,
  268. DOMParser,
  269. fetch,
  270. createCanvas: canvas.createCanvas,
  271. createImage: canvas.loadImage
  272. };
  273. }
  274. var index = /*#__PURE__*/Object.freeze({
  275. __proto__: null,
  276. offscreen: offscreen,
  277. node: node
  278. });
  279. /**
  280. * HTML-safe compress white-spaces.
  281. * @param str - String to compress.
  282. * @returns String.
  283. */
  284. function compressSpaces(str) {
  285. return str.replace(/(?!\u3000)\s+/gm, ' ');
  286. }
  287. /**
  288. * HTML-safe left trim.
  289. * @param str - String to trim.
  290. * @returns String.
  291. */
  292. function trimLeft(str) {
  293. return str.replace(/^[\n \t]+/, '');
  294. }
  295. /**
  296. * HTML-safe right trim.
  297. * @param str - String to trim.
  298. * @returns String.
  299. */
  300. function trimRight(str) {
  301. return str.replace(/[\n \t]+$/, '');
  302. }
  303. /**
  304. * String to numbers array.
  305. * @param str - Numbers string.
  306. * @returns Numbers array.
  307. */
  308. function toNumbers(str) {
  309. var matches = (str || '').match(/-?(\d+(?:\.\d*(?:[eE][+-]?\d+)?)?|\.\d+)(?=\D|$)/gm) || [];
  310. return matches.map(parseFloat);
  311. } // Microsoft Edge fix
  312. var allUppercase = /^[A-Z-]+$/;
  313. /**
  314. * Normalize attribute name.
  315. * @param name - Attribute name.
  316. * @returns Normalized attribute name.
  317. */
  318. function normalizeAttributeName(name) {
  319. if (allUppercase.test(name)) {
  320. return name.toLowerCase();
  321. }
  322. return name;
  323. }
  324. /**
  325. * Parse external URL.
  326. * @param url - CSS url string.
  327. * @returns Parsed URL.
  328. */
  329. function parseExternalUrl(url) {
  330. // single quotes [2]
  331. // v double quotes [3]
  332. // v v no quotes [4]
  333. // v v v
  334. var urlMatch = /url\(('([^']+)'|"([^"]+)"|([^'")]+))\)/.exec(url) || [];
  335. return urlMatch[2] || urlMatch[3] || urlMatch[4];
  336. }
  337. /**
  338. * Transform floats to integers in rgb colors.
  339. * @param color - Color to normalize.
  340. * @returns Normalized color.
  341. */
  342. function normalizeColor(color) {
  343. if (!color.startsWith('rgb')) {
  344. return color;
  345. }
  346. var rgbParts = 3;
  347. var normalizedColor = color.replace(/\d+(\.\d+)?/g, (num, isFloat) => rgbParts-- && isFloat ? String(Math.round(parseFloat(num))) : num);
  348. return normalizedColor;
  349. }
  350. // slightly modified version of https://github.com/keeganstreet/specificity/blob/master/specificity.js
  351. var attributeRegex = /(\[[^\]]+\])/g;
  352. var idRegex = /(#[^\s+>~.[:]+)/g;
  353. var classRegex = /(\.[^\s+>~.[:]+)/g;
  354. var pseudoElementRegex = /(::[^\s+>~.[:]+|:first-line|:first-letter|:before|:after)/gi;
  355. var pseudoClassWithBracketsRegex = /(:[\w-]+\([^)]*\))/gi;
  356. var pseudoClassRegex = /(:[^\s+>~.[:]+)/g;
  357. var elementRegex = /([^\s+>~.[:]+)/g;
  358. function findSelectorMatch(selector, regex) {
  359. var matches = regex.exec(selector);
  360. if (!matches) {
  361. return [selector, 0];
  362. }
  363. return [selector.replace(regex, ' '), matches.length];
  364. }
  365. /**
  366. * Measure selector specificity.
  367. * @param selector - Selector to measure.
  368. * @returns Specificity.
  369. */
  370. function getSelectorSpecificity(selector) {
  371. var specificity = [0, 0, 0];
  372. var currentSelector = selector.replace(/:not\(([^)]*)\)/g, ' $1 ').replace(/{[\s\S]*/gm, ' ');
  373. var delta = 0;
  374. [currentSelector, delta] = findSelectorMatch(currentSelector, attributeRegex);
  375. specificity[1] += delta;
  376. [currentSelector, delta] = findSelectorMatch(currentSelector, idRegex);
  377. specificity[0] += delta;
  378. [currentSelector, delta] = findSelectorMatch(currentSelector, classRegex);
  379. specificity[1] += delta;
  380. [currentSelector, delta] = findSelectorMatch(currentSelector, pseudoElementRegex);
  381. specificity[2] += delta;
  382. [currentSelector, delta] = findSelectorMatch(currentSelector, pseudoClassWithBracketsRegex);
  383. specificity[1] += delta;
  384. [currentSelector, delta] = findSelectorMatch(currentSelector, pseudoClassRegex);
  385. specificity[1] += delta;
  386. currentSelector = currentSelector.replace(/[*\s+>~]/g, ' ').replace(/[#.]/g, ' ');
  387. [currentSelector, delta] = findSelectorMatch(currentSelector, elementRegex); // lgtm [js/useless-assignment-to-local]
  388. specificity[2] += delta;
  389. return specificity.join('');
  390. }
  391. var PSEUDO_ZERO = .00000001;
  392. /**
  393. * Vector magnitude.
  394. * @param v
  395. * @returns Number result.
  396. */
  397. function vectorMagnitude(v) {
  398. return Math.sqrt(Math.pow(v[0], 2) + Math.pow(v[1], 2));
  399. }
  400. /**
  401. * Ratio between two vectors.
  402. * @param u
  403. * @param v
  404. * @returns Number result.
  405. */
  406. function vectorsRatio(u, v) {
  407. return (u[0] * v[0] + u[1] * v[1]) / (vectorMagnitude(u) * vectorMagnitude(v));
  408. }
  409. /**
  410. * Angle between two vectors.
  411. * @param u
  412. * @param v
  413. * @returns Number result.
  414. */
  415. function vectorsAngle(u, v) {
  416. return (u[0] * v[1] < u[1] * v[0] ? -1 : 1) * Math.acos(vectorsRatio(u, v));
  417. }
  418. function CB1(t) {
  419. return t * t * t;
  420. }
  421. function CB2(t) {
  422. return 3 * t * t * (1 - t);
  423. }
  424. function CB3(t) {
  425. return 3 * t * (1 - t) * (1 - t);
  426. }
  427. function CB4(t) {
  428. return (1 - t) * (1 - t) * (1 - t);
  429. }
  430. function QB1(t) {
  431. return t * t;
  432. }
  433. function QB2(t) {
  434. return 2 * t * (1 - t);
  435. }
  436. function QB3(t) {
  437. return (1 - t) * (1 - t);
  438. }
  439. class Property {
  440. constructor(document, name, value) {
  441. this.document = document;
  442. this.name = name;
  443. this.value = value;
  444. this.isNormalizedColor = false;
  445. }
  446. static empty(document) {
  447. return new Property(document, 'EMPTY', '');
  448. }
  449. split() {
  450. var separator = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ' ';
  451. var {
  452. document,
  453. name
  454. } = this;
  455. return compressSpaces(this.getString()).trim().split(separator).map(value => new Property(document, name, value));
  456. }
  457. hasValue(zeroIsValue) {
  458. var {
  459. value
  460. } = this;
  461. return value !== null && value !== '' && (zeroIsValue || value !== 0) && typeof value !== 'undefined';
  462. }
  463. isString(regexp) {
  464. var {
  465. value
  466. } = this;
  467. var result = typeof value === 'string';
  468. if (!result || !regexp) {
  469. return result;
  470. }
  471. return regexp.test(value);
  472. }
  473. isUrlDefinition() {
  474. return this.isString(/^url\(/);
  475. }
  476. isPixels() {
  477. if (!this.hasValue()) {
  478. return false;
  479. }
  480. var asString = this.getString();
  481. switch (true) {
  482. case asString.endsWith('px'):
  483. case /^[0-9]+$/.test(asString):
  484. return true;
  485. default:
  486. return false;
  487. }
  488. }
  489. setValue(value) {
  490. this.value = value;
  491. return this;
  492. }
  493. getValue(def) {
  494. if (typeof def === 'undefined' || this.hasValue()) {
  495. return this.value;
  496. }
  497. return def;
  498. }
  499. getNumber(def) {
  500. if (!this.hasValue()) {
  501. if (typeof def === 'undefined') {
  502. return 0;
  503. }
  504. return parseFloat(def);
  505. }
  506. var {
  507. value
  508. } = this;
  509. var n = parseFloat(value);
  510. if (this.isString(/%$/)) {
  511. n /= 100.0;
  512. }
  513. return n;
  514. }
  515. getString(def) {
  516. if (typeof def === 'undefined' || this.hasValue()) {
  517. return typeof this.value === 'undefined' ? '' : String(this.value);
  518. }
  519. return String(def);
  520. }
  521. getColor(def) {
  522. var color = this.getString(def);
  523. if (this.isNormalizedColor) {
  524. return color;
  525. }
  526. this.isNormalizedColor = true;
  527. color = normalizeColor(color);
  528. this.value = color;
  529. return color;
  530. }
  531. getDpi() {
  532. return 96.0; // TODO: compute?
  533. }
  534. getRem() {
  535. return this.document.rootEmSize;
  536. }
  537. getEm() {
  538. return this.document.emSize;
  539. }
  540. getUnits() {
  541. return this.getString().replace(/[0-9.-]/g, '');
  542. }
  543. getPixels(axisOrIsFontSize) {
  544. var processPercent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  545. if (!this.hasValue()) {
  546. return 0;
  547. }
  548. var [axis, isFontSize] = typeof axisOrIsFontSize === 'boolean' ? [undefined, axisOrIsFontSize] : [axisOrIsFontSize];
  549. var {
  550. viewPort
  551. } = this.document.screen;
  552. switch (true) {
  553. case this.isString(/vmin$/):
  554. return this.getNumber() / 100.0 * Math.min(viewPort.computeSize('x'), viewPort.computeSize('y'));
  555. case this.isString(/vmax$/):
  556. return this.getNumber() / 100.0 * Math.max(viewPort.computeSize('x'), viewPort.computeSize('y'));
  557. case this.isString(/vw$/):
  558. return this.getNumber() / 100.0 * viewPort.computeSize('x');
  559. case this.isString(/vh$/):
  560. return this.getNumber() / 100.0 * viewPort.computeSize('y');
  561. case this.isString(/rem$/):
  562. return this.getNumber() * this.getRem();
  563. case this.isString(/em$/):
  564. return this.getNumber() * this.getEm();
  565. case this.isString(/ex$/):
  566. return this.getNumber() * this.getEm() / 2.0;
  567. case this.isString(/px$/):
  568. return this.getNumber();
  569. case this.isString(/pt$/):
  570. return this.getNumber() * this.getDpi() * (1.0 / 72.0);
  571. case this.isString(/pc$/):
  572. return this.getNumber() * 15;
  573. case this.isString(/cm$/):
  574. return this.getNumber() * this.getDpi() / 2.54;
  575. case this.isString(/mm$/):
  576. return this.getNumber() * this.getDpi() / 25.4;
  577. case this.isString(/in$/):
  578. return this.getNumber() * this.getDpi();
  579. case this.isString(/%$/) && isFontSize:
  580. return this.getNumber() * this.getEm();
  581. case this.isString(/%$/):
  582. return this.getNumber() * viewPort.computeSize(axis);
  583. default:
  584. {
  585. var n = this.getNumber();
  586. if (processPercent && n < 1.0) {
  587. return n * viewPort.computeSize(axis);
  588. }
  589. return n;
  590. }
  591. }
  592. }
  593. getMilliseconds() {
  594. if (!this.hasValue()) {
  595. return 0;
  596. }
  597. if (this.isString(/ms$/)) {
  598. return this.getNumber();
  599. }
  600. return this.getNumber() * 1000;
  601. }
  602. getRadians() {
  603. if (!this.hasValue()) {
  604. return 0;
  605. }
  606. switch (true) {
  607. case this.isString(/deg$/):
  608. return this.getNumber() * (Math.PI / 180.0);
  609. case this.isString(/grad$/):
  610. return this.getNumber() * (Math.PI / 200.0);
  611. case this.isString(/rad$/):
  612. return this.getNumber();
  613. default:
  614. return this.getNumber() * (Math.PI / 180.0);
  615. }
  616. }
  617. getDefinition() {
  618. var asString = this.getString();
  619. var name = /#([^)'"]+)/.exec(asString);
  620. if (name) {
  621. name = name[1];
  622. }
  623. if (!name) {
  624. name = asString;
  625. }
  626. return this.document.definitions[name];
  627. }
  628. getFillStyleDefinition(element, opacity) {
  629. var def = this.getDefinition();
  630. if (!def) {
  631. return null;
  632. } // gradient
  633. if (typeof def.createGradient === 'function') {
  634. return def.createGradient(this.document.ctx, element, opacity);
  635. } // pattern
  636. if (typeof def.createPattern === 'function') {
  637. if (def.getHrefAttribute().hasValue()) {
  638. var patternTransform = def.getAttribute('patternTransform');
  639. def = def.getHrefAttribute().getDefinition();
  640. if (patternTransform.hasValue()) {
  641. def.getAttribute('patternTransform', true).setValue(patternTransform.value);
  642. }
  643. }
  644. return def.createPattern(this.document.ctx, element, opacity);
  645. }
  646. return null;
  647. }
  648. getTextBaseline() {
  649. if (!this.hasValue()) {
  650. return null;
  651. }
  652. return Property.textBaselineMapping[this.getString()];
  653. }
  654. addOpacity(opacity) {
  655. var value = this.getColor();
  656. var len = value.length;
  657. var commas = 0; // Simulate old RGBColor version, which can't parse rgba.
  658. for (var i = 0; i < len; i++) {
  659. if (value[i] === ',') {
  660. commas++;
  661. }
  662. if (commas === 3) {
  663. break;
  664. }
  665. }
  666. if (opacity.hasValue() && this.isString() && commas !== 3) {
  667. var color = new rgbcolor__WEBPACK_IMPORTED_MODULE_13___default.a(value);
  668. if (color.ok) {
  669. color.alpha = opacity.getNumber();
  670. value = color.toRGBA();
  671. }
  672. }
  673. return new Property(this.document, this.name, value);
  674. }
  675. }
  676. Property.textBaselineMapping = {
  677. 'baseline': 'alphabetic',
  678. 'before-edge': 'top',
  679. 'text-before-edge': 'top',
  680. 'middle': 'middle',
  681. 'central': 'middle',
  682. 'after-edge': 'bottom',
  683. 'text-after-edge': 'bottom',
  684. 'ideographic': 'ideographic',
  685. 'alphabetic': 'alphabetic',
  686. 'hanging': 'hanging',
  687. 'mathematical': 'alphabetic'
  688. };
  689. class ViewPort {
  690. constructor() {
  691. this.viewPorts = [];
  692. }
  693. clear() {
  694. this.viewPorts = [];
  695. }
  696. setCurrent(width, height) {
  697. this.viewPorts.push({
  698. width,
  699. height
  700. });
  701. }
  702. removeCurrent() {
  703. this.viewPorts.pop();
  704. }
  705. getCurrent() {
  706. var {
  707. viewPorts
  708. } = this;
  709. return viewPorts[viewPorts.length - 1];
  710. }
  711. get width() {
  712. return this.getCurrent().width;
  713. }
  714. get height() {
  715. return this.getCurrent().height;
  716. }
  717. computeSize(d) {
  718. if (typeof d === 'number') {
  719. return d;
  720. }
  721. if (d === 'x') {
  722. return this.width;
  723. }
  724. if (d === 'y') {
  725. return this.height;
  726. }
  727. return Math.sqrt(Math.pow(this.width, 2) + Math.pow(this.height, 2)) / Math.sqrt(2);
  728. }
  729. }
  730. class Point {
  731. constructor(x, y) {
  732. this.x = x;
  733. this.y = y;
  734. }
  735. static parse(point) {
  736. var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  737. var [x = defaultValue, y = defaultValue] = toNumbers(point);
  738. return new Point(x, y);
  739. }
  740. static parseScale(scale) {
  741. var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
  742. var [x = defaultValue, y = x] = toNumbers(scale);
  743. return new Point(x, y);
  744. }
  745. static parsePath(path) {
  746. var points = toNumbers(path);
  747. var len = points.length;
  748. var pathPoints = [];
  749. for (var i = 0; i < len; i += 2) {
  750. pathPoints.push(new Point(points[i], points[i + 1]));
  751. }
  752. return pathPoints;
  753. }
  754. angleTo(point) {
  755. return Math.atan2(point.y - this.y, point.x - this.x);
  756. }
  757. applyTransform(transform) {
  758. var {
  759. x,
  760. y
  761. } = this;
  762. var xp = x * transform[0] + y * transform[2] + transform[4];
  763. var yp = x * transform[1] + y * transform[3] + transform[5];
  764. this.x = xp;
  765. this.y = yp;
  766. }
  767. }
  768. class Mouse {
  769. constructor(screen) {
  770. this.screen = screen;
  771. this.working = false;
  772. this.events = [];
  773. this.eventElements = []; // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
  774. this.onClick = this.onClick.bind(this); // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
  775. this.onMouseMove = this.onMouseMove.bind(this);
  776. }
  777. isWorking() {
  778. return this.working;
  779. }
  780. start() {
  781. if (this.working) {
  782. return;
  783. }
  784. var {
  785. screen,
  786. onClick,
  787. onMouseMove
  788. } = this;
  789. var canvas = screen.ctx.canvas;
  790. canvas.onclick = onClick;
  791. canvas.onmousemove = onMouseMove;
  792. this.working = true;
  793. }
  794. stop() {
  795. if (!this.working) {
  796. return;
  797. }
  798. var canvas = this.screen.ctx.canvas;
  799. this.working = false;
  800. canvas.onclick = null;
  801. canvas.onmousemove = null;
  802. }
  803. hasEvents() {
  804. return this.working && this.events.length > 0;
  805. }
  806. runEvents() {
  807. if (!this.working) {
  808. return;
  809. }
  810. var {
  811. screen: document,
  812. events,
  813. eventElements
  814. } = this;
  815. var {
  816. style
  817. } = document.ctx.canvas;
  818. if (style) {
  819. style.cursor = '';
  820. }
  821. events.forEach((_ref, i) => {
  822. var {
  823. run
  824. } = _ref;
  825. var element = eventElements[i];
  826. while (element) {
  827. run(element);
  828. element = element.parent;
  829. }
  830. }); // done running, clear
  831. this.events = [];
  832. this.eventElements = [];
  833. }
  834. checkPath(element, ctx) {
  835. if (!this.working || !ctx) {
  836. return;
  837. }
  838. var {
  839. events,
  840. eventElements
  841. } = this;
  842. events.forEach((_ref2, i) => {
  843. var {
  844. x,
  845. y
  846. } = _ref2;
  847. if (!eventElements[i] && ctx.isPointInPath && ctx.isPointInPath(x, y)) {
  848. eventElements[i] = element;
  849. }
  850. });
  851. }
  852. checkBoundingBox(element, boundingBox) {
  853. if (!this.working || !boundingBox) {
  854. return;
  855. }
  856. var {
  857. events,
  858. eventElements
  859. } = this;
  860. events.forEach((_ref3, i) => {
  861. var {
  862. x,
  863. y
  864. } = _ref3;
  865. if (!eventElements[i] && boundingBox.isPointInBox(x, y)) {
  866. eventElements[i] = element;
  867. }
  868. });
  869. }
  870. mapXY(x, y) {
  871. var {
  872. window,
  873. ctx
  874. } = this.screen;
  875. var point = new Point(x, y);
  876. var element = ctx.canvas;
  877. while (element) {
  878. point.x -= element.offsetLeft;
  879. point.y -= element.offsetTop;
  880. element = element.offsetParent;
  881. }
  882. if (window.scrollX) {
  883. point.x += window.scrollX;
  884. }
  885. if (window.scrollY) {
  886. point.y += window.scrollY;
  887. }
  888. return point;
  889. }
  890. onClick(event) {
  891. var {
  892. x,
  893. y
  894. } = this.mapXY(event.clientX, event.clientY);
  895. this.events.push({
  896. type: 'onclick',
  897. x,
  898. y,
  899. run(eventTarget) {
  900. if (eventTarget.onClick) {
  901. eventTarget.onClick();
  902. }
  903. }
  904. });
  905. }
  906. onMouseMove(event) {
  907. var {
  908. x,
  909. y
  910. } = this.mapXY(event.clientX, event.clientY);
  911. this.events.push({
  912. type: 'onmousemove',
  913. x,
  914. y,
  915. run(eventTarget) {
  916. if (eventTarget.onMouseMove) {
  917. eventTarget.onMouseMove();
  918. }
  919. }
  920. });
  921. }
  922. }
  923. var defaultWindow = typeof window !== 'undefined' ? window : null;
  924. var defaultFetch$1 = typeof fetch !== 'undefined' ? fetch.bind(undefined) // `fetch` depends on context: `someObject.fetch(...)` will throw error.
  925. : null;
  926. class Screen {
  927. constructor(ctx) {
  928. var {
  929. fetch = defaultFetch$1,
  930. window = defaultWindow
  931. } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  932. this.ctx = ctx;
  933. this.FRAMERATE = 30;
  934. this.MAX_VIRTUAL_PIXELS = 30000;
  935. this.CLIENT_WIDTH = 800;
  936. this.CLIENT_HEIGHT = 600;
  937. this.viewPort = new ViewPort();
  938. this.mouse = new Mouse(this);
  939. this.animations = [];
  940. this.waits = [];
  941. this.frameDuration = 0;
  942. this.isReadyLock = false;
  943. this.isFirstRender = true;
  944. this.intervalId = null;
  945. this.window = window;
  946. this.fetch = fetch;
  947. }
  948. wait(checker) {
  949. this.waits.push(checker);
  950. }
  951. ready() {
  952. // eslint-disable-next-line @typescript-eslint/no-misused-promises
  953. if (!this.readyPromise) {
  954. return Promise.resolve();
  955. }
  956. return this.readyPromise;
  957. }
  958. isReady() {
  959. if (this.isReadyLock) {
  960. return true;
  961. }
  962. var isReadyLock = this.waits.every(_ => _());
  963. if (isReadyLock) {
  964. this.waits = [];
  965. if (this.resolveReady) {
  966. this.resolveReady();
  967. }
  968. }
  969. this.isReadyLock = isReadyLock;
  970. return isReadyLock;
  971. }
  972. setDefaults(ctx) {
  973. // initial values and defaults
  974. ctx.strokeStyle = 'rgba(0,0,0,0)';
  975. ctx.lineCap = 'butt';
  976. ctx.lineJoin = 'miter';
  977. ctx.miterLimit = 4;
  978. }
  979. setViewBox(_ref) {
  980. var {
  981. document,
  982. ctx,
  983. aspectRatio,
  984. width,
  985. desiredWidth,
  986. height,
  987. desiredHeight,
  988. minX = 0,
  989. minY = 0,
  990. refX,
  991. refY,
  992. clip = false,
  993. clipX = 0,
  994. clipY = 0
  995. } = _ref;
  996. // aspect ratio - http://www.w3.org/TR/SVG/coords.html#PreserveAspectRatioAttribute
  997. var cleanAspectRatio = compressSpaces(aspectRatio).replace(/^defer\s/, ''); // ignore defer
  998. var [aspectRatioAlign, aspectRatioMeetOrSlice] = cleanAspectRatio.split(' ');
  999. var align = aspectRatioAlign || 'xMidYMid';
  1000. var meetOrSlice = aspectRatioMeetOrSlice || 'meet'; // calculate scale
  1001. var scaleX = width / desiredWidth;
  1002. var scaleY = height / desiredHeight;
  1003. var scaleMin = Math.min(scaleX, scaleY);
  1004. var scaleMax = Math.max(scaleX, scaleY);
  1005. var finalDesiredWidth = desiredWidth;
  1006. var finalDesiredHeight = desiredHeight;
  1007. if (meetOrSlice === 'meet') {
  1008. finalDesiredWidth *= scaleMin;
  1009. finalDesiredHeight *= scaleMin;
  1010. }
  1011. if (meetOrSlice === 'slice') {
  1012. finalDesiredWidth *= scaleMax;
  1013. finalDesiredHeight *= scaleMax;
  1014. }
  1015. var refXProp = new Property(document, 'refX', refX);
  1016. var refYProp = new Property(document, 'refY', refY);
  1017. var hasRefs = refXProp.hasValue() && refYProp.hasValue();
  1018. if (hasRefs) {
  1019. ctx.translate(-scaleMin * refXProp.getPixels('x'), -scaleMin * refYProp.getPixels('y'));
  1020. }
  1021. if (clip) {
  1022. var scaledClipX = scaleMin * clipX;
  1023. var scaledClipY = scaleMin * clipY;
  1024. ctx.beginPath();
  1025. ctx.moveTo(scaledClipX, scaledClipY);
  1026. ctx.lineTo(width, scaledClipY);
  1027. ctx.lineTo(width, height);
  1028. ctx.lineTo(scaledClipX, height);
  1029. ctx.closePath();
  1030. ctx.clip();
  1031. }
  1032. if (!hasRefs) {
  1033. var isMeetMinY = meetOrSlice === 'meet' && scaleMin === scaleY;
  1034. var isSliceMaxY = meetOrSlice === 'slice' && scaleMax === scaleY;
  1035. var isMeetMinX = meetOrSlice === 'meet' && scaleMin === scaleX;
  1036. var isSliceMaxX = meetOrSlice === 'slice' && scaleMax === scaleX;
  1037. if (align.startsWith('xMid') && (isMeetMinY || isSliceMaxY)) {
  1038. ctx.translate(width / 2.0 - finalDesiredWidth / 2.0, 0);
  1039. }
  1040. if (align.endsWith('YMid') && (isMeetMinX || isSliceMaxX)) {
  1041. ctx.translate(0, height / 2.0 - finalDesiredHeight / 2.0);
  1042. }
  1043. if (align.startsWith('xMax') && (isMeetMinY || isSliceMaxY)) {
  1044. ctx.translate(width - finalDesiredWidth, 0);
  1045. }
  1046. if (align.endsWith('YMax') && (isMeetMinX || isSliceMaxX)) {
  1047. ctx.translate(0, height - finalDesiredHeight);
  1048. }
  1049. } // scale
  1050. switch (true) {
  1051. case align === 'none':
  1052. ctx.scale(scaleX, scaleY);
  1053. break;
  1054. case meetOrSlice === 'meet':
  1055. ctx.scale(scaleMin, scaleMin);
  1056. break;
  1057. case meetOrSlice === 'slice':
  1058. ctx.scale(scaleMax, scaleMax);
  1059. break;
  1060. } // translate
  1061. ctx.translate(-minX, -minY);
  1062. }
  1063. start(element) {
  1064. var {
  1065. enableRedraw = false,
  1066. ignoreMouse = false,
  1067. ignoreAnimation = false,
  1068. ignoreDimensions = false,
  1069. ignoreClear = false,
  1070. forceRedraw,
  1071. scaleWidth,
  1072. scaleHeight,
  1073. offsetX,
  1074. offsetY
  1075. } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  1076. var {
  1077. FRAMERATE,
  1078. mouse
  1079. } = this;
  1080. var frameDuration = 1000 / FRAMERATE;
  1081. this.frameDuration = frameDuration;
  1082. this.readyPromise = new Promise(resolve => {
  1083. this.resolveReady = resolve;
  1084. });
  1085. if (this.isReady()) {
  1086. this.render(element, ignoreDimensions, ignoreClear, scaleWidth, scaleHeight, offsetX, offsetY);
  1087. }
  1088. if (!enableRedraw) {
  1089. return;
  1090. }
  1091. var now = Date.now();
  1092. var then = now;
  1093. var delta = 0;
  1094. var tick = () => {
  1095. now = Date.now();
  1096. delta = now - then;
  1097. if (delta >= frameDuration) {
  1098. then = now - delta % frameDuration;
  1099. if (this.shouldUpdate(ignoreAnimation, forceRedraw)) {
  1100. this.render(element, ignoreDimensions, ignoreClear, scaleWidth, scaleHeight, offsetX, offsetY);
  1101. mouse.runEvents();
  1102. }
  1103. }
  1104. this.intervalId = raf__WEBPACK_IMPORTED_MODULE_11___default()(tick);
  1105. };
  1106. if (!ignoreMouse) {
  1107. mouse.start();
  1108. }
  1109. this.intervalId = raf__WEBPACK_IMPORTED_MODULE_11___default()(tick);
  1110. }
  1111. stop() {
  1112. if (this.intervalId) {
  1113. raf__WEBPACK_IMPORTED_MODULE_11___default.a.cancel(this.intervalId);
  1114. this.intervalId = null;
  1115. }
  1116. this.mouse.stop();
  1117. }
  1118. shouldUpdate(ignoreAnimation, forceRedraw) {
  1119. // need update from animations?
  1120. if (!ignoreAnimation) {
  1121. var {
  1122. frameDuration
  1123. } = this;
  1124. var shouldUpdate = this.animations.reduce((shouldUpdate, animation) => animation.update(frameDuration) || shouldUpdate, false);
  1125. if (shouldUpdate) {
  1126. return true;
  1127. }
  1128. } // need update from redraw?
  1129. if (typeof forceRedraw === 'function' && forceRedraw()) {
  1130. return true;
  1131. }
  1132. if (!this.isReadyLock && this.isReady()) {
  1133. return true;
  1134. } // need update from mouse events?
  1135. if (this.mouse.hasEvents()) {
  1136. return true;
  1137. }
  1138. return false;
  1139. }
  1140. render(element, ignoreDimensions, ignoreClear, scaleWidth, scaleHeight, offsetX, offsetY) {
  1141. var {
  1142. CLIENT_WIDTH,
  1143. CLIENT_HEIGHT,
  1144. viewPort,
  1145. ctx,
  1146. isFirstRender
  1147. } = this;
  1148. var canvas = ctx.canvas;
  1149. viewPort.clear();
  1150. if (canvas.width && canvas.height) {
  1151. viewPort.setCurrent(canvas.width, canvas.height);
  1152. } else {
  1153. viewPort.setCurrent(CLIENT_WIDTH, CLIENT_HEIGHT);
  1154. }
  1155. var widthStyle = element.getStyle('width');
  1156. var heightStyle = element.getStyle('height');
  1157. if (!ignoreDimensions && (isFirstRender || typeof scaleWidth !== 'number' && typeof scaleHeight !== 'number')) {
  1158. // set canvas size
  1159. if (widthStyle.hasValue()) {
  1160. canvas.width = widthStyle.getPixels('x');
  1161. if (canvas.style) {
  1162. canvas.style.width = "".concat(canvas.width, "px");
  1163. }
  1164. }
  1165. if (heightStyle.hasValue()) {
  1166. canvas.height = heightStyle.getPixels('y');
  1167. if (canvas.style) {
  1168. canvas.style.height = "".concat(canvas.height, "px");
  1169. }
  1170. }
  1171. }
  1172. var cWidth = canvas.clientWidth || canvas.width;
  1173. var cHeight = canvas.clientHeight || canvas.height;
  1174. if (ignoreDimensions && widthStyle.hasValue() && heightStyle.hasValue()) {
  1175. cWidth = widthStyle.getPixels('x');
  1176. cHeight = heightStyle.getPixels('y');
  1177. }
  1178. viewPort.setCurrent(cWidth, cHeight);
  1179. if (typeof offsetX === 'number') {
  1180. element.getAttribute('x', true).setValue(offsetX);
  1181. }
  1182. if (typeof offsetY === 'number') {
  1183. element.getAttribute('y', true).setValue(offsetY);
  1184. }
  1185. if (typeof scaleWidth === 'number' || typeof scaleHeight === 'number') {
  1186. var viewBox = toNumbers(element.getAttribute('viewBox').getString());
  1187. var xRatio = 0;
  1188. var yRatio = 0;
  1189. if (typeof scaleWidth === 'number') {
  1190. var _widthStyle = element.getStyle('width');
  1191. if (_widthStyle.hasValue()) {
  1192. xRatio = _widthStyle.getPixels('x') / scaleWidth;
  1193. } else if (!isNaN(viewBox[2])) {
  1194. xRatio = viewBox[2] / scaleWidth;
  1195. }
  1196. }
  1197. if (typeof scaleHeight === 'number') {
  1198. var _heightStyle = element.getStyle('height');
  1199. if (_heightStyle.hasValue()) {
  1200. yRatio = _heightStyle.getPixels('y') / scaleHeight;
  1201. } else if (!isNaN(viewBox[3])) {
  1202. yRatio = viewBox[3] / scaleHeight;
  1203. }
  1204. }
  1205. if (!xRatio) {
  1206. xRatio = yRatio;
  1207. }
  1208. if (!yRatio) {
  1209. yRatio = xRatio;
  1210. }
  1211. element.getAttribute('width', true).setValue(scaleWidth);
  1212. element.getAttribute('height', true).setValue(scaleHeight);
  1213. var transformStyle = element.getStyle('transform', true, true);
  1214. transformStyle.setValue("".concat(transformStyle.getString(), " scale(").concat(1.0 / xRatio, ", ").concat(1.0 / yRatio, ")"));
  1215. } // clear and render
  1216. if (!ignoreClear) {
  1217. ctx.clearRect(0, 0, cWidth, cHeight);
  1218. }
  1219. element.render(ctx);
  1220. if (isFirstRender) {
  1221. this.isFirstRender = false;
  1222. }
  1223. }
  1224. }
  1225. Screen.defaultWindow = defaultWindow;
  1226. Screen.defaultFetch = defaultFetch$1;
  1227. var {
  1228. defaultFetch
  1229. } = Screen;
  1230. var DefaultDOMParser = typeof DOMParser !== 'undefined' ? DOMParser : null;
  1231. class Parser {
  1232. constructor() {
  1233. var {
  1234. fetch = defaultFetch,
  1235. DOMParser = DefaultDOMParser
  1236. } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  1237. this.fetch = fetch;
  1238. this.DOMParser = DOMParser;
  1239. }
  1240. parse(resource) {
  1241. var _this = this;
  1242. return _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()(function* () {
  1243. if (resource.startsWith('<')) {
  1244. return _this.parseFromString(resource);
  1245. }
  1246. return _this.load(resource);
  1247. })();
  1248. }
  1249. parseFromString(xml) {
  1250. var parser = new this.DOMParser();
  1251. try {
  1252. return this.checkDocument(parser.parseFromString(xml, 'image/svg+xml'));
  1253. } catch (err) {
  1254. return this.checkDocument(parser.parseFromString(xml, 'text/xml'));
  1255. }
  1256. }
  1257. checkDocument(document) {
  1258. var parserError = document.getElementsByTagName('parsererror')[0];
  1259. if (parserError) {
  1260. throw new Error(parserError.textContent);
  1261. }
  1262. return document;
  1263. }
  1264. load(url) {
  1265. var _this2 = this;
  1266. return _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()(function* () {
  1267. var response = yield _this2.fetch(url);
  1268. var xml = yield response.text();
  1269. return _this2.parseFromString(xml);
  1270. })();
  1271. }
  1272. }
  1273. class Translate {
  1274. constructor(_, point) {
  1275. this.type = 'translate';
  1276. this.point = null;
  1277. this.point = Point.parse(point);
  1278. }
  1279. apply(ctx) {
  1280. var {
  1281. x,
  1282. y
  1283. } = this.point;
  1284. ctx.translate(x || 0.0, y || 0.0);
  1285. }
  1286. unapply(ctx) {
  1287. var {
  1288. x,
  1289. y
  1290. } = this.point;
  1291. ctx.translate(-1.0 * x || 0.0, -1.0 * y || 0.0);
  1292. }
  1293. applyToPoint(point) {
  1294. var {
  1295. x,
  1296. y
  1297. } = this.point;
  1298. point.applyTransform([1, 0, 0, 1, x || 0.0, y || 0.0]);
  1299. }
  1300. }
  1301. class Rotate {
  1302. constructor(document, rotate, transformOrigin) {
  1303. this.type = 'rotate';
  1304. this.angle = null;
  1305. this.originX = null;
  1306. this.originY = null;
  1307. this.cx = 0;
  1308. this.cy = 0;
  1309. var numbers = toNumbers(rotate);
  1310. this.angle = new Property(document, 'angle', numbers[0]);
  1311. this.originX = transformOrigin[0];
  1312. this.originY = transformOrigin[1];
  1313. this.cx = numbers[1] || 0;
  1314. this.cy = numbers[2] || 0;
  1315. }
  1316. apply(ctx) {
  1317. var {
  1318. cx,
  1319. cy,
  1320. originX,
  1321. originY,
  1322. angle
  1323. } = this;
  1324. var tx = cx + originX.getPixels('x');
  1325. var ty = cy + originY.getPixels('y');
  1326. ctx.translate(tx, ty);
  1327. ctx.rotate(angle.getRadians());
  1328. ctx.translate(-tx, -ty);
  1329. }
  1330. unapply(ctx) {
  1331. var {
  1332. cx,
  1333. cy,
  1334. originX,
  1335. originY,
  1336. angle
  1337. } = this;
  1338. var tx = cx + originX.getPixels('x');
  1339. var ty = cy + originY.getPixels('y');
  1340. ctx.translate(tx, ty);
  1341. ctx.rotate(-1.0 * angle.getRadians());
  1342. ctx.translate(-tx, -ty);
  1343. }
  1344. applyToPoint(point) {
  1345. var {
  1346. cx,
  1347. cy,
  1348. angle
  1349. } = this;
  1350. var rad = angle.getRadians();
  1351. point.applyTransform([1, 0, 0, 1, cx || 0.0, cy || 0.0 // this.p.y
  1352. ]);
  1353. point.applyTransform([Math.cos(rad), Math.sin(rad), -Math.sin(rad), Math.cos(rad), 0, 0]);
  1354. point.applyTransform([1, 0, 0, 1, -cx || 0.0, -cy || 0.0 // -this.p.y
  1355. ]);
  1356. }
  1357. }
  1358. class Scale {
  1359. constructor(_, scale, transformOrigin) {
  1360. this.type = 'scale';
  1361. this.scale = null;
  1362. this.originX = null;
  1363. this.originY = null;
  1364. var scaleSize = Point.parseScale(scale); // Workaround for node-canvas
  1365. if (scaleSize.x === 0 || scaleSize.y === 0) {
  1366. scaleSize.x = PSEUDO_ZERO;
  1367. scaleSize.y = PSEUDO_ZERO;
  1368. }
  1369. this.scale = scaleSize;
  1370. this.originX = transformOrigin[0];
  1371. this.originY = transformOrigin[1];
  1372. }
  1373. apply(ctx) {
  1374. var {
  1375. scale: {
  1376. x,
  1377. y
  1378. },
  1379. originX,
  1380. originY
  1381. } = this;
  1382. var tx = originX.getPixels('x');
  1383. var ty = originY.getPixels('y');
  1384. ctx.translate(tx, ty);
  1385. ctx.scale(x, y || x);
  1386. ctx.translate(-tx, -ty);
  1387. }
  1388. unapply(ctx) {
  1389. var {
  1390. scale: {
  1391. x,
  1392. y
  1393. },
  1394. originX,
  1395. originY
  1396. } = this;
  1397. var tx = originX.getPixels('x');
  1398. var ty = originY.getPixels('y');
  1399. ctx.translate(tx, ty);
  1400. ctx.scale(1.0 / x, 1.0 / y || x);
  1401. ctx.translate(-tx, -ty);
  1402. }
  1403. applyToPoint(point) {
  1404. var {
  1405. x,
  1406. y
  1407. } = this.scale;
  1408. point.applyTransform([x || 0.0, 0, 0, y || 0.0, 0, 0]);
  1409. }
  1410. }
  1411. class Matrix {
  1412. constructor(_, matrix, transformOrigin) {
  1413. this.type = 'matrix';
  1414. this.matrix = [];
  1415. this.originX = null;
  1416. this.originY = null;
  1417. this.matrix = toNumbers(matrix);
  1418. this.originX = transformOrigin[0];
  1419. this.originY = transformOrigin[1];
  1420. }
  1421. apply(ctx) {
  1422. var {
  1423. originX,
  1424. originY,
  1425. matrix
  1426. } = this;
  1427. var tx = originX.getPixels('x');
  1428. var ty = originY.getPixels('y');
  1429. ctx.translate(tx, ty);
  1430. ctx.transform(matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5]);
  1431. ctx.translate(-tx, -ty);
  1432. }
  1433. unapply(ctx) {
  1434. var {
  1435. originX,
  1436. originY,
  1437. matrix
  1438. } = this;
  1439. var a = matrix[0];
  1440. var b = matrix[2];
  1441. var c = matrix[4];
  1442. var d = matrix[1];
  1443. var e = matrix[3];
  1444. var f = matrix[5];
  1445. var g = 0.0;
  1446. var h = 0.0;
  1447. var i = 1.0;
  1448. var det = 1 / (a * (e * i - f * h) - b * (d * i - f * g) + c * (d * h - e * g));
  1449. var tx = originX.getPixels('x');
  1450. var ty = originY.getPixels('y');
  1451. ctx.translate(tx, ty);
  1452. ctx.transform(det * (e * i - f * h), det * (f * g - d * i), det * (c * h - b * i), det * (a * i - c * g), det * (b * f - c * e), det * (c * d - a * f));
  1453. ctx.translate(-tx, -ty);
  1454. }
  1455. applyToPoint(point) {
  1456. point.applyTransform(this.matrix);
  1457. }
  1458. }
  1459. class Skew extends Matrix {
  1460. constructor(document, skew, transformOrigin) {
  1461. super(document, skew, transformOrigin);
  1462. this.type = 'skew';
  1463. this.angle = null;
  1464. this.angle = new Property(document, 'angle', skew);
  1465. }
  1466. }
  1467. class SkewX extends Skew {
  1468. constructor(document, skew, transformOrigin) {
  1469. super(document, skew, transformOrigin);
  1470. this.type = 'skewX';
  1471. this.matrix = [1, 0, Math.tan(this.angle.getRadians()), 1, 0, 0];
  1472. }
  1473. }
  1474. class SkewY extends Skew {
  1475. constructor(document, skew, transformOrigin) {
  1476. super(document, skew, transformOrigin);
  1477. this.type = 'skewY';
  1478. this.matrix = [1, Math.tan(this.angle.getRadians()), 0, 1, 0, 0];
  1479. }
  1480. }
  1481. function parseTransforms(transform) {
  1482. return compressSpaces(transform).trim().replace(/\)([a-zA-Z])/g, ') $1').replace(/\)(\s?,\s?)/g, ') ').split(/\s(?=[a-z])/);
  1483. }
  1484. function parseTransform(transform) {
  1485. var [type, value] = transform.split('(');
  1486. return [type.trim(), value.trim().replace(')', '')];
  1487. }
  1488. class Transform {
  1489. constructor(document, transform, transformOrigin) {
  1490. this.document = document;
  1491. this.transforms = [];
  1492. var data = parseTransforms(transform);
  1493. data.forEach(transform => {
  1494. if (transform === 'none') {
  1495. return;
  1496. }
  1497. var [type, value] = parseTransform(transform);
  1498. var TransformType = Transform.transformTypes[type];
  1499. if (typeof TransformType !== 'undefined') {
  1500. this.transforms.push(new TransformType(this.document, value, transformOrigin));
  1501. }
  1502. });
  1503. }
  1504. static fromElement(document, element) {
  1505. var transformStyle = element.getStyle('transform', false, true);
  1506. var [transformOriginXProperty, transformOriginYProperty = transformOriginXProperty] = element.getStyle('transform-origin', false, true).split();
  1507. var transformOrigin = [transformOriginXProperty, transformOriginYProperty];
  1508. if (transformStyle.hasValue()) {
  1509. return new Transform(document, transformStyle.getString(), transformOrigin);
  1510. }
  1511. return null;
  1512. }
  1513. apply(ctx) {
  1514. var {
  1515. transforms
  1516. } = this;
  1517. var len = transforms.length;
  1518. for (var i = 0; i < len; i++) {
  1519. transforms[i].apply(ctx);
  1520. }
  1521. }
  1522. unapply(ctx) {
  1523. var {
  1524. transforms
  1525. } = this;
  1526. var len = transforms.length;
  1527. for (var i = len - 1; i >= 0; i--) {
  1528. transforms[i].unapply(ctx);
  1529. }
  1530. } // TODO: applyToPoint unused ... remove?
  1531. applyToPoint(point) {
  1532. var {
  1533. transforms
  1534. } = this;
  1535. var len = transforms.length;
  1536. for (var i = 0; i < len; i++) {
  1537. transforms[i].applyToPoint(point);
  1538. }
  1539. }
  1540. }
  1541. Transform.transformTypes = {
  1542. translate: Translate,
  1543. rotate: Rotate,
  1544. scale: Scale,
  1545. matrix: Matrix,
  1546. skewX: SkewX,
  1547. skewY: SkewY
  1548. };
  1549. class Element {
  1550. constructor(document, node) {
  1551. var captureTextNodes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  1552. this.document = document;
  1553. this.node = node;
  1554. this.captureTextNodes = captureTextNodes;
  1555. this.attributes = {};
  1556. this.styles = {};
  1557. this.stylesSpecificity = {};
  1558. this.animationFrozen = false;
  1559. this.animationFrozenValue = '';
  1560. this.parent = null;
  1561. this.children = [];
  1562. if (!node || node.nodeType !== 1) {
  1563. // ELEMENT_NODE
  1564. return;
  1565. } // add attributes
  1566. Array.from(node.attributes).forEach(attribute => {
  1567. var nodeName = normalizeAttributeName(attribute.nodeName);
  1568. this.attributes[nodeName] = new Property(document, nodeName, attribute.value);
  1569. });
  1570. this.addStylesFromStyleDefinition(); // add inline styles
  1571. if (this.getAttribute('style').hasValue()) {
  1572. var styles = this.getAttribute('style').getString().split(';').map(_ => _.trim());
  1573. styles.forEach(style => {
  1574. if (!style) {
  1575. return;
  1576. }
  1577. var [name, value] = style.split(':').map(_ => _.trim());
  1578. this.styles[name] = new Property(document, name, value);
  1579. });
  1580. }
  1581. var {
  1582. definitions
  1583. } = document;
  1584. var id = this.getAttribute('id'); // add id
  1585. if (id.hasValue()) {
  1586. if (!definitions[id.getString()]) {
  1587. definitions[id.getString()] = this;
  1588. }
  1589. }
  1590. Array.from(node.childNodes).forEach(childNode => {
  1591. if (childNode.nodeType === 1) {
  1592. this.addChild(childNode); // ELEMENT_NODE
  1593. } else if (captureTextNodes && (childNode.nodeType === 3 || childNode.nodeType === 4)) {
  1594. var textNode = document.createTextNode(childNode);
  1595. if (textNode.getText().length > 0) {
  1596. this.addChild(textNode); // TEXT_NODE
  1597. }
  1598. }
  1599. });
  1600. }
  1601. getAttribute(name) {
  1602. var createIfNotExists = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  1603. var attr = this.attributes[name];
  1604. if (!attr && createIfNotExists) {
  1605. var _attr = new Property(this.document, name, '');
  1606. this.attributes[name] = _attr;
  1607. return _attr;
  1608. }
  1609. return attr || Property.empty(this.document);
  1610. }
  1611. getHrefAttribute() {
  1612. for (var key in this.attributes) {
  1613. if (key === 'href' || key.endsWith(':href')) {
  1614. return this.attributes[key];
  1615. }
  1616. }
  1617. return Property.empty(this.document);
  1618. }
  1619. getStyle(name) {
  1620. var createIfNotExists = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  1621. var skipAncestors = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  1622. var style = this.styles[name];
  1623. if (style) {
  1624. return style;
  1625. }
  1626. var attr = this.getAttribute(name);
  1627. if (attr !== null && attr !== void 0 && attr.hasValue()) {
  1628. this.styles[name] = attr; // move up to me to cache
  1629. return attr;
  1630. }
  1631. if (!skipAncestors) {
  1632. var {
  1633. parent
  1634. } = this;
  1635. if (parent) {
  1636. var parentStyle = parent.getStyle(name);
  1637. if (parentStyle !== null && parentStyle !== void 0 && parentStyle.hasValue()) {
  1638. return parentStyle;
  1639. }
  1640. }
  1641. }
  1642. if (createIfNotExists) {
  1643. var _style = new Property(this.document, name, '');
  1644. this.styles[name] = _style;
  1645. return _style;
  1646. }
  1647. return style || Property.empty(this.document);
  1648. }
  1649. render(ctx) {
  1650. // don't render display=none
  1651. // don't render visibility=hidden
  1652. if (this.getStyle('display').getString() === 'none' || this.getStyle('visibility').getString() === 'hidden') {
  1653. return;
  1654. }
  1655. ctx.save();
  1656. if (this.getStyle('mask').hasValue()) {
  1657. // mask
  1658. var mask = this.getStyle('mask').getDefinition();
  1659. if (mask) {
  1660. this.applyEffects(ctx);
  1661. mask.apply(ctx, this);
  1662. }
  1663. } else if (this.getStyle('filter').getValue('none') !== 'none') {
  1664. // filter
  1665. var filter = this.getStyle('filter').getDefinition();
  1666. if (filter) {
  1667. this.applyEffects(ctx);
  1668. filter.apply(ctx, this);
  1669. }
  1670. } else {
  1671. this.setContext(ctx);
  1672. this.renderChildren(ctx);
  1673. this.clearContext(ctx);
  1674. }
  1675. ctx.restore();
  1676. }
  1677. setContext(_) {// NO RENDER
  1678. }
  1679. applyEffects(ctx) {
  1680. // transform
  1681. var transform = Transform.fromElement(this.document, this);
  1682. if (transform) {
  1683. transform.apply(ctx);
  1684. } // clip
  1685. var clipPathStyleProp = this.getStyle('clip-path', false, true);
  1686. if (clipPathStyleProp.hasValue()) {
  1687. var clip = clipPathStyleProp.getDefinition();
  1688. if (clip) {
  1689. clip.apply(ctx);
  1690. }
  1691. }
  1692. }
  1693. clearContext(_) {// NO RENDER
  1694. }
  1695. renderChildren(ctx) {
  1696. this.children.forEach(child => {
  1697. child.render(ctx);
  1698. });
  1699. }
  1700. addChild(childNode) {
  1701. var child = childNode instanceof Element ? childNode : this.document.createElement(childNode);
  1702. child.parent = this;
  1703. if (!Element.ignoreChildTypes.includes(child.type)) {
  1704. this.children.push(child);
  1705. }
  1706. }
  1707. matchesSelector(selector) {
  1708. var _node$getAttribute;
  1709. var {
  1710. node
  1711. } = this;
  1712. if (typeof node.matches === 'function') {
  1713. return node.matches(selector);
  1714. }
  1715. var styleClasses = (_node$getAttribute = node.getAttribute) === null || _node$getAttribute === void 0 ? void 0 : _node$getAttribute.call(node, 'class');
  1716. if (!styleClasses || styleClasses === '') {
  1717. return false;
  1718. }
  1719. return styleClasses.split(' ').some(styleClass => ".".concat(styleClass) === selector);
  1720. }
  1721. addStylesFromStyleDefinition() {
  1722. var {
  1723. styles,
  1724. stylesSpecificity
  1725. } = this.document;
  1726. for (var selector in styles) {
  1727. if (!selector.startsWith('@') && this.matchesSelector(selector)) {
  1728. var style = styles[selector];
  1729. var specificity = stylesSpecificity[selector];
  1730. if (style) {
  1731. for (var name in style) {
  1732. var existingSpecificity = this.stylesSpecificity[name];
  1733. if (typeof existingSpecificity === 'undefined') {
  1734. existingSpecificity = '000';
  1735. }
  1736. if (specificity >= existingSpecificity) {
  1737. this.styles[name] = style[name];
  1738. this.stylesSpecificity[name] = specificity;
  1739. }
  1740. }
  1741. }
  1742. }
  1743. }
  1744. }
  1745. removeStyles(element, ignoreStyles) {
  1746. var toRestore = ignoreStyles.reduce((toRestore, name) => {
  1747. var styleProp = element.getStyle(name);
  1748. if (!styleProp.hasValue()) {
  1749. return toRestore;
  1750. }
  1751. var value = styleProp.getString();
  1752. styleProp.setValue('');
  1753. return [...toRestore, [name, value]];
  1754. }, []);
  1755. return toRestore;
  1756. }
  1757. restoreStyles(element, styles) {
  1758. styles.forEach(_ref => {
  1759. var [name, value] = _ref;
  1760. element.getStyle(name, true).setValue(value);
  1761. });
  1762. }
  1763. isFirstChild() {
  1764. var _this$parent;
  1765. return ((_this$parent = this.parent) === null || _this$parent === void 0 ? void 0 : _this$parent.children.indexOf(this)) === 0;
  1766. }
  1767. }
  1768. Element.ignoreChildTypes = ['title'];
  1769. class UnknownElement extends Element {
  1770. constructor(document, node, captureTextNodes) {
  1771. super(document, node, captureTextNodes);
  1772. }
  1773. }
  1774. function wrapFontFamily(fontFamily) {
  1775. var trimmed = fontFamily.trim();
  1776. return /^('|")/.test(trimmed) ? trimmed : "\"".concat(trimmed, "\"");
  1777. }
  1778. function prepareFontFamily(fontFamily) {
  1779. return typeof process === 'undefined' ? fontFamily : fontFamily.trim().split(',').map(wrapFontFamily).join(',');
  1780. }
  1781. /**
  1782. * https://developer.mozilla.org/en-US/docs/Web/CSS/font-style
  1783. * @param fontStyle
  1784. * @returns CSS font style.
  1785. */
  1786. function prepareFontStyle(fontStyle) {
  1787. if (!fontStyle) {
  1788. return '';
  1789. }
  1790. var targetFontStyle = fontStyle.trim().toLowerCase();
  1791. switch (targetFontStyle) {
  1792. case 'normal':
  1793. case 'italic':
  1794. case 'oblique':
  1795. case 'inherit':
  1796. case 'initial':
  1797. case 'unset':
  1798. return targetFontStyle;
  1799. default:
  1800. if (/^oblique\s+(-|)\d+deg$/.test(targetFontStyle)) {
  1801. return targetFontStyle;
  1802. }
  1803. return '';
  1804. }
  1805. }
  1806. /**
  1807. * https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight
  1808. * @param fontWeight
  1809. * @returns CSS font weight.
  1810. */
  1811. function prepareFontWeight(fontWeight) {
  1812. if (!fontWeight) {
  1813. return '';
  1814. }
  1815. var targetFontWeight = fontWeight.trim().toLowerCase();
  1816. switch (targetFontWeight) {
  1817. case 'normal':
  1818. case 'bold':
  1819. case 'lighter':
  1820. case 'bolder':
  1821. case 'inherit':
  1822. case 'initial':
  1823. case 'unset':
  1824. return targetFontWeight;
  1825. default:
  1826. if (/^[\d.]+$/.test(targetFontWeight)) {
  1827. return targetFontWeight;
  1828. }
  1829. return '';
  1830. }
  1831. }
  1832. class Font {
  1833. constructor(fontStyle, fontVariant, fontWeight, fontSize, fontFamily, inherit) {
  1834. var inheritFont = inherit ? typeof inherit === 'string' ? Font.parse(inherit) : inherit : {};
  1835. this.fontFamily = fontFamily || inheritFont.fontFamily;
  1836. this.fontSize = fontSize || inheritFont.fontSize;
  1837. this.fontStyle = fontStyle || inheritFont.fontStyle;
  1838. this.fontWeight = fontWeight || inheritFont.fontWeight;
  1839. this.fontVariant = fontVariant || inheritFont.fontVariant;
  1840. }
  1841. static parse() {
  1842. var font = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
  1843. var inherit = arguments.length > 1 ? arguments[1] : undefined;
  1844. var fontStyle = '';
  1845. var fontVariant = '';
  1846. var fontWeight = '';
  1847. var fontSize = '';
  1848. var fontFamily = '';
  1849. var parts = compressSpaces(font).trim().split(' ');
  1850. var set = {
  1851. fontSize: false,
  1852. fontStyle: false,
  1853. fontWeight: false,
  1854. fontVariant: false
  1855. };
  1856. parts.forEach(part => {
  1857. switch (true) {
  1858. case !set.fontStyle && Font.styles.includes(part):
  1859. if (part !== 'inherit') {
  1860. fontStyle = part;
  1861. }
  1862. set.fontStyle = true;
  1863. break;
  1864. case !set.fontVariant && Font.variants.includes(part):
  1865. if (part !== 'inherit') {
  1866. fontVariant = part;
  1867. }
  1868. set.fontStyle = true;
  1869. set.fontVariant = true;
  1870. break;
  1871. case !set.fontWeight && Font.weights.includes(part):
  1872. if (part !== 'inherit') {
  1873. fontWeight = part;
  1874. }
  1875. set.fontStyle = true;
  1876. set.fontVariant = true;
  1877. set.fontWeight = true;
  1878. break;
  1879. case !set.fontSize:
  1880. if (part !== 'inherit') {
  1881. [fontSize] = part.split('/');
  1882. }
  1883. set.fontStyle = true;
  1884. set.fontVariant = true;
  1885. set.fontWeight = true;
  1886. set.fontSize = true;
  1887. break;
  1888. default:
  1889. if (part !== 'inherit') {
  1890. fontFamily += part;
  1891. }
  1892. }
  1893. });
  1894. return new Font(fontStyle, fontVariant, fontWeight, fontSize, fontFamily, inherit);
  1895. }
  1896. toString() {
  1897. return [prepareFontStyle(this.fontStyle), this.fontVariant, prepareFontWeight(this.fontWeight), this.fontSize, // Wrap fontFamily only on nodejs and only for canvas.ctx
  1898. prepareFontFamily(this.fontFamily)].join(' ').trim();
  1899. }
  1900. }
  1901. Font.styles = 'normal|italic|oblique|inherit';
  1902. Font.variants = 'normal|small-caps|inherit';
  1903. Font.weights = 'normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900|inherit';
  1904. class BoundingBox {
  1905. constructor() {
  1906. var x1 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : Number.NaN;
  1907. var y1 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Number.NaN;
  1908. var x2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : Number.NaN;
  1909. var y2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : Number.NaN;
  1910. this.x1 = x1;
  1911. this.y1 = y1;
  1912. this.x2 = x2;
  1913. this.y2 = y2;
  1914. this.addPoint(x1, y1);
  1915. this.addPoint(x2, y2);
  1916. }
  1917. get x() {
  1918. return this.x1;
  1919. }
  1920. get y() {
  1921. return this.y1;
  1922. }
  1923. get width() {
  1924. return this.x2 - this.x1;
  1925. }
  1926. get height() {
  1927. return this.y2 - this.y1;
  1928. }
  1929. addPoint(x, y) {
  1930. if (typeof x !== 'undefined') {
  1931. if (isNaN(this.x1) || isNaN(this.x2)) {
  1932. this.x1 = x;
  1933. this.x2 = x;
  1934. }
  1935. if (x < this.x1) {
  1936. this.x1 = x;
  1937. }
  1938. if (x > this.x2) {
  1939. this.x2 = x;
  1940. }
  1941. }
  1942. if (typeof y !== 'undefined') {
  1943. if (isNaN(this.y1) || isNaN(this.y2)) {
  1944. this.y1 = y;
  1945. this.y2 = y;
  1946. }
  1947. if (y < this.y1) {
  1948. this.y1 = y;
  1949. }
  1950. if (y > this.y2) {
  1951. this.y2 = y;
  1952. }
  1953. }
  1954. }
  1955. addX(x) {
  1956. this.addPoint(x, null);
  1957. }
  1958. addY(y) {
  1959. this.addPoint(null, y);
  1960. }
  1961. addBoundingBox(boundingBox) {
  1962. if (!boundingBox) {
  1963. return;
  1964. }
  1965. var {
  1966. x1,
  1967. y1,
  1968. x2,
  1969. y2
  1970. } = boundingBox;
  1971. this.addPoint(x1, y1);
  1972. this.addPoint(x2, y2);
  1973. }
  1974. sumCubic(t, p0, p1, p2, p3) {
  1975. return Math.pow(1 - t, 3) * p0 + 3 * Math.pow(1 - t, 2) * t * p1 + 3 * (1 - t) * Math.pow(t, 2) * p2 + Math.pow(t, 3) * p3;
  1976. }
  1977. bezierCurveAdd(forX, p0, p1, p2, p3) {
  1978. var b = 6 * p0 - 12 * p1 + 6 * p2;
  1979. var a = -3 * p0 + 9 * p1 - 9 * p2 + 3 * p3;
  1980. var c = 3 * p1 - 3 * p0;
  1981. if (a === 0) {
  1982. if (b === 0) {
  1983. return;
  1984. }
  1985. var t = -c / b;
  1986. if (0 < t && t < 1) {
  1987. if (forX) {
  1988. this.addX(this.sumCubic(t, p0, p1, p2, p3));
  1989. } else {
  1990. this.addY(this.sumCubic(t, p0, p1, p2, p3));
  1991. }
  1992. }
  1993. return;
  1994. }
  1995. var b2ac = Math.pow(b, 2) - 4 * c * a;
  1996. if (b2ac < 0) {
  1997. return;
  1998. }
  1999. var t1 = (-b + Math.sqrt(b2ac)) / (2 * a);
  2000. if (0 < t1 && t1 < 1) {
  2001. if (forX) {
  2002. this.addX(this.sumCubic(t1, p0, p1, p2, p3));
  2003. } else {
  2004. this.addY(this.sumCubic(t1, p0, p1, p2, p3));
  2005. }
  2006. }
  2007. var t2 = (-b - Math.sqrt(b2ac)) / (2 * a);
  2008. if (0 < t2 && t2 < 1) {
  2009. if (forX) {
  2010. this.addX(this.sumCubic(t2, p0, p1, p2, p3));
  2011. } else {
  2012. this.addY(this.sumCubic(t2, p0, p1, p2, p3));
  2013. }
  2014. }
  2015. } // from http://blog.hackers-cafe.net/2009/06/how-to-calculate-bezier-curves-bounding.html
  2016. addBezierCurve(p0x, p0y, p1x, p1y, p2x, p2y, p3x, p3y) {
  2017. this.addPoint(p0x, p0y);
  2018. this.addPoint(p3x, p3y);
  2019. this.bezierCurveAdd(true, p0x, p1x, p2x, p3x);
  2020. this.bezierCurveAdd(false, p0y, p1y, p2y, p3y);
  2021. }
  2022. addQuadraticCurve(p0x, p0y, p1x, p1y, p2x, p2y) {
  2023. var cp1x = p0x + 2 / 3 * (p1x - p0x); // CP1 = QP0 + 2/3 *(QP1-QP0)
  2024. var cp1y = p0y + 2 / 3 * (p1y - p0y); // CP1 = QP0 + 2/3 *(QP1-QP0)
  2025. var cp2x = cp1x + 1 / 3 * (p2x - p0x); // CP2 = CP1 + 1/3 *(QP2-QP0)
  2026. var cp2y = cp1y + 1 / 3 * (p2y - p0y); // CP2 = CP1 + 1/3 *(QP2-QP0)
  2027. this.addBezierCurve(p0x, p0y, cp1x, cp2x, cp1y, cp2y, p2x, p2y);
  2028. }
  2029. isPointInBox(x, y) {
  2030. var {
  2031. x1,
  2032. y1,
  2033. x2,
  2034. y2
  2035. } = this;
  2036. return x1 <= x && x <= x2 && y1 <= y && y <= y2;
  2037. }
  2038. }
  2039. class PathParser extends svg_pathdata__WEBPACK_IMPORTED_MODULE_17__["SVGPathData"] {
  2040. constructor(path) {
  2041. super(path // Fix spaces after signs.
  2042. .replace(/([+\-.])\s+/gm, '$1') // Remove invalid part.
  2043. .replace(/[^MmZzLlHhVvCcSsQqTtAae\d\s.,+-].*/g, ''));
  2044. this.control = null;
  2045. this.start = null;
  2046. this.current = null;
  2047. this.command = null;
  2048. this.commands = this.commands;
  2049. this.i = -1;
  2050. this.previousCommand = null;
  2051. this.points = [];
  2052. this.angles = [];
  2053. }
  2054. reset() {
  2055. this.i = -1;
  2056. this.command = null;
  2057. this.previousCommand = null;
  2058. this.start = new Point(0, 0);
  2059. this.control = new Point(0, 0);
  2060. this.current = new Point(0, 0);
  2061. this.points = [];
  2062. this.angles = [];
  2063. }
  2064. isEnd() {
  2065. var {
  2066. i,
  2067. commands
  2068. } = this;
  2069. return i >= commands.length - 1;
  2070. }
  2071. next() {
  2072. var command = this.commands[++this.i];
  2073. this.previousCommand = this.command;
  2074. this.command = command;
  2075. return command;
  2076. }
  2077. getPoint() {
  2078. var xProp = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'x';
  2079. var yProp = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'y';
  2080. var point = new Point(this.command[xProp], this.command[yProp]);
  2081. return this.makeAbsolute(point);
  2082. }
  2083. getAsControlPoint(xProp, yProp) {
  2084. var point = this.getPoint(xProp, yProp);
  2085. this.control = point;
  2086. return point;
  2087. }
  2088. getAsCurrentPoint(xProp, yProp) {
  2089. var point = this.getPoint(xProp, yProp);
  2090. this.current = point;
  2091. return point;
  2092. }
  2093. getReflectedControlPoint() {
  2094. var previousCommand = this.previousCommand.type;
  2095. if (previousCommand !== svg_pathdata__WEBPACK_IMPORTED_MODULE_17__["SVGPathData"].CURVE_TO && previousCommand !== svg_pathdata__WEBPACK_IMPORTED_MODULE_17__["SVGPathData"].SMOOTH_CURVE_TO && previousCommand !== svg_pathdata__WEBPACK_IMPORTED_MODULE_17__["SVGPathData"].QUAD_TO && previousCommand !== svg_pathdata__WEBPACK_IMPORTED_MODULE_17__["SVGPathData"].SMOOTH_QUAD_TO) {
  2096. return this.current;
  2097. } // reflect point
  2098. var {
  2099. current: {
  2100. x: cx,
  2101. y: cy
  2102. },
  2103. control: {
  2104. x: ox,
  2105. y: oy
  2106. }
  2107. } = this;
  2108. var point = new Point(2 * cx - ox, 2 * cy - oy);
  2109. return point;
  2110. }
  2111. makeAbsolute(point) {
  2112. if (this.command.relative) {
  2113. var {
  2114. x,
  2115. y
  2116. } = this.current;
  2117. point.x += x;
  2118. point.y += y;
  2119. }
  2120. return point;
  2121. }
  2122. addMarker(point, from, priorTo) {
  2123. var {
  2124. points,
  2125. angles
  2126. } = this; // if the last angle isn't filled in because we didn't have this point yet ...
  2127. if (priorTo && angles.length > 0 && !angles[angles.length - 1]) {
  2128. angles[angles.length - 1] = points[points.length - 1].angleTo(priorTo);
  2129. }
  2130. this.addMarkerAngle(point, from ? from.angleTo(point) : null);
  2131. }
  2132. addMarkerAngle(point, angle) {
  2133. this.points.push(point);
  2134. this.angles.push(angle);
  2135. }
  2136. getMarkerPoints() {
  2137. return this.points;
  2138. }
  2139. getMarkerAngles() {
  2140. var {
  2141. angles
  2142. } = this;
  2143. var len = angles.length;
  2144. for (var i = 0; i < len; i++) {
  2145. if (!angles[i]) {
  2146. for (var j = i + 1; j < len; j++) {
  2147. if (angles[j]) {
  2148. angles[i] = angles[j];
  2149. break;
  2150. }
  2151. }
  2152. }
  2153. }
  2154. return angles;
  2155. }
  2156. }
  2157. class RenderedElement extends Element {
  2158. constructor() {
  2159. super(...arguments);
  2160. this.modifiedEmSizeStack = false;
  2161. }
  2162. calculateOpacity() {
  2163. var opacity = 1.0; // eslint-disable-next-line @typescript-eslint/no-this-alias, consistent-this
  2164. var element = this;
  2165. while (element) {
  2166. var opacityStyle = element.getStyle('opacity', false, true); // no ancestors on style call
  2167. if (opacityStyle.hasValue(true)) {
  2168. opacity *= opacityStyle.getNumber();
  2169. }
  2170. element = element.parent;
  2171. }
  2172. return opacity;
  2173. }
  2174. setContext(ctx) {
  2175. var fromMeasure = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  2176. if (!fromMeasure) {
  2177. // causes stack overflow when measuring text with gradients
  2178. // fill
  2179. var fillStyleProp = this.getStyle('fill');
  2180. var fillOpacityStyleProp = this.getStyle('fill-opacity');
  2181. var strokeStyleProp = this.getStyle('stroke');
  2182. var strokeOpacityProp = this.getStyle('stroke-opacity');
  2183. if (fillStyleProp.isUrlDefinition()) {
  2184. var fillStyle = fillStyleProp.getFillStyleDefinition(this, fillOpacityStyleProp);
  2185. if (fillStyle) {
  2186. ctx.fillStyle = fillStyle;
  2187. }
  2188. } else if (fillStyleProp.hasValue()) {
  2189. if (fillStyleProp.getString() === 'currentColor') {
  2190. fillStyleProp.setValue(this.getStyle('color').getColor());
  2191. }
  2192. var _fillStyle = fillStyleProp.getColor();
  2193. if (_fillStyle !== 'inherit') {
  2194. ctx.fillStyle = _fillStyle === 'none' ? 'rgba(0,0,0,0)' : _fillStyle;
  2195. }
  2196. }
  2197. if (fillOpacityStyleProp.hasValue()) {
  2198. var _fillStyle2 = new Property(this.document, 'fill', ctx.fillStyle).addOpacity(fillOpacityStyleProp).getColor();
  2199. ctx.fillStyle = _fillStyle2;
  2200. } // stroke
  2201. if (strokeStyleProp.isUrlDefinition()) {
  2202. var strokeStyle = strokeStyleProp.getFillStyleDefinition(this, strokeOpacityProp);
  2203. if (strokeStyle) {
  2204. ctx.strokeStyle = strokeStyle;
  2205. }
  2206. } else if (strokeStyleProp.hasValue()) {
  2207. if (strokeStyleProp.getString() === 'currentColor') {
  2208. strokeStyleProp.setValue(this.getStyle('color').getColor());
  2209. }
  2210. var _strokeStyle = strokeStyleProp.getString();
  2211. if (_strokeStyle !== 'inherit') {
  2212. ctx.strokeStyle = _strokeStyle === 'none' ? 'rgba(0,0,0,0)' : _strokeStyle;
  2213. }
  2214. }
  2215. if (strokeOpacityProp.hasValue()) {
  2216. var _strokeStyle2 = new Property(this.document, 'stroke', ctx.strokeStyle).addOpacity(strokeOpacityProp).getString();
  2217. ctx.strokeStyle = _strokeStyle2;
  2218. }
  2219. var strokeWidthStyleProp = this.getStyle('stroke-width');
  2220. if (strokeWidthStyleProp.hasValue()) {
  2221. var newLineWidth = strokeWidthStyleProp.getPixels();
  2222. ctx.lineWidth = !newLineWidth ? PSEUDO_ZERO // browsers don't respect 0 (or node-canvas? :-)
  2223. : newLineWidth;
  2224. }
  2225. var strokeLinecapStyleProp = this.getStyle('stroke-linecap');
  2226. var strokeLinejoinStyleProp = this.getStyle('stroke-linejoin');
  2227. var strokeMiterlimitProp = this.getStyle('stroke-miterlimit'); // NEED TEST
  2228. // const pointOrderStyleProp = this.getStyle('paint-order');
  2229. var strokeDasharrayStyleProp = this.getStyle('stroke-dasharray');
  2230. var strokeDashoffsetProp = this.getStyle('stroke-dashoffset');
  2231. if (strokeLinecapStyleProp.hasValue()) {
  2232. ctx.lineCap = strokeLinecapStyleProp.getString();
  2233. }
  2234. if (strokeLinejoinStyleProp.hasValue()) {
  2235. ctx.lineJoin = strokeLinejoinStyleProp.getString();
  2236. }
  2237. if (strokeMiterlimitProp.hasValue()) {
  2238. ctx.miterLimit = strokeMiterlimitProp.getNumber();
  2239. } // NEED TEST
  2240. // if (pointOrderStyleProp.hasValue()) {
  2241. // // ?
  2242. // ctx.paintOrder = pointOrderStyleProp.getValue();
  2243. // }
  2244. if (strokeDasharrayStyleProp.hasValue() && strokeDasharrayStyleProp.getString() !== 'none') {
  2245. var gaps = toNumbers(strokeDasharrayStyleProp.getString());
  2246. if (typeof ctx.setLineDash !== 'undefined') {
  2247. ctx.setLineDash(gaps);
  2248. } else // @ts-expect-error Handle browser prefix.
  2249. if (typeof ctx.webkitLineDash !== 'undefined') {
  2250. // @ts-expect-error Handle browser prefix.
  2251. ctx.webkitLineDash = gaps;
  2252. } else // @ts-expect-error Handle browser prefix.
  2253. if (typeof ctx.mozDash !== 'undefined' && !(gaps.length === 1 && gaps[0] === 0)) {
  2254. // @ts-expect-error Handle browser prefix.
  2255. ctx.mozDash = gaps;
  2256. }
  2257. var offset = strokeDashoffsetProp.getPixels();
  2258. if (typeof ctx.lineDashOffset !== 'undefined') {
  2259. ctx.lineDashOffset = offset;
  2260. } else // @ts-expect-error Handle browser prefix.
  2261. if (typeof ctx.webkitLineDashOffset !== 'undefined') {
  2262. // @ts-expect-error Handle browser prefix.
  2263. ctx.webkitLineDashOffset = offset;
  2264. } else // @ts-expect-error Handle browser prefix.
  2265. if (typeof ctx.mozDashOffset !== 'undefined') {
  2266. // @ts-expect-error Handle browser prefix.
  2267. ctx.mozDashOffset = offset;
  2268. }
  2269. }
  2270. } // font
  2271. this.modifiedEmSizeStack = false;
  2272. if (typeof ctx.font !== 'undefined') {
  2273. var fontStyleProp = this.getStyle('font');
  2274. var fontStyleStyleProp = this.getStyle('font-style');
  2275. var fontVariantStyleProp = this.getStyle('font-variant');
  2276. var fontWeightStyleProp = this.getStyle('font-weight');
  2277. var fontSizeStyleProp = this.getStyle('font-size');
  2278. var fontFamilyStyleProp = this.getStyle('font-family');
  2279. var font = new Font(fontStyleStyleProp.getString(), fontVariantStyleProp.getString(), fontWeightStyleProp.getString(), fontSizeStyleProp.hasValue() ? "".concat(fontSizeStyleProp.getPixels(true), "px") : '', fontFamilyStyleProp.getString(), Font.parse(fontStyleProp.getString(), ctx.font));
  2280. fontStyleStyleProp.setValue(font.fontStyle);
  2281. fontVariantStyleProp.setValue(font.fontVariant);
  2282. fontWeightStyleProp.setValue(font.fontWeight);
  2283. fontSizeStyleProp.setValue(font.fontSize);
  2284. fontFamilyStyleProp.setValue(font.fontFamily);
  2285. ctx.font = font.toString();
  2286. if (fontSizeStyleProp.isPixels()) {
  2287. this.document.emSize = fontSizeStyleProp.getPixels();
  2288. this.modifiedEmSizeStack = true;
  2289. }
  2290. }
  2291. if (!fromMeasure) {
  2292. // effects
  2293. this.applyEffects(ctx); // opacity
  2294. ctx.globalAlpha = this.calculateOpacity();
  2295. }
  2296. }
  2297. clearContext(ctx) {
  2298. super.clearContext(ctx);
  2299. if (this.modifiedEmSizeStack) {
  2300. this.document.popEmSize();
  2301. }
  2302. }
  2303. }
  2304. class PathElement extends RenderedElement {
  2305. constructor(document, node, captureTextNodes) {
  2306. super(document, node, captureTextNodes);
  2307. this.type = 'path';
  2308. this.pathParser = null;
  2309. this.pathParser = new PathParser(this.getAttribute('d').getString());
  2310. }
  2311. path(ctx) {
  2312. var {
  2313. pathParser
  2314. } = this;
  2315. var boundingBox = new BoundingBox();
  2316. pathParser.reset();
  2317. if (ctx) {
  2318. ctx.beginPath();
  2319. }
  2320. while (!pathParser.isEnd()) {
  2321. switch (pathParser.next().type) {
  2322. case PathParser.MOVE_TO:
  2323. this.pathM(ctx, boundingBox);
  2324. break;
  2325. case PathParser.LINE_TO:
  2326. this.pathL(ctx, boundingBox);
  2327. break;
  2328. case PathParser.HORIZ_LINE_TO:
  2329. this.pathH(ctx, boundingBox);
  2330. break;
  2331. case PathParser.VERT_LINE_TO:
  2332. this.pathV(ctx, boundingBox);
  2333. break;
  2334. case PathParser.CURVE_TO:
  2335. this.pathC(ctx, boundingBox);
  2336. break;
  2337. case PathParser.SMOOTH_CURVE_TO:
  2338. this.pathS(ctx, boundingBox);
  2339. break;
  2340. case PathParser.QUAD_TO:
  2341. this.pathQ(ctx, boundingBox);
  2342. break;
  2343. case PathParser.SMOOTH_QUAD_TO:
  2344. this.pathT(ctx, boundingBox);
  2345. break;
  2346. case PathParser.ARC:
  2347. this.pathA(ctx, boundingBox);
  2348. break;
  2349. case PathParser.CLOSE_PATH:
  2350. this.pathZ(ctx, boundingBox);
  2351. break;
  2352. }
  2353. }
  2354. return boundingBox;
  2355. }
  2356. getBoundingBox(_) {
  2357. return this.path();
  2358. }
  2359. getMarkers() {
  2360. var {
  2361. pathParser
  2362. } = this;
  2363. var points = pathParser.getMarkerPoints();
  2364. var angles = pathParser.getMarkerAngles();
  2365. var markers = points.map((point, i) => [point, angles[i]]);
  2366. return markers;
  2367. }
  2368. renderChildren(ctx) {
  2369. this.path(ctx);
  2370. this.document.screen.mouse.checkPath(this, ctx);
  2371. var fillRuleStyleProp = this.getStyle('fill-rule');
  2372. if (ctx.fillStyle !== '') {
  2373. if (fillRuleStyleProp.getString('inherit') !== 'inherit') {
  2374. ctx.fill(fillRuleStyleProp.getString());
  2375. } else {
  2376. ctx.fill();
  2377. }
  2378. }
  2379. if (ctx.strokeStyle !== '') {
  2380. if (this.getAttribute('vector-effect').getString() === 'non-scaling-stroke') {
  2381. ctx.save();
  2382. ctx.setTransform(1, 0, 0, 1, 0, 0);
  2383. ctx.stroke();
  2384. ctx.restore();
  2385. } else {
  2386. ctx.stroke();
  2387. }
  2388. }
  2389. var markers = this.getMarkers();
  2390. if (markers) {
  2391. var markersLastIndex = markers.length - 1;
  2392. var markerStartStyleProp = this.getStyle('marker-start');
  2393. var markerMidStyleProp = this.getStyle('marker-mid');
  2394. var markerEndStyleProp = this.getStyle('marker-end');
  2395. if (markerStartStyleProp.isUrlDefinition()) {
  2396. var marker = markerStartStyleProp.getDefinition();
  2397. var [point, angle] = markers[0];
  2398. marker.render(ctx, point, angle);
  2399. }
  2400. if (markerMidStyleProp.isUrlDefinition()) {
  2401. var _marker = markerMidStyleProp.getDefinition();
  2402. for (var i = 1; i < markersLastIndex; i++) {
  2403. var [_point, _angle] = markers[i];
  2404. _marker.render(ctx, _point, _angle);
  2405. }
  2406. }
  2407. if (markerEndStyleProp.isUrlDefinition()) {
  2408. var _marker2 = markerEndStyleProp.getDefinition();
  2409. var [_point2, _angle2] = markers[markersLastIndex];
  2410. _marker2.render(ctx, _point2, _angle2);
  2411. }
  2412. }
  2413. }
  2414. static pathM(pathParser) {
  2415. var point = pathParser.getAsCurrentPoint();
  2416. pathParser.start = pathParser.current;
  2417. return {
  2418. point
  2419. };
  2420. }
  2421. pathM(ctx, boundingBox) {
  2422. var {
  2423. pathParser
  2424. } = this;
  2425. var {
  2426. point
  2427. } = PathElement.pathM(pathParser);
  2428. var {
  2429. x,
  2430. y
  2431. } = point;
  2432. pathParser.addMarker(point);
  2433. boundingBox.addPoint(x, y);
  2434. if (ctx) {
  2435. ctx.moveTo(x, y);
  2436. }
  2437. }
  2438. static pathL(pathParser) {
  2439. var {
  2440. current
  2441. } = pathParser;
  2442. var point = pathParser.getAsCurrentPoint();
  2443. return {
  2444. current,
  2445. point
  2446. };
  2447. }
  2448. pathL(ctx, boundingBox) {
  2449. var {
  2450. pathParser
  2451. } = this;
  2452. var {
  2453. current,
  2454. point
  2455. } = PathElement.pathL(pathParser);
  2456. var {
  2457. x,
  2458. y
  2459. } = point;
  2460. pathParser.addMarker(point, current);
  2461. boundingBox.addPoint(x, y);
  2462. if (ctx) {
  2463. ctx.lineTo(x, y);
  2464. }
  2465. }
  2466. static pathH(pathParser) {
  2467. var {
  2468. current,
  2469. command
  2470. } = pathParser;
  2471. var point = new Point((command.relative ? current.x : 0) + command.x, current.y);
  2472. pathParser.current = point;
  2473. return {
  2474. current,
  2475. point
  2476. };
  2477. }
  2478. pathH(ctx, boundingBox) {
  2479. var {
  2480. pathParser
  2481. } = this;
  2482. var {
  2483. current,
  2484. point
  2485. } = PathElement.pathH(pathParser);
  2486. var {
  2487. x,
  2488. y
  2489. } = point;
  2490. pathParser.addMarker(point, current);
  2491. boundingBox.addPoint(x, y);
  2492. if (ctx) {
  2493. ctx.lineTo(x, y);
  2494. }
  2495. }
  2496. static pathV(pathParser) {
  2497. var {
  2498. current,
  2499. command
  2500. } = pathParser;
  2501. var point = new Point(current.x, (command.relative ? current.y : 0) + command.y);
  2502. pathParser.current = point;
  2503. return {
  2504. current,
  2505. point
  2506. };
  2507. }
  2508. pathV(ctx, boundingBox) {
  2509. var {
  2510. pathParser
  2511. } = this;
  2512. var {
  2513. current,
  2514. point
  2515. } = PathElement.pathV(pathParser);
  2516. var {
  2517. x,
  2518. y
  2519. } = point;
  2520. pathParser.addMarker(point, current);
  2521. boundingBox.addPoint(x, y);
  2522. if (ctx) {
  2523. ctx.lineTo(x, y);
  2524. }
  2525. }
  2526. static pathC(pathParser) {
  2527. var {
  2528. current
  2529. } = pathParser;
  2530. var point = pathParser.getPoint('x1', 'y1');
  2531. var controlPoint = pathParser.getAsControlPoint('x2', 'y2');
  2532. var currentPoint = pathParser.getAsCurrentPoint();
  2533. return {
  2534. current,
  2535. point,
  2536. controlPoint,
  2537. currentPoint
  2538. };
  2539. }
  2540. pathC(ctx, boundingBox) {
  2541. var {
  2542. pathParser
  2543. } = this;
  2544. var {
  2545. current,
  2546. point,
  2547. controlPoint,
  2548. currentPoint
  2549. } = PathElement.pathC(pathParser);
  2550. pathParser.addMarker(currentPoint, controlPoint, point);
  2551. boundingBox.addBezierCurve(current.x, current.y, point.x, point.y, controlPoint.x, controlPoint.y, currentPoint.x, currentPoint.y);
  2552. if (ctx) {
  2553. ctx.bezierCurveTo(point.x, point.y, controlPoint.x, controlPoint.y, currentPoint.x, currentPoint.y);
  2554. }
  2555. }
  2556. static pathS(pathParser) {
  2557. var {
  2558. current
  2559. } = pathParser;
  2560. var point = pathParser.getReflectedControlPoint();
  2561. var controlPoint = pathParser.getAsControlPoint('x2', 'y2');
  2562. var currentPoint = pathParser.getAsCurrentPoint();
  2563. return {
  2564. current,
  2565. point,
  2566. controlPoint,
  2567. currentPoint
  2568. };
  2569. }
  2570. pathS(ctx, boundingBox) {
  2571. var {
  2572. pathParser
  2573. } = this;
  2574. var {
  2575. current,
  2576. point,
  2577. controlPoint,
  2578. currentPoint
  2579. } = PathElement.pathS(pathParser);
  2580. pathParser.addMarker(currentPoint, controlPoint, point);
  2581. boundingBox.addBezierCurve(current.x, current.y, point.x, point.y, controlPoint.x, controlPoint.y, currentPoint.x, currentPoint.y);
  2582. if (ctx) {
  2583. ctx.bezierCurveTo(point.x, point.y, controlPoint.x, controlPoint.y, currentPoint.x, currentPoint.y);
  2584. }
  2585. }
  2586. static pathQ(pathParser) {
  2587. var {
  2588. current
  2589. } = pathParser;
  2590. var controlPoint = pathParser.getAsControlPoint('x1', 'y1');
  2591. var currentPoint = pathParser.getAsCurrentPoint();
  2592. return {
  2593. current,
  2594. controlPoint,
  2595. currentPoint
  2596. };
  2597. }
  2598. pathQ(ctx, boundingBox) {
  2599. var {
  2600. pathParser
  2601. } = this;
  2602. var {
  2603. current,
  2604. controlPoint,
  2605. currentPoint
  2606. } = PathElement.pathQ(pathParser);
  2607. pathParser.addMarker(currentPoint, controlPoint, controlPoint);
  2608. boundingBox.addQuadraticCurve(current.x, current.y, controlPoint.x, controlPoint.y, currentPoint.x, currentPoint.y);
  2609. if (ctx) {
  2610. ctx.quadraticCurveTo(controlPoint.x, controlPoint.y, currentPoint.x, currentPoint.y);
  2611. }
  2612. }
  2613. static pathT(pathParser) {
  2614. var {
  2615. current
  2616. } = pathParser;
  2617. var controlPoint = pathParser.getReflectedControlPoint();
  2618. pathParser.control = controlPoint;
  2619. var currentPoint = pathParser.getAsCurrentPoint();
  2620. return {
  2621. current,
  2622. controlPoint,
  2623. currentPoint
  2624. };
  2625. }
  2626. pathT(ctx, boundingBox) {
  2627. var {
  2628. pathParser
  2629. } = this;
  2630. var {
  2631. current,
  2632. controlPoint,
  2633. currentPoint
  2634. } = PathElement.pathT(pathParser);
  2635. pathParser.addMarker(currentPoint, controlPoint, controlPoint);
  2636. boundingBox.addQuadraticCurve(current.x, current.y, controlPoint.x, controlPoint.y, currentPoint.x, currentPoint.y);
  2637. if (ctx) {
  2638. ctx.quadraticCurveTo(controlPoint.x, controlPoint.y, currentPoint.x, currentPoint.y);
  2639. }
  2640. }
  2641. static pathA(pathParser) {
  2642. var {
  2643. current,
  2644. command
  2645. } = pathParser;
  2646. var {
  2647. rX,
  2648. rY,
  2649. xRot,
  2650. lArcFlag,
  2651. sweepFlag
  2652. } = command;
  2653. var xAxisRotation = xRot * (Math.PI / 180.0);
  2654. var currentPoint = pathParser.getAsCurrentPoint(); // Conversion from endpoint to center parameterization
  2655. // http://www.w3.org/TR/SVG11/implnote.html#ArcImplementationNotes
  2656. // x1', y1'
  2657. var currp = new Point(Math.cos(xAxisRotation) * (current.x - currentPoint.x) / 2.0 + Math.sin(xAxisRotation) * (current.y - currentPoint.y) / 2.0, -Math.sin(xAxisRotation) * (current.x - currentPoint.x) / 2.0 + Math.cos(xAxisRotation) * (current.y - currentPoint.y) / 2.0); // adjust radii
  2658. var l = Math.pow(currp.x, 2) / Math.pow(rX, 2) + Math.pow(currp.y, 2) / Math.pow(rY, 2);
  2659. if (l > 1) {
  2660. rX *= Math.sqrt(l);
  2661. rY *= Math.sqrt(l);
  2662. } // cx', cy'
  2663. var s = (lArcFlag === sweepFlag ? -1 : 1) * Math.sqrt((Math.pow(rX, 2) * Math.pow(rY, 2) - Math.pow(rX, 2) * Math.pow(currp.y, 2) - Math.pow(rY, 2) * Math.pow(currp.x, 2)) / (Math.pow(rX, 2) * Math.pow(currp.y, 2) + Math.pow(rY, 2) * Math.pow(currp.x, 2)));
  2664. if (isNaN(s)) {
  2665. s = 0;
  2666. }
  2667. var cpp = new Point(s * rX * currp.y / rY, s * -rY * currp.x / rX); // cx, cy
  2668. var centp = new Point((current.x + currentPoint.x) / 2.0 + Math.cos(xAxisRotation) * cpp.x - Math.sin(xAxisRotation) * cpp.y, (current.y + currentPoint.y) / 2.0 + Math.sin(xAxisRotation) * cpp.x + Math.cos(xAxisRotation) * cpp.y); // initial angle
  2669. var a1 = vectorsAngle([1, 0], [(currp.x - cpp.x) / rX, (currp.y - cpp.y) / rY]); // θ1
  2670. // angle delta
  2671. var u = [(currp.x - cpp.x) / rX, (currp.y - cpp.y) / rY];
  2672. var v = [(-currp.x - cpp.x) / rX, (-currp.y - cpp.y) / rY];
  2673. var ad = vectorsAngle(u, v); // Δθ
  2674. if (vectorsRatio(u, v) <= -1) {
  2675. ad = Math.PI;
  2676. }
  2677. if (vectorsRatio(u, v) >= 1) {
  2678. ad = 0;
  2679. }
  2680. return {
  2681. currentPoint,
  2682. rX,
  2683. rY,
  2684. sweepFlag,
  2685. xAxisRotation,
  2686. centp,
  2687. a1,
  2688. ad
  2689. };
  2690. }
  2691. pathA(ctx, boundingBox) {
  2692. var {
  2693. pathParser
  2694. } = this;
  2695. var {
  2696. currentPoint,
  2697. rX,
  2698. rY,
  2699. sweepFlag,
  2700. xAxisRotation,
  2701. centp,
  2702. a1,
  2703. ad
  2704. } = PathElement.pathA(pathParser); // for markers
  2705. var dir = 1 - sweepFlag ? 1.0 : -1.0;
  2706. var ah = a1 + dir * (ad / 2.0);
  2707. var halfWay = new Point(centp.x + rX * Math.cos(ah), centp.y + rY * Math.sin(ah));
  2708. pathParser.addMarkerAngle(halfWay, ah - dir * Math.PI / 2);
  2709. pathParser.addMarkerAngle(currentPoint, ah - dir * Math.PI);
  2710. boundingBox.addPoint(currentPoint.x, currentPoint.y); // TODO: this is too naive, make it better
  2711. if (ctx && !isNaN(a1) && !isNaN(ad)) {
  2712. var r = rX > rY ? rX : rY;
  2713. var sx = rX > rY ? 1 : rX / rY;
  2714. var sy = rX > rY ? rY / rX : 1;
  2715. ctx.translate(centp.x, centp.y);
  2716. ctx.rotate(xAxisRotation);
  2717. ctx.scale(sx, sy);
  2718. ctx.arc(0, 0, r, a1, a1 + ad, Boolean(1 - sweepFlag));
  2719. ctx.scale(1 / sx, 1 / sy);
  2720. ctx.rotate(-xAxisRotation);
  2721. ctx.translate(-centp.x, -centp.y);
  2722. }
  2723. }
  2724. static pathZ(pathParser) {
  2725. pathParser.current = pathParser.start;
  2726. }
  2727. pathZ(ctx, boundingBox) {
  2728. PathElement.pathZ(this.pathParser);
  2729. if (ctx) {
  2730. // only close path if it is not a straight line
  2731. if (boundingBox.x1 !== boundingBox.x2 && boundingBox.y1 !== boundingBox.y2) {
  2732. ctx.closePath();
  2733. }
  2734. }
  2735. }
  2736. }
  2737. class GlyphElement extends PathElement {
  2738. constructor(document, node, captureTextNodes) {
  2739. super(document, node, captureTextNodes);
  2740. this.type = 'glyph';
  2741. this.horizAdvX = this.getAttribute('horiz-adv-x').getNumber();
  2742. this.unicode = this.getAttribute('unicode').getString();
  2743. this.arabicForm = this.getAttribute('arabic-form').getString();
  2744. }
  2745. }
  2746. class TextElement extends RenderedElement {
  2747. constructor(document, node, captureTextNodes) {
  2748. super(document, node, new.target === TextElement ? true : captureTextNodes);
  2749. this.type = 'text';
  2750. this.x = 0;
  2751. this.y = 0;
  2752. this.measureCache = -1;
  2753. }
  2754. setContext(ctx) {
  2755. var fromMeasure = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  2756. super.setContext(ctx, fromMeasure);
  2757. var textBaseline = this.getStyle('dominant-baseline').getTextBaseline() || this.getStyle('alignment-baseline').getTextBaseline();
  2758. if (textBaseline) {
  2759. ctx.textBaseline = textBaseline;
  2760. }
  2761. }
  2762. initializeCoordinates() {
  2763. this.x = 0;
  2764. this.y = 0;
  2765. this.leafTexts = [];
  2766. this.textChunkStart = 0;
  2767. this.minX = Number.POSITIVE_INFINITY;
  2768. this.maxX = Number.NEGATIVE_INFINITY;
  2769. }
  2770. getBoundingBox(ctx) {
  2771. if (this.type !== 'text') {
  2772. return this.getTElementBoundingBox(ctx);
  2773. } // first, calculate child positions
  2774. this.initializeCoordinates();
  2775. this.adjustChildCoordinatesRecursive(ctx);
  2776. var boundingBox = null; // then calculate bounding box
  2777. this.children.forEach((_, i) => {
  2778. var childBoundingBox = this.getChildBoundingBox(ctx, this, this, i);
  2779. if (!boundingBox) {
  2780. boundingBox = childBoundingBox;
  2781. } else {
  2782. boundingBox.addBoundingBox(childBoundingBox);
  2783. }
  2784. });
  2785. return boundingBox;
  2786. }
  2787. getFontSize() {
  2788. var {
  2789. document,
  2790. parent
  2791. } = this;
  2792. var inheritFontSize = Font.parse(document.ctx.font).fontSize;
  2793. var fontSize = parent.getStyle('font-size').getNumber(inheritFontSize);
  2794. return fontSize;
  2795. }
  2796. getTElementBoundingBox(ctx) {
  2797. var fontSize = this.getFontSize();
  2798. return new BoundingBox(this.x, this.y - fontSize, this.x + this.measureText(ctx), this.y);
  2799. }
  2800. getGlyph(font, text, i) {
  2801. var char = text[i];
  2802. var glyph = null;
  2803. if (font.isArabic) {
  2804. var len = text.length;
  2805. var prevChar = text[i - 1];
  2806. var nextChar = text[i + 1];
  2807. var arabicForm = 'isolated';
  2808. if ((i === 0 || prevChar === ' ') && i < len - 1 && nextChar !== ' ') {
  2809. arabicForm = 'terminal';
  2810. }
  2811. if (i > 0 && prevChar !== ' ' && i < len - 1 && nextChar !== ' ') {
  2812. arabicForm = 'medial';
  2813. }
  2814. if (i > 0 && prevChar !== ' ' && (i === len - 1 || nextChar === ' ')) {
  2815. arabicForm = 'initial';
  2816. }
  2817. if (typeof font.glyphs[char] !== 'undefined') {
  2818. // NEED TEST
  2819. var maybeGlyph = font.glyphs[char];
  2820. glyph = maybeGlyph instanceof GlyphElement ? maybeGlyph : maybeGlyph[arabicForm];
  2821. }
  2822. } else {
  2823. glyph = font.glyphs[char];
  2824. }
  2825. if (!glyph) {
  2826. glyph = font.missingGlyph;
  2827. }
  2828. return glyph;
  2829. }
  2830. getText() {
  2831. return '';
  2832. }
  2833. getTextFromNode(node) {
  2834. var textNode = node || this.node;
  2835. var childNodes = Array.from(textNode.parentNode.childNodes);
  2836. var index = childNodes.indexOf(textNode);
  2837. var lastIndex = childNodes.length - 1;
  2838. var text = compressSpaces( // textNode.value
  2839. // || textNode.text
  2840. textNode.textContent || '');
  2841. if (index === 0) {
  2842. text = trimLeft(text);
  2843. }
  2844. if (index === lastIndex) {
  2845. text = trimRight(text);
  2846. }
  2847. return text;
  2848. }
  2849. renderChildren(ctx) {
  2850. if (this.type !== 'text') {
  2851. this.renderTElementChildren(ctx);
  2852. return;
  2853. } // first, calculate child positions
  2854. this.initializeCoordinates();
  2855. this.adjustChildCoordinatesRecursive(ctx); // then render
  2856. this.children.forEach((_, i) => {
  2857. this.renderChild(ctx, this, this, i);
  2858. });
  2859. var {
  2860. mouse
  2861. } = this.document.screen; // Do not calc bounding box if mouse is not working.
  2862. if (mouse.isWorking()) {
  2863. mouse.checkBoundingBox(this, this.getBoundingBox(ctx));
  2864. }
  2865. }
  2866. renderTElementChildren(ctx) {
  2867. var {
  2868. document,
  2869. parent
  2870. } = this;
  2871. var renderText = this.getText();
  2872. var customFont = parent.getStyle('font-family').getDefinition();
  2873. if (customFont) {
  2874. var {
  2875. unitsPerEm
  2876. } = customFont.fontFace;
  2877. var ctxFont = Font.parse(document.ctx.font);
  2878. var fontSize = parent.getStyle('font-size').getNumber(ctxFont.fontSize);
  2879. var fontStyle = parent.getStyle('font-style').getString(ctxFont.fontStyle);
  2880. var scale = fontSize / unitsPerEm;
  2881. var text = customFont.isRTL ? renderText.split('').reverse().join('') : renderText;
  2882. var dx = toNumbers(parent.getAttribute('dx').getString());
  2883. var len = text.length;
  2884. for (var i = 0; i < len; i++) {
  2885. var glyph = this.getGlyph(customFont, text, i);
  2886. ctx.translate(this.x, this.y);
  2887. ctx.scale(scale, -scale);
  2888. var lw = ctx.lineWidth;
  2889. ctx.lineWidth = ctx.lineWidth * unitsPerEm / fontSize;
  2890. if (fontStyle === 'italic') {
  2891. ctx.transform(1, 0, .4, 1, 0, 0);
  2892. }
  2893. glyph.render(ctx);
  2894. if (fontStyle === 'italic') {
  2895. ctx.transform(1, 0, -.4, 1, 0, 0);
  2896. }
  2897. ctx.lineWidth = lw;
  2898. ctx.scale(1 / scale, -1 / scale);
  2899. ctx.translate(-this.x, -this.y);
  2900. this.x += fontSize * (glyph.horizAdvX || customFont.horizAdvX) / unitsPerEm;
  2901. if (typeof dx[i] !== 'undefined' && !isNaN(dx[i])) {
  2902. this.x += dx[i];
  2903. }
  2904. }
  2905. return;
  2906. }
  2907. var {
  2908. x,
  2909. y
  2910. } = this; // NEED TEST
  2911. // if (ctx.paintOrder === 'stroke') {
  2912. // if (ctx.strokeStyle) {
  2913. // ctx.strokeText(renderText, x, y);
  2914. // }
  2915. // if (ctx.fillStyle) {
  2916. // ctx.fillText(renderText, x, y);
  2917. // }
  2918. // } else {
  2919. if (ctx.fillStyle) {
  2920. ctx.fillText(renderText, x, y);
  2921. }
  2922. if (ctx.strokeStyle) {
  2923. ctx.strokeText(renderText, x, y);
  2924. } // }
  2925. }
  2926. applyAnchoring() {
  2927. if (this.textChunkStart >= this.leafTexts.length) {
  2928. return;
  2929. } // This is basically the "Apply anchoring" part of https://www.w3.org/TR/SVG2/text.html#TextLayoutAlgorithm.
  2930. // The difference is that we apply the anchoring as soon as a chunk is finished. This saves some extra looping.
  2931. // Vertical text is not supported.
  2932. var firstElement = this.leafTexts[this.textChunkStart];
  2933. var textAnchor = firstElement.getStyle('text-anchor').getString('start');
  2934. var isRTL = false; // we treat RTL like LTR
  2935. var shift = 0;
  2936. if (textAnchor === 'start' && !isRTL || textAnchor === 'end' && isRTL) {
  2937. shift = firstElement.x - this.minX;
  2938. } else if (textAnchor === 'end' && !isRTL || textAnchor === 'start' && isRTL) {
  2939. shift = firstElement.x - this.maxX;
  2940. } else {
  2941. shift = firstElement.x - (this.minX + this.maxX) / 2;
  2942. }
  2943. for (var i = this.textChunkStart; i < this.leafTexts.length; i++) {
  2944. this.leafTexts[i].x += shift;
  2945. } // start new chunk
  2946. this.minX = Number.POSITIVE_INFINITY;
  2947. this.maxX = Number.NEGATIVE_INFINITY;
  2948. this.textChunkStart = this.leafTexts.length;
  2949. }
  2950. adjustChildCoordinatesRecursive(ctx) {
  2951. this.children.forEach((_, i) => {
  2952. this.adjustChildCoordinatesRecursiveCore(ctx, this, this, i);
  2953. });
  2954. this.applyAnchoring();
  2955. }
  2956. adjustChildCoordinatesRecursiveCore(ctx, textParent, parent, i) {
  2957. var child = parent.children[i];
  2958. if (child.children.length > 0) {
  2959. child.children.forEach((_, i) => {
  2960. textParent.adjustChildCoordinatesRecursiveCore(ctx, textParent, child, i);
  2961. });
  2962. } else {
  2963. // only leafs are relevant
  2964. this.adjustChildCoordinates(ctx, textParent, parent, i);
  2965. }
  2966. }
  2967. adjustChildCoordinates(ctx, textParent, parent, i) {
  2968. var child = parent.children[i];
  2969. if (typeof child.measureText !== 'function') {
  2970. return child;
  2971. }
  2972. ctx.save();
  2973. child.setContext(ctx, true);
  2974. var xAttr = child.getAttribute('x');
  2975. var yAttr = child.getAttribute('y');
  2976. var dxAttr = child.getAttribute('dx');
  2977. var dyAttr = child.getAttribute('dy');
  2978. var customFont = child.getStyle('font-family').getDefinition();
  2979. var isRTL = Boolean(customFont) && customFont.isRTL;
  2980. if (i === 0) {
  2981. // First children inherit attributes from parent(s). Positional attributes
  2982. // are only inherited from a parent to it's first child.
  2983. if (!xAttr.hasValue()) {
  2984. xAttr.setValue(child.getInheritedAttribute('x'));
  2985. }
  2986. if (!yAttr.hasValue()) {
  2987. yAttr.setValue(child.getInheritedAttribute('y'));
  2988. }
  2989. if (!dxAttr.hasValue()) {
  2990. dxAttr.setValue(child.getInheritedAttribute('dx'));
  2991. }
  2992. if (!dyAttr.hasValue()) {
  2993. dyAttr.setValue(child.getInheritedAttribute('dy'));
  2994. }
  2995. }
  2996. var width = child.measureText(ctx);
  2997. if (isRTL) {
  2998. textParent.x -= width;
  2999. }
  3000. if (xAttr.hasValue()) {
  3001. // an "x" attribute marks the start of a new chunk
  3002. textParent.applyAnchoring();
  3003. child.x = xAttr.getPixels('x');
  3004. if (dxAttr.hasValue()) {
  3005. child.x += dxAttr.getPixels('x');
  3006. }
  3007. } else {
  3008. if (dxAttr.hasValue()) {
  3009. textParent.x += dxAttr.getPixels('x');
  3010. }
  3011. child.x = textParent.x;
  3012. }
  3013. textParent.x = child.x;
  3014. if (!isRTL) {
  3015. textParent.x += width;
  3016. }
  3017. if (yAttr.hasValue()) {
  3018. child.y = yAttr.getPixels('y');
  3019. if (dyAttr.hasValue()) {
  3020. child.y += dyAttr.getPixels('y');
  3021. }
  3022. } else {
  3023. if (dyAttr.hasValue()) {
  3024. textParent.y += dyAttr.getPixels('y');
  3025. }
  3026. child.y = textParent.y;
  3027. }
  3028. textParent.y = child.y; // update the current chunk and it's bounds
  3029. textParent.leafTexts.push(child);
  3030. textParent.minX = Math.min(textParent.minX, child.x, child.x + width);
  3031. textParent.maxX = Math.max(textParent.maxX, child.x, child.x + width);
  3032. child.clearContext(ctx);
  3033. ctx.restore();
  3034. return child;
  3035. }
  3036. getChildBoundingBox(ctx, textParent, parent, i) {
  3037. var child = parent.children[i]; // not a text node?
  3038. if (typeof child.getBoundingBox !== 'function') {
  3039. return null;
  3040. }
  3041. var boundingBox = child.getBoundingBox(ctx);
  3042. if (!boundingBox) {
  3043. return null;
  3044. }
  3045. child.children.forEach((_, i) => {
  3046. var childBoundingBox = textParent.getChildBoundingBox(ctx, textParent, child, i);
  3047. boundingBox.addBoundingBox(childBoundingBox);
  3048. });
  3049. return boundingBox;
  3050. }
  3051. renderChild(ctx, textParent, parent, i) {
  3052. var child = parent.children[i];
  3053. child.render(ctx);
  3054. child.children.forEach((_, i) => {
  3055. textParent.renderChild(ctx, textParent, child, i);
  3056. });
  3057. }
  3058. measureText(ctx) {
  3059. var {
  3060. measureCache
  3061. } = this;
  3062. if (~measureCache) {
  3063. return measureCache;
  3064. }
  3065. var renderText = this.getText();
  3066. var measure = this.measureTargetText(ctx, renderText);
  3067. this.measureCache = measure;
  3068. return measure;
  3069. }
  3070. measureTargetText(ctx, targetText) {
  3071. if (!targetText.length) {
  3072. return 0;
  3073. }
  3074. var {
  3075. parent
  3076. } = this;
  3077. var customFont = parent.getStyle('font-family').getDefinition();
  3078. if (customFont) {
  3079. var fontSize = this.getFontSize();
  3080. var text = customFont.isRTL ? targetText.split('').reverse().join('') : targetText;
  3081. var dx = toNumbers(parent.getAttribute('dx').getString());
  3082. var len = text.length;
  3083. var _measure = 0;
  3084. for (var i = 0; i < len; i++) {
  3085. var glyph = this.getGlyph(customFont, text, i);
  3086. _measure += (glyph.horizAdvX || customFont.horizAdvX) * fontSize / customFont.fontFace.unitsPerEm;
  3087. if (typeof dx[i] !== 'undefined' && !isNaN(dx[i])) {
  3088. _measure += dx[i];
  3089. }
  3090. }
  3091. return _measure;
  3092. }
  3093. if (!ctx.measureText) {
  3094. return targetText.length * 10;
  3095. }
  3096. ctx.save();
  3097. this.setContext(ctx, true);
  3098. var {
  3099. width: measure
  3100. } = ctx.measureText(targetText);
  3101. this.clearContext(ctx);
  3102. ctx.restore();
  3103. return measure;
  3104. }
  3105. /**
  3106. * Inherits positional attributes from {@link TextElement} parent(s). Attributes
  3107. * are only inherited from a parent to its first child.
  3108. * @param name - The attribute name.
  3109. * @returns The attribute value or null.
  3110. */
  3111. getInheritedAttribute(name) {
  3112. // eslint-disable-next-line @typescript-eslint/no-this-alias,consistent-this
  3113. var current = this;
  3114. while (current instanceof TextElement && current.isFirstChild()) {
  3115. var parentAttr = current.parent.getAttribute(name);
  3116. if (parentAttr.hasValue(true)) {
  3117. return parentAttr.getValue('0');
  3118. }
  3119. current = current.parent;
  3120. }
  3121. return null;
  3122. }
  3123. }
  3124. class TSpanElement extends TextElement {
  3125. constructor(document, node, captureTextNodes) {
  3126. super(document, node, new.target === TSpanElement ? true : captureTextNodes);
  3127. this.type = 'tspan'; // if this node has children, then they own the text
  3128. this.text = this.children.length > 0 ? '' : this.getTextFromNode();
  3129. }
  3130. getText() {
  3131. return this.text;
  3132. }
  3133. }
  3134. class TextNode extends TSpanElement {
  3135. constructor() {
  3136. super(...arguments);
  3137. this.type = 'textNode';
  3138. }
  3139. }
  3140. class SVGElement extends RenderedElement {
  3141. constructor() {
  3142. super(...arguments);
  3143. this.type = 'svg';
  3144. this.root = false;
  3145. }
  3146. setContext(ctx) {
  3147. var _this$node$parentNode;
  3148. var {
  3149. document
  3150. } = this;
  3151. var {
  3152. screen,
  3153. window
  3154. } = document;
  3155. var canvas = ctx.canvas;
  3156. screen.setDefaults(ctx);
  3157. if (canvas.style && typeof ctx.font !== 'undefined' && window && typeof window.getComputedStyle !== 'undefined') {
  3158. ctx.font = window.getComputedStyle(canvas).getPropertyValue('font');
  3159. var fontSizeProp = new Property(document, 'fontSize', Font.parse(ctx.font).fontSize);
  3160. if (fontSizeProp.hasValue()) {
  3161. document.rootEmSize = fontSizeProp.getPixels('y');
  3162. document.emSize = document.rootEmSize;
  3163. }
  3164. } // create new view port
  3165. if (!this.getAttribute('x').hasValue()) {
  3166. this.getAttribute('x', true).setValue(0);
  3167. }
  3168. if (!this.getAttribute('y').hasValue()) {
  3169. this.getAttribute('y', true).setValue(0);
  3170. }
  3171. var {
  3172. width,
  3173. height
  3174. } = screen.viewPort;
  3175. if (!this.getStyle('width').hasValue()) {
  3176. this.getStyle('width', true).setValue('100%');
  3177. }
  3178. if (!this.getStyle('height').hasValue()) {
  3179. this.getStyle('height', true).setValue('100%');
  3180. }
  3181. if (!this.getStyle('color').hasValue()) {
  3182. this.getStyle('color', true).setValue('black');
  3183. }
  3184. var refXAttr = this.getAttribute('refX');
  3185. var refYAttr = this.getAttribute('refY');
  3186. var viewBoxAttr = this.getAttribute('viewBox');
  3187. var viewBox = viewBoxAttr.hasValue() ? toNumbers(viewBoxAttr.getString()) : null;
  3188. var clip = !this.root && this.getStyle('overflow').getValue('hidden') !== 'visible';
  3189. var minX = 0;
  3190. var minY = 0;
  3191. var clipX = 0;
  3192. var clipY = 0;
  3193. if (viewBox) {
  3194. minX = viewBox[0];
  3195. minY = viewBox[1];
  3196. }
  3197. if (!this.root) {
  3198. width = this.getStyle('width').getPixels('x');
  3199. height = this.getStyle('height').getPixels('y');
  3200. if (this.type === 'marker') {
  3201. clipX = minX;
  3202. clipY = minY;
  3203. minX = 0;
  3204. minY = 0;
  3205. }
  3206. }
  3207. screen.viewPort.setCurrent(width, height); // Default value of transform-origin is center only for root SVG elements
  3208. // https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/transform-origin
  3209. if (this.node // is not temporary SVGElement
  3210. && (!this.parent || ((_this$node$parentNode = this.node.parentNode) === null || _this$node$parentNode === void 0 ? void 0 : _this$node$parentNode.nodeName) === 'foreignObject') && this.getStyle('transform', false, true).hasValue() && !this.getStyle('transform-origin', false, true).hasValue()) {
  3211. this.getStyle('transform-origin', true, true).setValue('50% 50%');
  3212. }
  3213. super.setContext(ctx);
  3214. ctx.translate(this.getAttribute('x').getPixels('x'), this.getAttribute('y').getPixels('y'));
  3215. if (viewBox) {
  3216. width = viewBox[2];
  3217. height = viewBox[3];
  3218. }
  3219. document.setViewBox({
  3220. ctx,
  3221. aspectRatio: this.getAttribute('preserveAspectRatio').getString(),
  3222. width: screen.viewPort.width,
  3223. desiredWidth: width,
  3224. height: screen.viewPort.height,
  3225. desiredHeight: height,
  3226. minX,
  3227. minY,
  3228. refX: refXAttr.getValue(),
  3229. refY: refYAttr.getValue(),
  3230. clip,
  3231. clipX,
  3232. clipY
  3233. });
  3234. if (viewBox) {
  3235. screen.viewPort.removeCurrent();
  3236. screen.viewPort.setCurrent(width, height);
  3237. }
  3238. }
  3239. clearContext(ctx) {
  3240. super.clearContext(ctx);
  3241. this.document.screen.viewPort.removeCurrent();
  3242. }
  3243. /**
  3244. * Resize SVG to fit in given size.
  3245. * @param width
  3246. * @param height
  3247. * @param preserveAspectRatio
  3248. */
  3249. resize(width) {
  3250. var height = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : width;
  3251. var preserveAspectRatio = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  3252. var widthAttr = this.getAttribute('width', true);
  3253. var heightAttr = this.getAttribute('height', true);
  3254. var viewBoxAttr = this.getAttribute('viewBox');
  3255. var styleAttr = this.getAttribute('style');
  3256. var originWidth = widthAttr.getNumber(0);
  3257. var originHeight = heightAttr.getNumber(0);
  3258. if (preserveAspectRatio) {
  3259. if (typeof preserveAspectRatio === 'string') {
  3260. this.getAttribute('preserveAspectRatio', true).setValue(preserveAspectRatio);
  3261. } else {
  3262. var preserveAspectRatioAttr = this.getAttribute('preserveAspectRatio');
  3263. if (preserveAspectRatioAttr.hasValue()) {
  3264. preserveAspectRatioAttr.setValue(preserveAspectRatioAttr.getString().replace(/^\s*(\S.*\S)\s*$/, '$1'));
  3265. }
  3266. }
  3267. }
  3268. widthAttr.setValue(width);
  3269. heightAttr.setValue(height);
  3270. if (!viewBoxAttr.hasValue()) {
  3271. viewBoxAttr.setValue("0 0 ".concat(originWidth || width, " ").concat(originHeight || height));
  3272. }
  3273. if (styleAttr.hasValue()) {
  3274. var widthStyle = this.getStyle('width');
  3275. var heightStyle = this.getStyle('height');
  3276. if (widthStyle.hasValue()) {
  3277. widthStyle.setValue("".concat(width, "px"));
  3278. }
  3279. if (heightStyle.hasValue()) {
  3280. heightStyle.setValue("".concat(height, "px"));
  3281. }
  3282. }
  3283. }
  3284. }
  3285. class RectElement extends PathElement {
  3286. constructor() {
  3287. super(...arguments);
  3288. this.type = 'rect';
  3289. }
  3290. path(ctx) {
  3291. var x = this.getAttribute('x').getPixels('x');
  3292. var y = this.getAttribute('y').getPixels('y');
  3293. var width = this.getStyle('width', false, true).getPixels('x');
  3294. var height = this.getStyle('height', false, true).getPixels('y');
  3295. var rxAttr = this.getAttribute('rx');
  3296. var ryAttr = this.getAttribute('ry');
  3297. var rx = rxAttr.getPixels('x');
  3298. var ry = ryAttr.getPixels('y');
  3299. if (rxAttr.hasValue() && !ryAttr.hasValue()) {
  3300. ry = rx;
  3301. }
  3302. if (ryAttr.hasValue() && !rxAttr.hasValue()) {
  3303. rx = ry;
  3304. }
  3305. rx = Math.min(rx, width / 2.0);
  3306. ry = Math.min(ry, height / 2.0);
  3307. if (ctx) {
  3308. var KAPPA = 4 * ((Math.sqrt(2) - 1) / 3);
  3309. ctx.beginPath(); // always start the path so we don't fill prior paths
  3310. if (height > 0 && width > 0) {
  3311. ctx.moveTo(x + rx, y);
  3312. ctx.lineTo(x + width - rx, y);
  3313. ctx.bezierCurveTo(x + width - rx + KAPPA * rx, y, x + width, y + ry - KAPPA * ry, x + width, y + ry);
  3314. ctx.lineTo(x + width, y + height - ry);
  3315. ctx.bezierCurveTo(x + width, y + height - ry + KAPPA * ry, x + width - rx + KAPPA * rx, y + height, x + width - rx, y + height);
  3316. ctx.lineTo(x + rx, y + height);
  3317. ctx.bezierCurveTo(x + rx - KAPPA * rx, y + height, x, y + height - ry + KAPPA * ry, x, y + height - ry);
  3318. ctx.lineTo(x, y + ry);
  3319. ctx.bezierCurveTo(x, y + ry - KAPPA * ry, x + rx - KAPPA * rx, y, x + rx, y);
  3320. ctx.closePath();
  3321. }
  3322. }
  3323. return new BoundingBox(x, y, x + width, y + height);
  3324. }
  3325. getMarkers() {
  3326. return null;
  3327. }
  3328. }
  3329. class CircleElement extends PathElement {
  3330. constructor() {
  3331. super(...arguments);
  3332. this.type = 'circle';
  3333. }
  3334. path(ctx) {
  3335. var cx = this.getAttribute('cx').getPixels('x');
  3336. var cy = this.getAttribute('cy').getPixels('y');
  3337. var r = this.getAttribute('r').getPixels();
  3338. if (ctx && r > 0) {
  3339. ctx.beginPath();
  3340. ctx.arc(cx, cy, r, 0, Math.PI * 2, false);
  3341. ctx.closePath();
  3342. }
  3343. return new BoundingBox(cx - r, cy - r, cx + r, cy + r);
  3344. }
  3345. getMarkers() {
  3346. return null;
  3347. }
  3348. }
  3349. class EllipseElement extends PathElement {
  3350. constructor() {
  3351. super(...arguments);
  3352. this.type = 'ellipse';
  3353. }
  3354. path(ctx) {
  3355. var KAPPA = 4 * ((Math.sqrt(2) - 1) / 3);
  3356. var rx = this.getAttribute('rx').getPixels('x');
  3357. var ry = this.getAttribute('ry').getPixels('y');
  3358. var cx = this.getAttribute('cx').getPixels('x');
  3359. var cy = this.getAttribute('cy').getPixels('y');
  3360. if (ctx && rx > 0 && ry > 0) {
  3361. ctx.beginPath();
  3362. ctx.moveTo(cx + rx, cy);
  3363. ctx.bezierCurveTo(cx + rx, cy + KAPPA * ry, cx + KAPPA * rx, cy + ry, cx, cy + ry);
  3364. ctx.bezierCurveTo(cx - KAPPA * rx, cy + ry, cx - rx, cy + KAPPA * ry, cx - rx, cy);
  3365. ctx.bezierCurveTo(cx - rx, cy - KAPPA * ry, cx - KAPPA * rx, cy - ry, cx, cy - ry);
  3366. ctx.bezierCurveTo(cx + KAPPA * rx, cy - ry, cx + rx, cy - KAPPA * ry, cx + rx, cy);
  3367. ctx.closePath();
  3368. }
  3369. return new BoundingBox(cx - rx, cy - ry, cx + rx, cy + ry);
  3370. }
  3371. getMarkers() {
  3372. return null;
  3373. }
  3374. }
  3375. class LineElement extends PathElement {
  3376. constructor() {
  3377. super(...arguments);
  3378. this.type = 'line';
  3379. }
  3380. getPoints() {
  3381. return [new Point(this.getAttribute('x1').getPixels('x'), this.getAttribute('y1').getPixels('y')), new Point(this.getAttribute('x2').getPixels('x'), this.getAttribute('y2').getPixels('y'))];
  3382. }
  3383. path(ctx) {
  3384. var [{
  3385. x: x0,
  3386. y: y0
  3387. }, {
  3388. x: x1,
  3389. y: y1
  3390. }] = this.getPoints();
  3391. if (ctx) {
  3392. ctx.beginPath();
  3393. ctx.moveTo(x0, y0);
  3394. ctx.lineTo(x1, y1);
  3395. }
  3396. return new BoundingBox(x0, y0, x1, y1);
  3397. }
  3398. getMarkers() {
  3399. var [p0, p1] = this.getPoints();
  3400. var a = p0.angleTo(p1);
  3401. return [[p0, a], [p1, a]];
  3402. }
  3403. }
  3404. class PolylineElement extends PathElement {
  3405. constructor(document, node, captureTextNodes) {
  3406. super(document, node, captureTextNodes);
  3407. this.type = 'polyline';
  3408. this.points = [];
  3409. this.points = Point.parsePath(this.getAttribute('points').getString());
  3410. }
  3411. path(ctx) {
  3412. var {
  3413. points
  3414. } = this;
  3415. var [{
  3416. x: x0,
  3417. y: y0
  3418. }] = points;
  3419. var boundingBox = new BoundingBox(x0, y0);
  3420. if (ctx) {
  3421. ctx.beginPath();
  3422. ctx.moveTo(x0, y0);
  3423. }
  3424. points.forEach(_ref => {
  3425. var {
  3426. x,
  3427. y
  3428. } = _ref;
  3429. boundingBox.addPoint(x, y);
  3430. if (ctx) {
  3431. ctx.lineTo(x, y);
  3432. }
  3433. });
  3434. return boundingBox;
  3435. }
  3436. getMarkers() {
  3437. var {
  3438. points
  3439. } = this;
  3440. var lastIndex = points.length - 1;
  3441. var markers = [];
  3442. points.forEach((point, i) => {
  3443. if (i === lastIndex) {
  3444. return;
  3445. }
  3446. markers.push([point, point.angleTo(points[i + 1])]);
  3447. });
  3448. if (markers.length > 0) {
  3449. markers.push([points[points.length - 1], markers[markers.length - 1][1]]);
  3450. }
  3451. return markers;
  3452. }
  3453. }
  3454. class PolygonElement extends PolylineElement {
  3455. constructor() {
  3456. super(...arguments);
  3457. this.type = 'polygon';
  3458. }
  3459. path(ctx) {
  3460. var boundingBox = super.path(ctx);
  3461. var [{
  3462. x,
  3463. y
  3464. }] = this.points;
  3465. if (ctx) {
  3466. ctx.lineTo(x, y);
  3467. ctx.closePath();
  3468. }
  3469. return boundingBox;
  3470. }
  3471. }
  3472. class PatternElement extends Element {
  3473. constructor() {
  3474. super(...arguments);
  3475. this.type = 'pattern';
  3476. }
  3477. createPattern(ctx, _, parentOpacityProp) {
  3478. var width = this.getStyle('width').getPixels('x', true);
  3479. var height = this.getStyle('height').getPixels('y', true); // render me using a temporary svg element
  3480. var patternSvg = new SVGElement(this.document, null);
  3481. patternSvg.attributes.viewBox = new Property(this.document, 'viewBox', this.getAttribute('viewBox').getValue());
  3482. patternSvg.attributes.width = new Property(this.document, 'width', "".concat(width, "px"));
  3483. patternSvg.attributes.height = new Property(this.document, 'height', "".concat(height, "px"));
  3484. patternSvg.attributes.transform = new Property(this.document, 'transform', this.getAttribute('patternTransform').getValue());
  3485. patternSvg.children = this.children;
  3486. var patternCanvas = this.document.createCanvas(width, height);
  3487. var patternCtx = patternCanvas.getContext('2d');
  3488. var xAttr = this.getAttribute('x');
  3489. var yAttr = this.getAttribute('y');
  3490. if (xAttr.hasValue() && yAttr.hasValue()) {
  3491. patternCtx.translate(xAttr.getPixels('x', true), yAttr.getPixels('y', true));
  3492. }
  3493. if (parentOpacityProp.hasValue()) {
  3494. this.styles['fill-opacity'] = parentOpacityProp;
  3495. } else {
  3496. Reflect.deleteProperty(this.styles, 'fill-opacity');
  3497. } // render 3x3 grid so when we transform there's no white space on edges
  3498. for (var x = -1; x <= 1; x++) {
  3499. for (var y = -1; y <= 1; y++) {
  3500. patternCtx.save();
  3501. patternSvg.attributes.x = new Property(this.document, 'x', x * patternCanvas.width);
  3502. patternSvg.attributes.y = new Property(this.document, 'y', y * patternCanvas.height);
  3503. patternSvg.render(patternCtx);
  3504. patternCtx.restore();
  3505. }
  3506. }
  3507. var pattern = ctx.createPattern(patternCanvas, 'repeat');
  3508. return pattern;
  3509. }
  3510. }
  3511. class MarkerElement extends Element {
  3512. constructor() {
  3513. super(...arguments);
  3514. this.type = 'marker';
  3515. }
  3516. render(ctx, point, angle) {
  3517. if (!point) {
  3518. return;
  3519. }
  3520. var {
  3521. x,
  3522. y
  3523. } = point;
  3524. var orient = this.getAttribute('orient').getString('auto');
  3525. var markerUnits = this.getAttribute('markerUnits').getString('strokeWidth');
  3526. ctx.translate(x, y);
  3527. if (orient === 'auto') {
  3528. ctx.rotate(angle);
  3529. }
  3530. if (markerUnits === 'strokeWidth') {
  3531. ctx.scale(ctx.lineWidth, ctx.lineWidth);
  3532. }
  3533. ctx.save(); // render me using a temporary svg element
  3534. var markerSvg = new SVGElement(this.document, null);
  3535. markerSvg.type = this.type;
  3536. markerSvg.attributes.viewBox = new Property(this.document, 'viewBox', this.getAttribute('viewBox').getValue());
  3537. markerSvg.attributes.refX = new Property(this.document, 'refX', this.getAttribute('refX').getValue());
  3538. markerSvg.attributes.refY = new Property(this.document, 'refY', this.getAttribute('refY').getValue());
  3539. markerSvg.attributes.width = new Property(this.document, 'width', this.getAttribute('markerWidth').getValue());
  3540. markerSvg.attributes.height = new Property(this.document, 'height', this.getAttribute('markerHeight').getValue());
  3541. markerSvg.attributes.overflow = new Property(this.document, 'overflow', this.getAttribute('overflow').getValue());
  3542. markerSvg.attributes.fill = new Property(this.document, 'fill', this.getAttribute('fill').getColor('black'));
  3543. markerSvg.attributes.stroke = new Property(this.document, 'stroke', this.getAttribute('stroke').getValue('none'));
  3544. markerSvg.children = this.children;
  3545. markerSvg.render(ctx);
  3546. ctx.restore();
  3547. if (markerUnits === 'strokeWidth') {
  3548. ctx.scale(1 / ctx.lineWidth, 1 / ctx.lineWidth);
  3549. }
  3550. if (orient === 'auto') {
  3551. ctx.rotate(-angle);
  3552. }
  3553. ctx.translate(-x, -y);
  3554. }
  3555. }
  3556. class DefsElement extends Element {
  3557. constructor() {
  3558. super(...arguments);
  3559. this.type = 'defs';
  3560. }
  3561. render() {// NOOP
  3562. }
  3563. }
  3564. class GElement extends RenderedElement {
  3565. constructor() {
  3566. super(...arguments);
  3567. this.type = 'g';
  3568. }
  3569. getBoundingBox(ctx) {
  3570. var boundingBox = new BoundingBox();
  3571. this.children.forEach(child => {
  3572. boundingBox.addBoundingBox(child.getBoundingBox(ctx));
  3573. });
  3574. return boundingBox;
  3575. }
  3576. }
  3577. class GradientElement extends Element {
  3578. constructor(document, node, captureTextNodes) {
  3579. super(document, node, captureTextNodes);
  3580. this.attributesToInherit = ['gradientUnits'];
  3581. this.stops = [];
  3582. var {
  3583. stops,
  3584. children
  3585. } = this;
  3586. children.forEach(child => {
  3587. if (child.type === 'stop') {
  3588. stops.push(child);
  3589. }
  3590. });
  3591. }
  3592. getGradientUnits() {
  3593. return this.getAttribute('gradientUnits').getString('objectBoundingBox');
  3594. }
  3595. createGradient(ctx, element, parentOpacityProp) {
  3596. // eslint-disable-next-line @typescript-eslint/no-this-alias, consistent-this
  3597. var stopsContainer = this;
  3598. if (this.getHrefAttribute().hasValue()) {
  3599. stopsContainer = this.getHrefAttribute().getDefinition();
  3600. this.inheritStopContainer(stopsContainer);
  3601. }
  3602. var {
  3603. stops
  3604. } = stopsContainer;
  3605. var gradient = this.getGradient(ctx, element);
  3606. if (!gradient) {
  3607. return this.addParentOpacity(parentOpacityProp, stops[stops.length - 1].color);
  3608. }
  3609. stops.forEach(stop => {
  3610. gradient.addColorStop(stop.offset, this.addParentOpacity(parentOpacityProp, stop.color));
  3611. });
  3612. if (this.getAttribute('gradientTransform').hasValue()) {
  3613. // render as transformed pattern on temporary canvas
  3614. var {
  3615. document
  3616. } = this;
  3617. var {
  3618. MAX_VIRTUAL_PIXELS,
  3619. viewPort
  3620. } = document.screen;
  3621. var [rootView] = viewPort.viewPorts;
  3622. var rect = new RectElement(document, null);
  3623. rect.attributes.x = new Property(document, 'x', -MAX_VIRTUAL_PIXELS / 3.0);
  3624. rect.attributes.y = new Property(document, 'y', -MAX_VIRTUAL_PIXELS / 3.0);
  3625. rect.attributes.width = new Property(document, 'width', MAX_VIRTUAL_PIXELS);
  3626. rect.attributes.height = new Property(document, 'height', MAX_VIRTUAL_PIXELS);
  3627. var group = new GElement(document, null);
  3628. group.attributes.transform = new Property(document, 'transform', this.getAttribute('gradientTransform').getValue());
  3629. group.children = [rect];
  3630. var patternSvg = new SVGElement(document, null);
  3631. patternSvg.attributes.x = new Property(document, 'x', 0);
  3632. patternSvg.attributes.y = new Property(document, 'y', 0);
  3633. patternSvg.attributes.width = new Property(document, 'width', rootView.width);
  3634. patternSvg.attributes.height = new Property(document, 'height', rootView.height);
  3635. patternSvg.children = [group];
  3636. var patternCanvas = document.createCanvas(rootView.width, rootView.height);
  3637. var patternCtx = patternCanvas.getContext('2d');
  3638. patternCtx.fillStyle = gradient;
  3639. patternSvg.render(patternCtx);
  3640. return patternCtx.createPattern(patternCanvas, 'no-repeat');
  3641. }
  3642. return gradient;
  3643. }
  3644. inheritStopContainer(stopsContainer) {
  3645. this.attributesToInherit.forEach(attributeToInherit => {
  3646. if (!this.getAttribute(attributeToInherit).hasValue() && stopsContainer.getAttribute(attributeToInherit).hasValue()) {
  3647. this.getAttribute(attributeToInherit, true).setValue(stopsContainer.getAttribute(attributeToInherit).getValue());
  3648. }
  3649. });
  3650. }
  3651. addParentOpacity(parentOpacityProp, color) {
  3652. if (parentOpacityProp.hasValue()) {
  3653. var colorProp = new Property(this.document, 'color', color);
  3654. return colorProp.addOpacity(parentOpacityProp).getColor();
  3655. }
  3656. return color;
  3657. }
  3658. }
  3659. class LinearGradientElement extends GradientElement {
  3660. constructor(document, node, captureTextNodes) {
  3661. super(document, node, captureTextNodes);
  3662. this.type = 'linearGradient';
  3663. this.attributesToInherit.push('x1', 'y1', 'x2', 'y2');
  3664. }
  3665. getGradient(ctx, element) {
  3666. var isBoundingBoxUnits = this.getGradientUnits() === 'objectBoundingBox';
  3667. var boundingBox = isBoundingBoxUnits ? element.getBoundingBox(ctx) : null;
  3668. if (isBoundingBoxUnits && !boundingBox) {
  3669. return null;
  3670. }
  3671. if (!this.getAttribute('x1').hasValue() && !this.getAttribute('y1').hasValue() && !this.getAttribute('x2').hasValue() && !this.getAttribute('y2').hasValue()) {
  3672. this.getAttribute('x1', true).setValue(0);
  3673. this.getAttribute('y1', true).setValue(0);
  3674. this.getAttribute('x2', true).setValue(1);
  3675. this.getAttribute('y2', true).setValue(0);
  3676. }
  3677. var x1 = isBoundingBoxUnits ? boundingBox.x + boundingBox.width * this.getAttribute('x1').getNumber() : this.getAttribute('x1').getPixels('x');
  3678. var y1 = isBoundingBoxUnits ? boundingBox.y + boundingBox.height * this.getAttribute('y1').getNumber() : this.getAttribute('y1').getPixels('y');
  3679. var x2 = isBoundingBoxUnits ? boundingBox.x + boundingBox.width * this.getAttribute('x2').getNumber() : this.getAttribute('x2').getPixels('x');
  3680. var y2 = isBoundingBoxUnits ? boundingBox.y + boundingBox.height * this.getAttribute('y2').getNumber() : this.getAttribute('y2').getPixels('y');
  3681. if (x1 === x2 && y1 === y2) {
  3682. return null;
  3683. }
  3684. return ctx.createLinearGradient(x1, y1, x2, y2);
  3685. }
  3686. }
  3687. class RadialGradientElement extends GradientElement {
  3688. constructor(document, node, captureTextNodes) {
  3689. super(document, node, captureTextNodes);
  3690. this.type = 'radialGradient';
  3691. this.attributesToInherit.push('cx', 'cy', 'r', 'fx', 'fy', 'fr');
  3692. }
  3693. getGradient(ctx, element) {
  3694. var isBoundingBoxUnits = this.getGradientUnits() === 'objectBoundingBox';
  3695. var boundingBox = element.getBoundingBox(ctx);
  3696. if (isBoundingBoxUnits && !boundingBox) {
  3697. return null;
  3698. }
  3699. if (!this.getAttribute('cx').hasValue()) {
  3700. this.getAttribute('cx', true).setValue('50%');
  3701. }
  3702. if (!this.getAttribute('cy').hasValue()) {
  3703. this.getAttribute('cy', true).setValue('50%');
  3704. }
  3705. if (!this.getAttribute('r').hasValue()) {
  3706. this.getAttribute('r', true).setValue('50%');
  3707. }
  3708. var cx = isBoundingBoxUnits ? boundingBox.x + boundingBox.width * this.getAttribute('cx').getNumber() : this.getAttribute('cx').getPixels('x');
  3709. var cy = isBoundingBoxUnits ? boundingBox.y + boundingBox.height * this.getAttribute('cy').getNumber() : this.getAttribute('cy').getPixels('y');
  3710. var fx = cx;
  3711. var fy = cy;
  3712. if (this.getAttribute('fx').hasValue()) {
  3713. fx = isBoundingBoxUnits ? boundingBox.x + boundingBox.width * this.getAttribute('fx').getNumber() : this.getAttribute('fx').getPixels('x');
  3714. }
  3715. if (this.getAttribute('fy').hasValue()) {
  3716. fy = isBoundingBoxUnits ? boundingBox.y + boundingBox.height * this.getAttribute('fy').getNumber() : this.getAttribute('fy').getPixels('y');
  3717. }
  3718. var r = isBoundingBoxUnits ? (boundingBox.width + boundingBox.height) / 2.0 * this.getAttribute('r').getNumber() : this.getAttribute('r').getPixels();
  3719. var fr = this.getAttribute('fr').getPixels();
  3720. return ctx.createRadialGradient(fx, fy, fr, cx, cy, r);
  3721. }
  3722. }
  3723. class StopElement extends Element {
  3724. constructor(document, node, captureTextNodes) {
  3725. super(document, node, captureTextNodes);
  3726. this.type = 'stop';
  3727. var offset = Math.max(0, Math.min(1, this.getAttribute('offset').getNumber()));
  3728. var stopOpacity = this.getStyle('stop-opacity');
  3729. var stopColor = this.getStyle('stop-color', true);
  3730. if (stopColor.getString() === '') {
  3731. stopColor.setValue('#000');
  3732. }
  3733. if (stopOpacity.hasValue()) {
  3734. stopColor = stopColor.addOpacity(stopOpacity);
  3735. }
  3736. this.offset = offset;
  3737. this.color = stopColor.getColor();
  3738. }
  3739. }
  3740. class AnimateElement extends Element {
  3741. constructor(document, node, captureTextNodes) {
  3742. super(document, node, captureTextNodes);
  3743. this.type = 'animate';
  3744. this.duration = 0;
  3745. this.initialValue = null;
  3746. this.initialUnits = '';
  3747. this.removed = false;
  3748. this.frozen = false;
  3749. document.screen.animations.push(this);
  3750. this.begin = this.getAttribute('begin').getMilliseconds();
  3751. this.maxDuration = this.begin + this.getAttribute('dur').getMilliseconds();
  3752. this.from = this.getAttribute('from');
  3753. this.to = this.getAttribute('to');
  3754. this.values = new Property(document, 'values', null);
  3755. var valuesAttr = this.getAttribute('values');
  3756. if (valuesAttr.hasValue()) {
  3757. this.values.setValue(valuesAttr.getString().split(';'));
  3758. }
  3759. }
  3760. getProperty() {
  3761. var attributeType = this.getAttribute('attributeType').getString();
  3762. var attributeName = this.getAttribute('attributeName').getString();
  3763. if (attributeType === 'CSS') {
  3764. return this.parent.getStyle(attributeName, true);
  3765. }
  3766. return this.parent.getAttribute(attributeName, true);
  3767. }
  3768. calcValue() {
  3769. var {
  3770. initialUnits
  3771. } = this;
  3772. var {
  3773. progress,
  3774. from,
  3775. to
  3776. } = this.getProgress(); // tween value linearly
  3777. var newValue = from.getNumber() + (to.getNumber() - from.getNumber()) * progress;
  3778. if (initialUnits === '%') {
  3779. newValue *= 100.0; // numValue() returns 0-1 whereas properties are 0-100
  3780. }
  3781. return "".concat(newValue).concat(initialUnits);
  3782. }
  3783. update(delta) {
  3784. var {
  3785. parent
  3786. } = this;
  3787. var prop = this.getProperty(); // set initial value
  3788. if (!this.initialValue) {
  3789. this.initialValue = prop.getString();
  3790. this.initialUnits = prop.getUnits();
  3791. } // if we're past the end time
  3792. if (this.duration > this.maxDuration) {
  3793. var fill = this.getAttribute('fill').getString('remove'); // loop for indefinitely repeating animations
  3794. if (this.getAttribute('repeatCount').getString() === 'indefinite' || this.getAttribute('repeatDur').getString() === 'indefinite') {
  3795. this.duration = 0;
  3796. } else if (fill === 'freeze' && !this.frozen) {
  3797. this.frozen = true;
  3798. parent.animationFrozen = true;
  3799. parent.animationFrozenValue = prop.getString();
  3800. } else if (fill === 'remove' && !this.removed) {
  3801. this.removed = true;
  3802. prop.setValue(parent.animationFrozen ? parent.animationFrozenValue : this.initialValue);
  3803. return true;
  3804. }
  3805. return false;
  3806. }
  3807. this.duration += delta; // if we're past the begin time
  3808. var updated = false;
  3809. if (this.begin < this.duration) {
  3810. var newValue = this.calcValue(); // tween
  3811. var typeAttr = this.getAttribute('type');
  3812. if (typeAttr.hasValue()) {
  3813. // for transform, etc.
  3814. var type = typeAttr.getString();
  3815. newValue = "".concat(type, "(").concat(newValue, ")");
  3816. }
  3817. prop.setValue(newValue);
  3818. updated = true;
  3819. }
  3820. return updated;
  3821. }
  3822. getProgress() {
  3823. var {
  3824. document,
  3825. values
  3826. } = this;
  3827. var result = {
  3828. progress: (this.duration - this.begin) / (this.maxDuration - this.begin)
  3829. };
  3830. if (values.hasValue()) {
  3831. var p = result.progress * (values.getValue().length - 1);
  3832. var lb = Math.floor(p);
  3833. var ub = Math.ceil(p);
  3834. result.from = new Property(document, 'from', parseFloat(values.getValue()[lb]));
  3835. result.to = new Property(document, 'to', parseFloat(values.getValue()[ub]));
  3836. result.progress = (p - lb) / (ub - lb);
  3837. } else {
  3838. result.from = this.from;
  3839. result.to = this.to;
  3840. }
  3841. return result;
  3842. }
  3843. }
  3844. class AnimateColorElement extends AnimateElement {
  3845. constructor() {
  3846. super(...arguments);
  3847. this.type = 'animateColor';
  3848. }
  3849. calcValue() {
  3850. var {
  3851. progress,
  3852. from,
  3853. to
  3854. } = this.getProgress();
  3855. var colorFrom = new rgbcolor__WEBPACK_IMPORTED_MODULE_13___default.a(from.getColor());
  3856. var colorTo = new rgbcolor__WEBPACK_IMPORTED_MODULE_13___default.a(to.getColor());
  3857. if (colorFrom.ok && colorTo.ok) {
  3858. // tween color linearly
  3859. var r = colorFrom.r + (colorTo.r - colorFrom.r) * progress;
  3860. var g = colorFrom.g + (colorTo.g - colorFrom.g) * progress;
  3861. var b = colorFrom.b + (colorTo.b - colorFrom.b) * progress; // ? alpha
  3862. return "rgb(".concat(Math.floor(r), ", ").concat(Math.floor(g), ", ").concat(Math.floor(b), ")");
  3863. }
  3864. return this.getAttribute('from').getColor();
  3865. }
  3866. }
  3867. class AnimateTransformElement extends AnimateElement {
  3868. constructor() {
  3869. super(...arguments);
  3870. this.type = 'animateTransform';
  3871. }
  3872. calcValue() {
  3873. var {
  3874. progress,
  3875. from,
  3876. to
  3877. } = this.getProgress(); // tween value linearly
  3878. var transformFrom = toNumbers(from.getString());
  3879. var transformTo = toNumbers(to.getString());
  3880. var newValue = transformFrom.map((from, i) => {
  3881. var to = transformTo[i];
  3882. return from + (to - from) * progress;
  3883. }).join(' ');
  3884. return newValue;
  3885. }
  3886. }
  3887. class FontElement extends Element {
  3888. constructor(document, node, captureTextNodes) {
  3889. super(document, node, captureTextNodes);
  3890. this.type = 'font';
  3891. this.glyphs = {};
  3892. this.horizAdvX = this.getAttribute('horiz-adv-x').getNumber();
  3893. var {
  3894. definitions
  3895. } = document;
  3896. var {
  3897. children
  3898. } = this;
  3899. for (var child of children) {
  3900. switch (child.type) {
  3901. case 'font-face':
  3902. {
  3903. this.fontFace = child;
  3904. var fontFamilyStyle = child.getStyle('font-family');
  3905. if (fontFamilyStyle.hasValue()) {
  3906. definitions[fontFamilyStyle.getString()] = this;
  3907. }
  3908. break;
  3909. }
  3910. case 'missing-glyph':
  3911. this.missingGlyph = child;
  3912. break;
  3913. case 'glyph':
  3914. {
  3915. var glyph = child;
  3916. if (glyph.arabicForm) {
  3917. this.isRTL = true;
  3918. this.isArabic = true;
  3919. if (typeof this.glyphs[glyph.unicode] === 'undefined') {
  3920. this.glyphs[glyph.unicode] = {};
  3921. }
  3922. this.glyphs[glyph.unicode][glyph.arabicForm] = glyph;
  3923. } else {
  3924. this.glyphs[glyph.unicode] = glyph;
  3925. }
  3926. break;
  3927. }
  3928. }
  3929. }
  3930. }
  3931. render() {// NO RENDER
  3932. }
  3933. }
  3934. class FontFaceElement extends Element {
  3935. constructor(document, node, captureTextNodes) {
  3936. super(document, node, captureTextNodes);
  3937. this.type = 'font-face';
  3938. this.ascent = this.getAttribute('ascent').getNumber();
  3939. this.descent = this.getAttribute('descent').getNumber();
  3940. this.unitsPerEm = this.getAttribute('units-per-em').getNumber();
  3941. }
  3942. }
  3943. class MissingGlyphElement extends PathElement {
  3944. constructor() {
  3945. super(...arguments);
  3946. this.type = 'missing-glyph';
  3947. this.horizAdvX = 0;
  3948. }
  3949. }
  3950. class TRefElement extends TextElement {
  3951. constructor() {
  3952. super(...arguments);
  3953. this.type = 'tref';
  3954. }
  3955. getText() {
  3956. var element = this.getHrefAttribute().getDefinition();
  3957. if (element) {
  3958. var firstChild = element.children[0];
  3959. if (firstChild) {
  3960. return firstChild.getText();
  3961. }
  3962. }
  3963. return '';
  3964. }
  3965. }
  3966. class AElement extends TextElement {
  3967. constructor(document, node, captureTextNodes) {
  3968. super(document, node, captureTextNodes);
  3969. this.type = 'a';
  3970. var {
  3971. childNodes
  3972. } = node;
  3973. var firstChild = childNodes[0];
  3974. var hasText = childNodes.length > 0 && Array.from(childNodes).every(node => node.nodeType === 3);
  3975. this.hasText = hasText;
  3976. this.text = hasText ? this.getTextFromNode(firstChild) : '';
  3977. }
  3978. getText() {
  3979. return this.text;
  3980. }
  3981. renderChildren(ctx) {
  3982. if (this.hasText) {
  3983. // render as text element
  3984. super.renderChildren(ctx);
  3985. var {
  3986. document,
  3987. x,
  3988. y
  3989. } = this;
  3990. var {
  3991. mouse
  3992. } = document.screen;
  3993. var fontSize = new Property(document, 'fontSize', Font.parse(document.ctx.font).fontSize); // Do not calc bounding box if mouse is not working.
  3994. if (mouse.isWorking()) {
  3995. mouse.checkBoundingBox(this, new BoundingBox(x, y - fontSize.getPixels('y'), x + this.measureText(ctx), y));
  3996. }
  3997. } else if (this.children.length > 0) {
  3998. // render as temporary group
  3999. var g = new GElement(this.document, null);
  4000. g.children = this.children;
  4001. g.parent = this;
  4002. g.render(ctx);
  4003. }
  4004. }
  4005. onClick() {
  4006. var {
  4007. window
  4008. } = this.document;
  4009. if (window) {
  4010. window.open(this.getHrefAttribute().getString());
  4011. }
  4012. }
  4013. onMouseMove() {
  4014. var ctx = this.document.ctx;
  4015. ctx.canvas.style.cursor = 'pointer';
  4016. }
  4017. }
  4018. function ownKeys$2(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
  4019. function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$2(Object(source), true).forEach(function (key) { _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_7___default()(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$2(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
  4020. class TextPathElement extends TextElement {
  4021. constructor(document, node, captureTextNodes) {
  4022. super(document, node, captureTextNodes);
  4023. this.type = 'textPath';
  4024. this.textWidth = 0;
  4025. this.textHeight = 0;
  4026. this.pathLength = -1;
  4027. this.glyphInfo = null;
  4028. this.letterSpacingCache = [];
  4029. this.measuresCache = new Map([['', 0]]);
  4030. var pathElement = this.getHrefAttribute().getDefinition();
  4031. this.text = this.getTextFromNode();
  4032. this.dataArray = this.parsePathData(pathElement);
  4033. }
  4034. getText() {
  4035. return this.text;
  4036. }
  4037. path(ctx) {
  4038. var {
  4039. dataArray
  4040. } = this;
  4041. if (ctx) {
  4042. ctx.beginPath();
  4043. }
  4044. dataArray.forEach(_ref => {
  4045. var {
  4046. type,
  4047. points
  4048. } = _ref;
  4049. switch (type) {
  4050. case PathParser.LINE_TO:
  4051. if (ctx) {
  4052. ctx.lineTo(points[0], points[1]);
  4053. }
  4054. break;
  4055. case PathParser.MOVE_TO:
  4056. if (ctx) {
  4057. ctx.moveTo(points[0], points[1]);
  4058. }
  4059. break;
  4060. case PathParser.CURVE_TO:
  4061. if (ctx) {
  4062. ctx.bezierCurveTo(points[0], points[1], points[2], points[3], points[4], points[5]);
  4063. }
  4064. break;
  4065. case PathParser.QUAD_TO:
  4066. if (ctx) {
  4067. ctx.quadraticCurveTo(points[0], points[1], points[2], points[3]);
  4068. }
  4069. break;
  4070. case PathParser.ARC:
  4071. {
  4072. var [cx, cy, rx, ry, theta, dTheta, psi, fs] = points;
  4073. var r = rx > ry ? rx : ry;
  4074. var scaleX = rx > ry ? 1 : rx / ry;
  4075. var scaleY = rx > ry ? ry / rx : 1;
  4076. if (ctx) {
  4077. ctx.translate(cx, cy);
  4078. ctx.rotate(psi);
  4079. ctx.scale(scaleX, scaleY);
  4080. ctx.arc(0, 0, r, theta, theta + dTheta, Boolean(1 - fs));
  4081. ctx.scale(1 / scaleX, 1 / scaleY);
  4082. ctx.rotate(-psi);
  4083. ctx.translate(-cx, -cy);
  4084. }
  4085. break;
  4086. }
  4087. case PathParser.CLOSE_PATH:
  4088. if (ctx) {
  4089. ctx.closePath();
  4090. }
  4091. break;
  4092. }
  4093. });
  4094. }
  4095. renderChildren(ctx) {
  4096. this.setTextData(ctx);
  4097. ctx.save();
  4098. var textDecoration = this.parent.getStyle('text-decoration').getString();
  4099. var fontSize = this.getFontSize();
  4100. var {
  4101. glyphInfo
  4102. } = this;
  4103. var fill = ctx.fillStyle;
  4104. if (textDecoration === 'underline') {
  4105. ctx.beginPath();
  4106. }
  4107. glyphInfo.forEach((glyph, i) => {
  4108. var {
  4109. p0,
  4110. p1,
  4111. rotation,
  4112. text: partialText
  4113. } = glyph;
  4114. ctx.save();
  4115. ctx.translate(p0.x, p0.y);
  4116. ctx.rotate(rotation);
  4117. if (ctx.fillStyle) {
  4118. ctx.fillText(partialText, 0, 0);
  4119. }
  4120. if (ctx.strokeStyle) {
  4121. ctx.strokeText(partialText, 0, 0);
  4122. }
  4123. ctx.restore();
  4124. if (textDecoration === 'underline') {
  4125. if (i === 0) {
  4126. ctx.moveTo(p0.x, p0.y + fontSize / 8);
  4127. }
  4128. ctx.lineTo(p1.x, p1.y + fontSize / 5);
  4129. } // // To assist with debugging visually, uncomment following
  4130. //
  4131. // ctx.beginPath();
  4132. // if (i % 2)
  4133. // ctx.strokeStyle = 'red';
  4134. // else
  4135. // ctx.strokeStyle = 'green';
  4136. // ctx.moveTo(p0.x, p0.y);
  4137. // ctx.lineTo(p1.x, p1.y);
  4138. // ctx.stroke();
  4139. // ctx.closePath();
  4140. });
  4141. if (textDecoration === 'underline') {
  4142. ctx.lineWidth = fontSize / 20;
  4143. ctx.strokeStyle = fill;
  4144. ctx.stroke();
  4145. ctx.closePath();
  4146. }
  4147. ctx.restore();
  4148. }
  4149. getLetterSpacingAt() {
  4150. var idx = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
  4151. return this.letterSpacingCache[idx] || 0;
  4152. }
  4153. findSegmentToFitChar(ctx, anchor, textFullWidth, fullPathWidth, spacesNumber, inputOffset, dy, c, charI) {
  4154. var offset = inputOffset;
  4155. var glyphWidth = this.measureText(ctx, c);
  4156. if (c === ' ' && anchor === 'justify' && textFullWidth < fullPathWidth) {
  4157. glyphWidth += (fullPathWidth - textFullWidth) / spacesNumber;
  4158. }
  4159. if (charI > -1) {
  4160. offset += this.getLetterSpacingAt(charI);
  4161. }
  4162. var splineStep = this.textHeight / 20;
  4163. var p0 = this.getEquidistantPointOnPath(offset, splineStep, 0);
  4164. var p1 = this.getEquidistantPointOnPath(offset + glyphWidth, splineStep, 0);
  4165. var segment = {
  4166. p0,
  4167. p1
  4168. };
  4169. var rotation = p0 && p1 ? Math.atan2(p1.y - p0.y, p1.x - p0.x) : 0;
  4170. if (dy) {
  4171. var dyX = Math.cos(Math.PI / 2 + rotation) * dy;
  4172. var dyY = Math.cos(-rotation) * dy;
  4173. segment.p0 = _objectSpread$2(_objectSpread$2({}, p0), {}, {
  4174. x: p0.x + dyX,
  4175. y: p0.y + dyY
  4176. });
  4177. segment.p1 = _objectSpread$2(_objectSpread$2({}, p1), {}, {
  4178. x: p1.x + dyX,
  4179. y: p1.y + dyY
  4180. });
  4181. }
  4182. offset += glyphWidth;
  4183. return {
  4184. offset,
  4185. segment,
  4186. rotation
  4187. };
  4188. }
  4189. measureText(ctx, text) {
  4190. var {
  4191. measuresCache
  4192. } = this;
  4193. var targetText = text || this.getText();
  4194. if (measuresCache.has(targetText)) {
  4195. return measuresCache.get(targetText);
  4196. }
  4197. var measure = this.measureTargetText(ctx, targetText);
  4198. measuresCache.set(targetText, measure);
  4199. return measure;
  4200. } // This method supposes what all custom fonts already loaded.
  4201. // If some font will be loaded after this method call, <textPath> will not be rendered correctly.
  4202. // You need to call this method manually to update glyphs cache.
  4203. setTextData(ctx) {
  4204. if (this.glyphInfo) {
  4205. return;
  4206. }
  4207. var renderText = this.getText();
  4208. var chars = renderText.split('');
  4209. var spacesNumber = renderText.split(' ').length - 1;
  4210. var dx = this.parent.getAttribute('dx').split().map(_ => _.getPixels('x'));
  4211. var dy = this.parent.getAttribute('dy').getPixels('y');
  4212. var anchor = this.parent.getStyle('text-anchor').getString('start');
  4213. var thisSpacing = this.getStyle('letter-spacing');
  4214. var parentSpacing = this.parent.getStyle('letter-spacing');
  4215. var letterSpacing = 0;
  4216. if (!thisSpacing.hasValue() || thisSpacing.getValue() === 'inherit') {
  4217. letterSpacing = parentSpacing.getPixels();
  4218. } else if (thisSpacing.hasValue()) {
  4219. if (thisSpacing.getValue() !== 'initial' && thisSpacing.getValue() !== 'unset') {
  4220. letterSpacing = thisSpacing.getPixels();
  4221. }
  4222. } // fill letter-spacing cache
  4223. var letterSpacingCache = [];
  4224. var textLen = renderText.length;
  4225. this.letterSpacingCache = letterSpacingCache;
  4226. for (var i = 0; i < textLen; i++) {
  4227. letterSpacingCache.push(typeof dx[i] !== 'undefined' ? dx[i] : letterSpacing);
  4228. }
  4229. var dxSum = letterSpacingCache.reduce((acc, cur, i) => i === 0 ? 0 : acc + cur || 0, 0);
  4230. var textWidth = this.measureText(ctx);
  4231. var textFullWidth = Math.max(textWidth + dxSum, 0);
  4232. this.textWidth = textWidth;
  4233. this.textHeight = this.getFontSize();
  4234. this.glyphInfo = [];
  4235. var fullPathWidth = this.getPathLength();
  4236. var startOffset = this.getStyle('startOffset').getNumber(0) * fullPathWidth;
  4237. var offset = 0;
  4238. if (anchor === 'middle' || anchor === 'center') {
  4239. offset = -textFullWidth / 2;
  4240. }
  4241. if (anchor === 'end' || anchor === 'right') {
  4242. offset = -textFullWidth;
  4243. }
  4244. offset += startOffset;
  4245. chars.forEach((char, i) => {
  4246. // Find such segment what distance between p0 and p1 is approx. width of glyph
  4247. var {
  4248. offset: nextOffset,
  4249. segment,
  4250. rotation
  4251. } = this.findSegmentToFitChar(ctx, anchor, textFullWidth, fullPathWidth, spacesNumber, offset, dy, char, i);
  4252. offset = nextOffset;
  4253. if (!segment.p0 || !segment.p1) {
  4254. return;
  4255. } // const width = this.getLineLength(
  4256. // segment.p0.x,
  4257. // segment.p0.y,
  4258. // segment.p1.x,
  4259. // segment.p1.y
  4260. // );
  4261. // Note: Since glyphs are rendered one at a time, any kerning pair data built into the font will not be used.
  4262. // Can foresee having a rough pair table built in that the developer can override as needed.
  4263. // Or use "dx" attribute of the <text> node as a naive replacement
  4264. // const kern = 0;
  4265. // placeholder for future implementation
  4266. // const midpoint = this.getPointOnLine(
  4267. // kern + width / 2.0,
  4268. // segment.p0.x, segment.p0.y, segment.p1.x, segment.p1.y
  4269. // );
  4270. this.glyphInfo.push({
  4271. // transposeX: midpoint.x,
  4272. // transposeY: midpoint.y,
  4273. text: chars[i],
  4274. p0: segment.p0,
  4275. p1: segment.p1,
  4276. rotation
  4277. });
  4278. });
  4279. }
  4280. parsePathData(path) {
  4281. this.pathLength = -1; // reset path length
  4282. if (!path) {
  4283. return [];
  4284. }
  4285. var pathCommands = [];
  4286. var {
  4287. pathParser
  4288. } = path;
  4289. pathParser.reset(); // convert l, H, h, V, and v to L
  4290. while (!pathParser.isEnd()) {
  4291. var {
  4292. current
  4293. } = pathParser;
  4294. var startX = current ? current.x : 0;
  4295. var startY = current ? current.y : 0;
  4296. var command = pathParser.next();
  4297. var nextCommandType = command.type;
  4298. var points = [];
  4299. switch (command.type) {
  4300. case PathParser.MOVE_TO:
  4301. this.pathM(pathParser, points);
  4302. break;
  4303. case PathParser.LINE_TO:
  4304. nextCommandType = this.pathL(pathParser, points);
  4305. break;
  4306. case PathParser.HORIZ_LINE_TO:
  4307. nextCommandType = this.pathH(pathParser, points);
  4308. break;
  4309. case PathParser.VERT_LINE_TO:
  4310. nextCommandType = this.pathV(pathParser, points);
  4311. break;
  4312. case PathParser.CURVE_TO:
  4313. this.pathC(pathParser, points);
  4314. break;
  4315. case PathParser.SMOOTH_CURVE_TO:
  4316. nextCommandType = this.pathS(pathParser, points);
  4317. break;
  4318. case PathParser.QUAD_TO:
  4319. this.pathQ(pathParser, points);
  4320. break;
  4321. case PathParser.SMOOTH_QUAD_TO:
  4322. nextCommandType = this.pathT(pathParser, points);
  4323. break;
  4324. case PathParser.ARC:
  4325. points = this.pathA(pathParser);
  4326. break;
  4327. case PathParser.CLOSE_PATH:
  4328. PathElement.pathZ(pathParser);
  4329. break;
  4330. }
  4331. if (command.type !== PathParser.CLOSE_PATH) {
  4332. pathCommands.push({
  4333. type: nextCommandType,
  4334. points,
  4335. start: {
  4336. x: startX,
  4337. y: startY
  4338. },
  4339. pathLength: this.calcLength(startX, startY, nextCommandType, points)
  4340. });
  4341. } else {
  4342. pathCommands.push({
  4343. type: PathParser.CLOSE_PATH,
  4344. points: [],
  4345. pathLength: 0
  4346. });
  4347. }
  4348. }
  4349. return pathCommands;
  4350. }
  4351. pathM(pathParser, points) {
  4352. var {
  4353. x,
  4354. y
  4355. } = PathElement.pathM(pathParser).point;
  4356. points.push(x, y);
  4357. }
  4358. pathL(pathParser, points) {
  4359. var {
  4360. x,
  4361. y
  4362. } = PathElement.pathL(pathParser).point;
  4363. points.push(x, y);
  4364. return PathParser.LINE_TO;
  4365. }
  4366. pathH(pathParser, points) {
  4367. var {
  4368. x,
  4369. y
  4370. } = PathElement.pathH(pathParser).point;
  4371. points.push(x, y);
  4372. return PathParser.LINE_TO;
  4373. }
  4374. pathV(pathParser, points) {
  4375. var {
  4376. x,
  4377. y
  4378. } = PathElement.pathV(pathParser).point;
  4379. points.push(x, y);
  4380. return PathParser.LINE_TO;
  4381. }
  4382. pathC(pathParser, points) {
  4383. var {
  4384. point,
  4385. controlPoint,
  4386. currentPoint
  4387. } = PathElement.pathC(pathParser);
  4388. points.push(point.x, point.y, controlPoint.x, controlPoint.y, currentPoint.x, currentPoint.y);
  4389. }
  4390. pathS(pathParser, points) {
  4391. var {
  4392. point,
  4393. controlPoint,
  4394. currentPoint
  4395. } = PathElement.pathS(pathParser);
  4396. points.push(point.x, point.y, controlPoint.x, controlPoint.y, currentPoint.x, currentPoint.y);
  4397. return PathParser.CURVE_TO;
  4398. }
  4399. pathQ(pathParser, points) {
  4400. var {
  4401. controlPoint,
  4402. currentPoint
  4403. } = PathElement.pathQ(pathParser);
  4404. points.push(controlPoint.x, controlPoint.y, currentPoint.x, currentPoint.y);
  4405. }
  4406. pathT(pathParser, points) {
  4407. var {
  4408. controlPoint,
  4409. currentPoint
  4410. } = PathElement.pathT(pathParser);
  4411. points.push(controlPoint.x, controlPoint.y, currentPoint.x, currentPoint.y);
  4412. return PathParser.QUAD_TO;
  4413. }
  4414. pathA(pathParser) {
  4415. var {
  4416. rX,
  4417. rY,
  4418. sweepFlag,
  4419. xAxisRotation,
  4420. centp,
  4421. a1,
  4422. ad
  4423. } = PathElement.pathA(pathParser);
  4424. if (sweepFlag === 0 && ad > 0) {
  4425. ad -= 2 * Math.PI;
  4426. }
  4427. if (sweepFlag === 1 && ad < 0) {
  4428. ad += 2 * Math.PI;
  4429. }
  4430. return [centp.x, centp.y, rX, rY, a1, ad, xAxisRotation, sweepFlag];
  4431. }
  4432. calcLength(x, y, commandType, points) {
  4433. var len = 0;
  4434. var p1 = null;
  4435. var p2 = null;
  4436. var t = 0;
  4437. switch (commandType) {
  4438. case PathParser.LINE_TO:
  4439. return this.getLineLength(x, y, points[0], points[1]);
  4440. case PathParser.CURVE_TO:
  4441. // Approximates by breaking curve into 100 line segments
  4442. len = 0.0;
  4443. p1 = this.getPointOnCubicBezier(0, x, y, points[0], points[1], points[2], points[3], points[4], points[5]);
  4444. for (t = 0.01; t <= 1; t += 0.01) {
  4445. p2 = this.getPointOnCubicBezier(t, x, y, points[0], points[1], points[2], points[3], points[4], points[5]);
  4446. len += this.getLineLength(p1.x, p1.y, p2.x, p2.y);
  4447. p1 = p2;
  4448. }
  4449. return len;
  4450. case PathParser.QUAD_TO:
  4451. // Approximates by breaking curve into 100 line segments
  4452. len = 0.0;
  4453. p1 = this.getPointOnQuadraticBezier(0, x, y, points[0], points[1], points[2], points[3]);
  4454. for (t = 0.01; t <= 1; t += 0.01) {
  4455. p2 = this.getPointOnQuadraticBezier(t, x, y, points[0], points[1], points[2], points[3]);
  4456. len += this.getLineLength(p1.x, p1.y, p2.x, p2.y);
  4457. p1 = p2;
  4458. }
  4459. return len;
  4460. case PathParser.ARC:
  4461. {
  4462. // Approximates by breaking curve into line segments
  4463. len = 0.0;
  4464. var start = points[4]; // 4 = theta
  4465. var dTheta = points[5]; // 5 = dTheta
  4466. var end = points[4] + dTheta;
  4467. var inc = Math.PI / 180.0; // 1 degree resolution
  4468. if (Math.abs(start - end) < inc) {
  4469. inc = Math.abs(start - end);
  4470. } // Note: for purpose of calculating arc length, not going to worry about rotating X-axis by angle psi
  4471. p1 = this.getPointOnEllipticalArc(points[0], points[1], points[2], points[3], start, 0);
  4472. if (dTheta < 0) {
  4473. // clockwise
  4474. for (t = start - inc; t > end; t -= inc) {
  4475. p2 = this.getPointOnEllipticalArc(points[0], points[1], points[2], points[3], t, 0);
  4476. len += this.getLineLength(p1.x, p1.y, p2.x, p2.y);
  4477. p1 = p2;
  4478. }
  4479. } else {
  4480. // counter-clockwise
  4481. for (t = start + inc; t < end; t += inc) {
  4482. p2 = this.getPointOnEllipticalArc(points[0], points[1], points[2], points[3], t, 0);
  4483. len += this.getLineLength(p1.x, p1.y, p2.x, p2.y);
  4484. p1 = p2;
  4485. }
  4486. }
  4487. p2 = this.getPointOnEllipticalArc(points[0], points[1], points[2], points[3], end, 0);
  4488. len += this.getLineLength(p1.x, p1.y, p2.x, p2.y);
  4489. return len;
  4490. }
  4491. }
  4492. return 0;
  4493. }
  4494. getPointOnLine(dist, p1x, p1y, p2x, p2y) {
  4495. var fromX = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : p1x;
  4496. var fromY = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : p1y;
  4497. var m = (p2y - p1y) / (p2x - p1x + PSEUDO_ZERO);
  4498. var run = Math.sqrt(dist * dist / (1 + m * m));
  4499. if (p2x < p1x) {
  4500. run *= -1;
  4501. }
  4502. var rise = m * run;
  4503. var pt = null;
  4504. if (p2x === p1x) {
  4505. // vertical line
  4506. pt = {
  4507. x: fromX,
  4508. y: fromY + rise
  4509. };
  4510. } else if ((fromY - p1y) / (fromX - p1x + PSEUDO_ZERO) === m) {
  4511. pt = {
  4512. x: fromX + run,
  4513. y: fromY + rise
  4514. };
  4515. } else {
  4516. var ix = 0;
  4517. var iy = 0;
  4518. var len = this.getLineLength(p1x, p1y, p2x, p2y);
  4519. if (len < PSEUDO_ZERO) {
  4520. return null;
  4521. }
  4522. var u = (fromX - p1x) * (p2x - p1x) + (fromY - p1y) * (p2y - p1y);
  4523. u /= len * len;
  4524. ix = p1x + u * (p2x - p1x);
  4525. iy = p1y + u * (p2y - p1y);
  4526. var pRise = this.getLineLength(fromX, fromY, ix, iy);
  4527. var pRun = Math.sqrt(dist * dist - pRise * pRise);
  4528. run = Math.sqrt(pRun * pRun / (1 + m * m));
  4529. if (p2x < p1x) {
  4530. run *= -1;
  4531. }
  4532. rise = m * run;
  4533. pt = {
  4534. x: ix + run,
  4535. y: iy + rise
  4536. };
  4537. }
  4538. return pt;
  4539. }
  4540. getPointOnPath(distance) {
  4541. var fullLen = this.getPathLength();
  4542. var cumulativePathLength = 0;
  4543. var p = null;
  4544. if (distance < -0.00005 || distance - 0.00005 > fullLen) {
  4545. return null;
  4546. }
  4547. var {
  4548. dataArray
  4549. } = this;
  4550. for (var command of dataArray) {
  4551. if (command && (command.pathLength < 0.00005 || cumulativePathLength + command.pathLength + 0.00005 < distance)) {
  4552. cumulativePathLength += command.pathLength;
  4553. continue;
  4554. }
  4555. var delta = distance - cumulativePathLength;
  4556. var currentT = 0;
  4557. switch (command.type) {
  4558. case PathParser.LINE_TO:
  4559. p = this.getPointOnLine(delta, command.start.x, command.start.y, command.points[0], command.points[1], command.start.x, command.start.y);
  4560. break;
  4561. case PathParser.ARC:
  4562. {
  4563. var start = command.points[4]; // 4 = theta
  4564. var dTheta = command.points[5]; // 5 = dTheta
  4565. var end = command.points[4] + dTheta;
  4566. currentT = start + delta / command.pathLength * dTheta;
  4567. if (dTheta < 0 && currentT < end || dTheta >= 0 && currentT > end) {
  4568. break;
  4569. }
  4570. p = this.getPointOnEllipticalArc(command.points[0], command.points[1], command.points[2], command.points[3], currentT, command.points[6]);
  4571. break;
  4572. }
  4573. case PathParser.CURVE_TO:
  4574. currentT = delta / command.pathLength;
  4575. if (currentT > 1) {
  4576. currentT = 1;
  4577. }
  4578. p = this.getPointOnCubicBezier(currentT, command.start.x, command.start.y, command.points[0], command.points[1], command.points[2], command.points[3], command.points[4], command.points[5]);
  4579. break;
  4580. case PathParser.QUAD_TO:
  4581. currentT = delta / command.pathLength;
  4582. if (currentT > 1) {
  4583. currentT = 1;
  4584. }
  4585. p = this.getPointOnQuadraticBezier(currentT, command.start.x, command.start.y, command.points[0], command.points[1], command.points[2], command.points[3]);
  4586. break;
  4587. }
  4588. if (p) {
  4589. return p;
  4590. }
  4591. break;
  4592. }
  4593. return null;
  4594. }
  4595. getLineLength(x1, y1, x2, y2) {
  4596. return Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));
  4597. }
  4598. getPathLength() {
  4599. if (this.pathLength === -1) {
  4600. this.pathLength = this.dataArray.reduce((length, command) => command.pathLength > 0 ? length + command.pathLength : length, 0);
  4601. }
  4602. return this.pathLength;
  4603. }
  4604. getPointOnCubicBezier(pct, p1x, p1y, p2x, p2y, p3x, p3y, p4x, p4y) {
  4605. var x = p4x * CB1(pct) + p3x * CB2(pct) + p2x * CB3(pct) + p1x * CB4(pct);
  4606. var y = p4y * CB1(pct) + p3y * CB2(pct) + p2y * CB3(pct) + p1y * CB4(pct);
  4607. return {
  4608. x,
  4609. y
  4610. };
  4611. }
  4612. getPointOnQuadraticBezier(pct, p1x, p1y, p2x, p2y, p3x, p3y) {
  4613. var x = p3x * QB1(pct) + p2x * QB2(pct) + p1x * QB3(pct);
  4614. var y = p3y * QB1(pct) + p2y * QB2(pct) + p1y * QB3(pct);
  4615. return {
  4616. x,
  4617. y
  4618. };
  4619. }
  4620. getPointOnEllipticalArc(cx, cy, rx, ry, theta, psi) {
  4621. var cosPsi = Math.cos(psi);
  4622. var sinPsi = Math.sin(psi);
  4623. var pt = {
  4624. x: rx * Math.cos(theta),
  4625. y: ry * Math.sin(theta)
  4626. };
  4627. return {
  4628. x: cx + (pt.x * cosPsi - pt.y * sinPsi),
  4629. y: cy + (pt.x * sinPsi + pt.y * cosPsi)
  4630. };
  4631. } // TODO need some optimisations. possibly build cache only for curved segments?
  4632. buildEquidistantCache(inputStep, inputPrecision) {
  4633. var fullLen = this.getPathLength();
  4634. var precision = inputPrecision || 0.25; // accuracy vs performance
  4635. var step = inputStep || fullLen / 100;
  4636. if (!this.equidistantCache || this.equidistantCache.step !== step || this.equidistantCache.precision !== precision) {
  4637. // Prepare cache
  4638. this.equidistantCache = {
  4639. step,
  4640. precision,
  4641. points: []
  4642. }; // Calculate points
  4643. var s = 0;
  4644. for (var l = 0; l <= fullLen; l += precision) {
  4645. var p0 = this.getPointOnPath(l);
  4646. var p1 = this.getPointOnPath(l + precision);
  4647. if (!p0 || !p1) {
  4648. continue;
  4649. }
  4650. s += this.getLineLength(p0.x, p0.y, p1.x, p1.y);
  4651. if (s >= step) {
  4652. this.equidistantCache.points.push({
  4653. x: p0.x,
  4654. y: p0.y,
  4655. distance: l
  4656. });
  4657. s -= step;
  4658. }
  4659. }
  4660. }
  4661. }
  4662. getEquidistantPointOnPath(targetDistance, step, precision) {
  4663. this.buildEquidistantCache(step, precision);
  4664. if (targetDistance < 0 || targetDistance - this.getPathLength() > 0.00005) {
  4665. return null;
  4666. }
  4667. var idx = Math.round(targetDistance / this.getPathLength() * (this.equidistantCache.points.length - 1));
  4668. return this.equidistantCache.points[idx] || null;
  4669. }
  4670. }
  4671. var dataUriRegex = /^\s*data:(([^/,;]+\/[^/,;]+)(?:;([^,;=]+=[^,;=]+))?)?(?:;(base64))?,(.*)$/i;
  4672. class ImageElement extends RenderedElement {
  4673. constructor(document, node, captureTextNodes) {
  4674. super(document, node, captureTextNodes);
  4675. this.type = 'image';
  4676. this.loaded = false;
  4677. var href = this.getHrefAttribute().getString();
  4678. if (!href) {
  4679. return;
  4680. }
  4681. var isSvg = href.endsWith('.svg') || /^\s*data:image\/svg\+xml/i.test(href);
  4682. document.images.push(this);
  4683. if (!isSvg) {
  4684. void this.loadImage(href);
  4685. } else {
  4686. void this.loadSvg(href);
  4687. }
  4688. this.isSvg = isSvg;
  4689. }
  4690. loadImage(href) {
  4691. var _this = this;
  4692. return _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()(function* () {
  4693. try {
  4694. var image = yield _this.document.createImage(href);
  4695. _this.image = image;
  4696. } catch (err) {
  4697. console.error("Error while loading image \"".concat(href, "\":"), err);
  4698. }
  4699. _this.loaded = true;
  4700. })();
  4701. }
  4702. loadSvg(href) {
  4703. var _this2 = this;
  4704. return _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()(function* () {
  4705. var match = dataUriRegex.exec(href);
  4706. if (match) {
  4707. var data = match[5];
  4708. if (match[4] === 'base64') {
  4709. _this2.image = atob(data);
  4710. } else {
  4711. _this2.image = decodeURIComponent(data);
  4712. }
  4713. } else {
  4714. try {
  4715. var response = yield _this2.document.fetch(href);
  4716. var svg = yield response.text();
  4717. _this2.image = svg;
  4718. } catch (err) {
  4719. console.error("Error while loading image \"".concat(href, "\":"), err);
  4720. }
  4721. }
  4722. _this2.loaded = true;
  4723. })();
  4724. }
  4725. renderChildren(ctx) {
  4726. var {
  4727. document,
  4728. image,
  4729. loaded
  4730. } = this;
  4731. var x = this.getAttribute('x').getPixels('x');
  4732. var y = this.getAttribute('y').getPixels('y');
  4733. var width = this.getStyle('width').getPixels('x');
  4734. var height = this.getStyle('height').getPixels('y');
  4735. if (!loaded || !image || !width || !height) {
  4736. return;
  4737. }
  4738. ctx.save();
  4739. ctx.translate(x, y);
  4740. if (this.isSvg) {
  4741. var subDocument = document.canvg.forkString(ctx, this.image, {
  4742. ignoreMouse: true,
  4743. ignoreAnimation: true,
  4744. ignoreDimensions: true,
  4745. ignoreClear: true,
  4746. offsetX: 0,
  4747. offsetY: 0,
  4748. scaleWidth: width,
  4749. scaleHeight: height
  4750. });
  4751. subDocument.document.documentElement.parent = this;
  4752. void subDocument.render();
  4753. } else {
  4754. var _image = this.image;
  4755. document.setViewBox({
  4756. ctx,
  4757. aspectRatio: this.getAttribute('preserveAspectRatio').getString(),
  4758. width,
  4759. desiredWidth: _image.width,
  4760. height,
  4761. desiredHeight: _image.height
  4762. });
  4763. if (this.loaded) {
  4764. if (typeof _image.complete === 'undefined' || _image.complete) {
  4765. ctx.drawImage(_image, 0, 0);
  4766. }
  4767. }
  4768. }
  4769. ctx.restore();
  4770. }
  4771. getBoundingBox() {
  4772. var x = this.getAttribute('x').getPixels('x');
  4773. var y = this.getAttribute('y').getPixels('y');
  4774. var width = this.getStyle('width').getPixels('x');
  4775. var height = this.getStyle('height').getPixels('y');
  4776. return new BoundingBox(x, y, x + width, y + height);
  4777. }
  4778. }
  4779. class SymbolElement extends RenderedElement {
  4780. constructor() {
  4781. super(...arguments);
  4782. this.type = 'symbol';
  4783. }
  4784. render(_) {// NO RENDER
  4785. }
  4786. }
  4787. class SVGFontLoader {
  4788. constructor(document) {
  4789. this.document = document;
  4790. this.loaded = false;
  4791. document.fonts.push(this);
  4792. }
  4793. load(fontFamily, url) {
  4794. var _this = this;
  4795. return _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()(function* () {
  4796. try {
  4797. var {
  4798. document
  4799. } = _this;
  4800. var svgDocument = yield document.canvg.parser.load(url);
  4801. var fonts = svgDocument.getElementsByTagName('font');
  4802. Array.from(fonts).forEach(fontNode => {
  4803. var font = document.createElement(fontNode);
  4804. document.definitions[fontFamily] = font;
  4805. });
  4806. } catch (err) {
  4807. console.error("Error while loading font \"".concat(url, "\":"), err);
  4808. }
  4809. _this.loaded = true;
  4810. })();
  4811. }
  4812. }
  4813. class StyleElement extends Element {
  4814. constructor(document, node, captureTextNodes) {
  4815. super(document, node, captureTextNodes);
  4816. this.type = 'style';
  4817. var css = compressSpaces(Array.from(node.childNodes) // NEED TEST
  4818. .map(_ => _.textContent).join('').replace(/(\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+\/)|(^[\s]*\/\/.*)/gm, '') // remove comments
  4819. .replace(/@import.*;/g, '') // remove imports
  4820. );
  4821. var cssDefs = css.split('}');
  4822. cssDefs.forEach(_ => {
  4823. var def = _.trim();
  4824. if (!def) {
  4825. return;
  4826. }
  4827. var cssParts = def.split('{');
  4828. var cssClasses = cssParts[0].split(',');
  4829. var cssProps = cssParts[1].split(';');
  4830. cssClasses.forEach(_ => {
  4831. var cssClass = _.trim();
  4832. if (!cssClass) {
  4833. return;
  4834. }
  4835. var props = document.styles[cssClass] || {};
  4836. cssProps.forEach(cssProp => {
  4837. var prop = cssProp.indexOf(':');
  4838. var name = cssProp.substr(0, prop).trim();
  4839. var value = cssProp.substr(prop + 1, cssProp.length - prop).trim();
  4840. if (name && value) {
  4841. props[name] = new Property(document, name, value);
  4842. }
  4843. });
  4844. document.styles[cssClass] = props;
  4845. document.stylesSpecificity[cssClass] = getSelectorSpecificity(cssClass);
  4846. if (cssClass === '@font-face') {
  4847. // && !nodeEnv
  4848. var fontFamily = props['font-family'].getString().replace(/"|'/g, '');
  4849. var srcs = props.src.getString().split(',');
  4850. srcs.forEach(src => {
  4851. if (src.indexOf('format("svg")') > 0) {
  4852. var url = parseExternalUrl(src);
  4853. if (url) {
  4854. void new SVGFontLoader(document).load(fontFamily, url);
  4855. }
  4856. }
  4857. });
  4858. }
  4859. });
  4860. });
  4861. }
  4862. }
  4863. StyleElement.parseExternalUrl = parseExternalUrl;
  4864. class UseElement extends RenderedElement {
  4865. constructor() {
  4866. super(...arguments);
  4867. this.type = 'use';
  4868. }
  4869. setContext(ctx) {
  4870. super.setContext(ctx);
  4871. var xAttr = this.getAttribute('x');
  4872. var yAttr = this.getAttribute('y');
  4873. if (xAttr.hasValue()) {
  4874. ctx.translate(xAttr.getPixels('x'), 0);
  4875. }
  4876. if (yAttr.hasValue()) {
  4877. ctx.translate(0, yAttr.getPixels('y'));
  4878. }
  4879. }
  4880. path(ctx) {
  4881. var {
  4882. element
  4883. } = this;
  4884. if (element) {
  4885. element.path(ctx);
  4886. }
  4887. }
  4888. renderChildren(ctx) {
  4889. var {
  4890. document,
  4891. element
  4892. } = this;
  4893. if (element) {
  4894. var tempSvg = element;
  4895. if (element.type === 'symbol') {
  4896. // render me using a temporary svg element in symbol cases (http://www.w3.org/TR/SVG/struct.html#UseElement)
  4897. tempSvg = new SVGElement(document, null);
  4898. tempSvg.attributes.viewBox = new Property(document, 'viewBox', element.getAttribute('viewBox').getString());
  4899. tempSvg.attributes.preserveAspectRatio = new Property(document, 'preserveAspectRatio', element.getAttribute('preserveAspectRatio').getString());
  4900. tempSvg.attributes.overflow = new Property(document, 'overflow', element.getAttribute('overflow').getString());
  4901. tempSvg.children = element.children; // element is still the parent of the children
  4902. element.styles.opacity = new Property(document, 'opacity', this.calculateOpacity());
  4903. }
  4904. if (tempSvg.type === 'svg') {
  4905. var widthStyle = this.getStyle('width', false, true);
  4906. var heightStyle = this.getStyle('height', false, true); // if symbol or svg, inherit width/height from me
  4907. if (widthStyle.hasValue()) {
  4908. tempSvg.attributes.width = new Property(document, 'width', widthStyle.getString());
  4909. }
  4910. if (heightStyle.hasValue()) {
  4911. tempSvg.attributes.height = new Property(document, 'height', heightStyle.getString());
  4912. }
  4913. }
  4914. var oldParent = tempSvg.parent;
  4915. tempSvg.parent = this;
  4916. tempSvg.render(ctx);
  4917. tempSvg.parent = oldParent;
  4918. }
  4919. }
  4920. getBoundingBox(ctx) {
  4921. var {
  4922. element
  4923. } = this;
  4924. if (element) {
  4925. return element.getBoundingBox(ctx);
  4926. }
  4927. return null;
  4928. }
  4929. elementTransform() {
  4930. var {
  4931. document,
  4932. element
  4933. } = this;
  4934. return Transform.fromElement(document, element);
  4935. }
  4936. get element() {
  4937. if (!this.cachedElement) {
  4938. this.cachedElement = this.getHrefAttribute().getDefinition();
  4939. }
  4940. return this.cachedElement;
  4941. }
  4942. }
  4943. function imGet(img, x, y, width, _height, rgba) {
  4944. return img[y * width * 4 + x * 4 + rgba];
  4945. }
  4946. function imSet(img, x, y, width, _height, rgba, val) {
  4947. img[y * width * 4 + x * 4 + rgba] = val;
  4948. }
  4949. function m(matrix, i, v) {
  4950. var mi = matrix[i];
  4951. return mi * v;
  4952. }
  4953. function c(a, m1, m2, m3) {
  4954. return m1 + Math.cos(a) * m2 + Math.sin(a) * m3;
  4955. }
  4956. class FeColorMatrixElement extends Element {
  4957. constructor(document, node, captureTextNodes) {
  4958. super(document, node, captureTextNodes);
  4959. this.type = 'feColorMatrix';
  4960. var matrix = toNumbers(this.getAttribute('values').getString());
  4961. switch (this.getAttribute('type').getString('matrix')) {
  4962. // http://www.w3.org/TR/SVG/filters.html#feColorMatrixElement
  4963. case 'saturate':
  4964. {
  4965. var s = matrix[0];
  4966. /* eslint-disable array-element-newline */
  4967. matrix = [0.213 + 0.787 * s, 0.715 - 0.715 * s, 0.072 - 0.072 * s, 0, 0, 0.213 - 0.213 * s, 0.715 + 0.285 * s, 0.072 - 0.072 * s, 0, 0, 0.213 - 0.213 * s, 0.715 - 0.715 * s, 0.072 + 0.928 * s, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1];
  4968. /* eslint-enable array-element-newline */
  4969. break;
  4970. }
  4971. case 'hueRotate':
  4972. {
  4973. var a = matrix[0] * Math.PI / 180.0;
  4974. /* eslint-disable array-element-newline */
  4975. matrix = [c(a, 0.213, 0.787, -0.213), c(a, 0.715, -0.715, -0.715), c(a, 0.072, -0.072, 0.928), 0, 0, c(a, 0.213, -0.213, 0.143), c(a, 0.715, 0.285, 0.140), c(a, 0.072, -0.072, -0.283), 0, 0, c(a, 0.213, -0.213, -0.787), c(a, 0.715, -0.715, 0.715), c(a, 0.072, 0.928, 0.072), 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1];
  4976. /* eslint-enable array-element-newline */
  4977. break;
  4978. }
  4979. case 'luminanceToAlpha':
  4980. /* eslint-disable array-element-newline */
  4981. matrix = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.2125, 0.7154, 0.0721, 0, 0, 0, 0, 0, 0, 1];
  4982. /* eslint-enable array-element-newline */
  4983. break;
  4984. }
  4985. this.matrix = matrix;
  4986. this.includeOpacity = this.getAttribute('includeOpacity').hasValue();
  4987. }
  4988. apply(ctx, _x, _y, width, height) {
  4989. // assuming x==0 && y==0 for now
  4990. var {
  4991. includeOpacity,
  4992. matrix
  4993. } = this;
  4994. var srcData = ctx.getImageData(0, 0, width, height);
  4995. for (var y = 0; y < height; y++) {
  4996. for (var x = 0; x < width; x++) {
  4997. var r = imGet(srcData.data, x, y, width, height, 0);
  4998. var g = imGet(srcData.data, x, y, width, height, 1);
  4999. var b = imGet(srcData.data, x, y, width, height, 2);
  5000. var a = imGet(srcData.data, x, y, width, height, 3);
  5001. var nr = m(matrix, 0, r) + m(matrix, 1, g) + m(matrix, 2, b) + m(matrix, 3, a) + m(matrix, 4, 1);
  5002. var ng = m(matrix, 5, r) + m(matrix, 6, g) + m(matrix, 7, b) + m(matrix, 8, a) + m(matrix, 9, 1);
  5003. var nb = m(matrix, 10, r) + m(matrix, 11, g) + m(matrix, 12, b) + m(matrix, 13, a) + m(matrix, 14, 1);
  5004. var na = m(matrix, 15, r) + m(matrix, 16, g) + m(matrix, 17, b) + m(matrix, 18, a) + m(matrix, 19, 1);
  5005. if (includeOpacity) {
  5006. nr = 0;
  5007. ng = 0;
  5008. nb = 0;
  5009. na *= a / 255;
  5010. }
  5011. imSet(srcData.data, x, y, width, height, 0, nr);
  5012. imSet(srcData.data, x, y, width, height, 1, ng);
  5013. imSet(srcData.data, x, y, width, height, 2, nb);
  5014. imSet(srcData.data, x, y, width, height, 3, na);
  5015. }
  5016. }
  5017. ctx.clearRect(0, 0, width, height);
  5018. ctx.putImageData(srcData, 0, 0);
  5019. }
  5020. }
  5021. class MaskElement extends Element {
  5022. constructor() {
  5023. super(...arguments);
  5024. this.type = 'mask';
  5025. }
  5026. apply(ctx, element) {
  5027. var {
  5028. document
  5029. } = this; // render as temp svg
  5030. var x = this.getAttribute('x').getPixels('x');
  5031. var y = this.getAttribute('y').getPixels('y');
  5032. var width = this.getStyle('width').getPixels('x');
  5033. var height = this.getStyle('height').getPixels('y');
  5034. if (!width && !height) {
  5035. var boundingBox = new BoundingBox();
  5036. this.children.forEach(child => {
  5037. boundingBox.addBoundingBox(child.getBoundingBox(ctx));
  5038. });
  5039. x = Math.floor(boundingBox.x1);
  5040. y = Math.floor(boundingBox.y1);
  5041. width = Math.floor(boundingBox.width);
  5042. height = Math.floor(boundingBox.height);
  5043. }
  5044. var ignoredStyles = this.removeStyles(element, MaskElement.ignoreStyles);
  5045. var maskCanvas = document.createCanvas(x + width, y + height);
  5046. var maskCtx = maskCanvas.getContext('2d');
  5047. document.screen.setDefaults(maskCtx);
  5048. this.renderChildren(maskCtx); // convert mask to alpha with a fake node
  5049. // TODO: refactor out apply from feColorMatrix
  5050. new FeColorMatrixElement(document, {
  5051. nodeType: 1,
  5052. childNodes: [],
  5053. attributes: [{
  5054. nodeName: 'type',
  5055. value: 'luminanceToAlpha'
  5056. }, {
  5057. nodeName: 'includeOpacity',
  5058. value: 'true'
  5059. }]
  5060. }).apply(maskCtx, 0, 0, x + width, y + height);
  5061. var tmpCanvas = document.createCanvas(x + width, y + height);
  5062. var tmpCtx = tmpCanvas.getContext('2d');
  5063. document.screen.setDefaults(tmpCtx);
  5064. element.render(tmpCtx);
  5065. tmpCtx.globalCompositeOperation = 'destination-in';
  5066. tmpCtx.fillStyle = maskCtx.createPattern(maskCanvas, 'no-repeat');
  5067. tmpCtx.fillRect(0, 0, x + width, y + height);
  5068. ctx.fillStyle = tmpCtx.createPattern(tmpCanvas, 'no-repeat');
  5069. ctx.fillRect(0, 0, x + width, y + height); // reassign mask
  5070. this.restoreStyles(element, ignoredStyles);
  5071. }
  5072. render(_) {// NO RENDER
  5073. }
  5074. }
  5075. MaskElement.ignoreStyles = ['mask', 'transform', 'clip-path'];
  5076. var noop = () => {// NOOP
  5077. };
  5078. class ClipPathElement extends Element {
  5079. constructor() {
  5080. super(...arguments);
  5081. this.type = 'clipPath';
  5082. }
  5083. apply(ctx) {
  5084. var {
  5085. document
  5086. } = this;
  5087. var contextProto = Reflect.getPrototypeOf(ctx);
  5088. var {
  5089. beginPath,
  5090. closePath
  5091. } = ctx;
  5092. if (contextProto) {
  5093. contextProto.beginPath = noop;
  5094. contextProto.closePath = noop;
  5095. }
  5096. Reflect.apply(beginPath, ctx, []);
  5097. this.children.forEach(child => {
  5098. if (typeof child.path === 'undefined') {
  5099. return;
  5100. }
  5101. var transform = typeof child.elementTransform !== 'undefined' ? child.elementTransform() : null; // handle <use />
  5102. if (!transform) {
  5103. transform = Transform.fromElement(document, child);
  5104. }
  5105. if (transform) {
  5106. transform.apply(ctx);
  5107. }
  5108. child.path(ctx);
  5109. if (contextProto) {
  5110. contextProto.closePath = closePath;
  5111. }
  5112. if (transform) {
  5113. transform.unapply(ctx);
  5114. }
  5115. });
  5116. Reflect.apply(closePath, ctx, []);
  5117. ctx.clip();
  5118. if (contextProto) {
  5119. contextProto.beginPath = beginPath;
  5120. contextProto.closePath = closePath;
  5121. }
  5122. }
  5123. render(_) {// NO RENDER
  5124. }
  5125. }
  5126. class FilterElement extends Element {
  5127. constructor() {
  5128. super(...arguments);
  5129. this.type = 'filter';
  5130. }
  5131. apply(ctx, element) {
  5132. // render as temp svg
  5133. var {
  5134. document,
  5135. children
  5136. } = this;
  5137. var boundingBox = element.getBoundingBox(ctx);
  5138. if (!boundingBox) {
  5139. return;
  5140. }
  5141. var px = 0;
  5142. var py = 0;
  5143. children.forEach(child => {
  5144. var efd = child.extraFilterDistance || 0;
  5145. px = Math.max(px, efd);
  5146. py = Math.max(py, efd);
  5147. });
  5148. var width = Math.floor(boundingBox.width);
  5149. var height = Math.floor(boundingBox.height);
  5150. var tmpCanvasWidth = width + 2 * px;
  5151. var tmpCanvasHeight = height + 2 * py;
  5152. if (tmpCanvasWidth < 1 || tmpCanvasHeight < 1) {
  5153. return;
  5154. }
  5155. var x = Math.floor(boundingBox.x);
  5156. var y = Math.floor(boundingBox.y);
  5157. var ignoredStyles = this.removeStyles(element, FilterElement.ignoreStyles);
  5158. var tmpCanvas = document.createCanvas(tmpCanvasWidth, tmpCanvasHeight);
  5159. var tmpCtx = tmpCanvas.getContext('2d');
  5160. document.screen.setDefaults(tmpCtx);
  5161. tmpCtx.translate(-x + px, -y + py);
  5162. element.render(tmpCtx); // apply filters
  5163. children.forEach(child => {
  5164. if (typeof child.apply === 'function') {
  5165. child.apply(tmpCtx, 0, 0, tmpCanvasWidth, tmpCanvasHeight);
  5166. }
  5167. }); // render on me
  5168. ctx.drawImage(tmpCanvas, 0, 0, tmpCanvasWidth, tmpCanvasHeight, x - px, y - py, tmpCanvasWidth, tmpCanvasHeight);
  5169. this.restoreStyles(element, ignoredStyles);
  5170. }
  5171. render(_) {// NO RENDER
  5172. }
  5173. }
  5174. FilterElement.ignoreStyles = ['filter', 'transform', 'clip-path'];
  5175. class FeDropShadowElement extends Element {
  5176. constructor(document, node, captureTextNodes) {
  5177. super(document, node, captureTextNodes);
  5178. this.type = 'feDropShadow';
  5179. this.addStylesFromStyleDefinition();
  5180. }
  5181. apply(_, _x, _y, _width, _height) {// TODO: implement
  5182. }
  5183. }
  5184. class FeMorphologyElement extends Element {
  5185. constructor() {
  5186. super(...arguments);
  5187. this.type = 'feMorphology';
  5188. }
  5189. apply(_, _x, _y, _width, _height) {// TODO: implement
  5190. }
  5191. }
  5192. class FeCompositeElement extends Element {
  5193. constructor() {
  5194. super(...arguments);
  5195. this.type = 'feComposite';
  5196. }
  5197. apply(_, _x, _y, _width, _height) {// TODO: implement
  5198. }
  5199. }
  5200. class FeGaussianBlurElement extends Element {
  5201. constructor(document, node, captureTextNodes) {
  5202. super(document, node, captureTextNodes);
  5203. this.type = 'feGaussianBlur';
  5204. this.blurRadius = Math.floor(this.getAttribute('stdDeviation').getNumber());
  5205. this.extraFilterDistance = this.blurRadius;
  5206. }
  5207. apply(ctx, x, y, width, height) {
  5208. var {
  5209. document,
  5210. blurRadius
  5211. } = this;
  5212. var body = document.window ? document.window.document.body : null;
  5213. var canvas = ctx.canvas; // StackBlur requires canvas be on document
  5214. canvas.id = document.getUniqueId();
  5215. if (body) {
  5216. canvas.style.display = 'none';
  5217. body.appendChild(canvas);
  5218. }
  5219. Object(stackblur_canvas__WEBPACK_IMPORTED_MODULE_19__["canvasRGBA"])(canvas, x, y, width, height, blurRadius);
  5220. if (body) {
  5221. body.removeChild(canvas);
  5222. }
  5223. }
  5224. }
  5225. class TitleElement extends Element {
  5226. constructor() {
  5227. super(...arguments);
  5228. this.type = 'title';
  5229. }
  5230. }
  5231. class DescElement extends Element {
  5232. constructor() {
  5233. super(...arguments);
  5234. this.type = 'desc';
  5235. }
  5236. }
  5237. var elements = {
  5238. 'svg': SVGElement,
  5239. 'rect': RectElement,
  5240. 'circle': CircleElement,
  5241. 'ellipse': EllipseElement,
  5242. 'line': LineElement,
  5243. 'polyline': PolylineElement,
  5244. 'polygon': PolygonElement,
  5245. 'path': PathElement,
  5246. 'pattern': PatternElement,
  5247. 'marker': MarkerElement,
  5248. 'defs': DefsElement,
  5249. 'linearGradient': LinearGradientElement,
  5250. 'radialGradient': RadialGradientElement,
  5251. 'stop': StopElement,
  5252. 'animate': AnimateElement,
  5253. 'animateColor': AnimateColorElement,
  5254. 'animateTransform': AnimateTransformElement,
  5255. 'font': FontElement,
  5256. 'font-face': FontFaceElement,
  5257. 'missing-glyph': MissingGlyphElement,
  5258. 'glyph': GlyphElement,
  5259. 'text': TextElement,
  5260. 'tspan': TSpanElement,
  5261. 'tref': TRefElement,
  5262. 'a': AElement,
  5263. 'textPath': TextPathElement,
  5264. 'image': ImageElement,
  5265. 'g': GElement,
  5266. 'symbol': SymbolElement,
  5267. 'style': StyleElement,
  5268. 'use': UseElement,
  5269. 'mask': MaskElement,
  5270. 'clipPath': ClipPathElement,
  5271. 'filter': FilterElement,
  5272. 'feDropShadow': FeDropShadowElement,
  5273. 'feMorphology': FeMorphologyElement,
  5274. 'feComposite': FeCompositeElement,
  5275. 'feColorMatrix': FeColorMatrixElement,
  5276. 'feGaussianBlur': FeGaussianBlurElement,
  5277. 'title': TitleElement,
  5278. 'desc': DescElement
  5279. };
  5280. function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
  5281. function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$1(Object(source), true).forEach(function (key) { _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_7___default()(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
  5282. function createCanvas(width, height) {
  5283. var canvas = document.createElement('canvas');
  5284. canvas.width = width;
  5285. canvas.height = height;
  5286. return canvas;
  5287. }
  5288. function createImage(_x) {
  5289. return _createImage.apply(this, arguments);
  5290. }
  5291. function _createImage() {
  5292. _createImage = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()(function* (src) {
  5293. var anonymousCrossOrigin = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  5294. var image = document.createElement('img');
  5295. if (anonymousCrossOrigin) {
  5296. image.crossOrigin = 'Anonymous';
  5297. }
  5298. return new Promise((resolve, reject) => {
  5299. image.onload = () => {
  5300. resolve(image);
  5301. };
  5302. image.onerror = (_event, _source, _lineno, _colno, error) => {
  5303. reject(error);
  5304. };
  5305. image.src = src;
  5306. });
  5307. });
  5308. return _createImage.apply(this, arguments);
  5309. }
  5310. class Document {
  5311. constructor(canvg) {
  5312. var {
  5313. rootEmSize = 12,
  5314. emSize = 12,
  5315. createCanvas = Document.createCanvas,
  5316. createImage = Document.createImage,
  5317. anonymousCrossOrigin
  5318. } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  5319. this.canvg = canvg;
  5320. this.definitions = {};
  5321. this.styles = {};
  5322. this.stylesSpecificity = {};
  5323. this.images = [];
  5324. this.fonts = [];
  5325. this.emSizeStack = [];
  5326. this.uniqueId = 0;
  5327. this.screen = canvg.screen;
  5328. this.rootEmSize = rootEmSize;
  5329. this.emSize = emSize;
  5330. this.createCanvas = createCanvas;
  5331. this.createImage = this.bindCreateImage(createImage, anonymousCrossOrigin);
  5332. this.screen.wait(this.isImagesLoaded.bind(this));
  5333. this.screen.wait(this.isFontsLoaded.bind(this));
  5334. }
  5335. bindCreateImage(createImage, anonymousCrossOrigin) {
  5336. if (typeof anonymousCrossOrigin === 'boolean') {
  5337. return (source, forceAnonymousCrossOrigin) => createImage(source, typeof forceAnonymousCrossOrigin === 'boolean' ? forceAnonymousCrossOrigin : anonymousCrossOrigin);
  5338. }
  5339. return createImage;
  5340. }
  5341. get window() {
  5342. return this.screen.window;
  5343. }
  5344. get fetch() {
  5345. return this.screen.fetch;
  5346. }
  5347. get ctx() {
  5348. return this.screen.ctx;
  5349. }
  5350. get emSize() {
  5351. var {
  5352. emSizeStack
  5353. } = this;
  5354. return emSizeStack[emSizeStack.length - 1];
  5355. }
  5356. set emSize(value) {
  5357. var {
  5358. emSizeStack
  5359. } = this;
  5360. emSizeStack.push(value);
  5361. }
  5362. popEmSize() {
  5363. var {
  5364. emSizeStack
  5365. } = this;
  5366. emSizeStack.pop();
  5367. }
  5368. getUniqueId() {
  5369. return "canvg".concat(++this.uniqueId);
  5370. }
  5371. isImagesLoaded() {
  5372. return this.images.every(_ => _.loaded);
  5373. }
  5374. isFontsLoaded() {
  5375. return this.fonts.every(_ => _.loaded);
  5376. }
  5377. createDocumentElement(document) {
  5378. var documentElement = this.createElement(document.documentElement);
  5379. documentElement.root = true;
  5380. documentElement.addStylesFromStyleDefinition();
  5381. this.documentElement = documentElement;
  5382. return documentElement;
  5383. }
  5384. createElement(node) {
  5385. var elementType = node.nodeName.replace(/^[^:]+:/, '');
  5386. var ElementType = Document.elementTypes[elementType];
  5387. if (typeof ElementType !== 'undefined') {
  5388. return new ElementType(this, node);
  5389. }
  5390. return new UnknownElement(this, node);
  5391. }
  5392. createTextNode(node) {
  5393. return new TextNode(this, node);
  5394. }
  5395. setViewBox(config) {
  5396. this.screen.setViewBox(_objectSpread$1({
  5397. document: this
  5398. }, config));
  5399. }
  5400. }
  5401. Document.createCanvas = createCanvas;
  5402. Document.createImage = createImage;
  5403. Document.elementTypes = elements;
  5404. function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
  5405. function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_7___default()(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
  5406. /**
  5407. * SVG renderer on canvas.
  5408. */
  5409. class Canvg {
  5410. /**
  5411. * Main constructor.
  5412. * @param ctx - Rendering context.
  5413. * @param svg - SVG Document.
  5414. * @param options - Rendering options.
  5415. */
  5416. constructor(ctx, svg) {
  5417. var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  5418. this.parser = new Parser(options);
  5419. this.screen = new Screen(ctx, options);
  5420. this.options = options;
  5421. var document = new Document(this, options);
  5422. var documentElement = document.createDocumentElement(svg);
  5423. this.document = document;
  5424. this.documentElement = documentElement;
  5425. }
  5426. /**
  5427. * Create Canvg instance from SVG source string or URL.
  5428. * @param ctx - Rendering context.
  5429. * @param svg - SVG source string or URL.
  5430. * @param options - Rendering options.
  5431. * @returns Canvg instance.
  5432. */
  5433. static from(ctx, svg) {
  5434. var _arguments = arguments;
  5435. return _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()(function* () {
  5436. var options = _arguments.length > 2 && _arguments[2] !== undefined ? _arguments[2] : {};
  5437. var parser = new Parser(options);
  5438. var svgDocument = yield parser.parse(svg);
  5439. return new Canvg(ctx, svgDocument, options);
  5440. })();
  5441. }
  5442. /**
  5443. * Create Canvg instance from SVG source string.
  5444. * @param ctx - Rendering context.
  5445. * @param svg - SVG source string.
  5446. * @param options - Rendering options.
  5447. * @returns Canvg instance.
  5448. */
  5449. static fromString(ctx, svg) {
  5450. var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  5451. var parser = new Parser(options);
  5452. var svgDocument = parser.parseFromString(svg);
  5453. return new Canvg(ctx, svgDocument, options);
  5454. }
  5455. /**
  5456. * Create new Canvg instance with inherited options.
  5457. * @param ctx - Rendering context.
  5458. * @param svg - SVG source string or URL.
  5459. * @param options - Rendering options.
  5460. * @returns Canvg instance.
  5461. */
  5462. fork(ctx, svg) {
  5463. var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  5464. return Canvg.from(ctx, svg, _objectSpread(_objectSpread({}, this.options), options));
  5465. }
  5466. /**
  5467. * Create new Canvg instance with inherited options.
  5468. * @param ctx - Rendering context.
  5469. * @param svg - SVG source string.
  5470. * @param options - Rendering options.
  5471. * @returns Canvg instance.
  5472. */
  5473. forkString(ctx, svg) {
  5474. var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  5475. return Canvg.fromString(ctx, svg, _objectSpread(_objectSpread({}, this.options), options));
  5476. }
  5477. /**
  5478. * Document is ready promise.
  5479. * @returns Ready promise.
  5480. */
  5481. ready() {
  5482. return this.screen.ready();
  5483. }
  5484. /**
  5485. * Document is ready value.
  5486. * @returns Is ready or not.
  5487. */
  5488. isReady() {
  5489. return this.screen.isReady();
  5490. }
  5491. /**
  5492. * Render only first frame, ignoring animations and mouse.
  5493. * @param options - Rendering options.
  5494. */
  5495. render() {
  5496. var _arguments2 = arguments,
  5497. _this = this;
  5498. return _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()(function* () {
  5499. var options = _arguments2.length > 0 && _arguments2[0] !== undefined ? _arguments2[0] : {};
  5500. _this.start(_objectSpread({
  5501. enableRedraw: true,
  5502. ignoreAnimation: true,
  5503. ignoreMouse: true
  5504. }, options));
  5505. yield _this.ready();
  5506. _this.stop();
  5507. })();
  5508. }
  5509. /**
  5510. * Start rendering.
  5511. * @param options - Render options.
  5512. */
  5513. start() {
  5514. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  5515. var {
  5516. documentElement,
  5517. screen,
  5518. options: baseOptions
  5519. } = this;
  5520. screen.start(documentElement, _objectSpread(_objectSpread({
  5521. enableRedraw: true
  5522. }, baseOptions), options));
  5523. }
  5524. /**
  5525. * Stop rendering.
  5526. */
  5527. stop() {
  5528. this.screen.stop();
  5529. }
  5530. /**
  5531. * Resize SVG to fit in given size.
  5532. * @param width
  5533. * @param height
  5534. * @param preserveAspectRatio
  5535. */
  5536. resize(width) {
  5537. var height = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : width;
  5538. var preserveAspectRatio = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  5539. this.documentElement.resize(width, height, preserveAspectRatio);
  5540. }
  5541. }
  5542. //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZXMuanMiLCJzb3VyY2VzIjpbXSwic291cmNlc0NvbnRlbnQiOltdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OzsifQ==
  5543. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/mock/process.js */ "../../node_modules/node-libs-browser/mock/process.js")))
  5544. /***/ }),
  5545. /***/ "../../node_modules/core-js/internals/a-constructor.js":
  5546. /*!******************************************************************************!*\
  5547. !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/a-constructor.js ***!
  5548. \******************************************************************************/
  5549. /*! no static exports found */
  5550. /***/ (function(module, exports, __webpack_require__) {
  5551. "use strict";
  5552. var isConstructor = __webpack_require__(/*! ../internals/is-constructor */ "../../node_modules/core-js/internals/is-constructor.js");
  5553. var tryToString = __webpack_require__(/*! ../internals/try-to-string */ "../../node_modules/core-js/internals/try-to-string.js");
  5554. var $TypeError = TypeError;
  5555. // `Assert: IsConstructor(argument) is true`
  5556. module.exports = function (argument) {
  5557. if (isConstructor(argument)) return argument;
  5558. throw new $TypeError(tryToString(argument) + ' is not a constructor');
  5559. };
  5560. /***/ }),
  5561. /***/ "../../node_modules/core-js/internals/add-to-unscopables.js":
  5562. /*!***********************************************************************************!*\
  5563. !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/add-to-unscopables.js ***!
  5564. \***********************************************************************************/
  5565. /*! no static exports found */
  5566. /***/ (function(module, exports, __webpack_require__) {
  5567. "use strict";
  5568. var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "../../node_modules/core-js/internals/well-known-symbol.js");
  5569. var create = __webpack_require__(/*! ../internals/object-create */ "../../node_modules/core-js/internals/object-create.js");
  5570. var defineProperty = __webpack_require__(/*! ../internals/object-define-property */ "../../node_modules/core-js/internals/object-define-property.js").f;
  5571. var UNSCOPABLES = wellKnownSymbol('unscopables');
  5572. var ArrayPrototype = Array.prototype;
  5573. // Array.prototype[@@unscopables]
  5574. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  5575. if (ArrayPrototype[UNSCOPABLES] === undefined) {
  5576. defineProperty(ArrayPrototype, UNSCOPABLES, {
  5577. configurable: true,
  5578. value: create(null)
  5579. });
  5580. }
  5581. // add a key to Array.prototype[@@unscopables]
  5582. module.exports = function (key) {
  5583. ArrayPrototype[UNSCOPABLES][key] = true;
  5584. };
  5585. /***/ }),
  5586. /***/ "../../node_modules/core-js/internals/advance-string-index.js":
  5587. /*!*************************************************************************************!*\
  5588. !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/advance-string-index.js ***!
  5589. \*************************************************************************************/
  5590. /*! no static exports found */
  5591. /***/ (function(module, exports, __webpack_require__) {
  5592. "use strict";
  5593. var charAt = __webpack_require__(/*! ../internals/string-multibyte */ "../../node_modules/core-js/internals/string-multibyte.js").charAt;
  5594. // `AdvanceStringIndex` abstract operation
  5595. // https://tc39.es/ecma262/#sec-advancestringindex
  5596. module.exports = function (S, index, unicode) {
  5597. return index + (unicode ? charAt(S, index).length : 1);
  5598. };
  5599. /***/ }),
  5600. /***/ "../../node_modules/core-js/internals/array-slice.js":
  5601. /*!****************************************************************************!*\
  5602. !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/array-slice.js ***!
  5603. \****************************************************************************/
  5604. /*! no static exports found */
  5605. /***/ (function(module, exports, __webpack_require__) {
  5606. "use strict";
  5607. var uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this */ "../../node_modules/core-js/internals/function-uncurry-this.js");
  5608. module.exports = uncurryThis([].slice);
  5609. /***/ }),
  5610. /***/ "../../node_modules/core-js/internals/check-correctness-of-iteration.js":
  5611. /*!***********************************************************************************************!*\
  5612. !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/check-correctness-of-iteration.js ***!
  5613. \***********************************************************************************************/
  5614. /*! no static exports found */
  5615. /***/ (function(module, exports, __webpack_require__) {
  5616. "use strict";
  5617. var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "../../node_modules/core-js/internals/well-known-symbol.js");
  5618. var ITERATOR = wellKnownSymbol('iterator');
  5619. var SAFE_CLOSING = false;
  5620. try {
  5621. var called = 0;
  5622. var iteratorWithReturn = {
  5623. next: function () {
  5624. return { done: !!called++ };
  5625. },
  5626. 'return': function () {
  5627. SAFE_CLOSING = true;
  5628. }
  5629. };
  5630. iteratorWithReturn[ITERATOR] = function () {
  5631. return this;
  5632. };
  5633. // eslint-disable-next-line es/no-array-from, no-throw-literal -- required for testing
  5634. Array.from(iteratorWithReturn, function () { throw 2; });
  5635. } catch (error) { /* empty */ }
  5636. module.exports = function (exec, SKIP_CLOSING) {
  5637. try {
  5638. if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
  5639. } catch (error) { return false; } // workaround of old WebKit + `eval` bug
  5640. var ITERATION_SUPPORT = false;
  5641. try {
  5642. var object = {};
  5643. object[ITERATOR] = function () {
  5644. return {
  5645. next: function () {
  5646. return { done: ITERATION_SUPPORT = true };
  5647. }
  5648. };
  5649. };
  5650. exec(object);
  5651. } catch (error) { /* empty */ }
  5652. return ITERATION_SUPPORT;
  5653. };
  5654. /***/ }),
  5655. /***/ "../../node_modules/core-js/internals/correct-is-regexp-logic.js":
  5656. /*!****************************************************************************************!*\
  5657. !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/correct-is-regexp-logic.js ***!
  5658. \****************************************************************************************/
  5659. /*! no static exports found */
  5660. /***/ (function(module, exports, __webpack_require__) {
  5661. "use strict";
  5662. var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "../../node_modules/core-js/internals/well-known-symbol.js");
  5663. var MATCH = wellKnownSymbol('match');
  5664. module.exports = function (METHOD_NAME) {
  5665. var regexp = /./;
  5666. try {
  5667. '/./'[METHOD_NAME](regexp);
  5668. } catch (error1) {
  5669. try {
  5670. regexp[MATCH] = false;
  5671. return '/./'[METHOD_NAME](regexp);
  5672. } catch (error2) { /* empty */ }
  5673. } return false;
  5674. };
  5675. /***/ }),
  5676. /***/ "../../node_modules/core-js/internals/create-iter-result-object.js":
  5677. /*!******************************************************************************************!*\
  5678. !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/create-iter-result-object.js ***!
  5679. \******************************************************************************************/
  5680. /*! no static exports found */
  5681. /***/ (function(module, exports, __webpack_require__) {
  5682. "use strict";
  5683. // `CreateIterResultObject` abstract operation
  5684. // https://tc39.es/ecma262/#sec-createiterresultobject
  5685. module.exports = function (value, done) {
  5686. return { value: value, done: done };
  5687. };
  5688. /***/ }),
  5689. /***/ "../../node_modules/core-js/internals/dom-iterables.js":
  5690. /*!******************************************************************************!*\
  5691. !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/dom-iterables.js ***!
  5692. \******************************************************************************/
  5693. /*! no static exports found */
  5694. /***/ (function(module, exports, __webpack_require__) {
  5695. "use strict";
  5696. // iterable DOM collections
  5697. // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
  5698. module.exports = {
  5699. CSSRuleList: 0,
  5700. CSSStyleDeclaration: 0,
  5701. CSSValueList: 0,
  5702. ClientRectList: 0,
  5703. DOMRectList: 0,
  5704. DOMStringList: 0,
  5705. DOMTokenList: 1,
  5706. DataTransferItemList: 0,
  5707. FileList: 0,
  5708. HTMLAllCollection: 0,
  5709. HTMLCollection: 0,
  5710. HTMLFormElement: 0,
  5711. HTMLSelectElement: 0,
  5712. MediaList: 0,
  5713. MimeTypeArray: 0,
  5714. NamedNodeMap: 0,
  5715. NodeList: 1,
  5716. PaintRequestList: 0,
  5717. Plugin: 0,
  5718. PluginArray: 0,
  5719. SVGLengthList: 0,
  5720. SVGNumberList: 0,
  5721. SVGPathSegList: 0,
  5722. SVGPointList: 0,
  5723. SVGStringList: 0,
  5724. SVGTransformList: 0,
  5725. SourceBufferList: 0,
  5726. StyleSheetList: 0,
  5727. TextTrackCueList: 0,
  5728. TextTrackList: 0,
  5729. TouchList: 0
  5730. };
  5731. /***/ }),
  5732. /***/ "../../node_modules/core-js/internals/dom-token-list-prototype.js":
  5733. /*!*****************************************************************************************!*\
  5734. !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/dom-token-list-prototype.js ***!
  5735. \*****************************************************************************************/
  5736. /*! no static exports found */
  5737. /***/ (function(module, exports, __webpack_require__) {
  5738. "use strict";
  5739. // in old WebKit versions, `element.classList` is not an instance of global `DOMTokenList`
  5740. var documentCreateElement = __webpack_require__(/*! ../internals/document-create-element */ "../../node_modules/core-js/internals/document-create-element.js");
  5741. var classList = documentCreateElement('span').classList;
  5742. var DOMTokenListPrototype = classList && classList.constructor && classList.constructor.prototype;
  5743. module.exports = DOMTokenListPrototype === Object.prototype ? undefined : DOMTokenListPrototype;
  5744. /***/ }),
  5745. /***/ "../../node_modules/core-js/internals/engine-is-ios-pebble.js":
  5746. /*!*************************************************************************************!*\
  5747. !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/engine-is-ios-pebble.js ***!
  5748. \*************************************************************************************/
  5749. /*! no static exports found */
  5750. /***/ (function(module, exports, __webpack_require__) {
  5751. "use strict";
  5752. var userAgent = __webpack_require__(/*! ../internals/engine-user-agent */ "../../node_modules/core-js/internals/engine-user-agent.js");
  5753. module.exports = /ipad|iphone|ipod/i.test(userAgent) && typeof Pebble != 'undefined';
  5754. /***/ }),
  5755. /***/ "../../node_modules/core-js/internals/engine-is-ios.js":
  5756. /*!******************************************************************************!*\
  5757. !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/engine-is-ios.js ***!
  5758. \******************************************************************************/
  5759. /*! no static exports found */
  5760. /***/ (function(module, exports, __webpack_require__) {
  5761. "use strict";
  5762. var userAgent = __webpack_require__(/*! ../internals/engine-user-agent */ "../../node_modules/core-js/internals/engine-user-agent.js");
  5763. // eslint-disable-next-line redos/no-vulnerable -- safe
  5764. module.exports = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent);
  5765. /***/ }),
  5766. /***/ "../../node_modules/core-js/internals/engine-is-webos-webkit.js":
  5767. /*!***************************************************************************************!*\
  5768. !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/engine-is-webos-webkit.js ***!
  5769. \***************************************************************************************/
  5770. /*! no static exports found */
  5771. /***/ (function(module, exports, __webpack_require__) {
  5772. "use strict";
  5773. var userAgent = __webpack_require__(/*! ../internals/engine-user-agent */ "../../node_modules/core-js/internals/engine-user-agent.js");
  5774. module.exports = /web0s(?!.*chrome)/i.test(userAgent);
  5775. /***/ }),
  5776. /***/ "../../node_modules/core-js/internals/fix-regexp-well-known-symbol-logic.js":
  5777. /*!***************************************************************************************************!*\
  5778. !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/fix-regexp-well-known-symbol-logic.js ***!
  5779. \***************************************************************************************************/
  5780. /*! no static exports found */
  5781. /***/ (function(module, exports, __webpack_require__) {
  5782. "use strict";
  5783. // TODO: Remove from `core-js@4` since it's moved to entry points
  5784. __webpack_require__(/*! ../modules/es.regexp.exec */ "../../node_modules/core-js/modules/es.regexp.exec.js");
  5785. var call = __webpack_require__(/*! ../internals/function-call */ "../../node_modules/core-js/internals/function-call.js");
  5786. var defineBuiltIn = __webpack_require__(/*! ../internals/define-built-in */ "../../node_modules/core-js/internals/define-built-in.js");
  5787. var regexpExec = __webpack_require__(/*! ../internals/regexp-exec */ "../../node_modules/core-js/internals/regexp-exec.js");
  5788. var fails = __webpack_require__(/*! ../internals/fails */ "../../node_modules/core-js/internals/fails.js");
  5789. var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "../../node_modules/core-js/internals/well-known-symbol.js");
  5790. var createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ "../../node_modules/core-js/internals/create-non-enumerable-property.js");
  5791. var SPECIES = wellKnownSymbol('species');
  5792. var RegExpPrototype = RegExp.prototype;
  5793. module.exports = function (KEY, exec, FORCED, SHAM) {
  5794. var SYMBOL = wellKnownSymbol(KEY);
  5795. var DELEGATES_TO_SYMBOL = !fails(function () {
  5796. // String methods call symbol-named RegExp methods
  5797. var O = {};
  5798. O[SYMBOL] = function () { return 7; };
  5799. return ''[KEY](O) !== 7;
  5800. });
  5801. var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () {
  5802. // Symbol-named RegExp methods call .exec
  5803. var execCalled = false;
  5804. var re = /a/;
  5805. if (KEY === 'split') {
  5806. // We can't use real regex here since it causes deoptimization
  5807. // and serious performance degradation in V8
  5808. // https://github.com/zloirock/core-js/issues/306
  5809. re = {};
  5810. // RegExp[@@split] doesn't call the regex's exec method, but first creates
  5811. // a new one. We need to return the patched regex when creating the new one.
  5812. re.constructor = {};
  5813. re.constructor[SPECIES] = function () { return re; };
  5814. re.flags = '';
  5815. re[SYMBOL] = /./[SYMBOL];
  5816. }
  5817. re.exec = function () {
  5818. execCalled = true;
  5819. return null;
  5820. };
  5821. re[SYMBOL]('');
  5822. return !execCalled;
  5823. });
  5824. if (
  5825. !DELEGATES_TO_SYMBOL ||
  5826. !DELEGATES_TO_EXEC ||
  5827. FORCED
  5828. ) {
  5829. var nativeRegExpMethod = /./[SYMBOL];
  5830. var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
  5831. var $exec = regexp.exec;
  5832. if ($exec === regexpExec || $exec === RegExpPrototype.exec) {
  5833. if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
  5834. // The native String method already delegates to @@method (this
  5835. // polyfilled function), leasing to infinite recursion.
  5836. // We avoid it by directly calling the native @@method method.
  5837. return { done: true, value: call(nativeRegExpMethod, regexp, str, arg2) };
  5838. }
  5839. return { done: true, value: call(nativeMethod, str, regexp, arg2) };
  5840. }
  5841. return { done: false };
  5842. });
  5843. defineBuiltIn(String.prototype, KEY, methods[0]);
  5844. defineBuiltIn(RegExpPrototype, SYMBOL, methods[1]);
  5845. }
  5846. if (SHAM) createNonEnumerableProperty(RegExpPrototype[SYMBOL], 'sham', true);
  5847. };
  5848. /***/ }),
  5849. /***/ "../../node_modules/core-js/internals/get-iterator-method.js":
  5850. /*!************************************************************************************!*\
  5851. !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/get-iterator-method.js ***!
  5852. \************************************************************************************/
  5853. /*! no static exports found */
  5854. /***/ (function(module, exports, __webpack_require__) {
  5855. "use strict";
  5856. var classof = __webpack_require__(/*! ../internals/classof */ "../../node_modules/core-js/internals/classof.js");
  5857. var getMethod = __webpack_require__(/*! ../internals/get-method */ "../../node_modules/core-js/internals/get-method.js");
  5858. var isNullOrUndefined = __webpack_require__(/*! ../internals/is-null-or-undefined */ "../../node_modules/core-js/internals/is-null-or-undefined.js");
  5859. var Iterators = __webpack_require__(/*! ../internals/iterators */ "../../node_modules/core-js/internals/iterators.js");
  5860. var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "../../node_modules/core-js/internals/well-known-symbol.js");
  5861. var ITERATOR = wellKnownSymbol('iterator');
  5862. module.exports = function (it) {
  5863. if (!isNullOrUndefined(it)) return getMethod(it, ITERATOR)
  5864. || getMethod(it, '@@iterator')
  5865. || Iterators[classof(it)];
  5866. };
  5867. /***/ }),
  5868. /***/ "../../node_modules/core-js/internals/get-iterator.js":
  5869. /*!*****************************************************************************!*\
  5870. !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/get-iterator.js ***!
  5871. \*****************************************************************************/
  5872. /*! no static exports found */
  5873. /***/ (function(module, exports, __webpack_require__) {
  5874. "use strict";
  5875. var call = __webpack_require__(/*! ../internals/function-call */ "../../node_modules/core-js/internals/function-call.js");
  5876. var aCallable = __webpack_require__(/*! ../internals/a-callable */ "../../node_modules/core-js/internals/a-callable.js");
  5877. var anObject = __webpack_require__(/*! ../internals/an-object */ "../../node_modules/core-js/internals/an-object.js");
  5878. var tryToString = __webpack_require__(/*! ../internals/try-to-string */ "../../node_modules/core-js/internals/try-to-string.js");
  5879. var getIteratorMethod = __webpack_require__(/*! ../internals/get-iterator-method */ "../../node_modules/core-js/internals/get-iterator-method.js");
  5880. var $TypeError = TypeError;
  5881. module.exports = function (argument, usingIterator) {
  5882. var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator;
  5883. if (aCallable(iteratorMethod)) return anObject(call(iteratorMethod, argument));
  5884. throw new $TypeError(tryToString(argument) + ' is not iterable');
  5885. };
  5886. /***/ }),
  5887. /***/ "../../node_modules/core-js/internals/host-report-errors.js":
  5888. /*!***********************************************************************************!*\
  5889. !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/host-report-errors.js ***!
  5890. \***********************************************************************************/
  5891. /*! no static exports found */
  5892. /***/ (function(module, exports, __webpack_require__) {
  5893. "use strict";
  5894. module.exports = function (a, b) {
  5895. try {
  5896. // eslint-disable-next-line no-console -- safe
  5897. arguments.length === 1 ? console.error(a) : console.error(a, b);
  5898. } catch (error) { /* empty */ }
  5899. };
  5900. /***/ }),
  5901. /***/ "../../node_modules/core-js/internals/html.js":
  5902. /*!*********************************************************************!*\
  5903. !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/html.js ***!
  5904. \*********************************************************************/
  5905. /*! no static exports found */
  5906. /***/ (function(module, exports, __webpack_require__) {
  5907. "use strict";
  5908. var getBuiltIn = __webpack_require__(/*! ../internals/get-built-in */ "../../node_modules/core-js/internals/get-built-in.js");
  5909. module.exports = getBuiltIn('document', 'documentElement');
  5910. /***/ }),
  5911. /***/ "../../node_modules/core-js/internals/is-array-iterator-method.js":
  5912. /*!*****************************************************************************************!*\
  5913. !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/is-array-iterator-method.js ***!
  5914. \*****************************************************************************************/
  5915. /*! no static exports found */
  5916. /***/ (function(module, exports, __webpack_require__) {
  5917. "use strict";
  5918. var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "../../node_modules/core-js/internals/well-known-symbol.js");
  5919. var Iterators = __webpack_require__(/*! ../internals/iterators */ "../../node_modules/core-js/internals/iterators.js");
  5920. var ITERATOR = wellKnownSymbol('iterator');
  5921. var ArrayPrototype = Array.prototype;
  5922. // check on default Array iterator
  5923. module.exports = function (it) {
  5924. return it !== undefined && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it);
  5925. };
  5926. /***/ }),
  5927. /***/ "../../node_modules/core-js/internals/is-constructor.js":
  5928. /*!*******************************************************************************!*\
  5929. !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/is-constructor.js ***!
  5930. \*******************************************************************************/
  5931. /*! no static exports found */
  5932. /***/ (function(module, exports, __webpack_require__) {
  5933. "use strict";
  5934. var uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this */ "../../node_modules/core-js/internals/function-uncurry-this.js");
  5935. var fails = __webpack_require__(/*! ../internals/fails */ "../../node_modules/core-js/internals/fails.js");
  5936. var isCallable = __webpack_require__(/*! ../internals/is-callable */ "../../node_modules/core-js/internals/is-callable.js");
  5937. var classof = __webpack_require__(/*! ../internals/classof */ "../../node_modules/core-js/internals/classof.js");
  5938. var getBuiltIn = __webpack_require__(/*! ../internals/get-built-in */ "../../node_modules/core-js/internals/get-built-in.js");
  5939. var inspectSource = __webpack_require__(/*! ../internals/inspect-source */ "../../node_modules/core-js/internals/inspect-source.js");
  5940. var noop = function () { /* empty */ };
  5941. var construct = getBuiltIn('Reflect', 'construct');
  5942. var constructorRegExp = /^\s*(?:class|function)\b/;
  5943. var exec = uncurryThis(constructorRegExp.exec);
  5944. var INCORRECT_TO_STRING = !constructorRegExp.test(noop);
  5945. var isConstructorModern = function isConstructor(argument) {
  5946. if (!isCallable(argument)) return false;
  5947. try {
  5948. construct(noop, [], argument);
  5949. return true;
  5950. } catch (error) {
  5951. return false;
  5952. }
  5953. };
  5954. var isConstructorLegacy = function isConstructor(argument) {
  5955. if (!isCallable(argument)) return false;
  5956. switch (classof(argument)) {
  5957. case 'AsyncFunction':
  5958. case 'GeneratorFunction':
  5959. case 'AsyncGeneratorFunction': return false;
  5960. }
  5961. try {
  5962. // we can't check .prototype since constructors produced by .bind haven't it
  5963. // `Function#toString` throws on some built-it function in some legacy engines
  5964. // (for example, `DOMQuad` and similar in FF41-)
  5965. return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource(argument));
  5966. } catch (error) {
  5967. return true;
  5968. }
  5969. };
  5970. isConstructorLegacy.sham = true;
  5971. // `IsConstructor` abstract operation
  5972. // https://tc39.es/ecma262/#sec-isconstructor
  5973. module.exports = !construct || fails(function () {
  5974. var called;
  5975. return isConstructorModern(isConstructorModern.call)
  5976. || !isConstructorModern(Object)
  5977. || !isConstructorModern(function () { called = true; })
  5978. || called;
  5979. }) ? isConstructorLegacy : isConstructorModern;
  5980. /***/ }),
  5981. /***/ "../../node_modules/core-js/internals/iterate.js":
  5982. /*!************************************************************************!*\
  5983. !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/iterate.js ***!
  5984. \************************************************************************/
  5985. /*! no static exports found */
  5986. /***/ (function(module, exports, __webpack_require__) {
  5987. "use strict";
  5988. var bind = __webpack_require__(/*! ../internals/function-bind-context */ "../../node_modules/core-js/internals/function-bind-context.js");
  5989. var call = __webpack_require__(/*! ../internals/function-call */ "../../node_modules/core-js/internals/function-call.js");
  5990. var anObject = __webpack_require__(/*! ../internals/an-object */ "../../node_modules/core-js/internals/an-object.js");
  5991. var tryToString = __webpack_require__(/*! ../internals/try-to-string */ "../../node_modules/core-js/internals/try-to-string.js");
  5992. var isArrayIteratorMethod = __webpack_require__(/*! ../internals/is-array-iterator-method */ "../../node_modules/core-js/internals/is-array-iterator-method.js");
  5993. var lengthOfArrayLike = __webpack_require__(/*! ../internals/length-of-array-like */ "../../node_modules/core-js/internals/length-of-array-like.js");
  5994. var isPrototypeOf = __webpack_require__(/*! ../internals/object-is-prototype-of */ "../../node_modules/core-js/internals/object-is-prototype-of.js");
  5995. var getIterator = __webpack_require__(/*! ../internals/get-iterator */ "../../node_modules/core-js/internals/get-iterator.js");
  5996. var getIteratorMethod = __webpack_require__(/*! ../internals/get-iterator-method */ "../../node_modules/core-js/internals/get-iterator-method.js");
  5997. var iteratorClose = __webpack_require__(/*! ../internals/iterator-close */ "../../node_modules/core-js/internals/iterator-close.js");
  5998. var $TypeError = TypeError;
  5999. var Result = function (stopped, result) {
  6000. this.stopped = stopped;
  6001. this.result = result;
  6002. };
  6003. var ResultPrototype = Result.prototype;
  6004. module.exports = function (iterable, unboundFunction, options) {
  6005. var that = options && options.that;
  6006. var AS_ENTRIES = !!(options && options.AS_ENTRIES);
  6007. var IS_RECORD = !!(options && options.IS_RECORD);
  6008. var IS_ITERATOR = !!(options && options.IS_ITERATOR);
  6009. var INTERRUPTED = !!(options && options.INTERRUPTED);
  6010. var fn = bind(unboundFunction, that);
  6011. var iterator, iterFn, index, length, result, next, step;
  6012. var stop = function (condition) {
  6013. if (iterator) iteratorClose(iterator, 'normal', condition);
  6014. return new Result(true, condition);
  6015. };
  6016. var callFn = function (value) {
  6017. if (AS_ENTRIES) {
  6018. anObject(value);
  6019. return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
  6020. } return INTERRUPTED ? fn(value, stop) : fn(value);
  6021. };
  6022. if (IS_RECORD) {
  6023. iterator = iterable.iterator;
  6024. } else if (IS_ITERATOR) {
  6025. iterator = iterable;
  6026. } else {
  6027. iterFn = getIteratorMethod(iterable);
  6028. if (!iterFn) throw new $TypeError(tryToString(iterable) + ' is not iterable');
  6029. // optimisation for array iterators
  6030. if (isArrayIteratorMethod(iterFn)) {
  6031. for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {
  6032. result = callFn(iterable[index]);
  6033. if (result && isPrototypeOf(ResultPrototype, result)) return result;
  6034. } return new Result(false);
  6035. }
  6036. iterator = getIterator(iterable, iterFn);
  6037. }
  6038. next = IS_RECORD ? iterable.next : iterator.next;
  6039. while (!(step = call(next, iterator)).done) {
  6040. try {
  6041. result = callFn(step.value);
  6042. } catch (error) {
  6043. iteratorClose(iterator, 'throw', error);
  6044. }
  6045. if (typeof result == 'object' && result && isPrototypeOf(ResultPrototype, result)) return result;
  6046. } return new Result(false);
  6047. };
  6048. /***/ }),
  6049. /***/ "../../node_modules/core-js/internals/iterator-create-constructor.js":
  6050. /*!********************************************************************************************!*\
  6051. !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/iterator-create-constructor.js ***!
  6052. \********************************************************************************************/
  6053. /*! no static exports found */
  6054. /***/ (function(module, exports, __webpack_require__) {
  6055. "use strict";
  6056. var IteratorPrototype = __webpack_require__(/*! ../internals/iterators-core */ "../../node_modules/core-js/internals/iterators-core.js").IteratorPrototype;
  6057. var create = __webpack_require__(/*! ../internals/object-create */ "../../node_modules/core-js/internals/object-create.js");
  6058. var createPropertyDescriptor = __webpack_require__(/*! ../internals/create-property-descriptor */ "../../node_modules/core-js/internals/create-property-descriptor.js");
  6059. var setToStringTag = __webpack_require__(/*! ../internals/set-to-string-tag */ "../../node_modules/core-js/internals/set-to-string-tag.js");
  6060. var Iterators = __webpack_require__(/*! ../internals/iterators */ "../../node_modules/core-js/internals/iterators.js");
  6061. var returnThis = function () { return this; };
  6062. module.exports = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
  6063. var TO_STRING_TAG = NAME + ' Iterator';
  6064. IteratorConstructor.prototype = create(IteratorPrototype, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) });
  6065. setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true);
  6066. Iterators[TO_STRING_TAG] = returnThis;
  6067. return IteratorConstructor;
  6068. };
  6069. /***/ }),
  6070. /***/ "../../node_modules/core-js/internals/iterator-define.js":
  6071. /*!********************************************************************************!*\
  6072. !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/iterator-define.js ***!
  6073. \********************************************************************************/
  6074. /*! no static exports found */
  6075. /***/ (function(module, exports, __webpack_require__) {
  6076. "use strict";
  6077. var $ = __webpack_require__(/*! ../internals/export */ "../../node_modules/core-js/internals/export.js");
  6078. var call = __webpack_require__(/*! ../internals/function-call */ "../../node_modules/core-js/internals/function-call.js");
  6079. var IS_PURE = __webpack_require__(/*! ../internals/is-pure */ "../../node_modules/core-js/internals/is-pure.js");
  6080. var FunctionName = __webpack_require__(/*! ../internals/function-name */ "../../node_modules/core-js/internals/function-name.js");
  6081. var isCallable = __webpack_require__(/*! ../internals/is-callable */ "../../node_modules/core-js/internals/is-callable.js");
  6082. var createIteratorConstructor = __webpack_require__(/*! ../internals/iterator-create-constructor */ "../../node_modules/core-js/internals/iterator-create-constructor.js");
  6083. var getPrototypeOf = __webpack_require__(/*! ../internals/object-get-prototype-of */ "../../node_modules/core-js/internals/object-get-prototype-of.js");
  6084. var setPrototypeOf = __webpack_require__(/*! ../internals/object-set-prototype-of */ "../../node_modules/core-js/internals/object-set-prototype-of.js");
  6085. var setToStringTag = __webpack_require__(/*! ../internals/set-to-string-tag */ "../../node_modules/core-js/internals/set-to-string-tag.js");
  6086. var createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ "../../node_modules/core-js/internals/create-non-enumerable-property.js");
  6087. var defineBuiltIn = __webpack_require__(/*! ../internals/define-built-in */ "../../node_modules/core-js/internals/define-built-in.js");
  6088. var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "../../node_modules/core-js/internals/well-known-symbol.js");
  6089. var Iterators = __webpack_require__(/*! ../internals/iterators */ "../../node_modules/core-js/internals/iterators.js");
  6090. var IteratorsCore = __webpack_require__(/*! ../internals/iterators-core */ "../../node_modules/core-js/internals/iterators-core.js");
  6091. var PROPER_FUNCTION_NAME = FunctionName.PROPER;
  6092. var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
  6093. var IteratorPrototype = IteratorsCore.IteratorPrototype;
  6094. var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
  6095. var ITERATOR = wellKnownSymbol('iterator');
  6096. var KEYS = 'keys';
  6097. var VALUES = 'values';
  6098. var ENTRIES = 'entries';
  6099. var returnThis = function () { return this; };
  6100. module.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
  6101. createIteratorConstructor(IteratorConstructor, NAME, next);
  6102. var getIterationMethod = function (KIND) {
  6103. if (KIND === DEFAULT && defaultIterator) return defaultIterator;
  6104. if (!BUGGY_SAFARI_ITERATORS && KIND && KIND in IterablePrototype) return IterablePrototype[KIND];
  6105. switch (KIND) {
  6106. case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
  6107. case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
  6108. case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
  6109. }
  6110. return function () { return new IteratorConstructor(this); };
  6111. };
  6112. var TO_STRING_TAG = NAME + ' Iterator';
  6113. var INCORRECT_VALUES_NAME = false;
  6114. var IterablePrototype = Iterable.prototype;
  6115. var nativeIterator = IterablePrototype[ITERATOR]
  6116. || IterablePrototype['@@iterator']
  6117. || DEFAULT && IterablePrototype[DEFAULT];
  6118. var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
  6119. var anyNativeIterator = NAME === 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
  6120. var CurrentIteratorPrototype, methods, KEY;
  6121. // fix native
  6122. if (anyNativeIterator) {
  6123. CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));
  6124. if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
  6125. if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
  6126. if (setPrototypeOf) {
  6127. setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
  6128. } else if (!isCallable(CurrentIteratorPrototype[ITERATOR])) {
  6129. defineBuiltIn(CurrentIteratorPrototype, ITERATOR, returnThis);
  6130. }
  6131. }
  6132. // Set @@toStringTag to native iterators
  6133. setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true);
  6134. if (IS_PURE) Iterators[TO_STRING_TAG] = returnThis;
  6135. }
  6136. }
  6137. // fix Array.prototype.{ values, @@iterator }.name in V8 / FF
  6138. if (PROPER_FUNCTION_NAME && DEFAULT === VALUES && nativeIterator && nativeIterator.name !== VALUES) {
  6139. if (!IS_PURE && CONFIGURABLE_FUNCTION_NAME) {
  6140. createNonEnumerableProperty(IterablePrototype, 'name', VALUES);
  6141. } else {
  6142. INCORRECT_VALUES_NAME = true;
  6143. defaultIterator = function values() { return call(nativeIterator, this); };
  6144. }
  6145. }
  6146. // export additional methods
  6147. if (DEFAULT) {
  6148. methods = {
  6149. values: getIterationMethod(VALUES),
  6150. keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
  6151. entries: getIterationMethod(ENTRIES)
  6152. };
  6153. if (FORCED) for (KEY in methods) {
  6154. if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
  6155. defineBuiltIn(IterablePrototype, KEY, methods[KEY]);
  6156. }
  6157. } else $({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
  6158. }
  6159. // define iterator
  6160. if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) {
  6161. defineBuiltIn(IterablePrototype, ITERATOR, defaultIterator, { name: DEFAULT });
  6162. }
  6163. Iterators[NAME] = defaultIterator;
  6164. return methods;
  6165. };
  6166. /***/ }),
  6167. /***/ "../../node_modules/core-js/internals/iterators-core.js":
  6168. /*!*******************************************************************************!*\
  6169. !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/iterators-core.js ***!
  6170. \*******************************************************************************/
  6171. /*! no static exports found */
  6172. /***/ (function(module, exports, __webpack_require__) {
  6173. "use strict";
  6174. var fails = __webpack_require__(/*! ../internals/fails */ "../../node_modules/core-js/internals/fails.js");
  6175. var isCallable = __webpack_require__(/*! ../internals/is-callable */ "../../node_modules/core-js/internals/is-callable.js");
  6176. var isObject = __webpack_require__(/*! ../internals/is-object */ "../../node_modules/core-js/internals/is-object.js");
  6177. var create = __webpack_require__(/*! ../internals/object-create */ "../../node_modules/core-js/internals/object-create.js");
  6178. var getPrototypeOf = __webpack_require__(/*! ../internals/object-get-prototype-of */ "../../node_modules/core-js/internals/object-get-prototype-of.js");
  6179. var defineBuiltIn = __webpack_require__(/*! ../internals/define-built-in */ "../../node_modules/core-js/internals/define-built-in.js");
  6180. var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "../../node_modules/core-js/internals/well-known-symbol.js");
  6181. var IS_PURE = __webpack_require__(/*! ../internals/is-pure */ "../../node_modules/core-js/internals/is-pure.js");
  6182. var ITERATOR = wellKnownSymbol('iterator');
  6183. var BUGGY_SAFARI_ITERATORS = false;
  6184. // `%IteratorPrototype%` object
  6185. // https://tc39.es/ecma262/#sec-%iteratorprototype%-object
  6186. var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;
  6187. /* eslint-disable es/no-array-prototype-keys -- safe */
  6188. if ([].keys) {
  6189. arrayIterator = [].keys();
  6190. // Safari 8 has buggy iterators w/o `next`
  6191. if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true;
  6192. else {
  6193. PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator));
  6194. if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype;
  6195. }
  6196. }
  6197. var NEW_ITERATOR_PROTOTYPE = !isObject(IteratorPrototype) || fails(function () {
  6198. var test = {};
  6199. // FF44- legacy iterators case
  6200. return IteratorPrototype[ITERATOR].call(test) !== test;
  6201. });
  6202. if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype = {};
  6203. else if (IS_PURE) IteratorPrototype = create(IteratorPrototype);
  6204. // `%IteratorPrototype%[@@iterator]()` method
  6205. // https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
  6206. if (!isCallable(IteratorPrototype[ITERATOR])) {
  6207. defineBuiltIn(IteratorPrototype, ITERATOR, function () {
  6208. return this;
  6209. });
  6210. }
  6211. module.exports = {
  6212. IteratorPrototype: IteratorPrototype,
  6213. BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS
  6214. };
  6215. /***/ }),
  6216. /***/ "../../node_modules/core-js/internals/iterators.js":
  6217. /*!**************************************************************************!*\
  6218. !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/iterators.js ***!
  6219. \**************************************************************************/
  6220. /*! no static exports found */
  6221. /***/ (function(module, exports, __webpack_require__) {
  6222. "use strict";
  6223. module.exports = {};
  6224. /***/ }),
  6225. /***/ "../../node_modules/core-js/internals/microtask.js":
  6226. /*!**************************************************************************!*\
  6227. !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/microtask.js ***!
  6228. \**************************************************************************/
  6229. /*! no static exports found */
  6230. /***/ (function(module, exports, __webpack_require__) {
  6231. "use strict";
  6232. var global = __webpack_require__(/*! ../internals/global */ "../../node_modules/core-js/internals/global.js");
  6233. var safeGetBuiltIn = __webpack_require__(/*! ../internals/safe-get-built-in */ "../../node_modules/core-js/internals/safe-get-built-in.js");
  6234. var bind = __webpack_require__(/*! ../internals/function-bind-context */ "../../node_modules/core-js/internals/function-bind-context.js");
  6235. var macrotask = __webpack_require__(/*! ../internals/task */ "../../node_modules/core-js/internals/task.js").set;
  6236. var Queue = __webpack_require__(/*! ../internals/queue */ "../../node_modules/core-js/internals/queue.js");
  6237. var IS_IOS = __webpack_require__(/*! ../internals/engine-is-ios */ "../../node_modules/core-js/internals/engine-is-ios.js");
  6238. var IS_IOS_PEBBLE = __webpack_require__(/*! ../internals/engine-is-ios-pebble */ "../../node_modules/core-js/internals/engine-is-ios-pebble.js");
  6239. var IS_WEBOS_WEBKIT = __webpack_require__(/*! ../internals/engine-is-webos-webkit */ "../../node_modules/core-js/internals/engine-is-webos-webkit.js");
  6240. var IS_NODE = __webpack_require__(/*! ../internals/engine-is-node */ "../../node_modules/core-js/internals/engine-is-node.js");
  6241. var MutationObserver = global.MutationObserver || global.WebKitMutationObserver;
  6242. var document = global.document;
  6243. var process = global.process;
  6244. var Promise = global.Promise;
  6245. var microtask = safeGetBuiltIn('queueMicrotask');
  6246. var notify, toggle, node, promise, then;
  6247. // modern engines have queueMicrotask method
  6248. if (!microtask) {
  6249. var queue = new Queue();
  6250. var flush = function () {
  6251. var parent, fn;
  6252. if (IS_NODE && (parent = process.domain)) parent.exit();
  6253. while (fn = queue.get()) try {
  6254. fn();
  6255. } catch (error) {
  6256. if (queue.head) notify();
  6257. throw error;
  6258. }
  6259. if (parent) parent.enter();
  6260. };
  6261. // browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339
  6262. // also except WebOS Webkit https://github.com/zloirock/core-js/issues/898
  6263. if (!IS_IOS && !IS_NODE && !IS_WEBOS_WEBKIT && MutationObserver && document) {
  6264. toggle = true;
  6265. node = document.createTextNode('');
  6266. new MutationObserver(flush).observe(node, { characterData: true });
  6267. notify = function () {
  6268. node.data = toggle = !toggle;
  6269. };
  6270. // environments with maybe non-completely correct, but existent Promise
  6271. } else if (!IS_IOS_PEBBLE && Promise && Promise.resolve) {
  6272. // Promise.resolve without an argument throws an error in LG WebOS 2
  6273. promise = Promise.resolve(undefined);
  6274. // workaround of WebKit ~ iOS Safari 10.1 bug
  6275. promise.constructor = Promise;
  6276. then = bind(promise.then, promise);
  6277. notify = function () {
  6278. then(flush);
  6279. };
  6280. // Node.js without promises
  6281. } else if (IS_NODE) {
  6282. notify = function () {
  6283. process.nextTick(flush);
  6284. };
  6285. // for other environments - macrotask based on:
  6286. // - setImmediate
  6287. // - MessageChannel
  6288. // - window.postMessage
  6289. // - onreadystatechange
  6290. // - setTimeout
  6291. } else {
  6292. // `webpack` dev server bug on IE global methods - use bind(fn, global)
  6293. macrotask = bind(macrotask, global);
  6294. notify = function () {
  6295. macrotask(flush);
  6296. };
  6297. }
  6298. microtask = function (fn) {
  6299. if (!queue.head) notify();
  6300. queue.add(fn);
  6301. };
  6302. }
  6303. module.exports = microtask;
  6304. /***/ }),
  6305. /***/ "../../node_modules/core-js/internals/new-promise-capability.js":
  6306. /*!***************************************************************************************!*\
  6307. !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/new-promise-capability.js ***!
  6308. \***************************************************************************************/
  6309. /*! no static exports found */
  6310. /***/ (function(module, exports, __webpack_require__) {
  6311. "use strict";
  6312. var aCallable = __webpack_require__(/*! ../internals/a-callable */ "../../node_modules/core-js/internals/a-callable.js");
  6313. var $TypeError = TypeError;
  6314. var PromiseCapability = function (C) {
  6315. var resolve, reject;
  6316. this.promise = new C(function ($$resolve, $$reject) {
  6317. if (resolve !== undefined || reject !== undefined) throw new $TypeError('Bad Promise constructor');
  6318. resolve = $$resolve;
  6319. reject = $$reject;
  6320. });
  6321. this.resolve = aCallable(resolve);
  6322. this.reject = aCallable(reject);
  6323. };
  6324. // `NewPromiseCapability` abstract operation
  6325. // https://tc39.es/ecma262/#sec-newpromisecapability
  6326. module.exports.f = function (C) {
  6327. return new PromiseCapability(C);
  6328. };
  6329. /***/ }),
  6330. /***/ "../../node_modules/core-js/internals/not-a-regexp.js":
  6331. /*!*****************************************************************************!*\
  6332. !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/not-a-regexp.js ***!
  6333. \*****************************************************************************/
  6334. /*! no static exports found */
  6335. /***/ (function(module, exports, __webpack_require__) {
  6336. "use strict";
  6337. var isRegExp = __webpack_require__(/*! ../internals/is-regexp */ "../../node_modules/core-js/internals/is-regexp.js");
  6338. var $TypeError = TypeError;
  6339. module.exports = function (it) {
  6340. if (isRegExp(it)) {
  6341. throw new $TypeError("The method doesn't accept regular expressions");
  6342. } return it;
  6343. };
  6344. /***/ }),
  6345. /***/ "../../node_modules/core-js/internals/object-create.js":
  6346. /*!******************************************************************************!*\
  6347. !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/object-create.js ***!
  6348. \******************************************************************************/
  6349. /*! no static exports found */
  6350. /***/ (function(module, exports, __webpack_require__) {
  6351. "use strict";
  6352. /* global ActiveXObject -- old IE, WSH */
  6353. var anObject = __webpack_require__(/*! ../internals/an-object */ "../../node_modules/core-js/internals/an-object.js");
  6354. var definePropertiesModule = __webpack_require__(/*! ../internals/object-define-properties */ "../../node_modules/core-js/internals/object-define-properties.js");
  6355. var enumBugKeys = __webpack_require__(/*! ../internals/enum-bug-keys */ "../../node_modules/core-js/internals/enum-bug-keys.js");
  6356. var hiddenKeys = __webpack_require__(/*! ../internals/hidden-keys */ "../../node_modules/core-js/internals/hidden-keys.js");
  6357. var html = __webpack_require__(/*! ../internals/html */ "../../node_modules/core-js/internals/html.js");
  6358. var documentCreateElement = __webpack_require__(/*! ../internals/document-create-element */ "../../node_modules/core-js/internals/document-create-element.js");
  6359. var sharedKey = __webpack_require__(/*! ../internals/shared-key */ "../../node_modules/core-js/internals/shared-key.js");
  6360. var GT = '>';
  6361. var LT = '<';
  6362. var PROTOTYPE = 'prototype';
  6363. var SCRIPT = 'script';
  6364. var IE_PROTO = sharedKey('IE_PROTO');
  6365. var EmptyConstructor = function () { /* empty */ };
  6366. var scriptTag = function (content) {
  6367. return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
  6368. };
  6369. // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
  6370. var NullProtoObjectViaActiveX = function (activeXDocument) {
  6371. activeXDocument.write(scriptTag(''));
  6372. activeXDocument.close();
  6373. var temp = activeXDocument.parentWindow.Object;
  6374. activeXDocument = null; // avoid memory leak
  6375. return temp;
  6376. };
  6377. // Create object with fake `null` prototype: use iframe Object with cleared prototype
  6378. var NullProtoObjectViaIFrame = function () {
  6379. // Thrash, waste and sodomy: IE GC bug
  6380. var iframe = documentCreateElement('iframe');
  6381. var JS = 'java' + SCRIPT + ':';
  6382. var iframeDocument;
  6383. iframe.style.display = 'none';
  6384. html.appendChild(iframe);
  6385. // https://github.com/zloirock/core-js/issues/475
  6386. iframe.src = String(JS);
  6387. iframeDocument = iframe.contentWindow.document;
  6388. iframeDocument.open();
  6389. iframeDocument.write(scriptTag('document.F=Object'));
  6390. iframeDocument.close();
  6391. return iframeDocument.F;
  6392. };
  6393. // Check for document.domain and active x support
  6394. // No need to use active x approach when document.domain is not set
  6395. // see https://github.com/es-shims/es5-shim/issues/150
  6396. // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
  6397. // avoid IE GC bug
  6398. var activeXDocument;
  6399. var NullProtoObject = function () {
  6400. try {
  6401. activeXDocument = new ActiveXObject('htmlfile');
  6402. } catch (error) { /* ignore */ }
  6403. NullProtoObject = typeof document != 'undefined'
  6404. ? document.domain && activeXDocument
  6405. ? NullProtoObjectViaActiveX(activeXDocument) // old IE
  6406. : NullProtoObjectViaIFrame()
  6407. : NullProtoObjectViaActiveX(activeXDocument); // WSH
  6408. var length = enumBugKeys.length;
  6409. while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
  6410. return NullProtoObject();
  6411. };
  6412. hiddenKeys[IE_PROTO] = true;
  6413. // `Object.create` method
  6414. // https://tc39.es/ecma262/#sec-object.create
  6415. // eslint-disable-next-line es/no-object-create -- safe
  6416. module.exports = Object.create || function create(O, Properties) {
  6417. var result;
  6418. if (O !== null) {
  6419. EmptyConstructor[PROTOTYPE] = anObject(O);
  6420. result = new EmptyConstructor();
  6421. EmptyConstructor[PROTOTYPE] = null;
  6422. // add "__proto__" for Object.getPrototypeOf polyfill
  6423. result[IE_PROTO] = O;
  6424. } else result = NullProtoObject();
  6425. return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
  6426. };
  6427. /***/ }),
  6428. /***/ "../../node_modules/core-js/internals/object-define-properties.js":
  6429. /*!*****************************************************************************************!*\
  6430. !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/object-define-properties.js ***!
  6431. \*****************************************************************************************/
  6432. /*! no static exports found */
  6433. /***/ (function(module, exports, __webpack_require__) {
  6434. "use strict";
  6435. var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "../../node_modules/core-js/internals/descriptors.js");
  6436. var V8_PROTOTYPE_DEFINE_BUG = __webpack_require__(/*! ../internals/v8-prototype-define-bug */ "../../node_modules/core-js/internals/v8-prototype-define-bug.js");
  6437. var definePropertyModule = __webpack_require__(/*! ../internals/object-define-property */ "../../node_modules/core-js/internals/object-define-property.js");
  6438. var anObject = __webpack_require__(/*! ../internals/an-object */ "../../node_modules/core-js/internals/an-object.js");
  6439. var toIndexedObject = __webpack_require__(/*! ../internals/to-indexed-object */ "../../node_modules/core-js/internals/to-indexed-object.js");
  6440. var objectKeys = __webpack_require__(/*! ../internals/object-keys */ "../../node_modules/core-js/internals/object-keys.js");
  6441. // `Object.defineProperties` method
  6442. // https://tc39.es/ecma262/#sec-object.defineproperties
  6443. // eslint-disable-next-line es/no-object-defineproperties -- safe
  6444. exports.f = DESCRIPTORS && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
  6445. anObject(O);
  6446. var props = toIndexedObject(Properties);
  6447. var keys = objectKeys(Properties);
  6448. var length = keys.length;
  6449. var index = 0;
  6450. var key;
  6451. while (length > index) definePropertyModule.f(O, key = keys[index++], props[key]);
  6452. return O;
  6453. };
  6454. /***/ }),
  6455. /***/ "../../node_modules/core-js/internals/object-keys.js":
  6456. /*!****************************************************************************!*\
  6457. !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/object-keys.js ***!
  6458. \****************************************************************************/
  6459. /*! no static exports found */
  6460. /***/ (function(module, exports, __webpack_require__) {
  6461. "use strict";
  6462. var internalObjectKeys = __webpack_require__(/*! ../internals/object-keys-internal */ "../../node_modules/core-js/internals/object-keys-internal.js");
  6463. var enumBugKeys = __webpack_require__(/*! ../internals/enum-bug-keys */ "../../node_modules/core-js/internals/enum-bug-keys.js");
  6464. // `Object.keys` method
  6465. // https://tc39.es/ecma262/#sec-object.keys
  6466. // eslint-disable-next-line es/no-object-keys -- safe
  6467. module.exports = Object.keys || function keys(O) {
  6468. return internalObjectKeys(O, enumBugKeys);
  6469. };
  6470. /***/ }),
  6471. /***/ "../../node_modules/core-js/internals/perform.js":
  6472. /*!************************************************************************!*\
  6473. !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/perform.js ***!
  6474. \************************************************************************/
  6475. /*! no static exports found */
  6476. /***/ (function(module, exports, __webpack_require__) {
  6477. "use strict";
  6478. module.exports = function (exec) {
  6479. try {
  6480. return { error: false, value: exec() };
  6481. } catch (error) {
  6482. return { error: true, value: error };
  6483. }
  6484. };
  6485. /***/ }),
  6486. /***/ "../../node_modules/core-js/internals/promise-constructor-detection.js":
  6487. /*!**********************************************************************************************!*\
  6488. !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/promise-constructor-detection.js ***!
  6489. \**********************************************************************************************/
  6490. /*! no static exports found */
  6491. /***/ (function(module, exports, __webpack_require__) {
  6492. "use strict";
  6493. var global = __webpack_require__(/*! ../internals/global */ "../../node_modules/core-js/internals/global.js");
  6494. var NativePromiseConstructor = __webpack_require__(/*! ../internals/promise-native-constructor */ "../../node_modules/core-js/internals/promise-native-constructor.js");
  6495. var isCallable = __webpack_require__(/*! ../internals/is-callable */ "../../node_modules/core-js/internals/is-callable.js");
  6496. var isForced = __webpack_require__(/*! ../internals/is-forced */ "../../node_modules/core-js/internals/is-forced.js");
  6497. var inspectSource = __webpack_require__(/*! ../internals/inspect-source */ "../../node_modules/core-js/internals/inspect-source.js");
  6498. var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "../../node_modules/core-js/internals/well-known-symbol.js");
  6499. var IS_BROWSER = __webpack_require__(/*! ../internals/engine-is-browser */ "../../node_modules/core-js/internals/engine-is-browser.js");
  6500. var IS_DENO = __webpack_require__(/*! ../internals/engine-is-deno */ "../../node_modules/core-js/internals/engine-is-deno.js");
  6501. var IS_PURE = __webpack_require__(/*! ../internals/is-pure */ "../../node_modules/core-js/internals/is-pure.js");
  6502. var V8_VERSION = __webpack_require__(/*! ../internals/engine-v8-version */ "../../node_modules/core-js/internals/engine-v8-version.js");
  6503. var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
  6504. var SPECIES = wellKnownSymbol('species');
  6505. var SUBCLASSING = false;
  6506. var NATIVE_PROMISE_REJECTION_EVENT = isCallable(global.PromiseRejectionEvent);
  6507. var FORCED_PROMISE_CONSTRUCTOR = isForced('Promise', function () {
  6508. var PROMISE_CONSTRUCTOR_SOURCE = inspectSource(NativePromiseConstructor);
  6509. var GLOBAL_CORE_JS_PROMISE = PROMISE_CONSTRUCTOR_SOURCE !== String(NativePromiseConstructor);
  6510. // V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables
  6511. // https://bugs.chromium.org/p/chromium/issues/detail?id=830565
  6512. // We can't detect it synchronously, so just check versions
  6513. if (!GLOBAL_CORE_JS_PROMISE && V8_VERSION === 66) return true;
  6514. // We need Promise#{ catch, finally } in the pure version for preventing prototype pollution
  6515. if (IS_PURE && !(NativePromisePrototype['catch'] && NativePromisePrototype['finally'])) return true;
  6516. // We can't use @@species feature detection in V8 since it causes
  6517. // deoptimization and performance degradation
  6518. // https://github.com/zloirock/core-js/issues/679
  6519. if (!V8_VERSION || V8_VERSION < 51 || !/native code/.test(PROMISE_CONSTRUCTOR_SOURCE)) {
  6520. // Detect correctness of subclassing with @@species support
  6521. var promise = new NativePromiseConstructor(function (resolve) { resolve(1); });
  6522. var FakePromise = function (exec) {
  6523. exec(function () { /* empty */ }, function () { /* empty */ });
  6524. };
  6525. var constructor = promise.constructor = {};
  6526. constructor[SPECIES] = FakePromise;
  6527. SUBCLASSING = promise.then(function () { /* empty */ }) instanceof FakePromise;
  6528. if (!SUBCLASSING) return true;
  6529. // Unhandled rejections tracking support, NodeJS Promise without it fails @@species test
  6530. } return !GLOBAL_CORE_JS_PROMISE && (IS_BROWSER || IS_DENO) && !NATIVE_PROMISE_REJECTION_EVENT;
  6531. });
  6532. module.exports = {
  6533. CONSTRUCTOR: FORCED_PROMISE_CONSTRUCTOR,
  6534. REJECTION_EVENT: NATIVE_PROMISE_REJECTION_EVENT,
  6535. SUBCLASSING: SUBCLASSING
  6536. };
  6537. /***/ }),
  6538. /***/ "../../node_modules/core-js/internals/promise-native-constructor.js":
  6539. /*!*******************************************************************************************!*\
  6540. !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/promise-native-constructor.js ***!
  6541. \*******************************************************************************************/
  6542. /*! no static exports found */
  6543. /***/ (function(module, exports, __webpack_require__) {
  6544. "use strict";
  6545. var global = __webpack_require__(/*! ../internals/global */ "../../node_modules/core-js/internals/global.js");
  6546. module.exports = global.Promise;
  6547. /***/ }),
  6548. /***/ "../../node_modules/core-js/internals/promise-resolve.js":
  6549. /*!********************************************************************************!*\
  6550. !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/promise-resolve.js ***!
  6551. \********************************************************************************/
  6552. /*! no static exports found */
  6553. /***/ (function(module, exports, __webpack_require__) {
  6554. "use strict";
  6555. var anObject = __webpack_require__(/*! ../internals/an-object */ "../../node_modules/core-js/internals/an-object.js");
  6556. var isObject = __webpack_require__(/*! ../internals/is-object */ "../../node_modules/core-js/internals/is-object.js");
  6557. var newPromiseCapability = __webpack_require__(/*! ../internals/new-promise-capability */ "../../node_modules/core-js/internals/new-promise-capability.js");
  6558. module.exports = function (C, x) {
  6559. anObject(C);
  6560. if (isObject(x) && x.constructor === C) return x;
  6561. var promiseCapability = newPromiseCapability.f(C);
  6562. var resolve = promiseCapability.resolve;
  6563. resolve(x);
  6564. return promiseCapability.promise;
  6565. };
  6566. /***/ }),
  6567. /***/ "../../node_modules/core-js/internals/promise-statics-incorrect-iteration.js":
  6568. /*!****************************************************************************************************!*\
  6569. !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/promise-statics-incorrect-iteration.js ***!
  6570. \****************************************************************************************************/
  6571. /*! no static exports found */
  6572. /***/ (function(module, exports, __webpack_require__) {
  6573. "use strict";
  6574. var NativePromiseConstructor = __webpack_require__(/*! ../internals/promise-native-constructor */ "../../node_modules/core-js/internals/promise-native-constructor.js");
  6575. var checkCorrectnessOfIteration = __webpack_require__(/*! ../internals/check-correctness-of-iteration */ "../../node_modules/core-js/internals/check-correctness-of-iteration.js");
  6576. var FORCED_PROMISE_CONSTRUCTOR = __webpack_require__(/*! ../internals/promise-constructor-detection */ "../../node_modules/core-js/internals/promise-constructor-detection.js").CONSTRUCTOR;
  6577. module.exports = FORCED_PROMISE_CONSTRUCTOR || !checkCorrectnessOfIteration(function (iterable) {
  6578. NativePromiseConstructor.all(iterable).then(undefined, function () { /* empty */ });
  6579. });
  6580. /***/ }),
  6581. /***/ "../../node_modules/core-js/internals/queue.js":
  6582. /*!**********************************************************************!*\
  6583. !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/queue.js ***!
  6584. \**********************************************************************/
  6585. /*! no static exports found */
  6586. /***/ (function(module, exports, __webpack_require__) {
  6587. "use strict";
  6588. var Queue = function () {
  6589. this.head = null;
  6590. this.tail = null;
  6591. };
  6592. Queue.prototype = {
  6593. add: function (item) {
  6594. var entry = { item: item, next: null };
  6595. var tail = this.tail;
  6596. if (tail) tail.next = entry;
  6597. else this.head = entry;
  6598. this.tail = entry;
  6599. },
  6600. get: function () {
  6601. var entry = this.head;
  6602. if (entry) {
  6603. var next = this.head = entry.next;
  6604. if (next === null) this.tail = null;
  6605. return entry.item;
  6606. }
  6607. }
  6608. };
  6609. module.exports = Queue;
  6610. /***/ }),
  6611. /***/ "../../node_modules/core-js/internals/regexp-exec-abstract.js":
  6612. /*!*************************************************************************************!*\
  6613. !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/regexp-exec-abstract.js ***!
  6614. \*************************************************************************************/
  6615. /*! no static exports found */
  6616. /***/ (function(module, exports, __webpack_require__) {
  6617. "use strict";
  6618. var call = __webpack_require__(/*! ../internals/function-call */ "../../node_modules/core-js/internals/function-call.js");
  6619. var anObject = __webpack_require__(/*! ../internals/an-object */ "../../node_modules/core-js/internals/an-object.js");
  6620. var isCallable = __webpack_require__(/*! ../internals/is-callable */ "../../node_modules/core-js/internals/is-callable.js");
  6621. var classof = __webpack_require__(/*! ../internals/classof-raw */ "../../node_modules/core-js/internals/classof-raw.js");
  6622. var regexpExec = __webpack_require__(/*! ../internals/regexp-exec */ "../../node_modules/core-js/internals/regexp-exec.js");
  6623. var $TypeError = TypeError;
  6624. // `RegExpExec` abstract operation
  6625. // https://tc39.es/ecma262/#sec-regexpexec
  6626. module.exports = function (R, S) {
  6627. var exec = R.exec;
  6628. if (isCallable(exec)) {
  6629. var result = call(exec, R, S);
  6630. if (result !== null) anObject(result);
  6631. return result;
  6632. }
  6633. if (classof(R) === 'RegExp') return call(regexpExec, R, S);
  6634. throw new $TypeError('RegExp#exec called on incompatible receiver');
  6635. };
  6636. /***/ }),
  6637. /***/ "../../node_modules/core-js/internals/regexp-exec.js":
  6638. /*!****************************************************************************!*\
  6639. !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/regexp-exec.js ***!
  6640. \****************************************************************************/
  6641. /*! no static exports found */
  6642. /***/ (function(module, exports, __webpack_require__) {
  6643. "use strict";
  6644. /* eslint-disable regexp/no-empty-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */
  6645. /* eslint-disable regexp/no-useless-quantifier -- testing */
  6646. var call = __webpack_require__(/*! ../internals/function-call */ "../../node_modules/core-js/internals/function-call.js");
  6647. var uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this */ "../../node_modules/core-js/internals/function-uncurry-this.js");
  6648. var toString = __webpack_require__(/*! ../internals/to-string */ "../../node_modules/core-js/internals/to-string.js");
  6649. var regexpFlags = __webpack_require__(/*! ../internals/regexp-flags */ "../../node_modules/core-js/internals/regexp-flags.js");
  6650. var stickyHelpers = __webpack_require__(/*! ../internals/regexp-sticky-helpers */ "../../node_modules/core-js/internals/regexp-sticky-helpers.js");
  6651. var shared = __webpack_require__(/*! ../internals/shared */ "../../node_modules/core-js/internals/shared.js");
  6652. var create = __webpack_require__(/*! ../internals/object-create */ "../../node_modules/core-js/internals/object-create.js");
  6653. var getInternalState = __webpack_require__(/*! ../internals/internal-state */ "../../node_modules/core-js/internals/internal-state.js").get;
  6654. var UNSUPPORTED_DOT_ALL = __webpack_require__(/*! ../internals/regexp-unsupported-dot-all */ "../../node_modules/core-js/internals/regexp-unsupported-dot-all.js");
  6655. var UNSUPPORTED_NCG = __webpack_require__(/*! ../internals/regexp-unsupported-ncg */ "../../node_modules/core-js/internals/regexp-unsupported-ncg.js");
  6656. var nativeReplace = shared('native-string-replace', String.prototype.replace);
  6657. var nativeExec = RegExp.prototype.exec;
  6658. var patchedExec = nativeExec;
  6659. var charAt = uncurryThis(''.charAt);
  6660. var indexOf = uncurryThis(''.indexOf);
  6661. var replace = uncurryThis(''.replace);
  6662. var stringSlice = uncurryThis(''.slice);
  6663. var UPDATES_LAST_INDEX_WRONG = (function () {
  6664. var re1 = /a/;
  6665. var re2 = /b*/g;
  6666. call(nativeExec, re1, 'a');
  6667. call(nativeExec, re2, 'a');
  6668. return re1.lastIndex !== 0 || re2.lastIndex !== 0;
  6669. })();
  6670. var UNSUPPORTED_Y = stickyHelpers.BROKEN_CARET;
  6671. // nonparticipating capturing group, copied from es5-shim's String#split patch.
  6672. var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
  6673. var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG;
  6674. if (PATCH) {
  6675. patchedExec = function exec(string) {
  6676. var re = this;
  6677. var state = getInternalState(re);
  6678. var str = toString(string);
  6679. var raw = state.raw;
  6680. var result, reCopy, lastIndex, match, i, object, group;
  6681. if (raw) {
  6682. raw.lastIndex = re.lastIndex;
  6683. result = call(patchedExec, raw, str);
  6684. re.lastIndex = raw.lastIndex;
  6685. return result;
  6686. }
  6687. var groups = state.groups;
  6688. var sticky = UNSUPPORTED_Y && re.sticky;
  6689. var flags = call(regexpFlags, re);
  6690. var source = re.source;
  6691. var charsAdded = 0;
  6692. var strCopy = str;
  6693. if (sticky) {
  6694. flags = replace(flags, 'y', '');
  6695. if (indexOf(flags, 'g') === -1) {
  6696. flags += 'g';
  6697. }
  6698. strCopy = stringSlice(str, re.lastIndex);
  6699. // Support anchored sticky behavior.
  6700. if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt(str, re.lastIndex - 1) !== '\n')) {
  6701. source = '(?: ' + source + ')';
  6702. strCopy = ' ' + strCopy;
  6703. charsAdded++;
  6704. }
  6705. // ^(? + rx + ) is needed, in combination with some str slicing, to
  6706. // simulate the 'y' flag.
  6707. reCopy = new RegExp('^(?:' + source + ')', flags);
  6708. }
  6709. if (NPCG_INCLUDED) {
  6710. reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
  6711. }
  6712. if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
  6713. match = call(nativeExec, sticky ? reCopy : re, strCopy);
  6714. if (sticky) {
  6715. if (match) {
  6716. match.input = stringSlice(match.input, charsAdded);
  6717. match[0] = stringSlice(match[0], charsAdded);
  6718. match.index = re.lastIndex;
  6719. re.lastIndex += match[0].length;
  6720. } else re.lastIndex = 0;
  6721. } else if (UPDATES_LAST_INDEX_WRONG && match) {
  6722. re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
  6723. }
  6724. if (NPCG_INCLUDED && match && match.length > 1) {
  6725. // Fix browsers whose `exec` methods don't consistently return `undefined`
  6726. // for NPCG, like IE8. NOTE: This doesn't work for /(.?)?/
  6727. call(nativeReplace, match[0], reCopy, function () {
  6728. for (i = 1; i < arguments.length - 2; i++) {
  6729. if (arguments[i] === undefined) match[i] = undefined;
  6730. }
  6731. });
  6732. }
  6733. if (match && groups) {
  6734. match.groups = object = create(null);
  6735. for (i = 0; i < groups.length; i++) {
  6736. group = groups[i];
  6737. object[group[0]] = match[group[1]];
  6738. }
  6739. }
  6740. return match;
  6741. };
  6742. }
  6743. module.exports = patchedExec;
  6744. /***/ }),
  6745. /***/ "../../node_modules/core-js/internals/regexp-sticky-helpers.js":
  6746. /*!**************************************************************************************!*\
  6747. !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/regexp-sticky-helpers.js ***!
  6748. \**************************************************************************************/
  6749. /*! no static exports found */
  6750. /***/ (function(module, exports, __webpack_require__) {
  6751. "use strict";
  6752. var fails = __webpack_require__(/*! ../internals/fails */ "../../node_modules/core-js/internals/fails.js");
  6753. var global = __webpack_require__(/*! ../internals/global */ "../../node_modules/core-js/internals/global.js");
  6754. // babel-minify and Closure Compiler transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
  6755. var $RegExp = global.RegExp;
  6756. var UNSUPPORTED_Y = fails(function () {
  6757. var re = $RegExp('a', 'y');
  6758. re.lastIndex = 2;
  6759. return re.exec('abcd') !== null;
  6760. });
  6761. // UC Browser bug
  6762. // https://github.com/zloirock/core-js/issues/1008
  6763. var MISSED_STICKY = UNSUPPORTED_Y || fails(function () {
  6764. return !$RegExp('a', 'y').sticky;
  6765. });
  6766. var BROKEN_CARET = UNSUPPORTED_Y || fails(function () {
  6767. // https://bugzilla.mozilla.org/show_bug.cgi?id=773687
  6768. var re = $RegExp('^r', 'gy');
  6769. re.lastIndex = 2;
  6770. return re.exec('str') !== null;
  6771. });
  6772. module.exports = {
  6773. BROKEN_CARET: BROKEN_CARET,
  6774. MISSED_STICKY: MISSED_STICKY,
  6775. UNSUPPORTED_Y: UNSUPPORTED_Y
  6776. };
  6777. /***/ }),
  6778. /***/ "../../node_modules/core-js/internals/regexp-unsupported-dot-all.js":
  6779. /*!*******************************************************************************************!*\
  6780. !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/regexp-unsupported-dot-all.js ***!
  6781. \*******************************************************************************************/
  6782. /*! no static exports found */
  6783. /***/ (function(module, exports, __webpack_require__) {
  6784. "use strict";
  6785. var fails = __webpack_require__(/*! ../internals/fails */ "../../node_modules/core-js/internals/fails.js");
  6786. var global = __webpack_require__(/*! ../internals/global */ "../../node_modules/core-js/internals/global.js");
  6787. // babel-minify and Closure Compiler transpiles RegExp('.', 's') -> /./s and it causes SyntaxError
  6788. var $RegExp = global.RegExp;
  6789. module.exports = fails(function () {
  6790. var re = $RegExp('.', 's');
  6791. return !(re.dotAll && re.test('\n') && re.flags === 's');
  6792. });
  6793. /***/ }),
  6794. /***/ "../../node_modules/core-js/internals/regexp-unsupported-ncg.js":
  6795. /*!***************************************************************************************!*\
  6796. !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/regexp-unsupported-ncg.js ***!
  6797. \***************************************************************************************/
  6798. /*! no static exports found */
  6799. /***/ (function(module, exports, __webpack_require__) {
  6800. "use strict";
  6801. var fails = __webpack_require__(/*! ../internals/fails */ "../../node_modules/core-js/internals/fails.js");
  6802. var global = __webpack_require__(/*! ../internals/global */ "../../node_modules/core-js/internals/global.js");
  6803. // babel-minify and Closure Compiler transpiles RegExp('(?<a>b)', 'g') -> /(?<a>b)/g and it causes SyntaxError
  6804. var $RegExp = global.RegExp;
  6805. module.exports = fails(function () {
  6806. var re = $RegExp('(?<a>b)', 'g');
  6807. return re.exec('b').groups.a !== 'b' ||
  6808. 'b'.replace(re, '$<a>c') !== 'bc';
  6809. });
  6810. /***/ }),
  6811. /***/ "../../node_modules/core-js/internals/safe-get-built-in.js":
  6812. /*!**********************************************************************************!*\
  6813. !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/safe-get-built-in.js ***!
  6814. \**********************************************************************************/
  6815. /*! no static exports found */
  6816. /***/ (function(module, exports, __webpack_require__) {
  6817. "use strict";
  6818. var global = __webpack_require__(/*! ../internals/global */ "../../node_modules/core-js/internals/global.js");
  6819. var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "../../node_modules/core-js/internals/descriptors.js");
  6820. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  6821. var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  6822. // Avoid NodeJS experimental warning
  6823. module.exports = function (name) {
  6824. if (!DESCRIPTORS) return global[name];
  6825. var descriptor = getOwnPropertyDescriptor(global, name);
  6826. return descriptor && descriptor.value;
  6827. };
  6828. /***/ }),
  6829. /***/ "../../node_modules/core-js/internals/set-species.js":
  6830. /*!****************************************************************************!*\
  6831. !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/set-species.js ***!
  6832. \****************************************************************************/
  6833. /*! no static exports found */
  6834. /***/ (function(module, exports, __webpack_require__) {
  6835. "use strict";
  6836. var getBuiltIn = __webpack_require__(/*! ../internals/get-built-in */ "../../node_modules/core-js/internals/get-built-in.js");
  6837. var defineBuiltInAccessor = __webpack_require__(/*! ../internals/define-built-in-accessor */ "../../node_modules/core-js/internals/define-built-in-accessor.js");
  6838. var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "../../node_modules/core-js/internals/well-known-symbol.js");
  6839. var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "../../node_modules/core-js/internals/descriptors.js");
  6840. var SPECIES = wellKnownSymbol('species');
  6841. module.exports = function (CONSTRUCTOR_NAME) {
  6842. var Constructor = getBuiltIn(CONSTRUCTOR_NAME);
  6843. if (DESCRIPTORS && Constructor && !Constructor[SPECIES]) {
  6844. defineBuiltInAccessor(Constructor, SPECIES, {
  6845. configurable: true,
  6846. get: function () { return this; }
  6847. });
  6848. }
  6849. };
  6850. /***/ }),
  6851. /***/ "../../node_modules/core-js/internals/species-constructor.js":
  6852. /*!************************************************************************************!*\
  6853. !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/species-constructor.js ***!
  6854. \************************************************************************************/
  6855. /*! no static exports found */
  6856. /***/ (function(module, exports, __webpack_require__) {
  6857. "use strict";
  6858. var anObject = __webpack_require__(/*! ../internals/an-object */ "../../node_modules/core-js/internals/an-object.js");
  6859. var aConstructor = __webpack_require__(/*! ../internals/a-constructor */ "../../node_modules/core-js/internals/a-constructor.js");
  6860. var isNullOrUndefined = __webpack_require__(/*! ../internals/is-null-or-undefined */ "../../node_modules/core-js/internals/is-null-or-undefined.js");
  6861. var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "../../node_modules/core-js/internals/well-known-symbol.js");
  6862. var SPECIES = wellKnownSymbol('species');
  6863. // `SpeciesConstructor` abstract operation
  6864. // https://tc39.es/ecma262/#sec-speciesconstructor
  6865. module.exports = function (O, defaultConstructor) {
  6866. var C = anObject(O).constructor;
  6867. var S;
  6868. return C === undefined || isNullOrUndefined(S = anObject(C)[SPECIES]) ? defaultConstructor : aConstructor(S);
  6869. };
  6870. /***/ }),
  6871. /***/ "../../node_modules/core-js/internals/string-multibyte.js":
  6872. /*!*********************************************************************************!*\
  6873. !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/string-multibyte.js ***!
  6874. \*********************************************************************************/
  6875. /*! no static exports found */
  6876. /***/ (function(module, exports, __webpack_require__) {
  6877. "use strict";
  6878. var uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this */ "../../node_modules/core-js/internals/function-uncurry-this.js");
  6879. var toIntegerOrInfinity = __webpack_require__(/*! ../internals/to-integer-or-infinity */ "../../node_modules/core-js/internals/to-integer-or-infinity.js");
  6880. var toString = __webpack_require__(/*! ../internals/to-string */ "../../node_modules/core-js/internals/to-string.js");
  6881. var requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ "../../node_modules/core-js/internals/require-object-coercible.js");
  6882. var charAt = uncurryThis(''.charAt);
  6883. var charCodeAt = uncurryThis(''.charCodeAt);
  6884. var stringSlice = uncurryThis(''.slice);
  6885. var createMethod = function (CONVERT_TO_STRING) {
  6886. return function ($this, pos) {
  6887. var S = toString(requireObjectCoercible($this));
  6888. var position = toIntegerOrInfinity(pos);
  6889. var size = S.length;
  6890. var first, second;
  6891. if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
  6892. first = charCodeAt(S, position);
  6893. return first < 0xD800 || first > 0xDBFF || position + 1 === size
  6894. || (second = charCodeAt(S, position + 1)) < 0xDC00 || second > 0xDFFF
  6895. ? CONVERT_TO_STRING
  6896. ? charAt(S, position)
  6897. : first
  6898. : CONVERT_TO_STRING
  6899. ? stringSlice(S, position, position + 2)
  6900. : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
  6901. };
  6902. };
  6903. module.exports = {
  6904. // `String.prototype.codePointAt` method
  6905. // https://tc39.es/ecma262/#sec-string.prototype.codepointat
  6906. codeAt: createMethod(false),
  6907. // `String.prototype.at` method
  6908. // https://github.com/mathiasbynens/String.prototype.at
  6909. charAt: createMethod(true)
  6910. };
  6911. /***/ }),
  6912. /***/ "../../node_modules/core-js/internals/string-trim-forced.js":
  6913. /*!***********************************************************************************!*\
  6914. !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/string-trim-forced.js ***!
  6915. \***********************************************************************************/
  6916. /*! no static exports found */
  6917. /***/ (function(module, exports, __webpack_require__) {
  6918. "use strict";
  6919. var PROPER_FUNCTION_NAME = __webpack_require__(/*! ../internals/function-name */ "../../node_modules/core-js/internals/function-name.js").PROPER;
  6920. var fails = __webpack_require__(/*! ../internals/fails */ "../../node_modules/core-js/internals/fails.js");
  6921. var whitespaces = __webpack_require__(/*! ../internals/whitespaces */ "../../node_modules/core-js/internals/whitespaces.js");
  6922. var non = '\u200B\u0085\u180E';
  6923. // check that a method works with the correct list
  6924. // of whitespaces and has a correct name
  6925. module.exports = function (METHOD_NAME) {
  6926. return fails(function () {
  6927. return !!whitespaces[METHOD_NAME]()
  6928. || non[METHOD_NAME]() !== non
  6929. || (PROPER_FUNCTION_NAME && whitespaces[METHOD_NAME].name !== METHOD_NAME);
  6930. });
  6931. };
  6932. /***/ }),
  6933. /***/ "../../node_modules/core-js/internals/string-trim.js":
  6934. /*!****************************************************************************!*\
  6935. !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/string-trim.js ***!
  6936. \****************************************************************************/
  6937. /*! no static exports found */
  6938. /***/ (function(module, exports, __webpack_require__) {
  6939. "use strict";
  6940. var uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this */ "../../node_modules/core-js/internals/function-uncurry-this.js");
  6941. var requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ "../../node_modules/core-js/internals/require-object-coercible.js");
  6942. var toString = __webpack_require__(/*! ../internals/to-string */ "../../node_modules/core-js/internals/to-string.js");
  6943. var whitespaces = __webpack_require__(/*! ../internals/whitespaces */ "../../node_modules/core-js/internals/whitespaces.js");
  6944. var replace = uncurryThis(''.replace);
  6945. var ltrim = RegExp('^[' + whitespaces + ']+');
  6946. var rtrim = RegExp('(^|[^' + whitespaces + '])[' + whitespaces + ']+$');
  6947. // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
  6948. var createMethod = function (TYPE) {
  6949. return function ($this) {
  6950. var string = toString(requireObjectCoercible($this));
  6951. if (TYPE & 1) string = replace(string, ltrim, '');
  6952. if (TYPE & 2) string = replace(string, rtrim, '$1');
  6953. return string;
  6954. };
  6955. };
  6956. module.exports = {
  6957. // `String.prototype.{ trimLeft, trimStart }` methods
  6958. // https://tc39.es/ecma262/#sec-string.prototype.trimstart
  6959. start: createMethod(1),
  6960. // `String.prototype.{ trimRight, trimEnd }` methods
  6961. // https://tc39.es/ecma262/#sec-string.prototype.trimend
  6962. end: createMethod(2),
  6963. // `String.prototype.trim` method
  6964. // https://tc39.es/ecma262/#sec-string.prototype.trim
  6965. trim: createMethod(3)
  6966. };
  6967. /***/ }),
  6968. /***/ "../../node_modules/core-js/internals/task.js":
  6969. /*!*********************************************************************!*\
  6970. !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/task.js ***!
  6971. \*********************************************************************/
  6972. /*! no static exports found */
  6973. /***/ (function(module, exports, __webpack_require__) {
  6974. "use strict";
  6975. var global = __webpack_require__(/*! ../internals/global */ "../../node_modules/core-js/internals/global.js");
  6976. var apply = __webpack_require__(/*! ../internals/function-apply */ "../../node_modules/core-js/internals/function-apply.js");
  6977. var bind = __webpack_require__(/*! ../internals/function-bind-context */ "../../node_modules/core-js/internals/function-bind-context.js");
  6978. var isCallable = __webpack_require__(/*! ../internals/is-callable */ "../../node_modules/core-js/internals/is-callable.js");
  6979. var hasOwn = __webpack_require__(/*! ../internals/has-own-property */ "../../node_modules/core-js/internals/has-own-property.js");
  6980. var fails = __webpack_require__(/*! ../internals/fails */ "../../node_modules/core-js/internals/fails.js");
  6981. var html = __webpack_require__(/*! ../internals/html */ "../../node_modules/core-js/internals/html.js");
  6982. var arraySlice = __webpack_require__(/*! ../internals/array-slice */ "../../node_modules/core-js/internals/array-slice.js");
  6983. var createElement = __webpack_require__(/*! ../internals/document-create-element */ "../../node_modules/core-js/internals/document-create-element.js");
  6984. var validateArgumentsLength = __webpack_require__(/*! ../internals/validate-arguments-length */ "../../node_modules/core-js/internals/validate-arguments-length.js");
  6985. var IS_IOS = __webpack_require__(/*! ../internals/engine-is-ios */ "../../node_modules/core-js/internals/engine-is-ios.js");
  6986. var IS_NODE = __webpack_require__(/*! ../internals/engine-is-node */ "../../node_modules/core-js/internals/engine-is-node.js");
  6987. var set = global.setImmediate;
  6988. var clear = global.clearImmediate;
  6989. var process = global.process;
  6990. var Dispatch = global.Dispatch;
  6991. var Function = global.Function;
  6992. var MessageChannel = global.MessageChannel;
  6993. var String = global.String;
  6994. var counter = 0;
  6995. var queue = {};
  6996. var ONREADYSTATECHANGE = 'onreadystatechange';
  6997. var $location, defer, channel, port;
  6998. fails(function () {
  6999. // Deno throws a ReferenceError on `location` access without `--location` flag
  7000. $location = global.location;
  7001. });
  7002. var run = function (id) {
  7003. if (hasOwn(queue, id)) {
  7004. var fn = queue[id];
  7005. delete queue[id];
  7006. fn();
  7007. }
  7008. };
  7009. var runner = function (id) {
  7010. return function () {
  7011. run(id);
  7012. };
  7013. };
  7014. var eventListener = function (event) {
  7015. run(event.data);
  7016. };
  7017. var globalPostMessageDefer = function (id) {
  7018. // old engines have not location.origin
  7019. global.postMessage(String(id), $location.protocol + '//' + $location.host);
  7020. };
  7021. // Node.js 0.9+ & IE10+ has setImmediate, otherwise:
  7022. if (!set || !clear) {
  7023. set = function setImmediate(handler) {
  7024. validateArgumentsLength(arguments.length, 1);
  7025. var fn = isCallable(handler) ? handler : Function(handler);
  7026. var args = arraySlice(arguments, 1);
  7027. queue[++counter] = function () {
  7028. apply(fn, undefined, args);
  7029. };
  7030. defer(counter);
  7031. return counter;
  7032. };
  7033. clear = function clearImmediate(id) {
  7034. delete queue[id];
  7035. };
  7036. // Node.js 0.8-
  7037. if (IS_NODE) {
  7038. defer = function (id) {
  7039. process.nextTick(runner(id));
  7040. };
  7041. // Sphere (JS game engine) Dispatch API
  7042. } else if (Dispatch && Dispatch.now) {
  7043. defer = function (id) {
  7044. Dispatch.now(runner(id));
  7045. };
  7046. // Browsers with MessageChannel, includes WebWorkers
  7047. // except iOS - https://github.com/zloirock/core-js/issues/624
  7048. } else if (MessageChannel && !IS_IOS) {
  7049. channel = new MessageChannel();
  7050. port = channel.port2;
  7051. channel.port1.onmessage = eventListener;
  7052. defer = bind(port.postMessage, port);
  7053. // Browsers with postMessage, skip WebWorkers
  7054. // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
  7055. } else if (
  7056. global.addEventListener &&
  7057. isCallable(global.postMessage) &&
  7058. !global.importScripts &&
  7059. $location && $location.protocol !== 'file:' &&
  7060. !fails(globalPostMessageDefer)
  7061. ) {
  7062. defer = globalPostMessageDefer;
  7063. global.addEventListener('message', eventListener, false);
  7064. // IE8-
  7065. } else if (ONREADYSTATECHANGE in createElement('script')) {
  7066. defer = function (id) {
  7067. html.appendChild(createElement('script'))[ONREADYSTATECHANGE] = function () {
  7068. html.removeChild(this);
  7069. run(id);
  7070. };
  7071. };
  7072. // Rest old browsers
  7073. } else {
  7074. defer = function (id) {
  7075. setTimeout(runner(id), 0);
  7076. };
  7077. }
  7078. }
  7079. module.exports = {
  7080. set: set,
  7081. clear: clear
  7082. };
  7083. /***/ }),
  7084. /***/ "../../node_modules/core-js/internals/whitespaces.js":
  7085. /*!****************************************************************************!*\
  7086. !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/whitespaces.js ***!
  7087. \****************************************************************************/
  7088. /*! no static exports found */
  7089. /***/ (function(module, exports, __webpack_require__) {
  7090. "use strict";
  7091. // a string of all valid unicode whitespaces
  7092. module.exports = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' +
  7093. '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
  7094. /***/ }),
  7095. /***/ "../../node_modules/core-js/modules/es.array.index-of.js":
  7096. /*!********************************************************************************!*\
  7097. !*** D:/web_src/4dkankan_v4/node_modules/core-js/modules/es.array.index-of.js ***!
  7098. \********************************************************************************/
  7099. /*! no static exports found */
  7100. /***/ (function(module, exports, __webpack_require__) {
  7101. "use strict";
  7102. /* eslint-disable es/no-array-prototype-indexof -- required for testing */
  7103. var $ = __webpack_require__(/*! ../internals/export */ "../../node_modules/core-js/internals/export.js");
  7104. var uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this-clause */ "../../node_modules/core-js/internals/function-uncurry-this-clause.js");
  7105. var $indexOf = __webpack_require__(/*! ../internals/array-includes */ "../../node_modules/core-js/internals/array-includes.js").indexOf;
  7106. var arrayMethodIsStrict = __webpack_require__(/*! ../internals/array-method-is-strict */ "../../node_modules/core-js/internals/array-method-is-strict.js");
  7107. var nativeIndexOf = uncurryThis([].indexOf);
  7108. var NEGATIVE_ZERO = !!nativeIndexOf && 1 / nativeIndexOf([1], 1, -0) < 0;
  7109. var FORCED = NEGATIVE_ZERO || !arrayMethodIsStrict('indexOf');
  7110. // `Array.prototype.indexOf` method
  7111. // https://tc39.es/ecma262/#sec-array.prototype.indexof
  7112. $({ target: 'Array', proto: true, forced: FORCED }, {
  7113. indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
  7114. var fromIndex = arguments.length > 1 ? arguments[1] : undefined;
  7115. return NEGATIVE_ZERO
  7116. // convert -0 to +0
  7117. ? nativeIndexOf(this, searchElement, fromIndex) || 0
  7118. : $indexOf(this, searchElement, fromIndex);
  7119. }
  7120. });
  7121. /***/ }),
  7122. /***/ "../../node_modules/core-js/modules/es.array.iterator.js":
  7123. /*!********************************************************************************!*\
  7124. !*** D:/web_src/4dkankan_v4/node_modules/core-js/modules/es.array.iterator.js ***!
  7125. \********************************************************************************/
  7126. /*! no static exports found */
  7127. /***/ (function(module, exports, __webpack_require__) {
  7128. "use strict";
  7129. var toIndexedObject = __webpack_require__(/*! ../internals/to-indexed-object */ "../../node_modules/core-js/internals/to-indexed-object.js");
  7130. var addToUnscopables = __webpack_require__(/*! ../internals/add-to-unscopables */ "../../node_modules/core-js/internals/add-to-unscopables.js");
  7131. var Iterators = __webpack_require__(/*! ../internals/iterators */ "../../node_modules/core-js/internals/iterators.js");
  7132. var InternalStateModule = __webpack_require__(/*! ../internals/internal-state */ "../../node_modules/core-js/internals/internal-state.js");
  7133. var defineProperty = __webpack_require__(/*! ../internals/object-define-property */ "../../node_modules/core-js/internals/object-define-property.js").f;
  7134. var defineIterator = __webpack_require__(/*! ../internals/iterator-define */ "../../node_modules/core-js/internals/iterator-define.js");
  7135. var createIterResultObject = __webpack_require__(/*! ../internals/create-iter-result-object */ "../../node_modules/core-js/internals/create-iter-result-object.js");
  7136. var IS_PURE = __webpack_require__(/*! ../internals/is-pure */ "../../node_modules/core-js/internals/is-pure.js");
  7137. var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "../../node_modules/core-js/internals/descriptors.js");
  7138. var ARRAY_ITERATOR = 'Array Iterator';
  7139. var setInternalState = InternalStateModule.set;
  7140. var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR);
  7141. // `Array.prototype.entries` method
  7142. // https://tc39.es/ecma262/#sec-array.prototype.entries
  7143. // `Array.prototype.keys` method
  7144. // https://tc39.es/ecma262/#sec-array.prototype.keys
  7145. // `Array.prototype.values` method
  7146. // https://tc39.es/ecma262/#sec-array.prototype.values
  7147. // `Array.prototype[@@iterator]` method
  7148. // https://tc39.es/ecma262/#sec-array.prototype-@@iterator
  7149. // `CreateArrayIterator` internal method
  7150. // https://tc39.es/ecma262/#sec-createarrayiterator
  7151. module.exports = defineIterator(Array, 'Array', function (iterated, kind) {
  7152. setInternalState(this, {
  7153. type: ARRAY_ITERATOR,
  7154. target: toIndexedObject(iterated), // target
  7155. index: 0, // next index
  7156. kind: kind // kind
  7157. });
  7158. // `%ArrayIteratorPrototype%.next` method
  7159. // https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next
  7160. }, function () {
  7161. var state = getInternalState(this);
  7162. var target = state.target;
  7163. var index = state.index++;
  7164. if (!target || index >= target.length) {
  7165. state.target = undefined;
  7166. return createIterResultObject(undefined, true);
  7167. }
  7168. switch (state.kind) {
  7169. case 'keys': return createIterResultObject(index, false);
  7170. case 'values': return createIterResultObject(target[index], false);
  7171. } return createIterResultObject([index, target[index]], false);
  7172. }, 'values');
  7173. // argumentsList[@@iterator] is %ArrayProto_values%
  7174. // https://tc39.es/ecma262/#sec-createunmappedargumentsobject
  7175. // https://tc39.es/ecma262/#sec-createmappedargumentsobject
  7176. var values = Iterators.Arguments = Iterators.Array;
  7177. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  7178. addToUnscopables('keys');
  7179. addToUnscopables('values');
  7180. addToUnscopables('entries');
  7181. // V8 ~ Chrome 45- bug
  7182. if (!IS_PURE && DESCRIPTORS && values.name !== 'values') try {
  7183. defineProperty(values, 'name', { value: 'values' });
  7184. } catch (error) { /* empty */ }
  7185. /***/ }),
  7186. /***/ "../../node_modules/core-js/modules/es.array.reverse.js":
  7187. /*!*******************************************************************************!*\
  7188. !*** D:/web_src/4dkankan_v4/node_modules/core-js/modules/es.array.reverse.js ***!
  7189. \*******************************************************************************/
  7190. /*! no static exports found */
  7191. /***/ (function(module, exports, __webpack_require__) {
  7192. "use strict";
  7193. var $ = __webpack_require__(/*! ../internals/export */ "../../node_modules/core-js/internals/export.js");
  7194. var uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this */ "../../node_modules/core-js/internals/function-uncurry-this.js");
  7195. var isArray = __webpack_require__(/*! ../internals/is-array */ "../../node_modules/core-js/internals/is-array.js");
  7196. var nativeReverse = uncurryThis([].reverse);
  7197. var test = [1, 2];
  7198. // `Array.prototype.reverse` method
  7199. // https://tc39.es/ecma262/#sec-array.prototype.reverse
  7200. // fix for Safari 12.0 bug
  7201. // https://bugs.webkit.org/show_bug.cgi?id=188794
  7202. $({ target: 'Array', proto: true, forced: String(test) === String(test.reverse()) }, {
  7203. reverse: function reverse() {
  7204. // eslint-disable-next-line no-self-assign -- dirty hack
  7205. if (isArray(this)) this.length = this.length;
  7206. return nativeReverse(this);
  7207. }
  7208. });
  7209. /***/ }),
  7210. /***/ "../../node_modules/core-js/modules/es.promise.all.js":
  7211. /*!*****************************************************************************!*\
  7212. !*** D:/web_src/4dkankan_v4/node_modules/core-js/modules/es.promise.all.js ***!
  7213. \*****************************************************************************/
  7214. /*! no static exports found */
  7215. /***/ (function(module, exports, __webpack_require__) {
  7216. "use strict";
  7217. var $ = __webpack_require__(/*! ../internals/export */ "../../node_modules/core-js/internals/export.js");
  7218. var call = __webpack_require__(/*! ../internals/function-call */ "../../node_modules/core-js/internals/function-call.js");
  7219. var aCallable = __webpack_require__(/*! ../internals/a-callable */ "../../node_modules/core-js/internals/a-callable.js");
  7220. var newPromiseCapabilityModule = __webpack_require__(/*! ../internals/new-promise-capability */ "../../node_modules/core-js/internals/new-promise-capability.js");
  7221. var perform = __webpack_require__(/*! ../internals/perform */ "../../node_modules/core-js/internals/perform.js");
  7222. var iterate = __webpack_require__(/*! ../internals/iterate */ "../../node_modules/core-js/internals/iterate.js");
  7223. var PROMISE_STATICS_INCORRECT_ITERATION = __webpack_require__(/*! ../internals/promise-statics-incorrect-iteration */ "../../node_modules/core-js/internals/promise-statics-incorrect-iteration.js");
  7224. // `Promise.all` method
  7225. // https://tc39.es/ecma262/#sec-promise.all
  7226. $({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {
  7227. all: function all(iterable) {
  7228. var C = this;
  7229. var capability = newPromiseCapabilityModule.f(C);
  7230. var resolve = capability.resolve;
  7231. var reject = capability.reject;
  7232. var result = perform(function () {
  7233. var $promiseResolve = aCallable(C.resolve);
  7234. var values = [];
  7235. var counter = 0;
  7236. var remaining = 1;
  7237. iterate(iterable, function (promise) {
  7238. var index = counter++;
  7239. var alreadyCalled = false;
  7240. remaining++;
  7241. call($promiseResolve, C, promise).then(function (value) {
  7242. if (alreadyCalled) return;
  7243. alreadyCalled = true;
  7244. values[index] = value;
  7245. --remaining || resolve(values);
  7246. }, reject);
  7247. });
  7248. --remaining || resolve(values);
  7249. });
  7250. if (result.error) reject(result.value);
  7251. return capability.promise;
  7252. }
  7253. });
  7254. /***/ }),
  7255. /***/ "../../node_modules/core-js/modules/es.promise.catch.js":
  7256. /*!*******************************************************************************!*\
  7257. !*** D:/web_src/4dkankan_v4/node_modules/core-js/modules/es.promise.catch.js ***!
  7258. \*******************************************************************************/
  7259. /*! no static exports found */
  7260. /***/ (function(module, exports, __webpack_require__) {
  7261. "use strict";
  7262. var $ = __webpack_require__(/*! ../internals/export */ "../../node_modules/core-js/internals/export.js");
  7263. var IS_PURE = __webpack_require__(/*! ../internals/is-pure */ "../../node_modules/core-js/internals/is-pure.js");
  7264. var FORCED_PROMISE_CONSTRUCTOR = __webpack_require__(/*! ../internals/promise-constructor-detection */ "../../node_modules/core-js/internals/promise-constructor-detection.js").CONSTRUCTOR;
  7265. var NativePromiseConstructor = __webpack_require__(/*! ../internals/promise-native-constructor */ "../../node_modules/core-js/internals/promise-native-constructor.js");
  7266. var getBuiltIn = __webpack_require__(/*! ../internals/get-built-in */ "../../node_modules/core-js/internals/get-built-in.js");
  7267. var isCallable = __webpack_require__(/*! ../internals/is-callable */ "../../node_modules/core-js/internals/is-callable.js");
  7268. var defineBuiltIn = __webpack_require__(/*! ../internals/define-built-in */ "../../node_modules/core-js/internals/define-built-in.js");
  7269. var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
  7270. // `Promise.prototype.catch` method
  7271. // https://tc39.es/ecma262/#sec-promise.prototype.catch
  7272. $({ target: 'Promise', proto: true, forced: FORCED_PROMISE_CONSTRUCTOR, real: true }, {
  7273. 'catch': function (onRejected) {
  7274. return this.then(undefined, onRejected);
  7275. }
  7276. });
  7277. // makes sure that native promise-based APIs `Promise#catch` properly works with patched `Promise#then`
  7278. if (!IS_PURE && isCallable(NativePromiseConstructor)) {
  7279. var method = getBuiltIn('Promise').prototype['catch'];
  7280. if (NativePromisePrototype['catch'] !== method) {
  7281. defineBuiltIn(NativePromisePrototype, 'catch', method, { unsafe: true });
  7282. }
  7283. }
  7284. /***/ }),
  7285. /***/ "../../node_modules/core-js/modules/es.promise.constructor.js":
  7286. /*!*************************************************************************************!*\
  7287. !*** D:/web_src/4dkankan_v4/node_modules/core-js/modules/es.promise.constructor.js ***!
  7288. \*************************************************************************************/
  7289. /*! no static exports found */
  7290. /***/ (function(module, exports, __webpack_require__) {
  7291. "use strict";
  7292. var $ = __webpack_require__(/*! ../internals/export */ "../../node_modules/core-js/internals/export.js");
  7293. var IS_PURE = __webpack_require__(/*! ../internals/is-pure */ "../../node_modules/core-js/internals/is-pure.js");
  7294. var IS_NODE = __webpack_require__(/*! ../internals/engine-is-node */ "../../node_modules/core-js/internals/engine-is-node.js");
  7295. var global = __webpack_require__(/*! ../internals/global */ "../../node_modules/core-js/internals/global.js");
  7296. var call = __webpack_require__(/*! ../internals/function-call */ "../../node_modules/core-js/internals/function-call.js");
  7297. var defineBuiltIn = __webpack_require__(/*! ../internals/define-built-in */ "../../node_modules/core-js/internals/define-built-in.js");
  7298. var setPrototypeOf = __webpack_require__(/*! ../internals/object-set-prototype-of */ "../../node_modules/core-js/internals/object-set-prototype-of.js");
  7299. var setToStringTag = __webpack_require__(/*! ../internals/set-to-string-tag */ "../../node_modules/core-js/internals/set-to-string-tag.js");
  7300. var setSpecies = __webpack_require__(/*! ../internals/set-species */ "../../node_modules/core-js/internals/set-species.js");
  7301. var aCallable = __webpack_require__(/*! ../internals/a-callable */ "../../node_modules/core-js/internals/a-callable.js");
  7302. var isCallable = __webpack_require__(/*! ../internals/is-callable */ "../../node_modules/core-js/internals/is-callable.js");
  7303. var isObject = __webpack_require__(/*! ../internals/is-object */ "../../node_modules/core-js/internals/is-object.js");
  7304. var anInstance = __webpack_require__(/*! ../internals/an-instance */ "../../node_modules/core-js/internals/an-instance.js");
  7305. var speciesConstructor = __webpack_require__(/*! ../internals/species-constructor */ "../../node_modules/core-js/internals/species-constructor.js");
  7306. var task = __webpack_require__(/*! ../internals/task */ "../../node_modules/core-js/internals/task.js").set;
  7307. var microtask = __webpack_require__(/*! ../internals/microtask */ "../../node_modules/core-js/internals/microtask.js");
  7308. var hostReportErrors = __webpack_require__(/*! ../internals/host-report-errors */ "../../node_modules/core-js/internals/host-report-errors.js");
  7309. var perform = __webpack_require__(/*! ../internals/perform */ "../../node_modules/core-js/internals/perform.js");
  7310. var Queue = __webpack_require__(/*! ../internals/queue */ "../../node_modules/core-js/internals/queue.js");
  7311. var InternalStateModule = __webpack_require__(/*! ../internals/internal-state */ "../../node_modules/core-js/internals/internal-state.js");
  7312. var NativePromiseConstructor = __webpack_require__(/*! ../internals/promise-native-constructor */ "../../node_modules/core-js/internals/promise-native-constructor.js");
  7313. var PromiseConstructorDetection = __webpack_require__(/*! ../internals/promise-constructor-detection */ "../../node_modules/core-js/internals/promise-constructor-detection.js");
  7314. var newPromiseCapabilityModule = __webpack_require__(/*! ../internals/new-promise-capability */ "../../node_modules/core-js/internals/new-promise-capability.js");
  7315. var PROMISE = 'Promise';
  7316. var FORCED_PROMISE_CONSTRUCTOR = PromiseConstructorDetection.CONSTRUCTOR;
  7317. var NATIVE_PROMISE_REJECTION_EVENT = PromiseConstructorDetection.REJECTION_EVENT;
  7318. var NATIVE_PROMISE_SUBCLASSING = PromiseConstructorDetection.SUBCLASSING;
  7319. var getInternalPromiseState = InternalStateModule.getterFor(PROMISE);
  7320. var setInternalState = InternalStateModule.set;
  7321. var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
  7322. var PromiseConstructor = NativePromiseConstructor;
  7323. var PromisePrototype = NativePromisePrototype;
  7324. var TypeError = global.TypeError;
  7325. var document = global.document;
  7326. var process = global.process;
  7327. var newPromiseCapability = newPromiseCapabilityModule.f;
  7328. var newGenericPromiseCapability = newPromiseCapability;
  7329. var DISPATCH_EVENT = !!(document && document.createEvent && global.dispatchEvent);
  7330. var UNHANDLED_REJECTION = 'unhandledrejection';
  7331. var REJECTION_HANDLED = 'rejectionhandled';
  7332. var PENDING = 0;
  7333. var FULFILLED = 1;
  7334. var REJECTED = 2;
  7335. var HANDLED = 1;
  7336. var UNHANDLED = 2;
  7337. var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;
  7338. // helpers
  7339. var isThenable = function (it) {
  7340. var then;
  7341. return isObject(it) && isCallable(then = it.then) ? then : false;
  7342. };
  7343. var callReaction = function (reaction, state) {
  7344. var value = state.value;
  7345. var ok = state.state === FULFILLED;
  7346. var handler = ok ? reaction.ok : reaction.fail;
  7347. var resolve = reaction.resolve;
  7348. var reject = reaction.reject;
  7349. var domain = reaction.domain;
  7350. var result, then, exited;
  7351. try {
  7352. if (handler) {
  7353. if (!ok) {
  7354. if (state.rejection === UNHANDLED) onHandleUnhandled(state);
  7355. state.rejection = HANDLED;
  7356. }
  7357. if (handler === true) result = value;
  7358. else {
  7359. if (domain) domain.enter();
  7360. result = handler(value); // can throw
  7361. if (domain) {
  7362. domain.exit();
  7363. exited = true;
  7364. }
  7365. }
  7366. if (result === reaction.promise) {
  7367. reject(new TypeError('Promise-chain cycle'));
  7368. } else if (then = isThenable(result)) {
  7369. call(then, result, resolve, reject);
  7370. } else resolve(result);
  7371. } else reject(value);
  7372. } catch (error) {
  7373. if (domain && !exited) domain.exit();
  7374. reject(error);
  7375. }
  7376. };
  7377. var notify = function (state, isReject) {
  7378. if (state.notified) return;
  7379. state.notified = true;
  7380. microtask(function () {
  7381. var reactions = state.reactions;
  7382. var reaction;
  7383. while (reaction = reactions.get()) {
  7384. callReaction(reaction, state);
  7385. }
  7386. state.notified = false;
  7387. if (isReject && !state.rejection) onUnhandled(state);
  7388. });
  7389. };
  7390. var dispatchEvent = function (name, promise, reason) {
  7391. var event, handler;
  7392. if (DISPATCH_EVENT) {
  7393. event = document.createEvent('Event');
  7394. event.promise = promise;
  7395. event.reason = reason;
  7396. event.initEvent(name, false, true);
  7397. global.dispatchEvent(event);
  7398. } else event = { promise: promise, reason: reason };
  7399. if (!NATIVE_PROMISE_REJECTION_EVENT && (handler = global['on' + name])) handler(event);
  7400. else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason);
  7401. };
  7402. var onUnhandled = function (state) {
  7403. call(task, global, function () {
  7404. var promise = state.facade;
  7405. var value = state.value;
  7406. var IS_UNHANDLED = isUnhandled(state);
  7407. var result;
  7408. if (IS_UNHANDLED) {
  7409. result = perform(function () {
  7410. if (IS_NODE) {
  7411. process.emit('unhandledRejection', value, promise);
  7412. } else dispatchEvent(UNHANDLED_REJECTION, promise, value);
  7413. });
  7414. // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
  7415. state.rejection = IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED;
  7416. if (result.error) throw result.value;
  7417. }
  7418. });
  7419. };
  7420. var isUnhandled = function (state) {
  7421. return state.rejection !== HANDLED && !state.parent;
  7422. };
  7423. var onHandleUnhandled = function (state) {
  7424. call(task, global, function () {
  7425. var promise = state.facade;
  7426. if (IS_NODE) {
  7427. process.emit('rejectionHandled', promise);
  7428. } else dispatchEvent(REJECTION_HANDLED, promise, state.value);
  7429. });
  7430. };
  7431. var bind = function (fn, state, unwrap) {
  7432. return function (value) {
  7433. fn(state, value, unwrap);
  7434. };
  7435. };
  7436. var internalReject = function (state, value, unwrap) {
  7437. if (state.done) return;
  7438. state.done = true;
  7439. if (unwrap) state = unwrap;
  7440. state.value = value;
  7441. state.state = REJECTED;
  7442. notify(state, true);
  7443. };
  7444. var internalResolve = function (state, value, unwrap) {
  7445. if (state.done) return;
  7446. state.done = true;
  7447. if (unwrap) state = unwrap;
  7448. try {
  7449. if (state.facade === value) throw new TypeError("Promise can't be resolved itself");
  7450. var then = isThenable(value);
  7451. if (then) {
  7452. microtask(function () {
  7453. var wrapper = { done: false };
  7454. try {
  7455. call(then, value,
  7456. bind(internalResolve, wrapper, state),
  7457. bind(internalReject, wrapper, state)
  7458. );
  7459. } catch (error) {
  7460. internalReject(wrapper, error, state);
  7461. }
  7462. });
  7463. } else {
  7464. state.value = value;
  7465. state.state = FULFILLED;
  7466. notify(state, false);
  7467. }
  7468. } catch (error) {
  7469. internalReject({ done: false }, error, state);
  7470. }
  7471. };
  7472. // constructor polyfill
  7473. if (FORCED_PROMISE_CONSTRUCTOR) {
  7474. // 25.4.3.1 Promise(executor)
  7475. PromiseConstructor = function Promise(executor) {
  7476. anInstance(this, PromisePrototype);
  7477. aCallable(executor);
  7478. call(Internal, this);
  7479. var state = getInternalPromiseState(this);
  7480. try {
  7481. executor(bind(internalResolve, state), bind(internalReject, state));
  7482. } catch (error) {
  7483. internalReject(state, error);
  7484. }
  7485. };
  7486. PromisePrototype = PromiseConstructor.prototype;
  7487. // eslint-disable-next-line no-unused-vars -- required for `.length`
  7488. Internal = function Promise(executor) {
  7489. setInternalState(this, {
  7490. type: PROMISE,
  7491. done: false,
  7492. notified: false,
  7493. parent: false,
  7494. reactions: new Queue(),
  7495. rejection: false,
  7496. state: PENDING,
  7497. value: undefined
  7498. });
  7499. };
  7500. // `Promise.prototype.then` method
  7501. // https://tc39.es/ecma262/#sec-promise.prototype.then
  7502. Internal.prototype = defineBuiltIn(PromisePrototype, 'then', function then(onFulfilled, onRejected) {
  7503. var state = getInternalPromiseState(this);
  7504. var reaction = newPromiseCapability(speciesConstructor(this, PromiseConstructor));
  7505. state.parent = true;
  7506. reaction.ok = isCallable(onFulfilled) ? onFulfilled : true;
  7507. reaction.fail = isCallable(onRejected) && onRejected;
  7508. reaction.domain = IS_NODE ? process.domain : undefined;
  7509. if (state.state === PENDING) state.reactions.add(reaction);
  7510. else microtask(function () {
  7511. callReaction(reaction, state);
  7512. });
  7513. return reaction.promise;
  7514. });
  7515. OwnPromiseCapability = function () {
  7516. var promise = new Internal();
  7517. var state = getInternalPromiseState(promise);
  7518. this.promise = promise;
  7519. this.resolve = bind(internalResolve, state);
  7520. this.reject = bind(internalReject, state);
  7521. };
  7522. newPromiseCapabilityModule.f = newPromiseCapability = function (C) {
  7523. return C === PromiseConstructor || C === PromiseWrapper
  7524. ? new OwnPromiseCapability(C)
  7525. : newGenericPromiseCapability(C);
  7526. };
  7527. if (!IS_PURE && isCallable(NativePromiseConstructor) && NativePromisePrototype !== Object.prototype) {
  7528. nativeThen = NativePromisePrototype.then;
  7529. if (!NATIVE_PROMISE_SUBCLASSING) {
  7530. // make `Promise#then` return a polyfilled `Promise` for native promise-based APIs
  7531. defineBuiltIn(NativePromisePrototype, 'then', function then(onFulfilled, onRejected) {
  7532. var that = this;
  7533. return new PromiseConstructor(function (resolve, reject) {
  7534. call(nativeThen, that, resolve, reject);
  7535. }).then(onFulfilled, onRejected);
  7536. // https://github.com/zloirock/core-js/issues/640
  7537. }, { unsafe: true });
  7538. }
  7539. // make `.constructor === Promise` work for native promise-based APIs
  7540. try {
  7541. delete NativePromisePrototype.constructor;
  7542. } catch (error) { /* empty */ }
  7543. // make `instanceof Promise` work for native promise-based APIs
  7544. if (setPrototypeOf) {
  7545. setPrototypeOf(NativePromisePrototype, PromisePrototype);
  7546. }
  7547. }
  7548. }
  7549. $({ global: true, constructor: true, wrap: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {
  7550. Promise: PromiseConstructor
  7551. });
  7552. setToStringTag(PromiseConstructor, PROMISE, false, true);
  7553. setSpecies(PROMISE);
  7554. /***/ }),
  7555. /***/ "../../node_modules/core-js/modules/es.promise.js":
  7556. /*!*************************************************************************!*\
  7557. !*** D:/web_src/4dkankan_v4/node_modules/core-js/modules/es.promise.js ***!
  7558. \*************************************************************************/
  7559. /*! no static exports found */
  7560. /***/ (function(module, exports, __webpack_require__) {
  7561. "use strict";
  7562. // TODO: Remove this module from `core-js@4` since it's split to modules listed below
  7563. __webpack_require__(/*! ../modules/es.promise.constructor */ "../../node_modules/core-js/modules/es.promise.constructor.js");
  7564. __webpack_require__(/*! ../modules/es.promise.all */ "../../node_modules/core-js/modules/es.promise.all.js");
  7565. __webpack_require__(/*! ../modules/es.promise.catch */ "../../node_modules/core-js/modules/es.promise.catch.js");
  7566. __webpack_require__(/*! ../modules/es.promise.race */ "../../node_modules/core-js/modules/es.promise.race.js");
  7567. __webpack_require__(/*! ../modules/es.promise.reject */ "../../node_modules/core-js/modules/es.promise.reject.js");
  7568. __webpack_require__(/*! ../modules/es.promise.resolve */ "../../node_modules/core-js/modules/es.promise.resolve.js");
  7569. /***/ }),
  7570. /***/ "../../node_modules/core-js/modules/es.promise.race.js":
  7571. /*!******************************************************************************!*\
  7572. !*** D:/web_src/4dkankan_v4/node_modules/core-js/modules/es.promise.race.js ***!
  7573. \******************************************************************************/
  7574. /*! no static exports found */
  7575. /***/ (function(module, exports, __webpack_require__) {
  7576. "use strict";
  7577. var $ = __webpack_require__(/*! ../internals/export */ "../../node_modules/core-js/internals/export.js");
  7578. var call = __webpack_require__(/*! ../internals/function-call */ "../../node_modules/core-js/internals/function-call.js");
  7579. var aCallable = __webpack_require__(/*! ../internals/a-callable */ "../../node_modules/core-js/internals/a-callable.js");
  7580. var newPromiseCapabilityModule = __webpack_require__(/*! ../internals/new-promise-capability */ "../../node_modules/core-js/internals/new-promise-capability.js");
  7581. var perform = __webpack_require__(/*! ../internals/perform */ "../../node_modules/core-js/internals/perform.js");
  7582. var iterate = __webpack_require__(/*! ../internals/iterate */ "../../node_modules/core-js/internals/iterate.js");
  7583. var PROMISE_STATICS_INCORRECT_ITERATION = __webpack_require__(/*! ../internals/promise-statics-incorrect-iteration */ "../../node_modules/core-js/internals/promise-statics-incorrect-iteration.js");
  7584. // `Promise.race` method
  7585. // https://tc39.es/ecma262/#sec-promise.race
  7586. $({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {
  7587. race: function race(iterable) {
  7588. var C = this;
  7589. var capability = newPromiseCapabilityModule.f(C);
  7590. var reject = capability.reject;
  7591. var result = perform(function () {
  7592. var $promiseResolve = aCallable(C.resolve);
  7593. iterate(iterable, function (promise) {
  7594. call($promiseResolve, C, promise).then(capability.resolve, reject);
  7595. });
  7596. });
  7597. if (result.error) reject(result.value);
  7598. return capability.promise;
  7599. }
  7600. });
  7601. /***/ }),
  7602. /***/ "../../node_modules/core-js/modules/es.promise.reject.js":
  7603. /*!********************************************************************************!*\
  7604. !*** D:/web_src/4dkankan_v4/node_modules/core-js/modules/es.promise.reject.js ***!
  7605. \********************************************************************************/
  7606. /*! no static exports found */
  7607. /***/ (function(module, exports, __webpack_require__) {
  7608. "use strict";
  7609. var $ = __webpack_require__(/*! ../internals/export */ "../../node_modules/core-js/internals/export.js");
  7610. var newPromiseCapabilityModule = __webpack_require__(/*! ../internals/new-promise-capability */ "../../node_modules/core-js/internals/new-promise-capability.js");
  7611. var FORCED_PROMISE_CONSTRUCTOR = __webpack_require__(/*! ../internals/promise-constructor-detection */ "../../node_modules/core-js/internals/promise-constructor-detection.js").CONSTRUCTOR;
  7612. // `Promise.reject` method
  7613. // https://tc39.es/ecma262/#sec-promise.reject
  7614. $({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {
  7615. reject: function reject(r) {
  7616. var capability = newPromiseCapabilityModule.f(this);
  7617. var capabilityReject = capability.reject;
  7618. capabilityReject(r);
  7619. return capability.promise;
  7620. }
  7621. });
  7622. /***/ }),
  7623. /***/ "../../node_modules/core-js/modules/es.promise.resolve.js":
  7624. /*!*********************************************************************************!*\
  7625. !*** D:/web_src/4dkankan_v4/node_modules/core-js/modules/es.promise.resolve.js ***!
  7626. \*********************************************************************************/
  7627. /*! no static exports found */
  7628. /***/ (function(module, exports, __webpack_require__) {
  7629. "use strict";
  7630. var $ = __webpack_require__(/*! ../internals/export */ "../../node_modules/core-js/internals/export.js");
  7631. var getBuiltIn = __webpack_require__(/*! ../internals/get-built-in */ "../../node_modules/core-js/internals/get-built-in.js");
  7632. var IS_PURE = __webpack_require__(/*! ../internals/is-pure */ "../../node_modules/core-js/internals/is-pure.js");
  7633. var NativePromiseConstructor = __webpack_require__(/*! ../internals/promise-native-constructor */ "../../node_modules/core-js/internals/promise-native-constructor.js");
  7634. var FORCED_PROMISE_CONSTRUCTOR = __webpack_require__(/*! ../internals/promise-constructor-detection */ "../../node_modules/core-js/internals/promise-constructor-detection.js").CONSTRUCTOR;
  7635. var promiseResolve = __webpack_require__(/*! ../internals/promise-resolve */ "../../node_modules/core-js/internals/promise-resolve.js");
  7636. var PromiseConstructorWrapper = getBuiltIn('Promise');
  7637. var CHECK_WRAPPER = IS_PURE && !FORCED_PROMISE_CONSTRUCTOR;
  7638. // `Promise.resolve` method
  7639. // https://tc39.es/ecma262/#sec-promise.resolve
  7640. $({ target: 'Promise', stat: true, forced: IS_PURE || FORCED_PROMISE_CONSTRUCTOR }, {
  7641. resolve: function resolve(x) {
  7642. return promiseResolve(CHECK_WRAPPER && this === PromiseConstructorWrapper ? NativePromiseConstructor : this, x);
  7643. }
  7644. });
  7645. /***/ }),
  7646. /***/ "../../node_modules/core-js/modules/es.regexp.exec.js":
  7647. /*!*****************************************************************************!*\
  7648. !*** D:/web_src/4dkankan_v4/node_modules/core-js/modules/es.regexp.exec.js ***!
  7649. \*****************************************************************************/
  7650. /*! no static exports found */
  7651. /***/ (function(module, exports, __webpack_require__) {
  7652. "use strict";
  7653. var $ = __webpack_require__(/*! ../internals/export */ "../../node_modules/core-js/internals/export.js");
  7654. var exec = __webpack_require__(/*! ../internals/regexp-exec */ "../../node_modules/core-js/internals/regexp-exec.js");
  7655. // `RegExp.prototype.exec` method
  7656. // https://tc39.es/ecma262/#sec-regexp.prototype.exec
  7657. $({ target: 'RegExp', proto: true, forced: /./.exec !== exec }, {
  7658. exec: exec
  7659. });
  7660. /***/ }),
  7661. /***/ "../../node_modules/core-js/modules/es.regexp.to-string.js":
  7662. /*!**********************************************************************************!*\
  7663. !*** D:/web_src/4dkankan_v4/node_modules/core-js/modules/es.regexp.to-string.js ***!
  7664. \**********************************************************************************/
  7665. /*! no static exports found */
  7666. /***/ (function(module, exports, __webpack_require__) {
  7667. "use strict";
  7668. var PROPER_FUNCTION_NAME = __webpack_require__(/*! ../internals/function-name */ "../../node_modules/core-js/internals/function-name.js").PROPER;
  7669. var defineBuiltIn = __webpack_require__(/*! ../internals/define-built-in */ "../../node_modules/core-js/internals/define-built-in.js");
  7670. var anObject = __webpack_require__(/*! ../internals/an-object */ "../../node_modules/core-js/internals/an-object.js");
  7671. var $toString = __webpack_require__(/*! ../internals/to-string */ "../../node_modules/core-js/internals/to-string.js");
  7672. var fails = __webpack_require__(/*! ../internals/fails */ "../../node_modules/core-js/internals/fails.js");
  7673. var getRegExpFlags = __webpack_require__(/*! ../internals/regexp-get-flags */ "../../node_modules/core-js/internals/regexp-get-flags.js");
  7674. var TO_STRING = 'toString';
  7675. var RegExpPrototype = RegExp.prototype;
  7676. var nativeToString = RegExpPrototype[TO_STRING];
  7677. var NOT_GENERIC = fails(function () { return nativeToString.call({ source: 'a', flags: 'b' }) !== '/a/b'; });
  7678. // FF44- RegExp#toString has a wrong name
  7679. var INCORRECT_NAME = PROPER_FUNCTION_NAME && nativeToString.name !== TO_STRING;
  7680. // `RegExp.prototype.toString` method
  7681. // https://tc39.es/ecma262/#sec-regexp.prototype.tostring
  7682. if (NOT_GENERIC || INCORRECT_NAME) {
  7683. defineBuiltIn(RegExpPrototype, TO_STRING, function toString() {
  7684. var R = anObject(this);
  7685. var pattern = $toString(R.source);
  7686. var flags = $toString(getRegExpFlags(R));
  7687. return '/' + pattern + '/' + flags;
  7688. }, { unsafe: true });
  7689. }
  7690. /***/ }),
  7691. /***/ "../../node_modules/core-js/modules/es.string.ends-with.js":
  7692. /*!**********************************************************************************!*\
  7693. !*** D:/web_src/4dkankan_v4/node_modules/core-js/modules/es.string.ends-with.js ***!
  7694. \**********************************************************************************/
  7695. /*! no static exports found */
  7696. /***/ (function(module, exports, __webpack_require__) {
  7697. "use strict";
  7698. var $ = __webpack_require__(/*! ../internals/export */ "../../node_modules/core-js/internals/export.js");
  7699. var uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this-clause */ "../../node_modules/core-js/internals/function-uncurry-this-clause.js");
  7700. var getOwnPropertyDescriptor = __webpack_require__(/*! ../internals/object-get-own-property-descriptor */ "../../node_modules/core-js/internals/object-get-own-property-descriptor.js").f;
  7701. var toLength = __webpack_require__(/*! ../internals/to-length */ "../../node_modules/core-js/internals/to-length.js");
  7702. var toString = __webpack_require__(/*! ../internals/to-string */ "../../node_modules/core-js/internals/to-string.js");
  7703. var notARegExp = __webpack_require__(/*! ../internals/not-a-regexp */ "../../node_modules/core-js/internals/not-a-regexp.js");
  7704. var requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ "../../node_modules/core-js/internals/require-object-coercible.js");
  7705. var correctIsRegExpLogic = __webpack_require__(/*! ../internals/correct-is-regexp-logic */ "../../node_modules/core-js/internals/correct-is-regexp-logic.js");
  7706. var IS_PURE = __webpack_require__(/*! ../internals/is-pure */ "../../node_modules/core-js/internals/is-pure.js");
  7707. var slice = uncurryThis(''.slice);
  7708. var min = Math.min;
  7709. var CORRECT_IS_REGEXP_LOGIC = correctIsRegExpLogic('endsWith');
  7710. // https://github.com/zloirock/core-js/pull/702
  7711. var MDN_POLYFILL_BUG = !IS_PURE && !CORRECT_IS_REGEXP_LOGIC && !!function () {
  7712. var descriptor = getOwnPropertyDescriptor(String.prototype, 'endsWith');
  7713. return descriptor && !descriptor.writable;
  7714. }();
  7715. // `String.prototype.endsWith` method
  7716. // https://tc39.es/ecma262/#sec-string.prototype.endswith
  7717. $({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC }, {
  7718. endsWith: function endsWith(searchString /* , endPosition = @length */) {
  7719. var that = toString(requireObjectCoercible(this));
  7720. notARegExp(searchString);
  7721. var endPosition = arguments.length > 1 ? arguments[1] : undefined;
  7722. var len = that.length;
  7723. var end = endPosition === undefined ? len : min(toLength(endPosition), len);
  7724. var search = toString(searchString);
  7725. return slice(that, end - search.length, end) === search;
  7726. }
  7727. });
  7728. /***/ }),
  7729. /***/ "../../node_modules/core-js/modules/es.string.includes.js":
  7730. /*!*********************************************************************************!*\
  7731. !*** D:/web_src/4dkankan_v4/node_modules/core-js/modules/es.string.includes.js ***!
  7732. \*********************************************************************************/
  7733. /*! no static exports found */
  7734. /***/ (function(module, exports, __webpack_require__) {
  7735. "use strict";
  7736. var $ = __webpack_require__(/*! ../internals/export */ "../../node_modules/core-js/internals/export.js");
  7737. var uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this */ "../../node_modules/core-js/internals/function-uncurry-this.js");
  7738. var notARegExp = __webpack_require__(/*! ../internals/not-a-regexp */ "../../node_modules/core-js/internals/not-a-regexp.js");
  7739. var requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ "../../node_modules/core-js/internals/require-object-coercible.js");
  7740. var toString = __webpack_require__(/*! ../internals/to-string */ "../../node_modules/core-js/internals/to-string.js");
  7741. var correctIsRegExpLogic = __webpack_require__(/*! ../internals/correct-is-regexp-logic */ "../../node_modules/core-js/internals/correct-is-regexp-logic.js");
  7742. var stringIndexOf = uncurryThis(''.indexOf);
  7743. // `String.prototype.includes` method
  7744. // https://tc39.es/ecma262/#sec-string.prototype.includes
  7745. $({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }, {
  7746. includes: function includes(searchString /* , position = 0 */) {
  7747. return !!~stringIndexOf(
  7748. toString(requireObjectCoercible(this)),
  7749. toString(notARegExp(searchString)),
  7750. arguments.length > 1 ? arguments[1] : undefined
  7751. );
  7752. }
  7753. });
  7754. /***/ }),
  7755. /***/ "../../node_modules/core-js/modules/es.string.match.js":
  7756. /*!******************************************************************************!*\
  7757. !*** D:/web_src/4dkankan_v4/node_modules/core-js/modules/es.string.match.js ***!
  7758. \******************************************************************************/
  7759. /*! no static exports found */
  7760. /***/ (function(module, exports, __webpack_require__) {
  7761. "use strict";
  7762. var call = __webpack_require__(/*! ../internals/function-call */ "../../node_modules/core-js/internals/function-call.js");
  7763. var fixRegExpWellKnownSymbolLogic = __webpack_require__(/*! ../internals/fix-regexp-well-known-symbol-logic */ "../../node_modules/core-js/internals/fix-regexp-well-known-symbol-logic.js");
  7764. var anObject = __webpack_require__(/*! ../internals/an-object */ "../../node_modules/core-js/internals/an-object.js");
  7765. var isNullOrUndefined = __webpack_require__(/*! ../internals/is-null-or-undefined */ "../../node_modules/core-js/internals/is-null-or-undefined.js");
  7766. var toLength = __webpack_require__(/*! ../internals/to-length */ "../../node_modules/core-js/internals/to-length.js");
  7767. var toString = __webpack_require__(/*! ../internals/to-string */ "../../node_modules/core-js/internals/to-string.js");
  7768. var requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ "../../node_modules/core-js/internals/require-object-coercible.js");
  7769. var getMethod = __webpack_require__(/*! ../internals/get-method */ "../../node_modules/core-js/internals/get-method.js");
  7770. var advanceStringIndex = __webpack_require__(/*! ../internals/advance-string-index */ "../../node_modules/core-js/internals/advance-string-index.js");
  7771. var regExpExec = __webpack_require__(/*! ../internals/regexp-exec-abstract */ "../../node_modules/core-js/internals/regexp-exec-abstract.js");
  7772. // @@match logic
  7773. fixRegExpWellKnownSymbolLogic('match', function (MATCH, nativeMatch, maybeCallNative) {
  7774. return [
  7775. // `String.prototype.match` method
  7776. // https://tc39.es/ecma262/#sec-string.prototype.match
  7777. function match(regexp) {
  7778. var O = requireObjectCoercible(this);
  7779. var matcher = isNullOrUndefined(regexp) ? undefined : getMethod(regexp, MATCH);
  7780. return matcher ? call(matcher, regexp, O) : new RegExp(regexp)[MATCH](toString(O));
  7781. },
  7782. // `RegExp.prototype[@@match]` method
  7783. // https://tc39.es/ecma262/#sec-regexp.prototype-@@match
  7784. function (string) {
  7785. var rx = anObject(this);
  7786. var S = toString(string);
  7787. var res = maybeCallNative(nativeMatch, rx, S);
  7788. if (res.done) return res.value;
  7789. if (!rx.global) return regExpExec(rx, S);
  7790. var fullUnicode = rx.unicode;
  7791. rx.lastIndex = 0;
  7792. var A = [];
  7793. var n = 0;
  7794. var result;
  7795. while ((result = regExpExec(rx, S)) !== null) {
  7796. var matchStr = toString(result[0]);
  7797. A[n] = matchStr;
  7798. if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
  7799. n++;
  7800. }
  7801. return n === 0 ? null : A;
  7802. }
  7803. ];
  7804. });
  7805. /***/ }),
  7806. /***/ "../../node_modules/core-js/modules/es.string.replace.js":
  7807. /*!********************************************************************************!*\
  7808. !*** D:/web_src/4dkankan_v4/node_modules/core-js/modules/es.string.replace.js ***!
  7809. \********************************************************************************/
  7810. /*! no static exports found */
  7811. /***/ (function(module, exports, __webpack_require__) {
  7812. "use strict";
  7813. var apply = __webpack_require__(/*! ../internals/function-apply */ "../../node_modules/core-js/internals/function-apply.js");
  7814. var call = __webpack_require__(/*! ../internals/function-call */ "../../node_modules/core-js/internals/function-call.js");
  7815. var uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this */ "../../node_modules/core-js/internals/function-uncurry-this.js");
  7816. var fixRegExpWellKnownSymbolLogic = __webpack_require__(/*! ../internals/fix-regexp-well-known-symbol-logic */ "../../node_modules/core-js/internals/fix-regexp-well-known-symbol-logic.js");
  7817. var fails = __webpack_require__(/*! ../internals/fails */ "../../node_modules/core-js/internals/fails.js");
  7818. var anObject = __webpack_require__(/*! ../internals/an-object */ "../../node_modules/core-js/internals/an-object.js");
  7819. var isCallable = __webpack_require__(/*! ../internals/is-callable */ "../../node_modules/core-js/internals/is-callable.js");
  7820. var isNullOrUndefined = __webpack_require__(/*! ../internals/is-null-or-undefined */ "../../node_modules/core-js/internals/is-null-or-undefined.js");
  7821. var toIntegerOrInfinity = __webpack_require__(/*! ../internals/to-integer-or-infinity */ "../../node_modules/core-js/internals/to-integer-or-infinity.js");
  7822. var toLength = __webpack_require__(/*! ../internals/to-length */ "../../node_modules/core-js/internals/to-length.js");
  7823. var toString = __webpack_require__(/*! ../internals/to-string */ "../../node_modules/core-js/internals/to-string.js");
  7824. var requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ "../../node_modules/core-js/internals/require-object-coercible.js");
  7825. var advanceStringIndex = __webpack_require__(/*! ../internals/advance-string-index */ "../../node_modules/core-js/internals/advance-string-index.js");
  7826. var getMethod = __webpack_require__(/*! ../internals/get-method */ "../../node_modules/core-js/internals/get-method.js");
  7827. var getSubstitution = __webpack_require__(/*! ../internals/get-substitution */ "../../node_modules/core-js/internals/get-substitution.js");
  7828. var regExpExec = __webpack_require__(/*! ../internals/regexp-exec-abstract */ "../../node_modules/core-js/internals/regexp-exec-abstract.js");
  7829. var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "../../node_modules/core-js/internals/well-known-symbol.js");
  7830. var REPLACE = wellKnownSymbol('replace');
  7831. var max = Math.max;
  7832. var min = Math.min;
  7833. var concat = uncurryThis([].concat);
  7834. var push = uncurryThis([].push);
  7835. var stringIndexOf = uncurryThis(''.indexOf);
  7836. var stringSlice = uncurryThis(''.slice);
  7837. var maybeToString = function (it) {
  7838. return it === undefined ? it : String(it);
  7839. };
  7840. // IE <= 11 replaces $0 with the whole match, as if it was $&
  7841. // https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0
  7842. var REPLACE_KEEPS_$0 = (function () {
  7843. // eslint-disable-next-line regexp/prefer-escape-replacement-dollar-char -- required for testing
  7844. return 'a'.replace(/./, '$0') === '$0';
  7845. })();
  7846. // Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string
  7847. var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () {
  7848. if (/./[REPLACE]) {
  7849. return /./[REPLACE]('a', '$0') === '';
  7850. }
  7851. return false;
  7852. })();
  7853. var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
  7854. var re = /./;
  7855. re.exec = function () {
  7856. var result = [];
  7857. result.groups = { a: '7' };
  7858. return result;
  7859. };
  7860. // eslint-disable-next-line regexp/no-useless-dollar-replacements -- false positive
  7861. return ''.replace(re, '$<a>') !== '7';
  7862. });
  7863. // @@replace logic
  7864. fixRegExpWellKnownSymbolLogic('replace', function (_, nativeReplace, maybeCallNative) {
  7865. var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0';
  7866. return [
  7867. // `String.prototype.replace` method
  7868. // https://tc39.es/ecma262/#sec-string.prototype.replace
  7869. function replace(searchValue, replaceValue) {
  7870. var O = requireObjectCoercible(this);
  7871. var replacer = isNullOrUndefined(searchValue) ? undefined : getMethod(searchValue, REPLACE);
  7872. return replacer
  7873. ? call(replacer, searchValue, O, replaceValue)
  7874. : call(nativeReplace, toString(O), searchValue, replaceValue);
  7875. },
  7876. // `RegExp.prototype[@@replace]` method
  7877. // https://tc39.es/ecma262/#sec-regexp.prototype-@@replace
  7878. function (string, replaceValue) {
  7879. var rx = anObject(this);
  7880. var S = toString(string);
  7881. if (
  7882. typeof replaceValue == 'string' &&
  7883. stringIndexOf(replaceValue, UNSAFE_SUBSTITUTE) === -1 &&
  7884. stringIndexOf(replaceValue, '$<') === -1
  7885. ) {
  7886. var res = maybeCallNative(nativeReplace, rx, S, replaceValue);
  7887. if (res.done) return res.value;
  7888. }
  7889. var functionalReplace = isCallable(replaceValue);
  7890. if (!functionalReplace) replaceValue = toString(replaceValue);
  7891. var global = rx.global;
  7892. var fullUnicode;
  7893. if (global) {
  7894. fullUnicode = rx.unicode;
  7895. rx.lastIndex = 0;
  7896. }
  7897. var results = [];
  7898. var result;
  7899. while (true) {
  7900. result = regExpExec(rx, S);
  7901. if (result === null) break;
  7902. push(results, result);
  7903. if (!global) break;
  7904. var matchStr = toString(result[0]);
  7905. if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
  7906. }
  7907. var accumulatedResult = '';
  7908. var nextSourcePosition = 0;
  7909. for (var i = 0; i < results.length; i++) {
  7910. result = results[i];
  7911. var matched = toString(result[0]);
  7912. var position = max(min(toIntegerOrInfinity(result.index), S.length), 0);
  7913. var captures = [];
  7914. var replacement;
  7915. // NOTE: This is equivalent to
  7916. // captures = result.slice(1).map(maybeToString)
  7917. // but for some reason `nativeSlice.call(result, 1, result.length)` (called in
  7918. // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
  7919. // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
  7920. for (var j = 1; j < result.length; j++) push(captures, maybeToString(result[j]));
  7921. var namedCaptures = result.groups;
  7922. if (functionalReplace) {
  7923. var replacerArgs = concat([matched], captures, position, S);
  7924. if (namedCaptures !== undefined) push(replacerArgs, namedCaptures);
  7925. replacement = toString(apply(replaceValue, undefined, replacerArgs));
  7926. } else {
  7927. replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
  7928. }
  7929. if (position >= nextSourcePosition) {
  7930. accumulatedResult += stringSlice(S, nextSourcePosition, position) + replacement;
  7931. nextSourcePosition = position + matched.length;
  7932. }
  7933. }
  7934. return accumulatedResult + stringSlice(S, nextSourcePosition);
  7935. }
  7936. ];
  7937. }, !REPLACE_SUPPORTS_NAMED_GROUPS || !REPLACE_KEEPS_$0 || REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE);
  7938. /***/ }),
  7939. /***/ "../../node_modules/core-js/modules/es.string.split.js":
  7940. /*!******************************************************************************!*\
  7941. !*** D:/web_src/4dkankan_v4/node_modules/core-js/modules/es.string.split.js ***!
  7942. \******************************************************************************/
  7943. /*! no static exports found */
  7944. /***/ (function(module, exports, __webpack_require__) {
  7945. "use strict";
  7946. var call = __webpack_require__(/*! ../internals/function-call */ "../../node_modules/core-js/internals/function-call.js");
  7947. var uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this */ "../../node_modules/core-js/internals/function-uncurry-this.js");
  7948. var fixRegExpWellKnownSymbolLogic = __webpack_require__(/*! ../internals/fix-regexp-well-known-symbol-logic */ "../../node_modules/core-js/internals/fix-regexp-well-known-symbol-logic.js");
  7949. var anObject = __webpack_require__(/*! ../internals/an-object */ "../../node_modules/core-js/internals/an-object.js");
  7950. var isNullOrUndefined = __webpack_require__(/*! ../internals/is-null-or-undefined */ "../../node_modules/core-js/internals/is-null-or-undefined.js");
  7951. var requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ "../../node_modules/core-js/internals/require-object-coercible.js");
  7952. var speciesConstructor = __webpack_require__(/*! ../internals/species-constructor */ "../../node_modules/core-js/internals/species-constructor.js");
  7953. var advanceStringIndex = __webpack_require__(/*! ../internals/advance-string-index */ "../../node_modules/core-js/internals/advance-string-index.js");
  7954. var toLength = __webpack_require__(/*! ../internals/to-length */ "../../node_modules/core-js/internals/to-length.js");
  7955. var toString = __webpack_require__(/*! ../internals/to-string */ "../../node_modules/core-js/internals/to-string.js");
  7956. var getMethod = __webpack_require__(/*! ../internals/get-method */ "../../node_modules/core-js/internals/get-method.js");
  7957. var regExpExec = __webpack_require__(/*! ../internals/regexp-exec-abstract */ "../../node_modules/core-js/internals/regexp-exec-abstract.js");
  7958. var stickyHelpers = __webpack_require__(/*! ../internals/regexp-sticky-helpers */ "../../node_modules/core-js/internals/regexp-sticky-helpers.js");
  7959. var fails = __webpack_require__(/*! ../internals/fails */ "../../node_modules/core-js/internals/fails.js");
  7960. var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y;
  7961. var MAX_UINT32 = 0xFFFFFFFF;
  7962. var min = Math.min;
  7963. var push = uncurryThis([].push);
  7964. var stringSlice = uncurryThis(''.slice);
  7965. // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
  7966. // Weex JS has frozen built-in prototypes, so use try / catch wrapper
  7967. var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {
  7968. // eslint-disable-next-line regexp/no-empty-group -- required for testing
  7969. var re = /(?:)/;
  7970. var originalExec = re.exec;
  7971. re.exec = function () { return originalExec.apply(this, arguments); };
  7972. var result = 'ab'.split(re);
  7973. return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';
  7974. });
  7975. var BUGGY = 'abbc'.split(/(b)*/)[1] === 'c' ||
  7976. // eslint-disable-next-line regexp/no-empty-group -- required for testing
  7977. 'test'.split(/(?:)/, -1).length !== 4 ||
  7978. 'ab'.split(/(?:ab)*/).length !== 2 ||
  7979. '.'.split(/(.?)(.?)/).length !== 4 ||
  7980. // eslint-disable-next-line regexp/no-empty-capturing-group, regexp/no-empty-group -- required for testing
  7981. '.'.split(/()()/).length > 1 ||
  7982. ''.split(/.?/).length;
  7983. // @@split logic
  7984. fixRegExpWellKnownSymbolLogic('split', function (SPLIT, nativeSplit, maybeCallNative) {
  7985. var internalSplit = '0'.split(undefined, 0).length ? function (separator, limit) {
  7986. return separator === undefined && limit === 0 ? [] : call(nativeSplit, this, separator, limit);
  7987. } : nativeSplit;
  7988. return [
  7989. // `String.prototype.split` method
  7990. // https://tc39.es/ecma262/#sec-string.prototype.split
  7991. function split(separator, limit) {
  7992. var O = requireObjectCoercible(this);
  7993. var splitter = isNullOrUndefined(separator) ? undefined : getMethod(separator, SPLIT);
  7994. return splitter
  7995. ? call(splitter, separator, O, limit)
  7996. : call(internalSplit, toString(O), separator, limit);
  7997. },
  7998. // `RegExp.prototype[@@split]` method
  7999. // https://tc39.es/ecma262/#sec-regexp.prototype-@@split
  8000. //
  8001. // NOTE: This cannot be properly polyfilled in engines that don't support
  8002. // the 'y' flag.
  8003. function (string, limit) {
  8004. var rx = anObject(this);
  8005. var S = toString(string);
  8006. if (!BUGGY) {
  8007. var res = maybeCallNative(internalSplit, rx, S, limit, internalSplit !== nativeSplit);
  8008. if (res.done) return res.value;
  8009. }
  8010. var C = speciesConstructor(rx, RegExp);
  8011. var unicodeMatching = rx.unicode;
  8012. var flags = (rx.ignoreCase ? 'i' : '') +
  8013. (rx.multiline ? 'm' : '') +
  8014. (rx.unicode ? 'u' : '') +
  8015. (UNSUPPORTED_Y ? 'g' : 'y');
  8016. // ^(? + rx + ) is needed, in combination with some S slicing, to
  8017. // simulate the 'y' flag.
  8018. var splitter = new C(UNSUPPORTED_Y ? '^(?:' + rx.source + ')' : rx, flags);
  8019. var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
  8020. if (lim === 0) return [];
  8021. if (S.length === 0) return regExpExec(splitter, S) === null ? [S] : [];
  8022. var p = 0;
  8023. var q = 0;
  8024. var A = [];
  8025. while (q < S.length) {
  8026. splitter.lastIndex = UNSUPPORTED_Y ? 0 : q;
  8027. var z = regExpExec(splitter, UNSUPPORTED_Y ? stringSlice(S, q) : S);
  8028. var e;
  8029. if (
  8030. z === null ||
  8031. (e = min(toLength(splitter.lastIndex + (UNSUPPORTED_Y ? q : 0)), S.length)) === p
  8032. ) {
  8033. q = advanceStringIndex(S, q, unicodeMatching);
  8034. } else {
  8035. push(A, stringSlice(S, p, q));
  8036. if (A.length === lim) return A;
  8037. for (var i = 1; i <= z.length - 1; i++) {
  8038. push(A, z[i]);
  8039. if (A.length === lim) return A;
  8040. }
  8041. q = p = e;
  8042. }
  8043. }
  8044. push(A, stringSlice(S, p));
  8045. return A;
  8046. }
  8047. ];
  8048. }, BUGGY || !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC, UNSUPPORTED_Y);
  8049. /***/ }),
  8050. /***/ "../../node_modules/core-js/modules/es.string.starts-with.js":
  8051. /*!************************************************************************************!*\
  8052. !*** D:/web_src/4dkankan_v4/node_modules/core-js/modules/es.string.starts-with.js ***!
  8053. \************************************************************************************/
  8054. /*! no static exports found */
  8055. /***/ (function(module, exports, __webpack_require__) {
  8056. "use strict";
  8057. var $ = __webpack_require__(/*! ../internals/export */ "../../node_modules/core-js/internals/export.js");
  8058. var uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this-clause */ "../../node_modules/core-js/internals/function-uncurry-this-clause.js");
  8059. var getOwnPropertyDescriptor = __webpack_require__(/*! ../internals/object-get-own-property-descriptor */ "../../node_modules/core-js/internals/object-get-own-property-descriptor.js").f;
  8060. var toLength = __webpack_require__(/*! ../internals/to-length */ "../../node_modules/core-js/internals/to-length.js");
  8061. var toString = __webpack_require__(/*! ../internals/to-string */ "../../node_modules/core-js/internals/to-string.js");
  8062. var notARegExp = __webpack_require__(/*! ../internals/not-a-regexp */ "../../node_modules/core-js/internals/not-a-regexp.js");
  8063. var requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ "../../node_modules/core-js/internals/require-object-coercible.js");
  8064. var correctIsRegExpLogic = __webpack_require__(/*! ../internals/correct-is-regexp-logic */ "../../node_modules/core-js/internals/correct-is-regexp-logic.js");
  8065. var IS_PURE = __webpack_require__(/*! ../internals/is-pure */ "../../node_modules/core-js/internals/is-pure.js");
  8066. var stringSlice = uncurryThis(''.slice);
  8067. var min = Math.min;
  8068. var CORRECT_IS_REGEXP_LOGIC = correctIsRegExpLogic('startsWith');
  8069. // https://github.com/zloirock/core-js/pull/702
  8070. var MDN_POLYFILL_BUG = !IS_PURE && !CORRECT_IS_REGEXP_LOGIC && !!function () {
  8071. var descriptor = getOwnPropertyDescriptor(String.prototype, 'startsWith');
  8072. return descriptor && !descriptor.writable;
  8073. }();
  8074. // `String.prototype.startsWith` method
  8075. // https://tc39.es/ecma262/#sec-string.prototype.startswith
  8076. $({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC }, {
  8077. startsWith: function startsWith(searchString /* , position = 0 */) {
  8078. var that = toString(requireObjectCoercible(this));
  8079. notARegExp(searchString);
  8080. var index = toLength(min(arguments.length > 1 ? arguments[1] : undefined, that.length));
  8081. var search = toString(searchString);
  8082. return stringSlice(that, index, index + search.length) === search;
  8083. }
  8084. });
  8085. /***/ }),
  8086. /***/ "../../node_modules/core-js/modules/es.string.trim.js":
  8087. /*!*****************************************************************************!*\
  8088. !*** D:/web_src/4dkankan_v4/node_modules/core-js/modules/es.string.trim.js ***!
  8089. \*****************************************************************************/
  8090. /*! no static exports found */
  8091. /***/ (function(module, exports, __webpack_require__) {
  8092. "use strict";
  8093. var $ = __webpack_require__(/*! ../internals/export */ "../../node_modules/core-js/internals/export.js");
  8094. var $trim = __webpack_require__(/*! ../internals/string-trim */ "../../node_modules/core-js/internals/string-trim.js").trim;
  8095. var forcedStringTrimMethod = __webpack_require__(/*! ../internals/string-trim-forced */ "../../node_modules/core-js/internals/string-trim-forced.js");
  8096. // `String.prototype.trim` method
  8097. // https://tc39.es/ecma262/#sec-string.prototype.trim
  8098. $({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {
  8099. trim: function trim() {
  8100. return $trim(this);
  8101. }
  8102. });
  8103. /***/ }),
  8104. /***/ "../../node_modules/core-js/modules/web.dom-collections.iterator.js":
  8105. /*!*******************************************************************************************!*\
  8106. !*** D:/web_src/4dkankan_v4/node_modules/core-js/modules/web.dom-collections.iterator.js ***!
  8107. \*******************************************************************************************/
  8108. /*! no static exports found */
  8109. /***/ (function(module, exports, __webpack_require__) {
  8110. "use strict";
  8111. var global = __webpack_require__(/*! ../internals/global */ "../../node_modules/core-js/internals/global.js");
  8112. var DOMIterables = __webpack_require__(/*! ../internals/dom-iterables */ "../../node_modules/core-js/internals/dom-iterables.js");
  8113. var DOMTokenListPrototype = __webpack_require__(/*! ../internals/dom-token-list-prototype */ "../../node_modules/core-js/internals/dom-token-list-prototype.js");
  8114. var ArrayIteratorMethods = __webpack_require__(/*! ../modules/es.array.iterator */ "../../node_modules/core-js/modules/es.array.iterator.js");
  8115. var createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ "../../node_modules/core-js/internals/create-non-enumerable-property.js");
  8116. var setToStringTag = __webpack_require__(/*! ../internals/set-to-string-tag */ "../../node_modules/core-js/internals/set-to-string-tag.js");
  8117. var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "../../node_modules/core-js/internals/well-known-symbol.js");
  8118. var ITERATOR = wellKnownSymbol('iterator');
  8119. var ArrayValues = ArrayIteratorMethods.values;
  8120. var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
  8121. if (CollectionPrototype) {
  8122. // some Chrome versions have non-configurable methods on DOMTokenList
  8123. if (CollectionPrototype[ITERATOR] !== ArrayValues) try {
  8124. createNonEnumerableProperty(CollectionPrototype, ITERATOR, ArrayValues);
  8125. } catch (error) {
  8126. CollectionPrototype[ITERATOR] = ArrayValues;
  8127. }
  8128. setToStringTag(CollectionPrototype, COLLECTION_NAME, true);
  8129. if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) {
  8130. // some Chrome versions have non-configurable methods on DOMTokenList
  8131. if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) try {
  8132. createNonEnumerableProperty(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]);
  8133. } catch (error) {
  8134. CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME];
  8135. }
  8136. }
  8137. }
  8138. };
  8139. for (var COLLECTION_NAME in DOMIterables) {
  8140. handlePrototype(global[COLLECTION_NAME] && global[COLLECTION_NAME].prototype, COLLECTION_NAME);
  8141. }
  8142. handlePrototype(DOMTokenListPrototype, 'DOMTokenList');
  8143. /***/ }),
  8144. /***/ "../../node_modules/performance-now/lib/performance-now.js":
  8145. /*!**********************************************************************************!*\
  8146. !*** D:/web_src/4dkankan_v4/node_modules/performance-now/lib/performance-now.js ***!
  8147. \**********************************************************************************/
  8148. /*! no static exports found */
  8149. /***/ (function(module, exports, __webpack_require__) {
  8150. /* WEBPACK VAR INJECTION */(function(process) {// Generated by CoffeeScript 1.12.2
  8151. (function() {
  8152. var getNanoSeconds, hrtime, loadTime, moduleLoadTime, nodeLoadTime, upTime;
  8153. if ((typeof performance !== "undefined" && performance !== null) && performance.now) {
  8154. module.exports = function() {
  8155. return performance.now();
  8156. };
  8157. } else if ((typeof process !== "undefined" && process !== null) && process.hrtime) {
  8158. module.exports = function() {
  8159. return (getNanoSeconds() - nodeLoadTime) / 1e6;
  8160. };
  8161. hrtime = process.hrtime;
  8162. getNanoSeconds = function() {
  8163. var hr;
  8164. hr = hrtime();
  8165. return hr[0] * 1e9 + hr[1];
  8166. };
  8167. moduleLoadTime = getNanoSeconds();
  8168. upTime = process.uptime() * 1e9;
  8169. nodeLoadTime = moduleLoadTime - upTime;
  8170. } else if (Date.now) {
  8171. module.exports = function() {
  8172. return Date.now() - loadTime;
  8173. };
  8174. loadTime = Date.now();
  8175. } else {
  8176. module.exports = function() {
  8177. return new Date().getTime() - loadTime;
  8178. };
  8179. loadTime = new Date().getTime();
  8180. }
  8181. }).call(this);
  8182. //# sourceMappingURL=performance-now.js.map
  8183. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/mock/process.js */ "../../node_modules/node-libs-browser/mock/process.js")))
  8184. /***/ }),
  8185. /***/ "../../node_modules/raf/index.js":
  8186. /*!********************************************************!*\
  8187. !*** D:/web_src/4dkankan_v4/node_modules/raf/index.js ***!
  8188. \********************************************************/
  8189. /*! no static exports found */
  8190. /***/ (function(module, exports, __webpack_require__) {
  8191. /* WEBPACK VAR INJECTION */(function(global) {var now = __webpack_require__(/*! performance-now */ "../../node_modules/performance-now/lib/performance-now.js")
  8192. , root = typeof window === 'undefined' ? global : window
  8193. , vendors = ['moz', 'webkit']
  8194. , suffix = 'AnimationFrame'
  8195. , raf = root['request' + suffix]
  8196. , caf = root['cancel' + suffix] || root['cancelRequest' + suffix]
  8197. for(var i = 0; !raf && i < vendors.length; i++) {
  8198. raf = root[vendors[i] + 'Request' + suffix]
  8199. caf = root[vendors[i] + 'Cancel' + suffix]
  8200. || root[vendors[i] + 'CancelRequest' + suffix]
  8201. }
  8202. // Some versions of FF have rAF but not cAF
  8203. if(!raf || !caf) {
  8204. var last = 0
  8205. , id = 0
  8206. , queue = []
  8207. , frameDuration = 1000 / 60
  8208. raf = function(callback) {
  8209. if(queue.length === 0) {
  8210. var _now = now()
  8211. , next = Math.max(0, frameDuration - (_now - last))
  8212. last = next + _now
  8213. setTimeout(function() {
  8214. var cp = queue.slice(0)
  8215. // Clear queue here to prevent
  8216. // callbacks from appending listeners
  8217. // to the current frame's queue
  8218. queue.length = 0
  8219. for(var i = 0; i < cp.length; i++) {
  8220. if(!cp[i].cancelled) {
  8221. try{
  8222. cp[i].callback(last)
  8223. } catch(e) {
  8224. setTimeout(function() { throw e }, 0)
  8225. }
  8226. }
  8227. }
  8228. }, Math.round(next))
  8229. }
  8230. queue.push({
  8231. handle: ++id,
  8232. callback: callback,
  8233. cancelled: false
  8234. })
  8235. return id
  8236. }
  8237. caf = function(handle) {
  8238. for(var i = 0; i < queue.length; i++) {
  8239. if(queue[i].handle === handle) {
  8240. queue[i].cancelled = true
  8241. }
  8242. }
  8243. }
  8244. }
  8245. module.exports = function(fn) {
  8246. // Wrap in a new function to prevent
  8247. // `cancel` potentially being assigned
  8248. // to the native rAF function
  8249. return raf.call(root, fn)
  8250. }
  8251. module.exports.cancel = function() {
  8252. caf.apply(root, arguments)
  8253. }
  8254. module.exports.polyfill = function(object) {
  8255. if (!object) {
  8256. object = root;
  8257. }
  8258. object.requestAnimationFrame = raf
  8259. object.cancelAnimationFrame = caf
  8260. }
  8261. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "../../node_modules/webpack/buildin/global.js")))
  8262. /***/ }),
  8263. /***/ "../../node_modules/rgbcolor/index.js":
  8264. /*!*************************************************************!*\
  8265. !*** D:/web_src/4dkankan_v4/node_modules/rgbcolor/index.js ***!
  8266. \*************************************************************/
  8267. /*! no static exports found */
  8268. /***/ (function(module, exports) {
  8269. /*
  8270. Based on rgbcolor.js by Stoyan Stefanov <sstoo@gmail.com>
  8271. http://www.phpied.com/rgb-color-parser-in-javascript/
  8272. */
  8273. module.exports = function(color_string) {
  8274. this.ok = false;
  8275. this.alpha = 1.0;
  8276. // strip any leading #
  8277. if (color_string.charAt(0) == '#') { // remove # if any
  8278. color_string = color_string.substr(1,6);
  8279. }
  8280. color_string = color_string.replace(/ /g,'');
  8281. color_string = color_string.toLowerCase();
  8282. // before getting into regexps, try simple matches
  8283. // and overwrite the input
  8284. var simple_colors = {
  8285. aliceblue: 'f0f8ff',
  8286. antiquewhite: 'faebd7',
  8287. aqua: '00ffff',
  8288. aquamarine: '7fffd4',
  8289. azure: 'f0ffff',
  8290. beige: 'f5f5dc',
  8291. bisque: 'ffe4c4',
  8292. black: '000000',
  8293. blanchedalmond: 'ffebcd',
  8294. blue: '0000ff',
  8295. blueviolet: '8a2be2',
  8296. brown: 'a52a2a',
  8297. burlywood: 'deb887',
  8298. cadetblue: '5f9ea0',
  8299. chartreuse: '7fff00',
  8300. chocolate: 'd2691e',
  8301. coral: 'ff7f50',
  8302. cornflowerblue: '6495ed',
  8303. cornsilk: 'fff8dc',
  8304. crimson: 'dc143c',
  8305. cyan: '00ffff',
  8306. darkblue: '00008b',
  8307. darkcyan: '008b8b',
  8308. darkgoldenrod: 'b8860b',
  8309. darkgray: 'a9a9a9',
  8310. darkgreen: '006400',
  8311. darkkhaki: 'bdb76b',
  8312. darkmagenta: '8b008b',
  8313. darkolivegreen: '556b2f',
  8314. darkorange: 'ff8c00',
  8315. darkorchid: '9932cc',
  8316. darkred: '8b0000',
  8317. darksalmon: 'e9967a',
  8318. darkseagreen: '8fbc8f',
  8319. darkslateblue: '483d8b',
  8320. darkslategray: '2f4f4f',
  8321. darkturquoise: '00ced1',
  8322. darkviolet: '9400d3',
  8323. deeppink: 'ff1493',
  8324. deepskyblue: '00bfff',
  8325. dimgray: '696969',
  8326. dodgerblue: '1e90ff',
  8327. feldspar: 'd19275',
  8328. firebrick: 'b22222',
  8329. floralwhite: 'fffaf0',
  8330. forestgreen: '228b22',
  8331. fuchsia: 'ff00ff',
  8332. gainsboro: 'dcdcdc',
  8333. ghostwhite: 'f8f8ff',
  8334. gold: 'ffd700',
  8335. goldenrod: 'daa520',
  8336. gray: '808080',
  8337. green: '008000',
  8338. greenyellow: 'adff2f',
  8339. honeydew: 'f0fff0',
  8340. hotpink: 'ff69b4',
  8341. indianred : 'cd5c5c',
  8342. indigo : '4b0082',
  8343. ivory: 'fffff0',
  8344. khaki: 'f0e68c',
  8345. lavender: 'e6e6fa',
  8346. lavenderblush: 'fff0f5',
  8347. lawngreen: '7cfc00',
  8348. lemonchiffon: 'fffacd',
  8349. lightblue: 'add8e6',
  8350. lightcoral: 'f08080',
  8351. lightcyan: 'e0ffff',
  8352. lightgoldenrodyellow: 'fafad2',
  8353. lightgrey: 'd3d3d3',
  8354. lightgreen: '90ee90',
  8355. lightpink: 'ffb6c1',
  8356. lightsalmon: 'ffa07a',
  8357. lightseagreen: '20b2aa',
  8358. lightskyblue: '87cefa',
  8359. lightslateblue: '8470ff',
  8360. lightslategray: '778899',
  8361. lightsteelblue: 'b0c4de',
  8362. lightyellow: 'ffffe0',
  8363. lime: '00ff00',
  8364. limegreen: '32cd32',
  8365. linen: 'faf0e6',
  8366. magenta: 'ff00ff',
  8367. maroon: '800000',
  8368. mediumaquamarine: '66cdaa',
  8369. mediumblue: '0000cd',
  8370. mediumorchid: 'ba55d3',
  8371. mediumpurple: '9370d8',
  8372. mediumseagreen: '3cb371',
  8373. mediumslateblue: '7b68ee',
  8374. mediumspringgreen: '00fa9a',
  8375. mediumturquoise: '48d1cc',
  8376. mediumvioletred: 'c71585',
  8377. midnightblue: '191970',
  8378. mintcream: 'f5fffa',
  8379. mistyrose: 'ffe4e1',
  8380. moccasin: 'ffe4b5',
  8381. navajowhite: 'ffdead',
  8382. navy: '000080',
  8383. oldlace: 'fdf5e6',
  8384. olive: '808000',
  8385. olivedrab: '6b8e23',
  8386. orange: 'ffa500',
  8387. orangered: 'ff4500',
  8388. orchid: 'da70d6',
  8389. palegoldenrod: 'eee8aa',
  8390. palegreen: '98fb98',
  8391. paleturquoise: 'afeeee',
  8392. palevioletred: 'd87093',
  8393. papayawhip: 'ffefd5',
  8394. peachpuff: 'ffdab9',
  8395. peru: 'cd853f',
  8396. pink: 'ffc0cb',
  8397. plum: 'dda0dd',
  8398. powderblue: 'b0e0e6',
  8399. purple: '800080',
  8400. rebeccapurple: '663399',
  8401. red: 'ff0000',
  8402. rosybrown: 'bc8f8f',
  8403. royalblue: '4169e1',
  8404. saddlebrown: '8b4513',
  8405. salmon: 'fa8072',
  8406. sandybrown: 'f4a460',
  8407. seagreen: '2e8b57',
  8408. seashell: 'fff5ee',
  8409. sienna: 'a0522d',
  8410. silver: 'c0c0c0',
  8411. skyblue: '87ceeb',
  8412. slateblue: '6a5acd',
  8413. slategray: '708090',
  8414. snow: 'fffafa',
  8415. springgreen: '00ff7f',
  8416. steelblue: '4682b4',
  8417. tan: 'd2b48c',
  8418. teal: '008080',
  8419. thistle: 'd8bfd8',
  8420. tomato: 'ff6347',
  8421. turquoise: '40e0d0',
  8422. violet: 'ee82ee',
  8423. violetred: 'd02090',
  8424. wheat: 'f5deb3',
  8425. white: 'ffffff',
  8426. whitesmoke: 'f5f5f5',
  8427. yellow: 'ffff00',
  8428. yellowgreen: '9acd32'
  8429. };
  8430. color_string = simple_colors[color_string] || color_string;
  8431. // emd of simple type-in colors
  8432. // array of color definition objects
  8433. var color_defs = [
  8434. {
  8435. re: /^rgba\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3}),\s*((?:\d?\.)?\d)\)$/,
  8436. example: ['rgba(123, 234, 45, 0.8)', 'rgba(255,234,245,1.0)'],
  8437. process: function (bits){
  8438. return [
  8439. parseInt(bits[1]),
  8440. parseInt(bits[2]),
  8441. parseInt(bits[3]),
  8442. parseFloat(bits[4])
  8443. ];
  8444. }
  8445. },
  8446. {
  8447. re: /^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,
  8448. example: ['rgb(123, 234, 45)', 'rgb(255,234,245)'],
  8449. process: function (bits){
  8450. return [
  8451. parseInt(bits[1]),
  8452. parseInt(bits[2]),
  8453. parseInt(bits[3])
  8454. ];
  8455. }
  8456. },
  8457. {
  8458. re: /^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
  8459. example: ['#00ff00', '336699'],
  8460. process: function (bits){
  8461. return [
  8462. parseInt(bits[1], 16),
  8463. parseInt(bits[2], 16),
  8464. parseInt(bits[3], 16)
  8465. ];
  8466. }
  8467. },
  8468. {
  8469. re: /^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
  8470. example: ['#fb0', 'f0f'],
  8471. process: function (bits){
  8472. return [
  8473. parseInt(bits[1] + bits[1], 16),
  8474. parseInt(bits[2] + bits[2], 16),
  8475. parseInt(bits[3] + bits[3], 16)
  8476. ];
  8477. }
  8478. }
  8479. ];
  8480. // search through the definitions to find a match
  8481. for (var i = 0; i < color_defs.length; i++) {
  8482. var re = color_defs[i].re;
  8483. var processor = color_defs[i].process;
  8484. var bits = re.exec(color_string);
  8485. if (bits) {
  8486. var channels = processor(bits);
  8487. this.r = channels[0];
  8488. this.g = channels[1];
  8489. this.b = channels[2];
  8490. if (channels.length > 3) {
  8491. this.alpha = channels[3];
  8492. }
  8493. this.ok = true;
  8494. }
  8495. }
  8496. // validate/cleanup values
  8497. this.r = (this.r < 0 || isNaN(this.r)) ? 0 : ((this.r > 255) ? 255 : this.r);
  8498. this.g = (this.g < 0 || isNaN(this.g)) ? 0 : ((this.g > 255) ? 255 : this.g);
  8499. this.b = (this.b < 0 || isNaN(this.b)) ? 0 : ((this.b > 255) ? 255 : this.b);
  8500. this.alpha = (this.alpha < 0) ? 0 : ((this.alpha > 1.0 || isNaN(this.alpha)) ? 1.0 : this.alpha);
  8501. // some getters
  8502. this.toRGB = function () {
  8503. return 'rgb(' + this.r + ', ' + this.g + ', ' + this.b + ')';
  8504. }
  8505. this.toRGBA = function () {
  8506. return 'rgba(' + this.r + ', ' + this.g + ', ' + this.b + ', ' + this.alpha + ')';
  8507. }
  8508. this.toHex = function () {
  8509. var r = this.r.toString(16);
  8510. var g = this.g.toString(16);
  8511. var b = this.b.toString(16);
  8512. if (r.length == 1) r = '0' + r;
  8513. if (g.length == 1) g = '0' + g;
  8514. if (b.length == 1) b = '0' + b;
  8515. return '#' + r + g + b;
  8516. }
  8517. // help
  8518. this.getHelpXML = function () {
  8519. var examples = new Array();
  8520. // add regexps
  8521. for (var i = 0; i < color_defs.length; i++) {
  8522. var example = color_defs[i].example;
  8523. for (var j = 0; j < example.length; j++) {
  8524. examples[examples.length] = example[j];
  8525. }
  8526. }
  8527. // add type-in colors
  8528. for (var sc in simple_colors) {
  8529. examples[examples.length] = sc;
  8530. }
  8531. var xml = document.createElement('ul');
  8532. xml.setAttribute('id', 'rgbcolor-examples');
  8533. for (var i = 0; i < examples.length; i++) {
  8534. try {
  8535. var list_item = document.createElement('li');
  8536. var list_color = new RGBColor(examples[i]);
  8537. var example_div = document.createElement('div');
  8538. example_div.style.cssText =
  8539. 'margin: 3px; '
  8540. + 'border: 1px solid black; '
  8541. + 'background:' + list_color.toHex() + '; '
  8542. + 'color:' + list_color.toHex()
  8543. ;
  8544. example_div.appendChild(document.createTextNode('test'));
  8545. var list_item_value = document.createTextNode(
  8546. ' ' + examples[i] + ' -> ' + list_color.toRGB() + ' -> ' + list_color.toHex()
  8547. );
  8548. list_item.appendChild(example_div);
  8549. list_item.appendChild(list_item_value);
  8550. xml.appendChild(list_item);
  8551. } catch(e){}
  8552. }
  8553. return xml;
  8554. }
  8555. }
  8556. /***/ }),
  8557. /***/ "../../node_modules/stackblur-canvas/dist/stackblur-es.js":
  8558. /*!*********************************************************************************!*\
  8559. !*** D:/web_src/4dkankan_v4/node_modules/stackblur-canvas/dist/stackblur-es.js ***!
  8560. \*********************************************************************************/
  8561. /*! exports provided: BlurStack, canvasRGB, canvasRGBA, image, imageDataRGB, imageDataRGBA */
  8562. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8563. "use strict";
  8564. __webpack_require__.r(__webpack_exports__);
  8565. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BlurStack", function() { return BlurStack; });
  8566. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "canvasRGB", function() { return processCanvasRGB; });
  8567. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "canvasRGBA", function() { return processCanvasRGBA; });
  8568. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "image", function() { return processImage; });
  8569. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "imageDataRGB", function() { return processImageDataRGB; });
  8570. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "imageDataRGBA", function() { return processImageDataRGBA; });
  8571. function _typeof(obj) {
  8572. "@babel/helpers - typeof";
  8573. if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
  8574. _typeof = function (obj) {
  8575. return typeof obj;
  8576. };
  8577. } else {
  8578. _typeof = function (obj) {
  8579. return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  8580. };
  8581. }
  8582. return _typeof(obj);
  8583. }
  8584. function _classCallCheck(instance, Constructor) {
  8585. if (!(instance instanceof Constructor)) {
  8586. throw new TypeError("Cannot call a class as a function");
  8587. }
  8588. }
  8589. /* eslint-disable no-bitwise -- used for calculations */
  8590. /* eslint-disable unicorn/prefer-query-selector -- aiming at
  8591. backward-compatibility */
  8592. /**
  8593. * StackBlur - a fast almost Gaussian Blur For Canvas
  8594. *
  8595. * In case you find this class useful - especially in commercial projects -
  8596. * I am not totally unhappy for a small donation to my PayPal account
  8597. * mario@quasimondo.de
  8598. *
  8599. * Or support me on flattr:
  8600. * {@link https://flattr.com/thing/72791/StackBlur-a-fast-almost-Gaussian-Blur-Effect-for-CanvasJavascript}.
  8601. *
  8602. * @module StackBlur
  8603. * @author Mario Klingemann
  8604. * Contact: mario@quasimondo.com
  8605. * Website: {@link http://www.quasimondo.com/StackBlurForCanvas/StackBlurDemo.html}
  8606. * Twitter: @quasimondo
  8607. *
  8608. * @copyright (c) 2010 Mario Klingemann
  8609. *
  8610. * Permission is hereby granted, free of charge, to any person
  8611. * obtaining a copy of this software and associated documentation
  8612. * files (the "Software"), to deal in the Software without
  8613. * restriction, including without limitation the rights to use,
  8614. * copy, modify, merge, publish, distribute, sublicense, and/or sell
  8615. * copies of the Software, and to permit persons to whom the
  8616. * Software is furnished to do so, subject to the following
  8617. * conditions:
  8618. *
  8619. * The above copyright notice and this permission notice shall be
  8620. * included in all copies or substantial portions of the Software.
  8621. *
  8622. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  8623. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
  8624. * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  8625. * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
  8626. * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
  8627. * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  8628. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  8629. * OTHER DEALINGS IN THE SOFTWARE.
  8630. */
  8631. var mulTable = [512, 512, 456, 512, 328, 456, 335, 512, 405, 328, 271, 456, 388, 335, 292, 512, 454, 405, 364, 328, 298, 271, 496, 456, 420, 388, 360, 335, 312, 292, 273, 512, 482, 454, 428, 405, 383, 364, 345, 328, 312, 298, 284, 271, 259, 496, 475, 456, 437, 420, 404, 388, 374, 360, 347, 335, 323, 312, 302, 292, 282, 273, 265, 512, 497, 482, 468, 454, 441, 428, 417, 405, 394, 383, 373, 364, 354, 345, 337, 328, 320, 312, 305, 298, 291, 284, 278, 271, 265, 259, 507, 496, 485, 475, 465, 456, 446, 437, 428, 420, 412, 404, 396, 388, 381, 374, 367, 360, 354, 347, 341, 335, 329, 323, 318, 312, 307, 302, 297, 292, 287, 282, 278, 273, 269, 265, 261, 512, 505, 497, 489, 482, 475, 468, 461, 454, 447, 441, 435, 428, 422, 417, 411, 405, 399, 394, 389, 383, 378, 373, 368, 364, 359, 354, 350, 345, 341, 337, 332, 328, 324, 320, 316, 312, 309, 305, 301, 298, 294, 291, 287, 284, 281, 278, 274, 271, 268, 265, 262, 259, 257, 507, 501, 496, 491, 485, 480, 475, 470, 465, 460, 456, 451, 446, 442, 437, 433, 428, 424, 420, 416, 412, 408, 404, 400, 396, 392, 388, 385, 381, 377, 374, 370, 367, 363, 360, 357, 354, 350, 347, 344, 341, 338, 335, 332, 329, 326, 323, 320, 318, 315, 312, 310, 307, 304, 302, 299, 297, 294, 292, 289, 287, 285, 282, 280, 278, 275, 273, 271, 269, 267, 265, 263, 261, 259];
  8632. var shgTable = [9, 11, 12, 13, 13, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24];
  8633. /**
  8634. * @param {string|HTMLImageElement} img
  8635. * @param {string|HTMLCanvasElement} canvas
  8636. * @param {Float} radius
  8637. * @param {boolean} blurAlphaChannel
  8638. * @param {boolean} useOffset
  8639. * @param {boolean} skipStyles
  8640. * @returns {undefined}
  8641. */
  8642. function processImage(img, canvas, radius, blurAlphaChannel, useOffset, skipStyles) {
  8643. if (typeof img === 'string') {
  8644. img = document.getElementById(img);
  8645. }
  8646. if (!img || Object.prototype.toString.call(img).slice(8, -1) === 'HTMLImageElement' && !('naturalWidth' in img)) {
  8647. return;
  8648. }
  8649. var dimensionType = useOffset ? 'offset' : 'natural';
  8650. var w = img[dimensionType + 'Width'];
  8651. var h = img[dimensionType + 'Height']; // add ImageBitmap support,can blur texture source
  8652. if (Object.prototype.toString.call(img).slice(8, -1) === 'ImageBitmap') {
  8653. w = img.width;
  8654. h = img.height;
  8655. }
  8656. if (typeof canvas === 'string') {
  8657. canvas = document.getElementById(canvas);
  8658. }
  8659. if (!canvas || !('getContext' in canvas)) {
  8660. return;
  8661. }
  8662. if (!skipStyles) {
  8663. canvas.style.width = w + 'px';
  8664. canvas.style.height = h + 'px';
  8665. }
  8666. canvas.width = w;
  8667. canvas.height = h;
  8668. var context = canvas.getContext('2d');
  8669. context.clearRect(0, 0, w, h);
  8670. context.drawImage(img, 0, 0, img.naturalWidth, img.naturalHeight, 0, 0, w, h);
  8671. if (isNaN(radius) || radius < 1) {
  8672. return;
  8673. }
  8674. if (blurAlphaChannel) {
  8675. processCanvasRGBA(canvas, 0, 0, w, h, radius);
  8676. } else {
  8677. processCanvasRGB(canvas, 0, 0, w, h, radius);
  8678. }
  8679. }
  8680. /**
  8681. * @param {string|HTMLCanvasElement} canvas
  8682. * @param {Integer} topX
  8683. * @param {Integer} topY
  8684. * @param {Integer} width
  8685. * @param {Integer} height
  8686. * @throws {Error|TypeError}
  8687. * @returns {ImageData} See {@link https://html.spec.whatwg.org/multipage/canvas.html#imagedata}
  8688. */
  8689. function getImageDataFromCanvas(canvas, topX, topY, width, height) {
  8690. if (typeof canvas === 'string') {
  8691. canvas = document.getElementById(canvas);
  8692. }
  8693. if (!canvas || _typeof(canvas) !== 'object' || !('getContext' in canvas)) {
  8694. throw new TypeError('Expecting canvas with `getContext` method ' + 'in processCanvasRGB(A) calls!');
  8695. }
  8696. var context = canvas.getContext('2d');
  8697. try {
  8698. return context.getImageData(topX, topY, width, height);
  8699. } catch (e) {
  8700. throw new Error('unable to access image data: ' + e);
  8701. }
  8702. }
  8703. /**
  8704. * @param {HTMLCanvasElement} canvas
  8705. * @param {Integer} topX
  8706. * @param {Integer} topY
  8707. * @param {Integer} width
  8708. * @param {Integer} height
  8709. * @param {Float} radius
  8710. * @returns {undefined}
  8711. */
  8712. function processCanvasRGBA(canvas, topX, topY, width, height, radius) {
  8713. if (isNaN(radius) || radius < 1) {
  8714. return;
  8715. }
  8716. radius |= 0;
  8717. var imageData = getImageDataFromCanvas(canvas, topX, topY, width, height);
  8718. imageData = processImageDataRGBA(imageData, topX, topY, width, height, radius);
  8719. canvas.getContext('2d').putImageData(imageData, topX, topY);
  8720. }
  8721. /**
  8722. * @param {ImageData} imageData
  8723. * @param {Integer} topX
  8724. * @param {Integer} topY
  8725. * @param {Integer} width
  8726. * @param {Integer} height
  8727. * @param {Float} radius
  8728. * @returns {ImageData}
  8729. */
  8730. function processImageDataRGBA(imageData, topX, topY, width, height, radius) {
  8731. var pixels = imageData.data;
  8732. var div = 2 * radius + 1; // const w4 = width << 2;
  8733. var widthMinus1 = width - 1;
  8734. var heightMinus1 = height - 1;
  8735. var radiusPlus1 = radius + 1;
  8736. var sumFactor = radiusPlus1 * (radiusPlus1 + 1) / 2;
  8737. var stackStart = new BlurStack();
  8738. var stack = stackStart;
  8739. var stackEnd;
  8740. for (var i = 1; i < div; i++) {
  8741. stack = stack.next = new BlurStack();
  8742. if (i === radiusPlus1) {
  8743. stackEnd = stack;
  8744. }
  8745. }
  8746. stack.next = stackStart;
  8747. var stackIn = null,
  8748. stackOut = null,
  8749. yw = 0,
  8750. yi = 0;
  8751. var mulSum = mulTable[radius];
  8752. var shgSum = shgTable[radius];
  8753. for (var y = 0; y < height; y++) {
  8754. stack = stackStart;
  8755. var pr = pixels[yi],
  8756. pg = pixels[yi + 1],
  8757. pb = pixels[yi + 2],
  8758. pa = pixels[yi + 3];
  8759. for (var _i = 0; _i < radiusPlus1; _i++) {
  8760. stack.r = pr;
  8761. stack.g = pg;
  8762. stack.b = pb;
  8763. stack.a = pa;
  8764. stack = stack.next;
  8765. }
  8766. var rInSum = 0,
  8767. gInSum = 0,
  8768. bInSum = 0,
  8769. aInSum = 0,
  8770. rOutSum = radiusPlus1 * pr,
  8771. gOutSum = radiusPlus1 * pg,
  8772. bOutSum = radiusPlus1 * pb,
  8773. aOutSum = radiusPlus1 * pa,
  8774. rSum = sumFactor * pr,
  8775. gSum = sumFactor * pg,
  8776. bSum = sumFactor * pb,
  8777. aSum = sumFactor * pa;
  8778. for (var _i2 = 1; _i2 < radiusPlus1; _i2++) {
  8779. var p = yi + ((widthMinus1 < _i2 ? widthMinus1 : _i2) << 2);
  8780. var r = pixels[p],
  8781. g = pixels[p + 1],
  8782. b = pixels[p + 2],
  8783. a = pixels[p + 3];
  8784. var rbs = radiusPlus1 - _i2;
  8785. rSum += (stack.r = r) * rbs;
  8786. gSum += (stack.g = g) * rbs;
  8787. bSum += (stack.b = b) * rbs;
  8788. aSum += (stack.a = a) * rbs;
  8789. rInSum += r;
  8790. gInSum += g;
  8791. bInSum += b;
  8792. aInSum += a;
  8793. stack = stack.next;
  8794. }
  8795. stackIn = stackStart;
  8796. stackOut = stackEnd;
  8797. for (var x = 0; x < width; x++) {
  8798. var paInitial = aSum * mulSum >>> shgSum;
  8799. pixels[yi + 3] = paInitial;
  8800. if (paInitial !== 0) {
  8801. var _a2 = 255 / paInitial;
  8802. pixels[yi] = (rSum * mulSum >>> shgSum) * _a2;
  8803. pixels[yi + 1] = (gSum * mulSum >>> shgSum) * _a2;
  8804. pixels[yi + 2] = (bSum * mulSum >>> shgSum) * _a2;
  8805. } else {
  8806. pixels[yi] = pixels[yi + 1] = pixels[yi + 2] = 0;
  8807. }
  8808. rSum -= rOutSum;
  8809. gSum -= gOutSum;
  8810. bSum -= bOutSum;
  8811. aSum -= aOutSum;
  8812. rOutSum -= stackIn.r;
  8813. gOutSum -= stackIn.g;
  8814. bOutSum -= stackIn.b;
  8815. aOutSum -= stackIn.a;
  8816. var _p = x + radius + 1;
  8817. _p = yw + (_p < widthMinus1 ? _p : widthMinus1) << 2;
  8818. rInSum += stackIn.r = pixels[_p];
  8819. gInSum += stackIn.g = pixels[_p + 1];
  8820. bInSum += stackIn.b = pixels[_p + 2];
  8821. aInSum += stackIn.a = pixels[_p + 3];
  8822. rSum += rInSum;
  8823. gSum += gInSum;
  8824. bSum += bInSum;
  8825. aSum += aInSum;
  8826. stackIn = stackIn.next;
  8827. var _stackOut = stackOut,
  8828. _r = _stackOut.r,
  8829. _g = _stackOut.g,
  8830. _b = _stackOut.b,
  8831. _a = _stackOut.a;
  8832. rOutSum += _r;
  8833. gOutSum += _g;
  8834. bOutSum += _b;
  8835. aOutSum += _a;
  8836. rInSum -= _r;
  8837. gInSum -= _g;
  8838. bInSum -= _b;
  8839. aInSum -= _a;
  8840. stackOut = stackOut.next;
  8841. yi += 4;
  8842. }
  8843. yw += width;
  8844. }
  8845. for (var _x = 0; _x < width; _x++) {
  8846. yi = _x << 2;
  8847. var _pr = pixels[yi],
  8848. _pg = pixels[yi + 1],
  8849. _pb = pixels[yi + 2],
  8850. _pa = pixels[yi + 3],
  8851. _rOutSum = radiusPlus1 * _pr,
  8852. _gOutSum = radiusPlus1 * _pg,
  8853. _bOutSum = radiusPlus1 * _pb,
  8854. _aOutSum = radiusPlus1 * _pa,
  8855. _rSum = sumFactor * _pr,
  8856. _gSum = sumFactor * _pg,
  8857. _bSum = sumFactor * _pb,
  8858. _aSum = sumFactor * _pa;
  8859. stack = stackStart;
  8860. for (var _i3 = 0; _i3 < radiusPlus1; _i3++) {
  8861. stack.r = _pr;
  8862. stack.g = _pg;
  8863. stack.b = _pb;
  8864. stack.a = _pa;
  8865. stack = stack.next;
  8866. }
  8867. var yp = width;
  8868. var _gInSum = 0,
  8869. _bInSum = 0,
  8870. _aInSum = 0,
  8871. _rInSum = 0;
  8872. for (var _i4 = 1; _i4 <= radius; _i4++) {
  8873. yi = yp + _x << 2;
  8874. var _rbs = radiusPlus1 - _i4;
  8875. _rSum += (stack.r = _pr = pixels[yi]) * _rbs;
  8876. _gSum += (stack.g = _pg = pixels[yi + 1]) * _rbs;
  8877. _bSum += (stack.b = _pb = pixels[yi + 2]) * _rbs;
  8878. _aSum += (stack.a = _pa = pixels[yi + 3]) * _rbs;
  8879. _rInSum += _pr;
  8880. _gInSum += _pg;
  8881. _bInSum += _pb;
  8882. _aInSum += _pa;
  8883. stack = stack.next;
  8884. if (_i4 < heightMinus1) {
  8885. yp += width;
  8886. }
  8887. }
  8888. yi = _x;
  8889. stackIn = stackStart;
  8890. stackOut = stackEnd;
  8891. for (var _y = 0; _y < height; _y++) {
  8892. var _p2 = yi << 2;
  8893. pixels[_p2 + 3] = _pa = _aSum * mulSum >>> shgSum;
  8894. if (_pa > 0) {
  8895. _pa = 255 / _pa;
  8896. pixels[_p2] = (_rSum * mulSum >>> shgSum) * _pa;
  8897. pixels[_p2 + 1] = (_gSum * mulSum >>> shgSum) * _pa;
  8898. pixels[_p2 + 2] = (_bSum * mulSum >>> shgSum) * _pa;
  8899. } else {
  8900. pixels[_p2] = pixels[_p2 + 1] = pixels[_p2 + 2] = 0;
  8901. }
  8902. _rSum -= _rOutSum;
  8903. _gSum -= _gOutSum;
  8904. _bSum -= _bOutSum;
  8905. _aSum -= _aOutSum;
  8906. _rOutSum -= stackIn.r;
  8907. _gOutSum -= stackIn.g;
  8908. _bOutSum -= stackIn.b;
  8909. _aOutSum -= stackIn.a;
  8910. _p2 = _x + ((_p2 = _y + radiusPlus1) < heightMinus1 ? _p2 : heightMinus1) * width << 2;
  8911. _rSum += _rInSum += stackIn.r = pixels[_p2];
  8912. _gSum += _gInSum += stackIn.g = pixels[_p2 + 1];
  8913. _bSum += _bInSum += stackIn.b = pixels[_p2 + 2];
  8914. _aSum += _aInSum += stackIn.a = pixels[_p2 + 3];
  8915. stackIn = stackIn.next;
  8916. _rOutSum += _pr = stackOut.r;
  8917. _gOutSum += _pg = stackOut.g;
  8918. _bOutSum += _pb = stackOut.b;
  8919. _aOutSum += _pa = stackOut.a;
  8920. _rInSum -= _pr;
  8921. _gInSum -= _pg;
  8922. _bInSum -= _pb;
  8923. _aInSum -= _pa;
  8924. stackOut = stackOut.next;
  8925. yi += width;
  8926. }
  8927. }
  8928. return imageData;
  8929. }
  8930. /**
  8931. * @param {HTMLCanvasElement} canvas
  8932. * @param {Integer} topX
  8933. * @param {Integer} topY
  8934. * @param {Integer} width
  8935. * @param {Integer} height
  8936. * @param {Float} radius
  8937. * @returns {undefined}
  8938. */
  8939. function processCanvasRGB(canvas, topX, topY, width, height, radius) {
  8940. if (isNaN(radius) || radius < 1) {
  8941. return;
  8942. }
  8943. radius |= 0;
  8944. var imageData = getImageDataFromCanvas(canvas, topX, topY, width, height);
  8945. imageData = processImageDataRGB(imageData, topX, topY, width, height, radius);
  8946. canvas.getContext('2d').putImageData(imageData, topX, topY);
  8947. }
  8948. /**
  8949. * @param {ImageData} imageData
  8950. * @param {Integer} topX
  8951. * @param {Integer} topY
  8952. * @param {Integer} width
  8953. * @param {Integer} height
  8954. * @param {Float} radius
  8955. * @returns {ImageData}
  8956. */
  8957. function processImageDataRGB(imageData, topX, topY, width, height, radius) {
  8958. var pixels = imageData.data;
  8959. var div = 2 * radius + 1; // const w4 = width << 2;
  8960. var widthMinus1 = width - 1;
  8961. var heightMinus1 = height - 1;
  8962. var radiusPlus1 = radius + 1;
  8963. var sumFactor = radiusPlus1 * (radiusPlus1 + 1) / 2;
  8964. var stackStart = new BlurStack();
  8965. var stack = stackStart;
  8966. var stackEnd;
  8967. for (var i = 1; i < div; i++) {
  8968. stack = stack.next = new BlurStack();
  8969. if (i === radiusPlus1) {
  8970. stackEnd = stack;
  8971. }
  8972. }
  8973. stack.next = stackStart;
  8974. var stackIn = null;
  8975. var stackOut = null;
  8976. var mulSum = mulTable[radius];
  8977. var shgSum = shgTable[radius];
  8978. var p, rbs;
  8979. var yw = 0,
  8980. yi = 0;
  8981. for (var y = 0; y < height; y++) {
  8982. var pr = pixels[yi],
  8983. pg = pixels[yi + 1],
  8984. pb = pixels[yi + 2],
  8985. rOutSum = radiusPlus1 * pr,
  8986. gOutSum = radiusPlus1 * pg,
  8987. bOutSum = radiusPlus1 * pb,
  8988. rSum = sumFactor * pr,
  8989. gSum = sumFactor * pg,
  8990. bSum = sumFactor * pb;
  8991. stack = stackStart;
  8992. for (var _i5 = 0; _i5 < radiusPlus1; _i5++) {
  8993. stack.r = pr;
  8994. stack.g = pg;
  8995. stack.b = pb;
  8996. stack = stack.next;
  8997. }
  8998. var rInSum = 0,
  8999. gInSum = 0,
  9000. bInSum = 0;
  9001. for (var _i6 = 1; _i6 < radiusPlus1; _i6++) {
  9002. p = yi + ((widthMinus1 < _i6 ? widthMinus1 : _i6) << 2);
  9003. rSum += (stack.r = pr = pixels[p]) * (rbs = radiusPlus1 - _i6);
  9004. gSum += (stack.g = pg = pixels[p + 1]) * rbs;
  9005. bSum += (stack.b = pb = pixels[p + 2]) * rbs;
  9006. rInSum += pr;
  9007. gInSum += pg;
  9008. bInSum += pb;
  9009. stack = stack.next;
  9010. }
  9011. stackIn = stackStart;
  9012. stackOut = stackEnd;
  9013. for (var x = 0; x < width; x++) {
  9014. pixels[yi] = rSum * mulSum >>> shgSum;
  9015. pixels[yi + 1] = gSum * mulSum >>> shgSum;
  9016. pixels[yi + 2] = bSum * mulSum >>> shgSum;
  9017. rSum -= rOutSum;
  9018. gSum -= gOutSum;
  9019. bSum -= bOutSum;
  9020. rOutSum -= stackIn.r;
  9021. gOutSum -= stackIn.g;
  9022. bOutSum -= stackIn.b;
  9023. p = yw + ((p = x + radius + 1) < widthMinus1 ? p : widthMinus1) << 2;
  9024. rInSum += stackIn.r = pixels[p];
  9025. gInSum += stackIn.g = pixels[p + 1];
  9026. bInSum += stackIn.b = pixels[p + 2];
  9027. rSum += rInSum;
  9028. gSum += gInSum;
  9029. bSum += bInSum;
  9030. stackIn = stackIn.next;
  9031. rOutSum += pr = stackOut.r;
  9032. gOutSum += pg = stackOut.g;
  9033. bOutSum += pb = stackOut.b;
  9034. rInSum -= pr;
  9035. gInSum -= pg;
  9036. bInSum -= pb;
  9037. stackOut = stackOut.next;
  9038. yi += 4;
  9039. }
  9040. yw += width;
  9041. }
  9042. for (var _x2 = 0; _x2 < width; _x2++) {
  9043. yi = _x2 << 2;
  9044. var _pr2 = pixels[yi],
  9045. _pg2 = pixels[yi + 1],
  9046. _pb2 = pixels[yi + 2],
  9047. _rOutSum2 = radiusPlus1 * _pr2,
  9048. _gOutSum2 = radiusPlus1 * _pg2,
  9049. _bOutSum2 = radiusPlus1 * _pb2,
  9050. _rSum2 = sumFactor * _pr2,
  9051. _gSum2 = sumFactor * _pg2,
  9052. _bSum2 = sumFactor * _pb2;
  9053. stack = stackStart;
  9054. for (var _i7 = 0; _i7 < radiusPlus1; _i7++) {
  9055. stack.r = _pr2;
  9056. stack.g = _pg2;
  9057. stack.b = _pb2;
  9058. stack = stack.next;
  9059. }
  9060. var _rInSum2 = 0,
  9061. _gInSum2 = 0,
  9062. _bInSum2 = 0;
  9063. for (var _i8 = 1, yp = width; _i8 <= radius; _i8++) {
  9064. yi = yp + _x2 << 2;
  9065. _rSum2 += (stack.r = _pr2 = pixels[yi]) * (rbs = radiusPlus1 - _i8);
  9066. _gSum2 += (stack.g = _pg2 = pixels[yi + 1]) * rbs;
  9067. _bSum2 += (stack.b = _pb2 = pixels[yi + 2]) * rbs;
  9068. _rInSum2 += _pr2;
  9069. _gInSum2 += _pg2;
  9070. _bInSum2 += _pb2;
  9071. stack = stack.next;
  9072. if (_i8 < heightMinus1) {
  9073. yp += width;
  9074. }
  9075. }
  9076. yi = _x2;
  9077. stackIn = stackStart;
  9078. stackOut = stackEnd;
  9079. for (var _y2 = 0; _y2 < height; _y2++) {
  9080. p = yi << 2;
  9081. pixels[p] = _rSum2 * mulSum >>> shgSum;
  9082. pixels[p + 1] = _gSum2 * mulSum >>> shgSum;
  9083. pixels[p + 2] = _bSum2 * mulSum >>> shgSum;
  9084. _rSum2 -= _rOutSum2;
  9085. _gSum2 -= _gOutSum2;
  9086. _bSum2 -= _bOutSum2;
  9087. _rOutSum2 -= stackIn.r;
  9088. _gOutSum2 -= stackIn.g;
  9089. _bOutSum2 -= stackIn.b;
  9090. p = _x2 + ((p = _y2 + radiusPlus1) < heightMinus1 ? p : heightMinus1) * width << 2;
  9091. _rSum2 += _rInSum2 += stackIn.r = pixels[p];
  9092. _gSum2 += _gInSum2 += stackIn.g = pixels[p + 1];
  9093. _bSum2 += _bInSum2 += stackIn.b = pixels[p + 2];
  9094. stackIn = stackIn.next;
  9095. _rOutSum2 += _pr2 = stackOut.r;
  9096. _gOutSum2 += _pg2 = stackOut.g;
  9097. _bOutSum2 += _pb2 = stackOut.b;
  9098. _rInSum2 -= _pr2;
  9099. _gInSum2 -= _pg2;
  9100. _bInSum2 -= _pb2;
  9101. stackOut = stackOut.next;
  9102. yi += width;
  9103. }
  9104. }
  9105. return imageData;
  9106. }
  9107. /**
  9108. *
  9109. */
  9110. var BlurStack =
  9111. /**
  9112. * Set properties.
  9113. */
  9114. function BlurStack() {
  9115. _classCallCheck(this, BlurStack);
  9116. this.r = 0;
  9117. this.g = 0;
  9118. this.b = 0;
  9119. this.a = 0;
  9120. this.next = null;
  9121. };
  9122. /***/ }),
  9123. /***/ "../../node_modules/svg-pathdata/lib/SVGPathData.module.js":
  9124. /*!**********************************************************************************!*\
  9125. !*** D:/web_src/4dkankan_v4/node_modules/svg-pathdata/lib/SVGPathData.module.js ***!
  9126. \**********************************************************************************/
  9127. /*! exports provided: COMMAND_ARG_COUNTS, SVGPathData, SVGPathDataParser, SVGPathDataTransformer, encodeSVGPath */
  9128. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9129. "use strict";
  9130. __webpack_require__.r(__webpack_exports__);
  9131. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "COMMAND_ARG_COUNTS", function() { return N; });
  9132. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SVGPathData", function() { return _; });
  9133. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SVGPathDataParser", function() { return f; });
  9134. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SVGPathDataTransformer", function() { return u; });
  9135. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "encodeSVGPath", function() { return e; });
  9136. /*! *****************************************************************************
  9137. Copyright (c) Microsoft Corporation.
  9138. Permission to use, copy, modify, and/or distribute this software for any
  9139. purpose with or without fee is hereby granted.
  9140. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  9141. REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  9142. AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  9143. INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  9144. LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  9145. OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  9146. PERFORMANCE OF THIS SOFTWARE.
  9147. ***************************************************************************** */
  9148. var t=function(r,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var e in r)Object.prototype.hasOwnProperty.call(r,e)&&(t[e]=r[e])})(r,e)};function r(r,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=r}t(r,e),r.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}function e(t){var r="";Array.isArray(t)||(t=[t]);for(var e=0;e<t.length;e++){var i=t[e];if(i.type===_.CLOSE_PATH)r+="z";else if(i.type===_.HORIZ_LINE_TO)r+=(i.relative?"h":"H")+i.x;else if(i.type===_.VERT_LINE_TO)r+=(i.relative?"v":"V")+i.y;else if(i.type===_.MOVE_TO)r+=(i.relative?"m":"M")+i.x+" "+i.y;else if(i.type===_.LINE_TO)r+=(i.relative?"l":"L")+i.x+" "+i.y;else if(i.type===_.CURVE_TO)r+=(i.relative?"c":"C")+i.x1+" "+i.y1+" "+i.x2+" "+i.y2+" "+i.x+" "+i.y;else if(i.type===_.SMOOTH_CURVE_TO)r+=(i.relative?"s":"S")+i.x2+" "+i.y2+" "+i.x+" "+i.y;else if(i.type===_.QUAD_TO)r+=(i.relative?"q":"Q")+i.x1+" "+i.y1+" "+i.x+" "+i.y;else if(i.type===_.SMOOTH_QUAD_TO)r+=(i.relative?"t":"T")+i.x+" "+i.y;else{if(i.type!==_.ARC)throw new Error('Unexpected command type "'+i.type+'" at index '+e+".");r+=(i.relative?"a":"A")+i.rX+" "+i.rY+" "+i.xRot+" "+ +i.lArcFlag+" "+ +i.sweepFlag+" "+i.x+" "+i.y}}return r}function i(t,r){var e=t[0],i=t[1];return[e*Math.cos(r)-i*Math.sin(r),e*Math.sin(r)+i*Math.cos(r)]}function a(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];for(var e=0;e<t.length;e++)if("number"!=typeof t[e])throw new Error("assertNumbers arguments["+e+"] is not a number. "+typeof t[e]+" == typeof "+t[e]);return!0}var n=Math.PI;function o(t,r,e){t.lArcFlag=0===t.lArcFlag?0:1,t.sweepFlag=0===t.sweepFlag?0:1;var a=t.rX,o=t.rY,s=t.x,u=t.y;a=Math.abs(t.rX),o=Math.abs(t.rY);var h=i([(r-s)/2,(e-u)/2],-t.xRot/180*n),c=h[0],y=h[1],p=Math.pow(c,2)/Math.pow(a,2)+Math.pow(y,2)/Math.pow(o,2);1<p&&(a*=Math.sqrt(p),o*=Math.sqrt(p)),t.rX=a,t.rY=o;var m=Math.pow(a,2)*Math.pow(y,2)+Math.pow(o,2)*Math.pow(c,2),O=(t.lArcFlag!==t.sweepFlag?1:-1)*Math.sqrt(Math.max(0,(Math.pow(a,2)*Math.pow(o,2)-m)/m)),l=a*y/o*O,T=-o*c/a*O,v=i([l,T],t.xRot/180*n);t.cX=v[0]+(r+s)/2,t.cY=v[1]+(e+u)/2,t.phi1=Math.atan2((y-T)/o,(c-l)/a),t.phi2=Math.atan2((-y-T)/o,(-c-l)/a),0===t.sweepFlag&&t.phi2>t.phi1&&(t.phi2-=2*n),1===t.sweepFlag&&t.phi2<t.phi1&&(t.phi2+=2*n),t.phi1*=180/n,t.phi2*=180/n}function s(t,r,e){a(t,r,e);var i=t*t+r*r-e*e;if(0>i)return[];if(0===i)return[[t*e/(t*t+r*r),r*e/(t*t+r*r)]];var n=Math.sqrt(i);return[[(t*e+r*n)/(t*t+r*r),(r*e-t*n)/(t*t+r*r)],[(t*e-r*n)/(t*t+r*r),(r*e+t*n)/(t*t+r*r)]]}var u,h=Math.PI/180;function c(t,r,e){return(1-e)*t+e*r}function y(t,r,e,i){return t+Math.cos(i/180*n)*r+Math.sin(i/180*n)*e}function p(t,r,e,i){var a=1e-6,n=r-t,o=e-r,s=3*n+3*(i-e)-6*o,u=6*(o-n),h=3*n;return Math.abs(s)<a?[-h/u]:function(t,r,e){void 0===e&&(e=1e-6);var i=t*t/4-r;if(i<-e)return[];if(i<=e)return[-t/2];var a=Math.sqrt(i);return[-t/2-a,-t/2+a]}(u/s,h/s,a)}function m(t,r,e,i,a){var n=1-a;return t*(n*n*n)+r*(3*n*n*a)+e*(3*n*a*a)+i*(a*a*a)}!function(t){function r(){return u((function(t,r,e){return t.relative&&(void 0!==t.x1&&(t.x1+=r),void 0!==t.y1&&(t.y1+=e),void 0!==t.x2&&(t.x2+=r),void 0!==t.y2&&(t.y2+=e),void 0!==t.x&&(t.x+=r),void 0!==t.y&&(t.y+=e),t.relative=!1),t}))}function e(){var t=NaN,r=NaN,e=NaN,i=NaN;return u((function(a,n,o){return a.type&_.SMOOTH_CURVE_TO&&(a.type=_.CURVE_TO,t=isNaN(t)?n:t,r=isNaN(r)?o:r,a.x1=a.relative?n-t:2*n-t,a.y1=a.relative?o-r:2*o-r),a.type&_.CURVE_TO?(t=a.relative?n+a.x2:a.x2,r=a.relative?o+a.y2:a.y2):(t=NaN,r=NaN),a.type&_.SMOOTH_QUAD_TO&&(a.type=_.QUAD_TO,e=isNaN(e)?n:e,i=isNaN(i)?o:i,a.x1=a.relative?n-e:2*n-e,a.y1=a.relative?o-i:2*o-i),a.type&_.QUAD_TO?(e=a.relative?n+a.x1:a.x1,i=a.relative?o+a.y1:a.y1):(e=NaN,i=NaN),a}))}function n(){var t=NaN,r=NaN;return u((function(e,i,a){if(e.type&_.SMOOTH_QUAD_TO&&(e.type=_.QUAD_TO,t=isNaN(t)?i:t,r=isNaN(r)?a:r,e.x1=e.relative?i-t:2*i-t,e.y1=e.relative?a-r:2*a-r),e.type&_.QUAD_TO){t=e.relative?i+e.x1:e.x1,r=e.relative?a+e.y1:e.y1;var n=e.x1,o=e.y1;e.type=_.CURVE_TO,e.x1=((e.relative?0:i)+2*n)/3,e.y1=((e.relative?0:a)+2*o)/3,e.x2=(e.x+2*n)/3,e.y2=(e.y+2*o)/3}else t=NaN,r=NaN;return e}))}function u(t){var r=0,e=0,i=NaN,a=NaN;return function(n){if(isNaN(i)&&!(n.type&_.MOVE_TO))throw new Error("path must start with moveto");var o=t(n,r,e,i,a);return n.type&_.CLOSE_PATH&&(r=i,e=a),void 0!==n.x&&(r=n.relative?r+n.x:n.x),void 0!==n.y&&(e=n.relative?e+n.y:n.y),n.type&_.MOVE_TO&&(i=r,a=e),o}}function O(t,r,e,i,n,o){return a(t,r,e,i,n,o),u((function(a,s,u,h){var c=a.x1,y=a.x2,p=a.relative&&!isNaN(h),m=void 0!==a.x?a.x:p?0:s,O=void 0!==a.y?a.y:p?0:u;function l(t){return t*t}a.type&_.HORIZ_LINE_TO&&0!==r&&(a.type=_.LINE_TO,a.y=a.relative?0:u),a.type&_.VERT_LINE_TO&&0!==e&&(a.type=_.LINE_TO,a.x=a.relative?0:s),void 0!==a.x&&(a.x=a.x*t+O*e+(p?0:n)),void 0!==a.y&&(a.y=m*r+a.y*i+(p?0:o)),void 0!==a.x1&&(a.x1=a.x1*t+a.y1*e+(p?0:n)),void 0!==a.y1&&(a.y1=c*r+a.y1*i+(p?0:o)),void 0!==a.x2&&(a.x2=a.x2*t+a.y2*e+(p?0:n)),void 0!==a.y2&&(a.y2=y*r+a.y2*i+(p?0:o));var T=t*i-r*e;if(void 0!==a.xRot&&(1!==t||0!==r||0!==e||1!==i))if(0===T)delete a.rX,delete a.rY,delete a.xRot,delete a.lArcFlag,delete a.sweepFlag,a.type=_.LINE_TO;else{var v=a.xRot*Math.PI/180,f=Math.sin(v),N=Math.cos(v),x=1/l(a.rX),d=1/l(a.rY),E=l(N)*x+l(f)*d,A=2*f*N*(x-d),C=l(f)*x+l(N)*d,M=E*i*i-A*r*i+C*r*r,R=A*(t*i+r*e)-2*(E*e*i+C*t*r),g=E*e*e-A*t*e+C*t*t,I=(Math.atan2(R,M-g)+Math.PI)%Math.PI/2,S=Math.sin(I),L=Math.cos(I);a.rX=Math.abs(T)/Math.sqrt(M*l(L)+R*S*L+g*l(S)),a.rY=Math.abs(T)/Math.sqrt(M*l(S)-R*S*L+g*l(L)),a.xRot=180*I/Math.PI}return void 0!==a.sweepFlag&&0>T&&(a.sweepFlag=+!a.sweepFlag),a}))}function l(){return function(t){var r={};for(var e in t)r[e]=t[e];return r}}t.ROUND=function(t){function r(r){return Math.round(r*t)/t}return void 0===t&&(t=1e13),a(t),function(t){return void 0!==t.x1&&(t.x1=r(t.x1)),void 0!==t.y1&&(t.y1=r(t.y1)),void 0!==t.x2&&(t.x2=r(t.x2)),void 0!==t.y2&&(t.y2=r(t.y2)),void 0!==t.x&&(t.x=r(t.x)),void 0!==t.y&&(t.y=r(t.y)),void 0!==t.rX&&(t.rX=r(t.rX)),void 0!==t.rY&&(t.rY=r(t.rY)),t}},t.TO_ABS=r,t.TO_REL=function(){return u((function(t,r,e){return t.relative||(void 0!==t.x1&&(t.x1-=r),void 0!==t.y1&&(t.y1-=e),void 0!==t.x2&&(t.x2-=r),void 0!==t.y2&&(t.y2-=e),void 0!==t.x&&(t.x-=r),void 0!==t.y&&(t.y-=e),t.relative=!0),t}))},t.NORMALIZE_HVZ=function(t,r,e){return void 0===t&&(t=!0),void 0===r&&(r=!0),void 0===e&&(e=!0),u((function(i,a,n,o,s){if(isNaN(o)&&!(i.type&_.MOVE_TO))throw new Error("path must start with moveto");return r&&i.type&_.HORIZ_LINE_TO&&(i.type=_.LINE_TO,i.y=i.relative?0:n),e&&i.type&_.VERT_LINE_TO&&(i.type=_.LINE_TO,i.x=i.relative?0:a),t&&i.type&_.CLOSE_PATH&&(i.type=_.LINE_TO,i.x=i.relative?o-a:o,i.y=i.relative?s-n:s),i.type&_.ARC&&(0===i.rX||0===i.rY)&&(i.type=_.LINE_TO,delete i.rX,delete i.rY,delete i.xRot,delete i.lArcFlag,delete i.sweepFlag),i}))},t.NORMALIZE_ST=e,t.QT_TO_C=n,t.INFO=u,t.SANITIZE=function(t){void 0===t&&(t=0),a(t);var r=NaN,e=NaN,i=NaN,n=NaN;return u((function(a,o,s,u,h){var c=Math.abs,y=!1,p=0,m=0;if(a.type&_.SMOOTH_CURVE_TO&&(p=isNaN(r)?0:o-r,m=isNaN(e)?0:s-e),a.type&(_.CURVE_TO|_.SMOOTH_CURVE_TO)?(r=a.relative?o+a.x2:a.x2,e=a.relative?s+a.y2:a.y2):(r=NaN,e=NaN),a.type&_.SMOOTH_QUAD_TO?(i=isNaN(i)?o:2*o-i,n=isNaN(n)?s:2*s-n):a.type&_.QUAD_TO?(i=a.relative?o+a.x1:a.x1,n=a.relative?s+a.y1:a.y2):(i=NaN,n=NaN),a.type&_.LINE_COMMANDS||a.type&_.ARC&&(0===a.rX||0===a.rY||!a.lArcFlag)||a.type&_.CURVE_TO||a.type&_.SMOOTH_CURVE_TO||a.type&_.QUAD_TO||a.type&_.SMOOTH_QUAD_TO){var O=void 0===a.x?0:a.relative?a.x:a.x-o,l=void 0===a.y?0:a.relative?a.y:a.y-s;p=isNaN(i)?void 0===a.x1?p:a.relative?a.x:a.x1-o:i-o,m=isNaN(n)?void 0===a.y1?m:a.relative?a.y:a.y1-s:n-s;var T=void 0===a.x2?0:a.relative?a.x:a.x2-o,v=void 0===a.y2?0:a.relative?a.y:a.y2-s;c(O)<=t&&c(l)<=t&&c(p)<=t&&c(m)<=t&&c(T)<=t&&c(v)<=t&&(y=!0)}return a.type&_.CLOSE_PATH&&c(o-u)<=t&&c(s-h)<=t&&(y=!0),y?[]:a}))},t.MATRIX=O,t.ROTATE=function(t,r,e){void 0===r&&(r=0),void 0===e&&(e=0),a(t,r,e);var i=Math.sin(t),n=Math.cos(t);return O(n,i,-i,n,r-r*n+e*i,e-r*i-e*n)},t.TRANSLATE=function(t,r){return void 0===r&&(r=0),a(t,r),O(1,0,0,1,t,r)},t.SCALE=function(t,r){return void 0===r&&(r=t),a(t,r),O(t,0,0,r,0,0)},t.SKEW_X=function(t){return a(t),O(1,0,Math.atan(t),1,0,0)},t.SKEW_Y=function(t){return a(t),O(1,Math.atan(t),0,1,0,0)},t.X_AXIS_SYMMETRY=function(t){return void 0===t&&(t=0),a(t),O(-1,0,0,1,t,0)},t.Y_AXIS_SYMMETRY=function(t){return void 0===t&&(t=0),a(t),O(1,0,0,-1,0,t)},t.A_TO_C=function(){return u((function(t,r,e){return _.ARC===t.type?function(t,r,e){var a,n,s,u;t.cX||o(t,r,e);for(var y=Math.min(t.phi1,t.phi2),p=Math.max(t.phi1,t.phi2)-y,m=Math.ceil(p/90),O=new Array(m),l=r,T=e,v=0;v<m;v++){var f=c(t.phi1,t.phi2,v/m),N=c(t.phi1,t.phi2,(v+1)/m),x=N-f,d=4/3*Math.tan(x*h/4),E=[Math.cos(f*h)-d*Math.sin(f*h),Math.sin(f*h)+d*Math.cos(f*h)],A=E[0],C=E[1],M=[Math.cos(N*h),Math.sin(N*h)],R=M[0],g=M[1],I=[R+d*Math.sin(N*h),g-d*Math.cos(N*h)],S=I[0],L=I[1];O[v]={relative:t.relative,type:_.CURVE_TO};var H=function(r,e){var a=i([r*t.rX,e*t.rY],t.xRot),n=a[0],o=a[1];return[t.cX+n,t.cY+o]};a=H(A,C),O[v].x1=a[0],O[v].y1=a[1],n=H(S,L),O[v].x2=n[0],O[v].y2=n[1],s=H(R,g),O[v].x=s[0],O[v].y=s[1],t.relative&&(O[v].x1-=l,O[v].y1-=T,O[v].x2-=l,O[v].y2-=T,O[v].x-=l,O[v].y-=T),l=(u=[O[v].x,O[v].y])[0],T=u[1]}return O}(t,t.relative?0:r,t.relative?0:e):t}))},t.ANNOTATE_ARCS=function(){return u((function(t,r,e){return t.relative&&(r=0,e=0),_.ARC===t.type&&o(t,r,e),t}))},t.CLONE=l,t.CALCULATE_BOUNDS=function(){var t=function(t){var r={};for(var e in t)r[e]=t[e];return r},i=r(),a=n(),h=e(),c=u((function(r,e,n){var u=h(a(i(t(r))));function O(t){t>c.maxX&&(c.maxX=t),t<c.minX&&(c.minX=t)}function l(t){t>c.maxY&&(c.maxY=t),t<c.minY&&(c.minY=t)}if(u.type&_.DRAWING_COMMANDS&&(O(e),l(n)),u.type&_.HORIZ_LINE_TO&&O(u.x),u.type&_.VERT_LINE_TO&&l(u.y),u.type&_.LINE_TO&&(O(u.x),l(u.y)),u.type&_.CURVE_TO){O(u.x),l(u.y);for(var T=0,v=p(e,u.x1,u.x2,u.x);T<v.length;T++){0<(w=v[T])&&1>w&&O(m(e,u.x1,u.x2,u.x,w))}for(var f=0,N=p(n,u.y1,u.y2,u.y);f<N.length;f++){0<(w=N[f])&&1>w&&l(m(n,u.y1,u.y2,u.y,w))}}if(u.type&_.ARC){O(u.x),l(u.y),o(u,e,n);for(var x=u.xRot/180*Math.PI,d=Math.cos(x)*u.rX,E=Math.sin(x)*u.rX,A=-Math.sin(x)*u.rY,C=Math.cos(x)*u.rY,M=u.phi1<u.phi2?[u.phi1,u.phi2]:-180>u.phi2?[u.phi2+360,u.phi1+360]:[u.phi2,u.phi1],R=M[0],g=M[1],I=function(t){var r=t[0],e=t[1],i=180*Math.atan2(e,r)/Math.PI;return i<R?i+360:i},S=0,L=s(A,-d,0).map(I);S<L.length;S++){(w=L[S])>R&&w<g&&O(y(u.cX,d,A,w))}for(var H=0,U=s(C,-E,0).map(I);H<U.length;H++){var w;(w=U[H])>R&&w<g&&l(y(u.cY,E,C,w))}}return r}));return c.minX=1/0,c.maxX=-1/0,c.minY=1/0,c.maxY=-1/0,c}}(u||(u={}));var O,l=function(){function t(){}return t.prototype.round=function(t){return this.transform(u.ROUND(t))},t.prototype.toAbs=function(){return this.transform(u.TO_ABS())},t.prototype.toRel=function(){return this.transform(u.TO_REL())},t.prototype.normalizeHVZ=function(t,r,e){return this.transform(u.NORMALIZE_HVZ(t,r,e))},t.prototype.normalizeST=function(){return this.transform(u.NORMALIZE_ST())},t.prototype.qtToC=function(){return this.transform(u.QT_TO_C())},t.prototype.aToC=function(){return this.transform(u.A_TO_C())},t.prototype.sanitize=function(t){return this.transform(u.SANITIZE(t))},t.prototype.translate=function(t,r){return this.transform(u.TRANSLATE(t,r))},t.prototype.scale=function(t,r){return this.transform(u.SCALE(t,r))},t.prototype.rotate=function(t,r,e){return this.transform(u.ROTATE(t,r,e))},t.prototype.matrix=function(t,r,e,i,a,n){return this.transform(u.MATRIX(t,r,e,i,a,n))},t.prototype.skewX=function(t){return this.transform(u.SKEW_X(t))},t.prototype.skewY=function(t){return this.transform(u.SKEW_Y(t))},t.prototype.xSymmetry=function(t){return this.transform(u.X_AXIS_SYMMETRY(t))},t.prototype.ySymmetry=function(t){return this.transform(u.Y_AXIS_SYMMETRY(t))},t.prototype.annotateArcs=function(){return this.transform(u.ANNOTATE_ARCS())},t}(),T=function(t){return" "===t||"\t"===t||"\r"===t||"\n"===t},v=function(t){return"0".charCodeAt(0)<=t.charCodeAt(0)&&t.charCodeAt(0)<="9".charCodeAt(0)},f=function(t){function e(){var r=t.call(this)||this;return r.curNumber="",r.curCommandType=-1,r.curCommandRelative=!1,r.canParseCommandOrComma=!0,r.curNumberHasExp=!1,r.curNumberHasExpDigits=!1,r.curNumberHasDecimal=!1,r.curArgs=[],r}return r(e,t),e.prototype.finish=function(t){if(void 0===t&&(t=[]),this.parse(" ",t),0!==this.curArgs.length||!this.canParseCommandOrComma)throw new SyntaxError("Unterminated command at the path end.");return t},e.prototype.parse=function(t,r){var e=this;void 0===r&&(r=[]);for(var i=function(t){r.push(t),e.curArgs.length=0,e.canParseCommandOrComma=!0},a=0;a<t.length;a++){var n=t[a],o=!(this.curCommandType!==_.ARC||3!==this.curArgs.length&&4!==this.curArgs.length||1!==this.curNumber.length||"0"!==this.curNumber&&"1"!==this.curNumber),s=v(n)&&("0"===this.curNumber&&"0"===n||o);if(!v(n)||s)if("e"!==n&&"E"!==n)if("-"!==n&&"+"!==n||!this.curNumberHasExp||this.curNumberHasExpDigits)if("."!==n||this.curNumberHasExp||this.curNumberHasDecimal||o){if(this.curNumber&&-1!==this.curCommandType){var u=Number(this.curNumber);if(isNaN(u))throw new SyntaxError("Invalid number ending at "+a);if(this.curCommandType===_.ARC)if(0===this.curArgs.length||1===this.curArgs.length){if(0>u)throw new SyntaxError('Expected positive number, got "'+u+'" at index "'+a+'"')}else if((3===this.curArgs.length||4===this.curArgs.length)&&"0"!==this.curNumber&&"1"!==this.curNumber)throw new SyntaxError('Expected a flag, got "'+this.curNumber+'" at index "'+a+'"');this.curArgs.push(u),this.curArgs.length===N[this.curCommandType]&&(_.HORIZ_LINE_TO===this.curCommandType?i({type:_.HORIZ_LINE_TO,relative:this.curCommandRelative,x:u}):_.VERT_LINE_TO===this.curCommandType?i({type:_.VERT_LINE_TO,relative:this.curCommandRelative,y:u}):this.curCommandType===_.MOVE_TO||this.curCommandType===_.LINE_TO||this.curCommandType===_.SMOOTH_QUAD_TO?(i({type:this.curCommandType,relative:this.curCommandRelative,x:this.curArgs[0],y:this.curArgs[1]}),_.MOVE_TO===this.curCommandType&&(this.curCommandType=_.LINE_TO)):this.curCommandType===_.CURVE_TO?i({type:_.CURVE_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x2:this.curArgs[2],y2:this.curArgs[3],x:this.curArgs[4],y:this.curArgs[5]}):this.curCommandType===_.SMOOTH_CURVE_TO?i({type:_.SMOOTH_CURVE_TO,relative:this.curCommandRelative,x2:this.curArgs[0],y2:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===_.QUAD_TO?i({type:_.QUAD_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===_.ARC&&i({type:_.ARC,relative:this.curCommandRelative,rX:this.curArgs[0],rY:this.curArgs[1],xRot:this.curArgs[2],lArcFlag:this.curArgs[3],sweepFlag:this.curArgs[4],x:this.curArgs[5],y:this.curArgs[6]})),this.curNumber="",this.curNumberHasExpDigits=!1,this.curNumberHasExp=!1,this.curNumberHasDecimal=!1,this.canParseCommandOrComma=!0}if(!T(n))if(","===n&&this.canParseCommandOrComma)this.canParseCommandOrComma=!1;else if("+"!==n&&"-"!==n&&"."!==n)if(s)this.curNumber=n,this.curNumberHasDecimal=!1;else{if(0!==this.curArgs.length)throw new SyntaxError("Unterminated command at index "+a+".");if(!this.canParseCommandOrComma)throw new SyntaxError('Unexpected character "'+n+'" at index '+a+". Command cannot follow comma");if(this.canParseCommandOrComma=!1,"z"!==n&&"Z"!==n)if("h"===n||"H"===n)this.curCommandType=_.HORIZ_LINE_TO,this.curCommandRelative="h"===n;else if("v"===n||"V"===n)this.curCommandType=_.VERT_LINE_TO,this.curCommandRelative="v"===n;else if("m"===n||"M"===n)this.curCommandType=_.MOVE_TO,this.curCommandRelative="m"===n;else if("l"===n||"L"===n)this.curCommandType=_.LINE_TO,this.curCommandRelative="l"===n;else if("c"===n||"C"===n)this.curCommandType=_.CURVE_TO,this.curCommandRelative="c"===n;else if("s"===n||"S"===n)this.curCommandType=_.SMOOTH_CURVE_TO,this.curCommandRelative="s"===n;else if("q"===n||"Q"===n)this.curCommandType=_.QUAD_TO,this.curCommandRelative="q"===n;else if("t"===n||"T"===n)this.curCommandType=_.SMOOTH_QUAD_TO,this.curCommandRelative="t"===n;else{if("a"!==n&&"A"!==n)throw new SyntaxError('Unexpected character "'+n+'" at index '+a+".");this.curCommandType=_.ARC,this.curCommandRelative="a"===n}else r.push({type:_.CLOSE_PATH}),this.canParseCommandOrComma=!0,this.curCommandType=-1}else this.curNumber=n,this.curNumberHasDecimal="."===n}else this.curNumber+=n,this.curNumberHasDecimal=!0;else this.curNumber+=n;else this.curNumber+=n,this.curNumberHasExp=!0;else this.curNumber+=n,this.curNumberHasExpDigits=this.curNumberHasExp}return r},e.prototype.transform=function(t){return Object.create(this,{parse:{value:function(r,e){void 0===e&&(e=[]);for(var i=0,a=Object.getPrototypeOf(this).parse.call(this,r);i<a.length;i++){var n=a[i],o=t(n);Array.isArray(o)?e.push.apply(e,o):e.push(o)}return e}}})},e}(l),_=function(t){function i(r){var e=t.call(this)||this;return e.commands="string"==typeof r?i.parse(r):r,e}return r(i,t),i.prototype.encode=function(){return i.encode(this.commands)},i.prototype.getBounds=function(){var t=u.CALCULATE_BOUNDS();return this.transform(t),t},i.prototype.transform=function(t){for(var r=[],e=0,i=this.commands;e<i.length;e++){var a=t(i[e]);Array.isArray(a)?r.push.apply(r,a):r.push(a)}return this.commands=r,this},i.encode=function(t){return e(t)},i.parse=function(t){var r=new f,e=[];return r.parse(t,e),r.finish(e),e},i.CLOSE_PATH=1,i.MOVE_TO=2,i.HORIZ_LINE_TO=4,i.VERT_LINE_TO=8,i.LINE_TO=16,i.CURVE_TO=32,i.SMOOTH_CURVE_TO=64,i.QUAD_TO=128,i.SMOOTH_QUAD_TO=256,i.ARC=512,i.LINE_COMMANDS=i.LINE_TO|i.HORIZ_LINE_TO|i.VERT_LINE_TO,i.DRAWING_COMMANDS=i.HORIZ_LINE_TO|i.VERT_LINE_TO|i.LINE_TO|i.CURVE_TO|i.SMOOTH_CURVE_TO|i.QUAD_TO|i.SMOOTH_QUAD_TO|i.ARC,i}(l),N=((O={})[_.MOVE_TO]=2,O[_.LINE_TO]=2,O[_.HORIZ_LINE_TO]=1,O[_.VERT_LINE_TO]=1,O[_.CLOSE_PATH]=0,O[_.QUAD_TO]=4,O[_.SMOOTH_QUAD_TO]=2,O[_.CURVE_TO]=6,O[_.SMOOTH_CURVE_TO]=4,O[_.ARC]=7,O);
  9149. //# sourceMappingURL=SVGPathData.module.js.map
  9150. /***/ })
  9151. }]);
  9152. //# sourceMappingURL=25.js.map