| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971 |
- var Nf = Object.defineProperty;
- var Lf = (n, e, t) => e in n ? Nf(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
- var xe = (n, e, t) => Lf(n, typeof e != "symbol" ? e + "" : e, t);
- import { dq as Se } from "./index2.js";
- var tr = Uint8Array, Rn = Uint16Array, Ko = Int32Array, Xo = new tr([
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 1,
- 1,
- 1,
- 1,
- 2,
- 2,
- 2,
- 2,
- 3,
- 3,
- 3,
- 3,
- 4,
- 4,
- 4,
- 4,
- 5,
- 5,
- 5,
- 5,
- 0,
- /* unused */
- 0,
- 0,
- /* impossible */
- 0
- ]), $o = new tr([
- 0,
- 0,
- 0,
- 0,
- 1,
- 1,
- 2,
- 2,
- 3,
- 3,
- 4,
- 4,
- 5,
- 5,
- 6,
- 6,
- 7,
- 7,
- 8,
- 8,
- 9,
- 9,
- 10,
- 10,
- 11,
- 11,
- 12,
- 12,
- 13,
- 13,
- /* unused */
- 0,
- 0
- ]), Bl = new tr([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]), Ku = function(n, e) {
- for (var t = new Rn(31), i = 0; i < 31; ++i)
- t[i] = e += 1 << n[i - 1];
- for (var s = new Ko(t[30]), i = 1; i < 30; ++i)
- for (var a = t[i]; a < t[i + 1]; ++a)
- s[a] = a - t[i] << 5 | i;
- return { b: t, r: s };
- }, Xu = Ku(Xo, 2), Sf = Xu.b, To = Xu.r;
- Sf[28] = 258, To[258] = 28;
- var kf = Ku($o, 0), Ml = kf.r, Do = new Rn(32768);
- for (var Oe = 0; Oe < 32768; ++Oe) {
- var Kr = (Oe & 43690) >> 1 | (Oe & 21845) << 1;
- Kr = (Kr & 52428) >> 2 | (Kr & 13107) << 2, Kr = (Kr & 61680) >> 4 | (Kr & 3855) << 4, Do[Oe] = ((Kr & 65280) >> 8 | (Kr & 255) << 8) >> 1;
- }
- var Ca = function(n, e, t) {
- for (var i = n.length, s = 0, a = new Rn(e); s < i; ++s)
- n[s] && ++a[n[s] - 1];
- var c = new Rn(e);
- for (s = 1; s < e; ++s)
- c[s] = c[s - 1] + a[s - 1] << 1;
- var l;
- if (t) {
- l = new Rn(1 << e);
- var f = 15 - e;
- for (s = 0; s < i; ++s)
- if (n[s])
- for (var d = s << 4 | n[s], m = e - n[s], _ = c[n[s] - 1]++ << m, k = _ | (1 << m) - 1; _ <= k; ++_)
- l[Do[_] >> f] = d;
- } else
- for (l = new Rn(i), s = 0; s < i; ++s)
- n[s] && (l[s] = Do[c[n[s] - 1]++] >> 15 - n[s]);
- return l;
- }, xi = new tr(288);
- for (var Oe = 0; Oe < 144; ++Oe)
- xi[Oe] = 8;
- for (var Oe = 144; Oe < 256; ++Oe)
- xi[Oe] = 9;
- for (var Oe = 256; Oe < 280; ++Oe)
- xi[Oe] = 7;
- for (var Oe = 280; Oe < 288; ++Oe)
- xi[Oe] = 8;
- var Is = new tr(32);
- for (var Oe = 0; Oe < 32; ++Oe)
- Is[Oe] = 5;
- var Pf = /* @__PURE__ */ Ca(xi, 9, 0), If = /* @__PURE__ */ Ca(Is, 5, 0), $u = function(n) {
- return (n + 7) / 8 | 0;
- }, Ff = function(n, e, t) {
- return (t == null || t > n.length) && (t = n.length), new tr(n.subarray(e, t));
- }, Er = function(n, e, t) {
- t <<= e & 7;
- var i = e / 8 | 0;
- n[i] |= t, n[i + 1] |= t >> 8;
- }, Ia = function(n, e, t) {
- t <<= e & 7;
- var i = e / 8 | 0;
- n[i] |= t, n[i + 1] |= t >> 8, n[i + 2] |= t >> 16;
- }, vo = function(n, e) {
- for (var t = [], i = 0; i < n.length; ++i)
- n[i] && t.push({ s: i, f: n[i] });
- var s = t.length, a = t.slice();
- if (!s)
- return { t: Qu, l: 0 };
- if (s == 1) {
- var c = new tr(t[0].s + 1);
- return c[t[0].s] = 1, { t: c, l: 1 };
- }
- t.sort(function(it, vt) {
- return it.f - vt.f;
- }), t.push({ s: -1, f: 25001 });
- var l = t[0], f = t[1], d = 0, m = 1, _ = 2;
- for (t[0] = { s: -1, f: l.f + f.f, l, r: f }; m != s - 1; )
- l = t[t[d].f < t[_].f ? d++ : _++], f = t[d != m && t[d].f < t[_].f ? d++ : _++], t[m++] = { s: -1, f: l.f + f.f, l, r: f };
- for (var k = a[0].s, i = 1; i < s; ++i)
- a[i].s > k && (k = a[i].s);
- var p = new Rn(k + 1), j = qo(t[m - 1], p, 0);
- if (j > e) {
- var i = 0, O = 0, M = j - e, S = 1 << M;
- for (a.sort(function(vt, dt) {
- return p[dt.s] - p[vt.s] || vt.f - dt.f;
- }); i < s; ++i) {
- var V = a[i].s;
- if (p[V] > e)
- O += S - (1 << j - p[V]), p[V] = e;
- else
- break;
- }
- for (O >>= M; O > 0; ) {
- var G = a[i].s;
- p[G] < e ? O -= 1 << e - p[G]++ - 1 : ++i;
- }
- for (; i >= 0 && O; --i) {
- var q = a[i].s;
- p[q] == e && (--p[q], ++O);
- }
- j = e;
- }
- return { t: new tr(p), l: j };
- }, qo = function(n, e, t) {
- return n.s == -1 ? Math.max(qo(n.l, e, t + 1), qo(n.r, e, t + 1)) : e[n.s] = t;
- }, Rl = function(n) {
- for (var e = n.length; e && !n[--e]; )
- ;
- for (var t = new Rn(++e), i = 0, s = n[0], a = 1, c = function(f) {
- t[i++] = f;
- }, l = 1; l <= e; ++l)
- if (n[l] == s && l != e)
- ++a;
- else {
- if (!s && a > 2) {
- for (; a > 138; a -= 138)
- c(32754);
- a > 2 && (c(a > 10 ? a - 11 << 5 | 28690 : a - 3 << 5 | 12305), a = 0);
- } else if (a > 3) {
- for (c(s), --a; a > 6; a -= 6)
- c(8304);
- a > 2 && (c(a - 3 << 5 | 8208), a = 0);
- }
- for (; a--; )
- c(s);
- a = 1, s = n[l];
- }
- return { c: t.subarray(0, i), n: e };
- }, Fa = function(n, e) {
- for (var t = 0, i = 0; i < e.length; ++i)
- t += n[i] * e[i];
- return t;
- }, Zu = function(n, e, t) {
- var i = t.length, s = $u(e + 2);
- n[s] = i & 255, n[s + 1] = i >> 8, n[s + 2] = n[s] ^ 255, n[s + 3] = n[s + 1] ^ 255;
- for (var a = 0; a < i; ++a)
- n[s + a + 4] = t[a];
- return (s + 4 + i) * 8;
- }, Tl = function(n, e, t, i, s, a, c, l, f, d, m) {
- Er(e, m++, t), ++s[256];
- for (var _ = vo(s, 15), k = _.t, p = _.l, j = vo(a, 15), O = j.t, M = j.l, S = Rl(k), V = S.c, G = S.n, q = Rl(O), it = q.c, vt = q.n, dt = new Rn(19), X = 0; X < V.length; ++X)
- ++dt[V[X] & 31];
- for (var X = 0; X < it.length; ++X)
- ++dt[it[X] & 31];
- for (var R = vo(dt, 7), tt = R.t, N = R.l, E = 19; E > 4 && !tt[Bl[E - 1]]; --E)
- ;
- var z = d + 5 << 3, U = Fa(s, xi) + Fa(a, Is) + c, rt = Fa(s, k) + Fa(a, O) + c + 14 + 3 * E + Fa(dt, tt) + 2 * dt[16] + 3 * dt[17] + 7 * dt[18];
- if (f >= 0 && z <= U && z <= rt)
- return Zu(e, m, n.subarray(f, f + d));
- var ot, ht, nt, ct;
- if (Er(e, m, 1 + (rt < U)), m += 2, rt < U) {
- ot = Ca(k, p, 0), ht = k, nt = Ca(O, M, 0), ct = O;
- var At = Ca(tt, N, 0);
- Er(e, m, G - 257), Er(e, m + 5, vt - 1), Er(e, m + 10, E - 4), m += 14;
- for (var X = 0; X < E; ++X)
- Er(e, m + 3 * X, tt[Bl[X]]);
- m += 3 * E;
- for (var wt = [V, it], x = 0; x < 2; ++x)
- for (var B = wt[x], X = 0; X < B.length; ++X) {
- var T = B[X] & 31;
- Er(e, m, At[T]), m += tt[T], T > 15 && (Er(e, m, B[X] >> 5 & 127), m += B[X] >> 12);
- }
- } else
- ot = Pf, ht = xi, nt = If, ct = Is;
- for (var X = 0; X < l; ++X) {
- var H = i[X];
- if (H > 255) {
- var T = H >> 18 & 31;
- Ia(e, m, ot[T + 257]), m += ht[T + 257], T > 7 && (Er(e, m, H >> 23 & 31), m += Xo[T]);
- var J = H & 31;
- Ia(e, m, nt[J]), m += ct[J], J > 3 && (Ia(e, m, H >> 5 & 8191), m += $o[J]);
- } else
- Ia(e, m, ot[H]), m += ht[H];
- }
- return Ia(e, m, ot[256]), m + ht[256];
- }, Cf = /* @__PURE__ */ new Ko([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]), Qu = /* @__PURE__ */ new tr(0), Ef = function(n, e, t, i, s, a) {
- var c = a.z || n.length, l = new tr(i + c + 5 * (1 + Math.ceil(c / 7e3)) + s), f = l.subarray(i, l.length - s), d = a.l, m = (a.r || 0) & 7;
- if (e) {
- m && (f[0] = a.r >> 3);
- for (var _ = Cf[e - 1], k = _ >> 13, p = _ & 8191, j = (1 << t) - 1, O = a.p || new Rn(32768), M = a.h || new Rn(j + 1), S = Math.ceil(t / 3), V = 2 * S, G = function(Dt) {
- return (n[Dt] ^ n[Dt + 1] << S ^ n[Dt + 2] << V) & j;
- }, q = new Ko(25e3), it = new Rn(288), vt = new Rn(32), dt = 0, X = 0, R = a.i || 0, tt = 0, N = a.w || 0, E = 0; R + 2 < c; ++R) {
- var z = G(R), U = R & 32767, rt = M[z];
- if (O[U] = rt, M[z] = U, N <= R) {
- var ot = c - R;
- if ((dt > 7e3 || tt > 24576) && (ot > 423 || !d)) {
- m = Tl(n, f, 0, q, it, vt, X, tt, E, R - E, m), tt = dt = X = 0, E = R;
- for (var ht = 0; ht < 286; ++ht)
- it[ht] = 0;
- for (var ht = 0; ht < 30; ++ht)
- vt[ht] = 0;
- }
- var nt = 2, ct = 0, At = p, wt = U - rt & 32767;
- if (ot > 2 && z == G(R - wt))
- for (var x = Math.min(k, ot) - 1, B = Math.min(32767, R), T = Math.min(258, ot); wt <= B && --At && U != rt; ) {
- if (n[R + nt] == n[R + nt - wt]) {
- for (var H = 0; H < T && n[R + H] == n[R + H - wt]; ++H)
- ;
- if (H > nt) {
- if (nt = H, ct = wt, H > x)
- break;
- for (var J = Math.min(wt, H - 2), Z = 0, ht = 0; ht < J; ++ht) {
- var at = R - wt + ht & 32767, st = O[at], gt = at - st & 32767;
- gt > Z && (Z = gt, rt = at);
- }
- }
- }
- U = rt, rt = O[U], wt += U - rt & 32767;
- }
- if (ct) {
- q[tt++] = 268435456 | To[nt] << 18 | Ml[ct];
- var _t = To[nt] & 31, kt = Ml[ct] & 31;
- X += Xo[_t] + $o[kt], ++it[257 + _t], ++vt[kt], N = R + nt, ++dt;
- } else
- q[tt++] = n[R], ++it[n[R]];
- }
- }
- for (R = Math.max(R, N); R < c; ++R)
- q[tt++] = n[R], ++it[n[R]];
- m = Tl(n, f, d, q, it, vt, X, tt, E, R - E, m), d || (a.r = m & 7 | f[m / 8 | 0] << 3, m -= 7, a.h = M, a.p = O, a.i = R, a.w = N);
- } else {
- for (var R = a.w || 0; R < c + d; R += 65535) {
- var St = R + 65535;
- St >= c && (f[m / 8 | 0] = d, St = c), m = Zu(f, m + 1, n.subarray(R, St));
- }
- a.i = c;
- }
- return Ff(l, 0, i + $u(m) + s);
- }, th = function() {
- var n = 1, e = 0;
- return {
- p: function(t) {
- for (var i = n, s = e, a = t.length | 0, c = 0; c != a; ) {
- for (var l = Math.min(c + 2655, a); c < l; ++c)
- s += i += t[c];
- i = (i & 65535) + 15 * (i >> 16), s = (s & 65535) + 15 * (s >> 16);
- }
- n = i, e = s;
- },
- d: function() {
- return n %= 65521, e %= 65521, (n & 255) << 24 | (n & 65280) << 8 | (e & 255) << 8 | e >> 8;
- }
- };
- }, Of = function(n, e, t, i, s) {
- if (!s && (s = { l: 1 }, e.dictionary)) {
- var a = e.dictionary.subarray(-32768), c = new tr(a.length + n.length);
- c.set(a), c.set(n, a.length), n = c, s.w = a.length;
- }
- return Ef(n, e.level == null ? 6 : e.level, e.mem == null ? s.l ? Math.ceil(Math.max(8, Math.min(13, Math.log(n.length))) * 1.5) : 20 : 12 + e.mem, t, i, s);
- }, eh = function(n, e, t) {
- for (; t; ++e)
- n[e] = t, t >>>= 8;
- }, jf = function(n, e) {
- var t = e.level, i = t == 0 ? 0 : t < 6 ? 1 : t == 9 ? 3 : 2;
- if (n[0] = 120, n[1] = i << 6 | (e.dictionary && 32), n[1] |= 31 - (n[0] << 8 | n[1]) % 31, e.dictionary) {
- var s = th();
- s.p(e.dictionary), eh(n, 2, s.d());
- }
- };
- function Uo(n, e) {
- e || (e = {});
- var t = th();
- t.p(n);
- var i = Of(n, e, e.dictionary ? 6 : 2, 4);
- return jf(i, e), eh(i, i.length - 4, t.d()), i;
- }
- var Bf = typeof TextDecoder != "undefined" && /* @__PURE__ */ new TextDecoder(), Mf = 0;
- try {
- Bf.decode(Qu, { stream: !0 }), Mf = 1;
- } catch (n) {
- }
- function Rf(n) {
- if (Array.isArray(n)) return n;
- }
- function Tf(n, e) {
- var t = n == null ? null : typeof Symbol != "undefined" && n[Symbol.iterator] || n["@@iterator"];
- if (t != null) {
- var i, s, a, c, l = [], f = !0, d = !1;
- try {
- if (a = (t = t.call(n)).next, e !== 0) for (; !(f = (i = a.call(t)).done) && (l.push(i.value), l.length !== e); f = !0) ;
- } catch (m) {
- d = !0, s = m;
- } finally {
- try {
- if (!f && t.return != null && (c = t.return(), Object(c) !== c)) return;
- } finally {
- if (d) throw s;
- }
- }
- return l;
- }
- }
- function Dl(n, e) {
- (e == null || e > n.length) && (e = n.length);
- for (var t = 0, i = Array(e); t < e; t++) i[t] = n[t];
- return i;
- }
- function Df(n, e) {
- if (n) {
- if (typeof n == "string") return Dl(n, e);
- var t = {}.toString.call(n).slice(8, -1);
- return t === "Object" && n.constructor && (t = n.constructor.name), t === "Map" || t === "Set" ? Array.from(n) : t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? Dl(n, e) : void 0;
- }
- }
- function qf() {
- throw new TypeError(`Invalid attempt to destructure non-iterable instance.
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
- }
- function ql(n, e) {
- return Rf(n) || Tf(n, e) || Df(n, e) || qf();
- }
- function Ul(n, e = "utf8") {
- return new TextDecoder(e).decode(n);
- }
- const Uf = new TextEncoder();
- function zf(n) {
- return Uf.encode(n);
- }
- const Hf = 1024 * 8, Wf = (() => {
- const n = new Uint8Array(4), e = new Uint32Array(n.buffer);
- return !((e[0] = 1) & n[0]);
- })(), bo = {
- int8: globalThis.Int8Array,
- uint8: globalThis.Uint8Array,
- int16: globalThis.Int16Array,
- uint16: globalThis.Uint16Array,
- int32: globalThis.Int32Array,
- uint32: globalThis.Uint32Array,
- uint64: globalThis.BigUint64Array,
- int64: globalThis.BigInt64Array,
- float32: globalThis.Float32Array,
- float64: globalThis.Float64Array
- };
- class Zo {
- /**
- * Create a new IOBuffer.
- * @param data - The data to construct the IOBuffer with.
- * If data is a number, it will be the new buffer's length<br>
- * If data is `undefined`, the buffer will be initialized with a default length of 8Kb<br>
- * If data is an ArrayBuffer, SharedArrayBuffer, an ArrayBufferView (Typed Array), an IOBuffer instance,
- * or a Node.js Buffer, a view will be created over the underlying ArrayBuffer.
- * @param options - An object for the options.
- * @returns A new IOBuffer instance.
- */
- constructor(e = Hf, t = {}) {
- /**
- * Reference to the internal ArrayBuffer object.
- */
- xe(this, "buffer");
- /**
- * Byte length of the internal ArrayBuffer.
- */
- xe(this, "byteLength");
- /**
- * Byte offset of the internal ArrayBuffer.
- */
- xe(this, "byteOffset");
- /**
- * Byte length of the internal ArrayBuffer.
- */
- xe(this, "length");
- /**
- * The current offset of the buffer's pointer.
- */
- xe(this, "offset");
- xe(this, "lastWrittenByte");
- xe(this, "littleEndian");
- xe(this, "_data");
- xe(this, "_mark");
- xe(this, "_marks");
- let i = !1;
- typeof e == "number" ? e = new ArrayBuffer(e) : (i = !0, this.lastWrittenByte = e.byteLength);
- const s = t.offset ? t.offset >>> 0 : 0, a = e.byteLength - s;
- let c = s;
- (ArrayBuffer.isView(e) || e instanceof Zo) && (e.byteLength !== e.buffer.byteLength && (c = e.byteOffset + s), e = e.buffer), i ? this.lastWrittenByte = a : this.lastWrittenByte = 0, this.buffer = e, this.length = a, this.byteLength = a, this.byteOffset = c, this.offset = 0, this.littleEndian = !0, this._data = new DataView(this.buffer, c, a), this._mark = 0, this._marks = [];
- }
- /**
- * Checks if the memory allocated to the buffer is sufficient to store more
- * bytes after the offset.
- * @param byteLength - The needed memory in bytes.
- * @returns `true` if there is sufficient space and `false` otherwise.
- */
- available(e = 1) {
- return this.offset + e <= this.length;
- }
- /**
- * Check if little-endian mode is used for reading and writing multi-byte
- * values.
- * @returns `true` if little-endian mode is used, `false` otherwise.
- */
- isLittleEndian() {
- return this.littleEndian;
- }
- /**
- * Set little-endian mode for reading and writing multi-byte values.
- * @returns This.
- */
- setLittleEndian() {
- return this.littleEndian = !0, this;
- }
- /**
- * Check if big-endian mode is used for reading and writing multi-byte values.
- * @returns `true` if big-endian mode is used, `false` otherwise.
- */
- isBigEndian() {
- return !this.littleEndian;
- }
- /**
- * Switches to big-endian mode for reading and writing multi-byte values.
- * @returns This.
- */
- setBigEndian() {
- return this.littleEndian = !1, this;
- }
- /**
- * Move the pointer n bytes forward.
- * @param n - Number of bytes to skip.
- * @returns This.
- */
- skip(e = 1) {
- return this.offset += e, this;
- }
- /**
- * Move the pointer n bytes backward.
- * @param n - Number of bytes to move back.
- * @returns This.
- */
- back(e = 1) {
- return this.offset -= e, this;
- }
- /**
- * Move the pointer to the given offset.
- * @param offset - The offset to move to.
- * @returns This.
- */
- seek(e) {
- return this.offset = e, this;
- }
- /**
- * Store the current pointer offset.
- * @see {@link IOBuffer#reset}
- * @returns This.
- */
- mark() {
- return this._mark = this.offset, this;
- }
- /**
- * Move the pointer back to the last pointer offset set by mark.
- * @see {@link IOBuffer#mark}
- * @returns This.
- */
- reset() {
- return this.offset = this._mark, this;
- }
- /**
- * Push the current pointer offset to the mark stack.
- * @see {@link IOBuffer#popMark}
- * @returns This.
- */
- pushMark() {
- return this._marks.push(this.offset), this;
- }
- /**
- * Pop the last pointer offset from the mark stack, and set the current
- * pointer offset to the popped value.
- * @see {@link IOBuffer#pushMark}
- * @returns This.
- */
- popMark() {
- const e = this._marks.pop();
- if (e === void 0)
- throw new Error("Mark stack empty");
- return this.seek(e), this;
- }
- /**
- * Move the pointer offset back to 0.
- * @returns This.
- */
- rewind() {
- return this.offset = 0, this;
- }
- /**
- * Make sure the buffer has sufficient memory to write a given byteLength at
- * the current pointer offset.
- * If the buffer's memory is insufficient, this method will create a new
- * buffer (a copy) with a length that is twice (byteLength + current offset).
- * @param byteLength - The needed memory in bytes.
- * @returns This.
- */
- ensureAvailable(e = 1) {
- if (!this.available(e)) {
- const i = (this.offset + e) * 2, s = new Uint8Array(i);
- s.set(new Uint8Array(this.buffer)), this.buffer = s.buffer, this.length = i, this.byteLength = i, this._data = new DataView(this.buffer);
- }
- return this;
- }
- /**
- * Read a byte and return false if the byte's value is 0, or true otherwise.
- * Moves pointer forward by one byte.
- * @returns The read boolean.
- */
- readBoolean() {
- return this.readUint8() !== 0;
- }
- /**
- * Read a signed 8-bit integer and move pointer forward by 1 byte.
- * @returns The read byte.
- */
- readInt8() {
- return this._data.getInt8(this.offset++);
- }
- /**
- * Read an unsigned 8-bit integer and move pointer forward by 1 byte.
- * @returns The read byte.
- */
- readUint8() {
- return this._data.getUint8(this.offset++);
- }
- /**
- * Alias for {@link IOBuffer#readUint8}.
- * @returns The read byte.
- */
- readByte() {
- return this.readUint8();
- }
- /**
- * Read `n` bytes and move pointer forward by `n` bytes.
- * @param n - Number of bytes to read.
- * @returns The read bytes.
- */
- readBytes(e = 1) {
- return this.readArray(e, "uint8");
- }
- /**
- * Creates an array of corresponding to the type `type` and size `size`.
- * For example type `uint8` will create a `Uint8Array`.
- * @param size - size of the resulting array
- * @param type - number type of elements to read
- * @returns The read array.
- */
- readArray(e, t) {
- const i = bo[t].BYTES_PER_ELEMENT * e, s = this.byteOffset + this.offset, a = this.buffer.slice(s, s + i);
- if (this.littleEndian === Wf && t !== "uint8" && t !== "int8") {
- const l = new Uint8Array(this.buffer.slice(s, s + i));
- l.reverse();
- const f = new bo[t](l.buffer);
- return this.offset += i, f.reverse(), f;
- }
- const c = new bo[t](a);
- return this.offset += i, c;
- }
- /**
- * Read a 16-bit signed integer and move pointer forward by 2 bytes.
- * @returns The read value.
- */
- readInt16() {
- const e = this._data.getInt16(this.offset, this.littleEndian);
- return this.offset += 2, e;
- }
- /**
- * Read a 16-bit unsigned integer and move pointer forward by 2 bytes.
- * @returns The read value.
- */
- readUint16() {
- const e = this._data.getUint16(this.offset, this.littleEndian);
- return this.offset += 2, e;
- }
- /**
- * Read a 32-bit signed integer and move pointer forward by 4 bytes.
- * @returns The read value.
- */
- readInt32() {
- const e = this._data.getInt32(this.offset, this.littleEndian);
- return this.offset += 4, e;
- }
- /**
- * Read a 32-bit unsigned integer and move pointer forward by 4 bytes.
- * @returns The read value.
- */
- readUint32() {
- const e = this._data.getUint32(this.offset, this.littleEndian);
- return this.offset += 4, e;
- }
- /**
- * Read a 32-bit floating number and move pointer forward by 4 bytes.
- * @returns The read value.
- */
- readFloat32() {
- const e = this._data.getFloat32(this.offset, this.littleEndian);
- return this.offset += 4, e;
- }
- /**
- * Read a 64-bit floating number and move pointer forward by 8 bytes.
- * @returns The read value.
- */
- readFloat64() {
- const e = this._data.getFloat64(this.offset, this.littleEndian);
- return this.offset += 8, e;
- }
- /**
- * Read a 64-bit signed integer number and move pointer forward by 8 bytes.
- * @returns The read value.
- */
- readBigInt64() {
- const e = this._data.getBigInt64(this.offset, this.littleEndian);
- return this.offset += 8, e;
- }
- /**
- * Read a 64-bit unsigned integer number and move pointer forward by 8 bytes.
- * @returns The read value.
- */
- readBigUint64() {
- const e = this._data.getBigUint64(this.offset, this.littleEndian);
- return this.offset += 8, e;
- }
- /**
- * Read a 1-byte ASCII character and move pointer forward by 1 byte.
- * @returns The read character.
- */
- readChar() {
- return String.fromCharCode(this.readInt8());
- }
- /**
- * Read `n` 1-byte ASCII characters and move pointer forward by `n` bytes.
- * @param n - Number of characters to read.
- * @returns The read characters.
- */
- readChars(e = 1) {
- let t = "";
- for (let i = 0; i < e; i++)
- t += this.readChar();
- return t;
- }
- /**
- * Read the next `n` bytes, return a UTF-8 decoded string and move pointer
- * forward by `n` bytes.
- * @param n - Number of bytes to read.
- * @returns The decoded string.
- */
- readUtf8(e = 1) {
- return Ul(this.readBytes(e));
- }
- /**
- * Read the next `n` bytes, return a string decoded with `encoding` and move pointer
- * forward by `n` bytes.
- * If no encoding is passed, the function is equivalent to @see {@link IOBuffer#readUtf8}
- * @param n - Number of bytes to read.
- * @param encoding - The encoding to use. Default is 'utf8'.
- * @returns The decoded string.
- */
- decodeText(e = 1, t = "utf8") {
- return Ul(this.readBytes(e), t);
- }
- /**
- * Write 0xff if the passed value is truthy, 0x00 otherwise and move pointer
- * forward by 1 byte.
- * @param value - The value to write.
- * @returns This.
- */
- writeBoolean(e) {
- return this.writeUint8(e ? 255 : 0), this;
- }
- /**
- * Write `value` as an 8-bit signed integer and move pointer forward by 1 byte.
- * @param value - The value to write.
- * @returns This.
- */
- writeInt8(e) {
- return this.ensureAvailable(1), this._data.setInt8(this.offset++, e), this._updateLastWrittenByte(), this;
- }
- /**
- * Write `value` as an 8-bit unsigned integer and move pointer forward by 1
- * byte.
- * @param value - The value to write.
- * @returns This.
- */
- writeUint8(e) {
- return this.ensureAvailable(1), this._data.setUint8(this.offset++, e), this._updateLastWrittenByte(), this;
- }
- /**
- * An alias for {@link IOBuffer#writeUint8}.
- * @param value - The value to write.
- * @returns This.
- */
- writeByte(e) {
- return this.writeUint8(e);
- }
- /**
- * Write all elements of `bytes` as uint8 values and move pointer forward by
- * `bytes.length` bytes.
- * @param bytes - The array of bytes to write.
- * @returns This.
- */
- writeBytes(e) {
- this.ensureAvailable(e.length);
- for (let t = 0; t < e.length; t++)
- this._data.setUint8(this.offset++, e[t]);
- return this._updateLastWrittenByte(), this;
- }
- /**
- * Write `value` as a 16-bit signed integer and move pointer forward by 2
- * bytes.
- * @param value - The value to write.
- * @returns This.
- */
- writeInt16(e) {
- return this.ensureAvailable(2), this._data.setInt16(this.offset, e, this.littleEndian), this.offset += 2, this._updateLastWrittenByte(), this;
- }
- /**
- * Write `value` as a 16-bit unsigned integer and move pointer forward by 2
- * bytes.
- * @param value - The value to write.
- * @returns This.
- */
- writeUint16(e) {
- return this.ensureAvailable(2), this._data.setUint16(this.offset, e, this.littleEndian), this.offset += 2, this._updateLastWrittenByte(), this;
- }
- /**
- * Write `value` as a 32-bit signed integer and move pointer forward by 4
- * bytes.
- * @param value - The value to write.
- * @returns This.
- */
- writeInt32(e) {
- return this.ensureAvailable(4), this._data.setInt32(this.offset, e, this.littleEndian), this.offset += 4, this._updateLastWrittenByte(), this;
- }
- /**
- * Write `value` as a 32-bit unsigned integer and move pointer forward by 4
- * bytes.
- * @param value - The value to write.
- * @returns This.
- */
- writeUint32(e) {
- return this.ensureAvailable(4), this._data.setUint32(this.offset, e, this.littleEndian), this.offset += 4, this._updateLastWrittenByte(), this;
- }
- /**
- * Write `value` as a 32-bit floating number and move pointer forward by 4
- * bytes.
- * @param value - The value to write.
- * @returns This.
- */
- writeFloat32(e) {
- return this.ensureAvailable(4), this._data.setFloat32(this.offset, e, this.littleEndian), this.offset += 4, this._updateLastWrittenByte(), this;
- }
- /**
- * Write `value` as a 64-bit floating number and move pointer forward by 8
- * bytes.
- * @param value - The value to write.
- * @returns This.
- */
- writeFloat64(e) {
- return this.ensureAvailable(8), this._data.setFloat64(this.offset, e, this.littleEndian), this.offset += 8, this._updateLastWrittenByte(), this;
- }
- /**
- * Write `value` as a 64-bit signed bigint and move pointer forward by 8
- * bytes.
- * @param value - The value to write.
- * @returns This.
- */
- writeBigInt64(e) {
- return this.ensureAvailable(8), this._data.setBigInt64(this.offset, e, this.littleEndian), this.offset += 8, this._updateLastWrittenByte(), this;
- }
- /**
- * Write `value` as a 64-bit unsigned bigint and move pointer forward by 8
- * bytes.
- * @param value - The value to write.
- * @returns This.
- */
- writeBigUint64(e) {
- return this.ensureAvailable(8), this._data.setBigUint64(this.offset, e, this.littleEndian), this.offset += 8, this._updateLastWrittenByte(), this;
- }
- /**
- * Write the charCode of `str`'s first character as an 8-bit unsigned integer
- * and move pointer forward by 1 byte.
- * @param str - The character to write.
- * @returns This.
- */
- writeChar(e) {
- return this.writeUint8(e.charCodeAt(0));
- }
- /**
- * Write the charCodes of all `str`'s characters as 8-bit unsigned integers
- * and move pointer forward by `str.length` bytes.
- * @param str - The characters to write.
- * @returns This.
- */
- writeChars(e) {
- for (let t = 0; t < e.length; t++)
- this.writeUint8(e.charCodeAt(t));
- return this;
- }
- /**
- * UTF-8 encode and write `str` to the current pointer offset and move pointer
- * forward according to the encoded length.
- * @param str - The string to write.
- * @returns This.
- */
- writeUtf8(e) {
- return this.writeBytes(zf(e));
- }
- /**
- * Export a Uint8Array view of the internal buffer.
- * The view starts at the byte offset and its length
- * is calculated to stop at the last written byte or the original length.
- * @returns A new Uint8Array view.
- */
- toArray() {
- return new Uint8Array(this.buffer, this.byteOffset, this.lastWrittenByte);
- }
- /**
- * Get the total number of bytes written so far, regardless of the current offset.
- * @returns - Total number of bytes.
- */
- getWrittenByteLength() {
- return this.lastWrittenByte - this.byteOffset;
- }
- /**
- * Update the last written byte offset
- * @private
- */
- _updateLastWrittenByte() {
- this.offset > this.lastWrittenByte && (this.lastWrittenByte = this.offset);
- }
- }
- function aa(n) {
- let e = n.length;
- for (; --e >= 0; )
- n[e] = 0;
- }
- const Vf = 3, Gf = 258, nh = 29, Yf = 256, Jf = Yf + 1 + nh, rh = 30, Kf = 512, Xf = new Array((Jf + 2) * 2);
- aa(Xf);
- const $f = new Array(rh * 2);
- aa($f);
- const Zf = new Array(Kf);
- aa(Zf);
- const Qf = new Array(Gf - Vf + 1);
- aa(Qf);
- const tc = new Array(nh);
- aa(tc);
- const ec = new Array(rh);
- aa(ec);
- const nc = (n, e, t, i) => {
- let s = n & 65535 | 0, a = n >>> 16 & 65535 | 0, c = 0;
- for (; t !== 0; ) {
- c = t > 2e3 ? 2e3 : t, t -= c;
- do
- s = s + e[i++] | 0, a = a + s | 0;
- while (--c);
- s %= 65521, a %= 65521;
- }
- return s | a << 16 | 0;
- };
- var zo = nc;
- const rc = () => {
- let n, e = [];
- for (var t = 0; t < 256; t++) {
- n = t;
- for (var i = 0; i < 8; i++)
- n = n & 1 ? 3988292384 ^ n >>> 1 : n >>> 1;
- e[t] = n;
- }
- return e;
- }, ic = new Uint32Array(rc()), ac = (n, e, t, i) => {
- const s = ic, a = i + t;
- n ^= -1;
- for (let c = i; c < a; c++)
- n = n >>> 8 ^ s[(n ^ e[c]) & 255];
- return n ^ -1;
- };
- var dr = ac, Ho = {
- 2: "need dictionary",
- /* Z_NEED_DICT 2 */
- 1: "stream end",
- /* Z_STREAM_END 1 */
- 0: "",
- /* Z_OK 0 */
- "-1": "file error",
- /* Z_ERRNO (-1) */
- "-2": "stream error",
- /* Z_STREAM_ERROR (-2) */
- "-3": "data error",
- /* Z_DATA_ERROR (-3) */
- "-4": "insufficient memory",
- /* Z_MEM_ERROR (-4) */
- "-5": "buffer error",
- /* Z_BUF_ERROR (-5) */
- "-6": "incompatible version"
- /* Z_VERSION_ERROR (-6) */
- }, ih = {
- /* Allowed flush values; see deflate() and inflate() below for details */
- Z_NO_FLUSH: 0,
- Z_FINISH: 4,
- Z_BLOCK: 5,
- Z_TREES: 6,
- /* Return codes for the compression/decompression functions. Negative values
- * are errors, positive values are used for special but normal events.
- */
- Z_OK: 0,
- Z_STREAM_END: 1,
- Z_NEED_DICT: 2,
- Z_STREAM_ERROR: -2,
- Z_DATA_ERROR: -3,
- Z_MEM_ERROR: -4,
- Z_BUF_ERROR: -5,
- /* The deflate compression method */
- Z_DEFLATED: 8
- //Z_NULL: null // Use -1 or null inline, depending on var type
- };
- const sc = (n, e) => Object.prototype.hasOwnProperty.call(n, e);
- var oc = function(n) {
- const e = Array.prototype.slice.call(arguments, 1);
- for (; e.length; ) {
- const t = e.shift();
- if (t) {
- if (typeof t != "object")
- throw new TypeError(t + "must be non-object");
- for (const i in t)
- sc(t, i) && (n[i] = t[i]);
- }
- }
- return n;
- }, lc = (n) => {
- let e = 0;
- for (let i = 0, s = n.length; i < s; i++)
- e += n[i].length;
- const t = new Uint8Array(e);
- for (let i = 0, s = 0, a = n.length; i < a; i++) {
- let c = n[i];
- t.set(c, s), s += c.length;
- }
- return t;
- }, ah = {
- assign: oc,
- flattenChunks: lc
- };
- let sh = !0;
- try {
- String.fromCharCode.apply(null, new Uint8Array(1));
- } catch (n) {
- sh = !1;
- }
- const Oa = new Uint8Array(256);
- for (let n = 0; n < 256; n++)
- Oa[n] = n >= 252 ? 6 : n >= 248 ? 5 : n >= 240 ? 4 : n >= 224 ? 3 : n >= 192 ? 2 : 1;
- Oa[254] = Oa[255] = 1;
- var uc = (n) => {
- if (typeof TextEncoder == "function" && TextEncoder.prototype.encode)
- return new TextEncoder().encode(n);
- let e, t, i, s, a, c = n.length, l = 0;
- for (s = 0; s < c; s++)
- t = n.charCodeAt(s), (t & 64512) === 55296 && s + 1 < c && (i = n.charCodeAt(s + 1), (i & 64512) === 56320 && (t = 65536 + (t - 55296 << 10) + (i - 56320), s++)), l += t < 128 ? 1 : t < 2048 ? 2 : t < 65536 ? 3 : 4;
- for (e = new Uint8Array(l), a = 0, s = 0; a < l; s++)
- t = n.charCodeAt(s), (t & 64512) === 55296 && s + 1 < c && (i = n.charCodeAt(s + 1), (i & 64512) === 56320 && (t = 65536 + (t - 55296 << 10) + (i - 56320), s++)), t < 128 ? e[a++] = t : t < 2048 ? (e[a++] = 192 | t >>> 6, e[a++] = 128 | t & 63) : t < 65536 ? (e[a++] = 224 | t >>> 12, e[a++] = 128 | t >>> 6 & 63, e[a++] = 128 | t & 63) : (e[a++] = 240 | t >>> 18, e[a++] = 128 | t >>> 12 & 63, e[a++] = 128 | t >>> 6 & 63, e[a++] = 128 | t & 63);
- return e;
- };
- const hc = (n, e) => {
- if (e < 65534 && n.subarray && sh)
- return String.fromCharCode.apply(null, n.length === e ? n : n.subarray(0, e));
- let t = "";
- for (let i = 0; i < e; i++)
- t += String.fromCharCode(n[i]);
- return t;
- };
- var fc = (n, e) => {
- const t = e || n.length;
- if (typeof TextDecoder == "function" && TextDecoder.prototype.decode)
- return new TextDecoder().decode(n.subarray(0, e));
- let i, s;
- const a = new Array(t * 2);
- for (s = 0, i = 0; i < t; ) {
- let c = n[i++];
- if (c < 128) {
- a[s++] = c;
- continue;
- }
- let l = Oa[c];
- if (l > 4) {
- a[s++] = 65533, i += l - 1;
- continue;
- }
- for (c &= l === 2 ? 31 : l === 3 ? 15 : 7; l > 1 && i < t; )
- c = c << 6 | n[i++] & 63, l--;
- if (l > 1) {
- a[s++] = 65533;
- continue;
- }
- c < 65536 ? a[s++] = c : (c -= 65536, a[s++] = 55296 | c >> 10 & 1023, a[s++] = 56320 | c & 1023);
- }
- return hc(a, s);
- }, cc = (n, e) => {
- e = e || n.length, e > n.length && (e = n.length);
- let t = e - 1;
- for (; t >= 0 && (n[t] & 192) === 128; )
- t--;
- return t < 0 || t === 0 ? e : t + Oa[n[t]] > e ? t : e;
- }, Wo = {
- string2buf: uc,
- buf2string: fc,
- utf8border: cc
- };
- function dc() {
- this.input = null, this.next_in = 0, this.avail_in = 0, this.total_in = 0, this.output = null, this.next_out = 0, this.avail_out = 0, this.total_out = 0, this.msg = "", this.state = null, this.data_type = 2, this.adler = 0;
- }
- var pc = dc;
- const gs = 16209, gc = 16191;
- var mc = function(e, t) {
- let i, s, a, c, l, f, d, m, _, k, p, j, O, M, S, V, G, q, it, vt, dt, X, R, tt;
- const N = e.state;
- i = e.next_in, R = e.input, s = i + (e.avail_in - 5), a = e.next_out, tt = e.output, c = a - (t - e.avail_out), l = a + (e.avail_out - 257), f = N.dmax, d = N.wsize, m = N.whave, _ = N.wnext, k = N.window, p = N.hold, j = N.bits, O = N.lencode, M = N.distcode, S = (1 << N.lenbits) - 1, V = (1 << N.distbits) - 1;
- t:
- do {
- j < 15 && (p += R[i++] << j, j += 8, p += R[i++] << j, j += 8), G = O[p & S];
- e:
- for (; ; ) {
- if (q = G >>> 24, p >>>= q, j -= q, q = G >>> 16 & 255, q === 0)
- tt[a++] = G & 65535;
- else if (q & 16) {
- it = G & 65535, q &= 15, q && (j < q && (p += R[i++] << j, j += 8), it += p & (1 << q) - 1, p >>>= q, j -= q), j < 15 && (p += R[i++] << j, j += 8, p += R[i++] << j, j += 8), G = M[p & V];
- n:
- for (; ; ) {
- if (q = G >>> 24, p >>>= q, j -= q, q = G >>> 16 & 255, q & 16) {
- if (vt = G & 65535, q &= 15, j < q && (p += R[i++] << j, j += 8, j < q && (p += R[i++] << j, j += 8)), vt += p & (1 << q) - 1, vt > f) {
- e.msg = "invalid distance too far back", N.mode = gs;
- break t;
- }
- if (p >>>= q, j -= q, q = a - c, vt > q) {
- if (q = vt - q, q > m && N.sane) {
- e.msg = "invalid distance too far back", N.mode = gs;
- break t;
- }
- if (dt = 0, X = k, _ === 0) {
- if (dt += d - q, q < it) {
- it -= q;
- do
- tt[a++] = k[dt++];
- while (--q);
- dt = a - vt, X = tt;
- }
- } else if (_ < q) {
- if (dt += d + _ - q, q -= _, q < it) {
- it -= q;
- do
- tt[a++] = k[dt++];
- while (--q);
- if (dt = 0, _ < it) {
- q = _, it -= q;
- do
- tt[a++] = k[dt++];
- while (--q);
- dt = a - vt, X = tt;
- }
- }
- } else if (dt += _ - q, q < it) {
- it -= q;
- do
- tt[a++] = k[dt++];
- while (--q);
- dt = a - vt, X = tt;
- }
- for (; it > 2; )
- tt[a++] = X[dt++], tt[a++] = X[dt++], tt[a++] = X[dt++], it -= 3;
- it && (tt[a++] = X[dt++], it > 1 && (tt[a++] = X[dt++]));
- } else {
- dt = a - vt;
- do
- tt[a++] = tt[dt++], tt[a++] = tt[dt++], tt[a++] = tt[dt++], it -= 3;
- while (it > 2);
- it && (tt[a++] = tt[dt++], it > 1 && (tt[a++] = tt[dt++]));
- }
- } else if (q & 64) {
- e.msg = "invalid distance code", N.mode = gs;
- break t;
- } else {
- G = M[(G & 65535) + (p & (1 << q) - 1)];
- continue n;
- }
- break;
- }
- } else if (q & 64)
- if (q & 32) {
- N.mode = gc;
- break t;
- } else {
- e.msg = "invalid literal/length code", N.mode = gs;
- break t;
- }
- else {
- G = O[(G & 65535) + (p & (1 << q) - 1)];
- continue e;
- }
- break;
- }
- } while (i < s && a < l);
- it = j >> 3, i -= it, j -= it << 3, p &= (1 << j) - 1, e.next_in = i, e.next_out = a, e.avail_in = i < s ? 5 + (s - i) : 5 - (i - s), e.avail_out = a < l ? 257 + (l - a) : 257 - (a - l), N.hold = p, N.bits = j;
- };
- const Ji = 15, zl = 852, Hl = 592, Wl = 0, wo = 1, Vl = 2, vc = new Uint16Array([
- /* Length codes 257..285 base */
- 3,
- 4,
- 5,
- 6,
- 7,
- 8,
- 9,
- 10,
- 11,
- 13,
- 15,
- 17,
- 19,
- 23,
- 27,
- 31,
- 35,
- 43,
- 51,
- 59,
- 67,
- 83,
- 99,
- 115,
- 131,
- 163,
- 195,
- 227,
- 258,
- 0,
- 0
- ]), bc = new Uint8Array([
- /* Length codes 257..285 extra */
- 16,
- 16,
- 16,
- 16,
- 16,
- 16,
- 16,
- 16,
- 17,
- 17,
- 17,
- 17,
- 18,
- 18,
- 18,
- 18,
- 19,
- 19,
- 19,
- 19,
- 20,
- 20,
- 20,
- 20,
- 21,
- 21,
- 21,
- 21,
- 16,
- 199,
- 75
- ]), wc = new Uint16Array([
- /* Distance codes 0..29 base */
- 1,
- 2,
- 3,
- 4,
- 5,
- 7,
- 9,
- 13,
- 17,
- 25,
- 33,
- 49,
- 65,
- 97,
- 129,
- 193,
- 257,
- 385,
- 513,
- 769,
- 1025,
- 1537,
- 2049,
- 3073,
- 4097,
- 6145,
- 8193,
- 12289,
- 16385,
- 24577,
- 0,
- 0
- ]), yc = new Uint8Array([
- /* Distance codes 0..29 extra */
- 16,
- 16,
- 16,
- 16,
- 17,
- 17,
- 18,
- 18,
- 19,
- 19,
- 20,
- 20,
- 21,
- 21,
- 22,
- 22,
- 23,
- 23,
- 24,
- 24,
- 25,
- 25,
- 26,
- 26,
- 27,
- 27,
- 28,
- 28,
- 29,
- 29,
- 64,
- 64
- ]), xc = (n, e, t, i, s, a, c, l) => {
- const f = l.bits;
- let d = 0, m = 0, _ = 0, k = 0, p = 0, j = 0, O = 0, M = 0, S = 0, V = 0, G, q, it, vt, dt, X = null, R;
- const tt = new Uint16Array(Ji + 1), N = new Uint16Array(Ji + 1);
- let E = null, z, U, rt;
- for (d = 0; d <= Ji; d++)
- tt[d] = 0;
- for (m = 0; m < i; m++)
- tt[e[t + m]]++;
- for (p = f, k = Ji; k >= 1 && tt[k] === 0; k--)
- ;
- if (p > k && (p = k), k === 0)
- return s[a++] = 1 << 24 | 64 << 16 | 0, s[a++] = 1 << 24 | 64 << 16 | 0, l.bits = 1, 0;
- for (_ = 1; _ < k && tt[_] === 0; _++)
- ;
- for (p < _ && (p = _), M = 1, d = 1; d <= Ji; d++)
- if (M <<= 1, M -= tt[d], M < 0)
- return -1;
- if (M > 0 && (n === Wl || k !== 1))
- return -1;
- for (N[1] = 0, d = 1; d < Ji; d++)
- N[d + 1] = N[d] + tt[d];
- for (m = 0; m < i; m++)
- e[t + m] !== 0 && (c[N[e[t + m]]++] = m);
- if (n === Wl ? (X = E = c, R = 20) : n === wo ? (X = vc, E = bc, R = 257) : (X = wc, E = yc, R = 0), V = 0, m = 0, d = _, dt = a, j = p, O = 0, it = -1, S = 1 << p, vt = S - 1, n === wo && S > zl || n === Vl && S > Hl)
- return 1;
- for (; ; ) {
- z = d - O, c[m] + 1 < R ? (U = 0, rt = c[m]) : c[m] >= R ? (U = E[c[m] - R], rt = X[c[m] - R]) : (U = 96, rt = 0), G = 1 << d - O, q = 1 << j, _ = q;
- do
- q -= G, s[dt + (V >> O) + q] = z << 24 | U << 16 | rt | 0;
- while (q !== 0);
- for (G = 1 << d - 1; V & G; )
- G >>= 1;
- if (G !== 0 ? (V &= G - 1, V += G) : V = 0, m++, --tt[d] === 0) {
- if (d === k)
- break;
- d = e[t + c[m]];
- }
- if (d > p && (V & vt) !== it) {
- for (O === 0 && (O = p), dt += _, j = d - O, M = 1 << j; j + O < k && (M -= tt[j + O], !(M <= 0)); )
- j++, M <<= 1;
- if (S += 1 << j, n === wo && S > zl || n === Vl && S > Hl)
- return 1;
- it = V & vt, s[it] = p << 24 | j << 16 | dt - a | 0;
- }
- }
- return V !== 0 && (s[dt + V] = d - O << 24 | 64 << 16 | 0), l.bits = p, 0;
- };
- var Ea = xc;
- const _c = 0, oh = 1, lh = 2, {
- Z_FINISH: Gl,
- Z_BLOCK: Ac,
- Z_TREES: ms,
- Z_OK: _i,
- Z_STREAM_END: Nc,
- Z_NEED_DICT: Lc,
- Z_STREAM_ERROR: Vn,
- Z_DATA_ERROR: uh,
- Z_MEM_ERROR: hh,
- Z_BUF_ERROR: Sc,
- Z_DEFLATED: Yl
- } = ih, Os = 16180, Jl = 16181, Kl = 16182, Xl = 16183, $l = 16184, Zl = 16185, Ql = 16186, tu = 16187, eu = 16188, nu = 16189, Fs = 16190, Or = 16191, yo = 16192, ru = 16193, xo = 16194, iu = 16195, au = 16196, su = 16197, ou = 16198, vs = 16199, bs = 16200, lu = 16201, uu = 16202, hu = 16203, fu = 16204, cu = 16205, _o = 16206, du = 16207, pu = 16208, Me = 16209, fh = 16210, ch = 16211, kc = 852, Pc = 592, Ic = 15, Fc = Ic, gu = (n) => (n >>> 24 & 255) + (n >>> 8 & 65280) + ((n & 65280) << 8) + ((n & 255) << 24);
- function Cc() {
- this.strm = null, this.mode = 0, this.last = !1, this.wrap = 0, this.havedict = !1, this.flags = 0, this.dmax = 0, this.check = 0, this.total = 0, this.head = null, this.wbits = 0, this.wsize = 0, this.whave = 0, this.wnext = 0, this.window = null, this.hold = 0, this.bits = 0, this.length = 0, this.offset = 0, this.extra = 0, this.lencode = null, this.distcode = null, this.lenbits = 0, this.distbits = 0, this.ncode = 0, this.nlen = 0, this.ndist = 0, this.have = 0, this.next = null, this.lens = new Uint16Array(320), this.work = new Uint16Array(288), this.lendyn = null, this.distdyn = null, this.sane = 0, this.back = 0, this.was = 0;
- }
- const Ni = (n) => {
- if (!n)
- return 1;
- const e = n.state;
- return !e || e.strm !== n || e.mode < Os || e.mode > ch ? 1 : 0;
- }, dh = (n) => {
- if (Ni(n))
- return Vn;
- const e = n.state;
- return n.total_in = n.total_out = e.total = 0, n.msg = "", e.wrap && (n.adler = e.wrap & 1), e.mode = Os, e.last = 0, e.havedict = 0, e.flags = -1, e.dmax = 32768, e.head = null, e.hold = 0, e.bits = 0, e.lencode = e.lendyn = new Int32Array(kc), e.distcode = e.distdyn = new Int32Array(Pc), e.sane = 1, e.back = -1, _i;
- }, ph = (n) => {
- if (Ni(n))
- return Vn;
- const e = n.state;
- return e.wsize = 0, e.whave = 0, e.wnext = 0, dh(n);
- }, gh = (n, e) => {
- let t;
- if (Ni(n))
- return Vn;
- const i = n.state;
- return e < 0 ? (t = 0, e = -e) : (t = (e >> 4) + 5, e < 48 && (e &= 15)), e && (e < 8 || e > 15) ? Vn : (i.window !== null && i.wbits !== e && (i.window = null), i.wrap = t, i.wbits = e, ph(n));
- }, mh = (n, e) => {
- if (!n)
- return Vn;
- const t = new Cc();
- n.state = t, t.strm = n, t.window = null, t.mode = Os;
- const i = gh(n, e);
- return i !== _i && (n.state = null), i;
- }, Ec = (n) => mh(n, Fc);
- let mu = !0, Ao, No;
- const Oc = (n) => {
- if (mu) {
- Ao = new Int32Array(512), No = new Int32Array(32);
- let e = 0;
- for (; e < 144; )
- n.lens[e++] = 8;
- for (; e < 256; )
- n.lens[e++] = 9;
- for (; e < 280; )
- n.lens[e++] = 7;
- for (; e < 288; )
- n.lens[e++] = 8;
- for (Ea(oh, n.lens, 0, 288, Ao, 0, n.work, { bits: 9 }), e = 0; e < 32; )
- n.lens[e++] = 5;
- Ea(lh, n.lens, 0, 32, No, 0, n.work, { bits: 5 }), mu = !1;
- }
- n.lencode = Ao, n.lenbits = 9, n.distcode = No, n.distbits = 5;
- }, vh = (n, e, t, i) => {
- let s;
- const a = n.state;
- return a.window === null && (a.window = new Uint8Array(1 << a.wbits)), a.wsize === 0 && (a.wsize = 1 << a.wbits, a.wnext = 0, a.whave = 0), i >= a.wsize ? (a.window.set(e.subarray(t - a.wsize, t), 0), a.wnext = 0, a.whave = a.wsize) : (s = a.wsize - a.wnext, s > i && (s = i), a.window.set(e.subarray(t - i, t - i + s), a.wnext), i -= s, i ? (a.window.set(e.subarray(t - i, t), 0), a.wnext = i, a.whave = a.wsize) : (a.wnext += s, a.wnext === a.wsize && (a.wnext = 0), a.whave < a.wsize && (a.whave += s))), 0;
- }, jc = (n, e) => {
- let t, i, s, a, c, l, f, d, m, _, k, p, j, O, M = 0, S, V, G, q, it, vt, dt, X;
- const R = new Uint8Array(4);
- let tt, N;
- const E = (
- /* permutation of code lengths */
- new Uint8Array([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15])
- );
- if (Ni(n) || !n.output || !n.input && n.avail_in !== 0)
- return Vn;
- t = n.state, t.mode === Or && (t.mode = yo), c = n.next_out, s = n.output, f = n.avail_out, a = n.next_in, i = n.input, l = n.avail_in, d = t.hold, m = t.bits, _ = l, k = f, X = _i;
- t:
- for (; ; )
- switch (t.mode) {
- case Os:
- if (t.wrap === 0) {
- t.mode = yo;
- break;
- }
- for (; m < 16; ) {
- if (l === 0)
- break t;
- l--, d += i[a++] << m, m += 8;
- }
- if (t.wrap & 2 && d === 35615) {
- t.wbits === 0 && (t.wbits = 15), t.check = 0, R[0] = d & 255, R[1] = d >>> 8 & 255, t.check = dr(t.check, R, 2, 0), d = 0, m = 0, t.mode = Jl;
- break;
- }
- if (t.head && (t.head.done = !1), !(t.wrap & 1) || /* check if zlib header allowed */
- (((d & 255) << 8) + (d >> 8)) % 31) {
- n.msg = "incorrect header check", t.mode = Me;
- break;
- }
- if ((d & 15) !== Yl) {
- n.msg = "unknown compression method", t.mode = Me;
- break;
- }
- if (d >>>= 4, m -= 4, dt = (d & 15) + 8, t.wbits === 0 && (t.wbits = dt), dt > 15 || dt > t.wbits) {
- n.msg = "invalid window size", t.mode = Me;
- break;
- }
- t.dmax = 1 << t.wbits, t.flags = 0, n.adler = t.check = 1, t.mode = d & 512 ? nu : Or, d = 0, m = 0;
- break;
- case Jl:
- for (; m < 16; ) {
- if (l === 0)
- break t;
- l--, d += i[a++] << m, m += 8;
- }
- if (t.flags = d, (t.flags & 255) !== Yl) {
- n.msg = "unknown compression method", t.mode = Me;
- break;
- }
- if (t.flags & 57344) {
- n.msg = "unknown header flags set", t.mode = Me;
- break;
- }
- t.head && (t.head.text = d >> 8 & 1), t.flags & 512 && t.wrap & 4 && (R[0] = d & 255, R[1] = d >>> 8 & 255, t.check = dr(t.check, R, 2, 0)), d = 0, m = 0, t.mode = Kl;
- case Kl:
- for (; m < 32; ) {
- if (l === 0)
- break t;
- l--, d += i[a++] << m, m += 8;
- }
- t.head && (t.head.time = d), t.flags & 512 && t.wrap & 4 && (R[0] = d & 255, R[1] = d >>> 8 & 255, R[2] = d >>> 16 & 255, R[3] = d >>> 24 & 255, t.check = dr(t.check, R, 4, 0)), d = 0, m = 0, t.mode = Xl;
- case Xl:
- for (; m < 16; ) {
- if (l === 0)
- break t;
- l--, d += i[a++] << m, m += 8;
- }
- t.head && (t.head.xflags = d & 255, t.head.os = d >> 8), t.flags & 512 && t.wrap & 4 && (R[0] = d & 255, R[1] = d >>> 8 & 255, t.check = dr(t.check, R, 2, 0)), d = 0, m = 0, t.mode = $l;
- case $l:
- if (t.flags & 1024) {
- for (; m < 16; ) {
- if (l === 0)
- break t;
- l--, d += i[a++] << m, m += 8;
- }
- t.length = d, t.head && (t.head.extra_len = d), t.flags & 512 && t.wrap & 4 && (R[0] = d & 255, R[1] = d >>> 8 & 255, t.check = dr(t.check, R, 2, 0)), d = 0, m = 0;
- } else t.head && (t.head.extra = null);
- t.mode = Zl;
- case Zl:
- if (t.flags & 1024 && (p = t.length, p > l && (p = l), p && (t.head && (dt = t.head.extra_len - t.length, t.head.extra || (t.head.extra = new Uint8Array(t.head.extra_len)), t.head.extra.set(
- i.subarray(
- a,
- // extra field is limited to 65536 bytes
- // - no need for additional size check
- a + p
- ),
- /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/
- dt
- )), t.flags & 512 && t.wrap & 4 && (t.check = dr(t.check, i, p, a)), l -= p, a += p, t.length -= p), t.length))
- break t;
- t.length = 0, t.mode = Ql;
- case Ql:
- if (t.flags & 2048) {
- if (l === 0)
- break t;
- p = 0;
- do
- dt = i[a + p++], t.head && dt && t.length < 65536 && (t.head.name += String.fromCharCode(dt));
- while (dt && p < l);
- if (t.flags & 512 && t.wrap & 4 && (t.check = dr(t.check, i, p, a)), l -= p, a += p, dt)
- break t;
- } else t.head && (t.head.name = null);
- t.length = 0, t.mode = tu;
- case tu:
- if (t.flags & 4096) {
- if (l === 0)
- break t;
- p = 0;
- do
- dt = i[a + p++], t.head && dt && t.length < 65536 && (t.head.comment += String.fromCharCode(dt));
- while (dt && p < l);
- if (t.flags & 512 && t.wrap & 4 && (t.check = dr(t.check, i, p, a)), l -= p, a += p, dt)
- break t;
- } else t.head && (t.head.comment = null);
- t.mode = eu;
- case eu:
- if (t.flags & 512) {
- for (; m < 16; ) {
- if (l === 0)
- break t;
- l--, d += i[a++] << m, m += 8;
- }
- if (t.wrap & 4 && d !== (t.check & 65535)) {
- n.msg = "header crc mismatch", t.mode = Me;
- break;
- }
- d = 0, m = 0;
- }
- t.head && (t.head.hcrc = t.flags >> 9 & 1, t.head.done = !0), n.adler = t.check = 0, t.mode = Or;
- break;
- case nu:
- for (; m < 32; ) {
- if (l === 0)
- break t;
- l--, d += i[a++] << m, m += 8;
- }
- n.adler = t.check = gu(d), d = 0, m = 0, t.mode = Fs;
- case Fs:
- if (t.havedict === 0)
- return n.next_out = c, n.avail_out = f, n.next_in = a, n.avail_in = l, t.hold = d, t.bits = m, Lc;
- n.adler = t.check = 1, t.mode = Or;
- case Or:
- if (e === Ac || e === ms)
- break t;
- case yo:
- if (t.last) {
- d >>>= m & 7, m -= m & 7, t.mode = _o;
- break;
- }
- for (; m < 3; ) {
- if (l === 0)
- break t;
- l--, d += i[a++] << m, m += 8;
- }
- switch (t.last = d & 1, d >>>= 1, m -= 1, d & 3) {
- case 0:
- t.mode = ru;
- break;
- case 1:
- if (Oc(t), t.mode = vs, e === ms) {
- d >>>= 2, m -= 2;
- break t;
- }
- break;
- case 2:
- t.mode = au;
- break;
- case 3:
- n.msg = "invalid block type", t.mode = Me;
- }
- d >>>= 2, m -= 2;
- break;
- case ru:
- for (d >>>= m & 7, m -= m & 7; m < 32; ) {
- if (l === 0)
- break t;
- l--, d += i[a++] << m, m += 8;
- }
- if ((d & 65535) !== (d >>> 16 ^ 65535)) {
- n.msg = "invalid stored block lengths", t.mode = Me;
- break;
- }
- if (t.length = d & 65535, d = 0, m = 0, t.mode = xo, e === ms)
- break t;
- case xo:
- t.mode = iu;
- case iu:
- if (p = t.length, p) {
- if (p > l && (p = l), p > f && (p = f), p === 0)
- break t;
- s.set(i.subarray(a, a + p), c), l -= p, a += p, f -= p, c += p, t.length -= p;
- break;
- }
- t.mode = Or;
- break;
- case au:
- for (; m < 14; ) {
- if (l === 0)
- break t;
- l--, d += i[a++] << m, m += 8;
- }
- if (t.nlen = (d & 31) + 257, d >>>= 5, m -= 5, t.ndist = (d & 31) + 1, d >>>= 5, m -= 5, t.ncode = (d & 15) + 4, d >>>= 4, m -= 4, t.nlen > 286 || t.ndist > 30) {
- n.msg = "too many length or distance symbols", t.mode = Me;
- break;
- }
- t.have = 0, t.mode = su;
- case su:
- for (; t.have < t.ncode; ) {
- for (; m < 3; ) {
- if (l === 0)
- break t;
- l--, d += i[a++] << m, m += 8;
- }
- t.lens[E[t.have++]] = d & 7, d >>>= 3, m -= 3;
- }
- for (; t.have < 19; )
- t.lens[E[t.have++]] = 0;
- if (t.lencode = t.lendyn, t.lenbits = 7, tt = { bits: t.lenbits }, X = Ea(_c, t.lens, 0, 19, t.lencode, 0, t.work, tt), t.lenbits = tt.bits, X) {
- n.msg = "invalid code lengths set", t.mode = Me;
- break;
- }
- t.have = 0, t.mode = ou;
- case ou:
- for (; t.have < t.nlen + t.ndist; ) {
- for (; M = t.lencode[d & (1 << t.lenbits) - 1], S = M >>> 24, V = M >>> 16 & 255, G = M & 65535, !(S <= m); ) {
- if (l === 0)
- break t;
- l--, d += i[a++] << m, m += 8;
- }
- if (G < 16)
- d >>>= S, m -= S, t.lens[t.have++] = G;
- else {
- if (G === 16) {
- for (N = S + 2; m < N; ) {
- if (l === 0)
- break t;
- l--, d += i[a++] << m, m += 8;
- }
- if (d >>>= S, m -= S, t.have === 0) {
- n.msg = "invalid bit length repeat", t.mode = Me;
- break;
- }
- dt = t.lens[t.have - 1], p = 3 + (d & 3), d >>>= 2, m -= 2;
- } else if (G === 17) {
- for (N = S + 3; m < N; ) {
- if (l === 0)
- break t;
- l--, d += i[a++] << m, m += 8;
- }
- d >>>= S, m -= S, dt = 0, p = 3 + (d & 7), d >>>= 3, m -= 3;
- } else {
- for (N = S + 7; m < N; ) {
- if (l === 0)
- break t;
- l--, d += i[a++] << m, m += 8;
- }
- d >>>= S, m -= S, dt = 0, p = 11 + (d & 127), d >>>= 7, m -= 7;
- }
- if (t.have + p > t.nlen + t.ndist) {
- n.msg = "invalid bit length repeat", t.mode = Me;
- break;
- }
- for (; p--; )
- t.lens[t.have++] = dt;
- }
- }
- if (t.mode === Me)
- break;
- if (t.lens[256] === 0) {
- n.msg = "invalid code -- missing end-of-block", t.mode = Me;
- break;
- }
- if (t.lenbits = 9, tt = { bits: t.lenbits }, X = Ea(oh, t.lens, 0, t.nlen, t.lencode, 0, t.work, tt), t.lenbits = tt.bits, X) {
- n.msg = "invalid literal/lengths set", t.mode = Me;
- break;
- }
- if (t.distbits = 6, t.distcode = t.distdyn, tt = { bits: t.distbits }, X = Ea(lh, t.lens, t.nlen, t.ndist, t.distcode, 0, t.work, tt), t.distbits = tt.bits, X) {
- n.msg = "invalid distances set", t.mode = Me;
- break;
- }
- if (t.mode = vs, e === ms)
- break t;
- case vs:
- t.mode = bs;
- case bs:
- if (l >= 6 && f >= 258) {
- n.next_out = c, n.avail_out = f, n.next_in = a, n.avail_in = l, t.hold = d, t.bits = m, mc(n, k), c = n.next_out, s = n.output, f = n.avail_out, a = n.next_in, i = n.input, l = n.avail_in, d = t.hold, m = t.bits, t.mode === Or && (t.back = -1);
- break;
- }
- for (t.back = 0; M = t.lencode[d & (1 << t.lenbits) - 1], S = M >>> 24, V = M >>> 16 & 255, G = M & 65535, !(S <= m); ) {
- if (l === 0)
- break t;
- l--, d += i[a++] << m, m += 8;
- }
- if (V && !(V & 240)) {
- for (q = S, it = V, vt = G; M = t.lencode[vt + ((d & (1 << q + it) - 1) >> q)], S = M >>> 24, V = M >>> 16 & 255, G = M & 65535, !(q + S <= m); ) {
- if (l === 0)
- break t;
- l--, d += i[a++] << m, m += 8;
- }
- d >>>= q, m -= q, t.back += q;
- }
- if (d >>>= S, m -= S, t.back += S, t.length = G, V === 0) {
- t.mode = cu;
- break;
- }
- if (V & 32) {
- t.back = -1, t.mode = Or;
- break;
- }
- if (V & 64) {
- n.msg = "invalid literal/length code", t.mode = Me;
- break;
- }
- t.extra = V & 15, t.mode = lu;
- case lu:
- if (t.extra) {
- for (N = t.extra; m < N; ) {
- if (l === 0)
- break t;
- l--, d += i[a++] << m, m += 8;
- }
- t.length += d & (1 << t.extra) - 1, d >>>= t.extra, m -= t.extra, t.back += t.extra;
- }
- t.was = t.length, t.mode = uu;
- case uu:
- for (; M = t.distcode[d & (1 << t.distbits) - 1], S = M >>> 24, V = M >>> 16 & 255, G = M & 65535, !(S <= m); ) {
- if (l === 0)
- break t;
- l--, d += i[a++] << m, m += 8;
- }
- if (!(V & 240)) {
- for (q = S, it = V, vt = G; M = t.distcode[vt + ((d & (1 << q + it) - 1) >> q)], S = M >>> 24, V = M >>> 16 & 255, G = M & 65535, !(q + S <= m); ) {
- if (l === 0)
- break t;
- l--, d += i[a++] << m, m += 8;
- }
- d >>>= q, m -= q, t.back += q;
- }
- if (d >>>= S, m -= S, t.back += S, V & 64) {
- n.msg = "invalid distance code", t.mode = Me;
- break;
- }
- t.offset = G, t.extra = V & 15, t.mode = hu;
- case hu:
- if (t.extra) {
- for (N = t.extra; m < N; ) {
- if (l === 0)
- break t;
- l--, d += i[a++] << m, m += 8;
- }
- t.offset += d & (1 << t.extra) - 1, d >>>= t.extra, m -= t.extra, t.back += t.extra;
- }
- if (t.offset > t.dmax) {
- n.msg = "invalid distance too far back", t.mode = Me;
- break;
- }
- t.mode = fu;
- case fu:
- if (f === 0)
- break t;
- if (p = k - f, t.offset > p) {
- if (p = t.offset - p, p > t.whave && t.sane) {
- n.msg = "invalid distance too far back", t.mode = Me;
- break;
- }
- p > t.wnext ? (p -= t.wnext, j = t.wsize - p) : j = t.wnext - p, p > t.length && (p = t.length), O = t.window;
- } else
- O = s, j = c - t.offset, p = t.length;
- p > f && (p = f), f -= p, t.length -= p;
- do
- s[c++] = O[j++];
- while (--p);
- t.length === 0 && (t.mode = bs);
- break;
- case cu:
- if (f === 0)
- break t;
- s[c++] = t.length, f--, t.mode = bs;
- break;
- case _o:
- if (t.wrap) {
- for (; m < 32; ) {
- if (l === 0)
- break t;
- l--, d |= i[a++] << m, m += 8;
- }
- if (k -= f, n.total_out += k, t.total += k, t.wrap & 4 && k && (n.adler = t.check = /*UPDATE_CHECK(state.check, put - _out, _out);*/
- t.flags ? dr(t.check, s, k, c - k) : zo(t.check, s, k, c - k)), k = f, t.wrap & 4 && (t.flags ? d : gu(d)) !== t.check) {
- n.msg = "incorrect data check", t.mode = Me;
- break;
- }
- d = 0, m = 0;
- }
- t.mode = du;
- case du:
- if (t.wrap && t.flags) {
- for (; m < 32; ) {
- if (l === 0)
- break t;
- l--, d += i[a++] << m, m += 8;
- }
- if (t.wrap & 4 && d !== (t.total & 4294967295)) {
- n.msg = "incorrect length check", t.mode = Me;
- break;
- }
- d = 0, m = 0;
- }
- t.mode = pu;
- case pu:
- X = Nc;
- break t;
- case Me:
- X = uh;
- break t;
- case fh:
- return hh;
- case ch:
- default:
- return Vn;
- }
- return n.next_out = c, n.avail_out = f, n.next_in = a, n.avail_in = l, t.hold = d, t.bits = m, (t.wsize || k !== n.avail_out && t.mode < Me && (t.mode < _o || e !== Gl)) && vh(n, n.output, n.next_out, k - n.avail_out), _ -= n.avail_in, k -= n.avail_out, n.total_in += _, n.total_out += k, t.total += k, t.wrap & 4 && k && (n.adler = t.check = /*UPDATE_CHECK(state.check, strm.next_out - _out, _out);*/
- t.flags ? dr(t.check, s, k, n.next_out - k) : zo(t.check, s, k, n.next_out - k)), n.data_type = t.bits + (t.last ? 64 : 0) + (t.mode === Or ? 128 : 0) + (t.mode === vs || t.mode === xo ? 256 : 0), (_ === 0 && k === 0 || e === Gl) && X === _i && (X = Sc), X;
- }, Bc = (n) => {
- if (Ni(n))
- return Vn;
- let e = n.state;
- return e.window && (e.window = null), n.state = null, _i;
- }, Mc = (n, e) => {
- if (Ni(n))
- return Vn;
- const t = n.state;
- return t.wrap & 2 ? (t.head = e, e.done = !1, _i) : Vn;
- }, Rc = (n, e) => {
- const t = e.length;
- let i, s, a;
- return Ni(n) || (i = n.state, i.wrap !== 0 && i.mode !== Fs) ? Vn : i.mode === Fs && (s = 1, s = zo(s, e, t, 0), s !== i.check) ? uh : (a = vh(n, e, t, t), a ? (i.mode = fh, hh) : (i.havedict = 1, _i));
- };
- var Tc = ph, Dc = gh, qc = dh, Uc = Ec, zc = mh, Hc = jc, Wc = Bc, Vc = Mc, Gc = Rc, Yc = "pako inflate (from Nodeca project)", gr = {
- inflateReset: Tc,
- inflateReset2: Dc,
- inflateResetKeep: qc,
- inflateInit: Uc,
- inflateInit2: zc,
- inflate: Hc,
- inflateEnd: Wc,
- inflateGetHeader: Vc,
- inflateSetDictionary: Gc,
- inflateInfo: Yc
- };
- function Jc() {
- this.text = 0, this.time = 0, this.xflags = 0, this.os = 0, this.extra = null, this.extra_len = 0, this.name = "", this.comment = "", this.hcrc = 0, this.done = !1;
- }
- var Kc = Jc;
- const bh = Object.prototype.toString, {
- Z_NO_FLUSH: Xc,
- Z_FINISH: vu,
- Z_OK: ta,
- Z_STREAM_END: Lo,
- Z_NEED_DICT: So,
- Z_STREAM_ERROR: $c,
- Z_DATA_ERROR: bu,
- Z_MEM_ERROR: Zc,
- Z_BUF_ERROR: wu
- } = ih, Qc = {
- chunkSize: 1024 * 64,
- windowBits: 15,
- to: ""
- };
- function ja(n) {
- this.options = ah.assign({}, Qc, n || {});
- const e = this.options;
- e.raw && e.windowBits >= 0 && e.windowBits < 16 && (e.windowBits = -e.windowBits, e.windowBits === 0 && (e.windowBits = -15)), e.windowBits >= 0 && e.windowBits < 16 && !(n && n.windowBits) && (e.windowBits += 32), e.windowBits > 15 && e.windowBits < 48 && (e.windowBits & 15 || (e.windowBits |= 15)), this.err = 0, this.msg = "", this.ended = !1, this.chunks = [], this.strm = new pc(), this.strm.avail_out = 0;
- let t = gr.inflateInit2(
- this.strm,
- e.windowBits
- );
- if (t !== ta)
- throw new Error(Ho[t]);
- if (this.header = new Kc(), gr.inflateGetHeader(this.strm, this.header), e.dictionary && (typeof e.dictionary == "string" ? e.dictionary = Wo.string2buf(e.dictionary) : bh.call(e.dictionary) === "[object ArrayBuffer]" && (e.dictionary = new Uint8Array(e.dictionary)), e.raw && (t = gr.inflateSetDictionary(this.strm, e.dictionary), t !== ta)))
- throw new Error(Ho[t]);
- }
- ja.prototype.push = function(n, e) {
- const t = this.strm, i = this.options.chunkSize, s = this.options.dictionary;
- let a, c, l;
- if (this.ended) return !1;
- for (e === ~~e ? c = e : c = e === !0 ? vu : Xc, bh.call(n) === "[object ArrayBuffer]" ? t.input = new Uint8Array(n) : t.input = n, t.next_in = 0, t.avail_in = t.input.length; ; ) {
- for (t.avail_out === 0 && (t.output = new Uint8Array(i), t.next_out = 0, t.avail_out = i), a = gr.inflate(t, c), a === So && s && (a = gr.inflateSetDictionary(t, s), a === ta ? a = gr.inflate(t, c) : a === bu && (a = So)); t.avail_in > 0 && a === Lo && t.state.wrap & 2 && t.state.flags !== 0 && t.input[t.next_in] !== 0; )
- gr.inflateReset(t), a = gr.inflate(t, c);
- switch (a) {
- case $c:
- case bu:
- case So:
- case Zc:
- return this.onEnd(a), this.ended = !0, !1;
- }
- if (l = t.avail_out, t.next_out && (t.avail_out === 0 || a === Lo || c > 0))
- if (this.options.to === "string") {
- let f = Wo.utf8border(t.output, t.next_out), d = t.next_out - f, m = Wo.buf2string(t.output, f);
- t.next_out = d, t.avail_out = i - d, d && t.output.set(t.output.subarray(f, f + d), 0), this.onData(m);
- } else
- this.onData(t.output.length === t.next_out ? t.output : t.output.subarray(0, t.next_out)), t.avail_out = 0, t.next_out = 0;
- if (!((a === ta || a === wu) && l === 0)) {
- if (a === Lo)
- return a = gr.inflateEnd(this.strm), this.onEnd(a), this.ended = !0, !0;
- if (t.avail_in === 0) {
- if (c === vu)
- return a = gr.inflateEnd(this.strm), this.onEnd(a === ta ? wu : a), this.ended = !0, !1;
- break;
- }
- }
- }
- return !0;
- };
- ja.prototype.onData = function(n) {
- this.chunks.push(n);
- };
- ja.prototype.onEnd = function(n) {
- n === ta && (this.options.to === "string" ? this.result = this.chunks.join("") : this.result = ah.flattenChunks(this.chunks)), this.chunks = [], this.err = n, this.msg = this.strm.msg;
- };
- function t1(n, e) {
- const t = new ja(e);
- if (t.push(n, !0), t.err) throw t.msg || Ho[t.err];
- return t.result;
- }
- var e1 = ja, n1 = t1, r1 = {
- Inflate: e1,
- inflate: n1
- };
- const { Inflate: i1, inflate: a1 } = r1;
- var yu = i1, s1 = a1;
- const wh = [];
- for (let n = 0; n < 256; n++) {
- let e = n;
- for (let t = 0; t < 8; t++)
- e & 1 ? e = 3988292384 ^ e >>> 1 : e = e >>> 1;
- wh[n] = e;
- }
- const xu = 4294967295;
- function o1(n, e, t) {
- let i = n;
- for (let s = 0; s < t; s++)
- i = wh[(i ^ e[s]) & 255] ^ i >>> 8;
- return i;
- }
- function l1(n, e) {
- return (o1(xu, n, e) ^ xu) >>> 0;
- }
- function _u(n, e, t) {
- const i = n.readUint32(), s = l1(new Uint8Array(n.buffer, n.byteOffset + n.offset - e - 4, e), e);
- if (s !== i)
- throw new Error(`CRC mismatch for chunk ${t}. Expected ${i}, found ${s}`);
- }
- function yh(n, e, t) {
- for (let i = 0; i < t; i++)
- e[i] = n[i];
- }
- function xh(n, e, t, i) {
- let s = 0;
- for (; s < i; s++)
- e[s] = n[s];
- for (; s < t; s++)
- e[s] = n[s] + e[s - i] & 255;
- }
- function _h(n, e, t, i) {
- let s = 0;
- if (t.length === 0)
- for (; s < i; s++)
- e[s] = n[s];
- else
- for (; s < i; s++)
- e[s] = n[s] + t[s] & 255;
- }
- function Ah(n, e, t, i, s) {
- let a = 0;
- if (t.length === 0) {
- for (; a < s; a++)
- e[a] = n[a];
- for (; a < i; a++)
- e[a] = n[a] + (e[a - s] >> 1) & 255;
- } else {
- for (; a < s; a++)
- e[a] = n[a] + (t[a] >> 1) & 255;
- for (; a < i; a++)
- e[a] = n[a] + (e[a - s] + t[a] >> 1) & 255;
- }
- }
- function Nh(n, e, t, i, s) {
- let a = 0;
- if (t.length === 0) {
- for (; a < s; a++)
- e[a] = n[a];
- for (; a < i; a++)
- e[a] = n[a] + e[a - s] & 255;
- } else {
- for (; a < s; a++)
- e[a] = n[a] + t[a] & 255;
- for (; a < i; a++)
- e[a] = n[a] + u1(e[a - s], t[a], t[a - s]) & 255;
- }
- }
- function u1(n, e, t) {
- const i = n + e - t, s = Math.abs(i - n), a = Math.abs(i - e), c = Math.abs(i - t);
- return s <= a && s <= c ? n : a <= c ? e : t;
- }
- function h1(n, e, t, i, s, a) {
- switch (n) {
- case 0:
- yh(e, t, s);
- break;
- case 1:
- xh(e, t, s, a);
- break;
- case 2:
- _h(e, t, i, s);
- break;
- case 3:
- Ah(e, t, i, s, a);
- break;
- case 4:
- Nh(e, t, i, s, a);
- break;
- default:
- throw new Error(`Unsupported filter: ${n}`);
- }
- }
- const f1 = new Uint16Array([255]), c1 = new Uint8Array(f1.buffer), d1 = c1[0] === 255;
- function p1(n) {
- const { data: e, width: t, height: i, channels: s, depth: a } = n, c = [
- { x: 0, y: 0, xStep: 8, yStep: 8 },
- // Pass 1
- { x: 4, y: 0, xStep: 8, yStep: 8 },
- // Pass 2
- { x: 0, y: 4, xStep: 4, yStep: 8 },
- // Pass 3
- { x: 2, y: 0, xStep: 4, yStep: 4 },
- // Pass 4
- { x: 0, y: 2, xStep: 2, yStep: 4 },
- // Pass 5
- { x: 1, y: 0, xStep: 2, yStep: 2 },
- // Pass 6
- { x: 0, y: 1, xStep: 1, yStep: 2 }
- // Pass 7
- ], l = Math.ceil(a / 8) * s, f = new Uint8Array(i * t * l);
- let d = 0;
- for (let m = 0; m < 7; m++) {
- const _ = c[m], k = Math.ceil((t - _.x) / _.xStep), p = Math.ceil((i - _.y) / _.yStep);
- if (k <= 0 || p <= 0)
- continue;
- const j = k * l, O = new Uint8Array(j);
- for (let M = 0; M < p; M++) {
- const S = e[d++], V = e.subarray(d, d + j);
- d += j;
- const G = new Uint8Array(j);
- h1(S, V, G, O, j, l), O.set(G);
- for (let q = 0; q < k; q++) {
- const it = _.x + q * _.xStep, vt = _.y + M * _.yStep;
- if (!(it >= t || vt >= i))
- for (let dt = 0; dt < l; dt++)
- f[(vt * t + it) * l + dt] = G[q * l + dt];
- }
- }
- }
- if (a === 16) {
- const m = new Uint16Array(f.buffer);
- if (d1)
- for (let _ = 0; _ < m.length; _++)
- m[_] = g1(m[_]);
- return m;
- } else
- return f;
- }
- function g1(n) {
- return (n & 255) << 8 | n >> 8 & 255;
- }
- const m1 = new Uint16Array([255]), v1 = new Uint8Array(m1.buffer), b1 = v1[0] === 255, w1 = new Uint8Array(0);
- function Au(n) {
- const { data: e, width: t, height: i, channels: s, depth: a } = n, c = Math.ceil(a / 8) * s, l = Math.ceil(a / 8 * s * t), f = new Uint8Array(i * l);
- let d = w1, m = 0, _, k;
- for (let p = 0; p < i; p++) {
- switch (_ = e.subarray(m + 1, m + 1 + l), k = f.subarray(p * l, (p + 1) * l), e[m]) {
- case 0:
- yh(_, k, l);
- break;
- case 1:
- xh(_, k, l, c);
- break;
- case 2:
- _h(_, k, d, l);
- break;
- case 3:
- Ah(_, k, d, l, c);
- break;
- case 4:
- Nh(_, k, d, l, c);
- break;
- default:
- throw new Error(`Unsupported filter: ${e[m]}`);
- }
- d = k, m += l + 1;
- }
- if (a === 16) {
- const p = new Uint16Array(f.buffer);
- if (b1)
- for (let j = 0; j < p.length; j++)
- p[j] = y1(p[j]);
- return p;
- } else
- return f;
- }
- function y1(n) {
- return (n & 255) << 8 | n >> 8 & 255;
- }
- const As = Uint8Array.of(137, 80, 78, 71, 13, 10, 26, 10);
- function Nu(n) {
- if (!x1(n.readBytes(As.length)))
- throw new Error("wrong PNG signature");
- }
- function x1(n) {
- if (n.length < As.length)
- return !1;
- for (let e = 0; e < As.length; e++)
- if (n[e] !== As[e])
- return !1;
- return !0;
- }
- const _1 = "tEXt", A1 = 0, Lh = new TextDecoder("latin1");
- function N1(n) {
- if (S1(n), n.length === 0 || n.length > 79)
- throw new Error("keyword length must be between 1 and 79");
- }
- const L1 = /^[\u0000-\u00FF]*$/;
- function S1(n) {
- if (!L1.test(n))
- throw new Error("invalid latin1 text");
- }
- function k1(n, e, t) {
- const i = Sh(e);
- n[i] = P1(e, t - i.length - 1);
- }
- function Sh(n) {
- for (n.mark(); n.readByte() !== A1; )
- ;
- const e = n.offset;
- n.reset();
- const t = Lh.decode(n.readBytes(e - n.offset - 1));
- return n.skip(1), N1(t), t;
- }
- function P1(n, e) {
- return Lh.decode(n.readBytes(e));
- }
- const Mn = {
- UNKNOWN: -1,
- GREYSCALE: 0,
- TRUECOLOUR: 2,
- INDEXED_COLOUR: 3,
- GREYSCALE_ALPHA: 4,
- TRUECOLOUR_ALPHA: 6
- }, ko = {
- UNKNOWN: -1,
- DEFLATE: 0
- }, Lu = {
- UNKNOWN: -1,
- ADAPTIVE: 0
- }, Po = {
- UNKNOWN: -1,
- NO_INTERLACE: 0,
- ADAM7: 1
- }, ws = {
- NONE: 0,
- BACKGROUND: 1,
- PREVIOUS: 2
- }, Io = {
- SOURCE: 0,
- OVER: 1
- };
- class I1 extends Zo {
- constructor(t, i = {}) {
- super(t);
- xe(this, "_checkCrc");
- xe(this, "_inflator");
- xe(this, "_png");
- xe(this, "_apng");
- xe(this, "_end");
- xe(this, "_hasPalette");
- xe(this, "_palette");
- xe(this, "_hasTransparency");
- xe(this, "_transparency");
- xe(this, "_compressionMethod");
- xe(this, "_filterMethod");
- xe(this, "_interlaceMethod");
- xe(this, "_colorType");
- xe(this, "_isAnimated");
- xe(this, "_numberOfFrames");
- xe(this, "_numberOfPlays");
- xe(this, "_frames");
- xe(this, "_writingDataChunks");
- const { checkCrc: s = !1 } = i;
- this._checkCrc = s, this._inflator = new yu(), this._png = {
- width: -1,
- height: -1,
- channels: -1,
- data: new Uint8Array(0),
- depth: 1,
- text: {}
- }, this._apng = {
- width: -1,
- height: -1,
- channels: -1,
- depth: 1,
- numberOfFrames: 1,
- numberOfPlays: 0,
- text: {},
- frames: []
- }, this._end = !1, this._hasPalette = !1, this._palette = [], this._hasTransparency = !1, this._transparency = new Uint16Array(0), this._compressionMethod = ko.UNKNOWN, this._filterMethod = Lu.UNKNOWN, this._interlaceMethod = Po.UNKNOWN, this._colorType = Mn.UNKNOWN, this._isAnimated = !1, this._numberOfFrames = 1, this._numberOfPlays = 0, this._frames = [], this._writingDataChunks = !1, this.setBigEndian();
- }
- decode() {
- for (Nu(this); !this._end; ) {
- const t = this.readUint32(), i = this.readChars(4);
- this.decodeChunk(t, i);
- }
- return this.decodeImage(), this._png;
- }
- decodeApng() {
- for (Nu(this); !this._end; ) {
- const t = this.readUint32(), i = this.readChars(4);
- this.decodeApngChunk(t, i);
- }
- return this.decodeApngImage(), this._apng;
- }
- // https://www.w3.org/TR/PNG/#5Chunk-layout
- decodeChunk(t, i) {
- const s = this.offset;
- switch (i) {
- case "IHDR":
- this.decodeIHDR();
- break;
- case "PLTE":
- this.decodePLTE(t);
- break;
- case "IDAT":
- this.decodeIDAT(t);
- break;
- case "IEND":
- this._end = !0;
- break;
- case "tRNS":
- this.decodetRNS(t);
- break;
- case "iCCP":
- this.decodeiCCP(t);
- break;
- case _1:
- k1(this._png.text, this, t);
- break;
- case "pHYs":
- this.decodepHYs();
- break;
- default:
- this.skip(t);
- break;
- }
- if (this.offset - s !== t)
- throw new Error(`Length mismatch while decoding chunk ${i}`);
- this._checkCrc ? _u(this, t + 4, i) : this.skip(4);
- }
- decodeApngChunk(t, i) {
- const s = this.offset;
- switch (i !== "fdAT" && i !== "IDAT" && this._writingDataChunks && this.pushDataToFrame(), i) {
- case "acTL":
- this.decodeACTL();
- break;
- case "fcTL":
- this.decodeFCTL();
- break;
- case "fdAT":
- this.decodeFDAT(t);
- break;
- default:
- this.decodeChunk(t, i), this.offset = s + t;
- break;
- }
- if (this.offset - s !== t)
- throw new Error(`Length mismatch while decoding chunk ${i}`);
- this._checkCrc ? _u(this, t + 4, i) : this.skip(4);
- }
- // https://www.w3.org/TR/PNG/#11IHDR
- decodeIHDR() {
- const t = this._png;
- t.width = this.readUint32(), t.height = this.readUint32(), t.depth = F1(this.readUint8());
- const i = this.readUint8();
- this._colorType = i;
- let s;
- switch (i) {
- case Mn.GREYSCALE:
- s = 1;
- break;
- case Mn.TRUECOLOUR:
- s = 3;
- break;
- case Mn.INDEXED_COLOUR:
- s = 1;
- break;
- case Mn.GREYSCALE_ALPHA:
- s = 2;
- break;
- case Mn.TRUECOLOUR_ALPHA:
- s = 4;
- break;
- case Mn.UNKNOWN:
- default:
- throw new Error(`Unknown color type: ${i}`);
- }
- if (this._png.channels = s, this._compressionMethod = this.readUint8(), this._compressionMethod !== ko.DEFLATE)
- throw new Error(`Unsupported compression method: ${this._compressionMethod}`);
- this._filterMethod = this.readUint8(), this._interlaceMethod = this.readUint8();
- }
- decodeACTL() {
- this._numberOfFrames = this.readUint32(), this._numberOfPlays = this.readUint32(), this._isAnimated = !0;
- }
- decodeFCTL() {
- const t = {
- sequenceNumber: this.readUint32(),
- width: this.readUint32(),
- height: this.readUint32(),
- xOffset: this.readUint32(),
- yOffset: this.readUint32(),
- delayNumber: this.readUint16(),
- delayDenominator: this.readUint16(),
- disposeOp: this.readUint8(),
- blendOp: this.readUint8(),
- data: new Uint8Array(0)
- };
- this._frames.push(t);
- }
- // https://www.w3.org/TR/PNG/#11PLTE
- decodePLTE(t) {
- if (t % 3 !== 0)
- throw new RangeError(`PLTE field length must be a multiple of 3. Got ${t}`);
- const i = t / 3;
- this._hasPalette = !0;
- const s = [];
- this._palette = s;
- for (let a = 0; a < i; a++)
- s.push([this.readUint8(), this.readUint8(), this.readUint8()]);
- }
- // https://www.w3.org/TR/PNG/#11IDAT
- decodeIDAT(t) {
- this._writingDataChunks = !0;
- const i = t, s = this.offset + this.byteOffset;
- if (this._inflator.push(new Uint8Array(this.buffer, s, i)), this._inflator.err)
- throw new Error(`Error while decompressing the data: ${this._inflator.err}`);
- this.skip(t);
- }
- decodeFDAT(t) {
- this._writingDataChunks = !0;
- let i = t, s = this.offset + this.byteOffset;
- if (s += 4, i -= 4, this._inflator.push(new Uint8Array(this.buffer, s, i)), this._inflator.err)
- throw new Error(`Error while decompressing the data: ${this._inflator.err}`);
- this.skip(t);
- }
- // https://www.w3.org/TR/PNG/#11tRNS
- decodetRNS(t) {
- switch (this._colorType) {
- case Mn.GREYSCALE:
- case Mn.TRUECOLOUR: {
- if (t % 2 !== 0)
- throw new RangeError(`tRNS chunk length must be a multiple of 2. Got ${t}`);
- if (t / 2 > this._png.width * this._png.height)
- throw new Error(`tRNS chunk contains more alpha values than there are pixels (${t / 2} vs ${this._png.width * this._png.height})`);
- this._hasTransparency = !0, this._transparency = new Uint16Array(t / 2);
- for (let i = 0; i < t / 2; i++)
- this._transparency[i] = this.readUint16();
- break;
- }
- case Mn.INDEXED_COLOUR: {
- if (t > this._palette.length)
- throw new Error(`tRNS chunk contains more alpha values than there are palette colors (${t} vs ${this._palette.length})`);
- let i = 0;
- for (; i < t; i++) {
- const s = this.readByte();
- this._palette[i].push(s);
- }
- for (; i < this._palette.length; i++)
- this._palette[i].push(255);
- break;
- }
- case Mn.UNKNOWN:
- case Mn.GREYSCALE_ALPHA:
- case Mn.TRUECOLOUR_ALPHA:
- default:
- throw new Error(`tRNS chunk is not supported for color type ${this._colorType}`);
- }
- }
- // https://www.w3.org/TR/PNG/#11iCCP
- decodeiCCP(t) {
- const i = Sh(this), s = this.readUint8();
- if (s !== ko.DEFLATE)
- throw new Error(`Unsupported iCCP compression method: ${s}`);
- const a = this.readBytes(t - i.length - 2);
- this._png.iccEmbeddedProfile = {
- name: i,
- profile: s1(a)
- };
- }
- // https://www.w3.org/TR/PNG/#11pHYs
- decodepHYs() {
- const t = this.readUint32(), i = this.readUint32(), s = this.readByte();
- this._png.resolution = { x: t, y: i, unit: s };
- }
- decodeApngImage() {
- this._apng.width = this._png.width, this._apng.height = this._png.height, this._apng.channels = this._png.channels, this._apng.depth = this._png.depth, this._apng.numberOfFrames = this._numberOfFrames, this._apng.numberOfPlays = this._numberOfPlays, this._apng.text = this._png.text, this._apng.resolution = this._png.resolution;
- for (let t = 0; t < this._numberOfFrames; t++) {
- const i = {
- sequenceNumber: this._frames[t].sequenceNumber,
- delayNumber: this._frames[t].delayNumber,
- delayDenominator: this._frames[t].delayDenominator,
- data: this._apng.depth === 8 ? new Uint8Array(this._apng.width * this._apng.height * this._apng.channels) : new Uint16Array(this._apng.width * this._apng.height * this._apng.channels)
- }, s = this._frames.at(t);
- if (s) {
- if (s.data = Au({
- data: s.data,
- width: s.width,
- height: s.height,
- channels: this._apng.channels,
- depth: this._apng.depth
- }), this._hasPalette && (this._apng.palette = this._palette), this._hasTransparency && (this._apng.transparency = this._transparency), t === 0 || s.xOffset === 0 && s.yOffset === 0 && s.width === this._png.width && s.height === this._png.height)
- i.data = s.data;
- else {
- const a = this._apng.frames.at(t - 1);
- this.disposeFrame(s, a, i), this.addFrameDataToCanvas(i, s);
- }
- this._apng.frames.push(i);
- }
- }
- return this._apng;
- }
- disposeFrame(t, i, s) {
- switch (t.disposeOp) {
- case ws.NONE:
- break;
- case ws.BACKGROUND:
- for (let a = 0; a < this._png.height; a++)
- for (let c = 0; c < this._png.width; c++) {
- const l = (a * t.width + c) * this._png.channels;
- for (let f = 0; f < this._png.channels; f++)
- s.data[l + f] = 0;
- }
- break;
- case ws.PREVIOUS:
- s.data.set(i.data);
- break;
- default:
- throw new Error("Unknown disposeOp");
- }
- }
- addFrameDataToCanvas(t, i) {
- const s = 1 << this._png.depth, a = (c, l) => {
- const f = ((c + i.yOffset) * this._png.width + i.xOffset + l) * this._png.channels, d = (c * i.width + l) * this._png.channels;
- return { index: f, frameIndex: d };
- };
- switch (i.blendOp) {
- case Io.SOURCE:
- for (let c = 0; c < i.height; c++)
- for (let l = 0; l < i.width; l++) {
- const { index: f, frameIndex: d } = a(c, l);
- for (let m = 0; m < this._png.channels; m++)
- t.data[f + m] = i.data[d + m];
- }
- break;
- case Io.OVER:
- for (let c = 0; c < i.height; c++)
- for (let l = 0; l < i.width; l++) {
- const { index: f, frameIndex: d } = a(c, l);
- for (let m = 0; m < this._png.channels; m++) {
- const _ = i.data[d + this._png.channels - 1] / s, k = m % (this._png.channels - 1) === 0 ? 1 : i.data[d + m], p = Math.floor(_ * k + (1 - _) * t.data[f + m]);
- t.data[f + m] += p;
- }
- }
- break;
- default:
- throw new Error("Unknown blendOp");
- }
- }
- decodeImage() {
- var i;
- if (this._inflator.err)
- throw new Error(`Error while decompressing the data: ${this._inflator.err}`);
- const t = this._isAnimated ? ((i = this._frames) == null ? void 0 : i.at(0)).data : this._inflator.result;
- if (this._filterMethod !== Lu.ADAPTIVE)
- throw new Error(`Filter method ${this._filterMethod} not supported`);
- if (this._interlaceMethod === Po.NO_INTERLACE)
- this._png.data = Au({
- data: t,
- width: this._png.width,
- height: this._png.height,
- channels: this._png.channels,
- depth: this._png.depth
- });
- else if (this._interlaceMethod === Po.ADAM7)
- this._png.data = p1({
- data: t,
- width: this._png.width,
- height: this._png.height,
- channels: this._png.channels,
- depth: this._png.depth
- });
- else
- throw new Error(`Interlace method ${this._interlaceMethod} not supported`);
- this._hasPalette && (this._png.palette = this._palette), this._hasTransparency && (this._png.transparency = this._transparency);
- }
- pushDataToFrame() {
- const t = this._inflator.result, i = this._frames.at(-1);
- i ? i.data = t : this._frames.push({
- sequenceNumber: 0,
- width: this._png.width,
- height: this._png.height,
- xOffset: 0,
- yOffset: 0,
- delayNumber: 0,
- delayDenominator: 0,
- disposeOp: ws.NONE,
- blendOp: Io.SOURCE,
- data: t
- }), this._inflator = new yu(), this._writingDataChunks = !1;
- }
- }
- function F1(n) {
- if (n !== 1 && n !== 2 && n !== 4 && n !== 8 && n !== 16)
- throw new Error(`invalid bit depth: ${n}`);
- return n;
- }
- var Su;
- (function(n) {
- n[n.UNKNOWN = 0] = "UNKNOWN", n[n.METRE = 1] = "METRE";
- })(Su || (Su = {}));
- function C1(n, e) {
- return new I1(n, e).decode();
- }
- /** @license
- *
- * jsPDF - PDF Document creation from JavaScript
- * Version 4.2.1 Built on 2026-03-17T11:11:27.057Z
- * CommitID 00000000
- *
- * Copyright (c) 2010-2025 James Hall <james@parall.ax>, https://github.com/MrRio/jsPDF
- * 2015-2025 yWorks GmbH, http://www.yworks.com
- * 2015-2025 Lukas Holländer <lukas.hollaender@yworks.com>, https://github.com/HackbrettXXX
- * 2016-2018 Aras Abbasi <aras.abbasi@gmail.com>
- * 2010 Aaron Spike, https://github.com/acspike
- * 2012 Willow Systems Corporation, https://github.com/willowsystems
- * 2012 Pablo Hess, https://github.com/pablohess
- * 2012 Florian Jenett, https://github.com/fjenett
- * 2013 Warren Weckesser, https://github.com/warrenweckesser
- * 2013 Youssef Beddad, https://github.com/lifof
- * 2013 Lee Driscoll, https://github.com/lsdriscoll
- * 2013 Stefan Slonevskiy, https://github.com/stefslon
- * 2013 Jeremy Morel, https://github.com/jmorel
- * 2013 Christoph Hartmann, https://github.com/chris-rock
- * 2014 Juan Pablo Gaviria, https://github.com/juanpgaviria
- * 2014 James Makes, https://github.com/dollaruw
- * 2014 Diego Casorran, https://github.com/diegocr
- * 2014 Steven Spungin, https://github.com/Flamenco
- * 2014 Kenneth Glassey, https://github.com/Gavvers
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Contributor(s):
- * siefkenj, ahwolf, rickygu, Midnith, saintclair, eaparango,
- * kim3er, mfo, alnorth, Flamenco
- */
- var Kt = /* @__PURE__ */ function() {
- return typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : this;
- }();
- function Fo() {
- Kt.console && typeof Kt.console.log == "function" && Kt.console.log.apply(Kt.console, arguments);
- }
- var Le = { log: Fo, warn: function(n) {
- Kt.console && (typeof Kt.console.warn == "function" ? Kt.console.warn.apply(Kt.console, arguments) : Fo.call(null, arguments));
- }, error: function(n) {
- Kt.console && (typeof Kt.console.error == "function" ? Kt.console.error.apply(Kt.console, arguments) : Fo(n));
- } };
- function Co(n, e, t) {
- var i = new XMLHttpRequest();
- i.open("GET", n), i.responseType = "blob", i.onload = function() {
- bi(i.response, e, t);
- }, i.onerror = function() {
- Le.error("could not download file");
- }, i.send();
- }
- function ku(n) {
- var e = new XMLHttpRequest();
- e.open("HEAD", n, !1);
- try {
- e.send();
- } catch (t) {
- }
- return e.status >= 200 && e.status <= 299;
- }
- function ys(n) {
- try {
- n.dispatchEvent(new MouseEvent("click"));
- } catch (t) {
- var e = document.createEvent("MouseEvents");
- e.initMouseEvent("click", !0, !0, window, 0, 0, 0, 80, 20, !1, !1, !1, !1, 0, null), n.dispatchEvent(e);
- }
- }
- var bi = Kt.saveAs || ((typeof window == "undefined" ? "undefined" : Se(window)) !== "object" || window !== Kt ? function() {
- } : typeof HTMLAnchorElement != "undefined" && "download" in HTMLAnchorElement.prototype ? function(n, e, t) {
- var i = Kt.URL || Kt.webkitURL, s = document.createElement("a");
- e = e || n.name || "download", s.download = e, s.rel = "noopener", typeof n == "string" ? (s.href = n, s.origin !== location.origin ? ku(s.href) ? Co(n, e, t) : ys(s, s.target = "_blank") : ys(s)) : (s.href = i.createObjectURL(n), setTimeout(function() {
- i.revokeObjectURL(s.href);
- }, 4e4), setTimeout(function() {
- ys(s);
- }, 0));
- } : "msSaveOrOpenBlob" in navigator ? function(n, e, t) {
- if (e = e || n.name || "download", typeof n == "string") if (ku(n)) Co(n, e, t);
- else {
- var i = document.createElement("a");
- i.href = n, i.target = "_blank", setTimeout(function() {
- ys(i);
- });
- }
- else navigator.msSaveOrOpenBlob(function(s, a) {
- return a === void 0 ? a = { autoBom: !1 } : Se(a) !== "object" && (Le.warn("Deprecated: Expected third argument to be a object"), a = { autoBom: !a }), a.autoBom && /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(s.type) ? new Blob(["\uFEFF", s], { type: s.type }) : s;
- }(n, t), e);
- } : function(n, e, t, i) {
- if ((i = i || open("", "_blank")) && (i.document.title = i.document.body.innerText = "downloading..."), typeof n == "string") return Co(n, e, t);
- var s = n.type === "application/octet-stream", a = /constructor/i.test(Kt.HTMLElement) || Kt.safari, c = /CriOS\/[\d]+/.test(navigator.userAgent);
- if ((c || s && a) && (typeof FileReader == "undefined" ? "undefined" : Se(FileReader)) === "object") {
- var l = new FileReader();
- l.onloadend = function() {
- var m = l.result;
- m = c ? m : m.replace(/^data:[^;]*;/, "data:attachment/file;"), i ? i.location.href = m : location = m, i = null;
- }, l.readAsDataURL(n);
- } else {
- var f = Kt.URL || Kt.webkitURL, d = f.createObjectURL(n);
- i ? i.location = d : location.href = d, i = null, setTimeout(function() {
- f.revokeObjectURL(d);
- }, 4e4);
- }
- });
- /**
- * A class to parse color values
- * @author Stoyan Stefanov <sstoo@gmail.com>
- * {@link http://www.phpied.com/rgb-color-parser-in-javascript/}
- * @license Use it if you like it
- */
- function kh(n) {
- var e;
- n = n || "", this.ok = !1, n.charAt(0) == "#" && (n = n.substr(1, 6)), n = { aliceblue: "f0f8ff", antiquewhite: "faebd7", aqua: "00ffff", aquamarine: "7fffd4", azure: "f0ffff", beige: "f5f5dc", bisque: "ffe4c4", black: "000000", blanchedalmond: "ffebcd", blue: "0000ff", blueviolet: "8a2be2", brown: "a52a2a", burlywood: "deb887", cadetblue: "5f9ea0", chartreuse: "7fff00", chocolate: "d2691e", coral: "ff7f50", cornflowerblue: "6495ed", cornsilk: "fff8dc", crimson: "dc143c", cyan: "00ffff", darkblue: "00008b", darkcyan: "008b8b", darkgoldenrod: "b8860b", darkgray: "a9a9a9", darkgreen: "006400", darkkhaki: "bdb76b", darkmagenta: "8b008b", darkolivegreen: "556b2f", darkorange: "ff8c00", darkorchid: "9932cc", darkred: "8b0000", darksalmon: "e9967a", darkseagreen: "8fbc8f", darkslateblue: "483d8b", darkslategray: "2f4f4f", darkturquoise: "00ced1", darkviolet: "9400d3", deeppink: "ff1493", deepskyblue: "00bfff", dimgray: "696969", dodgerblue: "1e90ff", feldspar: "d19275", firebrick: "b22222", floralwhite: "fffaf0", forestgreen: "228b22", fuchsia: "ff00ff", gainsboro: "dcdcdc", ghostwhite: "f8f8ff", gold: "ffd700", goldenrod: "daa520", gray: "808080", green: "008000", greenyellow: "adff2f", honeydew: "f0fff0", hotpink: "ff69b4", indianred: "cd5c5c", indigo: "4b0082", ivory: "fffff0", khaki: "f0e68c", lavender: "e6e6fa", lavenderblush: "fff0f5", lawngreen: "7cfc00", lemonchiffon: "fffacd", lightblue: "add8e6", lightcoral: "f08080", lightcyan: "e0ffff", lightgoldenrodyellow: "fafad2", lightgrey: "d3d3d3", lightgreen: "90ee90", lightpink: "ffb6c1", lightsalmon: "ffa07a", lightseagreen: "20b2aa", lightskyblue: "87cefa", lightslateblue: "8470ff", lightslategray: "778899", lightsteelblue: "b0c4de", lightyellow: "ffffe0", lime: "00ff00", limegreen: "32cd32", linen: "faf0e6", magenta: "ff00ff", maroon: "800000", mediumaquamarine: "66cdaa", mediumblue: "0000cd", mediumorchid: "ba55d3", mediumpurple: "9370d8", mediumseagreen: "3cb371", mediumslateblue: "7b68ee", mediumspringgreen: "00fa9a", mediumturquoise: "48d1cc", mediumvioletred: "c71585", midnightblue: "191970", mintcream: "f5fffa", mistyrose: "ffe4e1", moccasin: "ffe4b5", navajowhite: "ffdead", navy: "000080", oldlace: "fdf5e6", olive: "808000", olivedrab: "6b8e23", orange: "ffa500", orangered: "ff4500", orchid: "da70d6", palegoldenrod: "eee8aa", palegreen: "98fb98", paleturquoise: "afeeee", palevioletred: "d87093", papayawhip: "ffefd5", peachpuff: "ffdab9", peru: "cd853f", pink: "ffc0cb", plum: "dda0dd", powderblue: "b0e0e6", purple: "800080", red: "ff0000", rosybrown: "bc8f8f", royalblue: "4169e1", saddlebrown: "8b4513", salmon: "fa8072", sandybrown: "f4a460", seagreen: "2e8b57", seashell: "fff5ee", sienna: "a0522d", silver: "c0c0c0", skyblue: "87ceeb", slateblue: "6a5acd", slategray: "708090", snow: "fffafa", springgreen: "00ff7f", steelblue: "4682b4", tan: "d2b48c", teal: "008080", thistle: "d8bfd8", tomato: "ff6347", turquoise: "40e0d0", violet: "ee82ee", violetred: "d02090", wheat: "f5deb3", white: "ffffff", whitesmoke: "f5f5f5", yellow: "ffff00", yellowgreen: "9acd32" }[n = (n = n.replace(/ /g, "")).toLowerCase()] || n;
- for (var t = [{ re: /^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/, example: ["rgb(123, 234, 45)", "rgb(255,234,245)"], process: function(l) {
- return [parseInt(l[1]), parseInt(l[2]), parseInt(l[3])];
- } }, { re: /^(\w{2})(\w{2})(\w{2})$/, example: ["#00ff00", "336699"], process: function(l) {
- return [parseInt(l[1], 16), parseInt(l[2], 16), parseInt(l[3], 16)];
- } }, { re: /^(\w{1})(\w{1})(\w{1})$/, example: ["#fb0", "f0f"], process: function(l) {
- return [parseInt(l[1] + l[1], 16), parseInt(l[2] + l[2], 16), parseInt(l[3] + l[3], 16)];
- } }], i = 0; i < t.length; i++) {
- var s = t[i].re, a = t[i].process, c = s.exec(n);
- c && (e = a(c), this.r = e[0], this.g = e[1], this.b = e[2], this.ok = !0);
- }
- this.r = this.r < 0 || isNaN(this.r) ? 0 : this.r > 255 ? 255 : this.r, this.g = this.g < 0 || isNaN(this.g) ? 0 : this.g > 255 ? 255 : this.g, this.b = this.b < 0 || isNaN(this.b) ? 0 : this.b > 255 ? 255 : this.b, this.toRGB = function() {
- return "rgb(" + this.r + ", " + this.g + ", " + this.b + ")";
- }, this.toHex = function() {
- var l = this.r.toString(16), f = this.g.toString(16), d = this.b.toString(16);
- return l.length == 1 && (l = "0" + l), f.length == 1 && (f = "0" + f), d.length == 1 && (d = "0" + d), "#" + l + f + d;
- };
- }
- var Ns = Kt.atob.bind(Kt), Pu = Kt.btoa.bind(Kt);
- /**
- * @license
- * Joseph Myers does not specify a particular license for his work.
- *
- * Author: Joseph Myers
- * Accessed from: http://www.myersdaily.org/joseph/javascript/md5.js
- *
- * Modified by: Owen Leong
- */
- function Eo(n, e) {
- var t = n[0], i = n[1], s = n[2], a = n[3];
- t = mn(t, i, s, a, e[0], 7, -680876936), a = mn(a, t, i, s, e[1], 12, -389564586), s = mn(s, a, t, i, e[2], 17, 606105819), i = mn(i, s, a, t, e[3], 22, -1044525330), t = mn(t, i, s, a, e[4], 7, -176418897), a = mn(a, t, i, s, e[5], 12, 1200080426), s = mn(s, a, t, i, e[6], 17, -1473231341), i = mn(i, s, a, t, e[7], 22, -45705983), t = mn(t, i, s, a, e[8], 7, 1770035416), a = mn(a, t, i, s, e[9], 12, -1958414417), s = mn(s, a, t, i, e[10], 17, -42063), i = mn(i, s, a, t, e[11], 22, -1990404162), t = mn(t, i, s, a, e[12], 7, 1804603682), a = mn(a, t, i, s, e[13], 12, -40341101), s = mn(s, a, t, i, e[14], 17, -1502002290), t = vn(t, i = mn(i, s, a, t, e[15], 22, 1236535329), s, a, e[1], 5, -165796510), a = vn(a, t, i, s, e[6], 9, -1069501632), s = vn(s, a, t, i, e[11], 14, 643717713), i = vn(i, s, a, t, e[0], 20, -373897302), t = vn(t, i, s, a, e[5], 5, -701558691), a = vn(a, t, i, s, e[10], 9, 38016083), s = vn(s, a, t, i, e[15], 14, -660478335), i = vn(i, s, a, t, e[4], 20, -405537848), t = vn(t, i, s, a, e[9], 5, 568446438), a = vn(a, t, i, s, e[14], 9, -1019803690), s = vn(s, a, t, i, e[3], 14, -187363961), i = vn(i, s, a, t, e[8], 20, 1163531501), t = vn(t, i, s, a, e[13], 5, -1444681467), a = vn(a, t, i, s, e[2], 9, -51403784), s = vn(s, a, t, i, e[7], 14, 1735328473), t = bn(t, i = vn(i, s, a, t, e[12], 20, -1926607734), s, a, e[5], 4, -378558), a = bn(a, t, i, s, e[8], 11, -2022574463), s = bn(s, a, t, i, e[11], 16, 1839030562), i = bn(i, s, a, t, e[14], 23, -35309556), t = bn(t, i, s, a, e[1], 4, -1530992060), a = bn(a, t, i, s, e[4], 11, 1272893353), s = bn(s, a, t, i, e[7], 16, -155497632), i = bn(i, s, a, t, e[10], 23, -1094730640), t = bn(t, i, s, a, e[13], 4, 681279174), a = bn(a, t, i, s, e[0], 11, -358537222), s = bn(s, a, t, i, e[3], 16, -722521979), i = bn(i, s, a, t, e[6], 23, 76029189), t = bn(t, i, s, a, e[9], 4, -640364487), a = bn(a, t, i, s, e[12], 11, -421815835), s = bn(s, a, t, i, e[15], 16, 530742520), t = wn(t, i = bn(i, s, a, t, e[2], 23, -995338651), s, a, e[0], 6, -198630844), a = wn(a, t, i, s, e[7], 10, 1126891415), s = wn(s, a, t, i, e[14], 15, -1416354905), i = wn(i, s, a, t, e[5], 21, -57434055), t = wn(t, i, s, a, e[12], 6, 1700485571), a = wn(a, t, i, s, e[3], 10, -1894986606), s = wn(s, a, t, i, e[10], 15, -1051523), i = wn(i, s, a, t, e[1], 21, -2054922799), t = wn(t, i, s, a, e[8], 6, 1873313359), a = wn(a, t, i, s, e[15], 10, -30611744), s = wn(s, a, t, i, e[6], 15, -1560198380), i = wn(i, s, a, t, e[13], 21, 1309151649), t = wn(t, i, s, a, e[4], 6, -145523070), a = wn(a, t, i, s, e[11], 10, -1120210379), s = wn(s, a, t, i, e[2], 15, 718787259), i = wn(i, s, a, t, e[9], 21, -343485551), n[0] = $r(t, n[0]), n[1] = $r(i, n[1]), n[2] = $r(s, n[2]), n[3] = $r(a, n[3]);
- }
- function js(n, e, t, i, s, a) {
- return e = $r($r(e, n), $r(i, a)), $r(e << s | e >>> 32 - s, t);
- }
- function mn(n, e, t, i, s, a, c) {
- return js(e & t | ~e & i, n, e, s, a, c);
- }
- function vn(n, e, t, i, s, a, c) {
- return js(e & i | t & ~i, n, e, s, a, c);
- }
- function bn(n, e, t, i, s, a, c) {
- return js(e ^ t ^ i, n, e, s, a, c);
- }
- function wn(n, e, t, i, s, a, c) {
- return js(t ^ (e | ~i), n, e, s, a, c);
- }
- function Ph(n) {
- var e, t = n.length, i = [1732584193, -271733879, -1732584194, 271733878];
- for (e = 64; e <= n.length; e += 64) Eo(i, E1(n.substring(e - 64, e)));
- n = n.substring(e - 64);
- var s = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
- for (e = 0; e < n.length; e++) s[e >> 2] |= n.charCodeAt(e) << (e % 4 << 3);
- if (s[e >> 2] |= 128 << (e % 4 << 3), e > 55) for (Eo(i, s), e = 0; e < 16; e++) s[e] = 0;
- return s[14] = 8 * t, Eo(i, s), i;
- }
- function E1(n) {
- var e, t = [];
- for (e = 0; e < 64; e += 4) t[e >> 2] = n.charCodeAt(e) + (n.charCodeAt(e + 1) << 8) + (n.charCodeAt(e + 2) << 16) + (n.charCodeAt(e + 3) << 24);
- return t;
- }
- var Iu = "0123456789abcdef".split("");
- function O1(n) {
- for (var e = "", t = 0; t < 4; t++) e += Iu[n >> 8 * t + 4 & 15] + Iu[n >> 8 * t & 15];
- return e;
- }
- function j1(n) {
- return String.fromCharCode(255 & n, (65280 & n) >> 8, (16711680 & n) >> 16, (4278190080 & n) >> 24);
- }
- function Vo(n) {
- return Ph(n).map(j1).join("");
- }
- var B1 = function(n) {
- for (var e = 0; e < n.length; e++) n[e] = O1(n[e]);
- return n.join("");
- }(Ph("hello")) != "5d41402abc4b2a76b9719d911017c592";
- function $r(n, e) {
- if (B1) {
- var t = (65535 & n) + (65535 & e);
- return (n >> 16) + (e >> 16) + (t >> 16) << 16 | 65535 & t;
- }
- return n + e & 4294967295;
- }
- /**
- * @license
- * FPDF is released under a permissive license: there is no usage restriction.
- * You may embed it freely in your application (commercial or not), with or
- * without modifications.
- *
- * Reference: http://www.fpdf.org/en/script/script37.php
- */
- function Go(n, e) {
- var t, i, s, a;
- if (n !== t) {
- for (var c = (s = n, a = 1 + (256 / n.length | 0), new Array(a + 1).join(s)), l = [], f = 0; f < 256; f++) l[f] = f;
- var d = 0;
- for (f = 0; f < 256; f++) {
- var m = l[f];
- d = (d + m + c.charCodeAt(f)) % 256, l[f] = l[d], l[d] = m;
- }
- t = n, i = l;
- } else l = i;
- var _ = e.length, k = 0, p = 0, j = "";
- for (f = 0; f < _; f++) p = (p + (m = l[k = (k + 1) % 256])) % 256, l[k] = l[p], l[p] = m, c = l[(l[k] + l[p]) % 256], j += String.fromCharCode(e.charCodeAt(f) ^ c);
- return j;
- }
- /**
- * @license
- * Licensed under the MIT License.
- * http://opensource.org/licenses/mit-license
- * Author: Owen Leong (@owenl131)
- * Date: 15 Oct 2020
- * References:
- * https://www.cs.cmu.edu/~dst/Adobe/Gallery/anon21jul01-pdf-encryption.txt
- * https://github.com/foliojs/pdfkit/blob/master/lib/security.js
- * http://www.fpdf.org/en/script/script37.php
- */
- var Fu = { print: 4, modify: 8, copy: 16, "annot-forms": 32 };
- function $i(n, e, t, i) {
- this.v = 1, this.r = 2;
- var s = 192;
- n.forEach(function(l) {
- if (Fu.perm !== void 0) throw new Error("Invalid permission: " + l);
- s += Fu[l];
- }), this.padding = "(¿N^NuAd\0NVÿú\b..\0¶Ðh>/\f©þdSiz";
- var a = (e + this.padding).substr(0, 32), c = (t + this.padding).substr(0, 32);
- this.O = this.processOwnerPassword(a, c), this.P = -(1 + (255 ^ s)), this.encryptionKey = Vo(a + this.O + this.lsbFirstWord(this.P) + this.hexToBytes(i)).substr(0, 5), this.U = Go(this.encryptionKey, this.padding);
- }
- function Zi(n) {
- if (/[^\u0000-\u00ff]/.test(n)) throw new Error("Invalid PDF Name Object: " + n + ", Only accept ASCII characters.");
- for (var e = "", t = n.length, i = 0; i < t; i++) {
- var s = n.charCodeAt(i);
- e += s < 33 || s === 35 || s === 37 || s === 40 || s === 41 || s === 47 || s === 60 || s === 62 || s === 91 || s === 93 || s === 123 || s === 125 || s > 126 ? "#" + ("0" + s.toString(16)).slice(-2) : n[i];
- }
- return e;
- }
- function Cu(n) {
- if (Se(n) !== "object") throw new Error("Invalid Context passed to initialize PubSub (jsPDF-module)");
- var e = {};
- this.subscribe = function(t, i, s) {
- if (s = s || !1, typeof t != "string" || typeof i != "function" || typeof s != "boolean") throw new Error("Invalid arguments passed to PubSub.subscribe (jsPDF-module)");
- e.hasOwnProperty(t) || (e[t] = {});
- var a = Math.random().toString(35);
- return e[t][a] = [i, !!s], a;
- }, this.unsubscribe = function(t) {
- for (var i in e) if (e[i][t]) return delete e[i][t], Object.keys(e[i]).length === 0 && delete e[i], !0;
- return !1;
- }, this.publish = function(t) {
- if (e.hasOwnProperty(t)) {
- var i = Array.prototype.slice.call(arguments, 1), s = [];
- for (var a in e[t]) {
- var c = e[t][a];
- try {
- c[0].apply(n, i);
- } catch (l) {
- Kt.console && Le.error("jsPDF PubSub Error", l.message, l);
- }
- c[1] && s.push(a);
- }
- s.length && s.forEach(this.unsubscribe);
- }
- }, this.getTopics = function() {
- return e;
- };
- }
- function Cs(n) {
- if (!(this instanceof Cs)) return new Cs(n);
- var e = "opacity,stroke-opacity".split(",");
- for (var t in n) n.hasOwnProperty(t) && e.indexOf(t) >= 0 && (this[t] = n[t]);
- this.id = "", this.objectNumber = -1;
- }
- function Ih(n, e) {
- this.gState = n, this.matrix = e, this.id = "", this.objectNumber = -1;
- }
- function wi(n, e, t, i, s) {
- if (!(this instanceof wi)) return new wi(n, e, t, i, s);
- this.type = n === "axial" ? 2 : 3, this.coords = e, this.colors = t, Ih.call(this, i, s);
- }
- function Qi(n, e, t, i, s) {
- if (!(this instanceof Qi)) return new Qi(n, e, t, i, s);
- this.boundingBox = n, this.xStep = e, this.yStep = t, this.stream = "", this.cloneIndex = 0, Ih.call(this, i, s);
- }
- function Tt(n) {
- var e, t = typeof arguments[0] == "string" ? arguments[0] : "p", i = arguments[1], s = arguments[2], a = arguments[3], c = [], l = 1, f = 16, d = "S", m = null;
- Se(n = n || {}) === "object" && (t = n.orientation, i = n.unit || i, s = n.format || s, a = n.compress || n.compressPdf || a, (m = n.encryption || null) !== null && (m.userPassword = m.userPassword || "", m.ownerPassword = m.ownerPassword || "", m.userPermissions = m.userPermissions || []), l = typeof n.userUnit == "number" ? Math.abs(n.userUnit) : 1, n.precision !== void 0 && (e = n.precision), n.floatPrecision !== void 0 && (f = n.floatPrecision), d = n.defaultPathOperation || "S"), c = n.filters || (a === !0 ? ["FlateEncode"] : c), i = i || "mm", t = ("" + (t || "P")).toLowerCase();
- var _ = n.putOnlyUsedFonts || !1, k = {}, p = { internal: {}, __private__: {} };
- p.__private__.PubSub = Cu;
- var j = "1.3", O = p.__private__.getPdfVersion = function() {
- return j;
- };
- p.__private__.setPdfVersion = function(u) {
- j = u;
- };
- var M = { a0: [2383.94, 3370.39], a1: [1683.78, 2383.94], a2: [1190.55, 1683.78], a3: [841.89, 1190.55], a4: [595.28, 841.89], a5: [419.53, 595.28], a6: [297.64, 419.53], a7: [209.76, 297.64], a8: [147.4, 209.76], a9: [104.88, 147.4], a10: [73.7, 104.88], b0: [2834.65, 4008.19], b1: [2004.09, 2834.65], b2: [1417.32, 2004.09], b3: [1000.63, 1417.32], b4: [708.66, 1000.63], b5: [498.9, 708.66], b6: [354.33, 498.9], b7: [249.45, 354.33], b8: [175.75, 249.45], b9: [124.72, 175.75], b10: [87.87, 124.72], c0: [2599.37, 3676.54], c1: [1836.85, 2599.37], c2: [1298.27, 1836.85], c3: [918.43, 1298.27], c4: [649.13, 918.43], c5: [459.21, 649.13], c6: [323.15, 459.21], c7: [229.61, 323.15], c8: [161.57, 229.61], c9: [113.39, 161.57], c10: [79.37, 113.39], dl: [311.81, 623.62], letter: [612, 792], "government-letter": [576, 756], legal: [612, 1008], "junior-legal": [576, 360], ledger: [1224, 792], tabloid: [792, 1224], "credit-card": [153, 243] };
- p.__private__.getPageFormats = function() {
- return M;
- };
- var S = p.__private__.getPageFormat = function(u) {
- return M[u];
- };
- s = s || "a4";
- var V = "compat", G = "advanced", q = V;
- function it() {
- this.saveGraphicsState(), P(new Gt(ne, 0, 0, -ne, 0, ai() * ne).toString() + " cm"), this.setFontSize(this.getFontSize() / ne), d = "n", q = G;
- }
- function vt() {
- this.restoreGraphicsState(), d = "S", q = V;
- }
- var dt = p.__private__.combineFontStyleAndFontWeight = function(u, v) {
- if (u == "bold" && v == "normal" || u == "bold" && v == 400 || u == "normal" && v == "italic" || u == "bold" && v == "italic") throw new Error("Invalid Combination of fontweight and fontstyle");
- return v && (u = v == 400 || v === "normal" ? u === "italic" ? "italic" : "normal" : v != 700 && v !== "bold" || u !== "normal" ? (v == 700 ? "bold" : v) + "" + u : "bold"), u;
- };
- p.advancedAPI = function(u) {
- var v = q === V;
- return v && it.call(this), typeof u != "function" || (u(this), v && vt.call(this)), this;
- }, p.compatAPI = function(u) {
- var v = q === G;
- return v && vt.call(this), typeof u != "function" || (u(this), v && it.call(this)), this;
- }, p.isAdvancedAPI = function() {
- return q === G;
- };
- var X, R = function(u) {
- if (q !== G) throw new Error(u + " is only available in 'advanced' API mode. You need to call advancedAPI() first.");
- }, tt = p.roundToPrecision = p.__private__.roundToPrecision = function(u, v) {
- var I = e || v;
- if (isNaN(u) || isNaN(I)) throw new Error("Invalid argument passed to jsPDF.roundToPrecision");
- return u.toFixed(I).replace(/0+$/, "");
- };
- X = p.hpf = p.__private__.hpf = typeof f == "number" ? function(u) {
- if (isNaN(u)) throw new Error("Invalid argument passed to jsPDF.hpf");
- return tt(u, f);
- } : f === "smart" ? function(u) {
- if (isNaN(u)) throw new Error("Invalid argument passed to jsPDF.hpf");
- return tt(u, u > -1 && u < 1 ? 16 : 5);
- } : function(u) {
- if (isNaN(u)) throw new Error("Invalid argument passed to jsPDF.hpf");
- return tt(u, 16);
- };
- var N = p.f2 = p.__private__.f2 = function(u) {
- if (isNaN(u)) throw new Error("Invalid argument passed to jsPDF.f2");
- return tt(u, 2);
- }, E = p.__private__.f3 = function(u) {
- if (isNaN(u)) throw new Error("Invalid argument passed to jsPDF.f3");
- return tt(u, 3);
- }, z = p.scale = p.__private__.scale = function(u) {
- if (isNaN(u)) throw new Error("Invalid argument passed to jsPDF.scale");
- return q === V ? u * ne : q === G ? u : void 0;
- }, U = function(u) {
- return z(function(v) {
- return q === V ? ai() - v : q === G ? v : void 0;
- }(u));
- };
- p.__private__.setPrecision = p.setPrecision = function(u) {
- typeof parseInt(u, 10) == "number" && (e = parseInt(u, 10));
- };
- var rt, ot = "00000000000000000000000000000000", ht = p.__private__.getFileId = function() {
- return ot;
- }, nt = p.__private__.setFileId = function(u) {
- return ot = u !== void 0 && /^[a-fA-F0-9]{32}$/.test(u) ? u.toUpperCase() : ot.split("").map(function() {
- return "ABCDEF0123456789".charAt(Math.floor(16 * Math.random()));
- }).join(""), m !== null && (on = new $i(m.userPermissions, m.userPassword, m.ownerPassword, ot)), ot;
- };
- p.setFileId = function(u) {
- return nt(u), this;
- }, p.getFileId = function() {
- return ht();
- };
- var ct = p.__private__.convertDateToPDFDate = function(u) {
- var v = u.getTimezoneOffset(), I = v < 0 ? "+" : "-", D = Math.floor(Math.abs(v / 60)), K = Math.abs(v % 60), lt = [I, T(D), "'", T(K), "'"].join("");
- return ["D:", u.getFullYear(), T(u.getMonth() + 1), T(u.getDate()), T(u.getHours()), T(u.getMinutes()), T(u.getSeconds()), lt].join("");
- }, At = p.__private__.convertPDFDateToDate = function(u) {
- var v = parseInt(u.substr(2, 4), 10), I = parseInt(u.substr(6, 2), 10) - 1, D = parseInt(u.substr(8, 2), 10), K = parseInt(u.substr(10, 2), 10), lt = parseInt(u.substr(12, 2), 10), mt = parseInt(u.substr(14, 2), 10);
- return new Date(v, I, D, K, lt, mt, 0);
- }, wt = p.__private__.setCreationDate = function(u) {
- var v;
- if (u === void 0 && (u = /* @__PURE__ */ new Date()), u instanceof Date) v = ct(u);
- else {
- if (!/^D:(20[0-2][0-9]|203[0-7]|19[7-9][0-9])(0[0-9]|1[0-2])([0-2][0-9]|3[0-1])(0[0-9]|1[0-9]|2[0-3])(0[0-9]|[1-5][0-9])(0[0-9]|[1-5][0-9])(\+0[0-9]|\+1[0-4]|-0[0-9]|-1[0-1])'(0[0-9]|[1-5][0-9])'?$/.test(u)) throw new Error("Invalid argument passed to jsPDF.setCreationDate");
- v = u;
- }
- return rt = v;
- }, x = p.__private__.getCreationDate = function(u) {
- var v = rt;
- return u === "jsDate" && (v = At(rt)), v;
- };
- p.setCreationDate = function(u) {
- return wt(u), this;
- }, p.getCreationDate = function(u) {
- return x(u);
- };
- var B, T = p.__private__.padd2 = function(u) {
- return ("0" + parseInt(u)).slice(-2);
- }, H = p.__private__.padd2Hex = function(u) {
- return ("00" + (u = u.toString())).substr(u.length);
- }, J = 0, Z = [], at = [], st = 0, gt = [], _t = [], kt = !1, St = at;
- p.__private__.setCustomOutputDestination = function(u) {
- kt = !0, St = u;
- };
- var Dt = function(u) {
- kt || (St = u);
- };
- p.__private__.resetCustomOutputDestination = function() {
- kt = !1, St = at;
- };
- var P = p.__private__.out = function(u) {
- return u = u.toString(), st += u.length + 1, St.push(u), St;
- }, Lt = p.__private__.write = function(u) {
- return P(arguments.length === 1 ? u.toString() : Array.prototype.join.call(arguments, " "));
- }, ae = p.__private__.getArrayBuffer = function(u) {
- for (var v = u.length, I = new ArrayBuffer(v), D = new Uint8Array(I); v--; ) D[v] = u.charCodeAt(v);
- return I;
- }, Ht = [["Helvetica", "helvetica", "normal", "WinAnsiEncoding"], ["Helvetica-Bold", "helvetica", "bold", "WinAnsiEncoding"], ["Helvetica-Oblique", "helvetica", "italic", "WinAnsiEncoding"], ["Helvetica-BoldOblique", "helvetica", "bolditalic", "WinAnsiEncoding"], ["Courier", "courier", "normal", "WinAnsiEncoding"], ["Courier-Bold", "courier", "bold", "WinAnsiEncoding"], ["Courier-Oblique", "courier", "italic", "WinAnsiEncoding"], ["Courier-BoldOblique", "courier", "bolditalic", "WinAnsiEncoding"], ["Times-Roman", "times", "normal", "WinAnsiEncoding"], ["Times-Bold", "times", "bold", "WinAnsiEncoding"], ["Times-Italic", "times", "italic", "WinAnsiEncoding"], ["Times-BoldItalic", "times", "bolditalic", "WinAnsiEncoding"], ["ZapfDingbats", "zapfdingbats", "normal", null], ["Symbol", "symbol", "normal", null]];
- p.__private__.getStandardFonts = function() {
- return Ht;
- };
- var yt = n.fontSize || 16;
- p.__private__.setFontSize = p.setFontSize = function(u) {
- return yt = q === G ? u / ne : u, this;
- };
- var Wt, It = p.__private__.getFontSize = p.getFontSize = function() {
- return q === V ? yt : yt * ne;
- }, zt = n.R2L || !1;
- p.__private__.setR2L = p.setR2L = function(u) {
- return zt = u, this;
- }, p.__private__.getR2L = p.getR2L = function() {
- return zt;
- };
- var qt, ve = p.__private__.setZoomMode = function(u) {
- if (/^(?:\d+\.\d*|\d*\.\d+|\d+)%$/.test(u)) Wt = u;
- else if (isNaN(u)) {
- if ([void 0, null, "fullwidth", "fullheight", "fullpage", "original"].indexOf(u) === -1) throw new Error('zoom must be Integer (e.g. 2), a percentage Value (e.g. 300%) or fullwidth, fullheight, fullpage, original. "' + u + '" is not recognized.');
- Wt = u;
- } else Wt = parseInt(u, 10);
- };
- p.__private__.getZoomMode = function() {
- return Wt;
- };
- var ue, Zt = p.__private__.setPageMode = function(u) {
- if ([void 0, null, "UseNone", "UseOutlines", "UseThumbs", "FullScreen"].indexOf(u) == -1) throw new Error('Page mode must be one of UseNone, UseOutlines, UseThumbs, or FullScreen. "' + u + '" is not recognized.');
- qt = u;
- };
- p.__private__.getPageMode = function() {
- return qt;
- };
- var fe = p.__private__.setLayoutMode = function(u) {
- if ([void 0, null, "continuous", "single", "twoleft", "tworight", "two"].indexOf(u) == -1) throw new Error('Layout mode must be one of continuous, single, twoleft, tworight. "' + u + '" is not recognized.');
- ue = u;
- };
- p.__private__.getLayoutMode = function() {
- return ue;
- }, p.__private__.setDisplayMode = p.setDisplayMode = function(u, v, I) {
- return ve(u), fe(v), Zt(I), this;
- };
- var he = { title: "", subject: "", author: "", keywords: "", creator: "" };
- p.__private__.getDocumentProperty = function(u) {
- if (Object.keys(he).indexOf(u) === -1) throw new Error("Invalid argument passed to jsPDF.getDocumentProperty");
- return he[u];
- }, p.__private__.getDocumentProperties = function() {
- return he;
- }, p.__private__.setDocumentProperties = p.setProperties = p.setDocumentProperties = function(u) {
- for (var v in he) he.hasOwnProperty(v) && u[v] && (he[v] = u[v]);
- return this;
- }, p.__private__.setDocumentProperty = function(u, v) {
- if (Object.keys(he).indexOf(u) === -1) throw new Error("Invalid arguments passed to jsPDF.setDocumentProperty");
- return he[u] = v;
- };
- var Bt, ne, Rt, He, ge, se = {}, oe = {}, je = [], Ut = {}, ke = {}, Yt = {}, Qt = {}, Be = null, le = 0, Vt = [], be = new Cu(p), Qr = n.hotfixes || [], fn = {}, br = {}, rr = [], Gt = function u(v, I, D, K, lt, mt) {
- if (!(this instanceof u)) return new u(v, I, D, K, lt, mt);
- isNaN(v) && (v = 1), isNaN(I) && (I = 0), isNaN(D) && (D = 0), isNaN(K) && (K = 1), isNaN(lt) && (lt = 0), isNaN(mt) && (mt = 0), this._matrix = [v, I, D, K, lt, mt];
- };
- Object.defineProperty(Gt.prototype, "sx", { get: function() {
- return this._matrix[0];
- }, set: function(u) {
- this._matrix[0] = u;
- } }), Object.defineProperty(Gt.prototype, "shy", { get: function() {
- return this._matrix[1];
- }, set: function(u) {
- this._matrix[1] = u;
- } }), Object.defineProperty(Gt.prototype, "shx", { get: function() {
- return this._matrix[2];
- }, set: function(u) {
- this._matrix[2] = u;
- } }), Object.defineProperty(Gt.prototype, "sy", { get: function() {
- return this._matrix[3];
- }, set: function(u) {
- this._matrix[3] = u;
- } }), Object.defineProperty(Gt.prototype, "tx", { get: function() {
- return this._matrix[4];
- }, set: function(u) {
- this._matrix[4] = u;
- } }), Object.defineProperty(Gt.prototype, "ty", { get: function() {
- return this._matrix[5];
- }, set: function(u) {
- this._matrix[5] = u;
- } }), Object.defineProperty(Gt.prototype, "a", { get: function() {
- return this._matrix[0];
- }, set: function(u) {
- this._matrix[0] = u;
- } }), Object.defineProperty(Gt.prototype, "b", { get: function() {
- return this._matrix[1];
- }, set: function(u) {
- this._matrix[1] = u;
- } }), Object.defineProperty(Gt.prototype, "c", { get: function() {
- return this._matrix[2];
- }, set: function(u) {
- this._matrix[2] = u;
- } }), Object.defineProperty(Gt.prototype, "d", { get: function() {
- return this._matrix[3];
- }, set: function(u) {
- this._matrix[3] = u;
- } }), Object.defineProperty(Gt.prototype, "e", { get: function() {
- return this._matrix[4];
- }, set: function(u) {
- this._matrix[4] = u;
- } }), Object.defineProperty(Gt.prototype, "f", { get: function() {
- return this._matrix[5];
- }, set: function(u) {
- this._matrix[5] = u;
- } }), Object.defineProperty(Gt.prototype, "rotation", { get: function() {
- return Math.atan2(this.shx, this.sx);
- } }), Object.defineProperty(Gt.prototype, "scaleX", { get: function() {
- return this.decompose().scale.sx;
- } }), Object.defineProperty(Gt.prototype, "scaleY", { get: function() {
- return this.decompose().scale.sy;
- } }), Object.defineProperty(Gt.prototype, "isIdentity", { get: function() {
- return this.sx === 1 && this.shy === 0 && this.shx === 0 && this.sy === 1 && this.tx === 0 && this.ty === 0;
- } }), Gt.prototype.join = function(u) {
- return [this.sx, this.shy, this.shx, this.sy, this.tx, this.ty].map(X).join(u);
- }, Gt.prototype.multiply = function(u) {
- var v = u.sx * this.sx + u.shy * this.shx, I = u.sx * this.shy + u.shy * this.sy, D = u.shx * this.sx + u.sy * this.shx, K = u.shx * this.shy + u.sy * this.sy, lt = u.tx * this.sx + u.ty * this.shx + this.tx, mt = u.tx * this.shy + u.ty * this.sy + this.ty;
- return new Gt(v, I, D, K, lt, mt);
- }, Gt.prototype.decompose = function() {
- var u = this.sx, v = this.shy, I = this.shx, D = this.sy, K = this.tx, lt = this.ty, mt = Math.sqrt(u * u + v * v), Et = (u /= mt) * I + (v /= mt) * D;
- I -= u * Et, D -= v * Et;
- var Ct = Math.sqrt(I * I + D * D);
- return Et /= Ct, u * (D /= Ct) < v * (I /= Ct) && (u = -u, v = -v, Et = -Et, mt = -mt), { scale: new Gt(mt, 0, 0, Ct, 0, 0), translate: new Gt(1, 0, 0, 1, K, lt), rotate: new Gt(u, v, -v, u, 0, 0), skew: new Gt(1, 0, Et, 1, 0, 0) };
- }, Gt.prototype.toString = function(u) {
- return this.join(" ");
- }, Gt.prototype.inversed = function() {
- var u = this.sx, v = this.shy, I = this.shx, D = this.sy, K = this.tx, lt = this.ty, mt = 1 / (u * D - v * I), Et = D * mt, Ct = -v * mt, Xt = -I * mt, te = u * mt;
- return new Gt(Et, Ct, Xt, te, -Et * K - Xt * lt, -Ct * K - te * lt);
- }, Gt.prototype.applyToPoint = function(u) {
- var v = u.x * this.sx + u.y * this.shx + this.tx, I = u.x * this.shy + u.y * this.sy + this.ty;
- return new ii(v, I);
- }, Gt.prototype.applyToRectangle = function(u) {
- var v = this.applyToPoint(u), I = this.applyToPoint(new ii(u.x + u.w, u.y + u.h));
- return new pa(v.x, v.y, I.x - v.x, I.y - v.y);
- }, Gt.prototype.clone = function() {
- var u = this.sx, v = this.shy, I = this.shx, D = this.sy, K = this.tx, lt = this.ty;
- return new Gt(u, v, I, D, K, lt);
- }, p.Matrix = Gt;
- var wr = p.matrixMult = function(u, v) {
- return v.multiply(u);
- }, yr = new Gt(1, 0, 0, 1, 0, 0);
- p.unitMatrix = p.identityMatrix = yr;
- var Tn = function(u, v) {
- if (!ke[u]) {
- var I = (v instanceof wi ? "Sh" : "P") + (Object.keys(Ut).length + 1).toString(10);
- v.id = I, ke[u] = I, Ut[I] = v, be.publish("addPattern", v);
- }
- };
- p.ShadingPattern = wi, p.TilingPattern = Qi, p.addShadingPattern = function(u, v) {
- return R("addShadingPattern()"), Tn(u, v), this;
- }, p.beginTilingPattern = function(u) {
- R("beginTilingPattern()"), ga(u.boundingBox[0], u.boundingBox[1], u.boundingBox[2] - u.boundingBox[0], u.boundingBox[3] - u.boundingBox[1], u.matrix);
- }, p.endTilingPattern = function(u, v) {
- R("endTilingPattern()"), v.stream = _t[B].join(`
- `), Tn(u, v), be.publish("endTilingPattern", v), rr.pop().restore();
- };
- var Dn, De = p.__private__.newObject = function() {
- var u = rn();
- return sn(u, !0), u;
- }, rn = p.__private__.newObjectDeferred = function() {
- return J++, Z[J] = function() {
- return st;
- }, J;
- }, sn = function(u, v) {
- return v = typeof v == "boolean" && v, Z[u] = st, v && P(u + " 0 obj"), u;
- }, ti = p.__private__.newAdditionalObject = function() {
- var u = { objId: rn(), content: "" };
- return gt.push(u), u;
- }, jr = rn(), Gn = rn(), ir = p.__private__.decodeColorString = function(u) {
- var v = u.split(" ");
- if (v.length !== 2 || v[1] !== "g" && v[1] !== "G") v.length !== 5 || v[4] !== "k" && v[4] !== "K" || (v = [(1 - v[0]) * (1 - v[3]), (1 - v[1]) * (1 - v[3]), (1 - v[2]) * (1 - v[3]), "r"]);
- else {
- var I = parseFloat(v[0]);
- v = [I, I, I, "r"];
- }
- for (var D = "#", K = 0; K < 3; K++) D += ("0" + Math.floor(255 * parseFloat(v[K])).toString(16)).slice(-2);
- return D;
- }, Yn = p.__private__.encodeColorString = function(u) {
- var v;
- typeof u == "string" && (u = { ch1: u });
- var I = u.ch1, D = u.ch2, K = u.ch3, lt = u.ch4, mt = u.pdfColorType === "draw" ? ["G", "RG", "K"] : ["g", "rg", "k"];
- if (typeof I == "string" && I.charAt(0) !== "#") {
- var Et = new kh(I);
- if (Et.ok) I = Et.toHex();
- else if (!/^\d*\.?\d*$/.test(I)) throw new Error('Invalid color "' + I + '" passed to jsPDF.encodeColorString.');
- }
- if (typeof I == "string" && /^#[0-9A-Fa-f]{3}$/.test(I) && (I = "#" + I[1] + I[1] + I[2] + I[2] + I[3] + I[3]), typeof I == "string" && /^#[0-9A-Fa-f]{6}$/.test(I)) {
- var Ct = parseInt(I.substr(1), 16);
- I = Ct >> 16 & 255, D = Ct >> 8 & 255, K = 255 & Ct;
- }
- if (D === void 0 || lt === void 0 && I === D && D === K) v = typeof I == "string" ? I + " " + mt[0] : u.precision === 2 ? N(I / 255) + " " + mt[0] : E(I / 255) + " " + mt[0];
- else if (lt === void 0 || Se(lt) === "object") {
- if (lt && !isNaN(lt.a) && lt.a === 0) return ["1.", "1.", "1.", mt[1]].join(" ");
- v = typeof I == "string" ? [I, D, K, mt[1]].join(" ") : u.precision === 2 ? [N(I / 255), N(D / 255), N(K / 255), mt[1]].join(" ") : [E(I / 255), E(D / 255), E(K / 255), mt[1]].join(" ");
- } else v = typeof I == "string" ? [I, D, K, lt, mt[2]].join(" ") : u.precision === 2 ? [N(I), N(D), N(K), N(lt), mt[2]].join(" ") : [E(I), E(D), E(K), E(lt), mt[2]].join(" ");
- return v;
- }, Jn = p.__private__.getFilters = function() {
- return c;
- }, qn = p.__private__.putStream = function(u) {
- var v = (u = u || {}).data || "", I = u.filters || Jn(), D = u.alreadyAppliedFilters || [], K = u.addLength1 || !1, lt = v.length, mt = u.objectId, Et = function(Ce) {
- return Ce;
- };
- if (m !== null && mt === void 0) throw new Error("ObjectId must be passed to putStream for file encryption");
- m !== null && (Et = on.encryptor(mt, 0));
- var Ct = {};
- I === !0 && (I = ["FlateEncode"]);
- var Xt = u.additionalKeyValues || [], te = (Ct = Tt.API.processDataByFilters !== void 0 ? Tt.API.processDataByFilters(v, I) : { data: v, reverseChain: [] }).reverseChain + (Array.isArray(D) ? D.join(" ") : D.toString());
- if (Ct.data.length !== 0 && (Xt.push({ key: "Length", value: Ct.data.length }), K === !0 && Xt.push({ key: "Length1", value: lt })), te.length != 0) if (te.split("/").length - 1 == 1) Xt.push({ key: "Filter", value: te });
- else {
- Xt.push({ key: "Filter", value: "[" + te + "]" });
- for (var de = 0; de < Xt.length; de += 1) if (Xt[de].key === "DecodeParms") {
- for (var $e = [], Ae = 0; Ae < Ct.reverseChain.split("/").length - 1; Ae += 1) $e.push("null");
- $e.push(Xt[de].value), Xt[de].value = "[" + $e.join(" ") + "]";
- }
- }
- P("<<");
- for (var _e = 0; _e < Xt.length; _e++) P("/" + Xt[_e].key + " " + Xt[_e].value);
- P(">>"), Ct.data.length !== 0 && (P("stream"), P(Et(Ct.data)), P("endstream"));
- }, ei = p.__private__.putPage = function(u) {
- var v = u.number, I = u.data, D = u.objId, K = u.contentsObjId;
- sn(D, !0), P("<</Type /Page"), P("/Parent " + u.rootDictionaryObjId + " 0 R"), P("/Resources " + u.resourceDictionaryObjId + " 0 R"), P("/MediaBox [" + parseFloat(X(u.mediaBox.bottomLeftX)) + " " + parseFloat(X(u.mediaBox.bottomLeftY)) + " " + X(u.mediaBox.topRightX) + " " + X(u.mediaBox.topRightY) + "]"), u.cropBox !== null && P("/CropBox [" + X(u.cropBox.bottomLeftX) + " " + X(u.cropBox.bottomLeftY) + " " + X(u.cropBox.topRightX) + " " + X(u.cropBox.topRightY) + "]"), u.bleedBox !== null && P("/BleedBox [" + X(u.bleedBox.bottomLeftX) + " " + X(u.bleedBox.bottomLeftY) + " " + X(u.bleedBox.topRightX) + " " + X(u.bleedBox.topRightY) + "]"), u.trimBox !== null && P("/TrimBox [" + X(u.trimBox.bottomLeftX) + " " + X(u.trimBox.bottomLeftY) + " " + X(u.trimBox.topRightX) + " " + X(u.trimBox.topRightY) + "]"), u.artBox !== null && P("/ArtBox [" + X(u.artBox.bottomLeftX) + " " + X(u.artBox.bottomLeftY) + " " + X(u.artBox.topRightX) + " " + X(u.artBox.topRightY) + "]"), typeof u.userUnit == "number" && u.userUnit !== 1 && P("/UserUnit " + u.userUnit), be.publish("putPage", { objId: D, pageContext: Vt[v], pageNumber: v, page: I }), P("/Contents " + K + " 0 R"), P(">>"), P("endobj");
- var lt = I.join(`
- `);
- return q === G && (lt += `
- Q`), sn(K, !0), qn({ data: lt, filters: Jn(), objectId: K }), P("endobj"), D;
- }, ar = p.__private__.putPages = function() {
- var u, v, I = [];
- for (u = 1; u <= le; u++) Vt[u].objId = rn(), Vt[u].contentsObjId = rn();
- for (u = 1; u <= le; u++) I.push(ei({ number: u, data: _t[u], objId: Vt[u].objId, contentsObjId: Vt[u].contentsObjId, mediaBox: Vt[u].mediaBox, cropBox: Vt[u].cropBox, bleedBox: Vt[u].bleedBox, trimBox: Vt[u].trimBox, artBox: Vt[u].artBox, userUnit: Vt[u].userUnit, rootDictionaryObjId: jr, resourceDictionaryObjId: Gn }));
- sn(jr, !0), P("<</Type /Pages");
- var D = "/Kids [";
- for (v = 0; v < le; v++) D += I[v] + " 0 R ";
- P(D + "]"), P("/Count " + le), P(">>"), P("endobj"), be.publish("postPutPages");
- }, ni = function(u) {
- be.publish("putFont", { font: u, out: P, newObject: De, putStream: qn }), u.isAlreadyPutted !== !0 && (u.objectNumber = De(), P("<<"), P("/Type /Font"), P("/BaseFont /" + Zi(u.postScriptName)), P("/Subtype /Type1"), typeof u.encoding == "string" && P("/Encoding /" + u.encoding), P("/FirstChar 32"), P("/LastChar 255"), P(">>"), P("endobj"));
- }, Si = function(u) {
- u.objectNumber = De();
- var v = [];
- v.push({ key: "Type", value: "/XObject" }), v.push({ key: "Subtype", value: "/Form" }), v.push({ key: "BBox", value: "[" + [X(u.x), X(u.y), X(u.x + u.width), X(u.y + u.height)].join(" ") + "]" }), v.push({ key: "Matrix", value: "[" + u.matrix.toString() + "]" });
- var I = u.pages[1].join(`
- `);
- qn({ data: I, additionalKeyValues: v, objectId: u.objectNumber }), P("endobj");
- }, ki = function(u, v) {
- v || (v = 21);
- var I = De(), D = function(mt, Et) {
- var Ct, Xt = [], te = 1 / (Et - 1);
- for (Ct = 0; Ct < 1; Ct += te) Xt.push(Ct);
- if (Xt.push(1), mt[0].offset != 0) {
- var de = { offset: 0, color: mt[0].color };
- mt.unshift(de);
- }
- if (mt[mt.length - 1].offset != 1) {
- var $e = { offset: 1, color: mt[mt.length - 1].color };
- mt.push($e);
- }
- for (var Ae = "", _e = 0, Ce = 0; Ce < Xt.length; Ce++) {
- for (Ct = Xt[Ce]; Ct > mt[_e + 1].offset; ) _e++;
- var Re = mt[_e].offset, Te = (Ct - Re) / (mt[_e + 1].offset - Re), cn = mt[_e].color, Sr = mt[_e + 1].color;
- Ae += H(Math.round((1 - Te) * cn[0] + Te * Sr[0]).toString(16)) + H(Math.round((1 - Te) * cn[1] + Te * Sr[1]).toString(16)) + H(Math.round((1 - Te) * cn[2] + Te * Sr[2]).toString(16));
- }
- return Ae.trim();
- }(u.colors, v), K = [];
- K.push({ key: "FunctionType", value: "0" }), K.push({ key: "Domain", value: "[0.0 1.0]" }), K.push({ key: "Size", value: "[" + v + "]" }), K.push({ key: "BitsPerSample", value: "8" }), K.push({ key: "Range", value: "[0.0 1.0 0.0 1.0 0.0 1.0]" }), K.push({ key: "Decode", value: "[0.0 1.0 0.0 1.0 0.0 1.0]" }), qn({ data: D, additionalKeyValues: K, alreadyAppliedFilters: ["/ASCIIHexDecode"], objectId: I }), P("endobj"), u.objectNumber = De(), P("<< /ShadingType " + u.type), P("/ColorSpace /DeviceRGB");
- var lt = "/Coords [" + X(parseFloat(u.coords[0])) + " " + X(parseFloat(u.coords[1])) + " ";
- u.type === 2 ? lt += X(parseFloat(u.coords[2])) + " " + X(parseFloat(u.coords[3])) : lt += X(parseFloat(u.coords[2])) + " " + X(parseFloat(u.coords[3])) + " " + X(parseFloat(u.coords[4])) + " " + X(parseFloat(u.coords[5])), P(lt += "]"), u.matrix && P("/Matrix [" + u.matrix.toString() + "]"), P("/Function " + I + " 0 R"), P("/Extend [true true]"), P(">>"), P("endobj");
- }, Pi = function(u, v) {
- var I = rn(), D = De();
- v.push({ resourcesOid: I, objectOid: D }), u.objectNumber = D;
- var K = [];
- K.push({ key: "Type", value: "/Pattern" }), K.push({ key: "PatternType", value: "1" }), K.push({ key: "PaintType", value: "1" }), K.push({ key: "TilingType", value: "1" }), K.push({ key: "BBox", value: "[" + u.boundingBox.map(X).join(" ") + "]" }), K.push({ key: "XStep", value: X(u.xStep) }), K.push({ key: "YStep", value: X(u.yStep) }), K.push({ key: "Resources", value: I + " 0 R" }), u.matrix && K.push({ key: "Matrix", value: "[" + u.matrix.toString() + "]" }), qn({ data: u.stream, additionalKeyValues: K, objectId: u.objectNumber }), P("endobj");
- }, Bs = function(u) {
- for (var v in u.objectNumber = De(), P("<<"), u) switch (v) {
- case "opacity":
- P("/ca " + N(u[v]));
- break;
- case "stroke-opacity":
- P("/CA " + N(u[v]));
- }
- P(">>"), P("endobj");
- }, sa = function(u) {
- sn(u.resourcesOid, !0), P("<<"), P("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"), function() {
- for (var v in P("/Font <<"), se) se.hasOwnProperty(v) && (_ === !1 || _ === !0 && k.hasOwnProperty(v)) && P("/" + v + " " + se[v].objectNumber + " 0 R");
- P(">>");
- }(), function() {
- if (Object.keys(Ut).length > 0) {
- for (var v in P("/Shading <<"), Ut) Ut.hasOwnProperty(v) && Ut[v] instanceof wi && Ut[v].objectNumber >= 0 && P("/" + v + " " + Ut[v].objectNumber + " 0 R");
- be.publish("putShadingPatternDict"), P(">>");
- }
- }(), function(v) {
- if (Object.keys(Ut).length > 0) {
- for (var I in P("/Pattern <<"), Ut) Ut.hasOwnProperty(I) && Ut[I] instanceof p.TilingPattern && Ut[I].objectNumber >= 0 && Ut[I].objectNumber < v && P("/" + I + " " + Ut[I].objectNumber + " 0 R");
- be.publish("putTilingPatternDict"), P(">>");
- }
- }(u.objectOid), function() {
- if (Object.keys(Yt).length > 0) {
- var v;
- for (v in P("/ExtGState <<"), Yt) Yt.hasOwnProperty(v) && Yt[v].objectNumber >= 0 && P("/" + v + " " + Yt[v].objectNumber + " 0 R");
- be.publish("putGStateDict"), P(">>");
- }
- }(), function() {
- for (var v in P("/XObject <<"), fn) fn.hasOwnProperty(v) && fn[v].objectNumber >= 0 && P("/" + v + " " + fn[v].objectNumber + " 0 R");
- be.publish("putXobjectDict"), P(">>");
- }(), P(">>"), P("endobj");
- }, Ba = function(u) {
- oe[u.fontName] = oe[u.fontName] || {}, oe[u.fontName][u.fontStyle] = u.id;
- }, Ma = function(u, v, I, D, K) {
- var lt = { id: "F" + (Object.keys(se).length + 1).toString(10), postScriptName: u, fontName: v, fontStyle: I, encoding: D, isStandardFont: K || !1, metadata: {} };
- return be.publish("addFont", { font: lt, instance: this }), se[lt.id] = lt, Ba(lt), lt.id;
- }, Un = p.__private__.pdfEscape = p.pdfEscape = function(u, v) {
- return function(I, D) {
- var K, lt, mt, Et, Ct, Xt, te, de, $e;
- if (mt = (D = D || {}).sourceEncoding || "Unicode", Ct = D.outputEncoding, (D.autoencode || Ct) && se[Bt].metadata && se[Bt].metadata[mt] && se[Bt].metadata[mt].encoding && (Et = se[Bt].metadata[mt].encoding, !Ct && se[Bt].encoding && (Ct = se[Bt].encoding), !Ct && Et.codePages && (Ct = Et.codePages[0]), typeof Ct == "string" && (Ct = Et[Ct]), Ct)) {
- for (te = !1, Xt = [], K = 0, lt = I.length; K < lt; K++) (de = Ct[I.charCodeAt(K)]) ? Xt.push(String.fromCharCode(de)) : Xt.push(I[K]), Xt[K].charCodeAt(0) >> 8 && (te = !0);
- I = Xt.join("");
- }
- for (K = I.length; te === void 0 && K !== 0; ) I.charCodeAt(K - 1) >> 8 && (te = !0), K--;
- if (!te) return I;
- for (Xt = D.noBOM ? [] : [254, 255], K = 0, lt = I.length; K < lt; K++) {
- if (($e = (de = I.charCodeAt(K)) >> 8) >> 8) throw new Error("Character at position " + K + " of string '" + I + "' exceeds 16bits. Cannot be encoded into UCS-2 BE");
- Xt.push($e), Xt.push(de - ($e << 8));
- }
- return String.fromCharCode.apply(void 0, Xt);
- }(u, v).replace(/\\/g, "\\\\").replace(/\(/g, "\\(").replace(/\)/g, "\\)");
- }, oa = p.__private__.beginPage = function(u) {
- _t[++le] = [], Vt[le] = { objId: 0, contentsObjId: 0, userUnit: Number(l), artBox: null, bleedBox: null, cropBox: null, trimBox: null, mediaBox: { bottomLeftX: 0, bottomLeftY: 0, topRightX: Number(u[0]), topRightY: Number(u[1]) } }, Ta(le), Dt(_t[B]);
- }, Ra = function(u, v) {
- var I, D, K;
- switch (t = v || t, typeof u == "string" && (I = S(u.toLowerCase()), Array.isArray(I) && (D = I[0], K = I[1])), Array.isArray(u) && (D = u[0] * ne, K = u[1] * ne), isNaN(D) && (D = s[0], K = s[1]), (D > 14400 || K > 14400) && (Le.warn("A page in a PDF can not be wider or taller than 14400 userUnit. jsPDF limits the width/height to 14400"), D = Math.min(14400, D), K = Math.min(14400, K)), s = [D, K], t.substr(0, 1)) {
- case "l":
- K > D && (s = [K, D]);
- break;
- case "p":
- D > K && (s = [K, D]);
- }
- oa(s), Vs(Jt), P(ji), ca !== 0 && P(ca + " J"), Rr !== 0 && P(Rr + " j"), be.publish("addPage", { pageNumber: le });
- }, la = function(u) {
- u > 0 && u <= le && (_t.splice(u, 1), Vt.splice(u, 1), le--, B > le && (B = le), this.setPage(B));
- }, Ta = function(u) {
- u > 0 && u <= le && (B = u);
- }, Da = p.__private__.getNumberOfPages = p.getNumberOfPages = function() {
- return _t.length - 1;
- }, qa = function(u, v, I) {
- var D, K = void 0;
- return I = I || {}, u = u !== void 0 ? u : se[Bt].fontName, v = v !== void 0 ? v : se[Bt].fontStyle, D = u.toLowerCase(), oe[D] !== void 0 && oe[D][v] !== void 0 ? K = oe[D][v] : oe[u] !== void 0 && oe[u][v] !== void 0 ? K = oe[u][v] : I.disableWarning === !1 && Le.warn("Unable to look up font label for font '" + u + "', '" + v + "'. Refer to getFontList() for available fonts."), K || I.noFallback || (K = oe.times[v]) == null && (K = oe.times.normal), K;
- }, sr = p.__private__.putInfo = function() {
- var u = De(), v = function(D) {
- return D;
- };
- for (var I in m !== null && (v = on.encryptor(u, 0)), P("<<"), P("/Producer (" + Un(v("jsPDF " + Tt.version)) + ")"), he) he.hasOwnProperty(I) && he[I] && P("/" + I.substr(0, 1).toUpperCase() + I.substr(1) + " (" + Un(v(he[I])) + ")");
- P("/CreationDate (" + Un(v(rt)) + ")"), P(">>"), P("endobj");
- }, Ii = p.__private__.putCatalog = function(u) {
- var v = (u = u || {}).rootDictionaryObjId || jr;
- switch (De(), P("<<"), P("/Type /Catalog"), P("/Pages " + v + " 0 R"), Wt || (Wt = "fullwidth"), Wt) {
- case "fullwidth":
- P("/OpenAction [3 0 R /FitH null]");
- break;
- case "fullheight":
- P("/OpenAction [3 0 R /FitV null]");
- break;
- case "fullpage":
- P("/OpenAction [3 0 R /Fit]");
- break;
- case "original":
- P("/OpenAction [3 0 R /XYZ null null 1]");
- break;
- default:
- var I = "" + Wt;
- I.substr(I.length - 1) === "%" && (Wt = parseInt(Wt) / 100), typeof Wt == "number" && P("/OpenAction [3 0 R /XYZ null null " + N(Wt) + "]");
- }
- switch (ue || (ue = "continuous"), ue) {
- case "continuous":
- P("/PageLayout /OneColumn");
- break;
- case "single":
- P("/PageLayout /SinglePage");
- break;
- case "two":
- case "twoleft":
- P("/PageLayout /TwoColumnLeft");
- break;
- case "tworight":
- P("/PageLayout /TwoColumnRight");
- }
- qt && P("/PageMode /" + qt), be.publish("putCatalog"), P(">>"), P("endobj");
- }, Ms = p.__private__.putTrailer = function() {
- P("trailer"), P("<<"), P("/Size " + (J + 1)), P("/Root " + J + " 0 R"), P("/Info " + (J - 1) + " 0 R"), m !== null && P("/Encrypt " + on.oid + " 0 R"), P("/ID [ <" + ot + "> <" + ot + "> ]"), P(">>");
- }, Xe = p.__private__.putHeader = function() {
- P("%PDF-" + j), P("%ºß¬à");
- }, Ua = p.__private__.putXRef = function() {
- var u = "0000000000";
- P("xref"), P("0 " + (J + 1)), P("0000000000 65535 f ");
- for (var v = 1; v <= J; v++) typeof Z[v] == "function" ? P((u + Z[v]()).slice(-10) + " 00000 n ") : Z[v] !== void 0 ? P((u + Z[v]).slice(-10) + " 00000 n ") : P("0000000000 00000 n ");
- }, or = p.__private__.buildDocument = function() {
- var u;
- J = 0, st = 0, at = [], Z = [], gt = [], jr = rn(), Gn = rn(), Dt(at), be.publish("buildDocument"), Xe(), ar(), function() {
- be.publish("putAdditionalObjects");
- for (var I = 0; I < gt.length; I++) {
- var D = gt[I];
- sn(D.objId, !0), P(D.content), P("endobj");
- }
- be.publish("postPutAdditionalObjects");
- }(), u = [], function() {
- for (var I in se) se.hasOwnProperty(I) && (_ === !1 || _ === !0 && k.hasOwnProperty(I)) && ni(se[I]);
- }(), function() {
- var I;
- for (I in Yt) Yt.hasOwnProperty(I) && Bs(Yt[I]);
- }(), function() {
- for (var I in fn) fn.hasOwnProperty(I) && Si(fn[I]);
- }(), function(I) {
- var D;
- for (D in Ut) Ut.hasOwnProperty(D) && (Ut[D] instanceof wi ? ki(Ut[D]) : Ut[D] instanceof Qi && Pi(Ut[D], I));
- }(u), be.publish("putResources"), u.forEach(sa), sa({ resourcesOid: Gn, objectOid: Number.MAX_SAFE_INTEGER }), be.publish("postPutResources"), m !== null && (on.oid = De(), P("<<"), P("/Filter /Standard"), P("/V " + on.v), P("/R " + on.r), P("/U <" + on.toHexString(on.U) + ">"), P("/O <" + on.toHexString(on.O) + ">"), P("/P " + on.P), P(">>"), P("endobj")), sr(), Ii();
- var v = st;
- return Ua(), Ms(), P("startxref"), P("" + v), P("%%EOF"), Dt(_t[B]), at.join(`
- `);
- }, Fi = p.__private__.getBlob = function(u) {
- return new Blob([ae(u)], { type: "application/pdf" });
- }, ua = function(u) {
- for (; u.firstChild; ) u.removeChild(u.firstChild);
- }, In = function(u) {
- var v, I = u.document, D = I.documentElement, K = I.head, lt = I.body;
- return K || (K = I.createElement("head"), D.appendChild(K)), lt || (lt = I.createElement("body"), D.appendChild(lt)), ua(K), ua(lt), (v = I.createElement("style")).appendChild(I.createTextNode("html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;}")), K.appendChild(v), { document: I, body: lt };
- }, Ci = p.output = p.__private__.output = (Dn = function(u, v) {
- switch (typeof (v = v || {}) == "string" ? v = { filename: v } : v.filename = v.filename || "generated.pdf", u) {
- case void 0:
- return or();
- case "save":
- p.save(v.filename);
- break;
- case "arraybuffer":
- return ae(or());
- case "blob":
- return Fi(or());
- case "bloburi":
- case "bloburl":
- if (Kt.URL !== void 0 && typeof Kt.URL.createObjectURL == "function") return Kt.URL && Kt.URL.createObjectURL(Fi(or())) || void 0;
- Le.warn("bloburl is not supported by your system, because URL.createObjectURL is not supported by your browser.");
- break;
- case "datauristring":
- case "dataurlstring":
- var I = "", D = or();
- try {
- I = Pu(D);
- } catch (cn) {
- I = Pu(unescape(encodeURIComponent(D)));
- }
- return "data:application/pdf;filename=" + encodeURIComponent(v.filename) + ";base64," + I;
- case "pdfobjectnewwindow":
- if (Object.prototype.toString.call(Kt) === "[object Window]") {
- var K = "https://cdnjs.cloudflare.com/ajax/libs/pdfobject/2.1.1/pdfobject.min.js", lt = !v.pdfObjectUrl;
- lt || (K = v.pdfObjectUrl);
- var mt = Kt.open();
- if (mt !== null) {
- var Et = In(mt), Ct = Et.document.createElement("script"), Xt = this;
- Ct.src = K, lt && (Ct.integrity = "sha512-4ze/a9/4jqu+tX9dfOqJYSvyYd5M6qum/3HpCLr+/Jqf0whc37VUbkpNGHR7/8pSnCFw47T1fmIpwBV7UySh3g==", Ct.crossOrigin = "anonymous"), Ct.onload = function() {
- mt.PDFObject.embed(Xt.output("dataurlstring"), v);
- }, Et.body.appendChild(Ct);
- }
- return mt;
- }
- throw new Error("The option pdfobjectnewwindow just works in a browser-environment.");
- case "pdfjsnewwindow":
- if (Object.prototype.toString.call(Kt) === "[object Window]") {
- var te = v.pdfJsUrl || "examples/PDF.js/web/viewer.html", de = Kt.open();
- if (de !== null) {
- var $e = In(de), Ae = $e.document.createElement("iframe"), _e = te.indexOf("?") === -1 ? "?" : "&";
- Xt = this, Ae.id = "pdfViewer", Ae.width = "500px", Ae.height = "400px", Ae.src = te + _e + "file=&downloadName=" + encodeURIComponent(v.filename), Ae.onload = function() {
- de.document.title = v.filename, Ae.contentWindow.PDFViewerApplication.open(Xt.output("bloburl"));
- }, $e.body.appendChild(Ae);
- }
- return de;
- }
- throw new Error("The option pdfjsnewwindow just works in a browser-environment.");
- case "dataurlnewwindow":
- if (Object.prototype.toString.call(Kt) !== "[object Window]") throw new Error("The option dataurlnewwindow just works in a browser-environment.");
- var Ce = Kt.open();
- if (Ce !== null) {
- var Re = In(Ce), Te = Re.document.createElement("iframe");
- Te.src = this.output("datauristring", v), Re.body.appendChild(Te), Ce.document.title = v.filename;
- }
- if (Ce || typeof safari == "undefined") return Ce;
- break;
- case "datauri":
- case "dataurl":
- return Kt.document.location.href = this.output("datauristring", v);
- default:
- return null;
- }
- }, Dn.foo = function() {
- try {
- return Dn.apply(this, arguments);
- } catch (I) {
- var u = I.stack || "";
- ~u.indexOf(" at ") && (u = u.split(" at ")[1]);
- var v = "Error in function " + u.split(`
- `)[0].split("<")[0] + ": " + I.message;
- if (!Kt.console) throw new Error(v);
- Kt.console.error(v, I), Kt.alert && alert(v);
- }
- }, Dn.foo.bar = Dn, Dn.foo), xr = function(u) {
- return Array.isArray(Qr) === !0 && Qr.indexOf(u) > -1;
- };
- switch (i) {
- case "pt":
- ne = 1;
- break;
- case "mm":
- ne = 72 / 25.4;
- break;
- case "cm":
- ne = 72 / 2.54;
- break;
- case "in":
- ne = 72;
- break;
- case "px":
- ne = xr("px_scaling") == 1 ? 0.75 : 96 / 72;
- break;
- case "pc":
- case "em":
- ne = 12;
- break;
- case "ex":
- ne = 6;
- break;
- default:
- if (typeof i != "number") throw new Error("Invalid unit: " + i);
- ne = i;
- }
- var on = null;
- wt(), nt();
- var za = p.__private__.getPageInfo = p.getPageInfo = function(u) {
- if (isNaN(u) || u % 1 != 0) throw new Error("Invalid argument passed to jsPDF.getPageInfo");
- return { objId: Vt[u].objId, pageNumber: u, pageContext: Vt[u] };
- }, Rs = p.__private__.getPageInfoByObjId = function(u) {
- if (isNaN(u) || u % 1 != 0) throw new Error("Invalid argument passed to jsPDF.getPageInfoByObjId");
- for (var v in Vt) if (Vt[v].objId === u) break;
- return za(v);
- }, Ts = p.__private__.getCurrentPageInfo = p.getCurrentPageInfo = function() {
- return { objId: Vt[B].objId, pageNumber: B, pageContext: Vt[B] };
- };
- p.addPage = function() {
- return Ra.apply(this, arguments), this;
- }, p.setPage = function() {
- return Ta.apply(this, arguments), Dt.call(this, _t[B]), this;
- }, p.insertPage = function(u) {
- return this.addPage(), this.movePage(B, u), this;
- }, p.movePage = function(u, v) {
- var I, D;
- if (u > v) {
- I = _t[u], D = Vt[u];
- for (var K = u; K > v; K--) _t[K] = _t[K - 1], Vt[K] = Vt[K - 1];
- _t[v] = I, Vt[v] = D, this.setPage(v);
- } else if (u < v) {
- I = _t[u], D = Vt[u];
- for (var lt = u; lt < v; lt++) _t[lt] = _t[lt + 1], Vt[lt] = Vt[lt + 1];
- _t[v] = I, Vt[v] = D, this.setPage(v);
- }
- return this;
- }, p.deletePage = function() {
- return la.apply(this, arguments), this;
- }, p.__private__.text = p.text = function(u, v, I, D, K) {
- var lt, mt, Et, Ct, Xt, te, de, $e, Ae, _e = (D = D || {}).scope || this;
- if (typeof u == "number" && typeof v == "number" && (typeof I == "string" || Array.isArray(I))) {
- var Ce = I;
- I = v, v = u, u = Ce;
- }
- if (arguments[3] instanceof Gt == 0 ? (Et = arguments[4], Ct = arguments[5], Se(de = arguments[3]) === "object" && de !== null || (typeof Et == "string" && (Ct = Et, Et = null), typeof de == "string" && (Ct = de, de = null), typeof de == "number" && (Et = de, de = null), D = { flags: de, angle: Et, align: Ct })) : (R("The transform parameter of text() with a Matrix value"), Ae = K), isNaN(v) || isNaN(I) || u == null) throw new Error("Invalid arguments passed to jsPDF.text");
- if (u.length === 0) return _e;
- var Re, Te = "", cn = typeof D.lineHeightFactor == "number" ? D.lineHeightFactor : ri, Sr = _e.internal.scaleFactor;
- function ma(Pe) {
- return Pe = Pe.split(" ").join(Array(D.TabLen || 9).join(" ")), Un(Pe, de);
- }
- function si(Pe) {
- for (var Ie, We = Pe.concat(), Qe = [], Pr = We.length; Pr--; ) typeof (Ie = We.shift()) == "string" ? Qe.push(Ie) : Array.isArray(Pe) && (Ie.length === 1 || Ie[1] === void 0 && Ie[2] === void 0) ? Qe.push(Ie[0]) : Qe.push([Ie[0], Ie[1], Ie[2]]);
- return Qe;
- }
- function oi(Pe, Ie) {
- var We;
- if (typeof Pe == "string") We = Ie(Pe)[0];
- else if (Array.isArray(Pe)) {
- for (var Qe, Pr, _a = Pe.concat(), Gi = [], Za = _a.length; Za--; ) typeof (Qe = _a.shift()) == "string" ? Gi.push(Ie(Qe)[0]) : Array.isArray(Qe) && typeof Qe[0] == "string" && (Pr = Ie(Qe[0], Qe[1], Qe[2]), Gi.push([Pr[0], Pr[1], Pr[2]]));
- We = Gi;
- }
- return We;
- }
- var Tr = !1, li = !0;
- if (typeof u == "string") Tr = !0;
- else if (Array.isArray(u)) {
- var Ti = u.concat();
- mt = [];
- for (var Di, dn = Ti.length; dn--; ) (typeof (Di = Ti.shift()) != "string" || Array.isArray(Di) && typeof Di[0] != "string") && (li = !1);
- Tr = li;
- }
- if (Tr === !1) throw new Error('Type of text must be string or Array. "' + u + '" is not recognized.');
- typeof u == "string" && (u = u.match(/[\r?\n]/) ? u.split(/\r\n|\r|\n/g) : [u]);
- var ui = yt / _e.internal.scaleFactor, hi = ui * (cn - 1);
- switch (D.baseline) {
- case "bottom":
- I -= hi;
- break;
- case "top":
- I += ui - hi;
- break;
- case "hanging":
- I += ui - 2 * hi;
- break;
- case "middle":
- I += ui / 2 - hi;
- }
- if ((te = D.maxWidth || 0) > 0 && (typeof u == "string" ? u = _e.splitTextToSize(u, te) : Object.prototype.toString.call(u) === "[object Array]" && (u = u.reduce(function(Pe, Ie) {
- return Pe.concat(_e.splitTextToSize(Ie, te));
- }, []))), lt = { text: u, x: v, y: I, options: D, mutex: { pdfEscape: Un, activeFontKey: Bt, fonts: se, activeFontSize: yt } }, be.publish("preProcessText", lt), u = lt.text, Et = (D = lt.options).angle, Ae instanceof Gt == 0 && Et && typeof Et == "number") {
- Et *= Math.PI / 180, D.rotationDirection === 0 && (Et = -Et), q === G && (Et = -Et);
- var va = Math.cos(Et), hr = Math.sin(Et);
- Ae = new Gt(va, hr, -hr, va, 0, 0);
- } else Et && Et instanceof Gt && (Ae = Et);
- q !== G || Ae || (Ae = yr), (Xt = D.charSpace || Bi) !== void 0 && (Te += X(z(Xt)) + ` Tc
- `, this.setCharSpace(this.getCharSpace() || 0)), ($e = D.horizontalScale) !== void 0 && (Te += X(100 * $e) + ` Tz
- `), D.lang;
- var yn = -1, Xa = D.renderingMode !== void 0 ? D.renderingMode : D.stroke, qi = _e.internal.getCurrentPageInfo().pageContext;
- switch (Xa) {
- case 0:
- case !1:
- case "fill":
- yn = 0;
- break;
- case 1:
- case !0:
- case "stroke":
- yn = 1;
- break;
- case 2:
- case "fillThenStroke":
- yn = 2;
- break;
- case 3:
- case "invisible":
- yn = 3;
- break;
- case 4:
- case "fillAndAddForClipping":
- yn = 4;
- break;
- case 5:
- case "strokeAndAddPathForClipping":
- yn = 5;
- break;
- case 6:
- case "fillThenStrokeAndAddToPathForClipping":
- yn = 6;
- break;
- case 7:
- case "addToPathForClipping":
- yn = 7;
- }
- var $a = qi.usedRenderingMode !== void 0 ? qi.usedRenderingMode : -1;
- yn !== -1 ? Te += yn + ` Tr
- ` : $a !== -1 && (Te += `0 Tr
- `), yn !== -1 && (qi.usedRenderingMode = yn), Ct = D.align || "left";
- var zn, fi = yt * cn, ba = _e.internal.pageSize.getWidth(), Ui = se[Bt];
- Xt = D.charSpace || Bi, te = D.maxWidth || 0, de = Object.assign({ autoencode: !0, noBOM: !0 }, D.flags);
- var ci = [], wa = function(Pe) {
- return _e.getStringUnitWidth(Pe, { font: Ui, charSpace: Xt, fontSize: yt, doKerning: !1 }) * yt / Sr;
- };
- if (Object.prototype.toString.call(u) === "[object Array]") {
- var xn;
- mt = si(u), Ct !== "left" && (zn = mt.map(wa));
- var Ln, zi = 0;
- if (Ct === "right") {
- v -= zn[0], u = [], dn = mt.length;
- for (var Dr = 0; Dr < dn; Dr++) Dr === 0 ? (Ln = _r(v), xn = Ar(I)) : (Ln = z(zi - zn[Dr]), xn = -fi), u.push([mt[Dr], Ln, xn]), zi = zn[Dr];
- } else if (Ct === "center") {
- v -= zn[0] / 2, u = [], dn = mt.length;
- for (var qr = 0; qr < dn; qr++) qr === 0 ? (Ln = _r(v), xn = Ar(I)) : (Ln = z((zi - zn[qr]) / 2), xn = -fi), u.push([mt[qr], Ln, xn]), zi = zn[qr];
- } else if (Ct === "left") {
- u = [], dn = mt.length;
- for (var Hi = 0; Hi < dn; Hi++) u.push(mt[Hi]);
- } else if (Ct === "justify" && Ui.encoding === "Identity-H") {
- u = [], dn = mt.length, te = te !== 0 ? te : ba;
- for (var di = 0, Ze = 0; Ze < dn; Ze++) if (xn = Ze === 0 ? Ar(I) : -fi, Ln = Ze === 0 ? _r(v) : di, Ze < dn - 1) {
- var Qs = z((te - zn[Ze]) / (mt[Ze].split(" ").length - 1)), fr = mt[Ze].split(" ");
- u.push([fr[0] + " ", Ln, xn]), di = 0;
- for (var Kn = 1; Kn < fr.length; Kn++) {
- var pi = (wa(fr[Kn - 1] + " " + fr[Kn]) - wa(fr[Kn])) * Sr + Qs;
- Kn == fr.length - 1 ? u.push([fr[Kn], pi, 0]) : u.push([fr[Kn] + " ", pi, 0]), di -= pi;
- }
- } else u.push([mt[Ze], Ln, xn]);
- u.push(["", di, 0]);
- } else {
- if (Ct !== "justify") throw new Error('Unrecognized alignment option, use "left", "center", "right" or "justify".');
- for (u = [], dn = mt.length, te = te !== 0 ? te : ba, Ze = 0; Ze < dn; Ze++) {
- xn = Ze === 0 ? Ar(I) : -fi, Ln = Ze === 0 ? _r(v) : 0;
- var ya = mt[Ze].split(" ").length - 1, xa = ya > 0 ? (te - zn[Ze]) / ya : 0;
- Ze < dn - 1 ? ci.push(X(z(xa))) : ci.push(0), u.push([mt[Ze], Ln, xn]);
- }
- }
- }
- (typeof D.R2L == "boolean" ? D.R2L : zt) === !0 && (u = oi(u, function(Pe, Ie, We) {
- return [Pe.split("").reverse().join(""), Ie, We];
- })), lt = { text: u, x: v, y: I, options: D, mutex: { pdfEscape: Un, activeFontKey: Bt, fonts: se, activeFontSize: yt } }, be.publish("postProcessText", lt), u = lt.text, Re = lt.mutex.isHex || !1;
- var Wi = se[Bt].encoding;
- Wi !== "WinAnsiEncoding" && Wi !== "StandardEncoding" || (u = oi(u, function(Pe, Ie, We) {
- return [ma(Pe), Ie, We];
- })), mt = si(u), u = [];
- for (var gi, mi, Ur, kr = Array.isArray(mt[0]) ? 1 : 0, zr = "", Vi = function(Pe, Ie, We) {
- var Qe = "";
- return We instanceof Gt ? (We = typeof D.angle == "number" ? wr(We, new Gt(1, 0, 0, 1, Pe, Ie)) : wr(new Gt(1, 0, 0, 1, Pe, Ie), We), q === G && (We = wr(new Gt(1, 0, 0, -1, 0, 0), We)), Qe = We.join(" ") + ` Tm
- `) : Qe = X(Pe) + " " + X(Ie) + ` Td
- `, Qe;
- }, pn = 0; pn < mt.length; pn++) {
- switch (zr = "", kr) {
- case 1:
- Ur = (Re ? "<" : "(") + mt[pn][0] + (Re ? ">" : ")"), gi = parseFloat(mt[pn][1]), mi = parseFloat(mt[pn][2]);
- break;
- case 0:
- Ur = (Re ? "<" : "(") + mt[pn] + (Re ? ">" : ")"), gi = _r(v), mi = Ar(I);
- }
- ci !== void 0 && ci[pn] !== void 0 && (zr = ci[pn] + ` Tw
- `), pn === 0 ? u.push(zr + Vi(gi, mi, Ae) + Ur) : kr === 0 ? u.push(zr + Ur) : kr === 1 && u.push(zr + Vi(gi, mi, Ae) + Ur);
- }
- u = kr === 0 ? u.join(` Tj
- T* `) : u.join(` Tj
- `), u += ` Tj
- `;
- var cr = `BT
- /`;
- return cr += Bt + " " + yt + ` Tf
- `, cr += X(yt * cn) + ` TL
- `, cr += ur + `
- `, cr += Te, cr += u, P(cr += "ET"), k[Bt] = !0, _e;
- };
- var Ds = p.__private__.clip = p.clip = function(u) {
- return P(u === "evenodd" ? "W*" : "W"), this;
- };
- p.clipEvenOdd = function() {
- return Ds("evenodd");
- }, p.__private__.discardPath = p.discardPath = function() {
- return P("n"), this;
- };
- var lr = p.__private__.isValidStyle = function(u) {
- var v = !1;
- return [void 0, null, "S", "D", "F", "DF", "FD", "f", "f*", "B", "B*", "n"].indexOf(u) !== -1 && (v = !0), v;
- };
- p.__private__.setDefaultPathOperation = p.setDefaultPathOperation = function(u) {
- return lr(u) && (d = u), this;
- };
- var Ha = p.__private__.getStyle = p.getStyle = function(u) {
- var v = d;
- switch (u) {
- case "D":
- case "S":
- v = "S";
- break;
- case "F":
- v = "f";
- break;
- case "FD":
- case "DF":
- v = "B";
- break;
- case "f":
- case "f*":
- case "B":
- case "B*":
- v = u;
- }
- return v;
- }, Ei = p.close = function() {
- return P("h"), this;
- };
- p.stroke = function() {
- return P("S"), this;
- }, p.fill = function(u) {
- return Oi("f", u), this;
- }, p.fillEvenOdd = function(u) {
- return Oi("f*", u), this;
- }, p.fillStroke = function(u) {
- return Oi("B", u), this;
- }, p.fillStrokeEvenOdd = function(u) {
- return Oi("B*", u), this;
- };
- var Oi = function(u, v) {
- Se(v) === "object" ? Us(v, u) : P(u);
- }, ha = function(u) {
- u === null || q === G && u === void 0 || (u = Ha(u), P(u));
- };
- function qs(u, v, I, D, K) {
- var lt = new Qi(v || this.boundingBox, I || this.xStep, D || this.yStep, this.gState, K || this.matrix);
- lt.stream = this.stream;
- var mt = u + "$$" + this.cloneIndex++ + "$$";
- return Tn(mt, lt), lt;
- }
- var Us = function(u, v) {
- var I = ke[u.key], D = Ut[I];
- if (D instanceof wi) P("q"), P(zs(v)), D.gState && p.setGState(D.gState), P(u.matrix.toString() + " cm"), P("/" + I + " sh"), P("Q");
- else if (D instanceof Qi) {
- var K = new Gt(1, 0, 0, -1, 0, ai());
- u.matrix && (K = K.multiply(u.matrix || yr), I = qs.call(D, u.key, u.boundingBox, u.xStep, u.yStep, K).id), P("q"), P("/Pattern cs"), P("/" + I + " scn"), D.gState && p.setGState(D.gState), P(v), P("Q");
- }
- }, zs = function(u) {
- switch (u) {
- case "f":
- case "F":
- case "n":
- return "W n";
- case "f*":
- return "W* n";
- case "B":
- case "S":
- return "W S";
- case "B*":
- return "W* S";
- }
- }, Br = p.moveTo = function(u, v) {
- return P(X(z(u)) + " " + X(U(v)) + " m"), this;
- }, Wa = p.lineTo = function(u, v) {
- return P(X(z(u)) + " " + X(U(v)) + " l"), this;
- }, Mr = p.curveTo = function(u, v, I, D, K, lt) {
- return P([X(z(u)), X(U(v)), X(z(I)), X(U(D)), X(z(K)), X(U(lt)), "c"].join(" ")), this;
- };
- p.__private__.line = p.line = function(u, v, I, D, K) {
- if (isNaN(u) || isNaN(v) || isNaN(I) || isNaN(D) || !lr(K)) throw new Error("Invalid arguments passed to jsPDF.line");
- return q === V ? this.lines([[I - u, D - v]], u, v, [1, 1], K || "S") : this.lines([[I - u, D - v]], u, v, [1, 1]).stroke();
- }, p.__private__.lines = p.lines = function(u, v, I, D, K, lt) {
- var mt, Et, Ct, Xt, te, de, $e, Ae, _e, Ce, Re, Te;
- if (typeof u == "number" && (Te = I, I = v, v = u, u = Te), D = D || [1, 1], lt = lt || !1, isNaN(v) || isNaN(I) || !Array.isArray(u) || !Array.isArray(D) || !lr(K) || typeof lt != "boolean") throw new Error("Invalid arguments passed to jsPDF.lines");
- for (Br(v, I), mt = D[0], Et = D[1], Xt = u.length, Ce = v, Re = I, Ct = 0; Ct < Xt; Ct++) (te = u[Ct]).length === 2 ? (Ce = te[0] * mt + Ce, Re = te[1] * Et + Re, Wa(Ce, Re)) : (de = te[0] * mt + Ce, $e = te[1] * Et + Re, Ae = te[2] * mt + Ce, _e = te[3] * Et + Re, Ce = te[4] * mt + Ce, Re = te[5] * Et + Re, Mr(de, $e, Ae, _e, Ce, Re));
- return lt && Ei(), ha(K), this;
- }, p.path = function(u) {
- for (var v = 0; v < u.length; v++) {
- var I = u[v], D = I.c;
- switch (I.op) {
- case "m":
- Br(D[0], D[1]);
- break;
- case "l":
- Wa(D[0], D[1]);
- break;
- case "c":
- Mr.apply(this, D);
- break;
- case "h":
- Ei();
- }
- }
- return this;
- }, p.__private__.rect = p.rect = function(u, v, I, D, K) {
- if (isNaN(u) || isNaN(v) || isNaN(I) || isNaN(D) || !lr(K)) throw new Error("Invalid arguments passed to jsPDF.rect");
- return q === V && (D = -D), P([X(z(u)), X(U(v)), X(z(I)), X(z(D)), "re"].join(" ")), ha(K), this;
- }, p.__private__.triangle = p.triangle = function(u, v, I, D, K, lt, mt) {
- if (isNaN(u) || isNaN(v) || isNaN(I) || isNaN(D) || isNaN(K) || isNaN(lt) || !lr(mt)) throw new Error("Invalid arguments passed to jsPDF.triangle");
- return this.lines([[I - u, D - v], [K - I, lt - D], [u - K, v - lt]], u, v, [1, 1], mt, !0), this;
- }, p.__private__.roundedRect = p.roundedRect = function(u, v, I, D, K, lt, mt) {
- if (isNaN(u) || isNaN(v) || isNaN(I) || isNaN(D) || isNaN(K) || isNaN(lt) || !lr(mt)) throw new Error("Invalid arguments passed to jsPDF.roundedRect");
- var Et = 4 / 3 * (Math.SQRT2 - 1);
- return K = Math.min(K, 0.5 * I), lt = Math.min(lt, 0.5 * D), this.lines([[I - 2 * K, 0], [K * Et, 0, K, lt - lt * Et, K, lt], [0, D - 2 * lt], [0, lt * Et, -K * Et, lt, -K, lt], [2 * K - I, 0], [-K * Et, 0, -K, -lt * Et, -K, -lt], [0, 2 * lt - D], [0, -lt * Et, K * Et, -lt, K, -lt]], u + K, v, [1, 1], mt, !0), this;
- }, p.__private__.ellipse = p.ellipse = function(u, v, I, D, K) {
- if (isNaN(u) || isNaN(v) || isNaN(I) || isNaN(D) || !lr(K)) throw new Error("Invalid arguments passed to jsPDF.ellipse");
- var lt = 4 / 3 * (Math.SQRT2 - 1) * I, mt = 4 / 3 * (Math.SQRT2 - 1) * D;
- return Br(u + I, v), Mr(u + I, v - mt, u + lt, v - D, u, v - D), Mr(u - lt, v - D, u - I, v - mt, u - I, v), Mr(u - I, v + mt, u - lt, v + D, u, v + D), Mr(u + lt, v + D, u + I, v + mt, u + I, v), ha(K), this;
- }, p.__private__.circle = p.circle = function(u, v, I, D) {
- if (isNaN(u) || isNaN(v) || isNaN(I) || !lr(D)) throw new Error("Invalid arguments passed to jsPDF.circle");
- return this.ellipse(u, v, I, I, D);
- }, p.setFont = function(u, v, I) {
- return I && (v = dt(v, I)), Bt = qa(u, v, { disableWarning: !1 }), this;
- };
- var Hs = p.__private__.getFont = p.getFont = function() {
- return se[qa.apply(p, arguments)];
- };
- p.__private__.getFontList = p.getFontList = function() {
- var u, v, I = {};
- for (u in oe) if (oe.hasOwnProperty(u)) for (v in I[u] = [], oe[u]) oe[u].hasOwnProperty(v) && I[u].push(v);
- return I;
- }, p.addFont = function(u, v, I, D, K) {
- var lt = ["StandardEncoding", "MacRomanEncoding", "Identity-H", "WinAnsiEncoding"];
- return arguments[3] && lt.indexOf(arguments[3]) !== -1 ? K = arguments[3] : arguments[3] && lt.indexOf(arguments[3]) == -1 && (I = dt(I, D)), Ma.call(this, u, v, I, K = K || "Identity-H");
- };
- var ri, Jt = n.lineWidth || 0.200025, Ws = p.__private__.getLineWidth = p.getLineWidth = function() {
- return Jt;
- }, Vs = p.__private__.setLineWidth = p.setLineWidth = function(u) {
- return Jt = u, P(X(z(u)) + " w"), this;
- };
- p.__private__.setLineDash = Tt.API.setLineDash = Tt.API.setLineDashPattern = function(u, v) {
- if (u = u || [], v = v || 0, isNaN(v) || !Array.isArray(u)) throw new Error("Invalid arguments passed to jsPDF.setLineDash");
- return u = u.map(function(I) {
- return X(z(I));
- }).join(" "), v = X(z(v)), P("[" + u + "] " + v + " d"), this;
- };
- var Gs = p.__private__.getLineHeight = p.getLineHeight = function() {
- return yt * ri;
- };
- p.__private__.getLineHeight = p.getLineHeight = function() {
- return yt * ri;
- };
- var Ys = p.__private__.setLineHeightFactor = p.setLineHeightFactor = function(u) {
- return typeof (u = u || 1.15) == "number" && (ri = u), this;
- }, Js = p.__private__.getLineHeightFactor = p.getLineHeightFactor = function() {
- return ri;
- };
- Ys(n.lineHeight);
- var _r = p.__private__.getHorizontalCoordinate = function(u) {
- return z(u);
- }, Ar = p.__private__.getVerticalCoordinate = function(u) {
- return q === G ? u : Vt[B].mediaBox.topRightY - Vt[B].mediaBox.bottomLeftY - z(u);
- }, Ks = p.__private__.getHorizontalCoordinateString = p.getHorizontalCoordinateString = function(u) {
- return X(_r(u));
- }, Xs = p.__private__.getVerticalCoordinateString = p.getVerticalCoordinateString = function(u) {
- return X(Ar(u));
- }, ji = n.strokeColor || "0 G";
- p.__private__.getStrokeColor = p.getDrawColor = function() {
- return ir(ji);
- }, p.__private__.setStrokeColor = p.setDrawColor = function(u, v, I, D) {
- return ji = Yn({ ch1: u, ch2: v, ch3: I, ch4: D, pdfColorType: "draw", precision: 2 }), P(ji), this;
- };
- var fa = n.fillColor || "0 g";
- p.__private__.getFillColor = p.getFillColor = function() {
- return ir(fa);
- }, p.__private__.setFillColor = p.setFillColor = function(u, v, I, D) {
- return fa = Yn({ ch1: u, ch2: v, ch3: I, ch4: D, pdfColorType: "fill", precision: 2 }), P(fa), this;
- };
- var ur = n.textColor || "0 g", $s = p.__private__.getTextColor = p.getTextColor = function() {
- return ir(ur);
- };
- p.__private__.setTextColor = p.setTextColor = function(u, v, I, D) {
- return ur = Yn({ ch1: u, ch2: v, ch3: I, ch4: D, pdfColorType: "text", precision: 3 }), this;
- };
- var Bi = n.charSpace, Zs = p.__private__.getCharSpace = p.getCharSpace = function() {
- return parseFloat(Bi || 0);
- };
- p.__private__.setCharSpace = p.setCharSpace = function(u) {
- if (isNaN(u)) throw new Error("Invalid argument passed to jsPDF.setCharSpace");
- return Bi = u, this;
- };
- var ca = 0;
- p.CapJoinStyles = { 0: 0, butt: 0, but: 0, miter: 0, 1: 1, round: 1, rounded: 1, circle: 1, 2: 2, projecting: 2, project: 2, square: 2, bevel: 2 }, p.__private__.setLineCap = p.setLineCap = function(u) {
- var v = p.CapJoinStyles[u];
- if (v === void 0) throw new Error("Line cap style of '" + u + "' is not recognized. See or extend .CapJoinStyles property for valid styles");
- return ca = v, P(v + " J"), this;
- };
- var Rr = 0;
- p.__private__.setLineJoin = p.setLineJoin = function(u) {
- var v = p.CapJoinStyles[u];
- if (v === void 0) throw new Error("Line join style of '" + u + "' is not recognized. See or extend .CapJoinStyles property for valid styles");
- return Rr = v, P(v + " j"), this;
- }, p.__private__.setLineMiterLimit = p.__private__.setMiterLimit = p.setLineMiterLimit = p.setMiterLimit = function(u) {
- if (u = u || 0, isNaN(u)) throw new Error("Invalid argument passed to jsPDF.setLineMiterLimit");
- return P(X(z(u)) + " M"), this;
- }, p.GState = Cs, p.setGState = function(u) {
- (u = typeof u == "string" ? Yt[Qt[u]] : da(null, u)).equals(Be) || (P("/" + u.id + " gs"), Be = u);
- };
- var da = function(u, v) {
- if (!u || !Qt[u]) {
- var I = !1;
- for (var D in Yt) if (Yt.hasOwnProperty(D) && Yt[D].equals(v)) {
- I = !0;
- break;
- }
- if (I) v = Yt[D];
- else {
- var K = "GS" + (Object.keys(Yt).length + 1).toString(10);
- Yt[K] = v, v.id = K;
- }
- return u && (Qt[u] = v.id), be.publish("addGState", v), v;
- }
- };
- p.addGState = function(u, v) {
- return da(u, v), this;
- }, p.saveGraphicsState = function() {
- return P("q"), je.push({ key: Bt, size: yt, color: ur }), this;
- }, p.restoreGraphicsState = function() {
- P("Q");
- var u = je.pop();
- return Bt = u.key, yt = u.size, ur = u.color, Be = null, this;
- }, p.setCurrentTransformationMatrix = function(u) {
- return P(u.toString() + " cm"), this;
- }, p.comment = function(u) {
- return P("#" + u), this;
- };
- var ii = function(u, v) {
- var I = u || 0;
- Object.defineProperty(this, "x", { enumerable: !0, get: function() {
- return I;
- }, set: function(lt) {
- isNaN(lt) || (I = parseFloat(lt));
- } });
- var D = v || 0;
- Object.defineProperty(this, "y", { enumerable: !0, get: function() {
- return D;
- }, set: function(lt) {
- isNaN(lt) || (D = parseFloat(lt));
- } });
- var K = "pt";
- return Object.defineProperty(this, "type", { enumerable: !0, get: function() {
- return K;
- }, set: function(lt) {
- K = lt.toString();
- } }), this;
- }, pa = function(u, v, I, D) {
- ii.call(this, u, v), this.type = "rect";
- var K = I || 0;
- Object.defineProperty(this, "w", { enumerable: !0, get: function() {
- return K;
- }, set: function(mt) {
- isNaN(mt) || (K = parseFloat(mt));
- } });
- var lt = D || 0;
- return Object.defineProperty(this, "h", { enumerable: !0, get: function() {
- return lt;
- }, set: function(mt) {
- isNaN(mt) || (lt = parseFloat(mt));
- } }), this;
- }, Mi = function() {
- this.page = le, this.currentPage = B, this.pages = _t.slice(0), this.pagesContext = Vt.slice(0), this.x = Rt, this.y = He, this.matrix = ge, this.width = Va(B), this.height = Lr(B), this.outputDestination = St, this.id = "", this.objectNumber = -1;
- };
- Mi.prototype.restore = function() {
- le = this.page, B = this.currentPage, Vt = this.pagesContext, _t = this.pages, Rt = this.x, He = this.y, ge = this.matrix, Nr(B, this.width), Ga(B, this.height), St = this.outputDestination;
- };
- var ga = function(u, v, I, D, K) {
- rr.push(new Mi()), le = B = 0, _t = [], Rt = u, He = v, ge = K, oa([I, D]);
- };
- for (var Ri in p.beginFormObject = function(u, v, I, D, K) {
- return ga(u, v, I, D, K), this;
- }, p.endFormObject = function(u) {
- return function(v) {
- if (br[v]) rr.pop().restore();
- else {
- var I = new Mi(), D = "Xo" + (Object.keys(fn).length + 1).toString(10);
- I.id = D, br[v] = D, fn[D] = I, be.publish("addFormObject", I), rr.pop().restore();
- }
- }(u), this;
- }, p.doFormObject = function(u, v) {
- var I = fn[br[u]];
- return P("q"), P(v.toString() + " cm"), P("/" + I.id + " Do"), P("Q"), this;
- }, p.getFormObject = function(u) {
- var v = fn[br[u]];
- return { x: v.x, y: v.y, width: v.width, height: v.height, matrix: v.matrix };
- }, p.save = function(u, v) {
- return u = u || "generated.pdf", (v = v || {}).returnPromise = v.returnPromise || !1, v.returnPromise === !1 ? (bi(Fi(or()), u), typeof bi.unload == "function" && Kt.setTimeout && setTimeout(bi.unload, 911), this) : new Promise(function(I, D) {
- try {
- var K = bi(Fi(or()), u);
- typeof bi.unload == "function" && Kt.setTimeout && setTimeout(bi.unload, 911), I(K);
- } catch (lt) {
- D(lt.message);
- }
- });
- }, Tt.API) Tt.API.hasOwnProperty(Ri) && (Ri === "events" && Tt.API.events.length ? function(u, v) {
- var I, D, K;
- for (K = v.length - 1; K !== -1; K--) I = v[K][0], D = v[K][1], u.subscribe.apply(u, [I].concat(typeof D == "function" ? [D] : D));
- }(be, Tt.API.events) : p[Ri] = Tt.API[Ri]);
- function Va(u) {
- return Vt[u].mediaBox.topRightX - Vt[u].mediaBox.bottomLeftX;
- }
- function Nr(u, v) {
- Vt[u].mediaBox.topRightX = v + Vt[u].mediaBox.bottomLeftX;
- }
- function Lr(u) {
- return Vt[u].mediaBox.topRightY - Vt[u].mediaBox.bottomLeftY;
- }
- function Ga(u, v) {
- Vt[u].mediaBox.topRightY = v + Vt[u].mediaBox.bottomLeftY;
- }
- var Ya = p.getPageWidth = function(u) {
- return Va(u = u || B) / ne;
- }, Ja = p.setPageWidth = function(u, v) {
- Nr(u, v * ne);
- }, ai = p.getPageHeight = function(u) {
- return Lr(u = u || B) / ne;
- }, Ka = p.setPageHeight = function(u, v) {
- Ga(u, v * ne);
- };
- return p.internal = { pdfEscape: Un, getStyle: Ha, getFont: Hs, getFontSize: It, getCharSpace: Zs, getTextColor: $s, getLineHeight: Gs, getLineHeightFactor: Js, getLineWidth: Ws, write: Lt, getHorizontalCoordinate: _r, getVerticalCoordinate: Ar, getCoordinateString: Ks, getVerticalCoordinateString: Xs, collections: {}, newObject: De, newAdditionalObject: ti, newObjectDeferred: rn, newObjectDeferredBegin: sn, getFilters: Jn, putStream: qn, events: be, scaleFactor: ne, pageSize: { getWidth: function() {
- return Ya(B);
- }, setWidth: function(u) {
- Ja(B, u);
- }, getHeight: function() {
- return ai(B);
- }, setHeight: function(u) {
- Ka(B, u);
- } }, encryptionOptions: m, encryption: on, getEncryptor: function(u) {
- return m !== null ? on.encryptor(u, 0) : function(v) {
- return v;
- };
- }, output: Ci, getNumberOfPages: Da, get pages() {
- return _t;
- }, out: P, f2: N, f3: E, getPageInfo: za, getPageInfoByObjId: Rs, getCurrentPageInfo: Ts, getPDFVersion: O, Point: ii, Rectangle: pa, Matrix: Gt, hasHotfix: xr }, Object.defineProperty(p.internal.pageSize, "width", { get: function() {
- return Ya(B);
- }, set: function(u) {
- Ja(B, u);
- }, enumerable: !0, configurable: !0 }), Object.defineProperty(p.internal.pageSize, "height", { get: function() {
- return ai(B);
- }, set: function(u) {
- Ka(B, u);
- }, enumerable: !0, configurable: !0 }), function(u) {
- for (var v = 0, I = Ht.length; v < I; v++) {
- var D = Ma.call(this, u[v][0], u[v][1], u[v][2], Ht[v][3], !0);
- _ === !1 && (k[D] = !0);
- var K = u[v][0].split("-");
- Ba({ id: D, fontName: K[0], fontStyle: K[1] || "" });
- }
- be.publish("addFonts", { fonts: se, dictionary: oe });
- }.call(p, Ht), Bt = "F1", Ra(s, t), be.publish("initialized"), p;
- }
- $i.prototype.lsbFirstWord = function(n) {
- return String.fromCharCode(255 & n, n >> 8 & 255, n >> 16 & 255, n >> 24 & 255);
- }, $i.prototype.toHexString = function(n) {
- return n.split("").map(function(e) {
- return ("0" + (255 & e.charCodeAt(0)).toString(16)).slice(-2);
- }).join("");
- }, $i.prototype.hexToBytes = function(n) {
- for (var e = [], t = 0; t < n.length; t += 2) e.push(String.fromCharCode(parseInt(n.substr(t, 2), 16)));
- return e.join("");
- }, $i.prototype.processOwnerPassword = function(n, e) {
- return Go(Vo(e).substr(0, 5), n);
- }, $i.prototype.encryptor = function(n, e) {
- var t = Vo(this.encryptionKey + String.fromCharCode(255 & n, n >> 8 & 255, n >> 16 & 255, 255 & e, e >> 8 & 255)).substr(0, 10);
- return function(i) {
- return Go(t, i);
- };
- }, Cs.prototype.equals = function(n) {
- var e, t = "id,objectNumber,equals";
- if (!n || Se(n) !== Se(this)) return !1;
- var i = 0;
- for (e in this) if (!(t.indexOf(e) >= 0)) {
- if (this.hasOwnProperty(e) && !n.hasOwnProperty(e) || this[e] !== n[e]) return !1;
- i++;
- }
- for (e in n) n.hasOwnProperty(e) && t.indexOf(e) < 0 && i--;
- return i === 0;
- }, Tt.API = { events: [] }, Tt.version = "4.2.1";
- var ze = Tt.API, Qo = 1, Li = function(n) {
- return n.replace(/\\/g, "\\\\").replace(/\(/g, "\\(").replace(/\)/g, "\\)");
- }, Ki = function(n) {
- return n.replace(/\\\\/g, "\\").replace(/\\\(/g, "(").replace(/\\\)/g, ")");
- }, Ai = function(n) {
- return n.toString().replace(/#/g, "#23").replace(/[\s\n\r()<>[\]{}\/%]/g, function(e) {
- var t = e.charCodeAt(0).toString(16).toUpperCase();
- return "#" + (t.length === 1 ? "0" + t : t);
- });
- }, $t = function(n) {
- return n.toFixed(2);
- }, Xr = function(n) {
- return n.toFixed(5);
- };
- ze.__acroform__ = {};
- var Pn = function(n, e) {
- n.prototype = Object.create(e.prototype), n.prototype.constructor = n;
- }, Eu = function(n) {
- return n * Qo;
- }, pr = function(n) {
- var e = new Ch(), t = Ft.internal.getHeight(n) || 0, i = Ft.internal.getWidth(n) || 0;
- return e.BBox = [0, 0, Number($t(i)), Number($t(t))], e;
- }, M1 = ze.__acroform__.setBit = function(n, e) {
- if (n = n || 0, e = e || 0, isNaN(n) || isNaN(e)) throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBit");
- return n | 1 << e;
- }, R1 = ze.__acroform__.clearBit = function(n, e) {
- if (n = n || 0, e = e || 0, isNaN(n) || isNaN(e)) throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBit");
- return n & ~(1 << e);
- }, T1 = ze.__acroform__.getBit = function(n, e) {
- if (isNaN(n) || isNaN(e)) throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBit");
- return n & 1 << e ? 1 : 0;
- }, Ye = ze.__acroform__.getBitForPdf = function(n, e) {
- if (isNaN(n) || isNaN(e)) throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBitForPdf");
- return T1(n, e - 1);
- }, Je = ze.__acroform__.setBitForPdf = function(n, e) {
- if (isNaN(n) || isNaN(e)) throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBitForPdf");
- return M1(n, e - 1);
- }, Ke = ze.__acroform__.clearBitForPdf = function(n, e) {
- if (isNaN(n) || isNaN(e)) throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBitForPdf");
- return R1(n, e - 1);
- }, D1 = ze.__acroform__.calculateCoordinates = function(n, e) {
- var t = e.internal.getHorizontalCoordinate, i = e.internal.getVerticalCoordinate, s = n[0], a = n[1], c = n[2], l = n[3], f = {};
- return f.lowerLeft_X = t(s) || 0, f.lowerLeft_Y = i(a + l) || 0, f.upperRight_X = t(s + c) || 0, f.upperRight_Y = i(a) || 0, [Number($t(f.lowerLeft_X)), Number($t(f.lowerLeft_Y)), Number($t(f.upperRight_X)), Number($t(f.upperRight_Y))];
- }, q1 = function(n) {
- if (n.appearanceStreamContent) return n.appearanceStreamContent;
- if (n.V || n.DV) {
- var e = [], t = n._V || n.DV, i = Yo(n, t), s = n.scope.internal.getFont(n.fontName, n.fontStyle).id;
- e.push("/Tx BMC"), e.push("q"), e.push("BT"), e.push(n.scope.__private__.encodeColorString(n.color)), e.push("/" + s + " " + $t(i.fontSize) + " Tf"), e.push("1 0 0 1 0 0 Tm"), e.push(i.text), e.push("ET"), e.push("Q"), e.push("EMC");
- var a = pr(n);
- return a.scope = n.scope, a.stream = e.join(`
- `), a;
- }
- }, Yo = function(n, e) {
- var t = n.fontSize === 0 ? n.maxFontSize : n.fontSize, i = { text: "", fontSize: "" }, s = (e = (e = e.substr(0, 1) == "(" ? e.substr(1) : e).substr(e.length - 1) == ")" ? e.substr(0, e.length - 1) : e).split(" ");
- s = n.multiline ? s.map(function(N) {
- return N.split(`
- `);
- }) : s.map(function(N) {
- return [N];
- });
- var a = t, c = Ft.internal.getHeight(n) || 0;
- c = c < 0 ? -c : c;
- var l = Ft.internal.getWidth(n) || 0;
- l = l < 0 ? -l : l;
- var f = function(N, E, z) {
- if (N + 1 < s.length) {
- var U = E + " " + s[N + 1][0];
- return xs(U, n, z).width <= l - 4;
- }
- return !1;
- };
- a++;
- t: for (; a > 0; ) {
- e = "", a--;
- var d, m, _ = xs("3", n, a).height, k = n.multiline ? c - a : (c - _) / 2, p = k += 2, j = 0, O = 0, M = 0;
- if (a <= 0) {
- e = `(...) Tj
- `, e += "% Width of Text: " + xs(e, n, a = 12).width + ", FieldWidth:" + l + `
- `;
- break;
- }
- for (var S = "", V = 0, G = 0; G < s.length; G++) if (s.hasOwnProperty(G)) {
- var q = !1;
- if (s[G].length !== 1 && M !== s[G].length - 1) {
- if ((_ + 2) * (V + 2) + 2 > c) continue t;
- S += s[G][M], q = !0, O = G, G--;
- } else {
- S = (S += s[G][M] + " ").substr(S.length - 1) == " " ? S.substr(0, S.length - 1) : S;
- var it = parseInt(G), vt = f(it, S, a), dt = G >= s.length - 1;
- if (vt && !dt) {
- S += " ", M = 0;
- continue;
- }
- if (vt || dt) {
- if (dt) O = it;
- else if (n.multiline && (_ + 2) * (V + 2) + 2 > c) continue t;
- } else {
- if (!n.multiline || (_ + 2) * (V + 2) + 2 > c) continue t;
- O = it;
- }
- }
- for (var X = "", R = j; R <= O; R++) {
- var tt = s[R];
- if (n.multiline) {
- if (R === O) {
- X += tt[M] + " ", M = (M + 1) % tt.length;
- continue;
- }
- if (R === j) {
- X += tt[tt.length - 1] + " ";
- continue;
- }
- }
- X += tt[0] + " ";
- }
- switch (X = X.substr(X.length - 1) == " " ? X.substr(0, X.length - 1) : X, m = xs(X, n, a).width, n.textAlign) {
- case "right":
- d = l - m - 2;
- break;
- case "center":
- d = (l - m) / 2;
- break;
- default:
- d = 2;
- }
- e += $t(d) + " " + $t(p) + ` Td
- `, e += "(" + Li(X) + `) Tj
- `, e += -$t(d) + ` 0 Td
- `, p = -(a + 2), m = 0, j = q ? O : O + 1, V++, S = "";
- }
- break;
- }
- return i.text = e, i.fontSize = a, i;
- }, xs = function(n, e, t) {
- var i = e.scope.internal.getFont(e.fontName, e.fontStyle), s = e.scope.getStringUnitWidth(n, { font: i, fontSize: parseFloat(t), charSpace: 0 }) * parseFloat(t);
- return { height: e.scope.getStringUnitWidth("3", { font: i, fontSize: parseFloat(t), charSpace: 0 }) * parseFloat(t) * 1.5, width: s };
- }, U1 = { fields: [], xForms: [], acroFormDictionaryRoot: null, printedOut: !1, internal: null, isInitialized: !1 }, z1 = function(n, e) {
- var t = { type: "reference", object: n };
- e.internal.getPageInfo(n.page).pageContext.annotations.find(function(i) {
- return i.type === t.type && i.object === t.object;
- }) === void 0 && e.internal.getPageInfo(n.page).pageContext.annotations.push(t);
- }, H1 = function(n, e) {
- if (e.scope = n, n.internal !== void 0 && (n.internal.acroformPlugin === void 0 || n.internal.acroformPlugin.isInitialized === !1)) {
- if (er.FieldNum = 0, n.internal.acroformPlugin = JSON.parse(JSON.stringify(U1)), n.internal.acroformPlugin.acroFormDictionaryRoot) throw new Error("Exception while creating AcroformDictionary");
- Qo = n.internal.scaleFactor, n.internal.acroformPlugin.acroFormDictionaryRoot = new Eh(), n.internal.acroformPlugin.acroFormDictionaryRoot.scope = n, n.internal.acroformPlugin.acroFormDictionaryRoot._eventID = n.internal.events.subscribe("postPutResources", function() {
- (function(t) {
- t.internal.events.unsubscribe(t.internal.acroformPlugin.acroFormDictionaryRoot._eventID), delete t.internal.acroformPlugin.acroFormDictionaryRoot._eventID, t.internal.acroformPlugin.printedOut = !0;
- })(n);
- }), n.internal.events.subscribe("buildDocument", function() {
- (function(t) {
- t.internal.acroformPlugin.acroFormDictionaryRoot.objId = void 0;
- var i = t.internal.acroformPlugin.acroFormDictionaryRoot.Fields;
- for (var s in i) if (i.hasOwnProperty(s)) {
- var a = i[s];
- a.objId = void 0, a.hasAnnotation && z1(a, t);
- }
- })(n);
- }), n.internal.events.subscribe("putCatalog", function() {
- (function(t) {
- if (t.internal.acroformPlugin.acroFormDictionaryRoot === void 0) throw new Error("putCatalogCallback: Root missing.");
- t.internal.write("/AcroForm " + t.internal.acroformPlugin.acroFormDictionaryRoot.objId + " 0 R");
- })(n);
- }), n.internal.events.subscribe("postPutPages", function(t) {
- (function(i, s) {
- var a = !i;
- for (var c in i || (s.internal.newObjectDeferredBegin(s.internal.acroformPlugin.acroFormDictionaryRoot.objId, !0), s.internal.acroformPlugin.acroFormDictionaryRoot.putStream()), i = i || s.internal.acroformPlugin.acroFormDictionaryRoot.Kids) if (i.hasOwnProperty(c)) {
- var l = i[c], f = [], d = l.Rect;
- if (l.Rect && (l.Rect = D1(l.Rect, s)), s.internal.newObjectDeferredBegin(l.objId, !0), l.DA = Ft.createDefaultAppearanceStream(l), Se(l) === "object" && typeof l.getKeyValueListForStream == "function" && (f = l.getKeyValueListForStream()), l.Rect = d, l.hasAppearanceStream && !l.appearanceStreamContent) {
- var m = q1(l);
- f.push({ key: "AP", value: "<</N " + m + ">>" }), s.internal.acroformPlugin.xForms.push(m);
- }
- if (l.appearanceStreamContent) {
- var _ = "";
- for (var k in l.appearanceStreamContent) if (l.appearanceStreamContent.hasOwnProperty(k)) {
- var p = l.appearanceStreamContent[k];
- if (_ += "/" + k + " ", _ += "<<", Object.keys(p).length >= 1 || Array.isArray(p)) {
- for (var c in p) if (p.hasOwnProperty(c)) {
- var j = p[c];
- typeof j == "function" && (j = j.call(s, l)), _ += "/" + c + " " + j + " ", s.internal.acroformPlugin.xForms.indexOf(j) >= 0 || s.internal.acroformPlugin.xForms.push(j);
- }
- } else typeof (j = p) == "function" && (j = j.call(s, l)), _ += "/" + c + " " + j, s.internal.acroformPlugin.xForms.indexOf(j) >= 0 || s.internal.acroformPlugin.xForms.push(j);
- _ += ">>";
- }
- f.push({ key: "AP", value: `<<
- ` + _ + ">>" });
- }
- s.internal.putStream({ additionalKeyValues: f, objectId: l.objId }), s.internal.out("endobj");
- }
- a && function(O, M) {
- for (var S in O) if (O.hasOwnProperty(S)) {
- var V = S, G = O[S];
- M.internal.newObjectDeferredBegin(G.objId, !0), Se(G) === "object" && typeof G.putStream == "function" && G.putStream(), delete O[V];
- }
- }(s.internal.acroformPlugin.xForms, s);
- })(t, n);
- }), n.internal.acroformPlugin.isInitialized = !0;
- }
- }, Fh = ze.__acroform__.arrayToPdfArray = function(n, e, t) {
- var i = function(c) {
- return c;
- };
- if (Array.isArray(n)) {
- for (var s = "[", a = 0; a < n.length; a++) switch (a !== 0 && (s += " "), Se(n[a])) {
- case "boolean":
- case "number":
- case "object":
- s += n[a].toString();
- break;
- case "string":
- n[a].substr(0, 1) === "/" ? s += "/" + Ai(n[a].substr(1)) : (e !== void 0 && t && (i = t.internal.getEncryptor(e)), s += "(" + Li(i(n[a].toString())) + ")");
- }
- return s + "]";
- }
- throw new Error("Invalid argument passed to jsPDF.__acroform__.arrayToPdfArray");
- }, Oo = function(n, e, t) {
- var i = function(s) {
- return s;
- };
- return e !== void 0 && t && (i = t.internal.getEncryptor(e)), (n = n || "").toString(), "(" + Li(i(n)) + ")";
- }, mr = function() {
- this._objId = void 0, this._scope = void 0, Object.defineProperty(this, "objId", { get: function() {
- if (this._objId === void 0) {
- if (this.scope === void 0) return;
- this._objId = this.scope.internal.newObjectDeferred();
- }
- return this._objId;
- }, set: function(n) {
- this._objId = n;
- } }), Object.defineProperty(this, "scope", { value: this._scope, writable: !0 });
- };
- mr.prototype.toString = function() {
- return this.objId + " 0 R";
- }, mr.prototype.putStream = function() {
- var n = this.getKeyValueListForStream();
- this.scope.internal.putStream({ data: this.stream, additionalKeyValues: n, objectId: this.objId }), this.scope.internal.out("endobj");
- }, mr.prototype.getKeyValueListForStream = function() {
- var n = [], e = Object.getOwnPropertyNames(this).filter(function(a) {
- return a != "content" && a != "appearanceStreamContent" && a != "scope" && a != "objId" && a.substring(0, 1) != "_";
- });
- for (var t in e) if (Object.getOwnPropertyDescriptor(this, e[t]).configurable === !1) {
- var i = e[t], s = this[i];
- s && (Array.isArray(s) ? n.push({ key: i, value: Fh(s, this.objId, this.scope) }) : s instanceof mr ? (s.scope = this.scope, n.push({ key: i, value: s.objId + " 0 R" })) : typeof s != "function" && n.push({ key: i, value: s }));
- }
- return n;
- };
- var Ch = function() {
- mr.call(this), Object.defineProperty(this, "Type", { value: "/XObject", configurable: !1, writable: !0 }), Object.defineProperty(this, "Subtype", { value: "/Form", configurable: !1, writable: !0 }), Object.defineProperty(this, "FormType", { value: 1, configurable: !1, writable: !0 });
- var n, e = [];
- Object.defineProperty(this, "BBox", { configurable: !1, get: function() {
- return e;
- }, set: function(t) {
- e = t;
- } }), Object.defineProperty(this, "Resources", { value: "2 0 R", configurable: !1, writable: !0 }), Object.defineProperty(this, "stream", { enumerable: !1, configurable: !0, set: function(t) {
- n = t.trim();
- }, get: function() {
- return n || null;
- } });
- };
- Pn(Ch, mr);
- var Eh = function() {
- mr.call(this);
- var n, e = [];
- Object.defineProperty(this, "Kids", { enumerable: !1, configurable: !0, get: function() {
- return e.length > 0 ? e : void 0;
- } }), Object.defineProperty(this, "Fields", { enumerable: !1, configurable: !1, get: function() {
- return e;
- } }), Object.defineProperty(this, "DA", { enumerable: !1, configurable: !1, get: function() {
- if (n) {
- var t = function(i) {
- return i;
- };
- return this.scope && (t = this.scope.internal.getEncryptor(this.objId)), "(" + Li(t(n)) + ")";
- }
- }, set: function(t) {
- n = t;
- } });
- };
- Pn(Eh, mr);
- var er = function n() {
- mr.call(this);
- var e = 4;
- Object.defineProperty(this, "F", { enumerable: !1, configurable: !1, get: function() {
- return e;
- }, set: function(S) {
- if (isNaN(S)) throw new Error('Invalid value "' + S + '" for attribute F supplied.');
- e = S;
- } }), Object.defineProperty(this, "showWhenPrinted", { enumerable: !0, configurable: !0, get: function() {
- return !!Ye(e, 3);
- }, set: function(S) {
- S ? this.F = Je(e, 3) : this.F = Ke(e, 3);
- } });
- var t = 0;
- Object.defineProperty(this, "Ff", { enumerable: !1, configurable: !1, get: function() {
- return t;
- }, set: function(S) {
- if (isNaN(S)) throw new Error('Invalid value "' + S + '" for attribute Ff supplied.');
- t = S;
- } });
- var i = [];
- Object.defineProperty(this, "Rect", { enumerable: !1, configurable: !1, get: function() {
- if (i.length !== 0) return i;
- }, set: function(S) {
- i = S !== void 0 ? S : [];
- } }), Object.defineProperty(this, "x", { enumerable: !0, configurable: !0, get: function() {
- return !i || isNaN(i[0]) ? 0 : i[0];
- }, set: function(S) {
- i[0] = S;
- } }), Object.defineProperty(this, "y", { enumerable: !0, configurable: !0, get: function() {
- return !i || isNaN(i[1]) ? 0 : i[1];
- }, set: function(S) {
- i[1] = S;
- } }), Object.defineProperty(this, "width", { enumerable: !0, configurable: !0, get: function() {
- return !i || isNaN(i[2]) ? 0 : i[2];
- }, set: function(S) {
- i[2] = S;
- } }), Object.defineProperty(this, "height", { enumerable: !0, configurable: !0, get: function() {
- return !i || isNaN(i[3]) ? 0 : i[3];
- }, set: function(S) {
- i[3] = S;
- } });
- var s = "";
- Object.defineProperty(this, "FT", { enumerable: !0, configurable: !1, get: function() {
- return s;
- }, set: function(S) {
- switch (S) {
- case "/Btn":
- case "/Tx":
- case "/Ch":
- case "/Sig":
- s = S;
- break;
- default:
- throw new Error('Invalid value "' + S + '" for attribute FT supplied.');
- }
- } });
- var a = null;
- Object.defineProperty(this, "T", { enumerable: !0, configurable: !1, get: function() {
- if (!a || a.length < 1) {
- if (this instanceof Es) return;
- a = "FieldObject" + n.FieldNum++;
- }
- var S = function(V) {
- return V;
- };
- return this.scope && (S = this.scope.internal.getEncryptor(this.objId)), "(" + Li(S(a)) + ")";
- }, set: function(S) {
- a = S.toString();
- } }), Object.defineProperty(this, "fieldName", { configurable: !0, enumerable: !0, get: function() {
- return a;
- }, set: function(S) {
- a = S;
- } });
- var c = "helvetica";
- Object.defineProperty(this, "fontName", { enumerable: !0, configurable: !0, get: function() {
- return c;
- }, set: function(S) {
- c = S;
- } });
- var l = "normal";
- Object.defineProperty(this, "fontStyle", { enumerable: !0, configurable: !0, get: function() {
- return l;
- }, set: function(S) {
- l = S;
- } });
- var f = 0;
- Object.defineProperty(this, "fontSize", { enumerable: !0, configurable: !0, get: function() {
- return f;
- }, set: function(S) {
- f = S;
- } });
- var d = void 0;
- Object.defineProperty(this, "maxFontSize", { enumerable: !0, configurable: !0, get: function() {
- return d === void 0 ? 50 / Qo : d;
- }, set: function(S) {
- d = S;
- } });
- var m = "black";
- Object.defineProperty(this, "color", { enumerable: !0, configurable: !0, get: function() {
- return m;
- }, set: function(S) {
- m = S;
- } });
- var _ = "/F1 0 Tf 0 g";
- Object.defineProperty(this, "DA", { enumerable: !0, configurable: !1, get: function() {
- if (!(!_ || this instanceof Es || this instanceof yi)) return Oo(_, this.objId, this.scope);
- }, set: function(S) {
- S = S.toString(), _ = S;
- } });
- var k = null;
- Object.defineProperty(this, "DV", { enumerable: !1, configurable: !1, get: function() {
- if (k) return this instanceof an == 0 ? Oo(k, this.objId, this.scope) : k;
- }, set: function(S) {
- S = S.toString(), k = this instanceof an == 0 ? S.substr(0, 1) === "(" ? Ki(S.substr(1, S.length - 2)) : Ki(S) : S;
- } }), Object.defineProperty(this, "defaultValue", { enumerable: !0, configurable: !0, get: function() {
- return this instanceof an == 1 ? Ki(k.substr(1, k.length - 1)) : k;
- }, set: function(S) {
- S = S.toString(), k = this instanceof an == 1 ? "/" + Ai(S) : S;
- } });
- var p = null;
- Object.defineProperty(this, "_V", { enumerable: !1, configurable: !1, get: function() {
- if (p) return p;
- }, set: function(S) {
- this.V = S;
- } }), Object.defineProperty(this, "V", { enumerable: !1, configurable: !1, get: function() {
- if (p) return this instanceof an == 0 ? Oo(p, this.objId, this.scope) : p;
- }, set: function(S) {
- S = S.toString(), p = this instanceof an == 0 ? S.substr(0, 1) === "(" ? Ki(S.substr(1, S.length - 2)) : Ki(S) : S;
- } }), Object.defineProperty(this, "value", { enumerable: !0, configurable: !0, get: function() {
- return this instanceof an == 1 ? Ki(p.substr(1, p.length - 1)) : p;
- }, set: function(S) {
- S = S.toString(), p = this instanceof an == 1 ? "/" + Ai(S) : S;
- } }), Object.defineProperty(this, "hasAnnotation", { enumerable: !0, configurable: !0, get: function() {
- return this.Rect;
- } }), Object.defineProperty(this, "Type", { enumerable: !0, configurable: !1, get: function() {
- return this.hasAnnotation ? "/Annot" : null;
- } }), Object.defineProperty(this, "Subtype", { enumerable: !0, configurable: !1, get: function() {
- return this.hasAnnotation ? "/Widget" : null;
- } });
- var j, O = !1;
- Object.defineProperty(this, "hasAppearanceStream", { enumerable: !0, configurable: !0, get: function() {
- return O;
- }, set: function(S) {
- S = !!S, O = S;
- } }), Object.defineProperty(this, "page", { enumerable: !0, configurable: !0, get: function() {
- if (j) return j;
- }, set: function(S) {
- j = S;
- } }), Object.defineProperty(this, "readOnly", { enumerable: !0, configurable: !0, get: function() {
- return !!Ye(this.Ff, 1);
- }, set: function(S) {
- S ? this.Ff = Je(this.Ff, 1) : this.Ff = Ke(this.Ff, 1);
- } }), Object.defineProperty(this, "required", { enumerable: !0, configurable: !0, get: function() {
- return !!Ye(this.Ff, 2);
- }, set: function(S) {
- S ? this.Ff = Je(this.Ff, 2) : this.Ff = Ke(this.Ff, 2);
- } }), Object.defineProperty(this, "noExport", { enumerable: !0, configurable: !0, get: function() {
- return !!Ye(this.Ff, 3);
- }, set: function(S) {
- S ? this.Ff = Je(this.Ff, 3) : this.Ff = Ke(this.Ff, 3);
- } });
- var M = null;
- Object.defineProperty(this, "Q", { enumerable: !0, configurable: !1, get: function() {
- if (M !== null) return M;
- }, set: function(S) {
- if ([0, 1, 2].indexOf(S) === -1) throw new Error('Invalid value "' + S + '" for attribute Q supplied.');
- M = S;
- } }), Object.defineProperty(this, "textAlign", { get: function() {
- var S;
- switch (M) {
- case 0:
- default:
- S = "left";
- break;
- case 1:
- S = "center";
- break;
- case 2:
- S = "right";
- }
- return S;
- }, configurable: !0, enumerable: !0, set: function(S) {
- switch (S) {
- case "right":
- case 2:
- M = 2;
- break;
- case "center":
- case 1:
- M = 1;
- break;
- default:
- M = 0;
- }
- } });
- };
- Pn(er, mr);
- var ea = function() {
- er.call(this), this.FT = "/Ch", this.V = "()", this.fontName = "zapfdingbats";
- var n = 0;
- Object.defineProperty(this, "TI", { enumerable: !0, configurable: !1, get: function() {
- return n;
- }, set: function(t) {
- n = t;
- } }), Object.defineProperty(this, "topIndex", { enumerable: !0, configurable: !0, get: function() {
- return n;
- }, set: function(t) {
- n = t;
- } });
- var e = [];
- Object.defineProperty(this, "Opt", { enumerable: !0, configurable: !1, get: function() {
- return Fh(e, this.objId, this.scope);
- }, set: function(t) {
- var i, s;
- s = [], typeof (i = t) == "string" && (s = function(a, c, l) {
- l || (l = 1);
- for (var f, d = []; f = c.exec(a); ) d.push(f[l]);
- return d;
- }(i, /\((.*?)\)/g)), e = s;
- } }), this.getOptions = function() {
- return e;
- }, this.setOptions = function(t) {
- e = t, this.sort && e.sort();
- }, this.addOption = function(t) {
- t = (t = t || "").toString(), e.push(t), this.sort && e.sort();
- }, this.removeOption = function(t, i) {
- for (i = i || !1, t = (t = t || "").toString(); e.indexOf(t) !== -1 && (e.splice(e.indexOf(t), 1), i !== !1); ) ;
- }, Object.defineProperty(this, "combo", { enumerable: !0, configurable: !0, get: function() {
- return !!Ye(this.Ff, 18);
- }, set: function(t) {
- t ? this.Ff = Je(this.Ff, 18) : this.Ff = Ke(this.Ff, 18);
- } }), Object.defineProperty(this, "edit", { enumerable: !0, configurable: !0, get: function() {
- return !!Ye(this.Ff, 19);
- }, set: function(t) {
- this.combo === !0 && (t ? this.Ff = Je(this.Ff, 19) : this.Ff = Ke(this.Ff, 19));
- } }), Object.defineProperty(this, "sort", { enumerable: !0, configurable: !0, get: function() {
- return !!Ye(this.Ff, 20);
- }, set: function(t) {
- t ? (this.Ff = Je(this.Ff, 20), e.sort()) : this.Ff = Ke(this.Ff, 20);
- } }), Object.defineProperty(this, "multiSelect", { enumerable: !0, configurable: !0, get: function() {
- return !!Ye(this.Ff, 22);
- }, set: function(t) {
- t ? this.Ff = Je(this.Ff, 22) : this.Ff = Ke(this.Ff, 22);
- } }), Object.defineProperty(this, "doNotSpellCheck", { enumerable: !0, configurable: !0, get: function() {
- return !!Ye(this.Ff, 23);
- }, set: function(t) {
- t ? this.Ff = Je(this.Ff, 23) : this.Ff = Ke(this.Ff, 23);
- } }), Object.defineProperty(this, "commitOnSelChange", { enumerable: !0, configurable: !0, get: function() {
- return !!Ye(this.Ff, 27);
- }, set: function(t) {
- t ? this.Ff = Je(this.Ff, 27) : this.Ff = Ke(this.Ff, 27);
- } }), this.hasAppearanceStream = !1;
- };
- Pn(ea, er);
- var na = function() {
- ea.call(this), this.fontName = "helvetica", this.combo = !1;
- };
- Pn(na, ea);
- var ra = function() {
- na.call(this), this.combo = !0;
- };
- Pn(ra, na);
- var Ls = function() {
- ra.call(this), this.edit = !0;
- };
- Pn(Ls, ra);
- var an = function() {
- er.call(this), this.FT = "/Btn", Object.defineProperty(this, "noToggleToOff", { enumerable: !0, configurable: !0, get: function() {
- return !!Ye(this.Ff, 15);
- }, set: function(t) {
- t ? this.Ff = Je(this.Ff, 15) : this.Ff = Ke(this.Ff, 15);
- } }), Object.defineProperty(this, "radio", { enumerable: !0, configurable: !0, get: function() {
- return !!Ye(this.Ff, 16);
- }, set: function(t) {
- t ? this.Ff = Je(this.Ff, 16) : this.Ff = Ke(this.Ff, 16);
- } }), Object.defineProperty(this, "pushButton", { enumerable: !0, configurable: !0, get: function() {
- return !!Ye(this.Ff, 17);
- }, set: function(t) {
- t ? this.Ff = Je(this.Ff, 17) : this.Ff = Ke(this.Ff, 17);
- } }), Object.defineProperty(this, "radioIsUnison", { enumerable: !0, configurable: !0, get: function() {
- return !!Ye(this.Ff, 26);
- }, set: function(t) {
- t ? this.Ff = Je(this.Ff, 26) : this.Ff = Ke(this.Ff, 26);
- } });
- var n, e = {};
- Object.defineProperty(this, "MK", { enumerable: !1, configurable: !1, get: function() {
- var t = function(a) {
- return a;
- };
- if (this.scope && (t = this.scope.internal.getEncryptor(this.objId)), Object.keys(e).length !== 0) {
- var i, s = [];
- for (i in s.push("<<"), e) s.push("/" + i + " (" + Li(t(e[i])) + ")");
- return s.push(">>"), s.join(`
- `);
- }
- }, set: function(t) {
- Se(t) === "object" && (e = t);
- } }), Object.defineProperty(this, "caption", { enumerable: !0, configurable: !0, get: function() {
- return e.CA || "";
- }, set: function(t) {
- typeof t == "string" && (e.CA = t);
- } }), Object.defineProperty(this, "AS", { enumerable: !1, configurable: !1, get: function() {
- return n;
- }, set: function(t) {
- var i = t == null ? "" : t.toString();
- i.substr(0, 1) === "/" && (i = i.substr(1)), n = "/" + Ai(i);
- } }), Object.defineProperty(this, "appearanceState", { enumerable: !0, configurable: !0, get: function() {
- return n.substr(1, n.length - 1);
- }, set: function(t) {
- n = "/" + Ai(t);
- } });
- };
- Pn(an, er);
- var Ss = function() {
- an.call(this), this.pushButton = !0;
- };
- Pn(Ss, an);
- var ia = function() {
- an.call(this), this.radio = !0, this.pushButton = !1;
- var n = [];
- Object.defineProperty(this, "Kids", { enumerable: !0, configurable: !1, get: function() {
- return n;
- }, set: function(e) {
- n = e !== void 0 ? e : [];
- } });
- };
- Pn(ia, an);
- var Es = function() {
- var n, e;
- er.call(this), Object.defineProperty(this, "Parent", { enumerable: !1, configurable: !1, get: function() {
- return n;
- }, set: function(s) {
- n = s;
- } }), Object.defineProperty(this, "optionName", { enumerable: !1, configurable: !0, get: function() {
- return e;
- }, set: function(s) {
- e = s;
- } });
- var t, i = {};
- Object.defineProperty(this, "MK", { enumerable: !1, configurable: !1, get: function() {
- var s = function(l) {
- return l;
- };
- this.scope && (s = this.scope.internal.getEncryptor(this.objId));
- var a, c = [];
- for (a in c.push("<<"), i) c.push("/" + a + " (" + Li(s(i[a])) + ")");
- return c.push(">>"), c.join(`
- `);
- }, set: function(s) {
- Se(s) === "object" && (i = s);
- } }), Object.defineProperty(this, "caption", { enumerable: !0, configurable: !0, get: function() {
- return i.CA || "";
- }, set: function(s) {
- typeof s == "string" && (i.CA = s);
- } }), Object.defineProperty(this, "AS", { enumerable: !1, configurable: !1, get: function() {
- return t;
- }, set: function(s) {
- var a = s == null ? "" : s.toString();
- a.substr(0, 1) === "/" && (a = a.substr(1)), t = "/" + Ai(a);
- } }), Object.defineProperty(this, "appearanceState", { enumerable: !0, configurable: !0, get: function() {
- return t.substr(1, t.length - 1);
- }, set: function(s) {
- var a = s == null ? "" : s.toString();
- a.substr(0, 1) === "/" && (a = a.substr(1)), t = "/" + Ai(a);
- } }), this.caption = "l", this.appearanceState = "Off", this._AppearanceType = Ft.RadioButton.Circle, this.appearanceStreamContent = this._AppearanceType.createAppearanceStream(this.optionName);
- };
- Pn(Es, er), ia.prototype.setAppearance = function(n) {
- if (!("createAppearanceStream" in n) || !("getCA" in n)) throw new Error("Couldn't assign Appearance to RadioButton. Appearance was Invalid!");
- for (var e in this.Kids) if (this.Kids.hasOwnProperty(e)) {
- var t = this.Kids[e];
- t.appearanceStreamContent = n.createAppearanceStream(t.optionName), t.caption = n.getCA();
- }
- }, ia.prototype.createOption = function(n) {
- var e = new Es();
- return e.Parent = this, e.optionName = n, this.Kids.push(e), W1.call(this.scope, e), e;
- };
- var ks = function() {
- an.call(this), this.fontName = "zapfdingbats", this.caption = "3", this.appearanceState = "On", this.value = "On", this.textAlign = "center", this.appearanceStreamContent = Ft.CheckBox.createAppearanceStream();
- };
- Pn(ks, an);
- var yi = function() {
- er.call(this), this.FT = "/Tx", Object.defineProperty(this, "multiline", { enumerable: !0, configurable: !0, get: function() {
- return !!Ye(this.Ff, 13);
- }, set: function(e) {
- e ? this.Ff = Je(this.Ff, 13) : this.Ff = Ke(this.Ff, 13);
- } }), Object.defineProperty(this, "fileSelect", { enumerable: !0, configurable: !0, get: function() {
- return !!Ye(this.Ff, 21);
- }, set: function(e) {
- e ? this.Ff = Je(this.Ff, 21) : this.Ff = Ke(this.Ff, 21);
- } }), Object.defineProperty(this, "doNotSpellCheck", { enumerable: !0, configurable: !0, get: function() {
- return !!Ye(this.Ff, 23);
- }, set: function(e) {
- e ? this.Ff = Je(this.Ff, 23) : this.Ff = Ke(this.Ff, 23);
- } }), Object.defineProperty(this, "doNotScroll", { enumerable: !0, configurable: !0, get: function() {
- return !!Ye(this.Ff, 24);
- }, set: function(e) {
- e ? this.Ff = Je(this.Ff, 24) : this.Ff = Ke(this.Ff, 24);
- } }), Object.defineProperty(this, "comb", { enumerable: !0, configurable: !0, get: function() {
- return !!Ye(this.Ff, 25);
- }, set: function(e) {
- e ? this.Ff = Je(this.Ff, 25) : this.Ff = Ke(this.Ff, 25);
- } }), Object.defineProperty(this, "richText", { enumerable: !0, configurable: !0, get: function() {
- return !!Ye(this.Ff, 26);
- }, set: function(e) {
- e ? this.Ff = Je(this.Ff, 26) : this.Ff = Ke(this.Ff, 26);
- } });
- var n = null;
- Object.defineProperty(this, "MaxLen", { enumerable: !0, configurable: !1, get: function() {
- return n;
- }, set: function(e) {
- n = e;
- } }), Object.defineProperty(this, "maxLength", { enumerable: !0, configurable: !0, get: function() {
- return n;
- }, set: function(e) {
- Number.isInteger(e) && (n = e);
- } }), Object.defineProperty(this, "hasAppearanceStream", { enumerable: !0, configurable: !0, get: function() {
- return this.V || this.DV;
- } });
- };
- Pn(yi, er);
- var Ps = function() {
- yi.call(this), Object.defineProperty(this, "password", { enumerable: !0, configurable: !0, get: function() {
- return !!Ye(this.Ff, 14);
- }, set: function(n) {
- n ? this.Ff = Je(this.Ff, 14) : this.Ff = Ke(this.Ff, 14);
- } }), this.password = !0;
- };
- Pn(Ps, yi);
- var Ft = { CheckBox: { createAppearanceStream: function() {
- return { N: { On: Ft.CheckBox.YesNormal }, D: { On: Ft.CheckBox.YesPushDown, Off: Ft.CheckBox.OffPushDown } };
- }, YesPushDown: function(n) {
- var e = pr(n);
- e.scope = n.scope;
- var t = [], i = n.scope.internal.getFont(n.fontName, n.fontStyle).id, s = n.scope.__private__.encodeColorString(n.color), a = Yo(n, n.caption);
- return t.push("0.749023 g"), t.push("0 0 " + $t(Ft.internal.getWidth(n)) + " " + $t(Ft.internal.getHeight(n)) + " re"), t.push("f"), t.push("BMC"), t.push("q"), t.push("0 0 1 rg"), t.push("/" + i + " " + $t(a.fontSize) + " Tf " + s), t.push("BT"), t.push(a.text), t.push("ET"), t.push("Q"), t.push("EMC"), e.stream = t.join(`
- `), e;
- }, YesNormal: function(n) {
- var e = pr(n);
- e.scope = n.scope;
- var t = n.scope.internal.getFont(n.fontName, n.fontStyle).id, i = n.scope.__private__.encodeColorString(n.color), s = [], a = Ft.internal.getHeight(n), c = Ft.internal.getWidth(n), l = Yo(n, n.caption);
- return s.push("1 g"), s.push("0 0 " + $t(c) + " " + $t(a) + " re"), s.push("f"), s.push("q"), s.push("0 0 1 rg"), s.push("0 0 " + $t(c - 1) + " " + $t(a - 1) + " re"), s.push("W"), s.push("n"), s.push("0 g"), s.push("BT"), s.push("/" + t + " " + $t(l.fontSize) + " Tf " + i), s.push(l.text), s.push("ET"), s.push("Q"), e.stream = s.join(`
- `), e;
- }, OffPushDown: function(n) {
- var e = pr(n);
- e.scope = n.scope;
- var t = [];
- return t.push("0.749023 g"), t.push("0 0 " + $t(Ft.internal.getWidth(n)) + " " + $t(Ft.internal.getHeight(n)) + " re"), t.push("f"), e.stream = t.join(`
- `), e;
- } }, RadioButton: { Circle: { createAppearanceStream: function(n) {
- var e = { D: { Off: Ft.RadioButton.Circle.OffPushDown }, N: {} };
- return e.N[n] = Ft.RadioButton.Circle.YesNormal, e.D[n] = Ft.RadioButton.Circle.YesPushDown, e;
- }, getCA: function() {
- return "l";
- }, YesNormal: function(n) {
- var e = pr(n);
- e.scope = n.scope;
- var t = [], i = Ft.internal.getWidth(n) <= Ft.internal.getHeight(n) ? Ft.internal.getWidth(n) / 4 : Ft.internal.getHeight(n) / 4;
- i = Number((0.9 * i).toFixed(5));
- var s = Ft.internal.Bezier_C, a = Number((i * s).toFixed(5));
- return t.push("q"), t.push("1 0 0 1 " + Xr(Ft.internal.getWidth(n) / 2) + " " + Xr(Ft.internal.getHeight(n) / 2) + " cm"), t.push(i + " 0 m"), t.push(i + " " + a + " " + a + " " + i + " 0 " + i + " c"), t.push("-" + a + " " + i + " -" + i + " " + a + " -" + i + " 0 c"), t.push("-" + i + " -" + a + " -" + a + " -" + i + " 0 -" + i + " c"), t.push(a + " -" + i + " " + i + " -" + a + " " + i + " 0 c"), t.push("f"), t.push("Q"), e.stream = t.join(`
- `), e;
- }, YesPushDown: function(n) {
- var e = pr(n);
- e.scope = n.scope;
- var t = [], i = Ft.internal.getWidth(n) <= Ft.internal.getHeight(n) ? Ft.internal.getWidth(n) / 4 : Ft.internal.getHeight(n) / 4;
- i = Number((0.9 * i).toFixed(5));
- var s = Number((2 * i).toFixed(5)), a = Number((s * Ft.internal.Bezier_C).toFixed(5)), c = Number((i * Ft.internal.Bezier_C).toFixed(5));
- return t.push("0.749023 g"), t.push("q"), t.push("1 0 0 1 " + Xr(Ft.internal.getWidth(n) / 2) + " " + Xr(Ft.internal.getHeight(n) / 2) + " cm"), t.push(s + " 0 m"), t.push(s + " " + a + " " + a + " " + s + " 0 " + s + " c"), t.push("-" + a + " " + s + " -" + s + " " + a + " -" + s + " 0 c"), t.push("-" + s + " -" + a + " -" + a + " -" + s + " 0 -" + s + " c"), t.push(a + " -" + s + " " + s + " -" + a + " " + s + " 0 c"), t.push("f"), t.push("Q"), t.push("0 g"), t.push("q"), t.push("1 0 0 1 " + Xr(Ft.internal.getWidth(n) / 2) + " " + Xr(Ft.internal.getHeight(n) / 2) + " cm"), t.push(i + " 0 m"), t.push(i + " " + c + " " + c + " " + i + " 0 " + i + " c"), t.push("-" + c + " " + i + " -" + i + " " + c + " -" + i + " 0 c"), t.push("-" + i + " -" + c + " -" + c + " -" + i + " 0 -" + i + " c"), t.push(c + " -" + i + " " + i + " -" + c + " " + i + " 0 c"), t.push("f"), t.push("Q"), e.stream = t.join(`
- `), e;
- }, OffPushDown: function(n) {
- var e = pr(n);
- e.scope = n.scope;
- var t = [], i = Ft.internal.getWidth(n) <= Ft.internal.getHeight(n) ? Ft.internal.getWidth(n) / 4 : Ft.internal.getHeight(n) / 4;
- i = Number((0.9 * i).toFixed(5));
- var s = Number((2 * i).toFixed(5)), a = Number((s * Ft.internal.Bezier_C).toFixed(5));
- return t.push("0.749023 g"), t.push("q"), t.push("1 0 0 1 " + Xr(Ft.internal.getWidth(n) / 2) + " " + Xr(Ft.internal.getHeight(n) / 2) + " cm"), t.push(s + " 0 m"), t.push(s + " " + a + " " + a + " " + s + " 0 " + s + " c"), t.push("-" + a + " " + s + " -" + s + " " + a + " -" + s + " 0 c"), t.push("-" + s + " -" + a + " -" + a + " -" + s + " 0 -" + s + " c"), t.push(a + " -" + s + " " + s + " -" + a + " " + s + " 0 c"), t.push("f"), t.push("Q"), e.stream = t.join(`
- `), e;
- } }, Cross: { createAppearanceStream: function(n) {
- var e = { D: { Off: Ft.RadioButton.Cross.OffPushDown }, N: {} };
- return e.N[n] = Ft.RadioButton.Cross.YesNormal, e.D[n] = Ft.RadioButton.Cross.YesPushDown, e;
- }, getCA: function() {
- return "8";
- }, YesNormal: function(n) {
- var e = pr(n);
- e.scope = n.scope;
- var t = [], i = Ft.internal.calculateCross(n);
- return t.push("q"), t.push("1 1 " + $t(Ft.internal.getWidth(n) - 2) + " " + $t(Ft.internal.getHeight(n) - 2) + " re"), t.push("W"), t.push("n"), t.push($t(i.x1.x) + " " + $t(i.x1.y) + " m"), t.push($t(i.x2.x) + " " + $t(i.x2.y) + " l"), t.push($t(i.x4.x) + " " + $t(i.x4.y) + " m"), t.push($t(i.x3.x) + " " + $t(i.x3.y) + " l"), t.push("s"), t.push("Q"), e.stream = t.join(`
- `), e;
- }, YesPushDown: function(n) {
- var e = pr(n);
- e.scope = n.scope;
- var t = Ft.internal.calculateCross(n), i = [];
- return i.push("0.749023 g"), i.push("0 0 " + $t(Ft.internal.getWidth(n)) + " " + $t(Ft.internal.getHeight(n)) + " re"), i.push("f"), i.push("q"), i.push("1 1 " + $t(Ft.internal.getWidth(n) - 2) + " " + $t(Ft.internal.getHeight(n) - 2) + " re"), i.push("W"), i.push("n"), i.push($t(t.x1.x) + " " + $t(t.x1.y) + " m"), i.push($t(t.x2.x) + " " + $t(t.x2.y) + " l"), i.push($t(t.x4.x) + " " + $t(t.x4.y) + " m"), i.push($t(t.x3.x) + " " + $t(t.x3.y) + " l"), i.push("s"), i.push("Q"), e.stream = i.join(`
- `), e;
- }, OffPushDown: function(n) {
- var e = pr(n);
- e.scope = n.scope;
- var t = [];
- return t.push("0.749023 g"), t.push("0 0 " + $t(Ft.internal.getWidth(n)) + " " + $t(Ft.internal.getHeight(n)) + " re"), t.push("f"), e.stream = t.join(`
- `), e;
- } } }, createDefaultAppearanceStream: function(n) {
- var e = n.scope.internal.getFont(n.fontName, n.fontStyle).id, t = n.scope.__private__.encodeColorString(n.color);
- return "/" + e + " " + n.fontSize + " Tf " + t;
- } };
- Ft.internal = { Bezier_C: 0.551915024494, calculateCross: function(n) {
- var e = Ft.internal.getWidth(n), t = Ft.internal.getHeight(n), i = Math.min(e, t);
- return { x1: { x: (e - i) / 2, y: (t - i) / 2 + i }, x2: { x: (e - i) / 2 + i, y: (t - i) / 2 }, x3: { x: (e - i) / 2, y: (t - i) / 2 }, x4: { x: (e - i) / 2 + i, y: (t - i) / 2 + i } };
- } }, Ft.internal.getWidth = function(n) {
- var e = 0;
- return Se(n) === "object" && (e = Eu(n.Rect[2])), e;
- }, Ft.internal.getHeight = function(n) {
- var e = 0;
- return Se(n) === "object" && (e = Eu(n.Rect[3])), e;
- };
- var W1 = ze.addField = function(n) {
- if (H1(this, n), !(n instanceof er)) throw new Error("Invalid argument passed to jsPDF.addField.");
- var e;
- return (e = n).scope.internal.acroformPlugin.printedOut && (e.scope.internal.acroformPlugin.printedOut = !1, e.scope.internal.acroformPlugin.acroFormDictionaryRoot = null), e.scope.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(e), n.page = n.scope.internal.getCurrentPageInfo().pageNumber, this;
- };
- ze.AcroFormChoiceField = ea, ze.AcroFormListBox = na, ze.AcroFormComboBox = ra, ze.AcroFormEditBox = Ls, ze.AcroFormButton = an, ze.AcroFormPushButton = Ss, ze.AcroFormRadioButton = ia, ze.AcroFormCheckBox = ks, ze.AcroFormTextField = yi, ze.AcroFormPasswordField = Ps, ze.AcroFormAppearance = Ft, ze.AcroForm = { ChoiceField: ea, ListBox: na, ComboBox: ra, EditBox: Ls, Button: an, PushButton: Ss, RadioButton: ia, CheckBox: ks, TextField: yi, PasswordField: Ps, Appearance: Ft }, Tt.AcroForm = { ChoiceField: ea, ListBox: na, ComboBox: ra, EditBox: Ls, Button: an, PushButton: Ss, RadioButton: ia, CheckBox: ks, TextField: yi, PasswordField: Ps, Appearance: Ft };
- var b2 = Tt.AcroForm;
- function Oh(n) {
- return n.reduce(function(e, t, i) {
- return e[t] = i, e;
- }, {});
- }
- (function(n) {
- var e = "addImage_";
- n.__addimage__ = {};
- var t = "UNKNOWN", i = { PNG: [[137, 80, 78, 71]], TIFF: [[77, 77, 0, 42], [73, 73, 42, 0]], JPEG: [[255, 216, 255, 224, void 0, void 0, 74, 70, 73, 70, 0], [255, 216, 255, 225, void 0, void 0, 69, 120, 105, 102, 0, 0], [255, 216, 255, 219], [255, 216, 255, 238]], JPEG2000: [[0, 0, 0, 12, 106, 80, 32, 32]], GIF87a: [[71, 73, 70, 56, 55, 97]], GIF89a: [[71, 73, 70, 56, 57, 97]], WEBP: [[82, 73, 70, 70, void 0, void 0, void 0, void 0, 87, 69, 66, 80]], BMP: [[66, 77], [66, 65], [67, 73], [67, 80], [73, 67], [80, 84]] }, s = n.__addimage__.getImageFileTypeByImageData = function(N, E) {
- var z, U, rt, ot, ht, nt = t;
- if ((E = E || t) === "RGBA" || N.data !== void 0 && N.data instanceof Uint8ClampedArray && "height" in N && "width" in N) return "RGBA";
- if (vt(N)) for (ht in i) for (rt = i[ht], z = 0; z < rt.length; z += 1) {
- for (ot = !0, U = 0; U < rt[z].length; U += 1) if (rt[z][U] !== void 0 && rt[z][U] !== N[U]) {
- ot = !1;
- break;
- }
- if (ot === !0) {
- nt = ht;
- break;
- }
- }
- else for (ht in i) for (rt = i[ht], z = 0; z < rt.length; z += 1) {
- for (ot = !0, U = 0; U < rt[z].length; U += 1) if (rt[z][U] !== void 0 && rt[z][U] !== N.charCodeAt(U)) {
- ot = !1;
- break;
- }
- if (ot === !0) {
- nt = ht;
- break;
- }
- }
- return nt === t && E !== t && (nt = E), nt;
- }, a = function N(E) {
- for (var z = this.internal.write, U = this.internal.putStream, rt = (0, this.internal.getFilters)(); rt.indexOf("FlateEncode") !== -1; ) rt.splice(rt.indexOf("FlateEncode"), 1);
- E.objectId = this.internal.newObject();
- var ot = [];
- if (ot.push({ key: "Type", value: "/XObject" }), ot.push({ key: "Subtype", value: "/Image" }), ot.push({ key: "Width", value: E.width }), ot.push({ key: "Height", value: E.height }), E.colorSpace === S.INDEXED ? ot.push({ key: "ColorSpace", value: "[/Indexed /DeviceRGB " + (E.palette.length / 3 - 1) + " " + ("sMask" in E && E.sMask !== void 0 ? E.objectId + 2 : E.objectId + 1) + " 0 R]" }) : (ot.push({ key: "ColorSpace", value: "/" + E.colorSpace }), E.colorSpace === S.DEVICE_CMYK && ot.push({ key: "Decode", value: "[1 0 1 0 1 0 1 0]" })), ot.push({ key: "BitsPerComponent", value: E.bitsPerComponent }), "decodeParameters" in E && E.decodeParameters !== void 0 && ot.push({ key: "DecodeParms", value: "<<" + E.decodeParameters + ">>" }), "transparency" in E && Array.isArray(E.transparency) && E.transparency.length > 0) {
- for (var ht = "", nt = 0, ct = E.transparency.length; nt < ct; nt++) ht += E.transparency[nt] + " " + E.transparency[nt] + " ";
- ot.push({ key: "Mask", value: "[" + ht + "]" });
- }
- E.sMask !== void 0 && ot.push({ key: "SMask", value: E.objectId + 1 + " 0 R" });
- var At = E.filter !== void 0 ? ["/" + E.filter] : void 0;
- if (U({ data: E.data, additionalKeyValues: ot, alreadyAppliedFilters: At, objectId: E.objectId }), z("endobj"), "sMask" in E && E.sMask !== void 0) {
- var wt, x = (wt = E.sMaskBitsPerComponent) !== null && wt !== void 0 ? wt : E.bitsPerComponent, B = { width: E.width, height: E.height, colorSpace: "DeviceGray", bitsPerComponent: x, data: E.sMask };
- "filter" in E && (B.decodeParameters = "/Predictor ".concat(E.predictor, " /Colors 1 /BitsPerComponent ").concat(x, " /Columns ").concat(E.width), B.filter = E.filter), N.call(this, B);
- }
- if (E.colorSpace === S.INDEXED) {
- var T = this.internal.newObject();
- U({ data: X(new Uint8Array(E.palette)), objectId: T }), z("endobj");
- }
- }, c = function() {
- var N = this.internal.collections[e + "images"];
- for (var E in N) a.call(this, N[E]);
- }, l = function() {
- var N, E = this.internal.collections[e + "images"], z = this.internal.write;
- for (var U in E) z("/I" + (N = E[U]).index, N.objectId, "0", "R");
- }, f = function() {
- this.internal.collections[e + "images"] || (this.internal.collections[e + "images"] = {}, this.internal.events.subscribe("putResources", c), this.internal.events.subscribe("putXobjectDict", l));
- }, d = function() {
- var N = this.internal.collections[e + "images"];
- return f.call(this), N;
- }, m = function() {
- return Object.keys(this.internal.collections[e + "images"]).length;
- }, _ = function(N) {
- return typeof n["process" + N.toUpperCase()] == "function";
- }, k = function(N) {
- return Se(N) === "object" && N.nodeType === 1;
- }, p = function(N, E) {
- if (N.nodeName === "IMG" && N.hasAttribute("src")) {
- var z = "" + N.getAttribute("src");
- if (z.indexOf("data:image/") === 0) return Ns(unescape(z).split("base64,").pop());
- var U = n.loadFile(z, !0);
- if (U !== void 0) return U;
- }
- if (N.nodeName === "CANVAS") {
- if (N.width === 0 || N.height === 0) throw new Error("Given canvas must have data. Canvas width: " + N.width + ", height: " + N.height);
- var rt;
- switch (E) {
- case "PNG":
- rt = "image/png";
- break;
- case "WEBP":
- rt = "image/webp";
- break;
- default:
- rt = "image/jpeg";
- }
- return Ns(N.toDataURL(rt, 1).split("base64,").pop());
- }
- }, j = function(N) {
- var E = this.internal.collections[e + "images"];
- if (E) {
- for (var z in E) if (N === E[z].alias) return E[z];
- }
- }, O = function(N, E, z) {
- return N || E || (N = -96, E = -96), N < 0 && (N = -1 * z.width * 72 / N / this.internal.scaleFactor), E < 0 && (E = -1 * z.height * 72 / E / this.internal.scaleFactor), N === 0 && (N = E * z.width / z.height), E === 0 && (E = N * z.height / z.width), [N, E];
- }, M = function(N, E, z, U, rt, ot) {
- var ht = O.call(this, z, U, rt), nt = this.internal.getCoordinateString, ct = this.internal.getVerticalCoordinateString, At = d.call(this);
- if (z = ht[0], U = ht[1], At[rt.index] = rt, ot) {
- ot *= Math.PI / 180;
- var wt = Math.cos(ot), x = Math.sin(ot), B = function(H) {
- return H.toFixed(4);
- }, T = [B(wt), B(x), B(-1 * x), B(wt), 0, 0, "cm"];
- }
- this.internal.write("q"), ot ? (this.internal.write([1, "0", "0", 1, nt(N), ct(E + U), "cm"].join(" ")), this.internal.write(T.join(" ")), this.internal.write([nt(z), "0", "0", nt(U), "0", "0", "cm"].join(" "))) : this.internal.write([nt(z), "0", "0", nt(U), nt(N), ct(E + U), "cm"].join(" ")), this.isAdvancedAPI() && this.internal.write([1, 0, 0, -1, 0, 0, "cm"].join(" ")), this.internal.write("/I" + rt.index + " Do"), this.internal.write("Q");
- }, S = n.color_spaces = { DEVICE_RGB: "DeviceRGB", DEVICE_GRAY: "DeviceGray", DEVICE_CMYK: "DeviceCMYK", CAL_GREY: "CalGray", CAL_RGB: "CalRGB", LAB: "Lab", ICC_BASED: "ICCBased", INDEXED: "Indexed", PATTERN: "Pattern", SEPARATION: "Separation", DEVICE_N: "DeviceN" };
- n.decode = { DCT_DECODE: "DCTDecode", FLATE_DECODE: "FlateDecode", LZW_DECODE: "LZWDecode", JPX_DECODE: "JPXDecode", JBIG2_DECODE: "JBIG2Decode", ASCII85_DECODE: "ASCII85Decode", ASCII_HEX_DECODE: "ASCIIHexDecode", RUN_LENGTH_DECODE: "RunLengthDecode", CCITT_FAX_DECODE: "CCITTFaxDecode" };
- var V = n.image_compression = { NONE: "NONE", FAST: "FAST", MEDIUM: "MEDIUM", SLOW: "SLOW" }, G = n.__addimage__.sHashCode = function(N) {
- var E, z, U = 0;
- if (typeof N == "string") for (z = N.length, E = 0; E < z; E++) U = (U << 5) - U + N.charCodeAt(E), U |= 0;
- else if (vt(N)) for (z = N.byteLength / 2, E = 0; E < z; E++) U = (U << 5) - U + N[E], U |= 0;
- return U;
- }, q = n.__addimage__.validateStringAsBase64 = function(N) {
- (N = N || "").toString().trim();
- var E = !0;
- return N.length === 0 && (E = !1), N.length % 4 != 0 && (E = !1), /^[A-Za-z0-9+/]+$/.test(N.substr(0, N.length - 2)) === !1 && (E = !1), /^[A-Za-z0-9/][A-Za-z0-9+/]|[A-Za-z0-9+/]=|==$/.test(N.substr(-2)) === !1 && (E = !1), E;
- }, it = n.__addimage__.extractImageFromDataUrl = function(N) {
- if (N == null || !(N = N.trim()).startsWith("data:")) return null;
- var E = N.indexOf(",");
- return E < 0 ? null : N.substring(0, E).trim().endsWith("base64") ? N.substring(E + 1) : null;
- };
- n.__addimage__.isArrayBuffer = function(N) {
- return N instanceof ArrayBuffer;
- };
- var vt = n.__addimage__.isArrayBufferView = function(N) {
- return N instanceof Int8Array || N instanceof Uint8Array || N instanceof Uint8ClampedArray || N instanceof Int16Array || N instanceof Uint16Array || N instanceof Int32Array || N instanceof Uint32Array || N instanceof Float32Array || N instanceof Float64Array;
- }, dt = n.__addimage__.binaryStringToUint8Array = function(N) {
- for (var E = N.length, z = new Uint8Array(E), U = 0; U < E; U++) z[U] = N.charCodeAt(U);
- return z;
- }, X = n.__addimage__.arrayBufferToBinaryString = function(N) {
- for (var E = "", z = vt(N) ? N : new Uint8Array(N), U = 0; U < z.length; U += 8192) E += String.fromCharCode.apply(null, z.subarray(U, U + 8192));
- return E;
- };
- n.addImage = function() {
- var N, E, z, U, rt, ot, ht, nt, ct;
- if (typeof arguments[1] == "number" ? (E = t, z = arguments[1], U = arguments[2], rt = arguments[3], ot = arguments[4], ht = arguments[5], nt = arguments[6], ct = arguments[7]) : (E = arguments[1], z = arguments[2], U = arguments[3], rt = arguments[4], ot = arguments[5], ht = arguments[6], nt = arguments[7], ct = arguments[8]), Se(N = arguments[0]) === "object" && !k(N) && "imageData" in N) {
- var At = N;
- N = At.imageData, E = At.format || E || t, z = At.x || z || 0, U = At.y || U || 0, rt = At.w || At.width || rt, ot = At.h || At.height || ot, ht = At.alias || ht, nt = At.compression || nt, ct = At.rotation || At.angle || ct;
- }
- var wt = this.internal.getFilters();
- if (nt === void 0 && wt.indexOf("FlateEncode") !== -1 && (nt = "SLOW"), isNaN(z) || isNaN(U)) throw new Error("Invalid coordinates passed to jsPDF.addImage");
- f.call(this);
- var x = R.call(this, N, E, ht, nt);
- return M.call(this, z, U, rt, ot, x, ct), this;
- };
- var R = function(N, E, z, U) {
- var rt, ot, ht;
- if (typeof N == "string" && s(N) === t) {
- N = unescape(N);
- var nt = tt(N, !1);
- (nt !== "" || (nt = n.loadFile(N, !0)) !== void 0) && (N = nt);
- }
- if (k(N) && (N = p(N, E)), E = s(N, E), !_(E)) throw new Error("addImage does not support files of type '" + E + "', please ensure that a plugin for '" + E + "' support is added.");
- if (((ht = z) == null || ht.length === 0) && (z = function(ct) {
- return typeof ct == "string" || vt(ct) ? G(ct) : vt(ct.data) ? G(ct.data) : null;
- }(N)), (rt = j.call(this, z)) || (N instanceof Uint8Array || E === "RGBA" || (ot = N, N = dt(N)), rt = this["process" + E.toUpperCase()](N, m.call(this), z, function(ct) {
- return ct && typeof ct == "string" && (ct = ct.toUpperCase()), ct in n.image_compression ? ct : V.NONE;
- }(U), ot)), !rt) throw new Error("An unknown error occurred whilst processing the image.");
- return rt;
- }, tt = n.__addimage__.convertBase64ToBinaryString = function(N, E) {
- E = typeof E != "boolean" || E;
- var z, U = "";
- if (typeof N == "string") {
- var rt;
- z = (rt = it(N)) !== null && rt !== void 0 ? rt : N;
- try {
- U = Ns(z);
- } catch (ot) {
- if (E) throw q(z) ? new Error("atob-Error in jsPDF.convertBase64ToBinaryString " + ot.message) : new Error("Supplied Data is not a valid base64-String jsPDF.convertBase64ToBinaryString ");
- }
- }
- return U;
- };
- n.getImageProperties = function(N) {
- var E, z, U = "";
- if (k(N) && (N = p(N)), typeof N == "string" && s(N) === t && ((U = tt(N, !1)) === "" && (U = n.loadFile(N) || ""), N = U), z = s(N), !_(z)) throw new Error("addImage does not support files of type '" + z + "', please ensure that a plugin for '" + z + "' support is added.");
- if (N instanceof Uint8Array || (N = dt(N)), !(E = this["process" + z.toUpperCase()](N))) throw new Error("An unknown error occurred whilst processing the image");
- return E.fileType = z, E;
- };
- })(Tt.API), /**
- * @license
- * Copyright (c) 2014 Steven Spungin (TwelveTone LLC) steven@twelvetone.tv
- *
- * Licensed under the MIT License.
- * http://opensource.org/licenses/mit-license
- */
- function(n) {
- var e = function(t) {
- if (t !== void 0 && t != "") return !0;
- };
- Tt.API.events.push(["addPage", function(t) {
- this.internal.getPageInfo(t.pageNumber).pageContext.annotations = [];
- }]), n.events.push(["putPage", function(t) {
- for (var i, s, a, c = this.internal.getCoordinateString, l = this.internal.getVerticalCoordinateString, f = this.internal.getPageInfoByObjId(t.objId), d = t.pageContext.annotations, m = !1, _ = 0; _ < d.length && !m; _++) switch ((i = d[_]).type) {
- case "link":
- (e(i.options.url) || e(i.options.pageNumber)) && (m = !0);
- break;
- case "reference":
- case "text":
- case "freetext":
- m = !0;
- }
- if (m != 0) {
- this.internal.write("/Annots [");
- for (var k = 0; k < d.length; k++) {
- i = d[k];
- var p = this.internal.pdfEscape, j = this.internal.getEncryptor(t.objId);
- switch (i.type) {
- case "reference":
- this.internal.write(" " + i.object.objId + " 0 R ");
- break;
- case "text":
- var O = this.internal.newAdditionalObject(), M = this.internal.newAdditionalObject(), S = this.internal.getEncryptor(O.objId), V = i.title || "Note";
- a = "<</Type /Annot /Subtype /Text " + (s = "/Rect [" + c(i.bounds.x) + " " + l(i.bounds.y + i.bounds.h) + " " + c(i.bounds.x + i.bounds.w) + " " + l(i.bounds.y) + "] ") + "/Contents (" + p(S(i.contents)) + ")", a += " /Popup " + M.objId + " 0 R", a += " /P " + f.objId + " 0 R", a += " /T (" + p(S(V)) + ") >>", O.content = a;
- var G = O.objId + " 0 R";
- a = "<</Type /Annot /Subtype /Popup " + (s = "/Rect [" + c(i.bounds.x + 30) + " " + l(i.bounds.y + i.bounds.h) + " " + c(i.bounds.x + i.bounds.w + 30) + " " + l(i.bounds.y) + "] ") + " /Parent " + G, i.open && (a += " /Open true"), a += " >>", M.content = a, this.internal.write(O.objId, "0 R", M.objId, "0 R");
- break;
- case "freetext":
- s = "/Rect [" + c(i.bounds.x) + " " + l(i.bounds.y) + " " + c(i.bounds.x + i.bounds.w) + " " + l(i.bounds.y + i.bounds.h) + "] ";
- var q = "font: Helvetica,sans-serif 12.0pt; text-align:left; color:#" + (i.color || "#000000");
- a = "<</Type /Annot /Subtype /FreeText " + s + "/Contents (" + p(j(i.contents)) + ")", a += " /DS(" + p(j(q)) + ")", a += " /Border [0 0 0]", a += " >>", this.internal.write(a);
- break;
- case "link":
- if (i.options.name) {
- var it = this.annotations._nameMap[i.options.name];
- i.options.pageNumber = it.page, i.options.top = it.y;
- } else i.options.top || (i.options.top = 0);
- if (s = "/Rect [" + i.finalBounds.x + " " + i.finalBounds.y + " " + i.finalBounds.w + " " + i.finalBounds.h + "] ", a = "", i.options.url) a = "<</Type /Annot /Subtype /Link " + s + "/Border [0 0 0] /A <</S /URI /URI (" + p(j(i.options.url)) + ") >>";
- else if (i.options.pageNumber) switch (a = "<</Type /Annot /Subtype /Link " + s + "/Border [0 0 0] /Dest [" + this.internal.getPageInfo(i.options.pageNumber).objId + " 0 R", i.options.magFactor = i.options.magFactor || "XYZ", i.options.magFactor) {
- case "Fit":
- a += " /Fit]";
- break;
- case "FitH":
- a += " /FitH " + i.options.top + "]";
- break;
- case "FitV":
- i.options.left = i.options.left || 0, a += " /FitV " + i.options.left + "]";
- break;
- default:
- var vt = l(i.options.top);
- i.options.left = i.options.left || 0, i.options.zoom === void 0 && (i.options.zoom = 0), a += " /XYZ " + i.options.left + " " + vt + " " + i.options.zoom + "]";
- }
- a != "" && (a += " >>", this.internal.write(a));
- }
- }
- this.internal.write("]");
- }
- }]), n.createAnnotation = function(t) {
- var i = this.internal.getCurrentPageInfo();
- switch (t.type) {
- case "link":
- this.link(t.bounds.x, t.bounds.y, t.bounds.w, t.bounds.h, t);
- break;
- case "text":
- case "freetext":
- i.pageContext.annotations.push(t);
- }
- }, n.link = function(t, i, s, a, c) {
- var l = this.internal.getCurrentPageInfo(), f = this.internal.getCoordinateString, d = this.internal.getVerticalCoordinateString;
- l.pageContext.annotations.push({ finalBounds: { x: f(t), y: d(i), w: f(t + s), h: d(i + a) }, options: c, type: "link" });
- }, n.textWithLink = function(t, i, s, a) {
- var c, l, f = this.getTextWidth(t), d = this.internal.getLineHeight() / this.internal.scaleFactor;
- if (a.maxWidth !== void 0) {
- l = a.maxWidth;
- var m = this.splitTextToSize(t, l).length;
- c = Math.ceil(d * m);
- } else l = f, c = d;
- return this.text(t, i, s, a), s += 0.2 * d, a.align === "center" && (i -= f / 2), a.align === "right" && (i -= f), this.link(i, s - d, l, c, a), f;
- }, n.getTextWidth = function(t) {
- var i = this.internal.getFontSize();
- return this.getStringUnitWidth(t) * i / this.internal.scaleFactor;
- };
- }(Tt.API), /**
- * @license
- * Copyright (c) 2017 Aras Abbasi
- *
- * Licensed under the MIT License.
- * http://opensource.org/licenses/mit-license
- */
- function(n) {
- var e = { 1569: [65152], 1570: [65153, 65154], 1571: [65155, 65156], 1572: [65157, 65158], 1573: [65159, 65160], 1574: [65161, 65162, 65163, 65164], 1575: [65165, 65166], 1576: [65167, 65168, 65169, 65170], 1577: [65171, 65172], 1578: [65173, 65174, 65175, 65176], 1579: [65177, 65178, 65179, 65180], 1580: [65181, 65182, 65183, 65184], 1581: [65185, 65186, 65187, 65188], 1582: [65189, 65190, 65191, 65192], 1583: [65193, 65194], 1584: [65195, 65196], 1585: [65197, 65198], 1586: [65199, 65200], 1587: [65201, 65202, 65203, 65204], 1588: [65205, 65206, 65207, 65208], 1589: [65209, 65210, 65211, 65212], 1590: [65213, 65214, 65215, 65216], 1591: [65217, 65218, 65219, 65220], 1592: [65221, 65222, 65223, 65224], 1593: [65225, 65226, 65227, 65228], 1594: [65229, 65230, 65231, 65232], 1601: [65233, 65234, 65235, 65236], 1602: [65237, 65238, 65239, 65240], 1603: [65241, 65242, 65243, 65244], 1604: [65245, 65246, 65247, 65248], 1605: [65249, 65250, 65251, 65252], 1606: [65253, 65254, 65255, 65256], 1607: [65257, 65258, 65259, 65260], 1608: [65261, 65262], 1609: [65263, 65264, 64488, 64489], 1610: [65265, 65266, 65267, 65268], 1649: [64336, 64337], 1655: [64477], 1657: [64358, 64359, 64360, 64361], 1658: [64350, 64351, 64352, 64353], 1659: [64338, 64339, 64340, 64341], 1662: [64342, 64343, 64344, 64345], 1663: [64354, 64355, 64356, 64357], 1664: [64346, 64347, 64348, 64349], 1667: [64374, 64375, 64376, 64377], 1668: [64370, 64371, 64372, 64373], 1670: [64378, 64379, 64380, 64381], 1671: [64382, 64383, 64384, 64385], 1672: [64392, 64393], 1676: [64388, 64389], 1677: [64386, 64387], 1678: [64390, 64391], 1681: [64396, 64397], 1688: [64394, 64395], 1700: [64362, 64363, 64364, 64365], 1702: [64366, 64367, 64368, 64369], 1705: [64398, 64399, 64400, 64401], 1709: [64467, 64468, 64469, 64470], 1711: [64402, 64403, 64404, 64405], 1713: [64410, 64411, 64412, 64413], 1715: [64406, 64407, 64408, 64409], 1722: [64414, 64415], 1723: [64416, 64417, 64418, 64419], 1726: [64426, 64427, 64428, 64429], 1728: [64420, 64421], 1729: [64422, 64423, 64424, 64425], 1733: [64480, 64481], 1734: [64473, 64474], 1735: [64471, 64472], 1736: [64475, 64476], 1737: [64482, 64483], 1739: [64478, 64479], 1740: [64508, 64509, 64510, 64511], 1744: [64484, 64485, 64486, 64487], 1746: [64430, 64431], 1747: [64432, 64433] }, t = { 65247: { 65154: 65269, 65156: 65271, 65160: 65273, 65166: 65275 }, 65248: { 65154: 65270, 65156: 65272, 65160: 65274, 65166: 65276 }, 65165: { 65247: { 65248: { 65258: 65010 } } }, 1617: { 1612: 64606, 1613: 64607, 1614: 64608, 1615: 64609, 1616: 64610 } }, i = { 1612: 64606, 1613: 64607, 1614: 64608, 1615: 64609, 1616: 64610 }, s = [1570, 1571, 1573, 1575];
- n.__arabicParser__ = {};
- var a = n.__arabicParser__.isInArabicSubstitutionA = function(O) {
- return e[O.charCodeAt(0)] !== void 0;
- }, c = n.__arabicParser__.isArabicLetter = function(O) {
- return typeof O == "string" && /^[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]+$/.test(O);
- }, l = n.__arabicParser__.isArabicEndLetter = function(O) {
- return c(O) && a(O) && e[O.charCodeAt(0)].length <= 2;
- }, f = n.__arabicParser__.isArabicAlfLetter = function(O) {
- return c(O) && s.indexOf(O.charCodeAt(0)) >= 0;
- };
- n.__arabicParser__.arabicLetterHasIsolatedForm = function(O) {
- return c(O) && a(O) && e[O.charCodeAt(0)].length >= 1;
- };
- var d = n.__arabicParser__.arabicLetterHasFinalForm = function(O) {
- return c(O) && a(O) && e[O.charCodeAt(0)].length >= 2;
- };
- n.__arabicParser__.arabicLetterHasInitialForm = function(O) {
- return c(O) && a(O) && e[O.charCodeAt(0)].length >= 3;
- };
- var m = n.__arabicParser__.arabicLetterHasMedialForm = function(O) {
- return c(O) && a(O) && e[O.charCodeAt(0)].length == 4;
- }, _ = n.__arabicParser__.resolveLigatures = function(O) {
- var M = 0, S = t, V = "", G = 0;
- for (M = 0; M < O.length; M += 1) S[O.charCodeAt(M)] !== void 0 ? (G++, typeof (S = S[O.charCodeAt(M)]) == "number" && (V += String.fromCharCode(S), S = t, G = 0), M === O.length - 1 && (S = t, V += O.charAt(M - (G - 1)), M -= G - 1, G = 0)) : (S = t, V += O.charAt(M - G), M -= G, G = 0);
- return V;
- };
- n.__arabicParser__.isArabicDiacritic = function(O) {
- return O !== void 0 && i[O.charCodeAt(0)] !== void 0;
- };
- var k = n.__arabicParser__.getCorrectForm = function(O, M, S) {
- return c(O) ? a(O) === !1 ? -1 : !d(O) || !c(M) && !c(S) || !c(S) && l(M) || l(O) && !c(M) || l(O) && f(M) || l(O) && l(M) ? 0 : m(O) && c(M) && !l(M) && c(S) && d(S) ? 3 : l(O) || !c(S) ? 1 : 2 : -1;
- }, p = function(O) {
- var M = 0, S = 0, V = 0, G = "", q = "", it = "", vt = (O = O || "").split("\\s+"), dt = [];
- for (M = 0; M < vt.length; M += 1) {
- for (dt.push(""), S = 0; S < vt[M].length; S += 1) G = vt[M][S], q = vt[M][S - 1], it = vt[M][S + 1], c(G) ? (V = k(G, q, it), dt[M] += V !== -1 ? String.fromCharCode(e[G.charCodeAt(0)][V]) : G) : dt[M] += G;
- dt[M] = _(dt[M]);
- }
- return dt.join(" ");
- }, j = n.__arabicParser__.processArabic = n.processArabic = function() {
- var O, M = typeof arguments[0] == "string" ? arguments[0] : arguments[0].text, S = [];
- if (Array.isArray(M)) {
- var V = 0;
- for (S = [], V = 0; V < M.length; V += 1) Array.isArray(M[V]) ? S.push([p(M[V][0]), M[V][1], M[V][2]]) : S.push([p(M[V])]);
- O = S;
- } else O = p(M);
- return typeof arguments[0] == "string" ? O : (arguments[0].text = O, arguments[0]);
- };
- n.events.push(["preProcessText", j]);
- }(Tt.API), Tt.API.autoPrint = function(n) {
- var e;
- return (n = n || {}).variant = n.variant || "non-conform", n.variant === "javascript" ? this.addJS("print({});") : (this.internal.events.subscribe("postPutResources", function() {
- e = this.internal.newObject(), this.internal.out("<<"), this.internal.out("/S /Named"), this.internal.out("/Type /Action"), this.internal.out("/N /Print"), this.internal.out(">>"), this.internal.out("endobj");
- }), this.internal.events.subscribe("putCatalog", function() {
- this.internal.out("/OpenAction " + e + " 0 R");
- })), this;
- }, /**
- * @license
- * Copyright (c) 2014 Steven Spungin (TwelveTone LLC) steven@twelvetone.tv
- *
- * Licensed under the MIT License.
- * http://opensource.org/licenses/mit-license
- */
- function(n) {
- var e = function() {
- var t = void 0;
- Object.defineProperty(this, "pdf", { get: function() {
- return t;
- }, set: function(l) {
- t = l;
- } });
- var i = 150;
- Object.defineProperty(this, "width", { get: function() {
- return i;
- }, set: function(l) {
- i = isNaN(l) || Number.isInteger(l) === !1 || l < 0 ? 150 : l, this.getContext("2d").pageWrapXEnabled && (this.getContext("2d").pageWrapX = i + 1);
- } });
- var s = 300;
- Object.defineProperty(this, "height", { get: function() {
- return s;
- }, set: function(l) {
- s = isNaN(l) || Number.isInteger(l) === !1 || l < 0 ? 300 : l, this.getContext("2d").pageWrapYEnabled && (this.getContext("2d").pageWrapY = s + 1);
- } });
- var a = [];
- Object.defineProperty(this, "childNodes", { get: function() {
- return a;
- }, set: function(l) {
- a = l;
- } });
- var c = {};
- Object.defineProperty(this, "style", { get: function() {
- return c;
- }, set: function(l) {
- c = l;
- } }), Object.defineProperty(this, "parentNode", {});
- };
- e.prototype.getContext = function(t, i) {
- var s;
- if ((t = t || "2d") !== "2d") return null;
- for (s in i) this.pdf.context2d.hasOwnProperty(s) && (this.pdf.context2d[s] = i[s]);
- return this.pdf.context2d._canvas = this, this.pdf.context2d;
- }, e.prototype.toDataURL = function() {
- throw new Error("toDataURL is not implemented.");
- }, n.events.push(["initialized", function() {
- this.canvas = new e(), this.canvas.pdf = this;
- }]);
- }(Tt.API), function(n) {
- var e = { left: 0, top: 0, bottom: 0, right: 0 }, t = !1, i = function() {
- this.internal.__cell__ === void 0 && (this.internal.__cell__ = {}, this.internal.__cell__.padding = 3, this.internal.__cell__.headerFunction = void 0, this.internal.__cell__.margins = Object.assign({}, e), this.internal.__cell__.margins.width = this.getPageWidth(), s.call(this));
- }, s = function() {
- this.internal.__cell__.lastCell = new a(), this.internal.__cell__.pages = 1;
- }, a = function() {
- var f = arguments[0];
- Object.defineProperty(this, "x", { enumerable: !0, get: function() {
- return f;
- }, set: function(O) {
- f = O;
- } });
- var d = arguments[1];
- Object.defineProperty(this, "y", { enumerable: !0, get: function() {
- return d;
- }, set: function(O) {
- d = O;
- } });
- var m = arguments[2];
- Object.defineProperty(this, "width", { enumerable: !0, get: function() {
- return m;
- }, set: function(O) {
- m = O;
- } });
- var _ = arguments[3];
- Object.defineProperty(this, "height", { enumerable: !0, get: function() {
- return _;
- }, set: function(O) {
- _ = O;
- } });
- var k = arguments[4];
- Object.defineProperty(this, "text", { enumerable: !0, get: function() {
- return k;
- }, set: function(O) {
- k = O;
- } });
- var p = arguments[5];
- Object.defineProperty(this, "lineNumber", { enumerable: !0, get: function() {
- return p;
- }, set: function(O) {
- p = O;
- } });
- var j = arguments[6];
- return Object.defineProperty(this, "align", { enumerable: !0, get: function() {
- return j;
- }, set: function(O) {
- j = O;
- } }), this;
- };
- a.prototype.clone = function() {
- return new a(this.x, this.y, this.width, this.height, this.text, this.lineNumber, this.align);
- }, a.prototype.toArray = function() {
- return [this.x, this.y, this.width, this.height, this.text, this.lineNumber, this.align];
- }, n.setHeaderFunction = function(f) {
- return i.call(this), this.internal.__cell__.headerFunction = typeof f == "function" ? f : void 0, this;
- }, n.getTextDimensions = function(f, d) {
- i.call(this);
- var m = (d = d || {}).fontSize || this.getFontSize(), _ = d.font || this.getFont(), k = d.scaleFactor || this.internal.scaleFactor, p = 0, j = 0, O = 0, M = this;
- if (!Array.isArray(f) && typeof f != "string") {
- if (typeof f != "number") throw new Error("getTextDimensions expects text-parameter to be of type String or type Number or an Array of Strings.");
- f = String(f);
- }
- var S = d.maxWidth;
- S > 0 ? typeof f == "string" ? f = this.splitTextToSize(f, S) : Object.prototype.toString.call(f) === "[object Array]" && (f = f.reduce(function(G, q) {
- return G.concat(M.splitTextToSize(q, S));
- }, [])) : f = Array.isArray(f) ? f : [f];
- for (var V = 0; V < f.length; V++) p < (O = this.getStringUnitWidth(f[V], { font: _ }) * m) && (p = O);
- return p !== 0 && (j = f.length), { w: p /= k, h: Math.max((j * m * this.getLineHeightFactor() - m * (this.getLineHeightFactor() - 1)) / k, 0) };
- }, n.cellAddPage = function() {
- i.call(this), this.addPage();
- var f = this.internal.__cell__.margins || e;
- return this.internal.__cell__.lastCell = new a(f.left, f.top, void 0, void 0), this.internal.__cell__.pages += 1, this;
- };
- var c = n.cell = function() {
- var f;
- f = arguments[0] instanceof a ? arguments[0] : new a(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4], arguments[5], arguments[6]), i.call(this);
- var d = this.internal.__cell__.lastCell, m = this.internal.__cell__.padding, _ = this.internal.__cell__.margins || e, k = this.internal.__cell__.tableHeaderRow, p = this.internal.__cell__.printHeaders;
- return d.lineNumber !== void 0 && (d.lineNumber === f.lineNumber ? (f.x = (d.x || 0) + (d.width || 0), f.y = d.y || 0) : d.y + d.height + f.height + _.bottom > this.getPageHeight() ? (this.cellAddPage(), f.y = _.top, p && k && (this.printHeaderRow(f.lineNumber, !0), f.y += k[0].height)) : f.y = d.y + d.height || f.y), f.text[0] !== void 0 && (this.rect(f.x, f.y, f.width, f.height, t === !0 ? "FD" : void 0), f.align === "right" ? this.text(f.text, f.x + f.width - m, f.y + m, { align: "right", baseline: "top" }) : f.align === "center" ? this.text(f.text, f.x + f.width / 2, f.y + m, { align: "center", baseline: "top", maxWidth: f.width - m - m }) : this.text(f.text, f.x + m, f.y + m, { align: "left", baseline: "top", maxWidth: f.width - m - m })), this.internal.__cell__.lastCell = f, this;
- };
- n.table = function(f, d, m, _, k) {
- if (i.call(this), !m) throw new Error("No data for PDF table.");
- var p, j, O, M, S = [], V = [], G = [], q = {}, it = {}, vt = [], dt = [], X = (k = k || {}).autoSize || !1, R = k.printHeaders !== !1, tt = k.css && k.css["font-size"] !== void 0 ? 16 * k.css["font-size"] : k.fontSize || 12, N = k.margins || Object.assign({ width: this.getPageWidth() }, e), E = typeof k.padding == "number" ? k.padding : 3, z = k.headerBackgroundColor || "#c8c8c8", U = k.headerTextColor || "#000";
- if (s.call(this), this.internal.__cell__.printHeaders = R, this.internal.__cell__.margins = N, this.internal.__cell__.table_font_size = tt, this.internal.__cell__.padding = E, this.internal.__cell__.headerBackgroundColor = z, this.internal.__cell__.headerTextColor = U, this.setFontSize(tt), _ == null) V = S = Object.keys(m[0]), G = S.map(function() {
- return "left";
- });
- else if (Array.isArray(_) && Se(_[0]) === "object") for (S = _.map(function(At) {
- return At.name;
- }), V = _.map(function(At) {
- return At.prompt || At.name || "";
- }), G = _.map(function(At) {
- return At.align || "left";
- }), p = 0; p < _.length; p += 1) it[_[p].name] = 0.7499990551181103 * _[p].width;
- else Array.isArray(_) && typeof _[0] == "string" && (V = S = _, G = S.map(function() {
- return "left";
- }));
- if (X || Array.isArray(_) && typeof _[0] == "string") for (p = 0; p < S.length; p += 1) {
- for (q[M = S[p]] = m.map(function(At) {
- return At[M];
- }), this.setFont(void 0, "bold"), vt.push(this.getTextDimensions(V[p], { fontSize: this.internal.__cell__.table_font_size, scaleFactor: this.internal.scaleFactor }).w), j = q[M], this.setFont(void 0, "normal"), O = 0; O < j.length; O += 1) vt.push(this.getTextDimensions(j[O], { fontSize: this.internal.__cell__.table_font_size, scaleFactor: this.internal.scaleFactor }).w);
- it[M] = Math.max.apply(null, vt) + E + E, vt = [];
- }
- if (R) {
- var rt = {};
- for (p = 0; p < S.length; p += 1) rt[S[p]] = {}, rt[S[p]].text = V[p], rt[S[p]].align = G[p];
- var ot = l.call(this, rt, it);
- dt = S.map(function(At) {
- return new a(f, d, it[At], ot, rt[At].text, void 0, rt[At].align);
- }), this.setTableHeaderRow(dt), this.printHeaderRow(1, !1);
- }
- var ht = _.reduce(function(At, wt) {
- return At[wt.name] = wt.align, At;
- }, {});
- for (p = 0; p < m.length; p += 1) {
- "rowStart" in k && k.rowStart instanceof Function && k.rowStart({ row: p, data: m[p] }, this);
- var nt = l.call(this, m[p], it);
- for (O = 0; O < S.length; O += 1) {
- var ct = m[p][S[O]];
- "cellStart" in k && k.cellStart instanceof Function && k.cellStart({ row: p, col: O, data: ct }, this), c.call(this, new a(f, d, it[S[O]], nt, ct, p + 2, ht[S[O]]));
- }
- }
- return this.internal.__cell__.table_x = f, this.internal.__cell__.table_y = d, this;
- };
- var l = function(f, d) {
- var m = this.internal.__cell__.padding, _ = this.internal.__cell__.table_font_size, k = this.internal.scaleFactor;
- return Object.keys(f).map(function(p) {
- var j = f[p];
- return this.splitTextToSize(j.hasOwnProperty("text") ? j.text : j, d[p] - m - m);
- }, this).map(function(p) {
- return this.getLineHeightFactor() * p.length * _ / k + m + m;
- }, this).reduce(function(p, j) {
- return Math.max(p, j);
- }, 0);
- };
- n.setTableHeaderRow = function(f) {
- i.call(this), this.internal.__cell__.tableHeaderRow = f;
- }, n.printHeaderRow = function(f, d) {
- if (i.call(this), !this.internal.__cell__.tableHeaderRow) throw new Error("Property tableHeaderRow does not exist.");
- var m;
- if (t = !0, typeof this.internal.__cell__.headerFunction == "function") {
- var _ = this.internal.__cell__.headerFunction(this, this.internal.__cell__.pages);
- this.internal.__cell__.lastCell = new a(_[0], _[1], _[2], _[3], void 0, -1);
- }
- this.setFont(void 0, "bold");
- for (var k = [], p = 0; p < this.internal.__cell__.tableHeaderRow.length; p += 1) {
- m = this.internal.__cell__.tableHeaderRow[p].clone(), d && (m.y = this.internal.__cell__.margins.top || 0, k.push(m)), m.lineNumber = f;
- var j = this.getTextColor();
- this.setTextColor(this.internal.__cell__.headerTextColor), this.setFillColor(this.internal.__cell__.headerBackgroundColor), c.call(this, m), this.setTextColor(j);
- }
- k.length > 0 && this.setTableHeaderRow(k), this.setFont(void 0, "normal"), t = !1;
- };
- }(Tt.API);
- var jh = { italic: ["italic", "oblique", "normal"], oblique: ["oblique", "italic", "normal"], normal: ["normal", "oblique", "italic"] }, Bh = ["ultra-condensed", "extra-condensed", "condensed", "semi-condensed", "normal", "semi-expanded", "expanded", "extra-expanded", "ultra-expanded"], Jo = Oh(Bh), Mh = [100, 200, 300, 400, 500, 600, 700, 800, 900], V1 = Oh(Mh);
- function jo(n) {
- var e = n.family.replace(/"|'/g, "").toLowerCase(), t = function(a) {
- return jh[a = a || "normal"] ? a : "normal";
- }(n.style), i = function(a) {
- return a ? typeof a == "number" ? a >= 100 && a <= 900 && a % 100 == 0 ? a : 400 : /^\d00$/.test(a) ? parseInt(a) : a === "bold" ? 700 : 400 : 400;
- }(n.weight), s = function(a) {
- return typeof Jo[a = a || "normal"] == "number" ? a : "normal";
- }(n.stretch);
- return { family: e, style: t, weight: i, stretch: s, src: n.src || [], ref: n.ref || { name: e, style: [s, t, i].join(" ") } };
- }
- function Ou(n, e, t, i) {
- var s;
- for (s = t; s >= 0 && s < e.length; s += i) if (n[e[s]]) return n[e[s]];
- for (s = t; s >= 0 && s < e.length; s -= i) if (n[e[s]]) return n[e[s]];
- }
- var G1 = { "sans-serif": "helvetica", fixed: "courier", monospace: "courier", terminal: "courier", cursive: "times", fantasy: "times", serif: "times" }, ju = { caption: "times", icon: "times", menu: "times", "message-box": "times", "small-caption": "times", "status-bar": "times" };
- function Bu(n) {
- return [n.stretch, n.style, n.weight, n.family].join(" ");
- }
- function Mu(n) {
- return n.trimLeft();
- }
- function Y1(n, e) {
- for (var t = 0; t < n.length; ) {
- if (n.charAt(t) === e) return [n.substring(0, t), n.substring(t + 1)];
- t += 1;
- }
- return null;
- }
- function J1(n) {
- var e = n.match(/^(-[a-z_]|[a-z_])[a-z0-9_-]*/i);
- return e === null ? null : [e[0], n.substring(e[0].length)];
- }
- var Xi, _s, Ru, Tu, Du, Bo = ["times"];
- function qu(n, e, t, i, s) {
- var a = 4, c = zu;
- switch (s) {
- case Tt.API.image_compression.FAST:
- a = 1, c = Uu;
- break;
- case Tt.API.image_compression.MEDIUM:
- a = 6, c = Hu;
- break;
- case Tt.API.image_compression.SLOW:
- a = 9, c = Wu;
- }
- n = function(f, d, m, _) {
- for (var k, p = f.length / d, j = new Uint8Array(f.length + p), O = [K1, Uu, zu, Hu, Wu], M = 0; M < p; M += 1) {
- var S = M * d, V = f.subarray(S, S + d);
- if (_) j.set(_(V, m, k), S + M);
- else {
- for (var G = O.length, q = [], it = 0; it < G; it += 1) q[it] = O[it](V, m, k);
- var vt = $1(q.concat());
- j.set(q[vt], S + M);
- }
- k = V;
- }
- return j;
- }(n, e, Math.ceil(t * i / 8), c);
- var l = Uo(n, { level: a });
- return Tt.API.__addimage__.arrayBufferToBinaryString(l);
- }
- function K1(n) {
- var e = Array.apply([], n);
- return e.unshift(0), e;
- }
- function Uu(n, e) {
- var t = n.length, i = [];
- i[0] = 1;
- for (var s = 0; s < t; s += 1) {
- var a = n[s - e] || 0;
- i[s + 1] = n[s] - a + 256 & 255;
- }
- return i;
- }
- function zu(n, e, t) {
- var i = n.length, s = [];
- s[0] = 2;
- for (var a = 0; a < i; a += 1) {
- var c = t && t[a] || 0;
- s[a + 1] = n[a] - c + 256 & 255;
- }
- return s;
- }
- function Hu(n, e, t) {
- var i = n.length, s = [];
- s[0] = 3;
- for (var a = 0; a < i; a += 1) {
- var c = n[a - e] || 0, l = t && t[a] || 0;
- s[a + 1] = n[a] + 256 - (c + l >>> 1) & 255;
- }
- return s;
- }
- function Wu(n, e, t) {
- var i = n.length, s = [];
- s[0] = 4;
- for (var a = 0; a < i; a += 1) {
- var c = X1(n[a - e] || 0, t && t[a] || 0, t && t[a - e] || 0);
- s[a + 1] = n[a] - c + 256 & 255;
- }
- return s;
- }
- function X1(n, e, t) {
- if (n === e && e === t) return n;
- var i = Math.abs(e - t), s = Math.abs(n - t), a = Math.abs(n + e - t - t);
- return i <= s && i <= a ? n : s <= a ? e : t;
- }
- function $1(n) {
- var e = n.map(function(t) {
- return t.reduce(function(i, s) {
- return i + Math.abs(s);
- }, 0);
- });
- return e.indexOf(Math.min.apply(null, e));
- }
- function Mo(n, e, t) {
- var i = e * t, s = Math.floor(i / 8), a = 16 - (i - 8 * s + t), c = (1 << t) - 1;
- return Rh(n, s) >> a & c;
- }
- function Vu(n, e, t, i) {
- var s = t * i, a = Math.floor(s / 8), c = 16 - (s - 8 * a + i), l = (1 << i) - 1, f = (e & l) << c;
- (function(d, m, _) {
- if (m + 1 < d.byteLength) d.setUint16(m, _, !1);
- else {
- var k = _ >> 8 & 255;
- d.setUint8(m, k);
- }
- })(n, a, Rh(n, a) & ~(l << c) & 65535 | f);
- }
- function Rh(n, e) {
- return e + 1 < n.byteLength ? n.getUint16(e, !1) : n.getUint8(e) << 8;
- }
- function Z1(n) {
- var e = 0;
- if (n[e++] !== 71 || n[e++] !== 73 || n[e++] !== 70 || n[e++] !== 56 || (n[e++] + 1 & 253) != 56 || n[e++] !== 97) throw new Error("Invalid GIF 87a/89a header.");
- var t = n[e++] | n[e++] << 8, i = n[e++] | n[e++] << 8, s = n[e++], a = s >> 7, c = 1 << 1 + (7 & s);
- n[e++], n[e++];
- var l = null, f = null;
- a && (l = e, f = c, e += 3 * c);
- var d = !0, m = [], _ = 0, k = null, p = 0, j = null;
- for (this.width = t, this.height = i; d && e < n.length; ) switch (n[e++]) {
- case 33:
- switch (n[e++]) {
- case 255:
- if (n[e] !== 11 || n[e + 1] == 78 && n[e + 2] == 69 && n[e + 3] == 84 && n[e + 4] == 83 && n[e + 5] == 67 && n[e + 6] == 65 && n[e + 7] == 80 && n[e + 8] == 69 && n[e + 9] == 50 && n[e + 10] == 46 && n[e + 11] == 48 && n[e + 12] == 3 && n[e + 13] == 1 && n[e + 16] == 0) e += 14, j = n[e++] | n[e++] << 8, e++;
- else for (e += 12; ; ) {
- if (!((N = n[e++]) >= 0)) throw Error("Invalid block size");
- if (N === 0) break;
- e += N;
- }
- break;
- case 249:
- if (n[e++] !== 4 || n[e + 4] !== 0) throw new Error("Invalid graphics extension block.");
- var O = n[e++];
- _ = n[e++] | n[e++] << 8, k = n[e++], 1 & O || (k = null), p = O >> 2 & 7, e++;
- break;
- case 254:
- for (; ; ) {
- if (!((N = n[e++]) >= 0)) throw Error("Invalid block size");
- if (N === 0) break;
- e += N;
- }
- break;
- default:
- throw new Error("Unknown graphic control label: 0x" + n[e - 1].toString(16));
- }
- break;
- case 44:
- var M = n[e++] | n[e++] << 8, S = n[e++] | n[e++] << 8, V = n[e++] | n[e++] << 8, G = n[e++] | n[e++] << 8, q = n[e++], it = q >> 6 & 1, vt = 1 << 1 + (7 & q), dt = l, X = f, R = !1;
- q >> 7 && (R = !0, dt = e, X = vt, e += 3 * vt);
- var tt = e;
- for (e++; ; ) {
- var N;
- if (!((N = n[e++]) >= 0)) throw Error("Invalid block size");
- if (N === 0) break;
- e += N;
- }
- m.push({ x: M, y: S, width: V, height: G, has_local_palette: R, palette_offset: dt, palette_size: X, data_offset: tt, data_length: e - tt, transparent_index: k, interlaced: !!it, delay: _, disposal: p });
- break;
- case 59:
- d = !1;
- break;
- default:
- throw new Error("Unknown gif block: 0x" + n[e - 1].toString(16));
- }
- this.numFrames = function() {
- return m.length;
- }, this.loopCount = function() {
- return j;
- }, this.frameInfo = function(E) {
- if (E < 0 || E >= m.length) throw new Error("Frame index out of range.");
- return m[E];
- }, this.decodeAndBlitFrameBGRA = function(E, z) {
- var U = this.frameInfo(E), rt = U.width * U.height;
- if (rt > 536870912) throw new Error("Image dimensions exceed 512MB, which is too large.");
- var ot = new Uint8Array(rt);
- Gu(n, U.data_offset, ot, rt);
- var ht = U.palette_offset, nt = U.transparent_index;
- nt === null && (nt = 256);
- var ct = U.width, At = t - ct, wt = ct, x = 4 * (U.y * t + U.x), B = 4 * ((U.y + U.height) * t + U.x), T = x, H = 4 * At;
- U.interlaced === !0 && (H += 4 * t * 7);
- for (var J = 8, Z = 0, at = ot.length; Z < at; ++Z) {
- var st = ot[Z];
- if (wt === 0 && (wt = ct, (T += H) >= B && (H = 4 * At + 4 * t * (J - 1), T = x + (ct + At) * (J << 1), J >>= 1)), st === nt) T += 4;
- else {
- var gt = n[ht + 3 * st], _t = n[ht + 3 * st + 1], kt = n[ht + 3 * st + 2];
- z[T++] = kt, z[T++] = _t, z[T++] = gt, z[T++] = 255;
- }
- --wt;
- }
- }, this.decodeAndBlitFrameRGBA = function(E, z) {
- var U = this.frameInfo(E), rt = U.width * U.height;
- if (rt > 536870912) throw new Error("Image dimensions exceed 512MB, which is too large.");
- var ot = new Uint8Array(rt);
- Gu(n, U.data_offset, ot, rt);
- var ht = U.palette_offset, nt = U.transparent_index;
- nt === null && (nt = 256);
- var ct = U.width, At = t - ct, wt = ct, x = 4 * (U.y * t + U.x), B = 4 * ((U.y + U.height) * t + U.x), T = x, H = 4 * At;
- U.interlaced === !0 && (H += 4 * t * 7);
- for (var J = 8, Z = 0, at = ot.length; Z < at; ++Z) {
- var st = ot[Z];
- if (wt === 0 && (wt = ct, (T += H) >= B && (H = 4 * At + 4 * t * (J - 1), T = x + (ct + At) * (J << 1), J >>= 1)), st === nt) T += 4;
- else {
- var gt = n[ht + 3 * st], _t = n[ht + 3 * st + 1], kt = n[ht + 3 * st + 2];
- z[T++] = gt, z[T++] = _t, z[T++] = kt, z[T++] = 255;
- }
- --wt;
- }
- };
- }
- function Gu(n, e, t, i) {
- for (var s = n[e++], a = 1 << s, c = a + 1, l = c + 1, f = s + 1, d = (1 << f) - 1, m = 0, _ = 0, k = 0, p = n[e++], j = new Int32Array(4096), O = null; ; ) {
- for (; m < 16 && p !== 0; ) _ |= n[e++] << m, m += 8, p === 1 ? p = n[e++] : --p;
- if (m < f) break;
- var M = _ & d;
- if (_ >>= f, m -= f, M !== a) {
- if (M === c) break;
- for (var S = M < l ? M : O, V = 0, G = S; G > a; ) G = j[G] >> 8, ++V;
- var q = G;
- if (k + V + (S !== M ? 1 : 0) > i) return void Le.log("Warning, gif stream longer than expected.");
- t[k++] = q;
- var it = k += V;
- for (S !== M && (t[k++] = q), G = S; V--; ) G = j[G], t[--it] = 255 & G, G >>= 8;
- O !== null && l < 4096 && (j[l++] = O << 8 | q, l >= d + 1 && f < 12 && (++f, d = d << 1 | 1)), O = M;
- } else l = c + 1, d = (1 << (f = s + 1)) - 1, O = null;
- }
- return k !== i && Le.log("Warning, gif stream shorter than expected."), t;
- }
- /**
- * @license
- Copyright (c) 2008, Adobe Systems Incorporated
- All rights reserved.
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are
- met:
- * Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- * Neither the name of Adobe Systems Incorporated nor the names of its
- contributors may be used to endorse or promote products derived from
- this software without specific prior written permission.
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
- IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
- function Ro(n) {
- var e, t, i, s, a, c = Math.floor, l = new Array(64), f = new Array(64), d = new Array(64), m = new Array(64), _ = new Array(65535), k = new Array(65535), p = new Array(64), j = new Array(64), O = [], M = 0, S = 7, V = new Array(64), G = new Array(64), q = new Array(64), it = new Array(256), vt = new Array(2048), dt = [0, 1, 5, 6, 14, 15, 27, 28, 2, 4, 7, 13, 16, 26, 29, 42, 3, 8, 12, 17, 25, 30, 41, 43, 9, 11, 18, 24, 31, 40, 44, 53, 10, 19, 23, 32, 39, 45, 52, 54, 20, 22, 33, 38, 46, 51, 55, 60, 21, 34, 37, 47, 50, 56, 59, 61, 35, 36, 48, 49, 57, 58, 62, 63], X = [0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0], R = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], tt = [0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 125], N = [1, 2, 3, 0, 4, 17, 5, 18, 33, 49, 65, 6, 19, 81, 97, 7, 34, 113, 20, 50, 129, 145, 161, 8, 35, 66, 177, 193, 21, 82, 209, 240, 36, 51, 98, 114, 130, 9, 10, 22, 23, 24, 25, 26, 37, 38, 39, 40, 41, 42, 52, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72, 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115, 116, 117, 118, 119, 120, 121, 122, 131, 132, 133, 134, 135, 136, 137, 138, 146, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178, 179, 180, 181, 182, 183, 184, 185, 186, 194, 195, 196, 197, 198, 199, 200, 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250], E = [0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0], z = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], U = [0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 119], rt = [0, 1, 2, 3, 17, 4, 5, 33, 49, 6, 18, 65, 81, 7, 97, 113, 19, 34, 50, 129, 8, 20, 66, 145, 161, 177, 193, 9, 35, 51, 82, 240, 21, 98, 114, 209, 10, 22, 36, 52, 225, 37, 241, 23, 24, 25, 26, 38, 39, 40, 41, 42, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72, 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115, 116, 117, 118, 119, 120, 121, 122, 130, 131, 132, 133, 134, 135, 136, 137, 138, 146, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178, 179, 180, 181, 182, 183, 184, 185, 186, 194, 195, 196, 197, 198, 199, 200, 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218, 226, 227, 228, 229, 230, 231, 232, 233, 234, 242, 243, 244, 245, 246, 247, 248, 249, 250];
- function ot(x, B) {
- for (var T = 0, H = 0, J = new Array(), Z = 1; Z <= 16; Z++) {
- for (var at = 1; at <= x[Z]; at++) J[B[H]] = [], J[B[H]][0] = T, J[B[H]][1] = Z, H++, T++;
- T *= 2;
- }
- return J;
- }
- function ht(x) {
- for (var B = x[0], T = x[1] - 1; T >= 0; ) B & 1 << T && (M |= 1 << S), T--, --S < 0 && (M == 255 ? (nt(255), nt(0)) : nt(M), S = 7, M = 0);
- }
- function nt(x) {
- O.push(x);
- }
- function ct(x) {
- nt(x >> 8 & 255), nt(255 & x);
- }
- function At(x, B, T, H, J) {
- for (var Z, at = J[0], st = J[240], gt = function(yt, Wt) {
- var It, zt, qt, ve, ue, Zt, fe, he, Bt, ne, Rt = 0;
- for (Bt = 0; Bt < 8; ++Bt) {
- It = yt[Rt], zt = yt[Rt + 1], qt = yt[Rt + 2], ve = yt[Rt + 3], ue = yt[Rt + 4], Zt = yt[Rt + 5], fe = yt[Rt + 6];
- var He = It + (he = yt[Rt + 7]), ge = It - he, se = zt + fe, oe = zt - fe, je = qt + Zt, Ut = qt - Zt, ke = ve + ue, Yt = ve - ue, Qt = He + ke, Be = He - ke, le = se + je, Vt = se - je;
- yt[Rt] = Qt + le, yt[Rt + 4] = Qt - le;
- var be = 0.707106781 * (Vt + Be);
- yt[Rt + 2] = Be + be, yt[Rt + 6] = Be - be;
- var Qr = 0.382683433 * ((Qt = Yt + Ut) - (Vt = oe + ge)), fn = 0.5411961 * Qt + Qr, br = 1.306562965 * Vt + Qr, rr = 0.707106781 * (le = Ut + oe), Gt = ge + rr, wr = ge - rr;
- yt[Rt + 5] = wr + fn, yt[Rt + 3] = wr - fn, yt[Rt + 1] = Gt + br, yt[Rt + 7] = Gt - br, Rt += 8;
- }
- for (Rt = 0, Bt = 0; Bt < 8; ++Bt) {
- It = yt[Rt], zt = yt[Rt + 8], qt = yt[Rt + 16], ve = yt[Rt + 24], ue = yt[Rt + 32], Zt = yt[Rt + 40], fe = yt[Rt + 48];
- var yr = It + (he = yt[Rt + 56]), Tn = It - he, Dn = zt + fe, De = zt - fe, rn = qt + Zt, sn = qt - Zt, ti = ve + ue, jr = ve - ue, Gn = yr + ti, ir = yr - ti, Yn = Dn + rn, Jn = Dn - rn;
- yt[Rt] = Gn + Yn, yt[Rt + 32] = Gn - Yn;
- var qn = 0.707106781 * (Jn + ir);
- yt[Rt + 16] = ir + qn, yt[Rt + 48] = ir - qn;
- var ei = 0.382683433 * ((Gn = jr + sn) - (Jn = De + Tn)), ar = 0.5411961 * Gn + ei, ni = 1.306562965 * Jn + ei, Si = 0.707106781 * (Yn = sn + De), ki = Tn + Si, Pi = Tn - Si;
- yt[Rt + 40] = Pi + ar, yt[Rt + 24] = Pi - ar, yt[Rt + 8] = ki + ni, yt[Rt + 56] = ki - ni, Rt++;
- }
- for (Bt = 0; Bt < 64; ++Bt) ne = yt[Bt] * Wt[Bt], p[Bt] = ne > 0 ? ne + 0.5 | 0 : ne - 0.5 | 0;
- return p;
- }(x, B), _t = 0; _t < 64; ++_t) j[dt[_t]] = gt[_t];
- var kt = j[0] - T;
- T = j[0], kt == 0 ? ht(H[0]) : (ht(H[k[Z = 32767 + kt]]), ht(_[Z]));
- for (var St = 63; St > 0 && j[St] == 0; ) St--;
- if (St == 0) return ht(at), T;
- for (var Dt, P = 1; P <= St; ) {
- for (var Lt = P; j[P] == 0 && P <= St; ) ++P;
- var ae = P - Lt;
- if (ae >= 16) {
- Dt = ae >> 4;
- for (var Ht = 1; Ht <= Dt; ++Ht) ht(st);
- ae &= 15;
- }
- Z = 32767 + j[P], ht(J[(ae << 4) + k[Z]]), ht(_[Z]), P++;
- }
- return St != 63 && ht(at), T;
- }
- function wt(x) {
- x = Math.min(Math.max(x, 1), 100), a != x && (function(B) {
- for (var T = [16, 11, 10, 16, 24, 40, 51, 61, 12, 12, 14, 19, 26, 58, 60, 55, 14, 13, 16, 24, 40, 57, 69, 56, 14, 17, 22, 29, 51, 87, 80, 62, 18, 22, 37, 56, 68, 109, 103, 77, 24, 35, 55, 64, 81, 104, 113, 92, 49, 64, 78, 87, 103, 121, 120, 101, 72, 92, 95, 98, 112, 100, 103, 99], H = 0; H < 64; H++) {
- var J = c((T[H] * B + 50) / 100);
- J = Math.min(Math.max(J, 1), 255), l[dt[H]] = J;
- }
- for (var Z = [17, 18, 24, 47, 99, 99, 99, 99, 18, 21, 26, 66, 99, 99, 99, 99, 24, 26, 56, 99, 99, 99, 99, 99, 47, 66, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99], at = 0; at < 64; at++) {
- var st = c((Z[at] * B + 50) / 100);
- st = Math.min(Math.max(st, 1), 255), f[dt[at]] = st;
- }
- for (var gt = [1, 1.387039845, 1.306562965, 1.175875602, 1, 0.785694958, 0.5411961, 0.275899379], _t = 0, kt = 0; kt < 8; kt++) for (var St = 0; St < 8; St++) d[_t] = 1 / (l[dt[_t]] * gt[kt] * gt[St] * 8), m[_t] = 1 / (f[dt[_t]] * gt[kt] * gt[St] * 8), _t++;
- }(x < 50 ? Math.floor(5e3 / x) : Math.floor(200 - 2 * x)), a = x);
- }
- this.encode = function(x, B) {
- B && wt(B), O = new Array(), M = 0, S = 7, ct(65496), ct(65504), ct(16), nt(74), nt(70), nt(73), nt(70), nt(0), nt(1), nt(1), nt(0), ct(1), ct(1), nt(0), nt(0), function() {
- ct(65499), ct(132), nt(0);
- for (var zt = 0; zt < 64; zt++) nt(l[zt]);
- nt(1);
- for (var qt = 0; qt < 64; qt++) nt(f[qt]);
- }(), function(zt, qt) {
- ct(65472), ct(17), nt(8), ct(qt), ct(zt), nt(3), nt(1), nt(17), nt(0), nt(2), nt(17), nt(1), nt(3), nt(17), nt(1);
- }(x.width, x.height), function() {
- ct(65476), ct(418), nt(0);
- for (var zt = 0; zt < 16; zt++) nt(X[zt + 1]);
- for (var qt = 0; qt <= 11; qt++) nt(R[qt]);
- nt(16);
- for (var ve = 0; ve < 16; ve++) nt(tt[ve + 1]);
- for (var ue = 0; ue <= 161; ue++) nt(N[ue]);
- nt(1);
- for (var Zt = 0; Zt < 16; Zt++) nt(E[Zt + 1]);
- for (var fe = 0; fe <= 11; fe++) nt(z[fe]);
- nt(17);
- for (var he = 0; he < 16; he++) nt(U[he + 1]);
- for (var Bt = 0; Bt <= 161; Bt++) nt(rt[Bt]);
- }(), ct(65498), ct(12), nt(3), nt(1), nt(0), nt(2), nt(17), nt(3), nt(17), nt(0), nt(63), nt(0);
- var T = 0, H = 0, J = 0;
- M = 0, S = 7, this.encode.displayName = "_encode_";
- for (var Z, at, st, gt, _t, kt, St, Dt, P, Lt = x.data, ae = x.width, Ht = x.height, yt = 4 * ae, Wt = 0; Wt < Ht; ) {
- for (Z = 0; Z < yt; ) {
- for (_t = yt * Wt + Z, St = -1, Dt = 0, P = 0; P < 64; P++) kt = _t + (Dt = P >> 3) * yt + (St = 4 * (7 & P)), Wt + Dt >= Ht && (kt -= yt * (Wt + 1 + Dt - Ht)), Z + St >= yt && (kt -= Z + St - yt + 4), at = Lt[kt++], st = Lt[kt++], gt = Lt[kt++], V[P] = (vt[at] + vt[st + 256 | 0] + vt[gt + 512 | 0] >> 16) - 128, G[P] = (vt[at + 768 | 0] + vt[st + 1024 | 0] + vt[gt + 1280 | 0] >> 16) - 128, q[P] = (vt[at + 1280 | 0] + vt[st + 1536 | 0] + vt[gt + 1792 | 0] >> 16) - 128;
- T = At(V, d, T, e, i), H = At(G, m, H, t, s), J = At(q, m, J, t, s), Z += 32;
- }
- Wt += 8;
- }
- if (S >= 0) {
- var It = [];
- It[1] = S + 1, It[0] = (1 << S + 1) - 1, ht(It);
- }
- return ct(65497), new Uint8Array(O);
- }, n = n || 50, function() {
- for (var x = String.fromCharCode, B = 0; B < 256; B++) it[B] = x(B);
- }(), e = ot(X, R), t = ot(E, z), i = ot(tt, N), s = ot(U, rt), function() {
- for (var x = 1, B = 2, T = 1; T <= 15; T++) {
- for (var H = x; H < B; H++) k[32767 + H] = T, _[32767 + H] = [], _[32767 + H][1] = T, _[32767 + H][0] = H;
- for (var J = -(B - 1); J <= -x; J++) k[32767 + J] = T, _[32767 + J] = [], _[32767 + J][1] = T, _[32767 + J][0] = B - 1 + J;
- x <<= 1, B <<= 1;
- }
- }(), function() {
- for (var x = 0; x < 256; x++) vt[x] = 19595 * x, vt[x + 256 | 0] = 38470 * x, vt[x + 512 | 0] = 7471 * x + 32768, vt[x + 768 | 0] = -11059 * x, vt[x + 1024 | 0] = -21709 * x, vt[x + 1280 | 0] = 32768 * x + 8421375, vt[x + 1536 | 0] = -27439 * x, vt[x + 1792 | 0] = -5329 * x;
- }(), wt(n);
- }
- /**
- * @license
- * Copyright (c) 2017 Aras Abbasi
- *
- * Licensed under the MIT License.
- * http://opensource.org/licenses/mit-license
- */
- function Qn(n, e) {
- if (this.pos = 0, this.buffer = n, this.datav = new DataView(n.buffer), this.is_with_alpha = !!e, this.bottom_up = !0, this.flag = String.fromCharCode(this.buffer[0]) + String.fromCharCode(this.buffer[1]), this.pos += 2, ["BM", "BA", "CI", "CP", "IC", "PT"].indexOf(this.flag) === -1) throw new Error("Invalid BMP File");
- this.parseHeader(), this.parseBGR();
- }
- function Yu(n) {
- function e(R) {
- if (!R) throw Error("assert :P");
- }
- function t(R, tt, N) {
- for (var E = 0; 4 > E; E++) if (R[tt + E] != N.charCodeAt(E)) return !0;
- return !1;
- }
- function i(R, tt, N, E, z) {
- for (var U = 0; U < z; U++) R[tt + U] = N[E + U];
- }
- function s(R, tt, N, E) {
- for (var z = 0; z < E; z++) R[tt + z] = N;
- }
- function a(R) {
- return new Int32Array(R);
- }
- function c(R, tt) {
- for (var N = [], E = 0; E < R; E++) N.push(new tt());
- return N;
- }
- function l(R, tt) {
- var N = [];
- return function E(z, U, rt) {
- for (var ot = rt[U], ht = 0; ht < ot && (z.push(rt.length > U + 1 ? [] : new tt()), !(rt.length < U + 1)); ht++) E(z[ht], U + 1, rt);
- }(N, 0, R), N;
- }
- var f = function() {
- var R = this;
- function tt(r, o) {
- for (var h = 1 << o - 1 >>> 0; r & h; ) h >>>= 1;
- return h ? (r & h - 1) + h : r;
- }
- function N(r, o, h, g, b) {
- e(!(g % h));
- do
- r[o + (g -= h)] = b;
- while (0 < g);
- }
- function E(r, o, h, g, b) {
- if (e(2328 >= b), 512 >= b) var w = a(512);
- else if ((w = a(b)) == null) return 0;
- return function(y, A, L, F, W, et) {
- var C, Y, $ = A, ut = 1 << L, Q = a(16), ft = a(16);
- for (e(W != 0), e(F != null), e(y != null), e(0 < L), Y = 0; Y < W; ++Y) {
- if (15 < F[Y]) return 0;
- ++Q[F[Y]];
- }
- if (Q[0] == W) return 0;
- for (ft[1] = 0, C = 1; 15 > C; ++C) {
- if (Q[C] > 1 << C) return 0;
- ft[C + 1] = ft[C] + Q[C];
- }
- for (Y = 0; Y < W; ++Y) C = F[Y], 0 < F[Y] && (et[ft[C]++] = Y);
- if (ft[15] == 1) return (F = new z()).g = 0, F.value = et[0], N(y, $, 1, ut, F), ut;
- var pt, xt = -1, bt = ut - 1, Mt = 0, Pt = 1, re = 1, Ot = 1 << L;
- for (Y = 0, C = 1, W = 2; C <= L; ++C, W <<= 1) {
- if (Pt += re <<= 1, 0 > (re -= Q[C])) return 0;
- for (; 0 < Q[C]; --Q[C]) (F = new z()).g = C, F.value = et[Y++], N(y, $ + Mt, W, Ot, F), Mt = tt(Mt, C);
- }
- for (C = L + 1, W = 2; 15 >= C; ++C, W <<= 1) {
- if (Pt += re <<= 1, 0 > (re -= Q[C])) return 0;
- for (; 0 < Q[C]; --Q[C]) {
- if (F = new z(), (Mt & bt) != xt) {
- for ($ += Ot, pt = 1 << (xt = C) - L; 15 > xt && !(0 >= (pt -= Q[xt])); ) ++xt, pt <<= 1;
- ut += Ot = 1 << (pt = xt - L), y[A + (xt = Mt & bt)].g = pt + L, y[A + xt].value = $ - A - xt;
- }
- F.g = C - L, F.value = et[Y++], N(y, $ + (Mt >> L), W, Ot, F), Mt = tt(Mt, C);
- }
- }
- return Pt != 2 * ft[15] - 1 ? 0 : ut;
- }(r, o, h, g, b, w);
- }
- function z() {
- this.value = this.g = 0;
- }
- function U() {
- this.value = this.g = 0;
- }
- function rt() {
- this.G = c(5, z), this.H = a(5), this.jc = this.Qb = this.qb = this.nd = 0, this.pd = c(Ui, U);
- }
- function ot(r, o, h, g) {
- e(r != null), e(o != null), e(2147483648 > g), r.Ca = 254, r.I = 0, r.b = -8, r.Ka = 0, r.oa = o, r.pa = h, r.Jd = o, r.Yc = h + g, r.Zc = 4 <= g ? h + g - 4 + 1 : h, at(r);
- }
- function ht(r, o) {
- for (var h = 0; 0 < o--; ) h |= gt(r, 128) << o;
- return h;
- }
- function nt(r, o) {
- var h = ht(r, o);
- return st(r) ? -h : h;
- }
- function ct(r, o, h, g) {
- var b, w = 0;
- for (e(r != null), e(o != null), e(4294967288 > g), r.Sb = g, r.Ra = 0, r.u = 0, r.h = 0, 4 < g && (g = 4), b = 0; b < g; ++b) w += o[h + b] << 8 * b;
- r.Ra = w, r.bb = g, r.oa = o, r.pa = h;
- }
- function At(r) {
- for (; 8 <= r.u && r.bb < r.Sb; ) r.Ra >>>= 8, r.Ra += r.oa[r.pa + r.bb] << xn - 8 >>> 0, ++r.bb, r.u -= 8;
- H(r) && (r.h = 1, r.u = 0);
- }
- function wt(r, o) {
- if (e(0 <= o), !r.h && o <= wa) {
- var h = T(r) & ci[o];
- return r.u += o, At(r), h;
- }
- return r.h = 1, r.u = 0;
- }
- function x() {
- this.b = this.Ca = this.I = 0, this.oa = [], this.pa = 0, this.Jd = [], this.Yc = 0, this.Zc = [], this.Ka = 0;
- }
- function B() {
- this.Ra = 0, this.oa = [], this.h = this.u = this.bb = this.Sb = this.pa = 0;
- }
- function T(r) {
- return r.Ra >>> (r.u & xn - 1) >>> 0;
- }
- function H(r) {
- return e(r.bb <= r.Sb), r.h || r.bb == r.Sb && r.u > xn;
- }
- function J(r, o) {
- r.u = o, r.h = H(r);
- }
- function Z(r) {
- r.u >= Ln && (e(r.u >= Ln), At(r));
- }
- function at(r) {
- e(r != null && r.oa != null), r.pa < r.Zc ? (r.I = (r.oa[r.pa++] | r.I << 8) >>> 0, r.b += 8) : (e(r != null && r.oa != null), r.pa < r.Yc ? (r.b += 8, r.I = r.oa[r.pa++] | r.I << 8) : r.Ka ? r.b = 0 : (r.I <<= 8, r.b += 8, r.Ka = 1));
- }
- function st(r) {
- return ht(r, 1);
- }
- function gt(r, o) {
- var h = r.Ca;
- 0 > r.b && at(r);
- var g = r.b, b = h * o >>> 8, w = (r.I >>> g > b) + 0;
- for (w ? (h -= b, r.I -= b + 1 << g >>> 0) : h = b + 1, g = h, b = 0; 256 <= g; ) b += 8, g >>= 8;
- return g = 7 ^ b + zi[g], r.b -= g, r.Ca = (h << g) - 1, w;
- }
- function _t(r, o, h) {
- r[o + 0] = h >> 24 & 255, r[o + 1] = h >> 16 & 255, r[o + 2] = h >> 8 & 255, r[o + 3] = 255 & h;
- }
- function kt(r, o) {
- return r[o + 0] | r[o + 1] << 8;
- }
- function St(r, o) {
- return kt(r, o) | r[o + 2] << 16;
- }
- function Dt(r, o) {
- return kt(r, o) | kt(r, o + 2) << 16;
- }
- function P(r, o) {
- var h = 1 << o;
- return e(r != null), e(0 < o), r.X = a(h), r.X == null ? 0 : (r.Mb = 32 - o, r.Xa = o, 1);
- }
- function Lt(r, o) {
- e(r != null), e(o != null), e(r.Xa == o.Xa), i(o.X, 0, r.X, 0, 1 << o.Xa);
- }
- function ae() {
- this.X = [], this.Xa = this.Mb = 0;
- }
- function Ht(r, o, h, g) {
- e(h != null), e(g != null);
- var b = h[0], w = g[0];
- return b == 0 && (b = (r * w + o / 2) / o), w == 0 && (w = (o * b + r / 2) / r), 0 >= b || 0 >= w ? 0 : (h[0] = b, g[0] = w, 1);
- }
- function yt(r, o) {
- return r + (1 << o) - 1 >>> o;
- }
- function Wt(r, o) {
- return ((4278255360 & r) + (4278255360 & o) >>> 0 & 4278255360) + ((16711935 & r) + (16711935 & o) >>> 0 & 16711935) >>> 0;
- }
- function It(r, o) {
- R[o] = function(h, g, b, w, y, A, L) {
- var F;
- for (F = 0; F < y; ++F) {
- var W = R[r](A[L + F - 1], b, w + F);
- A[L + F] = Wt(h[g + F], W);
- }
- };
- }
- function zt() {
- this.ud = this.hd = this.jd = 0;
- }
- function qt(r, o) {
- return ((4278124286 & (r ^ o)) >>> 1) + (r & o) >>> 0;
- }
- function ve(r) {
- return 0 <= r && 256 > r ? r : 0 > r ? 0 : 255 < r ? 255 : void 0;
- }
- function ue(r, o) {
- return ve(r + (r - o + 0.5 >> 1));
- }
- function Zt(r, o, h) {
- return Math.abs(o - h) - Math.abs(r - h);
- }
- function fe(r, o, h, g, b, w, y) {
- for (g = w[y - 1], h = 0; h < b; ++h) w[y + h] = g = Wt(r[o + h], g);
- }
- function he(r, o, h, g, b) {
- var w;
- for (w = 0; w < h; ++w) {
- var y = r[o + w], A = y >> 8 & 255, L = 16711935 & (L = (L = 16711935 & y) + ((A << 16) + A));
- g[b + w] = (4278255360 & y) + L >>> 0;
- }
- }
- function Bt(r, o) {
- o.jd = 255 & r, o.hd = r >> 8 & 255, o.ud = r >> 16 & 255;
- }
- function ne(r, o, h, g, b, w) {
- var y;
- for (y = 0; y < g; ++y) {
- var A = o[h + y], L = A >>> 8, F = A, W = 255 & (W = (W = A >>> 16) + ((r.jd << 24 >> 24) * (L << 24 >> 24) >>> 5));
- F = 255 & (F = (F += (r.hd << 24 >> 24) * (L << 24 >> 24) >>> 5) + ((r.ud << 24 >> 24) * (W << 24 >> 24) >>> 5)), b[w + y] = (4278255360 & A) + (W << 16) + F;
- }
- }
- function Rt(r, o, h, g, b) {
- R[o] = function(w, y, A, L, F, W, et, C, Y) {
- for (L = et; L < C; ++L) for (et = 0; et < Y; ++et) F[W++] = b(A[g(w[y++])]);
- }, R[r] = function(w, y, A, L, F, W, et) {
- var C = 8 >> w.b, Y = w.Ea, $ = w.K[0], ut = w.w;
- if (8 > C) for (w = (1 << w.b) - 1, ut = (1 << C) - 1; y < A; ++y) {
- var Q, ft = 0;
- for (Q = 0; Q < Y; ++Q) Q & w || (ft = g(L[F++])), W[et++] = b($[ft & ut]), ft >>= C;
- }
- else R["VP8LMapColor" + h](L, F, $, ut, W, et, y, A, Y);
- };
- }
- function He(r, o, h, g, b) {
- for (h = o + h; o < h; ) {
- var w = r[o++];
- g[b++] = w >> 16 & 255, g[b++] = w >> 8 & 255, g[b++] = 255 & w;
- }
- }
- function ge(r, o, h, g, b) {
- for (h = o + h; o < h; ) {
- var w = r[o++];
- g[b++] = w >> 16 & 255, g[b++] = w >> 8 & 255, g[b++] = 255 & w, g[b++] = w >> 24 & 255;
- }
- }
- function se(r, o, h, g, b) {
- for (h = o + h; o < h; ) {
- var w = (y = r[o++]) >> 16 & 240 | y >> 12 & 15, y = 240 & y | y >> 28 & 15;
- g[b++] = w, g[b++] = y;
- }
- }
- function oe(r, o, h, g, b) {
- for (h = o + h; o < h; ) {
- var w = (y = r[o++]) >> 16 & 248 | y >> 13 & 7, y = y >> 5 & 224 | y >> 3 & 31;
- g[b++] = w, g[b++] = y;
- }
- }
- function je(r, o, h, g, b) {
- for (h = o + h; o < h; ) {
- var w = r[o++];
- g[b++] = 255 & w, g[b++] = w >> 8 & 255, g[b++] = w >> 16 & 255;
- }
- }
- function Ut(r, o, h, g, b, w) {
- if (w == 0) for (h = o + h; o < h; ) _t(g, ((w = r[o++])[0] >> 24 | w[1] >> 8 & 65280 | w[2] << 8 & 16711680 | w[3] << 24) >>> 0), b += 32;
- else i(g, b, r, o, h);
- }
- function ke(r, o) {
- R[o][0] = R[r + "0"], R[o][1] = R[r + "1"], R[o][2] = R[r + "2"], R[o][3] = R[r + "3"], R[o][4] = R[r + "4"], R[o][5] = R[r + "5"], R[o][6] = R[r + "6"], R[o][7] = R[r + "7"], R[o][8] = R[r + "8"], R[o][9] = R[r + "9"], R[o][10] = R[r + "10"], R[o][11] = R[r + "11"], R[o][12] = R[r + "12"], R[o][13] = R[r + "13"], R[o][14] = R[r + "0"], R[o][15] = R[r + "0"];
- }
- function Yt(r) {
- return r == no || r == ro || r == is || r == io;
- }
- function Qt() {
- this.eb = [], this.size = this.A = this.fb = 0;
- }
- function Be() {
- this.y = [], this.f = [], this.ea = [], this.F = [], this.Tc = this.Ed = this.Cd = this.Fd = this.lb = this.Db = this.Ab = this.fa = this.J = this.W = this.N = this.O = 0;
- }
- function le() {
- this.Rd = this.height = this.width = this.S = 0, this.f = {}, this.f.RGBA = new Qt(), this.f.kb = new Be(), this.sd = null;
- }
- function Vt() {
- this.width = [0], this.height = [0], this.Pd = [0], this.Qd = [0], this.format = [0];
- }
- function be() {
- this.Id = this.fd = this.Md = this.hb = this.ib = this.da = this.bd = this.cd = this.j = this.v = this.Da = this.Sd = this.ob = 0;
- }
- function Qr(r) {
- return alert("todo:WebPSamplerProcessPlane"), r.T;
- }
- function fn(r, o) {
- var h = r.T, g = o.ba.f.RGBA, b = g.eb, w = g.fb + r.ka * g.A, y = Wn[o.ba.S], A = r.y, L = r.O, F = r.f, W = r.N, et = r.ea, C = r.W, Y = o.cc, $ = o.dc, ut = o.Mc, Q = o.Nc, ft = r.ka, pt = r.ka + r.T, xt = r.U, bt = xt + 1 >> 1;
- for (ft == 0 ? y(A, L, null, null, F, W, et, C, F, W, et, C, b, w, null, null, xt) : (y(o.ec, o.fc, A, L, Y, $, ut, Q, F, W, et, C, b, w - g.A, b, w, xt), ++h); ft + 2 < pt; ft += 2) Y = F, $ = W, ut = et, Q = C, W += r.Rc, C += r.Rc, w += 2 * g.A, y(A, (L += 2 * r.fa) - r.fa, A, L, Y, $, ut, Q, F, W, et, C, b, w - g.A, b, w, xt);
- return L += r.fa, r.j + pt < r.o ? (i(o.ec, o.fc, A, L, xt), i(o.cc, o.dc, F, W, bt), i(o.Mc, o.Nc, et, C, bt), h--) : 1 & pt || y(A, L, null, null, F, W, et, C, F, W, et, C, b, w + g.A, null, null, xt), h;
- }
- function br(r, o, h) {
- var g = r.F, b = [r.J];
- if (g != null) {
- var w = r.U, y = o.ba.S, A = y == rs || y == is;
- o = o.ba.f.RGBA;
- var L = [0], F = r.ka;
- L[0] = r.T, r.Kb && (F == 0 ? --L[0] : (--F, b[0] -= r.width), r.j + r.ka + r.T == r.o && (L[0] = r.o - r.j - F));
- var W = o.eb;
- F = o.fb + F * o.A, r = al(g, b[0], r.width, w, L, W, F + (A ? 0 : 3), o.A), e(h == L), r && Yt(y) && Aa(W, F, A, w, L, o.A);
- }
- return 0;
- }
- function rr(r) {
- var o = r.ma, h = o.ba.S, g = 11 > h, b = h == es || h == ns || h == rs || h == eo || h == 12 || Yt(h);
- if (o.memory = null, o.Ib = null, o.Jb = null, o.Nd = null, !zn(o.Oa, r, b ? 11 : 12)) return 0;
- if (b && Yt(h) && Sr(), r.da) alert("todo:use_scaling");
- else {
- if (g) {
- if (o.Ib = Qr, r.Kb) {
- if (h = r.U + 1 >> 1, o.memory = a(r.U + 2 * h), o.memory == null) return 0;
- o.ec = o.memory, o.fc = 0, o.cc = o.ec, o.dc = o.fc + r.U, o.Mc = o.cc, o.Nc = o.dc + h, o.Ib = fn, Sr();
- }
- } else alert("todo:EmitYUV");
- b && (o.Jb = br, g && Te());
- }
- if (g && !xl) {
- for (r = 0; 256 > r; ++r) af[r] = 89858 * (r - 128) + ss >> as, lf[r] = -22014 * (r - 128) + ss, of[r] = -45773 * (r - 128), sf[r] = 113618 * (r - 128) + ss >> as;
- for (r = La; r < oo; ++r) o = 76283 * (r - 16) + ss >> as, uf[r - La] = sr(o, 255), hf[r - La] = sr(o + 8 >> 4, 15);
- xl = 1;
- }
- return 1;
- }
- function Gt(r) {
- var o = r.ma, h = r.U, g = r.T;
- return e(!(1 & r.ka)), 0 >= h || 0 >= g ? 0 : (h = o.Ib(r, o), o.Jb != null && o.Jb(r, o, h), o.Dc += h, 1);
- }
- function wr(r) {
- r.ma.memory = null;
- }
- function yr(r, o, h, g) {
- return wt(r, 8) != 47 ? 0 : (o[0] = wt(r, 14) + 1, h[0] = wt(r, 14) + 1, g[0] = wt(r, 1), wt(r, 3) != 0 ? 0 : !r.h);
- }
- function Tn(r, o) {
- if (4 > r) return r + 1;
- var h = r - 2 >> 1;
- return (2 + (1 & r) << h) + wt(o, h) + 1;
- }
- function Dn(r, o) {
- return 120 < o ? o - 120 : 1 <= (h = ((h = Wh[o - 1]) >> 4) * r + (8 - (15 & h))) ? h : 1;
- var h;
- }
- function De(r, o, h) {
- var g = T(h), b = r[o += 255 & g].g - 8;
- return 0 < b && (J(h, h.u + 8), g = T(h), o += r[o].value, o += g & (1 << b) - 1), J(h, h.u + r[o].g), r[o].value;
- }
- function rn(r, o, h) {
- return h.g += r.g, h.value += r.value << o >>> 0, e(8 >= h.g), r.g;
- }
- function sn(r, o, h) {
- var g = r.xc;
- return e((o = g == 0 ? 0 : r.vc[r.md * (h >> g) + (o >> g)]) < r.Wb), r.Ya[o];
- }
- function ti(r, o, h, g) {
- var b = r.ab, w = r.c * o, y = r.C;
- o = y + o;
- var A = h, L = g;
- for (g = r.Ta, h = r.Ua; 0 < b--; ) {
- var F = r.gc[b], W = y, et = o, C = A, Y = L, $ = (L = g, A = h, F.Ea);
- switch (e(W < et), e(et <= F.nc), F.hc) {
- case 2:
- Hi(C, Y, (et - W) * $, L, A);
- break;
- case 0:
- var ut = W, Q = et, ft = L, pt = A, xt = (Ot = F).Ea;
- ut == 0 && (Dr(C, Y, null, null, 1, ft, pt), fe(C, Y + 1, 0, 0, xt - 1, ft, pt + 1), Y += xt, pt += xt, ++ut);
- for (var bt = 1 << Ot.b, Mt = bt - 1, Pt = yt(xt, Ot.b), re = Ot.K, Ot = Ot.w + (ut >> Ot.b) * Pt; ut < Q; ) {
- var ce = re, tn = Ot, ie = 1;
- for (qr(C, Y, ft, pt - xt, 1, ft, pt); ie < xt; ) {
- var jt = (ie & ~Mt) + bt;
- jt > xt && (jt = xt), (0, Kn[ce[tn++] >> 8 & 15])(C, Y + +ie, ft, pt + ie - xt, jt - ie, ft, pt + ie), ie = jt;
- }
- Y += xt, pt += xt, ++ut & Mt || (Ot += Pt);
- }
- et != F.nc && i(L, A - $, L, A + (et - W - 1) * $, $);
- break;
- case 1:
- for ($ = C, Q = Y, xt = (C = F.Ea) - (pt = C & ~(ft = (Y = 1 << F.b) - 1)), ut = yt(C, F.b), bt = F.K, F = F.w + (W >> F.b) * ut; W < et; ) {
- for (Mt = bt, Pt = F, re = new zt(), Ot = Q + pt, ce = Q + C; Q < Ot; ) Bt(Mt[Pt++], re), pi(re, $, Q, Y, L, A), Q += Y, A += Y;
- Q < ce && (Bt(Mt[Pt++], re), pi(re, $, Q, xt, L, A), Q += xt, A += xt), ++W & ft || (F += ut);
- }
- break;
- case 3:
- if (C == L && Y == A && 0 < F.b) {
- for (Q = L, C = $ = A + (et - W) * $ - (pt = (et - W) * yt(F.Ea, F.b)), Y = L, ft = A, ut = [], pt = (xt = pt) - 1; 0 <= pt; --pt) ut[pt] = Y[ft + pt];
- for (pt = xt - 1; 0 <= pt; --pt) Q[C + pt] = ut[pt];
- di(F, W, et, L, $, L, A);
- } else di(F, W, et, C, Y, L, A);
- }
- A = g, L = h;
- }
- L != h && i(g, h, A, L, w);
- }
- function jr(r, o) {
- var h = r.V, g = r.Ba + r.c * r.C, b = o - r.C;
- if (e(o <= r.l.o), e(16 >= b), 0 < b) {
- var w = r.l, y = r.Ta, A = r.Ua, L = w.width;
- if (ti(r, b, h, g), b = A = [A], e((h = r.C) < (g = o)), e(w.v < w.va), g > w.o && (g = w.o), h < w.j) {
- var F = w.j - h;
- h = w.j, b[0] += F * L;
- }
- if (h >= g ? h = 0 : (b[0] += 4 * w.v, w.ka = h - w.j, w.U = w.va - w.v, w.T = g - h, h = 1), h) {
- if (A = A[0], 11 > (h = r.ca).S) {
- var W = h.f.RGBA, et = (g = h.S, b = w.U, w = w.T, F = W.eb, W.A), C = w;
- for (W = W.fb + r.Ma * W.A; 0 < C--; ) {
- var Y = y, $ = A, ut = b, Q = F, ft = W;
- switch (g) {
- case ts:
- ya(Y, $, ut, Q, ft);
- break;
- case es:
- xa(Y, $, ut, Q, ft);
- break;
- case no:
- xa(Y, $, ut, Q, ft), Aa(Q, ft, 0, ut, 1, 0);
- break;
- case cl:
- mi(Y, $, ut, Q, ft);
- break;
- case ns:
- Ut(Y, $, ut, Q, ft, 1);
- break;
- case ro:
- Ut(Y, $, ut, Q, ft, 1), Aa(Q, ft, 0, ut, 1, 0);
- break;
- case rs:
- Ut(Y, $, ut, Q, ft, 0);
- break;
- case is:
- Ut(Y, $, ut, Q, ft, 0), Aa(Q, ft, 1, ut, 1, 0);
- break;
- case eo:
- Wi(Y, $, ut, Q, ft);
- break;
- case io:
- Wi(Y, $, ut, Q, ft), il(Q, ft, ut, 1, 0);
- break;
- case dl:
- gi(Y, $, ut, Q, ft);
- break;
- default:
- e(0);
- }
- A += L, W += et;
- }
- r.Ma += w;
- } else alert("todo:EmitRescaledRowsYUVA");
- e(r.Ma <= h.height);
- }
- }
- r.C = o, e(r.C <= r.i);
- }
- function Gn(r) {
- var o;
- if (0 < r.ua) return 0;
- for (o = 0; o < r.Wb; ++o) {
- var h = r.Ya[o].G, g = r.Ya[o].H;
- if (0 < h[1][g[1] + 0].g || 0 < h[2][g[2] + 0].g || 0 < h[3][g[3] + 0].g) return 0;
- }
- return 1;
- }
- function ir(r, o, h, g, b, w) {
- if (r.Z != 0) {
- var y = r.qd, A = r.rd;
- for (e(Wr[r.Z] != null); o < h; ++o) Wr[r.Z](y, A, g, b, g, b, w), y = g, A = b, b += w;
- r.qd = y, r.rd = A;
- }
- }
- function Yn(r, o) {
- var h = r.l.ma, g = h.Z == 0 || h.Z == 1 ? r.l.j : r.C;
- if (g = r.C < g ? g : r.C, e(o <= r.l.o), o > g) {
- var b = r.l.width, w = h.ca, y = h.tb + b * g, A = r.V, L = r.Ba + r.c * g, F = r.gc;
- e(r.ab == 1), e(F[0].hc == 3), Qs(F[0], g, o, A, L, w, y), ir(h, g, o, w, y, b);
- }
- r.C = r.Ma = o;
- }
- function Jn(r, o, h, g, b, w, y) {
- var A = r.$ / g, L = r.$ % g, F = r.m, W = r.s, et = h + r.$, C = et;
- b = h + g * b;
- var Y = h + g * w, $ = 280 + W.ua, ut = r.Pb ? A : 16777216, Q = 0 < W.ua ? W.Wa : null, ft = W.wc, pt = et < Y ? sn(W, L, A) : null;
- e(r.C < w), e(Y <= b);
- var xt = !1;
- t: for (; ; ) {
- for (; xt || et < Y; ) {
- var bt = 0;
- if (A >= ut) {
- var Mt = et - h;
- e((ut = r).Pb), ut.wd = ut.m, ut.xd = Mt, 0 < ut.s.ua && Lt(ut.s.Wa, ut.s.vb), ut = A + Gh;
- }
- if (L & ft || (pt = sn(W, L, A)), e(pt != null), pt.Qb && (o[et] = pt.qb, xt = !0), !xt) if (Z(F), pt.jc) {
- bt = F, Mt = o;
- var Pt = et, re = pt.pd[T(bt) & Ui - 1];
- e(pt.jc), 256 > re.g ? (J(bt, bt.u + re.g), Mt[Pt] = re.value, bt = 0) : (J(bt, bt.u + re.g - 256), e(256 <= re.value), bt = re.value), bt == 0 && (xt = !0);
- } else bt = De(pt.G[0], pt.H[0], F);
- if (F.h) break;
- if (xt || 256 > bt) {
- if (!xt) if (pt.nd) o[et] = (pt.qb | bt << 8) >>> 0;
- else {
- if (Z(F), xt = De(pt.G[1], pt.H[1], F), Z(F), Mt = De(pt.G[2], pt.H[2], F), Pt = De(pt.G[3], pt.H[3], F), F.h) break;
- o[et] = (Pt << 24 | xt << 16 | bt << 8 | Mt) >>> 0;
- }
- if (xt = !1, ++et, ++L >= g && (L = 0, ++A, y != null && A <= w && !(A % 16) && y(r, A), Q != null)) for (; C < et; ) bt = o[C++], Q.X[(506832829 * bt & 4294967295) >>> Q.Mb] = bt;
- } else if (280 > bt) {
- if (bt = Tn(bt - 256, F), Mt = De(pt.G[4], pt.H[4], F), Z(F), Mt = Dn(g, Mt = Tn(Mt, F)), F.h) break;
- if (et - h < Mt || b - et < bt) break t;
- for (Pt = 0; Pt < bt; ++Pt) o[et + Pt] = o[et + Pt - Mt];
- for (et += bt, L += bt; L >= g; ) L -= g, ++A, y != null && A <= w && !(A % 16) && y(r, A);
- if (e(et <= b), L & ft && (pt = sn(W, L, A)), Q != null) for (; C < et; ) bt = o[C++], Q.X[(506832829 * bt & 4294967295) >>> Q.Mb] = bt;
- } else {
- if (!(bt < $)) break t;
- for (xt = bt - 280, e(Q != null); C < et; ) bt = o[C++], Q.X[(506832829 * bt & 4294967295) >>> Q.Mb] = bt;
- bt = et, e(!(xt >>> (Mt = Q).Xa)), o[bt] = Mt.X[xt], xt = !0;
- }
- xt || e(F.h == H(F));
- }
- if (r.Pb && F.h && et < b) e(r.m.h), r.a = 5, r.m = r.wd, r.$ = r.xd, 0 < r.s.ua && Lt(r.s.vb, r.s.Wa);
- else {
- if (F.h) break t;
- y != null && y(r, A > w ? w : A), r.a = 0, r.$ = et - h;
- }
- return 1;
- }
- return r.a = 3, 0;
- }
- function qn(r) {
- e(r != null), r.vc = null, r.yc = null, r.Ya = null;
- var o = r.Wa;
- o != null && (o.X = null), r.vb = null, e(r != null);
- }
- function ei() {
- var r = new Et();
- return r == null ? null : (r.a = 0, r.xb = ml, ke("Predictor", "VP8LPredictors"), ke("Predictor", "VP8LPredictors_C"), ke("PredictorAdd", "VP8LPredictorsAdd"), ke("PredictorAdd", "VP8LPredictorsAdd_C"), Hi = he, pi = ne, ya = He, xa = ge, Wi = se, gi = oe, mi = je, R.VP8LMapColor32b = Ze, R.VP8LMapColor8b = fr, r);
- }
- function ar(r, o, h, g, b) {
- var w = 1, y = [r], A = [o], L = g.m, F = g.s, W = null, et = 0;
- t: for (; ; ) {
- if (h) for (; w && wt(L, 1); ) {
- var C = y, Y = A, $ = g, ut = 1, Q = $.m, ft = $.gc[$.ab], pt = wt(Q, 2);
- if ($.Oc & 1 << pt) w = 0;
- else {
- switch ($.Oc |= 1 << pt, ft.hc = pt, ft.Ea = C[0], ft.nc = Y[0], ft.K = [null], ++$.ab, e(4 >= $.ab), pt) {
- case 0:
- case 1:
- ft.b = wt(Q, 3) + 2, ut = ar(yt(ft.Ea, ft.b), yt(ft.nc, ft.b), 0, $, ft.K), ft.K = ft.K[0];
- break;
- case 3:
- var xt, bt = wt(Q, 8) + 1, Mt = 16 < bt ? 0 : 4 < bt ? 1 : 2 < bt ? 2 : 3;
- if (C[0] = yt(ft.Ea, Mt), ft.b = Mt, xt = ut = ar(bt, 1, 0, $, ft.K)) {
- var Pt, re = bt, Ot = ft, ce = 1 << (8 >> Ot.b), tn = a(ce);
- if (tn == null) xt = 0;
- else {
- var ie = Ot.K[0], jt = Ot.w;
- for (tn[0] = Ot.K[0][0], Pt = 1; Pt < 1 * re; ++Pt) tn[Pt] = Wt(ie[jt + Pt], tn[Pt - 1]);
- for (; Pt < 4 * ce; ++Pt) tn[Pt] = 0;
- Ot.K[0] = null, Ot.K[0] = tn, xt = 1;
- }
- }
- ut = xt;
- break;
- case 2:
- break;
- default:
- e(0);
- }
- w = ut;
- }
- }
- if (y = y[0], A = A[0], w && wt(L, 1) && !(w = 1 <= (et = wt(L, 4)) && 11 >= et)) {
- g.a = 3;
- break t;
- }
- var Nt;
- if (Nt = w) e: {
- var Ve, ee, pe, Ee = g, ln = y, _n = A, qe = et, gn = h, An = Ee.m, en = Ee.s, me = [null], we = 1, Ue = 0, ye = Vh[qe];
- n: for (; ; ) {
- if (gn && wt(An, 1)) {
- var un = wt(An, 3) + 2, $n = yt(ln, un), Ge = yt(_n, un), Sn = $n * Ge;
- if (!ar($n, Ge, 0, Ee, me)) break n;
- for (me = me[0], en.xc = un, Ve = 0; Ve < Sn; ++Ve) {
- var Ne = me[Ve] >> 8 & 65535;
- me[Ve] = Ne, Ne >= we && (we = Ne + 1);
- }
- }
- if (An.h) break n;
- for (ee = 0; 5 > ee; ++ee) {
- var nn = pl[ee];
- !ee && 0 < qe && (nn += 1 << qe), Ue < nn && (Ue = nn);
- }
- var Cn = c(we * ye, z), Nn = we, En = c(Nn, rt);
- if (En == null) var On = null;
- else e(65536 >= Nn), On = En;
- var kn = a(Ue);
- if (On == null || kn == null || Cn == null) {
- Ee.a = 1;
- break n;
- }
- var jn = Cn;
- for (Ve = pe = 0; Ve < we; ++Ve) {
- var Fe = On[Ve], Bn = Fe.G, Zn = Fe.H, vi = 0, Fr = 1, hn = 0;
- for (ee = 0; 5 > ee; ++ee) {
- nn = pl[ee], Bn[ee] = jn, Zn[ee] = pe, !ee && 0 < qe && (nn += 1 << qe);
- i: {
- var ls, lo = nn, us = Ee, Sa = kn, df = jn, pf = pe, uo = 0, Vr = us.m, gf = wt(Vr, 1);
- if (s(Sa, 0, 0, lo), gf) {
- var mf = wt(Vr, 1) + 1, vf = wt(Vr, 1), Nl = wt(Vr, vf == 0 ? 1 : 8);
- Sa[Nl] = 1, mf == 2 && (Sa[Nl = wt(Vr, 8)] = 1);
- var hs = 1;
- } else {
- var Ll = a(19), Sl = wt(Vr, 4) + 4;
- if (19 < Sl) {
- us.a = 3;
- var fs = 0;
- break i;
- }
- for (ls = 0; ls < Sl; ++ls) Ll[Hh[ls]] = wt(Vr, 3);
- var ho = void 0, ka = void 0, kl = us, bf = Ll, cs = lo, Pl = Sa, fo = 0, Gr = kl.m, Il = 8, Fl = c(128, z);
- r: for (; E(Fl, 0, 7, bf, 19); ) {
- if (wt(Gr, 1)) {
- var wf = 2 + 2 * wt(Gr, 3);
- if ((ho = 2 + wt(Gr, wf)) > cs) break r;
- } else ho = cs;
- for (ka = 0; ka < cs && ho--; ) {
- Z(Gr);
- var Cl = Fl[0 + (127 & T(Gr))];
- J(Gr, Gr.u + Cl.g);
- var Yi = Cl.value;
- if (16 > Yi) Pl[ka++] = Yi, Yi != 0 && (Il = Yi);
- else {
- var yf = Yi == 16, El = Yi - 16, xf = Uh[El], Ol = wt(Gr, qh[El]) + xf;
- if (ka + Ol > cs) break r;
- for (var _f = yf ? Il : 0; 0 < Ol--; ) Pl[ka++] = _f;
- }
- }
- fo = 1;
- break r;
- }
- fo || (kl.a = 3), hs = fo;
- }
- (hs = hs && !Vr.h) && (uo = E(df, pf, 8, Sa, lo)), hs && uo != 0 ? fs = uo : (us.a = 3, fs = 0);
- }
- if (fs == 0) break n;
- if (Fr && zh[ee] == 1 && (Fr = jn[pe].g == 0), vi += jn[pe].g, pe += fs, 3 >= ee) {
- var Pa, co = kn[0];
- for (Pa = 1; Pa < nn; ++Pa) kn[Pa] > co && (co = kn[Pa]);
- hn += co;
- }
- }
- if (Fe.nd = Fr, Fe.Qb = 0, Fr && (Fe.qb = (Bn[3][Zn[3] + 0].value << 24 | Bn[1][Zn[1] + 0].value << 16 | Bn[2][Zn[2] + 0].value) >>> 0, vi == 0 && 256 > Bn[0][Zn[0] + 0].value && (Fe.Qb = 1, Fe.qb += Bn[0][Zn[0] + 0].value << 8)), Fe.jc = !Fe.Qb && 6 > hn, Fe.jc) {
- var ds, Cr = Fe;
- for (ds = 0; ds < Ui; ++ds) {
- var Yr = ds, Jr = Cr.pd[Yr], ps = Cr.G[0][Cr.H[0] + Yr];
- 256 <= ps.value ? (Jr.g = ps.g + 256, Jr.value = ps.value) : (Jr.g = 0, Jr.value = 0, Yr >>= rn(ps, 8, Jr), Yr >>= rn(Cr.G[1][Cr.H[1] + Yr], 16, Jr), Yr >>= rn(Cr.G[2][Cr.H[2] + Yr], 0, Jr), rn(Cr.G[3][Cr.H[3] + Yr], 24, Jr));
- }
- }
- }
- en.vc = me, en.Wb = we, en.Ya = On, en.yc = Cn, Nt = 1;
- break e;
- }
- Nt = 0;
- }
- if (!(w = Nt)) {
- g.a = 3;
- break t;
- }
- if (0 < et) {
- if (F.ua = 1 << et, !P(F.Wa, et)) {
- g.a = 1, w = 0;
- break t;
- }
- } else F.ua = 0;
- var po = g, jl = y, Af = A, go = po.s, mo = go.xc;
- if (po.c = jl, po.i = Af, go.md = yt(jl, mo), go.wc = mo == 0 ? -1 : (1 << mo) - 1, h) {
- g.xb = Qh;
- break t;
- }
- if ((W = a(y * A)) == null) {
- g.a = 1, w = 0;
- break t;
- }
- w = (w = Jn(g, W, 0, y, A, A, null)) && !L.h;
- break t;
- }
- return w ? (b != null ? b[0] = W : (e(W == null), e(h)), g.$ = 0, h || qn(F)) : qn(F), w;
- }
- function ni(r, o) {
- var h = r.c * r.i, g = h + o + 16 * o;
- return e(r.c <= o), r.V = a(g), r.V == null ? (r.Ta = null, r.Ua = 0, r.a = 1, 0) : (r.Ta = r.V, r.Ua = r.Ba + h + o, 1);
- }
- function Si(r, o) {
- var h = r.C, g = o - h, b = r.V, w = r.Ba + r.c * h;
- for (e(o <= r.l.o); 0 < g; ) {
- var y = 16 < g ? 16 : g, A = r.l.ma, L = r.l.width, F = L * y, W = A.ca, et = A.tb + L * h, C = r.Ta, Y = r.Ua;
- ti(r, y, b, w), sl(C, Y, W, et, F), ir(A, h, h + y, W, et, L), g -= y, b += y * r.c, h += y;
- }
- e(h == o), r.C = r.Ma = o;
- }
- function ki() {
- this.ub = this.yd = this.td = this.Rb = 0;
- }
- function Pi() {
- this.Kd = this.Ld = this.Ud = this.Td = this.i = this.c = 0;
- }
- function Bs() {
- this.Fb = this.Bb = this.Cb = 0, this.Zb = a(4), this.Lb = a(4);
- }
- function sa() {
- this.Yb = function() {
- var r = [];
- return function o(h, g, b) {
- for (var w = b[g], y = 0; y < w && (h.push(b.length > g + 1 ? [] : 0), !(b.length < g + 1)); y++) o(h[y], g + 1, b);
- }(r, 0, [3, 11]), r;
- }();
- }
- function Ba() {
- this.jb = a(3), this.Wc = l([4, 8], sa), this.Xc = l([4, 17], sa);
- }
- function Ma() {
- this.Pc = this.wb = this.Tb = this.zd = 0, this.vd = new a(4), this.od = new a(4);
- }
- function Un() {
- this.ld = this.La = this.dd = this.tc = 0;
- }
- function oa() {
- this.Na = this.la = 0;
- }
- function Ra() {
- this.Sc = [0, 0], this.Eb = [0, 0], this.Qc = [0, 0], this.ia = this.lc = 0;
- }
- function la() {
- this.ad = a(384), this.Za = 0, this.Ob = a(16), this.$b = this.Ad = this.ia = this.Gc = this.Hc = this.Dd = 0;
- }
- function Ta() {
- this.uc = this.M = this.Nb = 0, this.wa = Array(new Un()), this.Y = 0, this.ya = Array(new la()), this.aa = 0, this.l = new Ii();
- }
- function Da() {
- this.y = a(16), this.f = a(8), this.ea = a(8);
- }
- function qa() {
- this.cb = this.a = 0, this.sc = "", this.m = new x(), this.Od = new ki(), this.Kc = new Pi(), this.ed = new Ma(), this.Qa = new Bs(), this.Ic = this.$c = this.Aa = 0, this.D = new Ta(), this.Xb = this.Va = this.Hb = this.zb = this.yb = this.Ub = this.za = 0, this.Jc = c(8, x), this.ia = 0, this.pb = c(4, Ra), this.Pa = new Ba(), this.Bd = this.kc = 0, this.Ac = [], this.Bc = 0, this.zc = [0, 0, 0, 0], this.Gd = Array(new Da()), this.Hd = 0, this.rb = Array(new oa()), this.sb = 0, this.wa = Array(new Un()), this.Y = 0, this.oc = [], this.pc = 0, this.sa = [], this.ta = 0, this.qa = [], this.ra = 0, this.Ha = [], this.B = this.R = this.Ia = 0, this.Ec = [], this.M = this.ja = this.Vb = this.Fc = 0, this.ya = Array(new la()), this.L = this.aa = 0, this.gd = l([4, 2], Un), this.ga = null, this.Fa = [], this.Cc = this.qc = this.P = 0, this.Gb = [], this.Uc = 0, this.mb = [], this.nb = 0, this.rc = [], this.Ga = this.Vc = 0;
- }
- function sr(r, o) {
- return 0 > r ? 0 : r > o ? o : r;
- }
- function Ii() {
- this.T = this.U = this.ka = this.height = this.width = 0, this.y = [], this.f = [], this.ea = [], this.Rc = this.fa = this.W = this.N = this.O = 0, this.ma = "void", this.put = "VP8IoPutHook", this.ac = "VP8IoSetupHook", this.bc = "VP8IoTeardownHook", this.ha = this.Kb = 0, this.data = [], this.hb = this.ib = this.da = this.o = this.j = this.va = this.v = this.Da = this.ob = this.w = 0, this.F = [], this.J = 0;
- }
- function Ms() {
- var r = new qa();
- return r != null && (r.a = 0, r.sc = "OK", r.cb = 0, r.Xb = 0, Na || (Na = Fi)), r;
- }
- function Xe(r, o, h) {
- return r.a == 0 && (r.a = o, r.sc = h, r.cb = 0), 0;
- }
- function Ua(r, o, h) {
- return 3 <= h && r[o + 0] == 157 && r[o + 1] == 1 && r[o + 2] == 42;
- }
- function or(r, o) {
- if (r == null) return 0;
- if (r.a = 0, r.sc = "OK", o == null) return Xe(r, 2, "null VP8Io passed to VP8GetHeaders()");
- var h = o.data, g = o.w, b = o.ha;
- if (4 > b) return Xe(r, 7, "Truncated header.");
- var w = h[g + 0] | h[g + 1] << 8 | h[g + 2] << 16, y = r.Od;
- if (y.Rb = !(1 & w), y.td = w >> 1 & 7, y.yd = w >> 4 & 1, y.ub = w >> 5, 3 < y.td) return Xe(r, 3, "Incorrect keyframe parameters.");
- if (!y.yd) return Xe(r, 4, "Frame not displayable.");
- g += 3, b -= 3;
- var A = r.Kc;
- if (y.Rb) {
- if (7 > b) return Xe(r, 7, "cannot parse picture header");
- if (!Ua(h, g, b)) return Xe(r, 3, "Bad code word");
- A.c = 16383 & (h[g + 4] << 8 | h[g + 3]), A.Td = h[g + 4] >> 6, A.i = 16383 & (h[g + 6] << 8 | h[g + 5]), A.Ud = h[g + 6] >> 6, g += 7, b -= 7, r.za = A.c + 15 >> 4, r.Ub = A.i + 15 >> 4, o.width = A.c, o.height = A.i, o.Da = 0, o.j = 0, o.v = 0, o.va = o.width, o.o = o.height, o.da = 0, o.ib = o.width, o.hb = o.height, o.U = o.width, o.T = o.height, s((w = r.Pa).jb, 0, 255, w.jb.length), e((w = r.Qa) != null), w.Cb = 0, w.Bb = 0, w.Fb = 1, s(w.Zb, 0, 0, w.Zb.length), s(w.Lb, 0, 0, w.Lb);
- }
- if (y.ub > b) return Xe(r, 7, "bad partition length");
- ot(w = r.m, h, g, y.ub), g += y.ub, b -= y.ub, y.Rb && (A.Ld = st(w), A.Kd = st(w)), A = r.Qa;
- var L, F = r.Pa;
- if (e(w != null), e(A != null), A.Cb = st(w), A.Cb) {
- if (A.Bb = st(w), st(w)) {
- for (A.Fb = st(w), L = 0; 4 > L; ++L) A.Zb[L] = st(w) ? nt(w, 7) : 0;
- for (L = 0; 4 > L; ++L) A.Lb[L] = st(w) ? nt(w, 6) : 0;
- }
- if (A.Bb) for (L = 0; 3 > L; ++L) F.jb[L] = st(w) ? ht(w, 8) : 255;
- } else A.Bb = 0;
- if (w.Ka) return Xe(r, 3, "cannot parse segment header");
- if ((A = r.ed).zd = st(w), A.Tb = ht(w, 6), A.wb = ht(w, 3), A.Pc = st(w), A.Pc && st(w)) {
- for (F = 0; 4 > F; ++F) st(w) && (A.vd[F] = nt(w, 6));
- for (F = 0; 4 > F; ++F) st(w) && (A.od[F] = nt(w, 6));
- }
- if (r.L = A.Tb == 0 ? 0 : A.zd ? 1 : 2, w.Ka) return Xe(r, 3, "cannot parse filter header");
- var W = b;
- if (b = L = g, g = L + W, A = W, r.Xb = (1 << ht(r.m, 2)) - 1, W < 3 * (F = r.Xb)) h = 7;
- else {
- for (L += 3 * F, A -= 3 * F, W = 0; W < F; ++W) {
- var et = h[b + 0] | h[b + 1] << 8 | h[b + 2] << 16;
- et > A && (et = A), ot(r.Jc[+W], h, L, et), L += et, A -= et, b += 3;
- }
- ot(r.Jc[+F], h, L, A), h = L < g ? 0 : 5;
- }
- if (h != 0) return Xe(r, h, "cannot parse partitions");
- for (h = ht(L = r.m, 7), b = st(L) ? nt(L, 4) : 0, g = st(L) ? nt(L, 4) : 0, A = st(L) ? nt(L, 4) : 0, F = st(L) ? nt(L, 4) : 0, L = st(L) ? nt(L, 4) : 0, W = r.Qa, et = 0; 4 > et; ++et) {
- if (W.Cb) {
- var C = W.Zb[et];
- W.Fb || (C += h);
- } else {
- if (0 < et) {
- r.pb[et] = r.pb[0];
- continue;
- }
- C = h;
- }
- var Y = r.pb[et];
- Y.Sc[0] = ao[sr(C + b, 127)], Y.Sc[1] = so[sr(C + 0, 127)], Y.Eb[0] = 2 * ao[sr(C + g, 127)], Y.Eb[1] = 101581 * so[sr(C + A, 127)] >> 16, 8 > Y.Eb[1] && (Y.Eb[1] = 8), Y.Qc[0] = ao[sr(C + F, 117)], Y.Qc[1] = so[sr(C + L, 127)], Y.lc = C + L;
- }
- if (!y.Rb) return Xe(r, 4, "Not a key frame.");
- for (st(w), y = r.Pa, h = 0; 4 > h; ++h) {
- for (b = 0; 8 > b; ++b) for (g = 0; 3 > g; ++g) for (A = 0; 11 > A; ++A) F = gt(w, $h[h][b][g][A]) ? ht(w, 8) : Kh[h][b][g][A], y.Wc[h][b].Yb[g][A] = F;
- for (b = 0; 17 > b; ++b) y.Xc[h][b] = y.Wc[h][Zh[b]];
- }
- return r.kc = st(w), r.kc && (r.Bd = ht(w, 8)), r.cb = 1;
- }
- function Fi(r, o, h, g, b, w, y) {
- var A = o[b].Yb[h];
- for (h = 0; 16 > b; ++b) {
- if (!gt(r, A[h + 0])) return b;
- for (; !gt(r, A[h + 1]); ) if (A = o[++b].Yb[0], h = 0, b == 16) return 16;
- var L = o[b + 1].Yb;
- if (gt(r, A[h + 2])) {
- var F = r, W = 0;
- if (gt(F, (C = A)[(et = h) + 3])) if (gt(F, C[et + 6])) {
- for (A = 0, et = 2 * (W = gt(F, C[et + 8])) + (C = gt(F, C[et + 9 + W])), W = 0, C = Yh[et]; C[A]; ++A) W += W + gt(F, C[A]);
- W += 3 + (8 << et);
- } else gt(F, C[et + 7]) ? (W = 7 + 2 * gt(F, 165), W += gt(F, 145)) : W = 5 + gt(F, 159);
- else W = gt(F, C[et + 4]) ? 3 + gt(F, C[et + 5]) : 2;
- A = L[2];
- } else W = 1, A = L[1];
- L = y + Jh[b], 0 > (F = r).b && at(F);
- var et, C = F.b, Y = (et = F.Ca >> 1) - (F.I >> C) >> 31;
- --F.b, F.Ca += Y, F.Ca |= 1, F.I -= (et + 1 & Y) << C, w[L] = ((W ^ Y) - Y) * g[(0 < b) + 0];
- }
- return 16;
- }
- function ua(r) {
- var o = r.rb[r.sb - 1];
- o.la = 0, o.Na = 0, s(r.zc, 0, 0, r.zc.length), r.ja = 0;
- }
- function In(r, o, h, g, b) {
- b = r[o + h + 32 * g] + (b >> 3), r[o + h + 32 * g] = -256 & b ? 0 > b ? 0 : 255 : b;
- }
- function Ci(r, o, h, g, b, w) {
- In(r, o, 0, h, g + b), In(r, o, 1, h, g + w), In(r, o, 2, h, g - w), In(r, o, 3, h, g - b);
- }
- function xr(r) {
- return (20091 * r >> 16) + r;
- }
- function on(r, o, h, g) {
- var b, w = 0, y = a(16);
- for (b = 0; 4 > b; ++b) {
- var A = r[o + 0] + r[o + 8], L = r[o + 0] - r[o + 8], F = (35468 * r[o + 4] >> 16) - xr(r[o + 12]), W = xr(r[o + 4]) + (35468 * r[o + 12] >> 16);
- y[w + 0] = A + W, y[w + 1] = L + F, y[w + 2] = L - F, y[w + 3] = A - W, w += 4, o++;
- }
- for (b = w = 0; 4 > b; ++b) A = (r = y[w + 0] + 4) + y[w + 8], L = r - y[w + 8], F = (35468 * y[w + 4] >> 16) - xr(y[w + 12]), In(h, g, 0, 0, A + (W = xr(y[w + 4]) + (35468 * y[w + 12] >> 16))), In(h, g, 1, 0, L + F), In(h, g, 2, 0, L - F), In(h, g, 3, 0, A - W), w++, g += 32;
- }
- function za(r, o, h, g) {
- var b = r[o + 0] + 4, w = 35468 * r[o + 4] >> 16, y = xr(r[o + 4]), A = 35468 * r[o + 1] >> 16;
- Ci(h, g, 0, b + y, r = xr(r[o + 1]), A), Ci(h, g, 1, b + w, r, A), Ci(h, g, 2, b - w, r, A), Ci(h, g, 3, b - y, r, A);
- }
- function Rs(r, o, h, g, b) {
- on(r, o, h, g), b && on(r, o + 16, h, g + 4);
- }
- function Ts(r, o, h, g) {
- kr(r, o + 0, h, g, 1), kr(r, o + 32, h, g + 128, 1);
- }
- function Ds(r, o, h, g) {
- var b;
- for (r = r[o + 0] + 4, b = 0; 4 > b; ++b) for (o = 0; 4 > o; ++o) In(h, g, o, b, r);
- }
- function lr(r, o, h, g) {
- r[o + 0] && pn(r, o + 0, h, g), r[o + 16] && pn(r, o + 16, h, g + 4), r[o + 32] && pn(r, o + 32, h, g + 128), r[o + 48] && pn(r, o + 48, h, g + 128 + 4);
- }
- function Ha(r, o, h, g) {
- var b, w = a(16);
- for (b = 0; 4 > b; ++b) {
- var y = r[o + 0 + b] + r[o + 12 + b], A = r[o + 4 + b] + r[o + 8 + b], L = r[o + 4 + b] - r[o + 8 + b], F = r[o + 0 + b] - r[o + 12 + b];
- w[0 + b] = y + A, w[8 + b] = y - A, w[4 + b] = F + L, w[12 + b] = F - L;
- }
- for (b = 0; 4 > b; ++b) y = (r = w[0 + 4 * b] + 3) + w[3 + 4 * b], A = w[1 + 4 * b] + w[2 + 4 * b], L = w[1 + 4 * b] - w[2 + 4 * b], F = r - w[3 + 4 * b], h[g + 0] = y + A >> 3, h[g + 16] = F + L >> 3, h[g + 32] = y - A >> 3, h[g + 48] = F - L >> 3, g += 64;
- }
- function Ei(r, o, h) {
- var g, b = o - 32, w = Fn, y = 255 - r[b - 1];
- for (g = 0; g < h; ++g) {
- var A, L = w, F = y + r[o - 1];
- for (A = 0; A < h; ++A) r[o + A] = L[F + r[b + A]];
- o += 32;
- }
- }
- function Oi(r, o) {
- Ei(r, o, 4);
- }
- function ha(r, o) {
- Ei(r, o, 8);
- }
- function qs(r, o) {
- Ei(r, o, 16);
- }
- function Us(r, o) {
- var h;
- for (h = 0; 16 > h; ++h) i(r, o + 32 * h, r, o - 32, 16);
- }
- function zs(r, o) {
- var h;
- for (h = 16; 0 < h; --h) s(r, o, r[o - 1], 16), o += 32;
- }
- function Br(r, o, h) {
- var g;
- for (g = 0; 16 > g; ++g) s(o, h + 32 * g, r, 16);
- }
- function Wa(r, o) {
- var h, g = 16;
- for (h = 0; 16 > h; ++h) g += r[o - 1 + 32 * h] + r[o + h - 32];
- Br(g >> 5, r, o);
- }
- function Mr(r, o) {
- var h, g = 8;
- for (h = 0; 16 > h; ++h) g += r[o - 1 + 32 * h];
- Br(g >> 4, r, o);
- }
- function Hs(r, o) {
- var h, g = 8;
- for (h = 0; 16 > h; ++h) g += r[o + h - 32];
- Br(g >> 4, r, o);
- }
- function ri(r, o) {
- Br(128, r, o);
- }
- function Jt(r, o, h) {
- return r + 2 * o + h + 2 >> 2;
- }
- function Ws(r, o) {
- var h, g = o - 32;
- for (g = new Uint8Array([Jt(r[g - 1], r[g + 0], r[g + 1]), Jt(r[g + 0], r[g + 1], r[g + 2]), Jt(r[g + 1], r[g + 2], r[g + 3]), Jt(r[g + 2], r[g + 3], r[g + 4])]), h = 0; 4 > h; ++h) i(r, o + 32 * h, g, 0, g.length);
- }
- function Vs(r, o) {
- var h = r[o - 1], g = r[o - 1 + 32], b = r[o - 1 + 64], w = r[o - 1 + 96];
- _t(r, o + 0, 16843009 * Jt(r[o - 1 - 32], h, g)), _t(r, o + 32, 16843009 * Jt(h, g, b)), _t(r, o + 64, 16843009 * Jt(g, b, w)), _t(r, o + 96, 16843009 * Jt(b, w, w));
- }
- function Gs(r, o) {
- var h, g = 4;
- for (h = 0; 4 > h; ++h) g += r[o + h - 32] + r[o - 1 + 32 * h];
- for (g >>= 3, h = 0; 4 > h; ++h) s(r, o + 32 * h, g, 4);
- }
- function Ys(r, o) {
- var h = r[o - 1 + 0], g = r[o - 1 + 32], b = r[o - 1 + 64], w = r[o - 1 - 32], y = r[o + 0 - 32], A = r[o + 1 - 32], L = r[o + 2 - 32], F = r[o + 3 - 32];
- r[o + 0 + 96] = Jt(g, b, r[o - 1 + 96]), r[o + 1 + 96] = r[o + 0 + 64] = Jt(h, g, b), r[o + 2 + 96] = r[o + 1 + 64] = r[o + 0 + 32] = Jt(w, h, g), r[o + 3 + 96] = r[o + 2 + 64] = r[o + 1 + 32] = r[o + 0 + 0] = Jt(y, w, h), r[o + 3 + 64] = r[o + 2 + 32] = r[o + 1 + 0] = Jt(A, y, w), r[o + 3 + 32] = r[o + 2 + 0] = Jt(L, A, y), r[o + 3 + 0] = Jt(F, L, A);
- }
- function Js(r, o) {
- var h = r[o + 1 - 32], g = r[o + 2 - 32], b = r[o + 3 - 32], w = r[o + 4 - 32], y = r[o + 5 - 32], A = r[o + 6 - 32], L = r[o + 7 - 32];
- r[o + 0 + 0] = Jt(r[o + 0 - 32], h, g), r[o + 1 + 0] = r[o + 0 + 32] = Jt(h, g, b), r[o + 2 + 0] = r[o + 1 + 32] = r[o + 0 + 64] = Jt(g, b, w), r[o + 3 + 0] = r[o + 2 + 32] = r[o + 1 + 64] = r[o + 0 + 96] = Jt(b, w, y), r[o + 3 + 32] = r[o + 2 + 64] = r[o + 1 + 96] = Jt(w, y, A), r[o + 3 + 64] = r[o + 2 + 96] = Jt(y, A, L), r[o + 3 + 96] = Jt(A, L, L);
- }
- function _r(r, o) {
- var h = r[o - 1 + 0], g = r[o - 1 + 32], b = r[o - 1 + 64], w = r[o - 1 - 32], y = r[o + 0 - 32], A = r[o + 1 - 32], L = r[o + 2 - 32], F = r[o + 3 - 32];
- r[o + 0 + 0] = r[o + 1 + 64] = w + y + 1 >> 1, r[o + 1 + 0] = r[o + 2 + 64] = y + A + 1 >> 1, r[o + 2 + 0] = r[o + 3 + 64] = A + L + 1 >> 1, r[o + 3 + 0] = L + F + 1 >> 1, r[o + 0 + 96] = Jt(b, g, h), r[o + 0 + 64] = Jt(g, h, w), r[o + 0 + 32] = r[o + 1 + 96] = Jt(h, w, y), r[o + 1 + 32] = r[o + 2 + 96] = Jt(w, y, A), r[o + 2 + 32] = r[o + 3 + 96] = Jt(y, A, L), r[o + 3 + 32] = Jt(A, L, F);
- }
- function Ar(r, o) {
- var h = r[o + 0 - 32], g = r[o + 1 - 32], b = r[o + 2 - 32], w = r[o + 3 - 32], y = r[o + 4 - 32], A = r[o + 5 - 32], L = r[o + 6 - 32], F = r[o + 7 - 32];
- r[o + 0 + 0] = h + g + 1 >> 1, r[o + 1 + 0] = r[o + 0 + 64] = g + b + 1 >> 1, r[o + 2 + 0] = r[o + 1 + 64] = b + w + 1 >> 1, r[o + 3 + 0] = r[o + 2 + 64] = w + y + 1 >> 1, r[o + 0 + 32] = Jt(h, g, b), r[o + 1 + 32] = r[o + 0 + 96] = Jt(g, b, w), r[o + 2 + 32] = r[o + 1 + 96] = Jt(b, w, y), r[o + 3 + 32] = r[o + 2 + 96] = Jt(w, y, A), r[o + 3 + 64] = Jt(y, A, L), r[o + 3 + 96] = Jt(A, L, F);
- }
- function Ks(r, o) {
- var h = r[o - 1 + 0], g = r[o - 1 + 32], b = r[o - 1 + 64], w = r[o - 1 + 96];
- r[o + 0 + 0] = h + g + 1 >> 1, r[o + 2 + 0] = r[o + 0 + 32] = g + b + 1 >> 1, r[o + 2 + 32] = r[o + 0 + 64] = b + w + 1 >> 1, r[o + 1 + 0] = Jt(h, g, b), r[o + 3 + 0] = r[o + 1 + 32] = Jt(g, b, w), r[o + 3 + 32] = r[o + 1 + 64] = Jt(b, w, w), r[o + 3 + 64] = r[o + 2 + 64] = r[o + 0 + 96] = r[o + 1 + 96] = r[o + 2 + 96] = r[o + 3 + 96] = w;
- }
- function Xs(r, o) {
- var h = r[o - 1 + 0], g = r[o - 1 + 32], b = r[o - 1 + 64], w = r[o - 1 + 96], y = r[o - 1 - 32], A = r[o + 0 - 32], L = r[o + 1 - 32], F = r[o + 2 - 32];
- r[o + 0 + 0] = r[o + 2 + 32] = h + y + 1 >> 1, r[o + 0 + 32] = r[o + 2 + 64] = g + h + 1 >> 1, r[o + 0 + 64] = r[o + 2 + 96] = b + g + 1 >> 1, r[o + 0 + 96] = w + b + 1 >> 1, r[o + 3 + 0] = Jt(A, L, F), r[o + 2 + 0] = Jt(y, A, L), r[o + 1 + 0] = r[o + 3 + 32] = Jt(h, y, A), r[o + 1 + 32] = r[o + 3 + 64] = Jt(g, h, y), r[o + 1 + 64] = r[o + 3 + 96] = Jt(b, g, h), r[o + 1 + 96] = Jt(w, b, g);
- }
- function ji(r, o) {
- var h;
- for (h = 0; 8 > h; ++h) i(r, o + 32 * h, r, o - 32, 8);
- }
- function fa(r, o) {
- var h;
- for (h = 0; 8 > h; ++h) s(r, o, r[o - 1], 8), o += 32;
- }
- function ur(r, o, h) {
- var g;
- for (g = 0; 8 > g; ++g) s(o, h + 32 * g, r, 8);
- }
- function $s(r, o) {
- var h, g = 8;
- for (h = 0; 8 > h; ++h) g += r[o + h - 32] + r[o - 1 + 32 * h];
- ur(g >> 4, r, o);
- }
- function Bi(r, o) {
- var h, g = 4;
- for (h = 0; 8 > h; ++h) g += r[o + h - 32];
- ur(g >> 3, r, o);
- }
- function Zs(r, o) {
- var h, g = 4;
- for (h = 0; 8 > h; ++h) g += r[o - 1 + 32 * h];
- ur(g >> 3, r, o);
- }
- function ca(r, o) {
- ur(128, r, o);
- }
- function Rr(r, o, h) {
- var g = r[o - h], b = r[o + 0], w = 3 * (b - g) + to[1020 + r[o - 2 * h] - r[o + h]], y = Qa[112 + (w + 4 >> 3)];
- r[o - h] = Fn[255 + g + Qa[112 + (w + 3 >> 3)]], r[o + 0] = Fn[255 + b - y];
- }
- function da(r, o, h, g) {
- var b = r[o + 0], w = r[o + h];
- return Hn[255 + r[o - 2 * h] - r[o - h]] > g || Hn[255 + w - b] > g;
- }
- function ii(r, o, h, g) {
- return 4 * Hn[255 + r[o - h] - r[o + 0]] + Hn[255 + r[o - 2 * h] - r[o + h]] <= g;
- }
- function pa(r, o, h, g, b) {
- var w = r[o - 3 * h], y = r[o - 2 * h], A = r[o - h], L = r[o + 0], F = r[o + h], W = r[o + 2 * h], et = r[o + 3 * h];
- return 4 * Hn[255 + A - L] + Hn[255 + y - F] > g ? 0 : Hn[255 + r[o - 4 * h] - w] <= b && Hn[255 + w - y] <= b && Hn[255 + y - A] <= b && Hn[255 + et - W] <= b && Hn[255 + W - F] <= b && Hn[255 + F - L] <= b;
- }
- function Mi(r, o, h, g) {
- var b = 2 * g + 1;
- for (g = 0; 16 > g; ++g) ii(r, o + g, h, b) && Rr(r, o + g, h);
- }
- function ga(r, o, h, g) {
- var b = 2 * g + 1;
- for (g = 0; 16 > g; ++g) ii(r, o + g * h, 1, b) && Rr(r, o + g * h, 1);
- }
- function Ri(r, o, h, g) {
- var b;
- for (b = 3; 0 < b; --b) Mi(r, o += 4 * h, h, g);
- }
- function Va(r, o, h, g) {
- var b;
- for (b = 3; 0 < b; --b) ga(r, o += 4, h, g);
- }
- function Nr(r, o, h, g, b, w, y, A) {
- for (w = 2 * w + 1; 0 < b--; ) {
- if (pa(r, o, h, w, y)) if (da(r, o, h, A)) Rr(r, o, h);
- else {
- var L = r, F = o, W = h, et = L[F - 2 * W], C = L[F - W], Y = L[F + 0], $ = L[F + W], ut = L[F + 2 * W], Q = 27 * (pt = to[1020 + 3 * (Y - C) + to[1020 + et - $]]) + 63 >> 7, ft = 18 * pt + 63 >> 7, pt = 9 * pt + 63 >> 7;
- L[F - 3 * W] = Fn[255 + L[F - 3 * W] + pt], L[F - 2 * W] = Fn[255 + et + ft], L[F - W] = Fn[255 + C + Q], L[F + 0] = Fn[255 + Y - Q], L[F + W] = Fn[255 + $ - ft], L[F + 2 * W] = Fn[255 + ut - pt];
- }
- o += g;
- }
- }
- function Lr(r, o, h, g, b, w, y, A) {
- for (w = 2 * w + 1; 0 < b--; ) {
- if (pa(r, o, h, w, y)) if (da(r, o, h, A)) Rr(r, o, h);
- else {
- var L = r, F = o, W = h, et = L[F - W], C = L[F + 0], Y = L[F + W], $ = Qa[112 + (4 + (ut = 3 * (C - et)) >> 3)], ut = Qa[112 + (ut + 3 >> 3)], Q = $ + 1 >> 1;
- L[F - 2 * W] = Fn[255 + L[F - 2 * W] + Q], L[F - W] = Fn[255 + et + ut], L[F + 0] = Fn[255 + C - $], L[F + W] = Fn[255 + Y - Q];
- }
- o += g;
- }
- }
- function Ga(r, o, h, g, b, w) {
- Nr(r, o, h, 1, 16, g, b, w);
- }
- function Ya(r, o, h, g, b, w) {
- Nr(r, o, 1, h, 16, g, b, w);
- }
- function Ja(r, o, h, g, b, w) {
- var y;
- for (y = 3; 0 < y; --y) Lr(r, o += 4 * h, h, 1, 16, g, b, w);
- }
- function ai(r, o, h, g, b, w) {
- var y;
- for (y = 3; 0 < y; --y) Lr(r, o += 4, 1, h, 16, g, b, w);
- }
- function Ka(r, o, h, g, b, w, y, A) {
- Nr(r, o, b, 1, 8, w, y, A), Nr(h, g, b, 1, 8, w, y, A);
- }
- function u(r, o, h, g, b, w, y, A) {
- Nr(r, o, 1, b, 8, w, y, A), Nr(h, g, 1, b, 8, w, y, A);
- }
- function v(r, o, h, g, b, w, y, A) {
- Lr(r, o + 4 * b, b, 1, 8, w, y, A), Lr(h, g + 4 * b, b, 1, 8, w, y, A);
- }
- function I(r, o, h, g, b, w, y, A) {
- Lr(r, o + 4, 1, b, 8, w, y, A), Lr(h, g + 4, 1, b, 8, w, y, A);
- }
- function D() {
- this.ba = new le(), this.ec = [], this.cc = [], this.Mc = [], this.Dc = this.Nc = this.dc = this.fc = 0, this.Oa = new be(), this.memory = 0, this.Ib = "OutputFunc", this.Jb = "OutputAlphaFunc", this.Nd = "OutputRowFunc";
- }
- function K() {
- this.data = [], this.offset = this.kd = this.ha = this.w = 0, this.na = [], this.xa = this.gb = this.Ja = this.Sa = this.P = 0;
- }
- function lt() {
- this.nc = this.Ea = this.b = this.hc = 0, this.K = [], this.w = 0;
- }
- function mt() {
- this.ua = 0, this.Wa = new ae(), this.vb = new ae(), this.md = this.xc = this.wc = 0, this.vc = [], this.Wb = 0, this.Ya = new rt(), this.yc = new z();
- }
- function Et() {
- this.xb = this.a = 0, this.l = new Ii(), this.ca = new le(), this.V = [], this.Ba = 0, this.Ta = [], this.Ua = 0, this.m = new B(), this.Pb = 0, this.wd = new B(), this.Ma = this.$ = this.C = this.i = this.c = this.xd = 0, this.s = new mt(), this.ab = 0, this.gc = c(4, lt), this.Oc = 0;
- }
- function Ct() {
- this.Lc = this.Z = this.$a = this.i = this.c = 0, this.l = new Ii(), this.ic = 0, this.ca = [], this.tb = 0, this.qd = null, this.rd = 0;
- }
- function Xt(r, o, h, g, b, w, y) {
- for (r = r == null ? 0 : r[o + 0], o = 0; o < y; ++o) b[w + o] = r + h[g + o] & 255, r = b[w + o];
- }
- function te(r, o, h, g, b, w, y) {
- var A;
- if (r == null) Xt(null, null, h, g, b, w, y);
- else for (A = 0; A < y; ++A) b[w + A] = r[o + A] + h[g + A] & 255;
- }
- function de(r, o, h, g, b, w, y) {
- if (r == null) Xt(null, null, h, g, b, w, y);
- else {
- var A, L = r[o + 0], F = L, W = L;
- for (A = 0; A < y; ++A) F = W + (L = r[o + A]) - F, W = h[g + A] + (-256 & F ? 0 > F ? 0 : 255 : F) & 255, F = L, b[w + A] = W;
- }
- }
- function $e(r, o, h, g) {
- var b = o.width, w = o.o;
- if (e(r != null && o != null), 0 > h || 0 >= g || h + g > w) return null;
- if (!r.Cc) {
- if (r.ga == null) {
- var y;
- if (r.ga = new Ct(), (y = r.ga == null) || (y = o.width * o.o, e(r.Gb.length == 0), r.Gb = a(y), r.Uc = 0, r.Gb == null ? y = 0 : (r.mb = r.Gb, r.nb = r.Uc, r.rc = null, y = 1), y = !y), !y) {
- y = r.ga;
- var A = r.Fa, L = r.P, F = r.qc, W = r.mb, et = r.nb, C = L + 1, Y = F - 1, $ = y.l;
- if (e(A != null && W != null && o != null), Wr[0] = null, Wr[1] = Xt, Wr[2] = te, Wr[3] = de, y.ca = W, y.tb = et, y.c = o.width, y.i = o.height, e(0 < y.c && 0 < y.i), 1 >= F) o = 0;
- else if (y.$a = 3 & A[L + 0], y.Z = A[L + 0] >> 2 & 3, y.Lc = A[L + 0] >> 4 & 3, L = A[L + 0] >> 6 & 3, 0 > y.$a || 1 < y.$a || 4 <= y.Z || 1 < y.Lc || L) o = 0;
- else if ($.put = Gt, $.ac = rr, $.bc = wr, $.ma = y, $.width = o.width, $.height = o.height, $.Da = o.Da, $.v = o.v, $.va = o.va, $.j = o.j, $.o = o.o, y.$a) t: {
- e(y.$a == 1), o = ei();
- e: for (; ; ) {
- if (o == null) {
- o = 0;
- break t;
- }
- if (e(y != null), y.mc = o, o.c = y.c, o.i = y.i, o.l = y.l, o.l.ma = y, o.l.width = y.c, o.l.height = y.i, o.a = 0, ct(o.m, A, C, Y), !ar(y.c, y.i, 1, o, null) || (o.ab == 1 && o.gc[0].hc == 3 && Gn(o.s) ? (y.ic = 1, A = o.c * o.i, o.Ta = null, o.Ua = 0, o.V = a(A), o.Ba = 0, o.V == null ? (o.a = 1, o = 0) : o = 1) : (y.ic = 0, o = ni(o, y.c)), !o)) break e;
- o = 1;
- break t;
- }
- y.mc = null, o = 0;
- }
- else o = Y >= y.c * y.i;
- y = !o;
- }
- if (y) return null;
- r.ga.Lc != 1 ? r.Ga = 0 : g = w - h;
- }
- e(r.ga != null), e(h + g <= w);
- t: {
- if (o = (A = r.ga).c, w = A.l.o, A.$a == 0) {
- if (C = r.rc, Y = r.Vc, $ = r.Fa, L = r.P + 1 + h * o, F = r.mb, W = r.nb + h * o, e(L <= r.P + r.qc), A.Z != 0) for (e(Wr[A.Z] != null), y = 0; y < g; ++y) Wr[A.Z](C, Y, $, L, F, W, o), C = F, Y = W, W += o, L += o;
- else for (y = 0; y < g; ++y) i(F, W, $, L, o), C = F, Y = W, W += o, L += o;
- r.rc = C, r.Vc = Y;
- } else {
- if (e(A.mc != null), o = h + g, e((y = A.mc) != null), e(o <= y.i), y.C >= o) o = 1;
- else if (A.ic || Te(), A.ic) {
- A = y.V, C = y.Ba, Y = y.c;
- var ut = y.i, Q = ($ = 1, L = y.$ / Y, F = y.$ % Y, W = y.m, et = y.s, y.$), ft = Y * ut, pt = Y * o, xt = et.wc, bt = Q < pt ? sn(et, F, L) : null;
- e(Q <= ft), e(o <= ut), e(Gn(et));
- e: for (; ; ) {
- for (; !W.h && Q < pt; ) {
- if (F & xt || (bt = sn(et, F, L)), e(bt != null), Z(W), 256 > (ut = De(bt.G[0], bt.H[0], W))) A[C + Q] = ut, ++Q, ++F >= Y && (F = 0, ++L <= o && !(L % 16) && Yn(y, L));
- else {
- if (!(280 > ut)) {
- $ = 0;
- break e;
- }
- ut = Tn(ut - 256, W);
- var Mt, Pt = De(bt.G[4], bt.H[4], W);
- if (Z(W), !(Q >= (Pt = Dn(Y, Pt = Tn(Pt, W))) && ft - Q >= ut)) {
- $ = 0;
- break e;
- }
- for (Mt = 0; Mt < ut; ++Mt) A[C + Q + Mt] = A[C + Q + Mt - Pt];
- for (Q += ut, F += ut; F >= Y; ) F -= Y, ++L <= o && !(L % 16) && Yn(y, L);
- Q < pt && F & xt && (bt = sn(et, F, L));
- }
- e(W.h == H(W));
- }
- Yn(y, L > o ? o : L);
- break e;
- }
- !$ || W.h && Q < ft ? ($ = 0, y.a = W.h ? 5 : 3) : y.$ = Q, o = $;
- } else o = Jn(y, y.V, y.Ba, y.c, y.i, o, Si);
- if (!o) {
- g = 0;
- break t;
- }
- }
- h + g >= w && (r.Cc = 1), g = 1;
- }
- if (!g) return null;
- if (r.Cc && ((g = r.ga) != null && (g.mc = null), r.ga = null, 0 < r.Ga)) return alert("todo:WebPDequantizeLevels"), null;
- }
- return r.nb + h * b;
- }
- function Ae(r, o, h, g, b, w) {
- for (; 0 < b--; ) {
- var y, A = r, L = o + (h ? 1 : 0), F = r, W = o + (h ? 0 : 3);
- for (y = 0; y < g; ++y) {
- var et = F[W + 4 * y];
- et != 255 && (et *= 32897, A[L + 4 * y + 0] = A[L + 4 * y + 0] * et >> 23, A[L + 4 * y + 1] = A[L + 4 * y + 1] * et >> 23, A[L + 4 * y + 2] = A[L + 4 * y + 2] * et >> 23);
- }
- o += w;
- }
- }
- function _e(r, o, h, g, b) {
- for (; 0 < g--; ) {
- var w;
- for (w = 0; w < h; ++w) {
- var y = r[o + 2 * w + 0], A = 15 & (F = r[o + 2 * w + 1]), L = 4369 * A, F = (240 & F | F >> 4) * L >> 16;
- r[o + 2 * w + 0] = (240 & y | y >> 4) * L >> 16 & 240 | (15 & y | y << 4) * L >> 16 >> 4 & 15, r[o + 2 * w + 1] = 240 & F | A;
- }
- o += b;
- }
- }
- function Ce(r, o, h, g, b, w, y, A) {
- var L, F, W = 255;
- for (F = 0; F < b; ++F) {
- for (L = 0; L < g; ++L) {
- var et = r[o + L];
- w[y + 4 * L] = et, W &= et;
- }
- o += h, y += A;
- }
- return W != 255;
- }
- function Re(r, o, h, g, b) {
- var w;
- for (w = 0; w < b; ++w) h[g + w] = r[o + w] >> 8;
- }
- function Te() {
- Aa = Ae, il = _e, al = Ce, sl = Re;
- }
- function cn(r, o, h) {
- R[r] = function(g, b, w, y, A, L, F, W, et, C, Y, $, ut, Q, ft, pt, xt) {
- var bt, Mt = xt - 1 >> 1, Pt = A[L + 0] | F[W + 0] << 16, re = et[C + 0] | Y[$ + 0] << 16;
- e(g != null);
- var Ot = 3 * Pt + re + 131074 >> 2;
- for (o(g[b + 0], 255 & Ot, Ot >> 16, ut, Q), w != null && (Ot = 3 * re + Pt + 131074 >> 2, o(w[y + 0], 255 & Ot, Ot >> 16, ft, pt)), bt = 1; bt <= Mt; ++bt) {
- var ce = A[L + bt] | F[W + bt] << 16, tn = et[C + bt] | Y[$ + bt] << 16, ie = Pt + ce + re + tn + 524296, jt = ie + 2 * (ce + re) >> 3;
- Ot = jt + Pt >> 1, Pt = (ie = ie + 2 * (Pt + tn) >> 3) + ce >> 1, o(g[b + 2 * bt - 1], 255 & Ot, Ot >> 16, ut, Q + (2 * bt - 1) * h), o(g[b + 2 * bt - 0], 255 & Pt, Pt >> 16, ut, Q + (2 * bt - 0) * h), w != null && (Ot = ie + re >> 1, Pt = jt + tn >> 1, o(w[y + 2 * bt - 1], 255 & Ot, Ot >> 16, ft, pt + (2 * bt - 1) * h), o(w[y + 2 * bt + 0], 255 & Pt, Pt >> 16, ft, pt + (2 * bt + 0) * h)), Pt = ce, re = tn;
- }
- 1 & xt || (Ot = 3 * Pt + re + 131074 >> 2, o(g[b + xt - 1], 255 & Ot, Ot >> 16, ut, Q + (xt - 1) * h), w != null && (Ot = 3 * re + Pt + 131074 >> 2, o(w[y + xt - 1], 255 & Ot, Ot >> 16, ft, pt + (xt - 1) * h)));
- };
- }
- function Sr() {
- Wn[ts] = tf, Wn[es] = vl, Wn[cl] = ef, Wn[ns] = bl, Wn[rs] = wl, Wn[eo] = yl, Wn[dl] = nf, Wn[no] = vl, Wn[ro] = bl, Wn[is] = wl, Wn[io] = yl;
- }
- function ma(r) {
- return r & -16384 ? 0 > r ? 0 : 255 : r >> rf;
- }
- function si(r, o) {
- return ma((19077 * r >> 8) + (26149 * o >> 8) - 14234);
- }
- function oi(r, o, h) {
- return ma((19077 * r >> 8) - (6419 * o >> 8) - (13320 * h >> 8) + 8708);
- }
- function Tr(r, o) {
- return ma((19077 * r >> 8) + (33050 * o >> 8) - 17685);
- }
- function li(r, o, h, g, b) {
- g[b + 0] = si(r, h), g[b + 1] = oi(r, o, h), g[b + 2] = Tr(r, o);
- }
- function Ti(r, o, h, g, b) {
- g[b + 0] = Tr(r, o), g[b + 1] = oi(r, o, h), g[b + 2] = si(r, h);
- }
- function Di(r, o, h, g, b) {
- var w = oi(r, o, h);
- o = w << 3 & 224 | Tr(r, o) >> 3, g[b + 0] = 248 & si(r, h) | w >> 5, g[b + 1] = o;
- }
- function dn(r, o, h, g, b) {
- var w = 240 & Tr(r, o) | 15;
- g[b + 0] = 240 & si(r, h) | oi(r, o, h) >> 4, g[b + 1] = w;
- }
- function ui(r, o, h, g, b) {
- g[b + 0] = 255, li(r, o, h, g, b + 1);
- }
- function hi(r, o, h, g, b) {
- Ti(r, o, h, g, b), g[b + 3] = 255;
- }
- function va(r, o, h, g, b) {
- li(r, o, h, g, b), g[b + 3] = 255;
- }
- function hr(r, o, h) {
- R[r] = function(g, b, w, y, A, L, F, W, et) {
- for (var C = W + (-2 & et) * h; W != C; ) o(g[b + 0], w[y + 0], A[L + 0], F, W), o(g[b + 1], w[y + 0], A[L + 0], F, W + h), b += 2, ++y, ++L, W += 2 * h;
- 1 & et && o(g[b + 0], w[y + 0], A[L + 0], F, W);
- };
- }
- function yn(r, o, h) {
- return h == 0 ? r == 0 ? o == 0 ? 6 : 5 : o == 0 ? 4 : 0 : h;
- }
- function Xa(r, o, h, g, b) {
- switch (r >>> 30) {
- case 3:
- kr(o, h, g, b, 0);
- break;
- case 2:
- zr(o, h, g, b);
- break;
- case 1:
- pn(o, h, g, b);
- }
- }
- function qi(r, o) {
- var h, g, b = o.M, w = o.Nb, y = r.oc, A = r.pc + 40, L = r.oc, F = r.pc + 584, W = r.oc, et = r.pc + 600;
- for (h = 0; 16 > h; ++h) y[A + 32 * h - 1] = 129;
- for (h = 0; 8 > h; ++h) L[F + 32 * h - 1] = 129, W[et + 32 * h - 1] = 129;
- for (0 < b ? y[A - 1 - 32] = L[F - 1 - 32] = W[et - 1 - 32] = 129 : (s(y, A - 32 - 1, 127, 21), s(L, F - 32 - 1, 127, 9), s(W, et - 32 - 1, 127, 9)), g = 0; g < r.za; ++g) {
- var C = o.ya[o.aa + g];
- if (0 < g) {
- for (h = -1; 16 > h; ++h) i(y, A + 32 * h - 4, y, A + 32 * h + 12, 4);
- for (h = -1; 8 > h; ++h) i(L, F + 32 * h - 4, L, F + 32 * h + 4, 4), i(W, et + 32 * h - 4, W, et + 32 * h + 4, 4);
- }
- var Y = r.Gd, $ = r.Hd + g, ut = C.ad, Q = C.Hc;
- if (0 < b && (i(y, A - 32, Y[$].y, 0, 16), i(L, F - 32, Y[$].f, 0, 8), i(W, et - 32, Y[$].ea, 0, 8)), C.Za) {
- var ft = y, pt = A - 32 + 16;
- for (0 < b && (g >= r.za - 1 ? s(ft, pt, Y[$].y[15], 4) : i(ft, pt, Y[$ + 1].y, 0, 4)), h = 0; 4 > h; h++) ft[pt + 128 + h] = ft[pt + 256 + h] = ft[pt + 384 + h] = ft[pt + 0 + h];
- for (h = 0; 16 > h; ++h, Q <<= 2) ft = y, pt = A + _l[h], Xn[C.Ob[h]](ft, pt), Xa(Q, ut, 16 * +h, ft, pt);
- } else if (ft = yn(g, b, C.Ob[0]), Hr[ft](y, A), Q != 0) for (h = 0; 16 > h; ++h, Q <<= 2) Xa(Q, ut, 16 * +h, y, A + _l[h]);
- for (h = C.Gc, ft = yn(g, b, C.Dd), Ir[ft](L, F), Ir[ft](W, et), Q = ut, ft = L, pt = F, 255 & (C = 0 | h) && (170 & C ? Vi(Q, 256, ft, pt) : cr(Q, 256, ft, pt)), C = W, Q = et, 255 & (h >>= 8) && (170 & h ? Vi(ut, 320, C, Q) : cr(ut, 320, C, Q)), b < r.Ub - 1 && (i(Y[$].y, 0, y, A + 480, 16), i(Y[$].f, 0, L, F + 224, 8), i(Y[$].ea, 0, W, et + 224, 8)), h = 8 * w * r.B, Y = r.sa, $ = r.ta + 16 * g + 16 * w * r.R, ut = r.qa, C = r.ra + 8 * g + h, Q = r.Ha, ft = r.Ia + 8 * g + h, h = 0; 16 > h; ++h) i(Y, $ + h * r.R, y, A + 32 * h, 16);
- for (h = 0; 8 > h; ++h) i(ut, C + h * r.B, L, F + 32 * h, 8), i(Q, ft + h * r.B, W, et + 32 * h, 8);
- }
- }
- function $a(r, o, h, g, b, w, y, A, L) {
- var F = [0], W = [0], et = 0, C = L != null ? L.kd : 0, Y = L != null ? L : new K();
- if (r == null || 12 > h) return 7;
- Y.data = r, Y.w = o, Y.ha = h, o = [o], h = [h], Y.gb = [Y.gb];
- t: {
- var $ = o, ut = h, Q = Y.gb;
- if (e(r != null), e(ut != null), e(Q != null), Q[0] = 0, 12 <= ut[0] && !t(r, $[0], "RIFF")) {
- if (t(r, $[0] + 8, "WEBP")) {
- Q = 3;
- break t;
- }
- var ft = Dt(r, $[0] + 4);
- if (12 > ft || 4294967286 < ft) {
- Q = 3;
- break t;
- }
- if (C && ft > ut[0] - 8) {
- Q = 7;
- break t;
- }
- Q[0] = ft, $[0] += 12, ut[0] -= 12;
- }
- Q = 0;
- }
- if (Q != 0) return Q;
- for (ft = 0 < Y.gb[0], h = h[0]; ; ) {
- t: {
- var pt = r;
- ut = o, Q = h;
- var xt = F, bt = W, Mt = $ = [0];
- if ((Ot = et = [et])[0] = 0, 8 > Q[0]) Q = 7;
- else {
- if (!t(pt, ut[0], "VP8X")) {
- if (Dt(pt, ut[0] + 4) != 10) {
- Q = 3;
- break t;
- }
- if (18 > Q[0]) {
- Q = 7;
- break t;
- }
- var Pt = Dt(pt, ut[0] + 8), re = 1 + St(pt, ut[0] + 12);
- if (2147483648 <= re * (pt = 1 + St(pt, ut[0] + 15))) {
- Q = 3;
- break t;
- }
- Mt != null && (Mt[0] = Pt), xt != null && (xt[0] = re), bt != null && (bt[0] = pt), ut[0] += 18, Q[0] -= 18, Ot[0] = 1;
- }
- Q = 0;
- }
- }
- if (et = et[0], $ = $[0], Q != 0) return Q;
- if (ut = !!(2 & $), !ft && et) return 3;
- if (w != null && (w[0] = !!(16 & $)), y != null && (y[0] = ut), A != null && (A[0] = 0), y = F[0], $ = W[0], et && ut && L == null) {
- Q = 0;
- break;
- }
- if (4 > h) {
- Q = 7;
- break;
- }
- if (ft && et || !ft && !et && !t(r, o[0], "ALPH")) {
- h = [h], Y.na = [Y.na], Y.P = [Y.P], Y.Sa = [Y.Sa];
- t: {
- Pt = r, Q = o, ft = h;
- var Ot = Y.gb;
- xt = Y.na, bt = Y.P, Mt = Y.Sa, re = 22, e(Pt != null), e(ft != null), pt = Q[0];
- var ce = ft[0];
- for (e(xt != null), e(Mt != null), xt[0] = null, bt[0] = null, Mt[0] = 0; ; ) {
- if (Q[0] = pt, ft[0] = ce, 8 > ce) {
- Q = 7;
- break t;
- }
- var tn = Dt(Pt, pt + 4);
- if (4294967286 < tn) {
- Q = 3;
- break t;
- }
- var ie = 8 + tn + 1 & -2;
- if (re += ie, 0 < Ot && re > Ot) {
- Q = 3;
- break t;
- }
- if (!t(Pt, pt, "VP8 ") || !t(Pt, pt, "VP8L")) {
- Q = 0;
- break t;
- }
- if (ce[0] < ie) {
- Q = 7;
- break t;
- }
- t(Pt, pt, "ALPH") || (xt[0] = Pt, bt[0] = pt + 8, Mt[0] = tn), pt += ie, ce -= ie;
- }
- }
- if (h = h[0], Y.na = Y.na[0], Y.P = Y.P[0], Y.Sa = Y.Sa[0], Q != 0) break;
- }
- h = [h], Y.Ja = [Y.Ja], Y.xa = [Y.xa];
- t: if (Ot = r, Q = o, ft = h, xt = Y.gb[0], bt = Y.Ja, Mt = Y.xa, Pt = Q[0], pt = !t(Ot, Pt, "VP8 "), re = !t(Ot, Pt, "VP8L"), e(Ot != null), e(ft != null), e(bt != null), e(Mt != null), 8 > ft[0]) Q = 7;
- else {
- if (pt || re) {
- if (Ot = Dt(Ot, Pt + 4), 12 <= xt && Ot > xt - 12) {
- Q = 3;
- break t;
- }
- if (C && Ot > ft[0] - 8) {
- Q = 7;
- break t;
- }
- bt[0] = Ot, Q[0] += 8, ft[0] -= 8, Mt[0] = re;
- } else Mt[0] = 5 <= ft[0] && Ot[Pt + 0] == 47 && !(Ot[Pt + 4] >> 5), bt[0] = ft[0];
- Q = 0;
- }
- if (h = h[0], Y.Ja = Y.Ja[0], Y.xa = Y.xa[0], o = o[0], Q != 0) break;
- if (4294967286 < Y.Ja) return 3;
- if (A == null || ut || (A[0] = Y.xa ? 2 : 1), y = [y], $ = [$], Y.xa) {
- if (5 > h) {
- Q = 7;
- break;
- }
- A = y, C = $, ut = w, r == null || 5 > h ? r = 0 : 5 <= h && r[o + 0] == 47 && !(r[o + 4] >> 5) ? (ft = [0], Ot = [0], xt = [0], ct(bt = new B(), r, o, h), yr(bt, ft, Ot, xt) ? (A != null && (A[0] = ft[0]), C != null && (C[0] = Ot[0]), ut != null && (ut[0] = xt[0]), r = 1) : r = 0) : r = 0;
- } else {
- if (10 > h) {
- Q = 7;
- break;
- }
- A = $, r == null || 10 > h || !Ua(r, o + 3, h - 3) ? r = 0 : (C = r[o + 0] | r[o + 1] << 8 | r[o + 2] << 16, ut = 16383 & (r[o + 7] << 8 | r[o + 6]), r = 16383 & (r[o + 9] << 8 | r[o + 8]), 1 & C || 3 < (C >> 1 & 7) || !(C >> 4 & 1) || C >> 5 >= Y.Ja || !ut || !r ? r = 0 : (y && (y[0] = ut), A && (A[0] = r), r = 1));
- }
- if (!r || (y = y[0], $ = $[0], et && (F[0] != y || W[0] != $))) return 3;
- L != null && (L[0] = Y, L.offset = o - L.w, e(4294967286 > o - L.w), e(L.offset == L.ha - h));
- break;
- }
- return Q == 0 || Q == 7 && et && L == null ? (w != null && (w[0] |= Y.na != null && 0 < Y.na.length), g != null && (g[0] = y), b != null && (b[0] = $), 0) : Q;
- }
- function zn(r, o, h) {
- var g = o.width, b = o.height, w = 0, y = 0, A = g, L = b;
- if (o.Da = r != null && 0 < r.Da, o.Da && (A = r.cd, L = r.bd, w = r.v, y = r.j, 11 > h || (w &= -2, y &= -2), 0 > w || 0 > y || 0 >= A || 0 >= L || w + A > g || y + L > b)) return 0;
- if (o.v = w, o.j = y, o.va = w + A, o.o = y + L, o.U = A, o.T = L, o.da = r != null && 0 < r.da, o.da) {
- if (!Ht(A, L, h = [r.ib], w = [r.hb])) return 0;
- o.ib = h[0], o.hb = w[0];
- }
- return o.ob = r != null && r.ob, o.Kb = r == null || !r.Sd, o.da && (o.ob = o.ib < 3 * g / 4 && o.hb < 3 * b / 4, o.Kb = 0), 1;
- }
- function fi(r) {
- if (r == null) return 2;
- if (11 > r.S) {
- var o = r.f.RGBA;
- o.fb += (r.height - 1) * o.A, o.A = -o.A;
- } else o = r.f.kb, r = r.height, o.O += (r - 1) * o.fa, o.fa = -o.fa, o.N += (r - 1 >> 1) * o.Ab, o.Ab = -o.Ab, o.W += (r - 1 >> 1) * o.Db, o.Db = -o.Db, o.F != null && (o.J += (r - 1) * o.lb, o.lb = -o.lb);
- return 0;
- }
- function ba(r, o, h, g) {
- if (g == null || 0 >= r || 0 >= o) return 2;
- if (h != null) {
- if (h.Da) {
- var b = h.cd, w = h.bd, y = -2 & h.v, A = -2 & h.j;
- if (0 > y || 0 > A || 0 >= b || 0 >= w || y + b > r || A + w > o) return 2;
- r = b, o = w;
- }
- if (h.da) {
- if (!Ht(r, o, b = [h.ib], w = [h.hb])) return 2;
- r = b[0], o = w[0];
- }
- }
- g.width = r, g.height = o;
- t: {
- var L = g.width, F = g.height;
- if (r = g.S, 0 >= L || 0 >= F || !(r >= ts && 13 > r)) r = 2;
- else {
- if (0 >= g.Rd && g.sd == null) {
- y = w = b = o = 0;
- var W = (A = L * Al[r]) * F;
- if (11 > r || (w = (F + 1) / 2 * (o = (L + 1) / 2), r == 12 && (y = (b = L) * F)), (F = a(W + 2 * w + y)) == null) {
- r = 1;
- break t;
- }
- g.sd = F, 11 > r ? ((L = g.f.RGBA).eb = F, L.fb = 0, L.A = A, L.size = W) : ((L = g.f.kb).y = F, L.O = 0, L.fa = A, L.Fd = W, L.f = F, L.N = 0 + W, L.Ab = o, L.Cd = w, L.ea = F, L.W = 0 + W + w, L.Db = o, L.Ed = w, r == 12 && (L.F = F, L.J = 0 + W + 2 * w), L.Tc = y, L.lb = b);
- }
- if (o = 1, b = g.S, w = g.width, y = g.height, b >= ts && 13 > b) if (11 > b) r = g.f.RGBA, o &= (A = Math.abs(r.A)) * (y - 1) + w <= r.size, o &= A >= w * Al[b], o &= r.eb != null;
- else {
- r = g.f.kb, A = (w + 1) / 2, W = (y + 1) / 2, L = Math.abs(r.fa), F = Math.abs(r.Ab);
- var et = Math.abs(r.Db), C = Math.abs(r.lb), Y = C * (y - 1) + w;
- o &= L * (y - 1) + w <= r.Fd, o &= F * (W - 1) + A <= r.Cd, o = (o &= et * (W - 1) + A <= r.Ed) & L >= w & F >= A & et >= A, o &= r.y != null, o &= r.f != null, o &= r.ea != null, b == 12 && (o &= C >= w, o &= Y <= r.Tc, o &= r.F != null);
- }
- else o = 0;
- r = o ? 0 : 2;
- }
- }
- return r != 0 || h != null && h.fd && (r = fi(g)), r;
- }
- var Ui = 64, ci = [0, 1, 3, 7, 15, 31, 63, 127, 255, 511, 1023, 2047, 4095, 8191, 16383, 32767, 65535, 131071, 262143, 524287, 1048575, 2097151, 4194303, 8388607, 16777215], wa = 24, xn = 32, Ln = 8, zi = [0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7];
- It("Predictor0", "PredictorAdd0"), R.Predictor0 = function() {
- return 4278190080;
- }, R.Predictor1 = function(r) {
- return r;
- }, R.Predictor2 = function(r, o, h) {
- return o[h + 0];
- }, R.Predictor3 = function(r, o, h) {
- return o[h + 1];
- }, R.Predictor4 = function(r, o, h) {
- return o[h - 1];
- }, R.Predictor5 = function(r, o, h) {
- return qt(qt(r, o[h + 1]), o[h + 0]);
- }, R.Predictor6 = function(r, o, h) {
- return qt(r, o[h - 1]);
- }, R.Predictor7 = function(r, o, h) {
- return qt(r, o[h + 0]);
- }, R.Predictor8 = function(r, o, h) {
- return qt(o[h - 1], o[h + 0]);
- }, R.Predictor9 = function(r, o, h) {
- return qt(o[h + 0], o[h + 1]);
- }, R.Predictor10 = function(r, o, h) {
- return qt(qt(r, o[h - 1]), qt(o[h + 0], o[h + 1]));
- }, R.Predictor11 = function(r, o, h) {
- var g = o[h + 0];
- return 0 >= Zt(g >> 24 & 255, r >> 24 & 255, (o = o[h - 1]) >> 24 & 255) + Zt(g >> 16 & 255, r >> 16 & 255, o >> 16 & 255) + Zt(g >> 8 & 255, r >> 8 & 255, o >> 8 & 255) + Zt(255 & g, 255 & r, 255 & o) ? g : r;
- }, R.Predictor12 = function(r, o, h) {
- var g = o[h + 0];
- return (ve((r >> 24 & 255) + (g >> 24 & 255) - ((o = o[h - 1]) >> 24 & 255)) << 24 | ve((r >> 16 & 255) + (g >> 16 & 255) - (o >> 16 & 255)) << 16 | ve((r >> 8 & 255) + (g >> 8 & 255) - (o >> 8 & 255)) << 8 | ve((255 & r) + (255 & g) - (255 & o))) >>> 0;
- }, R.Predictor13 = function(r, o, h) {
- var g = o[h - 1];
- return (ue((r = qt(r, o[h + 0])) >> 24 & 255, g >> 24 & 255) << 24 | ue(r >> 16 & 255, g >> 16 & 255) << 16 | ue(r >> 8 & 255, g >> 8 & 255) << 8 | ue(255 & r, 255 & g)) >>> 0;
- };
- var Dr = R.PredictorAdd0;
- R.PredictorAdd1 = fe, It("Predictor2", "PredictorAdd2"), It("Predictor3", "PredictorAdd3"), It("Predictor4", "PredictorAdd4"), It("Predictor5", "PredictorAdd5"), It("Predictor6", "PredictorAdd6"), It("Predictor7", "PredictorAdd7"), It("Predictor8", "PredictorAdd8"), It("Predictor9", "PredictorAdd9"), It("Predictor10", "PredictorAdd10"), It("Predictor11", "PredictorAdd11"), It("Predictor12", "PredictorAdd12"), It("Predictor13", "PredictorAdd13");
- var qr = R.PredictorAdd2;
- Rt("ColorIndexInverseTransform", "MapARGB", "32b", function(r) {
- return r >> 8 & 255;
- }, function(r) {
- return r;
- }), Rt("VP8LColorIndexInverseTransformAlpha", "MapAlpha", "8b", function(r) {
- return r;
- }, function(r) {
- return r >> 8 & 255;
- });
- var Hi, di = R.ColorIndexInverseTransform, Ze = R.MapARGB, Qs = R.VP8LColorIndexInverseTransformAlpha, fr = R.MapAlpha, Kn = R.VP8LPredictorsAdd = [];
- Kn.length = 16, (R.VP8LPredictors = []).length = 16, (R.VP8LPredictorsAdd_C = []).length = 16, (R.VP8LPredictors_C = []).length = 16;
- var pi, ya, xa, Wi, gi, mi, Ur, kr, zr, Vi, pn, cr, Pe, Ie, We, Qe, Pr, _a, Gi, Za, tl, el, nl, rl, Aa, il, al, sl, ol = a(511), ll = a(2041), ul = a(225), hl = a(767), fl = 0, to = ll, Qa = ul, Fn = hl, Hn = ol, ts = 0, es = 1, cl = 2, ns = 3, rs = 4, eo = 5, dl = 6, no = 7, ro = 8, is = 9, io = 10, qh = [2, 3, 7], Uh = [3, 3, 11], pl = [280, 256, 256, 256, 40], zh = [0, 1, 1, 1, 0], Hh = [17, 18, 0, 1, 2, 3, 4, 5, 16, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], Wh = [24, 7, 23, 25, 40, 6, 39, 41, 22, 26, 38, 42, 56, 5, 55, 57, 21, 27, 54, 58, 37, 43, 72, 4, 71, 73, 20, 28, 53, 59, 70, 74, 36, 44, 88, 69, 75, 52, 60, 3, 87, 89, 19, 29, 86, 90, 35, 45, 68, 76, 85, 91, 51, 61, 104, 2, 103, 105, 18, 30, 102, 106, 34, 46, 84, 92, 67, 77, 101, 107, 50, 62, 120, 1, 119, 121, 83, 93, 17, 31, 100, 108, 66, 78, 118, 122, 33, 47, 117, 123, 49, 63, 99, 109, 82, 94, 0, 116, 124, 65, 79, 16, 32, 98, 110, 48, 115, 125, 81, 95, 64, 114, 126, 97, 111, 80, 113, 127, 96, 112], Vh = [2954, 2956, 2958, 2962, 2970, 2986, 3018, 3082, 3212, 3468, 3980, 5004], Gh = 8, ao = [4, 5, 6, 7, 8, 9, 10, 10, 11, 12, 13, 14, 15, 16, 17, 17, 18, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 25, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 91, 93, 95, 96, 98, 100, 101, 102, 104, 106, 108, 110, 112, 114, 116, 118, 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 143, 145, 148, 151, 154, 157], so = [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 119, 122, 125, 128, 131, 134, 137, 140, 143, 146, 149, 152, 155, 158, 161, 164, 167, 170, 173, 177, 181, 185, 189, 193, 197, 201, 205, 209, 213, 217, 221, 225, 229, 234, 239, 245, 249, 254, 259, 264, 269, 274, 279, 284], Na = null, Yh = [[173, 148, 140, 0], [176, 155, 140, 135, 0], [180, 157, 141, 134, 130, 0], [254, 254, 243, 230, 196, 177, 153, 140, 133, 130, 129, 0]], Jh = [0, 1, 4, 8, 5, 2, 3, 6, 9, 12, 13, 10, 7, 11, 14, 15], gl = [-0, 1, -1, 2, -2, 3, 4, 6, -3, 5, -4, -5, -6, 7, -7, 8, -8, -9], Kh = [[[[128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128], [128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128], [128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128]], [[253, 136, 254, 255, 228, 219, 128, 128, 128, 128, 128], [189, 129, 242, 255, 227, 213, 255, 219, 128, 128, 128], [106, 126, 227, 252, 214, 209, 255, 255, 128, 128, 128]], [[1, 98, 248, 255, 236, 226, 255, 255, 128, 128, 128], [181, 133, 238, 254, 221, 234, 255, 154, 128, 128, 128], [78, 134, 202, 247, 198, 180, 255, 219, 128, 128, 128]], [[1, 185, 249, 255, 243, 255, 128, 128, 128, 128, 128], [184, 150, 247, 255, 236, 224, 128, 128, 128, 128, 128], [77, 110, 216, 255, 236, 230, 128, 128, 128, 128, 128]], [[1, 101, 251, 255, 241, 255, 128, 128, 128, 128, 128], [170, 139, 241, 252, 236, 209, 255, 255, 128, 128, 128], [37, 116, 196, 243, 228, 255, 255, 255, 128, 128, 128]], [[1, 204, 254, 255, 245, 255, 128, 128, 128, 128, 128], [207, 160, 250, 255, 238, 128, 128, 128, 128, 128, 128], [102, 103, 231, 255, 211, 171, 128, 128, 128, 128, 128]], [[1, 152, 252, 255, 240, 255, 128, 128, 128, 128, 128], [177, 135, 243, 255, 234, 225, 128, 128, 128, 128, 128], [80, 129, 211, 255, 194, 224, 128, 128, 128, 128, 128]], [[1, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128], [246, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128], [255, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128]]], [[[198, 35, 237, 223, 193, 187, 162, 160, 145, 155, 62], [131, 45, 198, 221, 172, 176, 220, 157, 252, 221, 1], [68, 47, 146, 208, 149, 167, 221, 162, 255, 223, 128]], [[1, 149, 241, 255, 221, 224, 255, 255, 128, 128, 128], [184, 141, 234, 253, 222, 220, 255, 199, 128, 128, 128], [81, 99, 181, 242, 176, 190, 249, 202, 255, 255, 128]], [[1, 129, 232, 253, 214, 197, 242, 196, 255, 255, 128], [99, 121, 210, 250, 201, 198, 255, 202, 128, 128, 128], [23, 91, 163, 242, 170, 187, 247, 210, 255, 255, 128]], [[1, 200, 246, 255, 234, 255, 128, 128, 128, 128, 128], [109, 178, 241, 255, 231, 245, 255, 255, 128, 128, 128], [44, 130, 201, 253, 205, 192, 255, 255, 128, 128, 128]], [[1, 132, 239, 251, 219, 209, 255, 165, 128, 128, 128], [94, 136, 225, 251, 218, 190, 255, 255, 128, 128, 128], [22, 100, 174, 245, 186, 161, 255, 199, 128, 128, 128]], [[1, 182, 249, 255, 232, 235, 128, 128, 128, 128, 128], [124, 143, 241, 255, 227, 234, 128, 128, 128, 128, 128], [35, 77, 181, 251, 193, 211, 255, 205, 128, 128, 128]], [[1, 157, 247, 255, 236, 231, 255, 255, 128, 128, 128], [121, 141, 235, 255, 225, 227, 255, 255, 128, 128, 128], [45, 99, 188, 251, 195, 217, 255, 224, 128, 128, 128]], [[1, 1, 251, 255, 213, 255, 128, 128, 128, 128, 128], [203, 1, 248, 255, 255, 128, 128, 128, 128, 128, 128], [137, 1, 177, 255, 224, 255, 128, 128, 128, 128, 128]]], [[[253, 9, 248, 251, 207, 208, 255, 192, 128, 128, 128], [175, 13, 224, 243, 193, 185, 249, 198, 255, 255, 128], [73, 17, 171, 221, 161, 179, 236, 167, 255, 234, 128]], [[1, 95, 247, 253, 212, 183, 255, 255, 128, 128, 128], [239, 90, 244, 250, 211, 209, 255, 255, 128, 128, 128], [155, 77, 195, 248, 188, 195, 255, 255, 128, 128, 128]], [[1, 24, 239, 251, 218, 219, 255, 205, 128, 128, 128], [201, 51, 219, 255, 196, 186, 128, 128, 128, 128, 128], [69, 46, 190, 239, 201, 218, 255, 228, 128, 128, 128]], [[1, 191, 251, 255, 255, 128, 128, 128, 128, 128, 128], [223, 165, 249, 255, 213, 255, 128, 128, 128, 128, 128], [141, 124, 248, 255, 255, 128, 128, 128, 128, 128, 128]], [[1, 16, 248, 255, 255, 128, 128, 128, 128, 128, 128], [190, 36, 230, 255, 236, 255, 128, 128, 128, 128, 128], [149, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128]], [[1, 226, 255, 128, 128, 128, 128, 128, 128, 128, 128], [247, 192, 255, 128, 128, 128, 128, 128, 128, 128, 128], [240, 128, 255, 128, 128, 128, 128, 128, 128, 128, 128]], [[1, 134, 252, 255, 255, 128, 128, 128, 128, 128, 128], [213, 62, 250, 255, 255, 128, 128, 128, 128, 128, 128], [55, 93, 255, 128, 128, 128, 128, 128, 128, 128, 128]], [[128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128], [128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128], [128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128]]], [[[202, 24, 213, 235, 186, 191, 220, 160, 240, 175, 255], [126, 38, 182, 232, 169, 184, 228, 174, 255, 187, 128], [61, 46, 138, 219, 151, 178, 240, 170, 255, 216, 128]], [[1, 112, 230, 250, 199, 191, 247, 159, 255, 255, 128], [166, 109, 228, 252, 211, 215, 255, 174, 128, 128, 128], [39, 77, 162, 232, 172, 180, 245, 178, 255, 255, 128]], [[1, 52, 220, 246, 198, 199, 249, 220, 255, 255, 128], [124, 74, 191, 243, 183, 193, 250, 221, 255, 255, 128], [24, 71, 130, 219, 154, 170, 243, 182, 255, 255, 128]], [[1, 182, 225, 249, 219, 240, 255, 224, 128, 128, 128], [149, 150, 226, 252, 216, 205, 255, 171, 128, 128, 128], [28, 108, 170, 242, 183, 194, 254, 223, 255, 255, 128]], [[1, 81, 230, 252, 204, 203, 255, 192, 128, 128, 128], [123, 102, 209, 247, 188, 196, 255, 233, 128, 128, 128], [20, 95, 153, 243, 164, 173, 255, 203, 128, 128, 128]], [[1, 222, 248, 255, 216, 213, 128, 128, 128, 128, 128], [168, 175, 246, 252, 235, 205, 255, 255, 128, 128, 128], [47, 116, 215, 255, 211, 212, 255, 255, 128, 128, 128]], [[1, 121, 236, 253, 212, 214, 255, 255, 128, 128, 128], [141, 84, 213, 252, 201, 202, 255, 219, 128, 128, 128], [42, 80, 160, 240, 162, 185, 255, 205, 128, 128, 128]], [[1, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128], [244, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128], [238, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128]]]], Xh = [[[231, 120, 48, 89, 115, 113, 120, 152, 112], [152, 179, 64, 126, 170, 118, 46, 70, 95], [175, 69, 143, 80, 85, 82, 72, 155, 103], [56, 58, 10, 171, 218, 189, 17, 13, 152], [114, 26, 17, 163, 44, 195, 21, 10, 173], [121, 24, 80, 195, 26, 62, 44, 64, 85], [144, 71, 10, 38, 171, 213, 144, 34, 26], [170, 46, 55, 19, 136, 160, 33, 206, 71], [63, 20, 8, 114, 114, 208, 12, 9, 226], [81, 40, 11, 96, 182, 84, 29, 16, 36]], [[134, 183, 89, 137, 98, 101, 106, 165, 148], [72, 187, 100, 130, 157, 111, 32, 75, 80], [66, 102, 167, 99, 74, 62, 40, 234, 128], [41, 53, 9, 178, 241, 141, 26, 8, 107], [74, 43, 26, 146, 73, 166, 49, 23, 157], [65, 38, 105, 160, 51, 52, 31, 115, 128], [104, 79, 12, 27, 217, 255, 87, 17, 7], [87, 68, 71, 44, 114, 51, 15, 186, 23], [47, 41, 14, 110, 182, 183, 21, 17, 194], [66, 45, 25, 102, 197, 189, 23, 18, 22]], [[88, 88, 147, 150, 42, 46, 45, 196, 205], [43, 97, 183, 117, 85, 38, 35, 179, 61], [39, 53, 200, 87, 26, 21, 43, 232, 171], [56, 34, 51, 104, 114, 102, 29, 93, 77], [39, 28, 85, 171, 58, 165, 90, 98, 64], [34, 22, 116, 206, 23, 34, 43, 166, 73], [107, 54, 32, 26, 51, 1, 81, 43, 31], [68, 25, 106, 22, 64, 171, 36, 225, 114], [34, 19, 21, 102, 132, 188, 16, 76, 124], [62, 18, 78, 95, 85, 57, 50, 48, 51]], [[193, 101, 35, 159, 215, 111, 89, 46, 111], [60, 148, 31, 172, 219, 228, 21, 18, 111], [112, 113, 77, 85, 179, 255, 38, 120, 114], [40, 42, 1, 196, 245, 209, 10, 25, 109], [88, 43, 29, 140, 166, 213, 37, 43, 154], [61, 63, 30, 155, 67, 45, 68, 1, 209], [100, 80, 8, 43, 154, 1, 51, 26, 71], [142, 78, 78, 16, 255, 128, 34, 197, 171], [41, 40, 5, 102, 211, 183, 4, 1, 221], [51, 50, 17, 168, 209, 192, 23, 25, 82]], [[138, 31, 36, 171, 27, 166, 38, 44, 229], [67, 87, 58, 169, 82, 115, 26, 59, 179], [63, 59, 90, 180, 59, 166, 93, 73, 154], [40, 40, 21, 116, 143, 209, 34, 39, 175], [47, 15, 16, 183, 34, 223, 49, 45, 183], [46, 17, 33, 183, 6, 98, 15, 32, 183], [57, 46, 22, 24, 128, 1, 54, 17, 37], [65, 32, 73, 115, 28, 128, 23, 128, 205], [40, 3, 9, 115, 51, 192, 18, 6, 223], [87, 37, 9, 115, 59, 77, 64, 21, 47]], [[104, 55, 44, 218, 9, 54, 53, 130, 226], [64, 90, 70, 205, 40, 41, 23, 26, 57], [54, 57, 112, 184, 5, 41, 38, 166, 213], [30, 34, 26, 133, 152, 116, 10, 32, 134], [39, 19, 53, 221, 26, 114, 32, 73, 255], [31, 9, 65, 234, 2, 15, 1, 118, 73], [75, 32, 12, 51, 192, 255, 160, 43, 51], [88, 31, 35, 67, 102, 85, 55, 186, 85], [56, 21, 23, 111, 59, 205, 45, 37, 192], [55, 38, 70, 124, 73, 102, 1, 34, 98]], [[125, 98, 42, 88, 104, 85, 117, 175, 82], [95, 84, 53, 89, 128, 100, 113, 101, 45], [75, 79, 123, 47, 51, 128, 81, 171, 1], [57, 17, 5, 71, 102, 57, 53, 41, 49], [38, 33, 13, 121, 57, 73, 26, 1, 85], [41, 10, 67, 138, 77, 110, 90, 47, 114], [115, 21, 2, 10, 102, 255, 166, 23, 6], [101, 29, 16, 10, 85, 128, 101, 196, 26], [57, 18, 10, 102, 102, 213, 34, 20, 43], [117, 20, 15, 36, 163, 128, 68, 1, 26]], [[102, 61, 71, 37, 34, 53, 31, 243, 192], [69, 60, 71, 38, 73, 119, 28, 222, 37], [68, 45, 128, 34, 1, 47, 11, 245, 171], [62, 17, 19, 70, 146, 85, 55, 62, 70], [37, 43, 37, 154, 100, 163, 85, 160, 1], [63, 9, 92, 136, 28, 64, 32, 201, 85], [75, 15, 9, 9, 64, 255, 184, 119, 16], [86, 6, 28, 5, 64, 255, 25, 248, 1], [56, 8, 17, 132, 137, 255, 55, 116, 128], [58, 15, 20, 82, 135, 57, 26, 121, 40]], [[164, 50, 31, 137, 154, 133, 25, 35, 218], [51, 103, 44, 131, 131, 123, 31, 6, 158], [86, 40, 64, 135, 148, 224, 45, 183, 128], [22, 26, 17, 131, 240, 154, 14, 1, 209], [45, 16, 21, 91, 64, 222, 7, 1, 197], [56, 21, 39, 155, 60, 138, 23, 102, 213], [83, 12, 13, 54, 192, 255, 68, 47, 28], [85, 26, 85, 85, 128, 128, 32, 146, 171], [18, 11, 7, 63, 144, 171, 4, 4, 246], [35, 27, 10, 146, 174, 171, 12, 26, 128]], [[190, 80, 35, 99, 180, 80, 126, 54, 45], [85, 126, 47, 87, 176, 51, 41, 20, 32], [101, 75, 128, 139, 118, 146, 116, 128, 85], [56, 41, 15, 176, 236, 85, 37, 9, 62], [71, 30, 17, 119, 118, 255, 17, 18, 138], [101, 38, 60, 138, 55, 70, 43, 26, 142], [146, 36, 19, 30, 171, 255, 97, 27, 20], [138, 45, 61, 62, 219, 1, 81, 188, 64], [32, 41, 20, 117, 151, 142, 20, 21, 163], [112, 19, 12, 61, 195, 128, 48, 4, 24]]], $h = [[[[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[176, 246, 255, 255, 255, 255, 255, 255, 255, 255, 255], [223, 241, 252, 255, 255, 255, 255, 255, 255, 255, 255], [249, 253, 253, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 244, 252, 255, 255, 255, 255, 255, 255, 255, 255], [234, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255], [253, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 246, 254, 255, 255, 255, 255, 255, 255, 255, 255], [239, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255], [254, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 248, 254, 255, 255, 255, 255, 255, 255, 255, 255], [251, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255], [251, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255], [254, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 254, 253, 255, 254, 255, 255, 255, 255, 255, 255], [250, 255, 254, 255, 254, 255, 255, 255, 255, 255, 255], [254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]]], [[[217, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [225, 252, 241, 253, 255, 255, 254, 255, 255, 255, 255], [234, 250, 241, 250, 253, 255, 253, 254, 255, 255, 255]], [[255, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255], [223, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255], [238, 253, 254, 254, 255, 255, 255, 255, 255, 255, 255]], [[255, 248, 254, 255, 255, 255, 255, 255, 255, 255, 255], [249, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 253, 255, 255, 255, 255, 255, 255, 255, 255, 255], [247, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255], [252, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255], [253, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 254, 253, 255, 255, 255, 255, 255, 255, 255, 255], [250, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]]], [[[186, 251, 250, 255, 255, 255, 255, 255, 255, 255, 255], [234, 251, 244, 254, 255, 255, 255, 255, 255, 255, 255], [251, 251, 243, 253, 254, 255, 254, 255, 255, 255, 255]], [[255, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255], [236, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255], [251, 253, 253, 254, 254, 255, 255, 255, 255, 255, 255]], [[255, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255], [254, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255], [254, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255], [254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]]], [[[248, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [250, 254, 252, 254, 255, 255, 255, 255, 255, 255, 255], [248, 254, 249, 253, 255, 255, 255, 255, 255, 255, 255]], [[255, 253, 253, 255, 255, 255, 255, 255, 255, 255, 255], [246, 253, 253, 255, 255, 255, 255, 255, 255, 255, 255], [252, 254, 251, 254, 254, 255, 255, 255, 255, 255, 255]], [[255, 254, 252, 255, 255, 255, 255, 255, 255, 255, 255], [248, 254, 253, 255, 255, 255, 255, 255, 255, 255, 255], [253, 255, 254, 254, 255, 255, 255, 255, 255, 255, 255]], [[255, 251, 254, 255, 255, 255, 255, 255, 255, 255, 255], [245, 251, 254, 255, 255, 255, 255, 255, 255, 255, 255], [253, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 251, 253, 255, 255, 255, 255, 255, 255, 255, 255], [252, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255], [255, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 252, 255, 255, 255, 255, 255, 255, 255, 255, 255], [249, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 255, 253, 255, 255, 255, 255, 255, 255, 255, 255], [250, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]]]], Zh = [0, 1, 2, 3, 6, 4, 5, 6, 6, 6, 6, 6, 6, 6, 6, 7, 0], Hr = [], Xn = [], Ir = [], Qh = 1, ml = 2, Wr = [], Wn = [];
- cn("UpsampleRgbLinePair", li, 3), cn("UpsampleBgrLinePair", Ti, 3), cn("UpsampleRgbaLinePair", va, 4), cn("UpsampleBgraLinePair", hi, 4), cn("UpsampleArgbLinePair", ui, 4), cn("UpsampleRgba4444LinePair", dn, 2), cn("UpsampleRgb565LinePair", Di, 2);
- var tf = R.UpsampleRgbLinePair, ef = R.UpsampleBgrLinePair, vl = R.UpsampleRgbaLinePair, bl = R.UpsampleBgraLinePair, wl = R.UpsampleArgbLinePair, yl = R.UpsampleRgba4444LinePair, nf = R.UpsampleRgb565LinePair, as = 16, ss = 1 << as - 1, La = -227, oo = 482, rf = 6, xl = 0, af = a(256), sf = a(256), of = a(256), lf = a(256), uf = a(oo - La), hf = a(oo - La);
- hr("YuvToRgbRow", li, 3), hr("YuvToBgrRow", Ti, 3), hr("YuvToRgbaRow", va, 4), hr("YuvToBgraRow", hi, 4), hr("YuvToArgbRow", ui, 4), hr("YuvToRgba4444Row", dn, 2), hr("YuvToRgb565Row", Di, 2);
- var _l = [0, 4, 8, 12, 128, 132, 136, 140, 256, 260, 264, 268, 384, 388, 392, 396], os = [0, 2, 8], ff = [8, 7, 6, 4, 4, 2, 2, 2, 1, 1, 1, 1], cf = 1;
- this.WebPDecodeRGBA = function(r, o, h, g, b) {
- var w = es, y = new D(), A = new le();
- y.ba = A, A.S = w, A.width = [A.width], A.height = [A.height];
- var L = A.width, F = A.height, W = new Vt();
- if (W == null || r == null) var et = 2;
- else e(W != null), et = $a(r, o, h, W.width, W.height, W.Pd, W.Qd, W.format, null);
- if (et != 0 ? L = 0 : (L != null && (L[0] = W.width[0]), F != null && (F[0] = W.height[0]), L = 1), L) {
- A.width = A.width[0], A.height = A.height[0], g != null && (g[0] = A.width), b != null && (b[0] = A.height);
- t: {
- if (g = new Ii(), (b = new K()).data = r, b.w = o, b.ha = h, b.kd = 1, o = [0], e(b != null), ((r = $a(b.data, b.w, b.ha, null, null, null, o, null, b)) == 0 || r == 7) && o[0] && (r = 4), (o = r) == 0) {
- if (e(y != null), g.data = b.data, g.w = b.w + b.offset, g.ha = b.ha - b.offset, g.put = Gt, g.ac = rr, g.bc = wr, g.ma = y, b.xa) {
- if ((r = ei()) == null) {
- y = 1;
- break t;
- }
- if (function(C, Y) {
- var $ = [0], ut = [0], Q = [0];
- e: for (; ; ) {
- if (C == null) return 0;
- if (Y == null) return C.a = 2, 0;
- if (C.l = Y, C.a = 0, ct(C.m, Y.data, Y.w, Y.ha), !yr(C.m, $, ut, Q)) {
- C.a = 3;
- break e;
- }
- if (C.xb = ml, Y.width = $[0], Y.height = ut[0], !ar($[0], ut[0], 1, C, null)) break e;
- return 1;
- }
- return e(C.a != 0), 0;
- }(r, g)) {
- if (g = (o = ba(g.width, g.height, y.Oa, y.ba)) == 0) {
- e: {
- g = r;
- n: for (; ; ) {
- if (g == null) {
- g = 0;
- break e;
- }
- if (e(g.s.yc != null), e(g.s.Ya != null), e(0 < g.s.Wb), e((h = g.l) != null), e((b = h.ma) != null), g.xb != 0) {
- if (g.ca = b.ba, g.tb = b.tb, e(g.ca != null), !zn(b.Oa, h, ns)) {
- g.a = 2;
- break n;
- }
- if (!ni(g, h.width) || h.da) break n;
- if ((h.da || Yt(g.ca.S)) && Te(), 11 > g.ca.S || (alert("todo:WebPInitConvertARGBToYUV"), g.ca.f.kb.F != null && Te()), g.Pb && 0 < g.s.ua && g.s.vb.X == null && !P(g.s.vb, g.s.Wa.Xa)) {
- g.a = 1;
- break n;
- }
- g.xb = 0;
- }
- if (!Jn(g, g.V, g.Ba, g.c, g.i, h.o, jr)) break n;
- b.Dc = g.Ma, g = 1;
- break e;
- }
- e(g.a != 0), g = 0;
- }
- g = !g;
- }
- g && (o = r.a);
- } else o = r.a;
- } else {
- if ((r = new Ms()) == null) {
- y = 1;
- break t;
- }
- if (r.Fa = b.na, r.P = b.P, r.qc = b.Sa, or(r, g)) {
- if ((o = ba(g.width, g.height, y.Oa, y.ba)) == 0) {
- if (r.Aa = 0, h = y.Oa, e((b = r) != null), h != null) {
- if (0 < (L = 0 > (L = h.Md) ? 0 : 100 < L ? 255 : 255 * L / 100)) {
- for (F = W = 0; 4 > F; ++F) 12 > (et = b.pb[F]).lc && (et.ia = L * ff[0 > et.lc ? 0 : et.lc] >> 3), W |= et.ia;
- W && (alert("todo:VP8InitRandom"), b.ia = 1);
- }
- b.Ga = h.Id, 100 < b.Ga ? b.Ga = 100 : 0 > b.Ga && (b.Ga = 0);
- }
- (function(C, Y) {
- if (C == null) return 0;
- if (Y == null) return Xe(C, 2, "NULL VP8Io parameter in VP8Decode().");
- if (!C.cb && !or(C, Y)) return 0;
- if (e(C.cb), Y.ac == null || Y.ac(Y)) {
- Y.ob && (C.L = 0);
- var $ = os[C.L];
- if (C.L == 2 ? (C.yb = 0, C.zb = 0) : (C.yb = Y.v - $ >> 4, C.zb = Y.j - $ >> 4, 0 > C.yb && (C.yb = 0), 0 > C.zb && (C.zb = 0)), C.Va = Y.o + 15 + $ >> 4, C.Hb = Y.va + 15 + $ >> 4, C.Hb > C.za && (C.Hb = C.za), C.Va > C.Ub && (C.Va = C.Ub), 0 < C.L) {
- var ut = C.ed;
- for ($ = 0; 4 > $; ++$) {
- var Q;
- if (C.Qa.Cb) {
- var ft = C.Qa.Lb[$];
- C.Qa.Fb || (ft += ut.Tb);
- } else ft = ut.Tb;
- for (Q = 0; 1 >= Q; ++Q) {
- var pt = C.gd[$][Q], xt = ft;
- if (ut.Pc && (xt += ut.vd[0], Q && (xt += ut.od[0])), 0 < (xt = 0 > xt ? 0 : 63 < xt ? 63 : xt)) {
- var bt = xt;
- 0 < ut.wb && (bt = 4 < ut.wb ? bt >> 2 : bt >> 1) > 9 - ut.wb && (bt = 9 - ut.wb), 1 > bt && (bt = 1), pt.dd = bt, pt.tc = 2 * xt + bt, pt.ld = 40 <= xt ? 2 : 15 <= xt ? 1 : 0;
- } else pt.tc = 0;
- pt.La = Q;
- }
- }
- }
- $ = 0;
- } else Xe(C, 6, "Frame setup failed"), $ = C.a;
- if ($ = $ == 0) {
- if ($) {
- C.$c = 0, 0 < C.Aa || (C.Ic = cf);
- e: {
- $ = C.Ic, ut = 4 * (bt = C.za);
- var Mt = 32 * bt, Pt = bt + 1, re = 0 < C.L ? bt * (0 < C.Aa ? 2 : 1) : 0, Ot = (C.Aa == 2 ? 2 : 1) * bt;
- if ((pt = ut + 832 + (Q = 3 * (16 * $ + os[C.L]) / 2 * Mt) + (ft = C.Fa != null && 0 < C.Fa.length ? C.Kc.c * C.Kc.i : 0)) != pt) $ = 0;
- else {
- if (pt > C.Vb) {
- if (C.Vb = 0, C.Ec = a(pt), C.Fc = 0, C.Ec == null) {
- $ = Xe(C, 1, "no memory during frame initialization.");
- break e;
- }
- C.Vb = pt;
- }
- pt = C.Ec, xt = C.Fc, C.Ac = pt, C.Bc = xt, xt += ut, C.Gd = c(Mt, Da), C.Hd = 0, C.rb = c(Pt + 1, oa), C.sb = 1, C.wa = re ? c(re, Un) : null, C.Y = 0, C.D.Nb = 0, C.D.wa = C.wa, C.D.Y = C.Y, 0 < C.Aa && (C.D.Y += bt), e(!0), C.oc = pt, C.pc = xt, xt += 832, C.ya = c(Ot, la), C.aa = 0, C.D.ya = C.ya, C.D.aa = C.aa, C.Aa == 2 && (C.D.aa += bt), C.R = 16 * bt, C.B = 8 * bt, bt = (Mt = os[C.L]) * C.R, Mt = Mt / 2 * C.B, C.sa = pt, C.ta = xt + bt, C.qa = C.sa, C.ra = C.ta + 16 * $ * C.R + Mt, C.Ha = C.qa, C.Ia = C.ra + 8 * $ * C.B + Mt, C.$c = 0, xt += Q, C.mb = ft ? pt : null, C.nb = ft ? xt : null, e(xt + ft <= C.Fc + C.Vb), ua(C), s(C.Ac, C.Bc, 0, ut), $ = 1;
- }
- }
- if ($) {
- if (Y.ka = 0, Y.y = C.sa, Y.O = C.ta, Y.f = C.qa, Y.N = C.ra, Y.ea = C.Ha, Y.Vd = C.Ia, Y.fa = C.R, Y.Rc = C.B, Y.F = null, Y.J = 0, !fl) {
- for ($ = -255; 255 >= $; ++$) ol[255 + $] = 0 > $ ? -$ : $;
- for ($ = -1020; 1020 >= $; ++$) ll[1020 + $] = -128 > $ ? -128 : 127 < $ ? 127 : $;
- for ($ = -112; 112 >= $; ++$) ul[112 + $] = -16 > $ ? -16 : 15 < $ ? 15 : $;
- for ($ = -255; 510 >= $; ++$) hl[255 + $] = 0 > $ ? 0 : 255 < $ ? 255 : $;
- fl = 1;
- }
- Ur = Ha, kr = Rs, Vi = Ts, pn = Ds, cr = lr, zr = za, Pe = Ga, Ie = Ya, We = Ka, Qe = u, Pr = Ja, _a = ai, Gi = v, Za = I, tl = Mi, el = ga, nl = Ri, rl = Va, Xn[0] = Gs, Xn[1] = Oi, Xn[2] = Ws, Xn[3] = Vs, Xn[4] = Ys, Xn[5] = _r, Xn[6] = Js, Xn[7] = Ar, Xn[8] = Xs, Xn[9] = Ks, Hr[0] = Wa, Hr[1] = qs, Hr[2] = Us, Hr[3] = zs, Hr[4] = Mr, Hr[5] = Hs, Hr[6] = ri, Ir[0] = $s, Ir[1] = ha, Ir[2] = ji, Ir[3] = fa, Ir[4] = Zs, Ir[5] = Bi, Ir[6] = ca, $ = 1;
- } else $ = 0;
- }
- $ && ($ = function(ce, tn) {
- for (ce.M = 0; ce.M < ce.Va; ++ce.M) {
- var ie, jt = ce.Jc[ce.M & ce.Xb], Nt = ce.m, Ve = ce;
- for (ie = 0; ie < Ve.za; ++ie) {
- var ee = Nt, pe = Ve, Ee = pe.Ac, ln = pe.Bc + 4 * ie, _n = pe.zc, qe = pe.ya[pe.aa + ie];
- if (pe.Qa.Bb ? qe.$b = gt(ee, pe.Pa.jb[0]) ? 2 + gt(ee, pe.Pa.jb[2]) : gt(ee, pe.Pa.jb[1]) : qe.$b = 0, pe.kc && (qe.Ad = gt(ee, pe.Bd)), qe.Za = !gt(ee, 145) + 0, qe.Za) {
- var gn = qe.Ob, An = 0;
- for (pe = 0; 4 > pe; ++pe) {
- var en, me = _n[0 + pe];
- for (en = 0; 4 > en; ++en) {
- me = Xh[Ee[ln + en]][me];
- for (var we = gl[gt(ee, me[0])]; 0 < we; ) we = gl[2 * we + gt(ee, me[we])];
- me = -we, Ee[ln + en] = me;
- }
- i(gn, An, Ee, ln, 4), An += 4, _n[0 + pe] = me;
- }
- } else me = gt(ee, 156) ? gt(ee, 128) ? 1 : 3 : gt(ee, 163) ? 2 : 0, qe.Ob[0] = me, s(Ee, ln, me, 4), s(_n, 0, me, 4);
- qe.Dd = gt(ee, 142) ? gt(ee, 114) ? gt(ee, 183) ? 1 : 3 : 2 : 0;
- }
- if (Ve.m.Ka) return Xe(ce, 7, "Premature end-of-partition0 encountered.");
- for (; ce.ja < ce.za; ++ce.ja) {
- if (Ve = jt, ee = (Nt = ce).rb[Nt.sb - 1], Ee = Nt.rb[Nt.sb + Nt.ja], ie = Nt.ya[Nt.aa + Nt.ja], ln = Nt.kc ? ie.Ad : 0) ee.la = Ee.la = 0, ie.Za || (ee.Na = Ee.Na = 0), ie.Hc = 0, ie.Gc = 0, ie.ia = 0;
- else {
- var Ue, ye;
- if (ee = Ee, Ee = Ve, ln = Nt.Pa.Xc, _n = Nt.ya[Nt.aa + Nt.ja], qe = Nt.pb[_n.$b], pe = _n.ad, gn = 0, An = Nt.rb[Nt.sb - 1], me = en = 0, s(pe, gn, 0, 384), _n.Za) var un = 0, $n = ln[3];
- else {
- we = a(16);
- var Ge = ee.Na + An.Na;
- if (Ge = Na(Ee, ln[1], Ge, qe.Eb, 0, we, 0), ee.Na = An.Na = (0 < Ge) + 0, 1 < Ge) Ur(we, 0, pe, gn);
- else {
- var Sn = we[0] + 3 >> 3;
- for (we = 0; 256 > we; we += 16) pe[gn + we] = Sn;
- }
- un = 1, $n = ln[0];
- }
- var Ne = 15 & ee.la, nn = 15 & An.la;
- for (we = 0; 4 > we; ++we) {
- var Cn = 1 & nn;
- for (Sn = ye = 0; 4 > Sn; ++Sn) Ne = Ne >> 1 | (Cn = (Ge = Na(Ee, $n, Ge = Cn + (1 & Ne), qe.Sc, un, pe, gn)) > un) << 7, ye = ye << 2 | (3 < Ge ? 3 : 1 < Ge ? 2 : pe[gn + 0] != 0), gn += 16;
- Ne >>= 4, nn = nn >> 1 | Cn << 7, en = (en << 8 | ye) >>> 0;
- }
- for ($n = Ne, un = nn >> 4, Ue = 0; 4 > Ue; Ue += 2) {
- for (ye = 0, Ne = ee.la >> 4 + Ue, nn = An.la >> 4 + Ue, we = 0; 2 > we; ++we) {
- for (Cn = 1 & nn, Sn = 0; 2 > Sn; ++Sn) Ge = Cn + (1 & Ne), Ne = Ne >> 1 | (Cn = 0 < (Ge = Na(Ee, ln[2], Ge, qe.Qc, 0, pe, gn))) << 3, ye = ye << 2 | (3 < Ge ? 3 : 1 < Ge ? 2 : pe[gn + 0] != 0), gn += 16;
- Ne >>= 2, nn = nn >> 1 | Cn << 5;
- }
- me |= ye << 4 * Ue, $n |= Ne << 4 << Ue, un |= (240 & nn) << Ue;
- }
- ee.la = $n, An.la = un, _n.Hc = en, _n.Gc = me, _n.ia = 43690 & me ? 0 : qe.ia, ln = !(en | me);
- }
- if (0 < Nt.L && (Nt.wa[Nt.Y + Nt.ja] = Nt.gd[ie.$b][ie.Za], Nt.wa[Nt.Y + Nt.ja].La |= !ln), Ve.Ka) return Xe(ce, 7, "Premature end-of-file encountered.");
- }
- if (ua(ce), Nt = tn, Ve = 1, ie = (jt = ce).D, ee = 0 < jt.L && jt.M >= jt.zb && jt.M <= jt.Va, jt.Aa == 0) e: {
- if (ie.M = jt.M, ie.uc = ee, qi(jt, ie), Ve = 1, ie = (ye = jt.D).Nb, ee = (me = os[jt.L]) * jt.R, Ee = me / 2 * jt.B, we = 16 * ie * jt.R, Sn = 8 * ie * jt.B, ln = jt.sa, _n = jt.ta - ee + we, qe = jt.qa, pe = jt.ra - Ee + Sn, gn = jt.Ha, An = jt.Ia - Ee + Sn, nn = (Ne = ye.M) == 0, en = Ne >= jt.Va - 1, jt.Aa == 2 && qi(jt, ye), ye.uc) for (Cn = (Ge = jt).D.M, e(Ge.D.uc), ye = Ge.yb; ye < Ge.Hb; ++ye) {
- un = ye, $n = Cn;
- var Nn = (En = (hn = Ge).D).Nb;
- Ue = hn.R;
- var En = En.wa[En.Y + un], On = hn.sa, kn = hn.ta + 16 * Nn * Ue + 16 * un, jn = En.dd, Fe = En.tc;
- if (Fe != 0) if (e(3 <= Fe), hn.L == 1) 0 < un && el(On, kn, Ue, Fe + 4), En.La && rl(On, kn, Ue, Fe), 0 < $n && tl(On, kn, Ue, Fe + 4), En.La && nl(On, kn, Ue, Fe);
- else {
- var Bn = hn.B, Zn = hn.qa, vi = hn.ra + 8 * Nn * Bn + 8 * un, Fr = hn.Ha, hn = hn.Ia + 8 * Nn * Bn + 8 * un;
- Nn = En.ld, 0 < un && (Ie(On, kn, Ue, Fe + 4, jn, Nn), Qe(Zn, vi, Fr, hn, Bn, Fe + 4, jn, Nn)), En.La && (_a(On, kn, Ue, Fe, jn, Nn), Za(Zn, vi, Fr, hn, Bn, Fe, jn, Nn)), 0 < $n && (Pe(On, kn, Ue, Fe + 4, jn, Nn), We(Zn, vi, Fr, hn, Bn, Fe + 4, jn, Nn)), En.La && (Pr(On, kn, Ue, Fe, jn, Nn), Gi(Zn, vi, Fr, hn, Bn, Fe, jn, Nn));
- }
- }
- if (jt.ia && alert("todo:DitherRow"), Nt.put != null) {
- if (ye = 16 * Ne, Ne = 16 * (Ne + 1), nn ? (Nt.y = jt.sa, Nt.O = jt.ta + we, Nt.f = jt.qa, Nt.N = jt.ra + Sn, Nt.ea = jt.Ha, Nt.W = jt.Ia + Sn) : (ye -= me, Nt.y = ln, Nt.O = _n, Nt.f = qe, Nt.N = pe, Nt.ea = gn, Nt.W = An), en || (Ne -= me), Ne > Nt.o && (Ne = Nt.o), Nt.F = null, Nt.J = null, jt.Fa != null && 0 < jt.Fa.length && ye < Ne && (Nt.J = $e(jt, Nt, ye, Ne - ye), Nt.F = jt.mb, Nt.F == null && Nt.F.length == 0)) {
- Ve = Xe(jt, 3, "Could not decode alpha data.");
- break e;
- }
- ye < Nt.j && (me = Nt.j - ye, ye = Nt.j, e(!(1 & me)), Nt.O += jt.R * me, Nt.N += jt.B * (me >> 1), Nt.W += jt.B * (me >> 1), Nt.F != null && (Nt.J += Nt.width * me)), ye < Ne && (Nt.O += Nt.v, Nt.N += Nt.v >> 1, Nt.W += Nt.v >> 1, Nt.F != null && (Nt.J += Nt.v), Nt.ka = ye - Nt.j, Nt.U = Nt.va - Nt.v, Nt.T = Ne - ye, Ve = Nt.put(Nt));
- }
- ie + 1 != jt.Ic || en || (i(jt.sa, jt.ta - ee, ln, _n + 16 * jt.R, ee), i(jt.qa, jt.ra - Ee, qe, pe + 8 * jt.B, Ee), i(jt.Ha, jt.Ia - Ee, gn, An + 8 * jt.B, Ee));
- }
- if (!Ve) return Xe(ce, 6, "Output aborted.");
- }
- return 1;
- }(C, Y)), Y.bc != null && Y.bc(Y), $ &= 1;
- }
- return $ ? (C.cb = 0, $) : 0;
- })(r, g) || (o = r.a);
- }
- } else o = r.a;
- }
- o == 0 && y.Oa != null && y.Oa.fd && (o = fi(y.ba));
- }
- y = o;
- }
- w = y != 0 ? null : 11 > w ? A.f.RGBA.eb : A.f.kb.y;
- } else w = null;
- return w;
- };
- var Al = [3, 4, 3, 4, 4, 2, 2, 4, 4, 4, 2, 1, 1];
- };
- function d(R, tt) {
- for (var N = "", E = 0; E < 4; E++) N += String.fromCharCode(R[tt++]);
- return N;
- }
- function m(R, tt) {
- return R[tt + 0] | R[tt + 1] << 8;
- }
- function _(R, tt) {
- return (R[tt + 0] | R[tt + 1] << 8 | R[tt + 2] << 16) >>> 0;
- }
- function k(R, tt) {
- return (R[tt + 0] | R[tt + 1] << 8 | R[tt + 2] << 16 | R[tt + 3] << 24) >>> 0;
- }
- new f();
- var p = [0], j = [0], O = [], M = new f(), S = n, V = function(R, tt) {
- var N = {}, E = 0, z = !1, U = 0, rt = 0;
- if (N.frames = [], !/** @license
- * Copyright (c) 2017 Dominik Homberger
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- https://webpjs.appspot.com
- WebPRiffParser dominikhlbg@gmail.com
- */
- function(x, B) {
- for (var T = 0; T < 4; T++) if (x[B + T] != "RIFF".charCodeAt(T)) return !0;
- return !1;
- }(R, tt)) {
- for (k(R, tt += 4), tt += 8; tt < R.length; ) {
- var ot = d(R, tt), ht = k(R, tt += 4);
- tt += 4;
- var nt = ht + (1 & ht);
- switch (ot) {
- case "VP8 ":
- case "VP8L":
- N.frames[E] === void 0 && (N.frames[E] = {}), (wt = N.frames[E]).src_off = z ? rt : tt - 8, wt.src_size = U + ht + 8, E++, z && (z = !1, U = 0, rt = 0);
- break;
- case "VP8X":
- (wt = N.header = {}).feature_flags = R[tt];
- var ct = tt + 4;
- wt.canvas_width = 1 + _(R, ct), ct += 3, wt.canvas_height = 1 + _(R, ct), ct += 3;
- break;
- case "ALPH":
- z = !0, U = nt + 8, rt = tt - 8;
- break;
- case "ANIM":
- (wt = N.header).bgcolor = k(R, tt), ct = tt + 4, wt.loop_count = m(R, ct), ct += 2;
- break;
- case "ANMF":
- var At, wt;
- (wt = N.frames[E] = {}).offset_x = 2 * _(R, tt), tt += 3, wt.offset_y = 2 * _(R, tt), tt += 3, wt.width = 1 + _(R, tt), tt += 3, wt.height = 1 + _(R, tt), tt += 3, wt.duration = _(R, tt), tt += 3, At = R[tt++], wt.dispose = 1 & At, wt.blend = At >> 1 & 1;
- }
- ot != "ANMF" && (tt += nt);
- }
- return N;
- }
- }(S, 0);
- V.response = S, V.rgbaoutput = !0, V.dataurl = !1;
- var G = V.header ? V.header : null, q = V.frames ? V.frames : null;
- if (G) {
- G.loop_counter = G.loop_count, p = [G.canvas_height], j = [G.canvas_width];
- for (var it = 0; it < q.length && q[it].blend != 0; it++) ;
- }
- var vt = q[0], dt = M.WebPDecodeRGBA(S, vt.src_off, vt.src_size, j, p);
- vt.rgba = dt, vt.imgwidth = j[0], vt.imgheight = p[0];
- for (var X = 0; X < j[0] * p[0] * 4; X++) O[X] = dt[X];
- return this.width = j, this.height = p, this.data = O, this;
- }
- /** ====================================================================
- * @license
- * jsPDF XMP metadata plugin
- * Copyright (c) 2016 Jussi Utunen, u-jussi@suomi24.fi
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- * ====================================================================
- */
- function Q1() {
- var n, e = this.internal.__metadata__.metadata, t = unescape(encodeURIComponent(e));
- n = this.internal.__metadata__.rawXml ? t : '<x:xmpmeta xmlns:x="adobe:ns:meta/"><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><rdf:Description rdf:about="" xmlns:jspdf="' + this.internal.__metadata__.namespaceUri + '"><jspdf:metadata>' + t.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'") + "</jspdf:metadata></rdf:Description></rdf:RDF></x:xmpmeta>", this.internal.__metadata__.metadataObjectNumber = this.internal.newObject(), this.internal.write("<< /Type /Metadata /Subtype /XML /Length " + n.length + " >>"), this.internal.write("stream"), this.internal.write(n), this.internal.write("endstream"), this.internal.write("endobj");
- }
- function t2() {
- this.internal.__metadata__.metadataObjectNumber && this.internal.write("/Metadata " + this.internal.__metadata__.metadataObjectNumber + " 0 R");
- }
- (function(n) {
- var e, t, i, s, a, c, l, f, d, m = function(x) {
- return x = x || {}, this.isStrokeTransparent = x.isStrokeTransparent || !1, this.strokeOpacity = x.strokeOpacity || 1, this.strokeStyle = x.strokeStyle || "#000000", this.fillStyle = x.fillStyle || "#000000", this.isFillTransparent = x.isFillTransparent || !1, this.fillOpacity = x.fillOpacity || 1, this.font = x.font || "10px sans-serif", this.textBaseline = x.textBaseline || "alphabetic", this.textAlign = x.textAlign || "left", this.lineWidth = x.lineWidth || 1, this.lineJoin = x.lineJoin || "miter", this.lineCap = x.lineCap || "butt", this.path = x.path || [], this.transform = x.transform !== void 0 ? x.transform.clone() : new f(), this.globalCompositeOperation = x.globalCompositeOperation || "normal", this.globalAlpha = x.globalAlpha || 1, this.clip_path = x.clip_path || [], this.currentPoint = x.currentPoint || new c(), this.miterLimit = x.miterLimit || 10, this.lastPoint = x.lastPoint || new c(), this.lineDashOffset = x.lineDashOffset || 0, this.lineDash = x.lineDash || [], this.margin = x.margin || [0, 0, 0, 0], this.prevPageLastElemOffset = x.prevPageLastElemOffset || 0, this.ignoreClearRect = typeof x.ignoreClearRect != "boolean" || x.ignoreClearRect, this;
- };
- n.events.push(["initialized", function() {
- this.context2d = new _(this), e = this.internal.f2, t = this.internal.getCoordinateString, i = this.internal.getVerticalCoordinateString, s = this.internal.getHorizontalCoordinate, a = this.internal.getVerticalCoordinate, c = this.internal.Point, l = this.internal.Rectangle, f = this.internal.Matrix, d = new m();
- }]);
- var _ = function(x) {
- Object.defineProperty(this, "canvas", { get: function() {
- return { parentNode: !1, style: !1 };
- } });
- var B = x;
- Object.defineProperty(this, "pdf", { get: function() {
- return B;
- } });
- var T = !1;
- Object.defineProperty(this, "pageWrapXEnabled", { get: function() {
- return T;
- }, set: function(P) {
- T = !!P;
- } });
- var H = !1;
- Object.defineProperty(this, "pageWrapYEnabled", { get: function() {
- return H;
- }, set: function(P) {
- H = !!P;
- } });
- var J = 0;
- Object.defineProperty(this, "posX", { get: function() {
- return J;
- }, set: function(P) {
- isNaN(P) || (J = P);
- } });
- var Z = 0;
- Object.defineProperty(this, "posY", { get: function() {
- return Z;
- }, set: function(P) {
- isNaN(P) || (Z = P);
- } }), Object.defineProperty(this, "margin", { get: function() {
- return d.margin;
- }, set: function(P) {
- var Lt;
- typeof P == "number" ? Lt = [P, P, P, P] : ((Lt = new Array(4))[0] = P[0], Lt[1] = P.length >= 2 ? P[1] : Lt[0], Lt[2] = P.length >= 3 ? P[2] : Lt[0], Lt[3] = P.length >= 4 ? P[3] : Lt[1]), d.margin = Lt;
- } });
- var at = !1;
- Object.defineProperty(this, "autoPaging", { get: function() {
- return at;
- }, set: function(P) {
- at = P;
- } });
- var st = 0;
- Object.defineProperty(this, "lastBreak", { get: function() {
- return st;
- }, set: function(P) {
- st = P;
- } });
- var gt = [];
- Object.defineProperty(this, "pageBreaks", { get: function() {
- return gt;
- }, set: function(P) {
- gt = P;
- } }), Object.defineProperty(this, "ctx", { get: function() {
- return d;
- }, set: function(P) {
- P instanceof m && (d = P);
- } }), Object.defineProperty(this, "path", { get: function() {
- return d.path;
- }, set: function(P) {
- d.path = P;
- } });
- var _t = [];
- Object.defineProperty(this, "ctxStack", { get: function() {
- return _t;
- }, set: function(P) {
- _t = P;
- } }), Object.defineProperty(this, "fillStyle", { get: function() {
- return this.ctx.fillStyle;
- }, set: function(P) {
- var Lt;
- Lt = k(P), this.ctx.fillStyle = Lt.style, this.ctx.isFillTransparent = Lt.a === 0, this.ctx.fillOpacity = Lt.a, this.pdf.setFillColor(Lt.r, Lt.g, Lt.b, { a: Lt.a }), this.pdf.setTextColor(Lt.r, Lt.g, Lt.b, { a: Lt.a });
- } }), Object.defineProperty(this, "strokeStyle", { get: function() {
- return this.ctx.strokeStyle;
- }, set: function(P) {
- var Lt = k(P);
- this.ctx.strokeStyle = Lt.style, this.ctx.isStrokeTransparent = Lt.a === 0, this.ctx.strokeOpacity = Lt.a, Lt.a === 0 ? this.pdf.setDrawColor(255, 255, 255) : (Lt.a, this.pdf.setDrawColor(Lt.r, Lt.g, Lt.b));
- } }), Object.defineProperty(this, "lineCap", { get: function() {
- return this.ctx.lineCap;
- }, set: function(P) {
- ["butt", "round", "square"].indexOf(P) !== -1 && (this.ctx.lineCap = P, this.pdf.setLineCap(P));
- } }), Object.defineProperty(this, "lineWidth", { get: function() {
- return this.ctx.lineWidth;
- }, set: function(P) {
- isNaN(P) || (this.ctx.lineWidth = P, this.pdf.setLineWidth(P));
- } }), Object.defineProperty(this, "lineJoin", { get: function() {
- return this.ctx.lineJoin;
- }, set: function(P) {
- ["bevel", "round", "miter"].indexOf(P) !== -1 && (this.ctx.lineJoin = P, this.pdf.setLineJoin(P));
- } }), Object.defineProperty(this, "miterLimit", { get: function() {
- return this.ctx.miterLimit;
- }, set: function(P) {
- isNaN(P) || (this.ctx.miterLimit = P, this.pdf.setMiterLimit(P));
- } }), Object.defineProperty(this, "textBaseline", { get: function() {
- return this.ctx.textBaseline;
- }, set: function(P) {
- this.ctx.textBaseline = P;
- } }), Object.defineProperty(this, "textAlign", { get: function() {
- return this.ctx.textAlign;
- }, set: function(P) {
- ["right", "end", "center", "left", "start"].indexOf(P) !== -1 && (this.ctx.textAlign = P);
- } });
- var kt = null, St = null, Dt = null;
- Object.defineProperty(this, "fontFaces", { get: function() {
- return Dt;
- }, set: function(P) {
- kt = null, St = null, Dt = P;
- } }), Object.defineProperty(this, "font", { get: function() {
- return this.ctx.font;
- }, set: function(P) {
- var Lt;
- if (this.ctx.font = P, (Lt = /^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:\%|in|[cem]m|ex|p[ctx]))(?:\s*\/\s*(normal|[.\d]+(?:\%|in|[cem]m|ex|p[ctx])))?\s*([-_,\"\'\sa-z0-9]+?)\s*$/i.exec(P)) !== null) {
- var ae = Lt[1];
- Lt[2];
- var Ht = Lt[3], yt = Lt[4];
- Lt[5];
- var Wt = Lt[6], It = /^([.\d]+)((?:%|in|[cem]m|ex|p[ctx]))$/i.exec(yt)[2];
- yt = Math.floor(It === "px" ? parseFloat(yt) * this.pdf.internal.scaleFactor : It === "em" ? parseFloat(yt) * this.pdf.getFontSize() : parseFloat(yt) * this.pdf.internal.scaleFactor), this.pdf.setFontSize(yt);
- var zt = function(Rt) {
- var He, ge, se = [], oe = Rt.trim();
- if (oe === "") return Bo;
- if (oe in ju) return [ju[oe]];
- for (; oe !== ""; ) {
- switch (ge = null, He = (oe = Mu(oe)).charAt(0)) {
- case '"':
- case "'":
- ge = Y1(oe.substring(1), He);
- break;
- default:
- ge = J1(oe);
- }
- if (ge === null || (se.push(ge[0]), (oe = Mu(ge[1])) !== "" && oe.charAt(0) !== ",")) return Bo;
- oe = oe.replace(/^,/, "");
- }
- return se;
- }(Wt);
- if (this.fontFaces) {
- var qt = function(Rt, He) {
- var ge = Rt.getFontList(), se = JSON.stringify(ge);
- if (kt === null || St !== se) {
- var oe = function(je) {
- var Ut = [];
- return Object.keys(je).forEach(function(ke) {
- je[ke].forEach(function(Yt) {
- var Qt = null;
- switch (Yt) {
- case "bold":
- Qt = { family: ke, weight: "bold" };
- break;
- case "italic":
- Qt = { family: ke, style: "italic" };
- break;
- case "bolditalic":
- Qt = { family: ke, weight: "bold", style: "italic" };
- break;
- case "":
- case "normal":
- Qt = { family: ke };
- }
- Qt !== null && (Qt.ref = { name: ke, style: Yt }, Ut.push(Qt));
- });
- }), Ut;
- }(ge);
- kt = function(je) {
- for (var Ut = {}, ke = 0; ke < je.length; ++ke) {
- var Yt = jo(je[ke]), Qt = Yt.family, Be = Yt.stretch, le = Yt.style, Vt = Yt.weight;
- Ut[Qt] = Ut[Qt] || {}, Ut[Qt][Be] = Ut[Qt][Be] || {}, Ut[Qt][Be][le] = Ut[Qt][Be][le] || {}, Ut[Qt][Be][le][Vt] = Yt;
- }
- return Ut;
- }(oe.concat(He)), St = se;
- }
- return kt;
- }(this.pdf, this.fontFaces), ve = zt.map(function(Rt) {
- return { family: Rt, stretch: "normal", weight: Ht, style: ae };
- }), ue = function(Rt, He, ge) {
- for (var se = (ge = ge || {}).defaultFontFamily || "times", oe = Object.assign({}, G1, ge.genericFontFamilies || {}), je = null, Ut = null, ke = 0; ke < He.length; ++ke) if (oe[(je = jo(He[ke])).family] && (je.family = oe[je.family]), Rt.hasOwnProperty(je.family)) {
- Ut = Rt[je.family];
- break;
- }
- if (!(Ut = Ut || Rt[se])) throw new Error("Could not find a font-family for the rule '" + Bu(je) + "' and default family '" + se + "'.");
- if (Ut = function(Yt, Qt) {
- if (Qt[Yt]) return Qt[Yt];
- var Be = Jo[Yt], le = Be <= Jo.normal ? -1 : 1, Vt = Ou(Qt, Bh, Be, le);
- if (!Vt) throw new Error("Could not find a matching font-stretch value for " + Yt);
- return Vt;
- }(je.stretch, Ut), Ut = function(Yt, Qt) {
- if (Qt[Yt]) return Qt[Yt];
- for (var Be = jh[Yt], le = 0; le < Be.length; ++le) if (Qt[Be[le]]) return Qt[Be[le]];
- throw new Error("Could not find a matching font-style for " + Yt);
- }(je.style, Ut), !(Ut = function(Yt, Qt) {
- if (Qt[Yt]) return Qt[Yt];
- if (Yt === 400 && Qt[500]) return Qt[500];
- if (Yt === 500 && Qt[400]) return Qt[400];
- var Be = V1[Yt], le = Ou(Qt, Mh, Be, Yt < 400 ? -1 : 1);
- if (!le) throw new Error("Could not find a matching font-weight for value " + Yt);
- return le;
- }(je.weight, Ut))) throw new Error("Failed to resolve a font for the rule '" + Bu(je) + "'.");
- return Ut;
- }(qt, ve);
- this.pdf.setFont(ue.ref.name, ue.ref.style);
- } else {
- var Zt = "";
- (Ht === "bold" || parseInt(Ht, 10) >= 700 || ae === "bold") && (Zt = "bold"), ae === "italic" && (Zt += "italic"), Zt.length === 0 && (Zt = "normal");
- for (var fe = "", he = { arial: "Helvetica", Arial: "Helvetica", verdana: "Helvetica", Verdana: "Helvetica", helvetica: "Helvetica", Helvetica: "Helvetica", "sans-serif": "Helvetica", fixed: "Courier", monospace: "Courier", terminal: "Courier", cursive: "Times", fantasy: "Times", serif: "Times" }, Bt = 0; Bt < zt.length; Bt++) {
- if (this.pdf.internal.getFont(zt[Bt], Zt, { noFallback: !0, disableWarning: !0 }) !== void 0) {
- fe = zt[Bt];
- break;
- }
- if (Zt === "bolditalic" && this.pdf.internal.getFont(zt[Bt], "bold", { noFallback: !0, disableWarning: !0 }) !== void 0) fe = zt[Bt], Zt = "bold";
- else if (this.pdf.internal.getFont(zt[Bt], "normal", { noFallback: !0, disableWarning: !0 }) !== void 0) {
- fe = zt[Bt], Zt = "normal";
- break;
- }
- }
- if (fe === "") {
- for (var ne = 0; ne < zt.length; ne++) if (he[zt[ne]]) {
- fe = he[zt[ne]];
- break;
- }
- }
- fe = fe === "" ? "Times" : fe, this.pdf.setFont(fe, Zt);
- }
- }
- } }), Object.defineProperty(this, "globalCompositeOperation", { get: function() {
- return this.ctx.globalCompositeOperation;
- }, set: function(P) {
- this.ctx.globalCompositeOperation = P;
- } }), Object.defineProperty(this, "globalAlpha", { get: function() {
- return this.ctx.globalAlpha;
- }, set: function(P) {
- this.ctx.globalAlpha = P;
- } }), Object.defineProperty(this, "lineDashOffset", { get: function() {
- return this.ctx.lineDashOffset;
- }, set: function(P) {
- this.ctx.lineDashOffset = P, wt.call(this);
- } }), Object.defineProperty(this, "lineDash", { get: function() {
- return this.ctx.lineDash;
- }, set: function(P) {
- this.ctx.lineDash = P, wt.call(this);
- } }), Object.defineProperty(this, "ignoreClearRect", { get: function() {
- return this.ctx.ignoreClearRect;
- }, set: function(P) {
- this.ctx.ignoreClearRect = !!P;
- } });
- };
- _.prototype.setLineDash = function(x) {
- this.lineDash = x;
- }, _.prototype.getLineDash = function() {
- return this.lineDash.length % 2 ? this.lineDash.concat(this.lineDash) : this.lineDash.slice();
- }, _.prototype.fill = function() {
- q.call(this, "fill", !1);
- }, _.prototype.stroke = function() {
- q.call(this, "stroke", !1);
- }, _.prototype.beginPath = function() {
- this.path = [{ type: "begin" }];
- }, _.prototype.moveTo = function(x, B) {
- if (isNaN(x) || isNaN(B)) throw Le.error("jsPDF.context2d.moveTo: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.moveTo");
- var T = this.ctx.transform.applyToPoint(new c(x, B));
- this.path.push({ type: "mt", x: T.x, y: T.y }), this.ctx.lastPoint = new c(x, B);
- }, _.prototype.closePath = function() {
- var x = new c(0, 0), B = 0;
- for (B = this.path.length - 1; B !== -1; B--) if (this.path[B].type === "begin" && Se(this.path[B + 1]) === "object" && typeof this.path[B + 1].x == "number") {
- x = new c(this.path[B + 1].x, this.path[B + 1].y);
- break;
- }
- this.path.push({ type: "close" }), this.ctx.lastPoint = new c(x.x, x.y);
- }, _.prototype.lineTo = function(x, B) {
- if (isNaN(x) || isNaN(B)) throw Le.error("jsPDF.context2d.lineTo: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.lineTo");
- var T = this.ctx.transform.applyToPoint(new c(x, B));
- this.path.push({ type: "lt", x: T.x, y: T.y }), this.ctx.lastPoint = new c(T.x, T.y);
- }, _.prototype.clip = function() {
- this.ctx.clip_path = JSON.parse(JSON.stringify(this.path)), q.call(this, null, !0);
- }, _.prototype.quadraticCurveTo = function(x, B, T, H) {
- if (isNaN(T) || isNaN(H) || isNaN(x) || isNaN(B)) throw Le.error("jsPDF.context2d.quadraticCurveTo: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.quadraticCurveTo");
- var J = this.ctx.transform.applyToPoint(new c(T, H)), Z = this.ctx.transform.applyToPoint(new c(x, B));
- this.path.push({ type: "qct", x1: Z.x, y1: Z.y, x: J.x, y: J.y }), this.ctx.lastPoint = new c(J.x, J.y);
- }, _.prototype.bezierCurveTo = function(x, B, T, H, J, Z) {
- if (isNaN(J) || isNaN(Z) || isNaN(x) || isNaN(B) || isNaN(T) || isNaN(H)) throw Le.error("jsPDF.context2d.bezierCurveTo: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.bezierCurveTo");
- var at = this.ctx.transform.applyToPoint(new c(J, Z)), st = this.ctx.transform.applyToPoint(new c(x, B)), gt = this.ctx.transform.applyToPoint(new c(T, H));
- this.path.push({ type: "bct", x1: st.x, y1: st.y, x2: gt.x, y2: gt.y, x: at.x, y: at.y }), this.ctx.lastPoint = new c(at.x, at.y);
- }, _.prototype.arc = function(x, B, T, H, J, Z) {
- if (isNaN(x) || isNaN(B) || isNaN(T) || isNaN(H) || isNaN(J)) throw Le.error("jsPDF.context2d.arc: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.arc");
- if (Z = !!Z, !this.ctx.transform.isIdentity) {
- var at = this.ctx.transform.applyToPoint(new c(x, B));
- x = at.x, B = at.y;
- var st = this.ctx.transform.applyToPoint(new c(0, T)), gt = this.ctx.transform.applyToPoint(new c(0, 0));
- T = Math.sqrt(Math.pow(st.x - gt.x, 2) + Math.pow(st.y - gt.y, 2));
- }
- Math.abs(J - H) >= 2 * Math.PI && (H = 0, J = 2 * Math.PI), this.path.push({ type: "arc", x, y: B, radius: T, startAngle: H, endAngle: J, counterclockwise: Z });
- }, _.prototype.arcTo = function(x, B, T, H, J) {
- throw new Error("arcTo not implemented.");
- }, _.prototype.rect = function(x, B, T, H) {
- if (isNaN(x) || isNaN(B) || isNaN(T) || isNaN(H)) throw Le.error("jsPDF.context2d.rect: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.rect");
- this.moveTo(x, B), this.lineTo(x + T, B), this.lineTo(x + T, B + H), this.lineTo(x, B + H), this.lineTo(x, B), this.lineTo(x + T, B), this.lineTo(x, B);
- }, _.prototype.fillRect = function(x, B, T, H) {
- if (isNaN(x) || isNaN(B) || isNaN(T) || isNaN(H)) throw Le.error("jsPDF.context2d.fillRect: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.fillRect");
- if (!p.call(this)) {
- var J = {};
- this.lineCap !== "butt" && (J.lineCap = this.lineCap, this.lineCap = "butt"), this.lineJoin !== "miter" && (J.lineJoin = this.lineJoin, this.lineJoin = "miter"), this.beginPath(), this.rect(x, B, T, H), this.fill(), J.hasOwnProperty("lineCap") && (this.lineCap = J.lineCap), J.hasOwnProperty("lineJoin") && (this.lineJoin = J.lineJoin);
- }
- }, _.prototype.strokeRect = function(x, B, T, H) {
- if (isNaN(x) || isNaN(B) || isNaN(T) || isNaN(H)) throw Le.error("jsPDF.context2d.strokeRect: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.strokeRect");
- j.call(this) || (this.beginPath(), this.rect(x, B, T, H), this.stroke());
- }, _.prototype.clearRect = function(x, B, T, H) {
- if (isNaN(x) || isNaN(B) || isNaN(T) || isNaN(H)) throw Le.error("jsPDF.context2d.clearRect: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.clearRect");
- this.ignoreClearRect || (this.fillStyle = "#ffffff", this.fillRect(x, B, T, H));
- }, _.prototype.save = function(x) {
- x = typeof x != "boolean" || x;
- for (var B = this.pdf.internal.getCurrentPageInfo().pageNumber, T = 0; T < this.pdf.internal.getNumberOfPages(); T++) this.pdf.setPage(T + 1), this.pdf.internal.out("q");
- if (this.pdf.setPage(B), x) {
- this.ctx.fontSize = this.pdf.internal.getFontSize();
- var H = new m(this.ctx);
- this.ctxStack.push(this.ctx), this.ctx = H;
- }
- }, _.prototype.restore = function(x) {
- x = typeof x != "boolean" || x;
- for (var B = this.pdf.internal.getCurrentPageInfo().pageNumber, T = 0; T < this.pdf.internal.getNumberOfPages(); T++) this.pdf.setPage(T + 1), this.pdf.internal.out("Q");
- this.pdf.setPage(B), x && this.ctxStack.length !== 0 && (this.ctx = this.ctxStack.pop(), this.fillStyle = this.ctx.fillStyle, this.strokeStyle = this.ctx.strokeStyle, this.font = this.ctx.font, this.lineCap = this.ctx.lineCap, this.lineWidth = this.ctx.lineWidth, this.lineJoin = this.ctx.lineJoin, this.lineDash = this.ctx.lineDash, this.lineDashOffset = this.ctx.lineDashOffset);
- }, _.prototype.toDataURL = function() {
- throw new Error("toDataUrl not implemented.");
- };
- var k = function(x) {
- var B, T, H, J;
- if (x.isCanvasGradient === !0 && (x = x.getColor()), !x) return { r: 0, g: 0, b: 0, a: 0, style: x };
- if (/transparent|rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*0+\s*\)/.test(x)) B = 0, T = 0, H = 0, J = 0;
- else {
- var Z = /rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(x);
- if (Z !== null) B = parseInt(Z[1]), T = parseInt(Z[2]), H = parseInt(Z[3]), J = 1;
- else if ((Z = /rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)/.exec(x)) !== null) B = parseInt(Z[1]), T = parseInt(Z[2]), H = parseInt(Z[3]), J = parseFloat(Z[4]);
- else {
- if (J = 1, typeof x == "string" && x.charAt(0) !== "#") {
- var at = new kh(x);
- x = at.ok ? at.toHex() : "#000000";
- }
- x.length === 4 ? (B = x.substring(1, 2), B += B, T = x.substring(2, 3), T += T, H = x.substring(3, 4), H += H) : (B = x.substring(1, 3), T = x.substring(3, 5), H = x.substring(5, 7)), B = parseInt(B, 16), T = parseInt(T, 16), H = parseInt(H, 16);
- }
- }
- return { r: B, g: T, b: H, a: J, style: x };
- }, p = function() {
- return this.ctx.isFillTransparent || this.globalAlpha == 0;
- }, j = function() {
- return !!(this.ctx.isStrokeTransparent || this.globalAlpha == 0);
- };
- _.prototype.fillText = function(x, B, T, H) {
- if (isNaN(B) || isNaN(T) || typeof x != "string") throw Le.error("jsPDF.context2d.fillText: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.fillText");
- if (H = isNaN(H) ? void 0 : H, !p.call(this)) {
- var J = nt(this.ctx.transform.rotation), Z = this.ctx.transform.scaleX;
- E.call(this, { text: x, x: B, y: T, scale: Z, angle: J, align: this.textAlign, maxWidth: H });
- }
- }, _.prototype.strokeText = function(x, B, T, H) {
- if (isNaN(B) || isNaN(T) || typeof x != "string") throw Le.error("jsPDF.context2d.strokeText: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.strokeText");
- if (!j.call(this)) {
- H = isNaN(H) ? void 0 : H;
- var J = nt(this.ctx.transform.rotation), Z = this.ctx.transform.scaleX;
- E.call(this, { text: x, x: B, y: T, scale: Z, renderingMode: "stroke", angle: J, align: this.textAlign, maxWidth: H });
- }
- }, _.prototype.measureText = function(x) {
- if (typeof x != "string") throw Le.error("jsPDF.context2d.measureText: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.measureText");
- var B = this.pdf, T = this.pdf.internal.scaleFactor, H = B.internal.getFontSize(), J = B.getStringUnitWidth(x) * H / B.internal.scaleFactor;
- return new function(Z) {
- var at = (Z = Z || {}).width || 0;
- return Object.defineProperty(this, "width", { get: function() {
- return at;
- } }), this;
- }({ width: J *= Math.round(96 * T / 72 * 1e4) / 1e4 });
- }, _.prototype.scale = function(x, B) {
- if (isNaN(x) || isNaN(B)) throw Le.error("jsPDF.context2d.scale: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.scale");
- var T = new f(x, 0, 0, B, 0, 0);
- this.ctx.transform = this.ctx.transform.multiply(T);
- }, _.prototype.rotate = function(x) {
- if (isNaN(x)) throw Le.error("jsPDF.context2d.rotate: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.rotate");
- var B = new f(Math.cos(x), Math.sin(x), -Math.sin(x), Math.cos(x), 0, 0);
- this.ctx.transform = this.ctx.transform.multiply(B);
- }, _.prototype.translate = function(x, B) {
- if (isNaN(x) || isNaN(B)) throw Le.error("jsPDF.context2d.translate: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.translate");
- var T = new f(1, 0, 0, 1, x, B);
- this.ctx.transform = this.ctx.transform.multiply(T);
- }, _.prototype.transform = function(x, B, T, H, J, Z) {
- if (isNaN(x) || isNaN(B) || isNaN(T) || isNaN(H) || isNaN(J) || isNaN(Z)) throw Le.error("jsPDF.context2d.transform: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.transform");
- var at = new f(x, B, T, H, J, Z);
- this.ctx.transform = this.ctx.transform.multiply(at);
- }, _.prototype.setTransform = function(x, B, T, H, J, Z) {
- x = isNaN(x) ? 1 : x, B = isNaN(B) ? 0 : B, T = isNaN(T) ? 0 : T, H = isNaN(H) ? 1 : H, J = isNaN(J) ? 0 : J, Z = isNaN(Z) ? 0 : Z, this.ctx.transform = new f(x, B, T, H, J, Z);
- };
- var O = function() {
- return this.margin[0] > 0 || this.margin[1] > 0 || this.margin[2] > 0 || this.margin[3] > 0;
- };
- _.prototype.drawImage = function(x, B, T, H, J, Z, at, st, gt) {
- var _t = this.pdf.getImageProperties(x), kt = 1, St = 1, Dt = 1, P = 1;
- H !== void 0 && st !== void 0 && (Dt = st / H, P = gt / J, kt = _t.width / H * st / H, St = _t.height / J * gt / J), Z === void 0 && (Z = B, at = T, B = 0, T = 0), H !== void 0 && st === void 0 && (st = H, gt = J), H === void 0 && st === void 0 && (st = _t.width, gt = _t.height);
- var Lt = this.ctx.transform.decompose(), ae = nt(Lt.rotate.shx), Ht = new f(), yt = (Ht = (Ht = (Ht = Ht.multiply(Lt.translate)).multiply(Lt.skew)).multiply(Lt.scale)).applyToRectangle(new l(Z - B * Dt, at - T * P, H * kt, J * St));
- if (this.autoPaging) {
- for (var Wt, It = M.call(this, yt), zt = [], qt = 0; qt < It.length; qt += 1) zt.indexOf(It[qt]) === -1 && zt.push(It[qt]);
- G(zt);
- for (var ve = zt[0], ue = zt[zt.length - 1], Zt = ve; Zt < ue + 1; Zt++) {
- this.pdf.setPage(Zt);
- var fe = this.pdf.internal.pageSize.width - this.margin[3] - this.margin[1], he = Zt === 1 ? this.posY + this.margin[0] : this.margin[0], Bt = this.pdf.internal.pageSize.height - this.posY - this.margin[0] - this.margin[2], ne = this.pdf.internal.pageSize.height - this.margin[0] - this.margin[2], Rt = Zt === 1 ? 0 : Bt + (Zt - 2) * ne;
- if (this.ctx.clip_path.length !== 0) {
- var He = this.path;
- Wt = JSON.parse(JSON.stringify(this.ctx.clip_path)), this.path = V(Wt, this.posX + this.margin[3], -Rt + he + this.ctx.prevPageLastElemOffset), it.call(this, "fill", !0), this.path = He;
- }
- var ge = JSON.parse(JSON.stringify(yt));
- ge = V([ge], this.posX + this.margin[3], -Rt + he + this.ctx.prevPageLastElemOffset)[0];
- var se = (Zt > ve || Zt < ue) && O.call(this);
- se && (this.pdf.saveGraphicsState(), this.pdf.rect(this.margin[3], this.margin[0], fe, ne, null).clip().discardPath()), this.pdf.addImage(x, "JPEG", ge.x, ge.y, ge.w, ge.h, null, null, ae), se && this.pdf.restoreGraphicsState();
- }
- } else this.pdf.addImage(x, "JPEG", yt.x, yt.y, yt.w, yt.h, null, null, ae);
- };
- var M = function(x, B, T) {
- var H = [];
- B = B || this.pdf.internal.pageSize.width, T = T || this.pdf.internal.pageSize.height - this.margin[0] - this.margin[2];
- var J = this.posY + this.ctx.prevPageLastElemOffset;
- switch (x.type) {
- default:
- case "mt":
- case "lt":
- H.push(Math.floor((x.y + J) / T) + 1);
- break;
- case "arc":
- H.push(Math.floor((x.y + J - x.radius) / T) + 1), H.push(Math.floor((x.y + J + x.radius) / T) + 1);
- break;
- case "qct":
- var Z = ct(this.ctx.lastPoint.x, this.ctx.lastPoint.y, x.x1, x.y1, x.x, x.y);
- H.push(Math.floor((Z.y + J) / T) + 1), H.push(Math.floor((Z.y + Z.h + J) / T) + 1);
- break;
- case "bct":
- var at = At(this.ctx.lastPoint.x, this.ctx.lastPoint.y, x.x1, x.y1, x.x2, x.y2, x.x, x.y);
- H.push(Math.floor((at.y + J) / T) + 1), H.push(Math.floor((at.y + at.h + J) / T) + 1);
- break;
- case "rect":
- H.push(Math.floor((x.y + J) / T) + 1), H.push(Math.floor((x.y + x.h + J) / T) + 1);
- }
- for (var st = 0; st < H.length; st += 1) for (; this.pdf.internal.getNumberOfPages() < H[st]; ) S.call(this);
- return H;
- }, S = function() {
- var x = this.fillStyle, B = this.strokeStyle, T = this.font, H = this.lineCap, J = this.lineWidth, Z = this.lineJoin;
- this.pdf.addPage(), this.fillStyle = x, this.strokeStyle = B, this.font = T, this.lineCap = H, this.lineWidth = J, this.lineJoin = Z;
- }, V = function(x, B, T) {
- for (var H = 0; H < x.length; H++) switch (x[H].type) {
- case "bct":
- x[H].x2 += B, x[H].y2 += T;
- case "qct":
- x[H].x1 += B, x[H].y1 += T;
- default:
- x[H].x += B, x[H].y += T;
- }
- return x;
- }, G = function(x) {
- return x.sort(function(B, T) {
- return B - T;
- });
- }, q = function(x, B) {
- var T = this.fillStyle, H = this.strokeStyle, J = this.lineCap, Z = this.lineWidth, at = Math.abs(Z * this.ctx.transform.scaleX), st = this.lineJoin;
- if (this.autoPaging) {
- for (var gt, _t, kt = JSON.parse(JSON.stringify(this.path)), St = JSON.parse(JSON.stringify(this.path)), Dt = [], P = 0; P < St.length; P++) if (St[P].x !== void 0) for (var Lt = M.call(this, St[P]), ae = 0; ae < Lt.length; ae += 1) Dt.indexOf(Lt[ae]) === -1 && Dt.push(Lt[ae]);
- for (var Ht = 0; Ht < Dt.length; Ht++) for (; this.pdf.internal.getNumberOfPages() < Dt[Ht]; ) S.call(this);
- G(Dt);
- for (var yt = Dt[0], Wt = Dt[Dt.length - 1], It = yt; It < Wt + 1; It++) {
- this.pdf.setPage(It), this.fillStyle = T, this.strokeStyle = H, this.lineCap = J, this.lineWidth = at, this.lineJoin = st;
- var zt = this.pdf.internal.pageSize.width - this.margin[3] - this.margin[1], qt = It === 1 ? this.posY + this.margin[0] : this.margin[0], ve = this.pdf.internal.pageSize.height - this.posY - this.margin[0] - this.margin[2], ue = this.pdf.internal.pageSize.height - this.margin[0] - this.margin[2], Zt = It === 1 ? 0 : ve + (It - 2) * ue;
- if (this.ctx.clip_path.length !== 0) {
- var fe = this.path;
- gt = JSON.parse(JSON.stringify(this.ctx.clip_path)), this.path = V(gt, this.posX + this.margin[3], -Zt + qt + this.ctx.prevPageLastElemOffset), it.call(this, x, !0), this.path = fe;
- }
- if (_t = JSON.parse(JSON.stringify(kt)), this.path = V(_t, this.posX + this.margin[3], -Zt + qt + this.ctx.prevPageLastElemOffset), B === !1 || It === 0) {
- var he = (It > yt || It < Wt) && O.call(this);
- he && (this.pdf.saveGraphicsState(), this.pdf.rect(this.margin[3], this.margin[0], zt, ue, null).clip().discardPath()), it.call(this, x, B), he && this.pdf.restoreGraphicsState();
- }
- this.lineWidth = Z;
- }
- this.path = kt;
- } else this.lineWidth = at, it.call(this, x, B), this.lineWidth = Z;
- }, it = function(x, B) {
- if ((x !== "stroke" || B || !j.call(this)) && (x === "stroke" || B || !p.call(this))) {
- for (var T, H, J = [], Z = this.path, at = 0; at < Z.length; at++) {
- var st = Z[at];
- switch (st.type) {
- case "begin":
- J.push({ begin: !0 });
- break;
- case "close":
- J.push({ close: !0 });
- break;
- case "mt":
- J.push({ start: st, deltas: [], abs: [] });
- break;
- case "lt":
- var gt = J.length;
- if (Z[at - 1] && !isNaN(Z[at - 1].x) && (T = [st.x - Z[at - 1].x, st.y - Z[at - 1].y], gt > 0)) {
- for (; gt >= 0; gt--) if (J[gt - 1].close !== !0 && J[gt - 1].begin !== !0) {
- J[gt - 1].deltas.push(T), J[gt - 1].abs.push(st);
- break;
- }
- }
- break;
- case "bct":
- T = [st.x1 - Z[at - 1].x, st.y1 - Z[at - 1].y, st.x2 - Z[at - 1].x, st.y2 - Z[at - 1].y, st.x - Z[at - 1].x, st.y - Z[at - 1].y], J[J.length - 1].deltas.push(T);
- break;
- case "qct":
- var _t = Z[at - 1].x + 2 / 3 * (st.x1 - Z[at - 1].x), kt = Z[at - 1].y + 2 / 3 * (st.y1 - Z[at - 1].y), St = st.x + 2 / 3 * (st.x1 - st.x), Dt = st.y + 2 / 3 * (st.y1 - st.y), P = st.x, Lt = st.y;
- T = [_t - Z[at - 1].x, kt - Z[at - 1].y, St - Z[at - 1].x, Dt - Z[at - 1].y, P - Z[at - 1].x, Lt - Z[at - 1].y], J[J.length - 1].deltas.push(T);
- break;
- case "arc":
- J.push({ deltas: [], abs: [], arc: !0 }), Array.isArray(J[J.length - 1].abs) && J[J.length - 1].abs.push(st);
- }
- }
- H = B ? null : x === "stroke" ? "stroke" : "fill";
- for (var ae = !1, Ht = 0; Ht < J.length; Ht++) if (J[Ht].arc) for (var yt = J[Ht].abs, Wt = 0; Wt < yt.length; Wt++) {
- var It = yt[Wt];
- It.type === "arc" ? X.call(this, It.x, It.y, It.radius, It.startAngle, It.endAngle, It.counterclockwise, void 0, B, !ae) : z.call(this, It.x, It.y), ae = !0;
- }
- else if (J[Ht].close === !0) this.pdf.internal.out("h"), ae = !1;
- else if (J[Ht].begin !== !0) {
- var zt = J[Ht].start.x, qt = J[Ht].start.y;
- U.call(this, J[Ht].deltas, zt, qt), ae = !0;
- }
- H && R.call(this, H), B && tt.call(this);
- }
- }, vt = function(x) {
- var B = this.pdf.internal.getFontSize() / this.pdf.internal.scaleFactor, T = B * (this.pdf.internal.getLineHeightFactor() - 1);
- switch (this.ctx.textBaseline) {
- case "bottom":
- return x - T;
- case "top":
- return x + B - T;
- case "hanging":
- return x + B - 2 * T;
- case "middle":
- return x + B / 2 - T;
- default:
- return x;
- }
- }, dt = function(x) {
- return x + this.pdf.internal.getFontSize() / this.pdf.internal.scaleFactor * (this.pdf.internal.getLineHeightFactor() - 1);
- };
- _.prototype.createLinearGradient = function() {
- var x = function() {
- };
- return x.colorStops = [], x.addColorStop = function(B, T) {
- this.colorStops.push([B, T]);
- }, x.getColor = function() {
- return this.colorStops.length === 0 ? "#000000" : this.colorStops[0][1];
- }, x.isCanvasGradient = !0, x;
- }, _.prototype.createPattern = function() {
- return this.createLinearGradient();
- }, _.prototype.createRadialGradient = function() {
- return this.createLinearGradient();
- };
- var X = function(x, B, T, H, J, Z, at, st, gt) {
- for (var _t = ot.call(this, T, H, J, Z), kt = 0; kt < _t.length; kt++) {
- var St = _t[kt];
- kt === 0 && (gt ? N.call(this, St.x1 + x, St.y1 + B) : z.call(this, St.x1 + x, St.y1 + B)), rt.call(this, x, B, St.x2, St.y2, St.x3, St.y3, St.x4, St.y4);
- }
- st ? tt.call(this) : R.call(this, at);
- }, R = function(x) {
- switch (x) {
- case "stroke":
- this.pdf.internal.out("S");
- break;
- case "fill":
- this.pdf.internal.out("f");
- }
- }, tt = function() {
- this.pdf.clip(), this.pdf.discardPath();
- }, N = function(x, B) {
- this.pdf.internal.out(t(x) + " " + i(B) + " m");
- }, E = function(x) {
- var B;
- switch (x.align) {
- case "right":
- case "end":
- B = "right";
- break;
- case "center":
- B = "center";
- break;
- default:
- B = "left";
- }
- var T, H, J, Z = this.pdf.getTextDimensions(x.text), at = vt.call(this, x.y), st = dt.call(this, at) - Z.h, gt = this.ctx.transform.applyToPoint(new c(x.x, at));
- if (this.autoPaging) {
- var _t = this.ctx.transform.decompose(), kt = new f();
- kt = (kt = (kt = kt.multiply(_t.translate)).multiply(_t.skew)).multiply(_t.scale);
- for (var St = this.ctx.transform.applyToRectangle(new l(x.x, at, Z.w, Z.h)), Dt = kt.applyToRectangle(new l(x.x, st, Z.w, Z.h)), P = M.call(this, Dt), Lt = [], ae = 0; ae < P.length; ae += 1) Lt.indexOf(P[ae]) === -1 && Lt.push(P[ae]);
- G(Lt);
- for (var Ht = Lt[0], yt = Lt[Lt.length - 1], Wt = Ht; Wt < yt + 1; Wt++) {
- this.pdf.setPage(Wt);
- var It = Wt === 1 ? this.posY + this.margin[0] : this.margin[0], zt = this.pdf.internal.pageSize.height - this.posY - this.margin[0] - this.margin[2], qt = this.pdf.internal.pageSize.height - this.margin[2], ve = qt - this.margin[0], ue = this.pdf.internal.pageSize.width - this.margin[1], Zt = ue - this.margin[3], fe = Wt === 1 ? 0 : zt + (Wt - 2) * ve;
- if (this.ctx.clip_path.length !== 0) {
- var he = this.path;
- T = JSON.parse(JSON.stringify(this.ctx.clip_path)), this.path = V(T, this.posX + this.margin[3], -1 * fe + It), it.call(this, "fill", !0), this.path = he;
- }
- var Bt = V([JSON.parse(JSON.stringify(Dt))], this.posX + this.margin[3], -fe + It + this.ctx.prevPageLastElemOffset)[0];
- x.scale >= 0.01 && (H = this.pdf.internal.getFontSize(), this.pdf.setFontSize(H * x.scale), J = this.lineWidth, this.lineWidth = J * x.scale);
- var ne = this.autoPaging !== "text";
- if (ne || Bt.y + Bt.h <= qt) {
- if (ne || Bt.y >= It && Bt.x <= ue) {
- var Rt = ne ? x.text : this.pdf.splitTextToSize(x.text, x.maxWidth || ue - Bt.x)[0], He = V([JSON.parse(JSON.stringify(St))], this.posX + this.margin[3], -fe + It + this.ctx.prevPageLastElemOffset)[0], ge = ne && (Wt > Ht || Wt < yt) && O.call(this);
- ge && (this.pdf.saveGraphicsState(), this.pdf.rect(this.margin[3], this.margin[0], Zt, ve, null).clip().discardPath()), this.pdf.text(Rt, He.x, He.y, { angle: x.angle, align: B, renderingMode: x.renderingMode }), ge && this.pdf.restoreGraphicsState();
- }
- } else Bt.y < qt && (this.ctx.prevPageLastElemOffset += qt - Bt.y);
- x.scale >= 0.01 && (this.pdf.setFontSize(H), this.lineWidth = J);
- }
- } else x.scale >= 0.01 && (H = this.pdf.internal.getFontSize(), this.pdf.setFontSize(H * x.scale), J = this.lineWidth, this.lineWidth = J * x.scale), this.pdf.text(x.text, gt.x + this.posX, gt.y + this.posY, { angle: x.angle, align: B, renderingMode: x.renderingMode, maxWidth: x.maxWidth }), x.scale >= 0.01 && (this.pdf.setFontSize(H), this.lineWidth = J);
- }, z = function(x, B, T, H) {
- T = T || 0, H = H || 0, this.pdf.internal.out(t(x + T) + " " + i(B + H) + " l");
- }, U = function(x, B, T) {
- return this.pdf.lines(x, B, T, null, null);
- }, rt = function(x, B, T, H, J, Z, at, st) {
- this.pdf.internal.out([e(s(T + x)), e(a(H + B)), e(s(J + x)), e(a(Z + B)), e(s(at + x)), e(a(st + B)), "c"].join(" "));
- }, ot = function(x, B, T, H) {
- for (var J = 2 * Math.PI, Z = Math.PI / 2; B > T; ) B -= J;
- var at = Math.abs(T - B);
- at < J && H && (at = J - at);
- for (var st = [], gt = H ? -1 : 1, _t = B; at > 1e-5; ) {
- var kt = _t + gt * Math.min(at, Z);
- st.push(ht.call(this, x, _t, kt)), at -= Math.abs(kt - _t), _t = kt;
- }
- return st;
- }, ht = function(x, B, T) {
- var H = (T - B) / 2, J = x * Math.cos(H), Z = x * Math.sin(H), at = J, st = -Z, gt = at * at + st * st, _t = gt + at * J + st * Z, kt = 4 / 3 * (Math.sqrt(2 * gt * _t) - _t) / (at * Z - st * J), St = at - kt * st, Dt = st + kt * at, P = St, Lt = -Dt, ae = H + B, Ht = Math.cos(ae), yt = Math.sin(ae);
- return { x1: x * Math.cos(B), y1: x * Math.sin(B), x2: St * Ht - Dt * yt, y2: St * yt + Dt * Ht, x3: P * Ht - Lt * yt, y3: P * yt + Lt * Ht, x4: x * Math.cos(T), y4: x * Math.sin(T) };
- }, nt = function(x) {
- return 180 * x / Math.PI;
- }, ct = function(x, B, T, H, J, Z) {
- var at = x + 0.5 * (T - x), st = B + 0.5 * (H - B), gt = J + 0.5 * (T - J), _t = Z + 0.5 * (H - Z), kt = Math.min(x, J, at, gt), St = Math.max(x, J, at, gt), Dt = Math.min(B, Z, st, _t), P = Math.max(B, Z, st, _t);
- return new l(kt, Dt, St - kt, P - Dt);
- }, At = function(x, B, T, H, J, Z, at, st) {
- var gt, _t, kt, St, Dt, P, Lt, ae, Ht, yt, Wt, It, zt, qt, ve = T - x, ue = H - B, Zt = J - T, fe = Z - H, he = at - J, Bt = st - Z;
- for (_t = 0; _t < 41; _t++) Ht = (Lt = (kt = x + (gt = _t / 40) * ve) + gt * ((Dt = T + gt * Zt) - kt)) + gt * (Dt + gt * (J + gt * he - Dt) - Lt), yt = (ae = (St = B + gt * ue) + gt * ((P = H + gt * fe) - St)) + gt * (P + gt * (Z + gt * Bt - P) - ae), _t == 0 ? (Wt = Ht, It = yt, zt = Ht, qt = yt) : (Wt = Math.min(Wt, Ht), It = Math.min(It, yt), zt = Math.max(zt, Ht), qt = Math.max(qt, yt));
- return new l(Math.round(Wt), Math.round(It), Math.round(zt - Wt), Math.round(qt - It));
- }, wt = function() {
- if (this.prevLineDash || this.ctx.lineDash.length || this.ctx.lineDashOffset) {
- var x, B, T = (x = this.ctx.lineDash, B = this.ctx.lineDashOffset, JSON.stringify({ lineDash: x, lineDashOffset: B }));
- this.prevLineDash !== T && (this.pdf.setLineDash(this.ctx.lineDash, this.ctx.lineDashOffset), this.prevLineDash = T);
- }
- };
- })(Tt.API), /**
- * @license
- * jsPDF filters PlugIn
- * Copyright (c) 2014 Aras Abbasi
- *
- * Licensed under the MIT License.
- * http://opensource.org/licenses/mit-license
- */
- function(n) {
- var e = function(c) {
- var l, f, d, m, _, k, p, j, O, M;
- for (f = [], d = 0, m = (c += l = "\0\0\0\0".slice(c.length % 4 || 4)).length; m > d; d += 4) (_ = (c.charCodeAt(d) << 24) + (c.charCodeAt(d + 1) << 16) + (c.charCodeAt(d + 2) << 8) + c.charCodeAt(d + 3)) !== 0 ? (k = (_ = ((_ = ((_ = ((_ = (_ - (M = _ % 85)) / 85) - (O = _ % 85)) / 85) - (j = _ % 85)) / 85) - (p = _ % 85)) / 85) % 85, f.push(k + 33, p + 33, j + 33, O + 33, M + 33)) : f.push(122);
- return function(S, V) {
- for (var G = V; G > 0; G--) S.pop();
- }(f, l.length), String.fromCharCode.apply(String, f) + "~>";
- }, t = function(c) {
- var l, f, d, m, _, k = String, p = "length", j = 255, O = "charCodeAt", M = "slice", S = "replace";
- for (c[M](-2), c = c[M](0, -2)[S](/\s/g, "")[S]("z", "!!!!!"), d = [], m = 0, _ = (c += l = "uuuuu"[M](c[p] % 5 || 5))[p]; _ > m; m += 5) f = 52200625 * (c[O](m) - 33) + 614125 * (c[O](m + 1) - 33) + 7225 * (c[O](m + 2) - 33) + 85 * (c[O](m + 3) - 33) + (c[O](m + 4) - 33), d.push(j & f >> 24, j & f >> 16, j & f >> 8, j & f);
- return function(V, G) {
- for (var q = G; q > 0; q--) V.pop();
- }(d, l[p]), k.fromCharCode.apply(k, d);
- }, i = function(c) {
- return c.split("").map(function(l) {
- return ("0" + l.charCodeAt().toString(16)).slice(-2);
- }).join("") + ">";
- }, s = function(c) {
- var l = new RegExp(/^([0-9A-Fa-f]{2})+$/);
- if ((c = c.replace(/\s/g, "")).indexOf(">") !== -1 && (c = c.substr(0, c.indexOf(">"))), c.length % 2 && (c += "0"), l.test(c) === !1) return "";
- for (var f = "", d = 0; d < c.length; d += 2) f += String.fromCharCode("0x" + (c[d] + c[d + 1]));
- return f;
- }, a = function(c) {
- for (var l = new Uint8Array(c.length), f = c.length; f--; ) l[f] = c.charCodeAt(f);
- return (l = Uo(l)).reduce(function(d, m) {
- return d + String.fromCharCode(m);
- }, "");
- };
- n.processDataByFilters = function(c, l) {
- var f = 0, d = c || "", m = [];
- for (typeof (l = l || []) == "string" && (l = [l]), f = 0; f < l.length; f += 1) switch (l[f]) {
- case "ASCII85Decode":
- case "/ASCII85Decode":
- d = t(d), m.push("/ASCII85Encode");
- break;
- case "ASCII85Encode":
- case "/ASCII85Encode":
- d = e(d), m.push("/ASCII85Decode");
- break;
- case "ASCIIHexDecode":
- case "/ASCIIHexDecode":
- d = s(d), m.push("/ASCIIHexEncode");
- break;
- case "ASCIIHexEncode":
- case "/ASCIIHexEncode":
- d = i(d), m.push("/ASCIIHexDecode");
- break;
- case "FlateEncode":
- case "/FlateEncode":
- d = a(d), m.push("/FlateDecode");
- break;
- default:
- throw new Error('The filter: "' + l[f] + '" is not implemented');
- }
- return { data: d, reverseChain: m.reverse().join(" ") };
- };
- }(Tt.API), /**
- * @license
- * jsPDF fileloading PlugIn
- * Copyright (c) 2018 Aras Abbasi (aras.abbasi@gmail.com)
- *
- * Licensed under the MIT License.
- * http://opensource.org/licenses/mit-license
- */
- function(n) {
- n.loadFile = function(e, t, i) {
- return function(s, a, c) {
- a = a !== !1, c = typeof c == "function" ? c : function() {
- };
- var l = void 0;
- try {
- l = function(f, d, m) {
- var _ = new XMLHttpRequest(), k = 0, p = function(j) {
- var O = j.length, M = [], S = String.fromCharCode;
- for (k = 0; k < O; k += 1) M.push(S(255 & j.charCodeAt(k)));
- return M.join("");
- };
- if (_.open("GET", f, !d), _.overrideMimeType("text/plain; charset=x-user-defined"), d === !1 && (_.onload = function() {
- _.status === 200 ? m(p(this.responseText)) : m(void 0);
- }), _.send(null), d && _.status === 200) return p(_.responseText);
- }(s, a, c);
- } catch (f) {
- }
- return l;
- }(e, t, i);
- }, n.allowFsRead = void 0, n.loadImageFile = n.loadFile;
- }(Tt.API), function(n) {
- function e() {
- return (Kt.html2canvas ? Promise.resolve(Kt.html2canvas) : import("./html2canvas.esm.js")).catch(function(l) {
- return Promise.reject(new Error("Could not load html2canvas: " + l));
- }).then(function(l) {
- return l.default ? l.default : l;
- });
- }
- function t() {
- return (Kt.DOMPurify ? Promise.resolve(Kt.DOMPurify) : import("./purify.es.js")).catch(function(l) {
- return Promise.reject(new Error("Could not load dompurify: " + l));
- }).then(function(l) {
- return l.default ? l.default : l;
- });
- }
- var i = function(l) {
- var f = Se(l);
- return f === "undefined" ? "undefined" : f === "string" || l instanceof String ? "string" : f === "number" || l instanceof Number ? "number" : f === "function" || l instanceof Function ? "function" : l && l.constructor === Array ? "array" : l && l.nodeType === 1 ? "element" : f === "object" ? "object" : "unknown";
- }, s = function(l, f) {
- var d = document.createElement(l);
- for (var m in f.className && (d.className = f.className), f.innerHTML && f.dompurify && (d.innerHTML = f.dompurify.sanitize(f.innerHTML)), f.style) d.style[m] = f.style[m];
- return d;
- }, a = function l(f, d) {
- for (var m = f.nodeType === 3 ? document.createTextNode(f.nodeValue) : f.cloneNode(!1), _ = f.firstChild; _; _ = _.nextSibling) d !== !0 && _.nodeType === 1 && _.nodeName === "SCRIPT" || m.appendChild(l(_, d));
- return f.nodeType === 1 && (f.nodeName === "CANVAS" ? (m.width = f.width, m.height = f.height, m.getContext("2d").drawImage(f, 0, 0)) : f.nodeName !== "TEXTAREA" && f.nodeName !== "SELECT" || (m.value = f.value), m.addEventListener("load", function() {
- m.scrollTop = f.scrollTop, m.scrollLeft = f.scrollLeft;
- }, !0)), m;
- }, c = function l(f) {
- var d = Object.assign(l.convert(Promise.resolve()), JSON.parse(JSON.stringify(l.template))), m = l.convert(Promise.resolve(), d);
- return (m = m.setProgress(1, l, 1, [l])).set(f);
- };
- (c.prototype = Object.create(Promise.prototype)).constructor = c, c.convert = function(l, f) {
- return l.__proto__ = f || c.prototype, l;
- }, c.template = { prop: { src: null, container: null, overlay: null, canvas: null, img: null, pdf: null, pageSize: null, callback: function() {
- } }, progress: { val: 0, state: null, n: 0, stack: [] }, opt: { filename: "file.pdf", margin: [0, 0, 0, 0], enableLinks: !0, x: 0, y: 0, html2canvas: {}, jsPDF: {}, backgroundColor: "transparent" } }, c.prototype.from = function(l, f) {
- return this.then(function() {
- switch (f = f || function(d) {
- switch (i(d)) {
- case "string":
- return "string";
- case "element":
- return d.nodeName.toLowerCase() === "canvas" ? "canvas" : "element";
- default:
- return "unknown";
- }
- }(l), f) {
- case "string":
- return this.then(t).then(function(d) {
- return this.set({ src: s("div", { innerHTML: l, dompurify: d }) });
- });
- case "element":
- return this.set({ src: l });
- case "canvas":
- return this.set({ canvas: l });
- case "img":
- return this.set({ img: l });
- default:
- return this.error("Unknown source type.");
- }
- });
- }, c.prototype.to = function(l) {
- switch (l) {
- case "container":
- return this.toContainer();
- case "canvas":
- return this.toCanvas();
- case "img":
- return this.toImg();
- case "pdf":
- return this.toPdf();
- default:
- return this.error("Invalid target.");
- }
- }, c.prototype.toContainer = function() {
- return this.thenList([function() {
- return this.prop.src || this.error("Cannot duplicate - no source HTML.");
- }, function() {
- return this.prop.pageSize || this.setPageSize();
- }]).then(function() {
- var l = { position: "relative", display: "inline-block", width: (typeof this.opt.width != "number" || isNaN(this.opt.width) || typeof this.opt.windowWidth != "number" || isNaN(this.opt.windowWidth) ? Math.max(this.prop.src.clientWidth, this.prop.src.scrollWidth, this.prop.src.offsetWidth) : this.opt.windowWidth) + "px", left: 0, right: 0, top: 0, margin: "auto", backgroundColor: this.opt.backgroundColor }, f = a(this.prop.src, this.opt.html2canvas.javascriptEnabled);
- f.tagName === "BODY" && (l.height = Math.max(document.body.scrollHeight, document.body.offsetHeight, document.documentElement.clientHeight, document.documentElement.scrollHeight, document.documentElement.offsetHeight) + "px"), this.prop.overlay = s("div", { className: "html2pdf__overlay", style: { position: "fixed", overflow: "hidden", zIndex: 1e3, left: "-100000px", right: 0, bottom: 0, top: 0 } }), this.prop.container = s("div", { className: "html2pdf__container", style: l }), this.prop.container.appendChild(f), this.prop.container.firstChild.appendChild(s("div", { style: { clear: "both", border: "0 none transparent", margin: 0, padding: 0, height: 0 } })), this.prop.container.style.float = "none", this.prop.overlay.appendChild(this.prop.container), document.body.appendChild(this.prop.overlay), this.prop.container.firstChild.style.position = "relative", this.prop.container.height = Math.max(this.prop.container.firstChild.clientHeight, this.prop.container.firstChild.scrollHeight, this.prop.container.firstChild.offsetHeight) + "px";
- });
- }, c.prototype.toCanvas = function() {
- var l = [function() {
- return document.body.contains(this.prop.container) || this.toContainer();
- }];
- return this.thenList(l).then(e).then(function(f) {
- var d = Object.assign({}, this.opt.html2canvas);
- return delete d.onrendered, f(this.prop.container, d);
- }).then(function(f) {
- (this.opt.html2canvas.onrendered || function() {
- })(f), this.prop.canvas = f, document.body.removeChild(this.prop.overlay);
- });
- }, c.prototype.toContext2d = function() {
- var l = [function() {
- return document.body.contains(this.prop.container) || this.toContainer();
- }];
- return this.thenList(l).then(e).then(function(f) {
- var d = this.opt.jsPDF, m = this.opt.fontFaces, _ = typeof this.opt.width != "number" || isNaN(this.opt.width) || typeof this.opt.windowWidth != "number" || isNaN(this.opt.windowWidth) ? 1 : this.opt.width / this.opt.windowWidth, k = Object.assign({ async: !0, allowTaint: !0, scale: _, scrollX: this.opt.scrollX || 0, scrollY: this.opt.scrollY || 0, backgroundColor: "#ffffff", imageTimeout: 15e3, logging: !0, proxy: null, removeContainer: !0, foreignObjectRendering: !1, useCORS: !1 }, this.opt.html2canvas);
- if (delete k.onrendered, d.context2d.autoPaging = this.opt.autoPaging === void 0 || this.opt.autoPaging, d.context2d.posX = this.opt.x, d.context2d.posY = this.opt.y, d.context2d.margin = this.opt.margin, d.context2d.fontFaces = m, m) for (var p = 0; p < m.length; ++p) {
- var j = m[p], O = j.src.find(function(M) {
- return M.format === "truetype";
- });
- O && d.addFont(O.url, j.ref.name, j.ref.style);
- }
- return k.windowHeight = k.windowHeight || 0, k.windowHeight = k.windowHeight == 0 ? Math.max(this.prop.container.clientHeight, this.prop.container.scrollHeight, this.prop.container.offsetHeight) : k.windowHeight, d.context2d.save(!0), f(this.prop.container, k);
- }).then(function(f) {
- this.opt.jsPDF.context2d.restore(!0), (this.opt.html2canvas.onrendered || function() {
- })(f), this.prop.canvas = f, document.body.removeChild(this.prop.overlay);
- });
- }, c.prototype.toImg = function() {
- return this.thenList([function() {
- return this.prop.canvas || this.toCanvas();
- }]).then(function() {
- var l = this.prop.canvas.toDataURL("image/" + this.opt.image.type, this.opt.image.quality);
- this.prop.img = document.createElement("img"), this.prop.img.src = l;
- });
- }, c.prototype.toPdf = function() {
- return this.thenList([function() {
- return this.toContext2d();
- }]).then(function() {
- this.prop.pdf = this.prop.pdf || this.opt.jsPDF;
- });
- }, c.prototype.output = function(l, f, d) {
- return (d = d || "pdf").toLowerCase() === "img" || d.toLowerCase() === "image" ? this.outputImg(l, f) : this.outputPdf(l, f);
- }, c.prototype.outputPdf = function(l, f) {
- return this.thenList([function() {
- return this.prop.pdf || this.toPdf();
- }]).then(function() {
- return this.prop.pdf.output(l, f);
- });
- }, c.prototype.outputImg = function(l) {
- return this.thenList([function() {
- return this.prop.img || this.toImg();
- }]).then(function() {
- switch (l) {
- case void 0:
- case "img":
- return this.prop.img;
- case "datauristring":
- case "dataurlstring":
- return this.prop.img.src;
- case "datauri":
- case "dataurl":
- return document.location.href = this.prop.img.src;
- default:
- throw 'Image output type "' + l + '" is not supported.';
- }
- });
- }, c.prototype.save = function(l) {
- return this.thenList([function() {
- return this.prop.pdf || this.toPdf();
- }]).set(l ? { filename: l } : null).then(function() {
- this.prop.pdf.save(this.opt.filename);
- });
- }, c.prototype.doCallback = function() {
- return this.thenList([function() {
- return this.prop.pdf || this.toPdf();
- }]).then(function() {
- this.prop.callback(this.prop.pdf);
- });
- }, c.prototype.set = function(l) {
- if (i(l) !== "object") return this;
- var f = Object.keys(l || {}).map(function(d) {
- if (d in c.template.prop) return function() {
- this.prop[d] = l[d];
- };
- switch (d) {
- case "margin":
- return this.setMargin.bind(this, l.margin);
- case "jsPDF":
- return function() {
- return this.opt.jsPDF = l.jsPDF, this.setPageSize();
- };
- case "pageSize":
- return this.setPageSize.bind(this, l.pageSize);
- default:
- return function() {
- this.opt[d] = l[d];
- };
- }
- }, this);
- return this.then(function() {
- return this.thenList(f);
- });
- }, c.prototype.get = function(l, f) {
- return this.then(function() {
- var d = l in c.template.prop ? this.prop[l] : this.opt[l];
- return f ? f(d) : d;
- });
- }, c.prototype.setMargin = function(l) {
- return this.then(function() {
- switch (i(l)) {
- case "number":
- l = [l, l, l, l];
- case "array":
- if (l.length === 2 && (l = [l[0], l[1], l[0], l[1]]), l.length === 4) break;
- default:
- return this.error("Invalid margin array.");
- }
- this.opt.margin = l;
- }).then(this.setPageSize);
- }, c.prototype.setPageSize = function(l) {
- function f(d, m) {
- return Math.floor(d * m / 72 * 96);
- }
- return this.then(function() {
- (l = l || Tt.getPageSize(this.opt.jsPDF)).hasOwnProperty("inner") || (l.inner = { width: l.width - this.opt.margin[1] - this.opt.margin[3], height: l.height - this.opt.margin[0] - this.opt.margin[2] }, l.inner.px = { width: f(l.inner.width, l.k), height: f(l.inner.height, l.k) }, l.inner.ratio = l.inner.height / l.inner.width), this.prop.pageSize = l;
- });
- }, c.prototype.setProgress = function(l, f, d, m) {
- return l != null && (this.progress.val = l), f != null && (this.progress.state = f), d != null && (this.progress.n = d), m != null && (this.progress.stack = m), this.progress.ratio = this.progress.val / this.progress.state, this;
- }, c.prototype.updateProgress = function(l, f, d, m) {
- return this.setProgress(l ? this.progress.val + l : null, f || null, d ? this.progress.n + d : null, m ? this.progress.stack.concat(m) : null);
- }, c.prototype.then = function(l, f) {
- var d = this;
- return this.thenCore(l, f, function(m, _) {
- return d.updateProgress(null, null, 1, [m]), Promise.prototype.then.call(this, function(k) {
- return d.updateProgress(null, m), k;
- }).then(m, _).then(function(k) {
- return d.updateProgress(1), k;
- });
- });
- }, c.prototype.thenCore = function(l, f, d) {
- d = d || Promise.prototype.then;
- var m = this;
- l && (l = l.bind(m)), f && (f = f.bind(m));
- var _ = Promise.toString().indexOf("[native code]") !== -1 && Promise.name === "Promise" ? m : c.convert(Object.assign({}, m), Promise.prototype), k = d.call(_, l, f);
- return c.convert(k, m.__proto__);
- }, c.prototype.thenExternal = function(l, f) {
- return Promise.prototype.then.call(this, l, f);
- }, c.prototype.thenList = function(l) {
- var f = this;
- return l.forEach(function(d) {
- f = f.thenCore(d);
- }), f;
- }, c.prototype.catch = function(l) {
- l && (l = l.bind(this));
- var f = Promise.prototype.catch.call(this, l);
- return c.convert(f, this);
- }, c.prototype.catchExternal = function(l) {
- return Promise.prototype.catch.call(this, l);
- }, c.prototype.error = function(l) {
- return this.then(function() {
- throw new Error(l);
- });
- }, c.prototype.using = c.prototype.set, c.prototype.saveAs = c.prototype.save, c.prototype.export = c.prototype.output, c.prototype.run = c.prototype.then, Tt.getPageSize = function(l, f, d) {
- if (Se(l) === "object") {
- var m = l;
- l = m.orientation, f = m.unit || f, d = m.format || d;
- }
- f = f || "mm", d = d || "a4", l = ("" + (l || "P")).toLowerCase();
- var _, k = ("" + d).toLowerCase(), p = { a0: [2383.94, 3370.39], a1: [1683.78, 2383.94], a2: [1190.55, 1683.78], a3: [841.89, 1190.55], a4: [595.28, 841.89], a5: [419.53, 595.28], a6: [297.64, 419.53], a7: [209.76, 297.64], a8: [147.4, 209.76], a9: [104.88, 147.4], a10: [73.7, 104.88], b0: [2834.65, 4008.19], b1: [2004.09, 2834.65], b2: [1417.32, 2004.09], b3: [1000.63, 1417.32], b4: [708.66, 1000.63], b5: [498.9, 708.66], b6: [354.33, 498.9], b7: [249.45, 354.33], b8: [175.75, 249.45], b9: [124.72, 175.75], b10: [87.87, 124.72], c0: [2599.37, 3676.54], c1: [1836.85, 2599.37], c2: [1298.27, 1836.85], c3: [918.43, 1298.27], c4: [649.13, 918.43], c5: [459.21, 649.13], c6: [323.15, 459.21], c7: [229.61, 323.15], c8: [161.57, 229.61], c9: [113.39, 161.57], c10: [79.37, 113.39], dl: [311.81, 623.62], letter: [612, 792], "government-letter": [576, 756], legal: [612, 1008], "junior-legal": [576, 360], ledger: [1224, 792], tabloid: [792, 1224], "credit-card": [153, 243] };
- switch (f) {
- case "pt":
- _ = 1;
- break;
- case "mm":
- _ = 72 / 25.4;
- break;
- case "cm":
- _ = 72 / 2.54;
- break;
- case "in":
- _ = 72;
- break;
- case "px":
- _ = 0.75;
- break;
- case "pc":
- case "em":
- _ = 12;
- break;
- case "ex":
- _ = 6;
- break;
- default:
- throw "Invalid unit: " + f;
- }
- var j, O = 0, M = 0;
- if (p.hasOwnProperty(k)) O = p[k][1] / _, M = p[k][0] / _;
- else try {
- O = d[1], M = d[0];
- } catch (S) {
- throw new Error("Invalid format: " + d);
- }
- if (l === "p" || l === "portrait") l = "p", M > O && (j = M, M = O, O = j);
- else {
- if (l !== "l" && l !== "landscape") throw "Invalid orientation: " + l;
- l = "l", O > M && (j = M, M = O, O = j);
- }
- return { width: M, height: O, unit: f, k: _, orientation: l };
- }, n.html = function(l, f) {
- (f = f || {}).callback = f.callback || function() {
- }, f.html2canvas = f.html2canvas || {}, f.html2canvas.canvas = f.html2canvas.canvas || this.canvas, f.jsPDF = f.jsPDF || this, f.fontFaces = f.fontFaces ? f.fontFaces.map(jo) : null;
- var d = new c(f);
- return f.worker ? d : d.from(l).doCallback();
- };
- }(Tt.API), Tt.API.addJS = function(n) {
- var e, t, i = function(s) {
- for (var a = "", c = 0; c < s.length; c++) {
- var l = s[c];
- if (l === "(" || l === ")") {
- for (var f = 0, d = c - 1; d >= 0 && s[d] === "\\"; d--) f++;
- a += f % 2 == 0 ? "\\" + l : l;
- } else a += l;
- }
- return a;
- }(n);
- return this.internal.events.subscribe("postPutResources", function() {
- e = this.internal.newObject(), this.internal.out("<<"), this.internal.out("/Names [(EmbeddedJS) " + (e + 1) + " 0 R]"), this.internal.out(">>"), this.internal.out("endobj"), t = this.internal.newObject(), this.internal.out("<<"), this.internal.out("/S /JavaScript"), this.internal.out("/JS (" + i + ")"), this.internal.out(">>"), this.internal.out("endobj");
- }), this.internal.events.subscribe("putCatalog", function() {
- e !== void 0 && t !== void 0 && this.internal.out("/Names <</JavaScript " + e + " 0 R>>");
- }), this;
- }, /**
- * @license
- * Copyright (c) 2014 Steven Spungin (TwelveTone LLC) steven@twelvetone.tv
- *
- * Licensed under the MIT License.
- * http://opensource.org/licenses/mit-license
- */
- function(n) {
- var e;
- n.events.push(["postPutResources", function() {
- var t = this, i = /^(\d+) 0 obj$/;
- if (this.outline.root.children.length > 0) for (var s = t.outline.render().split(/\r\n/), a = 0; a < s.length; a++) {
- var c = s[a], l = i.exec(c);
- if (l != null) {
- var f = l[1];
- t.internal.newObjectDeferredBegin(f, !1);
- }
- t.internal.write(c);
- }
- if (this.outline.createNamedDestinations) {
- var d = this.internal.pages.length, m = [];
- for (a = 0; a < d; a++) {
- var _ = t.internal.newObject();
- m.push(_);
- var k = t.internal.getPageInfo(a + 1);
- t.internal.write("<< /D[" + k.objId + " 0 R /XYZ null null null]>> endobj");
- }
- var p = t.internal.newObject();
- for (t.internal.write("<< /Names [ "), a = 0; a < m.length; a++) t.internal.write("(page_" + (a + 1) + ")" + m[a] + " 0 R");
- t.internal.write(" ] >>", "endobj"), e = t.internal.newObject(), t.internal.write("<< /Dests " + p + " 0 R"), t.internal.write(">>", "endobj");
- }
- }]), n.events.push(["putCatalog", function() {
- var t = this;
- t.outline.root.children.length > 0 && (t.internal.write("/Outlines", this.outline.makeRef(this.outline.root)), this.outline.createNamedDestinations && t.internal.write("/Names " + e + " 0 R"));
- }]), n.events.push(["initialized", function() {
- var t = this;
- t.outline = { createNamedDestinations: !1, root: { children: [] } }, t.outline.add = function(i, s, a) {
- var c = { title: s, options: a, children: [] };
- return i == null && (i = this.root), i.children.push(c), c;
- }, t.outline.render = function() {
- return this.ctx = {}, this.ctx.val = "", this.ctx.pdf = t, this.genIds_r(this.root), this.renderRoot(this.root), this.renderItems(this.root), this.ctx.val;
- }, t.outline.genIds_r = function(i) {
- i.id = t.internal.newObjectDeferred();
- for (var s = 0; s < i.children.length; s++) this.genIds_r(i.children[s]);
- }, t.outline.renderRoot = function(i) {
- this.objStart(i), this.line("/Type /Outlines"), i.children.length > 0 && (this.line("/First " + this.makeRef(i.children[0])), this.line("/Last " + this.makeRef(i.children[i.children.length - 1]))), this.line("/Count " + this.count_r({ count: 0 }, i)), this.objEnd();
- }, t.outline.renderItems = function(i) {
- for (var s = this.ctx.pdf.internal.getVerticalCoordinateString, a = 0; a < i.children.length; a++) {
- var c = i.children[a];
- this.objStart(c), this.line("/Title " + this.makeString(c.title)), this.line("/Parent " + this.makeRef(i)), a > 0 && this.line("/Prev " + this.makeRef(i.children[a - 1])), a < i.children.length - 1 && this.line("/Next " + this.makeRef(i.children[a + 1])), c.children.length > 0 && (this.line("/First " + this.makeRef(c.children[0])), this.line("/Last " + this.makeRef(c.children[c.children.length - 1])));
- var l = this.count = this.count_r({ count: 0 }, c);
- if (l > 0 && this.line("/Count " + l), c.options && c.options.pageNumber) {
- var f = t.internal.getPageInfo(c.options.pageNumber);
- this.line("/Dest [" + f.objId + " 0 R /XYZ 0 " + s(0) + " 0]");
- }
- this.objEnd();
- }
- for (var d = 0; d < i.children.length; d++) this.renderItems(i.children[d]);
- }, t.outline.line = function(i) {
- this.ctx.val += i + `\r
- `;
- }, t.outline.makeRef = function(i) {
- return i.id + " 0 R";
- }, t.outline.makeString = function(i) {
- return "(" + t.internal.pdfEscape(i) + ")";
- }, t.outline.objStart = function(i) {
- this.ctx.val += `\r
- ` + i.id + ` 0 obj\r
- <<\r
- `;
- }, t.outline.objEnd = function() {
- this.ctx.val += `>> \r
- endobj\r
- `;
- }, t.outline.count_r = function(i, s) {
- for (var a = 0; a < s.children.length; a++) i.count++, this.count_r(i, s.children[a]);
- return i.count;
- };
- }]);
- }(Tt.API), /**
- * @license
- *
- * Licensed under the MIT License.
- * http://opensource.org/licenses/mit-license
- */
- function(n) {
- var e = [192, 193, 194, 195, 196, 197, 198, 199];
- n.processJPEG = function(t, i, s, a, c, l) {
- var f, d = this.decode.DCT_DECODE, m = null;
- if (typeof t == "string" || this.__addimage__.isArrayBuffer(t) || this.__addimage__.isArrayBufferView(t)) {
- switch (t = c || t, t = this.__addimage__.isArrayBuffer(t) ? new Uint8Array(t) : t, f = function(_) {
- for (var k, p = 256 * _.charCodeAt(4) + _.charCodeAt(5), j = _.length, O = { width: 0, height: 0, numcomponents: 1 }, M = 4; M < j; M += 2) {
- if (M += p, e.indexOf(_.charCodeAt(M + 1)) !== -1) {
- k = 256 * _.charCodeAt(M + 5) + _.charCodeAt(M + 6), O = { width: 256 * _.charCodeAt(M + 7) + _.charCodeAt(M + 8), height: k, numcomponents: _.charCodeAt(M + 9) };
- break;
- }
- p = 256 * _.charCodeAt(M + 2) + _.charCodeAt(M + 3);
- }
- return O;
- }(t = this.__addimage__.isArrayBufferView(t) ? this.__addimage__.arrayBufferToBinaryString(t) : t), f.numcomponents) {
- case 1:
- l = this.color_spaces.DEVICE_GRAY;
- break;
- case 4:
- l = this.color_spaces.DEVICE_CMYK;
- break;
- case 3:
- l = this.color_spaces.DEVICE_RGB;
- }
- m = { data: t, width: f.width, height: f.height, colorSpace: l, bitsPerComponent: 8, filter: d, index: i, alias: s };
- }
- return m;
- };
- }(Tt.API), Tt.API.processPNG = function(n, e, t, i) {
- if (this.__addimage__.isArrayBuffer(n) && (n = new Uint8Array(n)), this.__addimage__.isArrayBufferView(n)) {
- var s, a = C1(n, { checkCrc: !0 }), c = a.width, l = a.height, f = a.channels, d = a.palette, m = a.depth;
- s = d && f === 1 ? function(X) {
- for (var R = X.width, tt = X.height, N = X.data, E = X.palette, z = X.depth, U = !1, rt = [], ot = [], ht = void 0, nt = !1, ct = 0, At = 0; At < E.length; At++) {
- var wt = ql(E[At], 4), x = wt[0], B = wt[1], T = wt[2], H = wt[3];
- rt.push(x, B, T), H != null && (H === 0 ? (ct++, ot.length < 1 && ot.push(At)) : H < 255 && (nt = !0));
- }
- if (nt || ct > 1) {
- U = !0, ot = void 0;
- var J = R * tt;
- ht = new Uint8Array(J);
- for (var Z = new DataView(N.buffer), at = 0; at < J; at++) {
- var st = Mo(Z, at, z), gt = ql(E[st], 4)[3];
- ht[at] = gt;
- }
- } else ct === 0 && (ot = void 0);
- return { colorSpace: "Indexed", colorsPerPixel: 1, sMaskBitsPerComponent: U ? 8 : void 0, colorBytes: N, alphaBytes: ht, needSMask: U, palette: rt, mask: ot };
- }(a) : f === 2 || f === 4 ? function(X) {
- for (var R = X.data, tt = X.width, N = X.height, E = X.channels, z = X.depth, U = E === 2 ? "DeviceGray" : "DeviceRGB", rt = E - 1, ot = tt * N, ht = rt, nt = ot * ht, ct = 1 * ot, At = Math.ceil(nt * z / 8), wt = Math.ceil(ct * z / 8), x = new Uint8Array(At), B = new Uint8Array(wt), T = new DataView(R.buffer), H = new DataView(x.buffer), J = new DataView(B.buffer), Z = !1, at = 0; at < ot; at++) {
- for (var st = at * E, gt = 0; gt < ht; gt++) Vu(H, Mo(T, st + gt, z), at * ht + gt, z);
- var _t = Mo(T, st + ht, z);
- _t < (1 << z) - 1 && (Z = !0), Vu(J, _t, 1 * at, z);
- }
- return { colorSpace: U, colorsPerPixel: rt, sMaskBitsPerComponent: Z ? z : void 0, colorBytes: x, alphaBytes: B, needSMask: Z };
- }(a) : function(X) {
- var R = X.data, tt = X.channels === 1 ? "DeviceGray" : "DeviceRGB";
- return { colorSpace: tt, colorsPerPixel: tt === "DeviceGray" ? 1 : 3, colorBytes: R instanceof Uint16Array ? function(N) {
- for (var E = N.length, z = new Uint8Array(2 * E), U = new DataView(z.buffer, z.byteOffset, z.byteLength), rt = 0; rt < E; rt++) U.setUint16(2 * rt, N[rt], !1);
- return z;
- }(R) : R, needSMask: !1 };
- }(a);
- var _, k, p, j = s, O = j.colorSpace, M = j.colorsPerPixel, S = j.sMaskBitsPerComponent, V = j.colorBytes, G = j.alphaBytes, q = j.needSMask, it = j.palette, vt = j.mask, dt = null;
- return i !== Tt.API.image_compression.NONE && typeof Uo == "function" ? (dt = function(X) {
- var R;
- switch (X) {
- case Tt.API.image_compression.FAST:
- R = 11;
- break;
- case Tt.API.image_compression.MEDIUM:
- R = 13;
- break;
- case Tt.API.image_compression.SLOW:
- R = 14;
- break;
- default:
- R = 12;
- }
- return R;
- }(i), _ = this.decode.FLATE_DECODE, k = "/Predictor ".concat(dt, " /Colors ").concat(M, " /BitsPerComponent ").concat(m, " /Columns ").concat(c), n = qu(V, Math.ceil(c * M * m / 8), M, m, i), q && (p = qu(G, Math.ceil(c * S / 8), 1, S, i))) : (_ = void 0, k = void 0, n = V, q && (p = G)), (this.__addimage__.isArrayBuffer(n) || this.__addimage__.isArrayBufferView(n)) && (n = this.__addimage__.arrayBufferToBinaryString(n)), (p && this.__addimage__.isArrayBuffer(p) || this.__addimage__.isArrayBufferView(p)) && (p = this.__addimage__.arrayBufferToBinaryString(p)), { alias: t, data: n, index: e, filter: _, decodeParameters: k, transparency: vt, palette: it, sMask: p, predictor: dt, width: c, height: l, bitsPerComponent: m, sMaskBitsPerComponent: S, colorSpace: O };
- }
- }, function(n) {
- n.processGIF89A = function(e, t, i, s) {
- var a = new Z1(e), c = a.width, l = a.height, f = [];
- a.decodeAndBlitFrameRGBA(0, f);
- var d = { data: f, width: c, height: l }, m = new Ro(100).encode(d, 100);
- return n.processJPEG.call(this, m, t, i, s);
- }, n.processGIF87A = n.processGIF89A;
- }(Tt.API), Qn.prototype.parseHeader = function() {
- if (this.fileSize = this.datav.getUint32(this.pos, !0), this.pos += 4, this.reserved = this.datav.getUint32(this.pos, !0), this.pos += 4, this.offset = this.datav.getUint32(this.pos, !0), this.pos += 4, this.headerSize = this.datav.getUint32(this.pos, !0), this.pos += 4, this.width = this.datav.getUint32(this.pos, !0), this.pos += 4, this.height = this.datav.getInt32(this.pos, !0), this.pos += 4, this.planes = this.datav.getUint16(this.pos, !0), this.pos += 2, this.bitPP = this.datav.getUint16(this.pos, !0), this.pos += 2, this.compress = this.datav.getUint32(this.pos, !0), this.pos += 4, this.rawSize = this.datav.getUint32(this.pos, !0), this.pos += 4, this.hr = this.datav.getUint32(this.pos, !0), this.pos += 4, this.vr = this.datav.getUint32(this.pos, !0), this.pos += 4, this.colors = this.datav.getUint32(this.pos, !0), this.pos += 4, this.importantColors = this.datav.getUint32(this.pos, !0), this.pos += 4, this.bitPP === 16 && this.is_with_alpha && (this.bitPP = 15), this.bitPP < 15) {
- var n = this.colors === 0 ? 1 << this.bitPP : this.colors;
- this.palette = new Array(n);
- for (var e = 0; e < n; e++) {
- var t = this.datav.getUint8(this.pos++, !0), i = this.datav.getUint8(this.pos++, !0), s = this.datav.getUint8(this.pos++, !0), a = this.datav.getUint8(this.pos++, !0);
- this.palette[e] = { red: s, green: i, blue: t, quad: a };
- }
- }
- this.height < 0 && (this.height *= -1, this.bottom_up = !1);
- }, Qn.prototype.parseBGR = function() {
- this.pos = this.offset;
- var n = "bit" + this.bitPP, e = this.width * this.height * 4;
- if (e > 536870912) throw new Error("Image dimensions exceed 512MB, which is too large.");
- this.data = new Uint8Array(e);
- try {
- this[n]();
- } catch (t) {
- Le.log("bit decode error:" + t);
- }
- }, Qn.prototype.bit1 = function() {
- var n, e = Math.ceil(this.width / 8), t = e % 4;
- for (n = this.height - 1; n >= 0; n--) {
- for (var i = this.bottom_up ? n : this.height - 1 - n, s = 0; s < e; s++) for (var a = this.datav.getUint8(this.pos++, !0), c = i * this.width * 4 + 8 * s * 4, l = 0; l < 8 && 8 * s + l < this.width; l++) {
- var f = this.palette[a >> 7 - l & 1];
- this.data[c + 4 * l] = f.blue, this.data[c + 4 * l + 1] = f.green, this.data[c + 4 * l + 2] = f.red, this.data[c + 4 * l + 3] = 255;
- }
- t !== 0 && (this.pos += 4 - t);
- }
- }, Qn.prototype.bit4 = function() {
- for (var n = Math.ceil(this.width / 2), e = n % 4, t = this.height - 1; t >= 0; t--) {
- for (var i = this.bottom_up ? t : this.height - 1 - t, s = 0; s < n; s++) {
- var a = this.datav.getUint8(this.pos++, !0), c = i * this.width * 4 + 2 * s * 4, l = a >> 4, f = 15 & a, d = this.palette[l];
- if (this.data[c] = d.blue, this.data[c + 1] = d.green, this.data[c + 2] = d.red, this.data[c + 3] = 255, 2 * s + 1 >= this.width) break;
- d = this.palette[f], this.data[c + 4] = d.blue, this.data[c + 4 + 1] = d.green, this.data[c + 4 + 2] = d.red, this.data[c + 4 + 3] = 255;
- }
- e !== 0 && (this.pos += 4 - e);
- }
- }, Qn.prototype.bit8 = function() {
- for (var n = this.width % 4, e = this.height - 1; e >= 0; e--) {
- for (var t = this.bottom_up ? e : this.height - 1 - e, i = 0; i < this.width; i++) {
- var s = this.datav.getUint8(this.pos++, !0), a = t * this.width * 4 + 4 * i;
- if (s < this.palette.length) {
- var c = this.palette[s];
- this.data[a] = c.red, this.data[a + 1] = c.green, this.data[a + 2] = c.blue, this.data[a + 3] = 255;
- } else this.data[a] = 255, this.data[a + 1] = 255, this.data[a + 2] = 255, this.data[a + 3] = 255;
- }
- n !== 0 && (this.pos += 4 - n);
- }
- }, Qn.prototype.bit15 = function() {
- for (var n = this.width % 3, e = parseInt("11111", 2), t = this.height - 1; t >= 0; t--) {
- for (var i = this.bottom_up ? t : this.height - 1 - t, s = 0; s < this.width; s++) {
- var a = this.datav.getUint16(this.pos, !0);
- this.pos += 2;
- var c = (a & e) / e * 255 | 0, l = (a >> 5 & e) / e * 255 | 0, f = (a >> 10 & e) / e * 255 | 0, d = a >> 15 ? 255 : 0, m = i * this.width * 4 + 4 * s;
- this.data[m] = f, this.data[m + 1] = l, this.data[m + 2] = c, this.data[m + 3] = d;
- }
- this.pos += n;
- }
- }, Qn.prototype.bit16 = function() {
- for (var n = this.width % 3, e = parseInt("11111", 2), t = parseInt("111111", 2), i = this.height - 1; i >= 0; i--) {
- for (var s = this.bottom_up ? i : this.height - 1 - i, a = 0; a < this.width; a++) {
- var c = this.datav.getUint16(this.pos, !0);
- this.pos += 2;
- var l = (c & e) / e * 255 | 0, f = (c >> 5 & t) / t * 255 | 0, d = (c >> 11) / e * 255 | 0, m = s * this.width * 4 + 4 * a;
- this.data[m] = d, this.data[m + 1] = f, this.data[m + 2] = l, this.data[m + 3] = 255;
- }
- this.pos += n;
- }
- }, Qn.prototype.bit24 = function() {
- for (var n = this.height - 1; n >= 0; n--) {
- for (var e = this.bottom_up ? n : this.height - 1 - n, t = 0; t < this.width; t++) {
- var i = this.datav.getUint8(this.pos++, !0), s = this.datav.getUint8(this.pos++, !0), a = this.datav.getUint8(this.pos++, !0), c = e * this.width * 4 + 4 * t;
- this.data[c] = a, this.data[c + 1] = s, this.data[c + 2] = i, this.data[c + 3] = 255;
- }
- this.pos += this.width % 4;
- }
- }, Qn.prototype.bit32 = function() {
- for (var n = this.height - 1; n >= 0; n--) for (var e = this.bottom_up ? n : this.height - 1 - n, t = 0; t < this.width; t++) {
- var i = this.datav.getUint8(this.pos++, !0), s = this.datav.getUint8(this.pos++, !0), a = this.datav.getUint8(this.pos++, !0), c = this.datav.getUint8(this.pos++, !0), l = e * this.width * 4 + 4 * t;
- this.data[l] = a, this.data[l + 1] = s, this.data[l + 2] = i, this.data[l + 3] = c;
- }
- }, Qn.prototype.getData = function() {
- return this.data;
- }, /**
- * @license
- * Copyright (c) 2018 Aras Abbasi
- *
- * Licensed under the MIT License.
- * http://opensource.org/licenses/mit-license
- */
- function(n) {
- n.processBMP = function(e, t, i, s) {
- var a = new Qn(e, !1), c = a.width, l = a.height, f = { data: a.getData(), width: c, height: l }, d = new Ro(100).encode(f, 100);
- return n.processJPEG.call(this, d, t, i, s);
- };
- }(Tt.API), Yu.prototype.getData = function() {
- return this.data;
- }, /**
- * @license
- * Copyright (c) 2019 Aras Abbasi
- *
- * Licensed under the MIT License.
- * http://opensource.org/licenses/mit-license
- */
- function(n) {
- n.processWEBP = function(e, t, i, s) {
- var a = new Yu(e), c = a.width, l = a.height, f = { data: a.getData(), width: c, height: l }, d = new Ro(100).encode(f, 100);
- return n.processJPEG.call(this, d, t, i, s);
- };
- }(Tt.API), Tt.API.processRGBA = function(n, e, t) {
- for (var i = n.data, s = i.length, a = new Uint8Array(s / 4 * 3), c = new Uint8Array(s / 4), l = 0, f = 0, d = 0; d < s; d += 4) {
- var m = i[d], _ = i[d + 1], k = i[d + 2], p = i[d + 3];
- a[l++] = m, a[l++] = _, a[l++] = k, c[f++] = p;
- }
- var j = this.__addimage__.arrayBufferToBinaryString(a);
- return { alpha: this.__addimage__.arrayBufferToBinaryString(c), data: j, index: e, alias: t, colorSpace: "DeviceRGB", bitsPerComponent: 8, width: n.width, height: n.height };
- }, Tt.API.setLanguage = function(n) {
- return this.internal.languageSettings === void 0 && (this.internal.languageSettings = {}, this.internal.languageSettings.isSubscribed = !1), { af: "Afrikaans", sq: "Albanian", ar: "Arabic (Standard)", "ar-DZ": "Arabic (Algeria)", "ar-BH": "Arabic (Bahrain)", "ar-EG": "Arabic (Egypt)", "ar-IQ": "Arabic (Iraq)", "ar-JO": "Arabic (Jordan)", "ar-KW": "Arabic (Kuwait)", "ar-LB": "Arabic (Lebanon)", "ar-LY": "Arabic (Libya)", "ar-MA": "Arabic (Morocco)", "ar-OM": "Arabic (Oman)", "ar-QA": "Arabic (Qatar)", "ar-SA": "Arabic (Saudi Arabia)", "ar-SY": "Arabic (Syria)", "ar-TN": "Arabic (Tunisia)", "ar-AE": "Arabic (U.A.E.)", "ar-YE": "Arabic (Yemen)", an: "Aragonese", hy: "Armenian", as: "Assamese", ast: "Asturian", az: "Azerbaijani", eu: "Basque", be: "Belarusian", bn: "Bengali", bs: "Bosnian", br: "Breton", bg: "Bulgarian", my: "Burmese", ca: "Catalan", ch: "Chamorro", ce: "Chechen", zh: "Chinese", "zh-HK": "Chinese (Hong Kong)", "zh-CN": "Chinese (PRC)", "zh-SG": "Chinese (Singapore)", "zh-TW": "Chinese (Taiwan)", cv: "Chuvash", co: "Corsican", cr: "Cree", hr: "Croatian", cs: "Czech", da: "Danish", nl: "Dutch (Standard)", "nl-BE": "Dutch (Belgian)", en: "English", "en-AU": "English (Australia)", "en-BZ": "English (Belize)", "en-CA": "English (Canada)", "en-IE": "English (Ireland)", "en-JM": "English (Jamaica)", "en-NZ": "English (New Zealand)", "en-PH": "English (Philippines)", "en-ZA": "English (South Africa)", "en-TT": "English (Trinidad & Tobago)", "en-GB": "English (United Kingdom)", "en-US": "English (United States)", "en-ZW": "English (Zimbabwe)", eo: "Esperanto", et: "Estonian", fo: "Faeroese", fj: "Fijian", fi: "Finnish", fr: "French (Standard)", "fr-BE": "French (Belgium)", "fr-CA": "French (Canada)", "fr-FR": "French (France)", "fr-LU": "French (Luxembourg)", "fr-MC": "French (Monaco)", "fr-CH": "French (Switzerland)", fy: "Frisian", fur: "Friulian", gd: "Gaelic (Scots)", "gd-IE": "Gaelic (Irish)", gl: "Galacian", ka: "Georgian", de: "German (Standard)", "de-AT": "German (Austria)", "de-DE": "German (Germany)", "de-LI": "German (Liechtenstein)", "de-LU": "German (Luxembourg)", "de-CH": "German (Switzerland)", el: "Greek", gu: "Gujurati", ht: "Haitian", he: "Hebrew", hi: "Hindi", hu: "Hungarian", is: "Icelandic", id: "Indonesian", iu: "Inuktitut", ga: "Irish", it: "Italian (Standard)", "it-CH": "Italian (Switzerland)", ja: "Japanese", kn: "Kannada", ks: "Kashmiri", kk: "Kazakh", km: "Khmer", ky: "Kirghiz", tlh: "Klingon", ko: "Korean", "ko-KP": "Korean (North Korea)", "ko-KR": "Korean (South Korea)", la: "Latin", lv: "Latvian", lt: "Lithuanian", lb: "Luxembourgish", mk: "North Macedonia", ms: "Malay", ml: "Malayalam", mt: "Maltese", mi: "Maori", mr: "Marathi", mo: "Moldavian", nv: "Navajo", ng: "Ndonga", ne: "Nepali", no: "Norwegian", nb: "Norwegian (Bokmal)", nn: "Norwegian (Nynorsk)", oc: "Occitan", or: "Oriya", om: "Oromo", fa: "Persian", "fa-IR": "Persian/Iran", pl: "Polish", pt: "Portuguese", "pt-BR": "Portuguese (Brazil)", pa: "Punjabi", "pa-IN": "Punjabi (India)", "pa-PK": "Punjabi (Pakistan)", qu: "Quechua", rm: "Rhaeto-Romanic", ro: "Romanian", "ro-MO": "Romanian (Moldavia)", ru: "Russian", "ru-MO": "Russian (Moldavia)", sz: "Sami (Lappish)", sg: "Sango", sa: "Sanskrit", sc: "Sardinian", sd: "Sindhi", si: "Singhalese", sr: "Serbian", sk: "Slovak", sl: "Slovenian", so: "Somani", sb: "Sorbian", es: "Spanish", "es-AR": "Spanish (Argentina)", "es-BO": "Spanish (Bolivia)", "es-CL": "Spanish (Chile)", "es-CO": "Spanish (Colombia)", "es-CR": "Spanish (Costa Rica)", "es-DO": "Spanish (Dominican Republic)", "es-EC": "Spanish (Ecuador)", "es-SV": "Spanish (El Salvador)", "es-GT": "Spanish (Guatemala)", "es-HN": "Spanish (Honduras)", "es-MX": "Spanish (Mexico)", "es-NI": "Spanish (Nicaragua)", "es-PA": "Spanish (Panama)", "es-PY": "Spanish (Paraguay)", "es-PE": "Spanish (Peru)", "es-PR": "Spanish (Puerto Rico)", "es-ES": "Spanish (Spain)", "es-UY": "Spanish (Uruguay)", "es-VE": "Spanish (Venezuela)", sx: "Sutu", sw: "Swahili", sv: "Swedish", "sv-FI": "Swedish (Finland)", "sv-SV": "Swedish (Sweden)", ta: "Tamil", tt: "Tatar", te: "Teluga", th: "Thai", tig: "Tigre", ts: "Tsonga", tn: "Tswana", tr: "Turkish", tk: "Turkmen", uk: "Ukrainian", hsb: "Upper Sorbian", ur: "Urdu", ve: "Venda", vi: "Vietnamese", vo: "Volapuk", wa: "Walloon", cy: "Welsh", xh: "Xhosa", ji: "Yiddish", zu: "Zulu" }[n] !== void 0 && (this.internal.languageSettings.languageCode = n, this.internal.languageSettings.isSubscribed === !1 && (this.internal.events.subscribe("putCatalog", function() {
- this.internal.write("/Lang (" + this.internal.languageSettings.languageCode + ")");
- }), this.internal.languageSettings.isSubscribed = !0)), this;
- }, Xi = Tt.API, _s = Xi.getCharWidthsArray = function(n, e) {
- var t, i, s = (e = e || {}).font || this.internal.getFont(), a = e.fontSize || this.internal.getFontSize(), c = e.charSpace || this.internal.getCharSpace(), l = e.widths ? e.widths : s.metadata.Unicode.widths, f = l.fof ? l.fof : 1, d = e.kerning ? e.kerning : s.metadata.Unicode.kerning, m = d.fof ? d.fof : 1, _ = e.doKerning !== !1, k = 0, p = n.length, j = 0, O = l[0] || f, M = [];
- for (t = 0; t < p; t++) i = n.charCodeAt(t), typeof s.metadata.widthOfString == "function" ? M.push((s.metadata.widthOfGlyph(s.metadata.characterToGlyph(i)) + c * (1e3 / a) || 0) / 1e3) : (k = _ && Se(d[i]) === "object" && !isNaN(parseInt(d[i][j], 10)) ? d[i][j] / m : 0, M.push((l[i] || O) / f + k)), j = i;
- return M;
- }, Ru = Xi.getStringUnitWidth = function(n, e) {
- var t = (e = e || {}).fontSize || this.internal.getFontSize(), i = e.font || this.internal.getFont(), s = e.charSpace || this.internal.getCharSpace();
- return Xi.processArabic && (n = Xi.processArabic(n)), typeof i.metadata.widthOfString == "function" ? i.metadata.widthOfString(n, t, s) / t : _s.apply(this, arguments).reduce(function(a, c) {
- return a + c;
- }, 0);
- }, Tu = function(n, e, t, i) {
- for (var s = [], a = 0, c = n.length, l = 0; a !== c && l + e[a] < t; ) l += e[a], a++;
- s.push(n.slice(0, a));
- var f = a;
- for (l = 0; a !== c; ) l + e[a] > i && (s.push(n.slice(f, a)), l = 0, f = a), l += e[a], a++;
- return f !== a && s.push(n.slice(f, a)), s;
- }, Du = function(n, e, t) {
- t || (t = {});
- var i, s, a, c, l, f, d, m = [], _ = [m], k = t.textIndent || 0, p = 0, j = 0, O = n.split(" "), M = _s.apply(this, [" ", t])[0];
- if (f = t.lineIndent === -1 ? O[0].length + 2 : t.lineIndent || 0) {
- var S = Array(f).join(" "), V = [];
- O.map(function(q) {
- (q = q.split(/\s*\n/)).length > 1 ? V = V.concat(q.map(function(it, vt) {
- return (vt && it.length ? `
- ` : "") + it;
- })) : V.push(q[0]);
- }), O = V, f = Ru.apply(this, [S, t]);
- }
- for (a = 0, c = O.length; a < c; a++) {
- var G = 0;
- if (i = O[a], f && i[0] == `
- ` && (i = i.substr(1), G = 1), k + p + (j = (s = _s.apply(this, [i, t])).reduce(function(q, it) {
- return q + it;
- }, 0)) > e || G) {
- if (j > e) {
- for (l = Tu.apply(this, [i, s, e - (k + p), e]), m.push(l.shift()), m = [l.pop()]; l.length; ) _.push([l.shift()]);
- j = s.slice(i.length - (m[0] ? m[0].length : 0)).reduce(function(q, it) {
- return q + it;
- }, 0);
- } else m = [i];
- _.push(m), k = j + f, p = M;
- } else m.push(i), k += p + j, p = M;
- }
- return d = f ? function(q, it) {
- return (it ? S : "") + q.join(" ");
- } : function(q) {
- return q.join(" ");
- }, _.map(d);
- }, Xi.splitTextToSize = function(n, e, t) {
- var i, s = (t = t || {}).fontSize || this.internal.getFontSize(), a = function(m) {
- if (m.widths && m.kerning) return { widths: m.widths, kerning: m.kerning };
- var _ = this.internal.getFont(m.fontName, m.fontStyle), k = "Unicode";
- return _.metadata[k] ? { widths: _.metadata[k].widths || { 0: 1 }, kerning: _.metadata[k].kerning || {} } : { font: _.metadata, fontSize: this.internal.getFontSize(), charSpace: this.internal.getCharSpace() };
- }.call(this, t);
- i = Array.isArray(n) ? n : String(n).split(/\r?\n/);
- var c = 1 * this.internal.scaleFactor * e / s;
- a.textIndent = t.textIndent ? 1 * t.textIndent * this.internal.scaleFactor / s : 0, a.lineIndent = t.lineIndent;
- var l, f, d = [];
- for (l = 0, f = i.length; l < f; l++) d = d.concat(Du.apply(this, [i[l], c, a]));
- return d;
- }, function(n) {
- n.__fontmetrics__ = n.__fontmetrics__ || {};
- for (var e = "0123456789abcdef", t = "klmnopqrstuvwxyz", i = {}, s = {}, a = 0; a < 16; a++) i[t[a]] = e[a], s[e[a]] = t[a];
- var c = function(k) {
- return "0x" + parseInt(k, 10).toString(16);
- }, l = n.__fontmetrics__.compress = function(k) {
- var p, j, O, M, S = ["{"];
- for (var V in k) {
- if (p = k[V], isNaN(parseInt(V, 10)) ? j = "'" + V + "'" : (V = parseInt(V, 10), j = (j = c(V).slice(2)).slice(0, -1) + s[j.slice(-1)]), typeof p == "number") p < 0 ? (O = c(p).slice(3), M = "-") : (O = c(p).slice(2), M = ""), O = M + O.slice(0, -1) + s[O.slice(-1)];
- else {
- if (Se(p) !== "object") throw new Error("Don't know what to do with value type " + Se(p) + ".");
- O = l(p);
- }
- S.push(j + O);
- }
- return S.push("}"), S.join("");
- }, f = n.__fontmetrics__.uncompress = function(k) {
- if (typeof k != "string") throw new Error("Invalid argument passed to uncompress.");
- for (var p, j, O, M, S = {}, V = 1, G = S, q = [], it = "", vt = "", dt = k.length - 1, X = 1; X < dt; X += 1) (M = k[X]) == "'" ? p ? (O = p.join(""), p = void 0) : p = [] : p ? p.push(M) : M == "{" ? (q.push([G, O]), G = {}, O = void 0) : M == "}" ? ((j = q.pop())[0][j[1]] = G, O = void 0, G = j[0]) : M == "-" ? V = -1 : O === void 0 ? i.hasOwnProperty(M) ? (it += i[M], O = parseInt(it, 16) * V, V = 1, it = "") : it += M : i.hasOwnProperty(M) ? (vt += i[M], G[O] = parseInt(vt, 16) * V, V = 1, O = void 0, vt = "") : vt += M;
- return S;
- }, d = { codePages: ["WinAnsiEncoding"], WinAnsiEncoding: f("{19m8n201n9q201o9r201s9l201t9m201u8m201w9n201x9o201y8o202k8q202l8r202m9p202q8p20aw8k203k8t203t8v203u9v2cq8s212m9t15m8w15n9w2dw9s16k8u16l9u17s9z17x8y17y9y}") }, m = { Unicode: { Courier: d, "Courier-Bold": d, "Courier-BoldOblique": d, "Courier-Oblique": d, Helvetica: d, "Helvetica-Bold": d, "Helvetica-BoldOblique": d, "Helvetica-Oblique": d, "Times-Roman": d, "Times-Bold": d, "Times-BoldItalic": d, "Times-Italic": d } }, _ = { Unicode: { "Courier-Oblique": f("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"), "Times-BoldItalic": f("{'widths'{k3o2q4ycx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2r202m2n2n3m2o3m2p5n202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5n4l4m4m4m4n4m4o4s4p4m4q4m4r4s4s4y4t2r4u3m4v4m4w3x4x5t4y4s4z4s5k3x5l4s5m4m5n3r5o3x5p4s5q4m5r5t5s4m5t3x5u3x5v2l5w1w5x2l5y3t5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q2l6r3m6s3r6t1w6u1w6v3m6w1w6x4y6y3r6z3m7k3m7l3m7m2r7n2r7o1w7p3r7q2w7r4m7s3m7t2w7u2r7v2n7w1q7x2n7y3t202l3mcl4mal2ram3man3mao3map3mar3mas2lat4uau1uav3maw3way4uaz2lbk2sbl3t'fof'6obo2lbp3tbq3mbr1tbs2lbu1ybv3mbz3mck4m202k3mcm4mcn4mco4mcp4mcq5ycr4mcs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz2w203k6o212m6o2dw2l2cq2l3t3m3u2l17s3x19m3m}'kerning'{cl{4qu5kt5qt5rs17ss5ts}201s{201ss}201t{cks4lscmscnscoscpscls2wu2yu201ts}201x{2wu2yu}2k{201ts}2w{4qx5kx5ou5qx5rs17su5tu}2x{17su5tu5ou}2y{4qx5kx5ou5qx5rs17ss5ts}'fof'-6ofn{17sw5tw5ou5qw5rs}7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qs}3v{17su5tu5os5qs}7p{17su5tu}ck{4qu5kt5qt5rs17ss5ts}4l{4qu5kt5qt5rs17ss5ts}cm{4qu5kt5qt5rs17ss5ts}cn{4qu5kt5qt5rs17ss5ts}co{4qu5kt5qt5rs17ss5ts}cp{4qu5kt5qt5rs17ss5ts}6l{4qu5ou5qw5rt17su5tu}5q{ckuclucmucnucoucpu4lu}5r{ckuclucmucnucoucpu4lu}7q{cksclscmscnscoscps4ls}6p{4qu5ou5qw5rt17sw5tw}ek{4qu5ou5qw5rt17su5tu}el{4qu5ou5qw5rt17su5tu}em{4qu5ou5qw5rt17su5tu}en{4qu5ou5qw5rt17su5tu}eo{4qu5ou5qw5rt17su5tu}ep{4qu5ou5qw5rt17su5tu}es{17ss5ts5qs4qu}et{4qu5ou5qw5rt17sw5tw}eu{4qu5ou5qw5rt17ss5ts}ev{17ss5ts5qs4qu}6z{17sw5tw5ou5qw5rs}fm{17sw5tw5ou5qw5rs}7n{201ts}fo{17sw5tw5ou5qw5rs}fp{17sw5tw5ou5qw5rs}fq{17sw5tw5ou5qw5rs}7r{cksclscmscnscoscps4ls}fs{17sw5tw5ou5qw5rs}ft{17su5tu}fu{17su5tu}fv{17su5tu}fw{17su5tu}fz{cksclscmscnscoscps4ls}}}"), "Helvetica-Bold": f("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"), Courier: f("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"), "Courier-BoldOblique": f("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"), "Times-Bold": f("{'widths'{k3q2q5ncx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2l202m2n2n3m2o3m2p6o202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5x4l4s4m4m4n4s4o4s4p4m4q3x4r4y4s4y4t2r4u3m4v4y4w4m4x5y4y4s4z4y5k3x5l4y5m4s5n3r5o4m5p4s5q4s5r6o5s4s5t4s5u4m5v2l5w1w5x2l5y3u5z3m6k2l6l3m6m3r6n2w6o3r6p2w6q2l6r3m6s3r6t1w6u2l6v3r6w1w6x5n6y3r6z3m7k3r7l3r7m2w7n2r7o2l7p3r7q3m7r4s7s3m7t3m7u2w7v2r7w1q7x2r7y3o202l3mcl4sal2lam3man3mao3map3mar3mas2lat4uau1yav3maw3tay4uaz2lbk2sbl3t'fof'6obo2lbp3rbr1tbs2lbu2lbv3mbz3mck4s202k3mcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3rek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3m3u2l17s4s19m3m}'kerning'{cl{4qt5ks5ot5qy5rw17sv5tv}201t{cks4lscmscnscoscpscls4wv}2k{201ts}2w{4qu5ku7mu5os5qx5ru17su5tu}2x{17su5tu5ou5qs}2y{4qv5kv7mu5ot5qz5ru17su5tu}'fof'-6o7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qu}3v{17su5tu5os5qu}fu{17su5tu5ou5qu}7p{17su5tu5ou5qu}ck{4qt5ks5ot5qy5rw17sv5tv}4l{4qt5ks5ot5qy5rw17sv5tv}cm{4qt5ks5ot5qy5rw17sv5tv}cn{4qt5ks5ot5qy5rw17sv5tv}co{4qt5ks5ot5qy5rw17sv5tv}cp{4qt5ks5ot5qy5rw17sv5tv}6l{17st5tt5ou5qu}17s{ckuclucmucnucoucpu4lu4wu}5o{ckuclucmucnucoucpu4lu4wu}5q{ckzclzcmzcnzcozcpz4lz4wu}5r{ckxclxcmxcnxcoxcpx4lx4wu}5t{ckuclucmucnucoucpu4lu4wu}7q{ckuclucmucnucoucpu4lu}6p{17sw5tw5ou5qu}ek{17st5tt5qu}el{17st5tt5ou5qu}em{17st5tt5qu}en{17st5tt5qu}eo{17st5tt5qu}ep{17st5tt5ou5qu}es{17ss5ts5qu}et{17sw5tw5ou5qu}eu{17sw5tw5ou5qu}ev{17ss5ts5qu}6z{17sw5tw5ou5qu5rs}fm{17sw5tw5ou5qu5rs}fn{17sw5tw5ou5qu5rs}fo{17sw5tw5ou5qu5rs}fp{17sw5tw5ou5qu5rs}fq{17sw5tw5ou5qu5rs}7r{cktcltcmtcntcotcpt4lt5os}fs{17sw5tw5ou5qu5rs}ft{17su5tu5ou5qu}7m{5os}fv{17su5tu5ou5qu}fw{17su5tu5ou5qu}fz{cksclscmscnscoscps4ls}}}"), Symbol: f("{'widths'{k3uaw4r19m3m2k1t2l2l202m2y2n3m2p5n202q6o3k3m2s2l2t2l2v3r2w1t3m3m2y1t2z1wbk2sbl3r'fof'6o3n3m3o3m3p3m3q3m3r3m3s3m3t3m3u1w3v1w3w3r3x3r3y3r3z2wbp3t3l3m5v2l5x2l5z3m2q4yfr3r7v3k7w1o7x3k}'kerning'{'fof'-6o}}"), Helvetica: f("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}"), "Helvetica-BoldOblique": f("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"), ZapfDingbats: f("{'widths'{k4u2k1w'fof'6o}'kerning'{'fof'-6o}}"), "Courier-Bold": f("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"), "Times-Italic": f("{'widths'{k3n2q4ycx2l201n3m201o5t201s2l201t2l201u2l201w3r201x3r201y3r2k1t2l2l202m2n2n3m2o3m2p5n202q5t2r1p2s2l2t2l2u3m2v4n2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w4n3x4n3y4n3z3m4k5w4l3x4m3x4n4m4o4s4p3x4q3x4r4s4s4s4t2l4u2w4v4m4w3r4x5n4y4m4z4s5k3x5l4s5m3x5n3m5o3r5p4s5q3x5r5n5s3x5t3r5u3r5v2r5w1w5x2r5y2u5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q1w6r3m6s3m6t1w6u1w6v2w6w1w6x4s6y3m6z3m7k3m7l3m7m2r7n2r7o1w7p3m7q2w7r4m7s2w7t2w7u2r7v2s7w1v7x2s7y3q202l3mcl3xal2ram3man3mao3map3mar3mas2lat4wau1vav3maw4nay4waz2lbk2sbl4n'fof'6obo2lbp3mbq3obr1tbs2lbu1zbv3mbz3mck3x202k3mcm3xcn3xco3xcp3xcq5tcr4mcs3xct3xcu3xcv3xcw2l2m2ucy2lcz2ldl4mdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr4nfs3mft3mfu3mfv3mfw3mfz2w203k6o212m6m2dw2l2cq2l3t3m3u2l17s3r19m3m}'kerning'{cl{5kt4qw}201s{201sw}201t{201tw2wy2yy6q-t}201x{2wy2yy}2k{201tw}2w{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}2x{17ss5ts5os}2y{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}'fof'-6o6t{17ss5ts5qs}7t{5os}3v{5qs}7p{17su5tu5qs}ck{5kt4qw}4l{5kt4qw}cm{5kt4qw}cn{5kt4qw}co{5kt4qw}cp{5kt4qw}6l{4qs5ks5ou5qw5ru17su5tu}17s{2ks}5q{ckvclvcmvcnvcovcpv4lv}5r{ckuclucmucnucoucpu4lu}5t{2ks}6p{4qs5ks5ou5qw5ru17su5tu}ek{4qs5ks5ou5qw5ru17su5tu}el{4qs5ks5ou5qw5ru17su5tu}em{4qs5ks5ou5qw5ru17su5tu}en{4qs5ks5ou5qw5ru17su5tu}eo{4qs5ks5ou5qw5ru17su5tu}ep{4qs5ks5ou5qw5ru17su5tu}es{5ks5qs4qs}et{4qs5ks5ou5qw5ru17su5tu}eu{4qs5ks5qw5ru17su5tu}ev{5ks5qs4qs}ex{17ss5ts5qs}6z{4qv5ks5ou5qw5ru17su5tu}fm{4qv5ks5ou5qw5ru17su5tu}fn{4qv5ks5ou5qw5ru17su5tu}fo{4qv5ks5ou5qw5ru17su5tu}fp{4qv5ks5ou5qw5ru17su5tu}fq{4qv5ks5ou5qw5ru17su5tu}7r{5os}fs{4qv5ks5ou5qw5ru17su5tu}ft{17su5tu5qs}fu{17su5tu5qs}fv{17su5tu5qs}fw{17su5tu5qs}}}"), "Times-Roman": f("{'widths'{k3n2q4ycx2l201n3m201o6o201s2l201t2l201u2l201w2w201x2w201y2w2k1t2l2l202m2n2n3m2o3m2p5n202q6o2r1m2s2l2t2l2u3m2v3s2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v1w3w3s3x3s3y3s3z2w4k5w4l4s4m4m4n4m4o4s4p3x4q3r4r4s4s4s4t2l4u2r4v4s4w3x4x5t4y4s4z4s5k3r5l4s5m4m5n3r5o3x5p4s5q4s5r5y5s4s5t4s5u3x5v2l5w1w5x2l5y2z5z3m6k2l6l2w6m3m6n2w6o3m6p2w6q2l6r3m6s3m6t1w6u1w6v3m6w1w6x4y6y3m6z3m7k3m7l3m7m2l7n2r7o1w7p3m7q3m7r4s7s3m7t3m7u2w7v3k7w1o7x3k7y3q202l3mcl4sal2lam3man3mao3map3mar3mas2lat4wau1vav3maw3say4waz2lbk2sbl3s'fof'6obo2lbp3mbq2xbr1tbs2lbu1zbv3mbz2wck4s202k3mcm4scn4sco4scp4scq5tcr4mcs3xct3xcu3xcv3xcw2l2m2tcy2lcz2ldl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek2wel2wem2wen2weo2wep2weq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr3sfs3mft3mfu3mfv3mfw3mfz3m203k6o212m6m2dw2l2cq2l3t3m3u1w17s4s19m3m}'kerning'{cl{4qs5ku17sw5ou5qy5rw201ss5tw201ws}201s{201ss}201t{ckw4lwcmwcnwcowcpwclw4wu201ts}2k{201ts}2w{4qs5kw5os5qx5ru17sx5tx}2x{17sw5tw5ou5qu}2y{4qs5kw5os5qx5ru17sx5tx}'fof'-6o7t{ckuclucmucnucoucpu4lu5os5rs}3u{17su5tu5qs}3v{17su5tu5qs}7p{17sw5tw5qs}ck{4qs5ku17sw5ou5qy5rw201ss5tw201ws}4l{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cm{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cn{4qs5ku17sw5ou5qy5rw201ss5tw201ws}co{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cp{4qs5ku17sw5ou5qy5rw201ss5tw201ws}6l{17su5tu5os5qw5rs}17s{2ktclvcmvcnvcovcpv4lv4wuckv}5o{ckwclwcmwcnwcowcpw4lw4wu}5q{ckyclycmycnycoycpy4ly4wu5ms}5r{cktcltcmtcntcotcpt4lt4ws}5t{2ktclvcmvcnvcovcpv4lv4wuckv}7q{cksclscmscnscoscps4ls}6p{17su5tu5qw5rs}ek{5qs5rs}el{17su5tu5os5qw5rs}em{17su5tu5os5qs5rs}en{17su5qs5rs}eo{5qs5rs}ep{17su5tu5os5qw5rs}es{5qs}et{17su5tu5qw5rs}eu{17su5tu5qs5rs}ev{5qs}6z{17sv5tv5os5qx5rs}fm{5os5qt5rs}fn{17sv5tv5os5qx5rs}fo{17sv5tv5os5qx5rs}fp{5os5qt5rs}fq{5os5qt5rs}7r{ckuclucmucnucoucpu4lu5os}fs{17sv5tv5os5qx5rs}ft{17ss5ts5qs}fu{17sw5tw5qs}fv{17sw5tw5qs}fw{17ss5ts5qs}fz{ckuclucmucnucoucpu4lu5os5rs}}}"), "Helvetica-Oblique": f("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}") } };
- n.events.push(["addFont", function(k) {
- var p = k.font, j = _.Unicode[p.postScriptName];
- j && (p.metadata.Unicode = {}, p.metadata.Unicode.widths = j.widths, p.metadata.Unicode.kerning = j.kerning);
- var O = m.Unicode[p.postScriptName];
- O && (p.metadata.Unicode.encoding = O, p.encoding = O.codePages[0]);
- }]);
- }(Tt.API), /**
- * @license
- * Licensed under the MIT License.
- * http://opensource.org/licenses/mit-license
- */
- function(n) {
- var e = function(t) {
- for (var i = t.length, s = new Uint8Array(i), a = 0; a < i; a++) s[a] = t.charCodeAt(a);
- return s;
- };
- n.API.events.push(["addFont", function(t) {
- var i = void 0, s = t.font, a = t.instance;
- if (!s.isStandardFont) {
- if (a === void 0) throw new Error("Font does not exist in vFS, import fonts or remove declaration doc.addFont('" + s.postScriptName + "').");
- if (typeof (i = a.existsFileInVFS(s.postScriptName) === !1 ? a.loadFile(s.postScriptName) : a.getFileFromVFS(s.postScriptName)) != "string") throw new Error("Font is not stored as string-data in vFS, import fonts or remove declaration doc.addFont('" + s.postScriptName + "').");
- (function(c, l) {
- l = /^\x00\x01\x00\x00/.test(l) ? e(l) : e(Ns(l)), c.metadata = n.API.TTFFont.open(l), c.metadata.Unicode = c.metadata.Unicode || { encoding: {}, kerning: {}, widths: [] }, c.metadata.glyIdsUsed = [0];
- })(s, i);
- }
- }]);
- }(Tt), Tt.API.addSvgAsImage = function(n, e, t, i, s, a, c, l) {
- if (isNaN(e) || isNaN(t)) throw Le.error("jsPDF.addSvgAsImage: Invalid coordinates", arguments), new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");
- if (isNaN(i) || isNaN(s)) throw Le.error("jsPDF.addSvgAsImage: Invalid measurements", arguments), new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");
- var f = document.createElement("canvas");
- f.width = i, f.height = s;
- var d = f.getContext("2d");
- d.fillStyle = "#fff", d.fillRect(0, 0, f.width, f.height);
- var m = { ignoreMouse: !0, ignoreAnimation: !0, ignoreDimensions: !0 }, _ = this;
- return (Kt.canvg ? Promise.resolve(Kt.canvg) : import("./index.es.js")).catch(function(k) {
- return Promise.reject(new Error("Could not load canvg: " + k));
- }).then(function(k) {
- return k.default ? k.default : k;
- }).then(function(k) {
- return k.fromString(d, n, m);
- }, function() {
- return Promise.reject(new Error("Could not load canvg."));
- }).then(function(k) {
- return k.render(m);
- }).then(function() {
- _.addImage(f.toDataURL("image/jpeg", 1), e, t, i, s, c, l);
- });
- }, Tt.API.putTotalPages = function(n) {
- var e, t = 0;
- parseInt(this.internal.getFont().id.substr(1), 10) < 15 ? (e = new RegExp(n, "g"), t = this.internal.getNumberOfPages()) : (e = new RegExp(this.pdfEscape16(n, this.internal.getFont()), "g"), t = this.pdfEscape16(this.internal.getNumberOfPages() + "", this.internal.getFont()));
- for (var i = 1; i <= this.internal.getNumberOfPages(); i++) for (var s = 0; s < this.internal.pages[i].length; s++) this.internal.pages[i][s] = this.internal.pages[i][s].replace(e, t);
- return this;
- }, Tt.API.viewerPreferences = function(n, e) {
- var t;
- n = n || {}, e = e || !1;
- var i, s, a, c = { HideToolbar: { defaultValue: !1, value: !1, type: "boolean", explicitSet: !1, valueSet: [!0, !1], pdfVersion: 1.3 }, HideMenubar: { defaultValue: !1, value: !1, type: "boolean", explicitSet: !1, valueSet: [!0, !1], pdfVersion: 1.3 }, HideWindowUI: { defaultValue: !1, value: !1, type: "boolean", explicitSet: !1, valueSet: [!0, !1], pdfVersion: 1.3 }, FitWindow: { defaultValue: !1, value: !1, type: "boolean", explicitSet: !1, valueSet: [!0, !1], pdfVersion: 1.3 }, CenterWindow: { defaultValue: !1, value: !1, type: "boolean", explicitSet: !1, valueSet: [!0, !1], pdfVersion: 1.3 }, DisplayDocTitle: { defaultValue: !1, value: !1, type: "boolean", explicitSet: !1, valueSet: [!0, !1], pdfVersion: 1.4 }, NonFullScreenPageMode: { defaultValue: "UseNone", value: "UseNone", type: "name", explicitSet: !1, valueSet: ["UseNone", "UseOutlines", "UseThumbs", "UseOC"], pdfVersion: 1.3 }, Direction: { defaultValue: "L2R", value: "L2R", type: "name", explicitSet: !1, valueSet: ["L2R", "R2L"], pdfVersion: 1.3 }, ViewArea: { defaultValue: "CropBox", value: "CropBox", type: "name", explicitSet: !1, valueSet: ["MediaBox", "CropBox", "TrimBox", "BleedBox", "ArtBox"], pdfVersion: 1.4 }, ViewClip: { defaultValue: "CropBox", value: "CropBox", type: "name", explicitSet: !1, valueSet: ["MediaBox", "CropBox", "TrimBox", "BleedBox", "ArtBox"], pdfVersion: 1.4 }, PrintArea: { defaultValue: "CropBox", value: "CropBox", type: "name", explicitSet: !1, valueSet: ["MediaBox", "CropBox", "TrimBox", "BleedBox", "ArtBox"], pdfVersion: 1.4 }, PrintClip: { defaultValue: "CropBox", value: "CropBox", type: "name", explicitSet: !1, valueSet: ["MediaBox", "CropBox", "TrimBox", "BleedBox", "ArtBox"], pdfVersion: 1.4 }, PrintScaling: { defaultValue: "AppDefault", value: "AppDefault", type: "name", explicitSet: !1, valueSet: ["AppDefault", "None"], pdfVersion: 1.6 }, Duplex: { defaultValue: "", value: "none", type: "name", explicitSet: !1, valueSet: ["Simplex", "DuplexFlipShortEdge", "DuplexFlipLongEdge", "none"], pdfVersion: 1.7 }, PickTrayByPDFSize: { defaultValue: !1, value: !1, type: "boolean", explicitSet: !1, valueSet: [!0, !1], pdfVersion: 1.7 }, PrintPageRange: { defaultValue: "", value: "", type: "array", explicitSet: !1, valueSet: null, pdfVersion: 1.7 }, NumCopies: { defaultValue: 1, value: 1, type: "integer", explicitSet: !1, valueSet: null, pdfVersion: 1.7 } }, l = Object.keys(c), f = [], d = 0, m = 0, _ = 0;
- function k(j, O) {
- var M, S = !1;
- for (M = 0; M < j.length; M += 1) j[M] === O && (S = !0);
- return S;
- }
- if (this.internal.viewerpreferences === void 0 && (this.internal.viewerpreferences = {}, this.internal.viewerpreferences.configuration = JSON.parse(JSON.stringify(c)), this.internal.viewerpreferences.isSubscribed = !1), t = this.internal.viewerpreferences.configuration, n === "reset" || e === !0) {
- var p = l.length;
- for (_ = 0; _ < p; _ += 1) t[l[_]].value = t[l[_]].defaultValue, t[l[_]].explicitSet = !1;
- }
- if (Se(n) === "object") {
- for (s in n) if (a = n[s], k(l, s) && a !== void 0) {
- if (t[s].type === "boolean" && typeof a == "boolean") t[s].value = a;
- else if (t[s].type === "name" && k(t[s].valueSet, a)) t[s].value = a;
- else if (t[s].type === "integer" && Number.isInteger(a)) t[s].value = a;
- else if (t[s].type === "array") {
- for (d = 0; d < a.length; d += 1) if (i = !0, a[d].length === 1 && typeof a[d][0] == "number") f.push(String(a[d] - 1));
- else if (a[d].length > 1) {
- for (m = 0; m < a[d].length; m += 1) typeof a[d][m] != "number" && (i = !1);
- i === !0 && f.push([a[d][0] - 1, a[d][1] - 1].join(" "));
- }
- t[s].value = "[" + f.join(" ") + "]";
- } else t[s].value = t[s].defaultValue;
- t[s].explicitSet = !0;
- }
- }
- return this.internal.viewerpreferences.isSubscribed === !1 && (this.internal.events.subscribe("putCatalog", function() {
- var j, O = [];
- for (j in t) t[j].explicitSet === !0 && (t[j].type === "name" ? O.push("/" + j + " /" + t[j].value) : O.push("/" + j + " " + t[j].value));
- O.length !== 0 && this.internal.write(`/ViewerPreferences
- <<
- ` + O.join(`
- `) + `
- >>`);
- }), this.internal.viewerpreferences.isSubscribed = !0), this.internal.viewerpreferences.configuration = t, this;
- }, Tt.API.addMetadata = function(n, e) {
- return this.internal.__metadata__ === void 0 && (this.internal.__metadata__ = { metadata: n, namespaceUri: e != null ? e : "http://jspdf.default.namespaceuri/", rawXml: typeof e == "boolean" && e }, this.internal.events.subscribe("putCatalog", t2), this.internal.events.subscribe("postPutResources", Q1)), this;
- }, function(n) {
- var e = n.API, t = e.pdfEscape16 = function(a, c) {
- for (var l, f = c.metadata.Unicode.widths, d = ["", "0", "00", "000", "0000"], m = [""], _ = 0, k = a.length; _ < k; ++_) {
- if (l = c.metadata.characterToGlyph(a.charCodeAt(_)), c.metadata.glyIdsUsed.push(l), c.metadata.toUnicode[l] = a.charCodeAt(_), f.indexOf(l) == -1 && (f.push(l), f.push([parseInt(c.metadata.widthOfGlyph(l), 10)])), l == "0") return m.join("");
- l = l.toString(16), m.push(d[4 - l.length], l);
- }
- return m.join("");
- }, i = function(a) {
- var c, l, f, d, m, _, k;
- for (m = `/CIDInit /ProcSet findresource begin
- 12 dict begin
- begincmap
- /CIDSystemInfo <<
- /Registry (Adobe)
- /Ordering (UCS)
- /Supplement 0
- >> def
- /CMapName /Adobe-Identity-UCS def
- /CMapType 2 def
- 1 begincodespacerange
- <0000><ffff>
- endcodespacerange`, f = [], _ = 0, k = (l = Object.keys(a).sort(function(p, j) {
- return p - j;
- })).length; _ < k; _++) c = l[_], f.length >= 100 && (m += `
- ` + f.length + ` beginbfchar
- ` + f.join(`
- `) + `
- endbfchar`, f = []), a[c] !== void 0 && a[c] !== null && typeof a[c].toString == "function" && (d = ("0000" + a[c].toString(16)).slice(-4), c = ("0000" + (+c).toString(16)).slice(-4), f.push("<" + c + "><" + d + ">"));
- return f.length && (m += `
- ` + f.length + ` beginbfchar
- ` + f.join(`
- `) + `
- endbfchar
- `), m + `endcmap
- CMapName currentdict /CMap defineresource pop
- end
- end`;
- };
- e.events.push(["putFont", function(a) {
- (function(c) {
- var l = c.font, f = c.out, d = c.newObject, m = c.putStream;
- if (l.metadata instanceof n.API.TTFFont && l.encoding === "Identity-H") {
- for (var _ = l.metadata.Unicode.widths, k = l.metadata.subset.encode(l.metadata.glyIdsUsed, 1), p = "", j = 0; j < k.length; j++) p += String.fromCharCode(k[j]);
- var O = d();
- m({ data: p, addLength1: !0, objectId: O }), f("endobj");
- var M = d();
- m({ data: i(l.metadata.toUnicode), addLength1: !0, objectId: M }), f("endobj");
- var S = d();
- f("<<"), f("/Type /FontDescriptor"), f("/FontName /" + Zi(l.fontName)), f("/FontFile2 " + O + " 0 R"), f("/FontBBox " + n.API.PDFObject.convert(l.metadata.bbox)), f("/Flags " + l.metadata.flags), f("/StemV " + l.metadata.stemV), f("/ItalicAngle " + l.metadata.italicAngle), f("/Ascent " + l.metadata.ascender), f("/Descent " + l.metadata.decender), f("/CapHeight " + l.metadata.capHeight), f(">>"), f("endobj");
- var V = d();
- f("<<"), f("/Type /Font"), f("/BaseFont /" + Zi(l.fontName)), f("/FontDescriptor " + S + " 0 R"), f("/W " + n.API.PDFObject.convert(_)), f("/CIDToGIDMap /Identity"), f("/DW 1000"), f("/Subtype /CIDFontType2"), f("/CIDSystemInfo"), f("<<"), f("/Supplement 0"), f("/Registry (Adobe)"), f("/Ordering (" + l.encoding + ")"), f(">>"), f(">>"), f("endobj"), l.objectNumber = d(), f("<<"), f("/Type /Font"), f("/Subtype /Type0"), f("/ToUnicode " + M + " 0 R"), f("/BaseFont /" + Zi(l.fontName)), f("/Encoding /" + l.encoding), f("/DescendantFonts [" + V + " 0 R]"), f(">>"), f("endobj"), l.isAlreadyPutted = !0;
- }
- })(a);
- }]), e.events.push(["putFont", function(a) {
- (function(c) {
- var l = c.font, f = c.out, d = c.newObject, m = c.putStream;
- if (l.metadata instanceof n.API.TTFFont && l.encoding === "WinAnsiEncoding") {
- for (var _ = l.metadata.rawData, k = "", p = 0; p < _.length; p++) k += String.fromCharCode(_[p]);
- var j = d();
- m({ data: k, addLength1: !0, objectId: j }), f("endobj");
- var O = d();
- m({ data: i(l.metadata.toUnicode), addLength1: !0, objectId: O }), f("endobj");
- var M = d();
- f("<<"), f("/Descent " + l.metadata.decender), f("/CapHeight " + l.metadata.capHeight), f("/StemV " + l.metadata.stemV), f("/Type /FontDescriptor"), f("/FontFile2 " + j + " 0 R"), f("/Flags 96"), f("/FontBBox " + n.API.PDFObject.convert(l.metadata.bbox)), f("/FontName /" + Zi(l.fontName)), f("/ItalicAngle " + l.metadata.italicAngle), f("/Ascent " + l.metadata.ascender), f(">>"), f("endobj"), l.objectNumber = d();
- for (var S = 0; S < l.metadata.hmtx.widths.length; S++) l.metadata.hmtx.widths[S] = parseInt(l.metadata.hmtx.widths[S] * (1e3 / l.metadata.head.unitsPerEm));
- f("<</Subtype/TrueType/Type/Font/ToUnicode " + O + " 0 R/BaseFont/" + Zi(l.fontName) + "/FontDescriptor " + M + " 0 R/Encoding/" + l.encoding + " /FirstChar 29 /LastChar 255 /Widths " + n.API.PDFObject.convert(l.metadata.hmtx.widths) + ">>"), f("endobj"), l.isAlreadyPutted = !0;
- }
- })(a);
- }]);
- var s = function(a) {
- var c, l = a.text || "", f = a.x, d = a.y, m = a.options || {}, _ = a.mutex || {}, k = _.pdfEscape, p = _.activeFontKey, j = _.fonts, O = p, M = "", S = 0, V = "", G = j[O].encoding;
- if (j[O].encoding !== "Identity-H") return { text: l, x: f, y: d, options: m, mutex: _ };
- for (V = l, O = p, Array.isArray(l) && (V = l[0]), S = 0; S < V.length; S += 1) j[O].metadata.hasOwnProperty("cmap") && (c = j[O].metadata.cmap.unicode.codeMap[V[S].charCodeAt(0)]), c || V[S].charCodeAt(0) < 256 && j[O].metadata.hasOwnProperty("Unicode") ? M += V[S] : M += "";
- var q = "";
- return parseInt(O.slice(1)) < 14 || G === "WinAnsiEncoding" ? q = k(M, O).split("").map(function(it) {
- return it.charCodeAt(0).toString(16);
- }).join("") : G === "Identity-H" && (q = t(M, j[O])), _.isHex = !0, { text: q, x: f, y: d, options: m, mutex: _ };
- };
- e.events.push(["postProcessText", function(a) {
- var c = a.text || "", l = [], f = { text: c, x: a.x, y: a.y, options: a.options, mutex: a.mutex };
- if (Array.isArray(c)) {
- var d = 0;
- for (d = 0; d < c.length; d += 1) Array.isArray(c[d]) && c[d].length === 3 ? l.push([s(Object.assign({}, f, { text: c[d][0] })).text, c[d][1], c[d][2]]) : l.push(s(Object.assign({}, f, { text: c[d] })).text);
- a.text = l;
- } else a.text = s(Object.assign({}, f, { text: c })).text;
- }]);
- }(Tt), /**
- * @license
- * jsPDF virtual FileSystem functionality
- *
- * Licensed under the MIT License.
- * http://opensource.org/licenses/mit-license
- */
- function(n) {
- var e = function() {
- return this.internal.vFS === void 0 && (this.internal.vFS = {}), !0;
- };
- n.existsFileInVFS = function(t) {
- return e.call(this), this.internal.vFS[t] !== void 0;
- }, n.addFileToVFS = function(t, i) {
- return e.call(this), this.internal.vFS[t] = i, this;
- }, n.getFileFromVFS = function(t) {
- return e.call(this), this.internal.vFS[t] !== void 0 ? this.internal.vFS[t] : null;
- };
- }(Tt.API), /**
- * @license
- * Unicode Bidi Engine based on the work of Alex Shensis (@asthensis)
- * MIT License
- */
- function(n) {
- n.__bidiEngine__ = n.prototype.__bidiEngine__ = function(i) {
- var s, a, c, l, f, d, m, _ = e, k = [[0, 3, 0, 1, 0, 0, 0], [0, 3, 0, 1, 2, 2, 0], [0, 3, 0, 17, 2, 0, 1], [0, 3, 5, 5, 4, 1, 0], [0, 3, 21, 21, 4, 0, 1], [0, 3, 5, 5, 4, 2, 0]], p = [[2, 0, 1, 1, 0, 1, 0], [2, 0, 1, 1, 0, 2, 0], [2, 0, 2, 1, 3, 2, 0], [2, 0, 2, 33, 3, 1, 1]], j = { L: 0, R: 1, EN: 2, AN: 3, N: 4, B: 5, S: 6 }, O = { 0: 0, 5: 1, 6: 2, 7: 3, 32: 4, 251: 5, 254: 6, 255: 7 }, M = ["(", ")", "(", "<", ">", "<", "[", "]", "[", "{", "}", "{", "«", "»", "«", "‹", "›", "‹", "⁅", "⁆", "⁅", "⁽", "⁾", "⁽", "₍", "₎", "₍", "≤", "≥", "≤", "〈", "〉", "〈", "﹙", "﹚", "﹙", "﹛", "﹜", "﹛", "﹝", "﹞", "﹝", "﹤", "﹥", "﹤"], S = new RegExp(/^([1-4|9]|1[0-9]|2[0-9]|3[0168]|4[04589]|5[012]|7[78]|159|16[0-9]|17[0-2]|21[569]|22[03489]|250)$/), V = !1, G = 0;
- this.__bidiEngine__ = {};
- var q = function(N) {
- var E = N.charCodeAt(), z = E >> 8, U = O[z];
- return U !== void 0 ? _[256 * U + (255 & E)] : z === 252 || z === 253 ? "AL" : S.test(z) ? "L" : z === 8 ? "R" : "N";
- }, it = function(N) {
- for (var E, z = 0; z < N.length; z++) {
- if ((E = q(N.charAt(z))) === "L") return !1;
- if (E === "R") return !0;
- }
- return !1;
- }, vt = function(N, E, z, U) {
- var rt, ot, ht, nt, ct = E[U];
- switch (ct) {
- case "L":
- case "R":
- case "LRE":
- case "RLE":
- case "LRO":
- case "RLO":
- case "PDF":
- V = !1;
- break;
- case "N":
- case "AN":
- break;
- case "EN":
- V && (ct = "AN");
- break;
- case "AL":
- V = !0, ct = "R";
- break;
- case "WS":
- case "BN":
- ct = "N";
- break;
- case "CS":
- U < 1 || U + 1 >= E.length || (rt = z[U - 1]) !== "EN" && rt !== "AN" || (ot = E[U + 1]) !== "EN" && ot !== "AN" ? ct = "N" : V && (ot = "AN"), ct = ot === rt ? ot : "N";
- break;
- case "ES":
- ct = (rt = U > 0 ? z[U - 1] : "B") === "EN" && U + 1 < E.length && E[U + 1] === "EN" ? "EN" : "N";
- break;
- case "ET":
- if (U > 0 && z[U - 1] === "EN") {
- ct = "EN";
- break;
- }
- if (V) {
- ct = "N";
- break;
- }
- for (ht = U + 1, nt = E.length; ht < nt && E[ht] === "ET"; ) ht++;
- ct = ht < nt && E[ht] === "EN" ? "EN" : "N";
- break;
- case "NSM":
- if (c && !l) {
- for (nt = E.length, ht = U + 1; ht < nt && E[ht] === "NSM"; ) ht++;
- if (ht < nt) {
- var At = N[U], wt = At >= 1425 && At <= 2303 || At === 64286;
- if (rt = E[ht], wt && (rt === "R" || rt === "AL")) {
- ct = "R";
- break;
- }
- }
- }
- ct = U < 1 || (rt = E[U - 1]) === "B" ? "N" : z[U - 1];
- break;
- case "B":
- V = !1, s = !0, ct = G;
- break;
- case "S":
- a = !0, ct = "N";
- }
- return ct;
- }, dt = function(N, E, z) {
- var U = N.split("");
- return z && X(U, z, { hiLevel: G }), U.reverse(), E && E.reverse(), U.join("");
- }, X = function(N, E, z) {
- var U, rt, ot, ht, nt, ct = -1, At = N.length, wt = 0, x = [], B = G ? p : k, T = [];
- for (V = !1, s = !1, a = !1, rt = 0; rt < At; rt++) T[rt] = q(N[rt]);
- for (ot = 0; ot < At; ot++) {
- if (nt = wt, x[ot] = vt(N, T, x, ot), U = 240 & (wt = B[nt][j[x[ot]]]), wt &= 15, E[ot] = ht = B[wt][5], U > 0) if (U === 16) {
- for (rt = ct; rt < ot; rt++) E[rt] = 1;
- ct = -1;
- } else ct = -1;
- if (B[wt][6]) ct === -1 && (ct = ot);
- else if (ct > -1) {
- for (rt = ct; rt < ot; rt++) E[rt] = ht;
- ct = -1;
- }
- T[ot] === "B" && (E[ot] = 0), z.hiLevel |= ht;
- }
- a && function(H, J, Z) {
- for (var at = 0; at < Z; at++) if (H[at] === "S") {
- J[at] = G;
- for (var st = at - 1; st >= 0 && H[st] === "WS"; st--) J[st] = G;
- }
- }(T, E, At);
- }, R = function(N, E, z, U, rt) {
- if (!(rt.hiLevel < N)) {
- if (N === 1 && G === 1 && !s) return E.reverse(), void (z && z.reverse());
- for (var ot, ht, nt, ct, At = E.length, wt = 0; wt < At; ) {
- if (U[wt] >= N) {
- for (nt = wt + 1; nt < At && U[nt] >= N; ) nt++;
- for (ct = wt, ht = nt - 1; ct < ht; ct++, ht--) ot = E[ct], E[ct] = E[ht], E[ht] = ot, z && (ot = z[ct], z[ct] = z[ht], z[ht] = ot);
- wt = nt;
- }
- wt++;
- }
- }
- }, tt = function(N, E, z) {
- var U = N.split(""), rt = { hiLevel: G };
- return z || (z = []), X(U, z, rt), function(ot, ht, nt) {
- if (nt.hiLevel !== 0 && m) for (var ct, At = 0; At < ot.length; At++) ht[At] === 1 && (ct = M.indexOf(ot[At])) >= 0 && (ot[At] = M[ct + 1]);
- }(U, z, rt), R(2, U, E, z, rt), R(1, U, E, z, rt), U.join("");
- };
- return this.__bidiEngine__.doBidiReorder = function(N, E, z) {
- if (function(rt, ot) {
- if (ot) for (var ht = 0; ht < rt.length; ht++) ot[ht] = ht;
- l === void 0 && (l = it(rt)), d === void 0 && (d = it(rt));
- }(N, E), c || !f || d) if (c && f && l ^ d) G = l ? 1 : 0, N = dt(N, E, z);
- else if (!c && f && d) G = l ? 1 : 0, N = tt(N, E, z), N = dt(N, E);
- else if (!c || l || f || d) {
- if (c && !f && l ^ d) N = dt(N, E), l ? (G = 0, N = tt(N, E, z)) : (G = 1, N = tt(N, E, z), N = dt(N, E));
- else if (c && l && !f && d) G = 1, N = tt(N, E, z), N = dt(N, E);
- else if (!c && !f && l ^ d) {
- var U = m;
- l ? (G = 1, N = tt(N, E, z), G = 0, m = !1, N = tt(N, E, z), m = U) : (G = 0, N = tt(N, E, z), N = dt(N, E), G = 1, m = !1, N = tt(N, E, z), m = U, N = dt(N, E));
- }
- } else G = 0, N = tt(N, E, z);
- else G = l ? 1 : 0, N = tt(N, E, z);
- return N;
- }, this.__bidiEngine__.setOptions = function(N) {
- N && (c = N.isInputVisual, f = N.isOutputVisual, l = N.isInputRtl, d = N.isOutputRtl, m = N.isSymmetricSwapping);
- }, this.__bidiEngine__.setOptions(i), this.__bidiEngine__;
- };
- var e = ["BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "S", "B", "S", "WS", "B", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "B", "B", "B", "S", "WS", "N", "N", "ET", "ET", "ET", "N", "N", "N", "N", "N", "ES", "CS", "ES", "CS", "CS", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "CS", "N", "N", "N", "N", "N", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "N", "N", "N", "N", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "N", "N", "N", "BN", "BN", "BN", "BN", "BN", "BN", "B", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "CS", "N", "ET", "ET", "ET", "ET", "N", "N", "N", "N", "L", "N", "N", "BN", "N", "N", "ET", "ET", "EN", "EN", "N", "L", "N", "N", "N", "EN", "L", "N", "N", "N", "N", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "N", "L", "L", "L", "L", "L", "L", "L", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "L", "N", "N", "N", "N", "N", "ET", "N", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "R", "NSM", "R", "NSM", "NSM", "R", "NSM", "NSM", "R", "NSM", "N", "N", "N", "N", "N", "N", "N", "N", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "N", "N", "N", "N", "N", "R", "R", "R", "R", "R", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "AN", "AN", "AN", "AN", "AN", "AN", "N", "N", "AL", "ET", "ET", "AL", "CS", "AL", "N", "N", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "AL", "AL", "N", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "AN", "AN", "AN", "AN", "AN", "AN", "AN", "AN", "AN", "AN", "ET", "AN", "AN", "AL", "AL", "AL", "NSM", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "AN", "N", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "AL", "AL", "NSM", "NSM", "N", "NSM", "NSM", "NSM", "NSM", "AL", "AL", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "N", "AL", "AL", "NSM", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "N", "N", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "AL", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "R", "R", "N", "N", "N", "N", "R", "N", "N", "N", "N", "N", "WS", "WS", "WS", "WS", "WS", "WS", "WS", "WS", "WS", "WS", "WS", "BN", "BN", "BN", "L", "R", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "WS", "B", "LRE", "RLE", "PDF", "LRO", "RLO", "CS", "ET", "ET", "ET", "ET", "ET", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "CS", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "WS", "BN", "BN", "BN", "BN", "BN", "N", "LRI", "RLI", "FSI", "PDI", "BN", "BN", "BN", "BN", "BN", "BN", "EN", "L", "N", "N", "EN", "EN", "EN", "EN", "EN", "EN", "ES", "ES", "N", "N", "N", "L", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "ES", "ES", "N", "N", "N", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "N", "N", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "L", "L", "L", "L", "L", "L", "L", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "L", "L", "L", "L", "L", "N", "N", "N", "N", "N", "R", "NSM", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "ES", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "N", "R", "R", "R", "R", "R", "N", "R", "N", "R", "R", "N", "R", "R", "N", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "CS", "N", "CS", "N", "N", "CS", "N", "N", "N", "N", "N", "N", "N", "N", "N", "ET", "N", "N", "ES", "ES", "N", "N", "N", "N", "N", "ET", "ET", "N", "N", "N", "N", "N", "AL", "AL", "AL", "AL", "AL", "N", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "N", "N", "BN", "N", "N", "N", "ET", "ET", "ET", "N", "N", "N", "N", "N", "ES", "CS", "ES", "CS", "CS", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "CS", "N", "N", "N", "N", "N", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "N", "N", "N", "N", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "N", "N", "L", "L", "L", "L", "L", "L", "N", "N", "L", "L", "L", "L", "L", "L", "N", "N", "L", "L", "L", "L", "L", "L", "N", "N", "L", "L", "L", "N", "N", "N", "ET", "ET", "N", "N", "N", "ET", "ET", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N"], t = new n.__bidiEngine__({ isInputVisual: !0 });
- n.API.events.push(["postProcessText", function(i) {
- var s = i.text;
- i.x, i.y;
- var a = i.options || {};
- i.mutex, a.lang;
- var c = [];
- if (a.isInputVisual = typeof a.isInputVisual != "boolean" || a.isInputVisual, t.setOptions(a), Object.prototype.toString.call(s) === "[object Array]") {
- var l = 0;
- for (c = [], l = 0; l < s.length; l += 1) Object.prototype.toString.call(s[l]) === "[object Array]" ? c.push([t.doBidiReorder(s[l][0]), s[l][1], s[l][2]]) : c.push([t.doBidiReorder(s[l])]);
- i.text = c;
- } else i.text = t.doBidiReorder(s);
- t.setOptions({ isInputVisual: !0 });
- }]);
- }(Tt), Tt.API.TTFFont = function() {
- function n(e) {
- var t;
- if (this.rawData = e, t = this.contents = new Zr(e), this.contents.pos = 4, t.readString(4) === "ttcf") throw new Error("TTCF not supported.");
- t.pos = 0, this.parse(), this.subset = new g2(this), this.registerTTF();
- }
- return n.open = function(e) {
- return new n(e);
- }, n.prototype.parse = function() {
- return this.directory = new e2(this.contents), this.head = new r2(this), this.name = new l2(this), this.cmap = new Th(this), this.toUnicode = {}, this.hhea = new i2(this), this.maxp = new u2(this), this.hmtx = new h2(this), this.post = new s2(this), this.os2 = new a2(this), this.loca = new p2(this), this.glyf = new f2(this), this.ascender = this.os2.exists && this.os2.ascender || this.hhea.ascender, this.decender = this.os2.exists && this.os2.decender || this.hhea.decender, this.lineGap = this.os2.exists && this.os2.lineGap || this.hhea.lineGap, this.bbox = [this.head.xMin, this.head.yMin, this.head.xMax, this.head.yMax];
- }, n.prototype.registerTTF = function() {
- var e, t, i, s, a;
- if (this.scaleFactor = 1e3 / this.head.unitsPerEm, this.bbox = function() {
- var c, l, f, d;
- for (d = [], c = 0, l = (f = this.bbox).length; c < l; c++) e = f[c], d.push(Math.round(e * this.scaleFactor));
- return d;
- }.call(this), this.stemV = 0, this.post.exists ? (i = 255 & (s = this.post.italic_angle), 32768 & (t = s >> 16) && (t = -(1 + (65535 ^ t))), this.italicAngle = +(t + "." + i)) : this.italicAngle = 0, this.ascender = Math.round(this.ascender * this.scaleFactor), this.decender = Math.round(this.decender * this.scaleFactor), this.lineGap = Math.round(this.lineGap * this.scaleFactor), this.capHeight = this.os2.exists && this.os2.capHeight || this.ascender, this.xHeight = this.os2.exists && this.os2.xHeight || 0, this.familyClass = (this.os2.exists && this.os2.familyClass || 0) >> 8, this.isSerif = (a = this.familyClass) === 1 || a === 2 || a === 3 || a === 4 || a === 5 || a === 7, this.isScript = this.familyClass === 10, this.flags = 0, this.post.isFixedPitch && (this.flags |= 1), this.isSerif && (this.flags |= 2), this.isScript && (this.flags |= 8), this.italicAngle !== 0 && (this.flags |= 64), this.flags |= 32, !this.cmap.unicode) throw new Error("No unicode cmap for font");
- }, n.prototype.characterToGlyph = function(e) {
- var t;
- return ((t = this.cmap.unicode) != null ? t.codeMap[e] : void 0) || 0;
- }, n.prototype.widthOfGlyph = function(e) {
- var t;
- return t = 1e3 / this.head.unitsPerEm, this.hmtx.forGlyph(e).advance * t;
- }, n.prototype.widthOfString = function(e, t, i) {
- var s, a, c, l;
- for (c = 0, a = 0, l = (e = "" + e).length; 0 <= l ? a < l : a > l; a = 0 <= l ? ++a : --a) s = e.charCodeAt(a), c += this.widthOfGlyph(this.characterToGlyph(s)) + i * (1e3 / t) || 0;
- return c * (t / 1e3);
- }, n.prototype.lineHeight = function(e, t) {
- var i;
- return t == null && (t = !1), i = t ? this.lineGap : 0, (this.ascender + i - this.decender) / 1e3 * e;
- }, n;
- }();
- var nr, Zr = function() {
- function n(e) {
- this.data = e != null ? e : [], this.pos = 0, this.length = this.data.length;
- }
- return n.prototype.readByte = function() {
- return this.data[this.pos++];
- }, n.prototype.writeByte = function(e) {
- return this.data[this.pos++] = e;
- }, n.prototype.readUInt32 = function() {
- return 16777216 * this.readByte() + (this.readByte() << 16) + (this.readByte() << 8) + this.readByte();
- }, n.prototype.writeUInt32 = function(e) {
- return this.writeByte(e >>> 24 & 255), this.writeByte(e >> 16 & 255), this.writeByte(e >> 8 & 255), this.writeByte(255 & e);
- }, n.prototype.readInt32 = function() {
- var e;
- return (e = this.readUInt32()) >= 2147483648 ? e - 4294967296 : e;
- }, n.prototype.writeInt32 = function(e) {
- return e < 0 && (e += 4294967296), this.writeUInt32(e);
- }, n.prototype.readUInt16 = function() {
- return this.readByte() << 8 | this.readByte();
- }, n.prototype.writeUInt16 = function(e) {
- return this.writeByte(e >> 8 & 255), this.writeByte(255 & e);
- }, n.prototype.readInt16 = function() {
- var e;
- return (e = this.readUInt16()) >= 32768 ? e - 65536 : e;
- }, n.prototype.writeInt16 = function(e) {
- return e < 0 && (e += 65536), this.writeUInt16(e);
- }, n.prototype.readString = function(e) {
- var t, i;
- for (i = [], t = 0; 0 <= e ? t < e : t > e; t = 0 <= e ? ++t : --t) i[t] = String.fromCharCode(this.readByte());
- return i.join("");
- }, n.prototype.writeString = function(e) {
- var t, i, s;
- for (s = [], t = 0, i = e.length; 0 <= i ? t < i : t > i; t = 0 <= i ? ++t : --t) s.push(this.writeByte(e.charCodeAt(t)));
- return s;
- }, n.prototype.readShort = function() {
- return this.readInt16();
- }, n.prototype.writeShort = function(e) {
- return this.writeInt16(e);
- }, n.prototype.readLongLong = function() {
- var e, t, i, s, a, c, l, f;
- return e = this.readByte(), t = this.readByte(), i = this.readByte(), s = this.readByte(), a = this.readByte(), c = this.readByte(), l = this.readByte(), f = this.readByte(), 128 & e ? -1 * (72057594037927940 * (255 ^ e) + 281474976710656 * (255 ^ t) + 1099511627776 * (255 ^ i) + 4294967296 * (255 ^ s) + 16777216 * (255 ^ a) + 65536 * (255 ^ c) + 256 * (255 ^ l) + (255 ^ f) + 1) : 72057594037927940 * e + 281474976710656 * t + 1099511627776 * i + 4294967296 * s + 16777216 * a + 65536 * c + 256 * l + f;
- }, n.prototype.writeLongLong = function(e) {
- var t, i;
- return t = Math.floor(e / 4294967296), i = 4294967295 & e, this.writeByte(t >> 24 & 255), this.writeByte(t >> 16 & 255), this.writeByte(t >> 8 & 255), this.writeByte(255 & t), this.writeByte(i >> 24 & 255), this.writeByte(i >> 16 & 255), this.writeByte(i >> 8 & 255), this.writeByte(255 & i);
- }, n.prototype.readInt = function() {
- return this.readInt32();
- }, n.prototype.writeInt = function(e) {
- return this.writeInt32(e);
- }, n.prototype.read = function(e) {
- var t, i;
- for (t = [], i = 0; 0 <= e ? i < e : i > e; i = 0 <= e ? ++i : --i) t.push(this.readByte());
- return t;
- }, n.prototype.write = function(e) {
- var t, i, s, a;
- for (a = [], i = 0, s = e.length; i < s; i++) t = e[i], a.push(this.writeByte(t));
- return a;
- }, n;
- }(), e2 = function() {
- var n;
- function e(t) {
- var i, s, a;
- for (this.scalarType = t.readInt(), this.tableCount = t.readShort(), this.searchRange = t.readShort(), this.entrySelector = t.readShort(), this.rangeShift = t.readShort(), this.tables = {}, s = 0, a = this.tableCount; 0 <= a ? s < a : s > a; s = 0 <= a ? ++s : --s) i = { tag: t.readString(4), checksum: t.readInt(), offset: t.readInt(), length: t.readInt() }, this.tables[i.tag] = i;
- }
- return e.prototype.encode = function(t) {
- var i, s, a, c, l, f, d, m, _, k, p, j, O;
- for (O in p = Object.keys(t).length, f = Math.log(2), _ = 16 * Math.floor(Math.log(p) / f), c = Math.floor(_ / f), m = 16 * p - _, (s = new Zr()).writeInt(this.scalarType), s.writeShort(p), s.writeShort(_), s.writeShort(c), s.writeShort(m), a = 16 * p, d = s.pos + a, l = null, j = [], t) for (k = t[O], s.writeString(O), s.writeInt(n(k)), s.writeInt(d), s.writeInt(k.length), j = j.concat(k), O === "head" && (l = d), d += k.length; d % 4; ) j.push(0), d++;
- return s.write(j), i = 2981146554 - n(s.data), s.pos = l + 8, s.writeUInt32(i), s.data;
- }, n = function(t) {
- var i, s, a, c;
- for (t = Dh.call(t); t.length % 4; ) t.push(0);
- for (a = new Zr(t), s = 0, i = 0, c = t.length; i < c; i = i += 4) s += a.readUInt32();
- return 4294967295 & s;
- }, e;
- }(), n2 = {}.hasOwnProperty, vr = function(n, e) {
- for (var t in e) n2.call(e, t) && (n[t] = e[t]);
- function i() {
- this.constructor = n;
- }
- return i.prototype = e.prototype, n.prototype = new i(), n.__super__ = e.prototype, n;
- };
- nr = function() {
- function n(e) {
- var t;
- this.file = e, t = this.file.directory.tables[this.tag], this.exists = !!t, t && (this.offset = t.offset, this.length = t.length, this.parse(this.file.contents));
- }
- return n.prototype.parse = function() {
- }, n.prototype.encode = function() {
- }, n.prototype.raw = function() {
- return this.exists ? (this.file.contents.pos = this.offset, this.file.contents.read(this.length)) : null;
- }, n;
- }();
- var r2 = function() {
- function n() {
- return n.__super__.constructor.apply(this, arguments);
- }
- return vr(n, nr), n.prototype.tag = "head", n.prototype.parse = function(e) {
- return e.pos = this.offset, this.version = e.readInt(), this.revision = e.readInt(), this.checkSumAdjustment = e.readInt(), this.magicNumber = e.readInt(), this.flags = e.readShort(), this.unitsPerEm = e.readShort(), this.created = e.readLongLong(), this.modified = e.readLongLong(), this.xMin = e.readShort(), this.yMin = e.readShort(), this.xMax = e.readShort(), this.yMax = e.readShort(), this.macStyle = e.readShort(), this.lowestRecPPEM = e.readShort(), this.fontDirectionHint = e.readShort(), this.indexToLocFormat = e.readShort(), this.glyphDataFormat = e.readShort();
- }, n.prototype.encode = function(e) {
- var t;
- return (t = new Zr()).writeInt(this.version), t.writeInt(this.revision), t.writeInt(this.checkSumAdjustment), t.writeInt(this.magicNumber), t.writeShort(this.flags), t.writeShort(this.unitsPerEm), t.writeLongLong(this.created), t.writeLongLong(this.modified), t.writeShort(this.xMin), t.writeShort(this.yMin), t.writeShort(this.xMax), t.writeShort(this.yMax), t.writeShort(this.macStyle), t.writeShort(this.lowestRecPPEM), t.writeShort(this.fontDirectionHint), t.writeShort(e), t.writeShort(this.glyphDataFormat), t.data;
- }, n;
- }(), Ju = function() {
- function n(e, t) {
- var i, s, a, c, l, f, d, m, _, k, p, j, O, M, S, V, G;
- switch (this.platformID = e.readUInt16(), this.encodingID = e.readShort(), this.offset = t + e.readInt(), _ = e.pos, e.pos = this.offset, this.format = e.readUInt16(), this.length = e.readUInt16(), this.language = e.readUInt16(), this.isUnicode = this.platformID === 3 && this.encodingID === 1 && this.format === 4 || this.platformID === 0 && this.format === 4, this.codeMap = {}, this.format) {
- case 0:
- for (f = 0; f < 256; ++f) this.codeMap[f] = e.readByte();
- break;
- case 4:
- for (p = e.readUInt16(), k = p / 2, e.pos += 6, a = function() {
- var q, it;
- for (it = [], f = q = 0; 0 <= k ? q < k : q > k; f = 0 <= k ? ++q : --q) it.push(e.readUInt16());
- return it;
- }(), e.pos += 2, O = function() {
- var q, it;
- for (it = [], f = q = 0; 0 <= k ? q < k : q > k; f = 0 <= k ? ++q : --q) it.push(e.readUInt16());
- return it;
- }(), d = function() {
- var q, it;
- for (it = [], f = q = 0; 0 <= k ? q < k : q > k; f = 0 <= k ? ++q : --q) it.push(e.readUInt16());
- return it;
- }(), m = function() {
- var q, it;
- for (it = [], f = q = 0; 0 <= k ? q < k : q > k; f = 0 <= k ? ++q : --q) it.push(e.readUInt16());
- return it;
- }(), s = (this.length - e.pos + this.offset) / 2, l = function() {
- var q, it;
- for (it = [], f = q = 0; 0 <= s ? q < s : q > s; f = 0 <= s ? ++q : --q) it.push(e.readUInt16());
- return it;
- }(), f = S = 0, G = a.length; S < G; f = ++S) for (M = a[f], i = V = j = O[f]; j <= M ? V <= M : V >= M; i = j <= M ? ++V : --V) m[f] === 0 ? c = i + d[f] : (c = l[m[f] / 2 + (i - j) - (k - f)] || 0) !== 0 && (c += d[f]), this.codeMap[i] = 65535 & c;
- }
- e.pos = _;
- }
- return n.encode = function(e, t) {
- var i, s, a, c, l, f, d, m, _, k, p, j, O, M, S, V, G, q, it, vt, dt, X, R, tt, N, E, z, U, rt, ot, ht, nt, ct, At, wt, x, B, T, H, J, Z, at, st, gt, _t, kt;
- switch (U = new Zr(), c = Object.keys(e).sort(function(St, Dt) {
- return St - Dt;
- }), t) {
- case "macroman":
- for (O = 0, M = function() {
- var St = [];
- for (j = 0; j < 256; ++j) St.push(0);
- return St;
- }(), V = { 0: 0 }, a = {}, rt = 0, ct = c.length; rt < ct; rt++) V[st = e[s = c[rt]]] == null && (V[st] = ++O), a[s] = { old: e[s], new: V[e[s]] }, M[s] = V[e[s]];
- return U.writeUInt16(1), U.writeUInt16(0), U.writeUInt32(12), U.writeUInt16(0), U.writeUInt16(262), U.writeUInt16(0), U.write(M), { charMap: a, subtable: U.data, maxGlyphID: O + 1 };
- case "unicode":
- for (E = [], _ = [], G = 0, V = {}, i = {}, S = d = null, ot = 0, At = c.length; ot < At; ot++) V[it = e[s = c[ot]]] == null && (V[it] = ++G), i[s] = { old: it, new: V[it] }, l = V[it] - s, S != null && l === d || (S && _.push(S), E.push(s), d = l), S = s;
- for (S && _.push(S), _.push(65535), E.push(65535), tt = 2 * (R = E.length), X = 2 * Math.pow(Math.log(R) / Math.LN2, 2), k = Math.log(X / 2) / Math.LN2, dt = 2 * R - X, f = [], vt = [], p = [], j = ht = 0, wt = E.length; ht < wt; j = ++ht) {
- if (N = E[j], m = _[j], N === 65535) {
- f.push(0), vt.push(0);
- break;
- }
- if (N - (z = i[N].new) >= 32768) for (f.push(0), vt.push(2 * (p.length + R - j)), s = nt = N; N <= m ? nt <= m : nt >= m; s = N <= m ? ++nt : --nt) p.push(i[s].new);
- else f.push(z - N), vt.push(0);
- }
- for (U.writeUInt16(3), U.writeUInt16(1), U.writeUInt32(12), U.writeUInt16(4), U.writeUInt16(16 + 8 * R + 2 * p.length), U.writeUInt16(0), U.writeUInt16(tt), U.writeUInt16(X), U.writeUInt16(k), U.writeUInt16(dt), Z = 0, x = _.length; Z < x; Z++) s = _[Z], U.writeUInt16(s);
- for (U.writeUInt16(0), at = 0, B = E.length; at < B; at++) s = E[at], U.writeUInt16(s);
- for (gt = 0, T = f.length; gt < T; gt++) l = f[gt], U.writeUInt16(l);
- for (_t = 0, H = vt.length; _t < H; _t++) q = vt[_t], U.writeUInt16(q);
- for (kt = 0, J = p.length; kt < J; kt++) O = p[kt], U.writeUInt16(O);
- return { charMap: i, subtable: U.data, maxGlyphID: G + 1 };
- }
- }, n;
- }(), Th = function() {
- function n() {
- return n.__super__.constructor.apply(this, arguments);
- }
- return vr(n, nr), n.prototype.tag = "cmap", n.prototype.parse = function(e) {
- var t, i, s;
- for (e.pos = this.offset, this.version = e.readUInt16(), s = e.readUInt16(), this.tables = [], this.unicode = null, i = 0; 0 <= s ? i < s : i > s; i = 0 <= s ? ++i : --i) t = new Ju(e, this.offset), this.tables.push(t), t.isUnicode && this.unicode == null && (this.unicode = t);
- return !0;
- }, n.encode = function(e, t) {
- var i, s;
- return t == null && (t = "macroman"), i = Ju.encode(e, t), (s = new Zr()).writeUInt16(0), s.writeUInt16(1), i.table = s.data.concat(i.subtable), i;
- }, n;
- }(), i2 = function() {
- function n() {
- return n.__super__.constructor.apply(this, arguments);
- }
- return vr(n, nr), n.prototype.tag = "hhea", n.prototype.parse = function(e) {
- return e.pos = this.offset, this.version = e.readInt(), this.ascender = e.readShort(), this.decender = e.readShort(), this.lineGap = e.readShort(), this.advanceWidthMax = e.readShort(), this.minLeftSideBearing = e.readShort(), this.minRightSideBearing = e.readShort(), this.xMaxExtent = e.readShort(), this.caretSlopeRise = e.readShort(), this.caretSlopeRun = e.readShort(), this.caretOffset = e.readShort(), e.pos += 8, this.metricDataFormat = e.readShort(), this.numberOfMetrics = e.readUInt16();
- }, n;
- }(), a2 = function() {
- function n() {
- return n.__super__.constructor.apply(this, arguments);
- }
- return vr(n, nr), n.prototype.tag = "OS/2", n.prototype.parse = function(e) {
- if (e.pos = this.offset, this.version = e.readUInt16(), this.averageCharWidth = e.readShort(), this.weightClass = e.readUInt16(), this.widthClass = e.readUInt16(), this.type = e.readShort(), this.ySubscriptXSize = e.readShort(), this.ySubscriptYSize = e.readShort(), this.ySubscriptXOffset = e.readShort(), this.ySubscriptYOffset = e.readShort(), this.ySuperscriptXSize = e.readShort(), this.ySuperscriptYSize = e.readShort(), this.ySuperscriptXOffset = e.readShort(), this.ySuperscriptYOffset = e.readShort(), this.yStrikeoutSize = e.readShort(), this.yStrikeoutPosition = e.readShort(), this.familyClass = e.readShort(), this.panose = function() {
- var t, i;
- for (i = [], t = 0; t < 10; ++t) i.push(e.readByte());
- return i;
- }(), this.charRange = function() {
- var t, i;
- for (i = [], t = 0; t < 4; ++t) i.push(e.readInt());
- return i;
- }(), this.vendorID = e.readString(4), this.selection = e.readShort(), this.firstCharIndex = e.readShort(), this.lastCharIndex = e.readShort(), this.version > 0 && (this.ascent = e.readShort(), this.descent = e.readShort(), this.lineGap = e.readShort(), this.winAscent = e.readShort(), this.winDescent = e.readShort(), this.codePageRange = function() {
- var t, i;
- for (i = [], t = 0; t < 2; t = ++t) i.push(e.readInt());
- return i;
- }(), this.version > 1)) return this.xHeight = e.readShort(), this.capHeight = e.readShort(), this.defaultChar = e.readShort(), this.breakChar = e.readShort(), this.maxContext = e.readShort();
- }, n;
- }(), s2 = function() {
- function n() {
- return n.__super__.constructor.apply(this, arguments);
- }
- return vr(n, nr), n.prototype.tag = "post", n.prototype.parse = function(e) {
- var t, i, s;
- switch (e.pos = this.offset, this.format = e.readInt(), this.italicAngle = e.readInt(), this.underlinePosition = e.readShort(), this.underlineThickness = e.readShort(), this.isFixedPitch = e.readInt(), this.minMemType42 = e.readInt(), this.maxMemType42 = e.readInt(), this.minMemType1 = e.readInt(), this.maxMemType1 = e.readInt(), this.format) {
- case 65536:
- case 196608:
- break;
- case 131072:
- var a;
- for (i = e.readUInt16(), this.glyphNameIndex = [], a = 0; 0 <= i ? a < i : a > i; a = 0 <= i ? ++a : --a) this.glyphNameIndex.push(e.readUInt16());
- for (this.names = [], s = []; e.pos < this.offset + this.length; ) t = e.readByte(), s.push(this.names.push(e.readString(t)));
- return s;
- case 151552:
- return i = e.readUInt16(), this.offsets = e.read(i);
- case 262144:
- return this.map = function() {
- var c, l, f;
- for (f = [], a = c = 0, l = this.file.maxp.numGlyphs; 0 <= l ? c < l : c > l; a = 0 <= l ? ++c : --c) f.push(e.readUInt32());
- return f;
- }.call(this);
- }
- }, n;
- }(), o2 = function(n, e) {
- this.raw = n, this.length = n.length, this.platformID = e.platformID, this.encodingID = e.encodingID, this.languageID = e.languageID;
- }, l2 = function() {
- function n() {
- return n.__super__.constructor.apply(this, arguments);
- }
- return vr(n, nr), n.prototype.tag = "name", n.prototype.parse = function(e) {
- var t, i, s, a, c, l, f, d, m, _, k;
- for (e.pos = this.offset, e.readShort(), t = e.readShort(), l = e.readShort(), i = [], a = 0; 0 <= t ? a < t : a > t; a = 0 <= t ? ++a : --a) i.push({ platformID: e.readShort(), encodingID: e.readShort(), languageID: e.readShort(), nameID: e.readShort(), length: e.readShort(), offset: this.offset + l + e.readShort() });
- for (f = {}, a = m = 0, _ = i.length; m < _; a = ++m) s = i[a], e.pos = s.offset, d = e.readString(s.length), c = new o2(d, s), f[k = s.nameID] == null && (f[k] = []), f[s.nameID].push(c);
- this.strings = f, this.copyright = f[0], this.fontFamily = f[1], this.fontSubfamily = f[2], this.uniqueSubfamily = f[3], this.fontName = f[4], this.version = f[5];
- try {
- this.postscriptName = f[6][0].raw.replace(/[\x00-\x19\x80-\xff]/g, "");
- } catch (p) {
- this.postscriptName = f[4][0].raw.replace(/[\x00-\x19\x80-\xff]/g, "");
- }
- return this.trademark = f[7], this.manufacturer = f[8], this.designer = f[9], this.description = f[10], this.vendorUrl = f[11], this.designerUrl = f[12], this.license = f[13], this.licenseUrl = f[14], this.preferredFamily = f[15], this.preferredSubfamily = f[17], this.compatibleFull = f[18], this.sampleText = f[19];
- }, n;
- }(), u2 = function() {
- function n() {
- return n.__super__.constructor.apply(this, arguments);
- }
- return vr(n, nr), n.prototype.tag = "maxp", n.prototype.parse = function(e) {
- return e.pos = this.offset, this.version = e.readInt(), this.numGlyphs = e.readUInt16(), this.maxPoints = e.readUInt16(), this.maxContours = e.readUInt16(), this.maxCompositePoints = e.readUInt16(), this.maxComponentContours = e.readUInt16(), this.maxZones = e.readUInt16(), this.maxTwilightPoints = e.readUInt16(), this.maxStorage = e.readUInt16(), this.maxFunctionDefs = e.readUInt16(), this.maxInstructionDefs = e.readUInt16(), this.maxStackElements = e.readUInt16(), this.maxSizeOfInstructions = e.readUInt16(), this.maxComponentElements = e.readUInt16(), this.maxComponentDepth = e.readUInt16();
- }, n;
- }(), h2 = function() {
- function n() {
- return n.__super__.constructor.apply(this, arguments);
- }
- return vr(n, nr), n.prototype.tag = "hmtx", n.prototype.parse = function(e) {
- var t, i, s, a, c, l, f;
- for (e.pos = this.offset, this.metrics = [], t = 0, l = this.file.hhea.numberOfMetrics; 0 <= l ? t < l : t > l; t = 0 <= l ? ++t : --t) this.metrics.push({ advance: e.readUInt16(), lsb: e.readInt16() });
- for (s = this.file.maxp.numGlyphs - this.file.hhea.numberOfMetrics, this.leftSideBearings = function() {
- var d, m;
- for (m = [], t = d = 0; 0 <= s ? d < s : d > s; t = 0 <= s ? ++d : --d) m.push(e.readInt16());
- return m;
- }(), this.widths = function() {
- var d, m, _, k;
- for (k = [], d = 0, m = (_ = this.metrics).length; d < m; d++) a = _[d], k.push(a.advance);
- return k;
- }.call(this), i = this.widths[this.widths.length - 1], f = [], t = c = 0; 0 <= s ? c < s : c > s; t = 0 <= s ? ++c : --c) f.push(this.widths.push(i));
- return f;
- }, n.prototype.forGlyph = function(e) {
- return e in this.metrics ? this.metrics[e] : { advance: this.metrics[this.metrics.length - 1].advance, lsb: this.leftSideBearings[e - this.metrics.length] };
- }, n;
- }(), Dh = [].slice, f2 = function() {
- function n() {
- return n.__super__.constructor.apply(this, arguments);
- }
- return vr(n, nr), n.prototype.tag = "glyf", n.prototype.parse = function() {
- return this.cache = {};
- }, n.prototype.glyphFor = function(e) {
- var t, i, s, a, c, l, f, d, m, _;
- return e in this.cache ? this.cache[e] : (a = this.file.loca, t = this.file.contents, i = a.indexOf(e), (s = a.lengthOf(e)) === 0 ? this.cache[e] = null : (t.pos = this.offset + i, c = (l = new Zr(t.read(s))).readShort(), d = l.readShort(), _ = l.readShort(), f = l.readShort(), m = l.readShort(), this.cache[e] = c === -1 ? new d2(l, d, _, f, m) : new c2(l, c, d, _, f, m), this.cache[e]));
- }, n.prototype.encode = function(e, t, i) {
- var s, a, c, l, f;
- for (c = [], a = [], l = 0, f = t.length; l < f; l++) s = e[t[l]], a.push(c.length), s && (c = c.concat(s.encode(i)));
- return a.push(c.length), { table: c, offsets: a };
- }, n;
- }(), c2 = function() {
- function n(e, t, i, s, a, c) {
- this.raw = e, this.numberOfContours = t, this.xMin = i, this.yMin = s, this.xMax = a, this.yMax = c, this.compound = !1;
- }
- return n.prototype.encode = function() {
- return this.raw.data;
- }, n;
- }(), d2 = function() {
- function n(e, t, i, s, a) {
- var c, l;
- for (this.raw = e, this.xMin = t, this.yMin = i, this.xMax = s, this.yMax = a, this.compound = !0, this.glyphIDs = [], this.glyphOffsets = [], c = this.raw; l = c.readShort(), this.glyphOffsets.push(c.pos), this.glyphIDs.push(c.readUInt16()), 32 & l; ) c.pos += 1 & l ? 4 : 2, 128 & l ? c.pos += 8 : 64 & l ? c.pos += 4 : 8 & l && (c.pos += 2);
- }
- return n.prototype.encode = function() {
- var e, t, i;
- for (t = new Zr(Dh.call(this.raw.data)), e = 0, i = this.glyphIDs.length; e < i; ++e) t.pos = this.glyphOffsets[e];
- return t.data;
- }, n;
- }(), p2 = function() {
- function n() {
- return n.__super__.constructor.apply(this, arguments);
- }
- return vr(n, nr), n.prototype.tag = "loca", n.prototype.parse = function(e) {
- var t, i;
- return e.pos = this.offset, t = this.file.head.indexToLocFormat, this.offsets = t === 0 ? function() {
- var s, a;
- for (a = [], i = 0, s = this.length; i < s; i += 2) a.push(2 * e.readUInt16());
- return a;
- }.call(this) : function() {
- var s, a;
- for (a = [], i = 0, s = this.length; i < s; i += 4) a.push(e.readUInt32());
- return a;
- }.call(this);
- }, n.prototype.indexOf = function(e) {
- return this.offsets[e];
- }, n.prototype.lengthOf = function(e) {
- return this.offsets[e + 1] - this.offsets[e];
- }, n.prototype.encode = function(e, t) {
- for (var i = new Uint32Array(this.offsets.length), s = 0, a = 0, c = 0; c < i.length; ++c) if (i[c] = s, a < t.length && t[a] == c) {
- ++a, i[c] = s;
- var l = this.offsets[c], f = this.offsets[c + 1] - l;
- f > 0 && (s += f);
- }
- for (var d = new Array(4 * i.length), m = 0; m < i.length; ++m) d[4 * m + 3] = 255 & i[m], d[4 * m + 2] = (65280 & i[m]) >> 8, d[4 * m + 1] = (16711680 & i[m]) >> 16, d[4 * m] = (4278190080 & i[m]) >> 24;
- return d;
- }, n;
- }(), g2 = function() {
- function n(e) {
- this.font = e, this.subset = {}, this.unicodes = {}, this.next = 33;
- }
- return n.prototype.generateCmap = function() {
- var e, t, i, s, a;
- for (t in s = this.font.cmap.tables[0].codeMap, e = {}, a = this.subset) i = a[t], e[t] = s[i];
- return e;
- }, n.prototype.glyphsFor = function(e) {
- var t, i, s, a, c, l, f;
- for (s = {}, c = 0, l = e.length; c < l; c++) s[a = e[c]] = this.font.glyf.glyphFor(a);
- for (a in t = [], s) (i = s[a]) != null && i.compound && t.push.apply(t, i.glyphIDs);
- if (t.length > 0) for (a in f = this.glyphsFor(t)) i = f[a], s[a] = i;
- return s;
- }, n.prototype.encode = function(e, t) {
- var i, s, a, c, l, f, d, m, _, k, p, j, O, M, S;
- for (s in i = Th.encode(this.generateCmap(), "unicode"), c = this.glyphsFor(e), p = { 0: 0 }, S = i.charMap) p[(f = S[s]).old] = f.new;
- for (j in k = i.maxGlyphID, c) j in p || (p[j] = k++);
- return m = function(V) {
- var G, q;
- for (G in q = {}, V) q[V[G]] = G;
- return q;
- }(p), _ = Object.keys(m).sort(function(V, G) {
- return V - G;
- }), O = function() {
- var V, G, q;
- for (q = [], V = 0, G = _.length; V < G; V++) l = _[V], q.push(m[l]);
- return q;
- }(), a = this.font.glyf.encode(c, O, p), d = this.font.loca.encode(a.offsets, O), M = { cmap: this.font.cmap.raw(), glyf: a.table, loca: d, hmtx: this.font.hmtx.raw(), hhea: this.font.hhea.raw(), maxp: this.font.maxp.raw(), post: this.font.post.raw(), name: this.font.name.raw(), head: this.font.head.encode(t) }, this.font.os2.exists && (M["OS/2"] = this.font.os2.raw()), this.font.directory.encode(M);
- }, n;
- }();
- Tt.API.PDFObject = function() {
- var n;
- function e() {
- }
- return n = function(t, i) {
- return (Array(i + 1).join("0") + t).slice(-i);
- }, e.convert = function(t) {
- var i, s, a, c;
- if (Array.isArray(t)) return "[" + function() {
- var l, f, d;
- for (d = [], l = 0, f = t.length; l < f; l++) i = t[l], d.push(e.convert(i));
- return d;
- }().join(" ") + "]";
- if (typeof t == "string") return "/" + t;
- if (t != null && t.isString) return "(" + t + ")";
- if (t instanceof Date) return "(D:" + n(t.getUTCFullYear(), 4) + n(t.getUTCMonth(), 2) + n(t.getUTCDate(), 2) + n(t.getUTCHours(), 2) + n(t.getUTCMinutes(), 2) + n(t.getUTCSeconds(), 2) + "Z)";
- if ({}.toString.call(t) === "[object Object]") {
- for (s in a = ["<<"], t) c = t[s], a.push("/" + s + " " + e.convert(c));
- return a.push(">>"), a.join(`
- `);
- }
- return "" + t;
- }, e;
- }();
- export {
- b2 as AcroForm,
- Ft as AcroFormAppearance,
- an as AcroFormButton,
- ks as AcroFormCheckBox,
- ea as AcroFormChoiceField,
- ra as AcroFormComboBox,
- Ls as AcroFormEditBox,
- na as AcroFormListBox,
- Ps as AcroFormPasswordField,
- Ss as AcroFormPushButton,
- ia as AcroFormRadioButton,
- yi as AcroFormTextField,
- Cs as GState,
- wi as ShadingPattern,
- Qi as TilingPattern,
- Tt as default,
- Tt as jsPDF
- };
|