vendor.1442b48262f29d17d337.js 3.6 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738
  1. webpackJsonp([0],{"++K3":function(t,e){var n,r,i,o,s,a,l,u,c,h,d,p,f,g,m,v=!1;function b(){if(!v){v=!0;var t=navigator.userAgent,e=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(t),b=/(Mac OS X)|(Windows)|(Linux)/.exec(t);if(p=/\b(iPhone|iP[ao]d)/.exec(t),f=/\b(iP[ao]d)/.exec(t),h=/Android/i.exec(t),g=/FBAN\/\w+;/i.exec(t),m=/Mobile/i.exec(t),d=!!/Win64/.exec(t),e){(n=e[1]?parseFloat(e[1]):e[5]?parseFloat(e[5]):NaN)&&document&&document.documentMode&&(n=document.documentMode);var _=/(?:Trident\/(\d+.\d+))/.exec(t);a=_?parseFloat(_[1])+4:n,r=e[2]?parseFloat(e[2]):NaN,i=e[3]?parseFloat(e[3]):NaN,(o=e[4]?parseFloat(e[4]):NaN)?(e=/(?:Chrome\/(\d+\.\d+))/.exec(t),s=e&&e[1]?parseFloat(e[1]):NaN):s=NaN}else n=r=i=s=o=NaN;if(b){if(b[1]){var y=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(t);l=!y||parseFloat(y[1].replace("_","."))}else l=!1;u=!!b[2],c=!!b[3]}else l=u=c=!1}}var _={ie:function(){return b()||n},ieCompatibilityMode:function(){return b()||a>n},ie64:function(){return _.ie()&&d},firefox:function(){return b()||r},opera:function(){return b()||i},webkit:function(){return b()||o},safari:function(){return _.webkit()},chrome:function(){return b()||s},windows:function(){return b()||u},osx:function(){return b()||l},linux:function(){return b()||c},iphone:function(){return b()||p},mobile:function(){return b()||p||f||h||m},nativeApp:function(){return b()||g},android:function(){return b()||h},ipad:function(){return b()||f}};t.exports=_},"+E39":function(t,e,n){t.exports=!n("S82l")(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},"+ZMJ":function(t,e,n){var r=n("lOnJ");t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)}}return function(){return t.apply(e,arguments)}}},"+gIa":function(t,e,n){"use strict";
  2. /**
  3. * @license
  4. * Copyright 2019 Google LLC. All Rights Reserved.
  5. * Licensed under the Apache License, Version 2.0 (the "License");
  6. * you may not use this file except in compliance with the License.
  7. * You may obtain a copy of the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS,
  13. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. * See the License for the specific language governing permissions and
  15. * limitations under the License.
  16. *
  17. * =============================================================================
  18. */
  19. var r,i;n.d(e,"a",function(){return r}),function(t){t[t.DT_INVALID=0]="DT_INVALID",t[t.DT_FLOAT=1]="DT_FLOAT",t[t.DT_DOUBLE=2]="DT_DOUBLE",t[t.DT_INT32=3]="DT_INT32",t[t.DT_UINT8=4]="DT_UINT8",t[t.DT_INT16=5]="DT_INT16",t[t.DT_INT8=6]="DT_INT8",t[t.DT_STRING=7]="DT_STRING",t[t.DT_COMPLEX64=8]="DT_COMPLEX64",t[t.DT_INT64=9]="DT_INT64",t[t.DT_BOOL=10]="DT_BOOL",t[t.DT_QINT8=11]="DT_QINT8",t[t.DT_QUINT8=12]="DT_QUINT8",t[t.DT_QINT32=13]="DT_QINT32",t[t.DT_BFLOAT16=14]="DT_BFLOAT16",t[t.DT_QINT16=15]="DT_QINT16",t[t.DT_QUINT16=16]="DT_QUINT16",t[t.DT_UINT16=17]="DT_UINT16",t[t.DT_COMPLEX128=18]="DT_COMPLEX128",t[t.DT_HALF=19]="DT_HALF",t[t.DT_RESOURCE=20]="DT_RESOURCE",t[t.DT_VARIANT=21]="DT_VARIANT",t[t.DT_UINT32=22]="DT_UINT32",t[t.DT_UINT64=23]="DT_UINT64",t[t.DT_FLOAT_REF=101]="DT_FLOAT_REF",t[t.DT_DOUBLE_REF=102]="DT_DOUBLE_REF",t[t.DT_INT32_REF=103]="DT_INT32_REF",t[t.DT_UINT8_REF=104]="DT_UINT8_REF",t[t.DT_INT16_REF=105]="DT_INT16_REF",t[t.DT_INT8_REF=106]="DT_INT8_REF",t[t.DT_STRING_REF=107]="DT_STRING_REF",t[t.DT_COMPLEX64_REF=108]="DT_COMPLEX64_REF",t[t.DT_INT64_REF=109]="DT_INT64_REF",t[t.DT_BOOL_REF=110]="DT_BOOL_REF",t[t.DT_QINT8_REF=111]="DT_QINT8_REF",t[t.DT_QUINT8_REF=112]="DT_QUINT8_REF",t[t.DT_QINT32_REF=113]="DT_QINT32_REF",t[t.DT_BFLOAT16_REF=114]="DT_BFLOAT16_REF",t[t.DT_QINT16_REF=115]="DT_QINT16_REF",t[t.DT_QUINT16_REF=116]="DT_QUINT16_REF",t[t.DT_UINT16_REF=117]="DT_UINT16_REF",t[t.DT_COMPLEX128_REF=118]="DT_COMPLEX128_REF",t[t.DT_HALF_REF=119]="DT_HALF_REF",t[t.DT_RESOURCE_REF=120]="DT_RESOURCE_REF",t[t.DT_VARIANT_REF=121]="DT_VARIANT_REF",t[t.DT_UINT32_REF=122]="DT_UINT32_REF",t[t.DT_UINT64_REF=123]="DT_UINT64_REF"}(r||(r={})),function(t){let e;!function(t){t[t.LEGACY=0]="LEGACY",t[t.V1=1]="V1",t[t.V2=2]="V2"}(e=t.CheckpointFormatVersion||(t.CheckpointFormatVersion={}))}(i||(i={}))},"+tPU":function(t,e,n){n("xGkn");for(var r=n("7KvD"),i=n("hJx8"),o=n("/bQp"),s=n("dSzd")("toStringTag"),a="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),l=0;l<a.length;l++){var u=a[l],c=r[u],h=c&&c.prototype;h&&!h[s]&&i(h,s,u),o[u]=o.Array}},"//Fk":function(t,e,n){t.exports={default:n("U5ju"),__esModule:!0}},"/Gr6":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.json=[{tfOpName:"AvgPool",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MaxPool",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[],notSupported:!0},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MaxPoolWithArgmax",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"include_batch_in_index",name:"includeBatchInIndex",type:"bool"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"AvgPool3D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MaxPool3D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Conv1D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"stride",name:"stride",type:"number"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NWC"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"dilation",name:"dilation",type:"number",defaultValue:1}]},{tfOpName:"Conv2D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"useCudnnOnGpu",name:"useCudnnOnGpu",type:"bool"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"_FusedConv2D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"},{start:2,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"num_args",name:"numArgs",type:"number"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"use_cudnn_on_gpu",name:"useCudnnOnGpu",type:"bool",defaultValue:!0},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"dilations",name:"dilations",type:"number[]",defaultValue:[1,1,1,1]},{tfName:"fused_ops",name:"fusedOps",type:"string[]",defaultValue:[]},{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:1e-4},{tfName:"leakyrelu_alpha",name:"leakyreluAlpha",type:"number"}]},{tfOpName:"Conv2DBackpropInput",category:"convolution",inputs:[{start:2,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"},{start:0,name:"outputShape",type:"number[]"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]",notSupported:!0}]},{tfOpName:"DepthwiseConv2d",category:"convolution",inputs:[{start:0,name:"input",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"DepthwiseConv2dNative",category:"convolution",inputs:[{start:0,name:"input",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"FusedDepthwiseConv2dNative",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"},{start:2,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"num_args",name:"numArgs",type:"number"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"dilations",name:"dilations",type:"number[]",defaultValue:[1,1,1,1]},{tfName:"fused_ops",name:"fusedOps",type:"string[]",defaultValue:[]},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]}]},{tfOpName:"Conv3D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"Dilation2D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"rates",name:"dilations",type:"number[]"},{tfName:"padding",name:"pad",type:"string"}]}]},"/Oas":function(t,e,n){(function(t){(function(){"use strict";var e;function n(t){var e=0;return function(){return e<t.length?{done:!1,value:t[e++]}:{done:!0}}}var r="function"==typeof Object.defineProperties?Object.defineProperty:function(t,e,n){return t==Array.prototype||t==Object.prototype?t:(t[e]=n.value,t)};var i=function(e){e=["object"==typeof globalThis&&globalThis,e,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof t&&t];for(var n=0;n<e.length;++n){var r=e[n];if(r&&r.Math==Math)return r}throw Error("Cannot find global object")}(this);function o(t,e){if(e)t:{var n=i;t=t.split(".");for(var o=0;o<t.length-1;o++){var s=t[o];if(!(s in n))break t;n=n[s]}(e=e(o=n[t=t[t.length-1]]))!=o&&null!=e&&r(n,t,{configurable:!0,writable:!0,value:e})}}function s(t){return(t={next:t})[Symbol.iterator]=function(){return this},t}function a(t){var e="undefined"!=typeof Symbol&&Symbol.iterator&&t[Symbol.iterator];return e?e.call(t):{next:n(t)}}function l(t){if(!(t instanceof Array)){t=a(t);for(var e,n=[];!(e=t.next()).done;)n.push(e.value);t=n}return t}o("Symbol",function(t){function e(t,e){this.g=t,r(this,"description",{configurable:!0,writable:!0,value:e})}if(t)return t;e.prototype.toString=function(){return this.g};var n="jscomp_symbol_"+(1e9*Math.random()>>>0)+"_",i=0;return function t(r){if(this instanceof t)throw new TypeError("Symbol is not a constructor");return new e(n+(r||"")+"_"+i++,r)}}),o("Symbol.iterator",function(t){if(t)return t;t=Symbol("Symbol.iterator");for(var e="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),o=0;o<e.length;o++){var a=i[e[o]];"function"==typeof a&&"function"!=typeof a.prototype[t]&&r(a.prototype,t,{configurable:!0,writable:!0,value:function(){return s(n(this))}})}return t});var u,c="function"==typeof Object.create?Object.create:function(t){function e(){}return e.prototype=t,new e};if("function"==typeof Object.setPrototypeOf)u=Object.setPrototypeOf;else{var h;t:{var d={};try{d.__proto__={a:!0},h=d.a;break t}catch(t){}h=!1}u=h?function(t,e){if(t.__proto__=e,t.__proto__!==e)throw new TypeError(t+" is not extensible");return t}:null}var p=u;function f(t,e){if(t.prototype=c(e.prototype),t.prototype.constructor=t,p)p(t,e);else for(var n in e)if("prototype"!=n)if(Object.defineProperties){var r=Object.getOwnPropertyDescriptor(e,n);r&&Object.defineProperty(t,n,r)}else t[n]=e[n];t.ra=e.prototype}function g(){this.l=!1,this.i=null,this.h=void 0,this.g=1,this.u=this.o=0,this.j=null}function m(t){if(t.l)throw new TypeError("Generator is already running");t.l=!0}function v(t,e){t.j={fa:e,ga:!0},t.g=t.o||t.u}function b(t,e,n){return t.g=n,{value:e}}function _(t,e,n,r){try{var i=e.call(t.g.i,n);if(!(i instanceof Object))throw new TypeError("Iterator result "+i+" is not an object");if(!i.done)return t.g.l=!1,i;var o=i.value}catch(e){return t.g.i=null,v(t.g,e),y(t)}return t.g.i=null,r.call(t.g,o),y(t)}function y(t){for(;t.g.g;)try{var e=t.h(t.g);if(e)return t.g.l=!1,{value:e.value,done:!1}}catch(e){t.g.h=void 0,v(t.g,e)}if(t.g.l=!1,t.g.j){if(e=t.g.j,t.g.j=null,e.ga)throw e.fa;return{value:e.return,done:!0}}return{value:void 0,done:!0}}function T(t){this.next=function(e){return m(t.g),t.g.i?e=_(t,t.g.i.next,e,t.g.s):(t.g.s(e),e=y(t)),e},this.throw=function(e){return m(t.g),t.g.i?e=_(t,t.g.i.throw,e,t.g.s):(v(t.g,e),e=y(t)),e},this.return=function(e){return function(t,e){m(t.g);var n=t.g.i;return n?_(t,"return"in n?n.return:function(t){return{value:t,done:!0}},e,t.g.return):(t.g.return(e),y(t))}(t,e)},this[Symbol.iterator]=function(){return this}}function x(t){return function(t){function e(e){return t.next(e)}function n(e){return t.throw(e)}return new Promise(function(r,i){!function t(o){o.done?r(o.value):Promise.resolve(o.value).then(e,n).then(t,i)}(t.next())})}(new T(new function(t){this.g=new g,this.h=t}(t)))}g.prototype.s=function(t){this.h=t},g.prototype.return=function(t){this.j={return:t},this.g=this.u},o("Promise",function(t){function e(t){this.h=0,this.i=void 0,this.g=[],this.s=!1;var e=this.j();try{t(e.resolve,e.reject)}catch(t){e.reject(t)}}function n(){this.g=null}function r(t){return t instanceof e?t:new e(function(e){e(t)})}if(t)return t;n.prototype.h=function(t){if(null==this.g){this.g=[];var e=this;this.i(function(){e.l()})}this.g.push(t)};var o=i.setTimeout;n.prototype.i=function(t){o(t,0)},n.prototype.l=function(){for(;this.g&&this.g.length;){var t=this.g;this.g=[];for(var e=0;e<t.length;++e){var n=t[e];t[e]=null;try{n()}catch(t){this.j(t)}}}this.g=null},n.prototype.j=function(t){this.i(function(){throw t})},e.prototype.j=function(){function t(t){return function(r){n||(n=!0,t.call(e,r))}}var e=this,n=!1;return{resolve:t(this.D),reject:t(this.l)}},e.prototype.D=function(t){if(t===this)this.l(new TypeError("A Promise cannot resolve to itself"));else if(t instanceof e)this.H(t);else{t:switch(typeof t){case"object":var n=null!=t;break t;case"function":n=!0;break t;default:n=!1}n?this.A(t):this.o(t)}},e.prototype.A=function(t){var e=void 0;try{e=t.then}catch(t){return void this.l(t)}"function"==typeof e?this.I(e,t):this.o(t)},e.prototype.l=function(t){this.u(2,t)},e.prototype.o=function(t){this.u(1,t)},e.prototype.u=function(t,e){if(0!=this.h)throw Error("Cannot settle("+t+", "+e+"): Promise already settled in state"+this.h);this.h=t,this.i=e,2===this.h&&this.G(),this.B()},e.prototype.G=function(){var t=this;o(function(){if(t.C()){var e=i.console;void 0!==e&&e.error(t.i)}},1)},e.prototype.C=function(){if(this.s)return!1;var t=i.CustomEvent,e=i.Event,n=i.dispatchEvent;return void 0===n||("function"==typeof t?t=new t("unhandledrejection",{cancelable:!0}):"function"==typeof e?t=new e("unhandledrejection",{cancelable:!0}):(t=i.document.createEvent("CustomEvent")).initCustomEvent("unhandledrejection",!1,!0,t),t.promise=this,t.reason=this.i,n(t))},e.prototype.B=function(){if(null!=this.g){for(var t=0;t<this.g.length;++t)s.h(this.g[t]);this.g=null}};var s=new n;return e.prototype.H=function(t){var e=this.j();t.M(e.resolve,e.reject)},e.prototype.I=function(t,e){var n=this.j();try{t.call(e,n.resolve,n.reject)}catch(t){n.reject(t)}},e.prototype.then=function(t,n){function r(t,e){return"function"==typeof t?function(e){try{i(t(e))}catch(t){o(t)}}:e}var i,o,s=new e(function(t,e){i=t,o=e});return this.M(r(t,i),r(n,o)),s},e.prototype.catch=function(t){return this.then(void 0,t)},e.prototype.M=function(t,e){function n(){switch(r.h){case 1:t(r.i);break;case 2:e(r.i);break;default:throw Error("Unexpected state: "+r.h)}}var r=this;null==this.g?s.h(n):this.g.push(n),this.s=!0},e.resolve=r,e.reject=function(t){return new e(function(e,n){n(t)})},e.race=function(t){return new e(function(e,n){for(var i=a(t),o=i.next();!o.done;o=i.next())r(o.value).M(e,n)})},e.all=function(t){var n=a(t),i=n.next();return i.done?r([]):new e(function(t,e){function o(e){return function(n){s[e]=n,0==--a&&t(s)}}var s=[],a=0;do{s.push(void 0),a++,r(i.value).M(o(s.length-1),e),i=n.next()}while(!i.done)})},e});var E="function"==typeof Object.assign?Object.assign:function(t,e){for(var n=1;n<arguments.length;n++){var r=arguments[n];if(r)for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t};o("Object.assign",function(t){return t||E}),o("Object.is",function(t){return t||function(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}}),o("Array.prototype.includes",function(t){return t||function(t,e){var n=this;n instanceof String&&(n=String(n));var r=n.length;for(0>(e=e||0)&&(e=Math.max(e+r,0));e<r;e++){var i=n[e];if(i===t||Object.is(i,t))return!0}return!1}}),o("String.prototype.includes",function(t){return t||function(t,e){if(null==this)throw new TypeError("The 'this' value for String.prototype.includes must not be null or undefined");if(t instanceof RegExp)throw new TypeError("First argument to String.prototype.includes must not be a regular expression");return-1!==this.indexOf(t,e||0)}}),o("Array.prototype.keys",function(t){return t||function(){return function(t,e){t instanceof String&&(t+="");var n=0,r=!1,i={next:function(){if(!r&&n<t.length){var i=n++;return{value:e(i,t[i]),done:!1}}return r=!0,{done:!0,value:void 0}}};return i[Symbol.iterator]=function(){return i},i}(this,function(t){return t})}});var w=this||self;function C(t,e){t=t.split(".");var n,r=w;t[0]in r||void 0===r.execScript||r.execScript("var "+t[0]);for(;t.length&&(n=t.shift());)t.length||void 0===e?r=r[n]&&r[n]!==Object.prototype[n]?r[n]:r[n]={}:r[n]=e}function S(){throw Error("Invalid UTF8")}function k(t,e){return e=String.fromCharCode.apply(null,e),null==t?e:t+e}var O,I,R="undefined"!=typeof TextDecoder,A="undefined"!=typeof TextEncoder,N={},D=null;function M(t){var e;void 0===e&&(e=0),P(),e=N[e];for(var n=Array(Math.floor(t.length/3)),r=e[64]||"",i=0,o=0;i<t.length-2;i+=3){var s=t[i],a=t[i+1],l=t[i+2],u=e[s>>2];s=e[(3&s)<<4|a>>4],a=e[(15&a)<<2|l>>6],l=e[63&l],n[o++]=u+s+a+l}switch(u=0,l=r,t.length-i){case 2:l=e[(15&(u=t[i+1]))<<2]||r;case 1:t=t[i],n[o]=e[t>>2]+e[(3&t)<<4|u>>4]+l+r}return n.join("")}function L(t){var e=t.length,n=3*e/4;n%3?n=Math.floor(n):-1!="=.".indexOf(t[e-1])&&(n=-1!="=.".indexOf(t[e-2])?n-2:n-1);var r=new Uint8Array(n),i=0;return function(t,e){function n(e){for(;r<t.length;){var n=t.charAt(r++),i=D[n];if(null!=i)return i;if(!/^[\s\xa0]*$/.test(n))throw Error("Unknown base64 encoding at char: "+n)}return e}P();for(var r=0;;){var i=n(-1),o=n(0),s=n(64),a=n(64);if(64===a&&-1===i)break;e(i<<2|o>>4),64!=s&&(e(o<<4&240|s>>2),64!=a&&e(s<<6&192|a))}}(t,function(t){r[i++]=t}),i!==n?r.subarray(0,i):r}function P(){if(!D){D={};for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),e=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++){var r=t.concat(e[n].split(""));N[n]=r;for(var i=0;i<r.length;i++){var o=r[i];void 0===D[o]&&(D[o]=i)}}}}var F,B="function"==typeof Uint8Array;function j(t){return B&&null!=t&&t instanceof Uint8Array}function $(t){if(this.L=t,null!==t&&0===t.length)throw Error("ByteString should be constructed with non-empty values")}var U="function"==typeof Uint8Array.prototype.slice,V=0;function H(t,e){return Error("Invalid wire type: "+t+" (at position "+e+")")}function W(){return Error("Failed to read varint, encoding is invalid.")}function G(t,e){e=void 0!==(e=void 0===e?{}:e).v&&e.v,this.h=null,this.g=this.i=this.j=0,this.v=e,t&&z(this,t)}function z(t,e){t.h=function(t,e){if(t.constructor===Uint8Array)return t;if(t.constructor===ArrayBuffer)return new Uint8Array(t);if(t.constructor===Array)return new Uint8Array(t);if(t.constructor===String)return L(t);if(t.constructor===$)return!e&&(e=t.L)&&e.constructor===Uint8Array?e:(e=null==(e=t.L)||j(e)?e:"string"==typeof e?L(e):null,(t=t.L=e)?new Uint8Array(t):F||(F=new Uint8Array(0)));if(t instanceof Uint8Array)return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw Error("Type not convertible to a Uint8Array, expected a Uint8Array, an ArrayBuffer, a base64 encoded string, or Array of numbers")}(e,t.v),t.j=0,t.i=t.h.length,t.g=t.j}function X(t){if(t.g>t.i)throw Error("Tried to read past the end of the data "+t.g+" > "+t.i)}function K(t){var e=t.h,n=e[t.g],r=127&n;if(128>n)return t.g+=1,X(t),r;if(r|=(127&(n=e[t.g+1]))<<7,128>n)return t.g+=2,X(t),r;if(r|=(127&(n=e[t.g+2]))<<14,128>n)return t.g+=3,X(t),r;if(r|=(127&(n=e[t.g+3]))<<21,128>n)return t.g+=4,X(t),r;if(n=e[t.g+4],t.g+=5,r|=(15&n)<<28,128>n)return X(t),r;if(128<=e[t.g++]&&128<=e[t.g++]&&128<=e[t.g++]&&128<=e[t.g++]&&128<=e[t.g++])throw W();return X(t),r}G.prototype.reset=function(){this.g=this.j};var Y=[];function q(){this.g=[]}function J(t,e){for(;127<e;)t.g.push(127&e|128),e>>>=7;t.g.push(e)}function Z(t){var e={},n=void 0!==e.W&&e.W;this.l={v:void 0!==e.v&&e.v},this.W=n,e=this.l,Y.length?(n=Y.pop(),e&&(n.v=e.v),t&&z(n,t),t=n):t=new G(t,e),this.g=t,this.j=this.g.g,this.h=this.i=-1}function Q(t){var e=t.g;if(e.g==e.i)return!1;t.j=t.g.g;var n=K(t.g)>>>0;if(e=n>>>3,!(0<=(n&=7)&&5>=n))throw H(n,t.j);if(1>e)throw Error("Invalid field number: "+e+" (at position "+t.j+")");return t.i=e,t.h=n,!0}function tt(t){switch(t.h){case 0:if(0!=t.h)tt(t);else t:{for(var e=(t=t.g).g,n=e+10;e<n;)if(0==(128&t.h[e++])){t.g=e,X(t);break t}throw W()}break;case 1:(t=t.g).g+=8,X(t);break;case 2:2!=t.h?tt(t):(e=K(t.g)>>>0,(t=t.g).g+=e,X(t));break;case 5:(t=t.g).g+=4,X(t);break;case 3:for(e=t.i;;){if(!Q(t))throw Error("Unmatched start-group tag: stream EOF");if(4==t.h){if(t.i!=e)throw Error("Unmatched end-group tag");break}tt(t)}break;default:throw H(t.h,t.j)}}q.prototype.length=function(){return this.g.length},q.prototype.end=function(){var t=this.g;return this.g=[],t},Z.prototype.reset=function(){this.g.reset(),this.j=this.g.g,this.h=this.i=-1};var et=[];function nt(t,e){0!==e.length&&(t.i.push(e),t.h+=e.length)}var rt="function"==typeof Symbol&&"symbol"==typeof Symbol()?Symbol(void 0):void 0;function it(t,e){Object.isFrozen(t)||(rt?t[rt]|=e:void 0!==t.N?t.N|=e:Object.defineProperties(t,{N:{value:e,configurable:!0,writable:!0,enumerable:!1}}))}function ot(t){var e;return null==(e=rt?t[rt]:t.N)?0:e}function st(t){return it(t,1),t}function at(t){return!!Array.isArray(t)&&!!(2&ot(t))}function lt(t){if(!Array.isArray(t))throw Error("cannot mark non-array as immutable");it(t,2)}function ut(t){return null!==t&&"object"==typeof t&&!Array.isArray(t)&&t.constructor===Object}var ct=Object.freeze(st([]));function ht(t){if(at(t.m))throw Error("Cannot mutate an immutable Message")}var dt,pt="undefined"!=typeof Symbol&&void 0!==Symbol.hasInstance;function ft(t){return{value:t,configurable:!1,writable:!1,enumerable:!1}}function gt(t,e,n){return-1===e?null:e>=t.i?t.g?t.g[e]:void 0:void 0!==n&&n&&t.g&&null!=(n=t.g[e])?n:t.m[e+t.h]}function mt(t,e,n,r){r=void 0!==r&&r,ht(t),e<t.i&&!r?t.m[e+t.h]=n:(t.g||(t.g=t.m[t.i+t.h]={}))[e]=n}function vt(t,e,n,r){n=void 0===n||n;var i=gt(t,e,r=void 0!==r&&r);return null==i&&(i=ct),at(t.m)?n&&(lt(i),Object.freeze(i)):(i===ct||at(i))&&mt(t,e,i=st(i.slice()),r),i}function bt(t,e,n){return null==(t=null==(t=gt(t,e))?t:+t)?void 0===n?0:n:t}function _t(t,e,n,r){t.j||(t.j={});var i=at(t.m),o=t.j[n];if(!o){r=vt(t,n,!0,void 0!==r&&r),o=[],i=i||at(r);for(var s=0;s<r.length;s++)o[s]=new e(r[s]),i&&lt(o[s].m);i&&(lt(o),Object.freeze(o)),t.j[n]=o}return o}function yt(t,e,n,r,i){var o=void 0!==o&&o;return ht(t),o=_t(t,n,e,o),n=r||new n,t=vt(t,e),void 0!=i?(o.splice(i,0,n),t.splice(i,0,n.m)):(o.push(n),t.push(n.m)),n}function Tt(t,e){return null==(t=gt(t,e))?0:t}function xt(t,e){return null==(t=gt(t,e))?"":t}function Et(t){var e=St;return Ct(t,e=void 0===e?kt:e)}function wt(t,e){if(null!=t){if(Array.isArray(t))t=Ct(t,e);else if(ut(t)){var n,r={};for(n in t)r[n]=wt(t[n],e);t=r}else t=e(t);return t}}function Ct(t,e){for(var n=t.slice(),r=0;r<n.length;r++)n[r]=wt(n[r],e);return Array.isArray(t)&&1&ot(t)&&st(n),n}function St(t){return t&&"object"==typeof t&&t.toJSON?t.toJSON():(t=function(t){switch(typeof t){case"number":return isFinite(t)?t:String(t);case"object":if(t&&!Array.isArray(t)){if(j(t))return M(t);if(t instanceof $){var e=t.L;return e=null==e||"string"==typeof e?e:B&&e instanceof Uint8Array?M(e):null,(t.L=e)||""}}}return t}(t),Array.isArray(t)?Et(t):t)}function kt(t){return j(t)?new Uint8Array(t):t}function Ot(t,e,n){t||(t=dt),dt=null;var r=this.constructor.h;if(t||(t=r?[r]:[]),this.h=(r?0:-1)-(this.constructor.g||0),this.j=void 0,this.m=t,t=(r=this.m.length)-1,r&&ut(r=this.m[t])?(this.i=t-this.h,this.g=r):void 0!==e&&-1<e?(this.i=Math.max(e,t+1-this.h),this.g=void 0):this.i=Number.MAX_VALUE,n)for(e=0;e<n.length;e++)if((t=n[e])<this.i)t+=this.h,(r=this.m[t])?Array.isArray(r)&&st(r):this.m[t]=ct;else{var i=(r=this.g||(this.g=this.m[this.i+this.h]={}))[t];i?Array.isArray(i)&&st(i):r[t]=ct}}function It(){Ot.apply(this,arguments)}if(Ot.prototype.toJSON=function(){return Et(this.m)},Ot.prototype.toString=function(){return this.m.toString()},f(It,Ot),pt){var Rt={};Object.defineProperties(It,(Rt[Symbol.hasInstance]=ft(function(){throw Error("Cannot perform instanceof checks for MutableMessage")}),Rt))}function At(t,e,n){if(n){var r,i={};for(r in n){var o=n[r],s=o.ja;s||(i.F=o.pa||o.ha.P,o.ba?(i.U=Bt(o.ba),s=function(t){return function(e,n,r){return t.F(e,n,r,t.U)}}(i)):o.da?(i.T=jt(o.X.g,o.da),s=function(t){return function(e,n,r){return t.F(e,n,r,t.T)}}(i)):s=i.F,o.ja=s),s(e,t,o.X),i={F:i.F,U:i.U,T:i.T}}}!function(t,e){if(e=e.ca){nt(t,t.g.end());for(var n=0;n<e.length;n++)nt(t,e[n])}}(e,t)}var Nt=Symbol();function Dt(t,e,n){return t[Nt]||(t[Nt]=function(t,r){return e(t,r,n)})}function Mt(t){var e=t[Nt];if(!e){var n=Jt(t);e=function(t,e){return Zt(t,e,n)},t[Nt]=e}return e}function Lt(t){var e=function(t){var e=t.ba;return e?Mt(e):(e=t.oa)?Dt(t.X.g,e,t.da):void 0}(t),n=t.X,r=t.ha.O;return e?function(t,i){return r(t,i,n,e)}:function(t,e){return r(t,e,n)}}function Pt(t,e,n,r,i,o){var s=0;for((t=t()).length&&"number"!=typeof t[0]&&(n(e,t[0]),s++);s<t.length;){n=t[s++];for(var a=s+1;a<t.length&&"number"!=typeof t[a];)a++;var l=t[s++];switch(a-=s){case 0:r(e,n,l);break;case 1:r(e,n,l,t[s++]);break;case 2:i(e,n,l,t[s++],t[s++]);break;case 3:a=t[s++];var u=t[s++],c=t[s++];Array.isArray(c)?i(e,n,l,a,u,c):o(e,n,l,a,u,c);break;case 4:o(e,n,l,t[s++],t[s++],t[s++],t[s++]);break;default:throw Error("unexpected number of binary field arguments: "+a)}}return e}var Ft=Symbol();function Bt(t){var e=t[Ft];if(!e){var n=Gt(t);e=function(t,e){return te(t,e,n)},t[Ft]=e}return e}function jt(t,e){var n=t[Ft];return n||(n=function(t,n){return At(t,n,e)},t[Ft]=n),n}var $t=Symbol();function Ut(t,e){t.push(e)}function Vt(t,e,n){t.push(e,n.P)}function Ht(t,e,n,r,i){var o=Bt(i),s=n.P;t.push(e,function(t,e,n){return s(t,e,n,r,o)})}function Wt(t,e,n,r,i,o){var s=jt(r,o),a=n.P;t.push(e,function(t,e,n){return a(t,e,n,r,s)})}function Gt(t){var e=t[$t];return e||Pt(t,t[$t]=[],Ut,Vt,Ht,Wt)}var zt=Symbol();function Xt(t,e){t[0]=e}function Kt(t,e,n,r){var i=n.O;t[e]=r?function(t,e,n){return i(t,e,n,r)}:i}function Yt(t,e,n,r,i,o){var s=n.O,a=Mt(i);t[e]=function(t,e,n){return s(t,e,n,r,a,o)}}function qt(t,e,n,r,i,o,s){var a=n.O,l=Dt(r,i,o);t[e]=function(t,e,n){return a(t,e,n,r,l,s)}}function Jt(t){var e=t[zt];return e||Pt(t,t[zt]={},Xt,Kt,Yt,qt)}function Zt(t,e,n){for(;Q(e)&&4!=e.h;){var r=e.i,i=n[r];if(!i){var o=n[0];o&&(o=o[r])&&(i=n[r]=Lt(o))}if(!(i&&i(e,t,r)||(i=e,r=t,o=i.j,tt(i),i.W))){var s=i.g.h;i=o===(i=i.g.g)?F||(F=new Uint8Array(0)):U?s.slice(o,i):new Uint8Array(s.subarray(o,i)),(o=r.ca)?o.push(i):r.ca=[i]}}return t}function Qt(t,e,n){if(et.length){var r=et.pop();t&&(z(r.g,t),r.i=-1,r.h=-1),t=r}else t=new Z(t);try{return Zt(new e,t,Jt(n))}finally{(e=t.g).h=null,e.j=0,e.i=0,e.g=0,e.v=!1,t.i=-1,t.h=-1,100>et.length&&et.push(t)}}function te(t,e,n){for(var r=n.length,i=1==r%2,o=i?1:0;o<r;o+=2)(0,n[o+1])(e,t,n[o]);At(t,e,i?n[0]:void 0)}function ee(t,e){var n=new function(){this.i=[],this.h=0,this.g=new q};te(t,n,Gt(e)),nt(n,n.g.end()),t=new Uint8Array(n.h);for(var r=(e=n.i).length,i=0,o=0;o<r;o++){var s=e[o];t.set(s,i),i+=s.length}return n.i=[t],t}function ne(t,e){return{O:t,P:e}}var re=ne(function(t,e,n){if(5!==t.h)return!1;var r=(t=t.g).h[t.g],i=t.h[t.g+1],o=t.h[t.g+2],s=t.h[t.g+3];return t.g+=4,X(t),t=2*((i=(r<<0|i<<8|o<<16|s<<24)>>>0)>>31)+1,r=i>>>23&255,i&=8388607,mt(e,n,255==r?i?NaN:1/0*t:0==r?t*Math.pow(2,-149)*i:t*Math.pow(2,r-150)*(i+Math.pow(2,23))),!0},function(t,e,n){if(null!=(e=gt(e,n))){J(t.g,8*n+5),t=t.g;var r=e;0===(r=(n=0>r?1:0)?-r:r)?0<1/r?V=0:(0,V=2147483648):isNaN(r)?(0,V=2147483647):3.4028234663852886e38<r?(0,V=(n<<31|2139095040)>>>0):1.1754943508222875e-38>r?(r=Math.round(r/Math.pow(2,-149)),0,V=(n<<31|r)>>>0):(e=Math.floor(Math.log(r)/Math.LN2),r*=Math.pow(2,-e),16777216<=(r=Math.round(8388608*r))&&++e,0,V=(n<<31|e+127<<23|8388607&r)>>>0),n=V,t.g.push(n>>>0&255),t.g.push(n>>>8&255),t.g.push(n>>>16&255),t.g.push(n>>>24&255)}}),ie=ne(function(t,e,n){if(0!==t.h)return!1;for(var r=t.g,i=128,o=0,s=t=0;4>s&&128<=i;s++)i=r.h[r.g++],X(r),o|=(127&i)<<7*s;if(128<=i&&(i=r.h[r.g++],X(r),o|=(127&i)<<28,t|=(127&i)>>4),128<=i)for(s=0;5>s&&128<=i;s++)i=r.h[r.g++],X(r),t|=(127&i)<<7*s+3;if(!(128>i))throw W();return r=o>>>0,(t=2147483648&(i=t>>>0))&&(i=~i>>>0,0==(r=1+~r>>>0)&&(i=i+1>>>0)),r=4294967296*i+(r>>>0),mt(e,n,t?-r:r),!0},function(t,e,n){if(null!=(e=gt(e,n))&&null!=e){J(t.g,8*n),t=t.g;var r=e;for(n=0>r,e=(r=Math.abs(r))>>>0,r=Math.floor((r-e)/4294967296),r>>>=0,n&&(r=~r>>>0,4294967295<(e=1+(~e>>>0))&&(e=0,4294967295<++r&&(r=0))),n=V=e,e=r;0<e||127<n;)t.g.push(127&n|128),n=(n>>>7|e<<25)>>>0,e>>>=7;t.g.push(n)}}),oe=ne(function(t,e,n){return 0===t.h&&(mt(e,n,K(t.g)),!0)},function(t,e,n){if(null!=(e=gt(e,n))&&null!=e)if(J(t.g,8*n),t=t.g,0<=(n=e))J(t,n);else{for(e=0;9>e;e++)t.g.push(127&n|128),n>>=7;t.g.push(1)}}),se=ne(function(t,e,n){if(2!==t.h)return!1;var r,i=K(t.g)>>>0,o=(t=t.g).g;if(t.g+=i,X(t),t=t.h,R)(r=O)||(r=O=new TextDecoder("utf-8",{fatal:!0})),r=r.decode(t.subarray(o,o+i));else{i=o+i;for(var s,a,l,u=[],c=null;o<i;)128>(s=t[o++])?u.push(s):224>s?o>=i?S():(a=t[o++],194>s||128!=(192&a)?(o--,S()):u.push((31&s)<<6|63&a)):240>s?o>=i-1?S():128!=(192&(a=t[o++]))||224===s&&160>a||237===s&&160<=a||128!=(192&(r=t[o++]))?(o--,S()):u.push((15&s)<<12|(63&a)<<6|63&r):244>=s?o>=i-2?S():128!=(192&(a=t[o++]))||0!=a-144+(s<<28)>>30||128!=(192&(r=t[o++]))||128!=(192&(l=t[o++]))?(o--,S()):(s=(7&s)<<18|(63&a)<<12|(63&r)<<6|63&l,s-=65536,u.push(55296+(s>>10&1023),56320+(1023&s))):S(),8192<=u.length&&(c=k(c,u),u.length=0);r=k(c,u)}return mt(e,n,r),!0},function(t,e,n){if(null!=(e=gt(e,n))){var r=!1;if(r=void 0!==r&&r,A){if(r&&/(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])/.test(e))throw Error("Found an unpaired surrogate");e=(I||(I=new TextEncoder)).encode(e)}else{for(var i=0,o=new Uint8Array(3*e.length),s=0;s<e.length;s++){var a=e.charCodeAt(s);if(128>a)o[i++]=a;else{if(2048>a)o[i++]=a>>6|192;else{if(55296<=a&&57343>=a){if(56319>=a&&s<e.length){var l=e.charCodeAt(++s);if(56320<=l&&57343>=l){a=1024*(a-55296)+l-56320+65536,o[i++]=a>>18|240,o[i++]=a>>12&63|128,o[i++]=a>>6&63|128,o[i++]=63&a|128;continue}s--}if(r)throw Error("Found an unpaired surrogate");a=65533}o[i++]=a>>12|224,o[i++]=a>>6&63|128}o[i++]=63&a|128}}e=o.subarray(0,i)}J(t.g,8*n+2),J(t.g,e.length),nt(t,t.g.end()),nt(t,e)}}),ae=ne(function(t,e,n,r,i){if(2!==t.h)return!1;e=yt(e,n,r),n=t.g.i,r=K(t.g)>>>0;var o=t.g.g+r,s=o-n;if(0>=s&&(t.g.i=o,i(e,t),s=o-t.g.g),s)throw Error("Message parsing ended unexpectedly. Expected to read "+r+" bytes, instead read "+(r-s)+" bytes, either the data ended unexpectedly or the message misreported its own length");return t.g.g=o,t.g.i=n,!0},function(t,e,n,r,i){if(null!=(e=_t(e,r,n)))for(r=0;r<e.length;r++){var o=t;J(o.g,8*n+2);var s=o.g.end();nt(o,s),s.push(o.h),o=s,i(e[r],t),s=t;var a=o.pop();for(a=s.h+s.g.length()-a;127<a;)o.push(127&a|128),a>>>=7,s.h++;o.push(a),s.h++}});function le(){It.apply(this,arguments)}if(f(le,It),pt){var ue={};Object.defineProperties(le,(ue[Symbol.hasInstance]=ft(Object[Symbol.hasInstance]),ue))}function ce(t){le.call(this,t)}function he(){return[1,oe,2,re,3,se,4,se]}function de(t){le.call(this,t,-1,fe)}function pe(){return[1,ae,ce,he]}f(ce,le),f(de,le),de.prototype.addClassification=function(t,e){return yt(this,1,ce,t,e),this};var fe=[1];function ge(t){le.call(this,t)}function me(){return[1,re,2,re,3,re,4,re,5,re]}function ve(t){le.call(this,t,-1,_e)}function be(){return[1,ae,ge,me]}f(ge,le),f(ve,le);var _e=[1];function ye(t){le.call(this,t)}function Te(){return[1,re,2,re,3,re,4,re,5,re,6,ie]}function xe(t,e,n){if(n=t.createShader(0===n?t.VERTEX_SHADER:t.FRAGMENT_SHADER),t.shaderSource(n,e),t.compileShader(n),!t.getShaderParameter(n,t.COMPILE_STATUS))throw Error("Could not compile WebGL shader.\n\n"+t.getShaderInfoLog(n));return n}function Ee(t){return _t(t,ce,1).map(function(t){return{index:Tt(t,1),score:bt(t,2),label:null!=gt(t,3)?xt(t,3):void 0,displayName:null!=gt(t,4)?xt(t,4):void 0}})}function we(t){return{x:bt(t,1),y:bt(t,2),z:bt(t,3),visibility:null!=gt(t,4)?bt(t,4):void 0}}function Ce(t){return t.map(function(t){return _t(Qt(t,ve,be),ge,1).map(we)})}function Se(t,e){this.h=t,this.g=e,this.l=0}function ke(t,e,n){return function(t,e){var n=t.g;if(void 0===t.o){var r=xe(n,"\n attribute vec2 aVertex;\n attribute vec2 aTex;\n varying vec2 vTex;\n void main(void) {\n gl_Position = vec4(aVertex, 0.0, 1.0);\n vTex = aTex;\n }",0),i=xe(n,"\n precision mediump float;\n varying vec2 vTex;\n uniform sampler2D sampler0;\n void main(){\n gl_FragColor = texture2D(sampler0, vTex);\n }",1),o=n.createProgram();if(n.attachShader(o,r),n.attachShader(o,i),n.linkProgram(o),!n.getProgramParameter(o,n.LINK_STATUS))throw Error("Could not compile WebGL program.\n\n"+n.getProgramInfoLog(o));r=t.o=o,n.useProgram(r),i=n.getUniformLocation(r,"sampler0"),t.j={K:n.getAttribLocation(r,"aVertex"),J:n.getAttribLocation(r,"aTex"),qa:i},t.u=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,t.u),n.enableVertexAttribArray(t.j.K),n.vertexAttribPointer(t.j.K,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),t.s=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,t.s),n.enableVertexAttribArray(t.j.J),n.vertexAttribPointer(t.j.J,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([0,1,0,0,1,0,1,1]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),n.uniform1i(i,0)}r=t.j,n.useProgram(t.o),n.canvas.width=e.width,n.canvas.height=e.height,n.viewport(0,0,e.width,e.height),n.activeTexture(n.TEXTURE0),t.h.bindTexture2d(e.glName),n.enableVertexAttribArray(r.K),n.bindBuffer(n.ARRAY_BUFFER,t.u),n.vertexAttribPointer(r.K,2,n.FLOAT,!1,0,0),n.enableVertexAttribArray(r.J),n.bindBuffer(n.ARRAY_BUFFER,t.s),n.vertexAttribPointer(r.J,2,n.FLOAT,!1,0,0),n.bindFramebuffer(n.DRAW_FRAMEBUFFER?n.DRAW_FRAMEBUFFER:n.FRAMEBUFFER,null),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.colorMask(!0,!0,!0,!0),n.drawArrays(n.TRIANGLE_FAN,0,4),n.disableVertexAttribArray(r.K),n.disableVertexAttribArray(r.J),n.bindBuffer(n.ARRAY_BUFFER,null),t.h.bindTexture2d(0)}(t,e),"function"==typeof t.g.canvas.transferToImageBitmap?Promise.resolve(t.g.canvas.transferToImageBitmap()):n?Promise.resolve(t.g.canvas):"function"==typeof createImageBitmap?createImageBitmap(t.g.canvas):(void 0===t.i&&(t.i=document.createElement("canvas")),new Promise(function(e){t.i.height=t.g.canvas.height,t.i.width=t.g.canvas.width,t.i.getContext("2d",{}).drawImage(t.g.canvas,0,0,t.g.canvas.width,t.g.canvas.height),e(t.i)}))}function Oe(t){this.g=t}f(ye,le);var Ie=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,9,1,7,0,65,0,253,15,26,11]);function Re(t,e){return e+t}function Ae(t,e){window[t]=e}function Ne(t){if(this.g=t,this.listeners={},this.j={},this.H={},this.o={},this.u={},this.I=this.s=this.$=!0,this.D=Promise.resolve(),this.Z="",this.C={},this.locateFile=t&&t.locateFile||Re,"object"==typeof window)var e=window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/";else{if("undefined"==typeof location)throw Error("solutions can only be loaded on a web page or in a web worker");e=location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/"}if(this.aa=e,t.options)for(var n=(e=a(Object.keys(t.options))).next();!n.done;n=e.next()){n=n.value;var r=t.options[n].default;void 0!==r&&(this.j[n]="function"==typeof r?r():r)}}function De(t){var e,n,r,i,o,s,a,u,c,h,d;return x(function(p){switch(p.g){case 1:return t.$?(e=void 0===t.g.files?[]:"function"==typeof t.g.files?t.g.files(t.j):t.g.files,b(p,x(function(t){switch(t.g){case 1:return t.o=2,b(t,WebAssembly.instantiate(Ie),4);case 4:t.g=3,t.o=0;break;case 2:return t.o=0,t.j=null,t.return(!1);case 3:return t.return(!0)}}),2)):p.return();case 2:if(n=p.h,"object"==typeof window)return Ae("createMediapipeSolutionsWasm",{locateFile:t.locateFile}),Ae("createMediapipeSolutionsPackedAssets",{locateFile:t.locateFile}),s=e.filter(function(t){return void 0!==t.data}),a=e.filter(function(t){return void 0===t.data}),u=Promise.all(s.map(function(e){var n=Me(t,e.url);if(void 0!==e.path){var r=e.path;n=n.then(function(e){return t.overrideFile(r,e),Promise.resolve(e)})}return n})),c=Promise.all(a.map(function(e){return void 0===e.simd||e.simd&&n||!e.simd&&!n?function(t){var e=document.createElement("script");return e.setAttribute("src",t),e.setAttribute("crossorigin","anonymous"),new Promise(function(t){e.addEventListener("load",function(){t()},!1),e.addEventListener("error",function(){t()},!1),document.body.appendChild(e)})}(t.locateFile(e.url,t.aa)):Promise.resolve()})).then(function(){var e,n,r;return x(function(i){if(1==i.g)return e=window.createMediapipeSolutionsWasm,n=window.createMediapipeSolutionsPackedAssets,r=t,b(i,e(n),2);r.h=i.h,i.g=0})}),h=x(function(e){return t.g.graph&&t.g.graph.url?e=b(e,Me(t,t.g.graph.url),0):(e.g=0,e=void 0),e}),b(p,Promise.all([c,u,h]),7);if("function"!=typeof importScripts)throw Error("solutions can only be loaded on a web page or in a web worker");return r=e.filter(function(t){return void 0===t.simd||t.simd&&n||!t.simd&&!n}).map(function(e){return t.locateFile(e.url,t.aa)}),importScripts.apply(null,l(r)),i=t,b(p,createMediapipeSolutionsWasm(Module),6);case 6:i.h=p.h,t.l=new OffscreenCanvas(1,1),t.h.canvas=t.l,o=t.h.GL.createContext(t.l,{antialias:!1,alpha:!1,na:"undefined"!=typeof WebGL2RenderingContext?2:1}),t.h.GL.makeContextCurrent(o),p.g=4;break;case 7:if(t.l=document.createElement("canvas"),!(d=t.l.getContext("webgl2",{}))&&!(d=t.l.getContext("webgl",{})))return alert("Failed to create WebGL canvas context when passing video frame."),p.return();t.G=d,t.h.canvas=t.l,t.h.createContext(t.l,!0,!0,{});case 4:t.i=new t.h.SolutionWasm,t.$=!1,p.g=0}})}function Me(t,e){var n,r;return x(function(i){return e in t.H?i.return(t.H[e]):(n=t.locateFile(e,""),r=fetch(n).then(function(t){return t.arrayBuffer()}),t.H[e]=r,i.return(r))})}function Le(t,e,n){var r,i,o,s,l,u,c,h,d,p,f,g,m,v;return x(function(_){switch(_.g){case 1:if(!n)return _.return(e);for(r={},i=0,o=a(Object.keys(n)),s=o.next();!s.done;s=o.next())l=s.value,"string"!=typeof(u=n[l])&&"texture"===u.type&&void 0!==e[u.stream]&&++i;1<i&&(t.I=!1),c=a(Object.keys(n)),s=c.next();case 2:if(s.done){_.g=4;break}if(h=s.value,"string"==typeof(d=n[h]))return m=r,v=h,b(_,function(t,e,n){var r;return x(function(i){return"number"==typeof n||n instanceof Uint8Array||n instanceof t.h.Uint8BlobList?i.return(n):n instanceof t.h.Texture2dDataOut?((r=t.u[e])||(r=new Se(t.h,t.G),t.u[e]=r),i.return(ke(r,n,t.I))):i.return(void 0)})}(t,h,e[d]),14);if(p=e[d.stream],"detection_list"===d.type){if(p){for(var y=p.getRectList(),T=p.getLandmarksList(),E=p.getClassificationsList(),w=[],C=0;C<y.size();++C){var S=Qt(y.get(C),ye,Te);S={ea:{ka:bt(S,1),la:bt(S,2),height:bt(S,3),width:bt(S,4),rotation:bt(S,5,0),ia:Tt(S,6)},Y:_t(Qt(T.get(C),ve,be),ge,1).map(we),V:Ee(Qt(E.get(C),de,pe))},w.push(S)}y=w}else y=[];r[h]=y,_.g=7;break}if("proto_list"===d.type){if(p){for(y=Array(p.size()),T=0;T<p.size();T++)y[T]=p.get(T);p.delete()}else y=[];r[h]=y,_.g=7;break}if(void 0===p){_.g=3;break}if("float_list"===d.type){r[h]=p,_.g=7;break}if("proto"===d.type){r[h]=p,_.g=7;break}if("texture"!==d.type)throw Error("Unknown output config type: '"+d.type+"'");return(f=t.u[h])||(f=new Se(t.h,t.G),t.u[h]=f),b(_,ke(f,p,t.I),13);case 13:g=_.h,r[h]=g;case 7:d.transform&&r[h]&&(r[h]=d.transform(r[h])),_.g=3;break;case 14:m[v]=_.h;case 3:s=c.next(),_.g=2;break;case 4:return _.return(r)}})}function Pe(t,e){for(var n=e.name||"$",r=[].concat(l(e.wants)),i=new t.h.StringList,o=a(e.wants),s=o.next();!s.done;s=o.next())i.push_back(s.value);o=t.h.PacketListener.implement({onResults:function(i){for(var o={},s=0;s<e.wants.length;++s)o[r[s]]=i.get(s);var a=t.listeners[n];a&&(t.D=Le(t,o,e.outs).then(function(n){n=a(n);for(var i=0;i<e.wants.length;++i){var s=o[r[i]];"object"==typeof s&&s.hasOwnProperty&&s.hasOwnProperty("delete")&&s.delete()}n&&(t.D=n)}))}}),t.i.attachMultiListener(i,o),i.delete()}function Fe(t){return void 0===t&&(t=0),1===t?"hand_landmark_full.tflite":"hand_landmark_lite.tflite"}function Be(t){var e=this;t=t||{},this.g=new Ne({locateFile:t.locateFile,files:function(t){return[{url:"hands_solution_packed_assets_loader.js"},{simd:!1,url:"hands_solution_wasm_bin.js"},{simd:!0,url:"hands_solution_simd_wasm_bin.js"},{data:!0,url:Fe(t.modelComplexity)}]},graph:{url:"hands.binarypb"},inputs:{image:{type:"video",stream:"input_frames_gpu"}},listeners:[{wants:["multi_hand_landmarks","multi_hand_world_landmarks","image_transformed","multi_handedness"],outs:{image:"image_transformed",multiHandLandmarks:{type:"proto_list",stream:"multi_hand_landmarks",transform:Ce},multiHandWorldLandmarks:{type:"proto_list",stream:"multi_hand_world_landmarks",transform:Ce},multiHandedness:{type:"proto_list",stream:"multi_handedness",transform:function(t){return t.map(function(t){return Ee(Qt(t,de,pe))[0]})}}}}],options:{useCpuInference:{type:0,graphOptionXref:{calculatorType:"InferenceCalculator",fieldName:"use_cpu_inference"},default:"object"==typeof window&&void 0!==window.navigator&&("iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document)},selfieMode:{type:0,graphOptionXref:{calculatorType:"GlScalerCalculator",calculatorIndex:1,fieldName:"flip_horizontal"}},maxNumHands:{type:1,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculator",fieldName:"int_value"}},modelComplexity:{type:1,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculatorModelComplexity",fieldName:"int_value"},onChange:function(t){var n,r,i;return x(function(o){return 1==o.g?(n=Fe(t),r="third_party/mediapipe/modules/hand_landmark/"+n,b(o,Me(e.g,n),2)):(i=o.h,e.g.overrideFile(r,i),o.return(!0))})}},minDetectionConfidence:{type:1,graphOptionXref:{calculatorType:"TensorsToDetectionsCalculator",calculatorName:"handlandmarktrackinggpu__palmdetectiongpu__TensorsToDetectionsCalculator",fieldName:"min_score_thresh"}},minTrackingConfidence:{type:1,graphOptionXref:{calculatorType:"ThresholdingCalculator",calculatorName:"handlandmarktrackinggpu__handlandmarkgpu__ThresholdingCalculator",fieldName:"threshold"}}}})}(e=Ne.prototype).close=function(){return this.i&&this.i.delete(),Promise.resolve()},e.reset=function(){var t=this;return x(function(e){t.i&&(t.i.reset(),t.o={},t.u={}),e.g=0})},e.setOptions=function(t,e){var n=this;if(e=e||this.g.options){for(var r=[],i=[],o={},s=a(Object.keys(t)),l=s.next();!l.done;o={R:o.R,S:o.S},l=s.next()){var u=l.value;u in this.j&&this.j[u]===t[u]||(this.j[u]=t[u],void 0!==(l=e[u])&&(l.onChange&&(o.R=l.onChange,o.S=t[u],r.push(function(t){return function(){return x(function(e){if(1==e.g)return b(e,t.R(t.S),2);!0===e.h&&(n.s=!0),e.g=0})}}(o))),l.graphOptionXref&&(u={valueNumber:1===l.type?t[u]:0,valueBoolean:0===l.type&&t[u],valueString:2===l.type?t[u]:""},l=Object.assign(Object.assign(Object.assign({},{calculatorName:"",calculatorIndex:0}),l.graphOptionXref),u),i.push(l))))}0===r.length&&0===i.length||(this.s=!0,this.B=(void 0===this.B?[]:this.B).concat(i),this.A=(void 0===this.A?[]:this.A).concat(r))}},e.initialize=function(){var t=this;return x(function(e){return 1==e.g?b(e,De(t),2):3!=e.g?b(e,function(t){var e,n,r,i,o,s,l,u;return x(function(c){if(1==c.g)return t.g.graph&&t.g.graph.url&&t.Z===t.g.graph.url?c.return():(t.s=!0,t.g.graph&&t.g.graph.url?(t.Z=t.g.graph.url,b(c,Me(t,t.g.graph.url),3)):void(c.g=2));for(2!=c.g&&(e=c.h,t.i.loadGraph(e)),n=a(Object.keys(t.C)),r=n.next();!r.done;r=n.next())i=r.value,t.i.overrideFile(i,t.C[i]);if(t.C={},t.g.listeners)for(o=a(t.g.listeners),s=o.next();!s.done;s=o.next())l=s.value,Pe(t,l);u=t.j,t.j={},t.setOptions(u),c.g=0})}(t),3):b(e,function(t){var e,n,r,i,o,s;return x(function(l){switch(l.g){case 1:if(!t.s)return l.return();if(!t.A){l.g=2;break}e=a(t.A),n=e.next();case 3:if(n.done){l.g=5;break}return b(l,(0,n.value)(),4);case 4:n=e.next(),l.g=3;break;case 5:t.A=void 0;case 2:if(t.B){for(r=new t.h.GraphOptionChangeRequestList,i=a(t.B),o=i.next();!o.done;o=i.next())s=o.value,r.push_back(s);t.i.changeOptions(r),r.delete(),t.B=void 0}t.s=!1,l.g=0}})}(t),0)})},e.overrideFile=function(t,e){this.i?this.i.overrideFile(t,e):this.C[t]=e},e.clearOverriddenFiles=function(){this.C={},this.i&&this.i.clearOverriddenFiles()},e.send=function(t,e){var n,r,i,o,s,l,u,c,h,d=this;return x(function(p){switch(p.g){case 1:return d.g.inputs?(n=1e3*(void 0===e||null===e?performance.now():e),b(p,d.D,2)):p.return();case 2:return b(p,d.initialize(),3);case 3:for(r=new d.h.PacketDataList,i=a(Object.keys(t)),o=i.next();!o.done;o=i.next())if(s=o.value,l=d.g.inputs[s]){t:{var f=t[s];switch(l.type){case"video":var g=d.o[l.stream];if(g||(g=new Se(d.h,d.G),d.o[l.stream]=g),0===g.l&&(g.l=g.h.createTexture()),"undefined"!=typeof HTMLVideoElement&&f instanceof HTMLVideoElement)var m=f.videoWidth,v=f.videoHeight;else"undefined"!=typeof HTMLImageElement&&f instanceof HTMLImageElement?(m=f.naturalWidth,v=f.naturalHeight):(m=f.width,v=f.height);v={glName:g.l,width:m,height:v},(m=g.g).canvas.width=v.width,m.canvas.height=v.height,m.activeTexture(m.TEXTURE0),g.h.bindTexture2d(g.l),m.texImage2D(m.TEXTURE_2D,0,m.RGBA,m.RGBA,m.UNSIGNED_BYTE,f),g.h.bindTexture2d(0),g=v;break t;case"detections":for((g=d.o[l.stream])||(g=new Oe(d.h),d.o[l.stream]=g),g.data||(g.data=new g.g.DetectionListData),g.data.reset(f.length),v=0;v<f.length;++v){m=f[v];var _=g.data,y=_.setBoundingBox,T=v,x=m.ea,E=new ye;if(mt(E,1,x.ka),mt(E,2,x.la),mt(E,3,x.height),mt(E,4,x.width),mt(E,5,x.rotation),mt(E,6,x.ia),x=ee(E,Te),y.call(_,T,x),m.Y)for(_=0;_<m.Y.length;++_){var w=!!(E=m.Y[_]).visibility;T=(y=g.data).addNormalizedLandmark,x=v,E=Object.assign(Object.assign({},E),{visibility:w?E.visibility:0}),mt(w=new ge,1,E.x),mt(w,2,E.y),mt(w,3,E.z),E.visibility&&mt(w,4,E.visibility),E=ee(w,me),T.call(y,x,E)}if(m.V)for(_=0;_<m.V.length;++_)T=(y=g.data).addClassification,x=v,E=m.V[_],mt(w=new ce,2,E.score),E.index&&mt(w,1,E.index),E.label&&mt(w,3,E.label),E.displayName&&mt(w,4,E.displayName),E=ee(w,he),T.call(y,x,E)}g=g.data;break t;default:g={}}}switch(u=g,c=l.stream,l.type){case"video":r.pushTexture2d(Object.assign(Object.assign({},u),{stream:c,timestamp:n}));break;case"detections":(h=u).stream=c,h.timestamp=n,r.pushDetectionList(h);break;default:throw Error("Unknown input config type: '"+l.type+"'")}}return d.i.send(r),b(p,d.D,4);case 4:r.delete(),p.g=0}})},e.onResults=function(t,e){this.listeners[e||"$"]=t},C("Solution",Ne),C("OptionType",{BOOL:0,NUMBER:1,ma:2,0:"BOOL",1:"NUMBER",2:"STRING"}),(e=Be.prototype).close=function(){return this.g.close(),Promise.resolve()},e.onResults=function(t){this.g.onResults(t)},e.initialize=function(){var t=this;return x(function(e){return b(e,t.g.initialize(),0)})},e.reset=function(){this.g.reset()},e.send=function(t){var e=this;return x(function(n){return b(n,e.g.send(t),0)})},e.setOptions=function(t){this.g.setOptions(t)},C("Hands",Be),C("HAND_CONNECTIONS",[[0,1],[1,2],[2,3],[3,4],[0,5],[5,6],[6,7],[7,8],[5,9],[9,10],[10,11],[11,12],[9,13],[13,14],[14,15],[15,16],[13,17],[0,17],[17,18],[18,19],[19,20]]),C("VERSION","0.4.1646424915")}).call(this)}).call(e,n("DuR2"))},"/bQp":function(t,e){t.exports={}},"/dHd":function(t,e,n){var r,i,o,s;s=function(t){
  20. /**
  21. * @license
  22. * Copyright 2020 Google LLC
  23. * SPDX-License-Identifier: Apache-2.0
  24. */
  25. "use strict";return t},i=[n("GEkh")],void 0===(o="function"==typeof(r=s)?r.apply(e,i):r)||(t.exports=o)},"/n6Q":function(t,e,n){n("zQR9"),n("+tPU"),t.exports=n("Kh4W").f("iterator")},"/ocq":function(t,e,n){"use strict";
  26. /*!
  27. * vue-router v3.5.2
  28. * (c) 2021 Evan You
  29. * @license MIT
  30. */function r(t,e){0}function i(t,e){for(var n in e)t[n]=e[n];return t}var o=/[!'()*]/g,s=function(t){return"%"+t.charCodeAt(0).toString(16)},a=/%2C/g,l=function(t){return encodeURIComponent(t).replace(o,s).replace(a,",")};function u(t){try{return decodeURIComponent(t)}catch(t){0}return t}var c=function(t){return null==t||"object"==typeof t?t:String(t)};function h(t){var e={};return(t=t.trim().replace(/^(\?|#|&)/,""))?(t.split("&").forEach(function(t){var n=t.replace(/\+/g," ").split("="),r=u(n.shift()),i=n.length>0?u(n.join("=")):null;void 0===e[r]?e[r]=i:Array.isArray(e[r])?e[r].push(i):e[r]=[e[r],i]}),e):e}function d(t){var e=t?Object.keys(t).map(function(e){var n=t[e];if(void 0===n)return"";if(null===n)return l(e);if(Array.isArray(n)){var r=[];return n.forEach(function(t){void 0!==t&&(null===t?r.push(l(e)):r.push(l(e)+"="+l(t)))}),r.join("&")}return l(e)+"="+l(n)}).filter(function(t){return t.length>0}).join("&"):null;return e?"?"+e:""}var p=/\/?$/;function f(t,e,n,r){var i=r&&r.options.stringifyQuery,o=e.query||{};try{o=g(o)}catch(t){}var s={name:e.name||t&&t.name,meta:t&&t.meta||{},path:e.path||"/",hash:e.hash||"",query:o,params:e.params||{},fullPath:v(e,i),matched:t?function(t){var e=[];for(;t;)e.unshift(t),t=t.parent;return e}(t):[]};return n&&(s.redirectedFrom=v(n,i)),Object.freeze(s)}function g(t){if(Array.isArray(t))return t.map(g);if(t&&"object"==typeof t){var e={};for(var n in t)e[n]=g(t[n]);return e}return t}var m=f(null,{path:"/"});function v(t,e){var n=t.path,r=t.query;void 0===r&&(r={});var i=t.hash;return void 0===i&&(i=""),(n||"/")+(e||d)(r)+i}function b(t,e,n){return e===m?t===e:!!e&&(t.path&&e.path?t.path.replace(p,"")===e.path.replace(p,"")&&(n||t.hash===e.hash&&_(t.query,e.query)):!(!t.name||!e.name)&&(t.name===e.name&&(n||t.hash===e.hash&&_(t.query,e.query)&&_(t.params,e.params))))}function _(t,e){if(void 0===t&&(t={}),void 0===e&&(e={}),!t||!e)return t===e;var n=Object.keys(t).sort(),r=Object.keys(e).sort();return n.length===r.length&&n.every(function(n,i){var o=t[n];if(r[i]!==n)return!1;var s=e[n];return null==o||null==s?o===s:"object"==typeof o&&"object"==typeof s?_(o,s):String(o)===String(s)})}function y(t){for(var e=0;e<t.matched.length;e++){var n=t.matched[e];for(var r in n.instances){var i=n.instances[r],o=n.enteredCbs[r];if(i&&o){delete n.enteredCbs[r];for(var s=0;s<o.length;s++)i._isBeingDestroyed||o[s](i)}}}}var T={name:"RouterView",functional:!0,props:{name:{type:String,default:"default"}},render:function(t,e){var n=e.props,r=e.children,o=e.parent,s=e.data;s.routerView=!0;for(var a=o.$createElement,l=n.name,u=o.$route,c=o._routerViewCache||(o._routerViewCache={}),h=0,d=!1;o&&o._routerRoot!==o;){var p=o.$vnode?o.$vnode.data:{};p.routerView&&h++,p.keepAlive&&o._directInactive&&o._inactive&&(d=!0),o=o.$parent}if(s.routerViewDepth=h,d){var f=c[l],g=f&&f.component;return g?(f.configProps&&x(g,s,f.route,f.configProps),a(g,s,r)):a()}var m=u.matched[h],v=m&&m.components[l];if(!m||!v)return c[l]=null,a();c[l]={component:v},s.registerRouteInstance=function(t,e){var n=m.instances[l];(e&&n!==t||!e&&n===t)&&(m.instances[l]=e)},(s.hook||(s.hook={})).prepatch=function(t,e){m.instances[l]=e.componentInstance},s.hook.init=function(t){t.data.keepAlive&&t.componentInstance&&t.componentInstance!==m.instances[l]&&(m.instances[l]=t.componentInstance),y(u)};var b=m.props&&m.props[l];return b&&(i(c[l],{route:u,configProps:b}),x(v,s,u,b)),a(v,s,r)}};function x(t,e,n,r){var o=e.props=function(t,e){switch(typeof e){case"undefined":return;case"object":return e;case"function":return e(t);case"boolean":return e?t.params:void 0;default:0}}(n,r);if(o){o=e.props=i({},o);var s=e.attrs=e.attrs||{};for(var a in o)t.props&&a in t.props||(s[a]=o[a],delete o[a])}}function E(t,e,n){var r=t.charAt(0);if("/"===r)return t;if("?"===r||"#"===r)return e+t;var i=e.split("/");n&&i[i.length-1]||i.pop();for(var o=t.replace(/^\//,"").split("/"),s=0;s<o.length;s++){var a=o[s];".."===a?i.pop():"."!==a&&i.push(a)}return""!==i[0]&&i.unshift(""),i.join("/")}function w(t){return t.replace(/\/\//g,"/")}var C=Array.isArray||function(t){return"[object Array]"==Object.prototype.toString.call(t)},S=$,k=N,O=function(t,e){return M(N(t,e),e)},I=M,R=j,A=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function N(t,e){for(var n,r=[],i=0,o=0,s="",a=e&&e.delimiter||"/";null!=(n=A.exec(t));){var l=n[0],u=n[1],c=n.index;if(s+=t.slice(o,c),o=c+l.length,u)s+=u[1];else{var h=t[o],d=n[2],p=n[3],f=n[4],g=n[5],m=n[6],v=n[7];s&&(r.push(s),s="");var b=null!=d&&null!=h&&h!==d,_="+"===m||"*"===m,y="?"===m||"*"===m,T=n[2]||a,x=f||g;r.push({name:p||i++,prefix:d||"",delimiter:T,optional:y,repeat:_,partial:b,asterisk:!!v,pattern:x?P(x):v?".*":"[^"+L(T)+"]+?"})}}return o<t.length&&(s+=t.substr(o)),s&&r.push(s),r}function D(t){return encodeURI(t).replace(/[\/?#]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})}function M(t,e){for(var n=new Array(t.length),r=0;r<t.length;r++)"object"==typeof t[r]&&(n[r]=new RegExp("^(?:"+t[r].pattern+")$",B(e)));return function(e,r){for(var i="",o=e||{},s=(r||{}).pretty?D:encodeURIComponent,a=0;a<t.length;a++){var l=t[a];if("string"!=typeof l){var u,c=o[l.name];if(null==c){if(l.optional){l.partial&&(i+=l.prefix);continue}throw new TypeError('Expected "'+l.name+'" to be defined')}if(C(c)){if(!l.repeat)throw new TypeError('Expected "'+l.name+'" to not repeat, but received `'+JSON.stringify(c)+"`");if(0===c.length){if(l.optional)continue;throw new TypeError('Expected "'+l.name+'" to not be empty')}for(var h=0;h<c.length;h++){if(u=s(c[h]),!n[a].test(u))throw new TypeError('Expected all "'+l.name+'" to match "'+l.pattern+'", but received `'+JSON.stringify(u)+"`");i+=(0===h?l.prefix:l.delimiter)+u}}else{if(u=l.asterisk?encodeURI(c).replace(/[?#]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()}):s(c),!n[a].test(u))throw new TypeError('Expected "'+l.name+'" to match "'+l.pattern+'", but received "'+u+'"');i+=l.prefix+u}}else i+=l}return i}}function L(t){return t.replace(/([.+*?=^!:${}()[\]|\/\\])/g,"\\$1")}function P(t){return t.replace(/([=!:$\/()])/g,"\\$1")}function F(t,e){return t.keys=e,t}function B(t){return t&&t.sensitive?"":"i"}function j(t,e,n){C(e)||(n=e||n,e=[]);for(var r=(n=n||{}).strict,i=!1!==n.end,o="",s=0;s<t.length;s++){var a=t[s];if("string"==typeof a)o+=L(a);else{var l=L(a.prefix),u="(?:"+a.pattern+")";e.push(a),a.repeat&&(u+="(?:"+l+u+")*"),o+=u=a.optional?a.partial?l+"("+u+")?":"(?:"+l+"("+u+"))?":l+"("+u+")"}}var c=L(n.delimiter||"/"),h=o.slice(-c.length)===c;return r||(o=(h?o.slice(0,-c.length):o)+"(?:"+c+"(?=$))?"),o+=i?"$":r&&h?"":"(?="+c+"|$)",F(new RegExp("^"+o,B(n)),e)}function $(t,e,n){return C(e)||(n=e||n,e=[]),n=n||{},t instanceof RegExp?function(t,e){var n=t.source.match(/\((?!\?)/g);if(n)for(var r=0;r<n.length;r++)e.push({name:r,prefix:null,delimiter:null,optional:!1,repeat:!1,partial:!1,asterisk:!1,pattern:null});return F(t,e)}(t,e):C(t)?function(t,e,n){for(var r=[],i=0;i<t.length;i++)r.push($(t[i],e,n).source);return F(new RegExp("(?:"+r.join("|")+")",B(n)),e)}(t,e,n):function(t,e,n){return j(N(t,n),e,n)}(t,e,n)}S.parse=k,S.compile=O,S.tokensToFunction=I,S.tokensToRegExp=R;var U=Object.create(null);function V(t,e,n){e=e||{};try{var r=U[t]||(U[t]=S.compile(t));return"string"==typeof e.pathMatch&&(e[0]=e.pathMatch),r(e,{pretty:!0})}catch(t){return""}finally{delete e[0]}}function H(t,e,n,r){var o="string"==typeof t?{path:t}:t;if(o._normalized)return o;if(o.name){var s=(o=i({},t)).params;return s&&"object"==typeof s&&(o.params=i({},s)),o}if(!o.path&&o.params&&e){(o=i({},o))._normalized=!0;var a=i(i({},e.params),o.params);if(e.name)o.name=e.name,o.params=a;else if(e.matched.length){var l=e.matched[e.matched.length-1].path;o.path=V(l,a,e.path)}else 0;return o}var u=function(t){var e="",n="",r=t.indexOf("#");r>=0&&(e=t.slice(r),t=t.slice(0,r));var i=t.indexOf("?");return i>=0&&(n=t.slice(i+1),t=t.slice(0,i)),{path:t,query:n,hash:e}}(o.path||""),d=e&&e.path||"/",p=u.path?E(u.path,d,n||o.append):d,f=function(t,e,n){void 0===e&&(e={});var r,i=n||h;try{r=i(t||"")}catch(t){r={}}for(var o in e){var s=e[o];r[o]=Array.isArray(s)?s.map(c):c(s)}return r}(u.query,o.query,r&&r.options.parseQuery),g=o.hash||u.hash;return g&&"#"!==g.charAt(0)&&(g="#"+g),{_normalized:!0,path:p,query:f,hash:g}}var W,G=[String,Object],z=[String,Array],X=function(){},K={name:"RouterLink",props:{to:{type:G,required:!0},tag:{type:String,default:"a"},custom:Boolean,exact:Boolean,exactPath:Boolean,append:Boolean,replace:Boolean,activeClass:String,exactActiveClass:String,ariaCurrentValue:{type:String,default:"page"},event:{type:z,default:"click"}},render:function(t){var e=this,n=this.$router,r=this.$route,o=n.resolve(this.to,r,this.append),s=o.location,a=o.route,l=o.href,u={},c=n.options.linkActiveClass,h=n.options.linkExactActiveClass,d=null==c?"router-link-active":c,g=null==h?"router-link-exact-active":h,m=null==this.activeClass?d:this.activeClass,v=null==this.exactActiveClass?g:this.exactActiveClass,_=a.redirectedFrom?f(null,H(a.redirectedFrom),null,n):a;u[v]=b(r,_,this.exactPath),u[m]=this.exact||this.exactPath?u[v]:function(t,e){return 0===t.path.replace(p,"/").indexOf(e.path.replace(p,"/"))&&(!e.hash||t.hash===e.hash)&&function(t,e){for(var n in e)if(!(n in t))return!1;return!0}(t.query,e.query)}(r,_);var y=u[v]?this.ariaCurrentValue:null,T=function(t){Y(t)&&(e.replace?n.replace(s,X):n.push(s,X))},x={click:Y};Array.isArray(this.event)?this.event.forEach(function(t){x[t]=T}):x[this.event]=T;var E={class:u},w=!this.$scopedSlots.$hasNormal&&this.$scopedSlots.default&&this.$scopedSlots.default({href:l,route:a,navigate:T,isActive:u[m],isExactActive:u[v]});if(w){if(1===w.length)return w[0];if(w.length>1||!w.length)return 0===w.length?t():t("span",{},w)}if("a"===this.tag)E.on=x,E.attrs={href:l,"aria-current":y};else{var C=function t(e){if(e)for(var n,r=0;r<e.length;r++){if("a"===(n=e[r]).tag)return n;if(n.children&&(n=t(n.children)))return n}}(this.$slots.default);if(C){C.isStatic=!1;var S=C.data=i({},C.data);for(var k in S.on=S.on||{},S.on){var O=S.on[k];k in x&&(S.on[k]=Array.isArray(O)?O:[O])}for(var I in x)I in S.on?S.on[I].push(x[I]):S.on[I]=T;var R=C.data.attrs=i({},C.data.attrs);R.href=l,R["aria-current"]=y}else E.on=x}return t(this.tag,E,this.$slots.default)}};function Y(t){if(!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey||t.defaultPrevented||void 0!==t.button&&0!==t.button)){if(t.currentTarget&&t.currentTarget.getAttribute){var e=t.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return t.preventDefault&&t.preventDefault(),!0}}function q(t){if(!q.installed||W!==t){q.installed=!0,W=t;var e=function(t){return void 0!==t},n=function(t,n){var r=t.$options._parentVnode;e(r)&&e(r=r.data)&&e(r=r.registerRouteInstance)&&r(t,n)};t.mixin({beforeCreate:function(){e(this.$options.router)?(this._routerRoot=this,this._router=this.$options.router,this._router.init(this),t.util.defineReactive(this,"_route",this._router.history.current)):this._routerRoot=this.$parent&&this.$parent._routerRoot||this,n(this,this)},destroyed:function(){n(this)}}),Object.defineProperty(t.prototype,"$router",{get:function(){return this._routerRoot._router}}),Object.defineProperty(t.prototype,"$route",{get:function(){return this._routerRoot._route}}),t.component("RouterView",T),t.component("RouterLink",K);var r=t.config.optionMergeStrategies;r.beforeRouteEnter=r.beforeRouteLeave=r.beforeRouteUpdate=r.created}}var J="undefined"!=typeof window;function Z(t,e,n,r,i){var o=e||[],s=n||Object.create(null),a=r||Object.create(null);t.forEach(function(t){!function t(e,n,r,i,o,s){var a=i.path;var l=i.name;0;var u=i.pathToRegexpOptions||{};var c=function(t,e,n){n||(t=t.replace(/\/$/,""));if("/"===t[0])return t;if(null==e)return t;return w(e.path+"/"+t)}(a,o,u.strict);"boolean"==typeof i.caseSensitive&&(u.sensitive=i.caseSensitive);var h={path:c,regex:function(t,e){var n=S(t,[],e);return n}(c,u),components:i.components||{default:i.component},alias:i.alias?"string"==typeof i.alias?[i.alias]:i.alias:[],instances:{},enteredCbs:{},name:l,parent:o,matchAs:s,redirect:i.redirect,beforeEnter:i.beforeEnter,meta:i.meta||{},props:null==i.props?{}:i.components?i.props:{default:i.props}};i.children&&i.children.forEach(function(i){var o=s?w(s+"/"+i.path):void 0;t(e,n,r,i,h,o)});n[h.path]||(e.push(h.path),n[h.path]=h);if(void 0!==i.alias)for(var d=Array.isArray(i.alias)?i.alias:[i.alias],p=0;p<d.length;++p){var f=d[p];0;var g={path:f,children:i.children};t(e,n,r,g,o,h.path||"/")}l&&(r[l]||(r[l]=h))}(o,s,a,t,i)});for(var l=0,u=o.length;l<u;l++)"*"===o[l]&&(o.push(o.splice(l,1)[0]),u--,l--);return{pathList:o,pathMap:s,nameMap:a}}function Q(t,e){var n=Z(t),r=n.pathList,i=n.pathMap,o=n.nameMap;function s(t,n,s){var a=H(t,n,!1,e),u=a.name;if(u){var c=o[u];if(!c)return l(null,a);var h=c.regex.keys.filter(function(t){return!t.optional}).map(function(t){return t.name});if("object"!=typeof a.params&&(a.params={}),n&&"object"==typeof n.params)for(var d in n.params)!(d in a.params)&&h.indexOf(d)>-1&&(a.params[d]=n.params[d]);return a.path=V(c.path,a.params),l(c,a,s)}if(a.path){a.params={};for(var p=0;p<r.length;p++){var f=r[p],g=i[f];if(tt(g.regex,a.path,a.params))return l(g,a,s)}}return l(null,a)}function a(t,n){var r=t.redirect,i="function"==typeof r?r(f(t,n,null,e)):r;if("string"==typeof i&&(i={path:i}),!i||"object"!=typeof i)return l(null,n);var a=i,u=a.name,c=a.path,h=n.query,d=n.hash,p=n.params;if(h=a.hasOwnProperty("query")?a.query:h,d=a.hasOwnProperty("hash")?a.hash:d,p=a.hasOwnProperty("params")?a.params:p,u){o[u];return s({_normalized:!0,name:u,query:h,hash:d,params:p},void 0,n)}if(c){var g=function(t,e){return E(t,e.parent?e.parent.path:"/",!0)}(c,t);return s({_normalized:!0,path:V(g,p),query:h,hash:d},void 0,n)}return l(null,n)}function l(t,n,r){return t&&t.redirect?a(t,r||n):t&&t.matchAs?function(t,e,n){var r=s({_normalized:!0,path:V(n,e.params)});if(r){var i=r.matched,o=i[i.length-1];return e.params=r.params,l(o,e)}return l(null,e)}(0,n,t.matchAs):f(t,n,r,e)}return{match:s,addRoute:function(t,e){var n="object"!=typeof t?o[t]:void 0;Z([e||t],r,i,o,n),n&&n.alias.length&&Z(n.alias.map(function(t){return{path:t,children:[e]}}),r,i,o,n)},getRoutes:function(){return r.map(function(t){return i[t]})},addRoutes:function(t){Z(t,r,i,o)}}}function tt(t,e,n){var r=e.match(t);if(!r)return!1;if(!n)return!0;for(var i=1,o=r.length;i<o;++i){var s=t.keys[i-1];s&&(n[s.name||"pathMatch"]="string"==typeof r[i]?u(r[i]):r[i])}return!0}var et=J&&window.performance&&window.performance.now?window.performance:Date;function nt(){return et.now().toFixed(3)}var rt=nt();function it(){return rt}function ot(t){return rt=t}var st=Object.create(null);function at(){"scrollRestoration"in window.history&&(window.history.scrollRestoration="manual");var t=window.location.protocol+"//"+window.location.host,e=window.location.href.replace(t,""),n=i({},window.history.state);return n.key=it(),window.history.replaceState(n,"",e),window.addEventListener("popstate",ct),function(){window.removeEventListener("popstate",ct)}}function lt(t,e,n,r){if(t.app){var i=t.options.scrollBehavior;i&&t.app.$nextTick(function(){var o=function(){var t=it();if(t)return st[t]}(),s=i.call(t,e,n,r?o:null);s&&("function"==typeof s.then?s.then(function(t){gt(t,o)}).catch(function(t){0}):gt(s,o))})}}function ut(){var t=it();t&&(st[t]={x:window.pageXOffset,y:window.pageYOffset})}function ct(t){ut(),t.state&&t.state.key&&ot(t.state.key)}function ht(t){return pt(t.x)||pt(t.y)}function dt(t){return{x:pt(t.x)?t.x:window.pageXOffset,y:pt(t.y)?t.y:window.pageYOffset}}function pt(t){return"number"==typeof t}var ft=/^#\d/;function gt(t,e){var n,r="object"==typeof t;if(r&&"string"==typeof t.selector){var i=ft.test(t.selector)?document.getElementById(t.selector.slice(1)):document.querySelector(t.selector);if(i){var o=t.offset&&"object"==typeof t.offset?t.offset:{};e=function(t,e){var n=document.documentElement.getBoundingClientRect(),r=t.getBoundingClientRect();return{x:r.left-n.left-e.x,y:r.top-n.top-e.y}}(i,o={x:pt((n=o).x)?n.x:0,y:pt(n.y)?n.y:0})}else ht(t)&&(e=dt(t))}else r&&ht(t)&&(e=dt(t));e&&("scrollBehavior"in document.documentElement.style?window.scrollTo({left:e.x,top:e.y,behavior:t.behavior}):window.scrollTo(e.x,e.y))}var mt,vt=J&&((-1===(mt=window.navigator.userAgent).indexOf("Android 2.")&&-1===mt.indexOf("Android 4.0")||-1===mt.indexOf("Mobile Safari")||-1!==mt.indexOf("Chrome")||-1!==mt.indexOf("Windows Phone"))&&window.history&&"function"==typeof window.history.pushState);function bt(t,e){ut();var n=window.history;try{if(e){var r=i({},n.state);r.key=it(),n.replaceState(r,"",t)}else n.pushState({key:ot(nt())},"",t)}catch(n){window.location[e?"replace":"assign"](t)}}function _t(t){bt(t,!0)}function yt(t,e,n){var r=function(i){i>=t.length?n():t[i]?e(t[i],function(){r(i+1)}):r(i+1)};r(0)}var Tt={redirected:2,aborted:4,cancelled:8,duplicated:16};function xt(t,e){return wt(t,e,Tt.redirected,'Redirected when going from "'+t.fullPath+'" to "'+function(t){if("string"==typeof t)return t;if("path"in t)return t.path;var e={};return Ct.forEach(function(n){n in t&&(e[n]=t[n])}),JSON.stringify(e,null,2)}(e)+'" via a navigation guard.')}function Et(t,e){return wt(t,e,Tt.cancelled,'Navigation cancelled from "'+t.fullPath+'" to "'+e.fullPath+'" with a new navigation.')}function wt(t,e,n,r){var i=new Error(r);return i._isRouter=!0,i.from=t,i.to=e,i.type=n,i}var Ct=["params","query","hash"];function St(t){return Object.prototype.toString.call(t).indexOf("Error")>-1}function kt(t,e){return St(t)&&t._isRouter&&(null==e||t.type===e)}function Ot(t){return function(e,n,r){var i=!1,o=0,s=null;It(t,function(t,e,n,a){if("function"==typeof t&&void 0===t.cid){i=!0,o++;var l,u=Nt(function(e){var i;((i=e).__esModule||At&&"Module"===i[Symbol.toStringTag])&&(e=e.default),t.resolved="function"==typeof e?e:W.extend(e),n.components[a]=e,--o<=0&&r()}),c=Nt(function(t){var e="Failed to resolve async component "+a+": "+t;s||(s=St(t)?t:new Error(e),r(s))});try{l=t(u,c)}catch(t){c(t)}if(l)if("function"==typeof l.then)l.then(u,c);else{var h=l.component;h&&"function"==typeof h.then&&h.then(u,c)}}}),i||r()}}function It(t,e){return Rt(t.map(function(t){return Object.keys(t.components).map(function(n){return e(t.components[n],t.instances[n],t,n)})}))}function Rt(t){return Array.prototype.concat.apply([],t)}var At="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;function Nt(t){var e=!1;return function(){for(var n=[],r=arguments.length;r--;)n[r]=arguments[r];if(!e)return e=!0,t.apply(this,n)}}var Dt=function(t,e){this.router=t,this.base=function(t){if(!t)if(J){var e=document.querySelector("base");t=(t=e&&e.getAttribute("href")||"/").replace(/^https?:\/\/[^\/]+/,"")}else t="/";"/"!==t.charAt(0)&&(t="/"+t);return t.replace(/\/$/,"")}(e),this.current=m,this.pending=null,this.ready=!1,this.readyCbs=[],this.readyErrorCbs=[],this.errorCbs=[],this.listeners=[]};function Mt(t,e,n,r){var i=It(t,function(t,r,i,o){var s=function(t,e){"function"!=typeof t&&(t=W.extend(t));return t.options[e]}(t,e);if(s)return Array.isArray(s)?s.map(function(t){return n(t,r,i,o)}):n(s,r,i,o)});return Rt(r?i.reverse():i)}function Lt(t,e){if(e)return function(){return t.apply(e,arguments)}}Dt.prototype.listen=function(t){this.cb=t},Dt.prototype.onReady=function(t,e){this.ready?t():(this.readyCbs.push(t),e&&this.readyErrorCbs.push(e))},Dt.prototype.onError=function(t){this.errorCbs.push(t)},Dt.prototype.transitionTo=function(t,e,n){var r,i=this;try{r=this.router.match(t,this.current)}catch(t){throw this.errorCbs.forEach(function(e){e(t)}),t}var o=this.current;this.confirmTransition(r,function(){i.updateRoute(r),e&&e(r),i.ensureURL(),i.router.afterHooks.forEach(function(t){t&&t(r,o)}),i.ready||(i.ready=!0,i.readyCbs.forEach(function(t){t(r)}))},function(t){n&&n(t),t&&!i.ready&&(kt(t,Tt.redirected)&&o===m||(i.ready=!0,i.readyErrorCbs.forEach(function(e){e(t)})))})},Dt.prototype.confirmTransition=function(t,e,n){var i=this,o=this.current;this.pending=t;var s,a,l=function(t){!kt(t)&&St(t)&&(i.errorCbs.length?i.errorCbs.forEach(function(e){e(t)}):(r(),console.error(t))),n&&n(t)},u=t.matched.length-1,c=o.matched.length-1;if(b(t,o)&&u===c&&t.matched[u]===o.matched[c])return this.ensureURL(),l(((a=wt(s=o,t,Tt.duplicated,'Avoided redundant navigation to current location: "'+s.fullPath+'".')).name="NavigationDuplicated",a));var h=function(t,e){var n,r=Math.max(t.length,e.length);for(n=0;n<r&&t[n]===e[n];n++);return{updated:e.slice(0,n),activated:e.slice(n),deactivated:t.slice(n)}}(this.current.matched,t.matched),d=h.updated,p=h.deactivated,f=h.activated,g=function(e,n){if(i.pending!==t)return l(Et(o,t));try{e(t,o,function(e){!1===e?(i.ensureURL(!0),l(function(t,e){return wt(t,e,Tt.aborted,'Navigation aborted from "'+t.fullPath+'" to "'+e.fullPath+'" via a navigation guard.')}(o,t))):St(e)?(i.ensureURL(!0),l(e)):"string"==typeof e||"object"==typeof e&&("string"==typeof e.path||"string"==typeof e.name)?(l(xt(o,t)),"object"==typeof e&&e.replace?i.replace(e):i.push(e)):n(e)})}catch(t){l(t)}};yt([].concat(function(t){return Mt(t,"beforeRouteLeave",Lt,!0)}(p),this.router.beforeHooks,function(t){return Mt(t,"beforeRouteUpdate",Lt)}(d),f.map(function(t){return t.beforeEnter}),Ot(f)),g,function(){yt(function(t){return Mt(t,"beforeRouteEnter",function(t,e,n,r){return function(t,e,n){return function(r,i,o){return t(r,i,function(t){"function"==typeof t&&(e.enteredCbs[n]||(e.enteredCbs[n]=[]),e.enteredCbs[n].push(t)),o(t)})}}(t,n,r)})}(f).concat(i.router.resolveHooks),g,function(){if(i.pending!==t)return l(Et(o,t));i.pending=null,e(t),i.router.app&&i.router.app.$nextTick(function(){y(t)})})})},Dt.prototype.updateRoute=function(t){this.current=t,this.cb&&this.cb(t)},Dt.prototype.setupListeners=function(){},Dt.prototype.teardown=function(){this.listeners.forEach(function(t){t()}),this.listeners=[],this.current=m,this.pending=null};var Pt=function(t){function e(e,n){t.call(this,e,n),this._startLocation=Ft(this.base)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setupListeners=function(){var t=this;if(!(this.listeners.length>0)){var e=this.router,n=e.options.scrollBehavior,r=vt&&n;r&&this.listeners.push(at());var i=function(){var n=t.current,i=Ft(t.base);t.current===m&&i===t._startLocation||t.transitionTo(i,function(t){r&&lt(e,t,n,!0)})};window.addEventListener("popstate",i),this.listeners.push(function(){window.removeEventListener("popstate",i)})}},e.prototype.go=function(t){window.history.go(t)},e.prototype.push=function(t,e,n){var r=this,i=this.current;this.transitionTo(t,function(t){bt(w(r.base+t.fullPath)),lt(r.router,t,i,!1),e&&e(t)},n)},e.prototype.replace=function(t,e,n){var r=this,i=this.current;this.transitionTo(t,function(t){_t(w(r.base+t.fullPath)),lt(r.router,t,i,!1),e&&e(t)},n)},e.prototype.ensureURL=function(t){if(Ft(this.base)!==this.current.fullPath){var e=w(this.base+this.current.fullPath);t?bt(e):_t(e)}},e.prototype.getCurrentLocation=function(){return Ft(this.base)},e}(Dt);function Ft(t){var e=window.location.pathname,n=e.toLowerCase(),r=t.toLowerCase();return!t||n!==r&&0!==n.indexOf(w(r+"/"))||(e=e.slice(t.length)),(e||"/")+window.location.search+window.location.hash}var Bt=function(t){function e(e,n,r){t.call(this,e,n),r&&function(t){var e=Ft(t);if(!/^\/#/.test(e))return window.location.replace(w(t+"/#"+e)),!0}(this.base)||jt()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setupListeners=function(){var t=this;if(!(this.listeners.length>0)){var e=this.router.options.scrollBehavior,n=vt&&e;n&&this.listeners.push(at());var r=function(){var e=t.current;jt()&&t.transitionTo($t(),function(r){n&&lt(t.router,r,e,!0),vt||Ht(r.fullPath)})},i=vt?"popstate":"hashchange";window.addEventListener(i,r),this.listeners.push(function(){window.removeEventListener(i,r)})}},e.prototype.push=function(t,e,n){var r=this,i=this.current;this.transitionTo(t,function(t){Vt(t.fullPath),lt(r.router,t,i,!1),e&&e(t)},n)},e.prototype.replace=function(t,e,n){var r=this,i=this.current;this.transitionTo(t,function(t){Ht(t.fullPath),lt(r.router,t,i,!1),e&&e(t)},n)},e.prototype.go=function(t){window.history.go(t)},e.prototype.ensureURL=function(t){var e=this.current.fullPath;$t()!==e&&(t?Vt(e):Ht(e))},e.prototype.getCurrentLocation=function(){return $t()},e}(Dt);function jt(){var t=$t();return"/"===t.charAt(0)||(Ht("/"+t),!1)}function $t(){var t=window.location.href,e=t.indexOf("#");return e<0?"":t=t.slice(e+1)}function Ut(t){var e=window.location.href,n=e.indexOf("#");return(n>=0?e.slice(0,n):e)+"#"+t}function Vt(t){vt?bt(Ut(t)):window.location.hash=t}function Ht(t){vt?_t(Ut(t)):window.location.replace(Ut(t))}var Wt=function(t){function e(e,n){t.call(this,e,n),this.stack=[],this.index=-1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.push=function(t,e,n){var r=this;this.transitionTo(t,function(t){r.stack=r.stack.slice(0,r.index+1).concat(t),r.index++,e&&e(t)},n)},e.prototype.replace=function(t,e,n){var r=this;this.transitionTo(t,function(t){r.stack=r.stack.slice(0,r.index).concat(t),e&&e(t)},n)},e.prototype.go=function(t){var e=this,n=this.index+t;if(!(n<0||n>=this.stack.length)){var r=this.stack[n];this.confirmTransition(r,function(){var t=e.current;e.index=n,e.updateRoute(r),e.router.afterHooks.forEach(function(e){e&&e(r,t)})},function(t){kt(t,Tt.duplicated)&&(e.index=n)})}},e.prototype.getCurrentLocation=function(){var t=this.stack[this.stack.length-1];return t?t.fullPath:"/"},e.prototype.ensureURL=function(){},e}(Dt),Gt=function(t){void 0===t&&(t={}),this.app=null,this.apps=[],this.options=t,this.beforeHooks=[],this.resolveHooks=[],this.afterHooks=[],this.matcher=Q(t.routes||[],this);var e=t.mode||"hash";switch(this.fallback="history"===e&&!vt&&!1!==t.fallback,this.fallback&&(e="hash"),J||(e="abstract"),this.mode=e,e){case"history":this.history=new Pt(this,t.base);break;case"hash":this.history=new Bt(this,t.base,this.fallback);break;case"abstract":this.history=new Wt(this,t.base);break;default:0}},zt={currentRoute:{configurable:!0}};function Xt(t,e){return t.push(e),function(){var n=t.indexOf(e);n>-1&&t.splice(n,1)}}Gt.prototype.match=function(t,e,n){return this.matcher.match(t,e,n)},zt.currentRoute.get=function(){return this.history&&this.history.current},Gt.prototype.init=function(t){var e=this;if(this.apps.push(t),t.$once("hook:destroyed",function(){var n=e.apps.indexOf(t);n>-1&&e.apps.splice(n,1),e.app===t&&(e.app=e.apps[0]||null),e.app||e.history.teardown()}),!this.app){this.app=t;var n=this.history;if(n instanceof Pt||n instanceof Bt){var r=function(t){n.setupListeners(),function(t){var r=n.current,i=e.options.scrollBehavior;vt&&i&&"fullPath"in t&&lt(e,t,r,!1)}(t)};n.transitionTo(n.getCurrentLocation(),r,r)}n.listen(function(t){e.apps.forEach(function(e){e._route=t})})}},Gt.prototype.beforeEach=function(t){return Xt(this.beforeHooks,t)},Gt.prototype.beforeResolve=function(t){return Xt(this.resolveHooks,t)},Gt.prototype.afterEach=function(t){return Xt(this.afterHooks,t)},Gt.prototype.onReady=function(t,e){this.history.onReady(t,e)},Gt.prototype.onError=function(t){this.history.onError(t)},Gt.prototype.push=function(t,e,n){var r=this;if(!e&&!n&&"undefined"!=typeof Promise)return new Promise(function(e,n){r.history.push(t,e,n)});this.history.push(t,e,n)},Gt.prototype.replace=function(t,e,n){var r=this;if(!e&&!n&&"undefined"!=typeof Promise)return new Promise(function(e,n){r.history.replace(t,e,n)});this.history.replace(t,e,n)},Gt.prototype.go=function(t){this.history.go(t)},Gt.prototype.back=function(){this.go(-1)},Gt.prototype.forward=function(){this.go(1)},Gt.prototype.getMatchedComponents=function(t){var e=t?t.matched?t:this.resolve(t).route:this.currentRoute;return e?[].concat.apply([],e.matched.map(function(t){return Object.keys(t.components).map(function(e){return t.components[e]})})):[]},Gt.prototype.resolve=function(t,e,n){var r=H(t,e=e||this.history.current,n,this),i=this.match(r,e),o=i.redirectedFrom||i.fullPath;return{location:r,route:i,href:function(t,e,n){var r="hash"===n?"#"+e:e;return t?w(t+"/"+r):r}(this.history.base,o,this.mode),normalizedTo:r,resolved:i}},Gt.prototype.getRoutes=function(){return this.matcher.getRoutes()},Gt.prototype.addRoute=function(t,e){this.matcher.addRoute(t,e),this.history.current!==m&&this.history.transitionTo(this.history.getCurrentLocation())},Gt.prototype.addRoutes=function(t){this.matcher.addRoutes(t),this.history.current!==m&&this.history.transitionTo(this.history.getCurrentLocation())},Object.defineProperties(Gt.prototype,zt),Gt.install=q,Gt.version="3.5.2",Gt.isNavigationFailure=kt,Gt.NavigationFailureType=Tt,Gt.START_LOCATION=m,J&&window.Vue&&window.Vue.use(Gt),e.a=Gt},"0+0a":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.json=[{tfOpName:"HashTable",category:"hash_table",inputs:[],attrs:[{tfName:"shared_name",name:"sharedName",type:"string"},{tfName:"use_node_name_sharing",name:"useNodeNameSharing",type:"bool"},{tfName:"key_dtype",name:"keyDType",type:"dtype"},{tfName:"value_dtype",name:"valueDType",type:"dtype"}]},{tfOpName:"HashTableV2",category:"hash_table",inputs:[],attrs:[{tfName:"shared_name",name:"sharedName",type:"string"},{tfName:"use_node_name_sharing",name:"useNodeNameSharing",type:"bool"},{tfName:"key_dtype",name:"keyDType",type:"dtype"},{tfName:"value_dtype",name:"valueDType",type:"dtype"}]},{tfOpName:"LookupTableImport",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"values",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableImportV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"values",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableFind",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableFindV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableSize",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"}]},{tfOpName:"LookupTableSizeV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"}]}]},"02Hb":function(t,e,n){(function(r){var i;i=function(){var t=t||function(t,e){var i;if("undefined"!=typeof window&&window.crypto&&(i=window.crypto),"undefined"!=typeof self&&self.crypto&&(i=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(i=globalThis.crypto),!i&&"undefined"!=typeof window&&window.msCrypto&&(i=window.msCrypto),!i&&void 0!==r&&r.crypto&&(i=r.crypto),!i)try{i=n(6)}catch(t){}var o=function(){if(i){if("function"==typeof i.getRandomValues)try{return i.getRandomValues(new Uint32Array(1))[0]}catch(t){}if("function"==typeof i.randomBytes)try{return i.randomBytes(4).readInt32LE()}catch(t){}}throw new Error("Native crypto module could not be used to get secure random number.")},s=Object.create||function(){function t(){}return function(e){var n;return t.prototype=e,n=new t,t.prototype=null,n}}(),a={},l=a.lib={},u=l.Base={extend:function(t){var e=s(this);return t&&e.mixIn(t),e.hasOwnProperty("init")&&this.init!==e.init||(e.init=function(){e.$super.init.apply(this,arguments)}),e.init.prototype=e,e.$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}},c=l.WordArray=u.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=void 0!=e?e:4*t.length},toString:function(t){return(t||d).stringify(this)},concat:function(t){var e=this.words,n=t.words,r=this.sigBytes,i=t.sigBytes;if(this.clamp(),r%4)for(var o=0;o<i;o++){var s=n[o>>>2]>>>24-o%4*8&255;e[r+o>>>2]|=s<<24-(r+o)%4*8}else for(var a=0;a<i;a+=4)e[r+a>>>2]=n[a>>>2];return this.sigBytes+=i,this},clamp:function(){var e=this.words,n=this.sigBytes;e[n>>>2]&=4294967295<<32-n%4*8,e.length=t.ceil(n/4)},clone:function(){var t=u.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var e=[],n=0;n<t;n+=4)e.push(o());return new c.init(e,t)}}),h=a.enc={},d=h.Hex={stringify:function(t){for(var e=t.words,n=t.sigBytes,r=[],i=0;i<n;i++){var o=e[i>>>2]>>>24-i%4*8&255;r.push((o>>>4).toString(16)),r.push((15&o).toString(16))}return r.join("")},parse:function(t){for(var e=t.length,n=[],r=0;r<e;r+=2)n[r>>>3]|=parseInt(t.substr(r,2),16)<<24-r%8*4;return new c.init(n,e/2)}},p=h.Latin1={stringify:function(t){for(var e=t.words,n=t.sigBytes,r=[],i=0;i<n;i++){var o=e[i>>>2]>>>24-i%4*8&255;r.push(String.fromCharCode(o))}return r.join("")},parse:function(t){for(var e=t.length,n=[],r=0;r<e;r++)n[r>>>2]|=(255&t.charCodeAt(r))<<24-r%4*8;return new c.init(n,e)}},f=h.Utf8={stringify:function(t){try{return decodeURIComponent(escape(p.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return p.parse(unescape(encodeURIComponent(t)))}},g=l.BufferedBlockAlgorithm=u.extend({reset:function(){this._data=new c.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=f.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(e){var n,r=this._data,i=r.words,o=r.sigBytes,s=this.blockSize,a=o/(4*s),l=(a=e?t.ceil(a):t.max((0|a)-this._minBufferSize,0))*s,u=t.min(4*l,o);if(l){for(var h=0;h<l;h+=s)this._doProcessBlock(i,h);n=i.splice(0,l),r.sigBytes-=u}return new c.init(n,u)},clone:function(){var t=u.clone.call(this);return t._data=this._data.clone(),t},_minBufferSize:0}),m=(l.Hasher=g.extend({cfg:u.extend(),init:function(t){this.cfg=this.cfg.extend(t),this.reset()},reset:function(){g.reset.call(this),this._doReset()},update:function(t){return this._append(t),this._process(),this},finalize:function(t){return t&&this._append(t),this._doFinalize()},blockSize:16,_createHelper:function(t){return function(e,n){return new t.init(n).finalize(e)}},_createHmacHelper:function(t){return function(e,n){return new m.HMAC.init(t,n).finalize(e)}}}),a.algo={});return a}(Math);return t},t.exports=e=i()}).call(e,n("DuR2"))},"02w1":function(t,e,n){"use strict";e.__esModule=!0,e.removeResizeListener=e.addResizeListener=void 0;var r,i=n("z+gd"),o=(r=i)&&r.__esModule?r:{default:r};var s="undefined"==typeof window,a=function(t){var e=t,n=Array.isArray(e),r=0;for(e=n?e:e[Symbol.iterator]();;){var i;if(n){if(r>=e.length)break;i=e[r++]}else{if((r=e.next()).done)break;i=r.value}var o=i.target.__resizeListeners__||[];o.length&&o.forEach(function(t){t()})}};e.addResizeListener=function(t,e){s||(t.__resizeListeners__||(t.__resizeListeners__=[],t.__ro__=new o.default(a),t.__ro__.observe(t)),t.__resizeListeners__.push(e))},e.removeResizeListener=function(t,e){t&&t.__resizeListeners__&&(t.__resizeListeners__.splice(t.__resizeListeners__.indexOf(e),1),t.__resizeListeners__.length||t.__ro__.disconnect())}},"06OY":function(t,e,n){var r=n("3Eo+")("meta"),i=n("EqjI"),o=n("D2L2"),s=n("evD5").f,a=0,l=Object.isExtensible||function(){return!0},u=!n("S82l")(function(){return l(Object.preventExtensions({}))}),c=function(t){s(t,r,{value:{i:"O"+ ++a,w:{}}})},h=t.exports={KEY:r,NEED:!1,fastKey:function(t,e){if(!i(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!o(t,r)){if(!l(t))return"F";if(!e)return"E";c(t)}return t[r].i},getWeak:function(t,e){if(!o(t,r)){if(!l(t))return!0;if(!e)return!1;c(t)}return t[r].w},onFreeze:function(t){return u&&h.NEED&&l(t)&&!o(t,r)&&c(t),t}}},"0FNO":function(t,e,n){"use strict";var r=n("Kkag"),i=n("l5jf"),o=n("xMQ1"),s=n("35G1");const a=Object(s.a)({oneHot_:
  31. /**
  32. * @license
  33. * Copyright 2020 Google LLC. All Rights Reserved.
  34. * Licensed under the Apache License, Version 2.0 (the "License");
  35. * you may not use this file except in compliance with the License.
  36. * You may obtain a copy of the License at
  37. *
  38. * http://www.apache.org/licenses/LICENSE-2.0
  39. *
  40. * Unless required by applicable law or agreed to in writing, software
  41. * distributed under the License is distributed on an "AS IS" BASIS,
  42. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  43. * See the License for the specific language governing permissions and
  44. * limitations under the License.
  45. * =============================================================================
  46. */
  47. function(t,e,n=1,s=0){if(e<2)throw new Error(`Error in oneHot: depth must be >=2, but it is ${e}`);const a={indices:Object(o.a)(t,"indices","oneHot","int32")},l={depth:e,onValue:n,offValue:s};return r.a.runKernel(i._50,a,l)}});e.a=a},"0Iyz":function(t,e,n){var r;r=function(t){return t.pad.NoPadding={pad:function(){},unpad:function(){}},t.pad.NoPadding},t.exports=r(n("02Hb"),n("fGru"))},"0KS2":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.json=[{tfOpName:"StringNGrams",category:"string",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"dataSplits",type:"tensor"}],attrs:[{tfName:"separator",name:"separator",type:"string"},{tfName:"ngram_widths",name:"nGramWidths",type:"number[]"},{tfName:"left_pad",name:"leftPad",type:"string"},{tfName:"right_pad",name:"rightPad",type:"string"},{tfName:"pad_width",name:"padWidth",type:"number"},{tfName:"preserve_short_sequences",name:"preserveShortSequences",type:"bool"}],outputs:["ngrams","ngrams_splits"]},{tfOpName:"StringSplit",category:"string",inputs:[{start:0,name:"input",type:"tensor"},{start:1,name:"delimiter",type:"tensor"}],attrs:[{tfName:"skip_empty",name:"skipEmpty",type:"bool"}],outputs:["indices","values","shape"]},{tfOpName:"StringToHashBucketFast",category:"string",inputs:[{start:0,name:"input",type:"tensor"}],attrs:[{tfName:"num_buckets",name:"numBuckets",type:"number"}]}]},"0hgu":function(t,e,n){var r;r=function(t){var e,n,r,i,o;return n=(e=t).lib.WordArray,r=e.algo,i=r.SHA256,o=r.SHA224=i.extend({_doReset:function(){this._hash=new n.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var t=i._doFinalize.call(this);return t.sigBytes-=4,t}}),e.SHA224=i._createHelper(o),e.HmacSHA224=i._createHmacHelper(o),t.SHA224},t.exports=r(n("02Hb"),n("mP1F"))},"0kY3":function(t,e,n){t.exports=function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/dist/",n(n.s=102)}({0:function(t,e,n){"use strict";function r(t,e,n,r,i,o,s,a){var l,u="function"==typeof t?t.options:t;if(e&&(u.render=e,u.staticRenderFns=n,u._compiled=!0),r&&(u.functional=!0),o&&(u._scopeId="data-v-"+o),s?(l=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(s)},u._ssrRegister=l):i&&(l=a?function(){i.call(this,this.$root.$options.shadowRoot)}:i),l)if(u.functional){u._injectStyles=l;var c=u.render;u.render=function(t,e){return l.call(e),c(t,e)}}else{var h=u.beforeCreate;u.beforeCreate=h?[].concat(h,l):[l]}return{exports:t,options:u}}n.d(e,"a",function(){return r})},10:function(t,e){t.exports=n("HJMx")},102:function(t,e,n){"use strict";n.r(e);var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:["el-input-number",t.inputNumberSize?"el-input-number--"+t.inputNumberSize:"",{"is-disabled":t.inputNumberDisabled},{"is-without-controls":!t.controls},{"is-controls-right":t.controlsAtRight}],on:{dragstart:function(t){t.preventDefault()}}},[t.controls?n("span",{directives:[{name:"repeat-click",rawName:"v-repeat-click",value:t.decrease,expression:"decrease"}],staticClass:"el-input-number__decrease",class:{"is-disabled":t.minDisabled},attrs:{role:"button"},on:{keydown:function(e){return"button"in e||!t._k(e.keyCode,"enter",13,e.key,"Enter")?t.decrease(e):null}}},[n("i",{class:"el-icon-"+(t.controlsAtRight?"arrow-down":"minus")})]):t._e(),t.controls?n("span",{directives:[{name:"repeat-click",rawName:"v-repeat-click",value:t.increase,expression:"increase"}],staticClass:"el-input-number__increase",class:{"is-disabled":t.maxDisabled},attrs:{role:"button"},on:{keydown:function(e){return"button"in e||!t._k(e.keyCode,"enter",13,e.key,"Enter")?t.increase(e):null}}},[n("i",{class:"el-icon-"+(t.controlsAtRight?"arrow-up":"plus")})]):t._e(),n("el-input",{ref:"input",attrs:{value:t.displayValue,placeholder:t.placeholder,disabled:t.inputNumberDisabled,size:t.inputNumberSize,max:t.max,min:t.min,name:t.name,label:t.label},on:{blur:t.handleBlur,focus:t.handleFocus,input:t.handleInput,change:t.handleInputChange},nativeOn:{keydown:[function(e){return"button"in e||!t._k(e.keyCode,"up",38,e.key,["Up","ArrowUp"])?(e.preventDefault(),t.increase(e)):null},function(e){return"button"in e||!t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"])?(e.preventDefault(),t.decrease(e)):null}]}})],1)};r._withStripped=!0;var i=n(10),o=n.n(i),s=n(22),a=n.n(s),l=n(30),u={name:"ElInputNumber",mixins:[a()("input")],inject:{elForm:{default:""},elFormItem:{default:""}},directives:{repeatClick:l.a},components:{ElInput:o.a},props:{step:{type:Number,default:1},stepStrictly:{type:Boolean,default:!1},max:{type:Number,default:1/0},min:{type:Number,default:-1/0},value:{},disabled:Boolean,size:String,controls:{type:Boolean,default:!0},controlsPosition:{type:String,default:""},name:String,label:String,placeholder:String,precision:{type:Number,validator:function(t){return t>=0&&t===parseInt(t,10)}}},data:function(){return{currentValue:0,userInput:null}},watch:{value:{immediate:!0,handler:function(t){var e=void 0===t?t:Number(t);if(void 0!==e){if(isNaN(e))return;if(this.stepStrictly){var n=this.getPrecision(this.step),r=Math.pow(10,n);e=Math.round(e/this.step)*r*this.step/r}void 0!==this.precision&&(e=this.toPrecision(e,this.precision))}e>=this.max&&(e=this.max),e<=this.min&&(e=this.min),this.currentValue=e,this.userInput=null,this.$emit("input",e)}}},computed:{minDisabled:function(){return this._decrease(this.value,this.step)<this.min},maxDisabled:function(){return this._increase(this.value,this.step)>this.max},numPrecision:function(){var t=this.value,e=this.step,n=this.getPrecision,r=this.precision,i=n(e);return void 0!==r?(i>r&&console.warn("[Element Warn][InputNumber]precision should not be less than the decimal places of step"),r):Math.max(n(t),i)},controlsAtRight:function(){return this.controls&&"right"===this.controlsPosition},_elFormItemSize:function(){return(this.elFormItem||{}).elFormItemSize},inputNumberSize:function(){return this.size||this._elFormItemSize||(this.$ELEMENT||{}).size},inputNumberDisabled:function(){return this.disabled||!!(this.elForm||{}).disabled},displayValue:function(){if(null!==this.userInput)return this.userInput;var t=this.currentValue;if("number"==typeof t){if(this.stepStrictly){var e=this.getPrecision(this.step),n=Math.pow(10,e);t=Math.round(t/this.step)*n*this.step/n}void 0!==this.precision&&(t=t.toFixed(this.precision))}return t}},methods:{toPrecision:function(t,e){return void 0===e&&(e=this.numPrecision),parseFloat(Math.round(t*Math.pow(10,e))/Math.pow(10,e))},getPrecision:function(t){if(void 0===t)return 0;var e=t.toString(),n=e.indexOf("."),r=0;return-1!==n&&(r=e.length-n-1),r},_increase:function(t,e){if("number"!=typeof t&&void 0!==t)return this.currentValue;var n=Math.pow(10,this.numPrecision);return this.toPrecision((n*t+n*e)/n)},_decrease:function(t,e){if("number"!=typeof t&&void 0!==t)return this.currentValue;var n=Math.pow(10,this.numPrecision);return this.toPrecision((n*t-n*e)/n)},increase:function(){if(!this.inputNumberDisabled&&!this.maxDisabled){var t=this.value||0,e=this._increase(t,this.step);this.setCurrentValue(e)}},decrease:function(){if(!this.inputNumberDisabled&&!this.minDisabled){var t=this.value||0,e=this._decrease(t,this.step);this.setCurrentValue(e)}},handleBlur:function(t){this.$emit("blur",t)},handleFocus:function(t){this.$emit("focus",t)},setCurrentValue:function(t){var e=this.currentValue;"number"==typeof t&&void 0!==this.precision&&(t=this.toPrecision(t,this.precision)),t>=this.max&&(t=this.max),t<=this.min&&(t=this.min),e!==t&&(this.userInput=null,this.$emit("input",t),this.$emit("change",t,e),this.currentValue=t)},handleInput:function(t){this.userInput=t},handleInputChange:function(t){var e=""===t?void 0:Number(t);isNaN(e)&&""!==t||this.setCurrentValue(e),this.userInput=null},select:function(){this.$refs.input.select()}},mounted:function(){var t=this.$refs.input.$refs.input;t.setAttribute("role","spinbutton"),t.setAttribute("aria-valuemax",this.max),t.setAttribute("aria-valuemin",this.min),t.setAttribute("aria-valuenow",this.currentValue),t.setAttribute("aria-disabled",this.inputNumberDisabled)},updated:function(){this.$refs&&this.$refs.input&&this.$refs.input.$refs.input.setAttribute("aria-valuenow",this.currentValue)}},c=n(0),h=Object(c.a)(u,r,[],!1,null,null,null);h.options.__file="packages/input-number/src/input-number.vue";var d=h.exports;d.install=function(t){t.component(d.name,d)};e.default=d},2:function(t,e){t.exports=n("2kvA")},22:function(t,e){t.exports=n("1oZe")},30:function(t,e,n){"use strict";var r=n(2);e.a={bind:function(t,e,n){var i=null,o=void 0,s=function(){return n.context[e.expression].apply()},a=function(){Date.now()-o<100&&s(),clearInterval(i),i=null};Object(r.on)(t,"mousedown",function(t){0===t.button&&(o=Date.now(),Object(r.once)(document,"mouseup",a),clearInterval(i),i=setInterval(s,100))})}}}})},"1J88":function(t,e,n){var r;r=function(t){var e,n,r,i,o;return n=(e=t).lib,r=n.Base,i=n.WordArray,(o=e.x64={}).Word=r.extend({init:function(t,e){this.high=t,this.low=e}}),o.WordArray=r.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=void 0!=e?e:8*t.length},toX32:function(){for(var t=this.words,e=t.length,n=[],r=0;r<e;r++){var o=t[r];n.push(o.high),n.push(o.low)}return i.create(n,this.sigBytes)},clone:function(){for(var t=r.clone.call(this),e=t.words=this.words.slice(0),n=e.length,i=0;i<n;i++)e[i]=e[i].clone();return t}}),t},t.exports=r(n("02Hb"))},"1kS7":function(t,e){e.f=Object.getOwnPropertySymbols},"1oZe":function(t,e,n){"use strict";e.__esModule=!0,e.default=function(t){return{methods:{focus:function(){this.$refs[t].focus()}}}}},"21It":function(t,e,n){"use strict";var r=n("FtD3");t.exports=function(t,e,n){var i=n.config.validateStatus;n.status&&i&&!i(n.status)?e(r("Request failed with status code "+n.status,n.config,null,n.request,n)):t(n)}},"2KxR":function(t,e){t.exports=function(t,e,n,r){if(!(t instanceof e)||void 0!==r&&r in t)throw TypeError(n+": incorrect invocation!");return t}},"2kvA":function(t,e,n){"use strict";e.__esModule=!0,e.isInContainer=e.getScrollContainer=e.isScroll=e.getStyle=e.once=e.off=e.on=void 0;var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};e.hasClass=f,e.addClass=function(t,e){if(!t)return;for(var n=t.className,r=(e||"").split(" "),i=0,o=r.length;i<o;i++){var s=r[i];s&&(t.classList?t.classList.add(s):f(t,s)||(n+=" "+s))}t.classList||t.setAttribute("class",n)},e.removeClass=function(t,e){if(!t||!e)return;for(var n=e.split(" "),r=" "+t.className+" ",i=0,o=n.length;i<o;i++){var s=n[i];s&&(t.classList?t.classList.remove(s):f(t,s)&&(r=r.replace(" "+s+" "," ")))}t.classList||t.setAttribute("class",c(r))},e.setStyle=function t(e,n,i){if(!e||!n)return;if("object"===(void 0===n?"undefined":r(n)))for(var o in n)n.hasOwnProperty(o)&&t(e,o,n[o]);else"opacity"===(n=h(n))&&u<9?e.style.filter=isNaN(i)?"":"alpha(opacity="+100*i+")":e.style[n]=i};var i,o=n("7+uW");var s=((i=o)&&i.__esModule?i:{default:i}).default.prototype.$isServer,a=/([\:\-\_]+(.))/g,l=/^moz([A-Z])/,u=s?0:Number(document.documentMode),c=function(t){return(t||"").replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g,"")},h=function(t){return t.replace(a,function(t,e,n,r){return r?n.toUpperCase():n}).replace(l,"Moz$1")},d=e.on=!s&&document.addEventListener?function(t,e,n){t&&e&&n&&t.addEventListener(e,n,!1)}:function(t,e,n){t&&e&&n&&t.attachEvent("on"+e,n)},p=e.off=!s&&document.removeEventListener?function(t,e,n){t&&e&&t.removeEventListener(e,n,!1)}:function(t,e,n){t&&e&&t.detachEvent("on"+e,n)};e.once=function(t,e,n){d(t,e,function r(){n&&n.apply(this,arguments),p(t,e,r)})};function f(t,e){if(!t||!e)return!1;if(-1!==e.indexOf(" "))throw new Error("className should not contain space.");return t.classList?t.classList.contains(e):(" "+t.className+" ").indexOf(" "+e+" ")>-1}var g=e.getStyle=u<9?function(t,e){if(!s){if(!t||!e)return null;"float"===(e=h(e))&&(e="styleFloat");try{switch(e){case"opacity":try{return t.filters.item("alpha").opacity/100}catch(t){return 1}default:return t.style[e]||t.currentStyle?t.currentStyle[e]:null}}catch(n){return t.style[e]}}}:function(t,e){if(!s){if(!t||!e)return null;"float"===(e=h(e))&&(e="cssFloat");try{var n=document.defaultView.getComputedStyle(t,"");return t.style[e]||n?n[e]:null}catch(n){return t.style[e]}}};var m=e.isScroll=function(t,e){if(!s)return g(t,null!==e&&void 0!==e?e?"overflow-y":"overflow-x":"overflow").match(/(scroll|auto)/)};e.getScrollContainer=function(t,e){if(!s){for(var n=t;n;){if([window,document,document.documentElement].includes(n))return window;if(m(n,e))return n;n=n.parentNode}return n}},e.isInContainer=function(t,e){if(s||!t||!e)return!1;var n=t.getBoundingClientRect(),r=void 0;return r=[window,document,document.documentElement,null,void 0].includes(e)?{top:0,right:window.innerWidth,bottom:window.innerHeight,left:0}:e.getBoundingClientRect(),n.top<r.bottom&&n.bottom>r.top&&n.right>r.left&&n.left<r.right}},"2reR":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.json=[{tfOpName:"NonMaxSuppressionV2",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"}]},{tfOpName:"NonMaxSuppressionV3",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"},{start:4,name:"scoreThreshold",type:"number"}]},{tfOpName:"NonMaxSuppressionV4",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"},{start:4,name:"scoreThreshold",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"T_threshold",name:"threshold",type:"dtype",notSupported:!0},{tfName:"pad_to_max_output_size",name:"padToMaxOutputSize",type:"bool"}]},{tfOpName:"NonMaxSuppressionV5",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"},{start:4,name:"scoreThreshold",type:"number"},{start:5,name:"softNmsSigma",type:"number"}]},{tfOpName:"Where",category:"dynamic",inputs:[{start:0,name:"condition",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ListDiff",category:"dynamic",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"y",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}]},"35G1":function(t,e,n){"use strict";e.a=function(t){const e=Object.keys(t);if(1!==e.length)throw new Error("Please provide an object with a single key (operation name) mapping to a function. Got an object with "+`${e.length} keys.`);let n=e[0];const s=t[n];n.endsWith("_")&&(n=n.substring(0,n.length-1));n+=o;const a=(...t)=>{r.a.startScope(n);try{const e=s(...t);return Object(i.isPromise)(e)&&console.error("Cannot return a Promise inside of tidy."),r.a.endScope(e),e}catch(t){throw r.a.endScope(null),t}};return Object.defineProperty(a,"name",{value:n,configurable:!0}),a};var r=n("Kkag"),i=n("XFvI");
  48. /**
  49. * @license
  50. * Copyright 2018 Google LLC. All Rights Reserved.
  51. * Licensed under the Apache License, Version 2.0 (the "License");
  52. * you may not use this file except in compliance with the License.
  53. * You may obtain a copy of the License at
  54. *
  55. * http://www.apache.org/licenses/LICENSE-2.0
  56. *
  57. * Unless required by applicable law or agreed to in writing, software
  58. * distributed under the License is distributed on an "AS IS" BASIS,
  59. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  60. * See the License for the specific language governing permissions and
  61. * limitations under the License.
  62. * =============================================================================
  63. */
  64. const o="__op"},"3Eo+":function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},"3IRH":function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},"3NE9":function(t,e,n){var r;r=function(t){return function(){var e=t,n=e.lib.StreamCipher,r=[],i=[],o=[],s=e.algo.RabbitLegacy=n.extend({_doReset:function(){var t=this._key.words,e=this.cfg.iv,n=this._X=[t[0],t[3]<<16|t[2]>>>16,t[1],t[0]<<16|t[3]>>>16,t[2],t[1]<<16|t[0]>>>16,t[3],t[2]<<16|t[1]>>>16],r=this._C=[t[2]<<16|t[2]>>>16,4294901760&t[0]|65535&t[1],t[3]<<16|t[3]>>>16,4294901760&t[1]|65535&t[2],t[0]<<16|t[0]>>>16,4294901760&t[2]|65535&t[3],t[1]<<16|t[1]>>>16,4294901760&t[3]|65535&t[0]];this._b=0;for(var i=0;i<4;i++)a.call(this);for(i=0;i<8;i++)r[i]^=n[i+4&7];if(e){var o=e.words,s=o[0],l=o[1],u=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),c=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8),h=u>>>16|4294901760&c,d=c<<16|65535&u;r[0]^=u,r[1]^=h,r[2]^=c,r[3]^=d,r[4]^=u,r[5]^=h,r[6]^=c,r[7]^=d;for(i=0;i<4;i++)a.call(this)}},_doProcessBlock:function(t,e){var n=this._X;a.call(this),r[0]=n[0]^n[5]>>>16^n[3]<<16,r[1]=n[2]^n[7]>>>16^n[5]<<16,r[2]=n[4]^n[1]>>>16^n[7]<<16,r[3]=n[6]^n[3]>>>16^n[1]<<16;for(var i=0;i<4;i++)r[i]=16711935&(r[i]<<8|r[i]>>>24)|4278255360&(r[i]<<24|r[i]>>>8),t[e+i]^=r[i]},blockSize:4,ivSize:2});function a(){for(var t=this._X,e=this._C,n=0;n<8;n++)i[n]=e[n];e[0]=e[0]+1295307597+this._b|0,e[1]=e[1]+3545052371+(e[0]>>>0<i[0]>>>0?1:0)|0,e[2]=e[2]+886263092+(e[1]>>>0<i[1]>>>0?1:0)|0,e[3]=e[3]+1295307597+(e[2]>>>0<i[2]>>>0?1:0)|0,e[4]=e[4]+3545052371+(e[3]>>>0<i[3]>>>0?1:0)|0,e[5]=e[5]+886263092+(e[4]>>>0<i[4]>>>0?1:0)|0,e[6]=e[6]+1295307597+(e[5]>>>0<i[5]>>>0?1:0)|0,e[7]=e[7]+3545052371+(e[6]>>>0<i[6]>>>0?1:0)|0,this._b=e[7]>>>0<i[7]>>>0?1:0;for(n=0;n<8;n++){var r=t[n]+e[n],s=65535&r,a=r>>>16,l=((s*s>>>17)+s*a>>>15)+a*a,u=((4294901760&r)*r|0)+((65535&r)*r|0);o[n]=l^u}t[0]=o[0]+(o[7]<<16|o[7]>>>16)+(o[6]<<16|o[6]>>>16)|0,t[1]=o[1]+(o[0]<<8|o[0]>>>24)+o[7]|0,t[2]=o[2]+(o[1]<<16|o[1]>>>16)+(o[0]<<16|o[0]>>>16)|0,t[3]=o[3]+(o[2]<<8|o[2]>>>24)+o[1]|0,t[4]=o[4]+(o[3]<<16|o[3]>>>16)+(o[2]<<16|o[2]>>>16)|0,t[5]=o[5]+(o[4]<<8|o[4]>>>24)+o[3]|0,t[6]=o[6]+(o[5]<<16|o[5]>>>16)+(o[4]<<16|o[4]>>>16)|0,t[7]=o[7]+(o[6]<<8|o[6]>>>24)+o[5]|0}e.RabbitLegacy=n._createHelper(s)}(),t.RabbitLegacy},t.exports=r(n("02Hb"),n("uFh6"),n("gykg"),n("wj1U"),n("fGru"))},"3fo+":function(t,e,n){t.exports=n("YAhB")},"3fs2":function(t,e,n){var r=n("RY/4"),i=n("dSzd")("iterator"),o=n("/bQp");t.exports=n("FeBl").getIteratorMethod=function(t){if(void 0!=t)return t[i]||t["@@iterator"]||o[r(t)]}},"3goy":function(t,e,n){"use strict";
  65. /**
  66. * @license
  67. * Copyright 2017 Google LLC. All Rights Reserved.
  68. * Licensed under the Apache License, Version 2.0 (the "License");
  69. * you may not use this file except in compliance with the License.
  70. * You may obtain a copy of the License at
  71. *
  72. * http://www.apache.org/licenses/LICENSE-2.0
  73. *
  74. * Unless required by applicable law or agreed to in writing, software
  75. * distributed under the License is distributed on an "AS IS" BASIS,
  76. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  77. * See the License for the specific language governing permissions and
  78. * limitations under the License.
  79. * =============================================================================
  80. */
  81. var r,i,o,s,a;e.b=u,e.a=function(t){return u(t,"int32")},function(t){t.R0="R0",t.R1="R1",t.R2="R2",t.R3="R3",t.R4="R4",t.R5="R5",t.R6="R6"}(r||(r={})),function(t){t.float32="float32",t.int32="int32",t.bool="int32",t.complex64="complex64"}(i||(i={})),function(t){t.float32="float32",t.int32="int32",t.bool="bool",t.complex64="complex64"}(o||(o={})),function(t){t.float32="float32",t.int32="float32",t.bool="float32",t.complex64="complex64"}(s||(s={})),function(t){t.float32="complex64",t.int32="complex64",t.bool="complex64",t.complex64="complex64"}(a||(a={}));const l={float32:s,int32:i,bool:o,complex64:a};function u(t,e){if("string"===t||"string"===e){if("string"===t&&"string"===e)return"string";throw new Error(`Can not upcast ${t} with ${e}`)}return l[t][e]}},"3ytT":function(t,e,n){var r;r=function(t){return function(){var e=t,n=e.lib.WordArray;e.enc.Base64url={stringify:function(t,e=!0){var n=t.words,r=t.sigBytes,i=e?this._safe_map:this._map;t.clamp();for(var o=[],s=0;s<r;s+=3)for(var a=(n[s>>>2]>>>24-s%4*8&255)<<16|(n[s+1>>>2]>>>24-(s+1)%4*8&255)<<8|n[s+2>>>2]>>>24-(s+2)%4*8&255,l=0;l<4&&s+.75*l<r;l++)o.push(i.charAt(a>>>6*(3-l)&63));var u=i.charAt(64);if(u)for(;o.length%4;)o.push(u);return o.join("")},parse:function(t,e=!0){var r=t.length,i=e?this._safe_map:this._map,o=this._reverseMap;if(!o){o=this._reverseMap=[];for(var s=0;s<i.length;s++)o[i.charCodeAt(s)]=s}var a=i.charAt(64);if(a){var l=t.indexOf(a);-1!==l&&(r=l)}return function(t,e,r){for(var i=[],o=0,s=0;s<e;s++)if(s%4){var a=r[t.charCodeAt(s-1)]<<s%4*2,l=r[t.charCodeAt(s)]>>>6-s%4*2,u=a|l;i[o>>>2]|=u<<24-o%4*8,o++}return n.create(i,o)}(t,r,o)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"}}(),t.enc.Base64url},t.exports=r(n("02Hb"))},"4Ute":function(t,e,n){"use strict";var r=n("Kkag"),i=n("l5jf"),o=n("jb1O"),s=n("xMQ1"),a=n("35G1");const l=Object(a.a)({matMul_:
  82. /**
  83. * @license
  84. * Copyright 2020 Google LLC. All Rights Reserved.
  85. * Licensed under the Apache License, Version 2.0 (the "License");
  86. * you may not use this file except in compliance with the License.
  87. * You may obtain a copy of the License at
  88. *
  89. * http://www.apache.org/licenses/LICENSE-2.0
  90. *
  91. * Unless required by applicable law or agreed to in writing, software
  92. * distributed under the License is distributed on an "AS IS" BASIS,
  93. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  94. * See the License for the specific language governing permissions and
  95. * limitations under the License.
  96. * =============================================================================
  97. */
  98. function(t,e,n=!1,a=!1){let l=Object(s.a)(t,"a","matMul"),u=Object(s.a)(e,"b","matMul");[l,u]=Object(o.c)(l,u);const c={a:l,b:u},h={transposeA:n,transposeB:a};return r.a.runKernel(i.s,c,h)}});e.a=l},"4dK1":function(t,e,n){(function(t){var r;!function(t,i,o){function s(t,e){return e.a=t.a,e.b=t.b,e.c=t.c,e.d=t.d,e}function a(t,e){var n=new function(t){var e=this,n="";e.next=function(){var t=e.b,n=e.c,r=e.d,i=e.a;return t=t<<25^t>>>7^n,n=n-r|0,r=r<<24^r>>>8^i,i=i-t|0,e.b=t=t<<20^t>>>12^n,e.c=n=n-r|0,e.d=r<<16^n>>>16^i,e.a=i-t|0},e.a=0,e.b=0,e.c=-1640531527,e.d=1367130551,t===Math.floor(t)?(e.a=t/4294967296|0,e.b=0|t):n+=t;for(var r=0;r<n.length+20;r++)e.b^=0|n.charCodeAt(r),e.next()}(t),r=e&&e.state,i=function(){return(n.next()>>>0)/4294967296};return i.double=function(){do{var t=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},i.int32=n.next,i.quick=i,r&&("object"==typeof r&&s(r,n),i.state=function(){return s(n,{})}),i}i&&i.exports?i.exports=a:n("LGuY")&&n("nErl")?void 0===(r=function(){return a}.call(e,n,e,i))||(i.exports=r):this.tychei=a}(0,"object"==typeof t&&t,n("LGuY"))}).call(e,n("3IRH")(t))},"4mcu":function(t,e){t.exports=function(){}},"4pyl":function(t,e,n){var r;r=function(t){return function(){var e=t,n=e.lib,r=n.WordArray,i=n.BlockCipher,o=e.algo,s=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],a=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],l=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],u=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],c=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],h=o.DES=i.extend({_doReset:function(){for(var t=this._key.words,e=[],n=0;n<56;n++){var r=s[n]-1;e[n]=t[r>>>5]>>>31-r%32&1}for(var i=this._subKeys=[],o=0;o<16;o++){var u=i[o]=[],c=l[o];for(n=0;n<24;n++)u[n/6|0]|=e[(a[n]-1+c)%28]<<31-n%6,u[4+(n/6|0)]|=e[28+(a[n+24]-1+c)%28]<<31-n%6;u[0]=u[0]<<1|u[0]>>>31;for(n=1;n<7;n++)u[n]=u[n]>>>4*(n-1)+3;u[7]=u[7]<<5|u[7]>>>27}var h=this._invSubKeys=[];for(n=0;n<16;n++)h[n]=i[15-n]},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._subKeys)},decryptBlock:function(t,e){this._doCryptBlock(t,e,this._invSubKeys)},_doCryptBlock:function(t,e,n){this._lBlock=t[e],this._rBlock=t[e+1],d.call(this,4,252645135),d.call(this,16,65535),p.call(this,2,858993459),p.call(this,8,16711935),d.call(this,1,1431655765);for(var r=0;r<16;r++){for(var i=n[r],o=this._lBlock,s=this._rBlock,a=0,l=0;l<8;l++)a|=u[l][((s^i[l])&c[l])>>>0];this._lBlock=s,this._rBlock=o^a}var h=this._lBlock;this._lBlock=this._rBlock,this._rBlock=h,d.call(this,1,1431655765),p.call(this,8,16711935),p.call(this,2,858993459),d.call(this,16,65535),d.call(this,4,252645135),t[e]=this._lBlock,t[e+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function d(t,e){var n=(this._lBlock>>>t^this._rBlock)&e;this._rBlock^=n,this._lBlock^=n<<t}function p(t,e){var n=(this._rBlock>>>t^this._lBlock)&e;this._lBlock^=n,this._rBlock^=n<<t}e.DES=i._createHelper(h);var f=o.TripleDES=i.extend({_doReset:function(){var t=this._key.words;if(2!==t.length&&4!==t.length&&t.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var e=t.slice(0,2),n=t.length<4?t.slice(0,2):t.slice(2,4),i=t.length<6?t.slice(0,2):t.slice(4,6);this._des1=h.createEncryptor(r.create(e)),this._des2=h.createEncryptor(r.create(n)),this._des3=h.createEncryptor(r.create(i))},encryptBlock:function(t,e){this._des1.encryptBlock(t,e),this._des2.decryptBlock(t,e),this._des3.encryptBlock(t,e)},decryptBlock:function(t,e){this._des3.decryptBlock(t,e),this._des2.encryptBlock(t,e),this._des1.decryptBlock(t,e)},keySize:6,ivSize:2,blockSize:2});e.TripleDES=i._createHelper(f)}(),t.TripleDES},t.exports=r(n("02Hb"),n("uFh6"),n("gykg"),n("wj1U"),n("fGru"))},"52gC":function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},"5PlU":function(t,e,n){var r=n("RY/4"),i=n("dSzd")("iterator"),o=n("/bQp");t.exports=n("FeBl").isIterable=function(t){var e=Object(t);return void 0!==e[i]||"@@iterator"in e||o.hasOwnProperty(r(e))}},"5Pol":function(t,e,n){var r;r=function(t){return function(){var e=t,n=e.lib.StreamCipher,r=e.algo,i=r.RC4=n.extend({_doReset:function(){for(var t=this._key,e=t.words,n=t.sigBytes,r=this._S=[],i=0;i<256;i++)r[i]=i;i=0;for(var o=0;i<256;i++){var s=i%n,a=e[s>>>2]>>>24-s%4*8&255;o=(o+r[i]+a)%256;var l=r[i];r[i]=r[o],r[o]=l}this._i=this._j=0},_doProcessBlock:function(t,e){t[e]^=o.call(this)},keySize:8,ivSize:0});function o(){for(var t=this._S,e=this._i,n=this._j,r=0,i=0;i<4;i++){n=(n+t[e=(e+1)%256])%256;var o=t[e];t[e]=t[n],t[n]=o,r|=t[(t[e]+t[n])%256]<<24-8*i}return this._i=e,this._j=n,r}e.RC4=n._createHelper(i);var s=r.RC4Drop=i.extend({cfg:i.cfg.extend({drop:192}),_doReset:function(){i._doReset.call(this);for(var t=this.cfg.drop;t>0;t--)o.call(this)}});e.RC4Drop=n._createHelper(s)}(),t.RC4},t.exports=r(n("02Hb"),n("uFh6"),n("gykg"),n("wj1U"),n("fGru"))},"5QVw":function(t,e,n){t.exports={default:n("BwfY"),__esModule:!0}},"5VQ+":function(t,e,n){"use strict";var r=n("cGG2");t.exports=function(t,e){r.forEach(t,function(n,r){r!==e&&r.toUpperCase()===e.toUpperCase()&&(t[e]=n,delete t[r])})}},"5zde":function(t,e,n){n("zQR9"),n("qyJz"),t.exports=n("FeBl").Array.from},"6Ppv":function(t,e,n){"use strict";var r=n("Kkag"),i=n("l5jf"),o=n("xMQ1"),s=n("35G1");const a=Object(s.a)({leakyRelu_:
  99. /**
  100. * @license
  101. * Copyright 2020 Google LLC. All Rights Reserved.
  102. * Licensed under the Apache License, Version 2.0 (the "License");
  103. * you may not use this file except in compliance with the License.
  104. * You may obtain a copy of the License at
  105. *
  106. * http://www.apache.org/licenses/LICENSE-2.0
  107. *
  108. * Unless required by applicable law or agreed to in writing, software
  109. * distributed under the License is distributed on an "AS IS" BASIS,
  110. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  111. * See the License for the specific language governing permissions and
  112. * limitations under the License.
  113. * =============================================================================
  114. */
  115. function(t,e=.2){const n={x:Object(o.a)(t,"x","leakyRelu")},s={alpha:e};return r.a.runKernel(i._22,n,s)}});e.a=a},"6Twh":function(t,e,n){"use strict";e.__esModule=!0,e.default=function(){if(o.default.prototype.$isServer)return 0;if(void 0!==s)return s;var t=document.createElement("div");t.className="el-scrollbar__wrap",t.style.visibility="hidden",t.style.width="100px",t.style.position="absolute",t.style.top="-9999px",document.body.appendChild(t);var e=t.offsetWidth;t.style.overflow="scroll";var n=document.createElement("div");n.style.width="100%",t.appendChild(n);var r=n.offsetWidth;return t.parentNode.removeChild(t),s=e-r};var r,i=n("7+uW"),o=(r=i)&&r.__esModule?r:{default:r};var s=void 0},"6kjP":function(t,e,n){"use strict";var r=n("Kkag"),i=n("l5jf"),o=n("jb1O"),s=n("xMQ1"),a=n("35G1");const l=Object(a.a)({sub_:
  116. /**
  117. * @license
  118. * Copyright 2020 Google LLC. All Rights Reserved.
  119. * Licensed under the Apache License, Version 2.0 (the "License");
  120. * you may not use this file except in compliance with the License.
  121. * You may obtain a copy of the License at
  122. *
  123. * http://www.apache.org/licenses/LICENSE-2.0
  124. *
  125. * Unless required by applicable law or agreed to in writing, software
  126. * distributed under the License is distributed on an "AS IS" BASIS,
  127. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  128. * See the License for the specific language governing permissions and
  129. * limitations under the License.
  130. * =============================================================================
  131. */
  132. function(t,e){let n=Object(s.a)(t,"a","sub"),a=Object(s.a)(e,"b","sub");[n,a]=Object(o.c)(n,a);const l={a:n,b:a};return r.a.runKernel(i._97,l)}});e.a=l},"6qVS":function(t,e,n){var r;r=function(t){return function(){if("function"==typeof ArrayBuffer){var e=t.lib.WordArray,n=e.init;(e.init=function(t){if(t instanceof ArrayBuffer&&(t=new Uint8Array(t)),(t instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array||t instanceof Float64Array)&&(t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength)),t instanceof Uint8Array){for(var e=t.byteLength,r=[],i=0;i<e;i++)r[i>>>2]|=t[i]<<24-i%4*8;n.call(this,r,e)}else n.apply(this,arguments)}).prototype=e}}(),t.lib.WordArray},t.exports=r(n("02Hb"))},"7+uW":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){
  133. /*!
  134. * Vue.js v2.6.14
  135. * (c) 2014-2021 Evan You
  136. * Released under the MIT License.
  137. */
  138. var n=Object.freeze({});function r(t){return void 0===t||null===t}function i(t){return void 0!==t&&null!==t}function o(t){return!0===t}function s(t){return"string"==typeof t||"number"==typeof t||"symbol"==typeof t||"boolean"==typeof t}function a(t){return null!==t&&"object"==typeof t}var l=Object.prototype.toString;function u(t){return"[object Object]"===l.call(t)}function c(t){return"[object RegExp]"===l.call(t)}function h(t){var e=parseFloat(String(t));return e>=0&&Math.floor(e)===e&&isFinite(t)}function d(t){return i(t)&&"function"==typeof t.then&&"function"==typeof t.catch}function p(t){return null==t?"":Array.isArray(t)||u(t)&&t.toString===l?JSON.stringify(t,null,2):String(t)}function f(t){var e=parseFloat(t);return isNaN(e)?t:e}function g(t,e){for(var n=Object.create(null),r=t.split(","),i=0;i<r.length;i++)n[r[i]]=!0;return e?function(t){return n[t.toLowerCase()]}:function(t){return n[t]}}var m=g("slot,component",!0),v=g("key,ref,slot,slot-scope,is");function b(t,e){if(t.length){var n=t.indexOf(e);if(n>-1)return t.splice(n,1)}}var _=Object.prototype.hasOwnProperty;function y(t,e){return _.call(t,e)}function T(t){var e=Object.create(null);return function(n){return e[n]||(e[n]=t(n))}}var x=/-(\w)/g,E=T(function(t){return t.replace(x,function(t,e){return e?e.toUpperCase():""})}),w=T(function(t){return t.charAt(0).toUpperCase()+t.slice(1)}),C=/\B([A-Z])/g,S=T(function(t){return t.replace(C,"-$1").toLowerCase()});var k=Function.prototype.bind?function(t,e){return t.bind(e)}:function(t,e){function n(n){var r=arguments.length;return r?r>1?t.apply(e,arguments):t.call(e,n):t.call(e)}return n._length=t.length,n};function O(t,e){e=e||0;for(var n=t.length-e,r=new Array(n);n--;)r[n]=t[n+e];return r}function I(t,e){for(var n in e)t[n]=e[n];return t}function R(t){for(var e={},n=0;n<t.length;n++)t[n]&&I(e,t[n]);return e}function A(t,e,n){}var N=function(t,e,n){return!1},D=function(t){return t};function M(t,e){if(t===e)return!0;var n=a(t),r=a(e);if(!n||!r)return!n&&!r&&String(t)===String(e);try{var i=Array.isArray(t),o=Array.isArray(e);if(i&&o)return t.length===e.length&&t.every(function(t,n){return M(t,e[n])});if(t instanceof Date&&e instanceof Date)return t.getTime()===e.getTime();if(i||o)return!1;var s=Object.keys(t),l=Object.keys(e);return s.length===l.length&&s.every(function(n){return M(t[n],e[n])})}catch(t){return!1}}function L(t,e){for(var n=0;n<t.length;n++)if(M(t[n],e))return n;return-1}function P(t){var e=!1;return function(){e||(e=!0,t.apply(this,arguments))}}var F="data-server-rendered",B=["component","directive","filter"],j=["beforeCreate","created","beforeMount","mounted","beforeUpdate","updated","beforeDestroy","destroyed","activated","deactivated","errorCaptured","serverPrefetch"],$={optionMergeStrategies:Object.create(null),silent:!1,productionTip:!1,devtools:!1,performance:!1,errorHandler:null,warnHandler:null,ignoredElements:[],keyCodes:Object.create(null),isReservedTag:N,isReservedAttr:N,isUnknownElement:N,getTagNamespace:A,parsePlatformTagName:D,mustUseProp:N,async:!0,_lifecycleHooks:j},U=/a-zA-Z\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD/;function V(t){var e=(t+"").charCodeAt(0);return 36===e||95===e}function H(t,e,n,r){Object.defineProperty(t,e,{value:n,enumerable:!!r,writable:!0,configurable:!0})}var W=new RegExp("[^"+U.source+".$_\\d]");var G,z="__proto__"in{},X="undefined"!=typeof window,K="undefined"!=typeof WXEnvironment&&!!WXEnvironment.platform,Y=K&&WXEnvironment.platform.toLowerCase(),q=X&&window.navigator.userAgent.toLowerCase(),J=q&&/msie|trident/.test(q),Z=q&&q.indexOf("msie 9.0")>0,Q=q&&q.indexOf("edge/")>0,tt=(q&&q.indexOf("android"),q&&/iphone|ipad|ipod|ios/.test(q)||"ios"===Y),et=(q&&/chrome\/\d+/.test(q),q&&/phantomjs/.test(q),q&&q.match(/firefox\/(\d+)/)),nt={}.watch,rt=!1;if(X)try{var it={};Object.defineProperty(it,"passive",{get:function(){rt=!0}}),window.addEventListener("test-passive",null,it)}catch(t){}var ot=function(){return void 0===G&&(G=!X&&!K&&void 0!==t&&(t.process&&"server"===t.process.env.VUE_ENV)),G},st=X&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function at(t){return"function"==typeof t&&/native code/.test(t.toString())}var lt,ut="undefined"!=typeof Symbol&&at(Symbol)&&"undefined"!=typeof Reflect&&at(Reflect.ownKeys);lt="undefined"!=typeof Set&&at(Set)?Set:function(){function t(){this.set=Object.create(null)}return t.prototype.has=function(t){return!0===this.set[t]},t.prototype.add=function(t){this.set[t]=!0},t.prototype.clear=function(){this.set=Object.create(null)},t}();var ct=A,ht=0,dt=function(){this.id=ht++,this.subs=[]};dt.prototype.addSub=function(t){this.subs.push(t)},dt.prototype.removeSub=function(t){b(this.subs,t)},dt.prototype.depend=function(){dt.target&&dt.target.addDep(this)},dt.prototype.notify=function(){var t=this.subs.slice();for(var e=0,n=t.length;e<n;e++)t[e].update()},dt.target=null;var pt=[];function ft(t){pt.push(t),dt.target=t}function gt(){pt.pop(),dt.target=pt[pt.length-1]}var mt=function(t,e,n,r,i,o,s,a){this.tag=t,this.data=e,this.children=n,this.text=r,this.elm=i,this.ns=void 0,this.context=o,this.fnContext=void 0,this.fnOptions=void 0,this.fnScopeId=void 0,this.key=e&&e.key,this.componentOptions=s,this.componentInstance=void 0,this.parent=void 0,this.raw=!1,this.isStatic=!1,this.isRootInsert=!0,this.isComment=!1,this.isCloned=!1,this.isOnce=!1,this.asyncFactory=a,this.asyncMeta=void 0,this.isAsyncPlaceholder=!1},vt={child:{configurable:!0}};vt.child.get=function(){return this.componentInstance},Object.defineProperties(mt.prototype,vt);var bt=function(t){void 0===t&&(t="");var e=new mt;return e.text=t,e.isComment=!0,e};function _t(t){return new mt(void 0,void 0,void 0,String(t))}function yt(t){var e=new mt(t.tag,t.data,t.children&&t.children.slice(),t.text,t.elm,t.context,t.componentOptions,t.asyncFactory);return e.ns=t.ns,e.isStatic=t.isStatic,e.key=t.key,e.isComment=t.isComment,e.fnContext=t.fnContext,e.fnOptions=t.fnOptions,e.fnScopeId=t.fnScopeId,e.asyncMeta=t.asyncMeta,e.isCloned=!0,e}var Tt=Array.prototype,xt=Object.create(Tt);["push","pop","shift","unshift","splice","sort","reverse"].forEach(function(t){var e=Tt[t];H(xt,t,function(){for(var n=[],r=arguments.length;r--;)n[r]=arguments[r];var i,o=e.apply(this,n),s=this.__ob__;switch(t){case"push":case"unshift":i=n;break;case"splice":i=n.slice(2)}return i&&s.observeArray(i),s.dep.notify(),o})});var Et=Object.getOwnPropertyNames(xt),wt=!0;function Ct(t){wt=t}var St=function(t){var e;this.value=t,this.dep=new dt,this.vmCount=0,H(t,"__ob__",this),Array.isArray(t)?(z?(e=xt,t.__proto__=e):function(t,e,n){for(var r=0,i=n.length;r<i;r++){var o=n[r];H(t,o,e[o])}}(t,xt,Et),this.observeArray(t)):this.walk(t)};function kt(t,e){var n;if(a(t)&&!(t instanceof mt))return y(t,"__ob__")&&t.__ob__ instanceof St?n=t.__ob__:wt&&!ot()&&(Array.isArray(t)||u(t))&&Object.isExtensible(t)&&!t._isVue&&(n=new St(t)),e&&n&&n.vmCount++,n}function Ot(t,e,n,r,i){var o=new dt,s=Object.getOwnPropertyDescriptor(t,e);if(!s||!1!==s.configurable){var a=s&&s.get,l=s&&s.set;a&&!l||2!==arguments.length||(n=t[e]);var u=!i&&kt(n);Object.defineProperty(t,e,{enumerable:!0,configurable:!0,get:function(){var e=a?a.call(t):n;return dt.target&&(o.depend(),u&&(u.dep.depend(),Array.isArray(e)&&function t(e){for(var n=void 0,r=0,i=e.length;r<i;r++)(n=e[r])&&n.__ob__&&n.__ob__.dep.depend(),Array.isArray(n)&&t(n)}(e))),e},set:function(e){var r=a?a.call(t):n;e===r||e!=e&&r!=r||a&&!l||(l?l.call(t,e):n=e,u=!i&&kt(e),o.notify())}})}}function It(t,e,n){if(Array.isArray(t)&&h(e))return t.length=Math.max(t.length,e),t.splice(e,1,n),n;if(e in t&&!(e in Object.prototype))return t[e]=n,n;var r=t.__ob__;return t._isVue||r&&r.vmCount?n:r?(Ot(r.value,e,n),r.dep.notify(),n):(t[e]=n,n)}function Rt(t,e){if(Array.isArray(t)&&h(e))t.splice(e,1);else{var n=t.__ob__;t._isVue||n&&n.vmCount||y(t,e)&&(delete t[e],n&&n.dep.notify())}}St.prototype.walk=function(t){for(var e=Object.keys(t),n=0;n<e.length;n++)Ot(t,e[n])},St.prototype.observeArray=function(t){for(var e=0,n=t.length;e<n;e++)kt(t[e])};var At=$.optionMergeStrategies;function Nt(t,e){if(!e)return t;for(var n,r,i,o=ut?Reflect.ownKeys(e):Object.keys(e),s=0;s<o.length;s++)"__ob__"!==(n=o[s])&&(r=t[n],i=e[n],y(t,n)?r!==i&&u(r)&&u(i)&&Nt(r,i):It(t,n,i));return t}function Dt(t,e,n){return n?function(){var r="function"==typeof e?e.call(n,n):e,i="function"==typeof t?t.call(n,n):t;return r?Nt(r,i):i}:e?t?function(){return Nt("function"==typeof e?e.call(this,this):e,"function"==typeof t?t.call(this,this):t)}:e:t}function Mt(t,e){var n=e?t?t.concat(e):Array.isArray(e)?e:[e]:t;return n?function(t){for(var e=[],n=0;n<t.length;n++)-1===e.indexOf(t[n])&&e.push(t[n]);return e}(n):n}function Lt(t,e,n,r){var i=Object.create(t||null);return e?I(i,e):i}At.data=function(t,e,n){return n?Dt(t,e,n):e&&"function"!=typeof e?t:Dt(t,e)},j.forEach(function(t){At[t]=Mt}),B.forEach(function(t){At[t+"s"]=Lt}),At.watch=function(t,e,n,r){if(t===nt&&(t=void 0),e===nt&&(e=void 0),!e)return Object.create(t||null);if(!t)return e;var i={};for(var o in I(i,t),e){var s=i[o],a=e[o];s&&!Array.isArray(s)&&(s=[s]),i[o]=s?s.concat(a):Array.isArray(a)?a:[a]}return i},At.props=At.methods=At.inject=At.computed=function(t,e,n,r){if(!t)return e;var i=Object.create(null);return I(i,t),e&&I(i,e),i},At.provide=Dt;var Pt=function(t,e){return void 0===e?t:e};function Ft(t,e,n){if("function"==typeof e&&(e=e.options),function(t,e){var n=t.props;if(n){var r,i,o={};if(Array.isArray(n))for(r=n.length;r--;)"string"==typeof(i=n[r])&&(o[E(i)]={type:null});else if(u(n))for(var s in n)i=n[s],o[E(s)]=u(i)?i:{type:i};t.props=o}}(e),function(t,e){var n=t.inject;if(n){var r=t.inject={};if(Array.isArray(n))for(var i=0;i<n.length;i++)r[n[i]]={from:n[i]};else if(u(n))for(var o in n){var s=n[o];r[o]=u(s)?I({from:o},s):{from:s}}}}(e),function(t){var e=t.directives;if(e)for(var n in e){var r=e[n];"function"==typeof r&&(e[n]={bind:r,update:r})}}(e),!e._base&&(e.extends&&(t=Ft(t,e.extends,n)),e.mixins))for(var r=0,i=e.mixins.length;r<i;r++)t=Ft(t,e.mixins[r],n);var o,s={};for(o in t)a(o);for(o in e)y(t,o)||a(o);function a(r){var i=At[r]||Pt;s[r]=i(t[r],e[r],n,r)}return s}function Bt(t,e,n,r){if("string"==typeof n){var i=t[e];if(y(i,n))return i[n];var o=E(n);if(y(i,o))return i[o];var s=w(o);return y(i,s)?i[s]:i[n]||i[o]||i[s]}}function jt(t,e,n,r){var i=e[t],o=!y(n,t),s=n[t],a=Ht(Boolean,i.type);if(a>-1)if(o&&!y(i,"default"))s=!1;else if(""===s||s===S(t)){var l=Ht(String,i.type);(l<0||a<l)&&(s=!0)}if(void 0===s){s=function(t,e,n){if(!y(e,"default"))return;var r=e.default;0;if(t&&t.$options.propsData&&void 0===t.$options.propsData[n]&&void 0!==t._props[n])return t._props[n];return"function"==typeof r&&"Function"!==Ut(e.type)?r.call(t):r}(r,i,t);var u=wt;Ct(!0),kt(s),Ct(u)}return s}var $t=/^\s*function (\w+)/;function Ut(t){var e=t&&t.toString().match($t);return e?e[1]:""}function Vt(t,e){return Ut(t)===Ut(e)}function Ht(t,e){if(!Array.isArray(e))return Vt(e,t)?0:-1;for(var n=0,r=e.length;n<r;n++)if(Vt(e[n],t))return n;return-1}function Wt(t,e,n){ft();try{if(e)for(var r=e;r=r.$parent;){var i=r.$options.errorCaptured;if(i)for(var o=0;o<i.length;o++)try{if(!1===i[o].call(r,t,e,n))return}catch(t){zt(t,r,"errorCaptured hook")}}zt(t,e,n)}finally{gt()}}function Gt(t,e,n,r,i){var o;try{(o=n?t.apply(e,n):t.call(e))&&!o._isVue&&d(o)&&!o._handled&&(o.catch(function(t){return Wt(t,r,i+" (Promise/async)")}),o._handled=!0)}catch(t){Wt(t,r,i)}return o}function zt(t,e,n){if($.errorHandler)try{return $.errorHandler.call(null,t,e,n)}catch(e){e!==t&&Xt(e,null,"config.errorHandler")}Xt(t,e,n)}function Xt(t,e,n){if(!X&&!K||"undefined"==typeof console)throw t;console.error(t)}var Kt,Yt=!1,qt=[],Jt=!1;function Zt(){Jt=!1;var t=qt.slice(0);qt.length=0;for(var e=0;e<t.length;e++)t[e]()}if("undefined"!=typeof Promise&&at(Promise)){var Qt=Promise.resolve();Kt=function(){Qt.then(Zt),tt&&setTimeout(A)},Yt=!0}else if(J||"undefined"==typeof MutationObserver||!at(MutationObserver)&&"[object MutationObserverConstructor]"!==MutationObserver.toString())Kt="undefined"!=typeof setImmediate&&at(setImmediate)?function(){setImmediate(Zt)}:function(){setTimeout(Zt,0)};else{var te=1,ee=new MutationObserver(Zt),ne=document.createTextNode(String(te));ee.observe(ne,{characterData:!0}),Kt=function(){te=(te+1)%2,ne.data=String(te)},Yt=!0}function re(t,e){var n;if(qt.push(function(){if(t)try{t.call(e)}catch(t){Wt(t,e,"nextTick")}else n&&n(e)}),Jt||(Jt=!0,Kt()),!t&&"undefined"!=typeof Promise)return new Promise(function(t){n=t})}var ie=new lt;function oe(t){!function t(e,n){var r,i;var o=Array.isArray(e);if(!o&&!a(e)||Object.isFrozen(e)||e instanceof mt)return;if(e.__ob__){var s=e.__ob__.dep.id;if(n.has(s))return;n.add(s)}if(o)for(r=e.length;r--;)t(e[r],n);else for(i=Object.keys(e),r=i.length;r--;)t(e[i[r]],n)}(t,ie),ie.clear()}var se=T(function(t){var e="&"===t.charAt(0),n="~"===(t=e?t.slice(1):t).charAt(0),r="!"===(t=n?t.slice(1):t).charAt(0);return{name:t=r?t.slice(1):t,once:n,capture:r,passive:e}});function ae(t,e){function n(){var t=arguments,r=n.fns;if(!Array.isArray(r))return Gt(r,null,arguments,e,"v-on handler");for(var i=r.slice(),o=0;o<i.length;o++)Gt(i[o],null,t,e,"v-on handler")}return n.fns=t,n}function le(t,e,n,i,s,a){var l,u,c,h;for(l in t)u=t[l],c=e[l],h=se(l),r(u)||(r(c)?(r(u.fns)&&(u=t[l]=ae(u,a)),o(h.once)&&(u=t[l]=s(h.name,u,h.capture)),n(h.name,u,h.capture,h.passive,h.params)):u!==c&&(c.fns=u,t[l]=c));for(l in e)r(t[l])&&i((h=se(l)).name,e[l],h.capture)}function ue(t,e,n){var s;t instanceof mt&&(t=t.data.hook||(t.data.hook={}));var a=t[e];function l(){n.apply(this,arguments),b(s.fns,l)}r(a)?s=ae([l]):i(a.fns)&&o(a.merged)?(s=a).fns.push(l):s=ae([a,l]),s.merged=!0,t[e]=s}function ce(t,e,n,r,o){if(i(e)){if(y(e,n))return t[n]=e[n],o||delete e[n],!0;if(y(e,r))return t[n]=e[r],o||delete e[r],!0}return!1}function he(t){return s(t)?[_t(t)]:Array.isArray(t)?function t(e,n){var a=[];var l,u,c,h;for(l=0;l<e.length;l++)r(u=e[l])||"boolean"==typeof u||(c=a.length-1,h=a[c],Array.isArray(u)?u.length>0&&(de((u=t(u,(n||"")+"_"+l))[0])&&de(h)&&(a[c]=_t(h.text+u[0].text),u.shift()),a.push.apply(a,u)):s(u)?de(h)?a[c]=_t(h.text+u):""!==u&&a.push(_t(u)):de(u)&&de(h)?a[c]=_t(h.text+u.text):(o(e._isVList)&&i(u.tag)&&r(u.key)&&i(n)&&(u.key="__vlist"+n+"_"+l+"__"),a.push(u)));return a}(t):void 0}function de(t){return i(t)&&i(t.text)&&!1===t.isComment}function pe(t,e){if(t){for(var n=Object.create(null),r=ut?Reflect.ownKeys(t):Object.keys(t),i=0;i<r.length;i++){var o=r[i];if("__ob__"!==o){for(var s=t[o].from,a=e;a;){if(a._provided&&y(a._provided,s)){n[o]=a._provided[s];break}a=a.$parent}if(!a)if("default"in t[o]){var l=t[o].default;n[o]="function"==typeof l?l.call(e):l}else 0}}return n}}function fe(t,e){if(!t||!t.length)return{};for(var n={},r=0,i=t.length;r<i;r++){var o=t[r],s=o.data;if(s&&s.attrs&&s.attrs.slot&&delete s.attrs.slot,o.context!==e&&o.fnContext!==e||!s||null==s.slot)(n.default||(n.default=[])).push(o);else{var a=s.slot,l=n[a]||(n[a]=[]);"template"===o.tag?l.push.apply(l,o.children||[]):l.push(o)}}for(var u in n)n[u].every(ge)&&delete n[u];return n}function ge(t){return t.isComment&&!t.asyncFactory||" "===t.text}function me(t){return t.isComment&&t.asyncFactory}function ve(t,e,r){var i,o=Object.keys(e).length>0,s=t?!!t.$stable:!o,a=t&&t.$key;if(t){if(t._normalized)return t._normalized;if(s&&r&&r!==n&&a===r.$key&&!o&&!r.$hasNormal)return r;for(var l in i={},t)t[l]&&"$"!==l[0]&&(i[l]=be(e,l,t[l]))}else i={};for(var u in e)u in i||(i[u]=_e(e,u));return t&&Object.isExtensible(t)&&(t._normalized=i),H(i,"$stable",s),H(i,"$key",a),H(i,"$hasNormal",o),i}function be(t,e,n){var r=function(){var t=arguments.length?n.apply(null,arguments):n({}),e=(t=t&&"object"==typeof t&&!Array.isArray(t)?[t]:he(t))&&t[0];return t&&(!e||1===t.length&&e.isComment&&!me(e))?void 0:t};return n.proxy&&Object.defineProperty(t,e,{get:r,enumerable:!0,configurable:!0}),r}function _e(t,e){return function(){return t[e]}}function ye(t,e){var n,r,o,s,l;if(Array.isArray(t)||"string"==typeof t)for(n=new Array(t.length),r=0,o=t.length;r<o;r++)n[r]=e(t[r],r);else if("number"==typeof t)for(n=new Array(t),r=0;r<t;r++)n[r]=e(r+1,r);else if(a(t))if(ut&&t[Symbol.iterator]){n=[];for(var u=t[Symbol.iterator](),c=u.next();!c.done;)n.push(e(c.value,n.length)),c=u.next()}else for(s=Object.keys(t),n=new Array(s.length),r=0,o=s.length;r<o;r++)l=s[r],n[r]=e(t[l],l,r);return i(n)||(n=[]),n._isVList=!0,n}function Te(t,e,n,r){var i,o=this.$scopedSlots[t];o?(n=n||{},r&&(n=I(I({},r),n)),i=o(n)||("function"==typeof e?e():e)):i=this.$slots[t]||("function"==typeof e?e():e);var s=n&&n.slot;return s?this.$createElement("template",{slot:s},i):i}function xe(t){return Bt(this.$options,"filters",t)||D}function Ee(t,e){return Array.isArray(t)?-1===t.indexOf(e):t!==e}function we(t,e,n,r,i){var o=$.keyCodes[e]||n;return i&&r&&!$.keyCodes[e]?Ee(i,r):o?Ee(o,t):r?S(r)!==e:void 0===t}function Ce(t,e,n,r,i){if(n)if(a(n)){var o;Array.isArray(n)&&(n=R(n));var s=function(s){if("class"===s||"style"===s||v(s))o=t;else{var a=t.attrs&&t.attrs.type;o=r||$.mustUseProp(e,a,s)?t.domProps||(t.domProps={}):t.attrs||(t.attrs={})}var l=E(s),u=S(s);l in o||u in o||(o[s]=n[s],i&&((t.on||(t.on={}))["update:"+s]=function(t){n[s]=t}))};for(var l in n)s(l)}else;return t}function Se(t,e){var n=this._staticTrees||(this._staticTrees=[]),r=n[t];return r&&!e?r:(Oe(r=n[t]=this.$options.staticRenderFns[t].call(this._renderProxy,null,this),"__static__"+t,!1),r)}function ke(t,e,n){return Oe(t,"__once__"+e+(n?"_"+n:""),!0),t}function Oe(t,e,n){if(Array.isArray(t))for(var r=0;r<t.length;r++)t[r]&&"string"!=typeof t[r]&&Ie(t[r],e+"_"+r,n);else Ie(t,e,n)}function Ie(t,e,n){t.isStatic=!0,t.key=e,t.isOnce=n}function Re(t,e){if(e)if(u(e)){var n=t.on=t.on?I({},t.on):{};for(var r in e){var i=n[r],o=e[r];n[r]=i?[].concat(i,o):o}}else;return t}function Ae(t,e,n,r){e=e||{$stable:!n};for(var i=0;i<t.length;i++){var o=t[i];Array.isArray(o)?Ae(o,e,n):o&&(o.proxy&&(o.fn.proxy=!0),e[o.key]=o.fn)}return r&&(e.$key=r),e}function Ne(t,e){for(var n=0;n<e.length;n+=2){var r=e[n];"string"==typeof r&&r&&(t[e[n]]=e[n+1])}return t}function De(t,e){return"string"==typeof t?e+t:t}function Me(t){t._o=ke,t._n=f,t._s=p,t._l=ye,t._t=Te,t._q=M,t._i=L,t._m=Se,t._f=xe,t._k=we,t._b=Ce,t._v=_t,t._e=bt,t._u=Ae,t._g=Re,t._d=Ne,t._p=De}function Le(t,e,r,i,s){var a,l=this,u=s.options;y(i,"_uid")?(a=Object.create(i))._original=i:(a=i,i=i._original);var c=o(u._compiled),h=!c;this.data=t,this.props=e,this.children=r,this.parent=i,this.listeners=t.on||n,this.injections=pe(u.inject,i),this.slots=function(){return l.$slots||ve(t.scopedSlots,l.$slots=fe(r,i)),l.$slots},Object.defineProperty(this,"scopedSlots",{enumerable:!0,get:function(){return ve(t.scopedSlots,this.slots())}}),c&&(this.$options=u,this.$slots=this.slots(),this.$scopedSlots=ve(t.scopedSlots,this.$slots)),u._scopeId?this._c=function(t,e,n,r){var o=We(a,t,e,n,r,h);return o&&!Array.isArray(o)&&(o.fnScopeId=u._scopeId,o.fnContext=i),o}:this._c=function(t,e,n,r){return We(a,t,e,n,r,h)}}function Pe(t,e,n,r,i){var o=yt(t);return o.fnContext=n,o.fnOptions=r,e.slot&&((o.data||(o.data={})).slot=e.slot),o}function Fe(t,e){for(var n in e)t[E(n)]=e[n]}Me(Le.prototype);var Be={init:function(t,e){if(t.componentInstance&&!t.componentInstance._isDestroyed&&t.data.keepAlive){var n=t;Be.prepatch(n,n)}else{(t.componentInstance=function(t,e){var n={_isComponent:!0,_parentVnode:t,parent:e},r=t.data.inlineTemplate;i(r)&&(n.render=r.render,n.staticRenderFns=r.staticRenderFns);return new t.componentOptions.Ctor(n)}(t,Qe)).$mount(e?t.elm:void 0,e)}},prepatch:function(t,e){var r=e.componentOptions;!function(t,e,r,i,o){0;var s=i.data.scopedSlots,a=t.$scopedSlots,l=!!(s&&!s.$stable||a!==n&&!a.$stable||s&&t.$scopedSlots.$key!==s.$key||!s&&t.$scopedSlots.$key),u=!!(o||t.$options._renderChildren||l);t.$options._parentVnode=i,t.$vnode=i,t._vnode&&(t._vnode.parent=i);if(t.$options._renderChildren=o,t.$attrs=i.data.attrs||n,t.$listeners=r||n,e&&t.$options.props){Ct(!1);for(var c=t._props,h=t.$options._propKeys||[],d=0;d<h.length;d++){var p=h[d],f=t.$options.props;c[p]=jt(p,f,e,t)}Ct(!0),t.$options.propsData=e}r=r||n;var g=t.$options._parentListeners;t.$options._parentListeners=r,Ze(t,r,g),u&&(t.$slots=fe(o,i.context),t.$forceUpdate());0}(e.componentInstance=t.componentInstance,r.propsData,r.listeners,e,r.children)},insert:function(t){var e,n=t.context,r=t.componentInstance;r._isMounted||(r._isMounted=!0,rn(r,"mounted")),t.data.keepAlive&&(n._isMounted?((e=r)._inactive=!1,sn.push(e)):nn(r,!0))},destroy:function(t){var e=t.componentInstance;e._isDestroyed||(t.data.keepAlive?function t(e,n){if(n&&(e._directInactive=!0,en(e)))return;if(!e._inactive){e._inactive=!0;for(var r=0;r<e.$children.length;r++)t(e.$children[r]);rn(e,"deactivated")}}(e,!0):e.$destroy())}},je=Object.keys(Be);function $e(t,e,s,l,u){if(!r(t)){var c=s.$options._base;if(a(t)&&(t=c.extend(t)),"function"==typeof t){var h;if(r(t.cid)&&void 0===(t=function(t,e){if(o(t.error)&&i(t.errorComp))return t.errorComp;if(i(t.resolved))return t.resolved;var n=ze;n&&i(t.owners)&&-1===t.owners.indexOf(n)&&t.owners.push(n);if(o(t.loading)&&i(t.loadingComp))return t.loadingComp;if(n&&!i(t.owners)){var s=t.owners=[n],l=!0,u=null,c=null;n.$on("hook:destroyed",function(){return b(s,n)});var h=function(t){for(var e=0,n=s.length;e<n;e++)s[e].$forceUpdate();t&&(s.length=0,null!==u&&(clearTimeout(u),u=null),null!==c&&(clearTimeout(c),c=null))},p=P(function(n){t.resolved=Xe(n,e),l?s.length=0:h(!0)}),f=P(function(e){i(t.errorComp)&&(t.error=!0,h(!0))}),g=t(p,f);return a(g)&&(d(g)?r(t.resolved)&&g.then(p,f):d(g.component)&&(g.component.then(p,f),i(g.error)&&(t.errorComp=Xe(g.error,e)),i(g.loading)&&(t.loadingComp=Xe(g.loading,e),0===g.delay?t.loading=!0:u=setTimeout(function(){u=null,r(t.resolved)&&r(t.error)&&(t.loading=!0,h(!1))},g.delay||200)),i(g.timeout)&&(c=setTimeout(function(){c=null,r(t.resolved)&&f(null)},g.timeout)))),l=!1,t.loading?t.loadingComp:t.resolved}}(h=t,c)))return function(t,e,n,r,i){var o=bt();return o.asyncFactory=t,o.asyncMeta={data:e,context:n,children:r,tag:i},o}(h,e,s,l,u);e=e||{},Sn(t),i(e.model)&&function(t,e){var n=t.model&&t.model.prop||"value",r=t.model&&t.model.event||"input";(e.attrs||(e.attrs={}))[n]=e.model.value;var o=e.on||(e.on={}),s=o[r],a=e.model.callback;i(s)?(Array.isArray(s)?-1===s.indexOf(a):s!==a)&&(o[r]=[a].concat(s)):o[r]=a}(t.options,e);var p=function(t,e,n){var o=e.options.props;if(!r(o)){var s={},a=t.attrs,l=t.props;if(i(a)||i(l))for(var u in o){var c=S(u);ce(s,l,u,c,!0)||ce(s,a,u,c,!1)}return s}}(e,t);if(o(t.options.functional))return function(t,e,r,o,s){var a=t.options,l={},u=a.props;if(i(u))for(var c in u)l[c]=jt(c,u,e||n);else i(r.attrs)&&Fe(l,r.attrs),i(r.props)&&Fe(l,r.props);var h=new Le(r,l,s,o,t),d=a.render.call(null,h._c,h);if(d instanceof mt)return Pe(d,r,h.parent,a);if(Array.isArray(d)){for(var p=he(d)||[],f=new Array(p.length),g=0;g<p.length;g++)f[g]=Pe(p[g],r,h.parent,a);return f}}(t,p,e,s,l);var f=e.on;if(e.on=e.nativeOn,o(t.options.abstract)){var g=e.slot;e={},g&&(e.slot=g)}!function(t){for(var e=t.hook||(t.hook={}),n=0;n<je.length;n++){var r=je[n],i=e[r],o=Be[r];i===o||i&&i._merged||(e[r]=i?Ue(o,i):o)}}(e);var m=t.options.name||u;return new mt("vue-component-"+t.cid+(m?"-"+m:""),e,void 0,void 0,void 0,s,{Ctor:t,propsData:p,listeners:f,tag:u,children:l},h)}}}function Ue(t,e){var n=function(n,r){t(n,r),e(n,r)};return n._merged=!0,n}var Ve=1,He=2;function We(t,e,n,l,u,c){return(Array.isArray(n)||s(n))&&(u=l,l=n,n=void 0),o(c)&&(u=He),function(t,e,n,s,l){if(i(n)&&i(n.__ob__))return bt();i(n)&&i(n.is)&&(e=n.is);if(!e)return bt();0;Array.isArray(s)&&"function"==typeof s[0]&&((n=n||{}).scopedSlots={default:s[0]},s.length=0);l===He?s=he(s):l===Ve&&(s=function(t){for(var e=0;e<t.length;e++)if(Array.isArray(t[e]))return Array.prototype.concat.apply([],t);return t}(s));var u,c;if("string"==typeof e){var h;c=t.$vnode&&t.$vnode.ns||$.getTagNamespace(e),u=$.isReservedTag(e)?new mt($.parsePlatformTagName(e),n,s,void 0,void 0,t):n&&n.pre||!i(h=Bt(t.$options,"components",e))?new mt(e,n,s,void 0,void 0,t):$e(h,n,t,s,e)}else u=$e(e,n,t,s);return Array.isArray(u)?u:i(u)?(i(c)&&function t(e,n,s){e.ns=n;"foreignObject"===e.tag&&(n=void 0,s=!0);if(i(e.children))for(var a=0,l=e.children.length;a<l;a++){var u=e.children[a];i(u.tag)&&(r(u.ns)||o(s)&&"svg"!==u.tag)&&t(u,n,s)}}(u,c),i(n)&&function(t){a(t.style)&&oe(t.style);a(t.class)&&oe(t.class)}(n),u):bt()}(t,e,n,l,u)}var Ge,ze=null;function Xe(t,e){return(t.__esModule||ut&&"Module"===t[Symbol.toStringTag])&&(t=t.default),a(t)?e.extend(t):t}function Ke(t){if(Array.isArray(t))for(var e=0;e<t.length;e++){var n=t[e];if(i(n)&&(i(n.componentOptions)||me(n)))return n}}function Ye(t,e){Ge.$on(t,e)}function qe(t,e){Ge.$off(t,e)}function Je(t,e){var n=Ge;return function r(){null!==e.apply(null,arguments)&&n.$off(t,r)}}function Ze(t,e,n){Ge=t,le(e,n||{},Ye,qe,Je,t),Ge=void 0}var Qe=null;function tn(t){var e=Qe;return Qe=t,function(){Qe=e}}function en(t){for(;t&&(t=t.$parent);)if(t._inactive)return!0;return!1}function nn(t,e){if(e){if(t._directInactive=!1,en(t))return}else if(t._directInactive)return;if(t._inactive||null===t._inactive){t._inactive=!1;for(var n=0;n<t.$children.length;n++)nn(t.$children[n]);rn(t,"activated")}}function rn(t,e){ft();var n=t.$options[e],r=e+" hook";if(n)for(var i=0,o=n.length;i<o;i++)Gt(n[i],t,null,t,r);t._hasHookEvent&&t.$emit("hook:"+e),gt()}var on=[],sn=[],an={},ln=!1,un=!1,cn=0;var hn=0,dn=Date.now;if(X&&!J){var pn=window.performance;pn&&"function"==typeof pn.now&&dn()>document.createEvent("Event").timeStamp&&(dn=function(){return pn.now()})}function fn(){var t,e;for(hn=dn(),un=!0,on.sort(function(t,e){return t.id-e.id}),cn=0;cn<on.length;cn++)(t=on[cn]).before&&t.before(),e=t.id,an[e]=null,t.run();var n=sn.slice(),r=on.slice();cn=on.length=sn.length=0,an={},ln=un=!1,function(t){for(var e=0;e<t.length;e++)t[e]._inactive=!0,nn(t[e],!0)}(n),function(t){var e=t.length;for(;e--;){var n=t[e],r=n.vm;r._watcher===n&&r._isMounted&&!r._isDestroyed&&rn(r,"updated")}}(r),st&&$.devtools&&st.emit("flush")}var gn=0,mn=function(t,e,n,r,i){this.vm=t,i&&(t._watcher=this),t._watchers.push(this),r?(this.deep=!!r.deep,this.user=!!r.user,this.lazy=!!r.lazy,this.sync=!!r.sync,this.before=r.before):this.deep=this.user=this.lazy=this.sync=!1,this.cb=n,this.id=++gn,this.active=!0,this.dirty=this.lazy,this.deps=[],this.newDeps=[],this.depIds=new lt,this.newDepIds=new lt,this.expression="","function"==typeof e?this.getter=e:(this.getter=function(t){if(!W.test(t)){var e=t.split(".");return function(t){for(var n=0;n<e.length;n++){if(!t)return;t=t[e[n]]}return t}}}(e),this.getter||(this.getter=A)),this.value=this.lazy?void 0:this.get()};mn.prototype.get=function(){var t;ft(this);var e=this.vm;try{t=this.getter.call(e,e)}catch(t){if(!this.user)throw t;Wt(t,e,'getter for watcher "'+this.expression+'"')}finally{this.deep&&oe(t),gt(),this.cleanupDeps()}return t},mn.prototype.addDep=function(t){var e=t.id;this.newDepIds.has(e)||(this.newDepIds.add(e),this.newDeps.push(t),this.depIds.has(e)||t.addSub(this))},mn.prototype.cleanupDeps=function(){for(var t=this.deps.length;t--;){var e=this.deps[t];this.newDepIds.has(e.id)||e.removeSub(this)}var n=this.depIds;this.depIds=this.newDepIds,this.newDepIds=n,this.newDepIds.clear(),n=this.deps,this.deps=this.newDeps,this.newDeps=n,this.newDeps.length=0},mn.prototype.update=function(){this.lazy?this.dirty=!0:this.sync?this.run():function(t){var e=t.id;if(null==an[e]){if(an[e]=!0,un){for(var n=on.length-1;n>cn&&on[n].id>t.id;)n--;on.splice(n+1,0,t)}else on.push(t);ln||(ln=!0,re(fn))}}(this)},mn.prototype.run=function(){if(this.active){var t=this.get();if(t!==this.value||a(t)||this.deep){var e=this.value;if(this.value=t,this.user){var n='callback for watcher "'+this.expression+'"';Gt(this.cb,this.vm,[t,e],this.vm,n)}else this.cb.call(this.vm,t,e)}}},mn.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},mn.prototype.depend=function(){for(var t=this.deps.length;t--;)this.deps[t].depend()},mn.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||b(this.vm._watchers,this);for(var t=this.deps.length;t--;)this.deps[t].removeSub(this);this.active=!1}};var vn={enumerable:!0,configurable:!0,get:A,set:A};function bn(t,e,n){vn.get=function(){return this[e][n]},vn.set=function(t){this[e][n]=t},Object.defineProperty(t,n,vn)}function _n(t){t._watchers=[];var e=t.$options;e.props&&function(t,e){var n=t.$options.propsData||{},r=t._props={},i=t.$options._propKeys=[],o=!t.$parent;o||Ct(!1);var s=function(o){i.push(o);var s=jt(o,e,n,t);Ot(r,o,s),o in t||bn(t,"_props",o)};for(var a in e)s(a);Ct(!0)}(t,e.props),e.methods&&function(t,e){t.$options.props;for(var n in e)t[n]="function"!=typeof e[n]?A:k(e[n],t)}(t,e.methods),e.data?function(t){var e=t.$options.data;u(e=t._data="function"==typeof e?function(t,e){ft();try{return t.call(e,e)}catch(t){return Wt(t,e,"data()"),{}}finally{gt()}}(e,t):e||{})||(e={});var n=Object.keys(e),r=t.$options.props,i=(t.$options.methods,n.length);for(;i--;){var o=n[i];0,r&&y(r,o)||V(o)||bn(t,"_data",o)}kt(e,!0)}(t):kt(t._data={},!0),e.computed&&function(t,e){var n=t._computedWatchers=Object.create(null),r=ot();for(var i in e){var o=e[i],s="function"==typeof o?o:o.get;0,r||(n[i]=new mn(t,s||A,A,yn)),i in t||Tn(t,i,o)}}(t,e.computed),e.watch&&e.watch!==nt&&function(t,e){for(var n in e){var r=e[n];if(Array.isArray(r))for(var i=0;i<r.length;i++)wn(t,n,r[i]);else wn(t,n,r)}}(t,e.watch)}var yn={lazy:!0};function Tn(t,e,n){var r=!ot();"function"==typeof n?(vn.get=r?xn(e):En(n),vn.set=A):(vn.get=n.get?r&&!1!==n.cache?xn(e):En(n.get):A,vn.set=n.set||A),Object.defineProperty(t,e,vn)}function xn(t){return function(){var e=this._computedWatchers&&this._computedWatchers[t];if(e)return e.dirty&&e.evaluate(),dt.target&&e.depend(),e.value}}function En(t){return function(){return t.call(this,this)}}function wn(t,e,n,r){return u(n)&&(r=n,n=n.handler),"string"==typeof n&&(n=t[n]),t.$watch(e,n,r)}var Cn=0;function Sn(t){var e=t.options;if(t.super){var n=Sn(t.super);if(n!==t.superOptions){t.superOptions=n;var r=function(t){var e,n=t.options,r=t.sealedOptions;for(var i in n)n[i]!==r[i]&&(e||(e={}),e[i]=n[i]);return e}(t);r&&I(t.extendOptions,r),(e=t.options=Ft(n,t.extendOptions)).name&&(e.components[e.name]=t)}}return e}function kn(t){this._init(t)}function On(t){t.cid=0;var e=1;t.extend=function(t){t=t||{};var n=this,r=n.cid,i=t._Ctor||(t._Ctor={});if(i[r])return i[r];var o=t.name||n.options.name;var s=function(t){this._init(t)};return(s.prototype=Object.create(n.prototype)).constructor=s,s.cid=e++,s.options=Ft(n.options,t),s.super=n,s.options.props&&function(t){var e=t.options.props;for(var n in e)bn(t.prototype,"_props",n)}(s),s.options.computed&&function(t){var e=t.options.computed;for(var n in e)Tn(t.prototype,n,e[n])}(s),s.extend=n.extend,s.mixin=n.mixin,s.use=n.use,B.forEach(function(t){s[t]=n[t]}),o&&(s.options.components[o]=s),s.superOptions=n.options,s.extendOptions=t,s.sealedOptions=I({},s.options),i[r]=s,s}}function In(t){return t&&(t.Ctor.options.name||t.tag)}function Rn(t,e){return Array.isArray(t)?t.indexOf(e)>-1:"string"==typeof t?t.split(",").indexOf(e)>-1:!!c(t)&&t.test(e)}function An(t,e){var n=t.cache,r=t.keys,i=t._vnode;for(var o in n){var s=n[o];if(s){var a=s.name;a&&!e(a)&&Nn(n,o,r,i)}}}function Nn(t,e,n,r){var i=t[e];!i||r&&i.tag===r.tag||i.componentInstance.$destroy(),t[e]=null,b(n,e)}!function(t){t.prototype._init=function(t){var e=this;e._uid=Cn++,e._isVue=!0,t&&t._isComponent?function(t,e){var n=t.$options=Object.create(t.constructor.options),r=e._parentVnode;n.parent=e.parent,n._parentVnode=r;var i=r.componentOptions;n.propsData=i.propsData,n._parentListeners=i.listeners,n._renderChildren=i.children,n._componentTag=i.tag,e.render&&(n.render=e.render,n.staticRenderFns=e.staticRenderFns)}(e,t):e.$options=Ft(Sn(e.constructor),t||{},e),e._renderProxy=e,e._self=e,function(t){var e=t.$options,n=e.parent;if(n&&!e.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(t)}t.$parent=n,t.$root=n?n.$root:t,t.$children=[],t.$refs={},t._watcher=null,t._inactive=null,t._directInactive=!1,t._isMounted=!1,t._isDestroyed=!1,t._isBeingDestroyed=!1}(e),function(t){t._events=Object.create(null),t._hasHookEvent=!1;var e=t.$options._parentListeners;e&&Ze(t,e)}(e),function(t){t._vnode=null,t._staticTrees=null;var e=t.$options,r=t.$vnode=e._parentVnode,i=r&&r.context;t.$slots=fe(e._renderChildren,i),t.$scopedSlots=n,t._c=function(e,n,r,i){return We(t,e,n,r,i,!1)},t.$createElement=function(e,n,r,i){return We(t,e,n,r,i,!0)};var o=r&&r.data;Ot(t,"$attrs",o&&o.attrs||n,null,!0),Ot(t,"$listeners",e._parentListeners||n,null,!0)}(e),rn(e,"beforeCreate"),function(t){var e=pe(t.$options.inject,t);e&&(Ct(!1),Object.keys(e).forEach(function(n){Ot(t,n,e[n])}),Ct(!0))}(e),_n(e),function(t){var e=t.$options.provide;e&&(t._provided="function"==typeof e?e.call(t):e)}(e),rn(e,"created"),e.$options.el&&e.$mount(e.$options.el)}}(kn),function(t){var e={get:function(){return this._data}},n={get:function(){return this._props}};Object.defineProperty(t.prototype,"$data",e),Object.defineProperty(t.prototype,"$props",n),t.prototype.$set=It,t.prototype.$delete=Rt,t.prototype.$watch=function(t,e,n){if(u(e))return wn(this,t,e,n);(n=n||{}).user=!0;var r=new mn(this,t,e,n);if(n.immediate){var i='callback for immediate watcher "'+r.expression+'"';ft(),Gt(e,this,[r.value],this,i),gt()}return function(){r.teardown()}}}(kn),function(t){var e=/^hook:/;t.prototype.$on=function(t,n){var r=this;if(Array.isArray(t))for(var i=0,o=t.length;i<o;i++)r.$on(t[i],n);else(r._events[t]||(r._events[t]=[])).push(n),e.test(t)&&(r._hasHookEvent=!0);return r},t.prototype.$once=function(t,e){var n=this;function r(){n.$off(t,r),e.apply(n,arguments)}return r.fn=e,n.$on(t,r),n},t.prototype.$off=function(t,e){var n=this;if(!arguments.length)return n._events=Object.create(null),n;if(Array.isArray(t)){for(var r=0,i=t.length;r<i;r++)n.$off(t[r],e);return n}var o,s=n._events[t];if(!s)return n;if(!e)return n._events[t]=null,n;for(var a=s.length;a--;)if((o=s[a])===e||o.fn===e){s.splice(a,1);break}return n},t.prototype.$emit=function(t){var e=this,n=e._events[t];if(n){n=n.length>1?O(n):n;for(var r=O(arguments,1),i='event handler for "'+t+'"',o=0,s=n.length;o<s;o++)Gt(n[o],e,r,e,i)}return e}}(kn),function(t){t.prototype._update=function(t,e){var n=this,r=n.$el,i=n._vnode,o=tn(n);n._vnode=t,n.$el=i?n.__patch__(i,t):n.__patch__(n.$el,t,e,!1),o(),r&&(r.__vue__=null),n.$el&&(n.$el.__vue__=n),n.$vnode&&n.$parent&&n.$vnode===n.$parent._vnode&&(n.$parent.$el=n.$el)},t.prototype.$forceUpdate=function(){this._watcher&&this._watcher.update()},t.prototype.$destroy=function(){var t=this;if(!t._isBeingDestroyed){rn(t,"beforeDestroy"),t._isBeingDestroyed=!0;var e=t.$parent;!e||e._isBeingDestroyed||t.$options.abstract||b(e.$children,t),t._watcher&&t._watcher.teardown();for(var n=t._watchers.length;n--;)t._watchers[n].teardown();t._data.__ob__&&t._data.__ob__.vmCount--,t._isDestroyed=!0,t.__patch__(t._vnode,null),rn(t,"destroyed"),t.$off(),t.$el&&(t.$el.__vue__=null),t.$vnode&&(t.$vnode.parent=null)}}}(kn),function(t){Me(t.prototype),t.prototype.$nextTick=function(t){return re(t,this)},t.prototype._render=function(){var t,e=this,n=e.$options,r=n.render,i=n._parentVnode;i&&(e.$scopedSlots=ve(i.data.scopedSlots,e.$slots,e.$scopedSlots)),e.$vnode=i;try{ze=e,t=r.call(e._renderProxy,e.$createElement)}catch(n){Wt(n,e,"render"),t=e._vnode}finally{ze=null}return Array.isArray(t)&&1===t.length&&(t=t[0]),t instanceof mt||(t=bt()),t.parent=i,t}}(kn);var Dn=[String,RegExp,Array],Mn={KeepAlive:{name:"keep-alive",abstract:!0,props:{include:Dn,exclude:Dn,max:[String,Number]},methods:{cacheVNode:function(){var t=this.cache,e=this.keys,n=this.vnodeToCache,r=this.keyToCache;if(n){var i=n.tag,o=n.componentInstance,s=n.componentOptions;t[r]={name:In(s),tag:i,componentInstance:o},e.push(r),this.max&&e.length>parseInt(this.max)&&Nn(t,e[0],e,this._vnode),this.vnodeToCache=null}}},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var t in this.cache)Nn(this.cache,t,this.keys)},mounted:function(){var t=this;this.cacheVNode(),this.$watch("include",function(e){An(t,function(t){return Rn(e,t)})}),this.$watch("exclude",function(e){An(t,function(t){return!Rn(e,t)})})},updated:function(){this.cacheVNode()},render:function(){var t=this.$slots.default,e=Ke(t),n=e&&e.componentOptions;if(n){var r=In(n),i=this.include,o=this.exclude;if(i&&(!r||!Rn(i,r))||o&&r&&Rn(o,r))return e;var s=this.cache,a=this.keys,l=null==e.key?n.Ctor.cid+(n.tag?"::"+n.tag:""):e.key;s[l]?(e.componentInstance=s[l].componentInstance,b(a,l),a.push(l)):(this.vnodeToCache=e,this.keyToCache=l),e.data.keepAlive=!0}return e||t&&t[0]}}};!function(t){var e={get:function(){return $}};Object.defineProperty(t,"config",e),t.util={warn:ct,extend:I,mergeOptions:Ft,defineReactive:Ot},t.set=It,t.delete=Rt,t.nextTick=re,t.observable=function(t){return kt(t),t},t.options=Object.create(null),B.forEach(function(e){t.options[e+"s"]=Object.create(null)}),t.options._base=t,I(t.options.components,Mn),function(t){t.use=function(t){var e=this._installedPlugins||(this._installedPlugins=[]);if(e.indexOf(t)>-1)return this;var n=O(arguments,1);return n.unshift(this),"function"==typeof t.install?t.install.apply(t,n):"function"==typeof t&&t.apply(null,n),e.push(t),this}}(t),function(t){t.mixin=function(t){return this.options=Ft(this.options,t),this}}(t),On(t),function(t){B.forEach(function(e){t[e]=function(t,n){return n?("component"===e&&u(n)&&(n.name=n.name||t,n=this.options._base.extend(n)),"directive"===e&&"function"==typeof n&&(n={bind:n,update:n}),this.options[e+"s"][t]=n,n):this.options[e+"s"][t]}})}(t)}(kn),Object.defineProperty(kn.prototype,"$isServer",{get:ot}),Object.defineProperty(kn.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(kn,"FunctionalRenderContext",{value:Le}),kn.version="2.6.14";var Ln=g("style,class"),Pn=g("input,textarea,option,select,progress"),Fn=function(t,e,n){return"value"===n&&Pn(t)&&"button"!==e||"selected"===n&&"option"===t||"checked"===n&&"input"===t||"muted"===n&&"video"===t},Bn=g("contenteditable,draggable,spellcheck"),jn=g("events,caret,typing,plaintext-only"),$n=function(t,e){return Gn(e)||"false"===e?"false":"contenteditable"===t&&jn(e)?e:"true"},Un=g("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,truespeed,typemustmatch,visible"),Vn="http://www.w3.org/1999/xlink",Hn=function(t){return":"===t.charAt(5)&&"xlink"===t.slice(0,5)},Wn=function(t){return Hn(t)?t.slice(6,t.length):""},Gn=function(t){return null==t||!1===t};function zn(t){for(var e=t.data,n=t,r=t;i(r.componentInstance);)(r=r.componentInstance._vnode)&&r.data&&(e=Xn(r.data,e));for(;i(n=n.parent);)n&&n.data&&(e=Xn(e,n.data));return function(t,e){if(i(t)||i(e))return Kn(t,Yn(e));return""}(e.staticClass,e.class)}function Xn(t,e){return{staticClass:Kn(t.staticClass,e.staticClass),class:i(t.class)?[t.class,e.class]:e.class}}function Kn(t,e){return t?e?t+" "+e:t:e||""}function Yn(t){return Array.isArray(t)?function(t){for(var e,n="",r=0,o=t.length;r<o;r++)i(e=Yn(t[r]))&&""!==e&&(n&&(n+=" "),n+=e);return n}(t):a(t)?function(t){var e="";for(var n in t)t[n]&&(e&&(e+=" "),e+=n);return e}(t):"string"==typeof t?t:""}var qn={svg:"http://www.w3.org/2000/svg",math:"http://www.w3.org/1998/Math/MathML"},Jn=g("html,body,base,head,link,meta,style,title,address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,menuitem,summary,content,element,shadow,template,blockquote,iframe,tfoot"),Zn=g("svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,foreignobject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view",!0),Qn=function(t){return Jn(t)||Zn(t)};function tr(t){return Zn(t)?"svg":"math"===t?"math":void 0}var er=Object.create(null);var nr=g("text,number,password,search,email,tel,url");function rr(t){if("string"==typeof t){var e=document.querySelector(t);return e||document.createElement("div")}return t}var ir=Object.freeze({createElement:function(t,e){var n=document.createElement(t);return"select"!==t?n:(e.data&&e.data.attrs&&void 0!==e.data.attrs.multiple&&n.setAttribute("multiple","multiple"),n)},createElementNS:function(t,e){return document.createElementNS(qn[t],e)},createTextNode:function(t){return document.createTextNode(t)},createComment:function(t){return document.createComment(t)},insertBefore:function(t,e,n){t.insertBefore(e,n)},removeChild:function(t,e){t.removeChild(e)},appendChild:function(t,e){t.appendChild(e)},parentNode:function(t){return t.parentNode},nextSibling:function(t){return t.nextSibling},tagName:function(t){return t.tagName},setTextContent:function(t,e){t.textContent=e},setStyleScope:function(t,e){t.setAttribute(e,"")}}),or={create:function(t,e){sr(e)},update:function(t,e){t.data.ref!==e.data.ref&&(sr(t,!0),sr(e))},destroy:function(t){sr(t,!0)}};function sr(t,e){var n=t.data.ref;if(i(n)){var r=t.context,o=t.componentInstance||t.elm,s=r.$refs;e?Array.isArray(s[n])?b(s[n],o):s[n]===o&&(s[n]=void 0):t.data.refInFor?Array.isArray(s[n])?s[n].indexOf(o)<0&&s[n].push(o):s[n]=[o]:s[n]=o}}var ar=new mt("",{},[]),lr=["create","activate","update","remove","destroy"];function ur(t,e){return t.key===e.key&&t.asyncFactory===e.asyncFactory&&(t.tag===e.tag&&t.isComment===e.isComment&&i(t.data)===i(e.data)&&function(t,e){if("input"!==t.tag)return!0;var n,r=i(n=t.data)&&i(n=n.attrs)&&n.type,o=i(n=e.data)&&i(n=n.attrs)&&n.type;return r===o||nr(r)&&nr(o)}(t,e)||o(t.isAsyncPlaceholder)&&r(e.asyncFactory.error))}function cr(t,e,n){var r,o,s={};for(r=e;r<=n;++r)i(o=t[r].key)&&(s[o]=r);return s}var hr={create:dr,update:dr,destroy:function(t){dr(t,ar)}};function dr(t,e){(t.data.directives||e.data.directives)&&function(t,e){var n,r,i,o=t===ar,s=e===ar,a=fr(t.data.directives,t.context),l=fr(e.data.directives,e.context),u=[],c=[];for(n in l)r=a[n],i=l[n],r?(i.oldValue=r.value,i.oldArg=r.arg,mr(i,"update",e,t),i.def&&i.def.componentUpdated&&c.push(i)):(mr(i,"bind",e,t),i.def&&i.def.inserted&&u.push(i));if(u.length){var h=function(){for(var n=0;n<u.length;n++)mr(u[n],"inserted",e,t)};o?ue(e,"insert",h):h()}c.length&&ue(e,"postpatch",function(){for(var n=0;n<c.length;n++)mr(c[n],"componentUpdated",e,t)});if(!o)for(n in a)l[n]||mr(a[n],"unbind",t,t,s)}(t,e)}var pr=Object.create(null);function fr(t,e){var n,r,i=Object.create(null);if(!t)return i;for(n=0;n<t.length;n++)(r=t[n]).modifiers||(r.modifiers=pr),i[gr(r)]=r,r.def=Bt(e.$options,"directives",r.name);return i}function gr(t){return t.rawName||t.name+"."+Object.keys(t.modifiers||{}).join(".")}function mr(t,e,n,r,i){var o=t.def&&t.def[e];if(o)try{o(n.elm,t,n,r,i)}catch(r){Wt(r,n.context,"directive "+t.name+" "+e+" hook")}}var vr=[or,hr];function br(t,e){var n=e.componentOptions;if(!(i(n)&&!1===n.Ctor.options.inheritAttrs||r(t.data.attrs)&&r(e.data.attrs))){var o,s,a=e.elm,l=t.data.attrs||{},u=e.data.attrs||{};for(o in i(u.__ob__)&&(u=e.data.attrs=I({},u)),u)s=u[o],l[o]!==s&&_r(a,o,s,e.data.pre);for(o in(J||Q)&&u.value!==l.value&&_r(a,"value",u.value),l)r(u[o])&&(Hn(o)?a.removeAttributeNS(Vn,Wn(o)):Bn(o)||a.removeAttribute(o))}}function _r(t,e,n,r){r||t.tagName.indexOf("-")>-1?yr(t,e,n):Un(e)?Gn(n)?t.removeAttribute(e):(n="allowfullscreen"===e&&"EMBED"===t.tagName?"true":e,t.setAttribute(e,n)):Bn(e)?t.setAttribute(e,$n(e,n)):Hn(e)?Gn(n)?t.removeAttributeNS(Vn,Wn(e)):t.setAttributeNS(Vn,e,n):yr(t,e,n)}function yr(t,e,n){if(Gn(n))t.removeAttribute(e);else{if(J&&!Z&&"TEXTAREA"===t.tagName&&"placeholder"===e&&""!==n&&!t.__ieph){var r=function(e){e.stopImmediatePropagation(),t.removeEventListener("input",r)};t.addEventListener("input",r),t.__ieph=!0}t.setAttribute(e,n)}}var Tr={create:br,update:br};function xr(t,e){var n=e.elm,o=e.data,s=t.data;if(!(r(o.staticClass)&&r(o.class)&&(r(s)||r(s.staticClass)&&r(s.class)))){var a=zn(e),l=n._transitionClasses;i(l)&&(a=Kn(a,Yn(l))),a!==n._prevClass&&(n.setAttribute("class",a),n._prevClass=a)}}var Er,wr,Cr,Sr,kr,Or,Ir={create:xr,update:xr},Rr=/[\w).+\-_$\]]/;function Ar(t){var e,n,r,i,o,s=!1,a=!1,l=!1,u=!1,c=0,h=0,d=0,p=0;for(r=0;r<t.length;r++)if(n=e,e=t.charCodeAt(r),s)39===e&&92!==n&&(s=!1);else if(a)34===e&&92!==n&&(a=!1);else if(l)96===e&&92!==n&&(l=!1);else if(u)47===e&&92!==n&&(u=!1);else if(124!==e||124===t.charCodeAt(r+1)||124===t.charCodeAt(r-1)||c||h||d){switch(e){case 34:a=!0;break;case 39:s=!0;break;case 96:l=!0;break;case 40:d++;break;case 41:d--;break;case 91:h++;break;case 93:h--;break;case 123:c++;break;case 125:c--}if(47===e){for(var f=r-1,g=void 0;f>=0&&" "===(g=t.charAt(f));f--);g&&Rr.test(g)||(u=!0)}}else void 0===i?(p=r+1,i=t.slice(0,r).trim()):m();function m(){(o||(o=[])).push(t.slice(p,r).trim()),p=r+1}if(void 0===i?i=t.slice(0,r).trim():0!==p&&m(),o)for(r=0;r<o.length;r++)i=Nr(i,o[r]);return i}function Nr(t,e){var n=e.indexOf("(");if(n<0)return'_f("'+e+'")('+t+")";var r=e.slice(0,n),i=e.slice(n+1);return'_f("'+r+'")('+t+(")"!==i?","+i:i)}function Dr(t,e){console.error("[Vue compiler]: "+t)}function Mr(t,e){return t?t.map(function(t){return t[e]}).filter(function(t){return t}):[]}function Lr(t,e,n,r,i){(t.props||(t.props=[])).push(Gr({name:e,value:n,dynamic:i},r)),t.plain=!1}function Pr(t,e,n,r,i){(i?t.dynamicAttrs||(t.dynamicAttrs=[]):t.attrs||(t.attrs=[])).push(Gr({name:e,value:n,dynamic:i},r)),t.plain=!1}function Fr(t,e,n,r){t.attrsMap[e]=n,t.attrsList.push(Gr({name:e,value:n},r))}function Br(t,e,n,r,i,o,s,a){(t.directives||(t.directives=[])).push(Gr({name:e,rawName:n,value:r,arg:i,isDynamicArg:o,modifiers:s},a)),t.plain=!1}function jr(t,e,n){return n?"_p("+e+',"'+t+'")':t+e}function $r(t,e,r,i,o,s,a,l){var u;(i=i||n).right?l?e="("+e+")==='click'?'contextmenu':("+e+")":"click"===e&&(e="contextmenu",delete i.right):i.middle&&(l?e="("+e+")==='click'?'mouseup':("+e+")":"click"===e&&(e="mouseup")),i.capture&&(delete i.capture,e=jr("!",e,l)),i.once&&(delete i.once,e=jr("~",e,l)),i.passive&&(delete i.passive,e=jr("&",e,l)),i.native?(delete i.native,u=t.nativeEvents||(t.nativeEvents={})):u=t.events||(t.events={});var c=Gr({value:r.trim(),dynamic:l},a);i!==n&&(c.modifiers=i);var h=u[e];Array.isArray(h)?o?h.unshift(c):h.push(c):u[e]=h?o?[c,h]:[h,c]:c,t.plain=!1}function Ur(t,e){return t.rawAttrsMap[":"+e]||t.rawAttrsMap["v-bind:"+e]||t.rawAttrsMap[e]}function Vr(t,e,n){var r=Hr(t,":"+e)||Hr(t,"v-bind:"+e);if(null!=r)return Ar(r);if(!1!==n){var i=Hr(t,e);if(null!=i)return JSON.stringify(i)}}function Hr(t,e,n){var r;if(null!=(r=t.attrsMap[e]))for(var i=t.attrsList,o=0,s=i.length;o<s;o++)if(i[o].name===e){i.splice(o,1);break}return n&&delete t.attrsMap[e],r}function Wr(t,e){for(var n=t.attrsList,r=0,i=n.length;r<i;r++){var o=n[r];if(e.test(o.name))return n.splice(r,1),o}}function Gr(t,e){return e&&(null!=e.start&&(t.start=e.start),null!=e.end&&(t.end=e.end)),t}function zr(t,e,n){var r=n||{},i=r.number,o="$$v";r.trim&&(o="(typeof $$v === 'string'? $$v.trim(): $$v)"),i&&(o="_n("+o+")");var s=Xr(e,o);t.model={value:"("+e+")",expression:JSON.stringify(e),callback:"function ($$v) {"+s+"}"}}function Xr(t,e){var n=function(t){if(t=t.trim(),Er=t.length,t.indexOf("[")<0||t.lastIndexOf("]")<Er-1)return(Sr=t.lastIndexOf("."))>-1?{exp:t.slice(0,Sr),key:'"'+t.slice(Sr+1)+'"'}:{exp:t,key:null};wr=t,Sr=kr=Or=0;for(;!Yr();)qr(Cr=Kr())?Zr(Cr):91===Cr&&Jr(Cr);return{exp:t.slice(0,kr),key:t.slice(kr+1,Or)}}(t);return null===n.key?t+"="+e:"$set("+n.exp+", "+n.key+", "+e+")"}function Kr(){return wr.charCodeAt(++Sr)}function Yr(){return Sr>=Er}function qr(t){return 34===t||39===t}function Jr(t){var e=1;for(kr=Sr;!Yr();)if(qr(t=Kr()))Zr(t);else if(91===t&&e++,93===t&&e--,0===e){Or=Sr;break}}function Zr(t){for(var e=t;!Yr()&&(t=Kr())!==e;);}var Qr,ti="__r",ei="__c";function ni(t,e,n){var r=Qr;return function i(){null!==e.apply(null,arguments)&&oi(t,i,n,r)}}var ri=Yt&&!(et&&Number(et[1])<=53);function ii(t,e,n,r){if(ri){var i=hn,o=e;e=o._wrapper=function(t){if(t.target===t.currentTarget||t.timeStamp>=i||t.timeStamp<=0||t.target.ownerDocument!==document)return o.apply(this,arguments)}}Qr.addEventListener(t,e,rt?{capture:n,passive:r}:n)}function oi(t,e,n,r){(r||Qr).removeEventListener(t,e._wrapper||e,n)}function si(t,e){if(!r(t.data.on)||!r(e.data.on)){var n=e.data.on||{},o=t.data.on||{};Qr=e.elm,function(t){if(i(t[ti])){var e=J?"change":"input";t[e]=[].concat(t[ti],t[e]||[]),delete t[ti]}i(t[ei])&&(t.change=[].concat(t[ei],t.change||[]),delete t[ei])}(n),le(n,o,ii,oi,ni,e.context),Qr=void 0}}var ai,li={create:si,update:si};function ui(t,e){if(!r(t.data.domProps)||!r(e.data.domProps)){var n,o,s=e.elm,a=t.data.domProps||{},l=e.data.domProps||{};for(n in i(l.__ob__)&&(l=e.data.domProps=I({},l)),a)n in l||(s[n]="");for(n in l){if(o=l[n],"textContent"===n||"innerHTML"===n){if(e.children&&(e.children.length=0),o===a[n])continue;1===s.childNodes.length&&s.removeChild(s.childNodes[0])}if("value"===n&&"PROGRESS"!==s.tagName){s._value=o;var u=r(o)?"":String(o);ci(s,u)&&(s.value=u)}else if("innerHTML"===n&&Zn(s.tagName)&&r(s.innerHTML)){(ai=ai||document.createElement("div")).innerHTML="<svg>"+o+"</svg>";for(var c=ai.firstChild;s.firstChild;)s.removeChild(s.firstChild);for(;c.firstChild;)s.appendChild(c.firstChild)}else if(o!==a[n])try{s[n]=o}catch(t){}}}}function ci(t,e){return!t.composing&&("OPTION"===t.tagName||function(t,e){var n=!0;try{n=document.activeElement!==t}catch(t){}return n&&t.value!==e}(t,e)||function(t,e){var n=t.value,r=t._vModifiers;if(i(r)){if(r.number)return f(n)!==f(e);if(r.trim)return n.trim()!==e.trim()}return n!==e}(t,e))}var hi={create:ui,update:ui},di=T(function(t){var e={},n=/:(.+)/;return t.split(/;(?![^(]*\))/g).forEach(function(t){if(t){var r=t.split(n);r.length>1&&(e[r[0].trim()]=r[1].trim())}}),e});function pi(t){var e=fi(t.style);return t.staticStyle?I(t.staticStyle,e):e}function fi(t){return Array.isArray(t)?R(t):"string"==typeof t?di(t):t}var gi,mi=/^--/,vi=/\s*!important$/,bi=function(t,e,n){if(mi.test(e))t.style.setProperty(e,n);else if(vi.test(n))t.style.setProperty(S(e),n.replace(vi,""),"important");else{var r=yi(e);if(Array.isArray(n))for(var i=0,o=n.length;i<o;i++)t.style[r]=n[i];else t.style[r]=n}},_i=["Webkit","Moz","ms"],yi=T(function(t){if(gi=gi||document.createElement("div").style,"filter"!==(t=E(t))&&t in gi)return t;for(var e=t.charAt(0).toUpperCase()+t.slice(1),n=0;n<_i.length;n++){var r=_i[n]+e;if(r in gi)return r}});function Ti(t,e){var n=e.data,o=t.data;if(!(r(n.staticStyle)&&r(n.style)&&r(o.staticStyle)&&r(o.style))){var s,a,l=e.elm,u=o.staticStyle,c=o.normalizedStyle||o.style||{},h=u||c,d=fi(e.data.style)||{};e.data.normalizedStyle=i(d.__ob__)?I({},d):d;var p=function(t,e){var n,r={};if(e)for(var i=t;i.componentInstance;)(i=i.componentInstance._vnode)&&i.data&&(n=pi(i.data))&&I(r,n);(n=pi(t.data))&&I(r,n);for(var o=t;o=o.parent;)o.data&&(n=pi(o.data))&&I(r,n);return r}(e,!0);for(a in h)r(p[a])&&bi(l,a,"");for(a in p)(s=p[a])!==h[a]&&bi(l,a,null==s?"":s)}}var xi={create:Ti,update:Ti},Ei=/\s+/;function wi(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(Ei).forEach(function(e){return t.classList.add(e)}):t.classList.add(e);else{var n=" "+(t.getAttribute("class")||"")+" ";n.indexOf(" "+e+" ")<0&&t.setAttribute("class",(n+e).trim())}}function Ci(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(Ei).forEach(function(e){return t.classList.remove(e)}):t.classList.remove(e),t.classList.length||t.removeAttribute("class");else{for(var n=" "+(t.getAttribute("class")||"")+" ",r=" "+e+" ";n.indexOf(r)>=0;)n=n.replace(r," ");(n=n.trim())?t.setAttribute("class",n):t.removeAttribute("class")}}function Si(t){if(t){if("object"==typeof t){var e={};return!1!==t.css&&I(e,ki(t.name||"v")),I(e,t),e}return"string"==typeof t?ki(t):void 0}}var ki=T(function(t){return{enterClass:t+"-enter",enterToClass:t+"-enter-to",enterActiveClass:t+"-enter-active",leaveClass:t+"-leave",leaveToClass:t+"-leave-to",leaveActiveClass:t+"-leave-active"}}),Oi=X&&!Z,Ii="transition",Ri="animation",Ai="transition",Ni="transitionend",Di="animation",Mi="animationend";Oi&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(Ai="WebkitTransition",Ni="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(Di="WebkitAnimation",Mi="webkitAnimationEnd"));var Li=X?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(t){return t()};function Pi(t){Li(function(){Li(t)})}function Fi(t,e){var n=t._transitionClasses||(t._transitionClasses=[]);n.indexOf(e)<0&&(n.push(e),wi(t,e))}function Bi(t,e){t._transitionClasses&&b(t._transitionClasses,e),Ci(t,e)}function ji(t,e,n){var r=Ui(t,e),i=r.type,o=r.timeout,s=r.propCount;if(!i)return n();var a=i===Ii?Ni:Mi,l=0,u=function(){t.removeEventListener(a,c),n()},c=function(e){e.target===t&&++l>=s&&u()};setTimeout(function(){l<s&&u()},o+1),t.addEventListener(a,c)}var $i=/\b(transform|all)(,|$)/;function Ui(t,e){var n,r=window.getComputedStyle(t),i=(r[Ai+"Delay"]||"").split(", "),o=(r[Ai+"Duration"]||"").split(", "),s=Vi(i,o),a=(r[Di+"Delay"]||"").split(", "),l=(r[Di+"Duration"]||"").split(", "),u=Vi(a,l),c=0,h=0;return e===Ii?s>0&&(n=Ii,c=s,h=o.length):e===Ri?u>0&&(n=Ri,c=u,h=l.length):h=(n=(c=Math.max(s,u))>0?s>u?Ii:Ri:null)?n===Ii?o.length:l.length:0,{type:n,timeout:c,propCount:h,hasTransform:n===Ii&&$i.test(r[Ai+"Property"])}}function Vi(t,e){for(;t.length<e.length;)t=t.concat(t);return Math.max.apply(null,e.map(function(e,n){return Hi(e)+Hi(t[n])}))}function Hi(t){return 1e3*Number(t.slice(0,-1).replace(",","."))}function Wi(t,e){var n=t.elm;i(n._leaveCb)&&(n._leaveCb.cancelled=!0,n._leaveCb());var o=Si(t.data.transition);if(!r(o)&&!i(n._enterCb)&&1===n.nodeType){for(var s=o.css,l=o.type,u=o.enterClass,c=o.enterToClass,h=o.enterActiveClass,d=o.appearClass,p=o.appearToClass,g=o.appearActiveClass,m=o.beforeEnter,v=o.enter,b=o.afterEnter,_=o.enterCancelled,y=o.beforeAppear,T=o.appear,x=o.afterAppear,E=o.appearCancelled,w=o.duration,C=Qe,S=Qe.$vnode;S&&S.parent;)C=S.context,S=S.parent;var k=!C._isMounted||!t.isRootInsert;if(!k||T||""===T){var O=k&&d?d:u,I=k&&g?g:h,R=k&&p?p:c,A=k&&y||m,N=k&&"function"==typeof T?T:v,D=k&&x||b,M=k&&E||_,L=f(a(w)?w.enter:w);0;var F=!1!==s&&!Z,B=Xi(N),j=n._enterCb=P(function(){F&&(Bi(n,R),Bi(n,I)),j.cancelled?(F&&Bi(n,O),M&&M(n)):D&&D(n),n._enterCb=null});t.data.show||ue(t,"insert",function(){var e=n.parentNode,r=e&&e._pending&&e._pending[t.key];r&&r.tag===t.tag&&r.elm._leaveCb&&r.elm._leaveCb(),N&&N(n,j)}),A&&A(n),F&&(Fi(n,O),Fi(n,I),Pi(function(){Bi(n,O),j.cancelled||(Fi(n,R),B||(zi(L)?setTimeout(j,L):ji(n,l,j)))})),t.data.show&&(e&&e(),N&&N(n,j)),F||B||j()}}}function Gi(t,e){var n=t.elm;i(n._enterCb)&&(n._enterCb.cancelled=!0,n._enterCb());var o=Si(t.data.transition);if(r(o)||1!==n.nodeType)return e();if(!i(n._leaveCb)){var s=o.css,l=o.type,u=o.leaveClass,c=o.leaveToClass,h=o.leaveActiveClass,d=o.beforeLeave,p=o.leave,g=o.afterLeave,m=o.leaveCancelled,v=o.delayLeave,b=o.duration,_=!1!==s&&!Z,y=Xi(p),T=f(a(b)?b.leave:b);0;var x=n._leaveCb=P(function(){n.parentNode&&n.parentNode._pending&&(n.parentNode._pending[t.key]=null),_&&(Bi(n,c),Bi(n,h)),x.cancelled?(_&&Bi(n,u),m&&m(n)):(e(),g&&g(n)),n._leaveCb=null});v?v(E):E()}function E(){x.cancelled||(!t.data.show&&n.parentNode&&((n.parentNode._pending||(n.parentNode._pending={}))[t.key]=t),d&&d(n),_&&(Fi(n,u),Fi(n,h),Pi(function(){Bi(n,u),x.cancelled||(Fi(n,c),y||(zi(T)?setTimeout(x,T):ji(n,l,x)))})),p&&p(n,x),_||y||x())}}function zi(t){return"number"==typeof t&&!isNaN(t)}function Xi(t){if(r(t))return!1;var e=t.fns;return i(e)?Xi(Array.isArray(e)?e[0]:e):(t._length||t.length)>1}function Ki(t,e){!0!==e.data.show&&Wi(e)}var Yi=function(t){var e,n,a={},l=t.modules,u=t.nodeOps;for(e=0;e<lr.length;++e)for(a[lr[e]]=[],n=0;n<l.length;++n)i(l[n][lr[e]])&&a[lr[e]].push(l[n][lr[e]]);function c(t){var e=u.parentNode(t);i(e)&&u.removeChild(e,t)}function h(t,e,n,r,s,l,c){if(i(t.elm)&&i(l)&&(t=l[c]=yt(t)),t.isRootInsert=!s,!function(t,e,n,r){var s=t.data;if(i(s)){var l=i(t.componentInstance)&&s.keepAlive;if(i(s=s.hook)&&i(s=s.init)&&s(t,!1),i(t.componentInstance))return d(t,e),p(n,t.elm,r),o(l)&&function(t,e,n,r){for(var o,s=t;s.componentInstance;)if(s=s.componentInstance._vnode,i(o=s.data)&&i(o=o.transition)){for(o=0;o<a.activate.length;++o)a.activate[o](ar,s);e.push(s);break}p(n,t.elm,r)}(t,e,n,r),!0}}(t,e,n,r)){var h=t.data,g=t.children,m=t.tag;i(m)?(t.elm=t.ns?u.createElementNS(t.ns,m):u.createElement(m,t),b(t),f(t,g,e),i(h)&&v(t,e),p(n,t.elm,r)):o(t.isComment)?(t.elm=u.createComment(t.text),p(n,t.elm,r)):(t.elm=u.createTextNode(t.text),p(n,t.elm,r))}}function d(t,e){i(t.data.pendingInsert)&&(e.push.apply(e,t.data.pendingInsert),t.data.pendingInsert=null),t.elm=t.componentInstance.$el,m(t)?(v(t,e),b(t)):(sr(t),e.push(t))}function p(t,e,n){i(t)&&(i(n)?u.parentNode(n)===t&&u.insertBefore(t,e,n):u.appendChild(t,e))}function f(t,e,n){if(Array.isArray(e))for(var r=0;r<e.length;++r)h(e[r],n,t.elm,null,!0,e,r);else s(t.text)&&u.appendChild(t.elm,u.createTextNode(String(t.text)))}function m(t){for(;t.componentInstance;)t=t.componentInstance._vnode;return i(t.tag)}function v(t,n){for(var r=0;r<a.create.length;++r)a.create[r](ar,t);i(e=t.data.hook)&&(i(e.create)&&e.create(ar,t),i(e.insert)&&n.push(t))}function b(t){var e;if(i(e=t.fnScopeId))u.setStyleScope(t.elm,e);else for(var n=t;n;)i(e=n.context)&&i(e=e.$options._scopeId)&&u.setStyleScope(t.elm,e),n=n.parent;i(e=Qe)&&e!==t.context&&e!==t.fnContext&&i(e=e.$options._scopeId)&&u.setStyleScope(t.elm,e)}function _(t,e,n,r,i,o){for(;r<=i;++r)h(n[r],o,t,e,!1,n,r)}function y(t){var e,n,r=t.data;if(i(r))for(i(e=r.hook)&&i(e=e.destroy)&&e(t),e=0;e<a.destroy.length;++e)a.destroy[e](t);if(i(e=t.children))for(n=0;n<t.children.length;++n)y(t.children[n])}function T(t,e,n){for(;e<=n;++e){var r=t[e];i(r)&&(i(r.tag)?(x(r),y(r)):c(r.elm))}}function x(t,e){if(i(e)||i(t.data)){var n,r=a.remove.length+1;for(i(e)?e.listeners+=r:e=function(t,e){function n(){0==--n.listeners&&c(t)}return n.listeners=e,n}(t.elm,r),i(n=t.componentInstance)&&i(n=n._vnode)&&i(n.data)&&x(n,e),n=0;n<a.remove.length;++n)a.remove[n](t,e);i(n=t.data.hook)&&i(n=n.remove)?n(t,e):e()}else c(t.elm)}function E(t,e,n,r){for(var o=n;o<r;o++){var s=e[o];if(i(s)&&ur(t,s))return o}}function w(t,e,n,s,l,c){if(t!==e){i(e.elm)&&i(s)&&(e=s[l]=yt(e));var d=e.elm=t.elm;if(o(t.isAsyncPlaceholder))i(e.asyncFactory.resolved)?k(t.elm,e,n):e.isAsyncPlaceholder=!0;else if(o(e.isStatic)&&o(t.isStatic)&&e.key===t.key&&(o(e.isCloned)||o(e.isOnce)))e.componentInstance=t.componentInstance;else{var p,f=e.data;i(f)&&i(p=f.hook)&&i(p=p.prepatch)&&p(t,e);var g=t.children,v=e.children;if(i(f)&&m(e)){for(p=0;p<a.update.length;++p)a.update[p](t,e);i(p=f.hook)&&i(p=p.update)&&p(t,e)}r(e.text)?i(g)&&i(v)?g!==v&&function(t,e,n,o,s){for(var a,l,c,d=0,p=0,f=e.length-1,g=e[0],m=e[f],v=n.length-1,b=n[0],y=n[v],x=!s;d<=f&&p<=v;)r(g)?g=e[++d]:r(m)?m=e[--f]:ur(g,b)?(w(g,b,o,n,p),g=e[++d],b=n[++p]):ur(m,y)?(w(m,y,o,n,v),m=e[--f],y=n[--v]):ur(g,y)?(w(g,y,o,n,v),x&&u.insertBefore(t,g.elm,u.nextSibling(m.elm)),g=e[++d],y=n[--v]):ur(m,b)?(w(m,b,o,n,p),x&&u.insertBefore(t,m.elm,g.elm),m=e[--f],b=n[++p]):(r(a)&&(a=cr(e,d,f)),r(l=i(b.key)?a[b.key]:E(b,e,d,f))?h(b,o,t,g.elm,!1,n,p):ur(c=e[l],b)?(w(c,b,o,n,p),e[l]=void 0,x&&u.insertBefore(t,c.elm,g.elm)):h(b,o,t,g.elm,!1,n,p),b=n[++p]);d>f?_(t,r(n[v+1])?null:n[v+1].elm,n,p,v,o):p>v&&T(e,d,f)}(d,g,v,n,c):i(v)?(i(t.text)&&u.setTextContent(d,""),_(d,null,v,0,v.length-1,n)):i(g)?T(g,0,g.length-1):i(t.text)&&u.setTextContent(d,""):t.text!==e.text&&u.setTextContent(d,e.text),i(f)&&i(p=f.hook)&&i(p=p.postpatch)&&p(t,e)}}}function C(t,e,n){if(o(n)&&i(t.parent))t.parent.data.pendingInsert=e;else for(var r=0;r<e.length;++r)e[r].data.hook.insert(e[r])}var S=g("attrs,class,staticClass,staticStyle,key");function k(t,e,n,r){var s,a=e.tag,l=e.data,u=e.children;if(r=r||l&&l.pre,e.elm=t,o(e.isComment)&&i(e.asyncFactory))return e.isAsyncPlaceholder=!0,!0;if(i(l)&&(i(s=l.hook)&&i(s=s.init)&&s(e,!0),i(s=e.componentInstance)))return d(e,n),!0;if(i(a)){if(i(u))if(t.hasChildNodes())if(i(s=l)&&i(s=s.domProps)&&i(s=s.innerHTML)){if(s!==t.innerHTML)return!1}else{for(var c=!0,h=t.firstChild,p=0;p<u.length;p++){if(!h||!k(h,u[p],n,r)){c=!1;break}h=h.nextSibling}if(!c||h)return!1}else f(e,u,n);if(i(l)){var g=!1;for(var m in l)if(!S(m)){g=!0,v(e,n);break}!g&&l.class&&oe(l.class)}}else t.data!==e.text&&(t.data=e.text);return!0}return function(t,e,n,s){if(!r(e)){var l,c=!1,d=[];if(r(t))c=!0,h(e,d);else{var p=i(t.nodeType);if(!p&&ur(t,e))w(t,e,d,null,null,s);else{if(p){if(1===t.nodeType&&t.hasAttribute(F)&&(t.removeAttribute(F),n=!0),o(n)&&k(t,e,d))return C(e,d,!0),t;l=t,t=new mt(u.tagName(l).toLowerCase(),{},[],void 0,l)}var f=t.elm,g=u.parentNode(f);if(h(e,d,f._leaveCb?null:g,u.nextSibling(f)),i(e.parent))for(var v=e.parent,b=m(e);v;){for(var _=0;_<a.destroy.length;++_)a.destroy[_](v);if(v.elm=e.elm,b){for(var x=0;x<a.create.length;++x)a.create[x](ar,v);var E=v.data.hook.insert;if(E.merged)for(var S=1;S<E.fns.length;S++)E.fns[S]()}else sr(v);v=v.parent}i(g)?T([t],0,0):i(t.tag)&&y(t)}}return C(e,d,c),e.elm}i(t)&&y(t)}}({nodeOps:ir,modules:[Tr,Ir,li,hi,xi,X?{create:Ki,activate:Ki,remove:function(t,e){!0!==t.data.show?Gi(t,e):e()}}:{}].concat(vr)});Z&&document.addEventListener("selectionchange",function(){var t=document.activeElement;t&&t.vmodel&&ro(t,"input")});var qi={inserted:function(t,e,n,r){"select"===n.tag?(r.elm&&!r.elm._vOptions?ue(n,"postpatch",function(){qi.componentUpdated(t,e,n)}):Ji(t,e,n.context),t._vOptions=[].map.call(t.options,to)):("textarea"===n.tag||nr(t.type))&&(t._vModifiers=e.modifiers,e.modifiers.lazy||(t.addEventListener("compositionstart",eo),t.addEventListener("compositionend",no),t.addEventListener("change",no),Z&&(t.vmodel=!0)))},componentUpdated:function(t,e,n){if("select"===n.tag){Ji(t,e,n.context);var r=t._vOptions,i=t._vOptions=[].map.call(t.options,to);if(i.some(function(t,e){return!M(t,r[e])}))(t.multiple?e.value.some(function(t){return Qi(t,i)}):e.value!==e.oldValue&&Qi(e.value,i))&&ro(t,"change")}}};function Ji(t,e,n){Zi(t,e,n),(J||Q)&&setTimeout(function(){Zi(t,e,n)},0)}function Zi(t,e,n){var r=e.value,i=t.multiple;if(!i||Array.isArray(r)){for(var o,s,a=0,l=t.options.length;a<l;a++)if(s=t.options[a],i)o=L(r,to(s))>-1,s.selected!==o&&(s.selected=o);else if(M(to(s),r))return void(t.selectedIndex!==a&&(t.selectedIndex=a));i||(t.selectedIndex=-1)}}function Qi(t,e){return e.every(function(e){return!M(e,t)})}function to(t){return"_value"in t?t._value:t.value}function eo(t){t.target.composing=!0}function no(t){t.target.composing&&(t.target.composing=!1,ro(t.target,"input"))}function ro(t,e){var n=document.createEvent("HTMLEvents");n.initEvent(e,!0,!0),t.dispatchEvent(n)}function io(t){return!t.componentInstance||t.data&&t.data.transition?t:io(t.componentInstance._vnode)}var oo={model:qi,show:{bind:function(t,e,n){var r=e.value,i=(n=io(n)).data&&n.data.transition,o=t.__vOriginalDisplay="none"===t.style.display?"":t.style.display;r&&i?(n.data.show=!0,Wi(n,function(){t.style.display=o})):t.style.display=r?o:"none"},update:function(t,e,n){var r=e.value;!r!=!e.oldValue&&((n=io(n)).data&&n.data.transition?(n.data.show=!0,r?Wi(n,function(){t.style.display=t.__vOriginalDisplay}):Gi(n,function(){t.style.display="none"})):t.style.display=r?t.__vOriginalDisplay:"none")},unbind:function(t,e,n,r,i){i||(t.style.display=t.__vOriginalDisplay)}}},so={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function ao(t){var e=t&&t.componentOptions;return e&&e.Ctor.options.abstract?ao(Ke(e.children)):t}function lo(t){var e={},n=t.$options;for(var r in n.propsData)e[r]=t[r];var i=n._parentListeners;for(var o in i)e[E(o)]=i[o];return e}function uo(t,e){if(/\d-keep-alive$/.test(e.tag))return t("keep-alive",{props:e.componentOptions.propsData})}var co=function(t){return t.tag||me(t)},ho=function(t){return"show"===t.name},po={name:"transition",props:so,abstract:!0,render:function(t){var e=this,n=this.$slots.default;if(n&&(n=n.filter(co)).length){0;var r=this.mode;0;var i=n[0];if(function(t){for(;t=t.parent;)if(t.data.transition)return!0}(this.$vnode))return i;var o=ao(i);if(!o)return i;if(this._leaving)return uo(t,i);var a="__transition-"+this._uid+"-";o.key=null==o.key?o.isComment?a+"comment":a+o.tag:s(o.key)?0===String(o.key).indexOf(a)?o.key:a+o.key:o.key;var l=(o.data||(o.data={})).transition=lo(this),u=this._vnode,c=ao(u);if(o.data.directives&&o.data.directives.some(ho)&&(o.data.show=!0),c&&c.data&&!function(t,e){return e.key===t.key&&e.tag===t.tag}(o,c)&&!me(c)&&(!c.componentInstance||!c.componentInstance._vnode.isComment)){var h=c.data.transition=I({},l);if("out-in"===r)return this._leaving=!0,ue(h,"afterLeave",function(){e._leaving=!1,e.$forceUpdate()}),uo(t,i);if("in-out"===r){if(me(o))return u;var d,p=function(){d()};ue(l,"afterEnter",p),ue(l,"enterCancelled",p),ue(h,"delayLeave",function(t){d=t})}}return i}}},fo=I({tag:String,moveClass:String},so);function go(t){t.elm._moveCb&&t.elm._moveCb(),t.elm._enterCb&&t.elm._enterCb()}function mo(t){t.data.newPos=t.elm.getBoundingClientRect()}function vo(t){var e=t.data.pos,n=t.data.newPos,r=e.left-n.left,i=e.top-n.top;if(r||i){t.data.moved=!0;var o=t.elm.style;o.transform=o.WebkitTransform="translate("+r+"px,"+i+"px)",o.transitionDuration="0s"}}delete fo.mode;var bo={Transition:po,TransitionGroup:{props:fo,beforeMount:function(){var t=this,e=this._update;this._update=function(n,r){var i=tn(t);t.__patch__(t._vnode,t.kept,!1,!0),t._vnode=t.kept,i(),e.call(t,n,r)}},render:function(t){for(var e=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,i=this.$slots.default||[],o=this.children=[],s=lo(this),a=0;a<i.length;a++){var l=i[a];if(l.tag)if(null!=l.key&&0!==String(l.key).indexOf("__vlist"))o.push(l),n[l.key]=l,(l.data||(l.data={})).transition=s;else;}if(r){for(var u=[],c=[],h=0;h<r.length;h++){var d=r[h];d.data.transition=s,d.data.pos=d.elm.getBoundingClientRect(),n[d.key]?u.push(d):c.push(d)}this.kept=t(e,null,u),this.removed=c}return t(e,null,o)},updated:function(){var t=this.prevChildren,e=this.moveClass||(this.name||"v")+"-move";t.length&&this.hasMove(t[0].elm,e)&&(t.forEach(go),t.forEach(mo),t.forEach(vo),this._reflow=document.body.offsetHeight,t.forEach(function(t){if(t.data.moved){var n=t.elm,r=n.style;Fi(n,e),r.transform=r.WebkitTransform=r.transitionDuration="",n.addEventListener(Ni,n._moveCb=function t(r){r&&r.target!==n||r&&!/transform$/.test(r.propertyName)||(n.removeEventListener(Ni,t),n._moveCb=null,Bi(n,e))})}}))},methods:{hasMove:function(t,e){if(!Oi)return!1;if(this._hasMove)return this._hasMove;var n=t.cloneNode();t._transitionClasses&&t._transitionClasses.forEach(function(t){Ci(n,t)}),wi(n,e),n.style.display="none",this.$el.appendChild(n);var r=Ui(n);return this.$el.removeChild(n),this._hasMove=r.hasTransform}}}};kn.config.mustUseProp=Fn,kn.config.isReservedTag=Qn,kn.config.isReservedAttr=Ln,kn.config.getTagNamespace=tr,kn.config.isUnknownElement=function(t){if(!X)return!0;if(Qn(t))return!1;if(t=t.toLowerCase(),null!=er[t])return er[t];var e=document.createElement(t);return t.indexOf("-")>-1?er[t]=e.constructor===window.HTMLUnknownElement||e.constructor===window.HTMLElement:er[t]=/HTMLUnknownElement/.test(e.toString())},I(kn.options.directives,oo),I(kn.options.components,bo),kn.prototype.__patch__=X?Yi:A,kn.prototype.$mount=function(t,e){return function(t,e,n){return t.$el=e,t.$options.render||(t.$options.render=bt),rn(t,"beforeMount"),new mn(t,function(){t._update(t._render(),n)},A,{before:function(){t._isMounted&&!t._isDestroyed&&rn(t,"beforeUpdate")}},!0),n=!1,null==t.$vnode&&(t._isMounted=!0,rn(t,"mounted")),t}(this,t=t&&X?rr(t):void 0,e)},X&&setTimeout(function(){$.devtools&&st&&st.emit("init",kn)},0);var _o=/\{\{((?:.|\r?\n)+?)\}\}/g,yo=/[-.*+?^${}()|[\]\/\\]/g,To=T(function(t){var e=t[0].replace(yo,"\\$&"),n=t[1].replace(yo,"\\$&");return new RegExp(e+"((?:.|\\n)+?)"+n,"g")});function xo(t,e){var n=e?To(e):_o;if(n.test(t)){for(var r,i,o,s=[],a=[],l=n.lastIndex=0;r=n.exec(t);){(i=r.index)>l&&(a.push(o=t.slice(l,i)),s.push(JSON.stringify(o)));var u=Ar(r[1].trim());s.push("_s("+u+")"),a.push({"@binding":u}),l=i+r[0].length}return l<t.length&&(a.push(o=t.slice(l)),s.push(JSON.stringify(o))),{expression:s.join("+"),tokens:a}}}var Eo={staticKeys:["staticClass"],transformNode:function(t,e){e.warn;var n=Hr(t,"class");n&&(t.staticClass=JSON.stringify(n));var r=Vr(t,"class",!1);r&&(t.classBinding=r)},genData:function(t){var e="";return t.staticClass&&(e+="staticClass:"+t.staticClass+","),t.classBinding&&(e+="class:"+t.classBinding+","),e}};var wo,Co={staticKeys:["staticStyle"],transformNode:function(t,e){e.warn;var n=Hr(t,"style");n&&(t.staticStyle=JSON.stringify(di(n)));var r=Vr(t,"style",!1);r&&(t.styleBinding=r)},genData:function(t){var e="";return t.staticStyle&&(e+="staticStyle:"+t.staticStyle+","),t.styleBinding&&(e+="style:("+t.styleBinding+"),"),e}},So=function(t){return(wo=wo||document.createElement("div")).innerHTML=t,wo.textContent},ko=g("area,base,br,col,embed,frame,hr,img,input,isindex,keygen,link,meta,param,source,track,wbr"),Oo=g("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source"),Io=g("address,article,aside,base,blockquote,body,caption,col,colgroup,dd,details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,title,tr,track"),Ro=/^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,Ao=/^\s*((?:v-[\w-]+:|@|:|#)\[[^=]+?\][^\s"'<>\/=]*)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,No="[a-zA-Z_][\\-\\.0-9_a-zA-Z"+U.source+"]*",Do="((?:"+No+"\\:)?"+No+")",Mo=new RegExp("^<"+Do),Lo=/^\s*(\/?)>/,Po=new RegExp("^<\\/"+Do+"[^>]*>"),Fo=/^<!DOCTYPE [^>]+>/i,Bo=/^<!\--/,jo=/^<!\[/,$o=g("script,style,textarea",!0),Uo={},Vo={"&lt;":"<","&gt;":">","&quot;":'"',"&amp;":"&","&#10;":"\n","&#9;":"\t","&#39;":"'"},Ho=/&(?:lt|gt|quot|amp|#39);/g,Wo=/&(?:lt|gt|quot|amp|#39|#10|#9);/g,Go=g("pre,textarea",!0),zo=function(t,e){return t&&Go(t)&&"\n"===e[0]};function Xo(t,e){var n=e?Wo:Ho;return t.replace(n,function(t){return Vo[t]})}var Ko,Yo,qo,Jo,Zo,Qo,ts,es,ns=/^@|^v-on:/,rs=/^v-|^@|^:|^#/,is=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,os=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,ss=/^\(|\)$/g,as=/^\[.*\]$/,ls=/:(.*)$/,us=/^:|^\.|^v-bind:/,cs=/\.[^.\]]+(?=[^\]]*$)/g,hs=/^v-slot(:|$)|^#/,ds=/[\r\n]/,ps=/[ \f\t\r\n]+/g,fs=T(So),gs="_empty_";function ms(t,e,n){return{type:1,tag:t,attrsList:e,attrsMap:function(t){for(var e={},n=0,r=t.length;n<r;n++)e[t[n].name]=t[n].value;return e}(e),rawAttrsMap:{},parent:n,children:[]}}function vs(t,e){Ko=e.warn||Dr,Qo=e.isPreTag||N,ts=e.mustUseProp||N,es=e.getTagNamespace||N;var n=e.isReservedTag||N;(function(t){return!(!(t.component||t.attrsMap[":is"]||t.attrsMap["v-bind:is"])&&(t.attrsMap.is?n(t.attrsMap.is):n(t.tag)))}),qo=Mr(e.modules,"transformNode"),Jo=Mr(e.modules,"preTransformNode"),Zo=Mr(e.modules,"postTransformNode"),Yo=e.delimiters;var r,i,o=[],s=!1!==e.preserveWhitespace,a=e.whitespace,l=!1,u=!1;function c(t){if(h(t),l||t.processed||(t=bs(t,e)),o.length||t===r||r.if&&(t.elseif||t.else)&&ys(r,{exp:t.elseif,block:t}),i&&!t.forbidden)if(t.elseif||t.else)s=t,(a=function(t){var e=t.length;for(;e--;){if(1===t[e].type)return t[e];t.pop()}}(i.children))&&a.if&&ys(a,{exp:s.elseif,block:s});else{if(t.slotScope){var n=t.slotTarget||'"default"';(i.scopedSlots||(i.scopedSlots={}))[n]=t}i.children.push(t),t.parent=i}var s,a;t.children=t.children.filter(function(t){return!t.slotScope}),h(t),t.pre&&(l=!1),Qo(t.tag)&&(u=!1);for(var c=0;c<Zo.length;c++)Zo[c](t,e)}function h(t){if(!u)for(var e;(e=t.children[t.children.length-1])&&3===e.type&&" "===e.text;)t.children.pop()}return function(t,e){for(var n,r,i=[],o=e.expectHTML,s=e.isUnaryTag||N,a=e.canBeLeftOpenTag||N,l=0;t;){if(n=t,r&&$o(r)){var u=0,c=r.toLowerCase(),h=Uo[c]||(Uo[c]=new RegExp("([\\s\\S]*?)(</"+c+"[^>]*>)","i")),d=t.replace(h,function(t,n,r){return u=r.length,$o(c)||"noscript"===c||(n=n.replace(/<!\--([\s\S]*?)-->/g,"$1").replace(/<!\[CDATA\[([\s\S]*?)]]>/g,"$1")),zo(c,n)&&(n=n.slice(1)),e.chars&&e.chars(n),""});l+=t.length-d.length,t=d,S(c,l-u,l)}else{var p=t.indexOf("<");if(0===p){if(Bo.test(t)){var f=t.indexOf("--\x3e");if(f>=0){e.shouldKeepComment&&e.comment(t.substring(4,f),l,l+f+3),E(f+3);continue}}if(jo.test(t)){var g=t.indexOf("]>");if(g>=0){E(g+2);continue}}var m=t.match(Fo);if(m){E(m[0].length);continue}var v=t.match(Po);if(v){var b=l;E(v[0].length),S(v[1],b,l);continue}var _=w();if(_){C(_),zo(_.tagName,t)&&E(1);continue}}var y=void 0,T=void 0,x=void 0;if(p>=0){for(T=t.slice(p);!(Po.test(T)||Mo.test(T)||Bo.test(T)||jo.test(T)||(x=T.indexOf("<",1))<0);)p+=x,T=t.slice(p);y=t.substring(0,p)}p<0&&(y=t),y&&E(y.length),e.chars&&y&&e.chars(y,l-y.length,l)}if(t===n){e.chars&&e.chars(t);break}}function E(e){l+=e,t=t.substring(e)}function w(){var e=t.match(Mo);if(e){var n,r,i={tagName:e[1],attrs:[],start:l};for(E(e[0].length);!(n=t.match(Lo))&&(r=t.match(Ao)||t.match(Ro));)r.start=l,E(r[0].length),r.end=l,i.attrs.push(r);if(n)return i.unarySlash=n[1],E(n[0].length),i.end=l,i}}function C(t){var n=t.tagName,l=t.unarySlash;o&&("p"===r&&Io(n)&&S(r),a(n)&&r===n&&S(n));for(var u=s(n)||!!l,c=t.attrs.length,h=new Array(c),d=0;d<c;d++){var p=t.attrs[d],f=p[3]||p[4]||p[5]||"",g="a"===n&&"href"===p[1]?e.shouldDecodeNewlinesForHref:e.shouldDecodeNewlines;h[d]={name:p[1],value:Xo(f,g)}}u||(i.push({tag:n,lowerCasedTag:n.toLowerCase(),attrs:h,start:t.start,end:t.end}),r=n),e.start&&e.start(n,h,u,t.start,t.end)}function S(t,n,o){var s,a;if(null==n&&(n=l),null==o&&(o=l),t)for(a=t.toLowerCase(),s=i.length-1;s>=0&&i[s].lowerCasedTag!==a;s--);else s=0;if(s>=0){for(var u=i.length-1;u>=s;u--)e.end&&e.end(i[u].tag,n,o);i.length=s,r=s&&i[s-1].tag}else"br"===a?e.start&&e.start(t,[],!0,n,o):"p"===a&&(e.start&&e.start(t,[],!1,n,o),e.end&&e.end(t,n,o))}S()}(t,{warn:Ko,expectHTML:e.expectHTML,isUnaryTag:e.isUnaryTag,canBeLeftOpenTag:e.canBeLeftOpenTag,shouldDecodeNewlines:e.shouldDecodeNewlines,shouldDecodeNewlinesForHref:e.shouldDecodeNewlinesForHref,shouldKeepComment:e.comments,outputSourceRange:e.outputSourceRange,start:function(t,n,s,a,h){var d=i&&i.ns||es(t);J&&"svg"===d&&(n=function(t){for(var e=[],n=0;n<t.length;n++){var r=t[n];Es.test(r.name)||(r.name=r.name.replace(ws,""),e.push(r))}return e}(n));var p,f=ms(t,n,i);d&&(f.ns=d),"style"!==(p=f).tag&&("script"!==p.tag||p.attrsMap.type&&"text/javascript"!==p.attrsMap.type)||ot()||(f.forbidden=!0);for(var g=0;g<Jo.length;g++)f=Jo[g](f,e)||f;l||(!function(t){null!=Hr(t,"v-pre")&&(t.pre=!0)}(f),f.pre&&(l=!0)),Qo(f.tag)&&(u=!0),l?function(t){var e=t.attrsList,n=e.length;if(n)for(var r=t.attrs=new Array(n),i=0;i<n;i++)r[i]={name:e[i].name,value:JSON.stringify(e[i].value)},null!=e[i].start&&(r[i].start=e[i].start,r[i].end=e[i].end);else t.pre||(t.plain=!0)}(f):f.processed||(_s(f),function(t){var e=Hr(t,"v-if");if(e)t.if=e,ys(t,{exp:e,block:t});else{null!=Hr(t,"v-else")&&(t.else=!0);var n=Hr(t,"v-else-if");n&&(t.elseif=n)}}(f),function(t){null!=Hr(t,"v-once")&&(t.once=!0)}(f)),r||(r=f),s?c(f):(i=f,o.push(f))},end:function(t,e,n){var r=o[o.length-1];o.length-=1,i=o[o.length-1],c(r)},chars:function(t,e,n){if(i&&(!J||"textarea"!==i.tag||i.attrsMap.placeholder!==t)){var r,o,c,h=i.children;if(t=u||t.trim()?"script"===(r=i).tag||"style"===r.tag?t:fs(t):h.length?a?"condense"===a&&ds.test(t)?"":" ":s?" ":"":"")u||"condense"!==a||(t=t.replace(ps," ")),!l&&" "!==t&&(o=xo(t,Yo))?c={type:2,expression:o.expression,tokens:o.tokens,text:t}:" "===t&&h.length&&" "===h[h.length-1].text||(c={type:3,text:t}),c&&h.push(c)}},comment:function(t,e,n){if(i){var r={type:3,text:t,isComment:!0};0,i.children.push(r)}}}),r}function bs(t,e){var n,r;!function(t){var e=Vr(t,"key");if(e){t.key=e}}(t),t.plain=!t.key&&!t.scopedSlots&&!t.attrsList.length,(r=Vr(n=t,"ref"))&&(n.ref=r,n.refInFor=function(t){for(var e=t;e;){if(void 0!==e.for)return!0;e=e.parent}return!1}(n)),function(t){var e;"template"===t.tag?(e=Hr(t,"scope"),t.slotScope=e||Hr(t,"slot-scope")):(e=Hr(t,"slot-scope"))&&(t.slotScope=e);var n=Vr(t,"slot");n&&(t.slotTarget='""'===n?'"default"':n,t.slotTargetDynamic=!(!t.attrsMap[":slot"]&&!t.attrsMap["v-bind:slot"]),"template"===t.tag||t.slotScope||Pr(t,"slot",n,Ur(t,"slot")));if("template"===t.tag){var r=Wr(t,hs);if(r){0;var i=Ts(r),o=i.name,s=i.dynamic;t.slotTarget=o,t.slotTargetDynamic=s,t.slotScope=r.value||gs}}else{var a=Wr(t,hs);if(a){0;var l=t.scopedSlots||(t.scopedSlots={}),u=Ts(a),c=u.name,h=u.dynamic,d=l[c]=ms("template",[],t);d.slotTarget=c,d.slotTargetDynamic=h,d.children=t.children.filter(function(t){if(!t.slotScope)return t.parent=d,!0}),d.slotScope=a.value||gs,t.children=[],t.plain=!1}}}(t),function(t){"slot"===t.tag&&(t.slotName=Vr(t,"name"))}(t),function(t){var e;(e=Vr(t,"is"))&&(t.component=e);null!=Hr(t,"inline-template")&&(t.inlineTemplate=!0)}(t);for(var i=0;i<qo.length;i++)t=qo[i](t,e)||t;return function(t){var e,n,r,i,o,s,a,l,u=t.attrsList;for(e=0,n=u.length;e<n;e++){if(r=i=u[e].name,o=u[e].value,rs.test(r))if(t.hasBindings=!0,(s=xs(r.replace(rs,"")))&&(r=r.replace(cs,"")),us.test(r))r=r.replace(us,""),o=Ar(o),(l=as.test(r))&&(r=r.slice(1,-1)),s&&(s.prop&&!l&&"innerHtml"===(r=E(r))&&(r="innerHTML"),s.camel&&!l&&(r=E(r)),s.sync&&(a=Xr(o,"$event"),l?$r(t,'"update:"+('+r+")",a,null,!1,0,u[e],!0):($r(t,"update:"+E(r),a,null,!1,0,u[e]),S(r)!==E(r)&&$r(t,"update:"+S(r),a,null,!1,0,u[e])))),s&&s.prop||!t.component&&ts(t.tag,t.attrsMap.type,r)?Lr(t,r,o,u[e],l):Pr(t,r,o,u[e],l);else if(ns.test(r))r=r.replace(ns,""),(l=as.test(r))&&(r=r.slice(1,-1)),$r(t,r,o,s,!1,0,u[e],l);else{var c=(r=r.replace(rs,"")).match(ls),h=c&&c[1];l=!1,h&&(r=r.slice(0,-(h.length+1)),as.test(h)&&(h=h.slice(1,-1),l=!0)),Br(t,r,i,o,h,l,s,u[e])}else Pr(t,r,JSON.stringify(o),u[e]),!t.component&&"muted"===r&&ts(t.tag,t.attrsMap.type,r)&&Lr(t,r,"true",u[e])}}(t),t}function _s(t){var e;if(e=Hr(t,"v-for")){var n=function(t){var e=t.match(is);if(!e)return;var n={};n.for=e[2].trim();var r=e[1].trim().replace(ss,""),i=r.match(os);i?(n.alias=r.replace(os,"").trim(),n.iterator1=i[1].trim(),i[2]&&(n.iterator2=i[2].trim())):n.alias=r;return n}(e);n&&I(t,n)}}function ys(t,e){t.ifConditions||(t.ifConditions=[]),t.ifConditions.push(e)}function Ts(t){var e=t.name.replace(hs,"");return e||"#"!==t.name[0]&&(e="default"),as.test(e)?{name:e.slice(1,-1),dynamic:!0}:{name:'"'+e+'"',dynamic:!1}}function xs(t){var e=t.match(cs);if(e){var n={};return e.forEach(function(t){n[t.slice(1)]=!0}),n}}var Es=/^xmlns:NS\d+/,ws=/^NS\d+:/;function Cs(t){return ms(t.tag,t.attrsList.slice(),t.parent)}var Ss=[Eo,Co,{preTransformNode:function(t,e){if("input"===t.tag){var n,r=t.attrsMap;if(!r["v-model"])return;if((r[":type"]||r["v-bind:type"])&&(n=Vr(t,"type")),r.type||n||!r["v-bind"]||(n="("+r["v-bind"]+").type"),n){var i=Hr(t,"v-if",!0),o=i?"&&("+i+")":"",s=null!=Hr(t,"v-else",!0),a=Hr(t,"v-else-if",!0),l=Cs(t);_s(l),Fr(l,"type","checkbox"),bs(l,e),l.processed=!0,l.if="("+n+")==='checkbox'"+o,ys(l,{exp:l.if,block:l});var u=Cs(t);Hr(u,"v-for",!0),Fr(u,"type","radio"),bs(u,e),ys(l,{exp:"("+n+")==='radio'"+o,block:u});var c=Cs(t);return Hr(c,"v-for",!0),Fr(c,":type",n),bs(c,e),ys(l,{exp:i,block:c}),s?l.else=!0:a&&(l.elseif=a),l}}}}];var ks,Os,Is={expectHTML:!0,modules:Ss,directives:{model:function(t,e,n){n;var r=e.value,i=e.modifiers,o=t.tag,s=t.attrsMap.type;if(t.component)return zr(t,r,i),!1;if("select"===o)!function(t,e,n){var r='var $$selectedVal = Array.prototype.filter.call($event.target.options,function(o){return o.selected}).map(function(o){var val = "_value" in o ? o._value : o.value;return '+(n&&n.number?"_n(val)":"val")+"});";r=r+" "+Xr(e,"$event.target.multiple ? $$selectedVal : $$selectedVal[0]"),$r(t,"change",r,null,!0)}(t,r,i);else if("input"===o&&"checkbox"===s)!function(t,e,n){var r=n&&n.number,i=Vr(t,"value")||"null",o=Vr(t,"true-value")||"true",s=Vr(t,"false-value")||"false";Lr(t,"checked","Array.isArray("+e+")?_i("+e+","+i+")>-1"+("true"===o?":("+e+")":":_q("+e+","+o+")")),$r(t,"change","var $$a="+e+",$$el=$event.target,$$c=$$el.checked?("+o+"):("+s+");if(Array.isArray($$a)){var $$v="+(r?"_n("+i+")":i)+",$$i=_i($$a,$$v);if($$el.checked){$$i<0&&("+Xr(e,"$$a.concat([$$v])")+")}else{$$i>-1&&("+Xr(e,"$$a.slice(0,$$i).concat($$a.slice($$i+1))")+")}}else{"+Xr(e,"$$c")+"}",null,!0)}(t,r,i);else if("input"===o&&"radio"===s)!function(t,e,n){var r=n&&n.number,i=Vr(t,"value")||"null";Lr(t,"checked","_q("+e+","+(i=r?"_n("+i+")":i)+")"),$r(t,"change",Xr(e,i),null,!0)}(t,r,i);else if("input"===o||"textarea"===o)!function(t,e,n){var r=t.attrsMap.type,i=n||{},o=i.lazy,s=i.number,a=i.trim,l=!o&&"range"!==r,u=o?"change":"range"===r?ti:"input",c="$event.target.value";a&&(c="$event.target.value.trim()"),s&&(c="_n("+c+")");var h=Xr(e,c);l&&(h="if($event.target.composing)return;"+h),Lr(t,"value","("+e+")"),$r(t,u,h,null,!0),(a||s)&&$r(t,"blur","$forceUpdate()")}(t,r,i);else if(!$.isReservedTag(o))return zr(t,r,i),!1;return!0},text:function(t,e){e.value&&Lr(t,"textContent","_s("+e.value+")",e)},html:function(t,e){e.value&&Lr(t,"innerHTML","_s("+e.value+")",e)}},isPreTag:function(t){return"pre"===t},isUnaryTag:ko,mustUseProp:Fn,canBeLeftOpenTag:Oo,isReservedTag:Qn,getTagNamespace:tr,staticKeys:function(t){return t.reduce(function(t,e){return t.concat(e.staticKeys||[])},[]).join(",")}(Ss)},Rs=T(function(t){return g("type,tag,attrsList,attrsMap,plain,parent,children,attrs,start,end,rawAttrsMap"+(t?","+t:""))});function As(t,e){t&&(ks=Rs(e.staticKeys||""),Os=e.isReservedTag||N,function t(e){e.static=function(t){if(2===t.type)return!1;if(3===t.type)return!0;return!(!t.pre&&(t.hasBindings||t.if||t.for||m(t.tag)||!Os(t.tag)||function(t){for(;t.parent;){if("template"!==(t=t.parent).tag)return!1;if(t.for)return!0}return!1}(t)||!Object.keys(t).every(ks)))}(e);if(1===e.type){if(!Os(e.tag)&&"slot"!==e.tag&&null==e.attrsMap["inline-template"])return;for(var n=0,r=e.children.length;n<r;n++){var i=e.children[n];t(i),i.static||(e.static=!1)}if(e.ifConditions)for(var o=1,s=e.ifConditions.length;o<s;o++){var a=e.ifConditions[o].block;t(a),a.static||(e.static=!1)}}}(t),function t(e,n){if(1===e.type){if((e.static||e.once)&&(e.staticInFor=n),e.static&&e.children.length&&(1!==e.children.length||3!==e.children[0].type))return void(e.staticRoot=!0);if(e.staticRoot=!1,e.children)for(var r=0,i=e.children.length;r<i;r++)t(e.children[r],n||!!e.for);if(e.ifConditions)for(var o=1,s=e.ifConditions.length;o<s;o++)t(e.ifConditions[o].block,n)}}(t,!1))}var Ns=/^([\w$_]+|\([^)]*?\))\s*=>|^function(?:\s+[\w$]+)?\s*\(/,Ds=/\([^)]*?\);*$/,Ms=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/,Ls={esc:27,tab:9,enter:13,space:32,up:38,left:37,right:39,down:40,delete:[8,46]},Ps={esc:["Esc","Escape"],tab:"Tab",enter:"Enter",space:[" ","Spacebar"],up:["Up","ArrowUp"],left:["Left","ArrowLeft"],right:["Right","ArrowRight"],down:["Down","ArrowDown"],delete:["Backspace","Delete","Del"]},Fs=function(t){return"if("+t+")return null;"},Bs={stop:"$event.stopPropagation();",prevent:"$event.preventDefault();",self:Fs("$event.target !== $event.currentTarget"),ctrl:Fs("!$event.ctrlKey"),shift:Fs("!$event.shiftKey"),alt:Fs("!$event.altKey"),meta:Fs("!$event.metaKey"),left:Fs("'button' in $event && $event.button !== 0"),middle:Fs("'button' in $event && $event.button !== 1"),right:Fs("'button' in $event && $event.button !== 2")};function js(t,e){var n=e?"nativeOn:":"on:",r="",i="";for(var o in t){var s=$s(t[o]);t[o]&&t[o].dynamic?i+=o+","+s+",":r+='"'+o+'":'+s+","}return r="{"+r.slice(0,-1)+"}",i?n+"_d("+r+",["+i.slice(0,-1)+"])":n+r}function $s(t){if(!t)return"function(){}";if(Array.isArray(t))return"["+t.map(function(t){return $s(t)}).join(",")+"]";var e=Ms.test(t.value),n=Ns.test(t.value),r=Ms.test(t.value.replace(Ds,""));if(t.modifiers){var i="",o="",s=[];for(var a in t.modifiers)if(Bs[a])o+=Bs[a],Ls[a]&&s.push(a);else if("exact"===a){var l=t.modifiers;o+=Fs(["ctrl","shift","alt","meta"].filter(function(t){return!l[t]}).map(function(t){return"$event."+t+"Key"}).join("||"))}else s.push(a);return s.length&&(i+=function(t){return"if(!$event.type.indexOf('key')&&"+t.map(Us).join("&&")+")return null;"}(s)),o&&(i+=o),"function($event){"+i+(e?"return "+t.value+".apply(null, arguments)":n?"return ("+t.value+").apply(null, arguments)":r?"return "+t.value:t.value)+"}"}return e||n?t.value:"function($event){"+(r?"return "+t.value:t.value)+"}"}function Us(t){var e=parseInt(t,10);if(e)return"$event.keyCode!=="+e;var n=Ls[t],r=Ps[t];return"_k($event.keyCode,"+JSON.stringify(t)+","+JSON.stringify(n)+",$event.key,"+JSON.stringify(r)+")"}var Vs={on:function(t,e){t.wrapListeners=function(t){return"_g("+t+","+e.value+")"}},bind:function(t,e){t.wrapData=function(n){return"_b("+n+",'"+t.tag+"',"+e.value+","+(e.modifiers&&e.modifiers.prop?"true":"false")+(e.modifiers&&e.modifiers.sync?",true":"")+")"}},cloak:A},Hs=function(t){this.options=t,this.warn=t.warn||Dr,this.transforms=Mr(t.modules,"transformCode"),this.dataGenFns=Mr(t.modules,"genData"),this.directives=I(I({},Vs),t.directives);var e=t.isReservedTag||N;this.maybeComponent=function(t){return!!t.component||!e(t.tag)},this.onceId=0,this.staticRenderFns=[],this.pre=!1};function Ws(t,e){var n=new Hs(e);return{render:"with(this){return "+(t?"script"===t.tag?"null":Gs(t,n):'_c("div")')+"}",staticRenderFns:n.staticRenderFns}}function Gs(t,e){if(t.parent&&(t.pre=t.pre||t.parent.pre),t.staticRoot&&!t.staticProcessed)return zs(t,e);if(t.once&&!t.onceProcessed)return Xs(t,e);if(t.for&&!t.forProcessed)return Ys(t,e);if(t.if&&!t.ifProcessed)return Ks(t,e);if("template"!==t.tag||t.slotTarget||e.pre){if("slot"===t.tag)return function(t,e){var n=t.slotName||'"default"',r=Qs(t,e),i="_t("+n+(r?",function(){return "+r+"}":""),o=t.attrs||t.dynamicAttrs?na((t.attrs||[]).concat(t.dynamicAttrs||[]).map(function(t){return{name:E(t.name),value:t.value,dynamic:t.dynamic}})):null,s=t.attrsMap["v-bind"];!o&&!s||r||(i+=",null");o&&(i+=","+o);s&&(i+=(o?"":",null")+","+s);return i+")"}(t,e);var n;if(t.component)n=function(t,e,n){var r=e.inlineTemplate?null:Qs(e,n,!0);return"_c("+t+","+qs(e,n)+(r?","+r:"")+")"}(t.component,t,e);else{var r;(!t.plain||t.pre&&e.maybeComponent(t))&&(r=qs(t,e));var i=t.inlineTemplate?null:Qs(t,e,!0);n="_c('"+t.tag+"'"+(r?","+r:"")+(i?","+i:"")+")"}for(var o=0;o<e.transforms.length;o++)n=e.transforms[o](t,n);return n}return Qs(t,e)||"void 0"}function zs(t,e){t.staticProcessed=!0;var n=e.pre;return t.pre&&(e.pre=t.pre),e.staticRenderFns.push("with(this){return "+Gs(t,e)+"}"),e.pre=n,"_m("+(e.staticRenderFns.length-1)+(t.staticInFor?",true":"")+")"}function Xs(t,e){if(t.onceProcessed=!0,t.if&&!t.ifProcessed)return Ks(t,e);if(t.staticInFor){for(var n="",r=t.parent;r;){if(r.for){n=r.key;break}r=r.parent}return n?"_o("+Gs(t,e)+","+e.onceId+++","+n+")":Gs(t,e)}return zs(t,e)}function Ks(t,e,n,r){return t.ifProcessed=!0,function t(e,n,r,i){if(!e.length)return i||"_e()";var o=e.shift();return o.exp?"("+o.exp+")?"+s(o.block)+":"+t(e,n,r,i):""+s(o.block);function s(t){return r?r(t,n):t.once?Xs(t,n):Gs(t,n)}}(t.ifConditions.slice(),e,n,r)}function Ys(t,e,n,r){var i=t.for,o=t.alias,s=t.iterator1?","+t.iterator1:"",a=t.iterator2?","+t.iterator2:"";return t.forProcessed=!0,(r||"_l")+"(("+i+"),function("+o+s+a+"){return "+(n||Gs)(t,e)+"})"}function qs(t,e){var n="{",r=function(t,e){var n=t.directives;if(!n)return;var r,i,o,s,a="directives:[",l=!1;for(r=0,i=n.length;r<i;r++){o=n[r],s=!0;var u=e.directives[o.name];u&&(s=!!u(t,o,e.warn)),s&&(l=!0,a+='{name:"'+o.name+'",rawName:"'+o.rawName+'"'+(o.value?",value:("+o.value+"),expression:"+JSON.stringify(o.value):"")+(o.arg?",arg:"+(o.isDynamicArg?o.arg:'"'+o.arg+'"'):"")+(o.modifiers?",modifiers:"+JSON.stringify(o.modifiers):"")+"},")}if(l)return a.slice(0,-1)+"]"}(t,e);r&&(n+=r+","),t.key&&(n+="key:"+t.key+","),t.ref&&(n+="ref:"+t.ref+","),t.refInFor&&(n+="refInFor:true,"),t.pre&&(n+="pre:true,"),t.component&&(n+='tag:"'+t.tag+'",');for(var i=0;i<e.dataGenFns.length;i++)n+=e.dataGenFns[i](t);if(t.attrs&&(n+="attrs:"+na(t.attrs)+","),t.props&&(n+="domProps:"+na(t.props)+","),t.events&&(n+=js(t.events,!1)+","),t.nativeEvents&&(n+=js(t.nativeEvents,!0)+","),t.slotTarget&&!t.slotScope&&(n+="slot:"+t.slotTarget+","),t.scopedSlots&&(n+=function(t,e,n){var r=t.for||Object.keys(e).some(function(t){var n=e[t];return n.slotTargetDynamic||n.if||n.for||Js(n)}),i=!!t.if;if(!r)for(var o=t.parent;o;){if(o.slotScope&&o.slotScope!==gs||o.for){r=!0;break}o.if&&(i=!0),o=o.parent}var s=Object.keys(e).map(function(t){return Zs(e[t],n)}).join(",");return"scopedSlots:_u(["+s+"]"+(r?",null,true":"")+(!r&&i?",null,false,"+function(t){var e=5381,n=t.length;for(;n;)e=33*e^t.charCodeAt(--n);return e>>>0}(s):"")+")"}(t,t.scopedSlots,e)+","),t.model&&(n+="model:{value:"+t.model.value+",callback:"+t.model.callback+",expression:"+t.model.expression+"},"),t.inlineTemplate){var o=function(t,e){var n=t.children[0];0;if(n&&1===n.type){var r=Ws(n,e.options);return"inlineTemplate:{render:function(){"+r.render+"},staticRenderFns:["+r.staticRenderFns.map(function(t){return"function(){"+t+"}"}).join(",")+"]}"}}(t,e);o&&(n+=o+",")}return n=n.replace(/,$/,"")+"}",t.dynamicAttrs&&(n="_b("+n+',"'+t.tag+'",'+na(t.dynamicAttrs)+")"),t.wrapData&&(n=t.wrapData(n)),t.wrapListeners&&(n=t.wrapListeners(n)),n}function Js(t){return 1===t.type&&("slot"===t.tag||t.children.some(Js))}function Zs(t,e){var n=t.attrsMap["slot-scope"];if(t.if&&!t.ifProcessed&&!n)return Ks(t,e,Zs,"null");if(t.for&&!t.forProcessed)return Ys(t,e,Zs);var r=t.slotScope===gs?"":String(t.slotScope),i="function("+r+"){return "+("template"===t.tag?t.if&&n?"("+t.if+")?"+(Qs(t,e)||"undefined")+":undefined":Qs(t,e)||"undefined":Gs(t,e))+"}",o=r?"":",proxy:true";return"{key:"+(t.slotTarget||'"default"')+",fn:"+i+o+"}"}function Qs(t,e,n,r,i){var o=t.children;if(o.length){var s=o[0];if(1===o.length&&s.for&&"template"!==s.tag&&"slot"!==s.tag){var a=n?e.maybeComponent(s)?",1":",0":"";return""+(r||Gs)(s,e)+a}var l=n?function(t,e){for(var n=0,r=0;r<t.length;r++){var i=t[r];if(1===i.type){if(ta(i)||i.ifConditions&&i.ifConditions.some(function(t){return ta(t.block)})){n=2;break}(e(i)||i.ifConditions&&i.ifConditions.some(function(t){return e(t.block)}))&&(n=1)}}return n}(o,e.maybeComponent):0,u=i||ea;return"["+o.map(function(t){return u(t,e)}).join(",")+"]"+(l?","+l:"")}}function ta(t){return void 0!==t.for||"template"===t.tag||"slot"===t.tag}function ea(t,e){return 1===t.type?Gs(t,e):3===t.type&&t.isComment?(r=t,"_e("+JSON.stringify(r.text)+")"):"_v("+(2===(n=t).type?n.expression:ra(JSON.stringify(n.text)))+")";var n,r}function na(t){for(var e="",n="",r=0;r<t.length;r++){var i=t[r],o=ra(i.value);i.dynamic?n+=i.name+","+o+",":e+='"'+i.name+'":'+o+","}return e="{"+e.slice(0,-1)+"}",n?"_d("+e+",["+n.slice(0,-1)+"])":e}function ra(t){return t.replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}new RegExp("\\b"+"do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,super,throw,while,yield,delete,export,import,return,switch,default,extends,finally,continue,debugger,function,arguments".split(",").join("\\b|\\b")+"\\b"),new RegExp("\\b"+"delete,typeof,void".split(",").join("\\s*\\([^\\)]*\\)|\\b")+"\\s*\\([^\\)]*\\)");function ia(t,e){try{return new Function(t)}catch(n){return e.push({err:n,code:t}),A}}function oa(t){var e=Object.create(null);return function(n,r,i){(r=I({},r)).warn;delete r.warn;var o=r.delimiters?String(r.delimiters)+n:n;if(e[o])return e[o];var s=t(n,r);var a={},l=[];return a.render=ia(s.render,l),a.staticRenderFns=s.staticRenderFns.map(function(t){return ia(t,l)}),e[o]=a}}var sa,aa,la=(sa=function(t,e){var n=vs(t.trim(),e);!1!==e.optimize&&As(n,e);var r=Ws(n,e);return{ast:n,render:r.render,staticRenderFns:r.staticRenderFns}},function(t){function e(e,n){var r=Object.create(t),i=[],o=[],s=function(t,e,n){(n?o:i).push(t)};if(n)for(var a in n.modules&&(r.modules=(t.modules||[]).concat(n.modules)),n.directives&&(r.directives=I(Object.create(t.directives||null),n.directives)),n)"modules"!==a&&"directives"!==a&&(r[a]=n[a]);r.warn=s;var l=sa(e.trim(),r);return l.errors=i,l.tips=o,l}return{compile:e,compileToFunctions:oa(e)}})(Is),ua=(la.compile,la.compileToFunctions);function ca(t){return(aa=aa||document.createElement("div")).innerHTML=t?'<a href="\n"/>':'<div a="\n"/>',aa.innerHTML.indexOf("&#10;")>0}var ha=!!X&&ca(!1),da=!!X&&ca(!0),pa=T(function(t){var e=rr(t);return e&&e.innerHTML}),fa=kn.prototype.$mount;kn.prototype.$mount=function(t,e){if((t=t&&rr(t))===document.body||t===document.documentElement)return this;var n=this.$options;if(!n.render){var r=n.template;if(r)if("string"==typeof r)"#"===r.charAt(0)&&(r=pa(r));else{if(!r.nodeType)return this;r=r.innerHTML}else t&&(r=function(t){if(t.outerHTML)return t.outerHTML;var e=document.createElement("div");return e.appendChild(t.cloneNode(!0)),e.innerHTML}(t));if(r){0;var i=ua(r,{outputSourceRange:!1,shouldDecodeNewlines:ha,shouldDecodeNewlinesForHref:da,delimiters:n.delimiters,comments:n.comments},this),o=i.render,s=i.staticRenderFns;n.render=o,n.staticRenderFns=s}}return fa.call(this,t,e)},kn.compile=ua,e.default=kn}.call(e,n("DuR2"))},"77Pl":function(t,e,n){var r=n("EqjI");t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},"7GwW":function(t,e,n){"use strict";var r=n("cGG2"),i=n("21It"),o=n("p1b6"),s=n("DQCr"),a=n("Oi+a"),l=n("oJlt"),u=n("GHBc"),c=n("FtD3");t.exports=function(t){return new Promise(function(e,n){var h=t.data,d=t.headers;r.isFormData(h)&&delete d["Content-Type"];var p=new XMLHttpRequest;if(t.auth){var f=t.auth.username||"",g=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";d.Authorization="Basic "+btoa(f+":"+g)}var m=a(t.baseURL,t.url);if(p.open(t.method.toUpperCase(),s(m,t.params,t.paramsSerializer),!0),p.timeout=t.timeout,p.onreadystatechange=function(){if(p&&4===p.readyState&&(0!==p.status||p.responseURL&&0===p.responseURL.indexOf("file:"))){var r="getAllResponseHeaders"in p?l(p.getAllResponseHeaders()):null,o={data:t.responseType&&"text"!==t.responseType?p.response:p.responseText,status:p.status,statusText:p.statusText,headers:r,config:t,request:p};i(e,n,o),p=null}},p.onabort=function(){p&&(n(c("Request aborted",t,"ECONNABORTED",p)),p=null)},p.onerror=function(){n(c("Network Error",t,null,p)),p=null},p.ontimeout=function(){var e="timeout of "+t.timeout+"ms exceeded";t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),n(c(e,t,"ECONNABORTED",p)),p=null},r.isStandardBrowserEnv()){var v=(t.withCredentials||u(m))&&t.xsrfCookieName?o.read(t.xsrfCookieName):void 0;v&&(d[t.xsrfHeaderName]=v)}if("setRequestHeader"in p&&r.forEach(d,function(t,e){void 0===h&&"content-type"===e.toLowerCase()?delete d[e]:p.setRequestHeader(e,t)}),r.isUndefined(t.withCredentials)||(p.withCredentials=!!t.withCredentials),t.responseType)try{p.responseType=t.responseType}catch(e){if("json"!==t.responseType)throw e}"function"==typeof t.onDownloadProgress&&p.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&p.upload&&p.upload.addEventListener("progress",t.onUploadProgress),t.cancelToken&&t.cancelToken.promise.then(function(t){p&&(p.abort(),n(t),p=null)}),h||(h=null),p.send(h)})}},"7J9s":function(t,e,n){"use strict";e.__esModule=!0,e.PopupManager=void 0;var r=l(n("7+uW")),i=l(n("jmaC")),o=l(n("OAzY")),s=l(n("6Twh")),a=n("2kvA");function l(t){return t&&t.__esModule?t:{default:t}}var u=1,c=void 0;e.default={props:{visible:{type:Boolean,default:!1},openDelay:{},closeDelay:{},zIndex:{},modal:{type:Boolean,default:!1},modalFade:{type:Boolean,default:!0},modalClass:{},modalAppendToBody:{type:Boolean,default:!1},lockScroll:{type:Boolean,default:!0},closeOnPressEscape:{type:Boolean,default:!1},closeOnClickModal:{type:Boolean,default:!1}},beforeMount:function(){this._popupId="popup-"+u++,o.default.register(this._popupId,this)},beforeDestroy:function(){o.default.deregister(this._popupId),o.default.closeModal(this._popupId),this.restoreBodyStyle()},data:function(){return{opened:!1,bodyPaddingRight:null,computedBodyPaddingRight:0,withoutHiddenClass:!0,rendered:!1}},watch:{visible:function(t){var e=this;if(t){if(this._opening)return;this.rendered?this.open():(this.rendered=!0,r.default.nextTick(function(){e.open()}))}else this.close()}},methods:{open:function(t){var e=this;this.rendered||(this.rendered=!0);var n=(0,i.default)({},this.$props||this,t);this._closeTimer&&(clearTimeout(this._closeTimer),this._closeTimer=null),clearTimeout(this._openTimer);var r=Number(n.openDelay);r>0?this._openTimer=setTimeout(function(){e._openTimer=null,e.doOpen(n)},r):this.doOpen(n)},doOpen:function(t){if(!this.$isServer&&(!this.willOpen||this.willOpen())&&!this.opened){this._opening=!0;var e=this.$el,n=t.modal,r=t.zIndex;if(r&&(o.default.zIndex=r),n&&(this._closing&&(o.default.closeModal(this._popupId),this._closing=!1),o.default.openModal(this._popupId,o.default.nextZIndex(),this.modalAppendToBody?void 0:e,t.modalClass,t.modalFade),t.lockScroll)){this.withoutHiddenClass=!(0,a.hasClass)(document.body,"el-popup-parent--hidden"),this.withoutHiddenClass&&(this.bodyPaddingRight=document.body.style.paddingRight,this.computedBodyPaddingRight=parseInt((0,a.getStyle)(document.body,"paddingRight"),10)),c=(0,s.default)();var i=document.documentElement.clientHeight<document.body.scrollHeight,l=(0,a.getStyle)(document.body,"overflowY");c>0&&(i||"scroll"===l)&&this.withoutHiddenClass&&(document.body.style.paddingRight=this.computedBodyPaddingRight+c+"px"),(0,a.addClass)(document.body,"el-popup-parent--hidden")}"static"===getComputedStyle(e).position&&(e.style.position="absolute"),e.style.zIndex=o.default.nextZIndex(),this.opened=!0,this.onOpen&&this.onOpen(),this.doAfterOpen()}},doAfterOpen:function(){this._opening=!1},close:function(){var t=this;if(!this.willClose||this.willClose()){null!==this._openTimer&&(clearTimeout(this._openTimer),this._openTimer=null),clearTimeout(this._closeTimer);var e=Number(this.closeDelay);e>0?this._closeTimer=setTimeout(function(){t._closeTimer=null,t.doClose()},e):this.doClose()}},doClose:function(){this._closing=!0,this.onClose&&this.onClose(),this.lockScroll&&setTimeout(this.restoreBodyStyle,200),this.opened=!1,this.doAfterClose()},doAfterClose:function(){o.default.closeModal(this._popupId),this._closing=!1},restoreBodyStyle:function(){this.modal&&this.withoutHiddenClass&&(document.body.style.paddingRight=this.bodyPaddingRight,(0,a.removeClass)(document.body,"el-popup-parent--hidden")),this.withoutHiddenClass=!0}}},e.PopupManager=o.default},"7KvD":function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},"7Mdl":function(t,e,n){"use strict";
  139. /**
  140. * @license
  141. * Copyright 2019 Google LLC. All Rights Reserved.
  142. * Licensed under the Apache License, Version 2.0 (the "License");
  143. * you may not use this file except in compliance with the License.
  144. * You may obtain a copy of the License at
  145. *
  146. * http://www.apache.org/licenses/LICENSE-2.0
  147. *
  148. * Unless required by applicable law or agreed to in writing, software
  149. * distributed under the License is distributed on an "AS IS" BASIS,
  150. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  151. * See the License for the specific language governing permissions and
  152. * limitations under the License.
  153. * =============================================================================
  154. */function r(t,e,n){const r=function(t,e,n){return function(t,e,n){let r=0,i=t.length,o=0,s=!1;for(;r<i;){const a=n(e,t[o=r+(i-r>>>1)]);a>0?r=o+1:(i=o,s=!a)}return s?r:-r-1}(t,e,n||i)}(t,e,n),o=r<0?-(r+1):r;t.splice(o,0,e)}function i(t,e){return t>e?1:t<e?-1:0}function o(t,e,n,i,o,u,c=!1,h=!1,d=!1){const p=[];for(let t=0;t<e.length;t++)e[t]>o&&p.push({score:e[t],boxIndex:t,suppressBeginIndex:0});p.sort(l);const f=u>0?-.5/u:0,g=[],m=[];for(;g.length<n&&p.length>0;){const e=p.pop(),{score:n,boxIndex:u,suppressBeginIndex:c}=e;if(n<o)break;let h=!1;for(let n=g.length-1;n>=c;--n){const r=s(t,u,g[n]);if(r>=i){h=!0;break}if(e.score=e.score*a(i,f,r),e.score<=o)break}e.suppressBeginIndex=g.length,h||(e.score===n?(g.push(u),m.push(e.score)):e.score>o&&r(p,e,l))}const v=g.length,b=n-v;h&&b>0&&(g.push(...new Array(b).fill(0)),m.push(...new Array(b).fill(0)));const _={selectedIndices:g};return c&&(_.selectedScores=m),d&&(_.validOutputs=v),_}function s(t,e,n){const r=t.subarray(4*e,4*e+4),i=t.subarray(4*n,4*n+4),o=Math.min(r[0],r[2]),s=Math.min(r[1],r[3]),a=Math.max(r[0],r[2]),l=Math.max(r[1],r[3]),u=Math.min(i[0],i[2]),c=Math.min(i[1],i[3]),h=Math.max(i[0],i[2]),d=Math.max(i[1],i[3]),p=(a-o)*(l-s),f=(h-u)*(d-c);if(p<=0||f<=0)return 0;const g=Math.max(o,u),m=Math.max(s,c),v=Math.min(a,h),b=Math.min(l,d),_=Math.max(v-g,0)*Math.max(b-m,0);return _/(p+f-_)}function a(t,e,n){const r=Math.exp(e*n*n);return n<=t?r:0}function l(t,e){return t.score-e.score||t.score===e.score&&e.boxIndex-t.boxIndex}e.a=
  155. /**
  156. * @license
  157. * Copyright 2020 Google LLC. All Rights Reserved.
  158. * Licensed under the Apache License, Version 2.0 (the "License");
  159. * you may not use this file except in compliance with the License.
  160. * You may obtain a copy of the License at
  161. *
  162. * http://www.apache.org/licenses/LICENSE-2.0
  163. *
  164. * Unless required by applicable law or agreed to in writing, software
  165. * distributed under the License is distributed on an "AS IS" BASIS,
  166. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  167. * See the License for the specific language governing permissions and
  168. * limitations under the License.
  169. * =============================================================================
  170. */
  171. function(t,e,n,r,i){return o(t,e,n,r,i,0)},e.b=function(t,e,n,r,i,s){return o(t,e,n,r,i,0,!1,s,!0)},e.c=function(t,e,n,r,i,s){return o(t,e,n,r,i,s,!0)}},"7UMu":function(t,e,n){var r=n("R9M2");t.exports=Array.isArray||function(t){return"Array"==r(t)}},"7t+N":function(t,e,n){var r;
  172. /*!
  173. * jQuery JavaScript Library v3.6.0
  174. * https://jquery.com/
  175. *
  176. * Includes Sizzle.js
  177. * https://sizzlejs.com/
  178. *
  179. * Copyright OpenJS Foundation and other contributors
  180. * Released under the MIT license
  181. * https://jquery.org/license
  182. *
  183. * Date: 2021-03-02T17:08Z
  184. */
  185. /*!
  186. * jQuery JavaScript Library v3.6.0
  187. * https://jquery.com/
  188. *
  189. * Includes Sizzle.js
  190. * https://sizzlejs.com/
  191. *
  192. * Copyright OpenJS Foundation and other contributors
  193. * Released under the MIT license
  194. * https://jquery.org/license
  195. *
  196. * Date: 2021-03-02T17:08Z
  197. */
  198. !function(e,n){"use strict";"object"==typeof t&&"object"==typeof t.exports?t.exports=e.document?n(e,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return n(t)}:n(e)}("undefined"!=typeof window?window:this,function(n,i){"use strict";var o=[],s=Object.getPrototypeOf,a=o.slice,l=o.flat?function(t){return o.flat.call(t)}:function(t){return o.concat.apply([],t)},u=o.push,c=o.indexOf,h={},d=h.toString,p=h.hasOwnProperty,f=p.toString,g=f.call(Object),m={},v=function(t){return"function"==typeof t&&"number"!=typeof t.nodeType&&"function"!=typeof t.item},b=function(t){return null!=t&&t===t.window},_=n.document,y={type:!0,src:!0,nonce:!0,noModule:!0};function T(t,e,n){var r,i,o=(n=n||_).createElement("script");if(o.text=t,e)for(r in y)(i=e[r]||e.getAttribute&&e.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function x(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?h[d.call(t)]||"object":typeof t}var E=function(t,e){return new E.fn.init(t,e)};function w(t){var e=!!t&&"length"in t&&t.length,n=x(t);return!v(t)&&!b(t)&&("array"===n||0===e||"number"==typeof e&&e>0&&e-1 in t)}E.fn=E.prototype={jquery:"3.6.0",constructor:E,length:0,toArray:function(){return a.call(this)},get:function(t){return null==t?a.call(this):t<0?this[t+this.length]:this[t]},pushStack:function(t){var e=E.merge(this.constructor(),t);return e.prevObject=this,e},each:function(t){return E.each(this,t)},map:function(t){return this.pushStack(E.map(this,function(e,n){return t.call(e,n,e)}))},slice:function(){return this.pushStack(a.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(E.grep(this,function(t,e){return(e+1)%2}))},odd:function(){return this.pushStack(E.grep(this,function(t,e){return e%2}))},eq:function(t){var e=this.length,n=+t+(t<0?e:0);return this.pushStack(n>=0&&n<e?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:u,sort:o.sort,splice:o.splice},E.extend=E.fn.extend=function(){var t,e,n,r,i,o,s=arguments[0]||{},a=1,l=arguments.length,u=!1;for("boolean"==typeof s&&(u=s,s=arguments[a]||{},a++),"object"==typeof s||v(s)||(s={}),a===l&&(s=this,a--);a<l;a++)if(null!=(t=arguments[a]))for(e in t)r=t[e],"__proto__"!==e&&s!==r&&(u&&r&&(E.isPlainObject(r)||(i=Array.isArray(r)))?(n=s[e],o=i&&!Array.isArray(n)?[]:i||E.isPlainObject(n)?n:{},i=!1,s[e]=E.extend(u,o,r)):void 0!==r&&(s[e]=r));return s},E.extend({expando:"jQuery"+("3.6.0"+Math.random()).replace(/\D/g,""),isReady:!0,error:function(t){throw new Error(t)},noop:function(){},isPlainObject:function(t){var e,n;return!(!t||"[object Object]"!==d.call(t))&&(!(e=s(t))||"function"==typeof(n=p.call(e,"constructor")&&e.constructor)&&f.call(n)===g)},isEmptyObject:function(t){var e;for(e in t)return!1;return!0},globalEval:function(t,e,n){T(t,{nonce:e&&e.nonce},n)},each:function(t,e){var n,r=0;if(w(t))for(n=t.length;r<n&&!1!==e.call(t[r],r,t[r]);r++);else for(r in t)if(!1===e.call(t[r],r,t[r]))break;return t},makeArray:function(t,e){var n=e||[];return null!=t&&(w(Object(t))?E.merge(n,"string"==typeof t?[t]:t):u.call(n,t)),n},inArray:function(t,e,n){return null==e?-1:c.call(e,t,n)},merge:function(t,e){for(var n=+e.length,r=0,i=t.length;r<n;r++)t[i++]=e[r];return t.length=i,t},grep:function(t,e,n){for(var r=[],i=0,o=t.length,s=!n;i<o;i++)!e(t[i],i)!==s&&r.push(t[i]);return r},map:function(t,e,n){var r,i,o=0,s=[];if(w(t))for(r=t.length;o<r;o++)null!=(i=e(t[o],o,n))&&s.push(i);else for(o in t)null!=(i=e(t[o],o,n))&&s.push(i);return l(s)},guid:1,support:m}),"function"==typeof Symbol&&(E.fn[Symbol.iterator]=o[Symbol.iterator]),E.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(t,e){h["[object "+e+"]"]=e.toLowerCase()});var C=
  199. /*!
  200. * Sizzle CSS Selector Engine v2.3.6
  201. * https://sizzlejs.com/
  202. *
  203. * Copyright JS Foundation and other contributors
  204. * Released under the MIT license
  205. * https://js.foundation/
  206. *
  207. * Date: 2021-02-16
  208. */
  209. function(t){var e,n,r,i,o,s,a,l,u,c,h,d,p,f,g,m,v,b,_,y="sizzle"+1*new Date,T=t.document,x=0,E=0,w=lt(),C=lt(),S=lt(),k=lt(),O=function(t,e){return t===e&&(h=!0),0},I={}.hasOwnProperty,R=[],A=R.pop,N=R.push,D=R.push,M=R.slice,L=function(t,e){for(var n=0,r=t.length;n<r;n++)if(t[n]===e)return n;return-1},P="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",F="[\\x20\\t\\r\\n\\f]",B="(?:\\\\[\\da-fA-F]{1,6}"+F+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",j="\\["+F+"*("+B+")(?:"+F+"*([*^$|!~]?=)"+F+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+B+"))|)"+F+"*\\]",$=":("+B+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+j+")*)|.*)\\)|)",U=new RegExp(F+"+","g"),V=new RegExp("^"+F+"+|((?:^|[^\\\\])(?:\\\\.)*)"+F+"+$","g"),H=new RegExp("^"+F+"*,"+F+"*"),W=new RegExp("^"+F+"*([>+~]|"+F+")"+F+"*"),G=new RegExp(F+"|>"),z=new RegExp($),X=new RegExp("^"+B+"$"),K={ID:new RegExp("^#("+B+")"),CLASS:new RegExp("^\\.("+B+")"),TAG:new RegExp("^("+B+"|[*])"),ATTR:new RegExp("^"+j),PSEUDO:new RegExp("^"+$),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+F+"*(even|odd|(([+-]|)(\\d*)n|)"+F+"*(?:([+-]|)"+F+"*(\\d+)|))"+F+"*\\)|)","i"),bool:new RegExp("^(?:"+P+")$","i"),needsContext:new RegExp("^"+F+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+F+"*((?:-\\d)?\\d*)"+F+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,Z=/^[^{]+\{\s*\[native \w/,Q=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,tt=/[+~]/,et=new RegExp("\\\\[\\da-fA-F]{1,6}"+F+"?|\\\\([^\\r\\n\\f])","g"),nt=function(t,e){var n="0x"+t.slice(1)-65536;return e||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},rt=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,it=function(t,e){return e?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t},ot=function(){d()},st=yt(function(t){return!0===t.disabled&&"fieldset"===t.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{D.apply(R=M.call(T.childNodes),T.childNodes),R[T.childNodes.length].nodeType}catch(t){D={apply:R.length?function(t,e){N.apply(t,M.call(e))}:function(t,e){for(var n=t.length,r=0;t[n++]=e[r++];);t.length=n-1}}}function at(t,e,r,i){var o,a,u,c,h,f,v,b=e&&e.ownerDocument,T=e?e.nodeType:9;if(r=r||[],"string"!=typeof t||!t||1!==T&&9!==T&&11!==T)return r;if(!i&&(d(e),e=e||p,g)){if(11!==T&&(h=Q.exec(t)))if(o=h[1]){if(9===T){if(!(u=e.getElementById(o)))return r;if(u.id===o)return r.push(u),r}else if(b&&(u=b.getElementById(o))&&_(e,u)&&u.id===o)return r.push(u),r}else{if(h[2])return D.apply(r,e.getElementsByTagName(t)),r;if((o=h[3])&&n.getElementsByClassName&&e.getElementsByClassName)return D.apply(r,e.getElementsByClassName(o)),r}if(n.qsa&&!k[t+" "]&&(!m||!m.test(t))&&(1!==T||"object"!==e.nodeName.toLowerCase())){if(v=t,b=e,1===T&&(G.test(t)||W.test(t))){for((b=tt.test(t)&&vt(e.parentNode)||e)===e&&n.scope||((c=e.getAttribute("id"))?c=c.replace(rt,it):e.setAttribute("id",c=y)),a=(f=s(t)).length;a--;)f[a]=(c?"#"+c:":scope")+" "+_t(f[a]);v=f.join(",")}try{return D.apply(r,b.querySelectorAll(v)),r}catch(e){k(t,!0)}finally{c===y&&e.removeAttribute("id")}}}return l(t.replace(V,"$1"),e,r,i)}function lt(){var t=[];return function e(n,i){return t.push(n+" ")>r.cacheLength&&delete e[t.shift()],e[n+" "]=i}}function ut(t){return t[y]=!0,t}function ct(t){var e=p.createElement("fieldset");try{return!!t(e)}catch(t){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function ht(t,e){for(var n=t.split("|"),i=n.length;i--;)r.attrHandle[n[i]]=e}function dt(t,e){var n=e&&t,r=n&&1===t.nodeType&&1===e.nodeType&&t.sourceIndex-e.sourceIndex;if(r)return r;if(n)for(;n=n.nextSibling;)if(n===e)return-1;return t?1:-1}function pt(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function ft(t){return function(e){var n=e.nodeName.toLowerCase();return("input"===n||"button"===n)&&e.type===t}}function gt(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&st(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function mt(t){return ut(function(e){return e=+e,ut(function(n,r){for(var i,o=t([],n.length,e),s=o.length;s--;)n[i=o[s]]&&(n[i]=!(r[i]=n[i]))})})}function vt(t){return t&&void 0!==t.getElementsByTagName&&t}for(e in n=at.support={},o=at.isXML=function(t){var e=t&&t.namespaceURI,n=t&&(t.ownerDocument||t).documentElement;return!Y.test(e||n&&n.nodeName||"HTML")},d=at.setDocument=function(t){var e,i,s=t?t.ownerDocument||t:T;return s!=p&&9===s.nodeType&&s.documentElement?(f=(p=s).documentElement,g=!o(p),T!=p&&(i=p.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",ot,!1):i.attachEvent&&i.attachEvent("onunload",ot)),n.scope=ct(function(t){return f.appendChild(t).appendChild(p.createElement("div")),void 0!==t.querySelectorAll&&!t.querySelectorAll(":scope fieldset div").length}),n.attributes=ct(function(t){return t.className="i",!t.getAttribute("className")}),n.getElementsByTagName=ct(function(t){return t.appendChild(p.createComment("")),!t.getElementsByTagName("*").length}),n.getElementsByClassName=Z.test(p.getElementsByClassName),n.getById=ct(function(t){return f.appendChild(t).id=y,!p.getElementsByName||!p.getElementsByName(y).length}),n.getById?(r.filter.ID=function(t){var e=t.replace(et,nt);return function(t){return t.getAttribute("id")===e}},r.find.ID=function(t,e){if(void 0!==e.getElementById&&g){var n=e.getElementById(t);return n?[n]:[]}}):(r.filter.ID=function(t){var e=t.replace(et,nt);return function(t){var n=void 0!==t.getAttributeNode&&t.getAttributeNode("id");return n&&n.value===e}},r.find.ID=function(t,e){if(void 0!==e.getElementById&&g){var n,r,i,o=e.getElementById(t);if(o){if((n=o.getAttributeNode("id"))&&n.value===t)return[o];for(i=e.getElementsByName(t),r=0;o=i[r++];)if((n=o.getAttributeNode("id"))&&n.value===t)return[o]}return[]}}),r.find.TAG=n.getElementsByTagName?function(t,e){return void 0!==e.getElementsByTagName?e.getElementsByTagName(t):n.qsa?e.querySelectorAll(t):void 0}:function(t,e){var n,r=[],i=0,o=e.getElementsByTagName(t);if("*"===t){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},r.find.CLASS=n.getElementsByClassName&&function(t,e){if(void 0!==e.getElementsByClassName&&g)return e.getElementsByClassName(t)},v=[],m=[],(n.qsa=Z.test(p.querySelectorAll))&&(ct(function(t){var e;f.appendChild(t).innerHTML="<a id='"+y+"'></a><select id='"+y+"-\r\\' msallowcapture=''><option selected=''></option></select>",t.querySelectorAll("[msallowcapture^='']").length&&m.push("[*^$]="+F+"*(?:''|\"\")"),t.querySelectorAll("[selected]").length||m.push("\\["+F+"*(?:value|"+P+")"),t.querySelectorAll("[id~="+y+"-]").length||m.push("~="),(e=p.createElement("input")).setAttribute("name",""),t.appendChild(e),t.querySelectorAll("[name='']").length||m.push("\\["+F+"*name"+F+"*="+F+"*(?:''|\"\")"),t.querySelectorAll(":checked").length||m.push(":checked"),t.querySelectorAll("a#"+y+"+*").length||m.push(".#.+[+~]"),t.querySelectorAll("\\\f"),m.push("[\\r\\n\\f]")}),ct(function(t){t.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var e=p.createElement("input");e.setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),t.querySelectorAll("[name=d]").length&&m.push("name"+F+"*[*^$|!~]?="),2!==t.querySelectorAll(":enabled").length&&m.push(":enabled",":disabled"),f.appendChild(t).disabled=!0,2!==t.querySelectorAll(":disabled").length&&m.push(":enabled",":disabled"),t.querySelectorAll("*,:x"),m.push(",.*:")})),(n.matchesSelector=Z.test(b=f.matches||f.webkitMatchesSelector||f.mozMatchesSelector||f.oMatchesSelector||f.msMatchesSelector))&&ct(function(t){n.disconnectedMatch=b.call(t,"*"),b.call(t,"[s!='']:x"),v.push("!=",$)}),m=m.length&&new RegExp(m.join("|")),v=v.length&&new RegExp(v.join("|")),e=Z.test(f.compareDocumentPosition),_=e||Z.test(f.contains)?function(t,e){var n=9===t.nodeType?t.documentElement:t,r=e&&e.parentNode;return t===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):t.compareDocumentPosition&&16&t.compareDocumentPosition(r)))}:function(t,e){if(e)for(;e=e.parentNode;)if(e===t)return!0;return!1},O=e?function(t,e){if(t===e)return h=!0,0;var r=!t.compareDocumentPosition-!e.compareDocumentPosition;return r||(1&(r=(t.ownerDocument||t)==(e.ownerDocument||e)?t.compareDocumentPosition(e):1)||!n.sortDetached&&e.compareDocumentPosition(t)===r?t==p||t.ownerDocument==T&&_(T,t)?-1:e==p||e.ownerDocument==T&&_(T,e)?1:c?L(c,t)-L(c,e):0:4&r?-1:1)}:function(t,e){if(t===e)return h=!0,0;var n,r=0,i=t.parentNode,o=e.parentNode,s=[t],a=[e];if(!i||!o)return t==p?-1:e==p?1:i?-1:o?1:c?L(c,t)-L(c,e):0;if(i===o)return dt(t,e);for(n=t;n=n.parentNode;)s.unshift(n);for(n=e;n=n.parentNode;)a.unshift(n);for(;s[r]===a[r];)r++;return r?dt(s[r],a[r]):s[r]==T?-1:a[r]==T?1:0},p):p},at.matches=function(t,e){return at(t,null,null,e)},at.matchesSelector=function(t,e){if(d(t),n.matchesSelector&&g&&!k[e+" "]&&(!v||!v.test(e))&&(!m||!m.test(e)))try{var r=b.call(t,e);if(r||n.disconnectedMatch||t.document&&11!==t.document.nodeType)return r}catch(t){k(e,!0)}return at(e,p,null,[t]).length>0},at.contains=function(t,e){return(t.ownerDocument||t)!=p&&d(t),_(t,e)},at.attr=function(t,e){(t.ownerDocument||t)!=p&&d(t);var i=r.attrHandle[e.toLowerCase()],o=i&&I.call(r.attrHandle,e.toLowerCase())?i(t,e,!g):void 0;return void 0!==o?o:n.attributes||!g?t.getAttribute(e):(o=t.getAttributeNode(e))&&o.specified?o.value:null},at.escape=function(t){return(t+"").replace(rt,it)},at.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},at.uniqueSort=function(t){var e,r=[],i=0,o=0;if(h=!n.detectDuplicates,c=!n.sortStable&&t.slice(0),t.sort(O),h){for(;e=t[o++];)e===t[o]&&(i=r.push(o));for(;i--;)t.splice(r[i],1)}return c=null,t},i=at.getText=function(t){var e,n="",r=0,o=t.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)n+=i(t)}else if(3===o||4===o)return t.nodeValue}else for(;e=t[r++];)n+=i(e);return n},(r=at.selectors={cacheLength:50,createPseudo:ut,match:K,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(et,nt),t[3]=(t[3]||t[4]||t[5]||"").replace(et,nt),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||at.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&at.error(t[0]),t},PSEUDO:function(t){var e,n=!t[6]&&t[2];return K.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&z.test(n)&&(e=s(n,!0))&&(e=n.indexOf(")",n.length-e)-n.length)&&(t[0]=t[0].slice(0,e),t[2]=n.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(et,nt).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=w[t+" "];return e||(e=new RegExp("(^|"+F+")"+t+"("+F+"|$)"))&&w(t,function(t){return e.test("string"==typeof t.className&&t.className||void 0!==t.getAttribute&&t.getAttribute("class")||"")})},ATTR:function(t,e,n){return function(r){var i=at.attr(r,t);return null==i?"!="===e:!e||(i+="","="===e?i===n:"!="===e?i!==n:"^="===e?n&&0===i.indexOf(n):"*="===e?n&&i.indexOf(n)>-1:"$="===e?n&&i.slice(-n.length)===n:"~="===e?(" "+i.replace(U," ")+" ").indexOf(n)>-1:"|="===e&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(t,e,n,r,i){var o="nth"!==t.slice(0,3),s="last"!==t.slice(-4),a="of-type"===e;return 1===r&&0===i?function(t){return!!t.parentNode}:function(e,n,l){var u,c,h,d,p,f,g=o!==s?"nextSibling":"previousSibling",m=e.parentNode,v=a&&e.nodeName.toLowerCase(),b=!l&&!a,_=!1;if(m){if(o){for(;g;){for(d=e;d=d[g];)if(a?d.nodeName.toLowerCase()===v:1===d.nodeType)return!1;f=g="only"===t&&!f&&"nextSibling"}return!0}if(f=[s?m.firstChild:m.lastChild],s&&b){for(_=(p=(u=(c=(h=(d=m)[y]||(d[y]={}))[d.uniqueID]||(h[d.uniqueID]={}))[t]||[])[0]===x&&u[1])&&u[2],d=p&&m.childNodes[p];d=++p&&d&&d[g]||(_=p=0)||f.pop();)if(1===d.nodeType&&++_&&d===e){c[t]=[x,p,_];break}}else if(b&&(_=p=(u=(c=(h=(d=e)[y]||(d[y]={}))[d.uniqueID]||(h[d.uniqueID]={}))[t]||[])[0]===x&&u[1]),!1===_)for(;(d=++p&&d&&d[g]||(_=p=0)||f.pop())&&((a?d.nodeName.toLowerCase()!==v:1!==d.nodeType)||!++_||(b&&((c=(h=d[y]||(d[y]={}))[d.uniqueID]||(h[d.uniqueID]={}))[t]=[x,_]),d!==e)););return(_-=i)===r||_%r==0&&_/r>=0}}},PSEUDO:function(t,e){var n,i=r.pseudos[t]||r.setFilters[t.toLowerCase()]||at.error("unsupported pseudo: "+t);return i[y]?i(e):i.length>1?(n=[t,t,"",e],r.setFilters.hasOwnProperty(t.toLowerCase())?ut(function(t,n){for(var r,o=i(t,e),s=o.length;s--;)t[r=L(t,o[s])]=!(n[r]=o[s])}):function(t){return i(t,0,n)}):i}},pseudos:{not:ut(function(t){var e=[],n=[],r=a(t.replace(V,"$1"));return r[y]?ut(function(t,e,n,i){for(var o,s=r(t,null,i,[]),a=t.length;a--;)(o=s[a])&&(t[a]=!(e[a]=o))}):function(t,i,o){return e[0]=t,r(e,null,o,n),e[0]=null,!n.pop()}}),has:ut(function(t){return function(e){return at(t,e).length>0}}),contains:ut(function(t){return t=t.replace(et,nt),function(e){return(e.textContent||i(e)).indexOf(t)>-1}}),lang:ut(function(t){return X.test(t||"")||at.error("unsupported lang: "+t),t=t.replace(et,nt).toLowerCase(),function(e){var n;do{if(n=g?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(n=n.toLowerCase())===t||0===n.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var n=t.location&&t.location.hash;return n&&n.slice(1)===e.id},root:function(t){return t===f},focus:function(t){return t===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:gt(!1),disabled:gt(!0),checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!r.pseudos.empty(t)},header:function(t){return J.test(t.nodeName)},input:function(t){return q.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:mt(function(){return[0]}),last:mt(function(t,e){return[e-1]}),eq:mt(function(t,e,n){return[n<0?n+e:n]}),even:mt(function(t,e){for(var n=0;n<e;n+=2)t.push(n);return t}),odd:mt(function(t,e){for(var n=1;n<e;n+=2)t.push(n);return t}),lt:mt(function(t,e,n){for(var r=n<0?n+e:n>e?e:n;--r>=0;)t.push(r);return t}),gt:mt(function(t,e,n){for(var r=n<0?n+e:n;++r<e;)t.push(r);return t})}}).pseudos.nth=r.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})r.pseudos[e]=pt(e);for(e in{submit:!0,reset:!0})r.pseudos[e]=ft(e);function bt(){}function _t(t){for(var e=0,n=t.length,r="";e<n;e++)r+=t[e].value;return r}function yt(t,e,n){var r=e.dir,i=e.next,o=i||r,s=n&&"parentNode"===o,a=E++;return e.first?function(e,n,i){for(;e=e[r];)if(1===e.nodeType||s)return t(e,n,i);return!1}:function(e,n,l){var u,c,h,d=[x,a];if(l){for(;e=e[r];)if((1===e.nodeType||s)&&t(e,n,l))return!0}else for(;e=e[r];)if(1===e.nodeType||s)if(c=(h=e[y]||(e[y]={}))[e.uniqueID]||(h[e.uniqueID]={}),i&&i===e.nodeName.toLowerCase())e=e[r]||e;else{if((u=c[o])&&u[0]===x&&u[1]===a)return d[2]=u[2];if(c[o]=d,d[2]=t(e,n,l))return!0}return!1}}function Tt(t){return t.length>1?function(e,n,r){for(var i=t.length;i--;)if(!t[i](e,n,r))return!1;return!0}:t[0]}function xt(t,e,n,r,i){for(var o,s=[],a=0,l=t.length,u=null!=e;a<l;a++)(o=t[a])&&(n&&!n(o,r,i)||(s.push(o),u&&e.push(a)));return s}function Et(t,e,n,r,i,o){return r&&!r[y]&&(r=Et(r)),i&&!i[y]&&(i=Et(i,o)),ut(function(o,s,a,l){var u,c,h,d=[],p=[],f=s.length,g=o||function(t,e,n){for(var r=0,i=e.length;r<i;r++)at(t,e[r],n);return n}(e||"*",a.nodeType?[a]:a,[]),m=!t||!o&&e?g:xt(g,d,t,a,l),v=n?i||(o?t:f||r)?[]:s:m;if(n&&n(m,v,a,l),r)for(u=xt(v,p),r(u,[],a,l),c=u.length;c--;)(h=u[c])&&(v[p[c]]=!(m[p[c]]=h));if(o){if(i||t){if(i){for(u=[],c=v.length;c--;)(h=v[c])&&u.push(m[c]=h);i(null,v=[],u,l)}for(c=v.length;c--;)(h=v[c])&&(u=i?L(o,h):d[c])>-1&&(o[u]=!(s[u]=h))}}else v=xt(v===s?v.splice(f,v.length):v),i?i(null,s,v,l):D.apply(s,v)})}function wt(t){for(var e,n,i,o=t.length,s=r.relative[t[0].type],a=s||r.relative[" "],l=s?1:0,c=yt(function(t){return t===e},a,!0),h=yt(function(t){return L(e,t)>-1},a,!0),d=[function(t,n,r){var i=!s&&(r||n!==u)||((e=n).nodeType?c(t,n,r):h(t,n,r));return e=null,i}];l<o;l++)if(n=r.relative[t[l].type])d=[yt(Tt(d),n)];else{if((n=r.filter[t[l].type].apply(null,t[l].matches))[y]){for(i=++l;i<o&&!r.relative[t[i].type];i++);return Et(l>1&&Tt(d),l>1&&_t(t.slice(0,l-1).concat({value:" "===t[l-2].type?"*":""})).replace(V,"$1"),n,l<i&&wt(t.slice(l,i)),i<o&&wt(t=t.slice(i)),i<o&&_t(t))}d.push(n)}return Tt(d)}return bt.prototype=r.filters=r.pseudos,r.setFilters=new bt,s=at.tokenize=function(t,e){var n,i,o,s,a,l,u,c=C[t+" "];if(c)return e?0:c.slice(0);for(a=t,l=[],u=r.preFilter;a;){for(s in n&&!(i=H.exec(a))||(i&&(a=a.slice(i[0].length)||a),l.push(o=[])),n=!1,(i=W.exec(a))&&(n=i.shift(),o.push({value:n,type:i[0].replace(V," ")}),a=a.slice(n.length)),r.filter)!(i=K[s].exec(a))||u[s]&&!(i=u[s](i))||(n=i.shift(),o.push({value:n,type:s,matches:i}),a=a.slice(n.length));if(!n)break}return e?a.length:a?at.error(t):C(t,l).slice(0)},a=at.compile=function(t,e){var n,i=[],o=[],a=S[t+" "];if(!a){for(e||(e=s(t)),n=e.length;n--;)(a=wt(e[n]))[y]?i.push(a):o.push(a);(a=S(t,function(t,e){var n=e.length>0,i=t.length>0,o=function(o,s,a,l,c){var h,f,m,v=0,b="0",_=o&&[],y=[],T=u,E=o||i&&r.find.TAG("*",c),w=x+=null==T?1:Math.random()||.1,C=E.length;for(c&&(u=s==p||s||c);b!==C&&null!=(h=E[b]);b++){if(i&&h){for(f=0,s||h.ownerDocument==p||(d(h),a=!g);m=t[f++];)if(m(h,s||p,a)){l.push(h);break}c&&(x=w)}n&&((h=!m&&h)&&v--,o&&_.push(h))}if(v+=b,n&&b!==v){for(f=0;m=e[f++];)m(_,y,s,a);if(o){if(v>0)for(;b--;)_[b]||y[b]||(y[b]=A.call(l));y=xt(y)}D.apply(l,y),c&&!o&&y.length>0&&v+e.length>1&&at.uniqueSort(l)}return c&&(x=w,u=T),_};return n?ut(o):o}(o,i))).selector=t}return a},l=at.select=function(t,e,n,i){var o,l,u,c,h,d="function"==typeof t&&t,p=!i&&s(t=d.selector||t);if(n=n||[],1===p.length){if((l=p[0]=p[0].slice(0)).length>2&&"ID"===(u=l[0]).type&&9===e.nodeType&&g&&r.relative[l[1].type]){if(!(e=(r.find.ID(u.matches[0].replace(et,nt),e)||[])[0]))return n;d&&(e=e.parentNode),t=t.slice(l.shift().value.length)}for(o=K.needsContext.test(t)?0:l.length;o--&&(u=l[o],!r.relative[c=u.type]);)if((h=r.find[c])&&(i=h(u.matches[0].replace(et,nt),tt.test(l[0].type)&&vt(e.parentNode)||e))){if(l.splice(o,1),!(t=i.length&&_t(l)))return D.apply(n,i),n;break}}return(d||a(t,p))(i,e,!g,n,!e||tt.test(t)&&vt(e.parentNode)||e),n},n.sortStable=y.split("").sort(O).join("")===y,n.detectDuplicates=!!h,d(),n.sortDetached=ct(function(t){return 1&t.compareDocumentPosition(p.createElement("fieldset"))}),ct(function(t){return t.innerHTML="<a href='#'></a>","#"===t.firstChild.getAttribute("href")})||ht("type|href|height|width",function(t,e,n){if(!n)return t.getAttribute(e,"type"===e.toLowerCase()?1:2)}),n.attributes&&ct(function(t){return t.innerHTML="<input/>",t.firstChild.setAttribute("value",""),""===t.firstChild.getAttribute("value")})||ht("value",function(t,e,n){if(!n&&"input"===t.nodeName.toLowerCase())return t.defaultValue}),ct(function(t){return null==t.getAttribute("disabled")})||ht(P,function(t,e,n){var r;if(!n)return!0===t[e]?e.toLowerCase():(r=t.getAttributeNode(e))&&r.specified?r.value:null}),at}(n);E.find=C,E.expr=C.selectors,E.expr[":"]=E.expr.pseudos,E.uniqueSort=E.unique=C.uniqueSort,E.text=C.getText,E.isXMLDoc=C.isXML,E.contains=C.contains,E.escapeSelector=C.escape;var S=function(t,e,n){for(var r=[],i=void 0!==n;(t=t[e])&&9!==t.nodeType;)if(1===t.nodeType){if(i&&E(t).is(n))break;r.push(t)}return r},k=function(t,e){for(var n=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&n.push(t);return n},O=E.expr.match.needsContext;function I(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()}var R=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function A(t,e,n){return v(e)?E.grep(t,function(t,r){return!!e.call(t,r,t)!==n}):e.nodeType?E.grep(t,function(t){return t===e!==n}):"string"!=typeof e?E.grep(t,function(t){return c.call(e,t)>-1!==n}):E.filter(e,t,n)}E.filter=function(t,e,n){var r=e[0];return n&&(t=":not("+t+")"),1===e.length&&1===r.nodeType?E.find.matchesSelector(r,t)?[r]:[]:E.find.matches(t,E.grep(e,function(t){return 1===t.nodeType}))},E.fn.extend({find:function(t){var e,n,r=this.length,i=this;if("string"!=typeof t)return this.pushStack(E(t).filter(function(){for(e=0;e<r;e++)if(E.contains(i[e],this))return!0}));for(n=this.pushStack([]),e=0;e<r;e++)E.find(t,i[e],n);return r>1?E.uniqueSort(n):n},filter:function(t){return this.pushStack(A(this,t||[],!1))},not:function(t){return this.pushStack(A(this,t||[],!0))},is:function(t){return!!A(this,"string"==typeof t&&O.test(t)?E(t):t||[],!1).length}});var N,D=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(E.fn.init=function(t,e,n){var r,i;if(!t)return this;if(n=n||N,"string"==typeof t){if(!(r="<"===t[0]&&">"===t[t.length-1]&&t.length>=3?[null,t,null]:D.exec(t))||!r[1]&&e)return!e||e.jquery?(e||n).find(t):this.constructor(e).find(t);if(r[1]){if(e=e instanceof E?e[0]:e,E.merge(this,E.parseHTML(r[1],e&&e.nodeType?e.ownerDocument||e:_,!0)),R.test(r[1])&&E.isPlainObject(e))for(r in e)v(this[r])?this[r](e[r]):this.attr(r,e[r]);return this}return(i=_.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return t.nodeType?(this[0]=t,this.length=1,this):v(t)?void 0!==n.ready?n.ready(t):t(E):E.makeArray(t,this)}).prototype=E.fn,N=E(_);var M=/^(?:parents|prev(?:Until|All))/,L={children:!0,contents:!0,next:!0,prev:!0};function P(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}E.fn.extend({has:function(t){var e=E(t,this),n=e.length;return this.filter(function(){for(var t=0;t<n;t++)if(E.contains(this,e[t]))return!0})},closest:function(t,e){var n,r=0,i=this.length,o=[],s="string"!=typeof t&&E(t);if(!O.test(t))for(;r<i;r++)for(n=this[r];n&&n!==e;n=n.parentNode)if(n.nodeType<11&&(s?s.index(n)>-1:1===n.nodeType&&E.find.matchesSelector(n,t))){o.push(n);break}return this.pushStack(o.length>1?E.uniqueSort(o):o)},index:function(t){return t?"string"==typeof t?c.call(E(t),this[0]):c.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(E.uniqueSort(E.merge(this.get(),E(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),E.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return S(t,"parentNode")},parentsUntil:function(t,e,n){return S(t,"parentNode",n)},next:function(t){return P(t,"nextSibling")},prev:function(t){return P(t,"previousSibling")},nextAll:function(t){return S(t,"nextSibling")},prevAll:function(t){return S(t,"previousSibling")},nextUntil:function(t,e,n){return S(t,"nextSibling",n)},prevUntil:function(t,e,n){return S(t,"previousSibling",n)},siblings:function(t){return k((t.parentNode||{}).firstChild,t)},children:function(t){return k(t.firstChild)},contents:function(t){return null!=t.contentDocument&&s(t.contentDocument)?t.contentDocument:(I(t,"template")&&(t=t.content||t),E.merge([],t.childNodes))}},function(t,e){E.fn[t]=function(n,r){var i=E.map(this,e,n);return"Until"!==t.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=E.filter(r,i)),this.length>1&&(L[t]||E.uniqueSort(i),M.test(t)&&i.reverse()),this.pushStack(i)}});var F=/[^\x20\t\r\n\f]+/g;function B(t){return t}function j(t){throw t}function $(t,e,n,r){var i;try{t&&v(i=t.promise)?i.call(t).done(e).fail(n):t&&v(i=t.then)?i.call(t,e,n):e.apply(void 0,[t].slice(r))}catch(t){n.apply(void 0,[t])}}E.Callbacks=function(t){t="string"==typeof t?function(t){var e={};return E.each(t.match(F)||[],function(t,n){e[n]=!0}),e}(t):E.extend({},t);var e,n,r,i,o=[],s=[],a=-1,l=function(){for(i=i||t.once,r=e=!0;s.length;a=-1)for(n=s.shift();++a<o.length;)!1===o[a].apply(n[0],n[1])&&t.stopOnFalse&&(a=o.length,n=!1);t.memory||(n=!1),e=!1,i&&(o=n?[]:"")},u={add:function(){return o&&(n&&!e&&(a=o.length-1,s.push(n)),function e(n){E.each(n,function(n,r){v(r)?t.unique&&u.has(r)||o.push(r):r&&r.length&&"string"!==x(r)&&e(r)})}(arguments),n&&!e&&l()),this},remove:function(){return E.each(arguments,function(t,e){for(var n;(n=E.inArray(e,o,n))>-1;)o.splice(n,1),n<=a&&a--}),this},has:function(t){return t?E.inArray(t,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=s=[],o=n="",this},disabled:function(){return!o},lock:function(){return i=s=[],n||e||(o=n=""),this},locked:function(){return!!i},fireWith:function(t,n){return i||(n=[t,(n=n||[]).slice?n.slice():n],s.push(n),e||l()),this},fire:function(){return u.fireWith(this,arguments),this},fired:function(){return!!r}};return u},E.extend({Deferred:function(t){var e=[["notify","progress",E.Callbacks("memory"),E.Callbacks("memory"),2],["resolve","done",E.Callbacks("once memory"),E.Callbacks("once memory"),0,"resolved"],["reject","fail",E.Callbacks("once memory"),E.Callbacks("once memory"),1,"rejected"]],r="pending",i={state:function(){return r},always:function(){return o.done(arguments).fail(arguments),this},catch:function(t){return i.then(null,t)},pipe:function(){var t=arguments;return E.Deferred(function(n){E.each(e,function(e,r){var i=v(t[r[4]])&&t[r[4]];o[r[1]](function(){var t=i&&i.apply(this,arguments);t&&v(t.promise)?t.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[r[0]+"With"](this,i?[t]:arguments)})}),t=null}).promise()},then:function(t,r,i){var o=0;function s(t,e,r,i){return function(){var a=this,l=arguments,u=function(){var n,u;if(!(t<o)){if((n=r.apply(a,l))===e.promise())throw new TypeError("Thenable self-resolution");u=n&&("object"==typeof n||"function"==typeof n)&&n.then,v(u)?i?u.call(n,s(o,e,B,i),s(o,e,j,i)):(o++,u.call(n,s(o,e,B,i),s(o,e,j,i),s(o,e,B,e.notifyWith))):(r!==B&&(a=void 0,l=[n]),(i||e.resolveWith)(a,l))}},c=i?u:function(){try{u()}catch(n){E.Deferred.exceptionHook&&E.Deferred.exceptionHook(n,c.stackTrace),t+1>=o&&(r!==j&&(a=void 0,l=[n]),e.rejectWith(a,l))}};t?c():(E.Deferred.getStackHook&&(c.stackTrace=E.Deferred.getStackHook()),n.setTimeout(c))}}return E.Deferred(function(n){e[0][3].add(s(0,n,v(i)?i:B,n.notifyWith)),e[1][3].add(s(0,n,v(t)?t:B)),e[2][3].add(s(0,n,v(r)?r:j))}).promise()},promise:function(t){return null!=t?E.extend(t,i):i}},o={};return E.each(e,function(t,n){var s=n[2],a=n[5];i[n[1]]=s.add,a&&s.add(function(){r=a},e[3-t][2].disable,e[3-t][3].disable,e[0][2].lock,e[0][3].lock),s.add(n[3].fire),o[n[0]]=function(){return o[n[0]+"With"](this===o?void 0:this,arguments),this},o[n[0]+"With"]=s.fireWith}),i.promise(o),t&&t.call(o,o),o},when:function(t){var e=arguments.length,n=e,r=Array(n),i=a.call(arguments),o=E.Deferred(),s=function(t){return function(n){r[t]=this,i[t]=arguments.length>1?a.call(arguments):n,--e||o.resolveWith(r,i)}};if(e<=1&&($(t,o.done(s(n)).resolve,o.reject,!e),"pending"===o.state()||v(i[n]&&i[n].then)))return o.then();for(;n--;)$(i[n],s(n),o.reject);return o.promise()}});var U=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;E.Deferred.exceptionHook=function(t,e){n.console&&n.console.warn&&t&&U.test(t.name)&&n.console.warn("jQuery.Deferred exception: "+t.message,t.stack,e)},E.readyException=function(t){n.setTimeout(function(){throw t})};var V=E.Deferred();function H(){_.removeEventListener("DOMContentLoaded",H),n.removeEventListener("load",H),E.ready()}E.fn.ready=function(t){return V.then(t).catch(function(t){E.readyException(t)}),this},E.extend({isReady:!1,readyWait:1,ready:function(t){(!0===t?--E.readyWait:E.isReady)||(E.isReady=!0,!0!==t&&--E.readyWait>0||V.resolveWith(_,[E]))}}),E.ready.then=V.then,"complete"===_.readyState||"loading"!==_.readyState&&!_.documentElement.doScroll?n.setTimeout(E.ready):(_.addEventListener("DOMContentLoaded",H),n.addEventListener("load",H));var W=function(t,e,n,r,i,o,s){var a=0,l=t.length,u=null==n;if("object"===x(n))for(a in i=!0,n)W(t,e,a,n[a],!0,o,s);else if(void 0!==r&&(i=!0,v(r)||(s=!0),u&&(s?(e.call(t,r),e=null):(u=e,e=function(t,e,n){return u.call(E(t),n)})),e))for(;a<l;a++)e(t[a],n,s?r:r.call(t[a],a,e(t[a],n)));return i?t:u?e.call(t):l?e(t[0],n):o},G=/^-ms-/,z=/-([a-z])/g;function X(t,e){return e.toUpperCase()}function K(t){return t.replace(G,"ms-").replace(z,X)}var Y=function(t){return 1===t.nodeType||9===t.nodeType||!+t.nodeType};function q(){this.expando=E.expando+q.uid++}q.uid=1,q.prototype={cache:function(t){var e=t[this.expando];return e||(e={},Y(t)&&(t.nodeType?t[this.expando]=e:Object.defineProperty(t,this.expando,{value:e,configurable:!0}))),e},set:function(t,e,n){var r,i=this.cache(t);if("string"==typeof e)i[K(e)]=n;else for(r in e)i[K(r)]=e[r];return i},get:function(t,e){return void 0===e?this.cache(t):t[this.expando]&&t[this.expando][K(e)]},access:function(t,e,n){return void 0===e||e&&"string"==typeof e&&void 0===n?this.get(t,e):(this.set(t,e,n),void 0!==n?n:e)},remove:function(t,e){var n,r=t[this.expando];if(void 0!==r){if(void 0!==e){n=(e=Array.isArray(e)?e.map(K):(e=K(e))in r?[e]:e.match(F)||[]).length;for(;n--;)delete r[e[n]]}(void 0===e||E.isEmptyObject(r))&&(t.nodeType?t[this.expando]=void 0:delete t[this.expando])}},hasData:function(t){var e=t[this.expando];return void 0!==e&&!E.isEmptyObject(e)}};var J=new q,Z=new q,Q=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,tt=/[A-Z]/g;function et(t,e,n){var r;if(void 0===n&&1===t.nodeType)if(r="data-"+e.replace(tt,"-$&").toLowerCase(),"string"==typeof(n=t.getAttribute(r))){try{n=function(t){return"true"===t||"false"!==t&&("null"===t?null:t===+t+""?+t:Q.test(t)?JSON.parse(t):t)}(n)}catch(t){}Z.set(t,e,n)}else n=void 0;return n}E.extend({hasData:function(t){return Z.hasData(t)||J.hasData(t)},data:function(t,e,n){return Z.access(t,e,n)},removeData:function(t,e){Z.remove(t,e)},_data:function(t,e,n){return J.access(t,e,n)},_removeData:function(t,e){J.remove(t,e)}}),E.fn.extend({data:function(t,e){var n,r,i,o=this[0],s=o&&o.attributes;if(void 0===t){if(this.length&&(i=Z.get(o),1===o.nodeType&&!J.get(o,"hasDataAttrs"))){for(n=s.length;n--;)s[n]&&0===(r=s[n].name).indexOf("data-")&&(r=K(r.slice(5)),et(o,r,i[r]));J.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof t?this.each(function(){Z.set(this,t)}):W(this,function(e){var n;if(o&&void 0===e)return void 0!==(n=Z.get(o,t))?n:void 0!==(n=et(o,t))?n:void 0;this.each(function(){Z.set(this,t,e)})},null,e,arguments.length>1,null,!0)},removeData:function(t){return this.each(function(){Z.remove(this,t)})}}),E.extend({queue:function(t,e,n){var r;if(t)return e=(e||"fx")+"queue",r=J.get(t,e),n&&(!r||Array.isArray(n)?r=J.access(t,e,E.makeArray(n)):r.push(n)),r||[]},dequeue:function(t,e){e=e||"fx";var n=E.queue(t,e),r=n.length,i=n.shift(),o=E._queueHooks(t,e);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===e&&n.unshift("inprogress"),delete o.stop,i.call(t,function(){E.dequeue(t,e)},o)),!r&&o&&o.empty.fire()},_queueHooks:function(t,e){var n=e+"queueHooks";return J.get(t,n)||J.access(t,n,{empty:E.Callbacks("once memory").add(function(){J.remove(t,[e+"queue",n])})})}}),E.fn.extend({queue:function(t,e){var n=2;return"string"!=typeof t&&(e=t,t="fx",n--),arguments.length<n?E.queue(this[0],t):void 0===e?this:this.each(function(){var n=E.queue(this,t,e);E._queueHooks(this,t),"fx"===t&&"inprogress"!==n[0]&&E.dequeue(this,t)})},dequeue:function(t){return this.each(function(){E.dequeue(this,t)})},clearQueue:function(t){return this.queue(t||"fx",[])},promise:function(t,e){var n,r=1,i=E.Deferred(),o=this,s=this.length,a=function(){--r||i.resolveWith(o,[o])};for("string"!=typeof t&&(e=t,t=void 0),t=t||"fx";s--;)(n=J.get(o[s],t+"queueHooks"))&&n.empty&&(r++,n.empty.add(a));return a(),i.promise(e)}});var nt=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,rt=new RegExp("^(?:([+-])=|)("+nt+")([a-z%]*)$","i"),it=["Top","Right","Bottom","Left"],ot=_.documentElement,st=function(t){return E.contains(t.ownerDocument,t)},at={composed:!0};ot.getRootNode&&(st=function(t){return E.contains(t.ownerDocument,t)||t.getRootNode(at)===t.ownerDocument});var lt=function(t,e){return"none"===(t=e||t).style.display||""===t.style.display&&st(t)&&"none"===E.css(t,"display")};function ut(t,e,n,r){var i,o,s=20,a=r?function(){return r.cur()}:function(){return E.css(t,e,"")},l=a(),u=n&&n[3]||(E.cssNumber[e]?"":"px"),c=t.nodeType&&(E.cssNumber[e]||"px"!==u&&+l)&&rt.exec(E.css(t,e));if(c&&c[3]!==u){for(l/=2,u=u||c[3],c=+l||1;s--;)E.style(t,e,c+u),(1-o)*(1-(o=a()/l||.5))<=0&&(s=0),c/=o;c*=2,E.style(t,e,c+u),n=n||[]}return n&&(c=+c||+l||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=u,r.start=c,r.end=i)),i}var ct={};function ht(t){var e,n=t.ownerDocument,r=t.nodeName,i=ct[r];return i||(e=n.body.appendChild(n.createElement(r)),i=E.css(e,"display"),e.parentNode.removeChild(e),"none"===i&&(i="block"),ct[r]=i,i)}function dt(t,e){for(var n,r,i=[],o=0,s=t.length;o<s;o++)(r=t[o]).style&&(n=r.style.display,e?("none"===n&&(i[o]=J.get(r,"display")||null,i[o]||(r.style.display="")),""===r.style.display&&lt(r)&&(i[o]=ht(r))):"none"!==n&&(i[o]="none",J.set(r,"display",n)));for(o=0;o<s;o++)null!=i[o]&&(t[o].style.display=i[o]);return t}E.fn.extend({show:function(){return dt(this,!0)},hide:function(){return dt(this)},toggle:function(t){return"boolean"==typeof t?t?this.show():this.hide():this.each(function(){lt(this)?E(this).show():E(this).hide()})}});var pt,ft,gt=/^(?:checkbox|radio)$/i,mt=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,vt=/^$|^module$|\/(?:java|ecma)script/i;pt=_.createDocumentFragment().appendChild(_.createElement("div")),(ft=_.createElement("input")).setAttribute("type","radio"),ft.setAttribute("checked","checked"),ft.setAttribute("name","t"),pt.appendChild(ft),m.checkClone=pt.cloneNode(!0).cloneNode(!0).lastChild.checked,pt.innerHTML="<textarea>x</textarea>",m.noCloneChecked=!!pt.cloneNode(!0).lastChild.defaultValue,pt.innerHTML="<option></option>",m.option=!!pt.lastChild;var bt={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function _t(t,e){var n;return n=void 0!==t.getElementsByTagName?t.getElementsByTagName(e||"*"):void 0!==t.querySelectorAll?t.querySelectorAll(e||"*"):[],void 0===e||e&&I(t,e)?E.merge([t],n):n}function yt(t,e){for(var n=0,r=t.length;n<r;n++)J.set(t[n],"globalEval",!e||J.get(e[n],"globalEval"))}bt.tbody=bt.tfoot=bt.colgroup=bt.caption=bt.thead,bt.th=bt.td,m.option||(bt.optgroup=bt.option=[1,"<select multiple='multiple'>","</select>"]);var Tt=/<|&#?\w+;/;function xt(t,e,n,r,i){for(var o,s,a,l,u,c,h=e.createDocumentFragment(),d=[],p=0,f=t.length;p<f;p++)if((o=t[p])||0===o)if("object"===x(o))E.merge(d,o.nodeType?[o]:o);else if(Tt.test(o)){for(s=s||h.appendChild(e.createElement("div")),a=(mt.exec(o)||["",""])[1].toLowerCase(),l=bt[a]||bt._default,s.innerHTML=l[1]+E.htmlPrefilter(o)+l[2],c=l[0];c--;)s=s.lastChild;E.merge(d,s.childNodes),(s=h.firstChild).textContent=""}else d.push(e.createTextNode(o));for(h.textContent="",p=0;o=d[p++];)if(r&&E.inArray(o,r)>-1)i&&i.push(o);else if(u=st(o),s=_t(h.appendChild(o),"script"),u&&yt(s),n)for(c=0;o=s[c++];)vt.test(o.type||"")&&n.push(o);return h}var Et=/^([^.]*)(?:\.(.+)|)/;function wt(){return!0}function Ct(){return!1}function St(t,e){return t===function(){try{return _.activeElement}catch(t){}}()==("focus"===e)}function kt(t,e,n,r,i,o){var s,a;if("object"==typeof e){for(a in"string"!=typeof n&&(r=r||n,n=void 0),e)kt(t,a,n,r,e[a],o);return t}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Ct;else if(!i)return t;return 1===o&&(s=i,(i=function(t){return E().off(t),s.apply(this,arguments)}).guid=s.guid||(s.guid=E.guid++)),t.each(function(){E.event.add(this,e,i,r,n)})}function Ot(t,e,n){n?(J.set(t,e,!1),E.event.add(t,e,{namespace:!1,handler:function(t){var r,i,o=J.get(this,e);if(1&t.isTrigger&&this[e]){if(o.length)(E.event.special[e]||{}).delegateType&&t.stopPropagation();else if(o=a.call(arguments),J.set(this,e,o),r=n(this,e),this[e](),o!==(i=J.get(this,e))||r?J.set(this,e,!1):i={},o!==i)return t.stopImmediatePropagation(),t.preventDefault(),i&&i.value}else o.length&&(J.set(this,e,{value:E.event.trigger(E.extend(o[0],E.Event.prototype),o.slice(1),this)}),t.stopImmediatePropagation())}})):void 0===J.get(t,e)&&E.event.add(t,e,wt)}E.event={global:{},add:function(t,e,n,r,i){var o,s,a,l,u,c,h,d,p,f,g,m=J.get(t);if(Y(t))for(n.handler&&(n=(o=n).handler,i=o.selector),i&&E.find.matchesSelector(ot,i),n.guid||(n.guid=E.guid++),(l=m.events)||(l=m.events=Object.create(null)),(s=m.handle)||(s=m.handle=function(e){return void 0!==E&&E.event.triggered!==e.type?E.event.dispatch.apply(t,arguments):void 0}),u=(e=(e||"").match(F)||[""]).length;u--;)p=g=(a=Et.exec(e[u])||[])[1],f=(a[2]||"").split(".").sort(),p&&(h=E.event.special[p]||{},p=(i?h.delegateType:h.bindType)||p,h=E.event.special[p]||{},c=E.extend({type:p,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&E.expr.match.needsContext.test(i),namespace:f.join(".")},o),(d=l[p])||((d=l[p]=[]).delegateCount=0,h.setup&&!1!==h.setup.call(t,r,f,s)||t.addEventListener&&t.addEventListener(p,s)),h.add&&(h.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),i?d.splice(d.delegateCount++,0,c):d.push(c),E.event.global[p]=!0)},remove:function(t,e,n,r,i){var o,s,a,l,u,c,h,d,p,f,g,m=J.hasData(t)&&J.get(t);if(m&&(l=m.events)){for(u=(e=(e||"").match(F)||[""]).length;u--;)if(p=g=(a=Et.exec(e[u])||[])[1],f=(a[2]||"").split(".").sort(),p){for(h=E.event.special[p]||{},d=l[p=(r?h.delegateType:h.bindType)||p]||[],a=a[2]&&new RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"),s=o=d.length;o--;)c=d[o],!i&&g!==c.origType||n&&n.guid!==c.guid||a&&!a.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(d.splice(o,1),c.selector&&d.delegateCount--,h.remove&&h.remove.call(t,c));s&&!d.length&&(h.teardown&&!1!==h.teardown.call(t,f,m.handle)||E.removeEvent(t,p,m.handle),delete l[p])}else for(p in l)E.event.remove(t,p+e[u],n,r,!0);E.isEmptyObject(l)&&J.remove(t,"handle events")}},dispatch:function(t){var e,n,r,i,o,s,a=new Array(arguments.length),l=E.event.fix(t),u=(J.get(this,"events")||Object.create(null))[l.type]||[],c=E.event.special[l.type]||{};for(a[0]=l,e=1;e<arguments.length;e++)a[e]=arguments[e];if(l.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,l)){for(s=E.event.handlers.call(this,l,u),e=0;(i=s[e++])&&!l.isPropagationStopped();)for(l.currentTarget=i.elem,n=0;(o=i.handlers[n++])&&!l.isImmediatePropagationStopped();)l.rnamespace&&!1!==o.namespace&&!l.rnamespace.test(o.namespace)||(l.handleObj=o,l.data=o.data,void 0!==(r=((E.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,a))&&!1===(l.result=r)&&(l.preventDefault(),l.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,l),l.result}},handlers:function(t,e){var n,r,i,o,s,a=[],l=e.delegateCount,u=t.target;if(l&&u.nodeType&&!("click"===t.type&&t.button>=1))for(;u!==this;u=u.parentNode||this)if(1===u.nodeType&&("click"!==t.type||!0!==u.disabled)){for(o=[],s={},n=0;n<l;n++)void 0===s[i=(r=e[n]).selector+" "]&&(s[i]=r.needsContext?E(i,this).index(u)>-1:E.find(i,this,null,[u]).length),s[i]&&o.push(r);o.length&&a.push({elem:u,handlers:o})}return u=this,l<e.length&&a.push({elem:u,handlers:e.slice(l)}),a},addProp:function(t,e){Object.defineProperty(E.Event.prototype,t,{enumerable:!0,configurable:!0,get:v(e)?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set:function(e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e})}})},fix:function(t){return t[E.expando]?t:new E.Event(t)},special:{load:{noBubble:!0},click:{setup:function(t){var e=this||t;return gt.test(e.type)&&e.click&&I(e,"input")&&Ot(e,"click",wt),!1},trigger:function(t){var e=this||t;return gt.test(e.type)&&e.click&&I(e,"input")&&Ot(e,"click"),!0},_default:function(t){var e=t.target;return gt.test(e.type)&&e.click&&I(e,"input")&&J.get(e,"click")||I(e,"a")}},beforeunload:{postDispatch:function(t){void 0!==t.result&&t.originalEvent&&(t.originalEvent.returnValue=t.result)}}}},E.removeEvent=function(t,e,n){t.removeEventListener&&t.removeEventListener(e,n)},E.Event=function(t,e){if(!(this instanceof E.Event))return new E.Event(t,e);t&&t.type?(this.originalEvent=t,this.type=t.type,this.isDefaultPrevented=t.defaultPrevented||void 0===t.defaultPrevented&&!1===t.returnValue?wt:Ct,this.target=t.target&&3===t.target.nodeType?t.target.parentNode:t.target,this.currentTarget=t.currentTarget,this.relatedTarget=t.relatedTarget):this.type=t,e&&E.extend(this,e),this.timeStamp=t&&t.timeStamp||Date.now(),this[E.expando]=!0},E.Event.prototype={constructor:E.Event,isDefaultPrevented:Ct,isPropagationStopped:Ct,isImmediatePropagationStopped:Ct,isSimulated:!1,preventDefault:function(){var t=this.originalEvent;this.isDefaultPrevented=wt,t&&!this.isSimulated&&t.preventDefault()},stopPropagation:function(){var t=this.originalEvent;this.isPropagationStopped=wt,t&&!this.isSimulated&&t.stopPropagation()},stopImmediatePropagation:function(){var t=this.originalEvent;this.isImmediatePropagationStopped=wt,t&&!this.isSimulated&&t.stopImmediatePropagation(),this.stopPropagation()}},E.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:!0},E.event.addProp),E.each({focus:"focusin",blur:"focusout"},function(t,e){E.event.special[t]={setup:function(){return Ot(this,t,St),!1},trigger:function(){return Ot(this,t),!0},_default:function(){return!0},delegateType:e}}),E.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(t,e){E.event.special[t]={delegateType:e,bindType:e,handle:function(t){var n,r=t.relatedTarget,i=t.handleObj;return r&&(r===this||E.contains(this,r))||(t.type=i.origType,n=i.handler.apply(this,arguments),t.type=e),n}}}),E.fn.extend({on:function(t,e,n,r){return kt(this,t,e,n,r)},one:function(t,e,n,r){return kt(this,t,e,n,r,1)},off:function(t,e,n){var r,i;if(t&&t.preventDefault&&t.handleObj)return r=t.handleObj,E(t.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof t){for(i in t)this.off(i,e,t[i]);return this}return!1!==e&&"function"!=typeof e||(n=e,e=void 0),!1===n&&(n=Ct),this.each(function(){E.event.remove(this,t,n,e)})}});var It=/<script|<style|<link/i,Rt=/checked\s*(?:[^=]|=\s*.checked.)/i,At=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function Nt(t,e){return I(t,"table")&&I(11!==e.nodeType?e:e.firstChild,"tr")&&E(t).children("tbody")[0]||t}function Dt(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function Mt(t){return"true/"===(t.type||"").slice(0,5)?t.type=t.type.slice(5):t.removeAttribute("type"),t}function Lt(t,e){var n,r,i,o,s,a;if(1===e.nodeType){if(J.hasData(t)&&(a=J.get(t).events))for(i in J.remove(e,"handle events"),a)for(n=0,r=a[i].length;n<r;n++)E.event.add(e,i,a[i][n]);Z.hasData(t)&&(o=Z.access(t),s=E.extend({},o),Z.set(e,s))}}function Pt(t,e,n,r){e=l(e);var i,o,s,a,u,c,h=0,d=t.length,p=d-1,f=e[0],g=v(f);if(g||d>1&&"string"==typeof f&&!m.checkClone&&Rt.test(f))return t.each(function(i){var o=t.eq(i);g&&(e[0]=f.call(this,i,o.html())),Pt(o,e,n,r)});if(d&&(o=(i=xt(e,t[0].ownerDocument,!1,t,r)).firstChild,1===i.childNodes.length&&(i=o),o||r)){for(a=(s=E.map(_t(i,"script"),Dt)).length;h<d;h++)u=i,h!==p&&(u=E.clone(u,!0,!0),a&&E.merge(s,_t(u,"script"))),n.call(t[h],u,h);if(a)for(c=s[s.length-1].ownerDocument,E.map(s,Mt),h=0;h<a;h++)u=s[h],vt.test(u.type||"")&&!J.access(u,"globalEval")&&E.contains(c,u)&&(u.src&&"module"!==(u.type||"").toLowerCase()?E._evalUrl&&!u.noModule&&E._evalUrl(u.src,{nonce:u.nonce||u.getAttribute("nonce")},c):T(u.textContent.replace(At,""),u,c))}return t}function Ft(t,e,n){for(var r,i=e?E.filter(e,t):t,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||E.cleanData(_t(r)),r.parentNode&&(n&&st(r)&&yt(_t(r,"script")),r.parentNode.removeChild(r));return t}E.extend({htmlPrefilter:function(t){return t},clone:function(t,e,n){var r,i,o,s,a,l,u,c=t.cloneNode(!0),h=st(t);if(!(m.noCloneChecked||1!==t.nodeType&&11!==t.nodeType||E.isXMLDoc(t)))for(s=_t(c),r=0,i=(o=_t(t)).length;r<i;r++)a=o[r],l=s[r],void 0,"input"===(u=l.nodeName.toLowerCase())&&gt.test(a.type)?l.checked=a.checked:"input"!==u&&"textarea"!==u||(l.defaultValue=a.defaultValue);if(e)if(n)for(o=o||_t(t),s=s||_t(c),r=0,i=o.length;r<i;r++)Lt(o[r],s[r]);else Lt(t,c);return(s=_t(c,"script")).length>0&&yt(s,!h&&_t(t,"script")),c},cleanData:function(t){for(var e,n,r,i=E.event.special,o=0;void 0!==(n=t[o]);o++)if(Y(n)){if(e=n[J.expando]){if(e.events)for(r in e.events)i[r]?E.event.remove(n,r):E.removeEvent(n,r,e.handle);n[J.expando]=void 0}n[Z.expando]&&(n[Z.expando]=void 0)}}}),E.fn.extend({detach:function(t){return Ft(this,t,!0)},remove:function(t){return Ft(this,t)},text:function(t){return W(this,function(t){return void 0===t?E.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=t)})},null,t,arguments.length)},append:function(){return Pt(this,arguments,function(t){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Nt(this,t).appendChild(t)})},prepend:function(){return Pt(this,arguments,function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=Nt(this,t);e.insertBefore(t,e.firstChild)}})},before:function(){return Pt(this,arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this)})},after:function(){return Pt(this,arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)})},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)1===t.nodeType&&(E.cleanData(_t(t,!1)),t.textContent="");return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map(function(){return E.clone(this,t,e)})},html:function(t){return W(this,function(t){var e=this[0]||{},n=0,r=this.length;if(void 0===t&&1===e.nodeType)return e.innerHTML;if("string"==typeof t&&!It.test(t)&&!bt[(mt.exec(t)||["",""])[1].toLowerCase()]){t=E.htmlPrefilter(t);try{for(;n<r;n++)1===(e=this[n]||{}).nodeType&&(E.cleanData(_t(e,!1)),e.innerHTML=t);e=0}catch(t){}}e&&this.empty().append(t)},null,t,arguments.length)},replaceWith:function(){var t=[];return Pt(this,arguments,function(e){var n=this.parentNode;E.inArray(this,t)<0&&(E.cleanData(_t(this)),n&&n.replaceChild(e,this))},t)}}),E.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(t,e){E.fn[t]=function(t){for(var n,r=[],i=E(t),o=i.length-1,s=0;s<=o;s++)n=s===o?this:this.clone(!0),E(i[s])[e](n),u.apply(r,n.get());return this.pushStack(r)}});var Bt=new RegExp("^("+nt+")(?!px)[a-z%]+$","i"),jt=function(t){var e=t.ownerDocument.defaultView;return e&&e.opener||(e=n),e.getComputedStyle(t)},$t=function(t,e,n){var r,i,o={};for(i in e)o[i]=t.style[i],t.style[i]=e[i];for(i in r=n.call(t),e)t.style[i]=o[i];return r},Ut=new RegExp(it.join("|"),"i");function Vt(t,e,n){var r,i,o,s,a=t.style;return(n=n||jt(t))&&(""!==(s=n.getPropertyValue(e)||n[e])||st(t)||(s=E.style(t,e)),!m.pixelBoxStyles()&&Bt.test(s)&&Ut.test(e)&&(r=a.width,i=a.minWidth,o=a.maxWidth,a.minWidth=a.maxWidth=a.width=s,s=n.width,a.width=r,a.minWidth=i,a.maxWidth=o)),void 0!==s?s+"":s}function Ht(t,e){return{get:function(){if(!t())return(this.get=e).apply(this,arguments);delete this.get}}}!function(){function t(){if(c){u.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",c.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",ot.appendChild(u).appendChild(c);var t=n.getComputedStyle(c);r="1%"!==t.top,l=12===e(t.marginLeft),c.style.right="60%",s=36===e(t.right),i=36===e(t.width),c.style.position="absolute",o=12===e(c.offsetWidth/3),ot.removeChild(u),c=null}}function e(t){return Math.round(parseFloat(t))}var r,i,o,s,a,l,u=_.createElement("div"),c=_.createElement("div");c.style&&(c.style.backgroundClip="content-box",c.cloneNode(!0).style.backgroundClip="",m.clearCloneStyle="content-box"===c.style.backgroundClip,E.extend(m,{boxSizingReliable:function(){return t(),i},pixelBoxStyles:function(){return t(),s},pixelPosition:function(){return t(),r},reliableMarginLeft:function(){return t(),l},scrollboxSize:function(){return t(),o},reliableTrDimensions:function(){var t,e,r,i;return null==a&&(t=_.createElement("table"),e=_.createElement("tr"),r=_.createElement("div"),t.style.cssText="position:absolute;left:-11111px;border-collapse:separate",e.style.cssText="border:1px solid",e.style.height="1px",r.style.height="9px",r.style.display="block",ot.appendChild(t).appendChild(e).appendChild(r),i=n.getComputedStyle(e),a=parseInt(i.height,10)+parseInt(i.borderTopWidth,10)+parseInt(i.borderBottomWidth,10)===e.offsetHeight,ot.removeChild(t)),a}}))}();var Wt=["Webkit","Moz","ms"],Gt=_.createElement("div").style,zt={};function Xt(t){var e=E.cssProps[t]||zt[t];return e||(t in Gt?t:zt[t]=function(t){for(var e=t[0].toUpperCase()+t.slice(1),n=Wt.length;n--;)if((t=Wt[n]+e)in Gt)return t}(t)||t)}var Kt=/^(none|table(?!-c[ea]).+)/,Yt=/^--/,qt={position:"absolute",visibility:"hidden",display:"block"},Jt={letterSpacing:"0",fontWeight:"400"};function Zt(t,e,n){var r=rt.exec(e);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):e}function Qt(t,e,n,r,i,o){var s="width"===e?1:0,a=0,l=0;if(n===(r?"border":"content"))return 0;for(;s<4;s+=2)"margin"===n&&(l+=E.css(t,n+it[s],!0,i)),r?("content"===n&&(l-=E.css(t,"padding"+it[s],!0,i)),"margin"!==n&&(l-=E.css(t,"border"+it[s]+"Width",!0,i))):(l+=E.css(t,"padding"+it[s],!0,i),"padding"!==n?l+=E.css(t,"border"+it[s]+"Width",!0,i):a+=E.css(t,"border"+it[s]+"Width",!0,i));return!r&&o>=0&&(l+=Math.max(0,Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-o-l-a-.5))||0),l}function te(t,e,n){var r=jt(t),i=(!m.boxSizingReliable()||n)&&"border-box"===E.css(t,"boxSizing",!1,r),o=i,s=Vt(t,e,r),a="offset"+e[0].toUpperCase()+e.slice(1);if(Bt.test(s)){if(!n)return s;s="auto"}return(!m.boxSizingReliable()&&i||!m.reliableTrDimensions()&&I(t,"tr")||"auto"===s||!parseFloat(s)&&"inline"===E.css(t,"display",!1,r))&&t.getClientRects().length&&(i="border-box"===E.css(t,"boxSizing",!1,r),(o=a in t)&&(s=t[a])),(s=parseFloat(s)||0)+Qt(t,e,n||(i?"border":"content"),o,r,s)+"px"}function ee(t,e,n,r,i){return new ee.prototype.init(t,e,n,r,i)}E.extend({cssHooks:{opacity:{get:function(t,e){if(e){var n=Vt(t,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(t,e,n,r){if(t&&3!==t.nodeType&&8!==t.nodeType&&t.style){var i,o,s,a=K(e),l=Yt.test(e),u=t.style;if(l||(e=Xt(a)),s=E.cssHooks[e]||E.cssHooks[a],void 0===n)return s&&"get"in s&&void 0!==(i=s.get(t,!1,r))?i:u[e];"string"===(o=typeof n)&&(i=rt.exec(n))&&i[1]&&(n=ut(t,e,i),o="number"),null!=n&&n==n&&("number"!==o||l||(n+=i&&i[3]||(E.cssNumber[a]?"":"px")),m.clearCloneStyle||""!==n||0!==e.indexOf("background")||(u[e]="inherit"),s&&"set"in s&&void 0===(n=s.set(t,n,r))||(l?u.setProperty(e,n):u[e]=n))}},css:function(t,e,n,r){var i,o,s,a=K(e);return Yt.test(e)||(e=Xt(a)),(s=E.cssHooks[e]||E.cssHooks[a])&&"get"in s&&(i=s.get(t,!0,n)),void 0===i&&(i=Vt(t,e,r)),"normal"===i&&e in Jt&&(i=Jt[e]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),E.each(["height","width"],function(t,e){E.cssHooks[e]={get:function(t,n,r){if(n)return!Kt.test(E.css(t,"display"))||t.getClientRects().length&&t.getBoundingClientRect().width?te(t,e,r):$t(t,qt,function(){return te(t,e,r)})},set:function(t,n,r){var i,o=jt(t),s=!m.scrollboxSize()&&"absolute"===o.position,a=(s||r)&&"border-box"===E.css(t,"boxSizing",!1,o),l=r?Qt(t,e,r,a,o):0;return a&&s&&(l-=Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-parseFloat(o[e])-Qt(t,e,"border",!1,o)-.5)),l&&(i=rt.exec(n))&&"px"!==(i[3]||"px")&&(t.style[e]=n,n=E.css(t,e)),Zt(0,n,l)}}}),E.cssHooks.marginLeft=Ht(m.reliableMarginLeft,function(t,e){if(e)return(parseFloat(Vt(t,"marginLeft"))||t.getBoundingClientRect().left-$t(t,{marginLeft:0},function(){return t.getBoundingClientRect().left}))+"px"}),E.each({margin:"",padding:"",border:"Width"},function(t,e){E.cssHooks[t+e]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];r<4;r++)i[t+it[r]+e]=o[r]||o[r-2]||o[0];return i}},"margin"!==t&&(E.cssHooks[t+e].set=Zt)}),E.fn.extend({css:function(t,e){return W(this,function(t,e,n){var r,i,o={},s=0;if(Array.isArray(e)){for(r=jt(t),i=e.length;s<i;s++)o[e[s]]=E.css(t,e[s],!1,r);return o}return void 0!==n?E.style(t,e,n):E.css(t,e)},t,e,arguments.length>1)}}),E.Tween=ee,ee.prototype={constructor:ee,init:function(t,e,n,r,i,o){this.elem=t,this.prop=n,this.easing=i||E.easing._default,this.options=e,this.start=this.now=this.cur(),this.end=r,this.unit=o||(E.cssNumber[n]?"":"px")},cur:function(){var t=ee.propHooks[this.prop];return t&&t.get?t.get(this):ee.propHooks._default.get(this)},run:function(t){var e,n=ee.propHooks[this.prop];return this.options.duration?this.pos=e=E.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):this.pos=e=t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):ee.propHooks._default.set(this),this}},ee.prototype.init.prototype=ee.prototype,ee.propHooks={_default:{get:function(t){var e;return 1!==t.elem.nodeType||null!=t.elem[t.prop]&&null==t.elem.style[t.prop]?t.elem[t.prop]:(e=E.css(t.elem,t.prop,""))&&"auto"!==e?e:0},set:function(t){E.fx.step[t.prop]?E.fx.step[t.prop](t):1!==t.elem.nodeType||!E.cssHooks[t.prop]&&null==t.elem.style[Xt(t.prop)]?t.elem[t.prop]=t.now:E.style(t.elem,t.prop,t.now+t.unit)}}},ee.propHooks.scrollTop=ee.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},E.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},_default:"swing"},E.fx=ee.prototype.init,E.fx.step={};var ne,re,ie=/^(?:toggle|show|hide)$/,oe=/queueHooks$/;function se(){re&&(!1===_.hidden&&n.requestAnimationFrame?n.requestAnimationFrame(se):n.setTimeout(se,E.fx.interval),E.fx.tick())}function ae(){return n.setTimeout(function(){ne=void 0}),ne=Date.now()}function le(t,e){var n,r=0,i={height:t};for(e=e?1:0;r<4;r+=2-e)i["margin"+(n=it[r])]=i["padding"+n]=t;return e&&(i.opacity=i.width=t),i}function ue(t,e,n){for(var r,i=(ce.tweeners[e]||[]).concat(ce.tweeners["*"]),o=0,s=i.length;o<s;o++)if(r=i[o].call(n,e,t))return r}function ce(t,e,n){var r,i,o=0,s=ce.prefilters.length,a=E.Deferred().always(function(){delete l.elem}),l=function(){if(i)return!1;for(var e=ne||ae(),n=Math.max(0,u.startTime+u.duration-e),r=1-(n/u.duration||0),o=0,s=u.tweens.length;o<s;o++)u.tweens[o].run(r);return a.notifyWith(t,[u,r,n]),r<1&&s?n:(s||a.notifyWith(t,[u,1,0]),a.resolveWith(t,[u]),!1)},u=a.promise({elem:t,props:E.extend({},e),opts:E.extend(!0,{specialEasing:{},easing:E.easing._default},n),originalProperties:e,originalOptions:n,startTime:ne||ae(),duration:n.duration,tweens:[],createTween:function(e,n){var r=E.Tween(t,u.opts,e,n,u.opts.specialEasing[e]||u.opts.easing);return u.tweens.push(r),r},stop:function(e){var n=0,r=e?u.tweens.length:0;if(i)return this;for(i=!0;n<r;n++)u.tweens[n].run(1);return e?(a.notifyWith(t,[u,1,0]),a.resolveWith(t,[u,e])):a.rejectWith(t,[u,e]),this}}),c=u.props;for(!function(t,e){var n,r,i,o,s;for(n in t)if(i=e[r=K(n)],o=t[n],Array.isArray(o)&&(i=o[1],o=t[n]=o[0]),n!==r&&(t[r]=o,delete t[n]),(s=E.cssHooks[r])&&"expand"in s)for(n in o=s.expand(o),delete t[r],o)n in t||(t[n]=o[n],e[n]=i);else e[r]=i}(c,u.opts.specialEasing);o<s;o++)if(r=ce.prefilters[o].call(u,t,c,u.opts))return v(r.stop)&&(E._queueHooks(u.elem,u.opts.queue).stop=r.stop.bind(r)),r;return E.map(c,ue,u),v(u.opts.start)&&u.opts.start.call(t,u),u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always),E.fx.timer(E.extend(l,{elem:t,anim:u,queue:u.opts.queue})),u}E.Animation=E.extend(ce,{tweeners:{"*":[function(t,e){var n=this.createTween(t,e);return ut(n.elem,t,rt.exec(e),n),n}]},tweener:function(t,e){v(t)?(e=t,t=["*"]):t=t.match(F);for(var n,r=0,i=t.length;r<i;r++)n=t[r],ce.tweeners[n]=ce.tweeners[n]||[],ce.tweeners[n].unshift(e)},prefilters:[function(t,e,n){var r,i,o,s,a,l,u,c,h="width"in e||"height"in e,d=this,p={},f=t.style,g=t.nodeType&&lt(t),m=J.get(t,"fxshow");for(r in n.queue||(null==(s=E._queueHooks(t,"fx")).unqueued&&(s.unqueued=0,a=s.empty.fire,s.empty.fire=function(){s.unqueued||a()}),s.unqueued++,d.always(function(){d.always(function(){s.unqueued--,E.queue(t,"fx").length||s.empty.fire()})})),e)if(i=e[r],ie.test(i)){if(delete e[r],o=o||"toggle"===i,i===(g?"hide":"show")){if("show"!==i||!m||void 0===m[r])continue;g=!0}p[r]=m&&m[r]||E.style(t,r)}if((l=!E.isEmptyObject(e))||!E.isEmptyObject(p))for(r in h&&1===t.nodeType&&(n.overflow=[f.overflow,f.overflowX,f.overflowY],null==(u=m&&m.display)&&(u=J.get(t,"display")),"none"===(c=E.css(t,"display"))&&(u?c=u:(dt([t],!0),u=t.style.display||u,c=E.css(t,"display"),dt([t]))),("inline"===c||"inline-block"===c&&null!=u)&&"none"===E.css(t,"float")&&(l||(d.done(function(){f.display=u}),null==u&&(c=f.display,u="none"===c?"":c)),f.display="inline-block")),n.overflow&&(f.overflow="hidden",d.always(function(){f.overflow=n.overflow[0],f.overflowX=n.overflow[1],f.overflowY=n.overflow[2]})),l=!1,p)l||(m?"hidden"in m&&(g=m.hidden):m=J.access(t,"fxshow",{display:u}),o&&(m.hidden=!g),g&&dt([t],!0),d.done(function(){for(r in g||dt([t]),J.remove(t,"fxshow"),p)E.style(t,r,p[r])})),l=ue(g?m[r]:0,r,d),r in m||(m[r]=l.start,g&&(l.end=l.start,l.start=0))}],prefilter:function(t,e){e?ce.prefilters.unshift(t):ce.prefilters.push(t)}}),E.speed=function(t,e,n){var r=t&&"object"==typeof t?E.extend({},t):{complete:n||!n&&e||v(t)&&t,duration:t,easing:n&&e||e&&!v(e)&&e};return E.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in E.fx.speeds?r.duration=E.fx.speeds[r.duration]:r.duration=E.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){v(r.old)&&r.old.call(this),r.queue&&E.dequeue(this,r.queue)},r},E.fn.extend({fadeTo:function(t,e,n,r){return this.filter(lt).css("opacity",0).show().end().animate({opacity:e},t,n,r)},animate:function(t,e,n,r){var i=E.isEmptyObject(t),o=E.speed(e,n,r),s=function(){var e=ce(this,E.extend({},t),o);(i||J.get(this,"finish"))&&e.stop(!0)};return s.finish=s,i||!1===o.queue?this.each(s):this.queue(o.queue,s)},stop:function(t,e,n){var r=function(t){var e=t.stop;delete t.stop,e(n)};return"string"!=typeof t&&(n=e,e=t,t=void 0),e&&this.queue(t||"fx",[]),this.each(function(){var e=!0,i=null!=t&&t+"queueHooks",o=E.timers,s=J.get(this);if(i)s[i]&&s[i].stop&&r(s[i]);else for(i in s)s[i]&&s[i].stop&&oe.test(i)&&r(s[i]);for(i=o.length;i--;)o[i].elem!==this||null!=t&&o[i].queue!==t||(o[i].anim.stop(n),e=!1,o.splice(i,1));!e&&n||E.dequeue(this,t)})},finish:function(t){return!1!==t&&(t=t||"fx"),this.each(function(){var e,n=J.get(this),r=n[t+"queue"],i=n[t+"queueHooks"],o=E.timers,s=r?r.length:0;for(n.finish=!0,E.queue(this,t,[]),i&&i.stop&&i.stop.call(this,!0),e=o.length;e--;)o[e].elem===this&&o[e].queue===t&&(o[e].anim.stop(!0),o.splice(e,1));for(e=0;e<s;e++)r[e]&&r[e].finish&&r[e].finish.call(this);delete n.finish})}}),E.each(["toggle","show","hide"],function(t,e){var n=E.fn[e];E.fn[e]=function(t,r,i){return null==t||"boolean"==typeof t?n.apply(this,arguments):this.animate(le(e,!0),t,r,i)}}),E.each({slideDown:le("show"),slideUp:le("hide"),slideToggle:le("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(t,e){E.fn[t]=function(t,n,r){return this.animate(e,t,n,r)}}),E.timers=[],E.fx.tick=function(){var t,e=0,n=E.timers;for(ne=Date.now();e<n.length;e++)(t=n[e])()||n[e]!==t||n.splice(e--,1);n.length||E.fx.stop(),ne=void 0},E.fx.timer=function(t){E.timers.push(t),E.fx.start()},E.fx.interval=13,E.fx.start=function(){re||(re=!0,se())},E.fx.stop=function(){re=null},E.fx.speeds={slow:600,fast:200,_default:400},E.fn.delay=function(t,e){return t=E.fx&&E.fx.speeds[t]||t,e=e||"fx",this.queue(e,function(e,r){var i=n.setTimeout(e,t);r.stop=function(){n.clearTimeout(i)}})},function(){var t=_.createElement("input"),e=_.createElement("select").appendChild(_.createElement("option"));t.type="checkbox",m.checkOn=""!==t.value,m.optSelected=e.selected,(t=_.createElement("input")).value="t",t.type="radio",m.radioValue="t"===t.value}();var he,de=E.expr.attrHandle;E.fn.extend({attr:function(t,e){return W(this,E.attr,t,e,arguments.length>1)},removeAttr:function(t){return this.each(function(){E.removeAttr(this,t)})}}),E.extend({attr:function(t,e,n){var r,i,o=t.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===t.getAttribute?E.prop(t,e,n):(1===o&&E.isXMLDoc(t)||(i=E.attrHooks[e.toLowerCase()]||(E.expr.match.bool.test(e)?he:void 0)),void 0!==n?null===n?void E.removeAttr(t,e):i&&"set"in i&&void 0!==(r=i.set(t,n,e))?r:(t.setAttribute(e,n+""),n):i&&"get"in i&&null!==(r=i.get(t,e))?r:null==(r=E.find.attr(t,e))?void 0:r)},attrHooks:{type:{set:function(t,e){if(!m.radioValue&&"radio"===e&&I(t,"input")){var n=t.value;return t.setAttribute("type",e),n&&(t.value=n),e}}}},removeAttr:function(t,e){var n,r=0,i=e&&e.match(F);if(i&&1===t.nodeType)for(;n=i[r++];)t.removeAttribute(n)}}),he={set:function(t,e,n){return!1===e?E.removeAttr(t,n):t.setAttribute(n,n),n}},E.each(E.expr.match.bool.source.match(/\w+/g),function(t,e){var n=de[e]||E.find.attr;de[e]=function(t,e,r){var i,o,s=e.toLowerCase();return r||(o=de[s],de[s]=i,i=null!=n(t,e,r)?s:null,de[s]=o),i}});var pe=/^(?:input|select|textarea|button)$/i,fe=/^(?:a|area)$/i;function ge(t){return(t.match(F)||[]).join(" ")}function me(t){return t.getAttribute&&t.getAttribute("class")||""}function ve(t){return Array.isArray(t)?t:"string"==typeof t&&t.match(F)||[]}E.fn.extend({prop:function(t,e){return W(this,E.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each(function(){delete this[E.propFix[t]||t]})}}),E.extend({prop:function(t,e,n){var r,i,o=t.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&E.isXMLDoc(t)||(e=E.propFix[e]||e,i=E.propHooks[e]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(t,n,e))?r:t[e]=n:i&&"get"in i&&null!==(r=i.get(t,e))?r:t[e]},propHooks:{tabIndex:{get:function(t){var e=E.find.attr(t,"tabindex");return e?parseInt(e,10):pe.test(t.nodeName)||fe.test(t.nodeName)&&t.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),m.optSelected||(E.propHooks.selected={get:function(t){var e=t.parentNode;return e&&e.parentNode&&e.parentNode.selectedIndex,null},set:function(t){var e=t.parentNode;e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex)}}),E.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){E.propFix[this.toLowerCase()]=this}),E.fn.extend({addClass:function(t){var e,n,r,i,o,s,a,l=0;if(v(t))return this.each(function(e){E(this).addClass(t.call(this,e,me(this)))});if((e=ve(t)).length)for(;n=this[l++];)if(i=me(n),r=1===n.nodeType&&" "+ge(i)+" "){for(s=0;o=e[s++];)r.indexOf(" "+o+" ")<0&&(r+=o+" ");i!==(a=ge(r))&&n.setAttribute("class",a)}return this},removeClass:function(t){var e,n,r,i,o,s,a,l=0;if(v(t))return this.each(function(e){E(this).removeClass(t.call(this,e,me(this)))});if(!arguments.length)return this.attr("class","");if((e=ve(t)).length)for(;n=this[l++];)if(i=me(n),r=1===n.nodeType&&" "+ge(i)+" "){for(s=0;o=e[s++];)for(;r.indexOf(" "+o+" ")>-1;)r=r.replace(" "+o+" "," ");i!==(a=ge(r))&&n.setAttribute("class",a)}return this},toggleClass:function(t,e){var n=typeof t,r="string"===n||Array.isArray(t);return"boolean"==typeof e&&r?e?this.addClass(t):this.removeClass(t):v(t)?this.each(function(n){E(this).toggleClass(t.call(this,n,me(this),e),e)}):this.each(function(){var e,i,o,s;if(r)for(i=0,o=E(this),s=ve(t);e=s[i++];)o.hasClass(e)?o.removeClass(e):o.addClass(e);else void 0!==t&&"boolean"!==n||((e=me(this))&&J.set(this,"__className__",e),this.setAttribute&&this.setAttribute("class",e||!1===t?"":J.get(this,"__className__")||""))})},hasClass:function(t){var e,n,r=0;for(e=" "+t+" ";n=this[r++];)if(1===n.nodeType&&(" "+ge(me(n))+" ").indexOf(e)>-1)return!0;return!1}});var be=/\r/g;E.fn.extend({val:function(t){var e,n,r,i=this[0];return arguments.length?(r=v(t),this.each(function(n){var i;1===this.nodeType&&(null==(i=r?t.call(this,n,E(this).val()):t)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=E.map(i,function(t){return null==t?"":t+""})),(e=E.valHooks[this.type]||E.valHooks[this.nodeName.toLowerCase()])&&"set"in e&&void 0!==e.set(this,i,"value")||(this.value=i))})):i?(e=E.valHooks[i.type]||E.valHooks[i.nodeName.toLowerCase()])&&"get"in e&&void 0!==(n=e.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(be,""):null==n?"":n:void 0}}),E.extend({valHooks:{option:{get:function(t){var e=E.find.attr(t,"value");return null!=e?e:ge(E.text(t))}},select:{get:function(t){var e,n,r,i=t.options,o=t.selectedIndex,s="select-one"===t.type,a=s?null:[],l=s?o+1:i.length;for(r=o<0?l:s?o:0;r<l;r++)if(((n=i[r]).selected||r===o)&&!n.disabled&&(!n.parentNode.disabled||!I(n.parentNode,"optgroup"))){if(e=E(n).val(),s)return e;a.push(e)}return a},set:function(t,e){for(var n,r,i=t.options,o=E.makeArray(e),s=i.length;s--;)((r=i[s]).selected=E.inArray(E.valHooks.option.get(r),o)>-1)&&(n=!0);return n||(t.selectedIndex=-1),o}}}}),E.each(["radio","checkbox"],function(){E.valHooks[this]={set:function(t,e){if(Array.isArray(e))return t.checked=E.inArray(E(t).val(),e)>-1}},m.checkOn||(E.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})}),m.focusin="onfocusin"in n;var _e=/^(?:focusinfocus|focusoutblur)$/,ye=function(t){t.stopPropagation()};E.extend(E.event,{trigger:function(t,e,r,i){var o,s,a,l,u,c,h,d,f=[r||_],g=p.call(t,"type")?t.type:t,m=p.call(t,"namespace")?t.namespace.split("."):[];if(s=d=a=r=r||_,3!==r.nodeType&&8!==r.nodeType&&!_e.test(g+E.event.triggered)&&(g.indexOf(".")>-1&&(g=(m=g.split(".")).shift(),m.sort()),u=g.indexOf(":")<0&&"on"+g,(t=t[E.expando]?t:new E.Event(g,"object"==typeof t&&t)).isTrigger=i?2:3,t.namespace=m.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=r),e=null==e?[t]:E.makeArray(e,[t]),h=E.event.special[g]||{},i||!h.trigger||!1!==h.trigger.apply(r,e))){if(!i&&!h.noBubble&&!b(r)){for(l=h.delegateType||g,_e.test(l+g)||(s=s.parentNode);s;s=s.parentNode)f.push(s),a=s;a===(r.ownerDocument||_)&&f.push(a.defaultView||a.parentWindow||n)}for(o=0;(s=f[o++])&&!t.isPropagationStopped();)d=s,t.type=o>1?l:h.bindType||g,(c=(J.get(s,"events")||Object.create(null))[t.type]&&J.get(s,"handle"))&&c.apply(s,e),(c=u&&s[u])&&c.apply&&Y(s)&&(t.result=c.apply(s,e),!1===t.result&&t.preventDefault());return t.type=g,i||t.isDefaultPrevented()||h._default&&!1!==h._default.apply(f.pop(),e)||!Y(r)||u&&v(r[g])&&!b(r)&&((a=r[u])&&(r[u]=null),E.event.triggered=g,t.isPropagationStopped()&&d.addEventListener(g,ye),r[g](),t.isPropagationStopped()&&d.removeEventListener(g,ye),E.event.triggered=void 0,a&&(r[u]=a)),t.result}},simulate:function(t,e,n){var r=E.extend(new E.Event,n,{type:t,isSimulated:!0});E.event.trigger(r,null,e)}}),E.fn.extend({trigger:function(t,e){return this.each(function(){E.event.trigger(t,e,this)})},triggerHandler:function(t,e){var n=this[0];if(n)return E.event.trigger(t,e,n,!0)}}),m.focusin||E.each({focus:"focusin",blur:"focusout"},function(t,e){var n=function(t){E.event.simulate(e,t.target,E.event.fix(t))};E.event.special[e]={setup:function(){var r=this.ownerDocument||this.document||this,i=J.access(r,e);i||r.addEventListener(t,n,!0),J.access(r,e,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this.document||this,i=J.access(r,e)-1;i?J.access(r,e,i):(r.removeEventListener(t,n,!0),J.remove(r,e))}}});var Te=n.location,xe={guid:Date.now()},Ee=/\?/;E.parseXML=function(t){var e,r;if(!t||"string"!=typeof t)return null;try{e=(new n.DOMParser).parseFromString(t,"text/xml")}catch(t){}return r=e&&e.getElementsByTagName("parsererror")[0],e&&!r||E.error("Invalid XML: "+(r?E.map(r.childNodes,function(t){return t.textContent}).join("\n"):t)),e};var we=/\[\]$/,Ce=/\r?\n/g,Se=/^(?:submit|button|image|reset|file)$/i,ke=/^(?:input|select|textarea|keygen)/i;function Oe(t,e,n,r){var i;if(Array.isArray(e))E.each(e,function(e,i){n||we.test(t)?r(t,i):Oe(t+"["+("object"==typeof i&&null!=i?e:"")+"]",i,n,r)});else if(n||"object"!==x(e))r(t,e);else for(i in e)Oe(t+"["+i+"]",e[i],n,r)}E.param=function(t,e){var n,r=[],i=function(t,e){var n=v(e)?e():e;r[r.length]=encodeURIComponent(t)+"="+encodeURIComponent(null==n?"":n)};if(null==t)return"";if(Array.isArray(t)||t.jquery&&!E.isPlainObject(t))E.each(t,function(){i(this.name,this.value)});else for(n in t)Oe(n,t[n],e,i);return r.join("&")},E.fn.extend({serialize:function(){return E.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var t=E.prop(this,"elements");return t?E.makeArray(t):this}).filter(function(){var t=this.type;return this.name&&!E(this).is(":disabled")&&ke.test(this.nodeName)&&!Se.test(t)&&(this.checked||!gt.test(t))}).map(function(t,e){var n=E(this).val();return null==n?null:Array.isArray(n)?E.map(n,function(t){return{name:e.name,value:t.replace(Ce,"\r\n")}}):{name:e.name,value:n.replace(Ce,"\r\n")}}).get()}});var Ie=/%20/g,Re=/#.*$/,Ae=/([?&])_=[^&]*/,Ne=/^(.*?):[ \t]*([^\r\n]*)$/gm,De=/^(?:GET|HEAD)$/,Me=/^\/\//,Le={},Pe={},Fe="*/".concat("*"),Be=_.createElement("a");function je(t){return function(e,n){"string"!=typeof e&&(n=e,e="*");var r,i=0,o=e.toLowerCase().match(F)||[];if(v(n))for(;r=o[i++];)"+"===r[0]?(r=r.slice(1)||"*",(t[r]=t[r]||[]).unshift(n)):(t[r]=t[r]||[]).push(n)}}function $e(t,e,n,r){var i={},o=t===Pe;function s(a){var l;return i[a]=!0,E.each(t[a]||[],function(t,a){var u=a(e,n,r);return"string"!=typeof u||o||i[u]?o?!(l=u):void 0:(e.dataTypes.unshift(u),s(u),!1)}),l}return s(e.dataTypes[0])||!i["*"]&&s("*")}function Ue(t,e){var n,r,i=E.ajaxSettings.flatOptions||{};for(n in e)void 0!==e[n]&&((i[n]?t:r||(r={}))[n]=e[n]);return r&&E.extend(!0,t,r),t}Be.href=Te.href,E.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Te.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Te.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Fe,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":E.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?Ue(Ue(t,E.ajaxSettings),e):Ue(E.ajaxSettings,t)},ajaxPrefilter:je(Le),ajaxTransport:je(Pe),ajax:function(t,e){"object"==typeof t&&(e=t,t=void 0),e=e||{};var r,i,o,s,a,l,u,c,h,d,p=E.ajaxSetup({},e),f=p.context||p,g=p.context&&(f.nodeType||f.jquery)?E(f):E.event,m=E.Deferred(),v=E.Callbacks("once memory"),b=p.statusCode||{},y={},T={},x="canceled",w={readyState:0,getResponseHeader:function(t){var e;if(u){if(!s)for(s={};e=Ne.exec(o);)s[e[1].toLowerCase()+" "]=(s[e[1].toLowerCase()+" "]||[]).concat(e[2]);e=s[t.toLowerCase()+" "]}return null==e?null:e.join(", ")},getAllResponseHeaders:function(){return u?o:null},setRequestHeader:function(t,e){return null==u&&(t=T[t.toLowerCase()]=T[t.toLowerCase()]||t,y[t]=e),this},overrideMimeType:function(t){return null==u&&(p.mimeType=t),this},statusCode:function(t){var e;if(t)if(u)w.always(t[w.status]);else for(e in t)b[e]=[b[e],t[e]];return this},abort:function(t){var e=t||x;return r&&r.abort(e),C(0,e),this}};if(m.promise(w),p.url=((t||p.url||Te.href)+"").replace(Me,Te.protocol+"//"),p.type=e.method||e.type||p.method||p.type,p.dataTypes=(p.dataType||"*").toLowerCase().match(F)||[""],null==p.crossDomain){l=_.createElement("a");try{l.href=p.url,l.href=l.href,p.crossDomain=Be.protocol+"//"+Be.host!=l.protocol+"//"+l.host}catch(t){p.crossDomain=!0}}if(p.data&&p.processData&&"string"!=typeof p.data&&(p.data=E.param(p.data,p.traditional)),$e(Le,p,e,w),u)return w;for(h in(c=E.event&&p.global)&&0==E.active++&&E.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!De.test(p.type),i=p.url.replace(Re,""),p.hasContent?p.data&&p.processData&&0===(p.contentType||"").indexOf("application/x-www-form-urlencoded")&&(p.data=p.data.replace(Ie,"+")):(d=p.url.slice(i.length),p.data&&(p.processData||"string"==typeof p.data)&&(i+=(Ee.test(i)?"&":"?")+p.data,delete p.data),!1===p.cache&&(i=i.replace(Ae,"$1"),d=(Ee.test(i)?"&":"?")+"_="+xe.guid+++d),p.url=i+d),p.ifModified&&(E.lastModified[i]&&w.setRequestHeader("If-Modified-Since",E.lastModified[i]),E.etag[i]&&w.setRequestHeader("If-None-Match",E.etag[i])),(p.data&&p.hasContent&&!1!==p.contentType||e.contentType)&&w.setRequestHeader("Content-Type",p.contentType),w.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+Fe+"; q=0.01":""):p.accepts["*"]),p.headers)w.setRequestHeader(h,p.headers[h]);if(p.beforeSend&&(!1===p.beforeSend.call(f,w,p)||u))return w.abort();if(x="abort",v.add(p.complete),w.done(p.success),w.fail(p.error),r=$e(Pe,p,e,w)){if(w.readyState=1,c&&g.trigger("ajaxSend",[w,p]),u)return w;p.async&&p.timeout>0&&(a=n.setTimeout(function(){w.abort("timeout")},p.timeout));try{u=!1,r.send(y,C)}catch(t){if(u)throw t;C(-1,t)}}else C(-1,"No Transport");function C(t,e,s,l){var h,d,_,y,T,x=e;u||(u=!0,a&&n.clearTimeout(a),r=void 0,o=l||"",w.readyState=t>0?4:0,h=t>=200&&t<300||304===t,s&&(y=function(t,e,n){for(var r,i,o,s,a=t.contents,l=t.dataTypes;"*"===l[0];)l.shift(),void 0===r&&(r=t.mimeType||e.getResponseHeader("Content-Type"));if(r)for(i in a)if(a[i]&&a[i].test(r)){l.unshift(i);break}if(l[0]in n)o=l[0];else{for(i in n){if(!l[0]||t.converters[i+" "+l[0]]){o=i;break}s||(s=i)}o=o||s}if(o)return o!==l[0]&&l.unshift(o),n[o]}(p,w,s)),!h&&E.inArray("script",p.dataTypes)>-1&&E.inArray("json",p.dataTypes)<0&&(p.converters["text script"]=function(){}),y=function(t,e,n,r){var i,o,s,a,l,u={},c=t.dataTypes.slice();if(c[1])for(s in t.converters)u[s.toLowerCase()]=t.converters[s];for(o=c.shift();o;)if(t.responseFields[o]&&(n[t.responseFields[o]]=e),!l&&r&&t.dataFilter&&(e=t.dataFilter(e,t.dataType)),l=o,o=c.shift())if("*"===o)o=l;else if("*"!==l&&l!==o){if(!(s=u[l+" "+o]||u["* "+o]))for(i in u)if((a=i.split(" "))[1]===o&&(s=u[l+" "+a[0]]||u["* "+a[0]])){!0===s?s=u[i]:!0!==u[i]&&(o=a[0],c.unshift(a[1]));break}if(!0!==s)if(s&&t.throws)e=s(e);else try{e=s(e)}catch(t){return{state:"parsererror",error:s?t:"No conversion from "+l+" to "+o}}}return{state:"success",data:e}}(p,y,w,h),h?(p.ifModified&&((T=w.getResponseHeader("Last-Modified"))&&(E.lastModified[i]=T),(T=w.getResponseHeader("etag"))&&(E.etag[i]=T)),204===t||"HEAD"===p.type?x="nocontent":304===t?x="notmodified":(x=y.state,d=y.data,h=!(_=y.error))):(_=x,!t&&x||(x="error",t<0&&(t=0))),w.status=t,w.statusText=(e||x)+"",h?m.resolveWith(f,[d,x,w]):m.rejectWith(f,[w,x,_]),w.statusCode(b),b=void 0,c&&g.trigger(h?"ajaxSuccess":"ajaxError",[w,p,h?d:_]),v.fireWith(f,[w,x]),c&&(g.trigger("ajaxComplete",[w,p]),--E.active||E.event.trigger("ajaxStop")))}return w},getJSON:function(t,e,n){return E.get(t,e,n,"json")},getScript:function(t,e){return E.get(t,void 0,e,"script")}}),E.each(["get","post"],function(t,e){E[e]=function(t,n,r,i){return v(n)&&(i=i||r,r=n,n=void 0),E.ajax(E.extend({url:t,type:e,dataType:i,data:n,success:r},E.isPlainObject(t)&&t))}}),E.ajaxPrefilter(function(t){var e;for(e in t.headers)"content-type"===e.toLowerCase()&&(t.contentType=t.headers[e]||"")}),E._evalUrl=function(t,e,n){return E.ajax({url:t,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(t){E.globalEval(t,e,n)}})},E.fn.extend({wrapAll:function(t){var e;return this[0]&&(v(t)&&(t=t.call(this[0])),e=E(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map(function(){for(var t=this;t.firstElementChild;)t=t.firstElementChild;return t}).append(this)),this},wrapInner:function(t){return v(t)?this.each(function(e){E(this).wrapInner(t.call(this,e))}):this.each(function(){var e=E(this),n=e.contents();n.length?n.wrapAll(t):e.append(t)})},wrap:function(t){var e=v(t);return this.each(function(n){E(this).wrapAll(e?t.call(this,n):t)})},unwrap:function(t){return this.parent(t).not("body").each(function(){E(this).replaceWith(this.childNodes)}),this}}),E.expr.pseudos.hidden=function(t){return!E.expr.pseudos.visible(t)},E.expr.pseudos.visible=function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},E.ajaxSettings.xhr=function(){try{return new n.XMLHttpRequest}catch(t){}};var Ve={0:200,1223:204},He=E.ajaxSettings.xhr();m.cors=!!He&&"withCredentials"in He,m.ajax=He=!!He,E.ajaxTransport(function(t){var e,r;if(m.cors||He&&!t.crossDomain)return{send:function(i,o){var s,a=t.xhr();if(a.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(s in t.xhrFields)a[s]=t.xhrFields[s];for(s in t.mimeType&&a.overrideMimeType&&a.overrideMimeType(t.mimeType),t.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest"),i)a.setRequestHeader(s,i[s]);e=function(t){return function(){e&&(e=r=a.onload=a.onerror=a.onabort=a.ontimeout=a.onreadystatechange=null,"abort"===t?a.abort():"error"===t?"number"!=typeof a.status?o(0,"error"):o(a.status,a.statusText):o(Ve[a.status]||a.status,a.statusText,"text"!==(a.responseType||"text")||"string"!=typeof a.responseText?{binary:a.response}:{text:a.responseText},a.getAllResponseHeaders()))}},a.onload=e(),r=a.onerror=a.ontimeout=e("error"),void 0!==a.onabort?a.onabort=r:a.onreadystatechange=function(){4===a.readyState&&n.setTimeout(function(){e&&r()})},e=e("abort");try{a.send(t.hasContent&&t.data||null)}catch(t){if(e)throw t}},abort:function(){e&&e()}}}),E.ajaxPrefilter(function(t){t.crossDomain&&(t.contents.script=!1)}),E.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(t){return E.globalEval(t),t}}}),E.ajaxPrefilter("script",function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")}),E.ajaxTransport("script",function(t){var e,n;if(t.crossDomain||t.scriptAttrs)return{send:function(r,i){e=E("<script>").attr(t.scriptAttrs||{}).prop({charset:t.scriptCharset,src:t.url}).on("load error",n=function(t){e.remove(),n=null,t&&i("error"===t.type?404:200,t.type)}),_.head.appendChild(e[0])},abort:function(){n&&n()}}});var We,Ge=[],ze=/(=)\?(?=&|$)|\?\?/;E.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var t=Ge.pop()||E.expando+"_"+xe.guid++;return this[t]=!0,t}}),E.ajaxPrefilter("json jsonp",function(t,e,r){var i,o,s,a=!1!==t.jsonp&&(ze.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&ze.test(t.data)&&"data");if(a||"jsonp"===t.dataTypes[0])return i=t.jsonpCallback=v(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,a?t[a]=t[a].replace(ze,"$1"+i):!1!==t.jsonp&&(t.url+=(Ee.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return s||E.error(i+" was not called"),s[0]},t.dataTypes[0]="json",o=n[i],n[i]=function(){s=arguments},r.always(function(){void 0===o?E(n).removeProp(i):n[i]=o,t[i]&&(t.jsonpCallback=e.jsonpCallback,Ge.push(i)),s&&v(o)&&o(s[0]),s=o=void 0}),"script"}),m.createHTMLDocument=((We=_.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===We.childNodes.length),E.parseHTML=function(t,e,n){return"string"!=typeof t?[]:("boolean"==typeof e&&(n=e,e=!1),e||(m.createHTMLDocument?((r=(e=_.implementation.createHTMLDocument("")).createElement("base")).href=_.location.href,e.head.appendChild(r)):e=_),i=R.exec(t),o=!n&&[],i?[e.createElement(i[1])]:(i=xt([t],e,o),o&&o.length&&E(o).remove(),E.merge([],i.childNodes)));var r,i,o},E.fn.load=function(t,e,n){var r,i,o,s=this,a=t.indexOf(" ");return a>-1&&(r=ge(t.slice(a)),t=t.slice(0,a)),v(e)?(n=e,e=void 0):e&&"object"==typeof e&&(i="POST"),s.length>0&&E.ajax({url:t,type:i||"GET",dataType:"html",data:e}).done(function(t){o=arguments,s.html(r?E("<div>").append(E.parseHTML(t)).find(r):t)}).always(n&&function(t,e){s.each(function(){n.apply(this,o||[t.responseText,e,t])})}),this},E.expr.pseudos.animated=function(t){return E.grep(E.timers,function(e){return t===e.elem}).length},E.offset={setOffset:function(t,e,n){var r,i,o,s,a,l,u=E.css(t,"position"),c=E(t),h={};"static"===u&&(t.style.position="relative"),a=c.offset(),o=E.css(t,"top"),l=E.css(t,"left"),("absolute"===u||"fixed"===u)&&(o+l).indexOf("auto")>-1?(s=(r=c.position()).top,i=r.left):(s=parseFloat(o)||0,i=parseFloat(l)||0),v(e)&&(e=e.call(t,n,E.extend({},a))),null!=e.top&&(h.top=e.top-a.top+s),null!=e.left&&(h.left=e.left-a.left+i),"using"in e?e.using.call(t,h):c.css(h)}},E.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){E.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var t,e,n,r=this[0],i={top:0,left:0};if("fixed"===E.css(r,"position"))e=r.getBoundingClientRect();else{for(e=this.offset(),n=r.ownerDocument,t=r.offsetParent||n.documentElement;t&&(t===n.body||t===n.documentElement)&&"static"===E.css(t,"position");)t=t.parentNode;t&&t!==r&&1===t.nodeType&&((i=E(t).offset()).top+=E.css(t,"borderTopWidth",!0),i.left+=E.css(t,"borderLeftWidth",!0))}return{top:e.top-i.top-E.css(r,"marginTop",!0),left:e.left-i.left-E.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var t=this.offsetParent;t&&"static"===E.css(t,"position");)t=t.offsetParent;return t||ot})}}),E.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,e){var n="pageYOffset"===e;E.fn[t]=function(r){return W(this,function(t,r,i){var o;if(b(t)?o=t:9===t.nodeType&&(o=t.defaultView),void 0===i)return o?o[e]:t[r];o?o.scrollTo(n?o.pageXOffset:i,n?i:o.pageYOffset):t[r]=i},t,r,arguments.length)}}),E.each(["top","left"],function(t,e){E.cssHooks[e]=Ht(m.pixelPosition,function(t,n){if(n)return n=Vt(t,e),Bt.test(n)?E(t).position()[e]+"px":n})}),E.each({Height:"height",Width:"width"},function(t,e){E.each({padding:"inner"+t,content:e,"":"outer"+t},function(n,r){E.fn[r]=function(i,o){var s=arguments.length&&(n||"boolean"!=typeof i),a=n||(!0===i||!0===o?"margin":"border");return W(this,function(e,n,i){var o;return b(e)?0===r.indexOf("outer")?e["inner"+t]:e.document.documentElement["client"+t]:9===e.nodeType?(o=e.documentElement,Math.max(e.body["scroll"+t],o["scroll"+t],e.body["offset"+t],o["offset"+t],o["client"+t])):void 0===i?E.css(e,n,a):E.style(e,n,i,a)},e,s?i:void 0,s)}})}),E.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(t,e){E.fn[e]=function(t){return this.on(e,t)}}),E.fn.extend({bind:function(t,e,n){return this.on(t,null,e,n)},unbind:function(t,e){return this.off(t,null,e)},delegate:function(t,e,n,r){return this.on(e,t,n,r)},undelegate:function(t,e,n){return 1===arguments.length?this.off(t,"**"):this.off(e,t||"**",n)},hover:function(t,e){return this.mouseenter(t).mouseleave(e||t)}}),E.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(t,e){E.fn[e]=function(t,n){return arguments.length>0?this.on(e,null,t,n):this.trigger(e)}});var Xe=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;E.proxy=function(t,e){var n,r,i;if("string"==typeof e&&(n=t[e],e=t,t=n),v(t))return r=a.call(arguments,2),(i=function(){return t.apply(e||this,r.concat(a.call(arguments)))}).guid=t.guid=t.guid||E.guid++,i},E.holdReady=function(t){t?E.readyWait++:E.ready(!0)},E.isArray=Array.isArray,E.parseJSON=JSON.parse,E.nodeName=I,E.isFunction=v,E.isWindow=b,E.camelCase=K,E.type=x,E.now=Date.now,E.isNumeric=function(t){var e=E.type(t);return("number"===e||"string"===e)&&!isNaN(t-parseFloat(t))},E.trim=function(t){return null==t?"":(t+"").replace(Xe,"")},void 0===(r=function(){return E}.apply(e,[]))||(t.exports=r);var Ke=n.jQuery,Ye=n.$;return E.noConflict=function(t){return n.$===E&&(n.$=Ye),t&&n.jQuery===E&&(n.jQuery=Ke),E},void 0===i&&(n.jQuery=n.$=E),E})},"82Mu":function(t,e,n){var r=n("7KvD"),i=n("L42u").set,o=r.MutationObserver||r.WebKitMutationObserver,s=r.process,a=r.Promise,l="process"==n("R9M2")(s);t.exports=function(){var t,e,n,u=function(){var r,i;for(l&&(r=s.domain)&&r.exit();t;){i=t.fn,t=t.next;try{i()}catch(r){throw t?n():e=void 0,r}}e=void 0,r&&r.enter()};if(l)n=function(){s.nextTick(u)};else if(!o||r.navigator&&r.navigator.standalone)if(a&&a.resolve){var c=a.resolve(void 0);n=function(){c.then(u)}}else n=function(){i.call(r,u)};else{var h=!0,d=document.createTextNode("");new o(u).observe(d,{characterData:!0}),n=function(){d.data=h=!h}}return function(r){var i={fn:r,next:void 0};e&&(e.next=i),t||(t=i,n()),e=i}}},"835U":function(t,e,n){"use strict";e.__esModule=!0,e.isDefined=e.isUndefined=e.isFunction=void 0;var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};e.isString=function(t){return"[object String]"===Object.prototype.toString.call(t)},e.isObject=function(t){return"[object Object]"===Object.prototype.toString.call(t)},e.isHtmlElement=function(t){return t&&t.nodeType===Node.ELEMENT_NODE};var i,o=n("7+uW"),s=(i=o)&&i.__esModule?i:{default:i};var a=function(t){return t&&"[object Function]"==={}.toString.call(t)};"function"==typeof/./||"object"===("undefined"==typeof Int8Array?"undefined":r(Int8Array))||!s.default.prototype.$isServer&&"function"==typeof document.childNodes||(e.isFunction=a=function(t){return"function"==typeof t||!1}),e.isFunction=a;e.isUndefined=function(t){return void 0===t},e.isDefined=function(t){return void 0!==t&&null!==t}},"880/":function(t,e,n){t.exports=n("hJx8")},"8lT+":function(t,e,n){var r;r=function(t){var e,n,r;return n=(e=t).lib.CipherParams,r=e.enc.Hex,e.format.Hex={stringify:function(t){return t.ciphertext.toString(r)},parse:function(t){var e=r.parse(t);return n.create({ciphertext:e})}},t.format.Hex},t.exports=r(n("02Hb"),n("fGru"))},"94VQ":function(t,e,n){"use strict";var r=n("Yobk"),i=n("X8DO"),o=n("e6n0"),s={};n("hJx8")(s,n("dSzd")("iterator"),function(){return this}),t.exports=function(t,e,n){t.prototype=r(s,{next:i(1,n)}),o(t,e+" Iterator")}},"96it":function(t,e,n){var r;r=function(t){return t.pad.AnsiX923={pad:function(t,e){var n=t.sigBytes,r=4*e,i=r-n%r,o=n+i-1;t.clamp(),t.words[o>>>2]|=i<<24-o%4*8,t.sigBytes+=i},unpad:function(t){var e=255&t.words[t.sigBytes-1>>>2];t.sigBytes-=e}},t.pad.Ansix923},t.exports=r(n("02Hb"),n("fGru"))},"9Nf/":function(t,e,n){"use strict";n.d(e,"a",function(){return a}),n.d(e,"b",function(){return s});var r=n("Kkag"),i=n("XPNO"),o=(n("xMQ1"),n("XFvI"));function s(t,e){o.assert(o.isFunction(t),()=>"The f passed in variableGrads(f) must be a function"),o.assert(null==e||Array.isArray(e)&&e.every(t=>t instanceof i.c),()=>"The varList passed in variableGrads(f, varList) must be an array of variables");const n=null!=e;if(!n){e=[];for(const t in r.a.registeredVariables)e.push(r.a.registeredVariables[t])}const s=n?e.filter(t=>!t.trainable):null,a=e.length;e=e.filter(t=>t.trainable),o.assert(e.length>0,()=>"variableGrads() expects at least one of the input variables to "+`be trainable, but none of the ${a} variables is `+"trainable.");const{value:l,grads:u}=r.a.gradients(t,e,null,!0);o.assert(u.some(t=>null!=t),()=>"Cannot find a connection between any variable and the result of the loss function y=f(x). Please make sure the operations that use variables are inside the function f passed to minimize()."),o.assert(0===l.rank,()=>"The f passed in variableGrads(f) must return a scalar, but it "+`returned a rank-${l.rank} tensor`);const c={};return e.forEach((t,e)=>{null!=u[e]&&(c[t.name]=u[e])}),null!=s&&s.forEach(t=>c[t.name]=null),{value:l,grads:c}}function a(t){return r.a.customGrad(t)}},"9bBU":function(t,e,n){n("mClu");var r=n("FeBl").Object;t.exports=function(t,e,n){return r.defineProperty(t,e,n)}},"9g4f":function(t,e,n){(function(t){var r;!function(t,i,o){function s(t,e){return e.i=t.i,e.w=t.w,e.X=t.X.slice(),e}function a(t,e){null==t&&(t=+new Date);var n=new function(t){var e=this;e.next=function(){var t,n,r=e.w,i=e.X,o=e.i;return e.w=r=r+1640531527|0,n=i[o+34&127],t=i[o=o+1&127],n^=n<<13,t^=t<<17,n^=n>>>15,t^=t>>>12,n=i[o]=n^t,e.i=o,n+(r^r>>>16)|0},function(t,e){var n,r,i,o,s,a=[],l=128;for(e===(0|e)?(r=e,e=null):(e+="\0",r=0,l=Math.max(l,e.length)),i=0,o=-32;o<l;++o)e&&(r^=e.charCodeAt((o+32)%e.length)),0===o&&(s=r),r^=r<<10,r^=r>>>15,r^=r<<4,r^=r>>>13,o>=0&&(s=s+1640531527|0,i=0==(n=a[127&o]^=r+s)?i+1:0);for(i>=128&&(a[127&(e&&e.length||0)]=-1),i=127,o=512;o>0;--o)r=a[i+34&127],n=a[i=i+1&127],r^=r<<13,n^=n<<17,r^=r>>>15,n^=n>>>12,a[i]=r^n;t.w=s,t.X=a,t.i=i}(e,t)}(t),r=e&&e.state,i=function(){return(n.next()>>>0)/4294967296};return i.double=function(){do{var t=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},i.int32=n.next,i.quick=i,r&&(r.X&&s(r,n),i.state=function(){return s(n,{})}),i}i&&i.exports?i.exports=a:n("LGuY")&&n("nErl")?void 0===(r=function(){return a}.call(e,n,e,i))||(i.exports=r):this.xor4096=a}(0,"object"==typeof t&&t,n("LGuY"))}).call(e,n("3IRH")(t))},AMCD:function(t,e,n){"use strict";e.__esModule=!0,e.validateRangeInOneMonth=e.extractTimeFormat=e.extractDateFormat=e.nextYear=e.prevYear=e.nextMonth=e.prevMonth=e.changeYearMonthAndClampDate=e.timeWithinRange=e.limitTimeRange=e.clearMilliseconds=e.clearTime=e.modifyWithTimeString=e.modifyTime=e.modifyDate=e.range=e.getRangeMinutes=e.getMonthDays=e.getPrevMonthLastDays=e.getRangeHours=e.getWeekNumber=e.getStartDateOfMonth=e.nextDate=e.prevDate=e.getFirstDayOfMonth=e.getDayCountOfYear=e.getDayCountOfMonth=e.parseDate=e.formatDate=e.isDateObject=e.isDate=e.toDate=e.getI18nSettings=void 0;var r,i=n("eNfa"),o=(r=i)&&r.__esModule?r:{default:r},s=n("urW8");var a=["sun","mon","tue","wed","thu","fri","sat"],l=["jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"],u=e.getI18nSettings=function(){return{dayNamesShort:a.map(function(t){return(0,s.t)("el.datepicker.weeks."+t)}),dayNames:a.map(function(t){return(0,s.t)("el.datepicker.weeks."+t)}),monthNamesShort:l.map(function(t){return(0,s.t)("el.datepicker.months."+t)}),monthNames:l.map(function(t,e){return(0,s.t)("el.datepicker.month"+(e+1))}),amPm:["am","pm"]}},c=e.toDate=function(t){return h(t)?new Date(t):null},h=e.isDate=function(t){return null!==t&&void 0!==t&&(!isNaN(new Date(t).getTime())&&!Array.isArray(t))},d=(e.isDateObject=function(t){return t instanceof Date},e.formatDate=function(t,e){return(t=c(t))?o.default.format(t,e||"yyyy-MM-dd",u()):""},e.parseDate=function(t,e){return o.default.parse(t,e||"yyyy-MM-dd",u())}),p=e.getDayCountOfMonth=function(t,e){return 3===e||5===e||8===e||10===e?30:1===e?t%4==0&&t%100!=0||t%400==0?29:28:31},f=(e.getDayCountOfYear=function(t){return t%400==0||t%100!=0&&t%4==0?366:365},e.getFirstDayOfMonth=function(t){var e=new Date(t.getTime());return e.setDate(1),e.getDay()},e.prevDate=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return new Date(t.getFullYear(),t.getMonth(),t.getDate()-e)});e.nextDate=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return new Date(t.getFullYear(),t.getMonth(),t.getDate()+e)},e.getStartDateOfMonth=function(t,e){var n=new Date(t,e,1),r=n.getDay();return f(n,0===r?7:r)},e.getWeekNumber=function(t){if(!h(t))return null;var e=new Date(t.getTime());e.setHours(0,0,0,0),e.setDate(e.getDate()+3-(e.getDay()+6)%7);var n=new Date(e.getFullYear(),0,4);return 1+Math.round(((e.getTime()-n.getTime())/864e5-3+(n.getDay()+6)%7)/7)},e.getRangeHours=function(t){var e=[],n=[];if((t||[]).forEach(function(t){var e=t.map(function(t){return t.getHours()});n=n.concat(function(t,e){for(var n=[],r=t;r<=e;r++)n.push(r);return n}(e[0],e[1]))}),n.length)for(var r=0;r<24;r++)e[r]=-1===n.indexOf(r);else for(var i=0;i<24;i++)e[i]=!1;return e},e.getPrevMonthLastDays=function(t,e){if(e<=0)return[];var n=new Date(t.getTime());n.setDate(0);var r=n.getDate();return m(e).map(function(t,n){return r-(e-n-1)})},e.getMonthDays=function(t){var e=new Date(t.getFullYear(),t.getMonth()+1,0).getDate();return m(e).map(function(t,e){return e+1})};function g(t,e,n,r){for(var i=e;i<n;i++)t[i]=r}e.getRangeMinutes=function(t,e){var n=new Array(60);return t.length>0?t.forEach(function(t){var r=t[0],i=t[1],o=r.getHours(),s=r.getMinutes(),a=i.getHours(),l=i.getMinutes();o===e&&a!==e?g(n,s,60,!0):o===e&&a===e?g(n,s,l+1,!0):o!==e&&a===e?g(n,0,l+1,!0):o<e&&a>e&&g(n,0,60,!0)}):g(n,0,60,!0),n};var m=e.range=function(t){return Array.apply(null,{length:t}).map(function(t,e){return e})},v=e.modifyDate=function(t,e,n,r){return new Date(e,n,r,t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds())},b=e.modifyTime=function(t,e,n,r){return new Date(t.getFullYear(),t.getMonth(),t.getDate(),e,n,r,t.getMilliseconds())},_=(e.modifyWithTimeString=function(t,e){return null!=t&&e?(e=d(e,"HH:mm:ss"),b(t,e.getHours(),e.getMinutes(),e.getSeconds())):t},e.clearTime=function(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate())},e.clearMilliseconds=function(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),0)},e.limitTimeRange=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"HH:mm:ss";if(0===e.length)return t;var r=function(t){return o.default.parse(o.default.format(t,n),n)},i=r(t),s=e.map(function(t){return t.map(r)});if(s.some(function(t){return i>=t[0]&&i<=t[1]}))return t;var a=s[0][0],l=s[0][0];return s.forEach(function(t){a=new Date(Math.min(t[0],a)),l=new Date(Math.max(t[1],a))}),v(i<a?a:l,t.getFullYear(),t.getMonth(),t.getDate())}),y=(e.timeWithinRange=function(t,e,n){return _(t,e,n).getTime()===t.getTime()},e.changeYearMonthAndClampDate=function(t,e,n){var r=Math.min(t.getDate(),p(e,n));return v(t,e,n,r)});e.prevMonth=function(t){var e=t.getFullYear(),n=t.getMonth();return 0===n?y(t,e-1,11):y(t,e,n-1)},e.nextMonth=function(t){var e=t.getFullYear(),n=t.getMonth();return 11===n?y(t,e+1,0):y(t,e,n+1)},e.prevYear=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=t.getFullYear(),r=t.getMonth();return y(t,n-e,r)},e.nextYear=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=t.getFullYear(),r=t.getMonth();return y(t,n+e,r)},e.extractDateFormat=function(t){return t.replace(/\W?m{1,2}|\W?ZZ/g,"").replace(/\W?h{1,2}|\W?s{1,3}|\W?a/gi,"").trim()},e.extractTimeFormat=function(t){return t.replace(/\W?D{1,2}|\W?Do|\W?d{1,4}|\W?M{1,4}|\W?y{2,4}/g,"").trim()},e.validateRangeInOneMonth=function(t,e){return t.getMonth()===e.getMonth()&&t.getFullYear()===e.getFullYear()}},Av7u:function(t,e,n){var r;r=function(t){return t},t.exports=r(n("02Hb"),n("1J88"),n("6qVS"),n("drMw"),n("uFh6"),n("3ytT"),n("gykg"),n("Ff/Y"),n("mP1F"),n("0hgu"),n("QA75"),n("x067"),n("v1IJ"),n("hjGT"),n("PIk1"),n("bBGs"),n("wj1U"),n("fGru"),n("E3Xu"),n("kVWZ"),n("s9og"),n("YeRv"),n("Trqf"),n("96it"),n("HYom"),n("Gqr1"),n("E+Sk"),n("0Iyz"),n("8lT+"),n("FQmK"),n("4pyl"),n("5Pol"),n("gkUh"),n("3NE9"))},"BJf/":function(t,e){t.exports=r;var n=null;try{n=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(t){}function r(t,e,n){this.low=0|t,this.high=0|e,this.unsigned=!!n}function i(t){return!0===(t&&t.__isLong__)}r.prototype.__isLong__,Object.defineProperty(r.prototype,"__isLong__",{value:!0}),r.isLong=i;var o={},s={};function a(t,e){var n,r,i;return e?(i=0<=(t>>>=0)&&t<256)&&(r=s[t])?r:(n=u(t,(0|t)<0?-1:0,!0),i&&(s[t]=n),n):(i=-128<=(t|=0)&&t<128)&&(r=o[t])?r:(n=u(t,t<0?-1:0,!1),i&&(o[t]=n),n)}function l(t,e){if(isNaN(t))return e?b:v;if(e){if(t<0)return b;if(t>=f)return E}else{if(t<=-g)return w;if(t+1>=g)return x}return t<0?l(-t,e).neg():u(t%p|0,t/p|0,e)}function u(t,e,n){return new r(t,e,n)}r.fromInt=a,r.fromNumber=l,r.fromBits=u;var c=Math.pow;function h(t,e,n){if(0===t.length)throw Error("empty string");if("NaN"===t||"Infinity"===t||"+Infinity"===t||"-Infinity"===t)return v;if("number"==typeof e?(n=e,e=!1):e=!!e,(n=n||10)<2||36<n)throw RangeError("radix");var r;if((r=t.indexOf("-"))>0)throw Error("interior hyphen");if(0===r)return h(t.substring(1),e,n).neg();for(var i=l(c(n,8)),o=v,s=0;s<t.length;s+=8){var a=Math.min(8,t.length-s),u=parseInt(t.substring(s,s+a),n);if(a<8){var d=l(c(n,a));o=o.mul(d).add(l(u))}else o=(o=o.mul(i)).add(l(u))}return o.unsigned=e,o}function d(t,e){return"number"==typeof t?l(t,e):"string"==typeof t?h(t,e):u(t.low,t.high,"boolean"==typeof e?e:t.unsigned)}r.fromString=h,r.fromValue=d;var p=4294967296,f=p*p,g=f/2,m=a(1<<24),v=a(0);r.ZERO=v;var b=a(0,!0);r.UZERO=b;var _=a(1);r.ONE=_;var y=a(1,!0);r.UONE=y;var T=a(-1);r.NEG_ONE=T;var x=u(-1,2147483647,!1);r.MAX_VALUE=x;var E=u(-1,-1,!0);r.MAX_UNSIGNED_VALUE=E;var w=u(0,-2147483648,!1);r.MIN_VALUE=w;var C=r.prototype;C.toInt=function(){return this.unsigned?this.low>>>0:this.low},C.toNumber=function(){return this.unsigned?(this.high>>>0)*p+(this.low>>>0):this.high*p+(this.low>>>0)},C.toString=function(t){if((t=t||10)<2||36<t)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(w)){var e=l(t),n=this.div(e),r=n.mul(e).sub(this);return n.toString(t)+r.toInt().toString(t)}return"-"+this.neg().toString(t)}for(var i=l(c(t,6),this.unsigned),o=this,s="";;){var a=o.div(i),u=(o.sub(a.mul(i)).toInt()>>>0).toString(t);if((o=a).isZero())return u+s;for(;u.length<6;)u="0"+u;s=""+u+s}},C.getHighBits=function(){return this.high},C.getHighBitsUnsigned=function(){return this.high>>>0},C.getLowBits=function(){return this.low},C.getLowBitsUnsigned=function(){return this.low>>>0},C.getNumBitsAbs=function(){if(this.isNegative())return this.eq(w)?64:this.neg().getNumBitsAbs();for(var t=0!=this.high?this.high:this.low,e=31;e>0&&0==(t&1<<e);e--);return 0!=this.high?e+33:e+1},C.isZero=function(){return 0===this.high&&0===this.low},C.eqz=C.isZero,C.isNegative=function(){return!this.unsigned&&this.high<0},C.isPositive=function(){return this.unsigned||this.high>=0},C.isOdd=function(){return 1==(1&this.low)},C.isEven=function(){return 0==(1&this.low)},C.equals=function(t){return i(t)||(t=d(t)),(this.unsigned===t.unsigned||this.high>>>31!=1||t.high>>>31!=1)&&(this.high===t.high&&this.low===t.low)},C.eq=C.equals,C.notEquals=function(t){return!this.eq(t)},C.neq=C.notEquals,C.ne=C.notEquals,C.lessThan=function(t){return this.comp(t)<0},C.lt=C.lessThan,C.lessThanOrEqual=function(t){return this.comp(t)<=0},C.lte=C.lessThanOrEqual,C.le=C.lessThanOrEqual,C.greaterThan=function(t){return this.comp(t)>0},C.gt=C.greaterThan,C.greaterThanOrEqual=function(t){return this.comp(t)>=0},C.gte=C.greaterThanOrEqual,C.ge=C.greaterThanOrEqual,C.compare=function(t){if(i(t)||(t=d(t)),this.eq(t))return 0;var e=this.isNegative(),n=t.isNegative();return e&&!n?-1:!e&&n?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1},C.comp=C.compare,C.negate=function(){return!this.unsigned&&this.eq(w)?w:this.not().add(_)},C.neg=C.negate,C.add=function(t){i(t)||(t=d(t));var e=this.high>>>16,n=65535&this.high,r=this.low>>>16,o=65535&this.low,s=t.high>>>16,a=65535&t.high,l=t.low>>>16,c=0,h=0,p=0,f=0;return p+=(f+=o+(65535&t.low))>>>16,h+=(p+=r+l)>>>16,c+=(h+=n+a)>>>16,c+=e+s,u((p&=65535)<<16|(f&=65535),(c&=65535)<<16|(h&=65535),this.unsigned)},C.subtract=function(t){return i(t)||(t=d(t)),this.add(t.neg())},C.sub=C.subtract,C.multiply=function(t){if(this.isZero())return v;if(i(t)||(t=d(t)),n)return u(n.mul(this.low,this.high,t.low,t.high),n.get_high(),this.unsigned);if(t.isZero())return v;if(this.eq(w))return t.isOdd()?w:v;if(t.eq(w))return this.isOdd()?w:v;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(m)&&t.lt(m))return l(this.toNumber()*t.toNumber(),this.unsigned);var e=this.high>>>16,r=65535&this.high,o=this.low>>>16,s=65535&this.low,a=t.high>>>16,c=65535&t.high,h=t.low>>>16,p=65535&t.low,f=0,g=0,b=0,_=0;return b+=(_+=s*p)>>>16,g+=(b+=o*p)>>>16,b&=65535,g+=(b+=s*h)>>>16,f+=(g+=r*p)>>>16,g&=65535,f+=(g+=o*h)>>>16,g&=65535,f+=(g+=s*c)>>>16,f+=e*p+r*h+o*c+s*a,u((b&=65535)<<16|(_&=65535),(f&=65535)<<16|(g&=65535),this.unsigned)},C.mul=C.multiply,C.divide=function(t){if(i(t)||(t=d(t)),t.isZero())throw Error("division by zero");var e,r,o;if(n)return this.unsigned||-2147483648!==this.high||-1!==t.low||-1!==t.high?u((this.unsigned?n.div_u:n.div_s)(this.low,this.high,t.low,t.high),n.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?b:v;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return b;if(t.gt(this.shru(1)))return y;o=b}else{if(this.eq(w))return t.eq(_)||t.eq(T)?w:t.eq(w)?_:(e=this.shr(1).div(t).shl(1)).eq(v)?t.isNegative()?_:T:(r=this.sub(t.mul(e)),o=e.add(r.div(t)));else if(t.eq(w))return this.unsigned?b:v;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();o=v}for(r=this;r.gte(t);){e=Math.max(1,Math.floor(r.toNumber()/t.toNumber()));for(var s=Math.ceil(Math.log(e)/Math.LN2),a=s<=48?1:c(2,s-48),h=l(e),p=h.mul(t);p.isNegative()||p.gt(r);)p=(h=l(e-=a,this.unsigned)).mul(t);h.isZero()&&(h=_),o=o.add(h),r=r.sub(p)}return o},C.div=C.divide,C.modulo=function(t){return i(t)||(t=d(t)),n?u((this.unsigned?n.rem_u:n.rem_s)(this.low,this.high,t.low,t.high),n.get_high(),this.unsigned):this.sub(this.div(t).mul(t))},C.mod=C.modulo,C.rem=C.modulo,C.not=function(){return u(~this.low,~this.high,this.unsigned)},C.and=function(t){return i(t)||(t=d(t)),u(this.low&t.low,this.high&t.high,this.unsigned)},C.or=function(t){return i(t)||(t=d(t)),u(this.low|t.low,this.high|t.high,this.unsigned)},C.xor=function(t){return i(t)||(t=d(t)),u(this.low^t.low,this.high^t.high,this.unsigned)},C.shiftLeft=function(t){return i(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?u(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):u(0,this.low<<t-32,this.unsigned)},C.shl=C.shiftLeft,C.shiftRight=function(t){return i(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?u(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):u(this.high>>t-32,this.high>=0?0:-1,this.unsigned)},C.shr=C.shiftRight,C.shiftRightUnsigned=function(t){if(i(t)&&(t=t.toInt()),0===(t&=63))return this;var e=this.high;return t<32?u(this.low>>>t|e<<32-t,e>>>t,this.unsigned):u(32===t?e:e>>>t-32,0,this.unsigned)},C.shru=C.shiftRightUnsigned,C.shr_u=C.shiftRightUnsigned,C.toSigned=function(){return this.unsigned?u(this.low,this.high,!1):this},C.toUnsigned=function(){return this.unsigned?this:u(this.low,this.high,!0)},C.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()},C.toBytesLE=function(){var t=this.high,e=this.low;return[255&e,e>>>8&255,e>>>16&255,e>>>24,255&t,t>>>8&255,t>>>16&255,t>>>24]},C.toBytesBE=function(){var t=this.high,e=this.low;return[t>>>24,t>>>16&255,t>>>8&255,255&t,e>>>24,e>>>16&255,e>>>8&255,255&e]},r.fromBytes=function(t,e,n){return n?r.fromBytesLE(t,e):r.fromBytesBE(t,e)},r.fromBytesLE=function(t,e){return new r(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,e)},r.fromBytesBE=function(t,e){return new r(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],e)}},BO1k:function(t,e,n){t.exports={default:n("fxRn"),__esModule:!0}},BVpN:function(t,e,n){"use strict";var r=n("Kkag"),i=n("l5jf"),o=n("xMQ1"),s=n("35G1");const a=Object(s.a)({abs_:
  210. /**
  211. * @license
  212. * Copyright 2018 Google LLC. All Rights Reserved.
  213. * Licensed under the Apache License, Version 2.0 (the "License");
  214. * you may not use this file except in compliance with the License.
  215. * You may obtain a copy of the License at
  216. *
  217. * http://www.apache.org/licenses/LICENSE-2.0
  218. *
  219. * Unless required by applicable law or agreed to in writing, software
  220. * distributed under the License is distributed on an "AS IS" BASIS,
  221. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  222. * See the License for the specific language governing permissions and
  223. * limitations under the License.
  224. * =============================================================================
  225. */
  226. function(t){const e=Object(o.a)(t,"x","abs");if("complex64"===e.dtype){const t={x:e};return r.a.runKernel(i.A,t)}{const t={x:e};return r.a.runKernel(i.a,t)}}});e.a=a},Bf2p:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.json=[{tfOpName:"_FusedMatMul",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"},{start:2,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"num_args",name:"numArgs",type:"number"},{tfName:"fused_ops",name:"fusedOps",type:"string[]",defaultValue:[]},{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:1e-4},{tfName:"transpose_a",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"transpose_b",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MatMul",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"transpose_a",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"transpose_b",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"BatchMatMul",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"adj_x",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"adj_y",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"BatchMatMulV2",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"adj_x",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"adj_y",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Transpose",category:"matrices",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"perm",type:"number[]"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Einsum",category:"matrices",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}],attrs:[{tfName:"equation",name:"equation",type:"string"},{tfName:"N",name:"n",type:"number",defaultValue:2},{tfName:"T",name:"dtype",type:"dtype"}]}]},BwfY:function(t,e,n){n("fWfb"),n("M6a0"),n("OYls"),n("QWe/"),t.exports=n("FeBl").Symbol},C4MV:function(t,e,n){t.exports={default:n("9bBU"),__esModule:!0}},CXw9:function(t,e,n){"use strict";var r,i,o,s,a=n("O4g8"),l=n("7KvD"),u=n("+ZMJ"),c=n("RY/4"),h=n("kM2E"),d=n("EqjI"),p=n("lOnJ"),f=n("2KxR"),g=n("NWt+"),m=n("t8x9"),v=n("L42u").set,b=n("82Mu")(),_=n("qARP"),y=n("dNDb"),T=n("iUbK"),x=n("fJUb"),E=l.TypeError,w=l.process,C=w&&w.versions,S=C&&C.v8||"",k=l.Promise,O="process"==c(w),I=function(){},R=i=_.f,A=!!function(){try{var t=k.resolve(1),e=(t.constructor={})[n("dSzd")("species")]=function(t){t(I,I)};return(O||"function"==typeof PromiseRejectionEvent)&&t.then(I)instanceof e&&0!==S.indexOf("6.6")&&-1===T.indexOf("Chrome/66")}catch(t){}}(),N=function(t){var e;return!(!d(t)||"function"!=typeof(e=t.then))&&e},D=function(t,e){if(!t._n){t._n=!0;var n=t._c;b(function(){for(var r=t._v,i=1==t._s,o=0,s=function(e){var n,o,s,a=i?e.ok:e.fail,l=e.resolve,u=e.reject,c=e.domain;try{a?(i||(2==t._h&&P(t),t._h=1),!0===a?n=r:(c&&c.enter(),n=a(r),c&&(c.exit(),s=!0)),n===e.promise?u(E("Promise-chain cycle")):(o=N(n))?o.call(n,l,u):l(n)):u(r)}catch(t){c&&!s&&c.exit(),u(t)}};n.length>o;)s(n[o++]);t._c=[],t._n=!1,e&&!t._h&&M(t)})}},M=function(t){v.call(l,function(){var e,n,r,i=t._v,o=L(t);if(o&&(e=y(function(){O?w.emit("unhandledRejection",i,t):(n=l.onunhandledrejection)?n({promise:t,reason:i}):(r=l.console)&&r.error&&r.error("Unhandled promise rejection",i)}),t._h=O||L(t)?2:1),t._a=void 0,o&&e.e)throw e.v})},L=function(t){return 1!==t._h&&0===(t._a||t._c).length},P=function(t){v.call(l,function(){var e;O?w.emit("rejectionHandled",t):(e=l.onrejectionhandled)&&e({promise:t,reason:t._v})})},F=function(t){var e=this;e._d||(e._d=!0,(e=e._w||e)._v=t,e._s=2,e._a||(e._a=e._c.slice()),D(e,!0))},B=function(t){var e,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===t)throw E("Promise can't be resolved itself");(e=N(t))?b(function(){var r={_w:n,_d:!1};try{e.call(t,u(B,r,1),u(F,r,1))}catch(t){F.call(r,t)}}):(n._v=t,n._s=1,D(n,!1))}catch(t){F.call({_w:n,_d:!1},t)}}};A||(k=function(t){f(this,k,"Promise","_h"),p(t),r.call(this);try{t(u(B,this,1),u(F,this,1))}catch(t){F.call(this,t)}},(r=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=n("xH/j")(k.prototype,{then:function(t,e){var n=R(m(this,k));return n.ok="function"!=typeof t||t,n.fail="function"==typeof e&&e,n.domain=O?w.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&D(this,!1),n.promise},catch:function(t){return this.then(void 0,t)}}),o=function(){var t=new r;this.promise=t,this.resolve=u(B,t,1),this.reject=u(F,t,1)},_.f=R=function(t){return t===k||t===s?new o(t):i(t)}),h(h.G+h.W+h.F*!A,{Promise:k}),n("e6n0")(k,"Promise"),n("bRrM")("Promise"),s=n("FeBl").Promise,h(h.S+h.F*!A,"Promise",{reject:function(t){var e=R(this);return(0,e.reject)(t),e.promise}}),h(h.S+h.F*(a||!A),"Promise",{resolve:function(t){return x(a&&this===s?k:this,t)}}),h(h.S+h.F*!(A&&n("dY0y")(function(t){k.all(t).catch(I)})),"Promise",{all:function(t){var e=this,n=R(e),r=n.resolve,i=n.reject,o=y(function(){var n=[],o=0,s=1;g(t,!1,function(t){var a=o++,l=!1;n.push(void 0),s++,e.resolve(t).then(function(t){l||(l=!0,n[a]=t,--s||r(n))},i)}),--s||r(n)});return o.e&&i(o.v),n.promise},race:function(t){var e=this,n=R(e),r=n.reject,i=y(function(){g(t,!1,function(t){e.resolve(t).then(n.resolve,r)})});return i.e&&r(i.v),n.promise}})},Cdx3:function(t,e,n){var r=n("sB3e"),i=n("lktj");n("uqUo")("keys",function(){return function(t){return i(r(t))}})},"Cp+6":function(t,e,n){"use strict";var r=n("Kkag"),i=n("l5jf"),o=n("xMQ1"),s=n("MlK1"),a=n("35G1");const l=Object(a.a)({sum_:
  227. /**
  228. * @license
  229. * Copyright 2018 Google LLC. All Rights Reserved.
  230. * Licensed under the Apache License, Version 2.0 (the "License");
  231. * you may not use this file except in compliance with the License.
  232. * You may obtain a copy of the License at
  233. *
  234. * http://www.apache.org/licenses/LICENSE-2.0
  235. *
  236. * Unless required by applicable law or agreed to in writing, software
  237. * distributed under the License is distributed on an "AS IS" BASIS,
  238. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  239. * See the License for the specific language governing permissions and
  240. * limitations under the License.
  241. * =============================================================================
  242. */
  243. function(t,e=null,n=!1){let a=Object(o.a)(t,"x","sum");"bool"===a.dtype&&(a=Object(s.a)(a,"int32"));const l={x:a},u={axis:e,keepDims:n};return r.a.runKernel(i._98,l,u)}});e.a=l},Cr6W:function(t,e,n){var r,i,o,s;s=function(t,e){
  244. /**
  245. * @license
  246. * Copyright 2020 Google LLC
  247. * SPDX-License-Identifier: Apache-2.0
  248. */
  249. "use strict";return t.JavaScript=e,e},i=[n("xnUL"),n("JMbB")],void 0===(o="function"==typeof(r=s)?r.apply(e,i):r)||(t.exports=o)},CwSZ:function(t,e,n){"use strict";var r=n("p8xL"),i=n("XgCd"),o=Object.prototype.hasOwnProperty,s={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,e){return t+"["+e+"]"},repeat:function(t){return t}},a=Array.isArray,l=Array.prototype.push,u=function(t,e){l.apply(t,a(e)?e:[e])},c=Date.prototype.toISOString,h={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:r.encode,encodeValuesOnly:!1,formatter:i.formatters[i.default],indices:!1,serializeDate:function(t){return c.call(t)},skipNulls:!1,strictNullHandling:!1},d=function t(e,n,i,o,s,l,c,d,p,f,g,m,v){var b=e;if("function"==typeof c?b=c(n,b):b instanceof Date?b=f(b):"comma"===i&&a(b)&&(b=b.join(",")),null===b){if(o)return l&&!m?l(n,h.encoder,v):n;b=""}if("string"==typeof b||"number"==typeof b||"boolean"==typeof b||r.isBuffer(b))return l?[g(m?n:l(n,h.encoder,v))+"="+g(l(b,h.encoder,v))]:[g(n)+"="+g(String(b))];var _,y=[];if(void 0===b)return y;if(a(c))_=c;else{var T=Object.keys(b);_=d?T.sort(d):T}for(var x=0;x<_.length;++x){var E=_[x];s&&null===b[E]||(a(b)?u(y,t(b[E],"function"==typeof i?i(n,E):n,i,o,s,l,c,d,p,f,g,m,v)):u(y,t(b[E],n+(p?"."+E:"["+E+"]"),i,o,s,l,c,d,p,f,g,m,v)))}return y};t.exports=function(t,e){var n,r=t,l=function(t){if(!t)return h;if(null!==t.encoder&&void 0!==t.encoder&&"function"!=typeof t.encoder)throw new TypeError("Encoder has to be a function.");var e=t.charset||h.charset;if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=i.default;if(void 0!==t.format){if(!o.call(i.formatters,t.format))throw new TypeError("Unknown format option provided.");n=t.format}var r=i.formatters[n],s=h.filter;return("function"==typeof t.filter||a(t.filter))&&(s=t.filter),{addQueryPrefix:"boolean"==typeof t.addQueryPrefix?t.addQueryPrefix:h.addQueryPrefix,allowDots:void 0===t.allowDots?h.allowDots:!!t.allowDots,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:h.charsetSentinel,delimiter:void 0===t.delimiter?h.delimiter:t.delimiter,encode:"boolean"==typeof t.encode?t.encode:h.encode,encoder:"function"==typeof t.encoder?t.encoder:h.encoder,encodeValuesOnly:"boolean"==typeof t.encodeValuesOnly?t.encodeValuesOnly:h.encodeValuesOnly,filter:s,formatter:r,serializeDate:"function"==typeof t.serializeDate?t.serializeDate:h.serializeDate,skipNulls:"boolean"==typeof t.skipNulls?t.skipNulls:h.skipNulls,sort:"function"==typeof t.sort?t.sort:null,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:h.strictNullHandling}}(e);"function"==typeof l.filter?r=(0,l.filter)("",r):a(l.filter)&&(n=l.filter);var c,p=[];if("object"!=typeof r||null===r)return"";c=e&&e.arrayFormat in s?e.arrayFormat:e&&"indices"in e?e.indices?"indices":"repeat":"indices";var f=s[c];n||(n=Object.keys(r)),l.sort&&n.sort(l.sort);for(var g=0;g<n.length;++g){var m=n[g];l.skipNulls&&null===r[m]||u(p,d(r[m],m,f,l.strictNullHandling,l.skipNulls,l.encode?l.encoder:null,l.filter,l.sort,l.allowDots,l.serializeDate,l.formatter,l.encodeValuesOnly,l.charset))}var v=p.join(l.delimiter),b=!0===l.addQueryPrefix?"?":"";return l.charsetSentinel&&("iso-8859-1"===l.charset?b+="utf8=%26%2310003%3B&":b+="utf8=%E2%9C%93&"),v.length>0?b+v:""}},"Cwm/":function(t,e,n){"use strict";var r=n("Kkag"),i=n("l5jf"),o=n("xMQ1"),s=n("35G1");const a=Object(s.a)({zerosLike_:
  250. /**
  251. * @license
  252. * Copyright 2018 Google LLC. All Rights Reserved.
  253. * Licensed under the Apache License, Version 2.0 (the "License");
  254. * you may not use this file except in compliance with the License.
  255. * You may obtain a copy of the License at
  256. *
  257. * http://www.apache.org/licenses/LICENSE-2.0
  258. *
  259. * Unless required by applicable law or agreed to in writing, software
  260. * distributed under the License is distributed on an "AS IS" BASIS,
  261. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  262. * See the License for the specific language governing permissions and
  263. * limitations under the License.
  264. * =============================================================================
  265. */
  266. function(t){const e={x:Object(o.a)(t,"x","zerosLike")};return r.a.runKernel(i._108,e)}});e.a=a},D2L2:function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},DDCP:function(t,e,n){"use strict";var r=n("p8xL"),i=Object.prototype.hasOwnProperty,o={allowDots:!1,allowPrototypes:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:r.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},s=function(t){return t.replace(/&#(\d+);/g,function(t,e){return String.fromCharCode(parseInt(e,10))})},a=function(t,e,n){if(t){var r=n.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,o=/(\[[^[\]]*])/g,s=/(\[[^[\]]*])/.exec(r),a=s?r.slice(0,s.index):r,l=[];if(a){if(!n.plainObjects&&i.call(Object.prototype,a)&&!n.allowPrototypes)return;l.push(a)}for(var u=0;null!==(s=o.exec(r))&&u<n.depth;){if(u+=1,!n.plainObjects&&i.call(Object.prototype,s[1].slice(1,-1))&&!n.allowPrototypes)return;l.push(s[1])}return s&&l.push("["+r.slice(s.index)+"]"),function(t,e,n){for(var r=e,i=t.length-1;i>=0;--i){var o,s=t[i];if("[]"===s&&n.parseArrays)o=[].concat(r);else{o=n.plainObjects?Object.create(null):{};var a="["===s.charAt(0)&&"]"===s.charAt(s.length-1)?s.slice(1,-1):s,l=parseInt(a,10);n.parseArrays||""!==a?!isNaN(l)&&s!==a&&String(l)===a&&l>=0&&n.parseArrays&&l<=n.arrayLimit?(o=[])[l]=r:o[a]=r:o={0:r}}r=o}return r}(l,e,n)}};t.exports=function(t,e){var n=function(t){if(!t)return o;if(null!==t.decoder&&void 0!==t.decoder&&"function"!=typeof t.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new Error("The charset option must be either utf-8, iso-8859-1, or undefined");var e=void 0===t.charset?o.charset:t.charset;return{allowDots:void 0===t.allowDots?o.allowDots:!!t.allowDots,allowPrototypes:"boolean"==typeof t.allowPrototypes?t.allowPrototypes:o.allowPrototypes,arrayLimit:"number"==typeof t.arrayLimit?t.arrayLimit:o.arrayLimit,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:o.charsetSentinel,comma:"boolean"==typeof t.comma?t.comma:o.comma,decoder:"function"==typeof t.decoder?t.decoder:o.decoder,delimiter:"string"==typeof t.delimiter||r.isRegExp(t.delimiter)?t.delimiter:o.delimiter,depth:"number"==typeof t.depth?t.depth:o.depth,ignoreQueryPrefix:!0===t.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof t.interpretNumericEntities?t.interpretNumericEntities:o.interpretNumericEntities,parameterLimit:"number"==typeof t.parameterLimit?t.parameterLimit:o.parameterLimit,parseArrays:!1!==t.parseArrays,plainObjects:"boolean"==typeof t.plainObjects?t.plainObjects:o.plainObjects,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:o.strictNullHandling}}(e);if(""===t||null===t||void 0===t)return n.plainObjects?Object.create(null):{};for(var l="string"==typeof t?function(t,e){var n,a={},l=e.ignoreQueryPrefix?t.replace(/^\?/,""):t,u=e.parameterLimit===1/0?void 0:e.parameterLimit,c=l.split(e.delimiter,u),h=-1,d=e.charset;if(e.charsetSentinel)for(n=0;n<c.length;++n)0===c[n].indexOf("utf8=")&&("utf8=%E2%9C%93"===c[n]?d="utf-8":"utf8=%26%2310003%3B"===c[n]&&(d="iso-8859-1"),h=n,n=c.length);for(n=0;n<c.length;++n)if(n!==h){var p,f,g=c[n],m=g.indexOf("]="),v=-1===m?g.indexOf("="):m+1;-1===v?(p=e.decoder(g,o.decoder,d),f=e.strictNullHandling?null:""):(p=e.decoder(g.slice(0,v),o.decoder,d),f=e.decoder(g.slice(v+1),o.decoder,d)),f&&e.interpretNumericEntities&&"iso-8859-1"===d&&(f=s(f)),f&&e.comma&&f.indexOf(",")>-1&&(f=f.split(",")),i.call(a,p)?a[p]=r.combine(a[p],f):a[p]=f}return a}(t,n):t,u=n.plainObjects?Object.create(null):{},c=Object.keys(l),h=0;h<c.length;++h){var d=c[h],p=a(d,l[d],n);u=r.merge(u,p,n)}return r.compact(u)}},DQCr:function(t,e,n){"use strict";var r=n("cGG2");function i(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}t.exports=function(t,e,n){if(!e)return t;var o;if(n)o=n(e);else if(r.isURLSearchParams(e))o=e.toString();else{var s=[];r.forEach(e,function(t,e){null!==t&&void 0!==t&&(r.isArray(t)?e+="[]":t=[t],r.forEach(t,function(t){r.isDate(t)?t=t.toISOString():r.isObject(t)&&(t=JSON.stringify(t)),s.push(i(e)+"="+i(t))}))}),o=s.join("&")}if(o){var a=t.indexOf("#");-1!==a&&(t=t.slice(0,a)),t+=(-1===t.indexOf("?")?"?":"&")+o}return t}},DQJY:function(t,e,n){"use strict";e.__esModule=!0;var r,i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o=n("hyEB"),s=(r=o)&&r.__esModule?r:{default:r};var a,l=l||{};l.Dialog=function(t,e,n){var r=this;if(this.dialogNode=t,null===this.dialogNode||"dialog"!==this.dialogNode.getAttribute("role"))throw new Error("Dialog() requires a DOM element with ARIA role of dialog.");"string"==typeof e?this.focusAfterClosed=document.getElementById(e):"object"===(void 0===e?"undefined":i(e))?this.focusAfterClosed=e:this.focusAfterClosed=null,"string"==typeof n?this.focusFirst=document.getElementById(n):"object"===(void 0===n?"undefined":i(n))?this.focusFirst=n:this.focusFirst=null,this.focusFirst?this.focusFirst.focus():s.default.focusFirstDescendant(this.dialogNode),this.lastFocus=document.activeElement,a=function(t){r.trapFocus(t)},this.addListeners()},l.Dialog.prototype.addListeners=function(){document.addEventListener("focus",a,!0)},l.Dialog.prototype.removeListeners=function(){document.removeEventListener("focus",a,!0)},l.Dialog.prototype.closeDialog=function(){var t=this;this.removeListeners(),this.focusAfterClosed&&setTimeout(function(){t.focusAfterClosed.focus()})},l.Dialog.prototype.trapFocus=function(t){s.default.IgnoreUtilFocusChanges||(this.dialogNode.contains(t.target)?this.lastFocus=t.target:(s.default.focusFirstDescendant(this.dialogNode),this.lastFocus===document.activeElement&&s.default.focusLastDescendant(this.dialogNode),this.lastFocus=document.activeElement))},e.default=l.Dialog},DUeU:function(t,e,n){"use strict";var r=n("cGG2");t.exports=function(t,e){e=e||{};var n={},i=["url","method","data"],o=["headers","auth","proxy","params"],s=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],a=["validateStatus"];function l(t,e){return r.isPlainObject(t)&&r.isPlainObject(e)?r.merge(t,e):r.isPlainObject(e)?r.merge({},e):r.isArray(e)?e.slice():e}function u(i){r.isUndefined(e[i])?r.isUndefined(t[i])||(n[i]=l(void 0,t[i])):n[i]=l(t[i],e[i])}r.forEach(i,function(t){r.isUndefined(e[t])||(n[t]=l(void 0,e[t]))}),r.forEach(o,u),r.forEach(s,function(i){r.isUndefined(e[i])?r.isUndefined(t[i])||(n[i]=l(void 0,t[i])):n[i]=l(void 0,e[i])}),r.forEach(a,function(r){r in e?n[r]=l(t[r],e[r]):r in t&&(n[r]=l(void 0,t[r]))});var c=i.concat(o).concat(s).concat(a),h=Object.keys(t).concat(Object.keys(e)).filter(function(t){return-1===c.indexOf(t)});return r.forEach(h,u),n}},DYVU:function(t,e,n){"use strict";
  267. /**
  268. * @license
  269. * Copyright 2020 Google LLC. All Rights Reserved.
  270. * Licensed under the Apache License, Version 2.0 (the "License");
  271. * you may not use this file except in compliance with the License.
  272. * You may obtain a copy of the License at
  273. *
  274. * http://www.apache.org/licenses/LICENSE-2.0
  275. *
  276. * Unless required by applicable law or agreed to in writing, software
  277. * distributed under the License is distributed on an "AS IS" BASIS,
  278. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  279. * See the License for the specific language governing permissions and
  280. * limitations under the License.
  281. * =============================================================================
  282. */
  283. function r(t){let e=t.length,n=0;for(;e>0;)n=Math.random()*e|0,i(t,--e,n)}function i(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function o(t,e){if(!t)throw new Error("string"==typeof e?e:e())}function s(t,e){if(t===e)return!0;if(null==t||null==e)return!1;if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function a(t){return t%1==0}function l(t,e){const n=e.length;return o((t=null==t?e.map((t,e)=>e):[].concat(t)).every(t=>t>=-n&&t<n),()=>`All values in axis param must be in range [-${n}, ${n}) but `+`got axis ${t}`),o(t.every(t=>a(t)),()=>"All values in axis param must be integers but "+`got axis ${t}`),t.map(t=>t<0?n+t:t)}function u(t){return t instanceof Float32Array||t instanceof Int32Array||t instanceof Uint8Array||t instanceof Uint8ClampedArray}function c(t){return"string"==typeof t||t instanceof String}function h(t){return"boolean"==typeof t}function d(t){return"number"==typeof t}function p(t,e,n=!1){if(0===t.length)return e[0];const r=t.reduce((t,e)=>t*e)*(n?2:1);if(0===r)return[];if(r!==e.length)throw new Error(`[${t}] does not match the input size ${e.length}${n?" for a complex tensor":""}.`);return function t(e,n,r,i=!1){const o=new Array;if(1===n.length){const t=n[0]*(i?2:1);for(let n=0;n<t;n++)o[n]=r[e+n]}else{const s=n[0],a=n.slice(1),l=a.reduce((t,e)=>t*e)*(i?2:1);for(let n=0;n<s;n++)o[n]=t(e+n*l,a,r,i)}return o}(0,t,e,n)}function f(t,e){if(null==e||"float32"===e||"complex64"===e)return new Float32Array(t);if("int32"===e)return new Int32Array(t);if("bool"===e)return new Uint8Array(t);throw new Error(`Unknown data type ${e}`)}e.M=r,e.N=function(t,e){if(t.length!==e.length)throw new Error("Array sizes must match to be shuffled together "+`First array length was ${t.length}`+`Second array length was ${e.length}`);let n=t.length,r=0;for(;n>0;)r=Math.random()*n|0,i(t,--n,r),i(e,n,r)},e.i=function(t,e,n){return Math.max(t,Math.min(e,n))},e.H=function(t){return t%2==0?t:t+1},e.S=i,e.R=function(t){let e=0;for(let n=0;n<t.length;n++)e+=t[n];return e},e.J=function(t,e){const n=Math.random();return e*n+(1-n)*t},e.l=function(t,e){let n=0;for(let r=0;r<t.length;r++){const i=Number(t[r])-Number(e[r]);n+=i*i}return n},e.b=o,e.e=function(t,e,n=""){o(s(t,e),()=>n+` Shapes ${t} and ${e} must match`)},e.d=function(t){o(null!=t,()=>"The input to the tensor constructor must be a non-null value.")},e.m=function t(e,n=[],r=!1){null==n&&(n=[]);if(Array.isArray(e)||u(e)&&!r)for(let i=0;i<e.length;++i)t(e[i],n,r);else n.push(e);return n},e.O=function(t){if(0===t.length)return 1;let e=t[0];for(let n=1;n<t.length;n++)e*=t[n];return e},e.y=function(t){return 0===t.length},e.a=s,e.v=a,e.T=function(t){if(null!=Math.tanh)return Math.tanh(t);if(t===1/0)return 1;if(t===-1/0)return-1;{const e=Math.exp(2*t);return(e-1)/(e+1)}},e.P=function(t){const e=Math.ceil(Math.sqrt(t));return[e,Math.ceil(t/e)]},e.k=function(t){const e=new Uint32Array(t);for(let n=0;n<t;++n)e[n]=n;return r(e),e},e.L=function(t,e){if(e<=t.length)return t;return t+" ".repeat(e-t.length)},e.K=function(t,e=(t=>0),n){return new Promise((r,i)=>{let o=0;const s=()=>{if(t())return void r();const a=e(++o);null!=n&&o>=n?i():setTimeout(s,a)};s()})},e.s=function(t,e){let n=1,r=-1;for(let e=0;e<t.length;++e)if(t[e]>=0)n*=t[e];else if(-1===t[e]){if(-1!==r)throw Error("Shapes can only have 1 implicit size. "+`Found -1 at dim ${r} and dim ${e}`);r=e}else if(t[e]<0)throw Error(`Shapes can not be < 0. Found ${t[e]} at dim ${e}`);if(-1===r){if(e>0&&e!==n)throw Error(`Size(${e}) must match the product of shape ${t}`);return t}if(0===n)throw Error(`Cannot infer the missing size in [${t}] when `+"there are 0 elements");if(e%n!=0)throw Error("The implicit shape can't be a fractional number. "+`Got ${e} / ${n}`);const i=t.slice();return i[r]=e/n,i},e.I=l,e.Q=function(t,e){const n=[],r=[],i=null!=e&&Array.isArray(e)&&0===e.length,o=null==e||i?null:l(e,t).sort();let s=0;for(let e=0;e<t.length;++e){if(null!=o){if(o[s]===e&&1!==t[e])throw new Error(`Can't squeeze axis ${e} since its dim '${t[e]}' is not 1`);(null==o[s]||o[s]>e)&&1===t[e]&&(n.push(t[e]),r.push(e)),o[s]<=e&&s++}1!==t[e]&&(n.push(t[e]),r.push(e))}return{newShape:n,keptDims:r}},e.o=function(t,e){let n=null;if(null==t||"float32"===t)n=new Float32Array(e);else if("int32"===t)n=new Int32Array(e);else{if("bool"!==t)throw new Error(`Unknown data type ${t}`);n=new Uint8Array(e)}return n},e.n=function(t,e){let n=null;if(null==t||"float32"===t)n=new Float32Array(e);else if("int32"===t)n=new Int32Array(e);else if("bool"===t)n=new Uint8Array(e);else{if("string"!==t)throw new Error(`Unknown data type ${t}`);n=new Array(e)}return n},e.h=function(t,e){for(let n=0;n<t.length;n++){const r=t[n];if(isNaN(r)||!isFinite(r))throw Error(`A tensor of type ${e} being uploaded contains ${r}.`)}},e.B=function(t){return"bool"===t||"complex64"===t||"float32"===t||"int32"===t||"string"===t},e.p=function(t,e){if("complex64"===e)return!1;if("float32"===e&&"complex64"!==t)return!1;if("int32"===e&&"float32"!==t&&"complex64"!==t)return!1;if("bool"===e&&"bool"===t)return!1;return!0},e.A=u,e.g=function(t){if("float32"===t||"int32"===t)return 4;if("complex64"===t)return 8;if("bool"===t)return 1;throw new Error(`Unknown dtype ${t}`)},e.f=function(t){if(null==t)return 0;let e=0;return t.forEach(t=>e+=t.length),e},e.z=c,e.t=h,e.w=d,e.r=function t(e){if(Array.isArray(e))return t(e[0]);if(e instanceof Float32Array)return"float32";if(e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray)return"int32";if(d(e))return"float32";if(c(e))return"string";if(h(e))return"bool";return"float32"},e.u=function(t){return!!(t&&t.constructor&&t.call&&t.apply)},e.G=function(t,e){for(let n=e;n<t;++n)if(t%n==0)return n;return t},e.j=function(t){const e=t.length;if(e<2)return[];const n=new Array(e-1);n[e-2]=t[e-1];for(let r=e-3;r>=0;--r)n[r]=n[r+1]*t[r+1];return n},e.U=p,e.D=function(t,e){const n=f(t,e);for(let t=0;t<n.length;t++)n[t]=1;return n},e.F=f,e.E=function(t,e){const n=t.reduce((t,e)=>t*e,1);if(null==e||"float32"===e)return p(t,new Float32Array(n));if("int32"===e)return p(t,new Int32Array(n));if("bool"===e)return p(t,new Uint8Array(n));throw new Error(`Unknown data type ${e}`)},e.c=function(t){t.forEach(e=>{o(Number.isInteger(e)&&e>=0,()=>"Tensor must have a shape comprised of positive integers but got "+`shape [${t}].`)})},e.C=function(t,e,n){if(0===e)return 0;if(1===e)return t[0];let r=t[t.length-1];for(let e=0;e<t.length-1;++e)r+=n[e]*t[e];return r},e.q=function(t,e,n){if(0===e)return[];if(1===e)return[t];const r=new Array(e);for(let e=0;e<r.length-1;++e)r[e]=Math.floor(t/n[e]),t-=r[e]*n[e];return r[r.length-1]=t,r},e.x=function(t){return t&&t.then&&"function"==typeof t.then}},Dd8w:function(t,e,n){"use strict";e.__esModule=!0;var r,i=n("woOf"),o=(r=i)&&r.__esModule?r:{default:r};e.default=o.default||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}},DqkE:function(t,e,n){"use strict";e.b=i,e.c=o,e.d=function(t,e){const n=[],r=t.length;for(let i=0;i<r;i++)-1===e.indexOf(i)&&n.push(t[i]);const i=e.map(e=>t[e]);return[n,i]},e.e=function(t,e){const n=e.map(t=>1);return o(t,n,e)},e.a=function(t,e,n){r.assert(i(e,n),()=>`${t} supports only inner-most axes for now. `+`Got axes ${e} and rank-${n} input.`)},e.f=function(t,e){if(i(t,e))return null;const n=[];for(let r=0;r<e;++r)-1===t.indexOf(r)&&n.push(r);return t.forEach(t=>n.push(t)),n},e.h=function(t){return t.map((t,e)=>[e,t]).sort((t,e)=>t[1]-e[1]).map(t=>t[0])},e.g=function(t,e){const n=[];for(let r=e-t;r<e;++r)n.push(r);return n};var r=n("XFvI");
  284. /**
  285. * @license
  286. * Copyright 2017 Google LLC. All Rights Reserved.
  287. * Licensed under the Apache License, Version 2.0 (the "License");
  288. * you may not use this file except in compliance with the License.
  289. * You may obtain a copy of the License at
  290. *
  291. * http://www.apache.org/licenses/LICENSE-2.0
  292. *
  293. * Unless required by applicable law or agreed to in writing, software
  294. * distributed under the License is distributed on an "AS IS" BASIS,
  295. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  296. * See the License for the specific language governing permissions and
  297. * limitations under the License.
  298. * =============================================================================
  299. */function i(t,e){for(let n=0;n<t.length;++n)if(t[t.length-n-1]!==e-1-n)return!1;return!0}function o(t,e,n){const r=t.length+e.length,i=[];let o=0,s=0;for(let a=0;a<r;a++)-1===n.indexOf(a)?i.push(t[o++]):i.push(e[s++]);return i}},DuR2:function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n},"E+Sk":function(t,e,n){var r;r=function(t){return t.pad.ZeroPadding={pad:function(t,e){var n=4*e;t.clamp(),t.sigBytes+=n-(t.sigBytes%n||n)},unpad:function(t){var e=t.words,n=t.sigBytes-1;for(n=t.sigBytes-1;n>=0;n--)if(e[n>>>2]>>>24-n%4*8&255){t.sigBytes=n+1;break}}},t.pad.ZeroPadding},t.exports=r(n("02Hb"),n("fGru"))},"E/in":function(t,e,n){"use strict";e.__esModule=!0,e.isDef=function(t){return void 0!==t&&null!==t},e.isKorean=function(t){return/([(\uAC00-\uD7AF)|(\u3130-\u318F)])+/gi.test(t)}},E3Xu:function(t,e,n){var r;r=function(t){return t.mode.CFB=function(){var e=t.lib.BlockCipherMode.extend();function n(t,e,n,r){var i,o=this._iv;o?(i=o.slice(0),this._iv=void 0):i=this._prevBlock,r.encryptBlock(i,0);for(var s=0;s<n;s++)t[e+s]^=i[s]}return e.Encryptor=e.extend({processBlock:function(t,e){var r=this._cipher,i=r.blockSize;n.call(this,t,e,i,r),this._prevBlock=t.slice(e,e+i)}}),e.Decryptor=e.extend({processBlock:function(t,e){var r=this._cipher,i=r.blockSize,o=t.slice(e,e+i);n.call(this,t,e,i,r),this._prevBlock=o}}),e}(),t.mode.CFB},t.exports=r(n("02Hb"),n("fGru"))},EGZi:function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},EKTV:function(t,e,n){t.exports=function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/dist/",n(n.s=119)}({0:function(t,e,n){"use strict";function r(t,e,n,r,i,o,s,a){var l,u="function"==typeof t?t.options:t;if(e&&(u.render=e,u.staticRenderFns=n,u._compiled=!0),r&&(u.functional=!0),o&&(u._scopeId="data-v-"+o),s?(l=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(s)},u._ssrRegister=l):i&&(l=a?function(){i.call(this,this.$root.$options.shadowRoot)}:i),l)if(u.functional){u._injectStyles=l;var c=u.render;u.render=function(t,e){return l.call(e),c(t,e)}}else{var h=u.beforeCreate;u.beforeCreate=h?[].concat(h,l):[l]}return{exports:t,options:u}}n.d(e,"a",function(){return r})},119:function(t,e,n){"use strict";n.r(e);var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("label",{staticClass:"el-checkbox",class:[t.border&&t.checkboxSize?"el-checkbox--"+t.checkboxSize:"",{"is-disabled":t.isDisabled},{"is-bordered":t.border},{"is-checked":t.isChecked}],attrs:{id:t.id}},[n("span",{staticClass:"el-checkbox__input",class:{"is-disabled":t.isDisabled,"is-checked":t.isChecked,"is-indeterminate":t.indeterminate,"is-focus":t.focus},attrs:{tabindex:!!t.indeterminate&&0,role:!!t.indeterminate&&"checkbox","aria-checked":!!t.indeterminate&&"mixed"}},[n("span",{staticClass:"el-checkbox__inner"}),t.trueLabel||t.falseLabel?n("input",{directives:[{name:"model",rawName:"v-model",value:t.model,expression:"model"}],staticClass:"el-checkbox__original",attrs:{type:"checkbox","aria-hidden":t.indeterminate?"true":"false",name:t.name,disabled:t.isDisabled,"true-value":t.trueLabel,"false-value":t.falseLabel},domProps:{checked:Array.isArray(t.model)?t._i(t.model,null)>-1:t._q(t.model,t.trueLabel)},on:{change:[function(e){var n=t.model,r=e.target,i=r.checked?t.trueLabel:t.falseLabel;if(Array.isArray(n)){var o=t._i(n,null);r.checked?o<0&&(t.model=n.concat([null])):o>-1&&(t.model=n.slice(0,o).concat(n.slice(o+1)))}else t.model=i},t.handleChange],focus:function(e){t.focus=!0},blur:function(e){t.focus=!1}}}):n("input",{directives:[{name:"model",rawName:"v-model",value:t.model,expression:"model"}],staticClass:"el-checkbox__original",attrs:{type:"checkbox","aria-hidden":t.indeterminate?"true":"false",disabled:t.isDisabled,name:t.name},domProps:{value:t.label,checked:Array.isArray(t.model)?t._i(t.model,t.label)>-1:t.model},on:{change:[function(e){var n=t.model,r=e.target,i=!!r.checked;if(Array.isArray(n)){var o=t.label,s=t._i(n,o);r.checked?s<0&&(t.model=n.concat([o])):s>-1&&(t.model=n.slice(0,s).concat(n.slice(s+1)))}else t.model=i},t.handleChange],focus:function(e){t.focus=!0},blur:function(e){t.focus=!1}}})]),t.$slots.default||t.label?n("span",{staticClass:"el-checkbox__label"},[t._t("default"),t.$slots.default?t._e():[t._v(t._s(t.label))]],2):t._e()])};r._withStripped=!0;var i=n(4),o={name:"ElCheckbox",mixins:[n.n(i).a],inject:{elForm:{default:""},elFormItem:{default:""}},componentName:"ElCheckbox",data:function(){return{selfModel:!1,focus:!1,isLimitExceeded:!1}},computed:{model:{get:function(){return this.isGroup?this.store:void 0!==this.value?this.value:this.selfModel},set:function(t){this.isGroup?(this.isLimitExceeded=!1,void 0!==this._checkboxGroup.min&&t.length<this._checkboxGroup.min&&(this.isLimitExceeded=!0),void 0!==this._checkboxGroup.max&&t.length>this._checkboxGroup.max&&(this.isLimitExceeded=!0),!1===this.isLimitExceeded&&this.dispatch("ElCheckboxGroup","input",[t])):(this.$emit("input",t),this.selfModel=t)}},isChecked:function(){return"[object Boolean]"==={}.toString.call(this.model)?this.model:Array.isArray(this.model)?this.model.indexOf(this.label)>-1:null!==this.model&&void 0!==this.model?this.model===this.trueLabel:void 0},isGroup:function(){for(var t=this.$parent;t;){if("ElCheckboxGroup"===t.$options.componentName)return this._checkboxGroup=t,!0;t=t.$parent}return!1},store:function(){return this._checkboxGroup?this._checkboxGroup.value:this.value},isLimitDisabled:function(){var t=this._checkboxGroup,e=t.max,n=t.min;return!(!e&&!n)&&this.model.length>=e&&!this.isChecked||this.model.length<=n&&this.isChecked},isDisabled:function(){return this.isGroup?this._checkboxGroup.disabled||this.disabled||(this.elForm||{}).disabled||this.isLimitDisabled:this.disabled||(this.elForm||{}).disabled},_elFormItemSize:function(){return(this.elFormItem||{}).elFormItemSize},checkboxSize:function(){var t=this.size||this._elFormItemSize||(this.$ELEMENT||{}).size;return this.isGroup&&this._checkboxGroup.checkboxGroupSize||t}},props:{value:{},label:{},indeterminate:Boolean,disabled:Boolean,checked:Boolean,name:String,trueLabel:[String,Number],falseLabel:[String,Number],id:String,controls:String,border:Boolean,size:String},methods:{addToStore:function(){Array.isArray(this.model)&&-1===this.model.indexOf(this.label)?this.model.push(this.label):this.model=this.trueLabel||!0},handleChange:function(t){var e=this;if(!this.isLimitExceeded){var n=void 0;n=t.target.checked?void 0===this.trueLabel||this.trueLabel:void 0!==this.falseLabel&&this.falseLabel,this.$emit("change",n,t),this.$nextTick(function(){e.isGroup&&e.dispatch("ElCheckboxGroup","change",[e._checkboxGroup.value])})}}},created:function(){this.checked&&this.addToStore()},mounted:function(){this.indeterminate&&this.$el.setAttribute("aria-controls",this.controls)},watch:{value:function(t){this.dispatch("ElFormItem","el.form.change",t)}}},s=n(0),a=Object(s.a)(o,r,[],!1,null,null,null);a.options.__file="packages/checkbox/src/checkbox.vue";var l=a.exports;l.install=function(t){t.component(l.name,l)};e.default=l},4:function(t,e){t.exports=n("fPll")}})},EKta:function(t,e,n){"use strict";e.byteLength=function(t){var e=u(t),n=e[0],r=e[1];return 3*(n+r)/4-r},e.toByteArray=function(t){var e,n,r=u(t),s=r[0],a=r[1],l=new o(function(t,e,n){return 3*(e+n)/4-n}(0,s,a)),c=0,h=a>0?s-4:s;for(n=0;n<h;n+=4)e=i[t.charCodeAt(n)]<<18|i[t.charCodeAt(n+1)]<<12|i[t.charCodeAt(n+2)]<<6|i[t.charCodeAt(n+3)],l[c++]=e>>16&255,l[c++]=e>>8&255,l[c++]=255&e;2===a&&(e=i[t.charCodeAt(n)]<<2|i[t.charCodeAt(n+1)]>>4,l[c++]=255&e);1===a&&(e=i[t.charCodeAt(n)]<<10|i[t.charCodeAt(n+1)]<<4|i[t.charCodeAt(n+2)]>>2,l[c++]=e>>8&255,l[c++]=255&e);return l},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],s=0,a=n-i;s<a;s+=16383)o.push(c(t,s,s+16383>a?a:s+16383));1===i?(e=t[n-1],o.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],o.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"="));return o.join("")};for(var r=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,l=s.length;a<l;++a)r[a]=s[a],i[s.charCodeAt(a)]=a;function u(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function c(t,e,n){for(var i,o,s=[],a=e;a<n;a+=3)i=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]),s.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},EqBC:function(t,e,n){"use strict";var r=n("kM2E"),i=n("FeBl"),o=n("7KvD"),s=n("t8x9"),a=n("fJUb");r(r.P+r.R,"Promise",{finally:function(t){var e=s(this,i.Promise||o.Promise),n="function"==typeof t;return this.then(n?function(n){return a(e,t()).then(function(){return n})}:t,n?function(n){return a(e,t()).then(function(){throw n})}:t)}})},EqjI:function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},EuP9:function(t,e,n){"use strict";(function(t){
  300. /*!
  301. * The buffer module from node.js, for the browser.
  302. *
  303. * @author Feross Aboukhadijeh <http://feross.org>
  304. * @license MIT
  305. */
  306. var r=n("EKta"),i=n("ujcs"),o=n("sOR5");function s(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,e){if(s()<e)throw new RangeError("Invalid typed array length");return l.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=l.prototype:(null===t&&(t=new l(e)),t.length=e),t}function l(t,e,n){if(!(l.TYPED_ARRAY_SUPPORT||this instanceof l))return new l(t,e,n);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return h(this,t)}return u(this,t,e,n)}function u(t,e,n,r){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,n,r){if(e.byteLength,n<0||e.byteLength<n)throw new RangeError("'offset' is out of bounds");if(e.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");e=void 0===n&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,n):new Uint8Array(e,n,r);l.TYPED_ARRAY_SUPPORT?(t=e).__proto__=l.prototype:t=d(t,e);return t}(t,e,n,r):"string"==typeof e?function(t,e,n){"string"==typeof n&&""!==n||(n="utf8");if(!l.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|f(e,n),i=(t=a(t,r)).write(e,n);i!==r&&(t=t.slice(0,i));return t}(t,e,n):function(t,e){if(l.isBuffer(e)){var n=0|p(e.length);return 0===(t=a(t,n)).length?t:(e.copy(t,0,0,n),t)}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(r=e.length)!=r?a(t,0):d(t,e);if("Buffer"===e.type&&o(e.data))return d(t,e.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function c(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function h(t,e){if(c(e),t=a(t,e<0?0:0|p(e)),!l.TYPED_ARRAY_SUPPORT)for(var n=0;n<e;++n)t[n]=0;return t}function d(t,e){var n=e.length<0?0:0|p(e.length);t=a(t,n);for(var r=0;r<n;r+=1)t[r]=255&e[r];return t}function p(t){if(t>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|t}function f(t,e){if(l.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return $(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return U(t).length;default:if(r)return $(t).length;e=(""+e).toLowerCase(),r=!0}}function g(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function m(t,e,n,r,i){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof e&&(e=l.from(e,r)),l.isBuffer(e))return 0===e.length?-1:v(t,e,n,r,i);if("number"==typeof e)return e&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):v(t,[e],n,r,i);throw new TypeError("val must be string, number or Buffer")}function v(t,e,n,r,i){var o,s=1,a=t.length,l=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;s=2,a/=2,l/=2,n/=2}function u(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){var c=-1;for(o=n;o<a;o++)if(u(t,o)===u(e,-1===c?0:o-c)){if(-1===c&&(c=o),o-c+1===l)return c*s}else-1!==c&&(o-=o-c),c=-1}else for(n+l>a&&(n=a-l),o=n;o>=0;o--){for(var h=!0,d=0;d<l;d++)if(u(t,o+d)!==u(e,d)){h=!1;break}if(h)return o}return-1}function b(t,e,n,r){n=Number(n)||0;var i=t.length-n;r?(r=Number(r))>i&&(r=i):r=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var s=0;s<r;++s){var a=parseInt(e.substr(2*s,2),16);if(isNaN(a))return s;t[n+s]=a}return s}function _(t,e,n,r){return V($(e,t.length-n),t,n,r)}function y(t,e,n,r){return V(function(t){for(var e=[],n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}(e),t,n,r)}function T(t,e,n,r){return y(t,e,n,r)}function x(t,e,n,r){return V(U(e),t,n,r)}function E(t,e,n,r){return V(function(t,e){for(var n,r,i,o=[],s=0;s<t.length&&!((e-=2)<0);++s)n=t.charCodeAt(s),r=n>>8,i=n%256,o.push(i),o.push(r);return o}(e,t.length-n),t,n,r)}function w(t,e,n){return 0===e&&n===t.length?r.fromByteArray(t):r.fromByteArray(t.slice(e,n))}function C(t,e,n){n=Math.min(t.length,n);for(var r=[],i=e;i<n;){var o,s,a,l,u=t[i],c=null,h=u>239?4:u>223?3:u>191?2:1;if(i+h<=n)switch(h){case 1:u<128&&(c=u);break;case 2:128==(192&(o=t[i+1]))&&(l=(31&u)<<6|63&o)>127&&(c=l);break;case 3:o=t[i+1],s=t[i+2],128==(192&o)&&128==(192&s)&&(l=(15&u)<<12|(63&o)<<6|63&s)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:o=t[i+1],s=t[i+2],a=t[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(l=(15&u)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&l<1114112&&(c=l)}null===c?(c=65533,h=1):c>65535&&(c-=65536,r.push(c>>>10&1023|55296),c=56320|1023&c),r.push(c),i+=h}return function(t){var e=t.length;if(e<=S)return String.fromCharCode.apply(String,t);var n="",r=0;for(;r<e;)n+=String.fromCharCode.apply(String,t.slice(r,r+=S));return n}(r)}e.Buffer=l,e.SlowBuffer=function(t){+t!=t&&(t=0);return l.alloc(+t)},e.INSPECT_MAX_BYTES=50,l.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=s(),l.poolSize=8192,l._augment=function(t){return t.__proto__=l.prototype,t},l.from=function(t,e,n){return u(null,t,e,n)},l.TYPED_ARRAY_SUPPORT&&(l.prototype.__proto__=Uint8Array.prototype,l.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&l[Symbol.species]===l&&Object.defineProperty(l,Symbol.species,{value:null,configurable:!0})),l.alloc=function(t,e,n){return function(t,e,n,r){return c(e),e<=0?a(t,e):void 0!==n?"string"==typeof r?a(t,e).fill(n,r):a(t,e).fill(n):a(t,e)}(null,t,e,n)},l.allocUnsafe=function(t){return h(null,t)},l.allocUnsafeSlow=function(t){return h(null,t)},l.isBuffer=function(t){return!(null==t||!t._isBuffer)},l.compare=function(t,e){if(!l.isBuffer(t)||!l.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,r=e.length,i=0,o=Math.min(n,r);i<o;++i)if(t[i]!==e[i]){n=t[i],r=e[i];break}return n<r?-1:r<n?1:0},l.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(t,e){if(!o(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return l.alloc(0);var n;if(void 0===e)for(e=0,n=0;n<t.length;++n)e+=t[n].length;var r=l.allocUnsafe(e),i=0;for(n=0;n<t.length;++n){var s=t[n];if(!l.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(r,i),i+=s.length}return r},l.byteLength=f,l.prototype._isBuffer=!0,l.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)g(this,e,e+1);return this},l.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)g(this,e,e+3),g(this,e+1,e+2);return this},l.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)g(this,e,e+7),g(this,e+1,e+6),g(this,e+2,e+5),g(this,e+3,e+4);return this},l.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?C(this,0,t):function(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return I(this,e,n);case"utf8":case"utf-8":return C(this,e,n);case"ascii":return k(this,e,n);case"latin1":case"binary":return O(this,e,n);case"base64":return w(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}.apply(this,arguments)},l.prototype.equals=function(t){if(!l.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===l.compare(this,t)},l.prototype.inspect=function(){var t="",n=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),"<Buffer "+t+">"},l.prototype.compare=function(t,e,n,r,i){if(!l.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),e<0||n>t.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&e>=n)return 0;if(r>=i)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,r>>>=0,i>>>=0,this===t)return 0;for(var o=i-r,s=n-e,a=Math.min(o,s),u=this.slice(r,i),c=t.slice(e,n),h=0;h<a;++h)if(u[h]!==c[h]){o=u[h],s=c[h];break}return o<s?-1:s<o?1:0},l.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},l.prototype.indexOf=function(t,e,n){return m(this,t,e,n,!0)},l.prototype.lastIndexOf=function(t,e,n){return m(this,t,e,n,!1)},l.prototype.write=function(t,e,n,r){if(void 0===e)r="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)r=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-e;if((void 0===n||n>i)&&(n=i),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return b(this,t,e,n);case"utf8":case"utf-8":return _(this,t,e,n);case"ascii":return y(this,t,e,n);case"latin1":case"binary":return T(this,t,e,n);case"base64":return x(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,e,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var S=4096;function k(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(127&t[i]);return r}function O(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(t[i]);return r}function I(t,e,n){var r=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>r)&&(n=r);for(var i="",o=e;o<n;++o)i+=j(t[o]);return i}function R(t,e,n){for(var r=t.slice(e,n),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function A(t,e,n){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function N(t,e,n,r,i,o){if(!l.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(n+r>t.length)throw new RangeError("Index out of range")}function D(t,e,n,r){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-n,2);i<o;++i)t[n+i]=(e&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function M(t,e,n,r){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-n,4);i<o;++i)t[n+i]=e>>>8*(r?i:3-i)&255}function L(t,e,n,r,i,o){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function P(t,e,n,r,o){return o||L(t,0,n,4),i.write(t,e,n,r,23,4),n+4}function F(t,e,n,r,o){return o||L(t,0,n,8),i.write(t,e,n,r,52,8),n+8}l.prototype.slice=function(t,e){var n,r=this.length;if(t=~~t,e=void 0===e?r:~~e,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),e<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t),l.TYPED_ARRAY_SUPPORT)(n=this.subarray(t,e)).__proto__=l.prototype;else{var i=e-t;n=new l(i,void 0);for(var o=0;o<i;++o)n[o]=this[o+t]}return n},l.prototype.readUIntLE=function(t,e,n){t|=0,e|=0,n||A(t,e,this.length);for(var r=this[t],i=1,o=0;++o<e&&(i*=256);)r+=this[t+o]*i;return r},l.prototype.readUIntBE=function(t,e,n){t|=0,e|=0,n||A(t,e,this.length);for(var r=this[t+--e],i=1;e>0&&(i*=256);)r+=this[t+--e]*i;return r},l.prototype.readUInt8=function(t,e){return e||A(t,1,this.length),this[t]},l.prototype.readUInt16LE=function(t,e){return e||A(t,2,this.length),this[t]|this[t+1]<<8},l.prototype.readUInt16BE=function(t,e){return e||A(t,2,this.length),this[t]<<8|this[t+1]},l.prototype.readUInt32LE=function(t,e){return e||A(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},l.prototype.readUInt32BE=function(t,e){return e||A(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},l.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||A(t,e,this.length);for(var r=this[t],i=1,o=0;++o<e&&(i*=256);)r+=this[t+o]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*e)),r},l.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||A(t,e,this.length);for(var r=e,i=1,o=this[t+--r];r>0&&(i*=256);)o+=this[t+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},l.prototype.readInt8=function(t,e){return e||A(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},l.prototype.readInt16LE=function(t,e){e||A(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt16BE=function(t,e){e||A(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt32LE=function(t,e){return e||A(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},l.prototype.readInt32BE=function(t,e){return e||A(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},l.prototype.readFloatLE=function(t,e){return e||A(t,4,this.length),i.read(this,t,!0,23,4)},l.prototype.readFloatBE=function(t,e){return e||A(t,4,this.length),i.read(this,t,!1,23,4)},l.prototype.readDoubleLE=function(t,e){return e||A(t,8,this.length),i.read(this,t,!0,52,8)},l.prototype.readDoubleBE=function(t,e){return e||A(t,8,this.length),i.read(this,t,!1,52,8)},l.prototype.writeUIntLE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||N(this,t,e,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[e]=255&t;++o<n&&(i*=256);)this[e+o]=t/i&255;return e+n},l.prototype.writeUIntBE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||N(this,t,e,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+n},l.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||N(this,t,e,1,255,0),l.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},l.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||N(this,t,e,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):D(this,t,e,!0),e+2},l.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||N(this,t,e,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):D(this,t,e,!1),e+2},l.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||N(this,t,e,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):M(this,t,e,!0),e+4},l.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||N(this,t,e,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):M(this,t,e,!1),e+4},l.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);N(this,t,e,n,i-1,-i)}var o=0,s=1,a=0;for(this[e]=255&t;++o<n&&(s*=256);)t<0&&0===a&&0!==this[e+o-1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+n},l.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);N(this,t,e,n,i-1,-i)}var o=n-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+n},l.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||N(this,t,e,1,127,-128),l.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},l.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||N(this,t,e,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):D(this,t,e,!0),e+2},l.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||N(this,t,e,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):D(this,t,e,!1),e+2},l.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||N(this,t,e,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):M(this,t,e,!0),e+4},l.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||N(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):M(this,t,e,!1),e+4},l.prototype.writeFloatLE=function(t,e,n){return P(this,t,e,!0,n)},l.prototype.writeFloatBE=function(t,e,n){return P(this,t,e,!1,n)},l.prototype.writeDoubleLE=function(t,e,n){return F(this,t,e,!0,n)},l.prototype.writeDoubleBE=function(t,e,n){return F(this,t,e,!1,n)},l.prototype.copy=function(t,e,n,r){if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e<r-n&&(r=t.length-e+n);var i,o=r-n;if(this===t&&n<e&&e<r)for(i=o-1;i>=0;--i)t[i+e]=this[i+n];else if(o<1e3||!l.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+e]=this[i+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+o),e);return o},l.prototype.fill=function(t,e,n,r){if("string"==typeof t){if("string"==typeof e?(r=e,e=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!l.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;var o;if(e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(o=e;o<n;++o)this[o]=t;else{var s=l.isBuffer(t)?t:$(new l(t,r).toString()),a=s.length;for(o=0;o<n-e;++o)this[o+e]=s[o%a]}return this};var B=/[^+\/0-9A-Za-z-_]/g;function j(t){return t<16?"0"+t.toString(16):t.toString(16)}function $(t,e){var n;e=e||1/0;for(var r=t.length,i=null,o=[],s=0;s<r;++s){if((n=t.charCodeAt(s))>55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===r){(e-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;o.push(n)}else if(n<2048){if((e-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function U(t){return r.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(B,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function V(t,e,n,r){for(var i=0;i<r&&!(i+n>=e.length||i>=t.length);++i)e[i+n]=t[i];return i}}).call(e,n("DuR2"))},Ew4t:function(t,e,n){var r,i,o,s;s=function(t,e,n,r){
  307. /**
  308. * @license
  309. * Copyright 2019 Google LLC
  310. * SPDX-License-Identifier: Apache-2.0
  311. */
  312. "use strict";return t.setLocale(e),t.Blocks=t.Blocks||{},Object.keys(n).forEach(function(e){t.Blocks[e]=n[e]}),t.JavaScript=r,t},i=[n("xnUL"),n("yUki"),n("wTUY"),n("Cr6W")],void 0===(o="function"==typeof(r=s)?r.apply(e,i):r)||(t.exports=o)},F08B:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.json=[{tfOpName:"SparseFillEmptyRows",category:"sparse",inputs:[{start:0,name:"indices",type:"tensor"},{start:1,name:"values",type:"tensor"},{start:2,name:"denseShape",type:"tensor"},{start:3,name:"defaultValue",type:"tensor"}]},{tfOpName:"SparseReshape",category:"sparse",inputs:[{start:0,name:"inputIndices",type:"tensor"},{start:1,name:"inputShape",type:"tensor"},{start:2,name:"newShape",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"SparseSegmentMean",category:"sparse",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"indices",type:"tensor"},{start:2,name:"segmentIds",type:"tensor"}]},{tfOpName:"SparseSegmentSum",category:"sparse",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"indices",type:"tensor"},{start:2,name:"segmentIds",type:"tensor"}]}]},F6Ex:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.json=[{tfOpName:"Cast",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"SrcT",name:"sdtype",type:"dtype",notSupported:!0},{tfName:"DstT",name:"dtype",type:"dtype"}]},{tfOpName:"ExpandDims",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]},{tfOpName:"MirrorPad",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"padding",type:"number[]"}],attrs:[{tfName:"mode",name:"mode",type:"string"}]},{tfOpName:"Pad",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"padding",type:"number[]"}],attrs:[{tfName:"constant_value",name:"constantValue",type:"number",defaultValue:0}]},{tfOpName:"PadV2",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"padding",type:"number[]"},{start:2,name:"constantValue",type:"number",defaultValue:0}]},{tfOpName:"Reshape",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"shape",type:"number[]"}]},{tfOpName:"Squeeze",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"axis",tfDeprecatedName:"squeeze_dims",name:"axis",type:"number[]"}]},{tfOpName:"SpaceToBatchND",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"blockShape",type:"number[]"},{start:2,name:"paddings",type:"number[]"}]},{tfOpName:"BatchToSpaceND",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"blockShape",type:"number[]"},{start:2,name:"crops",type:"number[]"}]},{tfOpName:"DepthToSpace",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"block_size",name:"blockSize",type:"number"},{tfName:"data_format",name:"dataFormat",type:"string"}]},{tfOpName:"BroadcastTo",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"shape",type:"number[]"}],attrs:[]},{tfOpName:"BroadcastArgs",category:"transformation",inputs:[{start:0,name:"s0",type:"tensor"},{start:1,name:"s1",type:"tensor"}],attrs:[]}]},FQmK:function(t,e,n){var r;r=function(t){return function(){var e=t,n=e.lib.BlockCipher,r=e.algo,i=[],o=[],s=[],a=[],l=[],u=[],c=[],h=[],d=[],p=[];!function(){for(var t=[],e=0;e<256;e++)t[e]=e<128?e<<1:e<<1^283;var n=0,r=0;for(e=0;e<256;e++){var f=r^r<<1^r<<2^r<<3^r<<4;f=f>>>8^255&f^99,i[n]=f,o[f]=n;var g=t[n],m=t[g],v=t[m],b=257*t[f]^16843008*f;s[n]=b<<24|b>>>8,a[n]=b<<16|b>>>16,l[n]=b<<8|b>>>24,u[n]=b;b=16843009*v^65537*m^257*g^16843008*n;c[f]=b<<24|b>>>8,h[f]=b<<16|b>>>16,d[f]=b<<8|b>>>24,p[f]=b,n?(n=g^t[t[t[v^g]]],r^=t[t[r]]):n=r=1}}();var f=[0,1,2,4,8,16,32,64,128,27,54],g=r.AES=n.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var t=this._keyPriorReset=this._key,e=t.words,n=t.sigBytes/4,r=4*((this._nRounds=n+6)+1),o=this._keySchedule=[],s=0;s<r;s++)s<n?o[s]=e[s]:(u=o[s-1],s%n?n>6&&s%n==4&&(u=i[u>>>24]<<24|i[u>>>16&255]<<16|i[u>>>8&255]<<8|i[255&u]):(u=i[(u=u<<8|u>>>24)>>>24]<<24|i[u>>>16&255]<<16|i[u>>>8&255]<<8|i[255&u],u^=f[s/n|0]<<24),o[s]=o[s-n]^u);for(var a=this._invKeySchedule=[],l=0;l<r;l++){s=r-l;if(l%4)var u=o[s];else u=o[s-4];a[l]=l<4||s<=4?u:c[i[u>>>24]]^h[i[u>>>16&255]]^d[i[u>>>8&255]]^p[i[255&u]]}}},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._keySchedule,s,a,l,u,i)},decryptBlock:function(t,e){var n=t[e+1];t[e+1]=t[e+3],t[e+3]=n,this._doCryptBlock(t,e,this._invKeySchedule,c,h,d,p,o);n=t[e+1];t[e+1]=t[e+3],t[e+3]=n},_doCryptBlock:function(t,e,n,r,i,o,s,a){for(var l=this._nRounds,u=t[e]^n[0],c=t[e+1]^n[1],h=t[e+2]^n[2],d=t[e+3]^n[3],p=4,f=1;f<l;f++){var g=r[u>>>24]^i[c>>>16&255]^o[h>>>8&255]^s[255&d]^n[p++],m=r[c>>>24]^i[h>>>16&255]^o[d>>>8&255]^s[255&u]^n[p++],v=r[h>>>24]^i[d>>>16&255]^o[u>>>8&255]^s[255&c]^n[p++],b=r[d>>>24]^i[u>>>16&255]^o[c>>>8&255]^s[255&h]^n[p++];u=g,c=m,h=v,d=b}g=(a[u>>>24]<<24|a[c>>>16&255]<<16|a[h>>>8&255]<<8|a[255&d])^n[p++],m=(a[c>>>24]<<24|a[h>>>16&255]<<16|a[d>>>8&255]<<8|a[255&u])^n[p++],v=(a[h>>>24]<<24|a[d>>>16&255]<<16|a[u>>>8&255]<<8|a[255&c])^n[p++],b=(a[d>>>24]<<24|a[u>>>16&255]<<16|a[c>>>8&255]<<8|a[255&h])^n[p++];t[e]=g,t[e+1]=m,t[e+2]=v,t[e+3]=b},keySize:8});e.AES=n._createHelper(g)}(),t.AES},t.exports=r(n("02Hb"),n("uFh6"),n("gykg"),n("wj1U"),n("fGru"))},FUmq:function(t,e,n){"use strict";var r=n("Kkag"),i=n("l5jf"),o=n("xMQ1"),s=n("35G1");const a=Object(s.a)({sqrt_:
  313. /**
  314. * @license
  315. * Copyright 2018 Google LLC. All Rights Reserved.
  316. * Licensed under the Apache License, Version 2.0 (the "License");
  317. * you may not use this file except in compliance with the License.
  318. * You may obtain a copy of the License at
  319. *
  320. * http://www.apache.org/licenses/LICENSE-2.0
  321. *
  322. * Unless required by applicable law or agreed to in writing, software
  323. * distributed under the License is distributed on an "AS IS" BASIS,
  324. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  325. * See the License for the specific language governing permissions and
  326. * limitations under the License.
  327. * =============================================================================
  328. */
  329. function(t){const e={x:Object(o.a)(t,"x","sqrt","float32")};return r.a.runKernel(i._89,e)}});e.a=a},FeBl:function(t,e){var n=t.exports={version:"2.6.12"};"number"==typeof __e&&(__e=n)},"Ff/Y":function(t,e,n){var r;r=function(t){var e,n,r,i,o,s;return n=(e=t).lib,r=n.WordArray,i=n.Hasher,o=[],s=e.algo.SHA1=i.extend({_doReset:function(){this._hash=new r.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var n=this._hash.words,r=n[0],i=n[1],s=n[2],a=n[3],l=n[4],u=0;u<80;u++){if(u<16)o[u]=0|t[e+u];else{var c=o[u-3]^o[u-8]^o[u-14]^o[u-16];o[u]=c<<1|c>>>31}var h=(r<<5|r>>>27)+l+o[u];h+=u<20?1518500249+(i&s|~i&a):u<40?1859775393+(i^s^a):u<60?(i&s|i&a|s&a)-1894007588:(i^s^a)-899497514,l=a,a=s,s=i<<30|i>>>2,i=r,r=h}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+s|0,n[3]=n[3]+a|0,n[4]=n[4]+l|0},_doFinalize:function(){var t=this._data,e=t.words,n=8*this._nDataBytes,r=8*t.sigBytes;return e[r>>>5]|=128<<24-r%32,e[14+(r+64>>>9<<4)]=Math.floor(n/4294967296),e[15+(r+64>>>9<<4)]=n,t.sigBytes=4*e.length,this._process(),this._hash},clone:function(){var t=i.clone.call(this);return t._hash=this._hash.clone(),t}}),e.SHA1=i._createHelper(s),e.HmacSHA1=i._createHmacHelper(s),t.SHA1},t.exports=r(n("02Hb"))},FtD3:function(t,e,n){"use strict";var r=n("t8qj");t.exports=function(t,e,n,i,o){var s=new Error(t);return r(s,e,n,i,o)}},G6fb:function(t,e,n){"use strict";e.c=i,e.b=function(t,e,n){if(e.rank<1)throw new Error("tf.scatterND() expects the indices to be rank 1 or higher,"+` but the rank was ${e.rank}.`);if(t.rank<1)throw new Error("tf.scatterND() expects the updates to be rank 1 or higher,"+` but the rank was ${t.rank}.`);if("int32"!==e.dtype)throw new Error(`The dtype of 'indices' should be int32, but got dtype: ${e.dtype}`);if(n.length<1)throw new Error(`Output rank must be greater or equal to 1, but got shape: ${n}`);if(0===n.length){if(0===e.size)throw new Error(`Indices specified for empty output. indices shape: ${e.shape}`);if(0===t.size)throw new Error(`Updates specified for empty output. updates shape: ${t.shape}`)}i(n,e,t)},e.a=function(t,e,n){const i=e.shape.length,o=i>1?e.shape[i-1]:1,s=n.length;let a=1;for(let t=o;t<s;++t)a*=n[t];const l=o<1?1:o,u=Object(r.sizeFromShape)(e.shape)/l,c=[...Object(r.computeStrides)(n.slice(0,o)),1],h=Object(r.sizeFromShape)(n);return{sliceRank:o,numUpdates:u,sliceSize:a,strides:c,outputSize:h}};var r=n("XFvI");function i(t,e,n){const r=e.rank>1?e.shape[e.rank-1]:1,i=e.rank>1?e.rank-1:1,o="Must have updates.shape = indices.shape[:batchDim] + "+`shape[sliceDim:], got updates.shape: ${n.shape}`+`, indices.shape: ${e.shape}, shape: ${t}`+`, sliceDim: ${r}, and batchDim: ${i}.`;if(n.rank<i)throw new Error(o+` update.rank < ${i}. `);if(t.length<r+(n.rank-i))throw new Error(o+` Output shape length < ${r+(n.rank-i)}`);if(n.rank!==i+t.length-r)throw new Error(o+` update.rank != ${i+t.length-r}`);for(let t=0;t<i;++t)if(n.shape[t]!==e.shape[t])throw new Error(o+` updates.shape[${t}] (${n.shape[t]}) != indices.shape[${t}] (${e.shape[t]}).`);for(let e=0;e<n.rank-i;++e)if(n.shape[e+i]!==t[e+r])throw new Error(o+` updates.shape[${e+i}] (${n.shape[e+i]}) != shape[${e+i}] (${t[e+i]})`)}},GEkh:function(t,e,n){(function(n){var r,i,o;i=[],void 0===(o="function"==typeof(r=function(){"use strict";var t={connectionTypes:{INPUT_VALUE:1,OUTPUT_VALUE:2,NEXT_STATEMENT:3,PREVIOUS_STATEMENT:4},constants:{},LINE_MODE_MULTIPLIER:40,PAGE_MODE_MULTIPLIER:125,DRAG_RADIUS:5,FLYOUT_DRAG_RADIUS:10,SNAP_RADIUS:28};return t.CONNECTING_SNAP_RADIUS=t.SNAP_RADIUS,t.CURRENT_CONNECTION_PREFERENCE=8,t.BUMP_DELAY=250,t.BUMP_RANDOMNESS=10,t.COLLAPSE_CHARS=30,t.LONGPRESS=750,t.SOUND_LIMIT=100,t.DRAG_STACK=!0,t.HSV_SATURATION=.45,t.HSV_VALUE=.65,t.SPRITE={width:96,height:124,url:"sprites.png"},t.constants.ALIGN={LEFT:-1,CENTRE:0,RIGHT:1},t.DRAG_NONE=0,t.DRAG_STICKY=1,t.DRAG_BEGIN=1,t.DRAG_FREE=2,t.OPPOSITE_TYPE=[],t.OPPOSITE_TYPE[t.connectionTypes.INPUT_VALUE]=t.connectionTypes.OUTPUT_VALUE,t.OPPOSITE_TYPE[t.connectionTypes.OUTPUT_VALUE]=t.connectionTypes.INPUT_VALUE,t.OPPOSITE_TYPE[t.connectionTypes.NEXT_STATEMENT]=t.connectionTypes.PREVIOUS_STATEMENT,t.OPPOSITE_TYPE[t.connectionTypes.PREVIOUS_STATEMENT]=t.connectionTypes.NEXT_STATEMENT,t.VARIABLE_CATEGORY_NAME="VARIABLE",t.VARIABLE_DYNAMIC_CATEGORY_NAME="VARIABLE_DYNAMIC",t.PROCEDURE_CATEGORY_NAME="PROCEDURE",t.RENAME_VARIABLE_ID="RENAME_VARIABLE_ID",t.DELETE_VARIABLE_ID="DELETE_VARIABLE_ID",t.constants.COLLAPSED_INPUT_NAME="_TEMP_COLLAPSED_INPUT",t.constants.COLLAPSED_FIELD_NAME="_TEMP_COLLAPSED_FIELD",t.utils={},t.utils.global=function(){return"object"==typeof self?self:"object"==typeof window?window:"object"==typeof n?n:this}(),t.Msg={},t.utils.global.Blockly||(t.utils.global.Blockly={}),t.utils.global.Blockly.Msg||(t.utils.global.Blockly.Msg=t.Msg),t.utils.colour={},t.utils.colour.parse=function(e){e=String(e).toLowerCase().trim();var n=t.utils.colour.names[e];if(n)return n;if(n="#"==(n="0x"==e.substring(0,2)?"#"+e.substring(2):e)[0]?n:"#"+n,/^#[0-9a-f]{6}$/.test(n))return n;if(/^#[0-9a-f]{3}$/.test(n))return["#",n[1],n[1],n[2],n[2],n[3],n[3]].join("");var r=e.match(/^(?:rgb)?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/);return r&&(e=Number(r[1]),n=Number(r[2]),r=Number(r[3]),0<=e&&256>e&&0<=n&&256>n&&0<=r&&256>r)?t.utils.colour.rgbToHex(e,n,r):null},t.utils.colour.rgbToHex=function(t,e,n){return e=t<<16|e<<8|n,16>t?"#"+(16777216|e).toString(16).substr(1):"#"+e.toString(16)},t.utils.colour.hexToRgb=function(e){return(e=t.utils.colour.parse(e))?[(e=parseInt(e.substr(1),16))>>16,e>>8&255,255&e]:[0,0,0]},t.utils.colour.hsvToHex=function(e,n,r){var i=0,o=0,s=0;if(0==n)s=o=i=r;else{var a=Math.floor(e/60),l=e/60-a;e=r*(1-n);var u=r*(1-n*l);switch(n=r*(1-n*(1-l)),a){case 1:i=u,o=r,s=e;break;case 2:i=e,o=r,s=n;break;case 3:i=e,o=u,s=r;break;case 4:i=n,o=e,s=r;break;case 5:i=r,o=e,s=u;break;case 6:case 0:i=r,o=n,s=e}}return t.utils.colour.rgbToHex(Math.floor(i),Math.floor(o),Math.floor(s))},t.utils.colour.blend=function(e,n,r){return(e=t.utils.colour.parse(e))&&(n=t.utils.colour.parse(n))?(e=t.utils.colour.hexToRgb(e),n=t.utils.colour.hexToRgb(n),t.utils.colour.rgbToHex(Math.round(n[0]+r*(e[0]-n[0])),Math.round(n[1]+r*(e[1]-n[1])),Math.round(n[2]+r*(e[2]-n[2])))):null},t.utils.colour.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00"},t.utils.Coordinate=function(t,e){this.x=t,this.y=e},t.utils.Coordinate.equals=function(t,e){return t==e||!(!t||!e)&&(t.x==e.x&&t.y==e.y)},t.utils.Coordinate.distance=function(t,e){var n=t.x-e.x;return t=t.y-e.y,Math.sqrt(n*n+t*t)},t.utils.Coordinate.magnitude=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},t.utils.Coordinate.difference=function(e,n){return new t.utils.Coordinate(e.x-n.x,e.y-n.y)},t.utils.Coordinate.sum=function(e,n){return new t.utils.Coordinate(e.x+n.x,e.y+n.y)},t.utils.Coordinate.prototype.clone=function(){return new t.utils.Coordinate(this.x,this.y)},t.utils.Coordinate.prototype.scale=function(t){return this.x*=t,this.y*=t,this},t.utils.Coordinate.prototype.translate=function(t,e){return this.x+=t,this.y+=e,this},t.utils.Rect=function(t,e,n,r){this.top=t,this.bottom=e,this.left=n,this.right=r},t.utils.Rect.prototype.contains=function(t,e){return t>=this.left&&t<=this.right&&e>=this.top&&e<=this.bottom},t.utils.Rect.prototype.intersects=function(t){return!(this.left>t.right||this.right<t.left||this.top>t.bottom||this.bottom<t.top)},t.utils.string={},t.utils.string.startsWith=function(t,e){return 0==t.lastIndexOf(e,0)},t.utils.string.shortestStringLength=function(t){return t.length?t.reduce(function(t,e){return t.length<e.length?t:e}).length:0},t.utils.string.commonWordPrefix=function(e,n){if(!e.length)return 0;if(1==e.length)return e[0].length;var r=0;n=n||t.utils.string.shortestStringLength(e);for(var i=0;i<n;i++){for(var o=e[0][i],s=1;s<e.length;s++)if(o!=e[s][i])return r;" "==o&&(r=i+1)}for(s=1;s<e.length;s++)if((o=e[s][i])&&" "!=o)return r;return n},t.utils.string.commonWordSuffix=function(e,n){if(!e.length)return 0;if(1==e.length)return e[0].length;var r=0;n=n||t.utils.string.shortestStringLength(e);for(var i=0;i<n;i++){for(var o=e[0].substr(-i-1,1),s=1;s<e.length;s++)if(o!=e[s].substr(-i-1,1))return r;" "==o&&(r=i+1)}for(s=1;s<e.length;s++)if((o=e[s].charAt(e[s].length-i-1))&&" "!=o)return r;return n},t.utils.string.wrap=function(e,n){e=e.split("\n");for(var r=0;r<e.length;r++)e[r]=t.utils.string.wrapLine_(e[r],n);return e.join("\n")},t.utils.string.wrapLine_=function(e,n){if(e.length<=n)return e;for(var r=e.trim().split(/\s+/),i=0;i<r.length;i++)r[i].length>n&&(n=r[i].length);i=-1/0;var o=1;do{var s=i,a=e;e=[];var l=r.length/o,u=1;for(i=0;i<r.length-1;i++)u<(i+1.5)/l?(u++,e[i]=!0):e[i]=!1;e=t.utils.string.wrapMutate_(r,e,n),i=t.utils.string.wrapScore_(r,e,n),e=t.utils.string.wrapToText_(r,e),o++}while(i>s);return a},t.utils.string.wrapScore_=function(t,e,n){for(var r=[0],i=[],o=0;o<t.length;o++)r[r.length-1]+=t[o].length,!0===e[o]?(r.push(0),i.push(t[o].charAt(t[o].length-1))):!1===e[o]&&r[r.length-1]++;for(t=Math.max.apply(Math,r),o=e=0;o<r.length;o++)e-=2*Math.pow(Math.abs(n-r[o]),1.5),e-=Math.pow(t-r[o],1.5),-1!=".?!".indexOf(i[o])?e+=n/3:-1!=",;)]}".indexOf(i[o])&&(e+=n/4);return 1<r.length&&r[r.length-1]<=r[r.length-2]&&(e+=.5),e},t.utils.string.wrapMutate_=function(e,n,r){for(var i,o=t.utils.string.wrapScore_(e,n,r),s=0;s<n.length-1;s++)if(n[s]!=n[s+1]){var a=[].concat(n);a[s]=!a[s],a[s+1]=!a[s+1];var l=t.utils.string.wrapScore_(e,a,r);l>o&&(o=l,i=a)}return i?t.utils.string.wrapMutate_(e,i,r):n},t.utils.string.wrapToText_=function(t,e){for(var n=[],r=0;r<t.length;r++)n.push(t[r]),void 0!==e[r]&&n.push(e[r]?"\n":" ");return n.join("")},t.utils.Size=function(t,e){this.width=t,this.height=e},t.utils.Size.equals=function(t,e){return t==e||!(!t||!e)&&(t.width==e.width&&t.height==e.height)},t.utils.style={},t.utils.style.getSize=function(e){if("none"!=t.utils.style.getStyle_(e,"display"))return t.utils.style.getSizeWithDisplay_(e);var n=e.style,r=n.display,i=n.visibility,o=n.position;n.visibility="hidden",n.position="absolute",n.display="inline";var s=e.offsetWidth;return e=e.offsetHeight,n.display=r,n.position=o,n.visibility=i,new t.utils.Size(s,e)},t.utils.style.getSizeWithDisplay_=function(e){return new t.utils.Size(e.offsetWidth,e.offsetHeight)},t.utils.style.getStyle_=function(e,n){return t.utils.style.getComputedStyle(e,n)||t.utils.style.getCascadedStyle(e,n)||e.style&&e.style[n]},t.utils.style.getComputedStyle=function(t,e){return document.defaultView&&document.defaultView.getComputedStyle&&(t=document.defaultView.getComputedStyle(t,null))&&(t[e]||t.getPropertyValue(e))||""},t.utils.style.getCascadedStyle=function(t,e){return t.currentStyle?t.currentStyle[e]:null},t.utils.style.getPageOffset=function(e){var n=new t.utils.Coordinate(0,0);e=e.getBoundingClientRect();var r=document.documentElement;return r=new t.utils.Coordinate(window.pageXOffset||r.scrollLeft,window.pageYOffset||r.scrollTop),n.x=e.left+r.x,n.y=e.top+r.y,n},t.utils.style.getViewportPageOffset=function(){var e=document.body,n=document.documentElement;return new t.utils.Coordinate(e.scrollLeft||n.scrollLeft,e.scrollTop||n.scrollTop)},t.utils.style.setElementShown=function(t,e){t.style.display=e?"":"none"},t.utils.style.isRightToLeft=function(e){return"rtl"==t.utils.style.getStyle_(e,"direction")},t.utils.style.getBorderBox=function(e){var n=t.utils.style.getComputedStyle(e,"borderLeftWidth"),r=t.utils.style.getComputedStyle(e,"borderRightWidth"),i=t.utils.style.getComputedStyle(e,"borderTopWidth");return e=t.utils.style.getComputedStyle(e,"borderBottomWidth"),{top:parseFloat(i),right:parseFloat(r),bottom:parseFloat(e),left:parseFloat(n)}},t.utils.style.scrollIntoContainerView=function(e,n,r){e=t.utils.style.getContainerOffsetToScrollInto(e,n,r),n.scrollLeft=e.x,n.scrollTop=e.y},t.utils.style.getContainerOffsetToScrollInto=function(e,n,r){var i=t.utils.style.getPageOffset(e),o=t.utils.style.getPageOffset(n),s=t.utils.style.getBorderBox(n),a=i.x-o.x-s.left;return i=i.y-o.y-s.top,o=t.utils.style.getSizeWithDisplay_(e),e=n.clientWidth-o.width,o=n.clientHeight-o.height,s=n.scrollLeft,n=n.scrollTop,r?(s+=a-e/2,n+=i-o/2):(s+=Math.min(a,Math.max(a-e,0)),n+=Math.min(i,Math.max(i-o,0))),new t.utils.Coordinate(s,n)},t.utils.userAgent={},function(e){function n(t){return-1!=r.indexOf(t.toUpperCase())}t.utils.userAgent.raw=e;var r=t.utils.userAgent.raw.toUpperCase();t.utils.userAgent.IE=n("Trident")||n("MSIE"),t.utils.userAgent.EDGE=n("Edge"),t.utils.userAgent.JAVA_FX=n("JavaFX"),t.utils.userAgent.CHROME=(n("Chrome")||n("CriOS"))&&!t.utils.userAgent.EDGE,t.utils.userAgent.WEBKIT=n("WebKit")&&!t.utils.userAgent.EDGE,t.utils.userAgent.GECKO=n("Gecko")&&!t.utils.userAgent.WEBKIT&&!t.utils.userAgent.IE&&!t.utils.userAgent.EDGE,t.utils.userAgent.ANDROID=n("Android"),e=t.utils.global.navigator&&t.utils.global.navigator.maxTouchPoints,t.utils.userAgent.IPAD=n("iPad")||n("Macintosh")&&0<e,t.utils.userAgent.IPOD=n("iPod"),t.utils.userAgent.IPHONE=n("iPhone")&&!t.utils.userAgent.IPAD&&!t.utils.userAgent.IPOD,t.utils.userAgent.MAC=n("Macintosh"),t.utils.userAgent.TABLET=t.utils.userAgent.IPAD||t.utils.userAgent.ANDROID&&!n("Mobile")||n("Silk"),t.utils.userAgent.MOBILE=!t.utils.userAgent.TABLET&&(t.utils.userAgent.IPOD||t.utils.userAgent.IPHONE||t.utils.userAgent.ANDROID||n("IEMobile"))}(t.utils.global.navigator&&t.utils.global.navigator.userAgent||""),t.utils.noEvent=function(t){t.preventDefault(),t.stopPropagation()},t.utils.isTargetInput=function(t){return"textarea"==t.target.type||"text"==t.target.type||"number"==t.target.type||"email"==t.target.type||"password"==t.target.type||"search"==t.target.type||"tel"==t.target.type||"url"==t.target.type||t.target.isContentEditable||t.target.dataset&&"true"==t.target.dataset.isTextInput},t.utils.getRelativeXY=function(e){var n=new t.utils.Coordinate(0,0),r=e.getAttribute("x");return r&&(n.x=parseInt(r,10)),(r=e.getAttribute("y"))&&(n.y=parseInt(r,10)),(r=(r=e.getAttribute("transform"))&&r.match(t.utils.getRelativeXY.XY_REGEX_))&&(n.x+=Number(r[1]),r[3]&&(n.y+=Number(r[3]))),(e=e.getAttribute("style"))&&-1<e.indexOf("translate")&&(e=e.match(t.utils.getRelativeXY.XY_STYLE_REGEX_))&&(n.x+=Number(e[1]),e[3]&&(n.y+=Number(e[3]))),n},t.utils.getInjectionDivXY_=function(e){for(var n=0,r=0;e;){var i=t.utils.getRelativeXY(e);if(n+=i.x,r+=i.y,-1!=(" "+(e.getAttribute("class")||"")+" ").indexOf(" injectionDiv "))break;e=e.parentNode}return new t.utils.Coordinate(n,r)},t.utils.getRelativeXY.XY_REGEX_=/translate\(\s*([-+\d.e]+)([ ,]\s*([-+\d.e]+)\s*)?/,t.utils.getRelativeXY.XY_STYLE_REGEX_=/transform:\s*translate(?:3d)?\(\s*([-+\d.e]+)\s*px([ ,]\s*([-+\d.e]+)\s*px)?/,t.utils.isRightButton=function(e){return!(!e.ctrlKey||!t.utils.userAgent.MAC)||2==e.button},t.utils.mouseToSvg=function(t,e,n){var r=e.createSVGPoint();return r.x=t.clientX,r.y=t.clientY,n||(n=e.getScreenCTM().inverse()),r.matrixTransform(n)},t.utils.getScrollDeltaPixels=function(e){switch(e.deltaMode){default:return{x:e.deltaX,y:e.deltaY};case 1:return{x:e.deltaX*t.LINE_MODE_MULTIPLIER,y:e.deltaY*t.LINE_MODE_MULTIPLIER};case 2:return{x:e.deltaX*t.PAGE_MODE_MULTIPLIER,y:e.deltaY*t.PAGE_MODE_MULTIPLIER}}},t.utils.tokenizeInterpolation=function(e){return t.utils.tokenizeInterpolation_(e,!0)},t.utils.replaceMessageReferences=function(e){return"string"!=typeof e?e:(e=t.utils.tokenizeInterpolation_(e,!1)).length?String(e[0]):""},t.utils.checkMessageReferences=function(e){for(var n=!0,r=t.Msg,i=e.match(/%{BKY_[A-Z]\w*}/gi),o=0;o<i.length;o++){void 0==r[i[o].toUpperCase().slice(6,-1)]&&(console.warn("No message string for "+i[o]+" in "+e),n=!1)}return n},t.utils.tokenizeInterpolation_=function(e,n){var r=[],i=e.split("");i.push("");var o=0;e=[];for(var s=null,a=0;a<i.length;a++){var l=i[a];0==o?"%"==l?((l=e.join(""))&&r.push(l),e.length=0,o=1):e.push(l):1==o?"%"==l?(e.push(l),o=0):n&&"0"<=l&&"9">=l?(o=2,s=l,(l=e.join(""))&&r.push(l),e.length=0):"{"==l?o=3:(e.push("%",l),o=0):2==o?"0"<=l&&"9">=l?s+=l:(r.push(parseInt(s,10)),a--,o=0):3==o&&(""==l?(e.splice(0,0,"%{"),a--,o=0):"}"!=l?e.push(l):(o=e.join(""),/[A-Z]\w*/i.test(o)?(l=o.toUpperCase(),(l=t.utils.string.startsWith(l,"BKY_")?l.substring(4):null)&&l in t.Msg?"string"==typeof(o=t.Msg[l])?Array.prototype.push.apply(r,t.utils.tokenizeInterpolation_(o,n)):n?r.push(String(o)):r.push(o):r.push("%{"+o+"}")):r.push("%{"+o+"}"),o=e.length=0))}for((l=e.join(""))&&r.push(l),n=[],a=e.length=0;a<r.length;++a)"string"==typeof r[a]?e.push(r[a]):((l=e.join(""))&&n.push(l),e.length=0,n.push(r[a]));return(l=e.join(""))&&n.push(l),e.length=0,n},t.utils.genUid=function(){for(var e=t.utils.genUid.soup_.length,n=[],r=0;20>r;r++)n[r]=t.utils.genUid.soup_.charAt(Math.random()*e);return n.join("")},t.utils.genUid.soup_="!#$%()*+,-./:;=?@[]^_`{|}~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",t.utils.is3dSupported=function(){if(void 0!==t.utils.is3dSupported.cached_)return t.utils.is3dSupported.cached_;if(!t.utils.global.getComputedStyle)return!1;var e=document.createElement("p"),n="none",r={webkitTransform:"-webkit-transform",OTransform:"-o-transform",msTransform:"-ms-transform",MozTransform:"-moz-transform",transform:"transform"};for(var i in document.body.insertBefore(e,null),r)if(void 0!==e.style[i]){if(e.style[i]="translate3d(1px,1px,1px)",!(n=t.utils.global.getComputedStyle(e)))return document.body.removeChild(e),!1;n=n.getPropertyValue(r[i])}return document.body.removeChild(e),t.utils.is3dSupported.cached_="none"!==n,t.utils.is3dSupported.cached_},t.utils.runAfterPageLoad=function(t){if("object"!=typeof document)throw Error("Blockly.utils.runAfterPageLoad() requires browser document.");if("complete"==document.readyState)t();else var e=setInterval(function(){"complete"==document.readyState&&(clearInterval(e),t())},10)},t.utils.getViewportBBox=function(){var e=t.utils.style.getViewportPageOffset();return new t.utils.Rect(e.y,document.documentElement.clientHeight+e.y,e.x,document.documentElement.clientWidth+e.x)},t.utils.arrayRemove=function(t,e){return-1!=(e=t.indexOf(e))&&(t.splice(e,1),!0)},t.utils.getDocumentScroll=function(){var e=document.documentElement,n=window;return t.utils.userAgent.IE&&n.pageYOffset!=e.scrollTop?new t.utils.Coordinate(e.scrollLeft,e.scrollTop):new t.utils.Coordinate(n.pageXOffset||e.scrollLeft,n.pageYOffset||e.scrollTop)},t.utils.getBlockTypeCounts=function(t,e){var n=Object.create(null),r=t.getDescendants(!0);for(e&&(t=t.getNextBlock())&&(t=r.indexOf(t),r.splice(t,r.length-t)),t=0;e=r[t];t++)n[e.type]?n[e.type]++:n[e.type]=1;return n},t.utils.screenToWsCoordinates=function(e,n){var r=n.x;n=n.y;var i=e.getInjectionDiv().getBoundingClientRect();return r=new t.utils.Coordinate(r-i.left,n-i.top),n=e.getOriginOffsetInPixels(),t.utils.Coordinate.difference(r,n).scale(1/e.scale)},t.utils.parseBlockColour=function(e){var n="string"==typeof e?t.utils.replaceMessageReferences(e):e,r=Number(n);if(!isNaN(r)&&0<=r&&360>=r)return{hue:r,hex:t.utils.colour.hsvToHex(r,t.HSV_SATURATION,255*t.HSV_VALUE)};if(r=t.utils.colour.parse(n))return{hue:null,hex:r};throw r='Invalid colour: "'+n+'"',e!=n&&(r+=' (from "'+e+'")'),Error(r)},t.Touch={},t.Touch.TOUCH_ENABLED="ontouchstart"in t.utils.global||!!(t.utils.global.document&&document.documentElement&&"ontouchstart"in document.documentElement)||!(!t.utils.global.navigator||!t.utils.global.navigator.maxTouchPoints&&!t.utils.global.navigator.msMaxTouchPoints),t.Touch.touchIdentifier_=null,t.Touch.TOUCH_MAP={},t.utils.global.PointerEvent?t.Touch.TOUCH_MAP={mousedown:["pointerdown"],mouseenter:["pointerenter"],mouseleave:["pointerleave"],mousemove:["pointermove"],mouseout:["pointerout"],mouseover:["pointerover"],mouseup:["pointerup","pointercancel"],touchend:["pointerup"],touchcancel:["pointercancel"]}:t.Touch.TOUCH_ENABLED&&(t.Touch.TOUCH_MAP={mousedown:["touchstart"],mousemove:["touchmove"],mouseup:["touchend","touchcancel"]}),t.longPid_=0,t.longStart=function(e,n){t.longStop_(),e.changedTouches&&1!=e.changedTouches.length||(t.longPid_=setTimeout(function(){e.changedTouches&&(e.button=2,e.clientX=e.changedTouches[0].clientX,e.clientY=e.changedTouches[0].clientY),n&&n.handleRightClick(e)},t.LONGPRESS))},t.longStop_=function(){t.longPid_&&(clearTimeout(t.longPid_),t.longPid_=0)},t.Touch.clearTouchIdentifier=function(){t.Touch.touchIdentifier_=null},t.Touch.shouldHandleEvent=function(e){return!t.Touch.isMouseOrTouchEvent(e)||t.Touch.checkTouchIdentifier(e)},t.Touch.getTouchIdentifierFromEvent=function(t){return void 0!=t.pointerId?t.pointerId:t.changedTouches&&t.changedTouches[0]&&void 0!==t.changedTouches[0].identifier&&null!==t.changedTouches[0].identifier?t.changedTouches[0].identifier:"mouse"},t.Touch.checkTouchIdentifier=function(e){var n=t.Touch.getTouchIdentifierFromEvent(e);return void 0!==t.Touch.touchIdentifier_&&null!==t.Touch.touchIdentifier_?t.Touch.touchIdentifier_==n:("mousedown"==e.type||"touchstart"==e.type||"pointerdown"==e.type)&&(t.Touch.touchIdentifier_=n,!0)},t.Touch.setClientFromTouch=function(e){if(t.utils.string.startsWith(e.type,"touch")){var n=e.changedTouches[0];e.clientX=n.clientX,e.clientY=n.clientY}},t.Touch.isMouseOrTouchEvent=function(e){return t.utils.string.startsWith(e.type,"touch")||t.utils.string.startsWith(e.type,"mouse")||t.utils.string.startsWith(e.type,"pointer")},t.Touch.isTouchEvent=function(e){return t.utils.string.startsWith(e.type,"touch")||t.utils.string.startsWith(e.type,"pointer")},t.Touch.splitEventByTouches=function(t){var e=[];if(t.changedTouches)for(var n=0;n<t.changedTouches.length;n++)e[n]={type:t.type,changedTouches:[t.changedTouches[n]],target:t.target,stopPropagation:function(){t.stopPropagation()},preventDefault:function(){t.preventDefault()}};else e.push(t);return e},t.browserEvents={},t.browserEvents.conditionalBind=function(e,n,r,i,o,s){var a=!1,l=function(e){var n=!o;e=t.Touch.splitEventByTouches(e);for(var s,l=0;s=e[l];l++)n&&!t.Touch.shouldHandleEvent(s)||(t.Touch.setClientFromTouch(s),r?i.call(r,s):i(s),a=!0)},u=[];if(t.utils.global.PointerEvent&&n in t.Touch.TOUCH_MAP)for(var c,h=0;c=t.Touch.TOUCH_MAP[n][h];h++)e.addEventListener(c,l,!1),u.push([e,c,l]);else if(e.addEventListener(n,l,!1),u.push([e,n,l]),n in t.Touch.TOUCH_MAP){var d=function(t){l(t),a&&!s&&t.preventDefault()};for(h=0;c=t.Touch.TOUCH_MAP[n][h];h++)e.addEventListener(c,d,!1),u.push([e,c,d])}return u},t.browserEvents.bind=function(e,n,r,i){var o=function(t){r?i.call(r,t):i(t)},s=[];if(t.utils.global.PointerEvent&&n in t.Touch.TOUCH_MAP)for(var a,l=0;a=t.Touch.TOUCH_MAP[n][l];l++)e.addEventListener(a,o,!1),s.push([e,a,o]);else if(e.addEventListener(n,o,!1),s.push([e,n,o]),n in t.Touch.TOUCH_MAP){var u=function(t){if(t.changedTouches&&1==t.changedTouches.length){var e=t.changedTouches[0];t.clientX=e.clientX,t.clientY=e.clientY}o(t),t.preventDefault()};for(l=0;a=t.Touch.TOUCH_MAP[n][l];l++)e.addEventListener(a,u,!1),s.push([e,a,u])}return s},t.browserEvents.unbind=function(t){for(;t.length;){var e=t.pop(),n=e[2];e[0].removeEventListener(e[1],n,!1)}return n},t.ComponentManager=function(){this.componentData_=Object.create(null),this.capabilityToComponentIds_=Object.create(null)},t.ComponentManager.prototype.addComponent=function(t,e){var n=t.component.id;if(!e&&this.componentData_[n])throw Error('Plugin "'+n+'" with capabilities "'+this.componentData_[n].capabilities+'" already added.');this.componentData_[n]=t,e=[];for(var r=0;r<t.capabilities.length;r++){var i=String(t.capabilities[r]).toLowerCase();e.push(i),void 0===this.capabilityToComponentIds_[i]?this.capabilityToComponentIds_[i]=[n]:this.capabilityToComponentIds_[i].push(n)}this.componentData_[n].capabilities=e},t.ComponentManager.prototype.removeComponent=function(t){var e=this.componentData_[t];if(e){for(var n=0;n<e.capabilities.length;n++){var r=String(e.capabilities[n]).toLowerCase();this.capabilityToComponentIds_[r].splice(this.capabilityToComponentIds_[r].indexOf(t),1)}delete this.componentData_[t]}},t.ComponentManager.prototype.addCapability=function(t,e){if(!this.getComponent(t))throw Error('Cannot add capability, "'+e+'". Plugin "'+t+'" has not been added to the ComponentManager');this.hasCapability(t,e)?console.warn('Plugin "'+t+'already has capability "'+e+'"'):(e=String(e).toLowerCase(),this.componentData_[t].capabilities.push(e),this.capabilityToComponentIds_[e].push(t))},t.ComponentManager.prototype.removeCapability=function(t,e){if(!this.getComponent(t))throw Error('Cannot remove capability, "'+e+'". Plugin "'+t+'" has not been added to the ComponentManager');this.hasCapability(t,e)?(e=String(e).toLowerCase(),this.componentData_[t].capabilities.splice(this.componentData_[t].capabilities.indexOf(e),1),this.capabilityToComponentIds_[e].splice(this.capabilityToComponentIds_[e].indexOf(t),1)):console.warn('Plugin "'+t+"doesn't have capability \""+e+'" to remove')},t.ComponentManager.prototype.hasCapability=function(t,e){return e=String(e).toLowerCase(),-1!==this.componentData_[t].capabilities.indexOf(e)},t.ComponentManager.prototype.getComponent=function(t){return this.componentData_[t]&&this.componentData_[t].component},t.ComponentManager.prototype.getComponents=function(t,e){if(t=String(t).toLowerCase(),!(t=this.capabilityToComponentIds_[t]))return[];var n=[];if(e){var r=[],i=this.componentData_;t.forEach(function(t){r.push(i[t])}),r.sort(function(t,e){return t.weight-e.weight}),r.forEach(function(t){n.push(t.component)})}else i=this.componentData_,t.forEach(function(t){n.push(i[t].component)});return n},t.ComponentManager.Capability=function(t){this.name_=t},t.ComponentManager.Capability.prototype.toString=function(){return this.name_},t.ComponentManager.Capability.POSITIONABLE=new t.ComponentManager.Capability("positionable"),t.ComponentManager.Capability.DRAG_TARGET=new t.ComponentManager.Capability("drag_target"),t.ComponentManager.Capability.DELETE_AREA=new t.ComponentManager.Capability("delete_area"),t.ComponentManager.Capability.AUTOHIDEABLE=new t.ComponentManager.Capability("autohideable"),t.utils.Svg=function(t){this.tagName_=t},t.utils.Svg.prototype.toString=function(){return this.tagName_},t.utils.Svg.ANIMATE=new t.utils.Svg("animate"),t.utils.Svg.CIRCLE=new t.utils.Svg("circle"),t.utils.Svg.CLIPPATH=new t.utils.Svg("clipPath"),t.utils.Svg.DEFS=new t.utils.Svg("defs"),t.utils.Svg.FECOMPOSITE=new t.utils.Svg("feComposite"),t.utils.Svg.FECOMPONENTTRANSFER=new t.utils.Svg("feComponentTransfer"),t.utils.Svg.FEFLOOD=new t.utils.Svg("feFlood"),t.utils.Svg.FEFUNCA=new t.utils.Svg("feFuncA"),t.utils.Svg.FEGAUSSIANBLUR=new t.utils.Svg("feGaussianBlur"),t.utils.Svg.FEPOINTLIGHT=new t.utils.Svg("fePointLight"),t.utils.Svg.FESPECULARLIGHTING=new t.utils.Svg("feSpecularLighting"),t.utils.Svg.FILTER=new t.utils.Svg("filter"),t.utils.Svg.FOREIGNOBJECT=new t.utils.Svg("foreignObject"),t.utils.Svg.G=new t.utils.Svg("g"),t.utils.Svg.IMAGE=new t.utils.Svg("image"),t.utils.Svg.LINE=new t.utils.Svg("line"),t.utils.Svg.PATH=new t.utils.Svg("path"),t.utils.Svg.PATTERN=new t.utils.Svg("pattern"),t.utils.Svg.POLYGON=new t.utils.Svg("polygon"),t.utils.Svg.RECT=new t.utils.Svg("rect"),t.utils.Svg.SVG=new t.utils.Svg("svg"),t.utils.Svg.TEXT=new t.utils.Svg("text"),t.utils.Svg.TSPAN=new t.utils.Svg("tspan"),t.utils.dom={},t.utils.dom.SVG_NS="http://www.w3.org/2000/svg",t.utils.dom.HTML_NS="http://www.w3.org/1999/xhtml",t.utils.dom.XLINK_NS="http://www.w3.org/1999/xlink",t.utils.dom.NodeType={ELEMENT_NODE:1,TEXT_NODE:3,COMMENT_NODE:8,DOCUMENT_POSITION_CONTAINED_BY:16},t.utils.dom.cacheWidths_=null,t.utils.dom.cacheReference_=0,t.utils.dom.canvasContext_=null,t.utils.dom.createSvgElement=function(e,n,r){for(var i in e=document.createElementNS(t.utils.dom.SVG_NS,String(e)),n)e.setAttribute(i,n[i]);return document.body.runtimeStyle&&(e.runtimeStyle=e.currentStyle=e.style),r&&r.appendChild(e),e},t.utils.dom.addClass=function(t,e){var n=t.getAttribute("class")||"";return-1==(" "+n+" ").indexOf(" "+e+" ")&&(n&&(n+=" "),t.setAttribute("class",n+e),!0)},t.utils.dom.removeClasses=function(e,n){n=n.split(" ");for(var r=0;r<n.length;r++)t.utils.dom.removeClass(e,n[r])},t.utils.dom.removeClass=function(t,e){var n=t.getAttribute("class");if(-1==(" "+n+" ").indexOf(" "+e+" "))return!1;n=n.split(/\s+/);for(var r=0;r<n.length;r++)n[r]&&n[r]!=e||(n.splice(r,1),r--);return n.length?t.setAttribute("class",n.join(" ")):t.removeAttribute("class"),!0},t.utils.dom.hasClass=function(t,e){return-1!=(" "+t.getAttribute("class")+" ").indexOf(" "+e+" ")},t.utils.dom.removeNode=function(t){return t&&t.parentNode?t.parentNode.removeChild(t):null},t.utils.dom.insertAfter=function(t,e){var n=e.nextSibling;if(!(e=e.parentNode))throw Error("Reference node has no parent.");n?e.insertBefore(t,n):e.appendChild(t)},t.utils.dom.containsNode=function(e,n){return!!(e.compareDocumentPosition(n)&t.utils.dom.NodeType.DOCUMENT_POSITION_CONTAINED_BY)},t.utils.dom.setCssTransform=function(t,e){t.style.transform=e,t.style["-webkit-transform"]=e},t.utils.dom.startTextWidthCache=function(){t.utils.dom.cacheReference_++,t.utils.dom.cacheWidths_||(t.utils.dom.cacheWidths_=Object.create(null))},t.utils.dom.stopTextWidthCache=function(){t.utils.dom.cacheReference_--,t.utils.dom.cacheReference_||(t.utils.dom.cacheWidths_=null)},t.utils.dom.getTextWidth=function(e){var n,r=e.textContent+"\n"+e.className.baseVal;if(t.utils.dom.cacheWidths_&&(n=t.utils.dom.cacheWidths_[r]))return n;try{n=t.utils.userAgent.IE||t.utils.userAgent.EDGE?e.getBBox().width:e.getComputedTextLength()}catch(t){return 8*e.textContent.length}return t.utils.dom.cacheWidths_&&(t.utils.dom.cacheWidths_[r]=n),n},t.utils.dom.getFastTextWidth=function(e,n,r,i){return t.utils.dom.getFastTextWidthWithSizeString(e,n+"pt",r,i)},t.utils.dom.getFastTextWidthWithSizeString=function(e,n,r,i){var o,s=e.textContent;return e=s+"\n"+e.className.baseVal,t.utils.dom.cacheWidths_&&(o=t.utils.dom.cacheWidths_[e])?o:(t.utils.dom.canvasContext_||((o=document.createElement("canvas")).className="blocklyComputeCanvas",document.body.appendChild(o),t.utils.dom.canvasContext_=o.getContext("2d")),t.utils.dom.canvasContext_.font=r+" "+n+" "+i,o=t.utils.dom.canvasContext_.measureText(s).width,t.utils.dom.cacheWidths_&&(t.utils.dom.cacheWidths_[e]=o),o)},t.utils.dom.measureFontMetrics=function(t,e,n,r){var i=document.createElement("span");i.style.font=n+" "+e+" "+r,i.textContent=t,(t=document.createElement("div")).style.width="1px",t.style.height="0px",(e=document.createElement("div")).setAttribute("style","position: fixed; top: 0; left: 0; display: flex;"),e.appendChild(i),e.appendChild(t),document.body.appendChild(e);try{n={},e.style.alignItems="baseline",n.baseline=t.offsetTop-i.offsetTop,e.style.alignItems="flex-end",n.height=t.offsetTop-i.offsetTop}finally{document.body.removeChild(e)}return n},t.utils.math={},t.utils.math.toRadians=function(t){return t*Math.PI/180},t.utils.math.toDegrees=function(t){return 180*t/Math.PI},t.utils.math.clamp=function(t,e,n){if(n<t){var r=n;n=t,t=r}return Math.max(t,Math.min(e,n))},t.DropDownDiv=function(){},t.DropDownDiv.boundsElement_=null,t.DropDownDiv.owner_=null,t.DropDownDiv.positionToField_=null,t.DropDownDiv.ARROW_SIZE=16,t.DropDownDiv.BORDER_SIZE=1,t.DropDownDiv.ARROW_HORIZONTAL_PADDING=12,t.DropDownDiv.PADDING_Y=16,t.DropDownDiv.ANIMATION_TIME=.25,t.DropDownDiv.animateOutTimer_=null,t.DropDownDiv.onHide_=null,t.DropDownDiv.rendererClassName_="",t.DropDownDiv.themeClassName_="",t.DropDownDiv.createDom=function(){if(!t.DropDownDiv.DIV_){var e=document.createElement("div");e.className="blocklyDropDownDiv",(t.parentContainer||document.body).appendChild(e),t.DropDownDiv.DIV_=e;var n=document.createElement("div");n.className="blocklyDropDownContent",e.appendChild(n),t.DropDownDiv.content_=n,(n=document.createElement("div")).className="blocklyDropDownArrow",e.appendChild(n),t.DropDownDiv.arrow_=n,t.DropDownDiv.DIV_.style.opacity=0,t.DropDownDiv.DIV_.style.transition="transform "+t.DropDownDiv.ANIMATION_TIME+"s, opacity "+t.DropDownDiv.ANIMATION_TIME+"s",e.addEventListener("focusin",function(){t.utils.dom.addClass(e,"blocklyFocused")}),e.addEventListener("focusout",function(){t.utils.dom.removeClass(e,"blocklyFocused")})}},t.DropDownDiv.setBoundsElement=function(e){t.DropDownDiv.boundsElement_=e},t.DropDownDiv.getContentDiv=function(){return t.DropDownDiv.content_},t.DropDownDiv.clearContent=function(){t.DropDownDiv.content_.textContent="",t.DropDownDiv.content_.style.width=""},t.DropDownDiv.setColour=function(e,n){t.DropDownDiv.DIV_.style.backgroundColor=e,t.DropDownDiv.DIV_.style.borderColor=n},t.DropDownDiv.showPositionedByBlock=function(e,n,r,i){return t.DropDownDiv.showPositionedByRect_(t.DropDownDiv.getScaledBboxOfBlock_(n),e,r,i)},t.DropDownDiv.showPositionedByField=function(e,n,r){return t.DropDownDiv.positionToField_=!0,t.DropDownDiv.showPositionedByRect_(t.DropDownDiv.getScaledBboxOfField_(e),e,n,r)},t.DropDownDiv.getScaledBboxOfBlock_=function(e){var n=e.getSvgRoot(),r=n.getBBox(),i=e.workspace.scale;return e=r.height*i,r=r.width*i,n=t.utils.style.getPageOffset(n),new t.utils.Rect(n.y,n.y+e,n.x,n.x+r)},t.DropDownDiv.getScaledBboxOfField_=function(e){return e=e.getScaledBBox(),new t.utils.Rect(e.top,e.bottom,e.left,e.right)},t.DropDownDiv.showPositionedByRect_=function(e,n,r,i){var o=e.left+(e.right-e.left)/2,s=e.bottom;e=e.top,i&&(e+=i);for(var a=(i=n.getSourceBlock()).workspace;a.options.parentWorkspace;)a=a.options.parentWorkspace;return t.DropDownDiv.setBoundsElement(a.getParentSvg().parentNode),t.DropDownDiv.show(n,i.RTL,o,s,o,e,r)},t.DropDownDiv.show=function(e,n,r,i,o,s,a){return t.DropDownDiv.owner_=e,t.DropDownDiv.onHide_=a||null,(e=t.DropDownDiv.DIV_).style.direction=n?"rtl":"ltr",n=t.getMainWorkspace(),t.DropDownDiv.rendererClassName_=n.getRenderer().getClassName(),t.DropDownDiv.themeClassName_=n.getTheme().getClassName(),t.utils.dom.addClass(e,t.DropDownDiv.rendererClassName_),t.utils.dom.addClass(e,t.DropDownDiv.themeClassName_),t.DropDownDiv.positionInternal_(r,i,o,s)},t.DropDownDiv.getBoundsInfo_=function(){var e=t.utils.style.getPageOffset(t.DropDownDiv.boundsElement_),n=t.utils.style.getSize(t.DropDownDiv.boundsElement_);return{left:e.x,right:e.x+n.width,top:e.y,bottom:e.y+n.height,width:n.width,height:n.height}},t.DropDownDiv.getPositionMetrics_=function(e,n,r,i){var o=t.DropDownDiv.getBoundsInfo_(),s=t.utils.style.getSize(t.DropDownDiv.DIV_);return n+s.height<o.bottom?t.DropDownDiv.getPositionBelowMetrics_(e,n,o,s):i-s.height>o.top?t.DropDownDiv.getPositionAboveMetrics_(r,i,o,s):n+s.height<document.documentElement.clientHeight?t.DropDownDiv.getPositionBelowMetrics_(e,n,o,s):i-s.height>document.documentElement.clientTop?t.DropDownDiv.getPositionAboveMetrics_(r,i,o,s):t.DropDownDiv.getPositionTopOfPageMetrics_(e,o,s)},t.DropDownDiv.getPositionBelowMetrics_=function(e,n,r,i){return{initialX:(e=t.DropDownDiv.getPositionX(e,r.left,r.right,i.width)).divX,initialY:n,finalX:e.divX,finalY:n+t.DropDownDiv.PADDING_Y,arrowX:e.arrowX,arrowY:-(t.DropDownDiv.ARROW_SIZE/2+t.DropDownDiv.BORDER_SIZE),arrowAtTop:!0,arrowVisible:!0}},t.DropDownDiv.getPositionAboveMetrics_=function(e,n,r,i){return{initialX:(e=t.DropDownDiv.getPositionX(e,r.left,r.right,i.width)).divX,initialY:n-i.height,finalX:e.divX,finalY:n-i.height-t.DropDownDiv.PADDING_Y,arrowX:e.arrowX,arrowY:i.height-2*t.DropDownDiv.BORDER_SIZE-t.DropDownDiv.ARROW_SIZE/2,arrowAtTop:!1,arrowVisible:!0}},t.DropDownDiv.getPositionTopOfPageMetrics_=function(e,n,r){return{initialX:(e=t.DropDownDiv.getPositionX(e,n.left,n.right,r.width)).divX,initialY:0,finalX:e.divX,finalY:0,arrowAtTop:null,arrowX:null,arrowY:null,arrowVisible:!1}},t.DropDownDiv.getPositionX=function(e,n,r,i){var o=e;return e=t.utils.math.clamp(n,e-i/2,r-i),o-=t.DropDownDiv.ARROW_SIZE/2,n=t.DropDownDiv.ARROW_HORIZONTAL_PADDING,{arrowX:i=t.utils.math.clamp(n,o-e,i-n-t.DropDownDiv.ARROW_SIZE),divX:e}},t.DropDownDiv.isVisible=function(){return!!t.DropDownDiv.owner_},t.DropDownDiv.hideIfOwner=function(e,n){return t.DropDownDiv.owner_===e&&(n?t.DropDownDiv.hideWithoutAnimation():t.DropDownDiv.hide(),!0)},t.DropDownDiv.hide=function(){var e=t.DropDownDiv.DIV_;e.style.transform="translate(0, 0)",e.style.opacity=0,t.DropDownDiv.animateOutTimer_=setTimeout(function(){t.DropDownDiv.hideWithoutAnimation()},1e3*t.DropDownDiv.ANIMATION_TIME),t.DropDownDiv.onHide_&&(t.DropDownDiv.onHide_(),t.DropDownDiv.onHide_=null)},t.DropDownDiv.hideWithoutAnimation=function(){if(t.DropDownDiv.isVisible()){t.DropDownDiv.animateOutTimer_&&clearTimeout(t.DropDownDiv.animateOutTimer_);var e=t.DropDownDiv.DIV_;e.style.transform="",e.style.left="",e.style.top="",e.style.opacity=0,e.style.display="none",e.style.backgroundColor="",e.style.borderColor="",t.DropDownDiv.onHide_&&(t.DropDownDiv.onHide_(),t.DropDownDiv.onHide_=null),t.DropDownDiv.clearContent(),t.DropDownDiv.owner_=null,t.DropDownDiv.rendererClassName_&&(t.utils.dom.removeClass(e,t.DropDownDiv.rendererClassName_),t.DropDownDiv.rendererClassName_=""),t.DropDownDiv.themeClassName_&&(t.utils.dom.removeClass(e,t.DropDownDiv.themeClassName_),t.DropDownDiv.themeClassName_=""),t.getMainWorkspace().markFocused()}},t.DropDownDiv.positionInternal_=function(e,n,r,i){(e=t.DropDownDiv.getPositionMetrics_(e,n,r,i)).arrowVisible?(t.DropDownDiv.arrow_.style.display="",t.DropDownDiv.arrow_.style.transform="translate("+e.arrowX+"px,"+e.arrowY+"px) rotate(45deg)",t.DropDownDiv.arrow_.setAttribute("class",e.arrowAtTop?"blocklyDropDownArrow blocklyArrowTop":"blocklyDropDownArrow blocklyArrowBottom")):t.DropDownDiv.arrow_.style.display="none",n=Math.floor(e.initialX),r=Math.floor(e.initialY),i=Math.floor(e.finalX);var o=Math.floor(e.finalY),s=t.DropDownDiv.DIV_;return s.style.left=n+"px",s.style.top=r+"px",s.style.display="block",s.style.opacity=1,s.style.transform="translate("+(i-n)+"px,"+(o-r)+"px)",!!e.arrowAtTop},t.DropDownDiv.repositionForWindowResize=function(){if(t.DropDownDiv.owner_){var e=t.DropDownDiv.owner_,n=e.getSourceBlock();n=(e=t.DropDownDiv.positionToField_?t.DropDownDiv.getScaledBboxOfField_(e):t.DropDownDiv.getScaledBboxOfBlock_(n)).left+(e.right-e.left)/2,t.DropDownDiv.positionInternal_(n,e.bottom,n,e.top)}else t.DropDownDiv.hide()},t.registry={},t.registry.typeMap_=Object.create(null),t.registry.DEFAULT="default",t.registry.Type=function(t){this.name_=t},t.registry.Type.prototype.toString=function(){return this.name_},t.registry.Type.CONNECTION_CHECKER=new t.registry.Type("connectionChecker"),t.registry.Type.CURSOR=new t.registry.Type("cursor"),t.registry.Type.EVENT=new t.registry.Type("event"),t.registry.Type.FIELD=new t.registry.Type("field"),t.registry.Type.RENDERER=new t.registry.Type("renderer"),t.registry.Type.TOOLBOX=new t.registry.Type("toolbox"),t.registry.Type.THEME=new t.registry.Type("theme"),t.registry.Type.TOOLBOX_ITEM=new t.registry.Type("toolboxItem"),t.registry.Type.FLYOUTS_VERTICAL_TOOLBOX=new t.registry.Type("flyoutsVerticalToolbox"),t.registry.Type.FLYOUTS_HORIZONTAL_TOOLBOX=new t.registry.Type("flyoutsHorizontalToolbox"),t.registry.Type.METRICS_MANAGER=new t.registry.Type("metricsManager"),t.registry.Type.BLOCK_DRAGGER=new t.registry.Type("blockDragger"),t.registry.register=function(e,n,r,i){if(!(e instanceof t.registry.Type)&&"string"!=typeof e||""==String(e).trim())throw Error('Invalid type "'+e+'". The type must be a non-empty string or a Blockly.registry.Type.');if(e=String(e).toLowerCase(),"string"!=typeof n||""==n.trim())throw Error('Invalid name "'+n+'". The name must be a non-empty string.');if(n=n.toLowerCase(),!r)throw Error("Can not register a null value");var o=t.registry.typeMap_[e];if(o||(o=t.registry.typeMap_[e]=Object.create(null)),t.registry.validate_(e,r),!i&&o[n])throw Error('Name "'+n+'" with type "'+e+'" already registered.');o[n]=r},t.registry.validate_=function(e,n){switch(e){case String(t.registry.Type.FIELD):if("function"!=typeof n.fromJson)throw Error('Type "'+e+'" must have a fromJson function')}},t.registry.unregister=function(e,n){e=String(e).toLowerCase(),n=n.toLowerCase();var r=t.registry.typeMap_[e];r&&r[n]?delete t.registry.typeMap_[e][n]:console.warn("Unable to unregister ["+n+"]["+e+"] from the registry.")},t.registry.getItem_=function(e,n,r){e=String(e).toLowerCase(),n=n.toLowerCase();var i=t.registry.typeMap_[e];if(!i||!i[n]){if(n="Unable to find ["+n+"]["+e+"] in the registry.",r)throw Error(n+" You must require or register a "+e+" plugin.");return console.warn(n),null}return i[n]},t.registry.hasItem=function(e,n){return e=String(e).toLowerCase(),n=n.toLowerCase(),!!(e=t.registry.typeMap_[e])&&!!e[n]},t.registry.getClass=function(e,n,r){return t.registry.getItem_(e,n,r)},t.registry.getObject=function(e,n,r){return t.registry.getItem_(e,n,r)},t.registry.getClassFromOptions=function(e,n,r){return"function"==typeof(n=n.plugins[e.toString()]||t.registry.DEFAULT)?n:t.registry.getClass(e,n,r)},t.Events={},t.Events.group_="",t.Events.recordUndo=!0,t.Events.disabled_=0,t.Events.CREATE="create",t.Events.BLOCK_CREATE=t.Events.CREATE,t.Events.DELETE="delete",t.Events.BLOCK_DELETE=t.Events.DELETE,t.Events.CHANGE="change",t.Events.BLOCK_CHANGE=t.Events.CHANGE,t.Events.MOVE="move",t.Events.BLOCK_MOVE=t.Events.MOVE,t.Events.VAR_CREATE="var_create",t.Events.VAR_DELETE="var_delete",t.Events.VAR_RENAME="var_rename",t.Events.UI="ui",t.Events.BLOCK_DRAG="drag",t.Events.SELECTED="selected",t.Events.CLICK="click",t.Events.MARKER_MOVE="marker_move",t.Events.BUBBLE_OPEN="bubble_open",t.Events.TRASHCAN_OPEN="trashcan_open",t.Events.TOOLBOX_ITEM_SELECT="toolbox_item_select",t.Events.THEME_CHANGE="theme_change",t.Events.VIEWPORT_CHANGE="viewport_change",t.Events.COMMENT_CREATE="comment_create",t.Events.COMMENT_DELETE="comment_delete",t.Events.COMMENT_CHANGE="comment_change",t.Events.COMMENT_MOVE="comment_move",t.Events.FINISHED_LOADING="finished_loading",t.Events.BUMP_EVENTS=[t.Events.BLOCK_CREATE,t.Events.BLOCK_MOVE,t.Events.COMMENT_CREATE,t.Events.COMMENT_MOVE],t.Events.FIRE_QUEUE_=[],t.Events.fire=function(e){t.Events.isEnabled()&&(t.Events.FIRE_QUEUE_.length||setTimeout(t.Events.fireNow_,0),t.Events.FIRE_QUEUE_.push(e))},t.Events.fireNow_=function(){for(var e,n=t.Events.filter(t.Events.FIRE_QUEUE_,!0),r=t.Events.FIRE_QUEUE_.length=0;e=n[r];r++)if(e.workspaceId){var i=t.Workspace.getById(e.workspaceId);i&&i.fireChangeListener(e)}},t.Events.filter=function(e,n){e=e.slice(),n||e.reverse();for(var r,i=[],o=Object.create(null),s=0;r=e[s];s++)if(!r.isNull()){var a=[r.isUiEvent?t.Events.UI:r.type,r.blockId,r.workspaceId].join(" "),l=o[a],u=l?l.event:null;l?r.type==t.Events.MOVE&&l.index==s-1?(u.newParentId=r.newParentId,u.newInputName=r.newInputName,u.newCoordinate=r.newCoordinate,l.index=s):r.type==t.Events.CHANGE&&r.element==u.element&&r.name==u.name?u.newValue=r.newValue:r.type==t.Events.VIEWPORT_CHANGE?(u.viewTop=r.viewTop,u.viewLeft=r.viewLeft,u.scale=r.scale,u.oldScale=r.oldScale):r.type==t.Events.CLICK&&u.type==t.Events.BUBBLE_OPEN||(o[a]={event:r,index:s},i.push(r)):(o[a]={event:r,index:s},i.push(r))}for(e=i.filter(function(t){return!t.isNull()}),n||e.reverse(),s=1;r=e[s];s++)r.type==t.Events.CHANGE&&"mutation"==r.element&&e.unshift(e.splice(s,1)[0]);return e},t.Events.clearPendingUndo=function(){for(var e,n=0;e=t.Events.FIRE_QUEUE_[n];n++)e.recordUndo=!1},t.Events.disable=function(){t.Events.disabled_++},t.Events.enable=function(){t.Events.disabled_--},t.Events.isEnabled=function(){return 0==t.Events.disabled_},t.Events.getGroup=function(){return t.Events.group_},t.Events.setGroup=function(e){t.Events.group_="boolean"==typeof e?e?t.utils.genUid():"":e},t.Events.getDescendantIds=function(t){var e=[];t=t.getDescendants(!1);for(var n,r=0;n=t[r];r++)e[r]=n.id;return e},t.Events.fromJson=function(e,n){var r=t.Events.get(e.type);if(!r)throw Error("Unknown event type.");return(r=new r).fromJson(e),r.workspaceId=n.id,r},t.Events.get=function(e){return t.registry.getClass(t.registry.Type.EVENT,e)},t.Events.disableOrphans=function(e){if((e.type==t.Events.MOVE||e.type==t.Events.CREATE)&&e.workspaceId){var n=t.Workspace.getById(e.workspaceId),r=n.getBlockById(e.blockId);if(r){e=t.Events.recordUndo;try{t.Events.recordUndo=!1;var i=r.getParent();if(i&&i.isEnabled()){var o,s=r.getDescendants(!1);for(n=0;o=s[n];n++)o.setEnabled(!0)}else if((r.outputConnection||r.previousConnection)&&!n.isDragging())do{r.setEnabled(!1),r=r.getNextBlock()}while(r)}finally{t.Events.recordUndo=e}}}},t.Events.Abstract=function(){this.isBlank=null,this.workspaceId=void 0,this.group=t.Events.getGroup(),this.recordUndo=t.Events.recordUndo},t.Events.Abstract.prototype.isUiEvent=!1,t.Events.Abstract.prototype.toJson=function(){var t={type:this.type};return this.group&&(t.group=this.group),t},t.Events.Abstract.prototype.fromJson=function(t){this.isBlank=!1,this.group=t.group},t.Events.Abstract.prototype.isNull=function(){return!1},t.Events.Abstract.prototype.run=function(t){},t.Events.Abstract.prototype.getEventWorkspace_=function(){if(this.workspaceId)var e=t.Workspace.getById(this.workspaceId);if(!e)throw Error("Workspace is null. Event must have been generated from real Blockly events.");return e},t.utils.object={},t.utils.object.inherits=function(t,e){t.superClass_=e.prototype,t.prototype=Object.create(e.prototype),t.prototype.constructor=t},t.utils.object.mixin=function(t,e){for(var n in e)t[n]=e[n]},t.utils.object.deepMerge=function(e,n){for(var r in n)e[r]=null!=n[r]&&"object"==typeof n[r]?t.utils.object.deepMerge(e[r]||Object.create(null),n[r]):n[r];return e},t.utils.object.values=function(t){return Object.values?Object.values(t):Object.keys(t).map(function(e){return t[e]})},t.utils.xml={},t.utils.xml.NAME_SPACE="https://developers.google.com/blockly/xml",t.utils.xml.document=function(){return document},t.utils.xml.createElement=function(e){return t.utils.xml.document().createElementNS(t.utils.xml.NAME_SPACE,e)},t.utils.xml.createTextNode=function(e){return t.utils.xml.document().createTextNode(e)},t.utils.xml.textToDomDocument=function(t){return(new DOMParser).parseFromString(t,"text/xml")},t.utils.xml.domToText=function(t){return(new XMLSerializer).serializeToString(t)},t.inputTypes={VALUE:t.connectionTypes.INPUT_VALUE,STATEMENT:t.connectionTypes.NEXT_STATEMENT,DUMMY:5},t.Xml={},t.Xml.workspaceToDom=function(e,n){var r=t.utils.xml.createElement("xml"),i=t.Xml.variablesToDom(t.Variables.allUsedVarModels(e));i.hasChildNodes()&&r.appendChild(i);var o,s=e.getTopComments(!0);for(i=0;o=s[i];i++)r.appendChild(o.toXmlWithXY(n));for(e=e.getTopBlocks(!0),i=0;s=e[i];i++)r.appendChild(t.Xml.blockToDomWithXY(s,n));return r},t.Xml.variablesToDom=function(e){for(var n,r=t.utils.xml.createElement("variables"),i=0;n=e[i];i++){var o=t.utils.xml.createElement("variable");o.appendChild(t.utils.xml.createTextNode(n.name)),n.type&&o.setAttribute("type",n.type),o.id=n.getId(),r.appendChild(o)}return r},t.Xml.blockToDomWithXY=function(e,n){if(e.isInsertionMarker()&&!(e=e.getChildren(!1)[0]))return new DocumentFragment;var r;e.workspace.RTL&&(r=e.workspace.getWidth()),n=t.Xml.blockToDom(e,n);var i=e.getRelativeToSurfaceXY();return n.setAttribute("x",Math.round(e.workspace.RTL?r-i.x:i.x)),n.setAttribute("y",Math.round(i.y)),n},t.Xml.fieldToDom_=function(e){if(e.isSerializable()){var n=t.utils.xml.createElement("field");return n.setAttribute("name",e.name||""),e.toXml(n)}return null},t.Xml.allFieldsToDom_=function(e,n){for(var r,i=0;r=e.inputList[i];i++)for(var o,s=0;o=r.fieldRow[s];s++)(o=t.Xml.fieldToDom_(o))&&n.appendChild(o)},t.Xml.blockToDom=function(e,n){if(e.isInsertionMarker())return(e=e.getChildren(!1)[0])?t.Xml.blockToDom(e):new DocumentFragment;var r=t.utils.xml.createElement(e.isShadow()?"shadow":"block");if(r.setAttribute("type",e.type),n||r.setAttribute("id",e.id),e.mutationToDom){var i=e.mutationToDom();i&&(i.hasChildNodes()||i.hasAttributes())&&r.appendChild(i)}if(t.Xml.allFieldsToDom_(e,r),i=e.getCommentText()){var o=e.commentModel.size,s=e.commentModel.pinned,a=t.utils.xml.createElement("comment");a.appendChild(t.utils.xml.createTextNode(i)),a.setAttribute("pinned",s),a.setAttribute("h",o.height),a.setAttribute("w",o.width),r.appendChild(a)}for(e.data&&((i=t.utils.xml.createElement("data")).appendChild(t.utils.xml.createTextNode(e.data)),r.appendChild(i)),i=0;o=e.inputList[i];i++){var l;if(s=!0,o.type!=t.inputTypes.DUMMY){var u=o.connection.targetBlock();o.type==t.inputTypes.VALUE?l=t.utils.xml.createElement("value"):o.type==t.inputTypes.STATEMENT&&(l=t.utils.xml.createElement("statement")),!(a=o.connection.getShadowDom())||u&&u.isShadow()||l.appendChild(t.Xml.cloneShadow_(a,n)),u&&((a=t.Xml.blockToDom(u,n)).nodeType==t.utils.dom.NodeType.ELEMENT_NODE&&(l.appendChild(a),s=!1)),l.setAttribute("name",o.name),s||r.appendChild(l)}}return void 0!=e.inputsInline&&e.inputsInline!=e.inputsInlineDefault&&r.setAttribute("inline",e.inputsInline),e.isCollapsed()&&r.setAttribute("collapsed",!0),e.isEnabled()||r.setAttribute("disabled",!0),e.isDeletable()||e.isShadow()||r.setAttribute("deletable",!1),e.isMovable()||e.isShadow()||r.setAttribute("movable",!1),e.isEditable()||r.setAttribute("editable",!1),(i=e.getNextBlock())&&((a=t.Xml.blockToDom(i,n)).nodeType==t.utils.dom.NodeType.ELEMENT_NODE&&((l=t.utils.xml.createElement("next")).appendChild(a),r.appendChild(l))),!(a=e.nextConnection&&e.nextConnection.getShadowDom())||i&&i.isShadow()||l.appendChild(t.Xml.cloneShadow_(a,n)),r},t.Xml.cloneShadow_=function(e,n){for(var r,i=e=e.cloneNode(!0);i;)if(n&&"shadow"==i.nodeName&&i.removeAttribute("id"),i.firstChild)i=i.firstChild;else{for(;i&&!i.nextSibling;)r=i,i=i.parentNode,r.nodeType==t.utils.dom.NodeType.TEXT_NODE&&""==r.data.trim()&&i.firstChild!=r&&t.utils.dom.removeNode(r);i&&(r=i,i=i.nextSibling,r.nodeType==t.utils.dom.NodeType.TEXT_NODE&&""==r.data.trim()&&t.utils.dom.removeNode(r))}return e},t.Xml.domToText=function(e){return t.utils.xml.domToText(e).replace(/<(\w+)([^<]*)\/>/g,"<$1$2></$1>")},t.Xml.domToPrettyText=function(e){e=t.Xml.domToText(e).split("<");for(var n="",r=1;r<e.length;r++){var i=e[r];"/"==i[0]&&(n=n.substring(2)),e[r]=n+"<"+i,"/"!=i[0]&&"/>"!=i.slice(-2)&&(n+=" ")}return(e=(e=e.join("\n")).replace(/(<(\w+)\b[^>]*>[^\n]*)\n *<\/\2>/g,"$1</$2>")).replace(/^\n/,"")},t.Xml.textToDom=function(e){var n=t.utils.xml.textToDomDocument(e);if(!n||!n.documentElement||n.getElementsByTagName("parsererror").length)throw Error("textToDom was unable to parse: "+e);return n.documentElement},t.Xml.clearWorkspaceAndLoadFromXml=function(e,n){return n.setResizesEnabled(!1),n.clear(),e=t.Xml.domToWorkspace(e,n),n.setResizesEnabled(!0),e},t.Xml.domToWorkspace=function(e,n){if(e instanceof t.Workspace){var r=e;e=n,n=r,console.warn("Deprecated call to Blockly.Xml.domToWorkspace, swap the arguments.")}var i;n.RTL&&(i=n.getWidth()),r=[],t.utils.dom.startTextWidthCache();var o=t.Events.getGroup();o||t.Events.setGroup(!0),n.setResizesEnabled&&n.setResizesEnabled(!1);var s=!0;try{for(var a,l=0;a=e.childNodes[l];l++){var u=a.nodeName.toLowerCase(),c=a;if("block"==u||"shadow"==u&&!t.Events.recordUndo){var h=t.Xml.domToBlock(c,n);r.push(h.id);var d=c.hasAttribute("x")?parseInt(c.getAttribute("x"),10):10,p=c.hasAttribute("y")?parseInt(c.getAttribute("y"),10):10;isNaN(d)||isNaN(p)||h.moveBy(n.RTL?i-d:d,p),s=!1}else{if("shadow"==u)throw TypeError("Shadow block cannot be a top-level block.");if("comment"==u)n.rendered?t.WorkspaceCommentSvg?t.WorkspaceCommentSvg.fromXml(c,n,i):console.warn("Missing require for Blockly.WorkspaceCommentSvg, ignoring workspace comment."):t.WorkspaceComment?t.WorkspaceComment.fromXml(c,n):console.warn("Missing require for Blockly.WorkspaceComment, ignoring workspace comment.");else if("variables"==u){if(!s)throw Error("'variables' tag must exist once before block and shadow tag elements in the workspace XML, but it was found in another location.");t.Xml.domToVariables(c,n),s=!1}}}}finally{o||t.Events.setGroup(!1),t.utils.dom.stopTextWidthCache()}return n.setResizesEnabled&&n.setResizesEnabled(!0),t.Events.fire(new(t.Events.get(t.Events.FINISHED_LOADING))(n)),r},t.Xml.appendDomToWorkspace=function(e,n){var r;if(Object.prototype.hasOwnProperty.call(n,"scale")&&(r=n.getBlocksBoundingBox()),e=t.Xml.domToWorkspace(e,n),r&&r.top!=r.bottom){var i=r.bottom,o=n.RTL?r.right:r.left,s=1/0,a=-1/0,l=1/0;for(r=0;r<e.length;r++){var u=n.getBlockById(e[r]).getRelativeToSurfaceXY();u.y<l&&(l=u.y),u.x<s&&(s=u.x),u.x>a&&(a=u.x)}for(i=i-l+10,o=n.RTL?o-a:o-s,r=0;r<e.length;r++)n.getBlockById(e[r]).moveBy(o,i)}return e},t.Xml.domToBlock=function(e,n){if(e instanceof t.Workspace){var r=e;e=n,n=r,console.warn("Deprecated call to Blockly.Xml.domToBlock, swap the arguments.")}t.Events.disable(),r=n.getAllVariables();try{var i=t.Xml.domToBlockHeadless_(e,n),o=i.getDescendants(!1);if(n.rendered){i.setConnectionTracking(!1);for(var s=o.length-1;0<=s;s--)o[s].initSvg();for(s=o.length-1;0<=s;s--)o[s].render(!1);setTimeout(function(){i.disposed||i.setConnectionTracking(!0)},1),i.updateDisabled(),n.resizeContents()}else for(s=o.length-1;0<=s;s--)o[s].initModel()}finally{t.Events.enable()}if(t.Events.isEnabled()){for(e=t.Variables.getAddedVariables(n,r),s=0;s<e.length;s++)n=e[s],t.Events.fire(new(t.Events.get(t.Events.VAR_CREATE))(n));t.Events.fire(new(t.Events.get(t.Events.CREATE))(i))}return i},t.Xml.domToVariables=function(e,n){for(var r,i=0;r=e.childNodes[i];i++)if(r.nodeType==t.utils.dom.NodeType.ELEMENT_NODE){var o=r.getAttribute("type"),s=r.getAttribute("id");n.createVariable(r.textContent,o,s)}},t.Xml.mapSupportedXmlTags_=function(e){for(var n,r={mutation:[],comment:[],data:[],field:[],input:[],next:[]},i=0;n=e.childNodes[i];i++)if(n.nodeType!=t.utils.dom.NodeType.TEXT_NODE)switch(n.nodeName.toLowerCase()){case"mutation":r.mutation.push(n);break;case"comment":if(!t.Comment){console.warn("Missing require for Blockly.Comment, ignoring block comment.");break}r.comment.push(n);break;case"data":r.data.push(n);break;case"title":case"field":r.field.push(n);break;case"value":case"statement":r.input.push(n);break;case"next":r.next.push(n);break;default:console.warn("Ignoring unknown tag: "+n.nodeName)}return r},t.Xml.applyMutationTagNodes_=function(t,e){for(var n,r=!1,i=0;n=t[i];i++)e.domToMutation&&(e.domToMutation(n),e.initSvg&&(r=!0));return r},t.Xml.applyCommentTagNodes_=function(e,n){for(var r,i=0;r=e[i];i++){var o=r.textContent,s="true"==r.getAttribute("pinned"),a=parseInt(r.getAttribute("w"),10);r=parseInt(r.getAttribute("h"),10),n.setCommentText(o),n.commentModel.pinned=s,isNaN(a)||isNaN(r)||(n.commentModel.size=new t.utils.Size(a,r)),s&&n.getCommentIcon&&!n.isInFlyout&&setTimeout(function(){n.getCommentIcon().setVisible(!0)},1)}},t.Xml.applyDataTagNodes_=function(t,e){for(var n,r=0;n=t[r];r++)e.data=n.textContent},t.Xml.applyFieldTagNodes_=function(e,n){for(var r,i=0;r=e[i];i++){var o=r.getAttribute("name");t.Xml.domToField_(n,o,r)}},t.Xml.findChildBlocks_=function(e){for(var n,r={childBlockElement:null,childShadowElement:null},i=0;n=e.childNodes[i];i++)n.nodeType==t.utils.dom.NodeType.ELEMENT_NODE&&("block"==n.nodeName.toLowerCase()?r.childBlockElement=n:"shadow"==n.nodeName.toLowerCase()&&(r.childShadowElement=n));return r},t.Xml.applyInputTagNodes_=function(e,n,r,i){for(var o,s=0;o=e[s];s++){var a=o.getAttribute("name"),l=r.getInput(a);if(!l){console.warn("Ignoring non-existent input "+a+" in block "+i);break}if((o=t.Xml.findChildBlocks_(o)).childBlockElement){if(!l.connection)throw TypeError("Input connection does not exist.");t.Xml.domToBlockHeadless_(o.childBlockElement,n,l.connection,!1)}o.childShadowElement&&l.connection.setShadowDom(o.childShadowElement)}},t.Xml.applyNextTagNodes_=function(e,n,r){for(var i,o=0;i=e[o];o++){if((i=t.Xml.findChildBlocks_(i)).childBlockElement){if(!r.nextConnection)throw TypeError("Next statement does not exist.");if(r.nextConnection.isConnected())throw TypeError("Next statement is already connected.");t.Xml.domToBlockHeadless_(i.childBlockElement,n,r.nextConnection,!0)}i.childShadowElement&&r.nextConnection&&r.nextConnection.setShadowDom(i.childShadowElement)}},t.Xml.domToBlockHeadless_=function(e,n,r,i){var o=e.getAttribute("type");if(!o)throw TypeError("Block type unspecified: "+e.outerHTML);var s=e.getAttribute("id");s=n.newBlock(o,s);var a=t.Xml.mapSupportedXmlTags_(e),l=t.Xml.applyMutationTagNodes_(a.mutation,s);if(t.Xml.applyCommentTagNodes_(a.comment,s),t.Xml.applyDataTagNodes_(a.data,s),r)if(i){if(!s.previousConnection)throw TypeError("Next block does not have previous statement.");r.connect(s.previousConnection)}else if(s.outputConnection)r.connect(s.outputConnection);else{if(!s.previousConnection)throw TypeError("Child block does not have output or previous statement.");r.connect(s.previousConnection)}if(t.Xml.applyFieldTagNodes_(a.field,s),t.Xml.applyInputTagNodes_(a.input,n,s,o),t.Xml.applyNextTagNodes_(a.next,n,s),l&&s.initSvg(),(n=e.getAttribute("inline"))&&s.setInputsInline("true"==n),(n=e.getAttribute("disabled"))&&s.setEnabled("true"!=n&&"disabled"!=n),(n=e.getAttribute("deletable"))&&s.setDeletable("true"==n),(n=e.getAttribute("movable"))&&s.setMovable("true"==n),(n=e.getAttribute("editable"))&&s.setEditable("true"==n),(n=e.getAttribute("collapsed"))&&s.setCollapsed("true"==n),"shadow"==e.nodeName.toLowerCase()){for(e=s.getChildren(!1),n=0;r=e[n];n++)if(!r.isShadow())throw TypeError("Shadow block not allowed non-shadow child.");if(s.getVarModels().length)throw TypeError("Shadow blocks cannot have variable references.");s.setShadow(!0)}return s},t.Xml.domToField_=function(t,e,n){var r=t.getField(e);r?r.fromXml(n):console.warn("Ignoring non-existent field "+e+" in block "+t.type)},t.Xml.deleteNext=function(t){for(var e,n=0;e=t.childNodes[n];n++)if("next"==e.nodeName.toLowerCase()){t.removeChild(e);break}},t.Events.BlockBase=function(e){t.Events.BlockBase.superClass_.constructor.call(this),this.blockId=(this.isBlank=void 0===e)?"":e.id,this.workspaceId=this.isBlank?"":e.workspace.id},t.utils.object.inherits(t.Events.BlockBase,t.Events.Abstract),t.Events.BlockBase.prototype.toJson=function(){var e=t.Events.BlockBase.superClass_.toJson.call(this);return e.blockId=this.blockId,e},t.Events.BlockBase.prototype.fromJson=function(e){t.Events.BlockBase.superClass_.fromJson.call(this,e),this.blockId=e.blockId},t.Events.BlockChange=function(e,n,r,i,o){t.Events.Change.superClass_.constructor.call(this,e),e&&(this.element=void 0===n?"":n,this.name=void 0===r?"":r,this.oldValue=void 0===i?"":i,this.newValue=void 0===o?"":o)},t.utils.object.inherits(t.Events.BlockChange,t.Events.BlockBase),t.Events.Change=t.Events.BlockChange,t.Events.BlockChange.prototype.type=t.Events.CHANGE,t.Events.BlockChange.prototype.toJson=function(){var e=t.Events.BlockChange.superClass_.toJson.call(this);return e.element=this.element,this.name&&(e.name=this.name),e.oldValue=this.oldValue,e.newValue=this.newValue,e},t.Events.BlockChange.prototype.fromJson=function(e){t.Events.BlockChange.superClass_.fromJson.call(this,e),this.element=e.element,this.name=e.name,this.oldValue=e.oldValue,this.newValue=e.newValue},t.Events.BlockChange.prototype.isNull=function(){return this.oldValue==this.newValue},t.Events.BlockChange.prototype.run=function(e){var n=this.getEventWorkspace_().getBlockById(this.blockId);if(n)switch(n.mutator&&n.mutator.setVisible(!1),e=e?this.newValue:this.oldValue,this.element){case"field":(n=n.getField(this.name))?n.setValue(e):console.warn("Can't set non-existent field: "+this.name);break;case"comment":n.setCommentText(e||null);break;case"collapsed":n.setCollapsed(!!e);break;case"disabled":n.setEnabled(!e);break;case"inline":n.setInputsInline(!!e);break;case"mutation":var r="";if(n.mutationToDom&&(r=(r=n.mutationToDom())&&t.Xml.domToText(r)),n.domToMutation){var i=t.Xml.textToDom(e||"<mutation/>");n.domToMutation(i)}t.Events.fire(new t.Events.BlockChange(n,"mutation",null,r,e));break;default:console.warn("Unknown change type: "+this.element)}else console.warn("Can't change non-existent block: "+this.blockId)},t.Events.Create=function(e){t.Events.Create.superClass_.constructor.call(this,e),e&&(e.isShadow()&&(this.recordUndo=!1),this.xml=e.workspace.rendered?t.Xml.blockToDomWithXY(e):t.Xml.blockToDom(e),this.ids=t.Events.getDescendantIds(e))},t.utils.object.inherits(t.Events.Create,t.Events.BlockBase),t.Events.BlockCreate=t.Events.Create,t.Events.Create.prototype.type=t.Events.CREATE,t.Events.Create.prototype.toJson=function(){var e=t.Events.Create.superClass_.toJson.call(this);return e.xml=t.Xml.domToText(this.xml),e.ids=this.ids,this.recordUndo||(e.recordUndo=this.recordUndo),e},t.Events.Create.prototype.fromJson=function(e){t.Events.Create.superClass_.fromJson.call(this,e),this.xml=t.Xml.textToDom(e.xml),this.ids=e.ids,void 0!==e.recordUndo&&(this.recordUndo=e.recordUndo)},t.Events.Create.prototype.run=function(e){var n=this.getEventWorkspace_();if(e)(e=t.utils.xml.createElement("xml")).appendChild(this.xml),t.Xml.domToWorkspace(e,n);else{e=0;for(var r;r=this.ids[e];e++){var i=n.getBlockById(r);i?i.dispose(!1):r==this.blockId&&console.warn("Can't uncreate non-existent block: "+r)}}},t.Events.Delete=function(e){if(t.Events.Delete.superClass_.constructor.call(this,e),e){if(e.getParent())throw Error("Connected blocks cannot be deleted.");e.isShadow()&&(this.recordUndo=!1),this.oldXml=e.workspace.rendered?t.Xml.blockToDomWithXY(e):t.Xml.blockToDom(e),this.ids=t.Events.getDescendantIds(e)}},t.utils.object.inherits(t.Events.Delete,t.Events.BlockBase),t.Events.BlockDelete=t.Events.Delete,t.Events.Delete.prototype.type=t.Events.DELETE,t.Events.Delete.prototype.toJson=function(){var e=t.Events.Delete.superClass_.toJson.call(this);return e.oldXml=t.Xml.domToText(this.oldXml),e.ids=this.ids,this.recordUndo||(e.recordUndo=this.recordUndo),e},t.Events.Delete.prototype.fromJson=function(e){t.Events.Delete.superClass_.fromJson.call(this,e),this.oldXml=t.Xml.textToDom(e.oldXml),this.ids=e.ids,void 0!==e.recordUndo&&(this.recordUndo=e.recordUndo)},t.Events.Delete.prototype.run=function(e){var n=this.getEventWorkspace_();if(e){e=0;for(var r;r=this.ids[e];e++){var i=n.getBlockById(r);i?i.dispose(!1):r==this.blockId&&console.warn("Can't delete non-existent block: "+r)}}else(e=t.utils.xml.createElement("xml")).appendChild(this.oldXml),t.Xml.domToWorkspace(e,n)},t.Events.Move=function(e){t.Events.Move.superClass_.constructor.call(this,e),e&&(e.isShadow()&&(this.recordUndo=!1),e=this.currentLocation_(),this.oldParentId=e.parentId,this.oldInputName=e.inputName,this.oldCoordinate=e.coordinate)},t.utils.object.inherits(t.Events.Move,t.Events.BlockBase),t.Events.BlockMove=t.Events.Move,t.Events.Move.prototype.type=t.Events.MOVE,t.Events.Move.prototype.toJson=function(){var e=t.Events.Move.superClass_.toJson.call(this);return this.newParentId&&(e.newParentId=this.newParentId),this.newInputName&&(e.newInputName=this.newInputName),this.newCoordinate&&(e.newCoordinate=Math.round(this.newCoordinate.x)+","+Math.round(this.newCoordinate.y)),this.recordUndo||(e.recordUndo=this.recordUndo),e},t.Events.Move.prototype.fromJson=function(e){if(t.Events.Move.superClass_.fromJson.call(this,e),this.newParentId=e.newParentId,this.newInputName=e.newInputName,e.newCoordinate){var n=e.newCoordinate.split(",");this.newCoordinate=new t.utils.Coordinate(Number(n[0]),Number(n[1]))}void 0!==e.recordUndo&&(this.recordUndo=e.recordUndo)},t.Events.Move.prototype.recordNew=function(){var t=this.currentLocation_();this.newParentId=t.parentId,this.newInputName=t.inputName,this.newCoordinate=t.coordinate},t.Events.Move.prototype.currentLocation_=function(){var t=this.getEventWorkspace_().getBlockById(this.blockId),e={},n=t.getParent();return n?(e.parentId=n.id,(t=n.getInputWithBlock(t))&&(e.inputName=t.name)):e.coordinate=t.getRelativeToSurfaceXY(),e},t.Events.Move.prototype.isNull=function(){return this.oldParentId==this.newParentId&&this.oldInputName==this.newInputName&&t.utils.Coordinate.equals(this.oldCoordinate,this.newCoordinate)},t.Events.Move.prototype.run=function(e){var n=this.getEventWorkspace_(),r=n.getBlockById(this.blockId);if(r){var i=e?this.newParentId:this.oldParentId,o=e?this.newInputName:this.oldInputName,s=e?this.newCoordinate:this.oldCoordinate;if(e=null,i&&!(e=n.getBlockById(i)))return void console.warn("Can't connect to non-existent block: "+i);if(r.getParent()&&r.unplug(),s)o=r.getRelativeToSurfaceXY(),r.moveBy(s.x-o.x,s.y-o.y);else{if(n=(r=r.outputConnection||r.previousConnection).type,o){if(e=e.getInput(o))var a=e.connection}else n==t.connectionTypes.PREVIOUS_STATEMENT&&(a=e.nextConnection);a?r.connect(a):console.warn("Can't connect to non-existent input: "+o)}}else console.warn("Can't move non-existent block: "+this.blockId)},t.registry.register(t.registry.Type.EVENT,t.Events.CREATE,t.Events.Create),t.registry.register(t.registry.Type.EVENT,t.Events.DELETE,t.Events.Delete),t.registry.register(t.registry.Type.EVENT,t.Events.CHANGE,t.Events.BlockChange),t.registry.register(t.registry.Type.EVENT,t.Events.MOVE,t.Events.Move),t.Events.FinishedLoading=function(e){this.isBlank=void 0===e,this.workspaceId=e?e.id:"",this.group=t.Events.getGroup(),this.recordUndo=!1},t.utils.object.inherits(t.Events.FinishedLoading,t.Events.Abstract),t.Events.FinishedLoading.prototype.type=t.Events.FINISHED_LOADING,t.Events.FinishedLoading.prototype.toJson=function(){var t={type:this.type};return this.group&&(t.group=this.group),this.workspaceId&&(t.workspaceId=this.workspaceId),t},t.Events.FinishedLoading.prototype.fromJson=function(t){this.isBlank=!1,this.workspaceId=t.workspaceId,this.group=t.group},t.registry.register(t.registry.Type.EVENT,t.Events.FINISHED_LOADING,t.Events.FinishedLoading),t.Events.UiBase=function(e){t.Events.UiBase.superClass_.constructor.call(this),this.isBlank=void 0===e,this.workspaceId=e||"",this.recordUndo=!1},t.utils.object.inherits(t.Events.UiBase,t.Events.Abstract),t.Events.UiBase.prototype.isUiEvent=!0,t.Events.Ui=function(e,n,r,i){t.Events.Ui.superClass_.constructor.call(this,e?e.workspace.id:void 0),this.blockId=e?e.id:null,this.element=void 0===n?"":n,this.oldValue=void 0===r?"":r,this.newValue=void 0===i?"":i},t.utils.object.inherits(t.Events.Ui,t.Events.UiBase),t.Events.Ui.prototype.type=t.Events.UI,t.Events.Ui.prototype.toJson=function(){var e=t.Events.Ui.superClass_.toJson.call(this);return e.element=this.element,void 0!==this.newValue&&(e.newValue=this.newValue),this.blockId&&(e.blockId=this.blockId),e},t.Events.Ui.prototype.fromJson=function(e){t.Events.Ui.superClass_.fromJson.call(this,e),this.element=e.element,this.newValue=e.newValue,this.blockId=e.blockId},t.registry.register(t.registry.Type.EVENT,t.Events.UI,t.Events.Ui),t.Events.VarBase=function(e){t.Events.VarBase.superClass_.constructor.call(this),this.varId=(this.isBlank=void 0===e)?"":e.getId(),this.workspaceId=this.isBlank?"":e.workspace.id},t.utils.object.inherits(t.Events.VarBase,t.Events.Abstract),t.Events.VarBase.prototype.toJson=function(){var e=t.Events.VarBase.superClass_.toJson.call(this);return e.varId=this.varId,e},t.Events.VarBase.prototype.fromJson=function(e){t.Events.VarBase.superClass_.toJson.call(this),this.varId=e.varId},t.Events.VarCreate=function(e){t.Events.VarCreate.superClass_.constructor.call(this,e),e&&(this.varType=e.type,this.varName=e.name)},t.utils.object.inherits(t.Events.VarCreate,t.Events.VarBase),t.Events.VarCreate.prototype.type=t.Events.VAR_CREATE,t.Events.VarCreate.prototype.toJson=function(){var e=t.Events.VarCreate.superClass_.toJson.call(this);return e.varType=this.varType,e.varName=this.varName,e},t.Events.VarCreate.prototype.fromJson=function(e){t.Events.VarCreate.superClass_.fromJson.call(this,e),this.varType=e.varType,this.varName=e.varName},t.Events.VarCreate.prototype.run=function(t){var e=this.getEventWorkspace_();t?e.createVariable(this.varName,this.varType,this.varId):e.deleteVariableById(this.varId)},t.Events.VarDelete=function(e){t.Events.VarDelete.superClass_.constructor.call(this,e),e&&(this.varType=e.type,this.varName=e.name)},t.utils.object.inherits(t.Events.VarDelete,t.Events.VarBase),t.Events.VarDelete.prototype.type=t.Events.VAR_DELETE,t.Events.VarDelete.prototype.toJson=function(){var e=t.Events.VarDelete.superClass_.toJson.call(this);return e.varType=this.varType,e.varName=this.varName,e},t.Events.VarDelete.prototype.fromJson=function(e){t.Events.VarDelete.superClass_.fromJson.call(this,e),this.varType=e.varType,this.varName=e.varName},t.Events.VarDelete.prototype.run=function(t){var e=this.getEventWorkspace_();t?e.deleteVariableById(this.varId):e.createVariable(this.varName,this.varType,this.varId)},t.Events.VarRename=function(e,n){t.Events.VarRename.superClass_.constructor.call(this,e),e&&(this.oldName=e.name,this.newName=void 0===n?"":n)},t.utils.object.inherits(t.Events.VarRename,t.Events.VarBase),t.Events.VarRename.prototype.type=t.Events.VAR_RENAME,t.Events.VarRename.prototype.toJson=function(){var e=t.Events.VarRename.superClass_.toJson.call(this);return e.oldName=this.oldName,e.newName=this.newName,e},t.Events.VarRename.prototype.fromJson=function(e){t.Events.VarRename.superClass_.fromJson.call(this,e),this.oldName=e.oldName,this.newName=e.newName},t.Events.VarRename.prototype.run=function(t){var e=this.getEventWorkspace_();t?e.renameVariableById(this.varId,this.newName):e.renameVariableById(this.varId,this.oldName)},t.registry.register(t.registry.Type.EVENT,t.Events.VAR_CREATE,t.Events.VarCreate),t.registry.register(t.registry.Type.EVENT,t.Events.VAR_DELETE,t.Events.VarDelete),t.registry.register(t.registry.Type.EVENT,t.Events.VAR_RENAME,t.Events.VarRename),t.BlockDragSurfaceSvg=function(t){this.container_=t,this.createDom()},t.BlockDragSurfaceSvg.prototype.SVG_=null,t.BlockDragSurfaceSvg.prototype.dragGroup_=null,t.BlockDragSurfaceSvg.prototype.container_=null,t.BlockDragSurfaceSvg.prototype.scale_=1,t.BlockDragSurfaceSvg.prototype.surfaceXY_=null,t.BlockDragSurfaceSvg.prototype.childSurfaceXY_=new t.utils.Coordinate(0,0),t.BlockDragSurfaceSvg.prototype.createDom=function(){this.SVG_||(this.SVG_=t.utils.dom.createSvgElement(t.utils.Svg.SVG,{xmlns:t.utils.dom.SVG_NS,"xmlns:html":t.utils.dom.HTML_NS,"xmlns:xlink":t.utils.dom.XLINK_NS,version:"1.1",class:"blocklyBlockDragSurface"},this.container_),this.dragGroup_=t.utils.dom.createSvgElement(t.utils.Svg.G,{},this.SVG_))},t.BlockDragSurfaceSvg.prototype.setBlocksAndShow=function(e){if(this.dragGroup_.childNodes.length)throw Error("Already dragging a block.");this.dragGroup_.appendChild(e),this.SVG_.style.display="block",this.surfaceXY_=new t.utils.Coordinate(0,0)},t.BlockDragSurfaceSvg.prototype.translateAndScaleGroup=function(t,e,n){this.scale_=n,t=t.toFixed(0),e=e.toFixed(0),this.childSurfaceXY_.x=parseInt(t,10),this.childSurfaceXY_.y=parseInt(e,10),this.dragGroup_.setAttribute("transform","translate("+t+","+e+") scale("+n+")")},t.BlockDragSurfaceSvg.prototype.translateSurfaceInternal_=function(){var e=this.surfaceXY_.x,n=this.surfaceXY_.y;e=e.toFixed(0),n=n.toFixed(0),this.SVG_.style.display="block",t.utils.dom.setCssTransform(this.SVG_,"translate3d("+e+"px, "+n+"px, 0px)")},t.BlockDragSurfaceSvg.prototype.translateBy=function(e,n){this.surfaceXY_=new t.utils.Coordinate(this.surfaceXY_.x+e,this.surfaceXY_.y+n),this.translateSurfaceInternal_()},t.BlockDragSurfaceSvg.prototype.translateSurface=function(e,n){this.surfaceXY_=new t.utils.Coordinate(e*this.scale_,n*this.scale_),this.translateSurfaceInternal_()},t.BlockDragSurfaceSvg.prototype.getSurfaceTranslation=function(){var e=t.utils.getRelativeXY(this.SVG_);return new t.utils.Coordinate(e.x/this.scale_,e.y/this.scale_)},t.BlockDragSurfaceSvg.prototype.getGroup=function(){return this.dragGroup_},t.BlockDragSurfaceSvg.prototype.getSvgRoot=function(){return this.SVG_},t.BlockDragSurfaceSvg.prototype.getCurrentBlock=function(){return this.dragGroup_.firstChild},t.BlockDragSurfaceSvg.prototype.getWsTranslation=function(){return this.childSurfaceXY_.clone()},t.BlockDragSurfaceSvg.prototype.clearAndHide=function(t){if(t?t.appendChild(this.getCurrentBlock()):this.dragGroup_.removeChild(this.getCurrentBlock()),this.SVG_.style.display="none",this.dragGroup_.childNodes.length)throw Error("Drag group was not cleared.");this.surfaceXY_=null},t.Css={},t.Css.injected_=!1,t.Css.register=function(e){if(t.Css.injected_)throw Error("CSS already injected");Array.prototype.push.apply(t.Css.CONTENT,e),e.length=0},t.Css.inject=function(e,n){if(!t.Css.injected_){t.Css.injected_=!0;var r=t.Css.CONTENT.join("\n");t.Css.CONTENT.length=0,e&&(e=n.replace(/[\\/]$/,""),r=r.replace(/<<<PATH>>>/g,e),(e=document.createElement("style")).id="blockly-common-style",r=document.createTextNode(r),e.appendChild(r),document.head.insertBefore(e,document.head.firstChild))}},t.Css.CONTENT=[".blocklySvg {","background-color: #fff;","outline: none;","overflow: hidden;","position: absolute;","display: block;","}",".blocklyWidgetDiv {","display: none;","position: absolute;","z-index: 99999;","}",".injectionDiv {","height: 100%;","position: relative;","overflow: hidden;","touch-action: none;","}",".blocklyNonSelectable {","user-select: none;","-ms-user-select: none;","-webkit-user-select: none;","}",".blocklyWsDragSurface {","display: none;","position: absolute;","top: 0;","left: 0;","}",".blocklyWsDragSurface.blocklyOverflowVisible {","overflow: visible;","}",".blocklyBlockDragSurface {","display: none;","position: absolute;","top: 0;","left: 0;","right: 0;","bottom: 0;","overflow: visible !important;","z-index: 50;","}",".blocklyBlockCanvas.blocklyCanvasTransitioning,",".blocklyBubbleCanvas.blocklyCanvasTransitioning {","transition: transform .5s;","}",".blocklyTooltipDiv {","background-color: #ffffc7;","border: 1px solid #ddc;","box-shadow: 4px 4px 20px 1px rgba(0,0,0,.15);","color: #000;","display: none;","font: 9pt sans-serif;","opacity: .9;","padding: 2px;","position: absolute;","z-index: 100000;","}",".blocklyDropDownDiv {","position: absolute;","left: 0;","top: 0;","z-index: 1000;","display: none;","border: 1px solid;","border-color: #dadce0;","background-color: #fff;","border-radius: 2px;","padding: 4px;","box-shadow: 0 0 3px 1px rgba(0,0,0,.3);","}",".blocklyDropDownDiv.blocklyFocused {","box-shadow: 0 0 6px 1px rgba(0,0,0,.3);","}",".blocklyDropDownContent {","max-height: 300px;","overflow: auto;","overflow-x: hidden;","position: relative;","}",".blocklyDropDownArrow {","position: absolute;","left: 0;","top: 0;","width: 16px;","height: 16px;","z-index: -1;","background-color: inherit;","border-color: inherit;","}",".blocklyDropDownButton {","display: inline-block;","float: left;","padding: 0;","margin: 4px;","border-radius: 4px;","outline: none;","border: 1px solid;","transition: box-shadow .1s;","cursor: pointer;","}",".blocklyArrowTop {","border-top: 1px solid;","border-left: 1px solid;","border-top-left-radius: 4px;","border-color: inherit;","}",".blocklyArrowBottom {","border-bottom: 1px solid;","border-right: 1px solid;","border-bottom-right-radius: 4px;","border-color: inherit;","}",".blocklyResizeSE {","cursor: se-resize;","fill: #aaa;","}",".blocklyResizeSW {","cursor: sw-resize;","fill: #aaa;","}",".blocklyResizeLine {","stroke: #515A5A;","stroke-width: 1;","}",".blocklyHighlightedConnectionPath {","fill: none;","stroke: #fc3;","stroke-width: 4px;","}",".blocklyPathLight {","fill: none;","stroke-linecap: round;","stroke-width: 1;","}",".blocklySelected>.blocklyPathLight {","display: none;","}",".blocklyDraggable {",'cursor: url("<<<PATH>>>/handopen.cur"), auto;',"cursor: grab;","cursor: -webkit-grab;","}",".blocklyDragging {",'cursor: url("<<<PATH>>>/handclosed.cur"), auto;',"cursor: grabbing;","cursor: -webkit-grabbing;","}",".blocklyDraggable:active {",'cursor: url("<<<PATH>>>/handclosed.cur"), auto;',"cursor: grabbing;","cursor: -webkit-grabbing;","}",".blocklyBlockDragSurface .blocklyDraggable {",'cursor: url("<<<PATH>>>/handclosed.cur"), auto;',"cursor: grabbing;","cursor: -webkit-grabbing;","}",".blocklyDragging.blocklyDraggingDelete {",'cursor: url("<<<PATH>>>/handdelete.cur"), auto;',"}",".blocklyDragging>.blocklyPath,",".blocklyDragging>.blocklyPathLight {","fill-opacity: .8;","stroke-opacity: .8;","}",".blocklyDragging>.blocklyPathDark {","display: none;","}",".blocklyDisabled>.blocklyPath {","fill-opacity: .5;","stroke-opacity: .5;","}",".blocklyDisabled>.blocklyPathLight,",".blocklyDisabled>.blocklyPathDark {","display: none;","}",".blocklyInsertionMarker>.blocklyPath,",".blocklyInsertionMarker>.blocklyPathLight,",".blocklyInsertionMarker>.blocklyPathDark {","fill-opacity: .2;","stroke: none;","}",".blocklyMultilineText {","font-family: monospace;","}",".blocklyNonEditableText>text {","pointer-events: none;","}",".blocklyFlyout {","position: absolute;","z-index: 20;","}",".blocklyText text {","cursor: default;","}",".blocklySvg text,",".blocklyBlockDragSurface text {","user-select: none;","-ms-user-select: none;","-webkit-user-select: none;","cursor: inherit;","}",".blocklyHidden {","display: none;","}",".blocklyFieldDropdown:not(.blocklyHidden) {","display: block;","}",".blocklyIconGroup {","cursor: default;","}",".blocklyIconGroup:not(:hover),",".blocklyIconGroupReadonly {","opacity: .6;","}",".blocklyIconShape {","fill: #00f;","stroke: #fff;","stroke-width: 1px;","}",".blocklyIconSymbol {","fill: #fff;","}",".blocklyMinimalBody {","margin: 0;","padding: 0;","}",".blocklyHtmlInput {","border: none;","border-radius: 4px;","height: 100%;","margin: 0;","outline: none;","padding: 0;","width: 100%;","text-align: center;","display: block;","box-sizing: border-box;","}",".blocklyHtmlInput::-ms-clear {","display: none;","}",".blocklyMainBackground {","stroke-width: 1;","stroke: #c6c6c6;","}",".blocklyMutatorBackground {","fill: #fff;","stroke: #ddd;","stroke-width: 1;","}",".blocklyFlyoutBackground {","fill: #ddd;","fill-opacity: .8;","}",".blocklyMainWorkspaceScrollbar {","z-index: 20;","}",".blocklyFlyoutScrollbar {","z-index: 30;","}",".blocklyScrollbarHorizontal,",".blocklyScrollbarVertical {","position: absolute;","outline: none;","}",".blocklyScrollbarBackground {","opacity: 0;","}",".blocklyScrollbarHandle {","fill: #ccc;","}",".blocklyScrollbarBackground:hover+.blocklyScrollbarHandle,",".blocklyScrollbarHandle:hover {","fill: #bbb;","}",".blocklyFlyout .blocklyScrollbarHandle {","fill: #bbb;","}",".blocklyFlyout .blocklyScrollbarBackground:hover+.blocklyScrollbarHandle,",".blocklyFlyout .blocklyScrollbarHandle:hover {","fill: #aaa;","}",".blocklyInvalidInput {","background: #faa;","}",".blocklyVerticalMarker {","stroke-width: 3px;","fill: rgba(255,255,255,.5);","pointer-events: none;","}",".blocklyComputeCanvas {","position: absolute;","width: 0;","height: 0;","}",".blocklyNoPointerEvents {","pointer-events: none;","}",".blocklyContextMenu {","border-radius: 4px;","max-height: 100%;","}",".blocklyDropdownMenu {","border-radius: 2px;","padding: 0 !important;","}",".blocklyDropdownMenu .blocklyMenuItem {","padding-left: 28px;","}",".blocklyDropdownMenu .blocklyMenuItemRtl {","padding-left: 5px;","padding-right: 28px;","}",".blocklyWidgetDiv .blocklyMenu {","background: #fff;","border: 1px solid transparent;","box-shadow: 0 0 3px 1px rgba(0,0,0,.3);","font: normal 13px Arial, sans-serif;","margin: 0;","outline: none;","padding: 4px 0;","position: absolute;","overflow-y: auto;","overflow-x: hidden;","max-height: 100%;","z-index: 20000;","}",".blocklyWidgetDiv .blocklyMenu.blocklyFocused {","box-shadow: 0 0 6px 1px rgba(0,0,0,.3);","}",".blocklyDropDownDiv .blocklyMenu {","background: inherit;","border: inherit;",'font: normal 13px "Helvetica Neue", Helvetica, sans-serif;',"outline: none;","position: relative;","z-index: 20000;","}",".blocklyMenuItem {","border: none;","color: #000;","cursor: pointer;","list-style: none;","margin: 0;","min-width: 7em;","padding: 6px 15px;","white-space: nowrap;","}",".blocklyMenuItemDisabled {","color: #ccc;","cursor: inherit;","}",".blocklyMenuItemHighlight {","background-color: rgba(0,0,0,.1);","}",".blocklyMenuItemCheckbox {","height: 16px;","position: absolute;","width: 16px;","}",".blocklyMenuItemSelected .blocklyMenuItemCheckbox {","background: url(<<<PATH>>>/sprites.png) no-repeat -48px -16px;","float: left;","margin-left: -24px;","position: static;","}",".blocklyMenuItemRtl .blocklyMenuItemCheckbox {","float: right;","margin-right: -24px;","}"],t.Grid=function(t,e){this.gridPattern_=t,this.spacing_=e.spacing,this.length_=e.length,this.line2_=(this.line1_=t.firstChild)&&this.line1_.nextSibling,this.snapToGrid_=e.snap},t.Grid.prototype.scale_=1,t.Grid.prototype.dispose=function(){this.gridPattern_=null},t.Grid.prototype.shouldSnap=function(){return this.snapToGrid_},t.Grid.prototype.getSpacing=function(){return this.spacing_},t.Grid.prototype.getPatternId=function(){return this.gridPattern_.id},t.Grid.prototype.update=function(t){this.scale_=t;var e=this.spacing_*t||100;this.gridPattern_.setAttribute("width",e),this.gridPattern_.setAttribute("height",e);var n=(e=Math.floor(this.spacing_/2)+.5)-this.length_/2,r=e+this.length_/2;e*=t,n*=t,r*=t,this.setLineAttributes_(this.line1_,t,n,r,e,e),this.setLineAttributes_(this.line2_,t,e,e,n,r)},t.Grid.prototype.setLineAttributes_=function(t,e,n,r,i,o){t&&(t.setAttribute("stroke-width",e),t.setAttribute("x1",n),t.setAttribute("y1",i),t.setAttribute("x2",r),t.setAttribute("y2",o))},t.Grid.prototype.moveTo=function(e,n){this.gridPattern_.setAttribute("x",e),this.gridPattern_.setAttribute("y",n),(t.utils.userAgent.IE||t.utils.userAgent.EDGE)&&this.update(this.scale_)},t.Grid.createDom=function(e,n,r){return e=t.utils.dom.createSvgElement(t.utils.Svg.PATTERN,{id:"blocklyGridPattern"+e,patternUnits:"userSpaceOnUse"},r),0<n.length&&0<n.spacing?(t.utils.dom.createSvgElement(t.utils.Svg.LINE,{stroke:n.colour},e),1<n.length&&t.utils.dom.createSvgElement(t.utils.Svg.LINE,{stroke:n.colour},e)):t.utils.dom.createSvgElement(t.utils.Svg.LINE,{},e),e},t.Theme=function(e,n,r,i){this.name=e,this.blockStyles=n||Object.create(null),this.categoryStyles=r||Object.create(null),this.componentStyles=i||Object.create(null),this.fontStyle=Object.create(null),this.startHats=null,t.registry.register(t.registry.Type.THEME,e,this)},t.Theme.prototype.getClassName=function(){return this.name+"-theme"},t.Theme.prototype.setBlockStyle=function(t,e){this.blockStyles[t]=e},t.Theme.prototype.setCategoryStyle=function(t,e){this.categoryStyles[t]=e},t.Theme.prototype.getComponentStyle=function(t){return(t=this.componentStyles[t])&&"string"==typeof t&&this.getComponentStyle(t)?this.getComponentStyle(t):t?String(t):null},t.Theme.prototype.setComponentStyle=function(t,e){this.componentStyles[t]=e},t.Theme.prototype.setFontStyle=function(t){this.fontStyle=t},t.Theme.prototype.setStartHats=function(t){this.startHats=t},t.Theme.defineTheme=function(e,n){var r=new t.Theme(e),i=n.base;return i&&("string"==typeof i&&(i=t.registry.getObject(t.registry.Type.THEME,i)),i instanceof t.Theme&&(t.utils.object.deepMerge(r,i),r.name=e)),t.utils.object.deepMerge(r.blockStyles,n.blockStyles),t.utils.object.deepMerge(r.categoryStyles,n.categoryStyles),t.utils.object.deepMerge(r.componentStyles,n.componentStyles),t.utils.object.deepMerge(r.fontStyle,n.fontStyle),null!=n.startHats&&(r.startHats=n.startHats),r},t.Themes={},t.Themes.Classic={},t.Themes.Classic.defaultBlockStyles={colour_blocks:{colourPrimary:"20"},list_blocks:{colourPrimary:"260"},logic_blocks:{colourPrimary:"210"},loop_blocks:{colourPrimary:"120"},math_blocks:{colourPrimary:"230"},procedure_blocks:{colourPrimary:"290"},text_blocks:{colourPrimary:"160"},variable_blocks:{colourPrimary:"330"},variable_dynamic_blocks:{colourPrimary:"310"},hat_blocks:{colourPrimary:"330",hat:"cap"}},t.Themes.Classic.categoryStyles={colour_category:{colour:"20"},list_category:{colour:"260"},logic_category:{colour:"210"},loop_category:{colour:"120"},math_category:{colour:"230"},procedure_category:{colour:"290"},text_category:{colour:"160"},variable_category:{colour:"330"},variable_dynamic_category:{colour:"310"}},t.Themes.Classic=new t.Theme("classic",t.Themes.Classic.defaultBlockStyles,t.Themes.Classic.categoryStyles),t.utils.IdGenerator={},t.utils.IdGenerator.nextId_=0,t.utils.IdGenerator.getNextUniqueId=function(){return"blockly-"+(t.utils.IdGenerator.nextId_++).toString(36)},t.utils.Metrics=function(){},t.utils.toolbox={},t.utils.toolbox.CATEGORY_TOOLBOX_KIND="categoryToolbox",t.utils.toolbox.FLYOUT_TOOLBOX_KIND="flyoutToolbox",t.utils.toolbox.Position={TOP:0,BOTTOM:1,LEFT:2,RIGHT:3},t.utils.toolbox.convertToolboxDefToJson=function(e){return e?((e instanceof Element||"string"==typeof e)&&(e=t.utils.toolbox.parseToolboxTree(e),e=t.utils.toolbox.convertToToolboxJson_(e)),t.utils.toolbox.validateToolbox_(e),e):null},t.utils.toolbox.validateToolbox_=function(e){var n=e.kind;if(e=e.contents,n&&n!=t.utils.toolbox.FLYOUT_TOOLBOX_KIND&&n!=t.utils.toolbox.CATEGORY_TOOLBOX_KIND)throw Error("Invalid toolbox kind "+n+". Please supply either "+t.utils.toolbox.FLYOUT_TOOLBOX_KIND+" or "+t.utils.toolbox.CATEGORY_TOOLBOX_KIND);if(!e)throw Error("Toolbox must have a contents attribute.")},t.utils.toolbox.convertFlyoutDefToJsonArray=function(e){return e?e.contents?e.contents:Array.isArray(e)&&0<e.length&&!e[0].nodeType?e:t.utils.toolbox.xmlToJsonArray_(e):[]},t.utils.toolbox.hasCategories=function(e){if(!e)return!1;var n=e.kind;return n?n==t.utils.toolbox.CATEGORY_TOOLBOX_KIND:!!e.contents.filter(function(t){return"CATEGORY"==t.kind.toUpperCase()}).length},t.utils.toolbox.isCategoryCollapsible=function(t){return!(!t||!t.contents)&&!!t.contents.filter(function(t){return"CATEGORY"==t.kind.toUpperCase()}).length},t.utils.toolbox.convertToToolboxJson_=function(e){var n={contents:t.utils.toolbox.xmlToJsonArray_(e)};return e instanceof Node&&t.utils.toolbox.addAttributes_(e,n),n},t.utils.toolbox.xmlToJsonArray_=function(e){var n,r=[],i=e.childNodes;for(i||(i=e),e=0;n=i[e];e++)if(n.tagName){var o={},s=n.tagName.toUpperCase();o.kind=s,"BLOCK"==s?o.blockxml=n:n.childNodes&&0<n.childNodes.length&&(o.contents=t.utils.toolbox.xmlToJsonArray_(n)),t.utils.toolbox.addAttributes_(n,o),r.push(o)}return r},t.utils.toolbox.addAttributes_=function(t,e){for(var n=0;n<t.attributes.length;n++){var r=t.attributes[n];-1<r.nodeName.indexOf("css-")?(e.cssconfig=e.cssconfig||{},e.cssconfig[r.nodeName.replace("css-","")]=r.value):e[r.nodeName]=r.value}},t.utils.toolbox.parseToolboxTree=function(e){if(e){if("string"!=typeof e&&(t.utils.userAgent.IE&&e.outerHTML?e=e.outerHTML:e instanceof Element||(e=null)),"string"==typeof e&&"xml"!=(e=t.Xml.textToDom(e)).nodeName.toLowerCase())throw TypeError("Toolbox should be an <xml> document.")}else e=null;return e},t.Options=function(e){var n=!!e.readOnly;if(n)var r=null,i=!1,o=!1,s=!1,a=!1,l=!1,u=!1;else{r=t.utils.toolbox.convertToolboxDefToJson(e.toolbox),i=t.utils.toolbox.hasCategories(r),void 0===(o=e.trashcan)&&(o=i);var c=e.maxTrashcanContents;o?void 0===c&&(c=32):c=0,void 0===(s=e.collapse)&&(s=i),void 0===(a=e.comments)&&(a=i),void 0===(l=e.disable)&&(l=i),void 0===(u=e.sounds)&&(u=!0)}var h=!!e.rtl,d=e.horizontalLayout;void 0===d&&(d=!1);var p=e.toolboxPosition;p="end"!==p,p=d?p?t.utils.toolbox.Position.TOP:t.utils.toolbox.Position.BOTTOM:p==h?t.utils.toolbox.Position.RIGHT:t.utils.toolbox.Position.LEFT;var f=e.css;void 0===f&&(f=!0);var g="https://blockly-demo.appspot.com/static/media/";e.media?g=e.media:e.path&&(g=e.path+"media/");var m=void 0===e.oneBasedIndex||!!e.oneBasedIndex,v=e.renderer||"geras",b=e.plugins||{};this.RTL=h,this.oneBasedIndex=m,this.collapse=s,this.comments=a,this.disable=l,this.readOnly=n,this.maxBlocks=e.maxBlocks||1/0,this.maxInstances=e.maxInstances,this.pathToMedia=g,this.hasCategories=i,this.moveOptions=t.Options.parseMoveOptions_(e,i),this.hasScrollbars=!!this.moveOptions.scrollbars,this.hasTrashcan=o,this.maxTrashcanContents=c,this.hasSounds=u,this.hasCss=f,this.horizontalLayout=d,this.languageTree=r,this.gridOptions=t.Options.parseGridOptions_(e),this.zoomOptions=t.Options.parseZoomOptions_(e),this.toolboxPosition=p,this.theme=t.Options.parseThemeOptions_(e),this.renderer=v,this.rendererOverrides=e.rendererOverrides,this.gridPattern=null,this.parentWorkspace=e.parentWorkspace,this.plugins=b},t.BlocklyOptions=function(){},t.Options.parseMoveOptions_=function(t,e){var n=t.move||{},r={};return void 0===n.scrollbars&&void 0===t.scrollbars?r.scrollbars=e:"object"==typeof n.scrollbars?(r.scrollbars={},r.scrollbars.horizontal=!!n.scrollbars.horizontal,r.scrollbars.vertical=!!n.scrollbars.vertical,r.scrollbars.horizontal&&r.scrollbars.vertical?r.scrollbars=!0:r.scrollbars.horizontal||r.scrollbars.vertical||(r.scrollbars=!1)):r.scrollbars=!!n.scrollbars||!!t.scrollbars,r.wheel=r.scrollbars&&void 0!==n.wheel?!!n.wheel:"object"==typeof r.scrollbars,r.drag=!!r.scrollbars&&(void 0===n.drag||!!n.drag),r},t.Options.parseZoomOptions_=function(t){t=t.zoom||{};var e={};return e.controls=void 0!==t.controls&&!!t.controls,e.wheel=void 0!==t.wheel&&!!t.wheel,e.startScale=void 0===t.startScale?1:Number(t.startScale),e.maxScale=void 0===t.maxScale?3:Number(t.maxScale),e.minScale=void 0===t.minScale?.3:Number(t.minScale),e.scaleSpeed=void 0===t.scaleSpeed?1.2:Number(t.scaleSpeed),e.pinch=void 0===t.pinch?e.wheel||e.controls:!!t.pinch,e},t.Options.parseGridOptions_=function(t){t=t.grid||{};var e={};return e.spacing=Number(t.spacing)||0,e.colour=t.colour||"#888",e.length=void 0===t.length?1:Number(t.length),e.snap=0<e.spacing&&!!t.snap,e},t.Options.parseThemeOptions_=function(e){return"string"==typeof(e=e.theme||t.Themes.Classic)?t.registry.getObject(t.registry.Type.THEME,e):e instanceof t.Theme?e:t.Theme.defineTheme(e.name||"builtin"+t.utils.IdGenerator.getNextUniqueId(),e)},t.Options.parseToolboxTree=function(e){return t.utils.deprecation.warn("Blockly.Options.parseToolboxTree","September 2020","September 2021","Blockly.utils.toolbox.parseToolboxTree"),t.utils.toolbox.parseToolboxTree(e)},t.ScrollbarPair=function(e,n,r,i,o){this.workspace_=e,n=void 0===n||n,r=void 0===r||r;var s=n&&r;n&&(this.hScroll=new t.Scrollbar(e,!0,s,i,o)),r&&(this.vScroll=new t.Scrollbar(e,!1,s,i,o)),s&&(this.corner_=t.utils.dom.createSvgElement(t.utils.Svg.RECT,{height:t.Scrollbar.scrollbarThickness,width:t.Scrollbar.scrollbarThickness,class:"blocklyScrollbarBackground"},null),t.utils.dom.insertAfter(this.corner_,e.getBubbleCanvas())),this.oldHostMetrics_=null},t.ScrollbarPair.prototype.dispose=function(){t.utils.dom.removeNode(this.corner_),this.oldHostMetrics_=this.workspace_=this.corner_=null,this.hScroll&&(this.hScroll.dispose(),this.hScroll=null),this.vScroll&&(this.vScroll.dispose(),this.vScroll=null)},t.ScrollbarPair.prototype.resize=function(){var e=this.workspace_.getMetrics();if(e){var n=!1,r=!1;if(this.oldHostMetrics_&&this.oldHostMetrics_.viewWidth==e.viewWidth&&this.oldHostMetrics_.viewHeight==e.viewHeight&&this.oldHostMetrics_.absoluteTop==e.absoluteTop&&this.oldHostMetrics_.absoluteLeft==e.absoluteLeft?(this.oldHostMetrics_&&this.oldHostMetrics_.scrollWidth==e.scrollWidth&&this.oldHostMetrics_.viewLeft==e.viewLeft&&this.oldHostMetrics_.scrollLeft==e.scrollLeft||(n=!0),this.oldHostMetrics_&&this.oldHostMetrics_.scrollHeight==e.scrollHeight&&this.oldHostMetrics_.viewTop==e.viewTop&&this.oldHostMetrics_.scrollTop==e.scrollTop||(r=!0)):r=n=!0,n||r){try{t.Events.disable(),this.hScroll&&n&&this.hScroll.resize(e),this.vScroll&&r&&this.vScroll.resize(e)}finally{t.Events.enable()}this.workspace_.maybeFireViewportChangeEvent()}this.hScroll&&this.vScroll&&(this.oldHostMetrics_&&this.oldHostMetrics_.viewWidth==e.viewWidth&&this.oldHostMetrics_.absoluteLeft==e.absoluteLeft||this.corner_.setAttribute("x",this.vScroll.position.x),this.oldHostMetrics_&&this.oldHostMetrics_.viewHeight==e.viewHeight&&this.oldHostMetrics_.absoluteTop==e.absoluteTop||this.corner_.setAttribute("y",this.hScroll.position.y)),this.oldHostMetrics_=e}},t.ScrollbarPair.prototype.canScrollHorizontally=function(){return!!this.hScroll},t.ScrollbarPair.prototype.canScrollVertically=function(){return!!this.vScroll},t.ScrollbarPair.prototype.setOrigin=function(t,e){this.hScroll&&this.hScroll.setOrigin(t,e),this.vScroll&&this.vScroll.setOrigin(t,e)},t.ScrollbarPair.prototype.set=function(t,e,n){this.hScroll&&this.hScroll.set(t,!1),this.vScroll&&this.vScroll.set(e,!1),(n||void 0===n)&&(t={},this.hScroll&&(t.x=this.hScroll.getRatio_()),this.vScroll&&(t.y=this.vScroll.getRatio_()),this.workspace_.setMetrics(t))},t.ScrollbarPair.prototype.setX=function(t){this.hScroll&&this.hScroll.set(t,!0)},t.ScrollbarPair.prototype.setY=function(t){this.vScroll&&this.vScroll.set(t,!0)},t.ScrollbarPair.prototype.setContainerVisible=function(t){this.hScroll&&this.hScroll.setContainerVisible(t),this.vScroll&&this.vScroll.setContainerVisible(t)},t.ScrollbarPair.prototype.isVisible=function(){var t=!1;return this.hScroll&&(t=this.hScroll.isVisible()),this.vScroll&&(t=t||this.vScroll.isVisible()),t},t.ScrollbarPair.prototype.resizeContent=function(t){this.hScroll&&this.hScroll.resizeContentHorizontal(t),this.vScroll&&this.vScroll.resizeContentVertical(t)},t.ScrollbarPair.prototype.resizeView=function(t){this.hScroll&&this.hScroll.resizeViewHorizontal(t),this.vScroll&&this.vScroll.resizeViewVertical(t)},t.Scrollbar=function(e,n,r,i,o){this.workspace_=e,this.pair_=r||!1,this.horizontal_=n,this.margin_=void 0!==o?o:t.Scrollbar.DEFAULT_SCROLLBAR_MARGIN,this.ratio=this.oldHostMetrics_=null,this.createDom_(i),this.position=new t.utils.Coordinate(0,0),e=t.Scrollbar.scrollbarThickness,n?(this.svgBackground_.setAttribute("height",e),this.outerSvg_.setAttribute("height",e),this.svgHandle_.setAttribute("height",e-5),this.svgHandle_.setAttribute("y",2.5),this.lengthAttribute_="width",this.positionAttribute_="x"):(this.svgBackground_.setAttribute("width",e),this.outerSvg_.setAttribute("width",e),this.svgHandle_.setAttribute("width",e-5),this.svgHandle_.setAttribute("x",2.5),this.lengthAttribute_="height",this.positionAttribute_="y"),this.onMouseDownBarWrapper_=t.browserEvents.conditionalBind(this.svgBackground_,"mousedown",this,this.onMouseDownBar_),this.onMouseDownHandleWrapper_=t.browserEvents.conditionalBind(this.svgHandle_,"mousedown",this,this.onMouseDownHandle_)},t.Scrollbar.prototype.origin_=new t.utils.Coordinate(0,0),t.Scrollbar.prototype.startDragMouse_=0,t.Scrollbar.prototype.scrollbarLength_=0,t.Scrollbar.prototype.handleLength_=0,t.Scrollbar.prototype.handlePosition_=0,t.Scrollbar.prototype.isVisible_=!0,t.Scrollbar.prototype.containerVisible_=!0,t.Scrollbar.scrollbarThickness=15,t.Touch.TOUCH_ENABLED&&(t.Scrollbar.scrollbarThickness=25),t.Scrollbar.DEFAULT_SCROLLBAR_MARGIN=.5,t.Scrollbar.metricsAreEquivalent_=function(t,e){return t.viewWidth==e.viewWidth&&t.viewHeight==e.viewHeight&&t.viewLeft==e.viewLeft&&t.viewTop==e.viewTop&&t.absoluteTop==e.absoluteTop&&t.absoluteLeft==e.absoluteLeft&&t.scrollWidth==e.scrollWidth&&t.scrollHeight==e.scrollHeight&&t.scrollLeft==e.scrollLeft&&t.scrollTop==e.scrollTop},t.Scrollbar.prototype.dispose=function(){this.cleanUp_(),t.browserEvents.unbind(this.onMouseDownBarWrapper_),this.onMouseDownBarWrapper_=null,t.browserEvents.unbind(this.onMouseDownHandleWrapper_),this.onMouseDownHandleWrapper_=null,t.utils.dom.removeNode(this.outerSvg_),this.svgBackground_=this.svgGroup_=this.outerSvg_=null,this.svgHandle_&&(this.workspace_.getThemeManager().unsubscribe(this.svgHandle_),this.svgHandle_=null),this.workspace_=null},t.Scrollbar.prototype.constrainHandleLength_=function(t){return 0>=t||isNaN(t)?0:Math.min(t,this.scrollbarLength_)},t.Scrollbar.prototype.setHandleLength_=function(t){this.handleLength_=t,this.svgHandle_.setAttribute(this.lengthAttribute_,this.handleLength_)},t.Scrollbar.prototype.constrainHandlePosition_=function(t){return 0>=t||isNaN(t)?0:Math.min(t,this.scrollbarLength_-this.handleLength_)},t.Scrollbar.prototype.setHandlePosition=function(t){this.handlePosition_=t,this.svgHandle_.setAttribute(this.positionAttribute_,this.handlePosition_)},t.Scrollbar.prototype.setScrollbarLength_=function(t){this.scrollbarLength_=t,this.outerSvg_.setAttribute(this.lengthAttribute_,this.scrollbarLength_),this.svgBackground_.setAttribute(this.lengthAttribute_,this.scrollbarLength_)},t.Scrollbar.prototype.setPosition=function(e,n){this.position.x=e,this.position.y=n,t.utils.dom.setCssTransform(this.outerSvg_,"translate("+(this.position.x+this.origin_.x)+"px,"+(this.position.y+this.origin_.y)+"px)")},t.Scrollbar.prototype.resize=function(e){(e||(e=this.workspace_.getMetrics()))&&(this.oldHostMetrics_&&t.Scrollbar.metricsAreEquivalent_(e,this.oldHostMetrics_)||(this.horizontal_?this.resizeHorizontal_(e):this.resizeVertical_(e),this.oldHostMetrics_=e,this.updateMetrics_()))},t.Scrollbar.prototype.requiresViewResize_=function(t){return!this.oldHostMetrics_||(this.oldHostMetrics_.viewWidth!==t.viewWidth||this.oldHostMetrics_.viewHeight!==t.viewHeight||this.oldHostMetrics_.absoluteLeft!==t.absoluteLeft||this.oldHostMetrics_.absoluteTop!==t.absoluteTop)},t.Scrollbar.prototype.resizeHorizontal_=function(t){this.requiresViewResize_(t)?this.resizeViewHorizontal(t):this.resizeContentHorizontal(t)},t.Scrollbar.prototype.resizeViewHorizontal=function(e){var n=e.viewWidth-2*this.margin_;this.pair_&&(n-=t.Scrollbar.scrollbarThickness),this.setScrollbarLength_(Math.max(0,n)),n=e.absoluteLeft+this.margin_,this.pair_&&this.workspace_.RTL&&(n+=t.Scrollbar.scrollbarThickness),this.setPosition(n,e.absoluteTop+e.viewHeight-t.Scrollbar.scrollbarThickness-this.margin_),this.resizeContentHorizontal(e)},t.Scrollbar.prototype.resizeContentHorizontal=function(t){if(t.viewWidth>=t.scrollWidth)this.setHandleLength_(this.scrollbarLength_),this.setHandlePosition(0),this.pair_||this.setVisible(!1);else{this.pair_||this.setVisible(!0);var e=this.scrollbarLength_*t.viewWidth/t.scrollWidth;e=this.constrainHandleLength_(e),this.setHandleLength_(e),e=t.scrollWidth-t.viewWidth;var n=this.scrollbarLength_-this.handleLength_;t=(t.viewLeft-t.scrollLeft)/e*n,t=this.constrainHandlePosition_(t),this.setHandlePosition(t),this.ratio=n/e}},t.Scrollbar.prototype.resizeVertical_=function(t){this.requiresViewResize_(t)?this.resizeViewVertical(t):this.resizeContentVertical(t)},t.Scrollbar.prototype.resizeViewVertical=function(e){var n=e.viewHeight-2*this.margin_;this.pair_&&(n-=t.Scrollbar.scrollbarThickness),this.setScrollbarLength_(Math.max(0,n)),this.setPosition(this.workspace_.RTL?e.absoluteLeft+this.margin_:e.absoluteLeft+e.viewWidth-t.Scrollbar.scrollbarThickness-this.margin_,e.absoluteTop+this.margin_),this.resizeContentVertical(e)},t.Scrollbar.prototype.resizeContentVertical=function(t){if(t.viewHeight>=t.scrollHeight)this.setHandleLength_(this.scrollbarLength_),this.setHandlePosition(0),this.pair_||this.setVisible(!1);else{this.pair_||this.setVisible(!0);var e=this.scrollbarLength_*t.viewHeight/t.scrollHeight;e=this.constrainHandleLength_(e),this.setHandleLength_(e),e=t.scrollHeight-t.viewHeight;var n=this.scrollbarLength_-this.handleLength_;t=(t.viewTop-t.scrollTop)/e*n,t=this.constrainHandlePosition_(t),this.setHandlePosition(t),this.ratio=n/e}},t.Scrollbar.prototype.createDom_=function(e){var n="blocklyScrollbar"+(this.horizontal_?"Horizontal":"Vertical");e&&(n+=" "+e),this.outerSvg_=t.utils.dom.createSvgElement(t.utils.Svg.SVG,{class:n},null),this.svgGroup_=t.utils.dom.createSvgElement(t.utils.Svg.G,{},this.outerSvg_),this.svgBackground_=t.utils.dom.createSvgElement(t.utils.Svg.RECT,{class:"blocklyScrollbarBackground"},this.svgGroup_),e=Math.floor((t.Scrollbar.scrollbarThickness-5)/2),this.svgHandle_=t.utils.dom.createSvgElement(t.utils.Svg.RECT,{class:"blocklyScrollbarHandle",rx:e,ry:e},this.svgGroup_),this.workspace_.getThemeManager().subscribe(this.svgHandle_,"scrollbarColour","fill"),this.workspace_.getThemeManager().subscribe(this.svgHandle_,"scrollbarOpacity","fill-opacity"),t.utils.dom.insertAfter(this.outerSvg_,this.workspace_.getParentSvg())},t.Scrollbar.prototype.isVisible=function(){return this.isVisible_},t.Scrollbar.prototype.setContainerVisible=function(t){var e=t!=this.containerVisible_;this.containerVisible_=t,e&&this.updateDisplay_()},t.Scrollbar.prototype.setVisible=function(t){var e=t!=this.isVisible();if(this.pair_)throw Error("Unable to toggle visibility of paired scrollbars.");this.isVisible_=t,e&&this.updateDisplay_()},t.Scrollbar.prototype.updateDisplay_=function(){this.containerVisible_&&this.isVisible()?this.outerSvg_.setAttribute("display","block"):this.outerSvg_.setAttribute("display","none")},t.Scrollbar.prototype.onMouseDownBar_=function(e){if(this.workspace_.markFocused(),t.Touch.clearTouchIdentifier(),this.cleanUp_(),t.utils.isRightButton(e))e.stopPropagation();else{var n=t.utils.mouseToSvg(e,this.workspace_.getParentSvg(),this.workspace_.getInverseScreenCTM());n=this.horizontal_?n.x:n.y;var r=t.utils.getInjectionDivXY_(this.svgHandle_);r=this.horizontal_?r.x:r.y;var i=this.handlePosition_,o=.95*this.handleLength_;n<=r?i-=o:n>=r+this.handleLength_&&(i+=o),this.setHandlePosition(this.constrainHandlePosition_(i)),this.updateMetrics_(),e.stopPropagation(),e.preventDefault()}},t.Scrollbar.prototype.onMouseDownHandle_=function(e){this.workspace_.markFocused(),this.cleanUp_(),t.utils.isRightButton(e)?e.stopPropagation():(this.startDragHandle=this.handlePosition_,this.workspace_.setupDragSurface(),this.startDragMouse_=this.horizontal_?e.clientX:e.clientY,t.Scrollbar.onMouseUpWrapper_=t.browserEvents.conditionalBind(document,"mouseup",this,this.onMouseUpHandle_),t.Scrollbar.onMouseMoveWrapper_=t.browserEvents.conditionalBind(document,"mousemove",this,this.onMouseMoveHandle_),e.stopPropagation(),e.preventDefault())},t.Scrollbar.prototype.onMouseMoveHandle_=function(t){this.setHandlePosition(this.constrainHandlePosition_(this.startDragHandle+((this.horizontal_?t.clientX:t.clientY)-this.startDragMouse_))),this.updateMetrics_()},t.Scrollbar.prototype.onMouseUpHandle_=function(){this.workspace_.resetDragSurface(),t.Touch.clearTouchIdentifier(),this.cleanUp_()},t.Scrollbar.prototype.cleanUp_=function(){t.hideChaff(!0),t.Scrollbar.onMouseUpWrapper_&&(t.browserEvents.unbind(t.Scrollbar.onMouseUpWrapper_),t.Scrollbar.onMouseUpWrapper_=null),t.Scrollbar.onMouseMoveWrapper_&&(t.browserEvents.unbind(t.Scrollbar.onMouseMoveWrapper_),t.Scrollbar.onMouseMoveWrapper_=null)},t.Scrollbar.prototype.getRatio_=function(){var t=this.handlePosition_/(this.scrollbarLength_-this.handleLength_);return isNaN(t)&&(t=0),t},t.Scrollbar.prototype.updateMetrics_=function(){var t=this.getRatio_(),e={};this.horizontal_?e.x=t:e.y=t,this.workspace_.setMetrics(e)},t.Scrollbar.prototype.set=function(t,e){this.setHandlePosition(this.constrainHandlePosition_(t*this.ratio)),(e||void 0===e)&&this.updateMetrics_()},t.Scrollbar.prototype.setOrigin=function(e,n){this.origin_=new t.utils.Coordinate(e,n)},t.Tooltip={},t.Tooltip.visible=!1,t.Tooltip.blocked_=!1,t.Tooltip.LIMIT=50,t.Tooltip.mouseOutPid_=0,t.Tooltip.showPid_=0,t.Tooltip.lastX_=0,t.Tooltip.lastY_=0,t.Tooltip.element_=null,t.Tooltip.poisonedElement_=null,t.Tooltip.OFFSET_X=0,t.Tooltip.OFFSET_Y=10,t.Tooltip.RADIUS_OK=10,t.Tooltip.HOVER_MS=750,t.Tooltip.MARGINS=5,t.Tooltip.DIV=null,t.Tooltip.getTooltipOfObject=function(e){if(e=t.Tooltip.getTargetObject_(e)){for(e=e.tooltip;"function"==typeof e;)e=e();if("string"!=typeof e)throw Error("Tooltip function must return a string.");return e}return""},t.Tooltip.getTargetObject_=function(t){for(;t&&t.tooltip;){if("string"==typeof t.tooltip||"function"==typeof t.tooltip)return t;t=t.tooltip}return null},t.Tooltip.createDom=function(){t.Tooltip.DIV||(t.Tooltip.DIV=document.createElement("div"),t.Tooltip.DIV.className="blocklyTooltipDiv",(t.parentContainer||document.body).appendChild(t.Tooltip.DIV))},t.Tooltip.bindMouseEvents=function(e){e.mouseOverWrapper_=t.browserEvents.bind(e,"mouseover",null,t.Tooltip.onMouseOver_),e.mouseOutWrapper_=t.browserEvents.bind(e,"mouseout",null,t.Tooltip.onMouseOut_),e.addEventListener("mousemove",t.Tooltip.onMouseMove_,!1)},t.Tooltip.unbindMouseEvents=function(e){e&&(t.browserEvents.unbind(e.mouseOverWrapper_),t.browserEvents.unbind(e.mouseOutWrapper_),e.removeEventListener("mousemove",t.Tooltip.onMouseMove_))},t.Tooltip.onMouseOver_=function(e){t.Tooltip.blocked_||(e=t.Tooltip.getTargetObject_(e.currentTarget),t.Tooltip.element_!=e&&(t.Tooltip.hide(),t.Tooltip.poisonedElement_=null,t.Tooltip.element_=e),clearTimeout(t.Tooltip.mouseOutPid_))},t.Tooltip.onMouseOut_=function(e){t.Tooltip.blocked_||(t.Tooltip.mouseOutPid_=setTimeout(function(){t.Tooltip.element_=null,t.Tooltip.poisonedElement_=null,t.Tooltip.hide()},1),clearTimeout(t.Tooltip.showPid_))},t.Tooltip.onMouseMove_=function(e){if(t.Tooltip.element_&&t.Tooltip.element_.tooltip&&!t.Tooltip.blocked_)if(t.Tooltip.visible){var n=t.Tooltip.lastX_-e.pageX;e=t.Tooltip.lastY_-e.pageY,Math.sqrt(n*n+e*e)>t.Tooltip.RADIUS_OK&&t.Tooltip.hide()}else t.Tooltip.poisonedElement_!=t.Tooltip.element_&&(clearTimeout(t.Tooltip.showPid_),t.Tooltip.lastX_=e.pageX,t.Tooltip.lastY_=e.pageY,t.Tooltip.showPid_=setTimeout(t.Tooltip.show_,t.Tooltip.HOVER_MS))},t.Tooltip.dispose=function(){t.Tooltip.element_=null,t.Tooltip.poisonedElement_=null,t.Tooltip.hide()},t.Tooltip.hide=function(){t.Tooltip.visible&&(t.Tooltip.visible=!1,t.Tooltip.DIV&&(t.Tooltip.DIV.style.display="none")),t.Tooltip.showPid_&&clearTimeout(t.Tooltip.showPid_)},t.Tooltip.block=function(){t.Tooltip.hide(),t.Tooltip.blocked_=!0},t.Tooltip.unblock=function(){t.Tooltip.blocked_=!1},t.Tooltip.show_=function(){if(!t.Tooltip.blocked_&&(t.Tooltip.poisonedElement_=t.Tooltip.element_,t.Tooltip.DIV)){t.Tooltip.DIV.textContent="";var e=t.Tooltip.getTooltipOfObject(t.Tooltip.element_);e=(e=t.utils.string.wrap(e,t.Tooltip.LIMIT)).split("\n");for(var n=0;n<e.length;n++){var r=document.createElement("div");r.appendChild(document.createTextNode(e[n])),t.Tooltip.DIV.appendChild(r)}e=t.Tooltip.element_.RTL,n=document.documentElement.clientWidth,r=document.documentElement.clientHeight,t.Tooltip.DIV.style.direction=e?"rtl":"ltr",t.Tooltip.DIV.style.display="block",t.Tooltip.visible=!0;var i=t.Tooltip.lastX_;i=e?i-(t.Tooltip.OFFSET_X+t.Tooltip.DIV.offsetWidth):i+t.Tooltip.OFFSET_X;var o=t.Tooltip.lastY_+t.Tooltip.OFFSET_Y;o+t.Tooltip.DIV.offsetHeight>r+window.scrollY&&(o-=t.Tooltip.DIV.offsetHeight+2*t.Tooltip.OFFSET_Y),e?i=Math.max(t.Tooltip.MARGINS-window.scrollX,i):i+t.Tooltip.DIV.offsetWidth>n+window.scrollX-2*t.Tooltip.MARGINS&&(i=n-t.Tooltip.DIV.offsetWidth-2*t.Tooltip.MARGINS),t.Tooltip.DIV.style.top=o+"px",t.Tooltip.DIV.style.left=i+"px"}},t.utils.aria={},t.utils.aria.ARIA_PREFIX_="aria-",t.utils.aria.ROLE_ATTRIBUTE_="role",t.utils.aria.Role={GRID:"grid",GRIDCELL:"gridcell",GROUP:"group",LISTBOX:"listbox",MENU:"menu",MENUITEM:"menuitem",MENUITEMCHECKBOX:"menuitemcheckbox",OPTION:"option",PRESENTATION:"presentation",ROW:"row",TREE:"tree",TREEITEM:"treeitem"},t.utils.aria.State={ACTIVEDESCENDANT:"activedescendant",COLCOUNT:"colcount",DISABLED:"disabled",EXPANDED:"expanded",INVALID:"invalid",LABEL:"label",LABELLEDBY:"labelledby",LEVEL:"level",ORIENTATION:"orientation",POSINSET:"posinset",ROWCOUNT:"rowcount",SELECTED:"selected",SETSIZE:"setsize",VALUEMAX:"valuemax",VALUEMIN:"valuemin"},t.utils.aria.setRole=function(e,n){e.setAttribute(t.utils.aria.ROLE_ATTRIBUTE_,n)},t.utils.aria.setState=function(e,n,r){Array.isArray(r)&&(r=r.join(" ")),e.setAttribute(t.utils.aria.ARIA_PREFIX_+n,r)},t.IASTNodeLocation=function(){},t.IASTNodeLocationSvg=function(){},t.IASTNodeLocationWithBlock=function(){},t.IKeyboardAccessible=function(){},t.utils.deprecation={},t.utils.deprecation.warn=function(t,e,n,r){t=t+" was deprecated on "+e+" and will be deleted on "+n+".",r&&(t+="\nUse "+r+" instead."),console.warn(t)},t.Connection=function(t,e){this.sourceBlock_=t,this.type=e},t.Connection.CAN_CONNECT=0,t.Connection.REASON_SELF_CONNECTION=1,t.Connection.REASON_WRONG_TYPE=2,t.Connection.REASON_TARGET_NULL=3,t.Connection.REASON_CHECKS_FAILED=4,t.Connection.REASON_DIFFERENT_WORKSPACES=5,t.Connection.REASON_SHADOW_PARENT=6,t.Connection.REASON_DRAG_CHECKS_FAILED=7,t.Connection.prototype.targetConnection=null,t.Connection.prototype.disposed=!1,t.Connection.prototype.check_=null,t.Connection.prototype.shadowDom_=null,t.Connection.prototype.x=0,t.Connection.prototype.y=0,t.Connection.prototype.connect_=function(e){var n,r=t.connectionTypes.INPUT_VALUE,i=this.getSourceBlock(),o=e.getSourceBlock();if(e.isConnected()&&e.disconnect(),this.isConnected()){var s=this.getShadowDom(!0);this.shadowDom_=null;var a=this.targetBlock();if(a.isShadow())a.dispose(!1);else{this.disconnect();var l=a}this.shadowDom_=s}t.Events.isEnabled()&&(n=new(t.Events.get(t.Events.BLOCK_MOVE))(o)),t.Connection.connectReciprocally_(this,e),o.setParent(i),n&&(n.recordNew(),t.Events.fire(n)),l&&(e=this.type===r?l.outputConnection:l.previousConnection,(o=t.Connection.getConnectionForOrphanedConnection(o,e))?e.connect(o):e.onFailedConnect(this))},t.Connection.prototype.dispose=function(){if(this.isConnected()){this.setShadowDom(null);var t=this.targetBlock();t&&t.unplug()}this.disposed=!0},t.Connection.prototype.getSourceBlock=function(){return this.sourceBlock_},t.Connection.prototype.isSuperior=function(){return this.type==t.connectionTypes.INPUT_VALUE||this.type==t.connectionTypes.NEXT_STATEMENT},t.Connection.prototype.isConnected=function(){return!!this.targetConnection},t.Connection.prototype.canConnectWithReason=function(e){return t.utils.deprecation.warn("Connection.prototype.canConnectWithReason","July 2020","July 2021","the workspace's connection checker"),this.getConnectionChecker().canConnectWithReason(this,e,!1)},t.Connection.prototype.checkConnection=function(e){t.utils.deprecation.warn("Connection.prototype.checkConnection","July 2020","July 2021","the workspace's connection checker");var n=this.getConnectionChecker(),r=n.canConnectWithReason(this,e,!1);if(r!=t.Connection.CAN_CONNECT)throw Error(n.getErrorMessage(r,this,e))},t.Connection.prototype.getConnectionChecker=function(){return this.sourceBlock_.workspace.connectionChecker},t.Connection.prototype.isConnectionAllowed=function(e){return t.utils.deprecation.warn("Connection.prototype.isConnectionAllowed","July 2020","July 2021","the workspace's connection checker"),this.getConnectionChecker().canConnect(this,e,!0)},t.Connection.prototype.onFailedConnect=function(t){},t.Connection.prototype.connect=function(e){if(this.targetConnection!=e&&this.getConnectionChecker().canConnect(this,e,!1)){var n=t.Events.getGroup();n||t.Events.setGroup(!0),this.isSuperior()?this.connect_(e):e.connect_(this),n||t.Events.setGroup(!1)}},t.Connection.connectReciprocally_=function(t,e){if(!t||!e)throw Error("Cannot connect null connections.");t.targetConnection=e,e.targetConnection=t},t.Connection.getSingleConnection_=function(t,e){for(var n,r=null,i=(e=e.outputConnection).getConnectionChecker(),o=0;n=t.inputList[o];o++)if((n=n.connection)&&i.canConnect(e,n,!1)){if(r)return null;r=n}return r},t.Connection.getConnectionForOrphanedOutput_=function(e,n){for(var r;r=t.Connection.getSingleConnection_(e,n);)if(!(e=r.targetBlock())||e.isShadow())return r;return null},t.Connection.getConnectionForOrphanedConnection=function(e,n){if(n.type===t.connectionTypes.OUTPUT_VALUE)return t.Connection.getConnectionForOrphanedOutput_(e,n.getSourceBlock());e=e.lastConnectionInStack(!0);var r=n.getConnectionChecker();return e&&r.canConnect(n,e,!1)?e:null},t.Connection.prototype.disconnect=function(){var e=this.targetConnection;if(!e)throw Error("Source connection not connected.");if(e.targetConnection!=this)throw Error("Target connection not connected to source connection.");if(this.isSuperior()){var n=this.sourceBlock_,r=e.getSourceBlock();e=this}else n=e.getSourceBlock(),r=this.sourceBlock_;var i=t.Events.getGroup();i||t.Events.setGroup(!0),this.disconnectInternal_(n,r),r.isShadow()||e.respawnShadow_(),i||t.Events.setGroup(!1)},t.Connection.prototype.disconnectInternal_=function(e,n){var r;t.Events.isEnabled()&&(r=new(t.Events.get(t.Events.BLOCK_MOVE))(n)),this.targetConnection=this.targetConnection.targetConnection=null,n.setParent(null),r&&(r.recordNew(),t.Events.fire(r))},t.Connection.prototype.respawnShadow_=function(){var e=this.getSourceBlock(),n=this.getShadowDom();if(e.workspace&&n)if((e=t.Xml.domToBlock(n,e.workspace)).outputConnection)this.connect(e.outputConnection);else{if(!e.previousConnection)throw Error("Child block does not have output or previous statement.");this.connect(e.previousConnection)}},t.Connection.prototype.targetBlock=function(){return this.isConnected()?this.targetConnection.getSourceBlock():null},t.Connection.prototype.checkType=function(e){return t.utils.deprecation.warn("Connection.prototype.checkType","October 2019","January 2021","the workspace's connection checker"),this.getConnectionChecker().canConnect(this,e,!1)},t.Connection.prototype.checkType_=function(e){return t.utils.deprecation.warn("Connection.prototype.checkType_","October 2019","January 2021","the workspace's connection checker"),this.checkType(e)},t.Connection.prototype.onCheckChanged_=function(){!this.isConnected()||this.targetConnection&&this.getConnectionChecker().canConnect(this,this.targetConnection,!1)||(this.isSuperior()?this.targetBlock():this.sourceBlock_).unplug()},t.Connection.prototype.setCheck=function(t){return t?(Array.isArray(t)||(t=[t]),this.check_=t,this.onCheckChanged_()):this.check_=null,this},t.Connection.prototype.getCheck=function(){return this.check_},t.Connection.prototype.setShadowDom=function(t){this.shadowDom_=t,(t=this.targetBlock())?t.isShadow()&&(t.dispose(!1),this.respawnShadow_()):this.respawnShadow_()},t.Connection.prototype.getShadowDom=function(e){return e&&this.targetBlock().isShadow()?t.Xml.blockToDom(this.targetBlock()):this.shadowDom_},t.Connection.prototype.neighbours=function(t){return[]},t.Connection.prototype.getParentInput=function(){for(var t=null,e=this.sourceBlock_.inputList,n=0;n<e.length;n++)if(e[n].connection===this){t=e[n];break}return t},t.Connection.prototype.toString=function(){var t=this.sourceBlock_;if(!t)return"Orphan Connection";if(t.outputConnection==this)var e="Output Connection of ";else if(t.previousConnection==this)e="Previous Connection of ";else if(t.nextConnection==this)e="Next Connection of ";else{e=null;for(var n,r=0;n=t.inputList[r];r++)if(n.connection==this){e=n;break}if(!e)return console.warn("Connection not actually connected to sourceBlock_"),"Orphan Connection";e='Input "'+e.name+'" connection on '}return e+t.toDevString()},t.IConnectionChecker=function(){},t.ConnectionChecker=function(){},t.ConnectionChecker.prototype.canConnect=function(e,n,r,i){return this.canConnectWithReason(e,n,r,i)==t.Connection.CAN_CONNECT},t.ConnectionChecker.prototype.canConnectWithReason=function(e,n,r,i){var o=this.doSafetyChecks(e,n);return o!=t.Connection.CAN_CONNECT?o:this.doTypeChecks(e,n)?r&&!this.doDragChecks(e,n,i||0)?t.Connection.REASON_DRAG_CHECKS_FAILED:t.Connection.CAN_CONNECT:t.Connection.REASON_CHECKS_FAILED},t.ConnectionChecker.prototype.getErrorMessage=function(e,n,r){switch(e){case t.Connection.REASON_SELF_CONNECTION:return"Attempted to connect a block to itself.";case t.Connection.REASON_DIFFERENT_WORKSPACES:return"Blocks not on same workspace.";case t.Connection.REASON_WRONG_TYPE:return"Attempt to connect incompatible types.";case t.Connection.REASON_TARGET_NULL:return"Target connection is null.";case t.Connection.REASON_CHECKS_FAILED:return"Connection checks failed. "+n+" expected "+n.getCheck()+", found "+r.getCheck();case t.Connection.REASON_SHADOW_PARENT:return"Connecting non-shadow to shadow block.";case t.Connection.REASON_DRAG_CHECKS_FAILED:return"Drag checks failed.";default:return"Unknown connection failure: this should never happen!"}},t.ConnectionChecker.prototype.doSafetyChecks=function(e,n){if(!e||!n)return t.Connection.REASON_TARGET_NULL;if(e.isSuperior())var r=e.getSourceBlock(),i=n.getSourceBlock();else i=e.getSourceBlock(),r=n.getSourceBlock();return r==i?t.Connection.REASON_SELF_CONNECTION:n.type!=t.OPPOSITE_TYPE[e.type]?t.Connection.REASON_WRONG_TYPE:r.workspace!==i.workspace?t.Connection.REASON_DIFFERENT_WORKSPACES:r.isShadow()&&!i.isShadow()?t.Connection.REASON_SHADOW_PARENT:t.Connection.CAN_CONNECT},t.ConnectionChecker.prototype.doTypeChecks=function(t,e){if(t=t.getCheck(),e=e.getCheck(),!t||!e)return!0;for(var n=0;n<t.length;n++)if(-1!=e.indexOf(t[n]))return!0;return!1},t.ConnectionChecker.prototype.doDragChecks=function(e,n,r){if(e.distanceFrom(n)>r||n.getSourceBlock().isInsertionMarker())return!1;switch(n.type){case t.connectionTypes.PREVIOUS_STATEMENT:return this.canConnectToPrevious_(e,n);case t.connectionTypes.OUTPUT_VALUE:if(n.isConnected()&&!n.targetBlock().isInsertionMarker()||e.isConnected())return!1;break;case t.connectionTypes.INPUT_VALUE:if(n.isConnected()&&!n.targetBlock().isMovable()&&!n.targetBlock().isShadow())return!1;break;case t.connectionTypes.NEXT_STATEMENT:if(n.isConnected()&&!e.getSourceBlock().nextConnection&&!n.targetBlock().isShadow()&&n.targetBlock().nextConnection)return!1;break;default:return!1}return-1==t.draggingConnections.indexOf(n)},t.ConnectionChecker.prototype.canConnectToPrevious_=function(e,n){return!e.targetConnection&&-1==t.draggingConnections.indexOf(n)&&(!n.targetConnection||!!(e=n.targetBlock()).isInsertionMarker()&&!e.getPreviousBlock())},t.registry.register(t.registry.Type.CONNECTION_CHECKER,t.registry.DEFAULT,t.ConnectionChecker),t.VariableMap=function(t){this.variableMap_=Object.create(null),this.workspace=t},t.VariableMap.prototype.clear=function(){this.variableMap_=Object.create(null)},t.VariableMap.prototype.renameVariable=function(e,n){var r=this.getVariable(n,e.type),i=this.workspace.getAllBlocks(!1);t.Events.setGroup(!0);try{r&&r.getId()!=e.getId()?this.renameVariableWithConflict_(e,n,r,i):this.renameVariableAndUses_(e,n,i)}finally{t.Events.setGroup(!1)}},t.VariableMap.prototype.renameVariableById=function(t,e){var n=this.getVariableById(t);if(!n)throw Error("Tried to rename a variable that didn't exist. ID: "+t);this.renameVariable(n,e)},t.VariableMap.prototype.renameVariableAndUses_=function(e,n,r){for(t.Events.fire(new(t.Events.get(t.Events.VAR_RENAME))(e,n)),e.name=n,n=0;n<r.length;n++)r[n].updateVarName(e)},t.VariableMap.prototype.renameVariableWithConflict_=function(e,n,r,i){var o=e.type;for(n!=r.name&&this.renameVariableAndUses_(r,n,i),n=0;n<i.length;n++)i[n].renameVarById(e.getId(),r.getId());t.Events.fire(new(t.Events.get(t.Events.VAR_DELETE))(e)),e=this.getVariablesOfType(o).indexOf(e),this.variableMap_[o].splice(e,1)},t.VariableMap.prototype.createVariable=function(e,n,r){var i=this.getVariable(e,n);if(i){if(r&&i.getId()!=r)throw Error('Variable "'+e+'" is already in use and its id is "'+i.getId()+'" which conflicts with the passed in id, "'+r+'".');return i}if(r&&this.getVariableById(r))throw Error('Variable id, "'+r+'", is already in use.');return i=r||t.utils.genUid(),n=n||"",i=new t.VariableModel(this.workspace,e,n,i),(e=this.variableMap_[n]||[]).push(i),delete this.variableMap_[n],this.variableMap_[n]=e,i},t.VariableMap.prototype.deleteVariable=function(e){for(var n,r=this.variableMap_[e.type],i=0;n=r[i];i++)if(n.getId()==e.getId()){r.splice(i,1),t.Events.fire(new(t.Events.get(t.Events.VAR_DELETE))(e));break}},t.VariableMap.prototype.deleteVariableById=function(e){var n=this.getVariableById(e);if(n){var r,i=n.name,o=this.getVariableUsesById(e);for(e=0;r=o[e];e++)if("procedures_defnoreturn"==r.type||"procedures_defreturn"==r.type)return e=r.getFieldValue("NAME"),i=t.Msg.CANNOT_DELETE_VARIABLE_PROCEDURE.replace("%1",i).replace("%2",e),void t.alert(i);var s=this;1<o.length?(i=t.Msg.DELETE_VARIABLE_CONFIRMATION.replace("%1",String(o.length)).replace("%2",i),t.confirm(i,function(t){t&&n&&s.deleteVariableInternal(n,o)})):s.deleteVariableInternal(n,o)}else console.warn("Can't delete non-existent variable: "+e)},t.VariableMap.prototype.deleteVariableInternal=function(e,n){var r=t.Events.getGroup();r||t.Events.setGroup(!0);try{for(var i=0;i<n.length;i++)n[i].dispose(!0);this.deleteVariable(e)}finally{r||t.Events.setGroup(!1)}},t.VariableMap.prototype.getVariable=function(e,n){if(n=this.variableMap_[n||""])for(var r,i=0;r=n[i];i++)if(t.Names.equals(r.name,e))return r;return null},t.VariableMap.prototype.getVariableById=function(t){for(var e=Object.keys(this.variableMap_),n=0;n<e.length;n++)for(var r,i=e[n],o=0;r=this.variableMap_[i][o];o++)if(r.getId()==t)return r;return null},t.VariableMap.prototype.getVariablesOfType=function(t){return(t=this.variableMap_[t||""])?t.slice():[]},t.VariableMap.prototype.getVariableTypes=function(e){var n={};t.utils.object.mixin(n,this.variableMap_),e&&e.getPotentialVariableMap()&&t.utils.object.mixin(n,e.getPotentialVariableMap().variableMap_),e=Object.keys(n),n=!1;for(var r=0;r<e.length;r++)""==e[r]&&(n=!0);return n||e.push(""),e},t.VariableMap.prototype.getAllVariables=function(){var t,e=[];for(t in this.variableMap_)e=e.concat(this.variableMap_[t]);return e},t.VariableMap.prototype.getAllVariableNames=function(){var t,e=[];for(t in this.variableMap_)for(var n,r=this.variableMap_[t],i=0;n=r[i];i++)e.push(n.name);return e},t.VariableMap.prototype.getVariableUsesById=function(t){for(var e=[],n=this.workspace.getAllBlocks(!1),r=0;r<n.length;r++){var i=n[r].getVarModels();if(i)for(var o=0;o<i.length;o++)i[o].getId()==t&&e.push(n[r])}return e},t.Workspace=function(e){this.id=t.utils.genUid(),t.Workspace.WorkspaceDB_[this.id]=this,this.options=e||new t.Options({}),this.RTL=!!this.options.RTL,this.horizontalLayout=!!this.options.horizontalLayout,this.toolboxPosition=this.options.toolboxPosition,this.connectionChecker=new(t.registry.getClassFromOptions(t.registry.Type.CONNECTION_CHECKER,this.options,!0))(this),this.topBlocks_=[],this.topComments_=[],this.commentDB_=Object.create(null),this.listeners_=[],this.undoStack_=[],this.redoStack_=[],this.blockDB_=Object.create(null),this.typedBlocksDB_=Object.create(null),this.variableMap_=new t.VariableMap(this),this.potentialVariableMap_=null},t.Workspace.prototype.rendered=!1,t.Workspace.prototype.isClearing=!1,t.Workspace.prototype.MAX_UNDO=1024,t.Workspace.prototype.connectionDBList=null,t.Workspace.prototype.dispose=function(){this.listeners_.length=0,this.clear(),delete t.Workspace.WorkspaceDB_[this.id]},t.Workspace.SCAN_ANGLE=3,t.Workspace.prototype.sortObjects_=function(e,n){return e=e.getRelativeToSurfaceXY(),n=n.getRelativeToSurfaceXY(),e.y+t.Workspace.prototype.sortObjects_.offset*e.x-(n.y+t.Workspace.prototype.sortObjects_.offset*n.x)},t.Workspace.prototype.addTopBlock=function(t){this.topBlocks_.push(t)},t.Workspace.prototype.removeTopBlock=function(e){if(!t.utils.arrayRemove(this.topBlocks_,e))throw Error("Block not present in workspace's list of top-most blocks.")},t.Workspace.prototype.getTopBlocks=function(e){var n=[].concat(this.topBlocks_);return e&&1<n.length&&(this.sortObjects_.offset=Math.sin(t.utils.math.toRadians(t.Workspace.SCAN_ANGLE)),this.RTL&&(this.sortObjects_.offset*=-1),n.sort(this.sortObjects_)),n},t.Workspace.prototype.addTypedBlock=function(t){this.typedBlocksDB_[t.type]||(this.typedBlocksDB_[t.type]=[]),this.typedBlocksDB_[t.type].push(t)},t.Workspace.prototype.removeTypedBlock=function(t){this.typedBlocksDB_[t.type].splice(this.typedBlocksDB_[t.type].indexOf(t),1),this.typedBlocksDB_[t.type].length||delete this.typedBlocksDB_[t.type]},t.Workspace.prototype.getBlocksByType=function(e,n){return this.typedBlocksDB_[e]?(e=this.typedBlocksDB_[e].slice(0),n&&1<e.length&&(this.sortObjects_.offset=Math.sin(t.utils.math.toRadians(t.Workspace.SCAN_ANGLE)),this.RTL&&(this.sortObjects_.offset*=-1),e.sort(this.sortObjects_)),e):[]},t.Workspace.prototype.addTopComment=function(t){this.topComments_.push(t),this.commentDB_[t.id]&&console.warn('Overriding an existing comment on this workspace, with id "'+t.id+'"'),this.commentDB_[t.id]=t},t.Workspace.prototype.removeTopComment=function(e){if(!t.utils.arrayRemove(this.topComments_,e))throw Error("Comment not present in workspace's list of top-most comments.");delete this.commentDB_[e.id]},t.Workspace.prototype.getTopComments=function(e){var n=[].concat(this.topComments_);return e&&1<n.length&&(this.sortObjects_.offset=Math.sin(t.utils.math.toRadians(t.Workspace.SCAN_ANGLE)),this.RTL&&(this.sortObjects_.offset*=-1),n.sort(this.sortObjects_)),n},t.Workspace.prototype.getAllBlocks=function(t){if(t){t=this.getTopBlocks(!0);for(var e=[],n=0;n<t.length;n++)e.push.apply(e,t[n].getDescendants(!0))}else for(e=this.getTopBlocks(!1),n=0;n<e.length;n++)e.push.apply(e,e[n].getChildren(!1));return e.filter(function(t){return!t.isInsertionMarker()})},t.Workspace.prototype.clear=function(){this.isClearing=!0;try{var e=t.Events.getGroup();for(e||t.Events.setGroup(!0);this.topBlocks_.length;)this.topBlocks_[0].dispose(!1);for(;this.topComments_.length;)this.topComments_[this.topComments_.length-1].dispose(!1);e||t.Events.setGroup(!1),this.variableMap_.clear(),this.potentialVariableMap_&&this.potentialVariableMap_.clear()}finally{this.isClearing=!1}},t.Workspace.prototype.renameVariableById=function(t,e){this.variableMap_.renameVariableById(t,e)},t.Workspace.prototype.createVariable=function(t,e,n){return this.variableMap_.createVariable(t,e,n)},t.Workspace.prototype.getVariableUsesById=function(t){return this.variableMap_.getVariableUsesById(t)},t.Workspace.prototype.deleteVariableById=function(t){this.variableMap_.deleteVariableById(t)},t.Workspace.prototype.getVariable=function(t,e){return this.variableMap_.getVariable(t,e)},t.Workspace.prototype.getVariableById=function(t){return this.variableMap_.getVariableById(t)},t.Workspace.prototype.getVariablesOfType=function(t){return this.variableMap_.getVariablesOfType(t)},t.Workspace.prototype.getVariableTypes=function(){return this.variableMap_.getVariableTypes(this)},t.Workspace.prototype.getAllVariables=function(){return this.variableMap_.getAllVariables()},t.Workspace.prototype.getAllVariableNames=function(){return this.variableMap_.getAllVariableNames()},t.Workspace.prototype.getWidth=function(){return 0},t.Workspace.prototype.newBlock=function(e,n){return new t.Block(this,e,n)},t.Workspace.prototype.remainingCapacity=function(){return isNaN(this.options.maxBlocks)?1/0:this.options.maxBlocks-this.getAllBlocks(!1).length},t.Workspace.prototype.remainingCapacityOfType=function(t){return this.options.maxInstances?(void 0!==this.options.maxInstances[t]?this.options.maxInstances[t]:1/0)-this.getBlocksByType(t,!1).length:1/0},t.Workspace.prototype.isCapacityAvailable=function(t){if(!this.hasBlockLimits())return!0;var e,n=0;for(e in t){if(t[e]>this.remainingCapacityOfType(e))return!1;n+=t[e]}return!(n>this.remainingCapacity())},t.Workspace.prototype.hasBlockLimits=function(){return 1/0!=this.options.maxBlocks||!!this.options.maxInstances},t.Workspace.prototype.getUndoStack=function(){return this.undoStack_},t.Workspace.prototype.getRedoStack=function(){return this.redoStack_},t.Workspace.prototype.undo=function(e){var n=e?this.redoStack_:this.undoStack_,r=e?this.undoStack_:this.redoStack_,i=n.pop();if(i){for(var o=[i];n.length&&i.group&&i.group==n[n.length-1].group;)o.push(n.pop());for(n=0;i=o[n];n++)r.push(i);o=t.Events.filter(o,e),t.Events.recordUndo=!1;try{for(n=0;i=o[n];n++)i.run(e)}finally{t.Events.recordUndo=!0}}},t.Workspace.prototype.clearUndo=function(){this.undoStack_.length=0,this.redoStack_.length=0,t.Events.clearPendingUndo()},t.Workspace.prototype.addChangeListener=function(t){return this.listeners_.push(t),t},t.Workspace.prototype.removeChangeListener=function(e){t.utils.arrayRemove(this.listeners_,e)},t.Workspace.prototype.fireChangeListener=function(t){if(t.recordUndo)for(this.undoStack_.push(t),this.redoStack_.length=0;this.undoStack_.length>this.MAX_UNDO&&0<=this.MAX_UNDO;)this.undoStack_.shift();for(var e,n=0;e=this.listeners_[n];n++)e(t)},t.Workspace.prototype.getBlockById=function(t){return this.blockDB_[t]||null},t.Workspace.prototype.setBlockById=function(t,e){this.blockDB_[t]=e},t.Workspace.prototype.removeBlockById=function(t){delete this.blockDB_[t]},t.Workspace.prototype.getCommentById=function(t){return this.commentDB_[t]||null},t.Workspace.prototype.allInputsFilled=function(t){for(var e,n=this.getTopBlocks(!1),r=0;e=n[r];r++)if(!e.allInputsFilled(t))return!1;return!0},t.Workspace.prototype.getPotentialVariableMap=function(){return this.potentialVariableMap_},t.Workspace.prototype.createPotentialVariableMap=function(){this.potentialVariableMap_=new t.VariableMap(this)},t.Workspace.prototype.getVariableMap=function(){return this.variableMap_},t.Workspace.prototype.setVariableMap=function(t){this.variableMap_=t},t.Workspace.WorkspaceDB_=Object.create(null),t.Workspace.getById=function(e){return t.Workspace.WorkspaceDB_[e]||null},t.Workspace.getAll=function(){var e,n=[];for(e in t.Workspace.WorkspaceDB_)n.push(t.Workspace.WorkspaceDB_[e]);return n},t.WorkspaceDragSurfaceSvg=function(t){this.container_=t,this.createDom()},t.WorkspaceDragSurfaceSvg.prototype.SVG_=null,t.WorkspaceDragSurfaceSvg.prototype.container_=null,t.WorkspaceDragSurfaceSvg.prototype.createDom=function(){this.SVG_||(this.SVG_=t.utils.dom.createSvgElement(t.utils.Svg.SVG,{xmlns:t.utils.dom.SVG_NS,"xmlns:html":t.utils.dom.HTML_NS,"xmlns:xlink":t.utils.dom.XLINK_NS,version:"1.1",class:"blocklyWsDragSurface blocklyOverflowVisible"},null),this.container_.appendChild(this.SVG_))},t.WorkspaceDragSurfaceSvg.prototype.translateSurface=function(e,n){e=e.toFixed(0),n=n.toFixed(0),this.SVG_.style.display="block",t.utils.dom.setCssTransform(this.SVG_,"translate3d("+e+"px, "+n+"px, 0px)")},t.WorkspaceDragSurfaceSvg.prototype.getSurfaceTranslation=function(){return t.utils.getRelativeXY(this.SVG_)},t.WorkspaceDragSurfaceSvg.prototype.clearAndHide=function(e){if(!e)throw Error("Couldn't clear and hide the drag surface: missing new surface.");var n=this.SVG_.childNodes[0],r=this.SVG_.childNodes[1];if(!(n&&r&&t.utils.dom.hasClass(n,"blocklyBlockCanvas")&&t.utils.dom.hasClass(r,"blocklyBubbleCanvas")))throw Error("Couldn't clear and hide the drag surface. A node was missing.");if(null!=this.previousSibling_?t.utils.dom.insertAfter(n,this.previousSibling_):e.insertBefore(n,e.firstChild),t.utils.dom.insertAfter(r,n),this.SVG_.style.display="none",this.SVG_.childNodes.length)throw Error("Drag surface was not cleared.");t.utils.dom.setCssTransform(this.SVG_,""),this.previousSibling_=null},t.WorkspaceDragSurfaceSvg.prototype.setContentsAndShow=function(t,e,n,r,i,o){if(this.SVG_.childNodes.length)throw Error("Already dragging a block.");this.previousSibling_=n,t.setAttribute("transform","translate(0, 0) scale("+o+")"),e.setAttribute("transform","translate(0, 0) scale("+o+")"),this.SVG_.setAttribute("width",r),this.SVG_.setAttribute("height",i),this.SVG_.appendChild(t),this.SVG_.appendChild(e),this.SVG_.style.display="block"},t.blockRendering={},t.blockRendering.useDebugger=!1,t.blockRendering.register=function(e,n){t.registry.register(t.registry.Type.RENDERER,e,n)},t.blockRendering.unregister=function(e){t.registry.unregister(t.registry.Type.RENDERER,e)},t.blockRendering.startDebugger=function(){t.blockRendering.useDebugger=!0},t.blockRendering.stopDebugger=function(){t.blockRendering.useDebugger=!1},t.blockRendering.init=function(e,n,r){return(e=new(t.registry.getClass(t.registry.Type.RENDERER,e))(e)).init(n,r),e},t.ASTNode=function(e,n,r){if(!n)throw Error("Cannot create a node without a location.");this.type_=e,this.isConnection_=t.ASTNode.isConnectionType_(e),this.location_=n,this.wsCoordinate_=null,this.processParams_(r||null)},t.ASTNode.types={FIELD:"field",BLOCK:"block",INPUT:"input",OUTPUT:"output",NEXT:"next",PREVIOUS:"previous",STACK:"stack",WORKSPACE:"workspace"},t.ASTNode.NAVIGATE_ALL_FIELDS=!1,t.ASTNode.DEFAULT_OFFSET_Y=-20,t.ASTNode.isConnectionType_=function(e){switch(e){case t.ASTNode.types.PREVIOUS:case t.ASTNode.types.NEXT:case t.ASTNode.types.INPUT:case t.ASTNode.types.OUTPUT:return!0}return!1},t.ASTNode.createFieldNode=function(e){return e?new t.ASTNode(t.ASTNode.types.FIELD,e):null},t.ASTNode.createConnectionNode=function(e){if(!e)return null;var n=e.type;return n==t.connectionTypes.INPUT_VALUE||n==t.connectionTypes.NEXT_STATEMENT&&e.getParentInput()?t.ASTNode.createInputNode(e.getParentInput()):n==t.connectionTypes.NEXT_STATEMENT?new t.ASTNode(t.ASTNode.types.NEXT,e):n==t.connectionTypes.OUTPUT_VALUE?new t.ASTNode(t.ASTNode.types.OUTPUT,e):n==t.connectionTypes.PREVIOUS_STATEMENT?new t.ASTNode(t.ASTNode.types.PREVIOUS,e):null},t.ASTNode.createInputNode=function(e){return e&&e.connection?new t.ASTNode(t.ASTNode.types.INPUT,e.connection):null},t.ASTNode.createBlockNode=function(e){return e?new t.ASTNode(t.ASTNode.types.BLOCK,e):null},t.ASTNode.createStackNode=function(e){return e?new t.ASTNode(t.ASTNode.types.STACK,e):null},t.ASTNode.createWorkspaceNode=function(e,n){return n&&e?new t.ASTNode(t.ASTNode.types.WORKSPACE,e,{wsCoordinate:n}):null},t.ASTNode.createTopNode=function(e){var n=e.previousConnection||e.outputConnection;return n?t.ASTNode.createConnectionNode(n):t.ASTNode.createBlockNode(e)},t.ASTNode.prototype.processParams_=function(t){t&&t.wsCoordinate&&(this.wsCoordinate_=t.wsCoordinate)},t.ASTNode.prototype.getLocation=function(){return this.location_},t.ASTNode.prototype.getType=function(){return this.type_},t.ASTNode.prototype.getWsCoordinate=function(){return this.wsCoordinate_},t.ASTNode.prototype.isConnection=function(){return this.isConnection_},t.ASTNode.prototype.findNextForInput_=function(){var e,n=this.location_.getParentInput(),r=n.getSourceBlock();for(n=r.inputList.indexOf(n)+1;e=r.inputList[n];n++){for(var i,o=e.fieldRow,s=0;i=o[s];s++)if(i.isClickable()||t.ASTNode.NAVIGATE_ALL_FIELDS)return t.ASTNode.createFieldNode(i);if(e.connection)return t.ASTNode.createInputNode(e)}return null},t.ASTNode.prototype.findNextForField_=function(){var e=this.location_,n=e.getParentInput(),r=e.getSourceBlock(),i=r.inputList.indexOf(n);for(e=n.fieldRow.indexOf(e)+1;n=r.inputList[i];i++){for(var o=n.fieldRow;e<o.length;){if(o[e].isClickable()||t.ASTNode.NAVIGATE_ALL_FIELDS)return t.ASTNode.createFieldNode(o[e]);e++}if(e=0,n.connection)return t.ASTNode.createInputNode(n)}return null},t.ASTNode.prototype.findPrevForInput_=function(){for(var e,n=this.location_.getParentInput(),r=n.getSourceBlock(),i=r.inputList.indexOf(n);e=r.inputList[i];i--){if(e.connection&&e!==n)return t.ASTNode.createInputNode(e);for(var o,s=(e=e.fieldRow).length-1;o=e[s];s--)if(o.isClickable()||t.ASTNode.NAVIGATE_ALL_FIELDS)return t.ASTNode.createFieldNode(o)}return null},t.ASTNode.prototype.findPrevForField_=function(){var e,n=this.location_,r=n.getParentInput(),i=n.getSourceBlock(),o=i.inputList.indexOf(r);for(n=r.fieldRow.indexOf(n)-1;e=i.inputList[o];o--){if(e.connection&&e!==r)return t.ASTNode.createInputNode(e);for(e=e.fieldRow;-1<n;){if(e[n].isClickable()||t.ASTNode.NAVIGATE_ALL_FIELDS)return t.ASTNode.createFieldNode(e[n]);n--}0<=o-1&&(n=i.inputList[o-1].fieldRow.length-1)}return null},t.ASTNode.prototype.navigateBetweenStacks_=function(e){var n=this.getLocation();if(n instanceof t.Block||(n=n.getSourceBlock()),!n||!n.workspace)return null;var r=n.getRootBlock();n=r.workspace.getTopBlocks(!0);for(var i,o=0;i=n[o];o++)if(r.id==i.id)return-1==(e=o+(e?1:-1))||e==n.length?null:t.ASTNode.createStackNode(n[e]);throw Error("Couldn't find "+(e?"next":"previous")+" stack?!")},t.ASTNode.prototype.findTopASTNodeForBlock_=function(e){var n=e.previousConnection||e.outputConnection;return n?t.ASTNode.createConnectionNode(n):t.ASTNode.createBlockNode(e)},t.ASTNode.prototype.getOutAstNodeForBlock_=function(e){if(!e)return null;var n=(e=e.getTopStackBlock()).previousConnection||e.outputConnection;return n&&n.targetConnection&&n.targetConnection.getParentInput()?t.ASTNode.createInputNode(n.targetConnection.getParentInput()):t.ASTNode.createStackNode(e)},t.ASTNode.prototype.findFirstFieldOrInput_=function(e){e=e.inputList;for(var n,r=0;n=e[r];r++){for(var i,o=n.fieldRow,s=0;i=o[s];s++)if(i.isClickable()||t.ASTNode.NAVIGATE_ALL_FIELDS)return t.ASTNode.createFieldNode(i);if(n.connection)return t.ASTNode.createInputNode(n)}return null},t.ASTNode.prototype.getSourceBlock=function(){return this.getType()===t.ASTNode.types.BLOCK?this.getLocation():this.getType()===t.ASTNode.types.STACK?this.getLocation():this.getType()===t.ASTNode.types.WORKSPACE?null:this.getLocation().getSourceBlock()},t.ASTNode.prototype.next=function(){switch(this.type_){case t.ASTNode.types.STACK:return this.navigateBetweenStacks_(!0);case t.ASTNode.types.OUTPUT:var e=this.location_;return t.ASTNode.createBlockNode(e.getSourceBlock());case t.ASTNode.types.FIELD:return this.findNextForField_();case t.ASTNode.types.INPUT:return this.findNextForInput_();case t.ASTNode.types.BLOCK:return t.ASTNode.createConnectionNode(this.location_.nextConnection);case t.ASTNode.types.PREVIOUS:return e=this.location_,t.ASTNode.createBlockNode(e.getSourceBlock());case t.ASTNode.types.NEXT:return e=this.location_,t.ASTNode.createConnectionNode(e.targetConnection)}return null},t.ASTNode.prototype.in=function(){switch(this.type_){case t.ASTNode.types.WORKSPACE:var e=this.location_.getTopBlocks(!0);if(0<e.length)return t.ASTNode.createStackNode(e[0]);break;case t.ASTNode.types.STACK:return e=this.location_,this.findTopASTNodeForBlock_(e);case t.ASTNode.types.BLOCK:return e=this.location_,this.findFirstFieldOrInput_(e);case t.ASTNode.types.INPUT:return t.ASTNode.createConnectionNode(this.location_.targetConnection)}return null},t.ASTNode.prototype.prev=function(){switch(this.type_){case t.ASTNode.types.STACK:return this.navigateBetweenStacks_(!1);case t.ASTNode.types.FIELD:return this.findPrevForField_();case t.ASTNode.types.INPUT:return this.findPrevForInput_();case t.ASTNode.types.BLOCK:var e=this.location_;return t.ASTNode.createConnectionNode(e.previousConnection||e.outputConnection);case t.ASTNode.types.PREVIOUS:if((e=(e=this.location_).targetConnection)&&!e.getParentInput())return t.ASTNode.createConnectionNode(e);break;case t.ASTNode.types.NEXT:return e=this.location_,t.ASTNode.createBlockNode(e.getSourceBlock())}return null},t.ASTNode.prototype.out=function(){switch(this.type_){case t.ASTNode.types.STACK:var e=this.location_,n=e.getRelativeToSurfaceXY();return n=new t.utils.Coordinate(n.x,n.y+t.ASTNode.DEFAULT_OFFSET_Y),t.ASTNode.createWorkspaceNode(e.workspace,n);case t.ASTNode.types.OUTPUT:return(n=(e=this.location_).targetConnection)?t.ASTNode.createConnectionNode(n):t.ASTNode.createStackNode(e.getSourceBlock());case t.ASTNode.types.FIELD:return t.ASTNode.createBlockNode(this.location_.getSourceBlock());case t.ASTNode.types.INPUT:return e=this.location_,t.ASTNode.createBlockNode(e.getSourceBlock());case t.ASTNode.types.BLOCK:return e=this.location_,this.getOutAstNodeForBlock_(e);case t.ASTNode.types.PREVIOUS:case t.ASTNode.types.NEXT:return e=this.location_,this.getOutAstNodeForBlock_(e.getSourceBlock())}return null},t.Blocks=Object.create(null),t.Extensions={},t.Extensions.ALL_=Object.create(null),t.Extensions.register=function(e,n){if("string"!=typeof e||""==e.trim())throw Error('Error: Invalid extension name "'+e+'"');if(t.Extensions.ALL_[e])throw Error('Error: Extension "'+e+'" is already registered.');if("function"!=typeof n)throw Error('Error: Extension "'+e+'" must be a function');t.Extensions.ALL_[e]=n},t.Extensions.registerMixin=function(e,n){if(!n||"object"!=typeof n)throw Error('Error: Mixin "'+e+'" must be a object');t.Extensions.register(e,function(){this.mixin(n)})},t.Extensions.registerMutator=function(e,n,r,i){var o='Error when registering mutator "'+e+'": ';t.Extensions.checkHasFunction_(o,n.domToMutation,"domToMutation"),t.Extensions.checkHasFunction_(o,n.mutationToDom,"mutationToDom");var s=t.Extensions.checkMutatorDialog_(n,o);if(r&&"function"!=typeof r)throw Error('Extension "'+e+'" is not a function');t.Extensions.register(e,function(){if(s){if(!t.Mutator)throw Error(o+"Missing require for Blockly.Mutator");this.setMutator(new t.Mutator(i||[]))}this.mixin(n),r&&r.apply(this)})},t.Extensions.unregister=function(e){t.Extensions.ALL_[e]?delete t.Extensions.ALL_[e]:console.warn('No extension mapping for name "'+e+'" found to unregister')},t.Extensions.apply=function(e,n,r){var i=t.Extensions.ALL_[e];if("function"!=typeof i)throw Error('Error: Extension "'+e+'" not found.');if(r)t.Extensions.checkNoMutatorProperties_(e,n);else var o=t.Extensions.getMutatorProperties_(n);if(i.apply(n),r)t.Extensions.checkBlockHasMutatorProperties_('Error after applying mutator "'+e+'": ',n);else if(!t.Extensions.mutatorPropertiesMatch_(o,n))throw Error('Error when applying extension "'+e+'": mutation properties changed when applying a non-mutator extension.')},t.Extensions.checkHasFunction_=function(t,e,n){if(!e)throw Error(t+'missing required property "'+n+'"');if("function"!=typeof e)throw Error(t+'" required property "'+n+'" must be a function')},t.Extensions.checkNoMutatorProperties_=function(e,n){if(t.Extensions.getMutatorProperties_(n).length)throw Error('Error: tried to apply mutation "'+e+'" to a block that already has mutator functions. Block id: '+n.id)},t.Extensions.checkMutatorDialog_=function(t,e){var n=void 0!==t.compose,r=void 0!==t.decompose;if(n&&r){if("function"!=typeof t.compose)throw Error(e+"compose must be a function.");if("function"!=typeof t.decompose)throw Error(e+"decompose must be a function.");return!0}if(!n&&!r)return!1;throw Error(e+'Must have both or neither of "compose" and "decompose"')},t.Extensions.checkBlockHasMutatorProperties_=function(e,n){if("function"!=typeof n.domToMutation)throw Error(e+'Applying a mutator didn\'t add "domToMutation"');if("function"!=typeof n.mutationToDom)throw Error(e+'Applying a mutator didn\'t add "mutationToDom"');t.Extensions.checkMutatorDialog_(n,e)},t.Extensions.getMutatorProperties_=function(t){var e=[];return void 0!==t.domToMutation&&e.push(t.domToMutation),void 0!==t.mutationToDom&&e.push(t.mutationToDom),void 0!==t.compose&&e.push(t.compose),void 0!==t.decompose&&e.push(t.decompose),e},t.Extensions.mutatorPropertiesMatch_=function(e,n){if((n=t.Extensions.getMutatorProperties_(n)).length!=e.length)return!1;for(var r=0;r<n.length;r++)if(e[r]!=n[r])return!1;return!0},t.Extensions.buildTooltipForDropdown=function(e,n){var r=[];return"object"==typeof document&&t.utils.runAfterPageLoad(function(){for(var e in n)t.utils.checkMessageReferences(n[e])}),function(){this.type&&-1==r.indexOf(this.type)&&(t.Extensions.checkDropdownOptionsInTable_(this,e,n),r.push(this.type)),this.setTooltip(function(){var i=String(this.getFieldValue(e)),o=n[i];return null==o?-1==r.indexOf(this.type)&&(i="No tooltip mapping for value "+i+" of field "+e,null!=this.type&&(i+=" of block type "+this.type),console.warn(i+".")):o=t.utils.replaceMessageReferences(o),o}.bind(this))}},t.Extensions.checkDropdownOptionsInTable_=function(t,e,n){var r=t.getField(e);if(!r.isOptionListDynamic()){r=r.getOptions();for(var i=0;i<r.length;++i){var o=r[i][1];null==n[o]&&console.warn("No tooltip mapping for value "+o+" of field "+e+" of block type "+t.type)}}},t.Extensions.buildTooltipWithFieldText=function(e,n){return"object"==typeof document&&t.utils.runAfterPageLoad(function(){t.utils.checkMessageReferences(e)}),function(){this.setTooltip(function(){var r=this.getField(n);return t.utils.replaceMessageReferences(e).replace("%1",r?r.getText():"")}.bind(this))}},t.Extensions.extensionParentTooltip_=function(){this.tooltipWhenNotConnected_=this.tooltip,this.setTooltip(function(){var t=this.getParent();return t&&t.getInputsInline()&&t.tooltip||this.tooltipWhenNotConnected_}.bind(this))},t.Extensions.register("parent_tooltip_when_inline",t.Extensions.extensionParentTooltip_),t.fieldRegistry={},t.fieldRegistry.register=function(e,n){t.registry.register(t.registry.Type.FIELD,e,n)},t.fieldRegistry.unregister=function(e){t.registry.unregister(t.registry.Type.FIELD,e)},t.fieldRegistry.fromJson=function(e){var n=t.registry.getObject(t.registry.Type.FIELD,e.type);return n?n.fromJson(e):(console.warn("Blockly could not create a field of type "+e.type+". The field is probably not being registered. This could be because the file is not loaded, the field does not register itself (Issue #1584), or the registration is not being reached."),null)},t.IDeletable=function(){},t.blockAnimations={},t.blockAnimations.disconnectPid_=0,t.blockAnimations.disconnectGroup_=null,t.blockAnimations.disposeUiEffect=function(e){var n=e.workspace,r=e.getSvgRoot();n.getAudioManager().play("delete"),e=n.getSvgXY(r),(r=r.cloneNode(!0)).translateX_=e.x,r.translateY_=e.y,r.setAttribute("transform","translate("+e.x+","+e.y+")"),n.getParentSvg().appendChild(r),r.bBox_=r.getBBox(),t.blockAnimations.disposeUiStep_(r,n.RTL,new Date,n.scale)},t.blockAnimations.disposeUiStep_=function(e,n,r,i){var o=(new Date-r)/150;1<o?t.utils.dom.removeNode(e):(e.setAttribute("transform","translate("+(e.translateX_+(n?-1:1)*e.bBox_.width*i/2*o)+","+(e.translateY_+e.bBox_.height*i*o)+") scale("+(1-o)*i+")"),setTimeout(t.blockAnimations.disposeUiStep_,10,e,n,r,i))},t.blockAnimations.connectionUiEffect=function(e){var n=e.workspace,r=n.scale;if(n.getAudioManager().play("click"),!(1>r)){var i=n.getSvgXY(e.getSvgRoot());e.outputConnection?(i.x+=(e.RTL?3:-3)*r,i.y+=13*r):e.previousConnection&&(i.x+=(e.RTL?-23:23)*r,i.y+=3*r),e=t.utils.dom.createSvgElement(t.utils.Svg.CIRCLE,{cx:i.x,cy:i.y,r:0,fill:"none",stroke:"#888","stroke-width":10},n.getParentSvg()),t.blockAnimations.connectionUiStep_(e,new Date,r)}},t.blockAnimations.connectionUiStep_=function(e,n,r){var i=(new Date-n)/150;1<i?t.utils.dom.removeNode(e):(e.setAttribute("r",25*i*r),e.style.opacity=1-i,t.blockAnimations.disconnectPid_=setTimeout(t.blockAnimations.connectionUiStep_,10,e,n,r))},t.blockAnimations.disconnectUiEffect=function(e){if(e.workspace.getAudioManager().play("disconnect"),!(1>e.workspace.scale)){var n=e.getHeightWidth().height;n=Math.atan(10/n)/Math.PI*180,e.RTL||(n*=-1),t.blockAnimations.disconnectUiStep_(e.getSvgRoot(),n,new Date)}},t.blockAnimations.disconnectUiStep_=function(e,n,r){var i=(new Date-r)/200;1<i?e.skew_="":(e.skew_="skewX("+Math.round(Math.sin(i*Math.PI*3)*(1-i)*n)+")",t.blockAnimations.disconnectGroup_=e,t.blockAnimations.disconnectPid_=setTimeout(t.blockAnimations.disconnectUiStep_,10,e,n,r)),e.setAttribute("transform",e.translate_+e.skew_)},t.blockAnimations.disconnectUiStop=function(){if(t.blockAnimations.disconnectGroup_){clearTimeout(t.blockAnimations.disconnectPid_);var e=t.blockAnimations.disconnectGroup_;e.skew_="",e.setAttribute("transform",e.translate_),t.blockAnimations.disconnectGroup_=null}},t.Events.BlockDrag=function(e,n,r){t.Events.BlockDrag.superClass_.constructor.call(this,e?e.workspace.id:void 0),this.blockId=e?e.id:null,this.isStart=n,this.blocks=r},t.utils.object.inherits(t.Events.BlockDrag,t.Events.UiBase),t.Events.BlockDrag.prototype.type=t.Events.BLOCK_DRAG,t.Events.BlockDrag.prototype.toJson=function(){var e=t.Events.BlockDrag.superClass_.toJson.call(this);return e.isStart=this.isStart,e.blockId=this.blockId,e.blocks=this.blocks,e},t.Events.BlockDrag.prototype.fromJson=function(e){t.Events.BlockDrag.superClass_.fromJson.call(this,e),this.isStart=e.isStart,this.blockId=e.blockId,this.blocks=e.blocks},t.registry.register(t.registry.Type.EVENT,t.Events.BLOCK_DRAG,t.Events.BlockDrag),t.IBlockDragger=function(){},t.InsertionMarkerManager=function(e){this.topBlock_=t.selected=e,this.workspace_=e.workspace,this.lastMarker_=this.lastOnStack_=null,this.firstMarker_=this.createMarkerBlock_(this.topBlock_),this.localConnection_=this.closestConnection_=null,this.wouldDeleteBlock_=!1,this.fadedBlock_=this.highlightedBlock_=this.markerConnection_=null,this.availableConnections_=this.initAvailableConnections_()},t.InsertionMarkerManager.PREVIEW_TYPE={INSERTION_MARKER:0,INPUT_OUTLINE:1,REPLACEMENT_FADE:2},t.InsertionMarkerManager.DUPLICATE_BLOCK_ERROR="The insertion marker manager tried to create a marker but the result is missing %1. If you are using a mutator, make sure your domToMutation method is properly defined.",t.InsertionMarkerManager.prototype.dispose=function(){this.availableConnections_.length=0,t.Events.disable();try{this.firstMarker_&&this.firstMarker_.dispose(),this.lastMarker_&&this.lastMarker_.dispose()}finally{t.Events.enable()}},t.InsertionMarkerManager.prototype.updateAvailableConnections=function(){this.availableConnections_=this.initAvailableConnections_()},t.InsertionMarkerManager.prototype.wouldDeleteBlock=function(){return this.wouldDeleteBlock_},t.InsertionMarkerManager.prototype.wouldConnectBlock=function(){return!!this.closestConnection_},t.InsertionMarkerManager.prototype.applyConnections=function(){if(this.closestConnection_&&(t.Events.disable(),this.hidePreview_(),t.Events.enable(),this.localConnection_.connect(this.closestConnection_),this.topBlock_.rendered)){var e=this.localConnection_.isSuperior()?this.closestConnection_:this.localConnection_;t.blockAnimations.connectionUiEffect(e.getSourceBlock()),this.topBlock_.getRootBlock().bringToFront()}},t.InsertionMarkerManager.prototype.update=function(e,n){var r=this.getCandidate_(e);((this.wouldDeleteBlock_=this.shouldDelete_(r,n))||this.shouldUpdatePreviews_(r,e))&&(t.Events.disable(),this.maybeHidePreview_(r),this.maybeShowPreview_(r),t.Events.enable())},t.InsertionMarkerManager.prototype.createMarkerBlock_=function(e){var n=e.type;t.Events.disable();try{var r=this.workspace_.newBlock(n);if(r.setInsertionMarker(!0),e.mutationToDom){var i=e.mutationToDom();i&&r.domToMutation(i)}for(n=0;n<e.inputList.length;n++){var o=e.inputList[n];if(o.name!=t.constants.COLLAPSED_INPUT_NAME){var s=r.inputList[n];if(!s)throw Error(t.InsertionMarkerManager.DUPLICATE_BLOCK_ERROR.replace("%1","an input"));for(i=0;i<o.fieldRow.length;i++){var a=o.fieldRow[i],l=s.fieldRow[i];if(!l)throw Error(t.InsertionMarkerManager.DUPLICATE_BLOCK_ERROR.replace("%1","a field"));l.setValue(a.getValue())}}}r.setCollapsed(e.isCollapsed()),r.setInputsInline(e.getInputsInline()),r.initSvg(),r.getSvgRoot().setAttribute("visibility","hidden")}finally{t.Events.enable()}return r},t.InsertionMarkerManager.prototype.initAvailableConnections_=function(){var e=this.topBlock_.getConnections_(!1),n=this.topBlock_.lastConnectionInStack(!0);if(n&&n!=this.topBlock_.nextConnection){if(e.push(n),this.lastOnStack_=n,this.lastMarker_){t.Events.disable();try{this.lastMarker_.dispose()}finally{t.Events.enable()}}this.lastMarker_=this.createMarkerBlock_(n.getSourceBlock())}return e},t.InsertionMarkerManager.prototype.shouldUpdatePreviews_=function(e,n){var r=e.local,i=e.closest;return e=e.radius,r&&i?this.localConnection_&&this.closestConnection_?(this.closestConnection_!=i||this.localConnection_!=r)&&(r=this.localConnection_.x+n.x-this.closestConnection_.x,n=this.localConnection_.y+n.y-this.closestConnection_.y,n=Math.sqrt(r*r+n*n),!(i&&e>n-t.CURRENT_CONNECTION_PREFERENCE)):!this.localConnection_&&!this.closestConnection_||(console.error("Only one of localConnection_ and closestConnection_ was set."),console.error("Returning true from shouldUpdatePreviews, but it's not clear why."),!0):!(!this.localConnection_||!this.closestConnection_)},t.InsertionMarkerManager.prototype.getCandidate_=function(t){for(var e=this.getStartRadius_(),n=null,r=null,i=0;i<this.availableConnections_.length;i++){var o=this.availableConnections_[i],s=o.closest(e,t);s.connection&&(n=s.connection,r=o,e=s.radius)}return{closest:n,local:r,radius:e}},t.InsertionMarkerManager.prototype.getStartRadius_=function(){return this.closestConnection_&&this.localConnection_?t.CONNECTING_SNAP_RADIUS:t.SNAP_RADIUS},t.InsertionMarkerManager.prototype.shouldDelete_=function(e,n){return!(!n||!this.workspace_.getComponentManager().hasCapability(n.id,t.ComponentManager.Capability.DELETE_AREA))&&n.wouldDelete(this.topBlock_,e&&!!e.closest)},t.InsertionMarkerManager.prototype.maybeShowPreview_=function(t){if(!this.wouldDeleteBlock_){var e=t.closest;t=t.local,e&&(e==this.closestConnection_||e.getSourceBlock().isInsertionMarker()?console.log("Trying to connect to an insertion marker"):(this.closestConnection_=e,this.localConnection_=t,this.showPreview_()))}},t.InsertionMarkerManager.prototype.showPreview_=function(){var e=this.closestConnection_,n=this.workspace_.getRenderer();switch(n.getConnectionPreviewMethod(e,this.localConnection_,this.topBlock_)){case t.InsertionMarkerManager.PREVIEW_TYPE.INPUT_OUTLINE:this.showInsertionInputOutline_();break;case t.InsertionMarkerManager.PREVIEW_TYPE.INSERTION_MARKER:this.showInsertionMarker_();break;case t.InsertionMarkerManager.PREVIEW_TYPE.REPLACEMENT_FADE:this.showReplacementFade_()}e&&n.shouldHighlightConnection(e)&&e.highlight()},t.InsertionMarkerManager.prototype.maybeHidePreview_=function(t){if(t.closest){var e=this.closestConnection_!=t.closest;t=this.localConnection_!=t.local,this.closestConnection_&&this.localConnection_&&(e||t||this.wouldDeleteBlock_)&&this.hidePreview_()}else this.hidePreview_();this.localConnection_=this.closestConnection_=this.markerConnection_=null},t.InsertionMarkerManager.prototype.hidePreview_=function(){this.closestConnection_&&this.closestConnection_.targetBlock()&&this.workspace_.getRenderer().shouldHighlightConnection(this.closestConnection_)&&this.closestConnection_.unhighlight(),this.fadedBlock_?this.hideReplacementFade_():this.highlightedBlock_?this.hideInsertionInputOutline_():this.markerConnection_&&this.hideInsertionMarker_()},t.InsertionMarkerManager.prototype.showInsertionMarker_=function(){var t=this.localConnection_,e=this.closestConnection_,n=this.lastOnStack_&&t==this.lastOnStack_?this.lastMarker_:this.firstMarker_;if((t=n.getMatchingConnection(t.getSourceBlock(),t))==this.markerConnection_)throw Error("Made it to showInsertionMarker_ even though the marker isn't changing");n.render(),n.rendered=!0,n.getSvgRoot().setAttribute("visibility","visible"),t&&e&&n.positionNearConnection(t,e),e&&t.connect(e),this.markerConnection_=t},t.InsertionMarkerManager.prototype.hideInsertionMarker_=function(){if(this.markerConnection_){var e=this.markerConnection_,n=e.getSourceBlock(),r=n.nextConnection,i=n.previousConnection,o=n.outputConnection;if(o=e.type==t.connectionTypes.INPUT_VALUE&&!(o&&o.targetConnection),!(e!=r||i&&i.targetConnection)||o?e.targetBlock().unplug(!1):e.type==t.connectionTypes.NEXT_STATEMENT&&e!=r?((r=e.targetConnection).getSourceBlock().unplug(!1),i=i?i.targetConnection:null,n.unplug(!0),i&&i.connect(r)):n.unplug(!0),e.targetConnection)throw Error("markerConnection_ still connected at the end of disconnectInsertionMarker");this.markerConnection_=null,(e=n.getSvgRoot())&&e.setAttribute("visibility","hidden")}else console.log("No insertion marker connection to disconnect")},t.InsertionMarkerManager.prototype.showInsertionInputOutline_=function(){var t=this.closestConnection_;this.highlightedBlock_=t.getSourceBlock(),this.highlightedBlock_.highlightShapeForInput(t,!0)},t.InsertionMarkerManager.prototype.hideInsertionInputOutline_=function(){this.highlightedBlock_.highlightShapeForInput(this.closestConnection_,!1),this.highlightedBlock_=null},t.InsertionMarkerManager.prototype.showReplacementFade_=function(){this.fadedBlock_=this.closestConnection_.targetBlock(),this.fadedBlock_.fadeForReplacement(!0)},t.InsertionMarkerManager.prototype.hideReplacementFade_=function(){this.fadedBlock_.fadeForReplacement(!1),this.fadedBlock_=null},t.InsertionMarkerManager.prototype.getInsertionMarkers=function(){var t=[];return this.firstMarker_&&t.push(this.firstMarker_),this.lastMarker_&&t.push(this.lastMarker_),t},t.BlockDragger=function(e,n){this.draggingBlock_=e,this.workspace_=n,this.draggedConnectionManager_=new t.InsertionMarkerManager(this.draggingBlock_),this.dragTarget_=null,this.wouldDeleteBlock_=!1,this.startXY_=this.draggingBlock_.getRelativeToSurfaceXY(),this.dragIconData_=t.BlockDragger.initIconData_(e)},t.BlockDragger.prototype.dispose=function(){this.dragIconData_.length=0,this.draggedConnectionManager_&&this.draggedConnectionManager_.dispose()},t.BlockDragger.initIconData_=function(t){var e=[];t=t.getDescendants(!1);for(var n,r=0;n=t[r];r++){n=n.getIcons();for(var i=0;i<n.length;i++){var o={location:n[i].getIconLocation(),icon:n[i]};e.push(o)}}return e},t.BlockDragger.prototype.startDrag=function(e,n){t.Events.getGroup()||t.Events.setGroup(!0),this.fireDragStartEvent_(),this.workspace_.isMutator&&this.draggingBlock_.bringToFront(),t.utils.dom.startTextWidthCache(),this.workspace_.setResizesEnabled(!1),t.blockAnimations.disconnectUiStop(),this.shouldDisconnect_(n)&&this.disconnectBlock_(n,e),this.draggingBlock_.setDragging(!0),this.draggingBlock_.moveToDragSurface()},t.BlockDragger.prototype.shouldDisconnect_=function(t){return!!(this.draggingBlock_.getParent()||t&&this.draggingBlock_.nextConnection&&this.draggingBlock_.nextConnection.targetBlock())},t.BlockDragger.prototype.disconnectBlock_=function(e,n){this.draggingBlock_.unplug(e),e=this.pixelsToWorkspaceUnits_(n),e=t.utils.Coordinate.sum(this.startXY_,e),this.draggingBlock_.translate(e.x,e.y),t.blockAnimations.disconnectUiEffect(this.draggingBlock_),this.draggedConnectionManager_.updateAvailableConnections()},t.BlockDragger.prototype.fireDragStartEvent_=function(){var e=new(t.Events.get(t.Events.BLOCK_DRAG))(this.draggingBlock_,!0,this.draggingBlock_.getDescendants(!1));t.Events.fire(e)},t.BlockDragger.prototype.drag=function(e,n){n=this.pixelsToWorkspaceUnits_(n);var r=t.utils.Coordinate.sum(this.startXY_,n);this.draggingBlock_.moveDuringDrag(r),this.dragIcons_(n),r=this.dragTarget_,this.dragTarget_=this.workspace_.getDragTarget(e),this.draggedConnectionManager_.update(n,this.dragTarget_),e=this.wouldDeleteBlock_,this.wouldDeleteBlock_=this.draggedConnectionManager_.wouldDeleteBlock(),e!=this.wouldDeleteBlock_&&this.updateCursorDuringBlockDrag_(),this.dragTarget_!==r&&(r&&r.onDragExit(this.draggingBlock_),this.dragTarget_&&this.dragTarget_.onDragEnter(this.draggingBlock_)),this.dragTarget_&&this.dragTarget_.onDragOver(this.draggingBlock_)},t.BlockDragger.prototype.endDrag=function(e,n){if(this.drag(e,n),this.dragIconData_=[],this.fireDragEndEvent_(),t.utils.dom.stopTextWidthCache(),t.blockAnimations.disconnectUiStop(),this.dragTarget_&&this.dragTarget_.shouldPreventMove(this.draggingBlock_))e=this.startXY_;else{var r=(e=this.getNewLocationAfterDrag_(n)).delta;e=e.newLocation}this.draggingBlock_.moveOffDragSurface(e),this.dragTarget_&&this.dragTarget_.onDrop(this.draggingBlock_),this.maybeDeleteBlock_()||(this.draggingBlock_.setDragging(!1),r?this.updateBlockAfterMove_(r):t.bumpObjectIntoBounds_(this.draggingBlock_.workspace,this.workspace_.getMetricsManager().getScrollMetrics(!0),this.draggingBlock_)),this.workspace_.setResizesEnabled(!0),t.Events.setGroup(!1)},t.BlockDragger.prototype.getNewLocationAfterDrag_=function(e){var n={};return n.delta=this.pixelsToWorkspaceUnits_(e),n.newLocation=t.utils.Coordinate.sum(this.startXY_,n.delta),n},t.BlockDragger.prototype.maybeDeleteBlock_=function(){return!!this.wouldDeleteBlock_&&(this.fireMoveEvent_(),this.draggingBlock_.dispose(!1,!0),t.draggingConnections=[],!0)},t.BlockDragger.prototype.updateBlockAfterMove_=function(t){this.draggingBlock_.moveConnections(t.x,t.y),this.fireMoveEvent_(),this.draggedConnectionManager_.wouldConnectBlock()?this.draggedConnectionManager_.applyConnections():this.draggingBlock_.render(),this.draggingBlock_.scheduleSnapAndBump()},t.BlockDragger.prototype.fireDragEndEvent_=function(){var e=new(t.Events.get(t.Events.BLOCK_DRAG))(this.draggingBlock_,!1,this.draggingBlock_.getDescendants(!1));t.Events.fire(e)},t.BlockDragger.prototype.updateToolboxStyle_=function(t){var e=this.workspace_.getToolbox();if(e){var n=this.draggingBlock_.isDeletable()?"blocklyToolboxDelete":"blocklyToolboxGrab";t&&"function"==typeof e.removeStyle?e.removeStyle(n):t||"function"!=typeof e.addStyle||e.addStyle(n)}},t.BlockDragger.prototype.fireMoveEvent_=function(){var e=new(t.Events.get(t.Events.BLOCK_MOVE))(this.draggingBlock_);e.oldCoordinate=this.startXY_,e.recordNew(),t.Events.fire(e)},t.BlockDragger.prototype.updateCursorDuringBlockDrag_=function(){this.draggingBlock_.setDeleteStyle(this.wouldDeleteBlock_)},t.BlockDragger.prototype.pixelsToWorkspaceUnits_=function(e){return e=new t.utils.Coordinate(e.x/this.workspace_.scale,e.y/this.workspace_.scale),this.workspace_.isMutator&&e.scale(1/this.workspace_.options.parentWorkspace.scale),e},t.BlockDragger.prototype.dragIcons_=function(e){for(var n=0;n<this.dragIconData_.length;n++){var r=this.dragIconData_[n];r.icon.setIconLocation(t.utils.Coordinate.sum(r.location,e))}},t.BlockDragger.prototype.getInsertionMarkers=function(){return this.draggedConnectionManager_&&this.draggedConnectionManager_.getInsertionMarkers?this.draggedConnectionManager_.getInsertionMarkers():[]},t.registry.register(t.registry.Type.BLOCK_DRAGGER,t.registry.DEFAULT,t.BlockDragger),t.IContextMenu=function(){},t.IDraggable=function(){},t.IBubble=function(){},t.Bubble=function(e,n,r,i,o,s){this.workspace_=e,this.content_=n,this.shape_=r,this.onMouseDownResizeWrapper_=this.onMouseDownBubbleWrapper_=this.moveCallback_=this.resizeCallback_=null,this.disposed=!1,r=t.Bubble.ARROW_ANGLE,this.workspace_.RTL&&(r=-r),this.arrow_radians_=t.utils.math.toRadians(r),e.getBubbleCanvas().appendChild(this.createDom_(n,!(!o||!s))),this.setAnchorLocation(i),o&&s||(o=(e=this.content_.getBBox()).width+2*t.Bubble.BORDER_WIDTH,s=e.height+2*t.Bubble.BORDER_WIDTH),this.setBubbleSize(o,s),this.positionBubble_(),this.renderArrow_(),this.rendered_=!0},t.Bubble.BORDER_WIDTH=6,t.Bubble.ARROW_THICKNESS=5,t.Bubble.ARROW_ANGLE=20,t.Bubble.ARROW_BEND=4,t.Bubble.ANCHOR_RADIUS=8,t.Bubble.onMouseUpWrapper_=null,t.Bubble.onMouseMoveWrapper_=null,t.Bubble.unbindDragEvents_=function(){t.Bubble.onMouseUpWrapper_&&(t.browserEvents.unbind(t.Bubble.onMouseUpWrapper_),t.Bubble.onMouseUpWrapper_=null),t.Bubble.onMouseMoveWrapper_&&(t.browserEvents.unbind(t.Bubble.onMouseMoveWrapper_),t.Bubble.onMouseMoveWrapper_=null)},t.Bubble.bubbleMouseUp_=function(e){t.Touch.clearTouchIdentifier(),t.Bubble.unbindDragEvents_()},t.Bubble.prototype.rendered_=!1,t.Bubble.prototype.anchorXY_=null,t.Bubble.prototype.relativeLeft_=0,t.Bubble.prototype.relativeTop_=0,t.Bubble.prototype.width_=0,t.Bubble.prototype.height_=0,t.Bubble.prototype.autoLayout_=!0,t.Bubble.prototype.createDom_=function(e,n){this.bubbleGroup_=t.utils.dom.createSvgElement(t.utils.Svg.G,{},null);var r={filter:"url(#"+this.workspace_.getRenderer().getConstants().embossFilterId+")"};return t.utils.userAgent.JAVA_FX&&(r={}),r=t.utils.dom.createSvgElement(t.utils.Svg.G,r,this.bubbleGroup_),this.bubbleArrow_=t.utils.dom.createSvgElement(t.utils.Svg.PATH,{},r),this.bubbleBack_=t.utils.dom.createSvgElement(t.utils.Svg.RECT,{class:"blocklyDraggable",x:0,y:0,rx:t.Bubble.BORDER_WIDTH,ry:t.Bubble.BORDER_WIDTH},r),n?(this.resizeGroup_=t.utils.dom.createSvgElement(t.utils.Svg.G,{class:this.workspace_.RTL?"blocklyResizeSW":"blocklyResizeSE"},this.bubbleGroup_),n=2*t.Bubble.BORDER_WIDTH,t.utils.dom.createSvgElement(t.utils.Svg.POLYGON,{points:"0,x x,x x,0".replace(/x/g,n.toString())},this.resizeGroup_),t.utils.dom.createSvgElement(t.utils.Svg.LINE,{class:"blocklyResizeLine",x1:n/3,y1:n-1,x2:n-1,y2:n/3},this.resizeGroup_),t.utils.dom.createSvgElement(t.utils.Svg.LINE,{class:"blocklyResizeLine",x1:2*n/3,y1:n-1,x2:n-1,y2:2*n/3},this.resizeGroup_)):this.resizeGroup_=null,this.workspace_.options.readOnly||(this.onMouseDownBubbleWrapper_=t.browserEvents.conditionalBind(this.bubbleBack_,"mousedown",this,this.bubbleMouseDown_),this.resizeGroup_&&(this.onMouseDownResizeWrapper_=t.browserEvents.conditionalBind(this.resizeGroup_,"mousedown",this,this.resizeMouseDown_))),this.bubbleGroup_.appendChild(e),this.bubbleGroup_},t.Bubble.prototype.getSvgRoot=function(){return this.bubbleGroup_},t.Bubble.prototype.setSvgId=function(t){this.bubbleGroup_.dataset&&(this.bubbleGroup_.dataset.blockId=t)},t.Bubble.prototype.bubbleMouseDown_=function(t){var e=this.workspace_.getGesture(t);e&&e.handleBubbleStart(t,this)},t.Bubble.prototype.showContextMenu=function(t){},t.Bubble.prototype.isDeletable=function(){return!1},t.Bubble.prototype.setDeleteStyle=function(t){},t.Bubble.prototype.resizeMouseDown_=function(e){this.promote(),t.Bubble.unbindDragEvents_(),t.utils.isRightButton(e)||(this.workspace_.startDrag(e,new t.utils.Coordinate(this.workspace_.RTL?-this.width_:this.width_,this.height_)),t.Bubble.onMouseUpWrapper_=t.browserEvents.conditionalBind(document,"mouseup",this,t.Bubble.bubbleMouseUp_),t.Bubble.onMouseMoveWrapper_=t.browserEvents.conditionalBind(document,"mousemove",this,this.resizeMouseMove_),t.hideChaff()),e.stopPropagation()},t.Bubble.prototype.resizeMouseMove_=function(t){this.autoLayout_=!1,t=this.workspace_.moveDrag(t),this.setBubbleSize(this.workspace_.RTL?-t.x:t.x,t.y),this.workspace_.RTL&&this.positionBubble_()},t.Bubble.prototype.registerResizeEvent=function(t){this.resizeCallback_=t},t.Bubble.prototype.registerMoveEvent=function(t){this.moveCallback_=t},t.Bubble.prototype.promote=function(){var t=this.bubbleGroup_.parentNode;return t.lastChild!==this.bubbleGroup_&&(t.appendChild(this.bubbleGroup_),!0)},t.Bubble.prototype.setAnchorLocation=function(t){this.anchorXY_=t,this.rendered_&&this.positionBubble_()},t.Bubble.prototype.layoutBubble_=function(){var t=this.workspace_.getMetricsManager().getViewMetrics(!0),e=this.getOptimalRelativeLeft_(t),n=this.getOptimalRelativeTop_(t),r=this.shape_.getBBox(),i={x:e,y:-this.height_-this.workspace_.getRenderer().getConstants().MIN_BLOCK_HEIGHT},o={x:-this.width_-30,y:n};n={x:r.width,y:n};var s={x:e,y:r.height};e=r.width<r.height?n:s,r=r.width<r.height?s:n,n=this.getOverlap_(i,t),s=this.getOverlap_(o,t);var a=this.getOverlap_(e,t);t=this.getOverlap_(r,t),n==(t=Math.max(n,s,a,t))?(this.relativeLeft_=i.x,this.relativeTop_=i.y):s==t?(this.relativeLeft_=o.x,this.relativeTop_=o.y):a==t?(this.relativeLeft_=e.x,this.relativeTop_=e.y):(this.relativeLeft_=r.x,this.relativeTop_=r.y)},t.Bubble.prototype.getOverlap_=function(t,e){var n=this.workspace_.RTL?this.anchorXY_.x-t.x-this.width_:t.x+this.anchorXY_.x;return t=t.y+this.anchorXY_.y,Math.max(0,Math.min(1,(Math.min(n+this.width_,e.left+e.width)-Math.max(n,e.left))*(Math.min(t+this.height_,e.top+e.height)-Math.max(t,e.top))/(this.width_*this.height_)))},t.Bubble.prototype.getOptimalRelativeLeft_=function(e){var n=-this.width_/4;if(this.width_>e.width)return n;if(this.workspace_.RTL)var r=this.anchorXY_.x-n,i=r-this.width_,o=e.left+e.width,s=e.left+t.Scrollbar.scrollbarThickness/this.workspace_.scale;else r=(i=n+this.anchorXY_.x)+this.width_,s=e.left,o=e.left+e.width-t.Scrollbar.scrollbarThickness/this.workspace_.scale;return this.workspace_.RTL?i<s?n=-(s-this.anchorXY_.x+this.width_):r>o&&(n=-(o-this.anchorXY_.x)):i<s?n=s-this.anchorXY_.x:r>o&&(n=o-this.anchorXY_.x-this.width_),n},t.Bubble.prototype.getOptimalRelativeTop_=function(e){var n=-this.height_/4;if(this.height_>e.height)return n;var r=this.anchorXY_.y+n,i=r+this.height_,o=e.top;e=e.top+e.height-t.Scrollbar.scrollbarThickness/this.workspace_.scale;var s=this.anchorXY_.y;return r<o?n=o-s:i>e&&(n=e-s-this.height_),n},t.Bubble.prototype.positionBubble_=function(){var t=this.anchorXY_.x;t=this.workspace_.RTL?t-(this.relativeLeft_+this.width_):t+this.relativeLeft_,this.moveTo(t,this.relativeTop_+this.anchorXY_.y)},t.Bubble.prototype.moveTo=function(t,e){this.bubbleGroup_.setAttribute("transform","translate("+t+","+e+")")},t.Bubble.prototype.setDragging=function(t){!t&&this.moveCallback_&&this.moveCallback_()},t.Bubble.prototype.getBubbleSize=function(){return new t.utils.Size(this.width_,this.height_)},t.Bubble.prototype.setBubbleSize=function(e,n){var r=2*t.Bubble.BORDER_WIDTH;e=Math.max(e,r+45),n=Math.max(n,r+20),this.width_=e,this.height_=n,this.bubbleBack_.setAttribute("width",e),this.bubbleBack_.setAttribute("height",n),this.resizeGroup_&&(this.workspace_.RTL?this.resizeGroup_.setAttribute("transform","translate("+2*t.Bubble.BORDER_WIDTH+","+(n-r)+") scale(-1 1)"):this.resizeGroup_.setAttribute("transform","translate("+(e-r)+","+(n-r)+")")),this.autoLayout_&&this.layoutBubble_(),this.positionBubble_(),this.renderArrow_(),this.resizeCallback_&&this.resizeCallback_()},t.Bubble.prototype.renderArrow_=function(){var e=[],n=this.width_/2,r=this.height_/2,i=-this.relativeLeft_,o=-this.relativeTop_;if(n==i&&r==o)e.push("M "+n+","+r);else{o-=r,i-=n,this.workspace_.RTL&&(i*=-1);var s=Math.sqrt(o*o+i*i),a=Math.acos(i/s);0>o&&(a=2*Math.PI-a);var l=a+Math.PI/2;l>2*Math.PI&&(l-=2*Math.PI);var u=Math.sin(l),c=Math.cos(l),h=this.getBubbleSize();l=(h.width+h.height)/t.Bubble.ARROW_THICKNESS,l=Math.min(l,h.width,h.height)/4,i=n+(h=1-t.Bubble.ANCHOR_RADIUS/s)*i,o=r+h*o,h=n+l*c;var d=r+l*u;n-=l*c,r-=l*u,(u=a+this.arrow_radians_)>2*Math.PI&&(u-=2*Math.PI),a=Math.sin(u)*s/t.Bubble.ARROW_BEND,s=Math.cos(u)*s/t.Bubble.ARROW_BEND,e.push("M"+h+","+d),e.push("C"+(h+s)+","+(d+a)+" "+i+","+o+" "+i+","+o),e.push("C"+i+","+o+" "+(n+s)+","+(r+a)+" "+n+","+r)}e.push("z"),this.bubbleArrow_.setAttribute("d",e.join(" "))},t.Bubble.prototype.setColour=function(t){this.bubbleBack_.setAttribute("fill",t),this.bubbleArrow_.setAttribute("fill",t)},t.Bubble.prototype.dispose=function(){this.onMouseDownBubbleWrapper_&&t.browserEvents.unbind(this.onMouseDownBubbleWrapper_),this.onMouseDownResizeWrapper_&&t.browserEvents.unbind(this.onMouseDownResizeWrapper_),t.Bubble.unbindDragEvents_(),t.utils.dom.removeNode(this.bubbleGroup_),this.disposed=!0},t.Bubble.prototype.moveDuringDrag=function(t,e){t?t.translateSurface(e.x,e.y):this.moveTo(e.x,e.y),this.relativeLeft_=this.workspace_.RTL?this.anchorXY_.x-e.x-this.width_:e.x-this.anchorXY_.x,this.relativeTop_=e.y-this.anchorXY_.y,this.renderArrow_()},t.Bubble.prototype.getRelativeToSurfaceXY=function(){return new t.utils.Coordinate(this.workspace_.RTL?-this.relativeLeft_+this.anchorXY_.x-this.width_:this.anchorXY_.x+this.relativeLeft_,this.anchorXY_.y+this.relativeTop_)},t.Bubble.prototype.setAutoLayout=function(t){this.autoLayout_=t},t.Bubble.textToDom=function(e){var n=t.utils.dom.createSvgElement(t.utils.Svg.TEXT,{class:"blocklyText blocklyBubbleText blocklyNoPointerEvents",y:t.Bubble.BORDER_WIDTH},null);e=e.split("\n");for(var r=0;r<e.length;r++){var i=t.utils.dom.createSvgElement(t.utils.Svg.TSPAN,{dy:"1em",x:t.Bubble.BORDER_WIDTH},n),o=document.createTextNode(e[r]);i.appendChild(o)}return n},t.Bubble.createNonEditableBubble=function(e,n,r){if((r=new t.Bubble(n.workspace,e,n.pathObject.svgPath,r,null,null)).setSvgId(n.id),n.RTL){n=e.getBBox().width;for(var i,o=0;i=e.childNodes[o];o++)i.setAttribute("text-anchor","end"),i.setAttribute("x",n+t.Bubble.BORDER_WIDTH)}return r},t.Events.CommentBase=function(e){this.commentId=(this.isBlank=void 0===e)?"":e.id,this.workspaceId=this.isBlank?"":e.workspace.id,this.group=t.Events.getGroup(),this.recordUndo=t.Events.recordUndo},t.utils.object.inherits(t.Events.CommentBase,t.Events.Abstract),t.Events.CommentBase.prototype.toJson=function(){var e=t.Events.CommentBase.superClass_.toJson.call(this);return this.commentId&&(e.commentId=this.commentId),e},t.Events.CommentBase.prototype.fromJson=function(e){t.Events.CommentBase.superClass_.fromJson.call(this,e),this.commentId=e.commentId},t.Events.CommentChange=function(e,n,r){t.Events.CommentChange.superClass_.constructor.call(this,e),e&&(this.oldContents_=void 0===n?"":n,this.newContents_=void 0===r?"":r)},t.utils.object.inherits(t.Events.CommentChange,t.Events.CommentBase),t.Events.CommentChange.prototype.type=t.Events.COMMENT_CHANGE,t.Events.CommentChange.prototype.toJson=function(){var e=t.Events.CommentChange.superClass_.toJson.call(this);return e.oldContents=this.oldContents_,e.newContents=this.newContents_,e},t.Events.CommentChange.prototype.fromJson=function(e){t.Events.CommentChange.superClass_.fromJson.call(this,e),this.oldContents_=e.oldContents,this.newContents_=e.newContents},t.Events.CommentChange.prototype.isNull=function(){return this.oldContents_==this.newContents_},t.Events.CommentChange.prototype.run=function(t){var e=this.getEventWorkspace_().getCommentById(this.commentId);e?e.setContent(t?this.newContents_:this.oldContents_):console.warn("Can't change non-existent comment: "+this.commentId)},t.Events.CommentCreate=function(e){t.Events.CommentCreate.superClass_.constructor.call(this,e),e&&(this.xml=e.toXmlWithXY())},t.utils.object.inherits(t.Events.CommentCreate,t.Events.CommentBase),t.Events.CommentCreate.prototype.type=t.Events.COMMENT_CREATE,t.Events.CommentCreate.prototype.toJson=function(){var e=t.Events.CommentCreate.superClass_.toJson.call(this);return e.xml=t.Xml.domToText(this.xml),e},t.Events.CommentCreate.prototype.fromJson=function(e){t.Events.CommentCreate.superClass_.fromJson.call(this,e),this.xml=t.Xml.textToDom(e.xml)},t.Events.CommentCreate.prototype.run=function(e){t.Events.CommentCreateDeleteHelper(this,e)},t.Events.CommentCreateDeleteHelper=function(e,n){var r=e.getEventWorkspace_();n?((n=t.utils.xml.createElement("xml")).appendChild(e.xml),t.Xml.domToWorkspace(n,r)):(r=r.getCommentById(e.commentId))?r.dispose(!1,!1):console.warn("Can't uncreate non-existent comment: "+e.commentId)},t.Events.CommentDelete=function(e){t.Events.CommentDelete.superClass_.constructor.call(this,e),e&&(this.xml=e.toXmlWithXY())},t.utils.object.inherits(t.Events.CommentDelete,t.Events.CommentBase),t.Events.CommentDelete.prototype.type=t.Events.COMMENT_DELETE,t.Events.CommentDelete.prototype.toJson=function(){return t.Events.CommentDelete.superClass_.toJson.call(this)},t.Events.CommentDelete.prototype.fromJson=function(e){t.Events.CommentDelete.superClass_.fromJson.call(this,e)},t.Events.CommentDelete.prototype.run=function(e){t.Events.CommentCreateDeleteHelper(this,!e)},t.Events.CommentMove=function(e){t.Events.CommentMove.superClass_.constructor.call(this,e),e&&(this.comment_=e,this.oldCoordinate_=e.getXY(),this.newCoordinate_=null)},t.utils.object.inherits(t.Events.CommentMove,t.Events.CommentBase),t.Events.CommentMove.prototype.recordNew=function(){if(!this.comment_)throw Error("Tried to record the new position of a comment on the same event twice.");this.newCoordinate_=this.comment_.getXY(),this.comment_=null},t.Events.CommentMove.prototype.type=t.Events.COMMENT_MOVE,t.Events.CommentMove.prototype.setOldCoordinate=function(t){this.oldCoordinate_=t},t.Events.CommentMove.prototype.toJson=function(){var e=t.Events.CommentMove.superClass_.toJson.call(this);return this.oldCoordinate_&&(e.oldCoordinate=Math.round(this.oldCoordinate_.x)+","+Math.round(this.oldCoordinate_.y)),this.newCoordinate_&&(e.newCoordinate=Math.round(this.newCoordinate_.x)+","+Math.round(this.newCoordinate_.y)),e},t.Events.CommentMove.prototype.fromJson=function(e){if(t.Events.CommentMove.superClass_.fromJson.call(this,e),e.oldCoordinate){var n=e.oldCoordinate.split(",");this.oldCoordinate_=new t.utils.Coordinate(Number(n[0]),Number(n[1]))}e.newCoordinate&&(n=e.newCoordinate.split(","),this.newCoordinate_=new t.utils.Coordinate(Number(n[0]),Number(n[1])))},t.Events.CommentMove.prototype.isNull=function(){return t.utils.Coordinate.equals(this.oldCoordinate_,this.newCoordinate_)},t.Events.CommentMove.prototype.run=function(t){var e=this.getEventWorkspace_().getCommentById(this.commentId);if(e){t=t?this.newCoordinate_:this.oldCoordinate_;var n=e.getXY();e.moveBy(t.x-n.x,t.y-n.y)}else console.warn("Can't move non-existent comment: "+this.commentId)},t.registry.register(t.registry.Type.EVENT,t.Events.COMMENT_CREATE,t.Events.CommentCreate),t.registry.register(t.registry.Type.EVENT,t.Events.COMMENT_CHANGE,t.Events.CommentChange),t.registry.register(t.registry.Type.EVENT,t.Events.COMMENT_MOVE,t.Events.CommentMove),t.registry.register(t.registry.Type.EVENT,t.Events.COMMENT_DELETE,t.Events.CommentDelete),t.BubbleDragger=function(e,n){this.draggingBubble_=e,this.workspace_=n,this.dragTarget_=null,this.wouldDeleteBubble_=!1,this.startXY_=this.draggingBubble_.getRelativeToSurfaceXY(),this.dragSurface_=t.utils.is3dSupported()&&n.getBlockDragSurface()?n.getBlockDragSurface():null},t.BubbleDragger.prototype.dispose=function(){this.dragSurface_=this.workspace_=this.draggingBubble_=null},t.BubbleDragger.prototype.startBubbleDrag=function(){t.Events.getGroup()||t.Events.setGroup(!0),this.workspace_.setResizesEnabled(!1),this.draggingBubble_.setAutoLayout(!1),this.dragSurface_&&this.moveToDragSurface_(),this.draggingBubble_.setDragging&&this.draggingBubble_.setDragging(!0)},t.BubbleDragger.prototype.dragBubble=function(e,n){n=this.pixelsToWorkspaceUnits_(n),n=t.utils.Coordinate.sum(this.startXY_,n),this.draggingBubble_.moveDuringDrag(this.dragSurface_,n),n=this.dragTarget_,this.dragTarget_=this.workspace_.getDragTarget(e),e=this.wouldDeleteBubble_,this.wouldDeleteBubble_=this.shouldDelete_(this.dragTarget_),e!=this.wouldDeleteBubble_&&this.updateCursorDuringBubbleDrag_(),this.dragTarget_!==n&&(n&&n.onDragExit(this.draggingBubble_),this.dragTarget_&&this.dragTarget_.onDragEnter(this.draggingBubble_)),this.dragTarget_&&this.dragTarget_.onDragOver(this.draggingBubble_)},t.BubbleDragger.prototype.shouldDelete_=function(e){return!(!e||!this.workspace_.getComponentManager().hasCapability(e.id,t.ComponentManager.Capability.DELETE_AREA))&&e.wouldDelete(this.draggingBubble_,!1)},t.BubbleDragger.prototype.updateCursorDuringBubbleDrag_=function(){this.draggingBubble_.setDeleteStyle(this.wouldDeleteBubble_)},t.BubbleDragger.prototype.endBubbleDrag=function(e,n){this.dragBubble(e,n),this.dragTarget_&&this.dragTarget_.shouldPreventMove(this.draggingBubble_)?e=this.startXY_:(e=this.pixelsToWorkspaceUnits_(n),e=t.utils.Coordinate.sum(this.startXY_,e)),this.draggingBubble_.moveTo(e.x,e.y),this.dragTarget_&&this.dragTarget_.onDrop(this.draggingBubble_),this.wouldDeleteBubble_?(this.fireMoveEvent_(),this.draggingBubble_.dispose(!1,!0)):(this.dragSurface_&&this.dragSurface_.clearAndHide(this.workspace_.getBubbleCanvas()),this.draggingBubble_.setDragging&&this.draggingBubble_.setDragging(!1),this.fireMoveEvent_()),this.workspace_.setResizesEnabled(!0),t.Events.setGroup(!1)},t.BubbleDragger.prototype.fireMoveEvent_=function(){if(this.draggingBubble_.isComment){var e=new(t.Events.get(t.Events.COMMENT_MOVE))(this.draggingBubble_);e.setOldCoordinate(this.startXY_),e.recordNew(),t.Events.fire(e)}},t.BubbleDragger.prototype.pixelsToWorkspaceUnits_=function(e){return e=new t.utils.Coordinate(e.x/this.workspace_.scale,e.y/this.workspace_.scale),this.workspace_.isMutator&&e.scale(1/this.workspace_.options.parentWorkspace.scale),e},t.BubbleDragger.prototype.moveToDragSurface_=function(){this.draggingBubble_.moveTo(0,0),this.dragSurface_.translateSurface(this.startXY_.x,this.startXY_.y),this.dragSurface_.setBlocksAndShow(this.draggingBubble_.getSvgRoot())},t.Events.Click=function(e,n,r){t.Events.Click.superClass_.constructor.call(this,e?e.workspace.id:n),this.blockId=e?e.id:null,this.targetType=r},t.utils.object.inherits(t.Events.Click,t.Events.UiBase),t.Events.Click.prototype.type=t.Events.CLICK,t.Events.Click.prototype.toJson=function(){var e=t.Events.Click.superClass_.toJson.call(this);return e.targetType=this.targetType,this.blockId&&(e.blockId=this.blockId),e},t.Events.Click.prototype.fromJson=function(e){t.Events.Click.superClass_.fromJson.call(this,e),this.targetType=e.targetType,this.blockId=e.blockId},t.registry.register(t.registry.Type.EVENT,t.Events.CLICK,t.Events.Click),t.WorkspaceDragger=function(e){this.workspace_=e,this.horizontalScrollEnabled_=this.workspace_.isMovableHorizontally(),this.verticalScrollEnabled_=this.workspace_.isMovableVertically(),this.startScrollXY_=new t.utils.Coordinate(e.scrollX,e.scrollY)},t.WorkspaceDragger.prototype.dispose=function(){this.workspace_=null},t.WorkspaceDragger.prototype.startDrag=function(){t.selected&&t.selected.unselect(),this.workspace_.setupDragSurface()},t.WorkspaceDragger.prototype.endDrag=function(t){this.drag(t),this.workspace_.resetDragSurface()},t.WorkspaceDragger.prototype.drag=function(e){if(e=t.utils.Coordinate.sum(this.startScrollXY_,e),this.horizontalScrollEnabled_&&this.verticalScrollEnabled_)this.workspace_.scroll(e.x,e.y);else if(this.horizontalScrollEnabled_)this.workspace_.scroll(e.x,this.workspace_.scrollY);else{if(!this.verticalScrollEnabled_)throw new TypeError("Invalid state.");this.workspace_.scroll(this.workspace_.scrollX,e.y)}},t.Gesture=function(e,n){this.mouseDownXY_=null,this.currentDragDeltaXY_=new t.utils.Coordinate(0,0),this.startWorkspace_=this.targetBlock_=this.startBlock_=this.startField_=this.startBubble_=null,this.creatorWorkspace_=n,this.isDraggingBubble_=this.isDraggingBlock_=this.isDraggingWorkspace_=this.hasExceededDragRadius_=!1,this.mostRecentEvent_=e,this.flyout_=this.workspaceDragger_=this.blockDragger_=this.bubbleDragger_=this.onUpWrapper_=this.onMoveWrapper_=null,this.isEnding_=this.hasStarted_=this.calledUpdateIsDragging_=!1,this.healStack_=!t.DRAG_STACK},t.Gesture.prototype.dispose=function(){t.Touch.clearTouchIdentifier(),t.Tooltip.unblock(),this.creatorWorkspace_.clearGesture(),this.onMoveWrapper_&&t.browserEvents.unbind(this.onMoveWrapper_),this.onUpWrapper_&&t.browserEvents.unbind(this.onUpWrapper_),this.blockDragger_&&this.blockDragger_.dispose(),this.workspaceDragger_&&this.workspaceDragger_.dispose(),this.bubbleDragger_&&this.bubbleDragger_.dispose()},t.Gesture.prototype.updateFromEvent_=function(e){var n=new t.utils.Coordinate(e.clientX,e.clientY);this.updateDragDelta_(n)&&(this.updateIsDragging_(),t.longStop_()),this.mostRecentEvent_=e},t.Gesture.prototype.updateDragDelta_=function(e){return this.currentDragDeltaXY_=t.utils.Coordinate.difference(e,this.mouseDownXY_),!this.hasExceededDragRadius_&&(this.hasExceededDragRadius_=t.utils.Coordinate.magnitude(this.currentDragDeltaXY_)>(this.flyout_?t.FLYOUT_DRAG_RADIUS:t.DRAG_RADIUS))},t.Gesture.prototype.updateIsDraggingFromFlyout_=function(){return!(!this.targetBlock_||!this.flyout_.isBlockCreatable_(this.targetBlock_))&&(!(this.flyout_.isScrollable()&&!this.flyout_.isDragTowardWorkspace(this.currentDragDeltaXY_))&&(this.startWorkspace_=this.flyout_.targetWorkspace,this.startWorkspace_.updateScreenCalculationsIfScrolled(),t.Events.getGroup()||t.Events.setGroup(!0),this.startBlock_=null,this.targetBlock_=this.flyout_.createBlock(this.targetBlock_),this.targetBlock_.select(),!0))},t.Gesture.prototype.updateIsDraggingBubble_=function(){return!!this.startBubble_&&(this.isDraggingBubble_=!0,this.startDraggingBubble_(),!0)},t.Gesture.prototype.updateIsDraggingBlock_=function(){return!!this.targetBlock_&&(this.flyout_?this.isDraggingBlock_=this.updateIsDraggingFromFlyout_():this.targetBlock_.isMovable()&&(this.isDraggingBlock_=!0),!!this.isDraggingBlock_&&(this.startDraggingBlock_(),!0))},t.Gesture.prototype.updateIsDraggingWorkspace_=function(){(this.flyout_?this.flyout_.isScrollable():this.startWorkspace_&&this.startWorkspace_.isDraggable())&&(this.workspaceDragger_=new t.WorkspaceDragger(this.startWorkspace_),this.isDraggingWorkspace_=!0,this.workspaceDragger_.startDrag())},t.Gesture.prototype.updateIsDragging_=function(){if(this.calledUpdateIsDragging_)throw Error("updateIsDragging_ should only be called once per gesture.");this.calledUpdateIsDragging_=!0,this.updateIsDraggingBubble_()||this.updateIsDraggingBlock_()||this.updateIsDraggingWorkspace_()},t.Gesture.prototype.startDraggingBlock_=function(){this.blockDragger_=new(t.registry.getClassFromOptions(t.registry.Type.BLOCK_DRAGGER,this.creatorWorkspace_.options,!0))(this.targetBlock_,this.startWorkspace_),this.blockDragger_.startDrag(this.currentDragDeltaXY_,this.healStack_),this.blockDragger_.drag(this.mostRecentEvent_,this.currentDragDeltaXY_)},t.Gesture.prototype.startDraggingBubble_=function(){this.bubbleDragger_=new t.BubbleDragger(this.startBubble_,this.startWorkspace_),this.bubbleDragger_.startBubbleDrag(),this.bubbleDragger_.dragBubble(this.mostRecentEvent_,this.currentDragDeltaXY_)},t.Gesture.prototype.doStart=function(e){t.utils.isTargetInput(e)?this.cancel():(this.hasStarted_=!0,t.blockAnimations.disconnectUiStop(),this.startWorkspace_.updateScreenCalculationsIfScrolled(),this.startWorkspace_.isMutator&&this.startWorkspace_.resize(),t.hideChaff(!!this.flyout_),this.startWorkspace_.markFocused(),this.mostRecentEvent_=e,t.Tooltip.block(),this.targetBlock_&&this.targetBlock_.select(),t.utils.isRightButton(e)?this.handleRightClick(e):("touchstart"!=e.type.toLowerCase()&&"pointerdown"!=e.type.toLowerCase()||"mouse"==e.pointerType||t.longStart(e,this),this.mouseDownXY_=new t.utils.Coordinate(e.clientX,e.clientY),this.healStack_=e.altKey||e.ctrlKey||e.metaKey,this.bindMouseEvents(e)))},t.Gesture.prototype.bindMouseEvents=function(e){this.onMoveWrapper_=t.browserEvents.conditionalBind(document,"mousemove",null,this.handleMove.bind(this)),this.onUpWrapper_=t.browserEvents.conditionalBind(document,"mouseup",null,this.handleUp.bind(this)),e.preventDefault(),e.stopPropagation()},t.Gesture.prototype.handleMove=function(t){this.updateFromEvent_(t),this.isDraggingWorkspace_?this.workspaceDragger_.drag(this.currentDragDeltaXY_):this.isDraggingBlock_?this.blockDragger_.drag(this.mostRecentEvent_,this.currentDragDeltaXY_):this.isDraggingBubble_&&this.bubbleDragger_.dragBubble(this.mostRecentEvent_,this.currentDragDeltaXY_),t.preventDefault(),t.stopPropagation()},t.Gesture.prototype.handleUp=function(e){this.updateFromEvent_(e),t.longStop_(),this.isEnding_?console.log("Trying to end a gesture recursively."):(this.isEnding_=!0,this.isDraggingBubble_?this.bubbleDragger_.endBubbleDrag(e,this.currentDragDeltaXY_):this.isDraggingBlock_?this.blockDragger_.endDrag(e,this.currentDragDeltaXY_):this.isDraggingWorkspace_?this.workspaceDragger_.endDrag(this.currentDragDeltaXY_):this.isBubbleClick_()?this.doBubbleClick_():this.isFieldClick_()?this.doFieldClick_():this.isBlockClick_()?this.doBlockClick_():this.isWorkspaceClick_()&&this.doWorkspaceClick_(e),e.preventDefault(),e.stopPropagation(),this.dispose())},t.Gesture.prototype.cancel=function(){this.isEnding_||(t.longStop_(),this.isDraggingBubble_?this.bubbleDragger_.endBubbleDrag(this.mostRecentEvent_,this.currentDragDeltaXY_):this.isDraggingBlock_?this.blockDragger_.endDrag(this.mostRecentEvent_,this.currentDragDeltaXY_):this.isDraggingWorkspace_&&this.workspaceDragger_.endDrag(this.currentDragDeltaXY_),this.dispose())},t.Gesture.prototype.handleRightClick=function(e){this.targetBlock_?(this.bringBlockToFront_(),t.hideChaff(!!this.flyout_),this.targetBlock_.showContextMenu(e)):this.startBubble_?this.startBubble_.showContextMenu(e):this.startWorkspace_&&!this.flyout_&&(t.hideChaff(),this.startWorkspace_.showContextMenu(e)),e.preventDefault(),e.stopPropagation(),this.dispose()},t.Gesture.prototype.handleWsStart=function(t,e){if(this.hasStarted_)throw Error("Tried to call gesture.handleWsStart, but the gesture had already been started.");this.setStartWorkspace_(e),this.mostRecentEvent_=t,this.doStart(t)},t.Gesture.prototype.fireWorkspaceClick_=function(e){t.Events.fire(new(t.Events.get(t.Events.CLICK))(null,e.id,"workspace"))},t.Gesture.prototype.handleFlyoutStart=function(t,e){if(this.hasStarted_)throw Error("Tried to call gesture.handleFlyoutStart, but the gesture had already been started.");this.setStartFlyout_(e),this.handleWsStart(t,e.getWorkspace())},t.Gesture.prototype.handleBlockStart=function(t,e){if(this.hasStarted_)throw Error("Tried to call gesture.handleBlockStart, but the gesture had already been started.");this.setStartBlock(e),this.mostRecentEvent_=t},t.Gesture.prototype.handleBubbleStart=function(t,e){if(this.hasStarted_)throw Error("Tried to call gesture.handleBubbleStart, but the gesture had already been started.");this.setStartBubble(e),this.mostRecentEvent_=t},t.Gesture.prototype.doBubbleClick_=function(){this.startBubble_.setFocus&&this.startBubble_.setFocus(),this.startBubble_.select&&this.startBubble_.select()},t.Gesture.prototype.doFieldClick_=function(){this.startField_.showEditor(this.mostRecentEvent_),this.bringBlockToFront_()},t.Gesture.prototype.doBlockClick_=function(){if(this.flyout_&&this.flyout_.autoClose)this.targetBlock_.isEnabled()&&(t.Events.getGroup()||t.Events.setGroup(!0),this.flyout_.createBlock(this.targetBlock_).scheduleSnapAndBump());else{var e=new(t.Events.get(t.Events.CLICK))(this.startBlock_,this.startWorkspace_.id,"block");t.Events.fire(e)}this.bringBlockToFront_(),t.Events.setGroup(!1)},t.Gesture.prototype.doWorkspaceClick_=function(e){e=this.creatorWorkspace_,t.selected&&t.selected.unselect(),this.fireWorkspaceClick_(this.startWorkspace_||e)},t.Gesture.prototype.bringBlockToFront_=function(){this.targetBlock_&&!this.flyout_&&this.targetBlock_.bringToFront()},t.Gesture.prototype.setStartField=function(t){if(this.hasStarted_)throw Error("Tried to call gesture.setStartField, but the gesture had already been started.");this.startField_||(this.startField_=t)},t.Gesture.prototype.setStartBubble=function(t){this.startBubble_||(this.startBubble_=t)},t.Gesture.prototype.setStartBlock=function(t){this.startBlock_||this.startBubble_||(this.startBlock_=t,t.isInFlyout&&t!=t.getRootBlock()?this.setTargetBlock_(t.getRootBlock()):this.setTargetBlock_(t))},t.Gesture.prototype.setTargetBlock_=function(t){t.isShadow()?this.setTargetBlock_(t.getParent()):this.targetBlock_=t},t.Gesture.prototype.setStartWorkspace_=function(t){this.startWorkspace_||(this.startWorkspace_=t)},t.Gesture.prototype.setStartFlyout_=function(t){this.flyout_||(this.flyout_=t)},t.Gesture.prototype.isBubbleClick_=function(){return!!this.startBubble_&&!this.hasExceededDragRadius_},t.Gesture.prototype.isBlockClick_=function(){return!!this.startBlock_&&!this.hasExceededDragRadius_&&!this.isFieldClick_()},t.Gesture.prototype.isFieldClick_=function(){return!!this.startField_&&this.startField_.isClickable()&&!this.hasExceededDragRadius_&&(!this.flyout_||!this.flyout_.autoClose)},t.Gesture.prototype.isWorkspaceClick_=function(){return!(this.startBlock_||this.startBubble_||this.startField_||this.hasExceededDragRadius_)},t.Gesture.prototype.isDragging=function(){return this.isDraggingWorkspace_||this.isDraggingBlock_||this.isDraggingBubble_},t.Gesture.prototype.hasStarted=function(){return this.hasStarted_},t.Gesture.prototype.getInsertionMarkers=function(){return this.blockDragger_?this.blockDragger_.getInsertionMarkers():[]},t.Gesture.prototype.getCurrentDragger=function(){return this.isDraggingBlock_?this.blockDragger_:this.isDraggingWorkspace_?this.workspaceDragger_:this.isDraggingBubble_?this.bubbleDragger_:null},t.Gesture.inProgress=function(){for(var e,n=t.Workspace.getAll(),r=0;e=n[r];r++)if(e.currentGesture_)return!0;return!1},t.IRegistrable=function(){},t.Marker=function(){this.drawer_=this.curNode_=this.colour=null,this.type="marker"},t.Marker.prototype.setDrawer=function(t){this.drawer_=t},t.Marker.prototype.getDrawer=function(){return this.drawer_},t.Marker.prototype.getCurNode=function(){return this.curNode_},t.Marker.prototype.setCurNode=function(t){var e=this.curNode_;this.curNode_=t,this.drawer_&&this.drawer_.draw(e,this.curNode_)},t.Marker.prototype.draw=function(){this.drawer_&&this.drawer_.draw(this.curNode_,this.curNode_)},t.Marker.prototype.hide=function(){this.drawer_&&this.drawer_.hide()},t.Marker.prototype.dispose=function(){this.getDrawer()&&this.getDrawer().dispose()},t.Cursor=function(){t.Cursor.superClass_.constructor.call(this),this.type="cursor"},t.utils.object.inherits(t.Cursor,t.Marker),t.Cursor.prototype.next=function(){var e=this.getCurNode();if(!e)return null;for(e=e.next();e&&e.next()&&(e.getType()==t.ASTNode.types.NEXT||e.getType()==t.ASTNode.types.BLOCK);)e=e.next();return e&&this.setCurNode(e),e},t.Cursor.prototype.in=function(){var e=this.getCurNode();return e?(e.getType()!=t.ASTNode.types.PREVIOUS&&e.getType()!=t.ASTNode.types.OUTPUT||(e=e.next()),(e=e.in())&&this.setCurNode(e),e):null},t.Cursor.prototype.prev=function(){var e=this.getCurNode();if(!e)return null;for(e=e.prev();e&&e.prev()&&(e.getType()==t.ASTNode.types.NEXT||e.getType()==t.ASTNode.types.BLOCK);)e=e.prev();return e&&this.setCurNode(e),e},t.Cursor.prototype.out=function(){var e=this.getCurNode();return e?((e=e.out())&&e.getType()==t.ASTNode.types.BLOCK&&(e=e.prev()||e),e&&this.setCurNode(e),e):null},t.registry.register(t.registry.Type.CURSOR,t.registry.DEFAULT,t.Cursor),t.MarkerManager=function(t){this.cursorSvg_=this.cursor_=null,this.markers_=Object.create(null),this.workspace_=t},t.MarkerManager.LOCAL_MARKER="local_marker_1",t.MarkerManager.prototype.registerMarker=function(t,e){this.markers_[t]&&this.unregisterMarker(t),e.setDrawer(this.workspace_.getRenderer().makeMarkerDrawer(this.workspace_,e)),this.setMarkerSvg(e.getDrawer().createDom()),this.markers_[t]=e},t.MarkerManager.prototype.unregisterMarker=function(t){var e=this.markers_[t];if(!e)throw Error("Marker with ID "+t+" does not exist. Can only unregister markers that exist.");e.dispose(),delete this.markers_[t]},t.MarkerManager.prototype.getCursor=function(){return this.cursor_},t.MarkerManager.prototype.getMarker=function(t){return this.markers_[t]||null},t.MarkerManager.prototype.setCursor=function(t){this.cursor_&&this.cursor_.getDrawer()&&this.cursor_.getDrawer().dispose(),(this.cursor_=t)&&(t=this.workspace_.getRenderer().makeMarkerDrawer(this.workspace_,this.cursor_),this.cursor_.setDrawer(t),this.setCursorSvg(this.cursor_.getDrawer().createDom()))},t.MarkerManager.prototype.setCursorSvg=function(t){t?(this.workspace_.getBlockCanvas().appendChild(t),this.cursorSvg_=t):this.cursorSvg_=null},t.MarkerManager.prototype.setMarkerSvg=function(t){t?this.workspace_.getBlockCanvas()&&(this.cursorSvg_?this.workspace_.getBlockCanvas().insertBefore(t,this.cursorSvg_):this.workspace_.getBlockCanvas().appendChild(t)):this.markerSvg_=null},t.MarkerManager.prototype.updateMarkers=function(){this.workspace_.keyboardAccessibilityMode&&this.cursorSvg_&&this.workspace_.getCursor().draw()},t.MarkerManager.prototype.dispose=function(){for(var t,e=Object.keys(this.markers_),n=0;t=e[n];n++)this.unregisterMarker(t);this.markers_=null,this.cursor_&&(this.cursor_.dispose(),this.cursor_=null)},t.WidgetDiv={},t.WidgetDiv.owner_=null,t.WidgetDiv.dispose_=null,t.WidgetDiv.rendererClassName_="",t.WidgetDiv.themeClassName_="",t.WidgetDiv.createDom=function(){t.WidgetDiv.DIV||(t.WidgetDiv.DIV=document.createElement("div"),t.WidgetDiv.DIV.className="blocklyWidgetDiv",(t.parentContainer||document.body).appendChild(t.WidgetDiv.DIV))},t.WidgetDiv.show=function(e,n,r){t.WidgetDiv.hide(),t.WidgetDiv.owner_=e,t.WidgetDiv.dispose_=r,(e=t.WidgetDiv.DIV).style.direction=n?"rtl":"ltr",e.style.display="block",n=t.getMainWorkspace(),t.WidgetDiv.rendererClassName_=n.getRenderer().getClassName(),t.WidgetDiv.themeClassName_=n.getTheme().getClassName(),t.utils.dom.addClass(e,t.WidgetDiv.rendererClassName_),t.utils.dom.addClass(e,t.WidgetDiv.themeClassName_)},t.WidgetDiv.hide=function(){if(t.WidgetDiv.isVisible()){t.WidgetDiv.owner_=null;var e=t.WidgetDiv.DIV;e.style.display="none",e.style.left="",e.style.top="",t.WidgetDiv.dispose_&&t.WidgetDiv.dispose_(),t.WidgetDiv.dispose_=null,e.textContent="",t.WidgetDiv.rendererClassName_&&(t.utils.dom.removeClass(e,t.WidgetDiv.rendererClassName_),t.WidgetDiv.rendererClassName_=""),t.WidgetDiv.themeClassName_&&(t.utils.dom.removeClass(e,t.WidgetDiv.themeClassName_),t.WidgetDiv.themeClassName_=""),t.getMainWorkspace().markFocused()}},t.WidgetDiv.isVisible=function(){return!!t.WidgetDiv.owner_},t.WidgetDiv.hideIfOwner=function(e){t.WidgetDiv.owner_==e&&t.WidgetDiv.hide()},t.WidgetDiv.positionInternal_=function(e,n,r){t.WidgetDiv.DIV.style.left=e+"px",t.WidgetDiv.DIV.style.top=n+"px",t.WidgetDiv.DIV.style.height=r+"px"},t.WidgetDiv.positionWithAnchor=function(e,n,r,i){var o=t.WidgetDiv.calculateY_(e,n,r);e=t.WidgetDiv.calculateX_(e,n,r,i),0>o?t.WidgetDiv.positionInternal_(e,0,r.height+o):t.WidgetDiv.positionInternal_(e,o,r.height)},t.WidgetDiv.calculateX_=function(t,e,n,r){return r?(e=Math.max(e.right-n.width,t.left),Math.min(e,t.right-n.width)):(e=Math.min(e.left,t.right-n.width),Math.max(e,t.left))},t.WidgetDiv.calculateY_=function(t,e,n){return e.bottom+n.height>=t.bottom?e.top-n.height:e.bottom},t.Field=function(e,n,r){this.value_=this.DEFAULT_VALUE,this.tooltip_=this.validator_=null,this.size_=new t.utils.Size(0,0),this.constants_=this.mouseDownWrapper_=this.textContent_=this.textElement_=this.borderRect_=this.fieldGroup_=this.markerSvg_=this.cursorSvg_=null,r&&this.configure_(r),this.setValue(e),n&&this.setValidator(n)},t.Field.prototype.DEFAULT_VALUE=null,t.Field.prototype.name=void 0,t.Field.prototype.disposed=!1,t.Field.prototype.maxDisplayLength=50,t.Field.prototype.sourceBlock_=null,t.Field.prototype.isDirty_=!0,t.Field.prototype.visible_=!0,t.Field.prototype.clickTarget_=null,t.Field.NBSP=" ",t.Field.prototype.EDITABLE=!0,t.Field.prototype.SERIALIZABLE=!1,t.Field.prototype.configure_=function(e){var n=e.tooltip;"string"==typeof n&&(n=t.utils.replaceMessageReferences(e.tooltip)),n&&this.setTooltip(n)},t.Field.prototype.setSourceBlock=function(t){if(this.sourceBlock_)throw Error("Field already bound to a block.");this.sourceBlock_=t},t.Field.prototype.getConstants=function(){return!this.constants_&&this.sourceBlock_&&this.sourceBlock_.workspace&&this.sourceBlock_.workspace.rendered&&(this.constants_=this.sourceBlock_.workspace.getRenderer().getConstants()),this.constants_},t.Field.prototype.getSourceBlock=function(){return this.sourceBlock_},t.Field.prototype.init=function(){this.fieldGroup_||(this.fieldGroup_=t.utils.dom.createSvgElement(t.utils.Svg.G,{},null),this.isVisible()||(this.fieldGroup_.style.display="none"),this.sourceBlock_.getSvgRoot().appendChild(this.fieldGroup_),this.initView(),this.updateEditable(),this.setTooltip(this.tooltip_),this.bindEvents_(),this.initModel())},t.Field.prototype.initView=function(){this.createBorderRect_(),this.createTextElement_()},t.Field.prototype.initModel=function(){},t.Field.prototype.createBorderRect_=function(){this.borderRect_=t.utils.dom.createSvgElement(t.utils.Svg.RECT,{rx:this.getConstants().FIELD_BORDER_RECT_RADIUS,ry:this.getConstants().FIELD_BORDER_RECT_RADIUS,x:0,y:0,height:this.size_.height,width:this.size_.width,class:"blocklyFieldRect"},this.fieldGroup_)},t.Field.prototype.createTextElement_=function(){this.textElement_=t.utils.dom.createSvgElement(t.utils.Svg.TEXT,{class:"blocklyText"},this.fieldGroup_),this.getConstants().FIELD_TEXT_BASELINE_CENTER&&this.textElement_.setAttribute("dominant-baseline","central"),this.textContent_=document.createTextNode(""),this.textElement_.appendChild(this.textContent_)},t.Field.prototype.bindEvents_=function(){t.Tooltip.bindMouseEvents(this.getClickTarget_()),this.mouseDownWrapper_=t.browserEvents.conditionalBind(this.getClickTarget_(),"mousedown",this,this.onMouseDown_)},t.Field.prototype.fromXml=function(t){this.setValue(t.textContent)},t.Field.prototype.toXml=function(t){return t.textContent=this.getValue(),t},t.Field.prototype.dispose=function(){t.DropDownDiv.hideIfOwner(this),t.WidgetDiv.hideIfOwner(this),t.Tooltip.unbindMouseEvents(this.getClickTarget_()),this.mouseDownWrapper_&&t.browserEvents.unbind(this.mouseDownWrapper_),t.utils.dom.removeNode(this.fieldGroup_),this.disposed=!0},t.Field.prototype.updateEditable=function(){var e=this.fieldGroup_;this.EDITABLE&&e&&(this.sourceBlock_.isEditable()?(t.utils.dom.addClass(e,"blocklyEditableText"),t.utils.dom.removeClass(e,"blocklyNonEditableText"),e.style.cursor=this.CURSOR):(t.utils.dom.addClass(e,"blocklyNonEditableText"),t.utils.dom.removeClass(e,"blocklyEditableText"),e.style.cursor=""))},t.Field.prototype.isClickable=function(){return!!this.sourceBlock_&&this.sourceBlock_.isEditable()&&!!this.showEditor_&&"function"==typeof this.showEditor_},t.Field.prototype.isCurrentlyEditable=function(){return this.EDITABLE&&!!this.sourceBlock_&&this.sourceBlock_.isEditable()},t.Field.prototype.isSerializable=function(){var t=!1;return this.name&&(this.SERIALIZABLE?t=!0:this.EDITABLE&&(console.warn("Detected an editable field that was not serializable. Please define SERIALIZABLE property as true on all editable custom fields. Proceeding with serialization."),t=!0)),t},t.Field.prototype.isVisible=function(){return this.visible_},t.Field.prototype.setVisible=function(t){if(this.visible_!=t){this.visible_=t;var e=this.getSvgRoot();e&&(e.style.display=t?"block":"none")}},t.Field.prototype.setValidator=function(t){this.validator_=t},t.Field.prototype.getValidator=function(){return this.validator_},t.Field.prototype.getSvgRoot=function(){return this.fieldGroup_},t.Field.prototype.applyColour=function(){},t.Field.prototype.render_=function(){this.textContent_&&(this.textContent_.nodeValue=this.getDisplayText_()),this.updateSize_()},t.Field.prototype.showEditor=function(t){this.isClickable()&&this.showEditor_(t)},t.Field.prototype.updateSize_=function(e){var n=this.getConstants(),r=2*(e=void 0!=e?e:this.borderRect_?this.getConstants().FIELD_BORDER_RECT_X_PADDING:0),i=n.FIELD_TEXT_HEIGHT,o=0;this.textElement_&&(r+=o=t.utils.dom.getFastTextWidth(this.textElement_,n.FIELD_TEXT_FONTSIZE,n.FIELD_TEXT_FONTWEIGHT,n.FIELD_TEXT_FONTFAMILY)),this.borderRect_&&(i=Math.max(i,n.FIELD_BORDER_RECT_HEIGHT)),this.size_.height=i,this.size_.width=r,this.positionTextElement_(e,o),this.positionBorderRect_()},t.Field.prototype.positionTextElement_=function(t,e){if(this.textElement_){var n=this.getConstants(),r=this.size_.height/2;this.textElement_.setAttribute("x",this.sourceBlock_.RTL?this.size_.width-e-t:t),this.textElement_.setAttribute("y",n.FIELD_TEXT_BASELINE_CENTER?r:r-n.FIELD_TEXT_HEIGHT/2+n.FIELD_TEXT_BASELINE)}},t.Field.prototype.positionBorderRect_=function(){this.borderRect_&&(this.borderRect_.setAttribute("width",this.size_.width),this.borderRect_.setAttribute("height",this.size_.height),this.borderRect_.setAttribute("rx",this.getConstants().FIELD_BORDER_RECT_RADIUS),this.borderRect_.setAttribute("ry",this.getConstants().FIELD_BORDER_RECT_RADIUS))},t.Field.prototype.getSize=function(){return this.isVisible()?(this.isDirty_?(this.render_(),this.isDirty_=!1):this.visible_&&0==this.size_.width&&(console.warn("Deprecated use of setting size_.width to 0 to rerender a field. Set field.isDirty_ to true instead."),this.render_()),this.size_):new t.utils.Size(0,0)},t.Field.prototype.getScaledBBox=function(){if(this.borderRect_)e=this.borderRect_.getBoundingClientRect(),r=t.utils.style.getPageOffset(this.borderRect_),i=e.width,e=e.height;else{var e=this.sourceBlock_.getHeightWidth(),n=this.sourceBlock_.workspace.scale,r=this.getAbsoluteXY_(),i=e.width*n;e=e.height*n,t.utils.userAgent.GECKO?(r.x+=1.5*n,r.y+=1.5*n):t.utils.userAgent.EDGE||t.utils.userAgent.IE||(r.x-=.5*n,r.y-=.5*n),i+=1*n,e+=1*n}return new t.utils.Rect(r.y,r.y+e,r.x,r.x+i)},t.Field.prototype.getDisplayText_=function(){var e=this.getText();return e?(e.length>this.maxDisplayLength&&(e=e.substring(0,this.maxDisplayLength-2)+"…"),e=e.replace(/\s/g,t.Field.NBSP),this.sourceBlock_&&this.sourceBlock_.RTL&&(e+="‏"),e):t.Field.NBSP},t.Field.prototype.getText=function(){if(this.getText_){var t=this.getText_.call(this);if(null!==t)return String(t)}return String(this.getValue())},t.Field.prototype.markDirty=function(){this.isDirty_=!0,this.constants_=null},t.Field.prototype.forceRerender=function(){this.isDirty_=!0,this.sourceBlock_&&this.sourceBlock_.rendered&&(this.sourceBlock_.render(),this.sourceBlock_.bumpNeighbours(),this.updateMarkers_())},t.Field.prototype.setValue=function(e){if(null!==e){var n=this.doClassValidation_(e);if(!((e=this.processValidation_(e,n))instanceof Error)){if((n=this.getValidator())&&(n=n.call(this,e),(e=this.processValidation_(e,n))instanceof Error))return;if(!(n=this.sourceBlock_)||!n.disposed){var r=this.getValue();r===e?this.doValueUpdate_(e):(n&&t.Events.isEnabled()&&t.Events.fire(new(t.Events.get(t.Events.BLOCK_CHANGE))(n,"field",this.name||null,r,e)),this.doValueUpdate_(e),this.isDirty_&&this.forceRerender())}}}},t.Field.prototype.processValidation_=function(t,e){return null===e?(this.doValueInvalid_(t),this.isDirty_&&this.forceRerender(),Error()):(void 0!==e&&(t=e),t)},t.Field.prototype.getValue=function(){return this.value_},t.Field.prototype.doClassValidation_=function(t){return null===t||void 0===t?null:t},t.Field.prototype.doValueUpdate_=function(t){this.value_=t,this.isDirty_=!0},t.Field.prototype.doValueInvalid_=function(t){},t.Field.prototype.onMouseDown_=function(t){this.sourceBlock_&&this.sourceBlock_.workspace&&(t=this.sourceBlock_.workspace.getGesture(t))&&t.setStartField(this)},t.Field.prototype.setTooltip=function(t){t||""===t||(t=this.sourceBlock_);var e=this.getClickTarget_();e?e.tooltip=t:this.tooltip_=t},t.Field.prototype.getTooltip=function(){var e=this.getClickTarget_();return e?t.Tooltip.getTooltipOfObject(e):t.Tooltip.getTooltipOfObject({tooltip:this.tooltip_})},t.Field.prototype.getClickTarget_=function(){return this.clickTarget_||this.getSvgRoot()},t.Field.prototype.getAbsoluteXY_=function(){return t.utils.style.getPageOffset(this.getClickTarget_())},t.Field.prototype.referencesVariables=function(){return!1},t.Field.prototype.getParentInput=function(){for(var t=null,e=this.sourceBlock_,n=e.inputList,r=0;r<e.inputList.length;r++)for(var i=n[r],o=i.fieldRow,s=0;s<o.length;s++)if(o[s]===this){t=i;break}return t},t.Field.prototype.getFlipRtl=function(){return!1},t.Field.prototype.isTabNavigable=function(){return!1},t.Field.prototype.onShortcut=function(t){return!1},t.Field.prototype.setCursorSvg=function(t){t?(this.fieldGroup_.appendChild(t),this.cursorSvg_=t):this.cursorSvg_=null},t.Field.prototype.setMarkerSvg=function(t){t?(this.fieldGroup_.appendChild(t),this.markerSvg_=t):this.markerSvg_=null},t.Field.prototype.updateMarkers_=function(){var e=this.sourceBlock_.workspace;e.keyboardAccessibilityMode&&this.cursorSvg_&&e.getCursor().draw(),e.keyboardAccessibilityMode&&this.markerSvg_&&e.getMarker(t.MarkerManager.LOCAL_MARKER).draw()},t.FieldLabel=function(e,n,r){this.class_=null,t.FieldLabel.superClass_.constructor.call(this,e,null,r),r||(this.class_=n||null)},t.utils.object.inherits(t.FieldLabel,t.Field),t.FieldLabel.prototype.DEFAULT_VALUE="",t.FieldLabel.fromJson=function(e){var n=t.utils.replaceMessageReferences(e.text);return new t.FieldLabel(n,void 0,e)},t.FieldLabel.prototype.EDITABLE=!1,t.FieldLabel.prototype.configure_=function(e){t.FieldLabel.superClass_.configure_.call(this,e),this.class_=e.class},t.FieldLabel.prototype.initView=function(){this.createTextElement_(),this.class_&&t.utils.dom.addClass(this.textElement_,this.class_)},t.FieldLabel.prototype.doClassValidation_=function(t){return null===t||void 0===t?null:String(t)},t.FieldLabel.prototype.setClass=function(e){this.textElement_&&(this.class_&&t.utils.dom.removeClass(this.textElement_,this.class_),e&&t.utils.dom.addClass(this.textElement_,e)),this.class_=e},t.fieldRegistry.register("field_label",t.FieldLabel),t.Input=function(e,n,r,i){if(e!=t.inputTypes.DUMMY&&!n)throw Error("Value inputs and statement inputs must have non-empty name.");this.type=e,this.name=n,this.sourceBlock_=r,this.connection=i,this.fieldRow=[]},t.Input.prototype.align=t.constants.ALIGN.LEFT,t.Input.prototype.visible_=!0,t.Input.prototype.getSourceBlock=function(){return this.sourceBlock_},t.Input.prototype.appendField=function(t,e){return this.insertFieldAt(this.fieldRow.length,t,e),this},t.Input.prototype.insertFieldAt=function(e,n,r){if(0>e||e>this.fieldRow.length)throw Error("index "+e+" out of bounds.");return n||""==n&&r?("string"==typeof n&&(n=t.fieldRegistry.fromJson({type:"field_label",text:n})),n.setSourceBlock(this.sourceBlock_),this.sourceBlock_.rendered&&(n.init(),n.applyColour()),n.name=r,n.setVisible(this.isVisible()),n.prefixField&&(e=this.insertFieldAt(e,n.prefixField)),this.fieldRow.splice(e,0,n),++e,n.suffixField&&(e=this.insertFieldAt(e,n.suffixField)),this.sourceBlock_.rendered&&(this.sourceBlock_=this.sourceBlock_,this.sourceBlock_.render(),this.sourceBlock_.bumpNeighbours()),e):e},t.Input.prototype.removeField=function(t,e){for(var n,r=0;n=this.fieldRow[r];r++)if(n.name===t)return n.dispose(),this.fieldRow.splice(r,1),this.sourceBlock_.rendered&&(this.sourceBlock_=this.sourceBlock_,this.sourceBlock_.render(),this.sourceBlock_.bumpNeighbours()),!0;if(e)return!1;throw Error('Field "'+t+'" not found.')},t.Input.prototype.isVisible=function(){return this.visible_},t.Input.prototype.setVisible=function(t){var e=[];if(this.visible_==t)return e;this.visible_=t;for(var n,r=0;n=this.fieldRow[r];r++)n.setVisible(t);return this.connection&&(this.connection=this.connection,t?e=this.connection.startTrackingAll():this.connection.stopTrackingAll(),r=this.connection.targetBlock())&&(r.getSvgRoot().style.display=t?"block":"none"),e},t.Input.prototype.markDirty=function(){for(var t,e=0;t=this.fieldRow[e];e++)t.markDirty()},t.Input.prototype.setCheck=function(t){if(!this.connection)throw Error("This input does not have a connection.");return this.connection.setCheck(t),this},t.Input.prototype.setAlign=function(t){return this.align=t,this.sourceBlock_.rendered&&(this.sourceBlock_=this.sourceBlock_,this.sourceBlock_.render()),this},t.Input.prototype.setShadowDom=function(t){if(!this.connection)throw Error("This input does not have a connection.");return this.connection.setShadowDom(t),this},t.Input.prototype.getShadowDom=function(){if(!this.connection)throw Error("This input does not have a connection.");return this.connection.getShadowDom()},t.Input.prototype.init=function(){if(this.sourceBlock_.workspace.rendered)for(var t=0;t<this.fieldRow.length;t++)this.fieldRow[t].init()},t.Input.prototype.dispose=function(){for(var t,e=0;t=this.fieldRow[e];e++)t.dispose();this.connection&&this.connection.dispose(),this.sourceBlock_=null},t.Block=function(e,n,r){if(t.Generator&&void 0!==t.Generator.prototype[n])throw Error('Block prototypeName "'+n+'" conflicts with Blockly.Generator members.');if(this.id=r&&!e.getBlockById(r)?r:t.utils.genUid(),e.setBlockById(this.id,this),this.previousConnection=this.nextConnection=this.outputConnection=null,this.inputList=[],this.inputsInline=void 0,this.disabled=!1,this.tooltip="",this.contextMenu=!0,this.parentBlock_=null,this.childBlocks_=[],this.editable_=this.movable_=this.deletable_=!0,this.collapsed_=this.isShadow_=!1,this.comment=this.outputShape_=null,this.commentModel={text:null,pinned:!1,size:new t.utils.Size(160,80)},this.xy_=new t.utils.Coordinate(0,0),this.workspace=e,this.isInFlyout=e.isFlyout,this.isInMutator=e.isMutator,this.RTL=e.RTL,this.isInsertionMarker_=!1,this.hat=void 0,this.rendered=null,this.statementInputCount=0,n){if(this.type=n,!(r=t.Blocks[n])||"object"!=typeof r)throw TypeError("Unknown block type: "+n);t.utils.object.mixin(this,r)}e.addTopBlock(this),e.addTypedBlock(this),(e=t.Events.getGroup())||t.Events.setGroup(!0),n=t.Events.recordUndo;try{"function"==typeof this.init&&(t.Events.recordUndo=!1,this.init(),t.Events.recordUndo=n),t.Events.isEnabled()&&t.Events.fire(new(t.Events.get(t.Events.BLOCK_CREATE))(this))}finally{e||t.Events.setGroup(!1),t.Events.recordUndo=n}this.inputsInlineDefault=this.inputsInline,"function"==typeof this.onchange&&this.setOnChange(this.onchange)},t.Block.COLLAPSED_INPUT_NAME=t.constants.COLLAPSED_INPUT_NAME,t.Block.COLLAPSED_FIELD_NAME=t.constants.COLLAPSED_FIELD_NAME,t.Block.prototype.data=null,t.Block.prototype.disposed=!1,t.Block.prototype.hue_=null,t.Block.prototype.colour_="#000000",t.Block.prototype.styleName_="",t.Block.prototype.dispose=function(e){if(this.workspace){this.onchangeWrapper_&&this.workspace.removeChangeListener(this.onchangeWrapper_),this.unplug(e),t.Events.isEnabled()&&t.Events.fire(new(t.Events.get(t.Events.BLOCK_DELETE))(this)),t.Events.disable();try{this.workspace&&(this.workspace.removeTopBlock(this),this.workspace.removeTypedBlock(this),this.workspace.removeBlockById(this.id),this.workspace=null),t.selected==this&&(t.selected=null);for(var n=this.childBlocks_.length-1;0<=n;n--)this.childBlocks_[n].dispose(!1);n=0;for(var r;r=this.inputList[n];n++)r.dispose();this.inputList.length=0;var i,o=this.getConnections_(!0);for(n=0;i=o[n];n++)i.dispose()}finally{t.Events.enable(),this.disposed=!0}}},t.Block.prototype.initModel=function(){for(var t,e=0;t=this.inputList[e];e++)for(var n,r=0;n=t.fieldRow[r];r++)n.initModel&&n.initModel()},t.Block.prototype.unplug=function(t){this.outputConnection?this.unplugFromRow_(t):this.previousConnection&&this.unplugFromStack_(t)},t.Block.prototype.unplugFromRow_=function(t){var e=null;this.outputConnection.isConnected()&&(e=this.outputConnection.targetConnection,this.outputConnection.disconnect()),e&&t&&(t=this.getOnlyValueConnection_())&&t.isConnected()&&!t.targetBlock().isShadow()&&((t=t.targetConnection).disconnect(),this.workspace.connectionChecker.canConnect(t,e,!1)?e.connect(t):t.onFailedConnect(e))},t.Block.prototype.getOnlyValueConnection_=function(){for(var e=null,n=0;n<this.inputList.length;n++){var r=this.inputList[n].connection;if(r&&r.type==t.connectionTypes.INPUT_VALUE&&r.targetConnection){if(e)return null;e=r}}return e},t.Block.prototype.unplugFromStack_=function(t){var e=null;this.previousConnection.isConnected()&&(e=this.previousConnection.targetConnection,this.previousConnection.disconnect());var n=this.getNextBlock();t&&n&&!n.isShadow()&&((t=this.nextConnection.targetConnection).disconnect(),e&&this.workspace.connectionChecker.canConnect(e,t,!1)&&e.connect(t))},t.Block.prototype.getConnections_=function(t){t=[],this.outputConnection&&t.push(this.outputConnection),this.previousConnection&&t.push(this.previousConnection),this.nextConnection&&t.push(this.nextConnection);for(var e,n=0;e=this.inputList[n];n++)e.connection&&t.push(e.connection);return t},t.Block.prototype.lastConnectionInStack=function(t){for(var e=this.nextConnection;e;){var n=e.targetBlock();if(!n||t&&n.isShadow())return e;e=n.nextConnection}return null},t.Block.prototype.bumpNeighbours=function(){},t.Block.prototype.getParent=function(){return this.parentBlock_},t.Block.prototype.getInputWithBlock=function(t){for(var e,n=0;e=this.inputList[n];n++)if(e.connection&&e.connection.targetBlock()==t)return e;return null},t.Block.prototype.getSurroundParent=function(){var t=this;do{var e=t;if(!(t=t.getParent()))return null}while(t.getNextBlock()==e);return t},t.Block.prototype.getNextBlock=function(){return this.nextConnection&&this.nextConnection.targetBlock()},t.Block.prototype.getPreviousBlock=function(){return this.previousConnection&&this.previousConnection.targetBlock()},t.Block.prototype.getFirstStatementConnection=function(){for(var e,n=0;e=this.inputList[n];n++)if(e.connection&&e.connection.type==t.connectionTypes.NEXT_STATEMENT)return e.connection;return null},t.Block.prototype.getRootBlock=function(){var t=this;do{var e=t;t=e.parentBlock_}while(t);return e},t.Block.prototype.getTopStackBlock=function(){var t=this;do{var e=t.getPreviousBlock()}while(e&&e.getNextBlock()==t&&(t=e));return t},t.Block.prototype.getChildren=function(t){if(!t)return this.childBlocks_;t=[];for(var e,n=0;e=this.inputList[n];n++)e.connection&&(e=e.connection.targetBlock())&&t.push(e);return(n=this.getNextBlock())&&t.push(n),t},t.Block.prototype.setParent=function(e){if(e!=this.parentBlock_){if(this.parentBlock_){if(t.utils.arrayRemove(this.parentBlock_.childBlocks_,this),this.previousConnection&&this.previousConnection.isConnected())throw Error("Still connected to previous block.");if(this.outputConnection&&this.outputConnection.isConnected())throw Error("Still connected to parent block.");this.parentBlock_=null}else this.workspace.removeTopBlock(this);(this.parentBlock_=e)?e.childBlocks_.push(this):this.workspace.addTopBlock(this)}},t.Block.prototype.getDescendants=function(t){for(var e,n=[this],r=this.getChildren(t),i=0;e=r[i];i++)n.push.apply(n,e.getDescendants(t));return n},t.Block.prototype.isDeletable=function(){return this.deletable_&&!this.isShadow_&&!(this.workspace&&this.workspace.options.readOnly)},t.Block.prototype.setDeletable=function(t){this.deletable_=t},t.Block.prototype.isMovable=function(){return this.movable_&&!this.isShadow_&&!(this.workspace&&this.workspace.options.readOnly)},t.Block.prototype.setMovable=function(t){this.movable_=t},t.Block.prototype.isDuplicatable=function(){return!this.workspace.hasBlockLimits()||this.workspace.isCapacityAvailable(t.utils.getBlockTypeCounts(this,!0))},t.Block.prototype.isShadow=function(){return this.isShadow_},t.Block.prototype.setShadow=function(t){this.isShadow_=t},t.Block.prototype.isInsertionMarker=function(){return this.isInsertionMarker_},t.Block.prototype.setInsertionMarker=function(t){this.isInsertionMarker_=t},t.Block.prototype.isEditable=function(){return this.editable_&&!(this.workspace&&this.workspace.options.readOnly)},t.Block.prototype.setEditable=function(t){this.editable_=t,t=0;for(var e;e=this.inputList[t];t++)for(var n,r=0;n=e.fieldRow[r];r++)n.updateEditable()},t.Block.prototype.isDisposed=function(){return this.disposed},t.Block.prototype.getMatchingConnection=function(t,e){var n=this.getConnections_(!0);if(t=t.getConnections_(!0),n.length!=t.length)throw Error("Connection lists did not match in length.");for(var r=0;r<t.length;r++)if(t[r]==e)return n[r];return null},t.Block.prototype.setHelpUrl=function(t){this.helpUrl=t},t.Block.prototype.setTooltip=function(t){this.tooltip=t},t.Block.prototype.getTooltip=function(){return t.Tooltip.getTooltipOfObject(this)},t.Block.prototype.getColour=function(){return this.colour_},t.Block.prototype.getStyleName=function(){return this.styleName_},t.Block.prototype.getHue=function(){return this.hue_},t.Block.prototype.setColour=function(e){e=t.utils.parseBlockColour(e),this.hue_=e.hue,this.colour_=e.hex},t.Block.prototype.setStyle=function(t){this.styleName_=t},t.Block.prototype.setOnChange=function(t){if(t&&"function"!=typeof t)throw Error("onchange must be a function.");this.onchangeWrapper_&&this.workspace.removeChangeListener(this.onchangeWrapper_),(this.onchange=t)&&(this.onchangeWrapper_=t.bind(this),this.workspace.addChangeListener(this.onchangeWrapper_))},t.Block.prototype.getField=function(t){if("string"!=typeof t)throw TypeError("Blockly.Block.prototype.getField expects a string with the field name but received "+(void 0===t?"nothing":t+" of type "+typeof t)+" instead");for(var e,n=0;e=this.inputList[n];n++)for(var r,i=0;r=e.fieldRow[i];i++)if(r.name===t)return r;return null},t.Block.prototype.getVars=function(){for(var t,e=[],n=0;t=this.inputList[n];n++)for(var r,i=0;r=t.fieldRow[i];i++)r.referencesVariables()&&e.push(r.getValue());return e},t.Block.prototype.getVarModels=function(){for(var t,e=[],n=0;t=this.inputList[n];n++)for(var r,i=0;r=t.fieldRow[i];i++)r.referencesVariables()&&(r=this.workspace.getVariableById(r.getValue()))&&e.push(r);return e},t.Block.prototype.updateVarName=function(t){for(var e,n=0;e=this.inputList[n];n++)for(var r,i=0;r=e.fieldRow[i];i++)r.referencesVariables()&&t.getId()==r.getValue()&&r.refreshVariableName()},t.Block.prototype.renameVarById=function(t,e){for(var n,r=0;n=this.inputList[r];r++)for(var i,o=0;i=n.fieldRow[o];o++)i.referencesVariables()&&t==i.getValue()&&i.setValue(e)},t.Block.prototype.getFieldValue=function(t){return(t=this.getField(t))?t.getValue():null},t.Block.prototype.setFieldValue=function(t,e){var n=this.getField(e);if(!n)throw Error('Field "'+e+'" not found.');n.setValue(t)},t.Block.prototype.setPreviousStatement=function(e,n){if(e){if(void 0===n&&(n=null),!this.previousConnection){if(this.outputConnection)throw Error("Remove output connection prior to adding previous connection.");this.previousConnection=this.makeConnection_(t.connectionTypes.PREVIOUS_STATEMENT)}this.previousConnection.setCheck(n)}else if(this.previousConnection){if(this.previousConnection.isConnected())throw Error("Must disconnect previous statement before removing connection.");this.previousConnection.dispose(),this.previousConnection=null}},t.Block.prototype.setNextStatement=function(e,n){if(e)void 0===n&&(n=null),this.nextConnection||(this.nextConnection=this.makeConnection_(t.connectionTypes.NEXT_STATEMENT)),this.nextConnection.setCheck(n);else if(this.nextConnection){if(this.nextConnection.isConnected())throw Error("Must disconnect next statement before removing connection.");this.nextConnection.dispose(),this.nextConnection=null}},t.Block.prototype.setOutput=function(e,n){if(e){if(void 0===n&&(n=null),!this.outputConnection){if(this.previousConnection)throw Error("Remove previous connection prior to adding output connection.");this.outputConnection=this.makeConnection_(t.connectionTypes.OUTPUT_VALUE)}this.outputConnection.setCheck(n)}else if(this.outputConnection){if(this.outputConnection.isConnected())throw Error("Must disconnect output value before removing connection.");this.outputConnection.dispose(),this.outputConnection=null}},t.Block.prototype.setInputsInline=function(e){this.inputsInline!=e&&(t.Events.fire(new(t.Events.get(t.Events.BLOCK_CHANGE))(this,"inline",null,this.inputsInline,e)),this.inputsInline=e)},t.Block.prototype.getInputsInline=function(){if(void 0!=this.inputsInline)return this.inputsInline;for(var e=1;e<this.inputList.length;e++)if(this.inputList[e-1].type==t.inputTypes.DUMMY&&this.inputList[e].type==t.inputTypes.DUMMY)return!1;for(e=1;e<this.inputList.length;e++)if(this.inputList[e-1].type==t.inputTypes.VALUE&&this.inputList[e].type==t.inputTypes.DUMMY)return!0;return!1},t.Block.prototype.setOutputShape=function(t){this.outputShape_=t},t.Block.prototype.getOutputShape=function(){return this.outputShape_},t.Block.prototype.isEnabled=function(){return!this.disabled},t.Block.prototype.setEnabled=function(e){this.isEnabled()!=e&&(t.Events.fire(new(t.Events.get(t.Events.BLOCK_CHANGE))(this,"disabled",null,this.disabled,!e)),this.disabled=!e)},t.Block.prototype.getInheritedDisabled=function(){for(var t=this.getSurroundParent();t;){if(t.disabled)return!0;t=t.getSurroundParent()}return!1},t.Block.prototype.isCollapsed=function(){return this.collapsed_},t.Block.prototype.setCollapsed=function(e){this.collapsed_!=e&&(t.Events.fire(new(t.Events.get(t.Events.BLOCK_CHANGE))(this,"collapsed",null,this.collapsed_,e)),this.collapsed_=e)},t.Block.prototype.toString=function(e,n){function r(t){var e=t.getCheck();return!e&&t.targetConnection&&(e=t.targetConnection.getCheck()),!!e&&(-1!=e.indexOf("Boolean")||-1!=e.indexOf("Number"))}function i(){a&&a.getType()==l.getType()&&a.getLocation()==l.getLocation()&&(a=null)}var o=[];n=n||"?";var s=t.ASTNode.NAVIGATE_ALL_FIELDS;t.ASTNode.NAVIGATE_ALL_FIELDS=!0;for(var a=t.ASTNode.createBlockNode(this),l=a;a;){switch(a.getType()){case t.ASTNode.types.INPUT:var u=a.getLocation();a.in()?r(u)&&o.push("("):o.push(n);break;case t.ASTNode.types.FIELD:(u=a.getLocation()).name!=t.constants.COLLAPSED_FIELD_NAME&&o.push(u.getText())}if(!(a=(u=a).in()||u.next())){for(a=u.out(),i();a&&!a.next();)a=a.out(),i(),a&&a.getType()==t.ASTNode.types.INPUT&&r(a.getLocation())&&o.push(")");a&&(a=a.next())}}for(t.ASTNode.NAVIGATE_ALL_FIELDS=s,n=2;n<o.length;n++)"("==o[n-2]&&")"==o[n]&&(o[n-2]=o[n-1],o.splice(n-1,2));return o=(o=o.reduce(function(t,e){return t+("("==t.substr(-1)||")"==e?"":" ")+e},"")).trim()||"???",e&&o.length>e&&(o=o.substring(0,e-3)+"..."),o},t.Block.prototype.appendValueInput=function(e){return this.appendInput_(t.inputTypes.VALUE,e)},t.Block.prototype.appendStatementInput=function(e){return this.appendInput_(t.inputTypes.STATEMENT,e)},t.Block.prototype.appendDummyInput=function(e){return this.appendInput_(t.inputTypes.DUMMY,e||"")},t.Block.prototype.jsonInit=function(e){var n=e.type?'Block "'+e.type+'": ':"";if(e.output&&e.previousStatement)throw Error(n+"Must not have both an output and a previousStatement.");if(e.style&&e.style.hat&&(this.hat=e.style.hat,e.style=null),e.style&&e.colour)throw Error(n+"Must not have both a colour and a style.");e.style?this.jsonInitStyle_(e,n):this.jsonInitColour_(e,n);for(var r=0;void 0!==e["message"+r];)this.interpolate_(e["message"+r],e["args"+r]||[],e["lastDummyAlign"+r],n),r++;if(void 0!==e.inputsInline&&this.setInputsInline(e.inputsInline),void 0!==e.output&&this.setOutput(!0,e.output),void 0!==e.outputShape&&this.setOutputShape(e.outputShape),void 0!==e.previousStatement&&this.setPreviousStatement(!0,e.previousStatement),void 0!==e.nextStatement&&this.setNextStatement(!0,e.nextStatement),void 0!==e.tooltip&&(r=e.tooltip,r=t.utils.replaceMessageReferences(r),this.setTooltip(r)),void 0!==e.enableContextMenu&&(r=e.enableContextMenu,this.contextMenu=!!r),void 0!==e.helpUrl&&(r=e.helpUrl,r=t.utils.replaceMessageReferences(r),this.setHelpUrl(r)),"string"==typeof e.extensions&&(console.warn(n+"JSON attribute 'extensions' should be an array of strings. Found raw string in JSON for '"+e.type+"' block."),e.extensions=[e.extensions]),void 0!==e.mutator&&t.Extensions.apply(e.mutator,this,!0),e=e.extensions,Array.isArray(e))for(n=0;n<e.length;++n)t.Extensions.apply(e[n],this,!1)},t.Block.prototype.jsonInitColour_=function(t,e){if("colour"in t)if(void 0===t.colour)console.warn(e+"Undefined colour value.");else{t=t.colour;try{this.setColour(t)}catch(n){console.warn(e+"Illegal colour value: ",t)}}},t.Block.prototype.jsonInitStyle_=function(t,e){t=t.style;try{this.setStyle(t)}catch(n){console.warn(e+"Style does not exist: ",t)}},t.Block.prototype.mixin=function(e,n){if(void 0!==n&&"boolean"!=typeof n)throw Error("opt_disableCheck must be a boolean if provided");if(!n){for(var r in n=[],e)void 0!==this[r]&&n.push(r);if(n.length)throw Error("Mixin will overwrite block members: "+JSON.stringify(n))}t.utils.object.mixin(this,e)},t.Block.prototype.interpolate_=function(e,n,r,i){e=t.utils.tokenizeInterpolation(e),this.validateTokens_(e,n.length),n=this.interpolateArguments_(e,n,r),r=[],e=0;for(var o;o=n[e];e++)if(this.isInputKeyword_(o.type)){if(o=this.inputFromJson_(o,i)){for(var s,a=0;s=r[a];a++)o.appendField(s[0],s[1]);r.length=0}}else(a=this.fieldFromJson_(o))&&r.push([a,o.name])},t.Block.prototype.validateTokens_=function(t,e){for(var n=[],r=0,i=0;i<t.length;i++){var o=t[i];if("number"==typeof o){if(1>o||o>e)throw Error('Block "'+this.type+'": Message index %'+o+" out of range.");if(n[o])throw Error('Block "'+this.type+'": Message index %'+o+" duplicated.");n[o]=!0,r++}}if(r!=e)throw Error('Block "'+this.type+'": Message does not reference all '+e+" arg(s).")},t.Block.prototype.interpolateArguments_=function(t,e,n){for(var r=[],i=0;i<t.length;i++){var o=t[i];"number"==typeof o&&(o=e[o-1]),("string"!=typeof o||(o=this.stringToFieldJson_(o)))&&r.push(o)}return(t=r.length)&&!this.isInputKeyword_(r[t-1].type)&&(t={type:"input_dummy"},n&&(t.align=n),r.push(t)),r},t.Block.prototype.fieldFromJson_=function(e){var n=t.fieldRegistry.fromJson(e);return!n&&e.alt?"string"==typeof e.alt?(e=this.stringToFieldJson_(e.alt))?this.fieldFromJson_(e):null:this.fieldFromJson_(e.alt):n},t.Block.prototype.inputFromJson_=function(e,n){var r={LEFT:t.constants.ALIGN.LEFT,RIGHT:t.constants.ALIGN.RIGHT,CENTRE:t.constants.ALIGN.CENTRE,CENTER:t.constants.ALIGN.CENTRE},i=null;switch(e.type){case"input_value":i=this.appendValueInput(e.name);break;case"input_statement":i=this.appendStatementInput(e.name);break;case"input_dummy":i=this.appendDummyInput(e.name)}return i?(e.check&&i.setCheck(e.check),e.align&&(void 0===(r=r[e.align.toUpperCase()])?console.warn(n+"Illegal align value: ",e.align):i.setAlign(r)),i):null},t.Block.prototype.isInputKeyword_=function(t){return"input_value"==t||"input_statement"==t||"input_dummy"==t},t.Block.prototype.stringToFieldJson_=function(t){return(t=t.trim())?{type:"field_label",text:t}:null},t.Block.prototype.appendInput_=function(e,n){var r=null;return e!=t.inputTypes.VALUE&&e!=t.inputTypes.STATEMENT||(r=this.makeConnection_(e)),e==t.inputTypes.STATEMENT&&this.statementInputCount++,e=new t.Input(e,n,this,r),this.inputList.push(e),e},t.Block.prototype.moveInputBefore=function(t,e){if(t!=e){for(var n,r=-1,i=e?-1:this.inputList.length,o=0;n=this.inputList[o];o++)if(n.name==t){if(r=o,-1!=i)break}else if(e&&n.name==e&&(i=o,-1!=r))break;if(-1==r)throw Error('Named input "'+t+'" not found.');if(-1==i)throw Error('Reference input "'+e+'" not found.');this.moveNumberedInputBefore(r,i)}},t.Block.prototype.moveNumberedInputBefore=function(t,e){if(t==e)throw Error("Can't move input to itself.");if(t>=this.inputList.length)throw RangeError("Input index "+t+" out of bounds.");if(e>this.inputList.length)throw RangeError("Reference input "+e+" out of bounds.");var n=this.inputList[t];this.inputList.splice(t,1),t<e&&e--,this.inputList.splice(e,0,n)},t.Block.prototype.removeInput=function(e,n){for(var r,i=0;r=this.inputList[i];i++)if(r.name==e)return r.type==t.inputTypes.STATEMENT&&this.statementInputCount--,r.dispose(),this.inputList.splice(i,1),!0;if(n)return!1;throw Error("Input not found: "+e)},t.Block.prototype.getInput=function(t){for(var e,n=0;e=this.inputList[n];n++)if(e.name==t)return e;return null},t.Block.prototype.getInputTargetBlock=function(t){return(t=this.getInput(t))&&t.connection&&t.connection.targetBlock()},t.Block.prototype.getCommentText=function(){return this.commentModel.text},t.Block.prototype.setCommentText=function(e){this.commentModel.text!=e&&(t.Events.fire(new(t.Events.get(t.Events.BLOCK_CHANGE))(this,"comment",null,this.commentModel.text,e)),this.comment=this.commentModel.text=e)},t.Block.prototype.setWarningText=function(t,e){},t.Block.prototype.setMutator=function(t){},t.Block.prototype.getRelativeToSurfaceXY=function(){return this.xy_},t.Block.prototype.moveBy=function(e,n){if(this.parentBlock_)throw Error("Block has parent.");var r=new(t.Events.get(t.Events.BLOCK_MOVE))(this);this.xy_.translate(e,n),r.recordNew(),t.Events.fire(r)},t.Block.prototype.makeConnection_=function(e){return new t.Connection(this,e)},t.Block.prototype.allInputsFilled=function(t){if(void 0===t&&(t=!0),!t&&this.isShadow())return!1;for(var e,n=0;e=this.inputList[n];n++)if(e.connection&&(!(e=e.connection.targetBlock())||!e.allInputsFilled(t)))return!1;return!(n=this.getNextBlock())||n.allInputsFilled(t)},t.Block.prototype.toDevString=function(){var t=this.type?'"'+this.type+'" block':"Block";return this.id&&(t+=' (id="'+this.id+'")'),t},t.blockRendering.IPathObject=function(t,e){},t.utils.KeyCodes={WIN_KEY_FF_LINUX:0,MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PLUS_SIGN:43,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,FF_SEMICOLON:59,FF_EQUALS:61,FF_DASH:173,FF_HASH:163,QUESTION_MARK:63,AT_SIGN:64,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SCROLL_LOCK:145,FIRST_MEDIA_KEY:166,LAST_MEDIA_KEY:183,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,TILDE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,MAC_WK_CMD_LEFT:91,MAC_WK_CMD_RIGHT:93,WIN_IME:229,VK_NONAME:252,PHANTOM:255},t.Menu=function(){this.menuItems_=[],this.roleName_=this.element_=this.onKeyDownHandler_=this.mouseLeaveHandler_=this.mouseEnterHandler_=this.clickHandler_=this.mouseOverHandler_=this.highlightedItem_=this.openingCoords=null},t.Menu.prototype.addChild=function(t){this.menuItems_.push(t)},t.Menu.prototype.render=function(e){var n=document.createElement("div");n.className="blocklyMenu goog-menu blocklyNonSelectable",n.tabIndex=0,this.roleName_&&t.utils.aria.setRole(n,this.roleName_),this.element_=n;for(var r,i=0;r=this.menuItems_[i];i++)n.appendChild(r.createDom());this.mouseOverHandler_=t.browserEvents.conditionalBind(n,"mouseover",this,this.handleMouseOver_,!0),this.clickHandler_=t.browserEvents.conditionalBind(n,"click",this,this.handleClick_,!0),this.mouseEnterHandler_=t.browserEvents.conditionalBind(n,"mouseenter",this,this.handleMouseEnter_,!0),this.mouseLeaveHandler_=t.browserEvents.conditionalBind(n,"mouseleave",this,this.handleMouseLeave_,!0),this.onKeyDownHandler_=t.browserEvents.conditionalBind(n,"keydown",this,this.handleKeyEvent_),e.appendChild(n)},t.Menu.prototype.getElement=function(){return this.element_},t.Menu.prototype.focus=function(){var e=this.getElement();e&&(e.focus({preventScroll:!0}),t.utils.dom.addClass(e,"blocklyFocused"))},t.Menu.prototype.blur_=function(){var e=this.getElement();e&&(e.blur(),t.utils.dom.removeClass(e,"blocklyFocused"))},t.Menu.prototype.setRole=function(t){this.roleName_=t},t.Menu.prototype.dispose=function(){this.mouseOverHandler_&&(t.browserEvents.unbind(this.mouseOverHandler_),this.mouseOverHandler_=null),this.clickHandler_&&(t.browserEvents.unbind(this.clickHandler_),this.clickHandler_=null),this.mouseEnterHandler_&&(t.browserEvents.unbind(this.mouseEnterHandler_),this.mouseEnterHandler_=null),this.mouseLeaveHandler_&&(t.browserEvents.unbind(this.mouseLeaveHandler_),this.mouseLeaveHandler_=null),this.onKeyDownHandler_&&(t.browserEvents.unbind(this.onKeyDownHandler_),this.onKeyDownHandler_=null);for(var e,n=0;e=this.menuItems_[n];n++)e.dispose();this.element_=null},t.Menu.prototype.getMenuItem_=function(e){for(var n=this.getElement();e&&e!=n;){if(t.utils.dom.hasClass(e,"blocklyMenuItem"))for(var r,i=0;r=this.menuItems_[i];i++)if(r.getElement()==e)return r;e=e.parentElement}return null},t.Menu.prototype.setHighlighted=function(e){var n=this.highlightedItem_;n&&(n.setHighlighted(!1),this.highlightedItem_=null),e&&(e.setHighlighted(!0),this.highlightedItem_=e,n=this.getElement(),t.utils.style.scrollIntoContainerView(e.getElement(),n),t.utils.aria.setState(n,t.utils.aria.State.ACTIVEDESCENDANT,e.getId()))},t.Menu.prototype.highlightNext=function(){var t=this.menuItems_.indexOf(this.highlightedItem_);this.highlightHelper_(t,1)},t.Menu.prototype.highlightPrevious=function(){var t=this.menuItems_.indexOf(this.highlightedItem_);this.highlightHelper_(0>t?this.menuItems_.length:t,-1)},t.Menu.prototype.highlightFirst_=function(){this.highlightHelper_(-1,1)},t.Menu.prototype.highlightLast_=function(){this.highlightHelper_(this.menuItems_.length,-1)},t.Menu.prototype.highlightHelper_=function(t,e){t+=e;for(var n;n=this.menuItems_[t];){if(n.isEnabled()){this.setHighlighted(n);break}t+=e}},t.Menu.prototype.handleMouseOver_=function(t){(t=this.getMenuItem_(t.target))&&(t.isEnabled()?this.highlightedItem_!=t&&this.setHighlighted(t):this.setHighlighted(null))},t.Menu.prototype.handleClick_=function(e){var n=this.openingCoords;if(this.openingCoords=null,n&&"number"==typeof e.clientX){var r=new t.utils.Coordinate(e.clientX,e.clientY);if(1>t.utils.Coordinate.distance(n,r))return}(e=this.getMenuItem_(e.target))&&e.performAction()},t.Menu.prototype.handleMouseEnter_=function(t){this.focus()},t.Menu.prototype.handleMouseLeave_=function(t){this.getElement()&&(this.blur_(),this.setHighlighted(null))},t.Menu.prototype.handleKeyEvent_=function(e){if(this.menuItems_.length&&!(e.shiftKey||e.ctrlKey||e.metaKey||e.altKey)){var n=this.highlightedItem_;switch(e.keyCode){case t.utils.KeyCodes.ENTER:case t.utils.KeyCodes.SPACE:n&&n.performAction();break;case t.utils.KeyCodes.UP:this.highlightPrevious();break;case t.utils.KeyCodes.DOWN:this.highlightNext();break;case t.utils.KeyCodes.PAGE_UP:case t.utils.KeyCodes.HOME:this.highlightFirst_();break;case t.utils.KeyCodes.PAGE_DOWN:case t.utils.KeyCodes.END:this.highlightLast_();break;default:return}e.preventDefault(),e.stopPropagation()}},t.Menu.prototype.getSize=function(){var e=this.getElement(),n=t.utils.style.getSize(e);return n.height=e.scrollHeight,n},t.MenuItem=function(t,e){this.content_=t,this.value_=e,this.enabled_=!0,this.element_=null,this.rightToLeft_=!1,this.roleName_=null,this.highlight_=this.checked_=this.checkable_=!1,this.actionHandler_=null},t.MenuItem.prototype.createDom=function(){var e=document.createElement("div");e.id=t.utils.IdGenerator.getNextUniqueId(),this.element_=e,e.className="blocklyMenuItem goog-menuitem "+(this.enabled_?"":"blocklyMenuItemDisabled goog-menuitem-disabled ")+(this.checked_?"blocklyMenuItemSelected goog-option-selected ":"")+(this.highlight_?"blocklyMenuItemHighlight goog-menuitem-highlight ":"")+(this.rightToLeft_?"blocklyMenuItemRtl goog-menuitem-rtl ":"");var n=document.createElement("div");if(n.className="blocklyMenuItemContent goog-menuitem-content",this.checkable_){var r=document.createElement("div");r.className="blocklyMenuItemCheckbox goog-menuitem-checkbox",n.appendChild(r)}return r=this.content_,"string"==typeof this.content_&&(r=document.createTextNode(this.content_)),n.appendChild(r),e.appendChild(n),this.roleName_&&t.utils.aria.setRole(e,this.roleName_),t.utils.aria.setState(e,t.utils.aria.State.SELECTED,this.checkable_&&this.checked_||!1),t.utils.aria.setState(e,t.utils.aria.State.DISABLED,!this.enabled_),e},t.MenuItem.prototype.dispose=function(){this.element_=null},t.MenuItem.prototype.getElement=function(){return this.element_},t.MenuItem.prototype.getId=function(){return this.element_.id},t.MenuItem.prototype.getValue=function(){return this.value_},t.MenuItem.prototype.setRightToLeft=function(t){this.rightToLeft_=t},t.MenuItem.prototype.setRole=function(t){this.roleName_=t},t.MenuItem.prototype.setCheckable=function(t){this.checkable_=t},t.MenuItem.prototype.setChecked=function(t){this.checked_=t},t.MenuItem.prototype.setHighlighted=function(e){this.highlight_=e;var n=this.getElement();n&&this.isEnabled()&&(e?(t.utils.dom.addClass(n,"blocklyMenuItemHighlight"),t.utils.dom.addClass(n,"goog-menuitem-highlight")):(t.utils.dom.removeClass(n,"blocklyMenuItemHighlight"),t.utils.dom.removeClass(n,"goog-menuitem-highlight")))},t.MenuItem.prototype.isEnabled=function(){return this.enabled_},t.MenuItem.prototype.setEnabled=function(t){this.enabled_=t},t.MenuItem.prototype.performAction=function(){this.isEnabled()&&this.actionHandler_&&this.actionHandler_(this)},t.MenuItem.prototype.onAction=function(t,e){this.actionHandler_=t.bind(e)},t.ContextMenu={},t.ContextMenu.currentBlock=null,t.ContextMenu.menu_=null,t.ContextMenu.show=function(e,n,r){if(t.WidgetDiv.show(t.ContextMenu,r,t.ContextMenu.dispose),n.length){var i=t.ContextMenu.populate_(n,r);t.ContextMenu.menu_=i,t.ContextMenu.position_(i,e,r),setTimeout(function(){i.focus()},1),t.ContextMenu.currentBlock=null}else t.ContextMenu.hide()},t.ContextMenu.populate_=function(e,n){var r=new t.Menu;r.setRole(t.utils.aria.Role.MENU);for(var i,o=0;i=e[o];o++){var s=new t.MenuItem(i.text);s.setRightToLeft(n),s.setRole(t.utils.aria.Role.MENUITEM),r.addChild(s),s.setEnabled(i.enabled),i.enabled&&s.onAction(function(e){t.ContextMenu.hide(),this.callback(this.scope)},i)}return r},t.ContextMenu.position_=function(e,n,r){var i=t.utils.getViewportBBox();n=new t.utils.Rect(n.clientY+i.top,n.clientY+i.top,n.clientX+i.left,n.clientX+i.left),t.ContextMenu.createWidget_(e);var o=e.getSize();r&&(n.left+=o.width,n.right+=o.width,i.left+=o.width,i.right+=o.width),t.WidgetDiv.positionWithAnchor(i,n,o,r),e.focus()},t.ContextMenu.createWidget_=function(e){e.render(t.WidgetDiv.DIV);var n=e.getElement();t.utils.dom.addClass(n,"blocklyContextMenu"),t.browserEvents.conditionalBind(n,"contextmenu",null,t.utils.noEvent),e.focus()},t.ContextMenu.hide=function(){t.WidgetDiv.hideIfOwner(t.ContextMenu),t.ContextMenu.currentBlock=null},t.ContextMenu.dispose=function(){t.ContextMenu.menu_&&(t.ContextMenu.menu_.dispose(),t.ContextMenu.menu_=null)},t.ContextMenu.callbackFactory=function(e,n){return function(){t.Events.disable();try{var r=t.Xml.domToBlock(n,e.workspace),i=e.getRelativeToSurfaceXY();i.x=e.RTL?i.x-t.SNAP_RADIUS:i.x+t.SNAP_RADIUS,i.y+=2*t.SNAP_RADIUS,r.moveBy(i.x,i.y)}finally{t.Events.enable()}t.Events.isEnabled()&&!r.isShadow()&&t.Events.fire(new(t.Events.get(t.Events.BLOCK_CREATE))(r)),r.select()}},t.ContextMenu.commentDeleteOption=function(e){return{text:t.Msg.REMOVE_COMMENT,enabled:!0,callback:function(){t.Events.setGroup(!0),e.dispose(!0,!0),t.Events.setGroup(!1)}}},t.ContextMenu.commentDuplicateOption=function(e){return{text:t.Msg.DUPLICATE_COMMENT,enabled:!0,callback:function(){t.duplicate(e)}}},t.ContextMenu.workspaceCommentOption=function(e,n){if(!t.WorkspaceCommentSvg)throw Error("Missing require for Blockly.WorkspaceCommentSvg");var r={enabled:!t.utils.userAgent.IE};return r.text=t.Msg.ADD_COMMENT,r.callback=function(){var r=new t.WorkspaceCommentSvg(e,t.Msg.WORKSPACE_COMMENT_DEFAULT_TEXT,t.WorkspaceCommentSvg.DEFAULT_SIZE,t.WorkspaceCommentSvg.DEFAULT_SIZE),i=e.getInjectionDiv().getBoundingClientRect();i=new t.utils.Coordinate(n.clientX-i.left,n.clientY-i.top);var o=e.getOriginOffsetInPixels();(i=t.utils.Coordinate.difference(i,o)).scale(1/e.scale),r.moveBy(i.x,i.y),e.rendered&&(r.initSvg(),r.render(),r.select())},r},t.ContextMenuRegistry=function(){t.ContextMenuRegistry.registry=this,this.registry_=Object.create(null)},t.ContextMenuRegistry.ScopeType={BLOCK:"block",WORKSPACE:"workspace"},t.ContextMenuRegistry.registry=null,t.ContextMenuRegistry.prototype.register=function(t){if(this.registry_[t.id])throw Error('Menu item with ID "'+t.id+'" is already registered.');this.registry_[t.id]=t},t.ContextMenuRegistry.prototype.unregister=function(t){if(!this.registry_[t])throw Error('Menu item with ID "'+t+'" not found.');delete this.registry_[t]},t.ContextMenuRegistry.prototype.getItem=function(t){return this.registry_[t]||null},t.ContextMenuRegistry.prototype.getContextMenuOptions=function(t,e){var n=[],r=this.registry_;return Object.keys(r).forEach(function(i){if(i=r[i],t==i.scopeType){var o=i.preconditionFn(e);"hidden"!=o&&(i={text:"function"==typeof i.displayText?i.displayText(e):i.displayText,enabled:"enabled"==o,callback:i.callback,scope:e,weight:i.weight},n.push(i))}}),n.sort(function(t,e){return t.weight-e.weight}),n},new t.ContextMenuRegistry,t.Events.Selected=function(e,n,r){t.Events.Selected.superClass_.constructor.call(this,r),this.oldElementId=e,this.newElementId=n},t.utils.object.inherits(t.Events.Selected,t.Events.UiBase),t.Events.Selected.prototype.type=t.Events.SELECTED,t.Events.Selected.prototype.toJson=function(){var e=t.Events.Selected.superClass_.toJson.call(this);return e.oldElementId=this.oldElementId,e.newElementId=this.newElementId,e},t.Events.Selected.prototype.fromJson=function(e){t.Events.Selected.superClass_.fromJson.call(this,e),this.oldElementId=e.oldElementId,this.newElementId=e.newElementId},t.registry.register(t.registry.Type.EVENT,t.Events.SELECTED,t.Events.Selected),t.IBoundedElement=function(){},t.ICopyable=function(){},t.RenderedConnection=function(e,n){t.RenderedConnection.superClass_.constructor.call(this,e,n),this.db_=e.workspace.connectionDBList[n],this.dbOpposite_=e.workspace.connectionDBList[t.OPPOSITE_TYPE[n]],this.offsetInBlock_=new t.utils.Coordinate(0,0),this.trackedState_=t.RenderedConnection.TrackedState.WILL_TRACK,this.targetConnection=null},t.utils.object.inherits(t.RenderedConnection,t.Connection),t.RenderedConnection.TrackedState={WILL_TRACK:-1,UNTRACKED:0,TRACKED:1},t.RenderedConnection.prototype.dispose=function(){t.RenderedConnection.superClass_.dispose.call(this),this.trackedState_==t.RenderedConnection.TrackedState.TRACKED&&this.db_.removeConnection(this,this.y)},t.RenderedConnection.prototype.getSourceBlock=function(){return t.RenderedConnection.superClass_.getSourceBlock.call(this)},t.RenderedConnection.prototype.targetBlock=function(){return t.RenderedConnection.superClass_.targetBlock.call(this)},t.RenderedConnection.prototype.distanceFrom=function(t){var e=this.x-t.x;return t=this.y-t.y,Math.sqrt(e*e+t*t)},t.RenderedConnection.prototype.bumpAwayFrom=function(e){if(!this.sourceBlock_.workspace.isDragging()){var n=this.sourceBlock_.getRootBlock();if(!n.isInFlyout){var r=!1;if(!n.isMovable()){if(!(n=e.getSourceBlock().getRootBlock()).isMovable())return;e=this,r=!0}var i=t.selected==n;i||n.addSelect();var o=e.x+t.SNAP_RADIUS+Math.floor(Math.random()*t.BUMP_RANDOMNESS)-this.x,s=e.y+t.SNAP_RADIUS+Math.floor(Math.random()*t.BUMP_RANDOMNESS)-this.y;r&&(s=-s),n.RTL&&(o=e.x-t.SNAP_RADIUS-Math.floor(Math.random()*t.BUMP_RANDOMNESS)-this.x),n.moveBy(o,s),i||n.removeSelect()}}},t.RenderedConnection.prototype.moveTo=function(e,n){this.trackedState_==t.RenderedConnection.TrackedState.WILL_TRACK?(this.db_.addConnection(this,n),this.trackedState_=t.RenderedConnection.TrackedState.TRACKED):this.trackedState_==t.RenderedConnection.TrackedState.TRACKED&&(this.db_.removeConnection(this,this.y),this.db_.addConnection(this,n)),this.x=e,this.y=n},t.RenderedConnection.prototype.moveBy=function(t,e){this.moveTo(this.x+t,this.y+e)},t.RenderedConnection.prototype.moveToOffset=function(t){this.moveTo(t.x+this.offsetInBlock_.x,t.y+this.offsetInBlock_.y)},t.RenderedConnection.prototype.setOffsetInBlock=function(t,e){this.offsetInBlock_.x=t,this.offsetInBlock_.y=e},t.RenderedConnection.prototype.getOffsetInBlock=function(){return this.offsetInBlock_},t.RenderedConnection.prototype.tighten=function(){var e=this.targetConnection.x-this.x,n=this.targetConnection.y-this.y;if(0!=e||0!=n){var r=this.targetBlock(),i=r.getSvgRoot();if(!i)throw Error("block is not rendered.");i=t.utils.getRelativeXY(i),r.getSvgRoot().setAttribute("transform","translate("+(i.x-e)+","+(i.y-n)+")"),r.moveConnections(-e,-n)}},t.RenderedConnection.prototype.closest=function(t,e){return this.dbOpposite_.searchForClosest(this,t,e)},t.RenderedConnection.prototype.highlight=function(){var e=this.sourceBlock_.workspace.getRenderer().getConstants(),n=e.shapeFor(this);this.type==t.connectionTypes.INPUT_VALUE||this.type==t.connectionTypes.OUTPUT_VALUE?(e=e.TAB_OFFSET_FROM_TOP,n=t.utils.svgPaths.moveBy(0,-e)+t.utils.svgPaths.lineOnAxis("v",e)+n.pathDown+t.utils.svgPaths.lineOnAxis("v",e)):(e=e.NOTCH_OFFSET_LEFT-e.CORNER_RADIUS,n=t.utils.svgPaths.moveBy(-e,0)+t.utils.svgPaths.lineOnAxis("h",e)+n.pathLeft+t.utils.svgPaths.lineOnAxis("h",e)),e=this.sourceBlock_.getRelativeToSurfaceXY(),t.Connection.highlightedPath_=t.utils.dom.createSvgElement(t.utils.Svg.PATH,{class:"blocklyHighlightedConnectionPath",d:n,transform:"translate("+(this.x-e.x)+","+(this.y-e.y)+")"+(this.sourceBlock_.RTL?" scale(-1 1)":"")},this.sourceBlock_.getSvgRoot())},t.RenderedConnection.prototype.unhighlight=function(){t.utils.dom.removeNode(t.Connection.highlightedPath_),delete t.Connection.highlightedPath_},t.RenderedConnection.prototype.setTracking=function(e){e&&this.trackedState_==t.RenderedConnection.TrackedState.TRACKED||!e&&this.trackedState_==t.RenderedConnection.TrackedState.UNTRACKED||this.sourceBlock_.isInFlyout||(e?(this.db_.addConnection(this,this.y),this.trackedState_=t.RenderedConnection.TrackedState.TRACKED):(this.trackedState_==t.RenderedConnection.TrackedState.TRACKED&&this.db_.removeConnection(this,this.y),this.trackedState_=t.RenderedConnection.TrackedState.UNTRACKED))},t.RenderedConnection.prototype.stopTrackingAll=function(){if(this.setTracking(!1),this.targetConnection)for(var t=this.targetBlock().getDescendants(!1),e=0;e<t.length;e++){for(var n=t[e],r=n.getConnections_(!0),i=0;i<r.length;i++)r[i].setTracking(!1);for(n=n.getIcons(),i=0;i<n.length;i++)n[i].setVisible(!1)}},t.RenderedConnection.prototype.startTrackingAll=function(){this.setTracking(!0);var e=[];if(this.type!=t.connectionTypes.INPUT_VALUE&&this.type!=t.connectionTypes.NEXT_STATEMENT)return e;var n=this.targetBlock();if(n){if(n.isCollapsed()){var r=[];n.outputConnection&&r.push(n.outputConnection),n.nextConnection&&r.push(n.nextConnection),n.previousConnection&&r.push(n.previousConnection)}else r=n.getConnections_(!0);for(var i=0;i<r.length;i++)e.push.apply(e,r[i].startTrackingAll());e.length||(e[0]=n)}return e},t.RenderedConnection.prototype.isConnectionAllowed=function(e,n){return t.utils.deprecation.warn("RenderedConnection.prototype.isConnectionAllowed","July 2020","July 2021","Blockly.Workspace.prototype.getConnectionChecker().canConnect"),!(this.distanceFrom(e)>n)&&t.RenderedConnection.superClass_.isConnectionAllowed.call(this,e)},t.RenderedConnection.prototype.onFailedConnect=function(e){var n=this.getSourceBlock();if(t.Events.recordUndo){var r=t.Events.getGroup();setTimeout(function(){n.isDisposed()||n.getParent()||(t.Events.setGroup(r),this.bumpAwayFrom(e),t.Events.setGroup(!1))}.bind(this),t.BUMP_DELAY)}},t.RenderedConnection.prototype.disconnectInternal_=function(e,n){t.RenderedConnection.superClass_.disconnectInternal_.call(this,e,n),e.rendered&&e.render(),n.rendered&&(n.updateDisabled(),n.render(),n.getSvgRoot().style.display="block")},t.RenderedConnection.prototype.respawnShadow_=function(){t.RenderedConnection.superClass_.respawnShadow_.call(this);var e=this.targetBlock();e&&(e.initSvg(),e.render(!1),(e=this.getSourceBlock()).rendered&&e.render())},t.RenderedConnection.prototype.neighbours=function(t){return this.dbOpposite_.getNeighbours(this,t)},t.RenderedConnection.prototype.connect_=function(e){t.RenderedConnection.superClass_.connect_.call(this,e);var n=this.getSourceBlock();e=e.getSourceBlock();var r=n.rendered,i=e.rendered;r&&n.updateDisabled(),i&&e.updateDisabled(),r&&i&&(this.type==t.connectionTypes.NEXT_STATEMENT||this.type==t.connectionTypes.PREVIOUS_STATEMENT?e.render():n.render()),(n=n.getInputWithBlock(e))&&(n=n.isVisible(),e.getSvgRoot().style.display=n?"block":"none")},t.RenderedConnection.prototype.onCheckChanged_=function(){!this.isConnected()||this.targetConnection&&this.getConnectionChecker().canConnect(this,this.targetConnection,!1)||((this.isSuperior()?this.targetBlock():this.sourceBlock_).unplug(),this.sourceBlock_.bumpNeighbours())},t.BasicCursor=function(){t.BasicCursor.superClass_.constructor.call(this)},t.utils.object.inherits(t.BasicCursor,t.Cursor),t.BasicCursor.registrationName="basicCursor",t.BasicCursor.prototype.next=function(){var t=this.getCurNode();return t?((t=this.getNextNode_(t,this.validNode_))&&this.setCurNode(t),t):null},t.BasicCursor.prototype.in=function(){return this.next()},t.BasicCursor.prototype.prev=function(){var t=this.getCurNode();return t?((t=this.getPreviousNode_(t,this.validNode_))&&this.setCurNode(t),t):null},t.BasicCursor.prototype.out=function(){return this.prev()},t.BasicCursor.prototype.getNextNode_=function(t,e){if(!t)return null;var n=t.in()||t.next();return e(n)?n:n?this.getNextNode_(n,e):e(t=this.findSiblingOrParent_(t.out()))?t:t?this.getNextNode_(t,e):null},t.BasicCursor.prototype.getPreviousNode_=function(t,e){if(!t)return null;var n=t.prev();return e(n=n?this.getRightMostChild_(n):t.out())?n:n?this.getPreviousNode_(n,e):null},t.BasicCursor.prototype.validNode_=function(e){var n=!1;return(e=e&&e.getType())!=t.ASTNode.types.OUTPUT&&e!=t.ASTNode.types.INPUT&&e!=t.ASTNode.types.FIELD&&e!=t.ASTNode.types.NEXT&&e!=t.ASTNode.types.PREVIOUS&&e!=t.ASTNode.types.WORKSPACE||(n=!0),n},t.BasicCursor.prototype.findSiblingOrParent_=function(t){if(!t)return null;var e=t.next();return e||this.findSiblingOrParent_(t.out())},t.BasicCursor.prototype.getRightMostChild_=function(t){if(!t.in())return t;for(t=t.in();t.next();)t=t.next();return this.getRightMostChild_(t)},t.registry.register(t.registry.Type.CURSOR,t.BasicCursor.registrationName,t.BasicCursor),t.TabNavigateCursor=function(){t.TabNavigateCursor.superClass_.constructor.call(this)},t.utils.object.inherits(t.TabNavigateCursor,t.BasicCursor),t.TabNavigateCursor.prototype.validNode_=function(e){var n=!1,r=e&&e.getType();return e&&(e=e.getLocation(),r==t.ASTNode.types.FIELD&&e&&e.isTabNavigable()&&e.isClickable()&&(n=!0)),n},t.BlockSvg=function(e,n,r){this.svgGroup_=t.utils.dom.createSvgElement(t.utils.Svg.G,{},null),this.svgGroup_.translate_="",this.style=e.getRenderer().getConstants().getBlockStyle(null),this.pathObject=e.getRenderer().makePathObject(this.svgGroup_,this.style),this.renderIsInProgress_=this.rendered=!1,this.workspace=e,this.previousConnection=this.nextConnection=this.outputConnection=null,this.useDragSurface_=t.utils.is3dSupported()&&!!e.getBlockDragSurface();var i=this.pathObject.svgPath;i.tooltip=this,t.Tooltip.bindMouseEvents(i),t.BlockSvg.superClass_.constructor.call(this,e,n,r),this.svgGroup_.dataset?this.svgGroup_.dataset.id=this.id:t.utils.userAgent.IE&&this.svgGroup_.setAttribute("data-id",this.id)},t.utils.object.inherits(t.BlockSvg,t.Block),t.BlockSvg.prototype.height=0,t.BlockSvg.prototype.width=0,t.BlockSvg.prototype.warningTextDb_=null,t.BlockSvg.INLINE=-1,t.BlockSvg.COLLAPSED_WARNING_ID="TEMP_COLLAPSED_WARNING_",t.BlockSvg.prototype.initSvg=function(){if(!this.workspace.rendered)throw TypeError("Workspace is headless.");for(var e,n=0;e=this.inputList[n];n++)e.init();for(e=this.getIcons(),n=0;n<e.length;n++)e[n].createIcon();this.applyColour(),this.pathObject.updateMovable(this.isMovable()),n=this.getSvgRoot(),this.workspace.options.readOnly||this.eventsInit_||!n||t.browserEvents.conditionalBind(n,"mousedown",this,this.onMouseDown_),this.eventsInit_=!0,n.parentNode||this.workspace.getCanvas().appendChild(n)},t.BlockSvg.prototype.getColourSecondary=function(){return this.style.colourSecondary},t.BlockSvg.prototype.getColourTertiary=function(){return this.style.colourTertiary},t.BlockSvg.prototype.getColourShadow=function(){return t.utils.deprecation.warn("BlockSvg.prototype.getColourShadow","January 2020","January 2021","style.colourSecondary"),this.getColourSecondary()},t.BlockSvg.prototype.getColourBorder=function(){return t.utils.deprecation.warn("BlockSvg.prototype.getColourBorder","January 2020","January 2021","style.colourTertiary"),{colourBorder:this.getColourTertiary(),colourLight:null,colourDark:null}},t.BlockSvg.prototype.select=function(){if(this.isShadow()&&this.getParent())this.getParent().select();else if(t.selected!=this){var e=null;if(t.selected){e=t.selected.id,t.Events.disable();try{t.selected.unselect()}finally{t.Events.enable()}}e=new(t.Events.get(t.Events.SELECTED))(e,this.id,this.workspace.id),t.Events.fire(e),t.selected=this,this.addSelect()}},t.BlockSvg.prototype.unselect=function(){if(t.selected==this){var e=new(t.Events.get(t.Events.SELECTED))(this.id,null,this.workspace.id);e.workspaceId=this.workspace.id,t.Events.fire(e),t.selected=null,this.removeSelect()}},t.BlockSvg.prototype.mutator=null,t.BlockSvg.prototype.comment=null,t.BlockSvg.prototype.commentIcon_=null,t.BlockSvg.prototype.warning=null,t.BlockSvg.prototype.getIcons=function(){var t=[];return this.mutator&&t.push(this.mutator),this.commentIcon_&&t.push(this.commentIcon_),this.warning&&t.push(this.warning),t},t.BlockSvg.prototype.setParent=function(e){var n=this.parentBlock_;if(e!=n){t.utils.dom.startTextWidthCache(),t.BlockSvg.superClass_.setParent.call(this,e),t.utils.dom.stopTextWidthCache();var r=this.getSvgRoot();if(!this.workspace.isClearing&&r){var i=this.getRelativeToSurfaceXY();e?(e.getSvgRoot().appendChild(r),e=this.getRelativeToSurfaceXY(),this.moveConnections(e.x-i.x,e.y-i.y)):n&&(this.workspace.getCanvas().appendChild(r),this.translate(i.x,i.y)),this.applyColour()}}},t.BlockSvg.prototype.getRelativeToSurfaceXY=function(){var e=0,n=0,r=this.useDragSurface_?this.workspace.getBlockDragSurface().getGroup():null,i=this.getSvgRoot();if(i)do{var o=t.utils.getRelativeXY(i);e+=o.x,n+=o.y,this.useDragSurface_&&this.workspace.getBlockDragSurface().getCurrentBlock()==i&&(e+=(o=this.workspace.getBlockDragSurface().getSurfaceTranslation()).x,n+=o.y),i=i.parentNode}while(i&&i!=this.workspace.getCanvas()&&i!=r);return new t.utils.Coordinate(e,n)},t.BlockSvg.prototype.moveBy=function(e,n){if(this.parentBlock_)throw Error("Block has parent.");var r=t.Events.isEnabled();if(r)var i=new(t.Events.get(t.Events.BLOCK_MOVE))(this);var o=this.getRelativeToSurfaceXY();this.translate(o.x+e,o.y+n),this.moveConnections(e,n),r&&(i.recordNew(),t.Events.fire(i)),this.workspace.resizeContents()},t.BlockSvg.prototype.translate=function(t,e){this.getSvgRoot().setAttribute("transform","translate("+t+","+e+")")},t.BlockSvg.prototype.moveToDragSurface=function(){if(this.useDragSurface_){var t=this.getRelativeToSurfaceXY();this.clearTransformAttributes_(),this.workspace.getBlockDragSurface().translateSurface(t.x,t.y),(t=this.getSvgRoot())&&this.workspace.getBlockDragSurface().setBlocksAndShow(t)}},t.BlockSvg.prototype.moveTo=function(t){var e=this.getRelativeToSurfaceXY();this.moveBy(t.x-e.x,t.y-e.y)},t.BlockSvg.prototype.moveOffDragSurface=function(t){this.useDragSurface_&&(this.translate(t.x,t.y),this.workspace.getBlockDragSurface().clearAndHide(this.workspace.getCanvas()))},t.BlockSvg.prototype.moveDuringDrag=function(t){this.useDragSurface_?this.workspace.getBlockDragSurface().translateSurface(t.x,t.y):(this.svgGroup_.translate_="translate("+t.x+","+t.y+")",this.svgGroup_.setAttribute("transform",this.svgGroup_.translate_+this.svgGroup_.skew_))},t.BlockSvg.prototype.clearTransformAttributes_=function(){this.getSvgRoot().removeAttribute("transform")},t.BlockSvg.prototype.snapToGrid=function(){if(this.workspace&&!this.workspace.isDragging()&&!this.getParent()&&!this.isInFlyout){var t=this.workspace.getGrid();if(t&&t.shouldSnap()){var e=t.getSpacing(),n=e/2,r=this.getRelativeToSurfaceXY();t=Math.round((r.x-n)/e)*e+n-r.x,e=Math.round((r.y-n)/e)*e+n-r.y,t=Math.round(t),e=Math.round(e),0==t&&0==e||this.moveBy(t,e)}}},t.BlockSvg.prototype.getBoundingRectangle=function(){var e=this.getRelativeToSurfaceXY(),n=this.getHeightWidth();if(this.RTL)var r=e.x-n.width,i=e.x;else r=e.x,i=e.x+n.width;return new t.utils.Rect(e.y,e.y+n.height,r,i)},t.BlockSvg.prototype.markDirty=function(){this.pathObject.constants=this.workspace.getRenderer().getConstants();for(var t,e=0;t=this.inputList[e];e++)t.markDirty()},t.BlockSvg.prototype.setCollapsed=function(e){this.collapsed_!=e&&(t.BlockSvg.superClass_.setCollapsed.call(this,e),e?this.rendered&&this.render():this.updateCollapsed_())},t.BlockSvg.prototype.updateCollapsed_=function(){for(var e,n=this.isCollapsed(),r=t.constants.COLLAPSED_INPUT_NAME,i=t.constants.COLLAPSED_FIELD_NAME,o=0;e=this.inputList[o];o++)e.name!=r&&e.setVisible(!n);if(n){for(e=this.getIcons(),o=0;n=e[o];o++)n.setVisible(!1);o=this.toString(t.COLLAPSE_CHARS),(e=this.getField(i))?e.setValue(o):(e=this.getInput(r)||this.appendDummyInput(r)).appendField(new t.FieldLabel(o),i)}else this.updateDisabled(),this.removeInput(r)},t.BlockSvg.prototype.tab=function(e,n){var r=new t.TabNavigateCursor;r.setCurNode(t.ASTNode.createFieldNode(e)),e=r.getCurNode(),n?r.next():r.prev(),(n=r.getCurNode())&&n!==e&&(n.getLocation().showEditor(),this.workspace.keyboardAccessibilityMode&&this.workspace.getCursor().setCurNode(n))},t.BlockSvg.prototype.onMouseDown_=function(t){var e=this.workspace&&this.workspace.getGesture(t);e&&e.handleBlockStart(t,this)},t.BlockSvg.prototype.showHelp=function(){var t="function"==typeof this.helpUrl?this.helpUrl():this.helpUrl;t&&window.open(t)},t.BlockSvg.prototype.generateContextMenu=function(){if(this.workspace.options.readOnly||!this.contextMenu)return null;var e=t.ContextMenuRegistry.registry.getContextMenuOptions(t.ContextMenuRegistry.ScopeType.BLOCK,{block:this});return this.customContextMenu&&this.customContextMenu(e),e},t.BlockSvg.prototype.showContextMenu=function(e){var n=this.generateContextMenu();n&&n.length&&(t.ContextMenu.show(e,n,this.RTL),t.ContextMenu.currentBlock=this)},t.BlockSvg.prototype.moveConnections=function(t,e){if(this.rendered){for(var n=this.getConnections_(!1),r=0;r<n.length;r++)n[r].moveBy(t,e);for(n=this.getIcons(),r=0;r<n.length;r++)n[r].computeIconLocation();for(r=0;r<this.childBlocks_.length;r++)this.childBlocks_[r].moveConnections(t,e)}},t.BlockSvg.prototype.setDragging=function(e){if(e){var n=this.getSvgRoot();n.translate_="",n.skew_="",t.draggingConnections=t.draggingConnections.concat(this.getConnections_(!0)),t.utils.dom.addClass(this.svgGroup_,"blocklyDragging")}else t.draggingConnections=[],t.utils.dom.removeClass(this.svgGroup_,"blocklyDragging");for(n=0;n<this.childBlocks_.length;n++)this.childBlocks_[n].setDragging(e)},t.BlockSvg.prototype.setMovable=function(e){t.BlockSvg.superClass_.setMovable.call(this,e),this.pathObject.updateMovable(e)},t.BlockSvg.prototype.setEditable=function(e){t.BlockSvg.superClass_.setEditable.call(this,e),e=this.getIcons();for(var n=0;n<e.length;n++)e[n].updateEditable()},t.BlockSvg.prototype.setShadow=function(e){t.BlockSvg.superClass_.setShadow.call(this,e),this.applyColour()},t.BlockSvg.prototype.setInsertionMarker=function(t){this.isInsertionMarker_!=t&&(this.isInsertionMarker_=t)&&(this.setColour(this.workspace.getRenderer().getConstants().INSERTION_MARKER_COLOUR),this.pathObject.updateInsertionMarker(!0))},t.BlockSvg.prototype.getSvgRoot=function(){return this.svgGroup_},t.BlockSvg.prototype.dispose=function(e,n){if(this.workspace){t.Tooltip.dispose(),t.Tooltip.unbindMouseEvents(this.pathObject.svgPath),t.utils.dom.startTextWidthCache();var r=this.workspace;if(t.selected==this&&(this.unselect(),this.workspace.cancelCurrentGesture()),t.ContextMenu.currentBlock==this&&t.ContextMenu.hide(),n&&this.rendered&&(this.unplug(e),t.blockAnimations.disposeUiEffect(this)),this.rendered=!1,this.warningTextDb_){for(var i in this.warningTextDb_)clearTimeout(this.warningTextDb_[i]);this.warningTextDb_=null}for(n=this.getIcons(),i=0;i<n.length;i++)n[i].dispose();t.BlockSvg.superClass_.dispose.call(this,!!e),t.utils.dom.removeNode(this.svgGroup_),r.resizeContents(),this.svgGroup_=null,t.utils.dom.stopTextWidthCache()}},t.BlockSvg.prototype.toCopyData=function(){if(this.isInsertionMarker_)return null;var e=t.Xml.blockToDom(this,!0);t.Xml.deleteNext(e);var n=this.getRelativeToSurfaceXY();return e.setAttribute("x",this.RTL?-n.x:n.x),e.setAttribute("y",n.y),{xml:e,source:this.workspace,typeCounts:t.utils.getBlockTypeCounts(this,!0)}},t.BlockSvg.prototype.applyColour=function(){this.pathObject.applyColour(this);for(var t=this.getIcons(),e=0;e<t.length;e++)t[e].applyColour();for(t=0;e=this.inputList[t];t++)for(var n,r=0;n=e.fieldRow[r];r++)n.applyColour()},t.BlockSvg.prototype.updateDisabled=function(){var t=this.getChildren(!1);if(this.applyColour(),!this.isCollapsed())for(var e,n=0;e=t[n];n++)e.rendered&&e.updateDisabled()},t.BlockSvg.prototype.getCommentIcon=function(){return this.commentIcon_},t.BlockSvg.prototype.setCommentText=function(e){if(!t.Comment)throw Error("Missing require for Blockly.Comment");this.commentModel.text!=e&&(t.BlockSvg.superClass_.setCommentText.call(this,e),e=null!=e,!!this.commentIcon_==e?this.commentIcon_.updateText():(e?this.comment=this.commentIcon_=new t.Comment(this):(this.commentIcon_.dispose(),this.comment=this.commentIcon_=null),this.rendered&&(this.render(),this.bumpNeighbours())))},t.BlockSvg.prototype.setWarningText=function(e,n){if(!t.Warning)throw Error("Missing require for Blockly.Warning");this.warningTextDb_||(this.warningTextDb_=Object.create(null));var r=n||"";if(r)this.warningTextDb_[r]&&(clearTimeout(this.warningTextDb_[r]),delete this.warningTextDb_[r]);else for(var i in this.warningTextDb_)clearTimeout(this.warningTextDb_[i]),delete this.warningTextDb_[i];if(this.workspace.isDragging()){var o=this;this.warningTextDb_[r]=setTimeout(function(){o.workspace&&(delete o.warningTextDb_[r],o.setWarningText(e,r))},100)}else{if(this.isInFlyout&&(e=null),n=!1,"string"==typeof e){i=this.getSurroundParent();for(var s=null;i;)i.isCollapsed()&&(s=i),i=i.getSurroundParent();s&&s.setWarningText(t.Msg.COLLAPSED_WARNINGS_WARNING,t.BlockSvg.COLLAPSED_WARNING_ID),this.warning||(this.warning=new t.Warning(this),n=!0),this.warning.setText(e,r)}else this.warning&&!r?(this.warning.dispose(),n=!0):this.warning&&(n=this.warning.getText(),this.warning.setText("",r),(i=this.warning.getText())||this.warning.dispose(),n=n!=i);n&&this.rendered&&(this.render(),this.bumpNeighbours())}},t.BlockSvg.prototype.setMutator=function(t){this.mutator&&this.mutator!==t&&this.mutator.dispose(),t&&(t.setBlock(this),this.mutator=t,t.createIcon()),this.rendered&&(this.render(),this.bumpNeighbours())},t.BlockSvg.prototype.setEnabled=function(e){this.isEnabled()!=e&&(t.BlockSvg.superClass_.setEnabled.call(this,e),this.rendered&&!this.getInheritedDisabled()&&this.updateDisabled())},t.BlockSvg.prototype.setHighlighted=function(t){this.rendered&&this.pathObject.updateHighlighted(t)},t.BlockSvg.prototype.addSelect=function(){this.pathObject.updateSelected(!0)},t.BlockSvg.prototype.removeSelect=function(){this.pathObject.updateSelected(!1)},t.BlockSvg.prototype.setDeleteStyle=function(t){this.pathObject.updateDraggingDelete(t)},t.BlockSvg.prototype.getColour=function(){return this.style.colourPrimary},t.BlockSvg.prototype.setColour=function(e){t.BlockSvg.superClass_.setColour.call(this,e),e=this.workspace.getRenderer().getConstants().getBlockStyleForColour(this.colour_),this.pathObject.setStyle(e.style),this.style=e.style,this.styleName_=e.name,this.applyColour()},t.BlockSvg.prototype.setStyle=function(t){var e=this.workspace.getRenderer().getConstants().getBlockStyle(t);if(this.styleName_=t,!e)throw Error("Invalid style name: "+t);this.hat=e.hat,this.pathObject.setStyle(e),this.colour_=e.colourPrimary,this.style=e,this.applyColour()},t.BlockSvg.prototype.bringToFront=function(){var t=this;do{var e=t.getSvgRoot(),n=e.parentNode,r=n.childNodes;r[r.length-1]!==e&&n.appendChild(e),t=t.getParent()}while(t)},t.BlockSvg.prototype.setPreviousStatement=function(e,n){t.BlockSvg.superClass_.setPreviousStatement.call(this,e,n),this.rendered&&(this.render(),this.bumpNeighbours())},t.BlockSvg.prototype.setNextStatement=function(e,n){t.BlockSvg.superClass_.setNextStatement.call(this,e,n),this.rendered&&(this.render(),this.bumpNeighbours())},t.BlockSvg.prototype.setOutput=function(e,n){t.BlockSvg.superClass_.setOutput.call(this,e,n),this.rendered&&(this.render(),this.bumpNeighbours())},t.BlockSvg.prototype.setInputsInline=function(e){t.BlockSvg.superClass_.setInputsInline.call(this,e),this.rendered&&(this.render(),this.bumpNeighbours())},t.BlockSvg.prototype.removeInput=function(e,n){return e=t.BlockSvg.superClass_.removeInput.call(this,e,n),this.rendered&&(this.render(),this.bumpNeighbours()),e},t.BlockSvg.prototype.moveNumberedInputBefore=function(e,n){t.BlockSvg.superClass_.moveNumberedInputBefore.call(this,e,n),this.rendered&&(this.render(),this.bumpNeighbours())},t.BlockSvg.prototype.appendInput_=function(e,n){return e=t.BlockSvg.superClass_.appendInput_.call(this,e,n),this.rendered&&(this.render(),this.bumpNeighbours()),e},t.BlockSvg.prototype.setConnectionTracking=function(t){if(this.previousConnection&&this.previousConnection.setTracking(t),this.outputConnection&&this.outputConnection.setTracking(t),this.nextConnection){this.nextConnection.setTracking(t);var e=this.nextConnection.targetBlock();e&&e.setConnectionTracking(t)}if(!this.collapsed_)for(e=0;e<this.inputList.length;e++){var n=this.inputList[e].connection;n&&(n.setTracking(t),(n=n.targetBlock())&&n.setConnectionTracking(t))}},t.BlockSvg.prototype.getConnections_=function(t){var e=[];if((t||this.rendered)&&(this.outputConnection&&e.push(this.outputConnection),this.previousConnection&&e.push(this.previousConnection),this.nextConnection&&e.push(this.nextConnection),t||!this.collapsed_)){t=0;for(var n;n=this.inputList[t];t++)n.connection&&e.push(n.connection)}return e},t.BlockSvg.prototype.lastConnectionInStack=function(e){return t.BlockSvg.superClass_.lastConnectionInStack.call(this,e)},t.BlockSvg.prototype.getMatchingConnection=function(e,n){return t.BlockSvg.superClass_.getMatchingConnection.call(this,e,n)},t.BlockSvg.prototype.makeConnection_=function(e){return new t.RenderedConnection(this,e)},t.BlockSvg.prototype.bumpNeighbours=function(){if(this.workspace&&!this.workspace.isDragging()){var e=this.getRootBlock();if(!e.isInFlyout)for(var n,r=this.getConnections_(!1),i=0;n=r[i];i++){n.isConnected()&&n.isSuperior()&&n.targetBlock().bumpNeighbours();for(var o,s=n.neighbours(t.SNAP_RADIUS),a=0;o=s[a];a++)n.isConnected()&&o.isConnected()||o.getSourceBlock().getRootBlock()!=e&&(n.isSuperior()?o.bumpAwayFrom(n):n.bumpAwayFrom(o))}}},t.BlockSvg.prototype.scheduleSnapAndBump=function(){var e=this,n=t.Events.getGroup();setTimeout(function(){t.Events.setGroup(n),e.snapToGrid(),t.Events.setGroup(!1)},t.BUMP_DELAY/2),setTimeout(function(){t.Events.setGroup(n),e.bumpNeighbours(),t.Events.setGroup(!1)},t.BUMP_DELAY)},t.BlockSvg.prototype.positionNearConnection=function(e,n){e.type!=t.connectionTypes.NEXT_STATEMENT&&e.type!=t.connectionTypes.INPUT_VALUE||this.moveBy(n.x-e.x,n.y-e.y)},t.BlockSvg.prototype.getParent=function(){return t.BlockSvg.superClass_.getParent.call(this)},t.BlockSvg.prototype.getRootBlock=function(){return t.BlockSvg.superClass_.getRootBlock.call(this)},t.BlockSvg.prototype.render=function(e){if(!this.renderIsInProgress_){this.renderIsInProgress_=!0;try{if(this.rendered=!0,t.utils.dom.startTextWidthCache(),this.isCollapsed()&&this.updateCollapsed_(),this.workspace.getRenderer().render(this),this.updateConnectionLocations_(),!1!==e){var n=this.getParent();n?n.render(!0):this.workspace.resizeContents()}t.utils.dom.stopTextWidthCache(),this.updateMarkers_()}finally{this.renderIsInProgress_=!1}}},t.BlockSvg.prototype.updateMarkers_=function(){this.workspace.keyboardAccessibilityMode&&this.pathObject.cursorSvg&&this.workspace.getCursor().draw(),this.workspace.keyboardAccessibilityMode&&this.pathObject.markerSvg&&this.workspace.getMarker(t.MarkerManager.LOCAL_MARKER).draw()},t.BlockSvg.prototype.updateConnectionLocations_=function(){var t=this.getRelativeToSurfaceXY();this.previousConnection&&this.previousConnection.moveToOffset(t),this.outputConnection&&this.outputConnection.moveToOffset(t);for(var e=0;e<this.inputList.length;e++){var n=this.inputList[e].connection;n&&(n.moveToOffset(t),n.isConnected()&&n.tighten())}this.nextConnection&&(this.nextConnection.moveToOffset(t),this.nextConnection.isConnected()&&this.nextConnection.tighten())},t.BlockSvg.prototype.setCursorSvg=function(t){this.pathObject.setCursorSvg(t)},t.BlockSvg.prototype.setMarkerSvg=function(t){this.pathObject.setMarkerSvg(t)},t.BlockSvg.prototype.getHeightWidth=function(){var t=this.height,e=this.width,n=this.getNextBlock();if(n){n=n.getHeightWidth();var r=this.workspace.getRenderer().getConstants().NOTCH_HEIGHT;t+=n.height-r,e=Math.max(e,n.width)}return{height:t,width:e}},t.BlockSvg.prototype.fadeForReplacement=function(t){this.pathObject.updateReplacementFade(t)},t.BlockSvg.prototype.highlightShapeForInput=function(t,e){this.pathObject.updateShapeForInputHighlight(t,e)},t.ConnectionDB=function(t){this.connections_=[],this.connectionChecker_=t},t.ConnectionDB.prototype.addConnection=function(t,e){e=this.calculateIndexForYPos_(e),this.connections_.splice(e,0,t)},t.ConnectionDB.prototype.findIndexOfConnection_=function(t,e){if(!this.connections_.length)return-1;var n=this.calculateIndexForYPos_(e);if(n>=this.connections_.length)return-1;e=t.y;for(var r=n;0<=r&&this.connections_[r].y==e;){if(this.connections_[r]==t)return r;r--}for(r=n;r<this.connections_.length&&this.connections_[r].y==e;){if(this.connections_[r]==t)return r;r++}return-1},t.ConnectionDB.prototype.calculateIndexForYPos_=function(t){if(!this.connections_.length)return 0;for(var e=0,n=this.connections_.length;e<n;){var r=Math.floor((e+n)/2);if(this.connections_[r].y<t)e=r+1;else{if(!(this.connections_[r].y>t)){e=r;break}n=r}}return e},t.ConnectionDB.prototype.removeConnection=function(t,e){if(-1==(t=this.findIndexOfConnection_(t,e)))throw Error("Unable to find connection in connectionDB.");this.connections_.splice(t,1)},t.ConnectionDB.prototype.getNeighbours=function(t,e){function n(t){var n=i-r[t].x,s=o-r[t].y;return Math.sqrt(n*n+s*s)<=e&&l.push(r[t]),s<e}var r=this.connections_,i=t.x,o=t.y;t=0;for(var s=r.length-2,a=s;t<a;)r[a].y<o?t=a:s=a,a=Math.floor((t+s)/2);var l=[];if(s=t=a,r.length){for(;0<=t&&n(t);)t--;do{s++}while(s<r.length&&n(s))}return l},t.ConnectionDB.prototype.isInYRange_=function(t,e,n){return Math.abs(this.connections_[t].y-e)<=n},t.ConnectionDB.prototype.searchForClosest=function(t,e,n){if(!this.connections_.length)return{connection:null,radius:e};var r=t.y,i=t.x;t.x=i+n.x,t.y=r+n.y;var o=this.calculateIndexForYPos_(t.y);n=null;for(var s,a=e,l=o-1;0<=l&&this.isInYRange_(l,t.y,e);)s=this.connections_[l],this.connectionChecker_.canConnect(t,s,!0,a)&&(n=s,a=s.distanceFrom(t)),l--;for(;o<this.connections_.length&&this.isInYRange_(o,t.y,e);)s=this.connections_[o],this.connectionChecker_.canConnect(t,s,!0,a)&&(n=s,a=s.distanceFrom(t)),o++;return t.x=i,t.y=r,{connection:n,radius:a}},t.ConnectionDB.init=function(e){var n=[];return n[t.connectionTypes.INPUT_VALUE]=new t.ConnectionDB(e),n[t.connectionTypes.OUTPUT_VALUE]=new t.ConnectionDB(e),n[t.connectionTypes.NEXT_STATEMENT]=new t.ConnectionDB(e),n[t.connectionTypes.PREVIOUS_STATEMENT]=new t.ConnectionDB(e),n},t.Events.ThemeChange=function(e,n){t.Events.ThemeChange.superClass_.constructor.call(this,n),this.themeName=e},t.utils.object.inherits(t.Events.ThemeChange,t.Events.UiBase),t.Events.ThemeChange.prototype.type=t.Events.THEME_CHANGE,t.Events.ThemeChange.prototype.toJson=function(){var e=t.Events.ThemeChange.superClass_.toJson.call(this);return e.themeName=this.themeName,e},t.Events.ThemeChange.prototype.fromJson=function(e){t.Events.ThemeChange.superClass_.fromJson.call(this,e),this.themeName=e.themeName},t.registry.register(t.registry.Type.EVENT,t.Events.THEME_CHANGE,t.Events.ThemeChange),t.Events.ViewportChange=function(e,n,r,i,o){t.Events.ViewportChange.superClass_.constructor.call(this,i),this.viewTop=e,this.viewLeft=n,this.scale=r,this.oldScale=o},t.utils.object.inherits(t.Events.ViewportChange,t.Events.UiBase),t.Events.ViewportChange.prototype.type=t.Events.VIEWPORT_CHANGE,t.Events.ViewportChange.prototype.toJson=function(){var e=t.Events.ViewportChange.superClass_.toJson.call(this);return e.viewTop=this.viewTop,e.viewLeft=this.viewLeft,e.scale=this.scale,e.oldScale=this.oldScale,e},t.Events.ViewportChange.prototype.fromJson=function(e){t.Events.ViewportChange.superClass_.fromJson.call(this,e),this.viewTop=e.viewTop,this.viewLeft=e.viewLeft,this.scale=e.scale,this.oldScale=e.oldScale},t.registry.register(t.registry.Type.EVENT,t.Events.VIEWPORT_CHANGE,t.Events.ViewportChange),t.IMetricsManager=function(){},t.MetricsManager=function(t){this.workspace_=t},t.MetricsManager.prototype.getDimensionsPx_=function(e){var n=0,r=0;return e&&(n=e.getWidth(),r=e.getHeight()),new t.utils.Size(n,r)},t.MetricsManager.prototype.getFlyoutMetrics=function(t){return{width:(t=this.getDimensionsPx_(this.workspace_.getFlyout(t))).width,height:t.height,position:this.workspace_.toolboxPosition}},t.MetricsManager.prototype.getToolboxMetrics=function(){var t=this.getDimensionsPx_(this.workspace_.getToolbox());return{width:t.width,height:t.height,position:this.workspace_.toolboxPosition}},t.MetricsManager.prototype.getSvgMetrics=function(){return this.workspace_.getCachedParentSvgSize()},t.MetricsManager.prototype.getAbsoluteMetrics=function(){var e=0,n=this.getToolboxMetrics(),r=this.getFlyoutMetrics(!0),i=!!this.workspace_.getToolbox(),o=!!this.workspace_.getFlyout(!0),s=i?n.position:r.position,a=s==t.utils.toolbox.Position.LEFT;return s=s==t.utils.toolbox.Position.TOP,i&&a?e=n.width:o&&a&&(e=r.width),a=0,i&&s?a=n.height:o&&s&&(a=r.height),{top:a,left:e}},t.MetricsManager.prototype.getViewMetrics=function(e){e=e?this.workspace_.scale:1;var n=this.getSvgMetrics(),r=this.getToolboxMetrics(),i=this.getFlyoutMetrics(!0),o=this.workspace_.getToolbox()?r.position:i.position;return this.workspace_.getToolbox()?o==t.utils.toolbox.Position.TOP||o==t.utils.toolbox.Position.BOTTOM?n.height-=r.height:o!=t.utils.toolbox.Position.LEFT&&o!=t.utils.toolbox.Position.RIGHT||(n.width-=r.width):this.workspace_.getFlyout(!0)&&(o==t.utils.toolbox.Position.TOP||o==t.utils.toolbox.Position.BOTTOM?n.height-=i.height:o!=t.utils.toolbox.Position.LEFT&&o!=t.utils.toolbox.Position.RIGHT||(n.width-=i.width)),{height:n.height/e,width:n.width/e,top:-this.workspace_.scrollY/e,left:-this.workspace_.scrollX/e}},t.MetricsManager.prototype.getContentMetrics=function(t){t=t?1:this.workspace_.scale;var e=this.workspace_.getBlocksBoundingBox();return{height:(e.bottom-e.top)*t,width:(e.right-e.left)*t,top:e.top*t,left:e.left*t}},t.MetricsManager.prototype.hasFixedEdges=function(){return!this.workspace_.isMovableHorizontally()||!this.workspace_.isMovableVertically()},t.MetricsManager.prototype.getComputedFixedEdges_=function(t){if(!this.hasFixedEdges())return{};var e=this.workspace_.isMovableHorizontally(),n=this.workspace_.isMovableVertically();t=t||this.getViewMetrics(!1);var r={};return n||(r.top=t.top,r.bottom=t.top+t.height),e||(r.left=t.left,r.right=t.left+t.width),r},t.MetricsManager.prototype.getPaddedContent_=function(t,e){var n=e.top+e.height,r=e.left+e.width,i=t.width,o=i/2,s=(t=t.height)/2;return{top:Math.min(e.top-s,n-t),bottom:Math.max(n+s,e.top+t),left:Math.min(e.left-o,r-i),right:Math.max(r+o,e.left+i)}},t.MetricsManager.prototype.getScrollMetrics=function(t,e,n){t=t?this.workspace_.scale:1,e=e||this.getViewMetrics(!1);var r=n||this.getContentMetrics();n=this.getComputedFixedEdges_(e),e=this.getPaddedContent_(e,r),r=void 0!==n.top?n.top:e.top;var i=void 0!==n.left?n.left:e.left;return{top:r/t,left:i/t,width:((void 0!==n.right?n.right:e.right)-i)/t,height:((void 0!==n.bottom?n.bottom:e.bottom)-r)/t}},t.MetricsManager.prototype.getUiMetrics=function(){return{viewMetrics:this.getViewMetrics(),absoluteMetrics:this.getAbsoluteMetrics(),toolboxMetrics:this.getToolboxMetrics()}},t.MetricsManager.prototype.getMetrics=function(){var t=this.getToolboxMetrics(),e=this.getFlyoutMetrics(!0),n=this.getSvgMetrics(),r=this.getAbsoluteMetrics(),i=this.getViewMetrics(),o=this.getContentMetrics(),s=this.getScrollMetrics(!1,i,o);return{contentHeight:o.height,contentWidth:o.width,contentTop:o.top,contentLeft:o.left,scrollHeight:s.height,scrollWidth:s.width,scrollTop:s.top,scrollLeft:s.left,viewHeight:i.height,viewWidth:i.width,viewTop:i.top,viewLeft:i.left,absoluteTop:r.top,absoluteLeft:r.left,svgHeight:n.height,svgWidth:n.width,toolboxWidth:t.width,toolboxHeight:t.height,toolboxPosition:t.position,flyoutWidth:e.width,flyoutHeight:e.height}},t.registry.register(t.registry.Type.METRICS_MANAGER,t.registry.DEFAULT,t.MetricsManager),t.FlyoutMetricsManager=function(e,n){this.flyout_=n,t.FlyoutMetricsManager.superClass_.constructor.call(this,e)},t.utils.object.inherits(t.FlyoutMetricsManager,t.MetricsManager),t.FlyoutMetricsManager.prototype.getBoundingBox_=function(){try{var t=this.workspace_.getCanvas().getBBox()}catch(e){t={height:0,y:0,width:0,x:0}}return t},t.FlyoutMetricsManager.prototype.getContentMetrics=function(t){var e=this.getBoundingBox_();return t=t?1:this.workspace_.scale,{height:e.height*t,width:e.width*t,top:e.y*t,left:e.x*t}},t.FlyoutMetricsManager.prototype.getScrollMetrics=function(t,e,n){return e=n||this.getContentMetrics(),n=this.flyout_.MARGIN*this.workspace_.scale,t=t?this.workspace_.scale:1,{height:(e.height+2*n)/t,width:(e.width+e.left+n)/t,top:0,left:0}},t.ThemeManager=function(t,e){this.workspace_=t,this.theme_=e,this.subscribedWorkspaces_=[],this.componentDB_=Object.create(null)},t.ThemeManager.prototype.getTheme=function(){return this.theme_},t.ThemeManager.prototype.setTheme=function(e){var n,r=this.theme_;for(this.theme_=e,(e=this.workspace_.getInjectionDiv())&&(r&&t.utils.dom.removeClass(e,r.getClassName()),t.utils.dom.addClass(e,this.theme_.getClassName())),r=0;e=this.subscribedWorkspaces_[r];r++)e.refreshTheme();for(r=0,e=Object.keys(this.componentDB_);n=e[r];r++)for(var i,o=0;i=this.componentDB_[n][o];o++){var s=i.element;i=i.propertyName;var a=this.theme_&&this.theme_.getComponentStyle(n);s.style[i]=a||""}t.hideChaff()},t.ThemeManager.prototype.subscribeWorkspace=function(t){this.subscribedWorkspaces_.push(t)},t.ThemeManager.prototype.unsubscribeWorkspace=function(t){if(0>(t=this.subscribedWorkspaces_.indexOf(t)))throw Error("Cannot unsubscribe a workspace that hasn't been subscribed.");this.subscribedWorkspaces_.splice(t,1)},t.ThemeManager.prototype.subscribe=function(t,e,n){this.componentDB_[e]||(this.componentDB_[e]=[]),this.componentDB_[e].push({element:t,propertyName:n}),e=this.theme_&&this.theme_.getComponentStyle(e),t.style[n]=e||""},t.ThemeManager.prototype.unsubscribe=function(t){if(t)for(var e,n=Object.keys(this.componentDB_),r=0;e=n[r];r++){for(var i=this.componentDB_[e],o=i.length-1;0<=o;o--)i[o].element===t&&i.splice(o,1);this.componentDB_[e].length||delete this.componentDB_[e]}},t.ThemeManager.prototype.dispose=function(){this.componentDB_=this.subscribedWorkspaces_=this.theme_=this.owner_=null},t.TouchGesture=function(e,n){t.TouchGesture.superClass_.constructor.call(this,e,n),this.isMultiTouch_=!1,this.cachedPoints_=Object.create(null),this.startDistance_=this.previousScale_=0,this.isPinchZoomEnabled_=this.onStartWrapper_=null},t.utils.object.inherits(t.TouchGesture,t.Gesture),t.TouchGesture.ZOOM_IN_MULTIPLIER=5,t.TouchGesture.ZOOM_OUT_MULTIPLIER=6,t.TouchGesture.prototype.doStart=function(e){this.isPinchZoomEnabled_=this.startWorkspace_.options.zoomOptions&&this.startWorkspace_.options.zoomOptions.pinch,t.TouchGesture.superClass_.doStart.call(this,e),!this.isEnding_&&t.Touch.isTouchEvent(e)&&this.handleTouchStart(e)},t.TouchGesture.prototype.bindMouseEvents=function(e){this.onStartWrapper_=t.browserEvents.conditionalBind(document,"mousedown",null,this.handleStart.bind(this),!0),this.onMoveWrapper_=t.browserEvents.conditionalBind(document,"mousemove",null,this.handleMove.bind(this),!0),this.onUpWrapper_=t.browserEvents.conditionalBind(document,"mouseup",null,this.handleUp.bind(this),!0),e.preventDefault(),e.stopPropagation()},t.TouchGesture.prototype.handleStart=function(e){!this.isDragging()&&t.Touch.isTouchEvent(e)&&(this.handleTouchStart(e),this.isMultiTouch()&&t.longStop_())},t.TouchGesture.prototype.handleMove=function(e){this.isDragging()?t.Touch.shouldHandleEvent(e)&&t.TouchGesture.superClass_.handleMove.call(this,e):this.isMultiTouch()?(t.Touch.isTouchEvent(e)&&this.handleTouchMove(e),t.longStop_()):t.TouchGesture.superClass_.handleMove.call(this,e)},t.TouchGesture.prototype.handleUp=function(e){t.Touch.isTouchEvent(e)&&!this.isDragging()&&this.handleTouchEnd(e),!this.isMultiTouch()||this.isDragging()?t.Touch.shouldHandleEvent(e)&&t.TouchGesture.superClass_.handleUp.call(this,e):(e.preventDefault(),e.stopPropagation(),this.dispose())},t.TouchGesture.prototype.isMultiTouch=function(){return this.isMultiTouch_},t.TouchGesture.prototype.dispose=function(){t.TouchGesture.superClass_.dispose.call(this),this.onStartWrapper_&&t.browserEvents.unbind(this.onStartWrapper_)},t.TouchGesture.prototype.handleTouchStart=function(e){var n=t.Touch.getTouchIdentifierFromEvent(e);this.cachedPoints_[n]=this.getTouchPoint(e),2==(n=Object.keys(this.cachedPoints_)).length&&(this.startDistance_=t.utils.Coordinate.distance(this.cachedPoints_[n[0]],this.cachedPoints_[n[1]]),this.isMultiTouch_=!0,e.preventDefault())},t.TouchGesture.prototype.handleTouchMove=function(e){var n=t.Touch.getTouchIdentifierFromEvent(e);this.cachedPoints_[n]=this.getTouchPoint(e),n=Object.keys(this.cachedPoints_),this.isPinchZoomEnabled_&&2===n.length?this.handlePinch_(e):t.TouchGesture.superClass_.handleMove.call(this,e)},t.TouchGesture.prototype.handlePinch_=function(e){var n=Object.keys(this.cachedPoints_);if(n=t.utils.Coordinate.distance(this.cachedPoints_[n[0]],this.cachedPoints_[n[1]])/this.startDistance_,0<this.previousScale_&&1/0>this.previousScale_){var r=n-this.previousScale_;r=0<r?r*t.TouchGesture.ZOOM_IN_MULTIPLIER:r*t.TouchGesture.ZOOM_OUT_MULTIPLIER;var i=this.startWorkspace_,o=t.utils.mouseToSvg(e,i.getParentSvg(),i.getInverseScreenCTM());i.zoom(o.x,o.y,r)}this.previousScale_=n,e.preventDefault()},t.TouchGesture.prototype.handleTouchEnd=function(e){e=t.Touch.getTouchIdentifierFromEvent(e),this.cachedPoints_[e]&&delete this.cachedPoints_[e],2>Object.keys(this.cachedPoints_).length&&(this.cachedPoints_=Object.create(null),this.previousScale_=0)},t.TouchGesture.prototype.getTouchPoint=function(e){return this.startWorkspace_?new t.utils.Coordinate(e.pageX?e.pageX:e.changedTouches[0].pageX,e.pageY?e.pageY:e.changedTouches[0].pageY):null},t.WorkspaceAudio=function(t){this.parentWorkspace_=t,this.SOUNDS_=Object.create(null)},t.WorkspaceAudio.prototype.lastSound_=null,t.WorkspaceAudio.prototype.dispose=function(){this.SOUNDS_=this.parentWorkspace_=null},t.WorkspaceAudio.prototype.load=function(e,n){if(e.length){try{var r=new t.utils.global.Audio}catch(t){return}for(var i,o=0;o<e.length;o++){var s=e[o],a=s.match(/\.(\w+)$/);if(a&&r.canPlayType("audio/"+a[1])){i=new t.utils.global.Audio(s);break}}i&&i.play&&(this.SOUNDS_[n]=i)}},t.WorkspaceAudio.prototype.preload=function(){for(var e in this.SOUNDS_){var n=this.SOUNDS_[e];n.volume=.01;var r=n.play();if(void 0!==r?r.then(n.pause).catch(function(){}):n.pause(),t.utils.userAgent.IPAD||t.utils.userAgent.IPHONE)break}},t.WorkspaceAudio.prototype.play=function(e,n){var r=this.SOUNDS_[e];r?(e=new Date,null!=this.lastSound_&&e-this.lastSound_<t.SOUND_LIMIT||(this.lastSound_=e,(r=t.utils.userAgent.IPAD||t.utils.userAgent.ANDROID?r:r.cloneNode()).volume=void 0===n?1:n,r.play())):this.parentWorkspace_&&this.parentWorkspace_.getAudioManager().play(e,n)},t.WorkspaceSvg=function(e,n,r){t.WorkspaceSvg.superClass_.constructor.call(this,e),this.metricsManager_=new(t.registry.getClassFromOptions(t.registry.Type.METRICS_MANAGER,e,!0))(this),this.getMetrics=e.getMetrics||this.metricsManager_.getMetrics.bind(this.metricsManager_),this.setMetrics=e.setMetrics||t.WorkspaceSvg.setTopLevelWorkspaceMetrics_,this.componentManager_=new t.ComponentManager,this.connectionDBList=t.ConnectionDB.init(this.connectionChecker),n&&(this.blockDragSurface_=n),r&&(this.workspaceDragSurface_=r),this.useWorkspaceDragSurface_=!!this.workspaceDragSurface_&&t.utils.is3dSupported(),this.highlightedBlocks_=[],this.audioManager_=new t.WorkspaceAudio(e.parentWorkspace),this.grid_=this.options.gridPattern?new t.Grid(this.options.gridPattern,e.gridOptions):null,this.markerManager_=new t.MarkerManager(this),this.toolboxCategoryCallbacks_=Object.create(null),this.flyoutButtonCallbacks_=Object.create(null),t.Variables&&t.Variables.flyoutCategory&&this.registerToolboxCategoryCallback(t.VARIABLE_CATEGORY_NAME,t.Variables.flyoutCategory),t.VariablesDynamic&&t.VariablesDynamic.flyoutCategory&&this.registerToolboxCategoryCallback(t.VARIABLE_DYNAMIC_CATEGORY_NAME,t.VariablesDynamic.flyoutCategory),t.Procedures&&t.Procedures.flyoutCategory&&(this.registerToolboxCategoryCallback(t.PROCEDURE_CATEGORY_NAME,t.Procedures.flyoutCategory),this.addChangeListener(t.Procedures.mutatorOpenListener)),this.themeManager_=this.options.parentWorkspace?this.options.parentWorkspace.getThemeManager():new t.ThemeManager(this,this.options.theme||t.Themes.Classic),this.themeManager_.subscribeWorkspace(this),this.renderer_=t.blockRendering.init(this.options.renderer||"geras",this.getTheme(),this.options.rendererOverrides),this.cachedParentSvg_=null,this.keyboardAccessibilityMode=!1,this.topBoundedElements_=[],this.dragTargetAreas_=[],this.cachedParentSvgSize_=new t.utils.Size(0,0)},t.utils.object.inherits(t.WorkspaceSvg,t.Workspace),t.WorkspaceSvg.prototype.resizeHandlerWrapper_=null,t.WorkspaceSvg.prototype.rendered=!0,t.WorkspaceSvg.prototype.isVisible_=!0,t.WorkspaceSvg.prototype.isFlyout=!1,t.WorkspaceSvg.prototype.isMutator=!1,t.WorkspaceSvg.prototype.resizesEnabled_=!0,t.WorkspaceSvg.prototype.scrollX=0,t.WorkspaceSvg.prototype.scrollY=0,t.WorkspaceSvg.prototype.startScrollX=0,t.WorkspaceSvg.prototype.startScrollY=0,t.WorkspaceSvg.prototype.dragDeltaXY_=null,t.WorkspaceSvg.prototype.scale=1,t.WorkspaceSvg.prototype.oldScale_=1,t.WorkspaceSvg.prototype.oldTop_=0,t.WorkspaceSvg.prototype.oldLeft_=0,t.WorkspaceSvg.prototype.trashcan=null,t.WorkspaceSvg.prototype.scrollbar=null,t.WorkspaceSvg.prototype.flyout_=null,t.WorkspaceSvg.prototype.toolbox_=null,t.WorkspaceSvg.prototype.currentGesture_=null,t.WorkspaceSvg.prototype.blockDragSurface_=null,t.WorkspaceSvg.prototype.workspaceDragSurface_=null,t.WorkspaceSvg.prototype.useWorkspaceDragSurface_=!1,t.WorkspaceSvg.prototype.isDragSurfaceActive_=!1,t.WorkspaceSvg.prototype.injectionDiv_=null,t.WorkspaceSvg.prototype.lastRecordedPageScroll_=null,t.WorkspaceSvg.prototype.targetWorkspace=null,t.WorkspaceSvg.prototype.inverseScreenCTM_=null,t.WorkspaceSvg.prototype.inverseScreenCTMDirty_=!0,t.WorkspaceSvg.prototype.getMarkerManager=function(){return this.markerManager_},t.WorkspaceSvg.prototype.getMetricsManager=function(){return this.metricsManager_},t.WorkspaceSvg.prototype.setMetricsManager=function(t){this.metricsManager_=t,this.getMetrics=this.metricsManager_.getMetrics.bind(this.metricsManager_)},t.WorkspaceSvg.prototype.getComponentManager=function(){return this.componentManager_},t.WorkspaceSvg.prototype.setCursorSvg=function(t){this.markerManager_.setCursorSvg(t)},t.WorkspaceSvg.prototype.setMarkerSvg=function(t){this.markerManager_.setMarkerSvg(t)},t.WorkspaceSvg.prototype.getMarker=function(t){return this.markerManager_?this.markerManager_.getMarker(t):null},t.WorkspaceSvg.prototype.getCursor=function(){return this.markerManager_?this.markerManager_.getCursor():null},t.WorkspaceSvg.prototype.getRenderer=function(){return this.renderer_},t.WorkspaceSvg.prototype.getThemeManager=function(){return this.themeManager_},t.WorkspaceSvg.prototype.getTheme=function(){return this.themeManager_.getTheme()},t.WorkspaceSvg.prototype.setTheme=function(e){e||(e=t.Themes.Classic),this.themeManager_.setTheme(e)},t.WorkspaceSvg.prototype.refreshTheme=function(){this.svgGroup_&&this.renderer_.refreshDom(this.svgGroup_,this.getTheme()),this.updateBlockStyles_(this.getAllBlocks(!1).filter(function(t){return!!t.getStyleName()})),this.refreshToolboxSelection(),this.toolbox_&&this.toolbox_.refreshTheme(),this.isVisible()&&this.setVisible(!0);var e=new(t.Events.get(t.Events.THEME_CHANGE))(this.getTheme().name,this.id);t.Events.fire(e)},t.WorkspaceSvg.prototype.updateBlockStyles_=function(t){for(var e,n=0;e=t[n];n++){var r=e.getStyleName();r&&(e.setStyle(r),e.mutator&&e.mutator.updateBlockStyle())}},t.WorkspaceSvg.prototype.getInverseScreenCTM=function(){if(this.inverseScreenCTMDirty_){var t=this.getParentSvg().getScreenCTM();t&&(this.inverseScreenCTM_=t.inverse(),this.inverseScreenCTMDirty_=!1)}return this.inverseScreenCTM_},t.WorkspaceSvg.prototype.updateInverseScreenCTM=function(){this.inverseScreenCTMDirty_=!0},t.WorkspaceSvg.prototype.isVisible=function(){return this.isVisible_},t.WorkspaceSvg.prototype.getSvgXY=function(e){var n=0,r=0,i=1;(t.utils.dom.containsNode(this.getCanvas(),e)||t.utils.dom.containsNode(this.getBubbleCanvas(),e))&&(i=this.scale);do{var o=t.utils.getRelativeXY(e);e!=this.getCanvas()&&e!=this.getBubbleCanvas()||(i=1),n+=o.x*i,r+=o.y*i,e=e.parentNode}while(e&&e!=this.getParentSvg());return new t.utils.Coordinate(n,r)},t.WorkspaceSvg.prototype.getCachedParentSvgSize=function(){var e=this.cachedParentSvgSize_;return new t.utils.Size(e.width,e.height)},t.WorkspaceSvg.prototype.getOriginOffsetInPixels=function(){return t.utils.getInjectionDivXY_(this.getCanvas())},t.WorkspaceSvg.prototype.getInjectionDiv=function(){if(!this.injectionDiv_)for(var t=this.svgGroup_;t;){if(-1!=(" "+(t.getAttribute("class")||"")+" ").indexOf(" injectionDiv ")){this.injectionDiv_=t;break}t=t.parentNode}return this.injectionDiv_},t.WorkspaceSvg.prototype.getBlockCanvas=function(){return this.svgBlockCanvas_},t.WorkspaceSvg.prototype.setResizeHandlerWrapper=function(t){this.resizeHandlerWrapper_=t},t.WorkspaceSvg.prototype.createDom=function(e){return this.svgGroup_=t.utils.dom.createSvgElement(t.utils.Svg.G,{class:"blocklyWorkspace"},null),e&&(this.svgBackground_=t.utils.dom.createSvgElement(t.utils.Svg.RECT,{height:"100%",width:"100%",class:e},this.svgGroup_),"blocklyMainBackground"==e&&this.grid_?this.svgBackground_.style.fill="url(#"+this.grid_.getPatternId()+")":this.themeManager_.subscribe(this.svgBackground_,"workspaceBackgroundColour","fill")),this.svgBlockCanvas_=t.utils.dom.createSvgElement(t.utils.Svg.G,{class:"blocklyBlockCanvas"},this.svgGroup_),this.svgBubbleCanvas_=t.utils.dom.createSvgElement(t.utils.Svg.G,{class:"blocklyBubbleCanvas"},this.svgGroup_),this.isFlyout||(t.browserEvents.conditionalBind(this.svgGroup_,"mousedown",this,this.onMouseDown_,!1,!0),t.browserEvents.conditionalBind(this.svgGroup_,"wheel",this,this.onMouseWheel_)),this.options.hasCategories&&(this.toolbox_=new(t.registry.getClassFromOptions(t.registry.Type.TOOLBOX,this.options,!0))(this)),this.grid_&&this.grid_.update(this.scale),this.recordDragTargets(),(e=t.registry.getClassFromOptions(t.registry.Type.CURSOR,this.options))&&this.markerManager_.setCursor(new e),this.renderer_.createDom(this.svgGroup_,this.getTheme()),this.svgGroup_},t.WorkspaceSvg.prototype.dispose=function(){if(this.rendered=!1,this.currentGesture_&&this.currentGesture_.cancel(),this.svgGroup_&&(t.utils.dom.removeNode(this.svgGroup_),this.svgGroup_=null),this.svgBubbleCanvas_=this.svgBlockCanvas_=null,this.toolbox_&&(this.toolbox_.dispose(),this.toolbox_=null),this.flyout_&&(this.flyout_.dispose(),this.flyout_=null),this.trashcan&&(this.trashcan.dispose(),this.trashcan=null),this.scrollbar&&(this.scrollbar.dispose(),this.scrollbar=null),this.zoomControls_&&(this.zoomControls_.dispose(),this.zoomControls_=null),this.audioManager_&&(this.audioManager_.dispose(),this.audioManager_=null),this.grid_&&(this.grid_.dispose(),this.grid_=null),this.renderer_.dispose(),this.markerManager_&&(this.markerManager_.dispose(),this.markerManager_=null),t.WorkspaceSvg.superClass_.dispose.call(this),this.themeManager_&&(this.themeManager_.unsubscribeWorkspace(this),this.themeManager_.unsubscribe(this.svgBackground_),this.options.parentWorkspace||(this.themeManager_.dispose(),this.themeManager_=null)),this.flyoutButtonCallbacks_=this.toolboxCategoryCallbacks_=this.connectionDBList=null,!this.options.parentWorkspace){var e=this.getParentSvg();e&&e.parentNode&&t.utils.dom.removeNode(e.parentNode)}this.resizeHandlerWrapper_&&(t.browserEvents.unbind(this.resizeHandlerWrapper_),this.resizeHandlerWrapper_=null)},t.WorkspaceSvg.prototype.newBlock=function(e,n){return new t.BlockSvg(this,e,n)},t.WorkspaceSvg.prototype.addTrashcan=function(){if(!t.Trashcan)throw Error("Missing require for Blockly.Trashcan");this.trashcan=new t.Trashcan(this);var e=this.trashcan.createDom();this.svgGroup_.insertBefore(e,this.svgBlockCanvas_)},t.WorkspaceSvg.prototype.addZoomControls=function(){if(!t.ZoomControls)throw Error("Missing require for Blockly.ZoomControls");this.zoomControls_=new t.ZoomControls(this);var e=this.zoomControls_.createDom();this.svgGroup_.appendChild(e)},t.WorkspaceSvg.prototype.addFlyout=function(e){var n=new t.Options({parentWorkspace:this,rtl:this.RTL,oneBasedIndex:this.options.oneBasedIndex,horizontalLayout:this.horizontalLayout,renderer:this.options.renderer,rendererOverrides:this.options.rendererOverrides,move:{scrollbars:!0}});return n.toolboxPosition=this.options.toolboxPosition,this.flyout_=this.horizontalLayout?new(t.registry.getClassFromOptions(t.registry.Type.FLYOUTS_HORIZONTAL_TOOLBOX,this.options,!0))(n):new(t.registry.getClassFromOptions(t.registry.Type.FLYOUTS_VERTICAL_TOOLBOX,this.options,!0))(n),this.flyout_.autoClose=!1,this.flyout_.getWorkspace().setVisible(!0),this.flyout_.createDom(e)},t.WorkspaceSvg.prototype.getFlyout=function(t){return this.flyout_||t?this.flyout_:this.toolbox_?this.toolbox_.getFlyout():null},t.WorkspaceSvg.prototype.getToolbox=function(){return this.toolbox_},t.WorkspaceSvg.prototype.updateScreenCalculations_=function(){this.updateInverseScreenCTM(),this.recordDragTargets()},t.WorkspaceSvg.prototype.resizeContents=function(){this.resizesEnabled_&&this.rendered&&(this.scrollbar&&this.scrollbar.resize(),this.updateInverseScreenCTM())},t.WorkspaceSvg.prototype.resize=function(){this.toolbox_&&this.toolbox_.position(),this.flyout_&&this.flyout_.position();for(var e,n=this.componentManager_.getComponents(t.ComponentManager.Capability.POSITIONABLE,!0),r=this.getMetricsManager().getUiMetrics(),i=[],o=0;e=n[o];o++)e.position(r,i),(e=e.getBoundingRectangle())&&i.push(e);this.scrollbar&&this.scrollbar.resize(),this.updateScreenCalculations_()},t.WorkspaceSvg.prototype.updateScreenCalculationsIfScrolled=function(){var e=t.utils.getDocumentScroll();t.utils.Coordinate.equals(this.lastRecordedPageScroll_,e)||(this.lastRecordedPageScroll_=e,this.updateScreenCalculations_())},t.WorkspaceSvg.prototype.getCanvas=function(){return this.svgBlockCanvas_},t.WorkspaceSvg.prototype.setCachedParentSvgSize=function(t,e){var n=this.getParentSvg();t&&(this.cachedParentSvgSize_.width=t,n.cachedWidth_=t),e&&(this.cachedParentSvgSize_.height=e,n.cachedHeight_=e)},t.WorkspaceSvg.prototype.getBubbleCanvas=function(){return this.svgBubbleCanvas_},t.WorkspaceSvg.prototype.getParentSvg=function(){if(!this.cachedParentSvg_)for(var t=this.svgGroup_;t;){if("svg"==t.tagName){this.cachedParentSvg_=t;break}t=t.parentNode}return this.cachedParentSvg_},t.WorkspaceSvg.prototype.maybeFireViewportChangeEvent=function(){if(t.Events.isEnabled()){var e=this.scale,n=-this.scrollY,r=-this.scrollX;if(!(e==this.oldScale_&&1>Math.abs(n-this.oldTop_)&&1>Math.abs(r-this.oldLeft_))){var i=new(t.Events.get(t.Events.VIEWPORT_CHANGE))(n,r,e,this.id,this.oldScale_);this.oldScale_=e,this.oldTop_=n,this.oldLeft_=r,t.Events.fire(i)}}},t.WorkspaceSvg.prototype.translate=function(t,e){if(this.useWorkspaceDragSurface_&&this.isDragSurfaceActive_)this.workspaceDragSurface_.translateSurface(t,e);else{var n="translate("+t+","+e+") scale("+this.scale+")";this.svgBlockCanvas_.setAttribute("transform",n),this.svgBubbleCanvas_.setAttribute("transform",n)}this.blockDragSurface_&&this.blockDragSurface_.translateAndScaleGroup(t,e,this.scale),this.grid_&&this.grid_.moveTo(t,e),this.maybeFireViewportChangeEvent()},t.WorkspaceSvg.prototype.resetDragSurface=function(){if(this.useWorkspaceDragSurface_){this.isDragSurfaceActive_=!1;var t=this.workspaceDragSurface_.getSurfaceTranslation();this.workspaceDragSurface_.clearAndHide(this.svgGroup_),t="translate("+t.x+","+t.y+") scale("+this.scale+")",this.svgBlockCanvas_.setAttribute("transform",t),this.svgBubbleCanvas_.setAttribute("transform",t)}},t.WorkspaceSvg.prototype.setupDragSurface=function(){if(this.useWorkspaceDragSurface_&&!this.isDragSurfaceActive_){this.isDragSurfaceActive_=!0;var e=this.svgBlockCanvas_.previousSibling,n=parseInt(this.getParentSvg().getAttribute("width"),10),r=parseInt(this.getParentSvg().getAttribute("height"),10),i=t.utils.getRelativeXY(this.getCanvas());this.workspaceDragSurface_.setContentsAndShow(this.getCanvas(),this.getBubbleCanvas(),e,n,r,this.scale),this.workspaceDragSurface_.translateSurface(i.x,i.y)}},t.WorkspaceSvg.prototype.getBlockDragSurface=function(){return this.blockDragSurface_},t.WorkspaceSvg.prototype.getWidth=function(){var t=this.getMetrics();return t?t.viewWidth/this.scale:0},t.WorkspaceSvg.prototype.setVisible=function(e){if(this.isVisible_=e,this.svgGroup_)if(this.scrollbar&&this.scrollbar.setContainerVisible(e),this.getFlyout()&&this.getFlyout().setContainerVisible(e),this.getParentSvg().style.display=e?"block":"none",this.toolbox_&&this.toolbox_.setVisible(e),e){for(var n=(e=this.getAllBlocks(!1)).length-1;0<=n;n--)e[n].markDirty();this.render(),this.toolbox_&&this.toolbox_.position()}else t.hideChaff(!0)},t.WorkspaceSvg.prototype.render=function(){for(var t=this.getAllBlocks(!1),e=t.length-1;0<=e;e--)t[e].render(!1);if(this.currentGesture_)for(t=this.currentGesture_.getInsertionMarkers(),e=0;e<t.length;e++)t[e].render(!1);this.markerManager_.updateMarkers()},t.WorkspaceSvg.prototype.highlightBlock=function(e,n){if(void 0===n){for(var r,i=0;r=this.highlightedBlocks_[i];i++)r.setHighlighted(!1);this.highlightedBlocks_.length=0}(r=e?this.getBlockById(e):null)&&((e=void 0===n||n)?-1==this.highlightedBlocks_.indexOf(r)&&this.highlightedBlocks_.push(r):t.utils.arrayRemove(this.highlightedBlocks_,r),r.setHighlighted(e))},t.WorkspaceSvg.prototype.paste=function(t){!this.rendered||!t.tagName||t.getElementsByTagName("block").length>=this.remainingCapacity()||(this.currentGesture_&&this.currentGesture_.cancel(),"comment"==t.tagName.toLowerCase()?this.pasteWorkspaceComment_(t):this.pasteBlock_(t))},t.WorkspaceSvg.prototype.pasteBlock_=function(e){t.Events.disable();try{var n=t.Xml.domToBlock(e,this),r=parseInt(e.getAttribute("x"),10),i=parseInt(e.getAttribute("y"),10);if(!isNaN(r)&&!isNaN(i)){this.RTL&&(r=-r);do{e=!1;for(var o,s=this.getAllBlocks(!1),a=0;o=s[a];a++){var l=o.getRelativeToSurfaceXY();if(1>=Math.abs(r-l.x)&&1>=Math.abs(i-l.y)){e=!0;break}}if(!e){var u,c=n.getConnections_(!1);for(a=0;u=c[a];a++)if(u.closest(t.SNAP_RADIUS,new t.utils.Coordinate(r,i)).connection){e=!0;break}}e&&(r=this.RTL?r-t.SNAP_RADIUS:r+t.SNAP_RADIUS,i+=2*t.SNAP_RADIUS)}while(e);n.moveBy(r,i)}}finally{t.Events.enable()}t.Events.isEnabled()&&!n.isShadow()&&t.Events.fire(new(t.Events.get(t.Events.BLOCK_CREATE))(n)),n.select()},t.WorkspaceSvg.prototype.pasteWorkspaceComment_=function(e){t.Events.disable();try{var n=t.WorkspaceCommentSvg.fromXml(e,this),r=parseInt(e.getAttribute("x"),10),i=parseInt(e.getAttribute("y"),10);isNaN(r)||isNaN(i)||(this.RTL&&(r=-r),n.moveBy(r+50,i+50))}finally{t.Events.enable()}t.Events.isEnabled()&&t.WorkspaceComment.fireCreateEvent(n),n.select()},t.WorkspaceSvg.prototype.refreshToolboxSelection=function(){var t=this.isFlyout?this.targetWorkspace:this;t&&!t.currentGesture_&&t.toolbox_&&t.toolbox_.getFlyout()&&t.toolbox_.refreshSelection()},t.WorkspaceSvg.prototype.renameVariableById=function(e,n){t.WorkspaceSvg.superClass_.renameVariableById.call(this,e,n),this.refreshToolboxSelection()},t.WorkspaceSvg.prototype.deleteVariableById=function(e){t.WorkspaceSvg.superClass_.deleteVariableById.call(this,e),this.refreshToolboxSelection()},t.WorkspaceSvg.prototype.createVariable=function(e,n,r){return e=t.WorkspaceSvg.superClass_.createVariable.call(this,e,n,r),this.refreshToolboxSelection(),e},t.WorkspaceSvg.prototype.recordDeleteAreas=function(){t.utils.deprecation.warn("WorkspaceSvg.prototype.recordDeleteAreas","June 2021","June 2022","WorkspaceSvg.prototype.recordDragTargets"),this.recordDragTargets()},t.WorkspaceSvg.prototype.recordDragTargets=function(){var e=this.componentManager_.getComponents(t.ComponentManager.Capability.DRAG_TARGET,!0);this.dragTargetAreas_=[];for(var n,r=0;n=e[r];r++){var i=n.getClientRect();i&&this.dragTargetAreas_.push({component:n,clientRect:i})}},t.WorkspaceSvg.prototype.getDragTarget=function(t){for(var e,n=0;e=this.dragTargetAreas_[n];n++)if(e.clientRect.contains(t.clientX,t.clientY))return e.component;return null},t.WorkspaceSvg.prototype.onMouseDown_=function(t){var e=this.getGesture(t);e&&e.handleWsStart(t,this)},t.WorkspaceSvg.prototype.startDrag=function(e,n){(e=t.utils.mouseToSvg(e,this.getParentSvg(),this.getInverseScreenCTM())).x/=this.scale,e.y/=this.scale,this.dragDeltaXY_=t.utils.Coordinate.difference(n,e)},t.WorkspaceSvg.prototype.moveDrag=function(e){return(e=t.utils.mouseToSvg(e,this.getParentSvg(),this.getInverseScreenCTM())).x/=this.scale,e.y/=this.scale,t.utils.Coordinate.sum(this.dragDeltaXY_,e)},t.WorkspaceSvg.prototype.isDragging=function(){return null!=this.currentGesture_&&this.currentGesture_.isDragging()},t.WorkspaceSvg.prototype.isDraggable=function(){return this.options.moveOptions&&this.options.moveOptions.drag},t.WorkspaceSvg.prototype.isMovable=function(){return this.options.moveOptions&&!!this.options.moveOptions.scrollbars||this.options.moveOptions&&this.options.moveOptions.wheel||this.options.moveOptions&&this.options.moveOptions.drag||this.options.zoomOptions&&this.options.zoomOptions.wheel||this.options.zoomOptions&&this.options.zoomOptions.pinch},t.WorkspaceSvg.prototype.isMovableHorizontally=function(){var t=!!this.scrollbar;return this.isMovable()&&(!t||t&&this.scrollbar.canScrollHorizontally())},t.WorkspaceSvg.prototype.isMovableVertically=function(){var t=!!this.scrollbar;return this.isMovable()&&(!t||t&&this.scrollbar.canScrollVertically())},t.WorkspaceSvg.prototype.onMouseWheel_=function(e){if(t.Gesture.inProgress())e.preventDefault(),e.stopPropagation();else{var n=this.options.zoomOptions&&this.options.zoomOptions.wheel,r=this.options.moveOptions&&this.options.moveOptions.wheel;if(n||r){var i=t.utils.getScrollDeltaPixels(e);!n||!e.ctrlKey&&r?(n=this.scrollX-i.x,r=this.scrollY-i.y,e.shiftKey&&!i.x&&(n=this.scrollX-i.y,r=this.scrollY),this.scroll(n,r)):(i=-i.y/50,n=t.utils.mouseToSvg(e,this.getParentSvg(),this.getInverseScreenCTM()),this.zoom(n.x,n.y,i)),e.preventDefault()}}},t.WorkspaceSvg.prototype.getBlocksBoundingBox=function(){var e=this.getTopBoundedElements();if(!e.length)return new t.utils.Rect(0,0,0,0);for(var n=e[0].getBoundingRectangle(),r=1;r<e.length;r++){var i=e[r];i.isInsertionMarker&&i.isInsertionMarker()||((i=i.getBoundingRectangle()).top<n.top&&(n.top=i.top),i.bottom>n.bottom&&(n.bottom=i.bottom),i.left<n.left&&(n.left=i.left),i.right>n.right&&(n.right=i.right))}return n},t.WorkspaceSvg.prototype.cleanUp=function(){this.setResizesEnabled(!1),t.Events.setGroup(!0);for(var e,n=this.getTopBlocks(!0),r=0,i=0;e=n[i];i++)if(e.isMovable()){var o=e.getRelativeToSurfaceXY();e.moveBy(-o.x,r-o.y),e.snapToGrid(),r=e.getRelativeToSurfaceXY().y+e.getHeightWidth().height+this.renderer_.getConstants().MIN_BLOCK_HEIGHT}t.Events.setGroup(!1),this.setResizesEnabled(!0)},t.WorkspaceSvg.prototype.showContextMenu=function(e){if(!this.options.readOnly&&!this.isFlyout){var n=t.ContextMenuRegistry.registry.getContextMenuOptions(t.ContextMenuRegistry.ScopeType.WORKSPACE,{workspace:this});this.configureContextMenu&&this.configureContextMenu(n,e),t.ContextMenu.show(e,n,this.RTL)}},t.WorkspaceSvg.prototype.updateToolbox=function(e){if(e=t.utils.toolbox.convertToolboxDefToJson(e)){if(!this.options.languageTree)throw Error("Existing toolbox is null. Can't create new toolbox.");if(t.utils.toolbox.hasCategories(e)){if(!this.toolbox_)throw Error("Existing toolbox has no categories. Can't change mode.");this.options.languageTree=e,this.toolbox_.render(e)}else{if(!this.flyout_)throw Error("Existing toolbox has categories. Can't change mode.");this.options.languageTree=e,this.flyout_.show(e)}}else if(this.options.languageTree)throw Error("Can't nullify an existing toolbox.")},t.WorkspaceSvg.prototype.markFocused=function(){this.options.parentWorkspace?this.options.parentWorkspace.markFocused():(t.mainWorkspace=this,this.setBrowserFocus())},t.WorkspaceSvg.prototype.setBrowserFocus=function(){document.activeElement&&document.activeElement.blur&&document.activeElement.blur();try{this.getParentSvg().focus({preventScroll:!0})}catch(t){try{this.getParentSvg().parentNode.setActive()}catch(t){this.getParentSvg().parentNode.focus({preventScroll:!0})}}},t.WorkspaceSvg.prototype.zoom=function(t,e,n){n=Math.pow(this.options.zoomOptions.scaleSpeed,n);var r=this.scale*n;if(this.scale!=r){r>this.options.zoomOptions.maxScale?n=this.options.zoomOptions.maxScale/this.scale:r<this.options.zoomOptions.minScale&&(n=this.options.zoomOptions.minScale/this.scale);var i=this.getCanvas().getCTM(),o=this.getParentSvg().createSVGPoint();o.x=t,o.y=e,t=(o=o.matrixTransform(i.inverse())).x,e=o.y,i=i.translate(t*(1-n),e*(1-n)).scale(n),this.scrollX=i.e,this.scrollY=i.f,this.setScale(r)}},t.WorkspaceSvg.prototype.zoomCenter=function(t){var e=this.getMetrics();if(this.flyout_){var n=e.svgWidth?e.svgWidth/2:0;e=e.svgHeight?e.svgHeight/2:0}else n=e.viewWidth/2+e.absoluteLeft,e=e.viewHeight/2+e.absoluteTop;this.zoom(n,e,t)},t.WorkspaceSvg.prototype.zoomToFit=function(){if(this.isMovable()){var e=this.getMetrics(),n=e.viewWidth;e=e.viewHeight;var r=this.getBlocksBoundingBox(),i=r.right-r.left;if(r=r.bottom-r.top,i){this.flyout_&&(this.horizontalLayout?(e+=this.flyout_.getHeight(),r+=this.flyout_.getHeight()/this.scale):(n+=this.flyout_.getWidth(),i+=this.flyout_.getWidth()/this.scale)),n/=i,e/=r,t.Events.disable();try{this.setScale(Math.min(n,e)),this.scrollCenter()}finally{t.Events.enable()}this.maybeFireViewportChangeEvent()}}else console.warn("Tried to move a non-movable workspace. This could result in blocks becoming inaccessible.")},t.WorkspaceSvg.prototype.beginCanvasTransition=function(){t.utils.dom.addClass(this.svgBlockCanvas_,"blocklyCanvasTransitioning"),t.utils.dom.addClass(this.svgBubbleCanvas_,"blocklyCanvasTransitioning")},t.WorkspaceSvg.prototype.endCanvasTransition=function(){t.utils.dom.removeClass(this.svgBlockCanvas_,"blocklyCanvasTransitioning"),t.utils.dom.removeClass(this.svgBubbleCanvas_,"blocklyCanvasTransitioning")},t.WorkspaceSvg.prototype.scrollCenter=function(){if(this.isMovable()){var t=this.getMetrics(),e=(t.scrollWidth-t.viewWidth)/2,n=(t.scrollHeight-t.viewHeight)/2;e=-e-t.scrollLeft,n=-n-t.scrollTop,this.scroll(e,n)}else console.warn("Tried to move a non-movable workspace. This could result in blocks becoming inaccessible.")},t.WorkspaceSvg.prototype.centerOnBlock=function(t){if(this.isMovable()){if(t=t?this.getBlockById(t):null){var e=t.getRelativeToSurfaceXY(),n=t.getHeightWidth(),r=this.scale;t=(e.x+(this.RTL?-1:1)*n.width/2)*r,e=(e.y+n.height/2)*r,n=this.getMetrics(),this.scroll(-(t-n.viewWidth/2),-(e-n.viewHeight/2))}}else console.warn("Tried to move a non-movable workspace. This could result in blocks becoming inaccessible.")},t.WorkspaceSvg.prototype.setScale=function(e){this.options.zoomOptions.maxScale&&e>this.options.zoomOptions.maxScale?e=this.options.zoomOptions.maxScale:this.options.zoomOptions.minScale&&e<this.options.zoomOptions.minScale&&(e=this.options.zoomOptions.minScale),this.scale=e,t.hideChaff(!1),this.flyout_&&(this.flyout_.reflow(),this.recordDragTargets()),this.grid_&&this.grid_.update(this.scale),e=this.getMetrics(),this.scrollX-=e.absoluteLeft,this.scrollY-=e.absoluteTop,e.viewLeft+=e.absoluteLeft,e.viewTop+=e.absoluteTop,this.scroll(this.scrollX,this.scrollY),this.scrollbar&&(this.flyout_?this.scrollbar.resizeView(e):this.scrollbar.resizeContent(e))},t.WorkspaceSvg.prototype.getScale=function(){return this.options.parentWorkspace?this.options.parentWorkspace.getScale():this.scale},t.WorkspaceSvg.prototype.scroll=function(e,n){t.hideChaff(!0);var r=this.getMetrics();e=Math.min(e,-r.scrollLeft),n=Math.min(n,-r.scrollTop);var i=r.scrollTop+Math.max(0,r.scrollHeight-r.viewHeight);e=Math.max(e,-(r.scrollLeft+Math.max(0,r.scrollWidth-r.viewWidth))),n=Math.max(n,-i),this.scrollX=e,this.scrollY=n,this.scrollbar&&this.scrollbar.set(-(e+r.scrollLeft),-(n+r.scrollTop),!1),e+=r.absoluteLeft,n+=r.absoluteTop,this.translate(e,n)},t.WorkspaceSvg.setTopLevelWorkspaceMetrics_=function(t){var e=this.getMetrics();"number"==typeof t.x&&(this.scrollX=-(e.scrollLeft+(e.scrollWidth-e.viewWidth)*t.x)),"number"==typeof t.y&&(this.scrollY=-(e.scrollTop+(e.scrollHeight-e.viewHeight)*t.y)),this.translate(this.scrollX+e.absoluteLeft,this.scrollY+e.absoluteTop)},t.WorkspaceSvg.prototype.getBlockById=function(e){return t.WorkspaceSvg.superClass_.getBlockById.call(this,e)},t.WorkspaceSvg.prototype.getTopBlocks=function(e){return t.WorkspaceSvg.superClass_.getTopBlocks.call(this,e)},t.WorkspaceSvg.prototype.addTopBlock=function(e){this.addTopBoundedElement(e),t.WorkspaceSvg.superClass_.addTopBlock.call(this,e)},t.WorkspaceSvg.prototype.removeTopBlock=function(e){this.removeTopBoundedElement(e),t.WorkspaceSvg.superClass_.removeTopBlock.call(this,e)},t.WorkspaceSvg.prototype.addTopComment=function(e){this.addTopBoundedElement(e),t.WorkspaceSvg.superClass_.addTopComment.call(this,e)},t.WorkspaceSvg.prototype.removeTopComment=function(e){this.removeTopBoundedElement(e),t.WorkspaceSvg.superClass_.removeTopComment.call(this,e)},t.WorkspaceSvg.prototype.addTopBoundedElement=function(t){this.topBoundedElements_.push(t)},t.WorkspaceSvg.prototype.removeTopBoundedElement=function(e){t.utils.arrayRemove(this.topBoundedElements_,e)},t.WorkspaceSvg.prototype.getTopBoundedElements=function(){return[].concat(this.topBoundedElements_)},t.WorkspaceSvg.prototype.setResizesEnabled=function(t){var e=!this.resizesEnabled_&&t;this.resizesEnabled_=t,e&&this.resizeContents()},t.WorkspaceSvg.prototype.clear=function(){this.setResizesEnabled(!1),t.WorkspaceSvg.superClass_.clear.call(this),this.topBoundedElements_=[],this.setResizesEnabled(!0)},t.WorkspaceSvg.prototype.registerButtonCallback=function(t,e){if("function"!=typeof e)throw TypeError("Button callbacks must be functions.");this.flyoutButtonCallbacks_[t]=e},t.WorkspaceSvg.prototype.getButtonCallback=function(t){return(t=this.flyoutButtonCallbacks_[t])?t:null},t.WorkspaceSvg.prototype.removeButtonCallback=function(t){this.flyoutButtonCallbacks_[t]=null},t.WorkspaceSvg.prototype.registerToolboxCategoryCallback=function(t,e){if("function"!=typeof e)throw TypeError("Toolbox category callbacks must be functions.");this.toolboxCategoryCallbacks_[t]=e},t.WorkspaceSvg.prototype.getToolboxCategoryCallback=function(t){return this.toolboxCategoryCallbacks_[t]||null},t.WorkspaceSvg.prototype.removeToolboxCategoryCallback=function(t){this.toolboxCategoryCallbacks_[t]=null},t.WorkspaceSvg.prototype.getGesture=function(e){var n="mousedown"==e.type||"touchstart"==e.type||"pointerdown"==e.type,r=this.currentGesture_;return r?n&&r.hasStarted()?(console.warn("Tried to start the same gesture twice."),r.cancel(),null):r:n?this.currentGesture_=new t.TouchGesture(e,this):null},t.WorkspaceSvg.prototype.clearGesture=function(){this.currentGesture_=null},t.WorkspaceSvg.prototype.cancelCurrentGesture=function(){this.currentGesture_&&this.currentGesture_.cancel()},t.WorkspaceSvg.prototype.getAudioManager=function(){return this.audioManager_},t.WorkspaceSvg.prototype.getGrid=function(){return this.grid_},t.inject=function(e,n){if(t.checkBlockColourConstants(),"string"==typeof e&&(e=document.getElementById(e)||document.querySelector(e)),!e||!t.utils.dom.containsNode(document,e))throw Error("Error: container is not in current document.");n=new t.Options(n||{});var r=document.createElement("div");r.className="injectionDiv",r.tabIndex=0,t.utils.aria.setState(r,t.utils.aria.State.LABEL,t.Msg.WORKSPACE_ARIA_LABEL),e.appendChild(r),e=t.createDom_(r,n);var i=new t.BlockDragSurfaceSvg(r),o=new t.WorkspaceDragSurfaceSvg(r),s=t.createMainWorkspace_(e,n,i,o);return t.init_(s),t.mainWorkspace=s,t.svgResize(s),r.addEventListener("focusin",function(){t.mainWorkspace=s}),s},t.createDom_=function(e,n){e.setAttribute("dir","LTR"),t.Css.inject(n.hasCss,n.pathToMedia),e=t.utils.dom.createSvgElement(t.utils.Svg.SVG,{xmlns:t.utils.dom.SVG_NS,"xmlns:html":t.utils.dom.HTML_NS,"xmlns:xlink":t.utils.dom.XLINK_NS,version:"1.1",class:"blocklySvg",tabindex:"0"},e);var r=t.utils.dom.createSvgElement(t.utils.Svg.DEFS,{},e),i=String(Math.random()).substring(2);return n.gridPattern=t.Grid.createDom(i,n.gridOptions,r),e},t.createMainWorkspace_=function(e,n,r,i){return n.parentWorkspace=null,r=(n=new t.WorkspaceSvg(n,r,i)).options,n.scale=r.zoomOptions.startScale,e.appendChild(n.createDom("blocklyMainBackground")),t.utils.dom.addClass(n.getInjectionDiv(),n.getRenderer().getClassName()),t.utils.dom.addClass(n.getInjectionDiv(),n.getTheme().getClassName()),!r.hasCategories&&r.languageTree&&(i=n.addFlyout(t.utils.Svg.SVG),t.utils.dom.insertAfter(i,e)),r.hasTrashcan&&n.addTrashcan(),r.zoomOptions&&r.zoomOptions.controls&&n.addZoomControls(),n.getThemeManager().subscribe(e,"workspaceBackgroundColour","background-color"),n.translate(0,0),n.addChangeListener(t.bumpIntoBoundsHandler_(n)),t.svgResize(n),t.WidgetDiv.createDom(),t.DropDownDiv.createDom(),t.Tooltip.createDom(),n},t.extractObjectFromEvent_=function(e,n){var r=null;switch(n.type){case t.Events.BLOCK_CREATE:case t.Events.BLOCK_MOVE:(r=e.getBlockById(n.blockId))&&(r=r.getRootBlock());break;case t.Events.COMMENT_CREATE:case t.Events.COMMENT_MOVE:r=e.getCommentById(n.commentId)}return r},t.bumpTopObjectsIntoBounds_=function(e){var n=e.getMetricsManager();if(n.hasFixedEdges()&&!e.isDragging()){n=n.getScrollMetrics(!0);for(var r,i=e.getTopBoundedElements(),o=0;r=i[o];o++)t.bumpObjectIntoBounds_(e,n,r)}},t.bumpIntoBoundsHandler_=function(e){return function(n){var r=e.getMetricsManager();if(r.hasFixedEdges()&&!e.isDragging())if(-1!==t.Events.BUMP_EVENTS.indexOf(n.type)){r=r.getScrollMetrics(!0);var i=t.extractObjectFromEvent_(e,n);if(i){var o=t.Events.getGroup();t.Events.setGroup(n.group),t.bumpObjectIntoBounds_(e,r,i)&&!n.group&&console.warn("Moved object in bounds but there was no event group. This may break undo."),null!==o&&t.Events.setGroup(o)}}else n.type===t.Events.VIEWPORT_CHANGE&&n.scale>n.oldScale&&t.bumpTopObjectsIntoBounds_(e)}},t.bumpObjectIntoBounds_=function(e,n,r){var i=r.getBoundingRectangle(),o=i.right-i.left,s=t.utils.math.clamp(n.top,i.top,n.top+n.height-(i.bottom-i.top))-i.top,a=n.left;return n=n.left+n.width-o,e.RTL?a=Math.min(n,a):n=Math.max(a,n),!(!(e=t.utils.math.clamp(a,i.left,n)-i.left)&&!s)&&(r.moveBy(e,s),!0)},t.init_=function(e){var n=e.options,r=e.getParentSvg();if(t.browserEvents.conditionalBind(r.parentNode,"contextmenu",null,function(e){t.utils.isTargetInput(e)||e.preventDefault()}),r=t.browserEvents.conditionalBind(window,"resize",null,function(){t.hideChaff(!0),t.svgResize(e),t.bumpTopObjectsIntoBounds_(e)}),e.setResizeHandlerWrapper(r),t.inject.bindDocumentEvents_(),n.languageTree){r=e.getToolbox();var i=e.getFlyout(!0);r?r.init():i&&(i.init(e),i.show(n.languageTree),"function"==typeof i.scrollToStart&&i.scrollToStart())}n.hasTrashcan&&e.trashcan.init(),n.zoomOptions&&n.zoomOptions.controls&&e.zoomControls_.init(),n.moveOptions&&n.moveOptions.scrollbars?(e.scrollbar=new t.ScrollbarPair(e,!0===n.moveOptions.scrollbars||!!n.moveOptions.scrollbars.horizontal,!0===n.moveOptions.scrollbars||!!n.moveOptions.scrollbars.vertical,"blocklyMainWorkspaceScrollbar"),e.scrollbar.resize()):e.setMetrics({x:.5,y:.5}),n.hasSounds&&t.inject.loadSounds_(n.pathToMedia,e)},t.inject.bindDocumentEvents_=function(){t.documentEventsBound_||(t.browserEvents.conditionalBind(document,"scroll",null,function(){for(var e,n=t.Workspace.getAll(),r=0;e=n[r];r++)e.updateInverseScreenCTM&&e.updateInverseScreenCTM()}),t.browserEvents.conditionalBind(document,"keydown",null,t.onKeyDown),t.browserEvents.bind(document,"touchend",null,t.longStop_),t.browserEvents.bind(document,"touchcancel",null,t.longStop_),t.utils.userAgent.IPAD&&t.browserEvents.conditionalBind(window,"orientationchange",document,function(){t.svgResize(t.getMainWorkspace())})),t.documentEventsBound_=!0},t.inject.loadSounds_=function(e,n){var r=n.getAudioManager();r.load([e+"click.mp3",e+"click.wav",e+"click.ogg"],"click"),r.load([e+"disconnect.wav",e+"disconnect.mp3",e+"disconnect.ogg"],"disconnect"),r.load([e+"delete.mp3",e+"delete.ogg",e+"delete.wav"],"delete");var i=[];e=function(){for(;i.length;)t.browserEvents.unbind(i.pop());r.preload()},i.push(t.browserEvents.conditionalBind(document,"mousemove",null,e,!0)),i.push(t.browserEvents.conditionalBind(document,"touchstart",null,e,!0))},t.Names=function(t,e){if(this.variablePrefix_=e||"",this.reservedDict_=Object.create(null),t)for(t=t.split(","),e=0;e<t.length;e++)this.reservedDict_[t[e]]=!0;this.reset()},t.Names.DEVELOPER_VARIABLE_TYPE="DEVELOPER_VARIABLE",t.Names.prototype.reset=function(){this.db_=Object.create(null),this.dbReverse_=Object.create(null),this.variableMap_=null},t.Names.prototype.setVariableMap=function(t){this.variableMap_=t},t.Names.prototype.getNameForUserVariable_=function(t){return this.variableMap_?(t=this.variableMap_.getVariableById(t))?t.name:null:(console.warn("Deprecated call to Blockly.Names.prototype.getName without defining a variable map. To fix, add the following code in your generator's init() function:\nBlockly.YourGeneratorName.nameDB_.setVariableMap(workspace.getVariableMap());"),null)},t.Names.prototype.populateVariables=function(e){e=t.Variables.allUsedVarModels(e);for(var n=0;n<e.length;n++)this.getName(e[n].getId(),t.VARIABLE_CATEGORY_NAME)},t.Names.prototype.populateProcedures=function(e){e=(e=t.Procedures.allProcedures(e))[0].concat(e[1]);for(var n=0;n<e.length;n++)this.getName(e[n][0],t.PROCEDURE_CATEGORY_NAME)},t.Names.prototype.getName=function(e,n){var r=e;n==t.VARIABLE_CATEGORY_NAME&&(e=this.getNameForUserVariable_(e))&&(r=e),e=r.toLowerCase();var i=n==t.VARIABLE_CATEGORY_NAME||n==t.Names.DEVELOPER_VARIABLE_TYPE?this.variablePrefix_:"";n in this.db_||(this.db_[n]=Object.create(null));var o=this.db_[n];return e in o?i+o[e]:(n=this.getDistinctName(r,n),o[e]=n.substr(i.length),n)},t.Names.prototype.getUserNames=function(t){return Object.keys(this.db_[t]||{})},t.Names.prototype.getDistinctName=function(e,n){e=this.safeName_(e);for(var r="";this.dbReverse_[e+r]||e+r in this.reservedDict_;)r=r?r+1:2;return e+=r,this.dbReverse_[e]=!0,(n==t.VARIABLE_CATEGORY_NAME||n==t.Names.DEVELOPER_VARIABLE_TYPE?this.variablePrefix_:"")+e},t.Names.prototype.safeName_=function(e){return e?(e=encodeURI(e.replace(/ /g,"_")).replace(/[^\w]/g,"_"),-1!="0123456789".indexOf(e[0])&&(e="my_"+e)):e=t.Msg.UNNAMED_KEY||"unnamed",e},t.Names.equals=function(t,e){return t.toLowerCase()==e.toLowerCase()},t.Procedures={},t.Procedures.NAME_TYPE=t.PROCEDURE_CATEGORY_NAME,t.Procedures.DEFAULT_ARG="x",t.Procedures.allProcedures=function(e){var n=e.getBlocksByType("procedures_defnoreturn",!1).map(function(t){return t.getProcedureDef()});return e=e.getBlocksByType("procedures_defreturn",!1).map(function(t){return t.getProcedureDef()}),n.sort(t.Procedures.procTupleComparator_),e.sort(t.Procedures.procTupleComparator_),[n,e]},t.Procedures.procTupleComparator_=function(t,e){return t[0].localeCompare(e[0],void 0,{sensitivity:"base"})},t.Procedures.findLegalName=function(e,n){if(n.isInFlyout)return e;for(e=e||t.Msg.UNNAMED_KEY||"unnamed";!t.Procedures.isLegalName_(e,n.workspace,n);){var r=e.match(/^(.*?)(\d+)$/);e=r?r[1]+(parseInt(r[2],10)+1):e+"2"}return e},t.Procedures.isLegalName_=function(e,n,r){return!t.Procedures.isNameUsed(e,n,r)},t.Procedures.isNameUsed=function(e,n,r){n=n.getAllBlocks(!1);for(var i=0;i<n.length;i++)if(n[i]!=r&&n[i].getProcedureDef){var o=n[i].getProcedureDef();if(t.Names.equals(o[0],e))return!0}return!1},t.Procedures.rename=function(e){e=e.trim();var n=t.Procedures.findLegalName(e,this.getSourceBlock()),r=this.getValue();if(r!=e&&r!=n){e=this.getSourceBlock().workspace.getAllBlocks(!1);for(var i=0;i<e.length;i++)e[i].renameProcedure&&e[i].renameProcedure(r,n)}return n},t.Procedures.flyoutCategory=function(e){function n(e,n){for(var i=0;i<e.length;i++){var o=e[i][0],s=e[i][1],a=t.utils.xml.createElement("block");a.setAttribute("type",n),a.setAttribute("gap",16);var l=t.utils.xml.createElement("mutation");for(l.setAttribute("name",o),a.appendChild(l),o=0;o<s.length;o++){var u=t.utils.xml.createElement("arg");u.setAttribute("name",s[o]),l.appendChild(u)}r.push(a)}}var r=[];if(t.Blocks.procedures_defnoreturn){var i=t.utils.xml.createElement("block");i.setAttribute("type","procedures_defnoreturn"),i.setAttribute("gap",16);var o=t.utils.xml.createElement("field");o.setAttribute("name","NAME"),o.appendChild(t.utils.xml.createTextNode(t.Msg.PROCEDURES_DEFNORETURN_PROCEDURE)),i.appendChild(o),r.push(i)}return t.Blocks.procedures_defreturn&&((i=t.utils.xml.createElement("block")).setAttribute("type","procedures_defreturn"),i.setAttribute("gap",16),(o=t.utils.xml.createElement("field")).setAttribute("name","NAME"),o.appendChild(t.utils.xml.createTextNode(t.Msg.PROCEDURES_DEFRETURN_PROCEDURE)),i.appendChild(o),r.push(i)),t.Blocks.procedures_ifreturn&&((i=t.utils.xml.createElement("block")).setAttribute("type","procedures_ifreturn"),i.setAttribute("gap",16),r.push(i)),r.length&&r[r.length-1].setAttribute("gap",24),n((e=t.Procedures.allProcedures(e))[0],"procedures_callnoreturn"),n(e[1],"procedures_callreturn"),r},t.Procedures.updateMutatorFlyout_=function(e){for(var n,r=[],i=e.getBlocksByType("procedures_mutatorarg",!1),o=0;n=i[o];o++)r.push(n.getFieldValue("NAME"));i=t.utils.xml.createElement("xml"),(o=t.utils.xml.createElement("block")).setAttribute("type","procedures_mutatorarg"),(n=t.utils.xml.createElement("field")).setAttribute("name","NAME"),r=t.Variables.generateUniqueNameFromOptions(t.Procedures.DEFAULT_ARG,r),r=t.utils.xml.createTextNode(r),n.appendChild(r),o.appendChild(n),i.appendChild(o),e.updateToolbox(i)},t.Procedures.mutatorOpenListener=function(e){if(e.type==t.Events.BUBBLE_OPEN&&"mutator"===e.bubbleType&&e.isOpen){var n=(e=t.Workspace.getById(e.workspaceId).getBlockById(e.blockId)).type;"procedures_defnoreturn"!=n&&"procedures_defreturn"!=n||(e=e.mutator.getWorkspace(),t.Procedures.updateMutatorFlyout_(e),e.addChangeListener(t.Procedures.mutatorChangeListener_))}},t.Procedures.mutatorChangeListener_=function(e){e.type!=t.Events.BLOCK_CREATE&&e.type!=t.Events.BLOCK_DELETE&&e.type!=t.Events.BLOCK_CHANGE||(e=t.Workspace.getById(e.workspaceId),t.Procedures.updateMutatorFlyout_(e))},t.Procedures.getCallers=function(e,n){var r=[];n=n.getAllBlocks(!1);for(var i=0;i<n.length;i++)if(n[i].getProcedureCall){var o=n[i].getProcedureCall();o&&t.Names.equals(o,e)&&r.push(n[i])}return r},t.Procedures.mutateCallers=function(e){var n,r=t.Events.recordUndo,i=e.getProcedureDef()[0],o=e.mutationToDom(!0);for(e=t.Procedures.getCallers(i,e.workspace),i=0;n=e[i];i++){var s=n.mutationToDom();s=s&&t.Xml.domToText(s),n.domToMutation(o);var a=n.mutationToDom();s!=(a=a&&t.Xml.domToText(a))&&(t.Events.recordUndo=!1,t.Events.fire(new(t.Events.get(t.Events.BLOCK_CHANGE))(n,"mutation",null,s,a)),t.Events.recordUndo=r)}},t.Procedures.getDefinition=function(e,n){n=n.getAllBlocks(!1);for(var r=0;r<n.length;r++)if(n[r].getProcedureDef){var i=n[r].getProcedureDef();if(i&&t.Names.equals(i[0],e))return n[r]}return null},t.ShortcutRegistry=function(){t.ShortcutRegistry.registry=this,this.registry_=Object.create(null),this.keyMap_=Object.create(null)},t.ShortcutRegistry.modifierKeys={Shift:t.utils.KeyCodes.SHIFT,Control:t.utils.KeyCodes.CTRL,Alt:t.utils.KeyCodes.ALT,Meta:t.utils.KeyCodes.META},t.ShortcutRegistry.prototype.register=function(t,e){if(this.registry_[t.name]&&!e)throw Error('Shortcut with name "'+t.name+'" already exists.');this.registry_[t.name]=t},t.ShortcutRegistry.prototype.unregister=function(t){return this.registry_[t]?(this.removeAllKeyMappings(t),delete this.registry_[t],!0):(console.warn('Keyboard shortcut with name "'+t+'" not found.'),!1)},t.ShortcutRegistry.prototype.addKeyMapping=function(t,e,n){t=String(t);var r=this.keyMap_[t];if(r&&!n)throw Error('Shortcut with name "'+e+'" collides with shortcuts '+r.toString());r&&n?r.unshift(e):this.keyMap_[t]=[e]},t.ShortcutRegistry.prototype.removeKeyMapping=function(t,e,n){var r=this.keyMap_[t];if(!r&&!n)return console.warn('No keyboard shortcut with name "'+e+'" registered with key code "'+t+'"'),!1;var i=r.indexOf(e);return-1<i?(r.splice(i,1),0==r.length&&delete this.keyMap_[t],!0):(n||console.warn('No keyboard shortcut with name "'+e+'" registered with key code "'+t+'"'),!1)},t.ShortcutRegistry.prototype.removeAllKeyMappings=function(t){for(var e in this.keyMap_)this.removeKeyMapping(e,t,!0)},t.ShortcutRegistry.prototype.setKeyMap=function(t){this.keyMap_=t},t.ShortcutRegistry.prototype.getKeyMap=function(){return t.utils.object.deepMerge(Object.create(null),this.keyMap_)},t.ShortcutRegistry.prototype.getRegistry=function(){return t.utils.object.deepMerge(Object.create(null),this.registry_)},t.ShortcutRegistry.prototype.onKeyDown=function(t,e){var n=this.serializeKeyEvent_(e);if(!(n=this.getShortcutNamesByKeyCode(n)))return!1;for(var r,i=0;r=n[i];i++)if((!(r=this.registry_[r]).preconditionFn||r.preconditionFn(t))&&r.callback&&r.callback(t,e,r))return!0;return!1},t.ShortcutRegistry.prototype.getShortcutNamesByKeyCode=function(t){return this.keyMap_[t]||[]},t.ShortcutRegistry.prototype.getKeyCodesByShortcutName=function(t){var e,n=[];for(e in this.keyMap_)-1<this.keyMap_[e].indexOf(t)&&n.push(e);return n},t.ShortcutRegistry.prototype.serializeKeyEvent_=function(e){var n,r="";for(n in t.ShortcutRegistry.modifierKeys)e.getModifierState(n)&&(""!=r&&(r+="+"),r+=n);return""!=r&&e.keyCode?r=r+"+"+e.keyCode:e.keyCode&&(r=e.keyCode.toString()),r},t.ShortcutRegistry.prototype.checkModifiers_=function(e){for(var n,r=t.utils.object.values(t.ShortcutRegistry.modifierKeys),i=0;n=e[i];i++)if(0>r.indexOf(n))throw Error(n+" is not a valid modifier key.")},t.ShortcutRegistry.prototype.createSerializedKey=function(e,n){var r="";if(n)for(var i in this.checkModifiers_(n),t.ShortcutRegistry.modifierKeys)-1<n.indexOf(t.ShortcutRegistry.modifierKeys[i])&&(""!=r&&(r+="+"),r+=i);return""!=r&&e?r=r+"+"+e:e&&(r=e.toString()),r},new t.ShortcutRegistry,t.VariableModel=function(e,n,r,i){this.workspace=e,this.name=n,this.type=r||"",this.id_=i||t.utils.genUid(),t.Events.fire(new(t.Events.get(t.Events.VAR_CREATE))(this))},t.VariableModel.prototype.getId=function(){return this.id_},t.VariableModel.compareByName=function(t,e){return t.name.localeCompare(e.name,void 0,{sensitivity:"base"})},t.Variables={},t.Variables.NAME_TYPE=t.VARIABLE_CATEGORY_NAME,t.Variables.allUsedVarModels=function(t){var e=t.getAllBlocks(!1);t=Object.create(null);for(var n=0;n<e.length;n++){var r=e[n].getVarModels();if(r)for(var i=0;i<r.length;i++){var o=r[i],s=o.getId();s&&(t[s]=o)}}for(s in e=[],t)e.push(t[s]);return e},t.Variables.ALL_DEVELOPER_VARS_WARNINGS_BY_BLOCK_TYPE_={},t.Variables.allDeveloperVariables=function(e){e=e.getAllBlocks(!1);for(var n,r=Object.create(null),i=0;n=e[i];i++){var o=n.getDeveloperVariables;if(!o&&n.getDeveloperVars&&(o=n.getDeveloperVars,t.Variables.ALL_DEVELOPER_VARS_WARNINGS_BY_BLOCK_TYPE_[n.type]||(console.warn("Function getDeveloperVars() deprecated. Use getDeveloperVariables() (block type '"+n.type+"')"),t.Variables.ALL_DEVELOPER_VARS_WARNINGS_BY_BLOCK_TYPE_[n.type]=!0)),o)for(n=o(),o=0;o<n.length;o++)r[n[o]]=!0}return Object.keys(r)},t.Variables.flyoutCategory=function(e){var n=[],r=document.createElement("button");return r.setAttribute("text","%{BKY_NEW_VARIABLE}"),r.setAttribute("callbackKey","CREATE_VARIABLE"),e.registerButtonCallback("CREATE_VARIABLE",function(e){t.Variables.createVariableButtonHandler(e.getTargetWorkspace())}),n.push(r),e=t.Variables.flyoutCategoryBlocks(e),n.concat(e)},t.Variables.flyoutCategoryBlocks=function(e){var n=[];if(0<(e=e.getVariablesOfType("")).length){var r=e[e.length-1];if(t.Blocks.variables_set){var i=t.utils.xml.createElement("block");i.setAttribute("type","variables_set"),i.setAttribute("gap",t.Blocks.math_change?8:24),i.appendChild(t.Variables.generateVariableFieldDom(r)),n.push(i)}if(t.Blocks.math_change&&((i=t.utils.xml.createElement("block")).setAttribute("type","math_change"),i.setAttribute("gap",t.Blocks.variables_get?20:8),i.appendChild(t.Variables.generateVariableFieldDom(r)),r=t.Xml.textToDom('<value name="DELTA"><shadow type="math_number"><field name="NUM">1</field></shadow></value>'),i.appendChild(r),n.push(i)),t.Blocks.variables_get){e.sort(t.VariableModel.compareByName),r=0;for(var o;o=e[r];r++)(i=t.utils.xml.createElement("block")).setAttribute("type","variables_get"),i.setAttribute("gap",8),i.appendChild(t.Variables.generateVariableFieldDom(o)),n.push(i)}}return n},t.Variables.VAR_LETTER_OPTIONS="ijkmnopqrstuvwxyzabcdefgh",t.Variables.generateUniqueName=function(e){return t.Variables.generateUniqueNameFromOptions(t.Variables.VAR_LETTER_OPTIONS.charAt(0),e.getAllVariableNames())},t.Variables.generateUniqueNameFromOptions=function(e,n){if(!n.length)return e;for(var r=t.Variables.VAR_LETTER_OPTIONS,i="",o=r.indexOf(e);;){for(var s=!1,a=0;a<n.length;a++)if(n[a].toLowerCase()==e){s=!0;break}if(!s)return e;++o==r.length&&(o=0,i=Number(i)+1),e=r.charAt(o)+i}},t.Variables.createVariableButtonHandler=function(e,n,r){var i=r||"",o=function(r){t.Variables.promptName(t.Msg.NEW_VARIABLE_TITLE,r,function(r){if(r){var s=t.Variables.nameUsedWithAnyType(r,e);if(s){if(s.type==i)var a=t.Msg.VARIABLE_ALREADY_EXISTS.replace("%1",s.name);else a=(a=t.Msg.VARIABLE_ALREADY_EXISTS_FOR_ANOTHER_TYPE).replace("%1",s.name).replace("%2",s.type);t.alert(a,function(){o(r)})}else e.createVariable(r,i),n&&n(r)}else n&&n(null)})};o("")},t.Variables.createVariable=t.Variables.createVariableButtonHandler,t.Variables.renameVariable=function(e,n,r){var i=function(o){var s=t.Msg.RENAME_VARIABLE_TITLE.replace("%1",n.name);t.Variables.promptName(s,o,function(o){if(o){var s=t.Variables.nameUsedWithOtherType_(o,n.type,e);s?(s=t.Msg.VARIABLE_ALREADY_EXISTS_FOR_ANOTHER_TYPE.replace("%1",s.name).replace("%2",s.type),t.alert(s,function(){i(o)})):(e.renameVariableById(n.getId(),o),r&&r(o))}else r&&r(null)})};i("")},t.Variables.promptName=function(e,n,r){t.prompt(e,n,function(e){e&&((e=e.replace(/[\s\xa0]+/g," ").trim())==t.Msg.RENAME_VARIABLE||e==t.Msg.NEW_VARIABLE)&&(e=null),r(e)})},t.Variables.nameUsedWithOtherType_=function(t,e,n){n=n.getVariableMap().getAllVariables(),t=t.toLowerCase();for(var r,i=0;r=n[i];i++)if(r.name.toLowerCase()==t&&r.type!=e)return r;return null},t.Variables.nameUsedWithAnyType=function(t,e){e=e.getVariableMap().getAllVariables(),t=t.toLowerCase();for(var n,r=0;n=e[r];r++)if(n.name.toLowerCase()==t)return n;return null},t.Variables.generateVariableFieldDom=function(e){var n=t.utils.xml.createElement("field");return n.setAttribute("name","VAR"),n.setAttribute("id",e.getId()),n.setAttribute("variabletype",e.type),e=t.utils.xml.createTextNode(e.name),n.appendChild(e),n},t.Variables.getOrCreateVariablePackage=function(e,n,r,i){var o=t.Variables.getVariable(e,n,r,i);return o||(o=t.Variables.createVariable_(e,n,r,i)),o},t.Variables.getVariable=function(t,e,n,r){var i=t.getPotentialVariableMap(),o=null;if(e&&(!(o=t.getVariableById(e))&&i&&(o=i.getVariableById(e)),o))return o;if(n){if(void 0==r)throw Error("Tried to look up a variable by name without a type");!(o=t.getVariable(n,r))&&i&&(o=i.getVariable(n,r))}return o},t.Variables.createVariable_=function(e,n,r,i){var o=e.getPotentialVariableMap();return r||(r=t.Variables.generateUniqueName(e.isFlyout?e.targetWorkspace:e)),o?o.createVariable(r,i,n):e.createVariable(r,i,n)},t.Variables.getAddedVariables=function(t,e){t=t.getAllVariables();var n=[];if(e.length!=t.length)for(var r=0;r<t.length;r++){var i=t[r];-1==e.indexOf(i)&&n.push(i)}return n},t.VERSION="6.20210701.0",t.mainWorkspace=null,t.selected=null,t.draggingConnections=[],t.clipboardXml_=null,t.clipboardSource_=null,t.clipboardTypeCounts_=null,t.cache3dSupported_=null,t.parentContainer=null,t.svgSize=function(e){return t.utils.deprecation.warn("Blockly.svgSize","March 2021","March 2022","workspace.getCachedParentSvgSize"),new t.utils.Size(e.cachedWidth_,e.cachedHeight_)},t.resizeSvgContents=function(t){t.resizeContents()},t.svgResize=function(t){for(;t.options.parentWorkspace;)t=t.options.parentWorkspace;var e=t.getParentSvg(),n=t.getCachedParentSvgSize(),r=e.parentNode;if(r){var i=r.offsetWidth;r=r.offsetHeight,n.width!=i&&(e.setAttribute("width",i+"px"),t.setCachedParentSvgSize(i,null)),n.height!=r&&(e.setAttribute("height",r+"px"),t.setCachedParentSvgSize(null,r)),t.resize()}},t.onKeyDown=function(e){var n=t.mainWorkspace;n&&!(t.utils.isTargetInput(e)||n.rendered&&!n.isVisible())&&t.ShortcutRegistry.registry.onKeyDown(n,e)},t.deleteBlock=function(e){e.workspace.isFlyout||(t.Events.setGroup(!0),t.hideChaff(),e.outputConnection?e.dispose(!1,!0):e.dispose(!0,!0),t.Events.setGroup(!1))},t.copy=function(e){(e=e.toCopyData())&&(t.clipboardXml_=e.xml,t.clipboardSource_=e.source,t.clipboardTypeCounts_=e.typeCounts)},t.paste=function(){if(!t.clipboardXml_)return!1;var e=t.clipboardSource_;return e.isFlyout&&(e=e.targetWorkspace),!(!t.clipboardTypeCounts_||!e.isCapacityAvailable(t.clipboardTypeCounts_))&&(t.Events.setGroup(!0),e.paste(t.clipboardXml_),t.Events.setGroup(!1),!0)},t.duplicate=function(e){var n=t.clipboardXml_,r=t.clipboardSource_;t.copy(e),e.workspace.paste(t.clipboardXml_),t.clipboardXml_=n,t.clipboardSource_=r},t.onContextMenu_=function(e){t.utils.isTargetInput(e)||e.preventDefault()},t.hideChaff=function(e){t.Tooltip.hide(),t.WidgetDiv.hide(),t.DropDownDiv.hideWithoutAnimation();var n=!!e;t.getMainWorkspace().getComponentManager().getComponents(t.ComponentManager.Capability.AUTOHIDEABLE,!0).forEach(function(t){t.autoHide(n)})},t.getMainWorkspace=function(){return t.mainWorkspace},t.alert=function(t,e){alert(t),e&&e()},t.confirm=function(t,e){e(confirm(t))},t.prompt=function(t,e,n){n(prompt(t,e))},t.jsonInitFactory_=function(t){return function(){this.jsonInit(t)}},t.defineBlocksWithJsonArray=function(e){for(var n=0;n<e.length;n++){var r=e[n];if(r){var i=r.type;null==i||""===i?console.warn("Block definition #"+n+" in JSON array is missing a type attribute. Skipping."):(t.Blocks[i]&&console.warn("Block definition #"+n+' in JSON array overwrites prior definition of "'+i+'".'),t.Blocks[i]={init:t.jsonInitFactory_(r)})}else console.warn("Block definition #"+n+" in JSON array is "+r+". Skipping.")}},t.isNumber=function(t){return/^\s*-?\d+(\.\d+)?\s*$/.test(t)},t.hueToHex=function(e){return t.utils.colour.hsvToHex(e,t.HSV_SATURATION,255*t.HSV_VALUE)},t.checkBlockColourConstants=function(){t.checkBlockColourConstant_("LOGIC_HUE",["Blocks","logic","HUE"],void 0),t.checkBlockColourConstant_("LOGIC_HUE",["Constants","Logic","HUE"],210),t.checkBlockColourConstant_("LOOPS_HUE",["Blocks","loops","HUE"],void 0),t.checkBlockColourConstant_("LOOPS_HUE",["Constants","Loops","HUE"],120),t.checkBlockColourConstant_("MATH_HUE",["Blocks","math","HUE"],void 0),t.checkBlockColourConstant_("MATH_HUE",["Constants","Math","HUE"],230),t.checkBlockColourConstant_("TEXTS_HUE",["Blocks","texts","HUE"],void 0),t.checkBlockColourConstant_("TEXTS_HUE",["Constants","Text","HUE"],160),t.checkBlockColourConstant_("LISTS_HUE",["Blocks","lists","HUE"],void 0),t.checkBlockColourConstant_("LISTS_HUE",["Constants","Lists","HUE"],260),t.checkBlockColourConstant_("COLOUR_HUE",["Blocks","colour","HUE"],void 0),t.checkBlockColourConstant_("COLOUR_HUE",["Constants","Colour","HUE"],20),t.checkBlockColourConstant_("VARIABLES_HUE",["Blocks","variables","HUE"],void 0),t.checkBlockColourConstant_("VARIABLES_HUE",["Constants","Variables","HUE"],330),t.checkBlockColourConstant_("VARIABLES_DYNAMIC_HUE",["Constants","VariablesDynamic","HUE"],310),t.checkBlockColourConstant_("PROCEDURES_HUE",["Blocks","procedures","HUE"],void 0)},t.checkBlockColourConstant_=function(e,n,r){for(var i="Blockly",o=t,s=0;s<n.length;++s)i+="."+n[s],o&&(o=o[n[s]]);o&&o!==r&&(e=(void 0===r?'%1 has been removed. Use Blockly.Msg["%2"].':'%1 is deprecated and unused. Override Blockly.Msg["%2"].').replace("%1",i).replace("%2",e),console.warn(e))},t.setParentContainer=function(e){t.parentContainer=e},t.bindEvent_=t.browserEvents.bind,t.unbindEvent_=t.browserEvents.unbind,t.bindEventWithChecks_=t.browserEvents.conditionalBind,t.ALIGN_LEFT=t.constants.ALIGN.LEFT,t.ALIGN_CENTRE=t.constants.ALIGN.CENTRE,t.ALIGN_RIGHT=t.constants.ALIGN.RIGHT,t.INPUT_VALUE=t.connectionTypes.INPUT_VALUE,t.OUTPUT_VALUE=t.connectionTypes.OUTPUT_VALUE,t.NEXT_STATEMENT=t.connectionTypes.NEXT_STATEMENT,t.PREVIOUS_STATEMENT=t.connectionTypes.PREVIOUS_STATEMENT,t.DUMMY_INPUT=t.inputTypes.DUMMY,t.TOOLBOX_AT_TOP=t.utils.toolbox.Position.TOP,t.TOOLBOX_AT_BOTTOM=t.utils.toolbox.Position.BOTTOM,t.TOOLBOX_AT_LEFT=t.utils.toolbox.Position.LEFT,t.TOOLBOX_AT_RIGHT=t.utils.toolbox.Position.RIGHT,t.Events.BubbleOpen=function(e,n,r){t.Events.BubbleOpen.superClass_.constructor.call(this,e?e.workspace.id:void 0),this.blockId=e?e.id:null,this.isOpen=n,this.bubbleType=r},t.utils.object.inherits(t.Events.BubbleOpen,t.Events.UiBase),t.Events.BubbleOpen.prototype.type=t.Events.BUBBLE_OPEN,t.Events.BubbleOpen.prototype.toJson=function(){var e=t.Events.BubbleOpen.superClass_.toJson.call(this);return e.isOpen=this.isOpen,e.bubbleType=this.bubbleType,e.blockId=this.blockId,e},t.Events.BubbleOpen.prototype.fromJson=function(e){t.Events.BubbleOpen.superClass_.fromJson.call(this,e),this.isOpen=e.isOpen,this.bubbleType=e.bubbleType,this.blockId=e.blockId},t.registry.register(t.registry.Type.EVENT,t.Events.BUBBLE_OPEN,t.Events.BubbleOpen),t.Icon=function(t){this.block_=t,this.iconGroup_=null},t.Icon.prototype.collapseHidden=!0,t.Icon.prototype.SIZE=17,t.Icon.prototype.bubble_=null,t.Icon.prototype.iconXY_=null,t.Icon.prototype.createIcon=function(){this.iconGroup_||(this.iconGroup_=t.utils.dom.createSvgElement(t.utils.Svg.G,{class:"blocklyIconGroup"},null),this.block_.isInFlyout&&t.utils.dom.addClass(this.iconGroup_,"blocklyIconGroupReadonly"),this.drawIcon_(this.iconGroup_),this.block_.getSvgRoot().appendChild(this.iconGroup_),t.browserEvents.conditionalBind(this.iconGroup_,"mouseup",this,this.iconClick_),this.updateEditable())},t.Icon.prototype.dispose=function(){t.utils.dom.removeNode(this.iconGroup_),this.iconGroup_=null,this.setVisible(!1),this.block_=null},t.Icon.prototype.updateEditable=function(){},t.Icon.prototype.isVisible=function(){return!!this.bubble_},t.Icon.prototype.iconClick_=function(e){this.block_.workspace.isDragging()||this.block_.isInFlyout||t.utils.isRightButton(e)||this.setVisible(!this.isVisible())},t.Icon.prototype.applyColour=function(){this.isVisible()&&this.bubble_.setColour(this.block_.style.colourPrimary)},t.Icon.prototype.setIconLocation=function(t){this.iconXY_=t,this.isVisible()&&this.bubble_.setAnchorLocation(t)},t.Icon.prototype.computeIconLocation=function(){var e=this.block_.getRelativeToSurfaceXY(),n=t.utils.getRelativeXY(this.iconGroup_);e=new t.utils.Coordinate(e.x+n.x+this.SIZE/2,e.y+n.y+this.SIZE/2),t.utils.Coordinate.equals(this.getIconLocation(),e)||this.setIconLocation(e)},t.Icon.prototype.getIconLocation=function(){return this.iconXY_},t.Icon.prototype.getCorrectedSize=function(){return new t.utils.Size(t.Icon.prototype.SIZE,t.Icon.prototype.SIZE-2)},t.Warning=function(e){t.Warning.superClass_.constructor.call(this,e),this.createIcon(),this.text_=Object.create(null)},t.utils.object.inherits(t.Warning,t.Icon),t.Warning.prototype.collapseHidden=!1,t.Warning.prototype.drawIcon_=function(e){t.utils.dom.createSvgElement(t.utils.Svg.PATH,{class:"blocklyIconShape",d:"M2,15Q-1,15 0.5,12L6.5,1.7Q8,-1 9.5,1.7L15.5,12Q17,15 14,15z"},e),t.utils.dom.createSvgElement(t.utils.Svg.PATH,{class:"blocklyIconSymbol",d:"m7,4.8v3.16l0.27,2.27h1.46l0.27,-2.27v-3.16z"},e),t.utils.dom.createSvgElement(t.utils.Svg.RECT,{class:"blocklyIconSymbol",x:"7",y:"11",height:"2",width:"2"},e)},t.Warning.prototype.setVisible=function(e){e!=this.isVisible()&&(t.Events.fire(new(t.Events.get(t.Events.BUBBLE_OPEN))(this.block_,e,"warning")),e?this.createBubble_():this.disposeBubble_())},t.Warning.prototype.createBubble_=function(){this.paragraphElement_=t.Bubble.textToDom(this.getText()),this.bubble_=t.Bubble.createNonEditableBubble(this.paragraphElement_,this.block_,this.iconXY_),this.applyColour()},t.Warning.prototype.disposeBubble_=function(){this.bubble_.dispose(),this.paragraphElement_=this.bubble_=null},t.Warning.prototype.setText=function(t,e){this.text_[e]!=t&&(t?this.text_[e]=t:delete this.text_[e],this.isVisible()&&(this.setVisible(!1),this.setVisible(!0)))},t.Warning.prototype.getText=function(){var t,e=[];for(t in this.text_)e.push(this.text_[t]);return e.join("\n")},t.Warning.prototype.dispose=function(){this.block_.warning=null,t.Icon.prototype.dispose.call(this)},t.Comment=function(e){t.Comment.superClass_.constructor.call(this,e),this.model_=e.commentModel,this.model_.text=this.model_.text||"",this.cachedText_="",this.onInputWrapper_=this.onChangeWrapper_=this.onWheelWrapper_=this.onMouseUpWrapper_=null,this.createIcon()},t.utils.object.inherits(t.Comment,t.Icon),t.Comment.prototype.drawIcon_=function(e){t.utils.dom.createSvgElement(t.utils.Svg.CIRCLE,{class:"blocklyIconShape",r:"8",cx:"8",cy:"8"},e),t.utils.dom.createSvgElement(t.utils.Svg.PATH,{class:"blocklyIconSymbol",d:"m6.8,10h2c0.003,-0.617 0.271,-0.962 0.633,-1.266 2.875,-2.4050.607,-5.534 -3.765,-3.874v1.7c3.12,-1.657 3.698,0.118 2.336,1.25-1.201,0.998 -1.201,1.528 -1.204,2.19z"},e),t.utils.dom.createSvgElement(t.utils.Svg.RECT,{class:"blocklyIconSymbol",x:"6.8",y:"10.78",height:"2",width:"2"},e)},t.Comment.prototype.createEditor_=function(){this.foreignObject_=t.utils.dom.createSvgElement(t.utils.Svg.FOREIGNOBJECT,{x:t.Bubble.BORDER_WIDTH,y:t.Bubble.BORDER_WIDTH},null);var e=document.createElementNS(t.utils.dom.HTML_NS,"body");e.setAttribute("xmlns",t.utils.dom.HTML_NS),e.className="blocklyMinimalBody";var n=this.textarea_=document.createElementNS(t.utils.dom.HTML_NS,"textarea");return n.className="blocklyCommentTextarea",n.setAttribute("dir",this.block_.RTL?"RTL":"LTR"),n.value=this.model_.text,this.resizeTextarea_(),e.appendChild(n),this.foreignObject_.appendChild(e),this.onMouseUpWrapper_=t.browserEvents.conditionalBind(n,"mouseup",this,this.startEdit_,!0,!0),this.onWheelWrapper_=t.browserEvents.conditionalBind(n,"wheel",this,function(t){t.stopPropagation()}),this.onChangeWrapper_=t.browserEvents.conditionalBind(n,"change",this,function(e){this.cachedText_!=this.model_.text&&t.Events.fire(new(t.Events.get(t.Events.BLOCK_CHANGE))(this.block_,"comment",null,this.cachedText_,this.model_.text))}),this.onInputWrapper_=t.browserEvents.conditionalBind(n,"input",this,function(t){this.model_.text=n.value}),setTimeout(n.focus.bind(n),0),this.foreignObject_},t.Comment.prototype.updateEditable=function(){t.Comment.superClass_.updateEditable.call(this),this.isVisible()&&(this.disposeBubble_(),this.createBubble_())},t.Comment.prototype.onBubbleResize_=function(){this.isVisible()&&(this.model_.size=this.bubble_.getBubbleSize(),this.resizeTextarea_())},t.Comment.prototype.resizeTextarea_=function(){var e=this.model_.size,n=2*t.Bubble.BORDER_WIDTH,r=e.width-n;e=e.height-n,this.foreignObject_.setAttribute("width",r),this.foreignObject_.setAttribute("height",e),this.textarea_.style.width=r-4+"px",this.textarea_.style.height=e-4+"px"},t.Comment.prototype.setVisible=function(e){e!=this.isVisible()&&(t.Events.fire(new(t.Events.get(t.Events.BUBBLE_OPEN))(this.block_,e,"comment")),(this.model_.pinned=e)?this.createBubble_():this.disposeBubble_())},t.Comment.prototype.createBubble_=function(){!this.block_.isEditable()||t.utils.userAgent.IE?this.createNonEditableBubble_():this.createEditableBubble_()},t.Comment.prototype.createEditableBubble_=function(){this.bubble_=new t.Bubble(this.block_.workspace,this.createEditor_(),this.block_.pathObject.svgPath,this.iconXY_,this.model_.size.width,this.model_.size.height),this.bubble_.setSvgId(this.block_.id),this.bubble_.registerResizeEvent(this.onBubbleResize_.bind(this)),this.applyColour()},t.Comment.prototype.createNonEditableBubble_=function(){this.paragraphElement_=t.Bubble.textToDom(this.block_.getCommentText()),this.bubble_=t.Bubble.createNonEditableBubble(this.paragraphElement_,this.block_,this.iconXY_),this.applyColour()},t.Comment.prototype.disposeBubble_=function(){this.onMouseUpWrapper_&&(t.browserEvents.unbind(this.onMouseUpWrapper_),this.onMouseUpWrapper_=null),this.onWheelWrapper_&&(t.browserEvents.unbind(this.onWheelWrapper_),this.onWheelWrapper_=null),this.onChangeWrapper_&&(t.browserEvents.unbind(this.onChangeWrapper_),this.onChangeWrapper_=null),this.onInputWrapper_&&(t.browserEvents.unbind(this.onInputWrapper_),this.onInputWrapper_=null),this.bubble_.dispose(),this.paragraphElement_=this.foreignObject_=this.textarea_=this.bubble_=null},t.Comment.prototype.startEdit_=function(t){this.bubble_.promote()&&this.textarea_.focus(),this.cachedText_=this.model_.text},t.Comment.prototype.getBubbleSize=function(){return this.model_.size},t.Comment.prototype.setBubbleSize=function(t,e){this.bubble_?this.bubble_.setBubbleSize(t,e):(this.model_.size.width=t,this.model_.size.height=e)},t.Comment.prototype.updateText=function(){this.textarea_?this.textarea_.value=this.model_.text:this.paragraphElement_&&(this.paragraphElement_.firstChild.textContent=this.model_.text)},t.Comment.prototype.dispose=function(){this.block_.comment=null,t.Icon.prototype.dispose.call(this)},t.Css.register(".blocklyCommentTextarea {,background-color: #fef49c;,border: 0;,outline: 0;,margin: 0;,padding: 3px;,resize: none;,display: block;,text-overflow: hidden;,}".split(",")),t.IComponent=function(){},t.IDragTarget=function(){},t.DragTarget=function(){},t.DragTarget.prototype.onDragEnter=function(t){},t.DragTarget.prototype.onDragOver=function(t){},t.DragTarget.prototype.onDragExit=function(t){},t.DragTarget.prototype.onDrop=function(t){},t.DragTarget.prototype.shouldPreventMove=function(t){return!1},t.IDeleteArea=function(){},t.DeleteArea=function(){t.DeleteArea.superClass_.constructor.call(this),this.wouldDelete_=!1},t.utils.object.inherits(t.DeleteArea,t.DragTarget),t.DeleteArea.prototype.wouldDelete=function(e,n){return e instanceof t.BlockSvg?(e=!e.getParent()&&e.isDeletable(),this.updateWouldDelete_(e&&!n)):this.updateWouldDelete_(e.isDeletable()),this.wouldDelete_},t.DeleteArea.prototype.updateWouldDelete_=function(t){this.wouldDelete_=t},t.IFlyout=function(){},t.Flyout=function(e){t.Flyout.superClass_.constructor.call(this),e.setMetrics=this.setMetrics_.bind(this),this.workspace_=new t.WorkspaceSvg(e),this.workspace_.setMetricsManager(new t.FlyoutMetricsManager(this.workspace_,this)),this.workspace_.isFlyout=!0,this.workspace_.setVisible(this.isVisible_),this.id=t.utils.genUid(),this.RTL=!!e.RTL,this.horizontalLayout=!1,this.toolboxPosition_=e.toolboxPosition,this.eventWrappers_=[],this.mats_=[],this.buttons_=[],this.listeners_=[],this.permanentlyDisabled_=[],this.tabWidth_=this.workspace_.getRenderer().getConstants().TAB_WIDTH,this.targetWorkspace=null},t.utils.object.inherits(t.Flyout,t.DeleteArea),t.Flyout.prototype.autoClose=!0,t.Flyout.prototype.isVisible_=!1,t.Flyout.prototype.containerVisible_=!0,t.Flyout.prototype.CORNER_RADIUS=8,t.Flyout.prototype.MARGIN=t.Flyout.prototype.CORNER_RADIUS,t.Flyout.prototype.GAP_X=3*t.Flyout.prototype.MARGIN,t.Flyout.prototype.GAP_Y=3*t.Flyout.prototype.MARGIN,t.Flyout.prototype.SCROLLBAR_MARGIN=2.5,t.Flyout.prototype.width_=0,t.Flyout.prototype.height_=0,t.Flyout.prototype.dragAngleRange_=70,t.Flyout.prototype.createDom=function(e){return this.svgGroup_=t.utils.dom.createSvgElement(e,{class:"blocklyFlyout",style:"display: none"},null),this.svgBackground_=t.utils.dom.createSvgElement(t.utils.Svg.PATH,{class:"blocklyFlyoutBackground"},this.svgGroup_),this.svgGroup_.appendChild(this.workspace_.createDom()),this.workspace_.getThemeManager().subscribe(this.svgBackground_,"flyoutBackgroundColour","fill"),this.workspace_.getThemeManager().subscribe(this.svgBackground_,"flyoutOpacity","fill-opacity"),this.svgGroup_},t.Flyout.prototype.init=function(e){this.targetWorkspace=e,this.workspace_.targetWorkspace=e,this.workspace_.scrollbar=new t.ScrollbarPair(this.workspace_,this.horizontalLayout,!this.horizontalLayout,"blocklyFlyoutScrollbar",this.SCROLLBAR_MARGIN),this.hide(),Array.prototype.push.apply(this.eventWrappers_,t.browserEvents.conditionalBind(this.svgGroup_,"wheel",this,this.wheel_)),this.autoClose||(this.filterWrapper_=this.filterForCapacity_.bind(this),this.targetWorkspace.addChangeListener(this.filterWrapper_)),Array.prototype.push.apply(this.eventWrappers_,t.browserEvents.conditionalBind(this.svgBackground_,"mousedown",this,this.onMouseDown_)),this.workspace_.getGesture=this.targetWorkspace.getGesture.bind(this.targetWorkspace),this.workspace_.setVariableMap(this.targetWorkspace.getVariableMap()),this.workspace_.createPotentialVariableMap(),e.getComponentManager().addComponent({component:this,weight:1,capabilities:[t.ComponentManager.Capability.DELETE_AREA,t.ComponentManager.Capability.DRAG_TARGET]})},t.Flyout.prototype.dispose=function(){this.hide(),this.workspace_.getComponentManager().removeComponent(this.id),t.browserEvents.unbind(this.eventWrappers_),this.filterWrapper_&&(this.targetWorkspace.removeChangeListener(this.filterWrapper_),this.filterWrapper_=null),this.workspace_&&(this.workspace_.getThemeManager().unsubscribe(this.svgBackground_),this.workspace_.targetWorkspace=null,this.workspace_.dispose(),this.workspace_=null),this.svgGroup_&&(t.utils.dom.removeNode(this.svgGroup_),this.svgGroup_=null),this.targetWorkspace=this.svgBackground_=null},t.Flyout.prototype.getWidth=function(){return this.width_},t.Flyout.prototype.getHeight=function(){return this.height_},t.Flyout.prototype.getFlyoutScale=function(){return this.targetWorkspace.scale},t.Flyout.prototype.getWorkspace=function(){return this.workspace_},t.Flyout.prototype.isVisible=function(){return this.isVisible_},t.Flyout.prototype.setVisible=function(t){var e=t!=this.isVisible();this.isVisible_=t,e&&(this.autoClose||this.workspace_.recordDragTargets(),this.updateDisplay_())},t.Flyout.prototype.setContainerVisible=function(t){var e=t!=this.containerVisible_;this.containerVisible_=t,e&&this.updateDisplay_()},t.Flyout.prototype.updateDisplay_=function(){var t=!!this.containerVisible_&&this.isVisible();this.svgGroup_.style.display=t?"block":"none",this.workspace_.scrollbar.setContainerVisible(t)},t.Flyout.prototype.positionAt_=function(e,n,r,i){this.svgGroup_.setAttribute("width",e),this.svgGroup_.setAttribute("height",n),this.workspace_.setCachedParentSvgSize(e,n),"svg"==this.svgGroup_.tagName?t.utils.dom.setCssTransform(this.svgGroup_,"translate("+r+"px,"+i+"px)"):this.svgGroup_.setAttribute("transform","translate("+r+","+i+")"),(e=this.workspace_.scrollbar)&&(e.setOrigin(r,i),e.resize(),e.hScroll&&e.hScroll.setPosition(e.hScroll.position.x,e.hScroll.position.y),e.vScroll&&e.vScroll.setPosition(e.vScroll.position.x,e.vScroll.position.y))},t.Flyout.prototype.hide=function(){if(this.isVisible()){this.setVisible(!1);for(var e,n=0;e=this.listeners_[n];n++)t.browserEvents.unbind(e);this.listeners_.length=0,this.reflowWrapper_&&(this.workspace_.removeChangeListener(this.reflowWrapper_),this.reflowWrapper_=null)}},t.Flyout.prototype.show=function(e){this.workspace_.setResizesEnabled(!1),this.hide(),this.clearOldBlocks_(),"string"==typeof e&&(e=this.getDynamicCategoryContents_(e)),this.setVisible(!0),e=t.utils.toolbox.convertFlyoutDefToJsonArray(e),e=this.createFlyoutInfo_(e),this.layout_(e.contents,e.gaps),this.listeners_.push(t.browserEvents.conditionalBind(this.svgBackground_,"mouseover",this,function(){for(var t,e=this.workspace_.getTopBlocks(!1),n=0;t=e[n];n++)t.removeSelect()})),this.horizontalLayout?this.height_=0:this.width_=0,this.workspace_.setResizesEnabled(!0),this.reflow(),this.filterForCapacity_(),this.position(),this.reflowWrapper_=this.reflow.bind(this),this.workspace_.addChangeListener(this.reflowWrapper_)},t.Flyout.prototype.createFlyoutInfo_=function(e){var n=[],r=[];this.permanentlyDisabled_.length=0;for(var i,o=this.horizontalLayout?this.GAP_X:this.GAP_Y,s=0;i=e[s];s++)switch(i.custom&&(i=this.getDynamicCategoryContents_(i.custom),i=t.utils.toolbox.convertFlyoutDefToJsonArray(i),e.splice.apply(e,[s,1].concat(i)),i=e[s]),i.kind.toUpperCase()){case"BLOCK":var a=i,l=this.getBlockXml_(a);i=this.createBlock_(l),a=parseInt(a.gap||l.getAttribute("gap"),10),r.push(isNaN(a)?o:a),n.push({type:"block",block:i});break;case"SEP":this.addSeparatorGap_(i,r,o);break;case"LABEL":i=this.createButton_(i,!0),n.push({type:"button",button:i}),r.push(o);break;case"BUTTON":i=this.createButton_(i,!1),n.push({type:"button",button:i}),r.push(o)}return{contents:n,gaps:r}},t.Flyout.prototype.getDynamicCategoryContents_=function(t){if("function"!=typeof(t=this.workspace_.targetWorkspace.getToolboxCategoryCallback(t)))throw TypeError("Couldn't find a callback function when opening a toolbox category.");if(t=t(this.workspace_.targetWorkspace),!Array.isArray(t))throw new TypeError("Result of toolbox category callback must be an array.");return t},t.Flyout.prototype.createButton_=function(e,n){if(!t.FlyoutButton)throw Error("Missing require for Blockly.FlyoutButton");return new t.FlyoutButton(this.workspace_,this.targetWorkspace,e,n)},t.Flyout.prototype.createBlock_=function(e){return(e=t.Xml.domToBlock(e,this.workspace_)).isEnabled()||this.permanentlyDisabled_.push(e),e},t.Flyout.prototype.getBlockXml_=function(e){var n=null,r=e.blockxml;if(r&&"string"!=typeof r?n=r:r&&"string"==typeof r?(n=t.Xml.textToDom(r),e.blockxml=n):e.type&&((n=t.utils.xml.createElement("xml")).setAttribute("type",e.type),n.setAttribute("disabled",e.disabled),e.blockxml=n),!n)throw Error("Error: Invalid block definition. Block definition must have blockxml or type.");return n},t.Flyout.prototype.addSeparatorGap_=function(t,e,n){t=parseInt(t.gap,10),!isNaN(t)&&0<e.length?e[e.length-1]=t:e.push(n)},t.Flyout.prototype.clearOldBlocks_=function(){for(var e,n=this.workspace_.getTopBlocks(!1),r=0;e=n[r];r++)e.workspace==this.workspace_&&e.dispose(!1,!1);for(r=0;r<this.mats_.length;r++)(n=this.mats_[r])&&(t.Tooltip.unbindMouseEvents(n),t.utils.dom.removeNode(n));for(r=this.mats_.length=0;n=this.buttons_[r];r++)n.dispose();this.buttons_.length=0,this.workspace_.getPotentialVariableMap().clear()},t.Flyout.prototype.addBlockListeners_=function(e,n,r){this.listeners_.push(t.browserEvents.conditionalBind(e,"mousedown",null,this.blockMouseDown_(n))),this.listeners_.push(t.browserEvents.conditionalBind(r,"mousedown",null,this.blockMouseDown_(n))),this.listeners_.push(t.browserEvents.bind(e,"mouseenter",n,n.addSelect)),this.listeners_.push(t.browserEvents.bind(e,"mouseleave",n,n.removeSelect)),this.listeners_.push(t.browserEvents.bind(r,"mouseenter",n,n.addSelect)),this.listeners_.push(t.browserEvents.bind(r,"mouseleave",n,n.removeSelect))},t.Flyout.prototype.blockMouseDown_=function(t){var e=this;return function(n){var r=e.targetWorkspace.getGesture(n);r&&(r.setStartBlock(t),r.handleFlyoutStart(n,e))}},t.Flyout.prototype.onMouseDown_=function(t){var e=this.targetWorkspace.getGesture(t);e&&e.handleFlyoutStart(t,this)},t.Flyout.prototype.isBlockCreatable_=function(t){return t.isEnabled()},t.Flyout.prototype.createBlock=function(e){var n=null;t.Events.disable();var r=this.targetWorkspace.getAllVariables();this.targetWorkspace.setResizesEnabled(!1);try{n=this.placeNewBlock_(e)}finally{t.Events.enable()}if(t.hideChaff(),e=t.Variables.getAddedVariables(this.targetWorkspace,r),t.Events.isEnabled()){for(t.Events.setGroup(!0),r=0;r<e.length;r++){var i=e[r];t.Events.fire(new(t.Events.get(t.Events.VAR_CREATE))(i))}t.Events.fire(new(t.Events.get(t.Events.BLOCK_CREATE))(n))}return this.autoClose?this.hide():this.filterForCapacity_(),n},t.Flyout.prototype.initFlyoutButton_=function(e,n,r){var i=e.createDom();e.moveTo(n,r),e.show(),this.listeners_.push(t.browserEvents.conditionalBind(i,"mousedown",this,this.onMouseDown_)),this.buttons_.push(e)},t.Flyout.prototype.createRect_=function(e,n,r,i,o){return(n=t.utils.dom.createSvgElement(t.utils.Svg.RECT,{"fill-opacity":0,x:n,y:r,height:i.height,width:i.width},null)).tooltip=e,t.Tooltip.bindMouseEvents(n),this.workspace_.getCanvas().insertBefore(n,e.getSvgRoot()),e.flyoutRect_=n,this.mats_[o]=n},t.Flyout.prototype.moveRectToBlock_=function(t,e){var n=e.getHeightWidth();t.setAttribute("width",n.width),t.setAttribute("height",n.height),e=e.getRelativeToSurfaceXY(),t.setAttribute("y",e.y),t.setAttribute("x",this.RTL?e.x-n.width:e.x)},t.Flyout.prototype.filterForCapacity_=function(){for(var e,n=this.workspace_.getTopBlocks(!1),r=0;e=n[r];r++)if(-1==this.permanentlyDisabled_.indexOf(e))for(var i=this.targetWorkspace.isCapacityAvailable(t.utils.getBlockTypeCounts(e));e;)e.setEnabled(i),e=e.getNextBlock()},t.Flyout.prototype.reflow=function(){this.reflowWrapper_&&this.workspace_.removeChangeListener(this.reflowWrapper_),this.reflowInternal_(),this.reflowWrapper_&&this.workspace_.addChangeListener(this.reflowWrapper_)},t.Flyout.prototype.isScrollable=function(){return!!this.workspace_.scrollbar&&this.workspace_.scrollbar.isVisible()},t.Flyout.prototype.placeNewBlock_=function(e){var n=this.targetWorkspace;if(!e.getSvgRoot())throw Error("oldBlock is not rendered.");var r=t.Xml.blockToDom(e,!0);if(n.setResizesEnabled(!1),!(r=t.Xml.domToBlock(r,n)).getSvgRoot())throw Error("block is not rendered.");var i=n.getOriginOffsetInPixels(),o=this.workspace_.getOriginOffsetInPixels();return(e=e.getRelativeToSurfaceXY()).scale(this.workspace_.scale),e=t.utils.Coordinate.sum(o,e),(i=t.utils.Coordinate.difference(e,i)).scale(1/n.scale),r.moveBy(i.x,i.y),r},t.HorizontalFlyout=function(e){t.HorizontalFlyout.superClass_.constructor.call(this,e),this.horizontalLayout=!0},t.utils.object.inherits(t.HorizontalFlyout,t.Flyout),t.HorizontalFlyout.prototype.setMetrics_=function(t){if(this.isVisible()){var e=this.workspace_.getMetricsManager(),n=e.getScrollMetrics(),r=e.getViewMetrics();e=e.getAbsoluteMetrics(),"number"==typeof t.x&&(this.workspace_.scrollX=-(n.left+(n.width-r.width)*t.x)),this.workspace_.translate(this.workspace_.scrollX+e.left,this.workspace_.scrollY+e.top)}},t.HorizontalFlyout.prototype.getX=function(){return 0},t.HorizontalFlyout.prototype.getY=function(){if(!this.isVisible())return 0;var e=this.targetWorkspace.getMetricsManager(),n=e.getAbsoluteMetrics(),r=e.getViewMetrics();e=e.getToolboxMetrics();var i=this.toolboxPosition_==t.utils.toolbox.Position.TOP;return this.targetWorkspace.toolboxPosition==this.toolboxPosition_?this.targetWorkspace.getToolbox()?i?e.height:r.height-this.height_:i?0:r.height:i?0:r.height+n.top-this.height_},t.HorizontalFlyout.prototype.position=function(){if(this.isVisible()&&this.targetWorkspace.isVisible()){var t=this.targetWorkspace.getMetricsManager().getViewMetrics();this.width_=t.width,this.setBackgroundPath_(t.width-2*this.CORNER_RADIUS,this.height_-this.CORNER_RADIUS),t=this.getX();var e=this.getY();this.positionAt_(this.width_,this.height_,t,e)}},t.HorizontalFlyout.prototype.setBackgroundPath_=function(e,n){var r=this.toolboxPosition_==t.utils.toolbox.Position.TOP,i=["M 0,"+(r?0:this.CORNER_RADIUS)];r?(i.push("h",e+2*this.CORNER_RADIUS),i.push("v",n),i.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,1,-this.CORNER_RADIUS,this.CORNER_RADIUS),i.push("h",-e),i.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,1,-this.CORNER_RADIUS,-this.CORNER_RADIUS)):(i.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,1,this.CORNER_RADIUS,-this.CORNER_RADIUS),i.push("h",e),i.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,1,this.CORNER_RADIUS,this.CORNER_RADIUS),i.push("v",n),i.push("h",-e-2*this.CORNER_RADIUS)),i.push("z"),this.svgBackground_.setAttribute("d",i.join(" "))},t.HorizontalFlyout.prototype.scrollToStart=function(){this.workspace_.scrollbar.setX(this.RTL?1/0:0)},t.HorizontalFlyout.prototype.wheel_=function(e){var n=t.utils.getScrollDeltaPixels(e);if(n=n.x||n.y){var r=this.workspace_.getMetricsManager(),i=r.getScrollMetrics();n=r.getViewMetrics().left-i.left+n,this.workspace_.scrollbar.setX(n),t.WidgetDiv.hide(),t.DropDownDiv.hideWithoutAnimation()}e.preventDefault(),e.stopPropagation()},t.HorizontalFlyout.prototype.layout_=function(t,e){this.workspace_.scale=this.targetWorkspace.scale;var n=this.MARGIN,r=n+this.tabWidth_;this.RTL&&(t=t.reverse());for(var i,o=0;i=t[o];o++)if("block"==i.type){for(var s,a=(i=i.block).getDescendants(!1),l=0;s=a[l];l++)s.isInFlyout=!0;i.render(),a=i.getSvgRoot(),l=i.getHeightWidth(),s=i.outputConnection?this.tabWidth_:0,s=this.RTL?r+l.width:r-s,i.moveBy(s,n),s=this.createRect_(i,s,n,l,o),r+=l.width+e[o],this.addBlockListeners_(a,i,s)}else"button"==i.type&&(this.initFlyoutButton_(i.button,r,n),r+=i.button.width+e[o])},t.HorizontalFlyout.prototype.isDragTowardWorkspace=function(t){t=Math.atan2(t.y,t.x)/Math.PI*180;var e=this.dragAngleRange_;return t<90+e&&t>90-e||t>-90-e&&t<-90+e},t.HorizontalFlyout.prototype.getClientRect=function(){if(!this.svgGroup_||this.autoClose||!this.isVisible())return null;var e=this.svgGroup_.getBoundingClientRect(),n=e.top;return this.toolboxPosition_==t.utils.toolbox.Position.TOP?new t.utils.Rect(-1e9,n+e.height,-1e9,1e9):new t.utils.Rect(n,1e9,-1e9,1e9)},t.HorizontalFlyout.prototype.reflowInternal_=function(){this.workspace_.scale=this.getFlyoutScale();for(var e,n=0,r=this.workspace_.getTopBlocks(!1),i=0;e=r[i];i++)n=Math.max(n,e.getHeightWidth().height);if(n+=1.5*this.MARGIN,n*=this.workspace_.scale,n+=t.Scrollbar.scrollbarThickness,this.height_!=n){for(i=0;e=r[i];i++)e.flyoutRect_&&this.moveRectToBlock_(e.flyoutRect_,e);this.targetWorkspace.toolboxPosition!=this.toolboxPosition_||this.toolboxPosition_!=t.utils.toolbox.Position.TOP||this.targetWorkspace.getToolbox()||this.targetWorkspace.translate(this.targetWorkspace.scrollX,this.targetWorkspace.scrollY+n),this.height_=n,this.position(),this.targetWorkspace.recordDragTargets()}},t.registry.register(t.registry.Type.FLYOUTS_HORIZONTAL_TOOLBOX,t.registry.DEFAULT,t.HorizontalFlyout),t.VerticalFlyout=function(e){t.VerticalFlyout.superClass_.constructor.call(this,e)},t.utils.object.inherits(t.VerticalFlyout,t.Flyout),t.VerticalFlyout.registryName="verticalFlyout",t.VerticalFlyout.prototype.setMetrics_=function(t){if(this.isVisible()){var e=this.workspace_.getMetricsManager(),n=e.getScrollMetrics(),r=e.getViewMetrics();e=e.getAbsoluteMetrics(),"number"==typeof t.y&&(this.workspace_.scrollY=-(n.top+(n.height-r.height)*t.y)),this.workspace_.translate(this.workspace_.scrollX+e.left,this.workspace_.scrollY+e.top)}},t.VerticalFlyout.prototype.getX=function(){if(!this.isVisible())return 0;var e=this.targetWorkspace.getMetricsManager(),n=e.getAbsoluteMetrics(),r=e.getViewMetrics();return e=e.getToolboxMetrics(),this.targetWorkspace.toolboxPosition==this.toolboxPosition_?this.targetWorkspace.getToolbox()?this.toolboxPosition_==t.utils.toolbox.Position.LEFT?e.width:r.width-this.width_:this.toolboxPosition_==t.utils.toolbox.Position.LEFT?0:r.width:this.toolboxPosition_==t.utils.toolbox.Position.LEFT?0:r.width+n.left-this.width_},t.VerticalFlyout.prototype.getY=function(){return 0},t.VerticalFlyout.prototype.position=function(){if(this.isVisible()&&this.targetWorkspace.isVisible()){var t=this.targetWorkspace.getMetricsManager().getViewMetrics();this.height_=t.height,this.setBackgroundPath_(this.width_-this.CORNER_RADIUS,t.height-2*this.CORNER_RADIUS),t=this.getX();var e=this.getY();this.positionAt_(this.width_,this.height_,t,e)}},t.VerticalFlyout.prototype.setBackgroundPath_=function(e,n){var r=this.toolboxPosition_==t.utils.toolbox.Position.RIGHT,i=e+this.CORNER_RADIUS;(i=["M "+(r?i:0)+",0"]).push("h",r?-e:e),i.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,r?0:1,r?-this.CORNER_RADIUS:this.CORNER_RADIUS,this.CORNER_RADIUS),i.push("v",Math.max(0,n)),i.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,r?0:1,r?this.CORNER_RADIUS:-this.CORNER_RADIUS,this.CORNER_RADIUS),i.push("h",r?e:-e),i.push("z"),this.svgBackground_.setAttribute("d",i.join(" "))},t.VerticalFlyout.prototype.scrollToStart=function(){this.workspace_.scrollbar.setY(0)},t.VerticalFlyout.prototype.wheel_=function(e){var n=t.utils.getScrollDeltaPixels(e);if(n.y){var r=this.workspace_.getMetricsManager(),i=r.getScrollMetrics();n=r.getViewMetrics().top-i.top+n.y,this.workspace_.scrollbar.setY(n),t.WidgetDiv.hide(),t.DropDownDiv.hideWithoutAnimation()}e.preventDefault(),e.stopPropagation()},t.VerticalFlyout.prototype.layout_=function(t,e){this.workspace_.scale=this.targetWorkspace.scale;for(var n,r=this.MARGIN,i=this.RTL?r:r+this.tabWidth_,o=0;n=t[o];o++)if("block"==n.type){for(var s,a=(n=n.block).getDescendants(!1),l=0;s=a[l];l++)s.isInFlyout=!0;n.render(),a=n.getSvgRoot(),l=n.getHeightWidth(),s=n.outputConnection?i-this.tabWidth_:i,n.moveBy(s,r),s=this.createRect_(n,this.RTL?s-l.width:s,r,l,o),this.addBlockListeners_(a,n,s),r+=l.height+e[o]}else"button"==n.type&&(this.initFlyoutButton_(n.button,i,r),r+=n.button.height+e[o])},t.VerticalFlyout.prototype.isDragTowardWorkspace=function(t){t=Math.atan2(t.y,t.x)/Math.PI*180;var e=this.dragAngleRange_;return t<e&&t>-e||t<-180+e||t>180-e},t.VerticalFlyout.prototype.getClientRect=function(){if(!this.svgGroup_||this.autoClose||!this.isVisible())return null;var e=this.svgGroup_.getBoundingClientRect(),n=e.left;return this.toolboxPosition_==t.utils.toolbox.Position.LEFT?new t.utils.Rect(-1e9,1e9,-1e9,n+e.width):new t.utils.Rect(-1e9,1e9,n,1e9)},t.VerticalFlyout.prototype.reflowInternal_=function(){this.workspace_.scale=this.getFlyoutScale();for(var e,n=0,r=this.workspace_.getTopBlocks(!1),i=0;e=r[i];i++){var o=e.getHeightWidth().width;e.outputConnection&&(o-=this.tabWidth_),n=Math.max(n,o)}for(i=0;e=this.buttons_[i];i++)n=Math.max(n,e.width);if(n+=1.5*this.MARGIN+this.tabWidth_,n*=this.workspace_.scale,n+=t.Scrollbar.scrollbarThickness,this.width_!=n){for(i=0;e=r[i];i++){if(this.RTL){o=e.getRelativeToSurfaceXY().x;var s=n/this.workspace_.scale-this.MARGIN;e.outputConnection||(s-=this.tabWidth_),e.moveBy(s-o,0)}e.flyoutRect_&&this.moveRectToBlock_(e.flyoutRect_,e)}if(this.RTL)for(i=0;e=this.buttons_[i];i++)r=e.getPosition().y,e.moveTo(n/this.workspace_.scale-e.width-this.MARGIN-this.tabWidth_,r);this.targetWorkspace.toolboxPosition!=this.toolboxPosition_||this.toolboxPosition_!=t.utils.toolbox.Position.LEFT||this.targetWorkspace.getToolbox()||this.targetWorkspace.translate(this.targetWorkspace.scrollX+n,this.targetWorkspace.scrollY),this.width_=n,this.position(),this.targetWorkspace.recordDragTargets()}},t.registry.register(t.registry.Type.FLYOUTS_VERTICAL_TOOLBOX,t.registry.DEFAULT,t.VerticalFlyout),t.FlyoutButton=function(e,n,r,i){this.workspace_=e,this.targetWorkspace_=n,this.text_=r.text,this.position_=new t.utils.Coordinate(0,0),this.isLabel_=i,this.callbackKey_=r.callbackKey||r.callbackkey,this.cssClass_=r["web-class"]||null,this.onMouseUpWrapper_=null,this.info=r},t.FlyoutButton.MARGIN_X=5,t.FlyoutButton.MARGIN_Y=2,t.FlyoutButton.prototype.width=0,t.FlyoutButton.prototype.height=0,t.FlyoutButton.prototype.createDom=function(){var e=this.isLabel_?"blocklyFlyoutLabel":"blocklyFlyoutButton";if(this.cssClass_&&(e+=" "+this.cssClass_),this.svgGroup_=t.utils.dom.createSvgElement(t.utils.Svg.G,{class:e},this.workspace_.getCanvas()),!this.isLabel_)var n=t.utils.dom.createSvgElement(t.utils.Svg.RECT,{class:"blocklyFlyoutButtonShadow",rx:4,ry:4,x:1,y:1},this.svgGroup_);e=t.utils.dom.createSvgElement(t.utils.Svg.RECT,{class:this.isLabel_?"blocklyFlyoutLabelBackground":"blocklyFlyoutButtonBackground",rx:4,ry:4},this.svgGroup_);var r=t.utils.dom.createSvgElement(t.utils.Svg.TEXT,{class:this.isLabel_?"blocklyFlyoutLabelText":"blocklyText",x:0,y:0,"text-anchor":"middle"},this.svgGroup_),i=t.utils.replaceMessageReferences(this.text_);this.workspace_.RTL&&(i+="‏"),r.textContent=i,this.isLabel_&&(this.svgText_=r,this.workspace_.getThemeManager().subscribe(this.svgText_,"flyoutForegroundColour","fill"));var o=t.utils.style.getComputedStyle(r,"fontSize"),s=t.utils.style.getComputedStyle(r,"fontWeight"),a=t.utils.style.getComputedStyle(r,"fontFamily");return this.width=t.utils.dom.getFastTextWidthWithSizeString(r,o,s,a),i=t.utils.dom.measureFontMetrics(i,o,s,a),this.height=i.height,this.isLabel_||(this.width+=2*t.FlyoutButton.MARGIN_X,this.height+=2*t.FlyoutButton.MARGIN_Y,n.setAttribute("width",this.width),n.setAttribute("height",this.height)),e.setAttribute("width",this.width),e.setAttribute("height",this.height),r.setAttribute("x",this.width/2),r.setAttribute("y",this.height/2-i.height/2+i.baseline),this.updateTransform_(),this.onMouseUpWrapper_=t.browserEvents.conditionalBind(this.svgGroup_,"mouseup",this,this.onMouseUp_),this.svgGroup_},t.FlyoutButton.prototype.show=function(){this.updateTransform_(),this.svgGroup_.setAttribute("display","block")},t.FlyoutButton.prototype.updateTransform_=function(){this.svgGroup_.setAttribute("transform","translate("+this.position_.x+","+this.position_.y+")")},t.FlyoutButton.prototype.moveTo=function(t,e){this.position_.x=t,this.position_.y=e,this.updateTransform_()},t.FlyoutButton.prototype.isLabel=function(){return this.isLabel_},t.FlyoutButton.prototype.getPosition=function(){return this.position_},t.FlyoutButton.prototype.getButtonText=function(){return this.text_},t.FlyoutButton.prototype.getTargetWorkspace=function(){return this.targetWorkspace_},t.FlyoutButton.prototype.dispose=function(){this.onMouseUpWrapper_&&t.browserEvents.unbind(this.onMouseUpWrapper_),this.svgGroup_&&t.utils.dom.removeNode(this.svgGroup_),this.svgText_&&this.workspace_.getThemeManager().unsubscribe(this.svgText_)},t.FlyoutButton.prototype.onMouseUp_=function(t){(t=this.targetWorkspace_.getGesture(t))&&t.cancel(),this.isLabel_&&this.callbackKey_?console.warn("Labels should not have callbacks. Label text: "+this.text_):this.isLabel_||this.callbackKey_&&this.targetWorkspace_.getButtonCallback(this.callbackKey_)?this.isLabel_||this.targetWorkspace_.getButtonCallback(this.callbackKey_)(this):console.warn("Buttons should have callbacks. Button text: "+this.text_)},t.Css.register(".blocklyFlyoutButton {,fill: #888;,cursor: default;,},.blocklyFlyoutButtonShadow {,fill: #666;,},.blocklyFlyoutButton:hover {,fill: #aaa;,},.blocklyFlyoutLabel {,cursor: default;,},.blocklyFlyoutLabelBackground {,opacity: 0;,}".split(",")),t.Generator=function(t){this.name_=t,this.FUNCTION_NAME_PLACEHOLDER_REGEXP_=new RegExp(this.FUNCTION_NAME_PLACEHOLDER_,"g")},t.Generator.prototype.INFINITE_LOOP_TRAP=null,t.Generator.prototype.STATEMENT_PREFIX=null,t.Generator.prototype.STATEMENT_SUFFIX=null,t.Generator.prototype.INDENT=" ",t.Generator.prototype.COMMENT_WRAP=60,t.Generator.prototype.ORDER_OVERRIDES=[],t.Generator.prototype.isInitialized=null,t.Generator.prototype.workspaceToCode=function(e){e||(console.warn("No workspace specified in workspaceToCode call. Guessing."),e=t.getMainWorkspace());var n=[];this.init(e),e=e.getTopBlocks(!0);for(var r,i=0;r=e[i];i++){var o=this.blockToCode(r);Array.isArray(o)&&(o=o[0]),o&&(r.outputConnection&&(o=this.scrubNakedValue(o),this.STATEMENT_PREFIX&&!r.suppressPrefixSuffix&&(o=this.injectId(this.STATEMENT_PREFIX,r)+o),this.STATEMENT_SUFFIX&&!r.suppressPrefixSuffix&&(o+=this.injectId(this.STATEMENT_SUFFIX,r))),n.push(o))}return n=n.join("\n"),(n=(n=(n=this.finish(n)).replace(/^\s+\n/,"")).replace(/\n\s+$/,"\n")).replace(/[ \t]+\n/g,"\n")},t.Generator.prototype.prefixLines=function(t,e){return e+t.replace(/(?!\n$)\n/g,"\n"+e)},t.Generator.prototype.allNestedComments=function(t){var e=[];t=t.getDescendants(!0);for(var n=0;n<t.length;n++){var r=t[n].getCommentText();r&&e.push(r)}return e.length&&e.push(""),e.join("\n")},t.Generator.prototype.blockToCode=function(t,e){if(!1===this.isInitialized&&console.warn("Generator init was not called before blockToCode was called."),!t)return"";if(!t.isEnabled())return e?"":this.blockToCode(t.getNextBlock());if(t.isInsertionMarker())return e?"":this.blockToCode(t.getChildren(!1)[0]);var n=this[t.type];if("function"!=typeof n)throw Error('Language "'+this.name_+'" does not know how to generate code for block type "'+t.type+'".');if(n=n.call(t,t),Array.isArray(n)){if(!t.outputConnection)throw TypeError("Expecting string from statement block: "+t.type);return[this.scrub_(t,n[0],e),n[1]]}if("string"==typeof n)return this.STATEMENT_PREFIX&&!t.suppressPrefixSuffix&&(n=this.injectId(this.STATEMENT_PREFIX,t)+n),this.STATEMENT_SUFFIX&&!t.suppressPrefixSuffix&&(n+=this.injectId(this.STATEMENT_SUFFIX,t)),this.scrub_(t,n,e);if(null===n)return"";throw SyntaxError("Invalid code generated: "+n)},t.Generator.prototype.valueToCode=function(t,e,n){if(isNaN(n))throw TypeError("Expecting valid order from block: "+t.type);var r=t.getInputTargetBlock(e);if(!r)return"";if(""===(e=this.blockToCode(r)))return"";if(!Array.isArray(e))throw TypeError("Expecting tuple from value block: "+r.type);if(t=e[0],e=e[1],isNaN(e))throw TypeError("Expecting valid order from value block: "+r.type);if(!t)return"";r=!1;var i=Math.floor(n),o=Math.floor(e);if(i<=o&&(i!=o||0!=i&&99!=i))for(r=!0,i=0;i<this.ORDER_OVERRIDES.length;i++)if(this.ORDER_OVERRIDES[i][0]==n&&this.ORDER_OVERRIDES[i][1]==e){r=!1;break}return r&&(t="("+t+")"),t},t.Generator.prototype.statementToCode=function(t,e){if(t=t.getInputTargetBlock(e),"string"!=typeof(e=this.blockToCode(t)))throw TypeError("Expecting code from statement block: "+(t&&t.type));return e&&(e=this.prefixLines(e,this.INDENT)),e},t.Generator.prototype.addLoopTrap=function(t,e){return this.INFINITE_LOOP_TRAP&&(t=this.prefixLines(this.injectId(this.INFINITE_LOOP_TRAP,e),this.INDENT)+t),this.STATEMENT_SUFFIX&&!e.suppressPrefixSuffix&&(t=this.prefixLines(this.injectId(this.STATEMENT_SUFFIX,e),this.INDENT)+t),this.STATEMENT_PREFIX&&!e.suppressPrefixSuffix&&(t+=this.prefixLines(this.injectId(this.STATEMENT_PREFIX,e),this.INDENT)),t},t.Generator.prototype.injectId=function(t,e){return e=e.id.replace(/\$/g,"$$$$"),t.replace(/%1/g,"'"+e+"'")},t.Generator.prototype.RESERVED_WORDS_="",t.Generator.prototype.addReservedWords=function(t){this.RESERVED_WORDS_+=t+","},t.Generator.prototype.FUNCTION_NAME_PLACEHOLDER_="{leCUI8hutHZI4480Dc}",Object.defineProperty(t.Generator.prototype,"variableDB_",{get:function(){return t.utils.deprecation.warn("variableDB_","May 2021","May 2026","nameDB_"),this.nameDB_},set:function(e){t.utils.deprecation.warn("variableDB_","May 2021","May 2026","nameDB_"),this.nameDB_=e}}),t.Generator.prototype.provideFunction_=function(e,n){if(!this.definitions_[e]){var r,i=this.nameDB_.getDistinctName(e,t.PROCEDURE_CATEGORY_NAME);for(this.functionNames_[e]=i,n=n.join("\n").replace(this.FUNCTION_NAME_PLACEHOLDER_REGEXP_,i);r!=n;)r=n,n=n.replace(/^(( {2})*) {2}/gm,"$1\0");n=n.replace(/\0/g,this.INDENT),this.definitions_[e]=n}return this.functionNames_[e]},t.Generator.prototype.init=function(t){this.definitions_=Object.create(null),this.functionNames_=Object.create(null)},t.Generator.prototype.scrub_=function(t,e,n){return e},t.Generator.prototype.finish=function(t){return delete this.definitions_,delete this.functionNames_,t},t.Generator.prototype.scrubNakedValue=function(t){return t},t.IToolboxItem=function(){},t.ISelectableToolboxItem=function(){},t.ICollapsibleToolboxItem=function(){},t.ToolboxItem=function(e,n,r){this.id_=e.toolboxitemid||t.utils.IdGenerator.getNextUniqueId(),this.level_=(this.parent_=r||null)?this.parent_.getLevel()+1:0,this.toolboxItemDef_=e,this.parentToolbox_=n,this.workspace_=this.parentToolbox_.getWorkspace()},t.ToolboxItem.prototype.init=function(){},t.ToolboxItem.prototype.getDiv=function(){return null},t.ToolboxItem.prototype.getId=function(){return this.id_},t.ToolboxItem.prototype.getParent=function(){return null},t.ToolboxItem.prototype.getLevel=function(){return this.level_},t.ToolboxItem.prototype.isSelectable=function(){return!1},t.ToolboxItem.prototype.isCollapsible=function(){return!1},t.ToolboxItem.prototype.dispose=function(){},t.ToolboxCategory=function(e,n,r){t.ToolboxCategory.superClass_.constructor.call(this,e,n,r),this.name_=t.utils.replaceMessageReferences(e.name),this.colour_=this.getColour_(e),this.labelDom_=this.iconDom_=this.rowContents_=this.rowDiv_=this.htmlDiv_=null,this.cssConfig_=this.makeDefaultCssConfig_(),t.utils.object.mixin(this.cssConfig_,e.cssconfig||e.cssConfig),this.isDisabled_=this.isHidden_=!1,this.flyoutItems_=[],this.parseContents_(e)},t.utils.object.inherits(t.ToolboxCategory,t.ToolboxItem),t.ToolboxCategory.registrationName="category",t.ToolboxCategory.nestedPadding=19,t.ToolboxCategory.borderWidth=8,t.ToolboxCategory.defaultBackgroundColour="#57e",t.ToolboxCategory.prototype.makeDefaultCssConfig_=function(){return{container:"blocklyToolboxCategory",row:"blocklyTreeRow",rowcontentcontainer:"blocklyTreeRowContentContainer",icon:"blocklyTreeIcon",label:"blocklyTreeLabel",contents:"blocklyToolboxContents",selected:"blocklyTreeSelected",openicon:"blocklyTreeIconOpen",closedicon:"blocklyTreeIconClosed"}},t.ToolboxCategory.prototype.parseContents_=function(t){var e=t.contents;if(t.custom)this.flyoutItems_=t.custom;else if(e){t=0;for(var n;n=e[t];t++)this.flyoutItems_.push(n)}},t.ToolboxCategory.prototype.init=function(){this.createDom_(),"true"==this.toolboxItemDef_.hidden&&this.hide()},t.ToolboxCategory.prototype.createDom_=function(){return this.htmlDiv_=this.createContainer_(),t.utils.aria.setRole(this.htmlDiv_,t.utils.aria.Role.TREEITEM),t.utils.aria.setState(this.htmlDiv_,t.utils.aria.State.SELECTED,!1),t.utils.aria.setState(this.htmlDiv_,t.utils.aria.State.LEVEL,this.level_),this.rowDiv_=this.createRowContainer_(),this.rowDiv_.style.pointerEvents="auto",this.htmlDiv_.appendChild(this.rowDiv_),this.rowContents_=this.createRowContentsContainer_(),this.rowContents_.style.pointerEvents="none",this.rowDiv_.appendChild(this.rowContents_),this.iconDom_=this.createIconDom_(),t.utils.aria.setRole(this.iconDom_,t.utils.aria.Role.PRESENTATION),this.rowContents_.appendChild(this.iconDom_),this.labelDom_=this.createLabelDom_(this.name_),this.rowContents_.appendChild(this.labelDom_),t.utils.aria.setState(this.htmlDiv_,t.utils.aria.State.LABELLEDBY,this.labelDom_.getAttribute("id")),this.addColourBorder_(this.colour_),this.htmlDiv_},t.ToolboxCategory.prototype.createContainer_=function(){var e=document.createElement("div");return t.utils.dom.addClass(e,this.cssConfig_.container),e},t.ToolboxCategory.prototype.createRowContainer_=function(){var e=document.createElement("div");t.utils.dom.addClass(e,this.cssConfig_.row);var n=t.ToolboxCategory.nestedPadding*this.getLevel();return n=n.toString()+"px",this.workspace_.RTL?e.style.paddingRight=n:e.style.paddingLeft=n,e},t.ToolboxCategory.prototype.createRowContentsContainer_=function(){var e=document.createElement("div");return t.utils.dom.addClass(e,this.cssConfig_.rowcontentcontainer),e},t.ToolboxCategory.prototype.createIconDom_=function(){var e=document.createElement("span");return this.parentToolbox_.isHorizontal()||t.utils.dom.addClass(e,this.cssConfig_.icon),e.style.display="inline-block",e},t.ToolboxCategory.prototype.createLabelDom_=function(e){var n=document.createElement("span");return n.setAttribute("id",this.getId()+".label"),n.textContent=e,t.utils.dom.addClass(n,this.cssConfig_.label),n},t.ToolboxCategory.prototype.refreshTheme=function(){this.colour_=this.getColour_(this.toolboxItemDef_),this.addColourBorder_(this.colour_)},t.ToolboxCategory.prototype.addColourBorder_=function(e){e&&(e=t.ToolboxCategory.borderWidth+"px solid "+(e||"#ddd"),this.workspace_.RTL?this.rowDiv_.style.borderRight=e:this.rowDiv_.style.borderLeft=e)},t.ToolboxCategory.prototype.getColour_=function(t){var e=t.categorystyle||t.categoryStyle;return(t=t.colour)&&e?(console.warn('Toolbox category "'+this.name_+'" must not have both a style and a colour'),""):e?this.getColourfromStyle_(e):this.parseColour_(t)},t.ToolboxCategory.prototype.getColourfromStyle_=function(t){var e=this.workspace_.getTheme();if(t&&e){if((e=e.categoryStyles[t])&&e.colour)return this.parseColour_(e.colour);console.warn('Style "'+t+'" must exist and contain a colour value')}return""},t.ToolboxCategory.prototype.getClickTarget=function(){return this.rowDiv_},t.ToolboxCategory.prototype.parseColour_=function(e){if(null==(e=t.utils.replaceMessageReferences(e))||""===e)return"";var n=Number(e);return isNaN(n)?(n=t.utils.colour.parse(e))?n:(console.warn('Toolbox category "'+this.name_+'" has unrecognized colour attribute: '+e),""):t.hueToHex(n)},t.ToolboxCategory.prototype.openIcon_=function(e){e&&(t.utils.dom.removeClasses(e,this.cssConfig_.closedicon),t.utils.dom.addClass(e,this.cssConfig_.openicon))},t.ToolboxCategory.prototype.closeIcon_=function(e){e&&(t.utils.dom.removeClasses(e,this.cssConfig_.openicon),t.utils.dom.addClass(e,this.cssConfig_.closedicon))},t.ToolboxCategory.prototype.setVisible_=function(t){this.htmlDiv_.style.display=t?"block":"none",this.isHidden_=!t,this.parentToolbox_.getSelectedItem()==this&&this.parentToolbox_.clearSelection()},t.ToolboxCategory.prototype.hide=function(){this.setVisible_(!1)},t.ToolboxCategory.prototype.show=function(){this.setVisible_(!0)},t.ToolboxCategory.prototype.isVisible=function(){return!this.isHidden_&&this.allAncestorsExpanded_()},t.ToolboxCategory.prototype.allAncestorsExpanded_=function(){for(var t=this;t.getParent();)if(!(t=t.getParent()).isExpanded())return!1;return!0},t.ToolboxCategory.prototype.isSelectable=function(){return this.isVisible()&&!this.isDisabled_},t.ToolboxCategory.prototype.onClick=function(t){},t.ToolboxCategory.prototype.setSelected=function(e){if(e){var n=this.parseColour_(t.ToolboxCategory.defaultBackgroundColour);this.rowDiv_.style.backgroundColor=this.colour_||n,t.utils.dom.addClass(this.rowDiv_,this.cssConfig_.selected)}else this.rowDiv_.style.backgroundColor="",t.utils.dom.removeClass(this.rowDiv_,this.cssConfig_.selected);t.utils.aria.setState(this.htmlDiv_,t.utils.aria.State.SELECTED,e)},t.ToolboxCategory.prototype.setDisabled=function(t){this.isDisabled_=t,this.getDiv().setAttribute("disabled",t),t?this.getDiv().setAttribute("disabled","true"):this.getDiv().removeAttribute("disabled")},t.ToolboxCategory.prototype.getName=function(){return this.name_},t.ToolboxCategory.prototype.getParent=function(){return this.parent_},t.ToolboxCategory.prototype.getDiv=function(){return this.htmlDiv_},t.ToolboxCategory.prototype.getContents=function(){return this.flyoutItems_},t.ToolboxCategory.prototype.updateFlyoutContents=function(e){this.flyoutItems_=[],"string"==typeof e?this.toolboxItemDef_.custom=e:(delete this.toolboxItemDef_.custom,this.toolboxItemDef_.contents=t.utils.toolbox.convertFlyoutDefToJsonArray(e)),this.parseContents_(this.toolboxItemDef_)},t.ToolboxCategory.prototype.dispose=function(){t.utils.dom.removeNode(this.htmlDiv_)},t.Css.register([".blocklyTreeRow:not(.blocklyTreeSelected):hover {","background-color: rgba(255, 255, 255, 0.2);","}",'.blocklyToolboxDiv[layout="h"] .blocklyToolboxCategory {',"margin: 1px 5px 1px 0;","}",'.blocklyToolboxDiv[dir="RTL"][layout="h"] .blocklyToolboxCategory {',"margin: 1px 0 1px 5px;","}",".blocklyTreeRow {","height: 22px;","line-height: 22px;","margin-bottom: 3px;","padding-right: 8px;","white-space: nowrap;","}",'.blocklyToolboxDiv[dir="RTL"] .blocklyTreeRow {',"margin-left: 8px;","padding-right: 0px","}",".blocklyTreeIcon {","background-image: url(<<<PATH>>>/sprites.png);","height: 16px;","vertical-align: middle;","visibility: hidden;","width: 16px;","}",".blocklyTreeIconClosed {","background-position: -32px -1px;","}",'.blocklyToolboxDiv[dir="RTL"] .blocklyTreeIconClosed {',"background-position: 0 -1px;","}",".blocklyTreeSelected>.blocklyTreeIconClosed {","background-position: -32px -17px;","}",'.blocklyToolboxDiv[dir="RTL"] .blocklyTreeSelected>.blocklyTreeIconClosed {',"background-position: 0 -17px;","}",".blocklyTreeIconOpen {","background-position: -16px -1px;","}",".blocklyTreeSelected>.blocklyTreeIconOpen {","background-position: -16px -17px;","}",".blocklyTreeLabel {","cursor: default;","font: 16px sans-serif;","padding: 0 3px;","vertical-align: middle;","}",".blocklyToolboxDelete .blocklyTreeLabel {",'cursor: url("<<<PATH>>>/handdelete.cur"), auto;',"}",".blocklyTreeSelected .blocklyTreeLabel {","color: #fff;","}"]),t.registry.register(t.registry.Type.TOOLBOX_ITEM,t.ToolboxCategory.registrationName,t.ToolboxCategory),t.ToolboxSeparator=function(e,n){t.ToolboxSeparator.superClass_.constructor.call(this,e,n),this.cssConfig_={container:"blocklyTreeSeparator"},t.utils.object.mixin(this.cssConfig_,e.cssconfig||e.cssConfig)},t.utils.object.inherits(t.ToolboxSeparator,t.ToolboxItem),t.ToolboxSeparator.registrationName="sep",t.ToolboxSeparator.prototype.init=function(){this.createDom_()},t.ToolboxSeparator.prototype.createDom_=function(){var e=document.createElement("div");return t.utils.dom.addClass(e,this.cssConfig_.container),this.htmlDiv_=e},t.ToolboxSeparator.prototype.getDiv=function(){return this.htmlDiv_},t.ToolboxSeparator.prototype.dispose=function(){t.utils.dom.removeNode(this.htmlDiv_)},t.Css.register('.blocklyTreeSeparator {,border-bottom: solid #e5e5e5 1px;,height: 0;,margin: 5px 0;,},.blocklyToolboxDiv[layout="h"] .blocklyTreeSeparator {,border-right: solid #e5e5e5 1px;,border-bottom: none;,height: auto;,margin: 0 5px 0 5px;,padding: 5px 0;,width: 0;,}'.split(",")),t.registry.register(t.registry.Type.TOOLBOX_ITEM,t.ToolboxSeparator.registrationName,t.ToolboxSeparator),t.CollapsibleToolboxCategory=function(e,n,r){this.subcategoriesDiv_=null,this.expanded_=!1,this.toolboxItems_=[],t.CollapsibleToolboxCategory.superClass_.constructor.call(this,e,n,r)},t.utils.object.inherits(t.CollapsibleToolboxCategory,t.ToolboxCategory),t.CollapsibleToolboxCategory.registrationName="collapsibleCategory",t.CollapsibleToolboxCategory.prototype.makeDefaultCssConfig_=function(){var e=t.CollapsibleToolboxCategory.superClass_.makeDefaultCssConfig_.call(this);return e.contents="blocklyToolboxContents",e},t.CollapsibleToolboxCategory.prototype.parseContents_=function(e){var n=e.contents,r=!0;if(e.custom)this.flyoutItems_=e.custom;else if(n){e=0;for(var i;i=n[e];e++)!t.registry.hasItem(t.registry.Type.TOOLBOX_ITEM,i.kind)||i.kind.toLowerCase()==t.ToolboxSeparator.registrationName&&r?(this.flyoutItems_.push(i),r=!0):(this.createToolboxItem_(i),r=!1)}},t.CollapsibleToolboxCategory.prototype.createToolboxItem_=function(e){var n=e.kind;"CATEGORY"==n.toUpperCase()&&t.utils.toolbox.isCategoryCollapsible(e)&&(n=t.CollapsibleToolboxCategory.registrationName),e=new(t.registry.getClass(t.registry.Type.TOOLBOX_ITEM,n))(e,this.parentToolbox_,this),this.toolboxItems_.push(e)},t.CollapsibleToolboxCategory.prototype.init=function(){t.CollapsibleToolboxCategory.superClass_.init.call(this),this.setExpanded("true"==this.toolboxItemDef_.expanded||this.toolboxItemDef_.expanded)},t.CollapsibleToolboxCategory.prototype.createDom_=function(){t.CollapsibleToolboxCategory.superClass_.createDom_.call(this);var e=this.getChildToolboxItems();return this.subcategoriesDiv_=this.createSubCategoriesDom_(e),t.utils.aria.setRole(this.subcategoriesDiv_,t.utils.aria.Role.GROUP),this.htmlDiv_.appendChild(this.subcategoriesDiv_),this.htmlDiv_},t.CollapsibleToolboxCategory.prototype.createIconDom_=function(){var e=document.createElement("span");return this.parentToolbox_.isHorizontal()||(t.utils.dom.addClass(e,this.cssConfig_.icon),e.style.visibility="visible"),e.style.display="inline-block",e},t.CollapsibleToolboxCategory.prototype.createSubCategoriesDom_=function(e){var n=document.createElement("div");t.utils.dom.addClass(n,this.cssConfig_.contents);for(var r=0;r<e.length;r++){var i=e[r];i.init();var o=i.getDiv();n.appendChild(o),i.getClickTarget&&i.getClickTarget().setAttribute("id",i.getId())}return n},t.CollapsibleToolboxCategory.prototype.setExpanded=function(e){this.expanded_!=e&&((this.expanded_=e)?(this.subcategoriesDiv_.style.display="block",this.openIcon_(this.iconDom_)):(this.subcategoriesDiv_.style.display="none",this.closeIcon_(this.iconDom_)),t.utils.aria.setState(this.htmlDiv_,t.utils.aria.State.EXPANDED,e),this.parentToolbox_.handleToolboxItemResize())},t.CollapsibleToolboxCategory.prototype.setVisible_=function(t){this.htmlDiv_.style.display=t?"block":"none";for(var e,n=0;e=this.getChildToolboxItems()[n];n++)e.setVisible_(t);this.isHidden_=!t,this.parentToolbox_.getSelectedItem()==this&&this.parentToolbox_.clearSelection()},t.CollapsibleToolboxCategory.prototype.isExpanded=function(){return this.expanded_},t.CollapsibleToolboxCategory.prototype.isCollapsible=function(){return!0},t.CollapsibleToolboxCategory.prototype.onClick=function(t){this.toggleExpanded()},t.CollapsibleToolboxCategory.prototype.toggleExpanded=function(){this.setExpanded(!this.expanded_)},t.CollapsibleToolboxCategory.prototype.getDiv=function(){return this.htmlDiv_},t.CollapsibleToolboxCategory.prototype.getChildToolboxItems=function(){return this.toolboxItems_},t.registry.register(t.registry.Type.TOOLBOX_ITEM,t.CollapsibleToolboxCategory.registrationName,t.CollapsibleToolboxCategory),t.Events.ToolboxItemSelect=function(e,n,r){t.Events.ToolboxItemSelect.superClass_.constructor.call(this,r),this.oldItem=e,this.newItem=n},t.utils.object.inherits(t.Events.ToolboxItemSelect,t.Events.UiBase),t.Events.ToolboxItemSelect.prototype.type=t.Events.TOOLBOX_ITEM_SELECT,t.Events.ToolboxItemSelect.prototype.toJson=function(){var e=t.Events.ToolboxItemSelect.superClass_.toJson.call(this);return e.oldItem=this.oldItem,e.newItem=this.newItem,e},t.Events.ToolboxItemSelect.prototype.fromJson=function(e){t.Events.ToolboxItemSelect.superClass_.fromJson.call(this,e),this.oldItem=e.oldItem,this.newItem=e.newItem},t.registry.register(t.registry.Type.EVENT,t.Events.TOOLBOX_ITEM_SELECT,t.Events.ToolboxItemSelect),t.IAutoHideable=function(){},t.IStyleable=function(){},t.IToolbox=function(){},t.Toolbox=function(e){t.Toolbox.superClass_.constructor.call(this),this.workspace_=e,this.id="toolbox",this.toolboxDef_=e.options.languageTree||{contents:[]},this.horizontalLayout_=e.options.horizontalLayout,this.contentsDiv_=this.HtmlDiv=null,this.isVisible_=!1,this.contents_=[],this.height_=this.width_=0,this.RTL=e.options.RTL,this.flyout_=null,this.contentMap_=Object.create(null),this.toolboxPosition=e.options.toolboxPosition,this.previouslySelectedItem_=this.selectedItem_=null,this.boundEvents_=[]},t.utils.object.inherits(t.Toolbox,t.DeleteArea),t.Toolbox.prototype.onShortcut=function(t){return!1},t.Toolbox.prototype.init=function(){var e=this.workspace_,n=e.getParentSvg();this.flyout_=this.createFlyout_(),this.HtmlDiv=this.createDom_(this.workspace_),t.utils.dom.insertAfter(this.flyout_.createDom("svg"),n),this.setVisible(!0),this.flyout_.init(e),this.render(this.toolboxDef_),(e=e.getThemeManager()).subscribe(this.HtmlDiv,"toolboxBackgroundColour","background-color"),e.subscribe(this.HtmlDiv,"toolboxForegroundColour","color"),this.workspace_.getComponentManager().addComponent({component:this,weight:1,capabilities:[t.ComponentManager.Capability.AUTOHIDEABLE,t.ComponentManager.Capability.DELETE_AREA,t.ComponentManager.Capability.DRAG_TARGET]})},t.Toolbox.prototype.createDom_=function(e){e=e.getParentSvg();var n=this.createContainer_();return this.contentsDiv_=this.createContentsContainer_(),this.contentsDiv_.tabIndex=0,t.utils.aria.setRole(this.contentsDiv_,t.utils.aria.Role.TREE),n.appendChild(this.contentsDiv_),e.parentNode.insertBefore(n,e),this.attachEvents_(n,this.contentsDiv_),n},t.Toolbox.prototype.createContainer_=function(){var e=document.createElement("div");return e.setAttribute("layout",this.isHorizontal()?"h":"v"),t.utils.dom.addClass(e,"blocklyToolboxDiv"),t.utils.dom.addClass(e,"blocklyNonSelectable"),e.setAttribute("dir",this.RTL?"RTL":"LTR"),e},t.Toolbox.prototype.createContentsContainer_=function(){var e=document.createElement("div");return t.utils.dom.addClass(e,"blocklyToolboxContents"),this.isHorizontal()&&(e.style.flexDirection="row"),e},t.Toolbox.prototype.attachEvents_=function(e,n){e=t.browserEvents.conditionalBind(e,"click",this,this.onClick_,!1,!0),this.boundEvents_.push(e),n=t.browserEvents.conditionalBind(n,"keydown",this,this.onKeyDown_,!1,!0),this.boundEvents_.push(n)},t.Toolbox.prototype.onClick_=function(e){if(t.utils.isRightButton(e)||e.target==this.HtmlDiv)t.hideChaff(!1);else{var n=e.target.getAttribute("id");n&&((n=this.getToolboxItemById(n)).isSelectable()&&(this.setSelectedItem(n),n.onClick(e))),t.hideChaff(!0)}t.Touch.clearTouchIdentifier()},t.Toolbox.prototype.onKeyDown_=function(e){var n=!1;switch(e.keyCode){case t.utils.KeyCodes.DOWN:n=this.selectNext_();break;case t.utils.KeyCodes.UP:n=this.selectPrevious_();break;case t.utils.KeyCodes.LEFT:n=this.selectParent_();break;case t.utils.KeyCodes.RIGHT:n=this.selectChild_();break;case t.utils.KeyCodes.ENTER:case t.utils.KeyCodes.SPACE:this.selectedItem_&&this.selectedItem_.isCollapsible()&&(this.selectedItem_.toggleExpanded(),n=!0);break;default:n=!1}!n&&this.selectedItem_&&this.selectedItem_.onKeyDown&&(n=this.selectedItem_.onKeyDown(e)),n&&e.preventDefault()},t.Toolbox.prototype.createFlyout_=function(){var e=this.workspace_,n=new t.Options({parentWorkspace:e,rtl:e.RTL,oneBasedIndex:e.options.oneBasedIndex,horizontalLayout:e.horizontalLayout,renderer:e.options.renderer,rendererOverrides:e.options.rendererOverrides,move:{scrollbars:!0}});return n.toolboxPosition=e.options.toolboxPosition,new(e.horizontalLayout?t.registry.getClassFromOptions(t.registry.Type.FLYOUTS_HORIZONTAL_TOOLBOX,e.options,!0):t.registry.getClassFromOptions(t.registry.Type.FLYOUTS_VERTICAL_TOOLBOX,e.options,!0))(n)},t.Toolbox.prototype.render=function(t){this.toolboxDef_=t;for(var e=0;e<this.contents_.length;e++){var n=this.contents_[e];n&&n.dispose()}this.contents_=[],this.contentMap_=Object.create(null),this.renderContents_(t.contents),this.position(),this.handleToolboxItemResize()},t.Toolbox.prototype.renderContents_=function(t){for(var e,n=document.createDocumentFragment(),r=0;e=t[r];r++)this.createToolboxItem_(e,n);this.contentsDiv_.appendChild(n)},t.Toolbox.prototype.createToolboxItem_=function(e,n){var r=e.kind;"CATEGORY"==r.toUpperCase()&&t.utils.toolbox.isCategoryCollapsible(e)&&(r=t.CollapsibleToolboxCategory.registrationName),(r=t.registry.getClass(t.registry.Type.TOOLBOX_ITEM,r.toLowerCase()))&&(e=new r(e,this),this.addToolboxItem_(e),e.init(),(r=e.getDiv())&&n.appendChild(r),e.getClickTarget&&e.getClickTarget().setAttribute("id",e.getId()))},t.Toolbox.prototype.addToolboxItem_=function(t){if(this.contents_.push(t),this.contentMap_[t.getId()]=t,t.isCollapsible())for(var e,n=0;e=t.getChildToolboxItems()[n];n++)this.addToolboxItem_(e)},t.Toolbox.prototype.getToolboxItems=function(){return this.contents_},t.Toolbox.prototype.addStyle=function(e){t.utils.dom.addClass(this.HtmlDiv,e)},t.Toolbox.prototype.removeStyle=function(e){t.utils.dom.removeClass(this.HtmlDiv,e)},t.Toolbox.prototype.getClientRect=function(){if(!this.HtmlDiv||!this.isVisible_)return null;var e=this.HtmlDiv.getBoundingClientRect(),n=e.top,r=n+e.height,i=e.left;return e=i+e.width,this.toolboxPosition==t.utils.toolbox.Position.TOP?new t.utils.Rect(-1e7,r,-1e7,1e7):this.toolboxPosition==t.utils.toolbox.Position.BOTTOM?new t.utils.Rect(n,1e7,-1e7,1e7):this.toolboxPosition==t.utils.toolbox.Position.LEFT?new t.utils.Rect(-1e7,1e7,-1e7,e):new t.utils.Rect(-1e7,1e7,i,1e7)},t.Toolbox.prototype.wouldDelete=function(e,n){return e instanceof t.BlockSvg?this.updateWouldDelete_(!e.getParent()&&e.isDeletable()):this.updateWouldDelete_(e.isDeletable()),this.wouldDelete_},t.Toolbox.prototype.onDragEnter=function(t){this.updateCursorDeleteStyle_(!0)},t.Toolbox.prototype.onDragExit=function(t){this.updateCursorDeleteStyle_(!1)},t.Toolbox.prototype.onDrop=function(t){this.updateCursorDeleteStyle_(!1)},t.Toolbox.prototype.updateWouldDelete_=function(t){t!==this.wouldDelete_&&(this.updateCursorDeleteStyle_(!1),this.wouldDelete_=t,this.updateCursorDeleteStyle_(!0))},t.Toolbox.prototype.updateCursorDeleteStyle_=function(t){var e=this.wouldDelete_?"blocklyToolboxDelete":"blocklyToolboxGrab";t?this.addStyle(e):this.removeStyle(e)},t.Toolbox.prototype.getToolboxItemById=function(t){return this.contentMap_[t]||null},t.Toolbox.prototype.getWidth=function(){return this.width_},t.Toolbox.prototype.getHeight=function(){return this.height_},t.Toolbox.prototype.getFlyout=function(){return this.flyout_},t.Toolbox.prototype.getWorkspace=function(){return this.workspace_},t.Toolbox.prototype.getSelectedItem=function(){return this.selectedItem_},t.Toolbox.prototype.getPreviouslySelectedItem=function(){return this.previouslySelectedItem_},t.Toolbox.prototype.isHorizontal=function(){return this.horizontalLayout_},t.Toolbox.prototype.position=function(){var e=this.workspace_.getMetrics(),n=this.HtmlDiv;n&&(this.horizontalLayout_?(n.style.left="0",n.style.height="auto",n.style.width="100%",this.height_=n.offsetHeight,this.width_=e.viewWidth,this.toolboxPosition==t.utils.toolbox.Position.TOP?n.style.top="0":n.style.bottom="0"):(this.toolboxPosition==t.utils.toolbox.Position.RIGHT?n.style.right="0":n.style.left="0",n.style.height="100%",this.width_=n.offsetWidth,this.height_=e.viewHeight),this.flyout_.position())},t.Toolbox.prototype.handleToolboxItemResize=function(){var e=this.workspace_,n=this.HtmlDiv.getBoundingClientRect();e.translate(this.toolboxPosition==t.utils.toolbox.Position.LEFT?e.scrollX+n.width:e.scrollX,this.toolboxPosition==t.utils.toolbox.Position.TOP?e.scrollY+n.height:e.scrollY),t.svgResize(e)},t.Toolbox.prototype.clearSelection=function(){this.setSelectedItem(null)},t.Toolbox.prototype.refreshTheme=function(){for(var t=0;t<this.contents_.length;t++){var e=this.contents_[t];e.refreshTheme&&e.refreshTheme()}},t.Toolbox.prototype.refreshSelection=function(){this.selectedItem_&&this.selectedItem_.isSelectable()&&this.selectedItem_.getContents().length&&this.flyout_.show(this.selectedItem_.getContents())},t.Toolbox.prototype.setVisible=function(t){this.isVisible_!==t&&(this.HtmlDiv.style.display=t?"block":"none",this.isVisible_=t,this.workspace_.recordDragTargets())},t.Toolbox.prototype.autoHide=function(t){!t&&this.flyout_&&this.flyout_.autoClose&&this.clearSelection()},t.Toolbox.prototype.setSelectedItem=function(t){var e=this.selectedItem_;!t&&!e||t&&!t.isSelectable()||(this.shouldDeselectItem_(e,t)&&null!=e&&this.deselectItem_(e),this.shouldSelectItem_(e,t)&&null!=t&&this.selectItem_(e,t),this.updateFlyout_(e,t),this.fireSelectEvent_(e,t))},t.Toolbox.prototype.shouldDeselectItem_=function(t,e){return null!=t&&(!t.isCollapsible()||t!=e)},t.Toolbox.prototype.shouldSelectItem_=function(t,e){return null!=e&&e!=t},t.Toolbox.prototype.deselectItem_=function(e){this.selectedItem_=null,this.previouslySelectedItem_=e,e.setSelected(!1),t.utils.aria.setState(this.contentsDiv_,t.utils.aria.State.ACTIVEDESCENDANT,"")},t.Toolbox.prototype.selectItem_=function(e,n){this.selectedItem_=n,this.previouslySelectedItem_=e,n.setSelected(!0),t.utils.aria.setState(this.contentsDiv_,t.utils.aria.State.ACTIVEDESCENDANT,n.getId())},t.Toolbox.prototype.selectItemByPosition=function(t){-1<t&&t<this.contents_.length&&((t=this.contents_[t]).isSelectable()&&this.setSelectedItem(t))},t.Toolbox.prototype.updateFlyout_=function(t,e){(t!=e||e.isCollapsible())&&e&&e.getContents().length?(this.flyout_.show(e.getContents()),this.flyout_.scrollToStart()):this.flyout_.hide()},t.Toolbox.prototype.fireSelectEvent_=function(e,n){var r=e&&e.getName(),i=n&&n.getName();e==n&&(i=null),e=new(t.Events.get(t.Events.TOOLBOX_ITEM_SELECT))(r,i,this.workspace_.id),t.Events.fire(e)},t.Toolbox.prototype.selectParent_=function(){return!!this.selectedItem_&&(this.selectedItem_.isCollapsible()&&this.selectedItem_.isExpanded()?(this.selectedItem_.setExpanded(!1),!0):!(!this.selectedItem_.getParent()||!this.selectedItem_.getParent().isSelectable())&&(this.setSelectedItem(this.selectedItem_.getParent()),!0))},t.Toolbox.prototype.selectChild_=function(){if(!this.selectedItem_||!this.selectedItem_.isCollapsible())return!1;var t=this.selectedItem_;return t.isExpanded()?this.selectNext_():t.setExpanded(!0),!0},t.Toolbox.prototype.selectNext_=function(){if(!this.selectedItem_)return!1;var t=this.contents_.indexOf(this.selectedItem_)+1;if(-1<t&&t<this.contents_.length){for(var e=this.contents_[t];e&&!e.isSelectable();)e=this.contents_[++t];if(e&&e.isSelectable())return this.setSelectedItem(e),!0}return!1},t.Toolbox.prototype.selectPrevious_=function(){if(!this.selectedItem_)return!1;var t=this.contents_.indexOf(this.selectedItem_)-1;if(-1<t&&t<this.contents_.length){for(var e=this.contents_[t];e&&!e.isSelectable();)e=this.contents_[--t];if(e&&e.isSelectable())return this.setSelectedItem(e),!0}return!1},t.Toolbox.prototype.dispose=function(){this.workspace_.getComponentManager().removeComponent("toolbox"),this.flyout_.dispose();for(var e=0;e<this.contents_.length;e++)this.contents_[e].dispose();for(e=0;e<this.boundEvents_.length;e++)t.browserEvents.unbind(this.boundEvents_[e]);this.boundEvents_=[],this.contents_=[],this.workspace_.getThemeManager().unsubscribe(this.HtmlDiv),t.utils.dom.removeNode(this.HtmlDiv)},t.Css.register([".blocklyToolboxDelete {",'cursor: url("<<<PATH>>>/handdelete.cur"), auto;',"}",".blocklyToolboxGrab {",'cursor: url("<<<PATH>>>/handclosed.cur"), auto;',"cursor: grabbing;","cursor: -webkit-grabbing;","}",".blocklyToolboxDiv {","background-color: #ddd;","overflow-x: visible;","overflow-y: auto;","padding: 4px 0 4px 0;","position: absolute;","z-index: 70;","-webkit-tap-highlight-color: transparent;","}",".blocklyToolboxContents {","display: flex;","flex-wrap: wrap;","flex-direction: column;","}",".blocklyToolboxContents:focus {","outline: none;","}"]),t.registry.register(t.registry.Type.TOOLBOX,t.registry.DEFAULT,t.Toolbox),t.Events.TrashcanOpen=function(e,n){t.Events.TrashcanOpen.superClass_.constructor.call(this,n),this.isOpen=e},t.utils.object.inherits(t.Events.TrashcanOpen,t.Events.UiBase),t.Events.TrashcanOpen.prototype.type=t.Events.TRASHCAN_OPEN,t.Events.TrashcanOpen.prototype.toJson=function(){var e=t.Events.TrashcanOpen.superClass_.toJson.call(this);return e.isOpen=this.isOpen,e},t.Events.TrashcanOpen.prototype.fromJson=function(e){t.Events.TrashcanOpen.superClass_.fromJson.call(this,e),this.isOpen=e.isOpen},t.registry.register(t.registry.Type.EVENT,t.Events.TRASHCAN_OPEN,t.Events.TrashcanOpen),t.IPositionable=function(){},t.uiPosition={},t.uiPosition.verticalPosition={TOP:0,BOTTOM:1},t.uiPosition.horizontalPosition={LEFT:0,RIGHT:1},t.uiPosition.bumpDirection={UP:0,DOWN:1},t.uiPosition.getStartPositionRect=function(e,n,r,i,o,s){var a=s.scrollbar&&s.scrollbar.canScrollVertically();return e.horizontal===t.uiPosition.horizontalPosition.LEFT?(r=o.absoluteMetrics.left+r,a&&s.RTL&&(r+=t.Scrollbar.scrollbarThickness)):(r=o.absoluteMetrics.left+o.viewMetrics.width-n.width-r,a&&!s.RTL&&(r-=t.Scrollbar.scrollbarThickness)),e.vertical===t.uiPosition.verticalPosition.TOP?e=o.absoluteMetrics.top+i:(e=o.absoluteMetrics.top+o.viewMetrics.height-n.height-i,s.scrollbar&&s.scrollbar.canScrollHorizontally()&&(e-=t.Scrollbar.scrollbarThickness)),new t.utils.Rect(e,e+n.height,r,r+n.width)},t.uiPosition.getCornerOppositeToolbox=function(e,n){return{horizontal:n.toolboxMetrics.position===t.utils.toolbox.Position.LEFT||e.horizontalLayout&&!e.RTL?t.uiPosition.horizontalPosition.RIGHT:t.uiPosition.horizontalPosition.LEFT,vertical:n.toolboxMetrics.position===t.utils.toolbox.Position.BOTTOM?t.uiPosition.verticalPosition.TOP:t.uiPosition.verticalPosition.BOTTOM}},t.uiPosition.bumpPositionRect=function(e,n,r,i){for(var o,s=e.left,a=e.right-e.left,l=e.bottom-e.top,u=0;o=i[u];u++)e.intersects(o)&&(e=r===t.uiPosition.bumpDirection.UP?o.top-l-n:o.bottom+n,e=new t.utils.Rect(e,e+l,s,s+a),u=-1);return e},t.Trashcan=function(e){t.Trashcan.superClass_.constructor.call(this),this.workspace_=e,this.id="trashcan",this.contents_=[],this.flyout=null,0>=this.workspace_.options.maxTrashcanContents||(e=new t.Options({scrollbars:!0,parentWorkspace:this.workspace_,rtl:this.workspace_.RTL,oneBasedIndex:this.workspace_.options.oneBasedIndex,renderer:this.workspace_.options.renderer,rendererOverrides:this.workspace_.options.rendererOverrides,move:{scrollbars:!0}}),this.workspace_.horizontalLayout?(e.toolboxPosition=this.workspace_.toolboxPosition==t.utils.toolbox.Position.TOP?t.utils.toolbox.Position.BOTTOM:t.utils.toolbox.Position.TOP,this.flyout=new(t.registry.getClassFromOptions(t.registry.Type.FLYOUTS_HORIZONTAL_TOOLBOX,this.workspace_.options,!0))(e)):(e.toolboxPosition=this.workspace_.toolboxPosition==t.utils.toolbox.Position.RIGHT?t.utils.toolbox.Position.LEFT:t.utils.toolbox.Position.RIGHT,this.flyout=new(t.registry.getClassFromOptions(t.registry.Type.FLYOUTS_VERTICAL_TOOLBOX,this.workspace_.options,!0))(e)),this.workspace_.addChangeListener(this.onDelete_.bind(this)))},t.utils.object.inherits(t.Trashcan,t.DeleteArea),t.Trashcan.prototype.WIDTH_=47,t.Trashcan.prototype.BODY_HEIGHT_=44,t.Trashcan.prototype.LID_HEIGHT_=16,t.Trashcan.prototype.MARGIN_VERTICAL_=20,t.Trashcan.prototype.MARGIN_HORIZONTAL_=20,t.Trashcan.prototype.MARGIN_HOTSPOT_=10,t.Trashcan.prototype.SPRITE_LEFT_=0,t.Trashcan.prototype.SPRITE_TOP_=32,t.Trashcan.prototype.HAS_BLOCKS_LID_ANGLE_=.1,t.Trashcan.ANIMATION_LENGTH_=80,t.Trashcan.ANIMATION_FRAMES_=4,t.Trashcan.OPACITY_MIN_=.4,t.Trashcan.OPACITY_MAX_=.8,t.Trashcan.MAX_LID_ANGLE_=45,t.Trashcan.prototype.isLidOpen=!1,t.Trashcan.prototype.minOpenness_=0,t.Trashcan.prototype.svgGroup_=null,t.Trashcan.prototype.svgLid_=null,t.Trashcan.prototype.lidTask_=0,t.Trashcan.prototype.lidOpen_=0,t.Trashcan.prototype.left_=0,t.Trashcan.prototype.top_=0,t.Trashcan.prototype.initialized_=!1,t.Trashcan.prototype.createDom=function(){this.svgGroup_=t.utils.dom.createSvgElement(t.utils.Svg.G,{class:"blocklyTrash"},null);var e=String(Math.random()).substring(2),n=t.utils.dom.createSvgElement(t.utils.Svg.CLIPPATH,{id:"blocklyTrashBodyClipPath"+e},this.svgGroup_);t.utils.dom.createSvgElement(t.utils.Svg.RECT,{width:this.WIDTH_,height:this.BODY_HEIGHT_,y:this.LID_HEIGHT_},n);var r=t.utils.dom.createSvgElement(t.utils.Svg.IMAGE,{width:t.SPRITE.width,x:-this.SPRITE_LEFT_,height:t.SPRITE.height,y:-this.SPRITE_TOP_,"clip-path":"url(#blocklyTrashBodyClipPath"+e+")"},this.svgGroup_);return r.setAttributeNS(t.utils.dom.XLINK_NS,"xlink:href",this.workspace_.options.pathToMedia+t.SPRITE.url),n=t.utils.dom.createSvgElement(t.utils.Svg.CLIPPATH,{id:"blocklyTrashLidClipPath"+e},this.svgGroup_),t.utils.dom.createSvgElement(t.utils.Svg.RECT,{width:this.WIDTH_,height:this.LID_HEIGHT_},n),this.svgLid_=t.utils.dom.createSvgElement(t.utils.Svg.IMAGE,{width:t.SPRITE.width,x:-this.SPRITE_LEFT_,height:t.SPRITE.height,y:-this.SPRITE_TOP_,"clip-path":"url(#blocklyTrashLidClipPath"+e+")"},this.svgGroup_),this.svgLid_.setAttributeNS(t.utils.dom.XLINK_NS,"xlink:href",this.workspace_.options.pathToMedia+t.SPRITE.url),t.browserEvents.bind(this.svgGroup_,"mousedown",this,this.blockMouseDownWhenOpenable_),t.browserEvents.bind(this.svgGroup_,"mouseup",this,this.click),t.browserEvents.bind(r,"mouseover",this,this.mouseOver_),t.browserEvents.bind(r,"mouseout",this,this.mouseOut_),this.animateLid_(),this.svgGroup_},t.Trashcan.prototype.init=function(){0<this.workspace_.options.maxTrashcanContents&&(t.utils.dom.insertAfter(this.flyout.createDom(t.utils.Svg.SVG),this.workspace_.getParentSvg()),this.flyout.init(this.workspace_)),this.workspace_.getComponentManager().addComponent({component:this,weight:1,capabilities:[t.ComponentManager.Capability.AUTOHIDEABLE,t.ComponentManager.Capability.DELETE_AREA,t.ComponentManager.Capability.DRAG_TARGET,t.ComponentManager.Capability.POSITIONABLE]}),this.initialized_=!0,this.setLidOpen(!1)},t.Trashcan.prototype.dispose=function(){this.workspace_.getComponentManager().removeComponent("trashcan"),this.svgGroup_&&(t.utils.dom.removeNode(this.svgGroup_),this.svgGroup_=null),this.workspace_=this.svgLid_=null,clearTimeout(this.lidTask_)},t.Trashcan.prototype.hasContents_=function(){return!!this.contents_.length},t.Trashcan.prototype.contentsIsOpen=function(){return this.flyout.isVisible()},t.Trashcan.prototype.openFlyout=function(){if(!this.contentsIsOpen()){var e=this.contents_.map(t.Xml.textToDom);this.flyout.show(e),this.fireUiEvent_(!0)}},t.Trashcan.prototype.closeFlyout=function(){this.contentsIsOpen()&&(this.flyout.hide(),this.fireUiEvent_(!1))},t.Trashcan.prototype.autoHide=function(t){!t&&this.flyout&&this.closeFlyout()},t.Trashcan.prototype.emptyContents=function(){this.hasContents_()&&(this.contents_.length=0,this.setMinOpenness_(0),this.closeFlyout())},t.Trashcan.prototype.position=function(e,n){if(this.initialized_){var r=t.uiPosition.getCornerOppositeToolbox(this.workspace_,e);e=t.uiPosition.getStartPositionRect(r,new t.utils.Size(this.WIDTH_,this.BODY_HEIGHT_+this.LID_HEIGHT_),this.MARGIN_HORIZONTAL_,this.MARGIN_VERTICAL_,e,this.workspace_),n=t.uiPosition.bumpPositionRect(e,this.MARGIN_VERTICAL_,r.vertical===t.uiPosition.verticalPosition.TOP?t.uiPosition.bumpDirection.DOWN:t.uiPosition.bumpDirection.UP,n),this.top_=n.top,this.left_=n.left,this.svgGroup_.setAttribute("transform","translate("+this.left_+","+this.top_+")")}},t.Trashcan.prototype.getBoundingRectangle=function(){return new t.utils.Rect(this.top_,this.top_+this.BODY_HEIGHT_+this.LID_HEIGHT_,this.left_,this.left_+this.WIDTH_)},t.Trashcan.prototype.getClientRect=function(){if(!this.svgGroup_)return null;var e=this.svgGroup_.getBoundingClientRect(),n=e.top+this.SPRITE_TOP_-this.MARGIN_HOTSPOT_;return e=e.left+this.SPRITE_LEFT_-this.MARGIN_HOTSPOT_,new t.utils.Rect(n,n+this.LID_HEIGHT_+this.BODY_HEIGHT_+2*this.MARGIN_HOTSPOT_,e,e+this.WIDTH_+2*this.MARGIN_HOTSPOT_)},t.Trashcan.prototype.onDragOver=function(t){this.setLidOpen(this.wouldDelete_)},t.Trashcan.prototype.onDragExit=function(t){this.setLidOpen(!1)},t.Trashcan.prototype.onDrop=function(t){setTimeout(this.setLidOpen.bind(this,!1),100)},t.Trashcan.prototype.setLidOpen=function(t){this.isLidOpen!=t&&(clearTimeout(this.lidTask_),this.isLidOpen=t,this.animateLid_())},t.Trashcan.prototype.animateLid_=function(){var e=t.Trashcan.ANIMATION_FRAMES_,n=1/(e+1);this.lidOpen_+=this.isLidOpen?n:-n,this.lidOpen_=Math.min(Math.max(this.lidOpen_,this.minOpenness_),1),this.setLidAngle_(this.lidOpen_*t.Trashcan.MAX_LID_ANGLE_),n=t.Trashcan.OPACITY_MIN_,this.svgGroup_.style.opacity=n+this.lidOpen_*(t.Trashcan.OPACITY_MAX_-n),this.lidOpen_>this.minOpenness_&&1>this.lidOpen_&&(this.lidTask_=setTimeout(this.animateLid_.bind(this),t.Trashcan.ANIMATION_LENGTH_/e))},t.Trashcan.prototype.setLidAngle_=function(e){var n=this.workspace_.toolboxPosition==t.utils.toolbox.Position.RIGHT||this.workspace_.horizontalLayout&&this.workspace_.RTL;this.svgLid_.setAttribute("transform","rotate("+(n?-e:e)+","+(n?4:this.WIDTH_-4)+","+(this.LID_HEIGHT_-2)+")")},t.Trashcan.prototype.setMinOpenness_=function(e){this.minOpenness_=e,this.isLidOpen||this.setLidAngle_(e*t.Trashcan.MAX_LID_ANGLE_)},t.Trashcan.prototype.closeLid=function(){this.setLidOpen(!1)},t.Trashcan.prototype.click=function(){this.hasContents_()&&this.openFlyout()},t.Trashcan.prototype.fireUiEvent_=function(e){e=new(t.Events.get(t.Events.TRASHCAN_OPEN))(e,this.workspace_.id),t.Events.fire(e)},t.Trashcan.prototype.blockMouseDownWhenOpenable_=function(t){!this.contentsIsOpen()&&this.hasContents_()&&t.stopPropagation()},t.Trashcan.prototype.mouseOver_=function(){this.hasContents_()&&this.setLidOpen(!0)},t.Trashcan.prototype.mouseOut_=function(){this.setLidOpen(!1)},t.Trashcan.prototype.onDelete_=function(e){if(!(0>=this.workspace_.options.maxTrashcanContents)&&e.type==t.Events.BLOCK_DELETE&&e.oldXml.tagName&&"shadow"!=e.oldXml.tagName.toLowerCase()&&(e=this.cleanBlockXML_(e.oldXml),-1==this.contents_.indexOf(e))){for(this.contents_.unshift(e);this.contents_.length>this.workspace_.options.maxTrashcanContents;)this.contents_.pop();this.setMinOpenness_(this.HAS_BLOCKS_LID_ANGLE_)}},t.Trashcan.prototype.cleanBlockXML_=function(e){for(var n=e=e.cloneNode(!0);n;){n.removeAttribute&&(n.removeAttribute("x"),n.removeAttribute("y"),n.removeAttribute("id"),n.removeAttribute("disabled"),"comment"==n.nodeName&&(n.removeAttribute("h"),n.removeAttribute("w"),n.removeAttribute("pinned")));var r=n.firstChild||n.nextSibling;if(!r)for(r=n.parentNode;r;){if(r.nextSibling){r=r.nextSibling;break}r=r.parentNode}n=r}return t.Xml.domToText(e)},t.VariablesDynamic={},t.VariablesDynamic.onCreateVariableButtonClick_String=function(e){t.Variables.createVariableButtonHandler(e.getTargetWorkspace(),void 0,"String")},t.VariablesDynamic.onCreateVariableButtonClick_Number=function(e){t.Variables.createVariableButtonHandler(e.getTargetWorkspace(),void 0,"Number")},t.VariablesDynamic.onCreateVariableButtonClick_Colour=function(e){t.Variables.createVariableButtonHandler(e.getTargetWorkspace(),void 0,"Colour")},t.VariablesDynamic.flyoutCategory=function(e){var n=[],r=document.createElement("button");return r.setAttribute("text",t.Msg.NEW_STRING_VARIABLE),r.setAttribute("callbackKey","CREATE_VARIABLE_STRING"),n.push(r),(r=document.createElement("button")).setAttribute("text",t.Msg.NEW_NUMBER_VARIABLE),r.setAttribute("callbackKey","CREATE_VARIABLE_NUMBER"),n.push(r),(r=document.createElement("button")).setAttribute("text",t.Msg.NEW_COLOUR_VARIABLE),r.setAttribute("callbackKey","CREATE_VARIABLE_COLOUR"),n.push(r),e.registerButtonCallback("CREATE_VARIABLE_STRING",t.VariablesDynamic.onCreateVariableButtonClick_String),e.registerButtonCallback("CREATE_VARIABLE_NUMBER",t.VariablesDynamic.onCreateVariableButtonClick_Number),e.registerButtonCallback("CREATE_VARIABLE_COLOUR",t.VariablesDynamic.onCreateVariableButtonClick_Colour),e=t.VariablesDynamic.flyoutCategoryBlocks(e),n.concat(e)},t.VariablesDynamic.flyoutCategoryBlocks=function(e){var n=[];if(0<(e=e.getAllVariables()).length){if(t.Blocks.variables_set_dynamic){var r=e[e.length-1],i=t.utils.xml.createElement("block");i.setAttribute("type","variables_set_dynamic"),i.setAttribute("gap",24),i.appendChild(t.Variables.generateVariableFieldDom(r)),n.push(i)}if(t.Blocks.variables_get_dynamic){e.sort(t.VariableModel.compareByName),r=0;for(var o;o=e[r];r++)(i=t.utils.xml.createElement("block")).setAttribute("type","variables_get_dynamic"),i.setAttribute("gap",8),i.appendChild(t.Variables.generateVariableFieldDom(o)),n.push(i)}}return n},t.ZoomControls=function(t){this.workspace_=t,this.id="zoomControls",this.zoomResetGroup_=this.zoomOutGroup_=this.zoomInGroup_=this.onZoomOutWrapper_=this.onZoomInWrapper_=this.onZoomResetWrapper_=null},t.ZoomControls.prototype.WIDTH_=32,t.ZoomControls.prototype.HEIGHT_=32,t.ZoomControls.prototype.SMALL_SPACING_=2,t.ZoomControls.prototype.LARGE_SPACING_=11,t.ZoomControls.prototype.MARGIN_VERTICAL_=20,t.ZoomControls.prototype.MARGIN_HORIZONTAL_=20,t.ZoomControls.prototype.svgGroup_=null,t.ZoomControls.prototype.left_=0,t.ZoomControls.prototype.top_=0,t.ZoomControls.prototype.initialized_=!1,t.ZoomControls.prototype.createDom=function(){this.svgGroup_=t.utils.dom.createSvgElement(t.utils.Svg.G,{},null);var e=String(Math.random()).substring(2);return this.createZoomOutSvg_(e),this.createZoomInSvg_(e),this.workspace_.isMovable()&&this.createZoomResetSvg_(e),this.svgGroup_},t.ZoomControls.prototype.init=function(){this.workspace_.getComponentManager().addComponent({component:this,weight:2,capabilities:[t.ComponentManager.Capability.POSITIONABLE]}),this.initialized_=!0},t.ZoomControls.prototype.dispose=function(){this.workspace_.getComponentManager().removeComponent("zoomControls"),this.svgGroup_&&t.utils.dom.removeNode(this.svgGroup_),this.onZoomResetWrapper_&&t.browserEvents.unbind(this.onZoomResetWrapper_),this.onZoomInWrapper_&&t.browserEvents.unbind(this.onZoomInWrapper_),this.onZoomOutWrapper_&&t.browserEvents.unbind(this.onZoomOutWrapper_)},t.ZoomControls.prototype.getBoundingRectangle=function(){var e=this.SMALL_SPACING_+2*this.HEIGHT_;return this.zoomResetGroup_&&(e+=this.LARGE_SPACING_+this.HEIGHT_),new t.utils.Rect(this.top_,this.top_+e,this.left_,this.left_+this.WIDTH_)},t.ZoomControls.prototype.position=function(e,n){if(this.initialized_){var r=t.uiPosition.getCornerOppositeToolbox(this.workspace_,e),i=this.SMALL_SPACING_+2*this.HEIGHT_;this.zoomResetGroup_&&(i+=this.LARGE_SPACING_+this.HEIGHT_),e=t.uiPosition.getStartPositionRect(r,new t.utils.Size(this.WIDTH_,i),this.MARGIN_HORIZONTAL_,this.MARGIN_VERTICAL_,e,this.workspace_),r=r.vertical,n=t.uiPosition.bumpPositionRect(e,this.MARGIN_VERTICAL_,r===t.uiPosition.verticalPosition.TOP?t.uiPosition.bumpDirection.DOWN:t.uiPosition.bumpDirection.UP,n),r===t.uiPosition.verticalPosition.TOP?(r=this.SMALL_SPACING_+this.HEIGHT_,this.zoomInGroup_.setAttribute("transform","translate(0, "+r+")"),this.zoomResetGroup_&&this.zoomResetGroup_.setAttribute("transform","translate(0, "+(r+this.LARGE_SPACING_+this.HEIGHT_)+")")):(r=this.zoomResetGroup_?this.LARGE_SPACING_+this.HEIGHT_:0,this.zoomInGroup_.setAttribute("transform","translate(0, "+r+")"),this.zoomOutGroup_.setAttribute("transform","translate(0, "+(r+this.SMALL_SPACING_+this.HEIGHT_)+")")),this.top_=n.top,this.left_=n.left,this.svgGroup_.setAttribute("transform","translate("+this.left_+","+this.top_+")")}},t.ZoomControls.prototype.createZoomOutSvg_=function(e){this.zoomOutGroup_=t.utils.dom.createSvgElement(t.utils.Svg.G,{class:"blocklyZoom"},this.svgGroup_);var n=t.utils.dom.createSvgElement(t.utils.Svg.CLIPPATH,{id:"blocklyZoomoutClipPath"+e},this.zoomOutGroup_);t.utils.dom.createSvgElement(t.utils.Svg.RECT,{width:32,height:32},n),t.utils.dom.createSvgElement(t.utils.Svg.IMAGE,{width:t.SPRITE.width,height:t.SPRITE.height,x:-64,y:-92,"clip-path":"url(#blocklyZoomoutClipPath"+e+")"},this.zoomOutGroup_).setAttributeNS(t.utils.dom.XLINK_NS,"xlink:href",this.workspace_.options.pathToMedia+t.SPRITE.url),this.onZoomOutWrapper_=t.browserEvents.conditionalBind(this.zoomOutGroup_,"mousedown",null,this.zoom_.bind(this,-1))},t.ZoomControls.prototype.createZoomInSvg_=function(e){this.zoomInGroup_=t.utils.dom.createSvgElement(t.utils.Svg.G,{class:"blocklyZoom"},this.svgGroup_);var n=t.utils.dom.createSvgElement(t.utils.Svg.CLIPPATH,{id:"blocklyZoominClipPath"+e},this.zoomInGroup_);t.utils.dom.createSvgElement(t.utils.Svg.RECT,{width:32,height:32},n),t.utils.dom.createSvgElement(t.utils.Svg.IMAGE,{width:t.SPRITE.width,height:t.SPRITE.height,x:-32,y:-92,"clip-path":"url(#blocklyZoominClipPath"+e+")"},this.zoomInGroup_).setAttributeNS(t.utils.dom.XLINK_NS,"xlink:href",this.workspace_.options.pathToMedia+t.SPRITE.url),this.onZoomInWrapper_=t.browserEvents.conditionalBind(this.zoomInGroup_,"mousedown",null,this.zoom_.bind(this,1))},t.ZoomControls.prototype.zoom_=function(e,n){this.workspace_.markFocused(),this.workspace_.zoomCenter(e),this.fireZoomEvent_(),t.Touch.clearTouchIdentifier(),n.stopPropagation(),n.preventDefault()},t.ZoomControls.prototype.createZoomResetSvg_=function(e){this.zoomResetGroup_=t.utils.dom.createSvgElement(t.utils.Svg.G,{class:"blocklyZoom"},this.svgGroup_);var n=t.utils.dom.createSvgElement(t.utils.Svg.CLIPPATH,{id:"blocklyZoomresetClipPath"+e},this.zoomResetGroup_);t.utils.dom.createSvgElement(t.utils.Svg.RECT,{width:32,height:32},n),t.utils.dom.createSvgElement(t.utils.Svg.IMAGE,{width:t.SPRITE.width,height:t.SPRITE.height,y:-92,"clip-path":"url(#blocklyZoomresetClipPath"+e+")"},this.zoomResetGroup_).setAttributeNS(t.utils.dom.XLINK_NS,"xlink:href",this.workspace_.options.pathToMedia+t.SPRITE.url),this.onZoomResetWrapper_=t.browserEvents.conditionalBind(this.zoomResetGroup_,"mousedown",null,this.resetZoom_.bind(this))},t.ZoomControls.prototype.resetZoom_=function(e){this.workspace_.markFocused();var n=Math.log(this.workspace_.options.zoomOptions.startScale/this.workspace_.scale)/Math.log(this.workspace_.options.zoomOptions.scaleSpeed);this.workspace_.beginCanvasTransition(),this.workspace_.zoomCenter(n),this.workspace_.scrollCenter(),setTimeout(this.workspace_.endCanvasTransition.bind(this.workspace_),500),this.fireZoomEvent_(),t.Touch.clearTouchIdentifier(),e.stopPropagation(),e.preventDefault()},t.ZoomControls.prototype.fireZoomEvent_=function(){var e=new(t.Events.get(t.Events.CLICK))(null,this.workspace_.id,"zoom_controls");t.Events.fire(e)},t.Css.register([".blocklyZoom>image, .blocklyZoom>svg>image {","opacity: .4;","}",".blocklyZoom>image:hover, .blocklyZoom>svg>image:hover {","opacity: .6;","}",".blocklyZoom>image:active, .blocklyZoom>svg>image:active {","opacity: .8;","}"]),t.ShortcutItems={},t.ShortcutItems.names={ESCAPE:"escape",DELETE:"delete",COPY:"copy",CUT:"cut",PASTE:"paste",UNDO:"undo",REDO:"redo"},t.ShortcutItems.registerEscape=function(){var e={name:t.ShortcutItems.names.ESCAPE,preconditionFn:function(t){return!t.options.readOnly},callback:function(){return t.hideChaff(),!0}};t.ShortcutRegistry.registry.register(e),t.ShortcutRegistry.registry.addKeyMapping(t.utils.KeyCodes.ESC,e.name)},t.ShortcutItems.registerDelete=function(){var e={name:t.ShortcutItems.names.DELETE,preconditionFn:function(e){return!e.options.readOnly&&t.selected&&t.selected.isDeletable()},callback:function(e,n){return n.preventDefault(),!t.Gesture.inProgress()&&(t.deleteBlock(t.selected),!0)}};t.ShortcutRegistry.registry.register(e),t.ShortcutRegistry.registry.addKeyMapping(t.utils.KeyCodes.DELETE,e.name),t.ShortcutRegistry.registry.addKeyMapping(t.utils.KeyCodes.BACKSPACE,e.name)},t.ShortcutItems.registerCopy=function(){var e={name:t.ShortcutItems.names.COPY,preconditionFn:function(e){return!e.options.readOnly&&!t.Gesture.inProgress()&&t.selected&&t.selected.isDeletable()&&t.selected.isMovable()},callback:function(e,n){return n.preventDefault(),t.hideChaff(),t.copy(t.selected),!0}};t.ShortcutRegistry.registry.register(e);var n=t.ShortcutRegistry.registry.createSerializedKey(t.utils.KeyCodes.C,[t.utils.KeyCodes.CTRL]);t.ShortcutRegistry.registry.addKeyMapping(n,e.name),n=t.ShortcutRegistry.registry.createSerializedKey(t.utils.KeyCodes.C,[t.utils.KeyCodes.ALT]),t.ShortcutRegistry.registry.addKeyMapping(n,e.name),n=t.ShortcutRegistry.registry.createSerializedKey(t.utils.KeyCodes.C,[t.utils.KeyCodes.META]),t.ShortcutRegistry.registry.addKeyMapping(n,e.name)},t.ShortcutItems.registerCut=function(){var e={name:t.ShortcutItems.names.CUT,preconditionFn:function(e){return!e.options.readOnly&&!t.Gesture.inProgress()&&t.selected&&t.selected.isDeletable()&&t.selected.isMovable()&&!t.selected.workspace.isFlyout},callback:function(){return t.copy(t.selected),t.deleteBlock(t.selected),!0}};t.ShortcutRegistry.registry.register(e);var n=t.ShortcutRegistry.registry.createSerializedKey(t.utils.KeyCodes.X,[t.utils.KeyCodes.CTRL]);t.ShortcutRegistry.registry.addKeyMapping(n,e.name),n=t.ShortcutRegistry.registry.createSerializedKey(t.utils.KeyCodes.X,[t.utils.KeyCodes.ALT]),t.ShortcutRegistry.registry.addKeyMapping(n,e.name),n=t.ShortcutRegistry.registry.createSerializedKey(t.utils.KeyCodes.X,[t.utils.KeyCodes.META]),t.ShortcutRegistry.registry.addKeyMapping(n,e.name)},t.ShortcutItems.registerPaste=function(){var e={name:t.ShortcutItems.names.PASTE,preconditionFn:function(e){return!e.options.readOnly&&!t.Gesture.inProgress()},callback:function(){return t.paste()}};t.ShortcutRegistry.registry.register(e);var n=t.ShortcutRegistry.registry.createSerializedKey(t.utils.KeyCodes.V,[t.utils.KeyCodes.CTRL]);t.ShortcutRegistry.registry.addKeyMapping(n,e.name),n=t.ShortcutRegistry.registry.createSerializedKey(t.utils.KeyCodes.V,[t.utils.KeyCodes.ALT]),t.ShortcutRegistry.registry.addKeyMapping(n,e.name),n=t.ShortcutRegistry.registry.createSerializedKey(t.utils.KeyCodes.V,[t.utils.KeyCodes.META]),t.ShortcutRegistry.registry.addKeyMapping(n,e.name)},t.ShortcutItems.registerUndo=function(){var e={name:t.ShortcutItems.names.UNDO,preconditionFn:function(e){return!e.options.readOnly&&!t.Gesture.inProgress()},callback:function(e){return t.hideChaff(),e.undo(!1),!0}};t.ShortcutRegistry.registry.register(e);var n=t.ShortcutRegistry.registry.createSerializedKey(t.utils.KeyCodes.Z,[t.utils.KeyCodes.CTRL]);t.ShortcutRegistry.registry.addKeyMapping(n,e.name),n=t.ShortcutRegistry.registry.createSerializedKey(t.utils.KeyCodes.Z,[t.utils.KeyCodes.ALT]),t.ShortcutRegistry.registry.addKeyMapping(n,e.name),n=t.ShortcutRegistry.registry.createSerializedKey(t.utils.KeyCodes.Z,[t.utils.KeyCodes.META]),t.ShortcutRegistry.registry.addKeyMapping(n,e.name)},t.ShortcutItems.registerRedo=function(){var e={name:t.ShortcutItems.names.REDO,preconditionFn:function(e){return!t.Gesture.inProgress()&&!e.options.readOnly},callback:function(e){return t.hideChaff(),e.undo(!0),!0}};t.ShortcutRegistry.registry.register(e);var n=t.ShortcutRegistry.registry.createSerializedKey(t.utils.KeyCodes.Z,[t.utils.KeyCodes.SHIFT,t.utils.KeyCodes.CTRL]);t.ShortcutRegistry.registry.addKeyMapping(n,e.name),n=t.ShortcutRegistry.registry.createSerializedKey(t.utils.KeyCodes.Z,[t.utils.KeyCodes.SHIFT,t.utils.KeyCodes.ALT]),t.ShortcutRegistry.registry.addKeyMapping(n,e.name),n=t.ShortcutRegistry.registry.createSerializedKey(t.utils.KeyCodes.Z,[t.utils.KeyCodes.SHIFT,t.utils.KeyCodes.META]),t.ShortcutRegistry.registry.addKeyMapping(n,e.name),n=t.ShortcutRegistry.registry.createSerializedKey(t.utils.KeyCodes.Y,[t.utils.KeyCodes.CTRL]),t.ShortcutRegistry.registry.addKeyMapping(n,e.name)},t.ShortcutItems.registerDefaultShortcuts=function(){t.ShortcutItems.registerEscape(),t.ShortcutItems.registerDelete(),t.ShortcutItems.registerCopy(),t.ShortcutItems.registerCut(),t.ShortcutItems.registerPaste(),t.ShortcutItems.registerUndo(),t.ShortcutItems.registerRedo()},t.ShortcutItems.registerDefaultShortcuts(),t.ContextMenuItems={},t.ContextMenuItems.registerUndo=function(){t.ContextMenuRegistry.registry.register({displayText:function(){return t.Msg.UNDO},preconditionFn:function(t){return 0<t.workspace.getUndoStack().length?"enabled":"disabled"},callback:function(t){t.workspace.undo(!1)},scopeType:t.ContextMenuRegistry.ScopeType.WORKSPACE,id:"undoWorkspace",weight:1})},t.ContextMenuItems.registerRedo=function(){t.ContextMenuRegistry.registry.register({displayText:function(){return t.Msg.REDO},preconditionFn:function(t){return 0<t.workspace.getRedoStack().length?"enabled":"disabled"},callback:function(t){t.workspace.undo(!0)},scopeType:t.ContextMenuRegistry.ScopeType.WORKSPACE,id:"redoWorkspace",weight:2})},t.ContextMenuItems.registerCleanup=function(){t.ContextMenuRegistry.registry.register({displayText:function(){return t.Msg.CLEAN_UP},preconditionFn:function(t){return t.workspace.isMovable()?1<t.workspace.getTopBlocks(!1).length?"enabled":"disabled":"hidden"},callback:function(t){t.workspace.cleanUp()},scopeType:t.ContextMenuRegistry.ScopeType.WORKSPACE,id:"cleanWorkspace",weight:3})},t.ContextMenuItems.toggleOption_=function(t,e){for(var n=0,r=0;r<e.length;r++)for(var i=e[r];i;)setTimeout(i.setCollapsed.bind(i,t),n),i=i.getNextBlock(),n+=10},t.ContextMenuItems.registerCollapse=function(){t.ContextMenuRegistry.registry.register({displayText:function(){return t.Msg.COLLAPSE_ALL},preconditionFn:function(t){if(t.workspace.options.collapse){t=t.workspace.getTopBlocks(!1);for(var e=0;e<t.length;e++)for(var n=t[e];n;){if(!n.isCollapsed())return"enabled";n=n.getNextBlock()}return"disabled"}return"hidden"},callback:function(e){t.ContextMenuItems.toggleOption_(!0,e.workspace.getTopBlocks(!0))},scopeType:t.ContextMenuRegistry.ScopeType.WORKSPACE,id:"collapseWorkspace",weight:4})},t.ContextMenuItems.registerExpand=function(){t.ContextMenuRegistry.registry.register({displayText:function(){return t.Msg.EXPAND_ALL},preconditionFn:function(t){if(t.workspace.options.collapse){t=t.workspace.getTopBlocks(!1);for(var e=0;e<t.length;e++)for(var n=t[e];n;){if(n.isCollapsed())return"enabled";n=n.getNextBlock()}return"disabled"}return"hidden"},callback:function(e){t.ContextMenuItems.toggleOption_(!1,e.workspace.getTopBlocks(!0))},scopeType:t.ContextMenuRegistry.ScopeType.WORKSPACE,id:"expandWorkspace",weight:5})},t.ContextMenuItems.addDeletableBlocks_=function(e,n){if(e.isDeletable())Array.prototype.push.apply(n,e.getDescendants(!1));else{e=e.getChildren(!1);for(var r=0;r<e.length;r++)t.ContextMenuItems.addDeletableBlocks_(e[r],n)}},t.ContextMenuItems.getDeletableBlocks_=function(e){var n=[];e=e.getTopBlocks(!0);for(var r=0;r<e.length;r++)t.ContextMenuItems.addDeletableBlocks_(e[r],n);return n},t.ContextMenuItems.deleteNext_=function(e,n){t.Events.setGroup(n);var r=e.shift();r&&(r.workspace?(r.dispose(!1,!0),setTimeout(t.ContextMenuItems.deleteNext_,10,e,n)):t.ContextMenuItems.deleteNext_(e,n)),t.Events.setGroup(!1)},t.ContextMenuItems.registerDeleteAll=function(){t.ContextMenuRegistry.registry.register({displayText:function(e){if(e.workspace)return 1==(e=t.ContextMenuItems.getDeletableBlocks_(e.workspace).length)?t.Msg.DELETE_BLOCK:t.Msg.DELETE_X_BLOCKS.replace("%1",String(e))},preconditionFn:function(e){if(e.workspace)return 0<t.ContextMenuItems.getDeletableBlocks_(e.workspace).length?"enabled":"disabled"},callback:function(e){if(e.workspace){e.workspace.cancelCurrentGesture();var n=t.ContextMenuItems.getDeletableBlocks_(e.workspace),r=t.utils.genUid();2>n.length?t.ContextMenuItems.deleteNext_(n,r):t.confirm(t.Msg.DELETE_ALL_BLOCKS.replace("%1",n.length),function(e){e&&t.ContextMenuItems.deleteNext_(n,r)})}},scopeType:t.ContextMenuRegistry.ScopeType.WORKSPACE,id:"workspaceDelete",weight:6})},t.ContextMenuItems.registerWorkspaceOptions_=function(){t.ContextMenuItems.registerUndo(),t.ContextMenuItems.registerRedo(),t.ContextMenuItems.registerCleanup(),t.ContextMenuItems.registerCollapse(),t.ContextMenuItems.registerExpand(),t.ContextMenuItems.registerDeleteAll()},t.ContextMenuItems.registerDuplicate=function(){t.ContextMenuRegistry.registry.register({displayText:function(){return t.Msg.DUPLICATE_BLOCK},preconditionFn:function(t){return!(t=t.block).isInFlyout&&t.isDeletable()&&t.isMovable()?t.isDuplicatable()?"enabled":"disabled":"hidden"},callback:function(e){e.block&&t.duplicate(e.block)},scopeType:t.ContextMenuRegistry.ScopeType.BLOCK,id:"blockDuplicate",weight:1})},t.ContextMenuItems.registerComment=function(){t.ContextMenuRegistry.registry.register({displayText:function(e){return e.block.getCommentIcon()?t.Msg.REMOVE_COMMENT:t.Msg.ADD_COMMENT},preconditionFn:function(e){return e=e.block,t.utils.userAgent.IE||e.isInFlyout||!e.workspace.options.comments||e.isCollapsed()||!e.isEditable()?"hidden":"enabled"},callback:function(t){(t=t.block).getCommentIcon()?t.setCommentText(null):t.setCommentText("")},scopeType:t.ContextMenuRegistry.ScopeType.BLOCK,id:"blockComment",weight:2})},t.ContextMenuItems.registerInline=function(){t.ContextMenuRegistry.registry.register({displayText:function(e){return e.block.getInputsInline()?t.Msg.EXTERNAL_INPUTS:t.Msg.INLINE_INPUTS},preconditionFn:function(e){if(!(e=e.block).isInFlyout&&e.isMovable()&&!e.isCollapsed())for(var n=1;n<e.inputList.length;n++)if(e.inputList[n-1].type!=t.inputTypes.STATEMENT&&e.inputList[n].type!=t.inputTypes.STATEMENT)return"enabled";return"hidden"},callback:function(t){t.block.setInputsInline(!t.block.getInputsInline())},scopeType:t.ContextMenuRegistry.ScopeType.BLOCK,id:"blockInline",weight:3})},t.ContextMenuItems.registerCollapseExpandBlock=function(){t.ContextMenuRegistry.registry.register({displayText:function(e){return e.block.isCollapsed()?t.Msg.EXPAND_BLOCK:t.Msg.COLLAPSE_BLOCK},preconditionFn:function(t){return!(t=t.block).isInFlyout&&t.isMovable()&&t.workspace.options.collapse?"enabled":"hidden"},callback:function(t){t.block.setCollapsed(!t.block.isCollapsed())},scopeType:t.ContextMenuRegistry.ScopeType.BLOCK,id:"blockCollapseExpand",weight:4})},t.ContextMenuItems.registerDisable=function(){t.ContextMenuRegistry.registry.register({displayText:function(e){return e.block.isEnabled()?t.Msg.DISABLE_BLOCK:t.Msg.ENABLE_BLOCK},preconditionFn:function(t){return!(t=t.block).isInFlyout&&t.workspace.options.disable&&t.isEditable()?t.getInheritedDisabled()?"disabled":"enabled":"hidden"},callback:function(e){e=e.block;var n=t.Events.getGroup();n||t.Events.setGroup(!0),e.setEnabled(!e.isEnabled()),n||t.Events.setGroup(!1)},scopeType:t.ContextMenuRegistry.ScopeType.BLOCK,id:"blockDisable",weight:5})},t.ContextMenuItems.registerDelete=function(){t.ContextMenuRegistry.registry.register({displayText:function(e){var n=e.block;return e=n.getDescendants(!1).length,(n=n.getNextBlock())&&(e-=n.getDescendants(!1).length),1==e?t.Msg.DELETE_BLOCK:t.Msg.DELETE_X_BLOCKS.replace("%1",String(e))},preconditionFn:function(t){return!t.block.isInFlyout&&t.block.isDeletable()?"enabled":"hidden"},callback:function(e){t.Events.setGroup(!0),e.block&&t.deleteBlock(e.block),t.Events.setGroup(!1)},scopeType:t.ContextMenuRegistry.ScopeType.BLOCK,id:"blockDelete",weight:6})},t.ContextMenuItems.registerHelp=function(){t.ContextMenuRegistry.registry.register({displayText:function(){return t.Msg.HELP},preconditionFn:function(t){return("function"==typeof(t=t.block).helpUrl?t.helpUrl():t.helpUrl)?"enabled":"hidden"},callback:function(t){t.block.showHelp()},scopeType:t.ContextMenuRegistry.ScopeType.BLOCK,id:"blockHelp",weight:7})},t.ContextMenuItems.registerBlockOptions_=function(){t.ContextMenuItems.registerDuplicate(),t.ContextMenuItems.registerComment(),t.ContextMenuItems.registerInline(),t.ContextMenuItems.registerCollapseExpandBlock(),t.ContextMenuItems.registerDisable(),t.ContextMenuItems.registerDelete(),t.ContextMenuItems.registerHelp()},t.ContextMenuItems.registerDefaultOptions=function(){t.ContextMenuItems.registerWorkspaceOptions_(),t.ContextMenuItems.registerBlockOptions_()},t.ContextMenuItems.registerDefaultOptions(),t.Mutator=function(e){t.Mutator.superClass_.constructor.call(this,null),this.quarkNames_=e},t.utils.object.inherits(t.Mutator,t.Icon),t.Mutator.prototype.workspace_=null,t.Mutator.prototype.workspaceWidth_=0,t.Mutator.prototype.workspaceHeight_=0,t.Mutator.prototype.setBlock=function(t){this.block_=t},t.Mutator.prototype.getWorkspace=function(){return this.workspace_},t.Mutator.prototype.drawIcon_=function(e){t.utils.dom.createSvgElement(t.utils.Svg.RECT,{class:"blocklyIconShape",rx:"4",ry:"4",height:"16",width:"16"},e),t.utils.dom.createSvgElement(t.utils.Svg.PATH,{class:"blocklyIconSymbol",d:"m4.203,7.296 0,1.368 -0.92,0.677 -0.11,0.41 0.9,1.559 0.41,0.11 1.043,-0.457 1.187,0.683 0.127,1.134 0.3,0.3 1.8,0 0.3,-0.299 0.127,-1.138 1.185,-0.682 1.046,0.458 0.409,-0.11 0.9,-1.559 -0.11,-0.41 -0.92,-0.677 0,-1.366 0.92,-0.677 0.11,-0.41 -0.9,-1.559 -0.409,-0.109 -1.046,0.458 -1.185,-0.682 -0.127,-1.138 -0.3,-0.299 -1.8,0 -0.3,0.3 -0.126,1.135 -1.187,0.682 -1.043,-0.457 -0.41,0.11 -0.899,1.559 0.108,0.409z"},e),t.utils.dom.createSvgElement(t.utils.Svg.CIRCLE,{class:"blocklyIconShape",r:"2.7",cx:"8",cy:"8"},e)},t.Mutator.prototype.iconClick_=function(e){this.block_.isEditable()&&t.Icon.prototype.iconClick_.call(this,e)},t.Mutator.prototype.createEditor_=function(){if(this.svgDialog_=t.utils.dom.createSvgElement(t.utils.Svg.SVG,{x:t.Bubble.BORDER_WIDTH,y:t.Bubble.BORDER_WIDTH},null),this.quarkNames_.length)for(var e,n=t.utils.xml.createElement("xml"),r=0;e=this.quarkNames_[r];r++){var i=t.utils.xml.createElement("block");i.setAttribute("type",e),n.appendChild(i)}else n=null;return(r=new t.Options({disable:!1,parentWorkspace:this.block_.workspace,media:this.block_.workspace.options.pathToMedia,rtl:this.block_.RTL,horizontalLayout:!1,renderer:this.block_.workspace.options.renderer,rendererOverrides:this.block_.workspace.options.rendererOverrides})).toolboxPosition=this.block_.RTL?t.utils.toolbox.Position.RIGHT:t.utils.toolbox.Position.LEFT,(e=!!n)&&(r.languageTree=t.utils.toolbox.convertToolboxDefToJson(n)),this.workspace_=new t.WorkspaceSvg(r),this.workspace_.isMutator=!0,this.workspace_.addChangeListener(t.Events.disableOrphans),n=e?this.workspace_.addFlyout(t.utils.Svg.G):null,r=this.workspace_.createDom("blocklyMutatorBackground"),n&&r.insertBefore(n,this.workspace_.svgBlockCanvas_),this.svgDialog_.appendChild(r),this.svgDialog_},t.Mutator.prototype.updateEditable=function(){t.Mutator.superClass_.updateEditable.call(this),this.block_.isInFlyout||(this.block_.isEditable()?this.iconGroup_&&t.utils.dom.removeClass(this.iconGroup_,"blocklyIconGroupReadonly"):(this.setVisible(!1),this.iconGroup_&&t.utils.dom.addClass(this.iconGroup_,"blocklyIconGroupReadonly")))},t.Mutator.prototype.resizeBubble_=function(){var e=2*t.Bubble.BORDER_WIDTH,n=this.workspace_.getCanvas().getBBox(),r=n.width+n.x,i=n.height+3*e,o=this.workspace_.getFlyout();if(o){var s=o.getWorkspace().getMetricsManager().getScrollMetrics();i=Math.max(i,s.height+20),r+=o.getWidth()}this.block_.RTL&&(r=-n.x),r+=3*e,(Math.abs(this.workspaceWidth_-r)>e||Math.abs(this.workspaceHeight_-i)>e)&&(this.workspaceWidth_=r,this.workspaceHeight_=i,this.bubble_.setBubbleSize(r+e,i+e),this.svgDialog_.setAttribute("width",this.workspaceWidth_),this.svgDialog_.setAttribute("height",this.workspaceHeight_),this.workspace_.setCachedParentSvgSize(this.workspaceWidth_,this.workspaceHeight_)),this.block_.RTL&&(e="translate("+this.workspaceWidth_+",0)",this.workspace_.getCanvas().setAttribute("transform",e)),this.workspace_.resize()},t.Mutator.prototype.onBubbleMove_=function(){this.workspace_&&this.workspace_.recordDragTargets()},t.Mutator.prototype.setVisible=function(e){if(e!=this.isVisible())if(t.Events.fire(new(t.Events.get(t.Events.BUBBLE_OPEN))(this.block_,e,"mutator")),e){this.bubble_=new t.Bubble(this.block_.workspace,this.createEditor_(),this.block_.pathObject.svgPath,this.iconXY_,null,null),this.bubble_.setSvgId(this.block_.id),this.bubble_.registerMoveEvent(this.onBubbleMove_.bind(this));var n=this.workspace_.options.languageTree;e=this.workspace_.getFlyout(),n&&(e.init(this.workspace_),e.show(n)),this.rootBlock_=this.block_.decompose(this.workspace_),n=this.rootBlock_.getDescendants(!1);for(var r,i=0;r=n[i];i++)r.render();if(this.rootBlock_.setMovable(!1),this.rootBlock_.setDeletable(!1),e?(n=2*e.CORNER_RADIUS,e=this.rootBlock_.RTL?e.getWidth()+n:n):e=n=16,this.block_.RTL&&(e=-e),this.rootBlock_.moveBy(e,n),this.block_.saveConnections){var o=this,s=this.block_;s.saveConnections(this.rootBlock_),this.sourceListener_=function(){s.saveConnections(o.rootBlock_)},this.block_.workspace.addChangeListener(this.sourceListener_)}this.resizeBubble_(),this.workspace_.addChangeListener(this.workspaceChanged_.bind(this)),this.applyColour()}else this.svgDialog_=null,this.workspace_.dispose(),this.rootBlock_=this.workspace_=null,this.bubble_.dispose(),this.bubble_=null,this.workspaceHeight_=this.workspaceWidth_=0,this.sourceListener_&&(this.block_.workspace.removeChangeListener(this.sourceListener_),this.sourceListener_=null)},t.Mutator.prototype.workspaceChanged_=function(e){if(!(e.isUiEvent||e.type==t.Events.CHANGE&&"disabled"==e.element)){if(!this.workspace_.isDragging()){e=this.workspace_.getTopBlocks(!1);for(var n,r=0;n=e[r];r++){var i=n.getRelativeToSurfaceXY();if(20>i.y&&n.moveBy(0,20-i.y),n.RTL){var o=-20,s=this.workspace_.getFlyout();s&&(o-=s.getWidth()),i.x>o&&n.moveBy(o-i.x,0)}else 20>i.x&&n.moveBy(20-i.x,0)}}if(this.rootBlock_.workspace==this.workspace_){if(t.Events.setGroup(!0),e=(e=(n=this.block_).mutationToDom())&&t.Xml.domToText(e),r=n.rendered,n.rendered=!1,n.compose(this.rootBlock_),n.rendered=r,n.initSvg(),n.rendered&&n.render(),e!=(r=(r=n.mutationToDom())&&t.Xml.domToText(r))){t.Events.fire(new(t.Events.get(t.Events.BLOCK_CHANGE))(n,"mutation",null,e,r));var a=t.Events.getGroup();setTimeout(function(){t.Events.setGroup(a),n.bumpNeighbours(),t.Events.setGroup(!1)},t.BUMP_DELAY)}this.workspace_.isDragging()||this.resizeBubble_(),t.Events.setGroup(!1)}}},t.Mutator.prototype.dispose=function(){this.block_.mutator=null,t.Icon.prototype.dispose.call(this)},t.Mutator.prototype.updateBlockStyle=function(){var t=this.workspace_;if(t&&t.getAllBlocks(!1)){for(var e,n=t.getAllBlocks(!1),r=0;e=n[r];r++)e.setStyle(e.getStyleName());if(r=t.getFlyout())for(t=r.workspace_.getAllBlocks(!1),r=0;e=t[r];r++)e.setStyle(e.getStyleName())}},t.Mutator.reconnect=function(t,e,n){if(!t||!t.getSourceBlock().workspace)return!1;n=e.getInput(n).connection;var r=t.targetBlock();return!(r&&r!=e||n.targetConnection==t)&&(n.isConnected()&&n.disconnect(),n.connect(t),!0)},t.Mutator.findParentWs=function(t){var e=null;if(t&&t.options){var n=t.options.parentWorkspace;t.isFlyout?n&&n.options&&(e=n.options.parentWorkspace):n&&(e=n)}return e},t.FieldTextInput=function(e,n,r){this.spellcheck_=!0,t.FieldTextInput.superClass_.constructor.call(this,e,n,r),this.onKeyInputWrapper_=this.onKeyDownWrapper_=this.htmlInput_=null,this.fullBlockClickTarget_=!1,this.workspace_=null},t.utils.object.inherits(t.FieldTextInput,t.Field),t.FieldTextInput.prototype.DEFAULT_VALUE="",t.FieldTextInput.fromJson=function(e){var n=t.utils.replaceMessageReferences(e.text);return new t.FieldTextInput(n,void 0,e)},t.FieldTextInput.prototype.SERIALIZABLE=!0,t.FieldTextInput.BORDERRADIUS=4,t.FieldTextInput.prototype.CURSOR="text",t.FieldTextInput.prototype.configure_=function(e){t.FieldTextInput.superClass_.configure_.call(this,e),"boolean"==typeof e.spellcheck&&(this.spellcheck_=e.spellcheck)},t.FieldTextInput.prototype.initView=function(){if(this.getConstants().FULL_BLOCK_FIELDS){for(var t,e=0,n=0,r=0;t=this.sourceBlock_.inputList[r];r++){for(var i=0;t.fieldRow[i];i++)e++;t.connection&&n++}this.fullBlockClickTarget_=1>=e&&this.sourceBlock_.outputConnection&&!n}else this.fullBlockClickTarget_=!1;this.fullBlockClickTarget_?this.clickTarget_=this.sourceBlock_.getSvgRoot():this.createBorderRect_(),this.createTextElement_()},t.FieldTextInput.prototype.doClassValidation_=function(t){return null===t||void 0===t?null:String(t)},t.FieldTextInput.prototype.doValueInvalid_=function(e){this.isBeingEdited_&&(this.isTextValid_=!1,e=this.value_,this.value_=this.htmlInput_.untypedDefaultValue_,this.sourceBlock_&&t.Events.isEnabled()&&t.Events.fire(new(t.Events.get(t.Events.BLOCK_CHANGE))(this.sourceBlock_,"field",this.name||null,e,this.value_)))},t.FieldTextInput.prototype.doValueUpdate_=function(t){this.isTextValid_=!0,this.value_=t,this.isBeingEdited_||(this.isDirty_=!0)},t.FieldTextInput.prototype.applyColour=function(){this.sourceBlock_&&this.getConstants().FULL_BLOCK_FIELDS&&(this.borderRect_?this.borderRect_.setAttribute("stroke",this.sourceBlock_.style.colourTertiary):this.sourceBlock_.pathObject.svgPath.setAttribute("fill",this.getConstants().FIELD_BORDER_RECT_COLOUR))},t.FieldTextInput.prototype.render_=function(){if(t.FieldTextInput.superClass_.render_.call(this),this.isBeingEdited_){this.resizeEditor_();var e=this.htmlInput_;this.isTextValid_?(t.utils.dom.removeClass(e,"blocklyInvalidInput"),t.utils.aria.setState(e,t.utils.aria.State.INVALID,!1)):(t.utils.dom.addClass(e,"blocklyInvalidInput"),t.utils.aria.setState(e,t.utils.aria.State.INVALID,!0))}},t.FieldTextInput.prototype.setSpellcheck=function(t){t!=this.spellcheck_&&(this.spellcheck_=t,this.htmlInput_&&this.htmlInput_.setAttribute("spellcheck",this.spellcheck_))},t.FieldTextInput.prototype.showEditor_=function(e,n){this.workspace_=this.sourceBlock_.workspace,!(e=n||!1)&&(t.utils.userAgent.MOBILE||t.utils.userAgent.ANDROID||t.utils.userAgent.IPAD)?this.showPromptEditor_():this.showInlineEditor_(e)},t.FieldTextInput.prototype.showPromptEditor_=function(){t.prompt(t.Msg.CHANGE_VALUE_TITLE,this.getText(),function(t){this.setValue(this.getValueFromEditorText_(t))}.bind(this))},t.FieldTextInput.prototype.showInlineEditor_=function(e){t.WidgetDiv.show(this,this.sourceBlock_.RTL,this.widgetDispose_.bind(this)),this.htmlInput_=this.widgetCreate_(),this.isBeingEdited_=!0,e||(this.htmlInput_.focus({preventScroll:!0}),this.htmlInput_.select())},t.FieldTextInput.prototype.widgetCreate_=function(){var e=t.WidgetDiv.DIV;t.utils.dom.addClass(this.getClickTarget_(),"editing");var n=document.createElement("input");n.className="blocklyHtmlInput",n.setAttribute("spellcheck",this.spellcheck_);var r=this.workspace_.getScale(),i=this.getConstants().FIELD_TEXT_FONTSIZE*r+"pt";if(e.style.fontSize=i,n.style.fontSize=i,i=t.FieldTextInput.BORDERRADIUS*r+"px",this.fullBlockClickTarget_){i=((i=this.getScaledBBox()).bottom-i.top)/2+"px";var o=this.sourceBlock_.getParent()?this.sourceBlock_.getParent().style.colourTertiary:this.sourceBlock_.style.colourTertiary;n.style.border=1*r+"px solid "+o,e.style.borderRadius=i,e.style.transition="box-shadow 0.25s ease 0s",this.getConstants().FIELD_TEXTINPUT_BOX_SHADOW&&(e.style.boxShadow="rgba(255, 255, 255, 0.3) 0px 0px 0px "+4*r+"px")}return n.style.borderRadius=i,e.appendChild(n),n.value=n.defaultValue=this.getEditorText_(this.value_),n.untypedDefaultValue_=this.value_,n.oldValue_=null,this.resizeEditor_(),this.bindInputEvents_(n),n},t.FieldTextInput.prototype.widgetDispose_=function(){this.isBeingEdited_=!1,this.isTextValid_=!0,this.forceRerender(),this.onFinishEditing_&&this.onFinishEditing_(this.value_),this.unbindInputEvents_();var e=t.WidgetDiv.DIV.style;e.width="auto",e.height="auto",e.fontSize="",e.transition="",e.boxShadow="",this.htmlInput_=null,t.utils.dom.removeClass(this.getClickTarget_(),"editing")},t.FieldTextInput.prototype.bindInputEvents_=function(e){this.onKeyDownWrapper_=t.browserEvents.conditionalBind(e,"keydown",this,this.onHtmlInputKeyDown_),this.onKeyInputWrapper_=t.browserEvents.conditionalBind(e,"input",this,this.onHtmlInputChange_)},t.FieldTextInput.prototype.unbindInputEvents_=function(){this.onKeyDownWrapper_&&(t.browserEvents.unbind(this.onKeyDownWrapper_),this.onKeyDownWrapper_=null),this.onKeyInputWrapper_&&(t.browserEvents.unbind(this.onKeyInputWrapper_),this.onKeyInputWrapper_=null)},t.FieldTextInput.prototype.onHtmlInputKeyDown_=function(e){e.keyCode==t.utils.KeyCodes.ENTER?(t.WidgetDiv.hide(),t.DropDownDiv.hideWithoutAnimation()):e.keyCode==t.utils.KeyCodes.ESC?(this.setValue(this.htmlInput_.untypedDefaultValue_),t.WidgetDiv.hide(),t.DropDownDiv.hideWithoutAnimation()):e.keyCode==t.utils.KeyCodes.TAB&&(t.WidgetDiv.hide(),t.DropDownDiv.hideWithoutAnimation(),this.sourceBlock_.tab(this,!e.shiftKey),e.preventDefault())},t.FieldTextInput.prototype.onHtmlInputChange_=function(e){(e=this.htmlInput_.value)!==this.htmlInput_.oldValue_&&(this.htmlInput_.oldValue_=e,t.Events.setGroup(!0),e=this.getValueFromEditorText_(e),this.setValue(e),this.forceRerender(),this.resizeEditor_(),t.Events.setGroup(!1))},t.FieldTextInput.prototype.setEditorValue_=function(t){this.isDirty_=!0,this.isBeingEdited_&&(this.htmlInput_.value=this.getEditorText_(t)),this.setValue(t)},t.FieldTextInput.prototype.resizeEditor_=function(){var e=t.WidgetDiv.DIV,n=this.getScaledBBox();e.style.width=n.right-n.left+"px",e.style.height=n.bottom-n.top+"px",n=new t.utils.Coordinate(this.sourceBlock_.RTL?n.right-e.offsetWidth:n.left,n.top),e.style.left=n.x+"px",e.style.top=n.y+"px"},t.FieldTextInput.prototype.isTabNavigable=function(){return!0},t.FieldTextInput.prototype.getText_=function(){return this.isBeingEdited_&&this.htmlInput_?this.htmlInput_.value:null},t.FieldTextInput.prototype.getEditorText_=function(t){return String(t)},t.FieldTextInput.prototype.getValueFromEditorText_=function(t){return t},t.fieldRegistry.register("field_input",t.FieldTextInput),t.FieldAngle=function(e,n,r){this.clockwise_=t.FieldAngle.CLOCKWISE,this.offset_=t.FieldAngle.OFFSET,this.wrap_=t.FieldAngle.WRAP,this.round_=t.FieldAngle.ROUND,t.FieldAngle.superClass_.constructor.call(this,e,n,r),this.moveSurfaceWrapper_=this.clickSurfaceWrapper_=this.clickWrapper_=this.line_=this.gauge_=this.editor_=null},t.utils.object.inherits(t.FieldAngle,t.FieldTextInput),t.FieldAngle.prototype.DEFAULT_VALUE=0,t.FieldAngle.fromJson=function(e){return new t.FieldAngle(e.angle,void 0,e)},t.FieldAngle.prototype.SERIALIZABLE=!0,t.FieldAngle.ROUND=15,t.FieldAngle.HALF=50,t.FieldAngle.CLOCKWISE=!1,t.FieldAngle.OFFSET=0,t.FieldAngle.WRAP=360,t.FieldAngle.RADIUS=t.FieldAngle.HALF-1,t.FieldAngle.prototype.configure_=function(e){switch(t.FieldAngle.superClass_.configure_.call(this,e),e.mode){case"compass":this.clockwise_=!0,this.offset_=90;break;case"protractor":this.clockwise_=!1,this.offset_=0}var n=e.clockwise;"boolean"==typeof n&&(this.clockwise_=n),null!=(n=e.offset)&&(n=Number(n),isNaN(n)||(this.offset_=n)),null!=(n=e.wrap)&&(n=Number(n),isNaN(n)||(this.wrap_=n)),null!=(e=e.round)&&(e=Number(e),isNaN(e)||(this.round_=e))},t.FieldAngle.prototype.initView=function(){t.FieldAngle.superClass_.initView.call(this),this.symbol_=t.utils.dom.createSvgElement(t.utils.Svg.TSPAN,{},null),this.symbol_.appendChild(document.createTextNode("°")),this.textElement_.appendChild(this.symbol_)},t.FieldAngle.prototype.render_=function(){t.FieldAngle.superClass_.render_.call(this),this.updateGraph_()},t.FieldAngle.prototype.showEditor_=function(e){t.FieldAngle.superClass_.showEditor_.call(this,e,t.utils.userAgent.MOBILE||t.utils.userAgent.ANDROID||t.utils.userAgent.IPAD),this.dropdownCreate_(),t.DropDownDiv.getContentDiv().appendChild(this.editor_),t.DropDownDiv.setColour(this.sourceBlock_.style.colourPrimary,this.sourceBlock_.style.colourTertiary),t.DropDownDiv.showPositionedByField(this,this.dropdownDispose_.bind(this)),this.updateGraph_()},t.FieldAngle.prototype.dropdownCreate_=function(){var e=t.utils.dom.createSvgElement(t.utils.Svg.SVG,{xmlns:t.utils.dom.SVG_NS,"xmlns:html":t.utils.dom.HTML_NS,"xmlns:xlink":t.utils.dom.XLINK_NS,version:"1.1",height:2*t.FieldAngle.HALF+"px",width:2*t.FieldAngle.HALF+"px",style:"touch-action: none"},null),n=t.utils.dom.createSvgElement(t.utils.Svg.CIRCLE,{cx:t.FieldAngle.HALF,cy:t.FieldAngle.HALF,r:t.FieldAngle.RADIUS,class:"blocklyAngleCircle"},e);this.gauge_=t.utils.dom.createSvgElement(t.utils.Svg.PATH,{class:"blocklyAngleGauge"},e),this.line_=t.utils.dom.createSvgElement(t.utils.Svg.LINE,{x1:t.FieldAngle.HALF,y1:t.FieldAngle.HALF,class:"blocklyAngleLine"},e);for(var r=0;360>r;r+=15)t.utils.dom.createSvgElement(t.utils.Svg.LINE,{x1:t.FieldAngle.HALF+t.FieldAngle.RADIUS,y1:t.FieldAngle.HALF,x2:t.FieldAngle.HALF+t.FieldAngle.RADIUS-(0==r%45?10:5),y2:t.FieldAngle.HALF,class:"blocklyAngleMarks",transform:"rotate("+r+","+t.FieldAngle.HALF+","+t.FieldAngle.HALF+")"},e);this.clickWrapper_=t.browserEvents.conditionalBind(e,"click",this,this.hide_),this.clickSurfaceWrapper_=t.browserEvents.conditionalBind(n,"click",this,this.onMouseMove_,!0,!0),this.moveSurfaceWrapper_=t.browserEvents.conditionalBind(n,"mousemove",this,this.onMouseMove_,!0,!0),this.editor_=e},t.FieldAngle.prototype.dropdownDispose_=function(){this.clickWrapper_&&(t.browserEvents.unbind(this.clickWrapper_),this.clickWrapper_=null),this.clickSurfaceWrapper_&&(t.browserEvents.unbind(this.clickSurfaceWrapper_),this.clickSurfaceWrapper_=null),this.moveSurfaceWrapper_&&(t.browserEvents.unbind(this.moveSurfaceWrapper_),this.moveSurfaceWrapper_=null),this.line_=this.gauge_=null},t.FieldAngle.prototype.hide_=function(){t.DropDownDiv.hideIfOwner(this),t.WidgetDiv.hide()},t.FieldAngle.prototype.onMouseMove_=function(e){var n=this.gauge_.ownerSVGElement.getBoundingClientRect(),r=e.clientX-n.left-t.FieldAngle.HALF;e=e.clientY-n.top-t.FieldAngle.HALF,n=Math.atan(-e/r),isNaN(n)||(n=t.utils.math.toDegrees(n),0>r?n+=180:0<e&&(n+=360),n=this.clockwise_?this.offset_+360-n:360-(this.offset_-n),this.displayMouseOrKeyboardValue_(n))},t.FieldAngle.prototype.displayMouseOrKeyboardValue_=function(t){this.round_&&(t=Math.round(t/this.round_)*this.round_),(t=this.wrapValue_(t))!=this.value_&&this.setEditorValue_(t)},t.FieldAngle.prototype.updateGraph_=function(){if(this.gauge_){var e=Number(this.getText())+this.offset_,n=t.utils.math.toRadians(e%360);e=["M ",t.FieldAngle.HALF,",",t.FieldAngle.HALF];var r=t.FieldAngle.HALF,i=t.FieldAngle.HALF;if(!isNaN(n)){var o=Number(this.clockwise_),s=t.utils.math.toRadians(this.offset_),a=Math.cos(s)*t.FieldAngle.RADIUS,l=Math.sin(s)*-t.FieldAngle.RADIUS;o&&(n=2*s-n),r+=Math.cos(n)*t.FieldAngle.RADIUS,i-=Math.sin(n)*t.FieldAngle.RADIUS,n=Math.abs(Math.floor((n-s)/Math.PI)%2),o&&(n=1-n),e.push(" l ",a,",",l," A ",t.FieldAngle.RADIUS,",",t.FieldAngle.RADIUS," 0 ",n," ",o," ",r,",",i," z")}this.gauge_.setAttribute("d",e.join("")),this.line_.setAttribute("x2",r),this.line_.setAttribute("y2",i)}},t.FieldAngle.prototype.onHtmlInputKeyDown_=function(e){var n;if(t.FieldAngle.superClass_.onHtmlInputKeyDown_.call(this,e),e.keyCode===t.utils.KeyCodes.LEFT?n=this.sourceBlock_.RTL?1:-1:e.keyCode===t.utils.KeyCodes.RIGHT?n=this.sourceBlock_.RTL?-1:1:e.keyCode===t.utils.KeyCodes.DOWN?n=-1:e.keyCode===t.utils.KeyCodes.UP&&(n=1),n){var r=this.getValue();this.displayMouseOrKeyboardValue_(r+n*this.round_),e.preventDefault(),e.stopPropagation()}},t.FieldAngle.prototype.doClassValidation_=function(t){return t=Number(t),isNaN(t)||!isFinite(t)?null:this.wrapValue_(t)},t.FieldAngle.prototype.wrapValue_=function(t){return 0>(t%=360)&&(t+=360),t>this.wrap_&&(t-=360),t},t.Css.register(".blocklyAngleCircle {,stroke: #444;,stroke-width: 1;,fill: #ddd;,fill-opacity: .8;,},.blocklyAngleMarks {,stroke: #444;,stroke-width: 1;,},.blocklyAngleGauge {,fill: #f88;,fill-opacity: .8;,pointer-events: none;,},.blocklyAngleLine {,stroke: #f00;,stroke-width: 2;,stroke-linecap: round;,pointer-events: none;,}".split(",")),t.fieldRegistry.register("field_angle",t.FieldAngle),t.FieldCheckbox=function(e,n,r){this.checkChar_=null,t.FieldCheckbox.superClass_.constructor.call(this,e,n,r)},t.utils.object.inherits(t.FieldCheckbox,t.Field),t.FieldCheckbox.prototype.DEFAULT_VALUE=!1,t.FieldCheckbox.fromJson=function(e){return new t.FieldCheckbox(e.checked,void 0,e)},t.FieldCheckbox.CHECK_CHAR="✓",t.FieldCheckbox.prototype.SERIALIZABLE=!0,t.FieldCheckbox.prototype.CURSOR="default",t.FieldCheckbox.prototype.configure_=function(e){t.FieldCheckbox.superClass_.configure_.call(this,e),e.checkCharacter&&(this.checkChar_=e.checkCharacter)},t.FieldCheckbox.prototype.initView=function(){t.FieldCheckbox.superClass_.initView.call(this),t.utils.dom.addClass(this.textElement_,"blocklyCheckbox"),this.textElement_.style.display=this.value_?"block":"none"},t.FieldCheckbox.prototype.render_=function(){this.textContent_&&(this.textContent_.nodeValue=this.getDisplayText_()),this.updateSize_(this.getConstants().FIELD_CHECKBOX_X_OFFSET)},t.FieldCheckbox.prototype.getDisplayText_=function(){return this.checkChar_||t.FieldCheckbox.CHECK_CHAR},t.FieldCheckbox.prototype.setCheckCharacter=function(t){this.checkChar_=t,this.forceRerender()},t.FieldCheckbox.prototype.showEditor_=function(){this.setValue(!this.value_)},t.FieldCheckbox.prototype.doClassValidation_=function(t){return!0===t||"TRUE"===t?"TRUE":!1===t||"FALSE"===t?"FALSE":null},t.FieldCheckbox.prototype.doValueUpdate_=function(t){this.value_=this.convertValueToBool_(t),this.textElement_&&(this.textElement_.style.display=this.value_?"block":"none")},t.FieldCheckbox.prototype.getValue=function(){return this.value_?"TRUE":"FALSE"},t.FieldCheckbox.prototype.getValueBoolean=function(){return this.value_},t.FieldCheckbox.prototype.getText=function(){return String(this.convertValueToBool_(this.value_))},t.FieldCheckbox.prototype.convertValueToBool_=function(t){return"string"==typeof t?"TRUE"==t:!!t},t.fieldRegistry.register("field_checkbox",t.FieldCheckbox),t.FieldColour=function(e,n,r){t.FieldColour.superClass_.constructor.call(this,e,n,r),this.onKeyDownWrapper_=this.onMouseLeaveWrapper_=this.onMouseEnterWrapper_=this.onMouseMoveWrapper_=this.onClickWrapper_=this.highlightedIndex_=this.picker_=null},t.utils.object.inherits(t.FieldColour,t.Field),t.FieldColour.fromJson=function(e){return new t.FieldColour(e.colour,void 0,e)},t.FieldColour.prototype.SERIALIZABLE=!0,t.FieldColour.prototype.CURSOR="default",t.FieldColour.prototype.isDirty_=!1,t.FieldColour.prototype.colours_=null,t.FieldColour.prototype.titles_=null,t.FieldColour.prototype.columns_=0,t.FieldColour.prototype.configure_=function(e){t.FieldColour.superClass_.configure_.call(this,e),e.colourOptions&&(this.colours_=e.colourOptions,this.titles_=e.colourTitles),e.columns&&(this.columns_=e.columns)},t.FieldColour.prototype.initView=function(){this.size_=new t.utils.Size(this.getConstants().FIELD_COLOUR_DEFAULT_WIDTH,this.getConstants().FIELD_COLOUR_DEFAULT_HEIGHT),this.getConstants().FIELD_COLOUR_FULL_BLOCK?this.clickTarget_=this.sourceBlock_.getSvgRoot():(this.createBorderRect_(),this.borderRect_.style.fillOpacity="1")},t.FieldColour.prototype.applyColour=function(){this.getConstants().FIELD_COLOUR_FULL_BLOCK?(this.sourceBlock_.pathObject.svgPath.setAttribute("fill",this.getValue()),this.sourceBlock_.pathObject.svgPath.setAttribute("stroke","#fff")):this.borderRect_&&(this.borderRect_.style.fill=this.getValue())},t.FieldColour.prototype.doClassValidation_=function(e){return"string"!=typeof e?null:t.utils.colour.parse(e)},t.FieldColour.prototype.doValueUpdate_=function(t){this.value_=t,this.borderRect_?this.borderRect_.style.fill=t:this.sourceBlock_&&this.sourceBlock_.rendered&&(this.sourceBlock_.pathObject.svgPath.setAttribute("fill",t),this.sourceBlock_.pathObject.svgPath.setAttribute("stroke","#fff"))},t.FieldColour.prototype.getText=function(){var t=this.value_;return/^#(.)\1(.)\2(.)\3$/.test(t)&&(t="#"+t[1]+t[3]+t[5]),t},t.FieldColour.COLOURS="#ffffff #cccccc #c0c0c0 #999999 #666666 #333333 #000000 #ffcccc #ff6666 #ff0000 #cc0000 #990000 #660000 #330000 #ffcc99 #ff9966 #ff9900 #ff6600 #cc6600 #993300 #663300 #ffff99 #ffff66 #ffcc66 #ffcc33 #cc9933 #996633 #663333 #ffffcc #ffff33 #ffff00 #ffcc00 #999900 #666600 #333300 #99ff99 #66ff99 #33ff33 #33cc00 #009900 #006600 #003300 #99ffff #33ffff #66cccc #00cccc #339999 #336666 #003333 #ccffff #66ffff #33ccff #3366ff #3333ff #000099 #000066 #ccccff #9999ff #6666cc #6633ff #6600cc #333399 #330099 #ffccff #ff99ff #cc66cc #cc33cc #993399 #663366 #330033".split(" "),t.FieldColour.prototype.DEFAULT_VALUE=t.FieldColour.COLOURS[0],t.FieldColour.TITLES=[],t.FieldColour.COLUMNS=7,t.FieldColour.prototype.setColours=function(t,e){return this.colours_=t,e&&(this.titles_=e),this},t.FieldColour.prototype.setColumns=function(t){return this.columns_=t,this},t.FieldColour.prototype.showEditor_=function(){this.dropdownCreate_(),t.DropDownDiv.getContentDiv().appendChild(this.picker_),t.DropDownDiv.showPositionedByField(this,this.dropdownDispose_.bind(this)),this.picker_.focus({preventScroll:!0})},t.FieldColour.prototype.onClick_=function(e){null!==(e=(e=e.target)&&e.label)&&(this.setValue(e),t.DropDownDiv.hideIfOwner(this))},t.FieldColour.prototype.onKeyDown_=function(e){var n=!1;e.keyCode===t.utils.KeyCodes.UP?(this.moveHighlightBy_(0,-1),n=!0):e.keyCode===t.utils.KeyCodes.DOWN?(this.moveHighlightBy_(0,1),n=!0):e.keyCode===t.utils.KeyCodes.LEFT?(this.moveHighlightBy_(-1,0),n=!0):e.keyCode===t.utils.KeyCodes.RIGHT?(this.moveHighlightBy_(1,0),n=!0):e.keyCode===t.utils.KeyCodes.ENTER&&((n=this.getHighlighted_())&&(null!==(n=n&&n.label)&&this.setValue(n)),t.DropDownDiv.hideWithoutAnimation(),n=!0),n&&e.stopPropagation()},t.FieldColour.prototype.moveHighlightBy_=function(e,n){var r=this.colours_||t.FieldColour.COLOURS,i=this.columns_||t.FieldColour.COLUMNS,o=this.highlightedIndex_%i,s=Math.floor(this.highlightedIndex_/i);o+=e,s+=n,0>e?0>o&&0<s?(o=i-1,s--):0>o&&(o=0):0<e?o>i-1&&s<Math.floor(r.length/i)-1?(o=0,s++):o>i-1&&o--:0>n?0>s&&(s=0):0<n&&s>Math.floor(r.length/i)-1&&(s=Math.floor(r.length/i)-1),this.setHighlightedCell_(this.picker_.childNodes[s].childNodes[o],s*i+o)},t.FieldColour.prototype.onMouseMove_=function(t){var e=(t=t.target)&&Number(t.getAttribute("data-index"));null!==e&&e!==this.highlightedIndex_&&this.setHighlightedCell_(t,e)},t.FieldColour.prototype.onMouseEnter_=function(){this.picker_.focus({preventScroll:!0})},t.FieldColour.prototype.onMouseLeave_=function(){this.picker_.blur();var e=this.getHighlighted_();e&&t.utils.dom.removeClass(e,"blocklyColourHighlighted")},t.FieldColour.prototype.getHighlighted_=function(){var e=this.columns_||t.FieldColour.COLUMNS,n=this.picker_.childNodes[Math.floor(this.highlightedIndex_/e)];return n?n.childNodes[this.highlightedIndex_%e]:null},t.FieldColour.prototype.setHighlightedCell_=function(e,n){var r=this.getHighlighted_();r&&t.utils.dom.removeClass(r,"blocklyColourHighlighted"),t.utils.dom.addClass(e,"blocklyColourHighlighted"),this.highlightedIndex_=n,t.utils.aria.setState(this.picker_,t.utils.aria.State.ACTIVEDESCENDANT,e.getAttribute("id"))},t.FieldColour.prototype.dropdownCreate_=function(){var e=this.columns_||t.FieldColour.COLUMNS,n=this.colours_||t.FieldColour.COLOURS,r=this.titles_||t.FieldColour.TITLES,i=this.getValue(),o=document.createElement("table");o.className="blocklyColourTable",o.tabIndex=0,o.dir="ltr",t.utils.aria.setRole(o,t.utils.aria.Role.GRID),t.utils.aria.setState(o,t.utils.aria.State.EXPANDED,!0),t.utils.aria.setState(o,t.utils.aria.State.ROWCOUNT,Math.floor(n.length/e)),t.utils.aria.setState(o,t.utils.aria.State.COLCOUNT,e);for(var s,a=0;a<n.length;a++){0==a%e&&(s=document.createElement("tr"),t.utils.aria.setRole(s,t.utils.aria.Role.ROW),o.appendChild(s));var l=document.createElement("td");s.appendChild(l),l.label=n[a],l.title=r[a]||n[a],l.id=t.utils.IdGenerator.getNextUniqueId(),l.setAttribute("data-index",a),t.utils.aria.setRole(l,t.utils.aria.Role.GRIDCELL),t.utils.aria.setState(l,t.utils.aria.State.LABEL,n[a]),t.utils.aria.setState(l,t.utils.aria.State.SELECTED,n[a]==i),l.style.backgroundColor=n[a],n[a]==i&&(l.className="blocklyColourSelected",this.highlightedIndex_=a)}this.onClickWrapper_=t.browserEvents.conditionalBind(o,"click",this,this.onClick_,!0),this.onMouseMoveWrapper_=t.browserEvents.conditionalBind(o,"mousemove",this,this.onMouseMove_,!0),this.onMouseEnterWrapper_=t.browserEvents.conditionalBind(o,"mouseenter",this,this.onMouseEnter_,!0),this.onMouseLeaveWrapper_=t.browserEvents.conditionalBind(o,"mouseleave",this,this.onMouseLeave_,!0),this.onKeyDownWrapper_=t.browserEvents.conditionalBind(o,"keydown",this,this.onKeyDown_),this.picker_=o},t.FieldColour.prototype.dropdownDispose_=function(){this.onClickWrapper_&&(t.browserEvents.unbind(this.onClickWrapper_),this.onClickWrapper_=null),this.onMouseMoveWrapper_&&(t.browserEvents.unbind(this.onMouseMoveWrapper_),this.onMouseMoveWrapper_=null),this.onMouseEnterWrapper_&&(t.browserEvents.unbind(this.onMouseEnterWrapper_),this.onMouseEnterWrapper_=null),this.onMouseLeaveWrapper_&&(t.browserEvents.unbind(this.onMouseLeaveWrapper_),this.onMouseLeaveWrapper_=null),this.onKeyDownWrapper_&&(t.browserEvents.unbind(this.onKeyDownWrapper_),this.onKeyDownWrapper_=null),this.highlightedIndex_=this.picker_=null},t.Css.register([".blocklyColourTable {","border-collapse: collapse;","display: block;","outline: none;","padding: 1px;","}",".blocklyColourTable>tr>td {","border: .5px solid #888;","box-sizing: border-box;","cursor: pointer;","display: inline-block;","height: 20px;","padding: 0;","width: 20px;","}",".blocklyColourTable>tr>td.blocklyColourHighlighted {","border-color: #eee;","box-shadow: 2px 2px 7px 2px rgba(0,0,0,.3);","position: relative;","}",".blocklyColourSelected, .blocklyColourSelected:hover {","border-color: #eee !important;","outline: 1px solid #333;","position: relative;","}"]),t.fieldRegistry.register("field_colour",t.FieldColour),t.FieldDropdown=function(e,n,r){"function"!=typeof e&&t.FieldDropdown.validateOptions_(e),this.menuGenerator_=e,this.suffixField=this.prefixField=this.generatedOptions_=null,this.trimOptions_(),this.selectedOption_=this.getOptions(!1)[0],t.FieldDropdown.superClass_.constructor.call(this,this.selectedOption_[1],n,r),this.svgArrow_=this.arrow_=this.imageElement_=this.menu_=this.selectedMenuItem_=null},t.utils.object.inherits(t.FieldDropdown,t.Field),t.FieldDropdown.fromJson=function(e){return new t.FieldDropdown(e.options,void 0,e)},t.FieldDropdown.prototype.fromXml=function(t){this.isOptionListDynamic()&&this.getOptions(!1),this.setValue(t.textContent)},t.FieldDropdown.prototype.SERIALIZABLE=!0,t.FieldDropdown.CHECKMARK_OVERHANG=25,t.FieldDropdown.MAX_MENU_HEIGHT_VH=.45,t.FieldDropdown.IMAGE_Y_OFFSET=5,t.FieldDropdown.IMAGE_Y_PADDING=2*t.FieldDropdown.IMAGE_Y_OFFSET,t.FieldDropdown.ARROW_CHAR=t.utils.userAgent.ANDROID?"▼":"▾",t.FieldDropdown.prototype.CURSOR="default",t.FieldDropdown.prototype.initView=function(){this.shouldAddBorderRect_()?this.createBorderRect_():this.clickTarget_=this.sourceBlock_.getSvgRoot(),this.createTextElement_(),this.imageElement_=t.utils.dom.createSvgElement(t.utils.Svg.IMAGE,{},this.fieldGroup_),this.getConstants().FIELD_DROPDOWN_SVG_ARROW?this.createSVGArrow_():this.createTextArrow_(),this.borderRect_&&t.utils.dom.addClass(this.borderRect_,"blocklyDropdownRect")},t.FieldDropdown.prototype.shouldAddBorderRect_=function(){return!this.getConstants().FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW||this.getConstants().FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW&&!this.sourceBlock_.isShadow()},t.FieldDropdown.prototype.createTextArrow_=function(){this.arrow_=t.utils.dom.createSvgElement(t.utils.Svg.TSPAN,{},this.textElement_),this.arrow_.appendChild(document.createTextNode(this.sourceBlock_.RTL?t.FieldDropdown.ARROW_CHAR+" ":" "+t.FieldDropdown.ARROW_CHAR)),this.sourceBlock_.RTL?this.textElement_.insertBefore(this.arrow_,this.textContent_):this.textElement_.appendChild(this.arrow_)},t.FieldDropdown.prototype.createSVGArrow_=function(){this.svgArrow_=t.utils.dom.createSvgElement(t.utils.Svg.IMAGE,{height:this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE+"px",width:this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE+"px"},this.fieldGroup_),this.svgArrow_.setAttributeNS(t.utils.dom.XLINK_NS,"xlink:href",this.getConstants().FIELD_DROPDOWN_SVG_ARROW_DATAURI)},t.FieldDropdown.prototype.showEditor_=function(e){if(this.dropdownCreate_(),this.menu_.openingCoords=e&&"number"==typeof e.clientX?new t.utils.Coordinate(e.clientX,e.clientY):null,this.menu_.render(t.DropDownDiv.getContentDiv()),e=this.menu_.getElement(),t.utils.dom.addClass(e,"blocklyDropdownMenu"),this.getConstants().FIELD_DROPDOWN_COLOURED_DIV){e=this.sourceBlock_.isShadow()?this.sourceBlock_.getParent().getColour():this.sourceBlock_.getColour();var n=this.sourceBlock_.isShadow()?this.sourceBlock_.getParent().style.colourTertiary:this.sourceBlock_.style.colourTertiary;t.DropDownDiv.setColour(e,n)}t.DropDownDiv.showPositionedByField(this,this.dropdownDispose_.bind(this)),this.menu_.focus(),this.selectedMenuItem_&&this.menu_.setHighlighted(this.selectedMenuItem_),this.applyColour()},t.FieldDropdown.prototype.dropdownCreate_=function(){var e=new t.Menu;e.setRole(t.utils.aria.Role.LISTBOX),this.menu_=e;var n=this.getOptions(!1);this.selectedMenuItem_=null;for(var r=0;r<n.length;r++){var i=n[r][0],o=n[r][1];if("object"==typeof i){var s=new Image(i.width,i.height);s.src=i.src,s.alt=i.alt||"",i=s}(i=new t.MenuItem(i,o)).setRole(t.utils.aria.Role.OPTION),i.setRightToLeft(this.sourceBlock_.RTL),i.setCheckable(!0),e.addChild(i),i.setChecked(o==this.value_),o==this.value_&&(this.selectedMenuItem_=i),i.onAction(this.handleMenuActionEvent_,this)}},t.FieldDropdown.prototype.dropdownDispose_=function(){this.menu_&&this.menu_.dispose(),this.selectedMenuItem_=this.menu_=null,this.applyColour()},t.FieldDropdown.prototype.handleMenuActionEvent_=function(e){t.DropDownDiv.hideIfOwner(this,!0),this.onItemSelected_(this.menu_,e)},t.FieldDropdown.prototype.onItemSelected_=function(t,e){this.setValue(e.getValue())},t.FieldDropdown.prototype.trimOptions_=function(){var e=this.menuGenerator_;if(Array.isArray(e)){for(var n=!1,r=0;r<e.length;r++){var i=e[r][0];"string"==typeof i?e[r][0]=t.utils.replaceMessageReferences(i):(null!=i.alt&&(e[r][0].alt=t.utils.replaceMessageReferences(i.alt)),n=!0)}if(!(n||2>e.length)){for(n=[],r=0;r<e.length;r++)n.push(e[r][0]);r=t.utils.string.shortestStringLength(n),i=t.utils.string.commonWordPrefix(n,r);var o=t.utils.string.commonWordSuffix(n,r);!i&&!o||r<=i+o||(i&&(this.prefixField=n[0].substring(0,i-1)),o&&(this.suffixField=n[0].substr(1-o)),this.menuGenerator_=t.FieldDropdown.applyTrim_(e,i,o))}}},t.FieldDropdown.applyTrim_=function(t,e,n){for(var r=[],i=0;i<t.length;i++){var o=t[i][0],s=t[i][1];o=o.substring(e,o.length-n),r[i]=[o,s]}return r},t.FieldDropdown.prototype.isOptionListDynamic=function(){return"function"==typeof this.menuGenerator_},t.FieldDropdown.prototype.getOptions=function(e){return this.isOptionListDynamic()?(this.generatedOptions_&&e||(this.generatedOptions_=this.menuGenerator_.call(this),t.FieldDropdown.validateOptions_(this.generatedOptions_)),this.generatedOptions_):this.menuGenerator_},t.FieldDropdown.prototype.doClassValidation_=function(t){for(var e,n=!1,r=this.getOptions(!0),i=0;e=r[i];i++)if(e[1]==t){n=!0;break}return n?t:(this.sourceBlock_&&console.warn("Cannot set the dropdown's value to an unavailable option. Block type: "+this.sourceBlock_.type+", Field name: "+this.name+", Value: "+t),null)},t.FieldDropdown.prototype.doValueUpdate_=function(e){t.FieldDropdown.superClass_.doValueUpdate_.call(this,e),e=this.getOptions(!0);for(var n,r=0;n=e[r];r++)n[1]==this.value_&&(this.selectedOption_=n)},t.FieldDropdown.prototype.applyColour=function(){this.borderRect_&&(this.borderRect_.setAttribute("stroke",this.sourceBlock_.style.colourTertiary),this.menu_?this.borderRect_.setAttribute("fill",this.sourceBlock_.style.colourTertiary):this.borderRect_.setAttribute("fill","transparent")),this.sourceBlock_&&this.arrow_&&(this.sourceBlock_.isShadow()?this.arrow_.style.fill=this.sourceBlock_.style.colourSecondary:this.arrow_.style.fill=this.sourceBlock_.style.colourPrimary)},t.FieldDropdown.prototype.render_=function(){this.textContent_.nodeValue="",this.imageElement_.style.display="none";var t=this.selectedOption_&&this.selectedOption_[0];t&&"object"==typeof t?this.renderSelectedImage_(t):this.renderSelectedText_(),this.positionBorderRect_()},t.FieldDropdown.prototype.renderSelectedImage_=function(e){this.imageElement_.style.display="",this.imageElement_.setAttributeNS(t.utils.dom.XLINK_NS,"xlink:href",e.src),this.imageElement_.setAttribute("height",e.height),this.imageElement_.setAttribute("width",e.width);var n=Number(e.height);e=Number(e.width);var r=!!this.borderRect_,i=Math.max(r?this.getConstants().FIELD_DROPDOWN_BORDER_RECT_HEIGHT:0,n+t.FieldDropdown.IMAGE_Y_PADDING);r=r?this.getConstants().FIELD_BORDER_RECT_X_PADDING:0;var o=this.svgArrow_?this.positionSVGArrow_(e+r,i/2-this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE/2):t.utils.dom.getFastTextWidth(this.arrow_,this.getConstants().FIELD_TEXT_FONTSIZE,this.getConstants().FIELD_TEXT_FONTWEIGHT,this.getConstants().FIELD_TEXT_FONTFAMILY);this.size_.width=e+o+2*r,this.size_.height=i;var s=0;this.sourceBlock_.RTL?this.imageElement_.setAttribute("x",r+o):(s=e+o,this.textElement_.setAttribute("text-anchor","end"),this.imageElement_.setAttribute("x",r)),this.imageElement_.setAttribute("y",i/2-n/2),this.positionTextElement_(s+r,e+o)},t.FieldDropdown.prototype.renderSelectedText_=function(){this.textContent_.nodeValue=this.getDisplayText_(),t.utils.dom.addClass(this.textElement_,"blocklyDropdownText"),this.textElement_.setAttribute("text-anchor","start");var e=!!this.borderRect_,n=Math.max(e?this.getConstants().FIELD_DROPDOWN_BORDER_RECT_HEIGHT:0,this.getConstants().FIELD_TEXT_HEIGHT),r=t.utils.dom.getFastTextWidth(this.textElement_,this.getConstants().FIELD_TEXT_FONTSIZE,this.getConstants().FIELD_TEXT_FONTWEIGHT,this.getConstants().FIELD_TEXT_FONTFAMILY);e=e?this.getConstants().FIELD_BORDER_RECT_X_PADDING:0;var i=0;this.svgArrow_&&(i=this.positionSVGArrow_(r+e,n/2-this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE/2)),this.size_.width=r+i+2*e,this.size_.height=n,this.positionTextElement_(e,r)},t.FieldDropdown.prototype.positionSVGArrow_=function(t,e){if(!this.svgArrow_)return 0;var n=this.borderRect_?this.getConstants().FIELD_BORDER_RECT_X_PADDING:0,r=this.getConstants().FIELD_DROPDOWN_SVG_ARROW_PADDING,i=this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE;return this.svgArrow_.setAttribute("transform","translate("+(this.sourceBlock_.RTL?n:t+r)+","+e+")"),i+r},t.FieldDropdown.prototype.getText_=function(){if(!this.selectedOption_)return null;var t=this.selectedOption_[0];return"object"==typeof t?t.alt:t},t.FieldDropdown.validateOptions_=function(t){if(!Array.isArray(t))throw TypeError("FieldDropdown options must be an array.");if(!t.length)throw TypeError("FieldDropdown options must not be an empty array.");for(var e=!1,n=0;n<t.length;++n){var r=t[n];Array.isArray(r)?"string"!=typeof r[1]?(e=!0,console.error("Invalid option["+n+"]: Each FieldDropdown option id must be a string. Found "+r[1]+" in: ",r)):r[0]&&"string"!=typeof r[0]&&"string"!=typeof r[0].src&&(e=!0,console.error("Invalid option["+n+"]: Each FieldDropdown option must have a string label or image description. Found"+r[0]+" in: ",r)):(e=!0,console.error("Invalid option["+n+"]: Each FieldDropdown option must be an array. Found: ",r))}if(e)throw TypeError("Found invalid FieldDropdown options.")},t.fieldRegistry.register("field_dropdown",t.FieldDropdown),t.FieldLabelSerializable=function(e,n,r){t.FieldLabelSerializable.superClass_.constructor.call(this,e,n,r)},t.utils.object.inherits(t.FieldLabelSerializable,t.FieldLabel),t.FieldLabelSerializable.fromJson=function(e){var n=t.utils.replaceMessageReferences(e.text);return new t.FieldLabelSerializable(n,void 0,e)},t.FieldLabelSerializable.prototype.EDITABLE=!1,t.FieldLabelSerializable.prototype.SERIALIZABLE=!0,t.fieldRegistry.register("field_label_serializable",t.FieldLabelSerializable),t.FieldImage=function(e,n,r,i,o,s,a){if(!e)throw Error("Src value of an image field is required");if(e=t.utils.replaceMessageReferences(e),r=Number(t.utils.replaceMessageReferences(r)),n=Number(t.utils.replaceMessageReferences(n)),isNaN(r)||isNaN(n))throw Error("Height and width values of an image field must cast to numbers.");if(0>=r||0>=n)throw Error("Height and width values of an image field must be greater than 0.");this.flipRtl_=!1,this.altText_="",t.FieldImage.superClass_.constructor.call(this,e,null,a),a||(this.flipRtl_=!!s,this.altText_=t.utils.replaceMessageReferences(i)||""),this.size_=new t.utils.Size(n,r+t.FieldImage.Y_PADDING),this.imageHeight_=r,this.clickHandler_=null,"function"==typeof o&&(this.clickHandler_=o),this.imageElement_=null},t.utils.object.inherits(t.FieldImage,t.Field),t.FieldImage.prototype.DEFAULT_VALUE="",t.FieldImage.fromJson=function(e){return new t.FieldImage(e.src,e.width,e.height,void 0,void 0,void 0,e)},t.FieldImage.Y_PADDING=1,t.FieldImage.prototype.EDITABLE=!1,t.FieldImage.prototype.isDirty_=!1,t.FieldImage.prototype.configure_=function(e){t.FieldImage.superClass_.configure_.call(this,e),this.flipRtl_=!!e.flipRtl,this.altText_=t.utils.replaceMessageReferences(e.alt)||""},t.FieldImage.prototype.initView=function(){this.imageElement_=t.utils.dom.createSvgElement(t.utils.Svg.IMAGE,{height:this.imageHeight_+"px",width:this.size_.width+"px",alt:this.altText_},this.fieldGroup_),this.imageElement_.setAttributeNS(t.utils.dom.XLINK_NS,"xlink:href",this.value_),this.clickHandler_&&(this.imageElement_.style.cursor="pointer")},t.FieldImage.prototype.updateSize_=function(){},t.FieldImage.prototype.doClassValidation_=function(t){return"string"!=typeof t?null:t},t.FieldImage.prototype.doValueUpdate_=function(e){this.value_=e,this.imageElement_&&this.imageElement_.setAttributeNS(t.utils.dom.XLINK_NS,"xlink:href",String(this.value_))},t.FieldImage.prototype.getFlipRtl=function(){return this.flipRtl_},t.FieldImage.prototype.setAlt=function(t){t!=this.altText_&&(this.altText_=t||"",this.imageElement_&&this.imageElement_.setAttribute("alt",this.altText_))},t.FieldImage.prototype.showEditor_=function(){this.clickHandler_&&this.clickHandler_(this)},t.FieldImage.prototype.setOnClickHandler=function(t){this.clickHandler_=t},t.FieldImage.prototype.getText_=function(){return this.altText_},t.fieldRegistry.register("field_image",t.FieldImage),t.FieldMultilineInput=function(e,n,r){t.FieldMultilineInput.superClass_.constructor.call(this,e,n,r),this.textGroup_=null,this.maxLines_=1/0,this.isOverflowedY_=!1},t.utils.object.inherits(t.FieldMultilineInput,t.FieldTextInput),t.FieldMultilineInput.prototype.configure_=function(e){t.FieldMultilineInput.superClass_.configure_.call(this,e),e.maxLines&&this.setMaxLines(e.maxLines)},t.FieldMultilineInput.fromJson=function(e){var n=t.utils.replaceMessageReferences(e.text);return new t.FieldMultilineInput(n,void 0,e)},t.FieldMultilineInput.prototype.toXml=function(t){return t.textContent=this.getValue().replace(/\n/g,"&#10;"),t},t.FieldMultilineInput.prototype.fromXml=function(t){this.setValue(t.textContent.replace(/&#10;/g,"\n"))},t.FieldMultilineInput.prototype.initView=function(){this.createBorderRect_(),this.textGroup_=t.utils.dom.createSvgElement(t.utils.Svg.G,{class:"blocklyEditableText"},this.fieldGroup_)},t.FieldMultilineInput.prototype.getDisplayText_=function(){var e=this.getText();if(!e)return t.Field.NBSP;var n=e.split("\n");e="";for(var r=this.isOverflowedY_?this.maxLines_:n.length,i=0;i<r;i++){var o=n[i];o.length>this.maxDisplayLength?o=o.substring(0,this.maxDisplayLength-4)+"...":this.isOverflowedY_&&i===r-1&&(o=o.substring(0,o.length-3)+"..."),e+=o=o.replace(/\s/g,t.Field.NBSP),i!==r-1&&(e+="\n")}return this.sourceBlock_.RTL&&(e+="‏"),e},t.FieldMultilineInput.prototype.doValueUpdate_=function(e){t.FieldMultilineInput.superClass_.doValueUpdate_.call(this,e),this.isOverflowedY_=this.value_.split("\n").length>this.maxLines_},t.FieldMultilineInput.prototype.render_=function(){for(var e;e=this.textGroup_.firstChild;)this.textGroup_.removeChild(e);e=this.getDisplayText_().split("\n");for(var n=0,r=0;r<e.length;r++){var i=this.getConstants().FIELD_TEXT_HEIGHT+this.getConstants().FIELD_BORDER_RECT_Y_PADDING;t.utils.dom.createSvgElement(t.utils.Svg.TEXT,{class:"blocklyText blocklyMultilineText",x:this.getConstants().FIELD_BORDER_RECT_X_PADDING,y:n+this.getConstants().FIELD_BORDER_RECT_Y_PADDING,dy:this.getConstants().FIELD_TEXT_BASELINE},this.textGroup_).appendChild(document.createTextNode(e[r])),n+=i}this.isBeingEdited_&&(e=this.htmlInput_,this.isOverflowedY_?t.utils.dom.addClass(e,"blocklyHtmlTextAreaInputOverflowedY"):t.utils.dom.removeClass(e,"blocklyHtmlTextAreaInputOverflowedY")),this.updateSize_(),this.isBeingEdited_&&(this.sourceBlock_.RTL?setTimeout(this.resizeEditor_.bind(this),0):this.resizeEditor_(),e=this.htmlInput_,this.isTextValid_?(t.utils.dom.removeClass(e,"blocklyInvalidInput"),t.utils.aria.setState(e,t.utils.aria.State.INVALID,!1)):(t.utils.dom.addClass(e,"blocklyInvalidInput"),t.utils.aria.setState(e,t.utils.aria.State.INVALID,!0)))},t.FieldMultilineInput.prototype.updateSize_=function(){for(var e=this.textGroup_.childNodes,n=0,r=0,i=0;i<e.length;i++){var o=t.utils.dom.getTextWidth(e[i]);o>n&&(n=o),r+=this.getConstants().FIELD_TEXT_HEIGHT+(0<i?this.getConstants().FIELD_BORDER_RECT_Y_PADDING:0)}if(this.isBeingEdited_){e=this.value_.split("\n"),o=t.utils.dom.createSvgElement(t.utils.Svg.TEXT,{class:"blocklyText blocklyMultilineText"});var s=this.getConstants().FIELD_TEXT_FONTSIZE,a=this.getConstants().FIELD_TEXT_FONTWEIGHT,l=this.getConstants().FIELD_TEXT_FONTFAMILY;for(i=0;i<e.length;i++){e[i].length>this.maxDisplayLength&&(e[i]=e[i].substring(0,this.maxDisplayLength)),o.textContent=e[i];var u=t.utils.dom.getFastTextWidth(o,s,a,l);u>n&&(n=u)}n+=this.htmlInput_.offsetWidth-this.htmlInput_.clientWidth}this.borderRect_&&(r+=2*this.getConstants().FIELD_BORDER_RECT_Y_PADDING,n+=2*this.getConstants().FIELD_BORDER_RECT_X_PADDING,this.borderRect_.setAttribute("width",n),this.borderRect_.setAttribute("height",r)),this.size_.width=n,this.size_.height=r,this.positionBorderRect_()},t.FieldMultilineInput.prototype.showEditor_=function(e,n){t.FieldMultilineInput.superClass_.showEditor_.call(this,e,n),this.forceRerender()},t.FieldMultilineInput.prototype.widgetCreate_=function(){var e=t.WidgetDiv.DIV,n=this.workspace_.getScale(),r=document.createElement("textarea");r.className="blocklyHtmlInput blocklyHtmlTextAreaInput",r.setAttribute("spellcheck",this.spellcheck_);var i=this.getConstants().FIELD_TEXT_FONTSIZE*n+"pt";e.style.fontSize=i,r.style.fontSize=i,r.style.borderRadius=t.FieldTextInput.BORDERRADIUS*n+"px",i=this.getConstants().FIELD_BORDER_RECT_X_PADDING*n;var o=this.getConstants().FIELD_BORDER_RECT_Y_PADDING*n/2;return r.style.padding=o+"px "+i+"px "+o+"px "+i+"px",i=this.getConstants().FIELD_TEXT_HEIGHT+this.getConstants().FIELD_BORDER_RECT_Y_PADDING,r.style.lineHeight=i*n+"px",e.appendChild(r),r.value=r.defaultValue=this.getEditorText_(this.value_),r.untypedDefaultValue_=this.value_,r.oldValue_=null,t.utils.userAgent.GECKO?setTimeout(this.resizeEditor_.bind(this),0):this.resizeEditor_(),this.bindInputEvents_(r),r},t.FieldMultilineInput.prototype.setMaxLines=function(t){"number"==typeof t&&0<t&&t!==this.maxLines_&&(this.maxLines_=t,this.forceRerender())},t.FieldMultilineInput.prototype.getMaxLines=function(){return this.maxLines_},t.FieldMultilineInput.prototype.onHtmlInputKeyDown_=function(e){e.keyCode!==t.utils.KeyCodes.ENTER&&t.FieldMultilineInput.superClass_.onHtmlInputKeyDown_.call(this,e)},t.Css.register(".blocklyHtmlTextAreaInput {,font-family: monospace;,resize: none;,overflow: hidden;,height: 100%;,text-align: left;,},.blocklyHtmlTextAreaInputOverflowedY {,overflow-y: scroll;,}".split(",")),t.fieldRegistry.register("field_multilinetext",t.FieldMultilineInput),t.FieldNumber=function(e,n,r,i,o,s){this.min_=-1/0,this.max_=1/0,this.precision_=0,this.decimalPlaces_=null,t.FieldNumber.superClass_.constructor.call(this,e,o,s),s||this.setConstraints(n,r,i)},t.utils.object.inherits(t.FieldNumber,t.FieldTextInput),t.FieldNumber.prototype.DEFAULT_VALUE=0,t.FieldNumber.fromJson=function(e){return new t.FieldNumber(e.value,void 0,void 0,void 0,void 0,e)},t.FieldNumber.prototype.SERIALIZABLE=!0,t.FieldNumber.prototype.configure_=function(e){t.FieldNumber.superClass_.configure_.call(this,e),this.setMinInternal_(e.min),this.setMaxInternal_(e.max),this.setPrecisionInternal_(e.precision)},t.FieldNumber.prototype.setConstraints=function(t,e,n){this.setMinInternal_(t),this.setMaxInternal_(e),this.setPrecisionInternal_(n),this.setValue(this.getValue())},t.FieldNumber.prototype.setMin=function(t){this.setMinInternal_(t),this.setValue(this.getValue())},t.FieldNumber.prototype.setMinInternal_=function(t){null==t?this.min_=-1/0:(t=Number(t),isNaN(t)||(this.min_=t))},t.FieldNumber.prototype.getMin=function(){return this.min_},t.FieldNumber.prototype.setMax=function(t){this.setMaxInternal_(t),this.setValue(this.getValue())},t.FieldNumber.prototype.setMaxInternal_=function(t){null==t?this.max_=1/0:(t=Number(t),isNaN(t)||(this.max_=t))},t.FieldNumber.prototype.getMax=function(){return this.max_},t.FieldNumber.prototype.setPrecision=function(t){this.setPrecisionInternal_(t),this.setValue(this.getValue())},t.FieldNumber.prototype.setPrecisionInternal_=function(t){this.precision_=Number(t)||0;var e=String(this.precision_);-1!=e.indexOf("e")&&(e=this.precision_.toLocaleString("en-US",{maximumFractionDigits:20}));var n=e.indexOf(".");this.decimalPlaces_=-1==n?t?0:null:e.length-n-1},t.FieldNumber.prototype.getPrecision=function(){return this.precision_},t.FieldNumber.prototype.doClassValidation_=function(t){return null===t?null:(t=(t=(t=(t=String(t)).replace(/O/gi,"0")).replace(/,/g,"")).replace(/infinity/i,"Infinity"),t=Number(t||0),isNaN(t)?null:(t=Math.min(Math.max(t,this.min_),this.max_),this.precision_&&isFinite(t)&&(t=Math.round(t/this.precision_)*this.precision_),null!=this.decimalPlaces_&&(t=Number(t.toFixed(this.decimalPlaces_))),t))},t.FieldNumber.prototype.widgetCreate_=function(){var e=t.FieldNumber.superClass_.widgetCreate_.call(this);return-1/0<this.min_&&t.utils.aria.setState(e,t.utils.aria.State.VALUEMIN,this.min_),1/0>this.max_&&t.utils.aria.setState(e,t.utils.aria.State.VALUEMAX,this.max_),e},t.fieldRegistry.register("field_number",t.FieldNumber),t.FieldVariable=function(e,n,r,i,o){this.menuGenerator_=t.FieldVariable.dropdownCreate,this.defaultVariableName="string"==typeof e?e:"",this.size_=new t.utils.Size(0,0),o&&this.configure_(o),n&&this.setValidator(n),o||this.setTypes_(r,i)},t.utils.object.inherits(t.FieldVariable,t.FieldDropdown),t.FieldVariable.fromJson=function(e){var n=t.utils.replaceMessageReferences(e.variable);return new t.FieldVariable(n,void 0,void 0,void 0,e)},t.FieldVariable.prototype.SERIALIZABLE=!0,t.FieldVariable.prototype.configure_=function(e){t.FieldVariable.superClass_.configure_.call(this,e),this.setTypes_(e.variableTypes,e.defaultType)},t.FieldVariable.prototype.initModel=function(){if(!this.variable_){var e=t.Variables.getOrCreateVariablePackage(this.sourceBlock_.workspace,null,this.defaultVariableName,this.defaultType_);this.doValueUpdate_(e.getId())}},t.FieldVariable.prototype.shouldAddBorderRect_=function(){return t.FieldVariable.superClass_.shouldAddBorderRect_.call(this)&&(!this.getConstants().FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW||"variables_get"!=this.sourceBlock_.type)},t.FieldVariable.prototype.fromXml=function(e){var n=e.getAttribute("id"),r=e.textContent,i=e.getAttribute("variabletype")||e.getAttribute("variableType")||"";if(n=t.Variables.getOrCreateVariablePackage(this.sourceBlock_.workspace,n,r,i),null!=i&&i!==n.type)throw Error("Serialized variable type with id '"+n.getId()+"' had type "+n.type+", and does not match variable field that references it: "+t.Xml.domToText(e)+".");this.setValue(n.getId())},t.FieldVariable.prototype.toXml=function(t){return this.initModel(),t.id=this.variable_.getId(),t.textContent=this.variable_.name,this.variable_.type&&t.setAttribute("variabletype",this.variable_.type),t},t.FieldVariable.prototype.setSourceBlock=function(e){if(e.isShadow())throw Error("Variable fields are not allowed to exist on shadow blocks.");t.FieldVariable.superClass_.setSourceBlock.call(this,e)},t.FieldVariable.prototype.getValue=function(){return this.variable_?this.variable_.getId():null},t.FieldVariable.prototype.getText=function(){return this.variable_?this.variable_.name:""},t.FieldVariable.prototype.getVariable=function(){return this.variable_},t.FieldVariable.prototype.getValidator=function(){return this.variable_?this.validator_:null},t.FieldVariable.prototype.doClassValidation_=function(e){if(null===e)return null;var n=t.Variables.getVariable(this.sourceBlock_.workspace,e);return n?(n=n.type,this.typeIsAllowed_(n)?e:(console.warn("Variable type doesn't match this field! Type was "+n),null)):(console.warn("Variable id doesn't point to a real variable! ID was "+e),null)},t.FieldVariable.prototype.doValueUpdate_=function(e){this.variable_=t.Variables.getVariable(this.sourceBlock_.workspace,e),t.FieldVariable.superClass_.doValueUpdate_.call(this,e)},t.FieldVariable.prototype.typeIsAllowed_=function(t){var e=this.getVariableTypes_();if(!e)return!0;for(var n=0;n<e.length;n++)if(t==e[n])return!0;return!1},t.FieldVariable.prototype.getVariableTypes_=function(){var t=this.variableTypes;if(null===t&&this.sourceBlock_&&this.sourceBlock_.workspace)return this.sourceBlock_.workspace.getVariableTypes();if(0==(t=t||[""]).length)throw t=this.getText(),Error("'variableTypes' of field variable "+t+" was an empty list");return t},t.FieldVariable.prototype.setTypes_=function(t,e){if(e=e||"",null==t||void 0==t)t=null;else{if(!Array.isArray(t))throw Error("'variableTypes' was not an array in the definition of a FieldVariable");for(var n=!1,r=0;r<t.length;r++)t[r]==e&&(n=!0);if(!n)throw Error("Invalid default type '"+e+"' in the definition of a FieldVariable")}this.defaultType_=e,this.variableTypes=t},t.FieldVariable.prototype.refreshVariableName=function(){this.forceRerender()},t.FieldVariable.dropdownCreate=function(){if(!this.variable_)throw Error("Tried to call dropdownCreate on a variable field with no variable selected.");var e=this.getText(),n=[];if(this.sourceBlock_&&this.sourceBlock_.workspace)for(var r=this.getVariableTypes_(),i=0;i<r.length;i++){var o=this.sourceBlock_.workspace.getVariablesOfType(r[i]);n=n.concat(o)}for(n.sort(t.VariableModel.compareByName),r=[],i=0;i<n.length;i++)r[i]=[n[i].name,n[i].getId()];return r.push([t.Msg.RENAME_VARIABLE,t.RENAME_VARIABLE_ID]),t.Msg.DELETE_VARIABLE&&r.push([t.Msg.DELETE_VARIABLE.replace("%1",e),t.DELETE_VARIABLE_ID]),r},t.FieldVariable.prototype.onItemSelected_=function(e,n){if(e=n.getValue(),this.sourceBlock_&&this.sourceBlock_.workspace){if(e==t.RENAME_VARIABLE_ID)return void t.Variables.renameVariable(this.sourceBlock_.workspace,this.variable_);if(e==t.DELETE_VARIABLE_ID)return void this.sourceBlock_.workspace.deleteVariableById(this.variable_.getId())}this.setValue(e)},t.FieldVariable.prototype.referencesVariables=function(){return!0},t.fieldRegistry.register("field_variable",t.FieldVariable),t.utils.svgPaths={},t.utils.svgPaths.point=function(t,e){return" "+t+","+e+" "},t.utils.svgPaths.curve=function(t,e){return" "+t+e.join("")},t.utils.svgPaths.moveTo=function(t,e){return" M "+t+","+e+" "},t.utils.svgPaths.moveBy=function(t,e){return" m "+t+","+e+" "},t.utils.svgPaths.lineTo=function(t,e){return" l "+t+","+e+" "},t.utils.svgPaths.line=function(t){return" l"+t.join("")},t.utils.svgPaths.lineOnAxis=function(t,e){return" "+t+" "+e+" "},t.utils.svgPaths.arc=function(t,e,n,r){return t+" "+n+" "+n+" "+e+r},t.blockRendering.ConstantProvider=function(){this.NO_PADDING=0,this.SMALL_PADDING=3,this.MEDIUM_PADDING=5,this.MEDIUM_LARGE_PADDING=8,this.LARGE_PADDING=10,this.TALL_INPUT_FIELD_OFFSET_Y=this.MEDIUM_PADDING,this.TAB_HEIGHT=15,this.TAB_OFFSET_FROM_TOP=5,this.TAB_VERTICAL_OVERLAP=2.5,this.TAB_WIDTH=8,this.NOTCH_WIDTH=15,this.NOTCH_HEIGHT=4,this.MIN_BLOCK_WIDTH=12,this.EMPTY_BLOCK_SPACER_HEIGHT=16,this.DUMMY_INPUT_SHADOW_MIN_HEIGHT=this.DUMMY_INPUT_MIN_HEIGHT=this.TAB_HEIGHT,this.CORNER_RADIUS=8,this.STATEMENT_INPUT_NOTCH_OFFSET=this.NOTCH_OFFSET_LEFT=15,this.STATEMENT_BOTTOM_SPACER=0,this.STATEMENT_INPUT_PADDING_LEFT=20,this.BETWEEN_STATEMENT_PADDING_Y=4,this.TOP_ROW_MIN_HEIGHT=this.MEDIUM_PADDING,this.TOP_ROW_PRECEDES_STATEMENT_MIN_HEIGHT=this.LARGE_PADDING,this.BOTTOM_ROW_MIN_HEIGHT=this.MEDIUM_PADDING,this.BOTTOM_ROW_AFTER_STATEMENT_MIN_HEIGHT=this.LARGE_PADDING,this.ADD_START_HATS=!1,this.START_HAT_HEIGHT=15,this.START_HAT_WIDTH=100,this.SPACER_DEFAULT_HEIGHT=15,this.MIN_BLOCK_HEIGHT=24,this.EMPTY_INLINE_INPUT_PADDING=14.5,this.EMPTY_INLINE_INPUT_HEIGHT=this.TAB_HEIGHT+11,this.EXTERNAL_VALUE_INPUT_PADDING=2,this.EMPTY_STATEMENT_INPUT_HEIGHT=this.MIN_BLOCK_HEIGHT,this.START_POINT=t.utils.svgPaths.moveBy(0,0),this.JAGGED_TEETH_HEIGHT=12,this.JAGGED_TEETH_WIDTH=6,this.FIELD_TEXT_FONTSIZE=11,this.FIELD_TEXT_FONTWEIGHT="normal",this.FIELD_TEXT_FONTFAMILY="sans-serif",this.FIELD_TEXT_BASELINE=this.FIELD_TEXT_HEIGHT=-1,this.FIELD_BORDER_RECT_RADIUS=4,this.FIELD_BORDER_RECT_HEIGHT=16,this.FIELD_BORDER_RECT_X_PADDING=5,this.FIELD_BORDER_RECT_Y_PADDING=3,this.FIELD_BORDER_RECT_COLOUR="#fff",this.FIELD_TEXT_BASELINE_CENTER=!t.utils.userAgent.IE&&!t.utils.userAgent.EDGE,this.FIELD_DROPDOWN_BORDER_RECT_HEIGHT=this.FIELD_BORDER_RECT_HEIGHT,this.FIELD_DROPDOWN_SVG_ARROW=this.FIELD_DROPDOWN_COLOURED_DIV=this.FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW=!1,this.FIELD_DROPDOWN_SVG_ARROW_PADDING=this.FIELD_BORDER_RECT_X_PADDING,this.FIELD_DROPDOWN_SVG_ARROW_SIZE=12,this.FIELD_DROPDOWN_SVG_ARROW_DATAURI="data:image/svg+xml;base64,PHN2ZyBpZD0iTGF5ZXJfMSIgZGF0YS1uYW1lPSJMYXllciAxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMi43MSIgaGVpZ2h0PSI4Ljc5IiB2aWV3Qm94PSIwIDAgMTIuNzEgOC43OSI+PHRpdGxlPmRyb3Bkb3duLWFycm93PC90aXRsZT48ZyBvcGFjaXR5PSIwLjEiPjxwYXRoIGQ9Ik0xMi43MSwyLjQ0QTIuNDEsMi40MSwwLDAsMSwxMiw0LjE2TDguMDgsOC4wOGEyLjQ1LDIuNDUsMCwwLDEtMy40NSwwTDAuNzIsNC4xNkEyLjQyLDIuNDIsMCwwLDEsMCwyLjQ0LDIuNDgsMi40OCwwLDAsMSwuNzEuNzFDMSwwLjQ3LDEuNDMsMCw2LjM2LDBTMTEuNzUsMC40NiwxMiwuNzFBMi40NCwyLjQ0LDAsMCwxLDEyLjcxLDIuNDRaIiBmaWxsPSIjMjMxZjIwIi8+PC9nPjxwYXRoIGQ9Ik02LjM2LDcuNzlhMS40MywxLjQzLDAsMCwxLTEtLjQyTDEuNDIsMy40NWExLjQ0LDEuNDQsMCwwLDEsMC0yYzAuNTYtLjU2LDkuMzEtMC41Niw5Ljg3LDBhMS40NCwxLjQ0LDAsMCwxLDAsMkw3LjM3LDcuMzdBMS40MywxLjQzLDAsMCwxLDYuMzYsNy43OVoiIGZpbGw9IiNmZmYiLz48L3N2Zz4=",this.FIELD_COLOUR_FULL_BLOCK=this.FIELD_TEXTINPUT_BOX_SHADOW=!1,this.FIELD_COLOUR_DEFAULT_WIDTH=26,this.FIELD_COLOUR_DEFAULT_HEIGHT=this.FIELD_BORDER_RECT_HEIGHT,this.FIELD_CHECKBOX_X_OFFSET=this.FIELD_BORDER_RECT_X_PADDING-3,this.randomIdentifier=String(Math.random()).substring(2),this.embossFilterId="",this.embossFilter_=null,this.disabledPatternId="",this.disabledPattern_=null,this.debugFilterId="",this.cssNode_=this.debugFilter_=null,this.CURSOR_COLOUR="#cc0a0a",this.MARKER_COLOUR="#4286f4",this.CURSOR_WS_WIDTH=100,this.WS_CURSOR_HEIGHT=5,this.CURSOR_STACK_PADDING=10,this.CURSOR_BLOCK_PADDING=2,this.CURSOR_STROKE_WIDTH=4,this.FULL_BLOCK_FIELDS=!1,this.INSERTION_MARKER_COLOUR="#000000",this.INSERTION_MARKER_OPACITY=.2,this.SHAPES={PUZZLE:1,NOTCH:2}},t.blockRendering.ConstantProvider.prototype.init=function(){this.JAGGED_TEETH=this.makeJaggedTeeth(),this.NOTCH=this.makeNotch(),this.START_HAT=this.makeStartHat(),this.PUZZLE_TAB=this.makePuzzleTab(),this.INSIDE_CORNERS=this.makeInsideCorners(),this.OUTSIDE_CORNERS=this.makeOutsideCorners()},t.blockRendering.ConstantProvider.prototype.setTheme=function(t){this.blockStyles=Object.create(null);var e,n=t.blockStyles;for(e in n)this.blockStyles[e]=this.validatedBlockStyle_(n[e]);this.setDynamicProperties_(t)},t.blockRendering.ConstantProvider.prototype.setDynamicProperties_=function(t){this.setFontConstants_(t),this.setComponentConstants_(t),this.ADD_START_HATS=null!=t.startHats?t.startHats:this.ADD_START_HATS},t.blockRendering.ConstantProvider.prototype.setFontConstants_=function(e){this.FIELD_TEXT_FONTFAMILY=e.fontStyle&&void 0!=e.fontStyle.family?e.fontStyle.family:this.FIELD_TEXT_FONTFAMILY,this.FIELD_TEXT_FONTWEIGHT=e.fontStyle&&void 0!=e.fontStyle.weight?e.fontStyle.weight:this.FIELD_TEXT_FONTWEIGHT,this.FIELD_TEXT_FONTSIZE=e.fontStyle&&void 0!=e.fontStyle.size?e.fontStyle.size:this.FIELD_TEXT_FONTSIZE,e=t.utils.dom.measureFontMetrics("Hg",this.FIELD_TEXT_FONTSIZE+"pt",this.FIELD_TEXT_FONTWEIGHT,this.FIELD_TEXT_FONTFAMILY),this.FIELD_TEXT_HEIGHT=e.height,this.FIELD_TEXT_BASELINE=e.baseline},t.blockRendering.ConstantProvider.prototype.setComponentConstants_=function(t){this.CURSOR_COLOUR=t.getComponentStyle("cursorColour")||this.CURSOR_COLOUR,this.MARKER_COLOUR=t.getComponentStyle("markerColour")||this.MARKER_COLOUR,this.INSERTION_MARKER_COLOUR=t.getComponentStyle("insertionMarkerColour")||this.INSERTION_MARKER_COLOUR,this.INSERTION_MARKER_OPACITY=Number(t.getComponentStyle("insertionMarkerOpacity"))||this.INSERTION_MARKER_OPACITY},t.blockRendering.ConstantProvider.prototype.getBlockStyleForColour=function(t){var e="auto_"+t;return this.blockStyles[e]||(this.blockStyles[e]=this.createBlockStyle_(t)),{style:this.blockStyles[e],name:e}},t.blockRendering.ConstantProvider.prototype.getBlockStyle=function(t){return this.blockStyles[t||""]||(t&&0==t.indexOf("auto_")?this.getBlockStyleForColour(t.substring(5)).style:this.createBlockStyle_("#000000"))},t.blockRendering.ConstantProvider.prototype.createBlockStyle_=function(t){return this.validatedBlockStyle_({colourPrimary:t})},t.blockRendering.ConstantProvider.prototype.validatedBlockStyle_=function(e){var n={};return e&&t.utils.object.mixin(n,e),e=t.utils.parseBlockColour(n.colourPrimary||"#000"),n.colourPrimary=e.hex,n.colourSecondary=n.colourSecondary?t.utils.parseBlockColour(n.colourSecondary).hex:this.generateSecondaryColour_(n.colourPrimary),n.colourTertiary=n.colourTertiary?t.utils.parseBlockColour(n.colourTertiary).hex:this.generateTertiaryColour_(n.colourPrimary),n.hat=n.hat||"",n},t.blockRendering.ConstantProvider.prototype.generateSecondaryColour_=function(e){return t.utils.colour.blend("#fff",e,.6)||e},t.blockRendering.ConstantProvider.prototype.generateTertiaryColour_=function(e){return t.utils.colour.blend("#fff",e,.3)||e},t.blockRendering.ConstantProvider.prototype.dispose=function(){this.embossFilter_&&t.utils.dom.removeNode(this.embossFilter_),this.disabledPattern_&&t.utils.dom.removeNode(this.disabledPattern_),this.debugFilter_&&t.utils.dom.removeNode(this.debugFilter_),this.cssNode_=null},t.blockRendering.ConstantProvider.prototype.makeJaggedTeeth=function(){var e=this.JAGGED_TEETH_HEIGHT,n=this.JAGGED_TEETH_WIDTH;return{height:e,width:n,path:t.utils.svgPaths.line([t.utils.svgPaths.point(n,e/4),t.utils.svgPaths.point(2*-n,e/2),t.utils.svgPaths.point(n,e/4)])}},t.blockRendering.ConstantProvider.prototype.makeStartHat=function(){var e=this.START_HAT_HEIGHT,n=this.START_HAT_WIDTH;return{height:e,width:n,path:t.utils.svgPaths.curve("c",[t.utils.svgPaths.point(30,-e),t.utils.svgPaths.point(70,-e),t.utils.svgPaths.point(n,0)])}},t.blockRendering.ConstantProvider.prototype.makePuzzleTab=function(){function e(e){var i=-(e=e?-1:1),o=r/2,s=o+2.5,a=o+.5,l=t.utils.svgPaths.point(-n,e*o);return o=t.utils.svgPaths.point(n,e*o),t.utils.svgPaths.curve("c",[t.utils.svgPaths.point(0,e*s),t.utils.svgPaths.point(-n,i*a),l])+t.utils.svgPaths.curve("s",[t.utils.svgPaths.point(n,2.5*i),o])}var n=this.TAB_WIDTH,r=this.TAB_HEIGHT,i=e(!0),o=e(!1);return{type:this.SHAPES.PUZZLE,width:n,height:r,pathDown:o,pathUp:i}},t.blockRendering.ConstantProvider.prototype.makeNotch=function(){function e(e){return t.utils.svgPaths.line([t.utils.svgPaths.point(e*i,r),t.utils.svgPaths.point(3*e,0),t.utils.svgPaths.point(e*i,-r)])}var n=this.NOTCH_WIDTH,r=this.NOTCH_HEIGHT,i=(n-3)/2,o=e(1),s=e(-1);return{type:this.SHAPES.NOTCH,width:n,height:r,pathLeft:o,pathRight:s}},t.blockRendering.ConstantProvider.prototype.makeInsideCorners=function(){var e=this.CORNER_RADIUS;return{width:e,height:e,pathTop:t.utils.svgPaths.arc("a","0 0,0",e,t.utils.svgPaths.point(-e,e)),pathBottom:t.utils.svgPaths.arc("a","0 0,0",e,t.utils.svgPaths.point(e,e))}},t.blockRendering.ConstantProvider.prototype.makeOutsideCorners=function(){var e=this.CORNER_RADIUS,n=t.utils.svgPaths.moveBy(0,e)+t.utils.svgPaths.arc("a","0 0,1",e,t.utils.svgPaths.point(e,-e)),r=t.utils.svgPaths.arc("a","0 0,1",e,t.utils.svgPaths.point(e,e)),i=t.utils.svgPaths.arc("a","0 0,1",e,t.utils.svgPaths.point(-e,-e));return{topLeft:n,topRight:r,bottomRight:t.utils.svgPaths.arc("a","0 0,1",e,t.utils.svgPaths.point(-e,e)),bottomLeft:i,rightHeight:e}},t.blockRendering.ConstantProvider.prototype.shapeFor=function(e){switch(e.type){case t.connectionTypes.INPUT_VALUE:case t.connectionTypes.OUTPUT_VALUE:return this.PUZZLE_TAB;case t.connectionTypes.PREVIOUS_STATEMENT:case t.connectionTypes.NEXT_STATEMENT:return this.NOTCH;default:throw Error("Unknown connection type")}},t.blockRendering.ConstantProvider.prototype.createDom=function(e,n,r){this.injectCSS_(n,r),e=t.utils.dom.createSvgElement(t.utils.Svg.DEFS,{},e),n=t.utils.dom.createSvgElement(t.utils.Svg.FILTER,{id:"blocklyEmbossFilter"+this.randomIdentifier},e),t.utils.dom.createSvgElement(t.utils.Svg.FEGAUSSIANBLUR,{in:"SourceAlpha",stdDeviation:1,result:"blur"},n),r=t.utils.dom.createSvgElement(t.utils.Svg.FESPECULARLIGHTING,{in:"blur",surfaceScale:1,specularConstant:.5,specularExponent:10,"lighting-color":"white",result:"specOut"},n),t.utils.dom.createSvgElement(t.utils.Svg.FEPOINTLIGHT,{x:-5e3,y:-1e4,z:2e4},r),t.utils.dom.createSvgElement(t.utils.Svg.FECOMPOSITE,{in:"specOut",in2:"SourceAlpha",operator:"in",result:"specOut"},n),t.utils.dom.createSvgElement(t.utils.Svg.FECOMPOSITE,{in:"SourceGraphic",in2:"specOut",operator:"arithmetic",k1:0,k2:1,k3:1,k4:0},n),this.embossFilterId=n.id,this.embossFilter_=n,n=t.utils.dom.createSvgElement(t.utils.Svg.PATTERN,{id:"blocklyDisabledPattern"+this.randomIdentifier,patternUnits:"userSpaceOnUse",width:10,height:10},e),t.utils.dom.createSvgElement(t.utils.Svg.RECT,{width:10,height:10,fill:"#aaa"},n),t.utils.dom.createSvgElement(t.utils.Svg.PATH,{d:"M 0 0 L 10 10 M 10 0 L 0 10",stroke:"#cc0"},n),this.disabledPatternId=n.id,this.disabledPattern_=n,t.blockRendering.Debug&&(e=t.utils.dom.createSvgElement(t.utils.Svg.FILTER,{id:"blocklyDebugFilter"+this.randomIdentifier,height:"160%",width:"180%",y:"-30%",x:"-40%"},e),n=t.utils.dom.createSvgElement(t.utils.Svg.FECOMPONENTTRANSFER,{result:"outBlur"},e),t.utils.dom.createSvgElement(t.utils.Svg.FEFUNCA,{type:"table",tableValues:"0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1"},n),t.utils.dom.createSvgElement(t.utils.Svg.FEFLOOD,{"flood-color":"#ff0000","flood-opacity":.5,result:"outColor"},e),t.utils.dom.createSvgElement(t.utils.Svg.FECOMPOSITE,{in:"outColor",in2:"outBlur",operator:"in",result:"outGlow"},e),this.debugFilterId=e.id,this.debugFilter_=e)},t.blockRendering.ConstantProvider.prototype.injectCSS_=function(t,e){e=this.getCSS_(e),t="blockly-renderer-style-"+t,this.cssNode_=document.getElementById(t);var n=e.join("\n");this.cssNode_?this.cssNode_.firstChild.textContent=n:((e=document.createElement("style")).id=t,t=document.createTextNode(n),e.appendChild(t),document.head.insertBefore(e,document.head.firstChild),this.cssNode_=e)},t.blockRendering.ConstantProvider.prototype.getCSS_=function(t){return[t+" .blocklyText, ",t+" .blocklyFlyoutLabelText {","font: "+this.FIELD_TEXT_FONTWEIGHT+" "+this.FIELD_TEXT_FONTSIZE+"pt "+this.FIELD_TEXT_FONTFAMILY+";","}",t+" .blocklyText {","fill: #fff;","}",t+" .blocklyNonEditableText>rect,",t+" .blocklyEditableText>rect {","fill: "+this.FIELD_BORDER_RECT_COLOUR+";","fill-opacity: .6;","stroke: none;","}",t+" .blocklyNonEditableText>text,",t+" .blocklyEditableText>text {","fill: #000;","}",t+" .blocklyFlyoutLabelText {","fill: #000;","}",t+" .blocklyText.blocklyBubbleText {","fill: #000;","}",t+" .blocklyEditableText:not(.editing):hover>rect {","stroke: #fff;","stroke-width: 2;","}",t+" .blocklyHtmlInput {","font-family: "+this.FIELD_TEXT_FONTFAMILY+";","font-weight: "+this.FIELD_TEXT_FONTWEIGHT+";","}",t+" .blocklySelected>.blocklyPath {","stroke: #fc3;","stroke-width: 3px;","}",t+" .blocklyHighlightedConnectionPath {","stroke: #fc3;","}",t+" .blocklyReplaceable .blocklyPath {","fill-opacity: .5;","}",t+" .blocklyReplaceable .blocklyPathLight,",t+" .blocklyReplaceable .blocklyPathDark {","display: none;","}",t+" .blocklyInsertionMarker>.blocklyPath {","fill-opacity: "+this.INSERTION_MARKER_OPACITY+";","stroke: none;","}"]},t.blockRendering.Types={NONE:0,FIELD:1,HAT:2,ICON:4,SPACER:8,BETWEEN_ROW_SPACER:16,IN_ROW_SPACER:32,EXTERNAL_VALUE_INPUT:64,INPUT:128,INLINE_INPUT:256,STATEMENT_INPUT:512,CONNECTION:1024,PREVIOUS_CONNECTION:2048,NEXT_CONNECTION:4096,OUTPUT_CONNECTION:8192,CORNER:16384,LEFT_SQUARE_CORNER:32768,LEFT_ROUND_CORNER:65536,RIGHT_SQUARE_CORNER:131072,RIGHT_ROUND_CORNER:262144,JAGGED_EDGE:524288,ROW:1048576,TOP_ROW:2097152,BOTTOM_ROW:4194304,INPUT_ROW:8388608},t.blockRendering.Types.LEFT_CORNER=t.blockRendering.Types.LEFT_SQUARE_CORNER|t.blockRendering.Types.LEFT_ROUND_CORNER,t.blockRendering.Types.RIGHT_CORNER=t.blockRendering.Types.RIGHT_SQUARE_CORNER|t.blockRendering.Types.RIGHT_ROUND_CORNER,t.blockRendering.Types.nextTypeValue_=16777216,t.blockRendering.Types.getType=function(e){return Object.prototype.hasOwnProperty.call(t.blockRendering.Types,e)||(t.blockRendering.Types[e]=t.blockRendering.Types.nextTypeValue_,t.blockRendering.Types.nextTypeValue_<<=1),t.blockRendering.Types[e]},t.blockRendering.Types.isField=function(e){return e.type&t.blockRendering.Types.FIELD},t.blockRendering.Types.isHat=function(e){return e.type&t.blockRendering.Types.HAT},t.blockRendering.Types.isIcon=function(e){return e.type&t.blockRendering.Types.ICON},t.blockRendering.Types.isSpacer=function(e){return e.type&t.blockRendering.Types.SPACER},t.blockRendering.Types.isInRowSpacer=function(e){return e.type&t.blockRendering.Types.IN_ROW_SPACER},t.blockRendering.Types.isInput=function(e){return e.type&t.blockRendering.Types.INPUT},t.blockRendering.Types.isExternalInput=function(e){return e.type&t.blockRendering.Types.EXTERNAL_VALUE_INPUT},t.blockRendering.Types.isInlineInput=function(e){return e.type&t.blockRendering.Types.INLINE_INPUT},t.blockRendering.Types.isStatementInput=function(e){return e.type&t.blockRendering.Types.STATEMENT_INPUT},t.blockRendering.Types.isPreviousConnection=function(e){return e.type&t.blockRendering.Types.PREVIOUS_CONNECTION},t.blockRendering.Types.isNextConnection=function(e){return e.type&t.blockRendering.Types.NEXT_CONNECTION},t.blockRendering.Types.isPreviousOrNextConnection=function(e){return e.type&(t.blockRendering.Types.PREVIOUS_CONNECTION|t.blockRendering.Types.NEXT_CONNECTION)},t.blockRendering.Types.isLeftRoundedCorner=function(e){return e.type&t.blockRendering.Types.LEFT_ROUND_CORNER},t.blockRendering.Types.isRightRoundedCorner=function(e){return e.type&t.blockRendering.Types.RIGHT_ROUND_CORNER},t.blockRendering.Types.isLeftSquareCorner=function(e){return e.type&t.blockRendering.Types.LEFT_SQUARE_CORNER},t.blockRendering.Types.isRightSquareCorner=function(e){return e.type&t.blockRendering.Types.RIGHT_SQUARE_CORNER},t.blockRendering.Types.isCorner=function(e){return e.type&t.blockRendering.Types.CORNER},t.blockRendering.Types.isJaggedEdge=function(e){return e.type&t.blockRendering.Types.JAGGED_EDGE},t.blockRendering.Types.isRow=function(e){return e.type&t.blockRendering.Types.ROW},t.blockRendering.Types.isBetweenRowSpacer=function(e){return e.type&t.blockRendering.Types.BETWEEN_ROW_SPACER},t.blockRendering.Types.isTopRow=function(e){return e.type&t.blockRendering.Types.TOP_ROW},t.blockRendering.Types.isBottomRow=function(e){return e.type&t.blockRendering.Types.BOTTOM_ROW},t.blockRendering.Types.isTopOrBottomRow=function(e){return e.type&(t.blockRendering.Types.TOP_ROW|t.blockRendering.Types.BOTTOM_ROW)},t.blockRendering.Types.isInputRow=function(e){return e.type&t.blockRendering.Types.INPUT_ROW},t.blockRendering.Measurable=function(e){this.height=this.width=0,this.type=t.blockRendering.Types.NONE,this.centerline=this.xPos=0,this.constants_=e,this.notchOffset=this.constants_.NOTCH_OFFSET_LEFT},t.blockRendering.Connection=function(e,n){t.blockRendering.Connection.superClass_.constructor.call(this,e),this.connectionModel=n,this.shape=this.constants_.shapeFor(n),this.isDynamicShape=!!this.shape.isDynamic,this.type|=t.blockRendering.Types.CONNECTION},t.utils.object.inherits(t.blockRendering.Connection,t.blockRendering.Measurable),t.blockRendering.OutputConnection=function(e,n){t.blockRendering.OutputConnection.superClass_.constructor.call(this,e,n),this.type|=t.blockRendering.Types.OUTPUT_CONNECTION,this.height=this.isDynamicShape?0:this.shape.height,this.startX=this.width=this.isDynamicShape?0:this.shape.width,this.connectionOffsetY=this.constants_.TAB_OFFSET_FROM_TOP,this.connectionOffsetX=0},t.utils.object.inherits(t.blockRendering.OutputConnection,t.blockRendering.Connection),t.blockRendering.PreviousConnection=function(e,n){t.blockRendering.PreviousConnection.superClass_.constructor.call(this,e,n),this.type|=t.blockRendering.Types.PREVIOUS_CONNECTION,this.height=this.shape.height,this.width=this.shape.width},t.utils.object.inherits(t.blockRendering.PreviousConnection,t.blockRendering.Connection),t.blockRendering.NextConnection=function(e,n){t.blockRendering.NextConnection.superClass_.constructor.call(this,e,n),this.type|=t.blockRendering.Types.NEXT_CONNECTION,this.height=this.shape.height,this.width=this.shape.width},t.utils.object.inherits(t.blockRendering.NextConnection,t.blockRendering.Connection),t.blockRendering.InputConnection=function(e,n){t.blockRendering.InputConnection.superClass_.constructor.call(this,e,n.connection),this.type|=t.blockRendering.Types.INPUT,this.input=n,this.align=n.align,(this.connectedBlock=n.connection&&n.connection.targetBlock()?n.connection.targetBlock():null)?(e=this.connectedBlock.getHeightWidth(),this.connectedBlockWidth=e.width,this.connectedBlockHeight=e.height):this.connectedBlockHeight=this.connectedBlockWidth=0,this.connectionOffsetY=this.connectionOffsetX=0},t.utils.object.inherits(t.blockRendering.InputConnection,t.blockRendering.Connection),t.blockRendering.InlineInput=function(e,n){t.blockRendering.InlineInput.superClass_.constructor.call(this,e,n),this.type|=t.blockRendering.Types.INLINE_INPUT,this.connectedBlock?(this.width=this.connectedBlockWidth,this.height=this.connectedBlockHeight):(this.height=this.constants_.EMPTY_INLINE_INPUT_HEIGHT,this.width=this.constants_.EMPTY_INLINE_INPUT_PADDING),this.connectionHeight=this.isDynamicShape?this.shape.height(this.height):this.shape.height,this.connectionWidth=this.isDynamicShape?this.shape.width(this.height):this.shape.width,this.connectedBlock||(this.width+=this.connectionWidth*(this.isDynamicShape?2:1)),this.connectionOffsetY=this.isDynamicShape?this.shape.connectionOffsetY(this.connectionHeight):this.constants_.TAB_OFFSET_FROM_TOP,this.connectionOffsetX=this.isDynamicShape?this.shape.connectionOffsetX(this.connectionWidth):0},t.utils.object.inherits(t.blockRendering.InlineInput,t.blockRendering.InputConnection),t.blockRendering.StatementInput=function(e,n){t.blockRendering.StatementInput.superClass_.constructor.call(this,e,n),this.type|=t.blockRendering.Types.STATEMENT_INPUT,this.height=this.connectedBlock?this.connectedBlockHeight+this.constants_.STATEMENT_BOTTOM_SPACER:this.constants_.EMPTY_STATEMENT_INPUT_HEIGHT,this.width=this.constants_.STATEMENT_INPUT_NOTCH_OFFSET+this.shape.width},t.utils.object.inherits(t.blockRendering.StatementInput,t.blockRendering.InputConnection),t.blockRendering.ExternalValueInput=function(e,n){t.blockRendering.ExternalValueInput.superClass_.constructor.call(this,e,n),this.type|=t.blockRendering.Types.EXTERNAL_VALUE_INPUT,this.height=this.connectedBlock?this.connectedBlockHeight-this.constants_.TAB_OFFSET_FROM_TOP-this.constants_.MEDIUM_PADDING:this.shape.height,this.width=this.shape.width+this.constants_.EXTERNAL_VALUE_INPUT_PADDING,this.connectionOffsetY=this.constants_.TAB_OFFSET_FROM_TOP,this.connectionHeight=this.shape.height,this.connectionWidth=this.shape.width},t.utils.object.inherits(t.blockRendering.ExternalValueInput,t.blockRendering.InputConnection),t.blockRendering.Icon=function(e,n){t.blockRendering.Icon.superClass_.constructor.call(this,e),this.icon=n,this.isVisible=n.isVisible(),this.type|=t.blockRendering.Types.ICON,e=n.getCorrectedSize(),this.height=e.height,this.width=e.width},t.utils.object.inherits(t.blockRendering.Icon,t.blockRendering.Measurable),t.blockRendering.JaggedEdge=function(e){t.blockRendering.JaggedEdge.superClass_.constructor.call(this,e),this.type|=t.blockRendering.Types.JAGGED_EDGE,this.height=this.constants_.JAGGED_TEETH.height,this.width=this.constants_.JAGGED_TEETH.width},t.utils.object.inherits(t.blockRendering.JaggedEdge,t.blockRendering.Measurable),t.blockRendering.Field=function(e,n,r){t.blockRendering.Field.superClass_.constructor.call(this,e),this.field=n,this.isEditable=n.EDITABLE,this.flipRtl=n.getFlipRtl(),this.type|=t.blockRendering.Types.FIELD,e=this.field.getSize(),this.height=e.height,this.width=e.width,this.parentInput=r},t.utils.object.inherits(t.blockRendering.Field,t.blockRendering.Measurable),t.blockRendering.Hat=function(e){t.blockRendering.Hat.superClass_.constructor.call(this,e),this.type|=t.blockRendering.Types.HAT,this.height=this.constants_.START_HAT.height,this.width=this.constants_.START_HAT.width,this.ascenderHeight=this.height},t.utils.object.inherits(t.blockRendering.Hat,t.blockRendering.Measurable),t.blockRendering.SquareCorner=function(e,n){t.blockRendering.SquareCorner.superClass_.constructor.call(this,e),this.type=(n&&"left"!=n?t.blockRendering.Types.RIGHT_SQUARE_CORNER:t.blockRendering.Types.LEFT_SQUARE_CORNER)|t.blockRendering.Types.CORNER,this.width=this.height=this.constants_.NO_PADDING},t.utils.object.inherits(t.blockRendering.SquareCorner,t.blockRendering.Measurable),t.blockRendering.RoundCorner=function(e,n){t.blockRendering.RoundCorner.superClass_.constructor.call(this,e),this.type=(n&&"left"!=n?t.blockRendering.Types.RIGHT_ROUND_CORNER:t.blockRendering.Types.LEFT_ROUND_CORNER)|t.blockRendering.Types.CORNER,this.width=this.constants_.CORNER_RADIUS,this.height=this.constants_.CORNER_RADIUS/2},t.utils.object.inherits(t.blockRendering.RoundCorner,t.blockRendering.Measurable),t.blockRendering.InRowSpacer=function(e,n){t.blockRendering.InRowSpacer.superClass_.constructor.call(this,e),this.type=this.type|t.blockRendering.Types.SPACER|t.blockRendering.Types.IN_ROW_SPACER,this.width=n,this.height=this.constants_.SPACER_DEFAULT_HEIGHT},t.utils.object.inherits(t.blockRendering.InRowSpacer,t.blockRendering.Measurable),t.blockRendering.Row=function(e){this.type=t.blockRendering.Types.ROW,this.elements=[],this.xPos=this.yPos=this.widthWithConnectedBlocks=this.minWidth=this.minHeight=this.width=this.height=0,this.hasJaggedEdge=this.hasDummyInput=this.hasInlineInput=this.hasStatement=this.hasExternalInput=!1,this.constants_=e,this.notchOffset=this.constants_.NOTCH_OFFSET_LEFT,this.align=null},t.blockRendering.Row.prototype.measure=function(){throw Error("Unexpected attempt to measure a base Row.")},t.blockRendering.Row.prototype.getLastInput=function(){for(var e,n=this.elements.length-1;e=this.elements[n];n--)if(t.blockRendering.Types.isInput(e))return e;return null},t.blockRendering.Row.prototype.startsWithElemSpacer=function(){return!0},t.blockRendering.Row.prototype.endsWithElemSpacer=function(){return!0},t.blockRendering.Row.prototype.getFirstSpacer=function(){for(var e,n=0;e=this.elements[n];n++)if(t.blockRendering.Types.isSpacer(e))return e;return null},t.blockRendering.Row.prototype.getLastSpacer=function(){for(var e,n=this.elements.length-1;e=this.elements[n];n--)if(t.blockRendering.Types.isSpacer(e))return e;return null},t.blockRendering.TopRow=function(e){t.blockRendering.TopRow.superClass_.constructor.call(this,e),this.type|=t.blockRendering.Types.TOP_ROW,this.ascenderHeight=this.capline=0,this.hasPreviousConnection=!1,this.connection=null},t.utils.object.inherits(t.blockRendering.TopRow,t.blockRendering.Row),t.blockRendering.TopRow.prototype.hasLeftSquareCorner=function(t){var e=(t.hat?"cap"===t.hat:this.constants_.ADD_START_HATS)&&!t.outputConnection&&!t.previousConnection,n=t.getPreviousBlock();return!!t.outputConnection||e||!!n&&n.getNextBlock()==t},t.blockRendering.TopRow.prototype.hasRightSquareCorner=function(t){return!0},t.blockRendering.TopRow.prototype.measure=function(){for(var e,n=0,r=0,i=0,o=0;e=this.elements[o];o++)r+=e.width,t.blockRendering.Types.isSpacer(e)||(t.blockRendering.Types.isHat(e)?i=Math.max(i,e.ascenderHeight):n=Math.max(n,e.height));this.width=Math.max(this.minWidth,r),this.height=Math.max(this.minHeight,n)+i,this.capline=this.ascenderHeight=i,this.widthWithConnectedBlocks=this.width},t.blockRendering.TopRow.prototype.startsWithElemSpacer=function(){return!1},t.blockRendering.TopRow.prototype.endsWithElemSpacer=function(){return!1},t.blockRendering.BottomRow=function(e){t.blockRendering.BottomRow.superClass_.constructor.call(this,e),this.type|=t.blockRendering.Types.BOTTOM_ROW,this.hasNextConnection=!1,this.connection=null,this.baseline=this.descenderHeight=0},t.utils.object.inherits(t.blockRendering.BottomRow,t.blockRendering.Row),t.blockRendering.BottomRow.prototype.hasLeftSquareCorner=function(t){return!!t.outputConnection||!!t.getNextBlock()},t.blockRendering.BottomRow.prototype.hasRightSquareCorner=function(t){return!0},t.blockRendering.BottomRow.prototype.measure=function(){for(var e,n=0,r=0,i=0,o=0;e=this.elements[o];o++)r+=e.width,t.blockRendering.Types.isSpacer(e)||(t.blockRendering.Types.isNextConnection(e)?i=Math.max(i,e.height):n=Math.max(n,e.height));this.width=Math.max(this.minWidth,r),this.height=Math.max(this.minHeight,n)+i,this.descenderHeight=i,this.widthWithConnectedBlocks=this.width},t.blockRendering.BottomRow.prototype.startsWithElemSpacer=function(){return!1},t.blockRendering.BottomRow.prototype.endsWithElemSpacer=function(){return!1},t.blockRendering.SpacerRow=function(e,n,r){t.blockRendering.SpacerRow.superClass_.constructor.call(this,e),this.type=this.type|t.blockRendering.Types.SPACER|t.blockRendering.Types.BETWEEN_ROW_SPACER,this.width=r,this.height=n,this.followsStatement=!1,this.widthWithConnectedBlocks=0,this.elements=[new t.blockRendering.InRowSpacer(this.constants_,r)]},t.utils.object.inherits(t.blockRendering.SpacerRow,t.blockRendering.Row),t.blockRendering.SpacerRow.prototype.measure=function(){},t.blockRendering.InputRow=function(e){t.blockRendering.InputRow.superClass_.constructor.call(this,e),this.type|=t.blockRendering.Types.INPUT_ROW,this.connectedBlockWidths=0},t.utils.object.inherits(t.blockRendering.InputRow,t.blockRendering.Row),t.blockRendering.InputRow.prototype.measure=function(){this.width=this.minWidth,this.height=this.minHeight;for(var e,n=0,r=0;e=this.elements[r];r++)this.width+=e.width,t.blockRendering.Types.isInput(e)&&(t.blockRendering.Types.isStatementInput(e)?n+=e.connectedBlockWidth:t.blockRendering.Types.isExternalInput(e)&&0!=e.connectedBlockWidth&&(n+=e.connectedBlockWidth-e.connectionWidth)),t.blockRendering.Types.isSpacer(e)||(this.height=Math.max(this.height,e.height));this.connectedBlockWidths=n,this.widthWithConnectedBlocks=this.width+n},t.blockRendering.InputRow.prototype.endsWithElemSpacer=function(){return!this.hasExternalInput&&!this.hasStatement},t.blockRendering.RenderInfo=function(e,n){this.block_=n,this.renderer_=e,this.constants_=this.renderer_.getConstants(),this.outputConnection=n.outputConnection?new t.blockRendering.OutputConnection(this.constants_,n.outputConnection):null,this.isInline=n.getInputsInline()&&!n.isCollapsed(),this.isCollapsed=n.isCollapsed(),this.isInsertionMarker=n.isInsertionMarker(),this.RTL=n.RTL,this.statementEdge=this.width=this.widthWithChildren=this.height=0,this.rows=[],this.inputRows=[],this.hiddenIcons=[],this.topRow=new t.blockRendering.TopRow(this.constants_),this.bottomRow=new t.blockRendering.BottomRow(this.constants_),this.startY=this.startX=0},t.blockRendering.RenderInfo.prototype.getRenderer=function(){return this.renderer_},t.blockRendering.RenderInfo.prototype.measure=function(){this.createRows_(),this.addElemSpacing_(),this.addRowSpacing_(),this.computeBounds_(),this.alignRowElements_(),this.finalize_()},t.blockRendering.RenderInfo.prototype.createRows_=function(){this.populateTopRow_(),this.rows.push(this.topRow);var e=new t.blockRendering.InputRow(this.constants_);this.inputRows.push(e);for(var n,r=this.block_.getIcons(),i=0;n=r[i];i++){var o=new t.blockRendering.Icon(this.constants_,n);this.isCollapsed&&n.collapseHidden?this.hiddenIcons.push(o):e.elements.push(o)}for(n=null,i=0;r=this.block_.inputList[i];i++)if(r.isVisible()){for(this.shouldStartNewRow_(r,n)&&(this.rows.push(e),e=new t.blockRendering.InputRow(this.constants_),this.inputRows.push(e)),n=0;o=r.fieldRow[n];n++)e.elements.push(new t.blockRendering.Field(this.constants_,o,r));this.addInput_(r,e),n=r}this.isCollapsed&&(e.hasJaggedEdge=!0,e.elements.push(new t.blockRendering.JaggedEdge(this.constants_))),(e.elements.length||e.hasDummyInput)&&this.rows.push(e),this.populateBottomRow_(),this.rows.push(this.bottomRow)},t.blockRendering.RenderInfo.prototype.populateTopRow_=function(){var e=!!this.block_.previousConnection,n=(this.block_.hat?"cap"===this.block_.hat:this.constants_.ADD_START_HATS)&&!this.outputConnection&&!e,r=this.topRow.hasLeftSquareCorner(this.block_)?t.blockRendering.SquareCorner:t.blockRendering.RoundCorner;this.topRow.elements.push(new r(this.constants_)),n?(e=new t.blockRendering.Hat(this.constants_),this.topRow.elements.push(e),this.topRow.capline=e.ascenderHeight):e&&(this.topRow.hasPreviousConnection=!0,this.topRow.connection=new t.blockRendering.PreviousConnection(this.constants_,this.block_.previousConnection),this.topRow.elements.push(this.topRow.connection)),this.block_.inputList.length&&this.block_.inputList[0].type==t.inputTypes.STATEMENT&&!this.block_.isCollapsed()?this.topRow.minHeight=this.constants_.TOP_ROW_PRECEDES_STATEMENT_MIN_HEIGHT:this.topRow.minHeight=this.constants_.TOP_ROW_MIN_HEIGHT,r=this.topRow.hasRightSquareCorner(this.block_)?t.blockRendering.SquareCorner:t.blockRendering.RoundCorner,this.topRow.elements.push(new r(this.constants_,"right"))},t.blockRendering.RenderInfo.prototype.populateBottomRow_=function(){this.bottomRow.hasNextConnection=!!this.block_.nextConnection,this.bottomRow.minHeight=this.block_.inputList.length&&this.block_.inputList[this.block_.inputList.length-1].type==t.inputTypes.STATEMENT?this.constants_.BOTTOM_ROW_AFTER_STATEMENT_MIN_HEIGHT:this.constants_.BOTTOM_ROW_MIN_HEIGHT,this.bottomRow.hasLeftSquareCorner(this.block_)?this.bottomRow.elements.push(new t.blockRendering.SquareCorner(this.constants_)):this.bottomRow.elements.push(new t.blockRendering.RoundCorner(this.constants_)),this.bottomRow.hasNextConnection&&(this.bottomRow.connection=new t.blockRendering.NextConnection(this.constants_,this.block_.nextConnection),this.bottomRow.elements.push(this.bottomRow.connection)),this.bottomRow.hasRightSquareCorner(this.block_)?this.bottomRow.elements.push(new t.blockRendering.SquareCorner(this.constants_,"right")):this.bottomRow.elements.push(new t.blockRendering.RoundCorner(this.constants_,"right"))},t.blockRendering.RenderInfo.prototype.addInput_=function(e,n){this.isInline&&e.type==t.inputTypes.VALUE?(n.elements.push(new t.blockRendering.InlineInput(this.constants_,e)),n.hasInlineInput=!0):e.type==t.inputTypes.STATEMENT?(n.elements.push(new t.blockRendering.StatementInput(this.constants_,e)),n.hasStatement=!0):e.type==t.inputTypes.VALUE?(n.elements.push(new t.blockRendering.ExternalValueInput(this.constants_,e)),n.hasExternalInput=!0):e.type==t.inputTypes.DUMMY&&(n.minHeight=Math.max(n.minHeight,e.getSourceBlock()&&e.getSourceBlock().isShadow()?this.constants_.DUMMY_INPUT_SHADOW_MIN_HEIGHT:this.constants_.DUMMY_INPUT_MIN_HEIGHT),n.hasDummyInput=!0),null==n.align&&(n.align=e.align)},t.blockRendering.RenderInfo.prototype.shouldStartNewRow_=function(e,n){return!!n&&(e.type==t.inputTypes.STATEMENT||n.type==t.inputTypes.STATEMENT||(e.type==t.inputTypes.VALUE||e.type==t.inputTypes.DUMMY)&&!this.isInline)},t.blockRendering.RenderInfo.prototype.addElemSpacing_=function(){for(var e,n=0;e=this.rows[n];n++){var r=e.elements;if(e.elements=[],e.startsWithElemSpacer()&&e.elements.push(new t.blockRendering.InRowSpacer(this.constants_,this.getInRowSpacing_(null,r[0]))),r.length){for(var i=0;i<r.length-1;i++){e.elements.push(r[i]);var o=this.getInRowSpacing_(r[i],r[i+1]);e.elements.push(new t.blockRendering.InRowSpacer(this.constants_,o))}e.elements.push(r[r.length-1]),e.endsWithElemSpacer()&&e.elements.push(new t.blockRendering.InRowSpacer(this.constants_,this.getInRowSpacing_(r[r.length-1],null)))}}},t.blockRendering.RenderInfo.prototype.getInRowSpacing_=function(e,n){if(!e&&n&&t.blockRendering.Types.isStatementInput(n))return this.constants_.STATEMENT_INPUT_PADDING_LEFT;if(e&&t.blockRendering.Types.isInput(e)&&!n){if(t.blockRendering.Types.isExternalInput(e))return this.constants_.NO_PADDING;if(t.blockRendering.Types.isInlineInput(e))return this.constants_.LARGE_PADDING;if(t.blockRendering.Types.isStatementInput(e))return this.constants_.NO_PADDING}return e&&t.blockRendering.Types.isLeftSquareCorner(e)&&n&&(t.blockRendering.Types.isPreviousConnection(n)||t.blockRendering.Types.isNextConnection(n))?n.notchOffset:e&&t.blockRendering.Types.isLeftRoundedCorner(e)&&n&&(t.blockRendering.Types.isPreviousConnection(n)||t.blockRendering.Types.isNextConnection(n))?n.notchOffset-this.constants_.CORNER_RADIUS:this.constants_.MEDIUM_PADDING},t.blockRendering.RenderInfo.prototype.computeBounds_=function(){for(var t,e=0,n=0,r=0,i=0;t=this.rows[i];i++){if(t.measure(),n=Math.max(n,t.width),t.hasStatement){var o=t.getLastInput();e=Math.max(e,t.width-o.width)}r=Math.max(r,t.widthWithConnectedBlocks)}for(this.statementEdge=e,this.width=n,i=0;t=this.rows[i];i++)t.hasStatement&&(t.statementEdge=this.statementEdge);this.widthWithChildren=Math.max(n,r),this.outputConnection&&(this.startX=this.outputConnection.width,this.width+=this.outputConnection.width,this.widthWithChildren+=this.outputConnection.width)},t.blockRendering.RenderInfo.prototype.alignRowElements_=function(){for(var e,n=0;e=this.rows[n];n++)if(e.hasStatement)this.alignStatementRow_(e);else{var r=e.width;0<(r=this.getDesiredRowWidth_(e)-r)&&this.addAlignmentPadding_(e,r),t.blockRendering.Types.isTopOrBottomRow(e)&&(e.widthWithConnectedBlocks=e.width)}},t.blockRendering.RenderInfo.prototype.getDesiredRowWidth_=function(t){return this.width-this.startX},t.blockRendering.RenderInfo.prototype.addAlignmentPadding_=function(e,n){var r=e.getFirstSpacer(),i=e.getLastSpacer();(e.hasExternalInput||e.hasStatement)&&(e.widthWithConnectedBlocks+=n),e.align==t.constants.ALIGN.LEFT?i.width+=n:e.align==t.constants.ALIGN.CENTRE?(r.width+=n/2,i.width+=n/2):e.align==t.constants.ALIGN.RIGHT?r.width+=n:i.width+=n,e.width+=n},t.blockRendering.RenderInfo.prototype.alignStatementRow_=function(t){var e=t.getLastInput(),n=t.width-e.width,r=this.statementEdge;0<(n=r-n)&&this.addAlignmentPadding_(t,n),n=t.width,r=this.getDesiredRowWidth_(t),e.width+=r-n,e.height=Math.max(e.height,t.height),t.width+=r-n,t.widthWithConnectedBlocks=Math.max(t.width,this.statementEdge+t.connectedBlockWidths)},t.blockRendering.RenderInfo.prototype.addRowSpacing_=function(){var t=this.rows;this.rows=[];for(var e=0;e<t.length;e++)this.rows.push(t[e]),e!=t.length-1&&this.rows.push(this.makeSpacerRow_(t[e],t[e+1]))},t.blockRendering.RenderInfo.prototype.makeSpacerRow_=function(e,n){var r=this.getSpacerRowHeight_(e,n),i=this.getSpacerRowWidth_(e,n);return r=new t.blockRendering.SpacerRow(this.constants_,r,i),e.hasStatement&&(r.followsStatement=!0),n.hasStatement&&(r.precedesStatement=!0),r},t.blockRendering.RenderInfo.prototype.getSpacerRowWidth_=function(t,e){return this.width-this.startX},t.blockRendering.RenderInfo.prototype.getSpacerRowHeight_=function(t,e){return this.constants_.MEDIUM_PADDING},t.blockRendering.RenderInfo.prototype.getElemCenterline_=function(e,n){return t.blockRendering.Types.isSpacer(n)?e.yPos+n.height/2:t.blockRendering.Types.isBottomRow(e)?(e=e.yPos+e.height-e.descenderHeight,t.blockRendering.Types.isNextConnection(n)?e+n.height/2:e-n.height/2):t.blockRendering.Types.isTopRow(e)?t.blockRendering.Types.isHat(n)?e.capline-n.height/2:e.capline+n.height/2:e.yPos+e.height/2},t.blockRendering.RenderInfo.prototype.recordElemPositions_=function(e){for(var n,r=e.xPos,i=0;n=e.elements[i];i++)t.blockRendering.Types.isSpacer(n)&&(n.height=e.height),n.xPos=r,n.centerline=this.getElemCenterline_(e,n),r+=n.width},t.blockRendering.RenderInfo.prototype.finalize_=function(){for(var t,e=0,n=0,r=0;t=this.rows[r];r++)t.yPos=n,t.xPos=this.startX,n+=t.height,e=Math.max(e,t.widthWithConnectedBlocks),this.recordElemPositions_(t);this.outputConnection&&this.block_.nextConnection&&this.block_.nextConnection.isConnected()&&(e=Math.max(e,this.block_.nextConnection.targetBlock().getHeightWidth().width)),this.widthWithChildren=e+this.startX,this.height=n,this.startY=this.topRow.capline,this.bottomRow.baseline=n-this.bottomRow.descenderHeight},t.blockRendering.Debug=function(t){this.debugElements_=[],this.svgRoot_=null,this.constants_=t},t.blockRendering.Debug.config={rowSpacers:!0,elemSpacers:!0,rows:!0,elems:!0,connections:!0,blockBounds:!0,connectedBlockBounds:!0,render:!0},t.blockRendering.Debug.prototype.clearElems=function(){for(var e,n=0;e=this.debugElements_[n];n++)t.utils.dom.removeNode(e);this.debugElements_=[]},t.blockRendering.Debug.prototype.drawSpacerRow=function(e,n,r){if(t.blockRendering.Debug.config.rowSpacers){var i=Math.abs(e.height),o=0>e.height;o&&(n-=i),this.debugElements_.push(t.utils.dom.createSvgElement(t.utils.Svg.RECT,{class:"rowSpacerRect blockRenderDebug",x:r?-(e.xPos+e.width):e.xPos,y:n,width:e.width,height:i,stroke:o?"black":"blue",fill:"blue","fill-opacity":"0.5","stroke-width":"1px"},this.svgRoot_))}},t.blockRendering.Debug.prototype.drawSpacerElem=function(e,n,r){if(t.blockRendering.Debug.config.elemSpacers){n=Math.abs(e.width);var i=0>e.width,o=i?e.xPos-n:e.xPos;r&&(o=-(o+n)),this.debugElements_.push(t.utils.dom.createSvgElement(t.utils.Svg.RECT,{class:"elemSpacerRect blockRenderDebug",x:o,y:e.centerline-e.height/2,width:n,height:e.height,stroke:"pink",fill:i?"black":"pink","fill-opacity":"0.5","stroke-width":"1px"},this.svgRoot_))}},t.blockRendering.Debug.prototype.drawRenderedElem=function(e,n){if(t.blockRendering.Debug.config.elems){var r=e.xPos;n&&(r=-(r+e.width)),n=e.centerline-e.height/2,this.debugElements_.push(t.utils.dom.createSvgElement(t.utils.Svg.RECT,{class:"rowRenderingRect blockRenderDebug",x:r,y:n,width:e.width,height:e.height,stroke:"black",fill:"none","stroke-width":"1px"},this.svgRoot_)),t.blockRendering.Types.isField(e)&&e.field instanceof t.FieldLabel&&this.debugElements_.push(t.utils.dom.createSvgElement(t.utils.Svg.RECT,{class:"rowRenderingRect blockRenderDebug",x:r,y:n+this.constants_.FIELD_TEXT_BASELINE,width:e.width,height:"0.1px",stroke:"red",fill:"none","stroke-width":"0.5px"},this.svgRoot_))}t.blockRendering.Types.isInput(e)&&t.blockRendering.Debug.config.connections&&this.drawConnection(e.connectionModel)},t.blockRendering.Debug.prototype.drawConnection=function(e){if(t.blockRendering.Debug.config.connections){if(e.type==t.connectionTypes.INPUT_VALUE)var n=4,r="magenta",i="none";else e.type==t.connectionTypes.OUTPUT_VALUE?(n=2,i=r="magenta"):e.type==t.connectionTypes.NEXT_STATEMENT?(n=4,r="goldenrod",i="none"):e.type==t.connectionTypes.PREVIOUS_STATEMENT&&(n=2,i=r="goldenrod");this.debugElements_.push(t.utils.dom.createSvgElement(t.utils.Svg.CIRCLE,{class:"blockRenderDebug",cx:e.offsetInBlock_.x,cy:e.offsetInBlock_.y,r:n,fill:i,stroke:r},this.svgRoot_))}},t.blockRendering.Debug.prototype.drawRenderedRow=function(e,n,r){t.blockRendering.Debug.config.rows&&(this.debugElements_.push(t.utils.dom.createSvgElement(t.utils.Svg.RECT,{class:"elemRenderingRect blockRenderDebug",x:r?-(e.xPos+e.width):e.xPos,y:e.yPos,width:e.width,height:e.height,stroke:"red",fill:"none","stroke-width":"1px"},this.svgRoot_)),t.blockRendering.Types.isTopOrBottomRow(e)||t.blockRendering.Debug.config.connectedBlockBounds&&this.debugElements_.push(t.utils.dom.createSvgElement(t.utils.Svg.RECT,{class:"connectedBlockWidth blockRenderDebug",x:r?-(e.xPos+e.widthWithConnectedBlocks):e.xPos,y:e.yPos,width:e.widthWithConnectedBlocks,height:e.height,stroke:this.randomColour_,fill:"none","stroke-width":"1px","stroke-dasharray":"3,3"},this.svgRoot_)))},t.blockRendering.Debug.prototype.drawRowWithElements=function(e,n,r){for(var i=0,o=e.elements.length;i<o;i++){var s=e.elements[i];s?t.blockRendering.Types.isSpacer(s)?this.drawSpacerElem(s,e.height,r):this.drawRenderedElem(s,r):console.warn("A row has an undefined or null element.",e,s)}this.drawRenderedRow(e,n,r)},t.blockRendering.Debug.prototype.drawBoundingBox=function(e){if(t.blockRendering.Debug.config.blockBounds){var n=e.RTL?-e.width:0;this.debugElements_.push(t.utils.dom.createSvgElement(t.utils.Svg.RECT,{class:"blockBoundingBox blockRenderDebug",x:n,y:0,width:e.width,height:e.height,stroke:"black",fill:"none","stroke-width":"1px","stroke-dasharray":"5,5"},this.svgRoot_)),t.blockRendering.Debug.config.connectedBlockBounds&&(n=e.RTL?-e.widthWithChildren:0,this.debugElements_.push(t.utils.dom.createSvgElement(t.utils.Svg.RECT,{class:"blockRenderDebug",x:n,y:0,width:e.widthWithChildren,height:e.height,stroke:"#DF57BC",fill:"none","stroke-width":"1px","stroke-dasharray":"3,3"},this.svgRoot_)))}},t.blockRendering.Debug.prototype.drawDebug=function(e,n){this.clearElems(),this.svgRoot_=e.getSvgRoot(),this.randomColour_="#"+Math.floor(16777215*Math.random()).toString(16);for(var r,i=0,o=0;r=n.rows[o];o++)t.blockRendering.Types.isBetweenRowSpacer(r)?this.drawSpacerRow(r,i,n.RTL):this.drawRowWithElements(r,i,n.RTL),i+=r.height;e.previousConnection&&this.drawConnection(e.previousConnection),e.nextConnection&&this.drawConnection(e.nextConnection),e.outputConnection&&this.drawConnection(e.outputConnection),n.rightSide&&this.drawRenderedElem(n.rightSide,n.RTL),this.drawBoundingBox(n),this.drawRender(e.pathObject.svgPath)},t.blockRendering.Debug.prototype.drawRender=function(e){t.blockRendering.Debug.config.render&&(e.setAttribute("filter","url(#"+this.constants_.debugFilterId+")"),setTimeout(function(){e.setAttribute("filter","")},100))},t.blockRendering.Drawer=function(t,e){this.block_=t,this.info_=e,this.topLeft_=t.getRelativeToSurfaceXY(),this.inlinePath_=this.outlinePath_="",this.constants_=e.getRenderer().getConstants()},t.blockRendering.Drawer.prototype.draw=function(){this.hideHiddenIcons_(),this.drawOutline_(),this.drawInternals_(),this.block_.pathObject.setPath(this.outlinePath_+"\n"+this.inlinePath_),this.info_.RTL&&this.block_.pathObject.flipRTL(),t.blockRendering.useDebugger&&this.block_.renderingDebugger.drawDebug(this.block_,this.info_),this.recordSizeOnBlock_()},t.blockRendering.Drawer.prototype.recordSizeOnBlock_=function(){this.block_.height=this.info_.height,this.block_.width=this.info_.widthWithChildren},t.blockRendering.Drawer.prototype.hideHiddenIcons_=function(){for(var t,e=0;t=this.info_.hiddenIcons[e];e++)t.icon.iconGroup_.setAttribute("display","none")},t.blockRendering.Drawer.prototype.drawOutline_=function(){this.drawTop_();for(var t=1;t<this.info_.rows.length-1;t++){var e=this.info_.rows[t];e.hasJaggedEdge?this.drawJaggedEdge_(e):e.hasStatement?this.drawStatementInput_(e):e.hasExternalInput?this.drawValueInput_(e):this.drawRightSideRow_(e)}this.drawBottom_(),this.drawLeft_()},t.blockRendering.Drawer.prototype.drawTop_=function(){var e=this.info_.topRow,n=e.elements;this.positionPreviousConnection_(),this.outlinePath_+=t.utils.svgPaths.moveBy(e.xPos,this.info_.startY);for(var r,i=0;r=n[i];i++)t.blockRendering.Types.isLeftRoundedCorner(r)?this.outlinePath_+=this.constants_.OUTSIDE_CORNERS.topLeft:t.blockRendering.Types.isRightRoundedCorner(r)?this.outlinePath_+=this.constants_.OUTSIDE_CORNERS.topRight:t.blockRendering.Types.isPreviousConnection(r)?this.outlinePath_+=r.shape.pathLeft:t.blockRendering.Types.isHat(r)?this.outlinePath_+=this.constants_.START_HAT.path:t.blockRendering.Types.isSpacer(r)&&(this.outlinePath_+=t.utils.svgPaths.lineOnAxis("h",r.width));this.outlinePath_+=t.utils.svgPaths.lineOnAxis("v",e.height)},t.blockRendering.Drawer.prototype.drawJaggedEdge_=function(e){this.outlinePath_+=this.constants_.JAGGED_TEETH.path+t.utils.svgPaths.lineOnAxis("v",e.height-this.constants_.JAGGED_TEETH.height)},t.blockRendering.Drawer.prototype.drawValueInput_=function(e){var n=e.getLastInput();this.positionExternalValueConnection_(e);var r="function"==typeof n.shape.pathDown?n.shape.pathDown(n.height):n.shape.pathDown;this.outlinePath_+=t.utils.svgPaths.lineOnAxis("H",n.xPos+n.width)+r+t.utils.svgPaths.lineOnAxis("v",e.height-n.connectionHeight)},t.blockRendering.Drawer.prototype.drawStatementInput_=function(e){var n=e.getLastInput(),r=n.xPos+n.notchOffset+n.shape.width;n=n.shape.pathRight+t.utils.svgPaths.lineOnAxis("h",-(n.notchOffset-this.constants_.INSIDE_CORNERS.width))+this.constants_.INSIDE_CORNERS.pathTop;var i=e.height-2*this.constants_.INSIDE_CORNERS.height;this.outlinePath_+=t.utils.svgPaths.lineOnAxis("H",r)+n+t.utils.svgPaths.lineOnAxis("v",i)+this.constants_.INSIDE_CORNERS.pathBottom+t.utils.svgPaths.lineOnAxis("H",e.xPos+e.width),this.positionStatementInputConnection_(e)},t.blockRendering.Drawer.prototype.drawRightSideRow_=function(e){this.outlinePath_+=t.utils.svgPaths.lineOnAxis("V",e.yPos+e.height)},t.blockRendering.Drawer.prototype.drawBottom_=function(){var e=this.info_.bottomRow,n=e.elements;this.positionNextConnection_();for(var r,i=0,o="",s=n.length-1;r=n[s];s--)t.blockRendering.Types.isNextConnection(r)?o+=r.shape.pathRight:t.blockRendering.Types.isLeftSquareCorner(r)?o+=t.utils.svgPaths.lineOnAxis("H",e.xPos):t.blockRendering.Types.isLeftRoundedCorner(r)?o+=this.constants_.OUTSIDE_CORNERS.bottomLeft:t.blockRendering.Types.isRightRoundedCorner(r)?(o+=this.constants_.OUTSIDE_CORNERS.bottomRight,i=this.constants_.OUTSIDE_CORNERS.rightHeight):t.blockRendering.Types.isSpacer(r)&&(o+=t.utils.svgPaths.lineOnAxis("h",-1*r.width));this.outlinePath_+=t.utils.svgPaths.lineOnAxis("V",e.baseline-i),this.outlinePath_+=o},t.blockRendering.Drawer.prototype.drawLeft_=function(){var e=this.info_.outputConnection;if(this.positionOutputConnection_(),e){var n=e.connectionOffsetY+e.height;e="function"==typeof e.shape.pathUp?e.shape.pathUp(e.height):e.shape.pathUp,this.outlinePath_+=t.utils.svgPaths.lineOnAxis("V",n)+e}this.outlinePath_+="z"},t.blockRendering.Drawer.prototype.drawInternals_=function(){for(var e,n=0;e=this.info_.rows[n];n++)for(var r,i=0;r=e.elements[i];i++)t.blockRendering.Types.isInlineInput(r)?this.drawInlineInput_(r):(t.blockRendering.Types.isIcon(r)||t.blockRendering.Types.isField(r))&&this.layoutField_(r)},t.blockRendering.Drawer.prototype.layoutField_=function(e){if(t.blockRendering.Types.isField(e))var n=e.field.getSvgRoot();else t.blockRendering.Types.isIcon(e)&&(n=e.icon.iconGroup_);var r=e.centerline-e.height/2,i=e.xPos,o="";this.info_.RTL&&(i=-(i+e.width),e.flipRtl&&(i+=e.width,o="scale(-1 1)")),t.blockRendering.Types.isIcon(e)?(n.setAttribute("display","block"),n.setAttribute("transform","translate("+i+","+r+")"),e.icon.computeIconLocation()):n.setAttribute("transform","translate("+i+","+r+")"+o),this.info_.isInsertionMarker&&n.setAttribute("display","none")},t.blockRendering.Drawer.prototype.drawInlineInput_=function(e){var n=e.width,r=e.height,i=e.connectionOffsetY,o=e.connectionHeight+i;this.inlinePath_+=t.utils.svgPaths.moveTo(e.xPos+e.connectionWidth,e.centerline-r/2)+t.utils.svgPaths.lineOnAxis("v",i)+e.shape.pathDown+t.utils.svgPaths.lineOnAxis("v",r-o)+t.utils.svgPaths.lineOnAxis("h",n-e.connectionWidth)+t.utils.svgPaths.lineOnAxis("v",-r)+"z",this.positionInlineInputConnection_(e)},t.blockRendering.Drawer.prototype.positionInlineInputConnection_=function(t){var e=t.centerline-t.height/2;if(t.connectionModel){var n=t.xPos+t.connectionWidth+t.connectionOffsetX;this.info_.RTL&&(n*=-1),t.connectionModel.setOffsetInBlock(n,e+t.connectionOffsetY)}},t.blockRendering.Drawer.prototype.positionStatementInputConnection_=function(t){var e=t.getLastInput();if(e.connectionModel){var n=t.xPos+t.statementEdge+e.notchOffset;this.info_.RTL&&(n*=-1),e.connectionModel.setOffsetInBlock(n,t.yPos)}},t.blockRendering.Drawer.prototype.positionExternalValueConnection_=function(t){var e=t.getLastInput();if(e.connectionModel){var n=t.xPos+t.width;this.info_.RTL&&(n*=-1),e.connectionModel.setOffsetInBlock(n,t.yPos)}},t.blockRendering.Drawer.prototype.positionPreviousConnection_=function(){var t=this.info_.topRow;if(t.connection){var e=t.xPos+t.notchOffset;t.connection.connectionModel.setOffsetInBlock(this.info_.RTL?-e:e,0)}},t.blockRendering.Drawer.prototype.positionNextConnection_=function(){var t=this.info_.bottomRow;if(t.connection){var e=t.connection,n=e.xPos;e.connectionModel.setOffsetInBlock(this.info_.RTL?-n:n,t.baseline)}},t.blockRendering.Drawer.prototype.positionOutputConnection_=function(){if(this.info_.outputConnection){var t=this.info_.startX+this.info_.outputConnection.connectionOffsetX;this.block_.outputConnection.setOffsetInBlock(this.info_.RTL?-t:t,this.info_.outputConnection.connectionOffsetY)}},t.Events.MarkerMove=function(e,n,r,i){var o=e?e.workspace.id:void 0;i&&i.getType()==t.ASTNode.types.WORKSPACE&&(o=i.getLocation().id),t.Events.MarkerMove.superClass_.constructor.call(this,o),this.blockId=e?e.id:null,this.oldNode=r,this.newNode=i,this.isCursor=n},t.utils.object.inherits(t.Events.MarkerMove,t.Events.UiBase),t.Events.MarkerMove.prototype.type=t.Events.MARKER_MOVE,t.Events.MarkerMove.prototype.toJson=function(){var e=t.Events.MarkerMove.superClass_.toJson.call(this);return e.isCursor=this.isCursor,e.blockId=this.blockId,e.oldNode=this.oldNode,e.newNode=this.newNode,e},t.Events.MarkerMove.prototype.fromJson=function(e){t.Events.MarkerMove.superClass_.fromJson.call(this,e),this.isCursor=e.isCursor,this.blockId=e.blockId,this.oldNode=e.oldNode,this.newNode=e.newNode},t.registry.register(t.registry.Type.EVENT,t.Events.MARKER_MOVE,t.Events.MarkerMove),t.blockRendering.MarkerSvg=function(t,e,n){this.workspace_=t,this.marker_=n,this.parent_=null,this.constants_=e,this.currentMarkerSvg=null,t=this.isCursor()?this.constants_.CURSOR_COLOUR:this.constants_.MARKER_COLOUR,this.colour_=n.colour||t},t.blockRendering.MarkerSvg.CURSOR_CLASS="blocklyCursor",t.blockRendering.MarkerSvg.MARKER_CLASS="blocklyMarker",t.blockRendering.MarkerSvg.HEIGHT_MULTIPLIER=.75,t.blockRendering.MarkerSvg.prototype.getSvgRoot=function(){return this.svgGroup_},t.blockRendering.MarkerSvg.prototype.getMarker=function(){return this.marker_},t.blockRendering.MarkerSvg.prototype.isCursor=function(){return"cursor"==this.marker_.type},t.blockRendering.MarkerSvg.prototype.createDom=function(){var e=this.isCursor()?t.blockRendering.MarkerSvg.CURSOR_CLASS:t.blockRendering.MarkerSvg.MARKER_CLASS;return this.svgGroup_=t.utils.dom.createSvgElement(t.utils.Svg.G,{class:e},null),this.createDomInternal_(),this.svgGroup_},t.blockRendering.MarkerSvg.prototype.setParent_=function(t){this.isCursor()?(this.parent_&&this.parent_.setCursorSvg(null),t.setCursorSvg(this.getSvgRoot())):(this.parent_&&this.parent_.setMarkerSvg(null),t.setMarkerSvg(this.getSvgRoot())),this.parent_=t},t.blockRendering.MarkerSvg.prototype.draw=function(t,e){if(e){this.constants_=this.workspace_.getRenderer().getConstants();var n=this.isCursor()?this.constants_.CURSOR_COLOUR:this.constants_.MARKER_COLOUR;this.colour_=this.marker_.colour||n,this.applyColour_(e),this.showAtLocation_(e),this.fireMarkerEvent_(t,e),void 0!==(t=this.currentMarkerSvg.childNodes[0])&&t.beginElement&&t.beginElement()}else this.hide()},t.blockRendering.MarkerSvg.prototype.showAtLocation_=function(e){var n=e.getLocation().type;e.getType()==t.ASTNode.types.BLOCK?this.showWithBlock_(e):e.getType()==t.ASTNode.types.OUTPUT?this.showWithOutput_(e):n==t.connectionTypes.INPUT_VALUE?this.showWithInput_(e):n==t.connectionTypes.NEXT_STATEMENT?this.showWithNext_(e):e.getType()==t.ASTNode.types.PREVIOUS?this.showWithPrevious_(e):e.getType()==t.ASTNode.types.FIELD?this.showWithField_(e):e.getType()==t.ASTNode.types.WORKSPACE?this.showWithCoordinates_(e):e.getType()==t.ASTNode.types.STACK&&this.showWithStack_(e)},t.blockRendering.MarkerSvg.prototype.showWithBlockPrevOutput_=function(e){var n=(e=e.getSourceBlock()).width,r=e.height,i=r*t.blockRendering.MarkerSvg.HEIGHT_MULTIPLIER,o=this.constants_.CURSOR_BLOCK_PADDING;if(e.previousConnection){var s=this.constants_.shapeFor(e.previousConnection);this.positionPrevious_(n,o,i,s)}else e.outputConnection?(s=this.constants_.shapeFor(e.outputConnection),this.positionOutput_(n,r,s)):this.positionBlock_(n,o,i);this.setParent_(e),this.showCurrent_()},t.blockRendering.MarkerSvg.prototype.showWithBlock_=function(t){this.showWithBlockPrevOutput_(t)},t.blockRendering.MarkerSvg.prototype.showWithPrevious_=function(t){this.showWithBlockPrevOutput_(t)},t.blockRendering.MarkerSvg.prototype.showWithOutput_=function(t){this.showWithBlockPrevOutput_(t)},t.blockRendering.MarkerSvg.prototype.showWithCoordinates_=function(t){var e=t.getWsCoordinate();t=e.x,e=e.y,this.workspace_.RTL&&(t-=this.constants_.CURSOR_WS_WIDTH),this.positionLine_(t,e,this.constants_.CURSOR_WS_WIDTH),this.setParent_(this.workspace_),this.showCurrent_()},t.blockRendering.MarkerSvg.prototype.showWithField_=function(t){var e=(t=t.getLocation()).getSize().width,n=t.getSize().height;this.positionRect_(0,0,e,n),this.setParent_(t),this.showCurrent_()},t.blockRendering.MarkerSvg.prototype.showWithInput_=function(t){var e=(t=t.getLocation()).getSourceBlock();this.positionInput_(t),this.setParent_(e),this.showCurrent_()},t.blockRendering.MarkerSvg.prototype.showWithNext_=function(t){var e=t.getLocation();t=e.getSourceBlock();var n=0;e=e.getOffsetInBlock().y;var r=t.getHeightWidth().width;this.workspace_.RTL&&(n=-r),this.positionLine_(n,e,r),this.setParent_(t),this.showCurrent_()},t.blockRendering.MarkerSvg.prototype.showWithStack_=function(t){var e=(t=t.getLocation()).getHeightWidth(),n=e.width+this.constants_.CURSOR_STACK_PADDING;e=e.height+this.constants_.CURSOR_STACK_PADDING;var r=-this.constants_.CURSOR_STACK_PADDING/2,i=-this.constants_.CURSOR_STACK_PADDING/2,o=r;this.workspace_.RTL&&(o=-(n+r)),this.positionRect_(o,i,n,e),this.setParent_(t),this.showCurrent_()},t.blockRendering.MarkerSvg.prototype.showCurrent_=function(){this.hide(),this.currentMarkerSvg.style.display=""},t.blockRendering.MarkerSvg.prototype.positionBlock_=function(e,n,r){e=t.utils.svgPaths.moveBy(-n,r)+t.utils.svgPaths.lineOnAxis("V",-n)+t.utils.svgPaths.lineOnAxis("H",e+2*n)+t.utils.svgPaths.lineOnAxis("V",r),this.markerBlock_.setAttribute("d",e),this.workspace_.RTL&&this.flipRtl_(this.markerBlock_),this.currentMarkerSvg=this.markerBlock_},t.blockRendering.MarkerSvg.prototype.positionInput_=function(e){var n=e.getOffsetInBlock().x,r=e.getOffsetInBlock().y;e=t.utils.svgPaths.moveTo(0,0)+this.constants_.shapeFor(e).pathDown,this.markerInput_.setAttribute("d",e),this.markerInput_.setAttribute("transform","translate("+n+","+r+")"+(this.workspace_.RTL?" scale(-1 1)":"")),this.currentMarkerSvg=this.markerInput_},t.blockRendering.MarkerSvg.prototype.positionLine_=function(t,e,n){this.markerSvgLine_.setAttribute("x",t),this.markerSvgLine_.setAttribute("y",e),this.markerSvgLine_.setAttribute("width",n),this.currentMarkerSvg=this.markerSvgLine_},t.blockRendering.MarkerSvg.prototype.positionOutput_=function(e,n,r){e=t.utils.svgPaths.moveBy(e,0)+t.utils.svgPaths.lineOnAxis("h",-(e-r.width))+t.utils.svgPaths.lineOnAxis("v",this.constants_.TAB_OFFSET_FROM_TOP)+r.pathDown+t.utils.svgPaths.lineOnAxis("V",n)+t.utils.svgPaths.lineOnAxis("H",e),this.markerBlock_.setAttribute("d",e),this.workspace_.RTL&&this.flipRtl_(this.markerBlock_),this.currentMarkerSvg=this.markerBlock_},t.blockRendering.MarkerSvg.prototype.positionPrevious_=function(e,n,r,i){e=t.utils.svgPaths.moveBy(-n,r)+t.utils.svgPaths.lineOnAxis("V",-n)+t.utils.svgPaths.lineOnAxis("H",this.constants_.NOTCH_OFFSET_LEFT)+i.pathLeft+t.utils.svgPaths.lineOnAxis("H",e+2*n)+t.utils.svgPaths.lineOnAxis("V",r),this.markerBlock_.setAttribute("d",e),this.workspace_.RTL&&this.flipRtl_(this.markerBlock_),this.currentMarkerSvg=this.markerBlock_},t.blockRendering.MarkerSvg.prototype.positionRect_=function(t,e,n,r){this.markerSvgRect_.setAttribute("x",t),this.markerSvgRect_.setAttribute("y",e),this.markerSvgRect_.setAttribute("width",n),this.markerSvgRect_.setAttribute("height",r),this.currentMarkerSvg=this.markerSvgRect_},t.blockRendering.MarkerSvg.prototype.flipRtl_=function(t){t.setAttribute("transform","scale(-1 1)")},t.blockRendering.MarkerSvg.prototype.hide=function(){this.markerSvgLine_.style.display="none",this.markerSvgRect_.style.display="none",this.markerInput_.style.display="none",this.markerBlock_.style.display="none"},t.blockRendering.MarkerSvg.prototype.fireMarkerEvent_=function(e,n){var r=n.getSourceBlock();e=new(t.Events.get(t.Events.MARKER_MOVE))(r,this.isCursor(),e,n),t.Events.fire(e)},t.blockRendering.MarkerSvg.prototype.getBlinkProperties_=function(){return{attributeType:"XML",attributeName:"fill",dur:"1s",values:this.colour_+";transparent;transparent;",repeatCount:"indefinite"}},t.blockRendering.MarkerSvg.prototype.createDomInternal_=function(){if(this.markerSvg_=t.utils.dom.createSvgElement(t.utils.Svg.G,{width:this.constants_.CURSOR_WS_WIDTH,height:this.constants_.WS_CURSOR_HEIGHT},this.svgGroup_),this.markerSvgLine_=t.utils.dom.createSvgElement(t.utils.Svg.RECT,{width:this.constants_.CURSOR_WS_WIDTH,height:this.constants_.WS_CURSOR_HEIGHT,style:"display: none"},this.markerSvg_),this.markerSvgRect_=t.utils.dom.createSvgElement(t.utils.Svg.RECT,{class:"blocklyVerticalMarker",rx:10,ry:10,style:"display: none"},this.markerSvg_),this.markerInput_=t.utils.dom.createSvgElement(t.utils.Svg.PATH,{transform:"",style:"display: none"},this.markerSvg_),this.markerBlock_=t.utils.dom.createSvgElement(t.utils.Svg.PATH,{transform:"",style:"display: none",fill:"none","stroke-width":this.constants_.CURSOR_STROKE_WIDTH},this.markerSvg_),this.isCursor()){var e=this.getBlinkProperties_();t.utils.dom.createSvgElement(t.utils.Svg.ANIMATE,e,this.markerSvgLine_),t.utils.dom.createSvgElement(t.utils.Svg.ANIMATE,e,this.markerInput_),e.attributeName="stroke",t.utils.dom.createSvgElement(t.utils.Svg.ANIMATE,e,this.markerBlock_)}return this.markerSvg_},t.blockRendering.MarkerSvg.prototype.applyColour_=function(t){this.markerSvgLine_.setAttribute("fill",this.colour_),this.markerSvgRect_.setAttribute("stroke",this.colour_),this.markerInput_.setAttribute("fill",this.colour_),this.markerBlock_.setAttribute("stroke",this.colour_),this.isCursor()&&(t=this.colour_+";transparent;transparent;",this.markerSvgLine_.firstChild.setAttribute("values",t),this.markerInput_.firstChild.setAttribute("values",t),this.markerBlock_.firstChild.setAttribute("values",t))},t.blockRendering.MarkerSvg.prototype.dispose=function(){this.svgGroup_&&t.utils.dom.removeNode(this.svgGroup_)},t.blockRendering.PathObject=function(e,n,r){this.constants=r,this.svgRoot=e,this.svgPath=t.utils.dom.createSvgElement(t.utils.Svg.PATH,{class:"blocklyPath"},this.svgRoot),this.style=n,this.markerSvg=this.cursorSvg=null},t.blockRendering.PathObject.prototype.setPath=function(t){this.svgPath.setAttribute("d",t)},t.blockRendering.PathObject.prototype.flipRTL=function(){this.svgPath.setAttribute("transform","scale(-1 1)")},t.blockRendering.PathObject.prototype.setCursorSvg=function(t){t?(this.svgRoot.appendChild(t),this.cursorSvg=t):this.cursorSvg=null},t.blockRendering.PathObject.prototype.setMarkerSvg=function(t){t?(this.cursorSvg?this.svgRoot.insertBefore(t,this.cursorSvg):this.svgRoot.appendChild(t),this.markerSvg=t):this.markerSvg=null},t.blockRendering.PathObject.prototype.applyColour=function(t){this.svgPath.setAttribute("stroke",this.style.colourTertiary),this.svgPath.setAttribute("fill",this.style.colourPrimary),this.updateShadow_(t.isShadow()),this.updateDisabled_(!t.isEnabled()||t.getInheritedDisabled())},t.blockRendering.PathObject.prototype.setStyle=function(t){this.style=t},t.blockRendering.PathObject.prototype.setClass_=function(e,n){n?t.utils.dom.addClass(this.svgRoot,e):t.utils.dom.removeClass(this.svgRoot,e)},t.blockRendering.PathObject.prototype.updateHighlighted=function(t){t?this.svgPath.setAttribute("filter","url(#"+this.constants.embossFilterId+")"):this.svgPath.setAttribute("filter","none")},t.blockRendering.PathObject.prototype.updateShadow_=function(t){t&&(this.svgPath.setAttribute("stroke","none"),this.svgPath.setAttribute("fill",this.style.colourSecondary))},t.blockRendering.PathObject.prototype.updateDisabled_=function(t){this.setClass_("blocklyDisabled",t),t&&this.svgPath.setAttribute("fill","url(#"+this.constants.disabledPatternId+")")},t.blockRendering.PathObject.prototype.updateSelected=function(t){this.setClass_("blocklySelected",t)},t.blockRendering.PathObject.prototype.updateDraggingDelete=function(t){this.setClass_("blocklyDraggingDelete",t)},t.blockRendering.PathObject.prototype.updateInsertionMarker=function(t){this.setClass_("blocklyInsertionMarker",t)},t.blockRendering.PathObject.prototype.updateMovable=function(t){this.setClass_("blocklyDraggable",t)},t.blockRendering.PathObject.prototype.updateReplacementFade=function(t){this.setClass_("blocklyReplaceable",t)},t.blockRendering.PathObject.prototype.updateShapeForInputHighlight=function(t,e){},t.blockRendering.Renderer=function(t){this.name=t,this.overrides=this.constants_=null},t.blockRendering.Renderer.prototype.getClassName=function(){return this.name+"-renderer"},t.blockRendering.Renderer.prototype.init=function(e,n){this.constants_=this.makeConstants_(),n&&(this.overrides=n,t.utils.object.mixin(this.constants_,n)),this.constants_.setTheme(e),this.constants_.init()},t.blockRendering.Renderer.prototype.createDom=function(t,e){this.constants_.createDom(t,this.name+"-"+e.name,"."+this.getClassName()+"."+e.getClassName())},t.blockRendering.Renderer.prototype.refreshDom=function(e,n){var r=this.getConstants();r.dispose(),this.constants_=this.makeConstants_(),this.overrides&&t.utils.object.mixin(this.constants_,this.overrides),this.constants_.randomIdentifier=r.randomIdentifier,this.constants_.setTheme(n),this.constants_.init(),this.createDom(e,n)},t.blockRendering.Renderer.prototype.dispose=function(){this.constants_&&this.constants_.dispose()},t.blockRendering.Renderer.prototype.makeConstants_=function(){return new t.blockRendering.ConstantProvider},t.blockRendering.Renderer.prototype.makeRenderInfo_=function(e){return new t.blockRendering.RenderInfo(this,e)},t.blockRendering.Renderer.prototype.makeDrawer_=function(e,n){return new t.blockRendering.Drawer(e,n)},t.blockRendering.Renderer.prototype.makeDebugger_=function(){if(!t.blockRendering.Debug)throw Error("Missing require for Blockly.blockRendering.Debug");return new t.blockRendering.Debug(this.getConstants())},t.blockRendering.Renderer.prototype.makeMarkerDrawer=function(e,n){return new t.blockRendering.MarkerSvg(e,this.getConstants(),n)},t.blockRendering.Renderer.prototype.makePathObject=function(e,n){return new t.blockRendering.PathObject(e,n,this.constants_)},t.blockRendering.Renderer.prototype.getConstants=function(){return this.constants_},t.blockRendering.Renderer.prototype.shouldHighlightConnection=function(t){return!0},t.blockRendering.Renderer.prototype.orphanCanConnectAtEnd=function(e,n,r){return!!t.Connection.getConnectionForOrphanedConnection(e,r===t.connectionTypes.OUTPUT_VALUE?n.outputConnection:n.previousConnection)},t.blockRendering.Renderer.prototype.getConnectionPreviewMethod=function(e,n,r){return n.type==t.connectionTypes.OUTPUT_VALUE||n.type==t.connectionTypes.PREVIOUS_STATEMENT?!e.isConnected()||this.orphanCanConnectAtEnd(r,e.targetBlock(),n.type)?t.InsertionMarkerManager.PREVIEW_TYPE.INSERTION_MARKER:t.InsertionMarkerManager.PREVIEW_TYPE.REPLACEMENT_FADE:t.InsertionMarkerManager.PREVIEW_TYPE.INSERTION_MARKER},t.blockRendering.Renderer.prototype.render=function(e){t.blockRendering.useDebugger&&!e.renderingDebugger&&(e.renderingDebugger=this.makeDebugger_());var n=this.makeRenderInfo_(e);n.measure(),this.makeDrawer_(e,n).draw()},t.geras={},t.geras.ConstantProvider=function(){t.geras.ConstantProvider.superClass_.constructor.call(this),this.FIELD_TEXT_BASELINE_CENTER=!1,this.DARK_PATH_OFFSET=1,this.MAX_BOTTOM_WIDTH=30,this.STATEMENT_BOTTOM_SPACER=-this.NOTCH_HEIGHT/2},t.utils.object.inherits(t.geras.ConstantProvider,t.blockRendering.ConstantProvider),t.geras.ConstantProvider.prototype.getCSS_=function(e){return t.geras.ConstantProvider.superClass_.getCSS_.call(this,e).concat([e+" .blocklyInsertionMarker>.blocklyPathLight,",e+" .blocklyInsertionMarker>.blocklyPathDark {","fill-opacity: "+this.INSERTION_MARKER_OPACITY+";","stroke: none;","}"])},t.geras.Highlighter=function(t){this.info_=t,this.inlineSteps_=this.steps_="",this.RTL_=this.info_.RTL,t=t.getRenderer(),this.constants_=t.getConstants(),this.highlightConstants_=t.getHighlightConstants(),this.highlightOffset_=this.highlightConstants_.OFFSET,this.outsideCornerPaths_=this.highlightConstants_.OUTSIDE_CORNER,this.insideCornerPaths_=this.highlightConstants_.INSIDE_CORNER,this.puzzleTabPaths_=this.highlightConstants_.PUZZLE_TAB,this.notchPaths_=this.highlightConstants_.NOTCH,this.startPaths_=this.highlightConstants_.START_HAT,this.jaggedTeethPaths_=this.highlightConstants_.JAGGED_TEETH},t.geras.Highlighter.prototype.getPath=function(){return this.steps_+"\n"+this.inlineSteps_},t.geras.Highlighter.prototype.drawTopCorner=function(e){this.steps_+=t.utils.svgPaths.moveBy(e.xPos,this.info_.startY);for(var n,r=0;n=e.elements[r];r++)t.blockRendering.Types.isLeftSquareCorner(n)?this.steps_+=this.highlightConstants_.START_POINT:t.blockRendering.Types.isLeftRoundedCorner(n)?this.steps_+=this.outsideCornerPaths_.topLeft(this.RTL_):t.blockRendering.Types.isPreviousConnection(n)?this.steps_+=this.notchPaths_.pathLeft:t.blockRendering.Types.isHat(n)?this.steps_+=this.startPaths_.path(this.RTL_):t.blockRendering.Types.isSpacer(n)&&0!=n.width&&(this.steps_+=t.utils.svgPaths.lineOnAxis("H",n.xPos+n.width-this.highlightOffset_));this.steps_+=t.utils.svgPaths.lineOnAxis("H",e.xPos+e.width-this.highlightOffset_)},t.geras.Highlighter.prototype.drawJaggedEdge_=function(e){this.info_.RTL&&(this.steps_+=this.jaggedTeethPaths_.pathLeft+t.utils.svgPaths.lineOnAxis("v",e.height-this.jaggedTeethPaths_.height-this.highlightOffset_))},t.geras.Highlighter.prototype.drawValueInput=function(e){var n=e.getLastInput();if(this.RTL_){var r=e.height-n.connectionHeight;this.steps_+=t.utils.svgPaths.moveTo(n.xPos+n.width-this.highlightOffset_,e.yPos)+this.puzzleTabPaths_.pathDown(this.RTL_)+t.utils.svgPaths.lineOnAxis("v",r)}else this.steps_+=t.utils.svgPaths.moveTo(n.xPos+n.width,e.yPos)+this.puzzleTabPaths_.pathDown(this.RTL_)},t.geras.Highlighter.prototype.drawStatementInput=function(e){var n=e.getLastInput();if(this.RTL_){var r=e.height-2*this.insideCornerPaths_.height;this.steps_+=t.utils.svgPaths.moveTo(n.xPos,e.yPos)+this.insideCornerPaths_.pathTop(this.RTL_)+t.utils.svgPaths.lineOnAxis("v",r)+this.insideCornerPaths_.pathBottom(this.RTL_)+t.utils.svgPaths.lineTo(e.width-n.xPos-this.insideCornerPaths_.width,0)}else this.steps_+=t.utils.svgPaths.moveTo(n.xPos,e.yPos+e.height)+this.insideCornerPaths_.pathBottom(this.RTL_)+t.utils.svgPaths.lineTo(e.width-n.xPos-this.insideCornerPaths_.width,0)},t.geras.Highlighter.prototype.drawRightSideRow=function(e){var n=e.xPos+e.width-this.highlightOffset_;e.followsStatement&&(this.steps_+=t.utils.svgPaths.lineOnAxis("H",n)),this.RTL_&&(this.steps_+=t.utils.svgPaths.lineOnAxis("H",n),e.height>this.highlightOffset_&&(this.steps_+=t.utils.svgPaths.lineOnAxis("V",e.yPos+e.height-this.highlightOffset_)))},t.geras.Highlighter.prototype.drawBottomRow=function(e){if(this.RTL_)this.steps_+=t.utils.svgPaths.lineOnAxis("V",e.baseline-this.highlightOffset_);else{var n=this.info_.bottomRow.elements[0];t.blockRendering.Types.isLeftSquareCorner(n)?this.steps_+=t.utils.svgPaths.moveTo(e.xPos+this.highlightOffset_,e.baseline-this.highlightOffset_):t.blockRendering.Types.isLeftRoundedCorner(n)&&(this.steps_+=t.utils.svgPaths.moveTo(e.xPos,e.baseline),this.steps_+=this.outsideCornerPaths_.bottomLeft())}},t.geras.Highlighter.prototype.drawLeft=function(){var e=this.info_.outputConnection;e&&(e=e.connectionOffsetY+e.height,this.RTL_?this.steps_+=t.utils.svgPaths.moveTo(this.info_.startX,e):(this.steps_+=t.utils.svgPaths.moveTo(this.info_.startX+this.highlightOffset_,this.info_.bottomRow.baseline-this.highlightOffset_),this.steps_+=t.utils.svgPaths.lineOnAxis("V",e)),this.steps_+=this.puzzleTabPaths_.pathUp(this.RTL_)),this.RTL_||(e=this.info_.topRow,t.blockRendering.Types.isLeftRoundedCorner(e.elements[0])?this.steps_+=t.utils.svgPaths.lineOnAxis("V",this.outsideCornerPaths_.height):this.steps_+=t.utils.svgPaths.lineOnAxis("V",e.capline+this.highlightOffset_))},t.geras.Highlighter.prototype.drawInlineInput=function(e){var n=this.highlightOffset_,r=e.xPos+e.connectionWidth,i=e.centerline-e.height/2,o=e.width-e.connectionWidth,s=i+n;this.RTL_?(i=e.connectionOffsetY-n,e=e.height-(e.connectionOffsetY+e.connectionHeight)+n,this.inlineSteps_+=t.utils.svgPaths.moveTo(r-n,s)+t.utils.svgPaths.lineOnAxis("v",i)+this.puzzleTabPaths_.pathDown(this.RTL_)+t.utils.svgPaths.lineOnAxis("v",e)+t.utils.svgPaths.lineOnAxis("h",o)):this.inlineSteps_+=t.utils.svgPaths.moveTo(e.xPos+e.width+n,s)+t.utils.svgPaths.lineOnAxis("v",e.height)+t.utils.svgPaths.lineOnAxis("h",-o)+t.utils.svgPaths.moveTo(r,i+e.connectionOffsetY)+this.puzzleTabPaths_.pathDown(this.RTL_)},t.geras.InlineInput=function(e,n){t.geras.InlineInput.superClass_.constructor.call(this,e,n),this.connectedBlock&&(this.width+=this.constants_.DARK_PATH_OFFSET,this.height+=this.constants_.DARK_PATH_OFFSET)},t.utils.object.inherits(t.geras.InlineInput,t.blockRendering.InlineInput),t.geras.StatementInput=function(e,n){t.geras.StatementInput.superClass_.constructor.call(this,e,n),this.connectedBlock&&(this.height+=this.constants_.DARK_PATH_OFFSET)},t.utils.object.inherits(t.geras.StatementInput,t.blockRendering.StatementInput),t.geras.RenderInfo=function(e,n){t.geras.RenderInfo.superClass_.constructor.call(this,e,n)},t.utils.object.inherits(t.geras.RenderInfo,t.blockRendering.RenderInfo),t.geras.RenderInfo.prototype.getRenderer=function(){return this.renderer_},t.geras.RenderInfo.prototype.populateBottomRow_=function(){t.geras.RenderInfo.superClass_.populateBottomRow_.call(this),this.block_.inputList.length&&this.block_.inputList[this.block_.inputList.length-1].type==t.inputTypes.STATEMENT||(this.bottomRow.minHeight=this.constants_.MEDIUM_PADDING-this.constants_.DARK_PATH_OFFSET)},t.geras.RenderInfo.prototype.addInput_=function(e,n){this.isInline&&e.type==t.inputTypes.VALUE?(n.elements.push(new t.geras.InlineInput(this.constants_,e)),n.hasInlineInput=!0):e.type==t.inputTypes.STATEMENT?(n.elements.push(new t.geras.StatementInput(this.constants_,e)),n.hasStatement=!0):e.type==t.inputTypes.VALUE?(n.elements.push(new t.blockRendering.ExternalValueInput(this.constants_,e)),n.hasExternalInput=!0):e.type==t.inputTypes.DUMMY&&(n.minHeight=Math.max(n.minHeight,this.constants_.DUMMY_INPUT_MIN_HEIGHT),n.hasDummyInput=!0),this.isInline||null!=n.align||(n.align=e.align)},t.geras.RenderInfo.prototype.addElemSpacing_=function(){for(var e,n=!1,r=0;e=this.rows[r];r++)e.hasExternalInput&&(n=!0);for(r=0;e=this.rows[r];r++){var i=e.elements;if(e.elements=[],e.startsWithElemSpacer()&&e.elements.push(new t.blockRendering.InRowSpacer(this.constants_,this.getInRowSpacing_(null,i[0]))),i.length){for(var o=0;o<i.length-1;o++){e.elements.push(i[o]);var s=this.getInRowSpacing_(i[o],i[o+1]);e.elements.push(new t.blockRendering.InRowSpacer(this.constants_,s))}e.elements.push(i[i.length-1]),e.endsWithElemSpacer()&&(s=this.getInRowSpacing_(i[i.length-1],null),n&&e.hasDummyInput&&(s+=this.constants_.TAB_WIDTH),e.elements.push(new t.blockRendering.InRowSpacer(this.constants_,s)))}}},t.geras.RenderInfo.prototype.getInRowSpacing_=function(e,n){if(!e)return n&&t.blockRendering.Types.isField(n)&&n.isEditable?this.constants_.MEDIUM_PADDING:n&&t.blockRendering.Types.isInlineInput(n)?this.constants_.MEDIUM_LARGE_PADDING:n&&t.blockRendering.Types.isStatementInput(n)?this.constants_.STATEMENT_INPUT_PADDING_LEFT:this.constants_.LARGE_PADDING;if(!t.blockRendering.Types.isInput(e)&&(!n||t.blockRendering.Types.isStatementInput(n)))return t.blockRendering.Types.isField(e)&&e.isEditable?this.constants_.MEDIUM_PADDING:t.blockRendering.Types.isIcon(e)?2*this.constants_.LARGE_PADDING+1:t.blockRendering.Types.isHat(e)?this.constants_.NO_PADDING:t.blockRendering.Types.isPreviousOrNextConnection(e)?this.constants_.LARGE_PADDING:t.blockRendering.Types.isLeftRoundedCorner(e)?this.constants_.MIN_BLOCK_WIDTH:t.blockRendering.Types.isJaggedEdge(e)?this.constants_.NO_PADDING:this.constants_.LARGE_PADDING;if(t.blockRendering.Types.isInput(e)&&!n){if(t.blockRendering.Types.isExternalInput(e))return this.constants_.NO_PADDING;if(t.blockRendering.Types.isInlineInput(e))return this.constants_.LARGE_PADDING;if(t.blockRendering.Types.isStatementInput(e))return this.constants_.NO_PADDING}if(!t.blockRendering.Types.isInput(e)&&n&&t.blockRendering.Types.isInput(n)){if(t.blockRendering.Types.isField(e)&&e.isEditable){if(t.blockRendering.Types.isInlineInput(n)||t.blockRendering.Types.isExternalInput(n))return this.constants_.SMALL_PADDING}else{if(t.blockRendering.Types.isInlineInput(n)||t.blockRendering.Types.isExternalInput(n))return this.constants_.MEDIUM_LARGE_PADDING;if(t.blockRendering.Types.isStatementInput(n))return this.constants_.LARGE_PADDING}return this.constants_.LARGE_PADDING-1}if(t.blockRendering.Types.isIcon(e)&&n&&!t.blockRendering.Types.isInput(n))return this.constants_.LARGE_PADDING;if(t.blockRendering.Types.isInlineInput(e)&&n&&t.blockRendering.Types.isField(n))return n.isEditable?this.constants_.MEDIUM_PADDING:this.constants_.LARGE_PADDING;if(t.blockRendering.Types.isLeftSquareCorner(e)&&n){if(t.blockRendering.Types.isHat(n))return this.constants_.NO_PADDING;if(t.blockRendering.Types.isPreviousConnection(n))return n.notchOffset;if(t.blockRendering.Types.isNextConnection(n))return e=(this.RTL?1:-1)*this.constants_.DARK_PATH_OFFSET/2,n.notchOffset+e}if(t.blockRendering.Types.isLeftRoundedCorner(e)&&n){if(t.blockRendering.Types.isPreviousConnection(n))return n.notchOffset-this.constants_.CORNER_RADIUS;if(t.blockRendering.Types.isNextConnection(n))return e=(this.RTL?1:-1)*this.constants_.DARK_PATH_OFFSET/2,n.notchOffset-this.constants_.CORNER_RADIUS+e}return t.blockRendering.Types.isField(e)&&n&&t.blockRendering.Types.isField(n)&&e.isEditable==n.isEditable||n&&t.blockRendering.Types.isJaggedEdge(n)?this.constants_.LARGE_PADDING:this.constants_.MEDIUM_PADDING},t.geras.RenderInfo.prototype.getSpacerRowHeight_=function(e,n){return t.blockRendering.Types.isTopRow(e)&&t.blockRendering.Types.isBottomRow(n)?this.constants_.EMPTY_BLOCK_SPACER_HEIGHT:t.blockRendering.Types.isTopRow(e)||t.blockRendering.Types.isBottomRow(n)?this.constants_.NO_PADDING:e.hasExternalInput&&n.hasExternalInput?this.constants_.LARGE_PADDING:!e.hasStatement&&n.hasStatement?this.constants_.BETWEEN_STATEMENT_PADDING_Y:e.hasStatement&&n.hasStatement||!e.hasStatement&&n.hasDummyInput||e.hasDummyInput?this.constants_.LARGE_PADDING:this.constants_.MEDIUM_PADDING},t.geras.RenderInfo.prototype.getElemCenterline_=function(e,n){if(t.blockRendering.Types.isSpacer(n))return e.yPos+n.height/2;if(t.blockRendering.Types.isBottomRow(e))return e=e.yPos+e.height-e.descenderHeight,t.blockRendering.Types.isNextConnection(n)?e+n.height/2:e-n.height/2;if(t.blockRendering.Types.isTopRow(e))return t.blockRendering.Types.isHat(n)?e.capline-n.height/2:e.capline+n.height/2;var r=e.yPos;return t.blockRendering.Types.isField(n)||t.blockRendering.Types.isIcon(n)?(r+=n.height/2,(e.hasInlineInput||e.hasStatement)&&n.height+this.constants_.TALL_INPUT_FIELD_OFFSET_Y<=e.height&&(r+=this.constants_.TALL_INPUT_FIELD_OFFSET_Y)):r=t.blockRendering.Types.isInlineInput(n)?r+n.height/2:r+e.height/2,r},t.geras.RenderInfo.prototype.alignRowElements_=function(){if(this.isInline){for(var e,n=0,r=null,i=this.rows.length-1;e=this.rows[i];i--)e.nextRightEdge=n,t.blockRendering.Types.isInputRow(e)&&(e.hasStatement&&this.alignStatementRow_(e),r&&r.hasStatement&&e.width<r.width?e.nextRightEdge=r.width:n=e.width,r=e);for(i=n=0;e=this.rows[i];i++)e.hasStatement?n=this.getDesiredRowWidth_(e):t.blockRendering.Types.isSpacer(e)?e.width=Math.max(n,e.nextRightEdge):(0<(n=Math.max(n,e.nextRightEdge)-e.width)&&this.addAlignmentPadding_(e,n),n=e.width)}else t.geras.RenderInfo.superClass_.alignRowElements_.call(this)},t.geras.RenderInfo.prototype.getDesiredRowWidth_=function(e){return this.isInline&&e.hasStatement?this.statementEdge+this.constants_.MAX_BOTTOM_WIDTH+this.startX:t.geras.RenderInfo.superClass_.getDesiredRowWidth_.call(this,e)},t.geras.RenderInfo.prototype.finalize_=function(){for(var t,e=0,n=0,r=0;t=this.rows[r];r++){t.yPos=n,t.xPos=this.startX,n+=t.height,e=Math.max(e,t.widthWithConnectedBlocks);var i=n-this.topRow.ascenderHeight;t==this.bottomRow&&i<this.constants_.MIN_BLOCK_HEIGHT&&(i=this.constants_.MIN_BLOCK_HEIGHT-i,this.bottomRow.height+=i,n+=i),this.recordElemPositions_(t)}this.outputConnection&&this.block_.nextConnection&&this.block_.nextConnection.isConnected()&&(e=Math.max(e,this.block_.nextConnection.targetBlock().getHeightWidth().width-this.constants_.DARK_PATH_OFFSET)),this.bottomRow.baseline=n-this.bottomRow.descenderHeight,this.widthWithChildren=e+this.startX+this.constants_.DARK_PATH_OFFSET,this.width+=this.constants_.DARK_PATH_OFFSET,this.height=n+this.constants_.DARK_PATH_OFFSET,this.startY=this.topRow.capline},t.geras.Drawer=function(e,n){t.geras.Drawer.superClass_.constructor.call(this,e,n),this.highlighter_=new t.geras.Highlighter(n)},t.utils.object.inherits(t.geras.Drawer,t.blockRendering.Drawer),t.geras.Drawer.prototype.draw=function(){this.hideHiddenIcons_(),this.drawOutline_(),this.drawInternals_();var e=this.block_.pathObject;e.setPath(this.outlinePath_+"\n"+this.inlinePath_),e.setHighlightPath(this.highlighter_.getPath()),this.info_.RTL&&e.flipRTL(),t.blockRendering.useDebugger&&this.block_.renderingDebugger.drawDebug(this.block_,this.info_),this.recordSizeOnBlock_()},t.geras.Drawer.prototype.drawTop_=function(){this.highlighter_.drawTopCorner(this.info_.topRow),this.highlighter_.drawRightSideRow(this.info_.topRow),t.geras.Drawer.superClass_.drawTop_.call(this)},t.geras.Drawer.prototype.drawJaggedEdge_=function(e){this.highlighter_.drawJaggedEdge_(e),t.geras.Drawer.superClass_.drawJaggedEdge_.call(this,e)},t.geras.Drawer.prototype.drawValueInput_=function(e){this.highlighter_.drawValueInput(e),t.geras.Drawer.superClass_.drawValueInput_.call(this,e)},t.geras.Drawer.prototype.drawStatementInput_=function(e){this.highlighter_.drawStatementInput(e),t.geras.Drawer.superClass_.drawStatementInput_.call(this,e)},t.geras.Drawer.prototype.drawRightSideRow_=function(e){this.highlighter_.drawRightSideRow(e),this.outlinePath_+=t.utils.svgPaths.lineOnAxis("H",e.xPos+e.width)+t.utils.svgPaths.lineOnAxis("V",e.yPos+e.height)},t.geras.Drawer.prototype.drawBottom_=function(){this.highlighter_.drawBottomRow(this.info_.bottomRow),t.geras.Drawer.superClass_.drawBottom_.call(this)},t.geras.Drawer.prototype.drawLeft_=function(){this.highlighter_.drawLeft(),t.geras.Drawer.superClass_.drawLeft_.call(this)},t.geras.Drawer.prototype.drawInlineInput_=function(e){this.highlighter_.drawInlineInput(e),t.geras.Drawer.superClass_.drawInlineInput_.call(this,e)},t.geras.Drawer.prototype.positionInlineInputConnection_=function(t){var e=t.centerline-t.height/2;if(t.connectionModel){var n=t.xPos+t.connectionWidth+this.constants_.DARK_PATH_OFFSET;this.info_.RTL&&(n*=-1),t.connectionModel.setOffsetInBlock(n,e+t.connectionOffsetY+this.constants_.DARK_PATH_OFFSET)}},t.geras.Drawer.prototype.positionStatementInputConnection_=function(t){var e=t.getLastInput();if(e.connectionModel){var n=t.xPos+t.statementEdge+e.notchOffset;n=this.info_.RTL?-1*n:n+this.constants_.DARK_PATH_OFFSET,e.connectionModel.setOffsetInBlock(n,t.yPos+this.constants_.DARK_PATH_OFFSET)}},t.geras.Drawer.prototype.positionExternalValueConnection_=function(t){var e=t.getLastInput();if(e.connectionModel){var n=t.xPos+t.width+this.constants_.DARK_PATH_OFFSET;this.info_.RTL&&(n*=-1),e.connectionModel.setOffsetInBlock(n,t.yPos)}},t.geras.Drawer.prototype.positionNextConnection_=function(){var t=this.info_.bottomRow;if(t.connection){var e=t.connection,n=e.xPos;e.connectionModel.setOffsetInBlock((this.info_.RTL?-n:n)+this.constants_.DARK_PATH_OFFSET/2,t.baseline+this.constants_.DARK_PATH_OFFSET)}},t.geras.HighlightConstantProvider=function(e){this.constantProvider=e,this.OFFSET=.5,this.START_POINT=t.utils.svgPaths.moveBy(this.OFFSET,this.OFFSET)},t.geras.HighlightConstantProvider.prototype.init=function(){this.INSIDE_CORNER=this.makeInsideCorner(),this.OUTSIDE_CORNER=this.makeOutsideCorner(),this.PUZZLE_TAB=this.makePuzzleTab(),this.NOTCH=this.makeNotch(),this.JAGGED_TEETH=this.makeJaggedTeeth(),this.START_HAT=this.makeStartHat()},t.geras.HighlightConstantProvider.prototype.makeInsideCorner=function(){var e=this.constantProvider.CORNER_RADIUS,n=this.OFFSET,r=(1-Math.SQRT1_2)*(e+n)-n,i=t.utils.svgPaths.moveBy(r,r)+t.utils.svgPaths.arc("a","0 0,0",e,t.utils.svgPaths.point(-r-n,e-r)),o=t.utils.svgPaths.arc("a","0 0,0",e+n,t.utils.svgPaths.point(e+n,e+n)),s=t.utils.svgPaths.moveBy(r,-r)+t.utils.svgPaths.arc("a","0 0,0",e+n,t.utils.svgPaths.point(e-r,r+n));return{width:e+n,height:e,pathTop:function(t){return t?i:""},pathBottom:function(t){return t?o:s}}},t.geras.HighlightConstantProvider.prototype.makeOutsideCorner=function(){var e=this.constantProvider.CORNER_RADIUS,n=this.OFFSET,r=(1-Math.SQRT1_2)*(e-n)+n,i=t.utils.svgPaths.moveBy(r,r)+t.utils.svgPaths.arc("a","0 0,1",e-n,t.utils.svgPaths.point(e-r,-r+n)),o=t.utils.svgPaths.moveBy(n,e)+t.utils.svgPaths.arc("a","0 0,1",e-n,t.utils.svgPaths.point(e,-e+n)),s=-r,a=t.utils.svgPaths.moveBy(r,s)+t.utils.svgPaths.arc("a","0 0,1",e-n,t.utils.svgPaths.point(-r+n,-s-e));return{height:e,topLeft:function(t){return t?i:o},bottomLeft:function(){return a}}},t.geras.HighlightConstantProvider.prototype.makePuzzleTab=function(){var e=this.constantProvider.TAB_WIDTH,n=this.constantProvider.TAB_HEIGHT,r=t.utils.svgPaths.moveBy(-2,3.4-n)+t.utils.svgPaths.lineTo(-.45*e,-2.1),i=t.utils.svgPaths.lineOnAxis("v",2.5)+t.utils.svgPaths.moveBy(.97*-e,2.5)+t.utils.svgPaths.curve("q",[t.utils.svgPaths.point(.05*-e,10),t.utils.svgPaths.point(.3*e,9.5)])+t.utils.svgPaths.moveBy(.67*e,-1.9)+t.utils.svgPaths.lineOnAxis("v",2.5),o=t.utils.svgPaths.lineOnAxis("v",-1.5)+t.utils.svgPaths.moveBy(-.92*e,-.5)+t.utils.svgPaths.curve("q",[t.utils.svgPaths.point(-.19*e,-5.5),t.utils.svgPaths.point(0,-11)])+t.utils.svgPaths.moveBy(.92*e,1),s=t.utils.svgPaths.moveBy(-5,n-.7)+t.utils.svgPaths.lineTo(.46*e,-2.1);return{width:e,height:n,pathUp:function(t){return t?r:o},pathDown:function(t){return t?i:s}}},t.geras.HighlightConstantProvider.prototype.makeNotch=function(){return{pathLeft:t.utils.svgPaths.lineOnAxis("h",this.OFFSET)+this.constantProvider.NOTCH.pathLeft}},t.geras.HighlightConstantProvider.prototype.makeJaggedTeeth=function(){return{pathLeft:t.utils.svgPaths.lineTo(5.1,2.6)+t.utils.svgPaths.moveBy(-10.2,6.8)+t.utils.svgPaths.lineTo(5.1,2.6),height:12,width:10.2}},t.geras.HighlightConstantProvider.prototype.makeStartHat=function(){var e=this.constantProvider.START_HAT.height,n=t.utils.svgPaths.moveBy(25,-8.7)+t.utils.svgPaths.curve("c",[t.utils.svgPaths.point(29.7,-6.2),t.utils.svgPaths.point(57.2,-.5),t.utils.svgPaths.point(75,8.7)]),r=t.utils.svgPaths.curve("c",[t.utils.svgPaths.point(17.8,-9.2),t.utils.svgPaths.point(45.3,-14.9),t.utils.svgPaths.point(75,-8.7)])+t.utils.svgPaths.moveTo(100.5,e+.5);return{path:function(t){return t?n:r}}},t.geras.PathObject=function(e,n,r){this.constants=r,this.svgRoot=e,this.svgPathDark=t.utils.dom.createSvgElement(t.utils.Svg.PATH,{class:"blocklyPathDark",transform:"translate(1,1)"},this.svgRoot),this.svgPath=t.utils.dom.createSvgElement(t.utils.Svg.PATH,{class:"blocklyPath"},this.svgRoot),this.svgPathLight=t.utils.dom.createSvgElement(t.utils.Svg.PATH,{class:"blocklyPathLight"},this.svgRoot),this.colourDark="#000000",this.style=n},t.utils.object.inherits(t.geras.PathObject,t.blockRendering.PathObject),t.geras.PathObject.prototype.setPath=function(t){this.svgPath.setAttribute("d",t),this.svgPathDark.setAttribute("d",t)},t.geras.PathObject.prototype.setHighlightPath=function(t){this.svgPathLight.setAttribute("d",t)},t.geras.PathObject.prototype.flipRTL=function(){this.svgPath.setAttribute("transform","scale(-1 1)"),this.svgPathLight.setAttribute("transform","scale(-1 1)"),this.svgPathDark.setAttribute("transform","translate(1,1) scale(-1 1)")},t.geras.PathObject.prototype.applyColour=function(e){this.svgPathLight.style.display="",this.svgPathDark.style.display="",this.svgPathLight.setAttribute("stroke",this.style.colourTertiary),this.svgPathDark.setAttribute("fill",this.colourDark),t.geras.PathObject.superClass_.applyColour.call(this,e),this.svgPath.setAttribute("stroke","none")},t.geras.PathObject.prototype.setStyle=function(e){this.style=e,this.colourDark=t.utils.colour.blend("#000",this.style.colourPrimary,.2)||this.colourDark},t.geras.PathObject.prototype.updateHighlighted=function(t){t?(this.svgPath.setAttribute("filter","url(#"+this.constants.embossFilterId+")"),this.svgPathLight.style.display="none"):(this.svgPath.setAttribute("filter","none"),this.svgPathLight.style.display="inline")},t.geras.PathObject.prototype.updateShadow_=function(t){t&&(this.svgPathLight.style.display="none",this.svgPathDark.setAttribute("fill",this.style.colourSecondary),this.svgPath.setAttribute("stroke","none"),this.svgPath.setAttribute("fill",this.style.colourSecondary))},t.geras.PathObject.prototype.updateDisabled_=function(e){t.geras.PathObject.superClass_.updateDisabled_.call(this,e),e&&this.svgPath.setAttribute("stroke","none")},t.geras.Renderer=function(e){t.geras.Renderer.superClass_.constructor.call(this,e),this.highlightConstants_=null},t.utils.object.inherits(t.geras.Renderer,t.blockRendering.Renderer),t.geras.Renderer.prototype.init=function(e,n){t.geras.Renderer.superClass_.init.call(this,e,n),this.highlightConstants_=this.makeHighlightConstants_(),this.highlightConstants_.init()},t.geras.Renderer.prototype.refreshDom=function(e,n){t.geras.Renderer.superClass_.refreshDom.call(this,e,n),this.getHighlightConstants().init()},t.geras.Renderer.prototype.makeConstants_=function(){return new t.geras.ConstantProvider},t.geras.Renderer.prototype.makeRenderInfo_=function(e){return new t.geras.RenderInfo(this,e)},t.geras.Renderer.prototype.makeDrawer_=function(e,n){return new t.geras.Drawer(e,n)},t.geras.Renderer.prototype.makePathObject=function(e,n){return new t.geras.PathObject(e,n,this.getConstants())},t.geras.Renderer.prototype.makeHighlightConstants_=function(){return new t.geras.HighlightConstantProvider(this.getConstants())},t.geras.Renderer.prototype.getHighlightConstants=function(){return this.highlightConstants_},t.blockRendering.register("geras",t.geras.Renderer),t.thrasos={},t.thrasos.RenderInfo=function(e,n){t.thrasos.RenderInfo.superClass_.constructor.call(this,e,n)},t.utils.object.inherits(t.thrasos.RenderInfo,t.blockRendering.RenderInfo),t.thrasos.RenderInfo.prototype.getRenderer=function(){return this.renderer_},t.thrasos.RenderInfo.prototype.addElemSpacing_=function(){for(var e,n=!1,r=0;e=this.rows[r];r++)e.hasExternalInput&&(n=!0);for(r=0;e=this.rows[r];r++){var i=e.elements;e.elements=[],e.startsWithElemSpacer()&&e.elements.push(new t.blockRendering.InRowSpacer(this.constants_,this.getInRowSpacing_(null,i[0])));for(var o=0;o<i.length-1;o++){e.elements.push(i[o]);var s=this.getInRowSpacing_(i[o],i[o+1]);e.elements.push(new t.blockRendering.InRowSpacer(this.constants_,s))}e.elements.push(i[i.length-1]),e.endsWithElemSpacer()&&(s=this.getInRowSpacing_(i[i.length-1],null),n&&e.hasDummyInput&&(s+=this.constants_.TAB_WIDTH),e.elements.push(new t.blockRendering.InRowSpacer(this.constants_,s)))}},t.thrasos.RenderInfo.prototype.getInRowSpacing_=function(e,n){if(!e)return n&&t.blockRendering.Types.isField(n)&&n.isEditable?this.constants_.MEDIUM_PADDING:n&&t.blockRendering.Types.isInlineInput(n)?this.constants_.MEDIUM_LARGE_PADDING:n&&t.blockRendering.Types.isStatementInput(n)?this.constants_.STATEMENT_INPUT_PADDING_LEFT:this.constants_.LARGE_PADDING;if(!t.blockRendering.Types.isInput(e)&&!n)return t.blockRendering.Types.isField(e)&&e.isEditable?this.constants_.MEDIUM_PADDING:t.blockRendering.Types.isIcon(e)?2*this.constants_.LARGE_PADDING+1:t.blockRendering.Types.isHat(e)?this.constants_.NO_PADDING:t.blockRendering.Types.isPreviousOrNextConnection(e)?this.constants_.LARGE_PADDING:t.blockRendering.Types.isLeftRoundedCorner(e)?this.constants_.MIN_BLOCK_WIDTH:t.blockRendering.Types.isJaggedEdge(e)?this.constants_.NO_PADDING:this.constants_.LARGE_PADDING;if(t.blockRendering.Types.isInput(e)&&!n){if(t.blockRendering.Types.isExternalInput(e))return this.constants_.NO_PADDING;if(t.blockRendering.Types.isInlineInput(e))return this.constants_.LARGE_PADDING;if(t.blockRendering.Types.isStatementInput(e))return this.constants_.NO_PADDING}if(!t.blockRendering.Types.isInput(e)&&n&&t.blockRendering.Types.isInput(n)){if(t.blockRendering.Types.isField(e)&&e.isEditable){if(t.blockRendering.Types.isInlineInput(n)||t.blockRendering.Types.isExternalInput(n))return this.constants_.SMALL_PADDING}else{if(t.blockRendering.Types.isInlineInput(n)||t.blockRendering.Types.isExternalInput(n))return this.constants_.MEDIUM_LARGE_PADDING;if(t.blockRendering.Types.isStatementInput(n))return this.constants_.LARGE_PADDING}return this.constants_.LARGE_PADDING-1}if(t.blockRendering.Types.isIcon(e)&&n&&!t.blockRendering.Types.isInput(n))return this.constants_.LARGE_PADDING;if(t.blockRendering.Types.isInlineInput(e)&&n&&t.blockRendering.Types.isField(n))return n.isEditable?this.constants_.MEDIUM_PADDING:this.constants_.LARGE_PADDING;if(t.blockRendering.Types.isLeftSquareCorner(e)&&n){if(t.blockRendering.Types.isHat(n))return this.constants_.NO_PADDING;if(t.blockRendering.Types.isPreviousConnection(n)||t.blockRendering.Types.isNextConnection(n))return n.notchOffset}return t.blockRendering.Types.isLeftRoundedCorner(e)&&n?n.notchOffset-this.constants_.CORNER_RADIUS:t.blockRendering.Types.isField(e)&&n&&t.blockRendering.Types.isField(n)&&e.isEditable==n.isEditable||n&&t.blockRendering.Types.isJaggedEdge(n)?this.constants_.LARGE_PADDING:this.constants_.MEDIUM_PADDING},t.thrasos.RenderInfo.prototype.getSpacerRowHeight_=function(e,n){return t.blockRendering.Types.isTopRow(e)&&t.blockRendering.Types.isBottomRow(n)?this.constants_.EMPTY_BLOCK_SPACER_HEIGHT:t.blockRendering.Types.isTopRow(e)||t.blockRendering.Types.isBottomRow(n)?this.constants_.NO_PADDING:e.hasExternalInput&&n.hasExternalInput?this.constants_.LARGE_PADDING:!e.hasStatement&&n.hasStatement?this.constants_.BETWEEN_STATEMENT_PADDING_Y:e.hasStatement&&n.hasStatement||e.hasDummyInput||n.hasDummyInput?this.constants_.LARGE_PADDING:this.constants_.MEDIUM_PADDING},t.thrasos.RenderInfo.prototype.getElemCenterline_=function(e,n){if(t.blockRendering.Types.isSpacer(n))return e.yPos+n.height/2;if(t.blockRendering.Types.isBottomRow(e))return e=e.yPos+e.height-e.descenderHeight,t.blockRendering.Types.isNextConnection(n)?e+n.height/2:e-n.height/2;if(t.blockRendering.Types.isTopRow(e))return t.blockRendering.Types.isHat(n)?e.capline-n.height/2:e.capline+n.height/2;var r=e.yPos;return t.blockRendering.Types.isField(n)&&e.hasStatement?r+(this.constants_.TALL_INPUT_FIELD_OFFSET_Y+n.height/2):r+e.height/2},t.thrasos.RenderInfo.prototype.finalize_=function(){for(var t,e=0,n=0,r=0;t=this.rows[r];r++){t.yPos=n,t.xPos=this.startX,n+=t.height,e=Math.max(e,t.widthWithConnectedBlocks);var i=n-this.topRow.ascenderHeight;t==this.bottomRow&&i<this.constants_.MIN_BLOCK_HEIGHT&&(i=this.constants_.MIN_BLOCK_HEIGHT-i,this.bottomRow.height+=i,n+=i),this.recordElemPositions_(t)}this.outputConnection&&this.block_.nextConnection&&this.block_.nextConnection.isConnected()&&(e=Math.max(e,this.block_.nextConnection.targetBlock().getHeightWidth().width)),this.bottomRow.baseline=n-this.bottomRow.descenderHeight,this.widthWithChildren=e+this.startX,this.height=n,this.startY=this.topRow.capline},t.thrasos.Renderer=function(e){t.thrasos.Renderer.superClass_.constructor.call(this,e)},t.utils.object.inherits(t.thrasos.Renderer,t.blockRendering.Renderer),t.thrasos.Renderer.prototype.makeRenderInfo_=function(e){return new t.thrasos.RenderInfo(this,e)},t.blockRendering.register("thrasos",t.thrasos.Renderer),t.zelos={},t.zelos.ConstantProvider=function(){t.zelos.ConstantProvider.superClass_.constructor.call(this),this.SMALL_PADDING=this.GRID_UNIT=4,this.MEDIUM_PADDING=2*this.GRID_UNIT,this.MEDIUM_LARGE_PADDING=3*this.GRID_UNIT,this.LARGE_PADDING=4*this.GRID_UNIT,this.CORNER_RADIUS=1*this.GRID_UNIT,this.NOTCH_WIDTH=9*this.GRID_UNIT,this.NOTCH_HEIGHT=2*this.GRID_UNIT,this.STATEMENT_INPUT_NOTCH_OFFSET=this.NOTCH_OFFSET_LEFT=3*this.GRID_UNIT,this.MIN_BLOCK_WIDTH=2*this.GRID_UNIT,this.MIN_BLOCK_HEIGHT=12*this.GRID_UNIT,this.EMPTY_STATEMENT_INPUT_HEIGHT=6*this.GRID_UNIT,this.TAB_OFFSET_FROM_TOP=0,this.TOP_ROW_MIN_HEIGHT=this.CORNER_RADIUS,this.TOP_ROW_PRECEDES_STATEMENT_MIN_HEIGHT=this.LARGE_PADDING,this.BOTTOM_ROW_MIN_HEIGHT=this.CORNER_RADIUS,this.BOTTOM_ROW_AFTER_STATEMENT_MIN_HEIGHT=6*this.GRID_UNIT,this.STATEMENT_BOTTOM_SPACER=-this.NOTCH_HEIGHT,this.STATEMENT_INPUT_SPACER_MIN_WIDTH=40*this.GRID_UNIT,this.STATEMENT_INPUT_PADDING_LEFT=4*this.GRID_UNIT,this.EMPTY_INLINE_INPUT_PADDING=4*this.GRID_UNIT,this.EMPTY_INLINE_INPUT_HEIGHT=8*this.GRID_UNIT,this.DUMMY_INPUT_MIN_HEIGHT=8*this.GRID_UNIT,this.DUMMY_INPUT_SHADOW_MIN_HEIGHT=6*this.GRID_UNIT,this.CURSOR_WS_WIDTH=20*this.GRID_UNIT,this.CURSOR_COLOUR="#ffa200",this.CURSOR_RADIUS=5,this.JAGGED_TEETH_WIDTH=this.JAGGED_TEETH_HEIGHT=0,this.START_HAT_HEIGHT=22,this.START_HAT_WIDTH=96,this.SHAPES={HEXAGONAL:1,ROUND:2,SQUARE:3,PUZZLE:4,NOTCH:5},this.SHAPE_IN_SHAPE_PADDING={1:{0:5*this.GRID_UNIT,1:2*this.GRID_UNIT,2:5*this.GRID_UNIT,3:5*this.GRID_UNIT},2:{0:3*this.GRID_UNIT,1:3*this.GRID_UNIT,2:1*this.GRID_UNIT,3:2*this.GRID_UNIT},3:{0:2*this.GRID_UNIT,1:2*this.GRID_UNIT,2:2*this.GRID_UNIT,3:2*this.GRID_UNIT}},this.FULL_BLOCK_FIELDS=!0,this.FIELD_TEXT_FONTSIZE=3*this.GRID_UNIT,this.FIELD_TEXT_FONTWEIGHT="bold",this.FIELD_TEXT_FONTFAMILY='"Helvetica Neue", "Segoe UI", Helvetica, sans-serif',this.FIELD_BORDER_RECT_RADIUS=this.CORNER_RADIUS,this.FIELD_BORDER_RECT_X_PADDING=2*this.GRID_UNIT,this.FIELD_BORDER_RECT_Y_PADDING=1.625*this.GRID_UNIT,this.FIELD_BORDER_RECT_HEIGHT=8*this.GRID_UNIT,this.FIELD_DROPDOWN_BORDER_RECT_HEIGHT=8*this.GRID_UNIT,this.FIELD_DROPDOWN_SVG_ARROW=this.FIELD_DROPDOWN_COLOURED_DIV=this.FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW=!0,this.FIELD_DROPDOWN_SVG_ARROW_PADDING=this.FIELD_BORDER_RECT_X_PADDING,this.FIELD_COLOUR_FULL_BLOCK=this.FIELD_TEXTINPUT_BOX_SHADOW=!0,this.FIELD_COLOUR_DEFAULT_WIDTH=2*this.GRID_UNIT,this.FIELD_COLOUR_DEFAULT_HEIGHT=4*this.GRID_UNIT,this.FIELD_CHECKBOX_X_OFFSET=1*this.GRID_UNIT,this.MAX_DYNAMIC_CONNECTION_SHAPE_WIDTH=12*this.GRID_UNIT,this.SELECTED_GLOW_COLOUR="#fff200",this.SELECTED_GLOW_SIZE=.5,this.REPLACEMENT_GLOW_COLOUR="#fff200",this.REPLACEMENT_GLOW_SIZE=2,this.selectedGlowFilterId="",this.selectedGlowFilter_=null,this.replacementGlowFilterId="",this.replacementGlowFilter_=null},t.utils.object.inherits(t.zelos.ConstantProvider,t.blockRendering.ConstantProvider),t.zelos.ConstantProvider.prototype.setFontConstants_=function(e){t.zelos.ConstantProvider.superClass_.setFontConstants_.call(this,e),this.FIELD_DROPDOWN_BORDER_RECT_HEIGHT=this.FIELD_BORDER_RECT_HEIGHT=this.FIELD_TEXT_HEIGHT+2*this.FIELD_BORDER_RECT_Y_PADDING},t.zelos.ConstantProvider.prototype.init=function(){t.zelos.ConstantProvider.superClass_.init.call(this),this.HEXAGONAL=this.makeHexagonal(),this.ROUNDED=this.makeRounded(),this.SQUARED=this.makeSquared(),this.STATEMENT_INPUT_NOTCH_OFFSET=this.NOTCH_OFFSET_LEFT+this.INSIDE_CORNERS.rightWidth},t.zelos.ConstantProvider.prototype.setDynamicProperties_=function(e){t.zelos.ConstantProvider.superClass_.setDynamicProperties_.call(this,e),this.SELECTED_GLOW_COLOUR=e.getComponentStyle("selectedGlowColour")||this.SELECTED_GLOW_COLOUR;var n=Number(e.getComponentStyle("selectedGlowSize"));this.SELECTED_GLOW_SIZE=n&&!isNaN(n)?n:this.SELECTED_GLOW_SIZE,this.REPLACEMENT_GLOW_COLOUR=e.getComponentStyle("replacementGlowColour")||this.REPLACEMENT_GLOW_COLOUR,this.REPLACEMENT_GLOW_SIZE=(e=Number(e.getComponentStyle("replacementGlowSize")))&&!isNaN(e)?e:this.REPLACEMENT_GLOW_SIZE},t.zelos.ConstantProvider.prototype.dispose=function(){t.zelos.ConstantProvider.superClass_.dispose.call(this),this.selectedGlowFilter_&&t.utils.dom.removeNode(this.selectedGlowFilter_),this.replacementGlowFilter_&&t.utils.dom.removeNode(this.replacementGlowFilter_)},t.zelos.ConstantProvider.prototype.makeStartHat=function(){var e=this.START_HAT_HEIGHT,n=this.START_HAT_WIDTH;return{height:e,width:n,path:t.utils.svgPaths.curve("c",[t.utils.svgPaths.point(25,-e),t.utils.svgPaths.point(71,-e),t.utils.svgPaths.point(n,0)])}},t.zelos.ConstantProvider.prototype.makeHexagonal=function(){function e(e,r,i){var o=e/2;return o=o>n?n:o,i=i?-1:1,e=(r?-1:1)*e/2,t.utils.svgPaths.lineTo(-i*o,e)+t.utils.svgPaths.lineTo(i*o,e)}var n=this.MAX_DYNAMIC_CONNECTION_SHAPE_WIDTH;return{type:this.SHAPES.HEXAGONAL,isDynamic:!0,width:function(t){return(t/=2)>n?n:t},height:function(t){return t},connectionOffsetY:function(t){return t/2},connectionOffsetX:function(t){return-t},pathDown:function(t){return e(t,!1,!1)},pathUp:function(t){return e(t,!0,!1)},pathRightDown:function(t){return e(t,!1,!0)},pathRightUp:function(t){return e(t,!1,!0)}}},t.zelos.ConstantProvider.prototype.makeRounded=function(){function e(e,n,i){var o=e>r?e-r:0;return e=(e>r?r:e)/2,t.utils.svgPaths.arc("a","0 0,1",e,t.utils.svgPaths.point((n?-1:1)*e,(n?-1:1)*e))+t.utils.svgPaths.lineOnAxis("v",(i?1:-1)*o)+t.utils.svgPaths.arc("a","0 0,1",e,t.utils.svgPaths.point((n?1:-1)*e,(n?-1:1)*e))}var n=this.MAX_DYNAMIC_CONNECTION_SHAPE_WIDTH,r=2*n;return{type:this.SHAPES.ROUND,isDynamic:!0,width:function(t){return(t/=2)>n?n:t},height:function(t){return t},connectionOffsetY:function(t){return t/2},connectionOffsetX:function(t){return-t},pathDown:function(t){return e(t,!1,!1)},pathUp:function(t){return e(t,!0,!1)},pathRightDown:function(t){return e(t,!1,!0)},pathRightUp:function(t){return e(t,!1,!0)}}},t.zelos.ConstantProvider.prototype.makeSquared=function(){function e(e,r,i){return e-=2*n,t.utils.svgPaths.arc("a","0 0,1",n,t.utils.svgPaths.point((r?-1:1)*n,(r?-1:1)*n))+t.utils.svgPaths.lineOnAxis("v",(i?1:-1)*e)+t.utils.svgPaths.arc("a","0 0,1",n,t.utils.svgPaths.point((r?1:-1)*n,(r?-1:1)*n))}var n=this.CORNER_RADIUS;return{type:this.SHAPES.SQUARE,isDynamic:!0,width:function(t){return n},height:function(t){return t},connectionOffsetY:function(t){return t/2},connectionOffsetX:function(t){return-t},pathDown:function(t){return e(t,!1,!1)},pathUp:function(t){return e(t,!0,!1)},pathRightDown:function(t){return e(t,!1,!0)},pathRightUp:function(t){return e(t,!1,!0)}}},t.zelos.ConstantProvider.prototype.shapeFor=function(e){var n=e.getCheck();switch(!n&&e.targetConnection&&(n=e.targetConnection.getCheck()),e.type){case t.connectionTypes.INPUT_VALUE:case t.connectionTypes.OUTPUT_VALUE:if(null!=(e=e.getSourceBlock().getOutputShape()))switch(e){case this.SHAPES.HEXAGONAL:return this.HEXAGONAL;case this.SHAPES.ROUND:return this.ROUNDED;case this.SHAPES.SQUARE:return this.SQUARED}return n&&-1!=n.indexOf("Boolean")?this.HEXAGONAL:n&&-1!=n.indexOf("Number")?this.ROUNDED:(n&&n.indexOf("String"),this.ROUNDED);case t.connectionTypes.PREVIOUS_STATEMENT:case t.connectionTypes.NEXT_STATEMENT:return this.NOTCH;default:throw Error("Unknown type")}},t.zelos.ConstantProvider.prototype.makeNotch=function(){function e(e){return t.utils.svgPaths.curve("c",[t.utils.svgPaths.point(e*o/2,0),t.utils.svgPaths.point(e*o*3/4,a/2),t.utils.svgPaths.point(e*o,a)])+t.utils.svgPaths.line([t.utils.svgPaths.point(e*o,s)])+t.utils.svgPaths.curve("c",[t.utils.svgPaths.point(e*o/4,a/2),t.utils.svgPaths.point(e*o/2,a),t.utils.svgPaths.point(e*o,a)])+t.utils.svgPaths.lineOnAxis("h",e*i)+t.utils.svgPaths.curve("c",[t.utils.svgPaths.point(e*o/2,0),t.utils.svgPaths.point(e*o*3/4,-a/2),t.utils.svgPaths.point(e*o,-a)])+t.utils.svgPaths.line([t.utils.svgPaths.point(e*o,-s)])+t.utils.svgPaths.curve("c",[t.utils.svgPaths.point(e*o/4,-a/2),t.utils.svgPaths.point(e*o/2,-a),t.utils.svgPaths.point(e*o,-a)])}var n=this.NOTCH_WIDTH,r=this.NOTCH_HEIGHT,i=n/3,o=i/3,s=r/2,a=s/2,l=e(1),u=e(-1);return{type:this.SHAPES.NOTCH,width:n,height:r,pathLeft:l,pathRight:u}},t.zelos.ConstantProvider.prototype.makeInsideCorners=function(){var e=this.CORNER_RADIUS,n=t.utils.svgPaths.arc("a","0 0,0",e,t.utils.svgPaths.point(-e,e)),r=t.utils.svgPaths.arc("a","0 0,1",e,t.utils.svgPaths.point(-e,e));return{width:e,height:e,pathTop:n,pathBottom:t.utils.svgPaths.arc("a","0 0,0",e,t.utils.svgPaths.point(e,e)),rightWidth:e,rightHeight:e,pathTopRight:r,pathBottomRight:t.utils.svgPaths.arc("a","0 0,1",e,t.utils.svgPaths.point(e,e))}},t.zelos.ConstantProvider.prototype.generateSecondaryColour_=function(e){return t.utils.colour.blend("#000",e,.15)||e},t.zelos.ConstantProvider.prototype.generateTertiaryColour_=function(e){return t.utils.colour.blend("#000",e,.25)||e},t.zelos.ConstantProvider.prototype.createDom=function(e,n,r){t.zelos.ConstantProvider.superClass_.createDom.call(this,e,n,r),e=t.utils.dom.createSvgElement(t.utils.Svg.DEFS,{},e),n=t.utils.dom.createSvgElement(t.utils.Svg.FILTER,{id:"blocklySelectedGlowFilter"+this.randomIdentifier,height:"160%",width:"180%",y:"-30%",x:"-40%"},e),t.utils.dom.createSvgElement(t.utils.Svg.FEGAUSSIANBLUR,{in:"SourceGraphic",stdDeviation:this.SELECTED_GLOW_SIZE},n),r=t.utils.dom.createSvgElement(t.utils.Svg.FECOMPONENTTRANSFER,{result:"outBlur"},n),t.utils.dom.createSvgElement(t.utils.Svg.FEFUNCA,{type:"table",tableValues:"0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1"},r),t.utils.dom.createSvgElement(t.utils.Svg.FEFLOOD,{"flood-color":this.SELECTED_GLOW_COLOUR,"flood-opacity":1,result:"outColor"},n),t.utils.dom.createSvgElement(t.utils.Svg.FECOMPOSITE,{in:"outColor",in2:"outBlur",operator:"in",result:"outGlow"},n),this.selectedGlowFilterId=n.id,this.selectedGlowFilter_=n,e=t.utils.dom.createSvgElement(t.utils.Svg.FILTER,{id:"blocklyReplacementGlowFilter"+this.randomIdentifier,height:"160%",width:"180%",y:"-30%",x:"-40%"},e),t.utils.dom.createSvgElement(t.utils.Svg.FEGAUSSIANBLUR,{in:"SourceGraphic",stdDeviation:this.REPLACEMENT_GLOW_SIZE},e),n=t.utils.dom.createSvgElement(t.utils.Svg.FECOMPONENTTRANSFER,{result:"outBlur"},e),t.utils.dom.createSvgElement(t.utils.Svg.FEFUNCA,{type:"table",tableValues:"0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1"},n),t.utils.dom.createSvgElement(t.utils.Svg.FEFLOOD,{"flood-color":this.REPLACEMENT_GLOW_COLOUR,"flood-opacity":1,result:"outColor"},e),t.utils.dom.createSvgElement(t.utils.Svg.FECOMPOSITE,{in:"outColor",in2:"outBlur",operator:"in",result:"outGlow"},e),t.utils.dom.createSvgElement(t.utils.Svg.FECOMPOSITE,{in:"SourceGraphic",in2:"outGlow",operator:"over"},e),this.replacementGlowFilterId=e.id,this.replacementGlowFilter_=e},t.zelos.ConstantProvider.prototype.getCSS_=function(t){return[t+" .blocklyText,",t+" .blocklyFlyoutLabelText {","font: "+this.FIELD_TEXT_FONTWEIGHT+" "+this.FIELD_TEXT_FONTSIZE+"pt "+this.FIELD_TEXT_FONTFAMILY+";","}",t+" .blocklyText {","fill: #fff;","}",t+" .blocklyNonEditableText>rect:not(.blocklyDropdownRect),",t+" .blocklyEditableText>rect:not(.blocklyDropdownRect) {","fill: "+this.FIELD_BORDER_RECT_COLOUR+";","}",t+" .blocklyNonEditableText>text,",t+" .blocklyEditableText>text,",t+" .blocklyNonEditableText>g>text,",t+" .blocklyEditableText>g>text {","fill: #575E75;","}",t+" .blocklyFlyoutLabelText {","fill: #575E75;","}",t+" .blocklyText.blocklyBubbleText {","fill: #575E75;","}",t+" .blocklyDraggable:not(.blocklyDisabled)"," .blocklyEditableText:not(.editing):hover>rect,",t+" .blocklyDraggable:not(.blocklyDisabled)"," .blocklyEditableText:not(.editing):hover>.blocklyPath {","stroke: #fff;","stroke-width: 2;","}",t+" .blocklyHtmlInput {","font-family: "+this.FIELD_TEXT_FONTFAMILY+";","font-weight: "+this.FIELD_TEXT_FONTWEIGHT+";","color: #575E75;","}",t+" .blocklyDropdownText {","fill: #fff !important;","}",t+".blocklyWidgetDiv .goog-menuitem,",t+".blocklyDropDownDiv .goog-menuitem {","font-family: "+this.FIELD_TEXT_FONTFAMILY+";","}",t+".blocklyDropDownDiv .goog-menuitem-content {","color: #fff;","}",t+" .blocklyHighlightedConnectionPath {","stroke: "+this.SELECTED_GLOW_COLOUR+";","}",t+" .blocklyDisabled > .blocklyOutlinePath {","fill: url(#blocklyDisabledPattern"+this.randomIdentifier+")","}",t+" .blocklyInsertionMarker>.blocklyPath {","fill-opacity: "+this.INSERTION_MARKER_OPACITY+";","stroke: none;","}"]},t.zelos.TopRow=function(e){t.zelos.TopRow.superClass_.constructor.call(this,e)},t.utils.object.inherits(t.zelos.TopRow,t.blockRendering.TopRow),t.zelos.TopRow.prototype.endsWithElemSpacer=function(){return!1},t.zelos.TopRow.prototype.hasLeftSquareCorner=function(t){var e=(t.hat?"cap"===t.hat:this.constants_.ADD_START_HATS)&&!t.outputConnection&&!t.previousConnection;return!!t.outputConnection||e},t.zelos.TopRow.prototype.hasRightSquareCorner=function(t){return!!t.outputConnection&&!t.statementInputCount&&!t.nextConnection},t.zelos.BottomRow=function(e){t.zelos.BottomRow.superClass_.constructor.call(this,e)},t.utils.object.inherits(t.zelos.BottomRow,t.blockRendering.BottomRow),t.zelos.BottomRow.prototype.endsWithElemSpacer=function(){return!1},t.zelos.BottomRow.prototype.hasLeftSquareCorner=function(t){return!!t.outputConnection},t.zelos.BottomRow.prototype.hasRightSquareCorner=function(t){return!!t.outputConnection&&!t.statementInputCount&&!t.nextConnection},t.zelos.RightConnectionShape=function(e){t.zelos.RightConnectionShape.superClass_.constructor.call(this,e),this.type|=t.blockRendering.Types.getType("RIGHT_CONNECTION"),this.width=this.height=0},t.utils.object.inherits(t.zelos.RightConnectionShape,t.blockRendering.Measurable),t.zelos.RenderInfo=function(e,n){t.zelos.RenderInfo.superClass_.constructor.call(this,e,n),this.topRow=new t.zelos.TopRow(this.constants_),this.bottomRow=new t.zelos.BottomRow(this.constants_),this.isInline=!0,this.isMultiRow=!n.getInputsInline()||n.isCollapsed(),this.hasStatementInput=0<n.statementInputCount,this.rightSide=this.outputConnection?new t.zelos.RightConnectionShape(this.constants_):null},t.utils.object.inherits(t.zelos.RenderInfo,t.blockRendering.RenderInfo),t.zelos.RenderInfo.prototype.getRenderer=function(){return this.renderer_},t.zelos.RenderInfo.prototype.measure=function(){this.createRows_(),this.addElemSpacing_(),this.addRowSpacing_(),this.adjustXPosition_(),this.computeBounds_(),this.alignRowElements_(),this.finalize_()},t.zelos.RenderInfo.prototype.shouldStartNewRow_=function(e,n){return!!n&&(e.type==t.inputTypes.STATEMENT||n.type==t.inputTypes.STATEMENT||(e.type==t.inputTypes.VALUE||e.type==t.inputTypes.DUMMY)&&(!this.isInline||this.isMultiRow))},t.zelos.RenderInfo.prototype.getDesiredRowWidth_=function(e){return e.hasStatement?this.width-this.startX-(this.constants_.INSIDE_CORNERS.rightWidth||0):t.zelos.RenderInfo.superClass_.getDesiredRowWidth_.call(this,e)},t.zelos.RenderInfo.prototype.getInRowSpacing_=function(e,n){return e&&n||!this.outputConnection||!this.outputConnection.isDynamicShape||this.hasStatementInput||this.bottomRow.hasNextConnection?!e&&n&&t.blockRendering.Types.isStatementInput(n)?this.constants_.STATEMENT_INPUT_PADDING_LEFT:e&&t.blockRendering.Types.isLeftRoundedCorner(e)&&n&&(t.blockRendering.Types.isPreviousConnection(n)||t.blockRendering.Types.isNextConnection(n))?n.notchOffset-this.constants_.CORNER_RADIUS:e&&t.blockRendering.Types.isLeftSquareCorner(e)&&n&&t.blockRendering.Types.isHat(n)?this.constants_.NO_PADDING:this.constants_.MEDIUM_PADDING:this.constants_.NO_PADDING},t.zelos.RenderInfo.prototype.getSpacerRowHeight_=function(e,n){if(t.blockRendering.Types.isTopRow(e)&&t.blockRendering.Types.isBottomRow(n))return this.constants_.EMPTY_BLOCK_SPACER_HEIGHT;var r=t.blockRendering.Types.isInputRow(e)&&e.hasStatement,i=t.blockRendering.Types.isInputRow(n)&&n.hasStatement;return i||r?(e=Math.max(this.constants_.NOTCH_HEIGHT,this.constants_.INSIDE_CORNERS.rightHeight||0),i&&r?Math.max(e,this.constants_.DUMMY_INPUT_MIN_HEIGHT):e):t.blockRendering.Types.isTopRow(e)?e.hasPreviousConnection||this.outputConnection&&!this.hasStatementInput?this.constants_.NO_PADDING:Math.abs(this.constants_.NOTCH_HEIGHT-this.constants_.CORNER_RADIUS):t.blockRendering.Types.isBottomRow(n)?this.outputConnection?!n.hasNextConnection&&this.hasStatementInput?Math.abs(this.constants_.NOTCH_HEIGHT-this.constants_.CORNER_RADIUS):this.constants_.NO_PADDING:Math.max(this.topRow.minHeight,Math.max(this.constants_.NOTCH_HEIGHT,this.constants_.CORNER_RADIUS))-this.constants_.CORNER_RADIUS:this.constants_.MEDIUM_PADDING},t.zelos.RenderInfo.prototype.getSpacerRowWidth_=function(e,n){var r=this.width-this.startX;return t.blockRendering.Types.isInputRow(e)&&e.hasStatement||t.blockRendering.Types.isInputRow(n)&&n.hasStatement?Math.max(r,this.constants_.STATEMENT_INPUT_SPACER_MIN_WIDTH):r},t.zelos.RenderInfo.prototype.getElemCenterline_=function(e,n){if(e.hasStatement&&!t.blockRendering.Types.isSpacer(n)&&!t.blockRendering.Types.isStatementInput(n))return e.yPos+this.constants_.EMPTY_STATEMENT_INPUT_HEIGHT/2;if(t.blockRendering.Types.isInlineInput(n)){var r=n.connectedBlock;if(r&&r.outputConnection&&r.nextConnection)return e.yPos+r.height/2}return t.zelos.RenderInfo.superClass_.getElemCenterline_.call(this,e,n)},t.zelos.RenderInfo.prototype.addInput_=function(e,n){e.type==t.inputTypes.DUMMY&&n.hasDummyInput&&n.align==t.constants.ALIGN.LEFT&&e.align==t.constants.ALIGN.RIGHT&&(n.rightAlignedDummyInput=e),t.zelos.RenderInfo.superClass_.addInput_.call(this,e,n)},t.zelos.RenderInfo.prototype.addAlignmentPadding_=function(e,n){if(e.rightAlignedDummyInput){for(var r,i,o=0;(i=e.elements[o])&&(t.blockRendering.Types.isSpacer(i)&&(r=i),!t.blockRendering.Types.isField(i)||i.parentInput!=e.rightAlignedDummyInput);o++);if(r)return r.width+=n,void(e.width+=n)}t.zelos.RenderInfo.superClass_.addAlignmentPadding_.call(this,e,n)},t.zelos.RenderInfo.prototype.adjustXPosition_=function(){for(var e=this.constants_.NOTCH_OFFSET_LEFT+this.constants_.NOTCH_WIDTH,n=e,r=2;r<this.rows.length-1;r+=2){var i=this.rows[r-1],o=this.rows[r],s=this.rows[r+1];if(i=2==r?!!this.topRow.hasPreviousConnection:!!i.followsStatement,s=r+2>=this.rows.length-1?!!this.bottomRow.hasNextConnection:!!s.precedesStatement,t.blockRendering.Types.isInputRow(o)&&o.hasStatement)o.measure(),n=o.width-o.getLastInput().width+e;else if(i&&(2==r||s)&&t.blockRendering.Types.isInputRow(o)&&!o.hasStatement){s=o.xPos,i=null;for(var a,l=0;a=o.elements[l];l++)t.blockRendering.Types.isSpacer(a)&&(i=a),!(i&&(t.blockRendering.Types.isField(a)||t.blockRendering.Types.isInput(a))&&s<n)||t.blockRendering.Types.isField(a)&&(a.field instanceof t.FieldLabel||a.field instanceof t.FieldImage)||(i.width+=n-s),s+=a.width}}},t.zelos.RenderInfo.prototype.finalizeOutputConnection_=function(){if(this.outputConnection&&this.outputConnection.isDynamicShape){for(var t,e=0,n=0;t=this.rows[n];n++)t.yPos=e,e+=t.height;this.height=e,n=this.bottomRow.hasNextConnection?this.height-this.bottomRow.descenderHeight:this.height,e=this.outputConnection.shape.height(n),n=this.outputConnection.shape.width(n),this.outputConnection.height=e,this.outputConnection.width=n,this.outputConnection.startX=n,this.outputConnection.connectionOffsetY=this.outputConnection.shape.connectionOffsetY(e),this.outputConnection.connectionOffsetX=this.outputConnection.shape.connectionOffsetX(n),t=0,this.hasStatementInput||this.bottomRow.hasNextConnection||(t=n,this.rightSide.height=e,this.rightSide.width=t,this.rightSide.centerline=e/2,this.rightSide.xPos=this.width+t),this.startX=n,this.width+=n+t,this.widthWithChildren+=n+t}},t.zelos.RenderInfo.prototype.finalizeHorizontalAlignment_=function(){if(this.outputConnection&&!this.hasStatementInput&&!this.bottomRow.hasNextConnection){for(var e,n=0,r=0;e=this.rows[r];r++)if(t.blockRendering.Types.isInputRow(e)){n=e.elements[e.elements.length-2];var i=this.getNegativeSpacing_(e.elements[1]),o=this.getNegativeSpacing_(n);n=i+o;var s=this.constants_.MIN_BLOCK_WIDTH+2*this.outputConnection.width;this.width-n<s&&(i=(n=this.width-s)/2,o=n/2),e.elements.unshift(new t.blockRendering.InRowSpacer(this.constants_,-i)),e.elements.push(new t.blockRendering.InRowSpacer(this.constants_,-o))}if(n)for(this.width-=n,this.widthWithChildren-=n,this.rightSide.xPos-=n,r=0;e=this.rows[r];r++)t.blockRendering.Types.isTopOrBottomRow(e)&&(e.elements[1].width-=n,e.elements[1].widthWithConnectedBlocks-=n),e.width-=n,e.widthWithConnectedBlocks-=n}},t.zelos.RenderInfo.prototype.getNegativeSpacing_=function(e){if(!e)return 0;var n=this.outputConnection.width,r=this.outputConnection.shape.type,i=this.constants_;if(this.isMultiRow&&1<this.inputRows.length)switch(r){case i.SHAPES.ROUND:return r=this.constants_.MAX_DYNAMIC_CONNECTION_SHAPE_WIDTH,n-(r=this.height/2>r?r:this.height/2)*(1-Math.sin(Math.acos((r-this.constants_.SMALL_PADDING)/r)));default:return 0}if(t.blockRendering.Types.isInlineInput(e)){var o=e.connectedBlock;return e=o?o.pathObject.outputShapeType:e.shape.type,o&&o.outputConnection&&(o.statementInputCount||o.nextConnection)||r==i.SHAPES.HEXAGONAL&&r!=e?0:n-this.constants_.SHAPE_IN_SHAPE_PADDING[r][e]}return t.blockRendering.Types.isField(e)?r==i.SHAPES.ROUND&&e.field instanceof t.FieldTextInput?n-2.75*i.GRID_UNIT:n-this.constants_.SHAPE_IN_SHAPE_PADDING[r][0]:t.blockRendering.Types.isIcon(e)?this.constants_.SMALL_PADDING:0},t.zelos.RenderInfo.prototype.finalizeVerticalAlignment_=function(){if(!this.outputConnection)for(var e=2;e<this.rows.length-1;e+=2){var n=this.rows[e-1],r=this.rows[e],i=this.rows[e+1],o=2==e,s=e+2>=this.rows.length-1?!!this.bottomRow.hasNextConnection:!!i.precedesStatement;if(o?this.topRow.hasPreviousConnection:n.followsStatement){var a=3==r.elements.length&&(r.elements[1].field instanceof t.FieldLabel||r.elements[1].field instanceof t.FieldImage);if(!o&&a)n.height-=this.constants_.SMALL_PADDING,i.height-=this.constants_.SMALL_PADDING,r.height-=this.constants_.MEDIUM_PADDING;else if(o||s){if(s){for(o=!1,s=0;a=r.elements[s];s++)if(t.blockRendering.Types.isInlineInput(a)&&a.connectedBlock&&!a.connectedBlock.isShadow()&&40<=a.connectedBlock.getHeightWidth().height){o=!0;break}o&&(n.height-=this.constants_.SMALL_PADDING,i.height-=this.constants_.SMALL_PADDING)}}else n.height+=this.constants_.SMALL_PADDING}}},t.zelos.RenderInfo.prototype.finalize_=function(){this.finalizeOutputConnection_(),this.finalizeHorizontalAlignment_(),this.finalizeVerticalAlignment_(),t.zelos.RenderInfo.superClass_.finalize_.call(this),this.rightSide&&(this.widthWithChildren+=this.rightSide.width)},t.zelos.Drawer=function(e,n){t.zelos.Drawer.superClass_.constructor.call(this,e,n)},t.utils.object.inherits(t.zelos.Drawer,t.blockRendering.Drawer),t.zelos.Drawer.prototype.draw=function(){var e=this.block_.pathObject;e.beginDrawing(),this.hideHiddenIcons_(),this.drawOutline_(),this.drawInternals_(),e.setPath(this.outlinePath_+"\n"+this.inlinePath_),this.info_.RTL&&e.flipRTL(),t.blockRendering.useDebugger&&this.block_.renderingDebugger.drawDebug(this.block_,this.info_),this.recordSizeOnBlock_(),this.info_.outputConnection&&(e.outputShapeType=this.info_.outputConnection.shape.type),e.endDrawing()},t.zelos.Drawer.prototype.drawOutline_=function(){this.info_.outputConnection&&this.info_.outputConnection.isDynamicShape&&!this.info_.hasStatementInput&&!this.info_.bottomRow.hasNextConnection?(this.drawFlatTop_(),this.drawRightDynamicConnection_(),this.drawFlatBottom_(),this.drawLeftDynamicConnection_()):t.zelos.Drawer.superClass_.drawOutline_.call(this)},t.zelos.Drawer.prototype.drawLeft_=function(){this.info_.outputConnection&&this.info_.outputConnection.isDynamicShape?this.drawLeftDynamicConnection_():t.zelos.Drawer.superClass_.drawLeft_.call(this)},t.zelos.Drawer.prototype.drawRightSideRow_=function(e){if(!(0>=e.height))if(e.precedesStatement||e.followsStatement){var n=this.constants_.INSIDE_CORNERS.rightHeight;n=e.height-(e.precedesStatement?n:0),this.outlinePath_+=(e.followsStatement?this.constants_.INSIDE_CORNERS.pathBottomRight:"")+(0<n?t.utils.svgPaths.lineOnAxis("V",e.yPos+n):"")+(e.precedesStatement?this.constants_.INSIDE_CORNERS.pathTopRight:"")}else this.outlinePath_+=t.utils.svgPaths.lineOnAxis("V",e.yPos+e.height)},t.zelos.Drawer.prototype.drawRightDynamicConnection_=function(){this.outlinePath_+=this.info_.outputConnection.shape.pathRightDown(this.info_.outputConnection.height)},t.zelos.Drawer.prototype.drawLeftDynamicConnection_=function(){this.positionOutputConnection_(),this.outlinePath_+=this.info_.outputConnection.shape.pathUp(this.info_.outputConnection.height),this.outlinePath_+="z"},t.zelos.Drawer.prototype.drawFlatTop_=function(){var e=this.info_.topRow;this.positionPreviousConnection_(),this.outlinePath_+=t.utils.svgPaths.moveBy(e.xPos,this.info_.startY),this.outlinePath_+=t.utils.svgPaths.lineOnAxis("h",e.width)},t.zelos.Drawer.prototype.drawFlatBottom_=function(){var e=this.info_.bottomRow;this.positionNextConnection_(),this.outlinePath_+=t.utils.svgPaths.lineOnAxis("V",e.baseline),this.outlinePath_+=t.utils.svgPaths.lineOnAxis("h",-e.width)},t.zelos.Drawer.prototype.drawInlineInput_=function(e){this.positionInlineInputConnection_(e);var n=e.input.name;if(!e.connectedBlock&&!this.info_.isInsertionMarker){var r=e.width-2*e.connectionWidth;e=t.utils.svgPaths.moveTo(e.xPos+e.connectionWidth,e.centerline-e.height/2)+t.utils.svgPaths.lineOnAxis("h",r)+e.shape.pathRightDown(e.height)+t.utils.svgPaths.lineOnAxis("h",-r)+e.shape.pathUp(e.height)+"z",this.block_.pathObject.setOutlinePath(n,e)}},t.zelos.Drawer.prototype.drawStatementInput_=function(e){var n=e.getLastInput(),r=n.xPos+n.notchOffset+n.shape.width,i=n.shape.pathRight+t.utils.svgPaths.lineOnAxis("h",-(n.notchOffset-this.constants_.INSIDE_CORNERS.width))+this.constants_.INSIDE_CORNERS.pathTop,o=e.height-2*this.constants_.INSIDE_CORNERS.height;n=this.constants_.INSIDE_CORNERS.pathBottom+t.utils.svgPaths.lineOnAxis("h",n.notchOffset-this.constants_.INSIDE_CORNERS.width)+(n.connectedBottomNextConnection?"":n.shape.pathLeft),this.outlinePath_+=t.utils.svgPaths.lineOnAxis("H",r)+i+t.utils.svgPaths.lineOnAxis("v",o)+n+t.utils.svgPaths.lineOnAxis("H",e.xPos+e.width),this.positionStatementInputConnection_(e)},t.zelos.MarkerSvg=function(e,n,r){t.zelos.MarkerSvg.superClass_.constructor.call(this,e,n,r)},t.utils.object.inherits(t.zelos.MarkerSvg,t.blockRendering.MarkerSvg),t.zelos.MarkerSvg.prototype.showWithInputOutput_=function(t){var e=t.getSourceBlock();t=t.getLocation().getOffsetInBlock(),this.positionCircle_(t.x,t.y),this.setParent_(e),this.showCurrent_()},t.zelos.MarkerSvg.prototype.showWithOutput_=function(t){this.showWithInputOutput_(t)},t.zelos.MarkerSvg.prototype.showWithInput_=function(t){this.showWithInputOutput_(t)},t.zelos.MarkerSvg.prototype.showWithBlock_=function(t){var e=(t=t.getLocation()).getHeightWidth();this.positionRect_(0,0,e.width,e.height),this.setParent_(t),this.showCurrent_()},t.zelos.MarkerSvg.prototype.positionCircle_=function(t,e){this.markerCircle_.setAttribute("cx",t),this.markerCircle_.setAttribute("cy",e),this.currentMarkerSvg=this.markerCircle_},t.zelos.MarkerSvg.prototype.hide=function(){t.zelos.MarkerSvg.superClass_.hide.call(this),this.markerCircle_.style.display="none"},t.zelos.MarkerSvg.prototype.createDomInternal_=function(){if(t.zelos.MarkerSvg.superClass_.createDomInternal_.call(this),this.markerCircle_=t.utils.dom.createSvgElement(t.utils.Svg.CIRCLE,{r:this.constants_.CURSOR_RADIUS,style:"display: none","stroke-width":this.constants_.CURSOR_STROKE_WIDTH},this.markerSvg_),this.isCursor()){var e=this.getBlinkProperties_();t.utils.dom.createSvgElement(t.utils.Svg.ANIMATE,e,this.markerCircle_)}return this.markerSvg_},t.zelos.MarkerSvg.prototype.applyColour_=function(e){t.zelos.MarkerSvg.superClass_.applyColour_.call(this,e),this.markerCircle_.setAttribute("fill",this.colour_),this.markerCircle_.setAttribute("stroke",this.colour_),this.isCursor()&&this.markerCircle_.firstChild.setAttribute("values",this.colour_+";transparent;transparent;")},t.zelos.PathObject=function(e,n,r){t.zelos.PathObject.superClass_.constructor.call(this,e,n,r),this.constants=r,this.svgPathSelected_=null,this.outlines_=Object.create(null),this.outputShapeType=this.remainingOutlines_=null},t.utils.object.inherits(t.zelos.PathObject,t.blockRendering.PathObject),t.zelos.PathObject.prototype.setPath=function(e){t.zelos.PathObject.superClass_.setPath.call(this,e),this.svgPathSelected_&&this.svgPathSelected_.setAttribute("d",e)},t.zelos.PathObject.prototype.applyColour=function(e){for(var n in t.zelos.PathObject.superClass_.applyColour.call(this,e),e.isShadow()&&e.getParent()&&this.svgPath.setAttribute("stroke",e.getParent().style.colourTertiary),this.outlines_)this.outlines_[n].setAttribute("fill",this.style.colourTertiary)},t.zelos.PathObject.prototype.flipRTL=function(){for(var e in t.zelos.PathObject.superClass_.flipRTL.call(this),this.outlines_)this.outlines_[e].setAttribute("transform","scale(-1 1)")},t.zelos.PathObject.prototype.updateSelected=function(t){this.setClass_("blocklySelected",t),t?this.svgPathSelected_||(this.svgPathSelected_=this.svgPath.cloneNode(!0),this.svgPathSelected_.setAttribute("fill","none"),this.svgPathSelected_.setAttribute("filter","url(#"+this.constants.selectedGlowFilterId+")"),this.svgRoot.appendChild(this.svgPathSelected_)):this.svgPathSelected_&&(this.svgRoot.removeChild(this.svgPathSelected_),this.svgPathSelected_=null)},t.zelos.PathObject.prototype.updateReplacementFade=function(t){this.setClass_("blocklyReplaceable",t),t?this.svgPath.setAttribute("filter","url(#"+this.constants.replacementGlowFilterId+")"):this.svgPath.removeAttribute("filter")},t.zelos.PathObject.prototype.updateShapeForInputHighlight=function(t,e){t=t.getParentInput().name,(t=this.getOutlinePath_(t))&&(e?t.setAttribute("filter","url(#"+this.constants.replacementGlowFilterId+")"):t.removeAttribute("filter"))},t.zelos.PathObject.prototype.beginDrawing=function(){for(var t in this.remainingOutlines_=Object.create(null),this.outlines_)this.remainingOutlines_[t]=1},t.zelos.PathObject.prototype.endDrawing=function(){if(this.remainingOutlines_)for(var t in this.remainingOutlines_)this.removeOutlinePath_(t);this.remainingOutlines_=null},t.zelos.PathObject.prototype.setOutlinePath=function(t,e){(t=this.getOutlinePath_(t)).setAttribute("d",e),t.setAttribute("fill",this.style.colourTertiary)},t.zelos.PathObject.prototype.getOutlinePath_=function(e){return this.outlines_[e]||(this.outlines_[e]=t.utils.dom.createSvgElement(t.utils.Svg.PATH,{class:"blocklyOutlinePath",d:""},this.svgRoot)),this.remainingOutlines_&&delete this.remainingOutlines_[e],this.outlines_[e]},t.zelos.PathObject.prototype.removeOutlinePath_=function(t){this.outlines_[t].parentNode.removeChild(this.outlines_[t]),delete this.outlines_[t]},t.zelos.Renderer=function(e){t.zelos.Renderer.superClass_.constructor.call(this,e)},t.utils.object.inherits(t.zelos.Renderer,t.blockRendering.Renderer),t.zelos.Renderer.prototype.makeConstants_=function(){return new t.zelos.ConstantProvider},t.zelos.Renderer.prototype.makeRenderInfo_=function(e){return new t.zelos.RenderInfo(this,e)},t.zelos.Renderer.prototype.makeDrawer_=function(e,n){return new t.zelos.Drawer(e,n)},t.zelos.Renderer.prototype.makeMarkerDrawer=function(e,n){return new t.zelos.MarkerSvg(e,this.getConstants(),n)},t.zelos.Renderer.prototype.makePathObject=function(e,n){return new t.zelos.PathObject(e,n,this.getConstants())},t.zelos.Renderer.prototype.shouldHighlightConnection=function(e){return e.type!=t.connectionTypes.INPUT_VALUE&&e.type!==t.connectionTypes.OUTPUT_VALUE},t.zelos.Renderer.prototype.getConnectionPreviewMethod=function(e,n,r){return n.type==t.connectionTypes.OUTPUT_VALUE?e.isConnected()?t.InsertionMarkerManager.PREVIEW_TYPE.REPLACEMENT_FADE:t.InsertionMarkerManager.PREVIEW_TYPE.INPUT_OUTLINE:t.zelos.Renderer.superClass_.getConnectionPreviewMethod(e,n,r)},t.blockRendering.register("zelos",t.zelos.Renderer),t.Themes.Dark=t.Theme.defineTheme("dark",{base:t.Themes.Classic,componentStyles:{workspaceBackgroundColour:"#1e1e1e",toolboxBackgroundColour:"blackBackground",toolboxForegroundColour:"#fff",flyoutBackgroundColour:"#252526",flyoutForegroundColour:"#ccc",flyoutOpacity:1,scrollbarColour:"#797979",insertionMarkerColour:"#fff",insertionMarkerOpacity:.3,scrollbarOpacity:.4,cursorColour:"#d0d0d0",blackBackground:"#333"}}),t.Themes.Deuteranopia={},t.Themes.Deuteranopia.defaultBlockStyles={colour_blocks:{colourPrimary:"#f2a72c",colourSecondary:"#f1c172",colourTertiary:"#da921c"},list_blocks:{colourPrimary:"#7d65ab",colourSecondary:"#a88be0",colourTertiary:"#66518e"},logic_blocks:{colourPrimary:"#9fd2f1",colourSecondary:"#c0e0f4",colourTertiary:"#74bae5"},loop_blocks:{colourPrimary:"#795a07",colourSecondary:"#ac8726",colourTertiary:"#c4a03f"},math_blocks:{colourPrimary:"#e6da39",colourSecondary:"#f3ec8e",colourTertiary:"#f2eeb7"},procedure_blocks:{colourPrimary:"#590721",colourSecondary:"#8c475d",colourTertiary:"#885464"},text_blocks:{colourPrimary:"#058863",colourSecondary:"#5ecfaf",colourTertiary:"#04684c"},variable_blocks:{colourPrimary:"#47025a",colourSecondary:"#820fa1",colourTertiary:"#8e579d"},variable_dynamic_blocks:{colourPrimary:"#47025a",colourSecondary:"#820fa1",colourTertiary:"#8e579d"}},t.Themes.Deuteranopia.categoryStyles={colour_category:{colour:"#f2a72c"},list_category:{colour:"#7d65ab"},logic_category:{colour:"#9fd2f1"},loop_category:{colour:"#795a07"},math_category:{colour:"#e6da39"},procedure_category:{colour:"#590721"},text_category:{colour:"#058863"},variable_category:{colour:"#47025a"},variable_dynamic_category:{colour:"#47025a"}},t.Themes.Deuteranopia=new t.Theme("deuteranopia",t.Themes.Deuteranopia.defaultBlockStyles,t.Themes.Deuteranopia.categoryStyles),t.Themes.HighContrast={},t.Themes.HighContrast.defaultBlockStyles={colour_blocks:{colourPrimary:"#a52714",colourSecondary:"#FB9B8C",colourTertiary:"#FBE1DD"},list_blocks:{colourPrimary:"#4a148c",colourSecondary:"#AD7BE9",colourTertiary:"#CDB6E9"},logic_blocks:{colourPrimary:"#01579b",colourSecondary:"#64C7FF",colourTertiary:"#C5EAFF"},loop_blocks:{colourPrimary:"#33691e",colourSecondary:"#9AFF78",colourTertiary:"#E1FFD7"},math_blocks:{colourPrimary:"#1a237e",colourSecondary:"#8A9EFF",colourTertiary:"#DCE2FF"},procedure_blocks:{colourPrimary:"#006064",colourSecondary:"#77E6EE",colourTertiary:"#CFECEE"},text_blocks:{colourPrimary:"#004d40",colourSecondary:"#5ae27c",colourTertiary:"#D2FFDD"},variable_blocks:{colourPrimary:"#880e4f",colourSecondary:"#FF73BE",colourTertiary:"#FFD4EB"},variable_dynamic_blocks:{colourPrimary:"#880e4f",colourSecondary:"#FF73BE",colourTertiary:"#FFD4EB"},hat_blocks:{colourPrimary:"#880e4f",colourSecondary:"#FF73BE",colourTertiary:"#FFD4EB",hat:"cap"}},t.Themes.HighContrast.categoryStyles={colour_category:{colour:"#a52714"},list_category:{colour:"#4a148c"},logic_category:{colour:"#01579b"},loop_category:{colour:"#33691e"},math_category:{colour:"#1a237e"},procedure_category:{colour:"#006064"},text_category:{colour:"#004d40"},variable_category:{colour:"#880e4f"},variable_dynamic_category:{colour:"#880e4f"}},t.Themes.HighContrast=new t.Theme("highcontrast",t.Themes.HighContrast.defaultBlockStyles,t.Themes.HighContrast.categoryStyles),t.Themes.HighContrast.setComponentStyle("selectedGlowColour","#000000"),t.Themes.HighContrast.setComponentStyle("selectedGlowSize",1),t.Themes.HighContrast.setComponentStyle("replacementGlowColour","#000000"),t.Themes.HighContrast.setFontStyle({family:null,weight:null,size:16}),t.Themes.Tritanopia={},t.Themes.Tritanopia.defaultBlockStyles={colour_blocks:{colourPrimary:"#05427f",colourSecondary:"#2974c0",colourTertiary:"#2d74bb"},list_blocks:{colourPrimary:"#b69ce8",colourSecondary:"#ccbaef",colourTertiary:"#9176c5"},logic_blocks:{colourPrimary:"#9fd2f1",colourSecondary:"#c0e0f4",colourTertiary:"#74bae5"},loop_blocks:{colourPrimary:"#aa1846",colourSecondary:"#d36185",colourTertiary:"#7c1636"},math_blocks:{colourPrimary:"#e6da39",colourSecondary:"#f3ec8e",colourTertiary:"#f2eeb7"},procedure_blocks:{colourPrimary:"#590721",colourSecondary:"#8c475d",colourTertiary:"#885464"},text_blocks:{colourPrimary:"#058863",colourSecondary:"#5ecfaf",colourTertiary:"#04684c"},variable_blocks:{colourPrimary:"#4b2d84",colourSecondary:"#816ea7",colourTertiary:"#83759e"},variable_dynamic_blocks:{colourPrimary:"#4b2d84",colourSecondary:"#816ea7",colourTertiary:"#83759e"}},t.Themes.Tritanopia.categoryStyles={colour_category:{colour:"#05427f"},list_category:{colour:"#b69ce8"},logic_category:{colour:"#9fd2f1"},loop_category:{colour:"#aa1846"},math_category:{colour:"#e6da39"},procedure_category:{colour:"#590721"},text_category:{colour:"#058863"},variable_category:{colour:"#4b2d84"},variable_dynamic_category:{colour:"#4b2d84"}},t.Themes.Tritanopia=new t.Theme("tritanopia",t.Themes.Tritanopia.defaultBlockStyles,t.Themes.Tritanopia.categoryStyles),t.requires={},t})?r.apply(e,i):r)||(t.exports=o)}).call(e,n("DuR2"))},GGfn:function(t,e,n){"use strict";(function(t){e.f=async function(t,e){const n=[],r=[],i=Array.isArray(t)?t.map(t=>t.name):Object.keys(t);for(let o=0;o<i.length;++o){const s=i[o],l=Array.isArray(t)?t[o].tensor:t[s];if("float32"!==l.dtype&&"int32"!==l.dtype&&"bool"!==l.dtype&&"string"!==l.dtype&&"complex64"!==l.dtype)throw new Error(`Unsupported dtype in weight '${s}': ${l.dtype}`);const u={name:s,shape:l.shape,dtype:l.dtype};if("string"===l.dtype){const t=new Promise(async t=>{const e=await l.bytes(),n=e.reduce((t,e)=>t+e.length,0)+a*e.length,r=new Uint8Array(n);let i=0;for(let t=0;t<e.length;t++){const n=e[t],o=new Uint8Array(new Uint32Array([n.length]).buffer);r.set(o,i),i+=a,r.set(n,i),i+=n.length}t(r)});r.push(t)}else r.push(l.data());null!=e&&(u.group=e),n.push(u)}return{data:function(t){if(null===t)throw new Error(`Invalid input value: ${JSON.stringify(t)}`);let e=0;const n=[];t.forEach(t=>{if(e+=t.byteLength,n.push(t.byteLength===t.buffer.byteLength?t:new t.constructor(t)),!(t instanceof Float32Array||t instanceof Int32Array||t instanceof Uint8Array))throw new Error(`Unsupported TypedArray subtype: ${t.constructor.name}`)});const r=new Uint8Array(e);let i=0;return n.forEach(t=>{r.set(new Uint8Array(t.buffer),i),i+=t.byteLength}),r.buffer}(await Promise.all(r)),specs:n}},e.e=function(t,e){const n={};let l,u=0;for(const h of e){const e=h.name,d=h.dtype,p=h.shape,f=Object(o.sizeFromShape)(p);let g;if("quantization"in h){const n=h.quantization;if("uint8"===n.dtype||"uint16"===n.dtype){if(!("min"in n&&"scale"in n))throw new Error(`Weight ${h.name} with quantization ${n.dtype} `+"doesn't have corresponding metadata min and scale.")}else{if("float16"!==n.dtype)throw new Error(`Weight ${h.name} has unknown `+`quantization dtype ${n.dtype}. `+"Supported quantization dtypes are: 'uint8', 'uint16', and 'float16'.");if("float32"!==d)throw new Error(`Weight ${h.name} is quantized with ${n.dtype} `+`which only supports weights of type float32 not ${d}.`)}const r=s.a[n.dtype],i=t.slice(u,u+f*r),o="uint8"===n.dtype?new Uint8Array(i):new Uint16Array(i);if("float32"===d)if("uint8"===n.dtype||"uint16"===n.dtype){g=new Float32Array(o.length);for(let t=0;t<o.length;t++){const e=o[t];g[t]=e*n.scale+n.min}}else{if("float16"!==n.dtype)throw new Error(`Unsupported quantization type ${n.dtype} `+"for weight type float32.");void 0===l&&(l=c()),g=l(o)}else{if("int32"!==d)throw new Error(`Unsupported dtype in weight '${e}': ${d}`);if("uint8"!==n.dtype&&"uint16"!==n.dtype)throw new Error(`Unsupported quantization type ${n.dtype} `+"for weight type int32.");g=new Int32Array(o.length);for(let t=0;t<o.length;t++){const e=o[t];g[t]=Math.round(e*n.scale+n.min)}}u+=f*r}else if("string"===d){const e=Object(o.sizeFromShape)(h.shape);g=[];for(let n=0;n<e;n++){const e=new Uint32Array(t.slice(u,u+a))[0];u+=a;const n=new Uint8Array(t.slice(u,u+e));g.push(n),u+=e}}else{const o=s.a[d],a=t.slice(u,u+f*o);if("float32"===d)g=new Float32Array(a);else if("int32"===d)g=new Int32Array(a);else if("bool"===d)g=new Uint8Array(a);else{if("complex64"!==d)throw new Error(`Unsupported dtype in weight '${e}': ${d}`);{g=new Float32Array(a);const t=new Float32Array(g.length/2),o=new Float32Array(g.length/2);for(let e=0;e<t.length;e++)t[e]=g[2*e],o[e]=g[2*e+1];const s=Object(i.a)(t,p,"float32"),l=Object(i.a)(o,p,"float32");n[e]=Object(r.a)(s,l),s.dispose(),l.dispose()}}u+=f*o}"complex64"!==d&&(n[e]=Object(i.a)(g,p,d))}return n},e.a=function(e){if(l)return t.from(e).toString("base64");const n=new Uint8Array(e);let r="";for(let t=0,e=n.length;t<e;t++)r+=String.fromCharCode(n[t]);return btoa(r)},e.b=function(e){if(l){const n=t.from(e,"base64");return n.buffer.slice(n.byteOffset,n.byteOffset+n.byteLength)}const n=atob(e),r=new Uint8Array(n.length);for(let t=0;t<n.length;++t)r.set([n.charCodeAt(t)],t);return r.buffer},e.d=function(t){if(1===t.length)return t[0];let e=0;t.forEach(t=>{e+=t.byteLength});const n=new Uint8Array(e);let r=0;return t.forEach(t=>{n.set(new Uint8Array(t),r),r+=t.byteLength}),n.buffer},e.c=function(t){t=t.trim();for(;t.endsWith("/");)t=t.slice(0,t.length-1);const e=t.split("/");return e[e.length-1]},e.i=function(t,e){const n={modelTopology:t.modelTopology,format:t.format,generatedBy:t.generatedBy,convertedBy:t.convertedBy,weightsManifest:e};null!=t.signature&&(n.signature=t.signature);null!=t.userDefinedMetadata&&(n.userDefinedMetadata=t.userDefinedMetadata);null!=t.modelInitializer&&(n.modelInitializer=t.modelInitializer);null!=t.trainingConfig&&(n.trainingConfig=t.trainingConfig);return n},e.g=async function(t,e){const n={modelTopology:t.modelTopology,format:t.format,generatedBy:t.generatedBy,convertedBy:t.convertedBy};null!=t.trainingConfig&&(n.trainingConfig=t.trainingConfig);if(null!=t.weightsManifest){const[r,i]=await e(t.weightsManifest);n.weightSpecs=r,n.weightData=i}null!=t.signature&&(n.signature=t.signature);null!=t.userDefinedMetadata&&(n.userDefinedMetadata=t.userDefinedMetadata);null!=t.modelInitializer&&(n.modelInitializer=t.modelInitializer);return n},e.h=function(t){if(t.modelTopology instanceof ArrayBuffer)throw new Error("Expected JSON model topology, received ArrayBuffer.");return{dateSaved:new Date,modelTopologyType:"JSON",modelTopologyBytes:null==t.modelTopology?0:u(JSON.stringify(t.modelTopology)),weightSpecsBytes:null==t.weightSpecs?0:u(JSON.stringify(t.weightSpecs)),weightDataBytes:null==t.weightData?0:t.weightData.byteLength}};var r=n("rQ0i"),i=n("gHp0"),o=n("XFvI"),s=n("T3Fu");
  330. /**
  331. * @license
  332. * Copyright 2018 Google LLC. All Rights Reserved.
  333. * Licensed under the Apache License, Version 2.0 (the "License");
  334. * you may not use this file except in compliance with the License.
  335. * You may obtain a copy of the License at
  336. *
  337. * http://www.apache.org/licenses/LICENSE-2.0
  338. *
  339. * Unless required by applicable law or agreed to in writing, software
  340. * distributed under the License is distributed on an "AS IS" BASIS,
  341. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  342. * See the License for the specific language governing permissions and
  343. * limitations under the License.
  344. * =============================================================================
  345. */
  346. const a=4;const l=void 0!==t&&("undefined"==typeof Blob||"undefined"==typeof atob||"undefined"==typeof btoa);function u(e){return l?t.byteLength(e):new Blob([e]).size}function c(){const t=function(){const t=t=>{let e=t<<13,n=0;for(;0==(8388608&e);)n-=8388608,e<<=1;return(e&=-8388609)|(n+=947912704)},e=new Uint32Array(2048);e[0]=0;for(let n=1;n<1024;n++)e[n]=t(n);for(let t=1024;t<2048;t++)e[t]=939524096+(t-1024<<13);return e}(),e=function(){const t=new Uint32Array(64);t[0]=0,t[31]=1199570944,t[32]=2147483648,t[63]=3347054592;for(let e=1;e<31;e++)t[e]=e<<23;for(let e=33;e<63;e++)t[e]=2147483648+(e-32<<23);return t}(),n=function(){const t=new Uint32Array(64);for(let e=0;e<64;e++)t[e]=1024;return t[0]=t[32]=0,t}();return r=>{const i=new ArrayBuffer(4*r.length),o=new Uint32Array(i);for(let i=0;i<r.length;i++){const s=r[i],a=t[n[s>>10]+(1023&s)]+e[s>>10];o[i]=a}return new Float32Array(i)}}}).call(e,n("EuP9").Buffer)},GHBc:function(t,e,n){"use strict";var r=n("cGG2");t.exports=r.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function i(t){var r=t;return e&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return t=i(window.location.href),function(e){var n=r.isString(e)?i(e):e;return n.protocol===t.protocol&&n.host===t.host}}():function(){return!0}},GegP:function(t,e){t.exports=function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/dist/",n(n.s=117)}({0:function(t,e,n){"use strict";function r(t,e,n,r,i,o,s,a){var l,u="function"==typeof t?t.options:t;if(e&&(u.render=e,u.staticRenderFns=n,u._compiled=!0),r&&(u.functional=!0),o&&(u._scopeId="data-v-"+o),s?(l=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(s)},u._ssrRegister=l):i&&(l=a?function(){i.call(this,this.$root.$options.shadowRoot)}:i),l)if(u.functional){u._injectStyles=l;var c=u.render;u.render=function(t,e){return l.call(e),c(t,e)}}else{var h=u.beforeCreate;u.beforeCreate=h?[].concat(h,l):[l]}return{exports:t,options:u}}n.d(e,"a",function(){return r})},117:function(t,e,n){"use strict";n.r(e);var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"el-progress",class:["el-progress--"+t.type,t.status?"is-"+t.status:"",{"el-progress--without-text":!t.showText,"el-progress--text-inside":t.textInside}],attrs:{role:"progressbar","aria-valuenow":t.percentage,"aria-valuemin":"0","aria-valuemax":"100"}},["line"===t.type?n("div",{staticClass:"el-progress-bar"},[n("div",{staticClass:"el-progress-bar__outer",style:{height:t.strokeWidth+"px"}},[n("div",{staticClass:"el-progress-bar__inner",style:t.barStyle},[t.showText&&t.textInside?n("div",{staticClass:"el-progress-bar__innerText"},[t._v(t._s(t.content))]):t._e()])])]):n("div",{staticClass:"el-progress-circle",style:{height:t.width+"px",width:t.width+"px"}},[n("svg",{attrs:{viewBox:"0 0 100 100"}},[n("path",{staticClass:"el-progress-circle__track",style:t.trailPathStyle,attrs:{d:t.trackPath,stroke:"#e5e9f2","stroke-width":t.relativeStrokeWidth,fill:"none"}}),n("path",{staticClass:"el-progress-circle__path",style:t.circlePathStyle,attrs:{d:t.trackPath,stroke:t.stroke,fill:"none","stroke-linecap":t.strokeLinecap,"stroke-width":t.percentage?t.relativeStrokeWidth:0}})])]),t.showText&&!t.textInside?n("div",{staticClass:"el-progress__text",style:{fontSize:t.progressTextSize+"px"}},[t.status?n("i",{class:t.iconClass}):[t._v(t._s(t.content))]],2):t._e()])};r._withStripped=!0;var i={name:"ElProgress",props:{type:{type:String,default:"line",validator:function(t){return["line","circle","dashboard"].indexOf(t)>-1}},percentage:{type:Number,default:0,required:!0,validator:function(t){return t>=0&&t<=100}},status:{type:String,validator:function(t){return["success","exception","warning"].indexOf(t)>-1}},strokeWidth:{type:Number,default:6},strokeLinecap:{type:String,default:"round"},textInside:{type:Boolean,default:!1},width:{type:Number,default:126},showText:{type:Boolean,default:!0},color:{type:[String,Array,Function],default:""},format:Function},computed:{barStyle:function(){var t={};return t.width=this.percentage+"%",t.backgroundColor=this.getCurrentColor(this.percentage),t},relativeStrokeWidth:function(){return(this.strokeWidth/this.width*100).toFixed(1)},radius:function(){return"circle"===this.type||"dashboard"===this.type?parseInt(50-parseFloat(this.relativeStrokeWidth)/2,10):0},trackPath:function(){var t=this.radius,e="dashboard"===this.type;return"\n M 50 50\n m 0 "+(e?"":"-")+t+"\n a "+t+" "+t+" 0 1 1 0 "+(e?"-":"")+2*t+"\n a "+t+" "+t+" 0 1 1 0 "+(e?"":"-")+2*t+"\n "},perimeter:function(){return 2*Math.PI*this.radius},rate:function(){return"dashboard"===this.type?.75:1},strokeDashoffset:function(){return-1*this.perimeter*(1-this.rate)/2+"px"},trailPathStyle:function(){return{strokeDasharray:this.perimeter*this.rate+"px, "+this.perimeter+"px",strokeDashoffset:this.strokeDashoffset}},circlePathStyle:function(){return{strokeDasharray:this.perimeter*this.rate*(this.percentage/100)+"px, "+this.perimeter+"px",strokeDashoffset:this.strokeDashoffset,transition:"stroke-dasharray 0.6s ease 0s, stroke 0.6s ease"}},stroke:function(){var t=void 0;if(this.color)t=this.getCurrentColor(this.percentage);else switch(this.status){case"success":t="#13ce66";break;case"exception":t="#ff4949";break;case"warning":t="#e6a23c";break;default:t="#20a0ff"}return t},iconClass:function(){return"warning"===this.status?"el-icon-warning":"line"===this.type?"success"===this.status?"el-icon-circle-check":"el-icon-circle-close":"success"===this.status?"el-icon-check":"el-icon-close"},progressTextSize:function(){return"line"===this.type?12+.4*this.strokeWidth:.111111*this.width+2},content:function(){return"function"==typeof this.format?this.format(this.percentage)||"":this.percentage+"%"}},methods:{getCurrentColor:function(t){return"function"==typeof this.color?this.color(t):"string"==typeof this.color?this.color:this.getLevelColor(t)},getLevelColor:function(t){for(var e=this.getColorArray().sort(function(t,e){return t.percentage-e.percentage}),n=0;n<e.length;n++)if(e[n].percentage>t)return e[n].color;return e[e.length-1].color},getColorArray:function(){var t=this.color,e=100/t.length;return t.map(function(t,n){return"string"==typeof t?{color:t,percentage:(n+1)*e}:t})}}},o=n(0),s=Object(o.a)(i,r,[],!1,null,null,null);s.options.__file="packages/progress/src/progress.vue";var a=s.exports;a.install=function(t){t.component(a.name,a)};e.default=a}})},Gqr1:function(t,e,n){var r;r=function(t){return t.pad.Iso97971={pad:function(e,n){e.concat(t.lib.WordArray.create([2147483648],1)),t.pad.ZeroPadding.pad(e,n)},unpad:function(e){t.pad.ZeroPadding.unpad(e),e.sigBytes--}},t.pad.Iso97971},t.exports=r(n("02Hb"),n("fGru"))},GtxA:function(t,e,n){"use strict";var r=n("Kkag"),i=n("l5jf"),o=n("xMQ1"),s=n("35G1");const a=Object(s.a)({reshape_:
  347. /**
  348. * @license
  349. * Copyright 2020 Google LLC. All Rights Reserved.
  350. * Licensed under the Apache License, Version 2.0 (the "License");
  351. * you may not use this file except in compliance with the License.
  352. * You may obtain a copy of the License at
  353. *
  354. * http://www.apache.org/licenses/LICENSE-2.0
  355. *
  356. * Unless required by applicable law or agreed to in writing, software
  357. * distributed under the License is distributed on an "AS IS" BASIS,
  358. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  359. * See the License for the specific language governing permissions and
  360. * limitations under the License.
  361. * =============================================================================
  362. */
  363. function(t,e){const n={x:Object(o.a)(t,"x","reshape","string_or_numeric")},s={shape:e};return r.a.runKernel(i._63,n,s)}});e.a=a},Gu7T:function(t,e,n){"use strict";e.__esModule=!0;var r,i=n("c/Tr"),o=(r=i)&&r.__esModule?r:{default:r};e.default=function(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return(0,o.default)(t)}},"H/Ud":function(t,e,n){var r=n("VOQS"),i=n("di0+"),o=n("i+52"),s=n("fzqA"),a=n("9g4f"),l=n("4dK1"),u=n("p//t");u.alea=r,u.xor128=i,u.xorwow=o,u.xorshift7=s,u.xor4096=a,u.tychei=l,t.exports=u},H8dH:function(t,e,n){"use strict";e.__esModule=!0,e.default=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:300,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!t||!e)throw new Error("instance & callback is required");var i=!1,o=function(){i||(i=!0,e&&e.apply(null,arguments))};r?t.$once("after-leave",o):t.$on("after-leave",o),setTimeout(function(){o()},n+100)}},H9Ud:function(t,e,n){"use strict";var r={};n.d(r,"isTensor",function(){return u}),n.d(r,"isTensor1D",function(){return c}),n.d(r,"isTensor2D",function(){return h}),n.d(r,"isTensor3D",function(){return d}),n.d(r,"isTensor4D",function(){return p}),n.d(r,"isFloat",function(){return f}),n.d(r,"isEven",function(){return g}),n.d(r,"round",function(){return m}),n.d(r,"isDimensions",function(){return v}),n.d(r,"computeReshapedDimensions",function(){return b}),n.d(r,"getCenterPoint",function(){return _}),n.d(r,"range",function(){return y}),n.d(r,"isValidNumber",function(){return T}),n.d(r,"isValidProbablitiy",function(){return x});var i={};n.d(i,"drawContour",function(){return s}),n.d(i,"drawDetections",function(){return lt}),n.d(i,"drawFaceExpressions",function(){return te}),n.d(i,"DrawBoxOptions",function(){return st}),n.d(i,"DrawBox",function(){return at}),n.d(i,"DrawFaceLandmarksOptions",function(){return re}),n.d(i,"DrawFaceLandmarks",function(){return ie}),n.d(i,"drawFaceLandmarks",function(){return oe}),n.d(i,"AnchorPosition",function(){return tt}),n.d(i,"DrawTextFieldOptions",function(){return it}),n.d(i,"DrawTextField",function(){return ot});var o=n("pSAl");function s(t,e,n){if(void 0===n&&(n=!1),t.beginPath(),e.slice(1).forEach(function(n,r){var i=n.x,o=n.y,s=e[r];t.moveTo(s.x,s.y),t.lineTo(i,o)}),n){var r=e[e.length-1],i=e[0];if(!r||!i)return;t.moveTo(r.x,r.y),t.lineTo(i.x,i.y)}t.stroke()}var a=n("TToO"),l=function(){function t(t,e){if(!T(t)||!T(e))throw new Error("Dimensions.constructor - expected width and height to be valid numbers, instead have "+JSON.stringify({width:t,height:e}));this._width=t,this._height=e}return Object.defineProperty(t.prototype,"width",{get:function(){return this._width},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this._height},enumerable:!0,configurable:!0}),t.prototype.reverse=function(){return new t(1/this.width,1/this.height)},t}();function u(t,e){return t instanceof o.a&&t.shape.length===e}function c(t){return u(t,1)}function h(t){return u(t,2)}function d(t){return u(t,3)}function p(t){return u(t,4)}function f(t){return t%1!=0}function g(t){return t%2==0}function m(t,e){void 0===e&&(e=2);var n=Math.pow(10,e);return Math.floor(t*n)/n}function v(t){return t&&t.width&&t.height}function b(t,e){var n=t.width,r=t.height,i=e/Math.max(r,n);return new l(Math.round(n*i),Math.round(r*i))}function _(t){return t.reduce(function(t,e){return t.add(e)},new E(0,0)).div(new E(t.length,t.length))}function y(t,e,n){return Array(t).fill(0).map(function(t,r){return e+r*n})}function T(t){return!!t&&t!==1/0&&t!==-1/0&&!isNaN(t)||0===t}function x(t){return T(t)&&0<=t&&t<=1}var E=function(){function t(t,e){this._x=t,this._y=e}return Object.defineProperty(t.prototype,"x",{get:function(){return this._x},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this._y},enumerable:!0,configurable:!0}),t.prototype.add=function(e){return new t(this.x+e.x,this.y+e.y)},t.prototype.sub=function(e){return new t(this.x-e.x,this.y-e.y)},t.prototype.mul=function(e){return new t(this.x*e.x,this.y*e.y)},t.prototype.div=function(e){return new t(this.x/e.x,this.y/e.y)},t.prototype.abs=function(){return new t(Math.abs(this.x),Math.abs(this.y))},t.prototype.magnitude=function(){return Math.sqrt(Math.pow(this.x,2)+Math.pow(this.y,2))},t.prototype.floor=function(){return new t(Math.floor(this.x),Math.floor(this.y))},t}(),w=function(){function t(e,n){void 0===n&&(n=!0);var r=e||{},i=[r.left,r.top,r.right,r.bottom].every(T),o=[r.x,r.y,r.width,r.height].every(T);if(!o&&!i)throw new Error("Box.constructor - expected box to be IBoundingBox | IRect, instead have "+JSON.stringify(r));var s=o?[r.x,r.y,r.width,r.height]:[r.left,r.top,r.right-r.left,r.bottom-r.top],a=s[0],l=s[1],u=s[2],c=s[3];t.assertIsValidBox({x:a,y:l,width:u,height:c},"Box.constructor",n),this._x=a,this._y=l,this._width=u,this._height=c}return t.isRect=function(t){return!!t&&[t.x,t.y,t.width,t.height].every(T)},t.assertIsValidBox=function(e,n,r){if(void 0===r&&(r=!1),!t.isRect(e))throw new Error(n+" - invalid box: "+JSON.stringify(e)+", expected object with properties x, y, width, height");if(!r&&(e.width<0||e.height<0))throw new Error(n+" - width ("+e.width+") and height ("+e.height+") must be positive numbers")},Object.defineProperty(t.prototype,"x",{get:function(){return this._x},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this._y},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this._width},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this._height},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"left",{get:function(){return this.x},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return this.y},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this.x+this.width},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"area",{get:function(){return this.width*this.height},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"topLeft",{get:function(){return new E(this.left,this.top)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"topRight",{get:function(){return new E(this.right,this.top)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"bottomLeft",{get:function(){return new E(this.left,this.bottom)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"bottomRight",{get:function(){return new E(this.right,this.bottom)},enumerable:!0,configurable:!0}),t.prototype.round=function(){var e=[this.x,this.y,this.width,this.height].map(function(t){return Math.round(t)});return new t({x:e[0],y:e[1],width:e[2],height:e[3]})},t.prototype.floor=function(){var e=[this.x,this.y,this.width,this.height].map(function(t){return Math.floor(t)});return new t({x:e[0],y:e[1],width:e[2],height:e[3]})},t.prototype.toSquare=function(){var e=this.x,n=this.y,r=this.width,i=this.height,o=Math.abs(r-i);return r<i&&(e-=o/2,r+=o),i<r&&(n-=o/2,i+=o),new t({x:e,y:n,width:r,height:i})},t.prototype.rescale=function(e){var n=v(e)?e.width:e,r=v(e)?e.height:e;return new t({x:this.x*n,y:this.y*r,width:this.width*n,height:this.height*r})},t.prototype.pad=function(e,n){var r=[this.x-e/2,this.y-n/2,this.width+e,this.height+n];return new t({x:r[0],y:r[1],width:r[2],height:r[3]})},t.prototype.clipAtImageBorders=function(e,n){var r=this.x,i=this.y,o=this.right,s=this.bottom,a=Math.max(r,0),l=Math.max(i,0),u=o-a,c=s-l;return new t({x:a,y:l,width:Math.min(u,e-a),height:Math.min(c,n-l)}).floor()},t.prototype.shift=function(e,n){var r=this.width,i=this.height;return new t({x:this.x+e,y:this.y+n,width:r,height:i})},t.prototype.padAtBorders=function(t,e){var n=this.width+1,r=this.height+1,i=n,o=r,s=this.left,a=this.top,l=this.right,u=this.bottom;return l>e&&(i=-l+e+n,l=e),u>t&&(o=-u+t+r,u=t),s<1&&(o=2-s,s=1),a<1&&(o=2-a,a=1),{dy:1,edy:o,dx:1,edx:i,y:a,ey:u,x:s,ex:l,w:n,h:r}},t.prototype.calibrate=function(e){return new t({left:this.left+e.left*this.width,top:this.top+e.top*this.height,right:this.right+e.right*this.width,bottom:this.bottom+e.bottom*this.height}).toSquare().round()},t}(),C=function(t){function e(e,n,r,i,o){return void 0===o&&(o=!1),t.call(this,{left:e,top:n,right:r,bottom:i},o)||this}return Object(a.c)(e,t),e}(w),S=function(){function t(t,e,n,r,i){this._imageDims=new l(i.width,i.height),this._score=t,this._classScore=e,this._className=n,this._box=new w(r).rescale(this._imageDims)}return Object.defineProperty(t.prototype,"score",{get:function(){return this._score},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"classScore",{get:function(){return this._classScore},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"className",{get:function(){return this._className},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"box",{get:function(){return this._box},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"imageDims",{get:function(){return this._imageDims},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"imageWidth",{get:function(){return this.imageDims.width},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"imageHeight",{get:function(){return this.imageDims.height},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"relativeBox",{get:function(){return new w(this._box).rescale(this.imageDims.reverse())},enumerable:!0,configurable:!0}),t.prototype.forSize=function(e,n){return new t(this.score,this.classScore,this.className,this.relativeBox,{width:e,height:n})},t}(),k=function(t){function e(e,n,r){return t.call(this,e,e,"",n,r)||this}return Object(a.c)(e,t),e.prototype.forSize=function(n,r){var i=t.prototype.forSize.call(this,n,r);return new e(i.score,i.relativeBox,i.imageDims)},e}(S);function O(t,e,n){void 0===n&&(n=!0);var r=Math.max(0,Math.min(t.right,e.right)-Math.max(t.left,e.left))*Math.max(0,Math.min(t.bottom,e.bottom)-Math.max(t.top,e.top));return n?r/(t.area+e.area-r):r/Math.min(t.area,e.area)}function I(t){var e=t.map(function(t){return t.x}),n=t.map(function(t){return t.y}),r=e.reduce(function(t,e){return e<t?e:t},1/0),i=n.reduce(function(t,e){return e<t?e:t},1/0),o=e.reduce(function(t,e){return t<e?e:t},0),s=n.reduce(function(t,e){return t<e?e:t},0);return new C(r,i,o,s)}function R(t,e,n,r){void 0===r&&(r=!0);for(var i=e.map(function(t,e){return{score:t,boxIndex:e}}).sort(function(t,e){return t.score-e.score}).map(function(t){return t.boxIndex}),o=[],s=function(){var e=i.pop();o.push(e);for(var s=i,a=[],l=0;l<s.length;l++){var u=s[l],c=t[e],h=t[u];a.push(O(c,h,r))}i=i.filter(function(t,e){return a[e]<=n})};i.length>0;)s();return o}function A(t,e){return o.L(function(){var n=e[0],r=e[1],i=e[2],s=o.n(Object(a.e)(t.shape.slice(0,3),[1]),n),l=o.n(Object(a.e)(t.shape.slice(0,3),[1]),r),u=o.n(Object(a.e)(t.shape.slice(0,3),[1]),i),c=o.h([s,l,u],3);return o.F(t,c)})}function N(t,e){return void 0===e&&(e=!1),o.L(function(){var n=t.shape.slice(1),r=n[0],i=n[1];if(r===i)return t;var s=Math.abs(r-i),a=Math.round(s*(e?.5:1)),l=r>i?2:1,u=function(e){var n=t.shape.slice();return n[l]=e,o.n(n,0)},c=u(a),h=s-c.shape[l],d=[e&&h?u(h):null,t,c].filter(function(t){return!!t}).map(function(t){return t.toFloat()});return o.h(d,l)})}function D(t){for(var e=t.slice(),n=e.length-1;n>0;n--){var r=Math.floor(Math.random()*(n+1)),i=e[n];e[n]=e[r],e[r]=i}return e}function M(t){return 1/(1+Math.exp(-t))}function L(t){return Math.log(t/(1-t))}var P=function(t){function e(e,n,r,i,o){return void 0===o&&(o=!1),t.call(this,{x:e,y:n,width:r,height:i},o)||this}return Object(a.c)(e,t),e}(w),F=function(){function t(t,e,n){void 0===n&&(n=new E(0,0));var r=e.width,i=e.height;this._imgDims=new l(r,i),this._shift=n,this._positions=t.map(function(t){return t.mul(new E(r,i)).add(n)})}return Object.defineProperty(t.prototype,"shift",{get:function(){return new E(this._shift.x,this._shift.y)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"imageWidth",{get:function(){return this._imgDims.width},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"imageHeight",{get:function(){return this._imgDims.height},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"positions",{get:function(){return this._positions},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"relativePositions",{get:function(){var t=this;return this._positions.map(function(e){return e.sub(t._shift).div(new E(t.imageWidth,t.imageHeight))})},enumerable:!0,configurable:!0}),t.prototype.forSize=function(t,e){return new this.constructor(this.relativePositions,{width:t,height:e})},t.prototype.shiftBy=function(t,e){return new this.constructor(this.relativePositions,this._imgDims,new E(t,e))},t.prototype.shiftByPoint=function(t){return this.shiftBy(t.x,t.y)},t.prototype.align=function(t,e){if(void 0===e&&(e={}),t){var n=t instanceof k?t.box.floor():new w(t);return this.shiftBy(n.x,n.y).align(null,e)}var r=Object.assign({},{useDlibAlignment:!1,minBoxPadding:.2},e),i=r.useDlibAlignment,o=r.minBoxPadding;return i?this.alignDlib():this.alignMinBbox(o)},t.prototype.alignDlib=function(){var t=this.getRefPointsForAlignment(),e=t[0],n=t[1],r=t[2],i=function(t){return r.sub(t).magnitude()},o=(i(e)+i(n))/2,s=Math.floor(o/.45),a=_(t),l=Math.floor(Math.max(0,a.x-.5*s)),u=Math.floor(Math.max(0,a.y-.43*s));return new P(l,u,Math.min(s,this.imageWidth+l),Math.min(s,this.imageHeight+u))},t.prototype.alignMinBbox=function(t){var e=I(this.positions);return e.pad(e.width*t,e.height*t)},t.prototype.getRefPointsForAlignment=function(){throw new Error("getRefPointsForAlignment not implemented by base class")},t}(),B=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(a.c)(e,t),e.prototype.getRefPointsForAlignment=function(){var t=this.positions;return[t[0],t[1],_([t[3],t[4]])]},e}(F),j=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(a.c)(e,t),e.prototype.getJawOutline=function(){return this.positions.slice(0,17)},e.prototype.getLeftEyeBrow=function(){return this.positions.slice(17,22)},e.prototype.getRightEyeBrow=function(){return this.positions.slice(22,27)},e.prototype.getNose=function(){return this.positions.slice(27,36)},e.prototype.getLeftEye=function(){return this.positions.slice(36,42)},e.prototype.getRightEye=function(){return this.positions.slice(42,48)},e.prototype.getMouth=function(){return this.positions.slice(48,68)},e.prototype.getRefPointsForAlignment=function(){return[this.getLeftEye(),this.getRightEye(),this.getMouth()].map(_)},e}(F),$=function(){function t(t,e){this._label=t,this._distance=e}return Object.defineProperty(t.prototype,"label",{get:function(){return this._label},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"distance",{get:function(){return this._distance},enumerable:!0,configurable:!0}),t.prototype.toString=function(t){return void 0===t&&(t=!0),this.label+(t?" ("+m(this.distance)+")":"")},t}(),U=function(t){function e(e,n){var r=t.call(this,e)||this;return r._label=n,r}return Object(a.c)(e,t),e.assertIsValidLabeledBox=function(t,e){if(w.assertIsValidBox(t,e),!T(t.label))throw new Error(e+" - expected property label ("+t.label+") to be a number")},Object.defineProperty(e.prototype,"label",{get:function(){return this._label},enumerable:!0,configurable:!0}),e}(w),V=function(){function t(t,e){if("string"!=typeof t)throw new Error("LabeledFaceDescriptors - constructor expected label to be a string");if(!Array.isArray(e)||e.some(function(t){return!(t instanceof Float32Array)}))throw new Error("LabeledFaceDescriptors - constructor expected descriptors to be an array of Float32Array");this._label=t,this._descriptors=e}return Object.defineProperty(t.prototype,"label",{get:function(){return this._label},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"descriptors",{get:function(){return this._descriptors},enumerable:!0,configurable:!0}),t.prototype.toJSON=function(){return{label:this.label,descriptors:this.descriptors.map(function(t){return Array.from(t)})}},t.fromJSON=function(e){var n=e.descriptors.map(function(t){return new Float32Array(t)});return new t(e.label,n)},t}(),H=function(t){function e(e,n,r,i){var o=t.call(this,e,n)||this;return o._score=r,o._classScore=i,o}return Object(a.c)(e,t),e.assertIsValidPredictedBox=function(t,e){if(U.assertIsValidLabeledBox(t,e),!x(t.score)||!x(t.classScore))throw new Error(e+" - expected properties score ("+t.score+") and ("+t.classScore+") to be a number between [0, 1]")},Object.defineProperty(e.prototype,"score",{get:function(){return this._score},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"classScore",{get:function(){return this._classScore},enumerable:!0,configurable:!0}),e}(U);function W(t){return t.detection instanceof k}function G(t,e){var n={detection:e};return Object.assign({},t,n)}function z(){var t=window.fetch||function(){throw new Error("fetch - missing fetch implementation for browser environment")};return{Canvas:HTMLCanvasElement,CanvasRenderingContext2D:CanvasRenderingContext2D,Image:HTMLImageElement,ImageData:ImageData,Video:HTMLVideoElement,createCanvasElement:function(){return document.createElement("canvas")},createImageElement:function(){return document.createElement("img")},fetch:t,readFile:function(){throw new Error("readFile - filesystem not available for browser environment")}}}var X=n("pcbz"),K=n("dxT3");function Y(){return"object"==typeof window&&"undefined"!=typeof document&&"undefined"!=typeof HTMLImageElement&&"undefined"!=typeof HTMLCanvasElement&&"undefined"!=typeof HTMLVideoElement&&"undefined"!=typeof ImageData&&"undefined"!=typeof CanvasRenderingContext2D}var q,J=n("iMyp");function Z(t){q=t}function Q(){Y()&&Z(z()),Object(J.a)()&&Z(Object(K.a)())}var tt,et={getEnv:function(){if(!q)throw new Error("getEnv - environment is not defined, check isNodejs() and isBrowser()");return q},setEnv:Z,initialize:Q,createBrowserEnv:z,createFileSystem:X.a,createNodejsEnv:K.a,monkeyPatch:function(t){if(q||Q(),!q)throw new Error("monkeyPatch - environment is not defined, check isNodejs() and isBrowser()");var e=t.Canvas,n=void 0===e?q.Canvas:e,r=t.Image,i=void 0===r?q.Image:r;q.Canvas=n,q.Image=i,q.createCanvasElement=t.createCanvasElement||function(){return new n},q.createImageElement=t.createImageElement||function(){return new i},q.ImageData=t.ImageData||q.ImageData,q.Video=t.Video||q.Video,q.fetch=t.fetch||q.fetch,q.readFile=t.readFile||q.readFile},isBrowser:Y,isNodejs:J.a};function nt(t){return et.isNodejs()||"string"!=typeof t?t:document.getElementById(t)}function rt(t){var e=et.getEnv(),n=e.Canvas;if(t instanceof e.CanvasRenderingContext2D)return t;var r=nt(t);if(!(r instanceof n))throw new Error("resolveContext2d - expected canvas to be of instance of Canvas");var i=r.getContext("2d");if(!i)throw new Error("resolveContext2d - canvas 2d context is null");return i}Q(),function(t){t.TOP_LEFT="TOP_LEFT",t.TOP_RIGHT="TOP_RIGHT",t.BOTTOM_LEFT="BOTTOM_LEFT",t.BOTTOM_RIGHT="BOTTOM_RIGHT"}(tt||(tt={}));var it=function(){return function(t){void 0===t&&(t={});var e=t.anchorPosition,n=t.backgroundColor,r=t.fontColor,i=t.fontSize,o=t.fontStyle,s=t.padding;this.anchorPosition=e||tt.TOP_LEFT,this.backgroundColor=n||"rgba(0, 0, 0, 0.5)",this.fontColor=r||"rgba(255, 255, 255, 1)",this.fontSize=i||14,this.fontStyle=o||"Georgia",this.padding=s||4}}(),ot=function(){function t(e,n,r){void 0===r&&(r={}),this.text="string"==typeof e?[e]:e instanceof t?e.text:e,this.anchor=n,this.options=new it(r)}return t.prototype.measureWidth=function(t){var e=this.options.padding;return this.text.map(function(e){return t.measureText(e).width}).reduce(function(t,e){return t<e?e:t},0)+2*e},t.prototype.measureHeight=function(){var t=this.options,e=t.fontSize,n=t.padding;return this.text.length*e+2*n},t.prototype.getUpperLeft=function(t,e){var n=this.options.anchorPosition,r=n===tt.BOTTOM_RIGHT||n===tt.TOP_RIGHT,i=n===tt.BOTTOM_LEFT||n===tt.BOTTOM_RIGHT,o=this.measureWidth(t),s=this.measureHeight(),a=r?this.anchor.x-o:this.anchor.x,l=i?this.anchor.y-s:this.anchor.y;if(e){var u=e.width,c=e.height;return{x:Math.max(Math.min(a,u-o),0),y:Math.max(Math.min(l,c-s),0)}}return{x:a,y:l}},t.prototype.draw=function(t){var e=nt(t),n=rt(e),r=this.options,i=r.backgroundColor,o=r.fontColor,s=r.fontSize,a=r.fontStyle,l=r.padding;n.font=s+"px "+a;var u=this.measureWidth(n),c=this.measureHeight();n.fillStyle=i;var h=this.getUpperLeft(n,e);n.fillRect(h.x,h.y,u,c),n.fillStyle=o,this.text.forEach(function(t,e){var r=l+h.x,i=l+h.y+(e+1)*s;n.fillText(t,r,i)})},t}(),st=function(){return function(t){void 0===t&&(t={});var e=t.boxColor,n=t.lineWidth,r=t.label,i=t.drawLabelOptions;this.boxColor=e||"rgba(0, 0, 255, 1)",this.lineWidth=n||2,this.label=r;var o={anchorPosition:tt.BOTTOM_LEFT,backgroundColor:this.boxColor};this.drawLabelOptions=new it(Object.assign({},o,i))}}(),at=function(){function t(t,e){void 0===e&&(e={}),this.box=new w(t),this.options=new st(e)}return t.prototype.draw=function(t){var e=rt(t),n=this.options,r=n.boxColor,i=n.lineWidth,o=this.box,s=o.x,a=o.y,l=o.width,u=o.height;e.strokeStyle=r,e.lineWidth=i,e.strokeRect(s,a,l,u);var c=this.options.label;c&&new ot([c],{x:s-i/2,y:a},this.options.drawLabelOptions).draw(t)},t}();function lt(t,e){(Array.isArray(e)?e:[e]).forEach(function(e){var n=e instanceof k?e.score:W(e)?e.detection.score:void 0,r=e instanceof k?e.box:W(e)?e.detection.box:new w(e),i=n?""+m(n):void 0;new at(r,{label:i}).draw(t)})}function ut(t){var e=et.getEnv(),n=e.Image,r=e.Video;return t instanceof n&&t.complete||t instanceof r&&t.readyState>=3}function ct(t){return new Promise(function(e,n){if(t instanceof et.getEnv().Canvas||ut(t))return e();function r(t){t.currentTarget&&(t.currentTarget.removeEventListener("load",r),t.currentTarget.removeEventListener("error",i),e(t))}function i(t){t.currentTarget&&(t.currentTarget.removeEventListener("load",r),t.currentTarget.removeEventListener("error",i),n(t))}t.addEventListener("load",r),t.addEventListener("error",i)})}function ht(t){return new Promise(function(e,n){if(!(t instanceof Blob))return n("bufferToImage - expected buf to be of type: Blob");var r=new FileReader;r.onload=function(){if("string"!=typeof r.result)return n("bufferToImage - expected reader.result to be a string, in onload");var t=et.getEnv().createImageElement();t.onload=function(){return e(t)},t.onerror=n,t.src=r.result},r.onerror=n,r.readAsDataURL(t)})}function dt(t){var e=et.getEnv(),n=e.Image,r=e.Video;return t instanceof n?new l(t.naturalWidth,t.naturalHeight):t instanceof r?new l(t.videoWidth,t.videoHeight):new l(t.width,t.height)}function pt(t){var e=t.width,n=t.height,r=(0,et.getEnv().createCanvasElement)();return r.width=e,r.height=n,r}function ft(t,e){var n=et.getEnv().ImageData;if(!(t instanceof n||ut(t)))throw new Error("createCanvasFromMedia - media has not finished loading yet");var r=e||dt(t),i=r.width,o=r.height,s=pt({width:i,height:o});return t instanceof n?rt(s).putImageData(t,0,0):rt(s).drawImage(t,0,0,i,o),s}function gt(t,e){return Object(a.b)(this,void 0,void 0,function(){var n,r,i,s,l,u;return Object(a.d)(this,function(a){switch(a.label){case 0:return n=e||et.getEnv().createCanvasElement(),r=t.shape.slice(p(t)?1:0),i=r[0],s=r[1],l=r[2],u=o.L(function(){return t.as3D(i,s,l).toInt()}),[4,o.f.toPixels(u,n)];case 1:return a.sent(),u.dispose(),[2,n]}})})}function mt(t){var e=et.getEnv(),n=e.Image,r=e.Canvas,i=e.Video;return t instanceof n||t instanceof r||t instanceof i}function vt(t,e,n){void 0===n&&(n=!1);var r=et.getEnv(),i=r.Image,o=r.Canvas;if(!(t instanceof i||t instanceof o))throw new Error("imageToSquare - expected arg0 to be HTMLImageElement | HTMLCanvasElement");var s=dt(t),a=e/Math.max(s.height,s.width),l=a*s.width,u=a*s.height,c=pt({width:e,height:e}),h=t instanceof o?t:ft(t),d=Math.abs(l-u)/2,p=n&&l<u?d:0,f=n&&u<l?d:0;return rt(c).drawImage(h,p,f,l,u),c}var bt=function(){function t(t,e){var n=this;if(void 0===e&&(e=!1),this._imageTensors=[],this._canvases=[],this._treatAsBatchInput=!1,this._inputDimensions=[],!Array.isArray(t))throw new Error("NetInput.constructor - expected inputs to be an Array of TResolvedNetInput or to be instanceof tf.Tensor4D, instead have "+t);this._treatAsBatchInput=e,this._batchSize=t.length,t.forEach(function(t,e){if(d(t))return n._imageTensors[e]=t,void(n._inputDimensions[e]=t.shape);if(p(t)){var r=t.shape[0];if(1!==r)throw new Error("NetInput - tf.Tensor4D with batchSize "+r+" passed, but not supported in input array");return n._imageTensors[e]=t,void(n._inputDimensions[e]=t.shape.slice(1))}var i=t instanceof et.getEnv().Canvas?t:ft(t);n._canvases[e]=i,n._inputDimensions[e]=[i.height,i.width,3]})}return Object.defineProperty(t.prototype,"imageTensors",{get:function(){return this._imageTensors},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"canvases",{get:function(){return this._canvases},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isBatchInput",{get:function(){return this.batchSize>1||this._treatAsBatchInput},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"batchSize",{get:function(){return this._batchSize},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"inputDimensions",{get:function(){return this._inputDimensions},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"inputSize",{get:function(){return this._inputSize},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"reshapedInputDimensions",{get:function(){var t=this;return y(this.batchSize,0,1).map(function(e,n){return t.getReshapedInputDimensions(n)})},enumerable:!0,configurable:!0}),t.prototype.getInput=function(t){return this.canvases[t]||this.imageTensors[t]},t.prototype.getInputDimensions=function(t){return this._inputDimensions[t]},t.prototype.getInputHeight=function(t){return this._inputDimensions[t][0]},t.prototype.getInputWidth=function(t){return this._inputDimensions[t][1]},t.prototype.getReshapedInputDimensions=function(t){if("number"!=typeof this.inputSize)throw new Error("getReshapedInputDimensions - inputSize not set, toBatchTensor has not been called yet");return b({width:this.getInputWidth(t),height:this.getInputHeight(t)},this.inputSize)},t.prototype.toBatchTensor=function(t,e){var n=this;return void 0===e&&(e=!0),this._inputSize=t,o.L(function(){var r=y(n.batchSize,0,1).map(function(r){var i=n.getInput(r);if(i instanceof o.a){var s=p(i)?i:i.expandDims();return(s=N(s,e)).shape[1]===t&&s.shape[2]===t||(s=o.o.resizeBilinear(s,[t,t])),s.as3D(t,t,3)}if(i instanceof et.getEnv().Canvas)return o.f.fromPixels(vt(i,t,e));throw new Error("toBatchTensor - at batchIdx "+r+", expected input to be instanceof tf.Tensor or instanceof HTMLCanvasElement, instead have "+i)});return o.E(r.map(function(t){return t.toFloat()})).as4D(n.batchSize,t,t,3)})},t}();function _t(t){return Object(a.b)(this,void 0,void 0,function(){var e,n,r;return Object(a.d)(this,function(i){switch(i.label){case 0:if(t instanceof bt)return[2,t];if(!(e=Array.isArray(t)?t:[t]).length)throw new Error("toNetInput - empty array passed as input");return n=function(e){return Array.isArray(t)?" at input index "+e+":":""},(r=e.map(nt)).forEach(function(t,r){if(!mt(t)&&!d(t)&&!p(t)){if("string"==typeof e[r])throw new Error("toNetInput -"+n(r)+" string passed, but could not resolve HTMLElement for element id "+e[r]);throw new Error("toNetInput -"+n(r)+" expected media to be of type HTMLImageElement | HTMLVideoElement | HTMLCanvasElement | tf.Tensor3D, or to be an element id")}if(p(t)){var i=t.shape[0];if(1!==i)throw new Error("toNetInput -"+n(r)+" tf.Tensor4D with batchSize "+i+" passed, but not supported in input array")}}),[4,Promise.all(r.map(function(t){return mt(t)&&ct(t)}))];case 1:return i.sent(),[2,new bt(r,Array.isArray(t))]}})})}function yt(t,e){return Object(a.b)(this,void 0,void 0,function(){var n,r,i,o,s,l;return Object(a.d)(this,function(a){switch(a.label){case 0:return n=et.getEnv().Canvas,r=t,t instanceof n?[3,5]:[4,_t(t)];case 1:if((i=a.sent()).batchSize>1)throw new Error("extractFaces - batchSize > 1 not supported");return(o=i.getInput(0))instanceof n?(s=o,[3,4]):[3,2];case 2:return[4,gt(o)];case 3:s=a.sent(),a.label=4;case 4:r=s,a.label=5;case 5:return l=rt(r),[2,e.map(function(t){return t instanceof k?t.forSize(r.width,r.height).box.floor():t}).map(function(t){return t.clipAtImageBorders(r.width,r.height)}).map(function(t){var e=t.x,n=t.y,r=t.width,i=t.height,o=pt({width:r,height:i});return rt(o).putImageData(l.getImageData(e,n,r,i),0,0),o})]}})})}function Tt(t,e){return Object(a.b)(this,void 0,void 0,function(){return Object(a.d)(this,function(n){if(!d(t)&&!p(t))throw new Error("extractFaceTensors - expected image tensor to be 3D or 4D");if(p(t)&&t.shape[0]>1)throw new Error("extractFaceTensors - batchSize > 1 not supported");return[2,o.L(function(){var n=t.shape.slice(p(t)?1:0),r=n[0],i=n[1],s=n[2];return e.map(function(t){return t instanceof k?t.forSize(i,r).box:t}).map(function(t){return t.clipAtImageBorders(i,r)}).map(function(e){var n=e.x,a=e.y,l=e.width,u=e.height;return o.C(t.as3D(r,i,s),[a,n,0],[u,l,s])})})]})})}function xt(t,e){return Object(a.b)(this,void 0,void 0,function(){var n;return Object(a.d)(this,function(r){switch(r.label){case 0:return[4,(0,et.getEnv().fetch)(t,e)];case 1:if(!((n=r.sent()).status<400))throw new Error("failed to fetch: ("+n.status+") "+n.statusText+", from url: "+n.url);return[2,n]}})})}function Et(t){return Object(a.b)(this,void 0,void 0,function(){var e,n;return Object(a.d)(this,function(r){switch(r.label){case 0:return[4,xt(t)];case 1:return[4,(e=r.sent()).blob()];case 2:if(!(n=r.sent()).type.startsWith("image/"))throw new Error("fetchImage - expected blob type to be of type image/*, instead have: "+n.type+", for url: "+e.url);return[2,ht(n)]}})})}function wt(t){return Object(a.b)(this,void 0,void 0,function(){return Object(a.d)(this,function(e){switch(e.label){case 0:return[4,xt(t)];case 1:return[2,e.sent().json()]}})})}function Ct(t){return Object(a.b)(this,void 0,void 0,function(){var e;return Object(a.d)(this,function(n){switch(n.label){case 0:return e=Float32Array.bind,[4,xt(t)];case 1:return[4,n.sent().arrayBuffer()];case 2:return[2,new(e.apply(Float32Array,[void 0,n.sent()]))]}})})}function St(t,e){var n=e+"-weights_manifest.json";if(!t)return{modelBaseUri:"",manifestUri:n};if("/"===t)return{modelBaseUri:"/",manifestUri:"/"+n};var r=t.startsWith("http://")?"http://":t.startsWith("https://")?"https://":"",i=(t=t.replace(r,"")).split("/").filter(function(t){return t}),o=t.endsWith(".json")?i[i.length-1]:n,s=r+(t.endsWith(".json")?i.slice(0,i.length-1):i).join("/");return{modelBaseUri:s=t.startsWith("/")?"/"+s:s,manifestUri:"/"===s?"/"+o:s+"/"+o}}function kt(t,e){return Object(a.b)(this,void 0,void 0,function(){var n,r,i,s;return Object(a.d)(this,function(a){switch(a.label){case 0:return n=St(t,e),r=n.manifestUri,i=n.modelBaseUri,[4,wt(r)];case 1:return s=a.sent(),[2,o.p.loadWeights(s,i)]}})})}function Ot(t,e,n){void 0===n&&(n=!1);var r=n?dt(e):e,i=r.width,o=r.height;return t.width=i,t.height=o,{width:i,height:o}}var It=function(){function t(t){this._name=t,this._params=void 0,this._paramMappings=[]}return Object.defineProperty(t.prototype,"params",{get:function(){return this._params},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"paramMappings",{get:function(){return this._paramMappings},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isLoaded",{get:function(){return!!this.params},enumerable:!0,configurable:!0}),t.prototype.getParamFromPath=function(t){var e=this.traversePropertyPath(t);return e.obj[e.objProp]},t.prototype.reassignParamFromPath=function(t,e){var n=this.traversePropertyPath(t),r=n.obj,i=n.objProp;r[i].dispose(),r[i]=e},t.prototype.getParamList=function(){var t=this;return this._paramMappings.map(function(e){var n=e.paramPath;return{path:n,tensor:t.getParamFromPath(n)}})},t.prototype.getTrainableParams=function(){return this.getParamList().filter(function(t){return t.tensor instanceof o.b})},t.prototype.getFrozenParams=function(){return this.getParamList().filter(function(t){return!(t.tensor instanceof o.b)})},t.prototype.variable=function(){var t=this;this.getFrozenParams().forEach(function(e){var n=e.path,r=e.tensor;t.reassignParamFromPath(n,r.variable())})},t.prototype.freeze=function(){var t=this;this.getTrainableParams().forEach(function(e){var n=e.path,r=e.tensor,i=o.G(r.dataSync());r.dispose(),t.reassignParamFromPath(n,i)})},t.prototype.dispose=function(t){void 0===t&&(t=!0),this.getParamList().forEach(function(e){if(t&&e.tensor.isDisposed)throw new Error("param tensor has already been disposed for path "+e.path);e.tensor.dispose()}),this._params=void 0},t.prototype.serializeParams=function(){return new Float32Array(this.getParamList().map(function(t){var e=t.tensor;return Array.from(e.dataSync())}).reduce(function(t,e){return t.concat(e)}))},t.prototype.load=function(t){return Object(a.b)(this,void 0,void 0,function(){return Object(a.d)(this,function(e){switch(e.label){case 0:return t instanceof Float32Array?(this.extractWeights(t),[2]):[4,this.loadFromUri(t)];case 1:return e.sent(),[2]}})})},t.prototype.loadFromUri=function(t){return Object(a.b)(this,void 0,void 0,function(){var e;return Object(a.d)(this,function(n){switch(n.label){case 0:if(t&&"string"!=typeof t)throw new Error(this._name+".loadFromUri - expected model uri");return[4,kt(t,this.getDefaultModelName())];case 1:return e=n.sent(),this.loadFromWeightMap(e),[2]}})})},t.prototype.loadFromDisk=function(t){return Object(a.b)(this,void 0,void 0,function(){var e,n,r,i,s,l,u,c,h,d;return Object(a.d)(this,function(a){switch(a.label){case 0:if(t&&"string"!=typeof t)throw new Error(this._name+".loadFromDisk - expected model file path");return e=et.getEnv().readFile,n=St(t,this.getDefaultModelName()),r=n.manifestUri,i=n.modelBaseUri,s=function(t){return Promise.all(t.map(function(t){return e(t).then(function(t){return t.buffer})}))},l=o.p.weightsLoaderFactory(s),h=(c=JSON).parse,[4,e(r)];case 1:return u=h.apply(c,[a.sent().toString()]),[4,l(u,i)];case 2:return d=a.sent(),this.loadFromWeightMap(d),[2]}})})},t.prototype.loadFromWeightMap=function(t){var e=this.extractParamsFromWeigthMap(t),n=e.paramMappings,r=e.params;this._paramMappings=n,this._params=r},t.prototype.extractWeights=function(t){var e=this.extractParams(t),n=e.paramMappings,r=e.params;this._paramMappings=n,this._params=r},t.prototype.traversePropertyPath=function(t){if(!this.params)throw new Error("traversePropertyPath - model has no loaded params");var e=t.split("/").reduce(function(e,n){if(!e.nextObj.hasOwnProperty(n))throw new Error("traversePropertyPath - object does not have property "+n+", for path "+t);return{obj:e.nextObj,objProp:n,nextObj:e.nextObj[n]}},{nextObj:this.params}),n=e.obj,r=e.objProp;if(!(n&&r&&n[r]instanceof o.a))throw new Error("traversePropertyPath - parameter is not a tensor, for path "+t);return{obj:n,objProp:r}},t}();function Rt(t,e,n){return o.L(function(){var r=o.z(t,e.depthwise_filter,e.pointwise_filter,n,"same");return r=o.c(r,e.bias)})}function At(t,e,n){return void 0===n&&(n=!1),o.L(function(){var r=o.w(n?o.c(o.i(t,e.conv0.filters,[2,2],"same"),e.conv0.bias):Rt(t,e.conv0,[2,2])),i=Rt(r,e.conv1,[1,1]),s=Rt(o.w(o.c(r,i)),e.conv2,[1,1]);return o.w(o.c(r,o.c(i,s)))})}function Nt(t,e,n,r){return void 0===n&&(n=!1),void 0===r&&(r=!0),o.L(function(){var i=o.w(n?o.c(o.i(t,e.conv0.filters,r?[2,2]:[1,1],"same"),e.conv0.bias):Rt(t,e.conv0,r?[2,2]:[1,1])),s=Rt(i,e.conv1,[1,1]),a=Rt(o.w(o.c(i,s)),e.conv2,[1,1]),l=Rt(o.w(o.c(i,o.c(s,a))),e.conv3,[1,1]);return o.w(o.c(i,o.c(s,o.c(a,l))))})}function Dt(t,e,n,r){return void 0===n&&(n="same"),void 0===r&&(r=!1),o.L(function(){var i=o.c(o.i(t,e.filters,[1,1],n),e.bias);return r?o.w(i):i})}function Mt(t,e){Object.keys(t).forEach(function(n){e.some(function(t){return t.originalPath===n})||t[n].dispose()})}function Lt(t,e){return function(n,r,i,s){var a=o.K(t(n*r*i*i),[i,i,n,r]),l=o.H(t(r));return e.push({paramPath:s+"/filters"},{paramPath:s+"/bias"}),{filters:a,bias:l}}}function Pt(t,e){return function(n,r,i){var s=o.I(t(n*r),[n,r]),a=o.H(t(r));return e.push({paramPath:i+"/weights"},{paramPath:i+"/bias"}),{weights:s,bias:a}}}var Ft=function(){return function(t,e,n){this.depthwise_filter=t,this.pointwise_filter=e,this.bias=n}}();function Bt(t,e){return function(n,r,i){var s=o.K(t(9*n),[3,3,n,1]),a=o.K(t(n*r),[1,1,n,r]),l=o.H(t(r));return e.push({paramPath:i+"/depthwise_filter"},{paramPath:i+"/pointwise_filter"},{paramPath:i+"/bias"}),new Ft(s,a,l)}}function jt(t){return function(e){var n=t(e+"/depthwise_filter",4),r=t(e+"/pointwise_filter",4),i=t(e+"/bias",1);return new Ft(n,r,i)}}function $t(t,e){return function(n,r,i){var o=t[n];if(!u(o,r))throw new Error("expected weightMap["+n+"] to be a Tensor"+r+"D, instead have "+o);return e.push({originalPath:n,paramPath:i||n}),o}}function Ut(t){var e=t;return{extractWeights:function(t){var n=e.slice(0,t);return e=e.slice(t),n},getRemainingWeights:function(){return e}}}function Vt(t,e){var n=Lt(t,e),r=Bt(t,e);function i(t,e,i,o){return void 0===o&&(o=!1),{conv0:o?n(t,e,3,i+"/conv0"):r(t,e,i+"/conv0"),conv1:r(e,e,i+"/conv1"),conv2:r(e,e,i+"/conv2")}}return{extractDenseBlock3Params:i,extractDenseBlock4Params:function(t,e,n,o){void 0===o&&(o=!1);var s=i(t,e,n,o);return{conv0:s.conv0,conv1:s.conv1,conv2:s.conv2,conv3:r(e,e,n+"/conv3")}}}}function Ht(t){return function(e){return{filters:t(e+"/filters",4),bias:t(e+"/bias",1)}}}function Wt(t,e){var n=$t(t,e),r=Ht(n),i=jt(n);return{extractDenseBlock3Params:function(t,e){return void 0===e&&(e=!1),{conv0:e?r(t+"/conv0"):i(t+"/conv0"),conv1:i(t+"/conv1"),conv2:i(t+"/conv2")}},extractDenseBlock4Params:function(t,e){return void 0===e&&(e=!1),{conv0:e?r(t+"/conv0"):i(t+"/conv0"),conv1:i(t+"/conv1"),conv2:i(t+"/conv2"),conv3:i(t+"/conv3")}}}}var Gt=function(t){function e(){return t.call(this,"FaceFeatureExtractor")||this}return Object(a.c)(e,t),e.prototype.forwardInput=function(t){var e=this.params;if(!e)throw new Error("FaceFeatureExtractor - load model before inference");return o.L(function(){var n=Nt(A(t.toBatchTensor(112,!0),[122.782,117.001,104.298]).div(o.y(255)),e.dense0,!0);return n=Nt(n=Nt(n=Nt(n,e.dense1),e.dense2),e.dense3),n=o.d(n,[7,7],[2,2],"valid")})},e.prototype.forward=function(t){return Object(a.b)(this,void 0,void 0,function(){var e;return Object(a.d)(this,function(n){switch(n.label){case 0:return e=this.forwardInput,[4,_t(t)];case 1:return[2,e.apply(this,[n.sent()])]}})})},e.prototype.getDefaultModelName=function(){return"face_feature_extractor_model"},e.prototype.extractParamsFromWeigthMap=function(t){return function(t){var e=[],n=Wt(t,e).extractDenseBlock4Params,r={dense0:n("dense0",!0),dense1:n("dense1"),dense2:n("dense2"),dense3:n("dense3")};return Mt(t,e),{params:r,paramMappings:e}}(t)},e.prototype.extractParams=function(t){return function(t){var e=[],n=Ut(t),r=n.extractWeights,i=n.getRemainingWeights,o=Vt(r,e).extractDenseBlock4Params,s=o(3,32,"dense0",!0),a=o(32,64,"dense1"),l=o(64,128,"dense2"),u=o(128,256,"dense3");if(0!==i().length)throw new Error("weights remaing after extract: "+i().length);return{paramMappings:e,params:{dense0:s,dense1:a,dense2:l,dense3:u}}}(t)},e}(It);function zt(t,e){return o.L(function(){return o.c(o.q(t,e.weights),e.bias)})}function Xt(t){var e={},n={};return Object.keys(t).forEach(function(r){(r.startsWith("fc")?n:e)[r]=t[r]}),{featureExtractorMap:e,classifierMap:n}}var Kt=function(t){function e(e,n){var r=t.call(this,e)||this;return r._faceFeatureExtractor=n,r}return Object(a.c)(e,t),Object.defineProperty(e.prototype,"faceFeatureExtractor",{get:function(){return this._faceFeatureExtractor},enumerable:!0,configurable:!0}),e.prototype.runNet=function(t){var e=this,n=this.params;if(!n)throw new Error(this._name+" - load model before inference");return o.L(function(){var r=t instanceof bt?e.faceFeatureExtractor.forwardInput(t):t;return zt(r.as2D(r.shape[0],-1),n.fc)})},e.prototype.dispose=function(e){void 0===e&&(e=!0),this.faceFeatureExtractor.dispose(e),t.prototype.dispose.call(this,e)},e.prototype.loadClassifierParams=function(t){var e=this.extractClassifierParams(t),n=e.params,r=e.paramMappings;this._params=n,this._paramMappings=r},e.prototype.extractClassifierParams=function(t){return function(t,e,n){var r=[],i=Ut(t),o=i.extractWeights,s=i.getRemainingWeights,a=Pt(o,r)(e,n,"fc");if(0!==s().length)throw new Error("weights remaing after extract: "+s().length);return{paramMappings:r,params:{fc:a}}}(t,this.getClassifierChannelsIn(),this.getClassifierChannelsOut())},e.prototype.extractParamsFromWeigthMap=function(t){var e=Xt(t),n=e.featureExtractorMap,r=e.classifierMap;return this.faceFeatureExtractor.loadFromWeightMap(n),function(t){var e,n=[],r=$t(t,n),i={fc:(e="fc",{weights:r(e+"/weights",2),bias:r(e+"/bias",1)})};return Mt(t,n),{params:i,paramMappings:n}}(r)},e.prototype.extractParams=function(t){var e=this.getClassifierChannelsIn(),n=this.getClassifierChannelsOut(),r=n*e+n,i=t.slice(0,t.length-r),o=t.slice(t.length-r);return this.faceFeatureExtractor.extractWeights(i),this.extractClassifierParams(o)},e}(It),Yt=["neutral","happy","sad","angry","fearful","disgusted","surprised"],qt=function(){function t(t){var e=this;if(7!==t.length)throw new Error("FaceExpressions.constructor - expected probabilities.length to be 7, have: "+t.length);Yt.forEach(function(n,r){e[n]=t[r]})}return t.prototype.asSortedArray=function(){var t=this;return Yt.map(function(e){return{expression:e,probability:t[e]}}).sort(function(t,e){return e.probability-t.probability})},t}(),Jt=function(t){function e(e){return void 0===e&&(e=new Gt),t.call(this,"FaceExpressionNet",e)||this}return Object(a.c)(e,t),e.prototype.forwardInput=function(t){var e=this;return o.L(function(){return o.D(e.runNet(t))})},e.prototype.forward=function(t){return Object(a.b)(this,void 0,void 0,function(){var e;return Object(a.d)(this,function(n){switch(n.label){case 0:return e=this.forwardInput,[4,_t(t)];case 1:return[2,e.apply(this,[n.sent()])]}})})},e.prototype.predictExpressions=function(t){return Object(a.b)(this,void 0,void 0,function(){var e,n,r,i,s=this;return Object(a.d)(this,function(l){switch(l.label){case 0:return[4,_t(t)];case 1:return e=l.sent(),[4,this.forwardInput(e)];case 2:return n=l.sent(),[4,Promise.all(o.O(n).map(function(t){return Object(a.b)(s,void 0,void 0,function(){var e;return Object(a.d)(this,function(n){switch(n.label){case 0:return[4,t.data()];case 1:return e=n.sent(),t.dispose(),[2,e]}})})}))];case 3:return r=l.sent(),n.dispose(),i=r.map(function(t){return new qt(t)}),[2,e.isBatchInput?i:i[0]]}})})},e.prototype.getDefaultModelName=function(){return"face_expression_model"},e.prototype.getClassifierChannelsIn=function(){return 256},e.prototype.getClassifierChannelsOut=function(){return 7},e}(Kt);function Zt(t){return t.expressions instanceof qt}function Qt(t,e){var n={expressions:e};return Object.assign({},t,n)}function te(t,e,n,r){void 0===n&&(n=.1),(Array.isArray(e)?e:[e]).forEach(function(e){var i=e instanceof qt?e:Zt(e)?e.expressions:void 0;if(!i)throw new Error("drawFaceExpressions - expected faceExpressions to be FaceExpressions | WithFaceExpressions<{}> or array thereof");var o=i.asSortedArray().filter(function(t){return t.probability>n}),s=W(e)?e.detection.box.bottomLeft:r||new E(0,0);new ot(o.map(function(t){return t.expression+" ("+m(t.probability)+")"}),s).draw(t)})}function ee(t){return W(t)&&t.landmarks instanceof F&&t.unshiftedLandmarks instanceof F&&t.alignedRect instanceof k}function ne(t,e){var n=t.detection.box,r=e.shiftBy(n.x,n.y),i=r.align(),o=t.detection.imageDims,s={landmarks:r,unshiftedLandmarks:e,alignedRect:new k(t.detection.score,i.rescale(o.reverse()),o)};return Object.assign({},t,s)}var re=function(){return function(t){void 0===t&&(t={});var e=t.drawLines,n=void 0===e||e,r=t.drawPoints,i=void 0===r||r,o=t.lineWidth,s=t.lineColor,a=t.pointSize,l=t.pointColor;this.drawLines=n,this.drawPoints=i,this.lineWidth=o||1,this.pointSize=a||2,this.lineColor=s||"rgba(0, 255, 255, 1)",this.pointColor=l||"rgba(255, 0, 255, 1)"}}(),ie=function(){function t(t,e){void 0===e&&(e={}),this.faceLandmarks=t,this.options=new re(e)}return t.prototype.draw=function(t){var e=rt(t),n=this.options,r=n.drawLines,i=n.drawPoints,o=n.lineWidth,a=n.lineColor,l=n.pointSize,u=n.pointColor;if(r&&this.faceLandmarks instanceof j&&(e.strokeStyle=a,e.lineWidth=o,s(e,this.faceLandmarks.getJawOutline()),s(e,this.faceLandmarks.getLeftEyeBrow()),s(e,this.faceLandmarks.getRightEyeBrow()),s(e,this.faceLandmarks.getNose()),s(e,this.faceLandmarks.getLeftEye(),!0),s(e,this.faceLandmarks.getRightEye(),!0),s(e,this.faceLandmarks.getMouth(),!0)),i){e.strokeStyle=u,e.fillStyle=u;this.faceLandmarks.positions.forEach(function(t){e.beginPath(),e.arc(t.x,t.y,l,0,2*Math.PI),e.fill()})}},t}();function oe(t,e){(Array.isArray(e)?e:[e]).forEach(function(e){var n=e instanceof F?e:ee(e)?e.landmarks:void 0;if(!n)throw new Error("drawFaceLandmarks - expected faceExpressions to be FaceLandmarks | WithFaceLandmarks<WithFaceDetection<{}>> or array thereof");new ie(n).draw(t)})}function se(t,e){var n=[],r=Ut(t),i=r.extractWeights,o=r.getRemainingWeights,s=function(t,e){var n=Lt(t,e),r=Bt(t,e);return{extractConvParams:n,extractSeparableConvParams:r,extractReductionBlockParams:function(t,e,i){return{separable_conv0:r(t,e,i+"/separable_conv0"),separable_conv1:r(e,e,i+"/separable_conv1"),expansion_conv:n(t,e,1,i+"/expansion_conv")}},extractMainBlockParams:function(t,e){return{separable_conv0:r(t,t,e+"/separable_conv0"),separable_conv1:r(t,t,e+"/separable_conv1"),separable_conv2:r(t,t,e+"/separable_conv2")}}}}(i,n),a=s.extractConvParams,l=s.extractSeparableConvParams,u=s.extractReductionBlockParams,c=s.extractMainBlockParams,h={conv_in:a(3,32,3,"entry_flow/conv_in"),reduction_block_0:u(32,64,"entry_flow/reduction_block_0"),reduction_block_1:u(64,128,"entry_flow/reduction_block_1")},d={};y(e,0,1).forEach(function(t){d["main_block_"+t]=c(128,"middle_flow/main_block_"+t)});var p={reduction_block:u(128,256,"exit_flow/reduction_block"),separable_conv:l(256,512,"exit_flow/separable_conv")};if(0!==o().length)throw new Error("weights remaing after extract: "+o().length);return{paramMappings:n,params:{entry_flow:h,middle_flow:d,exit_flow:p}}}function ae(t,e){var n=[],r=function(t,e){var n=$t(t,e),r=Ht(n),i=jt(n);return{extractConvParams:r,extractSeparableConvParams:i,extractReductionBlockParams:function(t){return{separable_conv0:i(t+"/separable_conv0"),separable_conv1:i(t+"/separable_conv1"),expansion_conv:r(t+"/expansion_conv")}},extractMainBlockParams:function(t){return{separable_conv0:i(t+"/separable_conv0"),separable_conv1:i(t+"/separable_conv1"),separable_conv2:i(t+"/separable_conv2")}}}}(t,n),i=r.extractConvParams,o=r.extractSeparableConvParams,s=r.extractReductionBlockParams,a=r.extractMainBlockParams,l={conv_in:i("entry_flow/conv_in"),reduction_block_0:s("entry_flow/reduction_block_0"),reduction_block_1:s("entry_flow/reduction_block_1")},u={};y(e,0,1).forEach(function(t){u["main_block_"+t]=a("middle_flow/main_block_"+t)});var c={reduction_block:s("exit_flow/reduction_block"),separable_conv:o("exit_flow/separable_conv")};return Mt(t,n),{params:{entry_flow:l,middle_flow:u,exit_flow:c},paramMappings:n}}function le(t,e,n){return o.c(o.i(t,e.filters,n,"same"),e.bias)}function ue(t,e,n){void 0===n&&(n=!0);var r=n?o.w(t):t;return r=Rt(r,e.separable_conv0,[1,1]),r=Rt(o.w(r),e.separable_conv1,[1,1]),r=o.s(r,[3,3],[2,2],"same"),r=o.c(r,le(t,e.expansion_conv,[2,2]))}var ce,he=function(t){function e(e){var n=t.call(this,"TinyXception")||this;return n._numMainBlocks=e,n}return Object(a.c)(e,t),e.prototype.forwardInput=function(t){var e=this,n=this.params;if(!n)throw new Error("TinyXception - load model before inference");return o.L(function(){var r=A(t.toBatchTensor(112,!0),[122.782,117.001,104.298]).div(o.y(256)),i=o.w(le(r,n.entry_flow.conv_in,[2,2]));return i=ue(i=ue(i,n.entry_flow.reduction_block_0,!1),n.entry_flow.reduction_block_1),y(e._numMainBlocks,0,1).forEach(function(t){i=function(t,e){var n=Rt(o.w(t),e.separable_conv0,[1,1]);return n=Rt(o.w(n),e.separable_conv1,[1,1]),n=Rt(o.w(n),e.separable_conv2,[1,1]),n=o.c(n,t)}(i,n.middle_flow["main_block_"+t])}),i=ue(i,n.exit_flow.reduction_block),i=o.w(Rt(i,n.exit_flow.separable_conv,[1,1]))})},e.prototype.forward=function(t){return Object(a.b)(this,void 0,void 0,function(){var e;return Object(a.d)(this,function(n){switch(n.label){case 0:return e=this.forwardInput,[4,_t(t)];case 1:return[2,e.apply(this,[n.sent()])]}})})},e.prototype.getDefaultModelName=function(){return"tiny_xception_model"},e.prototype.extractParamsFromWeigthMap=function(t){return ae(t,this._numMainBlocks)},e.prototype.extractParams=function(t){return se(t,this._numMainBlocks)},e}(It);!function(t){t.FEMALE="female",t.MALE="male"}(ce||(ce={}));var de=function(t){function e(e){void 0===e&&(e=new he(2));var n=t.call(this,"AgeGenderNet")||this;return n._faceFeatureExtractor=e,n}return Object(a.c)(e,t),Object.defineProperty(e.prototype,"faceFeatureExtractor",{get:function(){return this._faceFeatureExtractor},enumerable:!0,configurable:!0}),e.prototype.runNet=function(t){var e=this,n=this.params;if(!n)throw new Error(this._name+" - load model before inference");return o.L(function(){var r=t instanceof bt?e.faceFeatureExtractor.forwardInput(t):t,i=o.d(r,[7,7],[2,2],"valid").as2D(r.shape[0],-1);return{age:zt(i,n.fc.age).as1D(),gender:zt(i,n.fc.gender)}})},e.prototype.forwardInput=function(t){var e=this;return o.L(function(){var n=e.runNet(t),r=n.age,i=n.gender;return{age:r,gender:o.D(i)}})},e.prototype.forward=function(t){return Object(a.b)(this,void 0,void 0,function(){var e;return Object(a.d)(this,function(n){switch(n.label){case 0:return e=this.forwardInput,[4,_t(t)];case 1:return[2,e.apply(this,[n.sent()])]}})})},e.prototype.predictAgeAndGender=function(t){return Object(a.b)(this,void 0,void 0,function(){var e,n,r,i,s,l,u=this;return Object(a.d)(this,function(c){switch(c.label){case 0:return[4,_t(t)];case 1:return e=c.sent(),[4,this.forwardInput(e)];case 2:return n=c.sent(),r=o.O(n.age),i=o.O(n.gender),s=r.map(function(t,e){return{ageTensor:t,genderTensor:i[e]}}),[4,Promise.all(s.map(function(t){var e=t.ageTensor,n=t.genderTensor;return Object(a.b)(u,void 0,void 0,function(){var t,r,i,o,s;return Object(a.d)(this,function(a){switch(a.label){case 0:return[4,e.data()];case 1:return t=a.sent()[0],[4,n.data()];case 2:return r=a.sent()[0],o=(i=r>.5)?ce.MALE:ce.FEMALE,s=i?r:1-r,e.dispose(),n.dispose(),[2,{age:t,gender:o,genderProbability:s}]}})})}))];case 3:return l=c.sent(),n.age.dispose(),n.gender.dispose(),[2,e.isBatchInput?l:l[0]]}})})},e.prototype.getDefaultModelName=function(){return"age_gender_model"},e.prototype.dispose=function(e){void 0===e&&(e=!0),this.faceFeatureExtractor.dispose(e),t.prototype.dispose.call(this,e)},e.prototype.loadClassifierParams=function(t){var e=this.extractClassifierParams(t),n=e.params,r=e.paramMappings;this._params=n,this._paramMappings=r},e.prototype.extractClassifierParams=function(t){return function(t){var e=[],n=Ut(t),r=n.extractWeights,i=n.getRemainingWeights,o=Pt(r,e),s=o(512,1,"fc/age"),a=o(512,2,"fc/gender");if(0!==i().length)throw new Error("weights remaing after extract: "+i().length);return{paramMappings:e,params:{fc:{age:s,gender:a}}}}(t)},e.prototype.extractParamsFromWeigthMap=function(t){var e=Xt(t),n=e.featureExtractorMap,r=e.classifierMap;return this.faceFeatureExtractor.loadFromWeightMap(n),function(t){var e=[],n=$t(t,e);function r(t){return{weights:n(t+"/weights",2),bias:n(t+"/bias",1)}}var i={fc:{age:r("fc/age"),gender:r("fc/gender")}};return Mt(t,e),{params:i,paramMappings:e}}(r)},e.prototype.extractParams=function(t){var e=t.slice(0,t.length-1539),n=t.slice(t.length-1539);return this.faceFeatureExtractor.extractWeights(e),this.extractClassifierParams(n)},e}(It),pe=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(a.c)(e,t),e.prototype.postProcess=function(t,e,n){var r=n.map(function(t){var n=t.width,r=t.height,i=e/Math.max(r,n);return{width:n*i,height:r*i}}),i=r.length;return o.L(function(){var n=function(t,e){return o.E([o.n([68],t),o.n([68],e)],1).as2D(1,136).as1D()},s=function(t,e){var n=r[t],i=n.width,o=n.height;return e(i,o)?Math.abs(i-o)/2:0};return t.mul(o.n([i,136],e)).sub(o.E(Array.from(Array(i),function(t,e){return n(function(t){return s(t,function(t,e){return t<e})}(e),function(t){return s(t,function(t,e){return e<t})}(e))}))).div(o.E(Array.from(Array(i),function(t,e){return n(r[e].width,r[e].height)})))})},e.prototype.forwardInput=function(t){var e=this;return o.L(function(){var n=e.runNet(t);return e.postProcess(n,t.inputSize,t.inputDimensions.map(function(t){return{height:t[0],width:t[1]}}))})},e.prototype.forward=function(t){return Object(a.b)(this,void 0,void 0,function(){var e;return Object(a.d)(this,function(n){switch(n.label){case 0:return e=this.forwardInput,[4,_t(t)];case 1:return[2,e.apply(this,[n.sent()])]}})})},e.prototype.detectLandmarks=function(t){return Object(a.b)(this,void 0,void 0,function(){var e,n,r,i=this;return Object(a.d)(this,function(s){switch(s.label){case 0:return[4,_t(t)];case 1:return e=s.sent(),n=o.L(function(){return o.O(i.forwardInput(e))}),[4,Promise.all(n.map(function(t,n){return Object(a.b)(i,void 0,void 0,function(){var r,i,o,s,l;return Object(a.d)(this,function(a){switch(a.label){case 0:return o=(i=Array).from,[4,t.data()];case 1:return r=o.apply(i,[a.sent()]),s=r.filter(function(t,e){return g(e)}),l=r.filter(function(t,e){return!g(e)}),[2,new j(Array(68).fill(0).map(function(t,e){return new E(s[e],l[e])}),{height:e.getInputHeight(n),width:e.getInputWidth(n)})]}})})}))];case 2:return r=s.sent(),n.forEach(function(t){return t.dispose()}),[2,e.isBatchInput?r:r[0]]}})})},e.prototype.getClassifierChannelsOut=function(){return 136},e}(Kt),fe=function(t){function e(e){return void 0===e&&(e=new Gt),t.call(this,"FaceLandmark68Net",e)||this}return Object(a.c)(e,t),e.prototype.getDefaultModelName=function(){return"face_landmark_68_model"},e.prototype.getClassifierChannelsIn=function(){return 256},e}(pe);var ge=function(t){function e(){return t.call(this,"TinyFaceFeatureExtractor")||this}return Object(a.c)(e,t),e.prototype.forwardInput=function(t){var e=this.params;if(!e)throw new Error("TinyFaceFeatureExtractor - load model before inference");return o.L(function(){var n=At(A(t.toBatchTensor(112,!0),[122.782,117.001,104.298]).div(o.y(255)),e.dense0,!0);return n=At(n=At(n,e.dense1),e.dense2),n=o.d(n,[14,14],[2,2],"valid")})},e.prototype.forward=function(t){return Object(a.b)(this,void 0,void 0,function(){var e;return Object(a.d)(this,function(n){switch(n.label){case 0:return e=this.forwardInput,[4,_t(t)];case 1:return[2,e.apply(this,[n.sent()])]}})})},e.prototype.getDefaultModelName=function(){return"face_feature_extractor_tiny_model"},e.prototype.extractParamsFromWeigthMap=function(t){return function(t){var e=[],n=Wt(t,e).extractDenseBlock3Params,r={dense0:n("dense0",!0),dense1:n("dense1"),dense2:n("dense2")};return Mt(t,e),{params:r,paramMappings:e}}(t)},e.prototype.extractParams=function(t){return function(t){var e=[],n=Ut(t),r=n.extractWeights,i=n.getRemainingWeights,o=Vt(r,e).extractDenseBlock3Params,s=o(3,32,"dense0",!0),a=o(32,64,"dense1"),l=o(64,128,"dense2");if(0!==i().length)throw new Error("weights remaing after extract: "+i().length);return{paramMappings:e,params:{dense0:s,dense1:a,dense2:l}}}(t)},e}(It),me=function(t){function e(e){return void 0===e&&(e=new ge),t.call(this,"FaceLandmark68TinyNet",e)||this}return Object(a.c)(e,t),e.prototype.getDefaultModelName=function(){return"face_landmark_68_tiny_model"},e.prototype.getClassifierChannelsIn=function(){return 128},e}(pe),ve=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(a.c)(e,t),e}(fe);function be(t,e,n,r,i){void 0===i&&(i="same");var s=e.conv,a=s.filters,l=s.bias,u=o.i(t,a,n,i);return u=function(t,e){return o.c(o.t(t,e.weights),e.biases)}(u=o.c(u,l),e.scale),r?o.w(u):u}function _e(t,e){return be(t,e,[1,1],!1)}function ye(t,e){return be(t,e,[2,2],!0,"valid")}function Te(t,e){function n(n,r,i,s){var a=function(e,n,r){var i=t(e),s=i.length/(n*r*r);if(f(s))throw new Error("depth has to be an integer: "+s+", weights.length: "+i.length+", numFilters: "+n+", filterSize: "+r);return o.L(function(){return o.N(o.K(i,[n,s,r,r]),[2,3,1,0])})}(n,r,i),l=o.H(t(r));return e.push({paramPath:s+"/filters"},{paramPath:s+"/bias"}),{filters:a,bias:l}}function r(r,i,s,a){return{conv:n(r,i,s,a+"/conv"),scale:function(n,r){var i=o.H(t(n)),s=o.H(t(n));return e.push({paramPath:r+"/weights"},{paramPath:r+"/biases"}),{weights:i,biases:s}}(i,a+"/scale")}}return{extractConvLayerParams:r,extractResidualLayerParams:function(t,e,n,i,o){return void 0===o&&(o=!1),{conv1:r((o?.5:1)*t,e,n,i+"/conv1"),conv2:r(t,e,n,i+"/conv2")}}}}function xe(t,e){var n=$t(t,e);function r(t){return{conv:{filters:n(t+"/conv/filters",4),bias:n(t+"/conv/bias",1)},scale:function(t){return{weights:n(t+"/scale/weights",1),biases:n(t+"/scale/biases",1)}}(t)}}return{extractConvLayerParams:r,extractResidualLayerParams:function(t){return{conv1:r(t+"/conv1"),conv2:r(t+"/conv2")}}}}function Ee(t,e){var n=function(t,e){return be(t,e,[1,1],!0)}(t,e.conv1);return n=_e(n,e.conv2),n=o.c(n,t),n=o.w(n)}function we(t,e){var n=ye(t,e.conv1);n=_e(n,e.conv2);var r=o.d(t,2,2,"valid"),i=o.P(r.shape),s=r.shape[3]!==n.shape[3];if(r.shape[1]!==n.shape[1]||r.shape[2]!==n.shape[2]){var l=Object(a.e)(n.shape);l[1]=1;var u=o.P(l);n=o.h([n,u],1);var c=Object(a.e)(n.shape);c[2]=1;var h=o.P(c);n=o.h([n,h],2)}return r=s?o.h([r,i],3):r,n=o.c(r,n),n=o.w(n)}var Ce=function(t){function e(){return t.call(this,"FaceRecognitionNet")||this}return Object(a.c)(e,t),e.prototype.forwardInput=function(t){var e=this.params;if(!e)throw new Error("FaceRecognitionNet - load model before inference");return o.L(function(){var n=ye(A(t.toBatchTensor(150,!0).toFloat(),[122.782,117.001,104.298]).div(o.y(256)),e.conv32_down),r=(n=we(n=Ee(n=Ee(n=we(n=Ee(n=Ee(n=we(n=Ee(n=Ee(n=Ee(n=we(n=Ee(n=Ee(n=Ee(n=o.s(n,3,2,"valid"),e.conv32_1),e.conv32_2),e.conv32_3),e.conv64_down),e.conv64_1),e.conv64_2),e.conv64_3),e.conv128_down),e.conv128_1),e.conv128_2),e.conv256_down),e.conv256_1),e.conv256_2),e.conv256_down_out)).mean([1,2]);return o.q(r,e.fc)})},e.prototype.forward=function(t){return Object(a.b)(this,void 0,void 0,function(){var e;return Object(a.d)(this,function(n){switch(n.label){case 0:return e=this.forwardInput,[4,_t(t)];case 1:return[2,e.apply(this,[n.sent()])]}})})},e.prototype.computeFaceDescriptor=function(t){return Object(a.b)(this,void 0,void 0,function(){var e,n,r,i=this;return Object(a.d)(this,function(s){switch(s.label){case 0:return[4,_t(t)];case 1:return e=s.sent(),n=o.L(function(){return o.O(i.forwardInput(e))}),[4,Promise.all(n.map(function(t){return t.data()}))];case 2:return r=s.sent(),n.forEach(function(t){return t.dispose()}),[2,e.isBatchInput?r:r[0]]}})})},e.prototype.getDefaultModelName=function(){return"face_recognition_model"},e.prototype.extractParamsFromWeigthMap=function(t){return function(t){var e=[],n=xe(t,e),r=n.extractConvLayerParams,i=n.extractResidualLayerParams,o=r("conv32_down"),s=i("conv32_1"),a=i("conv32_2"),l=i("conv32_3"),u=i("conv64_down"),c=i("conv64_1"),d=i("conv64_2"),p=i("conv64_3"),f=i("conv128_down"),g=i("conv128_1"),m=i("conv128_2"),v=i("conv256_down"),b=i("conv256_1"),_=i("conv256_2"),y=i("conv256_down_out"),T=t.fc;if(e.push({originalPath:"fc",paramPath:"fc"}),!h(T))throw new Error("expected weightMap[fc] to be a Tensor2D, instead have "+T);var x={conv32_down:o,conv32_1:s,conv32_2:a,conv32_3:l,conv64_down:u,conv64_1:c,conv64_2:d,conv64_3:p,conv128_down:f,conv128_1:g,conv128_2:m,conv256_down:v,conv256_1:b,conv256_2:_,conv256_down_out:y,fc:T};return Mt(t,e),{params:x,paramMappings:e}}(t)},e.prototype.extractParams=function(t){return function(t){var e=Ut(t),n=e.extractWeights,r=e.getRemainingWeights,i=[],s=Te(n,i),a=s.extractConvLayerParams,l=s.extractResidualLayerParams,u=a(4704,32,7,"conv32_down"),c=l(9216,32,3,"conv32_1"),h=l(9216,32,3,"conv32_2"),d=l(9216,32,3,"conv32_3"),p=l(36864,64,3,"conv64_down",!0),f=l(36864,64,3,"conv64_1"),g=l(36864,64,3,"conv64_2"),m=l(36864,64,3,"conv64_3"),v=l(147456,128,3,"conv128_down",!0),b=l(147456,128,3,"conv128_1"),_=l(147456,128,3,"conv128_2"),y=l(589824,256,3,"conv256_down",!0),T=l(589824,256,3,"conv256_1"),x=l(589824,256,3,"conv256_2"),E=l(589824,256,3,"conv256_down_out"),w=o.L(function(){return o.N(o.I(n(32768),[128,256]),[1,0])});if(i.push({paramPath:"fc"}),0!==r().length)throw new Error("weights remaing after extract: "+r().length);return{params:{conv32_down:u,conv32_1:c,conv32_2:h,conv32_3:d,conv64_down:p,conv64_1:f,conv64_2:g,conv64_3:m,conv128_down:v,conv128_1:b,conv128_2:_,conv256_down:y,conv256_1:T,conv256_2:x,conv256_down_out:E,fc:w},paramMappings:i}}(t)},e}(It);function Se(t){var e=new Ce;return e.extractWeights(t),e}function ke(t,e){var n={descriptor:e};return Object.assign({},t,n)}function Oe(t){return"number"==typeof t.age}function Ie(t,e){var n={age:e};return Object.assign({},t,n)}function Re(t){return(t.gender===ce.MALE||t.gender===ce.FEMALE)&&x(t.genderProbability)}function Ae(t,e,n){var r={gender:e,genderProbability:n};return Object.assign({},t,r)}var Ne=function(){function t(t){var e=void 0===t?{}:t,n=e.minFaceSize,r=e.scaleFactor,i=e.maxNumScales,o=e.scoreThresholds,s=e.scaleSteps;if(this._name="MtcnnOptions",this._minFaceSize=n||20,this._scaleFactor=r||.709,this._maxNumScales=i||10,this._scoreThresholds=o||[.6,.7,.7],this._scaleSteps=s,"number"!=typeof this._minFaceSize||this._minFaceSize<0)throw new Error(this._name+" - expected minFaceSize to be a number > 0");if("number"!=typeof this._scaleFactor||this._scaleFactor<=0||this._scaleFactor>=1)throw new Error(this._name+" - expected scaleFactor to be a number between 0 and 1");if("number"!=typeof this._maxNumScales||this._maxNumScales<0)throw new Error(this._name+" - expected maxNumScales to be a number > 0");if(!Array.isArray(this._scoreThresholds)||3!==this._scoreThresholds.length||this._scoreThresholds.some(function(t){return"number"!=typeof t}))throw new Error(this._name+" - expected scoreThresholds to be an array of numbers of length 3");if(this._scaleSteps&&(!Array.isArray(this._scaleSteps)||this._scaleSteps.some(function(t){return"number"!=typeof t})))throw new Error(this._name+" - expected scaleSteps to be an array of numbers")}return Object.defineProperty(t.prototype,"minFaceSize",{get:function(){return this._minFaceSize},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"scaleFactor",{get:function(){return this._scaleFactor},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"maxNumScales",{get:function(){return this._maxNumScales},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"scoreThresholds",{get:function(){return this._scoreThresholds},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"scaleSteps",{get:function(){return this._scaleSteps},enumerable:!0,configurable:!0}),t}();function De(t,e){function n(n,r,i,s,a){var l=o.K(t(n*r*i*i),[i,i,n,r]),u=o.H(t(r));return e.push({paramPath:s+"/filters"},{paramPath:s+"/"+(a?"batch_norm_offset":"bias")}),{filters:l,bias:u}}function r(t,e,r,i){var o=n(t,e,r,i,!0);return{filters:o.filters,batch_norm_offset:o.bias}}function i(n,i,s){return{depthwise_conv:function(n,r){var i=o.K(t(9*n),[3,3,n,1]),s=o.H(t(n)),a=o.H(t(n)),l=o.H(t(n)),u=o.H(t(n));return e.push({paramPath:r+"/filters"},{paramPath:r+"/batch_norm_scale"},{paramPath:r+"/batch_norm_offset"},{paramPath:r+"/batch_norm_mean"},{paramPath:r+"/batch_norm_variance"}),{filters:i,batch_norm_scale:s,batch_norm_offset:a,batch_norm_mean:l,batch_norm_variance:u}}(n,s+"/depthwise_conv"),pointwise_conv:r(n,i,1,s+"/pointwise_conv")}}return{extractMobilenetV1Params:function(){return{conv_0:r(3,32,3,"mobilenetv1/conv_0"),conv_1:i(32,64,"mobilenetv1/conv_1"),conv_2:i(64,128,"mobilenetv1/conv_2"),conv_3:i(128,128,"mobilenetv1/conv_3"),conv_4:i(128,256,"mobilenetv1/conv_4"),conv_5:i(256,256,"mobilenetv1/conv_5"),conv_6:i(256,512,"mobilenetv1/conv_6"),conv_7:i(512,512,"mobilenetv1/conv_7"),conv_8:i(512,512,"mobilenetv1/conv_8"),conv_9:i(512,512,"mobilenetv1/conv_9"),conv_10:i(512,512,"mobilenetv1/conv_10"),conv_11:i(512,512,"mobilenetv1/conv_11"),conv_12:i(512,1024,"mobilenetv1/conv_12"),conv_13:i(1024,1024,"mobilenetv1/conv_13")}},extractPredictionLayerParams:function(){return{conv_0:r(1024,256,1,"prediction_layer/conv_0"),conv_1:r(256,512,3,"prediction_layer/conv_1"),conv_2:r(512,128,1,"prediction_layer/conv_2"),conv_3:r(128,256,3,"prediction_layer/conv_3"),conv_4:r(256,128,1,"prediction_layer/conv_4"),conv_5:r(128,256,3,"prediction_layer/conv_5"),conv_6:r(256,64,1,"prediction_layer/conv_6"),conv_7:r(64,128,3,"prediction_layer/conv_7"),box_predictor_0:{box_encoding_predictor:n(512,12,1,"prediction_layer/box_predictor_0/box_encoding_predictor"),class_predictor:n(512,9,1,"prediction_layer/box_predictor_0/class_predictor")},box_predictor_1:{box_encoding_predictor:n(1024,24,1,"prediction_layer/box_predictor_1/box_encoding_predictor"),class_predictor:n(1024,18,1,"prediction_layer/box_predictor_1/class_predictor")},box_predictor_2:{box_encoding_predictor:n(512,24,1,"prediction_layer/box_predictor_2/box_encoding_predictor"),class_predictor:n(512,18,1,"prediction_layer/box_predictor_2/class_predictor")},box_predictor_3:{box_encoding_predictor:n(256,24,1,"prediction_layer/box_predictor_3/box_encoding_predictor"),class_predictor:n(256,18,1,"prediction_layer/box_predictor_3/class_predictor")},box_predictor_4:{box_encoding_predictor:n(256,24,1,"prediction_layer/box_predictor_4/box_encoding_predictor"),class_predictor:n(256,18,1,"prediction_layer/box_predictor_4/class_predictor")},box_predictor_5:{box_encoding_predictor:n(128,24,1,"prediction_layer/box_predictor_5/box_encoding_predictor"),class_predictor:n(128,18,1,"prediction_layer/box_predictor_5/class_predictor")}}}}}function Me(t){var e=[],n=function(t,e){var n=$t(t,e);function r(t,e,r){return{filters:n(t+"/Conv2d_"+e+"_pointwise/weights",4,r+"/filters"),batch_norm_offset:n(t+"/Conv2d_"+e+"_pointwise/convolution_bn_offset",1,r+"/batch_norm_offset")}}function i(t){var e="mobilenetv1/conv_"+t,i="MobilenetV1/Conv2d_"+t+"_depthwise",o=e+"/depthwise_conv",s=e+"/pointwise_conv";return{depthwise_conv:{filters:n(i+"/depthwise_weights",4,o+"/filters"),batch_norm_scale:n(i+"/BatchNorm/gamma",1,o+"/batch_norm_scale"),batch_norm_offset:n(i+"/BatchNorm/beta",1,o+"/batch_norm_offset"),batch_norm_mean:n(i+"/BatchNorm/moving_mean",1,o+"/batch_norm_mean"),batch_norm_variance:n(i+"/BatchNorm/moving_variance",1,o+"/batch_norm_variance")},pointwise_conv:r("MobilenetV1",t,s)}}function o(t,e){return{filters:n(t+"/weights",4,e+"/filters"),bias:n(t+"/biases",1,e+"/bias")}}function s(t){return{box_encoding_predictor:o("Prediction/BoxPredictor_"+t+"/BoxEncodingPredictor","prediction_layer/box_predictor_"+t+"/box_encoding_predictor"),class_predictor:o("Prediction/BoxPredictor_"+t+"/ClassPredictor","prediction_layer/box_predictor_"+t+"/class_predictor")}}return{extractMobilenetV1Params:function(){return{conv_0:r("MobilenetV1",0,"mobilenetv1/conv_0"),conv_1:i(1),conv_2:i(2),conv_3:i(3),conv_4:i(4),conv_5:i(5),conv_6:i(6),conv_7:i(7),conv_8:i(8),conv_9:i(9),conv_10:i(10),conv_11:i(11),conv_12:i(12),conv_13:i(13)}},extractPredictionLayerParams:function(){return{conv_0:r("Prediction",0,"prediction_layer/conv_0"),conv_1:r("Prediction",1,"prediction_layer/conv_1"),conv_2:r("Prediction",2,"prediction_layer/conv_2"),conv_3:r("Prediction",3,"prediction_layer/conv_3"),conv_4:r("Prediction",4,"prediction_layer/conv_4"),conv_5:r("Prediction",5,"prediction_layer/conv_5"),conv_6:r("Prediction",6,"prediction_layer/conv_6"),conv_7:r("Prediction",7,"prediction_layer/conv_7"),box_predictor_0:s(0),box_predictor_1:s(1),box_predictor_2:s(2),box_predictor_3:s(3),box_predictor_4:s(4),box_predictor_5:s(5)}}}}(t,e),r=n.extractMobilenetV1Params,i=n.extractPredictionLayerParams,o=t["Output/extra_dim"];if(e.push({originalPath:"Output/extra_dim",paramPath:"output_layer/extra_dim"}),!d(o))throw new Error("expected weightMap['Output/extra_dim'] to be a Tensor3D, instead have "+o);var s={mobilenetv1:r(),prediction_layer:i(),output_layer:{extra_dim:o}};return Mt(t,e),{params:s,paramMappings:e}}function Le(t,e,n){return o.L(function(){var r=o.i(t,e.filters,n,"same");return r=o.c(r,e.batch_norm_offset),o.g(r,0,6)})}var Pe=.0010000000474974513;function Fe(t,e){return o.L(function(){var n=null,r=Le(t,e.conv_0,[2,2]);if([e.conv_1,e.conv_2,e.conv_3,e.conv_4,e.conv_5,e.conv_6,e.conv_7,e.conv_8,e.conv_9,e.conv_10,e.conv_11,e.conv_12,e.conv_13].forEach(function(t,e){var i,s,a,l=e+1,u=function(t){return[2,4,6,12].some(function(e){return e===t})?[2,2]:[1,1]}(l);i=r,s=t.depthwise_conv,a=u,r=Le(r=o.L(function(){var t=o.j(i,s.filters,a,"same");return t=o.e(t,s.batch_norm_mean,s.batch_norm_variance,s.batch_norm_offset,s.batch_norm_scale,Pe),o.g(t,0,6)}),t.pointwise_conv,[1,1]),11===l&&(n=r)}),null===n)throw new Error("mobileNetV1 - output of conv layer 11 is null");return{out:r,conv11:n}})}function Be(t,e,n){var r=t.arraySync(),i=Math.min(r[e][0],r[e][2]),o=Math.min(r[e][1],r[e][3]),s=Math.max(r[e][0],r[e][2]),a=Math.max(r[e][1],r[e][3]),l=Math.min(r[n][0],r[n][2]),u=Math.min(r[n][1],r[n][3]),c=Math.max(r[n][0],r[n][2]),h=Math.max(r[n][1],r[n][3]),d=(s-i)*(a-o),p=(c-l)*(h-u);if(d<=0||p<=0)return 0;var f=Math.max(i,l),g=Math.max(o,u),m=Math.min(s,c),v=Math.min(a,h),b=Math.max(m-f,0)*Math.max(v-g,0);return b/(d+p-b)}function je(t,e){var n=function(t){var e=o.O(o.N(t,[1,0])),n=[o.F(e[2],e[0]),o.F(e[3],e[1])];return{sizes:n,centers:[o.c(e[0],o.k(n[0],o.y(2))),o.c(e[1],o.k(n[1],o.y(2)))]}}(t),r=n.sizes,i=n.centers,s=o.O(o.N(e,[1,0])),a=o.k(o.t(o.l(o.k(s[2],o.y(5))),r[0]),o.y(2)),l=o.c(o.t(o.k(s[0],o.y(10)),r[0]),i[0]),u=o.k(o.t(o.l(o.k(s[3],o.y(5))),r[1]),o.y(2)),c=o.c(o.t(o.k(s[1],o.y(10)),r[1]),i[1]);return o.N(o.E([o.F(l,a),o.F(c,u),o.c(l,a),o.c(c,u)]),[1,0])}function $e(t,e){return o.L(function(){var n=t.shape[0];return{boxPredictionEncoding:o.x(Dt(t,e.box_encoding_predictor),[n,-1,1,4]),classPrediction:o.x(Dt(t,e.class_predictor),[n,-1,3])}})}var Ue=function(){function t(t){var e=void 0===t?{}:t,n=e.minConfidence,r=e.maxResults;if(this._name="SsdMobilenetv1Options",this._minConfidence=n||.5,this._maxResults=r||100,"number"!=typeof this._minConfidence||this._minConfidence<=0||this._minConfidence>=1)throw new Error(this._name+" - expected minConfidence to be a number between 0 and 1");if("number"!=typeof this._maxResults)throw new Error(this._name+" - expected maxResults to be a number")}return Object.defineProperty(t.prototype,"minConfidence",{get:function(){return this._minConfidence},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"maxResults",{get:function(){return this._maxResults},enumerable:!0,configurable:!0}),t}(),Ve=function(t){function e(){return t.call(this,"SsdMobilenetv1")||this}return Object(a.c)(e,t),e.prototype.forwardInput=function(t){var e=this.params;if(!e)throw new Error("SsdMobilenetv1 - load model before inference");return o.L(function(){var n=t.toBatchTensor(512,!1).toFloat(),r=Fe(o.F(o.t(n,o.y(.007843137718737125)),o.y(1)),e.mobilenetv1),i=function(t,e,n){return o.L(function(){var r=Le(Le(t,n.conv_0,[1,1]),n.conv_1,[2,2]),i=Le(Le(r,n.conv_2,[1,1]),n.conv_3,[2,2]),s=Le(Le(i,n.conv_4,[1,1]),n.conv_5,[2,2]),a=Le(Le(s,n.conv_6,[1,1]),n.conv_7,[2,2]),l=$e(e,n.box_predictor_0),u=$e(t,n.box_predictor_1),c=$e(r,n.box_predictor_2),h=$e(i,n.box_predictor_3),d=$e(s,n.box_predictor_4),p=$e(a,n.box_predictor_5);return{boxPredictions:o.h([l.boxPredictionEncoding,u.boxPredictionEncoding,c.boxPredictionEncoding,h.boxPredictionEncoding,d.boxPredictionEncoding,p.boxPredictionEncoding],1),classPredictions:o.h([l.classPrediction,u.classPrediction,c.classPrediction,h.classPrediction,d.classPrediction,p.classPrediction],1)}})}(r.out,r.conv11,e.prediction_layer);return function(t,e,n){return o.L(function(){var r=t.shape[0],i=je(o.x(o.M(n.extra_dim,[r,1,1]),[-1,4]),o.x(t,[-1,4]));i=o.x(i,[r,i.shape[0]/r,4]);var s=o.A(o.B(e,[0,0,1],[-1,-1,-1])),a=o.B(s,[0,0,0],[-1,-1,1]);return a=o.x(a,[r,a.shape[1]]),{boxes:o.O(i),scores:o.O(a)}})}(i.boxPredictions,i.classPredictions,e.output_layer)})},e.prototype.forward=function(t){return Object(a.b)(this,void 0,void 0,function(){var e;return Object(a.d)(this,function(n){switch(n.label){case 0:return e=this.forwardInput,[4,_t(t)];case 1:return[2,e.apply(this,[n.sent()])]}})})},e.prototype.locateFaces=function(t,e){return void 0===e&&(e={}),Object(a.b)(this,void 0,void 0,function(){var n,r,i,o,s,l,u,c,h,d,p,f,g,m,v,b,_,y,T,x;return Object(a.d)(this,function(a){switch(a.label){case 0:return n=new Ue(e),r=n.maxResults,i=n.minConfidence,[4,_t(t)];case 1:for(o=a.sent(),s=this.forwardInput(o),l=s.boxes,u=s.scores,c=l[0],h=u[0],d=1;d<l.length;d++)l[d].dispose(),u[d].dispose();return g=(f=Array).from,[4,h.data()];case 2:return p=g.apply(f,[a.sent()]),m=function(t,e,n,r,i){var o=t.shape[0],s=Math.min(n,o),a=[];return e.map(function(t,e){return{score:t,boxIndex:e}}).filter(function(t){return t.score>i}).sort(function(t,e){return e.score-t.score}).forEach(function(e){if(!(a.length>=s)){for(var n=e.score,o=a.length-1;o>=0;--o){var l=Be(t,e.boxIndex,a[o]);if(0!==l&&(e.score*=l<=r?1:0,e.score<=i))break}n===e.score&&a.push(e.boxIndex)}}),a}(c,p,r,.5,i),v=o.getReshapedInputDimensions(0),b=o.inputSize,_=b/v.width,y=b/v.height,T=c.arraySync(),x=m.map(function(t){var e=[Math.max(0,T[t][0]),Math.min(1,T[t][2])].map(function(t){return t*y}),n=e[0],r=e[1],i=[Math.max(0,T[t][1]),Math.min(1,T[t][3])].map(function(t){return t*_}),s=i[0],a=i[1];return new k(p[t],new P(s,n,a-s,r-n),{height:o.getInputHeight(0),width:o.getInputWidth(0)})}),c.dispose(),h.dispose(),[2,x]}})})},e.prototype.getDefaultModelName=function(){return"ssd_mobilenetv1_model"},e.prototype.extractParamsFromWeigthMap=function(t){return Me(t)},e.prototype.extractParams=function(t){return function(t){var e=[],n=Ut(t),r=n.extractWeights,i=n.getRemainingWeights,s=De(r,e),a=s.extractMobilenetV1Params,l=s.extractPredictionLayerParams,u=a(),c=l(),h={extra_dim:o.J(r(20472),[1,5118,4])};if(e.push({paramPath:"output_layer/extra_dim"}),0!==i().length)throw new Error("weights remaing after extract: "+i().length);return{params:{mobilenetv1:u,prediction_layer:c,output_layer:h},paramMappings:e}}(t)},e}(It);function He(t){var e=new Ve;return e.extractWeights(t),e}function We(t){return He(t)}var Ge,ze=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(a.c)(e,t),e}(Ve),Xe=.4,Ke=[new E(.738768,.874946),new E(2.42204,2.65704),new E(4.30971,7.04493),new E(10.246,4.59428),new E(12.6868,11.8741)],Ye=[new E(1.603231,2.094468),new E(6.041143,7.080126),new E(2.882459,3.518061),new E(4.266906,5.178857),new E(9.041765,10.66308)],qe=[117.001,114.697,97.404],Je=function(t){return"number"==typeof t};function Ze(t){if(!t)throw new Error("invalid config: "+t);if("boolean"!=typeof t.withSeparableConvs)throw new Error("config.withSeparableConvs has to be a boolean, have: "+t.withSeparableConvs);if(!Je(t.iouThreshold)||t.iouThreshold<0||t.iouThreshold>1)throw new Error("config.iouThreshold has to be a number between [0, 1], have: "+t.iouThreshold);if(!Array.isArray(t.classes)||!t.classes.length||!t.classes.every(function(t){return"string"==typeof t}))throw new Error("config.classes has to be an array class names: string[], have: "+JSON.stringify(t.classes));if(!Array.isArray(t.anchors)||!t.anchors.length||!t.anchors.map(function(t){return t||{}}).every(function(t){return Je(t.x)&&Je(t.y)}))throw new Error("config.anchors has to be an array of { x: number, y: number }, have: "+JSON.stringify(t.anchors));if(t.meanRgb&&(!Array.isArray(t.meanRgb)||3!==t.meanRgb.length||!t.meanRgb.every(Je)))throw new Error("config.meanRgb has to be an array of shape [number, number, number], have: "+JSON.stringify(t.meanRgb))}function Qe(t){return o.L(function(){var e=o.t(t,o.y(.10000000149011612));return o.c(o.w(o.F(t,e)),e)})}function tn(t,e){return o.L(function(){var n=o.v(t,[[0,0],[1,1],[1,1],[0,0]]);return n=o.i(n,e.conv.filters,[1,1],"valid"),n=o.F(n,e.bn.sub),n=o.t(n,e.bn.truediv),Qe(n=o.c(n,e.conv.bias))})}function en(t,e){return o.L(function(){var n=o.v(t,[[0,0],[1,1],[1,1],[0,0]]);return n=o.z(n,e.depthwise_filter,e.pointwise_filter,[1,1],"valid"),Qe(n=o.c(n,e.bias))})}function nn(t,e){var n=Lt(t,e);var r=Bt(t,e);return{extractConvParams:n,extractConvWithBatchNormParams:function(r,i,s){return{conv:n(r,i,3,s+"/conv"),bn:function(n,r){var i=o.H(t(n)),s=o.H(t(n));return e.push({paramPath:r+"/sub"},{paramPath:r+"/truediv"}),{sub:i,truediv:s}}(i,s+"/bn")}},extractSeparableConvParams:r}}function rn(t,e){var n=$t(t,e);function r(t){return{filters:n(t+"/filters",4),bias:n(t+"/bias",1)}}return{extractConvParams:r,extractConvWithBatchNormParams:function(t){return{conv:r(t+"/conv"),bn:function(t){return{sub:n(t+"/sub",1),truediv:n(t+"/truediv",1)}}(t+"/bn")}},extractSeparableConvParams:jt(n)}}!function(t){t[t.XS=224]="XS",t[t.SM=320]="SM",t[t.MD=416]="MD",t[t.LG=608]="LG"}(Ge||(Ge={}));var on=function(){function t(t){var e=void 0===t?{}:t,n=e.inputSize,r=e.scoreThreshold;if(this._name="TinyYolov2Options",this._inputSize=n||416,this._scoreThreshold=r||.5,"number"!=typeof this._inputSize||this._inputSize%32!=0)throw new Error(this._name+" - expected inputSize to be a number divisible by 32");if("number"!=typeof this._scoreThreshold||this._scoreThreshold<=0||this._scoreThreshold>=1)throw new Error(this._name+" - expected scoreThreshold to be a number between 0 and 1")}return Object.defineProperty(t.prototype,"inputSize",{get:function(){return this._inputSize},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"scoreThreshold",{get:function(){return this._scoreThreshold},enumerable:!0,configurable:!0}),t}(),sn=function(t){function e(e){var n=t.call(this,"TinyYolov2")||this;return Ze(e),n._config=e,n}return Object(a.c)(e,t),Object.defineProperty(e.prototype,"config",{get:function(){return this._config},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"withClassScores",{get:function(){return this.config.withClassScores||this.config.classes.length>1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"boxEncodingSize",{get:function(){return 5+(this.withClassScores?this.config.classes.length:0)},enumerable:!0,configurable:!0}),e.prototype.runTinyYolov2=function(t,e){var n=tn(t,e.conv0);return n=tn(n=o.s(n,[2,2],[2,2],"same"),e.conv1),n=tn(n=o.s(n,[2,2],[2,2],"same"),e.conv2),n=tn(n=o.s(n,[2,2],[2,2],"same"),e.conv3),n=tn(n=o.s(n,[2,2],[2,2],"same"),e.conv4),n=tn(n=o.s(n,[2,2],[2,2],"same"),e.conv5),Dt(n=tn(n=tn(n=o.s(n,[2,2],[1,1],"same"),e.conv6),e.conv7),e.conv8,"valid",!1)},e.prototype.runMobilenet=function(t,e){var n=this.config.isFirstLayerConv2d?Qe(Dt(t,e.conv0,"valid",!1)):en(t,e.conv0);return n=en(n=o.s(n,[2,2],[2,2],"same"),e.conv1),n=en(n=o.s(n,[2,2],[2,2],"same"),e.conv2),n=en(n=o.s(n,[2,2],[2,2],"same"),e.conv3),n=en(n=o.s(n,[2,2],[2,2],"same"),e.conv4),n=en(n=o.s(n,[2,2],[2,2],"same"),e.conv5),n=o.s(n,[2,2],[1,1],"same"),n=e.conv6?en(n,e.conv6):n,Dt(n=e.conv7?en(n,e.conv7):n,e.conv8,"valid",!1)},e.prototype.forwardInput=function(t,e){var n=this,r=this.params;if(!r)throw new Error("TinyYolov2 - load model before inference");return o.L(function(){var i=t.toBatchTensor(e,!1).toFloat();return i=(i=n.config.meanRgb?A(i,n.config.meanRgb):i).div(o.y(256)),n.config.withSeparableConvs?n.runMobilenet(i,r):n.runTinyYolov2(i,r)})},e.prototype.forward=function(t,e){return Object(a.b)(this,void 0,void 0,function(){var n;return Object(a.d)(this,function(r){switch(r.label){case 0:return n=this.forwardInput,[4,_t(t)];case 1:return[4,n.apply(this,[r.sent(),e])];case 2:return[2,r.sent()]}})})},e.prototype.detect=function(t,e){return void 0===e&&(e={}),Object(a.b)(this,void 0,void 0,function(){var n,r,i,s,l,u,c,h,d,p,f,g,m,v=this;return Object(a.d)(this,function(a){switch(a.label){case 0:return n=new on(e),r=n.inputSize,i=n.scoreThreshold,[4,_t(t)];case 1:return s=a.sent(),[4,this.forwardInput(s,r)];case 2:return l=a.sent(),u=o.L(function(){return o.O(l)[0].expandDims()}),c={width:s.getInputWidth(0),height:s.getInputHeight(0)},[4,this.extractBoxes(u,s.getReshapedInputDimensions(0),i)];case 3:return h=a.sent(),l.dispose(),u.dispose(),d=h.map(function(t){return t.box}),p=h.map(function(t){return t.score}),f=h.map(function(t){return t.classScore}),g=h.map(function(t){return v.config.classes[t.label]}),m=R(d.map(function(t){return t.rescale(r)}),p,this.config.iouThreshold,!0),[2,m.map(function(t){return new S(p[t],f[t],g[t],d[t],c)})]}})})},e.prototype.getDefaultModelName=function(){return""},e.prototype.extractParamsFromWeigthMap=function(t){return function(t,e){var n,r=[],i=rn(t,r),o=i.extractConvParams,s=i.extractConvWithBatchNormParams,a=i.extractSeparableConvParams;if(e.withSeparableConvs){var l=e.filterSizes&&e.filterSizes.length||9;n={conv0:e.isFirstLayerConv2d?o("conv0"):a("conv0"),conv1:a("conv1"),conv2:a("conv2"),conv3:a("conv3"),conv4:a("conv4"),conv5:a("conv5"),conv6:l>7?a("conv6"):void 0,conv7:l>8?a("conv7"):void 0,conv8:o("conv8")}}else n={conv0:s("conv0"),conv1:s("conv1"),conv2:s("conv2"),conv3:s("conv3"),conv4:s("conv4"),conv5:s("conv5"),conv6:s("conv6"),conv7:s("conv7"),conv8:o("conv8")};return Mt(t,r),{params:n,paramMappings:r}}(t,this.config)},e.prototype.extractParams=function(t){var n=this.config.filterSizes||e.DEFAULT_FILTER_SIZES,r=n?n.length:void 0;if(7!==r&&8!==r&&9!==r)throw new Error("TinyYolov2 - expected 7 | 8 | 9 convolutional filters, but found "+r+" filterSizes in config");return function(t,e,n,r){var i,o=Ut(t),s=o.extractWeights,a=o.getRemainingWeights,l=[],u=nn(s,l),c=u.extractConvParams,h=u.extractConvWithBatchNormParams,d=u.extractSeparableConvParams;if(e.withSeparableConvs){var p=r[0],f=r[1],g=r[2],m=r[3],v=r[4],b=r[5],_=r[6],y=r[7],T=r[8];i={conv0:e.isFirstLayerConv2d?c(p,f,3,"conv0"):d(p,f,"conv0"),conv1:d(f,g,"conv1"),conv2:d(g,m,"conv2"),conv3:d(m,v,"conv3"),conv4:d(v,b,"conv4"),conv5:d(b,_,"conv5"),conv6:y?d(_,y,"conv6"):void 0,conv7:T?d(y,T,"conv7"):void 0,conv8:c(T||y||_,5*n,1,"conv8")}}else p=r[0],f=r[1],g=r[2],m=r[3],v=r[4],b=r[5],_=r[6],y=r[7],T=r[8],i={conv0:h(p,f,"conv0"),conv1:h(f,g,"conv1"),conv2:h(g,m,"conv2"),conv3:h(m,v,"conv3"),conv4:h(v,b,"conv4"),conv5:h(b,_,"conv5"),conv6:h(_,y,"conv6"),conv7:h(y,T,"conv7"),conv8:c(T,5*n,1,"conv8")};if(0!==a().length)throw new Error("weights remaing after extract: "+a().length);return{params:i,paramMappings:l}}(t,this.config,this.boxEncodingSize,n)},e.prototype.extractBoxes=function(t,e,n){return Object(a.b)(this,void 0,void 0,function(){var r,i,s,l,u,c,h,d,p,f,g,m,v,b,_,y,T,x,E,w,S,k,O,I,R,A,N,D,L,P=this;return Object(a.d)(this,function(F){switch(F.label){case 0:return r=e.width,i=e.height,s=Math.max(r,i),l=s/r,u=s/i,c=t.shape[1],h=this.config.anchors.length,d=o.L(function(){var e=t.reshape([c,c,h,P.boxEncodingSize]);return[e.slice([0,0,0,0],[c,c,h,4]),e.slice([0,0,0,4],[c,c,h,1]),P.withClassScores?o.D(e.slice([0,0,0,5],[c,c,h,P.config.classes.length]),3):o.y(0)]}),p=d[0],f=d[1],g=d[2],m=[],[4,f.array()];case 1:return v=F.sent(),[4,p.array()];case 2:b=F.sent(),_=0,F.label=3;case 3:if(!(_<c))return[3,12];y=0,F.label=4;case 4:if(!(y<c))return[3,11];T=0,F.label=5;case 5:return T<h?(x=M(v[_][y][T][0]),!n||x>n?(E=(y+M(b[_][y][T][0]))/c*l,w=(_+M(b[_][y][T][1]))/c*u,S=Math.exp(b[_][y][T][2])*this.config.anchors[T].x/c*l,k=Math.exp(b[_][y][T][3])*this.config.anchors[T].y/c*u,O=E-S/2,I=w-k/2,R={row:_,col:y,anchor:T},this.withClassScores?[4,this.extractPredictedClass(g,R)]:[3,7]):[3,9]):[3,10];case 6:return L=F.sent(),[3,8];case 7:L={classScore:1,label:0},F.label=8;case 8:N=(A=L).classScore,D=A.label,m.push(Object(a.a)({box:new C(O,I,O+S,I+k),score:x,classScore:x*N,label:D},R)),F.label=9;case 9:return T++,[3,5];case 10:return y++,[3,4];case 11:return _++,[3,3];case 12:return p.dispose(),f.dispose(),g.dispose(),[2,m]}})})},e.prototype.extractPredictedClass=function(t,e){return Object(a.b)(this,void 0,void 0,function(){var n,r,i,o;return Object(a.d)(this,function(s){switch(s.label){case 0:return n=e.row,r=e.col,i=e.anchor,[4,t.array()];case 1:return o=s.sent(),[2,Array(this.config.classes.length).fill(0).map(function(t,e){return o[n][r][i][e]}).map(function(t,e){return{classScore:t,label:e}}).reduce(function(t,e){return t.classScore>e.classScore?t:e})]}})})},e.DEFAULT_FILTER_SIZES=[3,16,32,64,128,256,512,1024,1024],e}(It),an=function(t){function e(e){void 0===e&&(e=!0);var n=Object.assign({},{withSeparableConvs:e,iouThreshold:Xe,classes:["face"]},e?{anchors:Ye,meanRgb:qe}:{anchors:Ke,withClassScores:!0});return t.call(this,n)||this}return Object(a.c)(e,t),Object.defineProperty(e.prototype,"withSeparableConvs",{get:function(){return this.config.withSeparableConvs},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"anchors",{get:function(){return this.config.anchors},enumerable:!0,configurable:!0}),e.prototype.locateFaces=function(t,e){return Object(a.b)(this,void 0,void 0,function(){return Object(a.d)(this,function(n){switch(n.label){case 0:return[4,this.detect(t,e)];case 1:return[2,n.sent().map(function(t){return new k(t.score,t.relativeBox,{width:t.imageWidth,height:t.imageHeight})})]}})})},e.prototype.getDefaultModelName=function(){return this.withSeparableConvs?"tiny_yolov2_separable_conv_model":"tiny_yolov2_model"},e.prototype.extractParamsFromWeigthMap=function(e){return t.prototype.extractParamsFromWeigthMap.call(this,e)},e}(sn);function ln(t,e){void 0===e&&(e=!0);var n=new an(e);return n.extractWeights(t),n}var un=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._name="TinyFaceDetectorOptions",e}return Object(a.c)(e,t),e}(on),cn=function(){function t(){}return t.prototype.then=function(t){return Object(a.b)(this,void 0,void 0,function(){var e;return Object(a.d)(this,function(n){switch(n.label){case 0:return e=t,[4,this.run()];case 1:return[2,e.apply(void 0,[n.sent()])]}})})},t.prototype.run=function(){return Object(a.b)(this,void 0,void 0,function(){return Object(a.d)(this,function(t){throw new Error("ComposableTask - run is not implemented")})})},t}();function hn(t,e,n,r,i){return void 0===i&&(i=function(t){return t.alignedRect}),Object(a.b)(this,void 0,void 0,function(){var s,l,u,c,h;return Object(a.d)(this,function(a){switch(a.label){case 0:return s=t.map(function(t){return ee(t)?i(t):t.detection}),(u=r)?[3,5]:e instanceof o.a?[4,Tt(e,s)]:[3,2];case 1:return c=a.sent(),[3,4];case 2:return[4,yt(e,s)];case 3:c=a.sent(),a.label=4;case 4:u=c,a.label=5;case 5:return[4,n(l=u)];case 6:return h=a.sent(),l.forEach(function(t){return t instanceof o.a&&t.dispose()}),[2,h]}})})}function dn(t,e,n,r,i){return Object(a.b)(this,void 0,void 0,function(){var o=this;return Object(a.d)(this,function(s){return[2,hn([t],e,function(t){return Object(a.b)(o,void 0,void 0,function(){return Object(a.d)(this,function(e){return[2,n(t[0])]})})},r,i)]})})}var pn=2,fn=12;function gn(t){var e=Ut(t),n=e.extractWeights,r=e.getRemainingWeights,i=[],s=function(t,e){var n=Lt(t,e),r=Pt(t,e);function i(n,r){var i=o.H(t(n));return e.push({paramPath:r}),i}function s(t,e,r){return void 0===r&&(r=!1),{conv1:n(t[0],t[1],3,e+"/conv1"),prelu1_alpha:i(t[1],e+"/prelu1_alpha"),conv2:n(t[1],t[2],3,e+"/conv2"),prelu2_alpha:i(t[2],e+"/prelu2_alpha"),conv3:n(t[2],t[3],r?2:3,e+"/conv3"),prelu3_alpha:i(t[3],e+"/prelu3_alpha")}}return{extractPNetParams:function(){var t=s([3,10,16,32],"pnet"),e=n(32,2,1,"pnet/conv4_1"),r=n(32,4,1,"pnet/conv4_2");return Object(a.a)(Object(a.a)({},t),{conv4_1:e,conv4_2:r})},extractRNetParams:function(){var t=s([3,28,48,64],"rnet",!0),e=r(576,128,"rnet/fc1"),n=i(128,"rnet/prelu4_alpha"),o=r(128,2,"rnet/fc2_1"),l=r(128,4,"rnet/fc2_2");return Object(a.a)(Object(a.a)({},t),{fc1:e,prelu4_alpha:n,fc2_1:o,fc2_2:l})},extractONetParams:function(){var t=s([3,32,64,64],"onet"),e=n(64,128,2,"onet/conv4"),o=i(128,"onet/prelu4_alpha"),l=r(1152,256,"onet/fc1"),u=i(256,"onet/prelu5_alpha"),c=r(256,2,"onet/fc2_1"),h=r(256,4,"onet/fc2_2"),d=r(256,10,"onet/fc2_3");return Object(a.a)(Object(a.a)({},t),{conv4:e,prelu4_alpha:o,fc1:l,prelu5_alpha:u,fc2_1:c,fc2_2:h,fc2_3:d})}}}(n,i),l=s.extractPNetParams,u=s.extractRNetParams,c=s.extractONetParams,h=l(),d=u(),p=c();if(0!==r().length)throw new Error("weights remaing after extract: "+r().length);return{params:{pnet:h,rnet:d,onet:p},paramMappings:i}}function mn(t){var e=[],n=function(t,e){var n=$t(t,e);function r(t){return{filters:n(t+"/weights",4,t+"/filters"),bias:n(t+"/bias",1)}}function i(t){return{weights:n(t+"/weights",2),bias:n(t+"/bias",1)}}function o(t){return n(t,1)}function s(t){return{conv1:r(t+"/conv1"),prelu1_alpha:o(t+"/prelu1_alpha"),conv2:r(t+"/conv2"),prelu2_alpha:o(t+"/prelu2_alpha"),conv3:r(t+"/conv3"),prelu3_alpha:o(t+"/prelu3_alpha")}}return{extractPNetParams:function(){var t=s("pnet"),e=r("pnet/conv4_1"),n=r("pnet/conv4_2");return Object(a.a)(Object(a.a)({},t),{conv4_1:e,conv4_2:n})},extractRNetParams:function(){var t=s("rnet"),e=i("rnet/fc1"),n=o("rnet/prelu4_alpha"),r=i("rnet/fc2_1"),l=i("rnet/fc2_2");return Object(a.a)(Object(a.a)({},t),{fc1:e,prelu4_alpha:n,fc2_1:r,fc2_2:l})},extractONetParams:function(){var t=s("onet"),e=r("onet/conv4"),n=o("onet/prelu4_alpha"),l=i("onet/fc1"),u=o("onet/prelu5_alpha"),c=i("onet/fc2_1"),h=i("onet/fc2_2"),d=i("onet/fc2_3");return Object(a.a)(Object(a.a)({},t),{conv4:e,prelu4_alpha:n,fc1:l,prelu5_alpha:u,fc2_1:c,fc2_2:h,fc2_3:d})}}}(t,e),r=n.extractPNetParams,i=n.extractRNetParams,o=n.extractONetParams,s=r(),l=i(),u=o();return Mt(t,e),{params:{pnet:s,rnet:l,onet:u},paramMappings:e}}function vn(t,e){var n=e[0],r=e[1];return{height:Math.floor(n*t),width:Math.floor(r*t)}}var bn=function(t){function e(e,n,r,i){return t.call(this,{left:e,top:n,right:r,bottom:i},!0)||this}return Object(a.c)(e,t),e}(w);function _n(t){return o.L(function(){return o.t(o.F(t,o.y(127.5)),o.y(.0078125))})}function yn(t,e){return o.L(function(){return o.c(o.w(t),o.t(e,o.u(o.w(o.u(t)))))})}function Tn(t,e,n){return void 0===n&&(n=!1),o.L(function(){var r=Dt(t,e.conv1,"valid");return r=yn(r,e.prelu1_alpha),r=yn(r=Dt(r=o.s(r,n?[2,2]:[3,3],[2,2],"same"),e.conv2,"valid"),e.prelu2_alpha),r=yn(r=Dt(r=n?r:o.s(r,[3,3],[2,2],"valid"),e.conv3,"valid"),e.prelu3_alpha)})}function xn(t,e,n,r,i){i.stage1=[];var s=e.map(function(e){return o.L(function(){var n={scale:e},i=function(t,e){return o.L(function(){var n=vn(e,t.shape.slice(1)),r=n.height,i=n.width,s=_n(o.o.resizeBilinear(t,[r,i]));return o.N(s,[0,2,1,3])})}(t,e),s=Date.now(),a=function(t,e){return o.L(function(){var n=Tn(t,e,!0),r=Dt(n,e.conv4_1,"valid"),i=o.m(o.r(r,3),3);return{prob:o.D(o.F(r,i),3),regions:Dt(n,e.conv4_2,"valid")}})}(i,r),l=a.prob,u=a.regions;return n.pnet=Date.now()-s,{scoresTensor:o.O(o.O(l,3)[1])[0],regionsTensor:o.O(u)[0],scale:e,statsForScale:n}})}).map(function(t){var e=t.scoresTensor,r=t.regionsTensor,o=t.scale,s=t.statsForScale,a=function(t,e,n,r){for(var i=[],o=t.arraySync(),s=0;s<t.shape[0];s++)for(var a=0;a<t.shape[1];a++)o[s][a]>=r&&i.push(new E(a,s));return i.map(function(t){var r=new C(Math.round((t.y*pn+1)/n),Math.round((t.x*pn+1)/n),Math.round((t.y*pn+fn)/n),Math.round((t.x*pn+fn)/n)),i=o[t.y][t.x],s=e.arraySync();return{cell:r,score:i,region:new bn(s[t.y][t.x][0],s[t.y][t.x][1],s[t.y][t.x][2],s[t.y][t.x][3])}})}(e,r,o,n);if(e.dispose(),r.dispose(),!a.length)return i.stage1.push(s),[];var l=Date.now(),u=R(a.map(function(t){return t.cell}),a.map(function(t){return t.score}),.5);return s.nms=Date.now()-l,s.numBoxes=u.length,i.stage1.push(s),u.map(function(t){return a[t]})}).reduce(function(t,e){return t.concat(e)},[]),a=[],l=[];if(s.length>0){var u=Date.now(),c=R(s.map(function(t){return t.cell}),s.map(function(t){return t.score}),.7);i.stage1_nms=Date.now()-u,l=c.map(function(t){return s[t].score}),a=c.map(function(t){return s[t]}).map(function(t){var e=t.cell,n=t.region;return new C(e.left+n.left*e.width,e.top+n.top*e.height,e.right+n.right*e.width,e.bottom+n.bottom*e.height).toSquare().round()})}return{boxes:a,scores:l}}function En(t,e,n){var r=n.width,i=n.height;return Object(a.b)(this,void 0,void 0,function(){var n,s,l,u=this;return Object(a.d)(this,function(c){switch(c.label){case 0:return n=rt(t),[4,Promise.all(e.map(function(e){return Object(a.b)(u,void 0,void 0,function(){var r,i,o,s,l,u,c,h;return Object(a.d)(this,function(a){return r=e.padAtBorders(t.height,t.width),i=r.y,o=r.ey,s=r.x,l=r.ex,u=s-1,c=i-1,h=n.getImageData(u,c,l-u,o-c),[2,et.isNodejs()?ft(h):createImageBitmap(h)]})})}))];case 1:return s=c.sent(),l=[],s.forEach(function(t){var e=rt(pt({width:r,height:i}));e.drawImage(t,0,0,r,i);for(var n=e.getImageData(0,0,r,i).data,o=[],s=0;s<n.length;s+=4)o.push(n[s+2]),o.push(n[s+1]),o.push(n[s]);l.push(o)}),[2,l.map(function(t){return o.L(function(){return _n(o.N(o.K(t,[1,r,i,3]),[0,2,1,3]).toFloat())})})]}})})}function wn(t,e,n,r,i){return Object(a.b)(this,void 0,void 0,function(){var s,l,u,c,h,d,p,f,g,m,v,b,_,y;return Object(a.d)(this,function(a){switch(a.label){case 0:return s=Date.now(),[4,En(t,e,{width:24,height:24})];case 1:return l=a.sent(),i.stage2_extractImagePatches=Date.now()-s,s=Date.now(),u=l.map(function(t){var e=function(t,e){return o.L(function(){var n=Tn(t,e),r=yn(zt(o.x(n,[n.shape[0],e.fc1.weights.shape[0]]),e.fc1),e.prelu4_alpha),i=zt(r,e.fc2_1),s=o.m(o.r(i,1),1),a=o.D(o.F(i,s),1),l=zt(r,e.fc2_2);return{scores:o.O(a,1)[1],regions:l}})}(t,r);return t.dispose(),e}),i.stage2_rnet=Date.now()-s,c=u.length>1?o.h(u.map(function(t){return t.scores})):u[0].scores,p=(d=Array).from,[4,c.data()];case 2:return h=p.apply(d,[a.sent()]),c.dispose(),f=h.map(function(t,e){return{score:t,idx:e}}).filter(function(t){return t.score>n}).map(function(t){return t.idx}),g=f.map(function(t){return e[t]}),m=f.map(function(t){return h[t]}),v=[],b=[],g.length>0&&(s=Date.now(),_=R(g,m,.7),i.stage2_nms=Date.now()-s,y=_.map(function(t){var e=u[f[t]].regions.arraySync();return new bn(e[0][0],e[0][1],e[0][2],e[0][3])}),b=_.map(function(t){return m[t]}),v=_.map(function(t,e){return g[t].calibrate(y[e])})),u.forEach(function(t){t.regions.dispose(),t.scores.dispose()}),[2,{boxes:v,scores:b}]}})})}function Cn(t,e,n,r,i){return Object(a.b)(this,void 0,void 0,function(){var s,l,u,c,h,d,p,f,g,m,v,b,_,y,T;return Object(a.d)(this,function(a){switch(a.label){case 0:return s=Date.now(),[4,En(t,e,{width:48,height:48})];case 1:return l=a.sent(),i.stage3_extractImagePatches=Date.now()-s,s=Date.now(),u=l.map(function(t){var e=function(t,e){return o.L(function(){var n=Tn(t,e);n=yn(n=Dt(n=o.s(n,[2,2],[2,2],"same"),e.conv4,"valid"),e.prelu4_alpha);var r=yn(zt(o.x(n,[n.shape[0],e.fc1.weights.shape[0]]),e.fc1),e.prelu5_alpha),i=zt(r,e.fc2_1),s=o.m(o.r(i,1),1),a=o.D(o.F(i,s),1),l=zt(r,e.fc2_2),u=zt(r,e.fc2_3);return{scores:o.O(a,1)[1],regions:l,points:u}})}(t,r);return t.dispose(),e}),i.stage3_onet=Date.now()-s,c=u.length>1?o.h(u.map(function(t){return t.scores})):u[0].scores,p=(d=Array).from,[4,c.data()];case 2:return h=p.apply(d,[a.sent()]),c.dispose(),f=h.map(function(t,e){return{score:t,idx:e}}).filter(function(t){return t.score>n}).map(function(t){return t.idx}),g=f.map(function(t){var e=u[t].regions.arraySync();return new bn(e[0][0],e[0][1],e[0][2],e[0][3])}),m=f.map(function(t,n){return e[t].calibrate(g[n])}),v=f.map(function(t){return h[t]}),b=[],_=[],y=[],m.length>0&&(s=Date.now(),T=R(m,v,.7,!1),i.stage3_nms=Date.now()-s,b=T.map(function(t){return m[t]}),_=T.map(function(t){return v[t]}),y=T.map(function(t,e){return Array(5).fill(0).map(function(n,r){var i=u[t].points.arraySync();return new E(i[0][r]*(b[e].width+1)+b[e].left,i[0][r+5]*(b[e].height+1)+b[e].top)})})),u.forEach(function(t){t.regions.dispose(),t.scores.dispose(),t.points.dispose()}),[2,{boxes:b,scores:_,points:y}]}})})}var Sn=function(t){function e(){return t.call(this,"Mtcnn")||this}return Object(a.c)(e,t),e.prototype.load=function(e){return Object(a.b)(this,void 0,void 0,function(){return Object(a.d)(this,function(n){return console.warn("mtcnn is deprecated and will be removed soon"),[2,t.prototype.load.call(this,e)]})})},e.prototype.loadFromDisk=function(e){return Object(a.b)(this,void 0,void 0,function(){return Object(a.d)(this,function(n){return console.warn("mtcnn is deprecated and will be removed soon"),[2,t.prototype.loadFromDisk.call(this,e)]})})},e.prototype.forwardInput=function(t,e){return void 0===e&&(e={}),Object(a.b)(this,void 0,void 0,function(){var n,r,i,s,l,u,c,h,d,p,f,g,m,v,b,_,y,T,x,w,C;return Object(a.d)(this,function(a){switch(a.label){case 0:if(!(n=this.params))throw new Error("Mtcnn - load model before inference");if(!(r=t.canvases[0]))throw new Error("Mtcnn - inputCanvas is not defined, note that passing tensors into Mtcnn.forwardInput is not supported yet.");return i={},s=Date.now(),l=o.L(function(){return t=o.m(o.f.fromPixels(r)).toFloat(),o.L(function(){return o.E(o.O(t,3).reverse(),3)});var t}),u=function(t){return l.dispose(),i.total=Date.now()-s,t},c=l.shape.slice(1),h=c[0],d=c[1],p=new Ne(e),f=p.minFaceSize,g=p.scaleFactor,m=p.maxNumScales,v=p.scoreThresholds,b=p.scaleSteps,_=(b||function(t,e,n){for(var r=n[0],i=n[1],o=fn/t,s=[],a=Math.min(r,i)*o,l=0;a>=12;)s.push(o*Math.pow(e,l)),a*=e,l+=1;return s}(f,g,[h,d])).filter(function(t){var e=vn(t,[h,d]);return Math.min(e.width,e.height)>fn}).slice(0,m),i.scales=_,i.pyramid=_.map(function(t){return vn(t,[h,d])}),y=Date.now(),[4,xn(l,_,v[0],n.pnet,i)];case 1:return T=a.sent(),i.total_stage1=Date.now()-y,T.boxes.length?(i.stage2_numInputBoxes=T.boxes.length,y=Date.now(),[4,wn(r,T.boxes,v[1],n.rnet,i)]):[2,u({results:[],stats:i})];case 2:return x=a.sent(),i.total_stage2=Date.now()-y,x.boxes.length?(i.stage3_numInputBoxes=x.boxes.length,y=Date.now(),[4,Cn(r,x.boxes,v[2],n.onet,i)]):[2,u({results:[],stats:i})];case 3:return w=a.sent(),i.total_stage3=Date.now()-y,C=w.boxes.map(function(t,e){return ne(G({},new k(w.scores[e],new P(t.left/d,t.top/h,t.width/d,t.height/h),{height:h,width:d})),new B(w.points[e].map(function(e){return e.sub(new E(t.left,t.top)).div(new E(t.width,t.height))}),{width:t.width,height:t.height}))}),[2,u({results:C,stats:i})]}})})},e.prototype.forward=function(t,e){return void 0===e&&(e={}),Object(a.b)(this,void 0,void 0,function(){var n;return Object(a.d)(this,function(r){switch(r.label){case 0:return n=this.forwardInput,[4,_t(t)];case 1:return[4,n.apply(this,[r.sent(),e])];case 2:return[2,r.sent().results]}})})},e.prototype.forwardWithStats=function(t,e){return void 0===e&&(e={}),Object(a.b)(this,void 0,void 0,function(){var n;return Object(a.d)(this,function(r){switch(r.label){case 0:return n=this.forwardInput,[4,_t(t)];case 1:return[2,n.apply(this,[r.sent(),e])]}})})},e.prototype.getDefaultModelName=function(){return"mtcnn_model"},e.prototype.extractParamsFromWeigthMap=function(t){return mn(t)},e.prototype.extractParams=function(t){return gn(t)},e}(It),kn=.4,On=[new E(1.603231,2.094468),new E(6.041143,7.080126),new E(2.882459,3.518061),new E(4.266906,5.178857),new E(9.041765,10.66308)],In=[117.001,114.697,97.404],Rn=function(t){function e(){var e={withSeparableConvs:!0,iouThreshold:kn,classes:["face"],anchors:On,meanRgb:In,isFirstLayerConv2d:!0,filterSizes:[3,16,32,64,128,256,512]};return t.call(this,e)||this}return Object(a.c)(e,t),Object.defineProperty(e.prototype,"anchors",{get:function(){return this.config.anchors},enumerable:!0,configurable:!0}),e.prototype.locateFaces=function(t,e){return Object(a.b)(this,void 0,void 0,function(){return Object(a.d)(this,function(n){switch(n.label){case 0:return[4,this.detect(t,e)];case 1:return[2,n.sent().map(function(t){return new k(t.score,t.relativeBox,{width:t.imageWidth,height:t.imageHeight})})]}})})},e.prototype.getDefaultModelName=function(){return"tiny_face_detector_model"},e.prototype.extractParamsFromWeigthMap=function(e){return t.prototype.extractParamsFromWeigthMap.call(this,e)},e}(sn),An={ssdMobilenetv1:new Ve,tinyFaceDetector:new Rn,tinyYolov2:new an,mtcnn:new Sn,faceLandmark68Net:new fe,faceLandmark68TinyNet:new me,faceRecognitionNet:new Ce,faceExpressionNet:new Jt,ageGenderNet:new de},Nn=function(t,e){return An.ssdMobilenetv1.locateFaces(t,e)},Dn=function(t,e){return An.tinyFaceDetector.locateFaces(t,e)},Mn=function(t,e){return An.tinyYolov2.locateFaces(t,e)},Ln=function(t,e){return An.mtcnn.forward(t,e)},Pn=function(t){return An.faceLandmark68Net.detectLandmarks(t)},Fn=function(t){return An.faceLandmark68TinyNet.detectLandmarks(t)},Bn=function(t){return An.faceRecognitionNet.computeFaceDescriptor(t)},jn=function(t){return An.faceExpressionNet.predictExpressions(t)},$n=function(t){return An.ageGenderNet.predictAgeAndGender(t)},Un=function(t){return An.ssdMobilenetv1.load(t)},Vn=function(t){return An.tinyFaceDetector.load(t)},Hn=function(t){return An.mtcnn.load(t)},Wn=function(t){return An.tinyYolov2.load(t)},Gn=function(t){return An.faceLandmark68Net.load(t)},zn=function(t){return An.faceLandmark68TinyNet.load(t)},Xn=function(t){return An.faceRecognitionNet.load(t)},Kn=function(t){return An.faceExpressionNet.load(t)},Yn=function(t){return An.ageGenderNet.load(t)},qn=Un,Jn=Nn,Zn=Pn,Qn=function(t){function e(e,n,r){var i=t.call(this)||this;return i.parentTask=e,i.input=n,i.extractedFaces=r,i}return Object(a.c)(e,t),e}(cn),tr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(a.c)(e,t),e.prototype.run=function(){return Object(a.b)(this,void 0,void 0,function(){var t,e,n=this;return Object(a.d)(this,function(r){switch(r.label){case 0:return[4,this.parentTask];case 1:return[4,hn(t=r.sent(),this.input,function(t){return Object(a.b)(n,void 0,void 0,function(){return Object(a.d)(this,function(e){switch(e.label){case 0:return[4,Promise.all(t.map(function(t){return An.faceExpressionNet.predictExpressions(t)}))];case 1:return[2,e.sent()]}})})},this.extractedFaces)];case 2:return e=r.sent(),[2,t.map(function(t,n){return Qt(t,e[n])})]}})})},e.prototype.withAgeAndGender=function(){return new or(this,this.input)},e}(Qn),er=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(a.c)(e,t),e.prototype.run=function(){return Object(a.b)(this,void 0,void 0,function(){var t,e;return Object(a.d)(this,function(n){switch(n.label){case 0:return[4,this.parentTask];case 1:return(t=n.sent())?[4,dn(t,this.input,function(t){return An.faceExpressionNet.predictExpressions(t)},this.extractedFaces)]:[2];case 2:return e=n.sent(),[2,Qt(t,e)]}})})},e.prototype.withAgeAndGender=function(){return new sr(this,this.input)},e}(Qn),nr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(a.c)(e,t),e.prototype.withAgeAndGender=function(){return new ar(this,this.input)},e.prototype.withFaceDescriptors=function(){return new cr(this,this.input)},e}(tr),rr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(a.c)(e,t),e.prototype.withAgeAndGender=function(){return new lr(this,this.input)},e.prototype.withFaceDescriptor=function(){return new hr(this,this.input)},e}(er),ir=function(t){function e(e,n,r){var i=t.call(this)||this;return i.parentTask=e,i.input=n,i.extractedFaces=r,i}return Object(a.c)(e,t),e}(cn),or=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(a.c)(e,t),e.prototype.run=function(){return Object(a.b)(this,void 0,void 0,function(){var t,e,n=this;return Object(a.d)(this,function(r){switch(r.label){case 0:return[4,this.parentTask];case 1:return[4,hn(t=r.sent(),this.input,function(t){return Object(a.b)(n,void 0,void 0,function(){return Object(a.d)(this,function(e){switch(e.label){case 0:return[4,Promise.all(t.map(function(t){return An.ageGenderNet.predictAgeAndGender(t)}))];case 1:return[2,e.sent()]}})})},this.extractedFaces)];case 2:return e=r.sent(),[2,t.map(function(t,n){var r=e[n],i=r.age;return Ie(Ae(t,r.gender,r.genderProbability),i)})]}})})},e.prototype.withFaceExpressions=function(){return new tr(this,this.input)},e}(ir),sr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(a.c)(e,t),e.prototype.run=function(){return Object(a.b)(this,void 0,void 0,function(){var t,e,n,r,i;return Object(a.d)(this,function(o){switch(o.label){case 0:return[4,this.parentTask];case 1:return(t=o.sent())?[4,dn(t,this.input,function(t){return An.ageGenderNet.predictAgeAndGender(t)},this.extractedFaces)]:[2];case 2:return e=o.sent(),n=e.age,r=e.gender,i=e.genderProbability,[2,Ie(Ae(t,r,i),n)]}})})},e.prototype.withFaceExpressions=function(){return new er(this,this.input)},e}(ir),ar=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(a.c)(e,t),e.prototype.withFaceExpressions=function(){return new nr(this,this.input)},e.prototype.withFaceDescriptors=function(){return new cr(this,this.input)},e}(or),lr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(a.c)(e,t),e.prototype.withFaceExpressions=function(){return new rr(this,this.input)},e.prototype.withFaceDescriptor=function(){return new hr(this,this.input)},e}(sr),ur=function(t){function e(e,n){var r=t.call(this)||this;return r.parentTask=e,r.input=n,r}return Object(a.c)(e,t),e}(cn),cr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(a.c)(e,t),e.prototype.run=function(){return Object(a.b)(this,void 0,void 0,function(){var t;return Object(a.d)(this,function(e){switch(e.label){case 0:return[4,this.parentTask];case 1:return[4,hn(t=e.sent(),this.input,function(t){return Promise.all(t.map(function(t){return An.faceRecognitionNet.computeFaceDescriptor(t)}))},null,function(t){return t.landmarks.align(null,{useDlibAlignment:!0})})];case 2:return[2,e.sent().map(function(e,n){return ke(t[n],e)})]}})})},e.prototype.withFaceExpressions=function(){return new nr(this,this.input)},e.prototype.withAgeAndGender=function(){return new ar(this,this.input)},e}(ur),hr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(a.c)(e,t),e.prototype.run=function(){return Object(a.b)(this,void 0,void 0,function(){var t,e;return Object(a.d)(this,function(n){switch(n.label){case 0:return[4,this.parentTask];case 1:return(t=n.sent())?[4,dn(t,this.input,function(t){return An.faceRecognitionNet.computeFaceDescriptor(t)},null,function(t){return t.landmarks.align(null,{useDlibAlignment:!0})})]:[2];case 2:return e=n.sent(),[2,ke(t,e)]}})})},e.prototype.withFaceExpressions=function(){return new rr(this,this.input)},e.prototype.withAgeAndGender=function(){return new lr(this,this.input)},e}(ur),dr=function(t){function e(e,n,r){var i=t.call(this)||this;return i.parentTask=e,i.input=n,i.useTinyLandmarkNet=r,i}return Object(a.c)(e,t),Object.defineProperty(e.prototype,"landmarkNet",{get:function(){return this.useTinyLandmarkNet?An.faceLandmark68TinyNet:An.faceLandmark68Net},enumerable:!0,configurable:!0}),e}(cn),pr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(a.c)(e,t),e.prototype.run=function(){return Object(a.b)(this,void 0,void 0,function(){var t,e,n,r,i,s=this;return Object(a.d)(this,function(a){switch(a.label){case 0:return[4,this.parentTask];case 1:return t=a.sent(),e=t.map(function(t){return t.detection}),this.input instanceof o.a?[4,Tt(this.input,e)]:[3,3];case 2:return r=a.sent(),[3,5];case 3:return[4,yt(this.input,e)];case 4:r=a.sent(),a.label=5;case 5:return n=r,[4,Promise.all(n.map(function(t){return s.landmarkNet.detectLandmarks(t)}))];case 6:return i=a.sent(),n.forEach(function(t){return t instanceof o.a&&t.dispose()}),[2,t.map(function(t,e){return ne(t,i[e])})]}})})},e.prototype.withFaceExpressions=function(){return new nr(this,this.input)},e.prototype.withAgeAndGender=function(){return new ar(this,this.input)},e.prototype.withFaceDescriptors=function(){return new cr(this,this.input)},e}(dr),fr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(a.c)(e,t),e.prototype.run=function(){return Object(a.b)(this,void 0,void 0,function(){var t,e,n,r,i;return Object(a.d)(this,function(s){switch(s.label){case 0:return[4,this.parentTask];case 1:return(t=s.sent())?(e=t.detection,this.input instanceof o.a?[4,Tt(this.input,[e])]:[3,3]):[2];case 2:return r=s.sent(),[3,5];case 3:return[4,yt(this.input,[e])];case 4:r=s.sent(),s.label=5;case 5:return n=r,[4,this.landmarkNet.detectLandmarks(n[0])];case 6:return i=s.sent(),n.forEach(function(t){return t instanceof o.a&&t.dispose()}),[2,ne(t,i)]}})})},e.prototype.withFaceExpressions=function(){return new rr(this,this.input)},e.prototype.withAgeAndGender=function(){return new lr(this,this.input)},e.prototype.withFaceDescriptor=function(){return new hr(this,this.input)},e}(dr),gr=function(t){function e(e,n){void 0===n&&(n=new Ue);var r=t.call(this)||this;return r.input=e,r.options=n,r}return Object(a.c)(e,t),e}(cn),mr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(a.c)(e,t),e.prototype.run=function(){return Object(a.b)(this,void 0,void 0,function(){var t,e,n,r;return Object(a.d)(this,function(i){switch(i.label){case 0:return e=(t=this).input,(n=t.options)instanceof Ne?[4,An.mtcnn.forward(e,n)]:[3,2];case 1:return[2,i.sent().map(function(t){return t.detection})];case 2:if(!(r=n instanceof un?function(t){return An.tinyFaceDetector.locateFaces(t,n)}:n instanceof Ue?function(t){return An.ssdMobilenetv1.locateFaces(t,n)}:n instanceof on?function(t){return An.tinyYolov2.locateFaces(t,n)}:null))throw new Error("detectFaces - expected options to be instance of TinyFaceDetectorOptions | SsdMobilenetv1Options | MtcnnOptions | TinyYolov2Options");return[2,r(e)]}})})},e.prototype.runAndExtendWithFaceDetections=function(){var t=this;return new Promise(function(e){return Object(a.b)(t,void 0,void 0,function(){var t;return Object(a.d)(this,function(n){switch(n.label){case 0:return[4,this.run()];case 1:return t=n.sent(),[2,e(t.map(function(t){return G({},t)}))]}})})})},e.prototype.withFaceLandmarks=function(t){return void 0===t&&(t=!1),new pr(this.runAndExtendWithFaceDetections(),this.input,t)},e.prototype.withFaceExpressions=function(){return new tr(this.runAndExtendWithFaceDetections(),this.input)},e.prototype.withAgeAndGender=function(){return new or(this.runAndExtendWithFaceDetections(),this.input)},e}(gr),vr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(a.c)(e,t),e.prototype.run=function(){return Object(a.b)(this,void 0,void 0,function(){var t,e;return Object(a.d)(this,function(n){switch(n.label){case 0:return[4,new mr(this.input,this.options)];case 1:return t=n.sent(),e=t[0],t.forEach(function(t){t.score>e.score&&(e=t)}),[2,e]}})})},e.prototype.runAndExtendWithFaceDetection=function(){var t=this;return new Promise(function(e){return Object(a.b)(t,void 0,void 0,function(){var t;return Object(a.d)(this,function(n){switch(n.label){case 0:return[4,this.run()];case 1:return t=n.sent(),[2,e(t?G({},t):void 0)]}})})})},e.prototype.withFaceLandmarks=function(t){return void 0===t&&(t=!1),new fr(this.runAndExtendWithFaceDetection(),this.input,t)},e.prototype.withFaceExpressions=function(){return new er(this.runAndExtendWithFaceDetection(),this.input)},e.prototype.withAgeAndGender=function(){return new sr(this.runAndExtendWithFaceDetection(),this.input)},e}(gr);function br(t,e){return void 0===e&&(e=new Ue),new vr(t,e)}function _r(t,e){return void 0===e&&(e=new Ue),new mr(t,e)}function yr(t,e){return Object(a.b)(this,void 0,void 0,function(){return Object(a.d)(this,function(n){switch(n.label){case 0:return console.warn("allFacesSsdMobilenetv1 is deprecated and will be removed soon, use the high level api instead"),[4,_r(t,new Ue(e?{minConfidence:e}:{})).withFaceLandmarks().withFaceDescriptors()];case 1:return[2,n.sent()]}})})}function Tr(t,e){return void 0===e&&(e={}),Object(a.b)(this,void 0,void 0,function(){return Object(a.d)(this,function(n){switch(n.label){case 0:return console.warn("allFacesTinyYolov2 is deprecated and will be removed soon, use the high level api instead"),[4,_r(t,new on(e)).withFaceLandmarks().withFaceDescriptors()];case 1:return[2,n.sent()]}})})}function xr(t,e){return void 0===e&&(e={}),Object(a.b)(this,void 0,void 0,function(){return Object(a.d)(this,function(n){switch(n.label){case 0:return console.warn("allFacesMtcnn is deprecated and will be removed soon, use the high level api instead"),[4,_r(t,new Ne(e)).withFaceLandmarks().withFaceDescriptors()];case 1:return[2,n.sent()]}})})}var Er=yr;function wr(t,e){if(t.length!==e.length)throw new Error("euclideanDistance: arr1.length !== arr2.length");var n=Array.from(t),r=Array.from(e);return Math.sqrt(n.map(function(t,e){return t-r[e]}).reduce(function(t,e){return t+Math.pow(e,2)},0))}var Cr=function(){function t(t,e){void 0===e&&(e=.6),this._distanceThreshold=e;var n=Array.isArray(t)?t:[t];if(!n.length)throw new Error("FaceRecognizer.constructor - expected atleast one input");var r=1,i=function(){return"person "+r++};this._labeledDescriptors=n.map(function(t){if(t instanceof V)return t;if(t instanceof Float32Array)return new V(i(),[t]);if(t.descriptor&&t.descriptor instanceof Float32Array)return new V(i(),[t.descriptor]);throw new Error("FaceRecognizer.constructor - expected inputs to be of type LabeledFaceDescriptors | WithFaceDescriptor<any> | Float32Array | Array<LabeledFaceDescriptors | WithFaceDescriptor<any> | Float32Array>")})}return Object.defineProperty(t.prototype,"labeledDescriptors",{get:function(){return this._labeledDescriptors},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"distanceThreshold",{get:function(){return this._distanceThreshold},enumerable:!0,configurable:!0}),t.prototype.computeMeanDistance=function(t,e){return e.map(function(e){return wr(e,t)}).reduce(function(t,e){return t+e},0)/(e.length||1)},t.prototype.matchDescriptor=function(t){var e=this;return this.labeledDescriptors.map(function(n){var r=n.descriptors,i=n.label;return new $(i,e.computeMeanDistance(t,r))}).reduce(function(t,e){return t.distance<e.distance?t:e})},t.prototype.findBestMatch=function(t){var e=this.matchDescriptor(t);return e.distance<this.distanceThreshold?e:new $("unknown",e.distance)},t.prototype.toJSON=function(){return{distanceThreshold:this.distanceThreshold,labeledDescriptors:this.labeledDescriptors.map(function(t){return t.toJSON()})}},t.fromJSON=function(e){return new t(e.labeledDescriptors.map(function(t){return V.fromJSON(t)}),e.distanceThreshold)},t}();function Sr(t){var e=new Sn;return e.extractWeights(t),e}function kr(t){var e=new Rn;return e.extractWeights(t),e}function Or(t,e){var n=new l(e.width,e.height),r=n.width,i=n.height;if(r<=0||i<=0)throw new Error("resizeResults - invalid dimensions: "+JSON.stringify({width:r,height:i}));if(Array.isArray(t))return t.map(function(t){return Or(t,{width:r,height:i})});if(ee(t)){var o=t.detection.forSize(r,i),s=t.unshiftedLandmarks.forSize(o.box.width,o.box.height);return ne(G(t,o),s)}return W(t)?G(t,t.detection.forSize(r,i)):t instanceof F||t instanceof k?t.forSize(r,i):t}n.d(e,!1,function(){return i}),n.d(e,!1,function(){return r}),n.d(e,!1,function(){return o}),n.d(e,!1,function(){return de}),n.d(e,!1,function(){return ce}),n.d(e,!1,function(){return C}),n.d(e,!1,function(){return w}),n.d(e,!1,function(){return l}),n.d(e,!1,function(){return k}),n.d(e,!1,function(){return F}),n.d(e,!1,function(){return B}),n.d(e,!1,function(){return j}),n.d(e,!1,function(){return $}),n.d(e,!1,function(){return U}),n.d(e,"b",function(){return V}),n.d(e,!1,function(){return S}),n.d(e,!1,function(){return E}),n.d(e,!1,function(){return H}),n.d(e,!1,function(){return P}),n.d(e,!1,function(){return ct}),n.d(e,"c",function(){return ht}),n.d(e,!1,function(){return pt}),n.d(e,!1,function(){return ft}),n.d(e,!1,function(){return yt}),n.d(e,!1,function(){return Tt}),n.d(e,"e",function(){return Et}),n.d(e,!1,function(){return wt}),n.d(e,!1,function(){return Ct}),n.d(e,!1,function(){return xt}),n.d(e,!1,function(){return rt}),n.d(e,!1,function(){return dt}),n.d(e,!1,function(){return gt}),n.d(e,!1,function(){return vt}),n.d(e,!1,function(){return mt}),n.d(e,!1,function(){return ut}),n.d(e,!1,function(){return kt}),n.d(e,!1,function(){return Ot}),n.d(e,!1,function(){return bt}),n.d(e,!1,function(){return nt}),n.d(e,!1,function(){return _t}),n.d(e,!1,function(){return et}),n.d(e,!1,function(){return Jt}),n.d(e,!1,function(){return Yt}),n.d(e,!1,function(){return qt}),n.d(e,!1,function(){return ve}),n.d(e,!1,function(){return fe}),n.d(e,!1,function(){return me}),n.d(e,!1,function(){return Se}),n.d(e,!1,function(){return Ce}),n.d(e,!1,function(){return ke}),n.d(e,!1,function(){return W}),n.d(e,!1,function(){return G}),n.d(e,!1,function(){return Zt}),n.d(e,!1,function(){return Qt}),n.d(e,!1,function(){return ee}),n.d(e,!1,function(){return ne}),n.d(e,!1,function(){return Oe}),n.d(e,!1,function(){return Ie}),n.d(e,!1,function(){return Re}),n.d(e,!1,function(){return Ae}),n.d(e,!1,function(){return yr}),n.d(e,!1,function(){return Tr}),n.d(e,!1,function(){return xr}),n.d(e,!1,function(){return Er}),n.d(e,!1,function(){return cn}),n.d(e,!1,function(){return ur}),n.d(e,!1,function(){return cr}),n.d(e,!1,function(){return hr}),n.d(e,!1,function(){return br}),n.d(e,!1,function(){return _r}),n.d(e,!1,function(){return gr}),n.d(e,!1,function(){return mr}),n.d(e,!1,function(){return vr}),n.d(e,!1,function(){return dr}),n.d(e,!1,function(){return pr}),n.d(e,!1,function(){return fr}),n.d(e,"a",function(){return Cr}),n.d(e,!1,function(){return An}),n.d(e,!1,function(){return Nn}),n.d(e,!1,function(){return Dn}),n.d(e,!1,function(){return Mn}),n.d(e,!1,function(){return Ln}),n.d(e,!1,function(){return Pn}),n.d(e,!1,function(){return Fn}),n.d(e,"d",function(){return Bn}),n.d(e,!1,function(){return jn}),n.d(e,!1,function(){return $n}),n.d(e,!1,function(){return Un}),n.d(e,!1,function(){return Vn}),n.d(e,!1,function(){return Hn}),n.d(e,!1,function(){return Wn}),n.d(e,!1,function(){return Gn}),n.d(e,!1,function(){return zn}),n.d(e,"f",function(){return Xn}),n.d(e,!1,function(){return Kn}),n.d(e,!1,function(){return Yn}),n.d(e,!1,function(){return qn}),n.d(e,!1,function(){return Jn}),n.d(e,!1,function(){return Zn}),n.d(e,!1,function(){return Sr}),n.d(e,!1,function(){return Sn}),n.d(e,!1,function(){return Ne}),n.d(e,!1,function(){return M}),n.d(e,!1,function(){return L}),n.d(e,!1,function(){return O}),n.d(e,!1,function(){return I}),n.d(e,!1,function(){return R}),n.d(e,!1,function(){return A}),n.d(e,!1,function(){return N}),n.d(e,!1,function(){return D}),n.d(e,!1,function(){return He}),n.d(e,!1,function(){return We}),n.d(e,!1,function(){return ze}),n.d(e,!1,function(){return Ve}),n.d(e,!1,function(){return Ue}),n.d(e,!1,function(){return kr}),n.d(e,!1,function(){return Rn}),n.d(e,!1,function(){return un}),n.d(e,!1,function(){return an}),n.d(e,!1,function(){return ln}),n.d(e,!1,function(){return Ge}),n.d(e,!1,function(){return on}),n.d(e,!1,function(){return Ze}),n.d(e,!1,function(){return wr}),n.d(e,!1,function(){return It}),n.d(e,!1,function(){return Or})},HJMx:function(t,e,n){t.exports=function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/dist/",n(n.s=79)}({0:function(t,e,n){"use strict";function r(t,e,n,r,i,o,s,a){var l,u="function"==typeof t?t.options:t;if(e&&(u.render=e,u.staticRenderFns=n,u._compiled=!0),r&&(u.functional=!0),o&&(u._scopeId="data-v-"+o),s?(l=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(s)},u._ssrRegister=l):i&&(l=a?function(){i.call(this,this.$root.$options.shadowRoot)}:i),l)if(u.functional){u._injectStyles=l;var c=u.render;u.render=function(t,e){return l.call(e),c(t,e)}}else{var h=u.beforeCreate;u.beforeCreate=h?[].concat(h,l):[l]}return{exports:t,options:u}}n.d(e,"a",function(){return r})},11:function(t,e){t.exports=n("aW5l")},21:function(t,e){t.exports=n("E/in")},4:function(t,e){t.exports=n("fPll")},79:function(t,e,n){"use strict";n.r(e);var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:["textarea"===t.type?"el-textarea":"el-input",t.inputSize?"el-input--"+t.inputSize:"",{"is-disabled":t.inputDisabled,"is-exceed":t.inputExceed,"el-input-group":t.$slots.prepend||t.$slots.append,"el-input-group--append":t.$slots.append,"el-input-group--prepend":t.$slots.prepend,"el-input--prefix":t.$slots.prefix||t.prefixIcon,"el-input--suffix":t.$slots.suffix||t.suffixIcon||t.clearable||t.showPassword}],on:{mouseenter:function(e){t.hovering=!0},mouseleave:function(e){t.hovering=!1}}},["textarea"!==t.type?[t.$slots.prepend?n("div",{staticClass:"el-input-group__prepend"},[t._t("prepend")],2):t._e(),"textarea"!==t.type?n("input",t._b({ref:"input",staticClass:"el-input__inner",attrs:{tabindex:t.tabindex,type:t.showPassword?t.passwordVisible?"text":"password":t.type,disabled:t.inputDisabled,readonly:t.readonly,autocomplete:t.autoComplete||t.autocomplete,"aria-label":t.label},on:{compositionstart:t.handleCompositionStart,compositionupdate:t.handleCompositionUpdate,compositionend:t.handleCompositionEnd,input:t.handleInput,focus:t.handleFocus,blur:t.handleBlur,change:t.handleChange}},"input",t.$attrs,!1)):t._e(),t.$slots.prefix||t.prefixIcon?n("span",{staticClass:"el-input__prefix"},[t._t("prefix"),t.prefixIcon?n("i",{staticClass:"el-input__icon",class:t.prefixIcon}):t._e()],2):t._e(),t.getSuffixVisible()?n("span",{staticClass:"el-input__suffix"},[n("span",{staticClass:"el-input__suffix-inner"},[t.showClear&&t.showPwdVisible&&t.isWordLimitVisible?t._e():[t._t("suffix"),t.suffixIcon?n("i",{staticClass:"el-input__icon",class:t.suffixIcon}):t._e()],t.showClear?n("i",{staticClass:"el-input__icon el-icon-circle-close el-input__clear",on:{mousedown:function(t){t.preventDefault()},click:t.clear}}):t._e(),t.showPwdVisible?n("i",{staticClass:"el-input__icon el-icon-view el-input__clear",on:{click:t.handlePasswordVisible}}):t._e(),t.isWordLimitVisible?n("span",{staticClass:"el-input__count"},[n("span",{staticClass:"el-input__count-inner"},[t._v("\n "+t._s(t.textLength)+"/"+t._s(t.upperLimit)+"\n ")])]):t._e()],2),t.validateState?n("i",{staticClass:"el-input__icon",class:["el-input__validateIcon",t.validateIcon]}):t._e()]):t._e(),t.$slots.append?n("div",{staticClass:"el-input-group__append"},[t._t("append")],2):t._e()]:n("textarea",t._b({ref:"textarea",staticClass:"el-textarea__inner",style:t.textareaStyle,attrs:{tabindex:t.tabindex,disabled:t.inputDisabled,readonly:t.readonly,autocomplete:t.autoComplete||t.autocomplete,"aria-label":t.label},on:{compositionstart:t.handleCompositionStart,compositionupdate:t.handleCompositionUpdate,compositionend:t.handleCompositionEnd,input:t.handleInput,focus:t.handleFocus,blur:t.handleBlur,change:t.handleChange}},"textarea",t.$attrs,!1)),t.isWordLimitVisible&&"textarea"===t.type?n("span",{staticClass:"el-input__count"},[t._v(t._s(t.textLength)+"/"+t._s(t.upperLimit))]):t._e()],2)};r._withStripped=!0;var i=n(4),o=n.n(i),s=n(11),a=n.n(s),l=void 0,u="\n height:0 !important;\n visibility:hidden !important;\n overflow:hidden !important;\n position:absolute !important;\n z-index:-1000 !important;\n top:0 !important;\n right:0 !important\n",c=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing"];function h(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;l||(l=document.createElement("textarea"),document.body.appendChild(l));var r=function(t){var e=window.getComputedStyle(t),n=e.getPropertyValue("box-sizing"),r=parseFloat(e.getPropertyValue("padding-bottom"))+parseFloat(e.getPropertyValue("padding-top")),i=parseFloat(e.getPropertyValue("border-bottom-width"))+parseFloat(e.getPropertyValue("border-top-width"));return{contextStyle:c.map(function(t){return t+":"+e.getPropertyValue(t)}).join(";"),paddingSize:r,borderSize:i,boxSizing:n}}(t),i=r.paddingSize,o=r.borderSize,s=r.boxSizing,a=r.contextStyle;l.setAttribute("style",a+";"+u),l.value=t.value||t.placeholder||"";var h=l.scrollHeight,d={};"border-box"===s?h+=o:"content-box"===s&&(h-=i),l.value="";var p=l.scrollHeight-i;if(null!==e){var f=p*e;"border-box"===s&&(f=f+i+o),h=Math.max(f,h),d.minHeight=f+"px"}if(null!==n){var g=p*n;"border-box"===s&&(g=g+i+o),h=Math.min(g,h)}return d.height=h+"px",l.parentNode&&l.parentNode.removeChild(l),l=null,d}var d=n(9),p=n.n(d),f=n(21),g={name:"ElInput",componentName:"ElInput",mixins:[o.a,a.a],inheritAttrs:!1,inject:{elForm:{default:""},elFormItem:{default:""}},data:function(){return{textareaCalcStyle:{},hovering:!1,focused:!1,isComposing:!1,passwordVisible:!1}},props:{value:[String,Number],size:String,resize:String,form:String,disabled:Boolean,readonly:Boolean,type:{type:String,default:"text"},autosize:{type:[Boolean,Object],default:!1},autocomplete:{type:String,default:"off"},autoComplete:{type:String,validator:function(t){return!0}},validateEvent:{type:Boolean,default:!0},suffixIcon:String,prefixIcon:String,label:String,clearable:{type:Boolean,default:!1},showPassword:{type:Boolean,default:!1},showWordLimit:{type:Boolean,default:!1},tabindex:String},computed:{_elFormItemSize:function(){return(this.elFormItem||{}).elFormItemSize},validateState:function(){return this.elFormItem?this.elFormItem.validateState:""},needStatusIcon:function(){return!!this.elForm&&this.elForm.statusIcon},validateIcon:function(){return{validating:"el-icon-loading",success:"el-icon-circle-check",error:"el-icon-circle-close"}[this.validateState]},textareaStyle:function(){return p()({},this.textareaCalcStyle,{resize:this.resize})},inputSize:function(){return this.size||this._elFormItemSize||(this.$ELEMENT||{}).size},inputDisabled:function(){return this.disabled||(this.elForm||{}).disabled},nativeInputValue:function(){return null===this.value||void 0===this.value?"":String(this.value)},showClear:function(){return this.clearable&&!this.inputDisabled&&!this.readonly&&this.nativeInputValue&&(this.focused||this.hovering)},showPwdVisible:function(){return this.showPassword&&!this.inputDisabled&&!this.readonly&&(!!this.nativeInputValue||this.focused)},isWordLimitVisible:function(){return this.showWordLimit&&this.$attrs.maxlength&&("text"===this.type||"textarea"===this.type)&&!this.inputDisabled&&!this.readonly&&!this.showPassword},upperLimit:function(){return this.$attrs.maxlength},textLength:function(){return"number"==typeof this.value?String(this.value).length:(this.value||"").length},inputExceed:function(){return this.isWordLimitVisible&&this.textLength>this.upperLimit}},watch:{value:function(t){this.$nextTick(this.resizeTextarea),this.validateEvent&&this.dispatch("ElFormItem","el.form.change",[t])},nativeInputValue:function(){this.setNativeInputValue()},type:function(){var t=this;this.$nextTick(function(){t.setNativeInputValue(),t.resizeTextarea(),t.updateIconOffset()})}},methods:{focus:function(){this.getInput().focus()},blur:function(){this.getInput().blur()},getMigratingConfig:function(){return{props:{icon:"icon is removed, use suffix-icon / prefix-icon instead.","on-icon-click":"on-icon-click is removed."},events:{click:"click is removed."}}},handleBlur:function(t){this.focused=!1,this.$emit("blur",t),this.validateEvent&&this.dispatch("ElFormItem","el.form.blur",[this.value])},select:function(){this.getInput().select()},resizeTextarea:function(){if(!this.$isServer){var t=this.autosize;if("textarea"===this.type)if(t){var e=t.minRows,n=t.maxRows;this.textareaCalcStyle=h(this.$refs.textarea,e,n)}else this.textareaCalcStyle={minHeight:h(this.$refs.textarea).minHeight}}},setNativeInputValue:function(){var t=this.getInput();t&&t.value!==this.nativeInputValue&&(t.value=this.nativeInputValue)},handleFocus:function(t){this.focused=!0,this.$emit("focus",t)},handleCompositionStart:function(){this.isComposing=!0},handleCompositionUpdate:function(t){var e=t.target.value,n=e[e.length-1]||"";this.isComposing=!Object(f.isKorean)(n)},handleCompositionEnd:function(t){this.isComposing&&(this.isComposing=!1,this.handleInput(t))},handleInput:function(t){this.isComposing||t.target.value!==this.nativeInputValue&&(this.$emit("input",t.target.value),this.$nextTick(this.setNativeInputValue))},handleChange:function(t){this.$emit("change",t.target.value)},calcIconOffset:function(t){var e=[].slice.call(this.$el.querySelectorAll(".el-input__"+t)||[]);if(e.length){for(var n=null,r=0;r<e.length;r++)if(e[r].parentNode===this.$el){n=e[r];break}if(n){var i={suffix:"append",prefix:"prepend"}[t];this.$slots[i]?n.style.transform="translateX("+("suffix"===t?"-":"")+this.$el.querySelector(".el-input-group__"+i).offsetWidth+"px)":n.removeAttribute("style")}}},updateIconOffset:function(){this.calcIconOffset("prefix"),this.calcIconOffset("suffix")},clear:function(){this.$emit("input",""),this.$emit("change",""),this.$emit("clear")},handlePasswordVisible:function(){var t=this;this.passwordVisible=!this.passwordVisible,this.$nextTick(function(){t.focus()})},getInput:function(){return this.$refs.input||this.$refs.textarea},getSuffixVisible:function(){return this.$slots.suffix||this.suffixIcon||this.showClear||this.showPassword||this.isWordLimitVisible||this.validateState&&this.needStatusIcon}},created:function(){this.$on("inputSelect",this.select)},mounted:function(){this.setNativeInputValue(),this.resizeTextarea(),this.updateIconOffset()},updated:function(){this.$nextTick(this.updateIconOffset)}},m=n(0),v=Object(m.a)(g,r,[],!1,null,null,null);v.options.__file="packages/input/src/input.vue";var b=v.exports;b.install=function(t){t.component(b.name,b)};e.default=b},9:function(t,e){t.exports=n("jmaC")}})},HOGz:function(t,e,n){"use strict";
  364. /**
  365. * @license
  366. * Copyright 2020 Google LLC. All Rights Reserved.
  367. * Licensed under the Apache License, Version 2.0 (the "License");
  368. * you may not use this file except in compliance with the License.
  369. * You may obtain a copy of the License at
  370. *
  371. * http://www.apache.org/licenses/LICENSE-2.0
  372. *
  373. * Unless required by applicable law or agreed to in writing, software
  374. * distributed under the License is distributed on an "AS IS" BASIS,
  375. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  376. * See the License for the specific language governing permissions and
  377. * limitations under the License.
  378. * =============================================================================
  379. */
  380. var r;n.d(e,"a",function(){return r}),function(t){t[t.NONE=0]="NONE",t[t.MEAN=1]="MEAN",t[t.SUM=2]="SUM",t[t.SUM_BY_NONZERO_WEIGHTS=3]="SUM_BY_NONZERO_WEIGHTS"}(r||(r={}))},HSvE:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.json=[{tfOpName:"ResizeBilinear",category:"image",inputs:[{start:0,name:"images",type:"tensor"},{start:1,name:"size",type:"number[]"}],attrs:[{tfName:"align_corners",name:"alignCorners",type:"bool"},{tfName:"half_pixel_centers",name:"halfPixelCenters",type:"bool"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ResizeNearestNeighbor",category:"image",inputs:[{start:0,name:"images",type:"tensor"},{start:1,name:"size",type:"number[]"}],attrs:[{tfName:"align_corners",name:"alignCorners",type:"bool"},{tfName:"half_pixel_centers",name:"halfPixelCenters",type:"bool"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"CropAndResize",category:"image",inputs:[{start:0,name:"image",type:"tensor"},{start:1,name:"boxes",type:"tensor"},{start:2,name:"boxInd",type:"tensor"},{start:3,name:"cropSize",type:"number[]"}],attrs:[{tfName:"method",name:"method",type:"string"},{tfName:"extrapolation_value",name:"extrapolationValue",type:"number"}]}]},HYom:function(t,e,n){var r;r=function(t){return t.pad.Iso10126={pad:function(e,n){var r=4*n,i=r-e.sigBytes%r;e.concat(t.lib.WordArray.random(i-1)).concat(t.lib.WordArray.create([i<<24],1))},unpad:function(t){var e=255&t.words[t.sigBytes-1>>>2];t.sigBytes-=e}},t.pad.Iso10126},t.exports=r(n("02Hb"),n("fGru"))},Hdl1:function(t,e,n){"use strict";n.d(e,"a",function(){return o});var r=n("Kkag"),i=n("l5jf");
  381. /**
  382. * @license
  383. * Copyright 2020 Google LLC. All Rights Reserved.
  384. * Licensed under the Apache License, Version 2.0 (the "License");
  385. * you may not use this file except in compliance with the License.
  386. * You may obtain a copy of the License at
  387. *
  388. * http://www.apache.org/licenses/LICENSE-2.0
  389. *
  390. * Unless required by applicable law or agreed to in writing, software
  391. * distributed under the License is distributed on an "AS IS" BASIS,
  392. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  393. * See the License for the specific language governing permissions and
  394. * limitations under the License.
  395. * =============================================================================
  396. */
  397. function o(t,e,n){const o={shape:t,value:e,dtype:n};return r.a.runKernel(i._2,{},o)}},Hjly:function(t,e,n){"use strict";e.e=
  398. /**
  399. * @license
  400. * Copyright 2020 Google LLC. All Rights Reserved.
  401. * Licensed under the Apache License, Version 2.0 (the "License");
  402. * you may not use this file except in compliance with the License.
  403. * You may obtain a copy of the License at
  404. *
  405. * http://www.apache.org/licenses/LICENSE-2.0
  406. *
  407. * Unless required by applicable law or agreed to in writing, software
  408. * distributed under the License is distributed on an "AS IS" BASIS,
  409. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  410. * See the License for the specific language governing permissions and
  411. * limitations under the License.
  412. * =============================================================================
  413. */
  414. function(t,e,n,r,o="NHWC",s){const a=t[3],l=[...e,a],u=d(o);return i(t,l,n,s,r,null,null,u)},e.f=function(t,e,n,r,o,s,l="channelsLast"){const[u,c]=a(e);let h;if("channelsLast"===l)h=[u,c,t[3],t[3]];else{if("channelsFirst"!==l)throw new Error(`Unknown dataFormat ${l}`);h=[u,c,t[1],t[1]]}return i(t,h,n,r,o,s,!1,l)},e.g=function(t,e,n,r,i,s,a="NDHWC"){const[u,c,h]=l(e);let d,p;if("NDHWC"===a)p="channelsLast",d=[u,c,h,t[4],t[4]];else{if("NCDHW"!==a)throw new Error(`Unknown dataFormat ${a}`);p="channelsFirst",d=[u,c,h,t[1],t[1]]}return o(t,d,n,r,i,!1,p,s)},e.b=i,e.c=o,e.d=s,e.j=h,e.i=function(t,e){return h(t)||h(e)},e.h=d,e.a=function(t,e,n){if(null!=n){if("string"==typeof e)throw Error(`Error in ${t}: pad must be an integer when using `+`dimRoundingMode ${n} but got pad ${e}.`);if("number"==typeof e)r.assert(r.isInt(e),()=>`Error in ${t}: pad must be an integer when using `+`dimRoundingMode ${n} but got pad ${e}.`);else{if("object"!=typeof e)throw Error(`Error in ${t}: Unknown padding parameter: ${e}`);e.forEach(e=>{e.forEach(e=>{r.assert(r.isInt(e),()=>`Error in ${t}: pad must be an integer when using `+`dimRoundingMode ${n} but got pad ${e}.`)})})}}};var r=n("XFvI");function i(t,e,n,r,i,o,l=!1,h="channelsLast"){let[d,p,f,g]=[-1,-1,-1,-1];if("channelsLast"===h)[d,p,f,g]=t;else{if("channelsFirst"!==h)throw new Error(`Unknown dataFormat ${h}`);[d,g,p,f]=t}const[m,v,,b]=e,[_,y]=a(n),[T,x]=a(r),E=u(m,T),w=u(v,x),{padInfo:C,outHeight:S,outWidth:k}=function(t,e,n,r,i,o,a,l,u){let h,d,p;if("number"==typeof t){const i=0===t?"VALID":"NUMBER";h={top:t,bottom:t,left:t,right:t,type:i};const a=function(t,e,n,r,i){null==r&&(r=s(t,e,n));const o=t[0],a=t[1],l=c((o-e+2*r)/n+1,i),u=c((a-e+2*r)/n+1,i);return[l,u]}([e,n],o,r,t,l);d=a[0],p=a[1]}else if("same"===t){d=Math.ceil(e/r),p=Math.ceil(n/i);const t=Math.max(0,(d-1)*r+o-e),s=Math.max(0,(p-1)*i+a-n),l=Math.floor(t/2),u=t-l,c=Math.floor(s/2),f=s-c;h={top:l,bottom:u,left:c,right:f,type:"SAME"}}else if("valid"===t)h={top:0,bottom:0,left:0,right:0,type:"VALID"},d=Math.ceil((e-o+1)/r),p=Math.ceil((n-a+1)/i);else{if("object"!=typeof t)throw Error(`Unknown padding parameter: ${t}`);{const s="channelsLast"===u?t[1][0]:t[2][0],f="channelsLast"===u?t[1][1]:t[2][1],g="channelsLast"===u?t[2][0]:t[3][0],m="channelsLast"===u?t[2][1]:t[3][1],v=0===s&&0===f&&0===g&&0===m?"VALID":"EXPLICIT";h={top:s,bottom:f,left:g,right:m,type:v},d=c((e-o+s+f)/r+1,l),p=c((n-a+g+m)/i+1,l)}}return{padInfo:h,outHeight:d,outWidth:p}}(i,p,f,_,y,E,w,o,h),O=l?b*g:b;let I;return"channelsFirst"===h?I=[d,O,S,k]:"channelsLast"===h&&(I=[d,S,k,O]),{batchSize:d,dataFormat:h,inHeight:p,inWidth:f,inChannels:g,outHeight:S,outWidth:k,outChannels:O,padInfo:C,strideHeight:_,strideWidth:y,filterHeight:m,filterWidth:v,effectiveFilterHeight:E,effectiveFilterWidth:w,dilationHeight:T,dilationWidth:x,inShape:t,outShape:I,filterShape:e}}function o(t,e,n,r,i,o=!1,a="channelsLast",h){let[d,p,f,g,m]=[-1,-1,-1,-1,-1];if("channelsLast"===a)[d,p,f,g,m]=t;else{if("channelsFirst"!==a)throw new Error(`Unknown dataFormat ${a}`);[d,m,p,f,g]=t}const[v,b,_,,y]=e,[T,x,E]=l(n),[w,C,S]=l(r),k=u(v,w),O=u(b,C),I=u(_,S),{padInfo:R,outDepth:A,outHeight:N,outWidth:D}=function(t,e,n,r,i,o,a,l,u,h,d){let p,f,g,m;if("number"==typeof t){const o=0===t?"VALID":"NUMBER";p={top:t,bottom:t,left:t,right:t,front:t,back:t,type:o};const a=function(t,e,n,r,i,o){null==i&&(i=s(t,e,r));const a=t[0],l=t[1],u=t[2],h=c((a-e+2*i)/r+1,o),d=c((l-e+2*i)/r+1,o),p=c((u-e+2*i)/r+1,o);return[h,d,p,n]}([e,n,r,1],l,1,i,t,d);f=a[0],g=a[1],m=a[2]}else if("same"===t){f=Math.ceil(e/i),g=Math.ceil(n/o),m=Math.ceil(r/a);const t=(f-1)*i+l-e,s=(g-1)*o+u-n,c=(m-1)*a+h-r,d=Math.floor(t/2),v=t-d,b=Math.floor(s/2),_=s-b,y=Math.floor(c/2),T=c-y;p={top:b,bottom:_,left:y,right:T,front:d,back:v,type:"SAME"}}else{if("valid"!==t)throw Error(`Unknown padding parameter: ${t}`);p={top:0,bottom:0,left:0,right:0,front:0,back:0,type:"VALID"},f=Math.ceil((e-l+1)/i),g=Math.ceil((n-u+1)/o),m=Math.ceil((r-h+1)/a)}return{padInfo:p,outDepth:f,outHeight:g,outWidth:m}}(i,p,f,g,T,x,E,k,O,I,h),M=o?y*m:y;let L;return"channelsFirst"===a?L=[d,M,A,N,D]:"channelsLast"===a&&(L=[d,A,N,D,M]),{batchSize:d,dataFormat:a,inDepth:p,inHeight:f,inWidth:g,inChannels:m,outDepth:A,outHeight:N,outWidth:D,outChannels:M,padInfo:R,strideDepth:T,strideHeight:x,strideWidth:E,filterDepth:v,filterHeight:b,filterWidth:_,effectiveFilterDepth:k,effectiveFilterHeight:O,effectiveFilterWidth:I,dilationDepth:w,dilationHeight:C,dilationWidth:S,inShape:t,outShape:L,filterShape:e}}function s(t,e,n,r=1){const i=u(e,r);return Math.floor((t[0]*(n-1)-n+i)/2)}function a(t){return"number"==typeof t?[t,t,t]:2===t.length?[t[0],t[1],1]:t}function l(t){return"number"==typeof t?[t,t,t]:t}function u(t,e){return e<=1?t:t+(t-1)*(e-1)}function c(t,e){if(!e)return Math.trunc(t);switch(e){case"round":return Math.round(t);case"ceil":return Math.ceil(t);case"floor":return Math.floor(t);default:throw new Error(`Unknown roundingMode ${e}`)}}function h(t){const[e,n,r]=a(t);return 1===e&&1===n&&1===r}function d(t){if("NHWC"===t)return"channelsLast";if("NCHW"===t)return"channelsFirst";throw new Error(`Unknown dataFormat ${t}`)}},HzcN:function(t,e,n){var r=n("uY1a"),i=n("ON3O");t.exports={throttle:r,debounce:i}},IDSB:function(t,e,n){var r,i,o,s;s=function(t){return(t={Msg:{}}).Msg.ADD_COMMENT="添加注释",t.Msg.CANNOT_DELETE_VARIABLE_PROCEDURE="不能删除变量“%1”,因为它是函数“%2”定义的一部分",t.Msg.CHANGE_VALUE_TITLE="更改值:",t.Msg.CLEAN_UP="整理块",t.Msg.COLLAPSED_WARNINGS_WARNING="已收起的信息块内包含警告。",t.Msg.COLLAPSE_ALL="折叠块",t.Msg.COLLAPSE_BLOCK="折叠块",t.Msg.COLOUR_BLEND_COLOUR1="颜色1",t.Msg.COLOUR_BLEND_COLOUR2="颜色2",t.Msg.COLOUR_BLEND_HELPURL="https://meyerweb.com/eric/tools/color-blend/#:::rgbp",t.Msg.COLOUR_BLEND_RATIO="比例",t.Msg.COLOUR_BLEND_TITLE="混合",t.Msg.COLOUR_BLEND_TOOLTIP="把两种颜色以一个给定的比例(0.0-1.0)进行混合。",t.Msg.COLOUR_PICKER_HELPURL="https://zh.wikipedia.org/wiki/颜色",t.Msg.COLOUR_PICKER_TOOLTIP="从调色板中选择一种颜色。",t.Msg.COLOUR_RANDOM_HELPURL="http://randomcolour.com",t.Msg.COLOUR_RANDOM_TITLE="随机颜色",t.Msg.COLOUR_RANDOM_TOOLTIP="随机选择一种颜色。",t.Msg.COLOUR_RGB_BLUE="蓝色",t.Msg.COLOUR_RGB_GREEN="绿色",t.Msg.COLOUR_RGB_HELPURL="https://www.december.com/html/spec/colorpercompact.html",t.Msg.COLOUR_RGB_RED="红色",t.Msg.COLOUR_RGB_TITLE="颜色",t.Msg.COLOUR_RGB_TOOLTIP="通过指定红色、绿色和蓝色的量创建一种颜色。所有的值必须在0和100之间。",t.Msg.CONTROLS_FLOW_STATEMENTS_HELPURL="https://github.com/google/blockly/wiki/Loops#loop-termination-blocks",t.Msg.CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK="跳出循环",t.Msg.CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE="继续下一轮循环",t.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK="跳出包含它的循环。",t.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE="跳过本轮循环的剩余部分,并继进行续下一轮循环。",t.Msg.CONTROLS_FLOW_STATEMENTS_WARNING="警告:这个块只能在循环内使用。",t.Msg.CONTROLS_FOREACH_HELPURL="https://github.com/google/blockly/wiki/Loops#for-each",t.Msg.CONTROLS_FOREACH_TITLE="遍历列表 %2 里的每一项 %1",t.Msg.CONTROLS_FOREACH_TOOLTIP="遍历列表中的每一项,将变量“%1”设为所选项,并执行一些语句。",t.Msg.CONTROLS_FOR_HELPURL="https://github.com/google/blockly/wiki/Loops#count-with",t.Msg.CONTROLS_FOR_TITLE="变量 %1 从 %2 数到 %3 每次增加 %4",t.Msg.CONTROLS_FOR_TOOLTIP="用变量%1记录从开始数值到终止数值之间的数值,数值按指定间隔增加,并执行指定的块。",t.Msg.CONTROLS_IF_ELSEIF_TOOLTIP="在这个if语句块中增加一个条件。",t.Msg.CONTROLS_IF_ELSE_TOOLTIP="在这个if语句块中添加一个最终的,包括所有其余情况的条件。",t.Msg.CONTROLS_IF_HELPURL="https://github.com/google/blockly/wiki/IfElse",t.Msg.CONTROLS_IF_IF_TOOLTIP="增加、删除或重新排列各节来重新配置这个if语句块。",t.Msg.CONTROLS_IF_MSG_ELSE="否则",t.Msg.CONTROLS_IF_MSG_ELSEIF="否则如果",t.Msg.CONTROLS_IF_MSG_IF="如果",t.Msg.CONTROLS_IF_TOOLTIP_1="如果值为真,执行一些语句。",t.Msg.CONTROLS_IF_TOOLTIP_2="如果值为真,则执行第一块语句。否则,则执行第二块语句。",t.Msg.CONTROLS_IF_TOOLTIP_3="如果第一个值为真,则执行第一块的语句。否则,如果第二个值为真,则执行第二块的语句。",t.Msg.CONTROLS_IF_TOOLTIP_4="如果第一个值为真,则执行第一块对语句。否则,如果第二个值为真,则执行语句的第二块。如果没有值为真,则执行最后一块的语句。",t.Msg.CONTROLS_REPEAT_HELPURL="https://zh.wikipedia.org/wiki/For循环",t.Msg.CONTROLS_REPEAT_INPUT_DO="执行",t.Msg.CONTROLS_REPEAT_TITLE="重复 %1 次",t.Msg.CONTROLS_REPEAT_TOOLTIP="多次执行一些语句。",t.Msg.CONTROLS_WHILEUNTIL_HELPURL="https://github.com/google/blockly/wiki/Loops#repeat",t.Msg.CONTROLS_WHILEUNTIL_OPERATOR_UNTIL="重复直到条件满足",t.Msg.CONTROLS_WHILEUNTIL_OPERATOR_WHILE="当条件满足时重复",t.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL="只要值为假,就一直循环执行一些语句。",t.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE="只要值为真,就一直循环执行一些语句。",t.Msg.DELETE_ALL_BLOCKS="删除所有 %1 个块吗?",t.Msg.DELETE_BLOCK="删除块",t.Msg.DELETE_VARIABLE="删除变量“%1”",t.Msg.DELETE_VARIABLE_CONFIRMATION="要删除对变量“%2”的%1个引用吗?",t.Msg.DELETE_X_BLOCKS="删除 %1 个块",t.Msg.DISABLE_BLOCK="禁用块",t.Msg.DUPLICATE_BLOCK="复制",t.Msg.DUPLICATE_COMMENT="复制注释",t.Msg.ENABLE_BLOCK="启用块",t.Msg.EXPAND_ALL="展开块",t.Msg.EXPAND_BLOCK="展开块",t.Msg.EXTERNAL_INPUTS="外部输入",t.Msg.HELP="帮助",t.Msg.INLINE_INPUTS="单行输入",t.Msg.IOS_CANCEL="取消",t.Msg.IOS_ERROR="错误",t.Msg.IOS_OK="确定",t.Msg.IOS_PROCEDURES_ADD_INPUT="+ 添加输入",t.Msg.IOS_PROCEDURES_ALLOW_STATEMENTS="允许的语句",t.Msg.IOS_PROCEDURES_DUPLICATE_INPUTS_ERROR="这个函数有多个输入。",t.Msg.IOS_PROCEDURES_INPUTS="输入",t.Msg.IOS_VARIABLES_ADD_BUTTON="添加",t.Msg.IOS_VARIABLES_ADD_VARIABLE="+ 添加变量",t.Msg.IOS_VARIABLES_DELETE_BUTTON="删除",t.Msg.IOS_VARIABLES_EMPTY_NAME_ERROR="你不能使用空白的变量名。",t.Msg.IOS_VARIABLES_RENAME_BUTTON="重命名",t.Msg.IOS_VARIABLES_VARIABLE_NAME="变量名",t.Msg.LISTS_CREATE_EMPTY_HELPURL="https://github.com/google/blockly/wiki/Lists#create-empty-list",t.Msg.LISTS_CREATE_EMPTY_TITLE="创建空列表",t.Msg.LISTS_CREATE_EMPTY_TOOLTIP="返回一个列表,长度为 0,不包含任何数据记录",t.Msg.LISTS_CREATE_WITH_CONTAINER_TITLE_ADD="列表",t.Msg.LISTS_CREATE_WITH_CONTAINER_TOOLTIP="增加、删除或重新排列各部分以此重新配置这个列表块。",t.Msg.LISTS_CREATE_WITH_HELPURL="https://github.com/google/blockly/wiki/Lists#create-list-with",t.Msg.LISTS_CREATE_WITH_INPUT_WITH="创建列表,内容:",t.Msg.LISTS_CREATE_WITH_ITEM_TOOLTIP="将一个项添加到列表中。",t.Msg.LISTS_CREATE_WITH_TOOLTIP="建立一个具有任意数量项目的列表。",t.Msg.LISTS_GET_INDEX_FIRST="第一项",t.Msg.LISTS_GET_INDEX_FROM_END="倒数第#项",t.Msg.LISTS_GET_INDEX_FROM_START="#",t.Msg.LISTS_GET_INDEX_GET="取得",t.Msg.LISTS_GET_INDEX_GET_REMOVE="取得并移除",t.Msg.LISTS_GET_INDEX_LAST="最后一项",t.Msg.LISTS_GET_INDEX_RANDOM="随机的一项",t.Msg.LISTS_GET_INDEX_REMOVE="移除",t.Msg.LISTS_GET_INDEX_TAIL="-",t.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FIRST="返回列表中的第一项。",t.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM="返回在列表中的指定位置的项。",t.Msg.LISTS_GET_INDEX_TOOLTIP_GET_LAST="返回列表中的最后一项。",t.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM="返回列表中的随机一项。",t.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FIRST="移除并返回列表中的第一项。",t.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM="移除并返回列表中的指定位置的项。",t.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_LAST="移除并返回列表中的最后一项。",t.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM="移除并返回列表中的随机一项。",t.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FIRST="移除列表中的第一项",t.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FROM="移除在列表中的指定位置的项。",t.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_LAST="移除列表中的最后一项",t.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_RANDOM="删除列表中的随机一项。",t.Msg.LISTS_GET_SUBLIST_END_FROM_END="到倒数第#项",t.Msg.LISTS_GET_SUBLIST_END_FROM_START="到第#项",t.Msg.LISTS_GET_SUBLIST_END_LAST="到最后一项",t.Msg.LISTS_GET_SUBLIST_HELPURL="https://github.com/google/blockly/wiki/Lists#getting-a-sublist",t.Msg.LISTS_GET_SUBLIST_START_FIRST="获取子列表,从第一项",t.Msg.LISTS_GET_SUBLIST_START_FROM_END="获取子列表,从倒数第#项",t.Msg.LISTS_GET_SUBLIST_START_FROM_START="获取子列表,从第#项",t.Msg.LISTS_GET_SUBLIST_TAIL="-",t.Msg.LISTS_GET_SUBLIST_TOOLTIP="复制列表中指定的部分。",t.Msg.LISTS_INDEX_FROM_END_TOOLTIP="%1是最后一项。",t.Msg.LISTS_INDEX_FROM_START_TOOLTIP="%1是第一项。",t.Msg.LISTS_INDEX_OF_FIRST="寻找第一次出现的项",t.Msg.LISTS_INDEX_OF_HELPURL="https://github.com/google/blockly/wiki/Lists#getting-items-from-a-list",t.Msg.LISTS_INDEX_OF_LAST="寻找最后一次出现的项",t.Msg.LISTS_INDEX_OF_TOOLTIP="返回在列表中的第一/最后一个匹配项的索引值。如果找不到项目则返回%1。",t.Msg.LISTS_INLIST="在列表中",t.Msg.LISTS_ISEMPTY_HELPURL="https://github.com/google/blockly/wiki/Lists#is-empty",t.Msg.LISTS_ISEMPTY_TITLE="%1是空的",t.Msg.LISTS_ISEMPTY_TOOLTIP="如果改列表为空,则返回真。",t.Msg.LISTS_LENGTH_HELPURL="https://github.com/google/blockly/wiki/Lists#length-of",t.Msg.LISTS_LENGTH_TITLE="%1的长度",t.Msg.LISTS_LENGTH_TOOLTIP="返回列表的长度。",t.Msg.LISTS_REPEAT_HELPURL="https://github.com/google/blockly/wiki/Lists#create-list-with",t.Msg.LISTS_REPEAT_TITLE="建立列表使用项 %1 重复 %2 次",t.Msg.LISTS_REPEAT_TOOLTIP="建立包含指定重复次数的值的列表。",t.Msg.LISTS_REVERSE_HELPURL="https://github.com/google/blockly/wiki/Lists#reversing-a-list",t.Msg.LISTS_REVERSE_MESSAGE0="倒转%1",t.Msg.LISTS_REVERSE_TOOLTIP="倒转一个列表,返回副本。",t.Msg.LISTS_SET_INDEX_HELPURL="https://github.com/google/blockly/wiki/Lists#in-list--set",t.Msg.LISTS_SET_INDEX_INPUT_TO="值为",t.Msg.LISTS_SET_INDEX_INSERT="插入在",t.Msg.LISTS_SET_INDEX_SET="设置",t.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FIRST="在列表的起始处添加该项。",t.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FROM="在列表中指定位置插入项。",t.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_LAST="在列表的末尾处添加该项。",t.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_RANDOM="在列表的随机位置插入该项。",t.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FIRST="设置列表中的第一项。",t.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM="设置在列表中指定位置的项。",t.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST="设置列表中的最后一项。",t.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM="设置列表中的随机一项。",t.Msg.LISTS_SORT_HELPURL="https://github.com/google/blockly/wiki/Lists#sorting-a-list",t.Msg.LISTS_SORT_ORDER_ASCENDING="升序",t.Msg.LISTS_SORT_ORDER_DESCENDING="降序",t.Msg.LISTS_SORT_TITLE="排序%1 %2 %3",t.Msg.LISTS_SORT_TOOLTIP="排序一个列表,返回副本。",t.Msg.LISTS_SORT_TYPE_IGNORECASE="按字母(忽略大小写)",t.Msg.LISTS_SORT_TYPE_NUMERIC="按数字",t.Msg.LISTS_SORT_TYPE_TEXT="按字母",t.Msg.LISTS_SPLIT_HELPURL="https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists",t.Msg.LISTS_SPLIT_LIST_FROM_TEXT="从文本制作列表",t.Msg.LISTS_SPLIT_TEXT_FROM_LIST="将列表合并为文本",t.Msg.LISTS_SPLIT_TOOLTIP_JOIN="加入文本列表至一个文本,由分隔符分隔。",t.Msg.LISTS_SPLIT_TOOLTIP_SPLIT="将文本按指定的分隔符拆分为文本组成的列表。",t.Msg.LISTS_SPLIT_WITH_DELIMITER="分隔符:",t.Msg.LOGIC_BOOLEAN_FALSE="假",t.Msg.LOGIC_BOOLEAN_HELPURL="https://github.com/google/blockly/wiki/Logic#values",t.Msg.LOGIC_BOOLEAN_TOOLTIP="返回真或假。",t.Msg.LOGIC_BOOLEAN_TRUE="真",t.Msg.LOGIC_COMPARE_HELPURL="https://zh.wikipedia.org/wiki/不等",t.Msg.LOGIC_COMPARE_TOOLTIP_EQ="如果两个输入结果相等,则返回真。",t.Msg.LOGIC_COMPARE_TOOLTIP_GT="如果第一个输入结果比第二个大,则返回真。",t.Msg.LOGIC_COMPARE_TOOLTIP_GTE="如果第一个输入结果大于或等于第二个输入结果,则返回真。",t.Msg.LOGIC_COMPARE_TOOLTIP_LT="如果第一个输入结果比第二个小,则返回真。",t.Msg.LOGIC_COMPARE_TOOLTIP_LTE="如果第一个输入结果小于或等于第二个输入结果,则返回真。",t.Msg.LOGIC_COMPARE_TOOLTIP_NEQ="如果两个输入结果不相等,则返回真。",t.Msg.LOGIC_NEGATE_HELPURL="https://github.com/google/blockly/wiki/Logic#not",t.Msg.LOGIC_NEGATE_TITLE="%1不成立",t.Msg.LOGIC_NEGATE_TOOLTIP="如果输入结果为假,则返回真;如果输入结果为真,则返回假。",t.Msg.LOGIC_NULL="空",t.Msg.LOGIC_NULL_HELPURL="https://en.wikipedia.org/wiki/Nullable_type",t.Msg.LOGIC_NULL_TOOLTIP="返回空值。",t.Msg.LOGIC_OPERATION_AND="并且",t.Msg.LOGIC_OPERATION_HELPURL="https://github.com/google/blockly/wiki/Logic#logical-operations",t.Msg.LOGIC_OPERATION_OR="或",t.Msg.LOGIC_OPERATION_TOOLTIP_AND="如果两个输入结果都为真,则返回真。",t.Msg.LOGIC_OPERATION_TOOLTIP_OR="如果至少有一个输入结果为真,则返回真。",t.Msg.LOGIC_TERNARY_CONDITION="断言",t.Msg.LOGIC_TERNARY_HELPURL="https://zh.wikipedia.org/wiki/条件运算符",t.Msg.LOGIC_TERNARY_IF_FALSE="如果为假",t.Msg.LOGIC_TERNARY_IF_TRUE="如果为真",t.Msg.LOGIC_TERNARY_TOOLTIP="检查“断言”里的条件语句。如果条件为真,则返回“如果为真”的值,否则,则返回“如果为假”的值。",t.Msg.MATH_ADDITION_SYMBOL="+",t.Msg.MATH_ARITHMETIC_HELPURL="https://zh.wikipedia.org/wiki/算术",t.Msg.MATH_ARITHMETIC_TOOLTIP_ADD="返回两个数值的和。",t.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE="返回两个数值的商。",t.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS="返回两个数值的差。",t.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY="返回两个数值的乘积。",t.Msg.MATH_ARITHMETIC_TOOLTIP_POWER="返回以第一个数值为底数,以第二个数值为幂的结果。",t.Msg.MATH_ATAN2_HELPURL="https://zh.wikipedia.org/wiki/反正切2",t.Msg.MATH_ATAN2_TITLE="点(x:%1,y:%2)的方位角",t.Msg.MATH_ATAN2_TOOLTIP="返回点(X,Y)的反正切值,范围为-180到180度。",t.Msg.MATH_CHANGE_HELPURL="https://zh.wikipedia.org/wiki/加法",t.Msg.MATH_CHANGE_TITLE="将 %1 增加 %2",t.Msg.MATH_CHANGE_TOOLTIP="为变量“%1”增加一个数值。",t.Msg.MATH_CONSTANT_HELPURL="https://zh.wikipedia.org/wiki/数学常数",t.Msg.MATH_CONSTANT_TOOLTIP="返回一个常见常量:π (3.141…)、e (2.718…)、φ (1.618…)、根号2 (1.414…)、根号二分之一 (0.707…)或∞ (无穷大)。",t.Msg.MATH_CONSTRAIN_HELPURL="https://en.wikipedia.org/wiki/Clamping_(graphics)",t.Msg.MATH_CONSTRAIN_TITLE="将 %1 限制在 最低 %2 到最高 %3 之间",t.Msg.MATH_CONSTRAIN_TOOLTIP="将一个数值限制在两个指定的数值范围(含边界)之间。",t.Msg.MATH_DIVISION_SYMBOL="÷",t.Msg.MATH_IS_DIVISIBLE_BY="可被整除",t.Msg.MATH_IS_EVEN="是偶数",t.Msg.MATH_IS_NEGATIVE="是负数",t.Msg.MATH_IS_ODD="是奇数",t.Msg.MATH_IS_POSITIVE="是正数",t.Msg.MATH_IS_PRIME="是质数",t.Msg.MATH_IS_TOOLTIP="检查一个数值是否是偶数、奇数、质数、自然数、正数、负数或者是否能被某数整除。返回真或假。",t.Msg.MATH_IS_WHOLE="是整数",t.Msg.MATH_MODULO_HELPURL="https://zh.wikipedia.org/wiki/模除",t.Msg.MATH_MODULO_TITLE="取 %1 ÷ %2 的余数",t.Msg.MATH_MODULO_TOOLTIP="返回这两个数字相除后的余数。",t.Msg.MATH_MULTIPLICATION_SYMBOL="×",t.Msg.MATH_NUMBER_HELPURL="https://zh.wikipedia.org/wiki/数",t.Msg.MATH_NUMBER_TOOLTIP="一个数值。",t.Msg.MATH_ONLIST_HELPURL="",t.Msg.MATH_ONLIST_OPERATOR_AVERAGE="列表平均值",t.Msg.MATH_ONLIST_OPERATOR_MAX="列表最大值",t.Msg.MATH_ONLIST_OPERATOR_MEDIAN="列表中位数",t.Msg.MATH_ONLIST_OPERATOR_MIN="列表最小值",t.Msg.MATH_ONLIST_OPERATOR_MODE="列表中的众数",t.Msg.MATH_ONLIST_OPERATOR_RANDOM="列表中的随机一项",t.Msg.MATH_ONLIST_OPERATOR_STD_DEV="列表的标准差",t.Msg.MATH_ONLIST_OPERATOR_SUM="列表中数值的和",t.Msg.MATH_ONLIST_TOOLTIP_AVERAGE="返回列表中的数值的平均值。",t.Msg.MATH_ONLIST_TOOLTIP_MAX="返回列表中最大值。",t.Msg.MATH_ONLIST_TOOLTIP_MEDIAN="返回列表中数值的中位数。",t.Msg.MATH_ONLIST_TOOLTIP_MIN="返回列表中最小值。",t.Msg.MATH_ONLIST_TOOLTIP_MODE="返回列表中的出现次数最多的项的列表。",t.Msg.MATH_ONLIST_TOOLTIP_RANDOM="从列表中返回一个随机的元素。",t.Msg.MATH_ONLIST_TOOLTIP_STD_DEV="返回列表的标准差。",t.Msg.MATH_ONLIST_TOOLTIP_SUM="返回列表中的所有数值的和。",t.Msg.MATH_POWER_SYMBOL="^",t.Msg.MATH_RANDOM_FLOAT_HELPURL="https://zh.wikipedia.org/wiki/随机数生成器",t.Msg.MATH_RANDOM_FLOAT_TITLE_RANDOM="随机小数",t.Msg.MATH_RANDOM_FLOAT_TOOLTIP="返回一个从0.0(含)到1.0(不含)之间的随机数。",t.Msg.MATH_RANDOM_INT_HELPURL="https://zh.wikipedia.org/wiki/随机数生成器",t.Msg.MATH_RANDOM_INT_TITLE="从 %1 到 %2 范围内的随机整数",t.Msg.MATH_RANDOM_INT_TOOLTIP="返回一个限制在两个指定数值的范围(含边界)之间的随机整数。",t.Msg.MATH_ROUND_HELPURL="https://zh.wikipedia.org/wiki/数值修约",t.Msg.MATH_ROUND_OPERATOR_ROUND="四舍五入",t.Msg.MATH_ROUND_OPERATOR_ROUNDDOWN="向下舍入",t.Msg.MATH_ROUND_OPERATOR_ROUNDUP="向上舍入",t.Msg.MATH_ROUND_TOOLTIP="数字向上或向下舍入。",t.Msg.MATH_SINGLE_HELPURL="https://zh.wikipedia.org/wiki/平方根",t.Msg.MATH_SINGLE_OP_ABSOLUTE="绝对值",t.Msg.MATH_SINGLE_OP_ROOT="平方根",t.Msg.MATH_SINGLE_TOOLTIP_ABS="返回一个数值的绝对值。",t.Msg.MATH_SINGLE_TOOLTIP_EXP="返回一个数值的e次幂。",t.Msg.MATH_SINGLE_TOOLTIP_LN="返回一个数值的自然对数。",t.Msg.MATH_SINGLE_TOOLTIP_LOG10="返回一个数值的以10为底的对数。",t.Msg.MATH_SINGLE_TOOLTIP_NEG="返回一个数值的相反数。",t.Msg.MATH_SINGLE_TOOLTIP_POW10="返回一个数值的10次幂。",t.Msg.MATH_SINGLE_TOOLTIP_ROOT="返回一个数的平方根。",t.Msg.MATH_SUBTRACTION_SYMBOL="-",t.Msg.MATH_TRIG_ACOS="acos",t.Msg.MATH_TRIG_ASIN="asin",t.Msg.MATH_TRIG_ATAN="atan",t.Msg.MATH_TRIG_COS="cos",t.Msg.MATH_TRIG_HELPURL="https://zh.wikipedia.org/wiki/三角函数",t.Msg.MATH_TRIG_SIN="sin",t.Msg.MATH_TRIG_TAN="tan",t.Msg.MATH_TRIG_TOOLTIP_ACOS="返回一个数值的反余弦值。",t.Msg.MATH_TRIG_TOOLTIP_ASIN="返回一个数值的反正弦值。",t.Msg.MATH_TRIG_TOOLTIP_ATAN="返回一个数值的反正切值。",t.Msg.MATH_TRIG_TOOLTIP_COS="返回指定角度的余弦值(非弧度)。",t.Msg.MATH_TRIG_TOOLTIP_SIN="返回指定角度的正弦值(非弧度)。",t.Msg.MATH_TRIG_TOOLTIP_TAN="返回指定角度的正切值(非弧度)。",t.Msg.NEW_COLOUR_VARIABLE="创建颜色变量...",t.Msg.NEW_NUMBER_VARIABLE="创建数字变量...",t.Msg.NEW_STRING_VARIABLE="创建字符串变量...",t.Msg.NEW_VARIABLE="创建变量...",t.Msg.NEW_VARIABLE_TITLE="新变量的名称:",t.Msg.NEW_VARIABLE_TYPE_TITLE="新变量的类型:",t.Msg.ORDINAL_NUMBER_SUFFIX="-",t.Msg.PROCEDURES_ALLOW_STATEMENTS="允许声明",t.Msg.PROCEDURES_BEFORE_PARAMS="与:",t.Msg.PROCEDURES_CALLNORETURN_HELPURL="https://zh.wikipedia.org/wiki/子程序",t.Msg.PROCEDURES_CALLNORETURN_TOOLTIP="运行用户定义的函数“%1”。",t.Msg.PROCEDURES_CALLRETURN_HELPURL="https://zh.wikipedia.org/wiki/子程序",t.Msg.PROCEDURES_CALLRETURN_TOOLTIP="运行用户定义的函数“%1”,并使用它的输出值。",t.Msg.PROCEDURES_CALL_BEFORE_PARAMS="与:",t.Msg.PROCEDURES_CREATE_DO="创建“%1”",t.Msg.PROCEDURES_DEFNORETURN_COMMENT="描述该功能...",t.Msg.PROCEDURES_DEFNORETURN_DO="-",t.Msg.PROCEDURES_DEFNORETURN_HELPURL="https://zh.wikipedia.org/wiki/子程序",t.Msg.PROCEDURES_DEFNORETURN_PROCEDURE="做点什么",t.Msg.PROCEDURES_DEFNORETURN_TITLE="至",t.Msg.PROCEDURES_DEFNORETURN_TOOLTIP="创建一个不带输出值的函数。",t.Msg.PROCEDURES_DEFRETURN_HELPURL="https://zh.wikipedia.org/wiki/子程序",t.Msg.PROCEDURES_DEFRETURN_RETURN="返回",t.Msg.PROCEDURES_DEFRETURN_TOOLTIP="创建一个有输出值的函数。",t.Msg.PROCEDURES_DEF_DUPLICATE_WARNING="警告:此函数具有重复参数。",t.Msg.PROCEDURES_HIGHLIGHT_DEF="突出显示函数定义",t.Msg.PROCEDURES_IFRETURN_HELPURL="http://c2.com/cgi/wiki?GuardClause",t.Msg.PROCEDURES_IFRETURN_TOOLTIP="如果值为真,则返回第二个值。",t.Msg.PROCEDURES_IFRETURN_WARNING="警告:这个块只能在函数内部使用。",t.Msg.PROCEDURES_MUTATORARG_TITLE="输入名称:",t.Msg.PROCEDURES_MUTATORARG_TOOLTIP="添加函数输入。",t.Msg.PROCEDURES_MUTATORCONTAINER_TITLE="输入",t.Msg.PROCEDURES_MUTATORCONTAINER_TOOLTIP="添加、移除或重新排此函数的输入。",t.Msg.REDO="重做",t.Msg.REMOVE_COMMENT="删除注释",t.Msg.RENAME_VARIABLE="重命名变量...",t.Msg.RENAME_VARIABLE_TITLE="将所有“%1”变量重命名为:",t.Msg.TEXT_APPEND_HELPURL="https://github.com/google/blockly/wiki/Text#text-modification",t.Msg.TEXT_APPEND_TITLE="在%1之后加上文本%2",t.Msg.TEXT_APPEND_TOOLTIP="将一些文本追加到变量“%1”里。",t.Msg.TEXT_CHANGECASE_HELPURL="https://github.com/google/blockly/wiki/Text#adjusting-text-case",t.Msg.TEXT_CHANGECASE_OPERATOR_LOWERCASE="转为小写",t.Msg.TEXT_CHANGECASE_OPERATOR_TITLECASE="转为首字母大写",t.Msg.TEXT_CHANGECASE_OPERATOR_UPPERCASE="转为大写",t.Msg.TEXT_CHANGECASE_TOOLTIP="用不同的大小写模式复制并返回这段文字。",t.Msg.TEXT_CHARAT_FIRST="获取第一个字符",t.Msg.TEXT_CHARAT_FROM_END="获取倒数第#个字符",t.Msg.TEXT_CHARAT_FROM_START="获取第#个字符",t.Msg.TEXT_CHARAT_HELPURL="https://github.com/google/blockly/wiki/Text#extracting-text",t.Msg.TEXT_CHARAT_LAST="获取最后一个字符",t.Msg.TEXT_CHARAT_RANDOM="获取随机一个字符",t.Msg.TEXT_CHARAT_TAIL="-",t.Msg.TEXT_CHARAT_TITLE="在文本%1 里 %2",t.Msg.TEXT_CHARAT_TOOLTIP="返回位于指定位置的字符。",t.Msg.TEXT_COUNT_HELPURL="https://github.com/google/blockly/wiki/Text#counting-substrings",t.Msg.TEXT_COUNT_MESSAGE0="计算%1在%2里出现的次数",t.Msg.TEXT_COUNT_TOOLTIP="计算在一段文本中,某个部分文本重复出现了多少次。",t.Msg.TEXT_CREATE_JOIN_ITEM_TOOLTIP="将一个项添加到文本中。",t.Msg.TEXT_CREATE_JOIN_TITLE_JOIN="拼接",t.Msg.TEXT_CREATE_JOIN_TOOLTIP="添加、移除或重新排列各节来重新配置这个文本块。",t.Msg.TEXT_GET_SUBSTRING_END_FROM_END="到倒数第#个字符",t.Msg.TEXT_GET_SUBSTRING_END_FROM_START="到第#个字符",t.Msg.TEXT_GET_SUBSTRING_END_LAST="到最后一个字符",t.Msg.TEXT_GET_SUBSTRING_HELPURL="https://github.com/google/blockly/wiki/Text#extracting-a-region-of-text",t.Msg.TEXT_GET_SUBSTRING_INPUT_IN_TEXT="从文本",t.Msg.TEXT_GET_SUBSTRING_START_FIRST="获取子串,从第一个字符",t.Msg.TEXT_GET_SUBSTRING_START_FROM_END="获取子串,从倒数第#个字符",t.Msg.TEXT_GET_SUBSTRING_START_FROM_START="获取子串,从第#个字符",t.Msg.TEXT_GET_SUBSTRING_TAIL="-",t.Msg.TEXT_GET_SUBSTRING_TOOLTIP="返回文本中指定的一部分。",t.Msg.TEXT_INDEXOF_HELPURL="https://github.com/google/blockly/wiki/Text#finding-text",t.Msg.TEXT_INDEXOF_OPERATOR_FIRST="寻找第一次出现的文本",t.Msg.TEXT_INDEXOF_OPERATOR_LAST="寻找最后一次出现的文本",t.Msg.TEXT_INDEXOF_TITLE="在文本 %1 里 %2 %3",t.Msg.TEXT_INDEXOF_TOOLTIP="返回第一个文本段在第二个文本段中的第一/最后一个匹配项的起始位置。如果未找到,则返回%1。",t.Msg.TEXT_ISEMPTY_HELPURL="https://github.com/google/blockly/wiki/Text#checking-for-empty-text",t.Msg.TEXT_ISEMPTY_TITLE="%1是空的",t.Msg.TEXT_ISEMPTY_TOOLTIP="如果给定的文本为空,则返回真。",t.Msg.TEXT_JOIN_HELPURL="https://github.com/google/blockly/wiki/Text#text-creation",t.Msg.TEXT_JOIN_TITLE_CREATEWITH="创建文本,内容:",t.Msg.TEXT_JOIN_TOOLTIP="通过串起任意数量的项以建立一段文本。",t.Msg.TEXT_LENGTH_HELPURL="https://github.com/google/blockly/wiki/Text#text-modification",t.Msg.TEXT_LENGTH_TITLE="%1的长度",t.Msg.TEXT_LENGTH_TOOLTIP="返回给定文本的字母数(包括空格)。",t.Msg.TEXT_PRINT_HELPURL="https://github.com/google/blockly/wiki/Text#printing-text",t.Msg.TEXT_PRINT_TITLE="输出%1",t.Msg.TEXT_PRINT_TOOLTIP="输出指定的文字、数字或其他值。",t.Msg.TEXT_PROMPT_HELPURL="https://github.com/google/blockly/wiki/Text#getting-input-from-the-user",t.Msg.TEXT_PROMPT_TOOLTIP_NUMBER="要求用户输入数字。",t.Msg.TEXT_PROMPT_TOOLTIP_TEXT="要求用户输入一些文本。",t.Msg.TEXT_PROMPT_TYPE_NUMBER="要求输入数字,并显示提示消息",t.Msg.TEXT_PROMPT_TYPE_TEXT="要求输入文本,并显示提示消息",t.Msg.TEXT_REPLACE_HELPURL="https://github.com/google/blockly/wiki/Text#replacing-substrings",t.Msg.TEXT_REPLACE_MESSAGE0="把%3中的%1替换为%2",t.Msg.TEXT_REPLACE_TOOLTIP="在一段文本中,将出现过的某部分文本都替换掉。",t.Msg.TEXT_REVERSE_HELPURL="https://github.com/google/blockly/wiki/Text#reversing-text",t.Msg.TEXT_REVERSE_MESSAGE0="倒转文本%1",t.Msg.TEXT_REVERSE_TOOLTIP="将文本中各个字符的顺序倒转。",t.Msg.TEXT_TEXT_HELPURL="https://zh.wikipedia.org/wiki/字符串",t.Msg.TEXT_TEXT_TOOLTIP="一个字、词语或一行文本。",t.Msg.TEXT_TRIM_HELPURL="https://github.com/google/blockly/wiki/Text#trimming-removing-spaces",t.Msg.TEXT_TRIM_OPERATOR_BOTH="消除其两侧的空白",t.Msg.TEXT_TRIM_OPERATOR_LEFT="消除其左侧的空白",t.Msg.TEXT_TRIM_OPERATOR_RIGHT="消除其右侧的空白",t.Msg.TEXT_TRIM_TOOLTIP="从某一端或同时从两端删除多余的空白,并返回这段文字的一个副本。",t.Msg.TODAY="今天",t.Msg.UNDO="撤销",t.Msg.UNNAMED_KEY="匿名",t.Msg.VARIABLES_DEFAULT_NAME="项目",t.Msg.VARIABLES_GET_CREATE_SET="创建“设定%1”",t.Msg.VARIABLES_GET_HELPURL="https://github.com/google/blockly/wiki/Variables#get",t.Msg.VARIABLES_GET_TOOLTIP="返回此变量的值。",t.Msg.VARIABLES_SET="赋值 %1 为 %2",t.Msg.VARIABLES_SET_CREATE_GET="创建“获得%1”",t.Msg.VARIABLES_SET_HELPURL="https://github.com/google/blockly/wiki/Variables#set",t.Msg.VARIABLES_SET_TOOLTIP="设置此变量,以使它和输入值相等。",t.Msg.VARIABLE_ALREADY_EXISTS="名字叫“%1”的变量已经存在了。",t.Msg.VARIABLE_ALREADY_EXISTS_FOR_ANOTHER_TYPE="名字叫“%1”的变量已经有了另一个类型:“%2”。",t.Msg.WORKSPACE_ARIA_LABEL="Blockly工作区",t.Msg.WORKSPACE_COMMENT_DEFAULT_TEXT="说点什么...",t.Msg.CONTROLS_FOREACH_INPUT_DO=t.Msg.CONTROLS_REPEAT_INPUT_DO,t.Msg.CONTROLS_FOR_INPUT_DO=t.Msg.CONTROLS_REPEAT_INPUT_DO,t.Msg.CONTROLS_IF_ELSEIF_TITLE_ELSEIF=t.Msg.CONTROLS_IF_MSG_ELSEIF,t.Msg.CONTROLS_IF_ELSE_TITLE_ELSE=t.Msg.CONTROLS_IF_MSG_ELSE,t.Msg.CONTROLS_IF_IF_TITLE_IF=t.Msg.CONTROLS_IF_MSG_IF,t.Msg.CONTROLS_IF_MSG_THEN=t.Msg.CONTROLS_REPEAT_INPUT_DO,t.Msg.CONTROLS_WHILEUNTIL_INPUT_DO=t.Msg.CONTROLS_REPEAT_INPUT_DO,t.Msg.LISTS_CREATE_WITH_ITEM_TITLE=t.Msg.VARIABLES_DEFAULT_NAME,t.Msg.LISTS_GET_INDEX_HELPURL=t.Msg.LISTS_INDEX_OF_HELPURL,t.Msg.LISTS_GET_INDEX_INPUT_IN_LIST=t.Msg.LISTS_INLIST,t.Msg.LISTS_GET_SUBLIST_INPUT_IN_LIST=t.Msg.LISTS_INLIST,t.Msg.LISTS_INDEX_OF_INPUT_IN_LIST=t.Msg.LISTS_INLIST,t.Msg.LISTS_SET_INDEX_INPUT_IN_LIST=t.Msg.LISTS_INLIST,t.Msg.MATH_CHANGE_TITLE_ITEM=t.Msg.VARIABLES_DEFAULT_NAME,t.Msg.PROCEDURES_DEFRETURN_COMMENT=t.Msg.PROCEDURES_DEFNORETURN_COMMENT,t.Msg.PROCEDURES_DEFRETURN_DO=t.Msg.PROCEDURES_DEFNORETURN_DO,t.Msg.PROCEDURES_DEFRETURN_PROCEDURE=t.Msg.PROCEDURES_DEFNORETURN_PROCEDURE,t.Msg.PROCEDURES_DEFRETURN_TITLE=t.Msg.PROCEDURES_DEFNORETURN_TITLE,t.Msg.TEXT_APPEND_VARIABLE=t.Msg.VARIABLES_DEFAULT_NAME,t.Msg.TEXT_CREATE_JOIN_ITEM_TITLE_ITEM=t.Msg.VARIABLES_DEFAULT_NAME,t.Msg.MATH_HUE="230",t.Msg.LOOPS_HUE="120",t.Msg.LISTS_HUE="260",t.Msg.LOGIC_HUE="210",t.Msg.VARIABLES_HUE="330",t.Msg.TEXTS_HUE="160",t.Msg.PROCEDURES_HUE="290",t.Msg.COLOUR_HUE="20",t.Msg.VARIABLES_DYNAMIC_HUE="310",t.Msg},i=[n("xnUL")],void 0===(o="function"==typeof(r=s)?r.apply(e,i):r)||(t.exports=o)},ISYW:function(t,e,n){"use strict";e.__esModule=!0;var r,i=n("7+uW"),o=(r=i)&&r.__esModule?r:{default:r},s=n("2kvA");var a=[],l="@@clickoutsideContext",u=void 0,c=0;function h(t,e,n){return function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!(n&&n.context&&r.target&&i.target)||t.contains(r.target)||t.contains(i.target)||t===r.target||n.context.popperElm&&(n.context.popperElm.contains(r.target)||n.context.popperElm.contains(i.target))||(e.expression&&t[l].methodName&&n.context[t[l].methodName]?n.context[t[l].methodName]():t[l].bindingFn&&t[l].bindingFn())}}!o.default.prototype.$isServer&&(0,s.on)(document,"mousedown",function(t){return u=t}),!o.default.prototype.$isServer&&(0,s.on)(document,"mouseup",function(t){a.forEach(function(e){return e[l].documentHandler(t,u)})}),e.default={bind:function(t,e,n){a.push(t);var r=c++;t[l]={id:r,documentHandler:h(t,e,n),methodName:e.expression,bindingFn:e.value}},update:function(t,e,n){t[l].documentHandler=h(t,e,n),t[l].methodName=e.expression,t[l].bindingFn=e.value},unbind:function(t){for(var e=a.length,n=0;n<e;n++)if(a[n][l].id===t[l].id){a.splice(n,1);break}delete t[l]}}},IbAV:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.json=[{tfOpName:"Fill",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"},{start:1,name:"value",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"LinSpace",category:"creation",inputs:[{start:0,name:"start",type:"number"},{start:1,name:"stop",type:"number"},{start:2,name:"num",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"OneHot",category:"creation",inputs:[{start:0,name:"indices",type:"tensor"},{start:1,name:"depth",type:"number"},{start:2,name:"onValue",type:"number",defaultValue:1},{start:3,name:"offValue",type:"number",defaultValue:0}],attrs:[{tfName:"axis",name:"axis",type:"number",notSupported:!0},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Ones",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"OnesLike",category:"creation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"}]},{tfOpName:"RandomUniform",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"minval",name:"minval",type:"number",defaultValue:0},{tfName:"maxval",name:"maxval",type:"number",defaultValue:1},{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"seed",name:"seed",type:"number",defaultValue:0},{tfName:"seed2",name:"seed2",type:"number",defaultValue:0,notSupported:!0},{tfName:"T",name:"T",type:"number",notSupported:!0}]},{tfOpName:"Range",category:"creation",inputs:[{start:0,name:"start",type:"number"},{start:1,name:"stop",type:"number"},{start:2,name:"step",type:"number",defaultValue:0}],attrs:[{tfName:"Tidx",name:"dtype",type:"dtype"}]},{tfOpName:"TruncatedNormal",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"means",name:"mean",type:"number",defaultValue:0},{tfName:"stddev",name:"stdDev",type:"number",defaultValue:1},{tfName:"seed",name:"seed",type:"number"},{tfName:"seed2",name:"seed2",type:"number",defaultValue:0,notSupported:!0},{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"T",name:"T",type:"number",notSupported:!0}]},{tfOpName:"Zeros",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"ZerosLike",category:"creation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"Multinomial",category:"creation",inputs:[{start:0,name:"logits",type:"tensor"},{start:1,name:"numSamples",type:"number"}],attrs:[{tfName:"seed",name:"seed",type:"number"},{tfName:"seed2",name:"seed2",type:"number"},{tfName:"T",name:"dtype",type:"dtype"},{tfName:"output_dtype",name:"output_dtype",type:"dtype"}]}]},Ibhu:function(t,e,n){var r=n("D2L2"),i=n("TcQ7"),o=n("vFc/")(!1),s=n("ax3d")("IE_PROTO");t.exports=function(t,e){var n,a=i(t),l=0,u=[];for(n in a)n!=s&&r(a,n)&&u.push(n);for(;e.length>l;)r(a,n=e[l++])&&(~o(u,n)||u.push(n));return u}},JMbB:function(t,e,n){var r,i,o,s;s=function(t){"use strict";return t.JavaScript=new t.Generator("JavaScript"),t.JavaScript.addReservedWords("break,case,catch,class,const,continue,debugger,default,delete,do,else,export,extends,finally,for,function,if,import,in,instanceof,new,return,super,switch,this,throw,try,typeof,var,void,while,with,yield,enum,implements,interface,let,package,private,protected,public,static,await,null,true,false,arguments,"+Object.getOwnPropertyNames(t.utils.global).join(",")),t.JavaScript.ORDER_ATOMIC=0,t.JavaScript.ORDER_NEW=1.1,t.JavaScript.ORDER_MEMBER=1.2,t.JavaScript.ORDER_FUNCTION_CALL=2,t.JavaScript.ORDER_INCREMENT=3,t.JavaScript.ORDER_DECREMENT=3,t.JavaScript.ORDER_BITWISE_NOT=4.1,t.JavaScript.ORDER_UNARY_PLUS=4.2,t.JavaScript.ORDER_UNARY_NEGATION=4.3,t.JavaScript.ORDER_LOGICAL_NOT=4.4,t.JavaScript.ORDER_TYPEOF=4.5,t.JavaScript.ORDER_VOID=4.6,t.JavaScript.ORDER_DELETE=4.7,t.JavaScript.ORDER_AWAIT=4.8,t.JavaScript.ORDER_EXPONENTIATION=5,t.JavaScript.ORDER_MULTIPLICATION=5.1,t.JavaScript.ORDER_DIVISION=5.2,t.JavaScript.ORDER_MODULUS=5.3,t.JavaScript.ORDER_SUBTRACTION=6.1,t.JavaScript.ORDER_ADDITION=6.2,t.JavaScript.ORDER_BITWISE_SHIFT=7,t.JavaScript.ORDER_RELATIONAL=8,t.JavaScript.ORDER_IN=8,t.JavaScript.ORDER_INSTANCEOF=8,t.JavaScript.ORDER_EQUALITY=9,t.JavaScript.ORDER_BITWISE_AND=10,t.JavaScript.ORDER_BITWISE_XOR=11,t.JavaScript.ORDER_BITWISE_OR=12,t.JavaScript.ORDER_LOGICAL_AND=13,t.JavaScript.ORDER_LOGICAL_OR=14,t.JavaScript.ORDER_CONDITIONAL=15,t.JavaScript.ORDER_ASSIGNMENT=16,t.JavaScript.ORDER_YIELD=17,t.JavaScript.ORDER_COMMA=18,t.JavaScript.ORDER_NONE=99,t.JavaScript.ORDER_OVERRIDES=[[t.JavaScript.ORDER_FUNCTION_CALL,t.JavaScript.ORDER_MEMBER],[t.JavaScript.ORDER_FUNCTION_CALL,t.JavaScript.ORDER_FUNCTION_CALL],[t.JavaScript.ORDER_MEMBER,t.JavaScript.ORDER_MEMBER],[t.JavaScript.ORDER_MEMBER,t.JavaScript.ORDER_FUNCTION_CALL],[t.JavaScript.ORDER_LOGICAL_NOT,t.JavaScript.ORDER_LOGICAL_NOT],[t.JavaScript.ORDER_MULTIPLICATION,t.JavaScript.ORDER_MULTIPLICATION],[t.JavaScript.ORDER_ADDITION,t.JavaScript.ORDER_ADDITION],[t.JavaScript.ORDER_LOGICAL_AND,t.JavaScript.ORDER_LOGICAL_AND],[t.JavaScript.ORDER_LOGICAL_OR,t.JavaScript.ORDER_LOGICAL_OR]],t.JavaScript.isInitialized=!1,t.JavaScript.init=function(e){Object.getPrototypeOf(this).init.call(this),this.nameDB_?this.nameDB_.reset():this.nameDB_=new t.Names(this.RESERVED_WORDS_),this.nameDB_.setVariableMap(e.getVariableMap()),this.nameDB_.populateVariables(e),this.nameDB_.populateProcedures(e);for(var n=[],r=t.Variables.allDeveloperVariables(e),i=0;i<r.length;i++)n.push(this.nameDB_.getName(r[i],t.Names.DEVELOPER_VARIABLE_TYPE));for(e=t.Variables.allUsedVarModels(e),i=0;i<e.length;i++)n.push(this.nameDB_.getName(e[i].getId(),t.VARIABLE_CATEGORY_NAME));n.length&&(this.definitions_.variables="var "+n.join(", ")+";"),this.isInitialized=!0},t.JavaScript.finish=function(e){var n=t.utils.object.values(this.definitions_);return e=Object.getPrototypeOf(this).finish.call(this,e),this.isInitialized=!1,this.nameDB_.reset(),n.join("\n\n")+"\n\n\n"+e},t.JavaScript.scrubNakedValue=function(t){return t+";\n"},t.JavaScript.quote_=function(t){return"'"+(t=t.replace(/\\/g,"\\\\").replace(/\n/g,"\\\n").replace(/'/g,"\\'"))+"'"},t.JavaScript.multiline_quote_=function(t){return t.split(/\n/g).map(this.quote_).join(" + '\\n' +\n")},t.JavaScript.scrub_=function(e,n,r){var i="";if(!e.outputConnection||!e.outputConnection.targetConnection){var o=e.getCommentText();o&&(o=t.utils.string.wrap(o,this.COMMENT_WRAP-3),i+=this.prefixLines(o+"\n","// "));for(var s=0;s<e.inputList.length;s++)e.inputList[s].type==t.inputTypes.VALUE&&(o=e.inputList[s].connection.targetBlock())&&(o=this.allNestedComments(o))&&(i+=this.prefixLines(o,"// "))}return e=e.nextConnection&&e.nextConnection.targetBlock(),i+n+(r=r?"":this.blockToCode(e))},t.JavaScript.getAdjusted=function(e,n,r,i,o){r=r||0,o=o||this.ORDER_NONE,e.workspace.options.oneBasedIndex&&r--;var s=e.workspace.options.oneBasedIndex?"1":"0";if(e=0<r?this.valueToCode(e,n,this.ORDER_ADDITION)||s:0>r?this.valueToCode(e,n,this.ORDER_SUBTRACTION)||s:i?this.valueToCode(e,n,this.ORDER_UNARY_NEGATION)||s:this.valueToCode(e,n,o)||s,t.isNumber(e))e=Number(e)+r,i&&(e=-e);else{if(0<r){e=e+" + "+r;var a=this.ORDER_ADDITION}else 0>r&&(e=e+" - "+-r,a=this.ORDER_SUBTRACTION);i&&(e=r?"-("+e+")":"-"+e,a=this.ORDER_UNARY_NEGATION),a=Math.floor(a),o=Math.floor(o),a&&o>=a&&(e="("+e+")")}return e},t.JavaScript.colour={},t.JavaScript.colour_picker=function(e){return[t.JavaScript.quote_(e.getFieldValue("COLOUR")),t.JavaScript.ORDER_ATOMIC]},t.JavaScript.colour_random=function(e){return[t.JavaScript.provideFunction_("colourRandom",["function "+t.JavaScript.FUNCTION_NAME_PLACEHOLDER_+"() {"," var num = Math.floor(Math.random() * Math.pow(2, 24));"," return '#' + ('00000' + num.toString(16)).substr(-6);","}"])+"()",t.JavaScript.ORDER_FUNCTION_CALL]},t.JavaScript.colour_rgb=function(e){var n=t.JavaScript.valueToCode(e,"RED",t.JavaScript.ORDER_NONE)||0,r=t.JavaScript.valueToCode(e,"GREEN",t.JavaScript.ORDER_NONE)||0;return e=t.JavaScript.valueToCode(e,"BLUE",t.JavaScript.ORDER_NONE)||0,[t.JavaScript.provideFunction_("colourRgb",["function "+t.JavaScript.FUNCTION_NAME_PLACEHOLDER_+"(r, g, b) {"," r = Math.max(Math.min(Number(r), 100), 0) * 2.55;"," g = Math.max(Math.min(Number(g), 100), 0) * 2.55;"," b = Math.max(Math.min(Number(b), 100), 0) * 2.55;"," r = ('0' + (Math.round(r) || 0).toString(16)).slice(-2);"," g = ('0' + (Math.round(g) || 0).toString(16)).slice(-2);"," b = ('0' + (Math.round(b) || 0).toString(16)).slice(-2);"," return '#' + r + g + b;","}"])+"("+n+", "+r+", "+e+")",t.JavaScript.ORDER_FUNCTION_CALL]},t.JavaScript.colour_blend=function(e){var n=t.JavaScript.valueToCode(e,"COLOUR1",t.JavaScript.ORDER_NONE)||"'#000000'",r=t.JavaScript.valueToCode(e,"COLOUR2",t.JavaScript.ORDER_NONE)||"'#000000'";return e=t.JavaScript.valueToCode(e,"RATIO",t.JavaScript.ORDER_NONE)||.5,[t.JavaScript.provideFunction_("colourBlend",["function "+t.JavaScript.FUNCTION_NAME_PLACEHOLDER_+"(c1, c2, ratio) {"," ratio = Math.max(Math.min(Number(ratio), 1), 0);"," var r1 = parseInt(c1.substring(1, 3), 16);"," var g1 = parseInt(c1.substring(3, 5), 16);"," var b1 = parseInt(c1.substring(5, 7), 16);"," var r2 = parseInt(c2.substring(1, 3), 16);"," var g2 = parseInt(c2.substring(3, 5), 16);"," var b2 = parseInt(c2.substring(5, 7), 16);"," var r = Math.round(r1 * (1 - ratio) + r2 * ratio);"," var g = Math.round(g1 * (1 - ratio) + g2 * ratio);"," var b = Math.round(b1 * (1 - ratio) + b2 * ratio);"," r = ('0' + (r || 0).toString(16)).slice(-2);"," g = ('0' + (g || 0).toString(16)).slice(-2);"," b = ('0' + (b || 0).toString(16)).slice(-2);"," return '#' + r + g + b;","}"])+"("+n+", "+r+", "+e+")",t.JavaScript.ORDER_FUNCTION_CALL]},t.JavaScript.lists={},t.JavaScript.lists_create_empty=function(e){return["[]",t.JavaScript.ORDER_ATOMIC]},t.JavaScript.lists_create_with=function(e){for(var n=Array(e.itemCount_),r=0;r<e.itemCount_;r++)n[r]=t.JavaScript.valueToCode(e,"ADD"+r,t.JavaScript.ORDER_NONE)||"null";return["["+n.join(", ")+"]",t.JavaScript.ORDER_ATOMIC]},t.JavaScript.lists_repeat=function(e){return[t.JavaScript.provideFunction_("listsRepeat",["function "+t.JavaScript.FUNCTION_NAME_PLACEHOLDER_+"(value, n) {"," var array = [];"," for (var i = 0; i < n; i++) {"," array[i] = value;"," }"," return array;","}"])+"("+(t.JavaScript.valueToCode(e,"ITEM",t.JavaScript.ORDER_NONE)||"null")+", "+(e=t.JavaScript.valueToCode(e,"NUM",t.JavaScript.ORDER_NONE)||"0")+")",t.JavaScript.ORDER_FUNCTION_CALL]},t.JavaScript.lists_length=function(e){return[(t.JavaScript.valueToCode(e,"VALUE",t.JavaScript.ORDER_MEMBER)||"[]")+".length",t.JavaScript.ORDER_MEMBER]},t.JavaScript.lists_isEmpty=function(e){return["!"+(t.JavaScript.valueToCode(e,"VALUE",t.JavaScript.ORDER_MEMBER)||"[]")+".length",t.JavaScript.ORDER_LOGICAL_NOT]},t.JavaScript.lists_indexOf=function(e){var n="FIRST"==e.getFieldValue("END")?"indexOf":"lastIndexOf",r=t.JavaScript.valueToCode(e,"FIND",t.JavaScript.ORDER_NONE)||"''";return n=(t.JavaScript.valueToCode(e,"VALUE",t.JavaScript.ORDER_MEMBER)||"[]")+"."+n+"("+r+")",e.workspace.options.oneBasedIndex?[n+" + 1",t.JavaScript.ORDER_ADDITION]:[n,t.JavaScript.ORDER_FUNCTION_CALL]},t.JavaScript.lists_getIndex=function(e){var n=e.getFieldValue("MODE")||"GET",r=e.getFieldValue("WHERE")||"FROM_START",i=t.JavaScript.valueToCode(e,"VALUE","RANDOM"==r?t.JavaScript.ORDER_NONE:t.JavaScript.ORDER_MEMBER)||"[]";switch(r){case"FIRST":if("GET"==n)return[i+"[0]",t.JavaScript.ORDER_MEMBER];if("GET_REMOVE"==n)return[i+".shift()",t.JavaScript.ORDER_MEMBER];if("REMOVE"==n)return i+".shift();\n";break;case"LAST":if("GET"==n)return[i+".slice(-1)[0]",t.JavaScript.ORDER_MEMBER];if("GET_REMOVE"==n)return[i+".pop()",t.JavaScript.ORDER_MEMBER];if("REMOVE"==n)return i+".pop();\n";break;case"FROM_START":if(e=t.JavaScript.getAdjusted(e,"AT"),"GET"==n)return[i+"["+e+"]",t.JavaScript.ORDER_MEMBER];if("GET_REMOVE"==n)return[i+".splice("+e+", 1)[0]",t.JavaScript.ORDER_FUNCTION_CALL];if("REMOVE"==n)return i+".splice("+e+", 1);\n";break;case"FROM_END":if(e=t.JavaScript.getAdjusted(e,"AT",1,!0),"GET"==n)return[i+".slice("+e+")[0]",t.JavaScript.ORDER_FUNCTION_CALL];if("GET_REMOVE"==n)return[i+".splice("+e+", 1)[0]",t.JavaScript.ORDER_FUNCTION_CALL];if("REMOVE"==n)return i+".splice("+e+", 1);";break;case"RANDOM":if(i=t.JavaScript.provideFunction_("listsGetRandomItem",["function "+t.JavaScript.FUNCTION_NAME_PLACEHOLDER_+"(list, remove) {"," var x = Math.floor(Math.random() * list.length);"," if (remove) {"," return list.splice(x, 1)[0];"," } else {"," return list[x];"," }","}"])+"("+i+", "+("GET"!=n)+")","GET"==n||"GET_REMOVE"==n)return[i,t.JavaScript.ORDER_FUNCTION_CALL];if("REMOVE"==n)return i+";\n"}throw Error("Unhandled combination (lists_getIndex).")},t.JavaScript.lists_setIndex=function(e){function n(){if(r.match(/^\w+$/))return"";var e=t.JavaScript.nameDB_.getDistinctName("tmpList",t.VARIABLE_CATEGORY_NAME),n="var "+e+" = "+r+";\n";return r=e,n}var r=t.JavaScript.valueToCode(e,"LIST",t.JavaScript.ORDER_MEMBER)||"[]",i=e.getFieldValue("MODE")||"GET",o=e.getFieldValue("WHERE")||"FROM_START",s=t.JavaScript.valueToCode(e,"TO",t.JavaScript.ORDER_ASSIGNMENT)||"null";switch(o){case"FIRST":if("SET"==i)return r+"[0] = "+s+";\n";if("INSERT"==i)return r+".unshift("+s+");\n";break;case"LAST":if("SET"==i)return(e=n())+(r+"[")+r+".length - 1] = "+s+";\n";if("INSERT"==i)return r+".push("+s+");\n";break;case"FROM_START":if(o=t.JavaScript.getAdjusted(e,"AT"),"SET"==i)return r+"["+o+"] = "+s+";\n";if("INSERT"==i)return r+".splice("+o+", 0, "+s+");\n";break;case"FROM_END":if(o=t.JavaScript.getAdjusted(e,"AT",1,!1,t.JavaScript.ORDER_SUBTRACTION),e=n(),"SET"==i)return e+(r+"[")+r+".length - "+o+"] = "+s+";\n";if("INSERT"==i)return e+(r+".splice(")+r+".length - "+o+", 0, "+s+");\n";break;case"RANDOM":if(e=n(),e+="var "+(o=t.JavaScript.nameDB_.getDistinctName("tmpX",t.VARIABLE_CATEGORY_NAME))+" = Math.floor(Math.random() * "+r+".length);\n","SET"==i)return e+(r+"[")+o+"] = "+s+";\n";if("INSERT"==i)return e+(r+".splice(")+o+", 0, "+s+");\n"}throw Error("Unhandled combination (lists_setIndex).")},t.JavaScript.lists.getIndex_=function(t,e,n){return"FIRST"==e?"0":"FROM_END"==e?t+".length - 1 - "+n:"LAST"==e?t+".length - 1":n},t.JavaScript.lists_getSublist=function(e){var n=t.JavaScript.valueToCode(e,"LIST",t.JavaScript.ORDER_MEMBER)||"[]",r=e.getFieldValue("WHERE1"),i=e.getFieldValue("WHERE2");if("FIRST"==r&&"LAST"==i)n+=".slice(0)";else if(n.match(/^\w+$/)||"FROM_END"!=r&&"FROM_START"==i){switch(r){case"FROM_START":var o=t.JavaScript.getAdjusted(e,"AT1");break;case"FROM_END":o=n+".length - "+(o=t.JavaScript.getAdjusted(e,"AT1",1,!1,t.JavaScript.ORDER_SUBTRACTION));break;case"FIRST":o="0";break;default:throw Error("Unhandled option (lists_getSublist).")}switch(i){case"FROM_START":e=t.JavaScript.getAdjusted(e,"AT2",1);break;case"FROM_END":e=n+".length - "+(e=t.JavaScript.getAdjusted(e,"AT2",0,!1,t.JavaScript.ORDER_SUBTRACTION));break;case"LAST":e=n+".length";break;default:throw Error("Unhandled option (lists_getSublist).")}n=n+".slice("+o+", "+e+")"}else{o=t.JavaScript.getAdjusted(e,"AT1"),e=t.JavaScript.getAdjusted(e,"AT2");var s=t.JavaScript.lists.getIndex_,a={FIRST:"First",LAST:"Last",FROM_START:"FromStart",FROM_END:"FromEnd"};n=t.JavaScript.provideFunction_("subsequence"+a[r]+a[i],["function "+t.JavaScript.FUNCTION_NAME_PLACEHOLDER_+"(sequence"+("FROM_END"==r||"FROM_START"==r?", at1":"")+("FROM_END"==i||"FROM_START"==i?", at2":"")+") {"," var start = "+s("sequence",r,"at1")+";"," var end = "+s("sequence",i,"at2")+" + 1;"," return sequence.slice(start, end);","}"])+"("+n+("FROM_END"==r||"FROM_START"==r?", "+o:"")+("FROM_END"==i||"FROM_START"==i?", "+e:"")+")"}return[n,t.JavaScript.ORDER_FUNCTION_CALL]},t.JavaScript.lists_sort=function(e){var n=t.JavaScript.valueToCode(e,"LIST",t.JavaScript.ORDER_FUNCTION_CALL)||"[]",r="1"===e.getFieldValue("DIRECTION")?1:-1;return e=e.getFieldValue("TYPE"),[n+".slice().sort("+t.JavaScript.provideFunction_("listsGetSortCompare",["function "+t.JavaScript.FUNCTION_NAME_PLACEHOLDER_+"(type, direction) {"," var compareFuncs = {",' "NUMERIC": function(a, b) {'," return Number(a) - Number(b); },",' "TEXT": function(a, b) {'," return a.toString() > b.toString() ? 1 : -1; },",' "IGNORE_CASE": function(a, b) {'," return a.toString().toLowerCase() > b.toString().toLowerCase() ? 1 : -1; },"," };"," var compare = compareFuncs[type];"," return function(a, b) { return compare(a, b) * direction; }","}"])+'("'+e+'", '+r+"))",t.JavaScript.ORDER_FUNCTION_CALL]},t.JavaScript.lists_split=function(e){var n=t.JavaScript.valueToCode(e,"INPUT",t.JavaScript.ORDER_MEMBER),r=t.JavaScript.valueToCode(e,"DELIM",t.JavaScript.ORDER_NONE)||"''";if("SPLIT"==(e=e.getFieldValue("MODE")))n||(n="''"),e="split";else{if("JOIN"!=e)throw Error("Unknown mode: "+e);n||(n="[]"),e="join"}return[n+"."+e+"("+r+")",t.JavaScript.ORDER_FUNCTION_CALL]},t.JavaScript.lists_reverse=function(e){return[(t.JavaScript.valueToCode(e,"LIST",t.JavaScript.ORDER_FUNCTION_CALL)||"[]")+".slice().reverse()",t.JavaScript.ORDER_FUNCTION_CALL]},t.JavaScript.logic={},t.JavaScript.controls_if=function(e){var n=0,r="";t.JavaScript.STATEMENT_PREFIX&&(r+=t.JavaScript.injectId(t.JavaScript.STATEMENT_PREFIX,e));do{var i=t.JavaScript.valueToCode(e,"IF"+n,t.JavaScript.ORDER_NONE)||"false",o=t.JavaScript.statementToCode(e,"DO"+n);t.JavaScript.STATEMENT_SUFFIX&&(o=t.JavaScript.prefixLines(t.JavaScript.injectId(t.JavaScript.STATEMENT_SUFFIX,e),t.JavaScript.INDENT)+o),r+=(0<n?" else ":"")+"if ("+i+") {\n"+o+"}",++n}while(e.getInput("IF"+n));return(e.getInput("ELSE")||t.JavaScript.STATEMENT_SUFFIX)&&(o=t.JavaScript.statementToCode(e,"ELSE"),t.JavaScript.STATEMENT_SUFFIX&&(o=t.JavaScript.prefixLines(t.JavaScript.injectId(t.JavaScript.STATEMENT_SUFFIX,e),t.JavaScript.INDENT)+o),r+=" else {\n"+o+"}"),r+"\n"},t.JavaScript.controls_ifelse=t.JavaScript.controls_if,t.JavaScript.logic_compare=function(e){var n={EQ:"==",NEQ:"!=",LT:"<",LTE:"<=",GT:">",GTE:">="}[e.getFieldValue("OP")],r="=="==n||"!="==n?t.JavaScript.ORDER_EQUALITY:t.JavaScript.ORDER_RELATIONAL;return[(t.JavaScript.valueToCode(e,"A",r)||"0")+" "+n+" "+(e=t.JavaScript.valueToCode(e,"B",r)||"0"),r]},t.JavaScript.logic_operation=function(e){var n="AND"==e.getFieldValue("OP")?"&&":"||",r="&&"==n?t.JavaScript.ORDER_LOGICAL_AND:t.JavaScript.ORDER_LOGICAL_OR,i=t.JavaScript.valueToCode(e,"A",r);if(e=t.JavaScript.valueToCode(e,"B",r),i||e){var o="&&"==n?"true":"false";i||(i=o),e||(e=o)}else e=i="false";return[i+" "+n+" "+e,r]},t.JavaScript.logic_negate=function(e){var n=t.JavaScript.ORDER_LOGICAL_NOT;return["!"+(t.JavaScript.valueToCode(e,"BOOL",n)||"true"),n]},t.JavaScript.logic_boolean=function(e){return["TRUE"==e.getFieldValue("BOOL")?"true":"false",t.JavaScript.ORDER_ATOMIC]},t.JavaScript.logic_null=function(e){return["null",t.JavaScript.ORDER_ATOMIC]},t.JavaScript.logic_ternary=function(e){return[(t.JavaScript.valueToCode(e,"IF",t.JavaScript.ORDER_CONDITIONAL)||"false")+" ? "+(t.JavaScript.valueToCode(e,"THEN",t.JavaScript.ORDER_CONDITIONAL)||"null")+" : "+(e=t.JavaScript.valueToCode(e,"ELSE",t.JavaScript.ORDER_CONDITIONAL)||"null"),t.JavaScript.ORDER_CONDITIONAL]},t.JavaScript.loops={},t.JavaScript.controls_repeat_ext=function(e){var n=e.getField("TIMES")?String(Number(e.getFieldValue("TIMES"))):t.JavaScript.valueToCode(e,"TIMES",t.JavaScript.ORDER_ASSIGNMENT)||"0",r=t.JavaScript.statementToCode(e,"DO");r=t.JavaScript.addLoopTrap(r,e),e="";var i=t.JavaScript.nameDB_.getDistinctName("count",t.VARIABLE_CATEGORY_NAME),o=n;return n.match(/^\w+$/)||t.isNumber(n)||(e+="var "+(o=t.JavaScript.nameDB_.getDistinctName("repeat_end",t.VARIABLE_CATEGORY_NAME))+" = "+n+";\n"),e+"for (var "+i+" = 0; "+i+" < "+o+"; "+i+"++) {\n"+r+"}\n"},t.JavaScript.controls_repeat=t.JavaScript.controls_repeat_ext,t.JavaScript.controls_whileUntil=function(e){var n="UNTIL"==e.getFieldValue("MODE"),r=t.JavaScript.valueToCode(e,"BOOL",n?t.JavaScript.ORDER_LOGICAL_NOT:t.JavaScript.ORDER_NONE)||"false",i=t.JavaScript.statementToCode(e,"DO");return i=t.JavaScript.addLoopTrap(i,e),n&&(r="!"+r),"while ("+r+") {\n"+i+"}\n"},t.JavaScript.controls_for=function(e){var n=t.JavaScript.nameDB_.getName(e.getFieldValue("VAR"),t.VARIABLE_CATEGORY_NAME),r=t.JavaScript.valueToCode(e,"FROM",t.JavaScript.ORDER_ASSIGNMENT)||"0",i=t.JavaScript.valueToCode(e,"TO",t.JavaScript.ORDER_ASSIGNMENT)||"0",o=t.JavaScript.valueToCode(e,"BY",t.JavaScript.ORDER_ASSIGNMENT)||"1",s=t.JavaScript.statementToCode(e,"DO");if(s=t.JavaScript.addLoopTrap(s,e),t.isNumber(r)&&t.isNumber(i)&&t.isNumber(o)){var a=Number(r)<=Number(i);e="for ("+n+" = "+r+"; "+n+(a?" <= ":" >= ")+i+"; "+n,e=(1==(n=Math.abs(Number(o)))?e+(a?"++":"--"):e+(a?" += ":" -= ")+n)+") {\n"+s+"}\n"}else e="",a=r,r.match(/^\w+$/)||t.isNumber(r)||(e+="var "+(a=t.JavaScript.nameDB_.getDistinctName(n+"_start",t.VARIABLE_CATEGORY_NAME))+" = "+r+";\n"),r=i,i.match(/^\w+$/)||t.isNumber(i)||(e+="var "+(r=t.JavaScript.nameDB_.getDistinctName(n+"_end",t.VARIABLE_CATEGORY_NAME))+" = "+i+";\n"),e+="var "+(i=t.JavaScript.nameDB_.getDistinctName(n+"_inc",t.VARIABLE_CATEGORY_NAME))+" = ",e=(e=t.isNumber(o)?e+(Math.abs(o)+";\n"):e+"Math.abs("+o+");\n")+"if ("+a+" > "+r+") {\n"+(t.JavaScript.INDENT+i)+" = -"+i+";\n",e+="}\n",e+="for ("+n+" = "+a+"; "+i+" >= 0 ? "+n+" <= "+r+" : "+n+" >= "+r+"; "+n+" += "+i+") {\n"+s+"}\n";return e},t.JavaScript.controls_forEach=function(e){var n=t.JavaScript.nameDB_.getName(e.getFieldValue("VAR"),t.VARIABLE_CATEGORY_NAME),r=t.JavaScript.valueToCode(e,"LIST",t.JavaScript.ORDER_ASSIGNMENT)||"[]",i=t.JavaScript.statementToCode(e,"DO");i=t.JavaScript.addLoopTrap(i,e),e="";var o=r;return r.match(/^\w+$/)||(e+="var "+(o=t.JavaScript.nameDB_.getDistinctName(n+"_list",t.VARIABLE_CATEGORY_NAME))+" = "+r+";\n"),e+"for (var "+(r=t.JavaScript.nameDB_.getDistinctName(n+"_index",t.VARIABLE_CATEGORY_NAME))+" in "+o+") {\n"+(i=t.JavaScript.INDENT+n+" = "+o+"["+r+"];\n"+i)+"}\n"},t.JavaScript.controls_flow_statements=function(e){var n="";if(t.JavaScript.STATEMENT_PREFIX&&(n+=t.JavaScript.injectId(t.JavaScript.STATEMENT_PREFIX,e)),t.JavaScript.STATEMENT_SUFFIX&&(n+=t.JavaScript.injectId(t.JavaScript.STATEMENT_SUFFIX,e)),t.JavaScript.STATEMENT_PREFIX){var r=t.Constants.Loops.CONTROL_FLOW_IN_LOOP_CHECK_MIXIN.getSurroundLoop(e);r&&!r.suppressPrefixSuffix&&(n+=t.JavaScript.injectId(t.JavaScript.STATEMENT_PREFIX,r))}switch(e.getFieldValue("FLOW")){case"BREAK":return n+"break;\n";case"CONTINUE":return n+"continue;\n"}throw Error("Unknown flow statement.")},t.JavaScript.math={},t.JavaScript.math_number=function(e){return[e=Number(e.getFieldValue("NUM")),0<=e?t.JavaScript.ORDER_ATOMIC:t.JavaScript.ORDER_UNARY_NEGATION]},t.JavaScript.math_arithmetic=function(e){var n={ADD:[" + ",t.JavaScript.ORDER_ADDITION],MINUS:[" - ",t.JavaScript.ORDER_SUBTRACTION],MULTIPLY:[" * ",t.JavaScript.ORDER_MULTIPLICATION],DIVIDE:[" / ",t.JavaScript.ORDER_DIVISION],POWER:[null,t.JavaScript.ORDER_NONE]}[e.getFieldValue("OP")],r=n[0];n=n[1];var i=t.JavaScript.valueToCode(e,"A",n)||"0";return e=t.JavaScript.valueToCode(e,"B",n)||"0",r?[i+r+e,n]:["Math.pow("+i+", "+e+")",t.JavaScript.ORDER_FUNCTION_CALL]},t.JavaScript.math_single=function(e){var n=e.getFieldValue("OP");if("NEG"==n)return"-"==(e=t.JavaScript.valueToCode(e,"NUM",t.JavaScript.ORDER_UNARY_NEGATION)||"0")[0]&&(e=" "+e),["-"+e,t.JavaScript.ORDER_UNARY_NEGATION];switch(e="SIN"==n||"COS"==n||"TAN"==n?t.JavaScript.valueToCode(e,"NUM",t.JavaScript.ORDER_DIVISION)||"0":t.JavaScript.valueToCode(e,"NUM",t.JavaScript.ORDER_NONE)||"0",n){case"ABS":var r="Math.abs("+e+")";break;case"ROOT":r="Math.sqrt("+e+")";break;case"LN":r="Math.log("+e+")";break;case"EXP":r="Math.exp("+e+")";break;case"POW10":r="Math.pow(10,"+e+")";break;case"ROUND":r="Math.round("+e+")";break;case"ROUNDUP":r="Math.ceil("+e+")";break;case"ROUNDDOWN":r="Math.floor("+e+")";break;case"SIN":r="Math.sin("+e+" / 180 * Math.PI)";break;case"COS":r="Math.cos("+e+" / 180 * Math.PI)";break;case"TAN":r="Math.tan("+e+" / 180 * Math.PI)"}if(r)return[r,t.JavaScript.ORDER_FUNCTION_CALL];switch(n){case"LOG10":r="Math.log("+e+") / Math.log(10)";break;case"ASIN":r="Math.asin("+e+") / Math.PI * 180";break;case"ACOS":r="Math.acos("+e+") / Math.PI * 180";break;case"ATAN":r="Math.atan("+e+") / Math.PI * 180";break;default:throw Error("Unknown math operator: "+n)}return[r,t.JavaScript.ORDER_DIVISION]},t.JavaScript.math_constant=function(e){return{PI:["Math.PI",t.JavaScript.ORDER_MEMBER],E:["Math.E",t.JavaScript.ORDER_MEMBER],GOLDEN_RATIO:["(1 + Math.sqrt(5)) / 2",t.JavaScript.ORDER_DIVISION],SQRT2:["Math.SQRT2",t.JavaScript.ORDER_MEMBER],SQRT1_2:["Math.SQRT1_2",t.JavaScript.ORDER_MEMBER],INFINITY:["Infinity",t.JavaScript.ORDER_ATOMIC]}[e.getFieldValue("CONSTANT")]},t.JavaScript.math_number_property=function(e){var n=t.JavaScript.valueToCode(e,"NUMBER_TO_CHECK",t.JavaScript.ORDER_MODULUS)||"0",r=e.getFieldValue("PROPERTY");if("PRIME"==r)return[t.JavaScript.provideFunction_("mathIsPrime",["function "+t.JavaScript.FUNCTION_NAME_PLACEHOLDER_+"(n) {"," // https://en.wikipedia.org/wiki/Primality_test#Naive_methods"," if (n == 2 || n == 3) {"," return true;"," }"," // False if n is NaN, negative, is 1, or not whole."," // And false if n is divisible by 2 or 3."," if (isNaN(n) || n <= 1 || n % 1 != 0 || n % 2 == 0 || n % 3 == 0) {"," return false;"," }"," // Check all the numbers of form 6k +/- 1, up to sqrt(n)."," for (var x = 6; x <= Math.sqrt(n) + 1; x += 6) {"," if (n % (x - 1) == 0 || n % (x + 1) == 0) {"," return false;"," }"," }"," return true;","}"])+"("+n+")",t.JavaScript.ORDER_FUNCTION_CALL];switch(r){case"EVEN":var i=n+" % 2 == 0";break;case"ODD":i=n+" % 2 == 1";break;case"WHOLE":i=n+" % 1 == 0";break;case"POSITIVE":i=n+" > 0";break;case"NEGATIVE":i=n+" < 0";break;case"DIVISIBLE_BY":i=n+" % "+(e=t.JavaScript.valueToCode(e,"DIVISOR",t.JavaScript.ORDER_MODULUS)||"0")+" == 0"}return[i,t.JavaScript.ORDER_EQUALITY]},t.JavaScript.math_change=function(e){var n=t.JavaScript.valueToCode(e,"DELTA",t.JavaScript.ORDER_ADDITION)||"0";return(e=t.JavaScript.nameDB_.getName(e.getFieldValue("VAR"),t.VARIABLE_CATEGORY_NAME))+" = (typeof "+e+" == 'number' ? "+e+" : 0) + "+n+";\n"},t.JavaScript.math_round=t.JavaScript.math_single,t.JavaScript.math_trig=t.JavaScript.math_single,t.JavaScript.math_on_list=function(e){var n=e.getFieldValue("OP");switch(n){case"SUM":e=t.JavaScript.valueToCode(e,"LIST",t.JavaScript.ORDER_MEMBER)||"[]",e+=".reduce(function(x, y) {return x + y;})";break;case"MIN":e="Math.min.apply(null, "+(e=t.JavaScript.valueToCode(e,"LIST",t.JavaScript.ORDER_NONE)||"[]")+")";break;case"MAX":e="Math.max.apply(null, "+(e=t.JavaScript.valueToCode(e,"LIST",t.JavaScript.ORDER_NONE)||"[]")+")";break;case"AVERAGE":e=(n=t.JavaScript.provideFunction_("mathMean",["function "+t.JavaScript.FUNCTION_NAME_PLACEHOLDER_+"(myList) {"," return myList.reduce(function(x, y) {return x + y;}) / myList.length;","}"]))+"("+(e=t.JavaScript.valueToCode(e,"LIST",t.JavaScript.ORDER_NONE)||"[]")+")";break;case"MEDIAN":e=(n=t.JavaScript.provideFunction_("mathMedian",["function "+t.JavaScript.FUNCTION_NAME_PLACEHOLDER_+"(myList) {"," var localList = myList.filter(function (x) {return typeof x == 'number';});"," if (!localList.length) return null;"," localList.sort(function(a, b) {return b - a;});"," if (localList.length % 2 == 0) {"," return (localList[localList.length / 2 - 1] + localList[localList.length / 2]) / 2;"," } else {"," return localList[(localList.length - 1) / 2];"," }","}"]))+"("+(e=t.JavaScript.valueToCode(e,"LIST",t.JavaScript.ORDER_NONE)||"[]")+")";break;case"MODE":e=(n=t.JavaScript.provideFunction_("mathModes",["function "+t.JavaScript.FUNCTION_NAME_PLACEHOLDER_+"(values) {"," var modes = [];"," var counts = [];"," var maxCount = 0;"," for (var i = 0; i < values.length; i++) {"," var value = values[i];"," var found = false;"," var thisCount;"," for (var j = 0; j < counts.length; j++) {"," if (counts[j][0] === value) {"," thisCount = ++counts[j][1];"," found = true;"," break;"," }"," }"," if (!found) {"," counts.push([value, 1]);"," thisCount = 1;"," }"," maxCount = Math.max(thisCount, maxCount);"," }"," for (var j = 0; j < counts.length; j++) {"," if (counts[j][1] == maxCount) {"," modes.push(counts[j][0]);"," }"," }"," return modes;","}"]))+"("+(e=t.JavaScript.valueToCode(e,"LIST",t.JavaScript.ORDER_NONE)||"[]")+")";break;case"STD_DEV":e=(n=t.JavaScript.provideFunction_("mathStandardDeviation",["function "+t.JavaScript.FUNCTION_NAME_PLACEHOLDER_+"(numbers) {"," var n = numbers.length;"," if (!n) return null;"," var mean = numbers.reduce(function(x, y) {return x + y;}) / n;"," var variance = 0;"," for (var j = 0; j < n; j++) {"," variance += Math.pow(numbers[j] - mean, 2);"," }"," variance = variance / n;"," return Math.sqrt(variance);","}"]))+"("+(e=t.JavaScript.valueToCode(e,"LIST",t.JavaScript.ORDER_NONE)||"[]")+")";break;case"RANDOM":e=(n=t.JavaScript.provideFunction_("mathRandomList",["function "+t.JavaScript.FUNCTION_NAME_PLACEHOLDER_+"(list) {"," var x = Math.floor(Math.random() * list.length);"," return list[x];","}"]))+"("+(e=t.JavaScript.valueToCode(e,"LIST",t.JavaScript.ORDER_NONE)||"[]")+")";break;default:throw Error("Unknown operator: "+n)}return[e,t.JavaScript.ORDER_FUNCTION_CALL]},t.JavaScript.math_modulo=function(e){return[(t.JavaScript.valueToCode(e,"DIVIDEND",t.JavaScript.ORDER_MODULUS)||"0")+" % "+(e=t.JavaScript.valueToCode(e,"DIVISOR",t.JavaScript.ORDER_MODULUS)||"0"),t.JavaScript.ORDER_MODULUS]},t.JavaScript.math_constrain=function(e){return["Math.min(Math.max("+(t.JavaScript.valueToCode(e,"VALUE",t.JavaScript.ORDER_NONE)||"0")+", "+(t.JavaScript.valueToCode(e,"LOW",t.JavaScript.ORDER_NONE)||"0")+"), "+(e=t.JavaScript.valueToCode(e,"HIGH",t.JavaScript.ORDER_NONE)||"Infinity")+")",t.JavaScript.ORDER_FUNCTION_CALL]},t.JavaScript.math_random_int=function(e){var n=t.JavaScript.valueToCode(e,"FROM",t.JavaScript.ORDER_NONE)||"0";return e=t.JavaScript.valueToCode(e,"TO",t.JavaScript.ORDER_NONE)||"0",[t.JavaScript.provideFunction_("mathRandomInt",["function "+t.JavaScript.FUNCTION_NAME_PLACEHOLDER_+"(a, b) {"," if (a > b) {"," // Swap a and b to ensure a is smaller."," var c = a;"," a = b;"," b = c;"," }"," return Math.floor(Math.random() * (b - a + 1) + a);","}"])+"("+n+", "+e+")",t.JavaScript.ORDER_FUNCTION_CALL]},t.JavaScript.math_random_float=function(e){return["Math.random()",t.JavaScript.ORDER_FUNCTION_CALL]},t.JavaScript.math_atan2=function(e){var n=t.JavaScript.valueToCode(e,"X",t.JavaScript.ORDER_NONE)||"0";return["Math.atan2("+(t.JavaScript.valueToCode(e,"Y",t.JavaScript.ORDER_NONE)||"0")+", "+n+") / Math.PI * 180",t.JavaScript.ORDER_DIVISION]},t.JavaScript.procedures={},t.JavaScript.procedures_defreturn=function(e){var n=t.JavaScript.nameDB_.getName(e.getFieldValue("NAME"),t.PROCEDURE_CATEGORY_NAME),r="";t.JavaScript.STATEMENT_PREFIX&&(r+=t.JavaScript.injectId(t.JavaScript.STATEMENT_PREFIX,e)),t.JavaScript.STATEMENT_SUFFIX&&(r+=t.JavaScript.injectId(t.JavaScript.STATEMENT_SUFFIX,e)),r&&(r=t.JavaScript.prefixLines(r,t.JavaScript.INDENT));var i="";t.JavaScript.INFINITE_LOOP_TRAP&&(i=t.JavaScript.prefixLines(t.JavaScript.injectId(t.JavaScript.INFINITE_LOOP_TRAP,e),t.JavaScript.INDENT));var o=t.JavaScript.statementToCode(e,"STACK"),s=t.JavaScript.valueToCode(e,"RETURN",t.JavaScript.ORDER_NONE)||"",a="";o&&s&&(a=r),s&&(s=t.JavaScript.INDENT+"return "+s+";\n");for(var l=[],u=e.getVars(),c=0;c<u.length;c++)l[c]=t.JavaScript.nameDB_.getName(u[c],t.VARIABLE_CATEGORY_NAME);return r="function "+n+"("+l.join(", ")+") {\n"+r+i+o+a+s+"}",r=t.JavaScript.scrub_(e,r),t.JavaScript.definitions_["%"+n]=r,null},t.JavaScript.procedures_defnoreturn=t.JavaScript.procedures_defreturn,t.JavaScript.procedures_callreturn=function(e){for(var n=t.JavaScript.nameDB_.getName(e.getFieldValue("NAME"),t.PROCEDURE_CATEGORY_NAME),r=[],i=e.getVars(),o=0;o<i.length;o++)r[o]=t.JavaScript.valueToCode(e,"ARG"+o,t.JavaScript.ORDER_NONE)||"null";return[n+"("+r.join(", ")+")",t.JavaScript.ORDER_FUNCTION_CALL]},t.JavaScript.procedures_callnoreturn=function(e){return t.JavaScript.procedures_callreturn(e)[0]+";\n"},t.JavaScript.procedures_ifreturn=function(e){var n="if ("+(t.JavaScript.valueToCode(e,"CONDITION",t.JavaScript.ORDER_NONE)||"false")+") {\n";return t.JavaScript.STATEMENT_SUFFIX&&(n+=t.JavaScript.prefixLines(t.JavaScript.injectId(t.JavaScript.STATEMENT_SUFFIX,e),t.JavaScript.INDENT)),e.hasReturnValue_?(e=t.JavaScript.valueToCode(e,"VALUE",t.JavaScript.ORDER_NONE)||"null",n+=t.JavaScript.INDENT+"return "+e+";\n"):n+=t.JavaScript.INDENT+"return;\n",n+"}\n"},t.JavaScript.texts={},t.JavaScript.text=function(e){return[t.JavaScript.quote_(e.getFieldValue("TEXT")),t.JavaScript.ORDER_ATOMIC]},t.JavaScript.text_multiline=function(e){return[e=t.JavaScript.multiline_quote_(e.getFieldValue("TEXT")),-1!=e.indexOf("+")?t.JavaScript.ORDER_ADDITION:t.JavaScript.ORDER_ATOMIC]},t.JavaScript.text.forceString_=function(e){return t.JavaScript.text.forceString_.strRegExp.test(e)?[e,t.JavaScript.ORDER_ATOMIC]:["String("+e+")",t.JavaScript.ORDER_FUNCTION_CALL]},t.JavaScript.text.forceString_.strRegExp=/^\s*'([^']|\\')*'\s*$/,t.JavaScript.text_join=function(e){switch(e.itemCount_){case 0:return["''",t.JavaScript.ORDER_ATOMIC];case 1:return e=t.JavaScript.valueToCode(e,"ADD0",t.JavaScript.ORDER_NONE)||"''",t.JavaScript.text.forceString_(e);case 2:var n=t.JavaScript.valueToCode(e,"ADD0",t.JavaScript.ORDER_NONE)||"''";return e=t.JavaScript.valueToCode(e,"ADD1",t.JavaScript.ORDER_NONE)||"''",[e=t.JavaScript.text.forceString_(n)[0]+" + "+t.JavaScript.text.forceString_(e)[0],t.JavaScript.ORDER_ADDITION];default:n=Array(e.itemCount_);for(var r=0;r<e.itemCount_;r++)n[r]=t.JavaScript.valueToCode(e,"ADD"+r,t.JavaScript.ORDER_NONE)||"''";return[e="["+n.join(",")+"].join('')",t.JavaScript.ORDER_FUNCTION_CALL]}},t.JavaScript.text_append=function(e){var n=t.JavaScript.nameDB_.getName(e.getFieldValue("VAR"),t.VARIABLE_CATEGORY_NAME);return e=t.JavaScript.valueToCode(e,"TEXT",t.JavaScript.ORDER_NONE)||"''",n+" += "+t.JavaScript.text.forceString_(e)[0]+";\n"},t.JavaScript.text_length=function(e){return[(t.JavaScript.valueToCode(e,"VALUE",t.JavaScript.ORDER_MEMBER)||"''")+".length",t.JavaScript.ORDER_MEMBER]},t.JavaScript.text_isEmpty=function(e){return["!"+(t.JavaScript.valueToCode(e,"VALUE",t.JavaScript.ORDER_MEMBER)||"''")+".length",t.JavaScript.ORDER_LOGICAL_NOT]},t.JavaScript.text_indexOf=function(e){var n="FIRST"==e.getFieldValue("END")?"indexOf":"lastIndexOf",r=t.JavaScript.valueToCode(e,"FIND",t.JavaScript.ORDER_NONE)||"''";return n=(t.JavaScript.valueToCode(e,"VALUE",t.JavaScript.ORDER_MEMBER)||"''")+"."+n+"("+r+")",e.workspace.options.oneBasedIndex?[n+" + 1",t.JavaScript.ORDER_ADDITION]:[n,t.JavaScript.ORDER_FUNCTION_CALL]},t.JavaScript.text_charAt=function(e){var n=e.getFieldValue("WHERE")||"FROM_START",r=t.JavaScript.valueToCode(e,"VALUE","RANDOM"==n?t.JavaScript.ORDER_NONE:t.JavaScript.ORDER_MEMBER)||"''";switch(n){case"FIRST":return[r+".charAt(0)",t.JavaScript.ORDER_FUNCTION_CALL];case"LAST":return[r+".slice(-1)",t.JavaScript.ORDER_FUNCTION_CALL];case"FROM_START":return[r+".charAt("+(e=t.JavaScript.getAdjusted(e,"AT"))+")",t.JavaScript.ORDER_FUNCTION_CALL];case"FROM_END":return[r+".slice("+(e=t.JavaScript.getAdjusted(e,"AT",1,!0))+").charAt(0)",t.JavaScript.ORDER_FUNCTION_CALL];case"RANDOM":return[t.JavaScript.provideFunction_("textRandomLetter",["function "+t.JavaScript.FUNCTION_NAME_PLACEHOLDER_+"(text) {"," var x = Math.floor(Math.random() * text.length);"," return text[x];","}"])+"("+r+")",t.JavaScript.ORDER_FUNCTION_CALL]}throw Error("Unhandled option (text_charAt).")},t.JavaScript.text.getIndex_=function(t,e,n){return"FIRST"==e?"0":"FROM_END"==e?t+".length - 1 - "+n:"LAST"==e?t+".length - 1":n},t.JavaScript.text_getSubstring=function(e){var n=e.getFieldValue("WHERE1"),r=e.getFieldValue("WHERE2"),i="FROM_END"!=n&&"LAST"!=n&&"FROM_END"!=r&&"LAST"!=r,o=t.JavaScript.valueToCode(e,"STRING",i?t.JavaScript.ORDER_MEMBER:t.JavaScript.ORDER_NONE)||"''";if("FIRST"==n&&"LAST"==r)return[o,t.JavaScript.ORDER_NONE];if(o.match(/^'?\w+'?$/)||i){switch(n){case"FROM_START":i=t.JavaScript.getAdjusted(e,"AT1");break;case"FROM_END":i=o+".length - "+(i=t.JavaScript.getAdjusted(e,"AT1",1,!1,t.JavaScript.ORDER_SUBTRACTION));break;case"FIRST":i="0";break;default:throw Error("Unhandled option (text_getSubstring).")}switch(r){case"FROM_START":e=t.JavaScript.getAdjusted(e,"AT2",1);break;case"FROM_END":e=o+".length - "+(e=t.JavaScript.getAdjusted(e,"AT2",0,!1,t.JavaScript.ORDER_SUBTRACTION));break;case"LAST":e=o+".length";break;default:throw Error("Unhandled option (text_getSubstring).")}n=o+".slice("+i+", "+e+")"}else{i=t.JavaScript.getAdjusted(e,"AT1"),e=t.JavaScript.getAdjusted(e,"AT2");var s=t.JavaScript.text.getIndex_,a={FIRST:"First",LAST:"Last",FROM_START:"FromStart",FROM_END:"FromEnd"};n=t.JavaScript.provideFunction_("subsequence"+a[n]+a[r],["function "+t.JavaScript.FUNCTION_NAME_PLACEHOLDER_+"(sequence"+("FROM_END"==n||"FROM_START"==n?", at1":"")+("FROM_END"==r||"FROM_START"==r?", at2":"")+") {"," var start = "+s("sequence",n,"at1")+";"," var end = "+s("sequence",r,"at2")+" + 1;"," return sequence.slice(start, end);","}"])+"("+o+("FROM_END"==n||"FROM_START"==n?", "+i:"")+("FROM_END"==r||"FROM_START"==r?", "+e:"")+")"}return[n,t.JavaScript.ORDER_FUNCTION_CALL]},t.JavaScript.text_changeCase=function(e){var n={UPPERCASE:".toUpperCase()",LOWERCASE:".toLowerCase()",TITLECASE:null}[e.getFieldValue("CASE")];return e=t.JavaScript.valueToCode(e,"TEXT",n?t.JavaScript.ORDER_MEMBER:t.JavaScript.ORDER_NONE)||"''",[n?e+n:t.JavaScript.provideFunction_("textToTitleCase",["function "+t.JavaScript.FUNCTION_NAME_PLACEHOLDER_+"(str) {"," return str.replace(/\\S+/g,"," function(txt) {return txt[0].toUpperCase() + txt.substring(1).toLowerCase();});","}"])+"("+e+")",t.JavaScript.ORDER_FUNCTION_CALL]},t.JavaScript.text_trim=function(e){var n={LEFT:".replace(/^[\\s\\xa0]+/, '')",RIGHT:".replace(/[\\s\\xa0]+$/, '')",BOTH:".trim()"}[e.getFieldValue("MODE")];return[(t.JavaScript.valueToCode(e,"TEXT",t.JavaScript.ORDER_MEMBER)||"''")+n,t.JavaScript.ORDER_FUNCTION_CALL]},t.JavaScript.text_print=function(e){return"window.alert("+(t.JavaScript.valueToCode(e,"TEXT",t.JavaScript.ORDER_NONE)||"''")+");\n"},t.JavaScript.text_prompt_ext=function(e){var n="window.prompt("+(e.getField("TEXT")?t.JavaScript.quote_(e.getFieldValue("TEXT")):t.JavaScript.valueToCode(e,"TEXT",t.JavaScript.ORDER_NONE)||"''")+")";return"NUMBER"==e.getFieldValue("TYPE")&&(n="Number("+n+")"),[n,t.JavaScript.ORDER_FUNCTION_CALL]},t.JavaScript.text_prompt=t.JavaScript.text_prompt_ext,t.JavaScript.text_count=function(e){var n=t.JavaScript.valueToCode(e,"TEXT",t.JavaScript.ORDER_NONE)||"''";return e=t.JavaScript.valueToCode(e,"SUB",t.JavaScript.ORDER_NONE)||"''",[t.JavaScript.provideFunction_("textCount",["function "+t.JavaScript.FUNCTION_NAME_PLACEHOLDER_+"(haystack, needle) {"," if (needle.length === 0) {"," return haystack.length + 1;"," } else {"," return haystack.split(needle).length - 1;"," }","}"])+"("+n+", "+e+")",t.JavaScript.ORDER_FUNCTION_CALL]},t.JavaScript.text_replace=function(e){var n=t.JavaScript.valueToCode(e,"TEXT",t.JavaScript.ORDER_NONE)||"''",r=t.JavaScript.valueToCode(e,"FROM",t.JavaScript.ORDER_NONE)||"''";return e=t.JavaScript.valueToCode(e,"TO",t.JavaScript.ORDER_NONE)||"''",[t.JavaScript.provideFunction_("textReplace",["function "+t.JavaScript.FUNCTION_NAME_PLACEHOLDER_+"(haystack, needle, replacement) {",' needle = needle.replace(/([-()\\[\\]{}+?*.$\\^|,:#<!\\\\])/g,"\\\\$1")',' .replace(/\\x08/g,"\\\\x08");'," return haystack.replace(new RegExp(needle, 'g'), replacement);","}"])+"("+n+", "+r+", "+e+")",t.JavaScript.ORDER_FUNCTION_CALL]},t.JavaScript.text_reverse=function(e){return[(t.JavaScript.valueToCode(e,"TEXT",t.JavaScript.ORDER_MEMBER)||"''")+".split('').reverse().join('')",t.JavaScript.ORDER_FUNCTION_CALL]},t.JavaScript.variables={},t.JavaScript.variables_get=function(e){return[t.JavaScript.nameDB_.getName(e.getFieldValue("VAR"),t.VARIABLE_CATEGORY_NAME),t.JavaScript.ORDER_ATOMIC]},t.JavaScript.variables_set=function(e){var n=t.JavaScript.valueToCode(e,"VALUE",t.JavaScript.ORDER_ASSIGNMENT)||"0";return t.JavaScript.nameDB_.getName(e.getFieldValue("VAR"),t.VARIABLE_CATEGORY_NAME)+" = "+n+";\n"},t.JavaScript.variablesDynamic={},t.JavaScript.variables_get_dynamic=t.JavaScript.variables_get,t.JavaScript.variables_set_dynamic=t.JavaScript.variables_set,t.JavaScript},i=[n("GEkh")],void 0===(o="function"==typeof(r=s)?r.apply(e,i):r)||(t.exports=o)},"JP+z":function(t,e,n){"use strict";t.exports=function(t,e){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return t.apply(e,n)}}},JV7f:function(t,e,n){"use strict";var r={};n.d(r,"copyModel",function(){return K}),n.d(r,"listModels",function(){return z}),n.d(r,"moveModel",function(){return Y}),n.d(r,"removeModel",function(){return X}),n.d(r,"browserFiles",function(){return lt}),n.d(r,"browserHTTPRequest",function(){return yt}),n.d(r,"concatenateArrayBuffers",function(){return f.d}),n.d(r,"decodeWeights",function(){return f.e}),n.d(r,"encodeWeights",function(){return f.f}),n.d(r,"fromMemory",function(){return Et}),n.d(r,"getLoadHandlers",function(){return _}),n.d(r,"getModelArtifactsForJSON",function(){return f.g}),n.d(r,"getModelArtifactsInfoForJSON",function(){return f.h}),n.d(r,"getSaveHandlers",function(){return b}),n.d(r,"http",function(){return _t}),n.d(r,"isHTTPScheme",function(){return vt}),n.d(r,"loadWeights",function(){return dt}),n.d(r,"registerLoadRouter",function(){return v}),n.d(r,"registerSaveRouter",function(){return m}),n.d(r,"weightsLoaderFactory",function(){return pt}),n.d(r,"withSaveHandler",function(){return wt});var i={};n.d(i,"confusionMatrix",function(){return Rt});var o={};n.d(o,"fromPixelsAsync",function(){return Bt}),n.d(o,"toPixels",function(){return jt}),n.d(o,"fromPixels",function(){return $t});var s={};n.d(s,"prepareAndValidate",function(){return Ut});var a={};n.d(a,"assertParamsValid",function(){return Gt}),n.d(a,"maskToAxes",function(){return zt}),n.d(a,"computeOutShape",function(){return Xt}),n.d(a,"stridesWithElidedDims",function(){return Kt}),n.d(a,"getNormalizedAxes",function(){return Jt}),n.d(a,"startIndicesWithElidedDims",function(){return Zt}),n.d(a,"stopIndicesWithElidedDims",function(){return Qt}),n.d(a,"stridesForAxis",function(){return te}),n.d(a,"startForAxis",function(){return ee}),n.d(a,"stopForAxis",function(){return ne}),n.d(a,"isSliceContinous",function(){return re}),n.d(a,"computeFlatOffset",function(){return ie}),n.d(a,"parseSliceParams",function(){return oe}),n.d(a,"sliceInfo",function(){return se});var l={};n.d(l,"Serializable",function(){return le}),n.d(l,"SerializationMap",function(){return ue}),n.d(l,"registerClass",function(){return ce});var u={};n.d(u,"segOpComputeOptimalWindowSize",function(){return Hn}),n.d(u,"computeOutShape",function(){return Wn}),n.d(u,"collectGatherOpShapeInfo",function(){return Gn});var c={};n.d(c,"slice_util",function(){return a}),n.d(c,"upcastType",function(){return Fe.b}),n.d(c,"segment_util",function(){return u}),n.d(c,"fromUint8ToStringArray",function(){return zn}),n.d(c,"fromStringArrayToUint8",function(){return Xn}),n.d(c,"axesAreInnerMostDims",function(){return Ve.b}),n.d(c,"combineLocations",function(){return Ve.c}),n.d(c,"computeOutAndReduceShapes",function(){return Ve.d}),n.d(c,"expandShapeToKeepDim",function(){return Ve.e}),n.d(c,"assertAxesAreInnerMostDims",function(){return Ve.a}),n.d(c,"getAxesPermutation",function(){return Ve.f}),n.d(c,"getUndoAxesPermutation",function(){return Ve.h}),n.d(c,"getInnerMostAxes",function(){return Ve.g}),n.d(c,"getBroadcastDims",function(){return At.getBroadcastDims}),n.d(c,"getReductionAxes",function(){return At.getReductionAxes}),n.d(c,"assertAndGetBroadcastShape",function(){return At.assertAndGetBroadcastShape}),n.d(c,"assertParamsConsistent",function(){return He}),n.d(c,"computeOutShape",function(){return We}),n.d(c,"computeDilation2DInfo",function(){return Ge.e}),n.d(c,"computePool2DInfo",function(){return Ge.f}),n.d(c,"computePool3DInfo",function(){return Ge.g}),n.d(c,"computeConv2DInfo",function(){return Ge.b}),n.d(c,"computeConv3DInfo",function(){return Ge.c}),n.d(c,"computeDefaultPad",function(){return Ge.d}),n.d(c,"tupleValuesAreOne",function(){return Ge.j}),n.d(c,"eitherStridesOrDilationsAreOne",function(){return Ge.i}),n.d(c,"convertConv2DDataFormat",function(){return Ge.h}),n.d(c,"checkPadOnDimRoundingMode",function(){return Ge.a}),n.d(c,"getFusedDyActivation",function(){return ze.c}),n.d(c,"getFusedBiasGradient",function(){return ze.b}),n.d(c,"applyActivation",function(){return ze.a}),n.d(c,"shouldFuse",function(){return ze.d}),n.d(c,"PARALLELIZE_THRESHOLD",function(){return Xe}),n.d(c,"computeOptimalWindowSize",function(){return Ke}),n.d(c,"getImageCenter",function(){return Ye}),n.d(c,"getReshaped",function(){return qe}),n.d(c,"getPermuted",function(){return Je}),n.d(c,"getReshapedPermuted",function(){return Ze}),n.d(c,"getSliceBeginCoords",function(){return Qe}),n.d(c,"getSliceSize",function(){return tn}),n.d(c,"prepareAndValidate",function(){return Ut}),n.d(c,"validateUpdateShape",function(){return Vt.c}),n.d(c,"validateInput",function(){return Vt.b}),n.d(c,"calculateShapes",function(){return Vt.a}),n.d(c,"SELU_SCALEALPHA",function(){return en}),n.d(c,"SELU_SCALE",function(){return nn}),n.d(c,"ERF_P",function(){return rn}),n.d(c,"ERF_A1",function(){return on}),n.d(c,"ERF_A2",function(){return sn}),n.d(c,"ERF_A3",function(){return an}),n.d(c,"ERF_A4",function(){return ln}),n.d(c,"ERF_A5",function(){return un}),n.d(c,"warn",function(){return cn.b}),n.d(c,"log",function(){return cn.a}),n.d(c,"mergeRealAndImagArrays",function(){return hn}),n.d(c,"splitRealAndImagArrays",function(){return dn}),n.d(c,"complexWithEvenIndex",function(){return pn}),n.d(c,"complexWithOddIndex",function(){return fn}),n.d(c,"getComplexWithIndex",function(){return gn}),n.d(c,"assignToTypedArray",function(){return mn}),n.d(c,"exponents",function(){return vn}),n.d(c,"exponent",function(){return bn}),n.d(c,"decodeEinsumEquation",function(){return wn}),n.d(c,"getEinsumPermutation",function(){return Cn}),n.d(c,"checkEinsumDimSizes",function(){return Sn}),n.d(c,"getEinsumComputePath",function(){return kn}),n.d(c,"isIdentityPermutation",function(){return On}),n.d(c,"prepareSplitSize",function(){return Rn}),n.d(c,"getSparseFillEmptyRowsIndicesDenseShapeMismatch",function(){return An}),n.d(c,"getSparseFillEmptyRowsNegativeIndexErrorMessage",function(){return Nn}),n.d(c,"getSparseFillEmptyRowsOutOfRangeIndexErrorMessage",function(){return Dn}),n.d(c,"getSparseReshapeMultipleNegativeOneOutputDimErrorMessage",function(){return Mn}),n.d(c,"getSparseReshapeNegativeOutputDimErrorMessage",function(){return Ln}),n.d(c,"getSparseReshapeEmptyTensorZeroOutputDimErrorMessage",function(){return Pn}),n.d(c,"getSparseReshapeInputOutputMultipleErrorMessage",function(){return Fn}),n.d(c,"getSparseReshapeInputOutputMismatchErrorMessage",function(){return Bn}),n.d(c,"getSparseSegmentReductionNegativeSegmentIdsErrorMessage",function(){return jn}),n.d(c,"getSparseSegmentReductionNonIncreasingSegmentIdsErrorMessage",function(){return $n}),n.d(c,"getSparseSegmentReductionSegmentIdOutOfRangeErrorMessage",function(){return Un}),n.d(c,"getSparseSegmentReductionIndicesOutOfRangeErrorMessage",function(){return Vn});var h={};n.d(h,"nonMaxSuppressionV3Impl",function(){return Yn.a}),n.d(h,"nonMaxSuppressionV4Impl",function(){return Yn.b}),n.d(h,"nonMaxSuppressionV5Impl",function(){return Yn.c}),n.d(h,"whereImpl",function(){return qn.a});var d=n("Kkag"),p=(n("TdUJ"),n("v/P2")),f=n("GGfn");
  415. /**
  416. * @license
  417. * Copyright 2018 Google LLC. All Rights Reserved.
  418. * Licensed under the Apache License, Version 2.0 (the "License");
  419. * you may not use this file except in compliance with the License.
  420. * You may obtain a copy of the License at
  421. *
  422. * http://www.apache.org/licenses/LICENSE-2.0
  423. *
  424. * Unless required by applicable law or agreed to in writing, software
  425. * distributed under the License is distributed on an "AS IS" BASIS,
  426. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  427. * See the License for the specific language governing permissions and
  428. * limitations under the License.
  429. * =============================================================================
  430. */
  431. class g{constructor(){this.saveRouters=[],this.loadRouters=[]}static getInstance(){return null==g.instance&&(g.instance=new g),g.instance}static registerSaveRouter(t){g.getInstance().saveRouters.push(t)}static registerLoadRouter(t){g.getInstance().loadRouters.push(t)}static getSaveHandlers(t){return g.getHandlers(t,"save")}static getLoadHandlers(t,e){return g.getHandlers(t,"load",e)}static getHandlers(t,e,n){const r=[];return("load"===e?g.getInstance().loadRouters:g.getInstance().saveRouters).forEach(e=>{const i=e(t,n);null!==i&&r.push(i)}),r}}const m=t=>g.registerSaveRouter(t),v=t=>g.registerLoadRouter(t),b=t=>g.getSaveHandlers(t),_=(t,e)=>g.getLoadHandlers(t,e),y="tensorflowjs",T=1,x="models_store",E="model_info_store";function w(){if(!Object(p.b)().getBool("IS_BROWSER"))throw new Error("Failed to obtain IndexedDB factory because the current environmentis not a web browser.");const t="undefined"==typeof window?self:window,e=t.indexedDB||t.mozIndexedDB||t.webkitIndexedDB||t.msIndexedDB||t.shimIndexedDB;if(null==e)throw new Error("The current browser does not appear to support IndexedDB.");return e}function C(t){const e=t.result;e.createObjectStore(x,{keyPath:"modelPath"}),e.createObjectStore(E,{keyPath:"modelPath"})}class S{constructor(t){if(this.indexedDB=w(),null==t||!t)throw new Error("For IndexedDB, modelPath must not be null, undefined or empty.");this.modelPath=t}async save(t){if(t.modelTopology instanceof ArrayBuffer)throw new Error("BrowserLocalStorage.save() does not support saving model topology in binary formats yet.");return this.databaseAction(this.modelPath,t)}async load(){return this.databaseAction(this.modelPath)}databaseAction(t,e){return new Promise((t,n)=>{const r=this.indexedDB.open(y,T);r.onupgradeneeded=(()=>C(r)),r.onsuccess=(()=>{const i=r.result;if(null==e){const e=i.transaction(x,"readonly"),r=e.objectStore(x).get(this.modelPath);r.onsuccess=(()=>{if(null==r.result)return i.close(),n(new Error(`Cannot find model with path '${this.modelPath}' `+"in IndexedDB."));t(r.result.modelArtifacts)}),r.onerror=(t=>(i.close(),n(r.error))),e.oncomplete=(()=>i.close())}else{const r=Object(f.h)(e),o=i.transaction(E,"readwrite");let s=o.objectStore(E);const a=s.put({modelPath:this.modelPath,modelArtifactsInfo:r});let l;a.onsuccess=(()=>{const a=(l=i.transaction(x,"readwrite")).objectStore(x).put({modelPath:this.modelPath,modelArtifacts:e,modelArtifactsInfo:r});a.onsuccess=(()=>t({modelArtifactsInfo:r})),a.onerror=(t=>{const e=(s=o.objectStore(E)).delete(this.modelPath);e.onsuccess=(()=>(i.close(),n(a.error))),e.onerror=(t=>(i.close(),n(a.error)))})}),a.onerror=(t=>(i.close(),n(a.error))),o.oncomplete=(()=>{null==l?i.close():l.oncomplete=(()=>i.close())})}}),r.onerror=(t=>n(r.error))})}}S.URL_SCHEME="indexeddb://";const k=t=>Object(p.b)().getBool("IS_BROWSER")&&!Array.isArray(t)&&t.startsWith(S.URL_SCHEME)?(O=t.slice(S.URL_SCHEME.length),new S(O)):null;var O;g.registerSaveRouter(k),g.registerLoadRouter(k);var I=n("XFvI");
  432. /**
  433. * @license
  434. * Copyright 2018 Google LLC. All Rights Reserved.
  435. * Licensed under the Apache License, Version 2.0 (the "License");
  436. * you may not use this file except in compliance with the License.
  437. * You may obtain a copy of the License at
  438. *
  439. * http://www.apache.org/licenses/LICENSE-2.0
  440. *
  441. * Unless required by applicable law or agreed to in writing, software
  442. * distributed under the License is distributed on an "AS IS" BASIS,
  443. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  444. * See the License for the specific language governing permissions and
  445. * limitations under the License.
  446. * =============================================================================
  447. */const R="/",A="tensorflowjs_models",N="info",D="model_topology",M="weight_specs",L="weight_data",P="model_metadata";function F(t){return{info:[A,t,N].join(R),topology:[A,t,D].join(R),weightSpecs:[A,t,M].join(R),weightData:[A,t,L].join(R),modelMetadata:[A,t,P].join(R)}}function B(t){for(const e of Object.values(t))window.localStorage.removeItem(e)}function j(t){const e=t.split(R);if(e.length<3)throw new Error(`Invalid key format: ${t}`);return e.slice(1,e.length-1).join(R)}class ${constructor(t){if(!Object(p.b)().getBool("IS_BROWSER")||"undefined"==typeof window||void 0===window.localStorage)throw new Error("The current environment does not support local storage.");if(this.LS=window.localStorage,null==t||!t)throw new Error("For local storage, modelPath must not be null, undefined or empty.");this.modelPath=t,this.keys=F(this.modelPath)}async save(t){if(t.modelTopology instanceof ArrayBuffer)throw new Error("BrowserLocalStorage.save() does not support saving model topology in binary formats yet.");{const e=JSON.stringify(t.modelTopology),n=JSON.stringify(t.weightSpecs),r=Object(f.h)(t);try{this.LS.setItem(this.keys.info,JSON.stringify(r)),this.LS.setItem(this.keys.topology,e),this.LS.setItem(this.keys.weightSpecs,n),this.LS.setItem(this.keys.weightData,Object(f.a)(t.weightData));const i={format:t.format,generatedBy:t.generatedBy,convertedBy:t.convertedBy,signature:null!=t.signature?t.signature:void 0,userDefinedMetadata:null!=t.userDefinedMetadata?t.userDefinedMetadata:void 0,modelInitializer:null!=t.modelInitializer?t.modelInitializer:void 0,trainingConfig:null!=t.trainingConfig?t.trainingConfig:void 0};return this.LS.setItem(this.keys.modelMetadata,JSON.stringify(i)),{modelArtifactsInfo:r}}catch(t){throw B(this.keys),new Error(`Failed to save model '${this.modelPath}' to local storage: `+"size quota being exceeded is a possible cause of this failure: "+`modelTopologyBytes=${r.modelTopologyBytes}, `+`weightSpecsBytes=${r.weightSpecsBytes}, `+`weightDataBytes=${r.weightDataBytes}.`)}}}async load(){const t=JSON.parse(this.LS.getItem(this.keys.info));if(null==t)throw new Error(`In local storage, there is no model with name '${this.modelPath}'`);if("JSON"!==t.modelTopologyType)throw new Error("BrowserLocalStorage does not support loading non-JSON model topology yet.");const e={},n=JSON.parse(this.LS.getItem(this.keys.topology));if(null==n)throw new Error(`In local storage, the topology of model '${this.modelPath}' `+"is missing.");e.modelTopology=n;const r=JSON.parse(this.LS.getItem(this.keys.weightSpecs));if(null==r)throw new Error(`In local storage, the weight specs of model '${this.modelPath}' `+"are missing.");e.weightSpecs=r;const i=this.LS.getItem(this.keys.modelMetadata);if(null!=i){const t=JSON.parse(i);e.format=t.format,e.generatedBy=t.generatedBy,e.convertedBy=t.convertedBy,null!=t.signature&&(e.signature=t.signature),null!=t.userDefinedMetadata&&(e.userDefinedMetadata=t.userDefinedMetadata),null!=t.modelInitializer&&(e.modelInitializer=t.modelInitializer),null!=t.trainingConfig&&(e.trainingConfig=t.trainingConfig)}const o=this.LS.getItem(this.keys.weightData);if(null==o)throw new Error("In local storage, the binary weight values of model "+`'${this.modelPath}' are missing.`);return e.weightData=Object(f.b)(o),e}}$.URL_SCHEME="localstorage://";const U=t=>Object(p.b)().getBool("IS_BROWSER")&&!Array.isArray(t)&&t.startsWith($.URL_SCHEME)?function(t){return new $(t)}(t.slice($.URL_SCHEME.length)):null;g.registerSaveRouter(U),g.registerLoadRouter(U);
  448. /**
  449. * @license
  450. * Copyright 2018 Google LLC. All Rights Reserved.
  451. * Licensed under the Apache License, Version 2.0 (the "License");
  452. * you may not use this file except in compliance with the License.
  453. * You may obtain a copy of the License at
  454. *
  455. * http://www.apache.org/licenses/LICENSE-2.0
  456. *
  457. * Unless required by applicable law or agreed to in writing, software
  458. * distributed under the License is distributed on an "AS IS" BASIS,
  459. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  460. * See the License for the specific language governing permissions and
  461. * limitations under the License.
  462. * =============================================================================
  463. */
  464. const V="://";class H{constructor(){this.managers={}}static getInstance(){return null==H.instance&&(H.instance=new H),H.instance}static registerManager(t,e){Object(I.assert)(null!=t,()=>"scheme must not be undefined or null."),t.endsWith(V)&&(t=t.slice(0,t.indexOf(V))),Object(I.assert)(t.length>0,()=>"scheme must not be an empty string.");const n=H.getInstance();Object(I.assert)(null==n.managers[t],()=>`A model store manager is already registered for scheme '${t}'.`),n.managers[t]=e}static getManager(t){const e=this.getInstance().managers[t];if(null==e)throw new Error(`Cannot find model manager for scheme '${t}'`);return e}static getSchemes(){return Object.keys(this.getInstance().managers)}}function W(t){if(-1===t.indexOf(V))throw new Error("The url string provided does not contain a scheme. Supported schemes are: "+`${H.getSchemes().join(",")}`);return{scheme:t.split(V)[0],path:t.split(V)[1]}}async function G(t,e,n=!1){Object(I.assert)(t!==e,()=>`Old path and new path are the same: '${t}'`);const r=g.getLoadHandlers(t);Object(I.assert)(r.length>0,()=>`Copying failed because no load handler is found for source URL ${t}.`),Object(I.assert)(r.length<2,()=>`Copying failed because more than one (${r.length}) `+`load handlers for source URL ${t}.`);const i=r[0],o=g.getSaveHandlers(e);Object(I.assert)(o.length>0,()=>"Copying failed because no save handler is found for destination "+`URL ${e}.`),Object(I.assert)(o.length<2,()=>`Copying failed because more than one (${r.length}) `+`save handlers for destination URL ${e}.`);const s=o[0],a=W(t).scheme,l=W(t).path,u=a===W(t).scheme,c=await i.load();n&&u&&await H.getManager(a).removeModel(l);const h=await s.save(c);return n&&!u&&await H.getManager(a).removeModel(l),h.modelArtifactsInfo}async function z(){const t=H.getSchemes(),e={};for(const n of t){const t=await H.getManager(n).listModels();for(const r in t){e[n+V+r]=t[r]}}return e}async function X(t){const e=W(t);return H.getManager(e.scheme).removeModel(e.path)}async function K(t,e){return G(t,e,!1)}async function Y(t,e){return G(t,e,!0)}
  465. /**
  466. * @license
  467. * Copyright 2019 Google LLC. All Rights Reserved.
  468. * Licensed under the Apache License, Version 2.0 (the "License");
  469. * you may not use this file except in compliance with the License.
  470. * You may obtain a copy of the License at
  471. *
  472. * http://www.apache.org/licenses/LICENSE-2.0
  473. *
  474. * Unless required by applicable law or agreed to in writing, software
  475. * distributed under the License is distributed on an "AS IS" BASIS,
  476. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  477. * See the License for the specific language governing permissions and
  478. * limitations under the License.
  479. * =============================================================================
  480. */if(Object(p.b)().get("IS_BROWSER")){Object(p.b)().setPlatform("browser",new class{fetch(t,e){return fetch(t,e)}now(){return performance.now()}encode(t,e){if("utf-8"!==e&&"utf8"!==e)throw new Error(`Browser's encoder only supports utf-8, but got ${e}`);return null==this.textEncoder&&(this.textEncoder=new TextEncoder),this.textEncoder.encode(t)}decode(t,e){return new TextDecoder(e).decode(t)}});try{H.registerManager($.URL_SCHEME,new class{constructor(){Object(I.assert)(Object(p.b)().getBool("IS_BROWSER"),()=>"Current environment is not a web browser"),Object(I.assert)("undefined"==typeof window||void 0!==window.localStorage,()=>"Current browser does not appear to support localStorage"),this.LS=window.localStorage}async listModels(){const t={},e=A+R,n=R+N;for(let r=0;r<this.LS.length;++r){const i=this.LS.key(r);i.startsWith(e)&&i.endsWith(n)&&(t[j(i)]=JSON.parse(this.LS.getItem(i)))}return t}async removeModel(t){var e;const n=F(t=(e=t).startsWith($.URL_SCHEME)?e.slice($.URL_SCHEME.length):e);if(null==this.LS.getItem(n.info))throw new Error(`Cannot find model at path '${t}'`);const r=JSON.parse(this.LS.getItem(n.info));return B(n),r}})}catch(t){}try{H.registerManager(S.URL_SCHEME,new class{constructor(){this.indexedDB=w()}async listModels(){return new Promise((t,e)=>{const n=this.indexedDB.open(y,T);n.onupgradeneeded=(()=>C(n)),n.onsuccess=(()=>{const r=n.result,i=r.transaction(E,"readonly"),o=i.objectStore(E).getAll();o.onsuccess=(()=>{const e={};for(const t of o.result)e[t.modelPath]=t.modelArtifactsInfo;t(e)}),o.onerror=(t=>(r.close(),e(o.error))),i.oncomplete=(()=>r.close())}),n.onerror=(t=>e(n.error))})}async removeModel(t){var e;return t=(e=t).startsWith(S.URL_SCHEME)?e.slice(S.URL_SCHEME.length):e,new Promise((e,n)=>{const r=this.indexedDB.open(y,T);r.onupgradeneeded=(()=>C(r)),r.onsuccess=(()=>{const i=r.result,o=i.transaction(E,"readwrite"),s=o.objectStore(E),a=s.get(t);let l;a.onsuccess=(()=>{if(null==a.result)return i.close(),n(new Error(`Cannot find model with path '${t}' `+"in IndexedDB."));{const r=s.delete(t),o=()=>{const r=(l=i.transaction(x,"readwrite")).objectStore(x).delete(t);r.onsuccess=(()=>e(a.result.modelArtifactsInfo)),r.onerror=(t=>n(a.error))};r.onsuccess=o,r.onerror=(t=>(o(),i.close(),n(a.error)))}}),a.onerror=(t=>(i.close(),n(a.error))),o.oncomplete=(()=>{null==l?i.close():l.oncomplete=(()=>i.close())})}),r.onerror=(t=>n(r.error))})}})}catch(t){}}n("ficH");var q=n("SnLv"),J=n("MlK1"),Z=n("VdVo"),Q=n("xnen"),tt=n("XPNO");
  481. /**
  482. * @license
  483. * Copyright 2020 Google Inc. All Rights Reserved.
  484. * Licensed under the Apache License, Version 2.0 (the "License");
  485. * you may not use this file except in compliance with the License.
  486. * You may obtain a copy of the License at
  487. *
  488. * http://www.apache.org/licenses/LICENSE-2.0
  489. *
  490. * Unless required by applicable law or agreed to in writing, software
  491. * distributed under the License is distributed on an "AS IS" BASIS,
  492. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  493. * See the License for the specific language governing permissions and
  494. * limitations under the License.
  495. * =============================================================================
  496. */
  497. Object(d.b)();const et={buffer:q.a,cast:J.a,clone:Z.a,print:Q.a};Object(tt.e)(et);
  498. /**
  499. * @license
  500. * Copyright 2018 Google LLC. All Rights Reserved.
  501. * Licensed under the Apache License, Version 2.0 (the "License");
  502. * you may not use this file except in compliance with the License.
  503. * You may obtain a copy of the License at
  504. *
  505. * http://www.apache.org/licenses/LICENSE-2.0
  506. *
  507. * Unless required by applicable law or agreed to in writing, software
  508. * distributed under the License is distributed on an "AS IS" BASIS,
  509. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  510. * See the License for the specific language governing permissions and
  511. * limitations under the License.
  512. * =============================================================================
  513. */
  514. const nt="model",rt=".json",it=".weights.bin";function ot(t){return new Promise(t=>setTimeout(t)).then(t)}class st{constructor(t){if(!Object(p.b)().getBool("IS_BROWSER"))throw new Error("browserDownloads() cannot proceed because the current environment is not a browser.");t.startsWith(st.URL_SCHEME)&&(t=t.slice(st.URL_SCHEME.length)),null!=t&&0!==t.length||(t=nt),this.modelJsonFileName=t+rt,this.weightDataFileName=t+it}async save(t){if("undefined"==typeof document)throw new Error("Browser downloads are not supported in this environment since `document` is not present");const e=window.URL.createObjectURL(new Blob([t.weightData],{type:"application/octet-stream"}));if(t.modelTopology instanceof ArrayBuffer)throw new Error("BrowserDownloads.save() does not support saving model topology in binary formats yet.");{const n=[{paths:["./"+this.weightDataFileName],weights:t.weightSpecs}],r=Object(f.i)(t,n),i=window.URL.createObjectURL(new Blob([JSON.stringify(r)],{type:"application/json"})),o=null==this.modelJsonAnchor?document.createElement("a"):this.modelJsonAnchor;if(o.download=this.modelJsonFileName,o.href=i,await ot(()=>o.dispatchEvent(new MouseEvent("click"))),null!=t.weightData){const t=null==this.weightDataAnchor?document.createElement("a"):this.weightDataAnchor;t.download=this.weightDataFileName,t.href=e,await ot(()=>t.dispatchEvent(new MouseEvent("click")))}return{modelArtifactsInfo:Object(f.h)(t)}}}}st.URL_SCHEME="downloads://";class at{constructor(t){if(null==t||t.length<1)throw new Error("When calling browserFiles, at least 1 file is required, "+`but received ${t}`);this.jsonFile=t[0],this.weightsFiles=t.slice(1)}async load(){return new Promise((t,e)=>{const n=new FileReader;n.onload=(n=>{const r=JSON.parse(n.target.result),i=r.modelTopology;if(null==i)return void e(new Error(`modelTopology field is missing from file ${this.jsonFile.name}`));if(null==r.weightsManifest)return void e(new Error(`weightManifest field is missing from file ${this.jsonFile.name}`));if(0===this.weightsFiles.length)return void t({modelTopology:i});const o=Object(f.g)(r,t=>this.loadWeights(t));t(o)}),n.onerror=(t=>e("Failed to read model topology and weights manifest JSON "+`from file '${this.jsonFile.name}'. BrowserFiles supports loading `+"Keras-style tf.Model artifacts only.")),n.readAsText(this.jsonFile)})}loadWeights(t){const e=[],n=[];for(const r of t)e.push(...r.weights),n.push(...r.paths);const r=this.checkManifestAndWeightFiles(t),i=n.map(t=>this.loadWeightsFile(t,r[t]));return Promise.all(i).then(t=>[e,Object(f.d)(t)])}loadWeightsFile(t,e){return new Promise((n,r)=>{const i=new FileReader;i.onload=(t=>{const e=t.target.result;n(e)}),i.onerror=(e=>r(`Failed to weights data from file of path '${t}'.`)),i.readAsArrayBuffer(e)})}checkManifestAndWeightFiles(t){const e=[],n=this.weightsFiles.map(t=>Object(f.c)(t.name)),r={};for(const i of t)i.paths.forEach(t=>{const i=Object(f.c)(t);if(-1!==e.indexOf(i))throw new Error("Duplicate file basename found in weights manifest: "+`'${i}'`);if(e.push(i),-1===n.indexOf(i))throw new Error(`Weight file with basename '${i}' is not provided.`);r[t]=this.weightsFiles[n.indexOf(i)]});if(e.length!==this.weightsFiles.length)throw new Error("Mismatch in the number of files in weights manifest "+`(${e.length}) and the number of weight files provided `+`(${this.weightsFiles.length}).`);return r}}function lt(t){return new at(t)}
  515. /**
  516. * @license
  517. * Copyright 2019 Google LLC. All Rights Reserved.
  518. * Licensed under the Apache License, Version 2.0 (the "License");
  519. * you may not use this file except in compliance with the License.
  520. * You may obtain a copy of the License at
  521. *
  522. * http://www.apache.org/licenses/LICENSE-2.0
  523. *
  524. * Unless required by applicable law or agreed to in writing, software
  525. * distributed under the License is distributed on an "AS IS" BASIS,
  526. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  527. * See the License for the specific language governing permissions and
  528. * limitations under the License.
  529. * =============================================================================
  530. */function ut(t,e,n,r){!function(t){Object(I.assert)(null!=t&&Array.isArray(t)&&t.length>0,()=>"promises must be a none empty array")}(t),function(t,e){Object(I.assert)(t>=0&&t<=1,()=>"Progress fraction must be in range [0, 1], but "+`got startFraction ${t}`),Object(I.assert)(e>=0&&e<=1,()=>"Progress fraction must be in range [0, 1], but "+`got endFraction ${e}`),Object(I.assert)(e>=t,()=>"startFraction must be no more than endFraction, but "+`got startFraction ${t} and endFraction `+`${e}`)}(n=null==n?0:n,r=null==r?1:r);let i=0;return Promise.all(t.map(o=>(o.then(o=>{const s=n+ ++i/t.length*(r-n);return e(s),o}),o)))}g.registerSaveRouter(t=>Object(p.b)().getBool("IS_BROWSER")&&!Array.isArray(t)&&t.startsWith(st.URL_SCHEME)?function(t="model"){return new st(t)}(t.slice(st.URL_SCHEME.length)):null);var ct=n("T3Fu");
  531. /**
  532. * @license
  533. * Copyright 2018 Google LLC. All Rights Reserved.
  534. * Licensed under the Apache License, Version 2.0 (the "License");
  535. * you may not use this file except in compliance with the License.
  536. * You may obtain a copy of the License at
  537. *
  538. * http://www.apache.org/licenses/LICENSE-2.0
  539. *
  540. * Unless required by applicable law or agreed to in writing, software
  541. * distributed under the License is distributed on an "AS IS" BASIS,
  542. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  543. * See the License for the specific language governing permissions and
  544. * limitations under the License.
  545. * =============================================================================
  546. */async function ht(t,e){null==e&&(e={});const n=null==e.fetchFunc?Object(p.b)().platform.fetch:e.fetchFunc,r=t.map(t=>n(t,e.requestInit,{isBinary:!0})),i=(null==e.onProgress?await Promise.all(r):await ut(r,e.onProgress,0,.5)).map(t=>t.arrayBuffer());return null==e.onProgress?await Promise.all(i):await ut(i,e.onProgress,.5,1)}async function dt(t,e="",n,r){return pt(t=>ht(t,{requestInit:r}))(t,e,n)}function pt(t){return async(e,n="",r)=>{const i=e.map(()=>!1),o={},s=null!=r?r.map(()=>!1):[],a=[];if(e.forEach((t,e)=>{let n=0;t.weights.forEach(t=>{const l="quantization"in t?t.quantization.dtype:t.dtype,u=ct.a[l]*I.sizeFromShape(t.shape),c=()=>{i[e]=!0,null==o[e]&&(o[e]=[]),o[e].push({manifestEntry:t,groupOffset:n,sizeBytes:u})};null!=r?r.forEach((e,n)=>{e===t.name&&(c(),s[n]=!0)}):c(),a.push(t.name),n+=u})}),!s.every(t=>t)){const t=r.filter((t,e)=>!s[e]);throw new Error("Could not find weights in manifest with names: "+`${t.join(", ")}. \n`+"Manifest JSON has weights with names: "+`${a.join(", ")}.`)}const l=i.reduce((t,e,n)=>(e&&t.push(n),t),[]),u=[];l.forEach(t=>{e[t].paths.forEach(t=>{const e=n+(n.endsWith("/")?"":"/")+t;u.push(e)})});const c=await t(u),h={};let d=0;return l.forEach(t=>{const n=e[t].paths.length;let r=0;for(let t=0;t<n;t++)r+=c[d+t].byteLength;const i=new ArrayBuffer(r),s=new Uint8Array(i);let a=0;for(let t=0;t<n;t++){const e=new Uint8Array(c[d+t]);s.set(e,a),a+=e.byteLength}o[t].forEach(t=>{const e=i.slice(t.groupOffset,t.groupOffset+t.sizeBytes),n=Object(f.e)(e,[t.manifestEntry]);for(const t in n)h[t]=n[t]}),d+=n}),h}}
  547. /**
  548. * @license
  549. * Copyright 2018 Google LLC. All Rights Reserved.
  550. * Licensed under the Apache License, Version 2.0 (the "License");
  551. * you may not use this file except in compliance with the License.
  552. * You may obtain a copy of the License at
  553. *
  554. * http://www.apache.org/licenses/LICENSE-2.0
  555. *
  556. * Unless required by applicable law or agreed to in writing, software
  557. * distributed under the License is distributed on an "AS IS" BASIS,
  558. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  559. * See the License for the specific language governing permissions and
  560. * limitations under the License.
  561. * =============================================================================
  562. */const ft="application/octet-stream",gt="application/json";class mt{constructor(t,e){if(this.DEFAULT_METHOD="POST",null==e&&(e={}),this.weightPathPrefix=e.weightPathPrefix,this.onProgress=e.onProgress,this.weightUrlConverter=e.weightUrlConverter,null!=e.fetchFunc?(Object(I.assert)("function"==typeof e.fetchFunc,()=>"Must pass a function that matches the signature of `fetch` (see https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API)"),this.fetch=e.fetchFunc):this.fetch=Object(p.b)().platform.fetch,Object(I.assert)(null!=t&&t.length>0,()=>"URL path for http must not be null, undefined or empty."),Array.isArray(t)&&Object(I.assert)(2===t.length,()=>"URL paths for http must have a length of 2, "+`(actual length is ${t.length}).`),this.path=t,null!=e.requestInit&&null!=e.requestInit.body)throw new Error("requestInit is expected to have no pre-existing body, but has one.");this.requestInit=e.requestInit||{}}async save(t){if(t.modelTopology instanceof ArrayBuffer)throw new Error("BrowserHTTPRequest.save() does not support saving model topology in binary formats yet.");const e=Object.assign({method:this.DEFAULT_METHOD},this.requestInit);e.body=new FormData;const n=[{paths:["./model.weights.bin"],weights:t.weightSpecs}],r=Object(f.i)(t,n);e.body.append("model.json",new Blob([JSON.stringify(r)],{type:gt}),"model.json"),null!=t.weightData&&e.body.append("model.weights.bin",new Blob([t.weightData],{type:ft}),"model.weights.bin");const i=await this.fetch(this.path,e);if(i.ok)return{modelArtifactsInfo:Object(f.h)(t),responses:[i]};throw new Error("BrowserHTTPRequest.save() failed due to HTTP response status "+`${i.status}.`)}async load(){const t=await this.fetch(this.path,this.requestInit);if(!t.ok)throw new Error(`Request to ${this.path} failed with status code `+`${t.status}. Please verify this URL points to `+"the model JSON of the model to load.");let e;try{e=await t.json()}catch(t){let e=`Failed to parse model JSON of response from ${this.path}.`;throw this.path.endsWith(".pb")?e+=" Your path contains a .pb file extension. Support for .pb models have been removed in TensorFlow.js 1.0 in favor of .json models. You can re-convert your Python TensorFlow model using the TensorFlow.js 1.0 conversion scripts or you can convert your.pb models with the 'pb2json'NPM script in the tensorflow/tfjs-converter repository.":e+=" Please make sure the server is serving valid JSON for this request.",new Error(e)}const n=e.modelTopology,r=e.weightsManifest;if(null==n&&null==r)throw new Error(`The JSON from HTTP path ${this.path} contains neither model `+"topology or manifest for weights.");return Object(f.g)(e,t=>this.loadWeights(t))}async loadWeights(t){const e=Array.isArray(this.path)?this.path[1]:this.path,[n,r]=function(t){const e=t.lastIndexOf("/"),n=t.lastIndexOf("?"),r=t.substring(0,e),i=n>e?t.substring(n):"";return[r+"/",i]}(e),i=this.weightPathPrefix||n,o=[];for(const e of t)o.push(...e.weights);const s=[],a=[];for(const e of t)for(const t of e.paths)null!=this.weightUrlConverter?a.push(this.weightUrlConverter(t)):s.push(i+t+r);this.weightUrlConverter&&s.push(...await Promise.all(a));const l=await ht(s,{requestInit:this.requestInit,fetchFunc:this.fetch,onProgress:this.onProgress});return[o,Object(f.d)(l)]}}function vt(t){return null!=t.match(mt.URL_SCHEME_REGEX)}mt.URL_SCHEME_REGEX=/^https?:\/\//;const bt=(t,e)=>{if("undefined"==typeof fetch&&(null==e||null==e.fetchFunc))return null;{let n=!0;if(n=Array.isArray(t)?t.every(t=>vt(t)):vt(t))return _t(t,e)}return null};function _t(t,e){return new mt(t,e)}function yt(t,e){return _t(t,e)}
  563. /**
  564. * @license
  565. * Copyright 2018 Google LLC. All Rights Reserved.
  566. * Licensed under the Apache License, Version 2.0 (the "License");
  567. * you may not use this file except in compliance with the License.
  568. * You may obtain a copy of the License at
  569. *
  570. * http://www.apache.org/licenses/LICENSE-2.0
  571. *
  572. * Unless required by applicable law or agreed to in writing, software
  573. * distributed under the License is distributed on an "AS IS" BASIS,
  574. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  575. * See the License for the specific language governing permissions and
  576. * limitations under the License.
  577. * =============================================================================
  578. */g.registerSaveRouter(bt),g.registerLoadRouter(bt);class Tt{constructor(t){this.modelArtifacts=t}async load(){return this.modelArtifacts}}class xt{constructor(t){this.saveHandler=t}async save(t){return this.saveHandler(t)}}function Et(t,e,n,r){if(1===arguments.length){return null!=t.modelTopology||null!=t.weightSpecs?new Tt(t):(console.warn("Please call tf.io.fromMemory() with only one argument. The argument should be of type ModelArtifacts. The multi-argument signature of tf.io.fromMemory() has been deprecated and will be removed in a future release."),new Tt({modelTopology:t}))}return console.warn("Please call tf.io.fromMemory() with only one argument. The argument should be of type ModelArtifacts. The multi-argument signature of tf.io.fromMemory() has been deprecated and will be removed in a future release."),new Tt({modelTopology:t,weightSpecs:e,weightData:n,trainingConfig:r})}function wt(t){return new xt(t)}
  579. /**
  580. * @license
  581. * Copyright 2018 Google LLC. All Rights Reserved.
  582. * Licensed under the Apache License, Version 2.0 (the "License");
  583. * you may not use this file except in compliance with the License.
  584. * You may obtain a copy of the License at
  585. *
  586. * http://www.apache.org/licenses/LICENSE-2.0
  587. *
  588. * Unless required by applicable law or agreed to in writing, software
  589. * distributed under the License is distributed on an "AS IS" BASIS,
  590. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  591. * See the License for the specific language governing permissions and
  592. * limitations under the License.
  593. * =============================================================================
  594. */var Ct=n("xMQ1"),St=n("4Ute"),kt=n("0FNO"),Ot=n("35G1"),It=n("gkZw");const Rt=Object(Ot.a)({confusionMatrix_:
  595. /**
  596. * @license
  597. * Copyright 2018 Google LLC. All Rights Reserved.
  598. * Licensed under the Apache License, Version 2.0 (the "License");
  599. * you may not use this file except in compliance with the License.
  600. * You may obtain a copy of the License at
  601. *
  602. * http://www.apache.org/licenses/LICENSE-2.0
  603. *
  604. * Unless required by applicable law or agreed to in writing, software
  605. * distributed under the License is distributed on an "AS IS" BASIS,
  606. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  607. * See the License for the specific language governing permissions and
  608. * limitations under the License.
  609. * =============================================================================
  610. */
  611. function(t,e,n){const r=Object(Ct.a)(t,"labels","confusionMatrix"),i=Object(Ct.a)(e,"predictions","confusionMatrix");I.assert(null==n||n>0&&Number.isInteger(n),()=>"If provided, numClasses must be a positive integer, "+`but got ${n}`),I.assert(1===r.rank,()=>`Expected the rank of labels to be 1, but got ${r.rank}`),I.assert(1===i.rank,()=>"Expected the rank of predictions to be 1, "+`but got ${i.rank}`),I.assert(r.shape[0]===i.shape[0],()=>"Mismatch in the number of examples: "+`${r.shape[0]} vs. ${i.shape[0]}. `+"Labels and predictions should have the same number of elements."),I.assert(n>0&&Number.isInteger(n),()=>"numClasses is required to be a positive integer, but got "+`${n}`);const o=Object(kt.a)(Object(J.a)(r,"int32"),n),s=Object(kt.a)(Object(J.a)(i,"int32"),n),a=Object(It.a)(o),l=Object(St.a)(a,s);return Object(J.a)(l,"int32")}});
  612. /**
  613. * @license
  614. * Copyright 2018 Google LLC. All Rights Reserved.
  615. * Licensed under the Apache License, Version 2.0 (the "License");
  616. * you may not use this file except in compliance with the License.
  617. * You may obtain a copy of the License at
  618. *
  619. * http://www.apache.org/licenses/LICENSE-2.0
  620. *
  621. * Unless required by applicable law or agreed to in writing, software
  622. * distributed under the License is distributed on an "AS IS" BASIS,
  623. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  624. * See the License for the specific language governing permissions and
  625. * limitations under the License.
  626. * =============================================================================
  627. */var At=n("bDWH"),Nt=n("l5jf"),Dt=n("aYFL"),Mt=n("ke9e");
  628. /**
  629. * @license
  630. * Copyright 2019 Google LLC. All Rights Reserved.
  631. * Licensed under the Apache License, Version 2.0 (the "License");
  632. * you may not use this file except in compliance with the License.
  633. * You may obtain a copy of the License at
  634. *
  635. * http://www.apache.org/licenses/LICENSE-2.0
  636. *
  637. * Unless required by applicable law or agreed to in writing, software
  638. * distributed under the License is distributed on an "AS IS" BASIS,
  639. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  640. * See the License for the specific language governing permissions and
  641. * limitations under the License.
  642. * =============================================================================
  643. */
  644. let Lt;function Pt(t,e=3){if(e>4)throw new Error("Cannot construct Tensor with more than 4 channels from pixels.");if(null==t)throw new Error("pixels passed to tf.browser.fromPixels() can not be null");let n=!1,r=!1,i=!1,o=!1,s=!1,a=!1;if(t.data instanceof Uint8Array)n=!0;else if("undefined"!=typeof ImageData&&t instanceof ImageData)r=!0;else if("undefined"!=typeof HTMLVideoElement&&t instanceof HTMLVideoElement)i=!0;else if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement)o=!0;else if(null!=t.getContext)s=!0;else{if(!("undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap))throw new Error("pixels passed to tf.browser.fromPixels() must be either an HTMLVideoElement, HTMLImageElement, HTMLCanvasElement, ImageData in browser, or OffscreenCanvas, ImageData in webworker or {data: Uint32Array, width: number, height: number}, "+`but was ${t.constructor.name}`);a=!0}if(i){const e=2;if(i&&t.readyState<e)throw new Error("The video element has not loaded data yet. Please wait for `loadeddata` event on the <video> element.")}if(null!=Object(Dt.b)(Nt._6,d.a.backendName)){const n={pixels:t},r={numChannels:e};return d.a.runKernel(Nt._6,n,r)}const[l,u]=i?[t.videoWidth,t.videoHeight]:[t.width,t.height];let c,h;if(s)c=t.getContext("2d").getImageData(0,0,l,u).data;else if(r||n)c=t.data;else if(o||i||a){if(null==Lt)if("undefined"==typeof document){if("undefined"==typeof OffscreenCanvas||"undefined"==typeof OffscreenCanvasRenderingContext2D)throw new Error("Cannot parse input in current context. Reason: OffscreenCanvas Context2D rendering is not supported.");Lt=new OffscreenCanvas(1,1).getContext("2d")}else Lt=document.createElement("canvas").getContext("2d");Lt.canvas.width=l,Lt.canvas.height=u,Lt.drawImage(t,0,0,l,u),c=Lt.getImageData(0,0,l,u).data}if(4===e)h=new Int32Array(c);else{const t=l*u;h=new Int32Array(t*e);for(let n=0;n<t;n++)for(let t=0;t<e;++t)h[n*e+t]=c[4*n+t]}const p=[u,l,e];return Object(Mt.a)(h,p,"int32")}function Ft(t){return"undefined"!=typeof window&&"undefined"!=typeof ImageBitmap&&window.hasOwnProperty("createImageBitmap")&&!(t instanceof ImageBitmap)&&function(t){return null!=t&&0!==t.width&&0!==t.height}(t)&&!function(t){return null!=t&&t.data instanceof Uint8Array}(t)}async function Bt(t,e=3){let n=null;if(Object(p.b)().getBool("WRAP_TO_IMAGEBITMAP")&&Ft(t)){let e;try{e=await createImageBitmap(t,{premultiplyAlpha:"none"})}catch(t){e=null}n=null!=e&&e.width===t.width&&e.height===t.height?e:t}else n=t;return Pt(n,e)}async function jt(t,e){let n=Object(Ct.a)(t,"img","toPixels");if(!(t instanceof tt.a)){const t=n;n=Object(J.a)(t,"int32"),t.dispose()}if(2!==n.rank&&3!==n.rank)throw new Error(`toPixels only supports rank 2 or 3 tensors, got rank ${n.rank}.`);const[r,i]=n.shape.slice(0,2),o=2===n.rank?1:n.shape[2];if(o>4||2===o)throw new Error("toPixels only supports depth of size "+`1, 3 or 4 but got ${o}`);if("float32"!==n.dtype&&"int32"!==n.dtype)throw new Error(`Unsupported type for toPixels: ${n.dtype}.`+" Please use float32 or int32 tensors.");const s=await n.data(),a="float32"===n.dtype?255:1,l=new Uint8ClampedArray(i*r*4);for(let t=0;t<r*i;++t){const e=[0,0,0,255];for(let r=0;r<o;r++){const i=s[t*o+r];if("float32"===n.dtype){if(i<0||i>1)throw new Error("Tensor values for a float32 Tensor must be in the "+`range [0 - 1] but encountered ${i}.`)}else if("int32"===n.dtype&&(i<0||i>255))throw new Error("Tensor values for a int32 Tensor must be in the "+`range [0 - 255] but encountered ${i}.`);1===o?(e[0]=i*a,e[1]=i*a,e[2]=i*a):e[r]=i*a}const r=4*t;l[r+0]=Math.round(e[0]),l[r+1]=Math.round(e[1]),l[r+2]=Math.round(e[2]),l[r+3]=Math.round(e[3])}if(null!=e){e.width=i,e.height=r;const t=e.getContext("2d"),n=new ImageData(l,i,r);t.putImageData(n,0,0)}return n!==t&&n.dispose(),l}const $t=Object(Ot.a)({fromPixels_:Pt});function Ut(t,e){const n=t.shape.length,r=e.shape.length;if(n<1)throw new Error("tf.gatherND() expects the input to be rank 1 or higher,"+` but the rank was ${n}.`);if(r<1)throw new Error("tf.gatherND() expects the indices to be rank 1 or higher,"+` but the rank was ${r}.`);if("int32"!==e.dtype)throw new Error("tf.gatherND() expects the indices to be int32 type,"+` but the dtype was ${e.dtype}.`);if(e.shape[r-1]>n)throw new Error("index innermost dimension length must be <= tensor rank; saw: "+`${e.shape[r-1]} vs. ${n}`);if(0===Object(I.sizeFromShape)(t.shape))throw new Error("Requested more than 0 entries, but input is empty."+` Input shape: ${t.shape}.`);const i=e.shape,o=i[i.length-1];let s=1;for(let t=0;t<i.length-1;++t)s*=i[t];const a=t.shape,l=i.slice();l.pop();let u=1;for(let t=o;t<n;++t)u*=a[t],l.push(a[t]);const c=[...Object(I.computeStrides)(t.shape).map(t=>t/u),1].slice(0,o);return[l,s,u,c]}var Vt=n("G6fb");
  645. /**
  646. * @license
  647. * Copyright 2021 Google LLC. All Rights Reserved.
  648. * Licensed under the Apache License, Version 2.0 (the "License");
  649. * you may not use this file except in compliance with the License.
  650. * You may obtain a copy of the License at
  651. *
  652. * http://www.apache.org/licenses/LICENSE-2.0
  653. *
  654. * Unless required by applicable law or agreed to in writing, software
  655. * distributed under the License is distributed on an "AS IS" BASIS,
  656. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  657. * See the License for the specific language governing permissions and
  658. * limitations under the License.
  659. * =============================================================================
  660. */const Ht=-2,Wt=-1;function Gt(t,e,n){const r=t.shape.length;I.assert(r===e.length,()=>`Error in slice${r}D: Length of begin ${e} must `+`match the rank of the array (${r}).`),I.assert(r===n.length,()=>`Error in slice${r}D: Length of size ${n} must `+`match the rank of the array (${r}).`);for(let i=0;i<r;++i)I.assert(e[i]+n[i]<=t.shape[i],()=>`Error in slice${r}D: begin[${i}] + size[${i}] `+`(${e[i]+n[i]}) would overflow input.shape[${i}] (${t.shape[i]})`)}function zt(t){const e=[];let n=0;for(;t>0;)1&t&&e.push(n),t/=2,n++;return e}function Xt(t,e,n){const r=[];for(let i=0;i<t.length;i++)r[i]=Math.ceil((e[i]-t[i])/n[i]);return r}function Kt(t,e,n,r){const i=[...t];for(let t=i.length;t<r.length;t++)i.push(1);for(let t=0;t<n;t++)0===t?i[e]=1:(i.splice(e,0,1),i.pop());return i}function Yt(t,e,n){return n<=t?n:n-(e-1)}function qt(t,e){const n=[];for(let r=0;r<t;r++)n.push(e+r);return n}function Jt(t,e,n,r,i,o,s,a,l){const u=t.length;let c=new Array(u),h=new Array(u),d=new Array(u);if(e.length&&n>0){const l=e[0],u=n+1;c=Zt(s,l,u,r,t),h=Qt(a,l,u,i,t),d=Kt(o,l,u,t)}else for(let e=0;e<u;e++)c[e]=ee(s,r,o,t,e,l),h[e]=ne(a,i,o,t,e,l),d[e]=te(o,e,l);return{begin:c,end:h,strides:d}}function Zt(t,e,n,r,i){const o=[...i],s=qt(n,e);for(let i=0;i<o.length;i++)if(s.indexOf(i)>-1)o[i]=0;else{const s=Yt(e,n,i);let a=r[s];t&1<<s&&(a=0),o[i]=a}return o}function Qt(t,e,n,r,i){const o=[...i],s=qt(n,e);for(let i=0;i<o.length;i++)if(s.indexOf(i)>-1)o[i]=Number.MAX_SAFE_INTEGER;else{const s=Yt(e,n,i);let a=r[s];t&1<<s&&(a=Number.MAX_SAFE_INTEGER),o[i]=a}for(let t=0;t<o.length;t++){const e=i[t];o[t]<0&&(o[t]+=e),o[t]=I.clamp(0,o[t],i[t])}return o}function te(t,e,n){let r=t[e];return(n&1<<e||null==r)&&(r=1),r}function ee(t,e,n,r,i,o){let s=e[i];const a=n[i]||1;(t&1<<i||o&1<<i||null==s)&&(s=a>0?Number.MIN_SAFE_INTEGER:Number.MAX_SAFE_INTEGER);const l=r[i];return s<0&&(s+=l),s=I.clamp(0,s,l-1)}function ne(t,e,n,r,i,o){let s=e[i];const a=n[i]||1;(t&1<<i||o&1<<i||null==s)&&(s=a>0?Number.MAX_SAFE_INTEGER:Number.MIN_SAFE_INTEGER);const l=r[i];return s<0&&(s+=l),s=a>0?I.clamp(0,s,l):I.clamp(-1,s,l-1)}function re(t,e,n){let r=n.length;for(let t=0;t<n.length;t++)if(n[t]>1){r=t;break}for(let i=r+1;i<n.length;i++)if(e[i]>0||n[i]!==t[i])return!1;return!0}function ie(t,e){let n=t.length>0?t[t.length-1]:1;for(let r=0;r<t.length-1;r++)n+=t[r]*e[r];return n}function oe(t,e,n){let r;const i=t.shape.length;let o;return(r="number"==typeof e?[e,...new Array(i-1).fill(0)]:e.length<i?e.concat(new Array(i-e.length).fill(0)):e.slice()).forEach(t=>{I.assert(-1!==t,()=>"slice() does not support negative begin indexing.")}),o=(o=null==n?new Array(i).fill(-1):"number"==typeof n?[n,...new Array(i-1).fill(-1)]:n.length<i?n.concat(new Array(i-n.length).fill(-1)):n).map((e,n)=>e>=0?e:(I.assert(-1===e,()=>"Negative size values should be exactly -1 but got "+`${e} for the slice() size at index ${n}.`),t.shape[n]-r[n])),[r,o]}function se(t,e,n,r,i,o,s,a,l){let u;if(null==r?(u=new Array(e.length)).fill(1):u=r,null!=s&&0!=(s&s-1))throw new Error("Multiple ellipses in slice is not allowed.");let c=!1;const h={dims:u.length,numAddAxisAfterEllipsis:0,begin:e.slice(),end:n.slice(),strides:u.slice(),beginMask:i,endMask:o,ellipsisMask:s,newAxisMask:a,shrinkAxisMask:l};for(let t=0;t<h.dims;t++)c&&0!=(1<<t&a)&&h.numAddAxisAfterEllipsis++,1<<t&s&&(c=!0);c||(h.ellipsisMask|=1<<h.dims,h.dims++);const d={dims:t.length,beginMask:0,endMask:0,beginValid:!1,endValid:!1};!function(t,e){e.beginMask=0,e.endMask=0,e.shrinkAxisMask=0;let n=0;e.beginValid=null!=t.begin,e.endValid=null!=t.end,e.begin=new Array(e.dims),e.end=new Array(e.dims),e.strides=new Array(e.dims),e.finalShapeGatherIndices=[],e.finalShapeGatherIndicesSparse=[],e.inputShapeGatherIndicesSparse=new Array(e.dims);for(let r=0;r<t.dims;r++)if(1<<r&t.ellipsisMask){const i=Math.min(e.dims-(t.dims-r)+1+t.numAddAxisAfterEllipsis,e.dims);for(;n<i;n++)e.begin[n]=0,e.end[n]=0,e.strides[n]=1,e.beginMask|=1<<n,e.endMask|=1<<n,e.finalShapeGatherIndices.push(n),e.finalShapeGatherIndicesSparse.push(-1),e.inputShapeGatherIndicesSparse[n]=r}else if(1<<r&t.newAxisMask)e.finalShapeGatherIndices.push(Ht),e.finalShapeGatherIndicesSparse.push(-1);else{if(n===e.begin.length)throw Error(`Index out of range using input dim ${n}; input `+`has only ${e.dims} dims, ${e.begin.length}.`);null!=t.begin&&(e.begin[n]=t.begin[r]),null!=t.end&&(e.end[n]=t.end[r]),e.strides[n]=t.strides[r],t.beginMask&1<<r&&(e.beginMask|=1<<n),t.endMask&1<<r&&(e.endMask|=1<<n),t.shrinkAxisMask&1<<r?(e.finalShapeGatherIndices.push(Wt),e.finalShapeGatherIndicesSparse.push(-1),e.shrinkAxisMask|=1<<n):(e.finalShapeGatherIndices.push(n),e.finalShapeGatherIndicesSparse.push(r)),e.inputShapeGatherIndicesSparse[n]=r,n++}}(h,d);let p=!0,f=!0,g=!0;const m=[],v=[];for(let e=0;e<t.length;++e){if(0===d.strides[e])throw Error(`strides[${e}] must be non-zero`);const n=!!(d.shrinkAxisMask&1<<e),r=t[e];if(-1===r){m.push(n?1:-1);continue}const i=[d.beginMask&1<<e,d.endMask&1<<e],o=[d.strides[e]>0?0:-1,d.strides[e]>0?r:r-1];if(n&&d.strides[e]<=0)throw Error("only stride 1 allowed on non-range indexing.");g=g&&1===d.strides[e];const s=!!(d.beginMask&1<<e&&d.endMask&1<<e);if(d.beginValid&&d.endValid){if(n){const t=d.begin[e]<0?r+d.begin[e]:d.begin[e];if(d.begin[e]=t,d.end[e]=d.begin[e]+1,t<0||t>=r)throw Error(`slice index ${d.begin[e]} of dimension ${e} out of bounds.`)}else d.begin[e]=ae(d.begin[e],0,d.strides[e],r,i,o),d.end[e]=ae(d.end[e],1,d.strides[e],r,i,o);const t=1===d.strides[e]&&0===d.begin[e]&&d.end[e]===r;p=p&&t,f=f&&(0===e&&1===d.strides[e]||t)}else p=p&&1===d.strides[e]&&s,f=f&&(0===e&&1===d.strides[e]||s);let a,l=!1;if(d.beginValid&&d.endValid?(a=d.end[e]-d.begin[e],l=!0):n?(a=1,l=!0):s&&r>=0&&(a=d.strides[e]<0?-r:r,l=!0),l){let t;t=0===a||a<0!=d.strides[e]<0?0:Math.trunc(a/d.strides[e])+(a%d.strides[e]!=0?1:0),m.push(t)}else m.push(-1)}for(let t=0;t<d.finalShapeGatherIndices.length;++t){const e=d.finalShapeGatherIndices[t];e>=0?v.push(m[e]):e===Ht&&v.push(1)}return{finalShapeSparse:v.filter((t,e)=>d.finalShapeGatherIndices[e]!==Ht),finalShape:v,isIdentity:p,sliceDim0:f,isSimpleSlice:g,begin:d.begin,end:d.end,strides:d.strides}}function ae(t,e,n,r,i,o){if(i[e])return n>0?o[e]:o[e+1&1];{const e=t<0?r+t:t;return e<o[0]?o[0]:e>o[1]?o[1]:e}}
  661. /**
  662. * @license
  663. * Copyright 2018 Google LLC. All Rights Reserved.
  664. * Licensed under the Apache License, Version 2.0 (the "License");
  665. * you may not use this file except in compliance with the License.
  666. * You may obtain a copy of the License at
  667. *
  668. * http://www.apache.org/licenses/LICENSE-2.0
  669. *
  670. * Unless required by applicable law or agreed to in writing, software
  671. * distributed under the License is distributed on an "AS IS" BASIS,
  672. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  673. * See the License for the specific language governing permissions and
  674. * limitations under the License.
  675. * =============================================================================
  676. */class le{getClassName(){return this.constructor.className}static fromConfig(t,e){return new t(e)}}class ue{constructor(){this.classNameMap={}}static getMap(){return null==ue.instance&&(ue.instance=new ue),ue.instance}static register(t){ue.getMap().classNameMap[t.className]=[t,t.fromConfig]}}function ce(t){Object(I.assert)(null!=t.className,()=>"Class being registered does not have the static className property defined."),Object(I.assert)("string"==typeof t.className,()=>"className is required to be a string, but got type "+typeof t.className),Object(I.assert)(t.className.length>0,()=>"Class being registered has an empty-string as its className, which is disallowed."),ue.register(t)}var he=n("jb1O"),de=n("ZD6k");var pe=n("V6aD"),fe=n("ODj2"),ge=n("sfDJ"),me=n("dZfa"),ve=n("m3RX"),be=n("UWMC"),_e=n("Cwm/"),ye=n("9Nf/");
  677. /**
  678. * @license
  679. * Copyright 2018 Google LLC. All Rights Reserved.
  680. * Licensed under the Apache License, Version 2.0 (the "License");
  681. * you may not use this file except in compliance with the License.
  682. * You may obtain a copy of the License at
  683. *
  684. * http://www.apache.org/licenses/LICENSE-2.0
  685. *
  686. * Unless required by applicable law or agreed to in writing, software
  687. * distributed under the License is distributed on an "AS IS" BASIS,
  688. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  689. * See the License for the specific language governing permissions and
  690. * limitations under the License.
  691. * =============================================================================
  692. */
  693. class Te extends le{minimize(t,e=!1,n){const{value:r,grads:i}=this.computeGradients(t,n);if(null!=n){const t=n.map(t=>({name:t.name,tensor:i[t.name]}));this.applyGradients(t)}else this.applyGradients(i);return Object(pe.a)(i),e?r:(r.dispose(),null)}get iterations(){return null==this.iterations_&&(this.iterations_=0),this.iterations_}incrementIterations(){this.iterations_=this.iterations+1}computeGradients(t,e){return Object(ye.b)(t,e)}dispose(){null!=this.iterations_&&Object(pe.a)(this.iterations_)}async saveIterations(){return null==this.iterations_&&(this.iterations_=0),{name:"iter",tensor:Object(ve._54)(this.iterations_,"int32")}}async getWeights(){throw new Error("getWeights() is not implemented for this optimizer yet.")}async setWeights(t){throw new Error("setWeights() is not implemented for this optimizer class "+`${this.getClassName()}`)}async extractIterations(t){return this.iterations_=(await t[0].tensor.data())[0],t.slice(1)}}Object.defineProperty(Te,Symbol.hasInstance,{value:t=>null!=t.minimize&&null!=t.computeGradients&&null!=t.applyGradients});
  694. /**
  695. * @license
  696. * Copyright 2018 Google LLC. All Rights Reserved.
  697. * Licensed under the Apache License, Version 2.0 (the "License");
  698. * you may not use this file except in compliance with the License.
  699. * You may obtain a copy of the License at
  700. *
  701. * http://www.apache.org/licenses/LICENSE-2.0
  702. *
  703. * Unless required by applicable law or agreed to in writing, software
  704. * distributed under the License is distributed on an "AS IS" BASIS,
  705. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  706. * See the License for the specific language governing permissions and
  707. * limitations under the License.
  708. * =============================================================================
  709. */
  710. class xe extends Te{constructor(t,e,n=null){super(),this.learningRate=t,this.rho=e,this.epsilon=n,this.accumulatedGrads=[],this.accumulatedUpdates=[],null==n&&(this.epsilon=d.a.backend.epsilon())}applyGradients(t){(Array.isArray(t)?t.map(t=>t.name):Object.keys(t)).forEach((e,n)=>{const r=d.a.registeredVariables[e];null==this.accumulatedGrads[n]&&(this.accumulatedGrads[n]={originalName:`${e}/accum_grad`,variable:Object(pe.e)(()=>Object(_e.a)(r).variable(!1))}),null==this.accumulatedUpdates[n]&&(this.accumulatedUpdates[n]={originalName:`${e}/accum_var`,variable:Object(pe.e)(()=>Object(_e.a)(r).variable(!1))});const i=Array.isArray(t)?t[n].tensor:t[e];if(null==i)return;const o=this.accumulatedGrads[n].variable,s=this.accumulatedUpdates[n].variable;Object(pe.e)(()=>{const t=Object(fe.a)(Object(me.a)(o,this.rho),Object(me.a)(Object(be.a)(i),1-this.rho)),e=Object(me.a)(Object(ge.a)(Object(ve._69)(Object(fe.a)(s,this.epsilon)),Object(ve._69)(Object(fe.a)(o,this.epsilon))),i),n=Object(fe.a)(Object(me.a)(s,this.rho),Object(me.a)(Object(be.a)(e),1-this.rho));o.assign(t),s.assign(n);const a=Object(fe.a)(Object(me.a)(e,-this.learningRate),r);r.assign(a)})}),this.incrementIterations()}dispose(){null!=this.accumulatedUpdates&&(Object(pe.a)(this.accumulatedGrads.map(t=>t.variable)),Object(pe.a)(this.accumulatedUpdates.map(t=>t.variable)))}async getWeights(){const t=[...this.accumulatedGrads,...this.accumulatedUpdates];return[await this.saveIterations()].concat(t.map(t=>({name:t.originalName,tensor:t.variable})))}async setWeights(t){const e=(t=await this.extractIterations(t)).length/2;this.accumulatedGrads=t.slice(0,e).map(t=>({originalName:t.name,variable:t.tensor.variable(!1)})),this.accumulatedUpdates=t.slice(e,2*e).map(t=>({originalName:t.name,variable:t.tensor.variable(!1)}))}getConfig(){return{learningRate:this.learningRate,rho:this.rho,epsilon:this.epsilon}}static fromConfig(t,e){return new t(e.learningRate,e.rho,e.epsilon)}}xe.className="Adadelta",ce(xe);var Ee=n("Hdl1"),we=n("FUmq");
  711. /**
  712. * @license
  713. * Copyright 2018 Google LLC. All Rights Reserved.
  714. * Licensed under the Apache License, Version 2.0 (the "License");
  715. * you may not use this file except in compliance with the License.
  716. * You may obtain a copy of the License at
  717. *
  718. * http://www.apache.org/licenses/LICENSE-2.0
  719. *
  720. * Unless required by applicable law or agreed to in writing, software
  721. * distributed under the License is distributed on an "AS IS" BASIS,
  722. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  723. * See the License for the specific language governing permissions and
  724. * limitations under the License.
  725. * =============================================================================
  726. */
  727. class Ce extends Te{constructor(t,e=.1){super(),this.learningRate=t,this.initialAccumulatorValue=e,this.accumulatedGrads=[]}applyGradients(t){(Array.isArray(t)?t.map(t=>t.name):Object.keys(t)).forEach((e,n)=>{const r=d.a.registeredVariables[e];if(null==this.accumulatedGrads[n]){const t=!1;this.accumulatedGrads[n]={originalName:`${e}/accumulator`,variable:Object(pe.e)(()=>Object(Ee.a)(r.shape,this.initialAccumulatorValue).variable(t))}}const i=Array.isArray(t)?t[n].tensor:t[e];if(null==i)return;const o=this.accumulatedGrads[n].variable;Object(pe.e)(()=>{const t=Object(fe.a)(o,Object(be.a)(i));o.assign(t);const e=Object(fe.a)(Object(me.a)(Object(ge.a)(i,Object(we.a)(Object(fe.a)(t,d.a.backend.epsilon()))),-this.learningRate),r);r.assign(e)})}),this.incrementIterations()}dispose(){null!=this.accumulatedGrads&&Object(pe.a)(this.accumulatedGrads.map(t=>t.variable))}async getWeights(){return[await this.saveIterations()].concat(this.accumulatedGrads.map(t=>({name:t.originalName,tensor:t.variable})))}async setWeights(t){t=await this.extractIterations(t);this.accumulatedGrads=t.map(t=>({originalName:t.name,variable:t.tensor.variable(!1)}))}getConfig(){return{learningRate:this.learningRate,initialAccumulatorValue:this.initialAccumulatorValue}}static fromConfig(t,e){return new t(e.learningRate,e.initialAccumulatorValue)}}Ce.className="Adagrad",ce(Ce);var Se=n("eNzZ"),ke=n("s2iQ"),Oe=n("6kjP");
  728. /**
  729. * @license
  730. * Copyright 2018 Google LLC. All Rights Reserved.
  731. * Licensed under the Apache License, Version 2.0 (the "License");
  732. * you may not use this file except in compliance with the License.
  733. * You may obtain a copy of the License at
  734. *
  735. * http://www.apache.org/licenses/LICENSE-2.0
  736. *
  737. * Unless required by applicable law or agreed to in writing, software
  738. * distributed under the License is distributed on an "AS IS" BASIS,
  739. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  740. * See the License for the specific language governing permissions and
  741. * limitations under the License.
  742. * =============================================================================
  743. */
  744. class Ie extends Te{constructor(t,e,n,r=null){super(),this.learningRate=t,this.beta1=e,this.beta2=n,this.epsilon=r,this.accumulatedFirstMoment=[],this.accumulatedSecondMoment=[],Object(pe.e)(()=>{this.accBeta1=Object(ke.a)(e).variable(),this.accBeta2=Object(ke.a)(n).variable()}),null==r&&(this.epsilon=d.a.backend.epsilon())}applyGradients(t){const e=Array.isArray(t)?t.map(t=>t.name):Object.keys(t);Object(pe.e)(()=>{const n=Object(Oe.a)(1,this.accBeta1),r=Object(Oe.a)(1,this.accBeta2);e.forEach((e,i)=>{const o=d.a.registeredVariables[e];null==this.accumulatedFirstMoment[i]&&(this.accumulatedFirstMoment[i]={originalName:`${e}/m`,variable:Object(pe.e)(()=>Object(_e.a)(o).variable(!1))}),null==this.accumulatedSecondMoment[i]&&(this.accumulatedSecondMoment[i]={originalName:`${e}/v`,variable:Object(pe.e)(()=>Object(_e.a)(o).variable(!1))});const s=Array.isArray(t)?t[i].tensor:t[e];if(null==s)return;const a=this.accumulatedFirstMoment[i].variable,l=this.accumulatedSecondMoment[i].variable,u=Object(fe.a)(Object(me.a)(a,this.beta1),Object(me.a)(s,1-this.beta1)),c=Object(fe.a)(Object(me.a)(l,this.beta2),Object(me.a)(Object(be.a)(s),1-this.beta2)),h=Object(ge.a)(u,n),p=Object(ge.a)(c,r);a.assign(u),l.assign(c);const f=Object(fe.a)(Object(me.a)(Object(ge.a)(h,Object(fe.a)(Object(we.a)(p),this.epsilon)),-this.learningRate),o);o.assign(f)}),this.accBeta1.assign(Object(me.a)(this.accBeta1,this.beta1)),this.accBeta2.assign(Object(me.a)(this.accBeta2,this.beta2))}),this.incrementIterations()}dispose(){this.accBeta1.dispose(),this.accBeta2.dispose(),null!=this.accumulatedFirstMoment&&Object(pe.a)(this.accumulatedFirstMoment.map(t=>t.variable)),null!=this.accumulatedSecondMoment&&Object(pe.a)(this.accumulatedSecondMoment.map(t=>t.variable))}async getWeights(){const t=[...this.accumulatedFirstMoment,...this.accumulatedSecondMoment];return[await this.saveIterations()].concat(t.map(t=>({name:t.originalName,tensor:t.variable})))}async setWeights(t){t=await this.extractIterations(t),Object(pe.e)(()=>{this.accBeta1.assign(Object(Se.a)(this.beta1,this.iterations_+1)),this.accBeta2.assign(Object(Se.a)(this.beta2,this.iterations_+1))});const e=t.length/2;this.accumulatedFirstMoment=t.slice(0,e).map(t=>({originalName:t.name,variable:t.tensor.variable(!1)})),this.accumulatedSecondMoment=t.slice(e,2*e).map(t=>({originalName:t.name,variable:t.tensor.variable(!1)}))}getConfig(){return{learningRate:this.learningRate,beta1:this.beta1,beta2:this.beta2,epsilon:this.epsilon}}static fromConfig(t,e){return new t(e.learningRate,e.beta1,e.beta2,e.epsilon)}}Ie.className="Adam",ce(Ie);var Re=n("BVpN"),Ae=n("dHLy");
  745. /**
  746. * @license
  747. * Copyright 2018 Google LLC. All Rights Reserved.
  748. * Licensed under the Apache License, Version 2.0 (the "License");
  749. * you may not use this file except in compliance with the License.
  750. * You may obtain a copy of the License at
  751. *
  752. * http://www.apache.org/licenses/LICENSE-2.0
  753. *
  754. * Unless required by applicable law or agreed to in writing, software
  755. * distributed under the License is distributed on an "AS IS" BASIS,
  756. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  757. * See the License for the specific language governing permissions and
  758. * limitations under the License.
  759. * =============================================================================
  760. */
  761. class Ne extends Te{constructor(t,e,n,r=null,i=0){super(),this.learningRate=t,this.beta1=e,this.beta2=n,this.epsilon=r,this.decay=i,this.accumulatedFirstMoment=[],this.accumulatedWeightedInfNorm=[],Object(pe.e)(()=>{this.iteration=Object(ke.a)(0).variable(),this.accBeta1=Object(ke.a)(e).variable()}),null==r&&(this.epsilon=d.a.backend.epsilon())}applyGradients(t){const e=Array.isArray(t)?t.map(t=>t.name):Object.keys(t);Object(pe.e)(()=>{const n=Object(Oe.a)(1,this.accBeta1),r=Object(ge.a)(-this.learningRate,Object(fe.a)(Object(me.a)(this.iteration,this.decay),1));e.forEach((e,i)=>{const o=d.a.registeredVariables[e];null==this.accumulatedFirstMoment[i]&&(this.accumulatedFirstMoment[i]={originalName:`${e}/m`,variable:Object(_e.a)(o).variable(!1)}),null==this.accumulatedWeightedInfNorm[i]&&(this.accumulatedWeightedInfNorm[i]={originalName:`${e}/v`,variable:Object(_e.a)(o).variable(!1)});const s=Array.isArray(t)?t[i].tensor:t[e];if(null==s)return;const a=this.accumulatedFirstMoment[i].variable,l=this.accumulatedWeightedInfNorm[i].variable,u=Object(fe.a)(Object(me.a)(a,this.beta1),Object(me.a)(s,1-this.beta1)),c=Object(me.a)(l,this.beta2),h=Object(Re.a)(s),p=Object(Ae.a)(c,h);a.assign(u),l.assign(p);const f=Object(fe.a)(Object(me.a)(Object(ge.a)(r,n),Object(ge.a)(u,Object(fe.a)(p,this.epsilon))),o);o.assign(f)}),this.iteration.assign(Object(fe.a)(this.iteration,1)),this.accBeta1.assign(Object(me.a)(this.accBeta1,this.beta1))}),this.incrementIterations()}dispose(){this.accBeta1.dispose(),this.iteration.dispose(),null!=this.accumulatedFirstMoment&&Object(pe.a)(this.accumulatedFirstMoment.map(t=>t.variable)),null!=this.accumulatedWeightedInfNorm&&Object(pe.a)(this.accumulatedWeightedInfNorm.map(t=>t.variable))}async getWeights(){throw new Error("getWeights() is not implemented for Adamax yet.")}async setWeights(t){throw new Error("setWeights() is not implemented for Adamax yet.")}getConfig(){return{learningRate:this.learningRate,beta1:this.beta1,beta2:this.beta2,epsilon:this.epsilon,decay:this.decay}}static fromConfig(t,e){return new t(e.learningRate,e.beta1,e.beta2,e.epsilon,e.decay)}}Ne.className="Adamax",ce(Ne);
  762. /**
  763. * @license
  764. * Copyright 2018 Google LLC. All Rights Reserved.
  765. * Licensed under the Apache License, Version 2.0 (the "License");
  766. * you may not use this file except in compliance with the License.
  767. * You may obtain a copy of the License at
  768. *
  769. * http://www.apache.org/licenses/LICENSE-2.0
  770. *
  771. * Unless required by applicable law or agreed to in writing, software
  772. * distributed under the License is distributed on an "AS IS" BASIS,
  773. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  774. * See the License for the specific language governing permissions and
  775. * limitations under the License.
  776. * =============================================================================
  777. */
  778. class De extends Te{constructor(t){super(),this.learningRate=t,this.setLearningRate(t)}applyGradients(t){(Array.isArray(t)?t.map(t=>t.name):Object.keys(t)).forEach((e,n)=>{const r=Array.isArray(t)?t[n].tensor:t[e];if(null==r)return;const i=d.a.registeredVariables[e];Object(pe.e)(()=>{const t=Object(fe.a)(Object(me.a)(this.c,r),i);i.assign(t)})}),this.incrementIterations()}setLearningRate(t){this.learningRate=t,null!=this.c&&this.c.dispose(),this.c=Object(pe.c)(Object(ke.a)(-t))}dispose(){this.c.dispose()}async getWeights(){return[await this.saveIterations()]}async setWeights(t){if(0!==(t=await this.extractIterations(t)).length)throw new Error("SGD optimizer does not have settable weights.")}getConfig(){return{learningRate:this.learningRate}}static fromConfig(t,e){return new t(e.learningRate)}}De.className="SGD",ce(De);
  779. /**
  780. * @license
  781. * Copyright 2018 Google LLC. All Rights Reserved.
  782. * Licensed under the Apache License, Version 2.0 (the "License");
  783. * you may not use this file except in compliance with the License.
  784. * You may obtain a copy of the License at
  785. *
  786. * http://www.apache.org/licenses/LICENSE-2.0
  787. *
  788. * Unless required by applicable law or agreed to in writing, software
  789. * distributed under the License is distributed on an "AS IS" BASIS,
  790. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  791. * See the License for the specific language governing permissions and
  792. * limitations under the License.
  793. * =============================================================================
  794. */
  795. class Me extends De{constructor(t,e,n=!1){super(t),this.learningRate=t,this.momentum=e,this.useNesterov=n,this.accumulations=[],this.m=Object(ke.a)(this.momentum)}applyGradients(t){(Array.isArray(t)?t.map(t=>t.name):Object.keys(t)).forEach((e,n)=>{const r=d.a.registeredVariables[e];if(null==this.accumulations[n]){const t=!1;this.accumulations[n]={originalName:`${e}/momentum`,variable:Object(pe.e)(()=>Object(_e.a)(r).variable(t))}}const i=this.accumulations[n].variable,o=Array.isArray(t)?t[n].tensor:t[e];null!=o&&Object(pe.e)(()=>{let t;const e=Object(fe.a)(Object(me.a)(this.m,i),o);t=this.useNesterov?Object(fe.a)(Object(me.a)(this.c,Object(fe.a)(o,Object(me.a)(e,this.m))),r):Object(fe.a)(Object(me.a)(this.c,e),r),i.assign(e),r.assign(t)})}),this.incrementIterations()}dispose(){this.m.dispose(),null!=this.accumulations&&Object(pe.a)(this.accumulations.map(t=>t.variable))}setMomentum(t){this.momentum=t}async getWeights(){return[await this.saveIterations()].concat(this.accumulations.map(t=>({name:t.originalName,tensor:t.variable})))}async setWeights(t){t=await this.extractIterations(t);this.accumulations=t.map(t=>({originalName:t.name,variable:t.tensor.variable(!1)}))}getConfig(){return{learningRate:this.learningRate,momentum:this.momentum,useNesterov:this.useNesterov}}static fromConfig(t,e){return new t(e.learningRate,e.momentum,e.useNesterov)}}Me.className="Momentum",ce(Me);
  796. /**
  797. * @license
  798. * Copyright 2018 Google LLC. All Rights Reserved.
  799. * Licensed under the Apache License, Version 2.0 (the "License");
  800. * you may not use this file except in compliance with the License.
  801. * You may obtain a copy of the License at
  802. *
  803. * http://www.apache.org/licenses/LICENSE-2.0
  804. *
  805. * Unless required by applicable law or agreed to in writing, software
  806. * distributed under the License is distributed on an "AS IS" BASIS,
  807. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  808. * See the License for the specific language governing permissions and
  809. * limitations under the License.
  810. * =============================================================================
  811. */
  812. class Le extends Te{constructor(t,e=.9,n=0,r=null,i=!1){if(super(),this.learningRate=t,this.decay=e,this.momentum=n,this.epsilon=r,this.accumulatedMeanSquares=[],this.accumulatedMoments=[],this.accumulatedMeanGrads=[],this.centered=i,null==r&&(this.epsilon=d.a.backend.epsilon()),null==t)throw new Error("learningRate for RMSPropOptimizer must be defined.")}applyGradients(t){(Array.isArray(t)?t.map(t=>t.name):Object.keys(t)).forEach((e,n)=>{const r=d.a.registeredVariables[e];null==this.accumulatedMeanSquares[n]&&(this.accumulatedMeanSquares[n]={originalName:`${e}/rms`,variable:Object(pe.e)(()=>Object(_e.a)(r).variable(!1))}),null==this.accumulatedMoments[n]&&(this.accumulatedMoments[n]={originalName:`${e}/momentum`,variable:Object(pe.e)(()=>Object(_e.a)(r).variable(!1))}),null==this.accumulatedMeanGrads[n]&&this.centered&&(this.accumulatedMeanGrads[n]={originalName:`${e}/mg`,variable:Object(pe.e)(()=>Object(_e.a)(r).variable(!1))});const i=Array.isArray(t)?t[n].tensor:t[e];if(null==i)return;const o=this.accumulatedMeanSquares[n].variable,s=this.accumulatedMoments[n].variable;Object(pe.e)(()=>{const t=Object(fe.a)(Object(me.a)(o,this.decay),Object(me.a)(Object(be.a)(i),1-this.decay));if(this.centered){const e=this.accumulatedMeanGrads[n].variable,a=Object(fe.a)(Object(me.a)(e,this.decay),Object(me.a)(i,1-this.decay)),l=Object(ge.a)(Object(me.a)(i,this.learningRate),Object(we.a)(Object(Oe.a)(t,Object(fe.a)(Object(be.a)(a),this.epsilon)))),u=Object(fe.a)(Object(me.a)(s,this.momentum),l);o.assign(t),e.assign(a),s.assign(u);const c=Object(Oe.a)(r,u);r.assign(c)}else{const t=Object(fe.a)(Object(me.a)(o,this.decay),Object(me.a)(Object(be.a)(i),1-this.decay)),e=Object(fe.a)(Object(me.a)(s,this.momentum),Object(ge.a)(Object(me.a)(i,this.learningRate),Object(we.a)(Object(fe.a)(t,this.epsilon))));o.assign(t),s.assign(e);const n=Object(Oe.a)(r,e);r.assign(n)}})}),this.incrementIterations()}dispose(){null!=this.accumulatedMeanSquares&&Object(pe.a)(this.accumulatedMeanSquares.map(t=>t.variable)),null!=this.accumulatedMeanGrads&&this.centered&&Object(pe.a)(this.accumulatedMeanGrads.map(t=>t.variable)),null!=this.accumulatedMoments&&Object(pe.a)(this.accumulatedMoments.map(t=>t.variable))}async getWeights(){const t=[...this.accumulatedMeanSquares,...this.accumulatedMoments];return this.centered&&t.push(...this.accumulatedMeanGrads),[await this.saveIterations()].concat(t.map(t=>({name:t.originalName,tensor:t.variable})))}async setWeights(t){t=await this.extractIterations(t);const e=this.centered?t.length/3:t.length/2;this.accumulatedMeanSquares=t.slice(0,e).map(t=>({originalName:t.name,variable:t.tensor.variable(!1)})),this.accumulatedMoments=t.slice(e,2*e).map(t=>({originalName:t.name,variable:t.tensor.variable(!1)})),this.centered&&(this.accumulatedMeanGrads=t.slice(2*e,3*e).map(t=>({originalName:t.name,variable:t.tensor.variable(!1)})))}getConfig(){return{learningRate:this.learningRate,decay:this.decay,momentum:this.momentum,epsilon:this.epsilon,centered:this.centered}}static fromConfig(t,e){return new t(e.learningRate,e.decay,e.momentum,e.epsilon,e.centered)}}Le.className="RMSProp",ce(Le);
  813. /**
  814. * @license
  815. * Copyright 2018 Google LLC. All Rights Reserved.
  816. * Licensed under the Apache License, Version 2.0 (the "License");
  817. * you may not use this file except in compliance with the License.
  818. * You may obtain a copy of the License at
  819. *
  820. * http://www.apache.org/licenses/LICENSE-2.0
  821. *
  822. * Unless required by applicable law or agreed to in writing, software
  823. * distributed under the License is distributed on an "AS IS" BASIS,
  824. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  825. * See the License for the specific language governing permissions and
  826. * limitations under the License.
  827. * =============================================================================
  828. */
  829. class Pe{static sgd(t){return new De(t)}static momentum(t,e,n=!1){return new Me(t,e,n)}static rmsprop(t,e=.9,n=0,r=null,i=!1){return new Le(t,e,n,r,i)}static adam(t=.001,e=.9,n=.999,r=null){return new Ie(t,e,n,r)}static adadelta(t=.001,e=.95,n=null){return new xe(t,e,n)}static adamax(t=.002,e=.9,n=.999,r=null,i=0){return new Ne(t,e,n,r,i)}static adagrad(t,e=.1){return new Ce(t,e)}}var Fe=n("3goy"),Be=n("HOGz");const je={sgd:Pe.sgd,momentum:Pe.momentum,adadelta:Pe.adadelta,adagrad:Pe.adagrad,rmsprop:Pe.rmsprop,adamax:Pe.adamax,adam:Pe.adam},$e=(()=>"undefined"!=typeof requestAnimationFrame?requestAnimationFrame:"undefined"!=typeof setImmediate?setImmediate:t=>t())();
  830. /**
  831. * @license
  832. * Copyright 2017 Google LLC. All Rights Reserved.
  833. * Licensed under the Apache License, Version 2.0 (the "License");
  834. * you may not use this file except in compliance with the License.
  835. * You may obtain a copy of the License at
  836. *
  837. * http://www.apache.org/licenses/LICENSE-2.0
  838. *
  839. * Unless required by applicable law or agreed to in writing, software
  840. * distributed under the License is distributed on an "AS IS" BASIS,
  841. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  842. * See the License for the specific language governing permissions and
  843. * limitations under the License.
  844. * =============================================================================
  845. */function Ue(){return new Promise(t=>$e(()=>t()))}var Ve=n("DqkE");
  846. /**
  847. * @license
  848. * Copyright 2017 Google LLC. All Rights Reserved.
  849. * Licensed under the Apache License, Version 2.0 (the "License");
  850. * you may not use this file except in compliance with the License.
  851. * You may obtain a copy of the License at
  852. *
  853. * http://www.apache.org/licenses/LICENSE-2.0
  854. *
  855. * Unless required by applicable law or agreed to in writing, software
  856. * distributed under the License is distributed on an "AS IS" BASIS,
  857. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  858. * See the License for the specific language governing permissions and
  859. * limitations under the License.
  860. * =============================================================================
  861. */function He(t,e){const n=t[0].length;t.forEach((t,e)=>{I.assert(t.length===n,()=>`Error in concat${n}D: rank of tensors[${e}] must be the same `+`as the rank of the rest (${n})`)}),I.assert(e>=0&&e<n,()=>`Error in concat${n}D: axis must be between 0 and ${n-1}.`);const r=t[0];t.forEach((t,i)=>{for(let o=0;o<n;o++)I.assert(o===e||t[o]===r[o],()=>`Error in concat${n}D: Shape of tensors[${i}] (${t}) `+`does not match the shape of the rest (${r}) `+`along the non-concatenated axis ${i}.`)})}function We(t,e){const n=t[0].slice();for(let r=1;r<t.length;r++)n[e]+=t[r][e];return n}var Ge=n("Hjly"),ze=n("egTW");
  862. /**
  863. * @license
  864. * Copyright 2017 Google LLC. All Rights Reserved.
  865. * Licensed under the Apache License, Version 2.0 (the "License");
  866. * you may not use this file except in compliance with the License.
  867. * You may obtain a copy of the License at
  868. *
  869. * http://www.apache.org/licenses/LICENSE-2.0
  870. *
  871. * Unless required by applicable law or agreed to in writing, software
  872. * distributed under the License is distributed on an "AS IS" BASIS,
  873. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  874. * See the License for the specific language governing permissions and
  875. * limitations under the License.
  876. * =============================================================================
  877. */
  878. const Xe=30;function Ke(t){return t<=Xe?t:Object(I.nearestDivisor)(t,Math.floor(Math.sqrt(t)))}
  879. /**
  880. * @license
  881. * Copyright 2020 Google LLC. All Rights Reserved.
  882. * Licensed under the Apache License, Version 2.0 (the "License");
  883. * you may not use this file except in compliance with the License.
  884. * You may obtain a copy of the License at
  885. *
  886. * http://www.apache.org/licenses/LICENSE-2.0
  887. *
  888. * Unless required by applicable law or agreed to in writing, software
  889. * distributed under the License is distributed on an "AS IS" BASIS,
  890. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  891. * See the License for the specific language governing permissions and
  892. * limitations under the License.
  893. * =============================================================================
  894. */function Ye(t,e,n){return[n*("number"==typeof t?t:t[0]),e*("number"==typeof t?t:t[1])]}
  895. /**
  896. * @license
  897. * Copyright 2018 Google LLC. All Rights Reserved.
  898. * Licensed under the Apache License, Version 2.0 (the "License");
  899. * you may not use this file except in compliance with the License.
  900. * You may obtain a copy of the License at
  901. *
  902. * http://www.apache.org/licenses/LICENSE-2.0
  903. *
  904. * Unless required by applicable law or agreed to in writing, software
  905. * distributed under the License is distributed on an "AS IS" BASIS,
  906. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  907. * See the License for the specific language governing permissions and
  908. * limitations under the License.
  909. * =============================================================================
  910. */function qe(t,e,n,r=!0){let i=[];if(r)(i=i.concat(e.slice(0))).push(t[0]/n),i=i.concat(t.slice(1));else{i=i.concat(t[0]);const n=e.length;for(let r=0;r<n;++r)i=i.concat([t[r+1]/e[r],e[r]]);i=i.concat(t.slice(n+1))}return i}function Je(t,e,n=!0){const r=[];if(n){r.push(e);for(let n=e+1;n<t;++n)n<=2*e?(r.push(n),r.push(n-(e+1))):r.push(n)}else{const n=[],i=[];for(let r=1;r<t;++r)r>=2*e+1||r%2==1?i.push(r):n.push(r);r.push(...n),r.push(0),r.push(...i)}return r}function Ze(t,e,n,r=!0){const i=[];r?i.push(t[0]/n):i.push(t[0]*n);for(let n=1;n<t.length;++n)n<=e.length?r?i.push(e[n-1]*t[n]):i.push(t[n]/e[n-1]):i.push(t[n]);return i}function Qe(t,e){const n=[0];for(let r=0;r<e;++r)n.push(t[r][0]);return n}function tn(t,e,n){const r=t.slice(0,1);for(let i=0;i<n;++i)r.push(t[i+1]-e[i][0]-e[i][1]);return r}
  911. /**
  912. * @license
  913. * Copyright 2018 Google LLC. All Rights Reserved.
  914. * Licensed under the Apache License, Version 2.0 (the "License");
  915. * you may not use this file except in compliance with the License.
  916. * You may obtain a copy of the License at
  917. *
  918. * http://www.apache.org/licenses/LICENSE-2.0
  919. *
  920. * Unless required by applicable law or agreed to in writing, software
  921. * distributed under the License is distributed on an "AS IS" BASIS,
  922. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  923. * See the License for the specific language governing permissions and
  924. * limitations under the License.
  925. * =============================================================================
  926. */const en=1.7580993408473768,nn=1.0507009873554805,rn=.3275911,on=.254829592,sn=-.284496736,an=1.421413741,ln=-1.453152027,un=1.061405429;var cn=n("QSAg");
  927. /**
  928. * @license
  929. * Copyright 2018 Google LLC. All Rights Reserved.
  930. * Licensed under the Apache License, Version 2.0 (the "License");
  931. * you may not use this file except in compliance with the License.
  932. * You may obtain a copy of the License at
  933. *
  934. * http://www.apache.org/licenses/LICENSE-2.0
  935. *
  936. * Unless required by applicable law or agreed to in writing, software
  937. * distributed under the License is distributed on an "AS IS" BASIS,
  938. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  939. * See the License for the specific language governing permissions and
  940. * limitations under the License.
  941. * =============================================================================
  942. */function hn(t,e){if(t.length!==e.length)throw new Error("Cannot merge real and imag arrays of different lengths. real:"+`${t.length}, imag: ${e.length}.`);const n=new Float32Array(2*t.length);for(let r=0;r<n.length;r+=2)n[r]=t[r/2],n[r+1]=e[r/2];return n}function dn(t){const e=new Float32Array(t.length/2),n=new Float32Array(t.length/2);for(let r=0;r<t.length;r+=2)e[r/2]=t[r],n[r/2]=t[r+1];return{real:e,imag:n}}function pn(t){const e=Math.ceil(t.length/4),n=new Float32Array(e),r=new Float32Array(e);for(let e=0;e<t.length;e+=4)n[Math.floor(e/4)]=t[e],r[Math.floor(e/4)]=t[e+1];return{real:n,imag:r}}function fn(t){const e=Math.floor(t.length/4),n=new Float32Array(e),r=new Float32Array(e);for(let e=2;e<t.length;e+=4)n[Math.floor(e/4)]=t[e],r[Math.floor(e/4)]=t[e+1];return{real:n,imag:r}}function gn(t,e){return{real:t[2*e],imag:t[2*e+1]}}function mn(t,e,n,r){t[2*r]=e,t[2*r+1]=n}function vn(t,e){const n=new Float32Array(t/2),r=new Float32Array(t/2);for(let i=0;i<Math.ceil(t/2);i++){const o=(e?2:-2)*Math.PI*(i/t);n[i]=Math.cos(o),r[i]=Math.sin(o)}return{real:n,imag:r}}function bn(t,e,n){const r=(n?2:-2)*Math.PI*(t/e);return{real:Math.cos(r),imag:Math.sin(r)}}var _n=n("DYVU");
  943. /**
  944. * @license
  945. * Copyright 2021 Google LLC. All Rights Reserved.
  946. * Licensed under the Apache License, Version 2.0 (the "License");
  947. * you may not use this file except in compliance with the License.
  948. * You may obtain a copy of the License at
  949. *
  950. * http://www.apache.org/licenses/LICENSE-2.0
  951. *
  952. * Unless required by applicable law or agreed to in writing, software
  953. * distributed under the License is distributed on an "AS IS" BASIS,
  954. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  955. * See the License for the specific language governing permissions and
  956. * limitations under the License.
  957. * =============================================================================
  958. */const yn="->",Tn=/->/g,xn=",",En="...";function wn(t,e){const n=((t=t.replace(/\s/g,"")).length-t.replace(Tn,"").length)/yn.length;if(n<1)throw new Error("Equations without an arrow are not supported.");if(n>1)throw new Error(`Equation must contain exactly one arrow ("${yn}").`);const[r,i]=t.split(yn);Object(_n.b)(-1===r.indexOf(En),()=>`The ellipsis notation ("${En}") is not supported yet.`);const o=r.split(xn),s=o.length;if(e!==s)throw new Error(`Expected ${s} input tensors, received ${e}`);if(s>2)throw new Error("Support for more than 2 input tensors is not implemented yet.");const a=[];for(let t=0;t<i.length;++t){const e=i[t];if(!o.some(t=>-1!==t.indexOf(e)))throw new Error(`Output subscripts contain the label ${e} `+"not present in the input subscripts.");-1===a.indexOf(e)&&a.push(e)}for(let t=0;t<r.length;++t){const e=r[t];-1===a.indexOf(e)&&e!==xn&&a.push(e)}const l=new Array(o.length);for(let t=0;t<s;++t){if(new Set(o[t].split("")).size!==o[t].length)throw new Error(`Found duplicate axes in input component ${o[t]}. `+"Support for duplicate axes in input is not implemented yet.");l[t]=[];for(let e=0;e<o[t].length;++e)l[t].push(a.indexOf(o[t][e]))}const u=a.length,c=[];for(let t=i.length;t<u;++t)c.push(t);return{allDims:a,summedDims:c,idDims:l}}function Cn(t,e){let n=new Array(t);n.fill(-1);for(let t=0;t<e.length;++t)n[e[t]]=t;const r=[];for(let e=0;e<t;++e)-1===n[e]&&r.push(e);return{permutationIndices:n=n.filter(t=>-1!==t),expandDims:r}}function Sn(t,e,n){const r=new Array(t);for(let t=0;t<n.length;++t){const i=n[t].shape;for(let n=0;n<e[t].length;++n)void 0===r[e[t][n]]?r[e[t][n]]=i[n]:Object(_n.b)(r[e[t][n]]===i[n],()=>`Expected dimension ${r[e[t][n]]} at axis ${n} `+`of input shaped ${JSON.stringify(i)}, `+`but got dimension ${i[n]}`)}}function kn(t,e){const n=t,r=[];let i=0;0===t.length&&n.push(-1),i=t.length+1;for(let t=0;t<i;++t)r.push([]);const o=[];for(let t=0;t<n.length;++t){const i=In(e,n[t]);for(const e of i)-1===o.indexOf(e)&&(r[t].push(e),o.push(e))}return{path:n,steps:r}}function On(t){return t.every((t,e)=>t===e)}function In(t,e){const n=[];for(let r=0;r<t.length;++r)0!==t[r].length&&-1===t[r].indexOf(e)&&-1!==e||n.push(r);return n}function Rn(t,e,n=0){let r=[];if("number"==typeof e)Object(I.assert)(t.shape[n]%e==0,()=>"Number of splits must evenly divide the axis."),r=new Array(e).fill(t.shape[n]/e);else{const i=e.reduce((t,e)=>(-1===e&&(t+=1),t),0);Object(I.assert)(i<=1,()=>"There should be only one negative value in split array.");const o=e.indexOf(-1);if(-1!==o){const r=e.reduce((t,e)=>e>0?t+e:t);e[o]=t.shape[n]-r}Object(I.assert)(t.shape[n]===e.reduce((t,e)=>t+e),()=>"The sum of sizes must match the size of the axis dimension."),r=e}return r}
  959. /**
  960. * @license
  961. * Copyright 2021 Google LLC. All Rights Reserved.
  962. * Licensed under the Apache License, Version 2.0 (the "License");
  963. * you may not use this file except in compliance with the License.
  964. * You may obtain a copy of the License at
  965. *
  966. * http://www.apache.org/licenses/LICENSE-2.0
  967. *
  968. * Unless required by applicable law or agreed to in writing, software
  969. * distributed under the License is distributed on an "AS IS" BASIS,
  970. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  971. * See the License for the specific language governing permissions and
  972. * limitations under the License.
  973. * =============================================================================
  974. */function An(t){return`Received SparseTensor with denseShape[0] = 0 but\n indices.shape[0] = ${t}`}function Nn(t,e){return`indices(${t}, 0) is invalid: ${e} < 0`}function Dn(t,e,n){return`indices(${t}, 0) is invalid: ${e} >= ${n}`}
  975. /**
  976. * @license
  977. * Copyright 2021 Google LLC. All Rights Reserved.
  978. * Licensed under the Apache License, Version 2.0 (the "License");
  979. * you may not use this file except in compliance with the License.
  980. * You may obtain a copy of the License at
  981. *
  982. * http://www.apache.org/licenses/LICENSE-2.0
  983. *
  984. * Unless required by applicable law or agreed to in writing, software
  985. * distributed under the License is distributed on an "AS IS" BASIS,
  986. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  987. * See the License for the specific language governing permissions and
  988. * limitations under the License.
  989. * =============================================================================
  990. */function Mn(t,e){return`only one output dimension may be -1, not both ${t} and ${e}`}function Ln(t,e){return`size ${t} must be non-negative, not ${e}`}function Pn(){return"reshape cannot infer the missing input size for an empty tensor unless all specified input sizes are non-zero"}function Fn(t,e){return`Input to reshape is a SparseTensor with ${Object(I.sizeFromShape)(t)}\n dense values, but the requested shape requires a multiple of ${Object(I.sizeFromShape)(e)}. inputShape=${t} outputShape= ${e}`}function Bn(t,e){return`Input to reshape is a tensor with ${Object(I.sizeFromShape)(t)} dense values, but the requested shape has ${Object(I.sizeFromShape)(e)}. inputShape=${t} outputShape=${e}`}
  991. /**
  992. * @license
  993. * Copyright 2021 Google LLC. All Rights Reserved.
  994. * Licensed under the Apache License, Version 2.0 (the "License");
  995. * you may not use this file except in compliance with the License.
  996. * You may obtain a copy of the License at
  997. *
  998. * http://www.apache.org/licenses/LICENSE-2.0
  999. *
  1000. * Unless required by applicable law or agreed to in writing, software
  1001. * distributed under the License is distributed on an "AS IS" BASIS,
  1002. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1003. * See the License for the specific language governing permissions and
  1004. * limitations under the License.
  1005. * =============================================================================
  1006. */function jn(){return"segment ids must be >= 0"}function $n(){return"segment ids are not increasing"}function Un(t,e){return`Segment id ${t} out of range [0, ${e}), possibly because segmentIds input is not sorted.`}function Vn(t,e,n){return`Bad: indices[${t}] == ${e} out of range [0, ${n})`}
  1007. /**
  1008. * @license
  1009. * Copyright 2018 Google LLC. All Rights Reserved.
  1010. * Licensed under the Apache License, Version 2.0 (the "License");
  1011. * you may not use this file except in compliance with the License.
  1012. * You may obtain a copy of the License at
  1013. *
  1014. * http://www.apache.org/licenses/LICENSE-2.0
  1015. *
  1016. * Unless required by applicable law or agreed to in writing, software
  1017. * distributed under the License is distributed on an "AS IS" BASIS,
  1018. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1019. * See the License for the specific language governing permissions and
  1020. * limitations under the License.
  1021. * =============================================================================
  1022. */function Hn(t,e){let n,r=!1;for(t<=Xe?(n=t,r=!0):n=Object(I.nearestDivisor)(t,Math.floor(Math.sqrt(t)));!r;)n>e||n===t?r=!0:n=Object(I.nearestDivisor)(t,n+1);return n}function Wn(t,e,n){const r=[],i=t.length;for(let o=0;o<i;o++)o!==e?r.push(t[o]):r.push(n);return r}function Gn(t,e,n,r){const i=e.shape.length,o=t.shape.length;if(0!==r&&(r<-i||r>i))throw new Error(`Expect batchDims in the range of [-${i}, ${i}], but got ${r}`);if(r<0&&(r+=i),r>o)throw new Error(`batchDims (${r}) must be less than rank(x) (\n ${o}).`);if(n<r)throw new Error(`batchDims (${r}) must be less than or equal to axis (${n}).`);for(let n=0;n<r;++n)if(t.shape[n]!==e.shape[n])throw new Error(`x.shape[${n}]: ${t.shape[n]} should be equal to indices.shape[${n}]: ${e.shape[n]}.`);const s=t.shape[n],a=[];let l=1,u=1,c=1;for(let e=0;e<r;++e)a.push(t.shape[e]),l*=t.shape[e];for(let e=r;e<n;e++)a.push(t.shape[e]),u*=t.shape[e];for(let t=r;t<i;t++)a.push(e.shape[t]);for(let e=n+1;e<o;e++)a.push(t.shape[e]),c*=t.shape[e];return{batchSize:l,sliceSize:c,outerSize:u,dimSize:s,outputShape:a}}
  1023. /**
  1024. * @license
  1025. * Copyright 2018 Google LLC. All Rights Reserved.
  1026. * Licensed under the Apache License, Version 2.0 (the "License");
  1027. * you may not use this file except in compliance with the License.
  1028. * You may obtain a copy of the License at
  1029. *
  1030. * http://www.apache.org/licenses/LICENSE-2.0
  1031. *
  1032. * Unless required by applicable law or agreed to in writing, software
  1033. * distributed under the License is distributed on an "AS IS" BASIS,
  1034. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1035. * See the License for the specific language governing permissions and
  1036. * limitations under the License.
  1037. * =============================================================================
  1038. */function zn(t){try{return t.map(t=>Object(I.decodeString)(t))}catch(t){throw new Error(`Failed to decode encoded string bytes into utf-8, error: ${t}`)}}function Xn(t){return t.map(t=>Object(I.encodeString)(t))}var Kn=n("kESI"),Yn=n("7Mdl"),qn=n("cTqU"),Jn=n("ngdQ");
  1039. /**
  1040. * @license
  1041. * Copyright 2020 Google Inc. All Rights Reserved.
  1042. * Licensed under the Apache License, Version 2.0 (the "License");
  1043. * you may not use this file except in compliance with the License.
  1044. * You may obtain a copy of the License at
  1045. *
  1046. * http://www.apache.org/licenses/LICENSE-2.0
  1047. *
  1048. * Unless required by applicable law or agreed to in writing, software
  1049. * distributed under the License is distributed on an "AS IS" BASIS,
  1050. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1051. * See the License for the specific language governing permissions and
  1052. * limitations under the License.
  1053. * =============================================================================
  1054. */n.d(e,!1,function(){return xe}),n.d(e,!1,function(){return Ce}),n.d(e,!1,function(){return Ie}),n.d(e,!1,function(){return Ne}),n.d(e,!1,function(){return Me}),n.d(e,!1,function(){return Te}),n.d(e,!1,function(){return Pe}),n.d(e,!1,function(){return Le}),n.d(e,!1,function(){return De}),n.d(e,"_103",function(){return tt.a}),n.d(e,"_104",function(){return tt.b}),n.d(e,!1,function(){return tt.c}),n.d(e,!1,function(){}),n.d(e,"_145",function(){return Fe.a}),n.d(e,"_151",function(){return Fe.b}),n.d(e,!1,function(){return Be.a}),n.d(e,!1,function(){return ye.a}),n.d(e,!1,function(){}),n.d(e,!1,function(){}),n.d(e,!1,function(){}),n.d(e,!1,function(){}),n.d(e,!1,function(){return ye.b}),n.d(e,!1,function(){return p.a}),n.d(e,"_127",function(){return p.b}),n.d(e,!1,function(){}),n.d(e,!1,function(){return"3.14.0"}),n.d(e,!1,function(){return Ue}),n.d(e,"_117",function(){return o}),n.d(e,"_131",function(){return r}),n.d(e,!1,function(){return i}),n.d(e,!1,function(){return l}),n.d(e,!1,function(){return de}),n.d(e,"_152",function(){return I}),n.d(e,"_115",function(){return c}),n.d(e,"_116",function(){return At}),n.d(e,!1,function(){return he}),n.d(e,"_141",function(){return a}),n.d(e,!1,function(){return s}),n.d(e,!1,function(){return Vt}),n.d(e,"_123",function(){return Kn}),n.d(e,"_133",function(){return h}),n.d(e,"_21",function(){return Jn.b}),n.d(e,"M",function(){return Jn.a}),n.d(e,!1,function(){return ve.a}),n.d(e,!1,function(){return ve.b}),n.d(e,!1,function(){return ve.c}),n.d(e,"_114",function(){return ve.d}),n.d(e,!1,function(){return ve.e}),n.d(e,!1,function(){return ve.f}),n.d(e,!1,function(){return ve.g}),n.d(e,!1,function(){return ve.h}),n.d(e,!1,function(){return ve.i}),n.d(e,!1,function(){return ve.j}),n.d(e,!1,function(){return ve.k}),n.d(e,!1,function(){return ve.l}),n.d(e,!1,function(){return ve.m}),n.d(e,!1,function(){return ve.n}),n.d(e,!1,function(){return ve.o}),n.d(e,!1,function(){return ve.p}),n.d(e,!1,function(){}),n.d(e,!1,function(){return ve.r}),n.d(e,!1,function(){return ve.q}),n.d(e,!1,function(){}),n.d(e,!1,function(){}),n.d(e,!1,function(){}),n.d(e,!1,function(){return ve.s}),n.d(e,!1,function(){return ve.t}),n.d(e,!1,function(){return ve.u}),n.d(e,"_118",function(){return ve.v}),n.d(e,"_119",function(){return ve.w}),n.d(e,!1,function(){return ve.x}),n.d(e,"_120",function(){return ve.y}),n.d(e,"_121",function(){return ve.z}),n.d(e,!1,function(){return ve.A}),n.d(e,"_122",function(){return ve.B}),n.d(e,!1,function(){}),n.d(e,!1,function(){}),n.d(e,!1,function(){}),n.d(e,!1,function(){}),n.d(e,!1,function(){return ve.C}),n.d(e,!1,function(){return ve.D}),n.d(e,!1,function(){return ve.E}),n.d(e,!1,function(){return ve.F}),n.d(e,!1,function(){}),n.d(e,!1,function(){return ve.G}),n.d(e,!1,function(){return ve.H}),n.d(e,!1,function(){return ve.I}),n.d(e,!1,function(){return ve.J}),n.d(e,!1,function(){return ve.K}),n.d(e,!1,function(){return ve.L}),n.d(e,!1,function(){}),n.d(e,!1,function(){return ve.M}),n.d(e,"_125",function(){return ve.N}),n.d(e,!1,function(){return ve.O}),n.d(e,!1,function(){}),n.d(e,!1,function(){return ve.P}),n.d(e,!1,function(){return ve.Q}),n.d(e,!1,function(){return ve.R}),n.d(e,!1,function(){return ve.S}),n.d(e,"_128",function(){return ve.T}),n.d(e,"_129",function(){return ve.U}),n.d(e,!1,function(){return ve.V}),n.d(e,!1,function(){}),n.d(e,!1,function(){return ve.X}),n.d(e,!1,function(){return ve.Y}),n.d(e,!1,function(){return ve.Z}),n.d(e,!1,function(){return ve._1}),n.d(e,!1,function(){return ve._3}),n.d(e,!1,function(){return ve._4}),n.d(e,!1,function(){return ve._6}),n.d(e,!1,function(){}),n.d(e,!1,function(){}),n.d(e,!1,function(){return ve._9}),n.d(e,!1,function(){return ve._10}),n.d(e,!1,function(){return ve._11}),n.d(e,!1,function(){return ve._12}),n.d(e,!1,function(){return ve._13}),n.d(e,!1,function(){return ve._14}),n.d(e,!1,function(){return ve._15}),n.d(e,!1,function(){return ve._16}),n.d(e,!1,function(){}),n.d(e,!1,function(){return ve._17}),n.d(e,!1,function(){}),n.d(e,!1,function(){return ve._18}),n.d(e,!1,function(){return ve._19}),n.d(e,!1,function(){return ve._20}),n.d(e,!1,function(){}),n.d(e,!1,function(){return ve._21}),n.d(e,!1,function(){return ve._22}),n.d(e,!1,function(){return ve._23}),n.d(e,!1,function(){return ve._24}),n.d(e,!1,function(){return ve._25}),n.d(e,!1,function(){return ve._26}),n.d(e,!1,function(){return ve._27}),n.d(e,!1,function(){}),n.d(e,!1,function(){return ve._28}),n.d(e,!1,function(){return ve._29}),n.d(e,!1,function(){return ve._30}),n.d(e,!1,function(){return ve._31}),n.d(e,!1,function(){}),n.d(e,"_134",function(){return ve._32}),n.d(e,!1,function(){}),n.d(e,!1,function(){return ve._33}),n.d(e,!1,function(){return ve._34}),n.d(e,!1,function(){return ve._35}),n.d(e,!1,function(){return ve._36}),n.d(e,!1,function(){return ve._37}),n.d(e,!1,function(){return ve._38}),n.d(e,!1,function(){}),n.d(e,!1,function(){return ve._39}),n.d(e,!1,function(){}),n.d(e,!1,function(){}),n.d(e,!1,function(){}),n.d(e,!1,function(){}),n.d(e,!1,function(){}),n.d(e,!1,function(){return ve._40}),n.d(e,!1,function(){return ve._41}),n.d(e,!1,function(){}),n.d(e,!1,function(){return ve._42}),n.d(e,!1,function(){}),n.d(e,!1,function(){}),n.d(e,!1,function(){}),n.d(e,!1,function(){return ve._43}),n.d(e,!1,function(){return ve._44}),n.d(e,!1,function(){return ve._45}),n.d(e,!1,function(){return ve._46}),n.d(e,!1,function(){return ve._47}),n.d(e,!1,function(){return ve._48}),n.d(e,"_137",function(){return ve._49}),n.d(e,!1,function(){return ve._50}),n.d(e,!1,function(){}),n.d(e,!1,function(){}),n.d(e,!1,function(){}),n.d(e,!1,function(){}),n.d(e,!1,function(){return ve._52}),n.d(e,!1,function(){return ve._53}),n.d(e,"_138",function(){return ve._54}),n.d(e,!1,function(){return ve._56}),n.d(e,!1,function(){}),n.d(e,!1,function(){return ve._57}),n.d(e,"_139",function(){return ve._58}),n.d(e,!1,function(){return ve._59}),n.d(e,!1,function(){return ve._60}),n.d(e,!1,function(){return ve._61}),n.d(e,"_140",function(){return ve._62}),n.d(e,!1,function(){}),n.d(e,!1,function(){}),n.d(e,!1,function(){}),n.d(e,!1,function(){}),n.d(e,!1,function(){return ve._63}),n.d(e,!1,function(){return ve._64}),n.d(e,!1,function(){return ve._65}),n.d(e,!1,function(){return ve.W}),n.d(e,!1,function(){return ve._5}),n.d(e,!1,function(){return ve._8}),n.d(e,!1,function(){return ve._51}),n.d(e,!1,function(){return ve._68}),n.d(e,!1,function(){return ve._69}),n.d(e,!1,function(){return ve._70}),n.d(e,!1,function(){return ve._71}),n.d(e,"_142",function(){return ve._72}),n.d(e,"_143",function(){return ve._73}),n.d(e,!1,function(){}),n.d(e,!1,function(){return ve._74}),n.d(e,"_144",function(){return ve._76}),n.d(e,!1,function(){return ve._77}),n.d(e,!1,function(){return ve._78}),n.d(e,!1,function(){return ve._79}),n.d(e,"_146",function(){return ve._80}),n.d(e,"_147",function(){return ve._81}),n.d(e,"_148",function(){return ve._82}),n.d(e,!1,function(){}),n.d(e,!1,function(){}),n.d(e,!1,function(){}),n.d(e,!1,function(){}),n.d(e,!1,function(){return ve._83}),n.d(e,!1,function(){return ve._84}),n.d(e,!1,function(){return ve._86}),n.d(e,!1,function(){return ve._87}),n.d(e,!1,function(){}),n.d(e,"_150",function(){return ve._88}),n.d(e,!1,function(){}),n.d(e,!1,function(){return ve._89}),n.d(e,!1,function(){return ve._90}),n.d(e,"_153",function(){return ve._91}),n.d(e,!1,function(){return ve._92}),n.d(e,!1,function(){}),n.d(e,!1,function(){}),n.d(e,"_130",function(){return ve._7}),n.d(e,!1,function(){}),n.d(e,!1,function(){}),n.d(e,!1,function(){}),n.d(e,!1,function(){return ve._0}),n.d(e,!1,function(){}),n.d(e,!1,function(){return ve._66}),n.d(e,!1,function(){return ve._75}),n.d(e,!1,function(){return je}),n.d(e,!1,function(){}),n.d(e,!1,function(){}),n.d(e,!1,function(){}),n.d(e,!1,function(){}),n.d(e,!1,function(){}),n.d(e,"_126",function(){return pe.b}),n.d(e,!1,function(){}),n.d(e,!1,function(){}),n.d(e,"_149",function(){return pe.e}),n.d(e,"_124",function(){return pe.a}),n.d(e,"_132",function(){return pe.c}),n.d(e,!1,function(){}),n.d(e,!1,function(){}),n.d(e,!1,function(){}),n.d(e,!1,function(){}),n.d(e,!1,function(){}),n.d(e,!1,function(){}),n.d(e,!1,function(){}),n.d(e,"_135",function(){return pe.d}),n.d(e,!1,function(){}),n.d(e,!1,function(){}),n.d(e,!1,function(){return Dt.b}),n.d(e,!1,function(){return Dt.a}),n.d(e,!1,function(){return Dt.c}),n.d(e,"_136",function(){return Dt.d}),n.d(e,!1,function(){}),n.d(e,!1,function(){}),n.d(e,!1,function(){}),n.d(e,!1,function(){}),n.d(e,"a",function(){return Nt.a}),n.d(e,"b",function(){return Nt.b}),n.d(e,"c",function(){return Nt.c}),n.d(e,"d",function(){return Nt.d}),n.d(e,"e",function(){return Nt.e}),n.d(e,"f",function(){return Nt.f}),n.d(e,"g",function(){return Nt.g}),n.d(e,"h",function(){return Nt.h}),n.d(e,"i",function(){return Nt.i}),n.d(e,"j",function(){return Nt.j}),n.d(e,"k",function(){return Nt.k}),n.d(e,"l",function(){return Nt.l}),n.d(e,"n",function(){return Nt.n}),n.d(e,"m",function(){return Nt.m}),n.d(e,"o",function(){return Nt.o}),n.d(e,"r",function(){return Nt.r}),n.d(e,"p",function(){return Nt.p}),n.d(e,"q",function(){return Nt.q}),n.d(e,"s",function(){return Nt.s}),n.d(e,"t",function(){return Nt.t}),n.d(e,"u",function(){return Nt.u}),n.d(e,!1,function(){}),n.d(e,"v",function(){return Nt.v}),n.d(e,"w",function(){return Nt.w}),n.d(e,"x",function(){return Nt.x}),n.d(e,"y",function(){return Nt.y}),n.d(e,"z",function(){return Nt.z}),n.d(e,"A",function(){return Nt.A}),n.d(e,"B",function(){return Nt.B}),n.d(e,"C",function(){return Nt.C}),n.d(e,"D",function(){return Nt.D}),n.d(e,"E",function(){return Nt.E}),n.d(e,"F",function(){return Nt.F}),n.d(e,"G",function(){return Nt.G}),n.d(e,"H",function(){return Nt.H}),n.d(e,"I",function(){return Nt.I}),n.d(e,"J",function(){return Nt.J}),n.d(e,"L",function(){return Nt.L}),n.d(e,"K",function(){return Nt.K}),n.d(e,"N",function(){return Nt.M}),n.d(e,"O",function(){return Nt.N}),n.d(e,"P",function(){return Nt.O}),n.d(e,"Q",function(){return Nt.P}),n.d(e,"R",function(){return Nt.Q}),n.d(e,"S",function(){return Nt.R}),n.d(e,"T",function(){return Nt.S}),n.d(e,!1,function(){}),n.d(e,!1,function(){}),n.d(e,"_61",function(){return Nt._59}),n.d(e,"U",function(){return Nt.T}),n.d(e,"V",function(){return Nt.U}),n.d(e,"W",function(){return Nt.V}),n.d(e,"Y",function(){return Nt.X}),n.d(e,"X",function(){return Nt.W}),n.d(e,"Z",function(){return Nt.Y}),n.d(e,"_0",function(){return Nt.Z}),n.d(e,"_1",function(){return Nt._0}),n.d(e,"_2",function(){return Nt._1}),n.d(e,"_3",function(){return Nt._2}),n.d(e,"_4",function(){return Nt._3}),n.d(e,"_5",function(){return Nt._4}),n.d(e,"_6",function(){return Nt._5}),n.d(e,"_8",function(){return Nt._7}),n.d(e,"_12",function(){return Nt._11}),n.d(e,"_11",function(){return Nt._10}),n.d(e,"_13",function(){return Nt._12}),n.d(e,"_14",function(){return Nt._13}),n.d(e,"_16",function(){return Nt._15}),n.d(e,"_15",function(){return Nt._14}),n.d(e,"_17",function(){return Nt._16}),n.d(e,"_18",function(){return Nt._17}),n.d(e,"_19",function(){return Nt._18}),n.d(e,"_20",function(){return Nt._19}),n.d(e,"_24",function(){return Nt._22}),n.d(e,"_25",function(){return Nt._23}),n.d(e,"_26",function(){return Nt._24}),n.d(e,"_27",function(){return Nt._25}),n.d(e,"_28",function(){return Nt._26}),n.d(e,"_29",function(){return Nt._27}),n.d(e,"_30",function(){return Nt._28}),n.d(e,"_31",function(){return Nt._29}),n.d(e,"_32",function(){return Nt._30}),n.d(e,!1,function(){}),n.d(e,"_22",function(){return Nt._20}),n.d(e,"_23",function(){return Nt._21}),n.d(e,"_33",function(){return Nt._31}),n.d(e,"_39",function(){return Nt._37}),n.d(e,"_34",function(){return Nt._32}),n.d(e,"_37",function(){return Nt._35}),n.d(e,"_35",function(){return Nt._33}),n.d(e,"_36",function(){return Nt._34}),n.d(e,"_38",function(){return Nt._36}),n.d(e,"_40",function(){return Nt._38}),n.d(e,"_41",function(){return Nt._39}),n.d(e,"_42",function(){return Nt._40}),n.d(e,"_43",function(){return Nt._41}),n.d(e,"_44",function(){return Nt._42}),n.d(e,"_45",function(){return Nt._43}),n.d(e,"_46",function(){return Nt._44}),n.d(e,"_47",function(){return Nt._45}),n.d(e,"_51",function(){return Nt._49}),n.d(e,"_48",function(){return Nt._46}),n.d(e,"_49",function(){return Nt._47}),n.d(e,"_50",function(){return Nt._48}),n.d(e,"_53",function(){return Nt._51}),n.d(e,"_52",function(){return Nt._50}),n.d(e,"_54",function(){return Nt._52}),n.d(e,"_55",function(){return Nt._53}),n.d(e,!1,function(){}),n.d(e,"_56",function(){return Nt._54}),n.d(e,"_57",function(){return Nt._55}),n.d(e,"_58",function(){return Nt._56}),n.d(e,"_59",function(){return Nt._57}),n.d(e,"_60",function(){return Nt._58}),n.d(e,"_62",function(){return Nt._60}),n.d(e,"_63",function(){return Nt._61}),n.d(e,"_65",function(){return Nt._63}),n.d(e,"_68",function(){return Nt._66}),n.d(e,"_69",function(){return Nt._67}),n.d(e,"_66",function(){return Nt._64}),n.d(e,"_67",function(){return Nt._65}),n.d(e,"_64",function(){return Nt._62}),n.d(e,"_70",function(){return Nt._68}),n.d(e,"_72",function(){return Nt._70}),n.d(e,"_73",function(){return Nt._71}),n.d(e,"_74",function(){return Nt._72}),n.d(e,"_75",function(){return Nt._73}),n.d(e,"_76",function(){return Nt._74}),n.d(e,"_81",function(){return Nt._79}),n.d(e,"_79",function(){return Nt._77}),n.d(e,"_80",function(){return Nt._78}),n.d(e,"_78",function(){return Nt._76}),n.d(e,"_77",function(){return Nt._75}),n.d(e,"_83",function(){return Nt._81}),n.d(e,"_91",function(){return Nt._89}),n.d(e,"_100",function(){return Nt._98}),n.d(e,"_84",function(){return Nt._82}),n.d(e,"_90",function(){return Nt._88}),n.d(e,"_82",function(){return Nt._80}),n.d(e,"_85",function(){return Nt._83}),n.d(e,"_86",function(){return Nt._84}),n.d(e,"_87",function(){return Nt._85}),n.d(e,"_88",function(){return Nt._86}),n.d(e,"_89",function(){return Nt._87}),n.d(e,"_93",function(){return Nt._91}),n.d(e,"_92",function(){return Nt._90}),n.d(e,"_95",function(){return Nt._93}),n.d(e,"_96",function(){return Nt._94}),n.d(e,"_97",function(){return Nt._95}),n.d(e,"_98",function(){return Nt._96}),n.d(e,"_99",function(){return Nt._97}),n.d(e,"_101",function(){return Nt._99}),n.d(e,"_102",function(){return Nt._100}),n.d(e,"_105",function(){return Nt._101}),n.d(e,"_106",function(){return Nt._102}),n.d(e,"_107",function(){return Nt._103}),n.d(e,"_108",function(){return Nt._104}),n.d(e,"_109",function(){return Nt._105}),n.d(e,"_110",function(){return Nt._106}),n.d(e,"_111",function(){return Nt._107}),n.d(e,"_112",function(){return Nt._108}),n.d(e,"_94",function(){return Nt._92}),n.d(e,"_7",function(){return Nt._6}),n.d(e,"_71",function(){return Nt._69}),n.d(e,"_113",function(){return Nt._109}),n.d(e,"_9",function(){return Nt._8}),n.d(e,"_10",function(){return Nt._9}),n.d(e,!1,function(){}),n.d(e,!1,function(){return ve._85}),n.d(e,!1,function(){}),n.d(e,!1,function(){}),n.d(e,!1,function(){return ve._55}),n.d(e,!1,function(){return ve._67}),n.d(e,!1,function(){return ve._2}),n.d(e,!1,function(){}),n.d(e,!1,function(){}),n.d(e,!1,function(){}),n.d(e,!1,function(){})},JffD:function(t,e,n){"use strict";var r=n("Kkag"),i=n("l5jf"),o=n("xMQ1"),s=n("35G1");const a=Object(s.a)({prelu_:
  1055. /**
  1056. * @license
  1057. * Copyright 2020 Google LLC. All Rights Reserved.
  1058. * Licensed under the Apache License, Version 2.0 (the "License");
  1059. * you may not use this file except in compliance with the License.
  1060. * You may obtain a copy of the License at
  1061. *
  1062. * http://www.apache.org/licenses/LICENSE-2.0
  1063. *
  1064. * Unless required by applicable law or agreed to in writing, software
  1065. * distributed under the License is distributed on an "AS IS" BASIS,
  1066. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1067. * See the License for the specific language governing permissions and
  1068. * limitations under the License.
  1069. * =============================================================================
  1070. */
  1071. function(t,e){const n={x:Object(o.a)(t,"x","prelu"),alpha:Object(o.a)(e,"alpha","prelu")};return r.a.runKernel(i._55,n)}});e.a=a},K9mh:function(t,e,n){"use strict";var r=n("Kkag"),i=n("l5jf"),o=n("jb1O"),s=n("xMQ1"),a=n("35G1");const l=Object(a.a)({floorDiv_:
  1072. /**
  1073. * @license
  1074. * Copyright 2020 Google LLC. All Rights Reserved.
  1075. * Licensed under the Apache License, Version 2.0 (the "License");
  1076. * you may not use this file except in compliance with the License.
  1077. * You may obtain a copy of the License at
  1078. *
  1079. * http://www.apache.org/licenses/LICENSE-2.0
  1080. *
  1081. * Unless required by applicable law or agreed to in writing, software
  1082. * distributed under the License is distributed on an "AS IS" BASIS,
  1083. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1084. * See the License for the specific language governing permissions and
  1085. * limitations under the License.
  1086. * =============================================================================
  1087. */
  1088. function(t,e){let n=Object(s.a)(t,"a","floorDiv"),a=Object(s.a)(e,"b","floorDiv");[n,a]=Object(o.c)(n,a);const l={a:n,b:a};return r.a.runKernel(i._5,l)}});e.a=l},KCLY:function(t,e,n){"use strict";(function(e){var r=n("cGG2"),i=n("5VQ+"),o={"Content-Type":"application/x-www-form-urlencoded"};function s(t,e){!r.isUndefined(t)&&r.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var a,l={adapter:("undefined"!=typeof XMLHttpRequest?a=n("7GwW"):void 0!==e&&"[object process]"===Object.prototype.toString.call(e)&&(a=n("7GwW")),a),transformRequest:[function(t,e){return i(e,"Accept"),i(e,"Content-Type"),r.isFormData(t)||r.isArrayBuffer(t)||r.isBuffer(t)||r.isStream(t)||r.isFile(t)||r.isBlob(t)?t:r.isArrayBufferView(t)?t.buffer:r.isURLSearchParams(t)?(s(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):r.isObject(t)?(s(e,"application/json;charset=utf-8"),JSON.stringify(t)):t}],transformResponse:[function(t){if("string"==typeof t)try{t=JSON.parse(t)}catch(t){}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(t){return t>=200&&t<300}};l.headers={common:{Accept:"application/json, text/plain, */*"}},r.forEach(["delete","get","head"],function(t){l.headers[t]={}}),r.forEach(["post","put","patch"],function(t){l.headers[t]=r.merge(o)}),t.exports=l}).call(e,n("W2nU"))},Kh4W:function(t,e,n){e.f=n("dSzd")},Kkag:function(t,e,n){"use strict";var r=n("ngdQ"),i=n("v/P2"),o=n("Nhog"),s=n("l5jf"),a=n("aYFL"),l=n("QSAg"),u=n("XFvI");
  1089. /**
  1090. * @license
  1091. * Copyright 2018 Google LLC. All Rights Reserved.
  1092. * Licensed under the Apache License, Version 2.0 (the "License");
  1093. * you may not use this file except in compliance with the License.
  1094. * You may obtain a copy of the License at
  1095. *
  1096. * http://www.apache.org/licenses/LICENSE-2.0
  1097. *
  1098. * Unless required by applicable law or agreed to in writing, software
  1099. * distributed under the License is distributed on an "AS IS" BASIS,
  1100. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1101. * See the License for the specific language governing permissions and
  1102. * limitations under the License.
  1103. * =============================================================================
  1104. */
  1105. class c{constructor(t,e){this.backendTimer=t,this.logger=e,null==e&&(this.logger=new d)}profileKernel(t,e,n){let r;const o=()=>{r=n()};let s;const a=u.now();if(this.backendTimer.timerAvailable())s=this.backendTimer.time(o);else{o();for(const t of r)t.dataSync();s=Promise.resolve({kernelMs:u.now()-a})}if(Object(i.b)().getBool("CHECK_COMPUTATION_FOR_ERRORS"))for(let e=0;e<r.length;e++){const n=r[e];n.data().then(e=>{h(e,n.dtype,t)})}return{kernelName:t,outputs:r,inputs:e,timeMs:s.then(t=>t.kernelMs),extraInfo:s.then(t=>null!=t.getExtraProfileInfo?t.getExtraProfileInfo():"")}}logKernelProfile(t){const{kernelName:e,outputs:n,timeMs:r,inputs:i,extraInfo:o}=t;n.forEach(t=>{Promise.all([t.data(),r,o]).then(n=>{this.logger.logKernelProfile(e,t,n[0],n[1],i,n[2])})})}}function h(t,e,n){if("float32"!==e)return!1;for(let e=0;e<t.length;e++){const r=t[e];if(isNaN(r)||!isFinite(r))return console.warn(`Found ${r} in the result of '${n}'`),!0}return!1}class d{logKernelProfile(t,e,n,r,i,o){const s="number"==typeof r?u.rightPad(`${r}ms`,9):r.error,a=u.rightPad(t,25),l=e.rank,c=e.size,h=u.rightPad(e.shape.toString(),14);let d="";for(const t in i){const n=i[t];if(null!=n){const r=n.shape||e.shape,i=r.length;d+=`${t}: ${i}D ${i>0?r:""} `}}console.log(`%c${a}\t%c${s}\t%c${l}D ${h}\t%c${c}\t%c${d}\t%c${o}`,"font-weight:bold","color:red","color:blue","color: orange","color: green","color: steelblue")}}
  1106. /**
  1107. * @license
  1108. * Copyright 2017 Google LLC. All Rights Reserved.
  1109. * Licensed under the Apache License, Version 2.0 (the "License");
  1110. * you may not use this file except in compliance with the License.
  1111. * You may obtain a copy of the License at
  1112. *
  1113. * http://www.apache.org/licenses/LICENSE-2.0
  1114. *
  1115. * Unless required by applicable law or agreed to in writing, software
  1116. * distributed under the License is distributed on an "AS IS" BASIS,
  1117. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1118. * See the License for the specific language governing permissions and
  1119. * limitations under the License.
  1120. * =============================================================================
  1121. */var p=n("XPNO"),f=n("jb1O");
  1122. /**
  1123. * @license
  1124. * Copyright 2018 Google LLC. All Rights Reserved.
  1125. * Licensed under the Apache License, Version 2.0 (the "License");
  1126. * you may not use this file except in compliance with the License.
  1127. * You may obtain a copy of the License at
  1128. *
  1129. * http://www.apache.org/licenses/LICENSE-2.0
  1130. *
  1131. * Unless required by applicable law or agreed to in writing, software
  1132. * distributed under the License is distributed on an "AS IS" BASIS,
  1133. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1134. * See the License for the specific language governing permissions and
  1135. * limitations under the License.
  1136. * =============================================================================
  1137. */
  1138. function g(t){return null!=t.kernelName}e.b=b;class m{constructor(){this.registeredVariables={},this.nextTapeNodeId=0,this.numBytes=0,this.numTensors=0,this.numStringTensors=0,this.numDataBuffers=0,this.gradientDepth=0,this.kernelDepth=0,this.scopeStack=[],this.numDataMovesStack=[],this.nextScopeId=0,this.tensorInfo=new WeakMap,this.profiling=!1,this.activeProfile={newBytes:0,newTensors:0,peakBytes:0,kernels:[],result:null,get kernelNames(){return Array.from(new Set(this.kernels.map(t=>t.name)))}}}dispose(){for(const t in this.registeredVariables)this.registeredVariables[t].dispose()}}class v{constructor(t){this.ENV=t,this.registry={},this.registryFactory={},this.pendingBackendInitId=0,this.state=new m}async ready(){if(null!=this.pendingBackendInit)return this.pendingBackendInit.then(()=>{});if(null!=this.backendInstance)return;const t=this.getSortedBackends();for(let e=0;e<t.length;e++){const n=t[e];if(await this.initializeBackend(n).success)return void await this.setBackend(n)}throw new Error("Could not initialize any backends, all backend initializations failed.")}get backend(){if(null!=this.pendingBackendInit)throw new Error(`Backend '${this.backendName}' has not yet been initialized. Make `+"sure to await tf.ready() or await tf.setBackend() before calling other methods");if(null==this.backendInstance){const{name:t,asyncInit:e}=this.initializeBackendsAndReturnBest();if(e)throw new Error(`The highest priority backend '${t}' has not yet been `+"initialized. Make sure to await tf.ready() or await tf.setBackend() before calling other methods");this.setBackend(t)}return this.backendInstance}backendNames(){return Object.keys(this.registryFactory)}findBackend(t){if(!(t in this.registry)){if(!(t in this.registryFactory))return null;{const{asyncInit:e}=this.initializeBackend(t);if(e)return null}}return this.registry[t]}findBackendFactory(t){return t in this.registryFactory?this.registryFactory[t].factory:null}registerBackend(t,e,n=1){return t in this.registryFactory?(l.b(`${t} backend was already registered. `+"Reusing existing backend factory."),!1):(this.registryFactory[t]={factory:e,priority:n},!0)}async setBackend(t){if(null==this.registryFactory[t])throw new Error(`Backend name '${t}' not found in registry`);if(this.backendName=t,null==this.registry[t]){this.backendInstance=null;const{success:e,asyncInit:n}=this.initializeBackend(t);if(!(n?await e:e))return!1}return this.backendInstance=this.registry[t],this.setupRegisteredKernels(),this.profiler=new c(this.backendInstance),!0}setupRegisteredKernels(){Object(a.c)(this.backendName).forEach(t=>{null!=t.setupFunc&&t.setupFunc(this.backendInstance)})}disposeRegisteredKernels(t){Object(a.c)(t).forEach(e=>{null!=e.disposeFunc&&e.disposeFunc(this.registry[t])})}initializeBackend(t){const e=this.registryFactory[t];if(null==e)throw new Error(`Cannot initialize backend ${t}, no registration found.`);try{const n=e.factory();if(!n||n instanceof r.b||"function"!=typeof n.then)return this.registry[t]=n,{success:!0,asyncInit:!1};{const e=++this.pendingBackendInitId,r=n.then(n=>!(e<this.pendingBackendInitId)&&(this.registry[t]=n,this.pendingBackendInit=null,!0)).catch(n=>!(e<this.pendingBackendInitId)&&(this.pendingBackendInit=null,l.b(`Initialization of backend ${t} failed`),l.b(n.stack||n.message),!1));return this.pendingBackendInit=r,{success:r,asyncInit:!0}}}catch(e){return l.b(`Initialization of backend ${t} failed`),l.b(e.stack||e.message),{success:!1,asyncInit:!1}}}removeBackend(t){if(!(t in this.registryFactory))throw new Error(`${t} backend not found in registry`);this.backendName===t&&null!=this.pendingBackendInit&&this.pendingBackendInitId++,t in this.registry&&(this.disposeRegisteredKernels(t),this.registry[t].dispose(),delete this.registry[t]),delete this.registryFactory[t],this.backendName===t&&(this.pendingBackendInit=null,this.backendName=null,this.backendInstance=null)}getSortedBackends(){if(0===Object.keys(this.registryFactory).length)throw new Error("No backend found in registry.");return Object.keys(this.registryFactory).sort((t,e)=>this.registryFactory[e].priority-this.registryFactory[t].priority)}initializeBackendsAndReturnBest(){const t=this.getSortedBackends();for(let e=0;e<t.length;e++){const n=t[e],{success:r,asyncInit:i}=this.initializeBackend(n);if(i||r)return{name:n,asyncInit:i}}throw new Error("Could not initialize any backends, all backend initializations failed.")}moveData(t,e){const n=this.state.tensorInfo.get(e),r=n.backend,i=this.readSync(e),o=r.refCount(e);r.disposeData(e,!0),n.backend=t,t.move(e,i,n.shape,n.dtype,o),this.shouldCheckForMemLeaks()&&this.state.numDataMovesStack[this.state.numDataMovesStack.length-1]++}tidy(t,e){let n,r=null;if(null==e){if("function"!=typeof t)throw new Error("Please provide a function to tidy()");e=t}else{if("string"!=typeof t&&!(t instanceof String))throw new Error("When calling with two arguments, the first argument to tidy() must be a string");if("function"!=typeof e)throw new Error("When calling with two arguments, the 2nd argument to tidy() must be a function");r=t}return this.scopedRun(()=>this.startScope(r),()=>this.endScope(n),()=>((n=e())instanceof Promise&&console.error("Cannot return a Promise inside of tidy."),n))}scopedRun(t,e,n){t();try{const t=n();return e(),t}catch(t){throw e(),t}}nextTensorId(){return v.nextTensorId++}nextVariableId(){return v.nextVariableId++}clone(t){const e=_.runKernel(s._15,{x:t}),n={x:t};return this.addTapeNode(this.state.activeScope.name,n,[e],t=>({x:()=>{const e={x:t},n={dtype:"float32"};return _.runKernel(s.w,e,n)}}),[],{}),e}runKernel(t,e,n){if(null==this.backendName&&this.backend,!(null!=Object(a.b)(t,this.backendName)))throw new Error(`Kernel '${t}' not registered for backend '${this.backendName}'`);return this.runKernelFunc({kernelName:t,inputs:e,attrs:n})}shouldCheckForMemLeaks(){return this.ENV.getBool("IS_TEST")}checkKernelForMemLeak(t,e,n){const r=this.backend.numDataIds();let i=0;n.forEach(t=>{i+="complex64"===t.dtype?3:1});const o=this.state.numDataMovesStack[this.state.numDataMovesStack.length-1],s=r-e-i-o;if(s>0)throw new Error(`Backend '${this.backendName}' has an internal memory leak `+`(${s} data ids) after running '${t}'`)}runKernelFunc(t){let e,n=[];const r=this.isTapeOn(),i=this.state.numBytes,o=this.state.numTensors;let s,l;this.shouldCheckForMemLeaks()&&this.state.numDataMovesStack.push(0),null==this.backendName&&this.backend;const c=g(t)?t.kernelName:null!=this.state.activeScope?this.state.activeScope.name:"";if(g(t)){const{kernelName:e,inputs:i,attrs:o}=t;null==this.backendName&&this.backend;const c=Object(a.b)(e,this.backendName);u.assert(null!=c,()=>`Cannot find registered kernel '${e}' for backend '${this.backendName}'`),s=(()=>{const t=this.backend.numDataIds();l=c.kernelFunc({inputs:i,attrs:o,backend:this.backend});const s=Array.isArray(l)?l:[l];this.shouldCheckForMemLeaks()&&this.checkKernelForMemLeak(e,t,s);const a=s.map(t=>{if(null!=t.rank)return t;const{dataId:e,shape:n,dtype:r}=t;return this.makeTensorFromDataId(e,n,r)});if(r){const t=this.getTensorsForGradient(e,i,a);n=this.saveTensorsForBackwardMode(t)}return a})}else{const{forwardFunc:e}=t,i=t=>{r&&(n=t.map(t=>this.keep(this.clone(t))))};s=(()=>{const t=this.backend.numDataIds();l=this.tidy(()=>e(this.backend,i));const n=Array.isArray(l)?l:[l];return this.shouldCheckForMemLeaks()&&this.checkKernelForMemLeak(c,t,n),n})}const{inputs:h,attrs:d}=t,p=g(t)?null:t.backwardsFunc;let f;return this.scopedRun(()=>this.state.kernelDepth++,()=>this.state.kernelDepth--,()=>{this.ENV.getBool("DEBUG")||this.state.profiling?(f=this.profiler.profileKernel(c,h,()=>s()),this.ENV.getBool("DEBUG")&&this.profiler.logKernelProfile(f),e=f.outputs):e=s()}),r&&this.addTapeNode(c,h,e,p,n,d),this.state.profiling&&this.state.activeProfile.kernels.push({name:c,bytesAdded:this.state.numBytes-i,totalBytesSnapshot:this.state.numBytes,tensorsAdded:this.state.numTensors-o,totalTensorsSnapshot:this.state.numTensors,inputShapes:Object.keys(h).map(t=>null!=h[t]?h[t].shape:null),outputShapes:e.map(t=>t.shape),kernelTimeMs:f.timeMs,extraInfo:f.extraInfo}),Array.isArray(l)?e:e[0]}saveTensorsForBackwardMode(t){return t.map(t=>this.keep(this.clone(t)))}getTensorsForGradient(t,e,n){const r=Object(a.a)(t);if(null!=r){const t=r.inputsToSave||[],i=r.outputsToSave||[];let o;r.saveAllInputs?(u.assert(Array.isArray(e),()=>"saveAllInputs is true, expected inputs to be an array."),o=Object.keys(e).map(t=>e[t])):o=t.map(t=>e[t]);const s=n.filter((t,e)=>i[e]);return o.concat(s)}return[]}makeTensor(t,e,n,r){if(null==t)throw new Error("Values passed to engine.makeTensor() are null");n=n||"float32",r=r||this.backend;let i=t;"string"===n&&u.isString(t[0])&&(i=t.map(t=>u.encodeString(t)));const o=r.write(i,e,n),s=new p.a(e,n,o,this.nextTensorId());if(this.trackTensor(s,r),"string"===n){const t=this.state.tensorInfo.get(o),e=Object(u.bytesFromStringArray)(i);this.state.numBytes+=e-t.bytes,t.bytes=e}return s}makeTensorFromDataId(t,e,n,r){n=n||"float32";const i=new p.a(e,n,t,this.nextTensorId());return this.trackTensor(i,r),i}makeVariable(t,e=!0,n,r){n=n||this.nextVariableId().toString(),null!=r&&r!==t.dtype&&(t=t.cast(r));const i=new p.c(t,e,n,this.nextTensorId());if(null!=this.state.registeredVariables[i.name])throw new Error(`Variable with name ${i.name} was already registered`);return this.state.registeredVariables[i.name]=i,this.incRef(i,this.backend),i}trackTensor(t,e){this.state.numTensors++,"string"===t.dtype&&this.state.numStringTensors++;let n=0;"complex64"!==t.dtype&&"string"!==t.dtype&&(n=t.size*u.bytesPerElement(t.dtype)),this.state.numBytes+=n,this.state.tensorInfo.has(t.dataId)||(this.state.numDataBuffers++,this.state.tensorInfo.set(t.dataId,{backend:e||this.backend,dtype:t.dtype,shape:t.shape,bytes:n})),t instanceof p.c||this.track(t)}incRef(t,e){this.trackTensor(t,e),this.backend.incRef(t.dataId)}removeDataId(t,e){this.state.tensorInfo.has(t)&&this.state.tensorInfo.get(t).backend===e&&(this.state.tensorInfo.delete(t),this.state.numDataBuffers--)}disposeTensor(t){if(!this.state.tensorInfo.has(t.dataId))return;const e=this.state.tensorInfo.get(t.dataId);if(this.state.numTensors--,"string"===t.dtype&&(this.state.numStringTensors--,this.state.numBytes-=e.bytes),"complex64"!==t.dtype&&"string"!==t.dtype){const e=t.size*u.bytesPerElement(t.dtype);this.state.numBytes-=e}e.backend.disposeData(t.dataId)&&this.removeDataId(t.dataId,e.backend)}disposeVariables(){for(const t in this.state.registeredVariables){const e=this.state.registeredVariables[t];this.disposeVariable(e)}}disposeVariable(t){this.disposeTensor(t),null!=this.state.registeredVariables[t.name]&&delete this.state.registeredVariables[t.name]}memory(){const t=this.backend.memory();return t.numTensors=this.state.numTensors,t.numDataBuffers=this.state.numDataBuffers,t.numBytes=this.state.numBytes,this.state.numStringTensors>0&&(t.unreliable=!0,null==t.reasons&&(t.reasons=[]),t.reasons.push("Memory usage by string tensors is approximate (2 bytes per character)")),t}async profile(t){this.state.profiling=!0;const e=this.state.numBytes,n=this.state.numTensors;this.state.activeProfile.kernels=[],this.state.activeProfile.result=await t(),this.state.profiling=!1,this.state.activeProfile.peakBytes=Math.max(...this.state.activeProfile.kernels.map(t=>t.totalBytesSnapshot)),this.state.activeProfile.newBytes=this.state.numBytes-e,this.state.activeProfile.newTensors=this.state.numTensors-n;for(const t of this.state.activeProfile.kernels)t.kernelTimeMs=await t.kernelTimeMs,t.extraInfo=await t.extraInfo;return this.state.activeProfile}isTapeOn(){return this.state.gradientDepth>0&&0===this.state.kernelDepth}addTapeNode(t,e,n,r,i,o){const s={id:this.state.nextTapeNodeId++,kernelName:t,inputs:e,outputs:n,saved:i},l=Object(a.a)(t);null!=l&&(r=l.gradFunc),null!=r&&(s.gradient=(t=>(t=t.map((t,e)=>{if(null==t){const t=n[e],r=u.makeZerosTypedArray(t.size,t.dtype);return this.makeTensor(r,t.shape,t.dtype)}return t}),r(t.length>1?t:t[0],i,o)))),this.state.activeTape.push(s)}keep(t){return t.kept=!0,t}startTape(){0===this.state.gradientDepth&&(this.state.activeTape=[]),this.state.gradientDepth++}endTape(){this.state.gradientDepth--}startScope(t){const e={track:[],name:"unnamed scope",id:this.state.nextScopeId++};t&&(e.name=t),this.state.scopeStack.push(e),this.state.activeScope=e}endScope(t){const e=Object(f.b)(t),n=new Set(e.map(t=>t.id));for(let t=0;t<this.state.activeScope.track.length;t++){const e=this.state.activeScope.track[t];e.kept||n.has(e.id)||e.dispose()}const r=this.state.scopeStack.pop();this.state.activeScope=0===this.state.scopeStack.length?null:this.state.scopeStack[this.state.scopeStack.length-1],e.forEach(t=>{t.kept||t.scopeId!==r.id||this.track(t)})}gradients(t,e,n,r=!1){if(u.assert(e.length>0,()=>"gradients() received an empty list of xs."),null!=n&&"float32"!==n.dtype)throw new Error(`dy must have 'float32' dtype, but has '${n.dtype}'`);const i=this.scopedRun(()=>this.startTape(),()=>this.endTape(),()=>this.tidy("forward",t));u.assert(i instanceof p.a,()=>"The result y returned by f() must be a tensor.");const o=function(t,e,n){const r={},i={};for(let t=0;t<e.length;t++)r[e[t].id]=!0;for(let n=0;n<t.length;n++){const o=t[n],s=o.inputs;for(const t in s){const n=s[t];let a=!1;for(let t=0;t<e.length;t++)if(r[n.id]){o.outputs.forEach(t=>r[t.id]=!0),a=!0,i[o.id]=!0;break}if(a)break}}const o={};o[n.id]=!0;const s={};for(let e=t.length-1;e>=0;e--){const n=t[e],r=n.inputs;for(let t=0;t<n.outputs.length;t++)if(o[n.outputs[t].id]){for(const t in r)o[r[t].id]=!0,s[n.id]=!0;break}}const a=[];for(let e=0;e<t.length;e++){const n=t[e];if(i[n.id]&&s[n.id]){const t={};for(const e in n.inputs){const i=n.inputs[e];r[i.id]&&(t[e]=i)}const e=Object.assign({},n);e.inputs=t,e.outputs=n.outputs,a.push(e)}}return a}(this.state.activeTape,e,i);if(!r&&0===o.length&&e.length>0)throw new Error("Cannot compute gradient of y=f(x) with respect to x. Make sure that the f you passed encloses all operations that lead from x to y.");return this.tidy("backward",()=>{const t={};t[i.id]=null==n?function(t){const e=Object(u.makeOnesTypedArray)(Object(u.sizeFromShape)(t),"float32");return _.makeTensor(e,t,"float32")}(i.shape):n,function(t,e,n,r){for(let i=e.length-1;i>=0;i--){const o=e[i],s=[];if(o.outputs.forEach(e=>{const n=t[e.id];null!=n?s.push(n):s.push(null)}),null==o.gradient)throw new Error("Cannot compute gradient: gradient function not found "+`for ${o.kernelName}.`);const a=o.gradient(s);for(const e in o.inputs){if(!(e in a))throw new Error(`Cannot backprop through input ${e}. `+`Available gradients found: ${Object.keys(a)}.`);const i=n(()=>a[e]());if("float32"!==i.dtype)throw new Error(`Error in gradient for op ${o.kernelName}. The gradient of input `+`${e} must have 'float32' dtype, but has '${i.dtype}'`);const s=o.inputs[e];if(!u.arraysEqual(i.shape,s.shape))throw new Error(`Error in gradient for op ${o.kernelName}. The gradient of input `+`'${e}' has shape '${i.shape}', which does not match `+`the shape of the input '${s.shape}'`);if(null==t[s.id])t[s.id]=i;else{const e=t[s.id];t[s.id]=r(e,i),e.dispose()}}}}(t,o,t=>this.tidy(t),y);const r=e.map(e=>t[e.id]);return 0===this.state.gradientDepth&&(this.state.activeTape.forEach(t=>{for(const e of t.saved)e.dispose()}),this.state.activeTape=null),{value:i,grads:r}})}customGrad(t){return u.assert(u.isFunction(t),()=>"The f passed in customGrad(f) must be a function."),(...e)=>{let n;u.assert(e.every(t=>t instanceof p.a),()=>"The args passed in customGrad(f)(x1, x2,...) must all be tensors");const r={};e.forEach((t,e)=>{r[e]=t});return this.runKernelFunc({forwardFunc:(r,i)=>(n=t(...[...e,i]),u.assert(n.value instanceof p.a,()=>"The function f passed in customGrad(f) must return an object where `obj.value` is a tensor"),u.assert(u.isFunction(n.gradFunc),()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function."),n.value),backwardsFunc:(t,r)=>{const i=n.gradFunc(t,r),o=Array.isArray(i)?i:[i];u.assert(o.length===e.length,()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function that returns the same number of tensors as inputs passed to f(...)."),u.assert(o.every(t=>t instanceof p.a),()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function that returns a list of only tensors.");const s={};return o.forEach((t,e)=>{s[e]=(()=>t)}),s},inputs:r})}}readSync(t){return this.state.tensorInfo.get(t).backend.readSync(t)}read(t){return this.state.tensorInfo.get(t).backend.read(t)}readToGPU(t,e){return this.state.tensorInfo.get(t).backend.readToGPU(t,e)}async time(t){const e=Object(u.now)(),n=await this.backend.time(t);return n.wallMs=Object(u.now)()-e,n}track(t){return null!=this.state.activeScope&&(t.scopeId=this.state.activeScope.id,this.state.activeScope.track.push(t)),t}get registeredVariables(){return this.state.registeredVariables}reset(){this.pendingBackendInitId++,this.state.dispose(),this.ENV.reset(),this.state=new m;for(const t in this.registry)this.disposeRegisteredKernels(t),this.registry[t].dispose(),delete this.registry[t];this.backendName=null,this.backendInstance=null,this.pendingBackendInit=null}}function b(){const t=Object(o.b)();if(null==t._tfengine){const e=new i.a(t);t._tfengine=new v(e)}return Object(i.c)(t._tfengine.ENV),Object(p.f)(()=>t._tfengine),t._tfengine}v.nextTensorId=0,v.nextVariableId=0;const _=b();function y(t,e){const n={a:t,b:e};return _.runKernel(s.d,n)}e.a=_},L42u:function(t,e,n){var r,i,o,s=n("+ZMJ"),a=n("knuC"),l=n("RPLV"),u=n("ON07"),c=n("7KvD"),h=c.process,d=c.setImmediate,p=c.clearImmediate,f=c.MessageChannel,g=c.Dispatch,m=0,v={},b=function(){var t=+this;if(v.hasOwnProperty(t)){var e=v[t];delete v[t],e()}},_=function(t){b.call(t.data)};d&&p||(d=function(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return v[++m]=function(){a("function"==typeof t?t:Function(t),e)},r(m),m},p=function(t){delete v[t]},"process"==n("R9M2")(h)?r=function(t){h.nextTick(s(b,t,1))}:g&&g.now?r=function(t){g.now(s(b,t,1))}:f?(o=(i=new f).port2,i.port1.onmessage=_,r=s(o.postMessage,o,1)):c.addEventListener&&"function"==typeof postMessage&&!c.importScripts?(r=function(t){c.postMessage(t+"","*")},c.addEventListener("message",_,!1)):r="onreadystatechange"in u("script")?function(t){l.appendChild(u("script")).onreadystatechange=function(){l.removeChild(this),b.call(t)}}:function(t){setTimeout(s(b,t,1),0)}),t.exports={set:d,clear:p}},LGuY:function(t,e){t.exports=function(){throw new Error("define cannot be used indirect")}},LKZe:function(t,e,n){var r=n("NpIQ"),i=n("X8DO"),o=n("TcQ7"),s=n("MmMw"),a=n("D2L2"),l=n("SfB7"),u=Object.getOwnPropertyDescriptor;e.f=n("+E39")?u:function(t,e){if(t=o(t),e=s(e,!0),l)try{return u(t,e)}catch(t){}if(a(t,e))return i(!r.f.call(t,e),t[e])}},M1Ti:function(t,e,n){"use strict";e.a=
  1139. /**
  1140. * @license
  1141. * Copyright 2018 Google LLC. All Rights Reserved.
  1142. * Licensed under the Apache License, Version 2.0 (the "License");
  1143. * you may not use this file except in compliance with the License.
  1144. * You may obtain a copy of the License at
  1145. *
  1146. * http://www.apache.org/licenses/LICENSE-2.0
  1147. *
  1148. * Unless required by applicable law or agreed to in writing, software
  1149. * distributed under the License is distributed on an "AS IS" BASIS,
  1150. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1151. * See the License for the specific language governing permissions and
  1152. * limitations under the License.
  1153. * =============================================================================
  1154. */
  1155. function(t,e,n,o){null==o&&(o=Object(i.inferDtype)(t));if("complex64"===o)throw new Error("Cannot construct a complex64 tensor directly. Please use tf.complex(real, imag).");if(!Object(i.isTypedArray)(t)&&!Array.isArray(t)&&"number"!=typeof t&&"boolean"!=typeof t&&"string"!=typeof t)throw new Error("values passed to tensor(values) must be a number/boolean/string or an array of numbers/booleans/strings, or a TypedArray");if(null!=e){Object(i.assertNonNegativeIntegerDimensions)(e);const t=Object(i.sizeFromShape)(e),r=Object(i.sizeFromShape)(n);Object(i.assert)(t===r,()=>`Based on the provided shape, [${e}], the tensor should have `+`${t} values but has ${r}`);for(let t=0;t<n.length;++t){const r=n[t],o=t!==n.length-1||r!==Object(i.sizeFromShape)(e.slice(t));Object(i.assert)(n[t]===e[t]||!o,()=>"Error creating a new Tensor. Inferred shape "+`(${n}) does not match the provided `+`shape (${e}). `)}}Object(i.isTypedArray)(t)||Array.isArray(t)||(t=[t]);return e=e||n,t="string"!==o?Object(i.toTypedArray)(t,o):Object(i.flatten)(t,[],!0),r.a.makeTensor(t,e,o)};var r=n("Kkag"),i=n("XFvI")},M6a0:function(t,e){},MU5D:function(t,e,n){var r=n("R9M2");t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},Mhyx:function(t,e,n){var r=n("/bQp"),i=n("dSzd")("iterator"),o=Array.prototype;t.exports=function(t){return void 0!==t&&(r.Array===t||o[i]===t)}},MlK1:function(t,e,n){"use strict";var r=n("Kkag"),i=n("l5jf"),o=n("xMQ1"),s=n("XFvI"),a=n("35G1");const l=Object(a.a)({cast_:
  1156. /**
  1157. * @license
  1158. * Copyright 2020 Google Inc. All Rights Reserved.
  1159. * Licensed under the Apache License, Version 2.0 (the "License");
  1160. * you may not use this file except in compliance with the License.
  1161. * You may obtain a copy of the License at
  1162. *
  1163. * http://www.apache.org/licenses/LICENSE-2.0
  1164. *
  1165. * Unless required by applicable law or agreed to in writing, software
  1166. * distributed under the License is distributed on an "AS IS" BASIS,
  1167. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1168. * See the License for the specific language governing permissions and
  1169. * limitations under the License.
  1170. * =============================================================================
  1171. */
  1172. function(t,e){const n=Object(o.a)(t,"x","cast");if(!s.isValidDtype(e))throw new Error(`Failed to cast to unknown dtype ${e}`);if("string"===e&&"string"!==n.dtype||"string"!==e&&"string"===n.dtype)throw new Error("Only strings can be casted to strings");const a={x:n},l={dtype:e};return r.a.runKernel(i.w,a,l)}});e.a=l},MmMw:function(t,e,n){var r=n("EqjI");t.exports=function(t,e){if(!r(t))return t;var n,i;if(e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;if("function"==typeof(n=t.valueOf)&&!r(i=n.call(t)))return i;if(!e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},NMof:function(t,e,n){"use strict";var r,i;"function"==typeof Symbol&&Symbol.iterator;void 0===(i="function"==typeof(r=function(){var t=window,e={placement:"bottom",gpuAcceleration:!0,offset:0,boundariesElement:"viewport",boundariesPadding:5,preventOverflowOrder:["left","right","top","bottom"],flipBehavior:"flip",arrowElement:"[x-arrow]",arrowOffset:0,modifiers:["shift","offset","preventOverflow","keepTogether","arrow","flip","applyStyle"],modifiersIgnored:[],forceAbsolute:!1};function n(t,n,r){this._reference=t.jquery?t[0]:t,this.state={};var i=void 0===n||null===n,o=n&&"[object Object]"===Object.prototype.toString.call(n);return this._popper=i||o?this.parse(o?n:{}):n.jquery?n[0]:n,this._options=Object.assign({},e,r),this._options.modifiers=this._options.modifiers.map(function(t){if(-1===this._options.modifiersIgnored.indexOf(t))return"applyStyle"===t&&this._popper.setAttribute("x-placement",this._options.placement),this.modifiers[t]||t}.bind(this)),this.state.position=this._getPosition(this._popper,this._reference),c(this._popper,{position:this.state.position,top:0}),this.update(),this._setupEventListeners(),this}function r(e){var n=e.style.display,r=e.style.visibility;e.style.display="block",e.style.visibility="hidden";e.offsetWidth;var i=t.getComputedStyle(e),o=parseFloat(i.marginTop)+parseFloat(i.marginBottom),s=parseFloat(i.marginLeft)+parseFloat(i.marginRight),a={width:e.offsetWidth+s,height:e.offsetHeight+o};return e.style.display=n,e.style.visibility=r,a}function i(t){var e={left:"right",right:"left",bottom:"top",top:"bottom"};return t.replace(/left|right|bottom|top/g,function(t){return e[t]})}function o(t){var e=Object.assign({},t);return e.right=e.left+e.width,e.bottom=e.top+e.height,e}function s(t,e){var n,r=0;for(n in t){if(t[n]===e)return r;r++}return null}function a(e,n){return t.getComputedStyle(e,null)[n]}function l(e){var n=e.offsetParent;return n!==t.document.body&&n?n:t.document.documentElement}function u(e){var n=e.parentNode;return n?n===t.document?t.document.body.scrollTop||t.document.body.scrollLeft?t.document.body:t.document.documentElement:-1!==["scroll","auto"].indexOf(a(n,"overflow"))||-1!==["scroll","auto"].indexOf(a(n,"overflow-x"))||-1!==["scroll","auto"].indexOf(a(n,"overflow-y"))?n:u(e.parentNode):e}function c(t,e){Object.keys(e).forEach(function(n){var r,i="";-1!==["width","height","top","right","bottom","left"].indexOf(n)&&(""!==(r=e[n])&&!isNaN(parseFloat(r))&&isFinite(r))&&(i="px"),t.style[n]=e[n]+i})}function h(t){var e={width:t.offsetWidth,height:t.offsetHeight,left:t.offsetLeft,top:t.offsetTop};return e.right=e.left+e.width,e.bottom=e.top+e.height,e}function d(t){var e=t.getBoundingClientRect(),n=-1!=navigator.userAgent.indexOf("MSIE")&&"HTML"===t.tagName?-t.scrollTop:e.top;return{left:e.left,top:n,right:e.right,bottom:e.bottom,width:e.right-e.left,height:e.bottom-n}}function p(e){for(var n=["","ms","webkit","moz","o"],r=0;r<n.length;r++){var i=n[r]?n[r]+e.charAt(0).toUpperCase()+e.slice(1):e;if(void 0!==t.document.body.style[i])return i}return null}return n.prototype.destroy=function(){return this._popper.removeAttribute("x-placement"),this._popper.style.left="",this._popper.style.position="",this._popper.style.top="",this._popper.style[p("transform")]="",this._removeEventListeners(),this._options.removeOnDestroy&&this._popper.remove(),this},n.prototype.update=function(){var t={instance:this,styles:{}};t.placement=this._options.placement,t._originalPlacement=this._options.placement,t.offsets=this._getOffsets(this._popper,this._reference,t.placement),t.boundaries=this._getBoundaries(t,this._options.boundariesPadding,this._options.boundariesElement),t=this.runModifiers(t,this._options.modifiers),"function"==typeof this.state.updateCallback&&this.state.updateCallback(t)},n.prototype.onCreate=function(t){return t(this),this},n.prototype.onUpdate=function(t){return this.state.updateCallback=t,this},n.prototype.parse=function(e){var n={tagName:"div",classNames:["popper"],attributes:[],parent:t.document.body,content:"",contentType:"text",arrowTagName:"div",arrowClassNames:["popper__arrow"],arrowAttributes:["x-arrow"]};e=Object.assign({},n,e);var r=t.document,i=r.createElement(e.tagName);if(a(i,e.classNames),l(i,e.attributes),"node"===e.contentType?i.appendChild(e.content.jquery?e.content[0]:e.content):"html"===e.contentType?i.innerHTML=e.content:i.textContent=e.content,e.arrowTagName){var o=r.createElement(e.arrowTagName);a(o,e.arrowClassNames),l(o,e.arrowAttributes),i.appendChild(o)}var s=e.parent.jquery?e.parent[0]:e.parent;if("string"==typeof s){if((s=r.querySelectorAll(e.parent)).length>1&&console.warn("WARNING: the given `parent` query("+e.parent+") matched more than one element, the first one will be used"),0===s.length)throw"ERROR: the given `parent` doesn't exists!";s=s[0]}return s.length>1&&s instanceof Element==!1&&(console.warn("WARNING: you have passed as parent a list of elements, the first one will be used"),s=s[0]),s.appendChild(i),i;function a(t,e){e.forEach(function(e){t.classList.add(e)})}function l(t,e){e.forEach(function(e){t.setAttribute(e.split(":")[0],e.split(":")[1]||"")})}},n.prototype._getPosition=function(e,n){l(n);return this._options.forceAbsolute?"absolute":function e(n){if(n===t.document.body)return!1;if("fixed"===a(n,"position"))return!0;return n.parentNode?e(n.parentNode):n}(n)?"fixed":"absolute"},n.prototype._getOffsets=function(t,e,n){n=n.split("-")[0];var i={};i.position=this.state.position;var o="fixed"===i.position,s=function(t,e,n){var r=d(t),i=d(e);if(n){var o=u(e);i.top+=o.scrollTop,i.bottom+=o.scrollTop,i.left+=o.scrollLeft,i.right+=o.scrollLeft}return{top:r.top-i.top,left:r.left-i.left,bottom:r.top-i.top+r.height,right:r.left-i.left+r.width,width:r.width,height:r.height}}(e,l(t),o),a=r(t);return-1!==["right","left"].indexOf(n)?(i.top=s.top+s.height/2-a.height/2,i.left="left"===n?s.left-a.width:s.right):(i.left=s.left+s.width/2-a.width/2,i.top="top"===n?s.top-a.height:s.bottom),i.width=a.width,i.height=a.height,{popper:i,reference:s}},n.prototype._setupEventListeners=function(){if(this.state.updateBound=this.update.bind(this),t.addEventListener("resize",this.state.updateBound),"window"!==this._options.boundariesElement){var e=u(this._reference);e!==t.document.body&&e!==t.document.documentElement||(e=t),e.addEventListener("scroll",this.state.updateBound),this.state.scrollTarget=e}},n.prototype._removeEventListeners=function(){t.removeEventListener("resize",this.state.updateBound),"window"!==this._options.boundariesElement&&this.state.scrollTarget&&(this.state.scrollTarget.removeEventListener("scroll",this.state.updateBound),this.state.scrollTarget=null),this.state.updateBound=null},n.prototype._getBoundaries=function(e,n,r){var i,o,s={};if("window"===r){var a=t.document.body,c=t.document.documentElement;i=Math.max(a.scrollHeight,a.offsetHeight,c.clientHeight,c.scrollHeight,c.offsetHeight),s={top:0,right:Math.max(a.scrollWidth,a.offsetWidth,c.clientWidth,c.scrollWidth,c.offsetWidth),bottom:i,left:0}}else if("viewport"===r){var d=l(this._popper),p=u(this._popper),f=h(d),g="fixed"===e.offsets.popper.position?0:(o=p)==document.body?Math.max(document.documentElement.scrollTop,document.body.scrollTop):o.scrollTop,m="fixed"===e.offsets.popper.position?0:function(t){return t==document.body?Math.max(document.documentElement.scrollLeft,document.body.scrollLeft):t.scrollLeft}(p);s={top:0-(f.top-g),right:t.document.documentElement.clientWidth-(f.left-m),bottom:t.document.documentElement.clientHeight-(f.top-g),left:0-(f.left-m)}}else s=l(this._popper)===r?{top:0,left:0,right:r.clientWidth,bottom:r.clientHeight}:h(r);return s.left+=n,s.right-=n,s.top=s.top+n,s.bottom=s.bottom-n,s},n.prototype.runModifiers=function(t,e,n){var r=e.slice();return void 0!==n&&(r=this._options.modifiers.slice(0,s(this._options.modifiers,n))),r.forEach(function(e){var n;(n=e)&&"[object Function]"==={}.toString.call(n)&&(t=e.call(this,t))}.bind(this)),t},n.prototype.isModifierRequired=function(t,e){var n=s(this._options.modifiers,t);return!!this._options.modifiers.slice(0,n).filter(function(t){return t===e}).length},n.prototype.modifiers={},n.prototype.modifiers.applyStyle=function(t){var e,n={position:t.offsets.popper.position},r=Math.round(t.offsets.popper.left),i=Math.round(t.offsets.popper.top);return this._options.gpuAcceleration&&(e=p("transform"))?(n[e]="translate3d("+r+"px, "+i+"px, 0)",n.top=0,n.left=0):(n.left=r,n.top=i),Object.assign(n,t.styles),c(this._popper,n),this._popper.setAttribute("x-placement",t.placement),this.isModifierRequired(this.modifiers.applyStyle,this.modifiers.arrow)&&t.offsets.arrow&&c(t.arrowElement,t.offsets.arrow),t},n.prototype.modifiers.shift=function(t){var e=t.placement,n=e.split("-")[0],r=e.split("-")[1];if(r){var i=t.offsets.reference,s=o(t.offsets.popper),a={y:{start:{top:i.top},end:{top:i.top+i.height-s.height}},x:{start:{left:i.left},end:{left:i.left+i.width-s.width}}},l=-1!==["bottom","top"].indexOf(n)?"x":"y";t.offsets.popper=Object.assign(s,a[l][r])}return t},n.prototype.modifiers.preventOverflow=function(t){var e=this._options.preventOverflowOrder,n=o(t.offsets.popper),r={left:function(){var e=n.left;return n.left<t.boundaries.left&&(e=Math.max(n.left,t.boundaries.left)),{left:e}},right:function(){var e=n.left;return n.right>t.boundaries.right&&(e=Math.min(n.left,t.boundaries.right-n.width)),{left:e}},top:function(){var e=n.top;return n.top<t.boundaries.top&&(e=Math.max(n.top,t.boundaries.top)),{top:e}},bottom:function(){var e=n.top;return n.bottom>t.boundaries.bottom&&(e=Math.min(n.top,t.boundaries.bottom-n.height)),{top:e}}};return e.forEach(function(e){t.offsets.popper=Object.assign(n,r[e]())}),t},n.prototype.modifiers.keepTogether=function(t){var e=o(t.offsets.popper),n=t.offsets.reference,r=Math.floor;return e.right<r(n.left)&&(t.offsets.popper.left=r(n.left)-e.width),e.left>r(n.right)&&(t.offsets.popper.left=r(n.right)),e.bottom<r(n.top)&&(t.offsets.popper.top=r(n.top)-e.height),e.top>r(n.bottom)&&(t.offsets.popper.top=r(n.bottom)),t},n.prototype.modifiers.flip=function(t){if(!this.isModifierRequired(this.modifiers.flip,this.modifiers.preventOverflow))return console.warn("WARNING: preventOverflow modifier is required by flip modifier in order to work, be sure to include it before flip!"),t;if(t.flipped&&t.placement===t._originalPlacement)return t;var e=t.placement.split("-")[0],n=i(e),r=t.placement.split("-")[1]||"",s=[];return(s="flip"===this._options.flipBehavior?[e,n]:this._options.flipBehavior).forEach(function(a,l){if(e===a&&s.length!==l+1){e=t.placement.split("-")[0],n=i(e);var u=o(t.offsets.popper),c=-1!==["right","bottom"].indexOf(e);(c&&Math.floor(t.offsets.reference[e])>Math.floor(u[n])||!c&&Math.floor(t.offsets.reference[e])<Math.floor(u[n]))&&(t.flipped=!0,t.placement=s[l+1],r&&(t.placement+="-"+r),t.offsets.popper=this._getOffsets(this._popper,this._reference,t.placement).popper,t=this.runModifiers(t,this._options.modifiers,this._flip))}}.bind(this)),t},n.prototype.modifiers.offset=function(t){var e=this._options.offset,n=t.offsets.popper;return-1!==t.placement.indexOf("left")?n.top-=e:-1!==t.placement.indexOf("right")?n.top+=e:-1!==t.placement.indexOf("top")?n.left-=e:-1!==t.placement.indexOf("bottom")&&(n.left+=e),t},n.prototype.modifiers.arrow=function(t){var e=this._options.arrowElement,n=this._options.arrowOffset;if("string"==typeof e&&(e=this._popper.querySelector(e)),!e)return t;if(!this._popper.contains(e))return console.warn("WARNING: `arrowElement` must be child of its popper element!"),t;if(!this.isModifierRequired(this.modifiers.arrow,this.modifiers.keepTogether))return console.warn("WARNING: keepTogether modifier is required by arrow modifier in order to work, be sure to include it before arrow!"),t;var i={},s=t.placement.split("-")[0],a=o(t.offsets.popper),l=t.offsets.reference,u=-1!==["left","right"].indexOf(s),c=u?"height":"width",h=u?"top":"left",d=u?"left":"top",p=u?"bottom":"right",f=r(e)[c];l[p]-f<a[h]&&(t.offsets.popper[h]-=a[h]-(l[p]-f)),l[h]+f>a[p]&&(t.offsets.popper[h]+=l[h]+f-a[p]);var g=l[h]+(n||l[c]/2-f/2)-a[h];return g=Math.max(Math.min(a[c]-f-8,g),8),i[h]=g,i[d]="",t.offsets.arrow=i,t.arrowElement=e,t},Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(void 0===t||null===t)throw new TypeError("Cannot convert first argument to object");for(var e=Object(t),n=1;n<arguments.length;n++){var r=arguments[n];if(void 0!==r&&null!==r){r=Object(r);for(var i=Object.keys(r),o=0,s=i.length;o<s;o++){var a=i[o],l=Object.getOwnPropertyDescriptor(r,a);void 0!==l&&l.enumerable&&(e[a]=r[a])}}}return e}}),n})?r.call(e,n,e,t):r)||(t.exports=i)},"NWt+":function(t,e,n){var r=n("+ZMJ"),i=n("msXi"),o=n("Mhyx"),s=n("77Pl"),a=n("QRG4"),l=n("3fs2"),u={},c={};(e=t.exports=function(t,e,n,h,d){var p,f,g,m,v=d?function(){return t}:l(t),b=r(n,h,e?2:1),_=0;if("function"!=typeof v)throw TypeError(t+" is not iterable!");if(o(v)){for(p=a(t.length);p>_;_++)if((m=e?b(s(f=t[_])[0],f[1]):b(t[_]))===u||m===c)return m}else for(g=v.call(t);!(f=g.next()).done;)if((m=i(g,b,f.value,e))===u||m===c)return m}).BREAK=u,e.RETURN=c},NYxO:function(t,e,n){"use strict";(function(t){var n=("undefined"!=typeof window?window:void 0!==t?t:{}).__VUE_DEVTOOLS_GLOBAL_HOOK__;function r(t,e){if(void 0===e&&(e=[]),null===t||"object"!=typeof t)return t;var n,i=(n=function(e){return e.original===t},e.filter(n)[0]);if(i)return i.copy;var o=Array.isArray(t)?[]:{};return e.push({original:t,copy:o}),Object.keys(t).forEach(function(n){o[n]=r(t[n],e)}),o}function i(t,e){Object.keys(t).forEach(function(n){return e(t[n],n)})}function o(t){return null!==t&&"object"==typeof t}var s=function(t,e){this.runtime=e,this._children=Object.create(null),this._rawModule=t;var n=t.state;this.state=("function"==typeof n?n():n)||{}},a={namespaced:{configurable:!0}};a.namespaced.get=function(){return!!this._rawModule.namespaced},s.prototype.addChild=function(t,e){this._children[t]=e},s.prototype.removeChild=function(t){delete this._children[t]},s.prototype.getChild=function(t){return this._children[t]},s.prototype.hasChild=function(t){return t in this._children},s.prototype.update=function(t){this._rawModule.namespaced=t.namespaced,t.actions&&(this._rawModule.actions=t.actions),t.mutations&&(this._rawModule.mutations=t.mutations),t.getters&&(this._rawModule.getters=t.getters)},s.prototype.forEachChild=function(t){i(this._children,t)},s.prototype.forEachGetter=function(t){this._rawModule.getters&&i(this._rawModule.getters,t)},s.prototype.forEachAction=function(t){this._rawModule.actions&&i(this._rawModule.actions,t)},s.prototype.forEachMutation=function(t){this._rawModule.mutations&&i(this._rawModule.mutations,t)},Object.defineProperties(s.prototype,a);var l=function(t){this.register([],t,!1)};l.prototype.get=function(t){return t.reduce(function(t,e){return t.getChild(e)},this.root)},l.prototype.getNamespace=function(t){var e=this.root;return t.reduce(function(t,n){return t+((e=e.getChild(n)).namespaced?n+"/":"")},"")},l.prototype.update=function(t){!function t(e,n,r){0;n.update(r);if(r.modules)for(var i in r.modules){if(!n.getChild(i))return void 0;t(e.concat(i),n.getChild(i),r.modules[i])}}([],this.root,t)},l.prototype.register=function(t,e,n){var r=this;void 0===n&&(n=!0);var o=new s(e,n);0===t.length?this.root=o:this.get(t.slice(0,-1)).addChild(t[t.length-1],o);e.modules&&i(e.modules,function(e,i){r.register(t.concat(i),e,n)})},l.prototype.unregister=function(t){var e=this.get(t.slice(0,-1)),n=t[t.length-1],r=e.getChild(n);r&&r.runtime&&e.removeChild(n)},l.prototype.isRegistered=function(t){var e=this.get(t.slice(0,-1)),n=t[t.length-1];return!!e&&e.hasChild(n)};var u;var c=function(t){var e=this;void 0===t&&(t={}),!u&&"undefined"!=typeof window&&window.Vue&&b(window.Vue);var r=t.plugins;void 0===r&&(r=[]);var i=t.strict;void 0===i&&(i=!1),this._committing=!1,this._actions=Object.create(null),this._actionSubscribers=[],this._mutations=Object.create(null),this._wrappedGetters=Object.create(null),this._modules=new l(t),this._modulesNamespaceMap=Object.create(null),this._subscribers=[],this._watcherVM=new u,this._makeLocalGettersCache=Object.create(null);var o=this,s=this.dispatch,a=this.commit;this.dispatch=function(t,e){return s.call(o,t,e)},this.commit=function(t,e,n){return a.call(o,t,e,n)},this.strict=i;var c=this._modules.root.state;g(this,c,[],this._modules.root),f(this,c),r.forEach(function(t){return t(e)}),(void 0!==t.devtools?t.devtools:u.config.devtools)&&function(t){n&&(t._devtoolHook=n,n.emit("vuex:init",t),n.on("vuex:travel-to-state",function(e){t.replaceState(e)}),t.subscribe(function(t,e){n.emit("vuex:mutation",t,e)},{prepend:!0}),t.subscribeAction(function(t,e){n.emit("vuex:action",t,e)},{prepend:!0}))}(this)},h={state:{configurable:!0}};function d(t,e,n){return e.indexOf(t)<0&&(n&&n.prepend?e.unshift(t):e.push(t)),function(){var n=e.indexOf(t);n>-1&&e.splice(n,1)}}function p(t,e){t._actions=Object.create(null),t._mutations=Object.create(null),t._wrappedGetters=Object.create(null),t._modulesNamespaceMap=Object.create(null);var n=t.state;g(t,n,[],t._modules.root,!0),f(t,n,e)}function f(t,e,n){var r=t._vm;t.getters={},t._makeLocalGettersCache=Object.create(null);var o={};i(t._wrappedGetters,function(e,n){o[n]=function(t,e){return function(){return t(e)}}(e,t),Object.defineProperty(t.getters,n,{get:function(){return t._vm[n]},enumerable:!0})});var s=u.config.silent;u.config.silent=!0,t._vm=new u({data:{$$state:e},computed:o}),u.config.silent=s,t.strict&&function(t){t._vm.$watch(function(){return this._data.$$state},function(){0},{deep:!0,sync:!0})}(t),r&&(n&&t._withCommit(function(){r._data.$$state=null}),u.nextTick(function(){return r.$destroy()}))}function g(t,e,n,r,i){var o=!n.length,s=t._modules.getNamespace(n);if(r.namespaced&&(t._modulesNamespaceMap[s],t._modulesNamespaceMap[s]=r),!o&&!i){var a=m(e,n.slice(0,-1)),l=n[n.length-1];t._withCommit(function(){u.set(a,l,r.state)})}var c=r.context=function(t,e,n){var r=""===e,i={dispatch:r?t.dispatch:function(n,r,i){var o=v(n,r,i),s=o.payload,a=o.options,l=o.type;return a&&a.root||(l=e+l),t.dispatch(l,s)},commit:r?t.commit:function(n,r,i){var o=v(n,r,i),s=o.payload,a=o.options,l=o.type;a&&a.root||(l=e+l),t.commit(l,s,a)}};return Object.defineProperties(i,{getters:{get:r?function(){return t.getters}:function(){return function(t,e){if(!t._makeLocalGettersCache[e]){var n={},r=e.length;Object.keys(t.getters).forEach(function(i){if(i.slice(0,r)===e){var o=i.slice(r);Object.defineProperty(n,o,{get:function(){return t.getters[i]},enumerable:!0})}}),t._makeLocalGettersCache[e]=n}return t._makeLocalGettersCache[e]}(t,e)}},state:{get:function(){return m(t.state,n)}}}),i}(t,s,n);r.forEachMutation(function(e,n){!function(t,e,n,r){(t._mutations[e]||(t._mutations[e]=[])).push(function(e){n.call(t,r.state,e)})}(t,s+n,e,c)}),r.forEachAction(function(e,n){var r=e.root?n:s+n,i=e.handler||e;!function(t,e,n,r){(t._actions[e]||(t._actions[e]=[])).push(function(e){var i,o=n.call(t,{dispatch:r.dispatch,commit:r.commit,getters:r.getters,state:r.state,rootGetters:t.getters,rootState:t.state},e);return(i=o)&&"function"==typeof i.then||(o=Promise.resolve(o)),t._devtoolHook?o.catch(function(e){throw t._devtoolHook.emit("vuex:error",e),e}):o})}(t,r,i,c)}),r.forEachGetter(function(e,n){!function(t,e,n,r){if(t._wrappedGetters[e])return void 0;t._wrappedGetters[e]=function(t){return n(r.state,r.getters,t.state,t.getters)}}(t,s+n,e,c)}),r.forEachChild(function(r,o){g(t,e,n.concat(o),r,i)})}function m(t,e){return e.reduce(function(t,e){return t[e]},t)}function v(t,e,n){return o(t)&&t.type&&(n=e,e=t,t=t.type),{type:t,payload:e,options:n}}function b(t){u&&t===u||
  1173. /*!
  1174. * vuex v3.6.2
  1175. * (c) 2021 Evan You
  1176. * @license MIT
  1177. */
  1178. function(t){if(Number(t.version.split(".")[0])>=2)t.mixin({beforeCreate:n});else{var e=t.prototype._init;t.prototype._init=function(t){void 0===t&&(t={}),t.init=t.init?[n].concat(t.init):n,e.call(this,t)}}function n(){var t=this.$options;t.store?this.$store="function"==typeof t.store?t.store():t.store:t.parent&&t.parent.$store&&(this.$store=t.parent.$store)}}(u=t)}h.state.get=function(){return this._vm._data.$$state},h.state.set=function(t){0},c.prototype.commit=function(t,e,n){var r=this,i=v(t,e,n),o=i.type,s=i.payload,a=(i.options,{type:o,payload:s}),l=this._mutations[o];l&&(this._withCommit(function(){l.forEach(function(t){t(s)})}),this._subscribers.slice().forEach(function(t){return t(a,r.state)}))},c.prototype.dispatch=function(t,e){var n=this,r=v(t,e),i=r.type,o=r.payload,s={type:i,payload:o},a=this._actions[i];if(a){try{this._actionSubscribers.slice().filter(function(t){return t.before}).forEach(function(t){return t.before(s,n.state)})}catch(t){0}var l=a.length>1?Promise.all(a.map(function(t){return t(o)})):a[0](o);return new Promise(function(t,e){l.then(function(e){try{n._actionSubscribers.filter(function(t){return t.after}).forEach(function(t){return t.after(s,n.state)})}catch(t){0}t(e)},function(t){try{n._actionSubscribers.filter(function(t){return t.error}).forEach(function(e){return e.error(s,n.state,t)})}catch(t){0}e(t)})})}},c.prototype.subscribe=function(t,e){return d(t,this._subscribers,e)},c.prototype.subscribeAction=function(t,e){return d("function"==typeof t?{before:t}:t,this._actionSubscribers,e)},c.prototype.watch=function(t,e,n){var r=this;return this._watcherVM.$watch(function(){return t(r.state,r.getters)},e,n)},c.prototype.replaceState=function(t){var e=this;this._withCommit(function(){e._vm._data.$$state=t})},c.prototype.registerModule=function(t,e,n){void 0===n&&(n={}),"string"==typeof t&&(t=[t]),this._modules.register(t,e),g(this,this.state,t,this._modules.get(t),n.preserveState),f(this,this.state)},c.prototype.unregisterModule=function(t){var e=this;"string"==typeof t&&(t=[t]),this._modules.unregister(t),this._withCommit(function(){var n=m(e.state,t.slice(0,-1));u.delete(n,t[t.length-1])}),p(this)},c.prototype.hasModule=function(t){return"string"==typeof t&&(t=[t]),this._modules.isRegistered(t)},c.prototype.hotUpdate=function(t){this._modules.update(t),p(this,!0)},c.prototype._withCommit=function(t){var e=this._committing;this._committing=!0,t(),this._committing=e},Object.defineProperties(c.prototype,h);var _=w(function(t,e){var n={};return E(e).forEach(function(e){var r=e.key,i=e.val;n[r]=function(){var e=this.$store.state,n=this.$store.getters;if(t){var r=C(this.$store,"mapState",t);if(!r)return;e=r.context.state,n=r.context.getters}return"function"==typeof i?i.call(this,e,n):e[i]},n[r].vuex=!0}),n}),y=w(function(t,e){var n={};return E(e).forEach(function(e){var r=e.key,i=e.val;n[r]=function(){for(var e=[],n=arguments.length;n--;)e[n]=arguments[n];var r=this.$store.commit;if(t){var o=C(this.$store,"mapMutations",t);if(!o)return;r=o.context.commit}return"function"==typeof i?i.apply(this,[r].concat(e)):r.apply(this.$store,[i].concat(e))}}),n}),T=w(function(t,e){var n={};return E(e).forEach(function(e){var r=e.key,i=e.val;i=t+i,n[r]=function(){if(!t||C(this.$store,"mapGetters",t))return this.$store.getters[i]},n[r].vuex=!0}),n}),x=w(function(t,e){var n={};return E(e).forEach(function(e){var r=e.key,i=e.val;n[r]=function(){for(var e=[],n=arguments.length;n--;)e[n]=arguments[n];var r=this.$store.dispatch;if(t){var o=C(this.$store,"mapActions",t);if(!o)return;r=o.context.dispatch}return"function"==typeof i?i.apply(this,[r].concat(e)):r.apply(this.$store,[i].concat(e))}}),n});function E(t){return function(t){return Array.isArray(t)||o(t)}(t)?Array.isArray(t)?t.map(function(t){return{key:t,val:t}}):Object.keys(t).map(function(e){return{key:e,val:t[e]}}):[]}function w(t){return function(e,n){return"string"!=typeof e?(n=e,e=""):"/"!==e.charAt(e.length-1)&&(e+="/"),t(e,n)}}function C(t,e,n){return t._modulesNamespaceMap[n]}function S(t,e,n){var r=n?t.groupCollapsed:t.group;try{r.call(t,e)}catch(n){t.log(e)}}function k(t){try{t.groupEnd()}catch(e){t.log("—— log end ——")}}function O(){var t=new Date;return" @ "+I(t.getHours(),2)+":"+I(t.getMinutes(),2)+":"+I(t.getSeconds(),2)+"."+I(t.getMilliseconds(),3)}function I(t,e){return n="0",r=e-t.toString().length,new Array(r+1).join(n)+t;var n,r}var R={Store:c,install:b,version:"3.6.2",mapState:_,mapMutations:y,mapGetters:T,mapActions:x,createNamespacedHelpers:function(t){return{mapState:_.bind(null,t),mapGetters:T.bind(null,t),mapMutations:y.bind(null,t),mapActions:x.bind(null,t)}},createLogger:function(t){void 0===t&&(t={});var e=t.collapsed;void 0===e&&(e=!0);var n=t.filter;void 0===n&&(n=function(t,e,n){return!0});var i=t.transformer;void 0===i&&(i=function(t){return t});var o=t.mutationTransformer;void 0===o&&(o=function(t){return t});var s=t.actionFilter;void 0===s&&(s=function(t,e){return!0});var a=t.actionTransformer;void 0===a&&(a=function(t){return t});var l=t.logMutations;void 0===l&&(l=!0);var u=t.logActions;void 0===u&&(u=!0);var c=t.logger;return void 0===c&&(c=console),function(t){var h=r(t.state);void 0!==c&&(l&&t.subscribe(function(t,s){var a=r(s);if(n(t,h,a)){var l=O(),u=o(t),d="mutation "+t.type+l;S(c,d,e),c.log("%c prev state","color: #9E9E9E; font-weight: bold",i(h)),c.log("%c mutation","color: #03A9F4; font-weight: bold",u),c.log("%c next state","color: #4CAF50; font-weight: bold",i(a)),k(c)}h=a}),u&&t.subscribeAction(function(t,n){if(s(t,n)){var r=O(),i=a(t),o="action "+t.type+r;S(c,o,e),c.log("%c action","color: #03A9F4; font-weight: bold",i),k(c)}}))}}};e.a=R}).call(e,n("DuR2"))},Nhog:function(t,e,n){"use strict";(function(t,n){
  1179. /**
  1180. * @license
  1181. * Copyright 2020 Google LLC. All Rights Reserved.
  1182. * Licensed under the Apache License, Version 2.0 (the "License");
  1183. * you may not use this file except in compliance with the License.
  1184. * You may obtain a copy of the License at
  1185. *
  1186. * http://www.apache.org/licenses/LICENSE-2.0
  1187. *
  1188. * Unless required by applicable law or agreed to in writing, software
  1189. * distributed under the License is distributed on an "AS IS" BASIS,
  1190. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1191. * See the License for the specific language governing permissions and
  1192. * limitations under the License.
  1193. * =============================================================================
  1194. */
  1195. let r;function i(){if(null==r){let e;if("undefined"!=typeof window)e=window;else if(void 0!==t)e=t;else if(void 0!==n)e=n;else{if("undefined"==typeof self)throw new Error("Could not find a global object");e=self}r=e}return r}e.b=i,e.a=function(t,e){const n=function(){const t=i();null==t._tfGlobals&&(t._tfGlobals=new Map);return t._tfGlobals}();if(n.has(t))return n.get(t);{const r=e();return n.set(t,r),n.get(t)}}}).call(e,n("DuR2"),n("W2nU"))},NpIQ:function(t,e){e.f={}.propertyIsEnumerable},O4g8:function(t,e){t.exports=!0},OAzY:function(t,e,n){"use strict";e.__esModule=!0;var r,i=n("7+uW"),o=(r=i)&&r.__esModule?r:{default:r},s=n("2kvA");var a=!1,l=!1,u=void 0,c=function(){if(!o.default.prototype.$isServer){var t=d.modalDom;return t?a=!0:(a=!1,t=document.createElement("div"),d.modalDom=t,t.addEventListener("touchmove",function(t){t.preventDefault(),t.stopPropagation()}),t.addEventListener("click",function(){d.doOnModalClick&&d.doOnModalClick()})),t}},h={},d={modalFade:!0,getInstance:function(t){return h[t]},register:function(t,e){t&&e&&(h[t]=e)},deregister:function(t){t&&(h[t]=null,delete h[t])},nextZIndex:function(){return d.zIndex++},modalStack:[],doOnModalClick:function(){var t=d.modalStack[d.modalStack.length-1];if(t){var e=d.getInstance(t.id);e&&e.closeOnClickModal&&e.close()}},openModal:function(t,e,n,r,i){if(!o.default.prototype.$isServer&&t&&void 0!==e){this.modalFade=i;for(var l=this.modalStack,u=0,h=l.length;u<h;u++){if(l[u].id===t)return}var d=c();if((0,s.addClass)(d,"v-modal"),this.modalFade&&!a&&(0,s.addClass)(d,"v-modal-enter"),r)r.trim().split(/\s+/).forEach(function(t){return(0,s.addClass)(d,t)});setTimeout(function(){(0,s.removeClass)(d,"v-modal-enter")},200),n&&n.parentNode&&11!==n.parentNode.nodeType?n.parentNode.appendChild(d):document.body.appendChild(d),e&&(d.style.zIndex=e),d.tabIndex=0,d.style.display="",this.modalStack.push({id:t,zIndex:e,modalClass:r})}},closeModal:function(t){var e=this.modalStack,n=c();if(e.length>0){var r=e[e.length-1];if(r.id===t){if(r.modalClass)r.modalClass.trim().split(/\s+/).forEach(function(t){return(0,s.removeClass)(n,t)});e.pop(),e.length>0&&(n.style.zIndex=e[e.length-1].zIndex)}else for(var i=e.length-1;i>=0;i--)if(e[i].id===t){e.splice(i,1);break}}0===e.length&&(this.modalFade&&(0,s.addClass)(n,"v-modal-leave"),setTimeout(function(){0===e.length&&(n.parentNode&&n.parentNode.removeChild(n),n.style.display="none",d.modalDom=void 0),(0,s.removeClass)(n,"v-modal-leave")},200))}};Object.defineProperty(d,"zIndex",{configurable:!0,get:function(){return l||(u=u||(o.default.prototype.$ELEMENT||{}).zIndex||2e3,l=!0),u},set:function(t){u=t}});o.default.prototype.$isServer||window.addEventListener("keydown",function(t){if(27===t.keyCode){var e=function(){if(!o.default.prototype.$isServer&&d.modalStack.length>0){var t=d.modalStack[d.modalStack.length-1];if(!t)return;return d.getInstance(t.id)}}();e&&e.closeOnPressEscape&&(e.handleClose?e.handleClose():e.handleAction?e.handleAction("cancel"):e.close())}}),e.default=d},ODj2:function(t,e,n){"use strict";var r=n("Kkag"),i=n("l5jf"),o=n("jb1O"),s=n("xMQ1"),a=n("35G1");const l=Object(a.a)({add_:
  1196. /**
  1197. * @license
  1198. * Copyright 2020 Google LLC. All Rights Reserved.
  1199. * Licensed under the Apache License, Version 2.0 (the "License");
  1200. * you may not use this file except in compliance with the License.
  1201. * You may obtain a copy of the License at
  1202. *
  1203. * http://www.apache.org/licenses/LICENSE-2.0
  1204. *
  1205. * Unless required by applicable law or agreed to in writing, software
  1206. * distributed under the License is distributed on an "AS IS" BASIS,
  1207. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1208. * See the License for the specific language governing permissions and
  1209. * limitations under the License.
  1210. * =============================================================================
  1211. */
  1212. function(t,e){let n=Object(s.a)(t,"a","add"),a=Object(s.a)(e,"b","add");[n,a]=Object(o.c)(n,a);const l={a:n,b:a};return r.a.runKernel(i.d,l)}});e.a=l},ON07:function(t,e,n){var r=n("EqjI"),i=n("7KvD").document,o=r(i)&&r(i.createElement);t.exports=function(t){return o?i.createElement(t):{}}},ON3O:function(t,e,n){var r=n("uY1a");t.exports=function(t,e,n){return void 0===n?r(t,e,!1):r(t,n,!1!==e)}},OYls:function(t,e,n){n("crlp")("asyncIterator")},"Oi+a":function(t,e,n){"use strict";var r=n("dIwP"),i=n("qRfI");t.exports=function(t,e){return t&&!r(e)?i(t,e):e}},PIk1:function(t,e,n){var r;r=function(t){var e,n,r;n=(e=t).lib.Base,r=e.enc.Utf8,e.algo.HMAC=n.extend({init:function(t,e){t=this._hasher=new t.init,"string"==typeof e&&(e=r.parse(e));var n=t.blockSize,i=4*n;e.sigBytes>i&&(e=t.finalize(e)),e.clamp();for(var o=this._oKey=e.clone(),s=this._iKey=e.clone(),a=o.words,l=s.words,u=0;u<n;u++)a[u]^=1549556828,l[u]^=909522486;o.sigBytes=s.sigBytes=i,this.reset()},reset:function(){var t=this._hasher;t.reset(),t.update(this._iKey)},update:function(t){return this._hasher.update(t),this},finalize:function(t){var e=this._hasher,n=e.finalize(t);return e.reset(),e.finalize(this._oKey.clone().concat(n))}})},t.exports=r(n("02Hb"))},PzxK:function(t,e,n){var r=n("D2L2"),i=n("sB3e"),o=n("ax3d")("IE_PROTO"),s=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=i(t),r(t,o)?t[o]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?s:null}},QA75:function(t,e,n){var r;r=function(t){return function(){var e=t,n=e.lib.Hasher,r=e.x64,i=r.Word,o=r.WordArray,s=e.algo;function a(){return i.create.apply(i,arguments)}var l=[a(1116352408,3609767458),a(1899447441,602891725),a(3049323471,3964484399),a(3921009573,2173295548),a(961987163,4081628472),a(1508970993,3053834265),a(2453635748,2937671579),a(2870763221,3664609560),a(3624381080,2734883394),a(310598401,1164996542),a(607225278,1323610764),a(1426881987,3590304994),a(1925078388,4068182383),a(2162078206,991336113),a(2614888103,633803317),a(3248222580,3479774868),a(3835390401,2666613458),a(4022224774,944711139),a(264347078,2341262773),a(604807628,2007800933),a(770255983,1495990901),a(1249150122,1856431235),a(1555081692,3175218132),a(1996064986,2198950837),a(2554220882,3999719339),a(2821834349,766784016),a(2952996808,2566594879),a(3210313671,3203337956),a(3336571891,1034457026),a(3584528711,2466948901),a(113926993,3758326383),a(338241895,168717936),a(666307205,1188179964),a(773529912,1546045734),a(1294757372,1522805485),a(1396182291,2643833823),a(1695183700,2343527390),a(1986661051,1014477480),a(2177026350,1206759142),a(2456956037,344077627),a(2730485921,1290863460),a(2820302411,3158454273),a(3259730800,3505952657),a(3345764771,106217008),a(3516065817,3606008344),a(3600352804,1432725776),a(4094571909,1467031594),a(275423344,851169720),a(430227734,3100823752),a(506948616,1363258195),a(659060556,3750685593),a(883997877,3785050280),a(958139571,3318307427),a(1322822218,3812723403),a(1537002063,2003034995),a(1747873779,3602036899),a(1955562222,1575990012),a(2024104815,1125592928),a(2227730452,2716904306),a(2361852424,442776044),a(2428436474,593698344),a(2756734187,3733110249),a(3204031479,2999351573),a(3329325298,3815920427),a(3391569614,3928383900),a(3515267271,566280711),a(3940187606,3454069534),a(4118630271,4000239992),a(116418474,1914138554),a(174292421,2731055270),a(289380356,3203993006),a(460393269,320620315),a(685471733,587496836),a(852142971,1086792851),a(1017036298,365543100),a(1126000580,2618297676),a(1288033470,3409855158),a(1501505948,4234509866),a(1607167915,987167468),a(1816402316,1246189591)],u=[];!function(){for(var t=0;t<80;t++)u[t]=a()}();var c=s.SHA512=n.extend({_doReset:function(){this._hash=new o.init([new i.init(1779033703,4089235720),new i.init(3144134277,2227873595),new i.init(1013904242,4271175723),new i.init(2773480762,1595750129),new i.init(1359893119,2917565137),new i.init(2600822924,725511199),new i.init(528734635,4215389547),new i.init(1541459225,327033209)])},_doProcessBlock:function(t,e){for(var n=this._hash.words,r=n[0],i=n[1],o=n[2],s=n[3],a=n[4],c=n[5],h=n[6],d=n[7],p=r.high,f=r.low,g=i.high,m=i.low,v=o.high,b=o.low,_=s.high,y=s.low,T=a.high,x=a.low,E=c.high,w=c.low,C=h.high,S=h.low,k=d.high,O=d.low,I=p,R=f,A=g,N=m,D=v,M=b,L=_,P=y,F=T,B=x,j=E,$=w,U=C,V=S,H=k,W=O,G=0;G<80;G++){var z,X,K=u[G];if(G<16)X=K.high=0|t[e+2*G],z=K.low=0|t[e+2*G+1];else{var Y=u[G-15],q=Y.high,J=Y.low,Z=(q>>>1|J<<31)^(q>>>8|J<<24)^q>>>7,Q=(J>>>1|q<<31)^(J>>>8|q<<24)^(J>>>7|q<<25),tt=u[G-2],et=tt.high,nt=tt.low,rt=(et>>>19|nt<<13)^(et<<3|nt>>>29)^et>>>6,it=(nt>>>19|et<<13)^(nt<<3|et>>>29)^(nt>>>6|et<<26),ot=u[G-7],st=ot.high,at=ot.low,lt=u[G-16],ut=lt.high,ct=lt.low;X=(X=(X=Z+st+((z=Q+at)>>>0<Q>>>0?1:0))+rt+((z+=it)>>>0<it>>>0?1:0))+ut+((z+=ct)>>>0<ct>>>0?1:0),K.high=X,K.low=z}var ht,dt=F&j^~F&U,pt=B&$^~B&V,ft=I&A^I&D^A&D,gt=R&N^R&M^N&M,mt=(I>>>28|R<<4)^(I<<30|R>>>2)^(I<<25|R>>>7),vt=(R>>>28|I<<4)^(R<<30|I>>>2)^(R<<25|I>>>7),bt=(F>>>14|B<<18)^(F>>>18|B<<14)^(F<<23|B>>>9),_t=(B>>>14|F<<18)^(B>>>18|F<<14)^(B<<23|F>>>9),yt=l[G],Tt=yt.high,xt=yt.low,Et=H+bt+((ht=W+_t)>>>0<W>>>0?1:0),wt=vt+gt;H=U,W=V,U=j,V=$,j=F,$=B,F=L+(Et=(Et=(Et=Et+dt+((ht=ht+pt)>>>0<pt>>>0?1:0))+Tt+((ht=ht+xt)>>>0<xt>>>0?1:0))+X+((ht=ht+z)>>>0<z>>>0?1:0))+((B=P+ht|0)>>>0<P>>>0?1:0)|0,L=D,P=M,D=A,M=N,A=I,N=R,I=Et+(mt+ft+(wt>>>0<vt>>>0?1:0))+((R=ht+wt|0)>>>0<ht>>>0?1:0)|0}f=r.low=f+R,r.high=p+I+(f>>>0<R>>>0?1:0),m=i.low=m+N,i.high=g+A+(m>>>0<N>>>0?1:0),b=o.low=b+M,o.high=v+D+(b>>>0<M>>>0?1:0),y=s.low=y+P,s.high=_+L+(y>>>0<P>>>0?1:0),x=a.low=x+B,a.high=T+F+(x>>>0<B>>>0?1:0),w=c.low=w+$,c.high=E+j+(w>>>0<$>>>0?1:0),S=h.low=S+V,h.high=C+U+(S>>>0<V>>>0?1:0),O=d.low=O+W,d.high=k+H+(O>>>0<W>>>0?1:0)},_doFinalize:function(){var t=this._data,e=t.words,n=8*this._nDataBytes,r=8*t.sigBytes;return e[r>>>5]|=128<<24-r%32,e[30+(r+128>>>10<<5)]=Math.floor(n/4294967296),e[31+(r+128>>>10<<5)]=n,t.sigBytes=4*e.length,this._process(),this._hash.toX32()},clone:function(){var t=n.clone.call(this);return t._hash=this._hash.clone(),t},blockSize:32});e.SHA512=n._createHelper(c),e.HmacSHA512=n._createHmacHelper(c)}(),t.SHA512},t.exports=r(n("02Hb"),n("1J88"))},QRG4:function(t,e,n){var r=n("UuGF"),i=Math.min;t.exports=function(t){return t>0?i(r(t),9007199254740991):0}},QSAg:function(t,e,n){"use strict";e.b=
  1213. /**
  1214. * @license
  1215. * Copyright 2018 Google LLC. All Rights Reserved.
  1216. * Licensed under the Apache License, Version 2.0 (the "License");
  1217. * you may not use this file except in compliance with the License.
  1218. * You may obtain a copy of the License at
  1219. *
  1220. * http://www.apache.org/licenses/LICENSE-2.0
  1221. *
  1222. * Unless required by applicable law or agreed to in writing, software
  1223. * distributed under the License is distributed on an "AS IS" BASIS,
  1224. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1225. * See the License for the specific language governing permissions and
  1226. * limitations under the License.
  1227. * =============================================================================
  1228. */
  1229. function(...t){Object(r.b)().getBool("IS_TEST")||Object(r.b)().getBool("PROD")||console.warn(...t)},e.a=function(...t){Object(r.b)().getBool("IS_TEST")||Object(r.b)().getBool("PROD")||console.log(...t)};var r=n("v/P2")},QUGb:function(t,e,n){var r,i,o,s;s=function(t){"use strict";return t.Blocks.colour={},t.Constants={},t.Constants.Colour={},t.Constants.Colour.HUE=20,t.defineBlocksWithJsonArray([{type:"colour_picker",message0:"%1",args0:[{type:"field_colour",name:"COLOUR",colour:"#ff0000"}],output:"Colour",helpUrl:"%{BKY_COLOUR_PICKER_HELPURL}",style:"colour_blocks",tooltip:"%{BKY_COLOUR_PICKER_TOOLTIP}",extensions:["parent_tooltip_when_inline"]},{type:"colour_random",message0:"%{BKY_COLOUR_RANDOM_TITLE}",output:"Colour",helpUrl:"%{BKY_COLOUR_RANDOM_HELPURL}",style:"colour_blocks",tooltip:"%{BKY_COLOUR_RANDOM_TOOLTIP}"},{type:"colour_rgb",message0:"%{BKY_COLOUR_RGB_TITLE} %{BKY_COLOUR_RGB_RED} %1 %{BKY_COLOUR_RGB_GREEN} %2 %{BKY_COLOUR_RGB_BLUE} %3",args0:[{type:"input_value",name:"RED",check:"Number",align:"RIGHT"},{type:"input_value",name:"GREEN",check:"Number",align:"RIGHT"},{type:"input_value",name:"BLUE",check:"Number",align:"RIGHT"}],output:"Colour",helpUrl:"%{BKY_COLOUR_RGB_HELPURL}",style:"colour_blocks",tooltip:"%{BKY_COLOUR_RGB_TOOLTIP}"},{type:"colour_blend",message0:"%{BKY_COLOUR_BLEND_TITLE} %{BKY_COLOUR_BLEND_COLOUR1} %1 %{BKY_COLOUR_BLEND_COLOUR2} %2 %{BKY_COLOUR_BLEND_RATIO} %3",args0:[{type:"input_value",name:"COLOUR1",check:"Colour",align:"RIGHT"},{type:"input_value",name:"COLOUR2",check:"Colour",align:"RIGHT"},{type:"input_value",name:"RATIO",check:"Number",align:"RIGHT"}],output:"Colour",helpUrl:"%{BKY_COLOUR_BLEND_HELPURL}",style:"colour_blocks",tooltip:"%{BKY_COLOUR_BLEND_TOOLTIP}"}]),t.Constants.Lists={},t.Constants.Lists.HUE=260,t.defineBlocksWithJsonArray([{type:"lists_create_empty",message0:"%{BKY_LISTS_CREATE_EMPTY_TITLE}",output:"Array",style:"list_blocks",tooltip:"%{BKY_LISTS_CREATE_EMPTY_TOOLTIP}",helpUrl:"%{BKY_LISTS_CREATE_EMPTY_HELPURL}"},{type:"lists_repeat",message0:"%{BKY_LISTS_REPEAT_TITLE}",args0:[{type:"input_value",name:"ITEM"},{type:"input_value",name:"NUM",check:"Number"}],output:"Array",style:"list_blocks",tooltip:"%{BKY_LISTS_REPEAT_TOOLTIP}",helpUrl:"%{BKY_LISTS_REPEAT_HELPURL}"},{type:"lists_reverse",message0:"%{BKY_LISTS_REVERSE_MESSAGE0}",args0:[{type:"input_value",name:"LIST",check:"Array"}],output:"Array",inputsInline:!0,style:"list_blocks",tooltip:"%{BKY_LISTS_REVERSE_TOOLTIP}",helpUrl:"%{BKY_LISTS_REVERSE_HELPURL}"},{type:"lists_isEmpty",message0:"%{BKY_LISTS_ISEMPTY_TITLE}",args0:[{type:"input_value",name:"VALUE",check:["String","Array"]}],output:"Boolean",style:"list_blocks",tooltip:"%{BKY_LISTS_ISEMPTY_TOOLTIP}",helpUrl:"%{BKY_LISTS_ISEMPTY_HELPURL}"},{type:"lists_length",message0:"%{BKY_LISTS_LENGTH_TITLE}",args0:[{type:"input_value",name:"VALUE",check:["String","Array"]}],output:"Number",style:"list_blocks",tooltip:"%{BKY_LISTS_LENGTH_TOOLTIP}",helpUrl:"%{BKY_LISTS_LENGTH_HELPURL}"}]),t.Blocks.lists_create_with={init:function(){this.setHelpUrl(t.Msg.LISTS_CREATE_WITH_HELPURL),this.setStyle("list_blocks"),this.itemCount_=3,this.updateShape_(),this.setOutput(!0,"Array"),this.setMutator(new t.Mutator(["lists_create_with_item"])),this.setTooltip(t.Msg.LISTS_CREATE_WITH_TOOLTIP)},mutationToDom:function(){var e=t.utils.xml.createElement("mutation");return e.setAttribute("items",this.itemCount_),e},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("lists_create_with_container");e.initSvg();for(var n=e.getInput("STACK").connection,r=0;r<this.itemCount_;r++){var i=t.newBlock("lists_create_with_item");i.initSvg(),n.connect(i.previousConnection),n=i.nextConnection}return e},compose:function(e){var n=e.getInputTargetBlock("STACK");for(e=[];n&&!n.isInsertionMarker();)e.push(n.valueConnection_),n=n.nextConnection&&n.nextConnection.targetBlock();for(n=0;n<this.itemCount_;n++){var r=this.getInput("ADD"+n).connection.targetConnection;r&&-1==e.indexOf(r)&&r.disconnect()}for(this.itemCount_=e.length,this.updateShape_(),n=0;n<this.itemCount_;n++)t.Mutator.reconnect(e[n],this,"ADD"+n)},saveConnections:function(t){t=t.getInputTargetBlock("STACK");for(var e=0;t;){var n=this.getInput("ADD"+e);t.valueConnection_=n&&n.connection.targetConnection,e++,t=t.nextConnection&&t.nextConnection.targetBlock()}},updateShape_:function(){this.itemCount_&&this.getInput("EMPTY")?this.removeInput("EMPTY"):this.itemCount_||this.getInput("EMPTY")||this.appendDummyInput("EMPTY").appendField(t.Msg.LISTS_CREATE_EMPTY_TITLE);for(var e=0;e<this.itemCount_;e++)if(!this.getInput("ADD"+e)){var n=this.appendValueInput("ADD"+e).setAlign(t.ALIGN_RIGHT);0==e&&n.appendField(t.Msg.LISTS_CREATE_WITH_INPUT_WITH)}for(;this.getInput("ADD"+e);)this.removeInput("ADD"+e),e++}},t.Blocks.lists_create_with_container={init:function(){this.setStyle("list_blocks"),this.appendDummyInput().appendField(t.Msg.LISTS_CREATE_WITH_CONTAINER_TITLE_ADD),this.appendStatementInput("STACK"),this.setTooltip(t.Msg.LISTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},t.Blocks.lists_create_with_item={init:function(){this.setStyle("list_blocks"),this.appendDummyInput().appendField(t.Msg.LISTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(t.Msg.LISTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},t.Blocks.lists_indexOf={init:function(){var e=[[t.Msg.LISTS_INDEX_OF_FIRST,"FIRST"],[t.Msg.LISTS_INDEX_OF_LAST,"LAST"]];this.setHelpUrl(t.Msg.LISTS_INDEX_OF_HELPURL),this.setStyle("list_blocks"),this.setOutput(!0,"Number"),this.appendValueInput("VALUE").setCheck("Array").appendField(t.Msg.LISTS_INDEX_OF_INPUT_IN_LIST),this.appendValueInput("FIND").appendField(new t.FieldDropdown(e),"END"),this.setInputsInline(!0);var n=this;this.setTooltip(function(){return t.Msg.LISTS_INDEX_OF_TOOLTIP.replace("%1",n.workspace.options.oneBasedIndex?"0":"-1")})}},t.Blocks.lists_getIndex={init:function(){var e=[[t.Msg.LISTS_GET_INDEX_GET,"GET"],[t.Msg.LISTS_GET_INDEX_GET_REMOVE,"GET_REMOVE"],[t.Msg.LISTS_GET_INDEX_REMOVE,"REMOVE"]];this.WHERE_OPTIONS=[[t.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[t.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[t.Msg.LISTS_GET_INDEX_FIRST,"FIRST"],[t.Msg.LISTS_GET_INDEX_LAST,"LAST"],[t.Msg.LISTS_GET_INDEX_RANDOM,"RANDOM"]],this.setHelpUrl(t.Msg.LISTS_GET_INDEX_HELPURL),this.setStyle("list_blocks"),e=new t.FieldDropdown(e,function(t){t="REMOVE"==t,this.getSourceBlock().updateStatement_(t)}),this.appendValueInput("VALUE").setCheck("Array").appendField(t.Msg.LISTS_GET_INDEX_INPUT_IN_LIST),this.appendDummyInput().appendField(e,"MODE").appendField("","SPACE"),this.appendDummyInput("AT"),t.Msg.LISTS_GET_INDEX_TAIL&&this.appendDummyInput("TAIL").appendField(t.Msg.LISTS_GET_INDEX_TAIL),this.setInputsInline(!0),this.setOutput(!0),this.updateAt_(!0);var n=this;this.setTooltip(function(){var e=n.getFieldValue("MODE"),r=n.getFieldValue("WHERE"),i="";switch(e+" "+r){case"GET FROM_START":case"GET FROM_END":i=t.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM;break;case"GET FIRST":i=t.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FIRST;break;case"GET LAST":i=t.Msg.LISTS_GET_INDEX_TOOLTIP_GET_LAST;break;case"GET RANDOM":i=t.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM;break;case"GET_REMOVE FROM_START":case"GET_REMOVE FROM_END":i=t.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM;break;case"GET_REMOVE FIRST":i=t.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FIRST;break;case"GET_REMOVE LAST":i=t.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_LAST;break;case"GET_REMOVE RANDOM":i=t.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM;break;case"REMOVE FROM_START":case"REMOVE FROM_END":i=t.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FROM;break;case"REMOVE FIRST":i=t.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FIRST;break;case"REMOVE LAST":i=t.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_LAST;break;case"REMOVE RANDOM":i=t.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_RANDOM}return"FROM_START"!=r&&"FROM_END"!=r||(i+=" "+("FROM_START"==r?t.Msg.LISTS_INDEX_FROM_START_TOOLTIP:t.Msg.LISTS_INDEX_FROM_END_TOOLTIP).replace("%1",n.workspace.options.oneBasedIndex?"#1":"#0")),i})},mutationToDom:function(){var e=t.utils.xml.createElement("mutation");e.setAttribute("statement",!this.outputConnection);var n=this.getInput("AT").type==t.INPUT_VALUE;return e.setAttribute("at",n),e},domToMutation:function(t){var e="true"==t.getAttribute("statement");this.updateStatement_(e),t="false"!=t.getAttribute("at"),this.updateAt_(t)},updateStatement_:function(t){t!=!this.outputConnection&&(this.unplug(!0,!0),t?(this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)):(this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)))},updateAt_:function(e){this.removeInput("AT"),this.removeInput("ORDINAL",!0),e?(this.appendValueInput("AT").setCheck("Number"),t.Msg.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput("ORDINAL").appendField(t.Msg.ORDINAL_NUMBER_SUFFIX)):this.appendDummyInput("AT");var n=new t.FieldDropdown(this.WHERE_OPTIONS,function(t){var n="FROM_START"==t||"FROM_END"==t;if(n!=e){var r=this.getSourceBlock();return r.updateAt_(n),r.setFieldValue(t,"WHERE"),null}});this.getInput("AT").appendField(n,"WHERE"),t.Msg.LISTS_GET_INDEX_TAIL&&this.moveInputBefore("TAIL",null)}},t.Blocks.lists_setIndex={init:function(){var e=[[t.Msg.LISTS_SET_INDEX_SET,"SET"],[t.Msg.LISTS_SET_INDEX_INSERT,"INSERT"]];this.WHERE_OPTIONS=[[t.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[t.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[t.Msg.LISTS_GET_INDEX_FIRST,"FIRST"],[t.Msg.LISTS_GET_INDEX_LAST,"LAST"],[t.Msg.LISTS_GET_INDEX_RANDOM,"RANDOM"]],this.setHelpUrl(t.Msg.LISTS_SET_INDEX_HELPURL),this.setStyle("list_blocks"),this.appendValueInput("LIST").setCheck("Array").appendField(t.Msg.LISTS_SET_INDEX_INPUT_IN_LIST),this.appendDummyInput().appendField(new t.FieldDropdown(e),"MODE").appendField("","SPACE"),this.appendDummyInput("AT"),this.appendValueInput("TO").appendField(t.Msg.LISTS_SET_INDEX_INPUT_TO),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(t.Msg.LISTS_SET_INDEX_TOOLTIP),this.updateAt_(!0);var n=this;this.setTooltip(function(){var e=n.getFieldValue("MODE"),r=n.getFieldValue("WHERE"),i="";switch(e+" "+r){case"SET FROM_START":case"SET FROM_END":i=t.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM;break;case"SET FIRST":i=t.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FIRST;break;case"SET LAST":i=t.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST;break;case"SET RANDOM":i=t.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM;break;case"INSERT FROM_START":case"INSERT FROM_END":i=t.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FROM;break;case"INSERT FIRST":i=t.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FIRST;break;case"INSERT LAST":i=t.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_LAST;break;case"INSERT RANDOM":i=t.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_RANDOM}return"FROM_START"!=r&&"FROM_END"!=r||(i+=" "+t.Msg.LISTS_INDEX_FROM_START_TOOLTIP.replace("%1",n.workspace.options.oneBasedIndex?"#1":"#0")),i})},mutationToDom:function(){var e=t.utils.xml.createElement("mutation"),n=this.getInput("AT").type==t.INPUT_VALUE;return e.setAttribute("at",n),e},domToMutation:function(t){t="false"!=t.getAttribute("at"),this.updateAt_(t)},updateAt_:function(e){this.removeInput("AT"),this.removeInput("ORDINAL",!0),e?(this.appendValueInput("AT").setCheck("Number"),t.Msg.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput("ORDINAL").appendField(t.Msg.ORDINAL_NUMBER_SUFFIX)):this.appendDummyInput("AT");var n=new t.FieldDropdown(this.WHERE_OPTIONS,function(t){var n="FROM_START"==t||"FROM_END"==t;if(n!=e){var r=this.getSourceBlock();return r.updateAt_(n),r.setFieldValue(t,"WHERE"),null}});this.moveInputBefore("AT","TO"),this.getInput("ORDINAL")&&this.moveInputBefore("ORDINAL","TO"),this.getInput("AT").appendField(n,"WHERE")}},t.Blocks.lists_getSublist={init:function(){this.WHERE_OPTIONS_1=[[t.Msg.LISTS_GET_SUBLIST_START_FROM_START,"FROM_START"],[t.Msg.LISTS_GET_SUBLIST_START_FROM_END,"FROM_END"],[t.Msg.LISTS_GET_SUBLIST_START_FIRST,"FIRST"]],this.WHERE_OPTIONS_2=[[t.Msg.LISTS_GET_SUBLIST_END_FROM_START,"FROM_START"],[t.Msg.LISTS_GET_SUBLIST_END_FROM_END,"FROM_END"],[t.Msg.LISTS_GET_SUBLIST_END_LAST,"LAST"]],this.setHelpUrl(t.Msg.LISTS_GET_SUBLIST_HELPURL),this.setStyle("list_blocks"),this.appendValueInput("LIST").setCheck("Array").appendField(t.Msg.LISTS_GET_SUBLIST_INPUT_IN_LIST),this.appendDummyInput("AT1"),this.appendDummyInput("AT2"),t.Msg.LISTS_GET_SUBLIST_TAIL&&this.appendDummyInput("TAIL").appendField(t.Msg.LISTS_GET_SUBLIST_TAIL),this.setInputsInline(!0),this.setOutput(!0,"Array"),this.updateAt_(1,!0),this.updateAt_(2,!0),this.setTooltip(t.Msg.LISTS_GET_SUBLIST_TOOLTIP)},mutationToDom:function(){var e=t.utils.xml.createElement("mutation"),n=this.getInput("AT1").type==t.INPUT_VALUE;return e.setAttribute("at1",n),n=this.getInput("AT2").type==t.INPUT_VALUE,e.setAttribute("at2",n),e},domToMutation:function(t){var e="true"==t.getAttribute("at1");t="true"==t.getAttribute("at2"),this.updateAt_(1,e),this.updateAt_(2,t)},updateAt_:function(e,n){this.removeInput("AT"+e),this.removeInput("ORDINAL"+e,!0),n?(this.appendValueInput("AT"+e).setCheck("Number"),t.Msg.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput("ORDINAL"+e).appendField(t.Msg.ORDINAL_NUMBER_SUFFIX)):this.appendDummyInput("AT"+e);var r=new t.FieldDropdown(this["WHERE_OPTIONS_"+e],function(t){var r="FROM_START"==t||"FROM_END"==t;if(r!=n){var i=this.getSourceBlock();return i.updateAt_(e,r),i.setFieldValue(t,"WHERE"+e),null}});this.getInput("AT"+e).appendField(r,"WHERE"+e),1==e&&(this.moveInputBefore("AT1","AT2"),this.getInput("ORDINAL1")&&this.moveInputBefore("ORDINAL1","AT2")),t.Msg.LISTS_GET_SUBLIST_TAIL&&this.moveInputBefore("TAIL",null)}},t.Blocks.lists_sort={init:function(){this.jsonInit({message0:t.Msg.LISTS_SORT_TITLE,args0:[{type:"field_dropdown",name:"TYPE",options:[[t.Msg.LISTS_SORT_TYPE_NUMERIC,"NUMERIC"],[t.Msg.LISTS_SORT_TYPE_TEXT,"TEXT"],[t.Msg.LISTS_SORT_TYPE_IGNORECASE,"IGNORE_CASE"]]},{type:"field_dropdown",name:"DIRECTION",options:[[t.Msg.LISTS_SORT_ORDER_ASCENDING,"1"],[t.Msg.LISTS_SORT_ORDER_DESCENDING,"-1"]]},{type:"input_value",name:"LIST",check:"Array"}],output:"Array",style:"list_blocks",tooltip:t.Msg.LISTS_SORT_TOOLTIP,helpUrl:t.Msg.LISTS_SORT_HELPURL})}},t.Blocks.lists_split={init:function(){var e=this,n=new t.FieldDropdown([[t.Msg.LISTS_SPLIT_LIST_FROM_TEXT,"SPLIT"],[t.Msg.LISTS_SPLIT_TEXT_FROM_LIST,"JOIN"]],function(t){e.updateType_(t)});this.setHelpUrl(t.Msg.LISTS_SPLIT_HELPURL),this.setStyle("list_blocks"),this.appendValueInput("INPUT").setCheck("String").appendField(n,"MODE"),this.appendValueInput("DELIM").setCheck("String").appendField(t.Msg.LISTS_SPLIT_WITH_DELIMITER),this.setInputsInline(!0),this.setOutput(!0,"Array"),this.setTooltip(function(){var n=e.getFieldValue("MODE");if("SPLIT"==n)return t.Msg.LISTS_SPLIT_TOOLTIP_SPLIT;if("JOIN"==n)return t.Msg.LISTS_SPLIT_TOOLTIP_JOIN;throw Error("Unknown mode: "+n)})},updateType_:function(t){if(this.getFieldValue("MODE")!=t){var e=this.getInput("INPUT").connection;e.setShadowDom(null);var n=e.targetBlock();n&&(e.disconnect(),n.isShadow()?n.dispose():this.bumpNeighbours())}"SPLIT"==t?(this.outputConnection.setCheck("Array"),this.getInput("INPUT").setCheck("String")):(this.outputConnection.setCheck("String"),this.getInput("INPUT").setCheck("Array"))},mutationToDom:function(){var e=t.utils.xml.createElement("mutation");return e.setAttribute("mode",this.getFieldValue("MODE")),e},domToMutation:function(t){this.updateType_(t.getAttribute("mode"))}},t.Blocks.logic={},t.Constants.Logic={},t.Constants.Logic.HUE=210,t.defineBlocksWithJsonArray([{type:"logic_boolean",message0:"%1",args0:[{type:"field_dropdown",name:"BOOL",options:[["%{BKY_LOGIC_BOOLEAN_TRUE}","TRUE"],["%{BKY_LOGIC_BOOLEAN_FALSE}","FALSE"]]}],output:"Boolean",style:"logic_blocks",tooltip:"%{BKY_LOGIC_BOOLEAN_TOOLTIP}",helpUrl:"%{BKY_LOGIC_BOOLEAN_HELPURL}"},{type:"controls_if",message0:"%{BKY_CONTROLS_IF_MSG_IF} %1",args0:[{type:"input_value",name:"IF0",check:"Boolean"}],message1:"%{BKY_CONTROLS_IF_MSG_THEN} %1",args1:[{type:"input_statement",name:"DO0"}],previousStatement:null,nextStatement:null,style:"logic_blocks",helpUrl:"%{BKY_CONTROLS_IF_HELPURL}",mutator:"controls_if_mutator",extensions:["controls_if_tooltip"]},{type:"controls_ifelse",message0:"%{BKY_CONTROLS_IF_MSG_IF} %1",args0:[{type:"input_value",name:"IF0",check:"Boolean"}],message1:"%{BKY_CONTROLS_IF_MSG_THEN} %1",args1:[{type:"input_statement",name:"DO0"}],message2:"%{BKY_CONTROLS_IF_MSG_ELSE} %1",args2:[{type:"input_statement",name:"ELSE"}],previousStatement:null,nextStatement:null,style:"logic_blocks",tooltip:"%{BKYCONTROLS_IF_TOOLTIP_2}",helpUrl:"%{BKY_CONTROLS_IF_HELPURL}",extensions:["controls_if_tooltip"]},{type:"logic_compare",message0:"%1 %2 %3",args0:[{type:"input_value",name:"A"},{type:"field_dropdown",name:"OP",options:[["=","EQ"],["≠","NEQ"],["‏<","LT"],["‏≤","LTE"],["‏>","GT"],["‏≥","GTE"]]},{type:"input_value",name:"B"}],inputsInline:!0,output:"Boolean",style:"logic_blocks",helpUrl:"%{BKY_LOGIC_COMPARE_HELPURL}",extensions:["logic_compare","logic_op_tooltip"]},{type:"logic_operation",message0:"%1 %2 %3",args0:[{type:"input_value",name:"A",check:"Boolean"},{type:"field_dropdown",name:"OP",options:[["%{BKY_LOGIC_OPERATION_AND}","AND"],["%{BKY_LOGIC_OPERATION_OR}","OR"]]},{type:"input_value",name:"B",check:"Boolean"}],inputsInline:!0,output:"Boolean",style:"logic_blocks",helpUrl:"%{BKY_LOGIC_OPERATION_HELPURL}",extensions:["logic_op_tooltip"]},{type:"logic_negate",message0:"%{BKY_LOGIC_NEGATE_TITLE}",args0:[{type:"input_value",name:"BOOL",check:"Boolean"}],output:"Boolean",style:"logic_blocks",tooltip:"%{BKY_LOGIC_NEGATE_TOOLTIP}",helpUrl:"%{BKY_LOGIC_NEGATE_HELPURL}"},{type:"logic_null",message0:"%{BKY_LOGIC_NULL}",output:null,style:"logic_blocks",tooltip:"%{BKY_LOGIC_NULL_TOOLTIP}",helpUrl:"%{BKY_LOGIC_NULL_HELPURL}"},{type:"logic_ternary",message0:"%{BKY_LOGIC_TERNARY_CONDITION} %1",args0:[{type:"input_value",name:"IF",check:"Boolean"}],message1:"%{BKY_LOGIC_TERNARY_IF_TRUE} %1",args1:[{type:"input_value",name:"THEN"}],message2:"%{BKY_LOGIC_TERNARY_IF_FALSE} %1",args2:[{type:"input_value",name:"ELSE"}],output:null,style:"logic_blocks",tooltip:"%{BKY_LOGIC_TERNARY_TOOLTIP}",helpUrl:"%{BKY_LOGIC_TERNARY_HELPURL}",extensions:["logic_ternary"]}]),t.defineBlocksWithJsonArray([{type:"controls_if_if",message0:"%{BKY_CONTROLS_IF_IF_TITLE_IF}",nextStatement:null,enableContextMenu:!1,style:"logic_blocks",tooltip:"%{BKY_CONTROLS_IF_IF_TOOLTIP}"},{type:"controls_if_elseif",message0:"%{BKY_CONTROLS_IF_ELSEIF_TITLE_ELSEIF}",previousStatement:null,nextStatement:null,enableContextMenu:!1,style:"logic_blocks",tooltip:"%{BKY_CONTROLS_IF_ELSEIF_TOOLTIP}"},{type:"controls_if_else",message0:"%{BKY_CONTROLS_IF_ELSE_TITLE_ELSE}",previousStatement:null,enableContextMenu:!1,style:"logic_blocks",tooltip:"%{BKY_CONTROLS_IF_ELSE_TOOLTIP}"}]),t.Constants.Logic.TOOLTIPS_BY_OP={EQ:"%{BKY_LOGIC_COMPARE_TOOLTIP_EQ}",NEQ:"%{BKY_LOGIC_COMPARE_TOOLTIP_NEQ}",LT:"%{BKY_LOGIC_COMPARE_TOOLTIP_LT}",LTE:"%{BKY_LOGIC_COMPARE_TOOLTIP_LTE}",GT:"%{BKY_LOGIC_COMPARE_TOOLTIP_GT}",GTE:"%{BKY_LOGIC_COMPARE_TOOLTIP_GTE}",AND:"%{BKY_LOGIC_OPERATION_TOOLTIP_AND}",OR:"%{BKY_LOGIC_OPERATION_TOOLTIP_OR}"},t.Extensions.register("logic_op_tooltip",t.Extensions.buildTooltipForDropdown("OP",t.Constants.Logic.TOOLTIPS_BY_OP)),t.Constants.Logic.CONTROLS_IF_MUTATOR_MIXIN={elseifCount_:0,elseCount_:0,suppressPrefixSuffix:!0,mutationToDom:function(){if(!this.elseifCount_&&!this.elseCount_)return null;var e=t.utils.xml.createElement("mutation");return this.elseifCount_&&e.setAttribute("elseif",this.elseifCount_),this.elseCount_&&e.setAttribute("else",1),e},domToMutation:function(t){this.elseifCount_=parseInt(t.getAttribute("elseif"),10)||0,this.elseCount_=parseInt(t.getAttribute("else"),10)||0,this.rebuildShape_()},decompose:function(t){var e=t.newBlock("controls_if_if");e.initSvg();for(var n=e.nextConnection,r=1;r<=this.elseifCount_;r++){var i=t.newBlock("controls_if_elseif");i.initSvg(),n.connect(i.previousConnection),n=i.nextConnection}return this.elseCount_&&((t=t.newBlock("controls_if_else")).initSvg(),n.connect(t.previousConnection)),e},compose:function(t){t=t.nextConnection.targetBlock(),this.elseCount_=this.elseifCount_=0;for(var e=[null],n=[null],r=null;t&&!t.isInsertionMarker();){switch(t.type){case"controls_if_elseif":this.elseifCount_++,e.push(t.valueConnection_),n.push(t.statementConnection_);break;case"controls_if_else":this.elseCount_++,r=t.statementConnection_;break;default:throw TypeError("Unknown block type: "+t.type)}t=t.nextConnection&&t.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(e,n,r)},saveConnections:function(t){t=t.nextConnection.targetBlock();for(var e=1;t;){switch(t.type){case"controls_if_elseif":var n=this.getInput("IF"+e),r=this.getInput("DO"+e);t.valueConnection_=n&&n.connection.targetConnection,t.statementConnection_=r&&r.connection.targetConnection,e++;break;case"controls_if_else":r=this.getInput("ELSE"),t.statementConnection_=r&&r.connection.targetConnection;break;default:throw TypeError("Unknown block type: "+t.type)}t=t.nextConnection&&t.nextConnection.targetBlock()}},rebuildShape_:function(){var t=[null],e=[null],n=null;this.getInput("ELSE")&&(n=this.getInput("ELSE").connection.targetConnection);for(var r=1;this.getInput("IF"+r);){var i=this.getInput("IF"+r),o=this.getInput("DO"+r);t.push(i.connection.targetConnection),e.push(o.connection.targetConnection),r++}this.updateShape_(),this.reconnectChildBlocks_(t,e,n)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var e=1;this.getInput("IF"+e);)this.removeInput("IF"+e),this.removeInput("DO"+e),e++;for(e=1;e<=this.elseifCount_;e++)this.appendValueInput("IF"+e).setCheck("Boolean").appendField(t.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+e).appendField(t.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(t.Msg.CONTROLS_IF_MSG_ELSE)},reconnectChildBlocks_:function(e,n,r){for(var i=1;i<=this.elseifCount_;i++)t.Mutator.reconnect(e[i],this,"IF"+i),t.Mutator.reconnect(n[i],this,"DO"+i);t.Mutator.reconnect(r,this,"ELSE")}},t.Extensions.registerMutator("controls_if_mutator",t.Constants.Logic.CONTROLS_IF_MUTATOR_MIXIN,null,["controls_if_elseif","controls_if_else"]),t.Constants.Logic.CONTROLS_IF_TOOLTIP_EXTENSION=function(){this.setTooltip(function(){return this.elseifCount_||this.elseCount_?!this.elseifCount_&&this.elseCount_?t.Msg.CONTROLS_IF_TOOLTIP_2:this.elseifCount_&&!this.elseCount_?t.Msg.CONTROLS_IF_TOOLTIP_3:this.elseifCount_&&this.elseCount_?t.Msg.CONTROLS_IF_TOOLTIP_4:"":t.Msg.CONTROLS_IF_TOOLTIP_1}.bind(this))},t.Extensions.register("controls_if_tooltip",t.Constants.Logic.CONTROLS_IF_TOOLTIP_EXTENSION),t.Constants.Logic.LOGIC_COMPARE_ONCHANGE_MIXIN={onchange:function(e){this.prevBlocks_||(this.prevBlocks_=[null,null]);var n=this.getInputTargetBlock("A"),r=this.getInputTargetBlock("B");n&&r&&!this.workspace.connectionChecker.doTypeChecks(n.outputConnection,r.outputConnection)&&(t.Events.setGroup(e.group),(e=this.prevBlocks_[0])!==n&&(n.unplug(),!e||e.isDisposed()||e.isShadow()||this.getInput("A").connection.connect(e.outputConnection)),(n=this.prevBlocks_[1])!==r&&(r.unplug(),!n||n.isDisposed()||n.isShadow()||this.getInput("B").connection.connect(n.outputConnection)),this.bumpNeighbours(),t.Events.setGroup(!1)),this.prevBlocks_[0]=this.getInputTargetBlock("A"),this.prevBlocks_[1]=this.getInputTargetBlock("B")}},t.Constants.Logic.LOGIC_COMPARE_EXTENSION=function(){this.mixin(t.Constants.Logic.LOGIC_COMPARE_ONCHANGE_MIXIN)},t.Extensions.register("logic_compare",t.Constants.Logic.LOGIC_COMPARE_EXTENSION),t.Constants.Logic.LOGIC_TERNARY_ONCHANGE_MIXIN={prevParentConnection_:null,onchange:function(e){var n=this.getInputTargetBlock("THEN"),r=this.getInputTargetBlock("ELSE"),i=this.outputConnection.targetConnection;if((n||r)&&i)for(var o=0;2>o;o++){var s=1==o?n:r;s&&!s.workspace.connectionChecker.doTypeChecks(s.outputConnection,i)&&(t.Events.setGroup(e.group),i===this.prevParentConnection_?(this.unplug(),i.getSourceBlock().bumpNeighbours()):(s.unplug(),s.bumpNeighbours()),t.Events.setGroup(!1))}this.prevParentConnection_=i}},t.Extensions.registerMixin("logic_ternary",t.Constants.Logic.LOGIC_TERNARY_ONCHANGE_MIXIN),t.Blocks.loops={},t.Constants.Loops={},t.Constants.Loops.HUE=120,t.defineBlocksWithJsonArray([{type:"controls_repeat_ext",message0:"%{BKY_CONTROLS_REPEAT_TITLE}",args0:[{type:"input_value",name:"TIMES",check:"Number"}],message1:"%{BKY_CONTROLS_REPEAT_INPUT_DO} %1",args1:[{type:"input_statement",name:"DO"}],previousStatement:null,nextStatement:null,style:"loop_blocks",tooltip:"%{BKY_CONTROLS_REPEAT_TOOLTIP}",helpUrl:"%{BKY_CONTROLS_REPEAT_HELPURL}"},{type:"controls_repeat",message0:"%{BKY_CONTROLS_REPEAT_TITLE}",args0:[{type:"field_number",name:"TIMES",value:10,min:0,precision:1}],message1:"%{BKY_CONTROLS_REPEAT_INPUT_DO} %1",args1:[{type:"input_statement",name:"DO"}],previousStatement:null,nextStatement:null,style:"loop_blocks",tooltip:"%{BKY_CONTROLS_REPEAT_TOOLTIP}",helpUrl:"%{BKY_CONTROLS_REPEAT_HELPURL}"},{type:"controls_whileUntil",message0:"%1 %2",args0:[{type:"field_dropdown",name:"MODE",options:[["%{BKY_CONTROLS_WHILEUNTIL_OPERATOR_WHILE}","WHILE"],["%{BKY_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL}","UNTIL"]]},{type:"input_value",name:"BOOL",check:"Boolean"}],message1:"%{BKY_CONTROLS_REPEAT_INPUT_DO} %1",args1:[{type:"input_statement",name:"DO"}],previousStatement:null,nextStatement:null,style:"loop_blocks",helpUrl:"%{BKY_CONTROLS_WHILEUNTIL_HELPURL}",extensions:["controls_whileUntil_tooltip"]},{type:"controls_for",message0:"%{BKY_CONTROLS_FOR_TITLE}",args0:[{type:"field_variable",name:"VAR",variable:null},{type:"input_value",name:"FROM",check:"Number",align:"RIGHT"},{type:"input_value",name:"TO",check:"Number",align:"RIGHT"},{type:"input_value",name:"BY",check:"Number",align:"RIGHT"}],message1:"%{BKY_CONTROLS_REPEAT_INPUT_DO} %1",args1:[{type:"input_statement",name:"DO"}],inputsInline:!0,previousStatement:null,nextStatement:null,style:"loop_blocks",helpUrl:"%{BKY_CONTROLS_FOR_HELPURL}",extensions:["contextMenu_newGetVariableBlock","controls_for_tooltip"]},{type:"controls_forEach",message0:"%{BKY_CONTROLS_FOREACH_TITLE}",args0:[{type:"field_variable",name:"VAR",variable:null},{type:"input_value",name:"LIST",check:"Array"}],message1:"%{BKY_CONTROLS_REPEAT_INPUT_DO} %1",args1:[{type:"input_statement",name:"DO"}],previousStatement:null,nextStatement:null,style:"loop_blocks",helpUrl:"%{BKY_CONTROLS_FOREACH_HELPURL}",extensions:["contextMenu_newGetVariableBlock","controls_forEach_tooltip"]},{type:"controls_flow_statements",message0:"%1",args0:[{type:"field_dropdown",name:"FLOW",options:[["%{BKY_CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK}","BREAK"],["%{BKY_CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE}","CONTINUE"]]}],previousStatement:null,style:"loop_blocks",helpUrl:"%{BKY_CONTROLS_FLOW_STATEMENTS_HELPURL}",extensions:["controls_flow_tooltip","controls_flow_in_loop_check"]}]),t.Constants.Loops.WHILE_UNTIL_TOOLTIPS={WHILE:"%{BKY_CONTROLS_WHILEUNTIL_TOOLTIP_WHILE}",UNTIL:"%{BKY_CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL}"},t.Extensions.register("controls_whileUntil_tooltip",t.Extensions.buildTooltipForDropdown("MODE",t.Constants.Loops.WHILE_UNTIL_TOOLTIPS)),t.Constants.Loops.BREAK_CONTINUE_TOOLTIPS={BREAK:"%{BKY_CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK}",CONTINUE:"%{BKY_CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE}"},t.Extensions.register("controls_flow_tooltip",t.Extensions.buildTooltipForDropdown("FLOW",t.Constants.Loops.BREAK_CONTINUE_TOOLTIPS)),t.Constants.Loops.CUSTOM_CONTEXT_MENU_CREATE_VARIABLES_GET_MIXIN={customContextMenu:function(e){if(!this.isInFlyout){var n=this.getField("VAR").getVariable(),r=n.name;if(!this.isCollapsed()&&null!=r){var i={enabled:!0};i.text=t.Msg.VARIABLES_SET_CREATE_GET.replace("%1",r),n=t.Variables.generateVariableFieldDom(n),(r=t.utils.xml.createElement("block")).setAttribute("type","variables_get"),r.appendChild(n),i.callback=t.ContextMenu.callbackFactory(this,r),e.push(i)}}}},t.Extensions.registerMixin("contextMenu_newGetVariableBlock",t.Constants.Loops.CUSTOM_CONTEXT_MENU_CREATE_VARIABLES_GET_MIXIN),t.Extensions.register("controls_for_tooltip",t.Extensions.buildTooltipWithFieldText("%{BKY_CONTROLS_FOR_TOOLTIP}","VAR")),t.Extensions.register("controls_forEach_tooltip",t.Extensions.buildTooltipWithFieldText("%{BKY_CONTROLS_FOREACH_TOOLTIP}","VAR")),t.Constants.Loops.CONTROL_FLOW_IN_LOOP_CHECK_MIXIN={LOOP_TYPES:["controls_repeat","controls_repeat_ext","controls_forEach","controls_for","controls_whileUntil"],suppressPrefixSuffix:!0,getSurroundLoop:function(e){do{if(-1!=t.Constants.Loops.CONTROL_FLOW_IN_LOOP_CHECK_MIXIN.LOOP_TYPES.indexOf(e.type))return e;e=e.getSurroundParent()}while(e);return null},onchange:function(e){if(this.workspace.isDragging&&!this.workspace.isDragging()&&e.type==t.Events.BLOCK_MOVE){var n=t.Constants.Loops.CONTROL_FLOW_IN_LOOP_CHECK_MIXIN.getSurroundLoop(this);if(this.setWarningText(n?null:t.Msg.CONTROLS_FLOW_STATEMENTS_WARNING),!this.isInFlyout){var r=t.Events.getGroup();t.Events.setGroup(e.group),this.setEnabled(n),t.Events.setGroup(r)}}}},t.Extensions.registerMixin("controls_flow_in_loop_check",t.Constants.Loops.CONTROL_FLOW_IN_LOOP_CHECK_MIXIN),t.Blocks.math={},t.Constants.Math={},t.Constants.Math.HUE=230,t.defineBlocksWithJsonArray([{type:"math_number",message0:"%1",args0:[{type:"field_number",name:"NUM",value:0}],output:"Number",helpUrl:"%{BKY_MATH_NUMBER_HELPURL}",style:"math_blocks",tooltip:"%{BKY_MATH_NUMBER_TOOLTIP}",extensions:["parent_tooltip_when_inline"]},{type:"math_arithmetic",message0:"%1 %2 %3",args0:[{type:"input_value",name:"A",check:"Number"},{type:"field_dropdown",name:"OP",options:[["%{BKY_MATH_ADDITION_SYMBOL}","ADD"],["%{BKY_MATH_SUBTRACTION_SYMBOL}","MINUS"],["%{BKY_MATH_MULTIPLICATION_SYMBOL}","MULTIPLY"],["%{BKY_MATH_DIVISION_SYMBOL}","DIVIDE"],["%{BKY_MATH_POWER_SYMBOL}","POWER"]]},{type:"input_value",name:"B",check:"Number"}],inputsInline:!0,output:"Number",style:"math_blocks",helpUrl:"%{BKY_MATH_ARITHMETIC_HELPURL}",extensions:["math_op_tooltip"]},{type:"math_single",message0:"%1 %2",args0:[{type:"field_dropdown",name:"OP",options:[["%{BKY_MATH_SINGLE_OP_ROOT}","ROOT"],["%{BKY_MATH_SINGLE_OP_ABSOLUTE}","ABS"],["-","NEG"],["ln","LN"],["log10","LOG10"],["e^","EXP"],["10^","POW10"]]},{type:"input_value",name:"NUM",check:"Number"}],output:"Number",style:"math_blocks",helpUrl:"%{BKY_MATH_SINGLE_HELPURL}",extensions:["math_op_tooltip"]},{type:"math_trig",message0:"%1 %2",args0:[{type:"field_dropdown",name:"OP",options:[["%{BKY_MATH_TRIG_SIN}","SIN"],["%{BKY_MATH_TRIG_COS}","COS"],["%{BKY_MATH_TRIG_TAN}","TAN"],["%{BKY_MATH_TRIG_ASIN}","ASIN"],["%{BKY_MATH_TRIG_ACOS}","ACOS"],["%{BKY_MATH_TRIG_ATAN}","ATAN"]]},{type:"input_value",name:"NUM",check:"Number"}],output:"Number",style:"math_blocks",helpUrl:"%{BKY_MATH_TRIG_HELPURL}",extensions:["math_op_tooltip"]},{type:"math_constant",message0:"%1",args0:[{type:"field_dropdown",name:"CONSTANT",options:[["π","PI"],["e","E"],["φ","GOLDEN_RATIO"],["sqrt(2)","SQRT2"],["sqrt(½)","SQRT1_2"],["∞","INFINITY"]]}],output:"Number",style:"math_blocks",tooltip:"%{BKY_MATH_CONSTANT_TOOLTIP}",helpUrl:"%{BKY_MATH_CONSTANT_HELPURL}"},{type:"math_number_property",message0:"%1 %2",args0:[{type:"input_value",name:"NUMBER_TO_CHECK",check:"Number"},{type:"field_dropdown",name:"PROPERTY",options:[["%{BKY_MATH_IS_EVEN}","EVEN"],["%{BKY_MATH_IS_ODD}","ODD"],["%{BKY_MATH_IS_PRIME}","PRIME"],["%{BKY_MATH_IS_WHOLE}","WHOLE"],["%{BKY_MATH_IS_POSITIVE}","POSITIVE"],["%{BKY_MATH_IS_NEGATIVE}","NEGATIVE"],["%{BKY_MATH_IS_DIVISIBLE_BY}","DIVISIBLE_BY"]]}],inputsInline:!0,output:"Boolean",style:"math_blocks",tooltip:"%{BKY_MATH_IS_TOOLTIP}",mutator:"math_is_divisibleby_mutator"},{type:"math_change",message0:"%{BKY_MATH_CHANGE_TITLE}",args0:[{type:"field_variable",name:"VAR",variable:"%{BKY_MATH_CHANGE_TITLE_ITEM}"},{type:"input_value",name:"DELTA",check:"Number"}],previousStatement:null,nextStatement:null,style:"variable_blocks",helpUrl:"%{BKY_MATH_CHANGE_HELPURL}",extensions:["math_change_tooltip"]},{type:"math_round",message0:"%1 %2",args0:[{type:"field_dropdown",name:"OP",options:[["%{BKY_MATH_ROUND_OPERATOR_ROUND}","ROUND"],["%{BKY_MATH_ROUND_OPERATOR_ROUNDUP}","ROUNDUP"],["%{BKY_MATH_ROUND_OPERATOR_ROUNDDOWN}","ROUNDDOWN"]]},{type:"input_value",name:"NUM",check:"Number"}],output:"Number",style:"math_blocks",helpUrl:"%{BKY_MATH_ROUND_HELPURL}",tooltip:"%{BKY_MATH_ROUND_TOOLTIP}"},{type:"math_on_list",message0:"%1 %2",args0:[{type:"field_dropdown",name:"OP",options:[["%{BKY_MATH_ONLIST_OPERATOR_SUM}","SUM"],["%{BKY_MATH_ONLIST_OPERATOR_MIN}","MIN"],["%{BKY_MATH_ONLIST_OPERATOR_MAX}","MAX"],["%{BKY_MATH_ONLIST_OPERATOR_AVERAGE}","AVERAGE"],["%{BKY_MATH_ONLIST_OPERATOR_MEDIAN}","MEDIAN"],["%{BKY_MATH_ONLIST_OPERATOR_MODE}","MODE"],["%{BKY_MATH_ONLIST_OPERATOR_STD_DEV}","STD_DEV"],["%{BKY_MATH_ONLIST_OPERATOR_RANDOM}","RANDOM"]]},{type:"input_value",name:"LIST",check:"Array"}],output:"Number",style:"math_blocks",helpUrl:"%{BKY_MATH_ONLIST_HELPURL}",mutator:"math_modes_of_list_mutator",extensions:["math_op_tooltip"]},{type:"math_modulo",message0:"%{BKY_MATH_MODULO_TITLE}",args0:[{type:"input_value",name:"DIVIDEND",check:"Number"},{type:"input_value",name:"DIVISOR",check:"Number"}],inputsInline:!0,output:"Number",style:"math_blocks",tooltip:"%{BKY_MATH_MODULO_TOOLTIP}",helpUrl:"%{BKY_MATH_MODULO_HELPURL}"},{type:"math_constrain",message0:"%{BKY_MATH_CONSTRAIN_TITLE}",args0:[{type:"input_value",name:"VALUE",check:"Number"},{type:"input_value",name:"LOW",check:"Number"},{type:"input_value",name:"HIGH",check:"Number"}],inputsInline:!0,output:"Number",style:"math_blocks",tooltip:"%{BKY_MATH_CONSTRAIN_TOOLTIP}",helpUrl:"%{BKY_MATH_CONSTRAIN_HELPURL}"},{type:"math_random_int",message0:"%{BKY_MATH_RANDOM_INT_TITLE}",args0:[{type:"input_value",name:"FROM",check:"Number"},{type:"input_value",name:"TO",check:"Number"}],inputsInline:!0,output:"Number",style:"math_blocks",tooltip:"%{BKY_MATH_RANDOM_INT_TOOLTIP}",helpUrl:"%{BKY_MATH_RANDOM_INT_HELPURL}"},{type:"math_random_float",message0:"%{BKY_MATH_RANDOM_FLOAT_TITLE_RANDOM}",output:"Number",style:"math_blocks",tooltip:"%{BKY_MATH_RANDOM_FLOAT_TOOLTIP}",helpUrl:"%{BKY_MATH_RANDOM_FLOAT_HELPURL}"},{type:"math_atan2",message0:"%{BKY_MATH_ATAN2_TITLE}",args0:[{type:"input_value",name:"X",check:"Number"},{type:"input_value",name:"Y",check:"Number"}],inputsInline:!0,output:"Number",style:"math_blocks",tooltip:"%{BKY_MATH_ATAN2_TOOLTIP}",helpUrl:"%{BKY_MATH_ATAN2_HELPURL}"}]),t.Constants.Math.TOOLTIPS_BY_OP={ADD:"%{BKY_MATH_ARITHMETIC_TOOLTIP_ADD}",MINUS:"%{BKY_MATH_ARITHMETIC_TOOLTIP_MINUS}",MULTIPLY:"%{BKY_MATH_ARITHMETIC_TOOLTIP_MULTIPLY}",DIVIDE:"%{BKY_MATH_ARITHMETIC_TOOLTIP_DIVIDE}",POWER:"%{BKY_MATH_ARITHMETIC_TOOLTIP_POWER}",ROOT:"%{BKY_MATH_SINGLE_TOOLTIP_ROOT}",ABS:"%{BKY_MATH_SINGLE_TOOLTIP_ABS}",NEG:"%{BKY_MATH_SINGLE_TOOLTIP_NEG}",LN:"%{BKY_MATH_SINGLE_TOOLTIP_LN}",LOG10:"%{BKY_MATH_SINGLE_TOOLTIP_LOG10}",EXP:"%{BKY_MATH_SINGLE_TOOLTIP_EXP}",POW10:"%{BKY_MATH_SINGLE_TOOLTIP_POW10}",SIN:"%{BKY_MATH_TRIG_TOOLTIP_SIN}",COS:"%{BKY_MATH_TRIG_TOOLTIP_COS}",TAN:"%{BKY_MATH_TRIG_TOOLTIP_TAN}",ASIN:"%{BKY_MATH_TRIG_TOOLTIP_ASIN}",ACOS:"%{BKY_MATH_TRIG_TOOLTIP_ACOS}",ATAN:"%{BKY_MATH_TRIG_TOOLTIP_ATAN}",SUM:"%{BKY_MATH_ONLIST_TOOLTIP_SUM}",MIN:"%{BKY_MATH_ONLIST_TOOLTIP_MIN}",MAX:"%{BKY_MATH_ONLIST_TOOLTIP_MAX}",AVERAGE:"%{BKY_MATH_ONLIST_TOOLTIP_AVERAGE}",MEDIAN:"%{BKY_MATH_ONLIST_TOOLTIP_MEDIAN}",MODE:"%{BKY_MATH_ONLIST_TOOLTIP_MODE}",STD_DEV:"%{BKY_MATH_ONLIST_TOOLTIP_STD_DEV}",RANDOM:"%{BKY_MATH_ONLIST_TOOLTIP_RANDOM}"},t.Extensions.register("math_op_tooltip",t.Extensions.buildTooltipForDropdown("OP",t.Constants.Math.TOOLTIPS_BY_OP)),t.Constants.Math.IS_DIVISIBLEBY_MUTATOR_MIXIN={mutationToDom:function(){var e=t.utils.xml.createElement("mutation"),n="DIVISIBLE_BY"==this.getFieldValue("PROPERTY");return e.setAttribute("divisor_input",n),e},domToMutation:function(t){t="true"==t.getAttribute("divisor_input"),this.updateShape_(t)},updateShape_:function(t){var e=this.getInput("DIVISOR");t?e||this.appendValueInput("DIVISOR").setCheck("Number"):e&&this.removeInput("DIVISOR")}},t.Constants.Math.IS_DIVISIBLE_MUTATOR_EXTENSION=function(){this.getField("PROPERTY").setValidator(function(t){t="DIVISIBLE_BY"==t,this.getSourceBlock().updateShape_(t)})},t.Extensions.registerMutator("math_is_divisibleby_mutator",t.Constants.Math.IS_DIVISIBLEBY_MUTATOR_MIXIN,t.Constants.Math.IS_DIVISIBLE_MUTATOR_EXTENSION),t.Extensions.register("math_change_tooltip",t.Extensions.buildTooltipWithFieldText("%{BKY_MATH_CHANGE_TOOLTIP}","VAR")),t.Constants.Math.LIST_MODES_MUTATOR_MIXIN={updateType_:function(t){"MODE"==t?this.outputConnection.setCheck("Array"):this.outputConnection.setCheck("Number")},mutationToDom:function(){var e=t.utils.xml.createElement("mutation");return e.setAttribute("op",this.getFieldValue("OP")),e},domToMutation:function(t){this.updateType_(t.getAttribute("op"))}},t.Constants.Math.LIST_MODES_MUTATOR_EXTENSION=function(){this.getField("OP").setValidator(function(t){this.updateType_(t)}.bind(this))},t.Extensions.registerMutator("math_modes_of_list_mutator",t.Constants.Math.LIST_MODES_MUTATOR_MIXIN,t.Constants.Math.LIST_MODES_MUTATOR_EXTENSION),t.Blocks.procedures={},t.Blocks.procedures_defnoreturn={init:function(){var e=t.Procedures.findLegalName("",this);(e=new t.FieldTextInput(e,t.Procedures.rename)).setSpellcheck(!1),this.appendDummyInput().appendField(t.Msg.PROCEDURES_DEFNORETURN_TITLE).appendField(e,"NAME").appendField("","PARAMS"),this.setMutator(new t.Mutator(["procedures_mutatorarg"])),(this.workspace.options.comments||this.workspace.options.parentWorkspace&&this.workspace.options.parentWorkspace.options.comments)&&t.Msg.PROCEDURES_DEFNORETURN_COMMENT&&this.setCommentText(t.Msg.PROCEDURES_DEFNORETURN_COMMENT),this.setStyle("procedure_blocks"),this.setTooltip(t.Msg.PROCEDURES_DEFNORETURN_TOOLTIP),this.setHelpUrl(t.Msg.PROCEDURES_DEFNORETURN_HELPURL),this.arguments_=[],this.argumentVarModels_=[],this.setStatements_(!0),this.statementConnection_=null},setStatements_:function(e){this.hasStatements_!==e&&(e?(this.appendStatementInput("STACK").appendField(t.Msg.PROCEDURES_DEFNORETURN_DO),this.getInput("RETURN")&&this.moveInputBefore("STACK","RETURN")):this.removeInput("STACK",!0),this.hasStatements_=e)},updateParams_:function(){var e="";this.arguments_.length&&(e=t.Msg.PROCEDURES_BEFORE_PARAMS+" "+this.arguments_.join(", ")),t.Events.disable();try{this.setFieldValue(e,"PARAMS")}finally{t.Events.enable()}},mutationToDom:function(e){var n=t.utils.xml.createElement("mutation");e&&n.setAttribute("name",this.getFieldValue("NAME"));for(var r=0;r<this.argumentVarModels_.length;r++){var i=t.utils.xml.createElement("arg"),o=this.argumentVarModels_[r];i.setAttribute("name",o.name),i.setAttribute("varid",o.getId()),e&&this.paramIds_&&i.setAttribute("paramId",this.paramIds_[r]),n.appendChild(i)}return this.hasStatements_||n.setAttribute("statements","false"),n},domToMutation:function(e){this.arguments_=[],this.argumentVarModels_=[];for(var n,r=0;n=e.childNodes[r];r++)if("arg"==n.nodeName.toLowerCase()){var i=n.getAttribute("name");n=n.getAttribute("varid")||n.getAttribute("varId"),this.arguments_.push(i),null!=(n=t.Variables.getOrCreateVariablePackage(this.workspace,n,i,""))?this.argumentVarModels_.push(n):console.log("Failed to create a variable with name "+i+", ignoring.")}this.updateParams_(),t.Procedures.mutateCallers(this),this.setStatements_("false"!==e.getAttribute("statements"))},decompose:function(e){var n=t.utils.xml.createElement("block");n.setAttribute("type","procedures_mutatorcontainer");var r=t.utils.xml.createElement("statement");r.setAttribute("name","STACK"),n.appendChild(r);for(var i=0;i<this.arguments_.length;i++){var o=t.utils.xml.createElement("block");o.setAttribute("type","procedures_mutatorarg");var s=t.utils.xml.createElement("field");s.setAttribute("name","NAME");var a=t.utils.xml.createTextNode(this.arguments_[i]);s.appendChild(a),o.appendChild(s),s=t.utils.xml.createElement("next"),o.appendChild(s),r.appendChild(o),r=s}return e=t.Xml.domToBlock(n,e),"procedures_defreturn"==this.type?e.setFieldValue(this.hasStatements_,"STATEMENTS"):e.removeInput("STATEMENT_INPUT"),t.Procedures.mutateCallers(this),e},compose:function(e){this.arguments_=[],this.paramIds_=[],this.argumentVarModels_=[];for(var n=e.getInputTargetBlock("STACK");n&&!n.isInsertionMarker();){var r=n.getFieldValue("NAME");this.arguments_.push(r),r=this.workspace.getVariable(r,""),this.argumentVarModels_.push(r),this.paramIds_.push(n.id),n=n.nextConnection&&n.nextConnection.targetBlock()}this.updateParams_(),t.Procedures.mutateCallers(this),null!==(e=e.getFieldValue("STATEMENTS"))&&(e="TRUE"==e,this.hasStatements_!=e)&&(e?(this.setStatements_(!0),t.Mutator.reconnect(this.statementConnection_,this,"STACK"),this.statementConnection_=null):(e=this.getInput("STACK").connection,(this.statementConnection_=e.targetConnection)&&((e=e.targetBlock()).unplug(),e.bumpNeighbours()),this.setStatements_(!1)))},getProcedureDef:function(){return[this.getFieldValue("NAME"),this.arguments_,!1]},getVars:function(){return this.arguments_},getVarModels:function(){return this.argumentVarModels_},renameVarById:function(e,n){var r=this.workspace.getVariableById(e);if(""==r.type){r=r.name,n=this.workspace.getVariableById(n);for(var i=!1,o=0;o<this.argumentVarModels_.length;o++)this.argumentVarModels_[o].getId()==e&&(this.arguments_[o]=n.name,this.argumentVarModels_[o]=n,i=!0);i&&(this.displayRenamedVar_(r,n.name),t.Procedures.mutateCallers(this))}},updateVarName:function(e){for(var n=e.name,r=!1,i=0;i<this.argumentVarModels_.length;i++)if(this.argumentVarModels_[i].getId()==e.getId()){var o=this.arguments_[i];this.arguments_[i]=n,r=!0}r&&(this.displayRenamedVar_(o,n),t.Procedures.mutateCallers(this))},displayRenamedVar_:function(e,n){if(this.updateParams_(),this.mutator&&this.mutator.isVisible())for(var r,i=this.mutator.workspace_.getAllBlocks(!1),o=0;r=i[o];o++)"procedures_mutatorarg"==r.type&&t.Names.equals(e,r.getFieldValue("NAME"))&&r.setFieldValue(n,"NAME")},customContextMenu:function(e){if(!this.isInFlyout){var n={enabled:!0},r=this.getFieldValue("NAME");n.text=t.Msg.PROCEDURES_CREATE_DO.replace("%1",r);var i=t.utils.xml.createElement("mutation");for(i.setAttribute("name",r),r=0;r<this.arguments_.length;r++){var o=t.utils.xml.createElement("arg");o.setAttribute("name",this.arguments_[r]),i.appendChild(o)}if((r=t.utils.xml.createElement("block")).setAttribute("type",this.callType_),r.appendChild(i),n.callback=t.ContextMenu.callbackFactory(this,r),e.push(n),!this.isCollapsed())for(r=0;r<this.argumentVarModels_.length;r++)n={enabled:!0},i=this.argumentVarModels_[r],n.text=t.Msg.VARIABLES_SET_CREATE_GET.replace("%1",i.name),i=t.Variables.generateVariableFieldDom(i),(o=t.utils.xml.createElement("block")).setAttribute("type","variables_get"),o.appendChild(i),n.callback=t.ContextMenu.callbackFactory(this,o),e.push(n)}},callType_:"procedures_callnoreturn"},t.Blocks.procedures_defreturn={init:function(){var e=t.Procedures.findLegalName("",this);(e=new t.FieldTextInput(e,t.Procedures.rename)).setSpellcheck(!1),this.appendDummyInput().appendField(t.Msg.PROCEDURES_DEFRETURN_TITLE).appendField(e,"NAME").appendField("","PARAMS"),this.appendValueInput("RETURN").setAlign(t.ALIGN_RIGHT).appendField(t.Msg.PROCEDURES_DEFRETURN_RETURN),this.setMutator(new t.Mutator(["procedures_mutatorarg"])),(this.workspace.options.comments||this.workspace.options.parentWorkspace&&this.workspace.options.parentWorkspace.options.comments)&&t.Msg.PROCEDURES_DEFRETURN_COMMENT&&this.setCommentText(t.Msg.PROCEDURES_DEFRETURN_COMMENT),this.setStyle("procedure_blocks"),this.setTooltip(t.Msg.PROCEDURES_DEFRETURN_TOOLTIP),this.setHelpUrl(t.Msg.PROCEDURES_DEFRETURN_HELPURL),this.arguments_=[],this.argumentVarModels_=[],this.setStatements_(!0),this.statementConnection_=null},setStatements_:t.Blocks.procedures_defnoreturn.setStatements_,updateParams_:t.Blocks.procedures_defnoreturn.updateParams_,mutationToDom:t.Blocks.procedures_defnoreturn.mutationToDom,domToMutation:t.Blocks.procedures_defnoreturn.domToMutation,decompose:t.Blocks.procedures_defnoreturn.decompose,compose:t.Blocks.procedures_defnoreturn.compose,getProcedureDef:function(){return[this.getFieldValue("NAME"),this.arguments_,!0]},getVars:t.Blocks.procedures_defnoreturn.getVars,getVarModels:t.Blocks.procedures_defnoreturn.getVarModels,renameVarById:t.Blocks.procedures_defnoreturn.renameVarById,updateVarName:t.Blocks.procedures_defnoreturn.updateVarName,displayRenamedVar_:t.Blocks.procedures_defnoreturn.displayRenamedVar_,customContextMenu:t.Blocks.procedures_defnoreturn.customContextMenu,callType_:"procedures_callreturn"},t.Blocks.procedures_mutatorcontainer={init:function(){this.appendDummyInput().appendField(t.Msg.PROCEDURES_MUTATORCONTAINER_TITLE),this.appendStatementInput("STACK"),this.appendDummyInput("STATEMENT_INPUT").appendField(t.Msg.PROCEDURES_ALLOW_STATEMENTS).appendField(new t.FieldCheckbox("TRUE"),"STATEMENTS"),this.setStyle("procedure_blocks"),this.setTooltip(t.Msg.PROCEDURES_MUTATORCONTAINER_TOOLTIP),this.contextMenu=!1}},t.Blocks.procedures_mutatorarg={init:function(){var e=new t.FieldTextInput(t.Procedures.DEFAULT_ARG,this.validator_);e.oldShowEditorFn_=e.showEditor_,e.showEditor_=function(){this.createdVariables_=[],this.oldShowEditorFn_()},this.appendDummyInput().appendField(t.Msg.PROCEDURES_MUTATORARG_TITLE).appendField(e,"NAME"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setStyle("procedure_blocks"),this.setTooltip(t.Msg.PROCEDURES_MUTATORARG_TOOLTIP),this.contextMenu=!1,e.onFinishEditing_=this.deleteIntermediateVars_,e.createdVariables_=[],e.onFinishEditing_("x")},validator_:function(e){var n=this.getSourceBlock(),r=t.Mutator.findParentWs(n.workspace);if(!(e=e.replace(/[\s\xa0]+/g," ").replace(/^ | $/g,"")))return null;for(var i=(n.workspace.targetWorkspace||n.workspace).getAllBlocks(!1),o=e.toLowerCase(),s=0;s<i.length;s++)if(i[s].id!=this.getSourceBlock().id){var a=i[s].getFieldValue("NAME");if(a&&a.toLowerCase()==o)return null}return n.isInFlyout?e:((n=r.getVariable(e,""))&&n.name!=e&&r.renameVariableById(n.getId(),e),n||(n=r.createVariable(e,""))&&this.createdVariables_&&this.createdVariables_.push(n),e)},deleteIntermediateVars_:function(e){var n=t.Mutator.findParentWs(this.getSourceBlock().workspace);if(n)for(var r=0;r<this.createdVariables_.length;r++){var i=this.createdVariables_[r];i.name!=e&&n.deleteVariableById(i.getId())}}},t.Blocks.procedures_callnoreturn={init:function(){this.appendDummyInput("TOPROW").appendField("","NAME"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setStyle("procedure_blocks"),this.setHelpUrl(t.Msg.PROCEDURES_CALLNORETURN_HELPURL),this.arguments_=[],this.argumentVarModels_=[],this.quarkConnections_={},this.quarkIds_=null,this.previousEnabledState_=!0},getProcedureCall:function(){return this.getFieldValue("NAME")},renameProcedure:function(e,n){t.Names.equals(e,this.getProcedureCall())&&(this.setFieldValue(n,"NAME"),this.setTooltip((this.outputConnection?t.Msg.PROCEDURES_CALLRETURN_TOOLTIP:t.Msg.PROCEDURES_CALLNORETURN_TOOLTIP).replace("%1",n)))},setProcedureParameters_:function(e,n){var r=t.Procedures.getDefinition(this.getProcedureCall(),this.workspace),i=r&&r.mutator&&r.mutator.isVisible();if(i||(this.quarkConnections_={},this.quarkIds_=null),n)if(e.join("\n")==this.arguments_.join("\n"))this.quarkIds_=n;else{if(n.length!=e.length)throw RangeError("paramNames and paramIds must be the same length.");this.setCollapsed(!1),this.quarkIds_||(this.quarkConnections_={},this.quarkIds_=[]),r=this.rendered,this.rendered=!1;for(var o=0;o<this.arguments_.length;o++){var s=this.getInput("ARG"+o);s&&(s=s.connection.targetConnection,this.quarkConnections_[this.quarkIds_[o]]=s,i&&s&&-1==n.indexOf(this.quarkIds_[o])&&(s.disconnect(),s.getSourceBlock().bumpNeighbours()))}for(this.arguments_=[].concat(e),this.argumentVarModels_=[],o=0;o<this.arguments_.length;o++)e=t.Variables.getOrCreateVariablePackage(this.workspace,null,this.arguments_[o],""),this.argumentVarModels_.push(e);if(this.updateShape_(),this.quarkIds_=n)for(o=0;o<this.arguments_.length;o++)(n=this.quarkIds_[o])in this.quarkConnections_&&(s=this.quarkConnections_[n],t.Mutator.reconnect(s,this,"ARG"+o)||delete this.quarkConnections_[n]);(this.rendered=r)&&this.render()}},updateShape_:function(){for(var e=0;e<this.arguments_.length;e++){var n=this.getField("ARGNAME"+e);if(n){t.Events.disable();try{n.setValue(this.arguments_[e])}finally{t.Events.enable()}}else n=new t.FieldLabel(this.arguments_[e]),this.appendValueInput("ARG"+e).setAlign(t.ALIGN_RIGHT).appendField(n,"ARGNAME"+e).init()}for(;this.getInput("ARG"+e);)this.removeInput("ARG"+e),e++;(e=this.getInput("TOPROW"))&&(this.arguments_.length?this.getField("WITH")||(e.appendField(t.Msg.PROCEDURES_CALL_BEFORE_PARAMS,"WITH"),e.init()):this.getField("WITH")&&e.removeField("WITH"))},mutationToDom:function(){var e=t.utils.xml.createElement("mutation");e.setAttribute("name",this.getProcedureCall());for(var n=0;n<this.arguments_.length;n++){var r=t.utils.xml.createElement("arg");r.setAttribute("name",this.arguments_[n]),e.appendChild(r)}return e},domToMutation:function(t){var e=t.getAttribute("name");this.renameProcedure(this.getProcedureCall(),e),e=[];for(var n,r=[],i=0;n=t.childNodes[i];i++)"arg"==n.nodeName.toLowerCase()&&(e.push(n.getAttribute("name")),r.push(n.getAttribute("paramId")));this.setProcedureParameters_(e,r)},getVars:function(){return this.arguments_},getVarModels:function(){return this.argumentVarModels_},onchange:function(e){if(this.workspace&&!this.workspace.isFlyout&&e.recordUndo)if(e.type==t.Events.BLOCK_CREATE&&-1!=e.ids.indexOf(this.id)){var n=this.getProcedureCall();if(!(n=t.Procedures.getDefinition(n,this.workspace))||n.type==this.defType_&&JSON.stringify(n.getVars())==JSON.stringify(this.arguments_)||(n=null),!n){t.Events.setGroup(e.group),e=t.utils.xml.createElement("xml"),(n=t.utils.xml.createElement("block")).setAttribute("type",this.defType_);var r=this.getRelativeToSurfaceXY(),i=r.y+2*t.SNAP_RADIUS;n.setAttribute("x",r.x+t.SNAP_RADIUS*(this.RTL?-1:1)),n.setAttribute("y",i),r=this.mutationToDom(),n.appendChild(r),(r=t.utils.xml.createElement("field")).setAttribute("name","NAME"),(i=this.getProcedureCall())||(i=t.Procedures.findLegalName("",this),this.renameProcedure("",i)),r.appendChild(t.utils.xml.createTextNode(i)),n.appendChild(r),e.appendChild(n),t.Xml.domToWorkspace(e,this.workspace),t.Events.setGroup(!1)}}else e.type==t.Events.BLOCK_DELETE?(n=this.getProcedureCall(),(n=t.Procedures.getDefinition(n,this.workspace))||(t.Events.setGroup(e.group),this.dispose(!0),t.Events.setGroup(!1))):e.type==t.Events.CHANGE&&"disabled"==e.element&&(n=this.getProcedureCall(),(n=t.Procedures.getDefinition(n,this.workspace))&&n.id==e.blockId&&((n=t.Events.getGroup())&&console.log("Saw an existing group while responding to a definition change"),t.Events.setGroup(e.group),e.newValue?(this.previousEnabledState_=this.isEnabled(),this.setEnabled(!1)):this.setEnabled(this.previousEnabledState_),t.Events.setGroup(n)))},customContextMenu:function(e){if(this.workspace.isMovable()){var n={enabled:!0};n.text=t.Msg.PROCEDURES_HIGHLIGHT_DEF;var r=this.getProcedureCall(),i=this.workspace;n.callback=function(){var e=t.Procedures.getDefinition(r,i);e&&(i.centerOnBlock(e.id),e.select())},e.push(n)}},defType_:"procedures_defnoreturn"},t.Blocks.procedures_callreturn={init:function(){this.appendDummyInput("TOPROW").appendField("","NAME"),this.setOutput(!0),this.setStyle("procedure_blocks"),this.setHelpUrl(t.Msg.PROCEDURES_CALLRETURN_HELPURL),this.arguments_=[],this.argumentVarModels_=[],this.quarkConnections_={},this.quarkIds_=null,this.previousEnabledState_=!0},getProcedureCall:t.Blocks.procedures_callnoreturn.getProcedureCall,renameProcedure:t.Blocks.procedures_callnoreturn.renameProcedure,setProcedureParameters_:t.Blocks.procedures_callnoreturn.setProcedureParameters_,updateShape_:t.Blocks.procedures_callnoreturn.updateShape_,mutationToDom:t.Blocks.procedures_callnoreturn.mutationToDom,domToMutation:t.Blocks.procedures_callnoreturn.domToMutation,getVars:t.Blocks.procedures_callnoreturn.getVars,getVarModels:t.Blocks.procedures_callnoreturn.getVarModels,onchange:t.Blocks.procedures_callnoreturn.onchange,customContextMenu:t.Blocks.procedures_callnoreturn.customContextMenu,defType_:"procedures_defreturn"},t.Blocks.procedures_ifreturn={init:function(){this.appendValueInput("CONDITION").setCheck("Boolean").appendField(t.Msg.CONTROLS_IF_MSG_IF),this.appendValueInput("VALUE").appendField(t.Msg.PROCEDURES_DEFRETURN_RETURN),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setStyle("procedure_blocks"),this.setTooltip(t.Msg.PROCEDURES_IFRETURN_TOOLTIP),this.setHelpUrl(t.Msg.PROCEDURES_IFRETURN_HELPURL),this.hasReturnValue_=!0},mutationToDom:function(){var e=t.utils.xml.createElement("mutation");return e.setAttribute("value",Number(this.hasReturnValue_)),e},domToMutation:function(e){this.hasReturnValue_=1==e.getAttribute("value"),this.hasReturnValue_||(this.removeInput("VALUE"),this.appendDummyInput("VALUE").appendField(t.Msg.PROCEDURES_DEFRETURN_RETURN))},onchange:function(e){if(this.workspace.isDragging&&!this.workspace.isDragging()){e=!1;var n=this;do{if(-1!=this.FUNCTION_TYPES.indexOf(n.type)){e=!0;break}n=n.getSurroundParent()}while(n);e?("procedures_defnoreturn"==n.type&&this.hasReturnValue_?(this.removeInput("VALUE"),this.appendDummyInput("VALUE").appendField(t.Msg.PROCEDURES_DEFRETURN_RETURN),this.hasReturnValue_=!1):"procedures_defreturn"!=n.type||this.hasReturnValue_||(this.removeInput("VALUE"),this.appendValueInput("VALUE").appendField(t.Msg.PROCEDURES_DEFRETURN_RETURN),this.hasReturnValue_=!0),this.setWarningText(null),this.isInFlyout||this.setEnabled(!0)):(this.setWarningText(t.Msg.PROCEDURES_IFRETURN_WARNING),this.isInFlyout||this.getInheritedDisabled()||this.setEnabled(!1))}},FUNCTION_TYPES:["procedures_defnoreturn","procedures_defreturn"]},t.Blocks.texts={},t.Constants.Text={},t.Constants.Text.HUE=160,t.defineBlocksWithJsonArray([{type:"text",message0:"%1",args0:[{type:"field_input",name:"TEXT",text:""}],output:"String",style:"text_blocks",helpUrl:"%{BKY_TEXT_TEXT_HELPURL}",tooltip:"%{BKY_TEXT_TEXT_TOOLTIP}",extensions:["text_quotes","parent_tooltip_when_inline"]},{type:"text_multiline",message0:"%1 %2",args0:[{type:"field_image",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAARCAYAAADpPU2iAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAdhgAAHYYBXaITgQAAABh0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMS42/U4J6AAAAP1JREFUOE+Vks0KQUEYhjmRIja4ABtZ2dm5A3t3Ia6AUm7CylYuQRaUhZSlLZJiQbFAyRnPN33y01HOW08z8873zpwzM4F3GWOCruvGIE4/rLaV+Nq1hVGMBqzhqlxgCys4wJA65xnogMHsQ5lujnYHTejBBCK2mE4abjCgMGhNxHgDFWjDSG07kdfVa2pZMf4ZyMAdWmpZMfYOsLiDMYMjlMB+K613QISRhTnITnsYg5yUd0DETmEoMlkFOeIT/A58iyK5E18BuTBfgYXfwNJv4P9/oEBerLylOnRhygmGdPpTTBZAPkde61lbQe4moWUvYUZYLfUNftIY4zwA5X2Z9AYnQrEAAAAASUVORK5CYII=",width:12,height:17,alt:"¶"},{type:"field_multilinetext",name:"TEXT",text:""}],output:"String",style:"text_blocks",helpUrl:"%{BKY_TEXT_TEXT_HELPURL}",tooltip:"%{BKY_TEXT_TEXT_TOOLTIP}",extensions:["parent_tooltip_when_inline"]},{type:"text_join",message0:"",output:"String",style:"text_blocks",helpUrl:"%{BKY_TEXT_JOIN_HELPURL}",tooltip:"%{BKY_TEXT_JOIN_TOOLTIP}",mutator:"text_join_mutator"},{type:"text_create_join_container",message0:"%{BKY_TEXT_CREATE_JOIN_TITLE_JOIN} %1 %2",args0:[{type:"input_dummy"},{type:"input_statement",name:"STACK"}],style:"text_blocks",tooltip:"%{BKY_TEXT_CREATE_JOIN_TOOLTIP}",enableContextMenu:!1},{type:"text_create_join_item",message0:"%{BKY_TEXT_CREATE_JOIN_ITEM_TITLE_ITEM}",previousStatement:null,nextStatement:null,style:"text_blocks",tooltip:"%{BKY_TEXT_CREATE_JOIN_ITEM_TOOLTIP}",enableContextMenu:!1},{type:"text_append",message0:"%{BKY_TEXT_APPEND_TITLE}",args0:[{type:"field_variable",name:"VAR",variable:"%{BKY_TEXT_APPEND_VARIABLE}"},{type:"input_value",name:"TEXT"}],previousStatement:null,nextStatement:null,style:"text_blocks",extensions:["text_append_tooltip"]},{type:"text_length",message0:"%{BKY_TEXT_LENGTH_TITLE}",args0:[{type:"input_value",name:"VALUE",check:["String","Array"]}],output:"Number",style:"text_blocks",tooltip:"%{BKY_TEXT_LENGTH_TOOLTIP}",helpUrl:"%{BKY_TEXT_LENGTH_HELPURL}"},{type:"text_isEmpty",message0:"%{BKY_TEXT_ISEMPTY_TITLE}",args0:[{type:"input_value",name:"VALUE",check:["String","Array"]}],output:"Boolean",style:"text_blocks",tooltip:"%{BKY_TEXT_ISEMPTY_TOOLTIP}",helpUrl:"%{BKY_TEXT_ISEMPTY_HELPURL}"},{type:"text_indexOf",message0:"%{BKY_TEXT_INDEXOF_TITLE}",args0:[{type:"input_value",name:"VALUE",check:"String"},{type:"field_dropdown",name:"END",options:[["%{BKY_TEXT_INDEXOF_OPERATOR_FIRST}","FIRST"],["%{BKY_TEXT_INDEXOF_OPERATOR_LAST}","LAST"]]},{type:"input_value",name:"FIND",check:"String"}],output:"Number",style:"text_blocks",helpUrl:"%{BKY_TEXT_INDEXOF_HELPURL}",inputsInline:!0,extensions:["text_indexOf_tooltip"]},{type:"text_charAt",message0:"%{BKY_TEXT_CHARAT_TITLE}",args0:[{type:"input_value",name:"VALUE",check:"String"},{type:"field_dropdown",name:"WHERE",options:[["%{BKY_TEXT_CHARAT_FROM_START}","FROM_START"],["%{BKY_TEXT_CHARAT_FROM_END}","FROM_END"],["%{BKY_TEXT_CHARAT_FIRST}","FIRST"],["%{BKY_TEXT_CHARAT_LAST}","LAST"],["%{BKY_TEXT_CHARAT_RANDOM}","RANDOM"]]}],output:"String",style:"text_blocks",helpUrl:"%{BKY_TEXT_CHARAT_HELPURL}",inputsInline:!0,mutator:"text_charAt_mutator"}]),t.Blocks.text_getSubstring={init:function(){this.WHERE_OPTIONS_1=[[t.Msg.TEXT_GET_SUBSTRING_START_FROM_START,"FROM_START"],[t.Msg.TEXT_GET_SUBSTRING_START_FROM_END,"FROM_END"],[t.Msg.TEXT_GET_SUBSTRING_START_FIRST,"FIRST"]],this.WHERE_OPTIONS_2=[[t.Msg.TEXT_GET_SUBSTRING_END_FROM_START,"FROM_START"],[t.Msg.TEXT_GET_SUBSTRING_END_FROM_END,"FROM_END"],[t.Msg.TEXT_GET_SUBSTRING_END_LAST,"LAST"]],this.setHelpUrl(t.Msg.TEXT_GET_SUBSTRING_HELPURL),this.setStyle("text_blocks"),this.appendValueInput("STRING").setCheck("String").appendField(t.Msg.TEXT_GET_SUBSTRING_INPUT_IN_TEXT),this.appendDummyInput("AT1"),this.appendDummyInput("AT2"),t.Msg.TEXT_GET_SUBSTRING_TAIL&&this.appendDummyInput("TAIL").appendField(t.Msg.TEXT_GET_SUBSTRING_TAIL),this.setInputsInline(!0),this.setOutput(!0,"String"),this.updateAt_(1,!0),this.updateAt_(2,!0),this.setTooltip(t.Msg.TEXT_GET_SUBSTRING_TOOLTIP)},mutationToDom:function(){var e=t.utils.xml.createElement("mutation"),n=this.getInput("AT1").type==t.INPUT_VALUE;return e.setAttribute("at1",n),n=this.getInput("AT2").type==t.INPUT_VALUE,e.setAttribute("at2",n),e},domToMutation:function(t){var e="true"==t.getAttribute("at1");t="true"==t.getAttribute("at2"),this.updateAt_(1,e),this.updateAt_(2,t)},updateAt_:function(e,n){this.removeInput("AT"+e),this.removeInput("ORDINAL"+e,!0),n?(this.appendValueInput("AT"+e).setCheck("Number"),t.Msg.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput("ORDINAL"+e).appendField(t.Msg.ORDINAL_NUMBER_SUFFIX)):this.appendDummyInput("AT"+e),2==e&&t.Msg.TEXT_GET_SUBSTRING_TAIL&&(this.removeInput("TAIL",!0),this.appendDummyInput("TAIL").appendField(t.Msg.TEXT_GET_SUBSTRING_TAIL));var r=new t.FieldDropdown(this["WHERE_OPTIONS_"+e],function(t){var r="FROM_START"==t||"FROM_END"==t;if(r!=n){var i=this.getSourceBlock();return i.updateAt_(e,r),i.setFieldValue(t,"WHERE"+e),null}});this.getInput("AT"+e).appendField(r,"WHERE"+e),1==e&&(this.moveInputBefore("AT1","AT2"),this.getInput("ORDINAL1")&&this.moveInputBefore("ORDINAL1","AT2"))}},t.Blocks.text_changeCase={init:function(){var e=[[t.Msg.TEXT_CHANGECASE_OPERATOR_UPPERCASE,"UPPERCASE"],[t.Msg.TEXT_CHANGECASE_OPERATOR_LOWERCASE,"LOWERCASE"],[t.Msg.TEXT_CHANGECASE_OPERATOR_TITLECASE,"TITLECASE"]];this.setHelpUrl(t.Msg.TEXT_CHANGECASE_HELPURL),this.setStyle("text_blocks"),this.appendValueInput("TEXT").setCheck("String").appendField(new t.FieldDropdown(e),"CASE"),this.setOutput(!0,"String"),this.setTooltip(t.Msg.TEXT_CHANGECASE_TOOLTIP)}},t.Blocks.text_trim={init:function(){var e=[[t.Msg.TEXT_TRIM_OPERATOR_BOTH,"BOTH"],[t.Msg.TEXT_TRIM_OPERATOR_LEFT,"LEFT"],[t.Msg.TEXT_TRIM_OPERATOR_RIGHT,"RIGHT"]];this.setHelpUrl(t.Msg.TEXT_TRIM_HELPURL),this.setStyle("text_blocks"),this.appendValueInput("TEXT").setCheck("String").appendField(new t.FieldDropdown(e),"MODE"),this.setOutput(!0,"String"),this.setTooltip(t.Msg.TEXT_TRIM_TOOLTIP)}},t.Blocks.text_print={init:function(){this.jsonInit({message0:t.Msg.TEXT_PRINT_TITLE,args0:[{type:"input_value",name:"TEXT"}],previousStatement:null,nextStatement:null,style:"text_blocks",tooltip:t.Msg.TEXT_PRINT_TOOLTIP,helpUrl:t.Msg.TEXT_PRINT_HELPURL})}},t.Blocks.text_prompt_ext={init:function(){var e=[[t.Msg.TEXT_PROMPT_TYPE_TEXT,"TEXT"],[t.Msg.TEXT_PROMPT_TYPE_NUMBER,"NUMBER"]];this.setHelpUrl(t.Msg.TEXT_PROMPT_HELPURL),this.setStyle("text_blocks");var n=this;e=new t.FieldDropdown(e,function(t){n.updateType_(t)}),this.appendValueInput("TEXT").appendField(e,"TYPE"),this.setOutput(!0,"String"),this.setTooltip(function(){return"TEXT"==n.getFieldValue("TYPE")?t.Msg.TEXT_PROMPT_TOOLTIP_TEXT:t.Msg.TEXT_PROMPT_TOOLTIP_NUMBER})},updateType_:function(t){this.outputConnection.setCheck("NUMBER"==t?"Number":"String")},mutationToDom:function(){var e=t.utils.xml.createElement("mutation");return e.setAttribute("type",this.getFieldValue("TYPE")),e},domToMutation:function(t){this.updateType_(t.getAttribute("type"))}},t.Blocks.text_prompt={init:function(){this.mixin(t.Constants.Text.QUOTE_IMAGE_MIXIN);var e=[[t.Msg.TEXT_PROMPT_TYPE_TEXT,"TEXT"],[t.Msg.TEXT_PROMPT_TYPE_NUMBER,"NUMBER"]],n=this;this.setHelpUrl(t.Msg.TEXT_PROMPT_HELPURL),this.setStyle("text_blocks"),e=new t.FieldDropdown(e,function(t){n.updateType_(t)}),this.appendDummyInput().appendField(e,"TYPE").appendField(this.newQuote_(!0)).appendField(new t.FieldTextInput(""),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,"String"),this.setTooltip(function(){return"TEXT"==n.getFieldValue("TYPE")?t.Msg.TEXT_PROMPT_TOOLTIP_TEXT:t.Msg.TEXT_PROMPT_TOOLTIP_NUMBER})},updateType_:t.Blocks.text_prompt_ext.updateType_,mutationToDom:t.Blocks.text_prompt_ext.mutationToDom,domToMutation:t.Blocks.text_prompt_ext.domToMutation},t.Blocks.text_count={init:function(){this.jsonInit({message0:t.Msg.TEXT_COUNT_MESSAGE0,args0:[{type:"input_value",name:"SUB",check:"String"},{type:"input_value",name:"TEXT",check:"String"}],output:"Number",inputsInline:!0,style:"text_blocks",tooltip:t.Msg.TEXT_COUNT_TOOLTIP,helpUrl:t.Msg.TEXT_COUNT_HELPURL})}},t.Blocks.text_replace={init:function(){this.jsonInit({message0:t.Msg.TEXT_REPLACE_MESSAGE0,args0:[{type:"input_value",name:"FROM",check:"String"},{type:"input_value",name:"TO",check:"String"},{type:"input_value",name:"TEXT",check:"String"}],output:"String",inputsInline:!0,style:"text_blocks",tooltip:t.Msg.TEXT_REPLACE_TOOLTIP,helpUrl:t.Msg.TEXT_REPLACE_HELPURL})}},t.Blocks.text_reverse={init:function(){this.jsonInit({message0:t.Msg.TEXT_REVERSE_MESSAGE0,args0:[{type:"input_value",name:"TEXT",check:"String"}],output:"String",inputsInline:!0,style:"text_blocks",tooltip:t.Msg.TEXT_REVERSE_TOOLTIP,helpUrl:t.Msg.TEXT_REVERSE_HELPURL})}},t.Constants.Text.QUOTE_IMAGE_MIXIN={QUOTE_IMAGE_LEFT_DATAURI:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAn0lEQVQI1z3OMa5BURSF4f/cQhAKjUQhuQmFNwGJEUi0RKN5rU7FHKhpjEH3TEMtkdBSCY1EIv8r7nFX9e29V7EBAOvu7RPjwmWGH/VuF8CyN9/OAdvqIXYLvtRaNjx9mMTDyo+NjAN1HNcl9ZQ5oQMM3dgDUqDo1l8DzvwmtZN7mnD+PkmLa+4mhrxVA9fRowBWmVBhFy5gYEjKMfz9AylsaRRgGzvZAAAAAElFTkSuQmCC",QUOTE_IMAGE_RIGHT_DATAURI:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAqUlEQVQI1z3KvUpCcRiA8ef9E4JNHhI0aFEacm1o0BsI0Slx8wa8gLauoDnoBhq7DcfWhggONDmJJgqCPA7neJ7p934EOOKOnM8Q7PDElo/4x4lFb2DmuUjcUzS3URnGib9qaPNbuXvBO3sGPHJDRG6fGVdMSeWDP2q99FQdFrz26Gu5Tq7dFMzUvbXy8KXeAj57cOklgA+u1B5AoslLtGIHQMaCVnwDnADZIFIrXsoXrgAAAABJRU5ErkJggg==",QUOTE_IMAGE_WIDTH:12,QUOTE_IMAGE_HEIGHT:12,quoteField_:function(t){for(var e,n=0;e=this.inputList[n];n++)for(var r,i=0;r=e.fieldRow[i];i++)if(t==r.name)return e.insertFieldAt(i,this.newQuote_(!0)),void e.insertFieldAt(i+2,this.newQuote_(!1));console.warn('field named "'+t+'" not found in '+this.toDevString())},newQuote_:function(e){return e=this.RTL?!e:e,new t.FieldImage(e?this.QUOTE_IMAGE_LEFT_DATAURI:this.QUOTE_IMAGE_RIGHT_DATAURI,this.QUOTE_IMAGE_WIDTH,this.QUOTE_IMAGE_HEIGHT,e?"“":"”")}},t.Constants.Text.TEXT_QUOTES_EXTENSION=function(){this.mixin(t.Constants.Text.QUOTE_IMAGE_MIXIN),this.quoteField_("TEXT")},t.Constants.Text.TEXT_JOIN_MUTATOR_MIXIN={mutationToDom:function(){var e=t.utils.xml.createElement("mutation");return e.setAttribute("items",this.itemCount_),e},domToMutation:function(t){this.itemCount_=parseInt(t.getAttribute("items"),10),this.updateShape_()},decompose:function(t){var e=t.newBlock("text_create_join_container");e.initSvg();for(var n=e.getInput("STACK").connection,r=0;r<this.itemCount_;r++){var i=t.newBlock("text_create_join_item");i.initSvg(),n.connect(i.previousConnection),n=i.nextConnection}return e},compose:function(e){var n=e.getInputTargetBlock("STACK");for(e=[];n&&!n.isInsertionMarker();)e.push(n.valueConnection_),n=n.nextConnection&&n.nextConnection.targetBlock();for(n=0;n<this.itemCount_;n++){var r=this.getInput("ADD"+n).connection.targetConnection;r&&-1==e.indexOf(r)&&r.disconnect()}for(this.itemCount_=e.length,this.updateShape_(),n=0;n<this.itemCount_;n++)t.Mutator.reconnect(e[n],this,"ADD"+n)},saveConnections:function(t){t=t.getInputTargetBlock("STACK");for(var e=0;t;){var n=this.getInput("ADD"+e);t.valueConnection_=n&&n.connection.targetConnection,e++,t=t.nextConnection&&t.nextConnection.targetBlock()}},updateShape_:function(){this.itemCount_&&this.getInput("EMPTY")?this.removeInput("EMPTY"):this.itemCount_||this.getInput("EMPTY")||this.appendDummyInput("EMPTY").appendField(this.newQuote_(!0)).appendField(this.newQuote_(!1));for(var e=0;e<this.itemCount_;e++)if(!this.getInput("ADD"+e)){var n=this.appendValueInput("ADD"+e).setAlign(t.ALIGN_RIGHT);0==e&&n.appendField(t.Msg.TEXT_JOIN_TITLE_CREATEWITH)}for(;this.getInput("ADD"+e);)this.removeInput("ADD"+e),e++}},t.Constants.Text.TEXT_JOIN_EXTENSION=function(){this.mixin(t.Constants.Text.QUOTE_IMAGE_MIXIN),this.itemCount_=2,this.updateShape_(),this.setMutator(new t.Mutator(["text_create_join_item"]))},t.Extensions.register("text_append_tooltip",t.Extensions.buildTooltipWithFieldText("%{BKY_TEXT_APPEND_TOOLTIP}","VAR")),t.Constants.Text.TEXT_INDEXOF_TOOLTIP_EXTENSION=function(){var e=this;this.setTooltip(function(){return t.Msg.TEXT_INDEXOF_TOOLTIP.replace("%1",e.workspace.options.oneBasedIndex?"0":"-1")})},t.Constants.Text.TEXT_CHARAT_MUTATOR_MIXIN={mutationToDom:function(){var e=t.utils.xml.createElement("mutation");return e.setAttribute("at",!!this.isAt_),e},domToMutation:function(t){t="false"!=t.getAttribute("at"),this.updateAt_(t)},updateAt_:function(e){this.removeInput("AT",!0),this.removeInput("ORDINAL",!0),e&&(this.appendValueInput("AT").setCheck("Number"),t.Msg.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput("ORDINAL").appendField(t.Msg.ORDINAL_NUMBER_SUFFIX)),t.Msg.TEXT_CHARAT_TAIL&&(this.removeInput("TAIL",!0),this.appendDummyInput("TAIL").appendField(t.Msg.TEXT_CHARAT_TAIL)),this.isAt_=e}},t.Constants.Text.TEXT_CHARAT_EXTENSION=function(){this.getField("WHERE").setValidator(function(t){(t="FROM_START"==t||"FROM_END"==t)!=this.isAt_&&this.getSourceBlock().updateAt_(t)}),this.updateAt_(!0);var e=this;this.setTooltip(function(){var n=e.getFieldValue("WHERE"),r=t.Msg.TEXT_CHARAT_TOOLTIP;return("FROM_START"==n||"FROM_END"==n)&&(n="FROM_START"==n?t.Msg.LISTS_INDEX_FROM_START_TOOLTIP:t.Msg.LISTS_INDEX_FROM_END_TOOLTIP)&&(r+=" "+n.replace("%1",e.workspace.options.oneBasedIndex?"#1":"#0")),r})},t.Extensions.register("text_indexOf_tooltip",t.Constants.Text.TEXT_INDEXOF_TOOLTIP_EXTENSION),t.Extensions.register("text_quotes",t.Constants.Text.TEXT_QUOTES_EXTENSION),t.Extensions.registerMutator("text_join_mutator",t.Constants.Text.TEXT_JOIN_MUTATOR_MIXIN,t.Constants.Text.TEXT_JOIN_EXTENSION),t.Extensions.registerMutator("text_charAt_mutator",t.Constants.Text.TEXT_CHARAT_MUTATOR_MIXIN,t.Constants.Text.TEXT_CHARAT_EXTENSION),t.Blocks.variables={},t.Constants.Variables={},t.Constants.Variables.HUE=330,t.defineBlocksWithJsonArray([{type:"variables_get",message0:"%1",args0:[{type:"field_variable",name:"VAR",variable:"%{BKY_VARIABLES_DEFAULT_NAME}"}],output:null,style:"variable_blocks",helpUrl:"%{BKY_VARIABLES_GET_HELPURL}",tooltip:"%{BKY_VARIABLES_GET_TOOLTIP}",extensions:["contextMenu_variableSetterGetter"]},{type:"variables_set",message0:"%{BKY_VARIABLES_SET}",args0:[{type:"field_variable",name:"VAR",variable:"%{BKY_VARIABLES_DEFAULT_NAME}"},{type:"input_value",name:"VALUE"}],previousStatement:null,nextStatement:null,style:"variable_blocks",tooltip:"%{BKY_VARIABLES_SET_TOOLTIP}",helpUrl:"%{BKY_VARIABLES_SET_HELPURL}",extensions:["contextMenu_variableSetterGetter"]}]),t.Constants.Variables.CUSTOM_CONTEXT_MENU_VARIABLE_GETTER_SETTER_MIXIN={customContextMenu:function(e){if(this.isInFlyout)"variables_get"!=this.type&&"variables_get_reporter"!=this.type||(n={text:t.Msg.RENAME_VARIABLE,enabled:!0,callback:t.Constants.Variables.RENAME_OPTION_CALLBACK_FACTORY(this)},o=this.getField("VAR").getText(),i={text:t.Msg.DELETE_VARIABLE.replace("%1",o),enabled:!0,callback:t.Constants.Variables.DELETE_OPTION_CALLBACK_FACTORY(this)},e.unshift(n),e.unshift(i));else{if("variables_get"==this.type)var n="variables_set",r=t.Msg.VARIABLES_GET_CREATE_SET;else n="variables_get",r=t.Msg.VARIABLES_SET_CREATE_GET;var i={enabled:0<this.workspace.remainingCapacity()},o=this.getField("VAR").getText();i.text=r.replace("%1",o),(r=t.utils.xml.createElement("field")).setAttribute("name","VAR"),r.appendChild(t.utils.xml.createTextNode(o)),(o=t.utils.xml.createElement("block")).setAttribute("type",n),o.appendChild(r),i.callback=t.ContextMenu.callbackFactory(this,o),e.push(i)}}},t.Constants.Variables.RENAME_OPTION_CALLBACK_FACTORY=function(e){return function(){var n=e.workspace,r=e.getField("VAR").getVariable();t.Variables.renameVariable(n,r)}},t.Constants.Variables.DELETE_OPTION_CALLBACK_FACTORY=function(t){return function(){var e=t.workspace,n=t.getField("VAR").getVariable();e.deleteVariableById(n.getId()),e.refreshToolboxSelection()}},t.Extensions.registerMixin("contextMenu_variableSetterGetter",t.Constants.Variables.CUSTOM_CONTEXT_MENU_VARIABLE_GETTER_SETTER_MIXIN),t.Constants.VariablesDynamic={},t.Constants.VariablesDynamic.HUE=310,t.defineBlocksWithJsonArray([{type:"variables_get_dynamic",message0:"%1",args0:[{type:"field_variable",name:"VAR",variable:"%{BKY_VARIABLES_DEFAULT_NAME}"}],output:null,style:"variable_dynamic_blocks",helpUrl:"%{BKY_VARIABLES_GET_HELPURL}",tooltip:"%{BKY_VARIABLES_GET_TOOLTIP}",extensions:["contextMenu_variableDynamicSetterGetter"]},{type:"variables_set_dynamic",message0:"%{BKY_VARIABLES_SET}",args0:[{type:"field_variable",name:"VAR",variable:"%{BKY_VARIABLES_DEFAULT_NAME}"},{type:"input_value",name:"VALUE"}],previousStatement:null,nextStatement:null,style:"variable_dynamic_blocks",tooltip:"%{BKY_VARIABLES_SET_TOOLTIP}",helpUrl:"%{BKY_VARIABLES_SET_HELPURL}",extensions:["contextMenu_variableDynamicSetterGetter"]}]),t.Constants.VariablesDynamic.CUSTOM_CONTEXT_MENU_VARIABLE_GETTER_SETTER_MIXIN={customContextMenu:function(e){if(this.isInFlyout)"variables_get_dynamic"!=this.type&&"variables_get_reporter_dynamic"!=this.type||(n={text:t.Msg.RENAME_VARIABLE,enabled:!0,callback:t.Constants.Variables.RENAME_OPTION_CALLBACK_FACTORY(this)},s=this.getField("VAR").getText(),o={text:t.Msg.DELETE_VARIABLE.replace("%1",s),enabled:!0,callback:t.Constants.Variables.DELETE_OPTION_CALLBACK_FACTORY(this)},e.unshift(n),e.unshift(o));else{var n=this.getFieldValue("VAR"),r=this.workspace.getVariableById(n).type;if("variables_get_dynamic"==this.type){n="variables_set_dynamic";var i=t.Msg.VARIABLES_GET_CREATE_SET}else n="variables_get_dynamic",i=t.Msg.VARIABLES_SET_CREATE_GET;var o={enabled:0<this.workspace.remainingCapacity()},s=this.getField("VAR").getText();o.text=i.replace("%1",s),(i=t.utils.xml.createElement("field")).setAttribute("name","VAR"),i.setAttribute("variabletype",r),i.appendChild(t.utils.xml.createTextNode(s)),(s=t.utils.xml.createElement("block")).setAttribute("type",n),s.appendChild(i),o.callback=t.ContextMenu.callbackFactory(this,s),e.push(o)}},onchange:function(e){e=this.getFieldValue("VAR"),e=t.Variables.getVariable(this.workspace,e),"variables_get_dynamic"==this.type?this.outputConnection.setCheck(e.type):this.getInput("VALUE").connection.setCheck(e.type)}},t.Constants.VariablesDynamic.RENAME_OPTION_CALLBACK_FACTORY=function(e){return function(){var n=e.workspace,r=e.getField("VAR").getVariable();t.Variables.renameVariable(n,r)}},t.Constants.VariablesDynamic.DELETE_OPTION_CALLBACK_FACTORY=function(t){return function(){var e=t.workspace,n=t.getField("VAR").getVariable();e.deleteVariableById(n.getId()),e.refreshToolboxSelection()}},t.Extensions.registerMixin("contextMenu_variableDynamicSetterGetter",t.Constants.VariablesDynamic.CUSTOM_CONTEXT_MENU_VARIABLE_GETTER_SETTER_MIXIN),t.Blocks},i=[n("GEkh")],void 0===(o="function"==typeof(r=s)?r.apply(e,i):r)||(t.exports=o)},"QWe/":function(t,e,n){n("crlp")("observable")},Qy0b:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.json=[{tfOpName:"ConcatV2",category:"slice_join",inputs:[{start:0,end:-1,name:"tensors",type:"tensors"},{start:-1,name:"axis",type:"number"}],attrs:[{tfName:"N",name:"n",type:"number",defaultValue:2}]},{tfOpName:"Concat",category:"slice_join",inputs:[{start:1,end:0,name:"tensors",type:"tensors"},{start:0,name:"axis",type:"number"}],attrs:[{tfName:"N",name:"n",type:"number",defaultValue:2}]},{tfOpName:"GatherV2",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"indices",type:"tensor"},{start:2,name:"axis",type:"number",defaultValue:0}],attrs:[{tfName:"batch_dims",name:"batchDims",type:"number",defaultValue:0}]},{tfOpName:"Gather",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"indices",type:"tensor"}],attrs:[{tfName:"validate_indices",name:"validateIndices",type:"bool",notSupported:!0}]},{tfOpName:"Reverse",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"dims",type:"bool[]"}]},{tfOpName:"ReverseV2",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}]},{tfOpName:"Slice",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"begin",type:"number[]"},{start:2,name:"size",type:"number[]"}]},{tfOpName:"StridedSlice",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"begin",type:"number[]"},{start:2,name:"end",type:"number[]"},{start:3,name:"strides",type:"number[]"}],attrs:[{tfName:"begin_mask",name:"beginMask",type:"number",defaultValue:0},{tfName:"end_mask",name:"endMask",type:"number",defaultValue:0},{tfName:"new_axis_mask",name:"newAxisMask",type:"number",defaultValue:0},{tfName:"ellipsis_mask",name:"ellipsisMask",type:"number",defaultValue:0},{tfName:"shrink_axis_mask",name:"shrinkAxisMask",type:"number",defaultValue:0}]},{tfOpName:"Pack",category:"slice_join",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}],attrs:[{tfName:"axis",name:"axis",type:"number",defaultValue:0}]},{tfOpName:"Unpack",category:"slice_join",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"axis",name:"axis",type:"number",defaultValue:0},{tfName:"num",name:"num",type:"number",defaultValue:0,notSupported:!0}]},{tfOpName:"Tile",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"reps",type:"number[]"}]},{tfOpName:"Split",category:"slice_join",inputs:[{start:0,name:"axis",type:"number",defaultValue:0},{start:1,name:"x",type:"tensor"}],attrs:[{tfName:"num_split",name:"numOrSizeSplits",type:"number",defaultValue:1}]},{tfOpName:"SplitV",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"numOrSizeSplits",type:"number[]"},{start:2,name:"axis",type:"number",defaultValue:0}]},{tfOpName:"ScatterNd",category:"slice_join",inputs:[{start:0,name:"indices",type:"tensor"},{start:1,name:"values",type:"tensor"},{start:2,name:"shape",type:"number[]"}]},{tfOpName:"GatherNd",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"indices",type:"tensor"}]},{tfOpName:"SparseToDense",category:"slice_join",inputs:[{start:0,name:"sparseIndices",type:"tensor"},{start:1,name:"outputShape",type:"number[]"},{start:2,name:"sparseValues",type:"tensor"},{start:3,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"validate_indices",name:"validateIndices",type:"bool",defaultValue:!1,notSupported:!0}]}]},R4wc:function(t,e,n){var r=n("kM2E");r(r.S+r.F,"Object",{assign:n("To3L")})},R9M2:function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},RDoK:function(t,e,n){t.exports=function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/dist/",n(n.s=107)}({0:function(t,e,n){"use strict";function r(t,e,n,r,i,o,s,a){var l,u="function"==typeof t?t.options:t;if(e&&(u.render=e,u.staticRenderFns=n,u._compiled=!0),r&&(u.functional=!0),o&&(u._scopeId="data-v-"+o),s?(l=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(s)},u._ssrRegister=l):i&&(l=a?function(){i.call(this,this.$root.$options.shadowRoot)}:i),l)if(u.functional){u._injectStyles=l;var c=u.render;u.render=function(t,e){return l.call(e),c(t,e)}}else{var h=u.beforeCreate;u.beforeCreate=h?[].concat(h,l):[l]}return{exports:t,options:u}}n.d(e,"a",function(){return r})},107:function(t,e,n){"use strict";n.r(e);var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("label",{staticClass:"el-radio",class:[t.border&&t.radioSize?"el-radio--"+t.radioSize:"",{"is-disabled":t.isDisabled},{"is-focus":t.focus},{"is-bordered":t.border},{"is-checked":t.model===t.label}],attrs:{role:"radio","aria-checked":t.model===t.label,"aria-disabled":t.isDisabled,tabindex:t.tabIndex},on:{keydown:function(e){if(!("button"in e)&&t._k(e.keyCode,"space",32,e.key,[" ","Spacebar"]))return null;e.stopPropagation(),e.preventDefault(),t.model=t.isDisabled?t.model:t.label}}},[n("span",{staticClass:"el-radio__input",class:{"is-disabled":t.isDisabled,"is-checked":t.model===t.label}},[n("span",{staticClass:"el-radio__inner"}),n("input",{directives:[{name:"model",rawName:"v-model",value:t.model,expression:"model"}],ref:"radio",staticClass:"el-radio__original",attrs:{type:"radio","aria-hidden":"true",name:t.name,disabled:t.isDisabled,tabindex:"-1"},domProps:{value:t.label,checked:t._q(t.model,t.label)},on:{focus:function(e){t.focus=!0},blur:function(e){t.focus=!1},change:[function(e){t.model=t.label},t.handleChange]}})]),n("span",{staticClass:"el-radio__label",on:{keydown:function(t){t.stopPropagation()}}},[t._t("default"),t.$slots.default?t._e():[t._v(t._s(t.label))]],2)])};r._withStripped=!0;var i=n(4),o={name:"ElRadio",mixins:[n.n(i).a],inject:{elForm:{default:""},elFormItem:{default:""}},componentName:"ElRadio",props:{value:{},label:{},disabled:Boolean,name:String,border:Boolean,size:String},data:function(){return{focus:!1}},computed:{isGroup:function(){for(var t=this.$parent;t;){if("ElRadioGroup"===t.$options.componentName)return this._radioGroup=t,!0;t=t.$parent}return!1},model:{get:function(){return this.isGroup?this._radioGroup.value:this.value},set:function(t){this.isGroup?this.dispatch("ElRadioGroup","input",[t]):this.$emit("input",t),this.$refs.radio&&(this.$refs.radio.checked=this.model===this.label)}},_elFormItemSize:function(){return(this.elFormItem||{}).elFormItemSize},radioSize:function(){var t=this.size||this._elFormItemSize||(this.$ELEMENT||{}).size;return this.isGroup&&this._radioGroup.radioGroupSize||t},isDisabled:function(){return this.isGroup?this._radioGroup.disabled||this.disabled||(this.elForm||{}).disabled:this.disabled||(this.elForm||{}).disabled},tabIndex:function(){return this.isDisabled||this.isGroup&&this.model!==this.label?-1:0}},methods:{handleChange:function(){var t=this;this.$nextTick(function(){t.$emit("change",t.model),t.isGroup&&t.dispatch("ElRadioGroup","handleChange",t.model)})}}},s=n(0),a=Object(s.a)(o,r,[],!1,null,null,null);a.options.__file="packages/radio/src/radio.vue";var l=a.exports;l.install=function(t){t.component(l.name,l)};e.default=l},4:function(t,e){t.exports=n("fPll")}})},RJ9z:function(t,e,n){"use strict";var r=n("Kkag"),i=n("l5jf"),o=n("xMQ1"),s=n("35G1");const a=Object(s.a)({elu_:
  1230. /**
  1231. * @license
  1232. * Copyright 2020 Google LLC. All Rights Reserved.
  1233. * Licensed under the Apache License, Version 2.0 (the "License");
  1234. * you may not use this file except in compliance with the License.
  1235. * You may obtain a copy of the License at
  1236. *
  1237. * http://www.apache.org/licenses/LICENSE-2.0
  1238. *
  1239. * Unless required by applicable law or agreed to in writing, software
  1240. * distributed under the License is distributed on an "AS IS" BASIS,
  1241. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1242. * See the License for the specific language governing permissions and
  1243. * limitations under the License.
  1244. * =============================================================================
  1245. */
  1246. function(t){const e={x:Object(o.a)(t,"x","elu","float32")};return r.a.runKernel(i.U,e)}});e.a=a},RPLV:function(t,e,n){var r=n("7KvD").document;t.exports=r&&r.documentElement},"RY/4":function(t,e,n){var r=n("R9M2"),i=n("dSzd")("toStringTag"),o="Arguments"==r(function(){return arguments}());t.exports=function(t){var e,n,s;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),i))?n:o?r(e):"Object"==(s=r(e))&&"function"==typeof e.callee?"Arguments":s}},Rrel:function(t,e,n){var r=n("TcQ7"),i=n("n0T6").f,o={}.toString,s="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function(t){return s&&"[object Window]"==o.call(t)?function(t){try{return i(t)}catch(t){return s.slice()}}(t):i(r(t))}},Rz9h:function(t,e,n){"use strict";var r=n("Kkag"),i=n("l5jf"),o=n("xMQ1"),s=n("35G1");const a=Object(s.a)({step_:
  1247. /**
  1248. * @license
  1249. * Copyright 2018 Google LLC. All Rights Reserved.
  1250. * Licensed under the Apache License, Version 2.0 (the "License");
  1251. * you may not use this file except in compliance with the License.
  1252. * You may obtain a copy of the License at
  1253. *
  1254. * http://www.apache.org/licenses/LICENSE-2.0
  1255. *
  1256. * Unless required by applicable law or agreed to in writing, software
  1257. * distributed under the License is distributed on an "AS IS" BASIS,
  1258. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1259. * See the License for the specific language governing permissions and
  1260. * limitations under the License.
  1261. * =============================================================================
  1262. */
  1263. function(t,e=0){const n={x:Object(o.a)(t,"x","step")},s={alpha:e};return r.a.runKernel(i._92,n,s)}});e.a=a},S82l:function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},SLDG:function(t,e,n){"use strict";t.exports=function(t){return"object"==typeof t&&!0===t.isAxiosError}},STLj:function(t,e,n){t.exports=function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/dist/",n(n.s=53)}({0:function(t,e,n){"use strict";function r(t,e,n,r,i,o,s,a){var l,u="function"==typeof t?t.options:t;if(e&&(u.render=e,u.staticRenderFns=n,u._compiled=!0),r&&(u.functional=!0),o&&(u._scopeId="data-v-"+o),s?(l=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(s)},u._ssrRegister=l):i&&(l=a?function(){i.call(this,this.$root.$options.shadowRoot)}:i),l)if(u.functional){u._injectStyles=l;var c=u.render;u.render=function(t,e){return l.call(e),c(t,e)}}else{var h=u.beforeCreate;u.beforeCreate=h?[].concat(h,l):[l]}return{exports:t,options:u}}n.d(e,"a",function(){return r})},3:function(t,e){t.exports=n("ylDJ")},33:function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("li",{directives:[{name:"show",rawName:"v-show",value:t.visible,expression:"visible"}],staticClass:"el-select-dropdown__item",class:{selected:t.itemSelected,"is-disabled":t.disabled||t.groupDisabled||t.limitReached,hover:t.hover},on:{mouseenter:t.hoverItem,click:function(e){return e.stopPropagation(),t.selectOptionClick(e)}}},[t._t("default",[n("span",[t._v(t._s(t.currentLabel))])])],2)};r._withStripped=!0;var i=n(4),o=n.n(i),s=n(3),a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},l={mixins:[o.a],name:"ElOption",componentName:"ElOption",inject:["select"],props:{value:{required:!0},label:[String,Number],created:Boolean,disabled:{type:Boolean,default:!1}},data:function(){return{index:-1,groupDisabled:!1,visible:!0,hitState:!1,hover:!1}},computed:{isObject:function(){return"[object object]"===Object.prototype.toString.call(this.value).toLowerCase()},currentLabel:function(){return this.label||(this.isObject?"":this.value)},currentValue:function(){return this.value||this.label||""},itemSelected:function(){return this.select.multiple?this.contains(this.select.value,this.value):this.isEqual(this.value,this.select.value)},limitReached:function(){return!!this.select.multiple&&(!this.itemSelected&&(this.select.value||[]).length>=this.select.multipleLimit&&this.select.multipleLimit>0)}},watch:{currentLabel:function(){this.created||this.select.remote||this.dispatch("ElSelect","setSelected")},value:function(t,e){var n=this.select,r=n.remote,i=n.valueKey;if(!this.created&&!r){if(i&&"object"===(void 0===t?"undefined":a(t))&&"object"===(void 0===e?"undefined":a(e))&&t[i]===e[i])return;this.dispatch("ElSelect","setSelected")}}},methods:{isEqual:function(t,e){if(this.isObject){var n=this.select.valueKey;return Object(s.getValueByPath)(t,n)===Object(s.getValueByPath)(e,n)}return t===e},contains:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments[1];if(this.isObject){var n=this.select.valueKey;return t&&t.some(function(t){return Object(s.getValueByPath)(t,n)===Object(s.getValueByPath)(e,n)})}return t&&t.indexOf(e)>-1},handleGroupDisabled:function(t){this.groupDisabled=t},hoverItem:function(){this.disabled||this.groupDisabled||(this.select.hoverIndex=this.select.options.indexOf(this))},selectOptionClick:function(){!0!==this.disabled&&!0!==this.groupDisabled&&this.dispatch("ElSelect","handleOptionClick",[this,!0])},queryChange:function(t){this.visible=new RegExp(Object(s.escapeRegexpString)(t),"i").test(this.currentLabel)||this.created,this.visible||this.select.filteredOptionsCount--}},created:function(){this.select.options.push(this),this.select.cachedOptions.push(this),this.select.optionsCount++,this.select.filteredOptionsCount++,this.$on("queryChange",this.queryChange),this.$on("handleGroupDisabled",this.handleGroupDisabled)},beforeDestroy:function(){var t=this.select,e=t.selected,n=t.multiple?e:[e],r=this.select.cachedOptions.indexOf(this),i=n.indexOf(this);r>-1&&i<0&&this.select.cachedOptions.splice(r,1),this.select.onOptionDestroy(this.select.options.indexOf(this))}},u=n(0),c=Object(u.a)(l,r,[],!1,null,null,null);c.options.__file="packages/select/src/option.vue";e.a=c.exports},4:function(t,e){t.exports=n("fPll")},53:function(t,e,n){"use strict";n.r(e);var r=n(33);r.a.install=function(t){t.component(r.a.name,r.a)},e.default=r.a}})},SW71:function(t,e,n){"use strict";e.a=function(t){return r[t]};
  1264. /**
  1265. * @license
  1266. * Copyright 2019 Google LLC. All Rights Reserved.
  1267. * Licensed under the Apache License, Version 2.0 (the "License");
  1268. * you may not use this file except in compliance with the License.
  1269. * You may obtain a copy of the License at
  1270. *
  1271. * http://www.apache.org/licenses/LICENSE-2.0
  1272. *
  1273. * Unless required by applicable law or agreed to in writing, software
  1274. * distributed under the License is distributed on an "AS IS" BASIS,
  1275. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1276. * See the License for the specific language governing permissions and
  1277. * limitations under the License.
  1278. * =============================================================================
  1279. */
  1280. const r={}},SXzR:function(t,e,n){t.exports=function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/dist/",n(n.s=73)}({0:function(t,e,n){"use strict";function r(t,e,n,r,i,o,s,a){var l,u="function"==typeof t?t.options:t;if(e&&(u.render=e,u.staticRenderFns=n,u._compiled=!0),r&&(u.functional=!0),o&&(u._scopeId="data-v-"+o),s?(l=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(s)},u._ssrRegister=l):i&&(l=a?function(){i.call(this,this.$root.$options.shadowRoot)}:i),l)if(u.functional){u._injectStyles=l;var c=u.render;u.render=function(t,e){return l.call(e),c(t,e)}}else{var h=u.beforeCreate;u.beforeCreate=h?[].concat(h,l):[l]}return{exports:t,options:u}}n.d(e,"a",function(){return r})},2:function(t,e){t.exports=n("2kvA")},3:function(t,e){t.exports=n("ylDJ")},5:function(t,e){t.exports=n("fKx3")},7:function(t,e){t.exports=n("7+uW")},73:function(t,e,n){"use strict";n.r(e);var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("span",[n("transition",{attrs:{name:t.transition},on:{"after-enter":t.handleAfterEnter,"after-leave":t.handleAfterLeave}},[n("div",{directives:[{name:"show",rawName:"v-show",value:!t.disabled&&t.showPopper,expression:"!disabled && showPopper"}],ref:"popper",staticClass:"el-popover el-popper",class:[t.popperClass,t.content&&"el-popover--plain"],style:{width:t.width+"px"},attrs:{role:"tooltip",id:t.tooltipId,"aria-hidden":t.disabled||!t.showPopper?"true":"false"}},[t.title?n("div",{staticClass:"el-popover__title",domProps:{textContent:t._s(t.title)}}):t._e(),t._t("default",[t._v(t._s(t.content))])],2)]),n("span",{ref:"wrapper",staticClass:"el-popover__reference-wrapper"},[t._t("reference")],2)],1)};r._withStripped=!0;var i=n(5),o=n.n(i),s=n(2),a=n(3),l={name:"ElPopover",mixins:[o.a],props:{trigger:{type:String,default:"click",validator:function(t){return["click","focus","hover","manual"].indexOf(t)>-1}},openDelay:{type:Number,default:0},closeDelay:{type:Number,default:200},title:String,disabled:Boolean,content:String,reference:{},popperClass:String,width:{},visibleArrow:{default:!0},arrowOffset:{type:Number,default:0},transition:{type:String,default:"fade-in-linear"},tabindex:{type:Number,default:0}},computed:{tooltipId:function(){return"el-popover-"+Object(a.generateId)()}},watch:{showPopper:function(t){this.disabled||(t?this.$emit("show"):this.$emit("hide"))}},mounted:function(){var t=this,e=this.referenceElm=this.reference||this.$refs.reference,n=this.popper||this.$refs.popper;!e&&this.$refs.wrapper.children&&(e=this.referenceElm=this.$refs.wrapper.children[0]),e&&(Object(s.addClass)(e,"el-popover__reference"),e.setAttribute("aria-describedby",this.tooltipId),e.setAttribute("tabindex",this.tabindex),n.setAttribute("tabindex",0),"click"!==this.trigger&&(Object(s.on)(e,"focusin",function(){t.handleFocus();var n=e.__vue__;n&&"function"==typeof n.focus&&n.focus()}),Object(s.on)(n,"focusin",this.handleFocus),Object(s.on)(e,"focusout",this.handleBlur),Object(s.on)(n,"focusout",this.handleBlur)),Object(s.on)(e,"keydown",this.handleKeydown),Object(s.on)(e,"click",this.handleClick)),"click"===this.trigger?(Object(s.on)(e,"click",this.doToggle),Object(s.on)(document,"click",this.handleDocumentClick)):"hover"===this.trigger?(Object(s.on)(e,"mouseenter",this.handleMouseEnter),Object(s.on)(n,"mouseenter",this.handleMouseEnter),Object(s.on)(e,"mouseleave",this.handleMouseLeave),Object(s.on)(n,"mouseleave",this.handleMouseLeave)):"focus"===this.trigger&&(this.tabindex<0&&console.warn("[Element Warn][Popover]a negative taindex means that the element cannot be focused by tab key"),e.querySelector("input, textarea")?(Object(s.on)(e,"focusin",this.doShow),Object(s.on)(e,"focusout",this.doClose)):(Object(s.on)(e,"mousedown",this.doShow),Object(s.on)(e,"mouseup",this.doClose)))},beforeDestroy:function(){this.cleanup()},deactivated:function(){this.cleanup()},methods:{doToggle:function(){this.showPopper=!this.showPopper},doShow:function(){this.showPopper=!0},doClose:function(){this.showPopper=!1},handleFocus:function(){Object(s.addClass)(this.referenceElm,"focusing"),"click"!==this.trigger&&"focus"!==this.trigger||(this.showPopper=!0)},handleClick:function(){Object(s.removeClass)(this.referenceElm,"focusing")},handleBlur:function(){Object(s.removeClass)(this.referenceElm,"focusing"),"click"!==this.trigger&&"focus"!==this.trigger||(this.showPopper=!1)},handleMouseEnter:function(){var t=this;clearTimeout(this._timer),this.openDelay?this._timer=setTimeout(function(){t.showPopper=!0},this.openDelay):this.showPopper=!0},handleKeydown:function(t){27===t.keyCode&&"manual"!==this.trigger&&this.doClose()},handleMouseLeave:function(){var t=this;clearTimeout(this._timer),this.closeDelay?this._timer=setTimeout(function(){t.showPopper=!1},this.closeDelay):this.showPopper=!1},handleDocumentClick:function(t){var e=this.reference||this.$refs.reference,n=this.popper||this.$refs.popper;!e&&this.$refs.wrapper.children&&(e=this.referenceElm=this.$refs.wrapper.children[0]),this.$el&&e&&!this.$el.contains(t.target)&&!e.contains(t.target)&&n&&!n.contains(t.target)&&(this.showPopper=!1)},handleAfterEnter:function(){this.$emit("after-enter")},handleAfterLeave:function(){this.$emit("after-leave"),this.doDestroy()},cleanup:function(){(this.openDelay||this.closeDelay)&&clearTimeout(this._timer)}},destroyed:function(){var t=this.reference;Object(s.off)(t,"click",this.doToggle),Object(s.off)(t,"mouseup",this.doClose),Object(s.off)(t,"mousedown",this.doShow),Object(s.off)(t,"focusin",this.doShow),Object(s.off)(t,"focusout",this.doClose),Object(s.off)(t,"mousedown",this.doShow),Object(s.off)(t,"mouseup",this.doClose),Object(s.off)(t,"mouseleave",this.handleMouseLeave),Object(s.off)(t,"mouseenter",this.handleMouseEnter),Object(s.off)(document,"click",this.handleDocumentClick)}},u=n(0),c=Object(u.a)(l,r,[],!1,null,null,null);c.options.__file="packages/popover/src/main.vue";var h=c.exports,d=function(t,e,n){var r=e.expression?e.value:e.arg,i=n.context.$refs[r];i&&(Array.isArray(i)?i[0].$refs.reference=t:i.$refs.reference=t)},p={bind:function(t,e,n){d(t,e,n)},inserted:function(t,e,n){d(t,e,n)}},f=n(7);n.n(f).a.directive("popover",p),h.install=function(t){t.directive("popover",p),t.component(h.name,h)},h.directive=p;e.default=h}})},SfB7:function(t,e,n){t.exports=!n("+E39")&&!n("S82l")(function(){return 7!=Object.defineProperty(n("ON07")("div"),"a",{get:function(){return 7}}).a})},SldL:function(t,e){!function(e){"use strict";var n,r=Object.prototype,i=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag",u="object"==typeof t,c=e.regeneratorRuntime;if(c)u&&(t.exports=c);else{(c=e.regeneratorRuntime=u?t.exports:{}).wrap=y;var h="suspendedStart",d="suspendedYield",p="executing",f="completed",g={},m={};m[s]=function(){return this};var v=Object.getPrototypeOf,b=v&&v(v(A([])));b&&b!==r&&i.call(b,s)&&(m=b);var _=w.prototype=x.prototype=Object.create(m);E.prototype=_.constructor=w,w.constructor=E,w[l]=E.displayName="GeneratorFunction",c.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===E||"GeneratorFunction"===(e.displayName||e.name))},c.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,l in t||(t[l]="GeneratorFunction")),t.prototype=Object.create(_),t},c.awrap=function(t){return{__await:t}},C(S.prototype),S.prototype[a]=function(){return this},c.AsyncIterator=S,c.async=function(t,e,n,r){var i=new S(y(t,e,n,r));return c.isGeneratorFunction(e)?i:i.next().then(function(t){return t.done?t.value:i.next()})},C(_),_[l]="Generator",_[s]=function(){return this},_.toString=function(){return"[object Generator]"},c.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},c.values=A,R.prototype={constructor:R,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(I),!t)for(var e in this)"t"===e.charAt(0)&&i.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=n)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,i){return a.type="throw",a.arg=t,e.next=r,i&&(e.method="next",e.arg=n),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var s=this.tryEntries[o],a=s.completion;if("root"===s.tryLoc)return r("end");if(s.tryLoc<=this.prev){var l=i.call(s,"catchLoc"),u=i.call(s,"finallyLoc");if(l&&u){if(this.prev<s.catchLoc)return r(s.catchLoc,!0);if(this.prev<s.finallyLoc)return r(s.finallyLoc)}else if(l){if(this.prev<s.catchLoc)return r(s.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return r(s.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var s=o?o.completion:{};return s.type=t,s.arg=e,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),I(n),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;I(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:A(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=n),g}}}function y(t,e,n,r){var i=e&&e.prototype instanceof x?e:x,o=Object.create(i.prototype),s=new R(r||[]);return o._invoke=function(t,e,n){var r=h;return function(i,o){if(r===p)throw new Error("Generator is already running");if(r===f){if("throw"===i)throw o;return N()}for(n.method=i,n.arg=o;;){var s=n.delegate;if(s){var a=k(s,n);if(a){if(a===g)continue;return a}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===h)throw r=f,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=p;var l=T(t,e,n);if("normal"===l.type){if(r=n.done?f:d,l.arg===g)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r=f,n.method="throw",n.arg=l.arg)}}}(t,n,s),o}function T(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}function x(){}function E(){}function w(){}function C(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function S(t){var e;this._invoke=function(n,r){function o(){return new Promise(function(e,o){!function e(n,r,o,s){var a=T(t[n],t,r);if("throw"!==a.type){var l=a.arg,u=l.value;return u&&"object"==typeof u&&i.call(u,"__await")?Promise.resolve(u.__await).then(function(t){e("next",t,o,s)},function(t){e("throw",t,o,s)}):Promise.resolve(u).then(function(t){l.value=t,o(l)},s)}s(a.arg)}(n,r,e,o)})}return e=e?e.then(o,o):o()}}function k(t,e){var r=t.iterator[e.method];if(r===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=n,k(t,e),"throw"===e.method))return g;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return g}var i=T(r,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,g;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=n),e.delegate=null,g):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,g)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function I(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function R(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function A(t){if(t){var e=t[s];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(i.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=n,e.done=!0,e};return o.next=o}}return{next:N}}function N(){return{value:n,done:!0}}}(function(){return this}()||Function("return this")())},SnLv:function(t,e,n){"use strict";e.a=
  1281. /**
  1282. * @license
  1283. * Copyright 2020 Google Inc. All Rights Reserved.
  1284. * Licensed under the Apache License, Version 2.0 (the "License");
  1285. * you may not use this file except in compliance with the License.
  1286. * You may obtain a copy of the License at
  1287. *
  1288. * http://www.apache.org/licenses/LICENSE-2.0
  1289. *
  1290. * Unless required by applicable law or agreed to in writing, software
  1291. * distributed under the License is distributed on an "AS IS" BASIS,
  1292. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1293. * See the License for the specific language governing permissions and
  1294. * limitations under the License.
  1295. * =============================================================================
  1296. */
  1297. function(t,e="float32",n){return e=e||"float32",i.assertNonNegativeIntegerDimensions(t),new r.b(t,e,n)};var r=n("XPNO"),i=n("XFvI")},SvnF:function(t,e,n){"use strict";e.__esModule=!0;var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};e.default=function(t){return function(t){for(var e=arguments.length,n=Array(e>1?e-1:0),s=1;s<e;s++)n[s-1]=arguments[s];return 1===n.length&&"object"===r(n[0])&&(n=n[0]),n&&n.hasOwnProperty||(n={}),t.replace(o,function(e,r,o,s){var a=void 0;return"{"===t[s-1]&&"}"===t[s+e.length]?o:null===(a=(0,i.hasOwn)(n,o)?n[o]:null)||void 0===a?"":a})}};var i=n("ylDJ"),o=/(%|)\{([0-9a-zA-Z_]+)\}/g},T3Fu:function(t,e,n){"use strict";
  1298. /**
  1299. * @license
  1300. * Copyright 2018 Google LLC. All Rights Reserved.
  1301. * Licensed under the Apache License, Version 2.0 (the "License");
  1302. * you may not use this file except in compliance with the License.
  1303. * You may obtain a copy of the License at
  1304. *
  1305. * http://www.apache.org/licenses/LICENSE-2.0
  1306. *
  1307. * Unless required by applicable law or agreed to in writing, software
  1308. * distributed under the License is distributed on an "AS IS" BASIS,
  1309. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1310. * See the License for the specific language governing permissions and
  1311. * limitations under the License.
  1312. * =============================================================================
  1313. */e.a={float32:4,float16:2,int32:4,uint16:2,uint8:1,bool:1,complex64:8}},TNV1:function(t,e,n){"use strict";var r=n("cGG2");t.exports=function(t,e,n){return r.forEach(n,function(n){t=n(t,e)}),t}},TToO:function(t,e,n){"use strict";e.c=function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},n.d(e,"a",function(){return i}),e.b=function(t,e,n,r){return new(n||(n=Promise))(function(i,o){function s(t){try{l(r.next(t))}catch(t){o(t)}}function a(t){try{l(r.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(s,a)}l((r=r.apply(t,e||[])).next())})},e.d=function(t,e){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},e.e=function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;for(var r=Array(t),i=0,e=0;e<n;e++)for(var o=arguments[e],s=0,a=o.length;s<a;s++,i++)r[i]=o[s];return r};
  1314. /*! *****************************************************************************
  1315. Copyright (c) Microsoft Corporation.
  1316. Permission to use, copy, modify, and/or distribute this software for any
  1317. purpose with or without fee is hereby granted.
  1318. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  1319. REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  1320. AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  1321. INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  1322. LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  1323. OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  1324. PERFORMANCE OF THIS SOFTWARE.
  1325. ***************************************************************************** */
  1326. var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};var i=function(){return(i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)}},TcQ7:function(t,e,n){var r=n("MU5D"),i=n("52gC");t.exports=function(t){return r(i(t))}},TdUJ:function(t,e,n){"use strict";(function(t){n("Kkag");var e=n("kESI"),r=n("v/P2");
  1327. /**
  1328. * @license
  1329. * Copyright 2019 Google LLC. All Rights Reserved.
  1330. * Licensed under the Apache License, Version 2.0 (the "License");
  1331. * you may not use this file except in compliance with the License.
  1332. * You may obtain a copy of the License at
  1333. *
  1334. * http://www.apache.org/licenses/LICENSE-2.0
  1335. *
  1336. * Unless required by applicable law or agreed to in writing, software
  1337. * distributed under the License is distributed on an "AS IS" BASIS,
  1338. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1339. * See the License for the specific language governing permissions and
  1340. * limitations under the License.
  1341. * =============================================================================
  1342. */
  1343. const i=Object(r.b)();i.registerFlag("DEBUG",()=>!1,t=>{t&&console.warn("Debugging mode is ON. The output of every math call will be downloaded to CPU and checked for NaNs. This significantly impacts performance.")}),i.registerFlag("IS_BROWSER",()=>e.isBrowser()),i.registerFlag("IS_NODE",()=>void 0!==t&&void 0!==t.versions&&void 0!==t.versions.node),i.registerFlag("IS_CHROME",()=>"undefined"!=typeof navigator&&null!=navigator&&null!=navigator.userAgent&&/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)),i.registerFlag("PROD",()=>!1),i.registerFlag("TENSORLIKE_CHECK_SHAPE_CONSISTENCY",()=>i.getBool("DEBUG")),i.registerFlag("DEPRECATION_WARNINGS_ENABLED",()=>!0),i.registerFlag("IS_TEST",()=>!1),i.registerFlag("CHECK_COMPUTATION_FOR_ERRORS",()=>!0),i.registerFlag("WRAP_TO_IMAGEBITMAP",()=>!1)}).call(e,n("W2nU"))},To3L:function(t,e,n){"use strict";var r=n("+E39"),i=n("lktj"),o=n("1kS7"),s=n("NpIQ"),a=n("sB3e"),l=n("MU5D"),u=Object.assign;t.exports=!u||n("S82l")(function(){var t={},e={},n=Symbol(),r="abcdefghijklmnopqrst";return t[n]=7,r.split("").forEach(function(t){e[t]=t}),7!=u({},t)[n]||Object.keys(u({},e)).join("")!=r})?function(t,e){for(var n=a(t),u=arguments.length,c=1,h=o.f,d=s.f;u>c;)for(var p,f=l(arguments[c++]),g=h?i(f).concat(h(f)):i(f),m=g.length,v=0;m>v;)p=g[v++],r&&!d.call(f,p)||(n[p]=f[p]);return n}:u},Trqf:function(t,e,n){var r;r=function(t){var e;return t.mode.ECB=((e=t.lib.BlockCipherMode.extend()).Encryptor=e.extend({processBlock:function(t,e){this._cipher.encryptBlock(t,e)}}),e.Decryptor=e.extend({processBlock:function(t,e){this._cipher.decryptBlock(t,e)}}),e),t.mode.ECB},t.exports=r(n("02Hb"),n("fGru"))},U5ju:function(t,e,n){n("M6a0"),n("zQR9"),n("+tPU"),n("CXw9"),n("EqBC"),n("jKW+"),t.exports=n("FeBl").Promise},UWMC:function(t,e,n){"use strict";var r=n("Kkag"),i=n("xMQ1"),o=n("35G1");const s=Object(o.a)({square_:
  1344. /**
  1345. * @license
  1346. * Copyright 2019 Google LLC. All Rights Reserved.
  1347. * Licensed under the Apache License, Version 2.0 (the "License");
  1348. * you may not use this file except in compliance with the License.
  1349. * You may obtain a copy of the License at
  1350. *
  1351. * http://www.apache.org/licenses/LICENSE-2.0
  1352. *
  1353. * Unless required by applicable law or agreed to in writing, software
  1354. * distributed under the License is distributed on an "AS IS" BASIS,
  1355. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1356. * See the License for the specific language governing permissions and
  1357. * limitations under the License.
  1358. * =============================================================================
  1359. */
  1360. function(t){const e=Object(i.a)(t,"x","square");return r.a.runKernel("Square",{x:e},{})}});e.a=s},UuGF:function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},V3tA:function(t,e,n){n("R4wc"),t.exports=n("FeBl").Object.assign},V6aD:function(t,e,n){"use strict";e.b=function(){return r.a},e.e=function(t,e){return r.a.tidy(t,e)},e.a=function(t){Object(s.b)(t).forEach(t=>t.dispose())},e.c=function(t){return r.a.keep(t)},e.d=function(t,e,n=1){return r.a.registerBackend(t,e,n)};var r=n("Kkag"),i=n("v/P2"),o=n("XPNO"),s=n("jb1O");Object(o.d)(function(t){Object(i.b)().getBool("DEPRECATION_WARNINGS_ENABLED")&&console.warn(t+" You can disable deprecation warnings with tf.disableDeprecationWarnings().")})},VOQS:function(t,e,n){(function(t){var r;!function(t,i,o){function s(t,e){return e.c=t.c,e.s0=t.s0,e.s1=t.s1,e.s2=t.s2,e}function a(t,e){var n=new function(t){var e,n=this,r=(e=4022871197,function(t){t=t.toString();for(var n=0;n<t.length;n++){var r=.02519603282416938*(e+=t.charCodeAt(n));r-=e=r>>>0,e=(r*=e)>>>0,e+=4294967296*(r-=e)}return 2.3283064365386963e-10*(e>>>0)});n.next=function(){var t=2091639*n.s0+2.3283064365386963e-10*n.c;return n.s0=n.s1,n.s1=n.s2,n.s2=t-(n.c=0|t)},n.c=1,n.s0=r(" "),n.s1=r(" "),n.s2=r(" "),n.s0-=r(t),n.s0<0&&(n.s0+=1),n.s1-=r(t),n.s1<0&&(n.s1+=1),n.s2-=r(t),n.s2<0&&(n.s2+=1),r=null}(t),r=e&&e.state,i=n.next;return i.int32=function(){return 4294967296*n.next()|0},i.double=function(){return i()+1.1102230246251565e-16*(2097152*i()|0)},i.quick=i,r&&("object"==typeof r&&s(r,n),i.state=function(){return s(n,{})}),i}i&&i.exports?i.exports=a:n("LGuY")&&n("nErl")?void 0===(r=function(){return a}.call(e,n,e,i))||(i.exports=r):this.alea=a}(0,"object"==typeof t&&t,n("LGuY"))}).call(e,n("3IRH")(t))},"VU/8":function(t,e){t.exports=function(t,e,n,r,i,o){var s,a=t=t||{},l=typeof t.default;"object"!==l&&"function"!==l||(s=t,a=t.default);var u,c="function"==typeof a?a.options:a;if(e&&(c.render=e.render,c.staticRenderFns=e.staticRenderFns,c._compiled=!0),n&&(c.functional=!0),i&&(c._scopeId=i),o?(u=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),r&&r.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(o)},c._ssrRegister=u):r&&(u=r),u){var h=c.functional,d=h?c.render:c.beforeCreate;h?(c._injectStyles=u,c.render=function(t,e){return u.call(e),d(t,e)}):c.beforeCreate=d?[].concat(d,u):[u]}return{esModule:s,exports:a,options:c}}},VdVo:function(t,e,n){"use strict";var r=n("Kkag"),i=n("l5jf"),o=n("xMQ1"),s=n("35G1");const a=Object(s.a)({clone_:
  1361. /**
  1362. * @license
  1363. * Copyright 2020 Google LLC. All Rights Reserved.
  1364. * Licensed under the Apache License, Version 2.0 (the "License");
  1365. * you may not use this file except in compliance with the License.
  1366. * You may obtain a copy of the License at
  1367. *
  1368. * http://www.apache.org/licenses/LICENSE-2.0
  1369. *
  1370. * Unless required by applicable law or agreed to in writing, software
  1371. * distributed under the License is distributed on an "AS IS" BASIS,
  1372. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1373. * See the License for the specific language governing permissions and
  1374. * limitations under the License.
  1375. * =============================================================================
  1376. */
  1377. function(t){const e={x:Object(o.a)(t,"x","clone","string_or_numeric")};return r.a.runKernel(i._15,e)}});e.a=a},Vi3T:function(t,e,n){"use strict";e.__esModule=!0,e.default={el:{colorpicker:{confirm:"确定",clear:"清空"},datepicker:{now:"此刻",today:"今天",cancel:"取消",clear:"清空",confirm:"确定",selectDate:"选择日期",selectTime:"选择时间",startDate:"开始日期",startTime:"开始时间",endDate:"结束日期",endTime:"结束时间",prevYear:"前一年",nextYear:"后一年",prevMonth:"上个月",nextMonth:"下个月",year:"年",month1:"1 月",month2:"2 月",month3:"3 月",month4:"4 月",month5:"5 月",month6:"6 月",month7:"7 月",month8:"8 月",month9:"9 月",month10:"10 月",month11:"11 月",month12:"12 月",weeks:{sun:"日",mon:"一",tue:"二",wed:"三",thu:"四",fri:"五",sat:"六"},months:{jan:"一月",feb:"二月",mar:"三月",apr:"四月",may:"五月",jun:"六月",jul:"七月",aug:"八月",sep:"九月",oct:"十月",nov:"十一月",dec:"十二月"}},select:{loading:"加载中",noMatch:"无匹配数据",noData:"无数据",placeholder:"请选择"},cascader:{noMatch:"无匹配数据",loading:"加载中",placeholder:"请选择",noData:"暂无数据"},pagination:{goto:"前往",pagesize:"条/页",total:"共 {total} 条",pageClassifier:"页"},messagebox:{title:"提示",confirm:"确定",cancel:"取消",error:"输入的数据不合法!"},upload:{deleteTip:"按 delete 键可删除",delete:"删除",preview:"查看图片",continue:"继续上传"},table:{emptyText:"暂无数据",confirmFilter:"筛选",resetFilter:"重置",clearFilter:"全部",sumText:"合计"},tree:{emptyText:"暂无数据"},transfer:{noMatch:"无匹配数据",noData:"无数据",titles:["列表 1","列表 2"],filterPlaceholder:"请输入搜索内容",noCheckedFormat:"共 {total} 项",hasCheckedFormat:"已选 {checked}/{total} 项"},image:{error:"加载失败"},pageHeader:{title:"返回"},popconfirm:{confirmButtonText:"确定",cancelButtonText:"取消"},empty:{description:"暂无数据"}}}},W2nU:function(t,e){var n,r,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(t){n=o}try{r="function"==typeof clearTimeout?clearTimeout:s}catch(t){r=s}}();var l,u=[],c=!1,h=-1;function d(){c&&l&&(c=!1,l.length?u=l.concat(u):h=-1,u.length&&p())}function p(){if(!c){var t=a(d);c=!0;for(var e=u.length;e;){for(l=u,u=[];++h<e;)l&&l[h].run();h=-1,e=u.length}l=null,c=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===s||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function f(t,e){this.fun=t,this.array=e}function g(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];u.push(new f(t,e)),1!==u.length||c||a(p)},f.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=g,i.addListener=g,i.once=g,i.off=g,i.removeListener=g,i.removeAllListeners=g,i.emit=g,i.prependListener=g,i.prependOnceListener=g,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},X6Bc:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.json=[{tfOpName:"Abs",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Acos",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Asin",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Atan",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Atan2",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"y",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Ceil",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ClipByValue",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"clipValueMin",type:"number"},{start:2,name:"clipValueMax",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Complex",category:"basic_math",inputs:[{start:0,name:"real",type:"tensor"},{start:1,name:"imag",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ComplexAbs",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Cos",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Cosh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Elu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Exp",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Floor",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Log",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Imag",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"Tout",name:"outputType",type:"dtype",notSupported:!0}]},{tfOpName:"Neg",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Real",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"Tout",name:"outputType",type:"dtype",notSupported:!0}]},{tfOpName:"Prelu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"alpha",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Relu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Relu6",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Selu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sigmoid",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sin",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sinh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sqrt",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Rsqrt",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Square",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Tan",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Tanh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sign",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Round",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Expm1",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Log1p",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Reciprocal",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Softplus",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Asinh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Acosh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Atanh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Erf",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Prod",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axes",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool",notSupported:!0},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LeakyRelu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"alpha",name:"alpha",type:"number",defaultValue:.2},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"IsNan",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}]},X8DO:function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},XFvI:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n("v/P2"),i=n("DYVU"),o=n("BJf/");
  1378. /**
  1379. * @license
  1380. * Copyright 2021 Google LLC. All Rights Reserved.
  1381. * Licensed under the Apache License, Version 2.0 (the "License");
  1382. * you may not use this file except in compliance with the License.
  1383. * You may obtain a copy of the License at
  1384. *
  1385. * http://www.apache.org/licenses/LICENSE-2.0
  1386. *
  1387. * Unless required by applicable law or agreed to in writing, software
  1388. * distributed under the License is distributed on an "AS IS" BASIS,
  1389. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1390. * See the License for the specific language governing permissions and
  1391. * limitations under the License.
  1392. * =============================================================================
  1393. */
  1394. const s=n.n(o).a||o;function a(t){return s.fromString(t,!0,16)}const l=a("c3a5c85c97cb3127"),u=a("b492b66fbe98f273"),c=a("9ae16a3b2f90404f");function h(t){return t.xor(t.shru(47))}function d(t,e,n){const r=t.slice(e,e+n);return s.fromBytes(Array.from(r),!0,!0)}function p(t,e){return d(t,e,8)}function f(t,e){return d(t,e,4)}function g(t,e){return 0===e?t:t.shru(e).or(t.shl(64-e))}function m(t,e,n=a("9ddfea08eb382d69")){let r=t.xor(e).mul(n);r=r.xor(r.shru(47));let i=e.xor(r).mul(n);return i=(i=i.xor(i.shru(47))).mul(n)}function v(t,e,n,r){return function(t,e,n,r,i,o){i=i.add(t),o=g(o.add(i).add(r),21);const s=i;return i=(i=i.add(e)).add(n),o=o.add(g(i,44)),[i.add(r),o.add(s)]}(p(t,e),p(t,e+8),p(t,e+16),p(t,e+24),n,r)}function b(t,e=t.length){const n=s.fromNumber(81,!0);if(e<=32)return e<=16?function(t,e=t.length){if(e>=8){const n=c.add(2*e),r=p(t,0).add(c),i=p(t,e-8);return m(g(i,37).mul(n).add(r),g(r,25).add(i).mul(n),n)}if(e>=4){const n=c.add(2*e);return m(f(t,0).shl(3).add(e),f(t,e-4),n)}if(e>0){const n=t[0]+(t[e>>1]<<8),r=e+(t[e-1]<<2);return h(c.mul(n).xor(l.mul(r))).mul(c)}return c}(t,e):function(t,e=t.length){const n=c.add(2*e),r=p(t,0).mul(u),i=p(t,8),o=p(t,e-8).mul(n),s=p(t,e-16).mul(c);return m(g(r.add(i),43).add(g(o,30)).add(s),r.add(g(i.add(c),18)).add(o),n)}(t,e);if(e<=64)return function(t,e=t.length){const n=c.add(2*e),r=p(t,0).mul(c),i=p(t,8),o=p(t,e-8).mul(n),s=p(t,e-16).mul(c),a=g(r.add(i),43).add(g(o,30)).add(s),l=m(a,r.add(g(i.add(c),18)).add(o),n),u=p(t,16).mul(n),h=p(t,24),d=a.add(p(t,e-32)).mul(n),f=l.add(p(t,e-24)).mul(n);return m(g(u.add(h),43).add(g(d,30)).add(f),u.add(g(h.add(r),18)).add(d),n)}(t,e);let r=n,i=n.mul(u).add(113),o=h(i.mul(c).add(113)).mul(c),a=[s.UZERO,s.UZERO],d=[s.UZERO,s.UZERO];r=r.mul(c).add(p(t,0));let b=0;const _=64*(e-1>>6),y=_+(e-1&63)-63;do{r=g(r.add(i).add(a[0]).add(p(t,b+8)),37).mul(u),i=g(i.add(a[1]).add(p(t,b+48)),42).mul(u),r=r.xor(d[1]),i=i.add(a[0]).add(p(t,b+40)),o=g(o.add(d[0]),33).mul(u),a=v(t,b,a[1].mul(u),r.add(d[0])),d=v(t,b+32,o.add(d[1]),i.add(p(t,b+16))),[o,r]=[r,o],b+=64}while(b!==_);const T=u.add(o.and(255).shl(1));return b=y,d[0]=d[0].add(e-1&63),a[0]=a[0].add(d[0]),d[0]=d[0].add(a[0]),r=g(r.add(i).add(a[0]).add(p(t,b+8)),37).mul(T),i=g(i.add(a[1]).add(p(t,b+48)),42).mul(T),r=r.xor(d[1].mul(9)),i=i.add(a[0].mul(9).add(p(t,b+40))),o=g(o.add(d[0]),33).mul(T),a=v(t,b,a[1].mul(T),r.add(d[0])),d=v(t,b+32,o.add(d[1]),i.add(p(t,b+16))),[o,r]=[r,o],m(m(a[0],d[0],T).add(h(i).mul(l)).add(o),m(a[1],d[1],T).add(r),T)}function _(t,e){if("string"===e)throw new Error("Cannot convert a string[] to a TypedArray");if(Array.isArray(t)&&(t=i.m(t)),Object(r.b)().getBool("DEBUG")&&i.h(t,e),function(t,e){return t instanceof Float32Array&&"float32"===e||t instanceof Int32Array&&"int32"===e||t instanceof Uint8Array&&"bool"===e}(t,e))return t;if(null==e||"float32"===e||"complex64"===e)return new Float32Array(t);if("int32"===e)return new Int32Array(t);if("bool"===e){const e=new Uint8Array(t.length);for(let n=0;n<e.length;++n)0!==Math.round(t[n])&&(e[n]=1);return e}throw new Error(`Unknown data type ${e}`)}function y(t,e="utf-8"){return e=e||"utf-8",Object(r.b)().platform.encode(t,e)}e.createScalarValue=
  1395. /**
  1396. * @license
  1397. * Copyright 2017 Google LLC. All Rights Reserved.
  1398. * Licensed under the Apache License, Version 2.0 (the "License");
  1399. * you may not use this file except in compliance with the License.
  1400. * You may obtain a copy of the License at
  1401. *
  1402. * http://www.apache.org/licenses/LICENSE-2.0
  1403. *
  1404. * Unless required by applicable law or agreed to in writing, software
  1405. * distributed under the License is distributed on an "AS IS" BASIS,
  1406. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1407. * See the License for the specific language governing permissions and
  1408. * limitations under the License.
  1409. * =============================================================================
  1410. */
  1411. function(t,e){if("string"===e)return y(t);return _([t],e)},e.toTypedArray=_,e.now=function(){return Object(r.b)().platform.now()},e.fetch=function(t,e){return Object(r.b)().platform.fetch(t,e)},e.encodeString=y,e.decodeString=function(t,e="utf-8"){return e=e||"utf-8",Object(r.b)().platform.decode(t,e)},n.d(e,"shuffle",function(){return i.M}),n.d(e,"shuffleCombo",function(){return i.N}),n.d(e,"clamp",function(){return i.i}),n.d(e,"nearestLargerEven",function(){return i.H}),n.d(e,"swap",function(){return i.S}),n.d(e,"sum",function(){return i.R}),n.d(e,"randUniform",function(){return i.J}),n.d(e,"distSquared",function(){return i.l}),n.d(e,"assert",function(){return i.b}),n.d(e,"assertShapesMatch",function(){return i.e}),n.d(e,"assertNonNull",function(){return i.d}),n.d(e,"flatten",function(){return i.m}),n.d(e,"sizeFromShape",function(){return i.O}),n.d(e,"isScalarShape",function(){return i.y}),n.d(e,"arraysEqual",function(){return i.a}),n.d(e,"isInt",function(){return i.v}),n.d(e,"tanh",function(){return i.T}),n.d(e,"sizeToSquarishShape",function(){return i.P}),n.d(e,"createShuffledIndices",function(){return i.k}),n.d(e,"rightPad",function(){return i.L}),n.d(e,"repeatedTry",function(){return i.K}),n.d(e,"inferFromImplicitShape",function(){return i.s}),n.d(e,"parseAxisParam",function(){return i.I}),n.d(e,"squeezeShape",function(){return i.Q}),n.d(e,"getTypedArrayFromDType",function(){return i.o}),n.d(e,"getArrayFromDType",function(){return i.n}),n.d(e,"checkConversionForErrors",function(){return i.h}),n.d(e,"isValidDtype",function(){return i.B}),n.d(e,"hasEncodingLoss",function(){return i.p}),n.d(e,"isTypedArray",function(){return i.A}),n.d(e,"bytesPerElement",function(){return i.g}),n.d(e,"bytesFromStringArray",function(){return i.f}),n.d(e,"isString",function(){return i.z}),n.d(e,"isBoolean",function(){return i.t}),n.d(e,"isNumber",function(){return i.w}),n.d(e,"inferDtype",function(){return i.r}),n.d(e,"isFunction",function(){return i.u}),n.d(e,"nearestDivisor",function(){return i.G}),n.d(e,"computeStrides",function(){return i.j}),n.d(e,"toNestedArray",function(){return i.U}),n.d(e,"makeOnesTypedArray",function(){return i.D}),n.d(e,"makeZerosTypedArray",function(){return i.F}),n.d(e,"makeZerosNestedTypedArray",function(){return i.E}),n.d(e,"assertNonNegativeIntegerDimensions",function(){return i.c}),n.d(e,"locToIndex",function(){return i.C}),n.d(e,"indexToLoc",function(){return i.q}),n.d(e,"isPromise",function(){return i.x}),n.d(e,"hexToLong",function(){return a}),n.d(e,"fingerPrint64",function(){return b})},XFyj:function(t,e,n){"use strict";var r=n("/Oas"),i=n("JV7f");Object(i._127)().registerFlag("KEEP_INTERMEDIATE_TENSORS",()=>!1,t=>{t&&console.warn("Keep intermediate tensors is ON. This will print the values of all intermediate tensors during model inference. Not all models support this mode. For details, check e2e/benchmarks/ model_config.js. This significantly impacts performance.")});var o=n("qR1P"),s=n("zp+s");
  1412. /**
  1413. * @license
  1414. * Copyright 2019 Google LLC. All Rights Reserved.
  1415. * Licensed under the Apache License, Version 2.0 (the "License");
  1416. * you may not use this file except in compliance with the License.
  1417. * You may obtain a copy of the License at
  1418. *
  1419. * http://www.apache.org/licenses/LICENSE-2.0
  1420. *
  1421. * Unless required by applicable law or agreed to in writing, software
  1422. * distributed under the License is distributed on an "AS IS" BASIS,
  1423. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1424. * See the License for the specific language governing permissions and
  1425. * limitations under the License.
  1426. * =============================================================================
  1427. */
  1428. class a{constructor(t,e,n){this.node=t,this.tensorMap=e,this.context=n,this.inputs=[],this.attrs={},this.inputs=t.inputNames.map(t=>this.getInput(t)),null!=t.rawAttrs&&(this.attrs=Object.keys(t.rawAttrs).reduce((t,e)=>(t[e]=this.getAttr(e),t),{}))}getInput(t){return Object(s.e)(t,this.tensorMap,this.context)}getAttr(t,e){const n=this.node.rawAttrs[t];if(null!=n.tensor)return Object(s.e)(t,this.tensorMap,this.context);if(null!=n.i||null!=n.f)return Object(o.f)(this.node.rawAttrs,t,e);if(null!=n.s)return Object(o.i)(this.node.rawAttrs,t,e);if(null!=n.b)return Object(o.c)(this.node.rawAttrs,t,e);if(null!=n.shape)return Object(o.k)(this.node.rawAttrs,t,e);if(null!=n.type)return Object(o.e)(this.node.rawAttrs,t,e);if(null!=n.list){if(null!=n.list.i||null!=n.list.f)return Object(o.g)(this.node.rawAttrs,t,e);if(null!=n.list.s)return Object(o.h)(this.node.rawAttrs,t,e);if(null!=n.list.shape)return Object(o.j)(this.node.rawAttrs,t,e);if(null!=n.list.b)return Object(o.b)(this.node.rawAttrs,t,e);if(null!=n.list.type)return Object(o.d)(this.node.rawAttrs,t,e)}return e}}var l=n("SW71"),u=n("m3RX");
  1429. /**
  1430. * @license
  1431. * Copyright 2020 Google LLC. All Rights Reserved.
  1432. * Licensed under the Apache License, Version 2.0 (the "License");
  1433. * you may not use this file except in compliance with the License.
  1434. * You may obtain a copy of the License at
  1435. *
  1436. * http://www.apache.org/licenses/LICENSE-2.0
  1437. *
  1438. * Unless required by applicable law or agreed to in writing, software
  1439. * distributed under the License is distributed on an "AS IS" BASIS,
  1440. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1441. * See the License for the specific language governing permissions and
  1442. * limitations under the License.
  1443. * =============================================================================
  1444. */
  1445. /**
  1446. * @license
  1447. * Copyright 2018 Google LLC. All Rights Reserved.
  1448. * Licensed under the Apache License, Version 2.0 (the "License");
  1449. * you may not use this file except in compliance with the License.
  1450. * You may obtain a copy of the License at
  1451. *
  1452. * http://www.apache.org/licenses/LICENSE-2.0
  1453. *
  1454. * Unless required by applicable law or agreed to in writing, software
  1455. * distributed under the License is distributed on an "AS IS" BASIS,
  1456. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1457. * See the License for the specific language governing permissions and
  1458. * limitations under the License.
  1459. * =============================================================================
  1460. */
  1461. const c=(t,e,n)=>{switch(t.op){case"BiasAdd":case"AddV2":case"Add":return[u.d(Object(s.d)("a",t,e,n),Object(s.d)("b",t,e,n))];case"AddN":return[u.e(Object(s.d)("tensors",t,e,n))];case"FloorMod":case"Mod":return[u._31(Object(s.d)("a",t,e,n),Object(s.d)("b",t,e,n))];case"Mul":return[u._32(Object(s.d)("a",t,e,n),Object(s.d)("b",t,e,n))];case"RealDiv":case"Div":return[u.N(Object(s.d)("a",t,e,n),Object(s.d)("b",t,e,n))];case"DivNoNan":return[u.O(Object(s.d)("a",t,e,n),Object(s.d)("b",t,e,n))];case"FloorDiv":return[u.Z(Object(s.d)("a",t,e,n),Object(s.d)("b",t,e,n))];case"Sub":return[u._76(Object(s.d)("a",t,e,n),Object(s.d)("b",t,e,n))];case"Minimum":return[u._29(Object(s.d)("a",t,e,n),Object(s.d)("b",t,e,n))];case"Maximum":return[u._26(Object(s.d)("a",t,e,n),Object(s.d)("b",t,e,n))];case"Pow":return[u._40(Object(s.d)("a",t,e,n),Object(s.d)("b",t,e,n))];case"SquaredDifference":return[u._71(Object(s.d)("a",t,e,n),Object(s.d)("b",t,e,n))];default:throw TypeError(`Node type ${t.op} is not implemented`)}},h=(t,e,n)=>{switch(t.op){case"Abs":case"ComplexAbs":return[u.a(Object(s.d)("x",t,e,n))];case"Acos":return[u.b(Object(s.d)("x",t,e,n))];case"Acosh":return[u.c(Object(s.d)("x",t,e,n))];case"Asin":return[u.j(Object(s.d)("x",t,e,n))];case"Asinh":return[u.k(Object(s.d)("x",t,e,n))];case"Atan":return[u.l(Object(s.d)("x",t,e,n))];case"Atan2":return[u.m(Object(s.d)("x",t,e,n),Object(s.d)("y",t,e,n))];case"Atanh":return[u.n(Object(s.d)("x",t,e,n))];case"Ceil":return[u.x(Object(s.d)("x",t,e,n))];case"Complex":return[u.A(Object(s.d)("real",t,e,n),Object(s.d)("imag",t,e,n))];case"Cos":return[u.G(Object(s.d)("x",t,e,n))];case"Cosh":return[u.H(Object(s.d)("x",t,e,n))];case"Elu":return[u.Q(Object(s.d)("x",t,e,n))];case"Erf":return[u.S(Object(s.d)("x",t,e,n))];case"Exp":return[u.T(Object(s.d)("x",t,e,n))];case"Expm1":return[u.V(Object(s.d)("x",t,e,n))];case"Floor":return[u.Y(Object(s.d)("x",t,e,n))];case"Log":return[u._15(Object(s.d)("x",t,e,n))];case"Log1p":return[u._16(Object(s.d)("x",t,e,n))];case"Imag":return[u._6(Object(s.d)("x",t,e,n))];case"Neg":return[u._34(Object(s.d)("x",t,e,n))];case"Reciprocal":return[u._46(Object(s.d)("x",t,e,n))];case"Real":return[u._45(Object(s.d)("x",t,e,n))];case"Relu":return[u._47(Object(s.d)("x",t,e,n))];case"Round":return[u._52(Object(s.d)("x",t,e,n))];case"Selu":return[u._56(Object(s.d)("x",t,e,n))];case"Sigmoid":return[u._58(Object(s.d)("x",t,e,n))];case"Sin":return[u._60(Object(s.d)("x",t,e,n))];case"Sign":return[u._59(Object(s.d)("x",t,e,n))];case"Sinh":return[u._61(Object(s.d)("x",t,e,n))];case"Softplus":return[u._64(Object(s.d)("x",t,e,n))];case"Sqrt":return[u._69(Object(s.d)("x",t,e,n))];case"Square":return[u._70(Object(s.d)("x",t,e,n))];case"Tanh":return[u._79(Object(s.d)("x",t,e,n))];case"Tan":return[u._78(Object(s.d)("x",t,e,n))];case"ClipByValue":return[u.y(Object(s.d)("x",t,e,n),Object(s.d)("clipValueMin",t,e,n),Object(s.d)("clipValueMax",t,e,n))];case"Relu6":return[u._48(Object(s.d)("x",t,e,n))];case"Rsqrt":return[u._53(Object(s.e)(t.inputNames[0],e,n))];case"Prod":return[u._42(Object(s.d)("x",t,e,n),Object(s.d)("axes",t,e,n))];case"LeakyRelu":return[u._10(Object(s.d)("x",t,e,n),Object(s.d)("alpha",t,e,n))];case"Prelu":return[u._41(Object(s.d)("x",t,e,n),Object(s.d)("alpha",t,e,n))];case"IsNan":return[u._9(Object(s.e)(t.inputNames[0],e,n))];default:throw TypeError(`Node type ${t.op} is not implemented`)}};
  1462. /**
  1463. * @license
  1464. * Copyright 2020 Google LLC. All Rights Reserved.
  1465. * Licensed under the Apache License, Version 2.0 (the "License");
  1466. * you may not use this file except in compliance with the License.
  1467. * You may obtain a copy of the License at
  1468. *
  1469. * http://www.apache.org/licenses/LICENSE-2.0
  1470. *
  1471. * Unless required by applicable law or agreed to in writing, software
  1472. * distributed under the License is distributed on an "AS IS" BASIS,
  1473. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1474. * See the License for the specific language governing permissions and
  1475. * limitations under the License.
  1476. * =============================================================================
  1477. */
  1478. function d(t,e,n=""){if("number"!=typeof t&&"number"!=typeof e){i._152.assert(t.length===e.length,()=>n+` Shapes ${t} and ${e} must match`);for(let r=0;r<t.length;r++){const o=t[r],s=e[r];i._152.assert(o<0||s<0||o===s,()=>n+` Shapes ${t} and ${e} must match`)}}}function p(t){return"number"!=typeof t&&!t.some(t=>t<0)}function f(t,e,n){let r=g(t,n);const i=!p(r);if(i&&0===e.length)throw new Error("Tried to calculate elements of an empty list"+` with non-fully-defined elementShape: ${r}`);if(i&&e.forEach(t=>{r=g(t.shape,r)}),!p(r))throw new Error(`Non-fully-defined elementShape: ${r}`);return r}function g(t,e){if("number"==typeof t)return e;if("number"==typeof e)return t;if(t.length!==e.length)throw new Error(`Incompatible ranks during merge: ${t} vs. ${e}`);const n=[];for(let r=0;r<t.length;++r){const i=t[r],o=e[r];if(i>=0&&o>=0&&i!==o)throw new Error(`Incompatible shape during merge: ${t} vs. ${e}`);n[r]=i>=0?i:o}return n}
  1479. /**
  1480. * @license
  1481. * Copyright 2018 Google LLC. All Rights Reserved.
  1482. * Licensed under the Apache License, Version 2.0 (the "License");
  1483. * you may not use this file except in compliance with the License.
  1484. * You may obtain a copy of the License at
  1485. *
  1486. * http://www.apache.org/licenses/LICENSE-2.0
  1487. *
  1488. * Unless required by applicable law or agreed to in writing, software
  1489. * distributed under the License is distributed on an "AS IS" BASIS,
  1490. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1491. * See the License for the specific language governing permissions and
  1492. * limitations under the License.
  1493. * =============================================================================
  1494. */
  1495. /**
  1496. * @license
  1497. * Copyright 2020 Google LLC. All Rights Reserved.
  1498. * Licensed under the Apache License, Version 2.0 (the "License");
  1499. * you may not use this file except in compliance with the License.
  1500. * You may obtain a copy of the License at
  1501. *
  1502. * http://www.apache.org/licenses/LICENSE-2.0
  1503. *
  1504. * Unless required by applicable law or agreed to in writing, software
  1505. * distributed under the License is distributed on an "AS IS" BASIS,
  1506. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1507. * See the License for the specific language governing permissions and
  1508. * limitations under the License.
  1509. * =============================================================================
  1510. */
  1511. class m{constructor(t,e,n,r=-1){this.tensors=t,this.elementShape=e,this.elementDtype=n,null!=t&&t.forEach(t=>{if(n!==t.dtype)throw new Error(`Invalid data types; op elements ${n}, but list elements ${t.dtype}`);d(e,t.shape,"TensorList shape mismatch: "),Object(i._132)(t)}),this.idTensor=Object(i._138)(0),this.maxNumElements=r,Object(i._132)(this.idTensor)}get id(){return this.idTensor.id}copy(){return new m([...this.tensors],this.elementShape,this.elementDtype)}clearAndClose(t){this.tensors.forEach(e=>{null!=t&&t.has(e.id)||e.dispose()}),this.tensors.length=0,this.idTensor.dispose()}size(){return this.tensors.length}stack(t,e,n=-1){if(e!==this.elementDtype)throw new Error(`Invalid data types; op elements ${e}, but list elements ${this.elementDtype}`);if(-1!==n&&this.tensors.length!==n)throw new Error(`Operation expected a list with ${n} elements but got a list with ${this.tensors.length} elements.`);d(t,this.elementShape,"TensorList shape mismatch: ");const r=f(this.elementShape,this.tensors,t);return Object(i._149)(()=>{const t=this.tensors.map(t=>Object(i._137)(t,r));return Object(i._143)(t,0)})}popBack(t,e){if(e!==this.elementDtype)throw new Error(`Invalid data types; op elements ${e}, but list elements ${this.elementDtype}`);if(0===this.size())throw new Error("Trying to pop from an empty list.");const n=f(this.elementShape,this.tensors,t),r=this.tensors.pop();return d(r.shape,t,"TensorList shape mismatch: "),Object(i._137)(r,n)}pushBack(t){if(t.dtype!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t.dtype}, but list elements ${this.elementDtype}`);if(d(t.shape,this.elementShape,"TensorList shape mismatch: "),this.maxNumElements===this.size())throw new Error("Trying to push element into a full list.");Object(i._132)(t),this.tensors.push(t)}resize(t){if(t<0)throw new Error(`TensorListResize expects size to be non-negative. Got: ${t}`);if(-1!==this.maxNumElements&&t>this.maxNumElements)throw new Error(`TensorListResize input size ${t} is greater maxNumElement ${this.maxNumElements}.`);this.tensors.length=t}getItem(t,e,n){if(n!==this.elementDtype)throw new Error(`Invalid data types; op elements ${n}, but list elements ${this.elementDtype}`);if(t<0||t>this.tensors.length)throw new Error(`Trying to access element ${t} in a list with ${this.tensors.length} elements.`);if(null==this.tensors[t])throw new Error(`element at index ${t} is null.`);d(this.tensors[t].shape,e,"TensorList shape mismatch: ");const r=f(this.elementShape,this.tensors,e);return Object(i._137)(this.tensors[t],r)}setItem(t,e){if(e.dtype!==this.elementDtype)throw new Error(`Invalid data types; op elements ${e.dtype}, but list elements ${this.elementDtype}`);if(t<0||-1!==this.maxNumElements&&t>=this.maxNumElements)throw new Error(`Trying to set element ${t} in a list with max ${this.maxNumElements} elements.`);d(this.elementShape,e.shape,"TensorList shape mismatch: "),Object(i._132)(e),this.tensors[t]=e}gather(t,e,n){if(e!==this.elementDtype)throw new Error(`Invalid data types; op elements ${e}, but list elements ${this.elementDtype}`);d(this.elementShape,n,"TensorList shape mismatch: "),t=t.slice(0,this.size());const r=f(this.elementShape,this.tensors,n);return 0===t.length?Object(i._146)([],[0].concat(r)):Object(i._149)(()=>{const e=t.map(t=>Object(i._137)(this.tensors[t],r));return Object(i._143)(e,0)})}concat(t,e){if(t&&t!==this.elementDtype)throw new Error(`TensorList dtype is ${this.elementDtype} but concat requested dtype ${t}`);d(this.elementShape,e,"TensorList shape mismatch: ");const n=f(this.elementShape,this.tensors,e);return 0===this.size()?Object(i._146)([],[0].concat(n)):Object(i._149)(()=>{const t=this.tensors.map(t=>Object(i._137)(t,n));return Object(i._122)(t,0)})}}
  1512. /**
  1513. * @license
  1514. * Copyright 2018 Google LLC. All Rights Reserved.
  1515. * Licensed under the Apache License, Version 2.0 (the "License");
  1516. * you may not use this file except in compliance with the License.
  1517. * You may obtain a copy of the License at
  1518. *
  1519. * http://www.apache.org/licenses/LICENSE-2.0
  1520. *
  1521. * Unless required by applicable law or agreed to in writing, software
  1522. * distributed under the License is distributed on an "AS IS" BASIS,
  1523. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1524. * See the License for the specific language governing permissions and
  1525. * limitations under the License.
  1526. * =============================================================================
  1527. */
  1528. const v=async(t,e,n)=>{switch(t.op){case"If":case"StatelessIf":{const r=Object(s.d)("thenBranch",t,e,n),i=Object(s.d)("elseBranch",t,e,n),o=Object(s.d)("cond",t,e,n),a=Object(s.d)("args",t,e,n);return(await o.data())[0]?n.functionMap[r].executeFunctionAsync(a,n.tensorArrayMap,n.tensorListMap):n.functionMap[i].executeFunctionAsync(a,n.tensorArrayMap,n.tensorListMap)}case"While":case"StatelessWhile":{const r=Object(s.d)("body",t,e,n),i=Object(s.d)("cond",t,e,n),o=Object(s.d)("args",t,e,n),a=await n.functionMap[i].executeFunctionAsync(o,n.tensorArrayMap,n.tensorListMap),l=o.map(t=>t.id);let u=await a[0].data();a.forEach(t=>{t.kept||-1!==l.indexOf(t.id)||t.dispose()});let c=o;for(;u[0];){const t=c,e=(c=await n.functionMap[r].executeFunctionAsync(c,n.tensorArrayMap,n.tensorListMap)).map(t=>t.id);t.forEach(t=>{t.kept||-1!==l.indexOf(t.id)||-1!==e.indexOf(t.id)||t.dispose()});const o=await n.functionMap[i].executeFunctionAsync(c,n.tensorArrayMap,n.tensorListMap);u=await o[0].data(),o.forEach(t=>{t.kept||-1!==l.indexOf(t.id)||-1!==e.indexOf(t.id)||t.dispose()})}return c}case"LoopCond":{const r=Object(s.d)("pred",t,e,n);return[Object(s.a)(r)]}case"Switch":{const r=Object(s.d)("pred",t,e,n);let i=Object(s.d)("data",t,e,n);return i.kept||(i=Object(s.a)(i)),(await r.data())[0]?[void 0,i]:[i,void 0]}case"Merge":{const r=t.inputNames.find(t=>void 0!==Object(s.e)(t,e,n));if(r){const t=Object(s.e)(r,e,n);return[Object(s.a)(t)]}return}case"Enter":{const r=Object(s.d)("frameName",t,e,n),i=Object(s.d)("tensor",t,e,n);return n.enterFrame(r),[Object(s.a)(i)]}case"Exit":{const r=Object(s.d)("tensor",t,e,n);return n.exitFrame(),[Object(s.a)(r)]}case"NextIteration":{const r=Object(s.d)("tensor",t,e,n);return n.nextIteration(),[Object(s.a)(r)]}case"TensorArrayV3":{const r=Object(s.d)("size",t,e,n),o=Object(s.d)("dtype",t,e,n),a=Object(s.d)("elementShape",t,e,n),l=Object(s.d)("dynamicSize",t,e,n),u=Object(s.d)("clearAfterRead",t,e,n),c=Object(s.d)("identicalElementShapes",t,e,n),h=new class{constructor(t,e,n,r,o,s,a){this.name=t,this.dtype=e,this.maxSize=n,this.elementShape=r,this.identicalElementShapes=o,this.dynamicSize=s,this.clearAfterRead=a,this.tensors=[],this.closed_=!1,this.idTensor=Object(i._138)(0),Object(i._132)(this.idTensor)}get id(){return this.idTensor.id}get closed(){return this.closed_}clearAndClose(t){this.tensors.forEach(e=>{null!=t&&t.has(e.tensor.id)||e.tensor.dispose()}),this.tensors=[],this.closed_=!0,this.idTensor.dispose()}size(){return this.tensors.length}read(t){if(this.closed_)throw new Error(`TensorArray ${this.name} has already been closed.`);if(t<0||t>=this.size())throw new Error(`Tried to read from index ${t}, but array size is: ${this.size()}`);const e=this.tensors[t];if(e.cleared)throw new Error(`TensorArray ${this.name}: Could not read index ${t} twice because it was cleared after a previous read `+"(perhaps try setting clear_after_read = false?).");return this.clearAfterRead&&(e.cleared=!0),e.read=!0,e.tensor}readMany(t){return t.map(t=>this.read(t))}write(t,e){if(this.closed_)throw new Error(`TensorArray ${this.name} has already been closed.`);if(t<0||!this.dynamicSize&&t>=this.maxSize)throw new Error(`Tried to write to index ${t}, but array is not resizeable and size is: ${this.maxSize}`);const n=this.tensors[t]||{};if(e.dtype!==this.dtype)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${t},\n because the value dtype is ${e.dtype}, but TensorArray dtype is ${this.dtype}.`);if(0!==this.size()||null!=this.elementShape&&0!==this.elementShape.length||(this.elementShape=e.shape),d(this.elementShape,e.shape,`TensorArray ${this.name}: Could not write to TensorArray index ${t}.`),n.read)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${t}, because it has already been read.`);if(n.written)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${t}, because it has already been written.`);n.tensor=e,Object(i._132)(e),n.written=!0,this.tensors[t]=n}writeMany(t,e){if(t.length!==e.length)throw new Error(`TensorArray ${this.name}: could not write multiple tensors,`+`because the index size: ${t.length} is not the same as tensors size: ${e.length}.`);t.forEach((t,n)=>this.write(t,e[n]))}gather(t,e){if(e&&e!==this.dtype)throw new Error(`TensorArray dtype is ${this.dtype} but gather requested dtype ${e}`);if(t)t=t.slice(0,this.size());else{t=[];for(let e=0;e<this.size();e++)t.push(e)}if(0===t.length)return Object(i._146)([],[0].concat(this.elementShape));const n=this.readMany(t);return d(this.elementShape,n[0].shape,"TensorArray shape mismatch: "),Object(i._143)(n,0)}concat(t){if(t&&t!==this.dtype)throw new Error(`TensorArray dtype is ${this.dtype} but concat requested dtype ${t}`);if(0===this.size())return Object(i._146)([],[0].concat(this.elementShape));const e=[];for(let t=0;t<this.size();t++)e.push(t);const n=this.readMany(e);return d(this.elementShape,n[0].shape,`TensorArray shape mismatch: tensor array shape (${this.elementShape}) vs first tensor shape (${n[0].shape})`),Object(i._122)(n,0)}scatter(t,e){if(e.dtype!==this.dtype)throw new Error(`TensorArray dtype is ${this.dtype} but tensor has dtype ${e.dtype}`);if(t.length!==e.shape[0])throw new Error(`Expected len(indices) == tensor.shape[0], but saw: ${t.length} vs. ${e.shape[0]}`);const n=Math.max(...t);if(!this.dynamicSize&&n>=this.maxSize)throw new Error(`Max index must be < array size (${n} vs. ${this.maxSize})`);this.writeMany(t,Object(i._150)(e,0))}split(t,e){if(e.dtype!==this.dtype)throw new Error(`TensorArray dtype is ${this.dtype} but tensor has dtype ${e.dtype}`);let n=0;const r=t.map(t=>n+=t);if(n!==e.shape[0])throw new Error(`Expected sum of lengths to be equal to\n tensor.shape[0], but sum of lengths is\n ${n}, and tensor's shape is: ${e.shape}`);if(!this.dynamicSize&&t.length!==this.maxSize)throw new Error(`TensorArray's size is not equal to the size of lengths (${this.maxSize} vs. ${t.length}), `+"and the TensorArray is not marked as dynamically resizeable");const o=0===n?0:e.size/n,s=[];Object(i._149)(()=>{e=Object(i._137)(e,[1,n,o]);for(let n=0;n<t.length;++n){const a=[0,0===n?0:r[n-1],0],l=[1,t[n],o];s[n]=Object(i._137)(Object(i._140)(e,a,l),this.elementShape)}return s});const a=[];for(let e=0;e<t.length;e++)a[e]=e;this.writeMany(a,s)}}(Object(s.d)("name",t,e,n),o,r,a,c,l,u);return n.addTensorArray(h),[h.idTensor,Object(i._138)(1)]}case"TensorArrayWriteV3":{const r=Object(s.d)("tensorArrayId",t,e,n),i=Object(s.d)("index",t,e,n),o=Object(s.d)("tensor",t,e,n),a=n.getTensorArray(r.id);return a.write(i,o),[a.idTensor]}case"TensorArrayReadV3":{const r=Object(s.d)("tensorArrayId",t,e,n),i=Object(s.d)("index",t,e,n);return[n.getTensorArray(r.id).read(i)]}case"TensorArrayGatherV3":{const r=Object(s.d)("tensorArrayId",t,e,n),i=Object(s.d)("indices",t,e,n),o=Object(s.d)("dtype",t,e,n);return[n.getTensorArray(r.id).gather(i,o)]}case"TensorArrayScatterV3":{const r=Object(s.d)("tensorArrayId",t,e,n),i=Object(s.d)("indices",t,e,n),o=Object(s.d)("tensor",t,e,n),a=n.getTensorArray(r.id);return a.scatter(i,o),[a.idTensor]}case"TensorArrayConcatV3":{const r=Object(s.d)("tensorArrayId",t,e,n),i=n.getTensorArray(r.id),o=Object(s.d)("dtype",t,e,n);return[i.concat(o)]}case"TensorArraySplitV3":{const r=Object(s.d)("tensorArrayId",t,e,n),i=Object(s.d)("tensor",t,e,n),o=Object(s.d)("lengths",t,e,n),a=n.getTensorArray(r.id);return a.split(o,i),[a.idTensor]}case"TensorArraySizeV3":{const r=Object(s.d)("tensorArrayId",t,e,n),o=n.getTensorArray(r.id);return[Object(i._138)(o.size(),"int32")]}case"TensorArrayCloseV3":{const r=Object(s.d)("tensorArrayId",t,e,n),i=n.getTensorArray(r.id);return i.clearAndClose(),[i.idTensor]}case"TensorListSetItem":{const r=Object(s.d)("tensorListId",t,e,n),i=Object(s.d)("index",t,e,n),o=Object(s.d)("tensor",t,e,n),a=n.getTensorList(r.id);return a.setItem(i,o),[a.idTensor]}case"TensorListGetItem":{const r=Object(s.d)("tensorListId",t,e,n),i=Object(s.d)("index",t,e,n),o=Object(s.d)("elementShape",t,e,n),a=Object(s.d)("elementDType",t,e,n);return[n.getTensorList(r.id).getItem(i,o,a)]}case"TensorListScatterV2":case"TensorListScatter":{const r=Object(s.d)("indices",t,e,n),o=function(t,e,n,r){if(e.length!==t.shape[0])throw new Error(`Expected len(indices) == tensor.shape[0], but saw: ${e.length} vs. ${t.shape[0]}`);const o=Math.max(...e);if(null!=r&&-1!==r&&o>=r)throw new Error(`Max index must be < array size (${o} vs. ${r})`);const s=new m([],n,t.dtype,r),a=Object(i._150)(t,0);return e.forEach((t,e)=>{s.setItem(t,a[e])}),s}(Object(s.d)("tensor",t,e,n),r,Object(s.d)("elementShape",t,e,n),Object(s.d)("numElements",t,e,n));return n.addTensorList(o),[o.idTensor]}case"TensorListReserve":case"EmptyTensorList":{const r=Object(s.d)("elementShape",t,e,n),i=Object(s.d)("elementDType",t,e,n);let o;o="TensorListReserve"===t.op?"numElements":"maxNumElements";const a=Object(s.d)(o,t,e,n),l=new m([],r,i,a);return n.addTensorList(l),[l.idTensor]}case"TensorListGather":{const r=Object(s.d)("tensorListId",t,e,n),i=Object(s.d)("indices",t,e,n),o=Object(s.d)("elementShape",t,e,n),a=Object(s.d)("elementDType",t,e,n);return[n.getTensorList(r.id).gather(i,a,o)]}case"TensorListStack":{const r=Object(s.d)("tensorListId",t,e,n),i=Object(s.d)("elementShape",t,e,n),o=Object(s.d)("elementDType",t,e,n),a=Object(s.d)("numElements",t,e,n);return[n.getTensorList(r.id).stack(i,o,a)]}case"TensorListFromTensor":{const r=function(t,e,n){const r=t.dtype;if(t.shape.length<1)throw new Error(`Tensor must be at least a vector, but saw shape: ${t.shape}`);if(t.dtype!==n)throw new Error(`Invalid data types; op elements ${t.dtype}, but list elements ${n}`);d(t.shape.slice(1),e,"TensorList shape mismatch: ");const o=Object(i._150)(t);return new m(o,e,r)}(Object(s.d)("tensor",t,e,n),Object(s.d)("elementShape",t,e,n),Object(s.d)("elementDType",t,e,n));return n.addTensorList(r),[r.idTensor]}case"TensorListConcat":{const r=Object(s.d)("tensorListId",t,e,n),i=n.getTensorList(r.id),o=Object(s.d)("dtype",t,e,n),a=Object(s.d)("elementShape",t,e,n);return[i.concat(o,a)]}case"TensorListPushBack":{const r=Object(s.d)("tensorListId",t,e,n),i=Object(s.d)("tensor",t,e,n),o=n.getTensorList(r.id);return o.pushBack(i),[o.idTensor]}case"TensorListPopBack":{const r=Object(s.d)("tensorListId",t,e,n),i=Object(s.d)("elementShape",t,e,n),o=Object(s.d)("elementDType",t,e,n);return[n.getTensorList(r.id).popBack(i,o)]}case"TensorListSplit":{const r=Object(s.d)("tensor",t,e,n),o=Object(s.d)("elementShape",t,e,n),a=function(t,e,n){let r=0;const o=e.map(t=>r+=t);if(r!==t.shape[0])throw new Error(`Expected sum of lengths to be equal to\n tensor.shape[0], but sum of lengths is\n ${r}, and tensor's shape is: ${t.shape}`);const s=g(t.shape.slice(1),n),a=0===r?0:t.size/r,l=Object(i._149)(()=>{const n=[];t=Object(i._137)(t,[1,r,a]);for(let r=0;r<e.length;++r){const l=[0,0===r?0:o[r-1],0],u=[1,e[r],a];n[r]=Object(i._137)(Object(i._140)(t,l,u),s)}return t.dispose(),n}),u=new m([],n,t.dtype,e.length);for(let t=0;t<l.length;t++)u.setItem(t,l[t]);return u}(r,Object(s.d)("lengths",t,e,n),o);return n.addTensorList(a),[a.idTensor]}default:throw TypeError(`Node type ${t.op} is not implemented`)}};
  1529. /**
  1530. * @license
  1531. * Copyright 2018 Google LLC. All Rights Reserved.
  1532. * Licensed under the Apache License, Version 2.0 (the "License");
  1533. * you may not use this file except in compliance with the License.
  1534. * You may obtain a copy of the License at
  1535. *
  1536. * http://www.apache.org/licenses/LICENSE-2.0
  1537. *
  1538. * Unless required by applicable law or agreed to in writing, software
  1539. * distributed under the License is distributed on an "AS IS" BASIS,
  1540. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1541. * See the License for the specific language governing permissions and
  1542. * limitations under the License.
  1543. * =============================================================================
  1544. */
  1545. function b(t,e,n){const[r,i]=Object(s.d)("fusedOps",t,e,n),o="biasadd"===r,a=!o,l="prelu"===i,u="fusedbatchnorm"===r,c=Object(s.d)("numArgs",t,e,n);if(o){if(l&&2!==c)throw new Error("FusedConv2d and DepthwiseConv2d with BiasAdd and Prelu must have two extra arguments: bias and alpha.");if(!l&&o&&1!==c)throw new Error("FusedConv2d and DepthwiseConv2d with BiasAdd must have one extra argument: bias.")}if(u)throw new Error("FusedConv2d and DepthwiseConv2d with FusedBatchNorm is not supported");const h=Object(s.d)("strides",t,e,n),d=Object(s.c)(t,e,n),p=Object(s.d)("dataFormat",t,e,n).toUpperCase(),f=Object(s.d)("dilations",t,e,n);let[g,m]=Object(s.d)("args",t,e,n);return a&&(m=g,g=void 0),{stride:h,pad:d,dataFormat:p,dilations:f,biasArg:g,preluArg:m,activationFunc:i,leakyreluAlpha:Object(s.d)("leakyreluAlpha",t,e,n)}}const _=(t,e,n)=>{switch(t.op){case"Conv1D":{const r=Object(s.d)("stride",t,e,n),i=Object(s.d)("pad",t,e,n),o=Object(s.d)("dataFormat",t,e,n).toUpperCase(),a=Object(s.d)("dilation",t,e,n);return[u.C(Object(s.d)("x",t,e,n),Object(s.d)("filter",t,e,n),r,i,o,a)]}case"Conv2D":{const r=Object(s.d)("strides",t,e,n),i=Object(s.c)(t,e,n),o=Object(s.d)("dataFormat",t,e,n).toUpperCase(),a=Object(s.d)("dilations",t,e,n);return[u.D(Object(s.d)("x",t,e,n),Object(s.d)("filter",t,e,n),[r[1],r[2]],i,o,[a[1],a[2]])]}case"_FusedConv2D":{const{stride:r,pad:i,dataFormat:o,dilations:a,biasArg:l,preluArg:c,activationFunc:h,leakyreluAlpha:d}=b(t,e,n);return[u._0.conv2d({x:Object(s.d)("x",t,e,n),filter:Object(s.d)("filter",t,e,n),strides:[r[1],r[2]],pad:i,dataFormat:o,dilations:[a[1],a[2]],bias:l,activation:h,preluActivationWeights:c,leakyreluAlpha:d})]}case"FusedDepthwiseConv2dNative":{const{stride:r,pad:i,dataFormat:o,dilations:a,biasArg:l,preluArg:c,activationFunc:h,leakyreluAlpha:d}=b(t,e,n);return[u._0.depthwiseConv2d({x:Object(s.d)("x",t,e,n),filter:Object(s.d)("filter",t,e,n),strides:[r[1],r[2]],pad:i,dataFormat:o,dilations:[a[1],a[2]],bias:l,activation:h,preluActivationWeights:c,leakyreluAlpha:d})]}case"Conv2DBackpropInput":case"Conv2dTranspose":{const r=Object(s.d)("outputShape",t,e,n),i=Object(s.d)("strides",t,e,n),o=Object(s.c)(t,e,n);return[u.E(Object(s.d)("x",t,e,n),Object(s.d)("filter",t,e,n),r,[i[1],i[2]],o)]}case"DepthwiseConv2dNative":case"DepthwiseConv2d":{const r=Object(s.d)("strides",t,e,n),i=Object(s.c)(t,e,n),o=Object(s.d)("dilations",t,e,n),a=Object(s.d)("dataFormat",t,e,n).toUpperCase();return[u.L(Object(s.d)("input",t,e,n),Object(s.d)("filter",t,e,n),[r[1],r[2]],i,a,[o[1],o[2]])]}case"Conv3D":{const r=Object(s.d)("strides",t,e,n),i=Object(s.d)("pad",t,e,n),o=Object(s.d)("dataFormat",t,e,n).toUpperCase(),a=Object(s.d)("dilations",t,e,n);return[u.F(Object(s.d)("x",t,e,n),Object(s.d)("filter",t,e,n),[r[1],r[2],r[3]],i,o,[a[1],a[2],a[3]])]}case"AvgPool":{const r=Object(s.d)("strides",t,e,n),i=Object(s.d)("pad",t,e,n),o=Object(s.d)("kernelSize",t,e,n);return[u.o(Object(s.d)("x",t,e,n),[o[1],o[2]],[r[1],r[2]],i)]}case"MaxPool":{const r=Object(s.d)("strides",t,e,n),i=Object(s.d)("pad",t,e,n),o=Object(s.d)("kernelSize",t,e,n);return[u._23(Object(s.d)("x",t,e,n),[o[1],o[2]],[r[1],r[2]],i)]}case"MaxPoolWithArgmax":{const r=Object(s.d)("strides",t,e,n),i=Object(s.d)("pad",t,e,n),o=Object(s.d)("kernelSize",t,e,n),a=Object(s.d)("includeBatchInIndex",t,e,n),{result:l,indexes:c}=u._25(Object(s.d)("x",t,e,n),[o[1],o[2]],[r[1],r[2]],i,a);return[l,c]}case"AvgPool3D":{const r=Object(s.d)("strides",t,e,n),i=Object(s.d)("pad",t,e,n),o=Object(s.d)("kernelSize",t,e,n);return[u.p(Object(s.d)("x",t,e,n),[o[1],o[2],o[3]],[r[1],r[2],r[3]],i)]}case"MaxPool3D":{const r=Object(s.d)("strides",t,e,n),i=Object(s.d)("pad",t,e,n),o=Object(s.d)("kernelSize",t,e,n);return[u._24(Object(s.d)("x",t,e,n),[o[1],o[2],o[3]],[r[1],r[2],r[3]],i)]}case"Dilation2D":{const r=Object(s.d)("strides",t,e,n),i=Object(s.d)("pad",t,e,n),o=Object(s.d)("dilations",t,e,n),a=r[1],l=r[2],c=o[1],h=o[2];return[u.M(Object(s.d)("x",t,e,n),Object(s.d)("filter",t,e,n),[a,l],i,[c,h],"NHWC")]}default:throw TypeError(`Node type ${t.op} is not implemented`)}},y=(t,e,n)=>{switch(t.op){case"Fill":{const r=Object(s.d)("shape",t,e,n),i=Object(s.d)("dtype",t,e,n),o=Object(s.d)("value",t,e,n);return[u.X(r,o,i)]}case"LinSpace":{const r=Object(s.d)("start",t,e,n),i=Object(s.d)("stop",t,e,n),o=Object(s.d)("num",t,e,n);return[u._13(r,i,o)]}case"Multinomial":{const r=Object(s.d)("logits",t,e,n),i=Object(s.d)("numSamples",t,e,n),o=Object(s.d)("seed",t,e,n);return[u._33(r,i,o)]}case"OneHot":{const r=Object(s.d)("indices",t,e,n),i=Object(s.d)("depth",t,e,n),o=Object(s.d)("onValue",t,e,n),a=Object(s.d)("offValue",t,e,n);return[u._36(r,i,o,a)]}case"Ones":return[u._37(Object(s.d)("shape",t,e,n),Object(s.d)("dtype",t,e,n))];case"OnesLike":return[u._38(Object(s.d)("x",t,e,n))];case"RandomUniform":return[u._43(Object(s.d)("shape",t,e,n),Object(s.d)("minval",t,e,n),Object(s.d)("maxval",t,e,n),Object(s.d)("dtype",t,e,n))];case"Range":{const r=Object(s.d)("start",t,e,n),i=Object(s.d)("stop",t,e,n),o=Object(s.d)("step",t,e,n);return[u._44(r,i,o,Object(s.d)("dtype",t,e,n))]}case"TruncatedNormal":{const r=Object(s.d)("shape",t,e,n),i=Object(s.d)("mean",t,e,n),o=Object(s.d)("stdDev",t,e,n),a=Object(s.d)("seed",t,e,n);return[u._86(r,i,o,Object(s.d)("dtype",t,e,n),a)]}case"Zeros":return[u._91(Object(s.d)("shape",t,e,n),Object(s.d)("dtype",t,e,n))];case"ZerosLike":return[u._92(Object(s.d)("x",t,e,n))];default:throw TypeError(`Node type ${t.op} is not implemented`)}};
  1546. /**
  1547. * @license
  1548. * Copyright 2018 Google LLC. All Rights Reserved.
  1549. * Licensed under the Apache License, Version 2.0 (the "License");
  1550. * you may not use this file except in compliance with the License.
  1551. * You may obtain a copy of the License at
  1552. *
  1553. * http://www.apache.org/licenses/LICENSE-2.0
  1554. *
  1555. * Unless required by applicable law or agreed to in writing, software
  1556. * distributed under the License is distributed on an "AS IS" BASIS,
  1557. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1558. * See the License for the specific language governing permissions and
  1559. * limitations under the License.
  1560. * =============================================================================
  1561. */
  1562. function T(t,e,n){return{boxes:Object(s.d)("boxes",t,e,n),scores:Object(s.d)("scores",t,e,n),maxOutputSize:Object(s.d)("maxOutputSize",t,e,n),iouThreshold:Object(s.d)("iouThreshold",t,e,n),scoreThreshold:Object(s.d)("scoreThreshold",t,e,n),softNmsSigma:Object(s.d)("softNmsSigma",t,e,n)}}const x=async(t,e,n)=>{switch(t.op){case"NonMaxSuppressionV5":{const{boxes:r,scores:i,maxOutputSize:o,iouThreshold:s,scoreThreshold:a,softNmsSigma:l}=T(t,e,n),c=await u._7.nonMaxSuppressionWithScoreAsync(r,i,o,s,a,l);return[c.selectedIndices,c.selectedScores]}case"NonMaxSuppressionV4":{const{boxes:r,scores:i,maxOutputSize:o,iouThreshold:a,scoreThreshold:l}=T(t,e,n),c=Object(s.d)("padToMaxOutputSize",t,e,n),h=await u._7.nonMaxSuppressionPaddedAsync(r,i,o,a,l,c);return[h.selectedIndices,h.validOutputs]}case"NonMaxSuppressionV3":case"NonMaxSuppressionV2":{const{boxes:r,scores:i,maxOutputSize:o,iouThreshold:s,scoreThreshold:a}=T(t,e,n);return[await u._7.nonMaxSuppressionAsync(r,i,o,s,a)]}case"Where":{const r=u.w(Object(s.d)("condition",t,e,n),"bool"),i=[await u._90(r)];return r.dispose(),i}case"ListDiff":return u._57(Object(s.d)("x",t,e,n),Object(s.d)("y",t,e,n));default:throw TypeError(`Node type ${t.op} is not implemented`)}},E=(t,e,n)=>{switch(t.op){case"TopKV2":{const r=Object(s.d)("x",t,e,n),i=Object(s.d)("k",t,e,n),o=Object(s.d)("sorted",t,e,n),a=u._84(r,i,o);return[a.values,a.indices]}case"Unique":{const r=Object(s.d)("x",t,e,n),i=u._87(r);return[i.values,i.indices]}case"UniqueV2":{const r=Object(s.d)("x",t,e,n),i=Object(s.d)("axis",t,e,n),o=u._87(r,i);return[o.values,o.indices]}default:throw TypeError(`Node type ${t.op} is not implemented`)}},w=(t,e,n)=>{switch(t.op){case"Const":return e[t.name];case"PlaceholderWithDefault":const r=Object(s.d)("default",t,e,n);return[Object(s.e)(t.name,e,n)||r];case"Placeholder":return[Object(s.e)(t.name,e,n)];case"Identity":case"StopGradient":case"FakeQuantWithMinMaxVars":{const r=Object(s.d)("x",t,e,n);return[Object(s.a)(r)]}case"IdentityN":return Object(s.d)("x",t,e,n).map(t=>Object(s.a)(t));case"Snapshot":const i=Object(s.d)("x",t,e,n);return[Object(s.a)(i)];case"Shape":return[u._81(Object(s.d)("x",t,e,n).shape,"int32")];case"ShapeN":return Object(s.d)("x",t,e,n).map(t=>u._81(t.shape));case"Size":return[u._54(Object(s.d)("x",t,e,n).size,"int32")];case"Rank":return[u._54(Object(s.d)("x",t,e,n).rank,"int32")];case"NoOp":return[u._54(1)];case"Print":const o=Object(s.d)("x",t,e,n),a=Object(s.d)("data",t,e,n),l=Object(s.d)("message",t,e,n),c=Object(s.d)("summarize",t,e,n);console.warn("The graph has a tf.print() operation,usually used for debugging, which slows down performance."),console.log(l);for(let t=0;t<a.length;t++)console.log(Array.prototype.slice.call(a[t].dataSync()).slice(0,c));return[o];default:throw TypeError(`Node type ${t.op} is not implemented`)}};
  1563. /**
  1564. * @license
  1565. * Copyright 2020 Google LLC. All Rights Reserved.
  1566. * Licensed under the Apache License, Version 2.0 (the "License");
  1567. * you may not use this file except in compliance with the License.
  1568. * You may obtain a copy of the License at
  1569. *
  1570. * http://www.apache.org/licenses/LICENSE-2.0
  1571. *
  1572. * Unless required by applicable law or agreed to in writing, software
  1573. * distributed under the License is distributed on an "AS IS" BASIS,
  1574. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1575. * See the License for the specific language governing permissions and
  1576. * limitations under the License.
  1577. * =============================================================================
  1578. */
  1579. const C=async(t,e,n,r)=>{switch(t.op){case"HashTable":case"HashTableV2":{const o=new
  1580. /**
  1581. * @license
  1582. * Copyright 2020 Google LLC. All Rights Reserved.
  1583. * Licensed under the Apache License, Version 2.0 (the "License");
  1584. * you may not use this file except in compliance with the License.
  1585. * You may obtain a copy of the License at
  1586. *
  1587. * http://www.apache.org/licenses/LICENSE-2.0
  1588. *
  1589. * Unless required by applicable law or agreed to in writing, software
  1590. * distributed under the License is distributed on an "AS IS" BASIS,
  1591. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1592. * See the License for the specific language governing permissions and
  1593. * limitations under the License.
  1594. * =============================================================================
  1595. */
  1596. class{constructor(t,e){this.keyDType=t,this.valueDType=e,this.handle=Object(i._138)(0),this.tensorMap=new Map,Object(i._132)(this.handle)}get id(){return this.handle.id}clearAndClose(){this.tensorMap.forEach(t=>t.dispose()),this.tensorMap.clear(),this.handle.dispose()}size(){return this.tensorMap.size}tensorSize(){return u._54(this.size(),"int32")}async import(t,e){this.checkKeyAndValueTensor(t,e);const n=await t.data();return this.tensorMap.forEach(t=>t.dispose()),this.tensorMap.clear(),Object(i._149)(()=>{const t=Object(i._150)(e),r=n.length,o=t.length;i._152.assert(r===o,()=>"The number of elements doesn't match, keys has "+`${r} elements, the values has ${o} `+"elements.");for(let e=0;e<r;e++){const r=n[e],o=t[e];Object(i._132)(o),this.tensorMap.set(r,o)}return this.handle})}async find(t,e){this.checkKeyAndValueTensor(t,e);const n=await t.data();return Object(i._149)(()=>{const t=[];for(let r=0;r<n.length;r++){const i=n[r],o=this.findWithDefault(i,e);t.push(o)}return Object(i._143)(t)})}findWithDefault(t,e){const n=this.tensorMap.get(t);return null!=n?n:e}checkKeyAndValueTensor(t,e){if(t.dtype!==this.keyDType)throw new Error(`Expect key dtype ${this.keyDType}, but got `+`${t.dtype}`);if(e.dtype!==this.valueDType)throw new Error(`Expect value dtype ${this.valueDType}, but got `+`${e.dtype}`)}}(Object(s.d)("keyDType",t,e,n),Object(s.d)("valueDType",t,e,n));return r.addHashTable(t.name,o),[o.handle]}case"LookupTableImport":case"LookupTableImportV2":{const i=Object(s.d)("tableHandle",t,e,n,r),o=Object(s.d)("keys",t,e,n),a=Object(s.d)("values",t,e,n),l=r.getHashTableById(i.id);return[await l.import(o,a)]}case"LookupTableFind":case"LookupTableFindV2":{const i=Object(s.d)("tableHandle",t,e,n,r),o=Object(s.d)("keys",t,e,n),a=Object(s.d)("defaultValue",t,e,n),l=r.getHashTableById(i.id);return[await l.find(o,a)]}case"LookupTableSize":case"LookupTableSizeV2":{const i=Object(s.d)("tableHandle",t,e,n,r);return[r.getHashTableById(i.id).tensorSize()]}default:throw TypeError(`Node type ${t.op} is not implemented`)}},S=(t,e,n)=>{switch(t.op){case"ResizeBilinear":{const r=Object(s.d)("images",t,e,n),i=Object(s.d)("size",t,e,n),o=Object(s.d)("alignCorners",t,e,n),a=Object(s.d)("halfPixelCenters",t,e,n);return[u._7.resizeBilinear(r,[i[0],i[1]],o,a)]}case"ResizeNearestNeighbor":{const r=Object(s.d)("images",t,e,n),i=Object(s.d)("size",t,e,n),o=Object(s.d)("alignCorners",t,e,n),a=Object(s.d)("halfPixelCenters",t,e,n);return[u._7.resizeNearestNeighbor(r,[i[0],i[1]],o,a)]}case"CropAndResize":{const r=Object(s.d)("image",t,e,n),i=Object(s.d)("boxes",t,e,n),o=Object(s.d)("boxInd",t,e,n),a=Object(s.d)("cropSize",t,e,n),l=Object(s.d)("method",t,e,n),c=Object(s.d)("extrapolationValue",t,e,n);return[u._7.cropAndResize(r,i,o,a,l,c)]}default:throw TypeError(`Node type ${t.op} is not implemented`)}},k=(t,e,n)=>{switch(t.op){case"Equal":return[u.R(Object(s.d)("a",t,e,n),Object(s.d)("b",t,e,n))];case"NotEqual":return[u._35(Object(s.d)("a",t,e,n),Object(s.d)("b",t,e,n))];case"Greater":return[u._3(Object(s.d)("a",t,e,n),Object(s.d)("b",t,e,n))];case"GreaterEqual":return[u._4(Object(s.d)("a",t,e,n),Object(s.d)("b",t,e,n))];case"Less":return[u._11(Object(s.d)("a",t,e,n),Object(s.d)("b",t,e,n))];case"LessEqual":return[u._12(Object(s.d)("a",t,e,n),Object(s.d)("b",t,e,n))];case"LogicalAnd":return[u._18(Object(s.d)("a",t,e,n),Object(s.d)("b",t,e,n))];case"LogicalNot":return[u._19(Object(s.d)("a",t,e,n))];case"LogicalOr":return[u._20(Object(s.d)("a",t,e,n),Object(s.d)("b",t,e,n))];case"Select":case"SelectV2":return[u._89(Object(s.d)("condition",t,e,n),Object(s.d)("a",t,e,n),Object(s.d)("b",t,e,n))];default:throw TypeError(`Node type ${t.op} is not implemented`)}},O=(t,e,n)=>{switch(t.op){case"BatchMatMul":case"BatchMatMulV2":case"MatMul":return[u._21(Object(s.d)("a",t,e,n),Object(s.d)("b",t,e,n),Object(s.d)("transposeA",t,e,n),Object(s.d)("transposeB",t,e,n))];case"Einsum":return[u.P(Object(s.d)("equation",t,e,n),...Object(s.d)("tensors",t,e,n))];case"Transpose":return[u._85(Object(s.d)("x",t,e,n),Object(s.d)("perm",t,e,n))];case"_FusedMatMul":const[r,i]=Object(s.d)("fusedOps",t,e,n),o="biasadd"===r,a="prelu"===i,l=Object(s.d)("numArgs",t,e,n),c=Object(s.d)("leakyreluAlpha",t,e,n);if(o){if(a&&2!==l)throw new Error("Fused MatMul with BiasAdd and Prelu must have two extra arguments: bias and alpha.");if(!a&&1!==l)throw new Error("Fused MatMul with BiasAdd must have one extra argument: bias.")}const[h,d]=Object(s.d)("args",t,e,n);return[u._0.matMul({a:Object(s.d)("a",t,e,n),b:Object(s.d)("b",t,e,n),transposeA:Object(s.d)("transposeA",t,e,n),transposeB:Object(s.d)("transposeB",t,e,n),bias:h,activation:i,preluActivationWeights:d,leakyreluAlpha:c})];default:throw TypeError(`Node type ${t.op} is not implemented`)}},I=(t,e,n)=>{switch(t.op){case"FusedBatchNorm":case"FusedBatchNormV2":case"FusedBatchNormV3":return[u.q(Object(s.d)("x",t,e,n),Object(s.d)("mean",t,e,n),Object(s.d)("variance",t,e,n),Object(s.d)("offset",t,e,n),Object(s.d)("scale",t,e,n),Object(s.d)("epsilon",t,e,n))];case"LRN":return[u._14(Object(s.d)("x",t,e,n),Object(s.d)("radius",t,e,n),Object(s.d)("bias",t,e,n),Object(s.d)("alpha",t,e,n),Object(s.d)("beta",t,e,n))];case"Softmax":return[u._63(Object(s.d)("x",t,e,n))];case"LogSoftmax":return[u._17(Object(s.d)("x",t,e,n))];case"SparseToDense":return[u._67(Object(s.d)("sparseIndices",t,e,n),Object(s.d)("outputShape",t,e,n),Object(s.d)("sparseValues",t,e,n),Object(s.d)("defaultValue",t,e,n))];default:throw TypeError(`Node type ${t.op} is not implemented`)}},R=(t,e,n)=>{switch(t.op){case"Max":{const r=Object(s.d)("axis",t,e,n),i=Object(s.d)("keepDims",t,e,n);return[u._22(Object(s.d)("x",t,e,n),r,i)]}case"Mean":{const r=Object(s.d)("axis",t,e,n),i=Object(s.d)("keepDims",t,e,n);return[u._27(Object(s.d)("x",t,e,n),r,i)]}case"Min":{const r=Object(s.d)("axis",t,e,n),i=Object(s.d)("keepDims",t,e,n);return[u._28(Object(s.d)("x",t,e,n),r,i)]}case"Sum":{const r=Object(s.d)("axis",t,e,n),i=Object(s.d)("keepDims",t,e,n);return[u._77(Object(s.d)("x",t,e,n),r,i)]}case"All":{const r=Object(s.d)("axis",t,e,n),i=Object(s.d)("keepDims",t,e,n);return[u.f(Object(s.d)("x",t,e,n),r,i)]}case"Any":{const r=Object(s.d)("axis",t,e,n),i=Object(s.d)("keepDims",t,e,n);return[u.g(Object(s.d)("x",t,e,n),r,i)]}case"ArgMax":{const r=Object(s.d)("axis",t,e,n);return[u.h(Object(s.d)("x",t,e,n),r)]}case"ArgMin":{const r=Object(s.d)("axis",t,e,n);return[u.i(Object(s.d)("x",t,e,n),r)]}case"Prod":{const r=Object(s.d)("axis",t,e,n),i=Object(s.d)("keepDims",t,e,n);return[u._42(Object(s.d)("x",t,e,n),r,i)]}case"Cumsum":{const r=Object(s.d)("axis",t,e,n),i=Object(s.d)("exclusive",t,e,n),o=Object(s.d)("reverse",t,e,n);return[u.I(Object(s.d)("x",t,e,n),r,i,o)]}case"Bincount":const r=Object(s.d)("x",t,e,n),i=Object(s.d)("weights",t,e,n),o=Object(s.d)("size",t,e,n);return[u.s(r,i,o)];case"DenseBincount":{const r=Object(s.d)("x",t,e,n),i=Object(s.d)("weights",t,e,n),o=Object(s.d)("size",t,e,n),a=Object(s.d)("binaryOutput",t,e,n);return[u.J(r,i,o,a)]}default:throw TypeError(`Node type ${t.op} is not implemented`)}},A=(t,e,n)=>{switch(t.op){case"ConcatV2":case"Concat":{const r=Object(s.d)("n",t,e,n),i=Object(s.d)("axis",t,e,n);let o=Object(s.d)("tensors",t,e,n);return o=o.slice(0,r),[u.B(o,i)]}case"Gather":{const r=Object(s.d)("x",t,e,n),i=Object(s.d)("indices",t,e,n);return[u._1(r,u.w(i,"int32"),0)]}case"GatherV2":{const r=Object(s.d)("axis",t,e,n),i=Object(s.d)("batchDims",t,e,n),o=Object(s.d)("x",t,e,n),a=Object(s.d)("indices",t,e,n);return[u._1(o,u.w(a,"int32"),r,i)]}case"Reverse":{const r=Object(s.d)("dims",t,e,n),i=[];for(let t=0;t<r.length;t++)r[t]&&i.push(t);const o=Object(s.d)("x",t,e,n);return[u._50(o,i)]}case"ReverseV2":{const r=Object(s.d)("axis",t,e,n),i=Object(s.d)("x",t,e,n);return[u._50(i,r)]}case"Slice":{const r=Object(s.d)("begin",t,e,n),i=Object(s.d)("size",t,e,n);return[u._62(Object(s.d)("x",t,e,n),r,i)]}case"StridedSlice":{const r=Object(s.d)("begin",t,e,n),i=Object(s.d)("end",t,e,n),o=Object(s.d)("strides",t,e,n),a=Object(s.d)("beginMask",t,e,n),l=Object(s.d)("endMask",t,e,n),c=Object(s.d)("ellipsisMask",t,e,n),h=Object(s.d)("newAxisMask",t,e,n),d=Object(s.d)("shrinkAxisMask",t,e,n),p=Object(s.d)("x",t,e,n);return[u._74(p,r,i,o,a,l,c,h,d)]}case"Pack":return Object(i._149)(()=>{const r=Object(s.d)("axis",t,e,n),o=Object(s.d)("tensors",t,e,n),a=o[0].shape,l=u._72(o[0]).shape,c=o.map(t=>{const e=i._152.arraysEqual(t.shape,a);if(!e&&!i._152.arraysEqual(u._72(t).shape,l))throw new Error("the input tensors shape does not match");return e?t:u._49(t,a)});return[u._73(c,r)]});case"Unpack":{const r=Object(s.d)("axis",t,e,n),i=Object(s.d)("tensor",t,e,n);return u._88(i,r)}case"Tile":{const r=Object(s.d)("reps",t,e,n);return[u._83(Object(s.d)("x",t,e,n),r)]}case"Split":case"SplitV":{const r=Object(s.d)("axis",t,e,n),i=Object(s.d)("numOrSizeSplits",t,e,n),o=Object(s.d)("x",t,e,n);return u._68(o,i,r)}case"ScatterNd":{const r=Object(s.d)("indices",t,e,n),i=Object(s.d)("values",t,e,n),o=Object(s.d)("shape",t,e,n);return[u._55(r,i,o)]}case"GatherNd":{const r=Object(s.d)("x",t,e,n),i=Object(s.d)("indices",t,e,n);return[u._2(r,i)]}case"SparseToDense":{const r=Object(s.d)("sparseIndices",t,e,n),i=Object(s.d)("outputShape",t,e,n),o=Object(s.d)("sparseValues",t,e,n),a=Object(s.d)("defaultValue",t,e,n);return[u._67(r,o,i,o.dtype===a.dtype?a:u.w(a,o.dtype))]}default:throw TypeError(`Node type ${t.op} is not implemented`)}},N=(t,e,n)=>{switch(t.op){case"SparseFillEmptyRows":{const{outputIndices:r,outputValues:i,emptyRowIndicator:o,reverseIndexMap:a}=u._66.sparseFillEmptyRows(Object(s.d)("indices",t,e,n),Object(s.d)("values",t,e,n),Object(s.d)("denseShape",t,e,n),Object(s.d)("defaultValue",t,e,n));return[r,i,o,a]}case"SparseReshape":{const{outputIndices:r,outputShape:i}=u._66.sparseReshape(Object(s.d)("inputIndices",t,e,n),Object(s.d)("inputShape",t,e,n),Object(s.d)("newShape",t,e,n));return[r,i]}case"SparseSegmentMean":return[u._66.sparseSegmentMean(Object(s.d)("data",t,e,n),Object(s.d)("indices",t,e,n),Object(s.d)("segmentIds",t,e,n))];case"SparseSegmentSum":return[u._66.sparseSegmentSum(Object(s.d)("data",t,e,n),Object(s.d)("indices",t,e,n),Object(s.d)("segmentIds",t,e,n))];default:throw TypeError(`Node type ${t.op} is not implemented`)}},D=(t,e,n)=>{switch(t.op){case"FFT":return[u.W(Object(s.d)("x",t,e,n))];case"IFFT":return[u._5(Object(s.d)("x",t,e,n))];case"RFFT":return[u._51(Object(s.d)("x",t,e,n))];case"IRFFT":return[u._8(Object(s.d)("x",t,e,n))];default:throw TypeError(`Node type ${t.op} is not implemented`)}},M=(t,e,n)=>{switch(t.op){case"StringNGrams":{const{nGrams:r,nGramsSplits:i}=u._75.stringNGrams(Object(s.d)("data",t,e,n),Object(s.d)("dataSplits",t,e,n),Object(s.d)("separator",t,e,n),Object(s.d)("nGramWidths",t,e,n),Object(s.d)("leftPad",t,e,n),Object(s.d)("rightPad",t,e,n),Object(s.d)("padWidth",t,e,n),Object(s.d)("preserveShortSequences",t,e,n));return[r,i]}case"StringSplit":{const{indices:r,values:i,shape:o}=u._75.stringSplit(Object(s.d)("input",t,e,n),Object(s.d)("delimiter",t,e,n),Object(s.d)("skipEmpty",t,e,n));return[r,i,o]}case"StringToHashBucketFast":return[u._75.stringToHashBucketFast(Object(s.d)("input",t,e,n),Object(s.d)("numBuckets",t,e,n))];default:throw TypeError(`Node type ${t.op} is not implemented`)}},L=(t,e,n)=>{switch(t.op){case"Cast":return[u.w(Object(s.d)("x",t,e,n),Object(s.d)("dtype",t,e,n))];case"ExpandDims":{const r=Object(s.d)("axis",t,e,n);return[u.U(Object(s.d)("x",t,e,n),r)]}case"Squeeze":{const r=Object(s.d)("axis",t,e,n);return[u._72(Object(s.d)("x",t,e,n),r)]}case"Reshape":return[u._49(Object(s.d)("x",t,e,n),Object(s.d)("shape",t,e,n))];case"MirrorPad":return[u._30(Object(s.d)("x",t,e,n),Object(s.d)("padding",t,e,n),Object(s.d)("mode",t,e,n))];case"PadV2":case"Pad":return[u._39(Object(s.d)("x",t,e,n),Object(s.d)("padding",t,e,n),Object(s.d)("constantValue",t,e,n))];case"SpaceToBatchND":{const r=Object(s.d)("blockShape",t,e,n),i=Object(s.d)("paddings",t,e,n);return[u._65(Object(s.d)("x",t,e,n),r,i)]}case"BatchToSpaceND":{const r=Object(s.d)("blockShape",t,e,n),i=Object(s.d)("crops",t,e,n);return[u.r(Object(s.d)("x",t,e,n),r,i)]}case"DepthToSpace":{const r=Object(s.d)("blockSize",t,e,n),i=Object(s.d)("dataFormat",t,e,n).toUpperCase();return[u.K(Object(s.d)("x",t,e,n),r,i)]}case"BroadcastTo":return[u.u(Object(s.d)("x",t,e,n),Object(s.d)("shape",t,e,n))];case"BroadcastArgs":return[u.t(Object(s.d)("s0",t,e,n),Object(s.d)("s1",t,e,n))];default:throw TypeError(`Node type ${t.op} is not implemented`)}};
  1597. /**
  1598. * @license
  1599. * Copyright 2018 Google LLC. All Rights Reserved.
  1600. * Licensed under the Apache License, Version 2.0 (the "License");
  1601. * you may not use this file except in compliance with the License.
  1602. * You may obtain a copy of the License at
  1603. *
  1604. * http://www.apache.org/licenses/LICENSE-2.0
  1605. *
  1606. * Unless required by applicable law or agreed to in writing, software
  1607. * distributed under the License is distributed on an "AS IS" BASIS,
  1608. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1609. * See the License for the specific language governing permissions and
  1610. * limitations under the License.
  1611. * =============================================================================
  1612. */
  1613. function P(t,e,n,r){const o=((t,e,n)=>{switch(t.category){case"arithmetic":return i._149(()=>c(t,e,n));case"basic_math":return i._149(()=>h(t,e,n));case"control":return v(t,e,n);case"convolution":return i._149(()=>_(t,e,n));case"creation":return i._149(()=>y(t,e,n));case"dynamic":return x(t,e,n);case"evaluation":return i._149(()=>E(t,e,n));case"image":return i._149(()=>S(t,e,n));case"graph":return i._149(()=>w(t,e,n));case"logical":return i._149(()=>k(t,e,n));case"matrices":return i._149(()=>O(t,e,n));case"normalization":return i._149(()=>I(t,e,n));case"reduction":return i._149(()=>R(t,e,n));case"slice_join":return i._149(()=>A(t,e,n));case"sparse":return i._149(()=>N(t,e,n));case"spectral":return i._149(()=>D(t,e,n));case"string":return i._149(()=>M(t,e,n));case"transformation":return i._149(()=>L(t,e,n));case"hash_table":return C(t,e,n,r);case"custom":const o=Object(l.a)(t.op);if(o&&o.customExecutor)return o.customExecutor(new a(t,e,n));throw TypeError(`Custom op ${t.op} is not registered.`);default:throw TypeError(`Unknown op '${t.op}'. File an issue at `+"https://github.com/tensorflow/tfjs/issues so we can add it, or register a custom execution with tf.registerOp()")}})(t,e,n);return i._152.isPromise(o)?o.then(t=>[].concat(t)):[].concat(o)}class F{constructor(t={},e={},n={},r={}){this.weightMap=t,this.tensorArrayMap=e,this.tensorListMap=n,this.functionMap=r,this.rootContext={id:0,frameName:"",iterationId:0},this.contexts=[this.rootContext],this.lastId=0,this.generateCurrentContextIds()}newFrame(t,e){return{id:t,frameName:e,iterationId:0}}set currentContext(t){this.contexts!==t&&(this.contexts=t,this.generateCurrentContextIds())}get currentContext(){return this.contexts}get currentContextId(){return this._currentContextIds[0]}get currentContextIds(){return this._currentContextIds}generateCurrentContextIds(){const t=[];for(let e=0;e<this.contexts.length-1;e++){const n=this.contexts.slice(0,this.contexts.length-e);t.push(this.contextIdforContexts(n))}t.push(""),this._currentContextIds=t}contextIdforContexts(t){return t?t.map(t=>0===t.id&&0===t.iterationId?"":`${t.frameName}-${t.iterationId}`).join("/"):""}enterFrame(t){this.contexts&&(this.lastId++,this.contexts=this.contexts.slice(),this.contexts.push(this.newFrame(this.lastId,t)),this._currentContextIds.unshift(this.contextIdforContexts(this.contexts)))}exitFrame(){if(!(this.contexts&&this.contexts.length>1))throw new Error("Cannot exit frame, the context is empty");this.contexts=this.contexts.slice(),this.contexts.splice(-1),this.currentContextIds.shift()}nextIteration(){if(!(this.contexts&&this.contexts.length>0))throw new Error("Cannot increase frame iteration, the context is empty");{this.contexts=this.contexts.slice(),this.lastId++;const t=Object.assign({},this.contexts[this.contexts.length-1]);t.iterationId+=1,t.id=this.lastId,this.contexts.splice(-1,1,t),this._currentContextIds.splice(0,1,this.contextIdforContexts(this.contexts))}}getWeight(t){return this.weightMap[t]}addTensorArray(t){this.tensorArrayMap[t.id]=t}getTensorArray(t){return this.tensorArrayMap[t]}addTensorList(t){this.tensorListMap[t.id]=t}getTensorList(t){return this.tensorListMap[t]}dispose(t){for(const e in this.tensorArrayMap)this.tensorArrayMap[e].clearAndClose(t);for(const e in this.tensorListMap)this.tensorListMap[e].clearAndClose(t)}}
  1614. /**
  1615. * @license
  1616. * Copyright 2019 Google LLC. All Rights Reserved.
  1617. * Licensed under the Apache License, Version 2.0 (the "License");
  1618. * you may not use this file except in compliance with the License.
  1619. * You may obtain a copy of the License at
  1620. *
  1621. * http://www.apache.org/licenses/LICENSE-2.0
  1622. *
  1623. * Unless required by applicable law or agreed to in writing, software
  1624. * distributed under the License is distributed on an "AS IS" BASIS,
  1625. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1626. * See the License for the specific language governing permissions and
  1627. * limitations under the License.
  1628. * =============================================================================
  1629. */function B(t,e,n,r){const i=new Set,o=[];let a=null,l=null;const u=new Set,c=Object.keys(t).map(t=>Object(s.g)(t)[0]);let h=[];null!=r&&(h=r.map(t=>Object(s.g)(t.name)[0]));const d=[...e];for(;d.length>0;){const t=d.pop();(V(t)||(t=t,$.indexOf(t.op)>=0)||H(t))&&null==a&&(l=(a=t).children.map(t=>t.name).filter(t=>i.has(t))),i.add(t.name),null==n[t.name]&&(-1===c.indexOf(t.name)&&-1===h.indexOf(t.name)&&(0!==t.inputs.length?t.inputs.forEach(t=>{u.has(t.name)||(u.add(t.name),d.push(t))}):o.push(t.name)))}var p;return{inputs:t,outputs:e,usedNodes:i,missingInputs:o,dynamicNode:a,syncInputs:l}}const j=["Switch","Merge","Enter","Exit","NextIteration","StatelessIf","StatelessWhile","if","While"],$=["NonMaxSuppressionV2","NonMaxSuppressionV3","NonMaxSuppressionV5","Where"],U=["HashTable","HashTableV2","LookupTableImport","LookupTableImportV2","LookupTableFind","LookupTableFindV2","LookupTableSize","LookupTableSizeV2"];function V(t){return j.indexOf(t.op)>=0}function H(t){return U.indexOf(t.op)>=0}
  1630. /**
  1631. * @license
  1632. * Copyright 2018 Google LLC. All Rights Reserved.
  1633. * Licensed under the Apache License, Version 2.0 (the "License");
  1634. * you may not use this file except in compliance with the License.
  1635. * You may obtain a copy of the License at
  1636. *
  1637. * http://www.apache.org/licenses/LICENSE-2.0
  1638. *
  1639. * Unless required by applicable law or agreed to in writing, software
  1640. * distributed under the License is distributed on an "AS IS" BASIS,
  1641. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1642. * See the License for the specific language governing permissions and
  1643. * limitations under the License.
  1644. * =============================================================================
  1645. */class W{constructor(t,e){this.graph=t,this.parent=e,this.compiledMap=new Map,this._weightMap={},this.SEPERATOR=",",this._functions={},this._functionExecutorMap={},this.intermediateTensors={},this.keepTensorForDebug=!1,this._outputs=t.outputs,this._inputs=t.inputs,this._initNodes=t.initNodes,this._signature=t.signature,this._functions=t.functions,null!=t.functions&&Object.keys(t.functions).forEach(e=>{this._functionExecutorMap[e]=new W(t.functions[e],this)})}get weightIds(){return this.parent?this.parent.weightIds:this._weightIds}get functionExecutorMap(){return this.parent?this.parent.functionExecutorMap:this._functionExecutorMap}get weightMap(){return this.parent?this.parent.weightMap:this._weightMap}set weightMap(t){const e=Object.keys(t).map(e=>t[e].map(t=>t.id));this._weightIds=[].concat(...e),this._weightMap=t}set resourceManager(t){this._resourceManager=t}get inputs(){return this._inputs.map(t=>({name:t.name,shape:t.attrParams.shape?t.attrParams.shape.value:void 0,dtype:t.attrParams.dtype?t.attrParams.dtype.value:void 0}))}get outputs(){return this._outputs.map(t=>({name:t.name,shape:t.attrParams.shape?t.attrParams.shape.value:void 0,dtype:t.attrParams.dtype?t.attrParams.dtype.value:void 0}))}get inputNodes(){return this._inputs.map(t=>t.signatureKey||t.name)}get outputNodes(){return this._outputs.map(t=>{const e=t.signatureKey||t.name;return t.defaultOutput?`${e}:${t.defaultOutput}`:e})}get functions(){return Object.keys(this._functions).reduce((t,e)=>(t[e]=this._functions[e].signature,t),{})}getCompilationKey(t,e){const n=t.map(t=>t.name).sort(),r=e.map(t=>t.name).sort();return n.join(this.SEPERATOR)+"--"+r.join(this.SEPERATOR)}compile(t,e){const n=B(t,e,this.weightMap,this._initNodes),{missingInputs:r,dynamicNode:i,syncInputs:o}=n;if(null!=i)throw new Error(`This execution contains the node '${i.name}', which has `+`the dynamic op '${i.op}'. Please use `+"model.executeAsync() instead. Alternatively, to avoid the "+`dynamic ops, specify the inputs [${o}]`);if(r.length>0){const n=e.map(t=>t.name),i=Object.keys(t);throw new Error(`Cannot compute the outputs [${n}] from the provided inputs `+`[${i}]. Missing the following inputs: [${r}]`)}return function(t,e,n){const{usedNodes:r,inputs:i}=n,o=[],a=Object.keys(i).map(t=>Object(s.g)(t)[0]).map(e=>t.nodes[e]),l=t.initNodes;a.forEach(t=>{r.has(t.name)&&o.push(t)}),t.weights.forEach(t=>{r.has(t.name)&&o.push(t)}),null!=l&&l.forEach(t=>{r.has(t.name)&&o.push(t)});const u=new Set,c=[];for(;o.length>0;){const t=o.pop();u.add(t.name),e[t.name]||c.push(t),t.children.forEach(t=>{!u.has(t.name)&&r.has(t.name)&&t.inputs.every(t=>u.has(t.name))&&o.push(t)})}return c}(this.graph,this.weightMap,n)}execute(t,e){t=this.mapInputs(t);const n=Object.keys(t).sort();this.checkInputs(t),this.checkInputShapeAndType(t),e=this.mapOutputs(e),this.checkOutputs(e);const r=n.map(t=>this.graph.nodes[Object(s.g)(t)[0]]),o=e.map(t=>Object(s.g)(t)[0]);let a=o.map(t=>this.graph.nodes[t]);this.resetIntermediateTensors(),0===a.length&&(a=this._outputs);const l=this.getCompilationKey(r,a);let u=this.compiledMap.get(l);null==u&&(u=this.compile(t,a),this.compiledMap.set(l,u));const c={},h={};return Object(i._149)(()=>{const n=new F(this.weightMap,c,h,this.functionExecutorMap),r=Object.assign({},this.weightMap);Object.keys(t).forEach(e=>{const[n,i]=Object(s.g)(e),o=[];o[i]=t[e],r[n]=o});const a=this.getFrozenTensorIds(r),l={};for(let t=0;t<u.length;t++){const e=u[t];if(!r[e.name]){const t=P(e,r,n,this._resourceManager);if(i._152.isPromise(t))throw new Error(`The execution of the op '${e.op}' returned a promise. `+"Please use model.executeAsync() instead.");r[e.name]=t,this.checkTensorForDisposal(e.name,e,r,n,a,o,l)}}return null==this.parent&&n.dispose(a),e.map(t=>Object(s.e)(t,r,n))})}getFrozenTensorIds(t){const e=[].concat.apply([],Object.keys(t).map(e=>t[e]).map(t=>t.map(t=>t.id)));return new Set(e)}checkTensorForDisposal(t,e,n,r,i,o,a){"control"!==e.category&&-1===o.indexOf(t)&&(n[t].forEach(t=>{null!=t&&(a[t.id]=(a[t.id]||0)+e.children.length)}),e.inputs.forEach(t=>{if("control"!==t.category){const o=Object(s.f)(t.name,n,r);null!=o&&o.forEach(t=>{if(t&&!t.kept&&!i.has(t.id)){const n=a[t.id];if(1===n){if(this.keepTensorForDebug){const[n,i]=Object(s.b)(e.name,r);this.intermediateTensors[n]?this.intermediateTensors[n][i]=t:(this.intermediateTensors[n]=[],this.intermediateTensors[n][i]=t)}else t.dispose();delete a[t.id]}else null!=n&&a[t.id]--}})}}))}async executeAsync(t,e){return this._executeAsync(t,e)}disposeIntermediateTensors(){this.intermediateTensors&&(Object.keys(this.intermediateTensors).forEach(t=>this.intermediateTensors[t].forEach(t=>t.dispose())),this.disposeTensorsMap())}disposeTensorsMap(){this.tensorsMap&&Object.keys(this.tensorsMap).forEach(t=>{this.tensorsMap[t].forEach(t=>{!t||t.kept||t.isDisposed||this.keepIds.has(t.id)||t.dispose()})})}getIntermediateTensors(){return this.tensorsMap}resetIntermediateTensors(){for(const t in this.intermediateTensors)this.intermediateTensors[t].forEach(t=>t.dispose()),delete this.intermediateTensors[t]}async _executeAsync(t,e,n=!1,r={},o={}){n||(t=this.mapInputs(t),this.checkInputs(t),this.checkInputShapeAndType(t),e=this.mapOutputs(e),this.checkOutputs(e));try{this.keepTensorForDebug=Object(i._127)().getBool("KEEP_INTERMEDIATE_TENSORS")}catch(t){console.warn(t.message)}this.resetIntermediateTensors();const a=new F(this.weightMap,r,o,this.functionExecutorMap);this.tensorsMap=await this.executeWithControlFlow(t,a,e,n);const l=e.map(t=>Object(s.e)(t,this.tensorsMap,a)),u=l.map(t=>t.id),c=Object.keys(t).map(e=>t[e].id);return this.keepIds=new Set([...u,...c,...this.weightIds]),this.keepTensorForDebug||this.disposeTensorsMap(),null==this.parent&&a.dispose(this.keepIds),l}async executeFunctionAsync(t,e,n){const r=t.reduce((t,e,n)=>(t[this.inputs[n].name]=e,t),{});return this._executeAsync(r,this.outputNodes,!0,e,n)}async executeWithControlFlow(t,e,n,r){const i=Object.keys(t),o=i.map(t=>this.graph.nodes[Object(s.g)(t)[0]]),a=n.map(t=>Object(s.g)(t)[0]);let l=a.map(t=>this.graph.nodes[t]);0===l.length&&(l=this._outputs);const{usedNodes:u,missingInputs:c,dynamicNode:h,syncInputs:d}=B(t,l,this.weightMap,this._initNodes),p=[...o,...this.graph.weights,...this._initNodes||[]].map(t=>({node:t,contexts:e.currentContext})),f=Object.assign({},this.weightMap);Object.keys(t).forEach(e=>{const[n,r]=Object(s.g)(e),i=[];i[r]=t[e],f[n]=i});const g={},m=this.getFrozenTensorIds(f),v={};for(;p.length>0;){const t=this.processStack(o,p,e,f,v,m,a,g,u);await Promise.all(t)}null!=h||r||console.warn("This model execution did not contain any nodes with control flow or dynamic output shapes. You can use model.execute() instead.");const b=l.filter(t=>!V(t)&&!Object(s.e)(t.name,f,e)).map(t=>t.name);if(b.length>0){let t="";throw null!=h&&(t="Alternatively, to avoid the dynamic ops, use model.execute() "+`and specify the inputs [${d}]`),new Error(`Cannot compute the outputs [${b}] from the provided `+`inputs [${i}]. Consider providing the following inputs: `+`[${c}]. ${t}`)}return f}processStack(t,e,n,r,o,a,l,u,c){const h=[];for(;e.length>0;){const t=e.pop();n.currentContext=t.contexts;let d="";if("Enter"===t.node.op&&Object(s.d)("isConstant",t.node,r,n)&&([d]=Object(s.b)(t.node.name,n)),null==r[t.node.name]){const p=P(t.node,r,n,this._resourceManager);d||([d]=Object(s.b)(t.node.name,n));const f=n.currentContext;i._152.isPromise(p)?h.push(p.then(i=>(r[d]=i,n.currentContext=f,this.checkTensorForDisposal(d,t.node,r,n,a,l,u),this.processChildNodes(t.node,e,n,r,o,c),i))):(r[d]=p,this.checkTensorForDisposal(d,t.node,r,n,a,l,u),this.processChildNodes(t.node,e,n,r,o,c))}else this.processChildNodes(t.node,e,n,r,o,c)}return h}processChildNodes(t,e,n,r,i,o){t.children.forEach(t=>{const[a]=Object(s.b)(t.name,n);!i[a]&&o.has(t.name)&&("Merge"===t.op?t.inputNames.some(t=>!!Object(s.e)(t,r,n))&&(i[a]=!0,e.push({contexts:n.currentContext,node:t})):t.inputNames.every(t=>!!Object(s.e)(t,r,n))&&(i[a]=!0,e.push({contexts:n.currentContext,node:t})))})}dispose(){Object.keys(this.weightMap).forEach(t=>this.weightMap[t].forEach(t=>t.dispose()))}checkInputShapeAndType(t){Object.keys(t).forEach(e=>{const n=t[e],[r]=Object(s.g)(e),o=this.graph.nodes[r];if(o.attrParams.shape&&o.attrParams.shape.value){const t=o.attrParams.shape.value,e=t.length===n.shape.length&&n.shape.every((e,n)=>-1===t[n]||t[n]===e);i._152.assert(e,()=>`The shape of dict['${o.name}'] provided in `+`model.execute(dict) must be [${t}], but was `+`[${n.shape}]`)}o.attrParams.dtype&&o.attrParams.dtype.value&&i._152.assert(n.dtype===o.attrParams.dtype.value,()=>`The dtype of dict['${o.name}'] provided in `+"model.execute(dict) must be "+`${o.attrParams.dtype.value}, but was ${n.dtype}`)})}mapInputs(t){const e={};for(const n in t)if(null!=this._signature&&null!=this._signature.inputs&&null!=this._signature.inputs[n]){e[this._signature.inputs[n].name]=t[n]}else e[n]=t[n];return e}checkInputs(t){const e=Object.keys(t).filter(t=>{const[e]=Object(s.g)(t);return null==this.graph.nodes[e]});if(e.length>0)throw new Error("The dict provided in model.execute(dict) has "+`keys: [${e}] that are not part of graph`)}mapOutputs(t){return t.map(t=>{if(null!=this._signature&&null!=this._signature.outputs&&null!=this._signature.outputs[t]){return this._signature.outputs[t].name}return t},{})}checkOutputs(t){t.forEach(t=>{const[e]=Object(s.g)(t);if(!this.graph.nodes[e])throw new Error(`The output '${t}' is not found in the graph`)})}}class G{constructor(t={},e={}){this.hashTableNameToHandle=t,this.hashTableMap=e}addHashTable(t,e){this.hashTableNameToHandle[t]=e.handle,this.hashTableMap[e.id]=e}getHashTableHandleByName(t){return this.hashTableNameToHandle[t]}getHashTableById(t){return this.hashTableMap[t]}dispose(){for(const t in this.hashTableMap)this.hashTableMap[t].clearAndClose(),delete this.hashTableMap[t];for(const t in this.hashTableNameToHandle)this.hashTableNameToHandle[t].dispose(),delete this.hashTableNameToHandle[t]}}
  1646. /**
  1647. * @license
  1648. * Copyright 2018 Google LLC. All Rights Reserved.
  1649. * Licensed under the Apache License, Version 2.0 (the "License");
  1650. * you may not use this file except in compliance with the License.
  1651. * You may obtain a copy of the License at
  1652. *
  1653. * http://www.apache.org/licenses/LICENSE-2.0
  1654. *
  1655. * Unless required by applicable law or agreed to in writing, software
  1656. * distributed under the License is distributed on an "AS IS" BASIS,
  1657. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1658. * See the License for the specific language governing permissions and
  1659. * limitations under the License.
  1660. * =============================================================================
  1661. */const z="?tfjs-format=file",X="model.json";class K{constructor(t,e={}){this.modelUrl=t,this.loadOptions=e,this.version="n/a",null==e&&(this.loadOptions={}),this.resourceManager=new G}get modelVersion(){return this.version}get inputNodes(){return this.executor.inputNodes}get outputNodes(){return this.executor.outputNodes}get inputs(){return this.executor.inputs}get outputs(){return this.executor.outputs}get weights(){return this.executor.weightMap}get metadata(){return this.artifacts.userDefinedMetadata}get modelSignature(){return this.signature}findIOHandler(){const t=this.modelUrl;if(null!=t.load)this.handler=t;else if(null!=this.loadOptions.requestInit)this.handler=i._131.browserHTTPRequest(t,this.loadOptions);else{const e=i._131.getLoadHandlers(t,this.loadOptions);if(0===e.length)e.push(i._131.browserHTTPRequest(t,this.loadOptions));else if(e.length>1)throw new Error(`Found more than one (${e.length}) load handlers for `+`URL '${[t]}'`);this.handler=e[0]}}async load(){if(this.findIOHandler(),null==this.handler.load)throw new Error("Cannot proceed with model loading because the IOHandler provided does not have the `load` method implemented.");const t=await this.handler.load();return this.loadSync(t)}loadSync(t){this.artifacts=t;const e=this.artifacts.modelTopology;let n;n=null!=this.artifacts.userDefinedMetadata&&null!=this.artifacts.userDefinedMetadata.signature?this.artifacts.userDefinedMetadata.signature:this.artifacts.signature,this.signature=n,this.version=`${e.versions.producer}.${e.versions.minConsumer}`;const r=i._131.decodeWeights(this.artifacts.weightData,this.artifacts.weightSpecs);if(this.executor=new W(o.a.Instance.transformGraph(e,this.signature)),this.executor.weightMap=this.convertTensorMapToTensorsMap(r),this.executor.resourceManager=this.resourceManager,null!=t.modelInitializer&&null!=t.modelInitializer.node){const e=o.a.Instance.transformGraph(t.modelInitializer);this.initializer=new W(e),this.initializer.weightMap=this.executor.weightMap,this.initializer.resourceManager=this.resourceManager,this.initializer.executeAsync({},[])}return!0}async save(t,e){if("string"==typeof t){const e=i._131.getSaveHandlers(t);if(0===e.length)throw new Error(`Cannot find any save handlers for URL '${t}'`);if(e.length>1)throw new Error(`Found more than one (${e.length}) save handlers for `+`URL '${t}'`);t=e[0]}if(null==t.save)throw new Error("GraphModel.save() cannot proceed because the IOHandler provided does not have the `save` attribute defined.");return t.save(this.artifacts)}predict(t,e){return this.execute(t,this.outputNodes)}normalizeInputs(t){if(!(t instanceof i._103||Array.isArray(t)))return t;if((t=Array.isArray(t)?t:[t]).length!==this.inputNodes.length)throw new Error("Input tensor count mismatch,"+`the graph model has ${this.inputNodes.length} placeholders, `+`while there are ${t.length} input tensors.`);return this.inputNodes.reduce((e,n,r)=>(e[n]=t[r],e),{})}normalizeOutputs(t){return t=t||this.outputNodes,Array.isArray(t)?t:[t]}execute(t,e){t=this.normalizeInputs(t),e=this.normalizeOutputs(e);const n=this.executor.execute(t,e);return n.length>1?n:n[0]}async executeAsync(t,e){t=this.normalizeInputs(t),e=this.normalizeOutputs(e);const n=await this.executor.executeAsync(t,e);return n.length>1?n:n[0]}getIntermediateTensors(){return this.executor.getIntermediateTensors()}disposeIntermediateTensors(){this.executor.disposeIntermediateTensors()}convertTensorMapToTensorsMap(t){return Object.keys(t).reduce((e,n)=>(e[n]=[t[n]],e),{})}dispose(){this.executor.dispose(),this.initializer&&this.initializer.dispose(),this.resourceManager.dispose()}}async function Y(t,e={}){if(null==t)throw new Error("modelUrl in loadGraphModel() cannot be null. Please provide a url or an IOHandler that loads the model");null==e&&(e={}),e.fromTFHub&&null==t.load&&(t.endsWith("/")||(t+="/"),t=`${t}${X}${z}`);const n=new K(t,e);return await n.load(),n}
  1662. /** @license See the LICENSE file. */
  1663. /**
  1664. * @license
  1665. * Copyright 2018 Google LLC. All Rights Reserved.
  1666. * Licensed under the Apache License, Version 2.0 (the "License");
  1667. * you may not use this file except in compliance with the License.
  1668. * You may obtain a copy of the License at
  1669. *
  1670. * http://www.apache.org/licenses/LICENSE-2.0
  1671. *
  1672. * Unless required by applicable law or agreed to in writing, software
  1673. * distributed under the License is distributed on an "AS IS" BASIS,
  1674. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1675. * See the License for the specific language governing permissions and
  1676. * limitations under the License.
  1677. * =============================================================================
  1678. */n.d(e,"a",function(){return bt}),n.d(e,"b",function(){return Rt});
  1679. /**
  1680. * @license
  1681. * Copyright 2022 Google LLC. All Rights Reserved.
  1682. * Licensed under the Apache License, Version 2.0 (the "License");
  1683. * you may not use this file except in compliance with the License.
  1684. * You may obtain a copy of the License at
  1685. *
  1686. * http://www.apache.org/licenses/LICENSE-2.0
  1687. *
  1688. * Unless required by applicable law or agreed to in writing, software
  1689. * distributed under the License is distributed on an "AS IS" BASIS,
  1690. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1691. * See the License for the specific language governing permissions and
  1692. * limitations under the License.
  1693. * =============================================================================
  1694. */
  1695. var q=function(){return(q=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function J(t,e,n,r){return new(n||(n=Promise))(function(i,o){function s(t){try{l(r.next(t))}catch(t){o(t)}}function a(t){try{l(r.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(s,a)}l((r=r.apply(t,e||[])).next())})}function Z(t,e){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}var Q=["wrist","thumb_cmc","thumb_mcp","thumb_ip","thumb_tip","index_finger_mcp","index_finger_pip","index_finger_dip","index_finger_tip","middle_finger_mcp","middle_finger_pip","middle_finger_dip","middle_finger_tip","ring_finger_mcp","ring_finger_pip","ring_finger_dip","ring_finger_tip","pinky_finger_mcp","pinky_finger_pip","pinky_finger_dip","pinky_finger_tip"],tt={runtime:"mediapipe",maxHands:2,modelType:"full"},et=function(){function t(t){var e,n=this;switch(this.width=0,this.height=0,this.selfieMode=!1,this.handsSolution=new r.Hands({locateFile:function(e,n){return t.solutionPath?t.solutionPath.replace(/\/+$/,"")+"/"+e:n+"/"+e}}),t.modelType){case"lite":e=0;break;case"full":default:e=1}this.handsSolution.setOptions({modelComplexity:e,selfieMode:this.selfieMode,maxNumHands:t.maxHands}),this.handsSolution.onResults(function(t){if(n.height=t.image.height,n.width=t.image.width,n.hands=[],null!==t.multiHandLandmarks)for(var e=t.multiHandedness,r=t.multiHandLandmarks,i=t.multiHandWorldLandmarks,o=0;o<e.length;o++)n.hands.push(q(q({},n.translateOutput(r[o],i[o])),{score:e[o].score,handedness:e[o].label}))})}return t.prototype.translateOutput=function(t,e){var n=this;return{keypoints:t.map(function(t,e){return{x:t.x*n.width,y:t.y*n.height,score:t.visibility,name:Q[e]}}),keypoints3D:e.map(function(t,e){return{x:t.x,y:t.y,z:t.z,score:t.visibility,name:Q[e]}})}},t.prototype.estimateHands=function(t,e){return J(this,void 0,void 0,function(){var n,r;return Z(this,function(o){switch(o.label){case 0:return e&&e.flipHorizontal&&e.flipHorizontal!==this.selfieMode&&(this.selfieMode=e.flipHorizontal,this.handsSolution.setOptions({selfieMode:this.selfieMode})),t instanceof i._103?(r=ImageData.bind,[4,i._117.toPixels(t)]):[3,2];case 1:return n=new(r.apply(ImageData,[void 0,o.sent(),t.shape[1],t.shape[0]])),[3,3];case 2:n=t,o.label=3;case 3:return t=n,[4,this.handsSolution.send({image:t})];case 4:return o.sent(),[2,this.hands]}})})},t.prototype.dispose=function(){this.handsSolution.close()},t.prototype.reset=function(){this.handsSolution.reset(),this.width=0,this.height=0,this.hands=null,this.selfieMode=!1},t.prototype.initialize=function(){return this.handsSolution.initialize()},t}();function nt(t){return t.width*t.height}function rt(t){var e=t.xCenter-t.width/2,n=e+t.width,r=t.yCenter-t.height/2;return{xMin:e,xMax:n,yMin:r,yMax:r+t.height,width:t.width,height:t.height}}function it(t){return t instanceof i._103?{height:t.shape[0],width:t.shape[1]}:{height:t.height,width:t.width}}function ot(t){return t-2*Math.PI*Math.floor((t+Math.PI)/(2*Math.PI))}function st(t){return t instanceof i._103?t:i._117.fromPixels(t)}function at(t,e){i._152.assert(0!==t.width,function(){return e+" width cannot be 0."}),i._152.assert(0!==t.height,function(){return e+" height cannot be 0."})}function lt(t,e,n){var r=e.outputTensorSize,o=e.keepAspectRatio,s=e.borderMode,a=e.outputTensorFloatRange,l=it(t),u=function(t,e){return e?{xCenter:e.xCenter*t.width,yCenter:e.yCenter*t.height,width:e.width*t.width,height:e.height*t.height,rotation:e.rotation}:{xCenter:.5*t.width,yCenter:.5*t.height,width:t.width,height:t.height,rotation:0}}(l,n),c=function(t,e,n){if(void 0===n&&(n=!1),!n)return{top:0,left:0,right:0,bottom:0};var r=e.height,i=e.width;at(e,"targetSize"),at(t,"roi");var o,s,a=r/i,l=t.height/t.width,u=0,c=0;return a>l?(o=t.width,s=t.width*a,c=(1-l/a)/2):(o=t.height/a,s=t.height,u=(1-a/l)/2),t.width=o,t.height=s,{top:c,left:u,right:u,bottom:c}}(u,r,o),h=function(t,e,n,r){var i=t.width,o=t.height,s=r?-1:1,a=Math.cos(t.rotation),l=Math.sin(t.rotation),u=t.xCenter,c=t.yCenter,h=1/e,d=1/n,p=new Array(16);return p[0]=i*a*s*h,p[1]=-o*l*h,p[2]=0,p[3]=(-.5*i*a*s+.5*o*l+u)*h,p[4]=i*l*s*d,p[5]=o*a*d,p[6]=0,p[7]=(-.5*o*a-.5*i*l*s+c)*d,p[8]=0,p[9]=0,p[10]=i*h,p[11]=0,p[12]=0,p[13]=0,p[14]=0,p[15]=1,function(t){if(16!==t.length)throw new Error("Array length must be 16 but got "+t.length);return[[t[0],t[1],t[2],t[3]],[t[4],t[5],t[6],t[7]],[t[8],t[9],t[10],t[11]],[t[12],t[13],t[14],t[15]]]}(p)}(u,l.width,l.height,!1);return{imageTensor:Object(i._149)(function(){var e=st(t),n=Object(i._148)(function(t,e,n){return at(n,"inputResolution"),[1/n.width*t[0][0]*e.width,1/n.height*t[0][1]*e.width,t[0][3]*e.width,1/n.width*t[1][0]*e.height,1/n.height*t[1][1]*e.height,t[1][3]*e.height,0,0]}(h,l,r),[1,8]),o="zero"===s?"constant":"nearest",u=i._130.transform(Object(i._129)(Object(i._119)(e,"float32")),n,"bilinear",o,0,[r.height,r.width]);return null!=a?function(t,e){var n=function(t,e,n,r){var i=(r-n)/255;return{scale:i,offset:n-0*i}}(0,0,e[0],e[1]);return Object(i._149)(function(){return Object(i._114)(Object(i._134)(t,n.scale),n.offset)})}(u,a):u}),padding:c,transformationMatrix:h}}function ut(t,e,n,r){return 1===r?.5*(t+e):t+(e-t)*n/(r-1)}function ct(t){return{xCenter:t.xMin+t.width/2,yCenter:t.yMin+t.height/2,width:t.width,height:t.height}}function ht(t){var e=t.relativeKeypoints;if(e.length<=1)throw new Error("2 or more keypoints required to calculate a rect.");var n=Number.MAX_VALUE,r=Number.MAX_VALUE,i=Number.MIN_VALUE,o=Number.MIN_VALUE;return e.forEach(function(t){n=Math.min(n,t.x),i=Math.max(i,t.x),r=Math.min(r,t.y),o=Math.max(o,t.y)}),{xCenter:(n+i)/2,yCenter:(r+o)/2,width:i-n,height:o-r}}function dt(t,e){return t.map(function(t){var n=q(q({},t),{x:t.x*e.width,y:t.y*e.height});return null!=t.z&&(n.z=t.z*e.width),n})}function pt(t,e,n){return J(this,void 0,void 0,function(){var r,o,s,a,l;return Z(this,function(u){switch(u.label){case 0:return r=t[0],o=t[1],s=function(t,e,n){return Object(i._149)(function(){var r,o,s,a;n.reverseOutputOrder?(o=Object(i._142)(Object(i._140)(t,[0,n.boxCoordOffset+0],[-1,1])),r=Object(i._142)(Object(i._140)(t,[0,n.boxCoordOffset+1],[-1,1])),a=Object(i._142)(Object(i._140)(t,[0,n.boxCoordOffset+2],[-1,1])),s=Object(i._142)(Object(i._140)(t,[0,n.boxCoordOffset+3],[-1,1]))):(r=Object(i._142)(Object(i._140)(t,[0,n.boxCoordOffset+0],[-1,1])),o=Object(i._142)(Object(i._140)(t,[0,n.boxCoordOffset+1],[-1,1])),s=Object(i._142)(Object(i._140)(t,[0,n.boxCoordOffset+2],[-1,1])),a=Object(i._142)(Object(i._140)(t,[0,n.boxCoordOffset+3],[-1,1]))),o=Object(i._114)(Object(i._134)(Object(i._125)(o,n.xScale),e.w),e.x),r=Object(i._114)(Object(i._134)(Object(i._125)(r,n.yScale),e.h),e.y),n.applyExponentialOnBoxSize?(s=Object(i._134)(Object(i._128)(Object(i._125)(s,n.hScale)),e.h),a=Object(i._134)(Object(i._128)(Object(i._125)(a,n.wScale)),e.w)):(s=Object(i._134)(Object(i._125)(s,n.hScale),e.h),a=Object(i._134)(Object(i._125)(a,n.wScale),e.h));var l=Object(i._144)(r,Object(i._125)(s,2)),u=Object(i._144)(o,Object(i._125)(a,2)),c=Object(i._114)(r,Object(i._125)(s,2)),h=Object(i._114)(o,Object(i._125)(a,2)),d=Object(i._122)([Object(i._137)(l,[n.numBoxes,1]),Object(i._137)(u,[n.numBoxes,1]),Object(i._137)(c,[n.numBoxes,1]),Object(i._137)(h,[n.numBoxes,1])],1);if(n.numKeypoints)for(var p=0;p<n.numKeypoints;++p){var f=n.keypointCoordOffset+p*n.numValuesPerKeypoint,g=void 0,m=void 0;n.reverseOutputOrder?(g=Object(i._142)(Object(i._140)(t,[0,f],[-1,1])),m=Object(i._142)(Object(i._140)(t,[0,f+1],[-1,1]))):(m=Object(i._142)(Object(i._140)(t,[0,f],[-1,1])),g=Object(i._142)(Object(i._140)(t,[0,f+1],[-1,1])));var v=Object(i._114)(Object(i._134)(Object(i._125)(g,n.xScale),e.w),e.x),b=Object(i._114)(Object(i._134)(Object(i._125)(m,n.yScale),e.h),e.y);d=Object(i._122)([d,Object(i._137)(v,[n.numBoxes,1]),Object(i._137)(b,[n.numBoxes,1])],1)}return d})}(o,e,n),a=Object(i._149)(function(){var t=r;return n.sigmoidScore?(null!=n.scoreClippingThresh&&(t=Object(i._120)(r,-n.scoreClippingThresh,n.scoreClippingThresh)),t=Object(i._139)(t)):t}),[4,function(t,e,n){return J(this,void 0,void 0,function(){var r,i,o,s,a,l,u,c,h,d,p,f;return Z(this,function(g){switch(g.label){case 0:return r=[],[4,t.data()];case 1:return i=g.sent(),[4,e.data()];case 2:for(o=g.sent(),s=0;s<n.numBoxes;++s)if(!(null!=n.minScoreThresh&&o[s]<n.minScoreThresh||(a=s*n.numCoords,l=ft(i[a+0],i[a+1],i[a+2],i[a+3],o[s],n.flipVertically,s),(u=l.locationData.relativeBoundingBox).width<0||u.height<0))){if(n.numKeypoints>0)for((c=l.locationData).relativeKeypoints=[],h=n.numKeypoints*n.numValuesPerKeypoint,d=0;d<h;d+=n.numValuesPerKeypoint)p=a+n.keypointCoordOffset+d,f={x:i[p+0],y:n.flipVertically?1-i[p+1]:i[p+1]},c.relativeKeypoints.push(f);r.push(l)}return[2,r]}})})}(s,a,n)];case 1:return l=u.sent(),Object(i._124)([s,a]),[2,l]}})})}function ft(t,e,n,r,i,o,s){return{score:[i],ind:s,locationData:{relativeBoundingBox:{xMin:e,yMin:o?1-n:t,xMax:r,yMax:o?1-t:n,width:r-e,height:n-t}}}}function gt(t,e){return"none"===t?e:function(t){return 1/(1+Math.exp(-t))}(e)}function mt(t,e,n,r){return J(this,void 0,void 0,function(){var i,o,s,a,l,u,c,h;return Z(this,function(d){switch(d.label){case 0:return n=n||e.flipHorizontally||!1,r=r||e.flipVertically||!1,i=t.size,o=i/e.numLandmarks,[4,t.data()];case 1:for(s=d.sent(),a=[],l=0;l<e.numLandmarks;++l)u=l*o,(h={x:0,y:0}).x=n?e.inputImageWidth-s[u]:s[u],o>1&&(h.y=r?e.inputImageHeight-s[u+1]:s[u+1]),o>2&&(h.z=s[u+2]),o>3&&(h.score=gt(e.visibilityActivation,s[u+3])),a.push(h);for(c=0;c<a.length;++c)(h=a[c]).x=h.x/e.inputImageWidth,h.y=h.y/e.inputImageHeight,h.z=h.z/e.inputImageWidth/(e.normalizeZ||1);return[2,a]}})})}function vt(t,e,n){var r=t.width,i=t.height,o=t.rotation;if(null==n.rotation&&null==n.rotationDegree||(o=function(t,e){return null!=e.rotation?t+=e.rotation:null!=e.rotationDegree&&(t+=Math.PI*e.rotationDegree/180),ot(t)}(o,n)),0===o)t.xCenter=t.xCenter+r*n.shiftX,t.yCenter=t.yCenter+i*n.shiftY;else{var s=(e.width*r*n.shiftX*Math.cos(o)-e.height*i*n.shiftY*Math.sin(o))/e.width,a=(e.width*r*n.shiftX*Math.sin(o)+e.height*i*n.shiftY*Math.cos(o))/e.height;t.xCenter=t.xCenter+s,t.yCenter=t.yCenter+a}if(n.squareLong){var l=Math.max(r*e.width,i*e.height);r=l/e.width,i=l/e.height}else if(n.squareShort){var u=Math.min(r*e.width,i*e.height);r=u/e.width,i=u/e.height}return t.width=r*n.scaleX,t.height=i*n.scaleY,t}var bt,_t={reduceBoxesInLowestLayer:!1,interpolatedScaleAspectRatio:1,featureMapHeight:[],featureMapWidth:[],numLayers:4,minScale:.1484375,maxScale:.75,inputSizeHeight:192,inputSizeWidth:192,anchorOffsetX:.5,anchorOffsetY:.5,strides:[8,16,16,16],aspectRatios:[1],fixedAnchorSize:!0},yt={runtime:"tfjs",modelType:"full",maxHands:2,detectorModelUrl:"https://tfhub.dev/mediapipe/tfjs-model/handpose_3d/detector/full/1",landmarkModelUrl:"https://tfhub.dev/mediapipe/tfjs-model/handpose_3d/landmark/full/1"},Tt={flipHorizontal:!1,staticImageMode:!1},xt={applyExponentialOnBoxSize:!1,flipVertically:!1,ignoreClasses:[],numClasses:1,numBoxes:2016,numCoords:18,boxCoordOffset:0,keypointCoordOffset:4,numKeypoints:7,numValuesPerKeypoint:2,sigmoidScore:!0,scoreClippingThresh:100,reverseOutputOrder:!0,xScale:192,yScale:192,hScale:192,wScale:192,minScoreThresh:.5},Et={shiftX:0,shiftY:-.5,scaleX:2.6,scaleY:2.6,squareLong:!0},wt={shiftX:0,shiftY:-.1,scaleX:2,scaleY:2,squareLong:!0},Ct={outputTensorSize:{width:192,height:192},keepAspectRatio:!0,outputTensorFloatRange:[0,1],borderMode:"zero"},St={outputTensorSize:{width:224,height:224},keepAspectRatio:!0,outputTensorFloatRange:[0,1],borderMode:"zero"},kt={numLandmarks:21,inputImageWidth:224,inputImageHeight:224,normalizeZ:.4,visibilityActivation:"none",flipHorizontally:!1,flipVertically:!1},Ot={numLandmarks:21,inputImageWidth:1,inputImageHeight:1,visibilityActivation:"none",flipHorizontally:!1,flipVertically:!1},It=function(){function t(t,e,n){this.detectorModel=t,this.landmarkModel=e,this.maxHands=n,this.prevHandRectsFromLandmarks=null,this.anchors=function(t){null==t.reduceBoxesInLowestLayer&&(t.reduceBoxesInLowestLayer=!1),null==t.interpolatedScaleAspectRatio&&(t.interpolatedScaleAspectRatio=1),null==t.fixedAnchorSize&&(t.fixedAnchorSize=!1);for(var e=[],n=0;n<t.numLayers;){for(var r=[],i=[],o=[],s=[],a=n;a<t.strides.length&&t.strides[a]===t.strides[n];){var l=ut(t.minScale,t.maxScale,a,t.strides.length);if(0===a&&t.reduceBoxesInLowestLayer)o.push(1),o.push(2),o.push(.5),s.push(.1),s.push(l),s.push(l);else{for(var u=0;u<t.aspectRatios.length;++u)o.push(t.aspectRatios[u]),s.push(l);if(t.interpolatedScaleAspectRatio>0){var c=a===t.strides.length-1?1:ut(t.minScale,t.maxScale,a+1,t.strides.length);s.push(Math.sqrt(l*c)),o.push(t.interpolatedScaleAspectRatio)}}a++}for(var h=0;h<o.length;++h){var d=Math.sqrt(o[h]);r.push(s[h]/d),i.push(s[h]*d)}var p=0,f=0;if(t.featureMapHeight.length>0)p=t.featureMapHeight[n],f=t.featureMapWidth[n];else{var g=t.strides[n];p=Math.ceil(t.inputSizeHeight/g),f=Math.ceil(t.inputSizeWidth/g)}for(var m=0;m<p;++m)for(var v=0;v<f;++v)for(var b=0;b<r.length;++b){var _={xCenter:(v+t.anchorOffsetX)/f,yCenter:(m+t.anchorOffsetY)/p,width:0,height:0};t.fixedAnchorSize?(_.width=1,_.height=1):(_.width=i[b],_.height=r[b]),e.push(_)}n=a}return e}(_t);var r=Object(i._147)(this.anchors.map(function(t){return t.width})),o=Object(i._147)(this.anchors.map(function(t){return t.height})),s=Object(i._147)(this.anchors.map(function(t){return t.xCenter})),a=Object(i._147)(this.anchors.map(function(t){return t.yCenter}));this.anchorTensor={x:s,y:a,w:r,h:o}}return t.prototype.estimateHands=function(t,e){return J(this,void 0,void 0,function(){var n,r,o,s,a,l,u,c,h,d,p,f,g,m,v,b,_,y,T=this;return Z(this,function(x){switch(x.label){case 0:return n=function(t){if(null==t)return q({},Tt);var e=q({},t);return null==e.flipHorizontal&&(e.flipHorizontal=Tt.flipHorizontal),null==e.staticImageMode&&(e.staticImageMode=Tt.staticImageMode),e}(e),null==t?(this.reset(),[2,[]]):(r=it(t),o=Object(i._149)(function(){var e=Object(i._119)(st(t),"float32");return n.flipHorizontal&&(e=Object(i._142)(i._130.flipLeftRight(Object(i._129)(e,0)),[0])),e}),s=this.prevHandRectsFromLandmarks,n.staticImageMode||null==s||s.length<this.maxHands?[4,this.detectPalm(o)]:[3,2]);case 1:return 0===(l=x.sent()).length?(this.reset(),o.dispose(),[2,[]]):(u=l.map(function(t){return T.palmDetectionToRoi(t,r)}),a=u,[3,3]);case 2:a=s,x.label=3;case 3:return.5,E=[],[a].forEach(function(t){return t.forEach(function(t){(E=E.filter(function(e){return function(t,e){var n=rt(t),r=rt(e);if(!function(t,e){return!(t.xMax<e.xMin||e.xMax<t.xMin||t.yMax<e.yMin||e.yMax<t.yMin)}(n,r))return 0;var i=nt(function(t,e){var n=Math.max(t.xMin,e.xMin),r=Math.min(t.xMax,e.xMax),i=Math.max(t.yMin,e.yMin),o=Math.min(t.yMax,e.yMax);return{xMin:n,xMax:r,yMin:i,yMax:o,width:Math.max(r-n,0),height:Math.max(o-i,0)}}(n,r)),o=nt(n)+nt(r)-i;return o>0?i/o:0}(t,e)<=.5})).push(t)})}),a=E,[4,Promise.all(a.map(function(t){return T.handLandmarks(t,o)}))];case 4:for(c=x.sent(),h=[],this.prevHandRectsFromLandmarks=[],d=0,p=c;d<p.length;d++)null!=(f=p[d])&&(g=f.landmarks,m=f.worldLandmarks,v=f.handScore,b=f.handedness,this.prevHandRectsFromLandmarks.push(this.handLandmarksToRoi(g,r)),null!=(_=dt(g,r))&&_.forEach(function(t,e){delete t.z,t.name=Q[e]}),null!=(y=m)&&y.forEach(function(t,e){t.name=Q[e]}),h.push({keypoints:_,keypoints3D:y,handedness:b,score:v}));return o.dispose(),[2,h]}var E})})},t.prototype.dispose=function(){this.detectorModel.dispose(),this.landmarkModel.dispose(),Object(i._124)([this.anchorTensor.x,this.anchorTensor.y,this.anchorTensor.w,this.anchorTensor.h])},t.prototype.reset=function(){this.prevHandRectsFromLandmarks=null},t.prototype.detectPalm=function(t){return J(this,void 0,void 0,function(){var e,n,r,o,s,a,l,u,c,h;return Z(this,function(d){switch(d.label){case 0:return e=lt(t,Ct),n=e.imageTensor,r=e.padding,o=this.detectorModel.predict(n),s=function(t){return Object(i._149)(function(){var e=function(t){return Object(i._149)(function(){return[Object(i._140)(t,[0,0,0],[1,-1,1]),Object(i._140)(t,[0,0,1],[1,-1,-1])]})}(t),n=e[0],r=e[1];return{boxes:Object(i._142)(r),logits:Object(i._142)(n)}})}(o),a=s.boxes,[4,pt([l=s.logits,a],this.anchorTensor,xt)];case 1:return 0===(u=d.sent()).length?(Object(i._124)([n,o,l,a]),[2,u]):[4,function(t,e,n,r){return J(this,void 0,void 0,function(){var r,o,s,a,l;return Z(this,function(u){switch(u.label){case 0:return t.sort(function(t,e){return Math.max.apply(Math,e.score)-Math.max.apply(Math,t.score)}),r=Object(i._148)(t.map(function(t){return[t.locationData.relativeBoundingBox.yMin,t.locationData.relativeBoundingBox.xMin,t.locationData.relativeBoundingBox.yMax,t.locationData.relativeBoundingBox.xMax]})),o=Object(i._147)(t.map(function(t){return t.score[0]})),[4,i._130.nonMaxSuppressionAsync(r,o,e,n)];case 1:return[4,(s=u.sent()).array()];case 2:return a=u.sent(),l=t.filter(function(t,e){return a.indexOf(e)>-1}),Object(i._124)([r,o,s]),[2,l]}})})}(u,this.maxHands,.3)];case 2:return c=d.sent(),h=function(t,e){void 0===t&&(t=[]);for(var n=e.left,r=e.top,i=e.left+e.right,o=e.top+e.bottom,s=0;s<t.length;s++){var a=t[s],l=a.locationData.relativeBoundingBox,u=(l.xMin-n)/(1-i),c=(l.yMin-r)/(1-o),h=l.width/(1-i),d=l.height/(1-o);l.xMin=u,l.yMin=c,l.width=h,l.height=d,l.xMax=u+h,l.yMax=c+d;var p=a.locationData.relativeKeypoints;p&&p.forEach(function(t){var e=(t.x-n)/(1-i),s=(t.y-r)/(1-o);t.x=e,t.y=s})}return t}(c,r),Object(i._124)([n,o,l,a]),[2,h]}})})},t.prototype.palmDetectionToRoi=function(t,e){return vt(function(t,e,n,r,i){var o="rect"===n?function(t,e,n){var r,i=t.locationData;if("boundingbox"===e)r=ct(i.boundingBox);else{r=ht(i);var o=n.width,s=n.height;r.xCenter=Math.round(r.xCenter*o),r.yCenter=Math.round(r.yCenter*s),r.width=Math.round(r.width*o),r.height=Math.round(r.height*s)}return r}(t,e,r):function(t,e){var n=t.locationData;return"boundingbox"===e?ct(n.relativeBoundingBox):ht(n)}(t,e);return i&&(o.rotation=function(t,e,n){var r,i=t.locationData,o=n.rotationVectorStartKeypointIndex,s=n.rotationVectorEndKeypointIndex;r=n.rotationVectorTargetAngle?n.rotationVectorTargetAngle:Math.PI*n.rotationVectorTargetAngleDegree/180;var a=i.relativeKeypoints[o].x*e.width,l=i.relativeKeypoints[o].y*e.height,u=i.relativeKeypoints[s].x*e.width,c=i.relativeKeypoints[s].y*e.height;return ot(r-Math.atan2(-(c-l),u-a))}(t,r,i)),o}(t,"boundingbox","normRect",e,{rotationVectorStartKeypointIndex:0,rotationVectorEndKeypointIndex:2,rotationVectorTargetAngleDegree:90}),e,Et)},t.prototype.handLandmarks=function(t,e){return J(this,void 0,void 0,function(){var n,r,o,s,a,l,u,c,h,d,p,f,g,m,v,b;return Z(this,function(_){switch(_.label){case 0:return n=lt(e,St,t),r=n.imageTensor,o=n.padding,s=this.landmarkModel.execute(r,["Identity_2:0","Identity_1:0","Identity:0","Identity_3:0"]),a=s[0],l=s[1],u=s[2],c=s[3],[4,l.data()];case 1:return(h=_.sent()[0])<.5?(Object(i._124)(s),Object(i._124)(r),[2,null]):[4,u.data()];case 2:return d=_.sent()[0],p=d>=.5?"Left":"Right",[4,mt(a,kt)];case 3:return f=_.sent(),[4,mt(c,Ot)];case 4:return g=_.sent(),m=function(t,e){var n=e.left,r=e.top,i=e.left+e.right,o=e.top+e.bottom;return t.map(function(t){return q(q({},t),{x:(t.x-n)/(1-i),y:(t.y-r)/(1-o),z:t.z/(1-i)})})}(f,o),v=function(t,e,n){void 0===n&&(n={ignoreRotation:!1});for(var r=[],i=0,o=m;i<o.length;i++){var s=o[i],a=s.x-.5,l=s.y-.5,u=n.ignoreRotation?0:e.rotation,c=Math.cos(u)*a-Math.sin(u)*l,h=Math.sin(u)*a+Math.cos(u)*l;c=c*e.width+e.xCenter,h=h*e.height+e.yCenter;var d=s.z*e.width,p=q({},s);p.x=c,p.y=h,p.z=d,r.push(p)}return r}(0,t),b=function(t,e){for(var n=[],r=0,i=g;r<i.length;r++){var o=i[r],s=o.x,a=o.y,l=e.rotation,u=Math.cos(l)*s-Math.sin(l)*a,c=Math.sin(l)*s+Math.cos(l)*a,h=q({},o);h.x=u,h.y=c,n.push(h)}return n}(0,t),Object(i._124)(s),Object(i._124)(r),[2,{landmarks:v,worldLandmarks:b,handScore:h,handedness:p}]}})})},t.prototype.handLandmarksToRoi=function(t,e){return vt(function(t,e){for(var n=function(t,e){var n=t[0].x*e.width,r=t[0].y*e.height,i=(t[4].x+t[8].x)/2,o=(t[4].y+t[8].y)/2;return i=(i+t[6].x)/2*e.width,o=(o+t[6].y)/2*e.height,ot(Math.PI/2-Math.atan2(-(o-r),i-n))}(t,e),r=ot(-n),i=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,s=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY,l=0,u=t;l<u.length;l++){var c=(m=u[l]).x,h=m.y;i=Math.min(i,c),o=Math.max(o,c),s=Math.min(s,h),a=Math.max(a,h)}var d=(o+i)/2,p=(a+s)/2;i=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,s=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY;for(var f=0,g=t;f<g.length;f++){var m,v=((m=g[f]).x-d)*e.width,b=(m.y-p)*e.height,_=v*Math.cos(r)-b*Math.sin(r),y=v*Math.sin(r)+b*Math.cos(r);i=Math.min(i,_),o=Math.max(o,_),s=Math.min(s,y),a=Math.max(a,y)}var T=(o+i)/2,x=(a+s)/2,E=T*Math.cos(n)-x*Math.sin(n)+e.width*d,w=T*Math.sin(n)+x*Math.cos(n)+e.height*p,C=(o-i)/e.width,S=(a-s)/e.height;return{xCenter:E/e.width,yCenter:w/e.height,width:C,height:S,rotation:n}}([].concat(t.slice(0,4),t.slice(5,7),t.slice(9,11),t.slice(13,15),t.slice(17,19)),e),e,wt)},t}();function Rt(t,e){return J(this,void 0,void 0,function(){var n,r;return Z(this,function(i){switch(t){case bt.MediaPipeHands:if(r=void 0,null!=(n=e)){if("tfjs"===n.runtime)return[2,function(t){return J(this,void 0,void 0,function(){var e,n,r,i,o,s;return Z(this,function(a){switch(a.label){case 0:return e=function(t){if(null==t)return q({},yt);var e=q({},t);if(e.runtime="tfjs",null==e.maxHands&&(e.maxHands=yt.maxHands),null==e.modelType&&(e.modelType=yt.modelType),"lite"!==e.modelType&&"full"!==e.modelType)throw new Error("Model type must be one of lite or full, but got "+e.modelType);if(null==e.detectorModelUrl)switch(e.modelType){case"lite":e.detectorModelUrl="https://tfhub.dev/mediapipe/tfjs-model/handpose_3d/detector/lite/1";break;case"full":default:e.detectorModelUrl="https://tfhub.dev/mediapipe/tfjs-model/handpose_3d/detector/full/1"}if(null==e.landmarkModelUrl)switch(e.modelType){case"lite":e.landmarkModelUrl="https://tfhub.dev/mediapipe/tfjs-model/handpose_3d/landmark/lite/1";break;case"full":default:e.landmarkModelUrl="https://tfhub.dev/mediapipe/tfjs-model/handpose_3d/landmark/full/1"}return e}(t),n=e.detectorModelUrl.indexOf("https://tfhub.dev")>-1,r=e.landmarkModelUrl.indexOf("https://tfhub.dev")>-1,[4,Promise.all([Y(e.detectorModelUrl,{fromTFHub:n}),Y(e.landmarkModelUrl,{fromTFHub:r})])];case 1:return i=a.sent(),o=i[0],s=i[1],[2,new It(o,s,e.maxHands)]}})})}(n)];if("mediapipe"===n.runtime)return[2,function(t){return J(this,void 0,void 0,function(){var e,n;return Z(this,function(r){switch(r.label){case 0:return e=function(t){if(null==t)return q({},tt);var e=q({},t);return e.runtime="mediapipe",null==e.maxHands&&(e.maxHands=tt.maxHands),null==e.modelType&&(e.modelType=tt.modelType),e}(t),[4,(n=new et(e)).initialize()];case 1:return r.sent(),[2,n]}})})}(n)];r=n.runtime}throw new Error("Expect modelConfig.runtime to be either 'tfjs' or 'mediapipe', but got "+r);default:throw new Error(t+" is not a supported model name.")}})})}(bt||(bt={})).MediaPipeHands="MediaPipeHands"},XPNO:function(t,e,n){"use strict";var r=n("Nhog"),i=n("XFvI");
  1696. /**
  1697. * @license
  1698. * Copyright 2018 Google LLC. All Rights Reserved.
  1699. * Licensed under the Apache License, Version 2.0 (the "License");
  1700. * you may not use this file except in compliance with the License.
  1701. * You may obtain a copy of the License at
  1702. *
  1703. * http://www.apache.org/licenses/LICENSE-2.0
  1704. *
  1705. * Unless required by applicable law or agreed to in writing, software
  1706. * distributed under the License is distributed on an "AS IS" BASIS,
  1707. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1708. * See the License for the specific language governing permissions and
  1709. * limitations under the License.
  1710. * =============================================================================
  1711. */
  1712. const o=20,s=3,a=7;function l(t,e,n,r){const a=Object(i.computeStrides)(e),l=function(t,e,n,r){const o=Object(i.sizeFromShape)(e),s=r[r.length-1],a=new Array(s).fill(0),l=e.length,c="complex64"===n?h(t):t;if(l>1)for(let t=0;t<o/s;t++){const e=t*s;for(let t=0;t<s;t++)a[t]=Math.max(a[t],u(c[e+t],0,n).length)}return a}(t,e,n,a),d=e.length,p=function t(e,n,r,i,a,l=!0){const d="complex64"===r?2:1;const p=n[0];const f=n.length;if(0===f){if("complex64"===r){const t=h(e);return[u(t[0],0,r)]}return"bool"===r?[c(e[0])]:[e[0].toString()]}if(1===f){if(p>o){const t=s*d;let n=Array.from(e.slice(0,t)),i=Array.from(e.slice((p-s)*d,p*d));return"complex64"===r&&(n=h(n),i=h(i)),["["+n.map((t,e)=>u(t,a[e],r)).join(", ")+", ..., "+i.map((t,e)=>u(t,a[p-s+e],r)).join(", ")+"]"]}const t="complex64"===r?h(e):Array.from(e);return["["+t.map((t,e)=>u(t,a[e],r)).join(", ")+"]"]}const g=n.slice(1);const m=i.slice(1);const v=i[0]*d;const b=[];if(p>o){for(let n=0;n<s;n++){const i=n*v,o=i+v;b.push(...t(e.slice(i,o),g,r,m,a,!1))}b.push("...");for(let n=p-s;n<p;n++){const i=n*v,o=i+v;b.push(...t(e.slice(i,o),g,r,m,a,n===p-1))}}else for(let n=0;n<p;n++){const i=n*v,o=i+v;b.push(...t(e.slice(i,o),g,r,m,a,n===p-1))}const _=2===f?",":"";b[0]="["+b[0]+_;for(let t=1;t<b.length-1;t++)b[t]=" "+b[t]+_;let y=",\n";for(let t=2;t<f;t++)y+="\n";b[b.length-1]=" "+b[b.length-1]+"]"+(l?"":y);return b}(t,e,n,a,l),f=["Tensor"];return r&&(f.push(` dtype: ${n}`),f.push(` rank: ${d}`),f.push(` shape: [${e}]`),f.push(" values:")),f.push(p.map(t=>" "+t).join("\n")),f.join("\n")}function u(t,e,n){let r;return r=Array.isArray(t)?`${parseFloat(t[0].toFixed(a))} + `+`${parseFloat(t[1].toFixed(a))}j`:Object(i.isString)(t)?`'${t}'`:"bool"===n?c(t):parseFloat(t.toFixed(a)).toString(),Object(i.rightPad)(r,e)}function c(t){return 0===t?"false":"true"}function h(t){const e=[];for(let n=0;n<t.length;n+=2)e.push([t[n],t[n+1]]);return e}e.f=function(t){d=t},e.e=function(t){p=t},e.d=function(t){f=t};e.b=
  1713. /**
  1714. * @license
  1715. * Copyright 2017 Google LLC. All Rights Reserved.
  1716. * Licensed under the Apache License, Version 2.0 (the "License");
  1717. * you may not use this file except in compliance with the License.
  1718. * You may obtain a copy of the License at
  1719. *
  1720. * http://www.apache.org/licenses/LICENSE-2.0
  1721. *
  1722. * Unless required by applicable law or agreed to in writing, software
  1723. * distributed under the License is distributed on an "AS IS" BASIS,
  1724. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1725. * See the License for the specific language governing permissions and
  1726. * limitations under the License.
  1727. * =============================================================================
  1728. */
  1729. class{constructor(t,e,n){if(this.dtype=e,this.shape=t.slice(),this.size=i.sizeFromShape(t),null!=n){const t=n.length;i.assert(t===this.size,()=>`Length of values '${t}' does not match the size `+`inferred by the shape '${this.size}'.`)}if("complex64"===e)throw new Error("complex64 dtype TensorBuffers are not supported. Please create a TensorBuffer for the real and imaginary parts separately and call tf.complex(real, imag).");this.values=n||i.getArrayFromDType(e,this.size),this.strides=Object(i.computeStrides)(t)}set(t,...e){0===e.length&&(e=[0]),i.assert(e.length===this.rank,()=>`The number of provided coordinates (${e.length}) must `+`match the rank (${this.rank})`);const n=this.locToIndex(e);this.values[n]=t}get(...t){0===t.length&&(t=[0]);let e=0;for(const n of t){if(n<0||n>=this.shape[e]){const e=`Requested out of range element at ${t}. `+` Buffer shape=${this.shape}`;throw new Error(e)}e++}let n=t[t.length-1];for(let e=0;e<t.length-1;++e)n+=this.strides[e]*t[e];return this.values[n]}locToIndex(t){if(0===this.rank)return 0;if(1===this.rank)return t[0];let e=t[t.length-1];for(let n=0;n<t.length-1;++n)e+=this.strides[n]*t[n];return e}indexToLoc(t){if(0===this.rank)return[];if(1===this.rank)return[t];const e=new Array(this.shape.length);for(let n=0;n<e.length-1;++n)e[n]=Math.floor(t/this.strides[n]),t-=e[n]*this.strides[n];return e[e.length-1]=t,e}get rank(){return this.shape.length}toTensor(){return d().makeTensor(this.values,this.shape,this.dtype)}};let d=null,p=null,f=null;class g{constructor(t,e,n,r){this.kept=!1,this.isDisposedInternal=!1,this.shape=t.slice(),this.dtype=e||"float32",this.size=i.sizeFromShape(t),this.strides=Object(i.computeStrides)(t),this.dataId=n,this.id=r,this.rankType=this.rank<5?this.rank.toString():"higher"}get rank(){return this.shape.length}async buffer(){const t=await this.data();return p.buffer(this.shape,this.dtype,t)}bufferSync(){return p.buffer(this.shape,this.dtype,this.dataSync())}async array(){const t=await this.data();return Object(i.toNestedArray)(this.shape,t,"complex64"===this.dtype)}arraySync(){return Object(i.toNestedArray)(this.shape,this.dataSync(),"complex64"===this.dtype)}async data(){this.throwIfDisposed();const t=d().read(this.dataId);if("string"===this.dtype){const e=await t;try{return e.map(t=>i.decodeString(t))}catch(t){throw new Error("Failed to decode the string bytes into utf-8. To get the original bytes, call tensor.bytes().")}}return t}dataToGPU(t){return this.throwIfDisposed(),d().readToGPU(this.dataId,t)}dataSync(){this.throwIfDisposed();const t=d().readSync(this.dataId);if("string"===this.dtype)try{return t.map(t=>i.decodeString(t))}catch(t){throw new Error("Failed to decode the string bytes into utf-8. To get the original bytes, call tensor.bytes().")}return t}async bytes(){this.throwIfDisposed();const t=await d().read(this.dataId);return"string"===this.dtype?t:new Uint8Array(t.buffer)}dispose(){this.isDisposed||(d().disposeTensor(this),this.isDisposedInternal=!0)}get isDisposed(){return this.isDisposedInternal}throwIfDisposed(){if(this.isDisposed)throw new Error("Tensor is disposed.")}print(t=!1){return p.print(this,t)}clone(){return this.throwIfDisposed(),p.clone(this)}toString(t=!1){return l(this.dataSync(),this.shape,this.dtype,t)}cast(t){return this.throwIfDisposed(),p.cast(this,t)}variable(t=!0,e,n){return this.throwIfDisposed(),d().makeVariable(this,t,e,n)}}e.a=g,Object.defineProperty(g,Symbol.hasInstance,{value:t=>!!t&&null!=t.data&&null!=t.dataSync&&null!=t.throwIfDisposed}),Object(r.a)("Tensor",()=>g);class m extends g{constructor(t,e,n,r){super(t.shape,t.dtype,t.dataId,r),this.trainable=e,this.name=n}assign(t){if(t.dtype!==this.dtype)throw new Error(`dtype of the new value (${t.dtype}) and `+`previous value (${this.dtype}) must match`);if(!i.arraysEqual(t.shape,this.shape))throw new Error(`shape of the new value (${t.shape}) and `+`previous value (${this.shape}) must match`);d().disposeTensor(this),this.dataId=t.dataId,d().incRef(this,null)}dispose(){d().disposeVariable(this),this.isDisposedInternal=!0}}e.c=m,Object.defineProperty(m,Symbol.hasInstance,{value:t=>t instanceof g&&null!=t.assign&&t.assign instanceof Function})},Xc4G:function(t,e,n){var r=n("lktj"),i=n("1kS7"),o=n("NpIQ");t.exports=function(t){var e=r(t),n=i.f;if(n)for(var s,a=n(t),l=o.f,u=0;a.length>u;)l.call(t,s=a[u++])&&e.push(s);return e}},Xd32:function(t,e,n){n("+tPU"),n("zQR9"),t.exports=n("5PlU")},XgCd:function(t,e,n){"use strict";var r=String.prototype.replace,i=/%20/g;t.exports={default:"RFC3986",formatters:{RFC1738:function(t){return r.call(t,i,"+")},RFC3986:function(t){return t}},RFC1738:"RFC1738",RFC3986:"RFC3986"}},XmWM:function(t,e,n){"use strict";var r=n("cGG2"),i=n("DQCr"),o=n("fuGk"),s=n("xLtR"),a=n("DUeU");function l(t){this.defaults=t,this.interceptors={request:new o,response:new o}}l.prototype.request=function(t){"string"==typeof t?(t=arguments[1]||{}).url=arguments[0]:t=t||{},(t=a(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var e=[s,void 0],n=Promise.resolve(t);for(this.interceptors.request.forEach(function(t){e.unshift(t.fulfilled,t.rejected)}),this.interceptors.response.forEach(function(t){e.push(t.fulfilled,t.rejected)});e.length;)n=n.then(e.shift(),e.shift());return n},l.prototype.getUri=function(t){return t=a(this.defaults,t),i(t.url,t.params,t.paramsSerializer).replace(/^\?/,"")},r.forEach(["delete","get","head","options"],function(t){l.prototype[t]=function(e,n){return this.request(a(n||{},{method:t,url:e,data:(n||{}).data}))}}),r.forEach(["post","put","patch"],function(t){l.prototype[t]=function(e,n,r){return this.request(a(r||{},{method:t,url:e,data:n}))}}),t.exports=l},Xxa5:function(t,e,n){t.exports=n("jyFz")},Y5mS:function(t,e,n){"use strict";var r,i=n("lFkc");i.canUseDOM&&(r=document.implementation&&document.implementation.hasFeature&&!0!==document.implementation.hasFeature("",""))
  1730. /**
  1731. * Checks if an event is supported in the current execution environment.
  1732. *
  1733. * NOTE: This will not work correctly for non-generic events such as `change`,
  1734. * `reset`, `load`, `error`, and `select`.
  1735. *
  1736. * Borrows from Modernizr.
  1737. *
  1738. * @param {string} eventNameSuffix Event name, e.g. "click".
  1739. * @param {?boolean} capture Check if the capture phase is supported.
  1740. * @return {boolean} True if the event is supported.
  1741. * @internal
  1742. * @license Modernizr 3.0.0pre (Custom Build) | MIT
  1743. */,t.exports=function(t,e){if(!i.canUseDOM||e&&!("addEventListener"in document))return!1;var n="on"+t,o=n in document;if(!o){var s=document.createElement("div");s.setAttribute(n,"return;"),o="function"==typeof s[n]}return!o&&r&&"wheel"===t&&(o=document.implementation.hasFeature("Events.wheel","3.0")),o}},YAhB:function(t,e,n){"use strict";var r=n("++K3"),i=n("Y5mS"),o=10,s=40,a=800;function l(t){var e=0,n=0,r=0,i=0;return"detail"in t&&(n=t.detail),"wheelDelta"in t&&(n=-t.wheelDelta/120),"wheelDeltaY"in t&&(n=-t.wheelDeltaY/120),"wheelDeltaX"in t&&(e=-t.wheelDeltaX/120),"axis"in t&&t.axis===t.HORIZONTAL_AXIS&&(e=n,n=0),r=e*o,i=n*o,"deltaY"in t&&(i=t.deltaY),"deltaX"in t&&(r=t.deltaX),(r||i)&&t.deltaMode&&(1==t.deltaMode?(r*=s,i*=s):(r*=a,i*=a)),r&&!e&&(e=r<1?-1:1),i&&!n&&(n=i<1?-1:1),{spinX:e,spinY:n,pixelX:r,pixelY:i}}l.getEventType=function(){return r.firefox()?"DOMMouseScroll":i("wheel")?"wheel":"mousewheel"},t.exports=l},Ya8g:function(t,e){},YeRv:function(t,e,n){var r;r=function(t){var e,n;return t.mode.OFB=(e=t.lib.BlockCipherMode.extend(),n=e.Encryptor=e.extend({processBlock:function(t,e){var n=this._cipher,r=n.blockSize,i=this._iv,o=this._keystream;i&&(o=this._keystream=i.slice(0),this._iv=void 0),n.encryptBlock(o,0);for(var s=0;s<r;s++)t[e+s]^=o[s]}}),e.Decryptor=n,e),t.mode.OFB},t.exports=r(n("02Hb"),n("fGru"))},Yobk:function(t,e,n){var r=n("77Pl"),i=n("qio6"),o=n("xnc9"),s=n("ax3d")("IE_PROTO"),a=function(){},l=function(){var t,e=n("ON07")("iframe"),r=o.length;for(e.style.display="none",n("RPLV").appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),l=t.F;r--;)delete l.prototype[o[r]];return l()};t.exports=Object.create||function(t,e){var n;return null!==t?(a.prototype=r(t),n=new a,a.prototype=null,n[s]=t):n=l(),void 0===e?n:i(n,e)}},ZD6k:function(t,e,n){"use strict";e.b=s,e.a=function(t,e,n){null==n&&(n=s());if(!a(t,e,n))throw new Error(`Numbers differ: actual === ${t}, expected === ${e}`)};var r=n("Kkag");n("xMQ1"),n("XFvI");
  1744. /**
  1745. * @license
  1746. * Copyright 2017 Google LLC. All Rights Reserved.
  1747. * Licensed under the Apache License, Version 2.0 (the "License");
  1748. * you may not use this file except in compliance with the License.
  1749. * You may obtain a copy of the License at
  1750. *
  1751. * http://www.apache.org/licenses/LICENSE-2.0
  1752. *
  1753. * Unless required by applicable law or agreed to in writing, software
  1754. * distributed under the License is distributed on an "AS IS" BASIS,
  1755. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1756. * See the License for the specific language governing permissions and
  1757. * limitations under the License.
  1758. * =============================================================================
  1759. */
  1760. const i=.001,o=.1;function s(){return 32===r.a.backend.floatPrecision()?i:o}function a(t,e,n){return!isFinite(t)&&!isFinite(e)||!(isNaN(t)||isNaN(e)||Math.abs(t-e)>n)}},Zcwg:function(t,e,n){"use strict";e.__esModule=!0;var r=n("2kvA");var i=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return t.prototype.beforeEnter=function(t){(0,r.addClass)(t,"collapse-transition"),t.dataset||(t.dataset={}),t.dataset.oldPaddingTop=t.style.paddingTop,t.dataset.oldPaddingBottom=t.style.paddingBottom,t.style.height="0",t.style.paddingTop=0,t.style.paddingBottom=0},t.prototype.enter=function(t){t.dataset.oldOverflow=t.style.overflow,0!==t.scrollHeight?(t.style.height=t.scrollHeight+"px",t.style.paddingTop=t.dataset.oldPaddingTop,t.style.paddingBottom=t.dataset.oldPaddingBottom):(t.style.height="",t.style.paddingTop=t.dataset.oldPaddingTop,t.style.paddingBottom=t.dataset.oldPaddingBottom),t.style.overflow="hidden"},t.prototype.afterEnter=function(t){(0,r.removeClass)(t,"collapse-transition"),t.style.height="",t.style.overflow=t.dataset.oldOverflow},t.prototype.beforeLeave=function(t){t.dataset||(t.dataset={}),t.dataset.oldPaddingTop=t.style.paddingTop,t.dataset.oldPaddingBottom=t.style.paddingBottom,t.dataset.oldOverflow=t.style.overflow,t.style.height=t.scrollHeight+"px",t.style.overflow="hidden"},t.prototype.leave=function(t){0!==t.scrollHeight&&((0,r.addClass)(t,"collapse-transition"),t.style.height=0,t.style.paddingTop=0,t.style.paddingBottom=0)},t.prototype.afterLeave=function(t){(0,r.removeClass)(t,"collapse-transition"),t.style.height="",t.style.overflow=t.dataset.oldOverflow,t.style.paddingTop=t.dataset.oldPaddingTop,t.style.paddingBottom=t.dataset.oldPaddingBottom},t}();e.default={name:"ElCollapseTransition",functional:!0,render:function(t,e){var n=e.children;return t("transition",{on:new i},n)}}},Zrlr:function(t,e,n){"use strict";e.__esModule=!0,e.default=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},Zzip:function(t,e,n){t.exports={default:n("/n6Q"),__esModule:!0}},a0oK:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.json=[{tfOpName:"FusedBatchNorm",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"scale",type:"tensor"},{start:2,name:"offset",type:"tensor"},{start:3,name:"mean",type:"tensor"},{start:4,name:"variance",type:"tensor"}],attrs:[{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:.001},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"FusedBatchNormV2",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"scale",type:"tensor"},{start:2,name:"offset",type:"tensor"},{start:3,name:"mean",type:"tensor"},{start:4,name:"variance",type:"tensor"}],attrs:[{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:.001},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"FusedBatchNormV3",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"scale",type:"tensor"},{start:2,name:"offset",type:"tensor"},{start:3,name:"mean",type:"tensor"},{start:4,name:"variance",type:"tensor"}],attrs:[{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:.001},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"LRN",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"depth_radius",name:"radius",type:"number",defaultValue:5},{tfName:"bias",name:"bias",type:"number",defaultValue:1},{tfName:"alpha",name:"alpha",type:"number",defaultValue:1},{tfName:"beta",name:"beta",type:"number",defaultValue:.5}]},{tfOpName:"Softmax",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"LogSoftmax",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"SparseToDense",category:"normalization",inputs:[{start:0,name:"sparseIndices",type:"tensor"},{start:1,name:"outputShape",type:"number[]"},{start:2,name:"sparseValues",type:"tensor"},{start:3,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"validate_indices",name:"validateIndices",type:"bool",defaultValue:!0,notSupported:!0}]}]},aMwW:function(t,e,n){t.exports=function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/dist/",n(n.s=135)}({135:function(t,e,n){"use strict";n.r(e);var r=n(5),i=n.n(r),o=n(17),s=n.n(o),a=n(2),l=n(3),u=n(7),c=n.n(u),h={name:"ElTooltip",mixins:[i.a],props:{openDelay:{type:Number,default:0},disabled:Boolean,manual:Boolean,effect:{type:String,default:"dark"},arrowOffset:{type:Number,default:0},popperClass:String,content:String,visibleArrow:{default:!0},transition:{type:String,default:"el-fade-in-linear"},popperOptions:{default:function(){return{boundariesPadding:10,gpuAcceleration:!1}}},enterable:{type:Boolean,default:!0},hideAfter:{type:Number,default:0},tabindex:{type:Number,default:0}},data:function(){return{tooltipId:"el-tooltip-"+Object(l.generateId)(),timeoutPending:null,focusing:!1}},beforeCreate:function(){var t=this;this.$isServer||(this.popperVM=new c.a({data:{node:""},render:function(t){return this.node}}).$mount(),this.debounceClose=s()(200,function(){return t.handleClosePopper()}))},render:function(t){var e=this;this.popperVM&&(this.popperVM.node=t("transition",{attrs:{name:this.transition},on:{afterLeave:this.doDestroy}},[t("div",{on:{mouseleave:function(){e.setExpectedState(!1),e.debounceClose()},mouseenter:function(){e.setExpectedState(!0)}},ref:"popper",attrs:{role:"tooltip",id:this.tooltipId,"aria-hidden":this.disabled||!this.showPopper?"true":"false"},directives:[{name:"show",value:!this.disabled&&this.showPopper}],class:["el-tooltip__popper","is-"+this.effect,this.popperClass]},[this.$slots.content||this.content])]));var n=this.getFirstElement();if(!n)return null;var r=n.data=n.data||{};return r.staticClass=this.addTooltipClass(r.staticClass),n},mounted:function(){var t=this;this.referenceElm=this.$el,1===this.$el.nodeType&&(this.$el.setAttribute("aria-describedby",this.tooltipId),this.$el.setAttribute("tabindex",this.tabindex),Object(a.on)(this.referenceElm,"mouseenter",this.show),Object(a.on)(this.referenceElm,"mouseleave",this.hide),Object(a.on)(this.referenceElm,"focus",function(){if(t.$slots.default&&t.$slots.default.length){var e=t.$slots.default[0].componentInstance;e&&e.focus?e.focus():t.handleFocus()}else t.handleFocus()}),Object(a.on)(this.referenceElm,"blur",this.handleBlur),Object(a.on)(this.referenceElm,"click",this.removeFocusing)),this.value&&this.popperVM&&this.popperVM.$nextTick(function(){t.value&&t.updatePopper()})},watch:{focusing:function(t){t?Object(a.addClass)(this.referenceElm,"focusing"):Object(a.removeClass)(this.referenceElm,"focusing")}},methods:{show:function(){this.setExpectedState(!0),this.handleShowPopper()},hide:function(){this.setExpectedState(!1),this.debounceClose()},handleFocus:function(){this.focusing=!0,this.show()},handleBlur:function(){this.focusing=!1,this.hide()},removeFocusing:function(){this.focusing=!1},addTooltipClass:function(t){return t?"el-tooltip "+t.replace("el-tooltip",""):"el-tooltip"},handleShowPopper:function(){var t=this;this.expectedState&&!this.manual&&(clearTimeout(this.timeout),this.timeout=setTimeout(function(){t.showPopper=!0},this.openDelay),this.hideAfter>0&&(this.timeoutPending=setTimeout(function(){t.showPopper=!1},this.hideAfter)))},handleClosePopper:function(){this.enterable&&this.expectedState||this.manual||(clearTimeout(this.timeout),this.timeoutPending&&clearTimeout(this.timeoutPending),this.showPopper=!1,this.disabled&&this.doDestroy())},setExpectedState:function(t){!1===t&&clearTimeout(this.timeoutPending),this.expectedState=t},getFirstElement:function(){var t=this.$slots.default;if(!Array.isArray(t))return null;for(var e=null,n=0;n<t.length;n++)t[n]&&t[n].tag&&(e=t[n]);return e}},beforeDestroy:function(){this.popperVM&&this.popperVM.$destroy()},destroyed:function(){var t=this.referenceElm;1===t.nodeType&&(Object(a.off)(t,"mouseenter",this.show),Object(a.off)(t,"mouseleave",this.hide),Object(a.off)(t,"focus",this.handleFocus),Object(a.off)(t,"blur",this.handleBlur),Object(a.off)(t,"click",this.removeFocusing))},install:function(t){t.component(h.name,h)}};e.default=h},17:function(t,e){t.exports=n("ON3O")},2:function(t,e){t.exports=n("2kvA")},3:function(t,e){t.exports=n("ylDJ")},5:function(t,e){t.exports=n("fKx3")},7:function(t,e){t.exports=n("7+uW")}})},aW5l:function(t,e,n){"use strict";e.__esModule=!0;n("ylDJ");e.default={mounted:function(){},methods:{getMigratingConfig:function(){return{props:{},events:{}}}}}},aYFL:function(t,e,n){"use strict";e.b=function(t,e){const n=u(t,e);return o.get(n)},e.a=function(t){return s.get(t)},e.c=a,e.d=l;n("v/P2");var r=n("Nhog"),i=n("QSAg");
  1761. /**
  1762. * @license
  1763. * Copyright 2019 Google LLC. All Rights Reserved.
  1764. * Licensed under the Apache License, Version 2.0 (the "License");
  1765. * you may not use this file except in compliance with the License.
  1766. * You may obtain a copy of the License at
  1767. *
  1768. * http://www.apache.org/licenses/LICENSE-2.0
  1769. *
  1770. * Unless required by applicable law or agreed to in writing, software
  1771. * distributed under the License is distributed on an "AS IS" BASIS,
  1772. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1773. * See the License for the specific language governing permissions and
  1774. * limitations under the License.
  1775. * =============================================================================
  1776. */
  1777. const o=Object(r.a)("kernelRegistry",()=>new Map),s=Object(r.a)("gradRegistry",()=>new Map);function a(t){const e=o.entries(),n=[];for(;;){const{done:r,value:i}=e.next();if(r)break;const[o,s]=i,[a]=o.split("_");a===t&&n.push(s)}return n}function l(t){const{kernelName:e,backendName:n}=t,r=u(e,n);o.has(r)&&i.b(`The kernel '${e}' for backend `+`'${n}' is already registered`),o.set(r,t)}function u(t,e){return`${e}_${t}`}},ax3d:function(t,e,n){var r=n("e8AB")("keys"),i=n("3Eo+");t.exports=function(t){return r[t]||(r[t]=i(t))}},bBGs:function(t,e,n){var r;r=function(t){var e,n,r,i,o,s,a,l;return n=(e=t).lib,r=n.Base,i=n.WordArray,o=e.algo,s=o.SHA1,a=o.HMAC,l=o.PBKDF2=r.extend({cfg:r.extend({keySize:4,hasher:s,iterations:1}),init:function(t){this.cfg=this.cfg.extend(t)},compute:function(t,e){for(var n=this.cfg,r=a.create(n.hasher,t),o=i.create(),s=i.create([1]),l=o.words,u=s.words,c=n.keySize,h=n.iterations;l.length<c;){var d=r.update(e).finalize(s);r.reset();for(var p=d.words,f=p.length,g=d,m=1;m<h;m++){g=r.finalize(g),r.reset();for(var v=g.words,b=0;b<f;b++)p[b]^=v[b]}o.concat(d),u[0]++}return o.sigBytes=4*c,o}}),e.PBKDF2=function(t,e,n){return l.create(n).compute(t,e)},t.PBKDF2},t.exports=r(n("02Hb"),n("Ff/Y"),n("PIk1"))},bDWH:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getBroadcastDims=
  1778. /**
  1779. * @license
  1780. * Copyright 2017 Google LLC. All Rights Reserved.
  1781. * Licensed under the Apache License, Version 2.0 (the "License");
  1782. * you may not use this file except in compliance with the License.
  1783. * You may obtain a copy of the License at
  1784. *
  1785. * http://www.apache.org/licenses/LICENSE-2.0
  1786. *
  1787. * Unless required by applicable law or agreed to in writing, software
  1788. * distributed under the License is distributed on an "AS IS" BASIS,
  1789. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1790. * See the License for the specific language governing permissions and
  1791. * limitations under the License.
  1792. * =============================================================================
  1793. */
  1794. function(t,e){const n=t.length,r=[];for(let i=0;i<n;i++){const o=n-1-i,s=t[o]||1,a=e[e.length-1-i]||1;a>1&&1===s&&r.unshift(o)}return r},e.getReductionAxes=function(t,e){const n=[];for(let r=0;r<e.length;r++){const i=t[t.length-r-1],o=e.length-r-1,s=e[o];(null==i||1===i&&s>1)&&n.unshift(o)}return n},e.assertAndGetBroadcastShape=function(t,e){const n=[],r=Math.max(t.length,e.length);for(let i=0;i<r;i++){let r=t[t.length-i-1];null==r&&(r=1);let o=e[e.length-i-1];if(null==o&&(o=1),1===r)n.unshift(o);else if(1===o)n.unshift(r);else{if(r!==o){const n="Operands could not be broadcast together with shapes "+`${t} and ${e}.`;throw Error(n)}n.unshift(r)}}return n}},bRrM:function(t,e,n){"use strict";var r=n("7KvD"),i=n("FeBl"),o=n("evD5"),s=n("+E39"),a=n("dSzd")("species");t.exports=function(t){var e="function"==typeof i[t]?i[t]:r[t];s&&e&&!e[a]&&o.f(e,a,{configurable:!0,get:function(){return this}})}},"c/Tr":function(t,e,n){t.exports={default:n("5zde"),__esModule:!0}},cGG2:function(t,e,n){"use strict";var r=n("JP+z"),i=Object.prototype.toString;function o(t){return"[object Array]"===i.call(t)}function s(t){return void 0===t}function a(t){return null!==t&&"object"==typeof t}function l(t){if("[object Object]"!==i.call(t))return!1;var e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}function u(t){return"[object Function]"===i.call(t)}function c(t,e){if(null!==t&&void 0!==t)if("object"!=typeof t&&(t=[t]),o(t))for(var n=0,r=t.length;n<r;n++)e.call(null,t[n],n,t);else for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.call(null,t[i],i,t)}t.exports={isArray:o,isArrayBuffer:function(t){return"[object ArrayBuffer]"===i.call(t)},isBuffer:function(t){return null!==t&&!s(t)&&null!==t.constructor&&!s(t.constructor)&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)},isFormData:function(t){return"undefined"!=typeof FormData&&t instanceof FormData},isArrayBufferView:function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&t.buffer instanceof ArrayBuffer},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isObject:a,isPlainObject:l,isUndefined:s,isDate:function(t){return"[object Date]"===i.call(t)},isFile:function(t){return"[object File]"===i.call(t)},isBlob:function(t){return"[object Blob]"===i.call(t)},isFunction:u,isStream:function(t){return a(t)&&u(t.pipe)},isURLSearchParams:function(t){return"undefined"!=typeof URLSearchParams&&t instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:c,merge:function t(){var e={};function n(n,r){l(e[r])&&l(n)?e[r]=t(e[r],n):l(n)?e[r]=t({},n):o(n)?e[r]=n.slice():e[r]=n}for(var r=0,i=arguments.length;r<i;r++)c(arguments[r],n);return e},extend:function(t,e,n){return c(e,function(e,i){t[i]=n&&"function"==typeof e?r(e,n):e}),t},trim:function(t){return t.replace(/^\s*/,"").replace(/\s*$/,"")},stripBOM:function(t){return 65279===t.charCodeAt(0)&&(t=t.slice(1)),t}}},cTqU:function(t,e,n){"use strict";e.a=
  1795. /**
  1796. * @license
  1797. * Copyright 2018 Google LLC. All Rights Reserved.
  1798. * Licensed under the Apache License, Version 2.0 (the "License");
  1799. * you may not use this file except in compliance with the License.
  1800. * You may obtain a copy of the License at
  1801. *
  1802. * http://www.apache.org/licenses/LICENSE-2.0
  1803. *
  1804. * Unless required by applicable law or agreed to in writing, software
  1805. * distributed under the License is distributed on an "AS IS" BASIS,
  1806. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1807. * See the License for the specific language governing permissions and
  1808. * limitations under the License.
  1809. * =============================================================================
  1810. */
  1811. function(t,e){const n=[];for(let t=0;t<e.length;t++)e[t]&&n.push(t);const i=Object(r.a)(t,"int32"),o=Object(r.a)([n.length,t.length],"int32");for(let e=0;e<n.length;e++){const r=i.indexToLoc(n[e]),s=e*t.length;o.values.set(r,s)}return o.toTensor()};var r=n("SnLv")},cWxy:function(t,e,n){"use strict";var r=n("dVOP");function i(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise(function(t){e=t});var n=this;t(function(t){n.reason||(n.reason=new r(t),e(n.reason))})}i.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},i.source=function(){var t;return{token:new i(function(e){t=e}),cancel:t}},t.exports=i},crlp:function(t,e,n){var r=n("7KvD"),i=n("FeBl"),o=n("O4g8"),s=n("Kh4W"),a=n("evD5").f;t.exports=function(t){var e=i.Symbol||(i.Symbol=o?{}:r.Symbol||{});"_"==t.charAt(0)||t in e||a(e,t,{value:s.f(t)})}},d7EF:function(t,e,n){"use strict";e.__esModule=!0;var r=o(n("us/S")),i=o(n("BO1k"));function o(t){return t&&t.__esModule?t:{default:t}}e.default=function(){return function(t,e){if(Array.isArray(t))return t;if((0,r.default)(Object(t)))return function(t,e){var n=[],r=!0,o=!1,s=void 0;try{for(var a,l=(0,i.default)(t);!(r=(a=l.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,s=t}finally{try{!r&&l.return&&l.return()}finally{if(o)throw s}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}()},dHLy:function(t,e,n){"use strict";var r=n("Kkag"),i=n("l5jf"),o=n("jb1O"),s=n("xMQ1"),a=n("bDWH"),l=n("MlK1"),u=n("35G1");const c=Object(u.a)({maximum_:
  1812. /**
  1813. * @license
  1814. * Copyright 2020 Google LLC. All Rights Reserved.
  1815. * Licensed under the Apache License, Version 2.0 (the "License");
  1816. * you may not use this file except in compliance with the License.
  1817. * You may obtain a copy of the License at
  1818. *
  1819. * http://www.apache.org/licenses/LICENSE-2.0
  1820. *
  1821. * Unless required by applicable law or agreed to in writing, software
  1822. * distributed under the License is distributed on an "AS IS" BASIS,
  1823. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1824. * See the License for the specific language governing permissions and
  1825. * limitations under the License.
  1826. * =============================================================================
  1827. */
  1828. function(t,e){let n=Object(s.a)(t,"a","maximum"),u=Object(s.a)(e,"b","maximum");[n,u]=Object(o.c)(n,u),"bool"===n.dtype&&(n=Object(l.a)(n,"int32"),u=Object(l.a)(u,"int32")),Object(a.assertAndGetBroadcastShape)(n.shape,u.shape);const c={a:n,b:u};return r.a.runKernel(i._37,c)}});e.a=c},dIwP:function(t,e,n){"use strict";t.exports=function(t){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t)}},dNDb:function(t,e){t.exports=function(t){try{return{e:!1,v:t()}}catch(t){return{e:!0,v:t}}}},dSzd:function(t,e,n){var r=n("e8AB")("wks"),i=n("3Eo+"),o=n("7KvD").Symbol,s="function"==typeof o;(t.exports=function(t){return r[t]||(r[t]=s&&o[t]||(s?o:i)("Symbol."+t))}).store=r},dVOP:function(t,e,n){"use strict";function r(t){this.message=t}r.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},r.prototype.__CANCEL__=!0,t.exports=r},dY0y:function(t,e,n){var r=n("dSzd")("iterator"),i=!1;try{var o=[7][r]();o.return=function(){i=!0},Array.from(o,function(){throw 2})}catch(t){}t.exports=function(t,e){if(!e&&!i)return!1;var n=!1;try{var o=[7],s=o[r]();s.next=function(){return{done:n=!0}},o[r]=function(){return s},t(o)}catch(t){}return n}},dZfa:function(t,e,n){"use strict";var r=n("Kkag"),i=n("l5jf"),o=n("jb1O"),s=n("xMQ1"),a=n("35G1");const l=Object(a.a)({mul_:
  1829. /**
  1830. * @license
  1831. * Copyright 2020 Google LLC. All Rights Reserved.
  1832. * Licensed under the Apache License, Version 2.0 (the "License");
  1833. * you may not use this file except in compliance with the License.
  1834. * You may obtain a copy of the License at
  1835. *
  1836. * http://www.apache.org/licenses/LICENSE-2.0
  1837. *
  1838. * Unless required by applicable law or agreed to in writing, software
  1839. * distributed under the License is distributed on an "AS IS" BASIS,
  1840. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1841. * See the License for the specific language governing permissions and
  1842. * limitations under the License.
  1843. * =============================================================================
  1844. */
  1845. function(t,e){let n=Object(s.a)(t,"a","mul"),a=Object(s.a)(e,"b","mul");[n,a]=Object(o.c)(n,a);const l={a:n,b:a};return r.a.runKernel(i._44,l)}});e.a=l},"di0+":function(t,e,n){(function(t){var r;!function(t,i,o){function s(t,e){return e.x=t.x,e.y=t.y,e.z=t.z,e.w=t.w,e}function a(t,e){var n=new function(t){var e=this,n="";e.x=0,e.y=0,e.z=0,e.w=0,e.next=function(){var t=e.x^e.x<<11;return e.x=e.y,e.y=e.z,e.z=e.w,e.w^=e.w>>>19^t^t>>>8},t===(0|t)?e.x=t:n+=t;for(var r=0;r<n.length+64;r++)e.x^=0|n.charCodeAt(r),e.next()}(t),r=e&&e.state,i=function(){return(n.next()>>>0)/4294967296};return i.double=function(){do{var t=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},i.int32=n.next,i.quick=i,r&&("object"==typeof r&&s(r,n),i.state=function(){return s(n,{})}),i}i&&i.exports?i.exports=a:n("LGuY")&&n("nErl")?void 0===(r=function(){return a}.call(e,n,e,i))||(i.exports=r):this.xor128=a}(0,"object"==typeof t&&t,n("LGuY"))}).call(e,n("3IRH")(t))},dmtG:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.json=[{tfOpName:"Equal",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"NotEqual",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Greater",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"GreaterEqual",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Less",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LessEqual",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LogicalAnd",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LogicalNot",category:"logical",inputs:[{start:0,name:"a",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LogicalOr",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Select",category:"logical",inputs:[{start:0,name:"condition",type:"tensor"},{start:1,name:"a",type:"tensor"},{start:2,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"SelectV2",category:"logical",inputs:[{start:0,name:"condition",type:"tensor"},{start:1,name:"a",type:"tensor"},{start:2,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}]},drMw:function(t,e,n){var r;r=function(t){return function(){var e=t,n=e.lib.WordArray,r=e.enc;r.Utf16=r.Utf16BE={stringify:function(t){for(var e=t.words,n=t.sigBytes,r=[],i=0;i<n;i+=2){var o=e[i>>>2]>>>16-i%4*8&65535;r.push(String.fromCharCode(o))}return r.join("")},parse:function(t){for(var e=t.length,r=[],i=0;i<e;i++)r[i>>>1]|=t.charCodeAt(i)<<16-i%2*16;return n.create(r,2*e)}};function i(t){return t<<8&4278255360|t>>>8&16711935}r.Utf16LE={stringify:function(t){for(var e=t.words,n=t.sigBytes,r=[],o=0;o<n;o+=2){var s=i(e[o>>>2]>>>16-o%4*8&65535);r.push(String.fromCharCode(s))}return r.join("")},parse:function(t){for(var e=t.length,r=[],o=0;o<e;o++)r[o>>>1]|=i(t.charCodeAt(o)<<16-o%2*16);return n.create(r,2*e)}}}(),t.enc.Utf16},t.exports=r(n("02Hb"))},dxT3:function(t,e,n){"use strict";(function(t){e.a=function(){var e=t.Canvas||t.HTMLCanvasElement,n=t.Image||t.HTMLImageElement,o=t.fetch||function(){throw new Error("fetch - missing fetch implementation for nodejs environment")},s=Object(i.a)();return Object(r.a)({Canvas:e||function(){return function(){}}(),CanvasRenderingContext2D:t.CanvasRenderingContext2D||function(){return function(){}}(),Image:n||function(){return function(){}}(),ImageData:t.ImageData||function(){return function(){}}(),Video:t.HTMLVideoElement||function(){return function(){}}(),createCanvasElement:function(){if(e)return new e;throw new Error("createCanvasElement - missing Canvas implementation for nodejs environment")},createImageElement:function(){if(n)return new n;throw new Error("createImageElement - missing Image implementation for nodejs environment")},fetch:o},s)};var r=n("TToO"),i=n("pcbz")}).call(e,n("DuR2"))},e0Bm:function(t,e,n){t.exports=function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/dist/",n(n.s=60)}({0:function(t,e,n){"use strict";function r(t,e,n,r,i,o,s,a){var l,u="function"==typeof t?t.options:t;if(e&&(u.render=e,u.staticRenderFns=n,u._compiled=!0),r&&(u.functional=!0),o&&(u._scopeId="data-v-"+o),s?(l=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(s)},u._ssrRegister=l):i&&(l=a?function(){i.call(this,this.$root.$options.shadowRoot)}:i),l)if(u.functional){u._injectStyles=l;var c=u.render;u.render=function(t,e){return l.call(e),c(t,e)}}else{var h=u.beforeCreate;u.beforeCreate=h?[].concat(h,l):[l]}return{exports:t,options:u}}n.d(e,"a",function(){return r})},10:function(t,e){t.exports=n("HJMx")},12:function(t,e){t.exports=n("ISYW")},15:function(t,e){t.exports=n("fEB+")},16:function(t,e){t.exports=n("02w1")},17:function(t,e){t.exports=n("ON3O")},21:function(t,e){t.exports=n("E/in")},22:function(t,e){t.exports=n("1oZe")},3:function(t,e){t.exports=n("ylDJ")},31:function(t,e){t.exports=n("zTCi")},33:function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("li",{directives:[{name:"show",rawName:"v-show",value:t.visible,expression:"visible"}],staticClass:"el-select-dropdown__item",class:{selected:t.itemSelected,"is-disabled":t.disabled||t.groupDisabled||t.limitReached,hover:t.hover},on:{mouseenter:t.hoverItem,click:function(e){return e.stopPropagation(),t.selectOptionClick(e)}}},[t._t("default",[n("span",[t._v(t._s(t.currentLabel))])])],2)};r._withStripped=!0;var i=n(4),o=n.n(i),s=n(3),a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},l={mixins:[o.a],name:"ElOption",componentName:"ElOption",inject:["select"],props:{value:{required:!0},label:[String,Number],created:Boolean,disabled:{type:Boolean,default:!1}},data:function(){return{index:-1,groupDisabled:!1,visible:!0,hitState:!1,hover:!1}},computed:{isObject:function(){return"[object object]"===Object.prototype.toString.call(this.value).toLowerCase()},currentLabel:function(){return this.label||(this.isObject?"":this.value)},currentValue:function(){return this.value||this.label||""},itemSelected:function(){return this.select.multiple?this.contains(this.select.value,this.value):this.isEqual(this.value,this.select.value)},limitReached:function(){return!!this.select.multiple&&(!this.itemSelected&&(this.select.value||[]).length>=this.select.multipleLimit&&this.select.multipleLimit>0)}},watch:{currentLabel:function(){this.created||this.select.remote||this.dispatch("ElSelect","setSelected")},value:function(t,e){var n=this.select,r=n.remote,i=n.valueKey;if(!this.created&&!r){if(i&&"object"===(void 0===t?"undefined":a(t))&&"object"===(void 0===e?"undefined":a(e))&&t[i]===e[i])return;this.dispatch("ElSelect","setSelected")}}},methods:{isEqual:function(t,e){if(this.isObject){var n=this.select.valueKey;return Object(s.getValueByPath)(t,n)===Object(s.getValueByPath)(e,n)}return t===e},contains:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments[1];if(this.isObject){var n=this.select.valueKey;return t&&t.some(function(t){return Object(s.getValueByPath)(t,n)===Object(s.getValueByPath)(e,n)})}return t&&t.indexOf(e)>-1},handleGroupDisabled:function(t){this.groupDisabled=t},hoverItem:function(){this.disabled||this.groupDisabled||(this.select.hoverIndex=this.select.options.indexOf(this))},selectOptionClick:function(){!0!==this.disabled&&!0!==this.groupDisabled&&this.dispatch("ElSelect","handleOptionClick",[this,!0])},queryChange:function(t){this.visible=new RegExp(Object(s.escapeRegexpString)(t),"i").test(this.currentLabel)||this.created,this.visible||this.select.filteredOptionsCount--}},created:function(){this.select.options.push(this),this.select.cachedOptions.push(this),this.select.optionsCount++,this.select.filteredOptionsCount++,this.$on("queryChange",this.queryChange),this.$on("handleGroupDisabled",this.handleGroupDisabled)},beforeDestroy:function(){var t=this.select,e=t.selected,n=t.multiple?e:[e],r=this.select.cachedOptions.indexOf(this),i=n.indexOf(this);r>-1&&i<0&&this.select.cachedOptions.splice(r,1),this.select.onOptionDestroy(this.select.options.indexOf(this))}},u=n(0),c=Object(u.a)(l,r,[],!1,null,null,null);c.options.__file="packages/select/src/option.vue";e.a=c.exports},37:function(t,e){t.exports=n("orbS")},4:function(t,e){t.exports=n("fPll")},5:function(t,e){t.exports=n("fKx3")},6:function(t,e){t.exports=n("y+7x")},60:function(t,e,n){"use strict";n.r(e);var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{directives:[{name:"clickoutside",rawName:"v-clickoutside",value:t.handleClose,expression:"handleClose"}],staticClass:"el-select",class:[t.selectSize?"el-select--"+t.selectSize:""],on:{click:function(e){return e.stopPropagation(),t.toggleMenu(e)}}},[t.multiple?n("div",{ref:"tags",staticClass:"el-select__tags",style:{"max-width":t.inputWidth-32+"px",width:"100%"}},[t.collapseTags&&t.selected.length?n("span",[n("el-tag",{attrs:{closable:!t.selectDisabled,size:t.collapseTagSize,hit:t.selected[0].hitState,type:"info","disable-transitions":""},on:{close:function(e){t.deleteTag(e,t.selected[0])}}},[n("span",{staticClass:"el-select__tags-text"},[t._v(t._s(t.selected[0].currentLabel))])]),t.selected.length>1?n("el-tag",{attrs:{closable:!1,size:t.collapseTagSize,type:"info","disable-transitions":""}},[n("span",{staticClass:"el-select__tags-text"},[t._v("+ "+t._s(t.selected.length-1))])]):t._e()],1):t._e(),t.collapseTags?t._e():n("transition-group",{on:{"after-leave":t.resetInputHeight}},t._l(t.selected,function(e){return n("el-tag",{key:t.getValueKey(e),attrs:{closable:!t.selectDisabled,size:t.collapseTagSize,hit:e.hitState,type:"info","disable-transitions":""},on:{close:function(n){t.deleteTag(n,e)}}},[n("span",{staticClass:"el-select__tags-text"},[t._v(t._s(e.currentLabel))])])}),1),t.filterable?n("input",{directives:[{name:"model",rawName:"v-model",value:t.query,expression:"query"}],ref:"input",staticClass:"el-select__input",class:[t.selectSize?"is-"+t.selectSize:""],style:{"flex-grow":"1",width:t.inputLength/(t.inputWidth-32)+"%","max-width":t.inputWidth-42+"px"},attrs:{type:"text",disabled:t.selectDisabled,autocomplete:t.autoComplete||t.autocomplete},domProps:{value:t.query},on:{focus:t.handleFocus,blur:function(e){t.softFocus=!1},keyup:t.managePlaceholder,keydown:[t.resetInputState,function(e){if(!("button"in e)&&t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"]))return null;e.preventDefault(),t.navigateOptions("next")},function(e){if(!("button"in e)&&t._k(e.keyCode,"up",38,e.key,["Up","ArrowUp"]))return null;e.preventDefault(),t.navigateOptions("prev")},function(e){return"button"in e||!t._k(e.keyCode,"enter",13,e.key,"Enter")?(e.preventDefault(),t.selectOption(e)):null},function(e){if(!("button"in e)&&t._k(e.keyCode,"esc",27,e.key,["Esc","Escape"]))return null;e.stopPropagation(),e.preventDefault(),t.visible=!1},function(e){return"button"in e||!t._k(e.keyCode,"delete",[8,46],e.key,["Backspace","Delete","Del"])?t.deletePrevTag(e):null},function(e){if(!("button"in e)&&t._k(e.keyCode,"tab",9,e.key,"Tab"))return null;t.visible=!1}],compositionstart:t.handleComposition,compositionupdate:t.handleComposition,compositionend:t.handleComposition,input:[function(e){e.target.composing||(t.query=e.target.value)},t.debouncedQueryChange]}}):t._e()],1):t._e(),n("el-input",{ref:"reference",class:{"is-focus":t.visible},attrs:{type:"text",placeholder:t.currentPlaceholder,name:t.name,id:t.id,autocomplete:t.autoComplete||t.autocomplete,size:t.selectSize,disabled:t.selectDisabled,readonly:t.readonly,"validate-event":!1,tabindex:t.multiple&&t.filterable?"-1":null},on:{focus:t.handleFocus,blur:t.handleBlur},nativeOn:{keyup:function(e){return t.debouncedOnInputChange(e)},keydown:[function(e){if(!("button"in e)&&t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"]))return null;e.stopPropagation(),e.preventDefault(),t.navigateOptions("next")},function(e){if(!("button"in e)&&t._k(e.keyCode,"up",38,e.key,["Up","ArrowUp"]))return null;e.stopPropagation(),e.preventDefault(),t.navigateOptions("prev")},function(e){return"button"in e||!t._k(e.keyCode,"enter",13,e.key,"Enter")?(e.preventDefault(),t.selectOption(e)):null},function(e){if(!("button"in e)&&t._k(e.keyCode,"esc",27,e.key,["Esc","Escape"]))return null;e.stopPropagation(),e.preventDefault(),t.visible=!1},function(e){if(!("button"in e)&&t._k(e.keyCode,"tab",9,e.key,"Tab"))return null;t.visible=!1}],paste:function(e){return t.debouncedOnInputChange(e)},mouseenter:function(e){t.inputHovering=!0},mouseleave:function(e){t.inputHovering=!1}},model:{value:t.selectedLabel,callback:function(e){t.selectedLabel=e},expression:"selectedLabel"}},[t.$slots.prefix?n("template",{slot:"prefix"},[t._t("prefix")],2):t._e(),n("template",{slot:"suffix"},[n("i",{directives:[{name:"show",rawName:"v-show",value:!t.showClose,expression:"!showClose"}],class:["el-select__caret","el-input__icon","el-icon-"+t.iconClass]}),t.showClose?n("i",{staticClass:"el-select__caret el-input__icon el-icon-circle-close",on:{click:t.handleClearClick}}):t._e()])],2),n("transition",{attrs:{name:"el-zoom-in-top"},on:{"before-enter":t.handleMenuEnter,"after-leave":t.doDestroy}},[n("el-select-menu",{directives:[{name:"show",rawName:"v-show",value:t.visible&&!1!==t.emptyText,expression:"visible && emptyText !== false"}],ref:"popper",attrs:{"append-to-body":t.popperAppendToBody}},[n("el-scrollbar",{directives:[{name:"show",rawName:"v-show",value:t.options.length>0&&!t.loading,expression:"options.length > 0 && !loading"}],ref:"scrollbar",class:{"is-empty":!t.allowCreate&&t.query&&0===t.filteredOptionsCount},attrs:{tag:"ul","wrap-class":"el-select-dropdown__wrap","view-class":"el-select-dropdown__list"}},[t.showNewOption?n("el-option",{attrs:{value:t.query,created:""}}):t._e(),t._t("default")],2),t.emptyText&&(!t.allowCreate||t.loading||t.allowCreate&&0===t.options.length)?[t.$slots.empty?t._t("empty"):n("p",{staticClass:"el-select-dropdown__empty"},[t._v("\n "+t._s(t.emptyText)+"\n ")])]:t._e()],2)],1)],1)};r._withStripped=!0;var i=n(4),o=n.n(i),s=n(22),a=n.n(s),l=n(6),u=n.n(l),c=n(10),h=n.n(c),d=function(){var t=this.$createElement;return(this._self._c||t)("div",{staticClass:"el-select-dropdown el-popper",class:[{"is-multiple":this.$parent.multiple},this.popperClass],style:{minWidth:this.minWidth}},[this._t("default")],2)};d._withStripped=!0;var p=n(5),f={name:"ElSelectDropdown",componentName:"ElSelectDropdown",mixins:[n.n(p).a],props:{placement:{default:"bottom-start"},boundariesPadding:{default:0},popperOptions:{default:function(){return{gpuAcceleration:!1}}},visibleArrow:{default:!0},appendToBody:{type:Boolean,default:!0}},data:function(){return{minWidth:""}},computed:{popperClass:function(){return this.$parent.popperClass}},watch:{"$parent.inputWidth":function(){this.minWidth=this.$parent.$el.getBoundingClientRect().width+"px"}},mounted:function(){var t=this;this.referenceElm=this.$parent.$refs.reference.$el,this.$parent.popperElm=this.popperElm=this.$el,this.$on("updatePopper",function(){t.$parent.visible&&t.updatePopper()}),this.$on("destroyPopper",this.destroyPopper)}},g=n(0),m=Object(g.a)(f,d,[],!1,null,null,null);m.options.__file="packages/select/src/select-dropdown.vue";var v=m.exports,b=n(33),_=n(37),y=n.n(_),T=n(15),x=n.n(T),E=n(17),w=n.n(E),C=n(12),S=n.n(C),k=n(16),O=n(31),I=n.n(O),R=n(3),A=n(21),N={mixins:[o.a,u.a,a()("reference"),{data:function(){return{hoverOption:-1}},computed:{optionsAllDisabled:function(){return this.options.filter(function(t){return t.visible}).every(function(t){return t.disabled})}},watch:{hoverIndex:function(t){var e=this;"number"==typeof t&&t>-1&&(this.hoverOption=this.options[t]||{}),this.options.forEach(function(t){t.hover=e.hoverOption===t})}},methods:{navigateOptions:function(t){var e=this;if(this.visible){if(0!==this.options.length&&0!==this.filteredOptionsCount&&!this.optionsAllDisabled){"next"===t?(this.hoverIndex++,this.hoverIndex===this.options.length&&(this.hoverIndex=0)):"prev"===t&&(this.hoverIndex--,this.hoverIndex<0&&(this.hoverIndex=this.options.length-1));var n=this.options[this.hoverIndex];!0!==n.disabled&&!0!==n.groupDisabled&&n.visible||this.navigateOptions(t),this.$nextTick(function(){return e.scrollToOption(e.hoverOption)})}}else this.visible=!0}}}],name:"ElSelect",componentName:"ElSelect",inject:{elForm:{default:""},elFormItem:{default:""}},provide:function(){return{select:this}},computed:{_elFormItemSize:function(){return(this.elFormItem||{}).elFormItemSize},readonly:function(){return!this.filterable||this.multiple||!Object(R.isIE)()&&!Object(R.isEdge)()&&!this.visible},showClose:function(){var t=this.multiple?Array.isArray(this.value)&&this.value.length>0:void 0!==this.value&&null!==this.value&&""!==this.value;return this.clearable&&!this.selectDisabled&&this.inputHovering&&t},iconClass:function(){return this.remote&&this.filterable?"":this.visible?"arrow-up is-reverse":"arrow-up"},debounce:function(){return this.remote?300:0},emptyText:function(){return this.loading?this.loadingText||this.t("el.select.loading"):(!this.remote||""!==this.query||0!==this.options.length)&&(this.filterable&&this.query&&this.options.length>0&&0===this.filteredOptionsCount?this.noMatchText||this.t("el.select.noMatch"):0===this.options.length?this.noDataText||this.t("el.select.noData"):null)},showNewOption:function(){var t=this,e=this.options.filter(function(t){return!t.created}).some(function(e){return e.currentLabel===t.query});return this.filterable&&this.allowCreate&&""!==this.query&&!e},selectSize:function(){return this.size||this._elFormItemSize||(this.$ELEMENT||{}).size},selectDisabled:function(){return this.disabled||(this.elForm||{}).disabled},collapseTagSize:function(){return["small","mini"].indexOf(this.selectSize)>-1?"mini":"small"},propPlaceholder:function(){return void 0!==this.placeholder?this.placeholder:this.t("el.select.placeholder")}},components:{ElInput:h.a,ElSelectMenu:v,ElOption:b.a,ElTag:y.a,ElScrollbar:x.a},directives:{Clickoutside:S.a},props:{name:String,id:String,value:{required:!0},autocomplete:{type:String,default:"off"},autoComplete:{type:String,validator:function(t){return!0}},automaticDropdown:Boolean,size:String,disabled:Boolean,clearable:Boolean,filterable:Boolean,allowCreate:Boolean,loading:Boolean,popperClass:String,remote:Boolean,loadingText:String,noMatchText:String,noDataText:String,remoteMethod:Function,filterMethod:Function,multiple:Boolean,multipleLimit:{type:Number,default:0},placeholder:{type:String,required:!1},defaultFirstOption:Boolean,reserveKeyword:Boolean,valueKey:{type:String,default:"value"},collapseTags:Boolean,popperAppendToBody:{type:Boolean,default:!0}},data:function(){return{options:[],cachedOptions:[],createdLabel:null,createdSelected:!1,selected:this.multiple?[]:{},inputLength:20,inputWidth:0,initialInputHeight:0,cachedPlaceHolder:"",optionsCount:0,filteredOptionsCount:0,visible:!1,softFocus:!1,selectedLabel:"",hoverIndex:-1,query:"",previousQuery:null,inputHovering:!1,currentPlaceholder:"",menuVisibleOnFocus:!1,isOnComposition:!1,isSilentBlur:!1}},watch:{selectDisabled:function(){var t=this;this.$nextTick(function(){t.resetInputHeight()})},propPlaceholder:function(t){this.cachedPlaceHolder=this.currentPlaceholder=t},value:function(t,e){this.multiple&&(this.resetInputHeight(),t&&t.length>0||this.$refs.input&&""!==this.query?this.currentPlaceholder="":this.currentPlaceholder=this.cachedPlaceHolder,this.filterable&&!this.reserveKeyword&&(this.query="",this.handleQueryChange(this.query))),this.setSelected(),this.filterable&&!this.multiple&&(this.inputLength=20),Object(R.valueEquals)(t,e)||this.dispatch("ElFormItem","el.form.change",t)},visible:function(t){var e=this;t?(this.broadcast("ElSelectDropdown","updatePopper"),this.filterable&&(this.query=this.remote?"":this.selectedLabel,this.handleQueryChange(this.query),this.multiple?this.$refs.input.focus():(this.remote||(this.broadcast("ElOption","queryChange",""),this.broadcast("ElOptionGroup","queryChange")),this.selectedLabel&&(this.currentPlaceholder=this.selectedLabel,this.selectedLabel="")))):(this.broadcast("ElSelectDropdown","destroyPopper"),this.$refs.input&&this.$refs.input.blur(),this.query="",this.previousQuery=null,this.selectedLabel="",this.inputLength=20,this.menuVisibleOnFocus=!1,this.resetHoverIndex(),this.$nextTick(function(){e.$refs.input&&""===e.$refs.input.value&&0===e.selected.length&&(e.currentPlaceholder=e.cachedPlaceHolder)}),this.multiple||(this.selected&&(this.filterable&&this.allowCreate&&this.createdSelected&&this.createdLabel?this.selectedLabel=this.createdLabel:this.selectedLabel=this.selected.currentLabel,this.filterable&&(this.query=this.selectedLabel)),this.filterable&&(this.currentPlaceholder=this.cachedPlaceHolder))),this.$emit("visible-change",t)},options:function(){var t=this;if(!this.$isServer){this.$nextTick(function(){t.broadcast("ElSelectDropdown","updatePopper")}),this.multiple&&this.resetInputHeight();var e=this.$el.querySelectorAll("input");-1===[].indexOf.call(e,document.activeElement)&&this.setSelected(),this.defaultFirstOption&&(this.filterable||this.remote)&&this.filteredOptionsCount&&this.checkDefaultFirstOption()}}},methods:{handleComposition:function(t){var e=this,n=t.target.value;if("compositionend"===t.type)this.isOnComposition=!1,this.$nextTick(function(t){return e.handleQueryChange(n)});else{var r=n[n.length-1]||"";this.isOnComposition=!Object(A.isKorean)(r)}},handleQueryChange:function(t){var e=this;this.previousQuery===t||this.isOnComposition||(null!==this.previousQuery||"function"!=typeof this.filterMethod&&"function"!=typeof this.remoteMethod?(this.previousQuery=t,this.$nextTick(function(){e.visible&&e.broadcast("ElSelectDropdown","updatePopper")}),this.hoverIndex=-1,this.multiple&&this.filterable&&this.$nextTick(function(){var t=15*e.$refs.input.value.length+20;e.inputLength=e.collapseTags?Math.min(50,t):t,e.managePlaceholder(),e.resetInputHeight()}),this.remote&&"function"==typeof this.remoteMethod?(this.hoverIndex=-1,this.remoteMethod(t)):"function"==typeof this.filterMethod?(this.filterMethod(t),this.broadcast("ElOptionGroup","queryChange")):(this.filteredOptionsCount=this.optionsCount,this.broadcast("ElOption","queryChange",t),this.broadcast("ElOptionGroup","queryChange")),this.defaultFirstOption&&(this.filterable||this.remote)&&this.filteredOptionsCount&&this.checkDefaultFirstOption()):this.previousQuery=t)},scrollToOption:function(t){var e=Array.isArray(t)&&t[0]?t[0].$el:t.$el;if(this.$refs.popper&&e){var n=this.$refs.popper.$el.querySelector(".el-select-dropdown__wrap");I()(n,e)}this.$refs.scrollbar&&this.$refs.scrollbar.handleScroll()},handleMenuEnter:function(){var t=this;this.$nextTick(function(){return t.scrollToOption(t.selected)})},emitChange:function(t){Object(R.valueEquals)(this.value,t)||this.$emit("change",t)},getOption:function(t){for(var e=void 0,n="[object object]"===Object.prototype.toString.call(t).toLowerCase(),r="[object null]"===Object.prototype.toString.call(t).toLowerCase(),i="[object undefined]"===Object.prototype.toString.call(t).toLowerCase(),o=this.cachedOptions.length-1;o>=0;o--){var s=this.cachedOptions[o];if(n?Object(R.getValueByPath)(s.value,this.valueKey)===Object(R.getValueByPath)(t,this.valueKey):s.value===t){e=s;break}}if(e)return e;var a={value:t,currentLabel:n||r||i?"":String(t)};return this.multiple&&(a.hitState=!1),a},setSelected:function(){var t=this;if(!this.multiple){var e=this.getOption(this.value);return e.created?(this.createdLabel=e.currentLabel,this.createdSelected=!0):this.createdSelected=!1,this.selectedLabel=e.currentLabel,this.selected=e,void(this.filterable&&(this.query=this.selectedLabel))}var n=[];Array.isArray(this.value)&&this.value.forEach(function(e){n.push(t.getOption(e))}),this.selected=n,this.$nextTick(function(){t.resetInputHeight()})},handleFocus:function(t){this.softFocus?this.softFocus=!1:((this.automaticDropdown||this.filterable)&&(this.visible=!0,this.filterable&&(this.menuVisibleOnFocus=!0)),this.$emit("focus",t))},blur:function(){this.visible=!1,this.$refs.reference.blur()},handleBlur:function(t){var e=this;setTimeout(function(){e.isSilentBlur?e.isSilentBlur=!1:e.$emit("blur",t)},50),this.softFocus=!1},handleClearClick:function(t){this.deleteSelected(t)},doDestroy:function(){this.$refs.popper&&this.$refs.popper.doDestroy()},handleClose:function(){this.visible=!1},toggleLastOptionHitState:function(t){if(Array.isArray(this.selected)){var e=this.selected[this.selected.length-1];if(e)return!0===t||!1===t?(e.hitState=t,t):(e.hitState=!e.hitState,e.hitState)}},deletePrevTag:function(t){if(t.target.value.length<=0&&!this.toggleLastOptionHitState()){var e=this.value.slice();e.pop(),this.$emit("input",e),this.emitChange(e)}},managePlaceholder:function(){""!==this.currentPlaceholder&&(this.currentPlaceholder=this.$refs.input.value?"":this.cachedPlaceHolder)},resetInputState:function(t){8!==t.keyCode&&this.toggleLastOptionHitState(!1),this.inputLength=15*this.$refs.input.value.length+20,this.resetInputHeight()},resetInputHeight:function(){var t=this;this.collapseTags&&!this.filterable||this.$nextTick(function(){if(t.$refs.reference){var e=t.$refs.reference.$el.childNodes,n=[].filter.call(e,function(t){return"INPUT"===t.tagName})[0],r=t.$refs.tags,i=t.initialInputHeight||40;n.style.height=0===t.selected.length?i+"px":Math.max(r?r.clientHeight+(r.clientHeight>i?6:0):0,i)+"px",t.visible&&!1!==t.emptyText&&t.broadcast("ElSelectDropdown","updatePopper")}})},resetHoverIndex:function(){var t=this;setTimeout(function(){t.multiple?t.selected.length>0?t.hoverIndex=Math.min.apply(null,t.selected.map(function(e){return t.options.indexOf(e)})):t.hoverIndex=-1:t.hoverIndex=t.options.indexOf(t.selected)},300)},handleOptionSelect:function(t,e){var n=this;if(this.multiple){var r=(this.value||[]).slice(),i=this.getValueIndex(r,t.value);i>-1?r.splice(i,1):(this.multipleLimit<=0||r.length<this.multipleLimit)&&r.push(t.value),this.$emit("input",r),this.emitChange(r),t.created&&(this.query="",this.handleQueryChange(""),this.inputLength=20),this.filterable&&this.$refs.input.focus()}else this.$emit("input",t.value),this.emitChange(t.value),this.visible=!1;this.isSilentBlur=e,this.setSoftFocus(),this.visible||this.$nextTick(function(){n.scrollToOption(t)})},setSoftFocus:function(){this.softFocus=!0;var t=this.$refs.input||this.$refs.reference;t&&t.focus()},getValueIndex:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments[1];if("[object object]"===Object.prototype.toString.call(e).toLowerCase()){var n=this.valueKey,r=-1;return t.some(function(t,i){return Object(R.getValueByPath)(t,n)===Object(R.getValueByPath)(e,n)&&(r=i,!0)}),r}return t.indexOf(e)},toggleMenu:function(){this.selectDisabled||(this.menuVisibleOnFocus?this.menuVisibleOnFocus=!1:this.visible=!this.visible,this.visible&&(this.$refs.input||this.$refs.reference).focus())},selectOption:function(){this.visible?this.options[this.hoverIndex]&&this.handleOptionSelect(this.options[this.hoverIndex]):this.toggleMenu()},deleteSelected:function(t){t.stopPropagation();var e=this.multiple?[]:"";this.$emit("input",e),this.emitChange(e),this.visible=!1,this.$emit("clear")},deleteTag:function(t,e){var n=this.selected.indexOf(e);if(n>-1&&!this.selectDisabled){var r=this.value.slice();r.splice(n,1),this.$emit("input",r),this.emitChange(r),this.$emit("remove-tag",e.value)}t.stopPropagation()},onInputChange:function(){this.filterable&&this.query!==this.selectedLabel&&(this.query=this.selectedLabel,this.handleQueryChange(this.query))},onOptionDestroy:function(t){t>-1&&(this.optionsCount--,this.filteredOptionsCount--,this.options.splice(t,1))},resetInputWidth:function(){this.inputWidth=this.$refs.reference.$el.getBoundingClientRect().width},handleResize:function(){this.resetInputWidth(),this.multiple&&this.resetInputHeight()},checkDefaultFirstOption:function(){this.hoverIndex=-1;for(var t=!1,e=this.options.length-1;e>=0;e--)if(this.options[e].created){t=!0,this.hoverIndex=e;break}if(!t)for(var n=0;n!==this.options.length;++n){var r=this.options[n];if(this.query){if(!r.disabled&&!r.groupDisabled&&r.visible){this.hoverIndex=n;break}}else if(r.itemSelected){this.hoverIndex=n;break}}},getValueKey:function(t){return"[object object]"!==Object.prototype.toString.call(t.value).toLowerCase()?t.value:Object(R.getValueByPath)(t.value,this.valueKey)}},created:function(){var t=this;this.cachedPlaceHolder=this.currentPlaceholder=this.propPlaceholder,this.multiple&&!Array.isArray(this.value)&&this.$emit("input",[]),!this.multiple&&Array.isArray(this.value)&&this.$emit("input",""),this.debouncedOnInputChange=w()(this.debounce,function(){t.onInputChange()}),this.debouncedQueryChange=w()(this.debounce,function(e){t.handleQueryChange(e.target.value)}),this.$on("handleOptionClick",this.handleOptionSelect),this.$on("setSelected",this.setSelected)},mounted:function(){var t=this;this.multiple&&Array.isArray(this.value)&&this.value.length>0&&(this.currentPlaceholder=""),Object(k.addResizeListener)(this.$el,this.handleResize);var e=this.$refs.reference;if(e&&e.$el){var n=e.$el.querySelector("input");this.initialInputHeight=n.getBoundingClientRect().height||{medium:36,small:32,mini:28}[this.selectSize]}this.remote&&this.multiple&&this.resetInputHeight(),this.$nextTick(function(){e&&e.$el&&(t.inputWidth=e.$el.getBoundingClientRect().width)}),this.setSelected()},beforeDestroy:function(){this.$el&&this.handleResize&&Object(k.removeResizeListener)(this.$el,this.handleResize)}},D=Object(g.a)(N,r,[],!1,null,null,null);D.options.__file="packages/select/src/select.vue";var M=D.exports;M.install=function(t){t.component(M.name,M)};e.default=M}})},e6n0:function(t,e,n){var r=n("evD5").f,i=n("D2L2"),o=n("dSzd")("toStringTag");t.exports=function(t,e,n){t&&!i(t=n?t:t.prototype,o)&&r(t,o,{configurable:!0,value:e})}},e8AB:function(t,e,n){var r=n("FeBl"),i=n("7KvD"),o=i["__core-js_shared__"]||(i["__core-js_shared__"]={});(t.exports=function(t,e){return o[t]||(o[t]=void 0!==e?e:{})})("versions",[]).push({version:r.version,mode:n("O4g8")?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},eNfa:function(t,e,n){"use strict";var r;!function(i){var o={},s=/d{1,4}|M{1,4}|yy(?:yy)?|S{1,3}|Do|ZZ|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,a="[^\\s]+",l=/\[([^]*?)\]/gm,u=function(){};function c(t,e){for(var n=[],r=0,i=t.length;r<i;r++)n.push(t[r].substr(0,e));return n}function h(t){return function(e,n,r){var i=r[t].indexOf(n.charAt(0).toUpperCase()+n.substr(1).toLowerCase());~i&&(e.month=i)}}function d(t,e){for(t=String(t),e=e||2;t.length<e;)t="0"+t;return t}var p=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],f=["January","February","March","April","May","June","July","August","September","October","November","December"],g=c(f,3),m=c(p,3);o.i18n={dayNamesShort:m,dayNames:p,monthNamesShort:g,monthNames:f,amPm:["am","pm"],DoFn:function(t){return t+["th","st","nd","rd"][t%10>3?0:(t-t%10!=10)*t%10]}};var v={D:function(t){return t.getDay()},DD:function(t){return d(t.getDay())},Do:function(t,e){return e.DoFn(t.getDate())},d:function(t){return t.getDate()},dd:function(t){return d(t.getDate())},ddd:function(t,e){return e.dayNamesShort[t.getDay()]},dddd:function(t,e){return e.dayNames[t.getDay()]},M:function(t){return t.getMonth()+1},MM:function(t){return d(t.getMonth()+1)},MMM:function(t,e){return e.monthNamesShort[t.getMonth()]},MMMM:function(t,e){return e.monthNames[t.getMonth()]},yy:function(t){return d(String(t.getFullYear()),4).substr(2)},yyyy:function(t){return d(t.getFullYear(),4)},h:function(t){return t.getHours()%12||12},hh:function(t){return d(t.getHours()%12||12)},H:function(t){return t.getHours()},HH:function(t){return d(t.getHours())},m:function(t){return t.getMinutes()},mm:function(t){return d(t.getMinutes())},s:function(t){return t.getSeconds()},ss:function(t){return d(t.getSeconds())},S:function(t){return Math.round(t.getMilliseconds()/100)},SS:function(t){return d(Math.round(t.getMilliseconds()/10),2)},SSS:function(t){return d(t.getMilliseconds(),3)},a:function(t,e){return t.getHours()<12?e.amPm[0]:e.amPm[1]},A:function(t,e){return t.getHours()<12?e.amPm[0].toUpperCase():e.amPm[1].toUpperCase()},ZZ:function(t){var e=t.getTimezoneOffset();return(e>0?"-":"+")+d(100*Math.floor(Math.abs(e)/60)+Math.abs(e)%60,4)}},b={d:["\\d\\d?",function(t,e){t.day=e}],Do:["\\d\\d?"+a,function(t,e){t.day=parseInt(e,10)}],M:["\\d\\d?",function(t,e){t.month=e-1}],yy:["\\d\\d?",function(t,e){var n=+(""+(new Date).getFullYear()).substr(0,2);t.year=""+(e>68?n-1:n)+e}],h:["\\d\\d?",function(t,e){t.hour=e}],m:["\\d\\d?",function(t,e){t.minute=e}],s:["\\d\\d?",function(t,e){t.second=e}],yyyy:["\\d{4}",function(t,e){t.year=e}],S:["\\d",function(t,e){t.millisecond=100*e}],SS:["\\d{2}",function(t,e){t.millisecond=10*e}],SSS:["\\d{3}",function(t,e){t.millisecond=e}],D:["\\d\\d?",u],ddd:[a,u],MMM:[a,h("monthNamesShort")],MMMM:[a,h("monthNames")],a:[a,function(t,e,n){var r=e.toLowerCase();r===n.amPm[0]?t.isPm=!1:r===n.amPm[1]&&(t.isPm=!0)}],ZZ:["[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z",function(t,e){var n,r=(e+"").match(/([+-]|\d\d)/gi);r&&(n=60*r[1]+parseInt(r[2],10),t.timezoneOffset="+"===r[0]?n:-n)}]};b.dd=b.d,b.dddd=b.ddd,b.DD=b.D,b.mm=b.m,b.hh=b.H=b.HH=b.h,b.MM=b.M,b.ss=b.s,b.A=b.a,o.masks={default:"ddd MMM dd yyyy HH:mm:ss",shortDate:"M/D/yy",mediumDate:"MMM d, yyyy",longDate:"MMMM d, yyyy",fullDate:"dddd, MMMM d, yyyy",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"},o.format=function(t,e,n){var r=n||o.i18n;if("number"==typeof t&&(t=new Date(t)),"[object Date]"!==Object.prototype.toString.call(t)||isNaN(t.getTime()))throw new Error("Invalid Date in fecha.format");var i=[];return(e=(e=(e=o.masks[e]||e||o.masks.default).replace(l,function(t,e){return i.push(e),"@@@"})).replace(s,function(e){return e in v?v[e](t,r):e.slice(1,e.length-1)})).replace(/@@@/g,function(){return i.shift()})},o.parse=function(t,e,n){var r=n||o.i18n;if("string"!=typeof e)throw new Error("Invalid format in fecha.parse");if(e=o.masks[e]||e,t.length>1e3)return null;var i={},a=[],u=[];e=e.replace(l,function(t,e){return u.push(e),"@@@"});var c,h=(c=e,c.replace(/[|\\{()[^$+*?.-]/g,"\\$&")).replace(s,function(t){if(b[t]){var e=b[t];return a.push(e[1]),"("+e[0]+")"}return t});h=h.replace(/@@@/g,function(){return u.shift()});var d=t.match(new RegExp(h,"i"));if(!d)return null;for(var p=1;p<d.length;p++)a[p-1](i,d[p],r);var f,g=new Date;return!0===i.isPm&&null!=i.hour&&12!=+i.hour?i.hour=+i.hour+12:!1===i.isPm&&12==+i.hour&&(i.hour=0),null!=i.timezoneOffset?(i.minute=+(i.minute||0)-+i.timezoneOffset,f=new Date(Date.UTC(i.year||g.getFullYear(),i.month||0,i.day||1,i.hour||0,i.minute||0,i.second||0,i.millisecond||0))):f=new Date(i.year||g.getFullYear(),i.month||0,i.day||1,i.hour||0,i.minute||0,i.second||0,i.millisecond||0),f},void 0!==t&&t.exports?t.exports=o:void 0===(r=function(){return o}.call(e,n,e,t))||(t.exports=r)}()},eNzZ:function(t,e,n){"use strict";var r=n("Kkag"),i=n("l5jf"),o=n("jb1O"),s=n("xMQ1"),a=n("35G1");const l=Object(a.a)({pow_:
  1846. /**
  1847. * @license
  1848. * Copyright 2020 Google LLC. All Rights Reserved.
  1849. * Licensed under the Apache License, Version 2.0 (the "License");
  1850. * you may not use this file except in compliance with the License.
  1851. * You may obtain a copy of the License at
  1852. *
  1853. * http://www.apache.org/licenses/LICENSE-2.0
  1854. *
  1855. * Unless required by applicable law or agreed to in writing, software
  1856. * distributed under the License is distributed on an "AS IS" BASIS,
  1857. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1858. * See the License for the specific language governing permissions and
  1859. * limitations under the License.
  1860. * =============================================================================
  1861. */
  1862. function(t,e){let n=Object(s.a)(t,"base","pow"),a=Object(s.a)(e,"exp","pow");[n,a]=Object(o.c)(n,a);const l={a:n,b:a};return r.a.runKernel(i._54,l)}});e.a=l},egTW:function(t,e,n){"use strict";e.c=
  1863. /**
  1864. * @license
  1865. * Copyright 2019 Google LLC. All Rights Reserved.
  1866. * Licensed under the Apache License, Version 2.0 (the "License");
  1867. * you may not use this file except in compliance with the License.
  1868. * You may obtain a copy of the License at
  1869. *
  1870. * http://www.apache.org/licenses/LICENSE-2.0
  1871. *
  1872. * Unless required by applicable law or agreed to in writing, software
  1873. * distributed under the License is distributed on an "AS IS" BASIS,
  1874. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1875. * See the License for the specific language governing permissions and
  1876. * limitations under the License.
  1877. * =============================================================================
  1878. */
  1879. function(t,e,n){if(null==n||"linear"===n)return t;if("relu"===n)return Object(s.a)(t,Object(d.a)(e));throw new Error(`Cannot compute gradient for fused activation ${n}.`)},e.b=function(t,e){let n=e;const i=r.getReductionAxes(t.shape,e.shape);i.length>0&&(n=Object(p.a)(n,i));return Object(c.a)(n,t.shape)},e.a=function(t,e,n,r){if("linear"===e)return t;if("relu"===e)return Object(l.a)(t);if("elu"===e)return Object(i.a)(t);if("relu6"===e)return Object(u.a)(t);if("prelu"===e)return Object(a.a)(t,n);if("leakyrelu"===e)return Object(o.a)(t,r);if("sigmoid"===e)return Object(h.a)(t);throw new Error(`Unknown fused activation ${e}.`)};var r=n("bDWH"),i=n("RJ9z"),o=n("6Ppv"),s=n("dZfa"),a=n("JffD"),l=n("hSps"),u=n("lsVm"),c=n("GtxA"),h=n("fxrw"),d=n("Rz9h"),p=n("Cp+6");e.d=((t,e)=>{return!(t>0)||"linear"===e})},evD5:function(t,e,n){var r=n("77Pl"),i=n("SfB7"),o=n("MmMw"),s=Object.defineProperty;e.f=n("+E39")?Object.defineProperty:function(t,e,n){if(r(t),e=o(e,!0),r(n),i)try{return s(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},exGp:function(t,e,n){"use strict";e.__esModule=!0;var r,i=n("//Fk"),o=(r=i)&&r.__esModule?r:{default:r};e.default=function(t){return function(){var e=t.apply(this,arguments);return new o.default(function(t,n){return function r(i,s){try{var a=e[i](s),l=a.value}catch(t){return void n(t)}if(!a.done)return o.default.resolve(l).then(function(t){r("next",t)},function(t){r("throw",t)});t(l)}("next")})}}},fBQ2:function(t,e,n){"use strict";var r=n("evD5"),i=n("X8DO");t.exports=function(t,e,n){e in t?r.f(t,e,i(0,n)):t[e]=n}},"fEB+":function(t,e,n){t.exports=function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/dist/",n(n.s=131)}({131:function(t,e,n){"use strict";n.r(e);var r=n(16),i=n(38),o=n.n(i),s=n(3),a=n(2),l={vertical:{offset:"offsetHeight",scroll:"scrollTop",scrollSize:"scrollHeight",size:"height",key:"vertical",axis:"Y",client:"clientY",direction:"top"},horizontal:{offset:"offsetWidth",scroll:"scrollLeft",scrollSize:"scrollWidth",size:"width",key:"horizontal",axis:"X",client:"clientX",direction:"left"}};var u={name:"Bar",props:{vertical:Boolean,size:String,move:Number},computed:{bar:function(){return l[this.vertical?"vertical":"horizontal"]},wrap:function(){return this.$parent.wrap}},render:function(t){var e=this.size,n=this.move,r=this.bar;return t("div",{class:["el-scrollbar__bar","is-"+r.key],on:{mousedown:this.clickTrackHandler}},[t("div",{ref:"thumb",class:"el-scrollbar__thumb",on:{mousedown:this.clickThumbHandler},style:function(t){var e=t.move,n=t.size,r=t.bar,i={},o="translate"+r.axis+"("+e+"%)";return i[r.size]=n,i.transform=o,i.msTransform=o,i.webkitTransform=o,i}({size:e,move:n,bar:r})})])},methods:{clickThumbHandler:function(t){t.ctrlKey||2===t.button||(this.startDrag(t),this[this.bar.axis]=t.currentTarget[this.bar.offset]-(t[this.bar.client]-t.currentTarget.getBoundingClientRect()[this.bar.direction]))},clickTrackHandler:function(t){var e=100*(Math.abs(t.target.getBoundingClientRect()[this.bar.direction]-t[this.bar.client])-this.$refs.thumb[this.bar.offset]/2)/this.$el[this.bar.offset];this.wrap[this.bar.scroll]=e*this.wrap[this.bar.scrollSize]/100},startDrag:function(t){t.stopImmediatePropagation(),this.cursorDown=!0,Object(a.on)(document,"mousemove",this.mouseMoveDocumentHandler),Object(a.on)(document,"mouseup",this.mouseUpDocumentHandler),document.onselectstart=function(){return!1}},mouseMoveDocumentHandler:function(t){if(!1!==this.cursorDown){var e=this[this.bar.axis];if(e){var n=100*(-1*(this.$el.getBoundingClientRect()[this.bar.direction]-t[this.bar.client])-(this.$refs.thumb[this.bar.offset]-e))/this.$el[this.bar.offset];this.wrap[this.bar.scroll]=n*this.wrap[this.bar.scrollSize]/100}}},mouseUpDocumentHandler:function(t){this.cursorDown=!1,this[this.bar.axis]=0,Object(a.off)(document,"mousemove",this.mouseMoveDocumentHandler),document.onselectstart=null}},destroyed:function(){Object(a.off)(document,"mouseup",this.mouseUpDocumentHandler)}},c={name:"ElScrollbar",components:{Bar:u},props:{native:Boolean,wrapStyle:{},wrapClass:{},viewClass:{},viewStyle:{},noresize:Boolean,tag:{type:String,default:"div"}},data:function(){return{sizeWidth:"0",sizeHeight:"0",moveX:0,moveY:0}},computed:{wrap:function(){return this.$refs.wrap}},render:function(t){var e=o()(),n=this.wrapStyle;if(e){var r="-"+e+"px",i="margin-bottom: "+r+"; margin-right: "+r+";";Array.isArray(this.wrapStyle)?(n=Object(s.toObject)(this.wrapStyle)).marginRight=n.marginBottom=r:"string"==typeof this.wrapStyle?n+=i:n=i}var a=t(this.tag,{class:["el-scrollbar__view",this.viewClass],style:this.viewStyle,ref:"resize"},this.$slots.default),l=t("div",{ref:"wrap",style:n,on:{scroll:this.handleScroll},class:[this.wrapClass,"el-scrollbar__wrap",e?"":"el-scrollbar__wrap--hidden-default"]},[[a]]);return t("div",{class:"el-scrollbar"},this.native?[t("div",{ref:"wrap",class:[this.wrapClass,"el-scrollbar__wrap"],style:n},[[a]])]:[l,t(u,{attrs:{move:this.moveX,size:this.sizeWidth}}),t(u,{attrs:{vertical:!0,move:this.moveY,size:this.sizeHeight}})])},methods:{handleScroll:function(){var t=this.wrap;this.moveY=100*t.scrollTop/t.clientHeight,this.moveX=100*t.scrollLeft/t.clientWidth},update:function(){var t,e,n=this.wrap;n&&(t=100*n.clientHeight/n.scrollHeight,e=100*n.clientWidth/n.scrollWidth,this.sizeHeight=t<100?t+"%":"",this.sizeWidth=e<100?e+"%":"")}},mounted:function(){this.native||(this.$nextTick(this.update),!this.noresize&&Object(r.addResizeListener)(this.$refs.resize,this.update))},beforeDestroy:function(){this.native||!this.noresize&&Object(r.removeResizeListener)(this.$refs.resize,this.update)},install:function(t){t.component(c.name,c)}};e.default=c},16:function(t,e){t.exports=n("02w1")},2:function(t,e){t.exports=n("2kvA")},3:function(t,e){t.exports=n("ylDJ")},38:function(t,e){t.exports=n("6Twh")}})},fGru:function(t,e,n){var r;r=function(t){t.lib.Cipher||function(e){var n=t,r=n.lib,i=r.Base,o=r.WordArray,s=r.BufferedBlockAlgorithm,a=n.enc,l=(a.Utf8,a.Base64),u=n.algo.EvpKDF,c=r.Cipher=s.extend({cfg:i.extend(),createEncryptor:function(t,e){return this.create(this._ENC_XFORM_MODE,t,e)},createDecryptor:function(t,e){return this.create(this._DEC_XFORM_MODE,t,e)},init:function(t,e,n){this.cfg=this.cfg.extend(n),this._xformMode=t,this._key=e,this.reset()},reset:function(){s.reset.call(this),this._doReset()},process:function(t){return this._append(t),this._process()},finalize:function(t){return t&&this._append(t),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function t(t){return"string"==typeof t?_:v}return function(e){return{encrypt:function(n,r,i){return t(r).encrypt(e,n,r,i)},decrypt:function(n,r,i){return t(r).decrypt(e,n,r,i)}}}}()}),h=(r.StreamCipher=c.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),n.mode={}),d=r.BlockCipherMode=i.extend({createEncryptor:function(t,e){return this.Encryptor.create(t,e)},createDecryptor:function(t,e){return this.Decryptor.create(t,e)},init:function(t,e){this._cipher=t,this._iv=e}}),p=h.CBC=function(){var t=d.extend();function n(t,n,r){var i,o=this._iv;o?(i=o,this._iv=e):i=this._prevBlock;for(var s=0;s<r;s++)t[n+s]^=i[s]}return t.Encryptor=t.extend({processBlock:function(t,e){var r=this._cipher,i=r.blockSize;n.call(this,t,e,i),r.encryptBlock(t,e),this._prevBlock=t.slice(e,e+i)}}),t.Decryptor=t.extend({processBlock:function(t,e){var r=this._cipher,i=r.blockSize,o=t.slice(e,e+i);r.decryptBlock(t,e),n.call(this,t,e,i),this._prevBlock=o}}),t}(),f=(n.pad={}).Pkcs7={pad:function(t,e){for(var n=4*e,r=n-t.sigBytes%n,i=r<<24|r<<16|r<<8|r,s=[],a=0;a<r;a+=4)s.push(i);var l=o.create(s,r);t.concat(l)},unpad:function(t){var e=255&t.words[t.sigBytes-1>>>2];t.sigBytes-=e}},g=(r.BlockCipher=c.extend({cfg:c.cfg.extend({mode:p,padding:f}),reset:function(){var t;c.reset.call(this);var e=this.cfg,n=e.iv,r=e.mode;this._xformMode==this._ENC_XFORM_MODE?t=r.createEncryptor:(t=r.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==t?this._mode.init(this,n&&n.words):(this._mode=t.call(r,this,n&&n.words),this._mode.__creator=t)},_doProcessBlock:function(t,e){this._mode.processBlock(t,e)},_doFinalize:function(){var t,e=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(e.pad(this._data,this.blockSize),t=this._process(!0)):(t=this._process(!0),e.unpad(t)),t},blockSize:4}),r.CipherParams=i.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}})),m=(n.format={}).OpenSSL={stringify:function(t){var e=t.ciphertext,n=t.salt;return(n?o.create([1398893684,1701076831]).concat(n).concat(e):e).toString(l)},parse:function(t){var e,n=l.parse(t),r=n.words;return 1398893684==r[0]&&1701076831==r[1]&&(e=o.create(r.slice(2,4)),r.splice(0,4),n.sigBytes-=16),g.create({ciphertext:n,salt:e})}},v=r.SerializableCipher=i.extend({cfg:i.extend({format:m}),encrypt:function(t,e,n,r){r=this.cfg.extend(r);var i=t.createEncryptor(n,r),o=i.finalize(e),s=i.cfg;return g.create({ciphertext:o,key:n,iv:s.iv,algorithm:t,mode:s.mode,padding:s.padding,blockSize:t.blockSize,formatter:r.format})},decrypt:function(t,e,n,r){return r=this.cfg.extend(r),e=this._parse(e,r.format),t.createDecryptor(n,r).finalize(e.ciphertext)},_parse:function(t,e){return"string"==typeof t?e.parse(t,this):t}}),b=(n.kdf={}).OpenSSL={execute:function(t,e,n,r){r||(r=o.random(8));var i=u.create({keySize:e+n}).compute(t,r),s=o.create(i.words.slice(e),4*n);return i.sigBytes=4*e,g.create({key:i,iv:s,salt:r})}},_=r.PasswordBasedCipher=v.extend({cfg:v.cfg.extend({kdf:b}),encrypt:function(t,e,n,r){var i=(r=this.cfg.extend(r)).kdf.execute(n,t.keySize,t.ivSize);r.iv=i.iv;var o=v.encrypt.call(this,t,e,i.key,r);return o.mixIn(i),o},decrypt:function(t,e,n,r){r=this.cfg.extend(r),e=this._parse(e,r.format);var i=r.kdf.execute(n,t.keySize,t.ivSize,e.salt);return r.iv=i.iv,v.decrypt.call(this,t,e,i.key,r)}})}()},t.exports=r(n("02Hb"),n("wj1U"))},fJUb:function(t,e,n){var r=n("77Pl"),i=n("EqjI"),o=n("qARP");t.exports=function(t,e){if(r(t),i(e)&&e.constructor===t)return e;var n=o.f(t);return(0,n.resolve)(e),n.promise}},fKx3:function(t,e,n){"use strict";e.__esModule=!0;var r,i=n("7+uW"),o=(r=i)&&r.__esModule?r:{default:r},s=n("7J9s");var a=o.default.prototype.$isServer?function(){}:n("NMof"),l=function(t){return t.stopPropagation()};e.default={props:{transformOrigin:{type:[Boolean,String],default:!0},placement:{type:String,default:"bottom"},boundariesPadding:{type:Number,default:5},reference:{},popper:{},offset:{default:0},value:Boolean,visibleArrow:Boolean,arrowOffset:{type:Number,default:35},appendToBody:{type:Boolean,default:!0},popperOptions:{type:Object,default:function(){return{gpuAcceleration:!1}}}},data:function(){return{showPopper:!1,currentPlacement:""}},watch:{value:{immediate:!0,handler:function(t){this.showPopper=t,this.$emit("input",t)}},showPopper:function(t){this.disabled||(t?this.updatePopper():this.destroyPopper(),this.$emit("input",t))}},methods:{createPopper:function(){var t=this;if(!this.$isServer&&(this.currentPlacement=this.currentPlacement||this.placement,/^(top|bottom|left|right)(-start|-end)?$/g.test(this.currentPlacement))){var e=this.popperOptions,n=this.popperElm=this.popperElm||this.popper||this.$refs.popper,r=this.referenceElm=this.referenceElm||this.reference||this.$refs.reference;!r&&this.$slots.reference&&this.$slots.reference[0]&&(r=this.referenceElm=this.$slots.reference[0].elm),n&&r&&(this.visibleArrow&&this.appendArrow(n),this.appendToBody&&document.body.appendChild(this.popperElm),this.popperJS&&this.popperJS.destroy&&this.popperJS.destroy(),e.placement=this.currentPlacement,e.offset=this.offset,e.arrowOffset=this.arrowOffset,this.popperJS=new a(r,n,e),this.popperJS.onCreate(function(e){t.$emit("created",t),t.resetTransformOrigin(),t.$nextTick(t.updatePopper)}),"function"==typeof e.onUpdate&&this.popperJS.onUpdate(e.onUpdate),this.popperJS._popper.style.zIndex=s.PopupManager.nextZIndex(),this.popperElm.addEventListener("click",l))}},updatePopper:function(){var t=this.popperJS;t?(t.update(),t._popper&&(t._popper.style.zIndex=s.PopupManager.nextZIndex())):this.createPopper()},doDestroy:function(t){!this.popperJS||this.showPopper&&!t||(this.popperJS.destroy(),this.popperJS=null)},destroyPopper:function(){this.popperJS&&this.resetTransformOrigin()},resetTransformOrigin:function(){if(this.transformOrigin){var t=this.popperJS._popper.getAttribute("x-placement").split("-")[0],e={top:"bottom",bottom:"top",left:"right",right:"left"}[t];this.popperJS._popper.style.transformOrigin="string"==typeof this.transformOrigin?this.transformOrigin:["top","bottom"].indexOf(t)>-1?"center "+e:e+" center"}},appendArrow:function(t){var e=void 0;if(!this.appended){for(var n in this.appended=!0,t.attributes)if(/^_v-/.test(t.attributes[n].name)){e=t.attributes[n].name;break}var r=document.createElement("div");e&&r.setAttribute(e,""),r.setAttribute("x-arrow",""),r.className="popper__arrow",t.appendChild(r)}}},beforeDestroy:function(){this.doDestroy(!0),this.popperElm&&this.popperElm.parentNode===document.body&&(this.popperElm.removeEventListener("click",l),document.body.removeChild(this.popperElm))},deactivated:function(){this.$options.beforeDestroy[0].call(this)}}},fPll:function(t,e,n){"use strict";e.__esModule=!0,e.default={methods:{dispatch:function(t,e,n){for(var r=this.$parent||this.$root,i=r.$options.componentName;r&&(!i||i!==t);)(r=r.$parent)&&(i=r.$options.componentName);r&&r.$emit.apply(r,[e].concat(n))},broadcast:function(t,e,n){(function t(e,n,r){this.$children.forEach(function(i){i.$options.componentName===e?i.$emit.apply(i,[n].concat(r)):t.apply(i,[e,n].concat([r]))})}).call(this,t,e,n)}}}},fUqW:function(t,e,n){"use strict";e.__esModule=!0;var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};e.isVNode=function(t){return null!==t&&"object"===(void 0===t?"undefined":r(t))&&(0,i.hasOwn)(t,"componentOptions")};var i=n("ylDJ")},fWfb:function(t,e,n){"use strict";var r=n("7KvD"),i=n("D2L2"),o=n("+E39"),s=n("kM2E"),a=n("880/"),l=n("06OY").KEY,u=n("S82l"),c=n("e8AB"),h=n("e6n0"),d=n("3Eo+"),p=n("dSzd"),f=n("Kh4W"),g=n("crlp"),m=n("Xc4G"),v=n("7UMu"),b=n("77Pl"),_=n("EqjI"),y=n("sB3e"),T=n("TcQ7"),x=n("MmMw"),E=n("X8DO"),w=n("Yobk"),C=n("Rrel"),S=n("LKZe"),k=n("1kS7"),O=n("evD5"),I=n("lktj"),R=S.f,A=O.f,N=C.f,D=r.Symbol,M=r.JSON,L=M&&M.stringify,P=p("_hidden"),F=p("toPrimitive"),B={}.propertyIsEnumerable,j=c("symbol-registry"),$=c("symbols"),U=c("op-symbols"),V=Object.prototype,H="function"==typeof D&&!!k.f,W=r.QObject,G=!W||!W.prototype||!W.prototype.findChild,z=o&&u(function(){return 7!=w(A({},"a",{get:function(){return A(this,"a",{value:7}).a}})).a})?function(t,e,n){var r=R(V,e);r&&delete V[e],A(t,e,n),r&&t!==V&&A(V,e,r)}:A,X=function(t){var e=$[t]=w(D.prototype);return e._k=t,e},K=H&&"symbol"==typeof D.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof D},Y=function(t,e,n){return t===V&&Y(U,e,n),b(t),e=x(e,!0),b(n),i($,e)?(n.enumerable?(i(t,P)&&t[P][e]&&(t[P][e]=!1),n=w(n,{enumerable:E(0,!1)})):(i(t,P)||A(t,P,E(1,{})),t[P][e]=!0),z(t,e,n)):A(t,e,n)},q=function(t,e){b(t);for(var n,r=m(e=T(e)),i=0,o=r.length;o>i;)Y(t,n=r[i++],e[n]);return t},J=function(t){var e=B.call(this,t=x(t,!0));return!(this===V&&i($,t)&&!i(U,t))&&(!(e||!i(this,t)||!i($,t)||i(this,P)&&this[P][t])||e)},Z=function(t,e){if(t=T(t),e=x(e,!0),t!==V||!i($,e)||i(U,e)){var n=R(t,e);return!n||!i($,e)||i(t,P)&&t[P][e]||(n.enumerable=!0),n}},Q=function(t){for(var e,n=N(T(t)),r=[],o=0;n.length>o;)i($,e=n[o++])||e==P||e==l||r.push(e);return r},tt=function(t){for(var e,n=t===V,r=N(n?U:T(t)),o=[],s=0;r.length>s;)!i($,e=r[s++])||n&&!i(V,e)||o.push($[e]);return o};H||(a((D=function(){if(this instanceof D)throw TypeError("Symbol is not a constructor!");var t=d(arguments.length>0?arguments[0]:void 0),e=function(n){this===V&&e.call(U,n),i(this,P)&&i(this[P],t)&&(this[P][t]=!1),z(this,t,E(1,n))};return o&&G&&z(V,t,{configurable:!0,set:e}),X(t)}).prototype,"toString",function(){return this._k}),S.f=Z,O.f=Y,n("n0T6").f=C.f=Q,n("NpIQ").f=J,k.f=tt,o&&!n("O4g8")&&a(V,"propertyIsEnumerable",J,!0),f.f=function(t){return X(p(t))}),s(s.G+s.W+s.F*!H,{Symbol:D});for(var et="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),nt=0;et.length>nt;)p(et[nt++]);for(var rt=I(p.store),it=0;rt.length>it;)g(rt[it++]);s(s.S+s.F*!H,"Symbol",{for:function(t){return i(j,t+="")?j[t]:j[t]=D(t)},keyFor:function(t){if(!K(t))throw TypeError(t+" is not a symbol!");for(var e in j)if(j[e]===t)return e},useSetter:function(){G=!0},useSimple:function(){G=!1}}),s(s.S+s.F*!H,"Object",{create:function(t,e){return void 0===e?w(t):q(w(t),e)},defineProperty:Y,defineProperties:q,getOwnPropertyDescriptor:Z,getOwnPropertyNames:Q,getOwnPropertySymbols:tt});var ot=u(function(){k.f(1)});s(s.S+s.F*ot,"Object",{getOwnPropertySymbols:function(t){return k.f(y(t))}}),M&&s(s.S+s.F*(!H||u(function(){var t=D();return"[null]"!=L([t])||"{}"!=L({a:t})||"{}"!=L(Object(t))})),"JSON",{stringify:function(t){for(var e,n,r=[t],i=1;arguments.length>i;)r.push(arguments[i++]);if(n=e=r[1],(_(e)||void 0!==t)&&!K(t))return v(e)||(e=function(t,e){if("function"==typeof n&&(e=n.call(this,t,e)),!K(e))return e}),r[1]=e,L.apply(M,r)}}),D.prototype[F]||n("hJx8")(D.prototype,F,D.prototype.valueOf),h(D,"Symbol"),h(Math,"Math",!0),h(r.JSON,"JSON",!0)},fZjL:function(t,e,n){t.exports={default:n("jFbC"),__esModule:!0}},fiWD:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.json=[{tfOpName:"FFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"IFFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"RFFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"fft_length",type:"number",notSupported:!0}]},{tfOpName:"IRFFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"fft_length",type:"number",notSupported:!0}]}]},ficH:function(t,e,n){"use strict";(function(t){var e=n("v/P2");
  1880. /**
  1881. * @license
  1882. * Copyright 2019 Google LLC. All Rights Reserved.
  1883. * Licensed under the Apache License, Version 2.0 (the "License");
  1884. * you may not use this file except in compliance with the License.
  1885. * You may obtain a copy of the License at
  1886. *
  1887. * http://www.apache.org/licenses/LICENSE-2.0
  1888. *
  1889. * Unless required by applicable law or agreed to in writing, software
  1890. * distributed under the License is distributed on an "AS IS" BASIS,
  1891. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1892. * See the License for the specific language governing permissions and
  1893. * limitations under the License.
  1894. * =============================================================================
  1895. */const r={importFetch:()=>n(3)};let i;Object(e.b)().get("IS_NODE")&&!Object(e.b)().get("IS_BROWSER")&&Object(e.b)().setPlatform("node",new class{constructor(){this.util=n(4),this.textEncoder=new this.util.TextEncoder}fetch(t,n){return null!=Object(e.b)().global.fetch?Object(e.b)().global.fetch(t,n):(null==i&&(i=r.importFetch()),i(t,n))}now(){const e=t.hrtime();return 1e3*e[0]+e[1]/1e6}encode(t,e){if("utf-8"!==e&&"utf8"!==e)throw new Error(`Node built-in encoder only supports utf-8, but got ${e}`);return this.textEncoder.encode(t)}decode(t,e){return 0===t.length?"":new this.util.TextDecoder(e).decode(t)}})}).call(e,n("W2nU"))},fkB2:function(t,e,n){var r=n("UuGF"),i=Math.max,o=Math.min;t.exports=function(t,e){return(t=r(t))<0?i(t+e,0):o(t,e)}},fuGk:function(t,e,n){"use strict";var r=n("cGG2");function i(){this.handlers=[]}i.prototype.use=function(t,e){return this.handlers.push({fulfilled:t,rejected:e}),this.handlers.length-1},i.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},i.prototype.forEach=function(t){r.forEach(this.handlers,function(e){null!==e&&t(e)})},t.exports=i},fxRn:function(t,e,n){n("+tPU"),n("zQR9"),t.exports=n("g8Ux")},fxrw:function(t,e,n){"use strict";var r=n("Kkag"),i=n("l5jf"),o=n("xMQ1"),s=n("35G1");const a=Object(s.a)({sigmoid_:
  1896. /**
  1897. * @license
  1898. * Copyright 2018 Google LLC. All Rights Reserved.
  1899. * Licensed under the Apache License, Version 2.0 (the "License");
  1900. * you may not use this file except in compliance with the License.
  1901. * You may obtain a copy of the License at
  1902. *
  1903. * http://www.apache.org/licenses/LICENSE-2.0
  1904. *
  1905. * Unless required by applicable law or agreed to in writing, software
  1906. * distributed under the License is distributed on an "AS IS" BASIS,
  1907. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1908. * See the License for the specific language governing permissions and
  1909. * limitations under the License.
  1910. * =============================================================================
  1911. */
  1912. function(t){const e={x:Object(o.a)(t,"x","sigmoid","float32")};return r.a.runKernel(i._75,e)}});e.a=a},fzqA:function(t,e,n){(function(t){var r;!function(t,i,o){function s(t,e){return e.x=t.x.slice(),e.i=t.i,e}function a(t,e){null==t&&(t=+new Date);var n=new function(t){var e=this;e.next=function(){var t,n,r=e.x,i=e.i;return t=r[i],n=(t^=t>>>7)^t<<24,n^=(t=r[i+1&7])^t>>>10,n^=(t=r[i+3&7])^t>>>3,n^=(t=r[i+4&7])^t<<7,t=r[i+7&7],n^=(t^=t<<13)^t<<9,r[i]=n,e.i=i+1&7,n},function(t,e){var n,r=[];if(e===(0|e))r[0]=e;else for(e=""+e,n=0;n<e.length;++n)r[7&n]=r[7&n]<<15^e.charCodeAt(n)+r[n+1&7]<<13;for(;r.length<8;)r.push(0);for(n=0;n<8&&0===r[n];++n);for(8==n?r[7]=-1:r[n],t.x=r,t.i=0,n=256;n>0;--n)t.next()}(e,t)}(t),r=e&&e.state,i=function(){return(n.next()>>>0)/4294967296};return i.double=function(){do{var t=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},i.int32=n.next,i.quick=i,r&&(r.x&&s(r,n),i.state=function(){return s(n,{})}),i}i&&i.exports?i.exports=a:n("LGuY")&&n("nErl")?void 0===(r=function(){return a}.call(e,n,e,i))||(i.exports=r):this.xorshift7=a}(0,"object"==typeof t&&t,n("LGuY"))}).call(e,n("3IRH")(t))},g8Ux:function(t,e,n){var r=n("77Pl"),i=n("3fs2");t.exports=n("FeBl").getIterator=function(t){var e=i(t);if("function"!=typeof e)throw TypeError(t+" is not iterable!");return r(e.call(t))}},gHp0:function(t,e,n){"use strict";e.a=
  1913. /**
  1914. * @license
  1915. * Copyright 2018 Google LLC. All Rights Reserved.
  1916. * Licensed under the Apache License, Version 2.0 (the "License");
  1917. * you may not use this file except in compliance with the License.
  1918. * You may obtain a copy of the License at
  1919. *
  1920. * http://www.apache.org/licenses/LICENSE-2.0
  1921. *
  1922. * Unless required by applicable law or agreed to in writing, software
  1923. * distributed under the License is distributed on an "AS IS" BASIS,
  1924. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1925. * See the License for the specific language governing permissions and
  1926. * limitations under the License.
  1927. * =============================================================================
  1928. */
  1929. function(t,e,n){const o=Object(r.c)(t,n);return Object(i.a)(t,e,o,n)};var r=n("xMQ1"),i=n("M1Ti")},gkUh:function(t,e,n){var r;r=function(t){return function(){var e=t,n=e.lib.StreamCipher,r=[],i=[],o=[],s=e.algo.Rabbit=n.extend({_doReset:function(){for(var t=this._key.words,e=this.cfg.iv,n=0;n<4;n++)t[n]=16711935&(t[n]<<8|t[n]>>>24)|4278255360&(t[n]<<24|t[n]>>>8);var r=this._X=[t[0],t[3]<<16|t[2]>>>16,t[1],t[0]<<16|t[3]>>>16,t[2],t[1]<<16|t[0]>>>16,t[3],t[2]<<16|t[1]>>>16],i=this._C=[t[2]<<16|t[2]>>>16,4294901760&t[0]|65535&t[1],t[3]<<16|t[3]>>>16,4294901760&t[1]|65535&t[2],t[0]<<16|t[0]>>>16,4294901760&t[2]|65535&t[3],t[1]<<16|t[1]>>>16,4294901760&t[3]|65535&t[0]];this._b=0;for(n=0;n<4;n++)a.call(this);for(n=0;n<8;n++)i[n]^=r[n+4&7];if(e){var o=e.words,s=o[0],l=o[1],u=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),c=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8),h=u>>>16|4294901760&c,d=c<<16|65535&u;i[0]^=u,i[1]^=h,i[2]^=c,i[3]^=d,i[4]^=u,i[5]^=h,i[6]^=c,i[7]^=d;for(n=0;n<4;n++)a.call(this)}},_doProcessBlock:function(t,e){var n=this._X;a.call(this),r[0]=n[0]^n[5]>>>16^n[3]<<16,r[1]=n[2]^n[7]>>>16^n[5]<<16,r[2]=n[4]^n[1]>>>16^n[7]<<16,r[3]=n[6]^n[3]>>>16^n[1]<<16;for(var i=0;i<4;i++)r[i]=16711935&(r[i]<<8|r[i]>>>24)|4278255360&(r[i]<<24|r[i]>>>8),t[e+i]^=r[i]},blockSize:4,ivSize:2});function a(){for(var t=this._X,e=this._C,n=0;n<8;n++)i[n]=e[n];e[0]=e[0]+1295307597+this._b|0,e[1]=e[1]+3545052371+(e[0]>>>0<i[0]>>>0?1:0)|0,e[2]=e[2]+886263092+(e[1]>>>0<i[1]>>>0?1:0)|0,e[3]=e[3]+1295307597+(e[2]>>>0<i[2]>>>0?1:0)|0,e[4]=e[4]+3545052371+(e[3]>>>0<i[3]>>>0?1:0)|0,e[5]=e[5]+886263092+(e[4]>>>0<i[4]>>>0?1:0)|0,e[6]=e[6]+1295307597+(e[5]>>>0<i[5]>>>0?1:0)|0,e[7]=e[7]+3545052371+(e[6]>>>0<i[6]>>>0?1:0)|0,this._b=e[7]>>>0<i[7]>>>0?1:0;for(n=0;n<8;n++){var r=t[n]+e[n],s=65535&r,a=r>>>16,l=((s*s>>>17)+s*a>>>15)+a*a,u=((4294901760&r)*r|0)+((65535&r)*r|0);o[n]=l^u}t[0]=o[0]+(o[7]<<16|o[7]>>>16)+(o[6]<<16|o[6]>>>16)|0,t[1]=o[1]+(o[0]<<8|o[0]>>>24)+o[7]|0,t[2]=o[2]+(o[1]<<16|o[1]>>>16)+(o[0]<<16|o[0]>>>16)|0,t[3]=o[3]+(o[2]<<8|o[2]>>>24)+o[1]|0,t[4]=o[4]+(o[3]<<16|o[3]>>>16)+(o[2]<<16|o[2]>>>16)|0,t[5]=o[5]+(o[4]<<8|o[4]>>>24)+o[3]|0,t[6]=o[6]+(o[5]<<16|o[5]>>>16)+(o[4]<<16|o[4]>>>16)|0,t[7]=o[7]+(o[6]<<8|o[6]>>>24)+o[5]|0}e.Rabbit=n._createHelper(s)}(),t.Rabbit},t.exports=r(n("02Hb"),n("uFh6"),n("gykg"),n("wj1U"),n("fGru"))},gkZw:function(t,e,n){"use strict";var r=n("Kkag"),i=n("l5jf"),o=n("xMQ1"),s=n("XFvI"),a=n("35G1");const l=Object(a.a)({transpose_:
  1930. /**
  1931. * @license
  1932. * Copyright 2018 Google LLC. All Rights Reserved.
  1933. * Licensed under the Apache License, Version 2.0 (the "License");
  1934. * you may not use this file except in compliance with the License.
  1935. * You may obtain a copy of the License at
  1936. *
  1937. * http://www.apache.org/licenses/LICENSE-2.0
  1938. *
  1939. * Unless required by applicable law or agreed to in writing, software
  1940. * distributed under the License is distributed on an "AS IS" BASIS,
  1941. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1942. * See the License for the specific language governing permissions and
  1943. * limitations under the License.
  1944. * =============================================================================
  1945. */
  1946. function(t,e){const n=Object(o.a)(t,"x","transpose");if(null==e&&(e=n.shape.map((t,e)=>e).reverse()),s.assert(n.rank===e.length,()=>`Error in transpose: rank of input ${n.rank} `+`must match length of perm ${e}.`),e.forEach(t=>{s.assert(t>=0&&t<n.rank,()=>`All entries in 'perm' must be between 0 and ${n.rank-1}`+` but got ${e}`)}),n.rank<=1)return n.clone();const a={x:n},l={perm:e};return r.a.runKernel(i._104,a,l)}});e.a=l},gykg:function(t,e,n){var r;r=function(t){return function(e){var n=t,r=n.lib,i=r.WordArray,o=r.Hasher,s=n.algo,a=[];!function(){for(var t=0;t<64;t++)a[t]=4294967296*e.abs(e.sin(t+1))|0}();var l=s.MD5=o.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(t,e){for(var n=0;n<16;n++){var r=e+n,i=t[r];t[r]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var o=this._hash.words,s=t[e+0],l=t[e+1],p=t[e+2],f=t[e+3],g=t[e+4],m=t[e+5],v=t[e+6],b=t[e+7],_=t[e+8],y=t[e+9],T=t[e+10],x=t[e+11],E=t[e+12],w=t[e+13],C=t[e+14],S=t[e+15],k=o[0],O=o[1],I=o[2],R=o[3];O=d(O=d(O=d(O=d(O=h(O=h(O=h(O=h(O=c(O=c(O=c(O=c(O=u(O=u(O=u(O=u(O,I=u(I,R=u(R,k=u(k,O,I,R,s,7,a[0]),O,I,l,12,a[1]),k,O,p,17,a[2]),R,k,f,22,a[3]),I=u(I,R=u(R,k=u(k,O,I,R,g,7,a[4]),O,I,m,12,a[5]),k,O,v,17,a[6]),R,k,b,22,a[7]),I=u(I,R=u(R,k=u(k,O,I,R,_,7,a[8]),O,I,y,12,a[9]),k,O,T,17,a[10]),R,k,x,22,a[11]),I=u(I,R=u(R,k=u(k,O,I,R,E,7,a[12]),O,I,w,12,a[13]),k,O,C,17,a[14]),R,k,S,22,a[15]),I=c(I,R=c(R,k=c(k,O,I,R,l,5,a[16]),O,I,v,9,a[17]),k,O,x,14,a[18]),R,k,s,20,a[19]),I=c(I,R=c(R,k=c(k,O,I,R,m,5,a[20]),O,I,T,9,a[21]),k,O,S,14,a[22]),R,k,g,20,a[23]),I=c(I,R=c(R,k=c(k,O,I,R,y,5,a[24]),O,I,C,9,a[25]),k,O,f,14,a[26]),R,k,_,20,a[27]),I=c(I,R=c(R,k=c(k,O,I,R,w,5,a[28]),O,I,p,9,a[29]),k,O,b,14,a[30]),R,k,E,20,a[31]),I=h(I,R=h(R,k=h(k,O,I,R,m,4,a[32]),O,I,_,11,a[33]),k,O,x,16,a[34]),R,k,C,23,a[35]),I=h(I,R=h(R,k=h(k,O,I,R,l,4,a[36]),O,I,g,11,a[37]),k,O,b,16,a[38]),R,k,T,23,a[39]),I=h(I,R=h(R,k=h(k,O,I,R,w,4,a[40]),O,I,s,11,a[41]),k,O,f,16,a[42]),R,k,v,23,a[43]),I=h(I,R=h(R,k=h(k,O,I,R,y,4,a[44]),O,I,E,11,a[45]),k,O,S,16,a[46]),R,k,p,23,a[47]),I=d(I,R=d(R,k=d(k,O,I,R,s,6,a[48]),O,I,b,10,a[49]),k,O,C,15,a[50]),R,k,m,21,a[51]),I=d(I,R=d(R,k=d(k,O,I,R,E,6,a[52]),O,I,f,10,a[53]),k,O,T,15,a[54]),R,k,l,21,a[55]),I=d(I,R=d(R,k=d(k,O,I,R,_,6,a[56]),O,I,S,10,a[57]),k,O,v,15,a[58]),R,k,w,21,a[59]),I=d(I,R=d(R,k=d(k,O,I,R,g,6,a[60]),O,I,x,10,a[61]),k,O,p,15,a[62]),R,k,y,21,a[63]),o[0]=o[0]+k|0,o[1]=o[1]+O|0,o[2]=o[2]+I|0,o[3]=o[3]+R|0},_doFinalize:function(){var t=this._data,n=t.words,r=8*this._nDataBytes,i=8*t.sigBytes;n[i>>>5]|=128<<24-i%32;var o=e.floor(r/4294967296),s=r;n[15+(i+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),n[14+(i+64>>>9<<4)]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),t.sigBytes=4*(n.length+1),this._process();for(var a=this._hash,l=a.words,u=0;u<4;u++){var c=l[u];l[u]=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8)}return a},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t}});function u(t,e,n,r,i,o,s){var a=t+(e&n|~e&r)+i+s;return(a<<o|a>>>32-o)+e}function c(t,e,n,r,i,o,s){var a=t+(e&r|n&~r)+i+s;return(a<<o|a>>>32-o)+e}function h(t,e,n,r,i,o,s){var a=t+(e^n^r)+i+s;return(a<<o|a>>>32-o)+e}function d(t,e,n,r,i,o,s){var a=t+(n^(e|~r))+i+s;return(a<<o|a>>>32-o)+e}n.MD5=o._createHelper(l),n.HmacMD5=o._createHmacHelper(l)}(Math),t.MD5},t.exports=r(n("02Hb"))},h65t:function(t,e,n){var r=n("UuGF"),i=n("52gC");t.exports=function(t){return function(e,n){var o,s,a=String(i(e)),l=r(n),u=a.length;return l<0||l>=u?t?"":void 0:(o=a.charCodeAt(l))<55296||o>56319||l+1===u||(s=a.charCodeAt(l+1))<56320||s>57343?t?a.charAt(l):o:t?a.slice(l,l+2):s-56320+(o-55296<<10)+65536}}},hJx8:function(t,e,n){var r=n("evD5"),i=n("X8DO");t.exports=n("+E39")?function(t,e,n){return r.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},hSps:function(t,e,n){"use strict";var r=n("Kkag"),i=n("l5jf"),o=n("xMQ1"),s=n("35G1");const a=Object(s.a)({relu_:
  1947. /**
  1948. * @license
  1949. * Copyright 2020 Google LLC. All Rights Reserved.
  1950. * Licensed under the Apache License, Version 2.0 (the "License");
  1951. * you may not use this file except in compliance with the License.
  1952. * You may obtain a copy of the License at
  1953. *
  1954. * http://www.apache.org/licenses/LICENSE-2.0
  1955. *
  1956. * Unless required by applicable law or agreed to in writing, software
  1957. * distributed under the License is distributed on an "AS IS" BASIS,
  1958. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1959. * See the License for the specific language governing permissions and
  1960. * limitations under the License.
  1961. * =============================================================================
  1962. */
  1963. function(t){const e={x:Object(o.a)(t,"x","relu")};return r.a.runKernel(i._61,e)}});e.a=a},hjGT:function(t,e,n){var r;r=function(t){
  1964. /** @preserve
  1965. (c) 2012 by Cédric Mesnil. All rights reserved.
  1966. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
  1967. - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  1968. - 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.
  1969. 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 HOLDER 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.
  1970. */
  1971. return function(e){var n=t,r=n.lib,i=r.WordArray,o=r.Hasher,s=n.algo,a=i.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),l=i.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),u=i.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),c=i.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),h=i.create([0,1518500249,1859775393,2400959708,2840853838]),d=i.create([1352829926,1548603684,1836072691,2053994217,0]),p=s.RIPEMD160=o.extend({_doReset:function(){this._hash=i.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var n=0;n<16;n++){var r=e+n,i=t[r];t[r]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var o,s,p,y,T,x,E,w,C,S,k,O=this._hash.words,I=h.words,R=d.words,A=a.words,N=l.words,D=u.words,M=c.words;x=o=O[0],E=s=O[1],w=p=O[2],C=y=O[3],S=T=O[4];for(n=0;n<80;n+=1)k=o+t[e+A[n]]|0,k+=n<16?f(s,p,y)+I[0]:n<32?g(s,p,y)+I[1]:n<48?m(s,p,y)+I[2]:n<64?v(s,p,y)+I[3]:b(s,p,y)+I[4],k=(k=_(k|=0,D[n]))+T|0,o=T,T=y,y=_(p,10),p=s,s=k,k=x+t[e+N[n]]|0,k+=n<16?b(E,w,C)+R[0]:n<32?v(E,w,C)+R[1]:n<48?m(E,w,C)+R[2]:n<64?g(E,w,C)+R[3]:f(E,w,C)+R[4],k=(k=_(k|=0,M[n]))+S|0,x=S,S=C,C=_(w,10),w=E,E=k;k=O[1]+p+C|0,O[1]=O[2]+y+S|0,O[2]=O[3]+T+x|0,O[3]=O[4]+o+E|0,O[4]=O[0]+s+w|0,O[0]=k},_doFinalize:function(){var t=this._data,e=t.words,n=8*this._nDataBytes,r=8*t.sigBytes;e[r>>>5]|=128<<24-r%32,e[14+(r+64>>>9<<4)]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),t.sigBytes=4*(e.length+1),this._process();for(var i=this._hash,o=i.words,s=0;s<5;s++){var a=o[s];o[s]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8)}return i},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t}});function f(t,e,n){return t^e^n}function g(t,e,n){return t&e|~t&n}function m(t,e,n){return(t|~e)^n}function v(t,e,n){return t&n|e&~n}function b(t,e,n){return t^(e|~n)}function _(t,e){return t<<e|t>>>32-e}n.RIPEMD160=o._createHelper(p),n.HmacRIPEMD160=o._createHmacHelper(p)}(Math),t.RIPEMD160},t.exports=r(n("02Hb"))},hyEB:function(t,e,n){"use strict";e.__esModule=!0;var r=r||{};r.Utils=r.Utils||{},r.Utils.focusFirstDescendant=function(t){for(var e=0;e<t.childNodes.length;e++){var n=t.childNodes[e];if(r.Utils.attemptFocus(n)||r.Utils.focusFirstDescendant(n))return!0}return!1},r.Utils.focusLastDescendant=function(t){for(var e=t.childNodes.length-1;e>=0;e--){var n=t.childNodes[e];if(r.Utils.attemptFocus(n)||r.Utils.focusLastDescendant(n))return!0}return!1},r.Utils.attemptFocus=function(t){if(!r.Utils.isFocusable(t))return!1;r.Utils.IgnoreUtilFocusChanges=!0;try{t.focus()}catch(t){}return r.Utils.IgnoreUtilFocusChanges=!1,document.activeElement===t},r.Utils.isFocusable=function(t){if(t.tabIndex>0||0===t.tabIndex&&null!==t.getAttribute("tabIndex"))return!0;if(t.disabled)return!1;switch(t.nodeName){case"A":return!!t.href&&"ignore"!==t.rel;case"INPUT":return"hidden"!==t.type&&"file"!==t.type;case"BUTTON":case"SELECT":case"TEXTAREA":return!0;default:return!1}},r.Utils.triggerEvent=function(t,e){var n=void 0;n=/^mouse|click/.test(e)?"MouseEvents":/^key/.test(e)?"KeyboardEvent":"HTMLEvents";for(var r=document.createEvent(n),i=arguments.length,o=Array(i>2?i-2:0),s=2;s<i;s++)o[s-2]=arguments[s];return r.initEvent.apply(r,[e].concat(o)),t.dispatchEvent?t.dispatchEvent(r):t.fireEvent("on"+e,r),t},r.Utils.keys={tab:9,enter:13,space:32,left:37,up:38,right:39,down:40,esc:27},e.default=r.Utils},"i+52":function(t,e,n){(function(t){var r;!function(t,i,o){function s(t,e){return e.x=t.x,e.y=t.y,e.z=t.z,e.w=t.w,e.v=t.v,e.d=t.d,e}function a(t,e){var n=new function(t){var e=this,n="";e.next=function(){var t=e.x^e.x>>>2;return e.x=e.y,e.y=e.z,e.z=e.w,e.w=e.v,(e.d=e.d+362437|0)+(e.v=e.v^e.v<<4^t^t<<1)|0},e.x=0,e.y=0,e.z=0,e.w=0,e.v=0,t===(0|t)?e.x=t:n+=t;for(var r=0;r<n.length+64;r++)e.x^=0|n.charCodeAt(r),r==n.length&&(e.d=e.x<<10^e.x>>>4),e.next()}(t),r=e&&e.state,i=function(){return(n.next()>>>0)/4294967296};return i.double=function(){do{var t=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},i.int32=n.next,i.quick=i,r&&("object"==typeof r&&s(r,n),i.state=function(){return s(n,{})}),i}i&&i.exports?i.exports=a:n("LGuY")&&n("nErl")?void 0===(r=function(){return a}.call(e,n,e,i))||(i.exports=r):this.xorwow=a}(0,"object"==typeof t&&t,n("LGuY"))}).call(e,n("3IRH")(t))},i3rX:function(t,e,n){"use strict";var r=function(t){return function(t){return!!t&&"object"==typeof t}(t)&&!function(t){var e=Object.prototype.toString.call(t);return"[object RegExp]"===e||"[object Date]"===e||function(t){return t.$$typeof===i}(t)}(t)};var i="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function o(t,e){var n;return e&&!0===e.clone&&r(t)?a((n=t,Array.isArray(n)?[]:{}),t,e):t}function s(t,e,n){var i=t.slice();return e.forEach(function(e,s){void 0===i[s]?i[s]=o(e,n):r(e)?i[s]=a(t[s],e,n):-1===t.indexOf(e)&&i.push(o(e,n))}),i}function a(t,e,n){var i=Array.isArray(e);return i===Array.isArray(t)?i?((n||{arrayMerge:s}).arrayMerge||s)(t,e,n):function(t,e,n){var i={};return r(t)&&Object.keys(t).forEach(function(e){i[e]=o(t[e],n)}),Object.keys(e).forEach(function(s){r(e[s])&&t[s]?i[s]=a(t[s],e[s],n):i[s]=o(e[s],n)}),i}(t,e,n):o(e,n)}a.all=function(t,e){if(!Array.isArray(t)||t.length<2)throw new Error("first argument should be an array with at least two elements");return t.reduce(function(t,n){return a(t,n,e)})};var l=a;t.exports=l},iMyp:function(t,e,n){"use strict";(function(n,r){e.a=function(){return"object"==typeof n&&void 0!==t&&void 0!==r&&!!r.version}}).call(e,n("DuR2"),n("W2nU"))},iUbK:function(t,e,n){var r=n("7KvD").navigator;t.exports=r&&r.userAgent||""},jFbC:function(t,e,n){n("Cdx3"),t.exports=n("FeBl").Object.keys},"jKW+":function(t,e,n){"use strict";var r=n("kM2E"),i=n("qARP"),o=n("dNDb");r(r.S,"Promise",{try:function(t){var e=i.f(this),n=o(t);return(n.e?e.reject:e.resolve)(n.v),e.promise}})},jb1O:function(t,e,n){"use strict";e.c=
  1972. /**
  1973. * @license
  1974. * Copyright 2018 Google LLC. All Rights Reserved.
  1975. * Licensed under the Apache License, Version 2.0 (the "License");
  1976. * you may not use this file except in compliance with the License.
  1977. * You may obtain a copy of the License at
  1978. *
  1979. * http://www.apache.org/licenses/LICENSE-2.0
  1980. *
  1981. * Unless required by applicable law or agreed to in writing, software
  1982. * distributed under the License is distributed on an "AS IS" BASIS,
  1983. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1984. * See the License for the specific language governing permissions and
  1985. * limitations under the License.
  1986. * =============================================================================
  1987. */
  1988. function(t,e){if(t.dtype===e.dtype)return[t,e];const n=Object(i.b)(t.dtype,e.dtype);return[t.cast(n),e.cast(n)]},e.a=function(t,e){Object(o.assert)(t.dtype===e.dtype,()=>`The dtypes of the first(${t.dtype}) and`+` second(${e.dtype}) input must match`)},e.b=function(t){const e=[],n=new Set;return function t(e,n,i){if(null==e)return;if(e instanceof r.a)return void n.push(e);if(o=e,!Array.isArray(o)&&"object"!=typeof o)return;var o;const s=e;for(const e in s){const r=s[e];i.has(r)||(i.add(r),t(r,n,i))}}(t,e,n),e};var r=n("XPNO"),i=n("3goy"),o=n("XFvI")},jmaC:function(t,e,n){"use strict";e.__esModule=!0,e.default=function(t){for(var e=1,n=arguments.length;e<n;e++){var r=arguments[e]||{};for(var i in r)if(r.hasOwnProperty(i)){var o=r[i];void 0!==o&&(t[i]=o)}}return t}},jwfv:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n("Dd8w"),i=n.n(r),o=n("pFYg"),s=n.n(o),a=/%[sdj%]/g,l=function(){};function u(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=1,i=e[0],o=e.length;if("function"==typeof i)return i.apply(null,e.slice(1));if("string"==typeof i){for(var s=String(i).replace(a,function(t){if("%%"===t)return"%";if(r>=o)return t;switch(t){case"%s":return String(e[r++]);case"%d":return Number(e[r++]);case"%j":try{return JSON.stringify(e[r++])}catch(t){return"[Circular]"}break;default:return t}}),l=e[r];r<o;l=e[++r])s+=" "+l;return s}return i}function c(t,e){return void 0===t||null===t||(!("array"!==e||!Array.isArray(t)||t.length)||!(!function(t){return"string"===t||"url"===t||"hex"===t||"email"===t||"pattern"===t}(e)||"string"!=typeof t||t))}function h(t,e,n){var r=0,i=t.length;!function o(s){if(s&&s.length)n(s);else{var a=r;r+=1,a<i?e(t[a],o):n([])}}([])}function d(t,e,n,r){if(e.first)return h(function(t){var e=[];return Object.keys(t).forEach(function(n){e.push.apply(e,t[n])}),e}(t),n,r);var i=e.firstFields||[];!0===i&&(i=Object.keys(t));var o=Object.keys(t),s=o.length,a=0,l=[],u=function(t){l.push.apply(l,t),++a===s&&r(l)};o.forEach(function(e){var r=t[e];-1!==i.indexOf(e)?h(r,n,u):function(t,e,n){var r=[],i=0,o=t.length;function s(t){r.push.apply(r,t),++i===o&&n(r)}t.forEach(function(t){e(t,s)})}(r,n,u)})}function p(t){return function(e){return e&&e.message?(e.field=e.field||t.fullField,e):{message:e,field:e.field||t.fullField}}}function f(t,e){if(e)for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];"object"===(void 0===r?"undefined":s()(r))&&"object"===s()(t[n])?t[n]=i()({},t[n],r):t[n]=r}return t}var g=function(t,e,n,r,i,o){!t.required||n.hasOwnProperty(t.field)&&!c(e,o||t.type)||r.push(u(i.messages.required,t.fullField))};var m=function(t,e,n,r,i){(/^\s+$/.test(e)||""===e)&&r.push(u(i.messages.whitespace,t.fullField))},v={email:/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,url:new RegExp("^(?!mailto:)(?:(?:http|https|ftp)://|//)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$","i"),hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i},b={integer:function(t){return b.number(t)&&parseInt(t,10)===t},float:function(t){return b.number(t)&&!b.integer(t)},array:function(t){return Array.isArray(t)},regexp:function(t){if(t instanceof RegExp)return!0;try{return!!new RegExp(t)}catch(t){return!1}},date:function(t){return"function"==typeof t.getTime&&"function"==typeof t.getMonth&&"function"==typeof t.getYear},number:function(t){return!isNaN(t)&&"number"==typeof t},object:function(t){return"object"===(void 0===t?"undefined":s()(t))&&!b.array(t)},method:function(t){return"function"==typeof t},email:function(t){return"string"==typeof t&&!!t.match(v.email)&&t.length<255},url:function(t){return"string"==typeof t&&!!t.match(v.url)},hex:function(t){return"string"==typeof t&&!!t.match(v.hex)}};var _="enum";var y={required:g,whitespace:m,type:function(t,e,n,r,i){if(t.required&&void 0===e)g(t,e,n,r,i);else{var o=t.type;["integer","float","array","regexp","object","method","email","number","date","url","hex"].indexOf(o)>-1?b[o](e)||r.push(u(i.messages.types[o],t.fullField,t.type)):o&&(void 0===e?"undefined":s()(e))!==t.type&&r.push(u(i.messages.types[o],t.fullField,t.type))}},range:function(t,e,n,r,i){var o="number"==typeof t.len,s="number"==typeof t.min,a="number"==typeof t.max,l=e,c=null,h="number"==typeof e,d="string"==typeof e,p=Array.isArray(e);if(h?c="number":d?c="string":p&&(c="array"),!c)return!1;p&&(l=e.length),d&&(l=e.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"_").length),o?l!==t.len&&r.push(u(i.messages[c].len,t.fullField,t.len)):s&&!a&&l<t.min?r.push(u(i.messages[c].min,t.fullField,t.min)):a&&!s&&l>t.max?r.push(u(i.messages[c].max,t.fullField,t.max)):s&&a&&(l<t.min||l>t.max)&&r.push(u(i.messages[c].range,t.fullField,t.min,t.max))},enum:function(t,e,n,r,i){t[_]=Array.isArray(t[_])?t[_]:[],-1===t[_].indexOf(e)&&r.push(u(i.messages[_],t.fullField,t[_].join(", ")))},pattern:function(t,e,n,r,i){t.pattern&&(t.pattern instanceof RegExp?(t.pattern.lastIndex=0,t.pattern.test(e)||r.push(u(i.messages.pattern.mismatch,t.fullField,e,t.pattern))):"string"==typeof t.pattern&&(new RegExp(t.pattern).test(e)||r.push(u(i.messages.pattern.mismatch,t.fullField,e,t.pattern))))}};var T="enum";var x=function(t,e,n,r,i){var o=t.type,s=[];if(t.required||!t.required&&r.hasOwnProperty(t.field)){if(c(e,o)&&!t.required)return n();y.required(t,e,r,s,i,o),c(e,o)||y.type(t,e,r,s,i)}n(s)},E={string:function(t,e,n,r,i){var o=[];if(t.required||!t.required&&r.hasOwnProperty(t.field)){if(c(e,"string")&&!t.required)return n();y.required(t,e,r,o,i,"string"),c(e,"string")||(y.type(t,e,r,o,i),y.range(t,e,r,o,i),y.pattern(t,e,r,o,i),!0===t.whitespace&&y.whitespace(t,e,r,o,i))}n(o)},method:function(t,e,n,r,i){var o=[];if(t.required||!t.required&&r.hasOwnProperty(t.field)){if(c(e)&&!t.required)return n();y.required(t,e,r,o,i),void 0!==e&&y.type(t,e,r,o,i)}n(o)},number:function(t,e,n,r,i){var o=[];if(t.required||!t.required&&r.hasOwnProperty(t.field)){if(c(e)&&!t.required)return n();y.required(t,e,r,o,i),void 0!==e&&(y.type(t,e,r,o,i),y.range(t,e,r,o,i))}n(o)},boolean:function(t,e,n,r,i){var o=[];if(t.required||!t.required&&r.hasOwnProperty(t.field)){if(c(e)&&!t.required)return n();y.required(t,e,r,o,i),void 0!==e&&y.type(t,e,r,o,i)}n(o)},regexp:function(t,e,n,r,i){var o=[];if(t.required||!t.required&&r.hasOwnProperty(t.field)){if(c(e)&&!t.required)return n();y.required(t,e,r,o,i),c(e)||y.type(t,e,r,o,i)}n(o)},integer:function(t,e,n,r,i){var o=[];if(t.required||!t.required&&r.hasOwnProperty(t.field)){if(c(e)&&!t.required)return n();y.required(t,e,r,o,i),void 0!==e&&(y.type(t,e,r,o,i),y.range(t,e,r,o,i))}n(o)},float:function(t,e,n,r,i){var o=[];if(t.required||!t.required&&r.hasOwnProperty(t.field)){if(c(e)&&!t.required)return n();y.required(t,e,r,o,i),void 0!==e&&(y.type(t,e,r,o,i),y.range(t,e,r,o,i))}n(o)},array:function(t,e,n,r,i){var o=[];if(t.required||!t.required&&r.hasOwnProperty(t.field)){if(c(e,"array")&&!t.required)return n();y.required(t,e,r,o,i,"array"),c(e,"array")||(y.type(t,e,r,o,i),y.range(t,e,r,o,i))}n(o)},object:function(t,e,n,r,i){var o=[];if(t.required||!t.required&&r.hasOwnProperty(t.field)){if(c(e)&&!t.required)return n();y.required(t,e,r,o,i),void 0!==e&&y.type(t,e,r,o,i)}n(o)},enum:function(t,e,n,r,i){var o=[];if(t.required||!t.required&&r.hasOwnProperty(t.field)){if(c(e)&&!t.required)return n();y.required(t,e,r,o,i),e&&y[T](t,e,r,o,i)}n(o)},pattern:function(t,e,n,r,i){var o=[];if(t.required||!t.required&&r.hasOwnProperty(t.field)){if(c(e,"string")&&!t.required)return n();y.required(t,e,r,o,i),c(e,"string")||y.pattern(t,e,r,o,i)}n(o)},date:function(t,e,n,r,i){var o=[];if(t.required||!t.required&&r.hasOwnProperty(t.field)){if(c(e)&&!t.required)return n();if(y.required(t,e,r,o,i),!c(e)){var s=void 0;s="number"==typeof e?new Date(e):e,y.type(t,s,r,o,i),s&&y.range(t,s.getTime(),r,o,i)}}n(o)},url:x,hex:x,email:x,required:function(t,e,n,r,i){var o=[],a=Array.isArray(e)?"array":void 0===e?"undefined":s()(e);y.required(t,e,r,o,i,a),n(o)}};function w(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone:function(){var t=JSON.parse(JSON.stringify(this));return t.clone=this.clone,t}}}var C=w();function S(t){this.rules=null,this._messages=C,this.define(t)}S.prototype={messages:function(t){return t&&(this._messages=f(w(),t)),this._messages},define:function(t){if(!t)throw new Error("Cannot configure a schema with no rules");if("object"!==(void 0===t?"undefined":s()(t))||Array.isArray(t))throw new Error("Rules must be an object");this.rules={};var e=void 0,n=void 0;for(e in t)t.hasOwnProperty(e)&&(n=t[e],this.rules[e]=Array.isArray(n)?n:[n])},validate:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments[2],o=t,a=n,c=r;if("function"==typeof a&&(c=a,a={}),this.rules&&0!==Object.keys(this.rules).length){if(a.messages){var h=this.messages();h===C&&(h=w()),f(h,a.messages),a.messages=h}else a.messages=this.messages();var g=void 0,m=void 0,v={};(a.keys||Object.keys(this.rules)).forEach(function(n){g=e.rules[n],m=o[n],g.forEach(function(r){var s=r;"function"==typeof s.transform&&(o===t&&(o=i()({},o)),m=o[n]=s.transform(m)),(s="function"==typeof s?{validator:s}:i()({},s)).validator=e.getValidationMethod(s),s.field=n,s.fullField=s.fullField||n,s.type=e.getType(s),s.validator&&(v[n]=v[n]||[],v[n].push({rule:s,value:m,source:o,field:n}))})});var b={};d(v,a,function(t,e){var n=t.rule,r=!("object"!==n.type&&"array"!==n.type||"object"!==s()(n.fields)&&"object"!==s()(n.defaultField));function o(t,e){return i()({},e,{fullField:n.fullField+"."+t})}function c(){var s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(Array.isArray(s)||(s=[s]),s.length&&l("async-validator:",s),s.length&&n.message&&(s=[].concat(n.message)),s=s.map(p(n)),a.first&&s.length)return b[n.field]=1,e(s);if(r){if(n.required&&!t.value)return s=n.message?[].concat(n.message).map(p(n)):a.error?[a.error(n,u(a.messages.required,n.field))]:[],e(s);var c={};if(n.defaultField)for(var h in t.value)t.value.hasOwnProperty(h)&&(c[h]=n.defaultField);for(var d in c=i()({},c,t.rule.fields))if(c.hasOwnProperty(d)){var f=Array.isArray(c[d])?c[d]:[c[d]];c[d]=f.map(o.bind(null,d))}var g=new S(c);g.messages(a.messages),t.rule.options&&(t.rule.options.messages=a.messages,t.rule.options.error=a.error),g.validate(t.value,t.rule.options||a,function(t){e(t&&t.length?s.concat(t):t)})}else e(s)}r=r&&(n.required||!n.required&&t.value),n.field=t.field;var h=n.validator(n,t.value,c,t.source,a);h&&h.then&&h.then(function(){return c()},function(t){return c(t)})},function(t){!function(t){var e,n=void 0,r=void 0,i=[],o={};for(n=0;n<t.length;n++)e=t[n],Array.isArray(e)?i=i.concat.apply(i,e):i.push(e);if(i.length)for(n=0;n<i.length;n++)o[r=i[n].field]=o[r]||[],o[r].push(i[n]);else i=null,o=null;c(i,o)}(t)})}else c&&c()},getType:function(t){if(void 0===t.type&&t.pattern instanceof RegExp&&(t.type="pattern"),"function"!=typeof t.validator&&t.type&&!E.hasOwnProperty(t.type))throw new Error(u("Unknown rule type %s",t.type));return t.type||"string"},getValidationMethod:function(t){if("function"==typeof t.validator)return t.validator;var e=Object.keys(t),n=e.indexOf("message");return-1!==n&&e.splice(n,1),1===e.length&&"required"===e[0]?E.required:E[this.getType(t)]||!1}},S.register=function(t,e){if("function"!=typeof e)throw new Error("Cannot register a validator by type, validator is not a function");E[t]=e},S.messages=C;e.default=S},jyFz:function(t,e,n){var r=function(){return this}()||Function("return this")(),i=r.regeneratorRuntime&&Object.getOwnPropertyNames(r).indexOf("regeneratorRuntime")>=0,o=i&&r.regeneratorRuntime;if(r.regeneratorRuntime=void 0,t.exports=n("SldL"),i)r.regeneratorRuntime=o;else try{delete r.regeneratorRuntime}catch(t){r.regeneratorRuntime=void 0}},kESI:function(t,e,n){"use strict";let r;Object.defineProperty(e,"__esModule",{value:!0}),e.mockIsMobile=function(t){r=t},e.isMobile=function(t){if(void 0!==r)return r;if(t||"undefined"!=typeof navigator&&null!=navigator){if(t||(t=navigator),"ReactNative"===t.product)return!0;const e=t.userAgent||t.vendor||("undefined"!=typeof window?window.opera:"");if(!e){const e=t;return e.userAgentData&&e.userAgentData.mobile}return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substr(0,4))}return!1},e.isBrowser=function(){return"undefined"!=typeof window&&null!=window.document||"undefined"!=typeof WorkerGlobalScope}},kM2E:function(t,e,n){var r=n("7KvD"),i=n("FeBl"),o=n("+ZMJ"),s=n("hJx8"),a=n("D2L2"),l=function(t,e,n){var u,c,h,d=t&l.F,p=t&l.G,f=t&l.S,g=t&l.P,m=t&l.B,v=t&l.W,b=p?i:i[e]||(i[e]={}),_=b.prototype,y=p?r:f?r[e]:(r[e]||{}).prototype;for(u in p&&(n=e),n)(c=!d&&y&&void 0!==y[u])&&a(b,u)||(h=c?y[u]:n[u],b[u]=p&&"function"!=typeof y[u]?n[u]:m&&c?o(h,r):v&&y[u]==h?function(t){var e=function(e,n,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,r)}return t.apply(this,arguments)};return e.prototype=t.prototype,e}(h):g&&"function"==typeof h?o(Function.call,h):h,g&&((b.virtual||(b.virtual={}))[u]=h,t&l.R&&_&&!_[u]&&s(_,u,h)))};l.F=1,l.G=2,l.S=4,l.P=8,l.B=16,l.W=32,l.U=64,l.R=128,t.exports=l},kNJA:function(t,e,n){t.exports=function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/dist/",n(n.s=58)}({0:function(t,e,n){"use strict";function r(t,e,n,r,i,o,s,a){var l,u="function"==typeof t?t.options:t;if(e&&(u.render=e,u.staticRenderFns=n,u._compiled=!0),r&&(u.functional=!0),o&&(u._scopeId="data-v-"+o),s?(l=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(s)},u._ssrRegister=l):i&&(l=a?function(){i.call(this,this.$root.$options.shadowRoot)}:i),l)if(u.functional){u._injectStyles=l;var c=u.render;u.render=function(t,e){return l.call(e),c(t,e)}}else{var h=u.beforeCreate;u.beforeCreate=h?[].concat(h,l):[l]}return{exports:t,options:u}}n.d(e,"a",function(){return r})},15:function(t,e){t.exports=n("fEB+")},18:function(t,e){t.exports=n("EKTV")},21:function(t,e){t.exports=n("E/in")},26:function(t,e){t.exports=n("nvbp")},3:function(t,e){t.exports=n("ylDJ")},31:function(t,e){t.exports=n("zTCi")},40:function(t,e){t.exports=n("hyEB")},51:function(t,e){t.exports=n("RDoK")},58:function(t,e,n){"use strict";n.r(e);var r=function(){var t=this.$createElement,e=this._self._c||t;return e("div",{class:["el-cascader-panel",this.border&&"is-bordered"],on:{keydown:this.handleKeyDown}},this._l(this.menus,function(t,n){return e("cascader-menu",{key:n,ref:"menu",refInFor:!0,attrs:{index:n,nodes:t}})}),1)};r._withStripped=!0;var i=n(26),o=n.n(i),s=n(15),a=n.n(s),l=n(18),u=n.n(l),c=n(51),h=n.n(c),d=n(3),p=function(t){return t.stopPropagation()},f={inject:["panel"],components:{ElCheckbox:u.a,ElRadio:h.a},props:{node:{required:!0},nodeId:String},computed:{config:function(){return this.panel.config},isLeaf:function(){return this.node.isLeaf},isDisabled:function(){return this.node.isDisabled},checkedValue:function(){return this.panel.checkedValue},isChecked:function(){return this.node.isSameNode(this.checkedValue)},inActivePath:function(){return this.isInPath(this.panel.activePath)},inCheckedPath:function(){var t=this;return!!this.config.checkStrictly&&this.panel.checkedNodePaths.some(function(e){return t.isInPath(e)})},value:function(){return this.node.getValueByOption()}},methods:{handleExpand:function(){var t=this,e=this.panel,n=this.node,r=this.isDisabled,i=this.config,o=i.multiple;!i.checkStrictly&&r||n.loading||(i.lazy&&!n.loaded?e.lazyLoad(n,function(){var e=t.isLeaf;if(e||t.handleExpand(),o){var r=!!e&&n.checked;t.handleMultiCheckChange(r)}}):e.handleExpand(n))},handleCheckChange:function(){var t=this.panel,e=this.value,n=this.node;t.handleCheckChange(e),t.handleExpand(n)},handleMultiCheckChange:function(t){this.node.doCheck(t),this.panel.calculateMultiCheckedValue()},isInPath:function(t){var e=this.node;return(t[e.level-1]||{}).uid===e.uid},renderPrefix:function(t){var e=this.isLeaf,n=this.isChecked,r=this.config,i=r.checkStrictly;return r.multiple?this.renderCheckbox(t):i?this.renderRadio(t):e&&n?this.renderCheckIcon(t):null},renderPostfix:function(t){var e=this.node,n=this.isLeaf;return e.loading?this.renderLoadingIcon(t):n?null:this.renderExpandIcon(t)},renderCheckbox:function(t){var e=this.node,n=this.config,r=this.isDisabled,i={on:{change:this.handleMultiCheckChange},nativeOn:{}};return n.checkStrictly&&(i.nativeOn.click=p),t("el-checkbox",o()([{attrs:{value:e.checked,indeterminate:e.indeterminate,disabled:r}},i]))},renderRadio:function(t){var e=this.checkedValue,n=this.value,r=this.isDisabled;return Object(d.isEqual)(n,e)&&(n=e),t("el-radio",{attrs:{value:e,label:n,disabled:r},on:{change:this.handleCheckChange},nativeOn:{click:p}},[t("span")])},renderCheckIcon:function(t){return t("i",{class:"el-icon-check el-cascader-node__prefix"})},renderLoadingIcon:function(t){return t("i",{class:"el-icon-loading el-cascader-node__postfix"})},renderExpandIcon:function(t){return t("i",{class:"el-icon-arrow-right el-cascader-node__postfix"})},renderContent:function(t){var e=this.panel,n=this.node,r=e.renderLabelFn;return t("span",{class:"el-cascader-node__label"},[(r?r({node:n,data:n.data}):null)||n.label])}},render:function(t){var e=this,n=this.inActivePath,r=this.inCheckedPath,i=this.isChecked,s=this.isLeaf,a=this.isDisabled,l=this.config,u=this.nodeId,c=l.expandTrigger,h=l.checkStrictly,d=l.multiple,p=!h&&a,f={on:{}};return"click"===c?f.on.click=this.handleExpand:(f.on.mouseenter=function(t){e.handleExpand(),e.$emit("expand",t)},f.on.focus=function(t){e.handleExpand(),e.$emit("expand",t)}),!s||a||h||d||(f.on.click=this.handleCheckChange),t("li",o()([{attrs:{role:"menuitem",id:u,"aria-expanded":n,tabindex:p?null:-1},class:{"el-cascader-node":!0,"is-selectable":h,"in-active-path":n,"in-checked-path":r,"is-active":i,"is-disabled":p}},f]),[this.renderPrefix(t),this.renderContent(t),this.renderPostfix(t)])}},g=n(0),m=Object(g.a)(f,void 0,void 0,!1,null,null,null);m.options.__file="packages/cascader-panel/src/cascader-node.vue";var v=m.exports,b=n(6),_={name:"ElCascaderMenu",mixins:[n.n(b).a],inject:["panel"],components:{ElScrollbar:a.a,CascaderNode:v},props:{nodes:{type:Array,required:!0},index:Number},data:function(){return{activeNode:null,hoverTimer:null,id:Object(d.generateId)()}},computed:{isEmpty:function(){return!this.nodes.length},menuId:function(){return"cascader-menu-"+this.id+"-"+this.index}},methods:{handleExpand:function(t){this.activeNode=t.target},handleMouseMove:function(t){var e=this.activeNode,n=this.hoverTimer,r=this.$refs.hoverZone;if(e&&r)if(e.contains(t.target)){clearTimeout(n);var i=this.$el.getBoundingClientRect().left,o=t.clientX-i,s=this.$el,a=s.offsetWidth,l=s.offsetHeight,u=e.offsetTop,c=u+e.offsetHeight;r.innerHTML='\n <path style="pointer-events: auto;" fill="transparent" d="M'+o+" "+u+" L"+a+" 0 V"+u+' Z" />\n <path style="pointer-events: auto;" fill="transparent" d="M'+o+" "+c+" L"+a+" "+l+" V"+c+' Z" />\n '}else n||(this.hoverTimer=setTimeout(this.clearHoverZone,this.panel.config.hoverThreshold))},clearHoverZone:function(){var t=this.$refs.hoverZone;t&&(t.innerHTML="")},renderEmptyText:function(t){return t("div",{class:"el-cascader-menu__empty-text"},[this.t("el.cascader.noData")])},renderNodeList:function(t){var e=this.menuId,n=this.panel.isHoverMenu,r={on:{}};n&&(r.on.expand=this.handleExpand);var i=this.nodes.map(function(n,i){var s=n.hasChildren;return t("cascader-node",o()([{key:n.uid,attrs:{node:n,"node-id":e+"-"+i,"aria-haspopup":s,"aria-owns":s?e:null}},r]))});return[].concat(i,[n?t("svg",{ref:"hoverZone",class:"el-cascader-menu__hover-zone"}):null])}},render:function(t){var e=this.isEmpty,n=this.menuId,r={nativeOn:{}};return this.panel.isHoverMenu&&(r.nativeOn.mousemove=this.handleMouseMove),t("el-scrollbar",o()([{attrs:{tag:"ul",role:"menu",id:n,"wrap-class":"el-cascader-menu__wrap","view-class":{"el-cascader-menu__list":!0,"is-empty":e}},class:"el-cascader-menu"},r]),[e?this.renderEmptyText(t):this.renderNodeList(t)])}},y=Object(g.a)(_,void 0,void 0,!1,null,null,null);y.options.__file="packages/cascader-panel/src/cascader-menu.vue";var T=y.exports,x=n(21),E=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();var w=0,C=function(){function t(e,n,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.data=e,this.config=n,this.parent=r||null,this.level=this.parent?this.parent.level+1:1,this.uid=w++,this.initState(),this.initChildren()}return t.prototype.initState=function(){var t=this.config,e=t.value,n=t.label;this.value=this.data[e],this.label=this.data[n],this.pathNodes=this.calculatePathNodes(),this.path=this.pathNodes.map(function(t){return t.value}),this.pathLabels=this.pathNodes.map(function(t){return t.label}),this.loading=!1,this.loaded=!1},t.prototype.initChildren=function(){var e=this,n=this.config,r=n.children,i=this.data[r];this.hasChildren=Array.isArray(i),this.children=(i||[]).map(function(r){return new t(r,n,e)})},t.prototype.calculatePathNodes=function(){for(var t=[this],e=this.parent;e;)t.unshift(e),e=e.parent;return t},t.prototype.getPath=function(){return this.path},t.prototype.getValue=function(){return this.value},t.prototype.getValueByOption=function(){return this.config.emitPath?this.getPath():this.getValue()},t.prototype.getText=function(t,e){return t?this.pathLabels.join(e):this.label},t.prototype.isSameNode=function(t){var e=this.getValueByOption();return this.config.multiple&&Array.isArray(t)?t.some(function(t){return Object(d.isEqual)(t,e)}):Object(d.isEqual)(t,e)},t.prototype.broadcast=function(t){for(var e=arguments.length,n=Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];var i="onParent"+Object(d.capitalize)(t);this.children.forEach(function(e){e&&(e.broadcast.apply(e,[t].concat(n)),e[i]&&e[i].apply(e,n))})},t.prototype.emit=function(t){var e=this.parent,n="onChild"+Object(d.capitalize)(t);if(e){for(var r=arguments.length,i=Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];e[n]&&e[n].apply(e,i),e.emit.apply(e,[t].concat(i))}},t.prototype.onParentCheck=function(t){this.isDisabled||this.setCheckState(t)},t.prototype.onChildCheck=function(){var t=this.children.filter(function(t){return!t.isDisabled}),e=!!t.length&&t.every(function(t){return t.checked});this.setCheckState(e)},t.prototype.setCheckState=function(t){var e=this.children.length,n=this.children.reduce(function(t,e){return t+(e.checked?1:e.indeterminate?.5:0)},0);this.checked=t,this.indeterminate=n!==e&&n>0},t.prototype.syncCheckState=function(t){var e=this.getValueByOption(),n=this.isSameNode(t,e);this.doCheck(n)},t.prototype.doCheck=function(t){this.checked!==t&&(this.config.checkStrictly?this.checked=t:(this.broadcast("check",t),this.setCheckState(t),this.emit("check")))},E(t,[{key:"isDisabled",get:function(){var t=this.data,e=this.parent,n=this.config,r=n.disabled,i=n.checkStrictly;return t[r]||!i&&e&&e.isDisabled}},{key:"isLeaf",get:function(){var t=this.data,e=this.loaded,n=this.hasChildren,r=this.children,i=this.config,o=i.lazy,s=i.leaf;if(o){var a=Object(x.isDef)(t[s])?t[s]:!!e&&!r.length;return this.hasChildren=!a,a}return!n}}]),t}();var S=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.config=n,this.initNodes(e)}return t.prototype.initNodes=function(t){var e=this;t=Object(d.coerceTruthyValueToArray)(t),this.nodes=t.map(function(t){return new C(t,e.config)}),this.flattedNodes=this.getFlattedNodes(!1,!1),this.leafNodes=this.getFlattedNodes(!0,!1)},t.prototype.appendNode=function(t,e){var n=new C(t,this.config,e);(e?e.children:this.nodes).push(n)},t.prototype.appendNodes=function(t,e){var n=this;(t=Object(d.coerceTruthyValueToArray)(t)).forEach(function(t){return n.appendNode(t,e)})},t.prototype.getNodes=function(){return this.nodes},t.prototype.getFlattedNodes=function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=t?this.leafNodes:this.flattedNodes;return e?n:function t(e,n){return e.reduce(function(e,r){return r.isLeaf?e.push(r):(!n&&e.push(r),e=e.concat(t(r.children,n))),e},[])}(this.nodes,t)},t.prototype.getNodeByValue=function(t){if(t){var e=this.getFlattedNodes(!1,!this.config.lazy).filter(function(e){return Object(d.valueEquals)(e.path,t)||e.value===t});return e&&e.length?e[0]:null}return null},t}(),k=n(9),O=n.n(k),I=n(40),R=n.n(I),A=n(31),N=n.n(A),D=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},M=R.a.keys,L={expandTrigger:"click",multiple:!1,checkStrictly:!1,emitPath:!0,lazy:!1,lazyLoad:d.noop,value:"value",label:"label",children:"children",leaf:"leaf",disabled:"disabled",hoverThreshold:500},P=function(t){return!t.getAttribute("aria-owns")},F=function(t,e){var n=t.parentNode;if(n){var r=n.querySelectorAll('.el-cascader-node[tabindex="-1"]');return r[Array.prototype.indexOf.call(r,t)+e]||null}return null},B=function(t,e){if(t){var n=t.id.split("-");return Number(n[n.length-2])}},j=function(t){t&&(t.focus(),!P(t)&&t.click())},$={name:"ElCascaderPanel",components:{CascaderMenu:T},props:{value:{},options:Array,props:Object,border:{type:Boolean,default:!0},renderLabel:Function},provide:function(){return{panel:this}},data:function(){return{checkedValue:null,checkedNodePaths:[],store:[],menus:[],activePath:[],loadCount:0}},computed:{config:function(){return O()(D({},L),this.props||{})},multiple:function(){return this.config.multiple},checkStrictly:function(){return this.config.checkStrictly},leafOnly:function(){return!this.checkStrictly},isHoverMenu:function(){return"hover"===this.config.expandTrigger},renderLabelFn:function(){return this.renderLabel||this.$scopedSlots.default}},watch:{options:{handler:function(){this.initStore()},immediate:!0,deep:!0},value:function(){this.syncCheckedValue(),this.checkStrictly&&this.calculateCheckedNodePaths()},checkedValue:function(t){Object(d.isEqual)(t,this.value)||(this.checkStrictly&&this.calculateCheckedNodePaths(),this.$emit("input",t),this.$emit("change",t))}},mounted:function(){Object(d.isEmpty)(this.value)||this.syncCheckedValue()},methods:{initStore:function(){var t=this.config,e=this.options;t.lazy&&Object(d.isEmpty)(e)?this.lazyLoad():(this.store=new S(e,t),this.menus=[this.store.getNodes()],this.syncMenuState())},syncCheckedValue:function(){var t=this.value,e=this.checkedValue;Object(d.isEqual)(t,e)||(this.activePath=[],this.checkedValue=t,this.syncMenuState())},syncMenuState:function(){var t=this.multiple,e=this.checkStrictly;this.syncActivePath(),t&&this.syncMultiCheckState(),e&&this.calculateCheckedNodePaths(),this.$nextTick(this.scrollIntoView)},syncMultiCheckState:function(){var t=this;this.getFlattedNodes(this.leafOnly).forEach(function(e){e.syncCheckState(t.checkedValue)})},syncActivePath:function(){var t=this,e=this.store,n=this.multiple,r=this.activePath,i=this.checkedValue;if(Object(d.isEmpty)(r))if(Object(d.isEmpty)(i))this.activePath=[],this.menus=[e.getNodes()];else{var o=n?i[0]:i,s=((this.getNodeByValue(o)||{}).pathNodes||[]).slice(0,-1);this.expandNodes(s)}else{var a=r.map(function(e){return t.getNodeByValue(e.getValue())});this.expandNodes(a)}},expandNodes:function(t){var e=this;t.forEach(function(t){return e.handleExpand(t,!0)})},calculateCheckedNodePaths:function(){var t=this,e=this.checkedValue,n=this.multiple?Object(d.coerceTruthyValueToArray)(e):[e];this.checkedNodePaths=n.map(function(e){var n=t.getNodeByValue(e);return n?n.pathNodes:[]})},handleKeyDown:function(t){var e=t.target;switch(t.keyCode){case M.up:var n=F(e,-1);j(n);break;case M.down:var r=F(e,1);j(r);break;case M.left:var i=this.$refs.menu[B(e)-1];if(i){var o=i.$el.querySelector('.el-cascader-node[aria-expanded="true"]');j(o)}break;case M.right:var s=this.$refs.menu[B(e)+1];if(s){var a=s.$el.querySelector('.el-cascader-node[tabindex="-1"]');j(a)}break;case M.enter:!function(t){if(t){var e=t.querySelector("input");e?e.click():P(t)&&t.click()}}(e);break;case M.esc:case M.tab:this.$emit("close");break;default:return}},handleExpand:function(t,e){var n=this.activePath,r=t.level,i=n.slice(0,r-1),o=this.menus.slice(0,r);if(t.isLeaf||(i.push(t),o.push(t.children)),this.activePath=i,this.menus=o,!e){var s=i.map(function(t){return t.getValue()}),a=n.map(function(t){return t.getValue()});Object(d.valueEquals)(s,a)||(this.$emit("active-item-change",s),this.$emit("expand-change",s))}},handleCheckChange:function(t){this.checkedValue=t},lazyLoad:function(t,e){var n=this,r=this.config;t||(t=t||{root:!0,level:0},this.store=new S([],r),this.menus=[this.store.getNodes()]),t.loading=!0;r.lazyLoad(t,function(r){var i=t.root?null:t;if(r&&r.length&&n.store.appendNodes(r,i),t.loading=!1,t.loaded=!0,Array.isArray(n.checkedValue)){var o=n.checkedValue[n.loadCount++],s=n.config.value,a=n.config.leaf;if(Array.isArray(r)&&r.filter(function(t){return t[s]===o}).length>0){var l=n.store.getNodeByValue(o);l.data[a]||n.lazyLoad(l,function(){n.handleExpand(l)}),n.loadCount===n.checkedValue.length&&n.$parent.computePresentText()}}e&&e(r)})},calculateMultiCheckedValue:function(){this.checkedValue=this.getCheckedNodes(this.leafOnly).map(function(t){return t.getValueByOption()})},scrollIntoView:function(){this.$isServer||(this.$refs.menu||[]).forEach(function(t){var e=t.$el;if(e){var n=e.querySelector(".el-scrollbar__wrap"),r=e.querySelector(".el-cascader-node.is-active")||e.querySelector(".el-cascader-node.in-active-path");N()(n,r)}})},getNodeByValue:function(t){return this.store.getNodeByValue(t)},getFlattedNodes:function(t){var e=!this.config.lazy;return this.store.getFlattedNodes(t,e)},getCheckedNodes:function(t){var e=this.checkedValue;return this.multiple?this.getFlattedNodes(t).filter(function(t){return t.checked}):Object(d.isEmpty)(e)?[]:[this.getNodeByValue(e)]},clearCheckedNodes:function(){var t=this.config,e=this.leafOnly,n=t.multiple,r=t.emitPath;n?(this.getCheckedNodes(e).filter(function(t){return!t.isDisabled}).forEach(function(t){return t.doCheck(!1)}),this.calculateMultiCheckedValue()):this.checkedValue=r?[]:null}}},U=Object(g.a)($,r,[],!1,null,null,null);U.options.__file="packages/cascader-panel/src/cascader-panel.vue";var V=U.exports;V.install=function(t){t.component(V.name,V)};e.default=V},6:function(t,e){t.exports=n("y+7x")},9:function(t,e){t.exports=n("jmaC")}})},kVWZ:function(t,e,n){var r;r=function(t){var e,n;return t.mode.CTR=(e=t.lib.BlockCipherMode.extend(),n=e.Encryptor=e.extend({processBlock:function(t,e){var n=this._cipher,r=n.blockSize,i=this._iv,o=this._counter;i&&(o=this._counter=i.slice(0),this._iv=void 0);var s=o.slice(0);n.encryptBlock(s,0),o[r-1]=o[r-1]+1|0;for(var a=0;a<r;a++)t[e+a]^=s[a]}}),e.Decryptor=n,e),t.mode.CTR},t.exports=r(n("02Hb"),n("fGru"))},ke9e:function(t,e,n){"use strict";e.a=
  1989. /**
  1990. * @license
  1991. * Copyright 2018 Google LLC. All Rights Reserved.
  1992. * Licensed under the Apache License, Version 2.0 (the "License");
  1993. * you may not use this file except in compliance with the License.
  1994. * You may obtain a copy of the License at
  1995. *
  1996. * http://www.apache.org/licenses/LICENSE-2.0
  1997. *
  1998. * Unless required by applicable law or agreed to in writing, software
  1999. * distributed under the License is distributed on an "AS IS" BASIS,
  2000. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2001. * See the License for the specific language governing permissions and
  2002. * limitations under the License.
  2003. * =============================================================================
  2004. */
  2005. function(t,e,n){if(Object(i.assertNonNull)(t),null!=e&&3!==e.length)throw new Error("tensor3d() requires shape to have three numbers");const s=Object(r.c)(t,n);if(3!==s.length&&1!==s.length)throw new Error("tensor3d() requires values to be number[][][] or flat/TypedArray");if(1===s.length&&null==e)throw new Error("tensor3d() requires shape to be provided when `values` are a flat array");return Object(o.a)(t,e,s,n)};var r=n("xMQ1"),i=n("XFvI"),o=n("M1Ti")},knuC:function(t,e){t.exports=function(t,e,n){var r=void 0===n;switch(e.length){case 0:return r?t():t.call(n);case 1:return r?t(e[0]):t.call(n,e[0]);case 2:return r?t(e[0],e[1]):t.call(n,e[0],e[1]);case 3:return r?t(e[0],e[1],e[2]):t.call(n,e[0],e[1],e[2]);case 4:return r?t(e[0],e[1],e[2],e[3]):t.call(n,e[0],e[1],e[2],e[3])}return t.apply(n,e)}},l5jf:function(t,e,n){"use strict";e.a="Abs";e.b="Acos";e.c="Acosh";e.d="Add";e.e="AddN";e.f="All";e.g="Any";e.h="ArgMax";e.i="ArgMin";e.j="Asin";e.k="Asinh";e.l="Atan";e.n="Atanh";e.m="Atan2";e.o="AvgPool";e.r="AvgPoolGrad";e.p="AvgPool3D";e.q="AvgPool3DGrad";e.s="BatchMatMul";e.t="BatchToSpaceND";e.u="Bincount";e.v="BroadcastArgs";e.w="Cast";e.x="Ceil";e.y="ClipByValue";e.z="Complex";e.A="ComplexAbs";e.B="Concat";e.C="Conv2D";e.D="Conv2DBackpropFilter";e.E="Conv2DBackpropInput";e.F="Conv3D";e.G="Conv3DBackpropFilterV2";e.H="Conv3DBackpropInputV2";e.I="Cos";e.J="Cosh";e.L="Cumsum";e.K="CropAndResize";e.M="DenseBincount";e.N="DepthToSpace";e.O="DepthwiseConv2dNative";e.P="DepthwiseConv2dNativeBackpropFilter";e.Q="DepthwiseConv2dNativeBackpropInput";e.R="Diag";e.S="Dilation2D";e._59="RealDiv";e.T="Einsum";e.U="Elu";e.V="EluGrad";e.X="Erf";e.W="Equal";e.Y="Exp";e.Z="ExpandDims";e._0="Expm1";e._1="FFT";e._2="Fill";e._3="FlipLeftRight";e._4="Floor";e._5="FloorDiv";e._7="FusedBatchNorm";e._11="GatherV2";e._10="GatherNd";e._12="Greater";e._13="GreaterEqual";e._15="Identity";e._14="IFFT";e._16="Imag";e._17="IsFinite";e._18="IsInf";e._19="IsNan";e._22="LeakyRelu";e._23="Less";e._24="LessEqual";e._25="LinSpace";e._26="Log";e._27="Log1p";e._28="LogicalAnd";e._29="LogicalNot";e._30="LogicalOr";e._20="LRN";e._21="LRNGrad";e._31="Max";e._37="Maximum";e._32="MaxPool";e._35="MaxPoolGrad";e._33="MaxPool3D";e._34="MaxPool3DGrad";e._36="MaxPoolWithArgmax";e._38="Mean";e._39="Min";e._40="Minimum";e._41="MirrorPad";e._42="Mod";e._43="Multinomial";e._44="Multiply";e._45="Neg";e._49="NotEqual";e._46="NonMaxSuppressionV3";e._47="NonMaxSuppressionV4";e._48="NonMaxSuppressionV5";e._51="OnesLike";e._50="OneHot";e._52="Pack";e._53="PadV2";e._54="Pow";e._55="Prelu";e._56="Prod";e._57="Range";e._58="Real";e._60="Reciprocal";e._61="Relu";e._63="Reshape";e._66="ResizeNearestNeighbor";e._67="ResizeNearestNeighborGrad";e._64="ResizeBilinear";e._65="ResizeBilinearGrad";e._62="Relu6";e._68="Reverse";e._70="Round";e._71="Rsqrt";e._72="ScatterNd";e._73="Select";e._74="Selu";e._79="Slice";e._77="Sin";e._78="Sinh";e._76="Sign";e._75="Sigmoid";e._81="Softplus";e._89="Sqrt";e._98="Sum";e._82="SpaceToBatchND";e._88="SplitV";e._80="Softmax";e._83="SparseFillEmptyRows";e._84="SparseReshape";e._85="SparseSegmentMean";e._86="SparseSegmentSum";e._87="SparseToDense";e._91="SquaredDifference";e._90="Square";e._93="StridedSlice";e._94="StringNGrams";e._95="StringSplit";e._96="StringToHashBucketFast";e._97="Sub";e._99="Tan";e._100="Tanh";e._101="Tile";e._102="TopK";e._103="Transform";e._104="Transpose";e._105="Unique";e._106="Unpack";e._107="UnsortedSegmentSum";e._108="ZerosLike";e._92="Step";e._6="FromPixels";e._69="RotateWithOffset";e._109="_FusedMatMul";e._8="FusedConv2D";e._9="FusedDepthwiseConv2D"},lFkc:function(t,e,n){"use strict";var r=!("undefined"==typeof window||!window.document||!window.document.createElement),i={canUseDOM:r,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:r&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:r&&!!window.screen,isInWorker:!r};t.exports=i},lOnJ:function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},lktj:function(t,e,n){var r=n("Ibhu"),i=n("xnc9");t.exports=Object.keys||function(t){return r(t,i)}},lsVm:function(t,e,n){"use strict";var r=n("Kkag"),i=n("l5jf"),o=n("xMQ1"),s=n("35G1");const a=Object(s.a)({relu6_:
  2006. /**
  2007. * @license
  2008. * Copyright 2020 Google LLC. All Rights Reserved.
  2009. * Licensed under the Apache License, Version 2.0 (the "License");
  2010. * you may not use this file except in compliance with the License.
  2011. * You may obtain a copy of the License at
  2012. *
  2013. * http://www.apache.org/licenses/LICENSE-2.0
  2014. *
  2015. * Unless required by applicable law or agreed to in writing, software
  2016. * distributed under the License is distributed on an "AS IS" BASIS,
  2017. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2018. * See the License for the specific language governing permissions and
  2019. * limitations under the License.
  2020. * =============================================================================
  2021. */
  2022. function(t){const e={x:Object(o.a)(t,"x","relu6")};return r.a.runKernel(i._62,e)}});e.a=a},m3RX:function(t,e,n){"use strict";var r={};n.d(r,"conv2d",function(){return sr}),n.d(r,"depthwiseConv2d",function(){return ur}),n.d(r,"matMul",function(){return cr});var i=n("BVpN"),o=n("Kkag"),s=n("l5jf"),a=n("xMQ1"),l=n("35G1");const u=Object(l.a)({acos_:
  2023. /**
  2024. * @license
  2025. * Copyright 2018 Google LLC. All Rights Reserved.
  2026. * Licensed under the Apache License, Version 2.0 (the "License");
  2027. * you may not use this file except in compliance with the License.
  2028. * You may obtain a copy of the License at
  2029. *
  2030. * http://www.apache.org/licenses/LICENSE-2.0
  2031. *
  2032. * Unless required by applicable law or agreed to in writing, software
  2033. * distributed under the License is distributed on an "AS IS" BASIS,
  2034. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2035. * See the License for the specific language governing permissions and
  2036. * limitations under the License.
  2037. * =============================================================================
  2038. */
  2039. function(t){const e={x:Object(a.a)(t,"x","acos")};return o.a.runKernel(s.b,e)}});
  2040. /**
  2041. * @license
  2042. * Copyright 2018 Google LLC. All Rights Reserved.
  2043. * Licensed under the Apache License, Version 2.0 (the "License");
  2044. * you may not use this file except in compliance with the License.
  2045. * You may obtain a copy of the License at
  2046. *
  2047. * http://www.apache.org/licenses/LICENSE-2.0
  2048. *
  2049. * Unless required by applicable law or agreed to in writing, software
  2050. * distributed under the License is distributed on an "AS IS" BASIS,
  2051. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2052. * See the License for the specific language governing permissions and
  2053. * limitations under the License.
  2054. * =============================================================================
  2055. */const c=Object(l.a)({acosh_:function(t){const e={x:Object(a.a)(t,"x","acosh")};return o.a.runKernel(s.c,e)}});var h=n("ODj2"),d=n("XFvI");const p=Object(l.a)({addN_:
  2056. /**
  2057. * @license
  2058. * Copyright 2020 Google LLC. All Rights Reserved.
  2059. * Licensed under the Apache License, Version 2.0 (the "License");
  2060. * you may not use this file except in compliance with the License.
  2061. * You may obtain a copy of the License at
  2062. *
  2063. * http://www.apache.org/licenses/LICENSE-2.0
  2064. *
  2065. * Unless required by applicable law or agreed to in writing, software
  2066. * distributed under the License is distributed on an "AS IS" BASIS,
  2067. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2068. * See the License for the specific language governing permissions and
  2069. * limitations under the License.
  2070. * =============================================================================
  2071. */
  2072. function(t){d.assert(Array.isArray(t),()=>"The argument passed to tf.addN() must be a list of tensors"),d.assert(t.length>=1,()=>"Must pass at least one tensor to tf.addN(), but got "+`${t.length}`);const e=t.map((t,e)=>Object(a.a)(t,`tensors${e}`,"addN")),n=e[0];e.forEach(t=>{if(t.dtype!==n.dtype)throw new Error("All tensors passed to tf.addN() must have the same dtype")}),e.forEach(t=>{if(!d.arraysEqual(t.shape,n.shape))throw new Error("All tensors passed to tf.addN() must have the same shape")});const r=e;return o.a.runKernel(s.e,r)}});
  2073. /**
  2074. * @license
  2075. * Copyright 2020 Google LLC. All Rights Reserved.
  2076. * Licensed under the Apache License, Version 2.0 (the "License");
  2077. * you may not use this file except in compliance with the License.
  2078. * You may obtain a copy of the License at
  2079. *
  2080. * http://www.apache.org/licenses/LICENSE-2.0
  2081. *
  2082. * Unless required by applicable law or agreed to in writing, software
  2083. * distributed under the License is distributed on an "AS IS" BASIS,
  2084. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2085. * See the License for the specific language governing permissions and
  2086. * limitations under the License.
  2087. * =============================================================================
  2088. */const f=Object(l.a)({all_:function(t,e=null,n=!1){const r={x:Object(a.a)(t,"x","all","bool")},i={axis:e,keepDims:n};return o.a.runKernel(s.f,r,i)}});
  2089. /**
  2090. * @license
  2091. * Copyright 2020 Google LLC. All Rights Reserved.
  2092. * Licensed under the Apache License, Version 2.0 (the "License");
  2093. * you may not use this file except in compliance with the License.
  2094. * You may obtain a copy of the License at
  2095. *
  2096. * http://www.apache.org/licenses/LICENSE-2.0
  2097. *
  2098. * Unless required by applicable law or agreed to in writing, software
  2099. * distributed under the License is distributed on an "AS IS" BASIS,
  2100. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2101. * See the License for the specific language governing permissions and
  2102. * limitations under the License.
  2103. * =============================================================================
  2104. */const g=Object(l.a)({any_:function(t,e=null,n=!1){const r={x:Object(a.a)(t,"x","any","bool")},i={axis:e,keepDims:n};return o.a.runKernel(s.g,r,i)}});
  2105. /**
  2106. * @license
  2107. * Copyright 2020 Google Inc. All Rights Reserved.
  2108. * Licensed under the Apache License, Version 2.0 (the "License");
  2109. * you may not use this file except in compliance with the License.
  2110. * You may obtain a copy of the License at
  2111. *
  2112. * http://www.apache.org/licenses/LICENSE-2.0
  2113. *
  2114. * Unless required by applicable law or agreed to in writing, software
  2115. * distributed under the License is distributed on an "AS IS" BASIS,
  2116. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2117. * See the License for the specific language governing permissions and
  2118. * limitations under the License.
  2119. * =============================================================================
  2120. */const m=Object(l.a)({argMax_:function(t,e=0){const n={x:Object(a.a)(t,"x","argMax")},r={axis:e};return o.a.runKernel(s.h,n,r)}});
  2121. /**
  2122. * @license
  2123. * Copyright 2020 Google Inc. All Rights Reserved.
  2124. * Licensed under the Apache License, Version 2.0 (the "License");
  2125. * you may not use this file except in compliance with the License.
  2126. * You may obtain a copy of the License at
  2127. *
  2128. * http://www.apache.org/licenses/LICENSE-2.0
  2129. *
  2130. * Unless required by applicable law or agreed to in writing, software
  2131. * distributed under the License is distributed on an "AS IS" BASIS,
  2132. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2133. * See the License for the specific language governing permissions and
  2134. * limitations under the License.
  2135. * =============================================================================
  2136. */const v=Object(l.a)({argMin_:function(t,e=0){const n={x:Object(a.a)(t,"x","argMin")},r={axis:e};return o.a.runKernel(s.i,n,r)}});
  2137. /**
  2138. * @license
  2139. * Copyright 2018 Google LLC. All Rights Reserved.
  2140. * Licensed under the Apache License, Version 2.0 (the "License");
  2141. * you may not use this file except in compliance with the License.
  2142. * You may obtain a copy of the License at
  2143. *
  2144. * http://www.apache.org/licenses/LICENSE-2.0
  2145. *
  2146. * Unless required by applicable law or agreed to in writing, software
  2147. * distributed under the License is distributed on an "AS IS" BASIS,
  2148. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2149. * See the License for the specific language governing permissions and
  2150. * limitations under the License.
  2151. * =============================================================================
  2152. */const b=Object(l.a)({asin_:function(t){const e={x:Object(a.a)(t,"x","asin")};return o.a.runKernel(s.j,e)}});
  2153. /**
  2154. * @license
  2155. * Copyright 2018 Google LLC. All Rights Reserved.
  2156. * Licensed under the Apache License, Version 2.0 (the "License");
  2157. * you may not use this file except in compliance with the License.
  2158. * You may obtain a copy of the License at
  2159. *
  2160. * http://www.apache.org/licenses/LICENSE-2.0
  2161. *
  2162. * Unless required by applicable law or agreed to in writing, software
  2163. * distributed under the License is distributed on an "AS IS" BASIS,
  2164. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2165. * See the License for the specific language governing permissions and
  2166. * limitations under the License.
  2167. * =============================================================================
  2168. */const _=Object(l.a)({asinh_:function(t){const e={x:Object(a.a)(t,"x","asinh")};return o.a.runKernel(s.k,e)}});
  2169. /**
  2170. * @license
  2171. * Copyright 2018 Google LLC. All Rights Reserved.
  2172. * Licensed under the Apache License, Version 2.0 (the "License");
  2173. * you may not use this file except in compliance with the License.
  2174. * You may obtain a copy of the License at
  2175. *
  2176. * http://www.apache.org/licenses/LICENSE-2.0
  2177. *
  2178. * Unless required by applicable law or agreed to in writing, software
  2179. * distributed under the License is distributed on an "AS IS" BASIS,
  2180. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2181. * See the License for the specific language governing permissions and
  2182. * limitations under the License.
  2183. * =============================================================================
  2184. */const y=Object(l.a)({atan_:function(t){const e={x:Object(a.a)(t,"x","atan")};return o.a.runKernel(s.l,e)}});var T=n("jb1O");
  2185. /**
  2186. * @license
  2187. * Copyright 2020 Google LLC. All Rights Reserved.
  2188. * Licensed under the Apache License, Version 2.0 (the "License");
  2189. * you may not use this file except in compliance with the License.
  2190. * You may obtain a copy of the License at
  2191. *
  2192. * http://www.apache.org/licenses/LICENSE-2.0
  2193. *
  2194. * Unless required by applicable law or agreed to in writing, software
  2195. * distributed under the License is distributed on an "AS IS" BASIS,
  2196. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2197. * See the License for the specific language governing permissions and
  2198. * limitations under the License.
  2199. * =============================================================================
  2200. */const x=Object(l.a)({atan2_:function(t,e){let n=Object(a.a)(t,"a","atan2"),r=Object(a.a)(e,"b","atan2");[n,r]=Object(T.c)(n,r);const i={a:n,b:r};return o.a.runKernel(s.m,i)}});
  2201. /**
  2202. * @license
  2203. * Copyright 2018 Google LLC. All Rights Reserved.
  2204. * Licensed under the Apache License, Version 2.0 (the "License");
  2205. * you may not use this file except in compliance with the License.
  2206. * You may obtain a copy of the License at
  2207. *
  2208. * http://www.apache.org/licenses/LICENSE-2.0
  2209. *
  2210. * Unless required by applicable law or agreed to in writing, software
  2211. * distributed under the License is distributed on an "AS IS" BASIS,
  2212. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2213. * See the License for the specific language governing permissions and
  2214. * limitations under the License.
  2215. * =============================================================================
  2216. */const E=Object(l.a)({atanh_:function(t){const e={x:Object(a.a)(t,"x","atanh")};return o.a.runKernel(s.n,e)}});var w=n("MlK1"),C=n("Hjly"),S=n("GtxA");const k=Object(l.a)({avgPool_:
  2217. /**
  2218. * @license
  2219. * Copyright 2020 Google LLC. All Rights Reserved.
  2220. * Licensed under the Apache License, Version 2.0 (the "License");
  2221. * you may not use this file except in compliance with the License.
  2222. * You may obtain a copy of the License at
  2223. *
  2224. * http://www.apache.org/licenses/LICENSE-2.0
  2225. *
  2226. * Unless required by applicable law or agreed to in writing, software
  2227. * distributed under the License is distributed on an "AS IS" BASIS,
  2228. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2229. * See the License for the specific language governing permissions and
  2230. * limitations under the License.
  2231. * =============================================================================
  2232. */
  2233. function(t,e,n,r,i){const l=Object(a.a)(t,"x","avgPool","float32");d.assert(C.i(n,1),()=>"Error in avgPool: Either strides or dilations must be 1. "+`Got strides ${n} and dilations '1'`);let u=l,c=!1;3===l.rank&&(c=!0,u=Object(S.a)(l,[1,l.shape[0],l.shape[1],l.shape[2]])),d.assert(4===u.rank,()=>`Error in avgPool: x must be rank 4 but got rank ${u.rank}.`),C.a("avgPool",r,i);const h={x:u},p={filterSize:e,strides:n,pad:r,dimRoundingMode:i};let f=o.a.runKernel(s.o,h,p);return f=Object(w.a)(f,l.dtype),c?Object(S.a)(f,[f.shape[1],f.shape[2],f.shape[3]]):f}});
  2234. /**
  2235. * @license
  2236. * Copyright 2020 Google LLC. All Rights Reserved.
  2237. * Licensed under the Apache License, Version 2.0 (the "License");
  2238. * you may not use this file except in compliance with the License.
  2239. * You may obtain a copy of the License at
  2240. *
  2241. * http://www.apache.org/licenses/LICENSE-2.0
  2242. *
  2243. * Unless required by applicable law or agreed to in writing, software
  2244. * distributed under the License is distributed on an "AS IS" BASIS,
  2245. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2246. * See the License for the specific language governing permissions and
  2247. * limitations under the License.
  2248. * =============================================================================
  2249. */const O=Object(l.a)({avgPool3d_:function(t,e,n,r,i,l="NDHWC"){const u=Object(a.a)(t,"x","avgPool3d","float32");let c=u,h=!1;4===u.rank&&(h=!0,c=Object(S.a)(u,[1,u.shape[0],u.shape[1],u.shape[2],u.shape[3]])),d.assert(5===c.rank,()=>`Error in avgPool3d: x must be rank 5 but got rank ${c.rank}.`),d.assert("NDHWC"===l,()=>"Error in avgPool3d: Only NDHWC is currently supported, "+`but got dataFormat of ${l}`),Object(C.a)("avgPool3d",r,i);const p={x:c},f={filterSize:e,strides:n,pad:r,dimRoundingMode:i,dataFormat:l};let g=o.a.runKernel(s.p,p,f);return g=Object(w.a)(g,c.dtype),h?Object(S.a)(g,[g.shape[1],g.shape[2],g.shape[3],g.shape[4]]):g}});var I=n("VdVo");
  2250. /**
  2251. * @license
  2252. * Copyright 2020 Google LLC. All Rights Reserved.
  2253. * Licensed under the Apache License, Version 2.0 (the "License");
  2254. * you may not use this file except in compliance with the License.
  2255. * You may obtain a copy of the License at
  2256. *
  2257. * http://www.apache.org/licenses/LICENSE-2.0
  2258. *
  2259. * Unless required by applicable law or agreed to in writing, software
  2260. * distributed under the License is distributed on an "AS IS" BASIS,
  2261. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2262. * See the License for the specific language governing permissions and
  2263. * limitations under the License.
  2264. * =============================================================================
  2265. */const R=Object(l.a)({concat_:function(t,e=0){Object(d.assert)(t.length>=1,()=>"Pass at least one tensor to concat");const n=Object(a.b)(t,"tensors","concat","string_or_numeric");if("complex64"===n[0].dtype&&n.forEach(t=>{if("complex64"!==t.dtype)throw new Error(`Cannot concatenate complex64 tensors with a tensor\n with dtype ${t.dtype}. `)}),1===n.length)return Object(I.a)(n[0]);const r=n,i={axis:e};return o.a.runKernel(s.B,r,i)}});var A=n("4Ute"),N=n("dZfa"),D=n("fxrw");const M=Object(l.a)({slice_:
  2266. /**
  2267. * @license
  2268. * Copyright 2018 Google LLC. All Rights Reserved.
  2269. * Licensed under the Apache License, Version 2.0 (the "License");
  2270. * you may not use this file except in compliance with the License.
  2271. * You may obtain a copy of the License at
  2272. *
  2273. * http://www.apache.org/licenses/LICENSE-2.0
  2274. *
  2275. * Unless required by applicable law or agreed to in writing, software
  2276. * distributed under the License is distributed on an "AS IS" BASIS,
  2277. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2278. * See the License for the specific language governing permissions and
  2279. * limitations under the License.
  2280. * =============================================================================
  2281. */
  2282. function(t,e,n){const r=Object(a.a)(t,"x","slice","string_or_numeric");if(0===r.rank)throw new Error("Slicing scalar is not possible");const i={x:r},l={begin:e,size:n};return o.a.runKernel(s._79,i,l)}});
  2283. /**
  2284. * @license
  2285. * Copyright 2018 Google LLC. All Rights Reserved.
  2286. * Licensed under the Apache License, Version 2.0 (the "License");
  2287. * you may not use this file except in compliance with the License.
  2288. * You may obtain a copy of the License at
  2289. *
  2290. * http://www.apache.org/licenses/LICENSE-2.0
  2291. *
  2292. * Unless required by applicable law or agreed to in writing, software
  2293. * distributed under the License is distributed on an "AS IS" BASIS,
  2294. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2295. * See the License for the specific language governing permissions and
  2296. * limitations under the License.
  2297. * =============================================================================
  2298. */const L=Object(l.a)({tanh_:function(t){const e={x:Object(a.a)(t,"x","tanh","float32")};return o.a.runKernel(s._100,e)}});
  2299. /**
  2300. * @license
  2301. * Copyright 2020 Google LLC. All Rights Reserved.
  2302. * Licensed under the Apache License, Version 2.0 (the "License");
  2303. * you may not use this file except in compliance with the License.
  2304. * You may obtain a copy of the License at
  2305. *
  2306. * http://www.apache.org/licenses/LICENSE-2.0
  2307. *
  2308. * Unless required by applicable law or agreed to in writing, software
  2309. * distributed under the License is distributed on an "AS IS" BASIS,
  2310. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2311. * See the License for the specific language governing permissions and
  2312. * limitations under the License.
  2313. * =============================================================================
  2314. */const P=Object(l.a)({basicLSTMCell_:function(t,e,n,r,i,o){const s=Object(a.a)(t,"forgetBias","basicLSTMCell"),l=Object(a.a)(e,"lstmKernel","basicLSTMCell"),u=Object(a.a)(n,"lstmBias","basicLSTMCell"),c=Object(a.a)(r,"data","basicLSTMCell"),d=Object(a.a)(i,"c","basicLSTMCell"),p=Object(a.a)(o,"h","basicLSTMCell"),f=R([c,p],1),g=Object(A.a)(f,l),m=Object(h.a)(g,u),v=m.shape[0],b=m.shape[1]/4,_=[v,b],y=M(m,[0,0],_),T=M(m,[0,b],_),x=M(m,[0,2*b],_),E=M(m,[0,3*b],_),w=Object(h.a)(Object(N.a)(Object(D.a)(y),L(T)),Object(N.a)(d,Object(D.a)(Object(h.a)(s,x))));return[w,Object(N.a)(L(w),Object(D.a)(E))]}});
  2315. /**
  2316. * @license
  2317. * Copyright 2020 Google LLC. All Rights Reserved.
  2318. * Licensed under the Apache License, Version 2.0 (the "License");
  2319. * you may not use this file except in compliance with the License.
  2320. * You may obtain a copy of the License at
  2321. *
  2322. * http://www.apache.org/licenses/LICENSE-2.0
  2323. *
  2324. * Unless required by applicable law or agreed to in writing, software
  2325. * distributed under the License is distributed on an "AS IS" BASIS,
  2326. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2327. * See the License for the specific language governing permissions and
  2328. * limitations under the License.
  2329. * =============================================================================
  2330. */const F=Object(l.a)({batchToSpaceND_:function(t,e,n){const r=Object(a.a)(t,"x","batchToSpaceND"),i=e.reduce((t,e)=>t*e);d.assert(r.rank>=1+e.length,()=>`input rank is ${r.rank} but should be > than blockShape.length ${e.length}`),d.assert(n.length===e.length,()=>`crops.length is ${n.length} but should be equal to blockShape.length ${e.length}`),d.assert(r.shape[0]%i==0,()=>`input tensor batch is ${r.shape[0]} but is not divisible by the product of `+`the elements of blockShape ${e.join(" * ")} === ${i}`);const l={x:r},u={blockShape:e,crops:n};return o.a.runKernel(s.t,l,u)}});const B=Object(l.a)({batchNorm_:
  2331. /**
  2332. * @license
  2333. * Copyright 2020 Google LLC. All Rights Reserved.
  2334. * Licensed under the Apache License, Version 2.0 (the "License");
  2335. * you may not use this file except in compliance with the License.
  2336. * You may obtain a copy of the License at
  2337. *
  2338. * http://www.apache.org/licenses/LICENSE-2.0
  2339. *
  2340. * Unless required by applicable law or agreed to in writing, software
  2341. * distributed under the License is distributed on an "AS IS" BASIS,
  2342. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2343. * See the License for the specific language governing permissions and
  2344. * limitations under the License.
  2345. * =============================================================================
  2346. */
  2347. function(t,e,n,r,i,l){null==l&&(l=.001);const u=Object(a.a)(t,"x","batchNorm"),c=Object(a.a)(e,"mean","batchNorm"),h=Object(a.a)(n,"variance","batchNorm");let p,f;null!=i&&(p=Object(a.a)(i,"scale","batchNorm")),null!=r&&(f=Object(a.a)(r,"offset","batchNorm")),d.assert(c.rank===h.rank,()=>"Batch normalization gradient requires mean and variance to have equal ranks."),d.assert(null==f||c.rank===f.rank,()=>"Batch normalization gradient requires mean and offset to have equal ranks."),d.assert(null==p||c.rank===p.rank,()=>"Batch normalization gradient requires mean and scale to have equal ranks.");const g={x:function(t){let e;return e=0===t.rank||1===t.rank?Object(S.a)(t,[1,1,1,t.size]):2===t.rank?Object(S.a)(t,[1,1,t.shape[0],t.shape[1]]):3===t.rank?Object(S.a)(t,[1,t.shape[0],t.shape[1],t.shape[2]]):t}(u),scale:p,offset:f,mean:c,variance:h},m={varianceEpsilon:l},v=o.a.runKernel(s._7,g,m);return Object(S.a)(v,u.shape)}});const j=Object(l.a)({batchNorm2d_:function(t,e,n,r,i,o){const s=Object(a.a)(t,"x","batchNorm"),l=Object(a.a)(e,"mean","batchNorm"),u=Object(a.a)(n,"variance","batchNorm");let c,h;return null!=i&&(c=Object(a.a)(i,"scale","batchNorm")),null!=r&&(h=Object(a.a)(r,"offset","batchNorm")),d.assert(2===s.rank,()=>"Error in batchNorm2D: x must be rank 2 but got rank "+`${s.rank}.`),d.assert(2===l.rank||1===l.rank,()=>"Error in batchNorm2D: mean must be rank 2 or rank 1 but "+`got rank ${l.rank}.`),d.assert(2===u.rank||1===u.rank,()=>"Error in batchNorm2D: variance must be rank 2 or rank 1 "+`but got rank ${u.rank}.`),null!=c&&d.assert(2===c.rank||1===c.rank,()=>"Error in batchNorm2D: scale must be rank 2 or rank 1 "+`but got rank ${c.rank}.`),null!=h&&d.assert(2===h.rank||1===h.rank,()=>"Error in batchNorm2D: offset must be rank 2 or rank 1 "+`but got rank ${h.rank}.`),B(s,l,u,h,c,o)}});const $=Object(l.a)({batchNorm3d_:function(t,e,n,r,i,o){const s=Object(a.a)(t,"x","batchNorm"),l=Object(a.a)(e,"mean","batchNorm"),u=Object(a.a)(n,"variance","batchNorm");let c,h;return null!=i&&(c=Object(a.a)(i,"scale","batchNorm")),null!=r&&(h=Object(a.a)(r,"offset","batchNorm")),d.assert(3===s.rank,()=>"Error in batchNorm3D: x must be rank 3 but got rank "+`${s.rank}.`),d.assert(3===l.rank||1===l.rank,()=>"Error in batchNorm3D: mean must be rank 3 or rank 1 but "+`got rank ${l.rank}.`),d.assert(3===u.rank||1===u.rank,()=>"Error in batchNorm3D: variance must be rank 3 or rank 1 "+`but got rank ${u.rank}.`),null!=c&&d.assert(3===c.rank||1===c.rank,()=>"Error in batchNorm3D: scale must be rank 3 or rank 1 "+`but got rank ${c.rank}.`),null!=h&&d.assert(3===h.rank||1===h.rank,()=>"Error in batchNorm3D: offset must be rank 3 or rank 1 "+`but got rank ${h.rank}.`),B(s,l,u,h,c,o)}});const U=Object(l.a)({batchNorm4d_:function(t,e,n,r,i,o){const s=Object(a.a)(t,"x","batchNorm"),l=Object(a.a)(e,"mean","batchNorm"),u=Object(a.a)(n,"variance","batchNorm");let c,h;return null!=i&&(c=Object(a.a)(i,"scale","batchNorm")),null!=r&&(h=Object(a.a)(r,"offset","batchNorm")),d.assert(4===s.rank,()=>"Error in batchNorm4D: x must be rank 4 but got rank "+`${s.rank}.`),d.assert(4===l.rank||1===l.rank,()=>"Error in batchNorm4D: mean must be rank 4 or rank 1 but "+`got rank ${l.rank}.`),d.assert(4===u.rank||1===u.rank,()=>"Error in batchNorm4D: variance must be rank 4 or rank 1 "+`but got rank ${u.rank}.`),null!=c&&d.assert(4===c.rank||1===c.rank,()=>"Error in batchNorm4D: scale must be rank 4 or rank 1 "+`but got rank ${c.rank}.`),null!=h&&d.assert(4===h.rank||1===h.rank,()=>"Error in batchNorm4D: offset must be rank 4 or rank 1 "+`but got rank ${h.rank}.`),B(s,l,u,h,c,o)}});
  2348. /**
  2349. * @license
  2350. * Copyright 2020 Google LLC. All Rights Reserved.
  2351. * Licensed under the Apache License, Version 2.0 (the "License");
  2352. * you may not use this file except in compliance with the License.
  2353. * You may obtain a copy of the License at
  2354. *
  2355. * http://www.apache.org/licenses/LICENSE-2.0
  2356. *
  2357. * Unless required by applicable law or agreed to in writing, software
  2358. * distributed under the License is distributed on an "AS IS" BASIS,
  2359. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2360. * See the License for the specific language governing permissions and
  2361. * limitations under the License.
  2362. * =============================================================================
  2363. */const V=Object(l.a)({bincount_:function(t,e,n){const r=Object(a.a)(t,"x","bincount"),i=Object(a.a)(e,"weights","bincount");d.assert("int32"===r.dtype,()=>"Error in bincount: input "+`dtype must be int32, but got ${r.dtype}`),d.assert(n>=0,()=>`size must be non-negative, but got ${n}.`),d.assert(i.size===r.size||0===i.size,()=>"Error in bincount: weights must have the same size as input or"+`0-length, but got input shape: ${r.shape}, weights shape: `+`${i.shape}.`);const l={x:r,weights:i},u={size:n};return o.a.runKernel(s.u,l,u)}});
  2364. /**
  2365. * @license
  2366. * Copyright 2021 Google LLC. All Rights Reserved.
  2367. * Licensed under the Apache License, Version 2.0 (the "License");
  2368. * you may not use this file except in compliance with the License.
  2369. * You may obtain a copy of the License at
  2370. *
  2371. * http://www.apache.org/licenses/LICENSE-2.0
  2372. *
  2373. * Unless required by applicable law or agreed to in writing, software
  2374. * distributed under the License is distributed on an "AS IS" BASIS,
  2375. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2376. * See the License for the specific language governing permissions and
  2377. * limitations under the License.
  2378. * =============================================================================
  2379. */const H=Object(l.a)({broadcastArgs_:function(t,e){const n=Object(a.a)(t,"s0","broadcastArgs","int32"),r=Object(a.a)(e,"s1","broadcastArgs","int32");if(1!==n.rank)throw new Error("broadcastArgs(): first input must be a vector (rank=1). "+`Has rank ${n.rank}`);if(1!==r.rank)throw new Error("broadcastArgs(): second input must be a vector (rank=1). "+`Has rank ${r.rank}`);const i={s0:n,s1:r};return o.a.runKernel(s.v,i)}});
  2380. /**
  2381. * @license
  2382. * Copyright 2020 Google LLC. All Rights Reserved.
  2383. * Licensed under the Apache License, Version 2.0 (the "License");
  2384. * you may not use this file except in compliance with the License.
  2385. * You may obtain a copy of the License at
  2386. *
  2387. * http://www.apache.org/licenses/LICENSE-2.0
  2388. *
  2389. * Unless required by applicable law or agreed to in writing, software
  2390. * distributed under the License is distributed on an "AS IS" BASIS,
  2391. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2392. * See the License for the specific language governing permissions and
  2393. * limitations under the License.
  2394. * =============================================================================
  2395. */const W=Object(l.a)({broadcastTo_:function(t,e){let n=Object(a.a)(t,"broadcastTo","x");const r=n.shape;if(e.some(t=>!(t>0)||t%1!=0))throw new Error(`broadcastTo(): Invalid broadcast shape [${e}].`);if(e.length<n.rank)throw new Error(`broadcastTo(): shape.length=${e.length} < input.rank=${n.rank}.`);if(e.length>n.rank){const t=n.shape.slice();for(;t.length<e.length;)t.unshift(1);n=Object(S.a)(n,t)}const i=n.shape,l=Array.from(e);for(let t=e.length-1;t>=0;t--)if(i[t]===e[t])l[t]=1;else if(1!==n.shape[t])throw new Error(`broadcastTo(): [${r}] cannot be broadcast to [${e}].`);if(0===l.map((t,e)=>t>1?e:-1).filter(t=>t>=0).length)return Object(I.a)(n);const u={x:n},c={reps:l};return o.a.runKernel(s._101,u,c)}});var G=n("SnLv");
  2396. /**
  2397. * @license
  2398. * Copyright 2018 Google LLC. All Rights Reserved.
  2399. * Licensed under the Apache License, Version 2.0 (the "License");
  2400. * you may not use this file except in compliance with the License.
  2401. * You may obtain a copy of the License at
  2402. *
  2403. * http://www.apache.org/licenses/LICENSE-2.0
  2404. *
  2405. * Unless required by applicable law or agreed to in writing, software
  2406. * distributed under the License is distributed on an "AS IS" BASIS,
  2407. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2408. * See the License for the specific language governing permissions and
  2409. * limitations under the License.
  2410. * =============================================================================
  2411. */const z=Object(l.a)({ceil_:function(t){const e={x:Object(a.a)(t,"x","ceil","float32")};return o.a.runKernel(s.x,e)}});
  2412. /**
  2413. * @license
  2414. * Copyright 2018 Google LLC. All Rights Reserved.
  2415. * Licensed under the Apache License, Version 2.0 (the "License");
  2416. * you may not use this file except in compliance with the License.
  2417. * You may obtain a copy of the License at
  2418. *
  2419. * http://www.apache.org/licenses/LICENSE-2.0
  2420. *
  2421. * Unless required by applicable law or agreed to in writing, software
  2422. * distributed under the License is distributed on an "AS IS" BASIS,
  2423. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2424. * See the License for the specific language governing permissions and
  2425. * limitations under the License.
  2426. * =============================================================================
  2427. */const X=Object(l.a)({clipByValue_:function(t,e,n){const r=Object(a.a)(t,"x","clipByValue");d.assert(e<=n,()=>`Error in clip: min (${e}) must be `+`less than or equal to max (${n}).`);const i={x:r},l={clipValueMin:e,clipValueMax:n};return o.a.runKernel(s.y,i,l)}});var K=n("rQ0i");const Y=Object(l.a)({concat1d_:function(t){return R(t,0)}});const q=Object(l.a)({concat2d_:function(t,e){return R(t,e)}});const J=Object(l.a)({concat3d_:function(t,e){return R(t,e)}});const Z=Object(l.a)({concat4d_:function(t,e){return R(t,e)}});
  2428. /**
  2429. * @license
  2430. * Copyright 2020 Google LLC. All Rights Reserved.
  2431. * Licensed under the Apache License, Version 2.0 (the "License");
  2432. * you may not use this file except in compliance with the License.
  2433. * You may obtain a copy of the License at
  2434. *
  2435. * http://www.apache.org/licenses/LICENSE-2.0
  2436. *
  2437. * Unless required by applicable law or agreed to in writing, software
  2438. * distributed under the License is distributed on an "AS IS" BASIS,
  2439. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2440. * See the License for the specific language governing permissions and
  2441. * limitations under the License.
  2442. * =============================================================================
  2443. */const Q=Object(l.a)({conv2d_:function(t,e,n,r,i="NHWC",l=[1,1],u){const c=Object(a.a)(t,"x","conv2d","float32"),h=Object(a.a)(e,"filter","conv2d","float32");let p=c,f=!1;3===c.rank&&(f=!0,p=Object(S.a)(c,[1,c.shape[0],c.shape[1],c.shape[2]])),d.assert(4===p.rank,()=>`Error in conv2d: input must be rank 4, but got rank ${p.rank}.`),d.assert(4===h.rank,()=>"Error in conv2d: filter must be rank 4, but got rank "+`${h.rank}.`),C.a("conv2d",r,u);const g="NHWC"===i?p.shape[3]:p.shape[1];d.assert(g===h.shape[2],()=>`Error in conv2d: depth of input (${g}) must match `+`input depth for filter ${h.shape[2]}.`),d.assert(C.i(n,l),()=>"Error in conv2D: Either strides or dilations must be 1. "+`Got strides ${n} and dilations '${l}'`);const m={x:p,filter:h},v={strides:n,pad:r,dataFormat:i,dilations:l,dimRoundingMode:u},b=o.a.runKernel(s.C,m,v);return f?Object(S.a)(b,[b.shape[1],b.shape[2],b.shape[3]]):b}});const tt=Object(l.a)({conv1d_:function(t,e,n,r,i="NWC",o=1,s){const l=Object(a.a)(t,"x","conv1d"),u=Object(a.a)(e,"filter","conv1d");let c=l,h=!1;2===l.rank&&(h=!0,c=Object(S.a)(l,[1,l.shape[0],l.shape[1]])),d.assert(3===c.rank,()=>`Error in conv1d: input must be rank 3, but got rank ${c.rank}.`),d.assert(3===u.rank,()=>"Error in conv1d: filter must be rank 3, but got rank "+`${u.rank}.`),C.a("conv1d",r,s),d.assert(c.shape[2]===u.shape[1],()=>`Error in conv1d: depth of input (${c.shape[2]}) must match `+`input depth for filter ${u.shape[1]}.`),d.assert(C.i(n,o),()=>"Error in conv1D: Either stride or dilation must be 1. "+`Got stride ${n} and dilation '${o}'`),d.assert("NWC"===i,()=>`Error in conv1d: got dataFormat of ${i} but only NWC is currently supported.`);const p=Object(S.a)(u,[1,u.shape[0],u.shape[1],u.shape[2]]),f=Object(S.a)(c,[c.shape[0],1,c.shape[1],c.shape[2]]),g=Q(f,p,[1,n],r,"NHWC",[1,o],s);return h?Object(S.a)(g,[g.shape[2],g.shape[3]]):Object(S.a)(g,[g.shape[0],g.shape[2],g.shape[3]])}});
  2444. /**
  2445. * @license
  2446. * Copyright 2020 Google LLC. All Rights Reserved.
  2447. * Licensed under the Apache License, Version 2.0 (the "License");
  2448. * you may not use this file except in compliance with the License.
  2449. * You may obtain a copy of the License at
  2450. *
  2451. * http://www.apache.org/licenses/LICENSE-2.0
  2452. *
  2453. * Unless required by applicable law or agreed to in writing, software
  2454. * distributed under the License is distributed on an "AS IS" BASIS,
  2455. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2456. * See the License for the specific language governing permissions and
  2457. * limitations under the License.
  2458. * =============================================================================
  2459. */const et=Object(l.a)({conv2DBackpropInput_:function(t,e,n,r,i,a="NHWC",l){d.assert(t.length===e.rank,()=>"Length of inShape "+`(${t.length}) and rank of dy (${e.rank}) must match`);let u=t,c=e,h=!1;3===e.rank&&(h=!0,c=Object(S.a)(e,[1,e.shape[0],e.shape[1],e.shape[2]]),u=[1,t[0],t[1],t[2]]),d.assert(4===u.length,()=>"Error in conv2dDerInput: inShape must be length 4, but got length "+`${u.length}.`),d.assert(4===c.rank,()=>"Error in conv2dDerInput: dy must be rank 4, but got "+`rank ${c.rank}`),d.assert(4===n.rank,()=>"Error in conv2dDerInput: filter must be rank 4, but got "+`rank ${n.rank}`);const p="NHWC"===a?u[3]:u[1],f="NHWC"===a?c.shape[3]:c.shape[1];d.assert(p===n.shape[2],()=>`Error in conv2dDerInput: depth of input (${p}) must `+`match input depth for filter ${n.shape[2]}.`),d.assert(f===n.shape[3],()=>`Error in conv2dDerInput: depth of output (${f}) must `+`match output depth for filter ${n.shape[3]}.`),C.a("conv2dDerInput",i,l);const g={dy:c,filter:n},m={strides:r,pad:i,dataFormat:a,dimRoundingMode:l,inputShape:u},v=o.a.runKernel(s.E,g,m);return h?Object(S.a)(v,[v.shape[1],v.shape[2],v.shape[3]]):v}});const nt=Object(l.a)({conv2dTranspose_:function(t,e,n,r,i,o){const s=Object(a.a)(t,"x","conv2dTranspose"),l=Object(a.a)(e,"filter","conv2dTranspose");return et(n,s,l,r,i,"NHWC",o)}});
  2460. /**
  2461. * @license
  2462. * Copyright 2020 Google LLC. All Rights Reserved.
  2463. * Licensed under the Apache License, Version 2.0 (the "License");
  2464. * you may not use this file except in compliance with the License.
  2465. * You may obtain a copy of the License at
  2466. *
  2467. * http://www.apache.org/licenses/LICENSE-2.0
  2468. *
  2469. * Unless required by applicable law or agreed to in writing, software
  2470. * distributed under the License is distributed on an "AS IS" BASIS,
  2471. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2472. * See the License for the specific language governing permissions and
  2473. * limitations under the License.
  2474. * =============================================================================
  2475. */const rt=Object(l.a)({conv3d_:function(t,e,n,r,i="NDHWC",l=[1,1,1]){const u=Object(a.a)(t,"x","conv3d"),c=Object(a.a)(e,"filter","conv3d");let h=u,p=!1;4===u.rank&&(p=!0,h=Object(S.a)(u,[1,u.shape[0],u.shape[1],u.shape[2],u.shape[3]])),d.assert(5===h.rank,()=>`Error in conv3d: input must be rank 5, but got rank ${h.rank}.`),d.assert(5===c.rank,()=>"Error in conv3d: filter must be rank 5, but got rank "+`${c.rank}.`),d.assert(h.shape[4]===c.shape[3],()=>`Error in conv3d: depth of input (${h.shape[4]}) must match `+`input depth for filter ${c.shape[3]}.`),d.assert(Object(C.i)(n,l),()=>"Error in conv3D: Either strides or dilations must be 1. "+`Got strides ${n} and dilations '${l}'`),d.assert("NDHWC"===i,()=>`Error in conv3d: got dataFormat of ${i} but only NDHWC is currently supported.`);const f={x:h,filter:c},g={strides:n,pad:r,dataFormat:i,dilations:l},m=o.a.runKernel(s.F,f,g);return p?Object(S.a)(m,[m.shape[1],m.shape[2],m.shape[3],m.shape[4]]):m}});
  2476. /**
  2477. * @license
  2478. * Copyright 2020 Google LLC. All Rights Reserved.
  2479. * Licensed under the Apache License, Version 2.0 (the "License");
  2480. * you may not use this file except in compliance with the License.
  2481. * You may obtain a copy of the License at
  2482. *
  2483. * http://www.apache.org/licenses/LICENSE-2.0
  2484. *
  2485. * Unless required by applicable law or agreed to in writing, software
  2486. * distributed under the License is distributed on an "AS IS" BASIS,
  2487. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2488. * See the License for the specific language governing permissions and
  2489. * limitations under the License.
  2490. * =============================================================================
  2491. */const it=Object(l.a)({conv3DBackpropInput_:function(t,e,n,r,i){d.assert(t.length===e.rank,()=>"Length of inShape "+`(${t.length}) and rank of dy (${e.rank}) must match`);let a=t,l=e,u=!1;4===e.rank&&(u=!0,l=Object(S.a)(e,[1,e.shape[0],e.shape[1],e.shape[2],e.shape[3]]),a=[1,t[0],t[1],t[2],t[3]]);const c=a[4],h=l.shape[4];d.assert(5===a.length,()=>"Error in conv3dDerInput: inShape must be length 5, but got length "+`${a.length}.`),d.assert(5===l.rank,()=>"Error in conv3dDerInput: dy must be rank 5, but got "+`rank ${l.rank}`),d.assert(5===n.rank,()=>"Error in conv3dDerInput: filter must be rank 5, but got "+`rank ${n.rank}`),d.assert(c===n.shape[3],()=>`Error in conv3dDerInput: depth of input (${c}) must `+`match input depth for filter ${n.shape[3]}.`),d.assert(h===n.shape[4],()=>`Error in conv3dDerInput: depth of output (${h}) must `+`match output depth for filter ${n.shape[4]}.`);const p={dy:l,filter:n},f={pad:i,strides:r,inputShape:a},g=o.a.runKernel(s.H,p,f);return u?Object(S.a)(g,[g.shape[1],g.shape[2],g.shape[3],g.shape[4]]):g}});const ot=Object(l.a)({conv3dTranspose_:function(t,e,n,r,i){const o=Object(a.a)(t,"x","conv3dTranspose"),s=Object(a.a)(e,"filter","conv3dTranspose");return it(n,o,s,r,i)}});
  2492. /**
  2493. * @license
  2494. * Copyright 2018 Google LLC. All Rights Reserved.
  2495. * Licensed under the Apache License, Version 2.0 (the "License");
  2496. * you may not use this file except in compliance with the License.
  2497. * You may obtain a copy of the License at
  2498. *
  2499. * http://www.apache.org/licenses/LICENSE-2.0
  2500. *
  2501. * Unless required by applicable law or agreed to in writing, software
  2502. * distributed under the License is distributed on an "AS IS" BASIS,
  2503. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2504. * See the License for the specific language governing permissions and
  2505. * limitations under the License.
  2506. * =============================================================================
  2507. */const st=Object(l.a)({cos_:function(t){const e={x:Object(a.a)(t,"x","cos","float32")};return o.a.runKernel(s.I,e)}});
  2508. /**
  2509. * @license
  2510. * Copyright 2018 Google LLC. All Rights Reserved.
  2511. * Licensed under the Apache License, Version 2.0 (the "License");
  2512. * you may not use this file except in compliance with the License.
  2513. * You may obtain a copy of the License at
  2514. *
  2515. * http://www.apache.org/licenses/LICENSE-2.0
  2516. *
  2517. * Unless required by applicable law or agreed to in writing, software
  2518. * distributed under the License is distributed on an "AS IS" BASIS,
  2519. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2520. * See the License for the specific language governing permissions and
  2521. * limitations under the License.
  2522. * =============================================================================
  2523. */const at=Object(l.a)({cosh_:function(t){const e={x:Object(a.a)(t,"x","cosh","float32")};return o.a.runKernel(s.J,e)}});
  2524. /**
  2525. * @license
  2526. * Copyright 2018 Google LLC. All Rights Reserved.
  2527. * Licensed under the Apache License, Version 2.0 (the "License");
  2528. * you may not use this file except in compliance with the License.
  2529. * You may obtain a copy of the License at
  2530. *
  2531. * http://www.apache.org/licenses/LICENSE-2.0
  2532. *
  2533. * Unless required by applicable law or agreed to in writing, software
  2534. * distributed under the License is distributed on an "AS IS" BASIS,
  2535. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2536. * See the License for the specific language governing permissions and
  2537. * limitations under the License.
  2538. * =============================================================================
  2539. */const lt=Object(l.a)({cumsum_:function(t,e=0,n=!1,r=!1){const i={x:Object(a.a)(t,"x","cumsum")},l={axis:e,exclusive:n,reverse:r};return o.a.runKernel(s.L,i,l)}});
  2540. /**
  2541. * @license
  2542. * Copyright 2020 Google LLC. All Rights Reserved.
  2543. * Licensed under the Apache License, Version 2.0 (the "License");
  2544. * you may not use this file except in compliance with the License.
  2545. * You may obtain a copy of the License at
  2546. *
  2547. * http://www.apache.org/licenses/LICENSE-2.0
  2548. *
  2549. * Unless required by applicable law or agreed to in writing, software
  2550. * distributed under the License is distributed on an "AS IS" BASIS,
  2551. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2552. * See the License for the specific language governing permissions and
  2553. * limitations under the License.
  2554. * =============================================================================
  2555. */const ut=Object(l.a)({denseBincount_:function(t,e,n,r=!1){const i=Object(a.a)(t,"x","denseBincount"),l=Object(a.a)(e,"weights","denseBincount");d.assert("int32"===i.dtype,()=>"Error in denseBincount: input "+`dtype must be int32, but got ${i.dtype}`),d.assert(i.rank<=2,()=>"Error in denseBincount: input must be at most rank 2, but got "+`rank ${i.rank}.`),d.assert(n>=0,()=>`size must be non-negative, but got ${n}.`),d.assert(l.size===i.size||0===l.size,()=>"Error in denseBincount: weights must have the same shape as x or "+`0-length, but got x shape: ${i.shape}, weights shape: `+`${l.shape}.`);const u={x:i,weights:l},c={size:n,binaryOutput:r};return o.a.runKernel(s.M,u,c)}});
  2556. /**
  2557. * @license
  2558. * Copyright 2020 Google LLC. All Rights Reserved.
  2559. * Licensed under the Apache License, Version 2.0 (the "License");
  2560. * you may not use this file except in compliance with the License.
  2561. * You may obtain a copy of the License at
  2562. *
  2563. * http://www.apache.org/licenses/LICENSE-2.0
  2564. *
  2565. * Unless required by applicable law or agreed to in writing, software
  2566. * distributed under the License is distributed on an "AS IS" BASIS,
  2567. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2568. * See the License for the specific language governing permissions and
  2569. * limitations under the License.
  2570. * =============================================================================
  2571. */const ct=Object(l.a)({depthToSpace_:function(t,e,n="NHWC"){const r=Object(a.a)(t,"x","depthToSpace","float32"),i="NHWC"===n?r.shape[1]:r.shape[2],l="NHWC"===n?r.shape[2]:r.shape[3],u="NHWC"===n?r.shape[3]:r.shape[1];d.assert(e>1,()=>`blockSize should be > 1 for depthToSpace, but was: ${e}`),d.assert(i*e>=0,()=>`Negative dimension size caused by overflow when multiplying\n ${i} and ${e} for depthToSpace with input shape\n ${r.shape}`),d.assert(l*e>=0,()=>`Negative dimension size caused by overflow when multiplying\n ${l} and ${e} for depthToSpace with input shape\n ${r.shape}`),d.assert(u%(e*e)==0,()=>`Dimension size must be evenly divisible by ${e*e} but is ${u} for depthToSpace with input shape ${r.shape}`);const c={x:r},h={blockSize:e,dataFormat:n};return o.a.runKernel(s.N,c,h)}});
  2572. /**
  2573. * @license
  2574. * Copyright 2020 Google LLC. All Rights Reserved.
  2575. * Licensed under the Apache License, Version 2.0 (the "License");
  2576. * you may not use this file except in compliance with the License.
  2577. * You may obtain a copy of the License at
  2578. *
  2579. * http://www.apache.org/licenses/LICENSE-2.0
  2580. *
  2581. * Unless required by applicable law or agreed to in writing, software
  2582. * distributed under the License is distributed on an "AS IS" BASIS,
  2583. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2584. * See the License for the specific language governing permissions and
  2585. * limitations under the License.
  2586. * =============================================================================
  2587. */const ht=Object(l.a)({depthwiseConv2d_:function(t,e,n,r,i="NHWC",l=[1,1],u){const c=Object(a.a)(t,"x","depthwiseConv2d","float32"),h=Object(a.a)(e,"filter","depthwiseConv2d","float32");let p=c,f=!1;3===c.rank&&(f=!0,p=Object(S.a)(c,[1,c.shape[0],c.shape[1],c.shape[2]])),d.assert(4===p.rank,()=>"Error in depthwiseConv2d: input must be rank 4, but got "+`rank ${p.rank}.`),d.assert(4===h.rank,()=>"Error in depthwiseConv2d: filter must be rank 4, but got rank "+`${h.rank}.`),d.assert(p.shape[3]===h.shape[2],()=>"Error in depthwiseConv2d: number of input channels "+`(${p.shape[3]}) must match the inChannels dimension in `+`filter ${h.shape[2]}.`),C.a("depthwiseConv2d",r,u);const g={x:p,filter:h},m={strides:n,pad:r,dataFormat:i,dilations:l,dimRoundingMode:u},v=o.a.runKernel(s.O,g,m);return f?Object(S.a)(v,[v.shape[1],v.shape[2],v.shape[3]]):v}});
  2588. /**
  2589. * @license
  2590. * Copyright 2020 Google LLC. All Rights Reserved.
  2591. * Licensed under the Apache License, Version 2.0 (the "License");
  2592. * you may not use this file except in compliance with the License.
  2593. * You may obtain a copy of the License at
  2594. *
  2595. * http://www.apache.org/licenses/LICENSE-2.0
  2596. *
  2597. * Unless required by applicable law or agreed to in writing, software
  2598. * distributed under the License is distributed on an "AS IS" BASIS,
  2599. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2600. * See the License for the specific language governing permissions and
  2601. * limitations under the License.
  2602. * =============================================================================
  2603. */const dt=Object(l.a)({diag_:function(t){const e={x:Object(a.a)(t,"x","diag")};return o.a.runKernel(s.R,e)}});
  2604. /**
  2605. * @license
  2606. * Copyright 2020 Google LLC. All Rights Reserved.
  2607. * Licensed under the Apache License, Version 2.0 (the "License");
  2608. * you may not use this file except in compliance with the License.
  2609. * You may obtain a copy of the License at
  2610. *
  2611. * http://www.apache.org/licenses/LICENSE-2.0
  2612. *
  2613. * Unless required by applicable law or agreed to in writing, software
  2614. * distributed under the License is distributed on an "AS IS" BASIS,
  2615. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2616. * See the License for the specific language governing permissions and
  2617. * limitations under the License.
  2618. * =============================================================================
  2619. */const pt=Object(l.a)({dilation2d_:function(t,e,n,r,i=[1,1],l="NHWC"){const u=Object(a.a)(t,"x","dilation2d"),c=Object(a.a)(e,"filter","dilation2d");d.assert(3===u.rank||4===u.rank,()=>"Error in dilation2d: input must be rank 3 or 4, but got rank "+`${u.rank}.`),d.assert(3===c.rank,()=>"Error in dilation2d: filter must be rank 3, but got rank "+`${c.rank}.`),d.assert("NHWC"===l,()=>"Error in dilation2d: Only NHWC is currently supported, "+`but got dataFormat of ${l}`);let h=u,p=!1;3===u.rank&&(h=Object(S.a)(u,[1,u.shape[0],u.shape[1],u.shape[2]]),p=!0);const f={x:h,filter:c},g={strides:n,pad:r,dilations:i},m=o.a.runKernel(s.S,f,g);return p?Object(S.a)(m,[m.shape[1],m.shape[2],m.shape[3]]):m}});var ft=n("sfDJ"),gt=n("bDWH");const mt=Object(l.a)({equal_:
  2620. /**
  2621. * @license
  2622. * Copyright 2020 Google LLC. All Rights Reserved.
  2623. * Licensed under the Apache License, Version 2.0 (the "License");
  2624. * you may not use this file except in compliance with the License.
  2625. * You may obtain a copy of the License at
  2626. *
  2627. * http://www.apache.org/licenses/LICENSE-2.0
  2628. *
  2629. * Unless required by applicable law or agreed to in writing, software
  2630. * distributed under the License is distributed on an "AS IS" BASIS,
  2631. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2632. * See the License for the specific language governing permissions and
  2633. * limitations under the License.
  2634. * =============================================================================
  2635. */
  2636. function(t,e){let n=Object(a.a)(t,"a","equal","string_or_numeric"),r=Object(a.a)(e,"b","equal","string_or_numeric");[n,r]=Object(T.c)(n,r),Object(gt.assertAndGetBroadcastShape)(n.shape,r.shape);const i={a:n,b:r};return o.a.runKernel(s.W,i)}});
  2637. /**
  2638. * @license
  2639. * Copyright 2020 Google LLC. All Rights Reserved.
  2640. * Licensed under the Apache License, Version 2.0 (the "License");
  2641. * you may not use this file except in compliance with the License.
  2642. * You may obtain a copy of the License at
  2643. *
  2644. * http://www.apache.org/licenses/LICENSE-2.0
  2645. *
  2646. * Unless required by applicable law or agreed to in writing, software
  2647. * distributed under the License is distributed on an "AS IS" BASIS,
  2648. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2649. * See the License for the specific language governing permissions and
  2650. * limitations under the License.
  2651. * =============================================================================
  2652. */const vt=Object(l.a)({where_:function(t,e,n){const r=Object(a.a)(e,"a","where"),i=Object(a.a)(n,"b","where"),l=Object(a.a)(t,"condition","where","bool"),u=Object(gt.assertAndGetBroadcastShape)(Object(gt.assertAndGetBroadcastShape)(l.shape,r.shape),i.shape),c={condition:W(l,u),t:W(r,u),e:W(i,u)};return o.a.runKernel(s._73,c)}});var bt=n("Cwm/");
  2653. /**
  2654. * @license
  2655. * Copyright 2020 Google LLC. All Rights Reserved.
  2656. * Licensed under the Apache License, Version 2.0 (the "License");
  2657. * you may not use this file except in compliance with the License.
  2658. * You may obtain a copy of the License at
  2659. *
  2660. * http://www.apache.org/licenses/LICENSE-2.0
  2661. *
  2662. * Unless required by applicable law or agreed to in writing, software
  2663. * distributed under the License is distributed on an "AS IS" BASIS,
  2664. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2665. * See the License for the specific language governing permissions and
  2666. * limitations under the License.
  2667. * =============================================================================
  2668. */const _t=Object(l.a)({divNoNan_:function(t,e){let n=Object(a.a)(t,"a","div"),r=Object(a.a)(e,"b","div");[n,r]=Object(T.c)(n,r);const i=Object(ft.a)(n,r),o=Object(bt.a)(i),s=mt(r,o);return vt(s,o,i)}});
  2669. /**
  2670. * @license
  2671. * Copyright 2020 Google LLC. All Rights Reserved.
  2672. * Licensed under the Apache License, Version 2.0 (the "License");
  2673. * you may not use this file except in compliance with the License.
  2674. * You may obtain a copy of the License at
  2675. *
  2676. * http://www.apache.org/licenses/LICENSE-2.0
  2677. *
  2678. * Unless required by applicable law or agreed to in writing, software
  2679. * distributed under the License is distributed on an "AS IS" BASIS,
  2680. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2681. * See the License for the specific language governing permissions and
  2682. * limitations under the License.
  2683. * =============================================================================
  2684. */const yt=Object(l.a)({dot_:function(t,e){const n=Object(a.a)(t,"t1","dot"),r=Object(a.a)(e,"t2","dot");d.assert(!(1!==n.rank&&2!==n.rank||1!==r.rank&&2!==r.rank),()=>"Error in dot: inputs must all be rank 1 or 2, but got ranks "+`${n.rank} and ${r.rank}.`);const i=1===n.rank?n.size:n.shape[1],o=1===r.rank?r.size:r.shape[0];if(d.assert(i===o,()=>"Error in dot: inner dimensions of inputs must match, but got "+`${i} and ${o}.`),1===n.rank&&1===r.rank){const t=Object(S.a)(n,[1,-1]),e=Object(S.a)(r,[-1,1]),i=Object(A.a)(t,e);return Object(S.a)(i,[])}if(1===n.rank&&2===r.rank){const t=Object(S.a)(n,[1,-1]),e=Object(S.a)(r,[r.shape[0],r.shape[1]]),i=Object(A.a)(t,e);return Object(S.a)(i,[i.size])}if(2===n.rank&&1===r.rank){const t=Object(S.a)(r,[-1,1]),e=Object(A.a)(n,t);return Object(S.a)(e,[e.size])}{const t=Object(S.a)(r,[r.shape[0],r.shape[1]]);return Object(A.a)(n,t)}}});
  2685. /**
  2686. * @license
  2687. * Copyright 2021 Google LLC. All Rights Reserved.
  2688. * Licensed under the Apache License, Version 2.0 (the "License");
  2689. * you may not use this file except in compliance with the License.
  2690. * You may obtain a copy of the License at
  2691. *
  2692. * http://www.apache.org/licenses/LICENSE-2.0
  2693. *
  2694. * Unless required by applicable law or agreed to in writing, software
  2695. * distributed under the License is distributed on an "AS IS" BASIS,
  2696. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2697. * See the License for the specific language governing permissions and
  2698. * limitations under the License.
  2699. * =============================================================================
  2700. */const Tt=Object(l.a)({einsum_:function(t,...e){const n=e.map((t,e)=>Object(a.a)(t,`tensors${e}`,"einsum")),r={equation:t};return o.a.runKernel(s.T,n,r)}});var xt=n("RJ9z");
  2701. /**
  2702. * @license
  2703. * Copyright 2018 Google LLC. All Rights Reserved.
  2704. * Licensed under the Apache License, Version 2.0 (the "License");
  2705. * you may not use this file except in compliance with the License.
  2706. * You may obtain a copy of the License at
  2707. *
  2708. * http://www.apache.org/licenses/LICENSE-2.0
  2709. *
  2710. * Unless required by applicable law or agreed to in writing, software
  2711. * distributed under the License is distributed on an "AS IS" BASIS,
  2712. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2713. * See the License for the specific language governing permissions and
  2714. * limitations under the License.
  2715. * =============================================================================
  2716. */const Et=Object(l.a)({erf_:function(t){let e=Object(a.a)(t,"x","erf");d.assert("int32"===e.dtype||"float32"===e.dtype,()=>"Input dtype must be `int32` or `float32`."),"int32"===e.dtype&&(e=Object(w.a)(e,"float32"));const n={x:e};return o.a.runKernel(s.X,n)}});
  2717. /**
  2718. * @license
  2719. * Copyright 2018 Google LLC. All Rights Reserved.
  2720. * Licensed under the Apache License, Version 2.0 (the "License");
  2721. * you may not use this file except in compliance with the License.
  2722. * You may obtain a copy of the License at
  2723. *
  2724. * http://www.apache.org/licenses/LICENSE-2.0
  2725. *
  2726. * Unless required by applicable law or agreed to in writing, software
  2727. * distributed under the License is distributed on an "AS IS" BASIS,
  2728. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2729. * See the License for the specific language governing permissions and
  2730. * limitations under the License.
  2731. * =============================================================================
  2732. */const wt=Object(l.a)({exp_:function(t){const e={x:Object(a.a)(t,"x","exp")};return o.a.runKernel(s.Y,e)}});
  2733. /**
  2734. * @license
  2735. * Copyright 2020 Google LLC. All Rights Reserved.
  2736. * Licensed under the Apache License, Version 2.0 (the "License");
  2737. * you may not use this file except in compliance with the License.
  2738. * You may obtain a copy of the License at
  2739. *
  2740. * http://www.apache.org/licenses/LICENSE-2.0
  2741. *
  2742. * Unless required by applicable law or agreed to in writing, software
  2743. * distributed under the License is distributed on an "AS IS" BASIS,
  2744. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2745. * See the License for the specific language governing permissions and
  2746. * limitations under the License.
  2747. * =============================================================================
  2748. */const Ct=Object(l.a)({expandDims_:function(t,e=0){const n=Object(a.a)(t,"x","expandDims","string_or_numeric");d.assert(e<=n.rank,()=>"Axis must be <= rank of the tensor");const r={input:n},i={dim:e};return o.a.runKernel(s.Z,r,i)}});
  2749. /**
  2750. * @license
  2751. * Copyright 2018 Google LLC. All Rights Reserved.
  2752. * Licensed under the Apache License, Version 2.0 (the "License");
  2753. * you may not use this file except in compliance with the License.
  2754. * You may obtain a copy of the License at
  2755. *
  2756. * http://www.apache.org/licenses/LICENSE-2.0
  2757. *
  2758. * Unless required by applicable law or agreed to in writing, software
  2759. * distributed under the License is distributed on an "AS IS" BASIS,
  2760. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2761. * See the License for the specific language governing permissions and
  2762. * limitations under the License.
  2763. * =============================================================================
  2764. */const St=Object(l.a)({expm1_:function(t){const e={x:Object(a.a)(t,"x","expm1")};return o.a.runKernel(s._0,e)}});
  2765. /**
  2766. * @license
  2767. * Copyright 2020 Google LLC. All Rights Reserved.
  2768. * Licensed under the Apache License, Version 2.0 (the "License");
  2769. * you may not use this file except in compliance with the License.
  2770. * You may obtain a copy of the License at
  2771. *
  2772. * http://www.apache.org/licenses/LICENSE-2.0
  2773. *
  2774. * Unless required by applicable law or agreed to in writing, software
  2775. * distributed under the License is distributed on an "AS IS" BASIS,
  2776. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2777. * See the License for the specific language governing permissions and
  2778. * limitations under the License.
  2779. * =============================================================================
  2780. */const kt=Object(l.a)({tile_:function(t,e){const n=Object(a.a)(t,"x","tile","string_or_numeric");d.assert(n.rank===e.length,()=>`Error in transpose: rank of input ${n.rank} `+`must match length of reps ${e}.`);const r={x:n},i={reps:e};return o.a.runKernel(s._101,r,i)}});
  2781. /**
  2782. * @license
  2783. * Copyright 2020 Google LLC. All Rights Reserved.
  2784. * Licensed under the Apache License, Version 2.0 (the "License");
  2785. * you may not use this file except in compliance with the License.
  2786. * You may obtain a copy of the License at
  2787. *
  2788. * http://www.apache.org/licenses/LICENSE-2.0
  2789. *
  2790. * Unless required by applicable law or agreed to in writing, software
  2791. * distributed under the License is distributed on an "AS IS" BASIS,
  2792. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2793. * See the License for the specific language governing permissions and
  2794. * limitations under the License.
  2795. * =============================================================================
  2796. */const Ot=Object(l.a)({eye_:function(t,e,n,r="float32"){null==e&&(e=t);const i=Object(G.a)([t,e],r),o=t<=e?t:e;for(let t=0;t<o;++t)i.set(1,t,t);const s=Object(S.a)(i.toTensor(),[t,e]);if(null==n)return s;if(1===n.length)return kt(Ct(s,0),[n[0],1,1]);if(2===n.length)return kt(Ct(Ct(s,0),0),[n[0],n[1],1,1]);if(3===n.length)return kt(Ct(Ct(Ct(s,0),0),0),[n[0],n[1],n[2],1,1]);throw new Error("eye() currently supports only 1D and 2D "+`batchShapes, but received ${n.length}D.`)}});var It=n("Hdl1");
  2797. /**
  2798. * @license
  2799. * Copyright 2018 Google LLC. All Rights Reserved.
  2800. * Licensed under the Apache License, Version 2.0 (the "License");
  2801. * you may not use this file except in compliance with the License.
  2802. * You may obtain a copy of the License at
  2803. *
  2804. * http://www.apache.org/licenses/LICENSE-2.0
  2805. *
  2806. * Unless required by applicable law or agreed to in writing, software
  2807. * distributed under the License is distributed on an "AS IS" BASIS,
  2808. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2809. * See the License for the specific language governing permissions and
  2810. * limitations under the License.
  2811. * =============================================================================
  2812. */const Rt=Object(l.a)({floor_:function(t){const e={x:Object(a.a)(t,"x","floor","float32")};return o.a.runKernel(s._4,e)}});var At=n("K9mh");
  2813. /**
  2814. * @license
  2815. * Copyright 2018 Google LLC. All Rights Reserved.
  2816. * Licensed under the Apache License, Version 2.0 (the "License");
  2817. * you may not use this file except in compliance with the License.
  2818. * You may obtain a copy of the License at
  2819. *
  2820. * http://www.apache.org/licenses/LICENSE-2.0
  2821. *
  2822. * Unless required by applicable law or agreed to in writing, software
  2823. * distributed under the License is distributed on an "AS IS" BASIS,
  2824. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2825. * See the License for the specific language governing permissions and
  2826. * limitations under the License.
  2827. * =============================================================================
  2828. */const Nt=Object(l.a)({gather_:function(t,e,n=0,r=0){const i={x:Object(a.a)(t,"x","gather"),indices:Object(a.a)(e,"indices","gather","int32")},l={axis:n,batchDims:r};return o.a.runKernel(s._11,i,l)}});
  2829. /**
  2830. * @license
  2831. * Copyright 2020 Google LLC. All Rights Reserved.
  2832. * Licensed under the Apache License, Version 2.0 (the "License");
  2833. * you may not use this file except in compliance with the License.
  2834. * You may obtain a copy of the License at
  2835. *
  2836. * http://www.apache.org/licenses/LICENSE-2.0
  2837. *
  2838. * Unless required by applicable law or agreed to in writing, software
  2839. * distributed under the License is distributed on an "AS IS" BASIS,
  2840. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2841. * See the License for the specific language governing permissions and
  2842. * limitations under the License.
  2843. * =============================================================================
  2844. */const Dt=Object(l.a)({greater_:function(t,e){let n=Object(a.a)(t,"a","greater","string_or_numeric"),r=Object(a.a)(e,"b","greater","string_or_numeric");[n,r]=Object(T.c)(n,r),Object(gt.assertAndGetBroadcastShape)(n.shape,r.shape);const i={a:n,b:r};return o.a.runKernel(s._12,i)}});
  2845. /**
  2846. * @license
  2847. * Copyright 2020 Google LLC. All Rights Reserved.
  2848. * Licensed under the Apache License, Version 2.0 (the "License");
  2849. * you may not use this file except in compliance with the License.
  2850. * You may obtain a copy of the License at
  2851. *
  2852. * http://www.apache.org/licenses/LICENSE-2.0
  2853. *
  2854. * Unless required by applicable law or agreed to in writing, software
  2855. * distributed under the License is distributed on an "AS IS" BASIS,
  2856. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2857. * See the License for the specific language governing permissions and
  2858. * limitations under the License.
  2859. * =============================================================================
  2860. */const Mt=Object(l.a)({greaterEqual_:function(t,e){let n=Object(a.a)(t,"a","greaterEqual","string_or_numeric"),r=Object(a.a)(e,"b","greaterEqual","string_or_numeric");[n,r]=Object(T.c)(n,r),Object(gt.assertAndGetBroadcastShape)(n.shape,r.shape);const i={a:n,b:r};return o.a.runKernel(s._13,i)}});
  2861. /**
  2862. * @license
  2863. * Copyright 2020 Google LLC. All Rights Reserved.
  2864. * Licensed under the Apache License, Version 2.0 (the "License");
  2865. * you may not use this file except in compliance with the License.
  2866. * You may obtain a copy of the License at
  2867. *
  2868. * http://www.apache.org/licenses/LICENSE-2.0
  2869. *
  2870. * Unless required by applicable law or agreed to in writing, software
  2871. * distributed under the License is distributed on an "AS IS" BASIS,
  2872. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2873. * See the License for the specific language governing permissions and
  2874. * limitations under the License.
  2875. * =============================================================================
  2876. */const Lt=Object(l.a)({imag_:function(t){const e={input:Object(a.a)(t,"input","imag")};return o.a.runKernel(s._16,e)}});
  2877. /**
  2878. * @license
  2879. * Copyright 2018 Google LLC. All Rights Reserved.
  2880. * Licensed under the Apache License, Version 2.0 (the "License");
  2881. * you may not use this file except in compliance with the License.
  2882. * You may obtain a copy of the License at
  2883. *
  2884. * http://www.apache.org/licenses/LICENSE-2.0
  2885. *
  2886. * Unless required by applicable law or agreed to in writing, software
  2887. * distributed under the License is distributed on an "AS IS" BASIS,
  2888. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2889. * See the License for the specific language governing permissions and
  2890. * limitations under the License.
  2891. * =============================================================================
  2892. */const Pt=Object(l.a)({isFinite_:function(t){const e={x:Object(a.a)(t,"x","isFinite")};return o.a.runKernel(s._17,e)}});
  2893. /**
  2894. * @license
  2895. * Copyright 2018 Google LLC. All Rights Reserved.
  2896. * Licensed under the Apache License, Version 2.0 (the "License");
  2897. * you may not use this file except in compliance with the License.
  2898. * You may obtain a copy of the License at
  2899. *
  2900. * http://www.apache.org/licenses/LICENSE-2.0
  2901. *
  2902. * Unless required by applicable law or agreed to in writing, software
  2903. * distributed under the License is distributed on an "AS IS" BASIS,
  2904. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2905. * See the License for the specific language governing permissions and
  2906. * limitations under the License.
  2907. * =============================================================================
  2908. */const Ft=Object(l.a)({isInf_:function(t){const e={x:Object(a.a)(t,"x","isInf")};return o.a.runKernel(s._18,e)}});
  2909. /**
  2910. * @license
  2911. * Copyright 2018 Google LLC. All Rights Reserved.
  2912. * Licensed under the Apache License, Version 2.0 (the "License");
  2913. * you may not use this file except in compliance with the License.
  2914. * You may obtain a copy of the License at
  2915. *
  2916. * http://www.apache.org/licenses/LICENSE-2.0
  2917. *
  2918. * Unless required by applicable law or agreed to in writing, software
  2919. * distributed under the License is distributed on an "AS IS" BASIS,
  2920. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2921. * See the License for the specific language governing permissions and
  2922. * limitations under the License.
  2923. * =============================================================================
  2924. */const Bt=Object(l.a)({isNaN_:function(t){const e={x:Object(a.a)(t,"x","isNaN")};return o.a.runKernel(s._19,e)}});var jt=n("6Ppv");
  2925. /**
  2926. * @license
  2927. * Copyright 2020 Google LLC. All Rights Reserved.
  2928. * Licensed under the Apache License, Version 2.0 (the "License");
  2929. * you may not use this file except in compliance with the License.
  2930. * You may obtain a copy of the License at
  2931. *
  2932. * http://www.apache.org/licenses/LICENSE-2.0
  2933. *
  2934. * Unless required by applicable law or agreed to in writing, software
  2935. * distributed under the License is distributed on an "AS IS" BASIS,
  2936. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2937. * See the License for the specific language governing permissions and
  2938. * limitations under the License.
  2939. * =============================================================================
  2940. */const $t=Object(l.a)({less_:function(t,e){let n=Object(a.a)(t,"a","less","string_or_numeric"),r=Object(a.a)(e,"b","less","string_or_numeric");[n,r]=Object(T.c)(n,r),Object(gt.assertAndGetBroadcastShape)(n.shape,r.shape);const i={a:n,b:r};return o.a.runKernel(s._23,i)}});
  2941. /**
  2942. * @license
  2943. * Copyright 2020 Google LLC. All Rights Reserved.
  2944. * Licensed under the Apache License, Version 2.0 (the "License");
  2945. * you may not use this file except in compliance with the License.
  2946. * You may obtain a copy of the License at
  2947. *
  2948. * http://www.apache.org/licenses/LICENSE-2.0
  2949. *
  2950. * Unless required by applicable law or agreed to in writing, software
  2951. * distributed under the License is distributed on an "AS IS" BASIS,
  2952. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2953. * See the License for the specific language governing permissions and
  2954. * limitations under the License.
  2955. * =============================================================================
  2956. */const Ut=Object(l.a)({lessEqual_:function(t,e){let n=Object(a.a)(t,"a","lessEqual","string_or_numeric"),r=Object(a.a)(e,"b","lessEqual","string_or_numeric");[n,r]=Object(T.c)(n,r),Object(gt.assertAndGetBroadcastShape)(n.shape,r.shape);const i={a:n,b:r};return o.a.runKernel(s._24,i)}});
  2957. /**
  2958. * @license
  2959. * Copyright 2018 Google LLC. All Rights Reserved.
  2960. * Licensed under the Apache License, Version 2.0 (the "License");
  2961. * you may not use this file except in compliance with the License.
  2962. * You may obtain a copy of the License at
  2963. *
  2964. * http://www.apache.org/licenses/LICENSE-2.0
  2965. *
  2966. * Unless required by applicable law or agreed to in writing, software
  2967. * distributed under the License is distributed on an "AS IS" BASIS,
  2968. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2969. * See the License for the specific language governing permissions and
  2970. * limitations under the License.
  2971. * =============================================================================
  2972. */function Vt(t,e,n){if(n<=0)throw new Error("The number of values should be positive.");const r={start:t,stop:e,num:n};return o.a.runKernel(s._25,{},r)}
  2973. /**
  2974. * @license
  2975. * Copyright 2020 Google LLC. All Rights Reserved.
  2976. * Licensed under the Apache License, Version 2.0 (the "License");
  2977. * you may not use this file except in compliance with the License.
  2978. * You may obtain a copy of the License at
  2979. *
  2980. * http://www.apache.org/licenses/LICENSE-2.0
  2981. *
  2982. * Unless required by applicable law or agreed to in writing, software
  2983. * distributed under the License is distributed on an "AS IS" BASIS,
  2984. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2985. * See the License for the specific language governing permissions and
  2986. * limitations under the License.
  2987. * =============================================================================
  2988. */const Ht=Object(l.a)({localResponseNormalization_:function(t,e=5,n=1,r=1,i=.5){const l=Object(a.a)(t,"x","localResponseNormalization");d.assert(4===l.rank||3===l.rank,()=>`Error in localResponseNormalization: x must be rank 3 or 4 but got\n rank ${l.rank}.`),d.assert(d.isInt(e),()=>"Error in localResponseNormalization: depthRadius must be an "+`integer but got depthRadius ${e}.`);let u=l,c=!1;3===l.rank&&(c=!0,u=Object(S.a)(l,[1,l.shape[0],l.shape[1],l.shape[2]]));const h={x:u},p={depthRadius:e,bias:n,alpha:r,beta:i},f=o.a.runKernel(s._20,h,p);return c?Object(S.a)(f,[f.shape[1],f.shape[2],f.shape[3]]):f}});
  2989. /**
  2990. * @license
  2991. * Copyright 2018 Google LLC. All Rights Reserved.
  2992. * Licensed under the Apache License, Version 2.0 (the "License");
  2993. * you may not use this file except in compliance with the License.
  2994. * You may obtain a copy of the License at
  2995. *
  2996. * http://www.apache.org/licenses/LICENSE-2.0
  2997. *
  2998. * Unless required by applicable law or agreed to in writing, software
  2999. * distributed under the License is distributed on an "AS IS" BASIS,
  3000. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3001. * See the License for the specific language governing permissions and
  3002. * limitations under the License.
  3003. * =============================================================================
  3004. */const Wt=Object(l.a)({log_:function(t){const e={x:Object(a.a)(t,"x","log","float32")};return o.a.runKernel(s._26,e)}});
  3005. /**
  3006. * @license
  3007. * Copyright 2018 Google LLC. All Rights Reserved.
  3008. * Licensed under the Apache License, Version 2.0 (the "License");
  3009. * you may not use this file except in compliance with the License.
  3010. * You may obtain a copy of the License at
  3011. *
  3012. * http://www.apache.org/licenses/LICENSE-2.0
  3013. *
  3014. * Unless required by applicable law or agreed to in writing, software
  3015. * distributed under the License is distributed on an "AS IS" BASIS,
  3016. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3017. * See the License for the specific language governing permissions and
  3018. * limitations under the License.
  3019. * =============================================================================
  3020. */const Gt=Object(l.a)({log1p_:function(t){const e={x:Object(a.a)(t,"x","log1p")};return o.a.runKernel(s._27,e)}});var zt=n("9Nf/");
  3021. /**
  3022. * @license
  3023. * Copyright 2018 Google LLC. All Rights Reserved.
  3024. * Licensed under the Apache License, Version 2.0 (the "License");
  3025. * you may not use this file except in compliance with the License.
  3026. * You may obtain a copy of the License at
  3027. *
  3028. * http://www.apache.org/licenses/LICENSE-2.0
  3029. *
  3030. * Unless required by applicable law or agreed to in writing, software
  3031. * distributed under the License is distributed on an "AS IS" BASIS,
  3032. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3033. * See the License for the specific language governing permissions and
  3034. * limitations under the License.
  3035. * =============================================================================
  3036. */const Xt=Object(l.a)({neg_:function(t){const e={x:Object(a.a)(t,"x","neg")};return o.a.runKernel(s._45,e)}});
  3037. /**
  3038. * @license
  3039. * Copyright 2018 Google LLC. All Rights Reserved.
  3040. * Licensed under the Apache License, Version 2.0 (the "License");
  3041. * you may not use this file except in compliance with the License.
  3042. * You may obtain a copy of the License at
  3043. *
  3044. * http://www.apache.org/licenses/LICENSE-2.0
  3045. *
  3046. * Unless required by applicable law or agreed to in writing, software
  3047. * distributed under the License is distributed on an "AS IS" BASIS,
  3048. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3049. * See the License for the specific language governing permissions and
  3050. * limitations under the License.
  3051. * =============================================================================
  3052. */const Kt=Object(l.a)({softplus_:function(t){const e={x:Object(a.a)(t,"x","softplus")};return o.a.runKernel(s._81,e)}});
  3053. /**
  3054. * @license
  3055. * Copyright 2018 Google LLC. All Rights Reserved.
  3056. * Licensed under the Apache License, Version 2.0 (the "License");
  3057. * you may not use this file except in compliance with the License.
  3058. * You may obtain a copy of the License at
  3059. *
  3060. * http://www.apache.org/licenses/LICENSE-2.0
  3061. *
  3062. * Unless required by applicable law or agreed to in writing, software
  3063. * distributed under the License is distributed on an "AS IS" BASIS,
  3064. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3065. * See the License for the specific language governing permissions and
  3066. * limitations under the License.
  3067. * =============================================================================
  3068. */const Yt=Object(l.a)({logSigmoid_:function(t){const e=Object(a.a)(t,"x","logSigmoid");return Object(zt.a)(t=>({value:Xt(Kt(Xt(t))),gradFunc:e=>Object(N.a)(e,Object(D.a)(Xt(t)))}))(e)}});
  3069. /**
  3070. * @license
  3071. * Copyright 2020 Google LLC. All Rights Reserved.
  3072. * Licensed under the Apache License, Version 2.0 (the "License");
  3073. * you may not use this file except in compliance with the License.
  3074. * You may obtain a copy of the License at
  3075. *
  3076. * http://www.apache.org/licenses/LICENSE-2.0
  3077. *
  3078. * Unless required by applicable law or agreed to in writing, software
  3079. * distributed under the License is distributed on an "AS IS" BASIS,
  3080. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3081. * See the License for the specific language governing permissions and
  3082. * limitations under the License.
  3083. * =============================================================================
  3084. */const qt=Object(l.a)({max_:function(t,e=null,n=!1){const r={x:Object(a.a)(t,"x","max")},i={reductionIndices:e,keepDims:n};return o.a.runKernel(s._31,r,i)}});var Jt=n("6kjP"),Zt=n("Cp+6");const Qt=Object(l.a)({logSoftmax_:
  3085. /**
  3086. * @license
  3087. * Copyright 2020 Google Inc. All Rights Reserved.
  3088. * Licensed under the Apache License, Version 2.0 (the "License");
  3089. * you may not use this file except in compliance with the License.
  3090. * You may obtain a copy of the License at
  3091. *
  3092. * http://www.apache.org/licenses/LICENSE-2.0
  3093. *
  3094. * Unless required by applicable law or agreed to in writing, software
  3095. * distributed under the License is distributed on an "AS IS" BASIS,
  3096. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3097. * See the License for the specific language governing permissions and
  3098. * limitations under the License.
  3099. * =============================================================================
  3100. */
  3101. function(t,e=-1){const n=Object(a.a)(t,"logits","logSoftmax");if(-1===e&&(e=n.rank-1),e!==n.rank-1)throw Error("Log Softmax along a non-last dimension is not yet supported. "+`Logits was rank ${n.rank} and axis was ${e}`);return Object(zt.a)((t,n)=>{const r=qt(t,e,!0),i=Object(Jt.a)(t,r),o=Object(Jt.a)(Object(w.a)(i,"float32"),Wt(Object(Zt.a)(wt(i),e,!0)));return n([o]),{value:o,gradFunc:(t,n)=>{const[r]=n,i=wt(r);return Object(Jt.a)(t,Object(N.a)(Object(Zt.a)(t,e,!0),i))}}})(n)}});var te=n("DqkE");
  3102. /**
  3103. * @license
  3104. * Copyright 2020 Google LLC. All Rights Reserved.
  3105. * Licensed under the Apache License, Version 2.0 (the "License");
  3106. * you may not use this file except in compliance with the License.
  3107. * You may obtain a copy of the License at
  3108. *
  3109. * http://www.apache.org/licenses/LICENSE-2.0
  3110. *
  3111. * Unless required by applicable law or agreed to in writing, software
  3112. * distributed under the License is distributed on an "AS IS" BASIS,
  3113. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3114. * See the License for the specific language governing permissions and
  3115. * limitations under the License.
  3116. * =============================================================================
  3117. */const ee=Object(l.a)({logSumExp_:function(t,e=null,n=!1){const r=Object(a.a)(t,"x","logSumExp"),i=Object(d.parseAxisParam)(e,r.shape),o=qt(r,i,!0),s=Object(Jt.a)(r,o),l=wt(s),u=Object(Zt.a)(l,i),c=Wt(u),p=Object(h.a)(Object(S.a)(o,c.shape),c);if(n){const t=Object(te.e)(p.shape,i);return Object(S.a)(p,t)}return p}});
  3118. /**
  3119. * @license
  3120. * Copyright 2020 Google LLC. All Rights Reserved.
  3121. * Licensed under the Apache License, Version 2.0 (the "License");
  3122. * you may not use this file except in compliance with the License.
  3123. * You may obtain a copy of the License at
  3124. *
  3125. * http://www.apache.org/licenses/LICENSE-2.0
  3126. *
  3127. * Unless required by applicable law or agreed to in writing, software
  3128. * distributed under the License is distributed on an "AS IS" BASIS,
  3129. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3130. * See the License for the specific language governing permissions and
  3131. * limitations under the License.
  3132. * =============================================================================
  3133. */const ne=Object(l.a)({logicalAnd_:function(t,e){const n=Object(a.a)(t,"a","logicalAnd","bool"),r=Object(a.a)(e,"b","logicalAnd","bool");Object(gt.assertAndGetBroadcastShape)(n.shape,r.shape);const i={a:n,b:r};return o.a.runKernel(s._28,i)}});
  3134. /**
  3135. * @license
  3136. * Copyright 2020 Google LLC. All Rights Reserved.
  3137. * Licensed under the Apache License, Version 2.0 (the "License");
  3138. * you may not use this file except in compliance with the License.
  3139. * You may obtain a copy of the License at
  3140. *
  3141. * http://www.apache.org/licenses/LICENSE-2.0
  3142. *
  3143. * Unless required by applicable law or agreed to in writing, software
  3144. * distributed under the License is distributed on an "AS IS" BASIS,
  3145. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3146. * See the License for the specific language governing permissions and
  3147. * limitations under the License.
  3148. * =============================================================================
  3149. */const re=Object(l.a)({logicalNot_:function(t){const e={x:Object(a.a)(t,"x","logicalNot","bool")};return o.a.runKernel(s._29,e)}});
  3150. /**
  3151. * @license
  3152. * Copyright 2020 Google LLC. All Rights Reserved.
  3153. * Licensed under the Apache License, Version 2.0 (the "License");
  3154. * you may not use this file except in compliance with the License.
  3155. * You may obtain a copy of the License at
  3156. *
  3157. * http://www.apache.org/licenses/LICENSE-2.0
  3158. *
  3159. * Unless required by applicable law or agreed to in writing, software
  3160. * distributed under the License is distributed on an "AS IS" BASIS,
  3161. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3162. * See the License for the specific language governing permissions and
  3163. * limitations under the License.
  3164. * =============================================================================
  3165. */const ie=Object(l.a)({logicalOr_:function(t,e){const n=Object(a.a)(t,"a","logicalOr","bool"),r=Object(a.a)(e,"b","logicalOr","bool");Object(gt.assertAndGetBroadcastShape)(n.shape,r.shape);const i={a:n,b:r};return o.a.runKernel(s._30,i)}});
  3166. /**
  3167. * @license
  3168. * Copyright 2020 Google LLC. All Rights Reserved.
  3169. * Licensed under the Apache License, Version 2.0 (the "License");
  3170. * you may not use this file except in compliance with the License.
  3171. * You may obtain a copy of the License at
  3172. *
  3173. * http://www.apache.org/licenses/LICENSE-2.0
  3174. *
  3175. * Unless required by applicable law or agreed to in writing, software
  3176. * distributed under the License is distributed on an "AS IS" BASIS,
  3177. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3178. * See the License for the specific language governing permissions and
  3179. * limitations under the License.
  3180. * =============================================================================
  3181. */const oe=Object(l.a)({logicalXor_:function(t,e){const n=Object(a.a)(t,"a","logicalXor","bool"),r=Object(a.a)(e,"b","logicalXor","bool");return Object(gt.assertAndGetBroadcastShape)(n.shape,r.shape),ne(ie(t,e),re(ne(t,e)))}});
  3182. /**
  3183. * @license
  3184. * Copyright 2020 Google LLC. All Rights Reserved.
  3185. * Licensed under the Apache License, Version 2.0 (the "License");
  3186. * you may not use this file except in compliance with the License.
  3187. * You may obtain a copy of the License at
  3188. *
  3189. * http://www.apache.org/licenses/LICENSE-2.0
  3190. *
  3191. * Unless required by applicable law or agreed to in writing, software
  3192. * distributed under the License is distributed on an "AS IS" BASIS,
  3193. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3194. * See the License for the specific language governing permissions and
  3195. * limitations under the License.
  3196. * =============================================================================
  3197. */const se=Object(l.a)({maxPool_:function(t,e,n,r,i){const l=Object(a.a)(t,"x","maxPool");let u=l,c=!1;3===l.rank&&(c=!0,u=Object(S.a)(l,[1,l.shape[0],l.shape[1],l.shape[2]])),d.assert(4===u.rank,()=>`Error in maxPool: input must be rank 4 but got rank ${u.rank}.`),d.assert(C.i(n,1),()=>"Error in maxPool: Either strides or dilations must be 1. "+`Got strides ${n} and dilations '1'`),C.a("maxPool",r,i);const h={x:u},p={filterSize:e,strides:n,pad:r,dimRoundingMode:i},f=o.a.runKernel(s._32,h,p);return c?Object(S.a)(f,[f.shape[1],f.shape[2],f.shape[3]]):f}});
  3198. /**
  3199. * @license
  3200. * Copyright 2020 Google LLC. All Rights Reserved.
  3201. * Licensed under the Apache License, Version 2.0 (the "License");
  3202. * you may not use this file except in compliance with the License.
  3203. * You may obtain a copy of the License at
  3204. *
  3205. * http://www.apache.org/licenses/LICENSE-2.0
  3206. *
  3207. * Unless required by applicable law or agreed to in writing, software
  3208. * distributed under the License is distributed on an "AS IS" BASIS,
  3209. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3210. * See the License for the specific language governing permissions and
  3211. * limitations under the License.
  3212. * =============================================================================
  3213. */const ae=Object(l.a)({maxPool3d_:function(t,e=[1,1,1],n,r,i,l="NDHWC"){const u=Object(a.a)(t,"x","maxPool3d");let c=u,h=!1;4===u.rank&&(h=!0,c=Object(S.a)(u,[1,u.shape[0],u.shape[1],u.shape[2],u.shape[3]])),d.assert(5===c.rank,()=>`Error in maxPool3d: x must be rank 5 but got rank ${c.rank}.`),d.assert("NDHWC"===l,()=>"Error in maxPool3d: Only NDHWC is currently supported, "+`but got dataFormat of ${l}`),Object(C.a)("maxPool3d",r,i);const p={x:c},f={filterSize:e,strides:n,pad:r,dimRoundingMode:i,dataFormat:l},g=o.a.runKernel(s._33,p,f);return h?Object(S.a)(g,[g.shape[1],g.shape[2],g.shape[3],g.shape[4]]):g}});
  3214. /**
  3215. * @license
  3216. * Copyright 2018 Google LLC. All Rights Reserved.
  3217. * Licensed under the Apache License, Version 2.0 (the "License");
  3218. * you may not use this file except in compliance with the License.
  3219. * You may obtain a copy of the License at
  3220. *
  3221. * http://www.apache.org/licenses/LICENSE-2.0
  3222. *
  3223. * Unless required by applicable law or agreed to in writing, software
  3224. * distributed under the License is distributed on an "AS IS" BASIS,
  3225. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3226. * See the License for the specific language governing permissions and
  3227. * limitations under the License.
  3228. * =============================================================================
  3229. */const le=Object(l.a)({maxPoolWithArgmax_:function(t,e,n,r,i=!1){const l={x:Object(a.a)(t,"x","maxPoolWithArgmax")},u={filterSize:e,strides:n,pad:r,includeBatchInIndex:i},c=o.a.runKernel(s._36,l,u);return{result:c[0],indexes:c[1]}}});var ue=n("dHLy");
  3230. /**
  3231. * @license
  3232. * Copyright 2020 Google Inc. All Rights Reserved.
  3233. * Licensed under the Apache License, Version 2.0 (the "License");
  3234. * you may not use this file except in compliance with the License.
  3235. * You may obtain a copy of the License at
  3236. *
  3237. * http://www.apache.org/licenses/LICENSE-2.0
  3238. *
  3239. * Unless required by applicable law or agreed to in writing, software
  3240. * distributed under the License is distributed on an "AS IS" BASIS,
  3241. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3242. * See the License for the specific language governing permissions and
  3243. * limitations under the License.
  3244. * =============================================================================
  3245. */const ce=Object(l.a)({mean_:function(t,e=null,n=!1){const r={x:Object(a.a)(t,"x","mean")},i={axis:e,keepDims:n};return o.a.runKernel(s._38,r,i)}});
  3246. /**
  3247. * @license
  3248. * Copyright 2018 Google LLC. All Rights Reserved.
  3249. * Licensed under the Apache License, Version 2.0 (the "License");
  3250. * you may not use this file except in compliance with the License.
  3251. * You may obtain a copy of the License at
  3252. *
  3253. * http://www.apache.org/licenses/LICENSE-2.0
  3254. *
  3255. * Unless required by applicable law or agreed to in writing, software
  3256. * distributed under the License is distributed on an "AS IS" BASIS,
  3257. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3258. * See the License for the specific language governing permissions and
  3259. * limitations under the License.
  3260. * =============================================================================
  3261. */function he(t,e="float32"){if("complex64"===e){const e=he(t,"float32"),n=he(t,"float32");return Object(K.a)(e,n)}const n=Object(d.makeZerosTypedArray)(Object(d.sizeFromShape)(t),e);return o.a.makeTensor(n,t,e)}
  3262. /**
  3263. * @license
  3264. * Copyright 2018 Google LLC. All Rights Reserved.
  3265. * Licensed under the Apache License, Version 2.0 (the "License");
  3266. * you may not use this file except in compliance with the License.
  3267. * You may obtain a copy of the License at
  3268. *
  3269. * http://www.apache.org/licenses/LICENSE-2.0
  3270. *
  3271. * Unless required by applicable law or agreed to in writing, software
  3272. * distributed under the License is distributed on an "AS IS" BASIS,
  3273. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3274. * See the License for the specific language governing permissions and
  3275. * limitations under the License.
  3276. * =============================================================================
  3277. */function de(t,e="float32"){if("complex64"===e){const e=de(t,"float32"),n=he(t,"float32");return Object(K.a)(e,n)}const n=Object(d.makeOnesTypedArray)(Object(d.sizeFromShape)(t),e);return o.a.makeTensor(n,t,e)}var pe=n("XPNO"),fe=n("DYVU");
  3278. /**
  3279. * @license
  3280. * Copyright 2021 Google LLC. All Rights Reserved.
  3281. * Licensed under the Apache License, Version 2.0 (the "License");
  3282. * you may not use this file except in compliance with the License.
  3283. * You may obtain a copy of the License at
  3284. *
  3285. * http://www.apache.org/licenses/LICENSE-2.0
  3286. *
  3287. * Unless required by applicable law or agreed to in writing, software
  3288. * distributed under the License is distributed on an "AS IS" BASIS,
  3289. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3290. * See the License for the specific language governing permissions and
  3291. * limitations under the License.
  3292. * =============================================================================
  3293. */
  3294. function ge(t,e,{indexing:n="xy"}={}){if("xy"!==n&&"ij"!==n)throw new TypeError(`${n} is not a valid third argument to meshgrid`);if(void 0===t)return[];let r=Object(a.a)(t,"x","meshgrid",t instanceof pe.a?t.dtype:"float32");if(void 0===e)return[r];let i=Object(a.a)(e,"y","meshgrid",e instanceof pe.a?e.dtype:"float32");const o=Object(fe.O)(r.shape),s=Object(fe.O)(i.shape);return"xy"===n?(r=Object(S.a)(r,[1,-1]),i=Object(S.a)(i,[-1,1]),[Object(A.a)(de([s,1],r.dtype),r),Object(A.a)(i,de([1,o],i.dtype))]):(r=Object(S.a)(r,[-1,1]),i=Object(S.a)(i,[1,-1]),[Object(A.a)(r,de([1,s],r.dtype)),Object(A.a)(de([o,1],i.dtype),i)])}
  3295. /**
  3296. * @license
  3297. * Copyright 2020 Google Inc. All Rights Reserved.
  3298. * Licensed under the Apache License, Version 2.0 (the "License");
  3299. * you may not use this file except in compliance with the License.
  3300. * You may obtain a copy of the License at
  3301. *
  3302. * http://www.apache.org/licenses/LICENSE-2.0
  3303. *
  3304. * Unless required by applicable law or agreed to in writing, software
  3305. * distributed under the License is distributed on an "AS IS" BASIS,
  3306. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3307. * See the License for the specific language governing permissions and
  3308. * limitations under the License.
  3309. * =============================================================================
  3310. */const me=Object(l.a)({min_:function(t,e=null,n=!1){const r={x:Object(a.a)(t,"x","min")},i={axis:e,keepDims:n};return o.a.runKernel(s._39,r,i)}});
  3311. /**
  3312. * @license
  3313. * Copyright 2020 Google LLC. All Rights Reserved.
  3314. * Licensed under the Apache License, Version 2.0 (the "License");
  3315. * you may not use this file except in compliance with the License.
  3316. * You may obtain a copy of the License at
  3317. *
  3318. * http://www.apache.org/licenses/LICENSE-2.0
  3319. *
  3320. * Unless required by applicable law or agreed to in writing, software
  3321. * distributed under the License is distributed on an "AS IS" BASIS,
  3322. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3323. * See the License for the specific language governing permissions and
  3324. * limitations under the License.
  3325. * =============================================================================
  3326. */const ve=Object(l.a)({minimum_:function(t,e){let n=Object(a.a)(t,"a","minimum"),r=Object(a.a)(e,"b","minimum");[n,r]=Object(T.c)(n,r),"bool"===n.dtype&&(n=Object(w.a)(n,"int32"),r=Object(w.a)(r,"int32")),Object(gt.assertAndGetBroadcastShape)(n.shape,r.shape);const i={a:n,b:r};return o.a.runKernel(s._40,i)}});
  3327. /**
  3328. * @license
  3329. * Copyright 2020 Google LLC. All Rights Reserved.
  3330. * Licensed under the Apache License, Version 2.0 (the "License");
  3331. * you may not use this file except in compliance with the License.
  3332. * You may obtain a copy of the License at
  3333. *
  3334. * http://www.apache.org/licenses/LICENSE-2.0
  3335. *
  3336. * Unless required by applicable law or agreed to in writing, software
  3337. * distributed under the License is distributed on an "AS IS" BASIS,
  3338. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3339. * See the License for the specific language governing permissions and
  3340. * limitations under the License.
  3341. * =============================================================================
  3342. */const be=Object(l.a)({mirrorPad_:function(t,e,n){d.assert("reflect"===n||"symmetric"===n,()=>"Invalid mode. Mode must be either reflect or symmetric. "+`Got ${n}.`);const r=Object(a.a)(t,"x","mirrorPad");if(0===r.rank)throw new Error("mirrorPad(scalar) is not defined. Pass non-scalar to mirrorPad");d.assert(e.length===r.rank,()=>`Padding doesn't match input. Must be ${r.rank}. `+`Got ${e.length}.`);const i="reflect"===n?1:0;for(let t=0;t<r.rank;t++)d.assert(2===e[t].length,()=>"Invalid number of paddings. Must be length of 2 each."),d.assert(e[t][0]>=0&&e[t][0]<=r.shape[t]-i&&e[t][1]>=0&&e[t][1]<=r.shape[t]-i,()=>`Padding in dimension ${t} cannot be greater than or equal `+`to ${r.shape[t]-i} or less than 0 for input of `+`shape ${r.shape}`);const l={paddings:e,mode:n},u={x:r};return o.a.runKernel(s._41,u,l)}});
  3343. /**
  3344. * @license
  3345. * Copyright 2020 Google LLC. All Rights Reserved.
  3346. * Licensed under the Apache License, Version 2.0 (the "License");
  3347. * you may not use this file except in compliance with the License.
  3348. * You may obtain a copy of the License at
  3349. *
  3350. * http://www.apache.org/licenses/LICENSE-2.0
  3351. *
  3352. * Unless required by applicable law or agreed to in writing, software
  3353. * distributed under the License is distributed on an "AS IS" BASIS,
  3354. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3355. * See the License for the specific language governing permissions and
  3356. * limitations under the License.
  3357. * =============================================================================
  3358. */const _e=Object(l.a)({mod_:function(t,e){let n=Object(a.a)(t,"a","mod"),r=Object(a.a)(e,"b","mod");[n,r]=Object(T.c)(n,r);const i={a:n,b:r};return o.a.runKernel(s._42,i)}});var ye=n("UWMC");
  3359. /**
  3360. * @license
  3361. * Copyright 2020 Google LLC. All Rights Reserved.
  3362. * Licensed under the Apache License, Version 2.0 (the "License");
  3363. * you may not use this file except in compliance with the License.
  3364. * You may obtain a copy of the License at
  3365. *
  3366. * http://www.apache.org/licenses/LICENSE-2.0
  3367. *
  3368. * Unless required by applicable law or agreed to in writing, software
  3369. * distributed under the License is distributed on an "AS IS" BASIS,
  3370. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3371. * See the License for the specific language governing permissions and
  3372. * limitations under the License.
  3373. * =============================================================================
  3374. */const Te=Object(l.a)({moments_:function(t,e=null,n=!1){t=Object(a.a)(t,"x","moments");const r=Object(d.parseAxisParam)(e,t.shape),i=ce(t,r,n);let o=i.shape;n||(o=Object(te.e)(i.shape,r));const s=Object(ye.a)(Object(Jt.a)(Object(w.a)(t,"float32"),Object(S.a)(i,o)));return{mean:i,variance:ce(s,r,n)}}});const xe=Object(l.a)({multiRNNCell_:function(t,e,n,r){const i=Object(a.a)(e,"data","multiRNNCell"),o=Object(a.b)(n,"c","multiRNNCell"),s=Object(a.b)(r,"h","multiRNNCell");let l=i;const u=[];for(let e=0;e<t.length;e++){const n=t[e](l,o[e],s[e]);u.push(n[0]),u.push(n[1]),l=n[1]}const c=[],h=[];for(let t=0;t<u.length;t+=2)c.push(u[t]),h.push(u[t+1]);return[c,h]}});
  3375. /**
  3376. * @license
  3377. * Copyright 2020 Google LLC. All Rights Reserved.
  3378. * Licensed under the Apache License, Version 2.0 (the "License");
  3379. * you may not use this file except in compliance with the License.
  3380. * You may obtain a copy of the License at
  3381. *
  3382. * http://www.apache.org/licenses/LICENSE-2.0
  3383. *
  3384. * Unless required by applicable law or agreed to in writing, software
  3385. * distributed under the License is distributed on an "AS IS" BASIS,
  3386. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3387. * See the License for the specific language governing permissions and
  3388. * limitations under the License.
  3389. * =============================================================================
  3390. */const Ee=Object(l.a)({multinomial_:function(t,e,n,r=!1){const i=Object(a.a)(t,"logits","multinomial"),l=i.size,u=i.rank;if(l<2)throw new Error("Error in multinomial: you need at least 2 outcomes, but got "+`${l}.`);if(u>2)throw new Error(`Rank of probabilities must be 1 or 2, but is ${u}`);n=n||Math.random();const c={logits:1===u?Object(S.a)(i,[1,-1]):i},h={numSamples:e,seed:n,normalized:r},d=o.a.runKernel(s._43,c,h);return 1===u?Object(S.a)(d,[d.size]):d}});
  3391. /**
  3392. * @license
  3393. * Copyright 2020 Google LLC. All Rights Reserved.
  3394. * Licensed under the Apache License, Version 2.0 (the "License");
  3395. * you may not use this file except in compliance with the License.
  3396. * You may obtain a copy of the License at
  3397. *
  3398. * http://www.apache.org/licenses/LICENSE-2.0
  3399. *
  3400. * Unless required by applicable law or agreed to in writing, software
  3401. * distributed under the License is distributed on an "AS IS" BASIS,
  3402. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3403. * See the License for the specific language governing permissions and
  3404. * limitations under the License.
  3405. * =============================================================================
  3406. */const we=Object(l.a)({notEqual_:function(t,e){let n=Object(a.a)(t,"a","notEqual","string_or_numeric"),r=Object(a.a)(e,"b","notEqual","string_or_numeric");[n,r]=Object(T.c)(n,r),Object(gt.assertAndGetBroadcastShape)(n.shape,r.shape);const i={a:n,b:r};return o.a.runKernel(s._49,i)}});var Ce=n("0FNO");
  3407. /**
  3408. * @license
  3409. * Copyright 2018 Google LLC. All Rights Reserved.
  3410. * Licensed under the Apache License, Version 2.0 (the "License");
  3411. * you may not use this file except in compliance with the License.
  3412. * You may obtain a copy of the License at
  3413. *
  3414. * http://www.apache.org/licenses/LICENSE-2.0
  3415. *
  3416. * Unless required by applicable law or agreed to in writing, software
  3417. * distributed under the License is distributed on an "AS IS" BASIS,
  3418. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3419. * See the License for the specific language governing permissions and
  3420. * limitations under the License.
  3421. * =============================================================================
  3422. */const Se=Object(l.a)({onesLike_:function(t){const e={x:Object(a.a)(t,"x","onesLike")};return o.a.runKernel(s._51,e)}});const ke=Object(l.a)({outerProduct_:function(t,e){const n=Object(a.a)(t,"v1","outerProduct"),r=Object(a.a)(e,"v2","outerProduct");d.assert(1===n.rank&&1===r.rank,()=>"Error in outerProduct: inputs must be rank 1, but got ranks "+`${n.rank} and ${r.rank}.`);const i=Object(S.a)(n,[-1,1]),o=Object(S.a)(r,[1,-1]);return Object(A.a)(i,o)}});
  3423. /**
  3424. * @license
  3425. * Copyright 2020 Google LLC. All Rights Reserved.
  3426. * Licensed under the Apache License, Version 2.0 (the "License");
  3427. * you may not use this file except in compliance with the License.
  3428. * You may obtain a copy of the License at
  3429. *
  3430. * http://www.apache.org/licenses/LICENSE-2.0
  3431. *
  3432. * Unless required by applicable law or agreed to in writing, software
  3433. * distributed under the License is distributed on an "AS IS" BASIS,
  3434. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3435. * See the License for the specific language governing permissions and
  3436. * limitations under the License.
  3437. * =============================================================================
  3438. */const Oe=Object(l.a)({pad_:function(t,e,n=0){const r=Object(a.a)(t,"x","pad");if(0===r.rank)throw new Error("pad(scalar) is not defined. Pass non-scalar to pad");const i={paddings:e,constantValue:n},l={x:r};return o.a.runKernel(s._53,l,i)}});const Ie=Object(l.a)({pad1d_:function(t,e,n=0){return Object(d.assert)(2===e.length,()=>"Invalid number of paddings. Must be length of 2."),Oe(t,[e],n)}});const Re=Object(l.a)({pad2d_:function(t,e,n=0){return Object(d.assert)(2===e.length&&2===e[0].length&&2===e[1].length,()=>"Invalid number of paddings. Must be length of 2 each."),Oe(t,e,n)}});const Ae=Object(l.a)({pad3d_:function(t,e,n=0){return Object(d.assert)(3===e.length&&2===e[0].length&&2===e[1].length&&2===e[2].length,()=>"Invalid number of paddings. Must be length of 2 each."),Oe(t,e,n)}});const Ne=Object(l.a)({pad4d_:function(t,e,n=0){return Object(d.assert)(4===e.length&&2===e[0].length&&2===e[1].length&&2===e[2].length&&2===e[3].length,()=>"Invalid number of paddings. Must be length of 2 each."),Oe(t,e,n)}});
  3439. /**
  3440. * @license
  3441. * Copyright 2020 Google LLC. All Rights Reserved.
  3442. * Licensed under the Apache License, Version 2.0 (the "License");
  3443. * you may not use this file except in compliance with the License.
  3444. * You may obtain a copy of the License at
  3445. *
  3446. * http://www.apache.org/licenses/LICENSE-2.0
  3447. *
  3448. * Unless required by applicable law or agreed to in writing, software
  3449. * distributed under the License is distributed on an "AS IS" BASIS,
  3450. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3451. * See the License for the specific language governing permissions and
  3452. * limitations under the License.
  3453. * =============================================================================
  3454. */const De=Object(l.a)({spaceToBatchND_:function(t,e,n){const r=Object(a.a)(t,"x","spaceToBatchND");d.assert(r.rank>=1+e.length,()=>`input rank ${r.rank} should be > than [blockShape] ${e.length}`),d.assert(n.length===e.length,()=>`paddings.shape[0] ${n.length} must be equal to [blockShape] ${e.length}`),d.assert(r.shape.reduce((t,r,i)=>i>0&&i<=e.length?t&&(r+n[i-1][0]+n[i-1][1])%e[i-1]==0:t,!0),()=>`input spatial dimensions ${r.shape.slice(1)} with paddings ${n.toString()} must be divisible by blockShapes ${e.toString()}`);const i={x:r},l={blockShape:e,paddings:n};return o.a.runKernel(s._82,i,l)}});
  3455. /**
  3456. * @license
  3457. * Copyright 2018 Google LLC. All Rights Reserved.
  3458. * Licensed under the Apache License, Version 2.0 (the "License");
  3459. * you may not use this file except in compliance with the License.
  3460. * You may obtain a copy of the License at
  3461. *
  3462. * http://www.apache.org/licenses/LICENSE-2.0
  3463. *
  3464. * Unless required by applicable law or agreed to in writing, software
  3465. * distributed under the License is distributed on an "AS IS" BASIS,
  3466. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3467. * See the License for the specific language governing permissions and
  3468. * limitations under the License.
  3469. * =============================================================================
  3470. */const Me=Object(l.a)({pool_:function(t,e,n,r,i,o,s){null==i&&(i=[1,1]),null==o&&(o=1),0===r&&(r="valid");const l=Object(a.a)(t,"x","maxPool");let u=l,c=!1;3===l.rank&&(c=!0,u=Object(S.a)(l,[1,l.shape[0],l.shape[1],l.shape[2]])),d.assert(C.i(o,i),()=>"Error in pool: Either strides or dilations must be 1. "+`Got strides ${o} and dilations '${i}'`);const h=C.f(u.shape,e,o,i,r),p=[h.dilationHeight,h.dilationWidth];let f;f="same"===r?function(t,e){const n=t.map((t,n)=>t+(t-1)*(e[n]-1)).map(t=>t-1),r=n.map(t=>Math.floor(t/2)),i=n.map((t,e)=>t-r[e]);return n.map((t,e)=>[r[e],i[e]])}([h.filterHeight,h.filterWidth],p):[[0,0],[0,0]];const g=1===p[0]&&1===p[1],[m,v]=function(t,e,n){const r=n.map(t=>t[0]),i=n.map(t=>t[1]),o=t.concat(r,i),s=e.map((t,e)=>(t-o[e]%t)%t),a=i.map((t,e)=>t+s[e]),l=e.map((t,e)=>[r[e],a[e]]),u=e.map((t,e)=>[0,s[e]]);return[l,u]}([h.inHeight,h.inWidth],p,f),b=g?r:"valid",_=g?u:De(u,p,m),y=("avg"===n?()=>k(_,e,o,b,s):()=>se(_,e,o,b,s))(),T=g?y:F(y,p,v);return c?Object(S.a)(T,[T.shape[1],T.shape[2],T.shape[3]]):T}});var Le=n("eNzZ"),Pe=n("JffD"),Fe=n("xnen");const Be=Object(l.a)({prod_:
  3471. /**
  3472. * @license
  3473. * Copyright 2020 Google LLC. All Rights Reserved.
  3474. * Licensed under the Apache License, Version 2.0 (the "License");
  3475. * you may not use this file except in compliance with the License.
  3476. * You may obtain a copy of the License at
  3477. *
  3478. * http://www.apache.org/licenses/LICENSE-2.0
  3479. *
  3480. * Unless required by applicable law or agreed to in writing, software
  3481. * distributed under the License is distributed on an "AS IS" BASIS,
  3482. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3483. * See the License for the specific language governing permissions and
  3484. * limitations under the License.
  3485. * =============================================================================
  3486. */
  3487. function(t,e=null,n=!1){let r=Object(a.a)(t,"x","prod");"bool"===r.dtype&&(r=Object(w.a)(r,"int32"));const i={x:r},l={axis:e,keepDims:n};return o.a.runKernel(s._56,i,l)}});
  3488. /**
  3489. * @license
  3490. * Copyright 2020 Google LLC. All Rights Reserved.
  3491. * Licensed under the Apache License, Version 2.0 (the "License");
  3492. * you may not use this file except in compliance with the License.
  3493. * You may obtain a copy of the License at
  3494. *
  3495. * http://www.apache.org/licenses/LICENSE-2.0
  3496. *
  3497. * Unless required by applicable law or agreed to in writing, software
  3498. * distributed under the License is distributed on an "AS IS" BASIS,
  3499. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3500. * See the License for the specific language governing permissions and
  3501. * limitations under the License.
  3502. * =============================================================================
  3503. */const je=Object(l.a)({rand_:function(t,e,n){const r=Object(d.sizeFromShape)(t);let i=null;if(null==n||"float32"===n)i=new Float32Array(r);else if("int32"===n)i=new Int32Array(r);else{if("bool"!==n)throw new Error(`Unknown data type ${n}`);i=new Uint8Array(r)}for(let t=0;t<r;t++)i[t]=e();return o.a.makeTensor(i,t,n)}});var $e=n("H/Ud");n("ZD6k");
  3504. /**
  3505. * @license
  3506. * Copyright 2018 Google LLC. All Rights Reserved.
  3507. * Licensed under the Apache License, Version 2.0 (the "License");
  3508. * you may not use this file except in compliance with the License.
  3509. * You may obtain a copy of the License at
  3510. *
  3511. * http://www.apache.org/licenses/LICENSE-2.0
  3512. *
  3513. * Unless required by applicable law or agreed to in writing, software
  3514. * distributed under the License is distributed on an "AS IS" BASIS,
  3515. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3516. * See the License for the specific language governing permissions and
  3517. * limitations under the License.
  3518. * =============================================================================
  3519. */
  3520. class Ue{constructor(t,e,n,r,i){this.mean=t,this.stdDev=e,this.dtype=n,this.nextVal=NaN,this.truncated=r,this.truncated&&(this.upper=this.mean+2*this.stdDev,this.lower=this.mean-2*this.stdDev);const o=i||Math.random();this.random=$e.alea(o.toString())}nextValue(){if(!isNaN(this.nextVal)){const t=this.nextVal;return this.nextVal=NaN,t}let t,e,n=!1;for(;!n;){let r,i,o;do{o=(r=2*this.random()-1)*r+(i=2*this.random()-1)*i}while(o>=1||0===o);const s=Math.sqrt(-2*Math.log(o)/o);t=this.mean+this.stdDev*r*s,e=this.mean+this.stdDev*i*s,this.truncated&&!this.isValidTruncated(t)||(n=!0)}return this.truncated&&!this.isValidTruncated(e)||(this.nextVal=this.convertValue(e)),this.convertValue(t)}convertValue(t){return null==this.dtype||"float32"===this.dtype?t:Math.round(t)}isValidTruncated(t){return t<=this.upper&&t>=this.lower}}class Ve{constructor(t,e,n,r){this.alpha=t,this.beta=1/e,this.dtype=n;const i=r||Math.random();this.randu=$e.alea(i.toString()),this.randn=new Ue(0,1,n,!1,this.randu()),this.d=t<1?t+2/3:t-1/3,this.c=1/Math.sqrt(9*this.d)}nextValue(){let t,e,n,r,i,o;for(;;){do{r=this.randn.nextValue(),o=1+this.c*r}while(o<=0);if(o*=o*o,e=1-.331*(t=r*r)*t,n=.5*t+this.d*(1-o+Math.log(o)),(i=this.randu())<e||Math.log(i)<n)break}return o=1/this.beta*this.d*o,this.alpha<1&&(o*=Math.pow(this.randu(),1/this.alpha)),this.convertValue(o)}convertValue(t){return"float32"===this.dtype?t:Math.round(t)}}class He{constructor(t=0,e=1,n,r){if(this.canReturnFloat=(()=>null==this.dtype||"float32"===this.dtype),this.min=t,this.range=e-t,this.dtype=n,null==r&&(r=Math.random()),"number"==typeof r&&(r=r.toString()),!this.canReturnFloat()&&this.range<=1)throw new Error(`The difference between ${t} - ${e} <= 1 and dtype is not float`);this.random=$e.alea(r)}convertValue(t){return this.canReturnFloat()?t:Math.round(t)}nextValue(){return this.convertValue(this.min+this.range*this.random())}}const We=Object(l.a)({randomGamma_:
  3521. /**
  3522. * @license
  3523. * Copyright 2020 Google LLC. All Rights Reserved.
  3524. * Licensed under the Apache License, Version 2.0 (the "License");
  3525. * you may not use this file except in compliance with the License.
  3526. * You may obtain a copy of the License at
  3527. *
  3528. * http://www.apache.org/licenses/LICENSE-2.0
  3529. *
  3530. * Unless required by applicable law or agreed to in writing, software
  3531. * distributed under the License is distributed on an "AS IS" BASIS,
  3532. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3533. * See the License for the specific language governing permissions and
  3534. * limitations under the License.
  3535. * =============================================================================
  3536. */
  3537. function(t,e,n=1,r="float32",i){if(null==n&&(n=1),null==r&&(r="float32"),"float32"!==r&&"int32"!==r)throw new Error(`Unsupported data type ${r}`);const o=new Ve(e,n,r,i),s=Object(G.a)(t,r);for(let t=0;t<s.values.length;t++)s.values[t]=o.nextValue();return s.toTensor()}});
  3538. /**
  3539. * @license
  3540. * Copyright 2020 Google LLC. All Rights Reserved.
  3541. * Licensed under the Apache License, Version 2.0 (the "License");
  3542. * you may not use this file except in compliance with the License.
  3543. * You may obtain a copy of the License at
  3544. *
  3545. * http://www.apache.org/licenses/LICENSE-2.0
  3546. *
  3547. * Unless required by applicable law or agreed to in writing, software
  3548. * distributed under the License is distributed on an "AS IS" BASIS,
  3549. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3550. * See the License for the specific language governing permissions and
  3551. * limitations under the License.
  3552. * =============================================================================
  3553. */const Ge=Object(l.a)({randomNormal_:function(t,e=0,n=1,r,i){if(null!=r&&"bool"===r)throw new Error(`Unsupported data type ${r}`);const o=new Ue(e,n,r,!1,i),s=Object(G.a)(t,r);for(let t=0;t<s.values.length;t++)s.values[t]=o.nextValue();return s.toTensor()}});
  3554. /**
  3555. * @license
  3556. * Copyright 2020 Google LLC. All Rights Reserved.
  3557. * Licensed under the Apache License, Version 2.0 (the "License");
  3558. * you may not use this file except in compliance with the License.
  3559. * You may obtain a copy of the License at
  3560. *
  3561. * http://www.apache.org/licenses/LICENSE-2.0
  3562. *
  3563. * Unless required by applicable law or agreed to in writing, software
  3564. * distributed under the License is distributed on an "AS IS" BASIS,
  3565. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3566. * See the License for the specific language governing permissions and
  3567. * limitations under the License.
  3568. * =============================================================================
  3569. */const ze=Object(l.a)({randomUniform_:function(t,e=0,n=1,r="float32",i){const o=Object(G.a)(t,r),s=new He(e,n,null,i);for(let t=0;t<o.values.length;t++)o.values[t]=s.nextValue();return o.toTensor()}});
  3570. /**
  3571. * @license
  3572. * Copyright 2018 Google LLC. All Rights Reserved.
  3573. * Licensed under the Apache License, Version 2.0 (the "License");
  3574. * you may not use this file except in compliance with the License.
  3575. * You may obtain a copy of the License at
  3576. *
  3577. * http://www.apache.org/licenses/LICENSE-2.0
  3578. *
  3579. * Unless required by applicable law or agreed to in writing, software
  3580. * distributed under the License is distributed on an "AS IS" BASIS,
  3581. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3582. * See the License for the specific language governing permissions and
  3583. * limitations under the License.
  3584. * =============================================================================
  3585. */function Xe(t,e,n=1,r="float32"){if(0===n)throw new Error("Cannot have a step of zero");const i={start:t,stop:e,step:n,dtype:r};return o.a.runKernel(s._57,{},i)}
  3586. /**
  3587. * @license
  3588. * Copyright 2020 Google LLC. All Rights Reserved.
  3589. * Licensed under the Apache License, Version 2.0 (the "License");
  3590. * you may not use this file except in compliance with the License.
  3591. * You may obtain a copy of the License at
  3592. *
  3593. * http://www.apache.org/licenses/LICENSE-2.0
  3594. *
  3595. * Unless required by applicable law or agreed to in writing, software
  3596. * distributed under the License is distributed on an "AS IS" BASIS,
  3597. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3598. * See the License for the specific language governing permissions and
  3599. * limitations under the License.
  3600. * =============================================================================
  3601. */const Ke=Object(l.a)({real_:function(t){const e={input:Object(a.a)(t,"input","real")};return o.a.runKernel(s._58,e)}});
  3602. /**
  3603. * @license
  3604. * Copyright 2018 Google LLC. All Rights Reserved.
  3605. * Licensed under the Apache License, Version 2.0 (the "License");
  3606. * you may not use this file except in compliance with the License.
  3607. * You may obtain a copy of the License at
  3608. *
  3609. * http://www.apache.org/licenses/LICENSE-2.0
  3610. *
  3611. * Unless required by applicable law or agreed to in writing, software
  3612. * distributed under the License is distributed on an "AS IS" BASIS,
  3613. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3614. * See the License for the specific language governing permissions and
  3615. * limitations under the License.
  3616. * =============================================================================
  3617. */const Ye=Object(l.a)({reciprocal_:function(t){const e={x:Object(a.a)(t,"x","reciprocal")};return o.a.runKernel(s._60,e)}});var qe=n("hSps"),Je=n("lsVm");const Ze=Object(l.a)({reverse_:
  3618. /**
  3619. * @license
  3620. * Copyright 2018 Google LLC. All Rights Reserved.
  3621. * Licensed under the Apache License, Version 2.0 (the "License");
  3622. * you may not use this file except in compliance with the License.
  3623. * You may obtain a copy of the License at
  3624. *
  3625. * http://www.apache.org/licenses/LICENSE-2.0
  3626. *
  3627. * Unless required by applicable law or agreed to in writing, software
  3628. * distributed under the License is distributed on an "AS IS" BASIS,
  3629. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3630. * See the License for the specific language governing permissions and
  3631. * limitations under the License.
  3632. * =============================================================================
  3633. */
  3634. function(t,e){const n={x:Object(a.a)(t,"x","reverse")},r={dims:e};return o.a.runKernel(s._68,n,r)}});
  3635. /**
  3636. * @license
  3637. * Copyright 2020 Google LLC. All Rights Reserved.
  3638. * Licensed under the Apache License, Version 2.0 (the "License");
  3639. * you may not use this file except in compliance with the License.
  3640. * You may obtain a copy of the License at
  3641. *
  3642. * http://www.apache.org/licenses/LICENSE-2.0
  3643. *
  3644. * Unless required by applicable law or agreed to in writing, software
  3645. * distributed under the License is distributed on an "AS IS" BASIS,
  3646. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3647. * See the License for the specific language governing permissions and
  3648. * limitations under the License.
  3649. * =============================================================================
  3650. */const Qe=Object(l.a)({reverse1d_:function(t){const e=Object(a.a)(t,"x","reverse");return d.assert(1===e.rank,()=>`Error in reverse1D: x must be rank 1 but got rank ${e.rank}.`),Ze(e,0)}});
  3651. /**
  3652. * @license
  3653. * Copyright 2020 Google LLC. All Rights Reserved.
  3654. * Licensed under the Apache License, Version 2.0 (the "License");
  3655. * you may not use this file except in compliance with the License.
  3656. * You may obtain a copy of the License at
  3657. *
  3658. * http://www.apache.org/licenses/LICENSE-2.0
  3659. *
  3660. * Unless required by applicable law or agreed to in writing, software
  3661. * distributed under the License is distributed on an "AS IS" BASIS,
  3662. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3663. * See the License for the specific language governing permissions and
  3664. * limitations under the License.
  3665. * =============================================================================
  3666. */const tn=Object(l.a)({reverse2d_:function(t,e){const n=Object(a.a)(t,"x","reverse");return d.assert(2===n.rank,()=>`Error in reverse2D: x must be rank 2 but got rank ${n.rank}.`),Ze(n,e)}});
  3667. /**
  3668. * @license
  3669. * Copyright 2020 Google LLC. All Rights Reserved.
  3670. * Licensed under the Apache License, Version 2.0 (the "License");
  3671. * you may not use this file except in compliance with the License.
  3672. * You may obtain a copy of the License at
  3673. *
  3674. * http://www.apache.org/licenses/LICENSE-2.0
  3675. *
  3676. * Unless required by applicable law or agreed to in writing, software
  3677. * distributed under the License is distributed on an "AS IS" BASIS,
  3678. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3679. * See the License for the specific language governing permissions and
  3680. * limitations under the License.
  3681. * =============================================================================
  3682. */const en=Object(l.a)({reverse3d_:function(t,e){const n=Object(a.a)(t,"x","reverse");return d.assert(3===n.rank,()=>`Error in reverse3D: x must be rank 3 but got rank ${n.rank}.`),Ze(n,e)}});
  3683. /**
  3684. * @license
  3685. * Copyright 2020 Google LLC. All Rights Reserved.
  3686. * Licensed under the Apache License, Version 2.0 (the "License");
  3687. * you may not use this file except in compliance with the License.
  3688. * You may obtain a copy of the License at
  3689. *
  3690. * http://www.apache.org/licenses/LICENSE-2.0
  3691. *
  3692. * Unless required by applicable law or agreed to in writing, software
  3693. * distributed under the License is distributed on an "AS IS" BASIS,
  3694. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3695. * See the License for the specific language governing permissions and
  3696. * limitations under the License.
  3697. * =============================================================================
  3698. */const nn=Object(l.a)({reverse4d_:function(t,e){const n=Object(a.a)(t,"x","reverse");return d.assert(4===n.rank,()=>`Error in reverse4D: x must be rank 4 but got rank ${n.rank}.`),Ze(n,e)}});
  3699. /**
  3700. * @license
  3701. * Copyright 2018 Google LLC. All Rights Reserved.
  3702. * Licensed under the Apache License, Version 2.0 (the "License");
  3703. * you may not use this file except in compliance with the License.
  3704. * You may obtain a copy of the License at
  3705. *
  3706. * http://www.apache.org/licenses/LICENSE-2.0
  3707. *
  3708. * Unless required by applicable law or agreed to in writing, software
  3709. * distributed under the License is distributed on an "AS IS" BASIS,
  3710. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3711. * See the License for the specific language governing permissions and
  3712. * limitations under the License.
  3713. * =============================================================================
  3714. */const rn=Object(l.a)({round_:function(t){const e={x:Object(a.a)(t,"x","round")};return o.a.runKernel(s._70,e)}});
  3715. /**
  3716. * @license
  3717. * Copyright 2018 Google LLC. All Rights Reserved.
  3718. * Licensed under the Apache License, Version 2.0 (the "License");
  3719. * you may not use this file except in compliance with the License.
  3720. * You may obtain a copy of the License at
  3721. *
  3722. * http://www.apache.org/licenses/LICENSE-2.0
  3723. *
  3724. * Unless required by applicable law or agreed to in writing, software
  3725. * distributed under the License is distributed on an "AS IS" BASIS,
  3726. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3727. * See the License for the specific language governing permissions and
  3728. * limitations under the License.
  3729. * =============================================================================
  3730. */const on=Object(l.a)({rsqrt_:function(t){const e={x:Object(a.a)(t,"x","rsqrt","float32")};return o.a.runKernel(s._71,e)}});var sn=n("s2iQ");
  3731. /**
  3732. * @license
  3733. * Copyright 2020 Google LLC. All Rights Reserved.
  3734. * Licensed under the Apache License, Version 2.0 (the "License");
  3735. * you may not use this file except in compliance with the License.
  3736. * You may obtain a copy of the License at
  3737. *
  3738. * http://www.apache.org/licenses/LICENSE-2.0
  3739. *
  3740. * Unless required by applicable law or agreed to in writing, software
  3741. * distributed under the License is distributed on an "AS IS" BASIS,
  3742. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3743. * See the License for the specific language governing permissions and
  3744. * limitations under the License.
  3745. * =============================================================================
  3746. */const an=Object(l.a)({selu_:function(t){const e={x:Object(a.a)(t,"x","selu")};return o.a.runKernel(s._74,e)}});const ln=Object(l.a)({separableConv2d_:function(t,e,n,r,i,o=[1,1],s="NHWC"){const l=Object(a.a)(t,"x","separableConv2d"),u=Object(a.a)(e,"depthwiseFilter","separableConv2d"),c=Object(a.a)(n,"pointwiseFilter","separableConv2d");let h=l,p=!1;if(3===l.rank&&(p=!0,h=Object(S.a)(l,[1,l.shape[0],l.shape[1],l.shape[2]])),"NCHW"===s)throw new Error("separableConv2d currently does not support dataFormat NCHW; only NHWC is supported");d.assert(4===h.rank,()=>"Error in separableConv2d: input must be rank 4, but got "+`rank ${h.rank}.`),d.assert(4===u.rank,()=>"Error in separableConv2d: depthwise filter must be rank 4, but "+`got rank ${u.rank}.`),d.assert(4===c.rank,()=>"Error in separableConv2d: pointwise filter must be rank 4, but "+`got rank ${u.rank}.`),d.assert(1===c.shape[0],()=>"Error in separableConv2d: the first dimension of pointwise filter "+` must be 1, but got ${c.shape[0]}.`),d.assert(1===c.shape[1],()=>"Error in separableConv2d: the second dimension of pointwise "+`filter must be 1, but got ${c.shape[1]}.`);const f=u.shape[2],g=u.shape[3];d.assert(c.shape[2]===f*g,()=>"Error in separableConv2d: the third dimension of pointwise filter "+`must be ${f*g}, `+`but got ${c.shape[2]}.`);const m=ht(h,u,r,i,s,o),v=Q(m,c,1,"valid",s);return p?Object(S.a)(v,[v.shape[1],v.shape[2],v.shape[3]]):v}});
  3747. /**
  3748. * @license
  3749. * Copyright 2020 Google Inc. All Rights Reserved.
  3750. * Licensed under the Apache License, Version 2.0 (the "License");
  3751. * you may not use this file except in compliance with the License.
  3752. * You may obtain a copy of the License at
  3753. *
  3754. * http://www.apache.org/licenses/LICENSE-2.0
  3755. *
  3756. * Unless required by applicable law or agreed to in writing, software
  3757. * distributed under the License is distributed on an "AS IS" BASIS,
  3758. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3759. * See the License for the specific language governing permissions and
  3760. * limitations under the License.
  3761. * =============================================================================
  3762. */const un=async function(t,e){const n=Object(a.a)(t,"x","setdiff1d"),r=Object(a.a)(e,"y","setdiff1d");d.assert(n.dtype===r.dtype,()=>`x and y should have the same dtype, but got x (${n.dtype}) and y (${r.dtype}).`),d.assert(1===n.rank,()=>`x should be 1D tensor, but got x (${n.shape}).`),d.assert(1===r.rank,()=>`y should be 1D tensor, but got y (${r.shape}).`);const i=await n.data(),o=await r.data(),s=new Set(o);let l=0;for(let t=0;t<i.length;t++)s.has(i[t])||l++;const u=new pe.b([l],n.dtype),c=new pe.b([l],"int32");for(let t=0,e=0;t<i.length;t++)s.has(i[t])||(u.values[e]=i[t],c.values[e]=t,e++);return[u.toTensor(),c.toTensor()]};
  3763. /**
  3764. * @license
  3765. * Copyright 2018 Google LLC. All Rights Reserved.
  3766. * Licensed under the Apache License, Version 2.0 (the "License");
  3767. * you may not use this file except in compliance with the License.
  3768. * You may obtain a copy of the License at
  3769. *
  3770. * http://www.apache.org/licenses/LICENSE-2.0
  3771. *
  3772. * Unless required by applicable law or agreed to in writing, software
  3773. * distributed under the License is distributed on an "AS IS" BASIS,
  3774. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3775. * See the License for the specific language governing permissions and
  3776. * limitations under the License.
  3777. * =============================================================================
  3778. */const cn=Object(l.a)({sign_:function(t){const e={x:Object(a.a)(t,"x","sign")};return o.a.runKernel(s._76,e)}});
  3779. /**
  3780. * @license
  3781. * Copyright 2018 Google LLC. All Rights Reserved.
  3782. * Licensed under the Apache License, Version 2.0 (the "License");
  3783. * you may not use this file except in compliance with the License.
  3784. * You may obtain a copy of the License at
  3785. *
  3786. * http://www.apache.org/licenses/LICENSE-2.0
  3787. *
  3788. * Unless required by applicable law or agreed to in writing, software
  3789. * distributed under the License is distributed on an "AS IS" BASIS,
  3790. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3791. * See the License for the specific language governing permissions and
  3792. * limitations under the License.
  3793. * =============================================================================
  3794. */const hn=Object(l.a)({sin_:function(t){const e={x:Object(a.a)(t,"x","sin","float32")};return o.a.runKernel(s._77,e)}});
  3795. /**
  3796. * @license
  3797. * Copyright 2018 Google LLC. All Rights Reserved.
  3798. * Licensed under the Apache License, Version 2.0 (the "License");
  3799. * you may not use this file except in compliance with the License.
  3800. * You may obtain a copy of the License at
  3801. *
  3802. * http://www.apache.org/licenses/LICENSE-2.0
  3803. *
  3804. * Unless required by applicable law or agreed to in writing, software
  3805. * distributed under the License is distributed on an "AS IS" BASIS,
  3806. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3807. * See the License for the specific language governing permissions and
  3808. * limitations under the License.
  3809. * =============================================================================
  3810. */const dn=Object(l.a)({sinh_:function(t){const e={x:Object(a.a)(t,"x","sinh")};return o.a.runKernel(s._78,e)}});
  3811. /**
  3812. * @license
  3813. * Copyright 2018 Google LLC. All Rights Reserved.
  3814. * Licensed under the Apache License, Version 2.0 (the "License");
  3815. * you may not use this file except in compliance with the License.
  3816. * You may obtain a copy of the License at
  3817. *
  3818. * http://www.apache.org/licenses/LICENSE-2.0
  3819. *
  3820. * Unless required by applicable law or agreed to in writing, software
  3821. * distributed under the License is distributed on an "AS IS" BASIS,
  3822. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3823. * See the License for the specific language governing permissions and
  3824. * limitations under the License.
  3825. * =============================================================================
  3826. */const pn=Object(l.a)({slice1d_:function(t,e,n){const r=Object(a.a)(t,"x","slice1d");return d.assert(1===r.rank,()=>`slice1d expects a rank-1 tensor, but got a rank-${r.rank} tensor`),M(r,[e],[n])}});
  3827. /**
  3828. * @license
  3829. * Copyright 2018 Google LLC. All Rights Reserved.
  3830. * Licensed under the Apache License, Version 2.0 (the "License");
  3831. * you may not use this file except in compliance with the License.
  3832. * You may obtain a copy of the License at
  3833. *
  3834. * http://www.apache.org/licenses/LICENSE-2.0
  3835. *
  3836. * Unless required by applicable law or agreed to in writing, software
  3837. * distributed under the License is distributed on an "AS IS" BASIS,
  3838. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3839. * See the License for the specific language governing permissions and
  3840. * limitations under the License.
  3841. * =============================================================================
  3842. */const fn=Object(l.a)({slice2d_:function(t,e,n){const r=Object(a.a)(t,"x","slice2d");return d.assert(2===r.rank,()=>`slice2d expects a rank-2 tensor, but got a rank-${r.rank} tensor`),M(r,e,n)}});
  3843. /**
  3844. * @license
  3845. * Copyright 2018 Google LLC. All Rights Reserved.
  3846. * Licensed under the Apache License, Version 2.0 (the "License");
  3847. * you may not use this file except in compliance with the License.
  3848. * You may obtain a copy of the License at
  3849. *
  3850. * http://www.apache.org/licenses/LICENSE-2.0
  3851. *
  3852. * Unless required by applicable law or agreed to in writing, software
  3853. * distributed under the License is distributed on an "AS IS" BASIS,
  3854. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3855. * See the License for the specific language governing permissions and
  3856. * limitations under the License.
  3857. * =============================================================================
  3858. */const gn=Object(l.a)({slice3d_:function(t,e,n){const r=Object(a.a)(t,"x","slice3d");return d.assert(3===r.rank,()=>`slice3d expects a rank-3 tensor, but got a rank-${r.rank} tensor`),M(r,e,n)}});
  3859. /**
  3860. * @license
  3861. * Copyright 2018 Google LLC. All Rights Reserved.
  3862. * Licensed under the Apache License, Version 2.0 (the "License");
  3863. * you may not use this file except in compliance with the License.
  3864. * You may obtain a copy of the License at
  3865. *
  3866. * http://www.apache.org/licenses/LICENSE-2.0
  3867. *
  3868. * Unless required by applicable law or agreed to in writing, software
  3869. * distributed under the License is distributed on an "AS IS" BASIS,
  3870. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3871. * See the License for the specific language governing permissions and
  3872. * limitations under the License.
  3873. * =============================================================================
  3874. */const mn=Object(l.a)({slice4d_:function(t,e,n){const r=Object(a.a)(t,"x","slice4d");return d.assert(4===r.rank,()=>`slice4d expects a rank-4 tensor, but got a rank-${r.rank} tensor`),M(r,e,n)}});
  3875. /**
  3876. * @license
  3877. * Copyright 2018 Google LLC. All Rights Reserved.
  3878. * Licensed under the Apache License, Version 2.0 (the "License");
  3879. * you may not use this file except in compliance with the License.
  3880. * You may obtain a copy of the License at
  3881. *
  3882. * http://www.apache.org/licenses/LICENSE-2.0
  3883. *
  3884. * Unless required by applicable law or agreed to in writing, software
  3885. * distributed under the License is distributed on an "AS IS" BASIS,
  3886. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3887. * See the License for the specific language governing permissions and
  3888. * limitations under the License.
  3889. * =============================================================================
  3890. */const vn=Object(l.a)({softmax_:function(t,e=-1){const n=Object(a.a)(t,"logits","softmax","float32");if(-1===e&&(e=n.rank-1),e!==n.rank-1)throw Error("Softmax along a non-last dimension is not yet supported. "+`Logits was rank ${n.rank} and dim was ${e}`);const r={logits:n},i={dim:e};return o.a.runKernel(s._80,r,i)}});
  3891. /**
  3892. * @license
  3893. * Copyright 2020 Google LLC. All Rights Reserved.
  3894. * Licensed under the Apache License, Version 2.0 (the "License");
  3895. * you may not use this file except in compliance with the License.
  3896. * You may obtain a copy of the License at
  3897. *
  3898. * http://www.apache.org/licenses/LICENSE-2.0
  3899. *
  3900. * Unless required by applicable law or agreed to in writing, software
  3901. * distributed under the License is distributed on an "AS IS" BASIS,
  3902. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3903. * See the License for the specific language governing permissions and
  3904. * limitations under the License.
  3905. * =============================================================================
  3906. */const bn=Object(l.a)({fft_:function(t){Object(d.assert)("complex64"===t.dtype,()=>"The dtype for tf.spectral.fft() must be complex64 "+`but got ${t.dtype}.`);const e={input:t};return o.a.runKernel(s._1,e)}});
  3907. /**
  3908. * @license
  3909. * Copyright 2020 Google LLC. All Rights Reserved.
  3910. * Licensed under the Apache License, Version 2.0 (the "License");
  3911. * you may not use this file except in compliance with the License.
  3912. * You may obtain a copy of the License at
  3913. *
  3914. * http://www.apache.org/licenses/LICENSE-2.0
  3915. *
  3916. * Unless required by applicable law or agreed to in writing, software
  3917. * distributed under the License is distributed on an "AS IS" BASIS,
  3918. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3919. * See the License for the specific language governing permissions and
  3920. * limitations under the License.
  3921. * =============================================================================
  3922. */const _n=Object(l.a)({ifft_:function(t){Object(d.assert)("complex64"===t.dtype,()=>"The dtype for tf.spectral.ifft() must be complex64 "+`but got ${t.dtype}.`);const e={input:t};return o.a.runKernel(s._14,e)}});
  3923. /**
  3924. * @license
  3925. * Copyright 2018 Google LLC. All Rights Reserved.
  3926. * Licensed under the Apache License, Version 2.0 (the "License");
  3927. * you may not use this file except in compliance with the License.
  3928. * You may obtain a copy of the License at
  3929. *
  3930. * http://www.apache.org/licenses/LICENSE-2.0
  3931. *
  3932. * Unless required by applicable law or agreed to in writing, software
  3933. * distributed under the License is distributed on an "AS IS" BASIS,
  3934. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3935. * See the License for the specific language governing permissions and
  3936. * limitations under the License.
  3937. * =============================================================================
  3938. */const yn=Object(l.a)({irfft_:function(t){const e=t.shape[t.shape.length-1],n=t.size/e;let r;if(e<=2){const i=Object(S.a)(t,[n,e]);r=_n(i)}else{const i=[n,2*(e-1)],o=Object(S.a)(Ke(t),[n,e]),s=Object(S.a)(Lt(t),[n,e]),a=Ze(M(o,[0,1],[n,e-2]),1),l=Object(N.a)(Ze(M(s,[0,1],[n,e-2]),1),Object(sn.a)(-1)),u=R([o,a],1),c=R([s,l],1),h=Object(S.a)(Object(K.a)(u,c),[i[0],i[1]]);r=_n(h)}if(r=Ke(r),3===t.rank&&0!==t.shape[0]){const e=r,n=t.shape[0];r=Object(S.a)(r,[n,r.shape[0]/n,r.shape[1]]),e.dispose()}return r}});
  3939. /**
  3940. * @license
  3941. * Copyright 2020 Google LLC. All Rights Reserved.
  3942. * Licensed under the Apache License, Version 2.0 (the "License");
  3943. * you may not use this file except in compliance with the License.
  3944. * You may obtain a copy of the License at
  3945. *
  3946. * http://www.apache.org/licenses/LICENSE-2.0
  3947. *
  3948. * Unless required by applicable law or agreed to in writing, software
  3949. * distributed under the License is distributed on an "AS IS" BASIS,
  3950. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3951. * See the License for the specific language governing permissions and
  3952. * limitations under the License.
  3953. * =============================================================================
  3954. */const Tn=Object(l.a)({split_:function(t,e,n=0){const r={x:Object(a.a)(t,"x","split")},i={numOrSizeSplits:e,axis:n};return o.a.runKernel(s._88,r,i)}});
  3955. /**
  3956. * @license
  3957. * Copyright 2018 Google LLC. All Rights Reserved.
  3958. * Licensed under the Apache License, Version 2.0 (the "License");
  3959. * you may not use this file except in compliance with the License.
  3960. * You may obtain a copy of the License at
  3961. *
  3962. * http://www.apache.org/licenses/LICENSE-2.0
  3963. *
  3964. * Unless required by applicable law or agreed to in writing, software
  3965. * distributed under the License is distributed on an "AS IS" BASIS,
  3966. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3967. * See the License for the specific language governing permissions and
  3968. * limitations under the License.
  3969. * =============================================================================
  3970. */const xn=Object(l.a)({rfft_:function(t,e){Object(d.assert)("float32"===t.dtype,()=>`The dtype for rfft() must be real value but got ${t.dtype}`);let n=t.shape[t.shape.length-1];const r=t.size/n;let i;if(null!=e&&e<n){const r=t.shape.map(t=>0),o=t.shape.map(t=>t);o[t.shape.length-1]=e,i=M(t,r,o),n=e}else if(null!=e&&e>n){const r=t.shape.map(t=>t);r[t.shape.length-1]=e-n,i=R([t,he(r)],t.shape.length-1),n=e}else i=t;const o=Object(bt.a)(i),s=Object(S.a)(Object(K.a)(i,o),[r,n]),a=bn(s),l=Math.floor(n/2)+1,u=Ke(a),c=Lt(a),h=Tn(u,[l,n-l],u.shape.length-1),p=Tn(c,[l,n-l],c.shape.length-1),f=i.shape.slice();return f[i.shape.length-1]=l,Object(S.a)(Object(K.a)(h[0],p[0]),f)}});var En=n("FUmq");
  3971. /**
  3972. * @license
  3973. * Copyright 2020 Google LLC. All Rights Reserved.
  3974. * Licensed under the Apache License, Version 2.0 (the "License");
  3975. * you may not use this file except in compliance with the License.
  3976. * You may obtain a copy of the License at
  3977. *
  3978. * http://www.apache.org/licenses/LICENSE-2.0
  3979. *
  3980. * Unless required by applicable law or agreed to in writing, software
  3981. * distributed under the License is distributed on an "AS IS" BASIS,
  3982. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3983. * See the License for the specific language governing permissions and
  3984. * limitations under the License.
  3985. * =============================================================================
  3986. */const wn=Object(l.a)({squaredDifference_:function(t,e){let n=Object(a.a)(t,"a","squaredDifference"),r=Object(a.a)(e,"b","squaredDifference");[n,r]=Object(T.c)(n,r),Object(gt.assertAndGetBroadcastShape)(n.shape,r.shape);const i={a:n,b:r};return o.a.runKernel(s._91,i,{})}});
  3987. /**
  3988. * @license
  3989. * Copyright 2020 Google LLC. All Rights Reserved.
  3990. * Licensed under the Apache License, Version 2.0 (the "License");
  3991. * you may not use this file except in compliance with the License.
  3992. * You may obtain a copy of the License at
  3993. *
  3994. * http://www.apache.org/licenses/LICENSE-2.0
  3995. *
  3996. * Unless required by applicable law or agreed to in writing, software
  3997. * distributed under the License is distributed on an "AS IS" BASIS,
  3998. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3999. * See the License for the specific language governing permissions and
  4000. * limitations under the License.
  4001. * =============================================================================
  4002. */const Cn=Object(l.a)({squeeze_:function(t,e){const n=Object(a.a)(t,"x","squeeze");return Object(S.a)(n,Object(d.squeezeShape)(n.shape,e).newShape)}});
  4003. /**
  4004. * @license
  4005. * Copyright 2020 Google LLC. All Rights Reserved.
  4006. * Licensed under the Apache License, Version 2.0 (the "License");
  4007. * you may not use this file except in compliance with the License.
  4008. * You may obtain a copy of the License at
  4009. *
  4010. * http://www.apache.org/licenses/LICENSE-2.0
  4011. *
  4012. * Unless required by applicable law or agreed to in writing, software
  4013. * distributed under the License is distributed on an "AS IS" BASIS,
  4014. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4015. * See the License for the specific language governing permissions and
  4016. * limitations under the License.
  4017. * =============================================================================
  4018. */const Sn=Object(l.a)({stack_:function(t,e=0){const n=Object(a.b)(t,"tensors","stack","string_or_numeric");d.assert(n.length>=1,()=>"Pass at least one tensor to tf.stack"),n.length>0&&d.assert(e<=n[0].rank,()=>"Axis must be <= rank of the tensor");const r=n,i={axis:e};return o.a.runKernel(s._52,r,i)}});var kn=n("Rz9h");
  4019. /**
  4020. * @license
  4021. * Copyright 2018 Google LLC. All Rights Reserved.
  4022. * Licensed under the Apache License, Version 2.0 (the "License");
  4023. * you may not use this file except in compliance with the License.
  4024. * You may obtain a copy of the License at
  4025. *
  4026. * http://www.apache.org/licenses/LICENSE-2.0
  4027. *
  4028. * Unless required by applicable law or agreed to in writing, software
  4029. * distributed under the License is distributed on an "AS IS" BASIS,
  4030. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4031. * See the License for the specific language governing permissions and
  4032. * limitations under the License.
  4033. * =============================================================================
  4034. */const On=Object(l.a)({stridedSlice_:function(t,e,n,r,i=0,l=0,u=0,c=0,h=0){const d={x:Object(a.a)(t,"x","stridedSlice","string_or_numeric")},p={begin:e,end:n,strides:r,beginMask:i,endMask:l,ellipsisMask:u,newAxisMask:c,shrinkAxisMask:h};return o.a.runKernel(s._93,d,p)}});
  4035. /**
  4036. * @license
  4037. * Copyright 2018 Google LLC. All Rights Reserved.
  4038. * Licensed under the Apache License, Version 2.0 (the "License");
  4039. * you may not use this file except in compliance with the License.
  4040. * You may obtain a copy of the License at
  4041. *
  4042. * http://www.apache.org/licenses/LICENSE-2.0
  4043. *
  4044. * Unless required by applicable law or agreed to in writing, software
  4045. * distributed under the License is distributed on an "AS IS" BASIS,
  4046. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4047. * See the License for the specific language governing permissions and
  4048. * limitations under the License.
  4049. * =============================================================================
  4050. */const In=Object(l.a)({tan_:function(t){const e={x:Object(a.a)(t,"x","tan","float32")};return o.a.runKernel(s._99,e)}});var Rn=n("gHp0"),An=n("M1Ti");
  4051. /**
  4052. * @license
  4053. * Copyright 2018 Google LLC. All Rights Reserved.
  4054. * Licensed under the Apache License, Version 2.0 (the "License");
  4055. * you may not use this file except in compliance with the License.
  4056. * You may obtain a copy of the License at
  4057. *
  4058. * http://www.apache.org/licenses/LICENSE-2.0
  4059. *
  4060. * Unless required by applicable law or agreed to in writing, software
  4061. * distributed under the License is distributed on an "AS IS" BASIS,
  4062. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4063. * See the License for the specific language governing permissions and
  4064. * limitations under the License.
  4065. * =============================================================================
  4066. */
  4067. function Nn(t,e){Object(d.assertNonNull)(t);const n=Object(a.c)(t,e);if(1!==n.length)throw new Error("tensor1d() requires values to be a flat/TypedArray");return Object(An.a)(t,null,n,e)}
  4068. /**
  4069. * @license
  4070. * Copyright 2018 Google LLC. All Rights Reserved.
  4071. * Licensed under the Apache License, Version 2.0 (the "License");
  4072. * you may not use this file except in compliance with the License.
  4073. * You may obtain a copy of the License at
  4074. *
  4075. * http://www.apache.org/licenses/LICENSE-2.0
  4076. *
  4077. * Unless required by applicable law or agreed to in writing, software
  4078. * distributed under the License is distributed on an "AS IS" BASIS,
  4079. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4080. * See the License for the specific language governing permissions and
  4081. * limitations under the License.
  4082. * =============================================================================
  4083. */function Dn(t,e,n){if(Object(d.assertNonNull)(t),null!=e&&2!==e.length)throw new Error("tensor2d() requires shape to have two numbers");const r=Object(a.c)(t,n);if(2!==r.length&&1!==r.length)throw new Error("tensor2d() requires values to be number[][] or flat/TypedArray");if(1===r.length&&null==e)throw new Error("tensor2d() requires shape to be provided when `values` are a flat/TypedArray");return Object(An.a)(t,e,r,n)}var Mn=n("ke9e");
  4084. /**
  4085. * @license
  4086. * Copyright 2018 Google LLC. All Rights Reserved.
  4087. * Licensed under the Apache License, Version 2.0 (the "License");
  4088. * you may not use this file except in compliance with the License.
  4089. * You may obtain a copy of the License at
  4090. *
  4091. * http://www.apache.org/licenses/LICENSE-2.0
  4092. *
  4093. * Unless required by applicable law or agreed to in writing, software
  4094. * distributed under the License is distributed on an "AS IS" BASIS,
  4095. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4096. * See the License for the specific language governing permissions and
  4097. * limitations under the License.
  4098. * =============================================================================
  4099. */function Ln(t,e,n){if(Object(d.assertNonNull)(t),null!=e&&4!==e.length)throw new Error("tensor4d() requires shape to have four numbers");const r=Object(a.c)(t,n);if(4!==r.length&&1!==r.length)throw new Error("tensor4d() requires values to be number[][][][] or flat/TypedArray");if(1===r.length&&null==e)throw new Error("tensor4d() requires shape to be provided when `values` are a flat array");return Object(An.a)(t,e,r,n)}
  4100. /**
  4101. * @license
  4102. * Copyright 2018 Google LLC. All Rights Reserved.
  4103. * Licensed under the Apache License, Version 2.0 (the "License");
  4104. * you may not use this file except in compliance with the License.
  4105. * You may obtain a copy of the License at
  4106. *
  4107. * http://www.apache.org/licenses/LICENSE-2.0
  4108. *
  4109. * Unless required by applicable law or agreed to in writing, software
  4110. * distributed under the License is distributed on an "AS IS" BASIS,
  4111. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4112. * See the License for the specific language governing permissions and
  4113. * limitations under the License.
  4114. * =============================================================================
  4115. */function Pn(t,e,n){if(Object(d.assertNonNull)(t),null!=e&&5!==e.length)throw new Error("tensor5d() requires shape to have five numbers");const r=Object(a.c)(t,n);if(5!==r.length&&1!==r.length)throw new Error("tensor5d() requires values to be number[][][][][] or flat/TypedArray");if(1===r.length&&null==e)throw new Error("tensor5d() requires shape to be provided when `values` are a flat array");return Object(An.a)(t,e,r,n)}
  4116. /**
  4117. * @license
  4118. * Copyright 2018 Google LLC. All Rights Reserved.
  4119. * Licensed under the Apache License, Version 2.0 (the "License");
  4120. * you may not use this file except in compliance with the License.
  4121. * You may obtain a copy of the License at
  4122. *
  4123. * http://www.apache.org/licenses/LICENSE-2.0
  4124. *
  4125. * Unless required by applicable law or agreed to in writing, software
  4126. * distributed under the License is distributed on an "AS IS" BASIS,
  4127. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4128. * See the License for the specific language governing permissions and
  4129. * limitations under the License.
  4130. * =============================================================================
  4131. */function Fn(t,e,n){if(Object(d.assertNonNull)(t),null!=e&&6!==e.length)throw new Error("tensor6d() requires shape to have six numbers");const r=Object(a.c)(t,n);if(6!==r.length&&1!==r.length)throw new Error("tensor6d() requires values to be number[][][][][][] or flat/TypedArray");if(1===r.length&&null==e)throw new Error("tensor6d() requires shape to be provided when `values` are a flat array");return e=e||r,Object(An.a)(t,e,r,n)}
  4132. /**
  4133. * @license
  4134. * Copyright 2018 Google LLC. All Rights Reserved.
  4135. * Licensed under the Apache License, Version 2.0 (the "License");
  4136. * you may not use this file except in compliance with the License.
  4137. * You may obtain a copy of the License at
  4138. *
  4139. * http://www.apache.org/licenses/LICENSE-2.0
  4140. *
  4141. * Unless required by applicable law or agreed to in writing, software
  4142. * distributed under the License is distributed on an "AS IS" BASIS,
  4143. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4144. * See the License for the specific language governing permissions and
  4145. * limitations under the License.
  4146. * =============================================================================
  4147. */const Bn=Object(l.a)({topk_:function(t,e=1,n=!0){const r=Object(a.a)(t,"x","topk");if(0===r.rank)throw new Error("topk() expects the input to be of rank 1 or higher");const i=r.shape[r.shape.length-1];if(e<0)throw new Error(`'k' passed to topk() must be >= 0 but got ${e}`);if(e>i)throw new Error(`'k' passed to topk() must be <= the last dimension (${i}) `+`but got ${e}`);const l={x:r},u={k:e,sorted:n},[c,h]=o.a.runKernel(s._102,l,u);return{values:c,indices:h}}});
  4148. /**
  4149. * @license
  4150. * Copyright 2020 Google LLC. All Rights Reserved.
  4151. * Licensed under the Apache License, Version 2.0 (the "License");
  4152. * you may not use this file except in compliance with the License.
  4153. * You may obtain a copy of the License at
  4154. *
  4155. * http://www.apache.org/licenses/LICENSE-2.0
  4156. *
  4157. * Unless required by applicable law or agreed to in writing, software
  4158. * distributed under the License is distributed on an "AS IS" BASIS,
  4159. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4160. * See the License for the specific language governing permissions and
  4161. * limitations under the License.
  4162. * =============================================================================
  4163. */const jn=Object(l.a)({truncatedNormal_:function(t,e=0,n=1,r,i){if(null!=r&&"bool"===r)throw new Error("Unsupported data type $ { dtype }");const o=new Ue(e,n,r,!0,i),s=Object(G.a)(t,r);for(let t=0;t<s.values.length;t++)s.values[t]=o.nextValue();return s.toTensor()}});
  4164. /**
  4165. * @license
  4166. * Copyright 2020 Google LLC. All Rights Reserved.
  4167. * Licensed under the Apache License, Version 2.0 (the "License");
  4168. * you may not use this file except in compliance with the License.
  4169. * You may obtain a copy of the License at
  4170. *
  4171. * http://www.apache.org/licenses/LICENSE-2.0
  4172. *
  4173. * Unless required by applicable law or agreed to in writing, software
  4174. * distributed under the License is distributed on an "AS IS" BASIS,
  4175. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4176. * See the License for the specific language governing permissions and
  4177. * limitations under the License.
  4178. * =============================================================================
  4179. */const $n=Object(l.a)({unique_:function(t,e=0){const n=Object(a.a)(t,"x","unique","string_or_numeric");Object(d.assert)(n.rank>0,()=>"The input tensor must be at least 1D");const r={x:n},i={axis:e},[l,u]=o.a.runKernel(s._105,r,i);return{values:l,indices:u}}});
  4180. /**
  4181. * @license
  4182. * Copyright 2020 Google LLC. All Rights Reserved.
  4183. * Licensed under the Apache License, Version 2.0 (the "License");
  4184. * you may not use this file except in compliance with the License.
  4185. * You may obtain a copy of the License at
  4186. *
  4187. * http://www.apache.org/licenses/LICENSE-2.0
  4188. *
  4189. * Unless required by applicable law or agreed to in writing, software
  4190. * distributed under the License is distributed on an "AS IS" BASIS,
  4191. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4192. * See the License for the specific language governing permissions and
  4193. * limitations under the License.
  4194. * =============================================================================
  4195. */const Un=Object(l.a)({unsortedSegmentSum_:function(t,e,n){const r=Object(a.a)(t,"x","unsortedSegmentSum"),i=Object(a.a)(e,"segmentIds","unsortedSegmentSum","int32");Object(d.assert)(Object(d.isInt)(n),()=>"numSegments must be of dtype int");const l={x:r,segmentIds:i},u={numSegments:n};return o.a.runKernel(s._107,l,u)}});
  4196. /**
  4197. * @license
  4198. * Copyright 2020 Google LLC. All Rights Reserved.
  4199. * Licensed under the Apache License, Version 2.0 (the "License");
  4200. * you may not use this file except in compliance with the License.
  4201. * You may obtain a copy of the License at
  4202. *
  4203. * http://www.apache.org/licenses/LICENSE-2.0
  4204. *
  4205. * Unless required by applicable law or agreed to in writing, software
  4206. * distributed under the License is distributed on an "AS IS" BASIS,
  4207. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4208. * See the License for the specific language governing permissions and
  4209. * limitations under the License.
  4210. * =============================================================================
  4211. */const Vn=Object(l.a)({unstack_:function(t,e=0){const n=Object(a.a)(t,"x","unstack","string_or_numeric");d.assert(e>=-n.shape.length&&e<n.shape.length,()=>`Axis = ${e} is not in [-${n.shape.length}, ${n.shape.length})`);const r={value:n},i={axis:e};return o.a.runKernel(s._106,r,i)}});
  4212. /**
  4213. * @license
  4214. * Copyright 2018 Google LLC. All Rights Reserved.
  4215. * Licensed under the Apache License, Version 2.0 (the "License");
  4216. * you may not use this file except in compliance with the License.
  4217. * You may obtain a copy of the License at
  4218. *
  4219. * http://www.apache.org/licenses/LICENSE-2.0
  4220. *
  4221. * Unless required by applicable law or agreed to in writing, software
  4222. * distributed under the License is distributed on an "AS IS" BASIS,
  4223. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4224. * See the License for the specific language governing permissions and
  4225. * limitations under the License.
  4226. * =============================================================================
  4227. */function Hn(t,e=!0,n,r){return o.a.makeVariable(t,e,n,r)}var Wn=n("cTqU");
  4228. /**
  4229. * @license
  4230. * Copyright 2020 Google LLC. All Rights Reserved.
  4231. * Licensed under the Apache License, Version 2.0 (the "License");
  4232. * you may not use this file except in compliance with the License.
  4233. * You may obtain a copy of the License at
  4234. *
  4235. * http://www.apache.org/licenses/LICENSE-2.0
  4236. *
  4237. * Unless required by applicable law or agreed to in writing, software
  4238. * distributed under the License is distributed on an "AS IS" BASIS,
  4239. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4240. * See the License for the specific language governing permissions and
  4241. * limitations under the License.
  4242. * =============================================================================
  4243. */const Gn=async function(t){const e=Object(a.a)(t,"condition","whereAsync","bool"),n=await e.data(),r=Object(Wn.a)(e.shape,n);return t!==e&&e.dispose(),r};
  4244. /**
  4245. * @license
  4246. * Copyright 2018 Google LLC. All Rights Reserved.
  4247. * Licensed under the Apache License, Version 2.0 (the "License");
  4248. * you may not use this file except in compliance with the License.
  4249. * You may obtain a copy of the License at
  4250. *
  4251. * http://www.apache.org/licenses/LICENSE-2.0
  4252. *
  4253. * Unless required by applicable law or agreed to in writing, software
  4254. * distributed under the License is distributed on an "AS IS" BASIS,
  4255. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4256. * See the License for the specific language governing permissions and
  4257. * limitations under the License.
  4258. * =============================================================================
  4259. */const zn=async function(t,e,n){const r=Object(a.a)(t,"tensor","boolMask"),i=Object(a.a)(e,"mask","boolMask","bool"),o=null==n?0:n,s=i.rank,l=r.shape;d.assert(s>0,()=>"mask cannot be scalar"),d.assertShapesMatch(l.slice(o,o+s),i.shape,"mask's shape must match the first K dimensions of tensor's shape,");let u=1;for(let t=o;t<o+s;t++)u*=l[t];const c=l.slice(0,o).concat([u],l.slice(o+s)),h=Object(S.a)(r,c),p=Object(S.a)(i,[-1]),f=await Gn(p),g=Cn(f,[1]),m=Nt(h,g,o);return t!==r&&r.dispose(),e!==i&&i.dispose(),g.dispose(),h.dispose(),p.dispose(),f.dispose(),m};var Xn=n("gkZw");
  4260. /**
  4261. * @license
  4262. * Copyright 2018 Google LLC. All Rights Reserved.
  4263. * Licensed under the Apache License, Version 2.0 (the "License");
  4264. * you may not use this file except in compliance with the License.
  4265. * You may obtain a copy of the License at
  4266. *
  4267. * http://www.apache.org/licenses/LICENSE-2.0
  4268. *
  4269. * Unless required by applicable law or agreed to in writing, software
  4270. * distributed under the License is distributed on an "AS IS" BASIS,
  4271. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4272. * See the License for the specific language governing permissions and
  4273. * limitations under the License.
  4274. * =============================================================================
  4275. */const Kn=Object(l.a)({norm_:function(t,e="euclidean",n=null,r=!1){const o=function t(e,n,r=null){if(0===e.rank)return Object(i.a)(e);if(1!==e.rank&&null===r)return t(Object(S.a)(e,[-1]),n,r);if(1===e.rank||"number"==typeof r||Array.isArray(r)&&1===r.length){if(1===n)return Object(Zt.a)(Object(i.a)(e),r);if(n===1/0)return qt(Object(i.a)(e),r);if(n===-1/0)return me(Object(i.a)(e),r);if("euclidean"===n||2===n)return Object(En.a)(Object(Zt.a)(Object(Le.a)(Object(i.a)(e),Object(sn.a)(2,"int32")),r));throw new Error(`Error in norm: invalid ord value: ${n}`)}if(Array.isArray(r)&&2===r.length){if(1===n)return qt(Object(Zt.a)(Object(i.a)(e),r[0]),r[1]-1);if(n===1/0)return qt(Object(Zt.a)(Object(i.a)(e),r[1]),r[0]);if(n===-1/0)return me(Object(Zt.a)(Object(i.a)(e),r[1]),r[0]);if("fro"===n||"euclidean"===n)return Object(En.a)(Object(Zt.a)(Object(ye.a)(e),r));throw new Error(`Error in norm: invalid ord value: ${n}`)}throw new Error(`Error in norm: invalid axis: ${r}`)}(t=Object(a.a)(t,"x","norm"),e,n);let s=o.shape;if(r){const e=Object(d.parseAxisParam)(n,t.shape);s=te.e(o.shape,e)}return Object(S.a)(o,s)}});
  4276. /**
  4277. * @license
  4278. * Copyright 2018 Google LLC. All Rights Reserved.
  4279. * Licensed under the Apache License, Version 2.0 (the "License");
  4280. * you may not use this file except in compliance with the License.
  4281. * You may obtain a copy of the License at
  4282. *
  4283. * http://www.apache.org/licenses/LICENSE-2.0
  4284. *
  4285. * Unless required by applicable law or agreed to in writing, software
  4286. * distributed under the License is distributed on an "AS IS" BASIS,
  4287. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4288. * See the License for the specific language governing permissions and
  4289. * limitations under the License.
  4290. * =============================================================================
  4291. */const Yn=Object(l.a)({movingAverage_:function(t,e,n,r,i=!0){const o=Object(a.a)(t,"v","movingAverage"),s=Object(a.a)(e,"x","movingAverage"),l=Object(a.a)(n,"decay","movingAverage");Object(T.a)(o,s),d.assert(d.arraysEqual(o.shape,s.shape),()=>"Shape mismatch in v and x");const u=Object(sn.a)(1),c=Object(Jt.a)(u,l);let p=Object(N.a)(Object(Jt.a)(s,o),c);if(i){d.assert(null!=r,()=>"When using zeroDebias: true, step is required.");const t=Object(a.a)(r,"step","movingAverage");p=Object(ft.a)(p,Object(Jt.a)(u,Object(Le.a)(l,t)))}return Object(h.a)(o,p)}});var qn=n("G6fb");
  4292. /**
  4293. * @license
  4294. * Copyright 2018 Google LLC. All Rights Reserved.
  4295. * Licensed under the Apache License, Version 2.0 (the "License");
  4296. * you may not use this file except in compliance with the License.
  4297. * You may obtain a copy of the License at
  4298. *
  4299. * http://www.apache.org/licenses/LICENSE-2.0
  4300. *
  4301. * Unless required by applicable law or agreed to in writing, software
  4302. * distributed under the License is distributed on an "AS IS" BASIS,
  4303. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4304. * See the License for the specific language governing permissions and
  4305. * limitations under the License.
  4306. * =============================================================================
  4307. */const Jn=Object(l.a)({scatterND_:function(t,e,n){const r=Object(a.a)(t,"indices","scatterND","int32"),i=Object(a.a)(e,"updates","scatterND");qn.b(i,r,n);const l={indices:r,updates:i},u={shape:n};return o.a.runKernel(s._72,l,u)}});const Zn=Object(l.a)({sparseToDense_:
  4308. /**
  4309. * @license
  4310. * Copyright 2018 Google LLC. All Rights Reserved.
  4311. * Licensed under the Apache License, Version 2.0 (the "License");
  4312. * you may not use this file except in compliance with the License.
  4313. * You may obtain a copy of the License at
  4314. *
  4315. * http://www.apache.org/licenses/LICENSE-2.0
  4316. *
  4317. * Unless required by applicable law or agreed to in writing, software
  4318. * distributed under the License is distributed on an "AS IS" BASIS,
  4319. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4320. * See the License for the specific language governing permissions and
  4321. * limitations under the License.
  4322. * =============================================================================
  4323. */
  4324. function(t,e,n,r=0){const i=Object(a.a)(t,"sparseIndices","sparseToDense","int32"),l=Object(a.a)(e,"sparseValues","sparseToDense"),u=Object(a.a)(r,"defaultValue","sparseToDense",l.dtype);!function(t,e,n,r){if("int32"!==t.dtype)throw new Error("tf.sparseToDense() expects the indices to be int32 type,"+` but the dtype was ${t.dtype}.`);if(t.rank>2)throw new Error("sparseIndices should be a scalar, vector, or matrix,"+` but got shape ${t.shape}.`);const i=t.rank>0?t.shape[0]:1,o=t.rank>1?t.shape[1]:1;if(n.length!==o)throw new Error("outputShape has incorrect number of elements:,"+` ${n.length}, should be: ${o}.`);const s=e.size;if(0!==e.rank&&(1!==e.rank||s!==i))throw new Error("sparseValues has incorrect shape "+`${e.shape}, should be [] or [${i}]`);if(e.dtype!==r.dtype)throw new Error("sparseValues.dtype must match defaultValues.dtype")}(i,l,n,u);const c={sparseIndices:i,sparseValues:l,defaultValue:u},h={outputShape:n};return o.a.runKernel(s._87,c,h)}});
  4325. /**
  4326. * @license
  4327. * Copyright 2018 Google LLC. All Rights Reserved.
  4328. * Licensed under the Apache License, Version 2.0 (the "License");
  4329. * you may not use this file except in compliance with the License.
  4330. * You may obtain a copy of the License at
  4331. *
  4332. * http://www.apache.org/licenses/LICENSE-2.0
  4333. *
  4334. * Unless required by applicable law or agreed to in writing, software
  4335. * distributed under the License is distributed on an "AS IS" BASIS,
  4336. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4337. * See the License for the specific language governing permissions and
  4338. * limitations under the License.
  4339. * =============================================================================
  4340. */const Qn=Object(l.a)({gatherND_:function(t,e){const n=Object(a.a)(e,"indices","gatherND","int32"),r={params:Object(a.a)(t,"x","gatherND","string_or_numeric"),indices:n};return o.a.runKernel(s._10,r)}});
  4341. /**
  4342. * @license
  4343. * Copyright 2019 Google LLC. All Rights Reserved.
  4344. * Licensed under the Apache License, Version 2.0 (the "License");
  4345. * you may not use this file except in compliance with the License.
  4346. * You may obtain a copy of the License at
  4347. *
  4348. * http://www.apache.org/licenses/LICENSE-2.0
  4349. *
  4350. * Unless required by applicable law or agreed to in writing, software
  4351. * distributed under the License is distributed on an "AS IS" BASIS,
  4352. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4353. * See the License for the specific language governing permissions and
  4354. * limitations under the License.
  4355. * =============================================================================
  4356. */const tr=Object(l.a)({dropout_:
  4357. /**
  4358. * @license
  4359. * Copyright 2018 Google LLC. All Rights Reserved.
  4360. * Licensed under the Apache License, Version 2.0 (the "License");
  4361. * you may not use this file except in compliance with the License.
  4362. * You may obtain a copy of the License at
  4363. *
  4364. * http://www.apache.org/licenses/LICENSE-2.0
  4365. *
  4366. * Unless required by applicable law or agreed to in writing, software
  4367. * distributed under the License is distributed on an "AS IS" BASIS,
  4368. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4369. * See the License for the specific language governing permissions and
  4370. * limitations under the License.
  4371. * =============================================================================
  4372. */
  4373. function(t,e,n,r){const i=Object(a.a)(t,"x","dropout");if(d.assert("float32"===i.dtype,()=>"x has to be a floating point tensor since it's going to be "+`scaled, but got a ${i.dtype} tensor instead.`),d.assert(e>=0&&e<1,()=>`rate must be a float in the range [0, 1), but got ${e}.`),0===e)return t instanceof pe.a?i.clone():i;const o=function(t,e){if(null==e)return t.shape.slice();if(d.arraysEqual(t.shape,e))return e;if(t.shape.length===e.length){const n=[];for(let r=0;r<t.shape.length;r++)null==e[r]&&null!=t.shape[r]?n.push(t.shape[r]):n.push(e[r]);return n}return e}(i,n),s=1-e,l=Object(ft.a)(Rt(Object(h.a)(ze(o,0,1,"float32",r),s)),s);return Object(N.a)(i,l)}});
  4374. /**
  4375. * @license
  4376. * Copyright 2019 Google LLC. All Rights Reserved.
  4377. * Licensed under the Apache License, Version 2.0 (the "License");
  4378. * you may not use this file except in compliance with the License.
  4379. * You may obtain a copy of the License at
  4380. *
  4381. * http://www.apache.org/licenses/LICENSE-2.0
  4382. *
  4383. * Unless required by applicable law or agreed to in writing, software
  4384. * distributed under the License is distributed on an "AS IS" BASIS,
  4385. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4386. * See the License for the specific language governing permissions and
  4387. * limitations under the License.
  4388. * =============================================================================
  4389. */function er(t){return Math.floor(Math.pow(2,Math.ceil(Math.log(t)/Math.log(2))))}function nr(t,e,n){const r=1-t%2,i=new Float32Array(t);for(let o=0;o<t;++o){const s=2*Math.PI*o/(t+r-1);i[o]=e-n*Math.cos(s)}return Nn(i,"float32")}
  4390. /**
  4391. * @license
  4392. * Copyright 2019 Google LLC. All Rights Reserved.
  4393. * Licensed under the Apache License, Version 2.0 (the "License");
  4394. * you may not use this file except in compliance with the License.
  4395. * You may obtain a copy of the License at
  4396. *
  4397. * http://www.apache.org/licenses/LICENSE-2.0
  4398. *
  4399. * Unless required by applicable law or agreed to in writing, software
  4400. * distributed under the License is distributed on an "AS IS" BASIS,
  4401. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4402. * See the License for the specific language governing permissions and
  4403. * limitations under the License.
  4404. * =============================================================================
  4405. */const rr=async function(t,e,n=1){const r=Object(a.a)(t,"predictions","inTopK"),i=Object(a.a)(e,"targets","inTopK");Object(d.assert)(r.rank>1,()=>"inTopK() expects the predictions to be of rank 2 or higher, "+`but got ${r.rank}`),Object(d.assert)(r.rank-1===i.rank,()=>"predictions rank should be 1 larger than targets rank, but got predictions rank "+`${r.rank} and targets rank ${i.rank}`),Object(d.assertShapesMatch)(r.shape.slice(0,r.shape.length-1),i.shape,"predictions's shape should be align with the targets' shape, except the last dimension.");const o=r.shape[r.shape.length-1];Object(d.assert)(n>0&&n<=o,()=>"'k' passed to inTopK() must be > 0 && <= the predictions last "+`dimension (${o}), but got ${n}`);const s=await r.data(),l=await i.data(),[u,c]=[s.length/o,o],h=Object(d.getTypedArrayFromDType)("bool",u);for(let t=0;t<u;t++){const e=t*c,r=s.subarray(e,e+c),i=[];for(let t=0;t<r.length;t++)i.push({value:r[t],index:t});i.sort((t,e)=>e.value-t.value),h[t]=0;for(let e=0;e<n;e++)if(i[e].index===l[t]){h[t]=1;break}}return t!==r&&r.dispose(),e!==i&&i.dispose(),Object(Rn.a)(h,i.shape,"bool")};
  4406. /**
  4407. * @license
  4408. * Copyright 2020 Google LLC. All Rights Reserved.
  4409. * Licensed under the Apache License, Version 2.0 (the "License");
  4410. * you may not use this file except in compliance with the License.
  4411. * You may obtain a copy of the License at
  4412. *
  4413. * http://www.apache.org/licenses/LICENSE-2.0
  4414. *
  4415. * Unless required by applicable law or agreed to in writing, software
  4416. * distributed under the License is distributed on an "AS IS" BASIS,
  4417. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4418. * See the License for the specific language governing permissions and
  4419. * limitations under the License.
  4420. * =============================================================================
  4421. */const ir=Object(l.a)({conv2DBackpropFilter_:function(t,e,n,r,i,a="NHWC",l){let u=t;3===t.rank&&(u=Object(S.a)(t,[1,t.shape[0],t.shape[1],t.shape[2]]));let c=e;3===c.rank&&(c=Object(S.a)(e,[1,e.shape[0],e.shape[1],e.shape[2]])),d.assert(4===u.rank,()=>"Error in conv2dDerFilter: input must be rank 4, but got shape "+`${u.shape}.`),d.assert(4===c.rank,()=>"Error in conv2dDerFilter: dy must be rank 4, but got shape "+`${c.shape}.`),d.assert(4===n.length,()=>"Error in conv2dDerFilter: filterShape must be length 4, but got "+`${n}.`);const h="NHWC"===a?u.shape[3]:u.shape[1],p="NHWC"===a?c.shape[3]:c.shape[1];d.assert(h===n[2],()=>`Error in conv2dDerFilter: depth of input ${h}) must `+`match input depth in filter (${n[2]}.`),d.assert(p===n[3],()=>`Error in conv2dDerFilter: depth of dy (${p}) must `+`match output depth for filter (${n[3]}).`),C.a("conv2dDerFilter",i,l);const f={x:u,dy:c},g={strides:r,pad:i,dataFormat:a,dimRoundingMode:l,filterShape:n};return o.a.runKernel(s.D,f,g)}});var or=n("egTW");
  4422. /**
  4423. * @license
  4424. * Copyright 2019 Google LLC. All Rights Reserved.
  4425. * Licensed under the Apache License, Version 2.0 (the "License");
  4426. * you may not use this file except in compliance with the License.
  4427. * You may obtain a copy of the License at
  4428. *
  4429. * http://www.apache.org/licenses/LICENSE-2.0
  4430. *
  4431. * Unless required by applicable law or agreed to in writing, software
  4432. * distributed under the License is distributed on an "AS IS" BASIS,
  4433. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4434. * See the License for the specific language governing permissions and
  4435. * limitations under the License.
  4436. * =============================================================================
  4437. */const sr=Object(l.a)({fusedConv2d_:function({x:t,filter:e,strides:n,pad:r,dataFormat:i="NHWC",dilations:l=[1,1],dimRoundingMode:u,bias:c,activation:p="linear",preluActivationWeights:f,leakyreluAlpha:g}){if(p=p||"linear",!1===Object(or.d)(o.a.state.gradientDepth,p)){let o=Q(t,e,n,r,i,l,u);return null!=c&&(o=Object(h.a)(o,c)),Object(or.a)(o,p,f,g)}const m=Object(a.a)(t,"x","conv2d","float32"),v=Object(a.a)(e,"filter","conv2d","float32");let b=m,_=!1;3===m.rank&&(_=!0,b=Object(S.a)(m,[1,m.shape[0],m.shape[1],m.shape[2]])),d.assert(4===b.rank,()=>"Error in fused conv2d: input must be rank 4, but got rank "+`${b.rank}.`),d.assert(4===v.rank,()=>"Error in fused conv2d: filter must be rank 4, but got rank "+`${v.rank}.`),C.a("fused conv2d",r,u),d.assert(b.shape[3]===v.shape[2],()=>`Error in conv2d: depth of input (${b.shape[3]}) must match `+`input depth for filter ${v.shape[2]}.`),d.assert(C.i(n,l),()=>"Error in conv2D: Either strides or dilations must be 1. "+`Got strides ${n} and dilations '${l}'`),d.assert("NHWC"===i,()=>`Error in conv2d: got dataFormat of ${i} but only NHWC is currently supported.`);const y=C.b(b.shape,v.shape,n,l,r,u);let x,E;null!=c&&(x=Object(a.a)(c,"bias","fused conv2d"),[x]=Object(T.c)(x,m),gt.assertAndGetBroadcastShape(y.outShape,x.shape)),null!=f&&(E=Object(a.a)(f,"prelu weights","fused conv2d"));const w=(t,e)=>{const[i,o,s,a]=e,u=Object(or.c)(t,s,p);d.assert(C.j(l),()=>"Error in gradient of fused conv2D: dilation rates greater than 1 "+`are not yet supported in gradients. Got dilations '${l}'`);const c=[et(o.shape,u,i,n,r),ir(o,u,i.shape,n,r)];if(null!=a){const t=Object(or.b)(a,u);c.push(t)}return c},k={x:b,filter:v,bias:x,preluActivationWeights:E},O={strides:n,pad:r,dataFormat:i,dilations:l,dimRoundingMode:u,activation:p,leakyreluAlpha:g};if(null==c)return Object(zt.a)((t,e,n)=>{let r=o.a.runKernel(s._8,k,O);return n([e,t,r]),_&&(r=Object(S.a)(r,[r.shape[1],r.shape[2],r.shape[3]])),{value:r,gradFunc:w}})(b,v);return Object(zt.a)((t,e,n,r)=>{let i=o.a.runKernel(s._8,k,O);return r([e,t,i,n]),_&&(i=Object(S.a)(i,[i.shape[1],i.shape[2],i.shape[3]])),{value:i,gradFunc:w}})(b,v,x)}});
  4438. /**
  4439. * @license
  4440. * Copyright 2020 Google LLC. All Rights Reserved.
  4441. * Licensed under the Apache License, Version 2.0 (the "License");
  4442. * you may not use this file except in compliance with the License.
  4443. * You may obtain a copy of the License at
  4444. *
  4445. * http://www.apache.org/licenses/LICENSE-2.0
  4446. *
  4447. * Unless required by applicable law or agreed to in writing, software
  4448. * distributed under the License is distributed on an "AS IS" BASIS,
  4449. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4450. * See the License for the specific language governing permissions and
  4451. * limitations under the License.
  4452. * =============================================================================
  4453. */const ar=Object(l.a)({depthwiseConv2dNativeBackpropFilter_:function(t,e,n,r,i,a=[1,1],l){let u=t;3===t.rank&&(u=Object(S.a)(t,[1,t.shape[0],t.shape[1],t.shape[2]]));let c=e;3===c.rank&&(c=Object(S.a)(e,[1,e.shape[0],e.shape[1],e.shape[2]]));const h={x:u,dy:c},d={strides:r,pad:i,dimRoundingMode:l,dilations:a,filterShape:n};return o.a.runKernel(s.P,h,d)}});
  4454. /**
  4455. * @license
  4456. * Copyright 2020 Google LLC. All Rights Reserved.
  4457. * Licensed under the Apache License, Version 2.0 (the "License");
  4458. * you may not use this file except in compliance with the License.
  4459. * You may obtain a copy of the License at
  4460. *
  4461. * http://www.apache.org/licenses/LICENSE-2.0
  4462. *
  4463. * Unless required by applicable law or agreed to in writing, software
  4464. * distributed under the License is distributed on an "AS IS" BASIS,
  4465. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4466. * See the License for the specific language governing permissions and
  4467. * limitations under the License.
  4468. * =============================================================================
  4469. */const lr=Object(l.a)({depthwiseConv2dNativeBackpropInput_:function(t,e,n,r,i,a=[1,1],l){let u=e,c=!1;3===e.rank&&(c=!0,u=Object(S.a)(e,[1,e.shape[0],e.shape[1],e.shape[2]]));const h={dy:u,filter:n},d={strides:r,pad:i,dimRoundingMode:l,dilations:a,inputShape:t},p=o.a.runKernel(s.Q,h,d);return c?Object(S.a)(p,[p.shape[1],p.shape[2],p.shape[3]]):p}});
  4470. /**
  4471. * @license
  4472. * Copyright 2019 Google LLC. All Rights Reserved.
  4473. * Licensed under the Apache License, Version 2.0 (the "License");
  4474. * you may not use this file except in compliance with the License.
  4475. * You may obtain a copy of the License at
  4476. *
  4477. * http://www.apache.org/licenses/LICENSE-2.0
  4478. *
  4479. * Unless required by applicable law or agreed to in writing, software
  4480. * distributed under the License is distributed on an "AS IS" BASIS,
  4481. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4482. * See the License for the specific language governing permissions and
  4483. * limitations under the License.
  4484. * =============================================================================
  4485. */const ur=Object(l.a)({fusedDepthwiseConv2d_:function({x:t,filter:e,strides:n,pad:r,dataFormat:i="NHWC",dilations:l=[1,1],dimRoundingMode:u,bias:c,activation:p="linear",preluActivationWeights:f,leakyreluAlpha:g}){if(!1===Object(or.d)(o.a.state.gradientDepth,p)){let o=ht(t,e,n,r,i,l,u);return null!=c&&(o=Object(h.a)(o,c)),Object(or.a)(o,p,f,g)}const m=Object(a.a)(t,"x","depthwiseConv2d","float32"),v=Object(a.a)(e,"filter","depthwiseConv2d","float32");let b=m,_=!1;3===m.rank&&(_=!0,b=Object(S.a)(m,[1,m.shape[0],m.shape[1],m.shape[2]])),d.assert(4===b.rank,()=>"Error in fused depthwiseConv2d: input must be rank 4, but got "+`rank ${b.rank}.`),d.assert(4===v.rank,()=>"Error in fused depthwiseConv2d: filter must be rank 4, "+`but got rank ${v.rank}.`),d.assert(b.shape[3]===v.shape[2],()=>"Error in fused depthwiseConv2d: number of input channels "+`(${b.shape[3]}) must match the inChannels dimension in `+`filter ${v.shape[2]}.`),null==l&&(l=[1,1]),d.assert(C.i(n,l),()=>"Error in fused depthwiseConv2d: Either strides or dilations must "+`be 1. Got strides ${n} and dilations '${l}'`),C.a("fused depthwiseConv2d",r,u);const y=C.b(b.shape,v.shape,n,l,r,u,!0);let x,E;null!=c&&(x=Object(a.a)(c,"bias","fused conv2d"),[x]=Object(T.c)(x,m),gt.assertAndGetBroadcastShape(y.outShape,x.shape)),null!=f&&(E=Object(a.a)(f,"prelu weights","fused depthwiseConv2d"));const w=(t,e)=>{d.assert(C.j(l),()=>"Error in gradient of fused depthwiseConv2d: dilation rates greater than 1 are not yet supported. Got dilations "+`'${l}'`);const[i,o,s,a]=e,c=Object(or.c)(t,s,p),h=lr(o.shape,c,i,n,r,l,u),f=ar(o,c,i.shape,n,r,l,u);return null!=a?[h,f,Object(or.b)(x,c)]:[h,f]},k={x:b,filter:v,bias:x,preluActivationWeights:E},O={strides:n,pad:r,dataFormat:i,dilations:l,dimRoundingMode:u,activation:p,leakyreluAlpha:g};if(null==c)return Object(zt.a)((t,e,n)=>{let r=o.a.runKernel(s._9,k,O);return n([e,t,r]),_&&(r=Object(S.a)(r,[r.shape[1],r.shape[2],r.shape[3]])),{value:r,gradFunc:w}})(b,v);return Object(zt.a)((t,e,n,r)=>{let i=o.a.runKernel(s._9,k,O);return r([e,t,i,n]),_&&(i=Object(S.a)(i,[i.shape[1],i.shape[2],i.shape[3]])),{value:i,gradFunc:w}})(b,v,x)}});
  4486. /**
  4487. * @license
  4488. * Copyright 2019 Google LLC. All Rights Reserved.
  4489. * Licensed under the Apache License, Version 2.0 (the "License");
  4490. * you may not use this file except in compliance with the License.
  4491. * You may obtain a copy of the License at
  4492. *
  4493. * http://www.apache.org/licenses/LICENSE-2.0
  4494. *
  4495. * Unless required by applicable law or agreed to in writing, software
  4496. * distributed under the License is distributed on an "AS IS" BASIS,
  4497. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4498. * See the License for the specific language governing permissions and
  4499. * limitations under the License.
  4500. * =============================================================================
  4501. */const cr=Object(l.a)({fusedMatMul_:function({a:t,b:e,transposeA:n=!1,transposeB:r=!1,bias:i,activation:l="linear",preluActivationWeights:u,leakyreluAlpha:c}){if(!1===Object(or.d)(o.a.state.gradientDepth,l)){let o=Object(A.a)(t,e,n,r);return null!=i&&(o=Object(h.a)(o,i)),Object(or.a)(o,l,u,c)}let p=Object(a.a)(t,"a","fused matMul"),f=Object(a.a)(e,"b","fused matMul");[p,f]=Object(T.c)(p,f);const g=n?p.shape[p.rank-2]:p.shape[p.rank-1],m=r?f.shape[f.rank-1]:f.shape[f.rank-2],v=n?p.shape[p.rank-1]:p.shape[p.rank-2],b=r?f.shape[f.rank-2]:f.shape[f.rank-1],_=p.shape.slice(0,-2),y=f.shape.slice(0,-2),x=d.sizeFromShape(_),E=d.sizeFromShape(y);d.assert(g===m,()=>`Error in fused matMul: inner shapes (${g}) and (`+`${m}) of Tensors with shapes ${p.shape} and `+`${f.shape} and transposeA=${n}`+` and transposeB=${r} must match.`);const w=gt.assertAndGetBroadcastShape(p.shape.slice(0,-2),f.shape.slice(0,-2)).concat([v,b]),C=n?Object(S.a)(p,[x,g,v]):Object(S.a)(p,[x,v,g]),k=r?Object(S.a)(f,[E,b,m]):Object(S.a)(f,[E,m,b]);let O,I;null!=i&&(O=Object(a.a)(i,"bias","fused matMul"),[O]=Object(T.c)(O,p),gt.assertAndGetBroadcastShape(w,O.shape)),null!=u&&(I=Object(a.a)(u,"prelu weights","fused matMul"));const R=(t,e)=>{const[o,s,a,u]=e,c=Object(or.c)(Object(S.a)(t,a.shape),a,l);let h,d;return n||r?!n&&r?(h=Object(A.a)(c,s,!1,!1),d=Object(A.a)(c,o,!0,!1)):n&&!r?(h=Object(A.a)(s,c,!1,!0),d=Object(A.a)(o,c,!1,!1)):(h=Object(A.a)(s,c,!0,!0),d=Object(A.a)(c,o,!0,!0)):(h=Object(A.a)(c,s,!1,!0),d=Object(A.a)(o,c,!0,!1)),null!=i?[h,d,Object(or.b)(u,c)]:[h,d]},N={a:C,b:k,bias:O,preluActivationWeights:I},D={transposeA:n,transposeB:r,activation:l,leakyreluAlpha:c};if(null==i)return Object(zt.a)((t,e,n)=>{const r=o.a.runKernel(s._109,N,D);return n([t,e,r]),{value:Object(S.a)(r,w),gradFunc:R}})(C,k);return Object(zt.a)((t,e,n,r)=>{const i=o.a.runKernel(s._109,N,D);return r([t,e,i,n]),{value:Object(S.a)(i,w),gradFunc:R}})(C,k,O)}});
  4502. /**
  4503. * @license
  4504. * Copyright 2019 Google LLC. All Rights Reserved.
  4505. * Licensed under the Apache License, Version 2.0 (the "License");
  4506. * you may not use this file except in compliance with the License.
  4507. * You may obtain a copy of the License at
  4508. *
  4509. * http://www.apache.org/licenses/LICENSE-2.0
  4510. *
  4511. * Unless required by applicable law or agreed to in writing, software
  4512. * distributed under the License is distributed on an "AS IS" BASIS,
  4513. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4514. * See the License for the specific language governing permissions and
  4515. * limitations under the License.
  4516. * =============================================================================
  4517. */
  4518. /**
  4519. * @license
  4520. * Copyright 2019 Google LLC. All Rights Reserved.
  4521. * Licensed under the Apache License, Version 2.0 (the "License");
  4522. * you may not use this file except in compliance with the License.
  4523. * You may obtain a copy of the License at
  4524. *
  4525. * http://www.apache.org/licenses/LICENSE-2.0
  4526. *
  4527. * Unless required by applicable law or agreed to in writing, software
  4528. * distributed under the License is distributed on an "AS IS" BASIS,
  4529. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4530. * See the License for the specific language governing permissions and
  4531. * limitations under the License.
  4532. * =============================================================================
  4533. */Object(l.a)({hammingWindow_:function(t){return nr(t,.54,.46)}});
  4534. /**
  4535. * @license
  4536. * Copyright 2019 Google LLC. All Rights Reserved.
  4537. * Licensed under the Apache License, Version 2.0 (the "License");
  4538. * you may not use this file except in compliance with the License.
  4539. * You may obtain a copy of the License at
  4540. *
  4541. * http://www.apache.org/licenses/LICENSE-2.0
  4542. *
  4543. * Unless required by applicable law or agreed to in writing, software
  4544. * distributed under the License is distributed on an "AS IS" BASIS,
  4545. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4546. * See the License for the specific language governing permissions and
  4547. * limitations under the License.
  4548. * =============================================================================
  4549. */const hr=Object(l.a)({hannWindow_:function(t){return nr(t,.5,.5)}});
  4550. /**
  4551. * @license
  4552. * Copyright 2019 Google LLC. All Rights Reserved.
  4553. * Licensed under the Apache License, Version 2.0 (the "License");
  4554. * you may not use this file except in compliance with the License.
  4555. * You may obtain a copy of the License at
  4556. *
  4557. * http://www.apache.org/licenses/LICENSE-2.0
  4558. *
  4559. * Unless required by applicable law or agreed to in writing, software
  4560. * distributed under the License is distributed on an "AS IS" BASIS,
  4561. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4562. * See the License for the specific language governing permissions and
  4563. * limitations under the License.
  4564. * =============================================================================
  4565. */const dr=Object(l.a)({frame_:function(t,e,n,r=!1,i=0){let o=0;const s=[];for(;o+e<=t.size;)s.push(M(t,o,e)),o+=n;if(r)for(;o<t.size;){const r=o+e-t.size,a=R([M(t,o,e-r),Object(It.a)([r],i)]);s.push(a),o+=n}return 0===s.length?Dn([],[0,e]):Object(S.a)(R(s),[s.length,e])}});
  4566. /**
  4567. * @license
  4568. * Copyright 2019 Google LLC. All Rights Reserved.
  4569. * Licensed under the Apache License, Version 2.0 (the "License");
  4570. * you may not use this file except in compliance with the License.
  4571. * You may obtain a copy of the License at
  4572. *
  4573. * http://www.apache.org/licenses/LICENSE-2.0
  4574. *
  4575. * Unless required by applicable law or agreed to in writing, software
  4576. * distributed under the License is distributed on an "AS IS" BASIS,
  4577. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4578. * See the License for the specific language governing permissions and
  4579. * limitations under the License.
  4580. * =============================================================================
  4581. */Object(l.a)({stft_:function(t,e,n,r,i=hr){null==r&&(r=er(e));const o=dr(t,e,n),s=Object(N.a)(o,i(e));return xn(s,r)}});
  4582. /**
  4583. * @license
  4584. * Copyright 2020 Google LLC. All Rights Reserved.
  4585. * Licensed under the Apache License, Version 2.0 (the "License");
  4586. * you may not use this file except in compliance with the License.
  4587. * You may obtain a copy of the License at
  4588. *
  4589. * http://www.apache.org/licenses/LICENSE-2.0
  4590. *
  4591. * Unless required by applicable law or agreed to in writing, software
  4592. * distributed under the License is distributed on an "AS IS" BASIS,
  4593. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4594. * See the License for the specific language governing permissions and
  4595. * limitations under the License.
  4596. * =============================================================================
  4597. */const pr=Object(l.a)({cropAndResize_:function(t,e,n,r,i="bilinear",l=0){const u=Object(a.a)(t,"image","cropAndResize"),c=Object(a.a)(e,"boxes","cropAndResize","float32"),h=Object(a.a)(n,"boxInd","cropAndResize","int32"),p=c.shape[0];d.assert(4===u.rank,()=>"Error in cropAndResize: image must be rank 4,"+`but got rank ${u.rank}.`),d.assert(2===c.rank&&4===c.shape[1],()=>`Error in cropAndResize: boxes must be have size [${p},4] `+`but had shape ${c.shape}.`),d.assert(1===h.rank&&h.shape[0]===p,()=>`Error in cropAndResize: boxInd must be have size [${p}] `+`but had shape ${c.shape}.`),d.assert(2===r.length,()=>"Error in cropAndResize: cropSize must be of length 2, but got "+`length ${r.length}.`),d.assert(r[0]>=1&&r[1]>=1,()=>`cropSize must be atleast [1,1], but was ${r}`),d.assert("bilinear"===i||"nearest"===i,()=>`method must be bilinear or nearest, but was ${i}`);const f={image:u,boxes:c,boxInd:h},g={method:i,extrapolationValue:l,cropSize:r};return o.a.runKernel(s.K,f,g)}});
  4598. /**
  4599. * @license
  4600. * Copyright 2020 Google LLC. All Rights Reserved.
  4601. * Licensed under the Apache License, Version 2.0 (the "License");
  4602. * you may not use this file except in compliance with the License.
  4603. * You may obtain a copy of the License at
  4604. *
  4605. * http://www.apache.org/licenses/LICENSE-2.0
  4606. *
  4607. * Unless required by applicable law or agreed to in writing, software
  4608. * distributed under the License is distributed on an "AS IS" BASIS,
  4609. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4610. * See the License for the specific language governing permissions and
  4611. * limitations under the License.
  4612. * =============================================================================
  4613. */const fr=Object(l.a)({flipLeftRight_:function(t){const e=Object(a.a)(t,"image","flipLeftRight","float32");d.assert(4===e.rank,()=>"Error in flipLeftRight: image must be rank 4,"+`but got rank ${e.rank}.`);const n={image:e};return o.a.runKernel(s._3,n,{})}});
  4614. /**
  4615. * @license
  4616. * Copyright 2021 Google LLC. All Rights Reserved.
  4617. * Licensed under the Apache License, Version 2.0 (the "License");
  4618. * you may not use this file except in compliance with the License.
  4619. * You may obtain a copy of the License at
  4620. *
  4621. * http://www.apache.org/licenses/LICENSE-2.0
  4622. *
  4623. * Unless required by applicable law or agreed to in writing, software
  4624. * distributed under the License is distributed on an "AS IS" BASIS,
  4625. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4626. * See the License for the specific language governing permissions and
  4627. * limitations under the License.
  4628. * =============================================================================
  4629. */const gr=Object(l.a)({grayscaleToRGB_:function(t){const e=Object(a.a)(t,"image","grayscaleToRGB"),n=e.rank-1,r=e.shape[n];d.assert(e.rank>=2,()=>"Error in grayscaleToRGB: images must be at least rank 2, "+`but got rank ${e.rank}.`),d.assert(1===r,()=>"Error in grayscaleToRGB: last dimension of a grayscale image "+`should be size 1, but got size ${r}.`);const i=new Array(e.rank);return i.fill(1,0,n),i[n]=3,kt(e,i)}});
  4630. /**
  4631. * @license
  4632. * Copyright 2020 Google LLC. All Rights Reserved.
  4633. * Licensed under the Apache License, Version 2.0 (the "License");
  4634. * you may not use this file except in compliance with the License.
  4635. * You may obtain a copy of the License at
  4636. *
  4637. * http://www.apache.org/licenses/LICENSE-2.0
  4638. *
  4639. * Unless required by applicable law or agreed to in writing, software
  4640. * distributed under the License is distributed on an "AS IS" BASIS,
  4641. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4642. * See the License for the specific language governing permissions and
  4643. * limitations under the License.
  4644. * =============================================================================
  4645. */const mr=Object(l.a)({rotateWithOffset_:function(t,e,n=0,r=.5){const i=Object(a.a)(t,"image","rotateWithOffset","float32");d.assert(4===i.rank,()=>"Error in rotateWithOffset: image must be rank 4,"+`but got rank ${i.rank}.`);const l={image:i},u={radians:e,fillValue:n,center:r};return o.a.runKernel(s._69,l,u)}});
  4646. /**
  4647. * @license
  4648. * Copyright 2020 Google LLC. All Rights Reserved.
  4649. * Licensed under the Apache License, Version 2.0 (the "License");
  4650. * you may not use this file except in compliance with the License.
  4651. * You may obtain a copy of the License at
  4652. *
  4653. * http://www.apache.org/licenses/LICENSE-2.0
  4654. *
  4655. * Unless required by applicable law or agreed to in writing, software
  4656. * distributed under the License is distributed on an "AS IS" BASIS,
  4657. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4658. * See the License for the specific language governing permissions and
  4659. * limitations under the License.
  4660. * =============================================================================
  4661. */function vr(t,e,n,r,i,o){null==r&&(r=.5),null==i&&(i=Number.NEGATIVE_INFINITY),null==o&&(o=0);const s=t.shape[0];return n=Math.min(n,s),d.assert(0<=r&&r<=1,()=>`iouThreshold must be in [0, 1], but was '${r}'`),d.assert(2===t.rank,()=>`boxes must be a 2D tensor, but was of rank '${t.rank}'`),d.assert(4===t.shape[1],()=>`boxes must have 4 columns, but 2nd dimension was ${t.shape[1]}`),d.assert(1===e.rank,()=>"scores must be a 1D tensor"),d.assert(e.shape[0]===s,()=>`scores has incompatible shape with boxes. Expected ${s}, `+`but was ${e.shape[0]}`),d.assert(0<=o&&o<=1,()=>`softNmsSigma must be in [0, 1], but was '${o}'`),{maxOutputSize:n,iouThreshold:r,scoreThreshold:i,softNmsSigma:o}}
  4662. /**
  4663. * @license
  4664. * Copyright 2020 Google LLC. All Rights Reserved.
  4665. * Licensed under the Apache License, Version 2.0 (the "License");
  4666. * you may not use this file except in compliance with the License.
  4667. * You may obtain a copy of the License at
  4668. *
  4669. * http://www.apache.org/licenses/LICENSE-2.0
  4670. *
  4671. * Unless required by applicable law or agreed to in writing, software
  4672. * distributed under the License is distributed on an "AS IS" BASIS,
  4673. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4674. * See the License for the specific language governing permissions and
  4675. * limitations under the License.
  4676. * =============================================================================
  4677. */const br=Object(l.a)({nonMaxSuppression_:function(t,e,n,r=.5,i=Number.NEGATIVE_INFINITY){const l=Object(a.a)(t,"boxes","nonMaxSuppression","float32"),u=Object(a.a)(e,"scores","nonMaxSuppression","float32"),c=vr(l,u,n,r,i),h={maxOutputSize:n=c.maxOutputSize,iouThreshold:r=c.iouThreshold,scoreThreshold:i=c.scoreThreshold};return o.a.runKernel(s._46,{boxes:l,scores:u},h)}});var _r=n("7Mdl");
  4678. /**
  4679. * @license
  4680. * Copyright 2020 Google LLC. All Rights Reserved.
  4681. * Licensed under the Apache License, Version 2.0 (the "License");
  4682. * you may not use this file except in compliance with the License.
  4683. * You may obtain a copy of the License at
  4684. *
  4685. * http://www.apache.org/licenses/LICENSE-2.0
  4686. *
  4687. * Unless required by applicable law or agreed to in writing, software
  4688. * distributed under the License is distributed on an "AS IS" BASIS,
  4689. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4690. * See the License for the specific language governing permissions and
  4691. * limitations under the License.
  4692. * =============================================================================
  4693. */const yr=async function(t,e,n,r=.5,i=Number.NEGATIVE_INFINITY){const o=Object(a.a)(t,"boxes","nonMaxSuppressionAsync"),s=Object(a.a)(e,"scores","nonMaxSuppressionAsync"),l=vr(o,s,n,r,i);n=l.maxOutputSize,r=l.iouThreshold,i=l.scoreThreshold;const u=await Promise.all([o.data(),s.data()]),c=u[0],h=u[1],{selectedIndices:d}=Object(_r.a)(c,h,n,r,i);return o!==t&&o.dispose(),s!==e&&s.dispose(),Nn(d,"int32")};
  4694. /**
  4695. * @license
  4696. * Copyright 2020 Google LLC. All Rights Reserved.
  4697. * Licensed under the Apache License, Version 2.0 (the "License");
  4698. * you may not use this file except in compliance with the License.
  4699. * You may obtain a copy of the License at
  4700. *
  4701. * http://www.apache.org/licenses/LICENSE-2.0
  4702. *
  4703. * Unless required by applicable law or agreed to in writing, software
  4704. * distributed under the License is distributed on an "AS IS" BASIS,
  4705. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4706. * See the License for the specific language governing permissions and
  4707. * limitations under the License.
  4708. * =============================================================================
  4709. */const Tr=Object(l.a)({nonMaxSuppressionWithScore_:function(t,e,n,r=.5,i=Number.NEGATIVE_INFINITY,l=0){const u=Object(a.a)(t,"boxes","nonMaxSuppression"),c=Object(a.a)(e,"scores","nonMaxSuppression"),h=vr(u,c,n,r,i,l),d={boxes:u,scores:c},p={maxOutputSize:n=h.maxOutputSize,iouThreshold:r=h.iouThreshold,scoreThreshold:i=h.scoreThreshold,softNmsSigma:l=h.softNmsSigma},f=o.a.runKernel(s._48,d,p);return{selectedIndices:f[0],selectedScores:f[1]}}});
  4710. /**
  4711. * @license
  4712. * Copyright 2020 Google LLC. All Rights Reserved.
  4713. * Licensed under the Apache License, Version 2.0 (the "License");
  4714. * you may not use this file except in compliance with the License.
  4715. * You may obtain a copy of the License at
  4716. *
  4717. * http://www.apache.org/licenses/LICENSE-2.0
  4718. *
  4719. * Unless required by applicable law or agreed to in writing, software
  4720. * distributed under the License is distributed on an "AS IS" BASIS,
  4721. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4722. * See the License for the specific language governing permissions and
  4723. * limitations under the License.
  4724. * =============================================================================
  4725. */const xr=async function(t,e,n,r=.5,i=Number.NEGATIVE_INFINITY,o=0){const s=Object(a.a)(t,"boxes","nonMaxSuppressionAsync"),l=Object(a.a)(e,"scores","nonMaxSuppressionAsync"),u=vr(s,l,n,r,i,o);n=u.maxOutputSize,r=u.iouThreshold,i=u.scoreThreshold,o=u.softNmsSigma;const c=await Promise.all([s.data(),l.data()]),h=c[0],d=c[1],{selectedIndices:p,selectedScores:f}=Object(_r.c)(h,d,n,r,i,o);return s!==t&&s.dispose(),l!==e&&l.dispose(),{selectedIndices:Nn(p,"int32"),selectedScores:Nn(f)}};
  4726. /**
  4727. * @license
  4728. * Copyright 2020 Google LLC. All Rights Reserved.
  4729. * Licensed under the Apache License, Version 2.0 (the "License");
  4730. * you may not use this file except in compliance with the License.
  4731. * You may obtain a copy of the License at
  4732. *
  4733. * http://www.apache.org/licenses/LICENSE-2.0
  4734. *
  4735. * Unless required by applicable law or agreed to in writing, software
  4736. * distributed under the License is distributed on an "AS IS" BASIS,
  4737. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4738. * See the License for the specific language governing permissions and
  4739. * limitations under the License.
  4740. * =============================================================================
  4741. */const Er=Object(l.a)({nonMaxSuppressionPadded_:function(t,e,n,r=.5,i=Number.NEGATIVE_INFINITY,l=!1){const u=Object(a.a)(t,"boxes","nonMaxSuppression"),c=Object(a.a)(e,"scores","nonMaxSuppression"),h=vr(u,c,n,r,i,null),d={boxes:u,scores:c},p={maxOutputSize:h.maxOutputSize,iouThreshold:h.iouThreshold,scoreThreshold:h.scoreThreshold,padToMaxOutputSize:l},f=o.a.runKernel(s._47,d,p);return{selectedIndices:f[0],validOutputs:f[1]}}});
  4742. /**
  4743. * @license
  4744. * Copyright 2020 Google LLC. All Rights Reserved.
  4745. * Licensed under the Apache License, Version 2.0 (the "License");
  4746. * you may not use this file except in compliance with the License.
  4747. * You may obtain a copy of the License at
  4748. *
  4749. * http://www.apache.org/licenses/LICENSE-2.0
  4750. *
  4751. * Unless required by applicable law or agreed to in writing, software
  4752. * distributed under the License is distributed on an "AS IS" BASIS,
  4753. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4754. * See the License for the specific language governing permissions and
  4755. * limitations under the License.
  4756. * =============================================================================
  4757. */const wr=async function(t,e,n,r=.5,i=Number.NEGATIVE_INFINITY,o=!1){const s=Object(a.a)(t,"boxes","nonMaxSuppressionAsync"),l=Object(a.a)(e,"scores","nonMaxSuppressionAsync"),u=vr(s,l,n,r,i,null),c=u.maxOutputSize,h=u.iouThreshold,d=u.scoreThreshold,[p,f]=await Promise.all([s.data(),l.data()]),{selectedIndices:g,validOutputs:m}=Object(_r.b)(p,f,c,h,d,o);return s!==t&&s.dispose(),l!==e&&l.dispose(),{selectedIndices:Nn(g,"int32"),validOutputs:Object(sn.a)(m,"int32")}};
  4758. /**
  4759. * @license
  4760. * Copyright 2020 Google LLC. All Rights Reserved.
  4761. * Licensed under the Apache License, Version 2.0 (the "License");
  4762. * you may not use this file except in compliance with the License.
  4763. * You may obtain a copy of the License at
  4764. *
  4765. * http://www.apache.org/licenses/LICENSE-2.0
  4766. *
  4767. * Unless required by applicable law or agreed to in writing, software
  4768. * distributed under the License is distributed on an "AS IS" BASIS,
  4769. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4770. * See the License for the specific language governing permissions and
  4771. * limitations under the License.
  4772. * =============================================================================
  4773. */const Cr=Object(l.a)({resizeBilinear_:function(t,e,n=!1,r=!1){const i=Object(a.a)(t,"images","resizeBilinear");d.assert(3===i.rank||4===i.rank,()=>"Error in resizeBilinear: x must be rank 3 or 4, but got "+`rank ${i.rank}.`),d.assert(2===e.length,()=>"Error in resizeBilinear: new shape must 2D, but got shape "+`${e}.`),d.assert(!1===r||!1===n,()=>"Error in resizeBilinear: If halfPixelCenters is true, alignCorners must be false.");let l=i,u=!1;3===i.rank&&(u=!0,l=Object(S.a)(i,[1,i.shape[0],i.shape[1],i.shape[2]]));const[]=e,c={images:l},h={alignCorners:n,halfPixelCenters:r,size:e},p=o.a.runKernel(s._64,c,h);return u?Object(S.a)(p,[p.shape[1],p.shape[2],p.shape[3]]):p}});
  4774. /**
  4775. * @license
  4776. * Copyright 2020 Google LLC. All Rights Reserved.
  4777. * Licensed under the Apache License, Version 2.0 (the "License");
  4778. * you may not use this file except in compliance with the License.
  4779. * You may obtain a copy of the License at
  4780. *
  4781. * http://www.apache.org/licenses/LICENSE-2.0
  4782. *
  4783. * Unless required by applicable law or agreed to in writing, software
  4784. * distributed under the License is distributed on an "AS IS" BASIS,
  4785. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4786. * See the License for the specific language governing permissions and
  4787. * limitations under the License.
  4788. * =============================================================================
  4789. */const Sr=Object(l.a)({resizeNearestNeighbor_:function(t,e,n=!1,r=!1){const i=Object(a.a)(t,"images","resizeNearestNeighbor");d.assert(3===i.rank||4===i.rank,()=>"Error in resizeNearestNeighbor: x must be rank 3 or 4, but got "+`rank ${i.rank}.`),d.assert(2===e.length,()=>"Error in resizeNearestNeighbor: new shape must 2D, but got shape "+`${e}.`),d.assert("float32"===i.dtype||"int32"===i.dtype,()=>"`images` must have `int32` or `float32` as dtype"),d.assert(!1===r||!1===n,()=>"Error in resizeNearestNeighbor: If halfPixelCenters is true, alignCorners must be false.");let l=i,u=!1;3===i.rank&&(u=!0,l=Object(S.a)(i,[1,i.shape[0],i.shape[1],i.shape[2]]));const[]=e,c={images:l},h={alignCorners:n,halfPixelCenters:r,size:e},p=o.a.runKernel(s._66,c,h);return u?Object(S.a)(p,[p.shape[1],p.shape[2],p.shape[3]]):p}});
  4790. /**
  4791. * @license
  4792. * Copyright 2021 Google LLC. All Rights Reserved.
  4793. * Licensed under the Apache License, Version 2.0 (the "License");
  4794. * you may not use this file except in compliance with the License.
  4795. * You may obtain a copy of the License at
  4796. *
  4797. * https://www.apache.org/licenses/LICENSE-2.0
  4798. *
  4799. * Unless required by applicable law or agreed to in writing, software
  4800. * distributed under the License is distributed on an "AS IS" BASIS,
  4801. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4802. * See the License for the specific language governing permissions and
  4803. * limitations under the License.
  4804. * =============================================================================
  4805. */const kr=Object(l.a)({threshold_:function(t,e="binary",n=!1,r=.5){const i=Object(a.a)(t,"image","threshold"),o=i.shape[0]*i.shape[1];let s,l,u,c,p=Object(N.a)(Nn([r]),255);if(d.assert(3===i.rank,()=>"Error in threshold: image must be rank 3,"+`but got rank ${i.rank}.`),d.assert(3===i.shape[2]||1===i.shape[2],()=>"Error in threshold: image color channel must be equal to 3 or 1"+`but got ${i.shape[2]}.`),d.assert("int32"===i.dtype||"float32"===i.dtype,()=>"Error in dtype: image dtype must be int32 or float32,"+`but got dtype ${i.dtype}.`),d.assert("otsu"===e||"binary"===e,()=>`Method must be binary or otsu, but was ${e}`),3===i.shape[2]){[s,l,u]=Tn(i,[1,1,1],-1);const t=Object(N.a)(s,.2989),e=Object(N.a)(l,.587),n=Object(N.a)(u,.114);c=Object(h.a)(Object(h.a)(t,e),n)}else c=t;"otsu"===e&&(p=function(t,e){let n,r,i,o,s,a,l=Nn([-1]),u=Nn([0]),c=Nn([0]);for(let d=0;d<t.size-1;d++){n=M(t,0,d+1),r=M(t,d+1),s=Object(ft.a)(Object(Zt.a)(n),e),a=Object(ft.a)(Object(Zt.a)(r),e);const p=Object(Zt.a)(Object(N.a)(n,Xe(0,n.size)));i=Object(ft.a)(p,Object(Zt.a)(n));const f=Object(It.a)(r.shape,n.size),g=Object(h.a)(Xe(0,r.size),f),m=Object(N.a)(r,g);o=Object(ft.a)(Object(Zt.a)(m),Object(Zt.a)(r));const v=Object(Jt.a)(i,o),b=Object(Jt.a)(i,o),_=Object(N.a)(s,a);c=Object(N.a)(Object(N.a)(_,v),b);const y=Dt(c,u);u=vt(y,c,u),l=vt(y,Nn([d]),l)}return l}(V(Object(w.a)(rn(c),"int32"),Object(Rn.a)([]),256),o));const f=n?Ut(c,p):Dt(c,p);return Object(w.a)(Object(N.a)(f,255),"int32")}});
  4806. /**
  4807. * @license
  4808. * Copyright 2021 Google LLC. All Rights Reserved.
  4809. * Licensed under the Apache License, Version 2.0 (the "License");
  4810. * you may not use this file except in compliance with the License.
  4811. * You may obtain a copy of the License at
  4812. *
  4813. * http://www.apache.org/licenses/LICENSE-2.0
  4814. *
  4815. * Unless required by applicable law or agreed to in writing, software
  4816. * distributed under the License is distributed on an "AS IS" BASIS,
  4817. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4818. * See the License for the specific language governing permissions and
  4819. * limitations under the License.
  4820. * =============================================================================
  4821. */const Or=Object(l.a)({transform_:function(t,e,n="nearest",r="constant",i=0,l){const u=Object(a.a)(t,"image","transform","float32"),c=Object(a.a)(e,"transforms","transform","float32");d.assert(4===u.rank,()=>"Error in transform: image must be rank 4,"+`but got rank ${u.rank}.`),d.assert(2===c.rank&&(c.shape[0]===u.shape[0]||1===c.shape[0])&&8===c.shape[1],()=>"Error in transform: Input transform should be batch x 8 or 1 x 8"),d.assert(null==l||2===l.length,()=>"Error in transform: outputShape must be [height, width] or null, "+`but got ${l}.`);const h={image:u,transforms:c},p={interpolation:n,fillMode:r,fillValue:i,outputShape:l};return o.a.runKernel(s._103,h,p)}});
  4822. /**
  4823. * @license
  4824. * Copyright 2020 Google LLC. All Rights Reserved.
  4825. * Licensed under the Apache License, Version 2.0 (the "License");
  4826. * you may not use this file except in compliance with the License.
  4827. * You may obtain a copy of the License at
  4828. *
  4829. * http://www.apache.org/licenses/LICENSE-2.0
  4830. *
  4831. * Unless required by applicable law or agreed to in writing, software
  4832. * distributed under the License is distributed on an "AS IS" BASIS,
  4833. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4834. * See the License for the specific language governing permissions and
  4835. * limitations under the License.
  4836. * =============================================================================
  4837. */Object(l.a)({bandPart_:function(t,e,n){Object(d.assert)(e%1==0,()=>`bandPart(): numLower must be an integer, got ${e}.`),Object(d.assert)(n%1==0,()=>`bandPart(): numUpper must be an integer, got ${n}.`);const r=Object(a.a)(t,"a","bandPart");Object(d.assert)(r.rank>=2,()=>`bandPart(): Rank must be at least 2, got ${r.rank}.`);const i=r.shape,[o,s]=r.shape.slice(-2);if(!(e<=o))throw new Error(`bandPart(): numLower (${e})`+` must not be greater than the number of rows (${o}).`);if(!(n<=s))throw new Error(`bandPart(): numUpper (${n})`+` must not be greater than the number of columns (${s}).`);e<0&&(e=o),n<0&&(n=s);const l=Object(S.a)(Xe(0,o,1,"int32"),[-1,1]),u=Xe(0,s,1,"int32"),c=Object(Jt.a)(l,u),h=ne(Ut(c,Object(sn.a)(+e,"int32")),Mt(c,Object(sn.a)(-n,"int32"))),p=he([o,s],r.dtype);return Object(S.a)(Sn(Vn(Object(S.a)(r,[-1,o,s])).map(t=>vt(h,t,p))),i)}});
  4838. /**
  4839. * @license
  4840. * Copyright 2020 Google LLC. All Rights Reserved.
  4841. * Licensed under the Apache License, Version 2.0 (the "License");
  4842. * you may not use this file except in compliance with the License.
  4843. * You may obtain a copy of the License at
  4844. *
  4845. * http://www.apache.org/licenses/LICENSE-2.0
  4846. *
  4847. * Unless required by applicable law or agreed to in writing, software
  4848. * distributed under the License is distributed on an "AS IS" BASIS,
  4849. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4850. * See the License for the specific language governing permissions and
  4851. * limitations under the License.
  4852. * =============================================================================
  4853. */Object(l.a)({gramSchmidt_:function(t){let e;if(Array.isArray(t)){e=!1,Object(d.assert)(null!=t&&t.length>0,()=>"Gram-Schmidt process: input must not be null, undefined, or empty");const n=t[0].shape[0];for(let e=1;e<t.length;++e)Object(d.assert)(t[e].shape[0]===n,()=>"Gram-Schmidt: Non-unique lengths found in the input vectors: "+`(${t[e].shape[0]} vs. ${n})`)}else e=!0,t=Tn(t,t.shape[0],0).map(t=>Cn(t,[0]));Object(d.assert)(t.length<=t[0].shape[0],()=>`Gram-Schmidt: Number of vectors (${t.length}) exceeds `+`number of dimensions (${t[0].shape[0]}).`);const n=[],r=t;for(let e=0;e<t.length;++e)n.push(o.a.tidy(()=>{let t=r[e];if(e>0)for(let r=0;r<e;++r){const e=Object(N.a)(Object(Zt.a)(Object(N.a)(n[r],t)),n[r]);t=Object(Jt.a)(t,e)}return Object(ft.a)(t,Kn(t,"euclidean"))}));return e?Sn(n,0):n}});var Ir=n("V6aD");
  4854. /**
  4855. * @license
  4856. * Copyright 2020 Google LLC. All Rights Reserved.
  4857. * Licensed under the Apache License, Version 2.0 (the "License");
  4858. * you may not use this file except in compliance with the License.
  4859. * You may obtain a copy of the License at
  4860. *
  4861. * http://www.apache.org/licenses/LICENSE-2.0
  4862. *
  4863. * Unless required by applicable law or agreed to in writing, software
  4864. * distributed under the License is distributed on an "AS IS" BASIS,
  4865. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4866. * See the License for the specific language governing permissions and
  4867. * limitations under the License.
  4868. * =============================================================================
  4869. */function Rr(t,e=!1){return o.a.tidy(()=>{Object(d.assert)(2===t.shape.length,()=>`qr2d() requires a 2D Tensor, but got a ${t.shape.length}D Tensor.`);const n=t.shape[0],r=t.shape[1];let i=Ot(n),s=Object(I.a)(t);const a=Dn([[1]],[1,1]);let l=Object(I.a)(a);const u=n>=r?r:n;for(let t=0;t<u;++t){const e=s,u=l,c=i;[l,s,i]=o.a.tidy(()=>{const e=M(s,[t,t],[n-t,1]),o=Kn(e),u=M(s,[t,t],[1,1]),c=vt(Dt(u,0),Dn([[-1]]),Dn([[1]])),h=Object(Jt.a)(u,Object(N.a)(c,o)),d=Object(ft.a)(e,h);l=1===d.shape[0]?Object(I.a)(a):R([a,M(d,[1,0],[d.shape[0]-1,d.shape[1]])],0);const p=Xt(Object(ft.a)(Object(A.a)(c,h),o)),f=M(s,[t,0],[n-t,r]),g=Object(N.a)(p,l),m=Object(Xn.a)(l);if(0===t)s=Object(Jt.a)(f,Object(A.a)(g,Object(A.a)(m,f)));else{const e=Object(Jt.a)(f,Object(A.a)(g,Object(A.a)(m,f)));s=R([M(s,[0,0],[t,r]),e],0)}const v=Object(Xn.a)(g),b=M(i,[0,t],[n,i.shape[1]-t]);if(0===t)i=Object(Jt.a)(b,Object(A.a)(Object(A.a)(b,l),v));else{const e=Object(Jt.a)(b,Object(A.a)(Object(A.a)(b,l),v));i=R([M(i,[0,0],[n,t]),e],1)}return[l,s,i]}),Object(Ir.a)([e,u,c])}return!e&&n>r&&(i=M(i,[0,0],[n,r]),s=M(s,[0,0],[r,r])),[i,s]})}Object(l.a)({qr_:function(t,e=!1){if(Object(d.assert)(t.rank>=2,()=>`qr() requires input tensor to have a rank >= 2, but got rank ${t.rank}`),2===t.rank)return Rr(t,e);{const n=t.shape.slice(0,t.shape.length-2).reduce((t,e)=>t*e),r=[],i=[];return Vn(Object(S.a)(t,[n,t.shape[t.shape.length-2],t.shape[t.shape.length-1]]),0).forEach(t=>{const[n,o]=Rr(t,e);r.push(n),i.push(o)}),[Object(S.a)(Sn(r,0),t.shape),Object(S.a)(Sn(i,0),t.shape)]}}});var Ar=n("HOGz");const Nr=Object(l.a)({computeWeightedLoss_:function(t,e,n=Ar.a.SUM_BY_NONZERO_WEIGHTS){const r=Object(a.a)(t,"losses","computeWeightedLoss");let i=null;null!=e&&(i=Object(a.a)(e,"weights","computeWeightedLoss"));const o=null==i?r:Object(N.a)(r,i);if(n===Ar.a.NONE)return o;if(n===Ar.a.SUM)return Object(Zt.a)(o);if(n===Ar.a.MEAN){if(null==i)return ce(o);{const t=r.size/i.size,e=Object(ft.a)(Object(Zt.a)(o),Object(Zt.a)(i));return t>1?Object(ft.a)(e,Object(sn.a)(t)):e}}if(n===Ar.a.SUM_BY_NONZERO_WEIGHTS){if(null==i)return Object(ft.a)(Object(Zt.a)(o),Object(sn.a)(r.size));{const t=Object(N.a)(i,de(r.shape)),e=Object(w.a)(Object(Zt.a)(we(t,Object(sn.a)(0))),"float32");return Object(ft.a)(Object(Zt.a)(o),e)}}throw Error(`Unknown reduction: ${n}`)}});
  4870. /**
  4871. * @license
  4872. * Copyright 2020 Google LLC. All Rights Reserved.
  4873. * Licensed under the Apache License, Version 2.0 (the "License");
  4874. * you may not use this file except in compliance with the License.
  4875. * You may obtain a copy of the License at
  4876. *
  4877. * http://www.apache.org/licenses/LICENSE-2.0
  4878. *
  4879. * Unless required by applicable law or agreed to in writing, software
  4880. * distributed under the License is distributed on an "AS IS" BASIS,
  4881. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4882. * See the License for the specific language governing permissions and
  4883. * limitations under the License.
  4884. * =============================================================================
  4885. */Object(l.a)({absoluteDifference_:function(t,e,n,r=Ar.a.SUM_BY_NONZERO_WEIGHTS){const o=Object(a.a)(t,"labels","absoluteDifference"),s=Object(a.a)(e,"predictions","absoluteDifference");let l=null;null!=n&&(l=Object(a.a)(n,"weights","absoluteDifference")),Object(d.assertShapesMatch)(o.shape,s.shape,"Error in absoluteDifference: ");const u=Object(i.a)(Object(Jt.a)(o,s));return Nr(u,l,r)}});Object(l.a)({cosineDistance_:function(t,e,n,r,i=Ar.a.SUM_BY_NONZERO_WEIGHTS){const o=Object(a.a)(t,"labels","cosineDistance"),s=Object(a.a)(e,"predictions","cosineDistance");let l=null;null!=r&&(l=Object(a.a)(r,"weights","cosineDistance")),Object(d.assertShapesMatch)(o.shape,s.shape,"Error in cosineDistance: ");const u=Object(sn.a)(1),c=Object(Jt.a)(u,Object(Zt.a)(Object(N.a)(o,s),n,!0));return Nr(c,l,i)}});Object(l.a)({hingeLoss_:function(t,e,n,r=Ar.a.SUM_BY_NONZERO_WEIGHTS){let i=Object(a.a)(t,"labels","hingeLoss");const o=Object(a.a)(e,"predictions","hingeLoss");let s=null;null!=n&&(s=Object(a.a)(n,"weights","hingeLoss")),Object(d.assertShapesMatch)(i.shape,o.shape,"Error in hingeLoss: ");const l=Object(sn.a)(1);i=Object(Jt.a)(Object(N.a)(Object(sn.a)(2),i),l);const u=Object(qe.a)(Object(Jt.a)(l,Object(N.a)(i,o)));return Nr(u,s,r)}});
  4886. /**
  4887. * @license
  4888. * Copyright 2020 Google LLC. All Rights Reserved.
  4889. * Licensed under the Apache License, Version 2.0 (the "License");
  4890. * you may not use this file except in compliance with the License.
  4891. * You may obtain a copy of the License at
  4892. *
  4893. * http://www.apache.org/licenses/LICENSE-2.0
  4894. *
  4895. * Unless required by applicable law or agreed to in writing, software
  4896. * distributed under the License is distributed on an "AS IS" BASIS,
  4897. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4898. * See the License for the specific language governing permissions and
  4899. * limitations under the License.
  4900. * =============================================================================
  4901. */Object(l.a)({huberLoss_:function(t,e,n,r=1,o=Ar.a.SUM_BY_NONZERO_WEIGHTS){const s=Object(a.a)(t,"labels","huberLoss"),l=Object(a.a)(e,"predictions","huberLoss");let u=null;null!=n&&(u=Object(a.a)(n,"weights","huberLoss")),Object(d.assertShapesMatch)(s.shape,l.shape,"Error in huberLoss: ");const c=Object(sn.a)(r),p=Object(i.a)(Object(Jt.a)(l,s)),f=ve(p,c),g=Object(Jt.a)(p,f),m=Object(h.a)(Object(N.a)(Object(sn.a)(.5),Object(ye.a)(f)),Object(N.a)(c,g));return Nr(m,u,o)}});
  4902. /**
  4903. * @license
  4904. * Copyright 2020 Google LLC. All Rights Reserved.
  4905. * Licensed under the Apache License, Version 2.0 (the "License");
  4906. * you may not use this file except in compliance with the License.
  4907. * You may obtain a copy of the License at
  4908. *
  4909. * http://www.apache.org/licenses/LICENSE-2.0
  4910. *
  4911. * Unless required by applicable law or agreed to in writing, software
  4912. * distributed under the License is distributed on an "AS IS" BASIS,
  4913. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4914. * See the License for the specific language governing permissions and
  4915. * limitations under the License.
  4916. * =============================================================================
  4917. */Object(l.a)({logLoss_:function(t,e,n,r=1e-7,i=Ar.a.SUM_BY_NONZERO_WEIGHTS){const o=Object(a.a)(t,"labels","logLoss"),s=Object(a.a)(e,"predictions","logLoss");let l=null;null!=n&&(l=Object(a.a)(n,"weights","logLoss")),Object(d.assertShapesMatch)(o.shape,s.shape,"Error in logLoss: ");const u=Object(sn.a)(1),c=Object(sn.a)(r),p=Xt(Object(N.a)(o,Wt(Object(h.a)(s,c)))),f=Object(N.a)(Object(Jt.a)(u,o),Wt(Object(h.a)(Object(Jt.a)(u,s),c))),g=Object(Jt.a)(p,f);return Nr(g,l,i)}});
  4918. /**
  4919. * @license
  4920. * Copyright 2020 Google LLC. All Rights Reserved.
  4921. * Licensed under the Apache License, Version 2.0 (the "License");
  4922. * you may not use this file except in compliance with the License.
  4923. * You may obtain a copy of the License at
  4924. *
  4925. * http://www.apache.org/licenses/LICENSE-2.0
  4926. *
  4927. * Unless required by applicable law or agreed to in writing, software
  4928. * distributed under the License is distributed on an "AS IS" BASIS,
  4929. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4930. * See the License for the specific language governing permissions and
  4931. * limitations under the License.
  4932. * =============================================================================
  4933. */Object(l.a)({meanSquaredError_:function(t,e,n,r=Ar.a.SUM_BY_NONZERO_WEIGHTS){const i=Object(a.a)(t,"labels","meanSquaredError"),o=Object(a.a)(e,"predictions","meanSquaredError");let s=null;null!=n&&(s=Object(a.a)(n,"weights","meanSquaredError")),Object(d.assertShapesMatch)(i.shape,o.shape,"Error in meanSquaredError: ");const l=wn(i,o);return Nr(l,s,r)}});
  4934. /**
  4935. * @license
  4936. * Copyright 2020 Google LLC. All Rights Reserved.
  4937. * Licensed under the Apache License, Version 2.0 (the "License");
  4938. * you may not use this file except in compliance with the License.
  4939. * You may obtain a copy of the License at
  4940. *
  4941. * http://www.apache.org/licenses/LICENSE-2.0
  4942. *
  4943. * Unless required by applicable law or agreed to in writing, software
  4944. * distributed under the License is distributed on an "AS IS" BASIS,
  4945. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4946. * See the License for the specific language governing permissions and
  4947. * limitations under the License.
  4948. * =============================================================================
  4949. */Object(l.a)({sigmoidCrossEntropy_:function(t,e,n,r=0,o=Ar.a.SUM_BY_NONZERO_WEIGHTS){let s=Object(a.a)(t,"multiClassLabels","sigmoidCrossEntropy");const l=Object(a.a)(e,"logits","sigmoidCrossEntropy");let u=null;if(null!=n&&(u=Object(a.a)(n,"weights","sigmoidCrossEntropy")),Object(d.assertShapesMatch)(s.shape,l.shape,"Error in sigmoidCrossEntropy: "),r>0){const t=Object(sn.a)(r),e=Object(sn.a)(1),n=Object(sn.a)(.5);s=Object(h.a)(Object(N.a)(s,Object(Jt.a)(e,t)),Object(N.a)(n,t))}const c=function(t,e){const n=Object(a.a)(t,"labels","sigmoidCrossEntropyWithLogits"),r=Object(a.a)(e,"logits","sigmoidCrossEntropyWithLogits");Object(d.assertShapesMatch)(n.shape,r.shape,"Error in sigmoidCrossEntropyWithLogits: ");const o=Object(qe.a)(r),s=Object(N.a)(r,n),l=Gt(wt(Xt(Object(i.a)(r))));return Object(h.a)(Object(Jt.a)(o,s),l)}(s,l);return Nr(c,u,o)}});
  4950. /**
  4951. * @license
  4952. * Copyright 2020 Google LLC. All Rights Reserved.
  4953. * Licensed under the Apache License, Version 2.0 (the "License");
  4954. * you may not use this file except in compliance with the License.
  4955. * You may obtain a copy of the License at
  4956. *
  4957. * http://www.apache.org/licenses/LICENSE-2.0
  4958. *
  4959. * Unless required by applicable law or agreed to in writing, software
  4960. * distributed under the License is distributed on an "AS IS" BASIS,
  4961. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4962. * See the License for the specific language governing permissions and
  4963. * limitations under the License.
  4964. * =============================================================================
  4965. */Object(l.a)({softmaxCrossEntropy_:function(t,e,n,r=0,i=Ar.a.SUM_BY_NONZERO_WEIGHTS){let o=Object(a.a)(t,"onehotLabels","softmaxCrossEntropy");const s=Object(a.a)(e,"logits","softmaxCrossEntropy");let l=null;if(null!=n&&(l=Object(a.a)(n,"weights","softmaxCrossEntropy")),Object(d.assertShapesMatch)(o.shape,s.shape,"Error in softmaxCrossEntropy: "),r>0){const t=Object(sn.a)(r),e=Object(sn.a)(1),n=Object(sn.a)(o.shape[1]);o=Object(h.a)(Object(N.a)(o,Object(Jt.a)(e,t)),Object(ft.a)(t,n))}const u=function(t,e,n=-1){if(-1===n&&(n=e.rank-1),n!==e.rank-1)throw Error("Softmax cross entropy along a non-last dimension is not yet "+`supported. Labels / logits was rank ${e.rank} `+`and dim was ${n}`);return Object(zt.a)((t,e,r)=>{const i=ee(e,[n],!0),o=Object(Jt.a)(Object(w.a)(e,"float32"),i);r([t,o]);const s=Xt(Object(N.a)(o,t));return{value:Object(Zt.a)(s,[n]),gradFunc:(t,e)=>{const[r,i]=e,o=Object(te.e)(t.shape,[n]);return[Object(N.a)(Object(S.a)(t,o),Object(Jt.a)(Object(w.a)(r,"float32"),wt(i))),Object(N.a)(Object(S.a)(t,o),Object(Jt.a)(wt(i),Object(w.a)(r,"float32")))]}}})(t,e)}(o,s);return Nr(u,l,i)}});
  4966. /**
  4967. * @license
  4968. * Copyright 2021 Google LLC. All Rights Reserved.
  4969. * Licensed under the Apache License, Version 2.0 (the "License");
  4970. * you may not use this file except in compliance with the License.
  4971. * You may obtain a copy of the License at
  4972. *
  4973. * http://www.apache.org/licenses/LICENSE-2.0
  4974. *
  4975. * Unless required by applicable law or agreed to in writing, software
  4976. * distributed under the License is distributed on an "AS IS" BASIS,
  4977. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4978. * See the License for the specific language governing permissions and
  4979. * limitations under the License.
  4980. * =============================================================================
  4981. */const Dr=Object(l.a)({sparseFillEmptyRows_:function(t,e,n,r){const i=Object(a.a)(t,"indices","sparseFillEmptyRows","int32"),l=Object(a.a)(e,"values","sparseFillEmptyRows"),u=Object(a.a)(n,"denseShape","sparseFillEmptyRows","int32"),c=Object(a.a)(r,"defaultValue","sparseFillEmptyRows",l.dtype);if(2!==i.rank)throw new Error(`Indices should be Tensor2D but received shape\n ${i.shape}`);if(1!==l.rank)throw new Error(`Values should be Tensor1D but received shape ${l.shape}`);if(1!==u.rank)throw new Error(`Dense shape should be Tensor1D but received shape ${u.shape}`);if(0!==c.rank)throw new Error(`Default value should be a scalar but received shape ${c.shape}`);const h={indices:i,values:l,denseShape:u,defaultValue:c},d=o.a.runKernel(s._83,h);return{outputIndices:d[0],outputValues:d[1],emptyRowIndicator:d[2],reverseIndexMap:d[3]}}});
  4982. /**
  4983. * @license
  4984. * Copyright 2021 Google LLC. All Rights Reserved.
  4985. * Licensed under the Apache License, Version 2.0 (the "License");
  4986. * you may not use this file except in compliance with the License.
  4987. * You may obtain a copy of the License at
  4988. *
  4989. * http://www.apache.org/licenses/LICENSE-2.0
  4990. *
  4991. * Unless required by applicable law or agreed to in writing, software
  4992. * distributed under the License is distributed on an "AS IS" BASIS,
  4993. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4994. * See the License for the specific language governing permissions and
  4995. * limitations under the License.
  4996. * =============================================================================
  4997. */const Mr=Object(l.a)({sparseReshape_:function(t,e,n){const r=Object(a.a)(t,"inputIndices","sparseReshape","int32"),i=Object(a.a)(e,"inputShape","sparseReshape","int32"),l=Object(a.a)(n,"newShape","sparseReshape","int32");if(2!==r.rank)throw new Error(`Input indices should be Tensor2D but received shape\n ${r.shape}`);if(1!==i.rank)throw new Error(`Input shape should be Tensor1D but received shape ${i.shape}`);if(1!==l.rank)throw new Error(`New shape should be Tensor1D but received shape ${l.shape}`);const u={inputIndices:r,inputShape:i,newShape:l},c=o.a.runKernel(s._84,u);return{outputIndices:c[0],outputShape:c[1]}}});
  4998. /**
  4999. * @license
  5000. * Copyright 2021 Google LLC. All Rights Reserved.
  5001. * Licensed under the Apache License, Version 2.0 (the "License");
  5002. * you may not use this file except in compliance with the License.
  5003. * You may obtain a copy of the License at
  5004. *
  5005. * http://www.apache.org/licenses/LICENSE-2.0
  5006. *
  5007. * Unless required by applicable law or agreed to in writing, software
  5008. * distributed under the License is distributed on an "AS IS" BASIS,
  5009. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5010. * See the License for the specific language governing permissions and
  5011. * limitations under the License.
  5012. * =============================================================================
  5013. */const Lr=Object(l.a)({sparseSegmentMean_:function(t,e,n){const r=Object(a.a)(t,"data","sparseSegmentMean"),i=Object(a.a)(e,"indices","sparseSegmentMean","int32"),l=Object(a.a)(n,"segmentIds","sparseSegmentMean","int32");if(r.rank<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(1!==i.rank)throw new Error(`Indices should be Tensor1D but received shape\n ${i.shape}`);if(1!==l.rank)throw new Error(`Segment ids should be Tensor1D but received shape\n ${l.shape}`);const u={data:r,indices:i,segmentIds:l};return o.a.runKernel(s._85,u)}});
  5014. /**
  5015. * @license
  5016. * Copyright 2021 Google LLC. All Rights Reserved.
  5017. * Licensed under the Apache License, Version 2.0 (the "License");
  5018. * you may not use this file except in compliance with the License.
  5019. * You may obtain a copy of the License at
  5020. *
  5021. * http://www.apache.org/licenses/LICENSE-2.0
  5022. *
  5023. * Unless required by applicable law or agreed to in writing, software
  5024. * distributed under the License is distributed on an "AS IS" BASIS,
  5025. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5026. * See the License for the specific language governing permissions and
  5027. * limitations under the License.
  5028. * =============================================================================
  5029. */const Pr=Object(l.a)({sparseSegmentSum_:function(t,e,n){const r=Object(a.a)(t,"data","sparseSegmentSum"),i=Object(a.a)(e,"indices","sparseSegmentSum","int32"),l=Object(a.a)(n,"segmentIds","sparseSegmentSum","int32");if(r.rank<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(1!==i.rank)throw new Error(`Indices should be Tensor1D but received shape\n ${i.shape}`);if(1!==l.rank)throw new Error(`Segment ids should be Tensor1D but received shape\n ${l.shape}`);const u={data:r,indices:i,segmentIds:l};return o.a.runKernel(s._86,u)}});
  5030. /**
  5031. * @license
  5032. * Copyright 2021 Google LLC. All Rights Reserved.
  5033. * Licensed under the Apache License, Version 2.0 (the "License");
  5034. * you may not use this file except in compliance with the License.
  5035. * You may obtain a copy of the License at
  5036. *
  5037. * http://www.apache.org/licenses/LICENSE-2.0
  5038. *
  5039. * Unless required by applicable law or agreed to in writing, software
  5040. * distributed under the License is distributed on an "AS IS" BASIS,
  5041. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5042. * See the License for the specific language governing permissions and
  5043. * limitations under the License.
  5044. * =============================================================================
  5045. */const Fr=Object(l.a)({stringNGrams_:function(t,e,n,r,i,l,u,c){const h=Object(a.a)(t,"data","stringNGrams","string");if("string"!==h.dtype)throw new Error("Data must be of datatype string");if(1!==h.shape.length)throw new Error(`Data must be a vector, saw: ${h.shape}`);const d=Object(a.a)(e,"dataSplits","stringNGrams");if("int32"!==d.dtype)throw new Error("Data splits must be of datatype int32");const p={separator:n,nGramWidths:r,leftPad:i,rightPad:l,padWidth:u,preserveShortSequences:c},f={data:h,dataSplits:d},g=o.a.runKernel(s._94,f,p);return{nGrams:g[0],nGramsSplits:g[1]}}});
  5046. /**
  5047. * @license
  5048. * Copyright 2021 Google LLC. All Rights Reserved.
  5049. * Licensed under the Apache License, Version 2.0 (the "License");
  5050. * you may not use this file except in compliance with the License.
  5051. * You may obtain a copy of the License at
  5052. *
  5053. * http://www.apache.org/licenses/LICENSE-2.0
  5054. *
  5055. * Unless required by applicable law or agreed to in writing, software
  5056. * distributed under the License is distributed on an "AS IS" BASIS,
  5057. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5058. * See the License for the specific language governing permissions and
  5059. * limitations under the License.
  5060. * =============================================================================
  5061. */const Br=Object(l.a)({stringSplit_:function(t,e,n=!0){const r=Object(a.a)(t,"input","stringSplit","string"),i=Object(a.a)(e,"delimiter","stringSplit","string");if(1!==r.rank)throw new Error(`Input should be Tensor1D but received shape ${r.shape}`);if(0!==i.rank)throw new Error(`Delimiter should be a scalar but received shape ${i.shape}`);const l={skipEmpty:n},u={input:r,delimiter:i},c=o.a.runKernel(s._95,u,l);return{indices:c[0],values:c[1],shape:c[2]}}});
  5062. /**
  5063. * @license
  5064. * Copyright 2021 Google LLC. All Rights Reserved.
  5065. * Licensed under the Apache License, Version 2.0 (the "License");
  5066. * you may not use this file except in compliance with the License.
  5067. * You may obtain a copy of the License at
  5068. *
  5069. * http://www.apache.org/licenses/LICENSE-2.0
  5070. *
  5071. * Unless required by applicable law or agreed to in writing, software
  5072. * distributed under the License is distributed on an "AS IS" BASIS,
  5073. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5074. * See the License for the specific language governing permissions and
  5075. * limitations under the License.
  5076. * =============================================================================
  5077. */const jr=Object(l.a)({stringToHashBucketFast_:function(t,e){const n=Object(a.a)(t,"input","stringToHashBucketFast","string"),r={numBuckets:e};if(e<=0)throw new Error("Number of buckets must be at least 1");const i={input:n};return o.a.runKernel(s._96,i,r)}});n.d(e,"_7",function(){return $r}),n.d(e,"_66",function(){return Ur}),n.d(e,"_75",function(){return Vr}),n.d(e,"a",function(){return i.a}),n.d(e,"b",function(){return u}),n.d(e,"c",function(){return c}),n.d(e,"d",function(){return h.a}),n.d(e,"e",function(){return p}),n.d(e,"f",function(){return f}),n.d(e,"g",function(){return g}),n.d(e,"h",function(){return m}),n.d(e,"i",function(){return v}),n.d(e,"j",function(){return b}),n.d(e,"k",function(){return _}),n.d(e,"l",function(){return y}),n.d(e,"m",function(){return x}),n.d(e,"n",function(){return E}),n.d(e,"o",function(){return k}),n.d(e,"p",function(){return O}),n.d(e,!1,function(){return P}),n.d(e,"r",function(){return F}),n.d(e,"q",function(){return B}),n.d(e,!1,function(){return j}),n.d(e,!1,function(){return $}),n.d(e,!1,function(){return U}),n.d(e,"s",function(){return V}),n.d(e,"t",function(){return H}),n.d(e,"u",function(){return W}),n.d(e,"v",function(){return G.a}),n.d(e,"w",function(){return w.a}),n.d(e,"x",function(){return z}),n.d(e,"y",function(){return X}),n.d(e,"z",function(){return I.a}),n.d(e,"A",function(){return K.a}),n.d(e,"B",function(){return R}),n.d(e,!1,function(){return Y}),n.d(e,!1,function(){return q}),n.d(e,!1,function(){return J}),n.d(e,!1,function(){return Z}),n.d(e,"C",function(){return tt}),n.d(e,"D",function(){return Q}),n.d(e,"E",function(){return nt}),n.d(e,"F",function(){return rt}),n.d(e,!1,function(){return ot}),n.d(e,"G",function(){return st}),n.d(e,"H",function(){return at}),n.d(e,"I",function(){return lt}),n.d(e,"J",function(){return ut}),n.d(e,"K",function(){return ct}),n.d(e,"L",function(){return ht}),n.d(e,!1,function(){return dt}),n.d(e,"M",function(){return pt}),n.d(e,"N",function(){return ft.a}),n.d(e,"O",function(){return _t}),n.d(e,!1,function(){return yt}),n.d(e,"P",function(){return Tt}),n.d(e,"Q",function(){return xt.a}),n.d(e,"R",function(){return mt}),n.d(e,"S",function(){return Et}),n.d(e,"T",function(){return wt}),n.d(e,"U",function(){return Ct}),n.d(e,"V",function(){return St}),n.d(e,!1,function(){return Ot}),n.d(e,"X",function(){return It.a}),n.d(e,"Y",function(){return Rt}),n.d(e,"Z",function(){return At.a}),n.d(e,"_1",function(){return Nt}),n.d(e,"_3",function(){return Dt}),n.d(e,"_4",function(){return Mt}),n.d(e,"_6",function(){return Lt}),n.d(e,!1,function(){return Pt}),n.d(e,!1,function(){return Ft}),n.d(e,"_9",function(){return Bt}),n.d(e,"_10",function(){return jt.a}),n.d(e,"_11",function(){return $t}),n.d(e,"_12",function(){return Ut}),n.d(e,"_13",function(){return Vt}),n.d(e,"_14",function(){return Ht}),n.d(e,"_15",function(){return Wt}),n.d(e,"_16",function(){return Gt}),n.d(e,!1,function(){return Yt}),n.d(e,"_17",function(){return Qt}),n.d(e,!1,function(){return ee}),n.d(e,"_18",function(){return ne}),n.d(e,"_19",function(){return re}),n.d(e,"_20",function(){return ie}),n.d(e,!1,function(){return oe}),n.d(e,"_21",function(){return A.a}),n.d(e,"_22",function(){return qt}),n.d(e,"_23",function(){return se}),n.d(e,"_24",function(){return ae}),n.d(e,"_25",function(){return le}),n.d(e,"_26",function(){return ue.a}),n.d(e,"_27",function(){return ce}),n.d(e,!1,function(){return ge}),n.d(e,"_28",function(){return me}),n.d(e,"_29",function(){return ve}),n.d(e,"_30",function(){return be}),n.d(e,"_31",function(){return _e}),n.d(e,!1,function(){return Te}),n.d(e,"_32",function(){return N.a}),n.d(e,!1,function(){return xe}),n.d(e,"_33",function(){return Ee}),n.d(e,"_34",function(){return Xt}),n.d(e,"_35",function(){return we}),n.d(e,"_36",function(){return Ce.a}),n.d(e,"_37",function(){return de}),n.d(e,"_38",function(){return Se}),n.d(e,!1,function(){return ke}),n.d(e,"_39",function(){return Oe}),n.d(e,!1,function(){return Ie}),n.d(e,!1,function(){return Re}),n.d(e,!1,function(){return Ae}),n.d(e,!1,function(){return Ne}),n.d(e,!1,function(){return Me}),n.d(e,"_40",function(){return Le.a}),n.d(e,"_41",function(){return Pe.a}),n.d(e,!1,function(){return Fe.a}),n.d(e,"_42",function(){return Be}),n.d(e,!1,function(){return je}),n.d(e,!1,function(){return We}),n.d(e,!1,function(){return Ge}),n.d(e,"_43",function(){return ze}),n.d(e,"_44",function(){return Xe}),n.d(e,"_45",function(){return Ke}),n.d(e,"_46",function(){return Ye}),n.d(e,"_47",function(){return qe.a}),n.d(e,"_48",function(){return Je.a}),n.d(e,"_49",function(){return S.a}),n.d(e,"_50",function(){return Ze}),n.d(e,!1,function(){return Qe}),n.d(e,!1,function(){return tn}),n.d(e,!1,function(){return en}),n.d(e,!1,function(){return nn}),n.d(e,"_52",function(){return rn}),n.d(e,"_53",function(){return on}),n.d(e,"_54",function(){return sn.a}),n.d(e,"_56",function(){return an}),n.d(e,!1,function(){return ln}),n.d(e,"_57",function(){return un}),n.d(e,"_58",function(){return D.a}),n.d(e,"_59",function(){return cn}),n.d(e,"_60",function(){return hn}),n.d(e,"_61",function(){return dn}),n.d(e,"_62",function(){return M}),n.d(e,!1,function(){return pn}),n.d(e,!1,function(){return fn}),n.d(e,!1,function(){return gn}),n.d(e,!1,function(){return mn}),n.d(e,"_63",function(){return vn}),n.d(e,"_64",function(){return Kt}),n.d(e,"_65",function(){return De}),n.d(e,"W",function(){return bn}),n.d(e,"_5",function(){return _n}),n.d(e,"_8",function(){return yn}),n.d(e,"_51",function(){return xn}),n.d(e,"_68",function(){return Tn}),n.d(e,"_69",function(){return En.a}),n.d(e,"_70",function(){return ye.a}),n.d(e,"_71",function(){return wn}),n.d(e,"_72",function(){return Cn}),n.d(e,"_73",function(){return Sn}),n.d(e,!1,function(){return kn.a}),n.d(e,"_74",function(){return On}),n.d(e,"_76",function(){return Jt.a}),n.d(e,"_77",function(){return Zt.a}),n.d(e,"_78",function(){return In}),n.d(e,"_79",function(){return L}),n.d(e,"_80",function(){return Rn.a}),n.d(e,"_81",function(){return Nn}),n.d(e,"_82",function(){return Dn}),n.d(e,!1,function(){return Mn.a}),n.d(e,!1,function(){return Ln}),n.d(e,!1,function(){return Pn}),n.d(e,!1,function(){return Fn}),n.d(e,"_83",function(){return kt}),n.d(e,"_84",function(){return Bn}),n.d(e,"_86",function(){return jn}),n.d(e,"_87",function(){return $n}),n.d(e,!1,function(){return Un}),n.d(e,"_88",function(){return Vn}),n.d(e,!1,function(){return Hn}),n.d(e,"_89",function(){return vt}),n.d(e,"_90",function(){return Gn}),n.d(e,"_91",function(){return he}),n.d(e,"_92",function(){return bt.a}),n.d(e,!1,function(){return zn}),n.d(e,"_85",function(){return Xn.a}),n.d(e,!1,function(){return Kn}),n.d(e,!1,function(){return Yn}),n.d(e,"_55",function(){return Jn}),n.d(e,"_67",function(){return Zn}),n.d(e,"_2",function(){return Qn}),n.d(e,!1,function(){return tr}),n.d(e,!1,function(){return er}),n.d(e,!1,function(){return nr}),n.d(e,!1,function(){return rr}),n.d(e,!1,function(){return l.a}),n.d(e,!1,function(){}),n.d(e,"_0",function(){return r});
  5078. /**
  5079. * @license
  5080. * Copyright 2020 Google LLC. All Rights Reserved.
  5081. * Licensed under the Apache License, Version 2.0 (the "License");
  5082. * you may not use this file except in compliance with the License.
  5083. * You may obtain a copy of the License at
  5084. *
  5085. * http://www.apache.org/licenses/LICENSE-2.0
  5086. *
  5087. * Unless required by applicable law or agreed to in writing, software
  5088. * distributed under the License is distributed on an "AS IS" BASIS,
  5089. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5090. * See the License for the specific language governing permissions and
  5091. * limitations under the License.
  5092. * =============================================================================
  5093. */
  5094. const $r={flipLeftRight:fr,grayscaleToRGB:gr,resizeNearestNeighbor:Sr,resizeBilinear:Cr,rotateWithOffset:mr,cropAndResize:pr,nonMaxSuppression:br,nonMaxSuppressionAsync:yr,nonMaxSuppressionWithScore:Tr,nonMaxSuppressionWithScoreAsync:xr,nonMaxSuppressionPadded:Er,nonMaxSuppressionPaddedAsync:wr,threshold:kr,transform:Or},Ur={sparseFillEmptyRows:Dr,sparseReshape:Mr,sparseSegmentMean:Lr,sparseSegmentSum:Pr},Vr={stringNGrams:Fr,stringSplit:Br,stringToHashBucketFast:jr}},mClu:function(t,e,n){var r=n("kM2E");r(r.S+r.F*!n("+E39"),"Object",{defineProperty:n("evD5").f})},mP1F:function(t,e,n){var r;r=function(t){return function(e){var n=t,r=n.lib,i=r.WordArray,o=r.Hasher,s=n.algo,a=[],l=[];!function(){function t(t){for(var n=e.sqrt(t),r=2;r<=n;r++)if(!(t%r))return!1;return!0}function n(t){return 4294967296*(t-(0|t))|0}for(var r=2,i=0;i<64;)t(r)&&(i<8&&(a[i]=n(e.pow(r,.5))),l[i]=n(e.pow(r,1/3)),i++),r++}();var u=[],c=s.SHA256=o.extend({_doReset:function(){this._hash=new i.init(a.slice(0))},_doProcessBlock:function(t,e){for(var n=this._hash.words,r=n[0],i=n[1],o=n[2],s=n[3],a=n[4],c=n[5],h=n[6],d=n[7],p=0;p<64;p++){if(p<16)u[p]=0|t[e+p];else{var f=u[p-15],g=(f<<25|f>>>7)^(f<<14|f>>>18)^f>>>3,m=u[p-2],v=(m<<15|m>>>17)^(m<<13|m>>>19)^m>>>10;u[p]=g+u[p-7]+v+u[p-16]}var b=r&i^r&o^i&o,_=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),y=d+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+(a&c^~a&h)+l[p]+u[p];d=h,h=c,c=a,a=s+y|0,s=o,o=i,i=r,r=y+(_+b)|0}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+o|0,n[3]=n[3]+s|0,n[4]=n[4]+a|0,n[5]=n[5]+c|0,n[6]=n[6]+h|0,n[7]=n[7]+d|0},_doFinalize:function(){var t=this._data,n=t.words,r=8*this._nDataBytes,i=8*t.sigBytes;return n[i>>>5]|=128<<24-i%32,n[14+(i+64>>>9<<4)]=e.floor(r/4294967296),n[15+(i+64>>>9<<4)]=r,t.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t}});n.SHA256=o._createHelper(c),n.HmacSHA256=o._createHmacHelper(c)}(Math),t.SHA256},t.exports=r(n("02Hb"))},msXi:function(t,e,n){var r=n("77Pl");t.exports=function(t,e,n,i){try{return i?e(r(n)[0],n[1]):e(n)}catch(e){var o=t.return;throw void 0!==o&&r(o.call(t)),e}}},mtWM:function(t,e,n){t.exports=n("tIFN")},mtrD:function(t,e){t.exports=function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/dist/",n(n.s=86)}({0:function(t,e,n){"use strict";function r(t,e,n,r,i,o,s,a){var l,u="function"==typeof t?t.options:t;if(e&&(u.render=e,u.staticRenderFns=n,u._compiled=!0),r&&(u.functional=!0),o&&(u._scopeId="data-v-"+o),s?(l=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(s)},u._ssrRegister=l):i&&(l=a?function(){i.call(this,this.$root.$options.shadowRoot)}:i),l)if(u.functional){u._injectStyles=l;var c=u.render;u.render=function(t,e){return l.call(e),c(t,e)}}else{var h=u.beforeCreate;u.beforeCreate=h?[].concat(h,l):[l]}return{exports:t,options:u}}n.d(e,"a",function(){return r})},86:function(t,e,n){"use strict";n.r(e);var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("button",{staticClass:"el-button",class:[t.type?"el-button--"+t.type:"",t.buttonSize?"el-button--"+t.buttonSize:"",{"is-disabled":t.buttonDisabled,"is-loading":t.loading,"is-plain":t.plain,"is-round":t.round,"is-circle":t.circle}],attrs:{disabled:t.buttonDisabled||t.loading,autofocus:t.autofocus,type:t.nativeType},on:{click:t.handleClick}},[t.loading?n("i",{staticClass:"el-icon-loading"}):t._e(),t.icon&&!t.loading?n("i",{class:t.icon}):t._e(),t.$slots.default?n("span",[t._t("default")],2):t._e()])};r._withStripped=!0;var i={name:"ElButton",inject:{elForm:{default:""},elFormItem:{default:""}},props:{type:{type:String,default:"default"},size:String,icon:{type:String,default:""},nativeType:{type:String,default:"button"},loading:Boolean,disabled:Boolean,plain:Boolean,autofocus:Boolean,round:Boolean,circle:Boolean},computed:{_elFormItemSize:function(){return(this.elFormItem||{}).elFormItemSize},buttonSize:function(){return this.size||this._elFormItemSize||(this.$ELEMENT||{}).size},buttonDisabled:function(){return this.disabled||(this.elForm||{}).disabled}},methods:{handleClick:function(t){this.$emit("click",t)}}},o=n(0),s=Object(o.a)(i,r,[],!1,null,null,null);s.options.__file="packages/button/src/button.vue";var a=s.exports;a.install=function(t){t.component(a.name,a)};e.default=a}})},mvHQ:function(t,e,n){t.exports={default:n("qkKv"),__esModule:!0}},mw3O:function(t,e,n){"use strict";var r=n("CwSZ"),i=n("DDCP"),o=n("XgCd");t.exports={formats:o,parse:i,stringify:r}},n0T6:function(t,e,n){var r=n("Ibhu"),i=n("xnc9").concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,i)}},nErl:function(t,e){(function(e){t.exports=e}).call(e,{})},ngdQ:function(t,e,n){"use strict";
  5095. /**
  5096. * @license
  5097. * Copyright 2020 Google LLC. All Rights Reserved.
  5098. * Licensed under the Apache License, Version 2.0 (the "License");
  5099. * you may not use this file except in compliance with the License.
  5100. * You may obtain a copy of the License at
  5101. *
  5102. * http://www.apache.org/licenses/LICENSE-2.0
  5103. *
  5104. * Unless required by applicable law or agreed to in writing, software
  5105. * distributed under the License is distributed on an "AS IS" BASIS,
  5106. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5107. * See the License for the specific language governing permissions and
  5108. * limitations under the License.
  5109. * =============================================================================
  5110. */const r=1e-7,i=1e-4;e.a=class{constructor(t,e){this.backend=t,this.dataMover=e,this.data=new WeakMap,this.dataIdsCount=0}get(t){return this.data.has(t)||this.dataMover.moveData(this.backend,t),this.data.get(t)}set(t,e){this.dataIdsCount++,this.data.set(t,e)}has(t){return this.data.has(t)}delete(t){return this.dataIdsCount--,this.data.delete(t)}numDataIds(){return this.dataIdsCount}};function o(t){throw new Error(`'${t}' not yet implemented or not found in the registry. `+"This kernel may not be supported by the tfjs backend you have chosen")}e.b=class{refCount(t){return o("refCount")}incRef(t){return o("incRef")}timerAvailable(){return!0}time(t){return o("time")}read(t){return o("read")}readSync(t){return o("readSync")}readToGPU(t,e){return o("readToGPU")}numDataIds(){return o("numDataIds")}disposeData(t,e){return o("disposeData")}write(t,e,n){return o("write")}move(t,e,n,r,i){return o("move")}memory(){return o("memory")}floatPrecision(){return o("floatPrecision")}epsilon(){return 32===this.floatPrecision()?r:i}dispose(){return o("dispose")}}},nvbp:function(t,e){var n=/^(attrs|props|on|nativeOn|class|style|hook)$/;function r(t,e){return function(){t&&t.apply(this,arguments),e&&e.apply(this,arguments)}}t.exports=function(t){return t.reduce(function(t,e){var i,o,s,a,l;for(s in e)if(i=t[s],o=e[s],i&&n.test(s))if("class"===s&&("string"==typeof i&&(l=i,t[s]=i={},i[l]=!0),"string"==typeof o&&(l=o,e[s]=o={},o[l]=!0)),"on"===s||"nativeOn"===s||"hook"===s)for(a in o)i[a]=r(i[a],o[a]);else if(Array.isArray(i))t[s]=i.concat(o);else if(Array.isArray(o))t[s]=[i].concat(o);else for(a in o)i[a]=o[a];else t[s]=e[s];return t},{})}},oJlt:function(t,e,n){"use strict";var r=n("cGG2"),i=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];t.exports=function(t){var e,n,o,s={};return t?(r.forEach(t.split("\n"),function(t){if(o=t.indexOf(":"),e=r.trim(t.substr(0,o)).toLowerCase(),n=r.trim(t.substr(o+1)),e){if(s[e]&&i.indexOf(e)>=0)return;s[e]="set-cookie"===e?(s[e]?s[e]:[]).concat([n]):s[e]?s[e]+", "+n:n}}),s):s}},oPgp:function(t,e,n){var r;"undefined"!=typeof self&&self,r=function(){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="/dist/",e(e.s=2)}([function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACIAAAHXCAMAAADusXjuAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAMAUExURQAAAGdtcwAAAAAAAAAAAAAAAAAAABmR+gECAgAAAAAAAAAAAAAAAAAAAAAAAPf49QAAAAAAAAAAAAAAAAAAALLS/QICAgEBAf///wAAAGS1/P///////wAAAP///xyS+gAAAN3q/pWbof///6Gqs////wAAAAAAACCV+v///zef+5LL/Xq2+woKCkVJTZWdppefqAIDAv///////////5WdpqvX/Z/R/Vyx/KDS/Zyjq5mhqpefqP///2ltcGdtczub+pafqP///0VJTY2hp5WdpgAAAGdtc////0Gk+3e//P///////yDIrvBnZ////8zQ1P////////b39P///6Kqsv///////5WdppefqP////T18pWdppWdpiDIrubw/gICAvb39P///yDIriaX+pWdpUan+5rP/R4eHr2+u////////////5Wdpv///////5WdpuHi3/Lz8Git+8nf/Wdtc/////////Dx7v///9LS0JWdpiDIrvBnZ/BnZ77Z/ZWdppWdppWdpuDh3uzt6q6vrZWdpmdtc+rr6dPU0cvLydbX1JWdpkVJTZnF/O71/vf6//BnZ2dtc////////9LT0Ovs6ru8uZWdppWdppWdpjM0M5WdppWdppWdplSl+/BnZ+bn5O7v7AMDA6Gqs2dtc////77g/v///6TT/bfc/Vau+3vA/P///////4TE/P///////////6bU/f///////7W2szIzMozI/P///2y5/P///y6b+pWdpoq+/KbM/JWdpv///////////yDIriDIrqGqs2dtc6Gqs6Gqs6Gqs////2dtc0VJTZWdpmdtc////x0dHZWdptPl/kVJTSDIriDIrmdtc6iopsDBvvX282FmaWdtc5Wdpv///yDIriDIrvBnZ2dtc6Gqs6Gqs6Gqs2dtc2dtc2dtc2dtc/BnZ35+ffBnZ0VJTWdtc2dtc2dtc35+ff///2dtc9/g3oOKkp6nsL3CyP7//v///6Gqs/f49fBnZyDIrmdtc0VJTdgAqpkAAAD5dFJOUwDMDxgGBArMAQIMDhYDB5kFEwkVHeUfHHgU2tgZEafMIvJD5Oc+GxrNk9Ll2SZF6wgeuJWKBern2ecCKBbdOcTPPfnsETIgD8XU3yDLCoH7AY4P+RVJhtUiGx3mSHm/9SmWNgfOT9XmIVgHuR9Z9EVxmtzW7LALI4uwfae3kIrpC+FncYlH1rmzamaBjD3f+fyLyk0vYYVUz/OFHZW9ntLzfssv/gqY7nvo7NffbF/hHls56G+iSybjftzp0LHc4rfO0Ty4p+7AecaT8HLUYCBJHP3vefL3o15qlC6Nx8KyeOme9lSkam2nFndNdTx4iJEzUhs/O+UL41+/HMAAAAwESURBVHja7Zl5fFNVFsdT0iSleW3SJk0oGkwCJAIJJGhcktJFm4hSa6EsrdBpq9YBFagUZBuHUqCyVMCFfZPF2fcFZoZh0xEBERFcUXFfZl/+u6TOzLn3LXlJ3r0v6EeoMz2fD/al79t7lnvOL/c9NZqEXfnMaA3brrwCPaNKXHHlFyXOT7pTbY0qNOpOFS/jJwGjEgdm1CIFRi0XzfiqIyrEJbbR58epIedRlRozriojZjTNgcxGf1HkIoLJINwMks6gdJfMyspuUUX+naXG3JKVEVNGcyCzsi+KXEQwGYSbQdIZlO4rtxeHCxfDX6Qhj97MM8NvHq5hMyyCZ9gEZl5RITSaV/7zigoxXHUVHMejTIaPlMWIuTAYqbp/ffGy7/TGKcKFezENqRjBM+4Rbg2bYRE8wyYw06BCaDQNZxpUCDesMkWFcEt50QkNkxFzYTAbxVwqOnvUt6zm7udefU+F+Nbnn7+mSnz+rirxjdvTb7z32rv8b+/+A4XQvCr8/nYqoXmOv8MghAgqGYTAvMoiBIZJMLJNqvtrz93eA/ZfOKmyzsz8SZV5ZiYn1Z5zmgUvQsyss/skJkMiHc9ihFxYzBEhUmAmUZCR4rl7fNX5y90M1U9VixcPU5D3u7vJrW93d3dTkD91EwYT1VRPmMHEY4xouok9xoxYlSBxdD+sSjAZEmk1i6nm46hmJP2UECkwT9H8iBvwl/ere4A4jDs9cfSMqrFP0B4nZo49cof47HNk7EwlRLg/iv95hxKCH5wmnh6neWjmxCq4VkZeEC9r1JGHmMgoMWI6gljITQiFE6uMUkJAfp5UKe01CF2rgtyF0Iy55Or0/hdGKTPzBaGbux+hsRS9HIjQ/n/VnAbimYcoruYCg/YjpmqOn08SHjmeFfPgATPmz+wRB5unSz/9oOz1k6W0Z6jSk68/nsXb45+dLFVC+PuPzxF+KiHw+w8+KX0avH3yOlwrI9LzZA4VeV4Km4nMESJmIFkspCwrK5xYZY4SAjdfUint37KyPlVB3oKs+WVKH3l+jjLzNkTwR/j50iNZWScpD9Jw65HSnFL48dnTFFf4z7PwP7IYZZ23ScL/YD5Qv/X3srdLL3/jThh0gWGDJgDCJIAB5MIFlg9y9+uJTBhESiAVS/gkRwbxJRBM+nSRSAaO/veqCxb46MTxQXv2DDp+4qOAIlJ/4mii146eqE9Hjn144cLxYxUl4XBJxbHjey58eCwNObrn40gihMjHe46mIZFIcpzC569jdTMY2AzG/jJYe8vmAxsXL+7c1tXSrgjUb+5cDDYCbNOmEVvr0oBA68bOzoUd0ZJQqCTaenjTpk2bAylLLOzs3Cz7w7qtm85sTFoosm3j4ZRmiHaeWRyVrXH4ne2Vqa5Ltp2RxbH9na2h9PhDmpqweN3xzkLlJMNhganfti2iXKiaUKiGXLRuo76UCgVIAIEDh+tpSE0ggJepONxF35NAO16m9UALHQm14xp3HYjQkXAlznX7gUo6UlOJby5cGGI0SAZISQn8Z+tChqMwQRq2M8IN1WPk1HbGm7r2euwiur2VEUodTjrQtbWE6qeujuz19K3T6Yvwf13S1UXZx0AkIhSkpatVsTThSEQMIdS6+VRYofh10Yj068qGzdND6WtEo7JRqm9t6EhJqz1aEU3q6MqOhtYplfJAKyqiKeMYqmhtbW2JlgTC4UBlXcUUd0VdeniV7o6OjlOnpk+f3tIyxR1pp9SyogUT7mh9+PKeqX7W7/6BN824YmS/MRTg2QGJ/4s34Fkl4lq4c33/oVffc2//65HSw9t9QxAadpVBsKuGIXTNfekPff0NMrsBmDQvtxqS7NYUX88idIMhxWCdwTJkABom3vH5dghXw9CABPEAQkKkh9ZCMmfL+ZgRekBC+qEbhb90NRYtQqiI/3Aj6pd4dSVl0wb/FiEX/6E/GikhA9FQWZyL0Gz+YigaKHuevjpBlK9FPv7qanSTIlLeiBYZ0hGZIyBmi9dyR/dL4cqJpHClpDHh8/na0pMeI5bOx3eLSyzdGPkG3EZ+u6OI2Gry4Tb5BmgGI/T71G28NXkbNUPQdanIdWhI8jtIlNhr3n6Jfp3ylP/zlI6BzvxFavNORN+VET9C6CfpE/Ad9H2J+CFC31MYkicR+qlA3PMDyguJHyN0r5jMNZRxHCtkDpM2l/blNB9dD8RvEHqCOvYzEWzE7xD6FUMa+iH0TYQmMuUDJjul7gpva357V4947/H/q3XyDlfUuiKSso+ldUVojcvlamNpXZEohXStS0KUtQ7Hsma1gaV1q10uEOeDTK3D8ozOsrSOd+ZiaJ3h0A6Db42SwEtaB07AGssZWmc4eNblOsQTvVrXq3W9WndZtY6XGANL6+DYhkSEonUGQ+MaCaGc64rQQQlR1ro2OLFJiLLWNa4pV0YkR6CpPjhy+crpWucSNtpH17o2ONQlVlHWOmyy0ilpHQmoqFfrerWuV+u+aq0r9wnTStW61TjjRUytKzpbNBuh1Sytw04axVMQ9Rm2fI34gEp5hl3kWru2iKl1WKfWqjzDGmQnsi9zrtshPekyznVrdzDPdbN7z3W9WterdZfmXFfepqJ1sxvFoae+r5PeSlG17mBbUQKhaZ0Mob2vkyG093UUJANHcq2jhJtIus03GzX6fKpaJxzsKFq3mn9h16t1vVp3CS0nyRTv9+2bl6cjlpfXt28aRwCdOTuft2yzhMmWyNNl5xfq9blger2+MD8bY5gSl4AVAMg19nFg62MEDiizxPBLAOBwFBRbLJbi4gKCFebjhXLIIjzhKLBwWmxe+MdZChy5emAwAm4wYXQUc1tWLp9cWztr+cp9tqDdyzmMwOTlEDdmTFi0K2fFBZv1pt+5axfnyC3M5hEd9mJ5+UG4tcq9b597FaAPNsXjHksffb4uBy+SXZjrKNY+GK9dYLOCxZz+BbVx+AMrLJOv68svYizgVsZrp1ntEKnXGvM3vVEL7mxaAckzwyKWLZPjC6weLcdZOG/Q2dS0IAnJhli5FfFZU+1arhhKw3liu0jQQREBP30KtMvjq6xeIIy5fRycnSC7+FhyMIKDnRx327UWqBZsg4Pz2JxOp81rceglxKKtjU/1cAWQZDYJ3hO02excgVGP65KKmHEJLFoPZGcRSic4miU6yseV5rSef05eWgyImUfk4UK74N3SelbFl5NFYRtTk4aOAcJrnxVfgbdRR5BE6ey4B3BLeD0L4pO3YLcESdkADgP2abXxdcWJjU7aRrvHY7cG8Tby+eWRpiPLODihGaYKzfAyTpn4SbQUJ2+plVAA0nNC6wqNaeG2rMCNOXn5ii0cIbJ14gDw7W2U2pv0NiHyxFFLGRI8IsZcQvRNDGPyqMEI6YUZytHQBraQXyJp7pPHPmmcmeJx8RLU8+RQpzOD6XQ0OSRlKQSDypjNunQ5hB3Ih+Iawfj65qfJobiP2BxkH/E2yeUQ9ifRDaAPMP/GxGbjfiFqiGfDGgwGbUFoYTww0N6SHGKiWGufumzJvOZzS5dM8PudMTz1uaIc6vgxti5bahJsaUtT086dHkEZAIHuhjWC60ym9dNK/f7SaetNpjd3m0wxraAv/KhpretMzRv8ICtOf9PuN86Z3jSZnJ5iIww1WQREx77M1OyGACBYZ9Pu3X9uBnd+q8VYaBa0rkA7dZ5pgzMGmq312mCZ3W8QhOtDEPDj4Lx7Tev9sSBOlfPG/DtJ0DIE+1limuYE6YKKgdLFCLITx1KIwzUX4mDnmUpjVi1US693WDwgzk1Nfpu2gM/IjEMJNpv8MTsW0Xzs1w4iTz7rZcg5EckmRYIvAqcNFtXn50mOlgqOeN2F74G35q3TykVVChfG3Yh3KxibZlqCv4+IHCYlDSlBR3itNud6017sV1LMROmw1nmsttgG07yXcSi8HCZtgNVuByDmbjYtw/oubHTSNsbAnM4N50zrPJwg3mIzWLzBFfJmWAHpCeKdaCmvvKWWWbUWqS+lxrRAY+6Fxmyet2TvVOErQyaHZqG9sSwHiYbz3/VyOTTzQ8Jx/IxgwSwUVVdp1GSCmSSH8oHV6/PJgSJNDvmxJ+OcnRhVtnhkLkH/BUTDFxXJeg2PAAAAAElFTkSuQmCC"},function(t,e,n){"use strict";function r(t,e){return t+e}function i(t){return t*t}var o=Math.PI;e.a={name:"SlideVerify",props:{l:{type:Number,default:42},r:{type:Number,default:10},w:{type:Number,default:310},h:{type:Number,default:155},sliderText:{type:String,default:"Slide filled right"},accuracy:{type:Number,default:5},show:{type:Boolean,default:!0},imgs:{type:Array,default:function(){return[]}}},data:function(){return{containerActive:!1,containerSuccess:!1,containerFail:!1,canvasCtx:null,blockCtx:null,block:null,block_x:void 0,block_y:void 0,L:this.l+2*this.r+3,img:void 0,originX:void 0,originY:void 0,isMouseDown:!1,trail:[],sliderLeft:0,sliderMaskWidth:0,success:!1,loadBlock:!0,timestamp:null}},mounted:function(){this.init()},methods:{init:function(){this.initDom(),this.initImg(),this.bindEvents()},initDom:function(){this.block=this.$refs.block,this.canvasCtx=this.$refs.canvas.getContext("2d"),this.blockCtx=this.block.getContext("2d")},initImg:function(){var t=this,e=this.createImg(function(){t.loadBlock=!1,t.drawBlock(),t.canvasCtx.drawImage(e,0,0,t.w,t.h),t.blockCtx.drawImage(e,0,0,t.w,t.h);var n=t.block_x,r=t.block_y,i=t.r,o=t.L,s=r-2*i-1,a=t.blockCtx.getImageData(n,s,o,o);t.block.width=o,t.blockCtx.putImageData(a,0,s)});this.img=e},drawBlock:function(){this.block_x=this.getRandomNumberByRange(this.L+10,this.w-(this.L+10)),this.block_y=this.getRandomNumberByRange(10+2*this.r,this.h-(this.L+10)),this.draw(this.canvasCtx,this.block_x,this.block_y,"fill"),this.draw(this.blockCtx,this.block_x,this.block_y,"clip")},draw:function(t,e,n,r){var i=this.l,s=this.r;t.beginPath(),t.moveTo(e,n),t.arc(e+i/2,n-s+2,s,.72*o,2.26*o),t.lineTo(e+i,n),t.arc(e+i+s-2,n+i/2,s,1.21*o,2.78*o),t.lineTo(e+i,n+i),t.lineTo(e,n+i),t.arc(e+s-2,n+i/2,s+.4,2.76*o,1.24*o,!0),t.lineTo(e,n),t.lineWidth=2,t.fillStyle="rgba(255, 255, 255, 0.7)",t.strokeStyle="rgba(255, 255, 255, 0.7)",t.stroke(),t[r](),t.globalCompositeOperation="destination-over"},createImg:function(t){var e=this,n=document.createElement("img");return n.crossOrigin="Anonymous",n.onload=t,n.onerror=function(){n.src=e.getRandomImg()},n.src=this.getRandomImg(),n},getRandomImg:function(){var t=this.imgs.length;return t>0?this.imgs[this.getRandomNumberByRange(0,t)]:"https://picsum.photos/300/150/?image="+this.getRandomNumberByRange(0,1084)},getRandomNumberByRange:function(t,e){return Math.round(Math.random()*(e-t)+t)},refresh:function(){this.reset(),this.$emit("refresh")},sliderDown:function(t){this.success||(this.originX=t.clientX,this.originY=t.clientY,this.isMouseDown=!0,this.timestamp=+new Date)},touchStartEvent:function(t){this.success||(this.originX=t.changedTouches[0].pageX,this.originY=t.changedTouches[0].pageY,this.isMouseDown=!0,this.timestamp=+new Date)},bindEvents:function(){var t=this;document.addEventListener("mousemove",function(e){if(!t.isMouseDown)return!1;var n=e.clientX-t.originX,r=e.clientY-t.originY;if(n<0||n+38>=t.w)return!1;t.sliderLeft=n+"px";var i=(t.w-40-20)/(t.w-40)*n;t.block.style.left=i+"px",t.containerActive=!0,t.sliderMaskWidth=n+"px",t.trail.push(r)}),document.addEventListener("mouseup",function(e){if(!t.isMouseDown)return!1;if(t.isMouseDown=!1,e.clientX===t.originX)return!1;t.containerActive=!1,t.timestamp=+new Date-t.timestamp;var n=t.verify(),r=n.spliced,i=n.TuringTest;if(r){if(-1===t.accuracy)return t.containerSuccess=!0,t.success=!0,void t.$emit("success",t.timestamp);i?(t.containerSuccess=!0,t.success=!0,t.$emit("success",t.timestamp)):(t.containerFail=!0,t.$emit("again"))}else t.containerFail=!0,t.$emit("fail"),setTimeout(function(){t.reset()},1e3)})},touchMoveEvent:function(t){if(!this.isMouseDown)return!1;var e=t.changedTouches[0].pageX-this.originX,n=t.changedTouches[0].pageY-this.originY;if(e<0||e+38>=this.w)return!1;this.sliderLeft=e+"px";var r=(this.w-40-20)/(this.w-40)*e;this.block.style.left=r+"px",this.containerActive=!0,this.sliderMaskWidth=e+"px",this.trail.push(n)},touchEndEvent:function(t){var e=this;if(!this.isMouseDown)return!1;if(this.isMouseDown=!1,t.changedTouches[0].pageX===this.originX)return!1;this.containerActive=!1,this.timestamp=+new Date-this.timestamp;var n=this.verify(),r=n.spliced,i=n.TuringTest;if(r){if(-1===this.accuracy)return this.containerSuccess=!0,this.success=!0,void this.$emit("success",this.timestamp);i?(this.containerSuccess=!0,this.success=!0,this.$emit("success",this.timestamp)):(this.containerFail=!0,this.$emit("again"))}else this.containerFail=!0,this.$emit("fail"),setTimeout(function(){e.reset()},1e3)},verify:function(){var t=this.trail,e=t.reduce(r)/t.length,n=t.map(function(t){return t-e}),o=Math.sqrt(n.map(i).reduce(r)/t.length),s=parseInt(this.block.style.left),a=this.accuracy<=1?1:this.accuracy>10?10:this.accuracy;return{spliced:Math.abs(s-this.block_x)<=a,TuringTest:e!==o}},reset:function(){this.success=!1,this.containerActive=!1,this.containerSuccess=!1,this.containerFail=!1,this.sliderLeft=0,this.block.style.left=0,this.sliderMaskWidth=0;var t=this.w,e=this.h;this.canvasCtx.clearRect(0,0,t,e),this.blockCtx.clearRect(0,0,t,e),this.block.width=t,this.img.src=this.getRandomImg(),this.$emit("fulfilled")}}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(3),i={install:function(t){t.component(r.a.name,r.a)}};"undefined"!=typeof window&&window.Vue&&window.Vue.use(r.a),e.default=i},function(t,e,n){"use strict";var r=n(1),i=n(11),o=function(t){n(4)},s=n(10)(r.a,i.a,!1,o,"data-v-b2d04a40",null);e.a=s.exports},function(t,e,n){var r=n(5);"string"==typeof r&&(r=[[t.i,r,""]]),r.locals&&(t.exports=r.locals),n(8)("6b4c9876",r,!0,{})},function(t,e,n){var r=n(6);(t.exports=n(7)(!1)).push([t.i,".slide-verify[data-v-b2d04a40]{position:relative}.slider-verify-loading[data-v-b2d04a40]{position:absolute;top:0;right:0;left:0;bottom:0;background:hsla(0,0%,100%,.9);z-index:999;animation:loading-data-v-b2d04a40 1.5s infinite}@keyframes loading-data-v-b2d04a40{0%{opacity:.7}to{opacity:1}}.slide-verify-block[data-v-b2d04a40]{position:absolute;left:0;top:0}.slide-verify-refresh-icon[data-v-b2d04a40]{position:absolute;right:0;top:0;width:34px;height:34px;cursor:pointer;background:url("+r(n(0))+") 0 -437px;background-size:34px 471px}.slide-verify-slider[data-v-b2d04a40]{position:relative;text-align:center;width:100%;height:40px;line-height:40px;margin-top:15px;background:#f7f9fa;color:#45494c;border:1px solid #e4e7eb}.slide-verify-slider-mask[data-v-b2d04a40]{position:absolute;left:0;top:0;height:40px;border:0 solid #1991fa;background:#d1e9fe}.slide-verify-slider-mask-item[data-v-b2d04a40]{position:absolute;top:0;left:0;width:40px;height:40px;background:#fff;box-shadow:0 0 3px rgba(0,0,0,.3);cursor:pointer;transition:background .2s linear}.slide-verify-slider-mask-item[data-v-b2d04a40]:hover{background:#1991fa}.slide-verify-slider-mask-item:hover .slide-verify-slider-mask-item-icon[data-v-b2d04a40]{background-position:0 -13px}.slide-verify-slider-mask-item-icon[data-v-b2d04a40]{position:absolute;top:15px;left:13px;width:14px;height:12px;background:url("+r(n(0))+") 0 -26px;background-size:34px 471px}.container-active .slide-verify-slider-mask-item[data-v-b2d04a40]{height:38px;top:-1px;border:1px solid #1991fa}.container-active .slide-verify-slider-mask[data-v-b2d04a40]{height:38px;border-width:1px}.container-success .slide-verify-slider-mask-item[data-v-b2d04a40]{height:38px;top:-1px;border:1px solid #52ccba;background-color:#52ccba!important}.container-success .slide-verify-slider-mask[data-v-b2d04a40]{height:38px;border:1px solid #52ccba;background-color:#d2f4ef}.container-success .slide-verify-slider-mask-item-icon[data-v-b2d04a40]{background-position:0 0!important}.container-fail .slide-verify-slider-mask-item[data-v-b2d04a40]{height:38px;top:-1px;border:1px solid #f57a7a;background-color:#f57a7a!important}.container-fail .slide-verify-slider-mask[data-v-b2d04a40]{height:38px;border:1px solid #f57a7a;background-color:#fce1e1}.container-fail .slide-verify-slider-mask-item-icon[data-v-b2d04a40]{top:14px;background-position:0 -82px!important}.container-active .slide-verify-slider-text[data-v-b2d04a40],.container-fail .slide-verify-slider-text[data-v-b2d04a40],.container-success .slide-verify-slider-text[data-v-b2d04a40]{display:none}",""])},function(t,e){t.exports=function(t){return"string"!=typeof t?t:(/^['"].*['"]$/.test(t)&&(t=t.slice(1,-1)),/["'() \t\n]/.test(t)?'"'+t.replace(/"/g,'\\"').replace(/\n/g,"\\n")+'"':t)}},function(t,e){function n(t,e){var n=t[1]||"",r=t[3];if(!r)return n;if(e&&"function"==typeof btoa){var i=function(t){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(t))))+" */"}(r);return[n].concat(r.sources.map(function(t){return"/*# sourceURL="+r.sourceRoot+t+" */"})).concat([i]).join("\n")}return[n].join("\n")}t.exports=function(t){var e=[];return e.toString=function(){return this.map(function(e){var r=n(e,t);return e[2]?"@media "+e[2]+"{"+r+"}":r}).join("")},e.i=function(t,n){"string"==typeof t&&(t=[[null,t,""]]);for(var r={},i=0;i<this.length;i++){var o=this[i][0];"number"==typeof o&&(r[o]=!0)}for(i=0;i<t.length;i++){var s=t[i];"number"==typeof s[0]&&r[s[0]]||(n&&!s[2]?s[2]=n:n&&(s[2]="("+s[2]+") and ("+n+")"),e.push(s))}},e}},function(t,e,n){function r(t){for(var e=0;e<t.length;e++){var n=t[e],r=u[n.id];if(r){r.refs++;for(var i=0;i<r.parts.length;i++)r.parts[i](n.parts[i]);for(;i<n.parts.length;i++)r.parts.push(o(n.parts[i]));r.parts.length>n.parts.length&&(r.parts.length=n.parts.length)}else{var s=[];for(i=0;i<n.parts.length;i++)s.push(o(n.parts[i]));u[n.id]={id:n.id,refs:1,parts:s}}}}function i(){var t=document.createElement("style");return t.type="text/css",c.appendChild(t),t}function o(t){var e,n,r=document.querySelector("style["+m+'~="'+t.id+'"]');if(r){if(p)return f;r.parentNode.removeChild(r)}if(v){var o=d++;r=h||(h=i()),e=s.bind(null,r,o,!1),n=s.bind(null,r,o,!0)}else r=i(),e=function(t,e){var n=e.css,r=e.media,i=e.sourceMap;if(r&&t.setAttribute("media",r),g.ssrId&&t.setAttribute(m,e.id),i&&(n+="\n/*# sourceURL="+i.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */"),t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}.bind(null,r),n=function(){r.parentNode.removeChild(r)};return e(t),function(r){if(r){if(r.css===t.css&&r.media===t.media&&r.sourceMap===t.sourceMap)return;e(t=r)}else n()}}function s(t,e,n,r){var i=n?"":r.css;if(t.styleSheet)t.styleSheet.cssText=b(e,i);else{var o=document.createTextNode(i),s=t.childNodes;s[e]&&t.removeChild(s[e]),s.length?t.insertBefore(o,s[e]):t.appendChild(o)}}var a="undefined"!=typeof document;if("undefined"!=typeof DEBUG&&DEBUG&&!a)throw new Error("vue-style-loader cannot be used in a non-browser environment. Use { target: 'node' } in your Webpack config to indicate a server-rendering environment.");var l=n(9),u={},c=a&&(document.head||document.getElementsByTagName("head")[0]),h=null,d=0,p=!1,f=function(){},g=null,m="data-vue-ssr-id",v="undefined"!=typeof navigator&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());t.exports=function(t,e,n,i){p=n,g=i||{};var o=l(t,e);return r(o),function(e){for(var n=[],i=0;i<o.length;i++){var s=o[i];(a=u[s.id]).refs--,n.push(a)}e?r(o=l(t,e)):o=[];for(i=0;i<n.length;i++){var a;if(0===(a=n[i]).refs){for(var c=0;c<a.parts.length;c++)a.parts[c]();delete u[a.id]}}}};var b=function(){var t=[];return function(e,n){return t[e]=n,t.filter(Boolean).join("\n")}}()},function(t,e){t.exports=function(t,e){for(var n=[],r={},i=0;i<e.length;i++){var o=e[i],s=o[0],a={id:t+":"+i,css:o[1],media:o[2],sourceMap:o[3]};r[s]?r[s].parts.push(a):n.push(r[s]={id:s,parts:[a]})}return n}},function(t,e){t.exports=function(t,e,n,r,i,o){var s,a=t=t||{},l=typeof t.default;"object"!==l&&"function"!==l||(s=t,a=t.default);var u,c="function"==typeof a?a.options:a;if(e&&(c.render=e.render,c.staticRenderFns=e.staticRenderFns,c._compiled=!0),n&&(c.functional=!0),i&&(c._scopeId=i),o?(u=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),r&&r.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(o)},c._ssrRegister=u):r&&(u=r),u){var h=c.functional,d=h?c.render:c.beforeCreate;h?(c._injectStyles=u,c.render=function(t,e){return u.call(e),d(t,e)}):c.beforeCreate=d?[].concat(d,u):[u]}return{esModule:s,exports:a,options:c}}},function(t,e,n){"use strict";var r={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"slide-verify",style:{width:t.w+"px"},attrs:{id:"slideVerify",onselectstart:"return false;"}},[n("div",{class:{"slider-verify-loading":t.loadBlock}}),t._v(" "),n("canvas",{ref:"canvas",attrs:{width:t.w,height:t.h}}),t._v(" "),t.show?n("div",{staticClass:"slide-verify-refresh-icon",on:{click:t.refresh}}):t._e(),t._v(" "),n("canvas",{ref:"block",staticClass:"slide-verify-block",attrs:{width:t.w,height:t.h}}),t._v(" "),n("div",{staticClass:"slide-verify-slider",class:{"container-active":t.containerActive,"container-success":t.containerSuccess,"container-fail":t.containerFail}},[n("div",{staticClass:"slide-verify-slider-mask",style:{width:t.sliderMaskWidth}},[n("div",{staticClass:"slide-verify-slider-mask-item",style:{left:t.sliderLeft},on:{mousedown:t.sliderDown,touchstart:t.touchStartEvent,touchmove:t.touchMoveEvent,touchend:t.touchEndEvent}},[n("div",{staticClass:"slide-verify-slider-mask-item-icon"})])]),t._v(" "),n("span",{staticClass:"slide-verify-slider-text"},[t._v(t._s(t.sliderText))])])])},staticRenderFns:[]};e.a=r}])},t.exports=r()},orbS:function(t,e){t.exports=function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/dist/",n(n.s=127)}({0:function(t,e,n){"use strict";function r(t,e,n,r,i,o,s,a){var l,u="function"==typeof t?t.options:t;if(e&&(u.render=e,u.staticRenderFns=n,u._compiled=!0),r&&(u.functional=!0),o&&(u._scopeId="data-v-"+o),s?(l=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(s)},u._ssrRegister=l):i&&(l=a?function(){i.call(this,this.$root.$options.shadowRoot)}:i),l)if(u.functional){u._injectStyles=l;var c=u.render;u.render=function(t,e){return l.call(e),c(t,e)}}else{var h=u.beforeCreate;u.beforeCreate=h?[].concat(h,l):[l]}return{exports:t,options:u}}n.d(e,"a",function(){return r})},127:function(t,e,n){"use strict";n.r(e);var r={name:"ElTag",props:{text:String,closable:Boolean,type:String,hit:Boolean,disableTransitions:Boolean,color:String,size:String,effect:{type:String,default:"light",validator:function(t){return-1!==["dark","light","plain"].indexOf(t)}}},methods:{handleClose:function(t){t.stopPropagation(),this.$emit("close",t)},handleClick:function(t){this.$emit("click",t)}},computed:{tagSize:function(){return this.size||(this.$ELEMENT||{}).size}},render:function(t){var e=this.type,n=this.tagSize,r=this.hit,i=this.effect,o=t("span",{class:["el-tag",e?"el-tag--"+e:"",n?"el-tag--"+n:"",i?"el-tag--"+i:"",r&&"is-hit"],style:{backgroundColor:this.color},on:{click:this.handleClick}},[this.$slots.default,this.closable&&t("i",{class:"el-tag__close el-icon-close",on:{click:this.handleClose}})]);return this.disableTransitions?o:t("transition",{attrs:{name:"el-zoom-in-center"}},[o])}},i=n(0),o=Object(i.a)(r,void 0,void 0,!1,null,null,null);o.options.__file="packages/tag/src/tag.vue";var s=o.exports;s.install=function(t){t.component(s.name,s)};e.default=s}})},"p//t":function(t,e,n){var r;!function(i,o){var s,a=this,l=256,u=6,c="random",h=o.pow(l,u),d=o.pow(2,52),p=2*d,f=l-1;function g(t,e,n){var r=[],g=v(function t(e,n){var r,i=[],o=typeof e;if(n&&"object"==o)for(r in e)try{i.push(t(e[r],n-1))}catch(t){}return i.length?i:"string"==o?e:e+"\0"}((e=1==e?{entropy:!0}:e||{}).entropy?[t,b(i)]:null==t?function(){try{var t;return s&&(t=s.randomBytes)?t=t(l):(t=new Uint8Array(l),(a.crypto||a.msCrypto).getRandomValues(t)),b(t)}catch(t){var e=a.navigator,n=e&&e.plugins;return[+new Date,a,n,a.screen,b(i)]}}():t,3),r),_=new function(t){var e,n=t.length,r=this,i=0,o=r.i=r.j=0,s=r.S=[];n||(t=[n++]);for(;i<l;)s[i]=i++;for(i=0;i<l;i++)s[i]=s[o=f&o+t[i%n]+(e=s[i])],s[o]=e;(r.g=function(t){for(var e,n=0,i=r.i,o=r.j,s=r.S;t--;)e=s[i=f&i+1],n=n*l+s[f&(s[i]=s[o=f&o+e])+(s[o]=e)];return r.i=i,r.j=o,n})(l)}(r),y=function(){for(var t=_.g(u),e=h,n=0;t<d;)t=(t+n)*l,e*=l,n=_.g(1);for(;t>=p;)t/=2,e/=2,n>>>=1;return(t+n)/e};return y.int32=function(){return 0|_.g(4)},y.quick=function(){return _.g(4)/4294967296},y.double=y,v(b(_.S),i),(e.pass||n||function(t,e,n,r){return r&&(r.S&&m(r,_),t.state=function(){return m(_,{})}),n?(o[c]=t,e):t})(y,g,"global"in e?e.global:this==o,e.state)}function m(t,e){return e.i=t.i,e.j=t.j,e.S=t.S.slice(),e}function v(t,e){for(var n,r=t+"",i=0;i<r.length;)e[f&i]=f&(n^=19*e[f&i])+r.charCodeAt(i++);return b(e)}function b(t){return String.fromCharCode.apply(0,t)}if(o["seed"+c]=g,v(o.random(),i),"object"==typeof t&&t.exports){t.exports=g;try{s=n(5)}catch(t){}}else void 0===(r=function(){return g}.call(e,n,e,t))||(t.exports=r)}([],Math)},p1b6:function(t,e,n){"use strict";var r=n("cGG2");t.exports=r.isStandardBrowserEnv()?{write:function(t,e,n,i,o,s){var a=[];a.push(t+"="+encodeURIComponent(e)),r.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),r.isString(i)&&a.push("path="+i),r.isString(o)&&a.push("domain="+o),!0===s&&a.push("secure"),document.cookie=a.join("; ")},read:function(t){var e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},p8xL:function(t,e,n){"use strict";var r=Object.prototype.hasOwnProperty,i=Array.isArray,o=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),s=function(t,e){for(var n=e&&e.plainObjects?Object.create(null):{},r=0;r<t.length;++r)void 0!==t[r]&&(n[r]=t[r]);return n};t.exports={arrayToObject:s,assign:function(t,e){return Object.keys(e).reduce(function(t,n){return t[n]=e[n],t},t)},combine:function(t,e){return[].concat(t,e)},compact:function(t){for(var e=[{obj:{o:t},prop:"o"}],n=[],r=0;r<e.length;++r)for(var o=e[r],s=o.obj[o.prop],a=Object.keys(s),l=0;l<a.length;++l){var u=a[l],c=s[u];"object"==typeof c&&null!==c&&-1===n.indexOf(c)&&(e.push({obj:s,prop:u}),n.push(c))}return function(t){for(;t.length>1;){var e=t.pop(),n=e.obj[e.prop];if(i(n)){for(var r=[],o=0;o<n.length;++o)void 0!==n[o]&&r.push(n[o]);e.obj[e.prop]=r}}}(e),t},decode:function(t,e,n){var r=t.replace(/\+/g," ");if("iso-8859-1"===n)return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch(t){return r}},encode:function(t,e,n){if(0===t.length)return t;var r="string"==typeof t?t:String(t);if("iso-8859-1"===n)return escape(r).replace(/%u[0-9a-f]{4}/gi,function(t){return"%26%23"+parseInt(t.slice(2),16)+"%3B"});for(var i="",s=0;s<r.length;++s){var a=r.charCodeAt(s);45===a||46===a||95===a||126===a||a>=48&&a<=57||a>=65&&a<=90||a>=97&&a<=122?i+=r.charAt(s):a<128?i+=o[a]:a<2048?i+=o[192|a>>6]+o[128|63&a]:a<55296||a>=57344?i+=o[224|a>>12]+o[128|a>>6&63]+o[128|63&a]:(s+=1,a=65536+((1023&a)<<10|1023&r.charCodeAt(s)),i+=o[240|a>>18]+o[128|a>>12&63]+o[128|a>>6&63]+o[128|63&a])}return i},isBuffer:function(t){return!(!t||"object"!=typeof t||!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t)))},isRegExp:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},merge:function t(e,n,o){if(!n)return e;if("object"!=typeof n){if(i(e))e.push(n);else{if(!e||"object"!=typeof e)return[e,n];(o&&(o.plainObjects||o.allowPrototypes)||!r.call(Object.prototype,n))&&(e[n]=!0)}return e}if(!e||"object"!=typeof e)return[e].concat(n);var a=e;return i(e)&&!i(n)&&(a=s(e,o)),i(e)&&i(n)?(n.forEach(function(n,i){if(r.call(e,i)){var s=e[i];s&&"object"==typeof s&&n&&"object"==typeof n?e[i]=t(s,n,o):e.push(n)}else e[i]=n}),e):Object.keys(n).reduce(function(e,i){var s=n[i];return r.call(e,i)?e[i]=t(e[i],s,o):e[i]=s,e},a)}}},pBtG:function(t,e,n){"use strict";t.exports=function(t){return!(!t||!t.__CANCEL__)}},pFYg:function(t,e,n){"use strict";e.__esModule=!0;var r=s(n("Zzip")),i=s(n("5QVw")),o="function"==typeof i.default&&"symbol"==typeof r.default?function(t){return typeof t}:function(t){return t&&"function"==typeof i.default&&t.constructor===i.default&&t!==i.default.prototype?"symbol":typeof t};function s(t){return t&&t.__esModule?t:{default:t}}e.default="function"==typeof i.default&&"symbol"===o(r.default)?function(t){return void 0===t?"undefined":o(t)}:function(t){return t&&"function"==typeof i.default&&t.constructor===i.default&&t!==i.default.prototype?"symbol":void 0===t?"undefined":o(t)}},pSAl:function(t,e,n){"use strict";(function(t,r,i){n.d(e,"a",function(){return yt}),n.d(e,"b",function(){return St}),n.d(e,"c",function(){return oa}),n.d(e,"d",function(){return pl}),n.d(e,"e",function(){return Ys}),n.d(e,"f",function(){return Zc}),n.d(e,"g",function(){return ps}),n.d(e,"h",function(){return Cn}),n.d(e,"i",function(){return za}),n.d(e,"j",function(){return qa}),n.d(e,"k",function(){return ua}),n.d(e,"l",function(){return vs}),n.d(e,"m",function(){return qn}),n.d(e,"n",function(){return Tn}),n.d(e,"o",function(){return Nu}),n.d(e,"p",function(){return Yc}),n.d(e,"q",function(){return nl}),n.d(e,"r",function(){return Ol}),n.d(e,"s",function(){return dl}),n.d(e,"t",function(){return _a}),n.d(e,"u",function(){return Es}),n.d(e,"v",function(){return tr}),n.d(e,"w",function(){return Fl}),n.d(e,"x",function(){return ur}),n.d(e,"y",function(){return fn}),n.d(e,"z",function(){return Qa}),n.d(e,"A",function(){return ks}),n.d(e,"B",function(){return vl}),n.d(e,"C",function(){return yl}),n.d(e,"D",function(){return Lr}),n.d(e,"E",function(){return dr}),n.d(e,"F",function(){return wa}),n.d(e,"G",function(){return dn}),n.d(e,"H",function(){return gn}),n.d(e,"I",function(){return mn}),n.d(e,"J",function(){return vn}),n.d(e,"K",function(){return bn}),n.d(e,"L",function(){return We}),n.d(e,"M",function(){return pr}),n.d(e,"N",function(){return $l}),n.d(e,"O",function(){return gr}),n.d(e,"P",function(){return yn});
  5111. /**
  5112. * @license
  5113. * Copyright 2020 Google LLC. All Rights Reserved.
  5114. * Licensed under the Apache License, Version 2.0 (the "License");
  5115. * you may not use this file except in compliance with the License.
  5116. * You may obtain a copy of the License at
  5117. *
  5118. * http://www.apache.org/licenses/LICENSE-2.0
  5119. *
  5120. * Unless required by applicable law or agreed to in writing, software
  5121. * distributed under the License is distributed on an "AS IS" BASIS,
  5122. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5123. * See the License for the specific language governing permissions and
  5124. * limitations under the License.
  5125. * =============================================================================
  5126. */
  5127. var o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function s(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function a(t,e,n,r){return new(n||(n=Promise))(function(i,o){function s(t){try{l(r.next(t))}catch(t){o(t)}}function a(t){try{l(r.throw(t))}catch(t){o(t)}}function l(t){t.done?i(t.value):new n(function(e){e(t.value)}).then(s,a)}l((r=r.apply(t,e||[])).next())})}function l(t,e){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}var u=function(){function t(t){this.global=t,this.flags={},this.flagRegistry={},this.urlFlags={},this.populateURLFlags()}return t.prototype.setPlatform=function(t,e){null!=this.platform&&console.warn("Platform "+this.platformName+" has already been set. Overwriting the platform with "+e+"."),this.platformName=t,this.platform=e},t.prototype.registerFlag=function(t,e,n){if(this.flagRegistry[t]={evaluationFn:e,setHook:n},null!=this.urlFlags[t]){var r=this.urlFlags[t];console.warn("Setting feature override from URL "+t+": "+r+"."),this.set(t,r)}},t.prototype.get=function(t){return t in this.flags?this.flags[t]:(this.flags[t]=this.evaluateFlag(t),this.flags[t])},t.prototype.getNumber=function(t){return this.get(t)},t.prototype.getBool=function(t){return this.get(t)},t.prototype.getFlags=function(){return this.flags},Object.defineProperty(t.prototype,"features",{get:function(){return this.flags},enumerable:!0,configurable:!0}),t.prototype.set=function(t,e){if(null==this.flagRegistry[t])throw new Error("Cannot set flag "+t+" as it has not been registered.");this.flags[t]=e,null!=this.flagRegistry[t].setHook&&this.flagRegistry[t].setHook(e)},t.prototype.evaluateFlag=function(t){if(null==this.flagRegistry[t])throw new Error("Cannot evaluate flag '"+t+"': no evaluation function found.");return this.flagRegistry[t].evaluationFn()},t.prototype.setFlags=function(t){this.flags=Object.assign({},t)},t.prototype.reset=function(){this.flags={},this.urlFlags={},this.populateURLFlags()},t.prototype.populateURLFlags=function(){var t=this;if(void 0!==this.global&&void 0!==this.global.location&&void 0!==this.global.location.search){var e,n,r=(e=this.global.location.search,n={},e.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g,function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];return function(t,e,n){t[decodeURIComponent(e)]=decodeURIComponent(n||"")}(n,e[0],e[1]),e.join("=")}),n);"tfjsflags"in r&&r.tfjsflags.split(",").forEach(function(e){var n=e.split(":"),r=n[0],i=n[1];t.urlFlags[r]=function(t,e){if("true"===(e=e.toLowerCase())||"false"===e)return"true"===e;if(""+ +e===e)return+e;throw new Error("Could not parse value flag value "+e+" for flag "+t+".")}(r,i)})}},t}();function c(){return h}var h=null,d=new Map,p=new Map;function f(t,e){var n=b(t,e);return d.get(n)}function g(t){for(var e=d.entries(),n=[];;){var r=e.next(),i=r.done,o=r.value;if(i)break;var s=o[0],a=o[1];s.split("_")[0]===t&&n.push(a)}return n}function m(t){var e=t.kernelName,n=t.backendName,r=b(e,n);if(d.has(r))throw new Error("The kernel '"+e+"' for backend '"+n+"' is already registered");d.set(r,t)}function v(t){var e=t.kernelName;p.has(e)&&console.warn("Overriding the gradient for '"+e+"'"),p.set(e,t)}function b(t,e){return e+"_"+t}function _(t){for(var e=t.length,n=0,r=0;e>0;)r=Math.random()*e|0,n=t[--e],t[e]=t[r],t[r]=n}function y(t,e,n){return Math.max(t,Math.min(e,n))}function T(t){return t%2==0?t:t+1}function x(t){for(var e=0,n=0;n<t.length;n++)e+=t[n];return e}function E(t,e){if(!t)throw new Error("string"==typeof e?e:e())}function w(t,e,n){void 0===n&&(n=""),E(O(t,e),function(){return n+" Shapes "+t+" and "+e+" must match"})}function C(t){E(null!=t,function(){return"The input to the tensor constructor must be a non-null value."})}function S(t,e,n){if(void 0===e&&(e=[]),void 0===n&&(n=!1),null==e&&(e=[]),Array.isArray(t)||V(t)&&!n)for(var r=0;r<t.length;++r)S(t[r],e,n);else e.push(t);return e}function k(t){if(0===t.length)return 1;for(var e=t[0],n=1;n<t.length;n++)e*=t[n];return e}function O(t,e){if(t===e)return!0;if(null==t||null==e)return!1;if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function I(t){return t%1==0}function R(t){if(null!=Math.tanh)return Math.tanh(t);if(t===1/0)return 1;if(t===-1/0)return-1;var e=Math.exp(2*t);return(e-1)/(e+1)}function A(t){var e=Math.ceil(Math.sqrt(t));return[e,Math.ceil(t/e)]}function N(t,e){return e<=t.length?t:t+" ".repeat(e-t.length)}function D(t,e,n){return void 0===e&&(e=function(t){return 0}),new Promise(function(r,i){var o=0,s=function(){if(t())r();else{var a=e(++o);null!=n&&o>=n?i():setTimeout(s,a)}};s()})}function M(t,e){for(var n=1,r=-1,i=0;i<t.length;++i)if(t[i]>=0)n*=t[i];else if(-1===t[i]){if(-1!==r)throw Error("Shapes can only have 1 implicit size. Found -1 at dim "+r+" and dim "+i);r=i}else if(t[i]<0)throw Error("Shapes can not be < 0. Found "+t[i]+" at dim "+i);if(-1===r){if(e>0&&e!==n)throw Error("Size("+e+") must match the product of shape "+t);return t}if(0===n)throw Error("Cannot infer the missing size in ["+t+"] when there are 0 elements");if(e%n!=0)throw Error("The implicit shape can't be a fractional number. Got "+e+" / "+n);var o=t.slice();return o[r]=e/n,o}function L(t,e){var n=e.length;return E((t=null==t?e.map(function(t,e){return e}):[].concat(t)).every(function(t){return t>=-n&&t<n}),function(){return"All values in axis param must be in range [-"+n+", "+n+") but got axis "+t}),E(t.every(function(t){return I(t)}),function(){return"All values in axis param must be integers but got axis "+t}),t.map(function(t){return t<0?n+t:t})}function P(t,e){for(var n=[],r=[],i=null!=e&&Array.isArray(e)&&0===e.length,o=null==e||i?null:L(e,t).sort(),s=0,a=0;a<t.length;++a){if(null!=o){if(o[s]===a&&1!==t[a])throw new Error("Can't squeeze axis "+a+" since its dim '"+t[a]+"' is not 1");(null==o[s]||o[s]>a)&&1===t[a]&&(n.push(t[a]),r.push(a)),o[s]<=a&&s++}1!==t[a]&&(n.push(t[a]),r.push(a))}return{newShape:n,keptDims:r}}function F(t,e){var n=null;if(null==t||"float32"===t)n=new Float32Array(e);else if("int32"===t)n=new Int32Array(e);else{if("bool"!==t)throw new Error("Unknown data type "+t);n=new Uint8Array(e)}return n}function B(t,e){var n=null;if(null==t||"float32"===t)n=new Float32Array(e);else if("int32"===t)n=new Int32Array(e);else if("bool"===t)n=new Uint8Array(e);else{if("string"!==t)throw new Error("Unknown data type "+t);n=new Array(e)}return n}function j(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(isNaN(r)||!isFinite(r))throw Error("A tensor of type "+e+" being uploaded contains "+r+".")}}function $(t){return"bool"===t||"complex64"===t||"float32"===t||"int32"===t||"string"===t}function U(t,e){return!("complex64"===e||"float32"===e&&"complex64"!==t||"int32"===e&&"float32"!==t&&"complex64"!==t||"bool"===e&&"bool"===t)}function V(t){return t instanceof Float32Array||t instanceof Int32Array||t instanceof Uint8Array}function H(t){if("float32"===t||"int32"===t)return 4;if("complex64"===t)return 8;if("bool"===t)return 1;throw new Error("Unknown dtype "+t)}function W(t){if(null==t)return 0;var e=0;return t.forEach(function(t){return e+=t.length}),e}function G(t){return"string"==typeof t||t instanceof String}function z(t){return"boolean"==typeof t}function X(t){return"number"==typeof t}function K(t){return Array.isArray(t)?K(t[0]):t instanceof Float32Array?"float32":t instanceof Int32Array||t instanceof Uint8Array?"int32":X(t)?"float32":G(t)?"string":z(t)?"bool":"float32"}function Y(t){return!!(t&&t.constructor&&t.call&&t.apply)}function q(t,e){for(var n=e;n<t;++n)if(t%n==0)return n;return t}function J(t){var e=t.length;if(e<2)return[];var n=new Array(e-1);n[e-2]=t[e-1];for(var r=e-3;r>=0;--r)n[r]=n[r+1]*t[r+1];return n}function Z(t,e,n){if("string"===e)throw new Error("Cannot convert a string[] to a TypedArray");if(Array.isArray(t)&&(t=S(t)),n&&j(t,e),function(t,e){return t instanceof Float32Array&&"float32"===e||t instanceof Int32Array&&"int32"===e||t instanceof Uint8Array&&"bool"===e}(t,e))return t;if(null==e||"float32"===e||"complex64"===e)return new Float32Array(t);if("int32"===e)return new Int32Array(t);if("bool"===e){for(var r=new Uint8Array(t.length),i=0;i<r.length;++i)0!==Math.round(t[i])&&(r[i]=1);return r}throw new Error("Unknown data type "+e)}function Q(t,e){if(0===t.length)return e[0];var n=t.reduce(function(t,e){return t*e});if(0===n)return[];if(n!==e.length)throw new Error("["+t+"] does not match the input size.");return function t(e,n,r){var i=new Array;if(1===n.length)for(var o=n[0],s=0;s<o;s++)i[s]=r[e+s];else{o=n[0];var a=n.slice(1),l=a.reduce(function(t,e){return t*e});for(s=0;s<o;s++)i[s]=t(e+s*l,a,r)}return i}(0,t,e)}function tt(t,e){for(var n=et(t,e),r=0;r<n.length;r++)n[r]=1;return n}function et(t,e){if(null==e||"float32"===e||"complex64"===e)return new Float32Array(t);if("int32"===e)return new Int32Array(t);if("bool"===e)return new Uint8Array(t);throw new Error("Unknown data type "+e)}function nt(){return c().platform.now()}function rt(t){t.forEach(function(e){E(Number.isInteger(e)&&e>=0,function(){return"Tensor must have a shape comprised of positive integers but got shape ["+t+"]."})})}function it(t,e){return void 0===e&&(e="utf-8"),e=e||"utf-8",c().platform.encode(t,e)}function ot(t,e){return void 0===e&&(e="utf-8"),e=e||"utf-8",c().platform.decode(t,e)}function st(t,e,n){if(0===e)return 0;if(1===e)return t[0];for(var r=t[t.length-1],i=0;i<t.length-1;++i)r+=n[i]*t[i];return r}function at(t,e,n){if(0===e)return[];if(1===e)return[t];for(var r=new Array(e),i=0;i<r.length-1;++i)r[i]=Math.floor(t/n[i]),t-=r[i]*n[i];return r[r.length-1]=t,r}Object.freeze({shuffle:_,clamp:y,nearestLargerEven:T,sum:x,randUniform:function(t,e){var n=Math.random();return e*n+(1-n)*t},distSquared:function(t,e){for(var n=0,r=0;r<t.length;r++){var i=Number(t[r])-Number(e[r]);n+=i*i}return n},assert:E,assertShapesMatch:w,assertNonNull:C,flatten:S,sizeFromShape:k,isScalarShape:function(t){return 0===t.length},arraysEqual:O,isInt:I,tanh:R,sizeToSquarishShape:A,createShuffledIndices:function(t){for(var e=new Uint32Array(t),n=0;n<t;++n)e[n]=n;return _(e),e},rightPad:N,repeatedTry:D,inferFromImplicitShape:M,parseAxisParam:L,squeezeShape:P,getTypedArrayFromDType:F,getArrayFromDType:B,checkConversionForErrors:j,isValidDtype:$,hasEncodingLoss:U,isTypedArray:V,bytesPerElement:H,bytesFromStringArray:W,isString:G,isBoolean:z,isNumber:X,inferDtype:K,isFunction:Y,nearestDivisor:q,computeStrides:J,toTypedArray:Z,toNestedArray:Q,makeOnesTypedArray:tt,makeZerosTypedArray:et,now:nt,assertNonNegativeIntegerDimensions:rt,fetch:function(t,e){return c().platform.fetch(t,e)},encodeString:it,decodeString:ot,locToIndex:st,indexToLoc:at});var lt=function(){function t(t,e){this.backendTimer=t,this.logger=e,null==e&&(this.logger=new ut)}return t.prototype.profileKernel=function(t,e,n){var r,i=this,o=this.backendTimer.time(function(){r=n()});return r.forEach(function(n){n.data().then(function(r){!function(t,e,n){if("float32"!==e)return!1;for(var r=0;r<t.length;r++){var i=t[r];if(isNaN(i)||!isFinite(i))return console.warn("Found "+i+" in the result of '"+n+"'"),!0}}(r,n.dtype,t),o.then(function(o){var s="";null!=o.getExtraProfileInfo&&(s=o.getExtraProfileInfo()),i.logger.logKernelProfile(t,n,r,o.kernelMs,e,s)})})}),r},t}(),ut=function(){function t(){}return t.prototype.logKernelProfile=function(t,e,n,r,i,o){var s="number"==typeof r?N(r+"ms",9):r.error,a=N(t,25),l=e.rank,u=e.size,c=N(e.shape.toString(),14),h="";for(var d in i){var p=i[d].shape||e.shape,f=p.length;h+=d+": "+f+"D "+(f>0?p:"")+" "}console.log("%c"+a+"\t%c"+s+"\t%c"+l+"D "+c+"\t%c"+u+"\t%c"+h+"\t%c"+o,"font-weight:bold","color:red","color:blue","color: orange","color: green","color: steelblue")},t}(),ct=20,ht=3,dt=7;function pt(t,e,n){return N(Array.isArray(t)?parseFloat(t[0].toFixed(dt))+" + "+parseFloat(t[1].toFixed(dt))+"j":G(t)?"'"+t+"'":"bool"===n?ft(t):parseFloat(t.toFixed(dt)).toString(),e)}function ft(t){return 0===t?"false":"true"}function gt(t){for(var e=[],n=0;n<t.length;n+=2)e.push([t[n],t[n+1]]);return e}var mt=function(){function t(t,e,n){var r=this;if(this.dtype=e,this.shape=t.slice(),this.size=k(t),null!=n){var i=n.length;E(i===this.size,function(){return"Length of values '"+i+"' does not match the size inferred by the shape '"+r.size+"'."})}if("complex64"===e)throw new Error("complex64 dtype TensorBuffers are not supported. Please create a TensorBuffer for the real and imaginary parts separately and call tf.complex(real, imag).");this.values=n||B(e,this.size),this.strides=J(t)}return t.prototype.set=function(t){for(var e=this,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];0===n.length&&(n=[0]),E(n.length===this.rank,function(){return"The number of provided coordinates ("+n.length+") must match the rank ("+e.rank+")"});var i=this.locToIndex(n);this.values[i]=t},t.prototype.get=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];0===t.length&&(t=[0]);for(var n=0,r=0,i=t;r<i.length;r++){var o=i[r];if(o<0||o>=this.shape[n]){var s="Requested out of range element at "+t+". Buffer shape="+this.shape;throw new Error(s)}n++}for(var a=t[t.length-1],l=0;l<t.length-1;++l)a+=this.strides[l]*t[l];return this.values[a]},t.prototype.locToIndex=function(t){if(0===this.rank)return 0;if(1===this.rank)return t[0];for(var e=t[t.length-1],n=0;n<t.length-1;++n)e+=this.strides[n]*t[n];return e},t.prototype.indexToLoc=function(t){if(0===this.rank)return[];if(1===this.rank)return[t];for(var e=new Array(this.shape.length),n=0;n<e.length-1;++n)e[n]=Math.floor(t/this.strides[n]),t-=e[n]*this.strides[n];return e[e.length-1]=t,e},Object.defineProperty(t.prototype,"rank",{get:function(){return this.shape.length},enumerable:!0,configurable:!0}),t.prototype.toTensor=function(){return vt().makeTensor(this.values,this.shape,this.dtype)},t}(),vt=null,bt=null,_t=null,yt=function(){function t(t,e,n,r){this.kept=!1,this.isDisposedInternal=!1,this.shape=t.slice(),this.dtype=e||"float32",this.size=k(t),this.strides=J(t),this.dataId=n,this.id=r,this.rankType=this.rank<5?this.rank.toString():"higher"}return t.prototype.flatten=function(){return this.throwIfDisposed(),this.as1D()},t.prototype.asScalar=function(){return this.throwIfDisposed(),E(1===this.size,function(){return"The array must have only 1 element."}),this.reshape([])},t.prototype.as1D=function(){return this.throwIfDisposed(),this.reshape([this.size])},t.prototype.as2D=function(t,e){return this.throwIfDisposed(),this.reshape([t,e])},t.prototype.as3D=function(t,e,n){return this.throwIfDisposed(),this.reshape([t,e,n])},t.prototype.as4D=function(t,e,n,r){return this.throwIfDisposed(),this.reshape([t,e,n,r])},t.prototype.as5D=function(t,e,n,r,i){return this.throwIfDisposed(),this.reshape([t,e,n,r,i])},t.prototype.asType=function(t){return this.throwIfDisposed(),bt.cast(this,t)},Object.defineProperty(t.prototype,"rank",{get:function(){return this.shape.length},enumerable:!0,configurable:!0}),t.prototype.buffer=function(){return a(this,void 0,void 0,function(){var t;return l(this,function(e){switch(e.label){case 0:return[4,this.data()];case 1:return t=e.sent(),[2,bt.buffer(this.shape,this.dtype,t)]}})})},t.prototype.bufferSync=function(){return bt.buffer(this.shape,this.dtype,this.dataSync())},t.prototype.array=function(){return a(this,void 0,void 0,function(){var t;return l(this,function(e){switch(e.label){case 0:return[4,this.data()];case 1:return t=e.sent(),[2,Q(this.shape,t)]}})})},t.prototype.arraySync=function(){return Q(this.shape,this.dataSync())},t.prototype.data=function(){return a(this,void 0,void 0,function(){var t,e;return l(this,function(n){switch(n.label){case 0:return this.throwIfDisposed(),t=vt().read(this.dataId),"string"!==this.dtype?[3,2]:[4,t];case 1:e=n.sent();try{return[2,e.map(function(t){return ot(t)})]}catch(t){throw new Error("Failed to decode the string bytes into utf-8. To get the original bytes, call tensor.bytes().")}n.label=2;case 2:return[2,t]}})})},t.prototype.dataSync=function(){this.throwIfDisposed();var t=vt().readSync(this.dataId);if("string"===this.dtype)try{return t.map(function(t){return ot(t)})}catch(t){throw new Error("Failed to decode the string bytes into utf-8. To get the original bytes, call tensor.bytes().")}return t},t.prototype.bytes=function(){return a(this,void 0,void 0,function(){var t;return l(this,function(e){switch(e.label){case 0:return this.throwIfDisposed(),[4,vt().read(this.dataId)];case 1:return t=e.sent(),"string"===this.dtype?[2,t]:[2,new Uint8Array(t.buffer)]}})})},t.prototype.dispose=function(){this.isDisposed||(vt().disposeTensor(this),this.isDisposedInternal=!0)},Object.defineProperty(t.prototype,"isDisposed",{get:function(){return this.isDisposedInternal},enumerable:!0,configurable:!0}),t.prototype.throwIfDisposed=function(){if(this.isDisposed)throw new Error("Tensor is disposed.")},t.prototype.toFloat=function(){return this.asType("float32")},t.prototype.toInt=function(){return this.asType("int32")},t.prototype.toBool=function(){return this.asType("bool")},t.prototype.print=function(t){return void 0===t&&(t=!1),bt.print(this,t)},t.prototype.reshape=function(t){return this.throwIfDisposed(),bt.reshape(this,t)},t.prototype.reshapeAs=function(t){return this.throwIfDisposed(),this.reshape(t.shape)},t.prototype.expandDims=function(t){return void 0===t&&(t=0),bt.expandDims(this,t)},t.prototype.cumsum=function(t,e,n){return void 0===t&&(t=0),void 0===e&&(e=!1),void 0===n&&(n=!1),bt.cumsum(this,t,e,n)},t.prototype.squeeze=function(t){return this.throwIfDisposed(),bt.squeeze(this,t)},t.prototype.clone=function(){return this.throwIfDisposed(),bt.clone(this)},t.prototype.oneHot=function(t,e,n){return this.throwIfDisposed(),bt.oneHot(this,t,e,n)},t.prototype.toString=function(t){return void 0===t&&(t=!1),function(t,e,n,r){var i=J(e),o=function(t,e,n,r){var i=k(e),o=r[r.length-1],s=new Array(o).fill(0),a=e.length,l="complex64"===n?gt(t):t;if(a>1)for(var u=0;u<i/o;u++)for(var c=u*o,h=0;h<o;h++)s[h]=Math.max(s[h],pt(l[c+h],0,n).length);return s}(t,e,n,i),s=e.length,a=function t(e,n,r,i,o,s){void 0===s&&(s=!0);var a="complex64"===r?2:1,l=n[0],u=n.length;if(0===u)return"complex64"===r?[pt(gt(e)[0],0,r)]:"bool"===r?[ft(e[0])]:[e[0].toString()];if(1===u){if(l>ct){var c=ht*a,h=Array.from(e.slice(0,c)),d=Array.from(e.slice((l-ht)*a,l*a));return"complex64"===r&&(h=gt(h),d=gt(d)),["["+h.map(function(t,e){return pt(t,o[e],r)}).join(", ")+", ..., "+d.map(function(t,e){return pt(t,o[l-ht+e],r)}).join(", ")+"]"]}return["["+("complex64"===r?gt(e):Array.from(e)).map(function(t,e){return pt(t,o[e],r)}).join(", ")+"]"]}var p=n.slice(1),f=i.slice(1),g=i[0]*a,m=[];if(l>ct){for(var v=0;v<ht;v++){var b=(_=v*g)+g;m.push.apply(m,t(e.slice(_,b),p,r,f,o,!1))}for(m.push("..."),v=l-ht;v<l;v++)b=(_=v*g)+g,m.push.apply(m,t(e.slice(_,b),p,r,f,o,v===l-1))}else for(v=0;v<l;v++){var _;b=(_=v*g)+g,m.push.apply(m,t(e.slice(_,b),p,r,f,o,v===l-1))}var y=2===u?",":"";for(m[0]="["+m[0]+y,v=1;v<m.length-1;v++)m[v]=" "+m[v]+y;var T=",\n";for(v=2;v<u;v++)T+="\n";return m[m.length-1]=" "+m[m.length-1]+"]"+(s?"":T),m}(t,e,n,i,o),l=["Tensor"];return r&&(l.push(" dtype: "+n),l.push(" rank: "+s),l.push(" shape: ["+e+"]"),l.push(" values:")),l.push(a.map(function(t){return" "+t}).join("\n")),l.join("\n")}(this.dataSync(),this.shape,this.dtype,t)},t.prototype.tile=function(t){return this.throwIfDisposed(),bt.tile(this,t)},t.prototype.gather=function(t,e){return void 0===e&&(e=0),this.throwIfDisposed(),bt.gather(this,t,e)},t.prototype.matMul=function(t,e,n){return void 0===e&&(e=!1),void 0===n&&(n=!1),this.throwIfDisposed(),bt.matMul(this,t,e,n)},t.prototype.dot=function(t){return this.throwIfDisposed(),bt.dot(this,t)},t.prototype.norm=function(t,e,n){return void 0===t&&(t="euclidean"),void 0===e&&(e=null),void 0===n&&(n=!1),this.throwIfDisposed(),bt.norm(this,t,e,n)},t.prototype.slice=function(t,e){return this.throwIfDisposed(),bt.slice(this,t,e)},t.prototype.reverse=function(t){return this.throwIfDisposed(),bt.reverse(this,t)},t.prototype.concat=function(e,n){return void 0===n&&(n=0),this.throwIfDisposed(),e instanceof t&&(e=[e]),bt.concat([this].concat(e),n)},t.prototype.split=function(t,e){return void 0===e&&(e=0),this.throwIfDisposed(),bt.split(this,t,e)},t.prototype.stack=function(t,e){return void 0===e&&(e=0),bt.stack([this,t],e)},t.prototype.unstack=function(t){return void 0===t&&(t=0),bt.unstack(this,t)},t.prototype.pad=function(t,e){return void 0===e&&(e=0),bt.pad(this,t,e)},t.prototype.batchNormalization=function(t,e,n,r,i){return void 0===n&&(n=.001),_t("tf.batchNormalization() is going away. Use tf.batchNorm() instead, and note the positional argument change of scale, offset, and varianceEpsilon"),this.batchNorm(t,e,i,r,n)},t.prototype.batchNorm=function(t,e,n,r,i){return void 0===i&&(i=.001),this.throwIfDisposed(),bt.batchNorm(this,t,e,n,r,i)},t.prototype.all=function(t,e){return void 0===t&&(t=null),void 0===e&&(e=!1),this.throwIfDisposed(),bt.all(this,t,e)},t.prototype.any=function(t,e){return void 0===t&&(t=null),void 0===e&&(e=!1),this.throwIfDisposed(),bt.any(this,t,e)},t.prototype.logSumExp=function(t,e){return void 0===t&&(t=null),void 0===e&&(e=!1),this.throwIfDisposed(),bt.logSumExp(this,t,e)},t.prototype.sum=function(t,e){return void 0===t&&(t=null),void 0===e&&(e=!1),this.throwIfDisposed(),bt.sum(this,t,e)},t.prototype.prod=function(t,e){return void 0===t&&(t=null),void 0===e&&(e=!1),this.throwIfDisposed(),bt.prod(this,t,e)},t.prototype.mean=function(t,e){return void 0===t&&(t=null),void 0===e&&(e=!1),this.throwIfDisposed(),bt.mean(this,t,e)},t.prototype.min=function(t,e){return void 0===t&&(t=null),void 0===e&&(e=!1),this.throwIfDisposed(),bt.min(this,t,e)},t.prototype.max=function(t,e){return void 0===t&&(t=null),void 0===e&&(e=!1),this.throwIfDisposed(),bt.max(this,t,e)},t.prototype.argMin=function(t){return void 0===t&&(t=null),this.throwIfDisposed(),bt.argMin(this,t)},t.prototype.argMax=function(t){return void 0===t&&(t=null),this.throwIfDisposed(),bt.argMax(this,t)},t.prototype.cast=function(t){return this.throwIfDisposed(),bt.cast(this,t)},t.prototype.add=function(t){return this.throwIfDisposed(),bt.add(this,t)},t.prototype.addStrict=function(t){return this.throwIfDisposed(),bt.addStrict(this,t)},t.prototype.atan2=function(t){return this.throwIfDisposed(),bt.atan2(this,t)},t.prototype.sub=function(t){return this.throwIfDisposed(),bt.sub(this,t)},t.prototype.subStrict=function(t){return this.throwIfDisposed(),bt.subStrict(this,t)},t.prototype.pow=function(t){return this.throwIfDisposed(),bt.pow(this,t)},t.prototype.powStrict=function(t){return this.throwIfDisposed(),bt.powStrict(this,t)},t.prototype.mul=function(t){return this.throwIfDisposed(),bt.mul(this,t)},t.prototype.mulStrict=function(t){return this.throwIfDisposed(),bt.mulStrict(this,t)},t.prototype.div=function(t){return this.throwIfDisposed(),bt.div(this,t)},t.prototype.divNoNan=function(t){return this.throwIfDisposed(),bt.divNoNan(this,t)},t.prototype.floorDiv=function(t){return this.throwIfDisposed(),bt.floorDiv(this,t)},t.prototype.divStrict=function(t){return this.throwIfDisposed(),bt.divStrict(this,t)},t.prototype.minimum=function(t){return this.throwIfDisposed(),bt.minimum(this,t)},t.prototype.minimumStrict=function(t){return this.throwIfDisposed(),bt.minimumStrict(this,t)},t.prototype.maximum=function(t){return this.throwIfDisposed(),bt.maximum(this,t)},t.prototype.maximumStrict=function(t){return this.throwIfDisposed(),bt.maximumStrict(this,t)},t.prototype.mod=function(t){return this.throwIfDisposed(),bt.mod(this,t)},t.prototype.modStrict=function(t){return this.throwIfDisposed(),bt.modStrict(this,t)},t.prototype.squaredDifferenceStrict=function(t){return this.throwIfDisposed(),bt.squaredDifferenceStrict(this,t)},t.prototype.transpose=function(t){return this.throwIfDisposed(),bt.transpose(this,t)},t.prototype.notEqual=function(t){return this.throwIfDisposed(),bt.notEqual(this,t)},t.prototype.notEqualStrict=function(t){return this.throwIfDisposed(),bt.notEqualStrict(this,t)},t.prototype.less=function(t){return this.throwIfDisposed(),bt.less(this,t)},t.prototype.lessStrict=function(t){return this.throwIfDisposed(),bt.lessStrict(this,t)},t.prototype.equal=function(t){return this.throwIfDisposed(),bt.equal(this,t)},t.prototype.equalStrict=function(t){return this.throwIfDisposed(),bt.equalStrict(this,t)},t.prototype.lessEqual=function(t){return this.throwIfDisposed(),bt.lessEqual(this,t)},t.prototype.lessEqualStrict=function(t){return this.throwIfDisposed(),bt.lessEqualStrict(this,t)},t.prototype.greater=function(t){return this.throwIfDisposed(),bt.greater(this,t)},t.prototype.greaterStrict=function(t){return this.throwIfDisposed(),bt.greaterStrict(this,t)},t.prototype.greaterEqual=function(t){return this.throwIfDisposed(),bt.greaterEqual(this,t)},t.prototype.greaterEqualStrict=function(t){return this.throwIfDisposed(),bt.greaterEqualStrict(this,t)},t.prototype.logicalAnd=function(t){return this.throwIfDisposed(),bt.logicalAnd(this,t)},t.prototype.logicalOr=function(t){return this.throwIfDisposed(),bt.logicalOr(this,t)},t.prototype.logicalNot=function(){return this.throwIfDisposed(),bt.logicalNot(this)},t.prototype.logicalXor=function(t){return this.throwIfDisposed(),bt.logicalXor(this,t)},t.prototype.where=function(t,e){return this.throwIfDisposed(),bt.where(t,this,e)},t.prototype.neg=function(){return this.throwIfDisposed(),bt.neg(this)},t.prototype.ceil=function(){return this.throwIfDisposed(),bt.ceil(this)},t.prototype.floor=function(){return this.throwIfDisposed(),bt.floor(this)},t.prototype.sign=function(){return this.throwIfDisposed(),bt.sign(this)},t.prototype.isNaN=function(){return this.throwIfDisposed(),bt.isNaN(this)},t.prototype.isInf=function(){return this.throwIfDisposed(),bt.isInf(this)},t.prototype.isFinite=function(){return this.throwIfDisposed(),bt.isFinite(this)},t.prototype.exp=function(){return this.throwIfDisposed(),bt.exp(this)},t.prototype.expm1=function(){return this.throwIfDisposed(),bt.expm1(this)},t.prototype.log=function(){return this.throwIfDisposed(),bt.log(this)},t.prototype.log1p=function(){return this.throwIfDisposed(),bt.log1p(this)},t.prototype.sqrt=function(){return this.throwIfDisposed(),bt.sqrt(this)},t.prototype.rsqrt=function(){return this.throwIfDisposed(),bt.rsqrt(this)},t.prototype.square=function(){return this.throwIfDisposed(),bt.square(this)},t.prototype.reciprocal=function(){return this.throwIfDisposed(),bt.reciprocal(this)},t.prototype.abs=function(){return this.throwIfDisposed(),bt.abs(this)},t.prototype.clipByValue=function(t,e){return this.throwIfDisposed(),bt.clipByValue(this,t,e)},t.prototype.relu=function(){return this.throwIfDisposed(),bt.relu(this)},t.prototype.relu6=function(){return this.throwIfDisposed(),bt.relu6(this)},t.prototype.elu=function(){return this.throwIfDisposed(),bt.elu(this)},t.prototype.selu=function(){return this.throwIfDisposed(),bt.selu(this)},t.prototype.leakyRelu=function(t){return void 0===t&&(t=.2),this.throwIfDisposed(),bt.leakyRelu(this,t)},t.prototype.prelu=function(t){return this.throwIfDisposed(),bt.prelu(this,t)},t.prototype.sigmoid=function(){return this.throwIfDisposed(),bt.sigmoid(this)},t.prototype.logSigmoid=function(){return this.throwIfDisposed(),bt.logSigmoid(this)},t.prototype.softplus=function(){return this.throwIfDisposed(),bt.softplus(this)},t.prototype.zerosLike=function(){return this.throwIfDisposed(),bt.zerosLike(this)},t.prototype.onesLike=function(){return this.throwIfDisposed(),bt.onesLike(this)},t.prototype.sin=function(){return this.throwIfDisposed(),bt.sin(this)},t.prototype.cos=function(){return this.throwIfDisposed(),bt.cos(this)},t.prototype.tan=function(){return this.throwIfDisposed(),bt.tan(this)},t.prototype.asin=function(){return this.throwIfDisposed(),bt.asin(this)},t.prototype.acos=function(){return this.throwIfDisposed(),bt.acos(this)},t.prototype.atan=function(){return this.throwIfDisposed(),bt.atan(this)},t.prototype.sinh=function(){return this.throwIfDisposed(),bt.sinh(this)},t.prototype.cosh=function(){return this.throwIfDisposed(),bt.cosh(this)},t.prototype.tanh=function(){return this.throwIfDisposed(),bt.tanh(this)},t.prototype.asinh=function(){return this.throwIfDisposed(),bt.asinh(this)},t.prototype.acosh=function(){return this.throwIfDisposed(),bt.acosh(this)},t.prototype.atanh=function(){return this.throwIfDisposed(),bt.atanh(this)},t.prototype.erf=function(){return this.throwIfDisposed(),bt.erf(this)},t.prototype.round=function(){return this.throwIfDisposed(),bt.round(this)},t.prototype.step=function(t){return void 0===t&&(t=0),this.throwIfDisposed(),bt.step(this,t)},t.prototype.softmax=function(t){return void 0===t&&(t=-1),this.throwIfDisposed(),bt.softmax(this,t)},t.prototype.logSoftmax=function(t){return void 0===t&&(t=-1),this.throwIfDisposed(),bt.logSoftmax(this,t)},t.prototype.resizeBilinear=function(t,e){return void 0===e&&(e=!1),this.throwIfDisposed(),bt.image.resizeBilinear(this,t,e)},t.prototype.resizeNearestNeighbor=function(t,e){return void 0===e&&(e=!1),this.throwIfDisposed(),bt.image.resizeNearestNeighbor(this,t,e)},t.prototype.conv1d=function(t,e,n,r,i,o){return void 0===r&&(r="NWC"),void 0===i&&(i=1),this.throwIfDisposed(),bt.conv1d(this,t,e,n,r,i,o)},t.prototype.conv2d=function(t,e,n,r,i,o){return void 0===r&&(r="NHWC"),void 0===i&&(i=[1,1]),this.throwIfDisposed(),bt.conv2d(this,t,e,n,r,i,o)},t.prototype.conv2dTranspose=function(t,e,n,r,i){return this.throwIfDisposed(),bt.conv2dTranspose(this,t,e,n,r,i)},t.prototype.depthwiseConv2D=function(t,e,n,r,i,o){return void 0===r&&(r="NHWC"),void 0===i&&(i=[1,1]),this.throwIfDisposed(),bt.depthwiseConv2d(this,t,e,n,r,i,o)},t.prototype.separableConv2d=function(t,e,n,r,i,o){return void 0===i&&(i=[1,1]),void 0===o&&(o="NHWC"),this.throwIfDisposed(),bt.separableConv2d(this,t,e,n,r,i,o)},t.prototype.avgPool=function(t,e,n,r){return this.throwIfDisposed(),bt.avgPool(this,t,e,n,r)},t.prototype.maxPool=function(t,e,n,r){return this.throwIfDisposed(),bt.maxPool(this,t,e,n,r)},t.prototype.localResponseNormalization=function(t,e,n,r){return void 0===t&&(t=5),void 0===e&&(e=1),void 0===n&&(n=1),void 0===r&&(r=.5),bt.localResponseNormalization(this,t,e,n,r)},t.prototype.pool=function(t,e,n,r,i){return this.throwIfDisposed(),bt.pool(this,t,e,n,r,i)},t.prototype.variable=function(t,e,n){return void 0===t&&(t=!0),this.throwIfDisposed(),vt().makeVariable(this,t,e,n)},t.prototype.unsortedSegmentSum=function(t,e){return this.throwIfDisposed(),bt.unsortedSegmentSum(this,t,e)},t.prototype.batchToSpaceND=function(t,e){return this.throwIfDisposed(),bt.batchToSpaceND(this,t,e)},t.prototype.spaceToBatchND=function(t,e){return this.throwIfDisposed(),bt.spaceToBatchND(this,t,e)},t.prototype.topk=function(t,e){return void 0===t&&(t=1),void 0===e&&(e=!0),this.throwIfDisposed(),bt.topk(this,t,e)},t.prototype.stridedSlice=function(t,e,n,r,i,o,s,a){return void 0===r&&(r=0),void 0===i&&(i=0),void 0===o&&(o=0),void 0===s&&(s=0),void 0===a&&(a=0),this.throwIfDisposed(),bt.stridedSlice(this,t,e,n,r,i,o,s,a)},t.prototype.depthToSpace=function(t,e){return this.throwIfDisposed(),bt.depthToSpace(this,t,e)},t.prototype.fft=function(){return this.throwIfDisposed(),bt.spectral.fft(this)},t.prototype.ifft=function(){return this.throwIfDisposed(),bt.spectral.ifft(this)},t.prototype.rfft=function(){return this.throwIfDisposed(),bt.spectral.rfft(this)},t.prototype.irfft=function(){return this.throwIfDisposed(),bt.spectral.irfft(this)},t}();Object.defineProperty(yt,Symbol.hasInstance,{value:function(t){return!!t&&null!=t.dataId&&null!=t.shape&&null!=t.dtype}});var Tt,xt,Et,wt,Ct,St=function(t){function e(e,n,r,i){var o=t.call(this,e.shape,e.dtype,e.dataId,i)||this;return o.trainable=n,o.name=r,o}return s(e,t),e.prototype.assign=function(t){if(t.dtype!==this.dtype)throw new Error("dtype of the new value ("+t.dtype+") and previous value ("+this.dtype+") must match");if(!O(t.shape,this.shape))throw new Error("shape of the new value ("+t.shape+") and previous value ("+this.shape+") must match");vt().disposeTensor(this),this.dataId=t.dataId,vt().incRef(this,null)},e.prototype.dispose=function(){vt().disposeVariable(this),this.isDisposedInternal=!0},e}(yt);Object.defineProperty(St,Symbol.hasInstance,{value:function(t){return t instanceof yt&&null!=t.assign&&t.assign instanceof Function}}),function(t){t.R0="R0",t.R1="R1",t.R2="R2",t.R3="R3",t.R4="R4",t.R5="R5",t.R6="R6"}(Tt||(Tt={})),function(t){t.float32="float32",t.int32="int32",t.bool="int32",t.complex64="complex64"}(xt||(xt={})),function(t){t.float32="float32",t.int32="int32",t.bool="bool",t.complex64="complex64"}(Et||(Et={})),function(t){t.float32="float32",t.int32="float32",t.bool="float32",t.complex64="complex64"}(wt||(wt={})),function(t){t.float32="complex64",t.int32="complex64",t.bool="complex64",t.complex64="complex64"}(Ct||(Ct={}));var kt={float32:wt,int32:xt,bool:Et,complex64:Ct};function Ot(t,e){if("string"===t||"string"===e){if("string"===t&&"string"===e)return"string";throw new Error("Can not upcast "+t+" with "+e)}return kt[t][e]}function It(t){return Ot(t,"int32")}function Rt(t,e){if(t.dtype===e.dtype)return[t,e];var n=Ot(t.dtype,e.dtype);return[t.cast(n),e.cast(n)]}function At(t,e){E(t.dtype===e.dtype,function(){return"The dtypes of the first("+t.dtype+") and second("+e.dtype+") input must match"})}function Nt(t){var e=[];return function t(e,n,r){if(null!=e)if(e instanceof yt)n.push(e);else if(i=e,Array.isArray(i)||"object"==typeof i){var i,o=e;for(var s in o){var a=o[s];r.has(a)||(r.add(a),t(a,n,r))}}}(t,e,new Set),e}Object.freeze({makeTypesMatch:Rt,assertTypesMatch:At,isTensorInList:function(t,e){return e.some(function(e){return e.id===t.id})},getTensorsInContainer:Nt});var Dt,Mt=function(){function t(){this.registeredVariables={},this.nextTapeNodeId=0,this.numBytes=0,this.numTensors=0,this.numStringTensors=0,this.numDataBuffers=0,this.gradientDepth=0,this.kernelDepth=0,this.scopeStack=[],this.numDataMovesStack=[],this.nextScopeId=0,this.tensorInfo=new WeakMap,this.profiling=!1,this.activeProfile={newBytes:0,newTensors:0,peakBytes:0,kernels:[],result:null}}return t.prototype.dispose=function(){for(var t in this.registeredVariables)this.registeredVariables[t].dispose()},t}(),Lt=function(){function t(t){this.ENV=t,this.registry={},this.registryFactory={},this.pendingBackendInitId=0,this.state=new Mt}return t.prototype.ready=function(){return a(this,void 0,void 0,function(){var t,e,n;return l(this,function(r){switch(r.label){case 0:if(null!=this.pendingBackendInit)return[2,this.pendingBackendInit.then(function(){})];if(null!=this.backendInstance)return[2];t=this.getSortedBackends(),e=0,r.label=1;case 1:return e<t.length?(n=t[e],[4,this.initializeBackend(n).success]):[3,5];case 2:return r.sent()?[4,this.setBackend(n)]:[3,4];case 3:return r.sent(),[2];case 4:return e++,[3,1];case 5:throw new Error("Could not initialize any backends, all backend initializations failed.")}})})},Object.defineProperty(t.prototype,"backend",{get:function(){if(null!=this.pendingBackendInit)throw new Error("Backend '"+this.backendName+"' has not yet been initialized. Make sure to await tf.ready() or await tf.setBackend() before calling other methods");if(null==this.backendInstance){var t=this.initializeBackendsAndReturnBest(),e=t.name;if(t.asyncInit)throw new Error("The highest priority backend '"+e+"' has not yet been initialized. Make sure to await tf.ready() or await tf.setBackend() before calling other methods");this.setBackend(e)}return this.backendInstance},enumerable:!0,configurable:!0}),t.prototype.backendNames=function(){return Object.keys(this.registryFactory)},t.prototype.findBackend=function(t){if(!(t in this.registry)){if(!(t in this.registryFactory))return null;if(this.initializeBackend(t).asyncInit)return null}return this.registry[t]},t.prototype.findBackendFactory=function(t){return t in this.registryFactory?this.registryFactory[t].factory:null},t.prototype.registerBackend=function(t,e,n){return void 0===n&&(n=1),t in this.registryFactory?(console.warn(t+" backend was already registered. Reusing existing backend factory."),!1):(this.registryFactory[t]={factory:e,priority:n},!0)},t.prototype.setBackend=function(t){return a(this,void 0,void 0,function(){var e,n,r;return l(this,function(i){switch(i.label){case 0:if(null==this.registryFactory[t])throw new Error("Backend name '"+t+"' not found in registry");return this.backendName=t,null!=this.registry[t]?[3,4]:(this.backendInstance=null,e=this.initializeBackend(t),n=e.success,e.asyncInit?[4,n]:[3,2]);case 1:return r=i.sent(),[3,3];case 2:r=n,i.label=3;case 3:if(!r)return[2,!1];i.label=4;case 4:return this.backendInstance=this.registry[t],this.setupRegisteredKernels(),this.profiler=new lt(this.backendInstance),[2,!0]}})})},t.prototype.setupRegisteredKernels=function(){var t=this;g(this.backendName).forEach(function(e){null!=e.setupFunc&&e.setupFunc(t.backendInstance)})},t.prototype.disposeRegisteredKernels=function(t){var e=this;g(t).forEach(function(n){null!=n.disposeFunc&&n.disposeFunc(e.registry[t])})},t.prototype.initializeBackend=function(t){var e=this,n=this.registryFactory[t];if(null==n)throw new Error("Cannot initialize backend "+t+", no registration found.");try{var r=n.factory();if(Promise.resolve(r)===r){var i=++this.pendingBackendInitId,o=r.then(function(n){return!(i<e.pendingBackendInitId||(e.registry[t]=n,e.pendingBackendInit=null,0))}).catch(function(n){return!(i<e.pendingBackendInitId||(e.pendingBackendInit=null,console.warn("Initialization of backend "+t+" failed"),console.warn(n.stack||n.message),1))});return this.pendingBackendInit=o,{success:o,asyncInit:!0}}return this.registry[t]=r,{success:!0,asyncInit:!1}}catch(e){return console.warn("Initialization of backend "+t+" failed"),console.warn(e.stack||e.message),{success:!1,asyncInit:!1}}},t.prototype.removeBackend=function(t){if(!(t in this.registryFactory))throw new Error(t+" backend not found in registry");this.backendName===t&&null!=this.pendingBackendInit&&this.pendingBackendInitId++,t in this.registry&&(this.disposeRegisteredKernels(t),this.registry[t].dispose(),delete this.registry[t]),delete this.registryFactory[t],this.backendName===t&&(this.pendingBackendInit=null,this.backendName=null,this.backendInstance=null)},t.prototype.getSortedBackends=function(){var t=this;if(0===Object.keys(this.registryFactory).length)throw new Error("No backend found in registry.");return Object.keys(this.registryFactory).sort(function(e,n){return t.registryFactory[n].priority-t.registryFactory[e].priority})},t.prototype.initializeBackendsAndReturnBest=function(){for(var t=this.getSortedBackends(),e=0;e<t.length;e++){var n=t[e],r=this.initializeBackend(n),i=r.success,o=r.asyncInit;if(o||i)return{name:n,asyncInit:o}}throw new Error("Could not initialize any backends, all backend initializations failed.")},t.prototype.moveData=function(t,e){var n=this.state.tensorInfo.get(e),r=n.backend,i=this.readSync(e);r.disposeData(e),n.backend=t,t.move(e,i,n.shape,n.dtype),this.shouldCheckForMemLeaks()&&this.state.numDataMovesStack[this.state.numDataMovesStack.length-1]++},t.prototype.tidy=function(t,e){var n,r=this,i=null;if(null==e){if("function"!=typeof t)throw new Error("Please provide a function to tidy()");e=t}else{if("string"!=typeof t&&!(t instanceof String))throw new Error("When calling with two arguments, the first argument to tidy() must be a string");if("function"!=typeof e)throw new Error("When calling with two arguments, the 2nd argument to tidy() must be a function");i=t}return this.scopedRun(function(){return r.startScope(i)},function(){return r.endScope(n)},function(){return(n=e())instanceof Promise&&console.error("Cannot return a Promise inside of tidy."),n})},t.prototype.scopedRun=function(t,e,n){t();try{var r=n();return e(),r}catch(t){throw e(),t}},t.prototype.nextTensorId=function(){return t.nextTensorId++},t.prototype.nextVariableId=function(){return t.nextVariableId++},t.prototype.clone=function(t){var e=this.makeTensorFromDataId(t.dataId,t.shape,t.dtype),n={x:t};return this.addTapeNode(this.state.activeScope.name,n,[e],function(t){return{x:function(){return t.toFloat()}}},[]),e},t.prototype.runKernel=function(t,e,n,r,i){return this.runKernelFunc(null,e,null,t,n,r,i)},t.prototype.shouldCheckForMemLeaks=function(){return this.ENV.getBool("IS_TEST")},t.prototype.checkKernelForMemLeak=function(t,e,n){var r=this.backend.numDataIds(),i=0;n.forEach(function(t){i+="complex64"===t.dtype?3:1});var o=this.state.numDataMovesStack[this.state.numDataMovesStack.length-1],s=r-e-i-o;if(s>0)throw new Error("Backend '"+this.backendName+"' has an internal memory leak ("+s+" data ids) after running '"+t+"'")},t.prototype.runKernelFunc=function(t,e,n,r,i,o,s){var a,l=this;void 0===o&&(o=[]),void 0===s&&(s=[]);var u=[],c=this.isTapeOn();null==r&&(r=null!=this.state.activeScope?this.state.activeScope.name:"");var h,d=function(t){c&&(u=t.map(function(t){return l.keep(l.clone(t))}))},p=this.state.numBytes,g=this.state.numTensors;this.shouldCheckForMemLeaks()&&this.state.numDataMovesStack.push(0);var m,v=f(r,this.backendName);return h=null!=v?function(){var t=l.backend.numDataIds();m=v.kernelFunc({inputs:e,attrs:i,backend:l.backend});var n=Array.isArray(m)?m:[m];l.shouldCheckForMemLeaks()&&l.checkKernelForMemLeak(r,t,n);var a=n.map(function(t){var e=t.dataId,n=t.shape,r=t.dtype;return l.makeTensorFromDataId(e,n,r)}),u=a.filter(function(t,e){return s[e]});return d((o||[]).slice().concat(u)),a}:function(){var e=l.backend.numDataIds();m=l.tidy(function(){return t(l.backend,d)});var n=Array.isArray(m)?m:[m];return l.shouldCheckForMemLeaks()&&l.checkKernelForMemLeak(r,e,n),n},this.scopedRun(function(){return l.state.kernelDepth++},function(){return l.state.kernelDepth--},function(){a=l.ENV.getBool("DEBUG")?l.profiler.profileKernel(r,e,function(){return h()}):h()}),c&&this.addTapeNode(r,e,a,n,u),this.state.profiling&&this.state.activeProfile.kernels.push({name:r,bytesAdded:this.state.numBytes-p,totalBytesSnapshot:this.state.numBytes,tensorsAdded:this.state.numTensors-g,totalTensorsSnapshot:this.state.numTensors,inputShapes:Object.keys(e).map(function(t){return e[t].shape}),outputShapes:a.map(function(t){return t.shape})}),Array.isArray(m)?a:a[0]},t.prototype.makeTensor=function(t,e,n,r){if(null==t)throw new Error("Values passed to engine.makeTensor() are null");n=n||"float32",r=r||this.backend;var i=t;"string"===n&&G(t[0])&&(i=t.map(function(t){return it(t)}));var o=r.write(i,e,n),s=new yt(e,n,o,this.nextTensorId());if(this.incRef(s,r),"string"===n){var a=this.state.tensorInfo.get(o),l=W(i);this.state.numBytes+=l-a.bytes,a.bytes=l}return s},t.prototype.makeTensorFromDataId=function(t,e,n,r){var i=new yt(e,n=n||"float32",t,this.nextTensorId());return this.incRef(i,r),i},t.prototype.makeVariable=function(t,e,n,r){void 0===e&&(e=!0),n=n||this.nextVariableId().toString(),null!=r&&r!==t.dtype&&(t=t.asType(r));var i=new St(t,e,n,this.nextTensorId());if(null!=this.state.registeredVariables[i.name])throw new Error("Variable with name "+i.name+" was already registered");return this.state.registeredVariables[i.name]=i,this.incRef(i,this.backend),i},t.prototype.incRef=function(t,e){var n=this.state.tensorInfo.has(t.dataId)?this.state.tensorInfo.get(t.dataId).refCount:0;if(this.state.numTensors++,"string"===t.dtype&&this.state.numStringTensors++,0===n){this.state.numDataBuffers++;var r=0;"complex64"!==t.dtype&&"string"!==t.dtype&&(r=t.size*H(t.dtype)),this.state.tensorInfo.set(t.dataId,{backend:e||this.backend,dtype:t.dtype,shape:t.shape,bytes:r,refCount:0}),this.state.numBytes+=r}this.state.tensorInfo.get(t.dataId).refCount++,t instanceof St||this.track(t)},t.prototype.disposeTensor=function(t){if(this.state.tensorInfo.has(t.dataId)){this.state.numTensors--,"string"===t.dtype&&this.state.numStringTensors--;var e=this.state.tensorInfo.get(t.dataId);e.refCount<=1?("complex64"!==t.dtype&&(this.state.numBytes-=e.bytes),this.state.numDataBuffers--,e.backend.disposeData(t.dataId),this.state.tensorInfo.delete(t.dataId)):this.state.tensorInfo.get(t.dataId).refCount--}},t.prototype.disposeVariables=function(){for(var t in this.state.registeredVariables){var e=this.state.registeredVariables[t];this.disposeVariable(e)}},t.prototype.disposeVariable=function(t){this.disposeTensor(t),null!=this.state.registeredVariables[t.name]&&delete this.state.registeredVariables[t.name]},t.prototype.memory=function(){var t=this.backend.memory();return t.numTensors=this.state.numTensors,t.numDataBuffers=this.state.numDataBuffers,t.numBytes=this.state.numBytes,this.state.numStringTensors>0&&(t.unreliable=!0,null==t.reasons&&(t.reasons=[]),t.reasons.push("Memory usage by string tensors is approximate (2 bytes per character)")),t},t.prototype.profile=function(t){return a(this,void 0,void 0,function(){var e,n;return l(this,function(r){return this.state.profiling=!0,e=this.state.numBytes,n=this.state.numTensors,this.state.activeProfile.kernels=[],this.state.activeProfile.result=t(),this.state.profiling=!1,this.state.activeProfile.peakBytes=Math.max.apply(Math,this.state.activeProfile.kernels.map(function(t){return t.totalBytesSnapshot})),this.state.activeProfile.newBytes=this.state.numBytes-e,this.state.activeProfile.newTensors=this.state.numTensors-n,[2,this.state.activeProfile]})})},t.prototype.isTapeOn=function(){return this.state.gradientDepth>0&&0===this.state.kernelDepth},t.prototype.addTapeNode=function(t,e,n,r,i){var o=this,s={id:this.state.nextTapeNodeId++,kernelName:t,inputs:e,outputs:n,saved:i},a=function(t){return p.get(t)}(t);null!=a&&(r=a.gradFunc),null!=r&&(s.gradient=function(t){return t=t.map(function(t,e){if(null==t){var r=n[e],i=et(r.size,r.dtype);return o.makeTensor(i,r.shape,r.dtype)}return t}),r(t.length>1?t:t[0],i)}),this.state.activeTape.push(s)},t.prototype.keep=function(t){return t.kept=!0,t},t.prototype.startTape=function(){0===this.state.gradientDepth&&(this.state.activeTape=[]),this.state.gradientDepth++},t.prototype.endTape=function(){this.state.gradientDepth--},t.prototype.startScope=function(t){var e={track:[],name:"unnamed scope",id:this.state.nextScopeId++};t&&(e.name=t),this.state.scopeStack.push(e),this.state.activeScope=e},t.prototype.endScope=function(t){for(var e=this,n=Nt(t),r=new Set(n.map(function(t){return t.id})),i=0;i<this.state.activeScope.track.length;i++){var o=this.state.activeScope.track[i];o.kept||r.has(o.id)||o.dispose()}var s=this.state.scopeStack.pop();this.state.activeScope=0===this.state.scopeStack.length?null:this.state.scopeStack[this.state.scopeStack.length-1],n.forEach(function(t){t.kept||t.scopeId!==s.id||e.track(t)})},t.prototype.gradients=function(t,e,n,r){var i=this;if(void 0===r&&(r=!1),E(e.length>0,function(){return"gradients() received an empty list of xs."}),null!=n&&"float32"!==n.dtype)throw new Error("dy must have 'float32' dtype, but has '"+n.dtype+"'");var o=this.scopedRun(function(){return i.startTape()},function(){return i.endTape()},function(){return i.tidy("forward",t)});E(o instanceof yt,function(){return"The result y returned by f() must be a tensor."});var s=function(t,e,n){for(var r={},i={},o=0;o<e.length;o++)r[e[o].id]=!0;for(o=0;o<t.length;o++){var s=(f=t[o]).inputs;for(var a in s){for(var l=s[a],u=!1,c=0;c<e.length;c++)if(r[l.id]){f.outputs.forEach(function(t){return r[t.id]=!0}),u=!0,i[f.id]=!0;break}if(u)break}}var h={};h[n.id]=!0;var d={};for(o=t.length-1;o>=0;o--)for(s=(f=t[o]).inputs,c=0;c<f.outputs.length;c++)if(h[f.outputs[c].id]){for(var a in s)h[s[a].id]=!0,d[f.id]=!0;break}var p=[];for(o=0;o<t.length;o++){var f;if(i[(f=t[o]).id]&&d[f.id]){var g={};for(var a in f.inputs){var m=f.inputs[a];r[m.id]&&(g[a]=m)}var v=Object.assign({},f);v.inputs=g,v.outputs=f.outputs,p.push(v)}}return p}(this.state.activeTape,e,o);if(!r&&0===s.length&&e.length>0)throw new Error("Cannot compute gradient of y=f(x) with respect to x. Make sure that the f you passed encloses all operations that lead from x to y.");return this.tidy("backward",function(){var t,r,a={};a[o.id]=null==n?(r=tt(k(t=o.shape),"float32"),Pt.makeTensor(r,t,"float32")):n,function(t,e,n){for(var r=function(r){var i=e[r],o=[];if(i.outputs.forEach(function(e){var n=t[e.id];null!=n?o.push(n):o.push(null)}),null==i.gradient)throw new Error("Cannot compute gradient: gradient function not found for "+i.kernelName+".");var s=i.gradient(o),a=function(e){if(!(e in s))throw new Error("Cannot backprop through input "+e+". Available gradients found: "+Object.keys(s)+".");var r=n(function(){return s[e]()});if("float32"!==r.dtype)throw new Error("Error in gradient for op "+i.kernelName+". The gradient of input "+e+" must have 'float32' dtype, but has '"+r.dtype+"'");var o=i.inputs[e];if(!O(r.shape,o.shape))throw new Error("Error in gradient for op "+i.kernelName+". The gradient of input '"+e+"' has shape '"+r.shape+"', which does not match the shape of the input '"+o.shape+"'");if(null==t[o.id])t[o.id]=r;else{var a=t[o.id];t[o.id]=a.add(r),a.dispose()}};for(var l in i.inputs)a(l)},i=e.length-1;i>=0;i--)r(i)}(a,s,function(t){return i.tidy(t)});var l=e.map(function(t){return a[t.id]});return 0===i.state.gradientDepth&&(i.state.activeTape.forEach(function(t){for(var e=0,n=t.saved;e<n.length;e++)n[e].dispose()}),i.state.activeTape=null),{value:o,grads:l}})},t.prototype.customGrad=function(t){var e=this;return E(Y(t),function(){return"The f passed in customGrad(f) must be a function."}),function(){for(var n,r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];E(r.every(function(t){return t instanceof yt}),function(){return"The args passed in customGrad(f)(x1, x2,...) must all be tensors"});var o={};return r.forEach(function(t,e){o[e]=t}),e.runKernelFunc(function(e,i){return E((n=t.apply(void 0,r.concat([i]))).value instanceof yt,function(){return"The function f passed in customGrad(f) must return an object where `obj.value` is a tensor"}),E(Y(n.gradFunc),function(){return"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function."}),n.value},o,function(t,e){var i=n.gradFunc(t,e),o=Array.isArray(i)?i:[i];E(o.length===r.length,function(){return"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function that returns the same number of tensors as inputs passed to f(...)."}),E(o.every(function(t){return t instanceof yt}),function(){return"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function that returns a list of only tensors."});var s={};return o.forEach(function(t,e){s[e]=function(){return t}}),s})}},t.prototype.readSync=function(t){return this.state.tensorInfo.get(t).backend.readSync(t)},t.prototype.read=function(t){return this.state.tensorInfo.get(t).backend.read(t)},t.prototype.time=function(t){return a(this,void 0,void 0,function(){var e,n;return l(this,function(r){switch(r.label){case 0:return e=nt(),[4,this.backend.time(t)];case 1:return(n=r.sent()).wallMs=nt()-e,[2,n]}})})},t.prototype.track=function(t){return null!=this.state.activeScope&&(t.scopeId=this.state.activeScope.id,this.state.activeScope.track.push(t)),t},Object.defineProperty(t.prototype,"registeredVariables",{get:function(){return this.state.registeredVariables},enumerable:!0,configurable:!0}),t.prototype.reset=function(){for(var t in this.pendingBackendInitId++,this.state.dispose(),this.ENV.reset(),this.state=new Mt,this.registry)this.disposeRegisteredKernels(t),this.registry[t].dispose(),delete this.registry[t];this.backendName=null,this.backendInstance=null,this.pendingBackendInit=null},t.nextTensorId=0,t.nextVariableId=0,t}(),Pt=function(){var e=function(){if(null==Dt){var e=void 0;if("undefined"!=typeof window)e=window;else if(void 0!==t)e=t;else if(void 0!==r)e=r;else{if("undefined"==typeof self)throw new Error("Could not find a global object");e=self}Dt=e}return Dt}();if(null==e._tfengine){var n=new u(e);e._tfengine=new Lt(n)}return function(t){h=t}(e._tfengine.ENV),vt=function(){return e._tfengine},e._tfengine}();function Ft(){return"undefined"!=typeof window&&null!=window.document||"undefined"!=typeof WorkerGlobalScope}var Bt=c();Bt.registerFlag("DEBUG",function(){return!1},function(t){t&&console.warn("Debugging mode is ON. The output of every math call will be downloaded to CPU and checked for NaNs. This significantly impacts performance.")}),Bt.registerFlag("IS_BROWSER",function(){return Ft()}),Bt.registerFlag("IS_NODE",function(){return void 0!==r&&void 0!==r.versions&&void 0!==r.versions.node}),Bt.registerFlag("IS_CHROME",function(){return"undefined"!=typeof navigator&&null!=navigator&&null!=navigator.userAgent&&/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)}),Bt.registerFlag("PROD",function(){return!1}),Bt.registerFlag("TENSORLIKE_CHECK_SHAPE_CONSISTENCY",function(){return Bt.getBool("DEBUG")}),Bt.registerFlag("DEPRECATION_WARNINGS_ENABLED",function(){return!0}),Bt.registerFlag("IS_TEST",function(){return!1});var jt,$t,Ut,Vt={},Ht={alpha:!1,antialias:!1,premultipliedAlpha:!1,preserveDrawingBuffer:!1,depth:!1,stencil:!1,failIfMajorPerformanceCaveat:!0};function Wt(t,e){Vt[t]=e}function Gt(t){t in Vt||(Vt[t]=function(t){if(1!==t&&2!==t)throw new Error("Cannot get WebGL rendering context, WebGL is disabled.");var e=function(t){if("undefined"!=typeof OffscreenCanvas&&2===t)return new OffscreenCanvas(300,150);if("undefined"!=typeof document)return document.createElement("canvas");throw new Error("Cannot create a canvas in this context")}(t);return e.addEventListener("webglcontextlost",function(e){e.preventDefault(),delete Vt[t]},!1),1===t?e.getContext("webgl",Ht)||e.getContext("experimental-webgl",Ht):e.getContext("webgl2",Ht)}(t));var e=Vt[t];return e.isContextLost()?(delete Vt[t],Gt(t)):(e.disable(e.DEPTH_TEST),e.disable(e.STENCIL_TEST),e.disable(e.BLEND),e.disable(e.DITHER),e.disable(e.POLYGON_OFFSET_FILL),e.disable(e.SAMPLE_COVERAGE),e.enable(e.SCISSOR_TEST),e.enable(e.CULL_FACE),e.cullFace(e.BACK),Vt[t])}function zt(t,e){return[e,t]}function Xt(t){var e=k(t);return A(Math.ceil(e/4))}function Kt(t,e){return[Math.max(1,Math.ceil(e/2)),Math.max(1,Math.ceil(t/2))]}function Yt(t,e){var n,r,i,o,s,a,l,u,h,d=t;return 2===c().getNumber("WEBGL_VERSION")?(n=d.R32F,r=d.R16F,i=d.RGBA16F,o=d.RGBA32F,s=d.RED,a=4,l=1,u=d.HALF_FLOAT,h=d.FLOAT):(n=t.RGBA,r=t.RGBA,i=t.RGBA,o=d.RGBA,s=t.RGBA,a=4,l=4,u=null!=e?e.HALF_FLOAT_OES:null,h=t.FLOAT),{internalFormatFloat:n,internalFormatHalfFloat:r,internalFormatPackedHalfFloat:i,internalFormatPackedFloat:o,textureFormatFloat:s,downloadTextureFormat:t.RGBA,downloadUnpackNumChannels:a,defaultNumChannels:l,textureTypeHalfFloat:u,textureTypeFloat:h}}function qt(t,e,n){var r=n();return e&&function(t){var e=t.getError();if(e!==t.NO_ERROR)throw new Error("WebGL Error: "+te(t,e))}(t),r}!function(t){t[t.DENSE=0]="DENSE",t[t.SHARED_BATCH=1]="SHARED_BATCH"}(jt||(jt={})),function(t){t[t.RENDER=0]="RENDER",t[t.UPLOAD=1]="UPLOAD",t[t.PIXELS=2]="PIXELS",t[t.DOWNLOAD=3]="DOWNLOAD"}($t||($t={})),function(t){t[t.UNPACKED_FLOAT16=0]="UNPACKED_FLOAT16",t[t.UNPACKED_FLOAT32=1]="UNPACKED_FLOAT32",t[t.PACKED_4X1_UNSIGNED_BYTE=2]="PACKED_4X1_UNSIGNED_BYTE",t[t.PACKED_2X2_FLOAT32=3]="PACKED_2X2_FLOAT32",t[t.PACKED_2X2_FLOAT16=4]="PACKED_2X2_FLOAT16"}(Ut||(Ut={}));var Jt=5.96e-8,Zt=65504;function Qt(t){return!!(c().getBool("WEBGL_RENDER_FLOAT32_ENABLED")||0===t||Jt<Math.abs(t)&&Math.abs(t)<Zt)}function te(t,e){switch(e){case t.NO_ERROR:return"NO_ERROR";case t.INVALID_ENUM:return"INVALID_ENUM";case t.INVALID_VALUE:return"INVALID_VALUE";case t.INVALID_OPERATION:return"INVALID_OPERATION";case t.INVALID_FRAMEBUFFER_OPERATION:return"INVALID_FRAMEBUFFER_OPERATION";case t.OUT_OF_MEMORY:return"OUT_OF_MEMORY";case t.CONTEXT_LOST_WEBGL:return"CONTEXT_LOST_WEBGL";default:return"Unknown error code "+e}}function ee(t,e,n){return we(t,e,function(){return t.getExtension(n)},'Extension "'+n+'" not supported on this browser.')}function ne(t,e,n){var r=we(t,e,function(){return t.createShader(t.VERTEX_SHADER)},"Unable to create vertex WebGLShader.");if(qt(t,e,function(){return t.shaderSource(r,n)}),qt(t,e,function(){return t.compileShader(r)}),!1===t.getShaderParameter(r,t.COMPILE_STATUS))throw console.log(t.getShaderInfoLog(r)),new Error("Failed to compile vertex shader.");return r}function re(t,e,n){var r=we(t,e,function(){return t.createShader(t.FRAGMENT_SHADER)},"Unable to create fragment WebGLShader.");if(qt(t,e,function(){return t.shaderSource(r,n)}),qt(t,e,function(){return t.compileShader(r)}),!1===t.getShaderParameter(r,t.COMPILE_STATUS))throw function(t,e){var n=se.exec(e);if(null==n)return console.log("Couldn't parse line number in error: "+e),void console.log(t);for(var r=+n[1],i=t.split("\n"),o=i.length.toString().length+2,s=i.map(function(t,e){return N((e+1).toString(),o)+t}),a=0,l=0;l<s.length;l++)a=Math.max(s[l].length,a);var u=s.slice(0,r-1),c=s.slice(r-1,r),h=s.slice(r);console.log(u.join("\n")),console.log(e.split("\n")[0]),console.log("%c "+N(c[0],a),"border:1px solid red; background-color:#e3d2d2; color:#a61717"),console.log(h.join("\n"))}(n,t.getShaderInfoLog(r)),new Error("Failed to compile fragment shader.");return r}var ie,oe,se=/ERROR: [0-9]+:([0-9]+):/g;function ae(t,e){return we(t,e,function(){return t.createProgram()},"Unable to create WebGLProgram.")}function le(t,e,n){if(qt(t,e,function(){return t.linkProgram(n)}),!1===t.getProgramParameter(n,t.LINK_STATUS))throw console.log(t.getProgramInfoLog(n)),new Error("Failed to link vertex and fragment shaders.")}function ue(t,e,n){if(qt(t,e,function(){return t.validateProgram(n)}),!1===t.getProgramParameter(n,t.VALIDATE_STATUS))throw console.log(t.getProgramInfoLog(n)),new Error("Shader program validation failed.")}function ce(t,e,n){var r=we(t,e,function(){return t.createBuffer()},"Unable to create WebGLBuffer");return qt(t,e,function(){return t.bindBuffer(t.ARRAY_BUFFER,r)}),qt(t,e,function(){return t.bufferData(t.ARRAY_BUFFER,n,t.STATIC_DRAW)}),r}function he(t,e,n){var r=we(t,e,function(){return t.createBuffer()},"Unable to create WebGLBuffer");return qt(t,e,function(){return t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,r)}),qt(t,e,function(){return t.bufferData(t.ELEMENT_ARRAY_BUFFER,n,t.STATIC_DRAW)}),r}function de(t,e){return we(t,e,function(){return t.createTexture()},"Unable to create WebGLTexture.")}function pe(t,e){var n=c().getNumber("WEBGL_MAX_TEXTURE_SIZE");if(t<=0||e<=0){var r="["+t+"x"+e+"]";throw new Error("Requested texture size "+r+" is invalid.")}if(t>n||e>n)throw r="["+t+"x"+e+"]",new Error("Requested texture size "+r+" greater than WebGL maximum on this browser / GPU ["+n+"x"+n+"].")}function fe(t,e){return we(t,e,function(){return t.createFramebuffer()},"Unable to create WebGLFramebuffer.")}function ge(t,e,n,r,i,o,s,a){var l=t.getAttribLocation(n,r);return-1!==l&&(qt(t,e,function(){return t.bindBuffer(t.ARRAY_BUFFER,i)}),qt(t,e,function(){return t.vertexAttribPointer(l,o,t.FLOAT,!1,s,a)}),qt(t,e,function(){return t.enableVertexAttribArray(l)}),!0)}function me(t,e,n,r){Ce(t,r),qt(t,e,function(){return t.activeTexture(t.TEXTURE0+r)}),qt(t,e,function(){return t.bindTexture(t.TEXTURE_2D,n)})}function ve(t,e,n,r){return we(t,e,function(){return t.getUniformLocation(n,r)},'uniform "'+r+'" not present in program.')}function be(t,e,n){return t.getUniformLocation(e,n)}function _e(t,e,n,r,i,o){qt(t,e,function(){return me(t,e,r,o)}),qt(t,e,function(){return t.uniform1i(i,o)})}function ye(t,e,n,r){qt(t,e,function(){return t.bindFramebuffer(t.FRAMEBUFFER,r)}),qt(t,e,function(){return t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,n,0)})}function Te(t,e,n){qt(t,e,function(){return t.bindFramebuffer(t.FRAMEBUFFER,n)}),qt(t,e,function(){return t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,null,0)})}function xe(t){var e=t.checkFramebufferStatus(t.FRAMEBUFFER);if(e!==t.FRAMEBUFFER_COMPLETE)throw new Error("Error binding framebuffer: "+Ee(t,e))}function Ee(t,e){switch(e){case t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT:return"FRAMEBUFFER_INCOMPLETE_ATTACHMENT";case t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:return"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT";case t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS:return"FRAMEBUFFER_INCOMPLETE_DIMENSIONS";case t.FRAMEBUFFER_UNSUPPORTED:return"FRAMEBUFFER_UNSUPPORTED";default:return"unknown error "+e}}function we(t,e,n,r){var i=qt(t,e,function(){return n()});if(null==i)throw new Error(r);return i}function Ce(t,e){var n=t.MAX_COMBINED_TEXTURE_IMAGE_UNITS-1,r=e+t.TEXTURE0;if(r<t.TEXTURE0||r>n)throw new Error("textureUnit must be in [gl.TEXTURE0, gl.TEXTURE"+n+"].")}function Se(t,e){return void 0===e&&(e=2),k(t.slice(0,t.length-e))}function ke(t){if(0===t.length)throw Error("Cannot get rows and columns of an empty shape array.");return[t.length>1?t[t.length-2]:1,t[t.length-1]]}function Oe(t){var e=[1,1,1];return 0===t.length||1===t.length&&1===t[0]||(e=[Se(t)].concat(ke(t))),e}function Ie(t,e){var n;void 0===e&&(e=!1);var r=c().getNumber("WEBGL_MAX_TEXTURE_SIZE");if(e&&(r*=2,1===(t=t.map(function(e,n){return n>=t.length-2?T(t[n]):t[n]})).length&&(t=[2,t[0]])),2!==t.length){var i=P(t);t=i.newShape}var o=k(t);if(t.length<=1&&o<=r)return[1,o];if(2===t.length&&t[0]<=r&&t[1]<=r)return t;if(3===t.length&&t[0]*t[1]<=r&&t[2]<=r)return[t[0]*t[1],t[2]];if(3===t.length&&t[0]<=r&&t[1]*t[2]<=r)return[t[0],t[1]*t[2]];if(4===t.length&&t[0]*t[1]*t[2]<=r&&t[3]<=r)return[t[0]*t[1]*t[2],t[3]];if(4===t.length&&t[0]<=r&&t[1]*t[2]*t[3]<=r)return[t[0],t[1]*t[2]*t[3]];if(e){var s=Se(t),a=2,l=2;return t.length&&(a=(n=ke(t))[0],l=n[1]),A(o=s*(a/2)*(l/2)).map(function(t){return 2*t})}return A(o)}function Re(t){return t%2==0}function Ae(t,e){if(O(t=t.slice(-2),e=e.slice(-2)))return!0;if(!t.length||!e.length)return!0;if(0===t[0]||0===t[1]||0===e[0]||0===e[1])return!0;if(t.length!==e.length){var n=t.slice(-1)[0],r=e.slice(-1)[0];if(n===r)return!0;if(Re(n)&&Re(r)&&(1===t[0]||1===e[0]))return!0}return t[1]===e[1]&&Re(t[0])&&Re(e[0])}function Ne(t){if(null==ie){var e=Gt(t);ie=e.getParameter(e.MAX_TEXTURE_SIZE)}return ie}function De(t){if(null==oe){var e=Gt(t);oe=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)}return Math.min(16,oe)}function Me(t){if(0===t)return 0;var e=Gt(t);return Le(e,"EXT_disjoint_timer_query_webgl2")&&2===t?2:Le(e,"EXT_disjoint_timer_query")?1:0}function Le(t,e){return null!=t.getExtension(e)}function Pe(t){try{if(null!=Gt(t))return!0}catch(t){return!1}return!1}function Fe(t){if(0===t)return!1;var e=Gt(t);if(1===t){if(!Le(e,"OES_texture_float"))return!1}else if(!Le(e,"EXT_color_buffer_float"))return!1;return je(e)}function Be(t){if(0===t)return!1;var e=Gt(t);return 1!==t?Le(e,"EXT_color_buffer_float")?je(e):!!Le(e,"EXT_color_buffer_half_float")&&function(t,e){var n=Yt(t,e),r=t.createTexture();t.bindTexture(t.TEXTURE_2D,r),t.texImage2D(t.TEXTURE_2D,0,n.internalFormatHalfFloat,1,1,0,n.textureFormatFloat,n.textureTypeHalfFloat,null);var i=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,i),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,r,0);var o=t.checkFramebufferStatus(t.FRAMEBUFFER)===t.FRAMEBUFFER_COMPLETE;return t.bindTexture(t.TEXTURE_2D,null),t.bindFramebuffer(t.FRAMEBUFFER,null),t.deleteTexture(r),t.deleteFramebuffer(i),o}(e,e.getExtension("EXT_color_buffer_half_float")):!!Le(e,"OES_texture_float")&&!!Le(e,"WEBGL_color_buffer_float")&&je(e)}function je(t){var e=Yt(t),n=t.createTexture();t.bindTexture(t.TEXTURE_2D,n),t.texImage2D(t.TEXTURE_2D,0,e.internalFormatFloat,1,1,0,e.textureFormatFloat,e.textureTypeFloat,null);var r=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,r),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,n,0);var i=t.checkFramebufferStatus(t.FRAMEBUFFER)===t.FRAMEBUFFER_COMPLETE;return t.bindTexture(t.TEXTURE_2D,null),t.bindFramebuffer(t.FRAMEBUFFER,null),t.deleteTexture(n),t.deleteFramebuffer(r),i}function $e(t){return 2===t&&null!=Gt(t).fenceSync}var Ue=Object.freeze({callAndCheck:qt,canBeRepresented:Qt,getWebGLErrorMessage:te,getExtensionOrThrow:ee,createVertexShader:ne,createFragmentShader:re,createProgram:ae,linkProgram:le,validateProgram:ue,createStaticVertexBuffer:ce,createStaticIndexBuffer:he,getNumChannels:function(){return 2===c().getNumber("WEBGL_VERSION")?1:4},createTexture:de,validateTextureSize:pe,createFramebuffer:fe,bindVertexBufferToProgramAttribute:ge,bindTextureUnit:me,unbindTextureUnit:function(t,e,n){Ce(t,n),qt(t,e,function(){return t.activeTexture(t.TEXTURE0+n)}),qt(t,e,function(){return t.bindTexture(t.TEXTURE_2D,null)})},getProgramUniformLocationOrThrow:ve,getProgramUniformLocation:be,bindTextureToProgramUniformSampler:_e,bindCanvasToFramebuffer:function(t,e){qt(t,e,function(){return t.bindFramebuffer(t.FRAMEBUFFER,null)}),qt(t,e,function(){return t.viewport(0,0,t.canvas.width,t.canvas.height)}),qt(t,e,function(){return t.scissor(0,0,t.canvas.width,t.canvas.height)})},bindColorTextureToFramebuffer:ye,unbindColorTextureFromFramebuffer:Te,validateFramebuffer:xe,getFramebufferErrorMessage:Ee,getBatchDim:Se,getRowsCols:ke,getShapeAs3D:Oe,getTextureShapeFromLogicalShape:Ie,isReshapeFree:Ae,getWebGLMaxTextureSize:Ne,resetMaxTextureSize:function(){ie=null},resetMaxTexturesInShader:function(){oe=null},getMaxTexturesInShader:De,getWebGLDisjointQueryTimerVersion:Me,hasExtension:Le,isWebGLVersionEnabled:Pe,isCapableOfRenderingToFloatTexture:Fe,isDownloadFloatTextureEnabled:Be,isWebGLFenceEnabled:$e}),Ve=c();function He(t){c().getBool("DEPRECATION_WARNINGS_ENABLED")&&console.warn(t+" You can disable deprecation warnings with tf.disableDeprecationWarnings().")}function We(t,e){return Pt.tidy(t,e)}function Ge(t){Nt(t).forEach(function(t){return t.dispose()})}function ze(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];c().getBool("IS_TEST")||console.warn.apply(console,t)}function Xe(t,e){var n=t;if(V(t))return"string"===e?[]:[t.length];if(!Array.isArray(t))return[];for(var r=[];Array.isArray(n)||V(n)&&"string"!==e;)r.push(n.length),n=n[0];return Array.isArray(t)&&c().getBool("TENSORLIKE_CHECK_SHAPE_CONSISTENCY")&&function t(e,n,r){if(r=r||[],Array.isArray(e)||V(e)){E(n.length>0,function(){return"Element arr["+r.join("][")+"] should be a primitive, but is an array of "+e.length+" elements"}),E(e.length===n[0],function(){return"Element arr["+r.join("][")+"] should have "+n[0]+" elements, but has "+e.length+" elements"});for(var i=n.slice(1),o=0;o<e.length;++o)t(e[o],i,r.concat(o))}else E(0===n.length,function(){return"Element arr["+r.join("][")+"] is a primitive, but should be an array/TypedArray of "+n[0]+" elements"})}(t,r,[]),r}function Ke(t,e,n,r){if(null!=t&&("numeric"!==t&&t!==e||"numeric"===t&&"string"===e))throw new Error("Argument '"+n+"' passed to '"+r+"' must be "+t+" tensor, but got "+e+" tensor")}function Ye(t,e,n,r){if(void 0===r&&(r="numeric"),t instanceof yt)return Ke(r,t.dtype,e,n),t;var i=K(t);if("string"!==i&&["bool","int32","float32"].indexOf(r)>=0&&(i=r),Ke(r,i,e,n),null==t||!V(t)&&!Array.isArray(t)&&"number"!=typeof t&&"boolean"!=typeof t&&"string"!=typeof t){var o=null==t?"null":t.constructor.name;throw new Error("Argument '"+e+"' passed to '"+n+"' must be a Tensor or TensorLike, but got '"+o+"'")}var s=Xe(t,i);V(t)||Array.isArray(t)||(t=[t]);var a="string"!==i?Z(t,i,c().getBool("DEBUG")):S(t,[],!0);return Pt.makeTensor(a,s,i)}function qe(t,e,n,r){if(void 0===r&&(r="numeric"),!Array.isArray(t))throw new Error("Argument "+e+" passed to "+n+" must be a `Tensor[]` or `TensorLike[]`");return t.map(function(t,r){return Ye(t,e+"["+r+"]",n)},r)}function Je(t,e){for(var n=0;n<t.length;++n)if(t[t.length-n-1]!==e-1-n)return!1;return!0}function Ze(t,e,n){for(var r=t.length+e.length,i=[],o=0,s=0,a=0;a<r;a++)-1===n.indexOf(a)?i.push(t[o++]):i.push(e[s++]);return i}function Qe(t,e){for(var n=[],r=t.length,i=0;i<r;i++)-1===e.indexOf(i)&&n.push(t[i]);return[n,e.map(function(e){return t[e]})]}function tn(t,e){return Ze(t,e.map(function(t){return 1}),e)}function en(t,e,n){E(Je(e,n),function(){return t+" supports only inner-most axes for now. Got axes "+e+" and rank-"+n+" input."})}function nn(t,e){if(Je(t,e))return null;for(var n=[],r=0;r<e;++r)-1===t.indexOf(r)&&n.push(r);return t.forEach(function(t){return n.push(t)}),n}function rn(t){return t.map(function(t,e){return[e,t]}).sort(function(t,e){return t[1]-e[1]}).map(function(t){return t[0]})}function on(t,e){for(var n=[],r=e-t;r<e;++r)n.push(r);return n}function sn(t,e){var n=t[0].length;t.forEach(function(t,e){E(t.length===n,function(){return"Error in concat"+n+"D: rank of tensors["+e+"] must be the same as the rank of the rest ("+n+")"})}),E(e>=0&&e<n,function(){return"Error in concat"+n+"D: axis must be between 0 and "+(n-1)+"."});var r=t[0];t.forEach(function(t,i){for(var o=0;o<n;o++)E(o===e||t[o]===r[o],function(){return"Error in concat"+n+"D: Shape of tensors["+i+"] ("+t+") does not match the shape of the rest ("+r+") along the non-concatenated axis "+i+"."})})}function an(t,e){for(var n=t[0].slice(),r=1;r<t.length;r++)n[e]+=t[r][e];return n}function ln(t){var e=Object.keys(t);if(1!==e.length)throw new Error("Please provide an object with a single key (operation name) mapping to a function. Got an object with "+e.length+" keys.");var n=e[0],r=t[n];n.endsWith("_")&&(n=n.substring(0,n.length-1));var i=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];Pt.startScope(n);try{var i=r.apply(void 0,t);return i instanceof Promise&&console.error("Cannot return a Promise inside of tidy."),Pt.endScope(i),i}catch(t){throw Pt.endScope(null),t}};return Object.defineProperty(i,"name",{value:n,configurable:!0}),i}Ve.registerFlag("HAS_WEBGL",function(){return Ve.getNumber("WEBGL_VERSION")>0}),Ve.registerFlag("WEBGL_VERSION",function(){return Pe(2)?2:Pe(1)?1:0}),Ve.registerFlag("WEBGL_BUFFER_SUPPORTED",function(){return 2===Ve.get("WEBGL_VERSION")}),Ve.registerFlag("WEBGL_CPU_FORWARD",function(){return!0}),Ve.registerFlag("WEBGL_FORCE_F16_TEXTURES",function(){return!1}),Ve.registerFlag("WEBGL_PACK",function(){return Ve.getBool("HAS_WEBGL")}),Ve.registerFlag("WEBGL_PACK_NORMALIZATION",function(){return Ve.getBool("WEBGL_PACK")}),Ve.registerFlag("WEBGL_PACK_CLIP",function(){return Ve.getBool("WEBGL_PACK")}),Ve.registerFlag("WEBGL_PACK_DEPTHWISECONV",function(){return!1}),Ve.registerFlag("WEBGL_PACK_BINARY_OPERATIONS",function(){return Ve.getBool("WEBGL_PACK")}),Ve.registerFlag("WEBGL_PACK_UNARY_OPERATIONS",function(){return Ve.getBool("WEBGL_PACK")}),Ve.registerFlag("WEBGL_PACK_ARRAY_OPERATIONS",function(){return Ve.getBool("WEBGL_PACK")}),Ve.registerFlag("WEBGL_PACK_IMAGE_OPERATIONS",function(){return Ve.getBool("WEBGL_PACK")}),Ve.registerFlag("WEBGL_PACK_REDUCE",function(){return Ve.getBool("WEBGL_PACK")}),Ve.registerFlag("WEBGL_LAZILY_UNPACK",function(){return Ve.getBool("WEBGL_PACK")}),Ve.registerFlag("WEBGL_CONV_IM2COL",function(){return Ve.getBool("WEBGL_PACK")}),Ve.registerFlag("WEBGL_MAX_TEXTURE_SIZE",function(){return Ne(Ve.getNumber("WEBGL_VERSION"))}),Ve.registerFlag("WEBGL_MAX_TEXTURES_IN_SHADER",function(){return De(Ve.getNumber("WEBGL_VERSION"))}),Ve.registerFlag("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION",function(){var t=Ve.getNumber("WEBGL_VERSION");return 0===t?0:Me(t)}),Ve.registerFlag("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE",function(){return Ve.getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0&&(t=navigator.userAgent||navigator.vendor||window.opera,!(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4))));var t}),Ve.registerFlag("WEBGL_RENDER_FLOAT32_CAPABLE",function(){return Fe(Ve.getNumber("WEBGL_VERSION"))}),Ve.registerFlag("WEBGL_RENDER_FLOAT32_ENABLED",function(){return!Ve.getBool("WEBGL_FORCE_F16_TEXTURES")&&Ve.getBool("WEBGL_RENDER_FLOAT32_CAPABLE")}),Ve.registerFlag("WEBGL_DOWNLOAD_FLOAT_ENABLED",function(){return Be(Ve.getNumber("WEBGL_VERSION"))}),Ve.registerFlag("WEBGL_FENCE_API_ENABLED",function(){return $e(Ve.getNumber("WEBGL_VERSION"))}),Ve.registerFlag("WEBGL_SIZE_UPLOAD_UNIFORM",function(){return Ve.getBool("WEBGL_RENDER_FLOAT32_ENABLED")?4:0}),_t=He;var un=ln({complex_:function(t,e){var n=Ye(t,"real","complex"),r=Ye(e,"imag","complex");return w(n.shape,r.shape,"real and imag shapes, "+n.shape+" and "+r.shape+", must match in call to tf.complex()."),Pt.runKernelFunc(function(t){return t.complex(n,r)},{$real:n,$imag:r})}}),cn=ln({real_:function(t){var e=Ye(t,"input","real");return Pt.runKernelFunc(function(t){return t.real(e)},{$input:e})}}),hn=ln({imag_:function(t){var e=Ye(t,"input","imag");return Pt.runKernelFunc(function(t){return t.imag(e)},{$input:e})}});function dn(t,e,n){return pn(t,e,Xe(t,n),n)}function pn(t,e,n,r){if(null==r&&(r=K(t)),"complex64"===r)throw new Error("Cannot construct a complex64 tensor directly. Please use tf.complex(real, imag).");if(!V(t)&&!Array.isArray(t)&&"number"!=typeof t&&"boolean"!=typeof t&&"string"!=typeof t)throw new Error("values passed to tensor(values) must be a number/boolean/string or an array of numbers/booleans/strings, or a TypedArray");if(null!=e){rt(e);var i=k(e),o=k(n);E(i===o,function(){return"Based on the provided shape, ["+e+"], the tensor should have "+i+" values but has "+o});for(var s=0;s<n.length;++s){var a=n[s],l=s!==n.length-1||a!==k(e.slice(s));E(n[s]===e[s]||!l,function(){return"Error creating a new Tensor. Inferred shape ("+n+") does not match the provided shape ("+e+"). "})}}return V(t)||Array.isArray(t)||(t=[t]),e=e||n,t="string"!==r?Z(t,r,c().getBool("DEBUG")):S(t,[],!0),Pt.makeTensor(t,e,r)}function fn(t,e){if((V(t)&&"string"!==e||Array.isArray(t))&&"complex64"!==e)throw new Error("Error creating a new Scalar: value must be a primitive (number|boolean|string)");if("string"===e&&V(t)&&!(t instanceof Uint8Array))throw new Error("When making a scalar from encoded string, the value must be `Uint8Array`.");return pn(t,[],[],e)}function gn(t,e){C(t);var n=Xe(t,e);if(1!==n.length)throw new Error("tensor1d() requires values to be a flat/TypedArray");return pn(t,null,n,e)}function mn(t,e,n){if(C(t),null!=e&&2!==e.length)throw new Error("tensor2d() requires shape to have two numbers");var r=Xe(t,n);if(2!==r.length&&1!==r.length)throw new Error("tensor2d() requires values to be number[][] or flat/TypedArray");if(1===r.length&&null==e)throw new Error("tensor2d() requires shape to be provided when `values` are a flat/TypedArray");return pn(t,e,r,n)}function vn(t,e,n){if(C(t),null!=e&&3!==e.length)throw new Error("tensor3d() requires shape to have three numbers");var r=Xe(t,n);if(3!==r.length&&1!==r.length)throw new Error("tensor3d() requires values to be number[][][] or flat/TypedArray");if(1===r.length&&null==e)throw new Error("tensor3d() requires shape to be provided when `values` are a flat array");return pn(t,e,r,n)}function bn(t,e,n){if(C(t),null!=e&&4!==e.length)throw new Error("tensor4d() requires shape to have four numbers");var r=Xe(t,n);if(4!==r.length&&1!==r.length)throw new Error("tensor4d() requires values to be number[][][][] or flat/TypedArray");if(1===r.length&&null==e)throw new Error("tensor4d() requires shape to be provided when `values` are a flat array");return pn(t,e,r,n)}function _n(t,e){if(void 0===e&&(e="float32"),"complex64"===e){var n=_n(t,"float32"),r=yn(t,"float32");return un(n,r)}var i=tt(k(t),e);return Pt.makeTensor(i,t,e)}function yn(t,e){if(void 0===e&&(e="float32"),"complex64"===e){var n=yn(t,"float32"),r=yn(t,"float32");return un(n,r)}var i=et(k(t),e);return Pt.makeTensor(i,t,e)}function Tn(t,e,n){return Pt.runKernelFunc(function(r){return r.fill(t,e,n)},{})}function xn(t,e,n,r){if(void 0===n&&(n=1),void 0===r&&(r="float32"),0===n)throw new Error("Cannot have a step of zero");if(t===e||t<e&&n<0||e<t&&n>1)return yn([0],r);var i=et(Math.abs(Math.ceil((e-t)/n)),r);e<t&&1===n&&(n=-1),i[0]=t;for(var o=1;o<i.length;o++)i[o]=i[o-1]+n;return gn(i,r)}var En=ln({onesLike_:function(t){var e=Ye(t,"x","onesLike");if("complex64"===e.dtype){var n=En(cn(e)),r=wn(hn(e));return un(n,r)}return Pt.runKernelFunc(function(t){return t.onesLike(e)},{$x:e},function(t,e){return{$x:function(){return wn(t)}}})}}),wn=ln({zerosLike_:function(t){var e=Ye(t,"x","zerosLike");return Pt.runKernelFunc(function(t){return t.zerosLike(e)},{$x:e},function(t,e){return{$x:function(){return wn(t)}}})}}),Cn=ln({concat_:function(t,e){void 0===e&&(e=0),E(t.length>=1,function(){return"Pass at least one tensor to concat"});var n=qe(t,"tensors","concat");"complex64"===n[0].dtype&&n.forEach(function(t){if("complex64"!==t.dtype)throw new Error("Cannot concatenate complex64 tensors with a tensor\n with dtype "+t.dtype+". ")}),e=L(e,n[0].shape)[0];var r=an(n.map(function(t){return t.shape}),e);if(0===k(r))return dn([],r);if(1===(n=n.filter(function(t){return t.size>0})).length)return n[0];var i=n.map(function(t){return t.shape});sn(i,e);var o=n,s={axis:e};return Pt.runKernelFunc(function(t){return t.concat(n,e)},o,function(t){var n=i.map(function(t){return t[e]});return Rn(t,n,e).map(function(t){return function(){return t}})},"Concat",s)}}),Sn=ln({concat1d_:function(t){return Cn(t,0)}}),kn=ln({concat2d_:function(t,e){return Cn(t,e)}}),On=ln({concat3d_:function(t,e){return Cn(t,e)}}),In=ln({concat4d_:function(t,e){return Cn(t,e)}}),Rn=ln({split_:function(t,e,n){void 0===n&&(n=0);var r,i=Ye(t,"x","split");return n=L(n,i.shape)[0],"number"==typeof e?(E(i.shape[n]%e==0,function(){return"Number of splits must evenly divide the axis."}),r=new Array(e).fill(i.shape[n]/e)):(E(i.shape[n]===e.reduce(function(t,e){return t+e}),function(){return"The sum of sizes must match the size of the axis dimension."}),r=e),Pt.runKernelFunc(function(t){return t.split(i,r,n)},{$x:i},function(t){return{$x:function(){return Cn(t,n)}}})}});function An(t,e){return t(e={exports:{}},e.exports),e.exports}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==t||"undefined"!=typeof self&&self;var Nn=An(function(t){!function(t,e,n){function r(t,e){return e.c=t.c,e.s0=t.s0,e.s1=t.s1,e.s2=t.s2,e}function i(t,e){var n=new function(t){var e,n=this,r=(e=4022871197,function(t){t=t.toString();for(var n=0;n<t.length;n++){var r=.02519603282416938*(e+=t.charCodeAt(n));r-=e=r>>>0,e=(r*=e)>>>0,e+=4294967296*(r-=e)}return 2.3283064365386963e-10*(e>>>0)});n.next=function(){var t=2091639*n.s0+2.3283064365386963e-10*n.c;return n.s0=n.s1,n.s1=n.s2,n.s2=t-(n.c=0|t)},n.c=1,n.s0=r(" "),n.s1=r(" "),n.s2=r(" "),n.s0-=r(t),n.s0<0&&(n.s0+=1),n.s1-=r(t),n.s1<0&&(n.s1+=1),n.s2-=r(t),n.s2<0&&(n.s2+=1),r=null}(t),i=e&&e.state,o=n.next;return o.int32=function(){return 4294967296*n.next()|0},o.double=function(){return o()+1.1102230246251565e-16*(2097152*o()|0)},o.quick=o,i&&("object"==typeof i&&r(i,n),o.state=function(){return r(n,{})}),o}e&&e.exports?e.exports=i:this.alea=i}(0,t)}),Dn=An(function(t){!function(t,e,n){function r(t,e){return e.x=t.x,e.y=t.y,e.z=t.z,e.w=t.w,e}function i(t,e){var n=new function(t){var e=this,n="";e.x=0,e.y=0,e.z=0,e.w=0,e.next=function(){var t=e.x^e.x<<11;return e.x=e.y,e.y=e.z,e.z=e.w,e.w^=e.w>>>19^t^t>>>8},t===(0|t)?e.x=t:n+=t;for(var r=0;r<n.length+64;r++)e.x^=0|n.charCodeAt(r),e.next()}(t),i=e&&e.state,o=function(){return(n.next()>>>0)/4294967296};return o.double=function(){do{var t=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},o.int32=n.next,o.quick=o,i&&("object"==typeof i&&r(i,n),o.state=function(){return r(n,{})}),o}e&&e.exports?e.exports=i:this.xor128=i}(0,t)}),Mn=An(function(t){!function(t,e,n){function r(t,e){return e.x=t.x,e.y=t.y,e.z=t.z,e.w=t.w,e.v=t.v,e.d=t.d,e}function i(t,e){var n=new function(t){var e=this,n="";e.next=function(){var t=e.x^e.x>>>2;return e.x=e.y,e.y=e.z,e.z=e.w,e.w=e.v,(e.d=e.d+362437|0)+(e.v=e.v^e.v<<4^t^t<<1)|0},e.x=0,e.y=0,e.z=0,e.w=0,e.v=0,t===(0|t)?e.x=t:n+=t;for(var r=0;r<n.length+64;r++)e.x^=0|n.charCodeAt(r),r==n.length&&(e.d=e.x<<10^e.x>>>4),e.next()}(t),i=e&&e.state,o=function(){return(n.next()>>>0)/4294967296};return o.double=function(){do{var t=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},o.int32=n.next,o.quick=o,i&&("object"==typeof i&&r(i,n),o.state=function(){return r(n,{})}),o}e&&e.exports?e.exports=i:this.xorwow=i}(0,t)}),Ln=An(function(t){!function(t,e,n){function r(t,e){return e.x=t.x.slice(),e.i=t.i,e}function i(t,e){null==t&&(t=+new Date);var n=new function(t){var e=this;e.next=function(){var t,n,r=e.x,i=e.i;return t=r[i],n=(t^=t>>>7)^t<<24,n^=(t=r[i+1&7])^t>>>10,n^=(t=r[i+3&7])^t>>>3,n^=(t=r[i+4&7])^t<<7,t=r[i+7&7],n^=(t^=t<<13)^t<<9,r[i]=n,e.i=i+1&7,n},function(t,e){var n,r=[];if(e===(0|e))r[0]=e;else for(e=""+e,n=0;n<e.length;++n)r[7&n]=r[7&n]<<15^e.charCodeAt(n)+r[n+1&7]<<13;for(;r.length<8;)r.push(0);for(n=0;n<8&&0===r[n];++n);for(8==n?r[7]=-1:r[n],t.x=r,t.i=0,n=256;n>0;--n)t.next()}(e,t)}(t),i=e&&e.state,o=function(){return(n.next()>>>0)/4294967296};return o.double=function(){do{var t=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},o.int32=n.next,o.quick=o,i&&(i.x&&r(i,n),o.state=function(){return r(n,{})}),o}e&&e.exports?e.exports=i:this.xorshift7=i}(0,t)}),Pn=An(function(t){!function(t,e,n){function r(t,e){return e.i=t.i,e.w=t.w,e.X=t.X.slice(),e}function i(t,e){null==t&&(t=+new Date);var n=new function(t){var e=this;e.next=function(){var t,n,r=e.w,i=e.X,o=e.i;return e.w=r=r+1640531527|0,n=i[o+34&127],t=i[o=o+1&127],n^=n<<13,t^=t<<17,n^=n>>>15,t^=t>>>12,n=i[o]=n^t,e.i=o,n+(r^r>>>16)|0},function(t,e){var n,r,i,o,s,a=[],l=128;for(e===(0|e)?(r=e,e=null):(e+="\0",r=0,l=Math.max(l,e.length)),i=0,o=-32;o<l;++o)e&&(r^=e.charCodeAt((o+32)%e.length)),0===o&&(s=r),r^=r<<10,r^=r>>>15,r^=r<<4,r^=r>>>13,o>=0&&(s=s+1640531527|0,i=0==(n=a[127&o]^=r+s)?i+1:0);for(i>=128&&(a[127&(e&&e.length||0)]=-1),i=127,o=512;o>0;--o)r=a[i+34&127],n=a[i=i+1&127],r^=r<<13,n^=n<<17,r^=r>>>15,n^=n>>>12,a[i]=r^n;t.w=s,t.X=a,t.i=i}(e,t)}(t),i=e&&e.state,o=function(){return(n.next()>>>0)/4294967296};return o.double=function(){do{var t=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},o.int32=n.next,o.quick=o,i&&(i.X&&r(i,n),o.state=function(){return r(n,{})}),o}e&&e.exports?e.exports=i:this.xor4096=i}(0,t)}),Fn=An(function(t){!function(t,e,n){function r(t,e){return e.a=t.a,e.b=t.b,e.c=t.c,e.d=t.d,e}function i(t,e){var n=new function(t){var e=this,n="";e.next=function(){var t=e.b,n=e.c,r=e.d,i=e.a;return t=t<<25^t>>>7^n,n=n-r|0,r=r<<24^r>>>8^i,i=i-t|0,e.b=t=t<<20^t>>>12^n,e.c=n=n-r|0,e.d=r<<16^n>>>16^i,e.a=i-t|0},e.a=0,e.b=0,e.c=-1640531527,e.d=1367130551,t===Math.floor(t)?(e.a=t/4294967296|0,e.b=0|t):n+=t;for(var r=0;r<n.length+20;r++)e.b^=0|n.charCodeAt(r),e.next()}(t),i=e&&e.state,o=function(){return(n.next()>>>0)/4294967296};return o.double=function(){do{var t=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},o.int32=n.next,o.quick=o,i&&("object"==typeof i&&r(i,n),o.state=function(){return r(n,{})}),o}e&&e.exports?e.exports=i:this.tychei=i}(0,t)}),Bn=An(function(t){!function(e,r){var i,o=this,s=256,a=6,l="random",u=r.pow(s,a),c=r.pow(2,52),h=2*c,d=s-1;function p(t,n,d){var p=[],b=m(function t(e,n){var r,i=[],o=typeof e;if(n&&"object"==o)for(r in e)try{i.push(t(e[r],n-1))}catch(t){}return i.length?i:"string"==o?e:e+"\0"}((n=1==n?{entropy:!0}:n||{}).entropy?[t,v(e)]:null==t?function(){try{var t;return i&&(t=i.randomBytes)?t=t(s):(t=new Uint8Array(s),(o.crypto||o.msCrypto).getRandomValues(t)),v(t)}catch(t){var n=o.navigator,r=n&&n.plugins;return[+new Date,o,r,o.screen,v(e)]}}():t,3),p),_=new f(p),y=function(){for(var t=_.g(a),e=u,n=0;t<c;)t=(t+n)*s,e*=s,n=_.g(1);for(;t>=h;)t/=2,e/=2,n>>>=1;return(t+n)/e};return y.int32=function(){return 0|_.g(4)},y.quick=function(){return _.g(4)/4294967296},y.double=y,m(v(_.S),e),(n.pass||d||function(t,e,n,i){return i&&(i.S&&g(i,_),t.state=function(){return g(_,{})}),n?(r[l]=t,e):t})(y,b,"global"in n?n.global:this==r,n.state)}function f(t){var e,n=t.length,r=this,i=0,o=r.i=r.j=0,a=r.S=[];for(n||(t=[n++]);i<s;)a[i]=i++;for(i=0;i<s;i++)a[i]=a[o=d&o+t[i%n]+(e=a[i])],a[o]=e;(r.g=function(t){for(var e,n=0,i=r.i,o=r.j,a=r.S;t--;)e=a[i=d&i+1],n=n*s+a[d&(a[i]=a[o=d&o+e])+(a[o]=e)];return r.i=i,r.j=o,n})(s)}function g(t,e){return e.i=t.i,e.j=t.j,e.S=t.S.slice(),e}function m(t,e){for(var n,r=t+"",i=0;i<r.length;)e[d&i]=d&(n^=19*e[d&i])+r.charCodeAt(i++);return v(e)}function v(t){return String.fromCharCode.apply(0,t)}if(r["seed"+l]=p,m(r.random(),e),t.exports){t.exports=p;try{i=n(0)}catch(t){}}}([],Math)});Bn.alea=Nn,Bn.xor128=Dn,Bn.xorwow=Mn,Bn.xorshift7=Ln,Bn.xor4096=Pn,Bn.tychei=Fn;var jn=Bn.alea,$n=function(){function t(t,e,n,r,i){this.mean=t,this.stdDev=e,this.dtype=n,this.nextVal=NaN,this.truncated=r,this.truncated&&(this.upper=this.mean+2*this.stdDev,this.lower=this.mean-2*this.stdDev);var o=i||Math.random();this.random=jn(o.toString())}return t.prototype.nextValue=function(){if(!isNaN(this.nextVal)){var t=this.nextVal;return this.nextVal=NaN,t}for(var e,n,r=!1;!r;){var i=void 0,o=void 0,s=void 0;do{s=(i=2*this.random()-1)*i+(o=2*this.random()-1)*o}while(s>=1||0===s);var a=Math.sqrt(-2*Math.log(s)/s);e=this.mean+this.stdDev*i*a,n=this.mean+this.stdDev*o*a,this.truncated&&!this.isValidTruncated(e)||(r=!0)}return this.truncated&&!this.isValidTruncated(n)||(this.nextVal=this.convertValue(n)),this.convertValue(e)},t.prototype.convertValue=function(t){return null==this.dtype||"float32"===this.dtype?t:Math.round(t)},t.prototype.isValidTruncated=function(t){return t<=this.upper&&t>=this.lower},t}(),Un=function(){function t(t,e,n,r){this.alpha=t,this.beta=1/e,this.dtype=n;var i=r||Math.random();this.randu=jn(i.toString()),this.randn=new $n(0,1,n,!1,this.randu()),this.d=t<1?t+2/3:t-1/3,this.c=1/Math.sqrt(9*this.d)}return t.prototype.nextValue=function(){for(var t,e,n,r,i,o;;){do{r=this.randn.nextValue(),o=1+this.c*r}while(o<=0);if(o*=o*o,e=1-.331*(t=r*r)*t,n=.5*t+this.d*(1-o+Math.log(o)),(i=this.randu())<e||Math.log(i)<n)break}return o=1/this.beta*this.d*o,this.alpha<1&&(o*=Math.pow(this.randu(),1/this.alpha)),this.convertValue(o)},t.prototype.convertValue=function(t){return"float32"===this.dtype?t:Math.round(t)},t}(),Vn=function(){function t(t,e,n,r){var i=this;if(void 0===t&&(t=0),void 0===e&&(e=1),this.canReturnFloat=function(){return null==i.dtype||"float32"===i.dtype},this.min=t,this.range=e-t,this.dtype=n,null==r&&(r=Math.random()),"number"==typeof r&&(r=r.toString()),!this.canReturnFloat()&&this.range<=1)throw new Error("The difference between "+t+" - "+e+" <= 1 and dtype is not float");this.random=jn(r)}return t.prototype.convertValue=function(t){return this.canReturnFloat()?t:Math.round(t)},t.prototype.nextValue=function(){return this.convertValue(this.min+this.range*this.random())},t}();function Hn(t,e,n){return void 0===e&&(e="float32"),e=e||"float32",rt(t),new mt(t,e,n)}var Wn=ln({batchToSpaceND_:function(t,e,n){var r=Ye(t,"x","batchToSpaceND"),i=e.reduce(function(t,e){return t*e});return E(r.rank>=1+e.length,function(){return"input rank is "+r.rank+" but should be > than blockShape.length "+e.length}),E(n.length===e.length,function(){return"crops.length is "+n.length+" but should be equal to blockShape.length "+e.length}),E(r.shape[0]%i==0,function(){return"input tensor batch is "+r.shape[0]+" but is not divisible by the product of the elements of blockShape "+e.join(" * ")+" === "+i}),Pt.runKernelFunc(function(t){return t.batchToSpaceND(r,e,n)},{$x:r},function(t){return{$x:function(){return t.spaceToBatchND(e,n)}}})}}),Gn=ln({broadcastTo_:function(t,e){var n=Ye(t,"broadcastTo","x"),r=n.shape;if(e.some(function(t){return!(t>0)||t%1!=0}))throw new Error("broadcastTo(): Invalid broadcast shape ["+e+"].");if(e.length<n.rank)throw new Error("broadcastTo(): shape.length="+e.length+" < input.rank="+n.rank+".");if(e.length>n.rank){for(var i=n.shape.slice();i.length<e.length;)i.unshift(1);n=n.reshape(i)}for(var o=Array.from(e),s=e.length-1;s>=0;s--)if(n.shape[s]===e[s])o[s]=1;else if(1!==n.shape[s])throw new Error("broadcastTo(): ["+r+"] cannot be broadcast to ["+e+"].");var a=o.map(function(t,e){return t>1?e:-1}).filter(function(t){return t>=0});return 0===a.length?n.clone():Pt.runKernelFunc(function(t){return t.tile(n,o)},{input:n},function(t){return{input:function(){return t.sum(a,!0)}}})}}),zn=ln({cast_:function(t,e){var n=Ye(t,"x","cast");if(!$(e))throw new Error("Failed to cast to unknown dtype "+e);if("string"===e&&"string"!==n.dtype||"string"!==e&&"string"===n.dtype)throw new Error("Only strings can be casted to strings");var r={dtype:e};return Pt.runKernelFunc(function(t){return t.cast(n,e)},{x:n},function(t){return{x:function(){return t.clone()}}},"Cast",r)}}),Xn=ln({clone_:function(t){var e=Ye(t,"x","clone",null);return Pt.runKernelFunc(function(){return Pt.makeTensorFromDataId(e.dataId,e.shape,e.dtype)},{$x:e},function(t){return{$x:function(){return t.toFloat()}}})}}),Kn=ln({cumsum_:function(t,e,n,r){void 0===e&&(e=0),void 0===n&&(n=!1),void 0===r&&(r=!1);var i=Ye(t,"x","cumsum"),o=nn([e|=0],i.rank),s=i;null!=o&&(s=i.transpose(o));var a=on(1,i.rank)[0],l=Pt.runKernelFunc(function(t){return t.cumsum(s,a,n,r)},{permutedX:s},function(t){return{permutedX:function(){return t.cumsum(e,n,!r)}}});return null!=o&&(l=l.transpose(o)),l}}),Yn=ln({depthToSpace_:function(t,e,n){void 0===n&&(n="NHWC");var r=Ye(t,"x","depthToSpace"),i="NHWC"===n?r.shape[1]:r.shape[2],o="NHWC"===n?r.shape[2]:r.shape[3],s="NHWC"===n?r.shape[3]:r.shape[1];return E(i*e>=0,function(){return"Negative dimension size caused by overflow when multiplying\n "+i+" and "+e+" for depthToSpace with input shape\n "+r.shape}),E(o*e>=0,function(){return"Negative dimension size caused by overflow when multiplying\n "+o+" and "+e+" for depthToSpace with input shape\n "+r.shape}),E(s%(e*e)==0,function(){return"Dimension size must be evenly divisible by "+e*e+" but is "+s+" for depthToSpace with input shape "+r.shape}),Pt.runKernelFunc(function(t){return t.depthToSpace(r,e,n)},{$x:r})}}),qn=ln({expandDims_:function(t,e){void 0===e&&(e=0);var n=Ye(t,"x","expandDims",null);E(e<=n.rank,function(){return"Axis must be <= rank of the tensor"});var r=n.shape.slice();return e<0&&(E(-(n.rank+1)<=e,function(){return"Axis must be in the interval ["+-(n.rank+1)+", "+n.rank+"]"}),e=n.rank+e+1),r.splice(e,0,1),ur(n,r)}}),Jn=ln({eye_:function(t,e,n,r){void 0===r&&(r="float32"),null==e&&(e=t);for(var i=Hn([t,e],r),o=t<=e?t:e,s=0;s<o;++s)i.set(1,s,s);var a=i.toTensor().as2D(t,e);if(null==n)return a;if(1===n.length)return pr(qn(a,0),[n[0],1,1]);if(2===n.length)return pr(qn(qn(a,0),0),[n[0],n[1],1,1]);if(3===n.length)return pr(qn(qn(qn(a,0),0),0),[n[0],n[1],n[2],1,1]);throw new Error("eye() currently supports only 1D and 2D batchShapes, but received "+n.length+"D.")}}),Zn=ln({multinomial_:function(t,e,n,r){void 0===r&&(r=!1);var i=Ye(t,"logits","multinomial"),o=i.size,s=i.rank;if(o<2)throw new Error("Error in multinomial: you need at least 2 outcomes, but got "+o+".");if(s>2)throw new Error("Rank of probabilities must be 1 or 2, but is "+s);n=n||Math.random();var a=1===s?i.as2D(1,-1):i,l=Pt.runKernelFunc(function(t){return t.multinomial(a,r,e,n)},{logits2D:a});return 1===s?l.as1D():l}}),Qn=ln({oneHot_:function(t,e,n,r){if(void 0===n&&(n=1),void 0===r&&(r=0),e<2)throw new Error("Error in oneHot: depth must be >=2, but it is "+e);var i=Ye(t,"indices","oneHot","int32"),o=i.shape.concat([e]);return i=i.flatten(),Pt.runKernelFunc(function(t){return t.oneHot(i,e,n,r)},{$indices:i},function(t){return{$indices:function(){return yn(i.shape,"float32")}}}).reshape(o)}}),tr=ln({pad_:function(t,e,n){void 0===n&&(n=0);var r=Ye(t,"x","pad");if(0===r.rank)throw new Error("pad(scalar) is not defined. Pass non-scalar to pad");var i={paddings:e,constantValue:n};return Pt.runKernelFunc(function(t){return t.pad(r,e,n)},{x:r},function(t){var n=e.map(function(t){return t[0]});return{x:function(){return t.slice(n,r.shape)}}},"PadV2",i)}}),er=ln({pad1d_:function(t,e,n){return void 0===n&&(n=0),E(2===e.length,function(){return"Invalid number of paddings. Must be length of 2."}),tr(t,[e],n)}}),nr=ln({pad2d_:function(t,e,n){return void 0===n&&(n=0),E(2===e.length&&2===e[0].length&&2===e[1].length,function(){return"Invalid number of paddings. Must be length of 2 each."}),tr(t,e,n)}}),rr=ln({pad3d_:function(t,e,n){return void 0===n&&(n=0),E(3===e.length&&2===e[0].length&&2===e[1].length&&2===e[2].length,function(){return"Invalid number of paddings. Must be length of 2 each."}),tr(t,e,n)}}),ir=ln({pad4d_:function(t,e,n){return void 0===n&&(n=0),E(4===e.length&&2===e[0].length&&2===e[1].length&&2===e[2].length&&2===e[3].length,function(){return"Invalid number of paddings. Must be length of 2 each."}),tr(t,e,n)}}),or=ln({rand_:function(t,e,n){var r=k(t),i=null;if(null==n||"float32"===n)i=new Float32Array(r);else if("int32"===n)i=new Int32Array(r);else{if("bool"!==n)throw new Error("Unknown data type "+n);i=new Uint8Array(r)}for(var o=0;o<r;o++)i[o]=e();return Pt.makeTensor(i,t,n)}}),sr=ln({randomNormal_:function(t,e,n,r,i){if(void 0===e&&(e=0),void 0===n&&(n=1),null!=r&&"bool"===r)throw new Error("Unsupported data type "+r);for(var o=new $n(e,n,r,!1,i),s=Hn(t,r),a=0;a<s.values.length;a++)s.values[a]=o.nextValue();return s.toTensor()}}),ar=ln({randomGamma_:function(t,e,n,r,i){if(void 0===n&&(n=1),void 0===r&&(r="float32"),null==n&&(n=1),null==r&&(r="float32"),"float32"!==r&&"int32"!==r)throw new Error("Unsupported data type "+r);for(var o=new Un(e,n,r,i),s=Hn(t,r),a=0;a<s.values.length;a++)s.values[a]=o.nextValue();return s.toTensor()}}),lr=ln({randomUniform_:function(t,e,n,r,i){void 0===e&&(e=0),void 0===n&&(n=1),void 0===r&&(r="float32");for(var o=Hn(t,r),s=new Vn(e,n,null,i),a=0;a<o.values.length;a++)o.values[a]=s.nextValue();return o.toTensor()}}),ur=ln({reshape_:function(t,e){var n=Ye(t,"x","reshape",null);e=M(e,n.size),E(n.size===k(e),function(){return"new shape and old shape must have the same number of elements."});var r={shape:e};return Pt.runKernelFunc(function(t){return t.reshape(n,e)},{x:n},function(t){return{x:function(){return t.reshape(n.shape)}}},"Reshape",r)}}),cr=ln({spaceToBatchND_:function(t,e,n){var r=Ye(t,"x","spaceToBatchND");return E(r.rank>=1+e.length,function(){return"input rank "+r.rank+" should be > than [blockShape] "+e.length}),E(n.length===e.length,function(){return"paddings.shape[0] "+n.length+" must be equal to [blockShape] "+e.length}),E(r.shape.reduce(function(t,r,i){return i>0&&i<=e.length?t&&(r+n[i-1][0]+n[i-1][1])%e[i-1]==0:t},!0),function(){return"input spatial dimensions "+r.shape.slice(1)+" with paddings "+n.toString()+" must be divisible by blockShapes "+e.toString()}),Pt.runKernelFunc(function(t){return t.spaceToBatchND(r,e,n)},{$x:r},function(t){return{$x:function(){return t.batchToSpaceND(e,n)}}})}}),hr=ln({squeeze_:function(t,e){var n=Ye(t,"x","squeeze");return ur(n,P(n.shape,e).newShape)}}),dr=ln({stack_:function(t,e){void 0===e&&(e=0);var n=qe(t,"tensors","stack");if(E(n.length>=1,function(){return"Pass at least one tensor to tf.stack"}),1===n.length)return n[0].expandDims(e);var r=n[0].rank,i=n[0].shape,o=n[0].dtype;E(e<=r,function(){return"Axis must be <= rank of the tensor"}),n.forEach(function(t){w(i,t.shape,"All tensors passed to stack must have matching shapes")}),n.forEach(function(t){E(o===t.dtype,function(){return"All tensors passed to stack must have matching dtypes"})});var s=n.map(function(t){return t.expandDims(e)});return Cn(s,e)}}),pr=ln({tile_:function(t,e){var n=Ye(t,"x","tile",null);E(n.rank===e.length,function(){return"Error in transpose: rank of input "+n.rank+" must match length of reps "+e+"."});var r=[n],i={reps:e};return Pt.runKernelFunc(function(t,r){var i=t.tile(n,e);return r([n]),i},{x:n},function(t,n){var r=n[0];return{x:function(){var n=wn(r);if(1===r.rank)for(var i=0;i<e[0];++i)n=n.add(t.slice([i*r.shape[0]],[r.shape[0]]));else if(2===r.rank)for(i=0;i<e[0];++i)for(var o=0;o<e[1];++o)n=n.add(t.slice([i*r.shape[0],o*r.shape[1]],[r.shape[0],r.shape[1]]));else if(3===r.rank)for(i=0;i<e[0];++i)for(o=0;o<e[1];++o)for(var s=0;s<e[2];++s)n=n.add(t.slice([i*r.shape[0],o*r.shape[1],s*r.shape[2]],[r.shape[0],r.shape[1],r.shape[2]]));else{if(4!==r.rank)throw new Error("Gradient for tile operation is not implemented for rank-"+r.rank+" tensors yet.");for(i=0;i<e[0];++i)for(o=0;o<e[1];++o)for(s=0;s<e[2];++s)for(var a=0;a<e[3];++a)n=n.add(t.slice([i*r.shape[0],o*r.shape[1],s*r.shape[2],a*r.shape[3]],[r.shape[0],r.shape[1],r.shape[2],r.shape[3]]))}return n}}},"Tile",i,r)}}),fr=ln({truncatedNormal_:function(t,e,n,r,i){if(void 0===e&&(e=0),void 0===n&&(n=1),null!=r&&"bool"===r)throw new Error("Unsupported data type "+r);for(var o=new $n(e,n,r,!0,i),s=Hn(t,r),a=0;a<s.values.length;a++)s.values[a]=o.nextValue();return s.toTensor()}}),gr=ln({unstack_:function(t,e){void 0===e&&(e=0),e=e||0;var n=Ye(t,"x","unstack");E(e>=-n.shape.length&&e<n.shape.length,function(){return"Axis = "+e+" is not in [-"+n.shape.length+", "+n.shape.length+")"}),e<0&&(e+=n.shape.length);var r={axis:e};return Pt.runKernelFunc(function(t){return t.unstack(n,e)},{x:n},function(t){return{x:function(){return dr(t,e)}}},"Unpack",r)}});function mr(t,e,n,r){void 0===r&&(r=!0);var i=[];if(r)(i=i.concat(e.slice(0))).push(t[0]/n),i=i.concat(t.slice(1));else{i=i.concat(t[0]);for(var o=e.length,s=0;s<o;++s)i=i.concat([t[s+1]/e[s],e[s]]);i=i.concat(t.slice(o+1))}return i}function vr(t,e,n){void 0===n&&(n=!0);var r=[];if(n){r.push(e);for(var i=e+1;i<t;++i)i<=2*e?(r.push(i),r.push(i-(e+1))):r.push(i)}else{var o=[],s=[];for(i=1;i<t;++i)i>=2*e+1||i%2==1?s.push(i):o.push(i);r.push.apply(r,o),r.push(0),r.push.apply(r,s)}return r}function br(t,e,n,r){void 0===r&&(r=!0);var i=[];r?i.push(t[0]/n):i.push(t[0]*n);for(var o=1;o<t.length;++o)o<=e.length?r?i.push(e[o-1]*t[o]):i.push(t[o]/e[o-1]):i.push(t[o]);return i}function _r(t,e){for(var n=[0],r=0;r<e;++r)n.push(t[r][0]);return n}function yr(t,e,n){for(var r=t.slice(0,1),i=0;i<n;++i)r.push(t[i+1]-e[i][0]-e[i][1]);return r}function Tr(t,e){if(t.rank<1)throw new Error("tf.gatherND() expects the input to be rank 1 or higher, but the rank was "+t.rank+".");if(e.rank<1)throw new Error("tf.gatherND() expects the indices to be rank 1 or higher, but the rank was "+e.rank+".");if("int32"!==e.dtype)throw new Error("tf.gatherND() expects the indices to be int32 type, but the dtype was "+e.dtype+".");if(e.shape[e.rank-1]>t.rank)throw new Error("index innermost dimension length must be <= tensor rank; saw: "+e.shape[e.rank-1]+" vs. "+t.rank);if(0===t.size)throw new Error("Requested more than 0 entries, but input is empty. Input shape: "+t.shape+".");for(var n=e.shape,r=n[n.length-1],i=1,o=0;o<n.length-1;++o)i*=n[o];var s=t.shape,a=n.slice();a.pop();var l=1;for(o=r;o<t.rank;++o)l*=s[o],a.push(s[o]);var u=J(t.shape).map(function(t){return t/l}).concat([1]).slice(0,r);return[a,i,l,u]}Object.freeze({prepareAndValidate:Tr});var xr=30;function Er(t){return t<=xr?t:q(t,Math.floor(Math.sqrt(t)))}function wr(t,e,n){var r=e.rank>1?e.shape[e.rank-1]:1,i=e.rank>1?e.rank-1:1,o="Must have updates.shape = indices.shape[:batchDim] + shape[sliceDim:], got updates.shape: "+n.shape+", indices.shape: "+e.shape+", shape: "+t+", sliceDim: "+r+", and batchDim: "+i+".";if(n.rank<i)throw new Error(o+" update.rank < "+i+". ");if(t.length<r+(n.rank-i))throw new Error(o+" Output shape length < "+(r+(n.rank-i)));if(n.rank!==i+t.length-r)throw new Error(o+" update.rank != "+(i+t.length-r));for(var s=0;s<i;++s)if(n.shape[s]!==e.shape[s])throw new Error(o+" updates.shape["+s+"] ("+n.shape[s]+") != indices.shape["+s+"] ("+e.shape[s]+").");for(s=0;s<n.rank-i;++s)if(n.shape[s+i]!==t[s+r])throw new Error(o+" updates.shape["+(s+i)+"] ("+n.shape[s+i]+") != shape["+(s+i)+"] ("+t[s+i]+")")}function Cr(t,e,n){if(e.rank<1)throw new Error("tf.scatterND() expects the indices to be rank 1 or higher, but the rank was "+e.rank+".");if(t.rank<1)throw new Error("tf.scatterND() expects the updates to be rank 1 or higher, but the rank was "+t.rank+".");if("int32"!==e.dtype)throw new Error("The dtype of 'indices' should be int32, but got dtype: "+e.dtype);if(n.length<1)throw new Error("Output rank must be greater or equal to 1, but got shape: "+n);if(0===n.length){if(0===e.size)throw new Error("Indices specified for empty output. indices shape: "+e.shape);if(0===t.size)throw new Error("Updates specified for empty output. updates shape: "+t.shape)}wr(n,e,t)}function Sr(t,e,n){for(var r=e.shape.length,i=r>1?e.shape[r-1]:1,o=n.length,s=1,a=i;a<o;++a)s*=n[a];var l=i<1?1:i;return{sliceRank:i,numUpdates:k(e.shape)/l,sliceSize:s,strides:J(n.slice(0,i)).concat([1]),outputSize:k(n)}}Object.freeze({validateUpdateShape:wr,validateInput:Cr,calculateShapes:Sr});function kr(t,e,n){E(t.rank===e.length,function(){return"Error in slice"+t.rank+"D: Length of begin "+e+" must match the rank of the array ("+t.rank+")."}),E(t.rank===n.length,function(){return"Error in slice"+t.rank+"D: Length of size "+n+" must match the rank of the array ("+t.rank+")."});for(var r=function(r){E(e[r]+n[r]<=t.shape[r],function(){return"Error in slice"+t.rank+"D: begin["+r+"] + size["+r+"] ("+(e[r]+n[r])+") would overflow input.shape["+r+"] ("+t.shape[r]+")"})},i=0;i<t.rank;++i)r(i)}function Or(t){for(var e=[],n=0;t>0;)1&t&&e.push(n),t/=2,n++;return e}function Ir(t,e,n){for(var r=[],i=0;i<t.length;i++)r[i]=Math.ceil((e[i]-t[i])/n[i]);return r}function Rr(t,e,n,r,i){var o=e[i],s=n[i]||1;(t&1<<i||null==o)&&(o=s>0?Number.MIN_SAFE_INTEGER:Number.MAX_SAFE_INTEGER);var a=r[i];return o<0&&(o+=a),y(0,o,a-1)}function Ar(t,e,n,r,i){var o=e[i],s=n[i]||1;(t&1<<i||null==o)&&(o=s>0?Number.MAX_SAFE_INTEGER:Number.MIN_SAFE_INTEGER);var a=r[i];return o<0&&(o+=a),s>0?y(0,o,a):y(-1,o,a-1)}function Nr(t,e,n){for(var r=n.length,i=0;i<n.length;i++)if(n[i]>1){r=i;break}for(i=r+1;i<n.length;i++)if(e[i]>0||n[i]!==t[i])return!1;return!0}function Dr(t,e){for(var n=t.length>0?t[t.length-1]:1,r=0;r<t.length-1;r++)n+=t[r]*e[r];return n}Object.freeze({assertParamsValid:kr,maskToAxes:Or,computeOutShape:Ir,startForAxis:Rr,stopForAxis:Ar,isSliceContinous:Nr,computeFlatOffset:Dr});function Mr(t){return Pt.customGrad(t)}var Lr=ln({softmax_:function(t,e){void 0===e&&(e=-1);var n=Ye(t,"logits","softmax","float32");if(-1===e&&(e=n.rank-1),e!==n.rank-1)throw Error("Softmax along a non-last dimension is not yet supported. Logits was rank "+n.rank+" and dim was "+e);return Pt.runKernelFunc(function(t,r){var i=t.softmax(n,e);return r([i]),i},{logits:n},function(t,n){var r=n[0],i=t.mul(r);return{logits:function(){return i.sub(i.sum([e],!0).mul(r))}}},"Softmax",{dim:e},[],[!0])}}),Pr=ln({logSoftmax_:function(t,e){void 0===e&&(e=-1);var n=Ye(t,"logits","logSoftmax");if(-1===e&&(e=n.rank-1),e!==n.rank-1)throw Error("Log Softmax along a non-last dimension is not yet supported. Logits was rank "+n.rank+" and axis was "+e);return Mr(function(t,n){var r=t.max(e,!0),i=t.sub(r),o=i.toFloat().sub(i.exp().sum(e,!0).log());return n([o]),{value:o,gradFunc:function(t,n){var r=n[0].exp();return t.sub(t.sum(e,!0).mul(r))}}})(n)}}),Fr=function(){function t(t,e){this.backend=t,this.dataMover=e,this.data=new WeakMap,this.dataIdsCount=0}return t.prototype.get=function(t){return this.data.has(t)||this.dataMover.moveData(this.backend,t),this.data.get(t)},t.prototype.set=function(t,e){this.dataIdsCount++,this.data.set(t,e)},t.prototype.has=function(t){return this.data.has(t)},t.prototype.delete=function(t){return this.dataIdsCount--,this.data.delete(t)},t.prototype.numDataIds=function(){return this.dataIdsCount},t}(),Br=function(){function t(){}return t.prototype.time=function(t){return jr("time")},t.prototype.read=function(t){return jr("read")},t.prototype.readSync=function(t){return jr("readSync")},t.prototype.numDataIds=function(){return jr("numDataIds")},t.prototype.disposeData=function(t){return jr("disposeData")},t.prototype.write=function(t,e,n){return jr("write")},t.prototype.move=function(t,e,n,r){return jr("move")},t.prototype.memory=function(){return jr("memory")},t.prototype.floatPrecision=function(){return jr("floatPrecision")},t.prototype.epsilon=function(){return 32===this.floatPrecision()?1e-7:1e-4},t.prototype.batchMatMul=function(t,e,n,r){return jr("batchMatMul")},t.prototype.fusedBatchMatMul=function(t){return t.a,t.b,t.transposeA,t.transposeB,t.bias,t.activation,t.preluActivationWeights,jr("fusedBatchMatMul")},t.prototype.slice=function(t,e,n){return jr("slice")},t.prototype.stridedSlice=function(t,e,n,r){return jr("stridedSlice")},t.prototype.unstack=function(t,e){return jr("unstack")},t.prototype.reverse=function(t,e){return jr("reverse")},t.prototype.concat=function(t,e){return jr("concat")},t.prototype.neg=function(t){return jr("neg")},t.prototype.add=function(t,e){return jr("add")},t.prototype.addN=function(t){return jr("addN")},t.prototype.subtract=function(t,e){return jr("subtract")},t.prototype.multiply=function(t,e){return jr("multiply")},t.prototype.realDivide=function(t,e){return jr("realDivide")},t.prototype.floorDiv=function(t,e){return jr("floorDiv")},t.prototype.sum=function(t,e){return jr("sum")},t.prototype.prod=function(t,e){return jr("prod")},t.prototype.unsortedSegmentSum=function(t,e,n){return jr("unsortedSegmentSum")},t.prototype.argMin=function(t,e){return jr("argMin")},t.prototype.argMax=function(t,e){return jr("argMax")},t.prototype.equal=function(t,e){return jr("equal")},t.prototype.notEqual=function(t,e){return jr("notEqual")},t.prototype.less=function(t,e){return jr("less")},t.prototype.lessEqual=function(t,e){return jr("lessEqual")},t.prototype.greater=function(t,e){return jr("greater")},t.prototype.greaterEqual=function(t,e){return jr("greaterEqual")},t.prototype.logicalNot=function(t){return jr("logicalNot")},t.prototype.logicalAnd=function(t,e){return jr("logicalAnd")},t.prototype.logicalOr=function(t,e){return jr("logicalOr")},t.prototype.where=function(t){return jr("where")},t.prototype.select=function(t,e,n){return jr("select")},t.prototype.topk=function(t,e,n){return jr("topk")},t.prototype.min=function(t,e){return jr("min")},t.prototype.minimum=function(t,e){return jr("minimum")},t.prototype.mod=function(t,e){return jr("mod")},t.prototype.max=function(t,e){return jr("max")},t.prototype.maximum=function(t,e){return jr("maximum")},t.prototype.all=function(t,e){return jr("all")},t.prototype.any=function(t,e){return jr("any")},t.prototype.squaredDifference=function(t,e){return jr("squaredDifference")},t.prototype.ceil=function(t){return jr("ceil")},t.prototype.floor=function(t){return jr("floor")},t.prototype.round=function(t){return jr("round")},t.prototype.sign=function(t){return jr("sign")},t.prototype.isNaN=function(t){return jr("isNaN")},t.prototype.isInf=function(t){return jr("isInf")},t.prototype.isFinite=function(t){return jr("isFinite")},t.prototype.pow=function(t,e){return jr("pow")},t.prototype.exp=function(t){return jr("exp")},t.prototype.expm1=function(t){return jr("expm1")},t.prototype.softmax=function(t,e){return jr("softmax")},t.prototype.log=function(t){return jr("log")},t.prototype.log1p=function(t){return jr("log1p")},t.prototype.sqrt=function(t){return jr("sqrt")},t.prototype.rsqrt=function(t){return jr("rsqrt")},t.prototype.square=function(t){return jr("square")},t.prototype.reciprocal=function(t){return jr("reciprocal")},t.prototype.relu=function(t){return jr("relu")},t.prototype.relu6=function(t){return jr("relu6")},t.prototype.prelu=function(t,e){return jr("prelu")},t.prototype.elu=function(t){return jr("elu")},t.prototype.eluDer=function(t,e){return jr("eluDer")},t.prototype.selu=function(t){return jr("selu")},t.prototype.int=function(t){return jr("int")},t.prototype.clip=function(t,e,n){return jr("clip")},t.prototype.abs=function(t){return jr("abs")},t.prototype.complexAbs=function(t){return jr("complexAbs")},t.prototype.sigmoid=function(t){return jr("sigmoid")},t.prototype.softplus=function(t){return jr("softplus")},t.prototype.sin=function(t){return jr("sin")},t.prototype.cos=function(t){return jr("cos")},t.prototype.tan=function(t){return jr("tan")},t.prototype.asin=function(t){return jr("asin")},t.prototype.acos=function(t){return jr("acos")},t.prototype.atan=function(t){return jr("atan")},t.prototype.atan2=function(t,e){return jr("atan2")},t.prototype.sinh=function(t){return jr("sinh")},t.prototype.cosh=function(t){return jr("cosh")},t.prototype.tanh=function(t){return jr("tanh")},t.prototype.asinh=function(t){return jr("asinh")},t.prototype.acosh=function(t){return jr("acosh")},t.prototype.atanh=function(t){return jr("atanh")},t.prototype.erf=function(t){return jr("erf")},t.prototype.step=function(t,e){return jr("step")},t.prototype.fusedConv2d=function(t){return t.input,t.filter,t.convInfo,t.bias,t.activation,t.preluActivationWeights,jr("fusedConv2d")},t.prototype.conv2d=function(t,e,n){return jr("conv2d")},t.prototype.conv2dDerInput=function(t,e,n){return jr("conv2dDerInput")},t.prototype.conv2dDerFilter=function(t,e,n){return jr("conv2dDerFilter")},t.prototype.fusedDepthwiseConv2D=function(t){return t.input,t.filter,t.convInfo,t.bias,t.activation,t.preluActivationWeights,jr("fusedDepthwiseConv2D")},t.prototype.depthwiseConv2D=function(t,e,n){return jr("depthwiseConv2D")},t.prototype.depthwiseConv2DDerInput=function(t,e,n){return jr("depthwiseConv2DDerInput")},t.prototype.depthwiseConv2DDerFilter=function(t,e,n){return jr("depthwiseConv2DDerFilter")},t.prototype.conv3d=function(t,e,n){return jr("conv3d")},t.prototype.conv3dDerInput=function(t,e,n){return jr("conv3dDerInput")},t.prototype.conv3dDerFilter=function(t,e,n){return jr("conv3dDerFilter")},t.prototype.maxPool=function(t,e){return jr("maxPool")},t.prototype.maxPoolBackprop=function(t,e,n,r){return jr("maxPoolBackprop")},t.prototype.avgPool=function(t,e){return jr("avgPool")},t.prototype.avgPoolBackprop=function(t,e,n){return jr("avgPoolBackprop")},t.prototype.avgPool3d=function(t,e){return jr("avgPool3d")},t.prototype.avgPool3dBackprop=function(t,e,n){return jr("avgPool3dBackprop")},t.prototype.maxPool3d=function(t,e){return jr("maxPool3d")},t.prototype.maxPool3dBackprop=function(t,e,n,r){return jr("maxPool3dBackprop")},t.prototype.reshape=function(t,e){return jr("reshape")},t.prototype.cast=function(t,e){return jr("cast")},t.prototype.tile=function(t,e){return jr("tile")},t.prototype.pad=function(t,e,n){return jr("pad")},t.prototype.transpose=function(t,e){return jr("transpose")},t.prototype.gather=function(t,e,n){return jr("gather")},t.prototype.gatherND=function(t,e){return jr("gatherND")},t.prototype.scatterND=function(t,e,n){return jr("scatterND")},t.prototype.batchToSpaceND=function(t,e,n){return jr("batchToSpaceND")},t.prototype.spaceToBatchND=function(t,e,n){return jr("spaceToBatchND")},t.prototype.resizeBilinear=function(t,e,n,r){return jr("resizeBilinear")},t.prototype.resizeBilinearBackprop=function(t,e,n){return jr("resizeBilinearBackprop")},t.prototype.resizeNearestNeighbor=function(t,e,n,r){return jr("resizeNearestNeighbor")},t.prototype.resizeNearestNeighborBackprop=function(t,e,n){return jr("resizeNearestNeighborBackprop")},t.prototype.batchNormalization=function(t,e,n,r,i,o){return jr("batchNormalization")},t.prototype.localResponseNormalization4D=function(t,e,n,r,i){return jr("localResponseNormalization4D")},t.prototype.LRNGrad=function(t,e,n,r,i,o,s){return jr("LRNGrad")},t.prototype.multinomial=function(t,e,n,r){return jr("multinomial")},t.prototype.oneHot=function(t,e,n,r){return jr("oneHot")},t.prototype.cumsum=function(t,e,n,r){return jr("cumsum")},t.prototype.nonMaxSuppression=function(t,e,n,r,i){return jr("nonMaxSuppression")},t.prototype.fft=function(t){return jr("fft")},t.prototype.ifft=function(t){return jr("ifft")},t.prototype.complex=function(t,e){return jr("complex")},t.prototype.real=function(t){return jr("real")},t.prototype.imag=function(t){return jr("imag")},t.prototype.cropAndResize=function(t,e,n,r,i,o){return jr("cropAndResize")},t.prototype.depthToSpace=function(t,e,n){return jr("depthToSpace")},t.prototype.split=function(t,e,n){return jr("split")},t.prototype.sparseToDense=function(t,e,n,r){return jr("sparseToDense")},t.prototype.diag=function(t){return jr("diag")},t.prototype.fill=function(t,e,n){return jr("fill")},t.prototype.onesLike=function(t){return jr("onesLike")},t.prototype.zerosLike=function(t){return jr("zerosLike")},t.prototype.linspace=function(t,e,n){return jr("linspace")},t.prototype.dispose=function(){return jr("dispose")},t}();function jr(t){throw new Error("'"+t+"' not yet implemented or not found in the registry. Did you forget to import the kernel?")}function $r(t,e){for(var n=t.length,r=[],i=0;i<n;i++){var o=n-1-i,s=t[o]||1;(e[e.length-1-i]||1)>1&&1===s&&r.unshift(o)}return r}function Ur(t,e){for(var n=[],r=0;r<e.length;r++){var i=t[t.length-r-1],o=e.length-r-1,s=e[o];(null==i||1===i&&s>1)&&n.unshift(o)}return n}function Vr(t,e){for(var n=[],r=Math.max(t.length,e.length),i=0;i<r;i++){var o=t[t.length-i-1];null==o&&(o=1);var s=e[e.length-i-1];if(null==s&&(s=1),1===o)n.unshift(s);else if(1===s)n.unshift(o);else{if(o!==s)throw Error("Operands could not be broadcast together with shapes "+t+" and "+e+".");n.unshift(o)}}return n}function Hr(t,e,n,r,i,o,s){void 0===s&&(s="channelsLast");var a,l=Kr(e),u=l[0],c=l[1];if("channelsLast"===s)a=[u,c,t[3],t[3]];else{if("channelsFirst"!==s)throw new Error("Unknown dataFormat "+s);a=[u,c,t[1],t[1]]}return Gr(t,a,n,r,i,o,!1,s)}function Wr(t,e,n,r,i,o,s){void 0===s&&(s="NDHWC");var a,l,u=Yr(e),c=u[0],h=u[1],d=u[2];if("NDHWC"===s)l="channelsLast",a=[c,h,d,t[4],t[4]];else{if("NCDHW"!==s)throw new Error("Unknown dataFormat "+s);l="channelsFirst",a=[c,h,d,t[1],t[1]]}return zr(t,a,n,r,i,!1,l,o)}function Gr(t,e,n,r,i,o,s,a){void 0===s&&(s=!1),void 0===a&&(a="channelsLast");var l=[-1,-1,-1,-1],u=l[0],c=l[1],h=l[2],d=l[3];if("channelsLast"===a)u=t[0],c=t[1],h=t[2],d=t[3];else{if("channelsFirst"!==a)throw new Error("Unknown dataFormat "+a);u=t[0],d=t[1],c=t[2],h=t[3]}var p,f=e[0],g=e[1],m=e[3],v=Kr(n),b=v[0],_=v[1],y=Kr(r),T=y[0],x=y[1],w=qr(f,T),C=qr(g,x),S=function(t,e,n,r,i,o,s,a){var l,u,c;if("number"==typeof t){l={top:t,bottom:t,left:t,right:t,type:0===t?"VALID":"NUMBER"};var h=function(t,e,n,r,i){null==r&&(r=Xr(t,e,n));var o=t[1],s=Jr((t[0]-e+2*r)/n+1,i);E(I(s),function(){return"The output # of rows ("+s+") must be an integer. Change the stride and/or zero pad parameters"});var a=Jr((o-e+2*r)/n+1,i);return E(I(a),function(){return"The output # of columns ("+a+") must be an integer. Change the stride and/or zero pad parameters"}),[s,a]}([e,n],o,r,t,a);u=h[0],c=h[1]}else if("same"===t){u=Math.ceil(e/r),c=Math.ceil(n/i);var d=Math.max(0,(u-1)*r+o-e),p=Math.max(0,(c-1)*i+s-n),f=Math.floor(d/2),g=d-f,m=Math.floor(p/2);l={top:f,bottom:g,left:m,right:p-m,type:"SAME"}}else{if("valid"!==t)throw Error("Unknown padding parameter: "+t);l={top:0,bottom:0,left:0,right:0,type:"VALID"},u=Math.ceil((e-o+1)/r),c=Math.ceil((n-s+1)/i)}return{padInfo:l,outHeight:u,outWidth:c}}(i,c,h,b,_,w,C,o),k=S.padInfo,O=S.outHeight,R=S.outWidth,A=s?m*d:m;return"channelsFirst"===a?p=[u,A,O,R]:"channelsLast"===a&&(p=[u,O,R,A]),{batchSize:u,dataFormat:a,inHeight:c,inWidth:h,inChannels:d,outHeight:O,outWidth:R,outChannels:A,padInfo:k,strideHeight:b,strideWidth:_,filterHeight:f,filterWidth:g,effectiveFilterHeight:w,effectiveFilterWidth:C,dilationHeight:T,dilationWidth:x,inShape:t,outShape:p,filterShape:e}}function zr(t,e,n,r,i,o,s,a){void 0===o&&(o=!1),void 0===s&&(s="channelsLast");var l=[-1,-1,-1,-1,-1],u=l[0],c=l[1],h=l[2],d=l[3],p=l[4];if("channelsLast"===s)u=t[0],c=t[1],h=t[2],d=t[3],p=t[4];else{if("channelsFirst"!==s)throw new Error("Unknown dataFormat "+s);u=t[0],p=t[1],c=t[2],h=t[3],d=t[4]}var f,g=e[0],m=e[1],v=e[2],b=e[4],_=Yr(n),y=_[0],T=_[1],x=_[2],w=Yr(r),C=w[0],S=w[1],k=w[2],O=qr(g,C),R=qr(m,S),A=qr(v,k),N=function(t,e,n,r,i,o,s,a,l,u,c){var h,d,p,f;if("number"==typeof t){h={top:t,bottom:t,left:t,right:t,front:t,back:t,type:0===t?"VALID":"NUMBER"};var g=function(t,e,n,r,i,o){null==i&&(i=Xr(t,e,r));var s=t[1],a=t[2],l=Jr((t[0]-e+2*i)/r+1,o);E(I(l),function(){return"The output # of depths ("+l+") must be an integer. Change the stride and/or zero pad parameters"});var u=Jr((s-e+2*i)/r+1,o);E(I(u),function(){return"The output # of rows ("+u+") must be an integer. Change the stride and/or zero pad parameters"});var c=Jr((a-e+2*i)/r+1,o);return E(I(c),function(){return"The output # of columns ("+c+") must be an integer. Change the stride and/or zero pad parameters"}),[l,u,c,1]}([e,n,r,1],a,0,i,t,c);d=g[0],p=g[1],f=g[2]}else if("same"===t){var m=((d=Math.ceil(e/i))-1)*i+a-e,v=((p=Math.ceil(n/o))-1)*o+l-n,b=((f=Math.ceil(r/s))-1)*s+u-r,_=Math.floor(m/2),y=m-_,T=Math.floor(v/2),x=v-T,w=Math.floor(b/2);h={top:T,bottom:x,left:w,right:b-w,front:_,back:y,type:"SAME"}}else{if("valid"!==t)throw Error("Unknown padding parameter: "+t);h={top:0,bottom:0,left:0,right:0,front:0,back:0,type:"VALID"},d=Math.ceil((e-a+1)/i),p=Math.ceil((n-l+1)/o),f=Math.ceil((r-u+1)/s)}return{padInfo:h,outDepth:d,outHeight:p,outWidth:f}}(i,c,h,d,y,T,x,O,R,A,a),D=N.padInfo,M=N.outDepth,L=N.outHeight,P=N.outWidth,F=o?b*p:b;return"channelsFirst"===s?f=[u,F,M,L,P]:"channelsLast"===s&&(f=[u,M,L,P,F]),{batchSize:u,dataFormat:s,inDepth:c,inHeight:h,inWidth:d,inChannels:p,outDepth:M,outHeight:L,outWidth:P,outChannels:F,padInfo:D,strideDepth:y,strideHeight:T,strideWidth:x,filterDepth:g,filterHeight:m,filterWidth:v,effectiveFilterDepth:O,effectiveFilterHeight:R,effectiveFilterWidth:A,dilationDepth:C,dilationHeight:S,dilationWidth:k,inShape:t,outShape:f,filterShape:e}}function Xr(t,e,n,r){void 0===r&&(r=1);var i=qr(e,r);return Math.floor((t[0]*(n-1)-n+i)/2)}function Kr(t){return"number"==typeof t?[t,t,t]:2===t.length?[t[0],t[1],1]:t}function Yr(t){return"number"==typeof t?[t,t,t]:t}function qr(t,e){return e<=1?t:t+(t-1)*(e-1)}function Jr(t,e){if(!e)return t;switch(e){case"round":return Math.round(t);case"ceil":return Math.ceil(t);case"floor":return Math.floor(t);default:throw new Error("Unknown roundingMode "+e)}}function Zr(t){var e=Kr(t),n=e[0],r=e[1],i=e[2];return 1===n&&1===r&&1===i}function Qr(t,e){return Zr(t)||Zr(e)}function ti(t){if("NHWC"===t)return"channelsLast";if("NCHW"===t)return"channelsFirst";throw new Error("Unknown dataFormat "+t)}function ei(t,e,n){if("complex64"===e){if("complex64"===t.dtype)return t.clone();var r=yn(t.shape),i=t.toFloat(),o=n.complex(i,r);return r.dispose(),i.dispose(),o}if(!U(t.dtype,e))return Pt.makeTensorFromDataId(t.dataId,t.shape,e);if("complex64"===t.dtype){var s=n.real(t);return o=s.cast(e),s.dispose(),o}if("int32"===e)return n.int(t);if("bool"===e){var a=fn(0,t.dtype);return o=n.notEqual(t,a),a.dispose(),o}throw new Error("Error in Cast: failed to cast "+t.dtype+" to "+e)}function ni(t,e){return Pt.makeTensorFromDataId(t.dataId,e,t.dtype)}function ri(t,e,n){var r=(e-t)/(n-1),i=et(n,"float32");i[0]=t;for(var o=1;o<i.length;o++)i[o]=i[o-1]+r;return gn(i,"float32")}Object.freeze({castTensor:ei,reshapeTensor:ni,linspaceImpl:ri,upcastType:Ot,axesAreInnerMostDims:Je,combineLocations:Ze,computeOutAndReduceShapes:Qe,expandShapeToKeepDim:tn,assertAxesAreInnerMostDims:en,getAxesPermutation:nn,getUndoAxesPermutation:rn,getInnerMostAxes:on,getBroadcastDims:$r,getReductionAxes:Ur,assertAndGetBroadcastShape:Vr,assertParamsConsistent:sn,computeOutShape:an,computePool2DInfo:Hr,computePool3DInfo:Wr,computeConv2DInfo:Gr,computeConv3DInfo:zr,computeDefaultPad:Xr,tupleValuesAreOne:Zr,eitherStridesOrDilationsAreOne:Qr,convertConv2DDataFormat:ti,PARALLELIZE_THRESHOLD:xr,computeOptimalWindowSize:Er});function ii(t,e){if(t.length!==e.length)throw new Error("Cannot merge real and imag arrays of different lengths. real:"+t.length+", imag: "+e.length+".");for(var n=new Float32Array(2*t.length),r=0;r<n.length;r+=2)n[r]=t[r/2],n[r+1]=e[r/2];return n}function oi(t,e){return{real:t[2*e],imag:t[2*e+1]}}function si(t,e,n,r){t[2*r]=e,t[2*r+1]=n}function ai(t,e,n){var r=(n?2:-2)*Math.PI*(t/e);return{real:Math.cos(r),imag:Math.sin(r)}}function li(t,e,n){var r=function(t,e,n){return function(t,e,n){for(var r=0,i=t.length,o=0,s=!1;r<i;){var a=n(e,t[o=r+(i-r>>>1)]);a>0?r=o+1:(i=o,s=!a)}return s?r:-r-1}(t,e,n||ui)}(t,e,n),i=r<0?-(r+1):r;t.splice(i,0,e)}function ui(t,e){return t>e?1:t<e?-1:0}function ci(t,e,n,r,i){return di(t,e,n,r,i,0).selectedIndices}function hi(t,e,n,r,i,o){var s=di(t,e,n,r,i,o,!0);return s.numValidOutputs.dispose(),{selectedIndices:s.selectedIndices,selectedScores:s.selectedScores}}function di(t,e,n,r,i,o,s,a){void 0===s&&(s=!1),void 0===a&&(a=!1);for(var l=Array.from(e).map(function(t,e){return{score:t,boxIndex:e,suppressBeginIndex:0}}).filter(function(t){return t.score>i}).sort(gi),u=o>0?-.5/o:0,c=[],h=[];c.length<n&&l.length>0;){var d=l.pop(),p=d.score,f=d.boxIndex,g=d.suppressBeginIndex;if(p<i)break;for(var m=!1,v=c.length-1;v>=g;--v){var b=pi(t,f,c[v]);if(b>=r){m=!0;break}if(d.score=d.score*fi(r,u,b),d.score<=i)break}d.suppressBeginIndex=c.length,m||(d.score===p?(c.push(f),h.push(d.score)):d.score>i&&li(l,d,gi))}var _=c.length;return a&&(c.fill(0,_),h.fill(0,_)),{selectedIndices:gn(c,"int32"),selectedScores:gn(h,"float32"),numValidOutputs:fn(_,"int32")}}function pi(t,e,n){var r=t.subarray(4*e,4*e+4),i=t.subarray(4*n,4*n+4),o=Math.min(r[0],r[2]),s=Math.min(r[1],r[3]),a=Math.max(r[0],r[2]),l=Math.max(r[1],r[3]),u=Math.min(i[0],i[2]),c=Math.min(i[1],i[3]),h=Math.max(i[0],i[2]),d=Math.max(i[1],i[3]),p=(a-o)*(l-s),f=(h-u)*(d-c);if(p<=0||f<=0)return 0;var g=Math.max(o,u),m=Math.max(s,c),v=Math.min(a,h),b=Math.min(l,d),_=Math.max(v-g,0)*Math.max(b-m,0);return _/(p+f-_)}function fi(t,e,n){var r=Math.exp(e*n*n);return n<=t?r:0}function gi(t,e){return t.score-e.score||t.score===e.score&&e.boxIndex-t.boxIndex}function mi(t,e,n){var r=new Array(t.rank).fill(0),i=t.shape.slice();return e.map(function(e){i[n]=e;var o=t.slice(r,i);return r[n]+=e,o})}function vi(t,e){for(var n=new Array(t.rank),r=0;r<n.length;r++)n[r]=t.shape[r]*e[r];var i=Hn(n,t.dtype);for(r=0;r<i.values.length;++r){for(var o=i.indexToLoc(r),s=new Array(t.rank),a=0;a<s.length;a++)s[a]=o[a]%t.shape[a];var l=t.locToIndex(s);i.values[r]=t.values[l]}return i.toTensor()}function bi(t,e,n,r,i){for(var o=e[e.length-1],s=[t.length/o,o],a=s[0],l=s[1],u=F(n,a*r),c=F("int32",a*r),h=0;h<a;h++){for(var d=h*l,p=t.subarray(d,d+l),f=[],g=0;g<p.length;g++)f.push({value:p[g],index:g});f.sort(function(t,e){return e.value-t.value});var m=h*r,v=u.subarray(m,m+r),b=c.subarray(m,m+r);for(g=0;g<r;g++)v[g]=f[g].value,b[g]=f[g].index}var _=e.slice();return _[_.length-1]=r,[dn(u,_,n),dn(c,_,"int32")]}function _i(t,e){for(var n=[],r=0;r<e.length;r++)e[r]&&n.push(r);var i=Hn(t,"int32"),o=Hn([n.length,t.length],"int32");for(r=0;r<n.length;r++){var s=i.indexToLoc(n[r]),a=r*t.length;o.values.set(s,a)}return o.toTensor()}function yi(t,e){return["x","y","z","w","u","v"].slice(0,e).map(function(e){return t+"."+e})}function Ti(t,e){return 1===e?[t]:yi(t,e)}function xi(){var t,e,n,r,i,o,s,a,l,u;return 2===c().getNumber("WEBGL_VERSION")?(t="#version 300 es",e="in",n="out",r="in",i="texture",o="outputColor",s="out vec4 outputColor;",a="\n bool isnan_custom(float val) {\n return (val > 0.0 || val < 0.0) ? false : val != 0.0;\n }\n\n bvec4 isnan_custom(vec4 val) {\n return bvec4(isnan_custom(val.x),\n isnan_custom(val.y), isnan_custom(val.z), isnan_custom(val.w));\n }\n\n #define isnan(value) isnan_custom(value)\n ",l="",u="\n #define round(value) newRound(value)\n int newRound(float value) {\n return int(floor(value + 0.5));\n }\n\n ivec4 newRound(vec4 value) {\n return ivec4(floor(value + vec4(0.5)));\n }\n "):(t="",e="attribute",n="varying",r="varying",i="texture2D",o="gl_FragColor",s="",a="\n #define isnan(value) isnan_custom(value)\n bool isnan_custom(float val) {\n return (val > 0. || val < 1. || val == 0.) ? false : true;\n }\n bvec4 isnan_custom(vec4 val) {\n return bvec4(isnan(val.x), isnan(val.y), isnan(val.z), isnan(val.w));\n }\n ",l="\n uniform float INFINITY;\n\n bool isinf(float val) {\n return abs(val) == INFINITY;\n }\n bvec4 isinf(vec4 val) {\n return equal(abs(val), vec4(INFINITY));\n }\n ",u="\n int round(float value) {\n return int(floor(value + 0.5));\n }\n\n ivec4 round(vec4 value) {\n return ivec4(floor(value + vec4(0.5)));\n }\n "),{version:t,attribute:e,varyingVs:n,varyingFs:r,texture2D:i,output:o,defineOutput:s,defineSpecialNaN:a,defineSpecialInf:l,defineRound:u}}function Ei(t,e,n){void 0===n&&(n="index");var r=J(e);return r.map(function(e,i){return"int "+t[i]+" = "+n+" / "+e+"; "+(i===r.length-1?"int "+t[i+1]+" = "+n+" - "+t[i]+" * "+e:"index -= "+t[i]+" * "+e)+";"}).join("")}function wi(t){var e=J(t).map(function(t){return t.toString()});return"\n int getFlatIndex(ivec3 coords) {\n return coords.x * "+e[0]+" + coords.y * "+e[1]+" + coords.z;\n }\n"}var Ci="\n const float FLOAT_MAX = 1.70141184e38;\n const float FLOAT_MIN = 1.17549435e-38;\n\n lowp vec4 encode_float(highp float v) {\n if (isnan(v)) {\n return vec4(255, 255, 255, 255);\n }\n\n highp float av = abs(v);\n\n if(av < FLOAT_MIN) {\n return vec4(0.0, 0.0, 0.0, 0.0);\n } else if(v > FLOAT_MAX) {\n return vec4(0.0, 0.0, 128.0, 127.0) / 255.0;\n } else if(v < -FLOAT_MAX) {\n return vec4(0.0, 0.0, 128.0, 255.0) / 255.0;\n }\n\n highp vec4 c = vec4(0,0,0,0);\n\n highp float e = floor(log2(av));\n highp float m = exp2(fract(log2(av))) - 1.0;\n\n c[2] = floor(128.0 * m);\n m -= c[2] / 128.0;\n c[1] = floor(32768.0 * m);\n m -= c[1] / 32768.0;\n c[0] = floor(8388608.0 * m);\n\n highp float ebias = e + 127.0;\n c[3] = floor(ebias / 2.0);\n ebias -= c[3] * 2.0;\n c[2] += floor(ebias) * 128.0;\n\n c[3] += 128.0 * step(0.0, -v);\n\n return c / 255.0;\n }\n";function Si(t,e,n,r){var i=[];t.forEach(function(t){var e=k(t.shapeInfo.logicalShape);t.shapeInfo.isUniform?i.push("uniform float "+t.name+(e>1?"["+e+"]":"")+";"):(i.push("uniform sampler2D "+t.name+";"),i.push("uniform int offset"+t.name+";"))});var o,s,a=i.join("\n"),l=t.map(function(t){return function(t,e,n){void 0===n&&(n=!1);var r="";r+=n?function t(e){var n,r,i;switch(e.shapeInfo.logicalShape.length){case 0:return n=e.name,r="get"+n.charAt(0).toUpperCase()+n.slice(1),i=xi(),"\n vec4 "+r+"() {\n return "+i.texture2D+"("+n+", halfCR);\n }\n ";case 1:return function(t){var e=t.name,n="get"+e.charAt(0).toUpperCase()+e.slice(1),r=t.shapeInfo.texShape,i=[Math.ceil(r[0]/2),Math.ceil(r[1]/2)],o=xi();return"\n vec4 "+n+"(int index) {\n vec2 uv = packedUVfrom1D(\n "+i[0]+", "+i[1]+", index);\n return "+o.texture2D+"("+e+", uv);\n }\n "}(e);case 2:return function(t){var e=t.shapeInfo.logicalShape,n=t.name,r="get"+n.charAt(0).toUpperCase()+n.slice(1),i=t.shapeInfo.texShape,o=i[0],s=i[1],a=xi();if(null!=i&&O(e,i))return"\n vec4 "+r+"(int row, int col) {\n vec2 uv = (vec2(col, row) + halfCR) / vec2("+s+".0, "+o+".0);\n\n return "+a.texture2D+"("+n+", uv);\n }\n ";var l=[Math.ceil(i[0]/2),Math.ceil(i[1]/2)],u=Math.ceil(e[1]/2);return"\n vec4 "+r+"(int row, int col) {\n vec2 uv = packedUVfrom2D("+u+", "+l[0]+", "+l[1]+", row, col);\n return "+a.texture2D+"("+n+", uv);\n }\n "}(e);case 3:return function(e){var n=e.shapeInfo.logicalShape,r=e.name,i="get"+r.charAt(0).toUpperCase()+r.slice(1),o=e.shapeInfo.texShape,s=[Math.ceil(o[0]/2),Math.ceil(o[1]/2)];if(1===n[0]){var a=n.slice(1),l=Mi(e,a);return"\n "+t(l)+"\n vec4 "+i+"(int b, int row, int col) {\n return "+i+"("+Li(["b","row","col"],[1,2])+");\n }\n "}var u=s[0],c=s[1],h=Math.ceil(n[2]/2),d=h*Math.ceil(n[1]/2),p=xi();return"\n vec4 "+i+"(int b, int row, int col) {\n vec2 uv = packedUVfrom3D(\n "+u+", "+c+", "+d+", "+h+", b, row, col);\n return "+p.texture2D+"("+r+", uv);\n }\n "}(e);default:return function(t){for(var e=t.shapeInfo.logicalShape,n=e.length,r=t.name,i="get"+r.charAt(0).toUpperCase()+r.slice(1),o=t.shapeInfo.texShape,s=[Math.ceil(o[0]/2),Math.ceil(o[1]/2)],a=s[0],l=s[1],u=Math.ceil(e[n-1]/2),c=u*Math.ceil(e[n-2]/2),h="int b, int row, int col",d="b * "+c+" + (row / 2) * "+u+" + (col / 2)",p=2;p<n-1;p++)h="int b"+p+", "+h,c*=e[n-p-1],d="b"+p+" * "+c+" + "+d;var f=xi();return"\n vec4 "+i+"("+h+") {\n int index = "+d+";\n int texR = index / "+l+";\n int texC = index - texR * "+l+";\n vec2 uv = (vec2(texC, texR) + halfCR) / vec2("+l+", "+a+");\n return "+f.texture2D+"("+r+", uv);\n }\n "}(e)}}(t):function t(e){var n=e.shapeInfo.logicalShape;switch(n.length){case 0:return function(t){var e=t.name,n="get"+e.charAt(0).toUpperCase()+e.slice(1);if(t.shapeInfo.isUniform)return"float "+n+"() {return "+e+";}";var r=t.shapeInfo.texShape,i=r[0],o=r[1];if(1===i&&1===o)return"\n float "+n+"() {\n return sampleTexture("+e+", halfCR);\n }\n ";var s=t.shapeInfo.texShape,a=s[0],l=s[1],u=Ai(e);return"\n float "+n+"() {\n vec2 uv = uvFromFlat("+a+", "+l+", "+u+");\n return sampleTexture("+e+", uv);\n }\n "}(e);case 1:return function(t){var e=t.name,n="get"+e.charAt(0).toUpperCase()+e.slice(1);if(t.shapeInfo.isUniform)return"\n float "+n+"(int index) {\n "+Ni(t)+"\n }\n ";var r=t.shapeInfo.texShape,i=r[0],o=r[1];if(1===o&&1===i)return"\n float "+n+"(int index) {\n return sampleTexture("+e+", halfCR);\n }\n ";var s=Ai(e);return 1===o?"\n float "+n+"(int index) {\n vec2 uv = vec2(0.5, (float(index + "+s+") + 0.5) / "+i+".0);\n return sampleTexture("+e+", uv);\n }\n ":1===i?"\n float "+n+"(int index) {\n vec2 uv = vec2((float(index + "+s+") + 0.5) / "+o+".0, 0.5);\n return sampleTexture("+e+", uv);\n }\n ":"\n float "+n+"(int index) {\n vec2 uv = uvFromFlat("+i+", "+o+", index + "+s+");\n return sampleTexture("+e+", uv);\n }\n "}(e);case 2:return function(e){var n=e.shapeInfo.logicalShape,r=e.name,i="get"+r.charAt(0).toUpperCase()+r.slice(1),o=e.shapeInfo.texShape;if(null!=o&&O(n,o)){var s=o[0],a=o[1];return"\n float "+i+"(int row, int col) {\n vec2 uv = (vec2(col, row) + halfCR) / vec2("+a+".0, "+s+".0);\n return sampleTexture("+r+", uv);\n }\n "}var l=P(n),u=l.newShape,c=l.keptDims,h=u;if(h.length<n.length){var d=Mi(e,h);return"\n "+t(d)+"\n float "+i+"(int row, int col) {\n return "+i+"("+Li(["row","col"],c)+");\n }\n "}if(e.shapeInfo.isUniform)return"\n float "+i+"(int row, int col) {\n int index = round(dot(vec2(row, col), vec2("+n[1]+", 1)));\n "+Ni(e)+"\n }\n ";var p=o[0],f=o[1],g=Ai(r);return 1===f?"\n float "+i+"(int row, int col) {\n float index = dot(vec3(row, col, "+g+"), vec3("+n[1]+", 1, 1));\n vec2 uv = vec2(0.5, (index + 0.5) / "+p+".0);\n return sampleTexture("+r+", uv);\n }\n ":1===p?"\n float "+i+"(int row, int col) {\n float index = dot(vec3(row, col, "+g+"), vec3("+n[1]+", 1, 1));\n vec2 uv = vec2((index + 0.5) / "+f+".0, 0.5);\n return sampleTexture("+r+", uv);\n }\n ":"\n float "+i+"(int row, int col) {\n // Explicitly use integer operations as dot() only works on floats.\n int index = row * "+n[1]+" + col + "+g+";\n vec2 uv = uvFromFlat("+p+", "+f+", index);\n return sampleTexture("+r+", uv);\n }\n"}(e);case 3:return function(e){var n=e.shapeInfo.logicalShape,r=e.name,i="get"+r.charAt(0).toUpperCase()+r.slice(1),o=n[1]*n[2],s=n[2],a=P(n),l=a.newShape,u=a.keptDims,c=l;if(c.length<n.length){var h=Mi(e,c);return"\n "+t(h)+"\n float "+i+"(int row, int col, int depth) {\n return "+i+"("+Li(["row","col","depth"],u)+");\n }\n "}if(e.shapeInfo.isUniform)return"\n float "+i+"(int row, int col, int depth) {\n int index = round(dot(vec3(row, col, depth),\n vec3("+o+", "+s+", 1)));\n "+Ni(e)+"\n }\n ";var d=e.shapeInfo.texShape,p=d[0],f=d[1],g=e.shapeInfo.flatOffset;if(f===o&&null==g)return"\n float "+i+"(int row, int col, int depth) {\n float texR = float(row);\n float texC = dot(vec2(col, depth), vec2("+s+", 1));\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2("+f+".0, "+p+".0);\n return sampleTexture("+r+", uv);\n }\n ";if(f===s&&null==g)return"\n float "+i+"(int row, int col, int depth) {\n float texR = dot(vec2(row, col), vec2("+n[1]+", 1));\n float texC = float(depth);\n vec2 uv = (vec2(texC, texR) + halfCR) / vec2("+f+".0, "+p+".0);\n return sampleTexture("+r+", uv);\n }\n ";var m=Ai(r);return"\n float "+i+"(int row, int col, int depth) {\n // Explicitly use integer operations as dot() only works on floats.\n int index = row * "+o+" + col * "+s+" + depth + "+m+";\n vec2 uv = uvFromFlat("+p+", "+f+", index);\n return sampleTexture("+r+", uv);\n }\n "}(e);case 4:return function(e){var n=e.shapeInfo.logicalShape,r=e.name,i="get"+r.charAt(0).toUpperCase()+r.slice(1),o=n[3],s=n[2]*o,a=n[1]*s,l=P(n),u=l.newShape,c=l.keptDims;if(u.length<n.length){var h=Mi(e,u);return"\n "+t(h)+"\n float "+i+"(int row, int col, int depth, int depth2) {\n return "+i+"("+Li(["row","col","depth","depth2"],c)+");\n }\n "}if(e.shapeInfo.isUniform)return"\n float "+i+"(int row, int col, int depth, int depth2) {\n int index = round(dot(vec4(row, col, depth, depth2),\n vec4("+a+", "+s+", "+o+", 1)));\n "+Ni(e)+"\n }\n ";var d=e.shapeInfo.flatOffset,p=e.shapeInfo.texShape,f=p[0],g=p[1];if(g===a&&null==d)return"\n float "+i+"(int row, int col, int depth, int depth2) {\n float texR = float(row);\n float texC =\n dot(vec3(col, depth, depth2),\n vec3("+s+", "+o+", 1));\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2("+g+".0, "+f+".0);\n return sampleTexture("+r+", uv);\n }\n ";if(g===o&&null==d)return"\n float "+i+"(int row, int col, int depth, int depth2) {\n float texR = dot(vec3(row, col, depth),\n vec3("+n[1]*n[2]+", "+n[2]+", 1));\n float texC = float(depth2);\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2("+g+".0, "+f+".0);\n return sampleTexture("+r+", uv);\n }\n ";var m=Ai(r);return"\n float "+i+"(int row, int col, int depth, int depth2) {\n // Explicitly use integer operations as dot() only works on floats.\n int index = row * "+a+" + col * "+s+" +\n depth * "+o+" + depth2;\n vec2 uv = uvFromFlat("+f+", "+g+", index + "+m+");\n return sampleTexture("+r+", uv);\n }\n "}(e);case 5:return function(e){var n=e.shapeInfo.logicalShape,r=e.name,i="get"+r.charAt(0).toUpperCase()+r.slice(1),o=n[4],s=n[3]*o,a=n[2]*s,l=n[1]*a,u=P(n),c=u.newShape,h=u.keptDims;if(c.length<n.length){var d=Mi(e,c);return"\n "+t(d)+"\n float "+i+"(int row, int col, int depth, int depth2, int depth3) {\n return "+i+"("+Li(["row","col","depth","depth2","depth3"],h)+");\n }\n "}if(e.shapeInfo.isUniform)return"\n float "+i+"(int row, int col, int depth, int depth2, int depth3) {\n float index = dot(\n vec4(row, col, depth, depth2),\n vec4("+l+", "+a+", "+s+", "+o+")) +\n depth3;\n "+Ni(e)+"\n }\n ";var p=e.shapeInfo.flatOffset,f=e.shapeInfo.texShape,g=f[0],m=f[1];if(m===l&&null==p)return"\n float "+i+"(int row, int col, int depth, int depth2, int depth3) {\n int texR = row;\n float texC = dot(vec4(col, depth, depth2, depth3),\n vec4("+a+", "+s+", "+o+", 1));\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2("+m+".0, "+g+".0);\n return sampleTexture("+r+", uv);\n }\n ";if(m===o&&null==p)return"\n float "+i+"(int row, int col, int depth, int depth2, int depth3) {\n float texR = dot(\n vec4(row, col, depth, depth2),\n vec4("+n[1]*n[2]*n[3]+",\n "+n[2]*n[3]+", "+n[3]+", 1));\n int texC = depth3;\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2("+m+".0, "+g+".0);\n return sampleTexture("+r+", uv);\n }\n ";var v=Ai(r);return"\n float "+i+"(int row, int col, int depth, int depth2, int depth3) {\n // Explicitly use integer operations as dot() only works on floats.\n int index = row * "+l+" + col * "+a+" + depth * "+s+" +\n depth2 * "+o+" + depth3 + "+v+";\n vec2 uv = uvFromFlat("+g+", "+m+", index);\n return sampleTexture("+r+", uv);\n }\n "}(e);case 6:return function(e){var n=e.shapeInfo.logicalShape,r=e.name,i="get"+r.charAt(0).toUpperCase()+r.slice(1),o=P(n),s=o.newShape,a=o.keptDims;if(s.length<n.length){var l=Mi(e,s);return"\n "+t(l)+"\n float "+i+"(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n return "+i+"("+Li(["row","col","depth","depth2","depth3","depth4"],a)+");\n }\n "}var u=n[5],c=n[4]*u,h=n[3]*c,d=n[2]*h,p=n[1]*d;if(e.shapeInfo.isUniform)return"\n float "+i+"(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n int index = round(dot(\n vec4(row, col, depth, depth2),\n vec4("+p+", "+d+", "+h+", "+c+")) +\n dot(\n vec2(depth3, depth4),\n vec2("+u+", 1)));\n "+Ni(e)+"\n }\n ";var f=e.shapeInfo.flatOffset,g=e.shapeInfo.texShape,m=g[0],v=g[1];if(v===p&&null==f)return"\n float "+i+"(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n int texR = row;\n float texC = dot(vec4(col, depth, depth2, depth3),\n vec4("+d+", "+h+", "+c+", "+u+")) +\n float(depth4);\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2("+v+".0, "+m+".0);\n return sampleTexture("+r+", uv);\n }\n ";if(v===u&&null==f)return"\n float "+i+"(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n float texR = dot(vec4(row, col, depth, depth2),\n vec4("+n[1]*n[2]*n[3]*n[4]+",\n "+n[2]*n[3]*n[4]+",\n "+n[3]*n[4]+",\n "+n[4]+")) + float(depth3);\n int texC = depth4;\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2("+v+".0, "+m+".0);\n return sampleTexture("+r+", uv);\n }\n ";var b=Ai(r);return"\n float "+i+"(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n // Explicitly use integer operations as dot() only works on floats.\n int index = row * "+p+" + col * "+d+" + depth * "+h+" +\n depth2 * "+c+" + depth3 * "+u+" + depth4 + "+b+";\n vec2 uv = uvFromFlat("+m+", "+v+", index);\n return sampleTexture("+r+", uv);\n }\n "}(e);default:throw new Error(n.length+"-D input sampling is not yet supported")}}(t);var i=t.shapeInfo.logicalShape,o=e.logicalShape;return i.length<=o.length&&(r+=n?function(t,e){var n,r=t.name,i=r.charAt(0).toUpperCase()+r.slice(1),o="get"+i+"AtOutCoords",s=t.shapeInfo.logicalShape.length,a=e.logicalShape.length,l=$r(t.shapeInfo.logicalShape,e.logicalShape),u=Di(a),c=a-s,h=["x","y","z","w","u","v"];n=0===s?"":a<2&&l.length>=1?"coords = 0;":l.map(function(t){return"coords."+h[t+c]+" = 0;"}).join("\n");var d;d=a<2&&s>0?"coords":t.shapeInfo.logicalShape.map(function(t,e){return"coords."+h[e+c]}).join(", ");var p="return outputValue;",f=1===k(t.shapeInfo.logicalShape),g=1===k(e.logicalShape);if(1!==s||f||g){if(f&&!g)p=1===a?"\n return vec4(outputValue.x, outputValue.x, 0., 0.);\n ":"\n return vec4(outputValue.x);\n ";else if(l.length){var m=s-2,v=s-1;l.indexOf(m)>-1&&l.indexOf(v)>-1?p="return vec4(outputValue.x);":l.indexOf(m)>-1?p="return vec4(outputValue.x, outputValue.y, outputValue.x, outputValue.y);":l.indexOf(v)>-1&&(p="return vec4(outputValue.xx, outputValue.zz);")}}else p="\n return vec4(outputValue.xy, outputValue.xy);\n ";return"\n vec4 "+o+"() {\n "+u+" coords = getOutputCoords();\n "+n+"\n vec4 outputValue = get"+i+"("+d+");\n "+p+"\n }\n "}(t,e):function(t,e){var n=t.name,r=n.charAt(0).toUpperCase()+n.slice(1),i="get"+r+"AtOutCoords",o=e.texShape,s=t.shapeInfo.texShape,a=t.shapeInfo.logicalShape.length,l=e.logicalShape.length;if(!t.shapeInfo.isUniform&&a===l&&null==t.shapeInfo.flatOffset&&O(s,o))return"\n float "+i+"() {\n return sampleTexture("+n+", resultUV);\n }\n ";var u=Di(l),c=$r(t.shapeInfo.logicalShape,e.logicalShape),h=l-a,d=["x","y","z","w","u","v"];return"\n float "+i+"() {\n "+u+" coords = getOutputCoords();\n "+(0===a?"":l<2&&c.length>=1?"coords = 0;":c.map(function(t){return"coords."+d[t+h]+" = 0;"}).join("\n"))+"\n return get"+r+"("+(l<2&&a>0?"coords":t.shapeInfo.logicalShape.map(function(t,e){return"coords."+d[e+h]}).join(", "))+");\n }\n "}(t,e)),r}(t,e,r)}).join("\n"),u=e.texShape,c=xi(),h="\n float sampleTexture(sampler2D textureSampler, vec2 uv) {\n return "+c.texture2D+"(textureSampler, uv).r;\n }\n ",d=function(t){return t.version+"\n precision highp float;\n precision highp int;\n precision highp sampler2D;\n "+t.varyingFs+" vec2 resultUV;\n "+t.defineOutput+"\n const vec2 halfCR = vec2(0.5, 0.5);\n\n struct ivec5\n {\n int x;\n int y;\n int z;\n int w;\n int u;\n };\n\n struct ivec6\n {\n int x;\n int y;\n int z;\n int w;\n int u;\n int v;\n };\n\n uniform float NAN;\n "+t.defineSpecialNaN+"\n "+t.defineSpecialInf+"\n "+t.defineRound+"\n\n int imod(int x, int y) {\n return x - y * (x / y);\n }\n\n int idiv(int a, int b, float sign) {\n int res = a / b;\n int mod = imod(a, b);\n if (sign < 0. && mod != 0) {\n res -= 1;\n }\n return res;\n }\n\n //Based on the work of Dave Hoskins\n //https://www.shadertoy.com/view/4djSRW\n #define HASHSCALE1 443.8975\n float random(float seed){\n vec2 p = resultUV * seed;\n vec3 p3 = fract(vec3(p.xyx) * HASHSCALE1);\n p3 += dot(p3, p3.yzx + 19.19);\n return fract((p3.x + p3.y) * p3.z);\n }\n\n "+ki+"\n "+Oi+"\n "+Ii+"\n "}(c);return e.isPacked?(o=function(t,e){switch(t.length){case 0:return"\n int getOutputCoords() {\n return 0;\n }\n ";case 1:return function(t,e){var n=[Math.ceil(e[0]/2),Math.ceil(e[1]/2)];return 1===n[0]?"\n int getOutputCoords() {\n return 2 * int(resultUV.x * "+n[1]+".0);\n }\n ":1===n[1]?"\n int getOutputCoords() {\n return 2 * int(resultUV.y * "+n[0]+".0);\n }\n ":"\n int getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2("+n[0]+", "+n[1]+"));\n return 2 * (resTexRC.x * "+n[1]+" + resTexRC.y);\n }\n "}(0,e);case 2:return function(t,e){var n=[Math.ceil(e[0]/2),Math.ceil(e[1]/2)];if(O(t,e))return"\n ivec2 getOutputCoords() {\n return 2 * ivec2(resultUV.yx * vec2("+n[0]+", "+n[1]+"));\n }\n ";var r=Math.ceil(t[1]/2);return"\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2("+n[0]+", "+n[1]+"));\n\n int index = resTexRC.x * "+n[1]+" + resTexRC.y;\n int r = 2 * (index / "+r+");\n int c = imod(index, "+r+") * 2;\n\n return ivec2(r, c);\n }\n "}(t,e);case 3:return n=t,r=e,i=[Math.ceil(r[0]/2),Math.ceil(r[1]/2)],s=(o=Math.ceil(n[2]/2))*Math.ceil(n[1]/2),"\n ivec3 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2("+i[0]+", "+i[1]+"));\n int index = resTexRC.x * "+i[1]+" + resTexRC.y;\n\n int b = index / "+s+";\n index -= b * "+s+";\n\n int r = 2 * (index / "+o+");\n int c = imod(index, "+o+") * 2;\n\n return ivec3(b, r, c);\n }\n ";default:return function(t,e){for(var n=[Math.ceil(e[0]/2),Math.ceil(e[1]/2)],r=Math.ceil(t[t.length-1]/2),i=r*Math.ceil(t[t.length-2]/2),o=i,s="",a="b, r, c",l=2;l<t.length-1;l++)s="\n int b"+l+" = index / "+(o*=t[t.length-l-1])+";\n index -= b"+l+" * "+o+";\n "+s,a="b"+l+", "+a;return"\n ivec"+t.length+" getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2("+n[0]+", "+n[1]+"));\n int index = resTexRC.x * "+n[1]+" + resTexRC.y;\n\n "+s+"\n\n int b = index / "+i+";\n index -= b * "+i+";\n\n int r = 2 * (index / "+r+");\n int c = imod(index, "+r+") * 2;\n\n return ivec"+t.length+"("+a+");\n }\n "}(t,e)}var n,r,i,o,s}(e.logicalShape,u),s="\n void setOutput(vec4 val) {\n "+c.output+" = val;\n }\n "):(o=function(t,e){switch(t.length){case 0:return"\n int getOutputCoords() {\n return 0;\n }\n ";case 1:return function(t,e){return 1===e[0]?"\n int getOutputCoords() {\n return int(resultUV.x * "+e[1]+".0);\n }\n ":1===e[1]?"\n int getOutputCoords() {\n return int(resultUV.y * "+e[0]+".0);\n }\n ":"\n int getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2("+e[0]+", "+e[1]+"));\n return resTexRC.x * "+e[1]+" + resTexRC.y;\n }\n "}(0,e);case 2:return function(t,e){return O(t,e)?"\n ivec2 getOutputCoords() {\n return ivec2(resultUV.yx * vec2("+e[0]+", "+e[1]+"));\n }\n ":1===t[1]?"\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2("+e[0]+", "+e[1]+"));\n int index = resTexRC.x * "+e[1]+" + resTexRC.y;\n return ivec2(index, 0);\n }\n ":1===t[0]?"\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2("+e[0]+", "+e[1]+"));\n int index = resTexRC.x * "+e[1]+" + resTexRC.y;\n return ivec2(0, index);\n }\n ":"\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2("+e[0]+", "+e[1]+"));\n int index = resTexRC.x * "+e[1]+" + resTexRC.y;\n int r = index / "+t[1]+";\n int c = index - r * "+t[1]+";\n return ivec2(r, c);\n }\n "}(t,e);case 3:return n=e,r=Ei(["r","c","d"],t),"\n ivec3 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2("+n[0]+", "+n[1]+"));\n int index = resTexRC.x * "+n[1]+" + resTexRC.y;\n "+r+"\n return ivec3(r, c, d);\n }\n ";case 4:return function(t,e){var n=Ei(["r","c","d","d2"],t);return"\n ivec4 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2("+e[0]+", "+e[1]+"));\n int index = resTexRC.x * "+e[1]+" + resTexRC.y;\n "+n+"\n return ivec4(r, c, d, d2);\n }\n "}(t,e);case 5:return function(t,e){var n=Ei(["r","c","d","d2","d3"],t);return"\n ivec5 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx * vec2("+e[0]+",\n "+e[1]+"));\n\n int index = resTexRC.x * "+e[1]+" + resTexRC.y;\n\n "+n+"\n\n ivec5 outShape = ivec5(r, c, d, d2, d3);\n return outShape;\n }\n "}(t,e);case 6:return function(t,e){var n=Ei(["r","c","d","d2","d3","d4"],t);return"\n ivec6 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2("+e[0]+", "+e[1]+"));\n int index = resTexRC.x * "+e[1]+" + resTexRC.y;\n\n "+n+"\n\n ivec6 result = ivec6(r, c, d, d2, d3, d4);\n return result;\n }\n "}(t,e);default:throw new Error(t.length+"-D output sampling is not yet supported")}var n,r}(e.logicalShape,u),s="\n void setOutput(float val) {\n "+c.output+" = vec4(val, 0, 0, 0);\n }\n "),r&&(d+=Ri),[d,h,s,a,o,l,n].join("\n")}var ki="\nvec2 uvFromFlat(int texNumR, int texNumC, int index) {\n int texR = index / texNumC;\n int texC = index - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\nvec2 packedUVfrom1D(int texNumR, int texNumC, int index) {\n int texelIndex = index / 2;\n int texR = texelIndex / texNumC;\n int texC = texelIndex - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n",Oi="\nvec2 packedUVfrom2D(int texelsInLogicalRow, int texNumR,\n int texNumC, int row, int col) {\n int texelIndex = (row / 2) * texelsInLogicalRow + (col / 2);\n int texR = texelIndex / texNumC;\n int texC = texelIndex - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n",Ii="\nvec2 packedUVfrom3D(int texNumR, int texNumC,\n int texelsInBatch, int texelsInLogicalRow, int b,\n int row, int col) {\n int index = b * texelsInBatch + (row / 2) * texelsInLogicalRow + (col / 2);\n int texR = index / texNumC;\n int texC = index - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n",Ri="\n float getChannel(vec4 frag, vec2 innerDims) {\n vec2 modCoord = mod(innerDims, 2.);\n return modCoord.x == 0. ?\n (modCoord.y == 0. ? frag.r : frag.g) :\n (modCoord.y == 0. ? frag.b : frag.a);\n }\n float getChannel(vec4 frag, int dim) {\n float modCoord = mod(float(dim), 2.);\n return modCoord == 0. ? frag.r : frag.g;\n }\n";function Ai(t){return"offset"+t}function Ni(t){var e=t.name,n=k(t.shapeInfo.logicalShape);return n<2?"return "+e+";":"\n for (int i = 0; i < "+n+"; i++) {\n if (i == index) {\n return "+e+"[i];\n }\n }\n "}function Di(t){if(t<=1)return"int";if(2===t)return"ivec2";if(3===t)return"ivec3";if(4===t)return"ivec4";if(5===t)return"ivec5";if(6===t)return"ivec6";throw Error("GPU for rank "+t+" is not yet supported")}function Mi(t,e){var n=JSON.parse(JSON.stringify(t));return n.shapeInfo.logicalShape=e,n}function Li(t,e){return e.map(function(e){return t[e]}).join(", ")}var Pi=function(t,e,n){this.variableNames=["AReal","AImag","BReal","BImag"],this.outputShape=Vr(e,n),this.userCode="\n float binaryOpComplex(\n float areal, float aimag, float breal, float bimag) {\n "+t+"\n }\n\n void main() {\n float areal = getARealAtOutCoords();\n float aimag = getAImagAtOutCoords();\n float breal = getBRealAtOutCoords();\n float bimag = getBImagAtOutCoords();\n setOutput(binaryOpComplex(areal, aimag, breal, bimag));\n }\n "},Fi="return a + b;",Bi="return a - b;",ji="return a * b;",$i="return (a < 0.) ? b * a : a;",Ui=function(t,e,n){this.variableNames=["A","B"],this.outputShape=Vr(e,n),this.userCode="\n float binaryOperation(float a, float b) {\n "+t+"\n }\n\n void main() {\n float a = getAAtOutCoords();\n float b = getBAtOutCoords();\n setOutput(binaryOperation(a, b));\n }\n "},Vi="\n vec4 aLessThanZero = vec4(lessThan(a, vec4(0.)));\n return (aLessThanZero * (b * a)) + ((vec4(1.0) - aLessThanZero) * a);\n",Hi=function(t,e,n,r){void 0===r&&(r=!1),this.variableNames=["A","B"],this.supportsBroadcasting=!0,this.packedInputs=!0,this.packedOutput=!0,this.outputShape=Vr(e,n);var i=this.outputShape.length,o="";if(r)if(0===i||1===k(this.outputShape))o="\n result.y = 0.;\n result.z = 0.;\n result.w = 0.;\n ";else if(o="\n "+Di(i)+" coords = getOutputCoords();\n ",1===i)o+="\n result.y = (coords + 1) >= "+this.outputShape[0]+" ? 0. : result.y;\n result.z = 0.;\n result.w = 0.;\n ";else{var s=Ti("coords",i);o+="\n bool nextRowOutOfBounds =\n ("+s[i-2]+" + 1) >= "+this.outputShape[i-2]+";\n bool nextColOutOfBounds =\n ("+s[i-1]+" + 1) >= "+this.outputShape[i-1]+";\n result.y = nextColOutOfBounds ? 0. : result.y;\n result.z = nextRowOutOfBounds ? 0. : result.z;\n result.w = nextColOutOfBounds || nextRowOutOfBounds ? 0. : result.w;\n "}this.userCode="\n vec4 binaryOperation(vec4 a, vec4 b) {\n "+t+"\n }\n\n void main() {\n vec4 a = getAAtOutCoords();\n vec4 b = getBAtOutCoords();\n\n vec4 result = binaryOperation(a, b);\n "+o+"\n\n setOutput(result);\n }\n "},Wi=function(){function t(t){this.variableNames=["A"],this.outputShape=t,this.userCode="\n uniform float minVal;\n uniform float maxVal;\n\n void main() {\n float value = getAAtOutCoords();\n if (isnan(value)) {\n setOutput(value);\n return;\n }\n\n setOutput(clamp(value, minVal, maxVal));\n }\n "}return t.prototype.getCustomSetupFunc=function(t,e){var n=this;return function(r,i){null==n.minLoc&&(n.minLoc=r.getUniformLocationNoThrow(i,"minVal"),n.maxLoc=r.getUniformLocationNoThrow(i,"maxVal")),r.gl.uniform1f(n.minLoc,t),r.gl.uniform1f(n.maxLoc,e)}},t}(),Gi=function(){function t(t){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=t,this.userCode="\n uniform float minVal;\n uniform float maxVal;\n\n void main() {\n vec4 value = getAAtOutCoords();\n\n if (any(isnan(value))) {\n setOutput(value);\n return;\n }\n\n setOutput(clamp(value, vec4(minVal), vec4(maxVal)));\n }\n "}return t.prototype.getCustomSetupFunc=function(t,e){var n=this;return function(r,i){null==n.minLoc&&(n.minLoc=r.getUniformLocationNoThrow(i,"minVal"),n.maxLoc=r.getUniformLocationNoThrow(i,"maxVal")),r.gl.uniform1f(n.minLoc,t),r.gl.uniform1f(n.maxLoc,e)}},t}();function zi(t,e,n){var r=t.indexOf(e);return t.map(function(t,e){return e===r?t+" - "+n:t}).join()}var Xi=function(t,e,n,r){void 0===e&&(e=!1),void 0===n&&(n=null),void 0===r&&(r=!1),this.variableNames=["x","W"],this.outputShape=t.outShape;var i=t.padInfo.top,o=t.padInfo.left,s=t.strideHeight,a=t.strideWidth,l=t.dilationHeight,u=t.dilationWidth,c=t.filterHeight,h=t.filterWidth,d=4*Math.floor(t.inChannels/4),p=t.inChannels%4,f="channelsLast"===t.dataFormat,g=f?1:2,m=f?2:3,v=f?3:1,b="",_="";n&&(b=r?"float activation(float a) {\n float b = getPreluActivationWeightsAtOutCoords();\n "+n+"\n }":"\n float activation(float x) {\n "+n+"\n }\n ",_="result = activation(result);");var y=e?"result += getBiasAtOutCoords();":"";e&&this.variableNames.push("bias"),r&&this.variableNames.push("preluActivationWeights"),this.userCode="\n "+b+"\n\n const ivec2 strides = ivec2("+s+", "+a+");\n const ivec2 pads = ivec2("+i+", "+o+");\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d2 = coords["+v+"];\n\n ivec2 xRCCorner =\n ivec2(coords["+g+"], coords["+m+"]) * strides - pads;\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // Convolve x(?, ?, d1) with w(:, :, d1, d2) to get y(yR, yC, d2).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < "+c+"; wR++) {\n int xR = xRCorner + wR * "+l+";\n\n if (xR < 0 || xR >= "+t.inHeight+") {\n continue;\n }\n\n for (int wC = 0; wC < "+h+"; wC++) {\n int xC = xCCorner + wC * "+u+";\n\n if (xC < 0 || xC >= "+t.inWidth+") {\n continue;\n }\n\n for (int d1 = 0; d1 < "+d+"; d1 += 4) {\n vec4 wValues = vec4(\n getW(wR, wC, d1, d2),\n getW(wR, wC, d1 + 1, d2),\n getW(wR, wC, d1 + 2, d2),\n getW(wR, wC, d1 + 3, d2)\n );\n\n if ("+f+") {\n vec4 xValues = vec4(\n getX(batch, xR, xC, d1),\n getX(batch, xR, xC, d1 + 1),\n getX(batch, xR, xC, d1 + 2),\n getX(batch, xR, xC, d1 + 3)\n );\n dotProd += dot(xValues, wValues);\n } else {\n vec4 xValues = vec4(\n getX(batch, d1, xR, xC),\n getX(batch, d1 + 1, xR, xC),\n getX(batch, d1 + 2, xR, xC),\n getX(batch, d1 + 3, xR, xC)\n );\n dotProd += dot(xValues, wValues);\n }\n }\n\n if ("+(1===p)+") {\n\n if ("+f+") {\n dotProd +=\n getX(batch, xR, xC, "+d+") *\n getW(wR, wC, "+d+", d2);\n } else {\n dotProd +=\n getX(batch, "+d+", xR, xC) *\n getW(wR, wC, "+d+", d2);\n }\n\n } else if ("+(2===p)+") {\n vec2 wValues = vec2(\n getW(wR, wC, "+d+", d2),\n getW(wR, wC, "+d+" + 1, d2)\n );\n\n if ("+f+") {\n vec2 xValues = vec2(\n getX(batch, xR, xC, "+d+"),\n getX(batch, xR, xC, "+d+" + 1)\n );\n dotProd += dot(xValues, wValues);\n } else {\n vec2 xValues = vec2(\n getX(batch, "+d+", xR, xC),\n getX(batch, "+d+" + 1, xR, xC)\n );\n dotProd += dot(xValues, wValues);\n }\n\n } else if ("+(3===p)+") {\n vec3 wValues = vec3(\n getW(wR, wC, "+d+", d2),\n getW(wR, wC, "+d+" + 1, d2),\n getW(wR, wC, "+d+" + 2, d2)\n );\n\n if ("+f+") {\n vec3 xValues = vec3(\n getX(batch, xR, xC, "+d+"),\n getX(batch, xR, xC, "+d+" + 1),\n getX(batch, xR, xC, "+d+" + 2)\n );\n dotProd += dot(xValues, wValues);\n } else {\n vec3 xValues = vec3(\n getX(batch, "+d+", xR, xC),\n getX(batch, "+d+" + 1, xR, xC),\n getX(batch, "+d+" + 2, xR, xC)\n );\n dotProd += dot(xValues, wValues);\n }\n\n }\n }\n }\n\n float result = dotProd;\n "+y+"\n "+_+"\n setOutput(result);\n }\n "},Ki=function(t,e,n,r){void 0===e&&(e=!1),void 0===n&&(n=null),void 0===r&&(r=!1),this.variableNames=["x","W"],this.outputShape=t.outShape;var i=t.inHeight,o=t.inWidth,s=t.padInfo.top,a=t.padInfo.left,l=t.strideHeight,u=t.strideWidth,c=t.dilationHeight,h=t.dilationWidth,d=t.filterHeight,p=t.filterWidth,f=t.outChannels/t.inChannels,g="",m="";n&&(g=r?"float activation(float a) {\n float b = getPreluActivationWeightsAtOutCoords();\n "+n+"\n }":"\n float activation(float x) {\n "+n+"\n }\n ",m="result = activation(result);");var v=e?"result += getBiasAtOutCoords();":"";e&&this.variableNames.push("bias"),r&&this.variableNames.push("preluActivationWeights"),this.userCode="\n "+g+"\n\n const ivec2 strides = ivec2("+l+", "+u+");\n const ivec2 pads = ivec2("+s+", "+a+");\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords.x;\n ivec2 xRCCorner = coords.yz * strides - pads;\n int d2 = coords.w;\n int d1 = d2 / "+f+";\n int q = d2 - d1 * "+f+";\n\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // Convolve x(?, ?, d1) with w(:, :, d1, q) to get y(yR, yC, d2).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n // TO DO(dsmilkov): Flatten the two for loops and vec4 the operations.\n for (int wR = 0; wR < "+d+"; wR++) {\n int xR = xRCorner + wR * "+c+";\n\n if (xR < 0 || xR >= "+i+") {\n continue;\n }\n\n for (int wC = 0; wC < "+p+"; wC++) {\n int xC = xCCorner + wC * "+h+";\n\n if (xC < 0 || xC >= "+o+") {\n continue;\n }\n\n float xVal = getX(batch, xR, xC, d1);\n float wVal = getW(wR, wC, d1, q);\n dotProd += xVal * wVal;\n }\n }\n\n float result = dotProd;\n "+v+"\n "+m+"\n setOutput(result);\n }\n "},Yi=function(t,e,n,r){void 0===e&&(e=!1),void 0===n&&(n=null),void 0===r&&(r=!1),this.variableNames=["x","W"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=t.outShape;for(var i=t.inHeight,o=t.inWidth,s=t.padInfo.top,a=t.padInfo.left,l=t.strideHeight,u=t.strideWidth,c=t.dilationHeight,h=t.dilationWidth,d=t.filterHeight,p=t.filterWidth,f=p,g="int xR; int xC; int xCOffset;",m=0;m<d;m++)for(var v=0;v<p;v++)g+="\n vec4 xTexelR"+m+"C"+2*v+" = vec4(0.);\n vec4 wR"+m+"C"+v+" = vec4(0.);\n vec4 xR"+m+"C"+v+" = vec4(0.);";for(m=0;m<d;m++)for(var b=0;b<f;b++){if(g+="\n xR = xRCorner + "+m*c+";\n xC = xCCorner + "+(v=2*b)*h+";\n ",1===u){if(v<p&&(g+=a%2==1?"\n xCOffset = xC + 1;\n if(xR >= 0 && xR < "+i+" && xCOffset >= 0 && xCOffset < "+o+") {\n xTexelR"+m+"C"+v+" = getX(batch, xR, xCOffset, d1);\n\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if(xCOffset + 1 >= "+o+") {\n xTexelR"+m+"C"+v+".zw = vec2(0.);\n }\n } else {\n xTexelR"+m+"C"+v+" = vec4(0.);\n }\n\n xCOffset = xC + 1 - 2;\n if(xR >= 0 && xR < "+i+" && xCOffset >= 0 && xCOffset < "+o+") {\n vec4 previous = getX(batch, xR, xCOffset, d1);\n\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if(xCOffset + 1 >= "+o+") {\n previous.zw = vec2(0.);\n }\n\n xR"+m+"C"+v+" = vec4(previous.zw, xTexelR"+m+"C"+v+".xy);\n } else {\n xR"+m+"C"+v+" = vec4(0, 0, xTexelR"+m+"C"+v+".xy);\n }\n ":"\n if(xR >= 0 && xR < "+i+" && xC >= 0 && xC < "+o+") {\n xTexelR"+m+"C"+v+" = getX(batch, xR, xC, d1);\n } else {\n xTexelR"+m+"C"+v+" = vec4(0.);\n }\n\n xR"+m+"C"+v+" = xTexelR"+m+"C"+v+";\n ",v+1<p)){var _=a%2==0?T(h):h;h%2==0&&a%2==1||h%2!=0&&a%2!=1?(g+="\n xCOffset = xC + "+a%2+" + "+_+";\n\n if(xR >= 0 && xR < "+i+" &&\n xCOffset >= 0 && xCOffset < "+o+") {\n xTexelR"+m+"C"+(v+2)+" = getX(batch, xR, xCOffset, d1);\n }\n ",h>1&&(g+="\n xCOffset -= 2;\n if(xR >= 0 && xR < "+i+" &&\n xCOffset >= 0 && xCOffset < "+o+") {\n xTexelR"+m+"C"+v+" = getX(batch, xR, xCOffset, d1);\n } else {\n xTexelR"+m+"C"+v+" = vec4(0.);\n }\n "),g+="\n xR"+m+"C"+(v+1)+" = vec4(\n xTexelR"+m+"C"+v+".zw, xTexelR"+m+"C"+(v+2)+".xy);\n "):g+="\n xCOffset = xC + "+_+";\n\n if(xR >= 0 && xR < "+i+" &&\n xCOffset >= 0 && xCOffset < "+o+") {\n xTexelR"+m+"C"+(v+2)+" = getX(batch, xR, xCOffset, d1);\n }\n\n xR"+m+"C"+(v+1)+" = xTexelR"+m+"C"+(v+2)+";\n "}}else v<p&&(g+="\n if(xR >= 0 && xR < "+i+") {\n ",a%2==1?(g+="\n xCOffset = xC + 1 - "+u+";\n if(xCOffset >= 0 && xCOffset < "+o+") {\n xTexelR"+m+"C"+v+" = getX(batch, xR, xCOffset, d1);\n } else {\n xTexelR"+m+"C"+v+" = vec4(0.);\n }\n\n if(xC + 1 >= 0 && xC + 1 < "+o+") {\n xTexelR"+m+"C"+(v+2)+" = getX(batch, xR, xC + 1, d1);\n } else {\n xTexelR"+m+"C"+(v+2)+" = vec4(0.);\n }\n\n xR"+m+"C"+v+" = vec4(\n xTexelR"+m+"C"+v+".zw, xTexelR"+m+"C"+(v+2)+".zw);\n ",v+1<p&&(g+="\n vec4 final = vec4(0.);\n xCOffset = xC + 1 + "+u+";\n if(xCOffset >= 0 && xCOffset < "+o+") {\n final = getX(batch, xR, xCOffset, d1);\n }\n xR"+m+"C"+(v+1)+" = vec4(xTexelR"+m+"C"+(v+2)+".xy, final.xy);\n ")):(g+="\n if(xC >= 0 && xC < "+o+") {\n xTexelR"+m+"C"+v+" = getX(batch, xR, xC, d1);\n } else {\n xTexelR"+m+"C"+v+" = vec4(0.);\n }\n\n xCOffset = xC + "+u+";\n if(xCOffset >= 0 && xCOffset < "+o+") {\n xTexelR"+m+"C"+(v+2)+" = getX(batch, xR, xCOffset, d1);\n } else {\n xTexelR"+m+"C"+(v+2)+" = vec4(0.);\n }\n\n xR"+m+"C"+v+" = vec4(\n xTexelR"+m+"C"+v+".xy, xTexelR"+m+"C"+(v+2)+".xy);\n ",v+1<p&&(g+="\n xR"+m+"C"+(v+1)+" = vec4(\n xTexelR"+m+"C"+v+".zw, xTexelR"+m+"C"+(v+2)+".zw);\n ")),g+="}");v<p&&(g+="\n vec4 wTexelR"+m+"C"+v+" = getW("+m+", "+v+", d1, q);\n wR"+m+"C"+v+" = vec4(wTexelR"+m+"C"+v+".xz, wTexelR"+m+"C"+v+".xz);\n ",v+1<p&&(g+="\n vec4 wTexelR"+m+"C"+(v+1)+" = getW("+m+", "+(v+1)+", d1, q);\n wR"+m+"C"+(v+1)+" =\n vec4(wTexelR"+m+"C"+(v+1)+".xz, wTexelR"+m+"C"+(v+1)+".xz);"))}for(m=0;m<d;m++)for(v=0;v<p;v++)g+="dotProd += xR"+m+"C"+v+" * wR"+m+"C"+v+";";var y="",x="";n&&(y=r?"vec4 activation(vec4 a) {\n vec4 b = getPreluActivationWeightsAtOutCoords();\n "+n+"\n }":"vec4 activation(vec4 x) {\n "+n+"\n }",x="result = activation(result);");var E=e?"result += getBiasAtOutCoords();":"";e&&this.variableNames.push("bias"),r&&this.variableNames.push("preluActivationWeights"),this.userCode="\n "+y+"\n\n const ivec2 strides = ivec2("+l+", "+u+");\n const ivec2 pads = ivec2("+s+", "+a+");\n\n void main() {\n\n ivec4 coords = getOutputCoords();\n int batch = coords.x;\n ivec2 xRCCorner = coords.yz * strides - pads;\n int d2 = coords.w;\n int d1 = d2;\n int q = 0;\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n vec4 dotProd = vec4(0.);\n\n "+g+"\n\n vec4 result = dotProd;\n "+E+"\n "+x+"\n setOutput(result);\n }\n "};function qi(t,e){if(1===t)return""+e;if(2===t)return e+".y";if(3===t)return e+".z";if(4===t)return e+".w";throw Error("Cumulative sum for rank "+t+" is not yet supported")}var Ji=function(){function t(t,e,n){this.variableNames=["x"],this.outputShape=[],this.outputShape=t,this.blockSize=e,this.dataFormat=n,this.userCode="\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int h = "+this.getHeightCoordString()+";\n int w = "+this.getWidthCoordString()+";\n int d = "+this.getDepthCoordString()+";\n\n int in_h = h / "+e+";\n int offset_h = imod(h, "+e+");\n int in_w = w / "+e+";\n int offset_w = imod(w, "+e+");\n int offset_d = (offset_h * "+e+" + offset_w) *\n "+this.getOutputDepthSize()+";\n int in_d = d + offset_d;\n\n float result = "+this.getInputSamplingString()+";\n setOutput(result);\n }\n "}return t.prototype.getHeightCoordString=function(){return"NHWC"===this.dataFormat?"coords[1]":"coords[2]"},t.prototype.getWidthCoordString=function(){return"NHWC"===this.dataFormat?"coords[2]":"coords[3]"},t.prototype.getDepthCoordString=function(){return"NHWC"===this.dataFormat?"coords[3]":"coords[1]"},t.prototype.getOutputDepthSize=function(){return"NHWC"===this.dataFormat?this.outputShape[3]:this.outputShape[1]},t.prototype.getInputSamplingString=function(){return"NHWC"===this.dataFormat?"getX(b, in_h, in_w, in_d)":"getX(b, in_d, in_h, in_w)"},t}(),Zi=function(t,e,n){this.variableNames=["real","imag"];var r=e[1];this.outputShape=e;var i=n?"2.0 * "+Math.PI:"-2.0 * "+Math.PI,o=n?r+".0":"1.0";this.userCode="\n const float exponentMultiplier = "+i+";\n\n float unaryOpComplex(float real, float expR, float imag, float expI) {\n "+t+"\n }\n\n float mulMatDFT(int batch, int index) {\n float indexRatio = float(index) / float("+r+");\n float exponentMultiplierTimesIndexRatio =\n exponentMultiplier * indexRatio;\n\n float result = 0.0;\n\n for (int i = 0; i < "+r+"; i++) {\n // x = (-2|2 * PI / N) * index * i;\n float x = exponentMultiplierTimesIndexRatio * float(i);\n float expR = cos(x);\n float expI = sin(x);\n float real = getReal(batch, i);\n float imag = getImag(batch, i);\n\n result +=\n unaryOpComplex(real, expR, imag, expI) / "+o+";\n }\n\n return result;\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n setOutput(mulMatDFT(coords[0], coords[1]));\n }\n "},Qi=function(){function t(t,e){this.outputShape=[],this.variableNames=["x"],this.outputShape=t,this.userCode="\n uniform float value;\n void main() {\n // Input can be obtained from uniform value.\n setOutput(value);\n }\n "}return t.prototype.getCustomSetupFunc=function(t){var e=this;return function(n,r){null==e.valueLoc&&(e.valueLoc=n.getUniformLocationNoThrow(r,"value")),n.gl.uniform1f(e.valueLoc,t)}},t}();function to(t,e){var n=xi();return ne(t,e,n.version+"\n precision highp float;\n "+n.attribute+" vec3 clipSpacePos;\n "+n.attribute+" vec2 uv;\n "+n.varyingVs+" vec2 resultUV;\n\n void main() {\n gl_Position = vec4(clipSpacePos, 1);\n resultUV = uv;\n }")}function eo(t,e){return ce(t,e,new Float32Array([-1,1,0,0,1,-1,-1,0,0,0,1,1,0,1,1,1,-1,0,1,0]))}function no(t,e){return he(t,e,new Uint16Array([0,1,2,2,1,3]))}function ro(t,e,n,r,i,o,s){pe(n,r);var a=de(t,e),l=t.TEXTURE_2D;return qt(t,e,function(){return t.bindTexture(l,a)}),qt(t,e,function(){return t.texParameteri(l,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE)}),qt(t,e,function(){return t.texParameteri(l,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE)}),qt(t,e,function(){return t.texParameteri(l,t.TEXTURE_MIN_FILTER,t.NEAREST)}),qt(t,e,function(){return t.texParameteri(l,t.TEXTURE_MAG_FILTER,t.NEAREST)}),qt(t,e,function(){return t.texImage2D(l,0,i,n,r,0,o,s,null)}),qt(t,e,function(){return t.bindTexture(t.TEXTURE_2D,null)}),a}function io(t,e,n,r,i){var o=zt(n,r);return ro(t,e,o[0],o[1],i.internalFormatFloat,i.textureFormatFloat,t.FLOAT)}function oo(t,e,n,r,i){var o=zt(n,r);return ro(t,e,o[0],o[1],i.internalFormatHalfFloat,i.textureFormatFloat,i.textureTypeHalfFloat)}function so(t,e,n,r,i){var o=zt(n,r);return ro(t,e,o[0],o[1],t.RGBA,t.RGBA,t.UNSIGNED_BYTE)}function ao(t,e,n,r,i){var o=Kt(n,r);return ro(t,e,o[0],o[1],i.internalFormatPackedFloat,t.RGBA,t.FLOAT)}function lo(t,e,n,r,i){var o=Kt(n,r);return ro(t,e,o[0],o[1],i.internalFormatPackedHalfFloat,t.RGBA,i.textureTypeHalfFloat)}function uo(t,e,n,r){return qt(t,e,function(){return t.bindBuffer(t.ARRAY_BUFFER,r)}),ge(t,e,n,"clipSpacePos",r,3,20,0)&&ge(t,e,n,"uv",r,2,20,12)}function co(t,e,n,r,i,o,s){var a,l,u;qt(t,e,function(){return t.bindTexture(t.TEXTURE_2D,n)}),o instanceof Uint8Array?(a=new Uint8Array(r*i*4),l=t.UNSIGNED_BYTE,u=t.RGBA):(a=new Float32Array(r*i*4),l=t.FLOAT,u=s.internalFormatPackedFloat),a.set(o),qt(t,e,function(){return t.texImage2D(t.TEXTURE_2D,0,u,r,i,0,t.RGBA,l,a)}),qt(t,e,function(){return t.bindTexture(t.TEXTURE_2D,null)})}function ho(t,e,n,r){qt(t,e,function(){return t.bindTexture(t.TEXTURE_2D,n)}),r.data instanceof Uint8Array?qt(t,e,function(){return t.texImage2D(t.TEXTURE_2D,0,t.RGBA,r.width,r.height,0,t.RGBA,t.UNSIGNED_BYTE,r.data)}):qt(t,e,function(){return t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,r)}),qt(t,e,function(){return t.bindTexture(t.TEXTURE_2D,null)})}function po(t,e,n,r,i){var o=t.createBuffer();qt(t,e,function(){return t.bindBuffer(t.PIXEL_PACK_BUFFER,o)});var s=16*n*r;return qt(t,e,function(){return t.bufferData(t.PIXEL_PACK_BUFFER,s,t.STREAM_READ)}),qt(t,e,function(){return t.readPixels(0,0,r,n,t.RGBA,t.FLOAT,0)}),qt(t,e,function(){return t.bindBuffer(t.PIXEL_PACK_BUFFER,null)}),o}function fo(t,e,n){var r=t,i=new Float32Array(n);return r.bindBuffer(r.PIXEL_PACK_BUFFER,e),r.getBufferSubData(r.PIXEL_PACK_BUFFER,0,i),r.bindBuffer(r.PIXEL_PACK_BUFFER,null),i}function go(t,e,n,r,i){var o=zt(n,r),s=o[0],a=o[1],l=new Uint8Array(n*r*4);return qt(t,e,function(){return t.readPixels(0,0,s,a,i.downloadTextureFormat,t.UNSIGNED_BYTE,l)}),new Float32Array(l.buffer)}function mo(t,e,n,r,i,o,s,a){var l=t,u=new Float32Array(function(t,e){var n=Kt(o,s);return n[0]*n[1]*4}());return l.bindBuffer(l.PIXEL_PACK_BUFFER,e),l.getBufferSubData(l.PIXEL_PACK_BUFFER,0,u),l.bindBuffer(l.PIXEL_PACK_BUFFER,null),u}function vo(t,e,n,r){var i=new Float32Array(n*r*4);return qt(t,e,function(){return t.readPixels(0,0,r,n,t.RGBA,t.FLOAT,i)}),i}var bo=Object.freeze({createVertexShader:to,createVertexBuffer:eo,createIndexBuffer:no,createFloat32MatrixTexture:io,createFloat16MatrixTexture:oo,createUnsignedBytesMatrixTexture:so,createPackedMatrixTexture:ao,createFloat16PackedMatrixTexture:lo,bindVertexProgramAttributeStreams:uo,uploadDenseMatrixToTexture:co,uploadPixelDataToTexture:ho,createBufferFromOutputTexture:po,downloadFloat32MatrixFromBuffer:fo,downloadByteEncodedFloatMatrixFromOutputTexture:go,downloadPackedMatrixFromBuffer:mo,downloadMatrixFromPackedOutputTexture:vo}),_o=function(){function t(t){this.outputTexture=null,this.program=null,this.disposed=!1,this.vertexAttrsAreBound=!1,this.itemsToPoll=[];var e=c().getNumber("WEBGL_VERSION");null!=t?(this.gl=t,Wt(e,t)):this.gl=Gt(e);var n="WEBGL_color_buffer_float";if(1===c().getNumber("WEBGL_VERSION")){if(this.textureFloatExtension=ee(this.gl,this.debug,"OES_texture_float"),Le(this.gl,"OES_texture_half_float"))this.textureHalfFloatExtension=ee(this.gl,this.debug,"OES_texture_half_float");else if(c().get("WEBGL_FORCE_F16_TEXTURES"))throw new Error("GL context does not support half float textures, yet the environment flag WEBGL_FORCE_F16_TEXTURES is set to true.");if(this.colorBufferFloatExtension=this.gl.getExtension(n),Le(this.gl,"EXT_color_buffer_half_float"))this.colorBufferHalfFloatExtension=ee(this.gl,this.debug,"EXT_color_buffer_half_float");else if(c().get("WEBGL_FORCE_F16_TEXTURES"))throw new Error("GL context does not support color renderable half floats, yet the environment flag WEBGL_FORCE_F16_TEXTURES is set to true.")}else if(n="EXT_color_buffer_float",Le(this.gl,n))this.colorBufferFloatExtension=this.gl.getExtension(n);else{if(!Le(this.gl,"EXT_color_buffer_half_float"))throw new Error("GL context does not support color renderable floats");this.colorBufferHalfFloatExtension=this.gl.getExtension("EXT_color_buffer_half_float")}this.vertexBuffer=eo(this.gl,this.debug),this.indexBuffer=no(this.gl,this.debug),this.framebuffer=fe(this.gl,this.debug),this.textureConfig=Yt(this.gl,this.textureHalfFloatExtension)}return Object.defineProperty(t.prototype,"debug",{get:function(){return c().getBool("DEBUG")},enumerable:!0,configurable:!0}),t.prototype.dispose=function(){var t=this;if(!this.disposed){null!=this.program&&console.warn("Disposing a GPGPUContext that still has a bound WebGLProgram. This is probably a resource leak, delete the program with GPGPUContext.deleteProgram before disposing."),null!=this.outputTexture&&console.warn("Disposing a GPGPUContext that still has a bound output matrix texture. This is probably a resource leak, delete the output matrix texture with GPGPUContext.deleteMatrixTexture before disposing.");var e=this.gl;qt(e,this.debug,function(){return e.finish()}),qt(e,this.debug,function(){return e.bindFramebuffer(e.FRAMEBUFFER,null)}),qt(e,this.debug,function(){return e.deleteFramebuffer(t.framebuffer)}),qt(e,this.debug,function(){return e.bindBuffer(e.ARRAY_BUFFER,null)}),qt(e,this.debug,function(){return e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,null)}),qt(e,this.debug,function(){return e.deleteBuffer(t.indexBuffer)}),this.disposed=!0}},t.prototype.createFloat32MatrixTexture=function(t,e){return this.throwIfDisposed(),io(this.gl,this.debug,t,e,this.textureConfig)},t.prototype.createFloat16MatrixTexture=function(t,e){return this.throwIfDisposed(),oo(this.gl,this.debug,t,e,this.textureConfig)},t.prototype.createUnsignedBytesMatrixTexture=function(t,e){return this.throwIfDisposed(),so(this.gl,this.debug,t,e,this.textureConfig)},t.prototype.uploadPixelDataToTexture=function(t,e){this.throwIfDisposed(),ho(this.gl,this.debug,t,e)},t.prototype.uploadDenseMatrixToTexture=function(t,e,n,r){this.throwIfDisposed(),co(this.gl,this.debug,t,e,n,r,this.textureConfig)},t.prototype.createFloat16PackedMatrixTexture=function(t,e){return this.throwIfDisposed(),lo(this.gl,this.debug,t,e,this.textureConfig)},t.prototype.createPackedMatrixTexture=function(t,e){return this.throwIfDisposed(),ao(this.gl,this.debug,t,e,this.textureConfig)},t.prototype.deleteMatrixTexture=function(t){var e=this;this.throwIfDisposed(),this.outputTexture===t&&(Te(this.gl,this.debug,this.framebuffer),this.outputTexture=null),qt(this.gl,this.debug,function(){return e.gl.deleteTexture(t)})},t.prototype.downloadByteEncodedFloatMatrixFromOutputTexture=function(t,e,n){var r=this;return this.downloadMatrixDriver(t,function(){return go(r.gl,r.debug,e,n,r.textureConfig)})},t.prototype.downloadPackedMatrixFromBuffer=function(t,e,n,r,i,o){return mo(this.gl,t,0,0,0,i,o,this.textureConfig)},t.prototype.downloadFloat32MatrixFromBuffer=function(t,e){return fo(this.gl,t,e)},t.prototype.createBufferFromTexture=function(t,e,n){this.bindTextureToFrameBuffer(t);var r=po(this.gl,this.debug,e,n,this.textureConfig);return this.unbindTextureToFrameBuffer(),r},t.prototype.createAndWaitForFence=function(){var t=this.createFence(this.gl);return this.pollFence(t)},t.prototype.createFence=function(t){var e,n,r=this;if(c().getBool("WEBGL_FENCE_API_ENABLED")){var i=t,o=i.fenceSync(i.SYNC_GPU_COMMANDS_COMPLETE,0);t.flush(),n=function(){var t=i.clientWaitSync(o,0,0);return t===i.ALREADY_SIGNALED||t===i.CONDITION_SATISFIED},e=o}else c().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0?(e=this.beginQuery(),this.endQuery(),n=function(){return r.isQueryAvailable(e,c().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))}):n=function(){return!0};return{query:e,isFencePassed:n}},t.prototype.downloadMatrixFromPackedTexture=function(t,e,n){var r=this;return this.downloadMatrixDriver(t,function(){return vo(r.gl,r.debug,e,n)})},t.prototype.createProgram=function(t){this.throwIfDisposed();var e=this.gl,n=re(e,this.debug,t),r=to(e,this.debug),i=ae(e,this.debug);return qt(e,this.debug,function(){return e.attachShader(i,r)}),qt(e,this.debug,function(){return e.attachShader(i,n)}),le(e,this.debug,i),this.debug&&ue(e,this.debug,i),this.vertexAttrsAreBound||(this.setProgram(i),this.vertexAttrsAreBound=uo(e,this.debug,this.program,this.vertexBuffer)),i},t.prototype.deleteProgram=function(t){var e=this;this.throwIfDisposed(),t===this.program&&(this.program=null),null!=t&&qt(this.gl,this.debug,function(){return e.gl.deleteProgram(t)})},t.prototype.setProgram=function(t){var e=this;this.throwIfDisposed(),this.program=t,null!=this.program&&this.debug&&ue(this.gl,this.debug,this.program),qt(this.gl,this.debug,function(){return e.gl.useProgram(t)})},t.prototype.getUniformLocation=function(t,e,n){return void 0===n&&(n=!0),this.throwIfDisposed(),n?ve(this.gl,this.debug,t,e):be(this.gl,t,e)},t.prototype.getAttributeLocation=function(t,e){var n=this;return this.throwIfDisposed(),qt(this.gl,this.debug,function(){return n.gl.getAttribLocation(t,e)})},t.prototype.getUniformLocationNoThrow=function(t,e){return this.throwIfDisposed(),this.gl.getUniformLocation(t,e)},t.prototype.setInputMatrixTexture=function(t,e,n){this.throwIfDisposed(),this.throwIfNoProgram(),_e(this.gl,this.debug,this.program,t,e,n)},t.prototype.setOutputMatrixTexture=function(t,e,n){this.setOutputMatrixTextureDriver(t,n,e)},t.prototype.setOutputPackedMatrixTexture=function(t,e,n){this.throwIfDisposed();var r=Kt(e,n),i=r[0],o=r[1];this.setOutputMatrixTextureDriver(t,i,o)},t.prototype.setOutputMatrixWriteRegion=function(t,e,n,r){this.setOutputMatrixWriteRegionDriver(n,t,r,e)},t.prototype.setOutputPackedMatrixWriteRegion=function(t,e,n,r){throw new Error("setOutputPackedMatrixWriteRegion not implemented.")},t.prototype.debugValidate=function(){null!=this.program&&ue(this.gl,this.debug,this.program),xe(this.gl)},t.prototype.executeProgram=function(){this.throwIfDisposed(),this.throwIfNoProgram();var t=this.gl;this.debug&&this.debugValidate(),qt(t,this.debug,function(){return t.drawElements(t.TRIANGLES,6,t.UNSIGNED_SHORT,0)})},t.prototype.blockUntilAllProgramsCompleted=function(){var t=this;this.throwIfDisposed(),qt(this.gl,this.debug,function(){return t.gl.finish()})},t.prototype.getQueryTimerExtension=function(){return null==this.disjointQueryTimerExtension&&(this.disjointQueryTimerExtension=ee(this.gl,this.debug,2===c().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")?"EXT_disjoint_timer_query_webgl2":"EXT_disjoint_timer_query")),this.disjointQueryTimerExtension},t.prototype.getQueryTimerExtensionWebGL2=function(){return this.getQueryTimerExtension()},t.prototype.getQueryTimerExtensionWebGL1=function(){return this.getQueryTimerExtension()},t.prototype.beginQuery=function(){if(2===c().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")){var t=this.gl,e=this.getQueryTimerExtensionWebGL2(),n=t.createQuery();return t.beginQuery(e.TIME_ELAPSED_EXT,n),n}var r=this.getQueryTimerExtensionWebGL1(),i=r.createQueryEXT();return r.beginQueryEXT(r.TIME_ELAPSED_EXT,i),i},t.prototype.endQuery=function(){if(2!==c().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")){var t=this.getQueryTimerExtensionWebGL1();t.endQueryEXT(t.TIME_ELAPSED_EXT)}else{var e=this.gl,n=this.getQueryTimerExtensionWebGL2();e.endQuery(n.TIME_ELAPSED_EXT)}},t.prototype.waitForQueryAndGetTime=function(t){return a(this,void 0,void 0,function(){var e=this;return l(this,function(n){switch(n.label){case 0:return[4,D(function(){return e.disposed||e.isQueryAvailable(t,c().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))})];case 1:return n.sent(),[2,this.getQueryTime(t,c().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))]}})})},t.prototype.getQueryTime=function(t,e){if(0===e)return null;if(2===e){var n=this.gl;return n.getQueryParameter(t,n.QUERY_RESULT)/1e6}var r=this.getQueryTimerExtensionWebGL1();return r.getQueryObjectEXT(t,r.QUERY_RESULT_EXT)/1e6},t.prototype.isQueryAvailable=function(t,e){if(0===e)return!0;if(2===e){var n=this.gl,r=this.getQueryTimerExtensionWebGL2(),i=n.getQueryParameter(t,n.QUERY_RESULT_AVAILABLE);return null==this.disjoint&&(this.disjoint=this.gl.getParameter(r.GPU_DISJOINT_EXT)),i&&!this.disjoint}return i=(r=this.getQueryTimerExtensionWebGL1()).getQueryObjectEXT(t,r.QUERY_RESULT_AVAILABLE_EXT),null==this.disjoint&&(this.disjoint=this.gl.getParameter(r.GPU_DISJOINT_EXT)),i&&!this.disjoint},t.prototype.pollFence=function(t){var e=this;return new Promise(function(n){e.addItemToPoll(function(){return t.isFencePassed()},function(){return n()})})},t.prototype.pollItems=function(){for(var t=function(t){for(var e=0;e<t.length&&t[e]();++e);return e-1}(this.itemsToPoll.map(function(t){return t.isDoneFn})),e=0;e<=t;++e)(0,this.itemsToPoll[e].resolveFn)();this.itemsToPoll=this.itemsToPoll.slice(t+1)},t.prototype.addItemToPoll=function(t,e){var n=this;this.itemsToPoll.push({isDoneFn:t,resolveFn:e}),this.itemsToPoll.length>1||D(function(){return n.pollItems(),0===n.itemsToPoll.length})},t.prototype.bindTextureToFrameBuffer=function(t){this.throwIfDisposed(),ye(this.gl,this.debug,t,this.framebuffer),this.debug&&xe(this.gl)},t.prototype.unbindTextureToFrameBuffer=function(){null!=this.outputTexture?(ye(this.gl,this.debug,this.outputTexture,this.framebuffer),this.debug&&xe(this.gl)):Te(this.gl,this.debug,this.framebuffer)},t.prototype.downloadMatrixDriver=function(t,e){this.bindTextureToFrameBuffer(t);var n=e();return this.unbindTextureToFrameBuffer(),n},t.prototype.setOutputMatrixTextureDriver=function(t,e,n){this.throwIfDisposed();var r=this.gl;ye(r,this.debug,t,this.framebuffer),this.debug&&xe(r),this.outputTexture=t,qt(r,this.debug,function(){return r.viewport(0,0,e,n)}),qt(r,this.debug,function(){return r.scissor(0,0,e,n)})},t.prototype.setOutputMatrixWriteRegionDriver=function(t,e,n,r){var i=this;this.throwIfDisposed(),qt(this.gl,this.debug,function(){return i.gl.scissor(t,e,n,r)})},t.prototype.throwIfDisposed=function(){if(this.disposed)throw new Error("Attempted to use disposed GPGPUContext.")},t.prototype.throwIfNoProgram=function(){if(null==this.program)throw new Error("No GPU program is currently set.")},t}();function yo(t,e){if(t.length!==e.length)throw Error("Binary was compiled with "+t.length+" inputs, but was executed with "+e.length+" inputs");t.forEach(function(t,n){var r=t.logicalShape,i=e[n],o=i.shape;if(!O(r,o))throw Error("Binary was compiled with different shapes than the current args. Shapes "+r+" and "+o+" must match");if(!t.isUniform||!i.isUniform){var s=t.texShape,a=i.isUniform?null:i.texData.texShape;if(!O(s,a))throw Error("Binary was compiled with different texture shapes than the current args. Shape "+s+" and "+a+" must match")}})}var To=function(t,e,n,r,i,o,s){void 0===n&&(n=!1),void 0===r&&(r=!1),void 0===i&&(i=!1),void 0===o&&(o=null),void 0===s&&(s=!1),this.variableNames=["matrixA","matrixB"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e;var a=n?t[1]:t[2],l=Math.ceil(a/2),u=n?"i * 2, rc.y":"rc.y, i * 2",c=r?"rc.z, i * 2":"i * 2, rc.z",h=n?["a.xxyy","a.zzww"]:["a.xxzz","a.yyww"],d=r?["b.xzxz","b.ywyw"]:["b.xyxy","b.zwzw"],p="",f="";o&&(p=s?"vec4 activation(vec4 a) {\n vec4 b = getPreluActivationWeightsAtOutCoords();\n "+o+"\n }":"vec4 activation(vec4 x) {\n "+o+"\n }",f="result = activation(result);");var g=i?"result += getBiasAtOutCoords();":"";i&&this.variableNames.push("bias"),s&&this.variableNames.push("preluActivationWeights"),this.userCode="\n "+p+"\n\n const float sharedDimension = "+l+".0;\n\n vec4 dot2x2ARowBCol(ivec3 rc) {\n vec4 result = vec4(0);\n for (int i = 0; i < "+l+"; i++) {\n vec4 a = getMatrixA(rc.x, "+u+");\n vec4 b = getMatrixB(rc.x, "+c+");\n\n // These swizzled products need to be separately added.\n // See: https://github.com/tensorflow/tfjs/issues/1735\n result += ("+h[0]+" * "+d[0]+");\n result += ("+h[1]+" * "+d[1]+");\n }\n return result;\n }\n\n void main() {\n ivec3 rc = getOutputCoords();\n vec4 result = dot2x2ARowBCol(rc);\n\n "+g+"\n\n "+f+"\n\n setOutput(result);\n }\n "},xo=function(){function t(t,e,n){this.variableNames=["probs"],this.outputShape=[t,n],this.userCode="\n uniform float seed;\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n\n float r = random(seed);\n float cdf = 0.0;\n\n for (int i = 0; i < "+(e-1)+"; i++) {\n cdf += getProbs(batch, i);\n\n if (r < cdf) {\n setOutput(float(i));\n return;\n }\n }\n\n // If no other event happened, last event happened.\n setOutput(float("+(e-1)+"));\n }\n "}return t.prototype.getCustomSetupFunc=function(t){var e=this;return function(n,r){null==e.seedLoc&&(e.seedLoc=n.getUniformLocation(r,"seed")),n.gl.uniform1f(e.seedLoc,t)}},t}(),Eo=function(t,e,n){if(this.variableNames=["x"],"avg"===e&&n)throw new Error("Cannot compute positions for average pool.");var r=t.filterWidth,i=t.strideHeight,o=t.strideWidth,s=t.dilationHeight,a=t.dilationWidth,l=t.effectiveFilterHeight,u=t.effectiveFilterWidth,c=t.padInfo.top,h=t.padInfo.left;this.outputShape=t.outShape;var d="avg"===e,p="0.0";if(d||(p="-1.0 / 1e-20"),n)this.userCode="\n const ivec2 strides = ivec2("+i+", "+o+");\n const ivec2 pads = ivec2("+c+", "+h+");\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d = coords[3];\n\n ivec2 xRCCorner = coords.yz * strides - pads;\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // max/min x(?, ?, d) to get y(yR, yC, d).\n // ? = to be determined\n float minMaxValue = 0.0;\n float minMaxValueFound = 0.0;\n int minMaxPosition = 0;\n float avgValue = 0.0;\n\n for (int wR = 0; wR < "+l+";\n wR += "+s+") {\n int xR = xRCorner + wR;\n\n if (xR < 0 || xR >= "+t.inHeight+") {\n continue;\n }\n\n for (int wC = 0; wC < "+u+";\n wC += "+a+") {\n int xC = xCCorner + wC;\n\n if (xC < 0 || xC >= "+t.inWidth+") {\n continue;\n }\n\n float value = getX(batch, xR, xC, d);\n\n // If a min / max value has already been found, use it. If not,\n // use the current value.\n float currMinMaxValue = mix(\n value, minMaxValue, minMaxValueFound);\n if (value >= currMinMaxValue) {\n minMaxValue = value;\n minMaxValueFound = 1.0;\n minMaxPosition = wR * "+u+" + wC;\n }\n }\n }\n setOutput(float(minMaxPosition));\n }\n ";else{var f=e+"("+e+"("+e+"(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])";"avg"===e&&(f="avgValue / count");var g=4*Math.floor(r/4),m=r%4,v="\n if ("+d+") {\n avgValue += dot(values, ones);\n } else {\n minMaxValue = max(values, minMaxValue);\n }\n ";this.userCode="\n const ivec2 strides = ivec2("+i+", "+o+");\n const ivec2 pads = ivec2("+c+", "+h+");\n const float initializationValue = "+p+";\n const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n float count = 0.0;\n\n float getValue(int batch, int xR, int xC, int d) {\n if (xC < 0 || xC >= "+t.inWidth+") {\n return initializationValue;\n }\n count += 1.0;\n return getX(batch, xR, xC, d);\n }\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d = coords[3];\n\n ivec2 xRCCorner = coords.yz * strides - pads;\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // max/min x(?, ?, d) to get y(yR, yC, d).\n // ? = to be determined\n vec4 minMaxValue = vec4("+p+");\n float avgValue = 0.0;\n count = 0.0;\n\n for (int wR = 0; wR < "+l+";\n wR += "+s+") {\n int xR = xRCorner + wR;\n\n if (xR < 0 || xR >= "+t.inHeight+") {\n continue;\n }\n\n for (int wC = 0; wC < "+g+"; wC += 4) {\n int xC = xCCorner + wC * "+a+";\n\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + "+a+", d),\n getValue(batch, xR, xC + 2 * "+a+", d),\n getValue(batch, xR, xC + 3 * "+a+", d)\n );\n\n "+v+"\n }\n\n int xC = xCCorner + "+g+";\n if ("+(1===m)+") {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n "+v+"\n } else if ("+(2===m)+") {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + "+a+", d),\n initializationValue,\n initializationValue\n );\n\n "+v+"\n } else if ("+(3===m)+") {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + "+a+", d),\n getValue(batch, xR, xC + 2 * "+a+", d),\n initializationValue\n );\n\n "+v+"\n }\n }\n setOutput("+f+");\n }\n "}},wo=function(t,e,n){if(this.variableNames=["x"],"avg"===e&&n)throw new Error("Cannot compute positions for average pool.");var r=t.filterWidth,i=t.strideDepth,o=t.strideHeight,s=t.strideWidth,a=t.dilationDepth,l=t.dilationHeight,u=t.dilationWidth,c=t.effectiveFilterDepth,h=t.effectiveFilterHeight,d=t.effectiveFilterWidth,p=t.padInfo.front,f=t.padInfo.top,g=t.padInfo.left;this.outputShape=t.outShape;var m="avg"===e,v="0.0";if(m||(v="-1.0 / 1e-20"),n)this.userCode="\n const ivec3 strides =\n ivec3("+i+", "+o+", "+s+");\n const ivec3 pads = ivec3("+p+", "+f+", "+g+");\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int ch = coords.u;\n\n ivec3 xCorner = ivec3(coords.y, coords.z, coords.w) * strides - pads;\n int xDCorner = xCorner.x;\n int xRCorner = xCorner.y;\n int xCCorner = xCorner.z;\n\n // max/min x(?, ?, ?, ch) to get y(yD, yR, yC, ch).\n // ? = to be determined\n float minMaxValue = 0.0;\n float minMaxValueFound = 0.0;\n int minMaxPosition = 0;\n\n for (int wD = 0; wD < "+c+";\n wD += "+a+") {\n int xD = xDCorner + wD;\n\n if (xD < 0 || xD >= "+t.inDepth+") {\n continue;\n }\n\n for (int wR = 0; wR < "+h+";\n wR += "+l+") {\n int xR = xRCorner + wR;\n\n if (xR < 0 || xR >= "+t.inHeight+") {\n continue;\n }\n\n for (int wC = 0; wC < "+d+";\n wC += "+u+") {\n int xC = xCCorner + wC;\n\n if (xC < 0 || xC >= "+t.inWidth+") {\n continue;\n }\n\n float value = getX(batch, xD, xR, xC, ch);\n\n // If a min / max value has already been found, use it. If not,\n // use the current value.\n float currMinMaxValue = mix(\n value, minMaxValue, minMaxValueFound);\n if (value >= currMinMaxValue) {\n minMaxValue = value;\n minMaxValueFound = 1.0;\n minMaxPosition =\n wD * "+h+" * "+d+" +\n wR * "+d+" + wC;;\n }\n }\n }\n }\n setOutput(float(minMaxPosition));\n }\n ";else{var b=e+"("+e+"("+e+"(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])";"avg"===e&&(b="avgValue / count");var _=4*Math.floor(r/4),y=r%4,T="\n if ("+m+") {\n avgValue += dot(values, ones);\n } else {\n minMaxValue = max(values, minMaxValue);\n }\n ";this.userCode="\n const ivec3 strides =\n ivec3("+i+", "+o+", "+s+");\n const ivec3 pads = ivec3("+p+", "+f+", "+g+");\n const float initializationValue = "+v+";\n const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n float count = 0.0;\n\n float getValue(int batch, int xD, int xR, int xC, int ch) {\n if (xC < 0 || xC >= "+t.inWidth+") {\n return initializationValue;\n }\n count += 1.0;\n return getX(batch, xD, xR, xC, ch);\n }\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int ch = coords.u;\n\n ivec3 xCorner = ivec3(coords.y, coords.z, coords.w) * strides - pads;\n int xDCorner = xCorner.x;\n int xRCorner = xCorner.y;\n int xCCorner = xCorner.z;\n\n // max/min x(?, ?, ?, d) to get y(yD, yR, yC, ch).\n // ? = to be determined\n vec4 minMaxValue = vec4("+v+");\n float avgValue = 0.0;\n count = 0.0;\n\n for (int wD = 0; wD < "+c+";\n wD += "+a+") {\n int xD = xDCorner + wD;\n\n if (xD < 0 || xD >= "+t.inDepth+") {\n continue;\n }\n\n for (int wR = 0; wR < "+h+";\n wR += "+l+") {\n int xR = xRCorner + wR;\n\n if (xR < 0 || xR >= "+t.inHeight+") {\n continue;\n }\n\n for (int wC = 0; wC < "+_+"; wC += 4) {\n int xC = xCCorner + wC * "+u+";\n\n vec4 values = vec4(\n getValue(batch, xD, xR, xC, ch),\n getValue(batch, xD, xR, xC + "+u+", ch),\n getValue(batch, xD, xR, xC + 2 * "+u+", ch),\n getValue(batch, xD, xR, xC + 3 * "+u+", ch)\n );\n\n "+T+"\n }\n\n int xC = xCCorner + "+_+";\n if ("+(1===y)+") {\n vec4 values = vec4(\n getValue(batch, xD, xR, xC, ch),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n "+T+"\n } else if ("+(2===y)+") {\n vec4 values = vec4(\n getValue(batch, xD, xR, xC, ch),\n getValue(batch, xD, xR, xC + "+u+", ch),\n initializationValue,\n initializationValue\n );\n\n "+T+"\n } else if ("+(3===y)+") {\n vec4 values = vec4(\n getValue(batch, xD, xR, xC, ch),\n getValue(batch, xD, xR, xC + "+u+", ch),\n getValue(batch, xD, xR, xC + 2 * "+u+", ch),\n initializationValue\n );\n\n "+T+"\n }\n }\n setOutput("+b+");\n }\n }\n "}},Co=function(t,e,n,r,i,o,s){void 0===s&&(s=!0),this.variableNames=["updates","indices","defaultValue"],this.outputShape=o;var a=Di(i.length),l=Di(o.length),u="";1===n?u="i":2===n&&(u="i, j");var c="getIndices("+u+")",h="";1===r?h="i":2===r&&(h="i, coords[1]");var d="getUpdates("+h+")",p=e>1?"strides[j]":"strides";this.userCode="\n "+a+" strides = "+a+"("+i+");\n\n void main() {\n "+l+" coords = getOutputCoords();\n float sum = 0.0;\n bool found = false;\n for (int i = 0; i < "+t+"; i++) {\n int flattenedIndex = 0;\n for (int j = 0; j < "+e+"; j++) {\n int index = round("+c+");\n flattenedIndex += index * "+p+";\n }\n if (flattenedIndex == coords[0]) {\n sum += "+d+";\n found = true;\n }\n }\n setOutput(mix(getDefaultValue(), sum, float(found)));\n }\n "},So=function(){function t(t){this.variableNames=["source"],this.outputShape=t,this.rank=t.length;var e,n=Di(this.rank),r="uniform int start["+this.rank+"];",i=function(t){if(1===t)return"sourceLoc";if(t<=6)return ko.slice(0,t).map(function(t){return"sourceLoc."+t}).join(",");throw Error("Slicing for rank "+t+" is not yet supported")}(this.rank);e="\n "+n+" sourceLoc;\n "+n+" coords = getOutputCoords();\n "+t.map(function(t,e){return"sourceLoc."+ko[e]+" = start["+e+"] + coords."+ko[e]+";"}).join("\n")+"\n ",this.userCode="\n "+r+"\n void main() {\n "+e+"\n setOutput(getSource("+i+"));\n }\n "}return t.prototype.getCustomSetupFunc=function(t){var e=this;if(t.length!==this.rank)throw Error("The rank ("+this.rank+") of the program must match the length of start ("+t.length+")");return function(n,r){null==e.startLoc&&(e.startLoc=n.getUniformLocationNoThrow(r,"start"),null==e.startLoc)||n.gl.uniform1iv(e.startLoc,t)}},t}(),ko=["x","y","z","w","u","v"],Oo=function(){function t(t){this.variableNames=["source"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=t,this.rank=t.length;var e=Di(this.rank),n=Ti("coords",this.rank),r=Ti("sourceLoc",this.rank),i=1===this.rank?"sourceLoc":"vec2("+r.slice(-2).join()+")",o="getChannel(getSource("+r.join()+"), "+i+")",s="\n result.x = "+o+";\n if (++"+n[this.rank-1]+" < "+t[this.rank-1]+") {\n ++"+r[this.rank-1]+";\n result.y = "+o+";\n --"+r[this.rank-1]+";\n }\n ",a=1===this.rank?"":"\n --"+n[this.rank-1]+";\n if (++"+n[this.rank-2]+" < "+t[this.rank-2]+") {\n ++"+r[this.rank-2]+";\n result.z = "+o+";\n if (++"+n[this.rank-1]+" < "+t[this.rank-1]+") {\n ++"+r[this.rank-1]+";\n result.w = "+o+";\n }\n }\n ",l=this.rank<=4?"sourceLoc = coords +\n "+e+"("+t.map(function(t,e){return"start["+e+"]"}).join()+");":t.map(function(t,e){return r[e]+" = "+n[e]+" + start["+e+"];"}).join("\n");this.userCode="\n uniform int start["+this.rank+"];\n void main() {\n "+e+" coords = getOutputCoords();\n "+e+" sourceLoc;\n "+l+"\n vec4 result = vec4(0.);\n "+s+"\n "+a+"\n setOutput(result);\n }\n "}return t.prototype.getCustomSetupFunc=function(t){var e=this;if(t.length!==this.rank)throw Error("The rank ("+this.rank+") of the program must match the length of start ("+t.length+")");return function(n,r){null==e.startLoc&&(e.startLoc=n.getUniformLocationNoThrow(r,"start"),null==e.startLoc)||n.gl.uniform1iv(e.startLoc,t)}},t}(),Io=function(){function t(t){this.gpgpu=t,this.numUsedTextures=0,this.numFreeTextures=0,this.freeTextures={},this.logEnabled=!1,this.usedTextures={}}return t.prototype.acquireTexture=function(t,e,n){var r,i=Ro(e,n),o=Ao(t,i,n);if(o in this.freeTextures||(this.freeTextures[o]=[]),o in this.usedTextures||(this.usedTextures[o]=[]),this.freeTextures[o].length>0){this.numFreeTextures--,this.numUsedTextures++,this.log();var s=this.freeTextures[o].shift();return this.usedTextures[o].push(s),s}return this.numUsedTextures++,this.log(),i===Ut.PACKED_2X2_FLOAT32?r=this.gpgpu.createPackedMatrixTexture(t[0],t[1]):i===Ut.PACKED_2X2_FLOAT16?r=this.gpgpu.createFloat16PackedMatrixTexture(t[0],t[1]):i===Ut.UNPACKED_FLOAT32?r=this.gpgpu.createFloat32MatrixTexture(t[0],t[1]):i===Ut.UNPACKED_FLOAT16?r=this.gpgpu.createFloat16MatrixTexture(t[0],t[1]):i===Ut.PACKED_4X1_UNSIGNED_BYTE&&(r=this.gpgpu.createUnsignedBytesMatrixTexture(t[0],t[1])),this.usedTextures[o].push(r),r},t.prototype.releaseTexture=function(t,e,n,r){if(null!=this.freeTextures){var i=Ao(e,Ro(n,r),r);i in this.freeTextures||(this.freeTextures[i]=[]),this.freeTextures[i].push(t),this.numFreeTextures++,this.numUsedTextures--;var o=this.usedTextures[i],s=o.indexOf(t);if(s<0)throw new Error("Cannot release a texture that was never provided by this texture manager");o.splice(s,1),this.log()}},t.prototype.log=function(){if(this.logEnabled){var t=this.numFreeTextures+this.numUsedTextures;console.log("Free/Used",this.numFreeTextures+" / "+this.numUsedTextures,"("+t+")")}},t.prototype.getNumUsedTextures=function(){return this.numUsedTextures},t.prototype.getNumFreeTextures=function(){return this.numFreeTextures},t.prototype.dispose=function(){var t=this;if(null!=this.freeTextures){for(var e in this.freeTextures)this.freeTextures[e].forEach(function(e){t.gpgpu.deleteMatrixTexture(e)});for(var e in this.usedTextures)this.usedTextures[e].forEach(function(e){t.gpgpu.deleteMatrixTexture(e)});this.freeTextures=null,this.usedTextures=null,this.numUsedTextures=0,this.numFreeTextures=0}},t}();function Ro(t,e){if(t===$t.UPLOAD)return Ut.PACKED_2X2_FLOAT32;if(t===$t.RENDER||null==t)return function(t){return c().getBool("WEBGL_RENDER_FLOAT32_ENABLED")?t?Ut.PACKED_2X2_FLOAT32:Ut.UNPACKED_FLOAT32:t?Ut.PACKED_2X2_FLOAT16:Ut.UNPACKED_FLOAT16}(e);if(t===$t.DOWNLOAD||t===$t.PIXELS)return Ut.PACKED_4X1_UNSIGNED_BYTE;throw new Error("Unknown logical texture type "+t)}function Ao(t,e,n){return t[0]+"_"+t[1]+"_"+e+"_"+n}var No=1.7580993408473768,Do=1.0507009873554805,Mo=function(t,e){this.variableNames=["A"],this.outputShape=t,this.userCode="\n float unaryOperation(float x) {\n "+e+"\n }\n\n void main() {\n float x = getAAtOutCoords();\n float y = unaryOperation(x);\n\n setOutput(y);\n }\n "},Lo="if (isnan(x)) return x;",Po="return x;",Fo="return abs(x);",Bo=Lo+"\n return (x < 0.0) ? 0.0 : x;\n",jo=Lo+"\n return (x < 0.0) ? 0.0 : min(6.0, x);\n",$o="return (x >= 0.0) ? x : (exp(x) - 1.0);",Uo="return -x;",Vo="return ceil(x);",Ho="return floor(x);",Wo="return exp(x);",Go="return exp(x) - 1.0;",zo="return x;",Xo="return x;",Ko="\n vec4 result = x * vec4(greaterThanEqual(x, vec4(0.0)));\n bvec4 isNaN = isnan(x);\n\n result.r = isNaN.r ? x.r : result.r;\n result.g = isNaN.g ? x.g : result.g;\n result.b = isNaN.b ? x.b : result.b;\n result.a = isNaN.a ? x.a : result.a;\n\n return result;\n",Yo="\n vec4 result = min(x, vec4(6.)) * vec4(greaterThanEqual(x, vec4(0.0)));\n bvec4 isNaN = isnan(x);\n\n result.r = isNaN.r ? x.r : result.r;\n result.g = isNaN.g ? x.g : result.g;\n result.b = isNaN.b ? x.b : result.b;\n result.a = isNaN.a ? x.a : result.a;\n\n return result;\n",qo="\n vec4 result;\n\n result.r = (x.r >= 0.0) ? x.r : (exp(x.r) - 1.0);\n result.g = (x.g >= 0.0) ? x.g : (exp(x.g) - 1.0);\n result.b = (x.b >= 0.0) ? x.b : (exp(x.b) - 1.0);\n result.a = (x.a >= 0.0) ? x.a : (exp(x.a) - 1.0);\n\n return result;\n",Jo=function(t,e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=t,this.userCode="\n vec4 unaryOperation(vec4 x) {\n "+e+"\n }\n\n void main() {\n vec4 x = getAAtOutCoords();\n vec4 y = unaryOperation(x);\n\n setOutput(y);\n }\n "},Zo={};function Qo(t,e){if(void 0===e&&(e=!1),"linear"===t)return e?Xo:Po;if("relu"===t)return e?Ko:Bo;if("elu"===t)return e?qo:$o;if("relu6"===t)return e?Yo:jo;if("prelu"===t)return e?Vi:$i;throw new Error("Activation "+t+" has not been implemented for the WebGL backend.")}var ts=600,es=function(t){function e(e){var n,r=t.call(this)||this;if(r.pendingRead=new WeakMap,r.pendingDisposal=new WeakSet,r.dataRefCount=new WeakMap,r.numBytesInGPU=0,r.uploadWaitMs=0,r.downloadWaitMs=0,r.warnedAboutMemory=!1,r.pendingDeletes=0,r.disposed=!1,!c().getBool("HAS_WEBGL"))throw new Error("WebGL is not supported on this device");if(null==e){var i=Gt(c().getNumber("WEBGL_VERSION"));r.binaryCache=(n=c().getNumber("WEBGL_VERSION"))in Zo?Zo[n]:(Zo[n]={},Zo[n]),r.gpgpu=new _o(i),r.canvas=i.canvas,r.gpgpuCreatedLocally=!0}else r.gpgpu=e,r.binaryCache={},r.gpgpuCreatedLocally=!1,r.canvas=e.gl.canvas;return r.textureManager=new Io(r.gpgpu),r.numMBBeforeWarning=null==c().global.screen?1024:c().global.screen.height*c().global.screen.width*window.devicePixelRatio*ts/1024/1024,r.texData=new Fr(r,Pt),r}return s(e,t),e.prototype.numDataIds=function(){return this.texData.numDataIds()+(this.cpuBackend?this.cpuBackend.numDataIds():0)-this.pendingDeletes},e.prototype.write=function(t,e,n){if(c().getBool("DEBUG")&&this.checkNumericalProblems(t),"complex64"===n&&null!=t)throw new Error("Cannot write to a complex64 dtype. Please use tf.complex(real, imag).");var r={};return this.texData.set(r,{shape:e,dtype:n,values:t,usage:$t.UPLOAD}),r},e.prototype.move=function(t,e,n,r){if(c().getBool("DEBUG")&&this.checkNumericalProblems(e),"complex64"===r)throw new Error("Cannot write to a complex64 dtype. Please use tf.complex(real, imag).");this.texData.set(t,{shape:n,dtype:r,values:e,usage:$t.UPLOAD})},e.prototype.readSync=function(t){var e=this.texData.get(t),n=e.values,r=e.dtype,i=e.complexTensors,o=e.slice,s=e.shape,a=e.isPacked;if(null!=o){var l;l=a?new Jo(s,zo):new Mo(s,zo);var u=this.runWebGLProgram(l,[{dataId:t,shape:s,dtype:r}],r),c=this.readSync(u.dataId);return this.disposeData(u.dataId),c}if(null!=n)return this.convertAndCacheOnCPU(t);if("string"===r)return n;var h,d,p=null!=this.activeTimers;return p&&(h=nt()),d="complex64"===r?ii(i.real.dataSync(),i.imag.dataSync()):this.getValuesFromTexture(t),p&&(this.downloadWaitMs+=nt()-h),this.convertAndCacheOnCPU(t,d)},e.prototype.read=function(t){return a(this,void 0,void 0,function(){var e,n,r,i,o,s,a,u,h,d,p,f,g,m,v,b,_,y,T,x,E,w;return l(this,function(l){switch(l.label){case 0:if(this.pendingRead.has(t))return e=this.pendingRead.get(t),[2,new Promise(function(t){return e.push(t)})];if(n=this.texData.get(t),r=n.values,i=n.shape,o=n.slice,s=n.dtype,a=n.complexTensors,u=n.isPacked,null!=o)return h=void 0,h=u?new Jo(i,zo):new Mo(i,zo),d=this.runWebGLProgram(h,[{dataId:t,shape:i,dtype:s}],s),p=this.read(d.dataId),this.disposeData(d.dataId),[2,p];if(null!=r)return[2,this.convertAndCacheOnCPU(t)];if(!c().getBool("WEBGL_DOWNLOAD_FLOAT_ENABLED")&&2===c().getNumber("WEBGL_VERSION"))throw new Error("tensor.data() with WEBGL_DOWNLOAD_FLOAT_ENABLED=false and WEBGL_VERSION=2 not yet supported.");return f=null,"complex64"!==s&&c().get("WEBGL_BUFFER_SUPPORTED")&&(g=this.decode(t),m=this.texData.get(g.dataId),f=(w=this.gpgpu).createBufferFromTexture.apply(w,[m.texture].concat(Xt(i)))),this.pendingRead.set(t,[]),"complex64"===s?[3,2]:[4,this.gpgpu.createAndWaitForFence()];case 1:l.sent(),l.label=2;case 2:return"complex64"!==s?[3,4]:[4,Promise.all([a.real.data(),a.imag.data()])];case 3:return b=l.sent(),_=b[0],y=b[1],v=ii(_,y),[3,5];case 4:null==f?v=this.getValuesFromTexture(t):(T=k(i),v=this.gpgpu.downloadFloat32MatrixFromBuffer(f,T)),l.label=5;case 5:return null!=g&&this.disposeData(g.dataId),x=this.convertAndCacheOnCPU(t,v),E=this.pendingRead.get(t),this.pendingRead.delete(t),E.forEach(function(t){return t(x)}),this.pendingDisposal.has(t)&&(this.pendingDisposal.delete(t),this.disposeData(t),this.pendingDeletes--),[2,x]}})})},e.prototype.checkNumericalProblems=function(t){if(null!=t)for(var e=0;e<t.length;e++){var n=t[e];if(!Qt(n)){if(c().getBool("WEBGL_RENDER_FLOAT32_CAPABLE"))throw Error("The value "+n+" cannot be represented with your current settings. Consider enabling float32 rendering: 'tf.env().set('WEBGL_RENDER_FLOAT32_ENABLED', true);'");throw Error("The value "+n+" cannot be represented on this device.")}}},e.prototype.getValuesFromTexture=function(t){var e,n=this.texData.get(t),r=n.shape,i=n.dtype,o=n.isPacked,s=k(r);if(c().getBool("WEBGL_DOWNLOAD_FLOAT_ENABLED")){var a=this.decode(t),l=this.texData.get(a.dataId),u=(e=this.gpgpu).downloadMatrixFromPackedTexture.apply(e,[l.texture].concat(Xt(r))).subarray(0,s);return this.disposeData(a.dataId),u}var h=c().getBool("WEBGL_PACK")&&!0===o,d=h?Oe(r):r,p=h?new function(t){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!1,this.outTexUsage=$t.DOWNLOAD;var e=xi();this.outputShape=t,this.userCode="\n "+Ci+"\n\n void main() {\n ivec3 coords = getOutputCoords();\n float x = getChannel(getAAtOutCoords(), vec2(coords.y, coords.z));\n "+e.output+" = encode_float(x);\n }\n "}(d):new function(t){this.variableNames=["A"],this.outTexUsage=$t.DOWNLOAD;var e=xi();this.outputShape=t,this.userCode="\n "+Ci+"\n\n void main() {\n float x = getAAtOutCoords();\n "+e.output+" = encode_float(x);\n }\n "}(d),f=this.runWebGLProgram(p,[{shape:d,dtype:i,dataId:t}],"float32"),g=this.texData.get(f.dataId),m=this.gpgpu.downloadByteEncodedFloatMatrixFromOutputTexture(g.texture,g.texShape[0],g.texShape[1]).subarray(0,s);return this.disposeData(f.dataId),m},e.prototype.time=function(t){return a(this,void 0,void 0,function(){var e,n,r,i,o,s,a;return l(this,function(l){switch(l.label){case 0:return e=this.activeTimers,n=[],r=!1,null==this.programTimersStack?(this.programTimersStack=n,r=!0):this.activeTimers.push(n),this.activeTimers=n,t(),i=S(this.activeTimers.map(function(t){return t.query})).filter(function(t){return null!=t}),o=S(this.activeTimers.map(function(t){return t.name})).filter(function(t){return null!=t}),this.activeTimers=e,r&&(this.programTimersStack=null),s={uploadWaitMs:this.uploadWaitMs,downloadWaitMs:this.downloadWaitMs,kernelMs:null,wallMs:null},c().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0?[4,Promise.all(i)]:[3,2];case 1:return a=l.sent(),s.kernelMs=x(a),s.getExtraProfileInfo=function(){return a.map(function(t,e){return{name:o[e],ms:t}}).map(function(t){return t.name+": "+t.ms}).join(", ")},[3,3];case 2:s.kernelMs={error:"WebGL query timers are not supported in this environment."},l.label=3;case 3:return this.uploadWaitMs=0,this.downloadWaitMs=0,[2,s]}})})},e.prototype.memory=function(){return{unreliable:!1,numBytesInGPU:this.numBytesInGPU}},e.prototype.startTimer=function(){return c().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0?this.gpgpu.beginQuery():{startMs:nt(),endMs:null}},e.prototype.endTimer=function(t){return c().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0?(this.gpgpu.endQuery(),t):(t.endMs=nt(),t)},e.prototype.getQueryTime=function(t){return a(this,void 0,void 0,function(){var e;return l(this,function(n){return c().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0?[2,this.gpgpu.waitForQueryAndGetTime(t)]:[2,(e=t).endMs-e.startMs]})})},e.prototype.disposeData=function(t){if(!this.pendingDisposal.has(t)){if(this.pendingRead.has(t))return this.pendingDisposal.add(t),void this.pendingDeletes++;if(this.texData.has(t)){this.releaseGPUData(t);var e=this.texData.get(t).complexTensors;null!=e&&(e.real.dispose(),e.imag.dispose()),this.texData.delete(t)}}},e.prototype.releaseGPUData=function(t){var e=this.texData.get(t),n=e.texture,r=e.dtype,i=e.texShape,o=e.usage,s=e.isPacked,a=e.slice,l=a&&a.origDataId||t,u=this.dataRefCount.get(l);u>1?this.dataRefCount.set(l,u-1):(this.dataRefCount.delete(l),null!=n&&(this.numBytesInGPU-=this.computeBytes(i,r),this.textureManager.releaseTexture(n,i,o,s)));var c=this.texData.get(t);c.texture=null,c.texShape=null,c.isPacked=!1,c.slice=null},e.prototype.getTexture=function(t){return this.uploadToGPU(t),this.texData.get(t).texture},e.prototype.getDataInfo=function(t){return this.texData.get(t)},e.prototype.getCPUBackend=function(){return c().getBool("WEBGL_CPU_FORWARD")?(null==this.cpuBackend&&(this.cpuBackend=Pt.findBackend("cpu")),this.cpuBackend):null},e.prototype.shouldExecuteOnCPU=function(t,e){var n=this;return void 0===e&&(e=128),null!=this.getCPUBackend()&&t.every(function(t){return null==n.texData.get(t.dataId).texture&&t.size<e})},e.prototype.getGPGPUContext=function(){return this.gpgpu},e.prototype.complex=function(t,e){var n=this.makeOutput(t.shape,"complex64");return this.texData.get(n.dataId).complexTensors={real:Pt.keep(t.clone()),imag:Pt.keep(e.clone())},n},e.prototype.real=function(t){return this.texData.get(t.dataId).complexTensors.real.clone()},e.prototype.imag=function(t){return this.texData.get(t.dataId).complexTensors.imag.clone()},e.prototype.slice=function(t,e,n){if(this.shouldExecuteOnCPU([t]))return this.cpuBackend.slice(t,e,n);if(0===k(n))return dn([],n,t.dtype);var r=this.texData.get(t.dataId).isPacked,i=Nr(t.shape,e,n);if(r||!i){var o=c().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new Oo(n):new So(n),s=o.getCustomSetupFunc(e);return this.compileAndRun(o,[t],null,s)}return this.uploadToGPU(t.dataId),this.shallowSlice(t,e,n)},e.prototype.shallowSlice=function(t,e,n){var r=this.texData.get(t.dataId),i=this.makeOutput(n,t.dtype),o=this.texData.get(i.dataId);Object.assign(o,r),o.shape=n,o.dtype=t.dtype;var s=Dr(e,t.strides);r.slice&&(s+=r.slice.flatOffset),o.slice={flatOffset:s,origDataId:r.slice&&r.slice.origDataId||t.dataId};var a=this.dataRefCount.get(o.slice.origDataId)||1;return this.dataRefCount.set(o.slice.origDataId,a+1),i},e.prototype.stridedSlice=function(t,e,n,r){if(this.shouldExecuteOnCPU([t]))return this.cpuBackend.stridedSlice(t,e,n,r);var i=Ir(e,n,r);if(i.some(function(t){return 0===t}))return dn([],i);var o=new function(t,e,n){this.variableNames=["x"],this.outputShape=n;var r=n.length,i=Di(n.length),o=Di(n.length),s="";if(1===r)s="coords * strides + begin";else{var a=0;s=n.map(function(t,e){return a++,1===n.length?"coords * strides["+e+"] + begin["+e+"]":"coords["+(a-1)+"] * strides["+e+"] + begin["+e+"]"}).join(",")}this.userCode="\n "+i+" begin = "+i+"("+t+");\n "+i+" strides = "+i+"("+e+");\n\n void main() {\n "+o+" coords = getOutputCoords();\n setOutput(getX("+s+"));\n }\n "}(e,r,i);return this.compileAndRun(o,[t])},e.prototype.reverse=function(t,e){var n=c().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new function(t,e){this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0;var n=t.length;if(n>4)throw new Error("WebGL backend: Reverse of rank-"+n+" tensor is not yet supported");this.outputShape=t;var r=Ti("rc",n),i=r[n-1]+" + 1 < "+this.outputShape[n-1],o=r[n-2]+" + 1 < "+this.outputShape[n-2],s=Di(n);function a(n){var r=t.map(function(r,i){return function(n,r){return-1!==e.indexOf(n)&&1!==t[n]?t[n]+" - "+r[n]+" - 1":""+r[n]}(i,n)});return"getChannel(getX("+r.join(",")+"), vec2("+r.slice(-2).join(",")+"))"}this.userCode=1===n?"\n void main(){\n int rc = getOutputCoords();\n vec4 result = vec4(0.);\n result.r = getChannel(getX("+t[0]+" - rc - 1),\n "+t[0]+" - rc - 1);\n if("+i+"){\n result.g = getChannel(getX("+t[0]+" - (rc + 1) - 1),\n "+t[0]+" - (rc + 1) - 1);\n }\n setOutput(result);\n }\n ":"\n void main() {\n "+s+" rc = getOutputCoords();\n vec4 result = vec4(0.);\n result.r = "+a(r.slice())+";\n if("+i+"){\n result.g = "+function(t){return t[n-1]="("+t[n-1]+" + 1)",a(t)}(r.slice())+";\n }\n if("+o+") {\n result.b = "+function(t){return t[n-2]="("+t[n-2]+" + 1)",a(t)}(r.slice())+";\n if("+i+") {\n result.a = "+function(t){return t[n-1]="("+t[n-1]+" + 1)",t[n-2]="("+t[n-2]+" + 1)",a(t)}(r.slice())+";\n }\n }\n setOutput(result);\n }\n "}(t.shape,e):new function(t,e){this.variableNames=["x"];var n=t.length;if(n>4)throw new Error("WebGL backend: Reverse of rank-"+n+" tensor is not yet supported");if(this.outputShape=t,1!==n){var r=t.map(function(n,r){return function(n){return-1!==e.indexOf(n)&&1!==t[n]?t[n]+" - coords["+n+"] - 1":"coords["+n+"]"}(r)}).join(","),i=Di(n);this.userCode="\n void main() {\n "+i+" coords = getOutputCoords();\n setOutput(getX("+r+"));\n }\n "}else this.userCode="\n void main() {\n int coord = getOutputCoords();\n setOutput(getX("+t[0]+" - coord - 1));\n }\n "}(t.shape,e);return this.compileAndRun(n,[t])},e.prototype.concat=function(t,e){if("complex64"===t[0].dtype){var n=t.map(function(t){return cn(t)}),r=t.map(function(t){return hn(t)});return un(this.concat(n,e),this.concat(r,e))}if(this.shouldExecuteOnCPU(t))return this.cpuBackend.concat(t,e);if(1===t.length)return t[0];if(t.length>c().getNumber("WEBGL_MAX_TEXTURES_IN_SHADER")){var i=Math.floor(t.length/2),o=this.concat(t.slice(0,i),e),s=this.concat(t.slice(i),e);return this.concat([o,s],e)}if(c().getBool("WEBGL_PACK_ARRAY_OPERATIONS")&&t[0].rank>1){var a=new function(t,e){this.packedInputs=!0,this.packedOutput=!0,this.outputShape=[],this.outputShape=an(t,e);var n=this.outputShape,r=n.length,i=Di(r),o=Ti("coords",r),s=["x","y","z","w","u","v"].slice(0,r);this.variableNames=t.map(function(t,e){return"T"+e});var a=new Array(t.length-1);a[0]=t[0][e];for(var l=1;l<a.length;l++)a[l]=a[l-1]+t[l][e];var u=s[e],c=s.slice(-2),h=s.join(),d="if ("+u+" < "+a[0]+") {\n return getChannel(\n getT0("+h+"), vec2("+c.join()+"));\n }";for(l=1;l<a.length;l++){var p=a[l-1];d+="\n if ("+u+" < "+a[l]+" && "+u+" >= "+a[l-1]+") {\n return getChannel(\n getT"+l+"("+zi(s,u,p)+"),\n vec2("+zi(c,u,p)+"));\n }"}var f=a.length,g=a[a.length-1];d+="\n return getChannel(\n getT"+f+"("+zi(s,u,g)+"),\n vec2("+zi(c,u,g)+"));",this.userCode="\n float getValue("+s.map(function(t){return"int "+t})+") {\n "+d+"\n }\n\n void main() {\n "+i+" coords = getOutputCoords();\n vec4 result = vec4(getValue("+o+"), 0., 0., 0.);\n\n "+o[r-1]+" = "+o[r-1]+" + 1;\n if ("+o[r-1]+" < "+n[r-1]+") {\n result.g = getValue("+o+");\n }\n\n "+o[r-2]+" = "+o[r-2]+" + 1;\n if ("+o[r-2]+" < "+n[r-2]+") {\n result.a = getValue("+o+");\n }\n\n "+o[r-1]+" = "+o[r-1]+" - 1;\n if ("+o[r-2]+" < "+n[r-2]+" &&\n "+o[r-1]+" < "+n[r-1]+") {\n result.b = getValue("+o+");\n }\n setOutput(result);\n }\n "}(t.map(function(t){return t.shape}),e);return this.compileAndRun(a,t)}var l=an(t.map(function(t){return t.shape}),e),u=t.map(function(t){return t.as2D(-1,k(t.shape.slice(e)))}),h=new function(t){this.outputShape=[],this.outputShape=an(t,1),this.variableNames=t.map(function(t,e){return"T"+e});var e=new Array(t.length-1);e[0]=t[0][1];for(var n=1;n<e.length;n++)e[n]=e[n-1]+t[n][1];var r=["if (yC < "+e[0]+") setOutput(getT0(yR, yC));"];for(n=1;n<e.length;n++){var i=e[n-1];r.push("else if (yC < "+e[n]+") setOutput(getT"+n+"(yR, yC-"+i+"));")}var o=e.length,s=e[e.length-1];r.push("else setOutput(getT"+o+"(yR, yC-"+s+"));"),this.userCode="\n void main() {\n ivec2 coords = getOutputCoords();\n int yR = coords.x;\n int yC = coords.y;\n\n "+r.join("\n ")+"\n }\n "}(u.map(function(t){return t.shape}));return this.compileAndRun(h,u).reshape(l)},e.prototype.neg=function(t){if(this.shouldExecuteOnCPU([t]))return this.cpuBackend.neg(t);if(c().getBool("WEBGL_PACK_UNARY_OPERATIONS"))return this.packedUnaryOp(t,Uo,t.dtype);var e=new Mo(t.shape,Uo);return this.compileAndRun(e,[t])},e.prototype.batchMatMul=function(t,e,n,r){var i=n?t.shape[2]:t.shape[1],o=r?e.shape[1]:e.shape[2],s=n?t.shape[1]:t.shape[2],a=t.shape[0];if((1===i||1===o)&&s>1e3){n&&(t=t.transpose([0,2,1])),r&&(e=e.transpose([0,2,1]));var l=1===o?t:t.as3D(a,s,1),u=1===o?2:1,c=1===o?e.as3D(a,1,s):e;return this.multiply(l,c).sum(u,!0)}var h=Ot(t.dtype,e.dtype),d=new To(t.shape,[a,i,o],n,r);return this.compileAndRun(d,[t,e],h)},e.prototype.fusedBatchMatMul=function(t){var e=t.a,n=t.b,r=t.transposeA,i=t.transposeB,o=t.bias,s=t.activation,a=t.preluActivationWeights,l=r?e.shape[2]:e.shape[1],u=i?n.shape[1]:n.shape[2],c=e.shape[0],h=Ot(e.dtype,n.dtype),d=null!=o,p=null!=a,f=s?Qo(s,!0):null,g=new To(e.shape,[c,l,u],r,i,d,f,p),m=[e,n];return o&&m.push(o),a&&m.push(a),this.compileAndRun(g,m,h)},e.prototype.multiply=function(t,e){if("complex64"===t.dtype){var n=this.texData.get(t.dataId),r=this.texData.get(e.dataId),i=new Pi("return areal * breal - aimag * bimag;",t.shape,e.shape),o=new Pi("return areal * bimag + aimag * breal;",t.shape,e.shape),s=[this.makeComplexComponentTensorInfo(t,n.complexTensors.real),this.makeComplexComponentTensorInfo(t,n.complexTensors.imag),this.makeComplexComponentTensorInfo(e,r.complexTensors.real),this.makeComplexComponentTensorInfo(e,r.complexTensors.imag)],a=this.compileAndRun(i,s),l=this.compileAndRun(o,s),u=this.complex(a,l);return a.dispose(),l.dispose(),u}if(this.shouldExecuteOnCPU([t,e]))return this.cpuBackend.multiply(t,e);if(c().getBool("WEBGL_PACK_BINARY_OPERATIONS"))return this.packedBinaryOp(t,e,ji,t.dtype);var h=new Ui(ji,t.shape,e.shape);return this.compileAndRun(h,[t,e],t.dtype)},e.prototype.batchNormalization=function(t,e,n,r,i,o){var s=[t,e,n],a=null;null!=o&&(a=o.shape,s.push(o));var l=null;if(null!=i&&(l=i.shape,s.push(i)),c().getBool("WEBGL_PACK_NORMALIZATION")){var u=new function(t,e,n,r,i,o){this.packedInputs=!0,this.packedOutput=!0,this.variableNames=["x","mean","variance"],Vr(t,e),Vr(t,n);var s="vec4(0.0)";null!=r&&(Vr(t,r),this.variableNames.push("offset"),s="getOffsetAtOutCoords()");var a="vec4(1.0)";null!=i&&(Vr(t,i),this.variableNames.push("scale"),a="getScaleAtOutCoords()"),this.outputShape=t,this.userCode="\n void main() {\n vec4 offset = "+s+";\n vec4 scale = "+a+";\n\n vec4 x = getXAtOutCoords();\n vec4 mean = getMeanAtOutCoords();\n vec4 variance = getVarianceAtOutCoords();\n\n vec4 inv = scale * inversesqrt(variance + vec4("+o+"));\n\n setOutput((x - mean) * inv + offset);\n }\n "}(t.shape,e.shape,n.shape,a,l,r);return this.compileAndRun(u,s)}var h=new function(t,e,n,r,i,o){this.outputShape=[],this.variableNames=["x","mean","variance"],Vr(t,e),Vr(t,n);var s="0.0";null!=r&&(Vr(t,r),this.variableNames.push("offset"),s="getOffsetAtOutCoords()");var a="1.0";null!=i&&(Vr(t,i),this.variableNames.push("scale"),a="getScaleAtOutCoords()"),this.outputShape=t,this.userCode="\n void main() {\n float x = getXAtOutCoords();\n float mean = getMeanAtOutCoords();\n float variance = getVarianceAtOutCoords();\n float offset = "+s+";\n float scale = "+a+";\n float inv = scale * inversesqrt(variance + float("+o+"));\n setOutput(dot(vec3(x, -mean, offset), vec3(inv, inv, 1)));\n }\n "}(t.shape,e.shape,n.shape,a,l,r);return this.compileAndRun(h,s)},e.prototype.localResponseNormalization4D=function(t,e,n,r,i){var o=c().getBool("WEBGL_PACK_NORMALIZATION")?new function(t,e,n,r,i){this.variableNames=["x"],this.outputShape=[],this.packedInputs=!0,this.packedOutput=!0;var o,s=e,a=t[3]-1;this.outputShape=t;var l="float("+n+") + float("+r+") * sum";o=.5===i?"inversesqrt("+l+")":1===i?"1.0/("+l+")":"exp(log("+l+") * float(-"+i+"));",this.userCode="\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords.x;\n int r = coords.y;\n int c = coords.z;\n int d = coords.w;\n\n bool hasNextCol = d < "+this.outputShape[3]+";\n bool hasNextRow = c < "+this.outputShape[2]+";\n\n vec4 sum = vec4(0.);\n vec4 xFragAtOutputCoords = getX(b, r, c, d);\n\n vec4 xAtOutputCoords = vec4(\n getChannel(xFragAtOutputCoords, vec2(c, d)),\n hasNextCol ?\n getChannel(xFragAtOutputCoords, vec2(c, d + 1)) : 0.0,\n hasNextRow ?\n getChannel(xFragAtOutputCoords , vec2(c + 1, d)) : 0.0,\n (hasNextRow && hasNextCol) ?\n getChannel(xFragAtOutputCoords, vec2(c + 1, d + 1)) : 0.0\n );\n\n int firstChannel = d - "+s+";\n vec2 cache = vec2(0.);\n if(firstChannel >= 0){\n vec4 firstChannelFrag = getX(b, r, c, firstChannel);\n cache.x = getChannel(firstChannelFrag, vec2(c, firstChannel));\n if(hasNextRow){\n cache.y = getChannel(firstChannelFrag, vec2(c + 1, firstChannel));\n }\n }\n\n ivec2 depth = ivec2(d, d + 1);\n for (int j = - "+s+"; j <= "+s+"; j++) {\n ivec2 idx = depth + j;\n bvec2 aboveLowerBound = greaterThanEqual(idx, ivec2(0));\n bvec2 belowUpperBound = lessThanEqual(idx, ivec2("+a+"));\n\n bool depthInRange = aboveLowerBound.x && belowUpperBound.x;\n bool depthPlusOneInRange = aboveLowerBound.y && belowUpperBound.y;\n\n if(depthInRange || depthPlusOneInRange){\n vec4 z = vec4(0.);\n vec4 xFragAtCurrentDepth;\n z.xz = cache.xy;\n if(depthPlusOneInRange && hasNextCol){\n xFragAtCurrentDepth = idx.y != d ?\n getX(b, r, c, idx.y) : xFragAtOutputCoords;\n z.y = getChannel(xFragAtCurrentDepth, vec2(c, idx.y));\n if(hasNextRow){\n z.w = getChannel(xFragAtCurrentDepth, vec2(c + 1, idx.y));\n }\n }\n cache.xy = z.yw;\n sum += z * z;\n }\n }\n vec4 result = xAtOutputCoords * "+o+";\n setOutput(result);\n }\n "}(t.shape,e,n,r,i):new function(t,e,n,r,i){this.variableNames=["x"],this.outputShape=[];var o,s=e,a=t[3]-1;this.outputShape=t;var l="float("+n+") + float("+r+") * sum";o=.5===i?"inversesqrt("+l+")":1===i?"1.0/("+l+")":"exp(log("+l+") * float(-"+i+"));",this.userCode="\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int r = coords[1];\n int c = coords[2];\n int d = coords[3];\n float x = getX(b, r, c, d);\n float sum = 0.0;\n for (int j = -"+s+"; j <= "+s+"; j++) {\n int idx = d + j;\n if (idx >= 0 && idx <= "+a+") {\n float z = getX(b, r, c, idx);\n sum += z * z;\n }\n }\n float val = x * "+o+";\n setOutput(val);\n }\n "}(t.shape,e,n,r,i);return this.compileAndRun(o,[t])},e.prototype.LRNGrad=function(t,e,n,r,i,o,s){var a=new function(t,e,n,r,i){this.variableNames=["inputImage","outputImage","dy"],this.outputShape=[],this.outputShape=t,this.depth=t[3],this.depthRadius=e,this.bias=n,this.alpha=r,this.beta=i,this.userCode="\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int r = coords[1];\n int c = coords[2];\n\n float result = 0.0;\n for (int d = 0; d < "+this.depth+"; ++d) {\n int depthBegin = int(max(0.0, float(d - "+e+")));\n int depthEnd = int(min(float("+this.depth+"),\n float(d + "+e+" + 1)));\n\n const int MIN_DEPTH_BEGIN = 0;\n const int MAX_DEPTH_END = "+this.depth+";\n\n float norm = 0.0;\n for (int k = MIN_DEPTH_BEGIN; k < MAX_DEPTH_END; ++k) {\n if (k < depthBegin){\n continue;\n }\n else if (k >= depthBegin && k < depthEnd) {\n norm += getInputImage(b, r, c, k) * getInputImage(b, r, c, k);\n }\n else {\n break;\n }\n }\n\n norm = float("+r+") * norm + float("+n+");\n\n for(int k = MIN_DEPTH_BEGIN; k < MAX_DEPTH_END; ++k){\n if (k < depthBegin){\n continue;\n }\n else if (k >= depthBegin && k < depthEnd){\n float dyi = -2.0 * float("+r+")\n * float("+i+")\n * getInputImage(b ,r ,c, k) * getOutputImage(b, r, c, d)\n / norm;\n if (k == d) {\n dyi += pow(norm, -1.0 * "+i+");\n }\n if (k == coords[3]) {\n dyi *= getDy(b, r, c, d);\n result += dyi;\n }\n }\n else {\n break;\n }\n }\n }\n setOutput(result);\n }\n "}(e.shape,r,i,o,s);return this.compileAndRun(a,[e,n,t])},e.prototype.tile=function(t,e){if("string"===t.dtype){var n=this.readSync(t.dataId).map(function(t){return ot(t)});return vi(Hn(t.shape,t.dtype,n),e)}var r=new function(t,e){this.variableNames=["A"];for(var n=new Array(t.length),r=0;r<n.length;r++)n[r]=t[r]*e[r];this.outputShape=n,this.rank=n.length;var i=Di(this.rank),o=function(t){var e=t.length;if(e>5)throw Error("Tile for rank "+e+" is not yet supported");if(1===e)return"imod(resRC, "+t[0]+")";for(var n=["resRC.x","resRC.y","resRC.z","resRC.w","resRC.u"],r=[],i=0;i<t.length;i++)r.push("imod("+n[i]+", "+t[i]+")");return r.join()}(t);this.userCode="\n void main() {\n "+i+" resRC = getOutputCoords();\n setOutput(getA("+o+"));\n }\n "}(t.shape,e);return this.compileAndRun(r,[t])},e.prototype.pad=function(t,e,n){var r=c().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new function(t,e,n){this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e.map(function(e,n){return e[0]+t[n]+e[1]});for(var r=t.length,i=Di(r),o=e.map(function(t){return t[0]}).join(","),s=e.map(function(e,n){return e[0]+t[n]}).join(","),a=Ti("rc",r),l=Ti("source",r),u=a[r-1]+" < "+this.outputShape[r-1],c=1===r?"source":"vec2("+l.slice(-2).join()+")",h=[i+" rc = outputLoc;",a[r-1]+" += 1;\n if("+u+") {\n ",1===r?"":"}\n rc = outputLoc;\n "+a[r-2]+" += 1;\n if("+a[r-2]+" < "+this.outputShape[r-2]+") {",1===r?"":" "+a[r-1]+" += 1;\n if("+u+") {"],d=1===r?"rc < start || rc >= end":"any(lessThan(rc, start)) || any(greaterThanEqual(rc, end))",p="",f=0,g=1===r?2:4;f<g;f++)p+="\n "+h[f]+"\n if ("+d+") {\n result["+f+"] = float("+n+");\n } else {\n "+i+" source = rc - start;\n result["+f+"] = getChannel(getX("+l.join()+"), "+c+");\n }\n ";p+=1===r?"} ":"}}",this.userCode="\n const "+i+" start = "+i+"("+o+");\n const "+i+" end = "+i+"("+s+");\n\n void main() {\n "+i+" outputLoc = getOutputCoords();\n vec4 result = vec4(0.);\n "+p+"\n setOutput(result);\n }\n "}(t.shape,e,n):new function(t,e,n){this.variableNames=["x"],this.outputShape=e.map(function(e,n){return e[0]+t[n]+e[1]});var r=t.length,i=Di(r),o=e.map(function(t){return t[0]}).join(","),s=e.map(function(e,n){return e[0]+t[n]}).join(","),a=["coords[0]","coords[1]","coords[2]","coords[3]"].slice(0,r);this.userCode=1!==r?"\n "+i+" start = "+i+"("+o+");\n "+i+" end = "+i+"("+s+");\n\n void main() {\n "+i+" outC = getOutputCoords();\n if (any(lessThan(outC, start)) || any(greaterThanEqual(outC, end))) {\n setOutput(float("+n+"));\n } else {\n "+i+" coords = outC - start;\n setOutput(getX("+a+"));\n }\n }\n ":"\n int start = "+o+";\n int end = "+s+";\n\n void main() {\n int outC = getOutputCoords();\n if (outC < start || outC >= end) {\n setOutput(float("+n+"));\n } else {\n setOutput(getX(outC - start));\n }\n }\n "}(t.shape,e,n);return this.compileAndRun(r,[t])},e.prototype.transpose=function(t,e){if(this.shouldExecuteOnCPU([t]))return this.cpuBackend.transpose(t,e);var n=c().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new function(t,e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0;for(var n=new Array(t.length),r=0;r<n.length;r++)n[r]=t[e[r]];if(this.outputShape=n,this.rank=n.length,this.rank>6)throw Error("Packed transpose for rank "+this.rank+" is not yet supported.");var i=Di(this.rank),o=yi("rc",this.rank),s=new Array(this.rank);for(r=0;r<e.length;r++)s[e[r]]=o[r];var a="vec2("+s.slice(-2).join()+")",l="++"+o[this.rank-1]+" < "+n[this.rank-1],u="getChannel(getA("+s.join()+"), "+a+")";this.userCode="\n void main() {\n "+i+" rc = getOutputCoords();\n vec4 result = vec4(0.);\n result[0] = "+u+";\n if("+l+") {\n result[1] = "+u+";\n }\n --"+o[this.rank-1]+";\n if(++"+o[this.rank-2]+" < "+n[this.rank-2]+") {\n result[2] = "+u+";\n if("+l+") {\n result[3] = "+u+";\n }\n }\n setOutput(result);\n }\n "}(t.shape,e):new function(t,e){this.variableNames=["A"];for(var n=new Array(t.length),r=0;r<n.length;r++)n[r]=t[e[r]];this.outputShape=n,this.rank=n.length;var i=Di(this.rank),o=function(t){var e=t.length;if(e>6)throw Error("Transpose for rank "+e+" is not yet supported");for(var n=["resRC.x","resRC.y","resRC.z","resRC.w","resRC.u","resRC.v"],r=new Array(e),i=0;i<t.length;i++)r[t[i]]=n[i];return r.join()}(e);this.userCode="\n void main() {\n "+i+" resRC = getOutputCoords();\n setOutput(getA("+o+"));\n }\n "}(t.shape,e);return this.compileAndRun(n,[t])},e.prototype.gather=function(t,e,n){if(this.shouldExecuteOnCPU([t,e]))return this.cpuBackend.gather(t,e,n);var r=new function(t,e,n){this.variableNames=["A","indices"];var r=t.slice();r[n]=e,this.outputShape=r,this.rank=r.length;var i=Di(this.rank),o=function(t,e){var n=t.length;if(n>4)throw Error("Gather for rank "+n+" is not yet supported");if(1===n)return"int(getIndices(resRC))";for(var r=["resRC.x","resRC.y","resRC.z","resRC.w"],i=[],o=0;o<t.length;o++)o===e?i.push("int(getIndices("+r[o]+"))"):i.push(""+r[o]);return i.join()}(t,n);this.userCode="\n void main() {\n "+i+" resRC = getOutputCoords();\n setOutput(getA("+o+"));\n }\n "}(t.shape,e.size,n);return this.compileAndRun(r,[t,e])},e.prototype.batchToSpaceND=function(t,e,n){E(t.rank<=4,function(){return"batchToSpaceND for rank > 4 with a WebGL backend not implemented yet"});var r=e.reduce(function(t,e){return t*e}),i=mr(t.shape,e,r),o=vr(i.length,e.length),s=br(t.shape,e,r),a=_r(n,e.length),l=yr(s,n,e.length);return t.reshape(i).transpose(o).reshape(s).slice(a,l)},e.prototype.spaceToBatchND=function(t,e,n){E(t.rank<=4,function(){return"spaceToBatchND for rank > 4 with a WebGL backend not implemented yet"});var r=e.reduce(function(t,e){return t*e}),i=[[0,0]];i.push.apply(i,n);for(var o=1+e.length;o<t.shape.length;++o)i.push([0,0]);var s=t.pad(i),a=mr(s.shape,e,r,!1),l=vr(a.length,e.length,!1),u=br(s.shape,e,r,!1);return s.reshape(a).transpose(l).reshape(u)},e.prototype.reduce=function(t,e,n){var r=t.shape[0],i=t.shape[1],o=new function(t,e){this.variableNames=["x"];var n=t.windowSize,r=t.batchSize,i=t.inSize,o=Math.ceil(i/n);this.outputShape=[r,o];var s="0.0",a="";"prod"===e?s="1.0":"min"===e?(s="1.0 / 1e-20",a="min"):"max"===e&&(s="-1.0 / 1e-20",a="max");var l=e+"("+e+"("+e+"(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])";"sum"===e?l="sumValue":"prod"===e?l="prodValue":"all"===e?l="allValue":"any"===e&&(l="anyValue");var u=4*Math.floor(n/4),c=n%4,h="\n if ("+("sum"===e)+") {\n sumValue += dot(values, ones);\n } else if ("+("prod"===e)+") {\n vec2 tmp = vec2(values[0], values[1]) * vec2(values[2], values[3]);\n prodValue *= tmp[0] * tmp[1];\n } else {\n minMaxValue = "+a+"(values, minMaxValue);\n }\n ",d="vec4";"all"===e?(s="1.0",h="\n bool reducedAllValue = all(values);\n float floatedReducedAllValue = float(reducedAllValue);\n allValue = float(allValue >= 1.0 && floatedReducedAllValue >= 1.0);\n ",d="bvec4"):"any"===e&&(s="0.0",h="\n bool reducedAnyValue = any(values);\n float floatedReducedAnyValue = float(reducedAnyValue);\n anyValue = float(anyValue >= 1.0 || floatedReducedAnyValue >= 1.0);\n ",d="bvec4");var p="";i%n>0&&(p="\n if (inIdx < 0 || inIdx >= "+i+") {\n return initializationValue;\n }\n "),this.userCode="\n const float initializationValue = "+s+";\n const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n float getValue(int batch, int inIdx) {\n "+p+"\n return getX(batch, inIdx);\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = outIdx * "+n+";\n\n vec4 minMaxValue = vec4("+s+");\n float prodValue = 1.0;\n float sumValue = 0.0;\n float allValue = 1.0;\n float anyValue = 0.0;\n\n for (int i = 0; i < "+u+"; i += 4) {\n int inIdx = inOffset + i;\n "+d+" values = "+d+"(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n getValue(batch, inIdx + 3)\n );\n\n "+h+"\n }\n\n int inIdx = inOffset + "+u+";\n if ("+(1===c)+") {\n "+d+" values = "+d+"(\n getValue(batch, inIdx),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n "+h+"\n } else if ("+(2===c)+") {\n "+d+" values = "+d+"(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n initializationValue,\n initializationValue\n );\n\n "+h+"\n } else if ("+(3===c)+") {\n "+d+" values = "+d+"(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n initializationValue\n );\n\n "+h+"\n }\n setOutput("+l+");\n }\n "}({windowSize:Er(i),inSize:i,batchSize:r},e),s=this.compileAndRun(o,[t],n);return 1===s.shape[1]?s:this.reduce(s,e,n)},e.prototype.argReduce=function(t,e,n){void 0===n&&(n=null);var r=t.shape[0],i=t.shape[1];null!=n&&(r=n.shape[0],i=n.shape[1]);var o=new function(t,e,n){this.variableNames=["A"];var r=t.windowSize,i=t.batchSize,o=t.inSize,s=Math.ceil(o/r);n||this.variableNames.push("bestIndicesA"),this.outputShape=[i,s];var a="max"===e?">":"<",l=n?"inOffset + i;":"round(getBestIndicesA(batch, inOffset + i));";this.userCode="\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = outIdx * "+r+";\n\n int bestIndex = inOffset;\n float bestValue = getA(batch, bestIndex);\n\n for (int i = 0; i < "+r+"; i++) {\n int inIdx = "+l+";\n float candidate = getA(batch, inIdx);\n if (candidate "+a+" bestValue) {\n bestValue = candidate;\n bestIndex = inIdx;\n }\n }\n setOutput(float(bestIndex));\n }\n "}({windowSize:Er(i),inSize:i,batchSize:r},e,null==n),s=[t];null!=n&&s.push(n);var a=this.compileAndRun(o,s,"int32");return 1===a.shape[1]?a:this.argReduce(t,e,a)},e.prototype.argReducePacked=function(t,e,n){void 0===n&&(n=null);var r=null!=n?n.shape:t.shape,i=new function(t,e,n,r){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,E(t.length>2,function(){return"Packed arg"+(n.charAt(0).toUpperCase()+n.slice(1))+" supports only inputs with rank above 2."});var i=t[t.length-1],o=Math.ceil(i/e);this.outputShape=t.slice(0,-1),o>1&&this.outputShape.push(o),r||this.variableNames.push("bestIndicesA");var s,a,l=this.outputShape,u=l.length,c=Di(u),h=Ti("coords",u);if(1===o){var d=Di(a=u+1);s="\n "+d+" sourceLocR = "+d+"("+h.join()+", 0);\n ++"+h[u-1]+";\n "+d+" sourceLocG = "+d+"("+h.join()+", 0);\n ++"+h[u-2]+";\n "+d+" sourceLocA = "+d+"("+h.join()+", 0);\n --"+h[u-1]+";\n "+d+" sourceLocB = "+d+"("+h.join()+", 0);\n --"+h[u-2]+";"}else a=u,s="\n "+c+" sourceLocR = coords;\n ++"+h[u-1]+";\n "+c+" sourceLocG = coords;\n ++"+h[u-2]+";\n "+c+" sourceLocA = coords;\n --"+h[u-1]+";\n "+c+" sourceLocB = coords;\n --"+h[u-2]+";";var p=["x","y","z","w","u","v"].slice(0,a),f="."+p[a-1],g=p.map(function(t){return"int "+t}),m=Ti("sourceLocR",a-1).concat("inIdx.r"),v=Ti("sourceLocG",a-1).concat("inIdx.g"),b=Ti("sourceLocB",a-1).concat("inIdx.b"),_=Ti("sourceLocA",a-1).concat("inIdx.a"),y="max"===n?"greaterThan":"lessThan",T=r?"":"\n inIdx = round(vec4(getBestIndicesAChannel("+m.join()+"),\n getBestIndicesAChannel("+v.join()+"),\n getBestIndicesAChannel("+b.join()+"),\n getBestIndicesAChannel("+_.join()+")));",x="vec4(\n getAChannel("+m.join()+"),\n hasNextCol ? getAChannel("+v.join()+") : 0.,\n hasNextRow ? getAChannel("+b.join()+") : 0.,\n hasNextRow && hasNextCol ? getAChannel("+_.join()+") : 0.)",w=r?"":"\n float getBestIndicesAChannel("+g.join()+") {\n return getChannel(getBestIndicesA("+p.join()+"),\n vec2("+p.slice(-2).join()+"));\n }";this.userCode="\n float getAChannel("+g.join()+") {\n return getChannel(getA("+p.join()+"),\n vec2("+p.slice(-2).join()+"));\n }\n "+w+"\n void main() {\n "+c+" coords = getOutputCoords();\n bool hasNextCol = "+h[u-1]+" < "+(l[u-1]-1)+";\n bool hasNextRow = "+h[u-2]+" < "+(l[u-2]-1)+";\n "+s+"\n ivec4 srcIdx = ivec4(sourceLocR"+f+", sourceLocG"+f+",\n sourceLocB"+f+", sourceLocA"+f+") * "+e+";\n ivec4 inIdx = srcIdx;\n vec4 bestIndex = vec4(inIdx);\n vec4 bestValue = "+x+";\n\n for (int i = 0; i < "+e+"; i++) {\n inIdx = srcIdx;\n "+T+"\n vec4 candidate = "+x+";\n bvec4 nan = isnan(candidate);\n bvec4 replace = bvec4(\n vec4("+y+"(candidate, bestValue)) * (vec4(1.0) - vec4(nan)));\n\n bestValue = vec4(replace.x ? candidate.x : bestValue.x,\n replace.y ? candidate.y : bestValue.y,\n replace.z ? candidate.z : bestValue.z,\n replace.w ? candidate.w : bestValue.w);\n bestIndex = mix(bestIndex, vec4(inIdx), vec4(replace));\n srcIdx++;\n }\n setOutput(bestIndex);\n }\n "}(r,Er(r[r.length-1]),e,null==n),o=null==n?[t]:[t,n],s=this.compileAndRun(i,o,"int32");return s.rank===t.rank?this.argReducePacked(t,e,s):s},e.prototype.sum=function(t,e){en("sum",e,t.rank);var n=Qe(t.shape,e),r=n[0],i=k(n[1]),o=t.as2D(-1,i),s=It(t.dtype);return this.reduce(o,"sum",s).reshape(r)},e.prototype.prod=function(t,e){if(this.shouldExecuteOnCPU([t]))return this.cpuBackend.prod(t,e);var n=Qe(t.shape,e),r=n[0],i=k(n[1]),o=t.as2D(-1,i),s=It(t.dtype);return this.reduce(o,"prod",s).reshape(r)},e.prototype.unsortedSegmentSum=function(t,e,n){var r=0,i=nn([r],t.rank),o=t;null!=i&&(o=t.transpose(i),r=on(1,t.rank)[0]);var s=function(t,e,n){for(var r=[],i=t.length,o=0;o<i;o++)o!==e?r.push(t[o]):r.push(n);return r}(o.shape,r,n),a=k([o.shape[r]]),l=o.as2D(-1,a),u=It(t.dtype),c=this.segOpCompute(l,"unsortedSegmentSum",e,u,n).reshape(s);return null!=i&&(c=c.transpose(rn(i))),c},e.prototype.segOpCompute=function(t,e,n,r,i){var o=t.shape[0],s=t.shape[1],a=function(t,e){var n,r=!1;for(t<=xr?(n=t,r=!0):n=q(t,Math.floor(Math.sqrt(t)));!r;)n>e||n===t?r=!0:n=q(t,n+1);return n}(s,i),l=new function(t,e){this.variableNames=["x","segmentIds"];var n=t.windowSize,r=t.batchSize,i=t.inSize,o=t.numSegments,s=o*Math.ceil(i/n);this.outputShape=[r,s];var a=4*Math.floor(n/4),l=n%4,u="\n sumValue += dot(values, segFilter);\n ",c="";i%n>0&&(c="\n if (inIdx < 0 || inIdx >= "+i+") {\n return initializationValue;\n }\n ");var h="";i%n>0&&(h="\n if (inIdx < 0 || inIdx >= "+i+") {\n return -1.0;\n }\n "),this.userCode="\n const float initializationValue = 0.0;\n\n float getValue(int batch, int inIdx) {\n "+c+"\n return getX(batch, inIdx);\n }\n\n float getSegmentIdAtIndex(int inIdx) {\n "+h+"\n return getSegmentIds(inIdx);\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = int(floor(float(outIdx) / float(\n "+o+")) * float("+n+"));\n int currentSeg = int(mod(float(outIdx), float("+o+")));\n\n float sumValue = 0.0;\n\n for (int i = 0; i < "+a+"; i += 4) {\n int inIdx = inOffset + i;\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n getValue(batch, inIdx + 3)\n );\n\n vec4 segFilter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 2)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 3)) == currentSeg ? 1 : 0\n );\n\n "+u+"\n }\n\n int inIdx = inOffset + "+a+";\n if ("+(1===l)+") {\n vec4 values = vec4(\n getValue(batch, inIdx),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n int inIdxSeg = int(getSegmentIdAtIndex(inIdx));\n\n vec4 segFilter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n 0,\n 0,\n 0\n );\n\n "+u+"\n } else if ("+(2===l)+") {\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n initializationValue,\n initializationValue\n );\n\n vec4 segFilter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\n 0,\n 0\n );\n\n "+u+"\n } else if ("+(3===l)+") {\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n initializationValue\n );\n\n vec4 segFilter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 2)) == currentSeg ? 1 : 0,\n 0\n );\n\n "+u+"\n }\n setOutput(sumValue);\n }\n "}({windowSize:a,inSize:s,batchSize:o,numSegments:i},e),u=this.compileAndRun(l,[t,n],r);return u.shape[1]===i?u:(n=xn(0,i).tile([s/a]),this.segOpCompute(u,e,n,r,i))},e.prototype.argMinMaxReduce=function(t,e,n){var r=[e];if(en("arg"+n.charAt(0).toUpperCase()+n.slice(1),r,t.rank),!c().getBool("WEBGL_PACK_REDUCE")||t.rank<=2){var i=Qe(t.shape,r),o=i[0],s=k(i[1]),a=t.as2D(-1,s);return this.argReduce(a,n).reshape(o)}return this.argReducePacked(t,n)},e.prototype.argMin=function(t,e){return this.argMinMaxReduce(t,e,"min")},e.prototype.argMax=function(t,e){return this.argMinMaxReduce(t,e,"max")},e.prototype.cumsum=function(t,e,n,r){if(e!==t.rank-1)throw new Error("WebGL cumsum shader expects an inner-most axis="+(t.rank-1)+" but got axis="+e);var i=new function(t,e,n){this.variableNames=["x"],this.outputShape=t;var r=t.length,i=t[t.length-1],o=n?"<":">";this.userCode="\n int getIndex(int i) {\n "+(n?"return "+i+" -i - 1;":"return i;")+"\n }\n\n void main() {\n "+Di(r)+" coords = getOutputCoords();\n int end = "+qi(r,"coords")+";\n float val = 0.0;\n for (int i = "+i+" - 1; i >= 0; i -= 1) {\n int idx = getIndex(i);\n if (idx "+o+" end) {\n continue;\n }\n if (idx == end && "+e+") {\n continue;\n }\n "+qi(r,"coords")+" = idx;\n val += getX("+function(t,e){if(1===t)return""+e;if(2===t)return e+".x, "+e+".y";if(3===t)return e+".x, "+e+".y, "+e+".z";if(4===t)return e+".x, "+e+".y, "+e+".z, "+e+".w";throw Error("Cumulative sum for rank "+t+" is not yet supported")}(r,"coords")+");\n }\n setOutput(val);\n }\n "}(t.shape,n,r);return this.compileAndRun(i,[t])},e.prototype.equal=function(t,e){if(c().getBool("WEBGL_PACK_BINARY_OPERATIONS"))return this.packedBinaryOp(t,e,"\n return vec4(equal(a, b));\n","bool");var n=new Ui("return float(a == b);",t.shape,e.shape);return this.compileAndRun(n,[t,e],"bool")},e.prototype.notEqual=function(t,e){if(c().getBool("WEBGL_PACK_BINARY_OPERATIONS"))return this.packedBinaryOp(t,e,"\n return vec4(notEqual(a, b));\n","bool");var n=new Ui("return float(a != b);",t.shape,e.shape);return this.compileAndRun(n,[t,e],"bool")},e.prototype.less=function(t,e){if(this.shouldExecuteOnCPU([t,e]))return this.cpuBackend.less(t,e);if(c().getBool("WEBGL_PACK_BINARY_OPERATIONS"))return this.packedBinaryOp(t,e,"\n return vec4(lessThan(a, b));\n","bool");var n=new Ui("return float(a < b);",t.shape,e.shape);return this.compileAndRun(n,[t,e],"bool")},e.prototype.lessEqual=function(t,e){if(c().getBool("WEBGL_PACK_BINARY_OPERATIONS"))return this.packedBinaryOp(t,e,"\n return vec4(lessThanEqual(a, b));\n","bool");var n=new Ui("return float(a <= b);",t.shape,e.shape);return this.compileAndRun(n,[t,e],"bool")},e.prototype.greater=function(t,e){if(this.shouldExecuteOnCPU([t,e]))return this.cpuBackend.greater(t,e);if(c().getBool("WEBGL_PACK_BINARY_OPERATIONS"))return this.packedBinaryOp(t,e,"\n return vec4(greaterThan(a, b));\n","bool");var n=new Ui("return float(a > b);",t.shape,e.shape);return this.compileAndRun(n,[t,e],"bool")},e.prototype.greaterEqual=function(t,e){if(c().getBool("WEBGL_PACK_BINARY_OPERATIONS"))return this.packedBinaryOp(t,e,"\n return vec4(greaterThanEqual(a, b));\n","bool");var n=new Ui("return float(a >= b);",t.shape,e.shape);return this.compileAndRun(n,[t,e],"bool")},e.prototype.logicalNot=function(t){var e=new Mo(t.shape,"return float(!(x >= 1.0));");return this.compileAndRun(e,[t])},e.prototype.logicalAnd=function(t,e){if(c().getBool("WEBGL_PACK_BINARY_OPERATIONS"))return this.packedBinaryOp(t,e,"\n return vec4(\n vec4(greaterThanEqual(a, vec4(1.0))) *\n vec4(greaterThanEqual(b, vec4(1.0))));\n","bool");var n=new Ui("return float(a >= 1.0 && b >= 1.0);",t.shape,e.shape);return this.compileAndRun(n,[t,e],"bool")},e.prototype.logicalOr=function(t,e){if(c().getBool("WEBGL_PACK_BINARY_OPERATIONS"))return this.packedBinaryOp(t,e,"\n return min(\n vec4(greaterThanEqual(a, vec4(1.0))) +\n vec4(greaterThanEqual(b, vec4(1.0))),\n vec4(1.0));\n","bool");var n=new Ui("return float(a >= 1.0 || b >= 1.0);",t.shape,e.shape);return this.compileAndRun(n,[t,e],"bool")},e.prototype.select=function(t,e,n){var r=new function(t,e,n){var r,i;if(this.variableNames=["c","a","b"],this.outputShape=e,n>4)throw Error("Where for rank "+n+" is not yet supported");if(1===n)i="resRC",r="resRC";else{for(var o=["resRC.x","resRC.y","resRC.z","resRC.w"],s=[],a=[],l=0;l<e.length;l++)a.push(""+o[l]),l<t&&s.push(""+o[l]);r=s.join(),i=a.join()}var u=Di(n);this.userCode="\n void main() {\n "+u+" resRC = getOutputCoords();\n float cVal = getC("+r+");\n if (cVal >= 1.0) {\n setOutput(getA("+i+"));\n } else {\n setOutput(getB("+i+"));\n }\n }\n "}(t.rank,e.shape,e.rank);return this.compileAndRun(r,[t,e,n],Ot(e.dtype,n.dtype))},e.prototype.where=function(t){ze("tf.where() in webgl locks the UI thread. Call tf.whereAsync() instead");var e=t.dataSync();return _i(t.shape,e)},e.prototype.topk=function(t,e,n){return bi(t.dataSync(),t.shape,t.dtype,e)},e.prototype.min=function(t,e){en("min",e,t.rank);var n=Qe(t.shape,e),r=n[0],i=k(n[1]),o=t.as2D(-1,i);return this.reduce(o,"min",o.dtype).reshape(r)},e.prototype.minimum=function(t,e){if(this.shouldExecuteOnCPU([t,e]))return this.cpuBackend.minimum(t,e);var n=c().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new Hi("\n vec4 result = vec4(min(a, b));\n vec4 isNaN = min(vec4(isnan(a)) + vec4(isnan(b)), vec4(1.0));\n \n result.r = isNaN.r > 0. ? NAN : result.r;\n result.g = isNaN.g > 0. ? NAN : result.g;\n result.b = isNaN.b > 0. ? NAN : result.b;\n result.a = isNaN.a > 0. ? NAN : result.a;\n\n return result;\n",t.shape,e.shape):new Ui("\n if (isnan(a)) return a;\n if (isnan(b)) return b;\n\n return min(a, b);\n",t.shape,e.shape);return this.compileAndRun(n,[t,e])},e.prototype.mod=function(t,e){var n=c().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new Hi("\n vec4 result = mod(a, b);\n vec4 isNaN = vec4(equal(b, vec4(0.0)));\n \n result.r = isNaN.r > 0. ? NAN : result.r;\n result.g = isNaN.g > 0. ? NAN : result.g;\n result.b = isNaN.b > 0. ? NAN : result.b;\n result.a = isNaN.a > 0. ? NAN : result.a;\n\n return result;\n",t.shape,e.shape):new Ui("if (b == 0.0) return NAN;\n return mod(a, b);",t.shape,e.shape);return this.compileAndRun(n,[t,e])},e.prototype.max=function(t,e){if(this.shouldExecuteOnCPU([t]))return this.cpuBackend.max(t,e);en("max",e,t.rank);var n=Qe(t.shape,e),r=n[0],i=k(n[1]),o=t.as2D(-1,i);return this.reduce(o,"max",o.dtype).reshape(r)},e.prototype.maximum=function(t,e){if(this.shouldExecuteOnCPU([t,e]))return this.cpuBackend.maximum(t,e);var n=c().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new Hi("\n vec4 result = vec4(max(a, b));\n vec4 isNaN = min(vec4(isnan(a)) + vec4(isnan(b)), vec4(1.0));\n \n result.r = isNaN.r > 0. ? NAN : result.r;\n result.g = isNaN.g > 0. ? NAN : result.g;\n result.b = isNaN.b > 0. ? NAN : result.b;\n result.a = isNaN.a > 0. ? NAN : result.a;\n\n return result;\n",t.shape,e.shape):new Ui("\n if (isnan(a)) return a;\n if (isnan(b)) return b;\n\n return max(a, b);\n",t.shape,e.shape);return this.compileAndRun(n,[t,e])},e.prototype.all=function(t,e){en("all",e,t.rank);var n=Qe(t.shape,e),r=n[0],i=k(n[1]),o=t.as2D(-1,i);return this.reduce(o,"all",o.dtype).reshape(r)},e.prototype.any=function(t,e){en("any",e,t.rank);var n=Qe(t.shape,e),r=n[0],i=k(n[1]),o=t.as2D(-1,i);return this.reduce(o,"any",o.dtype).reshape(r)},e.prototype.realDivide=function(t,e){if(c().getBool("WEBGL_PACK_BINARY_OPERATIONS"))return this.packedBinaryOp(t,e,"\n // vec4 one = vec4(equal(a, b));\n // return one + (vec4(1.0) - one) * a / b;\n vec4 result = a / b;\n if(a.x == b.x) {\n result.x = 1.;\n }\n if(a.y == b.y) {\n result.y = 1.;\n }\n if(a.z == b.z) {\n result.z = 1.;\n }\n if(a.w == b.w) {\n result.w = 1.;\n }\n\n return result;\n","float32",!0);var n=new Ui("\nif (a == b) {\n return 1.0;\n};\nreturn a / b;",t.shape,e.shape);return this.compileAndRun(n,[t,e],"float32")},e.prototype.floorDiv=function(t,e){if(c().getBool("WEBGL_PACK_BINARY_OPERATIONS"))return this.packedBinaryOp(t,e,"\n ivec4 ia = round(a);\n ivec4 ib = round(b);\n bvec4 cond = notEqual(ib, ivec4(0));\n ivec4 result = ivec4(0);\n vec4 s = sign(a) * sign(b);\n\n // Windows (D3D) wants guaranteed non-zero int division at compile-time.\n if (cond[0]) {\n result[0] = idiv(ia[0], ib[0], s[0]);\n }\n if (cond[1]) {\n result[1] = idiv(ia[1], ib[1], s[1]);\n }\n if (cond[2]) {\n result[2] = idiv(ia[2], ib[2], s[2]);\n }\n if (cond[3]) {\n result[3] = idiv(ia[3], ib[3], s[3]);\n }\n return vec4(result);\n","int32");var n=new Ui("\n float s = sign(a) * sign(b);\n int ia = round(a);\n int ib = round(b);\n if (ib != 0) {\n // Windows (D3D) wants guaranteed non-zero int division at compile-time.\n return float(idiv(ia, ib, s));\n } else {\n return NAN;\n }\n",t.shape,e.shape);return this.compileAndRun(n,[t,e],"int32")},e.prototype.add=function(t,e){if("complex64"===t.dtype&&"complex64"===e.dtype)return this.complexSeparableBinaryOp(t,e,Fi);if(this.shouldExecuteOnCPU([t,e]))return this.cpuBackend.add(t,e);var n=Ot(t.dtype,e.dtype);if(c().getBool("WEBGL_PACK_BINARY_OPERATIONS"))return this.packedBinaryOp(t,e,Fi,n);var r=new Ui(Fi,t.shape,e.shape);return this.compileAndRun(r,[t,e],n)},e.prototype.packedUnaryOp=function(t,e,n){var r=new Jo(t.shape,e);return this.compileAndRun(r,[t],n)},e.prototype.packedBinaryOp=function(t,e,n,r,i){void 0===i&&(i=!1);var o=new Hi(n,t.shape,e.shape,i);return this.compileAndRun(o,[t,e],r)},e.prototype.complexSeparableBinaryOp=function(t,e,n){var r=this,i=this.texData.get(t.dataId),o=this.texData.get(e.dataId),s=[[i.complexTensors.real,o.complexTensors.real],[i.complexTensors.imag,o.complexTensors.imag]].map(function(i){var o=i[0],s=i[1],a=r.makeComplexComponentTensorInfo(t,o),l=r.makeComplexComponentTensorInfo(e,s),u=new Ui(n,t.shape,e.shape);return r.compileAndRun(u,[a,l],Ot(o.dtype,s.dtype))}),a=s[0],l=s[1],u=this.complex(a,l);return a.dispose(),l.dispose(),u},e.prototype.makeComplexComponentTensorInfo=function(t,e){return{dataId:e.dataId,dtype:e.dtype,shape:t.shape}},e.prototype.addN=function(t){if(1===t.length)return t[0];if(t.length>c().get("WEBGL_MAX_TEXTURES_IN_SHADER")){var e=Math.floor(t.length/2),n=this.addN(t.slice(0,e)),r=this.addN(t.slice(e));return this.addN([n,r])}var i=t.map(function(t){return t.dtype}).reduce(function(t,e){return Ot(t,e)}),o=t.map(function(t){return t.shape}),s=c().getBool("WEBGL_PACK")?new function(t,e){this.outputShape=[],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=t,this.variableNames=e.map(function(t,e){return"T"+e});var n=[];this.variableNames.forEach(function(t){n.push("vec4 v"+t+" = get"+t+"AtOutCoords();")});var r=this.variableNames.map(function(t){return"v"+t}).join(" + ");this.userCode="\n void main() {\n "+n.join("\n ")+"\n\n vec4 result = "+r+";\n setOutput(result);\n }\n "}(t[0].shape,o):new function(t,e){this.outputShape=[],this.outputShape=t,this.variableNames=e.map(function(t,e){return"T"+e});var n=[];this.variableNames.forEach(function(t){n.push("float v"+t+" = get"+t+"AtOutCoords();")});var r=this.variableNames.map(function(t){return"v"+t}).join(" + ");this.userCode="\n void main() {\n "+n.join("\n ")+"\n\n float result = "+r+";\n setOutput(result);\n }\n "}(t[0].shape,o);return this.compileAndRun(s,t,i)},e.prototype.subtract=function(t,e){if("complex64"===t.dtype&&"complex64"===e.dtype)return this.complexSeparableBinaryOp(t,e,Bi);if(this.shouldExecuteOnCPU([t,e]))return this.cpuBackend.subtract(t,e);var n=Ot(t.dtype,e.dtype);if(c().getBool("WEBGL_PACK_BINARY_OPERATIONS"))return this.packedBinaryOp(t,e,Bi,t.dtype);var r=new Ui(Bi,t.shape,e.shape);return this.compileAndRun(r,[t,e],n)},e.prototype.pow=function(t,e){var n=c().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new Hi("\n // isModRound1 has 1 for components with round(mod(b, 2.0)) == 1, 0 otherwise.\n vec4 isModRound1 = vec4(equal(round(mod(b, 2.0)), ivec4(1)));\n vec4 multiplier = sign(a) * isModRound1 + (vec4(1.0) - isModRound1);\n vec4 result = multiplier * pow(abs(a), b);\n\n // Ensure that a^0 = 1, including 0^0 = 1 as this correspond to TF and JS\n bvec4 isExpZero = equal(b, vec4(0.0));\n result.r = isExpZero.r ? 1.0 : result.r;\n result.g = isExpZero.g ? 1.0 : result.g;\n result.b = isExpZero.b ? 1.0 : result.b;\n result.a = isExpZero.a ? 1.0 : result.a;\n\n vec4 isNaN = vec4(lessThan(a, vec4(0.0))) * vec4(lessThan(floor(b), b));\n \n result.r = isNaN.r > 0. ? NAN : result.r;\n result.g = isNaN.g > 0. ? NAN : result.g;\n result.b = isNaN.b > 0. ? NAN : result.b;\n result.a = isNaN.a > 0. ? NAN : result.a;\n\n return result;\n",t.shape,e.shape):new Ui("\nif(a < 0.0 && floor(b) < b){\n return NAN;\n}\nif (b == 0.0) {\n return 1.0;\n}\nreturn (round(mod(b, 2.0)) != 1) ?\n pow(abs(a), b) : sign(a) * pow(abs(a), b);\n",t.shape,e.shape),r=Ot(t.dtype,e.dtype);return this.compileAndRun(n,[t,e],r)},e.prototype.ceil=function(t){if(this.shouldExecuteOnCPU([t]))return this.cpuBackend.ceil(t);if(c().getBool("WEBGL_PACK_UNARY_OPERATIONS"))return this.packedUnaryOp(t,Vo,t.dtype);var e=new Mo(t.shape,Vo);return this.compileAndRun(e,[t])},e.prototype.floor=function(t){if(this.shouldExecuteOnCPU([t]))return this.cpuBackend.floor(t);if(c().getBool("WEBGL_PACK_UNARY_OPERATIONS"))return this.packedUnaryOp(t,Ho,t.dtype);var e=new Mo(t.shape,Ho);return this.compileAndRun(e,[t])},e.prototype.sign=function(t){var e=new Mo(t.shape,"\n if (isnan(x)) { return 0.0; }\n return sign(x);\n");return this.compileAndRun(e,[t])},e.prototype.isNaN=function(t){var e=new Mo(t.shape,"return float(isnan(x));");return this.compileAndRun(e,[t],"bool")},e.prototype.isInf=function(t){var e=new Mo(t.shape,"return float(isinf(x));");return this.compileAndRun(e,[t],"bool")},e.prototype.isFinite=function(t){var e=new Mo(t.shape,"return float(!isnan(x) && !isinf(x));");return this.compileAndRun(e,[t],"bool")},e.prototype.round=function(t){var e=new Mo(t.shape,"\n // OpenGL ES does not support round function.\n // The algorithm is based on banker's rounding.\n float base = floor(x);\n if ((x - base) < 0.5) {\n return floor(x);\n } else if ((x - base) > 0.5) {\n return ceil(x);\n } else {\n if (mod(base, 2.0) == 0.0) {\n return base;\n } else {\n return base + 1.0;\n }\n }\n");return this.compileAndRun(e,[t])},e.prototype.exp=function(t){if(this.shouldExecuteOnCPU([t]))return this.cpuBackend.exp(t);if(c().getBool("WEBGL_PACK_UNARY_OPERATIONS"))return this.packedUnaryOp(t,Wo,t.dtype);var e=new Mo(t.shape,Wo);return this.compileAndRun(e,[t])},e.prototype.expm1=function(t){if(this.shouldExecuteOnCPU([t]))return this.cpuBackend.expm1(t);if(c().getBool("WEBGL_PACK_UNARY_OPERATIONS"))return this.packedUnaryOp(t,Go,t.dtype);var e=new Mo(t.shape,Go);return this.compileAndRun(e,[t])},e.prototype.softmax=function(t,e){var n=L([e],t.shape),r=this.max(t,n),i=tn(r.shape,n),o=this.subtract(t,r.reshape(i)),s=this.exp(o),a=this.sum(s,n).reshape(i);return this.realDivide(s,a)},e.prototype.log=function(t){if(this.shouldExecuteOnCPU([t]))return this.cpuBackend.log(t);if(c().getBool("WEBGL_PACK_UNARY_OPERATIONS"))return this.packedUnaryOp(t,"\n vec4 result = log(x);\n vec4 isNaN = vec4(lessThan(x, vec4(0.0)));\n result.r = isNaN.r == 1.0 ? NAN : result.r;\n result.g = isNaN.g == 1.0 ? NAN : result.g;\n result.b = isNaN.b == 1.0 ? NAN : result.b;\n result.a = isNaN.a == 1.0 ? NAN : result.a;\n\n return result;\n",t.dtype);var e=new Mo(t.shape,"if (x < 0.0) return NAN;\n return log(x);");return this.compileAndRun(e,[t])},e.prototype.log1p=function(t){var e=new Mo(t.shape,"return log(1.0 + x);");return this.compileAndRun(e,[t])},e.prototype.sqrt=function(t){var e=new Mo(t.shape,"return sqrt(x);");return this.compileAndRun(e,[t])},e.prototype.rsqrt=function(t){if(this.shouldExecuteOnCPU([t]))return this.cpuBackend.rsqrt(t);var e=new Mo(t.shape,"return inversesqrt(x);");return this.compileAndRun(e,[t])},e.prototype.reciprocal=function(t){var e=new Mo(t.shape,"return 1.0 / x;");return this.compileAndRun(e,[t])},e.prototype.relu=function(t){var e;return e=c().getBool("WEBGL_PACK")?new Jo(t.shape,Ko):new Mo(t.shape,Bo),this.compileAndRun(e,[t])},e.prototype.relu6=function(t){var e;return e=c().getBool("WEBGL_PACK")?new Jo(t.shape,Yo):new Mo(t.shape,jo),this.compileAndRun(e,[t])},e.prototype.prelu=function(t,e){var n=c().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new Hi(Vi,t.shape,e.shape):new Ui($i,t.shape,e.shape);return this.compileAndRun(n,[t,e])},e.prototype.elu=function(t){if(c().getBool("WEBGL_PACK_UNARY_OPERATIONS"))return this.packedUnaryOp(t,qo,t.dtype);var e=new Mo(t.shape,$o);return this.compileAndRun(e,[t])},e.prototype.eluDer=function(t,e){var n=c().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new Hi("\n vec4 bGTEZero = vec4(greaterThanEqual(b, vec4(0.)));\n return (bGTEZero * a) + ((vec4(1.0) - bGTEZero) * (a * (b + vec4(1.0))));\n",t.shape,e.shape):new Ui("return (b >= 1.0) ? a : a * (b + 1.0);",t.shape,e.shape);return this.compileAndRun(n,[t,e])},e.prototype.selu=function(t){var e=new Mo(t.shape,"\n // Stable and Attracting Fixed Point (0, 1) for Normalized Weights.\n // see: https://arxiv.org/abs/1706.02515\n float scaleAlpha = 1.7580993408473768;\n float scale = 1.0507009873554805;\n return (x >= 0.0) ? scale * x : scaleAlpha * (exp(x) - 1.0);\n");return this.compileAndRun(e,[t])},e.prototype.int=function(t){var e=new Mo(t.shape,"return float(int(x));");return this.compileAndRun(e,[t],"int32")},e.prototype.clip=function(t,e,n){var r,i=(r=c().getBool("WEBGL_PACK_CLIP")?new Gi(t.shape):new Wi(t.shape)).getCustomSetupFunc(e,n);return this.compileAndRun(r,[t],null,i)},e.prototype.abs=function(t){if(this.shouldExecuteOnCPU([t]))return this.cpuBackend.abs(t);if(c().getBool("WEBGL_PACK_UNARY_OPERATIONS"))return this.packedUnaryOp(t,Fo,t.dtype);var e=new Mo(t.shape,Fo);return this.compileAndRun(e,[t])},e.prototype.complexAbs=function(t){var e=this.texData.get(t.dataId),n=new function(t){this.variableNames=["real","imag"],this.outputShape=t,this.userCode="\n void main() {\n float re = abs(getRealAtOutCoords());\n float im = abs(getImagAtOutCoords());\n float mx = max(re, im);\n\n // sadly the length function in glsl is not underflow-safe\n // (at least not on Intel GPUs). So the safe solution is\n // to ensure underflow-safety in all cases.\n setOutput(\n mx == 0.0 ? 0.0 : mx * length(vec2(1, min(re, im)/mx))\n );\n }\n "}(t.shape),r=[this.makeComplexComponentTensorInfo(t,e.complexTensors.real),this.makeComplexComponentTensorInfo(t,e.complexTensors.imag)];return this.compileAndRun(n,r)},e.prototype.sigmoid=function(t){var e=new Mo(t.shape,"return 1.0 / (1.0 + exp(-1.0 * x));");return this.compileAndRun(e,[t])},e.prototype.softplus=function(t){var e=new Mo(t.shape,"\n float epsilon = 1.1920928955078125e-7;\n float threshold = log(epsilon) + 2.0;\n\n bool too_large = x > -threshold;\n bool too_small = x < threshold;\n\n float result;\n float exp_x = exp(x);\n\n if (too_large){\n result = x;\n }\n else if (too_small){\n result = exp_x;\n }\n else{\n result = log(exp_x + 1.0);\n }\n return result;\n");return this.compileAndRun(e,[t])},e.prototype.sin=function(t){var e=new Mo(t.shape,"if (isnan(x)) return x;\n return sin(x);\n");return this.compileAndRun(e,[t])},e.prototype.cos=function(t){var e=new Mo(t.shape,"if (isnan(x)) return x;\n return cos(x);\n");return this.compileAndRun(e,[t])},e.prototype.tan=function(t){var e=new Mo(t.shape,"return tan(x);");return this.compileAndRun(e,[t])},e.prototype.asin=function(t){var e=new Mo(t.shape,"if (isnan(x)) return x;\n if (abs(x) > 1.) {\n return NAN;\n }\n return asin(x);\n");return this.compileAndRun(e,[t])},e.prototype.acos=function(t){var e=new Mo(t.shape,"if (isnan(x)) return x;\n if (abs(x) > 1.) {\n return NAN;\n }\n return acos(x);\n");return this.compileAndRun(e,[t])},e.prototype.atan=function(t){var e=new Mo(t.shape,"if (isnan(x)) return x;\n return atan(x);\n");return this.compileAndRun(e,[t])},e.prototype.atan2=function(t,e){var n=c().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new Hi("\n vec4 result = atan(a, b);\n vec4 isNaN = min(vec4(isnan(a)) + vec4(isnan(b)), vec4(1.0));\n \n result.r = isNaN.r > 0. ? NAN : result.r;\n result.g = isNaN.g > 0. ? NAN : result.g;\n result.b = isNaN.b > 0. ? NAN : result.b;\n result.a = isNaN.a > 0. ? NAN : result.a;\n\n return result;\n",t.shape,e.shape):new Ui("\n if (isnan(a)) return a;\n if (isnan(b)) return b;\n\n return atan(a, b);\n",t.shape,e.shape);return this.compileAndRun(n,[t,e])},e.prototype.sinh=function(t){var e=new Mo(t.shape,"\n float e2x = exp(x);\n return (e2x - 1.0 / e2x) / 2.0;\n");return this.compileAndRun(e,[t])},e.prototype.cosh=function(t){var e=new Mo(t.shape,"\n float e2x = exp(-x);\n return (e2x + 1.0 / e2x) / 2.0;\n");return this.compileAndRun(e,[t])},e.prototype.tanh=function(t){var e=new Mo(t.shape,"\n float e2x = exp(-2.0 * abs(x));\n return sign(x) * (1.0 - e2x) / (1.0 + e2x);\n");return this.compileAndRun(e,[t])},e.prototype.asinh=function(t){var e=new Mo(t.shape,"if (isnan(x)) return x;return log(x + sqrt(x * x + 1.0));");return this.compileAndRun(e,[t])},e.prototype.acosh=function(t){var e=new Mo(t.shape,"if (isnan(x)) return x;\n if (x < 1.0) return NAN;\n return log(x + sqrt(x * x - 1.0));");return this.compileAndRun(e,[t])},e.prototype.atanh=function(t){var e=new Mo(t.shape,"if (isnan(x)) return x;\n if ((x < -1.0) || (x > 1.0)) return NAN;\n return (log(1.0 + x) - log(1.0 - x)) / 2.0;");return this.compileAndRun(e,[t])},e.prototype.erf=function(t){var e=new Mo(t.shape,'\n // Error function is calculated approximately with elementary function.\n // See "Handbook of Mathematical Functions with Formulas,\n // Graphs, and Mathematical Tables", Abramowitz and Stegun.\n float p = 0.3275911;\n float a1 = 0.254829592;\n float a2 = -0.284496736;\n float a3 = 1.421413741;\n float a4 = -1.453152027;\n float a5 = 1.061405429;\n\n float sign = sign(x);\n x = abs(x);\n float t = 1.0 / (1.0 + p * x);\n return sign * (1.0 - (((((a5*t + a4)*t) + a3)*t + a2)*t + a1)*t*exp(-x*x));\n');return this.compileAndRun(e,[t])},e.prototype.step=function(t,e){var n=new Mo(t.shape,function(t){return void 0===t&&(t=0),Lo+"\n return x > 0.0 ? 1.0 : float("+t+");\n "}(e));return this.compileAndRun(n,[t])},e.prototype.conv2dByMatMul=function(t,e,n,r,i,o){var s=t.shape,a=this.texData.get(t.dataId),l=n.inChannels,u=s[0]*s[1]*s[2],h=n.outChannels,d="channelsLast"===n.dataFormat,p=(1===u||1===h)&&l>1e3,f=s[2]%2!=0&&!!a.isPacked;if(p||!c().getBool("WEBGL_LAZILY_UNPACK")||!c().getBool("WEBGL_PACK_BINARY_OPERATIONS")||!f){var g=d?s[0]*s[1]*s[2]:s[0]*s[2]*s[3],m=this.reshape(t,[1,g,n.inChannels]),v=this.reshape(e,[1,n.inChannels,n.outChannels]);return this.reshape(this.fusedBatchMatMul({a:m,b:v,transposeA:!1,transposeB:!1,bias:r,activation:i,preluActivationWeights:o}),n.outShape)}var b=d?s[0]*s[1]*(s[2]+1):s[0]*s[2]*(s[3]+1),_={dataId:t.dataId,shape:[1,b,n.inChannels],dtype:t.dtype},y=a.shape;a.shape=a.shape.slice(),a.shape[a.shape.length-2]++,E(Ae(a.shape,_.shape),function(){return"packed reshape "+a.shape+" to "+_.shape+" isn't free"});var T=this.reshape(e,[1,n.inChannels,n.outChannels]),x=this.fusedBatchMatMul({a:_,b:T,transposeA:!1,transposeB:!1,bias:r,activation:i,preluActivationWeights:o}),w=this.texData.get(x.dataId);return E(w.isPacked,function(){return"batchMatMul result is expected to be packed"}),a.shape=y,w.shape=n.outShape,Pt.makeTensorFromDataId(x.dataId,n.outShape,x.dtype)},e.prototype.conv2dWithIm2Row=function(t,e,n,r,i,o){var s=n.filterWidth,a=n.filterHeight,l=n.inChannels,u=n.outWidth,c=n.outHeight,h="channelsLast"===n.dataFormat,d=s*a*l,p=c*u,f=[d,p],g=t.squeeze([0]),m=e.reshape([1,d,-1]),v=new function(t,e,n){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=t;for(var r=n.filterWidth,i=n.inChannels,o=n.strideWidth,s=n.strideHeight,a=n.padInfo,l=n.outWidth,u=n.dilationWidth,c=n.dilationHeight,h=n.dataFormat,d=a.left,p=a.top,f=i*r,g=xi(),m="channelsLast"===h,v=m?0:1,b=m?1:2,_="",y=0;y<=1;y++)for(var T=0;T<=1;T++)_+="\n blockIndex = rc.y + "+T+";\n pos = rc.x + "+y+";\n\n if(blockIndex < "+t[1]+" && pos < "+t[0]+") {\n offsetY = int(blockIndex / ("+l+")) * "+s+" - "+p+";\n d0 = offsetY + "+c+" * (pos / "+f+");\n\n if(d0 < "+e[v]+" && d0 >= 0) {\n\n offsetX = int(mod(float(blockIndex), "+l+".) * "+o+". - "+d+".);\n d1 = offsetX + "+u+" * (int(mod(float(pos), "+f+".) / "+i+".));\n\n if(d1 < "+e[b]+" && d1 >= 0) {\n\n ch = int(mod(float(pos), "+i+".));\n\n if ("+m+") {\n innerDims = vec2(d1, ch);\n result["+(2*y+T)+"] = getChannel(\n getA(d0, int(innerDims.x),\n int(innerDims.y)), innerDims);\n } else {\n innerDims = vec2(d0, d1);\n result["+(2*y+T)+"] = getChannel(\n getA(ch, int(innerDims.x),\n int(innerDims.y)), innerDims);\n }\n }\n }\n }\n ";this.userCode="\n void main() {\n ivec2 rc = getOutputCoords();\n\n vec4 result = vec4(0);\n\n int blockIndex, pos, offsetY, d0, offsetX, d1, ch;\n vec2 innerDims;\n\n "+_+"\n\n "+g.output+" = result;\n }\n "}(f,g.shape,n),b=this.compileAndRun(v,[g]).reshape([1,f[0],f[1]]),_=null!=r,y=null!=o,T=i?Qo(i,!0):null,x=new To(b.shape,[1,p,n.outChannels],!0,!1,_,T,y),E=[b,m];r&&E.push(r),y&&E.push(o);var w=this.compileAndRun(x,E);return h?w.reshape([1,c,u,n.outChannels]):w.reshape([1,n.outChannels,c,u])},e.prototype.fusedConv2d=function(t){var e=t.input,n=t.filter,r=t.convInfo,i=t.bias,o=t.activation,s=t.preluActivationWeights;if(1===r.filterHeight&&1===r.filterWidth&&1===r.dilationHeight&&1===r.dilationWidth&&1===r.strideHeight&&1===r.strideWidth&&("SAME"===r.padInfo.type||"VALID"===r.padInfo.type))return this.conv2dByMatMul(e,n,r,i,o,s);if(c().getBool("WEBGL_CONV_IM2COL")&&1===e.shape[0])return this.conv2dWithIm2Row(e,n,r,i,o,s);var a=null!=i,l=null!=s,u=o?Qo(o,!1):null,h=new Xi(r,a,u,l),d=[e,n];return i&&d.push(i),s&&d.push(s),this.compileAndRun(h,d)},e.prototype.conv2d=function(t,e,n){if(1===n.filterHeight&&1===n.filterWidth&&1===n.dilationHeight&&1===n.dilationWidth&&1===n.strideHeight&&1===n.strideWidth&&("SAME"===n.padInfo.type||"VALID"===n.padInfo.type))return this.conv2dByMatMul(t,e,n);if(c().getBool("WEBGL_CONV_IM2COL")&&1===t.shape[0])return this.conv2dWithIm2Row(t,e,n);var r=new Xi(n);return this.compileAndRun(r,[t,e])},e.prototype.conv2dDerInput=function(t,e,n){var r=new function(t){this.variableNames=["dy","W"],this.outputShape=t.inShape;var e=t.filterHeight,n=t.filterWidth,r=t.strideHeight,i=t.strideWidth,o="channelsLast"===t.dataFormat,s=e-1-t.padInfo.top,a=n-1-t.padInfo.left,l=o?1:2,u=o?2:3,c=o?3:1;this.userCode="\n const ivec2 pads = ivec2("+s+", "+a+");\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d1 = coords["+c+"];\n\n ivec2 dyCorner = ivec2(coords["+l+"], coords["+u+"]) - pads;\n int dyRCorner = dyCorner.x;\n int dyCCorner = dyCorner.y;\n\n // Convolve dy(?, ?, d2) with w(:, :, d1, d2) to compute dx(xR, xC, d1).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < "+e+"; wR++) {\n float dyR = float(dyRCorner + wR) / "+r+".0;\n\n if (dyR < 0.0 || dyR >= "+t.outHeight+".0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n int wRPerm = "+e+" - 1 - wR;\n\n for (int wC = 0; wC < "+n+"; wC++) {\n float dyC = float(dyCCorner + wC) / "+i+".0;\n\n if (dyC < 0.0 || dyC >= "+t.outWidth+".0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n int wCPerm = "+n+" - 1 - wC;\n\n for (int d2 = 0; d2 < "+t.outChannels+"; d2++) {\n\n if ("+o+") {\n float xValue = getDy(batch, idyR, idyC, d2);\n float wValue = getW(wRPerm, wCPerm, d1, d2);\n dotProd += xValue * wValue;\n } else {\n float xValue = getDy(batch, d2, idyR, idyC);\n float wValue = getW(wRPerm, wCPerm, d1, d2);\n dotProd += xValue * wValue;\n }\n\n }\n }\n }\n setOutput(dotProd);\n }\n "}(n);return this.compileAndRun(r,[t,e])},e.prototype.conv2dDerFilter=function(t,e,n){var r=new function(t){this.variableNames=["x","dy"],this.outputShape=t.filterShape;var e=t.strideHeight,n=t.strideWidth,r=t.padInfo.top,i=t.padInfo.left,o="channelsLast"===t.dataFormat;this.userCode="\n void main() {\n ivec4 coords = getOutputCoords();\n int wR = coords.x;\n int wC = coords.y;\n int d1 = coords.z;\n int d2 = coords.w;\n\n // Convolve x(?, ?, d1) with dy(:, :, d2) to get dw(wR, wC, d1, d2).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n\n for (int b = 0; b < "+t.batchSize+"; b++) {\n for (int yR = 0; yR < "+t.outHeight+"; yR++) {\n int xR = wR + yR * "+e+" - "+r+";\n\n if (xR < 0 || xR >= "+t.inHeight+") {\n continue;\n }\n\n for (int yC = 0; yC < "+t.outWidth+"; yC++) {\n int xC = wC + yC * "+n+" - "+i+";\n\n if (xC < 0 || xC >= "+t.inWidth+") {\n continue;\n }\n\n if ("+o+") {\n float dyValue = getDy(b, yR, yC, d2);\n float xValue = getX(b, xR, xC, d1);\n dotProd += (xValue * dyValue);\n } else {\n float dyValue = getDy(b, d2, yR, yC);\n float xValue = getX(b, d1, xR, xC);\n dotProd += (xValue * dyValue);\n }\n\n }\n }\n }\n setOutput(dotProd);\n }\n "}(n);return this.compileAndRun(r,[t,e])},e.prototype.fusedDepthwiseConv2D=function(t){var e,n=t.input,r=t.filter,i=t.convInfo,o=t.bias,s=t.activation,a=t.preluActivationWeights,l=c().getBool("WEBGL_PACK_DEPTHWISECONV")&&i.strideWidth<=2&&i.outChannels/i.inChannels==1,u=s?Qo(s,l):null,h=[n,r],d=null!=o,p=null!=a;return d&&h.push(o),p&&h.push(a),l?(e=new Yi(i,d,u,p),this.compileAndRun(e,h)):(e=new Ki(i,d,u,p),this.compileAndRun(e,h))},e.prototype.depthwiseConv2D=function(t,e,n){var r;return c().getBool("WEBGL_PACK_DEPTHWISECONV")&&n.strideWidth<=2&&n.outChannels/n.inChannels==1?(r=new Yi(n),this.compileAndRun(r,[t,e])):(r=new Ki(n),this.compileAndRun(r,[t,e]))},e.prototype.depthwiseConv2DDerInput=function(t,e,n){var r=new function(t){this.variableNames=["dy","W"],this.outputShape=t.inShape;var e=t.filterHeight,n=t.filterWidth,r=t.strideHeight,i=t.strideWidth,o=e-1-t.padInfo.top,s=n-1-t.padInfo.left,a=t.outChannels/t.inChannels;this.userCode="\n const ivec2 pads = ivec2("+o+", "+s+");\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d1 = coords[3];\n ivec2 dyCorner = coords.yz - pads;\n int dyRCorner = dyCorner.x;\n int dyCCorner = dyCorner.y;\n\n float dotProd = 0.0;\n\n for (int wR = 0; wR < "+e+"; wR++) {\n float dyR = float(dyRCorner + wR) / "+r+".0;\n\n if (dyR < 0.0 || dyR >= "+t.outHeight+".0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n int wRPerm = "+e+" - 1 - wR;\n\n for (int wC = 0; wC < "+n+"; wC++) {\n float dyC = float(dyCCorner + wC) / "+i+".0;\n\n if (dyC < 0.0 || dyC >= "+t.outWidth+".0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n int wCPerm = "+n+" - 1 - wC;\n\n // TO DO: Vec4 over the channelMul\n for (int dm = 0; dm < "+a+"; dm++) {\n int d2 = d1 * "+a+" + dm;\n float xValue = getDy(batch, idyR, idyC, d2);\n float wValue = getW(wRPerm, wCPerm, d1, dm);\n dotProd += xValue * wValue;\n }\n }\n }\n setOutput(dotProd);\n }\n "}(n);return this.compileAndRun(r,[t,e])},e.prototype.depthwiseConv2DDerFilter=function(t,e,n){var r=new function(t){this.variableNames=["x","dy"],this.outputShape=t.filterShape;var e=t.strideHeight,n=t.strideWidth,r=t.padInfo.top,i=t.padInfo.left,o=t.outChannels/t.inChannels;this.userCode="\n void main() {\n ivec4 coords = getOutputCoords();\n int wR = coords.x;\n int wC = coords.y;\n int d1 = coords.z;\n int dm = coords.w;\n int d2 = d1 * "+o+" + dm;\n\n float dotProd = 0.0;\n\n // TO DO: Vec4 over the batch size\n for (int b = 0; b < "+t.batchSize+"; b++) {\n for (int yR = 0; yR < "+t.outHeight+"; yR++) {\n int xR = wR + yR * "+e+" - "+r+";\n\n if (xR < 0 || xR >= "+t.inHeight+") {\n continue;\n }\n\n for (int yC = 0; yC < "+t.outWidth+"; yC++) {\n int xC = wC + yC * "+n+" - "+i+";\n\n if (xC < 0 || xC >= "+t.inWidth+") {\n continue;\n }\n\n float dyValue = getDy(b, yR, yC, d2);\n float xValue = getX(b, xR, xC, d1);\n dotProd += (xValue * dyValue);\n }\n }\n }\n setOutput(dotProd);\n }\n "}(n);return this.compileAndRun(r,[t,e])},e.prototype.conv3d=function(t,e,n){var r=new function(t){this.variableNames=["x","W"],this.outputShape=t.outShape;var e=t.padInfo.front,n=t.padInfo.top,r=t.padInfo.left,i=t.strideDepth,o=t.strideHeight,s=t.strideWidth,a=t.dilationDepth,l=t.dilationHeight,u=t.dilationWidth,c=t.filterDepth,h=t.filterHeight,d=t.filterWidth,p=4*Math.floor(t.inChannels/4),f=t.inChannels%4;this.userCode="\n const ivec3 strides = ivec3("+i+", "+o+", "+s+");\n const ivec3 pads = ivec3("+e+", "+n+", "+r+");\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int d2 = coords.u;\n\n ivec3 xFRCCorner = ivec3(coords.y, coords.z, coords.w) * strides - pads;\n int xFCorner = xFRCCorner.x;\n int xRCorner = xFRCCorner.y;\n int xCCorner = xFRCCorner.z;\n\n // Convolve x(?, ?, ?, d1) with w(:, :, :, d1, d2) to get\n // y(yF, yR, yC, d2). ? = to be determined. : = across all\n // values in that axis.\n float dotProd = 0.0;\n for (int wF = 0; wF < "+c+"; wF++) {\n int xF = xFCorner + wF * "+a+";\n\n if (xF < 0 || xF >= "+t.inDepth+") {\n continue;\n }\n\n for (int wR = 0; wR < "+h+"; wR++) {\n int xR = xRCorner + wR * "+l+";\n\n if (xR < 0 || xR >= "+t.inHeight+") {\n continue;\n }\n\n for (int wC = 0; wC < "+d+"; wC++) {\n int xC = xCCorner + wC * "+u+";\n\n if (xC < 0 || xC >= "+t.inWidth+") {\n continue;\n }\n\n for (int d1 = 0; d1 < "+p+"; d1 += 4) {\n vec4 xValues = vec4(\n getX(batch, xF, xR, xC, d1),\n getX(batch, xF, xR, xC, d1 + 1),\n getX(batch, xF, xR, xC, d1 + 2),\n getX(batch, xF, xR, xC, d1 + 3)\n );\n vec4 wValues = vec4(\n getW(wF, wR, wC, d1, d2),\n getW(wF, wR, wC, d1 + 1, d2),\n getW(wF, wR, wC, d1 + 2, d2),\n getW(wF, wR, wC, d1 + 3, d2)\n );\n\n dotProd += dot(xValues, wValues);\n }\n\n if ("+(1===f)+") {\n dotProd +=\n getX(batch, xF, xR, xC, "+p+") *\n getW(wF, wR, wC, "+p+", d2);\n } else if ("+(2===f)+") {\n vec2 xValues = vec2(\n getX(batch, xF, xR, xC, "+p+"),\n getX(batch, xF, xR, xC, "+p+" + 1)\n );\n vec2 wValues = vec2(\n getW(wF, wR, wC, "+p+", d2),\n getW(wF, wR, wC, "+p+" + 1, d2)\n );\n dotProd += dot(xValues, wValues);\n } else if ("+(3===f)+") {\n vec3 xValues = vec3(\n getX(batch, xF, xR, xC, "+p+"),\n getX(batch, xF, xR, xC, "+p+" + 1),\n getX(batch, xF, xR, xC, "+p+" + 2)\n );\n vec3 wValues = vec3(\n getW(wF, wR, wC, "+p+", d2),\n getW(wF, wR, wC, "+p+" + 1, d2),\n getW(wF, wR, wC, "+p+" + 2, d2)\n );\n dotProd += dot(xValues, wValues);\n }\n }\n }\n }\n setOutput(dotProd);\n }\n "}(n);return this.compileAndRun(r,[t,e])},e.prototype.conv3dDerInput=function(t,e,n){var r=new function(t){this.variableNames=["dy","W"],this.outputShape=t.inShape;var e=t.filterDepth,n=t.filterHeight,r=t.filterWidth,i=t.strideDepth,o=t.strideHeight,s=t.strideWidth,a=e-1-t.padInfo.front,l=n-1-t.padInfo.top,u=r-1-t.padInfo.left;this.userCode="\n const ivec3 pads = ivec3("+a+", "+l+", "+u+");\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int d1 = coords.u;\n\n\n ivec3 dyCorner = ivec3(coords.y, coords.z, coords.w) - pads;\n int dyFCorner = dyCorner.x;\n int dyRCorner = dyCorner.y;\n int dyCCorner = dyCorner.z;\n\n float dotProd = 0.0;\n for (int wF = 0; wF < "+e+"; wF++) {\n float dyF = float(dyFCorner + wF) / "+i+".0;\n\n if (dyF < 0.0 || dyF >= "+t.outDepth+".0 || fract(dyF) > 0.0) {\n continue;\n }\n int idyF = int(dyF);\n\n int wFPerm = "+e+" - 1 - wF;\n\n for (int wR = 0; wR < "+n+"; wR++) {\n float dyR = float(dyRCorner + wR) / "+o+".0;\n\n if (dyR < 0.0 || dyR >= "+t.outHeight+".0 ||\n fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n int wRPerm = "+n+" - 1 - wR;\n\n for (int wC = 0; wC < "+r+"; wC++) {\n float dyC = float(dyCCorner + wC) / "+s+".0;\n\n if (dyC < 0.0 || dyC >= "+t.outWidth+".0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n int wCPerm = "+r+" - 1 - wC;\n\n for (int d2 = 0; d2 < "+t.outChannels+"; d2++) {\n float xValue = getDy(batch, idyF, idyR, idyC, d2);\n float wValue = getW(wFPerm, wRPerm, wCPerm, d1, d2);\n dotProd += xValue * wValue;\n }\n }\n }\n }\n setOutput(dotProd);\n }\n "}(n);return this.compileAndRun(r,[t,e])},e.prototype.conv3dDerFilter=function(t,e,n){var r=new function(t){this.variableNames=["x","dy"],this.outputShape=t.filterShape;var e=t.strideDepth,n=t.strideHeight,r=t.strideWidth,i=t.padInfo.front,o=t.padInfo.top,s=t.padInfo.left;this.userCode="\n void main() {\n ivec5 coords = getOutputCoords();\n int wF = coords.x;\n int wR = coords.y;\n int wC = coords.z;\n int d1 = coords.w;\n int d2 = coords.u;\n\n float dotProd = 0.0;\n\n for (int b = 0; b < "+t.batchSize+"; b++) {\n for (int yF = 0; yF < "+t.outDepth+"; yF++) {\n int xF = wF + yF * "+e+" - "+i+";\n\n if (xF < 0 || xF >= "+t.inDepth+") {\n continue;\n }\n\n for (int yR = 0; yR < "+t.outHeight+"; yR++) {\n int xR = wR + yR * "+n+" - "+o+";\n\n if (xR < 0 || xR >= "+t.inHeight+") {\n continue;\n }\n\n for (int yC = 0; yC < "+t.outWidth+"; yC++) {\n int xC = wC + yC * "+r+" - "+s+";\n\n if (xC < 0 || xC >= "+t.inWidth+") {\n continue;\n }\n\n float dyValue = getDy(b, yF, yR, yC, d2);\n float xValue = getX(b, xF, xR, xC, d1);\n dotProd += (xValue * dyValue);\n }\n }\n }\n }\n setOutput(dotProd);\n }\n "}(n);return this.compileAndRun(r,[t,e])},e.prototype.maxPool=function(t,e){var n=new Eo(e,"max",!1);return this.compileAndRun(n,[t])},e.prototype.avgPool=function(t,e){var n=new Eo(e,"avg",!1);return this.compileAndRun(n,[t],"float32")},e.prototype.maxPoolBackprop=function(t,e,n,r){var i=new Eo(r,"max",!0),o=this.compileAndRun(i,[e]),s=new function(t){this.variableNames=["dy","maxPos"],this.outputShape=t.inShape;var e=t.strideHeight,n=t.strideWidth,r=t.dilationHeight,i=t.effectiveFilterHeight,o=t.effectiveFilterWidth,s=i-1-t.padInfo.top,a=o-1-t.padInfo.left,l=i*o-1;this.userCode="\n const ivec2 pads = ivec2("+s+", "+a+");\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n\n ivec2 dyRCCorner = coords.yz - pads;\n int dyRCorner = dyRCCorner.x;\n int dyCCorner = dyRCCorner.y;\n\n // Convolve dy(?, ?, d) with pos mask(:, :, d) to get dx(xR, xC, d).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < "+i+";\n wR += "+r+") {\n float dyR = float(dyRCorner + wR) / "+e+".0;\n\n if (dyR < 0.0 || dyR >= "+t.outHeight+".0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n for (int wC = 0; wC < "+o+"; wC++) {\n float dyC = float(dyCCorner + wC) / "+n+".0;\n\n if (dyC < 0.0 || dyC >= "+t.outWidth+".0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n float dyValue = getDy(b, idyR, idyC, d);\n int maxPosValue = "+l+" - int(getMaxPos(b, idyR, idyC, d));\n\n // Get the current value, check it against the value from the\n // position matrix.\n int curPosValue = wR * "+o+" + wC;\n float mask = float(maxPosValue == curPosValue ? 1.0 : 0.0);\n\n dotProd += dyValue * mask;\n }\n }\n setOutput(dotProd);\n }\n "}(r),a=this.compileAndRun(s,[t,o],e.dtype);return o.dispose(),a},e.prototype.avgPoolBackprop=function(t,e,n){var r=new function(t){this.variableNames=["dy"],this.outputShape=t.inShape;var e=t.filterHeight,n=t.filterWidth,r=t.strideHeight,i=t.strideWidth,o=t.dilationHeight,s=t.dilationWidth,a=t.effectiveFilterHeight,l=t.effectiveFilterWidth,u=a-1-t.padInfo.top,c=l-1-t.padInfo.left,h=1/(e*n);this.userCode="\n const ivec2 pads = ivec2("+u+", "+c+");\n const float avgMultiplier = float("+h+");\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n\n ivec2 dyRCCorner = coords.yz - pads;\n int dyRCorner = dyRCCorner.x;\n int dyCCorner = dyRCCorner.y;\n\n // Convolve dy(?, ?, d) with pos mask(:, :, d) to get dx(xR, xC, d).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < "+a+";\n wR += "+o+") {\n float dyR = float(dyRCorner + wR) / "+r+".0;\n\n if (dyR < 0.0 || dyR >= "+t.outHeight+".0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n for (int wC = 0; wC < "+l+";\n wC+= "+s+") {\n float dyC = float(dyCCorner + wC) / "+i+".0;\n\n if (dyC < 0.0 || dyC >= "+t.outWidth+".0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n float dyValue = getDy(b, idyR, idyC, d);\n\n dotProd += dyValue * avgMultiplier;\n }\n }\n setOutput(dotProd);\n }\n "}(n);return this.compileAndRun(r,[t],e.dtype)},e.prototype.cast=function(t,e){return ei(t,e,this)},e.prototype.unstack=function(t,e){for(var n=t.shape[e],r=new Array(t.rank-1),i=0,o=0;o<t.rank;o++)o!==e&&(r[i++]=t.shape[o]);var s=new Array(t.rank).fill(0),a=t.shape.slice();a[e]=1;var l=new Array(n);for(o=0;o<l.length;o++)s[e]=o,l[o]=this.slice(t,s,a).reshape(r);return l},e.prototype.avgPool3d=function(t,e){var n=new wo(e,"avg",!1);return this.compileAndRun(n,[t],"float32")},e.prototype.avgPool3dBackprop=function(t,e,n){var r=new function(t){this.variableNames=["dy"],this.outputShape=t.inShape;var e=t.filterDepth,n=t.filterHeight,r=t.filterWidth,i=t.strideDepth,o=t.strideHeight,s=t.strideWidth,a=t.dilationDepth,l=t.dilationHeight,u=t.dilationWidth,c=t.effectiveFilterDepth,h=t.effectiveFilterHeight,d=t.effectiveFilterWidth,p=c-1-t.padInfo.front,f=h-1-t.padInfo.top,g=d-1-t.padInfo.left,m=1/(e*n*r);this.userCode="\n const ivec3 pads = ivec3("+p+", "+f+", "+g+");\n const float avgMultiplier = float("+m+");\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int ch = coords.u;\n\n ivec3 dyCorner = ivec3(coords.y, coords.z, coords.w) - pads;\n int dyDCorner = dyCorner.x;\n int dyRCorner = dyCorner.y;\n int dyCCorner = dyCorner.z;\n\n // Convolve dy(?, ?, ?, d) with pos mask(:, :, :, ch) to get\n // dx(xD, xR, xC, ch).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n\n for (int wD = 0; wD < "+c+";\n wD += "+a+") {\n float dyD = float(dyDCorner + wD) / "+i+".0;\n\n if (dyD < 0.0 || dyD >= "+t.outDepth+".0 || fract(dyD) > 0.0) {\n continue;\n }\n int idyD = int(dyD);\n\n for (int wR = 0; wR < "+h+";\n wR += "+l+") {\n float dyR = float(dyRCorner + wR) / "+o+".0;\n\n if (dyR < 0.0 || dyR >= "+t.outHeight+".0 ||\n fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n for (int wC = 0; wC < "+d+";\n wC += "+u+") {\n float dyC = float(dyCCorner + wC) / "+s+".0;\n\n if (dyC < 0.0 || dyC >= "+t.outWidth+".0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n float dyValue = getDy(batch, idyD, idyR, idyC, ch);\n\n dotProd += dyValue * avgMultiplier;\n }\n }\n }\n setOutput(dotProd);\n }\n "}(n);return this.compileAndRun(r,[t],e.dtype)},e.prototype.maxPool3d=function(t,e){var n=new wo(e,"max",!1);return this.compileAndRun(n,[t],"float32")},e.prototype.maxPool3dBackprop=function(t,e,n,r){var i=new wo(r,"max",!0),o=this.compileAndRun(i,[e]),s=new function(t){this.variableNames=["dy","maxPos"],this.outputShape=t.inShape;var e=t.strideDepth,n=t.strideHeight,r=t.strideWidth,i=t.dilationDepth,o=t.dilationHeight,s=t.dilationWidth,a=t.effectiveFilterDepth,l=t.effectiveFilterHeight,u=t.effectiveFilterWidth,c=a-1-t.padInfo.front,h=l-1-t.padInfo.top,d=u-1-t.padInfo.left,p=a*l*u-1;this.userCode="\n const ivec3 pads = ivec3("+c+", "+h+", "+d+");\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int ch = coords.u;\n\n ivec3 dyCorner = ivec3(coords.y, coords.z, coords.w) - pads;\n int dyDCorner = dyCorner.x;\n int dyRCorner = dyCorner.y;\n int dyCCorner = dyCorner.z;\n\n // Convolve dy(?, ?, ?, ch) with pos mask(:, :, :, d) to get\n // dx(xD, xR, xC, ch).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n\n for (int wD = 0; wD < "+a+";\n wD += "+i+") {\n float dyD = float(dyDCorner + wD) / "+e+".0;\n\n if (dyD < 0.0 || dyD >= "+t.outDepth+".0 || fract(dyD) > 0.0) {\n continue;\n }\n int idyD = int(dyD);\n\n for (int wR = 0; wR < "+l+";\n wR += "+o+") {\n float dyR = float(dyRCorner + wR) / "+n+".0;\n\n if (dyR < 0.0 || dyR >= "+t.outHeight+".0 ||\n fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n for (int wC = 0; wC < "+u+";\n wC += "+s+") {\n float dyC = float(dyCCorner + wC) / "+r+".0;\n\n if (dyC < 0.0 || dyC >= "+t.outWidth+".0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n float dyValue = getDy(batch, idyD, idyR, idyC, ch);\n int maxPosValue = "+p+" -\n int(getMaxPos(batch, idyD, idyR, idyC, ch));\n\n // Get the current value, check it against the value from the\n // position matrix.\n int curPosValue =\n wD * "+l+" * "+u+" +\n wR * "+u+" + wC;\n float mask = float(maxPosValue == curPosValue ? 1.0 : 0.0);\n\n dotProd += dyValue * mask;\n }\n }\n }\n setOutput(dotProd);\n }\n "}(r),a=this.compileAndRun(s,[t,o],e.dtype);return o.dispose(),a},e.prototype.reshape=function(t,e){var n=this.texData.get(t.dataId);if(n.isPacked&&!Ae(t.shape,e)&&(null===n.texture||!Ae(n.shape,e))){var r=this.packedReshape(t,e);return Pt.makeTensorFromDataId(r.dataId,r.shape,r.dtype)}return ni(t,e)},e.prototype.resizeBilinear=function(t,e,n,r){var i=c().getBool("WEBGL_PACK_IMAGE_OPERATIONS")?new function(t,e,n,r){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=[];var i=t[0],o=t[1],s=t[2],a=t[3];this.outputShape=[i,e,n,a];var l=[r&&e>1?o-1:o,r&&n>1?s-1:s],u=[r&&e>1?e-1:e,r&&n>1?n-1:n];this.userCode="\n const vec3 effectiveInputOverOutputRatioRC = vec3(\n "+l[0]/u[0]+",\n "+l[1]/u[1]+",\n "+l[1]/u[1]+");\n const vec3 inputShapeRC = vec3("+o+".0, "+s+".0,\n "+s+".0);\n\n float getAValue(int b, int r, int c, int d) {\n return getChannel(getA(b, r, c, d), vec2(c, d));\n }\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n // Calculate values for next column in yRC.z.\n ivec3 yRC = coords.yzz + ivec3(0, 0, 1);\n\n // Fractional source index.\n vec3 sourceFracIndexRC = vec3(yRC) * effectiveInputOverOutputRatioRC;\n\n // Compute the four integer indices.\n ivec3 sourceFloorRC = ivec3(sourceFracIndexRC);\n ivec3 sourceCeilRC = ivec3(\n min(inputShapeRC - 1.0, ceil(sourceFracIndexRC)));\n\n // Should we calculate next column and row elements in 2x2 packed cell.\n bool hasNextCol = d < "+(a-1)+";\n bool hasNextRow = coords.z < "+(n-1)+";\n\n // In parallel, construct four corners for all four components in\n // packed 2x2 cell.\n vec4 topLeft = vec4(\n getAValue(b, sourceFloorRC.x, sourceFloorRC.y, d),\n hasNextCol ? getAValue(b, sourceFloorRC.x, sourceFloorRC.y, d + 1)\n : 0.0,\n hasNextRow ? getAValue(b, sourceFloorRC.x, sourceFloorRC.z, d)\n : 0.0,\n (hasNextRow && hasNextCol) ?\n getAValue(b, sourceFloorRC.x, sourceFloorRC.z, d + 1) : 0.0);\n\n vec4 bottomLeft = vec4(\n getAValue(b, sourceCeilRC.x, sourceFloorRC.y, d),\n hasNextCol ? getAValue(b, sourceCeilRC.x, sourceFloorRC.y, d + 1)\n : 0.0,\n hasNextRow ? getAValue(b, sourceCeilRC.x, sourceFloorRC.z, d)\n : 0.0,\n (hasNextRow && hasNextCol) ?\n getAValue(b, sourceCeilRC.x, sourceFloorRC.z, d + 1) : 0.0);\n\n vec4 topRight = vec4(\n getAValue(b, sourceFloorRC.x, sourceCeilRC.y, d),\n hasNextCol ? getAValue(b, sourceFloorRC.x, sourceCeilRC.y, d + 1)\n : 0.0,\n hasNextRow ? getAValue(b, sourceFloorRC.x, sourceCeilRC.z, d)\n : 0.0,\n (hasNextRow && hasNextCol) ?\n getAValue(b, sourceFloorRC.x, sourceCeilRC.z, d + 1) : 0.0);\n\n vec4 bottomRight = vec4(\n getAValue(b, sourceCeilRC.x, sourceCeilRC.y, d),\n hasNextCol ? getAValue(b, sourceCeilRC.x, sourceCeilRC.y, d + 1)\n : 0.0,\n hasNextRow ? getAValue(b, sourceCeilRC.x, sourceCeilRC.z, d)\n : 0.0,\n (hasNextRow && hasNextCol) ?\n getAValue(b, sourceCeilRC.x, sourceCeilRC.z, d + 1) : 0.0);\n\n vec3 fracRC = sourceFracIndexRC - vec3(sourceFloorRC);\n\n vec4 top = mix(topLeft, topRight, fracRC.yyzz);\n vec4 bottom = mix(bottomLeft, bottomRight, fracRC.yyzz);\n vec4 newValue = mix(top, bottom, fracRC.x);\n\n setOutput(newValue);\n }\n "}(t.shape,e,n,r):new function(t,e,n,r){this.variableNames=["A"],this.outputShape=[];var i=t[0],o=t[1],s=t[2],a=t[3];this.outputShape=[i,e,n,a];var l=[r&&e>1?o-1:o,r&&n>1?s-1:s],u=[r&&e>1?e-1:e,r&&n>1?n-1:n];this.userCode="\n const vec2 effectiveInputOverOutputRatioRC = vec2(\n "+l[0]/u[0]+",\n "+l[1]/u[1]+");\n const vec2 inputShapeRC = vec2("+o+".0, "+s+".0);\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n ivec2 yRC = coords.yz;\n\n // Fractional source index.\n vec2 sourceFracIndexRC = vec2(yRC) * effectiveInputOverOutputRatioRC;\n\n // Compute the four integer indices.\n ivec2 sourceFloorRC = ivec2(sourceFracIndexRC);\n ivec2 sourceCeilRC = ivec2(\n min(inputShapeRC - 1.0, ceil(sourceFracIndexRC)));\n\n float topLeft = getA(b, sourceFloorRC.x, sourceFloorRC.y, d);\n float bottomLeft = getA(b, sourceCeilRC.x, sourceFloorRC.y, d);\n float topRight = getA(b, sourceFloorRC.x, sourceCeilRC.y, d);\n float bottomRight = getA(b, sourceCeilRC.x, sourceCeilRC.y, d);\n\n vec2 fracRC = sourceFracIndexRC - vec2(sourceFloorRC);\n\n float top = topLeft + (topRight - topLeft) * fracRC.y;\n float bottom = bottomLeft + (bottomRight - bottomLeft) * fracRC.y;\n float newValue = top + (bottom - top) * fracRC.x;\n\n setOutput(newValue);\n }\n "}(t.shape,e,n,r);return this.compileAndRun(i,[t],"float32")},e.prototype.resizeBilinearBackprop=function(t,e,n){var r=new function(t,e,n){this.variableNames=["dy"],this.outputShape=[],this.outputShape=e.shape;var r=e.shape,i=r[1],o=r[2],s=t.shape,a=s[1],l=s[2],u=[n&&a>1?i-1:i,n&&l>1?o-1:o],c=[n&&a>1?a-1:a,n&&l>1?l-1:l],h=u[0]/c[0],d=u[1]/c[1],p=1/h,f=1/d,g=2*Math.ceil(p)+2,m=2*Math.ceil(f)+2;this.userCode="\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n int r = coords[1];\n int c = coords[2];\n\n float accumulator = 0.0;\n\n const float heightScale = float("+h+");\n const float widthScale = float("+d+");\n\n const float invHeightScale = float("+p+");\n const float invWidthScale = float("+f+");\n\n const int winHeight = int("+g+");\n const int winWidth = int("+m+");\n\n // Compute bounds for where in dy we will look\n float startRLerp = floor(float(r) * invHeightScale);\n int startDyR = int(startRLerp - float(winHeight / 2));\n\n float startCLerp = floor(float(c) * invWidthScale);\n int startDyC = int(startCLerp - float(winWidth / 2));\n\n // Loop over dy\n for (int dyROffset = 0; dyROffset < winHeight; dyROffset++) {\n int dyR = dyROffset + startDyR;\n\n // Guard against the window exceeding the bounds of dy\n if (dyR < 0 || dyR >= "+a+") {\n continue;\n }\n\n for (int dyCOffset = 0; dyCOffset < winWidth; dyCOffset++) {\n int dyC = dyCOffset + startDyC;\n\n // Guard against the window exceeding the bounds of dy\n if (dyC < 0 || dyC >= "+l+") {\n continue;\n }\n\n float dxR = float(dyR) * heightScale;\n int topDxRIndex = int(floor(dxR));\n int bottomDxRIndex = int(min(ceil(dxR), "+(i-1)+".0));\n float dxRLerp = dxR - float(topDxRIndex);\n float inverseDxRLerp = 1.0 - dxRLerp;\n\n float dxC = float(dyC) * widthScale;\n int leftDxCIndex = int(floor(dxC));\n int rightDxCIndex = int(min(ceil(dxC), "+(o-1)+".0));\n float dxCLerp = dxC - float(leftDxCIndex);\n float inverseDxCLerp = 1.0 - dxCLerp;\n\n if (r == topDxRIndex && c == leftDxCIndex) {\n // topLeft\n accumulator +=\n getDy(b, dyR, dyC, d) * inverseDxRLerp * inverseDxCLerp;\n }\n\n if (r == topDxRIndex && c == rightDxCIndex) {\n // topRight\n accumulator += getDy(b, dyR, dyC, d) * inverseDxRLerp * dxCLerp;\n }\n\n if (r == bottomDxRIndex && c == leftDxCIndex) {\n // bottomLeft\n accumulator += getDy(b, dyR, dyC, d) * dxRLerp * inverseDxCLerp;\n }\n\n if (r == bottomDxRIndex && c == rightDxCIndex) {\n // bottomRight\n accumulator += getDy(b, dyR, dyC, d) * dxRLerp * dxCLerp;\n }\n }\n }\n // End loop over dy\n\n setOutput(accumulator);\n }\n "}(t,e,n);return this.compileAndRun(r,[t])},e.prototype.resizeNearestNeighbor=function(t,e,n,r){var i=new function(t,e,n,r){this.variableNames=["A"],this.outputShape=[];var i=t[0],o=t[1],s=t[2],a=t[3];this.outputShape=[i,e,n,a];var l=[r&&e>1?o-1:o,r&&n>1?s-1:s],u=[r&&e>1?e-1:e,r&&n>1?n-1:n],c=r?"0.5":"0.0";this.userCode="\n const vec2 effectiveInputOverOutputRatioRC = vec2(\n "+l[0]/u[0]+",\n "+l[1]/u[1]+");\n const vec2 inputShapeRC = vec2("+o+".0, "+s+".0);\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n ivec2 yRC = coords.yz;\n\n // Fractional source index.\n vec2 sourceFracIndexRC = vec2(yRC) * effectiveInputOverOutputRatioRC;\n\n // Compute the coordinators of nearest neighbor point.\n ivec2 sourceNearestRC = ivec2(\n min(inputShapeRC - 1.0, floor(sourceFracIndexRC + "+c+")));\n\n float newValue = getA(b, sourceNearestRC.x, sourceNearestRC.y, d);\n\n setOutput(newValue);\n }\n "}(t.shape,e,n,r);return this.compileAndRun(i,[t])},e.prototype.resizeNearestNeighborBackprop=function(t,e,n){var r=new function(t,e,n){this.variableNames=["dy"],this.outputShape=[],this.outputShape=e.shape;var r=e.shape,i=r[1],o=r[2],s=t.shape,a=s[1],l=s[2],u=[n&&a>1?i-1:i,n&&l>1?o-1:o],c=[n&&a>1?a-1:a,n&&l>1?l-1:l],h=u[0]/c[0],d=u[1]/c[1],p=1/h,f=1/d,g=2*Math.ceil(p)+2,m=2*Math.ceil(f)+2;this.userCode="\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n int r = coords[1];\n int c = coords[2];\n\n float accumulator = 0.0;\n\n const float heightScale = float("+h+");\n const float widthScale = float("+d+");\n\n const float invHeightScale = float("+p+");\n const float invWidthScale = float("+f+");\n\n const int winHeight = int("+g+");\n const int winWidth = int("+m+");\n\n // Compute bounds for where in dy we will look\n float startRLerp = floor(float(r) * invHeightScale);\n int startDyR = int(floor(startRLerp - float(winHeight / 2)));\n\n float startCLerp = floor(float(c) * invWidthScale);\n int startDyC = int(floor(startCLerp - float(winWidth / 2)));\n\n // Loop over dy\n for (int dyROffset = 0; dyROffset < winHeight; dyROffset++) {\n int dyR = dyROffset + startDyR;\n\n // Guard against the window exceeding the bounds of dy\n if (dyR < 0 || dyR >= "+a+") {\n continue;\n }\n\n for (int dyCOffset = 0; dyCOffset < winWidth; dyCOffset++) {\n int dyC = dyCOffset + startDyC;\n\n // Guard against the window exceeding the bounds of dy\n if (dyC < 0 || dyC >= "+l+") {\n continue;\n }\n\n float sourceFracRow =\n float("+u[0]+") *\n (float(dyR) / float("+c[0]+"));\n\n float sourceFracCol =\n float("+u[1]+") *\n (float(dyC) / float("+c[1]+"));\n\n int sourceNearestRow = int(min(\n float(int("+i+") - 1),\n "+n+" ? float(round(sourceFracRow)) :\n float(floor(sourceFracRow))));\n\n int sourceNearestCol = int(min(\n float(int("+o+") - 1),\n "+n+" ? float(round(sourceFracCol)) :\n float(floor(sourceFracCol))));\n\n if (r == sourceNearestRow && c == sourceNearestCol) {\n accumulator += getDy(b, dyR, dyC, d);\n }\n }\n }\n // End loop over dy\n\n setOutput(accumulator);\n }\n "}(t,e,n);return this.compileAndRun(r,[t])},e.prototype.multinomial=function(t,e,n,r){var i=e?t:Lr(t),o=i.shape[0],s=i.shape[1],a=new xo(o,s,n),l=a.getCustomSetupFunc(r);return this.compileAndRun(a,[i],"int32",l)},e.prototype.oneHot=function(t,e,n,r){var i=new function(t,e,n,r){this.variableNames=["indices"],this.outputShape=[t,e],this.userCode="\n void main() {\n ivec2 coords = getOutputCoords();\n int index = round(getIndices(coords.x));\n setOutput(mix(float("+r+"), float("+n+"),\n float(index == coords.y)));\n }\n "}(t.size,e,n,r);return this.compileAndRun(i,[t])},e.prototype.diag=function(t){var e=new function(t){this.variableNames=["X"],this.outputShape=[t,t],this.userCode="\n void main() {\n ivec2 coords = getOutputCoords();\n float val = coords[0] == coords[1] ? getX(coords[0]) : 0.0;\n setOutput(val);\n }\n "}(t.size);return this.compileAndRun(e,[t])},e.prototype.nonMaxSuppression=function(t,e,n,r,i){return ze("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead"),ci(t.dataSync(),e.dataSync(),n,r,i)},e.prototype.cropAndResize=function(t,e,n,r,i,o){var s=new function(t,e,n,r,i){this.variableNames=["Image","Boxes","BoxInd"],this.outputShape=[];var o=t[0],s=t[1],a=t[2],l=t[3],u=e[0],c=n[0],h=n[1];this.outputShape=[u,c,h,l];var d="bilinear"===r?1:0,p=[s-1+".0",a-1+".0"],f=p[0],g=p[1],m=c>1?[""+(s-1)/(c-1),"(y2-y1) * height_ratio","y1*"+f+" + float(y)*(height_scale)"]:["0.0","0.0","0.5 * (y1+y2) * "+f],v=m[0],b=m[1],_=m[2],y=h>1?[""+(a-1)/(h-1),"(x2-x1) * width_ratio","x1*"+g+" + float(x)*(width_scale)"]:["0.0","0.0","0.5 * (x1+x2) * "+g],T=y[0],x=y[1],E=y[2];this.userCode="\n const float height_ratio = float("+v+");\n const float width_ratio = float("+T+");\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int y = coords[1];\n int x = coords[2];\n int d = coords[3];\n\n // get box vals\n float y1 = getBoxes(b,0);\n float x1 = getBoxes(b,1);\n float y2 = getBoxes(b,2);\n float x2 = getBoxes(b,3);\n\n // get image in batch index\n int bInd = round(getBoxInd(b));\n if(bInd < 0 || bInd >= "+o+") {\n return;\n }\n\n float height_scale = "+b+";\n float width_scale = "+x+";\n\n float in_y = "+_+";\n if( in_y < 0.0 || in_y > "+f+" ) {\n setOutput(float("+i+"));\n return;\n }\n float in_x = "+E+";\n if( in_x < 0.0 || in_x > "+g+" ) {\n setOutput(float("+i+"));\n return;\n }\n\n vec2 sourceFracIndexCR = vec2(in_x,in_y);\n if("+d+" == 1) {\n // Compute the four integer indices.\n ivec2 sourceFloorCR = ivec2(sourceFracIndexCR);\n ivec2 sourceCeilCR = ivec2(ceil(sourceFracIndexCR));\n\n float topLeft = getImage(b, sourceFloorCR.y, sourceFloorCR.x, d);\n float bottomLeft = getImage(b, sourceCeilCR.y, sourceFloorCR.x, d);\n float topRight = getImage(b, sourceFloorCR.y, sourceCeilCR.x, d);\n float bottomRight = getImage(b, sourceCeilCR.y, sourceCeilCR.x, d);\n\n vec2 fracCR = sourceFracIndexCR - vec2(sourceFloorCR);\n\n float top = topLeft + (topRight - topLeft) * fracCR.x;\n float bottom = bottomLeft + (bottomRight - bottomLeft) * fracCR.x;\n float newValue = top + (bottom - top) * fracCR.y;\n setOutput(newValue);\n } else {\n // Compute the coordinators of nearest neighbor point.\n ivec2 sourceNearestCR = ivec2(floor(\n sourceFracIndexCR + vec2(0.5,0.5)));\n float newValue = getImage(b, sourceNearestCR.y, sourceNearestCR.x, d);\n setOutput(newValue);\n }\n }\n "}(t.shape,e.shape,r,i,o);return this.compileAndRun(s,[t,e,n],"float32")},e.prototype.depthToSpace=function(t,e,n){E(e>1,function(){return"blockSize should be > 1 for depthToSpace, but was: "+e});var r=t.shape[0],i="NHWC"===n?t.shape[1]:t.shape[2],o="NHWC"===n?t.shape[2]:t.shape[3],s="NHWC"===n?t.shape[3]:t.shape[1],a=i*e,l=o*e,u=s/(e*e),c=new Ji("NHWC"===n?[r,a,l,u]:[r,u,a,l],e,n);return this.compileAndRun(c,[t])},e.prototype.split=function(t,e,n){return mi(t,e,n)},e.prototype.scatterND=function(t,e,n){var r=Sr(0,t,n),i=r.sliceRank,o=r.numUpdates,s=r.sliceSize,a=r.strides,l=r.outputSize,u=[l/s,s],c=t.reshape([o,i]),h=e.reshape([o,s]);if(0===l)return ni(dn([]),n);var d=fn(0),p=new Co(o,i,c.rank,h.rank,a,u);return this.compileAndRun(p,[h,c,d]).reshape(n)},e.prototype.sparseToDense=function(t,e,n,r){var i=Sr(0,t,n),o=i.sliceRank,s=i.numUpdates,a=i.strides,l=i.outputSize,u=new Co(s,o,t.rank,e.rank,a,[l,1],!1);return this.compileAndRun(u,[e,t,r]).reshape(n)},e.prototype.fft=function(t){return this.fftImpl(t,!1)},e.prototype.ifft=function(t){return this.fftImpl(t,!0)},e.prototype.fftImpl=function(t,e){var n=this.texData.get(t.dataId),r=new Zi("return real * expR - imag * expI;",t.shape,e),i=new Zi("return real * expI + imag * expR;",t.shape,e),o=[this.makeComplexComponentTensorInfo(t,n.complexTensors.real),this.makeComplexComponentTensorInfo(t,n.complexTensors.imag)],s=this.compileAndRun(r,o),a=this.compileAndRun(i,o),l=this.complex(s,a).as2D(t.shape[0],t.shape[1]);return s.dispose(),a.dispose(),l},e.prototype.gatherND=function(t,e){var n=e.shape,r=n[n.length-1],i=Tr(t,e),o=i[0],s=i[1],a=i[2],l=i[3],u=e.reshape([s,r]),c=t.reshape([t.size/a,a]),h=new function(t,e,n){this.sliceDim=t,this.strides=e,this.variableNames=["x","indices"],this.outputShape=n;var r=Di(e.length),i=Di(n.length),o=this.sliceDim>1?"strides[j]":"strides";this.userCode="\n "+r+" strides = "+r+"("+this.strides+");\n void main() {\n "+i+" coords = getOutputCoords();\n int flattenIndex = 0;\n for (int j = 0; j < "+this.sliceDim+"; j++) {\n int index = round(getIndices(coords[0], j));\n flattenIndex += index * "+o+";\n }\n setOutput(getX(flattenIndex, coords[1]));\n }\n "}(r,l,[s,a]);return this.compileAndRun(h,[c,u]).reshape(o)},e.prototype.fill=function(t,e,n){if("string"===(n=n||K(e))){var r=B(n,k(t));return r.fill(e),Pt.makeTensor(r,t,n,this)}var i=new Qi(t,e),o=i.getCustomSetupFunc(e);return this.compileAndRun(i,[],n,o)},e.prototype.onesLike=function(t){if("string"===t.dtype)throw new Error("onesLike is not supported under string dtype");return this.fill(t.shape,1,t.dtype)},e.prototype.zerosLike=function(t){return this.fill(t.shape,"string"===t.dtype?"":0,t.dtype)},e.prototype.linspace=function(t,e,n){return ri(t,e,n)},e.prototype.makeTensorInfo=function(t,e){var n=this.write(null,t,e);return this.texData.get(n).usage=null,{dataId:n,shape:t,dtype:e}},e.prototype.makeOutput=function(t,e){var n=this.makeTensorInfo(t,e).dataId;return Pt.makeTensorFromDataId(n,t,e,this)},e.prototype.unpackTensor=function(t){var e=new function(t){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!1,this.outputShape=t;var e=t.length,n=Ti("rc",e),r=Di(e),i=function(t,e){if(1===t)return"rc";for(var n="",r=0;r<t;r++)n+=e[r],r<t-1&&(n+=",");return n}(e,n),o=n.slice(-2),s=e<=1?"rc":"vec2("+o.join(",")+")";this.userCode="\n void main() {\n "+r+" rc = getOutputCoords();\n vec4 packedInput = getA("+i+");\n\n setOutput(getChannel(packedInput, "+s+"));\n }\n "}(t.shape);return this.runWebGLProgram(e,[t],t.dtype)},e.prototype.packTensor=function(t){var e=new function(t){this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0,this.outputShape=t;var e=t.length;if(0===e)this.userCode="\n void main() {\n setOutput(vec4(getA(), 0., 0., 0.));\n }\n ";else{var n=Ti("rc",e),r=Di(e),i=function(t,e,n){if(1===t)return"rc > "+e[0];for(var r="",i=t-2;i<t;i++)r+=n[i]+" >= "+e[i],i<t-1&&(r+="||");return r}(e,t,n),o=function(t,e,n,r){if(1===t)return"";var i=r.slice(-2);return"\n int r = "+i[0]+";\n int c = "+i[1]+";\n int rp1 = r + 1;\n int cp1 = c + 1;\n\n bool cEdge = cp1 >= "+e+";\n bool rEdge = rp1 >= "+n+";\n "}(e,t[t.length-1],t[t.length-2],n),s=function(t,e){var n=t.length,r=function(t,e){for(var n=[],r=0;r<=1;r++)for(var i=0;i<=1;i++){for(var o=(0===r?"r":"rp1")+", "+(0===i?"c":"cp1"),s=2;s<t;s++)o=e[e.length-1-s]+","+o;n.push(o)}return n}(n,e);return 1===n?"getA(rc),\n rc + 1 >= "+t[0]+" ? 0. : getA(rc + 1),\n 0, 0":"getA("+r[0]+"),\n cEdge ? 0. : getA("+r[1]+"),\n rEdge ? 0. : getA("+r[2]+"),\n rEdge || cEdge ? 0. : getA("+r[3]+")"}(t,n);this.userCode="\n void main() {\n "+r+" rc = getOutputCoords();\n\n if("+i+") {\n setOutput(vec4(0));\n } else {\n "+o+"\n\n setOutput(vec4("+s+"));\n }\n }\n "}}(t.shape);return this.runWebGLProgram(e,[t],t.dtype,null,!0)},e.prototype.packedReshape=function(t,e){var n=[Se(t.shape)].concat(ke(t.shape)),r={dtype:t.dtype,shape:n,dataId:t.dataId},i=new function(t,e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=t;for(var n="",r=0;r<4;r++){var i="thisRC = rc;";r%2==1&&(i+="thisRC.z += 1;"),r>1&&(i+="thisRC.y += 1;"),n+="\n "+i+"\n "+(r>0?"if(thisRC.y < rows && thisRC.z < cols){":"")+"\n int flatIndex = getFlatIndex(thisRC);\n\n ivec3 inputRC = inputCoordsFromReshapedOutCoords(flatIndex);\n vec2 inputRCInnerDims = vec2(float(inputRC.y),float(inputRC.z));\n\n result["+r+"] =\n getChannel(getA(inputRC.x, inputRC.y, inputRC.z), inputRCInnerDims);\n "+(r>0?"}":"")+"\n "}this.userCode="\n \n ivec3 inputCoordsFromReshapedOutCoords(int index) {\n "+Ei(["r","c","d"],e)+"\n return ivec3(r, c, d);\n }\n \n "+wi(t)+"\n\n void main() {\n ivec3 rc = getOutputCoords();\n\n vec4 result = vec4(0.);\n\n ivec3 thisRC;\n int rows = "+t[1]+";\n int cols = "+t[2]+";\n\n "+n+"\n\n setOutput(result);\n }\n "}([Se(e)].concat(ke(e)),n),o=this.runWebGLProgram(i,[r],t.dtype,null,!0);return{dataId:o.dataId,shape:e,dtype:o.dtype}},e.prototype.decode=function(t){var e,n=this.texData.get(t),r=n.isPacked,i=n.shape,o=n.dtype,s=Oe(i);return e=r?new function(t){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outPackingScheme=jt.DENSE;var e=Xt(t),n=xi();this.outputShape=t,this.userCode="\n ivec3 outCoordsFromFlatIndex(int index) {\n "+Ei(["r","c","d"],t)+"\n return ivec3(r, c, d);\n }\n\n void main() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2("+e[0]+", "+e[1]+"));\n int index = 4 * (resTexRC.x * "+e[1]+" + resTexRC.y);\n\n vec4 result = vec4(0.);\n\n for (int i=0; i<4; i++) {\n int flatIndex = index + i;\n ivec3 rc = outCoordsFromFlatIndex(flatIndex);\n result[i] = getChannel(getA(rc.x, rc.y, rc.z), vec2(rc.y, rc.z));\n }\n\n "+n.output+" = result;\n }\n "}(s):new function(t){this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0,this.outPackingScheme=jt.DENSE;var e=Xt(t),n=xi();this.outputShape=t,this.userCode="\n ivec3 outCoordsFromFlatIndex(int index) {\n "+Ei(["r","c","d"],t)+"\n return ivec3(r, c, d);\n }\n\n void main() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2("+e[0]+", "+e[1]+"));\n int index = 4 * (resTexRC.x * "+e[1]+" + resTexRC.y);\n\n vec4 result = vec4(0.);\n\n for (int i=0; i<4; i++) {\n int flatIndex = index + i;\n ivec3 rc = outCoordsFromFlatIndex(flatIndex);\n result[i] = getA(rc.x, rc.y, rc.z);\n }\n\n "+n.output+" = result;\n }\n "}(s),{dtype:o,shape:i,dataId:this.runWebGLProgram(e,[{shape:s,dtype:o,dataId:t}],o,null,!0).dataId}},e.prototype.runWebGLProgram=function(t,e,n,r,i){var o=this;void 0===i&&(i=!1);var s=this.makeTensorInfo(t.outputShape,n),a=this.texData.get(s.dataId);if(t.packedOutput&&(a.isPacked=!0),t.outPackingScheme===jt.DENSE){var l=Xt(t.outputShape);a.texShape=l.map(function(t){return 2*t})}if(null!=t.outTexUsage&&(a.usage=t.outTexUsage),0===k(s.shape))return a.values=F(s.dtype,0),s;var u=[],h=e.map(function(e){if("complex64"===e.dtype)throw new Error("GPGPUProgram does not support complex64 input. For complex64 dtypes, please separate the program into real and imaginary parts.");var n=o.texData.get(e.dataId);if(null==n.texture){if(!t.packedInputs&&k(e.shape)<=c().getNumber("WEBGL_SIZE_UPLOAD_UNIFORM"))return{shape:e.shape,texData:null,isUniform:!0,uniformValues:n.values};t.packedInputs&&(n.isPacked=!0,n.shape=e.shape)}else if(!!n.isPacked!=!!t.packedInputs)e=n.isPacked?o.unpackTensor(e):o.packTensor(e),u.push(e),n=o.texData.get(e.dataId);else if(n.isPacked&&!Ae(n.shape,e.shape)){var r=e,i=e.shape;e.shape=n.shape,e=o.packedReshape(e,i),u.push(e),n=o.texData.get(e.dataId),r.shape=i}return o.uploadToGPU(e.dataId),{shape:e.shape,texData:n,isUniform:!1}});this.uploadToGPU(s.dataId);var d,p={shape:s.shape,texData:a,isUniform:!1},f=function(t,e,n){var r="";h.concat(n).forEach(function(t){var e=null!=t.texData&&null!=t.texData.slice&&t.texData.slice.flatOffset>0,n=t.isUniform?"uniform":t.texData.texShape;r+=t.shape+"_"+n+"_"+e});var i=t.userCode;return t.constructor.name+"_"+r+"_"+i}(t,0,p),g=this.getAndSaveBinary(f,function(){return function(t,e,n,r){var i=e.userCode,o=n.map(function(t,n){var r={logicalShape:t.shape,texShape:t.isUniform?null:t.texData.texShape,isUniform:t.isUniform,isPacked:!t.isUniform&&t.texData.isPacked,flatOffset:null};return null!=t.texData&&null!=t.texData.slice&&t.texData.slice.flatOffset>0&&(r.flatOffset=t.texData.slice.flatOffset),{name:e.variableNames[n],shapeInfo:r}}),s=o.map(function(t){return t.shapeInfo}),a={logicalShape:r.shape,texShape:r.texData.texShape,isUniform:!1,isPacked:r.texData.isPacked,flatOffset:null},l=Si(o,a,i,e.packedInputs),u=t.createProgram(l),h=null,d=t.getUniformLocation(u,"NAN",!1);1===c().getNumber("WEBGL_VERSION")&&(h=t.getUniformLocation(u,"INFINITY",!1));for(var p={},f=0;f<e.variableNames.length;f++){var g=e.variableNames[f];p[g]=t.getUniformLocation(u,g,!1),p["offset"+g]=t.getUniformLocation(u,"offset"+g,!1)}return{program:e,source:l,webGLProgram:u,uniformLocations:p,inShapeInfos:s,outShapeInfo:a,infLoc:h,nanLoc:d}}(o.gpgpu,t,h,p)}),m=null!=this.activeTimers;if(m&&(d=this.startTimer()),function(t,e,n,r,i){yo(e.inShapeInfos,n),yo([e.outShapeInfo],[r]);var o=r.texData.texture,s=r.texData.texShape;r.texData.isPacked?t.setOutputPackedMatrixTexture(o,s[0],s[1]):t.setOutputMatrixTexture(o,s[0],s[1]),t.setProgram(e.webGLProgram),1===c().getNumber("WEBGL_VERSION")&&null!==e.infLoc&&t.gl.uniform1f(e.infLoc,1/0),null!==e.nanLoc&&t.gl.uniform1f(e.nanLoc,NaN),n.forEach(function(n,r){var i=e.program.variableNames[r],o=e.uniformLocations[i],s=e.uniformLocations["offset"+i];if(null!=o)if(n.isUniform)if(k(n.shape)<2)t.gl.uniform1f(o,n.uniformValues[0]);else{var a=n.uniformValues;a instanceof Float32Array||(a=new Float32Array(a)),t.gl.uniform1fv(o,a)}else null!=n.texData.slice&&null!=s&&t.gl.uniform1i(s,n.texData.slice.flatOffset),t.setInputMatrixTexture(n.texData.texture,o,r)}),null!=i&&i(t,e.webGLProgram),t.executeProgram()}(this.gpgpu,g,h,p,r),u.forEach(function(t){return o.disposeData(t.dataId)}),m&&(d=this.endTimer(d),this.activeTimers.push({name:t.constructor.name,query:this.getQueryTime(d)})),!c().getBool("WEBGL_LAZILY_UNPACK")&&a.isPacked&&!1===i){var v=this.unpackTensor(s);return this.disposeData(s.dataId),v}return s},e.prototype.compileAndRun=function(t,e,n,r,i){void 0===i&&(i=!1),n=n||e[0].dtype;var o=this.runWebGLProgram(t,e,n,r,i);return Pt.makeTensorFromDataId(o.dataId,o.shape,o.dtype)},e.prototype.getAndSaveBinary=function(t,e){return t in this.binaryCache||(this.binaryCache[t]=e()),this.binaryCache[t]},e.prototype.getTextureManager=function(){return this.textureManager},e.prototype.dispose=function(){var t=this;this.disposed||(c().getBool("IS_TEST")||Object.keys(this.binaryCache).forEach(function(e){t.gpgpu.deleteProgram(t.binaryCache[e].webGLProgram),delete t.binaryCache[e]}),this.textureManager.dispose(),null!=this.canvas&&"undefined"!=typeof HTMLCanvasElement&&this.canvas instanceof HTMLCanvasElement?this.canvas.remove():this.canvas=null,this.gpgpuCreatedLocally&&(this.gpgpu.program=null,this.gpgpu.dispose()),this.disposed=!0)},e.prototype.floatPrecision=function(){var t=this;return null==this.floatPrecisionValue&&(this.floatPrecisionValue=We(function(){if(!c().get("WEBGL_RENDER_FLOAT32_ENABLED")){var e=c().getBool("DEBUG");c().set("DEBUG",!1);var n=t.abs(fn(1e-8)).dataSync()[0];if(c().set("DEBUG",e),n>0)return 32}return 16})),this.floatPrecisionValue},e.prototype.epsilon=function(){return 32===this.floatPrecision()?1e-7:1e-4},e.prototype.uploadToGPU=function(t){var e,n=this.texData.get(t),r=n.shape,i=n.dtype,o=n.values,s=n.texture,a=n.usage,l=n.isPacked;if(null==s){var u,c=null!=this.activeTimers;c&&(u=nt());var h=n.texShape;if(null==h&&(h=Ie(r,l),n.texShape=h),null!=o){var d=Oe(r),p=void 0,f=h[1],g=h[0],m=o instanceof Uint8Array;l?(f=(e=Kt(h[0],h[1]))[0],p=new function(t,e,n){void 0===n&&(n=!1),this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0;var r=xi(),i=e[0],o=e[1];this.outputShape=t;var s="",a="result";n&&(a="floor(result * 255. + 0.5)");for(var l=0;l<=1;l++)for(var u=0;u<=1;u++){var c=2*l+u;s+="\n localCoords = coords;\n if(localCoords[2] + "+u+" < "+t[2]+") {\n localCoords[2] += "+u+";\n if(localCoords[1] + "+l+" < "+t[1]+") {\n localCoords[1] += "+l+";\n\n flatIndex = getFlatIndex(localCoords);\n offset = imod(flatIndex, 4);\n\n flatIndex = idiv(flatIndex, 4, 1.);\n\n r = flatIndex / "+o+";\n c = imod(flatIndex, "+o+");\n uv = (vec2(c, r) + halfCR) / vec2("+o+".0, "+i+".0);\n values = "+r.texture2D+"(A, uv);\n\n if(offset == 0) {\n result["+c+"] = values[0];\n } else if(offset == 1) {\n result["+c+"] = values[1];\n } else if(offset == 2) {\n result["+c+"] = values[2];\n } else {\n result["+c+"] = values[3];\n }\n }\n }\n "}this.userCode="\n "+wi(t)+"\n\n void main() {\n ivec3 coords = getOutputCoords();\n\n vec4 result = vec4(0.);\n int flatIndex, r, c, offset;\n ivec3 localCoords;\n vec2 uv;\n vec4 values;\n\n "+s+"\n\n "+r.output+" = "+a+";\n }\n "}(d,[g=e[1],f],m)):p=new function(t,e,n){void 0===n&&(n=!1),this.variableNames=["A"];var r=xi(),i=e[0],o=e[1];this.outputShape=t;var s="result";n&&(s="floor(result * 255. + 0.5)"),this.userCode="\n "+wi(t)+"\n\n void main() {\n ivec3 coords = getOutputCoords();\n\n int flatIndex = getFlatIndex(coords);\n int offset = imod(flatIndex, 4);\n\n flatIndex = idiv(flatIndex, 4, 1.);\n \n int r = flatIndex / "+o+";\n int c = imod(flatIndex, "+o+");\n vec2 uv = (vec2(c, r) + halfCR) / vec2("+o+".0, "+i+".0);\n vec4 values = "+r.texture2D+"(A, uv);\n\n float result;\n\n if(offset == 0) {\n result = values[0];\n } else if(offset == 1) {\n result = values[1];\n } else if(offset == 2) {\n result = values[2];\n } else {\n result = values[3];\n }\n\n "+r.output+" = vec4("+s+", 0., 0., 0.);\n }\n "}(d,[g,f],m);var v=this.makeTensorInfo([g,f],i);this.texData.get(v.dataId).usage=m?$t.PIXELS:$t.UPLOAD,this.gpgpu.uploadDenseMatrixToTexture(this.getTexture(v.dataId),f,g,o);var b=this.runWebGLProgram(p,[v],i,null,!0),_=this.texData.get(b.dataId);n.texture=_.texture,n.texShape=_.texShape,n.isPacked=_.isPacked,n.usage=_.usage,this.disposeData(v.dataId),this.texData.delete(b.dataId),n.values=null,c&&(this.uploadWaitMs+=nt()-u)}else{var y=this.acquireTexture(h,a,i,l);n.texture=y}}},e.prototype.convertAndCacheOnCPU=function(t,e){var n=this.texData.get(t),r=n.dtype;return this.releaseGPUData(t),null!=e&&(n.values=function(t,e){if("float32"===e||"complex64"===e)return t;if("int32"===e||"bool"===e){for(var n="int32"===e?new Int32Array(t.length):new Uint8Array(t.length),r=0;r<n.length;++r)n[r]=Math.round(t[r]);return n}throw new Error("Unknown dtype "+e)}(e,r)),n.values},e.prototype.acquireTexture=function(t,e,n,r){if(this.numBytesInGPU+=this.computeBytes(t,n),!this.warnedAboutMemory&&this.numBytesInGPU>1024*this.numMBBeforeWarning*1024){var i=(this.numBytesInGPU/1024/1024).toFixed(2);this.warnedAboutMemory=!0,console.warn("High memory usage in GPU: "+i+" MB, most likely due to a memory leak")}return this.textureManager.acquireTexture(t,e,r)},e.prototype.computeBytes=function(t,e){return t[0]*t[1]*H(e)},e}(Br);Ft()&&Pt.registerBackend("webgl",function(){return new es},2);var ns=ln({square_:function(t){var e=Ye(t,"x","square"),n=[e];return Pt.runKernelFunc(function(t,n){return n([e]),t.square(e)},{x:e},null,"Square",{},n,[])}}),rs="SquaredDifference",is=ln({squaredDifference_:function(t,e){var n,r=Ye(t,"a","squaredDifference"),i=Ye(e,"b","squaredDifference");n=Rt(r,i),r=n[0],i=n[1],Vr(r.shape,i.shape);var o={a:r,b:i},s=[r,i];return Pt.runKernelFunc(function(t,e){var n=t.squaredDifference(r,i);return e([r,i]),n},o,function(t,e){var n=e[0],r=e[1],i=fn(2);return{a:function(){return t.mul(n.sub(r).mul(i))},b:function(){return t.mul(r.sub(n).mul(i))}}},rs,{},s,[])}}),os=ln({abs_:function(t){var e=Ye(t,"x","abs");return"complex64"===e.dtype?Pt.runKernelFunc(function(t){return t.complexAbs(e)},{$x:e}):Pt.runKernelFunc(function(t,n){var r=t.abs(e);return n([e]),r},{x:e},function(t,e){var n=e[0];return{x:function(){return t.mul(n.toFloat().step(-1))}}},"Abs")}}),ss=ln({acos_:function(t){var e=Ye(t,"x","acos");return Pt.runKernelFunc(function(t,n){var r=t.acos(e);return n([e]),r},{$x:e},function(t,e){var n=e[0];return{$x:function(){return t.divStrict(fn(1).sub(n.toFloat().square()).sqrt()).neg()}}})}}),as=ln({acosh_:function(t){var e=Ye(t,"x","acosh");return Pt.runKernelFunc(function(t,n){var r=t.acosh(e);return n([e]),r},{$x:e},function(t,e){var n=e[0];return{$x:function(){return t.divStrict(n.toFloat().square().sub(1).sqrt())}}})}}),ls=ln({asin_:function(t){var e=Ye(t,"x","asin");return Pt.runKernelFunc(function(t,n){var r=t.asin(e);return n([e]),r},{$x:e},function(t,e){var n=e[0];return{$x:function(){return t.divStrict(fn(1).sub(n.toFloat().square()).sqrt())}}})}}),us=ln({asinh_:function(t){var e=Ye(t,"x","asinh");return Pt.runKernelFunc(function(t,n){var r=t.asinh(e);return n([e]),r},{$x:e},function(t,e){var n=e[0];return{$x:function(){return t.divStrict(fn(1).add(n.toFloat().square()).sqrt())}}})}}),cs=ln({atan_:function(t){var e=Ye(t,"x","atan");return Pt.runKernelFunc(function(t,n){var r=t.atan(e);return n([e]),r},{$x:e},function(t,e){var n=e[0];return{$x:function(){return t.div(n.toFloat().square().add(1))}}})}}),hs=ln({atanh_:function(t){var e=Ye(t,"x","atanh");return Pt.runKernelFunc(function(t,n){var r=t.atanh(e);return n([e]),r},{$x:e},function(t,e){var n=e[0];return{$x:function(){return t.div(fn(1).sub(n.toFloat().square()))}}})}}),ds=ln({ceil_:function(t){var e=Ye(t,"x","ceil");return Pt.runKernelFunc(function(t){return t.ceil(e)},{$x:e},function(t){return{$x:function(){return wn(t)}}})}}),ps=ln({clipByValue_:function(t,e,n){var r=Ye(t,"x","clipByValue");E(e<=n,function(){return"Error in clip: min ("+e+") must be less than or equal to max ("+n+")."});var i=[r],o={min:e,max:n};return Pt.runKernelFunc(function(t,i){var o=t.clip(r,e,n);return i([r]),o},{x:r},function(t,r){var i=r[0];return{x:function(){return t.where(i.greaterEqual(e).logicalAnd(i.lessEqual(n)),wn(t))}}},"ClipByValue",o,i)}}),fs=ln({cos_:function(t){var e=Ye(t,"x","cos"),n=[e];return Pt.runKernelFunc(function(t,n){var r=t.cos(e);return n([e]),r},{x:e},function(t,e){var n=e[0];return{x:function(){return n.toFloat().sin().neg().mul(t)}}},"Cos",{},n)}}),gs=ln({cosh_:function(t){var e=Ye(t,"x","cosh");return Pt.runKernelFunc(function(t,n){var r=t.cosh(e);return n([e]),r},{$x:e},function(t,e){var n=e[0];return{$x:function(){return n.toFloat().sinh().mulStrict(t)}}})}}),ms=ln({erf_:function(t){var e=Ye(t,"x","erf");return E("int32"===e.dtype||"float32"===e.dtype,function(){return"Input dtype must be `int32` or `float32`."}),"int32"===e.dtype&&(e=e.toFloat()),Pt.runKernelFunc(function(t,n){var r=t.erf(e);return n([e]),r},{$x:e},function(t,e){var n=e[0];return{$x:function(){return t.mul(n.square().neg().exp().mul(2/Math.sqrt(Math.PI)))}}})}}),vs=ln({exp_:function(t){var e=Ye(t,"x","exp");return Pt.runKernelFunc(function(t,n){var r=t.exp(e);return n([r]),r},{x:e},function(t,e){return{x:function(){return t.mulStrict(e[0])}}},"Exp",{},[],[!0])}}),bs=ln({expm1_:function(t){var e=Ye(t,"x","expm1");return Pt.runKernelFunc(function(t,n){var r=t.expm1(e);return n([e]),r},{$x:e},function(t,e){var n=e[0];return{$x:function(){return t.mul(n.exp())}}})}}),_s=ln({floor_:function(t){var e=Ye(t,"x","floor");return Pt.runKernelFunc(function(t){return t.floor(e)},{$x:e},function(t){return{$x:function(){return wn(t)}}})}}),ys=ln({log_:function(t){var e=Ye(t,"x","log"),n=[e];return Pt.runKernelFunc(function(t,n){var r=t.log(e);return n([e]),r},{x:e},function(t,e){var n=e[0];return{x:function(){return t.div(n.toFloat())}}},"Log",{},n)}}),Ts=ln({log1p_:function(t){var e=Ye(t,"x","log1p");return Pt.runKernelFunc(function(t,n){var r=t.log1p(e);return n([e]),r},{$x:e},function(t,e){var n=e[0];return{$x:function(){return t.div(n.add(1))}}})}}),xs=ln({logSigmoid_:function(t){var e=Ye(t,"x","logSigmoid");return Pt.runKernelFunc(function(t,n){var r=t.softplus(e.neg()).neg();return n([e]),r},{$x:e},function(t,e){var n=e[0];return{$x:function(){return t.mul(n.neg().sigmoid())}}})}}),Es=ln({neg_:function(t){var e=Ye(t,"x","neg"),n=[e];return Pt.runKernelFunc(function(t){return t.neg(e)},{x:e},function(t){return{x:function(){return t.neg()}}},"Neg",{},n)}}),ws=ln({reciprocal_:function(t){var e=Ye(t,"x","reciprocal");return Pt.runKernelFunc(function(t,n){var r=t.reciprocal(e);return n([e]),r},{$x:e},function(t,e){var n=e[0];return{$x:function(){return t.div(n.square().neg())}}})}}),Cs=ln({round_:function(t){var e=Ye(t,"x","round");return Pt.runKernelFunc(function(t){return t.round(e)},{$x:e},function(t){return{$x:function(){return wn(t)}}})}}),Ss=ln({rsqrt_:function(t){var e=Ye(t,"x","rsqrt"),n=[e];return Pt.runKernelFunc(function(t,n){var r=t.rsqrt(e);return n([e]),r},{x:e},function(t,e){var n=e[0];return{x:function(){return t.div(n.pow(1.5).mul(2)).neg()}}},"Rsqrt",{},n)}}),ks=ln({sigmoid_:function(t){var e=Ye(t,"x","sigmoid");return Pt.runKernelFunc(function(t,n){var r=t.sigmoid(e);return n([r]),r},{x:e},function(t,e){var n=e[0];return{x:function(){return t.mul(n.mul(fn(1).sub(n)))}}},"Sigmoid")}}),Os=ln({sign_:function(t){var e=Ye(t,"x","sign");return Pt.runKernelFunc(function(t){return t.sign(e)},{$x:e},function(t){return{$x:function(){return wn(t)}}})}}),Is=ln({isNaN_:function(t){var e=Ye(t,"x","isNaN");return Pt.runKernelFunc(function(t){return t.isNaN(e)},{$x:e},function(t){return{$x:function(){return wn(t)}}})}}),Rs=ln({isInf_:function(t){var e=Ye(t,"x","isInf");return Pt.runKernelFunc(function(t){return t.isInf(e)},{$x:e},function(t){return{$x:function(){return wn(t)}}})}}),As=ln({isFinite_:function(t){var e=Ye(t,"x","isFinite");return Pt.runKernelFunc(function(t){return t.isFinite(e)},{$x:e},function(t){return{$x:function(){return wn(t)}}})}}),Ns=ln({sin_:function(t){var e=Ye(t,"x","sin"),n=[e];return Pt.runKernelFunc(function(t,n){var r=t.sin(e);return n([e]),r},{x:e},function(t,e){var n=e[0];return{x:function(){return n.toFloat().cos().mul(t)}}},"Sin",{},n)}}),Ds=ln({sinh_:function(t){var e=Ye(t,"x","sinh");return Pt.runKernelFunc(function(t,n){var r=t.sinh(e);return n([e]),r},{$x:e},function(t,e){var n=e[0];return{$x:function(){return n.toFloat().cosh().mulStrict(t)}}})}}),Ms=ln({softplus_:function(t){var e=Ye(t,"x","softplus");return Pt.runKernelFunc(function(t,n){var r=t.softplus(e);return n([e]),r},{$x:e},function(t,e){var n=e[0];return{$x:function(){return t.mul(n.sigmoid())}}})}}),Ls=ln({sqrt_:function(t){var e=Ye(t,"x","sqrt");return Pt.runKernelFunc(function(t,n){var r=t.sqrt(e);return n([e]),r},{$x:e},function(t,e){var n=e[0];return{$x:function(){return t.div(n.toFloat().sqrt().mul(2))}}})}}),Ps=ln({step_:function(t,e){void 0===e&&(e=0);var n=Ye(t,"x","step");return Pt.runKernelFunc(function(t){return t.step(n,e)},{$x:n},function(t){return{$x:function(){return wn(t)}}})}}),Fs=ln({tan_:function(t){var e=Ye(t,"x","tan");return Pt.runKernelFunc(function(t,n){var r=t.tan(e);return n([e]),r},{$x:e},function(t,e){var n=e[0];return{$x:function(){return t.div(n.cos().square())}}})}}),Bs=ln({tanh_:function(t){var e=Ye(t,"x","tanh");return Pt.runKernelFunc(function(t,n){var r=t.tanh(e);return n([r]),r},{x:e},function(t,e){var n=e[0];return{x:function(){return fn(1).sub(n.square()).mulStrict(t)}}},"Tanh",{},null,[!0])}});function js(t,e,n,r,i,o){var s,a,l=Ye(t,"x","batchNorm"),u=Ye(e,"mean","batchNorm"),c=Ye(n,"variance","batchNorm");return null!=i&&(s=Ye(i,"scale","batchNorm")),null!=r&&(a=Ye(r,"offset","batchNorm")),E(2===l.rank,function(){return"Error in batchNorm3D: x must be rank 3 but got rank "+l.rank+"."}),E(2===u.rank||1===u.rank,function(){return"Error in batchNorm2D: mean must be rank 2 or rank 1 but got rank "+u.rank+"."}),E(2===c.rank||1===c.rank,function(){return"Error in batchNorm2D: variance must be rank 2 or rank 1 but got rank "+c.rank+"."}),null!=s&&E(2===s.rank||1===s.rank,function(){return"Error in batchNorm2D: scale must be rank 2 or rank 1 but got rank "+s.rank+"."}),null!=a&&E(2===a.rank||1===a.rank,function(){return"Error in batchNorm2D: offset must be rank 2 or rank 1 but got rank "+a.rank+"."}),Vs(l,u,c,a,s,o)}function $s(t,e,n,r,i,o){var s,a,l=Ye(t,"x","batchNorm"),u=Ye(e,"mean","batchNorm"),c=Ye(n,"variance","batchNorm");return null!=i&&(s=Ye(i,"scale","batchNorm")),null!=r&&(a=Ye(r,"offset","batchNorm")),E(3===l.rank,function(){return"Error in batchNorm3D: x must be rank 3 but got rank "+l.rank+"."}),E(3===u.rank||1===u.rank,function(){return"Error in batchNorm3D: mean must be rank 3 or rank 1 but got rank "+u.rank+"."}),E(3===c.rank||1===c.rank,function(){return"Error in batchNorm3D: variance must be rank 3 or rank 1 but got rank "+c.rank+"."}),null!=s&&E(3===s.rank||1===s.rank,function(){return"Error in batchNorm3D: scale must be rank 3 or rank 1 but got rank "+s.rank+"."}),null!=a&&E(3===a.rank||1===a.rank,function(){return"Error in batchNorm3D: offset must be rank 3 or rank 1 but got rank "+a.rank+"."}),Vs(l,u,c,a,s,o)}function Us(t,e,n,r,i,o){var s,a,l=Ye(t,"x","batchNorm"),u=Ye(e,"mean","batchNorm"),c=Ye(n,"variance","batchNorm");return null!=i&&(s=Ye(i,"scale","batchNorm")),null!=r&&(a=Ye(r,"offset","batchNorm")),E(4===l.rank,function(){return"Error in batchNorm4D: x must be rank 4 but got rank "+l.rank+"."}),E(4===u.rank||1===u.rank,function(){return"Error in batchNorm4D: mean must be rank 4 or rank 1 but got rank "+u.rank+"."}),E(4===c.rank||1===c.rank,function(){return"Error in batchNorm4D: variance must be rank 4 or rank 1 but got rank "+c.rank+"."}),null!=s&&E(4===s.rank||1===s.rank,function(){return"Error in batchNorm4D: scale must be rank 4 or rank 1 but got rank "+s.rank+"."}),null!=a&&E(4===a.rank||1===a.rank,function(){return"Error in batchNorm4D: offset must be rank 4 or rank 1 but got rank "+a.rank+"."}),Vs(l,u,c,a,s,o)}function Vs(t,e,n,r,i,o){null==o&&(o=.001);var s,a,l,u=Ye(t,"x","batchNorm"),c=Ye(e,"mean","batchNorm"),h=Ye(n,"variance","batchNorm");null!=i&&(s=Ye(i,"scale","batchNorm")),null!=r&&(a=Ye(r,"offset","batchNorm")),E(c.rank===h.rank,function(){return"Batch normalization gradient requires mean and variance to have equal ranks."}),E(null==a||c.rank===a.rank,function(){return"Batch normalization gradient requires mean and offset to have equal ranks."}),E(null==s||c.rank===s.rank,function(){return"Batch normalization gradient requires mean and scale to have equal ranks."}),l=0===u.rank||1===u.rank?u.as4D(1,1,1,u.size):2===u.rank?u.as4D(1,1,u.shape[0],u.shape[1]):3===u.rank?u.as4D(1,u.shape[0],u.shape[1],u.shape[2]):u;var d=[u,c,h,s];return Pt.runKernelFunc(function(t,e){var n=t.batchNormalization(l,Hs(c),Hs(h),o,Hs(s),Hs(a));return e([u,c,h,s]),n},{x:u,mean:c,variance:h,scale:s,offset:a},function(t,e){var n=e,r=n[0],i=n[1],s=n[2],a=n[3],u=null==a?fn(1):a,c=Ur(i.shape,l.shape),h=[];if(1===i.rank){for(var d=0;d<l.shape.length-1;++d)h.push(l.shape[d]);h.push(1)}var p=r.sub(i),f=t.mul(u),g=Ss(s.add(fn(o))),m=g.mul(g).mul(g).mul(fn(-.5));return{x:function(){return 1===i.rank?t.mul(pr(g.as4D(1,1,1,i.shape[0]),h)).mul(u).reshape(r.shape):t.mul(g).mul(u).reshape(r.shape)},mean:function(){var t=g.mul(fn(-1)).mul(f);return 1===i.rank&&(t=t.sum(c)),t.reshape(i.shape)},variance:function(){var t=m.mul(p).mul(f);return 1===i.rank&&(t=t.sum(c)),t.reshape(i.shape)},scale:function(){var e=p.mul(g),n=t.mul(e);return 1===i.rank&&(n=n.sum(c)),n.reshape(i.shape)},offset:function(){var e=t;return 1===i.rank&&(e=e.sum(c)),e.reshape(i.shape)}}},"BatchNormalization",{varianceEpsilon:o},d).reshape(u.shape)}function Hs(t){return null==t?null:0===t.rank?t.as1D():1===t.rank?t:2===t.rank?t.as4D(1,1,t.shape[0],t.shape[1]):3===t.rank?t.as4D(1,t.shape[0],t.shape[1],t.shape[2]):t}function Ws(){He("tf.batchNormalization() is going away. Use tf.batchNorm() instead, and note the positional argument change of scale, offset, and varianceEpsilon")}var Gs=ln({batchNormalization2d_:function(t,e,n,r,i,o){return void 0===r&&(r=.001),Ws(),js(t,e,n,o,i,r)}}),zs=ln({batchNormalization3d_:function(t,e,n,r,i,o){return void 0===r&&(r=.001),Ws(),$s(t,e,n,o,i,r)}}),Xs=ln({batchNormalization4d_:function(t,e,n,r,i,o){return void 0===r&&(r=.001),Ws(),Us(t,e,n,o,i,r)}}),Ks=ln({batchNormalization_:function(t,e,n,r,i,o){return void 0===r&&(r=.001),Ws(),Vs(t,e,n,o,i,r)}}),Ys=ln({batchNorm_:Vs}),qs=ln({batchNorm2d_:js}),Js=ln({batchNorm3d_:$s}),Zs=ln({batchNorm4d_:Us}),Qs=ln({logicalAnd_:function(t,e){var n=Ye(t,"a","logicalAnd","bool"),r=Ye(e,"b","logicalAnd","bool");return Vr(n.shape,r.shape),Pt.runKernelFunc(function(t){return t.logicalAnd(n,r)},{a:n,b:r},null,"LogicalAnd")}}),ta=ln({logicalNot_:function(t){var e=Ye(t,"x","logicalNot","bool");return Pt.runKernelFunc(function(t){return t.logicalNot(e)},{$x:e})}}),ea=ln({logicalOr_:function(t,e){var n=Ye(t,"a","logicalOr","bool"),r=Ye(e,"b","logicalOr","bool");return Vr(n.shape,r.shape),Pt.runKernelFunc(function(t){return t.logicalOr(n,r)},{$a:n,$b:r})}}),na=ln({logicalXor_:function(t,e){var n=Ye(t,"a","logicalXor","bool"),r=Ye(e,"b","logicalXor","bool");return Vr(n.shape,r.shape),ea(t,e).logicalAnd(Qs(t,e).logicalNot())}}),ra=ln({where_:function(t,e,n){var r=Ye(e,"a","where"),i=Ye(n,"b","where"),o=Ye(t,"condition","where","bool");return w(r.shape,i.shape,"Error in where: "),1===o.rank?E(o.shape[0]===r.shape[0],function(){return"The first dimension of `a` must match the size of `condition`."}):w(o.shape,i.shape,"Error in where: "),Pt.runKernelFunc(function(t,e){var n=t.select(o,r,i);return e([o]),n},{$condition:o,$a:r,$b:i},function(t,e){var n=e[0];return{$condition:function(){return wn(n).toFloat()},$a:function(){return t.mul(n.cast(t.dtype))},$b:function(){return t.mul(n.logicalNot().cast(t.dtype))}}})}}),ia=function(t){return a(this,void 0,void 0,function(){var e,n,r;return l(this,function(i){switch(i.label){case 0:return[4,(e=Ye(t,"condition","whereAsync","bool")).data()];case 1:return n=i.sent(),r=_i(e.shape,n),t!==e&&e.dispose(),[2,r]}})})},oa=ln({add_:function(t,e){var n,r=Ye(t,"a","add"),i=Ye(e,"b","add");n=Rt(r,i),r=n[0],i=n[1];var o=Vr(r.shape,i.shape);return Pt.runKernelFunc(function(t){return t.add(r,i)},{a:r,b:i},function(t){return{a:function(){var e=t,n=Ur(r.shape,o);return n.length>0&&(e=e.sum(n)),e.reshape(r.shape)},b:function(){var e=t,n=Ur(i.shape,o);return n.length>0&&(e=e.sum(n)),e.reshape(i.shape)}}},"Add")}}),sa=ln({addN_:function(t){E(Array.isArray(t),function(){return"The argument passed to tf.addN() must be a list of tensors"}),E(t.length>=1,function(){return"Must pass at least one tensor to tf.addN(), but got "+t.length});var e=t.map(function(t,e){return Ye(t,"tensors"+e,"addN")}),n=e[0];e.forEach(function(t){if(t.dtype!==n.dtype)throw new Error("All tensors passed to tf.addN() must have the same dtype")}),e.forEach(function(t){if(!O(t.shape,n.shape))throw new Error("All tensors passed to tf.addN() must have the same shape")});var r=e;return Pt.runKernelFunc(function(t){return t.addN(e)},r,function(t){var n={};return e.forEach(function(e,r){n[r]=function(){return t.clone()}}),n},"AddN")}}),aa=ln({addStrict_:function(t,e){var n=Ye(t,"a","addStrict"),r=Ye(e,"b","addStrict");return w(n.shape,r.shape,"Error in addStrict: "),n.add(r)}}),la=ln({atan2_:function(t,e){var n,r=Ye(t,"a","atan2"),i=Ye(e,"b","atan2");n=Rt(r,i),r=n[0],i=n[1];var o=Vr(r.shape,i.shape);return Pt.runKernelFunc(function(t,e){var n=t.atan2(r,i);return e([r,i]),n},{$a:r,$b:i},function(t,e){var n=e[0],r=e[1];return{$a:function(){var e=oa(n.square(),r.square()),i=t.mul(r.div(e)),s=Ur(n.shape,o);return s.length>0&&(i=i.sum(s)),i.reshape(n.shape)},$b:function(){var e=oa(n.square(),r.square()),i=Es(t.mul(n.div(e))),s=Ur(r.shape,o);return s.length>0&&(i=i.sum(s)),i.reshape(r.shape)}}})}}),ua=ln({div_:function(t,e){var n,r=Ye(t,"a","div"),i=Ye(e,"b","div");if(n=Rt(r,i),r=n[0],i=n[1],"int32"===r.dtype&&"int32"===i.dtype)return da(r,i);var o=Vr(r.shape,i.shape);return Pt.runKernelFunc(function(t,e){var n=t.realDivide(r,i);return e([r,i]),n},{a:r,b:i},function(t,e){var n=e[0],r=e[1];return{a:function(){var e=t.div(r.toFloat()),i=Ur(n.shape,o);return i.length>0?e.sum(i).reshape(n.shape):e},b:function(){var e=t.mul(n.toFloat()),i=Ur(r.shape,o);i.length>0&&(e=e.sum(i).reshape(r.shape));var s=r.square();return e.div(s.toFloat()).neg()}}},"Div")}}),ca=ln({divNoNan_:function(t,e){var n,r=Ye(t,"a","div"),i=Ye(e,"b","div");r=(n=Rt(r,i))[0],i=n[1];var o=ua(r,i),s=wn(o),a=i.equal(s);return ra(a,s,o)}}),ha=ln({divStrict_:function(t,e){var n=Ye(t,"a","div"),r=Ye(e,"b","div");return w(n.shape,r.shape,"Error in divideStrict: "),n.div(r)}}),da=ln({floorDiv_:function(t,e){var n,r=Ye(t,"a","floorDiv"),i=Ye(e,"b","floorDiv");n=Rt(r,i),r=n[0],i=n[1];var o=Vr(r.shape,i.shape);return Pt.runKernelFunc(function(t,e){var n=t.floorDiv(r,i);return e([r,i]),n},{a:r,b:i},function(t,e){var n=e[0],r=e[1];return{a:function(){var e=t.div(r.toFloat()),i=Ur(n.shape,o);return i.length>0?e.sum(i).reshape(n.shape):e},b:function(){var e=t.mul(n.toFloat()),i=Ur(r.shape,o);i.length>0&&(e=e.sum(i).reshape(r.shape));var s=r.square();return e.div(s.toFloat()).neg()}}},"FloorDiv")}}),pa=ln({maximum_:function(t,e){var n,r=Ye(t,"a","maximum"),i=Ye(e,"b","maximum");return n=Rt(r,i),r=n[0],i=n[1],"bool"===r.dtype&&(r=r.toInt(),i=i.toInt()),Vr(r.shape,i.shape),Pt.runKernelFunc(function(t,e){var n=t.maximum(r,i);return e([r,i]),n},{a:r,b:i},function(t,e){var n=e[0],r=e[1];return{a:function(){return t.mul(n.greaterEqual(r).toFloat())},b:function(){return t.mul(n.less(r).toFloat())}}},"Maximum")}}),fa=ln({maximumStrict_:function(t,e){var n=Ye(t,"a","maximumStrict"),r=Ye(e,"b","maximumStrict");return w(n.shape,r.shape,"Error in maximumStrict: "),n.maximum(r)}}),ga=ln({minimum_:function(t,e){var n,r=Ye(t,"a","minimum"),i=Ye(e,"b","minimum");return n=Rt(r,i),r=n[0],i=n[1],"bool"===r.dtype&&(r=r.toInt(),i=i.toInt()),Vr(r.shape,i.shape),Pt.runKernelFunc(function(t,e){var n=t.minimum(r,i);return e([r,i]),n},{a:r,b:i},function(t,e){var n=e[0],r=e[1];return{a:function(){return t.mul(n.lessEqual(r).toFloat())},b:function(){return t.mul(n.greater(r).toFloat())}}},"Minimum")}}),ma=ln({minimumStrict_:function(t,e){var n=Ye(t,"a","minimumStrict"),r=Ye(e,"b","minimumStrict");return w(n.shape,r.shape,"Error in minimumStrict: "),n.minimum(r)}}),va=ln({mod_:function(t,e){var n,r=Ye(t,"a","mod"),i=Ye(e,"b","mod");n=Rt(r,i),r=n[0],i=n[1];var o=Vr(r.shape,i.shape);return Pt.runKernelFunc(function(t,e){var n=t.mod(r,i);return e([r,i]),n},{$a:r,$b:i},function(t,e){var n=e[0],r=e[1];return{$a:function(){var e=Ur(n.shape,o);return e.length>0?t.sum(e).reshape(n.shape):t},$b:function(){var e=t.mul(n.div(r).floor().neg()),i=Ur(r.shape,o);return i.length>0?e.sum(i).reshape(r.shape):e}}})}}),ba=ln({modStrict_:function(t,e){var n=Ye(t,"a","modStrict"),r=Ye(e,"b","modStrict");return w(n.shape,r.shape,"Error in modStrict: "),n.mod(r)}}),_a=ln({mul_:function(t,e){var n,r=Ye(t,"a","mul"),i=Ye(e,"b","mul");n=Rt(r,i),r=n[0],i=n[1];var o=Vr(r.shape,i.shape);return Pt.runKernelFunc(function(t,e){var n=t.multiply(r,i);return e([r,i]),n},{a:r,b:i},function(t,e){var n=e[0],r=e[1];return{a:function(){var e=t.mul(r.toFloat()),i=Ur(n.shape,o);return i.length>0?e.sum(i).reshape(n.shape):e},b:function(){var e=t.mul(n.toFloat()),i=Ur(r.shape,o);return i.length>0?e.sum(i).reshape(r.shape):e}}},"Mul")}}),ya=ln({mulStrict_:function(t,e){var n=Ye(t,"a","mul"),r=Ye(e,"b","mul");return w(n.shape,r.shape,"Error in multiplyStrict: "),n.mul(r)}}),Ta=ln({pow_:function(t,e){var n,r=Ye(t,"base","pow"),i=Ye(e,"exp","pow");n=Rt(r,i),r=n[0],i=n[1];var o=Vr(r.shape,i.shape),s=[r,i];return Pt.runKernelFunc(function(t,e){var n=t.pow(r,i);return e([r,i,n]),n},{a:r,b:i},function(t,e){var n=e[0],r=e[1],i=e[2];return{a:function(){var e=r.toFloat(),i=t.mul(e.mul(n.pow(e.sub(fn(1))))),s=Ur(n.shape,o);return s.length>0&&(i=i.sum(s)),i.reshape(n.shape)},b:function(){var e=n.greater(0),s=n.log().where(e,wn(n)),a=t.mul(i.mul(s)),l=Ur(r.shape,o);return l.length>0&&(a=a.sum(l)),a.reshape(r.shape)}}},"Pow",{},s,[!0])}}),xa=ln({powStrict_:function(t,e){return w(t.shape,e.shape,"Error in powStrict: "),t.pow(e)}}),Ea=ln({squaredDifferenceStrict_:function(t,e){var n=Ye(t,"a","squaredDifferenceStrict"),r=Ye(e,"b","squaredDifferenceStrict");return w(n.shape,r.shape,"Error in squaredDifferenceStrict: "),n.squaredDifference(r)}}),wa=ln({sub_:function(t,e){var n,r=Ye(t,"a","sub"),i=Ye(e,"b","sub");n=Rt(r,i),r=n[0],i=n[1];var o=Vr(r.shape,i.shape);return Pt.runKernelFunc(function(t){return t.subtract(r,i)},{a:r,b:i},function(t){return{a:function(){var e=t,n=Ur(r.shape,o);return n.length>0&&(e=e.sum(n)),e.reshape(r.shape)},b:function(){var e=t,n=Ur(i.shape,o);return n.length>0&&(e=e.sum(n)),e.neg().reshape(i.shape)}}},"Sub")}}),Ca=ln({subStrict_:function(t,e){var n=Ye(t,"a","subStrict"),r=Ye(e,"b","subStrict");return w(n.shape,r.shape,"Error in subStrict: "),n.sub(r)}}),Sa=ln({equal_:function(t,e){var n,r=Ye(t,"a","equal"),i=Ye(e,"b","equal");return n=Rt(r,i),r=n[0],i=n[1],Vr(r.shape,i.shape),Pt.runKernelFunc(function(t){return t.equal(r,i)},{$a:r,$b:i})}}),ka=ln({equalStrict_:function(t,e){var n=Ye(t,"a","equalStrict"),r=Ye(e,"b","equalStrict");return w(n.shape,r.shape,"Error in equalStrict: "),n.equal(r)}}),Oa=ln({greater_:function(t,e){var n,r=Ye(t,"a","greater"),i=Ye(e,"b","greater");return n=Rt(r,i),r=n[0],i=n[1],Vr(r.shape,i.shape),Pt.runKernelFunc(function(t){return t.greater(r,i)},{a:r,b:i},null,"Greater")}}),Ia=ln({greaterEqual_:function(t,e){var n,r=Ye(t,"a","greaterEqual"),i=Ye(e,"b","greaterEqual");return n=Rt(r,i),r=n[0],i=n[1],Vr(r.shape,i.shape),Pt.runKernelFunc(function(t,e){var n=t.greaterEqual(r,i);return e([r,i]),n},{a:r,b:i},function(t,e){var n=e[0],r=e[1];return{a:function(){return wn(n)},b:function(){return wn(r)}}},"GreaterEqual")}}),Ra=ln({greaterEqualStrict_:function(t,e){var n=Ye(t,"a","greaterEqualStrict"),r=Ye(e,"b","greaterEqualStrict");return w(n.shape,r.shape,"Error in greaterEqualStrict: "),n.greaterEqual(r)}}),Aa=ln({greaterStrict_:function(t,e){var n=Ye(t,"a","greaterStrict"),r=Ye(e,"b","greaterStrict");return w(n.shape,r.shape,"Error in greaterStrict: "),n.greater(r)}}),Na=ln({less_:function(t,e){var n,r=Ye(t,"a","less"),i=Ye(e,"b","less");return n=Rt(r,i),r=n[0],i=n[1],Vr(r.shape,i.shape),Pt.runKernelFunc(function(t){return t.less(r,i)},{a:r,b:i},null,"Less")}}),Da=ln({lessEqual_:function(t,e){var n,r=Ye(t,"a","lessEqual"),i=Ye(e,"b","lessEqual");return n=Rt(r,i),r=n[0],i=n[1],Vr(r.shape,i.shape),Pt.runKernelFunc(function(t,e){var n=t.lessEqual(r,i);return e([r,i]),n},{a:r,b:i},null,"LessEqual")}}),Ma=ln({lessEqualStrict_:function(t,e){var n=Ye(t,"a","lessEqualStrict"),r=Ye(e,"b","lessEqualStrict");return w(n.shape,r.shape,"Error in lessEqualStrict: "),n.lessEqual(r)}}),La=ln({lessStrict_:function(t,e){var n=Ye(t,"a","lessStrict"),r=Ye(e,"b","lessStrict");return w(n.shape,r.shape,"Error in lessStrict: "),n.less(r)}}),Pa=ln({notEqual_:function(t,e){var n,r=Ye(t,"a","notEqual"),i=Ye(e,"b","notEqual");return n=Rt(r,i),r=n[0],i=n[1],Vr(r.shape,i.shape),Pt.runKernelFunc(function(t){return t.notEqual(r,i)},{a:r,b:i},null,"NotEqual")}}),Fa=ln({notEqualStrict_:function(t,e){var n=Ye(t,"a","notEqualStrict"),r=Ye(e,"b","notEqualStrict");return w(n.shape,r.shape,"Error in notEqualStrict: "),n.notEqual(r)}});function Ba(t,e){for(var n=[],r=t;r<e;++r)n.push(r);return n}function ja(t){for(var e=[],n=0;n<t.length;++n)for(var r=0;r<t[n].length;++r)e.push(t[n][r]);return e}var $a=ln({gather_:function(t,e,n){void 0===n&&(n=0);var r=Ye(t,"x","gather"),i=Ye(e,"indices","gather","int32");n=L(n,r.shape)[0];var o=function(t,e,n){for(var r=t.shape[n],i=[],o=1,s=1,a=0;a<n;a++)i.push(t.shape[a]),o*=t.shape[a];for(a=0;a<e.rank;a++)i.push(e.shape[a]);for(a=n+1;a<t.rank;a++)i.push(t.shape[a]),s*=t.shape[a];return{batchSize:o,sliceSize:s,dimSize:r,outputShape:i}}(r,i,n);return Pt.runKernelFunc(function(t,e){var o=t.gather(r,i.flatten(),n);return e([i]),o},{x:r,indices:i},function(t,e){var i=e[0];return{x:function(){var e=r.shape,o=i.size,s=e.slice(0,n),a=s.length,l=e.slice(n,e.length).slice(1),u=l.length,c=Ba(0,a),h=Ba(a+1,a+1+u),d=ja([s,[o],l]),p=t.reshape(d),f=i.reshape([o]),g=ja([[a],c,h]),m=p.transpose(g),v=Ua(m,f,r.shape[n]),b=rn(g);return v.transpose(b)},indices:function(){return i}}},"Gather",{axis:n}).reshape(o.outputShape)}}),Ua=ln({unsortedSegmentSum_:function(t,e,n){var r=Ye(t,"x","unsortedSegmentSum"),i=Ye(e,"segmentIds","unsortedSegmentSum","int32");return E(I(n),function(){return"numSegments must be of dtype int"}),Pt.runKernelFunc(function(t,e){var o=t.unsortedSegmentSum(r,i,n);return e([i]),o},{$x:r},function(t,e){var n=e[0];return{$x:function(){return function(t,e){for(var n=pa(e,wn(e)),r=$a(t,n),i=Ia(e,fn(0,"int32")),o=r.rank-i.rank,s=0;s<o;++s)i=qn(i,s+1);i=Qs(i,_n(r.shape,"bool"));var a=wn(r);return ra(i,r,a)}(t,n)}}})}});function Va(t,e,n,r,i,o,s){void 0===o&&(o="NHWC"),E(t.length===e.rank,function(){return"Length of inShape ("+t.length+") and rank of dy ("+e.rank+") must match"});var a=t,l=e,u=!1;3===e.rank&&(u=!0,l=e.as4D(1,e.shape[0],e.shape[1],e.shape[2]),a=[1,t[0],t[1],t[2]]),E(4===a.length,function(){return"Error in conv2dDerInput: inShape must be length 4, but got length "+a.length+"."}),E(4===l.rank,function(){return"Error in conv2dDerInput: dy must be rank 4, but got rank "+l.rank}),E(4===n.rank,function(){return"Error in conv2dDerInput: filter must be rank 4, but got rank "+n.rank});var c="NHWC"===o?a[3]:a[1],h="NHWC"===o?l.shape[3]:l.shape[1];E(c===n.shape[2],function(){return"Error in conv2dDerInput: depth of input ("+c+") must match input depth for filter "+n.shape[2]+"."}),E(h===n.shape[3],function(){return"Error in conv2dDerInput: depth of output ("+h+") must match output depth for filter "+n.shape[3]+"."}),null!=s&&E(I(i),function(){return"Error in conv2dDerInput: pad must be an integer when using, dimRoundingMode "+s+" but got pad "+i+"."});var d=ti(o),p=Gr(a,n.shape,r,1,i,s,!1,d),f=Pt.runKernelFunc(function(t,e){var r=t.conv2dDerInput(l,n,p);return e([n,l]),r},{dy4D:l,filter:n},function(t,e){var n=e[0],a=e[1];return{dy4D:function(){return za(t,n,r,i,o,1,s)},filter:function(){return Ka(t,a,n.shape,r,i,o,s)}}});return u?f.as3D(f.shape[1],f.shape[2],f.shape[3]):f}function Ha(t){var e=function(t){return"number"==typeof t?[t,t,t]:2===t.length?[t[0],t[1],1]:t}(t),n=e[0],r=e[1],i=e[2];return 1===n&&1===r&&1===i}function Wa(t,e,n,r,i){E(t.length===e.rank,function(){return"Length of inShape ("+t.length+") and rank of dy ("+e.rank+") must match"});var o=t,s=e,a=!1;4===e.rank&&(a=!0,s=e.as5D(1,e.shape[0],e.shape[1],e.shape[2],e.shape[3]),o=[1,t[0],t[1],t[2],t[3]]);var l=o[4],u=s.shape[4];E(5===o.length,function(){return"Error in conv3dDerInput: inShape must be length 5, but got length "+o.length+"."}),E(5===s.rank,function(){return"Error in conv3dDerInput: dy must be rank 5, but got rank "+s.rank}),E(5===n.rank,function(){return"Error in conv3dDerInput: filter must be rank 5, but got rank "+n.rank}),E(l===n.shape[3],function(){return"Error in conv3dDerInput: depth of input ("+l+") must match input depth for filter "+n.shape[3]+"."}),E(u===n.shape[4],function(){return"Error in conv3dDerInput: depth of output ("+u+") must match output depth for filter "+n.shape[4]+"."});var c=zr(o,n.shape,r,1,i),h=Pt.runKernelFunc(function(t){return t.conv3dDerInput(s,n,c)},{dy5D:s});return a?h.as4D(h.shape[1],h.shape[2],h.shape[3],h.shape[4]):h}var Ga=ln({conv1d_:function(t,e,n,r,i,o,s){void 0===i&&(i="NWC"),void 0===o&&(o=1);var a=Ye(t,"x","conv1d"),l=Ye(e,"filter","conv1d"),u=a,c=!1;2===a.rank&&(c=!0,u=a.as3D(1,a.shape[0],a.shape[1])),E(3===u.rank,function(){return"Error in conv1d: input must be rank 3, but got rank "+u.rank+"."}),E(3===l.rank,function(){return"Error in conv1d: filter must be rank 3, but got rank "+l.rank+"."}),null!=s&&E(I(r),function(){return"Error in conv1d: pad must be an integer when using, dimRoundingMode "+s+" but got pad "+r+"."}),E(u.shape[2]===l.shape[1],function(){return"Error in conv1d: depth of input ("+u.shape[2]+") must match input depth for filter "+l.shape[1]+"."}),E(Qr(n,o),function(){return"Error in conv1D: Either stride or dilation must be 1. Got stride "+n+" and dilation '"+o+"'"}),E("NWC"===i,function(){return"Error in conv1d: got dataFormat of "+i+" but only NWC is currently supported."});var h=l.as4D(1,l.shape[0],l.shape[1],l.shape[2]),d=u.as4D(u.shape[0],1,u.shape[1],u.shape[2]),p=za(d,h,[1,n],r,"NHWC",[1,o],s);return c?p.as2D(p.shape[2],p.shape[3]):p.as3D(p.shape[0],p.shape[2],p.shape[3])}}),za=ln({conv2d_:function(t,e,n,r,i,o,s){void 0===i&&(i="NHWC"),void 0===o&&(o=[1,1]);var a=Ye(t,"x","conv2d"),l=Ye(e,"filter","conv2d"),u=a,c=!1;3===a.rank&&(c=!0,u=a.as4D(1,a.shape[0],a.shape[1],a.shape[2])),E(4===u.rank,function(){return"Error in conv2d: input must be rank 4, but got rank "+u.rank+"."}),E(4===l.rank,function(){return"Error in conv2d: filter must be rank 4, but got rank "+l.rank+"."}),null!=s&&E(I(r),function(){return"Error in conv2d: pad must be an integer when using, dimRoundingMode "+s+" but got pad "+r+"."});var h="NHWC"===i?u.shape[3]:u.shape[1];E(h===l.shape[2],function(){return"Error in conv2d: depth of input ("+h+") must match input depth for filter "+l.shape[2]+"."}),E(Qr(n,o),function(){return"Error in conv2D: Either strides or dilations must be 1. Got strides "+n+" and dilations '"+o+"'"});var d=ti(i),p=Gr(u.shape,l.shape,n,o,r,s,!1,d),f=[l,u],g=Pt.runKernelFunc(function(t,e){var n=t.conv2d(u,l,p);return e([l,u]),n},{x:u,filter:l},function(t,e){var s=e,a=s[0],l=s[1];return E(Zr(o),function(){return"Error in gradient of conv2D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '"+o+"'"}),{x:function(){return Ya(l.shape,t,a,n,r,i)},filter:function(){return Ka(l,t,a.shape,n,r,i)}}},"Conv2D",p,f);return c?g.as3D(g.shape[1],g.shape[2],g.shape[3]):g}}),Xa=ln({conv3d_:function(t,e,n,r,i,o){void 0===i&&(i="NDHWC"),void 0===o&&(o=[1,1,1]);var s=Ye(t,"x","conv3d"),a=Ye(e,"filter","conv3d"),l=s,u=!1;4===s.rank&&(u=!0,l=s.as5D(1,s.shape[0],s.shape[1],s.shape[2],s.shape[3])),E(5===l.rank,function(){return"Error in conv3d: input must be rank 5, but got rank "+l.rank+"."}),E(5===a.rank,function(){return"Error in conv3d: filter must be rank 5, but got rank "+a.rank+"."}),E(l.shape[4]===a.shape[3],function(){return"Error in conv3d: depth of input ("+l.shape[4]+") must match input depth for filter "+a.shape[3]+"."}),E(function(t,e){return Ha(n)||Ha(e)}(0,o),function(){return"Error in conv3D: Either strides or dilations must be 1. Got strides "+n+" and dilations '"+o+"'"}),E("NDHWC"===i,function(){return"Error in conv3d: got dataFormat of "+i+" but only NDHWC is currently supported."});var c=zr(l.shape,a.shape,n,o,r),h=Pt.runKernelFunc(function(t,e){var n=t.conv3d(l,a,c);return e([l,a]),n},{x:l,$filter:a},function(t,e){E(Ha(o),function(){return"Error in gradient of conv3D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '"+o+"'"});var i=e[0],s=e[1];return{x:function(){return Wa(i.shape,t,s,n,r)},$filter:function(){return function(t,e,n,r,i){var o=t;4===t.rank&&(o=t.as5D(1,t.shape[0],t.shape[1],t.shape[2],t.shape[3]));var s=e;4===s.rank&&(s=e.as5D(1,e.shape[0],e.shape[1],e.shape[2],e.shape[3])),E(5===o.rank,function(){return"Error in conv3dDerFilter: input must be rank 5, but got shape "+o.shape+"."}),E(5===s.rank,function(){return"Error in conv3dDerFilter: dy must be rank 5, but got shape "+s.shape+"."}),E(5===n.length,function(){return"Error in conv3dDerFilter: filterShape must be length 5, but got "+n+"."}),E(o.shape[4]===n[3],function(){return"Error in conv3dDerFilter: depth of input "+o.shape[4]+") must match input depth in filter ("+n[3]+"."}),E(s.shape[4]===n[4],function(){return"Error in conv3dDerFilter: depth of dy ("+s.shape[4]+") must match output depth for filter ("+n[4]+")."});var a=zr(o.shape,n,r,1,i);return Pt.runKernelFunc(function(t){return t.conv3dDerFilter(o,s,a)},{x5D:o,dy5D:s})}(i,t,s.shape,n,r)}}});return u?h.as4D(h.shape[1],h.shape[2],h.shape[3],h.shape[4]):h}}),Ka=ln({conv2dDerFilter_:function(t,e,n,r,i,o,s){void 0===o&&(o="NHWC");var a=t;3===t.rank&&(a=t.as4D(1,t.shape[0],t.shape[1],t.shape[2]));var l=e;3===l.rank&&(l=e.as4D(1,e.shape[0],e.shape[1],e.shape[2])),E(4===a.rank,function(){return"Error in conv2dDerFilter: input must be rank 4, but got shape "+a.shape+"."}),E(4===l.rank,function(){return"Error in conv2dDerFilter: dy must be rank 4, but got shape "+l.shape+"."}),E(4===n.length,function(){return"Error in conv2dDerFilter: filterShape must be length 4, but got "+n+"."});var u="NHWC"===o?a.shape[3]:a.shape[1],c="NHWC"===o?l.shape[3]:l.shape[1];E(u===n[2],function(){return"Error in conv2dDerFilter: depth of input "+u+") must match input depth in filter ("+n[2]+"."}),E(c===n[3],function(){return"Error in conv2dDerFilter: depth of dy ("+c+") must match output depth for filter ("+n[3]+")."}),null!=s&&E(I(i),function(){return"Error in conv2dDerFilter: pad must be an integer when using, dimRoundingMode "+s+" but got pad "+i+"."});var h=ti(o),d=Gr(a.shape,n,r,1,i,s,!1,h);return Pt.runKernelFunc(function(t){return t.conv2dDerFilter(a,l,d)},{x4D:a,dy4D:l})}}),Ya=ln({conv2dDerInput_:Va}),qa=ln({depthwiseConv2d_:function(t,e,n,r,i,o,s){void 0===i&&(i="NHWC"),void 0===o&&(o=[1,1]);var a=Ye(t,"x","depthwiseConv2d"),l=Ye(e,"filter","depthwiseConv2d"),u=a,c=!1;3===a.rank&&(c=!0,u=a.as4D(1,a.shape[0],a.shape[1],a.shape[2])),E(4===u.rank,function(){return"Error in depthwiseConv2d: input must be rank 4, but got rank "+u.rank+"."}),E(4===l.rank,function(){return"Error in depthwiseConv2d: filter must be rank 4, but got rank "+l.rank+"."}),E(u.shape[3]===l.shape[2],function(){return"Error in depthwiseConv2d: number of input channels ("+u.shape[3]+") must match the inChannels dimension in filter "+l.shape[2]+"."}),null==o&&(o=[1,1]),E(Qr(n,o),function(){return"Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides "+n+" and dilations '"+o+"'"}),null!=s&&E(I(r),function(){return"Error in depthwiseConv2d: pad must be an integer when using, dimRoundingMode "+s+" but got pad "+r+"."});var h=Gr(u.shape,l.shape,n,o,r,s,!0),d=[u,l],p=Pt.runKernelFunc(function(t,e){var n=t.depthwiseConv2D(u,l,h);return e([u,l]),n},{x:u,filter:l},function(t,e){E(Zr(o),function(){return"Error in gradient of depthwiseConv2d: dilation rates greater than 1 are not yet supported. Got dilations '"+o+"'"});var n=e[0],r=e[1];return{x:function(){return Ja(n.shape,t,r,h)},filter:function(){return Za(n,t,r.shape,h)}}},"DepthwiseConv2dNative",h,d);return c?p.as3D(p.shape[1],p.shape[2],p.shape[3]):p}}),Ja=ln({depthwiseConv2dDerInput_:function(t,e,n,r){var i=e,o=!1;3===e.rank&&(o=!0,i=e.as4D(1,e.shape[0],e.shape[1],e.shape[2]));var s=Pt.runKernelFunc(function(t){return t.depthwiseConv2DDerInput(i,n,r)},{dy4D:i});return o?s.as3D(s.shape[1],s.shape[2],s.shape[3]):s}}),Za=ln({depthwiseConv2dDerFilter_:function(t,e,n,r){var i=t;3===t.rank&&(i=t.as4D(1,t.shape[0],t.shape[1],t.shape[2]));var o=e;return 3===o.rank&&(o=e.as4D(1,e.shape[0],e.shape[1],e.shape[2])),Pt.runKernelFunc(function(t){return t.depthwiseConv2DDerFilter(i,o,r)},{x4D:i,dy4D:o})}}),Qa=ln({separableConv2d_:function(t,e,n,r,i,o,s){void 0===o&&(o=[1,1]),void 0===s&&(s="NHWC");var a=Ye(t,"x","separableConv2d"),l=Ye(e,"depthwiseFilter","separableConv2d"),u=Ye(n,"pointwiseFilter","separableConv2d"),c=a,h=!1;if(3===a.rank&&(h=!0,c=a.as4D(1,a.shape[0],a.shape[1],a.shape[2])),"NCHW"===s)throw new Error("separableConv2d currently does not support dataFormat NCHW; only NHWC is supported");E(4===c.rank,function(){return"Error in separableConv2d: input must be rank 4, but got rank "+c.rank+"."}),E(4===l.rank,function(){return"Error in separableConv2d: depthwise filter must be rank 4, but got rank "+l.rank+"."}),E(4===u.rank,function(){return"Error in separableConv2d: pointwise filter must be rank 4, but got rank "+l.rank+"."}),E(1===u.shape[0],function(){return"Error in separableConv2d: the first dimension of pointwise filter must be 1, but got "+u.shape[0]+"."}),E(1===u.shape[1],function(){return"Error in separableConv2d: the second dimension of pointwise filter must be 1, but got "+u.shape[1]+"."});var d=l.shape[2],p=l.shape[3];E(u.shape[2]===d*p,function(){return"Error in separableConv2d: the third dimension of pointwise filter must be "+d*p+", but got "+u.shape[2]+"."});var f=qa(c,l,r,i,s,o),g=za(f,u,1,"valid",s);return h?g.as3D(g.shape[1],g.shape[2],g.shape[3]):g}}),tl=ln({conv2dTranspose_:function(t,e,n,r,i,o){return Va(n,Ye(t,"x","conv2dTranspose"),Ye(e,"filter","conv2dTranspose"),r,i,"NHWC",o)}}),el=ln({conv3dTranspose_:function(t,e,n,r,i){return Wa(n,Ye(t,"x","conv3dTranspose"),Ye(e,"filter","conv3dTranspose"),r,i)}}),nl=ln({matMul_:function(t,e,n,r){var i;void 0===n&&(n=!1),void 0===r&&(r=!1);var o=Ye(t,"a","matMul"),s=Ye(e,"b","matMul");i=Rt(o,s),o=i[0],s=i[1];var a=n?o.shape[o.rank-2]:o.shape[o.rank-1],l=r?s.shape[s.rank-1]:s.shape[s.rank-2],u=n?o.shape[o.rank-1]:o.shape[o.rank-2],c=r?s.shape[s.rank-2]:s.shape[s.rank-1],h=o.shape.slice(0,-2),d=s.shape.slice(0,-2),p=k(h),f=k(d);E(o.rank>=2&&s.rank>=2&&o.rank===s.rank,function(){return"Error in matMul: inputs must have the same rank of at least 2, got ranks "+o.rank+" and "+s.rank+"."}),E(O(h,d),function(){return"Error in matMul: outer dimensions ("+h+") and ("+d+") of Tensors with shapes "+o.shape+" and "+s.shape+" must match."}),E(a===l,function(){return"Error in matMul: inner shapes ("+a+") and ("+l+") of Tensors with shapes "+o.shape+" and "+s.shape+" and transposeA="+n+" and transposeB="+r+" must match."});var g=o.shape.slice(0,-2).concat([u,c]),m=n?o.as3D(p,a,u):o.as3D(p,u,a),v=r?s.as3D(f,c,l):s.as3D(f,l,c),b={transposeA:n,transposeB:r};return Pt.runKernelFunc(function(t,e){var i=t.batchMatMul(m,v,n,r);return e([m,v]),i},{a:m,b:v},function(t,e){var i=e,o=i[0],s=i[1];return n||r?!n&&r?{a:function(){return t.matMul(s,!1,!1)},b:function(){return t.matMul(o,!0,!1)}}:n&&!r?{a:function(){return s.matMul(t,!1,!0)},b:function(){return o.matMul(t,!1,!1)}}:{a:function(){return s.matMul(t,!0,!0)},b:function(){return t.matMul(o,!0,!0)}}:{a:function(){return t.matMul(s,!1,!0)},b:function(){return o.matMul(t,!0,!1)}}},"BatchMatMul",b).reshape(g)}}),rl=ln({dot_:function(t,e){var n=Ye(t,"t1","dot"),r=Ye(e,"t2","dot");E(!(1!==n.rank&&2!==n.rank||1!==r.rank&&2!==r.rank),function(){return"Error in dot: inputs must all be rank 1 or 2, but got ranks "+n.rank+" and "+r.rank+"."});var i=1===n.rank?n.size:n.shape[1],o=1===r.rank?r.size:r.shape[0];return E(i===o,function(){return"Error in dot: inner dimensions of inputs must match, but got "+i+" and "+o+"."}),1===n.rank&&1===r.rank?n.as2D(1,-1).matMul(r.as2D(-1,1)).asScalar():1===n.rank&&2===r.rank?n.as2D(1,-1).matMul(r.as2D(r.shape[0],r.shape[1])).as1D():2===n.rank&&1===r.rank?n.matMul(r.as2D(-1,1)).as1D():n.matMul(r.as2D(r.shape[0],r.shape[1]))}}),il=ln({outerProduct_:function(t,e){var n=Ye(t,"v1","outerProduct"),r=Ye(e,"v2","outerProduct");return E(1===n.rank&&1===r.rank,function(){return"Error in outerProduct: inputs must be rank 1, but got ranks "+n.rank+" and "+r.rank+"."}),n.as2D(-1,1).matMul(r.as2D(1,-1))}}),ol=ln({reverse_:function(t,e){var n=Ye(t,"x","reverse");if(0===n.rank)return n.clone();var r=L(e,n.shape);return Pt.runKernelFunc(function(t){return t.reverse(n,r)},{$x:n},function(t){return{$x:function(){return t.reverse(r)}}}).reshapeAs(n)}}),sl=ln({reverse1d_:function(t){var e=Ye(t,"x","reverse");return E(1===e.rank,function(){return"Error in reverse1D: x must be rank 1 but got rank "+e.rank+"."}),ol(e,0)}}),al=ln({reverse2d_:function(t,e){var n=Ye(t,"x","reverse");return E(2===n.rank,function(){return"Error in reverse2D: x must be rank 2 but got rank "+n.rank+"."}),ol(n,e)}}),ll=ln({reverse3d_:function(t,e){var n=Ye(t,"x","reverse");return E(3===n.rank,function(){return"Error in reverse3D: x must be rank 3 but got rank "+n.rank+"."}),ol(n,e)}}),ul=ln({reverse4d_:function(t,e){var n=Ye(t,"x","reverse");return E(4===n.rank,function(){return"Error in reverse4D: x must be rank 4 but got rank "+n.rank+"."}),ol(n,e)}});function cl(t,e,n,r,i,o){var s=Ye(t,"x","maxPool"),a=s,l=!1;3===s.rank&&(l=!0,a=s.as4D(1,s.shape[0],s.shape[1],s.shape[2])),null==r&&(r=[1,1]),E(4===a.rank,function(){return"Error in maxPool: input must be rank 4 but got rank "+a.rank+"."}),E(Qr(n,r),function(){return"Error in maxPool: Either strides or dilations must be 1. Got strides "+n+" and dilations '"+r+"'"}),null!=o&&E(I(i),function(){return"Error in maxPool: pad must be an integer when using, dimRoundingMode "+o+" but got pad "+i+"."});var u=Hr(a.shape,e,n,r,i,o);if(1===u.filterWidth&&1===u.filterHeight&&O(u.inShape,u.outShape))return s.clone();var c=[a],h=Pt.runKernelFunc(function(t,e){var n=t.maxPool(a,u);return e([a,n]),n},{x:a},function(t,o){var s=o[0],a=o[1];return{x:function(){return function(t,e,n,r,i,o,s,a){var l=Ye(t,"dy","maxPoolBackprop"),u=Ye(e,"input","maxPoolBackprop"),c=Ye(n,"output","maxPoolBackprop");E(u.rank===l.rank,function(){return"Rank of input ("+u.rank+") does not match rank of dy ("+l.rank+")"}),null==o&&(o=[1,1]),E(Qr(i,o),function(){return"Error in maxPoolBackProp: Either strides or dilations must be 1. Got strides "+i+" and dilations '"+o+"'"}),E(4===l.rank,function(){return"Error in maxPoolBackprop: dy must be rank 4 but got rank "+l.rank+"."}),E(4===u.rank,function(){return"Error in maxPoolBackprop: input must be rank 4 but got rank "+u.rank+"."});var h=Hr(u.shape,r,i,o,s,a);return Pt.runKernelFunc(function(t){return t.maxPoolBackprop(l,u,c,h)},{$dy:l,$input:u})}(t,s,a,e,n,r,i)}}},"MaxPool",u,c);return l?h.as3D(h.shape[1],h.shape[2],h.shape[3]):h}function hl(t,e,n,r,i,o){var s=Ye(t,"x","avgPool","float32");null==r&&(r=[1,1]),E(Qr(n,r),function(){return"Error in avgPool: Either strides or dilations must be 1. Got strides "+n+" and dilations '"+r+"'"});var a=s,l=!1;3===s.rank&&(l=!0,a=s.as4D(1,s.shape[0],s.shape[1],s.shape[2])),E(4===a.rank,function(){return"Error in avgPool: x must be rank 4 but got rank "+a.rank+"."}),null!=o&&E(I(i),function(){return"Error in avgPool: pad must be an integer when using, dimRoundingMode "+o+" but got pad "+i+"."});var u=Hr(a.shape,e,n,r,i,o);if(1===u.filterWidth&&1===u.filterHeight&&O(u.inShape,u.outShape))return s.clone();var c=Pt.runKernelFunc(function(t){return t.avgPool(a,u)},{x:a},function(t){return{x:function(){return function(t,e,n,r,i,o){var s=Ye(t,"dy","avgPoolBackprop"),a=Ye(e,"input","avgPoolBackprop");E(a.rank===s.rank,function(){return"Rank of input ("+a.rank+") does not match rank of dy ("+s.rank+")"}),null==i&&(i=[1,1]),E(Qr(r,i),function(){return"Error in avgPoolBackprop: Either strides or dilations must be 1. Got strides "+r+" and dilations '"+i+"'"});var l=a,u=s,c=!1;3===a.rank&&(c=!0,l=a.as4D(1,a.shape[0],a.shape[1],a.shape[2]),u=s.as4D(1,s.shape[0],s.shape[1],s.shape[2])),E(4===u.rank,function(){return"Error in avgPoolBackprop: dy must be rank 4 but got rank "+u.rank+"."}),E(4===l.rank,function(){return"Error in avgPoolBackprop: input must be rank 4 but got rank "+l.rank+"."});var h=Hr(l.shape,n,r,i,o),d=Pt.runKernelFunc(function(t){return t.avgPoolBackprop(u,l,h)},{dy4D:u,input4D:l});return c?d.as3D(d.shape[1],d.shape[2],d.shape[3]):d}(t,a,e,n,r,i)}}},"AvgPool",u);return c=c.cast(s.dtype),l?c.as3D(c.shape[1],c.shape[2],c.shape[3]):c}var dl=ln({maxPool_:function(t,e,n,r,i){return cl(t,e,n,1,r,i)}}),pl=ln({avgPool_:function(t,e,n,r,i){return hl(t,e,n,1,r,i)}}),fl=ln({pool_:function(t,e,n,r,i,o){null==i&&(i=[1,1]),null==o&&(o=1),0===r&&(r="valid");var s=Ye(t,"x","maxPool"),a=s,l=!1;3===s.rank&&(l=!0,a=s.as4D(1,s.shape[0],s.shape[1],s.shape[2])),E(Qr(o,i),function(){return"Error in pool: Either strides or dilations must be 1. Got strides "+o+" and dilations '"+i+"'"});var u,c=Hr(a.shape,e,o,i,r),h=[c.dilationHeight,c.dilationWidth];u="same"===r?function(t,e){var n=t.map(function(t,n){return t+(t-1)*(e[n]-1)}).map(function(t){return t-1}),r=n.map(function(t){return Math.floor(t/2)}),i=n.map(function(t,e){return t-r[e]});return n.map(function(t,e){return[r[e],i[e]]})}([c.filterHeight,c.filterWidth],h):[[0,0],[0,0]];var d=1===h[0]&&1===h[1],p=function(t,e,n){var r=n.map(function(t){return t[0]}),i=n.map(function(t){return t[1]}),o=t.concat(r,i),s=e.map(function(t,e){return(t-o[e]%t)%t}),a=i.map(function(t,e){return t+s[e]});return[e.map(function(t,e){return[r[e],a[e]]}),e.map(function(t,e){return[0,s[e]]})]}([c.inHeight,c.inWidth],h,u),f=p[0],g=p[1],m=d?r:"valid",v=d?a:cr(a,h,f),b=("avg"===n?function(){return hl(v,e,o,1,m)}:function(){return cl(v,e,o,1,m)})(),_=d?b:Wn(b,h,g);return l?_.as3D(_.shape[1],_.shape[2],_.shape[3]):_}}),gl=ln({maxPool3d_:function(t,e,n,r,i,o,s){void 0===o&&(o="NDHWC");var a=Ye(t,"x","maxPool3d"),l=a,u=!1;4===a.rank&&(u=!0,l=a.as5D(1,a.shape[0],a.shape[1],a.shape[2],a.shape[3])),null==s&&(s=[1,1,1]),E(5===l.rank,function(){return"Error in maxPool3d: x must be rank 5 but got rank "+l.rank+"."}),E("NDHWC"===o,function(){return"Error in maxPool3d: Only NDHWC is currently supported, but got dataFormat of "+o}),E(Qr(n,s),function(){return"Error in maxPool3d: Either strides or dilations must be 1. Got strides "+n+" and dilations '"+s+"'"}),null!=i&&E(I(r),function(){return"Error in maxPool3d: pad must be an integer when using, dimRoundingMode "+i+" but got pad "+r+"."});var c=Wr(l.shape,e,n,s,r,i,o),h=Pt.runKernelFunc(function(t,e){var n=t.maxPool3d(l,c);return e([l,n]),n},{x:l},function(t,o){var a=o[0],l=o[1];return{x:function(){return function(t,e,n,r,i,o,s,a){var l=Ye(t,"dy","maxPool3dBackprop"),u=Ye(e,"input","maxPool3dBackprop"),c=Ye(n,"output","maxPool3dBackprop"),h=l,d=u,p=c,f=!1;4===u.rank&&(f=!0,h=l.as5D(1,l.shape[0],l.shape[1],l.shape[2],l.shape[3]),d=u.as5D(1,u.shape[0],u.shape[1],u.shape[2],u.shape[3]),p=c.as5D(1,c.shape[0],c.shape[1],c.shape[2],c.shape[3])),E(5===h.rank,function(){return"Error in maxPool3dBackprop: dy must be rank 5 but got rank "+h.rank+"."}),E(5===d.rank,function(){return"Error in maxPool3dBackprop: input must be rank 5 but got rank "+d.rank+"."}),E(5===p.rank,function(){return"Error in maxPool3dBackprop: output must be rank 5 but got rank "+p.rank+"."}),null==o&&(o=[1,1,1]),E(Qr(i,o),function(){return"Error in maxPool3dBackprop: Either strides or dilations must be 1. Got strides "+i+" and dilations '"+o+"'"}),null!=a&&E(I(s),function(){return"Error in maxPool3dBackprop: pad must be an integer when using, dimRoundingMode "+a+" but got pad "+s+"."});var g=Wr(d.shape,r,i,o,s,a),m=Pt.runKernelFunc(function(t){return t.maxPool3dBackprop(h,d,p,g)},{dy5D:h,input5D:d});return f?m.as4D(m.shape[1],m.shape[2],m.shape[3],m.shape[4]):m}(t,a,l,e,n,s,r,i)}}});return u?h.as4D(h.shape[1],h.shape[2],h.shape[3],h.shape[4]):h}}),ml=ln({avgPool3d_:function(t,e,n,r,i,o,s){void 0===o&&(o="NDHWC");var a=Ye(t,"x","avgPool3d","float32"),l=a,u=!1;4===a.rank&&(u=!0,l=a.as5D(1,a.shape[0],a.shape[1],a.shape[2],a.shape[3])),null==s&&(s=[1,1,1]),E(5===l.rank,function(){return"Error in avgPool3d: x must be rank 5 but got rank "+l.rank+"."}),E("NDHWC"===o,function(){return"Error in avgPool3d: Only NDHWC is currently supported, but got dataFormat of "+o}),E(Qr(n,s),function(){return"Error in avgPool3d: Either strides or dilations must be 1. Got strides "+n+" and dilations '"+s+"'"}),null!=i&&E(I(r),function(){return"Error in avgPool3d: pad must be an integer when using, dimRoundingMode "+i+" but got pad "+r+"."});var c=Wr(l.shape,e,n,s,r,i,o),h=Pt.runKernelFunc(function(t){return t.avgPool3d(l,c)},{x:l},function(t){return{x:function(){return function(t,e,n,r,i,o,s){var a=Ye(t,"dy","avgPool3dBackprop"),l=Ye(e,"input","avgPool3dBackprop"),u=a,c=l,h=!1;4===l.rank&&(h=!0,u=a.as5D(1,a.shape[0],a.shape[1],a.shape[2],a.shape[3]),c=l.as5D(1,l.shape[0],l.shape[1],l.shape[2],l.shape[3])),E(5===u.rank,function(){return"Error in avgPool3dBackprop: dy must be rank 5 but got rank "+u.rank+"."}),E(5===c.rank,function(){return"Error in avgPool3dBackprop: input must be rank 5 but got rank "+c.rank+"."}),null==i&&(i=[1,1,1]),E(Qr(r,i),function(){return"Error in avgPool3dBackprop: Either strides or dilations must be 1. Got strides "+r+" and dilations '"+i+"'"}),null!=s&&E(I(o),function(){return"Error in maxPool3dBackprop: pad must be an integer when using, dimRoundingMode "+s+" but got pad "+o+"."});var d=Wr(c.shape,n,r,i,o,s),p=Pt.runKernelFunc(function(t){return t.avgPool3dBackprop(u,c,d)},{dy5D:u,input5D:c});return h?p.as4D(p.shape[1],p.shape[2],p.shape[3],p.shape[4]):p}(t,l,e,n,s,r,i)}}});return h=h.cast(l.dtype),u?h.as4D(h.shape[1],h.shape[2],h.shape[3],h.shape[4]):h}}),vl=ln({slice_:function(t,e,n){var r,i,o=Ye(t,"x","slice");if(0===o.rank)throw new Error("Slicing scalar is not possible");(r="number"==typeof e?[e].concat(new Array(o.rank-1).fill(0)):e.length<o.rank?e.concat(new Array(o.rank-e.length).fill(0)):e.slice()).forEach(function(t){E(-1!==t,function(){return"slice() does not support negative begin indexing."})}),i=(i=null==n?new Array(o.rank).fill(-1):"number"==typeof n?[n].concat(new Array(o.rank-1).fill(-1)):n.length<o.rank?n.concat(new Array(o.rank-n.length).fill(-1)):n).map(function(t,e){return t>=0?t:(E(-1===t,function(){return"Negative size values should be exactly -1 but got "+t+" for the slice() size at index "+e+"."}),o.shape[e]-r[e])}),kr(o,r,i);var s=o.shape,a={begin:r,size:i};return Pt.runKernelFunc(function(t){return t.slice(o,r,i)},{x:o},function(t){for(var e=[],n=0;n<t.rank;n++)e.push([r[n],s[n]-r[n]-i[n]]);return{x:function(){return t.pad(e)}}},"Slice",a)}}),bl=ln({slice1d_:function(t,e,n){var r=Ye(t,"x","slice1d");return E(1===r.rank,function(){return"slice1d expects a rank-1 tensor, but got a rank-"+r.rank+" tensor"}),vl(r,[e],[n])}}),_l=ln({slice2d_:function(t,e,n){var r=Ye(t,"x","slice2d");return E(2===r.rank,function(){return"slice2d expects a rank-2 tensor, but got a rank-"+r.rank+" tensor"}),vl(r,e,n)}}),yl=ln({slice3d_:function(t,e,n){var r=Ye(t,"x","slice3d");return E(3===r.rank,function(){return"slice3d expects a rank-3 tensor, but got a rank-"+r.rank+" tensor"}),vl(r,e,n)}}),Tl=ln({slice4d_:function(t,e,n){var r=Ye(t,"x","slice4d");return E(4===r.rank,function(){return"slice4d expects a rank-4 tensor, but got a rank-"+r.rank+" tensor"}),vl(r,e,n)}});function xl(t,e,n,r,i){return e.rank<n.rank&&(e=e.reshape(tn(e.shape,r))),t.rank<n.rank&&(t=t.reshape(tn(t.shape,r))),{x:function(){var r=t.mul(n.equal(e).cast(t.dtype));return null==i?r:r.transpose(i)}}}var El=ln({all_:function(t,e,n){void 0===e&&(e=null),void 0===n&&(n=!1);var r=Ye(t,"x","all","bool"),i=L(e,r.shape),o=i,s=nn(o,r.rank);null!=s&&(r=r.transpose(s),o=on(o.length,r.rank));var a=Pt.runKernelFunc(function(t){return t.all(r,o)},{$x:r});if(n){var l=tn(a.shape,i);return a.reshape(l)}return a}}),wl=ln({any_:function(t,e,n){void 0===e&&(e=null),void 0===n&&(n=!1);var r=Ye(t,"x","any","bool"),i=L(e,r.shape),o=i,s=nn(o,r.rank);null!=s&&(r=r.transpose(s),o=on(o.length,r.rank));var a=Pt.runKernelFunc(function(t){return t.any(r,o)},{$x:r});if(n){var l=tn(a.shape,i);return a.reshape(l)}return a}}),Cl=ln({argMax_:function(t,e){void 0===e&&(e=0);var n=Ye(t,"x","argMax");null==e&&(e=0);var r=L(e,n.shape),i=nn(r,n.rank);null!=i&&(n=n.transpose(i),r=on(r.length,n.rank));var o={axis:r[0]},s=[n];return Pt.runKernelFunc(function(t,e){var i=t.argMax(n,r[0]);return e([n]),i},{x:n},function(t,e){var n=e[0];return{x:function(){return wn(n)}}},"ArgMax",o,s)}}),Sl=ln({argMin_:function(t,e){void 0===e&&(e=0);var n=Ye(t,"x","argMin");null==e&&(e=0);var r=L(e,n.shape),i=nn(r,n.rank);return null!=i&&(n=n.transpose(i),r=on(r.length,n.rank)),Pt.runKernelFunc(function(t,e){var i=t.argMin(n,r[0]);return e([n]),i},{$x:n},function(t,e){var n=e[0];return{$x:function(){return wn(n)}}})}}),kl=ln({logSumExp_:function(t,e,n){void 0===e&&(e=null),void 0===n&&(n=!1);var r=Ye(t,"x","logSumExp"),i=L(e,r.shape),o=r.max(i,!0),s=r.sub(o).exp().sum(i).log(),a=o.reshape(s.shape).add(s);if(n){var l=tn(a.shape,i);return a.reshape(l)}return a}}),Ol=ln({max_:function(t,e,n){void 0===e&&(e=null),void 0===n&&(n=!1);var r=Ye(t,"x","max"),i=r,o=L(e,r.shape),s=o,a=nn(s,r.rank);null!=a&&(r=r.transpose(a),s=on(s.length,r.rank));var l=[r],u=Pt.runKernelFunc(function(t,e){var n=t.max(r,s);return e([i,n]),n},{x:r},function(t,e){return xl(t,e[1],e[0],o,a)},"Max",{axes:s},l,[!0]);if(n){var c=tn(u.shape,o);u=u.reshape(c)}return u}}),Il=ln({mean_:function(t,e,n){void 0===e&&(e=null),void 0===n&&(n=!1);var r=Ye(t,"x","mean"),i=L(e,r.shape),o=k(Qe(r.shape,i)[1]);return Mr(function(t){var r=fn(o);return{value:(r.dtype===t.dtype?t:t.cast(r.dtype)).div(r).sum(e,n),gradFunc:function(e){var n=t.shape.slice();return i.forEach(function(t){n[t]=1}),e.reshape(n).mul(_n(t.shape,"float32")).div(o)}}})(r)}}),Rl=ln({min_:function(t,e,n){void 0===e&&(e=null),void 0===n&&(n=!1);var r=Ye(t,"x","min"),i=r,o=L(e,r.shape),s=o,a=nn(s,r.rank);null!=a&&(r=r.transpose(a),s=on(s.length,r.rank));var l=[r],u=Pt.runKernelFunc(function(t,e){var n=t.min(r,s);return e([i,n]),n},{x:r},function(t,e){return xl(t,e[1],e[0],o,a)},"Min",{axes:s},l,[!0]);if(n){var c=tn(u.shape,o);u=u.reshape(c)}return u}}),Al=ln({moments_:function(t,e,n){void 0===e&&(e=null),void 0===n&&(n=!1);var r=L(e,(t=Ye(t,"x","moments")).shape),i=t.mean(r,n),o=i.shape;return n||(o=tn(i.shape,r)),{mean:i,variance:t.toFloat().sub(i.reshape(o)).square().mean(r,n)}}}),Nl=ln({sum_:function(t,e,n){void 0===e&&(e=null),void 0===n&&(n=!1);var r=Ye(t,"x","sum");"bool"===r.dtype&&(r=r.toInt());var i=L(e,r.shape);return Mr(function(t){var e=nn(i,t.rank),r=i,o=t;null!=e&&(o=t.transpose(e),r=on(r.length,t.rank));var s=function(e){var n=t.shape.slice();return i.forEach(function(t){n[t]=1}),e.reshape(n).mul(_n(t.shape,"float32"))},a={axes:r},l=Pt.runKernelFunc(function(t){return t.sum(o,r)},{x:o},function(t){return{x:function(){return s(t)}}},"Sum",a);if(n){var u=tn(l.shape,i);l=l.reshape(u)}return{value:l,gradFunc:s}})(r)}}),Dl=ln({prod_:function(t,e,n){void 0===e&&(e=null),void 0===n&&(n=!1);var r=Ye(t,"x","prod");"bool"===r.dtype&&(r=r.toInt());var i=L(e,r.shape),o=nn(i,r.rank),s=i,a=r;null!=o&&(a=r.transpose(o),s=on(s.length,r.rank));var l=Pt.runKernelFunc(function(t){return t.prod(a,s)},{permutedX:a});if(n){var u=tn(l.shape,i);l=l.reshape(u)}return l}}),Ml=ln({elu_:function(t){var e=Ye(t,"x","elu");return Pt.runKernelFunc(function(t,n){var r=t.elu(e);return n([r]),r},{$x:e},function(t,e){var n=e[0];return{$x:function(){return Pt.runKernelFunc(function(e){return e.eluDer(t,n)},{dy:t,y:n})}}})}}),Ll=ln({leakyRelu_:function(t,e){void 0===e&&(e=.2);var n=Ye(t,"x","leakyRelu");return pa(fn(e).mul(n),n)}}),Pl=ln({prelu_:function(t,e){var n=Ye(t,"x","prelu"),r=Ye(e,"alpha","prelu");return Pt.runKernelFunc(function(t,e){var i=t.prelu(n,r);return e([n,r]),i},{x:n,alpha:r},function(t,e){var n=e[0],r=e[1],i=n.greater(0);return{x:function(){return ra(i,t,t.mul(r))},alpha:function(){var e=ra(i,wn(t),t.mul(n)),o=Ur(r.shape,t.shape);return o.length>0&&(e=e.sum(o)),e.reshape(r.shape)}}},"Prelu")}}),Fl=ln({relu_:function(t){var e=Ye(t,"x","relu");return"bool"===e.dtype?e.toInt():Pt.runKernelFunc(function(t,n){var r=t.relu(e);return n([e]),r},{x:e},function(t,e){var n=e[0];return{x:function(){return t.mulStrict(n.step().toFloat())}}},"Relu")}}),Bl=ln({relu6_:function(t){var e=Ye(t,"x","relu6");return"bool"===e.dtype?e.toInt():Pt.runKernelFunc(function(t,n){var r=t.relu6(e);return n([e]),r},{x:e},function(t,e){var n=e[0],r=n.lessEqual(6).mul(n.step());return{x:function(){return t.mulStrict(r.toFloat())}}},"Relu6")}}),jl=ln({selu_:function(t){var e=Ye(t,"x","selu");return Pt.runKernelFunc(function(t,n){var r=t.selu(e);return n([e]),r},{$x:e},function(t,e){var n=e[0];return{$x:function(){var e=n.greater(fn(0)),r=fn(No),i=fn(Do),o=t.mul(i),s=t.mul(r).mul(n.toFloat().exp());return ra(e,o,s)}}})}}),$l=ln({transpose_:function(t,e){var n=Ye(t,"x","transpose");if(null==e&&(e=n.shape.map(function(t,e){return e}).reverse()),E(n.rank===e.length,function(){return"Error in transpose: rank of input "+n.rank+" must match length of perm "+e+"."}),e.forEach(function(t){E(t>=0&&t<n.rank,function(){return"All entries in 'perm' must be between 0 and "+(n.rank-1)+" but got "+e})}),n.rank<=1)return n.clone();var r={perm:e};return Pt.runKernelFunc(function(t){return t.transpose(n,e)},{x:n},function(t){var n=rn(e);return{x:function(){return t.transpose(n)}}},"Transpose",r)}}),Ul=ln({localResponseNormalization_:function(t,e,n,r,i){void 0===e&&(e=5),void 0===n&&(n=1),void 0===r&&(r=1),void 0===i&&(i=.5);var o=Ye(t,"x","localResponseNormalization");E(4===o.rank||3===o.rank,function(){return"Error in localResponseNormalization: x must be rank 3 or 4 but got\n rank "+o.rank+"."}),E(I(e),function(){return"Error in localResponseNormalization: depthRadius must be an integer but got depthRadius "+e+"."});var s=o,a=!1;3===o.rank&&(a=!0,s=o.as4D(1,o.shape[0],o.shape[1],o.shape[2]));var l=Pt.runKernelFunc(function(t,o){var a=t.localResponseNormalization4D(s,e,n,r,i);return o([s,a]),a},{x4D:s},function(t,o){var s=o[0],a=o[1];return{x4D:function(){return Pt.runKernelFunc(function(o){return o.LRNGrad(t,s,a,e,n,r,i)},{})}}});return a?l.as3D(l.shape[1],l.shape[2],l.shape[3]):l}}),Vl=ln({norm_:function(t,e,n,r){void 0===e&&(e="euclidean"),void 0===n&&(n=null),void 0===r&&(r=!1);var i=function t(e,n,r){if(void 0===r&&(r=null),0===e.rank)return e.abs();if(1!==e.rank&&null===r)return t(e.reshape([-1]),n,r);if(1===e.rank||"number"==typeof r||Array.isArray(r)&&1===r.length){if(1===n)return e.abs().sum(r);if(n===1/0)return e.abs().max(r);if(n===-1/0)return e.abs().min(r);if("euclidean"===n||2===n)return e.abs().pow(fn(2,"int32")).sum(r).sqrt();throw new Error("Error in norm: invalid ord value: "+n)}if(Array.isArray(r)&&2===r.length){if(1===n)return e.abs().sum(r[0]).max(r[1]-1);if(n===1/0)return e.abs().sum(r[1]).max(r[0]);if(n===-1/0)return e.abs().sum(r[1]).min(r[0]);if("fro"===n||"euclidean"===n)return e.square().sum(r).sqrt();throw new Error("Error in norm: invalid ord value: "+n)}throw new Error("Error in norm: invalid axis: "+r)}(t=Ye(t,"x","norm"),e,n),o=i.shape;if(r){var s=L(n,t.shape);o=tn(i.shape,s)}return i.reshape(o)}}),Hl=ln({basicLSTMCell_:function(t,e,n,r,i,o){var s=Ye(t,"forgetBias","basicLSTMCell"),a=Ye(e,"lstmKernel","basicLSTMCell"),l=Ye(n,"lstmBias","basicLSTMCell"),u=Ye(r,"data","basicLSTMCell"),c=Ye(i,"c","basicLSTMCell"),h=Ye(o,"h","basicLSTMCell"),d=u.concat(h,1).matMul(a).add(l),p=d.shape[0],f=d.shape[1]/4,g=[p,f],m=d.slice([0,0],g),v=d.slice([0,f],g),b=d.slice([0,2*f],g),_=d.slice([0,3*f],g),y=m.sigmoid().mulStrict(v.tanh()).addStrict(c.mulStrict(s.add(b).sigmoid()));return[y,y.tanh().mulStrict(_.sigmoid())]}}),Wl=ln({multiRNNCell_:function(t,e,n,r){for(var i=Ye(e,"data","multiRNNCell"),o=qe(n,"c","multiRNNCell"),s=qe(r,"h","multiRNNCell"),a=i,l=[],u=0;u<t.length;u++){var c=t[u](a,o[u],s[u]);l.push(c[0]),l.push(c[1]),a=c[1]}var h=[],d=[];for(u=0;u<l.length;u+=2)h.push(l[u]),d.push(l[u+1]);return[h,d]}}),Gl=ln({movingAverage_:function(t,e,n,r,i){void 0===i&&(i=!0);var o=Ye(t,"v","movingAverage"),s=Ye(e,"x","movingAverage"),a=Ye(n,"decay","movingAverage");At(o,s),E(O(o.shape,s.shape),function(){return"Shape mismatch in v and x"});var l=fn(1),u=l.sub(a),c=s.sub(o).mul(u);if(i){E(null!=r,function(){return"When using zeroDebias: true, step is required."});var h=Ye(r,"step","movingAverage");c=c.div(l.sub(Ta(a,h)))}return o.add(c)}}),zl=ln({stridedSlice_:function(t,e,n,r,i,o,s,a,l){if(void 0===i&&(i=0),void 0===o&&(o=0),void 0===s&&(s=0),void 0===a&&(a=0),void 0===l&&(l=0),null==r&&(r=new Array(e.length)),0!==s)throw new Error("ellipsis mask is not yet supported");var u=Ye(t,"x","stridedSlice"),c=Or(a),h=u.shape.slice();c.forEach(function(t){e[t]=0,n[t]=1,h.splice(t,0,1)}),u=u.reshape(h);for(var d=0;d<u.rank;d++)e[d]=Rr(i,e,r,u.shape,d),n[d]=Ar(o,n,r,u.shape,d),r[d]=r[d]||1;var p=Or(l);p.forEach(function(t){n[t]=e[t]+1,r[t]=1});var f=Ir(e,n,r),g=f.filter(function(t,e){return-1===p.indexOf(e)});return r.every(function(t){return 1===t})?vl(u,e,f).reshape(g):Pt.runKernelFunc(function(t){return t.stridedSlice(u,e,n,r)},{$x:u}).reshape(g)}}),Xl=ln({topk_:function(t,e,n){void 0===e&&(e=1),void 0===n&&(n=!0);var r=Ye(t,"x","topk");if(0===r.rank)throw new Error("topk() expects the input to be of rank 1 or higher");var i=r.shape[r.shape.length-1];if(e>i)throw new Error("'k' passed to topk() must be <= the last dimension ("+i+") but got "+e);var o=Pt.runKernelFunc(function(t){return t.topk(r,e,n)},{$x:r});return{values:o[0],indices:o[1]}}}),Kl=ln({scatterND_:function(t,e,n){var r=Ye(t,"indices","scatterND","int32"),i=Ye(e,"updates","scatterND");return Cr(i,r,n),Pt.runKernelFunc(function(t){return t.scatterND(r,i,n)},{indices:r,updates:i},null,"ScatterNd",{shape:n})}}),Yl=ln({fft_:function(t){E("complex64"===t.dtype,function(){return"The dtype for tf.spectral.fft() must be complex64 but got "+t.dtype+"."});var e=t.shape[t.shape.length-1],n=t.size/e,r=t.as2D(n,e);return Pt.runKernelFunc(function(t){return t.fft(r)},{input:t}).reshape(t.shape)}}),ql=ln({ifft_:function(t){E("complex64"===t.dtype,function(){return"The dtype for tf.spectral.ifft() must be complex64 but got "+t.dtype+"."});var e=t.shape[t.shape.length-1],n=t.size/e,r=t.as2D(n,e);return Pt.runKernelFunc(function(t){return t.ifft(r)},{input:t}).reshape(t.shape)}}),Jl=ln({rfft_:function(t,e){E("float32"===t.dtype,function(){return"The dtype for rfft() must be real value but got "+t.dtype});var n,r=t.shape[t.shape.length-1],i=t.size/r;if(null!=e&&e<r){var o=t.shape.map(function(t){return 0}),s=t.shape.map(function(t){return t});s[t.shape.length-1]=e,n=t.slice(o,s),r=e}else if(null!=e&&e>r){var a=t.shape.map(function(t){return t});a[t.shape.length-1]=e-r,n=t.concat(yn(a),t.shape.length-1),r=e}else n=t;var l=n.zerosLike(),u=un(n,l).as2D(i,r),c=Yl(u),h=Math.floor(r/2)+1,d=cn(c),p=hn(c),f=d.split([h,r-h],d.shape.length-1),g=p.split([h,r-h],p.shape.length-1),m=n.shape.slice();return m[n.shape.length-1]=h,un(f[0],g[0]).reshape(m)}}),Zl=ln({irfft_:function(t){var e=t.shape[t.shape.length-1],n=t.size/e;if(e<=2){var r=t.as2D(n,e),i=ql(r);return cn(i)}var o=[n,2*(e-1)],s=cn(t).as2D(n,e),a=hn(t).as2D(n,e),l=s.slice([0,1],[n,e-2]).reverse(1),u=a.slice([0,1],[n,e-2]).reverse(1).mul(fn(-1)),c=s.concat(l,1),h=a.concat(u,1);return r=un(c,h).as2D(o[0],o[1]),i=ql(r),cn(i)}}),Ql=Object.freeze({fft:Yl,ifft:ql,rfft:Jl,irfft:Zl}),tu=ln({sparseToDense_:function(t,e,n,r){void 0===r&&(r=0);var i=Ye(t,"sparseIndices","sparseToDense","int32"),o=Ye(e,"sparseValues","sparseToDense"),s=Ye(r,"defaultValue","sparseToDense",o.dtype);return function(t,e,n,r){if("int32"!==t.dtype)throw new Error("tf.sparseToDense() expects the indices to be int32 type, but the dtype was "+t.dtype+".");if(t.rank>2)throw new Error("sparseIndices should be a scalar, vector, or matrix, but got shape "+t.shape+".");var i=t.rank>0?t.shape[0]:1,o=t.rank>1?t.shape[1]:1;if(n.length!==o)throw new Error("outputShape has incorrect number of elements:, "+n.length+", should be: "+o+".");var s=e.size;if(0!==e.rank&&(1!==e.rank||s!==i))throw new Error("sparseValues has incorrect shape "+e.shape+", should be [] or ["+i+"]");if(e.dtype!==r.dtype)throw new Error("sparseValues.dtype must match defaultValues.dtype")}(i,o,n,s),Pt.runKernelFunc(function(t){return t.sparseToDense(i,o,n,s)},{$sparseIndices:i,$sparseValues:o,$defaultValue:s})}}),eu=ln({gatherND_:function(t,e){var n=Ye(e,"indices","gatherND","int32"),r=Ye(t,"x","gatherND");return Pt.runKernelFunc(function(t){return t.gatherND(r,n)},{x:r,indices:n},null,"GatherNd")}}),nu=ln({diag_:function(t){var e=Ye(t,"x","diag").flatten(),n=t.shape.concat(t.shape);return Pt.runKernelFunc(function(t){return t.diag(e)},{$x:e}).reshape(n)}}),ru=ln({dropout_:function(t,e,n,r){var i=Ye(t,"x","dropout");if(E("float32"===i.dtype,function(){return"x has to be a floating point tensor since it's going to be scaled, but got a "+i.dtype+" tensor instead."}),E(e>=0&&e<1,function(){return"rate must be a float in the range [0, 1), but got "+e+"."}),0===e)return t instanceof yt?i.clone():i;var o=function(t,e){if(null==e)return t.shape.slice();if(O(t.shape,e))return e;if(t.shape.length===e.length){for(var n=[],r=0;r<t.shape.length;r++)null==e[r]&&null!=t.shape[r]?n.push(t.shape[r]):n.push(e[r]);return n}return e}(i,n),s=1-e,a=lr(o,0,1,"float32",r).add(s).floor().div(s);return i.mul(a)}});function iu(t,e,n){for(var r=1-t%2,i=new Float32Array(t),o=0;o<t;++o){var s=2*Math.PI*o/(t+r-1);i[o]=e-n*Math.cos(s)}return gn(i,"float32")}var ou,su=ln({hannWindow_:function(t){return iu(t,.5,.5)}}),au=ln({hammingWindow_:function(t){return iu(t,.54,.46)}}),lu=ln({frame_:function(t,e,n,r,i){void 0===r&&(r=!1),void 0===i&&(i=0);for(var o=0,s=[];o+e<=t.size;)s.push(vl(t,o,e)),o+=n;if(r)for(;o<t.size;){var a=o+e-t.size,l=Cn([vl(t,o,e-a),Tn([a],i)]);s.push(l),o+=n}return 0===s.length?mn([],[0,e]):Cn(s).as2D(s.length,e)}}),uu=ln({stft_:function(t,e,n,r,i){var o;void 0===i&&(i=su),null==r&&(o=e,r=Math.floor(Math.pow(2,Math.ceil(Math.log(o)/Math.log(2)))));for(var s=lu(t,e,n),a=_a(s,i(e)),l=[],u=0;u<s.shape[0];u++)l.push(Jl(a.slice([u,0],[1,e]),r));return Cn(l)}}),cu=Object.freeze({hannWindow:su,hammingWindow:au,frame:lu,stft:uu});!function(t){t[t.NONE=0]="NONE",t[t.MEAN=1]="MEAN",t[t.SUM=2]="SUM",t[t.SUM_BY_NONZERO_WEIGHTS=3]="SUM_BY_NONZERO_WEIGHTS"}(ou||(ou={}));var hu=ln({absoluteDifference_:function(t,e,n,r){void 0===r&&(r=ou.SUM_BY_NONZERO_WEIGHTS);var i=Ye(t,"labels","absoluteDifference"),o=Ye(e,"predictions","absoluteDifference"),s=null;null!=n&&(s=Ye(n,"weights","absoluteDifference")),w(i.shape,o.shape,"Error in absoluteDifference: ");var a=i.sub(o).abs();return du(a,s,r)}}),du=ln({computeWeightedLoss_:function(t,e,n){void 0===n&&(n=ou.SUM_BY_NONZERO_WEIGHTS);var r=Ye(t,"losses","computeWeightedLoss"),i=null;null!=e&&(i=Ye(e,"weights","computeWeightedLoss"));var o=null==i?r:r.mul(i);if(n===ou.NONE)return o;if(n===ou.SUM)return o.sum();if(n===ou.MEAN){if(null==i)return o.mean();var s=r.size/i.size,a=o.sum().div(i.sum());return s>1?a.div(fn(s)):a}if(n===ou.SUM_BY_NONZERO_WEIGHTS){if(null==i)return o.sum().div(fn(r.size));var l=i.mul(_n(r.shape)).notEqual(fn(0)).sum().toFloat();return o.sum().div(l)}throw Error("Unknown reduction: "+n)}}),pu=ln({cosineDistance_:function(t,e,n,r,i){void 0===i&&(i=ou.SUM_BY_NONZERO_WEIGHTS);var o=Ye(t,"labels","cosineDistance"),s=Ye(e,"predictions","cosineDistance"),a=null;null!=r&&(a=Ye(r,"weights","cosineDistance")),w(o.shape,s.shape,"Error in cosineDistance: ");var l=fn(1).sub(o.mul(s).sum(n,!0));return du(l,a,i)}}),fu=ln({hingeLoss_:function(t,e,n,r){void 0===r&&(r=ou.SUM_BY_NONZERO_WEIGHTS);var i=Ye(t,"labels","hingeLoss"),o=Ye(e,"predictions","hingeLoss"),s=null;null!=n&&(s=Ye(n,"weights","hingeLoss")),w(i.shape,o.shape,"Error in hingeLoss: ");var a=fn(1);i=fn(2).mul(i).sub(a);var l=a.sub(i.mul(o)).relu();return du(l,s,r)}}),gu=ln({huberLoss_:function(t,e,n,r,i){void 0===r&&(r=1),void 0===i&&(i=ou.SUM_BY_NONZERO_WEIGHTS);var o=Ye(t,"labels","huberLoss"),s=Ye(e,"predictions","huberLoss"),a=null;null!=n&&(a=Ye(n,"weights","huberLoss")),w(o.shape,s.shape,"Error in huberLoss: ");var l=fn(r),u=s.sub(o).abs(),c=ga(u,l),h=u.sub(c),d=fn(.5).mul(c.square()).add(l.mul(h));return du(d,a,i)}}),mu=ln({logLoss_:function(t,e,n,r,i){void 0===r&&(r=1e-7),void 0===i&&(i=ou.SUM_BY_NONZERO_WEIGHTS);var o=Ye(t,"labels","logLoss"),s=Ye(e,"predictions","logLoss"),a=null;null!=n&&(a=Ye(n,"weights","logLoss")),w(o.shape,s.shape,"Error in logLoss: ");var l=fn(1),u=fn(r),c=o.mul(s.add(u).log()).neg().sub(l.sub(o).mul(l.sub(s).add(u).log()));return du(c,a,i)}}),vu=ln({meanSquaredError_:function(t,e,n,r){void 0===r&&(r=ou.SUM_BY_NONZERO_WEIGHTS);var i=Ye(t,"labels","meanSquaredError"),o=Ye(e,"predictions","meanSquaredError"),s=null;null!=n&&(s=Ye(n,"weights","meanSquaredError")),w(i.shape,o.shape,"Error in meanSquaredError: ");var a=i.squaredDifference(o);return du(a,s,r)}}),bu=ln({sigmoidCrossEntropy_:function(t,e,n,r,i){void 0===r&&(r=0),void 0===i&&(i=ou.SUM_BY_NONZERO_WEIGHTS);var o=Ye(t,"multiClassLabels","sigmoidCrossEntropy"),s=Ye(e,"logits","sigmoidCrossEntropy"),a=null;if(null!=n&&(a=Ye(n,"weights","sigmoidCrossEntropy")),w(o.shape,s.shape,"Error in sigmoidCrossEntropy: "),r>0){var l=fn(r),u=fn(1),c=fn(.5);o=o.mul(u.sub(l)).add(c.mul(l))}var h=function(t,e){var n=Ye(t,"labels","sigmoidCrossEntropyWithLogits"),r=Ye(e,"logits","sigmoidCrossEntropyWithLogits");w(n.shape,r.shape,"Error in sigmoidCrossEntropyWithLogits: ");var i=r.relu(),o=r.mul(n),s=r.abs().neg().exp().log1p();return i.sub(o).add(s)}(o,s);return du(h,a,i)}}),_u=ln({softmaxCrossEntropy_:function(t,e,n,r,i){void 0===r&&(r=0),void 0===i&&(i=ou.SUM_BY_NONZERO_WEIGHTS);var o=Ye(t,"onehotLabels","softmaxCrossEntropy"),s=Ye(e,"logits","softmaxCrossEntropy"),a=null;if(null!=n&&(a=Ye(n,"weights","softmaxCrossEntropy")),w(o.shape,s.shape,"Error in softmaxCrossEntropy: "),r>0){var l=fn(r),u=fn(1),c=fn(o.shape[1]);o=o.mul(u.sub(l)).add(l.div(c))}var h=function(t,e,n){if(void 0===n&&(n=-1),-1===n&&(n=e.rank-1),n!==e.rank-1)throw Error("Softmax cross entropy along a non-last dimension is not yet supported. Labels / logits was rank "+e.rank+" and dim was "+n);return Mr(function(t,e,r){var i=e.logSumExp([n],!0),o=e.toFloat().sub(i);return r([t,o]),{value:o.mul(t).neg().sum([n]),gradFunc:function(t,e){var r=e[0],i=e[1],o=tn(t.shape,[n]);return[t.reshape(o).mul(r.toFloat().sub(i.exp())),t.reshape(o).mul(i.exp().sub(r.toFloat()))]}}})(t,e)}(o,s);return du(h,a,i)}}),yu=Object.freeze({get Reduction(){return ou},absoluteDifference:hu,computeWeightedLoss:du,cosineDistance:pu,hingeLoss:fu,huberLoss:gu,logLoss:mu,meanSquaredError:vu,sigmoidCrossEntropy:bu,softmaxCrossEntropy:_u});function Tu(t,e){return void 0===e&&(e=!1),Pt.tidy(function(){if(2!==t.shape.length)throw new Error("qr2d() requires a 2D Tensor, but got a "+t.shape.length+"D Tensor.");for(var n=t.shape[0],r=t.shape[1],i=Jn(n),o=t.clone(),s=mn([[1]],[1,1]),a=s.clone(),l=n>=r?r:n,u=function(t){var e,l=o,u=a,c=i;e=Pt.tidy(function(){var e=o.slice([t,t],[n-t,1]),l=e.norm(),u=o.slice([t,t],[1,1]),c=mn([[-1]]).where(u.greater(0),mn([[1]])),h=u.sub(c.mul(l)),d=e.div(h);a=1===d.shape[0]?s.clone():s.concat(d.slice([1,0],[d.shape[0]-1,d.shape[1]]),0);var p=c.matMul(h).div(l).neg(),f=o.slice([t,0],[n-t,r]),g=p.mul(a);if(0===t)o=f.sub(g.matMul(a.transpose().matMul(f)));else{var m=f.sub(g.matMul(a.transpose().matMul(f)));o=o.slice([0,0],[t,r]).concat(m,0)}var v=i.slice([0,t],[n,i.shape[1]-t]);if(0===t)i=v.sub(v.matMul(a).matMul(g.transpose()));else{var b=v.sub(v.matMul(a).matMul(g.transpose()));i=i.slice([0,0],[n,t]).concat(b,1)}return[a,o,i]}),a=e[0],o=e[1],i=e[2],Ge([l,u,c])},c=0;c<l;++c)u(c);return!e&&n>r&&(i=i.slice([0,0],[n,r]),o=o.slice([0,0],[r,r])),[i,o]})}var xu=ln({bandPart_:function(t,e,n){if(e%1!=0)throw new Error("bandPart(): numLower must be an integer, got "+e+".");if(n%1!=0)throw new Error("bandPart(): numUpper must be an integer, got "+n+".");var r=Ye(t,"a","bandPart");if(r.rank<2)throw new Error("bandPart(): Rank must be at least 2, got "+r.rank+".");var i=r.shape,o=r.shape.slice(-2),s=o[0],a=o[1];if(!(e<=s))throw new Error("bandPart(): numLower ("+e+") must not be greater than the number of rows ("+s+").");if(!(n<=a))throw new Error("bandPart(): numUpper ("+n+") must not be greater than the number of columns ("+a+").");e<0&&(e=s),n<0&&(n=a);var l=xn(0,s,1,"int32").reshape([-1,1]),u=xn(0,a,1,"int32"),c=wa(l,u),h=Qs(c.lessEqual(fn(+e,"int32")),c.greaterEqual(fn(-n,"int32"))),d=yn([s,a],r.dtype);return dr(gr(r.reshape([-1,s,a])).map(function(t){return ra(h,t,d)})).reshape(i)}}),Eu=ln({gramSchmidt_:function(t){var e;if(Array.isArray(t)){e=!1,E(null!=t&&t.length>0,function(){return"Gram-Schmidt process: input must not be null, undefined, or empty"});for(var n=t[0].shape[0],r=function(e){E(t[e].shape[0]===n,function(){return"Gram-Schmidt: Non-unique lengths found in the input vectors: ("+t[e].shape[0]+" vs. "+n+")"})},i=1;i<t.length;++i)r(i)}else e=!0,t=Rn(t,t.shape[0],0).map(function(t){return hr(t,[0])});E(t.length<=t[0].shape[0],function(){return"Gram-Schmidt: Number of vectors ("+t.length+") exceeds number of dimensions ("+t[0].shape[0]+")."});var o=[],s=t,a=function(t){o.push(Pt.tidy(function(){var e=s[t];if(t>0)for(var n=0;n<t;++n){var r=Nl(o[n].mulStrict(e)).mul(o[n]);e=e.sub(r)}return e.div(Vl(e,"euclidean"))}))};for(i=0;i<t.length;++i)a(i);return e?dr(o,0):o}}),wu=ln({qr_:function(t,e){if(void 0===e&&(e=!1),t.rank<2)throw new Error("qr() requires input tensor to have a rank >= 2, but got rank "+t.rank);if(2===t.rank)return Tu(t,e);var n=t.shape.slice(0,t.shape.length-2).reduce(function(t,e){return t*e}),r=[],i=[];return gr(t.reshape([n,t.shape[t.shape.length-2],t.shape[t.shape.length-1]]),0).forEach(function(t){var n=Tu(t,e),o=n[0],s=n[1];r.push(o),i.push(s)}),[dr(r,0).reshape(t.shape),dr(i,0).reshape(t.shape)]}}),Cu=Object.freeze({bandPart:xu,gramSchmidt:Eu,qr:wu});function Su(t,e,n,r,i,o){null==r&&(r=.5),null==i&&(i=Number.NEGATIVE_INFINITY),null==o&&(o=0);var s=t.shape[0];return n=Math.min(n,s),E(0<=r&&r<=1,function(){return"iouThreshold must be in [0, 1], but was '"+r+"'"}),E(2===t.rank,function(){return"boxes must be a 2D tensor, but was of rank '"+t.rank+"'"}),E(4===t.shape[1],function(){return"boxes must have 4 columns, but 2nd dimension was "+t.shape[1]}),E(1===e.rank,function(){return"scores must be a 1D tensor"}),E(e.shape[0]===s,function(){return"scores has incompatible shape with boxes. Expected "+s+", but was "+e.shape[0]}),E(0<=o&&o<=1,function(){return"softNmsSigma must be in [0, 1], but was '"+o+"'"}),{maxOutputSize:n,iouThreshold:r,scoreThreshold:i,softNmsSigma:o}}var ku=ln({resizeBilinear_:function(t,e,n){void 0===n&&(n=!1);var r=Ye(t,"images","resizeBilinear");E(3===r.rank||4===r.rank,function(){return"Error in resizeBilinear: x must be rank 3 or 4, but got rank "+r.rank+"."}),E(2===e.length,function(){return"Error in resizeBilinear: new shape must 2D, but got shape "+e+"."});var i=r,o=!1;3===r.rank&&(o=!0,i=r.as4D(1,r.shape[0],r.shape[1],r.shape[2]));var s=e[0],a=e[1],l=Pt.runKernelFunc(function(t,e){return e([i]),t.resizeBilinear(i,s,a,n)},{x:i},function(t,e){return{x:function(){return Pt.runKernelFunc(function(r){return r.resizeBilinearBackprop(t,e[0],n)},{})}}},"ResizeBilinear",{alignCorners:n,newHeight:s,newWidth:a});return o?l.as3D(l.shape[1],l.shape[2],l.shape[3]):l}}),Ou=ln({resizeNearestNeighbor_:function(t,e,n){void 0===n&&(n=!1);var r=Ye(t,"images","resizeNearestNeighbor");E(3===r.rank||4===r.rank,function(){return"Error in resizeNearestNeighbor: x must be rank 3 or 4, but got rank "+r.rank+"."}),E(2===e.length,function(){return"Error in resizeNearestNeighbor: new shape must 2D, but got shape "+e+"."}),E("float32"===r.dtype||"int32"===r.dtype,function(){return"`images` must have `int32` or `float32` as dtype"});var i=r,o=!1;3===r.rank&&(o=!0,i=r.as4D(1,r.shape[0],r.shape[1],r.shape[2]));var s=e[0],a=e[1],l=Pt.runKernelFunc(function(t,e){return e([i]),t.resizeNearestNeighbor(i,s,a,n)},{batchImages:i},function(t,e){return{batchImages:function(){return Pt.runKernelFunc(function(r){return r.resizeNearestNeighborBackprop(t,e[0],n)},{})}}});return o?l.as3D(l.shape[1],l.shape[2],l.shape[3]):l}}),Iu=ln({nonMaxSuppression_:function(t,e,n,r,i){void 0===r&&(r=.5),void 0===i&&(i=Number.NEGATIVE_INFINITY);var o=Ye(t,"boxes","nonMaxSuppression"),s=Ye(e,"scores","nonMaxSuppression"),a=Su(o,s,n,r,i);n=a.maxOutputSize,r=a.iouThreshold,i=a.scoreThreshold;var l={maxOutputSize:n,iouThreshold:r,scoreThreshold:i};return Pt.runKernelFunc(function(t){return t.nonMaxSuppression(o,s,n,r,i)},{boxes:o,scores:s},null,"NonMaxSuppressionV3",l)}}),Ru=ln({nonMaxSuppressionWithScore_:function(t,e,n,r,i,o){void 0===r&&(r=.5),void 0===i&&(i=Number.NEGATIVE_INFINITY),void 0===o&&(o=0);var s=Ye(t,"boxes","nonMaxSuppression"),a=Ye(e,"scores","nonMaxSuppression"),l=Su(s,a,n,r,i,o),u={maxOutputSize:n=l.maxOutputSize,iouThreshold:r=l.iouThreshold,scoreThreshold:i=l.scoreThreshold,softNmsSigma:o=l.softNmsSigma},c=Pt.runKernel("NonMaxSuppressionV5",{boxes:s,scores:a},u);return{selectedIndices:c[0],selectedScores:c[1]}}}),Au=ln({cropAndResize_:function(t,e,n,r,i,o){var s=Ye(t,"image","cropAndResize"),a=Ye(e,"boxes","cropAndResize","float32"),l=Ye(n,"boxInd","cropAndResize","int32");i=i||"bilinear",o=o||0;var u=a.shape[0];return E(4===s.rank,function(){return"Error in cropAndResize: image must be rank 4,but got rank "+s.rank+"."}),E(2===a.rank&&4===a.shape[1],function(){return"Error in cropAndResize: boxes must be have size ["+u+",4] but had shape "+a.shape+"."}),E(1===l.rank&&l.shape[0]===u,function(){return"Error in cropAndResize: boxInd must be have size ["+u+"] but had shape "+a.shape+"."}),E(2===r.length,function(){return"Error in cropAndResize: cropSize must be of length 2, but got length "+r.length+"."}),E(r[0]>=1&&r[1]>=1,function(){return"cropSize must be atleast [1,1], but was "+r}),E("bilinear"===i||"nearest"===i,function(){return"method must be bilinear or nearest, but was "+i}),Pt.runKernelFunc(function(t,e){return t.cropAndResize(s,a,l,r,i,o)},{images:s,boxes:a,boxInd:l},null,"CropAndResize",{method:i,extrapolationValue:o,cropSize:r})}}),Nu=Object.freeze({resizeBilinear:ku,resizeNearestNeighbor:Ou,nonMaxSuppression:Iu,nonMaxSuppressionAsync:function(t,e,n,r,i){return void 0===r&&(r=.5),void 0===i&&(i=Number.NEGATIVE_INFINITY),a(this,void 0,void 0,function(){var o,s,a,u,c,h,d;return l(this,function(l){switch(l.label){case 0:return o=Ye(t,"boxes","nonMaxSuppressionAsync"),s=Ye(e,"scores","nonMaxSuppressionAsync"),a=Su(o,s,n,r,i),n=a.maxOutputSize,r=a.iouThreshold,i=a.scoreThreshold,[4,Promise.all([o.data(),s.data()])];case 1:return u=l.sent(),c=u[0],h=u[1],d=ci(c,h,n,r,i),o!==t&&o.dispose(),s!==e&&s.dispose(),[2,d]}})})},nonMaxSuppressionWithScore:Ru,nonMaxSuppressionWithScoreAsync:function(t,e,n,r,i,o){return void 0===r&&(r=.5),void 0===i&&(i=Number.NEGATIVE_INFINITY),void 0===o&&(o=0),a(this,void 0,void 0,function(){var s,a,u,c,h,d,p;return l(this,function(l){switch(l.label){case 0:return s=Ye(t,"boxes","nonMaxSuppressionAsync"),a=Ye(e,"scores","nonMaxSuppressionAsync"),u=Su(s,a,n,r,i,o),n=u.maxOutputSize,r=u.iouThreshold,i=u.scoreThreshold,o=u.softNmsSigma,[4,Promise.all([s.data(),a.data()])];case 1:return c=l.sent(),h=c[0],d=c[1],p=hi(h,d,n,r,i,o),s!==t&&s.dispose(),a!==e&&a.dispose(),[2,p]}})})},cropAndResize:Au}),Du=function(t,e){return!(t>0)||"linear"===e},Mu=function(t,e,n){if(null==n||"linear"===n)return t;if("relu"===n)return t.mul(e.step());throw new Error("Gradient for activation "+n+" has not been implemented yet.")},Lu=function(t,e){var n=e,r=Ur(t.shape,e.shape);return r.length>0&&(n=n.sum(r)),n.reshape(t.shape)},Pu=function(t,e,n){if("linear"===e)return t;if("relu"===e)return Fl(t);if("elu"===e)return Ml(t);if("relu6"===e)return Bl(t);if("prelu"===e)return Pl(t,n);throw new Error("Unknown fused activation "+e+".")},Fu=ln({fusedMatMul_:function(t){var e,n=t.a,r=t.b,i=t.transposeA,o=void 0!==i&&i,s=t.transposeB,a=void 0!==s&&s,l=t.bias,u=t.activation,c=void 0===u?"linear":u,h=t.preluActivationWeights;if(!1===Du(Pt.state.gradientDepth,c)){var d=nl(n,r,o,a);return null!=l&&(d=oa(d,l)),Pu(d,c,h)}var p=Ye(n,"a","fused matMul"),f=Ye(r,"b","fused matMul");e=Rt(p,f),p=e[0],f=e[1];var g=o?p.shape[p.rank-2]:p.shape[p.rank-1],m=a?f.shape[f.rank-1]:f.shape[f.rank-2],v=o?p.shape[p.rank-1]:p.shape[p.rank-2],b=a?f.shape[f.rank-2]:f.shape[f.rank-1],_=p.shape.slice(0,-2),y=f.shape.slice(0,-2),T=k(_),x=k(y);E(p.rank>=2&&f.rank>=2&&p.rank===f.rank,function(){return"Error in fused matMul: inputs must have the same rank of at least 2, got ranks "+p.rank+" and "+f.rank+"."}),E(O(_,y),function(){return"Error in fused matMul: outer dimensions ("+_+") and ("+y+") of Tensors with shapes "+p.shape+" and "+f.shape+" must match."}),E(g===m,function(){return"Error in fused matMul: inner shapes ("+g+") and ("+m+") of Tensors with shapes "+p.shape+" and "+f.shape+" and transposeA="+o+" and transposeB="+a+" must match."});var w,C,S=p.shape.slice(0,-2).concat([v,b]),I=o?p.as3D(T,g,v):p.as3D(T,v,g),R=a?f.as3D(x,b,m):f.as3D(x,m,b);null!=l&&Vr(S,(w=Rt(w=Ye(l,"bias","fused matMul"),p)[0]).shape),null!=h&&(C=Ye(h,"prelu weights","fused matMul"));var A={a:I,b:R};null!=l&&(A.bias=w),null!=h&&(A.preluActivationWeights=C);var N=[I,R];return Pt.runKernelFunc(function(t,e){var n=t.fusedBatchMatMul({a:I,b:R,transposeA:o,transposeB:a,bias:w,activation:c,preluActivationWeights:C});return e([I,R,n]),n},A,function(t,e){var n=e[0],r=e[1],i=e[2],s=Mu(t,i,c),u={};return null!=l&&(u={bias:function(){return Lu(w,s)}}),o||a?!o&&a?Object.assign({a:function(){return s.matMul(r,!1,!1)},b:function(){return s.matMul(n,!0,!1)}},u):o&&!a?Object.assign({a:function(){return r.matMul(s,!1,!0)},b:function(){return n.matMul(s,!1,!1)}},u):Object.assign({a:function(){return r.matMul(s,!0,!0)},b:function(){return s.matMul(n,!0,!0)}},u):Object.assign({a:function(){return s.matMul(r,!1,!0)},b:function(){return n.matMul(s,!0,!1)}},u)},"_FusedMatMul",{transposeA:o,transposeB:a,activation:c},N,[!0]).reshape(S)}}),Bu=ln({fusedConv2d_:function(t){var e=t.x,n=t.filter,r=t.strides,i=t.pad,o=t.dataFormat,s=void 0===o?"NHWC":o,a=t.dilations,l=void 0===a?[1,1]:a,u=t.dimRoundingMode,c=t.bias,h=t.activation,d=void 0===h?"linear":h,p=t.preluActivationWeights;if(d=d||"linear",!1===Du(Pt.state.gradientDepth,d)){var f=za(e,n,r,i,s,l,u);return null!=c&&(f=oa(f,c)),Pu(f,d,p)}var g=Ye(e,"x","conv2d"),m=Ye(n,"filter","conv2d"),v=g,b=!1;3===g.rank&&(b=!0,v=g.as4D(1,g.shape[0],g.shape[1],g.shape[2])),E(4===v.rank,function(){return"Error in fused conv2d: input must be rank 4, but got rank "+v.rank+"."}),E(4===m.rank,function(){return"Error in fused conv2d: filter must be rank 4, but got rank "+m.rank+"."}),null!=u&&E(I(i),function(){return"Error in fused conv2d: pad must be an integer when using, dimRoundingMode "+u+" but got pad "+i+"."}),E(v.shape[3]===m.shape[2],function(){return"Error in conv2d: depth of input ("+v.shape[3]+") must match input depth for filter "+m.shape[2]+"."}),E(Qr(r,l),function(){return"Error in conv2D: Either strides or dilations must be 1. Got strides "+r+" and dilations '"+l+"'"}),E("NHWC"===s,function(){return"Error in conv2d: got dataFormat of "+s+" but only NHWC is currently supported."});var _,y,T=Gr(v.shape,m.shape,r,l,i,u);null!=c&&(_=Rt(_=Ye(c,"bias","fused conv2d"),g)[0],Vr(T.outShape,_.shape)),null!=p&&(y=Ye(p,"prelu weights","fused conv2d"));var x={x:v,filter:m};null!=c&&(x.bias=_),null!=p&&(x.preluActivationWeights=y);var w=[m,v],C=Pt.runKernelFunc(function(t,e){var n=t.fusedConv2d({input:v,filter:m,convInfo:T,bias:_,activation:d,preluActivationWeights:y});return e([m,v,n]),n},x,function(t,e){var n=e,o=n[0],s=n[1],a=n[2],u=Mu(t,a,d);E(Zr(l),function(){return"Error in gradient of fused conv2D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '"+l+"'"});var h={};return null!=c&&(h={bias:function(){return Lu(_,u)}}),Object.assign({x:function(){return Ya(s.shape,u,o,r,i)},filter:function(){return Ka(s,u,o.shape,r,i)}},h)},"FusedConv2D",{convInfo:T,activation:d},w,[!0]);return b?C.as3D(C.shape[1],C.shape[2],C.shape[3]):C}}),ju=ln({fusedDepthwiseConv2d_:function(t){var e=t.x,n=t.filter,r=t.strides,i=t.pad,o=t.dataFormat,s=void 0===o?"NHWC":o,a=t.dilations,l=void 0===a?[1,1]:a,u=t.dimRoundingMode,c=t.bias,h=t.activation,d=void 0===h?"linear":h,p=t.preluActivationWeights;if(!1===Du(Pt.state.gradientDepth,d)){var f=qa(e,n,r,i,s,l,u);return null!=c&&(f=oa(f,c)),Pu(f,d,p)}var g=Ye(e,"x","depthwiseConv2d"),m=Ye(n,"filter","depthwiseConv2d"),v=g,b=!1;3===g.rank&&(b=!0,v=g.as4D(1,g.shape[0],g.shape[1],g.shape[2])),E(4===v.rank,function(){return"Error in fused depthwiseConv2d: input must be rank 4, but got rank "+v.rank+"."}),E(4===m.rank,function(){return"Error in fused depthwiseConv2d: filter must be rank 4, but got rank "+m.rank+"."}),E(v.shape[3]===m.shape[2],function(){return"Error in fused depthwiseConv2d: number of input channels ("+v.shape[3]+") must match the inChannels dimension in filter "+m.shape[2]+"."}),null==l&&(l=[1,1]),E(Qr(r,l),function(){return"Error in fused depthwiseConv2d: Either strides or dilations must be 1. Got strides "+r+" and dilations '"+l+"'"}),null!=u&&E(I(i),function(){return"Error in fused depthwiseConv2d: pad must be an integer when using dimRoundingMode "+u+" but got pad "+i+"."});var _,y,T=Gr(v.shape,m.shape,r,l,i,u,!0);null!=c&&(_=Rt(_=Ye(c,"bias","fused conv2d"),g)[0],Vr(T.outShape,_.shape)),null!=p&&(y=Ye(p,"prelu weights","fused depthwiseConv2d"));var x={x:v,filter:m};null!=c&&(x.bias=_),null!=p&&(x.preluActivationWeights=y);var w=[m,v],C=Pt.runKernelFunc(function(t,e){var n=t.fusedDepthwiseConv2D({input:v,filter:m,convInfo:T,bias:_,activation:d,preluActivationWeights:y});return e([m,v,n]),n},x,function(t,e){E(Zr(l),function(){return"Error in gradient of fused depthwiseConv2d: dilation rates greater than 1 are not yet supported. Got dilations '"+l+"'"});var n=e[0],r=e[1],i=e[2],o=Mu(t,i,d),s={};return null!=c&&(s={bias:function(){return Lu(_,o)}}),Object.assign({x:function(){return Ja(r.shape,o,n,T)},filter:function(){return Za(r,o,n.shape,T)}},s)},"FusedDepthwiseConv2D",{convInfo:T,activation:d},w,[!0]);return b?C.as3D(C.shape[1],C.shape[2],C.shape[3]):C}}),$u=Object.freeze({matMul:Fu,conv2d:Bu,depthwiseConv2d:ju}),Uu=Object.freeze({image:Nu,linalg:Cu,losses:yu,spectral:Ql,fused:$u,signal:cu,square:ns,squaredDifference:is,conv1d:Ga,conv2d:za,conv3d:Xa,depthwiseConv2d:qa,separableConv2d:Qa,conv2dTranspose:tl,conv3dTranspose:el,op:ln,batchNormalization2d:Gs,batchNormalization3d:zs,batchNormalization4d:Xs,batchNormalization:Ks,batchNorm:Ys,batchNorm2d:qs,batchNorm3d:Js,batchNorm4d:Zs,booleanMaskAsync:function(t,e,n){return a(this,void 0,void 0,function(){var r,i,o,s,a,u,c,h,d,p,f,g,m;return l(this,function(l){switch(l.label){case 0:for(r=Ye(t,"tensor","boolMask"),i=Ye(e,"mask","boolMask","bool"),o=null==n?0:n,s=i.rank,a=r.shape,E(s>0,function(){return"mask cannot be scalar"}),w(a.slice(o,o+s),i.shape,"mask's shape must match the first K dimensions of tensor's shape,"),u=1,c=o;c<o+s;c++)u*=a[c];return h=a.slice(0,o).concat([u],a.slice(o+s)),d=r.reshape(h),p=i.reshape([-1]),[4,ia(p)];case 1:return f=l.sent(),g=f.squeeze([1]),m=$a(d,g,o),t!==r&&r.dispose(),e!==i&&i.dispose(),g.dispose(),d.dispose(),p.dispose(),f.dispose(),[2,m]}})})},complex:un,real:cn,imag:hn,concat:Cn,concat1d:Sn,concat2d:kn,concat3d:On,concat4d:In,split:Rn,matMul:nl,dot:rl,outerProduct:il,reverse:ol,reverse1d:sl,reverse2d:al,reverse3d:ll,reverse4d:ul,maxPool:dl,avgPool:pl,pool:fl,maxPool3d:gl,avgPool3d:ml,slice:vl,slice1d:bl,slice2d:_l,slice3d:yl,slice4d:Tl,abs:os,acos:ss,acosh:as,asin:ls,asinh:us,atan:cs,atanh:hs,ceil:ds,clipByValue:ps,cos:fs,cosh:gs,erf:ms,exp:vs,expm1:bs,floor:_s,log:ys,log1p:Ts,logSigmoid:xs,neg:Es,reciprocal:ws,round:Cs,rsqrt:Ss,sigmoid:ks,sign:Os,isNaN:Is,isInf:Rs,isFinite:As,sin:Ns,sinh:Ds,softplus:Ms,sqrt:Ls,step:Ps,tan:Fs,tanh:Bs,all:El,any:wl,argMax:Cl,argMin:Sl,logSumExp:kl,max:Ol,mean:Il,min:Rl,moments:Al,sum:Nl,prod:Dl,equal:Sa,equalStrict:ka,greater:Oa,greaterEqual:Ia,greaterEqualStrict:Ra,greaterStrict:Aa,less:Na,lessEqual:Da,lessEqualStrict:Ma,lessStrict:La,notEqual:Pa,notEqualStrict:Fa,add:oa,addN:sa,addStrict:aa,atan2:la,div:ua,divNoNan:ca,divStrict:ha,floorDiv:da,maximum:pa,maximumStrict:fa,minimum:ga,minimumStrict:ma,mod:va,modStrict:ba,mul:_a,mulStrict:ya,pow:Ta,powStrict:xa,squaredDifferenceStrict:Ea,sub:wa,subStrict:Ca,elu:Ml,leakyRelu:Ll,prelu:Pl,relu:Fl,relu6:Bl,selu:jl,logicalAnd:Qs,logicalNot:ta,logicalOr:ea,logicalXor:na,where:ra,whereAsync:ia,buffer:Hn,print:function(t,e){void 0===e&&(e=!1),console.log(t.toString(e))},batchToSpaceND:Wn,broadcastTo:Gn,cast:zn,clone:Xn,cumsum:Kn,depthToSpace:Yn,expandDims:qn,eye:Jn,multinomial:Zn,oneHot:Qn,pad:tr,pad1d:er,pad2d:nr,pad3d:rr,pad4d:ir,rand:or,randomNormal:sr,randomGamma:ar,randomUniform:lr,reshape:ur,spaceToBatchND:cr,squeeze:hr,stack:dr,tile:pr,truncatedNormal:fr,unstack:gr,setdiff1dAsync:function(t,e){return a(this,void 0,void 0,function(){var n,r,i,o,s,a,u,c,h,d;return l(this,function(l){switch(l.label){case 0:return n=Ye(t,"x","setdiff1d"),r=Ye(e,"y","setdiff1d"),E(n.dtype===r.dtype,function(){return"x and y should have the same dtype, but got x ("+n.dtype+") and y ("+r.dtype+")."}),E(1===n.rank,function(){return"x should be 1D tensor, but got x ("+n.shape+")."}),E(1===r.rank,function(){return"y should be 1D tensor, but got y ("+r.shape+")."}),[4,n.data()];case 1:return i=l.sent(),[4,r.data()];case 2:for(o=l.sent(),s=new Set(o),a=0,h=0;h<i.length;h++)s.has(i[h])||a++;for(u=new mt([a],n.dtype),c=new mt([a],"int32"),h=0,d=0;h<i.length;h++)s.has(i[h])||(u.values[d]=i[h],c.values[d]=h,d++);return[2,[u.toTensor(),c.toTensor()]]}})})},fill:Tn,linspace:function(t,e,n){if(n<=0)throw new Error("The number of values should be positive.");return Pt.runKernelFunc(function(r){return r.linspace(t,e,n)},{})},ones:_n,range:xn,scalar:fn,tensor:dn,tensor1d:gn,tensor2d:mn,tensor3d:vn,tensor4d:bn,tensor5d:function(t,e,n){if(C(t),null!=e&&5!==e.length)throw new Error("tensor5d() requires shape to have five numbers");var r=Xe(t,n);if(5!==r.length&&1!==r.length)throw new Error("tensor5d() requires values to be number[][][][][] or flat/TypedArray");if(1===r.length&&null==e)throw new Error("tensor5d() requires shape to be provided when `values` are a flat array");return pn(t,e,r,n)},tensor6d:function(t,e,n){if(C(t),null!=e&&6!==e.length)throw new Error("tensor6d() requires shape to have six numbers");var r=Xe(t,n);if(6!==r.length&&1!==r.length)throw new Error("tensor6d() requires values to be number[][][][][][] or flat/TypedArray");if(1===r.length&&null==e)throw new Error("tensor6d() requires shape to be provided when `values` are a flat array");return pn(t,e=e||r,r,n)},variable:function(t,e,n,r){return void 0===e&&(e=!0),Pt.makeVariable(t,e,n,r)},zeros:yn,onesLike:En,zerosLike:wn,transpose:$l,softmax:Lr,logSoftmax:Pr,localResponseNormalization:Ul,norm:Vl,gather:$a,unsortedSegmentSum:Ua,basicLSTMCell:Hl,multiRNNCell:Wl,movingAverage:Gl,stridedSlice:zl,topk:Xl,scatterND:Kl,fft:Yl,ifft:ql,rfft:Jl,irfft:Zl,sparseToDense:tu,gatherND:eu,diag:nu,dropout:ru,hannWindow:su,hammingWindow:au,frame:lu,stft:uu,inTopKAsync:function(t,e,n){return void 0===n&&(n=1),a(this,void 0,void 0,function(){var r,i,o,s,a,u,c,h,d,p,f,g,m,v;return l(this,function(l){switch(l.label){case 0:return r=Ye(t,"predictions","inTopK"),i=Ye(e,"targets","inTopK"),E(r.rank>1,function(){return"inTopK() expects the predictions to be of rank 2 or higher, but got "+r.rank}),E(r.rank-1===i.rank,function(){return"predictions rank should be 1 larger than targets rank, but got predictions rank "+r.rank+" and targets rank "+i.rank}),w(r.shape.slice(0,r.shape.length-1),i.shape,"predictions's shape should be align with the targets' shape, except the last dimension."),o=r.shape[r.shape.length-1],E(n>0&&n<=o,function(){return"'k' passed to inTopK() must be > 0 && <= the predictions last dimension ("+o+"), but got "+n}),[4,r.data()];case 1:return s=l.sent(),[4,i.data()];case 2:for(a=l.sent(),u=[s.length/o,o],h=u[1],d=F("bool",c=u[0]),p=0;p<c;p++){for(f=p*h,g=s.subarray(f,f+h),m=[],v=0;v<g.length;v++)m.push({value:g[v],index:v});for(m.sort(function(t,e){return e.value-t.value}),d[p]=0,v=0;v<n;v++)if(m[v].index===a[p]){d[p]=1;break}}return t!==r&&r.dispose(),e!==i&&i.dispose(),[2,dn(d,i.shape,"bool")]}})})}});function Vu(t,e){Array.isArray(t)||(t=[t]),t.forEach(function(t){null!=t&&E("complex64"!==t.dtype,function(){return e+" does not support complex64 tensors."})})}function Hu(t,e,n,r){if("linear"===n)return t.linear(e);if("relu"===n)return t.relu(e);if("elu"===n)return t.elu(e);if("relu6"===n)return t.relu6(e);if("prelu"===n)return t.prelu(e,r);throw new Error("Activation "+n+" has not been implemented for the CPU backend.")}var Wu=function(t){function e(){var e=t.call(this)||this;return e.blockSize=48,e.firstUse=!0,e.data=new Fr(e,Pt),e}return s(e,t),e.prototype.write=function(t,e,n){this.firstUse&&(this.firstUse=!1,c().get("IS_NODE")&&ze("\n============================\nHi there 👋. Looks like you are running TensorFlow.js in Node.js. To speed things up dramatically, install our node backend, which binds to TensorFlow C++, by running npm i @tensorflow/tfjs-node, or npm i @tensorflow/tfjs-node-gpu if you have CUDA. Then call require('@tensorflow/tfjs-node'); (-gpu suffix for CUDA) at the start of your program. Visit https://github.com/tensorflow/tfjs-node for more details.\n============================"));var r={};return this.data.set(r,{values:t,dtype:n}),r},e.prototype.move=function(t,e,n,r){this.data.set(t,{values:e,dtype:r})},e.prototype.numDataIds=function(){return this.data.numDataIds()},e.prototype.read=function(t){return a(this,void 0,void 0,function(){return l(this,function(e){return[2,this.readSync(t)]})})},e.prototype.readSync=function(t){var e=this.data.get(t),n=e.dtype,r=e.complexTensors;return"complex64"===n?ii(this.readSync(r.real.dataId),this.readSync(r.imag.dataId)):this.data.get(t).values},e.prototype.bufferSync=function(t){var e=this.readSync(t.dataId),n=e;if("string"===t.dtype)try{n=e.map(function(t){return ot(t)})}catch(t){throw new Error("Failed to decode encoded string bytes into utf-8")}return Hn(t.shape,t.dtype,n)},e.prototype.makeOutput=function(t,e,n){var r=this.write(t,e,n);return Pt.makeTensorFromDataId(r,e,n,this)},e.prototype.disposeData=function(t){if(this.data.has(t)){var e=this.data.get(t).complexTensors;null!=e&&(e.real.dispose(),e.imag.dispose()),this.data.delete(t)}},e.prototype.time=function(t){return a(this,void 0,void 0,function(){var e;return l(this,function(n){return e=nt(),t(),[2,{kernelMs:nt()-e}]})})},e.prototype.memory=function(){return{unreliable:!0,reasons:["The reported memory is an upper bound. Due to automatic garbage collection, the true allocated memory may be less."]}},e.prototype.complex=function(t,e){var n=this.makeOutput(null,t.shape,"complex64");return this.data.get(n.dataId).complexTensors={real:Pt.keep(t.clone()),imag:Pt.keep(e.clone())},n},e.prototype.real=function(t){return this.data.get(t.dataId).complexTensors.real.clone()},e.prototype.imag=function(t){return this.data.get(t.dataId).complexTensors.imag.clone()},e.prototype.slice=function(t,e,n){if(Vu(t,"slice"),Nr(t.shape,e,n)){var r=Dr(e,t.strides),i=k(n);return dn(this.readSync(t.dataId).subarray(r,r+i),n,t.dtype)}for(var o=Hn(n,t.dtype),s=this.bufferSync(t),a=0;a<o.size;++a){var l=o.indexToLoc(a).map(function(t,n){return t+e[n]});o.values[a]=s.get.apply(s,l)}return o.toTensor()},e.prototype.stridedSlice=function(t,e,n,r){Vu(t,"stridedSlice");var i=Ir(e,n,r);if(i.some(function(t){return 0===t}))return dn([],i);for(var o=Hn(i,t.dtype),s=this.bufferSync(t),a=0;a<o.size;a++){for(var l=o.indexToLoc(a),u=new Array(l.length),c=0;c<u.length;c++)u[c]=l[c]*r[c]+e[c];o.set.apply(o,[s.get.apply(s,u)].concat(l))}return o.toTensor()},e.prototype.diag=function(t){for(var e=this.readSync(t.dataId),n=Hn([t.size,t.size],t.dtype),r=n.values,i=0;i<e.length;i++)r[i*t.size+i]=e[i];return n.toTensor()},e.prototype.unstack=function(t,e){for(var n=t.shape[e],r=new Array(t.rank-1),i=0,o=0;o<t.rank;o++)o!==e&&(r[i++]=t.shape[o]);var s=new Array(t.rank).fill(0),a=t.shape.slice();a[e]=1;var l=new Array(n);for(o=0;o<l.length;o++)s[e]=o,l[o]=this.slice(t,s,a).reshape(r);return l},e.prototype.reverse=function(t,e){Vu(t,"reverse");for(var n=Hn(t.shape,t.dtype),r=this.bufferSync(t),i=function(i){var o=n.indexToLoc(i),s=o.slice();e.forEach(function(e){return s[e]=t.shape[e]-1-s[e]}),n.set.apply(n,[r.get.apply(r,s)].concat(o))},o=0;o<n.size;o++)i(o);return n.toTensor()},e.prototype.concat=function(t,e){var n=this;if("complex64"===t[0].dtype){var r=t.map(function(t){return cn(t)}),i=t.map(function(t){return hn(t)});return un(this.concat(r,e),this.concat(i,e))}var o=t.map(function(t){var n=k(t.shape.slice(e));return t.as2D(-1,n)}),s=an(o.map(function(t){return t.shape}),1),a=Hn(s,t[0].dtype).values;if(1===o[0].shape[0]){var l=0;o.forEach(function(t){a.set(n.readSync(t.dataId),l),l+=t.size})}else{var u=0;o.forEach(function(t){for(var e=n.readSync(t.dataId),r=0,i=0;i<t.shape[0];++i)for(var o=i*s[1]+u,l=0;l<t.shape[1];++l)a[o+l]=e[r++];u+=t.shape[1]})}var c=an(t.map(function(t){return t.shape}),e);return dn(a,c,t[0].dtype)},e.prototype.neg=function(t){return Vu(t,"neg"),this.multiply(fn(-1),t)},e.prototype.add=function(t,e){return"complex64"===t.dtype||"complex64"===e.dtype?this.broadcastedBinaryComplexOp(t.cast("complex64"),e.cast("complex64"),function(t,e,n,r){return{real:t+n,imag:e+r}}):this.broadcastedBinaryOp(t,e,Ot(t.dtype,e.dtype),function(t,e){return t+e})},e.prototype.addN=function(t){var e=this;Vu(t,"addN");for(var n=t.map(function(t){return e.readSync(t.dataId)}),r=Hn(t[0].shape,t[0].dtype),i=r.values,o=0;o<t.length;o++)for(var s=n[o],a=0;a<i.length;a++)i[a]+=s[a];return r.toTensor()},e.prototype.softmax=function(t,e){var n=L([e],t.shape),r=this.max(t,n),i=tn(r.shape,n),o=this.subtract(t,r.reshape(i)),s=this.exp(o),a=this.sum(s,n).reshape(i);return this.realDivide(s,a)},e.prototype.subtract=function(t,e){return"complex64"===t.dtype||"complex64"===e.dtype?this.broadcastedBinaryComplexOp(t.cast("complex64"),e.cast("complex64"),function(t,e,n,r){return{real:t-n,imag:e-r}}):this.broadcastedBinaryOp(t,e,Ot(t.dtype,e.dtype),function(t,e){return t-e})},e.prototype.pow=function(t,e){return Vu([t,e],"pow"),this.broadcastedBinaryOp(t,e,t.dtype,function(t,e){return Math.pow(t,e)})},e.prototype.batchMatMul=function(t,e,n,r){Vu([t,e],"matMul");for(var i=n?t.shape[1]:t.shape[2],o=n?t.shape[2]:t.shape[1],s=r?e.shape[1]:e.shape[2],a=t.shape[0],l=this.readSync(t.dataId),u=this.readSync(e.dataId),c=n?[t.strides[0],1,t.strides[1]]:[t.strides[0],t.strides[1],1],h=c[0],d=c[1],p=c[2],f=r?[1,e.strides[1],e.strides[0]]:[e.strides[1],1,e.strides[0]],g=f[0],m=f[1],v=f[2],b=o*s,_=Hn([a,o,s],t.dtype),y=_.values,T=this.blockSize,x=0;x<a;x++)for(var E=0;E<o;E+=T)for(var w=0;w<s;w+=T)for(var C=0;C<i;C+=T)for(var S=Math.min(E+T,o),k=Math.min(w+T,s),O=Math.min(C+T,i),I=E;I<S;I++)for(var R=w;R<k;R++){for(var A=0,N=C;N<O;N++)A+=l[x*h+I*d+N*p]*u[N*g+R*m+x*v];y[x*b+(I*s+R)]+=A}return _.toTensor()},e.prototype.fusedBatchMatMul=function(t){var e=t.a,n=t.b,r=t.transposeA,i=t.transposeB,o=t.bias,s=t.activation,a=t.preluActivationWeights,l=this.batchMatMul(e,n,r,i);return o&&(l=this.add(l,o)),s&&(l=Hu(this,l,s,a)),l},e.prototype.multiply=function(t,e){return"complex64"===t.dtype||"complex64"===e.dtype?this.broadcastedBinaryComplexOp(t.cast("complex64"),e.cast("complex64"),function(t,e,n,r){return{real:t*n-e*r,imag:t*r+e*n}}):this.broadcastedBinaryOp(t,e,Ot(t.dtype,e.dtype),function(t,e){return t*e})},e.prototype.realDivide=function(t,e){return Vu([t,e],"realDivide"),this.broadcastedBinaryOp(t,e,"float32",function(t,e){return t/e})},e.prototype.floorDiv=function(t,e){return Vu([t,e],"floorDiv"),this.broadcastedBinaryOp(t,e,"int32",function(t,e){return Math.floor(t/e)})},e.prototype.sum=function(t,e){Vu(t,"sum"),en("sum",e,t.rank);for(var n=Qe(t.shape,e),r=n[0],i=n[1],o=yn(r,Ot(t.dtype,"int32")),s=k(i),a=this.readSync(o.dataId),l=this.readSync(t.dataId),u=0;u<a.length;++u){for(var c=u*s,h=0,d=0;d<s;++d)h+=l[c+d];a[u]=h}return o},e.prototype.prod=function(t,e){Vu(t,"sum");for(var n=Qe(t.shape,e),r=n[0],i=n[1],o=yn(r,Ot(t.dtype,"int32")),s=k(i),a=this.readSync(o.dataId),l=this.readSync(t.dataId),u=0;u<a.length;++u){for(var c=u*s,h=1,d=0;d<s;++d)h*=l[c+d];a[u]=h}return o},e.prototype.unsortedSegmentSum=function(t,e,n){Vu(t,"unsortedSegmentSum");for(var r=[],i=t.rank-e.rank,o=0;o<i;++o)e=e.expandDims(o+1);for(o=0;o<n;++o){var s=fn(o,"int32"),a=Sa(s,e).asType("float32").mul(t).sum(0);r.push(a)}return dr(r)},e.prototype.argMin=function(t,e){Vu(t,"argMin");var n=[e];en("argMin",n,t.rank);for(var r=Qe(t.shape,n),i=r[0],o=r[1],s=yn(i,"int32"),a=k(o),l=this.readSync(s.dataId),u=this.readSync(t.dataId),c=0;c<l.length;++c){for(var h=c*a,d=u[h],p=0,f=0;f<a;++f){var g=u[h+f];g<d&&(d=g,p=f)}l[c]=p}return s},e.prototype.argMax=function(t,e){Vu(t,"argMax");var n=[e];en("argMax",n,t.rank);for(var r=Qe(t.shape,n),i=r[0],o=r[1],s=yn(i,"int32"),a=k(o),l=this.readSync(s.dataId),u=this.readSync(t.dataId),c=0;c<l.length;++c){for(var h=c*a,d=u[h],p=0,f=0;f<a;++f){var g=u[h+f];g>d&&(d=g,p=f)}l[c]=p}return s},e.prototype.cumsum=function(t,e,n,r){if(Vu(t,"cumsum"),e!==t.rank-1)throw new Error("backend.cumsum in CPU expects an inner-most axis="+(t.rank-1)+" but got axis="+e);for(var i=Ot(t.dtype,"int32"),o=yn(t.shape,i),s=this.readSync(o.dataId),a=this.readSync(t.dataId),l=t.shape[t.rank-1],u=r?function(t,e){return t+l-e-1}:function(t,e){return t+e},c=0;c<a.length;c+=l)for(var h=0;h<l;h++){var d=u(c,h);if(0===h)s[d]=n?0:a[d];else{var p=u(c,h-1);s[d]=n?a[p]+s[p]:a[d]+s[p]}}return o},e.prototype.equal=function(t,e){return Vu([t,e],"equal"),this.broadcastedBinaryOp(t,e,"bool",function(t,e){return t===e?1:0})},e.prototype.notEqual=function(t,e){return Vu([t,e],"notEqual"),this.broadcastedBinaryOp(t,e,"bool",function(t,e){return t!==e?1:0})},e.prototype.less=function(t,e){return Vu([t,e],"less"),this.broadcastedBinaryOp(t,e,"bool",function(t,e){return t<e?1:0})},e.prototype.lessEqual=function(t,e){return Vu([t,e],"lessEqual"),this.broadcastedBinaryOp(t,e,"bool",function(t,e){return t<=e?1:0})},e.prototype.greater=function(t,e){return Vu([t,e],"greater"),this.broadcastedBinaryOp(t,e,"bool",function(t,e){return t>e?1:0})},e.prototype.greaterEqual=function(t,e){return Vu([t,e],"greaterEqual"),this.broadcastedBinaryOp(t,e,"bool",function(t,e){return t>=e?1:0})},e.prototype.logicalNot=function(t){Vu(t,"logicalNot");for(var e=this.readSync(t.dataId),n=new Uint8Array(e.length),r=0;r<e.length;++r)n[r]=e[r]?0:1;return this.makeOutput(n,t.shape,"bool")},e.prototype.logicalAnd=function(t,e){return Vu([t,e],"logicalAnd"),this.broadcastedBinaryOp(t,e,"bool",function(t,e){return t&&e})},e.prototype.logicalOr=function(t,e){return Vu([t,e],"logicalOr"),this.broadcastedBinaryOp(t,e,"bool",function(t,e){return t||e})},e.prototype.select=function(t,e,n){Vu([t,e,n],"select");for(var r=this.readSync(t.dataId),i=this.readSync(e.dataId),o=this.readSync(n.dataId),s=yn(e.shape,Ot(e.dtype,n.dtype)),a=this.readSync(s.dataId),l=0,u=0===t.rank||t.rank>1||1===e.rank?1:k(e.shape.slice(1)),c=0;c<r.length;c++)for(var h=0;h<u;h++)1===r[c]?a[l++]=i[c]:a[l++]=o[c];return s},e.prototype.where=function(t){Vu([t],"where");var e=this.readSync(t.dataId);return _i(t.shape,e)},e.prototype.topk=function(t,e,n){return Vu(t,"topk"),bi(this.readSync(t.dataId),t.shape,t.dtype,e)},e.prototype.min=function(t,e){Vu(t,"min"),en("min",e,t.rank);for(var n=Qe(t.shape,e),r=n[0],i=n[1],o=yn(r,t.dtype),s=k(i),a=this.readSync(o.dataId),l=this.readSync(t.dataId),u=0;u<a.length;++u){for(var c=u*s,h=l[c],d=0;d<s;++d){var p=l[c+d];p<h&&(h=p)}a[u]=h}return o},e.prototype.minimum=function(t,e){return Vu([t,e],"minimum"),this.broadcastedBinaryOp(t,e,t.dtype,function(t,e){return Math.min(t,e)})},e.prototype.mod=function(t,e){return Vu([t,e],"mod"),this.broadcastedBinaryOp(t,e,t.dtype,function(t,e){var n=t%e;return t<0&&e<0||t>=0&&e>=0?n:(n+e)%e})},e.prototype.max=function(t,e){Vu(t,"max"),en("max",e,t.rank);for(var n=Qe(t.shape,e),r=n[0],i=n[1],o=yn(r,t.dtype),s=k(i),a=this.readSync(o.dataId),l=this.readSync(t.dataId),u=0;u<a.length;++u){for(var c=u*s,h=l[c],d=0;d<s;++d){var p=l[c+d];p>h&&(h=p)}a[u]=h}return o},e.prototype.maximum=function(t,e){return Vu([t,e],"maximum"),this.broadcastedBinaryOp(t,e,t.dtype,function(t,e){return Math.max(t,e)})},e.prototype.all=function(t,e){Vu(t,"all"),en("all",e,t.rank);for(var n=Qe(t.shape,e),r=n[0],i=n[1],o=yn(r,t.dtype),s=k(i),a=this.readSync(o.dataId),l=this.readSync(t.dataId),u=0;u<a.length;++u){for(var c=u*s,h=l[c],d=0;d<s;++d){var p=l[c+d];h=h&&p}a[u]=h}return o},e.prototype.any=function(t,e){Vu(t,"any"),en("any",e,t.rank);for(var n=Qe(t.shape,e),r=n[0],i=n[1],o=yn(r,t.dtype),s=k(i),a=this.readSync(o.dataId),l=this.readSync(t.dataId),u=0;u<a.length;++u){for(var c=u*s,h=l[c],d=0;d<s;++d){var p=l[c+d];h=h||p}a[u]=h}return o},e.prototype.squaredDifference=function(t,e){return Vu([t,e],"squaredDifference"),this.broadcastedBinaryOp(t,e,t.dtype,function(t,e){var n=t-e;return n*n})},e.prototype.ceil=function(t){Vu(t,"ceil");for(var e=this.readSync(t.dataId),n=new Float32Array(e.length),r=0;r<e.length;++r)n[r]=Math.ceil(e[r]);return this.makeOutput(n,t.shape,"float32")},e.prototype.floor=function(t){Vu(t,"floor");for(var e=this.readSync(t.dataId),n=new Float32Array(e.length),r=0;r<e.length;++r)n[r]=Math.floor(e[r]);return this.makeOutput(n,t.shape,"float32")},e.prototype.sign=function(t){Vu(t,"x");for(var e=this.readSync(t.dataId),n=new Float32Array(e.length),r=0;r<e.length;++r)e[r]<0?n[r]=-1:e[r]>0?n[r]=1:n[r]=0;return this.makeOutput(n,t.shape,"float32")},e.prototype.isNaN=function(t){Vu(t,"x");for(var e=this.readSync(t.dataId),n=new Uint8Array(e.length),r=0;r<e.length;++r)Number.isNaN(e[r])&&(n[r]=1);return this.makeOutput(n,t.shape,"bool")},e.prototype.isInf=function(t){Vu(t,"x");for(var e=this.readSync(t.dataId),n=new Uint8Array(e.length),r=0;r<e.length;++r)Math.abs(e[r])===1/0&&(n[r]=1);return this.makeOutput(n,t.shape,"bool")},e.prototype.isFinite=function(t){Vu(t,"x");for(var e=this.readSync(t.dataId),n=new Uint8Array(e.length),r=0;r<e.length;++r)Number.isFinite(e[r])&&(n[r]=1);return this.makeOutput(n,t.shape,"bool")},e.prototype.round=function(t){Vu(t,"round");for(var e=this.readSync(t.dataId),n=new Float32Array(e.length),r=0;r<e.length;++r){var i=Math.floor(e[r]);e[r]-i<.5?n[r]=Math.floor(e[r]):e[r]-i>.5?n[r]=Math.ceil(e[r]):n[r]=i%2==0?i:i+1}return this.makeOutput(n,t.shape,"float32")},e.prototype.exp=function(t){Vu(t,"exp");for(var e=this.readSync(t.dataId),n=new Float32Array(e.length),r=0;r<e.length;++r)n[r]=Math.exp(e[r]);return this.makeOutput(n,t.shape,"float32")},e.prototype.expm1=function(t){Vu(t,"expm1");for(var e=this.readSync(t.dataId),n=new Float32Array(e.length),r=0;r<e.length;++r)n[r]=Math.expm1(e[r]);return this.makeOutput(n,t.shape,"float32")},e.prototype.log=function(t){Vu(t,"log");for(var e=this.readSync(t.dataId),n=new Float32Array(e.length),r=0;r<e.length;++r){var i=e[r];n[r]=Math.log(i)}return this.makeOutput(n,t.shape,"float32")},e.prototype.log1p=function(t){Vu(t,"log1p");for(var e=this.readSync(t.dataId),n=new Float32Array(e.length),r=0;r<e.length;++r){var i=e[r];n[r]=Math.log1p(i)}return this.makeOutput(n,t.shape,"float32")},e.prototype.sqrt=function(t){Vu(t,"sqrt");for(var e=this.readSync(t.dataId),n=new Float32Array(e.length),r=0;r<e.length;++r){var i=e[r];n[r]=Math.sqrt(i)}return this.makeOutput(n,t.shape,"float32")},e.prototype.rsqrt=function(t){Vu(t,"rsqrt");for(var e=this.readSync(t.dataId),n=new Float32Array(e.length),r=0;r<e.length;++r){var i=e[r];n[r]=1/Math.sqrt(i)}return this.makeOutput(n,t.shape,"float32")},e.prototype.reciprocal=function(t){Vu(t,"reciprocal");for(var e=this.readSync(t.dataId),n=new Float32Array(e.length),r=0;r<e.length;++r)n[r]=1/e[r];return this.makeOutput(n,t.shape,"float32")},e.prototype.linear=function(t){return t},e.prototype.relu=function(t){Vu(t,"relu");for(var e=yn(t.shape,t.dtype),n=this.readSync(e.dataId),r=this.readSync(t.dataId),i=0;i<r.length;++i)n[i]=Math.max(0,r[i]);return e},e.prototype.relu6=function(t){Vu(t,"relu");for(var e=yn(t.shape,t.dtype),n=this.readSync(e.dataId),r=this.readSync(t.dataId),i=0;i<r.length;++i)n[i]=Math.min(Math.max(0,r[i]),6);return e},e.prototype.prelu=function(t,e){return Vu([t,e],"prelu"),this.broadcastedBinaryOp(t,e,t.dtype,function(t,e){return t<0?e*t:t})},e.prototype.elu=function(t){Vu(t,"elu");for(var e=new Float32Array(t.size),n=this.readSync(t.dataId),r=0;r<n.length;++r){var i=n[r];e[r]=i>=0?i:Math.exp(i)-1}return this.makeOutput(e,t.shape,"float32")},e.prototype.eluDer=function(t,e){Vu([t,e],"eluDer");for(var n=new Float32Array(e.size),r=this.readSync(e.dataId),i=this.readSync(t.dataId),o=0;o<r.length;++o){var s=r[o];n[o]=s>=1?i[o]:i[o]*(s+1)}return this.makeOutput(n,e.shape,"float32")},e.prototype.selu=function(t){Vu(t,"selu");for(var e=new Float32Array(t.size),n=this.readSync(t.dataId),r=0;r<n.length;++r){var i=n[r];e[r]=i>=0?1.0507009873554805*i:1.7580993408473768*(Math.exp(i)-1)}return this.makeOutput(e,t.shape,"float32")},e.prototype.clip=function(t,e,n){Vu(t,"clip");for(var r=new Float32Array(t.size),i=this.readSync(t.dataId),o=0;o<i.length;++o){var s=i[o];r[o]=s>n?n:s<e?e:s}return this.makeOutput(r,t.shape,"float32")},e.prototype.abs=function(t){for(var e=new Float32Array(t.size),n=this.readSync(t.dataId),r=0;r<n.length;++r)e[r]=Math.abs(n[r]);return this.makeOutput(e,t.shape,"float32")},e.prototype.complexAbs=function(t){for(var e=new Float32Array(t.size),n=this.readSync(t.dataId),r=0;r<t.size;++r){var i=n[2*r],o=n[2*r+1];e[r]=Math.hypot(i,o)}return this.makeOutput(e,t.shape,"float32")},e.prototype.int=function(t){Vu(t,"int");for(var e=new Int32Array(t.size),n=this.readSync(t.dataId),r=0;r<n.length;++r)e[r]=n[r];return this.makeOutput(e,t.shape,"int32")},e.prototype.sigmoid=function(t){Vu(t,"sigmoid");for(var e=new Float32Array(t.size),n=this.readSync(t.dataId),r=0;r<n.length;++r)e[r]=1/(1+Math.exp(-n[r]));return this.makeOutput(e,t.shape,"float32")},e.prototype.softplus=function(t){Vu(t,"softplus");for(var e=Math.log(1.1920928955078125e-7)+2,n=new Float32Array(t.size),r=this.readSync(t.dataId),i=0;i<r.length;++i){var o,s=r[i]>-e,a=r[i]<e,l=Math.exp(r[i]);o=a?l:s?r[i]:Math.log(1+l),n[i]=o}return this.makeOutput(n,t.shape,"float32")},e.prototype.sin=function(t){Vu(t,"sin");for(var e=new Float32Array(t.size),n=this.readSync(t.dataId),r=0;r<n.length;++r)e[r]=Math.sin(n[r]);return this.makeOutput(e,t.shape,"float32")},e.prototype.cos=function(t){Vu(t,"cos");for(var e=new Float32Array(t.size),n=this.readSync(t.dataId),r=0;r<n.length;++r)e[r]=Math.cos(n[r]);return this.makeOutput(e,t.shape,"float32")},e.prototype.tan=function(t){Vu(t,"tan");for(var e=new Float32Array(t.size),n=this.readSync(t.dataId),r=0;r<n.length;++r)e[r]=Math.tan(n[r]);return this.makeOutput(e,t.shape,"float32")},e.prototype.asin=function(t){Vu(t,"asin");for(var e=new Float32Array(t.size),n=this.readSync(t.dataId),r=0;r<n.length;++r)e[r]=Math.asin(n[r]);return this.makeOutput(e,t.shape,"float32")},e.prototype.acos=function(t){Vu(t,"acos");for(var e=new Float32Array(t.size),n=this.readSync(t.dataId),r=0;r<n.length;++r)e[r]=Math.acos(n[r]);return this.makeOutput(e,t.shape,"float32")},e.prototype.atan=function(t){Vu(t,"atan");for(var e=new Float32Array(t.size),n=this.readSync(t.dataId),r=0;r<n.length;++r)e[r]=Math.atan(n[r]);return this.makeOutput(e,t.shape,"float32")},e.prototype.atan2=function(t,e){return Vu([t,e],"atan2"),this.broadcastedBinaryOp(t,e,t.dtype,function(t,e){return Math.atan2(t,e)})},e.prototype.sinh=function(t){Vu(t,"sinh");for(var e=new Float32Array(t.size),n=this.readSync(t.dataId),r=0;r<n.length;++r)e[r]=Math.sinh(n[r]);return this.makeOutput(e,t.shape,"float32")},e.prototype.cosh=function(t){Vu(t,"cosh");for(var e=new Float32Array(t.size),n=this.readSync(t.dataId),r=0;r<n.length;++r)e[r]=Math.cosh(n[r]);return this.makeOutput(e,t.shape,"float32")},e.prototype.tanh=function(t){Vu(t,"tanh");for(var e=new Float32Array(t.size),n=this.readSync(t.dataId),r=0;r<n.length;++r)e[r]=R(n[r]);return this.makeOutput(e,t.shape,"float32")},e.prototype.asinh=function(t){Vu(t,"asinh");for(var e=new Float32Array(t.size),n=this.readSync(t.dataId),r=0;r<n.length;++r)e[r]=Math.asinh(n[r]);return this.makeOutput(e,t.shape,"float32")},e.prototype.acosh=function(t){Vu(t,"acosh");for(var e=new Float32Array(t.size),n=this.readSync(t.dataId),r=0;r<n.length;++r)e[r]=Math.acosh(n[r]);return this.makeOutput(e,t.shape,"float32")},e.prototype.atanh=function(t){Vu(t,"atanh");for(var e=new Float32Array(t.size),n=this.readSync(t.dataId),r=0;r<n.length;++r)e[r]=Math.atanh(n[r]);return this.makeOutput(e,t.shape,"float32")},e.prototype.erf=function(t){Vu(t,"erf");for(var e=new Float32Array(t.size),n=this.readSync(t.dataId),r=0;r<n.length;++r){var i=Math.sign(n[r]),o=Math.abs(n[r]),s=1/(1+.3275911*o);e[r]=i*(1-((((1.061405429*s-1.453152027)*s+1.421413741)*s-.284496736)*s+.254829592)*s*Math.exp(-o*o))}return this.makeOutput(e,t.shape,"float32")},e.prototype.step=function(t,e){void 0===e&&(e=0),Vu(t,"step");for(var n=new Float32Array(t.size),r=this.readSync(t.dataId),i=0;i<r.length;++i){var o=r[i];isNaN(o)?n[i]=NaN:n[i]=o>0?1:e}return this.makeOutput(n,t.shape,"float32")},e.prototype.fusedConv2d=function(t){var e=t.input,n=t.filter,r=t.convInfo,i=t.bias,o=t.activation,s=t.preluActivationWeights,a=this.conv2d(e,n,r);return i&&(a=this.add(a,i)),o&&(a=Hu(this,a,o,s)),a},e.prototype.conv2d=function(t,e,n){Vu([t,e],"conv2d");for(var r=n.filterHeight,i=n.filterWidth,o=n.dilationHeight,s=n.dilationWidth,a=n.padInfo.left,l=n.padInfo.top,u="channelsLast"===n.dataFormat,c=Hn(n.outShape,t.dtype),h=t.strides[0],d=u?t.strides[1]:t.strides[2],p=u?t.strides[2]:1,f=u?1:t.strides[1],g=c.strides[0],m=u?c.strides[1]:c.strides[2],v=u?c.strides[2]:1,b=u?1:c.strides[1],_=this.readSync(t.dataId),y=this.readSync(e.dataId),T=c.values,x=0;x<n.batchSize;++x)for(var E=x*h,w=x*g,C=0;C<n.outHeight;++C)for(var S=w+C*m,k=C*n.strideHeight-l,O=0;O<r;O++){var I=k+O*o;if(!(I<0||I>=n.inHeight))for(var R=O*e.strides[0],A=E+I*d,N=0;N<n.outWidth;++N)for(var D=S+N*v,M=N*n.strideWidth-a,L=0;L<i;L++){var P=M+L*s;if(!(P<0||P>=n.inWidth))for(var F=A+P*p,B=R+L*e.strides[1],j=0;j<n.inChannels;++j){for(var $=_[F+j*f],U=0;U<n.outChannels;++U)T[D+U*b]+=$*y[B+U];B+=n.outChannels}}}return c.toTensor()},e.prototype.conv3d=function(t,e,n){for(var r=n.filterDepth,i=n.filterHeight,o=n.filterWidth,s=n.dilationDepth,a=n.dilationHeight,l=n.dilationWidth,u=n.padInfo.front,c=n.padInfo.left,h=n.padInfo.top,d=Hn(n.outShape,t.dtype),p=this.readSync(t.dataId),f=this.readSync(e.dataId),g=d.values,m=0;m<n.batchSize;++m)for(var v=m*t.strides[0],b=m*d.strides[0],_=0;_<n.outDepth;++_)for(var y=b+_*d.strides[1],T=_*n.strideDepth-u,x=0;x<r;x++){var E=T+x*s;if(!(E<0||E>=n.inDepth))for(var w=x*e.strides[0],C=v+E*t.strides[1],S=0;S<n.outHeight;++S)for(var k=y+S*d.strides[2],O=S*n.strideHeight-h,I=0;I<i;I++){var R=O+I*a;if(!(R<0||R>=n.inHeight))for(var A=w+I*e.strides[1],N=C+R*t.strides[2],D=0;D<n.outWidth;++D)for(var M=k+D*n.outChannels,L=D*n.strideWidth-c,P=0;P<o;P++){var F=L+P*l;if(!(F<0||F>=n.inWidth))for(var B=A+P*e.strides[2],j=N+F*n.inChannels,$=B,U=0;U<n.inChannels;++U){for(var V=p[j+U],H=0;H<n.outChannels;++H)g[M+H]+=V*f[$+H];$+=n.outChannels}}}}return d.toTensor()},e.prototype.conv2dDerInput=function(t,e,n){Vu([t,e],"conv2dDerInput");for(var r=Hn(n.inShape,"float32"),i=r.values,o=this.readSync(t.dataId),s=this.readSync(e.dataId),a=e.strides,l=a[0],u=a[1],c=a[2],h=n.batchSize,d=n.filterHeight,p=n.filterWidth,f=n.inChannels,g=n.inHeight,m=n.inWidth,v=n.outChannels,b=n.outHeight,_=n.outWidth,y=n.strideHeight,T=n.strideWidth,x=n.dataFormat,E=d-1-n.padInfo.top,w=p-1-n.padInfo.left,C="channelsLast"===x,S=r.strides[0],k=C?r.strides[1]:r.strides[2],O=C?r.strides[2]:1,I=C?1:r.strides[1],R=t.strides[0],A=C?t.strides[1]:t.strides[2],N=C?t.strides[2]:1,D=C?1:t.strides[1],M=0;M<h;++M)for(var L=0;L<f;++L)for(var P=0;P<g;++P)for(var F=P-E,B=Math.max(0,Math.ceil(F/y)),j=Math.min(b,(d+F)/y),$=0;$<m;++$){for(var U=$-w,V=Math.max(0,Math.ceil(U/T)),H=Math.min(_,(p+U)/T),W=0,G=B;G<j;++G)for(var z=G*y-F,X=V;X<H;++X)for(var K=R*M+A*G+N*X,Y=l*(d-1-z)+u*(p-1-(X*T-U))+c*L,q=0;q<v;++q)W+=o[K+D*q]*s[Y+q];i[S*M+k*P+O*$+I*L]=W}return r.toTensor()},e.prototype.conv3dDerInput=function(t,e,n){for(var r=Hn(n.inShape,"float32"),i=r.values,o=r.strides,s=o[0],a=o[1],l=o[2],u=o[3],c=this.readSync(t.dataId),h=t.strides,d=h[0],p=h[1],f=h[2],g=h[3],m=this.readSync(e.dataId),v=e.strides,b=v[0],_=v[1],y=v[2],T=v[3],x=n.batchSize,E=n.filterDepth,w=n.filterHeight,C=n.filterWidth,S=n.inChannels,k=n.inDepth,O=n.inHeight,I=n.inWidth,R=n.outChannels,A=n.outDepth,N=n.outHeight,D=n.outWidth,M=n.strideDepth,L=n.strideHeight,P=n.strideWidth,F=E-1-n.padInfo.front,B=w-1-n.padInfo.top,j=C-1-n.padInfo.left,$=0;$<x;++$)for(var U=0;U<S;++U)for(var V=0;V<k;++V)for(var H=V-F,W=Math.max(0,Math.ceil(H/M)),G=Math.min(A,(E+H)/M),z=0;z<O;++z)for(var X=z-B,K=Math.max(0,Math.ceil(X/L)),Y=Math.min(N,(w+X)/L),q=0;q<I;++q){for(var J=q-j,Z=Math.max(0,Math.ceil(J/P)),Q=Math.min(D,(C+J)/P),tt=0,et=W;et<G;++et)for(var nt=et*M-H,rt=K;rt<Y;++rt)for(var it=rt*L-X,ot=Z;ot<Q;++ot)for(var st=d*$+p*et+f*rt+g*ot,at=b*(E-1-nt)+_*(w-1-it)+y*(C-1-(ot*P-J))+T*U,lt=0;lt<R;++lt)tt+=c[st+lt]*m[at+lt];i[s*$+a*V+l*z+u*q+U]=tt}return r.toTensor()},e.prototype.conv2dDerFilter=function(t,e,n){Vu([t,e],"conv2dDerFilter");for(var r=n.strideHeight,i=n.strideWidth,o=n.filterHeight,s=n.filterWidth,a="channelsLast"===n.dataFormat,l=Hn(n.filterShape,"float32"),u=n.padInfo.left,c=n.padInfo.top,h=this.bufferSync(t),d=this.bufferSync(e),p=0;p<o;++p)for(var f=Math.max(0,Math.ceil((c-p)/r)),g=Math.min(n.outHeight,(n.inHeight+c-p)/r),m=0;m<s;++m)for(var v=Math.max(0,Math.ceil((u-m)/i)),b=Math.min(n.outWidth,(n.inWidth+u-m)/i),_=0;_<n.inChannels;++_)for(var y=0;y<n.outChannels;++y){for(var T=0,x=0;x<n.batchSize;++x)for(var E=f;E<g;++E)for(var w=p+E*r-c,C=v;C<b;++C){var S=m+C*i-u;T+=a?h.get(x,w,S,_)*d.get(x,E,C,y):h.get(x,_,w,S)*d.get(x,y,E,C)}l.set(T,p,m,_,y)}return l.toTensor()},e.prototype.conv3dDerFilter=function(t,e,n){for(var r=n.strideDepth,i=n.strideHeight,o=n.strideWidth,s=n.filterDepth,a=n.filterHeight,l=n.filterWidth,u=Hn(n.filterShape,"float32"),c=u.values,h=u.strides,d=h[0],p=h[1],f=h[2],g=h[3],m=this.readSync(e.dataId),v=e.strides,b=v[0],_=v[1],y=v[2],T=v[3],x=this.readSync(t.dataId),E=t.strides,w=E[0],C=E[1],S=E[2],k=E[3],O=n.padInfo.front,I=n.padInfo.left,R=n.padInfo.top,A=0;A<s;++A)for(var N=Math.max(0,Math.ceil((O-A)/r)),D=Math.min(n.outDepth,(n.inDepth+O-A)/r),M=A*d,L=0;L<a;++L)for(var P=Math.max(0,Math.ceil((R-L)/i)),F=Math.min(n.outHeight,(n.inHeight+R-L)/i),B=L*p+M,j=0;j<l;++j)for(var $=Math.max(0,Math.ceil((I-j)/o)),U=Math.min(n.outWidth,(n.inWidth+I-j)/o),V=j*f+B,H=0;H<n.inChannels;++H)for(var W=H*g+V,G=0;G<n.outChannels;++G){for(var z=0,X=0;X<n.batchSize;++X)for(var K=X*w,Y=X*b,q=N;q<D;++q)for(var J=(A+q*r-O)*C+K,Z=q*_+Y,Q=P;Q<F;++Q)for(var tt=(L+Q*i-R)*S+J,et=Q*y+Z,nt=$;nt<U;++nt){var rt=nt*T+et;z+=x[(j+nt*o-I)*k+tt+H]*m[rt+G]}c[W+G]=z}return u.toTensor()},e.prototype.fusedDepthwiseConv2D=function(t){var e=t.input,n=t.filter,r=t.convInfo,i=t.bias,o=t.activation,s=t.preluActivationWeights,a=this.depthwiseConv2D(e,n,r);return i&&(a=this.add(a,i)),o&&(a=Hu(this,a,o,s)),a},e.prototype.depthwiseConv2D=function(t,e,n){Vu([t,e],"depthwiseConv2D");for(var r=n.filterHeight,i=n.filterWidth,o=n.dilationHeight,s=n.dilationWidth,a=n.padInfo.left,l=n.padInfo.top,u=n.outChannels/n.inChannels,c=Hn(n.outShape,t.dtype),h=this.readSync(t.dataId),d=this.readSync(e.dataId),p=c.values,f=0;f<n.batchSize;++f)for(var g=f*t.strides[0],m=f*c.strides[0],v=0;v<n.outHeight;++v)for(var b=m+v*c.strides[1],_=v*n.strideHeight-a,y=0;y<r;++y){var T=_+y*o;if(!(T<0||T>=n.inHeight))for(var x=y*e.strides[0],E=g+T*t.strides[1],w=0;w<n.outWidth;++w)for(var C=b+w*c.strides[2],S=w*n.strideWidth-l,k=0;k<i;++k){var O=S+k*s;if(!(O<0||O>=n.inWidth))for(var I=x+k*e.strides[1],R=E+O*n.inChannels,A=C,N=I,D=0;D<n.inChannels;++D){for(var M=h[R+D],L=0;L<u;++L)p[A+L]+=M*d[N+L];A+=u,N+=u}}}return c.toTensor()},e.prototype.depthwiseConv2DDerInput=function(t,e,n){Vu([t,e],"depthwiseConv2DDerInput");for(var r=Hn(n.inShape,"float32"),i=r.values,o=r.strides,s=o[0],a=o[1],l=o[2],u=this.readSync(t.dataId),c=t.strides,h=c[0],d=c[1],p=c[2],f=this.readSync(e.dataId),g=e.strides,m=g[0],v=g[1],b=g[2],_=n.batchSize,y=n.filterHeight,T=n.filterWidth,x=n.inChannels,E=n.inHeight,w=n.inWidth,C=n.outChannels,S=n.outHeight,k=n.outWidth,O=n.strideHeight,I=n.strideWidth,R=y-1-n.padInfo.top,A=T-1-n.padInfo.left,N=C/x,D=0;D<_;++D)for(var M=0;M<x;++M)for(var L=0;L<E;++L)for(var P=L-R,F=Math.max(0,Math.ceil(P/O)),B=Math.min(S,(y+P)/O),j=0;j<w;++j){for(var $=j-A,U=Math.max(0,Math.ceil($/I)),V=Math.min(k,(T+$)/I),H=0,W=F;W<B;++W)for(var G=W*O-P,z=U;z<V;++z)for(var X=h*D+d*W+p*z,K=m*(y-1-G)+v*(T-1-(z*I-$))+b*M,Y=0;Y<N;++Y)H+=u[X+(M*N+Y)]*f[K+Y];i[s*D+a*L+l*j+M]=H}return r.toTensor()},e.prototype.depthwiseConv2DDerFilter=function(t,e,n){Vu([t,e],"depthwiseConv2DDerFilter");for(var r=n.strideHeight,i=n.strideWidth,o=n.filterHeight,s=n.filterWidth,a=Hn(n.filterShape,"float32"),l=n.padInfo.left,u=n.padInfo.top,c=n.outChannels/n.inChannels,h=this.bufferSync(t),d=this.bufferSync(e),p=0;p<o;++p)for(var f=Math.max(0,Math.ceil((u-p)/r)),g=Math.min(n.outHeight,(n.inHeight+u-p)/r),m=0;m<s;++m)for(var v=Math.max(0,Math.ceil((l-m)/i)),b=Math.min(n.outWidth,(n.inWidth+l-m)/i),_=0;_<n.outChannels;++_){for(var y=Math.trunc(_/c),T=_%c,x=0,E=0;E<n.batchSize;++E)for(var w=f;w<g;++w)for(var C=p+w*r-u,S=v;S<b;++S){var k=m+S*i-l;x+=h.get(E,C,k,y)*d.get(E,w,S,_)}a.set(x,p,m,y,T)}return a.toTensor()},e.prototype.tile=function(t,e){return Vu(t,"tile"),vi(this.bufferSync(t),e)},e.prototype.pad=function(t,e,n){Vu(t,"pad");var r=e.map(function(e,n){return e[0]+t.shape[n]+e[1]}),i=e.map(function(t){return t[0]}),o=this.bufferSync(t),s=Hn(r,t.dtype);0!==n&&s.values.fill(n);for(var a=0;a<t.size;a++){var l=o.indexToLoc(a),u=l.map(function(t,e){return t+i[e]});s.set.apply(s,[o.get.apply(o,l)].concat(u))}return s.toTensor()},e.prototype.transpose=function(t,e){Vu(t,"transpose");for(var n=new Array(t.rank),r=0;r<n.length;r++)n[r]=t.shape[e[r]];var i=this.readSync(t.dataId),o=Hn(n,t.dtype),s=this.bufferSync(t);for(r=0;r<t.size;++r){for(var a=s.indexToLoc(r),l=new Array(a.length),u=0;u<l.length;u++)l[u]=a[e[u]];var c=o.locToIndex(l);o.values[c]=i[r]}return o.toTensor()},e.prototype.gather=function(t,e,n){Vu([t,e],"gather");var r=t.shape.slice(),i=this.readSync(e.dataId);r[n]=i.length;for(var o=Hn(r,t.dtype),s=this.bufferSync(t),a=0;a<o.size;++a){var l=o.indexToLoc(a),u=l.slice();u[n]=i[l[n]];var c=s.locToIndex(u);o.values[a]=s.values[c]}return o.toTensor()},e.prototype.batchToSpaceND=function(t,e,n){Vu([t],"batchToSpaceND");var r=e.reduce(function(t,e){return t*e}),i=mr(t.shape,e,r),o=vr(i.length,e.length),s=br(t.shape,e,r),a=_r(n,e.length),l=yr(s,n,e.length);return t.reshape(i).transpose(o).reshape(s).slice(a,l)},e.prototype.spaceToBatchND=function(t,e,n){Vu([t],"spaceToBatchND");var r=e.reduce(function(t,e){return t*e}),i=[[0,0]];i.push.apply(i,n);for(var o=1+e.length;o<t.shape.length;++o)i.push([0,0]);var s=t.pad(i),a=mr(s.shape,e,r,!1),l=vr(a.length,e.length,!1),u=br(s.shape,e,r,!1);return s.reshape(a).transpose(l).reshape(u)},e.prototype.pool=function(t,e,n){Vu(t,"pool");for(var r=e.strideHeight,i=e.strideWidth,o=e.dilationHeight,s=e.dilationWidth,a=e.effectiveFilterHeight,l=e.effectiveFilterWidth,u=e.padInfo.top,c=e.padInfo.left,h="max"===n?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,d=this.readSync(t.dataId),p=Hn(e.outShape,t.dtype),f=p.values,g=e.outShape[1]*e.outShape[2]*e.outShape[3],m=e.outShape[2]*e.outShape[3],v=e.outShape[3],b=0;b<e.batchSize;++b)for(var _=b*g,y=b*t.strides[0],T=0;T<e.inChannels;++T)for(var x=0;x<e.outHeight;++x)for(var E=x*r-u,w=Math.max(0,E),C=Math.min(e.inHeight,a+E),S=_+x*m,k=0;k<e.outWidth;++k){for(var O=k*i-c,I=Math.max(0,O),R=Math.min(e.inWidth,l+O),A=h,N=0,D=0,M=w;M<C;M+=o){for(var L=y+M*t.strides[1],P=I;P<R;P+=s){var F=d[L+P*t.strides[2]+T];"max"===n&&F>A?A=F:"avg"===n&&(N+=F,D++)}if(isNaN(A))break}f[S+k*v+T]="avg"===n?N/D:A}return p.toTensor()},e.prototype.maxPool=function(t,e){return this.pool(t,e,"max")},e.prototype.maxPoolPositions=function(t,e){for(var n=Hn(e.outShape,"int32"),r=e.strideHeight,i=e.strideWidth,o=e.dilationHeight,s=e.dilationWidth,a=e.effectiveFilterHeight,l=e.effectiveFilterWidth,u=e.padInfo.top,c=e.padInfo.left,h=this.bufferSync(t),d=0;d<e.batchSize;++d)for(var p=0;p<e.inChannels;++p)for(var f=0;f<e.outHeight;++f){for(var g=f*r-u,m=g;m<0;)m+=o;for(var v=Math.min(e.inHeight,a+g),b=0;b<e.outWidth;++b){for(var _=b*i-c,y=_;y<0;)y+=s;for(var T=Math.min(e.inWidth,l+_),x=Number.NEGATIVE_INFINITY,E=-1,w=m;w<v;w+=o)for(var C=w-g,S=y;S<T;S+=s){var k=S-_,O=h.get(d,w,S,p);O>x&&(x=O,E=C*l+k)}n.set(E,d,f,b,p)}}return n.toTensor()},e.prototype.maxPoolBackprop=function(t,e,n,r){Vu([e,n],"maxPoolBackprop");for(var i=this.maxPoolPositions(e,r),o=r.strideHeight,s=r.strideWidth,a=r.dilationHeight,l=r.dilationWidth,u=r.effectiveFilterHeight,c=r.effectiveFilterWidth,h=c-1-r.padInfo.left,d=u-1-r.padInfo.top,p=Hn(e.shape,"float32"),f=this.bufferSync(i),g=this.bufferSync(t),m=0;m<r.batchSize;++m)for(var v=0;v<r.inChannels;++v)for(var b=0;b<r.inHeight;++b)for(var _=0;_<r.inWidth;++_){for(var y=b-d,T=_-h,x=0,E=0;E<u;E+=a){var w=(y+E)/o;if(!(w<0||w>=r.outHeight||Math.floor(w)!==w))for(var C=0;C<c;C+=l){var S=(T+C)/s;if(!(S<0||S>=r.outWidth||Math.floor(S)!==S)){var k=u*c-1-f.get(m,w,S,v)===E*c+C?1:0;0!==k&&(x+=g.get(m,w,S,v)*k)}}}p.set(x,m,b,_,v)}return p.toTensor()},e.prototype.avgPoolBackprop=function(t,e,n){Vu([t,e],"avgPoolBackprop");for(var r=n.strideHeight,i=n.strideWidth,o=n.filterHeight,s=n.filterWidth,a=n.dilationHeight,l=n.dilationWidth,u=n.effectiveFilterHeight,c=n.effectiveFilterWidth,h=c-1-n.padInfo.left,d=u-1-n.padInfo.top,p=Hn(e.shape,"float32"),f=1/(o*s),g=this.bufferSync(t),m=0;m<n.batchSize;++m)for(var v=0;v<n.inChannels;++v)for(var b=0;b<n.inHeight;++b)for(var _=0;_<n.inWidth;++_){for(var y=b-d,T=_-h,x=0,E=0;E<u;E+=a){var w=(y+E)/r;if(!(w<0||w>=n.outHeight||Math.floor(w)!==w))for(var C=0;C<c;C+=l){var S=(T+C)/i;S<0||S>=n.outWidth||Math.floor(S)!==S||(x+=g.get(m,w,S,v))}}p.set(x*f,m,b,_,v)}return p.toTensor()},e.prototype.pool3d=function(t,e,n){Vu(t,"pool3d");for(var r=e.strideDepth,i=e.strideHeight,o=e.strideWidth,s=e.dilationDepth,a=e.dilationHeight,l=e.dilationWidth,u=e.effectiveFilterDepth,c=e.effectiveFilterHeight,h=e.effectiveFilterWidth,d=e.padInfo.front,p=e.padInfo.top,f=e.padInfo.left,g="max"===n?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,m=this.readSync(t.dataId),v=Hn(e.outShape,t.dtype),b=v.values,_=e.outShape[1]*e.outShape[2]*e.outShape[3]*e.outShape[4],y=e.outShape[2]*e.outShape[3]*e.outShape[4],T=e.outShape[3]*e.outShape[4],x=e.outShape[4],E=0;E<e.batchSize;++E)for(var w=E*_,C=E*t.strides[0],S=0;S<e.inChannels;++S)for(var k=0;k<e.outDepth;++k){for(var O=k*r-d,I=O;I<0;)I+=s;for(var R=Math.min(e.inDepth,u+O),A=w+k*y,N=0;N<e.outHeight;++N){for(var D=N*i-p,M=D;M<0;)M+=a;for(var L=Math.min(e.inHeight,c+D),P=A+N*T,F=0;F<e.outWidth;++F){for(var B=F*o-f,j=B;j<0;)j+=l;for(var $=Math.min(e.inWidth,h+B),U=P+F*x,V=g,H=0,W=0,G=I;G<R;G+=s){for(var z=C+G*t.strides[1],X=M;X<L;X+=a){for(var K=z+X*t.strides[2],Y=j;Y<$;Y+=l){var q=m[K+Y*t.strides[3]+S];if("max"===n&&q>V?V=q:"avg"===n&&(H+=q,W++),isNaN(V))break}if(isNaN(V))break}if(isNaN(V))break}b[U+S]="avg"===n?H/W:V}}}return v.toTensor()},e.prototype.avgPool3d=function(t,e){return Vu(t,"avgPool3d"),this.pool3d(t,e,"avg").toFloat()},e.prototype.avgPool3dBackprop=function(t,e,n){Vu([t,e],"avgPool3dBackprop");for(var r=n.strideDepth,i=n.strideHeight,o=n.strideWidth,s=n.filterDepth,a=n.filterHeight,l=n.filterWidth,u=n.dilationDepth,c=n.dilationHeight,h=n.dilationWidth,d=n.effectiveFilterDepth,p=n.effectiveFilterHeight,f=n.effectiveFilterWidth,g=d-1-n.padInfo.front,m=f-1-n.padInfo.left,v=p-1-n.padInfo.top,b=Hn(e.shape,"float32"),_=1/(s*a*l),y=this.bufferSync(t),T=0;T<n.batchSize;++T)for(var x=0;x<n.inChannels;++x)for(var E=0;E<n.inDepth;++E)for(var w=0;w<n.inHeight;++w)for(var C=0;C<n.inWidth;++C){for(var S=E-g,k=w-v,O=C-m,I=0,R=0;R<d;R+=u){var A=(S+R)/r;if(!(A<0||A>=n.outDepth||Math.floor(A)!==A))for(var N=0;N<p;N+=c){var D=(k+N)/i;if(!(D<0||D>=n.outHeight||Math.floor(D)!==D))for(var M=0;M<f;M+=h){var L=(O+M)/o;L<0||L>=n.outWidth||Math.floor(L)!==L||(I+=y.get(T,A,D,L,x))}}}b.set(I*_,T,E,w,C,x)}return b.toTensor()},e.prototype.maxPool3d=function(t,e){return Vu(t,"maxPool3d"),this.pool3d(t,e,"max").toFloat()},e.prototype.maxPool3dPositions=function(t,e){for(var n=Hn(e.outShape,"int32"),r=e.strideDepth,i=e.strideHeight,o=e.strideWidth,s=e.dilationDepth,a=e.dilationHeight,l=e.dilationWidth,u=e.effectiveFilterDepth,c=e.effectiveFilterHeight,h=e.effectiveFilterWidth,d=e.padInfo.front,p=e.padInfo.top,f=e.padInfo.left,g=this.bufferSync(t),m=0;m<e.batchSize;++m)for(var v=0;v<e.inChannels;++v)for(var b=0;b<e.outDepth;++b){for(var _=b*r-d,y=_;y<0;)y+=s;for(var T=Math.min(e.inDepth,u+_),x=0;x<e.outHeight;++x){for(var E=x*i-p,w=E;w<0;)w+=a;for(var C=Math.min(e.inHeight,c+E),S=0;S<e.outWidth;++S){for(var k=S*o-f,O=k;O<0;)O+=l;for(var I=Math.min(e.inWidth,h+k),R=Number.NEGATIVE_INFINITY,A=-1,N=y;N<T;N+=s)for(var D=N-_,M=w;M<C;M+=a)for(var L=M-E,P=O;P<I;P+=l){var F=P-k,B=g.get(m,N,M,P,v);B>=R&&(R=B,A=D*c*h+L*c+F)}n.set(A,m,b,x,S,v)}}}return n.toTensor()},e.prototype.maxPool3dBackprop=function(t,e,n,r){Vu([e,n],"maxPool3dBackprop");for(var i=this.maxPool3dPositions(e,r),o=r.strideDepth,s=r.strideHeight,a=r.strideWidth,l=r.dilationDepth,u=r.dilationHeight,c=r.dilationWidth,h=r.effectiveFilterDepth,d=r.effectiveFilterHeight,p=r.effectiveFilterWidth,f=h-1-r.padInfo.front,g=p-1-r.padInfo.left,m=d-1-r.padInfo.top,v=Hn(e.shape,"float32"),b=this.bufferSync(i),_=this.bufferSync(t),y=0;y<r.batchSize;++y)for(var T=0;T<r.inChannels;++T)for(var x=0;x<r.inDepth;++x)for(var E=0;E<r.inHeight;++E)for(var w=0;w<r.inWidth;++w){for(var C=x-f,S=E-m,k=w-g,O=0,I=0;I<h;I+=l){var R=(C+I)/o;if(!(R<0||R>=r.outDepth||Math.floor(R)!==R))for(var A=0;A<d;A+=u){var N=(S+A)/s;if(!(N<0||N>=r.outHeight||Math.floor(N)!==N))for(var D=0;D<p;D+=c){var M=(k+D)/a;if(!(M<0||M>=r.outWidth||Math.floor(M)!==M)){var L=h*d*p-1-b.get(y,R,N,M,T)===I*d*p+A*p+D?1:0;0!==L&&(O+=_.get(y,R,N,M,T)*L)}}}}v.set(O,y,x,E,w,T)}return v.toTensor()},e.prototype.cast=function(t,e){return ei(t,e,this)},e.prototype.reshape=function(t,e){return ni(t,e)},e.prototype.avgPool=function(t,e){return Vu(t,"avgPool"),this.pool(t,e,"avg").toFloat()},e.prototype.resizeBilinear=function(t,e,n,r){Vu(t,"resizeBilinear");for(var i=t.shape,o=i[0],s=i[1],a=i[2],l=i[3],u=this.readSync(t.dataId),c=new Float32Array(k([o,e,n,l])),h=[r&&e>1?s-1:s,r&&n>1?a-1:a],d=[r&&e>1?e-1:e,r&&n>1?n-1:n],p=0,f=h[0]/d[0],g=h[1]/d[1],m=0;m<o;m++)for(var v=0;v<e;v++)for(var b=f*v,_=Math.floor(b),y=b-_,T=Math.min(s-1,Math.ceil(b)),x=m*t.strides[0]+_*t.strides[1],E=m*t.strides[0]+T*t.strides[1],w=0;w<n;w++)for(var C=g*w,S=Math.floor(C),O=C-S,I=Math.min(a-1,Math.ceil(C)),R=x+S*t.strides[2],A=E+S*t.strides[2],N=x+I*t.strides[2],D=E+I*t.strides[2],M=0;M<l;M++){var L=u[R+M],P=u[A+M],F=L+(u[N+M]-L)*O,B=F+(P+(u[D+M]-P)*O-F)*y;c[p++]=B}return dn(c,[o,e,n,l])},e.prototype.resizeBilinearBackprop=function(t,e,n){Vu([t,e],"resizeBilinearBackprop");for(var r=e.shape,i=r[0],o=r[1],s=r[2],a=r[3],l=t.shape,u=l[1],c=l[2],h=new Float32Array(i*o*s*a),d=[n&&u>1?o-1:o,n&&c>1?s-1:s],p=[n&&u>1?u-1:u,n&&c>1?c-1:c],f=d[0]/p[0],g=d[1]/p[1],m=this.readSync(t.dataId),v=0,b=0;b<i;b++)for(var _=b*e.strides[0],y=0;y<u;y++)for(var T=y*f,x=Math.floor(T),E=Math.min(Math.ceil(T),o-1),w=_+x*e.strides[1],C=_+E*e.strides[1],S=T-x,k=1-S,O=0;O<c;O++)for(var I=O*g,R=Math.floor(I),A=Math.min(Math.ceil(I),s-1),N=I-R,D=1-N,M=w+R*e.strides[2],L=w+A*e.strides[2],P=C+R*e.strides[2],F=C+A*e.strides[2],B=k*D,j=k*N,$=S*D,U=S*N,V=0;V<a;V++){var H=m[v++];h[M+V]+=H*B,h[L+V]+=H*j,h[P+V]+=H*$,h[F+V]+=H*U}return bn(h,[i,s,o,a],e.dtype)},e.prototype.resizeNearestNeighbor=function(t,e,n,r){Vu(t,"resizeNearestNeighbor");for(var i=t.shape,o=i[0],s=i[1],a=i[2],l=i[3],u=this.readSync(t.dataId),c=new Float32Array(o*e*n*l),h=[r&&e>1?s-1:s,r&&n>1?a-1:a],d=[r&&e>1?e-1:e,r&&n>1?n-1:n],p=h[0]/d[0],f=h[1]/d[1],g=0,m=0;m<o;m++)for(var v=m*t.strides[0],b=0;b<e;b++)for(var _=p*b,y=v+Math.min(s-1,r?Math.round(_):Math.floor(_))*t.strides[1],T=0;T<n;T++)for(var x=f*T,E=y+Math.min(a-1,r?Math.round(x):Math.floor(x))*t.strides[2],w=0;w<l;w++){var C=u[E+w];c[g++]=C}return dn(c,[o,e,n,l],t.dtype)},e.prototype.resizeNearestNeighborBackprop=function(t,e,n){Vu([t,e],"resizeNearestNeighborBackprop");for(var r=e.shape,i=r[0],o=r[1],s=r[2],a=r[3],l=t.shape,u=l[1],c=l[2],h=new Float32Array(i*o*s*a),d=this.readSync(t.dataId),p=[n&&u>1?o-1:o,n&&c>1?s-1:s],f=[n&&u>1?u-1:u,n&&c>1?c-1:c],g=p[0]/f[0],m=p[1]/f[1],v=1/g,b=1/m,_=2*Math.ceil(v)+2,y=2*Math.ceil(b)+2,T=0;T<i;T++)for(var x=T*e.strides[0],E=0;E<o;E++)for(var w=x+E*e.strides[1],C=Math.floor(E*v),S=Math.floor(C-_/2),k=0;k<s;k++)for(var O=w+k*e.strides[2],I=Math.floor(k*b),R=Math.floor(I-y/2),A=0;A<a;A++){for(var N=0,D=0;D<_;D++){var M=D+S;if(!(M<0||M>=u)){var L=x+M*t.strides[1],P=M*g;if(E===Math.min(o-1,n?Math.round(P):Math.floor(P)))for(var F=0;F<y;F++){var B=F+R;if(!(B<0||B>=c)){var j=L+B*t.strides[2],$=B*m;k===Math.min(s-1,n?Math.round($):Math.floor($))&&(N+=d[j+A])}}}}h[O+A]=N}return bn(h,e.shape,e.dtype)},e.prototype.batchNormalization=function(t,e,n,r,i,o){Vu([t,e,n,i,o],"batchNorm");for(var s=this.readSync(t.dataId),a=this.readSync(e.dataId),l=this.readSync(n.dataId),u=i?this.readSync(i.dataId):new Float32Array([1]),c=o?this.readSync(o.dataId):new Float32Array([0]),h=new Float32Array(s.length),d=c.length,p=u.length,f=l.length,g=a.length,m=0,v=0,b=0,_=0,y=0;y<s.length;++y)h[y]=c[m++]+(s[y]-a[v++])*u[b++]/Math.sqrt(l[_++]+r),m>=d&&(m=0),v>=g&&(v=0),b>=p&&(b=0),_>=f&&(_=0);return bn(h,t.shape)},e.prototype.localResponseNormalization4D=function(t,e,n,r,i){Vu(t,"localResponseNormalization4D");var o=t.shape[3],s=o-1,a=this.readSync(t.dataId),l=t.size,u=new Float32Array(l);function c(t){for(var n=t%o,r=t-n+Math.max(0,n-e),i=t-n+Math.min(n+e,s),l=0;r<=i;r++){var u=a[r];l+=u*u}return l}for(var h=0;h<l;h++){var d=c(h),p=a[h]*Math.pow(n+r*d,-i);u[h]=p}return bn(u,t.shape)},e.prototype.LRNGrad=function(t,e,n,r,i,o,s){Vu(t,"LRNGrad");for(var a=t.shape[3],l=this.readSync(t.dataId),u=this.readSync(e.dataId),c=this.readSync(n.dataId),h=new Float32Array(t.size),d=t.size,p=0;p<d;p++){for(var f=p%a,g=p-f+Math.max(0,f-r),m=p-f+Math.min(a,f+r+1),v=0,b=g;b<m;b++)v+=Math.pow(u[b],2);for(v=o*v+i,b=g;b<m;b++){var _=-2*o*s*u[b]*c[p]/v;p===b&&(_+=Math.pow(v,-s)),_*=l[p],h[b]+=_}}return bn(h,t.shape)},e.prototype.multinomial=function(t,e,n,r){Vu(t,"multinomial");for(var i=e?t:Lr(t),o=i.shape[0],s=i.shape[1],a=yn([o,n],"int32"),l=this.readSync(a.dataId),u=this.readSync(i.dataId),c=0;c<o;++c){var h=c*s,d=new Float32Array(s-1);d[0]=u[h];for(var p=1;p<d.length;++p)d[p]=d[p-1]+u[h+p];for(var f=jn(r.toString()),g=c*n,m=0;m<n;++m){var v=f();l[g+m]=d.length;for(var b=0;b<d.length;b++)if(v<d[b]){l[g+m]=b;break}}}return a},e.prototype.oneHot=function(t,e,n,r){Vu(t,"oneHot");var i=new Float32Array(t.size*e);i.fill(r);for(var o=this.readSync(t.dataId),s=0;s<t.size;++s)o[s]>=0&&o[s]<e&&(i[s*e+o[s]]=n);return mn(i,[t.size,e],"int32")},e.prototype.nonMaxSuppression=function(t,e,n,r,i){return Vu(t,"nonMaxSuppression"),ci(this.readSync(t.dataId),this.readSync(e.dataId),n,r,i)},e.prototype.fft=function(t){return this.fftBatch(t,!1)},e.prototype.ifft=function(t){return this.fftBatch(t,!0)},e.prototype.fftBatch=function(t,e){for(var n=t.shape[0],r=t.shape[1],i=Hn(t.shape,"float32"),o=Hn(t.shape,"float32"),s=cn(t).as2D(n,r),a=hn(t).as2D(n,r),l=0;l<n;l++)for(var u=s.slice([l,0],[1,r]),c=a.slice([l,0],[1,r]),h=un(u,c),d=this.readSync(this.fftImpl(h,e).dataId),p=0;p<r;p++){var f=oi(d,p);i.values[l*r+p]=f.real,o.values[l*r+p]=f.imag}return un(i.toTensor(),o.toTensor()).as2D(n,r)},e.prototype.fftImpl=function(t,e){var n=t.as1D(),r=n.size;if(this.isExponentOf2(r)){var i=this.fftRadix2(n,r,e).as2D(t.shape[0],t.shape[1]);return e&&(i=un(cn(i).div(fn(r)),hn(i).div(fn(r)))),i}var o=this.readSync(t.dataId),s=function(t){for(var e=new Float32Array(t.length/2),n=new Float32Array(t.length/2),r=0;r<t.length;r+=2)e[r/2]=t[r],n[r/2]=t[r+1];return{real:e,imag:n}}(this.fourierTransformByMatmul(o,r,e));return un(s.real,s.imag).as2D(t.shape[0],t.shape[1])},e.prototype.isExponentOf2=function(t){return 0==(t&t-1)},e.prototype.fftRadix2=function(t,e,n){if(1===e)return t;var r=this.readSync(t.dataId),i=e/2,o=function(t){for(var e=Math.ceil(t.length/4),n=new Float32Array(e),r=new Float32Array(e),i=0;i<t.length;i+=4)n[Math.floor(i/4)]=t[i],r[Math.floor(i/4)]=t[i+1];return{real:n,imag:r}}(r),s=un(o.real,o.imag).as1D(),a=function(t){for(var e=Math.floor(t.length/4),n=new Float32Array(e),r=new Float32Array(e),i=2;i<t.length;i+=4)n[Math.floor(i/4)]=t[i],r[Math.floor(i/4)]=t[i+1];return{real:n,imag:r}}(r),l=un(a.real,a.imag).as1D();s=this.fftRadix2(s,i,n),l=this.fftRadix2(l,i,n);var u=function(t,e){for(var n=new Float32Array(t/2),r=new Float32Array(t/2),i=0;i<Math.ceil(t/2);i++){var o=(e?2:-2)*Math.PI*(i/t);n[i]=Math.cos(o),r[i]=Math.sin(o)}return{real:n,imag:r}}(e,n),c=un(u.real,u.imag).mul(l),h=s.add(c),d=s.sub(c),p=cn(h).concat(cn(d)),f=hn(h).concat(hn(d));return un(p,f).as1D()},e.prototype.fourierTransformByMatmul=function(t,e,n){for(var r=new Float32Array(2*e),i=0;i<e;i++){for(var o=0,s=0,a=0;a<e;a++){var l=ai(i*a,e,n),u=oi(t,a);o+=u.real*l.real-u.imag*l.imag,s+=u.real*l.imag+u.imag*l.real}n&&(o/=e,s/=e),si(r,o,s,i)}return r},e.prototype.depthToSpace=function(t,e,n){E("NHWC"===n,function(){return"Only NHWC dataFormat supported on CPU for depthToSpace. Got "+n}),E(e>1,function(){return"blockSize should be > 1 for depthToSpace, but was: "+e});for(var r=t.shape[0],i=t.shape[1],o=t.shape[2],s=t.shape[3],a=i*e,l=o*e,u=s/(e*e),c=this.readSync(t.dataId),h=new Float32Array(r*a*l*u),d=0,p=0;p<r;++p)for(var f=0;f<a;++f)for(var g=Math.floor(f/e),m=f%e,v=0;v<l;++v)for(var b=Math.floor(v/e),_=(m*e+v%e)*u,y=0;y<u;++y){var T=y+_+s*(b+o*(g+i*p));h[d++]=c[T]}return bn(h,[r,a,l,u])},e.prototype.broadcastedBinaryOp=function(t,e,n,r){var i=Vr(t.shape,e.shape),o=Hn(i,n),s=this.readSync(t.dataId),a=this.readSync(e.dataId),l=$r(t.shape,i),u=$r(e.shape,i),c=o.values;if(l.length+u.length===0)for(var h=0;h<c.length;++h)c[h]=r(s[h%s.length],a[h%a.length]);else{var d=this.bufferSync(t),p=this.bufferSync(e),f=function(n){var i=o.indexToLoc(n),h=i.slice(-t.rank);l.forEach(function(t){return h[t]=0});var f=d.locToIndex(h),g=i.slice(-e.rank);u.forEach(function(t){return g[t]=0});var m=p.locToIndex(g);c[n]=r(s[f],a[m])};for(h=0;h<c.length;++h)f(h)}return o.toTensor()},e.prototype.broadcastedBinaryComplexOp=function(t,e,n){var r=Vr(t.shape,e.shape),i=Hn(r,"float32"),o=Hn(r,"float32"),s=this.readSync(t.dataId),a=this.readSync(e.dataId),l=$r(t.shape,r),u=$r(e.shape,r),c=i.values,h=o.values;if(l.length+u.length===0)for(var d=0;d<c.length;d++){var p=d%s.length,f=d%a.length,g=n(s[2*p],s[2*p+1],a[2*f],a[2*f+1]);c[d]=g.real,h[d]=g.imag}else{var m=this.bufferSync(this.data.get(t.dataId).complexTensors.real),v=this.bufferSync(this.data.get(e.dataId).complexTensors.real),b=function(r){var o=i.indexToLoc(r),d=o.slice(-t.rank);l.forEach(function(t){return d[t]=0});var p=m.locToIndex(d),f=o.slice(-e.rank);u.forEach(function(t){return f[t]=0});var g=v.locToIndex(f),b=n(s[2*p],s[2*p+1],a[2*g],a[2*g+1]);c[r]=b.real,h[r]=b.imag};for(d=0;d<c.length;d++)b(d)}return this.complex(i.toTensor(),o.toTensor())},e.prototype.split=function(t,e,n){return mi(t,e,n)},e.prototype.dispose=function(){},e.prototype.floatPrecision=function(){return 32},e.prototype.epsilon=function(){return 1e-7},e.prototype.cropAndResize=function(t,e,n,r,i,o){for(var s=t.shape,a=s[0],l=s[1],u=s[2],c=s[3],h=e.shape[0],d=r[0],p=r[1],f=Hn([h,d,p,c],"float32"),g=this.readSync(e.dataId),m=this.readSync(n.dataId),v=this.readSync(t.dataId),b=t.strides,_=f.strides,y=0;y<h;y++){var T=4*y,x=g[T],E=g[T+1],w=g[T+2],C=g[T+3],S=m[y];if(!(S>=a))for(var k=d>1?(w-x)*(l-1)/(d-1):0,O=p>1?(C-E)*(u-1)/(p-1):0,I=0;I<d;I++){var R=d>1?x*(l-1)+I*k:.5*(x+w)*(l-1);if(R<0||R>l-1)for(var A=0;A<p;A++)for(var N=0;N<c;N++){var D=N+A*_[2]+I*_[1]+y*_[0];f.values[D]=o}else if("bilinear"===i){var M=Math.floor(R),L=Math.ceil(R),P=R-M;for(A=0;A<p;A++)if((G=p>1?E*(u-1)+A*O:.5*(E+C)*(u-1))<0||G>u-1)for(N=0;N<c;N++)D=N+A*_[2]+I*_[1]+y*_[0],f.values[D]=o;else{var F=Math.floor(G),B=Math.ceil(G),j=G-F;for(N=0;N<c;N++){var $=v[D=N+F*b[2]+M*b[1]+S*b[0]],U=v[D=N+B*b[2]+M*b[1]+S*b[0]],V=v[D=N+F*b[2]+L*b[1]+S*b[0]],H=$+(U-$)*j,W=V+(v[D=N+B*b[2]+L*b[1]+S*b[0]]-V)*j;D=N+A*_[2]+I*_[1]+y*_[0],f.values[D]=H+(W-H)*P}}}else for(A=0;A<p;++A){var G;if((G=p>1?E*(u-1)+A*O:.5*(E+C)*(u-1))<0||G>u-1)for(N=0;N<c;N++)D=N+A*_[2]+I*_[1]+y*_[0],f.values[D]=o;else{var z=Math.round(G),X=Math.round(R);for(N=0;N<c;N++){var K=N+z*b[2]+X*b[1]+S*b[0],Y=N+A*_[2]+I*_[1]+y*_[0];f.values[Y]=v[K]}}}}}return f.toTensor()},e.prototype.sparseToDense=function(t,e,n,r){var i=Sr(0,t,n),o=i.sliceRank,s=i.numUpdates,a=i.sliceSize,l=i.strides,u=i.outputSize;return this.scatter(t,e,n,u,a,s,o,l,r,!1)},e.prototype.gatherND=function(t,e){var n=e.shape,r=n[n.length-1],i=Tr(t,e),o=i[0],s=i[1],a=i[2],l=i[3];if(0===s)return dn([],o,t.dtype);for(var u=new mt([s,a],t.dtype),c=this.readSync(e.dataId),h=this.readSync(t.dataId),d=0;d<s;d++){for(var p=[],f=0,g=0;g<r;g++){var m=c[d*r+g];f+=m*l[g],p.push(m)}if(f<0||f>=t.size/a)throw new Error("Invalid indices: "+p+" does not index into "+t.shape);for(var v=0;v<a;v++)u.values[d*a+v]=h[f*a+v]}return u.toTensor().reshape(o)},e.prototype.scatterND=function(t,e,n){var r=Sr(0,t,n),i=r.sliceRank,o=r.numUpdates,s=r.sliceSize,a=r.strides,l=r.outputSize,u=fn(0);return this.scatter(t,e,n,l,s,o,i,a,u,!0)},e.prototype.fill=function(t,e,n){var r=B(n=n||K(e),k(t));return r.fill(e),Pt.makeTensor(r,t,n,this)},e.prototype.onesLike=function(t){if("string"===t.dtype)throw new Error("onesLike is not supported for string tensors");return this.fill(t.shape,1,t.dtype)},e.prototype.zerosLike=function(t){var e=B(t.dtype,k(t.shape));return this.makeOutput(e,t.shape,t.dtype)},e.prototype.linspace=function(t,e,n){return ri(t,e,n)},e.prototype.scatter=function(t,e,n,r,i,o,s,a,l,u){var c=[r/i,i],h=this.readSync(t.dataId),d=this.readSync(e.dataId);if(0===r)return dn([],n,e.dtype);var p=new mt(c,e.dtype);p.values.fill(this.readSync(l.dataId)[0]);for(var f=0;f<o;f++){for(var g=[],m=0,v=0;v<s;v++){var b=h[f*s+v];g.push(b),m+=b*a[v]}if(m<0||m>=r/i)throw new Error("Invalid indices: "+g+" does not index into "+n);for(var _=0;_<i;_++)u?p.values[m*i+_]+=d[f*i+_]:p.values[m*i+_]=0===e.rank?d[0]:d[f*i+_]}return p.toTensor().reshape(n)},e}(Br);Pt.registerBackend("cpu",function(){return new Wu},1);for(var Gu=0,zu=[{kernelName:"NonMaxSuppressionV5",backendName:"cpu",kernelFunc:function(t){var e=t.inputs,n=t.backend,r=t.attrs,i=e,o=i.boxes,s=i.scores,a=r,l=a.maxOutputSize,u=a.iouThreshold,c=a.scoreThreshold,h=a.softNmsSigma,d=n;Vu(o,"NonMaxSuppressionWithScore");var p=hi(d.data.get(o.dataId).values,d.data.get(s.dataId).values,l,u,c,h);return[p.selectedIndices,p.selectedScores]}},{kernelName:"Square",backendName:"cpu",kernelFunc:function(t){var e=t.inputs,n=t.backend,r=e.x,i=n;Vu(r,"square");for(var o=i.data.get(r.dataId).values,s=new Float32Array(o.length),a=0;a<o.length;++a){var l=o[a];s[a]=l*l}return{dataId:i.write(s,r.shape,r.dtype),shape:r.shape,dtype:r.dtype}}},{kernelName:rs,backendName:"cpu",kernelFunc:function(t){var e=t.inputs,n=t.backend,r=e,i=r.a,o=r.b,s=n;Vu([i,o],rs);var a=s.data.get(i.dataId).values,l=s.data.get(o.dataId).values,u=function(t,e,n,r,i,o){var s=Vr(t,e),a=s.length,l=J(s),u=F(i,k(s)),c=t.length,h=e.length,d=J(t),p=J(e),f=$r(t,s),g=$r(e,s);if(f.length+g.length===0)for(var m=0;m<u.length;++m)u[m]=o(n[m%n.length],r[m%r.length]);else{var v=function(t){var e=at(t,a,l),i=e.slice(-c);f.forEach(function(t){return i[t]=0});var s=st(i,c,d),m=e.slice(-h);g.forEach(function(t){return m[t]=0});var v=st(m,h,p);u[t]=o(n[s],r[v])};for(m=0;m<u.length;++m)v(m)}return[u,s]}(i.shape,o.shape,a,l,i.dtype,function(t,e){var n=t-e;return n*n}),c=u[0],h=u[1];return{dataId:s.write(c,h,i.dtype),shape:h,dtype:i.dtype}}}];Gu<zu.length;Gu++)m(zu[Gu]);for(var Xu,Ku=0,Yu=[{kernelName:"FromPixels",backendName:"webgl",kernelFunc:function(t){var e=t.inputs,n=t.backend,r=t.attrs,i=e.pixels,o=r.numChannels,s="undefined"!=typeof HTMLVideoElement&&i instanceof HTMLVideoElement,a="undefined"!=typeof HTMLImageElement&&i instanceof HTMLImageElement,l=s?[i.videoWidth,i.videoHeight]:[i.width,i.height],u=l[0],h=l[1],d=[h,u],p=[h,u,o];(a||s)&&(null==Xu&&(Xu=document.createElement("canvas").getContext("2d")),Xu.canvas.width=u,Xu.canvas.height=h,Xu.drawImage(i,0,0,u,h),i=Xu.canvas);var f=n.makeTensorInfo(d,"int32");n.texData.get(f.dataId).usage=$t.PIXELS,n.gpgpu.uploadPixelDataToTexture(n.getTexture(f.dataId),i);var g=c().getBool("WEBGL_PACK")?new function(t){this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0;var e=xi(),n=t[0],r=t[1];this.outputShape=t,this.userCode="\n void main() {\n ivec3 coords = getOutputCoords();\n int texR = coords[0];\n int texC = coords[1];\n int depth = coords[2];\n\n vec4 result = vec4(0.);\n\n for(int row=0; row<=1; row++) {\n for(int col=0; col<=1; col++) {\n texC = coords[1] + row;\n depth = coords[2] + col;\n\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2("+r+".0, "+n+".0);\n vec4 values = "+e.texture2D+"(A, uv);\n float value;\n if (depth == 0) {\n value = values.r;\n } else if (depth == 1) {\n value = values.g;\n } else if (depth == 2) {\n value = values.b;\n } else if (depth == 3) {\n value = values.a;\n }\n\n result[row * 2 + col] = floor(value * 255.0 + 0.5);\n }\n }\n\n "+e.output+" = result;\n }\n "}(p):new function(t){this.variableNames=["A"];var e=xi(),n=t[0],r=t[1];this.outputShape=t,this.userCode="\n void main() {\n ivec3 coords = getOutputCoords();\n int texR = coords[0];\n int texC = coords[1];\n int depth = coords[2];\n vec2 uv = (vec2(texC, texR) + halfCR) / vec2("+r+".0, "+n+".0);\n\n vec4 values = "+e.texture2D+"(A, uv);\n float value;\n if (depth == 0) {\n value = values.r;\n } else if (depth == 1) {\n value = values.g;\n } else if (depth == 2) {\n value = values.b;\n } else if (depth == 3) {\n value = values.a;\n }\n\n setOutput(floor(value * 255.0 + 0.5));\n }\n "}(p),m=n.runWebGLProgram(g,[f],"int32");return n.disposeData(f.dataId),m}},{kernelName:"NonMaxSuppressionV5",backendName:"webgl",kernelFunc:function(t){var e=t.inputs,n=t.backend,r=t.attrs;ze("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");var i=e,o=i.boxes,s=i.scores,a=r,l=a.maxOutputSize,u=a.iouThreshold,c=a.scoreThreshold,h=a.softNmsSigma,d=n,p=hi(d.readSync(o.dataId),d.readSync(s.dataId),l,u,c,h);return[p.selectedIndices,p.selectedScores]}},{kernelName:"Square",backendName:"webgl",kernelFunc:function(t){var e=t.inputs,n=t.backend,r=e.x,i=n,o=new Mo(r.shape,"return x * x;");return i.runWebGLProgram(o,[r],r.dtype)}},{kernelName:rs,backendName:"webgl",kernelFunc:function(t){var e=t.inputs,n=t.backend,r=e,i=r.a,o=r.b,s=n,a=c().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new Hi("return (a - b) * (a - b);",i.shape,o.shape):new Ui("return (a - b) * (a - b);",i.shape,o.shape);return s.compileAndRun(a,[i,o])}}];Ku<Yu.length;Ku++)m(Yu[Ku]);for(var qu=0,Ju=[{kernelName:"Square",gradFunc:function(t,e){var n=e[0];return{x:function(){return t.mul(n.toFloat().mul(2))}}}},{kernelName:rs,gradFunc:function(t,e){var n=e[0],r=e[1],i=fn(2);return{a:function(){return _a(t,_a(i,wa(n,r)))},b:function(){return _a(t,_a(i,wa(r,n)))}}}}];qu<Ju.length;qu++)v(Ju[qu]);var Zu=function(){function t(){}return t.prototype.fetch=function(t,e){return fetch(t,e)},t.prototype.now=function(){return performance.now()},t.prototype.encode=function(t,e){if("utf-8"!==e&&"utf8"!==e)throw new Error("Browser's encoder only supports utf-8, but got "+e);return null==this.textEncoder&&(this.textEncoder=new TextEncoder),this.textEncoder.encode(t)},t.prototype.decode=function(t,e){return new TextDecoder(e).decode(t)},t}();c().get("IS_BROWSER")&&c().setPlatform("browser",new Zu);var Qu,tc=function(){function t(){this.util=n(2),this.textEncoder=new this.util.TextEncoder}return t.prototype.fetch=function(t,e){return null!=c().global.fetch?c().global.fetch(t,e):(null==Qu&&(Qu=n(1)),Qu(t,e))},t.prototype.now=function(){var t=r.hrtime();return 1e3*t[0]+t[1]/1e6},t.prototype.encode=function(t,e){if("utf-8"!==e&&"utf8"!==e)throw new Error("Node built-in encoder only supports utf-8, but got "+e);return this.textEncoder.encode(t)},t.prototype.decode=function(t,e){return 0===t.length?"":new this.util.TextDecoder(e).decode(t)},t}();c().get("IS_NODE")&&c().setPlatform("node",new tc);var ec={float32:4,int32:4,uint16:2,uint8:1,bool:1},nc=4;function rc(t,e){for(var n={},r=0,i=function(e){var i=e.name,o=e.dtype,s=e.shape,a=k(s),l=void 0;if("quantization"in e){var u=e.quantization;if("uint8"!==u.dtype&&"uint16"!==u.dtype)throw new Error("Weight "+e.name+" has unknown quantization dtype "+u.dtype+". Supported quantization dtypes are: 'uint8' and 'uint16'.");var c=ec[u.dtype],h=t.slice(r,r+a*c),d="uint8"===u.dtype?new Uint8Array(h):new Uint16Array(h);if("float32"===o)l=Float32Array.from(d,function(t){return t*u.scale+u.min});else{if("int32"!==o)throw new Error("Unsupported dtype in weight '"+i+"': "+o);l=Int32Array.from(d,function(t){return Math.round(t*u.scale+u.min)})}r+=a*c}else if("string"===o){var p=k(e.shape);l=[];for(var f=0;f<p;f++){var g=new Uint32Array(t.slice(r,r+nc))[0];r+=nc;var m=new Uint8Array(t.slice(r,r+g));l.push(m),r+=g}}else{var v=ec[o];if(h=t.slice(r,r+a*v),"float32"===o)l=new Float32Array(h);else if("int32"===o)l=new Int32Array(h);else{if("bool"!==o)throw new Error("Unsupported dtype in weight '"+i+"': "+o);l=new Uint8Array(h)}r+=a*v}n[i]=dn(l,s,o)},o=0,s=e;o<s.length;o++)i(s[o]);return n}var ic=void 0!==i&&("undefined"==typeof Blob||"undefined"==typeof atob||"undefined"==typeof btoa);function oc(t){return ic?i.byteLength(t):new Blob([t]).size}function sc(t){var e=0;t.forEach(function(t){e+=t.byteLength});var n=new Uint8Array(e),r=0;return t.forEach(function(t){n.set(new Uint8Array(t),r),r+=t.byteLength}),n.buffer}function ac(t){for(t=t.trim();t.endsWith("/");)t=t.slice(0,t.length-1);var e=t.split("/");return e[e.length-1]}function lc(t){if(t.modelTopology instanceof ArrayBuffer)throw new Error("Expected JSON model topology, received ArrayBuffer.");return{dateSaved:new Date,modelTopologyType:"JSON",modelTopologyBytes:null==t.modelTopology?0:oc(JSON.stringify(t.modelTopology)),weightSpecsBytes:null==t.weightSpecs?0:oc(JSON.stringify(t.weightSpecs)),weightDataBytes:null==t.weightData?0:t.weightData.byteLength}}var uc=function(){function t(){this.saveRouters=[],this.loadRouters=[]}return t.getInstance=function(){return null==t.instance&&(t.instance=new t),t.instance},t.registerSaveRouter=function(e){t.getInstance().saveRouters.push(e)},t.registerLoadRouter=function(e){t.getInstance().loadRouters.push(e)},t.getSaveHandlers=function(e){return t.getHandlers(e,"save")},t.getLoadHandlers=function(e,n){return t.getHandlers(e,"load",n)},t.getHandlers=function(e,n,r){var i=[];return("load"===n?t.getInstance().loadRouters:t.getInstance().saveRouters).forEach(function(t){var n=t(e,r);null!==n&&i.push(n)}),i},t}(),cc="://",hc=function(){function t(){this.managers={}}return t.getInstance=function(){return null==t.instance&&(t.instance=new t),t.instance},t.registerManager=function(e,n){E(null!=e,function(){return"scheme must not be undefined or null."}),e.endsWith(cc)&&(e=e.slice(0,e.indexOf(cc))),E(e.length>0,function(){return"scheme must not be an empty string."});var r=t.getInstance();E(null==r.managers[e],function(){return"A model store manager is already registered for scheme '"+e+"'."}),r.managers[e]=n},t.getManager=function(t){var e=this.getInstance().managers[t];if(null==e)throw new Error("Cannot find model manager for scheme '"+t+"'");return e},t.getSchemes=function(){return Object.keys(this.getInstance().managers)},t}();function dc(t){if(-1===t.indexOf(cc))throw new Error("The url string provided does not contain a scheme. Supported schemes are: "+hc.getSchemes().join(","));return{scheme:t.split(cc)[0],path:t.split(cc)[1]}}function pc(t,e,n){return void 0===n&&(n=!1),a(this,void 0,void 0,function(){var r,i,o,s,a,u,c,h,d;return l(this,function(l){switch(l.label){case 0:return E(t!==e,function(){return"Old path and new path are the same: '"+t+"'"}),E((r=uc.getLoadHandlers(t)).length>0,function(){return"Copying failed because no load handler is found for source URL "+t+"."}),E(r.length<2,function(){return"Copying failed because more than one ("+r.length+") load handlers for source URL "+t+"."}),i=r[0],E((o=uc.getSaveHandlers(e)).length>0,function(){return"Copying failed because no save handler is found for destination URL "+e+"."}),E(o.length<2,function(){return"Copying failed because more than one ("+r.length+") save handlers for destination URL "+e+"."}),s=o[0],a=dc(t).scheme,u=dc(t).path,c=a===dc(t).scheme,[4,i.load()];case 1:return h=l.sent(),n&&c?[4,hc.getManager(a).removeModel(u)]:[3,3];case 2:l.sent(),l.label=3;case 3:return[4,s.save(h)];case 4:return d=l.sent(),!n||c?[3,6]:[4,hc.getManager(a).removeModel(u)];case 5:l.sent(),l.label=6;case 6:return[2,d.modelArtifactsInfo]}})})}var fc="models_store",gc="model_info_store";function mc(){if(!c().getBool("IS_BROWSER"))throw new Error("Failed to obtain IndexedDB factory because the current environmentis not a web browser.");var t=window||self,e=t.indexedDB||t.mozIndexedDB||t.webkitIndexedDB||t.msIndexedDB||t.shimIndexedDB;if(null==e)throw new Error("The current browser does not appear to support IndexedDB.");return e}function vc(t){var e=t.result;e.createObjectStore(fc,{keyPath:"modelPath"}),e.createObjectStore(gc,{keyPath:"modelPath"})}var bc=function(){function t(t){if(this.indexedDB=mc(),null==t||!t)throw new Error("For IndexedDB, modelPath must not be null, undefined or empty.");this.modelPath=t}return t.prototype.save=function(t){return a(this,void 0,void 0,function(){return l(this,function(e){if(t.modelTopology instanceof ArrayBuffer)throw new Error("BrowserLocalStorage.save() does not support saving model topology in binary formats yet.");return[2,this.databaseAction(this.modelPath,t)]})})},t.prototype.load=function(){return a(this,void 0,void 0,function(){return l(this,function(t){return[2,this.databaseAction(this.modelPath)]})})},t.prototype.databaseAction=function(t,e){var n=this;return new Promise(function(t,r){var i=n.indexedDB.open("tensorflowjs",1);i.onupgradeneeded=function(){return vc(i)},i.onsuccess=function(){var o=i.result;if(null==e){var s=o.transaction(fc,"readonly"),a=s.objectStore(fc).get(n.modelPath);a.onsuccess=function(){if(null==a.result)return o.close(),r(new Error("Cannot find model with path '"+n.modelPath+"' in IndexedDB."));t(a.result.modelArtifacts)},a.onerror=function(t){return o.close(),r(a.error)},s.oncomplete=function(){return o.close()}}else{var l,u=lc(e),c=o.transaction(gc,"readwrite"),h=c.objectStore(gc),d=h.put({modelPath:n.modelPath,modelArtifactsInfo:u});d.onsuccess=function(){var i=(l=o.transaction(fc,"readwrite")).objectStore(fc).put({modelPath:n.modelPath,modelArtifacts:e,modelArtifactsInfo:u});i.onsuccess=function(){return t({modelArtifactsInfo:u})},i.onerror=function(t){var e=(h=c.objectStore(gc)).delete(n.modelPath);e.onsuccess=function(){return o.close(),r(i.error)},e.onerror=function(t){return o.close(),r(i.error)}}},d.onerror=function(t){return o.close(),r(d.error)},c.oncomplete=function(){null==l?o.close():l.oncomplete=function(){return o.close()}}}},i.onerror=function(t){return r(i.error)}})},t.URL_SCHEME="indexeddb://",t}(),_c=function(t){return c().getBool("IS_BROWSER")&&!Array.isArray(t)&&t.startsWith(bc.URL_SCHEME)?(e=t.slice(bc.URL_SCHEME.length),new bc(e)):null;var e};uc.registerSaveRouter(_c),uc.registerLoadRouter(_c);var yc=function(){function t(){this.indexedDB=mc()}return t.prototype.listModels=function(){return a(this,void 0,void 0,function(){var t=this;return l(this,function(e){return[2,new Promise(function(e,n){var r=t.indexedDB.open("tensorflowjs",1);r.onupgradeneeded=function(){return vc(r)},r.onsuccess=function(){var t=r.result,i=t.transaction(gc,"readonly"),o=i.objectStore(gc).getAll();o.onsuccess=function(){for(var t={},n=0,r=o.result;n<r.length;n++){var i=r[n];t[i.modelPath]=i.modelArtifactsInfo}e(t)},o.onerror=function(e){return t.close(),n(o.error)},i.oncomplete=function(){return t.close()}},r.onerror=function(t){return n(r.error)}})]})})},t.prototype.removeModel=function(t){return a(this,void 0,void 0,function(){var e=this;return l(this,function(n){var r;return t=(r=t).startsWith(bc.URL_SCHEME)?r.slice(bc.URL_SCHEME.length):r,[2,new Promise(function(n,r){var i=e.indexedDB.open("tensorflowjs",1);i.onupgradeneeded=function(){return vc(i)},i.onsuccess=function(){var e,o=i.result,s=o.transaction(gc,"readwrite"),a=s.objectStore(gc),l=a.get(t);l.onsuccess=function(){if(null==l.result)return o.close(),r(new Error("Cannot find model with path '"+t+"' in IndexedDB."));var i=a.delete(t),s=function(){var i=(e=o.transaction(fc,"readwrite")).objectStore(fc).delete(t);i.onsuccess=function(){return n(l.result.modelArtifactsInfo)},i.onerror=function(t){return r(l.error)}};i.onsuccess=s,i.onerror=function(t){return s(),o.close(),r(l.error)}},l.onerror=function(t){return o.close(),r(l.error)},s.oncomplete=function(){null==e?o.close():e.oncomplete=function(){return o.close()}}},i.onerror=function(t){return r(i.error)}})]})})},t}();if(c().getBool("IS_BROWSER"))try{hc.registerManager(bc.URL_SCHEME,new yc)}catch(o){}var Tc="/",xc="tensorflowjs_models",Ec="info",wc="model_topology",Cc="weight_specs",Sc="weight_data",kc="model_metadata";function Oc(t){return{info:[xc,t,Ec].join(Tc),topology:[xc,t,wc].join(Tc),weightSpecs:[xc,t,Cc].join(Tc),weightData:[xc,t,Sc].join(Tc),modelMetadata:[xc,t,kc].join(Tc)}}function Ic(t){var e=t.split(Tc);if(e.length<3)throw new Error("Invalid key format: "+t);return e.slice(1,e.length-1).join(Tc)}var Rc=function(){function t(t){if(!c().getBool("IS_BROWSER")||"undefined"==typeof window||void 0===window.localStorage)throw new Error("The current environment does not support local storage.");if(this.LS=window.localStorage,null==t||!t)throw new Error("For local storage, modelPath must not be null, undefined or empty.");this.modelPath=t,this.keys=Oc(this.modelPath)}return t.prototype.save=function(t){return a(this,void 0,void 0,function(){var e,n,r;return l(this,function(o){if(t.modelTopology instanceof ArrayBuffer)throw new Error("BrowserLocalStorage.save() does not support saving model topology in binary formats yet.");e=JSON.stringify(t.modelTopology),n=JSON.stringify(t.weightSpecs),r=lc(t);try{return this.LS.setItem(this.keys.info,JSON.stringify(r)),this.LS.setItem(this.keys.topology,e),this.LS.setItem(this.keys.weightSpecs,n),this.LS.setItem(this.keys.weightData,function(t){if(ic)return i.from(t).toString("base64");for(var e=new Uint8Array(t),n="",r=0,o=e.length;r<o;r++)n+=String.fromCharCode(e[r]);return btoa(n)}(t.weightData)),this.LS.setItem(this.keys.modelMetadata,JSON.stringify({format:t.format,generatedBy:t.generatedBy,convertedBy:t.convertedBy,userDefinedMetadata:t.userDefinedMetadata})),[2,{modelArtifactsInfo:r}]}catch(t){throw this.LS.removeItem(this.keys.info),this.LS.removeItem(this.keys.topology),this.LS.removeItem(this.keys.weightSpecs),this.LS.removeItem(this.keys.weightData),this.LS.removeItem(this.keys.modelMetadata),new Error("Failed to save model '"+this.modelPath+"' to local storage: size quota being exceeded is a possible cause of this failure: modelTopologyBytes="+r.modelTopologyBytes+", weightSpecsBytes="+r.weightSpecsBytes+", weightDataBytes="+r.weightDataBytes+".")}return[2]})})},t.prototype.load=function(){return a(this,void 0,void 0,function(){var t,e,n,r,o,s,a;return l(this,function(l){if(null==(t=JSON.parse(this.LS.getItem(this.keys.info))))throw new Error("In local storage, there is no model with name '"+this.modelPath+"'");if("JSON"!==t.modelTopologyType)throw new Error("BrowserLocalStorage does not support loading non-JSON model topology yet.");if(e={},null==(n=JSON.parse(this.LS.getItem(this.keys.topology))))throw new Error("In local storage, the topology of model '"+this.modelPath+"' is missing.");if(e.modelTopology=n,null==(r=JSON.parse(this.LS.getItem(this.keys.weightSpecs))))throw new Error("In local storage, the weight specs of model '"+this.modelPath+"' are missing.");if(e.weightSpecs=r,null!=(o=this.LS.getItem(this.keys.modelMetadata))&&(s=JSON.parse(o),e.format=s.format,e.generatedBy=s.generatedBy,e.convertedBy=s.convertedBy,e.userDefinedMetadata=s.userDefinedMetadata),null==(a=this.LS.getItem(this.keys.weightData)))throw new Error("In local storage, the binary weight values of model '"+this.modelPath+"' are missing.");return e.weightData=function(t){if(ic){var e=i.from(t,"base64");return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}for(var n=atob(t),r=new Uint8Array(n.length),o=0;o<n.length;++o)r.set([n.charCodeAt(o)],o);return r.buffer}(a),[2,e]})})},t.URL_SCHEME="localstorage://",t}(),Ac=function(t){return c().getBool("IS_BROWSER")&&!Array.isArray(t)&&t.startsWith(Rc.URL_SCHEME)?(e=t.slice(Rc.URL_SCHEME.length),new Rc(e)):null;var e};uc.registerSaveRouter(Ac),uc.registerLoadRouter(Ac);var Nc=function(){function t(){E(c().getBool("IS_BROWSER"),function(){return"Current environment is not a web browser"}),E("undefined"==typeof window||void 0!==window.localStorage,function(){return"Current browser does not appear to support localStorage"}),this.LS=window.localStorage}return t.prototype.listModels=function(){return a(this,void 0,void 0,function(){var t,e,n,r,i,o;return l(this,function(s){for(t={},e=xc+Tc,n=Tc+Ec,r=0;r<this.LS.length;++r)(i=this.LS.key(r)).startsWith(e)&&i.endsWith(n)&&(o=Ic(i),t[o]=JSON.parse(this.LS.getItem(i)));return[2,t]})})},t.prototype.removeModel=function(t){return a(this,void 0,void 0,function(){var e,n;return l(this,function(r){var i;if(t=(i=t).startsWith(Rc.URL_SCHEME)?i.slice(Rc.URL_SCHEME.length):i,e=Oc(t),null==this.LS.getItem(e.info))throw new Error("Cannot find model at path '"+t+"'");return n=JSON.parse(this.LS.getItem(e.info)),this.LS.removeItem(e.info),this.LS.removeItem(e.topology),this.LS.removeItem(e.weightSpecs),this.LS.removeItem(e.weightData),[2,n]})})},t}();if(c().getBool("IS_BROWSER"))try{hc.registerManager(Rc.URL_SCHEME,new Nc)}catch(o){}var Dc="model",Mc=".json",Lc=".weights.bin";function Pc(t){return new Promise(function(t){return setTimeout(t)}).then(t)}var Fc=function(){function t(e){if(!c().getBool("IS_BROWSER"))throw new Error("browserDownloads() cannot proceed because the current environment is not a browser.");e.startsWith(t.URL_SCHEME)&&(e=e.slice(t.URL_SCHEME.length)),null!=e&&0!==e.length||(e=Dc),this.modelTopologyFileName=e+Mc,this.weightDataFileName=e+Lc}return t.prototype.save=function(t){return a(this,void 0,void 0,function(){var e,n,r,i,o,s;return l(this,function(a){switch(a.label){case 0:if("undefined"==typeof document)throw new Error("Browser downloads are not supported in this environment since `document` is not present");if(e=window.URL.createObjectURL(new Blob([t.weightData],{type:"application/octet-stream"})),!(t.modelTopology instanceof ArrayBuffer))return[3,1];throw new Error("BrowserDownloads.save() does not support saving model topology in binary formats yet.");case 1:return n=[{paths:["./"+this.weightDataFileName],weights:t.weightSpecs}],r={modelTopology:t.modelTopology,format:t.format,generatedBy:t.generatedBy,convertedBy:t.convertedBy,weightsManifest:n},i=window.URL.createObjectURL(new Blob([JSON.stringify(r)],{type:"application/json"})),(o=null==this.jsonAnchor?document.createElement("a"):this.jsonAnchor).download=this.modelTopologyFileName,o.href=i,[4,Pc(function(){return o.dispatchEvent(new MouseEvent("click"))})];case 2:return a.sent(),null==t.weightData?[3,4]:((s=null==this.weightDataAnchor?document.createElement("a"):this.weightDataAnchor).download=this.weightDataFileName,s.href=e,[4,Pc(function(){return s.dispatchEvent(new MouseEvent("click"))})]);case 3:a.sent(),a.label=4;case 4:return[2,{modelArtifactsInfo:lc(t)}]}})})},t.URL_SCHEME="downloads://",t}(),Bc=function(){function t(t){if(null==t||t.length<1)throw new Error("When calling browserFiles, at least 1 file is required, but received "+t);this.files=t}return t.prototype.load=function(){return a(this,void 0,void 0,function(){var t,e,n=this;return l(this,function(r){return t=this.files[0],e=this.files.slice(1),[2,new Promise(function(r,i){var o=new FileReader;o.onload=function(o){var s=JSON.parse(o.target.result),a=s.modelTopology;if(null!=a){0===e.length&&r({modelTopology:a});var l=s.weightsManifest;if(null!=l){var u;try{u=n.checkManifestAndWeightFiles(l,e)}catch(t){return void i(t)}var c=[],h=[],d=[];l.forEach(function(t){t.paths.forEach(function(t){h.push(t),d.push(null)}),c.push.apply(c,t.weights)}),l.forEach(function(t){t.paths.forEach(function(t){var e=new FileReader;e.onload=function(e){var n=e.target.result,i=h.indexOf(t);d[i]=n,-1===d.indexOf(null)&&r({modelTopology:a,weightSpecs:c,weightData:sc(d),format:s.format,generatedBy:s.generatedBy,convertedBy:s.convertedBy,userDefinedMetadata:s.userDefinedMetadata})},e.onerror=function(e){return i("Failed to weights data from file of path '"+t+"'.")},e.readAsArrayBuffer(u[t])})})}else i(new Error("weightManifest field is missing from file "+t.name))}else i(new Error("modelTopology field is missing from file "+t.name))},o.onerror=function(e){return i("Failed to read model topology and weights manifest JSON from file '"+t.name+"'. BrowserFiles supports loading Keras-style tf.Model artifacts only.")},o.readAsText(t)})]})})},t.prototype.checkManifestAndWeightFiles=function(t,e){for(var n=[],r=e.map(function(t){return ac(t.name)}),i={},o=0,s=t;o<s.length;o++)s[o].paths.forEach(function(t){var o=ac(t);if(-1!==n.indexOf(o))throw new Error("Duplicate file basename found in weights manifest: '"+o+"'");if(n.push(o),-1===r.indexOf(o))throw new Error("Weight file with basename '"+o+"' is not provided.");i[t]=e[r.indexOf(o)]});if(n.length!==e.length)throw new Error("Mismatch in the number of files in weights manifest ("+n.length+") and the number of weight files provided ("+e.length+").");return i},t}();function jc(t,e,n,r){!function(t){E(null!=t&&Array.isArray(t)&&t.length>0,function(){return"promises must be a none empty array"})}(t),function(t,e){E(t>=0&&t<=1,function(){return"Progress fraction must be in range [0, 1], but got startFraction "+t}),E(e>=0&&e<=1,function(){return"Progress fraction must be in range [0, 1], but got endFraction "+e}),E(e>=t,function(){return"startFraction must be no more than endFraction, but got startFraction "+t+" and endFraction "+e})}(n=null==n?0:n,r=null==r?1:r);var i=0;return Promise.all(t.map(function(o){return o.then(function(o){var s=n+ ++i/t.length*(r-n);return e(s),o}),o}))}function $c(t,e){return a(this,void 0,void 0,function(){var n,r,i,o,s,a,u,h,d;return l(this,function(l){switch(l.label){case 0:return null==e&&(e={}),n=null==e.fetchFunc?c().platform.fetch:e.fetchFunc,r=t.map(function(t){return n(t,e.requestInit,{isBinary:!0})}),i=0,o=.5,null!=e.onProgress?[3,2]:[4,Promise.all(r)];case 1:return s=l.sent(),[3,4];case 2:return[4,jc(r,e.onProgress,i,o)];case 3:s=l.sent(),l.label=4;case 4:return a=s.map(function(t){return t.arrayBuffer()}),u=.5,h=1,null!=e.onProgress?[3,6]:[4,Promise.all(a)];case 5:return d=l.sent(),[3,8];case 6:return[4,jc(a,e.onProgress,u,h)];case 7:d=l.sent(),l.label=8;case 8:return[2,d]}})})}function Uc(t){var e=this;return function(n,r,i){return void 0===r&&(r=""),a(e,void 0,void 0,function(){var e,o,s,a,u,c,h,d,p,f;return l(this,function(l){switch(l.label){case 0:if(e=n.map(function(){return!1}),o={},s=null!=i?i.map(function(){return!1}):[],a=[],n.forEach(function(t,n){var r=0;t.weights.forEach(function(t){var l="quantization"in t?t.quantization.dtype:t.dtype,u=ec[l]*k(t.shape),c=function(){e[n]=!0,null==o[n]&&(o[n]=[]),o[n].push({manifestEntry:t,groupOffset:r,sizeBytes:u})};null!=i?i.forEach(function(e,n){e===t.name&&(c(),s[n]=!0)}):c(),a.push(t.name),r+=u})}),!s.every(function(t){return t}))throw u=i.filter(function(t,e){return!s[e]}),new Error("Could not find weights in manifest with names: "+u.join(", ")+". \nManifest JSON has weights with names: "+a.join(", ")+".");return c=e.reduce(function(t,e,n){return e&&t.push(n),t},[]),h=[],c.forEach(function(t){n[t].paths.forEach(function(t){var e=r+(r.endsWith("/")?"":"/")+t;h.push(e)})}),[4,t(h)];case 1:return d=l.sent(),p={},f=0,c.forEach(function(t){for(var e=n[t].paths.length,r=0,i=0;i<e;i++)r+=d[f+i].byteLength;for(var s=new ArrayBuffer(r),a=new Uint8Array(s),l=0,u=0;u<e;u++){var c=new Uint8Array(d[f+u]);a.set(c,l),l+=c.byteLength}o[t].forEach(function(t){var e=rc(s.slice(t.groupOffset,t.groupOffset+t.sizeBytes),[t.manifestEntry]);for(var n in e)p[n]=e[n]}),f+=e}),[2,p]}})})}}uc.registerSaveRouter(function(t){return c().getBool("IS_BROWSER")&&!Array.isArray(t)&&t.startsWith(Fc.URL_SCHEME)?function(t){return void 0===t&&(t="model"),new Fc(t)}(t.slice(Fc.URL_SCHEME.length)):null});var Vc=function(){function t(t,e){if(this.DEFAULT_METHOD="POST",null==e&&(e={}),this.weightPathPrefix=e.weightPathPrefix,this.onProgress=e.onProgress,null!=e.fetchFunc?(E("function"==typeof e.fetchFunc,function(){return"Must pass a function that matches the signature of `fetch` (see https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API)"}),this.fetch=e.fetchFunc):this.fetch=c().platform.fetch,E(null!=t&&t.length>0,function(){return"URL path for http must not be null, undefined or empty."}),Array.isArray(t)&&E(2===t.length,function(){return"URL paths for http must have a length of 2, (actual length is "+t.length+")."}),this.path=t,null!=e.requestInit&&null!=e.requestInit.body)throw new Error("requestInit is expected to have no pre-existing body, but has one.");this.requestInit=e.requestInit||{}}return t.prototype.save=function(t){return a(this,void 0,void 0,function(){var e,n,r,i;return l(this,function(o){switch(o.label){case 0:if(t.modelTopology instanceof ArrayBuffer)throw new Error("BrowserHTTPRequest.save() does not support saving model topology in binary formats yet.");return(e=Object.assign({method:this.DEFAULT_METHOD},this.requestInit)).body=new FormData,n=[{paths:["./model.weights.bin"],weights:t.weightSpecs}],r={modelTopology:t.modelTopology,format:t.format,generatedBy:t.generatedBy,convertedBy:t.convertedBy,userDefinedMetadata:t.userDefinedMetadata,weightsManifest:n},e.body.append("model.json",new Blob([JSON.stringify(r)],{type:"application/json"}),"model.json"),null!=t.weightData&&e.body.append("model.weights.bin",new Blob([t.weightData],{type:"application/octet-stream"}),"model.weights.bin"),[4,this.fetch(this.path,e)];case 1:if((i=o.sent()).ok)return[2,{modelArtifactsInfo:lc(t),responses:[i]}];throw new Error("BrowserHTTPRequest.save() failed due to HTTP response status "+i.status+".")}})})},t.prototype.load=function(){return a(this,void 0,void 0,function(){var t,e,n,r,i,o,s,a,u,c,h,d;return l(this,function(l){switch(l.label){case 0:return[4,this.fetch(this.path,this.requestInit)];case 1:if(!(t=l.sent()).ok)throw new Error("Request to "+this.path+" failed with status code "+t.status+". Please verify this URL points to the model JSON of the model to load.");l.label=2;case 2:return l.trys.push([2,4,,5]),[4,t.json()];case 3:return e=l.sent(),[3,5];case 4:throw l.sent(),n="Failed to parse model JSON of response from "+this.path+".",this.path.endsWith(".pb")?n+=" Your path contains a .pb file extension. Support for .pb models have been removed in TensorFlow.js 1.0 in favor of .json models. You can re-convert your Python TensorFlow model using the TensorFlow.js 1.0 conversion scripts or you can convert your.pb models with the 'pb2json'NPM script in the tensorflow/tfjs-converter repository.":n+=" Please make sure the server is serving valid JSON for this request.",new Error(n);case 5:if(r=e.modelTopology,i=e.weightsManifest,o=e.generatedBy,s=e.convertedBy,a=e.format,u=e.userDefinedMetadata,null==r&&null==i)throw new Error("The JSON from HTTP path "+this.path+" contains neither model topology or manifest for weights.");return null==i?[3,7]:[4,this.loadWeights(i)];case 6:d=l.sent(),c=d[0],h=d[1],l.label=7;case 7:return[2,{modelTopology:r,weightSpecs:c,weightData:h,userDefinedMetadata:u,generatedBy:o,convertedBy:s,format:a}]}})})},t.prototype.loadWeights=function(t){return a(this,void 0,void 0,function(){var e,n,r,i,o,s,a,u,c,h,d;return l(this,function(l){switch(l.label){case 0:for(e=Array.isArray(this.path)?this.path[1]:this.path,n=function(t){var e=t.lastIndexOf("/"),n=t.lastIndexOf("?");return[t.substring(0,e)+"/",n>e?t.substring(n):""]}(e),r=n[0],i=n[1],o=this.weightPathPrefix||r,s=[],a=0,u=t;a<u.length;a++)c=u[a],s.push.apply(s,c.weights);return h=[],t.forEach(function(t){t.paths.forEach(function(t){h.push(o+t+i)})}),[4,$c(h,{requestInit:this.requestInit,fetchFunc:this.fetch,onProgress:this.onProgress})];case 1:return d=l.sent(),[2,[s,sc(d)]]}})})},t.URL_SCHEME_REGEX=/^https?:\/\//,t}();function Hc(t){return null!=t.match(Vc.URL_SCHEME_REGEX)}var Wc=function(t,e){return"undefined"==typeof fetch?null:(Array.isArray(t)?t.every(function(t){return Hc(t)}):Hc(t))?Gc(t,{onProgress:e}):null};function Gc(t,e){return new Vc(t,e)}uc.registerSaveRouter(Wc),uc.registerLoadRouter(Wc);var zc,Xc=function(){function t(t){this.modelArtifacts=t}return t.prototype.load=function(){return a(this,void 0,void 0,function(){return l(this,function(t){return[2,this.modelArtifacts]})})},t}(),Kc=function(){function t(t){this.saveHandler=t}return t.prototype.save=function(t){return a(this,void 0,void 0,function(){return l(this,function(e){return[2,this.saveHandler(t)]})})},t}(),Yc=Object.freeze({browserFiles:function(t){return new Bc(t)},browserHTTPRequest:function(t,e){return Gc(t,e)},concatenateArrayBuffers:sc,decodeWeights:rc,encodeWeights:function(t,e){return a(this,void 0,void 0,function(){var n,r,i,o,s,u=this;return l(this,function(c){switch(c.label){case 0:for(n=[],r=[],i=Array.isArray(t)?t.map(function(t){return t.name}):Object.keys(t),o=function(o){var s=i[o],c=Array.isArray(t)?t[o].tensor:t[s];if("float32"!==c.dtype&&"int32"!==c.dtype&&"bool"!==c.dtype&&"string"!==c.dtype)throw new Error("Unsupported dtype in weight '"+s+"': "+c.dtype);var h={name:s,shape:c.shape,dtype:c.dtype};if("string"===c.dtype){var d=new Promise(function(t){return a(u,void 0,void 0,function(){var e,n,r,i,o,s,a;return l(this,function(l){switch(l.label){case 0:return[4,c.bytes()];case 1:for(e=l.sent(),n=e.reduce(function(t,e){return t+e.length},0)+nc*e.length,r=new Uint8Array(n),i=0,o=0;o<e.length;o++)s=e[o],a=new Uint8Array(new Uint32Array([s.length]).buffer),r.set(a,i),i+=nc,r.set(s,i),i+=s.length;return t(r),[2]}})})});r.push(d)}else r.push(c.data());null!=e&&(h.group=e),n.push(h)},s=0;s<i.length;++s)o(s);return[4,Promise.all(r)];case 1:return[2,{data:function(t){if(null===t)throw new Error("Invalid input value: "+JSON.stringify(t));var e=0,n=[];t.forEach(function(t){if(e+=t.byteLength,n.push(t.byteLength===t.buffer.byteLength?t:new t.constructor(t)),!(t instanceof Float32Array||t instanceof Int32Array||t instanceof Uint8Array))throw new Error("Unsupported TypedArray subtype: "+t.constructor.name)});var r=new Uint8Array(e),i=0;return n.forEach(function(t){r.set(new Uint8Array(t.buffer),i),i+=t.byteLength}),r.buffer}(c.sent()),specs:n}]}})})},fromMemory:function(t,e,n,r){return 1===arguments.length?null!=t.modelTopology||null!=t.weightSpecs?new Xc(t):(console.warn("Please call tf.io.fromMemory() with only one argument. The argument should be of type ModelArtifacts. The multi-argument signature of tf.io.fromMemory() has been deprecated and will be removed in a future release."),new Xc({modelTopology:t})):(console.warn("Please call tf.io.fromMemory() with only one argument. The argument should be of type ModelArtifacts. The multi-argument signature of tf.io.fromMemory() has been deprecated and will be removed in a future release."),new Xc({modelTopology:t,weightSpecs:e,weightData:n,trainingConfig:r}))},getLoadHandlers:function(t,e){return uc.getLoadHandlers(t,e)},getModelArtifactsInfoForJSON:lc,getSaveHandlers:function(t){return uc.getSaveHandlers(t)},http:Gc,isHTTPScheme:Hc,loadWeights:function(t,e,n,r){return void 0===e&&(e=""),a(this,void 0,void 0,function(){return l(this,function(i){return[2,Uc(function(t){return $c(t,{requestInit:r})})(t,e,n)]})})},registerLoadRouter:function(t){return uc.registerLoadRouter(t)},registerSaveRouter:function(t){return uc.registerSaveRouter(t)},weightsLoaderFactory:Uc,withSaveHandler:function(t){return new Kc(t)},copyModel:function(t,e){return a(this,void 0,void 0,function(){return l(this,function(n){return[2,pc(t,e,!1)]})})},listModels:function(){return a(this,void 0,void 0,function(){var t,e,n,r,i,o,s;return l(this,function(a){switch(a.label){case 0:t=hc.getSchemes(),e={},n=0,r=t,a.label=1;case 1:return n<r.length?(i=r[n],[4,hc.getManager(i).listModels()]):[3,4];case 2:for(s in o=a.sent())e[i+cc+s]=o[s];a.label=3;case 3:return n++,[3,1];case 4:return[2,e]}})})},moveModel:function(t,e){return a(this,void 0,void 0,function(){return l(this,function(n){return[2,pc(t,e,!0)]})})},removeModel:function(t){return a(this,void 0,void 0,function(){var e;return l(this,function(n){return e=dc(t),[2,hc.getManager(e.scheme).removeModel(e.path)]})})}}),qc=ln({confusionMatrix_:function(t,e,n){var r=Ye(t,"labels","confusionMatrix"),i=Ye(e,"predictions","confusionMatrix");E(null==n||n>0&&Number.isInteger(n),function(){return"If provided, numClasses must be a positive integer, but got "+n}),E(1===r.rank,function(){return"Expected the rank of labels to be 1, but got "+r.rank}),E(1===i.rank,function(){return"Expected the rank of predictions to be 1, but got "+i.rank}),E(r.shape[0]===i.shape[0],function(){return"Mismatch in the number of examples: "+r.shape[0]+" vs. "+i.shape[0]+". Labels and predictions should have the same number of elements."}),E(n>0&&Number.isInteger(n),function(){return"numClasses is required to be a positive integer, but got "+n});var o=Qn(r.asType("int32"),n),s=Qn(i.asType("int32"),n);return o.transpose().matMul(s).asType("int32")}}),Jc=(Object.freeze({confusionMatrix:qc}),ln({fromPixels_:function(t,e){if(void 0===e&&(e=3),e>4)throw new Error("Cannot construct Tensor with more than 4 channels from pixels.");if(null==t)throw new Error("pixels passed to tf.browser.fromPixels() can not be null");var n=!1,r=!1,i=!1,o=!1,s=!1;if(t.data instanceof Uint8Array)n=!0;else if("undefined"!=typeof ImageData&&t instanceof ImageData)r=!0;else if("undefined"!=typeof HTMLVideoElement&&t instanceof HTMLVideoElement)i=!0;else if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement)o=!0;else{if(null==t.getContext)throw new Error("pixels passed to tf.browser.fromPixels() must be either an HTMLVideoElement, HTMLImageElement, HTMLCanvasElement, ImageData in browser, or OffscreenCanvas, ImageData in webworker or {data: Uint32Array, width: number, height: number}, but was "+t.constructor.name);s=!0}if(i&&i&&t.readyState<2)throw new Error("The video element has not loaded data yet. Please wait for `loadeddata` event on the <video> element.");if(null!=f("FromPixels",Pt.backendName))return Pt.runKernel("FromPixels",{pixels:t},{numChannels:e});var a,l,u=i?[t.videoWidth,t.videoHeight]:[t.width,t.height],c=u[0],h=u[1];if(s?a=t.getContext("2d").getImageData(0,0,c,h).data:r||n?a=t.data:(o||i)&&(null==zc&&(zc=document.createElement("canvas").getContext("2d")),zc.canvas.width=c,zc.canvas.height=h,zc.drawImage(t,0,0,c,h),a=zc.getImageData(0,0,c,h).data),4===e)l=new Int32Array(a);else{var d=c*h;l=new Int32Array(d*e);for(var p=0;p<d;p++)for(var g=0;g<e;++g)l[p*e+g]=a[4*p+g]}return vn(l,[h,c,e],"int32")}})),Zc=Object.freeze({toPixels:function(t,e){return a(this,void 0,void 0,function(){var n,r,i,o,s,a,u,c,h,d,p,f,g,m,v,b,_,y,T,x,E,w,C;return l(this,function(l){switch(l.label){case 0:if(n=Ye(t,"img","toPixels"),t instanceof yt||(n=n.toInt()),2!==n.rank&&3!==n.rank)throw new Error("toPixels only supports rank 2 or 3 tensors, got rank "+n.rank+".");if(r=n.shape.slice(0,2),i=r[0],o=r[1],(s=2===n.rank?1:n.shape[2])>4||2===s)throw new Error("toPixels only supports depth of size 1, 3 or 4 but got "+s);return[4,n.data()];case 1:return a=l.sent(),u=n.min(),c=n.max(),[4,Promise.all([u.data(),c.data()])];case 2:if(h=l.sent(),d=h[0],p=h[1],f=d[0],g=p[0],u.dispose(),c.dispose(),"float32"===n.dtype){if(f<0||g>1)throw new Error("Tensor values for a float32 Tensor must be in the range [0 - 1] but got range ["+f+" - "+g+"].")}else{if("int32"!==n.dtype)throw new Error("Unsupported type for toPixels: "+n.dtype+". Please use float32 or int32 tensors.");if(f<0||g>255)throw new Error("Tensor values for a int32 Tensor must be in the range [0 - 255] but got range ["+f+" - "+g+"].")}for(m="float32"===n.dtype?255:1,v=new Uint8ClampedArray(o*i*4),b=0;b<i*o;++b)_=void 0,y=void 0,T=void 0,x=void 0,1===s?(_=a[b]*m,y=a[b]*m,T=a[b]*m,x=255):3===s?(_=a[3*b]*m,y=a[3*b+1]*m,T=a[3*b+2]*m,x=255):4===s&&(_=a[4*b]*m,y=a[4*b+1]*m,T=a[4*b+2]*m,x=a[4*b+3]*m),v[0+(E=4*b)]=Math.round(_),v[E+1]=Math.round(y),v[E+2]=Math.round(T),v[E+3]=Math.round(x);return null!=e&&(e.width=o,e.height=i,w=e.getContext("2d"),C=new ImageData(v,o,i),w.putImageData(C,0,0)),n!==t&&n.dispose(),[2,v]}})})},fromPixels:Jc}),Qc=function(){function t(){}return t.prototype.getClassName=function(){return this.constructor.className},t.fromConfig=function(t,e){return new t(e)},t}(),th=function(){function t(){this.classNameMap={}}return t.getMap=function(){return null==t.instance&&(t.instance=new t),t.instance},t.register=function(e){t.getMap().classNameMap[e.className]=[e,e.fromConfig]},t}();function eh(t){E(null!=t.className,function(){return"Class being registered does not have the static className property defined."}),E("string"==typeof t.className,function(){return"className is required to be a string, but got type "+typeof t.className}),E(t.className.length>0,function(){return"Class being registered has an empty-string as its className, which is disallowed."}),th.register(t)}Object.freeze({Serializable:Qc,SerializationMap:th,registerClass:eh});var nh=.001,rh=.1;function ih(){return 32===Pt.backend.floatPrecision()?nh:rh}function oh(t,e,n){var r=!0;if((V(t)||V(e))&&(r=!1),V(t)&&V(e)&&(r=!0),r){var i=t.constructor.name,o=e.constructor.name;if(i!==o)throw new Error("Arrays are of different type. Actual: "+i+". Expected: "+o)}if(Array.isArray(t)&&Array.isArray(e)){var s=Xe(t),a=Xe(e);if(!O(s,a))throw new Error("Arrays have different shapes. Actual: ["+s+"]. Expected: ["+a+"]")}var l=V(t)?t:S(t),u=V(e)?e:S(e);if(l.length!==u.length)throw new Error("Arrays have different lengths actual: "+l.length+" vs expected: "+u.length+".\nActual: "+l+".\nExpected: "+u+".");for(var c=0;c<u.length;++c){var h=l[c],d=u[c];if(!n(h,d))throw new Error("Arrays differ: actual["+c+"] = "+h+", expected["+c+"] = "+d+".\nActual: "+l+".\nExpected: "+u+".")}}function sh(t,e,n){return!isFinite(t)&&!isFinite(e)||!(isNaN(t)||isNaN(e)||Math.abs(t-e)>n)}Object.freeze({TEST_EPSILON_FLOAT16:rh,expectArraysClose:function(t,e,n){return null==n&&(n=ih()),oh(t,e,function(t,e){return sh(t,e,n)})},testEpsilon:ih,expectPromiseToFail:function(t,e){t().then(function(){return e.fail()},function(){return e()})},expectArraysEqual:function(t,e){var n="string"==typeof e||"number"==typeof e||"boolean"==typeof e?[e]:e;return G(t)||G(t[0])||G(e)||G(e[0])?oh(t,n,function(t,e){return t==e}):oh(t,e,function(t,e){return sh(t,e,0)})},expectNumbersClose:function(t,e,n){if(null==n&&(n=ih()),!sh(t,e,n))throw new Error("Numbers differ: actual === "+t+", expected === "+e)},expectValuesInRange:function(t,e,n){for(var r=0;r<t.length;r++)if(t[r]<e||t[r]>n)throw new Error("Value out of range:"+t[r]+" low: "+e+", high: "+n)},expectArrayBuffersEqual:function(t,e){expect(new Float32Array(t)).toEqual(new Float32Array(e))}}),Object.freeze({gpgpu_util:bo,webgl_util:Ue,forceHalfFloat:function(){c().set("WEBGL_FORCE_F16_TEXTURES",!0)},MathBackendWebGL:es,setWebGLContext:Wt,GPGPUContext:_o});var ah=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s(e,t),e.prototype.minimize=function(t,e,n){void 0===e&&(e=!1);var r=this.computeGradients(t,n),i=r.value,o=r.grads;if(null!=n){var s=n.map(function(t){return{name:t.name,tensor:o[t.name]}});this.applyGradients(s)}else this.applyGradients(o);return Ge(o),e?i:(i.dispose(),null)},Object.defineProperty(e.prototype,"iterations",{get:function(){return null==this.iterations_&&(this.iterations_=0),this.iterations_},enumerable:!0,configurable:!0}),e.prototype.incrementIterations=function(){this.iterations_=this.iterations+1},e.prototype.computeGradients=function(t,e){return function(t,e){E(Y(t),function(){return"The f passed in variableGrads(f) must be a function"}),E(null==e||Array.isArray(e)&&e.every(function(t){return t instanceof St}),function(){return"The varList passed in variableGrads(f, varList) must be an array of variables"});var n=null!=e;if(!n)for(var r in e=[],Pt.registeredVariables)e.push(Pt.registeredVariables[r]);var i=n?e.filter(function(t){return!t.trainable}):null,o=e.length;E((e=e.filter(function(t){return t.trainable})).length>0,function(){return"variableGrads() expects at least one of the input variables to be trainable, but none of the "+o+" variables is trainable."});var s=Pt.gradients(t,e,null,!0),a=s.value,l=s.grads;E(l.some(function(t){return null!=t}),function(){return"Cannot find a connection between any variable and the result of the loss function y=f(x). Please make sure the operations that use variables are inside the function f passed to minimize()."}),E(0===a.rank,function(){return"The f passed in variableGrads(f) must return a scalar, but it returned a rank-"+a.rank+" tensor"});var u={};return e.forEach(function(t,e){null!=l[e]&&(u[t.name]=l[e])}),null!=i&&i.forEach(function(t){return u[t.name]=null}),{value:a,grads:u}}(t,e)},e.prototype.dispose=function(){null!=this.iterations_&&Ge(this.iterations_)},e.prototype.saveIterations=function(){return a(this,void 0,void 0,function(){return l(this,function(t){return null==this.iterations_&&(this.iterations_=0),[2,{name:"iter",tensor:fn(this.iterations_,"int32")}]})})},e.prototype.getWeights=function(){return a(this,void 0,void 0,function(){return l(this,function(t){throw new Error("getWeights() is not implemented for this optimizer yet.")})})},e.prototype.setWeights=function(t){return a(this,void 0,void 0,function(){return l(this,function(t){throw new Error("setWeights() is not implemented for this optimizer class "+this.getClassName())})})},e.prototype.extractIterations=function(t){return a(this,void 0,void 0,function(){var e;return l(this,function(n){switch(n.label){case 0:return e=this,[4,t[0].tensor.data()];case 1:return e.iterations_=n.sent()[0],[2,t.slice(1)]}})})},e}(Qc);Object.defineProperty(ah,Symbol.hasInstance,{value:function(t){return null!=t.minimize&&null!=t.computeGradients&&null!=t.applyGradients}});var lh=function(t){function e(e,n,r){void 0===r&&(r=null);var i=t.call(this)||this;return i.learningRate=e,i.rho=n,i.epsilon=r,i.accumulatedGrads=[],i.accumulatedUpdates=[],null==r&&(i.epsilon=Pt.backend.epsilon()),i}return s(e,t),e.prototype.applyGradients=function(t){var e=this;(Array.isArray(t)?t.map(function(t){return t.name}):Object.keys(t)).forEach(function(n,r){var i=Pt.registeredVariables[n];null==e.accumulatedGrads[r]&&(e.accumulatedGrads[r]={originalName:n+"/accum_grad",variable:We(function(){return wn(i).variable(!1)})}),null==e.accumulatedUpdates[r]&&(e.accumulatedUpdates[r]={originalName:n+"/accum_var",variable:We(function(){return wn(i).variable(!1)})});var o=Array.isArray(t)?t[r].tensor:t[n];if(null!=o){var s=e.accumulatedGrads[r].variable,a=e.accumulatedUpdates[r].variable;We(function(){var t=s.mul(e.rho).add(o.square().mul(1-e.rho)),n=a.add(e.epsilon).sqrt().div(s.add(e.epsilon).sqrt()).mul(o),r=a.mul(e.rho).add(n.square().mul(1-e.rho));s.assign(t),a.assign(r);var l=n.mul(-e.learningRate).add(i);i.assign(l)})}}),this.incrementIterations()},e.prototype.dispose=function(){null!=this.accumulatedUpdates&&(Ge(this.accumulatedGrads.map(function(t){return t.variable})),Ge(this.accumulatedUpdates.map(function(t){return t.variable})))},e.prototype.getWeights=function(){return a(this,void 0,void 0,function(){var t;return l(this,function(e){switch(e.label){case 0:return t=this.accumulatedGrads.concat(this.accumulatedUpdates),[4,this.saveIterations()];case 1:return[2,[e.sent()].concat(t.map(function(t){return{name:t.originalName,tensor:t.variable}}))]}})})},e.prototype.setWeights=function(t){return a(this,void 0,void 0,function(){var e;return l(this,function(n){switch(n.label){case 0:return[4,this.extractIterations(t)];case 1:return t=n.sent(),e=t.length/2,this.accumulatedGrads=t.slice(0,e).map(function(t){return{originalName:t.name,variable:t.tensor.variable(!1)}}),this.accumulatedUpdates=t.slice(e,2*e).map(function(t){return{originalName:t.name,variable:t.tensor.variable(!1)}}),[2]}})})},e.prototype.getConfig=function(){return{learningRate:this.learningRate,rho:this.rho,epsilon:this.epsilon}},e.fromConfig=function(t,e){return new t(e.learningRate,e.rho,e.epsilon)},e.className="Adadelta",e}(ah);eh(lh);var uh=function(t){function e(e,n){void 0===n&&(n=.1);var r=t.call(this)||this;return r.learningRate=e,r.initialAccumulatorValue=n,r.accumulatedGrads=[],r}return s(e,t),e.prototype.applyGradients=function(t){var e=this;(Array.isArray(t)?t.map(function(t){return t.name}):Object.keys(t)).forEach(function(n,r){var i=Pt.registeredVariables[n];null==e.accumulatedGrads[r]&&(e.accumulatedGrads[r]={originalName:n+"/accumulator",variable:We(function(){return Tn(i.shape,e.initialAccumulatorValue).variable(!1)})});var o=Array.isArray(t)?t[r].tensor:t[n];if(null!=o){var s=e.accumulatedGrads[r].variable;We(function(){var t=s.add(o.square());s.assign(t);var n=o.div(t.add(Pt.backend.epsilon()).sqrt()).mul(-e.learningRate).add(i);i.assign(n)})}}),this.incrementIterations()},e.prototype.dispose=function(){null!=this.accumulatedGrads&&Ge(this.accumulatedGrads.map(function(t){return t.variable}))},e.prototype.getWeights=function(){return a(this,void 0,void 0,function(){return l(this,function(t){switch(t.label){case 0:return[4,this.saveIterations()];case 1:return[2,[t.sent()].concat(this.accumulatedGrads.map(function(t){return{name:t.originalName,tensor:t.variable}}))]}})})},e.prototype.setWeights=function(t){return a(this,void 0,void 0,function(){return l(this,function(e){switch(e.label){case 0:return[4,this.extractIterations(t)];case 1:return t=e.sent(),this.accumulatedGrads=t.map(function(t){return{originalName:t.name,variable:t.tensor.variable(!1)}}),[2]}})})},e.prototype.getConfig=function(){return{learningRate:this.learningRate,initialAccumulatorValue:this.initialAccumulatorValue}},e.fromConfig=function(t,e){return new t(e.learningRate,e.initialAccumulatorValue)},e.className="Adagrad",e}(ah);eh(uh);var ch=function(t){function e(e,n,r,i){void 0===i&&(i=null);var o=t.call(this)||this;return o.learningRate=e,o.beta1=n,o.beta2=r,o.epsilon=i,o.accumulatedFirstMoment=[],o.accumulatedSecondMoment=[],We(function(){o.accBeta1=fn(n).variable(),o.accBeta2=fn(r).variable()}),null==i&&(o.epsilon=Pt.backend.epsilon()),o}return s(e,t),e.prototype.applyGradients=function(t){var e=this,n=Array.isArray(t)?t.map(function(t){return t.name}):Object.keys(t);We(function(){var r=wa(1,e.accBeta1),i=wa(1,e.accBeta2);n.forEach(function(n,o){var s=Pt.registeredVariables[n];null==e.accumulatedFirstMoment[o]&&(e.accumulatedFirstMoment[o]={originalName:n+"/m",variable:We(function(){return wn(s).variable(!1)})}),null==e.accumulatedSecondMoment[o]&&(e.accumulatedSecondMoment[o]={originalName:n+"/v",variable:We(function(){return wn(s).variable(!1)})});var a=Array.isArray(t)?t[o].tensor:t[n];if(null!=a){var l=e.accumulatedFirstMoment[o].variable,u=e.accumulatedSecondMoment[o].variable,c=l.mul(e.beta1).add(a.mul(1-e.beta1)),h=u.mul(e.beta2).add(a.square().mul(1-e.beta2)),d=c.div(r),p=h.div(i);l.assign(c),u.assign(h);var f=d.div(p.sqrt().add(e.epsilon)).mul(-e.learningRate).add(s);s.assign(f)}}),e.accBeta1.assign(e.accBeta1.mul(e.beta1)),e.accBeta2.assign(e.accBeta2.mul(e.beta2))}),this.incrementIterations()},e.prototype.dispose=function(){this.accBeta1.dispose(),this.accBeta2.dispose(),null!=this.accumulatedFirstMoment&&Ge(this.accumulatedFirstMoment.map(function(t){return t.variable})),null!=this.accumulatedSecondMoment&&Ge(this.accumulatedSecondMoment.map(function(t){return t.variable}))},e.prototype.getWeights=function(){return a(this,void 0,void 0,function(){var t;return l(this,function(e){switch(e.label){case 0:return t=this.accumulatedFirstMoment.concat(this.accumulatedSecondMoment),[4,this.saveIterations()];case 1:return[2,[e.sent()].concat(t.map(function(t){return{name:t.originalName,tensor:t.variable}}))]}})})},e.prototype.setWeights=function(t){return a(this,void 0,void 0,function(){var e,n=this;return l(this,function(r){switch(r.label){case 0:return[4,this.extractIterations(t)];case 1:return t=r.sent(),We(function(){n.accBeta1.assign(Ta(n.beta1,n.iterations_+1)),n.accBeta2.assign(Ta(n.beta2,n.iterations_+1))}),e=t.length/2,this.accumulatedFirstMoment=t.slice(0,e).map(function(t){return{originalName:t.name,variable:t.tensor.variable(!1)}}),this.accumulatedSecondMoment=t.slice(e,2*e).map(function(t){return{originalName:t.name,variable:t.tensor.variable(!1)}}),[2]}})})},e.prototype.getConfig=function(){return{learningRate:this.learningRate,beta1:this.beta1,beta2:this.beta2,epsilon:this.epsilon}},e.fromConfig=function(t,e){return new t(e.learningRate,e.beta1,e.beta2,e.epsilon)},e.className="Adam",e}(ah);eh(ch);var hh=function(t){function e(e,n,r,i,o){void 0===i&&(i=null),void 0===o&&(o=0);var s=t.call(this)||this;return s.learningRate=e,s.beta1=n,s.beta2=r,s.epsilon=i,s.decay=o,s.accumulatedFirstMoment=[],s.accumulatedWeightedInfNorm=[],We(function(){s.iteration=fn(0).variable(),s.accBeta1=fn(n).variable()}),null==i&&(s.epsilon=Pt.backend.epsilon()),s}return s(e,t),e.prototype.applyGradients=function(t){var e=this,n=Array.isArray(t)?t.map(function(t){return t.name}):Object.keys(t);We(function(){var r=wa(1,e.accBeta1),i=ua(-e.learningRate,e.iteration.mul(e.decay).add(1));n.forEach(function(n,o){var s=Pt.registeredVariables[n];null==e.accumulatedFirstMoment[o]&&(e.accumulatedFirstMoment[o]={originalName:n+"/m",variable:wn(s).variable(!1)}),null==e.accumulatedWeightedInfNorm[o]&&(e.accumulatedWeightedInfNorm[o]={originalName:n+"/v",variable:wn(s).variable(!1)});var a=Array.isArray(t)?t[o].tensor:t[n];if(null!=a){var l=e.accumulatedFirstMoment[o].variable,u=e.accumulatedWeightedInfNorm[o].variable,c=l.mul(e.beta1).add(a.mul(1-e.beta1)),h=u.mul(e.beta2),d=a.abs(),p=h.maximum(d);l.assign(c),u.assign(p);var f=i.div(r).mul(c.div(p.add(e.epsilon))).add(s);s.assign(f)}}),e.iteration.assign(e.iteration.add(1)),e.accBeta1.assign(e.accBeta1.mul(e.beta1))}),this.incrementIterations()},e.prototype.dispose=function(){this.accBeta1.dispose(),this.iteration.dispose(),null!=this.accumulatedFirstMoment&&Ge(this.accumulatedFirstMoment.map(function(t){return t.variable})),null!=this.accumulatedWeightedInfNorm&&Ge(this.accumulatedWeightedInfNorm.map(function(t){return t.variable}))},e.prototype.getWeights=function(){return a(this,void 0,void 0,function(){return l(this,function(t){throw new Error("getWeights() is not implemented for Adamax yet.")})})},e.prototype.setWeights=function(t){return a(this,void 0,void 0,function(){return l(this,function(t){throw new Error("setWeights() is not implemented for Adamax yet.")})})},e.prototype.getConfig=function(){return{learningRate:this.learningRate,beta1:this.beta1,beta2:this.beta2,epsilon:this.epsilon,decay:this.decay}},e.fromConfig=function(t,e){return new t(e.learningRate,e.beta1,e.beta2,e.epsilon,e.decay)},e.className="Adamax",e}(ah);eh(hh);var dh=function(t){function e(e){var n=t.call(this)||this;return n.learningRate=e,n.setLearningRate(e),n}return s(e,t),e.prototype.applyGradients=function(t){var e=this;(Array.isArray(t)?t.map(function(t){return t.name}):Object.keys(t)).forEach(function(n,r){var i=Array.isArray(t)?t[r].tensor:t[n];if(null!=i){var o=Pt.registeredVariables[n];We(function(){var t=e.c.mul(i).add(o);o.assign(t)})}}),this.incrementIterations()},e.prototype.setLearningRate=function(t){this.learningRate=t,null!=this.c&&this.c.dispose(),this.c=function(t){return Pt.keep(t)}(fn(-t))},e.prototype.dispose=function(){this.c.dispose()},e.prototype.getWeights=function(){return a(this,void 0,void 0,function(){return l(this,function(t){switch(t.label){case 0:return[4,this.saveIterations()];case 1:return[2,[t.sent()]]}})})},e.prototype.setWeights=function(t){return a(this,void 0,void 0,function(){return l(this,function(e){switch(e.label){case 0:return[4,this.extractIterations(t)];case 1:if(0!==(t=e.sent()).length)throw new Error("SGD optimizer does not have settable weights.");return[2]}})})},e.prototype.getConfig=function(){return{learningRate:this.learningRate}},e.fromConfig=function(t,e){return new t(e.learningRate)},e.className="SGD",e}(ah);eh(dh);var ph=function(t){function e(e,n,r){void 0===r&&(r=!1);var i=t.call(this,e)||this;return i.learningRate=e,i.momentum=n,i.useNesterov=r,i.accumulations=[],i.m=fn(i.momentum),i}return s(e,t),e.prototype.applyGradients=function(t){var e=this;(Array.isArray(t)?t.map(function(t){return t.name}):Object.keys(t)).forEach(function(n,r){var i=Pt.registeredVariables[n];null==e.accumulations[r]&&(e.accumulations[r]={originalName:n+"/momentum",variable:We(function(){return wn(i).variable(!1)})});var o=e.accumulations[r].variable,s=Array.isArray(t)?t[r].tensor:t[n];null!=s&&We(function(){var t,n=e.m.mul(o).add(s);t=e.useNesterov?e.c.mul(s.add(n.mul(e.m))).add(i):e.c.mul(n).add(i),o.assign(n),i.assign(t)})}),this.incrementIterations()},e.prototype.dispose=function(){this.m.dispose(),null!=this.accumulations&&Ge(this.accumulations.map(function(t){return t.variable}))},e.prototype.setMomentum=function(t){this.momentum=t},e.prototype.getWeights=function(){return a(this,void 0,void 0,function(){return l(this,function(t){switch(t.label){case 0:return[4,this.saveIterations()];case 1:return[2,[t.sent()].concat(this.accumulations.map(function(t){return{name:t.originalName,tensor:t.variable}}))]}})})},e.prototype.setWeights=function(t){return a(this,void 0,void 0,function(){return l(this,function(e){switch(e.label){case 0:return[4,this.extractIterations(t)];case 1:return t=e.sent(),this.accumulations=t.map(function(t){return{originalName:t.name,variable:t.tensor.variable(!1)}}),[2]}})})},e.prototype.getConfig=function(){return{learningRate:this.learningRate,momentum:this.momentum,useNesterov:this.useNesterov}},e.fromConfig=function(t,e){return new t(e.learningRate,e.momentum,e.useNesterov)},e.className="Momentum",e}(dh);eh(ph);var fh=function(t){function e(e,n,r,i,o){void 0===n&&(n=.9),void 0===r&&(r=0),void 0===i&&(i=null),void 0===o&&(o=!1);var s=t.call(this)||this;if(s.learningRate=e,s.decay=n,s.momentum=r,s.epsilon=i,s.accumulatedMeanSquares=[],s.accumulatedMoments=[],s.accumulatedMeanGrads=[],s.centered=o,null==i&&(s.epsilon=Pt.backend.epsilon()),null==e)throw new Error("learningRate for RMSPropOptimizer must be defined.");return s}return s(e,t),e.prototype.applyGradients=function(t){var e=this;(Array.isArray(t)?t.map(function(t){return t.name}):Object.keys(t)).forEach(function(n,r){var i=Pt.registeredVariables[n];null==e.accumulatedMeanSquares[r]&&(e.accumulatedMeanSquares[r]={originalName:n+"/rms",variable:We(function(){return wn(i).variable(!1)})}),null==e.accumulatedMoments[r]&&(e.accumulatedMoments[r]={originalName:n+"/momentum",variable:We(function(){return wn(i).variable(!1)})}),null==e.accumulatedMeanGrads[r]&&e.centered&&(e.accumulatedMeanGrads[r]={originalName:n+"/mg",variable:We(function(){return wn(i).variable(!1)})});var o=Array.isArray(t)?t[r].tensor:t[n];if(null!=o){var s=e.accumulatedMeanSquares[r].variable,a=e.accumulatedMoments[r].variable;We(function(){var t=s.mul(e.decay).add(o.square().mul(1-e.decay));if(e.centered){var n=e.accumulatedMeanGrads[r].variable,l=n.mul(e.decay).add(o.mul(1-e.decay)),u=a.mul(e.momentum).add(o.mul(e.learningRate).div(t.sub(l.square().add(e.epsilon)).sqrt()));s.assign(t),n.assign(l),a.assign(u);var c=i.sub(u);i.assign(c)}else{var h=s.mul(e.decay).add(o.square().mul(1-e.decay));u=a.mul(e.momentum).add(o.mul(e.learningRate).div(h.add(e.epsilon).sqrt())),s.assign(h),a.assign(u),c=i.sub(u),i.assign(c)}})}}),this.incrementIterations()},e.prototype.dispose=function(){null!=this.accumulatedMeanSquares&&Ge(this.accumulatedMeanSquares.map(function(t){return t.variable})),null!=this.accumulatedMeanGrads&&this.centered&&Ge(this.accumulatedMeanGrads.map(function(t){return t.variable})),null!=this.accumulatedMoments&&Ge(this.accumulatedMoments.map(function(t){return t.variable}))},e.prototype.getWeights=function(){return a(this,void 0,void 0,function(){var t;return l(this,function(e){switch(e.label){case 0:return t=this.accumulatedMeanSquares.concat(this.accumulatedMoments),this.centered&&t.push.apply(t,this.accumulatedMeanGrads),[4,this.saveIterations()];case 1:return[2,[e.sent()].concat(t.map(function(t){return{name:t.originalName,tensor:t.variable}}))]}})})},e.prototype.setWeights=function(t){return a(this,void 0,void 0,function(){var e;return l(this,function(n){switch(n.label){case 0:return[4,this.extractIterations(t)];case 1:return t=n.sent(),e=this.centered?t.length/3:t.length/2,this.accumulatedMeanSquares=t.slice(0,e).map(function(t){return{originalName:t.name,variable:t.tensor.variable(!1)}}),this.accumulatedMoments=t.slice(e,2*e).map(function(t){return{originalName:t.name,variable:t.tensor.variable(!1)}}),this.centered&&(this.accumulatedMeanGrads=t.slice(2*e,3*e).map(function(t){return{originalName:t.name,variable:t.tensor.variable(!1)}})),[2]}})})},e.prototype.getConfig=function(){return{learningRate:this.learningRate,decay:this.decay,momentum:this.momentum,epsilon:this.epsilon,centered:this.centered}},e.fromConfig=function(t,e){return new t(e.learningRate,e.decay,e.momentum,e.epsilon,e.centered)},e.className="RMSProp",e}(ah);eh(fh);var gh=function(){function t(){}return t.sgd=function(t){return new dh(t)},t.momentum=function(t,e,n){return void 0===n&&(n=!1),new ph(t,e,n)},t.rmsprop=function(t,e,n,r,i){return void 0===e&&(e=.9),void 0===n&&(n=0),void 0===r&&(r=null),void 0===i&&(i=!1),new fh(t,e,n,r,i)},t.adam=function(t,e,n,r){return void 0===t&&(t=.001),void 0===e&&(e=.9),void 0===n&&(n=.999),void 0===r&&(r=null),new ch(t,e,n,r)},t.adadelta=function(t,e,n){return void 0===t&&(t=.001),void 0===e&&(e=.95),void 0===n&&(n=null),new lh(t,e,n)},t.adamax=function(t,e,n,r,i){return void 0===t&&(t=.002),void 0===e&&(e=.9),void 0===n&&(n=.999),void 0===r&&(r=null),void 0===i&&(i=0),new hh(t,e,n,r,i)},t.adagrad=function(t,e){return void 0===e&&(e=.1),new uh(t,e)},t}();gh.sgd,gh.momentum,gh.adadelta,gh.adagrad,gh.rmsprop,gh.adamax,gh.adam,"undefined"!=typeof requestAnimationFrame?requestAnimationFrame:"undefined"!=typeof setImmediate&&setImmediate;yt.prototype.squaredDifference=function(t){return is(this,t)},bt=Uu}).call(e,n("DuR2"),n("W2nU"),n("EuP9").Buffer)},pcbz:function(t,e,n){"use strict";e.a=function(t){var e="";if(!t)try{t=n("Ya8g")}catch(t){e=t.toString()}return{readFile:t?function(e){return new Promise(function(n,r){t.readFile(e,function(t,e){return t?r(t):n(e)})})}:function(){throw new Error("readFile - failed to require fs in nodejs environment with error: "+e)}}}},psUW:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.json=[{tfOpName:"Bincount",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"size",type:"number"},{start:2,name:"weights",type:"tensor"}]},{tfOpName:"DenseBincount",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"size",type:"number"},{start:2,name:"weights",type:"tensor"}],attrs:[{tfName:"binary_output",name:"binaryOutput",type:"bool"}]},{tfOpName:"Max",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Mean",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Min",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Sum",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"All",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Any",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"ArgMax",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]},{tfOpName:"ArgMin",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]},{tfOpName:"Prod",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Cumsum",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}],attrs:[{tfName:"exclusive",name:"exclusive",type:"bool"},{tfName:"reverse",name:"reverse",type:"bool"}]}]},pxG4:function(t,e,n){"use strict";t.exports=function(t){return function(e){return t.apply(null,e)}}},qARP:function(t,e,n){"use strict";var r=n("lOnJ");t.exports.f=function(t){return new function(t){var e,n;this.promise=new t(function(t,r){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=r}),this.resolve=r(e),this.reject=r(n)}(t)}},qDT4:function(t,e,n){"use strict";var r=window.URL||window.webkitURL;t.exports=function(t,e){try{try{var n;try{(n=new(window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder)).append(t),n=n.getBlob()}catch(e){n=new Blob([t])}return new Worker(r.createObjectURL(n))}catch(e){return new Worker("data:application/javascript,"+encodeURIComponent(t))}}catch(t){if(!e)throw Error("Inline worker is not supported");return new Worker(e)}}},qL07:function(t,e,n){"use strict";var r={};n.d(r,"callAndCheck",function(){return b}),n.d(r,"canBeRepresented",function(){return T}),n.d(r,"getWebGLErrorMessage",function(){return x}),n.d(r,"getExtensionOrThrow",function(){return E}),n.d(r,"createVertexShader",function(){return w}),n.d(r,"createFragmentShader",function(){return C}),n.d(r,"createProgram",function(){return k}),n.d(r,"linkProgram",function(){return O}),n.d(r,"validateProgram",function(){return I}),n.d(r,"createStaticVertexBuffer",function(){return R}),n.d(r,"createStaticIndexBuffer",function(){return A}),n.d(r,"getNumChannels",function(){return N}),n.d(r,"createTexture",function(){return D}),n.d(r,"validateTextureSize",function(){return M}),n.d(r,"createFramebuffer",function(){return L}),n.d(r,"bindVertexBufferToProgramAttribute",function(){return P}),n.d(r,"bindTextureUnit",function(){return F}),n.d(r,"unbindTextureUnit",function(){return B}),n.d(r,"getProgramUniformLocationOrThrow",function(){return j}),n.d(r,"getProgramUniformLocation",function(){return $}),n.d(r,"bindTextureToProgramUniformSampler",function(){return U}),n.d(r,"bindCanvasToFramebuffer",function(){return V}),n.d(r,"bindColorTextureToFramebuffer",function(){return H}),n.d(r,"unbindColorTextureFromFramebuffer",function(){return W}),n.d(r,"validateFramebuffer",function(){return G}),n.d(r,"getFramebufferErrorMessage",function(){return z}),n.d(r,"getBatchDim",function(){return Y}),n.d(r,"getRowsCols",function(){return q}),n.d(r,"getShapeAs3D",function(){return J}),n.d(r,"getTextureShapeFromLogicalShape",function(){return Z}),n.d(r,"isReshapeFree",function(){return tt}),n.d(r,"getWebGLMaxTextureSize",function(){return rt}),n.d(r,"resetMaxTextureSize",function(){return it}),n.d(r,"resetMaxTexturesInShader",function(){return ot}),n.d(r,"getMaxTexturesInShader",function(){return st}),n.d(r,"getWebGLDisjointQueryTimerVersion",function(){return at}),n.d(r,"hasExtension",function(){return lt}),n.d(r,"isWebGLVersionEnabled",function(){return ut}),n.d(r,"isCapableOfRenderingToFloatTexture",function(){return ct}),n.d(r,"isDownloadFloatTextureEnabled",function(){return ht}),n.d(r,"isWebGLFenceEnabled",function(){return pt}),n.d(r,"assertNotComplex",function(){return ft});var i={};n.d(i,"createVertexShader",function(){return Gt}),n.d(i,"createVertexBuffer",function(){return zt}),n.d(i,"createIndexBuffer",function(){return Xt}),n.d(i,"getInternalFormatForFloat32MatrixTexture",function(){return Yt}),n.d(i,"createFloat32MatrixTexture",function(){return qt}),n.d(i,"getInternalFormatForFloat16MatrixTexture",function(){return Jt}),n.d(i,"createFloat16MatrixTexture",function(){return Zt}),n.d(i,"getInternalFormatForUnsignedBytesMatrixTexture",function(){return Qt}),n.d(i,"createUnsignedBytesMatrixTexture",function(){return te}),n.d(i,"getInternalFormatForPackedMatrixTexture",function(){return ee}),n.d(i,"createPackedMatrixTexture",function(){return ne}),n.d(i,"getInternalFormatForFloat16PackedMatrixTexture",function(){return re}),n.d(i,"createFloat16PackedMatrixTexture",function(){return ie}),n.d(i,"bindVertexProgramAttributeStreams",function(){return oe}),n.d(i,"uploadDenseMatrixToTexture",function(){return se}),n.d(i,"uploadPixelDataToTexture",function(){return ae}),n.d(i,"createBufferFromOutputTexture",function(){return le}),n.d(i,"downloadFloat32MatrixFromBuffer",function(){return ue}),n.d(i,"downloadByteEncodedFloatMatrixFromOutputTexture",function(){return ce}),n.d(i,"downloadPackedMatrixFromBuffer",function(){return he}),n.d(i,"downloadMatrixFromPackedOutputTexture",function(){return de});var o={};n.d(o,"simpleAbsImpl",function(){return ge}),n.d(o,"addImpl",function(){return Ee}),n.d(o,"bincountImpl",function(){return Ce}),n.d(o,"bincountReduceImpl",function(){return Se}),n.d(o,"ceilImpl",function(){return Re}),n.d(o,"concatImpl",function(){return Ae}),n.d(o,"equalImpl",function(){return Ne}),n.d(o,"expImpl",function(){return De}),n.d(o,"expm1Impl",function(){return Me}),n.d(o,"floorImpl",function(){return Le}),n.d(o,"gatherNdImpl",function(){return Pe}),n.d(o,"gatherV2Impl",function(){return Fe}),n.d(o,"greaterImpl",function(){return Be}),n.d(o,"greaterEqualImpl",function(){return je}),n.d(o,"lessImpl",function(){return $e}),n.d(o,"lessEqualImpl",function(){return Ue}),n.d(o,"linSpaceImpl",function(){return Ve}),n.d(o,"logImpl",function(){return He}),n.d(o,"maxImpl",function(){return We}),n.d(o,"maximumImpl",function(){return Ge}),n.d(o,"minimumImpl",function(){return ze}),n.d(o,"multiplyImpl",function(){return Xe}),n.d(o,"negImpl",function(){return Ye}),n.d(o,"notEqualImpl",function(){return qe}),n.d(o,"prodImpl",function(){return Ze}),n.d(o,"rangeImpl",function(){return Qe}),n.d(o,"rsqrtImpl",function(){return tn}),n.d(o,"sigmoidImpl",function(){return en}),n.d(o,"sliceImpl",function(){return nn}),n.d(o,"sparseFillEmptyRowsImpl",function(){return rn}),n.d(o,"sparseReshapeImpl",function(){return on}),n.d(o,"sparseSegmentReductionImpl",function(){return sn}),n.d(o,"sqrtImpl",function(){return an}),n.d(o,"squaredDifferenceImpl",function(){return ln}),n.d(o,"stridedSliceImpl",function(){return un}),n.d(o,"stringNGramsImpl",function(){return hn}),n.d(o,"stringSplitImpl",function(){return pn}),n.d(o,"stringToHashBucketFastImpl",function(){return fn}),n.d(o,"subImpl",function(){return gn}),n.d(o,"tileImpl",function(){return vn}),n.d(o,"topKImpl",function(){return yn}),n.d(o,"transposeImpl",function(){return Je}),n.d(o,"uniqueImpl",function(){return Tn});var s=n("JV7f");
  5128. /**
  5129. * @license
  5130. * Copyright 2018 Google LLC. All Rights Reserved.
  5131. * Licensed under the Apache License, Version 2.0 (the "License");
  5132. * you may not use this file except in compliance with the License.
  5133. * You may obtain a copy of the License at
  5134. *
  5135. * http://www.apache.org/licenses/LICENSE-2.0
  5136. *
  5137. * Unless required by applicable law or agreed to in writing, software
  5138. * distributed under the License is distributed on an "AS IS" BASIS,
  5139. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5140. * See the License for the specific language governing permissions and
  5141. * limitations under the License.
  5142. * =============================================================================
  5143. */const a={},l={alpha:!1,antialias:!1,premultipliedAlpha:!1,preserveDrawingBuffer:!1,depth:!1,stencil:!1,failIfMajorPerformanceCaveat:!0};function u(t,e){a[t]=e}function c(t,e){if(!(t in a)||null!=e){const n=function(t,e){if(1!==t&&2!==t)throw new Error("Cannot get WebGL rendering context, WebGL is disabled.");const n=null==e?function(t){if("undefined"!=typeof OffscreenCanvas&&2===t)return new OffscreenCanvas(300,150);if("undefined"!=typeof document)return document.createElement("canvas");throw new Error("Cannot create a canvas in this context")}(t):e;if(n.addEventListener("webglcontextlost",e=>{e.preventDefault(),delete a[t]},!1),1===t)return n.getContext("webgl",l)||n.getContext("experimental-webgl",l);return n.getContext("webgl2",l)}
  5144. /**
  5145. * @license
  5146. * Copyright 2017 Google LLC. All Rights Reserved.
  5147. * Licensed under the Apache License, Version 2.0 (the "License");
  5148. * you may not use this file except in compliance with the License.
  5149. * You may obtain a copy of the License at
  5150. *
  5151. * http://www.apache.org/licenses/LICENSE-2.0
  5152. *
  5153. * Unless required by applicable law or agreed to in writing, software
  5154. * distributed under the License is distributed on an "AS IS" BASIS,
  5155. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5156. * See the License for the specific language governing permissions and
  5157. * limitations under the License.
  5158. * =============================================================================
  5159. */(t,e);if(null===n)return console.log("Could not get context for WebGL version",t),null;a[t]=n}const n=a[t];return null==n||n.isContextLost()?(delete a[t],c(t)):(n.disable(n.DEPTH_TEST),n.disable(n.STENCIL_TEST),n.disable(n.BLEND),n.disable(n.DITHER),n.disable(n.POLYGON_OFFSET_FILL),n.disable(n.SAMPLE_COVERAGE),n.enable(n.SCISSOR_TEST),n.enable(n.CULL_FACE),n.cullFace(n.BACK),a[t])}var h,d,p;function f(t,e){return[e,t]}function g(t){const e=s._152.sizeFromShape(t),n=Math.ceil(e/4);return s._152.sizeToSquarishShape(n)}function m(t,e){return[Math.max(1,Math.ceil(e/2)),Math.max(1,Math.ceil(t/2))]}function v(t,e){const n=t;let r,i,o,a,l,u,c,h,d,p;return 2===Object(s._127)().getNumber("WEBGL_VERSION")?(r=n.R32F,i=n.R16F,o=n.RGBA16F,a=n.RGBA32F,l=n.RED,c=4,h=1,d=n.HALF_FLOAT,p=n.FLOAT,u=n.RGBA8):(r=t.RGBA,i=t.RGBA,o=t.RGBA,a=n.RGBA,l=t.RGBA,c=4,h=4,d=null!=e?e.HALF_FLOAT_OES:null,p=t.FLOAT,u=t.RGBA),{internalFormatFloat:r,internalFormatHalfFloat:i,internalFormatPackedHalfFloat:o,internalFormatPackedFloat:a,textureFormatFloat:l,downloadTextureFormat:u,downloadUnpackNumChannels:c,defaultNumChannels:h,textureTypeHalfFloat:d,textureTypeFloat:p}}
  5160. /**
  5161. * @license
  5162. * Copyright 2017 Google LLC. All Rights Reserved.
  5163. * Licensed under the Apache License, Version 2.0 (the "License");
  5164. * you may not use this file except in compliance with the License.
  5165. * You may obtain a copy of the License at
  5166. *
  5167. * http://www.apache.org/licenses/LICENSE-2.0
  5168. *
  5169. * Unless required by applicable law or agreed to in writing, software
  5170. * distributed under the License is distributed on an "AS IS" BASIS,
  5171. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5172. * See the License for the specific language governing permissions and
  5173. * limitations under the License.
  5174. * =============================================================================
  5175. */function b(t,e){const n=e();return Object(s._127)().getBool("DEBUG")&&function(t){const e=t.getError();if(e!==t.NO_ERROR)throw new Error("WebGL Error: "+x(t,e))}(t),n}!function(t){t[t.DENSE=0]="DENSE",t[t.SHARED_BATCH=1]="SHARED_BATCH"}(h||(h={})),function(t){t[t.RENDER=0]="RENDER",t[t.UPLOAD=1]="UPLOAD",t[t.PIXELS=2]="PIXELS",t[t.DOWNLOAD=3]="DOWNLOAD"}(d||(d={})),function(t){t[t.UNPACKED_FLOAT16=0]="UNPACKED_FLOAT16",t[t.UNPACKED_FLOAT32=1]="UNPACKED_FLOAT32",t[t.PACKED_4X1_UNSIGNED_BYTE=2]="PACKED_4X1_UNSIGNED_BYTE",t[t.PACKED_2X2_FLOAT32=3]="PACKED_2X2_FLOAT32",t[t.PACKED_2X2_FLOAT16=4]="PACKED_2X2_FLOAT16"}(p||(p={}));const _=5.96e-8,y=65504;function T(t){return!!(Object(s._127)().getBool("WEBGL_RENDER_FLOAT32_ENABLED")||0===t||_<Math.abs(t)&&Math.abs(t)<y)}function x(t,e){switch(e){case t.NO_ERROR:return"NO_ERROR";case t.INVALID_ENUM:return"INVALID_ENUM";case t.INVALID_VALUE:return"INVALID_VALUE";case t.INVALID_OPERATION:return"INVALID_OPERATION";case t.INVALID_FRAMEBUFFER_OPERATION:return"INVALID_FRAMEBUFFER_OPERATION";case t.OUT_OF_MEMORY:return"OUT_OF_MEMORY";case t.CONTEXT_LOST_WEBGL:return"CONTEXT_LOST_WEBGL";default:return`Unknown error code ${e}`}}function E(t,e){return X(t,()=>t.getExtension(e),'Extension "'+e+'" not supported on this browser.')}function w(t,e){const n=X(t,()=>t.createShader(t.VERTEX_SHADER),"Unable to create vertex WebGLShader.");if(b(t,()=>t.shaderSource(n,e)),b(t,()=>t.compileShader(n)),!1===t.getShaderParameter(n,t.COMPILE_STATUS))throw console.log(t.getShaderInfoLog(n)),new Error("Failed to compile vertex shader.");return n}function C(t,e){const n=X(t,()=>t.createShader(t.FRAGMENT_SHADER),"Unable to create fragment WebGLShader.");if(b(t,()=>t.shaderSource(n,e)),b(t,()=>t.compileShader(n)),!1===t.getShaderParameter(n,t.COMPILE_STATUS))throw function(t,e){const n=S.exec(e);if(null==n)return console.log(`Couldn't parse line number in error: ${e}`),void console.log(t);const r=+n[1],i=t.split("\n"),o=i.length.toString().length+2,a=i.map((t,e)=>s._152.rightPad((e+1).toString(),o)+t);let l=0;for(let t=0;t<a.length;t++)l=Math.max(a[t].length,l);const u=a.slice(0,r-1),c=a.slice(r-1,r),h=a.slice(r);console.log(u.join("\n")),console.log(e.split("\n")[0]),console.log(`%c ${s._152.rightPad(c[0],l)}`,"border:1px solid red; background-color:#e3d2d2; color:#a61717"),console.log(h.join("\n"))}(e,t.getShaderInfoLog(n)),new Error("Failed to compile fragment shader.");return n}const S=/ERROR: [0-9]+:([0-9]+):/g;function k(t){return X(t,()=>t.createProgram(),"Unable to create WebGLProgram.")}function O(t,e){if(b(t,()=>t.linkProgram(e)),!1===t.getProgramParameter(e,t.LINK_STATUS))throw console.log(t.getProgramInfoLog(e)),new Error("Failed to link vertex and fragment shaders.")}function I(t,e){if(b(t,()=>t.validateProgram(e)),!1===t.getProgramParameter(e,t.VALIDATE_STATUS))throw console.log(t.getProgramInfoLog(e)),new Error("Shader program validation failed.")}function R(t,e){const n=X(t,()=>t.createBuffer(),"Unable to create WebGLBuffer");return b(t,()=>t.bindBuffer(t.ARRAY_BUFFER,n)),b(t,()=>t.bufferData(t.ARRAY_BUFFER,e,t.STATIC_DRAW)),n}function A(t,e){const n=X(t,()=>t.createBuffer(),"Unable to create WebGLBuffer");return b(t,()=>t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,n)),b(t,()=>t.bufferData(t.ELEMENT_ARRAY_BUFFER,e,t.STATIC_DRAW)),n}function N(){return 2===Object(s._127)().getNumber("WEBGL_VERSION")?1:4}function D(t){return X(t,()=>t.createTexture(),"Unable to create WebGLTexture.")}function M(t,e){const n=Object(s._127)().getNumber("WEBGL_MAX_TEXTURE_SIZE");if(t<=0||e<=0){const n=`[${t}x${e}]`;throw new Error("Requested texture size "+n+" is invalid.")}if(t>n||e>n){const r=`[${t}x${e}]`,i=`[${n}x${n}]`;throw new Error("Requested texture size "+r+" greater than WebGL maximum on this browser / GPU "+i+".")}}function L(t){return X(t,()=>t.createFramebuffer(),"Unable to create WebGLFramebuffer.")}function P(t,e,n,r,i,o,s){const a=t.getAttribLocation(e,n);return-1!==a&&(b(t,()=>t.bindBuffer(t.ARRAY_BUFFER,r)),b(t,()=>t.vertexAttribPointer(a,i,t.FLOAT,!1,o,s)),b(t,()=>t.enableVertexAttribArray(a)),!0)}function F(t,e,n){K(t,n),b(t,()=>t.activeTexture(t.TEXTURE0+n)),b(t,()=>t.bindTexture(t.TEXTURE_2D,e))}function B(t,e){K(t,e),b(t,()=>t.activeTexture(t.TEXTURE0+e)),b(t,()=>t.bindTexture(t.TEXTURE_2D,null))}function j(t,e,n){return X(t,()=>t.getUniformLocation(e,n),'uniform "'+n+'" not present in program.')}function $(t,e,n){return t.getUniformLocation(e,n)}function U(t,e,n,r){b(t,()=>F(t,e,r)),b(t,()=>t.uniform1i(n,r))}function V(t){b(t,()=>t.bindFramebuffer(t.FRAMEBUFFER,null)),b(t,()=>t.viewport(0,0,t.canvas.width,t.canvas.height)),b(t,()=>t.scissor(0,0,t.canvas.width,t.canvas.height))}function H(t,e,n){b(t,()=>t.bindFramebuffer(t.FRAMEBUFFER,n)),b(t,()=>t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,e,0))}function W(t,e){b(t,()=>t.bindFramebuffer(t.FRAMEBUFFER,e)),b(t,()=>t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,null,0))}function G(t){const e=t.checkFramebufferStatus(t.FRAMEBUFFER);if(e!==t.FRAMEBUFFER_COMPLETE)throw new Error("Error binding framebuffer: "+z(t,e))}function z(t,e){switch(e){case t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT:return"FRAMEBUFFER_INCOMPLETE_ATTACHMENT";case t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:return"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT";case t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS:return"FRAMEBUFFER_INCOMPLETE_DIMENSIONS";case t.FRAMEBUFFER_UNSUPPORTED:return"FRAMEBUFFER_UNSUPPORTED";default:return`unknown error ${e}`}}function X(t,e,n){const r=b(t,()=>e());if(null==r)throw new Error(n);return r}function K(t,e){const n=t.MAX_COMBINED_TEXTURE_IMAGE_UNITS-1,r=e+t.TEXTURE0;if(r<t.TEXTURE0||r>n){const t=`[gl.TEXTURE0, gl.TEXTURE${n}]`;throw new Error(`textureUnit must be in ${t}.`)}}function Y(t,e=2){return s._152.sizeFromShape(t.slice(0,t.length-e))}function q(t){if(0===t.length)throw Error("Cannot get rows and columns of an empty shape array.");return[t.length>1?t[t.length-2]:1,t[t.length-1]]}function J(t){let e=[1,1,1];return 0===t.length||1===t.length&&1===t[0]||(e=[Y(t),...q(t)]),e}function Z(t,e=!1){let n=Object(s._127)().getNumber("WEBGL_MAX_TEXTURE_SIZE");if(e&&(n*=2,1===(t=t.map((e,n)=>n>=t.length-2?s._152.nearestLargerEven(t[n]):t[n])).length&&(t=[2,t[0]])),2!==t.length){const e=s._152.squeezeShape(t);t=e.newShape}let r=s._152.sizeFromShape(t);if(t.length<=1&&r<=n)return[1,r];if(2===t.length&&t[0]<=n&&t[1]<=n)return t;if(3===t.length&&t[0]*t[1]<=n&&t[2]<=n)return[t[0]*t[1],t[2]];if(3===t.length&&t[0]<=n&&t[1]*t[2]<=n)return[t[0],t[1]*t[2]];if(4===t.length&&t[0]*t[1]*t[2]<=n&&t[3]<=n)return[t[0]*t[1]*t[2],t[3]];if(4===t.length&&t[0]<=n&&t[1]*t[2]*t[3]<=n)return[t[0],t[1]*t[2]*t[3]];if(e){const e=Y(t);let n=2,i=2;return t.length&&([n,i]=q(t)),r=e*(n/2)*(i/2),s._152.sizeToSquarishShape(r).map(t=>2*t)}return s._152.sizeToSquarishShape(r)}function Q(t){return t%2==0}function tt(t,e){if(t=t.slice(-2),e=e.slice(-2),s._152.arraysEqual(t,e))return!0;if(!t.length||!e.length)return!0;if(0===t[0]||0===t[1]||0===e[0]||0===e[1])return!0;if(t.length!==e.length){const n=t.slice(-1)[0],r=e.slice(-1)[0];if(n===r)return!0;if(Q(n)&&Q(r)&&(1===t[0]||1===e[0]))return!0}return t[1]===e[1]&&Q(t[0])&&Q(e[0])}let et,nt;function rt(t){if(null==et){const e=c(t);et=e.getParameter(e.MAX_TEXTURE_SIZE)}return et}function it(){et=null}function ot(){nt=null}function st(t){if(null==nt){const e=c(t);nt=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)}return Math.min(16,nt)}function at(t){if(0===t)return 0;let e;const n=c(t);return e=lt(n,"EXT_disjoint_timer_query_webgl2")&&2===t?2:lt(n,"EXT_disjoint_timer_query")?1:0}function lt(t,e){return null!=t.getExtension(e)}function ut(t){try{if(null!=c(t))return!0}catch(t){return console.log("Error when getting WebGL context: ",t),!1}return!1}function ct(t){if(0===t)return!1;const e=c(t);if(1===t){if(!lt(e,"OES_texture_float"))return!1}else if(!lt(e,"EXT_color_buffer_float"))return!1;return dt(e)}function ht(t){if(0===t)return!1;const e=c(t);if(1!==t){if(lt(e,"EXT_color_buffer_float"))return dt(e);const t="EXT_color_buffer_half_float";if(lt(e,t)){return function(t,e){const n=v(t,e),r=t.createTexture();t.bindTexture(t.TEXTURE_2D,r);t.texImage2D(t.TEXTURE_2D,0,n.internalFormatHalfFloat,1,1,0,n.textureFormatFloat,n.textureTypeHalfFloat,null);const i=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,i),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,r,0);const o=t.checkFramebufferStatus(t.FRAMEBUFFER)===t.FRAMEBUFFER_COMPLETE;return t.bindTexture(t.TEXTURE_2D,null),t.bindFramebuffer(t.FRAMEBUFFER,null),t.deleteTexture(r),t.deleteFramebuffer(i),o}(e,e.getExtension(t))}return!1}return!!lt(e,"OES_texture_float")&&(!!lt(e,"WEBGL_color_buffer_float")&&dt(e))}function dt(t){const e=v(t),n=t.createTexture();t.bindTexture(t.TEXTURE_2D,n);t.texImage2D(t.TEXTURE_2D,0,e.internalFormatFloat,1,1,0,e.textureFormatFloat,e.textureTypeFloat,null);const r=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,r),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,n,0);const i=t.checkFramebufferStatus(t.FRAMEBUFFER)===t.FRAMEBUFFER_COMPLETE;return t.bindTexture(t.TEXTURE_2D,null),t.bindFramebuffer(t.FRAMEBUFFER,null),t.deleteTexture(n),t.deleteFramebuffer(r),i}function pt(t){if(2!==t)return!1;return null!=c(t).fenceSync}function ft(t,e){Array.isArray(t)||(t=[t]),t.forEach(t=>{null!=t&&s._152.assert("complex64"!==t.dtype,()=>`${e} does not support complex64 tensors `+"in the WebGL backend.")})}
  5176. /**
  5177. * @license
  5178. * Copyright 2019 Google LLC. All Rights Reserved.
  5179. * Licensed under the Apache License, Version 2.0 (the "License");
  5180. * you may not use this file except in compliance with the License.
  5181. * You may obtain a copy of the License at
  5182. *
  5183. * http://www.apache.org/licenses/LICENSE-2.0
  5184. *
  5185. * Unless required by applicable law or agreed to in writing, software
  5186. * distributed under the License is distributed on an "AS IS" BASIS,
  5187. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5188. * See the License for the specific language governing permissions and
  5189. * limitations under the License.
  5190. * =============================================================================
  5191. */const gt=Object(s._127)();
  5192. /**
  5193. * @license
  5194. * Copyright 2018 Google LLC. All Rights Reserved.
  5195. * Licensed under the Apache License, Version 2.0 (the "License");
  5196. * you may not use this file except in compliance with the License.
  5197. * You may obtain a copy of the License at
  5198. *
  5199. * http://www.apache.org/licenses/LICENSE-2.0
  5200. *
  5201. * Unless required by applicable law or agreed to in writing, software
  5202. * distributed under the License is distributed on an "AS IS" BASIS,
  5203. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5204. * See the License for the specific language governing permissions and
  5205. * limitations under the License.
  5206. * =============================================================================
  5207. */
  5208. function mt(){let t,e,n,r,i,o,a,l,u,c;return 2===Object(s._127)().getNumber("WEBGL_VERSION")?(t="#version 300 es",e="in",n="out",r="in",i="texture",o="outputColor",a="out vec4 outputColor;",l="\n bool isnan_custom(float val) {\n uint floatToUint = floatBitsToUint(val);\n return (floatToUint & 0x7fffffffu) > 0x7f800000u;\n }\n\n bvec4 isnan_custom(vec4 val) {\n return bvec4(isnan_custom(val.x),\n isnan_custom(val.y), isnan_custom(val.z), isnan_custom(val.w));\n }\n\n #define isnan(value) isnan_custom(value)\n ",u="",c="\n #define round(value) newRound(value)\n int newRound(float value) {\n return int(floor(value + 0.5));\n }\n\n ivec4 newRound(vec4 value) {\n return ivec4(floor(value + vec4(0.5)));\n }\n "):(t="",e="attribute",n="varying",r="varying",i="texture2D",o="gl_FragColor",a="",l="\n #define isnan(value) isnan_custom(value)\n bool isnan_custom(float val) {\n return (val > 0. || val < 1. || val == 0.) ? false : true;\n }\n bvec4 isnan_custom(vec4 val) {\n return bvec4(isnan(val.x), isnan(val.y), isnan(val.z), isnan(val.w));\n }\n ",u="\n uniform float INFINITY;\n\n bool isinf(float val) {\n return abs(val) == INFINITY;\n }\n bvec4 isinf(vec4 val) {\n return equal(abs(val), vec4(INFINITY));\n }\n ",c="\n int round(float value) {\n return int(floor(value + 0.5));\n }\n\n ivec4 round(vec4 value) {\n return ivec4(floor(value + vec4(0.5)));\n }\n "),{version:t,attribute:e,varyingVs:n,varyingFs:r,texture2D:i,output:o,defineOutput:a,defineSpecialNaN:l,defineSpecialInf:u,defineRound:c}}
  5209. /**
  5210. * @license
  5211. * Copyright 2018 Google LLC. All Rights Reserved.
  5212. * Licensed under the Apache License, Version 2.0 (the "License");
  5213. * you may not use this file except in compliance with the License.
  5214. * You may obtain a copy of the License at
  5215. *
  5216. * http://www.apache.org/licenses/LICENSE-2.0
  5217. *
  5218. * Unless required by applicable law or agreed to in writing, software
  5219. * distributed under the License is distributed on an "AS IS" BASIS,
  5220. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5221. * See the License for the specific language governing permissions and
  5222. * limitations under the License.
  5223. * =============================================================================
  5224. */function vt(t,e,n="index"){const r=s._152.computeStrides(e);return r.map((e,i)=>{return`${`int ${t[i]} = ${n} / ${e}`}; ${i===r.length-1?`int ${t[i+1]} = ${n} - ${t[i]} * ${e}`:`index -= ${t[i]} * ${e}`};`}).join("")}function bt(t,e,n="index"){const r=s._152.computeStrides(e);return r.map((e,i)=>{return`${`int ${t[i]} = ${n} / outShapeStrides[${i}]`}; ${i===r.length-1?`int ${t[i+1]} = ${n} - ${t[i]} * outShapeStrides[${i}]`:`index -= ${t[i]} * outShapeStrides[${i}]`};`}).join("")}function _t(t,e,n="index"){const r=function(t,e){const n=t.length,r=t.map(t=>`${e}[${t}]`),i=new Array(n-1);i[n-2]=r[n-1];for(let t=n-3;t>=0;--t)i[t]=`(${i[t+1]} * ${r[t+1]})`;return i}(t.map((t,e)=>e),e);return r.map((e,i)=>{return`${`int ${t[i]} = ${n} / ${r[i]}`}; ${i===r.length-1?`int ${t[i+1]} = ${n} - ${t[i]} * ${r[i]}`:`index -= ${t[i]} * ${r[i]}`};`}).join("")}function yt(t){const e=s._152.computeStrides(t).map(t=>t.toString());return`\n int getFlatIndex(ivec3 coords) {\n return coords.x * ${e[0]} + coords.y * ${e[1]} + coords.z;\n }\n`}gt.registerFlag("HAS_WEBGL",()=>gt.getNumber("WEBGL_VERSION")>0),gt.registerFlag("WEBGL_VERSION",()=>ut(2)?2:ut(1)?1:0),gt.registerFlag("WEBGL_CHECK_NUMERICAL_PROBLEMS",()=>!1),gt.registerFlag("WEBGL_BUFFER_SUPPORTED",()=>2===gt.get("WEBGL_VERSION")),gt.registerFlag("WEBGL_CPU_FORWARD",()=>!0),gt.registerFlag("WEBGL_FORCE_F16_TEXTURES",()=>!1),gt.registerFlag("WEBGL_PACK",()=>gt.getBool("HAS_WEBGL")),gt.registerFlag("WEBGL_PACK_NORMALIZATION",()=>gt.getBool("WEBGL_PACK")),gt.registerFlag("WEBGL_PACK_CLIP",()=>gt.getBool("WEBGL_PACK")),gt.registerFlag("WEBGL_PACK_DEPTHWISECONV",()=>gt.getBool("WEBGL_PACK")),gt.registerFlag("WEBGL_PACK_BINARY_OPERATIONS",()=>gt.getBool("WEBGL_PACK")),gt.registerFlag("WEBGL_PACK_UNARY_OPERATIONS",()=>gt.getBool("WEBGL_PACK")),gt.registerFlag("WEBGL_PACK_ARRAY_OPERATIONS",()=>gt.getBool("WEBGL_PACK")),gt.registerFlag("WEBGL_PACK_IMAGE_OPERATIONS",()=>gt.getBool("WEBGL_PACK")),gt.registerFlag("WEBGL_PACK_REDUCE",()=>gt.getBool("WEBGL_PACK")),gt.registerFlag("WEBGL_LAZILY_UNPACK",()=>gt.getBool("WEBGL_PACK")),gt.registerFlag("WEBGL_CONV_IM2COL",()=>gt.getBool("WEBGL_PACK")),gt.registerFlag("WEBGL_MAX_TEXTURE_SIZE",()=>rt(gt.getNumber("WEBGL_VERSION"))),gt.registerFlag("WEBGL_MAX_TEXTURES_IN_SHADER",()=>st(gt.getNumber("WEBGL_VERSION"))),gt.registerFlag("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION",()=>{const t=gt.getNumber("WEBGL_VERSION");return 0===t?0:at(t)}),gt.registerFlag("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE",()=>gt.getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0&&!s._123.isMobile()),gt.registerFlag("WEBGL_RENDER_FLOAT32_CAPABLE",()=>ct(gt.getNumber("WEBGL_VERSION"))),gt.registerFlag("WEBGL_RENDER_FLOAT32_ENABLED",()=>!gt.getBool("WEBGL_FORCE_F16_TEXTURES")&&gt.getBool("WEBGL_RENDER_FLOAT32_CAPABLE")),gt.registerFlag("WEBGL_DOWNLOAD_FLOAT_ENABLED",()=>ht(gt.getNumber("WEBGL_VERSION"))),gt.registerFlag("WEBGL_FENCE_API_ENABLED",()=>pt(gt.getNumber("WEBGL_VERSION"))),gt.registerFlag("WEBGL_SIZE_UPLOAD_UNIFORM",()=>{return gt.getBool("WEBGL_RENDER_FLOAT32_ENABLED")?4:0}),gt.registerFlag("WEBGL_DELETE_TEXTURE_THRESHOLD",()=>-1,t=>{if(t<0&&-1!==t)throw new Error("WEBGL_DELETE_TEXTURE_THRESHOLD must be -1 (indicating never "+`delete) or at least 0, but got ${t}.`)}),gt.registerFlag("WEBGL_FLUSH_THRESHOLD",()=>s._123.isMobile()?1:-1,t=>{if(t<0&&-1!==t)throw new Error("WEBGL_FLUSH_THRESHOLD must be -1 (indicating never "+`manual flush) or at least 0, but got ${t}.`)}),gt.registerFlag("CPU_HANDOFF_SIZE_THRESHOLD",()=>128),gt.registerFlag("WEBGL_USE_SHAPES_UNIFORMS",()=>!1),gt.registerFlag("TOPK_LAST_DIM_CPU_HANDOFF_SIZE_THRESHOLD",()=>1e5),gt.registerFlag("TOPK_K_CPU_HANDOFF_THRESHOLD",()=>128);const Tt="\n const float FLOAT_MAX = 1.70141184e38;\n const float FLOAT_MIN = 1.17549435e-38;\n\n lowp vec4 encode_float(highp float v) {\n if (isnan(v)) {\n return vec4(255, 255, 255, 255);\n }\n\n highp float av = abs(v);\n\n if(av < FLOAT_MIN) {\n return vec4(0.0, 0.0, 0.0, 0.0);\n } else if(v > FLOAT_MAX) {\n return vec4(0.0, 0.0, 128.0, 127.0) / 255.0;\n } else if(v < -FLOAT_MAX) {\n return vec4(0.0, 0.0, 128.0, 255.0) / 255.0;\n }\n\n highp vec4 c = vec4(0,0,0,0);\n\n highp float e = floor(log2(av));\n highp float m = exp2(fract(log2(av))) - 1.0;\n\n c[2] = floor(128.0 * m);\n m -= c[2] / 128.0;\n c[1] = floor(32768.0 * m);\n m -= c[1] / 32768.0;\n c[0] = floor(8388608.0 * m);\n\n highp float ebias = e + 127.0;\n c[3] = floor(ebias / 2.0);\n ebias -= c[3] * 2.0;\n c[2] += floor(ebias) * 128.0;\n\n c[3] += 128.0 * step(0.0, -v);\n\n return c / 255.0;\n }\n",{getBroadcastDims:xt}=s._115;
  5225. /**
  5226. * @license
  5227. * Copyright 2017 Google LLC. All Rights Reserved.
  5228. * Licensed under the Apache License, Version 2.0 (the "License");
  5229. * you may not use this file except in compliance with the License.
  5230. * You may obtain a copy of the License at
  5231. *
  5232. * http://www.apache.org/licenses/LICENSE-2.0
  5233. *
  5234. * Unless required by applicable law or agreed to in writing, software
  5235. * distributed under the License is distributed on an "AS IS" BASIS,
  5236. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5237. * See the License for the specific language governing permissions and
  5238. * limitations under the License.
  5239. * =============================================================================
  5240. */function Et(t,e,n){const r=[];if(t.forEach(t=>{const e=s._152.sizeFromShape(t.shapeInfo.logicalShape);if(t.shapeInfo.isUniform?r.push(`uniform float ${t.name}${e>1?`[${e}]`:""};`):(r.push(`uniform sampler2D ${t.name};`),r.push(`uniform int offset${t.name};`)),n.enableShapeUniforms){const{uniformShape:e}=Mt(n.packedInputs,t.shapeInfo.logicalShape,t.shapeInfo.texShape);switch(e.length){case 1:r.push(`uniform int ${t.name}Shape;`);break;case 2:r.push(`uniform ivec2 ${t.name}Shape;`);break;case 3:r.push(`uniform ivec3 ${t.name}Shape;`);break;case 4:r.push(`uniform ivec4 ${t.name}Shape;`)}r.push(`uniform ivec2 ${t.name}TexShape;`)}}),n.enableShapeUniforms){switch(e.logicalShape.length){case 1:r.push("uniform int outShape;");break;case 2:r.push("uniform ivec2 outShape;"),r.push("uniform int outShapeStrides;");break;case 3:r.push("uniform ivec3 outShape;"),r.push("uniform ivec2 outShapeStrides;");break;case 4:r.push("uniform ivec4 outShape;"),r.push("uniform ivec3 outShapeStrides;")}r.push("uniform ivec2 outTexShape;")}n.customUniforms&&n.customUniforms.forEach(t=>{r.push(`uniform ${t.type} ${t.name}${t.arrayIndex?`[${t.arrayIndex}]`:""};`)});const i=r.join("\n"),o=t.map(t=>(function(t,e,n=!1,r){let i="";i+=n?Ct(t,r):wt(t,r);const o=t.shapeInfo.logicalShape,a=e.logicalShape;o.length<=a.length&&(i+=n?function(t,e){const n=t.name,r=n.charAt(0).toUpperCase()+n.slice(1),i="get"+r+"AtOutCoords",o=t.shapeInfo.logicalShape.length,a=e.logicalShape.length,l=xt(t.shapeInfo.logicalShape,e.logicalShape),u=Dt(a),c=a-o;let h;const d=["x","y","z","w","u","v"];h=0===o?"":a<2&&l.length>=1?"coords = 0;":l.map(t=>`coords.${d[t+c]} = 0;`).join("\n");let p="";p=a<2&&o>0?"coords":t.shapeInfo.logicalShape.map((t,e)=>`coords.${d[e+c]}`).join(", ");let f="return outputValue;";const g=1===s._152.sizeFromShape(t.shapeInfo.logicalShape),m=1===s._152.sizeFromShape(e.logicalShape);if(1!==o||g||m){if(g&&!m)f=1===a?"\n return vec4(outputValue.x, outputValue.x, 0., 0.);\n ":"\n return vec4(outputValue.x);\n ";else if(l.length){const t=o-2,e=o-1;l.indexOf(t)>-1&&l.indexOf(e)>-1?f="return vec4(outputValue.x);":l.indexOf(t)>-1?f="return vec4(outputValue.x, outputValue.y, outputValue.x, outputValue.y);":l.indexOf(e)>-1&&(f="return vec4(outputValue.xx, outputValue.zz);")}}else f="\n return vec4(outputValue.xy, outputValue.xy);\n ";return`\n vec4 ${i}() {\n ${u} coords = getOutputCoords();\n ${h}\n vec4 outputValue = get${r}(${p});\n ${f}\n }\n `}(t,e):function(t,e){const n=t.name,r=n.charAt(0).toUpperCase()+n.slice(1),i="get"+r+"AtOutCoords",o=e.texShape,a=t.shapeInfo.texShape,l=t.shapeInfo.logicalShape.length,u=e.logicalShape.length;if(!t.shapeInfo.isUniform&&l===u&&null==t.shapeInfo.flatOffset&&s._152.arraysEqual(a,o))return`\n float ${i}() {\n return sampleTexture(${n}, resultUV);\n }\n `;const c=Dt(u),h=xt(t.shapeInfo.logicalShape,e.logicalShape),d=u-l;let p;const f=["x","y","z","w","u","v"];p=0===l?"":u<2&&h.length>=1?"coords = 0;":h.map(t=>`coords.${f[t+d]} = 0;`).join("\n");let g="";g=u<2&&l>0?"coords":t.shapeInfo.logicalShape.map((t,e)=>`coords.${f[e+d]}`).join(", ");return`\n float ${i}() {\n ${c} coords = getOutputCoords();\n ${p}\n return get${r}(${g});\n }\n `}(t,e));return i})(t,e,n.packedInputs,n.enableShapeUniforms)).join("\n"),a=e.texShape,l=mt(),u=function(t){return`\n float sampleTexture(sampler2D textureSampler, vec2 uv) {\n return ${t.texture2D}(textureSampler, uv).r;\n }\n `}(l);let c,h,d=function(t){return`${t.version}\n precision highp float;\n precision highp int;\n precision highp sampler2D;\n ${t.varyingFs} vec2 resultUV;\n ${t.defineOutput}\n const vec2 halfCR = vec2(0.5, 0.5);\n\n struct ivec5\n {\n int x;\n int y;\n int z;\n int w;\n int u;\n };\n\n struct ivec6\n {\n int x;\n int y;\n int z;\n int w;\n int u;\n int v;\n };\n\n uniform float NAN;\n ${t.defineSpecialNaN}\n ${t.defineSpecialInf}\n ${t.defineRound}\n\n int imod(int x, int y) {\n return x - y * (x / y);\n }\n\n int idiv(int a, int b, float sign) {\n int res = a / b;\n int mod = imod(a, b);\n if (sign < 0. && mod != 0) {\n res -= 1;\n }\n return res;\n }\n\n //Based on the work of Dave Hoskins\n //https://www.shadertoy.com/view/4djSRW\n #define HASHSCALE1 443.8975\n float random(float seed){\n vec2 p = resultUV * seed;\n vec3 p3 = fract(vec3(p.xyx) * HASHSCALE1);\n p3 += dot(p3, p3.yzx + 19.19);\n return fract((p3.x + p3.y) * p3.z);\n }\n\n ${St}\n ${kt}\n ${Ot}\n `}(l);return e.isPacked?(c=function(t,e,n){switch(t.length){case 0:return Rt();case 1:return function(t,e,n){const r=[Math.ceil(e[0]/2),Math.ceil(e[1]/2)];if(1===r[0])return n?"\n int getOutputCoords() {\n return 2 * int(resultUV.x * ceil(float(outTexShape[1]) / 2.0));\n }\n ":`\n int getOutputCoords() {\n return 2 * int(resultUV.x * ${r[1]}.0);\n }\n `;if(1===r[1])return n?"\n int getOutputCoords() {\n return 2 * int(resultUV.y * ceil(float(outTexShape[0]) / 2.0));\n }\n ":`\n int getOutputCoords() {\n return 2 * int(resultUV.y * ${r[0]}.0);\n }\n `;if(n)return"\n int getOutputCoords() {\n ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0));\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(packedTexShape[0], packedTexShape[1]));\n return 2 * (resTexRC.x * packedTexShape[1] + resTexRC.y);\n }\n ";return`\n int getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(${r[0]}, ${r[1]}));\n return 2 * (resTexRC.x * ${r[1]} + resTexRC.y);\n }\n `}(0,e,n);case 2:return function(t,e,n){const r=[Math.ceil(e[0]/2),Math.ceil(e[1]/2)];if(s._152.arraysEqual(t,e))return n?"\n ivec2 getOutputCoords() {\n ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0));\n return 2 * ivec2(resultUV.yx * vec2(packedTexShape[0], packedTexShape[1]));\n }\n ":`\n ivec2 getOutputCoords() {\n return 2 * ivec2(resultUV.yx * vec2(${r[0]}, ${r[1]}));\n }\n `;const i=Math.ceil(t[1]/2);if(n)return"\n ivec2 getOutputCoords() {\n ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0));\n int texelsInLogicalRow = int(ceil(float(outShape[1]) / 2.0));\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(packedTexShape[0], packedTexShape[1]));\n\n int index = resTexRC.x * packedTexShape[1] + resTexRC.y;\n int r = 2 * (index / texelsInLogicalRow);\n int c = imod(index, texelsInLogicalRow) * 2;\n\n return ivec2(r, c);\n }\n ";return`\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(${r[0]}, ${r[1]}));\n\n int index = resTexRC.x * ${r[1]} + resTexRC.y;\n int r = 2 * (index / ${i});\n int c = imod(index, ${i}) * 2;\n\n return ivec2(r, c);\n }\n `}(t,e,n);case 3:return function(t,e,n){if(n)return"\n ivec3 getOutputCoords() {\n ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0));\n int texelsInLogicalRow = int(ceil(float(outShape[2]) / 2.0));\n int texelsInBatch = texelsInLogicalRow * int(ceil(float(outShape[1]) / 2.0));\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(packedTexShape[0], packedTexShape[1]));\n int index = resTexRC.x * packedTexShape[1] + resTexRC.y;\n\n int b = index / texelsInBatch;\n index -= b * texelsInBatch;\n\n int r = 2 * (index / texelsInLogicalRow);\n int c = imod(index, texelsInLogicalRow) * 2;\n\n return ivec3(b, r, c);\n }\n ";const r=[Math.ceil(e[0]/2),Math.ceil(e[1]/2)],i=Math.ceil(t[2]/2),o=i*Math.ceil(t[1]/2);return`\n ivec3 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(${r[0]}, ${r[1]}));\n int index = resTexRC.x * ${r[1]} + resTexRC.y;\n\n int b = index / ${o};\n index -= b * ${o};\n\n int r = 2 * (index / ${i});\n int c = imod(index, ${i}) * 2;\n\n return ivec3(b, r, c);\n }\n `}(t,e,n);default:return function(t,e,n){if(n)return"\n ivec4 getOutputCoords() {\n ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0));\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(packedTexShape[0], packedTexShape[1]));\n int index = resTexRC.x * packedTexShape[1] + resTexRC.y;\n\n int texelsInLogicalRow = int(ceil(float(outShape[3]) / 2.0));\n int texelsInBatch = texelsInLogicalRow * int(ceil(float(outShape[2]) / 2.0));\n int texelsInBatchN = texelsInBatch * outShape[1];\n\n int b2 = index / texelsInBatchN;\n index -= b2 * texelsInBatchN;\n\n int b = index / texelsInBatch;\n index -= b * texelsInBatch;\n\n int r = 2 * (index / texelsInLogicalRow);\n int c = imod(index, texelsInLogicalRow) * 2;\n\n return ivec4(b2, b, r, c);\n }\n ";const r=[Math.ceil(e[0]/2),Math.ceil(e[1]/2)],i=Math.ceil(t[t.length-1]/2),o=i*Math.ceil(t[t.length-2]/2);let s=o,a="",l="b, r, c";for(let e=2;e<t.length-1;e++)s*=t[t.length-e-1],a=`\n int b${e} = index / ${s};\n index -= b${e} * ${s};\n `+a,l=`b${e}, `+l;return`\n ivec${t.length} getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(${r[0]}, ${r[1]}));\n int index = resTexRC.x * ${r[1]} + resTexRC.y;\n\n ${a}\n\n int b = index / ${o};\n index -= b * ${o};\n\n int r = 2 * (index / ${i});\n int c = imod(index, ${i}) * 2;\n\n return ivec${t.length}(${l});\n }\n `}(t,e,n)}}(e.logicalShape,a,n.enableShapeUniforms),h=function(t){return`\n void setOutput(vec4 val) {\n ${t.output} = val;\n }\n `}(l)):(c=function(t,e,n){switch(t.length){case 0:return Rt();case 1:return function(t,e,n){if(1===e[0])return n?"\n int getOutputCoords() {\n return int(resultUV.x * float(outTexShape[1]));\n }\n ":`\n int getOutputCoords() {\n return int(resultUV.x * ${e[1]}.0);\n }\n `;if(1===e[1])return n?"\n int getOutputCoords() {\n return int(resultUV.y * float(outTexShape[0]));\n }\n ":`\n int getOutputCoords() {\n return int(resultUV.y * ${e[0]}.0);\n }\n `;if(n)return"\n int getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(outTexShape[0], outTexShape[1]));\n return resTexRC.x * outTexShape[1] + resTexRC.y;\n }\n ";return`\n int getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(${e[0]}, ${e[1]}));\n return resTexRC.x * ${e[1]} + resTexRC.y;\n }\n `}(0,e,n);case 2:return function(t,e,n){if(s._152.arraysEqual(t,e))return n?"\n ivec2 getOutputCoords() {\n return ivec2(resultUV.yx * vec2(outTexShape[0], outTexShape[1]));\n }\n ":`\n ivec2 getOutputCoords() {\n return ivec2(resultUV.yx * vec2(${e[0]}, ${e[1]}));\n }\n `;if(1===t[1])return n?"\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(outTexShape[0], outTexShape[1]));\n int index = resTexRC.x * outTexShape[1] + resTexRC.y;\n return ivec2(index, 0);\n }\n ":`\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(${e[0]}, ${e[1]}));\n int index = resTexRC.x * ${e[1]} + resTexRC.y;\n return ivec2(index, 0);\n }\n `;if(1===t[0])return n?"\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(outTexShape[0], outTexShape[1]));\n int index = resTexRC.x * outTexShape[1] + resTexRC.y;\n return ivec2(0, index);\n }\n ":`\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(${e[0]}, ${e[1]}));\n int index = resTexRC.x * ${e[1]} + resTexRC.y;\n return ivec2(0, index);\n }\n `;if(n)return"\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(outTexShape[0], outTexShape[1]));\n int index = resTexRC.x * outTexShape[1] + resTexRC.y;\n int r = index / outShape[1];\n int c = index - r * outShape[1];\n return ivec2(r, c);\n }\n ";return`\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(${e[0]}, ${e[1]}));\n int index = resTexRC.x * ${e[1]} + resTexRC.y;\n int r = index / ${t[1]};\n int c = index - r * ${t[1]};\n return ivec2(r, c);\n }\n `}(t,e,n);case 3:return function(t,e,n){if(n){const e=bt(["r","c","d"],t);return`\n ivec3 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(outTexShape[0], outTexShape[1]));\n int index = resTexRC.x * outTexShape[1] + resTexRC.y;\n ${e}\n return ivec3(r, c, d);\n }\n`}const r=vt(["r","c","d"],t);return`\n ivec3 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(${e[0]}, ${e[1]}));\n int index = resTexRC.x * ${e[1]} + resTexRC.y;\n ${r}\n return ivec3(r, c, d);\n }\n `}(t,e,n);case 4:return function(t,e,n){if(n){const e=bt(["r","c","d","d2"],t);return`\n ivec4 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(outTexShape[0], outTexShape[1]));\n int index = resTexRC.x * outTexShape[1] + resTexRC.y;\n ${e}\n return ivec4(r, c, d, d2);\n }\n `}const r=vt(["r","c","d","d2"],t);return`\n ivec4 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(${e[0]}, ${e[1]}));\n int index = resTexRC.x * ${e[1]} + resTexRC.y;\n ${r}\n return ivec4(r, c, d, d2);\n }\n `}(t,e,n);case 5:return function(t,e){const n=vt(["r","c","d","d2","d3"],t);return`\n ivec5 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx * vec2(${e[0]},\n ${e[1]}));\n\n int index = resTexRC.x * ${e[1]} + resTexRC.y;\n\n ${n}\n\n ivec5 outShape = ivec5(r, c, d, d2, d3);\n return outShape;\n }\n `}(t,e);case 6:return function(t,e){const n=vt(["r","c","d","d2","d3","d4"],t);return`\n ivec6 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(${e[0]}, ${e[1]}));\n int index = resTexRC.x * ${e[1]} + resTexRC.y;\n\n ${n}\n\n ivec6 result = ivec6(r, c, d, d2, d3, d4);\n return result;\n }\n `}(t,e);default:throw new Error(`${t.length}-D output sampling is not yet supported`)}}(e.logicalShape,a,n.enableShapeUniforms),h=function(t){return`\n void setOutput(float val) {\n ${t.output} = vec4(val, 0, 0, 0);\n }\n `}(l)),n.packedInputs&&(d+=It),[d,u,h,i,c,o,n.userCode].join("\n")}function wt(t,e=!1){const n=t.shapeInfo.logicalShape;switch(n.length){case 0:return function(t,e){const n=t.name,r="get"+n.charAt(0).toUpperCase()+n.slice(1);if(t.shapeInfo.isUniform)return`float ${r}() {return ${n};}`;const[i,o]=t.shapeInfo.texShape;if(1===i&&1===o)return`\n float ${r}() {\n return sampleTexture(${n}, halfCR);\n }\n `;const s=At(n);if(e)return`\n float ${r}() {\n vec2 uv = uvFromFlat(${n}TexShape[0], ${n}TexShape[1], ${s});\n return sampleTexture(${n}, uv);\n }\n `;const[a,l]=t.shapeInfo.texShape;return`\n float ${r}() {\n vec2 uv = uvFromFlat(${a}, ${l}, ${s});\n return sampleTexture(${n}, uv);\n }\n `}(t,e);case 1:return function(t,e){const n=t.name,r="get"+n.charAt(0).toUpperCase()+n.slice(1);if(t.shapeInfo.isUniform)return`\n float ${r}(int index) {\n ${Nt(t)}\n }\n `;const i=t.shapeInfo.texShape,o=i[0],s=i[1];if(1===s&&1===o)return`\n float ${r}(int index) {\n return sampleTexture(${n}, halfCR);\n }\n `;const a=At(n);if(1===s)return e?`\n float ${r}(int index) {\n vec2 uv = vec2(0.5, (float(index + ${a}) + 0.5) / float(${n}TexShape[0]));\n return sampleTexture(${n}, uv);\n }\n `:`\n float ${r}(int index) {\n vec2 uv = vec2(0.5, (float(index + ${a}) + 0.5) / ${o}.0);\n return sampleTexture(${n}, uv);\n }\n `;if(1===o)return e?`\n float ${r}(int index) {\n vec2 uv = vec2((float(index + ${a}) + 0.5) / float(${n}TexShape[1]), 0.5);\n return sampleTexture(${n}, uv);\n }\n `:`\n float ${r}(int index) {\n vec2 uv = vec2((float(index + ${a}) + 0.5) / ${s}.0, 0.5);\n return sampleTexture(${n}, uv);\n }\n `;if(e)return`\n float ${r}(int index) {\n vec2 uv = uvFromFlat(${n}TexShape[0], ${n}TexShape[1], index + ${a});\n return sampleTexture(${n}, uv);\n }\n `;return`\n float ${r}(int index) {\n vec2 uv = uvFromFlat(${o}, ${s}, index + ${a});\n return sampleTexture(${n}, uv);\n }\n `}(t,e);case 2:return function(t,e){const n=t.shapeInfo.logicalShape,r=t.name,i="get"+r.charAt(0).toUpperCase()+r.slice(1),o=t.shapeInfo.texShape;if(null!=o&&s._152.arraysEqual(n,o)){if(e)return`\n float ${i}(int row, int col) {\n vec2 uv = (vec2(col, row) + halfCR) / vec2(${r}TexShape[1], ${r}TexShape[0]);\n return sampleTexture(${r}, uv);\n }\n `;const t=o[0],n=o[1];return`\n float ${i}(int row, int col) {\n vec2 uv = (vec2(col, row) + halfCR) / vec2(${n}.0, ${t}.0);\n return sampleTexture(${r}, uv);\n }\n `}const{newShape:a,keptDims:l}=s._152.squeezeShape(n),u=a;if(u.length<n.length){const n=Lt(t,u),r=["row","col"];return`\n ${wt(n,e)}\n float ${i}(int row, int col) {\n return ${i}(${Pt(r,l)});\n }\n `}if(t.shapeInfo.isUniform)return`\n float ${i}(int row, int col) {\n int index = round(dot(vec2(row, col), vec2(${n[1]}, 1)));\n ${Nt(t)}\n }\n `;const c=o[0],h=o[1],d=At(r);if(1===h)return e?`\n float ${i}(int row, int col) {\n float index = dot(vec3(row, col, ${d}), vec3(${r}Shape[1], 1, 1));\n vec2 uv = vec2(0.5, (index + 0.5) / float(${r}TexShape[0]));\n return sampleTexture(${r}, uv);\n }\n `:`\n float ${i}(int row, int col) {\n float index = dot(vec3(row, col, ${d}), vec3(${n[1]}, 1, 1));\n vec2 uv = vec2(0.5, (index + 0.5) / ${c}.0);\n return sampleTexture(${r}, uv);\n }\n `;if(1===c)return e?`\n float ${i}(int row, int col) {\n float index = dot(vec3(row, col, ${d}), vec3(${r}Shape[1], 1, 1));\n vec2 uv = vec2((index + 0.5) / float(${r}TexShape[1]), 0.5);\n return sampleTexture(${r}, uv);\n }\n `:`\n float ${i}(int row, int col) {\n float index = dot(vec3(row, col, ${d}), vec3(${n[1]}, 1, 1));\n vec2 uv = vec2((index + 0.5) / ${h}.0, 0.5);\n return sampleTexture(${r}, uv);\n }\n `;if(e)return`\n float ${i}(int row, int col) {\n // Explicitly use integer operations as dot() only works on floats.\n int index = row * ${r}Shape[1] + col + ${d};\n vec2 uv = uvFromFlat(${r}TexShape[0], ${r}TexShape[1], index);\n return sampleTexture(${r}, uv);\n }\n `;return`\n float ${i}(int row, int col) {\n // Explicitly use integer operations as dot() only works on floats.\n int index = row * ${n[1]} + col + ${d};\n vec2 uv = uvFromFlat(${c}, ${h}, index);\n return sampleTexture(${r}, uv);\n }\n`}(t,e);case 3:return function(t,e){const n=t.shapeInfo.logicalShape,r=t.name,i="get"+r.charAt(0).toUpperCase()+r.slice(1),o=n[1]*n[2],a=n[2],{newShape:l,keptDims:u}=s._152.squeezeShape(n),c=l;if(c.length<n.length){const n=Lt(t,c),r=["row","col","depth"];return`\n ${wt(n,e)}\n float ${i}(int row, int col, int depth) {\n return ${i}(${Pt(r,u)});\n }\n `}if(t.shapeInfo.isUniform)return`\n float ${i}(int row, int col, int depth) {\n int index = round(dot(vec3(row, col, depth),\n vec3(${o}, ${a}, 1)));\n ${Nt(t)}\n }\n `;const h=t.shapeInfo.texShape,d=h[0],p=h[1],f=t.shapeInfo.flatOffset;if(p===o&&null==f)return e?`\n float ${i}(int row, int col, int depth) {\n int stride1 = ${r}Shape[2];\n float texR = float(row);\n float texC = dot(vec2(col, depth), vec2(stride1, 1));\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(${r}TexShape[1], ${r}TexShape[0]);\n return sampleTexture(${r}, uv);\n }\n `:`\n float ${i}(int row, int col, int depth) {\n float texR = float(row);\n float texC = dot(vec2(col, depth), vec2(${a}, 1));\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(${p}.0, ${d}.0);\n return sampleTexture(${r}, uv);\n }\n `;if(p===a&&null==f)return e?`\n float ${i}(int row, int col, int depth) {\n float texR = dot(vec2(row, col), vec2(${r}Shape[1], 1));\n float texC = float(depth);\n vec2 uv = (vec2(texC, texR) + halfCR) / vec2(${r}TexShape[1], ${r}TexShape[0]);\n return sampleTexture(${r}, uv);\n }\n `:`\n float ${i}(int row, int col, int depth) {\n float texR = dot(vec2(row, col), vec2(${n[1]}, 1));\n float texC = float(depth);\n vec2 uv = (vec2(texC, texR) + halfCR) / vec2(${p}.0, ${d}.0);\n return sampleTexture(${r}, uv);\n }\n `;const g=At(r);if(e)return`\n float ${i}(int row, int col, int depth) {\n // Explicitly use integer operations as dot() only works on floats.\n int stride0 = ${r}Shape[1] * ${r}Shape[2];\n int stride1 = ${r}Shape[2];\n int index = row * ${o} + col * ${a} + depth + ${g};\n vec2 uv = uvFromFlat(${r}TexShape[0], ${r}TexShape[1], index);\n return sampleTexture(${r}, uv);\n }\n `;return`\n float ${i}(int row, int col, int depth) {\n // Explicitly use integer operations as dot() only works on floats.\n int index = row * ${o} + col * ${a} + depth + ${g};\n vec2 uv = uvFromFlat(${d}, ${p}, index);\n return sampleTexture(${r}, uv);\n }\n `}(t,e);case 4:return function(t,e){const n=t.shapeInfo.logicalShape,r=t.name,i="get"+r.charAt(0).toUpperCase()+r.slice(1),o=n[3],a=n[2]*o,l=n[1]*a,{newShape:u,keptDims:c}=s._152.squeezeShape(n);if(u.length<n.length){const n=Lt(t,u),r=["row","col","depth","depth2"];return`\n ${wt(n,e)}\n float ${i}(int row, int col, int depth, int depth2) {\n return ${i}(${Pt(r,c)});\n }\n `}if(t.shapeInfo.isUniform)return`\n float ${i}(int row, int col, int depth, int depth2) {\n int index = round(dot(vec4(row, col, depth, depth2),\n vec4(${l}, ${a}, ${o}, 1)));\n ${Nt(t)}\n }\n `;const h=t.shapeInfo.flatOffset,d=t.shapeInfo.texShape,p=d[0],f=d[1],g=`int stride2 = ${r}Shape[3];`,m=`int stride1 = ${r}Shape[2] * stride2;`,v=`int stride0 = ${r}Shape[1] * stride1;`;if(f===l&&null==h)return e?`\n float ${i}(int row, int col, int depth, int depth2) {\n ${g}\n ${m}\n float texR = float(row);\n float texC =\n dot(vec3(col, depth, depth2),\n vec3(stride1, stride2, 1));\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(${r}TexShape[1], ${r}TexShape[0]);\n return sampleTexture(${r}, uv);\n }\n `:`\n float ${i}(int row, int col, int depth, int depth2) {\n float texR = float(row);\n float texC =\n dot(vec3(col, depth, depth2),\n vec3(${a}, ${o}, 1));\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(${f}.0, ${p}.0);\n return sampleTexture(${r}, uv);\n }\n `;if(f===o&&null==h)return e?`\n float ${i}(int row, int col, int depth, int depth2) {\n float texR = dot(vec3(row, col, depth),\n vec3(${r}Shape[1] * ${r}Shape[2], ${r}Shape[2], 1));\n float texC = float(depth2);\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(${r}TexShape[1], ${r}TexShape[0]);\n return sampleTexture(${r}, uv);\n }\n `:`\n float ${i}(int row, int col, int depth, int depth2) {\n float texR = dot(vec3(row, col, depth),\n vec3(${n[1]*n[2]}, ${n[2]}, 1));\n float texC = float(depth2);\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(${f}.0, ${p}.0);\n return sampleTexture(${r}, uv);\n }\n `;const b=At(r);if(e)return`\n float ${i}(int row, int col, int depth, int depth2) {\n // Explicitly use integer operations as dot() only works on floats.\n ${g}\n ${m}\n ${v}\n int index = row * stride0 + col * stride1 +\n depth * stride2 + depth2;\n vec2 uv = uvFromFlat(${r}TexShape[0], ${r}TexShape[1], index + ${b});\n return sampleTexture(${r}, uv);\n }\n `;return`\n float ${i}(int row, int col, int depth, int depth2) {\n // Explicitly use integer operations as dot() only works on floats.\n int index = row * ${l} + col * ${a} +\n depth * ${o} + depth2;\n vec2 uv = uvFromFlat(${p}, ${f}, index + ${b});\n return sampleTexture(${r}, uv);\n }\n `}(t,e);case 5:return function(t){const e=t.shapeInfo.logicalShape,n=t.name,r="get"+n.charAt(0).toUpperCase()+n.slice(1),i=e[4],o=e[3]*i,a=e[2]*o,l=e[1]*a,{newShape:u,keptDims:c}=s._152.squeezeShape(e);if(u.length<e.length){const e=Lt(t,u),n=["row","col","depth","depth2","depth3"];return`\n ${wt(e)}\n float ${r}(int row, int col, int depth, int depth2, int depth3) {\n return ${r}(${Pt(n,c)});\n }\n `}if(t.shapeInfo.isUniform)return`\n float ${r}(int row, int col, int depth, int depth2, int depth3) {\n float index = dot(\n vec4(row, col, depth, depth2),\n vec4(${l}, ${a}, ${o}, ${i})) +\n depth3;\n ${Nt(t)}\n }\n `;const h=t.shapeInfo.flatOffset,d=t.shapeInfo.texShape,p=d[0],f=d[1];if(f===l&&null==h)return`\n float ${r}(int row, int col, int depth, int depth2, int depth3) {\n int texR = row;\n float texC = dot(vec4(col, depth, depth2, depth3),\n vec4(${a}, ${o}, ${i}, 1));\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(${f}.0, ${p}.0);\n return sampleTexture(${n}, uv);\n }\n `;if(f===i&&null==h)return`\n float ${r}(int row, int col, int depth, int depth2, int depth3) {\n float texR = dot(\n vec4(row, col, depth, depth2),\n vec4(${e[1]*e[2]*e[3]},\n ${e[2]*e[3]}, ${e[3]}, 1));\n int texC = depth3;\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(${f}.0, ${p}.0);\n return sampleTexture(${n}, uv);\n }\n `;const g=At(n);return`\n float ${r}(int row, int col, int depth, int depth2, int depth3) {\n // Explicitly use integer operations as dot() only works on floats.\n int index = row * ${l} + col * ${a} + depth * ${o} +\n depth2 * ${i} + depth3 + ${g};\n vec2 uv = uvFromFlat(${p}, ${f}, index);\n return sampleTexture(${n}, uv);\n }\n `}(t);case 6:return function(t){const e=t.shapeInfo.logicalShape,n=t.name,r="get"+n.charAt(0).toUpperCase()+n.slice(1),{newShape:i,keptDims:o}=s._152.squeezeShape(e);if(i.length<e.length){const e=Lt(t,i),n=["row","col","depth","depth2","depth3","depth4"];return`\n ${wt(e)}\n float ${r}(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n return ${r}(${Pt(n,o)});\n }\n `}const a=e[5],l=e[4]*a,u=e[3]*l,c=e[2]*u,h=e[1]*c;if(t.shapeInfo.isUniform)return`\n float ${r}(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n int index = round(dot(\n vec4(row, col, depth, depth2),\n vec4(${h}, ${c}, ${u}, ${l})) +\n dot(\n vec2(depth3, depth4),\n vec2(${a}, 1)));\n ${Nt(t)}\n }\n `;const d=t.shapeInfo.flatOffset,p=t.shapeInfo.texShape,f=p[0],g=p[1];if(g===h&&null==d)return`\n float ${r}(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n int texR = row;\n float texC = dot(vec4(col, depth, depth2, depth3),\n vec4(${c}, ${u}, ${l}, ${a})) +\n float(depth4);\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(${g}.0, ${f}.0);\n return sampleTexture(${n}, uv);\n }\n `;if(g===a&&null==d)return`\n float ${r}(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n float texR = dot(vec4(row, col, depth, depth2),\n vec4(${e[1]*e[2]*e[3]*e[4]},\n ${e[2]*e[3]*e[4]},\n ${e[3]*e[4]},\n ${e[4]})) + float(depth3);\n int texC = depth4;\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(${g}.0, ${f}.0);\n return sampleTexture(${n}, uv);\n }\n `;const m=At(n);return`\n float ${r}(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n // Explicitly use integer operations as dot() only works on floats.\n int index = row * ${h} + col * ${c} + depth * ${u} +\n depth2 * ${l} + depth3 * ${a} + depth4 + ${m};\n vec2 uv = uvFromFlat(${f}, ${g}, index);\n return sampleTexture(${n}, uv);\n }\n `}(t);default:throw new Error(`${n.length}-D input sampling`+" is not yet supported")}}function Ct(t,e){switch(t.shapeInfo.logicalShape.length){case 0:return function(t){const e=t.name,n="get"+e.charAt(0).toUpperCase()+e.slice(1),r=mt();return`\n vec4 ${n}() {\n return ${r.texture2D}(${e}, halfCR);\n }\n `}(t);case 1:return function(t,e){const n=t.name,r="get"+n.charAt(0).toUpperCase()+n.slice(1),i=t.shapeInfo.texShape,o=mt();if(e)return`\n vec4 ${r}(int index) {\n ivec2 packedTexShape = ivec2(ceil(float(${n}TexShape[0]) / 2.0), ceil(float(${n}TexShape[1]) / 2.0));\n vec2 uv = packedUVfrom1D(\n packedTexShape[0], packedTexShape[1], index);\n return ${o.texture2D}(${n}, uv);\n }\n `;const s=[Math.ceil(i[0]/2),Math.ceil(i[1]/2)];return`\n vec4 ${r}(int index) {\n vec2 uv = packedUVfrom1D(\n ${s[0]}, ${s[1]}, index);\n return ${o.texture2D}(${n}, uv);\n }\n `}(t,e);case 2:return function(t,e){const n=t.shapeInfo.logicalShape,r=t.name,i="get"+r.charAt(0).toUpperCase()+r.slice(1),o=t.shapeInfo.texShape,a=o[0],l=o[1],u=mt();if(null!=o&&s._152.arraysEqual(n,o))return e?`\n vec4 ${i}(int row, int col) {\n vec2 uv = (vec2(col, row) + halfCR) / vec2(${r}TexShape[1], ${r}TexShape[0]);\n\n return ${u.texture2D}(${r}, uv);\n }\n `:`\n vec4 ${i}(int row, int col) {\n vec2 uv = (vec2(col, row) + halfCR) / vec2(${l}.0, ${a}.0);\n\n return ${u.texture2D}(${r}, uv);\n }\n `;if(e)return`\n vec4 ${i}(int row, int col) {\n ivec2 packedTexShape = ivec2(ceil(float(${r}TexShape[0]) / 2.0), ceil(float(${r}TexShape[1]) / 2.0));\n int valuesPerRow = int(ceil(float(${r}Shape[1]) / 2.0));\n vec2 uv = packedUVfrom2D(valuesPerRow, packedTexShape[0], packedTexShape[1], row, col);\n return ${u.texture2D}(${r}, uv);\n }\n `;const c=[Math.ceil(o[0]/2),Math.ceil(o[1]/2)],h=Math.ceil(n[1]/2);return`\n vec4 ${i}(int row, int col) {\n vec2 uv = packedUVfrom2D(${h}, ${c[0]}, ${c[1]}, row, col);\n return ${u.texture2D}(${r}, uv);\n }\n `}(t,e);case 3:return function(t,e){const n=t.shapeInfo.logicalShape,r=t.name,i="get"+r.charAt(0).toUpperCase()+r.slice(1),o=t.shapeInfo.texShape,s=[Math.ceil(o[0]/2),Math.ceil(o[1]/2)];if(1===n[0]){const r=n.slice(1),o=[1,2],s=Lt(t,r),a=["b","row","col"];return`\n ${Ct(s,e)}\n vec4 ${i}(int b, int row, int col) {\n return ${i}(${Pt(a,o)});\n }\n `}const a=mt();if(e)return`\n vec4 ${i}(int b, int row, int col) {\n ivec2 packedTexShape = ivec2(ceil(float(${r}TexShape[0]) / 2.0), ceil(float(${r}TexShape[1]) / 2.0));\n int valuesPerRow = int(ceil(float(${r}Shape[2]) / 2.0));\n int texelsInBatch = valuesPerRow * int(ceil(float(${r}Shape[1]) / 2.0));\n vec2 uv = packedUVfrom3D(\n packedTexShape[0], packedTexShape[1], texelsInBatch, valuesPerRow, b, row, col);\n return ${a.texture2D}(${r}, uv);\n }\n `;const l=s[0],u=s[1],c=Math.ceil(n[2]/2),h=c*Math.ceil(n[1]/2);return`\n vec4 ${i}(int b, int row, int col) {\n vec2 uv = packedUVfrom3D(\n ${l}, ${u}, ${h}, ${c}, b, row, col);\n return ${a.texture2D}(${r}, uv);\n }\n `}(t,e);default:return function(t,e){const n=t.name,r="get"+n.charAt(0).toUpperCase()+n.slice(1),i=mt();if(e)return`\n vec4 ${r}(int b2, int b, int row, int col) {\n int valuesPerRow = int(ceil(float(${n}Shape[3]) / 2.0));\n int texelsInBatch = valuesPerRow * int(ceil(float(${n}Shape[2]) / 2.0));\n int index = b * texelsInBatch + (row / 2) * valuesPerRow + (col / 2);\n texelsInBatch *= ${n}Shape[1];\n index = b2 * texelsInBatch + index;\n ivec2 packedTexShape = ivec2(ceil(float(${n}TexShape[0]) / 2.0), ceil(float(${n}TexShape[1]) / 2.0));\n int texR = index / packedTexShape[1];\n int texC = index - texR * packedTexShape[1];\n vec2 uv = (vec2(texC, texR) + halfCR) / vec2(packedTexShape[1], packedTexShape[0]); return ${i.texture2D}(${n}, uv);\n }\n `;const o=t.shapeInfo.logicalShape,s=o.length,a=t.shapeInfo.texShape,l=[Math.ceil(a[0]/2),Math.ceil(a[1]/2)],u=l[0],c=l[1],h=Math.ceil(o[s-1]/2);let d=h*Math.ceil(o[s-2]/2),p="int b, int row, int col",f=`b * ${d} + (row / 2) * ${h} + (col / 2)`;for(let t=2;t<s-1;t++)p=`int b${t}, `+p,d*=o[s-t-1],f=`b${t} * ${d} + `+f;return`\n vec4 ${r}(${p}) {\n int index = ${f};\n int texR = index / ${c};\n int texC = index - texR * ${c};\n vec2 uv = (vec2(texC, texR) + halfCR) / vec2(${c}, ${u});\n return ${i.texture2D}(${n}, uv);\n }\n `}(t,e)}}const St="\nvec2 uvFromFlat(int texNumR, int texNumC, int index) {\n int texR = index / texNumC;\n int texC = index - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\nvec2 packedUVfrom1D(int texNumR, int texNumC, int index) {\n int texelIndex = index / 2;\n int texR = texelIndex / texNumC;\n int texC = texelIndex - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n",kt="\nvec2 packedUVfrom2D(int texelsInLogicalRow, int texNumR,\n int texNumC, int row, int col) {\n int texelIndex = (row / 2) * texelsInLogicalRow + (col / 2);\n int texR = texelIndex / texNumC;\n int texC = texelIndex - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n",Ot="\nvec2 packedUVfrom3D(int texNumR, int texNumC,\n int texelsInBatch, int texelsInLogicalRow, int b,\n int row, int col) {\n int index = b * texelsInBatch + (row / 2) * texelsInLogicalRow + (col / 2);\n int texR = index / texNumC;\n int texC = index - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n",It="\n float getChannel(vec4 frag, vec2 innerDims) {\n vec2 modCoord = mod(innerDims, 2.);\n return modCoord.x == 0. ?\n (modCoord.y == 0. ? frag.r : frag.g) :\n (modCoord.y == 0. ? frag.b : frag.a);\n }\n float getChannel(vec4 frag, int dim) {\n float modCoord = mod(float(dim), 2.);\n return modCoord == 0. ? frag.r : frag.g;\n }\n";function Rt(){return"\n int getOutputCoords() {\n return 0;\n }\n "}function At(t){return`offset${t}`}function Nt(t){const e=t.name,n=s._152.sizeFromShape(t.shapeInfo.logicalShape);return n<2?`return ${e};`:`\n for (int i = 0; i < ${n}; i++) {\n if (i == index) {\n return ${e}[i];\n }\n }\n `}function Dt(t){if(t<=1)return"int";if(2===t)return"ivec2";if(3===t)return"ivec3";if(4===t)return"ivec4";if(5===t)return"ivec5";if(6===t)return"ivec6";throw Error(`GPU for rank ${t} is not yet supported`)}function Mt(t,e,n){const{newShape:r,keptDims:i}=s._152.squeezeShape(e),o=e.length,a=t&&3===o&&1===e[0],l=a?e.slice(1):r,u=!t&&o>1&&!s._152.arraysEqual(e,n)&&r.length<o||a;return{useSqueezeShape:u,uniformShape:u?l:e,keptDims:i}}function Lt(t,e){const n=JSON.parse(JSON.stringify(t));return n.shapeInfo.logicalShape=e,n}function Pt(t,e){return e.map(e=>t[e]).join(", ")}
  5241. /**
  5242. * @license
  5243. * Copyright 2017 Google LLC. All Rights Reserved.
  5244. * Licensed under the Apache License, Version 2.0 (the "License");
  5245. * you may not use this file except in compliance with the License.
  5246. * You may obtain a copy of the License at
  5247. *
  5248. * http://www.apache.org/licenses/LICENSE-2.0
  5249. *
  5250. * Unless required by applicable law or agreed to in writing, software
  5251. * distributed under the License is distributed on an "AS IS" BASIS,
  5252. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5253. * See the License for the specific language governing permissions and
  5254. * limitations under the License.
  5255. * =============================================================================
  5256. */function Ft(t,e){if(t.length!==e.length)throw Error(`Binary was compiled with ${t.length} inputs, but `+`was executed with ${e.length} inputs`);t.forEach((t,n)=>{const r=t.logicalShape,i=e[n],o=i.shape;if(!s._152.arraysEqual(r,o))throw Error("Binary was compiled with different shapes than "+`the current args. Shapes ${r} and ${o} must match`);if(t.isUniform&&i.isUniform)return;const a=t.texShape,l=i.isUniform?null:i.texData.texShape;if(!s._152.arraysEqual(a,l))throw Error("Binary was compiled with different texture shapes than the"+` current args. Shape ${a} and ${l} must match`)})}function Bt(t){return Object(s._127)().getBool("WEBGL_USE_SHAPES_UNIFORMS")&&t<=4}
  5257. /**
  5258. * @license
  5259. * Copyright 2019 Google LLC. All Rights Reserved.
  5260. * Licensed under the Apache License, Version 2.0 (the "License");
  5261. * you may not use this file except in compliance with the License.
  5262. * You may obtain a copy of the License at
  5263. *
  5264. * http://www.apache.org/licenses/LICENSE-2.0
  5265. *
  5266. * Unless required by applicable law or agreed to in writing, software
  5267. * distributed under the License is distributed on an "AS IS" BASIS,
  5268. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5269. * See the License for the specific language governing permissions and
  5270. * limitations under the License.
  5271. * =============================================================================
  5272. */class jt{constructor(t){this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0,this.outPackingScheme=h.DENSE,this.customUniforms=[{name:"texShape",type:"ivec2"}];const e=mt();this.outputShape=t,this.enableShapeUniforms=Bt(this.outputShape.length),this.userCode=`\n ivec3 outCoordsFromFlatIndex(int index) {\n ${this.enableShapeUniforms?bt(["r","c","d"],t):vt(["r","c","d"],t)}\n return ivec3(r, c, d);\n }\n\n void main() {\n ivec2 resTexRC = ivec2(resultUV.yx * vec2(texShape[0], texShape[1]));\n int index = 4 * (resTexRC.x * texShape[1] + resTexRC.y);\n\n vec4 result = vec4(0.);\n\n for (int i=0; i<4; i++) {\n int flatIndex = index + i;\n ivec3 rc = outCoordsFromFlatIndex(flatIndex);\n result[i] = getA(rc.x, rc.y, rc.z);\n }\n\n ${e.output} = result;\n }\n `}}
  5273. /**
  5274. * @license
  5275. * Copyright 2019 Google LLC. All Rights Reserved.
  5276. * Licensed under the Apache License, Version 2.0 (the "License");
  5277. * you may not use this file except in compliance with the License.
  5278. * You may obtain a copy of the License at
  5279. *
  5280. * http://www.apache.org/licenses/LICENSE-2.0
  5281. *
  5282. * Unless required by applicable law or agreed to in writing, software
  5283. * distributed under the License is distributed on an "AS IS" BASIS,
  5284. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5285. * See the License for the specific language governing permissions and
  5286. * limitations under the License.
  5287. * =============================================================================
  5288. */class $t{constructor(t){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outPackingScheme=h.DENSE,this.customUniforms=[{name:"texShape",type:"ivec2"}];const e=mt();this.outputShape=t,this.enableShapeUniforms=Bt(this.outputShape.length),this.userCode=`\n ivec3 outCoordsFromFlatIndex(int index) {\n ${this.enableShapeUniforms?bt(["r","c","d"],t):vt(["r","c","d"],t)}\n return ivec3(r, c, d);\n }\n\n void main() {\n ivec2 resTexRC = ivec2(resultUV.yx * vec2(texShape[0], texShape[1]));\n int index = 4 * (resTexRC.x * texShape[1] + resTexRC.y);\n\n vec4 result = vec4(0.);\n\n for (int i=0; i<4; i++) {\n int flatIndex = index + i;\n ivec3 rc = outCoordsFromFlatIndex(flatIndex);\n result[i] = getChannel(getA(rc.x, rc.y, rc.z), vec2(rc.y, rc.z));\n }\n\n ${e.output} = result;\n }\n `}}
  5289. /**
  5290. * @license
  5291. * Copyright 2018 Google LLC. All Rights Reserved.
  5292. * Licensed under the Apache License, Version 2.0 (the "License");
  5293. * you may not use this file except in compliance with the License.
  5294. * You may obtain a copy of the License at
  5295. *
  5296. * http://www.apache.org/licenses/LICENSE-2.0
  5297. *
  5298. * Unless required by applicable law or agreed to in writing, software
  5299. * distributed under the License is distributed on an "AS IS" BASIS,
  5300. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5301. * See the License for the specific language governing permissions and
  5302. * limitations under the License.
  5303. * =============================================================================
  5304. */class Ut{constructor(t){this.variableNames=["A"],this.outTexUsage=d.DOWNLOAD;const e=mt();this.outputShape=t,this.userCode=`\n ${Tt}\n\n void main() {\n float x = getAAtOutCoords();\n ${e.output} = encode_float(x);\n }\n `}}
  5305. /**
  5306. * @license
  5307. * Copyright 2018 Google LLC. All Rights Reserved.
  5308. * Licensed under the Apache License, Version 2.0 (the "License");
  5309. * you may not use this file except in compliance with the License.
  5310. * You may obtain a copy of the License at
  5311. *
  5312. * http://www.apache.org/licenses/LICENSE-2.0
  5313. *
  5314. * Unless required by applicable law or agreed to in writing, software
  5315. * distributed under the License is distributed on an "AS IS" BASIS,
  5316. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5317. * See the License for the specific language governing permissions and
  5318. * limitations under the License.
  5319. * =============================================================================
  5320. */class Vt{constructor(t){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!1,this.outTexUsage=d.DOWNLOAD;const e=mt();this.outputShape=t,this.userCode=`\n ${Tt}\n\n void main() {\n ivec3 coords = getOutputCoords();\n float x = getChannel(getAAtOutCoords(), vec2(coords.y, coords.z));\n ${e.output} = encode_float(x);\n }\n `}}
  5321. /**
  5322. * @license
  5323. * Copyright 2018 Google LLC. All Rights Reserved.
  5324. * Licensed under the Apache License, Version 2.0 (the "License");
  5325. * you may not use this file except in compliance with the License.
  5326. * You may obtain a copy of the License at
  5327. *
  5328. * http://www.apache.org/licenses/LICENSE-2.0
  5329. *
  5330. * Unless required by applicable law or agreed to in writing, software
  5331. * distributed under the License is distributed on an "AS IS" BASIS,
  5332. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5333. * See the License for the specific language governing permissions and
  5334. * limitations under the License.
  5335. * =============================================================================
  5336. */class Ht{constructor(t,e=!1){this.variableNames=["A"],this.customUniforms=[{name:"texShape",type:"ivec2"}];const n=mt();this.outputShape=t,this.enableShapeUniforms=Bt(this.outputShape.length);let r="result";e&&(r="floor(result * 255. + 0.5)"),this.userCode=`\n ${this.enableShapeUniforms?"\n int getFlatIndex(ivec3 coords) {\n return coords.x * outShapeStrides[0] + coords.y * outShapeStrides[1] + coords.z;\n }\n":yt(t)}\n\n void main() {\n ivec3 coords = getOutputCoords();\n\n int flatIndex = getFlatIndex(coords);\n int offset = imod(flatIndex, 4);\n\n flatIndex = idiv(flatIndex, 4, 1.);\n\n int r = flatIndex / texShape[1];\n int c = imod(flatIndex, texShape[1]);\n vec2 uv = (vec2(c, r) + halfCR) / vec2(texShape[1], texShape[0]);\n vec4 values = ${n.texture2D}(A, uv);\n\n float result;\n\n if(offset == 0) {\n result = values[0];\n } else if(offset == 1) {\n result = values[1];\n } else if(offset == 2) {\n result = values[2];\n } else {\n result = values[3];\n }\n\n ${n.output} = vec4(${r}, 0., 0., 0.);\n }\n `}}
  5337. /**
  5338. * @license
  5339. * Copyright 2018 Google LLC. All Rights Reserved.
  5340. * Licensed under the Apache License, Version 2.0 (the "License");
  5341. * you may not use this file except in compliance with the License.
  5342. * You may obtain a copy of the License at
  5343. *
  5344. * http://www.apache.org/licenses/LICENSE-2.0
  5345. *
  5346. * Unless required by applicable law or agreed to in writing, software
  5347. * distributed under the License is distributed on an "AS IS" BASIS,
  5348. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5349. * See the License for the specific language governing permissions and
  5350. * limitations under the License.
  5351. * =============================================================================
  5352. */class Wt{constructor(t,e=!1){this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0,this.customUniforms=[{name:"texShape",type:"ivec2"}];const n=mt();this.outputShape=t,this.enableShapeUniforms=Bt(this.outputShape.length);let r="",i="result";e&&(i="floor(result * 255. + 0.5)");for(let e=0;e<=1;e++)for(let i=0;i<=1;i++){const o=2*e+i;r+=`\n localCoords = coords;\n if(localCoords[2] + ${i} < ${this.enableShapeUniforms?"outShape[2]":`${t[2]}`}) {\n localCoords[2] += ${i};\n if (localCoords[1] + ${e} < ${this.enableShapeUniforms?"outShape[1]":`${t[1]}`}) {\n localCoords[1] += ${e};\n\n flatIndex = getFlatIndex(localCoords);\n offset = imod(flatIndex, 4);\n\n flatIndex = idiv(flatIndex, 4, 1.);\n\n int r = flatIndex / texShape[1];\n int c = imod(flatIndex, texShape[1]);\n vec2 uv = (vec2(c, r) + halfCR) / vec2(texShape[1], texShape[0]);\n values = ${n.texture2D}(A, uv);\n\n if (offset == 0) {\n result[${o}] = values[0];\n } else if (offset == 1) {\n result[${o}] = values[1];\n } else if (offset == 2) {\n result[${o}] = values[2];\n } else {\n result[${o}] = values[3];\n }\n }\n }\n `}this.userCode=`\n ${this.enableShapeUniforms?"\n int getFlatIndex(ivec3 coords) {\n return coords.x * outShapeStrides[0] + coords.y * outShapeStrides[1] + coords.z;\n }\n":yt(t)}\n\n void main() {\n ivec3 coords = getOutputCoords();\n\n vec4 result = vec4(0.);\n int flatIndex, r, c, offset;\n ivec3 localCoords;\n vec2 uv;\n vec4 values;\n\n ${r}\n\n ${n.output} = ${i};\n }\n `}}
  5353. /**
  5354. * @license
  5355. * Copyright 2017 Google LLC. All Rights Reserved.
  5356. * Licensed under the Apache License, Version 2.0 (the "License");
  5357. * you may not use this file except in compliance with the License.
  5358. * You may obtain a copy of the License at
  5359. *
  5360. * http://www.apache.org/licenses/LICENSE-2.0
  5361. *
  5362. * Unless required by applicable law or agreed to in writing, software
  5363. * distributed under the License is distributed on an "AS IS" BASIS,
  5364. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5365. * See the License for the specific language governing permissions and
  5366. * limitations under the License.
  5367. * =============================================================================
  5368. */function Gt(t){const e=mt();return w(t,`${e.version}\n precision highp float;\n ${e.attribute} vec3 clipSpacePos;\n ${e.attribute} vec2 uv;\n ${e.varyingVs} vec2 resultUV;\n\n void main() {\n gl_Position = vec4(clipSpacePos, 1);\n resultUV = uv;\n }`)}function zt(t){return R(t,new Float32Array([-1,1,0,0,1,-1,-1,0,0,0,1,1,0,1,1,1,-1,0,1,0]))}function Xt(t){return A(t,new Uint16Array([0,1,2,2,1,3]))}function Kt(t,e,n,r,i,o){M(e,n);const a=D(t),l=t.TEXTURE_2D;return b(t,()=>t.bindTexture(l,a)),b(t,()=>t.texParameteri(l,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE)),b(t,()=>t.texParameteri(l,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE)),b(t,()=>t.texParameteri(l,t.TEXTURE_MIN_FILTER,t.NEAREST)),b(t,()=>t.texParameteri(l,t.TEXTURE_MAG_FILTER,t.NEAREST)),1===Object(s._127)().getNumber("WEBGL_VERSION")?b(t,()=>t.texImage2D(l,0,r,e,n,0,i,o,null)):b(t,()=>t.texStorage2D(l,1,r,e,n)),b(t,()=>t.bindTexture(t.TEXTURE_2D,null)),{texture:a,texShape:[n,e]}}function Yt(t){return t.internalFormatFloat}function qt(t,e,n,r){const[i,o]=f(e,n);return Kt(t,i,o,Yt(r),r.textureFormatFloat,t.FLOAT)}function Jt(t){return t.internalFormatHalfFloat}function Zt(t,e,n,r){const[i,o]=f(e,n);return Kt(t,i,o,Jt(r),r.textureFormatFloat,r.textureTypeHalfFloat)}function Qt(t){return t.downloadTextureFormat}function te(t,e,n,r){const[i,o]=f(e,n);return Kt(t,i,o,Qt(r),t.RGBA,t.UNSIGNED_BYTE)}function ee(t){return t.internalFormatPackedFloat}function ne(t,e,n,r){const[i,o]=m(e,n);return Kt(t,i,o,ee(r),t.RGBA,t.FLOAT)}function re(t){return t.internalFormatPackedHalfFloat}function ie(t,e,n,r){const[i,o]=m(e,n);return Kt(t,i,o,re(r),t.RGBA,r.textureTypeHalfFloat)}function oe(t,e,n){return b(t,()=>t.bindBuffer(t.ARRAY_BUFFER,n)),P(t,e,"clipSpacePos",n,3,20,0)&&P(t,e,"uv",n,2,20,12)}function se(t,e,n,r,i,o){let a,l,u;b(t,()=>t.bindTexture(t.TEXTURE_2D,e)),i instanceof Uint8Array?(a=new Uint8Array(n*r*4),l=t.UNSIGNED_BYTE,u=t.RGBA):(a=new Float32Array(n*r*4),l=t.FLOAT,u=o.internalFormatPackedFloat),a.set(i),2===Object(s._127)().getNumber("WEBGL_VERSION")?b(t,()=>t.texSubImage2D(t.TEXTURE_2D,0,0,0,n,r,t.RGBA,l,a)):b(t,()=>t.texImage2D(t.TEXTURE_2D,0,u,n,r,0,t.RGBA,l,a)),b(t,()=>t.bindTexture(t.TEXTURE_2D,null))}function ae(t,e,n){b(t,()=>t.bindTexture(t.TEXTURE_2D,e)),n.data instanceof Uint8Array?2===Object(s._127)().getNumber("WEBGL_VERSION")?b(t,()=>t.texSubImage2D(t.TEXTURE_2D,0,0,0,n.width,n.height,t.RGBA,t.UNSIGNED_BYTE,n.data)):b(t,()=>t.texImage2D(t.TEXTURE_2D,0,t.RGBA,n.width,n.height,0,t.RGBA,t.UNSIGNED_BYTE,n.data)):2===Object(s._127)().getNumber("WEBGL_VERSION")?b(t,()=>t.texSubImage2D(t.TEXTURE_2D,0,0,0,t.RGBA,t.UNSIGNED_BYTE,n)):b(t,()=>t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,n)),b(t,()=>t.bindTexture(t.TEXTURE_2D,null))}function le(t,e,n,r){const i=t.createBuffer();b(t,()=>t.bindBuffer(t.PIXEL_PACK_BUFFER,i));const o=16*e*n;return b(t,()=>t.bufferData(t.PIXEL_PACK_BUFFER,o,t.STREAM_READ)),b(t,()=>t.readPixels(0,0,n,e,t.RGBA,t.FLOAT,0)),b(t,()=>t.bindBuffer(t.PIXEL_PACK_BUFFER,null)),i}function ue(t,e,n){const r=t,i=new Float32Array(n);return r.bindBuffer(r.PIXEL_PACK_BUFFER,e),r.getBufferSubData(r.PIXEL_PACK_BUFFER,0,i),r.bindBuffer(r.PIXEL_PACK_BUFFER,null),i}function ce(t,e,n,r){const[i,o]=f(e,n),s=new Uint8Array(e*n*4);return b(t,()=>t.readPixels(0,0,i,o,r.downloadTextureFormat,t.UNSIGNED_BYTE,s)),new Float32Array(s.buffer)}function he(t,e,n,r,i,o,s,a){const l=t,u=new Float32Array(function(t,e){const[n,r]=m(t,e);return n*r*4}(o,s));return l.bindBuffer(l.PIXEL_PACK_BUFFER,e),l.getBufferSubData(l.PIXEL_PACK_BUFFER,0,u),l.bindBuffer(l.PIXEL_PACK_BUFFER,null),u}function de(t,e,n){const r=new Float32Array(e*n*4);return b(t,()=>t.readPixels(0,0,n,e,t.RGBA,t.FLOAT,r)),r}
  5369. /**
  5370. * @license
  5371. * Copyright 2017 Google LLC. All Rights Reserved.
  5372. * Licensed under the Apache License, Version 2.0 (the "License");
  5373. * you may not use this file except in compliance with the License.
  5374. * You may obtain a copy of the License at
  5375. *
  5376. * http://www.apache.org/licenses/LICENSE-2.0
  5377. *
  5378. * Unless required by applicable law or agreed to in writing, software
  5379. * distributed under the License is distributed on an "AS IS" BASIS,
  5380. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5381. * See the License for the specific language governing permissions and
  5382. * limitations under the License.
  5383. * =============================================================================
  5384. */class pe{constructor(t){this.outputTexture=null,this.program=null,this.disposed=!1,this.vertexAttrsAreBound=!1,this.itemsToPoll=[];const e=Object(s._127)().getNumber("WEBGL_VERSION");null!=t?(this.gl=t,u(e,t)):this.gl=c(e);let n="WEBGL_color_buffer_float";if(1===Object(s._127)().getNumber("WEBGL_VERSION")){const t="OES_texture_float",e="OES_texture_half_float";if(this.textureFloatExtension=E(this.gl,t),lt(this.gl,e))this.textureHalfFloatExtension=E(this.gl,e);else if(Object(s._127)().get("WEBGL_FORCE_F16_TEXTURES"))throw new Error("GL context does not support half float textures, yet the environment flag WEBGL_FORCE_F16_TEXTURES is set to true.");if(this.colorBufferFloatExtension=this.gl.getExtension(n),lt(this.gl,"EXT_color_buffer_half_float"))this.colorBufferHalfFloatExtension=E(this.gl,"EXT_color_buffer_half_float");else if(Object(s._127)().get("WEBGL_FORCE_F16_TEXTURES"))throw new Error("GL context does not support color renderable half floats, yet the environment flag WEBGL_FORCE_F16_TEXTURES is set to true.")}else if(n="EXT_color_buffer_float",lt(this.gl,n))this.colorBufferFloatExtension=this.gl.getExtension(n);else{if(!lt(this.gl,"EXT_color_buffer_half_float"))throw new Error("GL context does not support color renderable floats");this.colorBufferHalfFloatExtension=this.gl.getExtension("EXT_color_buffer_half_float")}this.vertexBuffer=zt(this.gl),this.indexBuffer=Xt(this.gl),this.framebuffer=L(this.gl),this.textureConfig=v(this.gl,this.textureHalfFloatExtension)}get debug(){return Object(s._127)().getBool("DEBUG")}dispose(){if(this.disposed)return;null!=this.program&&console.warn("Disposing a GPGPUContext that still has a bound WebGLProgram. This is probably a resource leak, delete the program with GPGPUContext.deleteProgram before disposing."),null!=this.outputTexture&&console.warn("Disposing a GPGPUContext that still has a bound output matrix texture. This is probably a resource leak, delete the output matrix texture with GPGPUContext.deleteMatrixTexture before disposing.");const t=this.gl;b(t,()=>t.finish()),b(t,()=>t.bindFramebuffer(t.FRAMEBUFFER,null)),b(t,()=>t.deleteFramebuffer(this.framebuffer)),b(t,()=>t.bindBuffer(t.ARRAY_BUFFER,null)),b(t,()=>t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null)),b(t,()=>t.deleteBuffer(this.indexBuffer)),this.disposed=!0}createFloat32MatrixTexture(t,e){return this.throwIfDisposed(),qt(this.gl,t,e,this.textureConfig)}createFloat16MatrixTexture(t,e){return this.throwIfDisposed(),Zt(this.gl,t,e,this.textureConfig)}createUnsignedBytesMatrixTexture(t,e){return this.throwIfDisposed(),te(this.gl,t,e,this.textureConfig)}uploadPixelDataToTexture(t,e){this.throwIfDisposed(),ae(this.gl,t,e)}uploadDenseMatrixToTexture(t,e,n,r){this.throwIfDisposed(),se(this.gl,t,e,n,r,this.textureConfig)}createFloat16PackedMatrixTexture(t,e){return this.throwIfDisposed(),ie(this.gl,t,e,this.textureConfig)}createPackedMatrixTexture(t,e){return this.throwIfDisposed(),ne(this.gl,t,e,this.textureConfig)}deleteMatrixTexture(t){this.throwIfDisposed(),this.outputTexture===t&&(W(this.gl,this.framebuffer),this.outputTexture=null),b(this.gl,()=>this.gl.deleteTexture(t))}downloadByteEncodedFloatMatrixFromOutputTexture(t,e,n){return this.downloadMatrixDriver(t,()=>ce(this.gl,e,n,this.textureConfig))}downloadPackedMatrixFromBuffer(t,e,n,r,i,o){return he(this.gl,t,0,0,0,i,o,this.textureConfig)}downloadFloat32MatrixFromBuffer(t,e){return ue(this.gl,t,e)}createBufferFromTexture(t,e,n){this.bindTextureToFrameBuffer(t);const r=le(this.gl,e,n,this.textureConfig);return this.unbindTextureToFrameBuffer(),r}createAndWaitForFence(){const t=this.createFence(this.gl);return this.pollFence(t)}createFence(t){let e,n;if(Object(s._127)().getBool("WEBGL_FENCE_API_ENABLED")){const r=t,i=r.fenceSync(r.SYNC_GPU_COMMANDS_COMPLETE,0);t.flush(),n=(()=>{const t=r.clientWaitSync(i,0,0);return t===r.ALREADY_SIGNALED||t===r.CONDITION_SATISFIED}),e=i}else Object(s._127)().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0?(e=this.beginQuery(),this.endQuery(),n=(()=>this.isQueryAvailable(e,Object(s._127)().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")))):n=(()=>!0);return{query:e,isFencePassed:n}}downloadMatrixFromPackedTexture(t,e,n){return this.downloadMatrixDriver(t,()=>de(this.gl,e,n))}createProgram(t){this.throwIfDisposed();const e=this.gl;null==this.vertexShader&&(this.vertexShader=Gt(e));const n=k(e);return b(e,()=>e.attachShader(n,this.vertexShader)),b(e,()=>e.attachShader(n,t)),O(e,n),this.debug&&I(e,n),this.vertexAttrsAreBound||(this.setProgram(n),this.vertexAttrsAreBound=oe(e,this.program,this.vertexBuffer)),n}deleteProgram(t){this.throwIfDisposed(),t===this.program&&(this.program=null),null!=t&&b(this.gl,()=>this.gl.deleteProgram(t))}setProgram(t){this.throwIfDisposed(),this.program=t,null!=this.program&&this.debug&&I(this.gl,this.program),b(this.gl,()=>this.gl.useProgram(t))}getUniformLocation(t,e,n=!0){return this.throwIfDisposed(),n?j(this.gl,t,e):$(this.gl,t,e)}getAttributeLocation(t,e){return this.throwIfDisposed(),b(this.gl,()=>this.gl.getAttribLocation(t,e))}getUniformLocationNoThrow(t,e){return this.throwIfDisposed(),this.gl.getUniformLocation(t,e)}setInputMatrixTexture(t,e,n){this.throwIfDisposed(),this.throwIfNoProgram(),U(this.gl,t,e,n)}setOutputMatrixTexture(t,e,n){this.setOutputMatrixTextureDriver(t,n,e)}setOutputPackedMatrixTexture(t,e,n){this.throwIfDisposed();const[r,i]=m(e,n);this.setOutputMatrixTextureDriver(t,r,i)}setOutputMatrixWriteRegion(t,e,n,r){this.setOutputMatrixWriteRegionDriver(n,t,r,e)}setOutputPackedMatrixWriteRegion(t,e,n,r){throw new Error("setOutputPackedMatrixWriteRegion not implemented.")}debugValidate(){null!=this.program&&I(this.gl,this.program),G(this.gl)}executeProgram(){this.throwIfDisposed(),this.throwIfNoProgram();const t=this.gl;this.debug&&this.debugValidate(),b(t,()=>t.drawElements(t.TRIANGLES,6,t.UNSIGNED_SHORT,0))}blockUntilAllProgramsCompleted(){this.throwIfDisposed(),b(this.gl,()=>this.gl.finish())}getQueryTimerExtension(){return null==this.disjointQueryTimerExtension&&(this.disjointQueryTimerExtension=E(this.gl,2===Object(s._127)().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")?"EXT_disjoint_timer_query_webgl2":"EXT_disjoint_timer_query")),this.disjointQueryTimerExtension}getQueryTimerExtensionWebGL2(){return this.getQueryTimerExtension()}getQueryTimerExtensionWebGL1(){return this.getQueryTimerExtension()}beginQuery(){if(2===Object(s._127)().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")){const t=this.gl,e=this.getQueryTimerExtensionWebGL2(),n=t.createQuery();return t.beginQuery(e.TIME_ELAPSED_EXT,n),n}const t=this.getQueryTimerExtensionWebGL1(),e=t.createQueryEXT();return t.beginQueryEXT(t.TIME_ELAPSED_EXT,e),e}endQuery(){if(2===Object(s._127)().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")){const t=this.gl,e=this.getQueryTimerExtensionWebGL2();return void t.endQuery(e.TIME_ELAPSED_EXT)}const t=this.getQueryTimerExtensionWebGL1();t.endQueryEXT(t.TIME_ELAPSED_EXT)}async waitForQueryAndGetTime(t){return await s._152.repeatedTry(()=>this.disposed||this.isQueryAvailable(t,Object(s._127)().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))),this.getQueryTime(t,Object(s._127)().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))}getQueryTime(t,e){if(0===e)return null;if(2===e){const e=this.gl;return e.getQueryParameter(t,e.QUERY_RESULT)/1e6}{const e=this.getQueryTimerExtensionWebGL1();return e.getQueryObjectEXT(t,e.QUERY_RESULT_EXT)/1e6}}isQueryAvailable(t,e){if(0===e)return!0;if(2===e){const e=this.gl,n=this.getQueryTimerExtensionWebGL2(),r=e.getQueryParameter(t,e.QUERY_RESULT_AVAILABLE);return null==this.disjoint&&(this.disjoint=this.gl.getParameter(n.GPU_DISJOINT_EXT)),r&&!this.disjoint}{const e=this.getQueryTimerExtensionWebGL1(),n=e.getQueryObjectEXT(t,e.QUERY_RESULT_AVAILABLE_EXT);return null==this.disjoint&&(this.disjoint=this.gl.getParameter(e.GPU_DISJOINT_EXT)),n&&!this.disjoint}}pollFence(t){return new Promise(e=>{this.addItemToPoll(()=>t.isFencePassed(),()=>e())})}pollItems(){const t=function(t){let e=0;for(;e<t.length;++e){const n=t[e]();if(!n)break}return e-1}
  5385. /**
  5386. * @license
  5387. * Copyright 2019 Google LLC. All Rights Reserved.
  5388. * Licensed under the Apache License, Version 2.0 (the "License");
  5389. * you may not use this file except in compliance with the License.
  5390. * You may obtain a copy of the License at
  5391. *
  5392. * http://www.apache.org/licenses/LICENSE-2.0
  5393. *
  5394. * Unless required by applicable law or agreed to in writing, software
  5395. * distributed under the License is distributed on an "AS IS" BASIS,
  5396. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5397. * See the License for the specific language governing permissions and
  5398. * limitations under the License.
  5399. * =============================================================================
  5400. */(this.itemsToPoll.map(t=>t.isDoneFn));for(let e=0;e<=t;++e){const{resolveFn:t}=this.itemsToPoll[e];t()}this.itemsToPoll=this.itemsToPoll.slice(t+1)}addItemToPoll(t,e){this.itemsToPoll.push({isDoneFn:t,resolveFn:e}),this.itemsToPoll.length>1||s._152.repeatedTry(()=>(this.pollItems(),0===this.itemsToPoll.length))}bindTextureToFrameBuffer(t){this.throwIfDisposed(),H(this.gl,t,this.framebuffer),this.debug&&G(this.gl)}unbindTextureToFrameBuffer(){null!=this.outputTexture?(H(this.gl,this.outputTexture,this.framebuffer),this.debug&&G(this.gl)):W(this.gl,this.framebuffer)}downloadMatrixDriver(t,e){this.bindTextureToFrameBuffer(t);const n=e();return this.unbindTextureToFrameBuffer(),n}setOutputMatrixTextureDriver(t,e,n){this.throwIfDisposed();const r=this.gl;H(r,t,this.framebuffer),this.debug&&G(r),this.outputTexture=t,b(r,()=>r.viewport(0,0,e,n)),b(r,()=>r.scissor(0,0,e,n))}setOutputMatrixWriteRegionDriver(t,e,n,r){this.throwIfDisposed(),b(this.gl,()=>this.gl.scissor(t,e,n,r))}throwIfDisposed(){if(this.disposed)throw new Error("Attempted to use disposed GPGPUContext.")}throwIfNoProgram(){if(null==this.program)throw new Error("No GPU program is currently set.")}}function fe(t,e){Array.isArray(t)||(t=[t]),t.forEach(t=>{null!=t&&s._152.assert("complex64"!==t.dtype,()=>`${e} does not support complex64 tensors in the CPU backend.`)})}
  5401. /**
  5402. * @license
  5403. * Copyright 2020 Google LLC. All Rights Reserved.
  5404. * Licensed under the Apache License, Version 2.0 (the License);
  5405. * you may not use this file except in compliance with the License.
  5406. * You may obtain a copy of the License at
  5407. *
  5408. * http://www.apache.org/licenses/LICENSE-2.0
  5409. *
  5410. * Unless required by applicable law or agreed to in writing, software
  5411. * distributed under the License is distributed on an AS IS BASIS,
  5412. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5413. * See the License for the specific language governing permissions and
  5414. * limitations under the License.
  5415. * =============================================================================
  5416. */function ge(t){const e=new Float32Array(t.length);for(let n=0;n<t.length;++n)e[n]=Math.abs(t[n]);return e}s.a;
  5417. /**
  5418. * @license
  5419. * Copyright 2020 Google LLC. All Rights Reserved.
  5420. * Licensed under the Apache License, Version 2.0 (the "License");
  5421. * you may not use this file except in compliance with the License.
  5422. * You may obtain a copy of the License at
  5423. *
  5424. * http://www.apache.org/licenses/LICENSE-2.0
  5425. *
  5426. * Unless required by applicable law or agreed to in writing, software
  5427. * distributed under the License is distributed on an "AS IS" BASIS,
  5428. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5429. * See the License for the specific language governing permissions and
  5430. * limitations under the License.
  5431. * =============================================================================
  5432. */
  5433. function me(t){return(e,n,r,i,o)=>{const a=s._115.assertAndGetBroadcastShape(e,n),l=a.length,u=s._152.computeStrides(a),c=s._152.sizeFromShape(a),h=s._152.getTypedArrayFromDType(o,c),d=e.length,p=n.length,f=s._152.computeStrides(e),g=s._152.computeStrides(n),m=s._115.getBroadcastDims(e,a),v=s._115.getBroadcastDims(n,a);if(m.length+v.length===0)for(let e=0;e<h.length;++e)h[e]=t(r[e%r.length],i[e%i.length]);else for(let e=0;e<h.length;++e){const n=s._152.indexToLoc(e,l,u),o=n.slice(-d);m.forEach(t=>o[t]=0);const a=s._152.locToIndex(o,d,f),c=n.slice(-p);v.forEach(t=>c[t]=0);const b=s._152.locToIndex(c,p,g);h[e]=t(r[a],i[b])}return[h,a]}}
  5434. /**
  5435. * @license
  5436. * Copyright 2020 Google LLC. All Rights Reserved.
  5437. * Licensed under the Apache License, Version 2.0 (the "License");
  5438. * you may not use this file except in compliance with the License.
  5439. * You may obtain a copy of the License at
  5440. *
  5441. * http://www.apache.org/licenses/LICENSE-2.0
  5442. *
  5443. * Unless required by applicable law or agreed to in writing, software
  5444. * distributed under the License is distributed on an "AS IS" BASIS,
  5445. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5446. * See the License for the specific language governing permissions and
  5447. * limitations under the License.
  5448. * =============================================================================
  5449. */function ve(t){const{inputs:e,backend:n}=t,{real:r,imag:i}=e,o=n.data.get(r.dataId).values,s=n.data.get(i.dataId).values,a=n.makeTensorInfo(r.shape,"complex64");return n.data.get(a.dataId).complexTensorInfos={real:n.makeTensorInfo(r.shape,"float32",o),imag:n.makeTensorInfo(i.shape,"float32",s)},a}s.z;
  5450. /**
  5451. * @license
  5452. * Copyright 2020 Google LLC. All Rights Reserved.
  5453. * Licensed under the Apache License, Version 2.0 (the "License");
  5454. * you may not use this file except in compliance with the License.
  5455. * You may obtain a copy of the License at
  5456. *
  5457. * http://www.apache.org/licenses/LICENSE-2.0
  5458. *
  5459. * Unless required by applicable law or agreed to in writing, software
  5460. * distributed under the License is distributed on an "AS IS" BASIS,
  5461. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5462. * See the License for the specific language governing permissions and
  5463. * limitations under the License.
  5464. * =============================================================================
  5465. */
  5466. /**
  5467. * @license
  5468. * Copyright 2020 Google LLC. All Rights Reserved.
  5469. * Licensed under the Apache License, Version 2.0 (the "License");
  5470. * you may not use this file except in compliance with the License.
  5471. * You may obtain a copy of the License at
  5472. *
  5473. * http://www.apache.org/licenses/LICENSE-2.0
  5474. *
  5475. * Unless required by applicable law or agreed to in writing, software
  5476. * distributed under the License is distributed on an "AS IS" BASIS,
  5477. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5478. * See the License for the specific language governing permissions and
  5479. * limitations under the License.
  5480. * =============================================================================
  5481. */
  5482. function be(t){const{inputs:e,backend:n}=t,{x:r}=e;return n.incRef(r.dataId),{dataId:r.dataId,shape:r.shape,dtype:r.dtype}}s._16;
  5483. /**
  5484. * @license
  5485. * Copyright 2020 Google LLC. All Rights Reserved.
  5486. * Licensed under the Apache License, Version 2.0 (the "License");
  5487. * you may not use this file except in compliance with the License.
  5488. * You may obtain a copy of the License at
  5489. *
  5490. * http://www.apache.org/licenses/LICENSE-2.0
  5491. *
  5492. * Unless required by applicable law or agreed to in writing, software
  5493. * distributed under the License is distributed on an "AS IS" BASIS,
  5494. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5495. * See the License for the specific language governing permissions and
  5496. * limitations under the License.
  5497. * =============================================================================
  5498. */function _e(t){const{inputs:e,backend:n}=t,{input:r}=e,i=n.data.get(r.dataId).complexTensorInfos.real,o=n.data.get(i.dataId).values;return n.makeTensorInfo(i.shape,i.dtype,o)}s._60;
  5499. /**
  5500. * @license
  5501. * Copyright 2020 Google LLC. All Rights Reserved.
  5502. * Licensed under the Apache License, Version 2.0 (the "License");
  5503. * you may not use this file except in compliance with the License.
  5504. * You may obtain a copy of the License at
  5505. *
  5506. * http://www.apache.org/licenses/LICENSE-2.0
  5507. *
  5508. * Unless required by applicable law or agreed to in writing, software
  5509. * distributed under the License is distributed on an "AS IS" BASIS,
  5510. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5511. * See the License for the specific language governing permissions and
  5512. * limitations under the License.
  5513. * =============================================================================
  5514. */function ye(t){const{inputs:e,backend:n,attrs:r}=t,{x:i}=e,{dtype:o}=r;if("complex64"===o){if("complex64"===i.dtype)return be({inputs:{x:i},backend:n});const t=function t(e,n,r="float32"){if("complex64"===r)return ve({inputs:{real:t(e,n,"float32"),imag:t(e,n,"float32")},backend:e});const i=s._152.makeZerosTypedArray(s._152.sizeFromShape(n),r);return e.makeTensorInfo(n,r,i)}(n,i.shape,i.dtype),e=ye({inputs:{x:i},backend:n,attrs:{dtype:"float32"}}),r=ve({inputs:{real:e,imag:t},backend:n});return n.disposeIntermediateTensorInfo(t),n.disposeIntermediateTensorInfo(e),r}if("complex64"===i.dtype){const t=_e({inputs:{input:i},backend:n}),e=ye({inputs:{x:t},backend:n,attrs:{dtype:o}});return n.disposeIntermediateTensorInfo(t),e}if(!s._152.hasEncodingLoss(i.dtype,o)){const t=be({inputs:{x:i},backend:n});return{dataId:t.dataId,shape:t.shape,dtype:o}}if("int32"===o){const t=n.data.get(i.dataId).values,e=Int32Array.from(t);return n.makeTensorInfo(i.shape,"int32",e)}if("bool"===o){const t=n.data.get(i.dataId).values,e=s._152.toTypedArray([0],i.dtype),[r,o]=me((t,e)=>t!==e?1:0)(i.shape,[],t,e,"bool");return n.makeTensorInfo(o,"bool",r)}throw new Error(`Error in Cast: failed to cast ${i.dtype} to ${o}`)}s.w;
  5515. /**
  5516. * @license
  5517. * Copyright 2020 Google LLC. All Rights Reserved.
  5518. * Licensed under the Apache License, Version 2.0 (the "License");
  5519. * you may not use this file except in compliance with the License.
  5520. * You may obtain a copy of the License at
  5521. *
  5522. * http://www.apache.org/licenses/LICENSE-2.0
  5523. *
  5524. * Unless required by applicable law or agreed to in writing, software
  5525. * distributed under the License is distributed on an "AS IS" BASIS,
  5526. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5527. * See the License for the specific language governing permissions and
  5528. * limitations under the License.
  5529. * =============================================================================
  5530. */function Te(t,e,n,r){return null==n?({inputs:n,backend:i})=>{const{a:o,b:a}=n,l=i;fe([o,a],t);const u=l.data.get(o.dataId).values,c=l.data.get(a.dataId).values,h="string"===o.dtype?s._115.fromUint8ToStringArray(u):u,d="string"===o.dtype?s._115.fromUint8ToStringArray(c):c,p=r||o.dtype,[f,g]=e(o.shape,a.shape,h,d,p);return l.makeTensorInfo(g,p,f)}:({inputs:t,backend:i})=>{const{a:o,b:s}=t,a=i;if("complex64"===o.dtype||"complex64"===s.dtype){const t=ye({inputs:{x:o},backend:a,attrs:{dtype:"complex64"}}),e=a.data.get(t.dataId),r=e.complexTensorInfos.real,i=e.complexTensorInfos.imag,l=a.data.get(r.dataId).values,u=a.data.get(i.dataId).values,c=ye({inputs:{x:s},backend:a,attrs:{dtype:"complex64"}}),h=a.data.get(c.dataId),d=h.complexTensorInfos.real,p=h.complexTensorInfos.imag,f=a.data.get(d.dataId).values,g=a.data.get(p.dataId).values,[m,v,b]=n(o.shape,s.shape,l,u,f,g),_=a.makeTensorInfo(b,"float32",m),y=a.makeTensorInfo(b,"float32",v),T=ve({inputs:{real:_,imag:y},backend:a});return a.disposeIntermediateTensorInfo(t),a.disposeIntermediateTensorInfo(c),a.disposeIntermediateTensorInfo(_),a.disposeIntermediateTensorInfo(y),T}{const t=a.data.get(o.dataId).values,n=a.data.get(s.dataId).values,i=r||o.dtype,[l,u]=e(o.shape,s.shape,t,n,i);return a.makeTensorInfo(u,i,l)}}}function xe(t){return(e,n,r,i,o,a)=>{const l=s._115.assertAndGetBroadcastShape(e,n),u=s._152.sizeFromShape(l),c=l.length,h=s._152.computeStrides(l),d=s._152.getTypedArrayFromDType("float32",u),p=s._152.getTypedArrayFromDType("float32",u),f=s._115.getBroadcastDims(e,l),g=s._115.getBroadcastDims(n,l),m=s._115.mergeRealAndImagArrays(r,i),v=s._115.mergeRealAndImagArrays(o,a),b=e.length,_=s._152.computeStrides(e),y=n.length,T=s._152.computeStrides(n);if(f.length+g.length===0)for(let e=0;e<d.length;e++){const n=e%m.length,r=e%v.length,i=t(m[2*n],m[2*n+1],v[2*r],v[2*r+1]);d[e]=i.real,p[e]=i.imag}else for(let e=0;e<d.length;e++){const n=s._152.indexToLoc(e,c,h),r=n.slice(-b);f.forEach(t=>r[t]=0);const i=s._152.locToIndex(r,b,_),o=n.slice(-y);g.forEach(t=>o[t]=0);const a=s._152.locToIndex(o,y,T),l=t(m[2*i],m[2*i+1],v[2*a],v[2*a+1]);d[e]=l.real,p[e]=l.imag}return[d,p,l]}}
  5531. /**
  5532. * @license
  5533. * Copyright 2020 Google LLC. All Rights Reserved.
  5534. * Licensed under the Apache License, Version 2.0 (the "License");
  5535. * you may not use this file except in compliance with the License.
  5536. * You may obtain a copy of the License at
  5537. *
  5538. * http://www.apache.org/licenses/LICENSE-2.0
  5539. *
  5540. * Unless required by applicable law or agreed to in writing, software
  5541. * distributed under the License is distributed on an "AS IS" BASIS,
  5542. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5543. * See the License for the specific language governing permissions and
  5544. * limitations under the License.
  5545. * =============================================================================
  5546. */const Ee=me((t,e)=>t+e),we=xe((t,e,n,r)=>({real:t+n,imag:e+r}));Te(s.d,Ee,we),s.d;
  5547. /**
  5548. * @license
  5549. * Copyright 2020 Google LLC. All Rights Reserved.
  5550. * Licensed under the Apache License, Version 2.0 (the "License");
  5551. * you may not use this file except in compliance with the License.
  5552. * You may obtain a copy of the License at
  5553. *
  5554. * http://www.apache.org/licenses/LICENSE-2.0
  5555. *
  5556. * Unless required by applicable law or agreed to in writing, software
  5557. * distributed under the License is distributed on an "AS IS" BASIS,
  5558. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5559. * See the License for the specific language governing permissions and
  5560. * limitations under the License.
  5561. * =============================================================================
  5562. */
  5563. function Ce(t,e,n,r,i){const o=s._152.sizeFromShape(r),a=s._152.makeZerosTypedArray(i,n);for(let n=0;n<t.length;n++){const r=t[n];if(r<0)throw new Error("Input x must be non-negative!");r>=i||(a[r]+=o>0?e[n]:1)}return a}function Se(t,e,n,r=!1){const i=t.shape[0],o=t.shape[1],a=Object(s._118)([i,n],e.dtype);for(let s=0;s<i;s++)for(let i=0;i<o;i++){const o=t.get(s,i);if(o<0)throw new Error("Input x must be non-negative!");o>=n||(r?a.set(1,s,o):e.size>0?a.set(a.get(s,o)+e.get(s,i),s,o):a.set(a.get(s,o)+1,s,o))}return a}
  5564. /**
  5565. * @license
  5566. * Copyright 2020 Google LLC. All Rights Reserved.
  5567. * Licensed under the Apache License, Version 2.0 (the "License");
  5568. * you may not use this file except in compliance with the License.
  5569. * You may obtain a copy of the License at
  5570. *
  5571. * http://www.apache.org/licenses/LICENSE-2.0
  5572. *
  5573. * Unless required by applicable law or agreed to in writing, software
  5574. * distributed under the License is distributed on an "AS IS" BASIS,
  5575. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5576. * See the License for the specific language governing permissions and
  5577. * limitations under the License.
  5578. * =============================================================================
  5579. */function ke(t){return(e,n,r)=>{const i=s._152.getTypedArrayFromDType(n,e.length);for(let n=0;n<e.length;++n)i[n]=t(e[n],r);return i}}
  5580. /**
  5581. * @license
  5582. * Copyright 2020 Google LLC. All Rights Reserved.
  5583. * Licensed under the Apache License, Version 2.0 (the "License");
  5584. * you may not use this file except in compliance with the License.
  5585. * You may obtain a copy of the License at
  5586. *
  5587. * http://www.apache.org/licenses/LICENSE-2.0
  5588. *
  5589. * Unless required by applicable law or agreed to in writing, software
  5590. * distributed under the License is distributed on an "AS IS" BASIS,
  5591. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5592. * See the License for the specific language governing permissions and
  5593. * limitations under the License.
  5594. * =============================================================================
  5595. */function Oe(t,e,n){return({inputs:r,attrs:i,backend:o})=>{const{x:a}=r;if(fe(a,t),"string"===a.dtype||"string"===n)throw new Error("unaryKernelFunc does not support string input/output");const l=o,u=l.data.get(a.dataId).values,c=s._152.sizeFromShape(a.shape),h=n||a.dtype,d=s._152.getArrayFromDType(h,c);for(let t=0;t<c;++t)d[t]=e(u[t],i);return l.makeTensorInfo(a.shape,h,d)}}function Ie(t,e,n){return({inputs:r,attrs:i,backend:o})=>{const{x:s}=r;if(fe(s,t),"string"===s.dtype||"string"===n)throw new Error("unaryKernelFunc does not support string input/output");const a=o,l=a.data.get(s.dataId).values,u=n||s.dtype,c=e(l,u,i);return a.makeTensorInfo(s.shape,u,c)}}
  5596. /**
  5597. * @license
  5598. * Copyright 2020 Google LLC. All Rights Reserved.
  5599. * Licensed under the Apache License, Version 2.0 (the License);
  5600. * you may not use this file except in compliance with the License.
  5601. * You may obtain a copy of the License at
  5602. *
  5603. * http://www.apache.org/licenses/LICENSE-2.0
  5604. *
  5605. * Unless required by applicable law or agreed to in writing, software
  5606. * distributed under the License is distributed on an AS IS BASIS,
  5607. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5608. * See the License for the specific language governing permissions and
  5609. * limitations under the License.
  5610. * =============================================================================
  5611. */const Re=ke(t=>Math.ceil(t));Ie(s.x,Re),s.x;
  5612. /**
  5613. * @license
  5614. * Copyright 2020 Google LLC. All Rights Reserved.
  5615. * Licensed under the Apache License, Version 2.0 (the "License");
  5616. * you may not use this file except in compliance with the License.
  5617. * You may obtain a copy of the License at
  5618. *
  5619. * http://www.apache.org/licenses/LICENSE-2.0
  5620. *
  5621. * Unless required by applicable law or agreed to in writing, software
  5622. * distributed under the License is distributed on an "AS IS" BASIS,
  5623. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5624. * See the License for the specific language governing permissions and
  5625. * limitations under the License.
  5626. * =============================================================================
  5627. */
  5628. function Ae(t,e,n,r){const i=s._152.getArrayFromDType(n,s._152.sizeFromShape(e));if(r&&"string"!==n){let e=0;t.forEach(t=>{const n=s._152.sizeFromShape(t.shape);i.set(t.vals,e),e+=n})}else{let r=0;t.forEach(t=>{const o="string"===n?s._115.fromUint8ToStringArray(t.vals):t.vals;let a=0;for(let n=0;n<t.shape[0];++n){const s=n*e[1]+r;for(let e=0;e<t.shape[1];++e)i[s+e]=o[a++]}r+=t.shape[1]})}return i}
  5629. /**
  5630. * @license
  5631. * Copyright 2020 Google LLC. All Rights Reserved.
  5632. * Licensed under the Apache License, Version 2.0 (the "License");
  5633. * you may not use this file except in compliance with the License.
  5634. * You may obtain a copy of the License at
  5635. *
  5636. * http://www.apache.org/licenses/LICENSE-2.0
  5637. *
  5638. * Unless required by applicable law or agreed to in writing, software
  5639. * distributed under the License is distributed on an "AS IS" BASIS,
  5640. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5641. * See the License for the specific language governing permissions and
  5642. * limitations under the License.
  5643. * =============================================================================
  5644. */const Ne=me((t,e)=>t===e?1:0),De=(Te(s.X,Ne,null,"bool"),s.X,ke(t=>Math.exp(t))),Me=(Ie(s.Z,De,"float32"),s.Z,ke(t=>Math.expm1(t))),Le=(Ie(s._1,Me),s._1,ke(t=>Math.floor(t)));Ie(s._5,Le),s._5;
  5645. /**
  5646. * @license
  5647. * Copyright 2021 Google LLC. All Rights Reserved.
  5648. * Licensed under the Apache License, Version 2.0 (the "License");
  5649. * you may not use this file except in compliance with the License.
  5650. * You may obtain a copy of the License at
  5651. *
  5652. * http://www.apache.org/licenses/LICENSE-2.0
  5653. *
  5654. * Unless required by applicable law or agreed to in writing, software
  5655. * distributed under the License is distributed on an "AS IS" BASIS,
  5656. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5657. * See the License for the specific language governing permissions and
  5658. * limitations under the License.
  5659. * =============================================================================
  5660. */
  5661. function Pe(t,e,n,r,i,o,a,l,u){const c=Object(s._118)([r,o],n);for(let n=0;n<r;n++){const r=[];let s=0;for(let e=0;e<i;e++){const o=t[n*i+e];s+=o*a[e],r.push(o)}if(s<0||s>=u/o)throw new Error(`Invalid indices: ${r} does not index into ${l}`);for(let t=0;t<o;t++)c.values[n*o+t]=e.get(...e.indexToLoc(s*o+t))}return c}
  5662. /**
  5663. * @license
  5664. * Copyright 2020 Google LLC. All Rights Reserved.
  5665. * Licensed under the Apache License, Version 2.0 (the "License");
  5666. * you may not use this file except in compliance with the License.
  5667. * You may obtain a copy of the License at
  5668. *
  5669. * http://www.apache.org/licenses/LICENSE-2.0
  5670. *
  5671. * Unless required by applicable law or agreed to in writing, software
  5672. * distributed under the License is distributed on an "AS IS" BASIS,
  5673. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5674. * See the License for the specific language governing permissions and
  5675. * limitations under the License.
  5676. * =============================================================================
  5677. */function Fe(t,e,n){const r=Object(s._118)(n,t.dtype);for(let n=0;n<r.size;++n){const i=r.indexToLoc(n).slice(),o=i[0],s=i[2],a=e.locToIndex([o,s]);i[2]=e.values[a];const l=t.locToIndex(i);0<=l&&l<t.values.length&&(r.values[n]=t.values[l])}return r}
  5678. /**
  5679. * @license
  5680. * Copyright 2020 Google LLC. All Rights Reserved.
  5681. * Licensed under the Apache License, Version 2.0 (the "License");
  5682. * you may not use this file except in compliance with the License.
  5683. * You may obtain a copy of the License at
  5684. *
  5685. * http://www.apache.org/licenses/LICENSE-2.0
  5686. *
  5687. * Unless required by applicable law or agreed to in writing, software
  5688. * distributed under the License is distributed on an "AS IS" BASIS,
  5689. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5690. * See the License for the specific language governing permissions and
  5691. * limitations under the License.
  5692. * =============================================================================
  5693. */const Be=me((t,e)=>t>e?1:0),je=(Te(s._13,Be,null,"bool"),s._13,me((t,e)=>t>=e?1:0)),$e=(Te(s._14,je,null,"bool"),s._14,me((t,e)=>t<e?1:0)),Ue=(Te(s._25,$e,null,"bool"),s._25,me((t,e)=>t<=e?1:0));Te(s._26,Ue,null,"bool"),s._26;
  5694. /**
  5695. * @license
  5696. * Copyright 2020 Google LLC. All Rights Reserved.
  5697. * Licensed under the Apache License, Version 2.0 (the "License");
  5698. * you may not use this file except in compliance with the License.
  5699. * You may obtain a copy of the License at
  5700. *
  5701. * http://www.apache.org/licenses/LICENSE-2.0
  5702. *
  5703. * Unless required by applicable law or agreed to in writing, software
  5704. * distributed under the License is distributed on an "AS IS" BASIS,
  5705. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5706. * See the License for the specific language governing permissions and
  5707. * limitations under the License.
  5708. * =============================================================================
  5709. */
  5710. function Ve(t,e,n){const r=(e-t)/(n-1),i=s._152.makeZerosTypedArray(n,"float32");i[0]=t;for(let t=1;t<i.length;t++)i[t]=i[t-1]+r;return i}
  5711. /**
  5712. * @license
  5713. * Copyright 2020 Google LLC. All Rights Reserved.
  5714. * Licensed under the Apache License, Version 2.0 (the License);
  5715. * you may not use this file except in compliance with the License.
  5716. * You may obtain a copy of the License at
  5717. *
  5718. * http://www.apache.org/licenses/LICENSE-2.0
  5719. *
  5720. * Unless required by applicable law or agreed to in writing, software
  5721. * distributed under the License is distributed on an AS IS BASIS,
  5722. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5723. * See the License for the specific language governing permissions and
  5724. * limitations under the License.
  5725. * =============================================================================
  5726. */const He=ke(t=>Math.log(t));Ie(s._28,He),s._28;
  5727. /**
  5728. * @license
  5729. * Copyright 2020 Google LLC. All Rights Reserved.
  5730. * Licensed under the Apache License, Version 2.0 (the "License");
  5731. * you may not use this file except in compliance with the License.
  5732. * You may obtain a copy of the License at
  5733. *
  5734. * http://www.apache.org/licenses/LICENSE-2.0
  5735. *
  5736. * Unless required by applicable law or agreed to in writing, software
  5737. * distributed under the License is distributed on an "AS IS" BASIS,
  5738. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5739. * See the License for the specific language governing permissions and
  5740. * limitations under the License.
  5741. * =============================================================================
  5742. */
  5743. function We(t,e,n,r){const i=s._152.getTypedArrayFromDType(r,s._152.sizeFromShape(n));for(let n=0;n<i.length;++n){const r=n*e;let o=t[r];for(let n=0;n<e;++n){const e=t[r+n];(Number.isNaN(e)||e>o)&&(o=e)}i[n]=o}return i}
  5744. /**
  5745. * @license
  5746. * Copyright 2020 Google LLC. All Rights Reserved.
  5747. * Licensed under the Apache License, Version 2.0 (the "License");
  5748. * you may not use this file except in compliance with the License.
  5749. * You may obtain a copy of the License at
  5750. *
  5751. * http://www.apache.org/licenses/LICENSE-2.0
  5752. *
  5753. * Unless required by applicable law or agreed to in writing, software
  5754. * distributed under the License is distributed on an "AS IS" BASIS,
  5755. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5756. * See the License for the specific language governing permissions and
  5757. * limitations under the License.
  5758. * =============================================================================
  5759. */const Ge=me((t,e)=>Math.max(t,e)),ze=(Te(s._39,Ge),s._39,me((t,e)=>Math.min(t,e))),Xe=(Te(s._42,ze),s._42,me((t,e)=>t*e)),Ke=xe((t,e,n,r)=>({real:t*n-e*r,imag:t*r+e*n}));Te(s._46,Xe,Ke),s._46;
  5760. /**
  5761. * @license
  5762. * Copyright 2020 Google LLC. All Rights Reserved.
  5763. * Licensed under the Apache License, Version 2.0 (the "License");
  5764. * you may not use this file except in compliance with the License.
  5765. * You may obtain a copy of the License at
  5766. *
  5767. * http://www.apache.org/licenses/LICENSE-2.0
  5768. *
  5769. * Unless required by applicable law or agreed to in writing, software
  5770. * distributed under the License is distributed on an "AS IS" BASIS,
  5771. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5772. * See the License for the specific language governing permissions and
  5773. * limitations under the License.
  5774. * =============================================================================
  5775. */
  5776. function Ye(t,e,n){const r=s._152.createScalarValue(-1,n);return Xe([],e,r,t,n)}s._47;
  5777. /**
  5778. * @license
  5779. * Copyright 2020 Google LLC. All Rights Reserved.
  5780. * Licensed under the Apache License, Version 2.0 (the "License");
  5781. * you may not use this file except in compliance with the License.
  5782. * You may obtain a copy of the License at
  5783. *
  5784. * http://www.apache.org/licenses/LICENSE-2.0
  5785. *
  5786. * Unless required by applicable law or agreed to in writing, software
  5787. * distributed under the License is distributed on an "AS IS" BASIS,
  5788. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5789. * See the License for the specific language governing permissions and
  5790. * limitations under the License.
  5791. * =============================================================================
  5792. */const qe=me((t,e)=>t!==e?1:0);Te(s._51,qe,null,"bool"),s._51;
  5793. /**
  5794. * @license
  5795. * Copyright 2020 Google LLC. All Rights Reserved.
  5796. * Licensed under the Apache License, Version 2.0 (the "License");
  5797. * you may not use this file except in compliance with the License.
  5798. * You may obtain a copy of the License at
  5799. *
  5800. * http://www.apache.org/licenses/LICENSE-2.0
  5801. *
  5802. * Unless required by applicable law or agreed to in writing, software
  5803. * distributed under the License is distributed on an "AS IS" BASIS,
  5804. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5805. * See the License for the specific language governing permissions and
  5806. * limitations under the License.
  5807. * =============================================================================
  5808. */
  5809. function Je(t,e,n,r,i){const o=e.length,a=s._152.sizeFromShape(e),l=s._152.computeStrides(e),u=s._152.computeStrides(i),c=s._152.getTypedArrayFromDType(n,s._152.sizeFromShape(i));for(let e=0;e<a;++e){const n=s._152.indexToLoc(e,o,l),i=new Array(n.length);for(let t=0;t<i.length;t++)i[t]=n[r[t]];c[s._152.locToIndex(i,o,u)]=t[e]}return c}
  5810. /**
  5811. * @license
  5812. * Copyright 2020 Google LLC. All Rights Reserved.
  5813. * Licensed under the Apache License, Version 2.0 (the "License");
  5814. * you may not use this file except in compliance with the License.
  5815. * You may obtain a copy of the License at
  5816. *
  5817. * http://www.apache.org/licenses/LICENSE-2.0
  5818. *
  5819. * Unless required by applicable law or agreed to in writing, software
  5820. * distributed under the License is distributed on an "AS IS" BASIS,
  5821. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5822. * See the License for the specific language governing permissions and
  5823. * limitations under the License.
  5824. * =============================================================================
  5825. */s._108;
  5826. /**
  5827. * @license
  5828. * Copyright 2020 Google LLC. All Rights Reserved.
  5829. * Licensed under the Apache License, Version 2.0 (the "License");
  5830. * you may not use this file except in compliance with the License.
  5831. * You may obtain a copy of the License at
  5832. *
  5833. * http://www.apache.org/licenses/LICENSE-2.0
  5834. *
  5835. * Unless required by applicable law or agreed to in writing, software
  5836. * distributed under the License is distributed on an "AS IS" BASIS,
  5837. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5838. * See the License for the specific language governing permissions and
  5839. * limitations under the License.
  5840. * =============================================================================
  5841. */function Ze(t,e,n,r){const[i,o]=s._115.computeOutAndReduceShapes(t,r),a=Object(s._151)(e,"int32"),l=s._152.makeZerosTypedArray(s._152.sizeFromShape(i),a),u=s._152.sizeFromShape(o);for(let t=0;t<l.length;++t){const e=t*u;let r=1;for(let t=0;t<u;++t)r*=n[e+t];l[t]=r}return{outVals:l,outShape:i,outDtype:a}}s._58;
  5842. /**
  5843. * @license
  5844. * Copyright 2020 Google LLC. All Rights Reserved.
  5845. * Licensed under the Apache License, Version 2.0 (the "License");
  5846. * you may not use this file except in compliance with the License.
  5847. * You may obtain a copy of the License at
  5848. *
  5849. * http://www.apache.org/licenses/LICENSE-2.0
  5850. *
  5851. * Unless required by applicable law or agreed to in writing, software
  5852. * distributed under the License is distributed on an "AS IS" BASIS,
  5853. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5854. * See the License for the specific language governing permissions and
  5855. * limitations under the License.
  5856. * =============================================================================
  5857. */function Qe(t,e,n,r){if(t===e||t<e&&n<0||e<t&&n>1)return s._152.makeZerosTypedArray(0,r);const i=Math.abs(Math.ceil((e-t)/n)),o=s._152.makeZerosTypedArray(i,r);e<t&&1===n&&(n=-1),o[0]=t;for(let t=1;t<o.length;t++)o[t]=o[t-1]+n;return o}
  5858. /**
  5859. * @license
  5860. * Copyright 2020 Google LLC. All Rights Reserved.
  5861. * Licensed under the Apache License, Version 2.0 (the License);
  5862. * you may not use this file except in compliance with the License.
  5863. * You may obtain a copy of the License at
  5864. *
  5865. * http://www.apache.org/licenses/LICENSE-2.0
  5866. *
  5867. * Unless required by applicable law or agreed to in writing, software
  5868. * distributed under the License is distributed on an AS IS BASIS,
  5869. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5870. * See the License for the specific language governing permissions and
  5871. * limitations under the License.
  5872. * =============================================================================
  5873. */const tn=ke(t=>1/Math.sqrt(t)),en=(Ie(s._73,tn),s._73,ke(t=>1/(1+Math.exp(-t))));Oe(s._77,t=>1/(1+Math.exp(-t))),s._77;
  5874. /**
  5875. * @license
  5876. * Copyright 2020 Google LLC. All Rights Reserved.
  5877. * Licensed under the Apache License, Version 2.0 (the "License");
  5878. * you may not use this file except in compliance with the License.
  5879. * You may obtain a copy of the License at
  5880. *
  5881. * http://www.apache.org/licenses/LICENSE-2.0
  5882. *
  5883. * Unless required by applicable law or agreed to in writing, software
  5884. * distributed under the License is distributed on an "AS IS" BASIS,
  5885. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5886. * See the License for the specific language governing permissions and
  5887. * limitations under the License.
  5888. * =============================================================================
  5889. */
  5890. function nn(t,e,n,r,i){const o=s._141.isSliceContinous(r,e,n),a=s._152.sizeFromShape(n),l=s._152.computeStrides(r);if(o){const n=s._141.computeFlatOffset(e,l);return"string"===i?t.slice(n,n+a):t.subarray(n,n+a)}const u="string"===i?s._115.fromUint8ToStringArray(t):t,c=Object(s._118)(r,i,u),h=Object(s._118)(n,i);for(let t=0;t<h.size;++t){const n=h.indexToLoc(t),r=n.map((t,n)=>t+e[n]);h.set(c.get(...r),...n)}return"string"===i?s._115.fromStringArrayToUint8(h.values):h.values}s._81;
  5891. /**
  5892. * @license
  5893. * Copyright 2021 Google LLC. All Rights Reserved.
  5894. * Licensed under the Apache License, Version 2.0 (the "License");
  5895. * you may not use this file except in compliance with the License.
  5896. * You may obtain a copy of the License at
  5897. *
  5898. * http://www.apache.org/licenses/LICENSE-2.0
  5899. *
  5900. * Unless required by applicable law or agreed to in writing, software
  5901. * distributed under the License is distributed on an "AS IS" BASIS,
  5902. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5903. * See the License for the specific language governing permissions and
  5904. * limitations under the License.
  5905. * =============================================================================
  5906. */function rn(t,e,n,r,i,o,a){const l=e[0],u=o[0],c=new Array(u),h=new Array(l),d=e[1];if(0===u){if(0!==l)throw new Error(s._115.getSparseFillEmptyRowsIndicesDenseShapeMismatch(l));return[s._152.getArrayFromDType(n,0),[0,d],s._152.getArrayFromDType(i,0),c,h]}let p=!0,f=0;const g=new Array(u).fill(0);for(let e=0;e<l;++e){const n=t[e*d];if(n<0)throw new Error(s._115.getSparseFillEmptyRowsNegativeIndexErrorMessage(e,n));if(n>=u)throw new Error(s._115.getSparseFillEmptyRowsOutOfRangeIndexErrorMessage(e,n,u));++g[n],p=p&&n>=f,f=n}let m=!0;for(let t=0;t<u;++t){const e=0===g[t];c[t]=e,m=m&&!e,g[t]=Math.max(g[t],1),t>0&&(g[t]+=g[t-1])}if(m&&p){const e=t,n=r;for(let t=0;t<l;++t)h[t]=t;return[e,[l,d],n,c,h]}{const e=g[u-1],o=s._152.getArrayFromDType(n,e*d),p=s._152.getArrayFromDType(i,e),f=new Array(u).fill(0);for(let e=0;e<l;++e){const n=t[e*d],i=f[n],s=(0===n?0:g[n-1])+i;f[n]++;for(let n=0;n<d;++n)o[s*d+n]=t[e*d+n];p[s]=r[e],h[e]=s}for(let t=0;t<u;++t){if(0===f[t]){const e=0===t?0:g[t-1];o[e*d+0]=t;for(let t=1;t<d;++t)o[e*d+t]=0;p[e]=a}}return[o,[e,d],p,c,h]}}
  5907. /**
  5908. * @license
  5909. * Copyright 2021 Google LLC. All Rights Reserved.
  5910. * Licensed under the Apache License, Version 2.0 (the "License");
  5911. * you may not use this file except in compliance with the License.
  5912. * You may obtain a copy of the License at
  5913. *
  5914. * http://www.apache.org/licenses/LICENSE-2.0
  5915. *
  5916. * Unless required by applicable law or agreed to in writing, software
  5917. * distributed under the License is distributed on an "AS IS" BASIS,
  5918. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5919. * See the License for the specific language governing permissions and
  5920. * limitations under the License.
  5921. * =============================================================================
  5922. */function on(t,e,n,r,i){const o=s._152.sizeFromShape(r),a=e[0],l=i.length,u=[];let c=1,h=-1;for(let t=0;t<l;++t){const e=i[t];if(-1===e){if(-1!==h)throw new Error(s._115.getSparseReshapeMultipleNegativeOneOutputDimErrorMessage(h,t));h=t,u.push(1)}else{if(e<0)throw new Error(s._115.getSparseReshapeNegativeOutputDimErrorMessage(t,e));c*=e,u.push(e)}}if(-1!==h){if(c<=0)throw new Error(s._115.getSparseReshapeEmptyTensorZeroOutputDimErrorMessage());const t=Math.trunc(o/c);if(c*t!==o)throw new Error(s._115.getSparseReshapeInputOutputMultipleErrorMessage(r,u));u[h]=t}if(s._152.sizeFromShape(u)!==o)throw new Error(s._115.getSparseReshapeInputOutputMismatchErrorMessage(r,u));const d=r.length,p=[];if(d>0){p[d-1]=1;for(let t=d-2;t>=0;--t)p[t]=p[t+1]*r[t+1]}const f=[];if(l>0){f[l-1]=1;for(let t=l-2;t>=0;--t)f[t]=f[t+1]*u[t+1]}const g=s._152.getArrayFromDType(n,a*l);for(let e=0;e<a;++e){let n=0;for(let r=0;r<d;++r)n+=t[e*d+r]*p[r];for(let t=0;t<l;++t)g[e*l+t]=Math.trunc(n/f[t]),n%=f[t]}return[g,[a,l],u]}
  5923. /**
  5924. * @license
  5925. * Copyright 2021 Google LLC. All Rights Reserved.
  5926. * Licensed under the Apache License, Version 2.0 (the "License");
  5927. * you may not use this file except in compliance with the License.
  5928. * You may obtain a copy of the License at
  5929. *
  5930. * http://www.apache.org/licenses/LICENSE-2.0
  5931. *
  5932. * Unless required by applicable law or agreed to in writing, software
  5933. * distributed under the License is distributed on an "AS IS" BASIS,
  5934. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5935. * See the License for the specific language governing permissions and
  5936. * limitations under the License.
  5937. * =============================================================================
  5938. */function sn(t,e,n,r,i,o=!1,a=0){const l=r.length,u=[e[0],t.length/e[0]],c=u[1],h=l>0?i[l-1]+1:0;if(h<0)throw new Error(s._115.getSparseSegmentReductionNegativeSegmentIdsErrorMessage());const d=e.slice();d[0]=h;const p=d.reduce((t,e)=>t*e,1),f=s._152.getArrayFromDType(n,p);if(0===l)return h>0&&f.fill(a),[f,d];if(h<=0)throw new Error(s._115.getSparseSegmentReductionNegativeSegmentIdsErrorMessage());let g=0,m=1,v=0,b=i[g];for(;;){let e=0;if(m<l){if(b===(e=i[m])){++m;continue}if(b>=e)throw new Error(s._115.getSparseSegmentReductionNonIncreasingSegmentIdsErrorMessage())}if(b<0||b>=h)throw new Error(s._115.getSparseSegmentReductionSegmentIdOutOfRangeErrorMessage(b,h));b>v&&f.fill(a,v*c,b*c);for(let e=g;e<m;++e){const n=r[e];if(n<0||n>=u[0])throw new Error(s._115.getSparseSegmentReductionIndicesOutOfRangeErrorMessage(e,r[e],u[0]));for(let e=0;e<c;e++)f[b*c+e]+=t[n*c+e]}if(o)for(let t=0;t<c;t++)f[b*c+t]/=m-g;if(g=m,v=b+1,b=e,++m>l)break}return v<h&&f.fill(a,v*c,h*c),[f,d]}
  5939. /**
  5940. * @license
  5941. * Copyright 2020 Google LLC. All Rights Reserved.
  5942. * Licensed under the Apache License, Version 2.0 (the License);
  5943. * you may not use this file except in compliance with the License.
  5944. * You may obtain a copy of the License at
  5945. *
  5946. * http://www.apache.org/licenses/LICENSE-2.0
  5947. *
  5948. * Unless required by applicable law or agreed to in writing, software
  5949. * distributed under the License is distributed on an AS IS BASIS,
  5950. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5951. * See the License for the specific language governing permissions and
  5952. * limitations under the License.
  5953. * =============================================================================
  5954. */const an=ke(t=>Math.sqrt(t)),ln=(Oe(s._91,t=>Math.sqrt(t)),s._91,me((t,e)=>{const n=t-e;return n*n}));Te(s._93,ln),s._93;
  5955. /**
  5956. * @license
  5957. * Copyright 2020 Google LLC. All Rights Reserved.
  5958. * Licensed under the Apache License, Version 2.0 (the "License");
  5959. * you may not use this file except in compliance with the License.
  5960. * You may obtain a copy of the License at
  5961. *
  5962. * http://www.apache.org/licenses/LICENSE-2.0
  5963. *
  5964. * Unless required by applicable law or agreed to in writing, software
  5965. * distributed under the License is distributed on an "AS IS" BASIS,
  5966. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5967. * See the License for the specific language governing permissions and
  5968. * limitations under the License.
  5969. * =============================================================================
  5970. */
  5971. function un(t,e,n,r){const i=Object(s._118)(t,e.dtype);for(let t=0;t<i.size;t++){const o=i.indexToLoc(t),s=new Array(o.length);for(let t=0;t<s.length;t++)s[t]=o[t]*n[t]+r[t];i.set(e.get(...s),...o)}return i}
  5972. /**
  5973. * @license
  5974. * Copyright 2021 Google LLC. All Rights Reserved.
  5975. * Licensed under the Apache License, Version 2.0 (the "License");
  5976. * you may not use this file except in compliance with the License.
  5977. * You may obtain a copy of the License at
  5978. *
  5979. * http://www.apache.org/licenses/LICENSE-2.0
  5980. *
  5981. * Unless required by applicable law or agreed to in writing, software
  5982. * distributed under the License is distributed on an "AS IS" BASIS,
  5983. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5984. * See the License for the specific language governing permissions and
  5985. * limitations under the License.
  5986. * =============================================================================
  5987. */class cn{constructor(t,e,n,r,i,o){this.separator=s._152.encodeString(t),this.nGramWidths=e,this.leftPad=s._152.encodeString(n),this.rightPad=s._152.encodeString(r),this.padWidth=i,this.preserveShort=o}getPadWidth(t){return Math.min(this.padWidth<0?t-1:this.padWidth,t-1)}getNumNGrams(t,e){const n=this.getPadWidth(e);return Math.max(0,t+2*n-e+1)}createNGrams(t,e,n,r,i,o){for(let s=0;s<i;++s){const a=this.getPadWidth(o),l=Math.max(0,a-s),u=Math.max(0,a-(i-(s+1))),c=o-(l+u),h=e+(l>0?0:s-a);let d=0;d+=l*this.leftPad.length;for(let e=0;e<c;++e)d+=t[h+e].length;d+=u*this.rightPad.length,d+=(l+u+c-1)*this.separator.length,n[r+s]=new Uint8Array(d);const p=n[r+s];let f=0;const g=t=>t.forEach(t=>p[f++]=t);for(let t=0;t<l;++t)g(this.leftPad),g(this.separator);for(let e=0;e<c-1;++e)g(t[h+e]),g(this.separator);if(c>0){g(t[h+c-1]);for(let t=0;t<u;++t)g(this.separator),g(this.rightPad)}else{for(let t=0;t<u-1;++t)g(this.rightPad),g(this.separator);g(this.rightPad)}}}compute(t,e){const n=t.length,r=e.length;if(r>0){let t=e[0];if(0!==t)throw new Error(`First split value must be 0, got ${t}`);for(let i=1;i<r;++i){let r=e[i]>=t;if(!(r=r&&e[i]<=n))throw new Error(`Invalid split value ${e[i]}, must be in [${t}, ${n}]`);t=e[i]}if(t!==n)throw new Error(`Last split value must be data size. Expected ${n}, got ${t}`)}const i=r-1,o=s._152.getArrayFromDType("int32",r);if(0===n||0===r){const t=new Array(n);for(let t=0;t<=i;++t)o[t]=0;return[t,o]}o[0]=0;for(let t=1;t<=i;++t){const n=e[t]-e[t-1];let r=0;this.nGramWidths.forEach(t=>{r+=this.getNumNGrams(n,t)}),this.preserveShort&&n>0&&0===r&&(r=1),o[t]=o[t-1]+r}const a=new Array(o[i]);for(let n=0;n<i;++n){const r=e[n];let i=o[n];if(this.nGramWidths.forEach(o=>{const s=e[n+1]-e[n],l=this.getNumNGrams(s,o);this.createNGrams(t,r,a,i,l,o),i+=l}),this.preserveShort&&i===o[n]){const o=e[n+1]-e[n];if(0===o)continue;const s=o+2*this.padWidth,l=1;this.createNGrams(t,r,a,i,l,s)}}return[a,o]}}function hn(t,e,n,r,i,o,s,a){return new cn(n,r,i,o,s,a).compute(t,e)}
  5988. /**
  5989. * @license
  5990. * Copyright 2021 Google LLC. All Rights Reserved.
  5991. * Licensed under the Apache License, Version 2.0 (the "License");
  5992. * you may not use this file except in compliance with the License.
  5993. * You may obtain a copy of the License at
  5994. *
  5995. * http://www.apache.org/licenses/LICENSE-2.0
  5996. *
  5997. * Unless required by applicable law or agreed to in writing, software
  5998. * distributed under the License is distributed on an "AS IS" BASIS,
  5999. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  6000. * See the License for the specific language governing permissions and
  6001. * limitations under the License.
  6002. * =============================================================================
  6003. */function dn(t,e,n,r){if(!t.length)return;if(0===e.length){for(let e=0;e<t.length;++e)r.push(t.subarray(e,e+1));return}if(1===e.length){const i=e[0];let o=t.indexOf(i);for(;-1!==o;){const e=t.subarray(0,o);n&&0===e.length||r.push(e),o=(t=t.subarray(o+1)).indexOf(i)}return void(n&&0===t.length||r.push(t))}let i=0;for(let o=0;o<t.length+1;o++)if(o===t.length||-1!==e.indexOf(t[o])){const e=t.subarray(i,o);n&&0===e.length||r.push(e),i=o+1}}function pn(t,e,n){const r=t.length,i=[];let o=0,a=0;const l=new Array(r);for(let s=0;s<r;++s){const r=i.length;dn(t[s],e,n,i);const u=i.length-r;l[s]=u,o+=u,a=Math.max(a,u)}const u=s._152.getArrayFromDType("int32",2*o),c=new Array(o),h=[r,a];let d=0;for(let t=0;t<r;++t)for(let e=0;e<l[t];++e)u[2*d]=t,u[2*d+1]=e,c[d]=i[d],++d;return[u,c,h]}
  6004. /**
  6005. * @license
  6006. * Copyright 2021 Google LLC. All Rights Reserved.
  6007. * Licensed under the Apache License, Version 2.0 (the "License");
  6008. * you may not use this file except in compliance with the License.
  6009. * You may obtain a copy of the License at
  6010. *
  6011. * http://www.apache.org/licenses/LICENSE-2.0
  6012. *
  6013. * Unless required by applicable law or agreed to in writing, software
  6014. * distributed under the License is distributed on an "AS IS" BASIS,
  6015. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  6016. * See the License for the specific language governing permissions and
  6017. * limitations under the License.
  6018. * =============================================================================
  6019. */function fn(t,e){const n=s._152.getArrayFromDType("int32",t.length);for(let r=0;r<t.length;++r)n[r]=s._152.fingerPrint64(t[r]).modulo(e).getLowBitsUnsigned();return n}
  6020. /**
  6021. * @license
  6022. * Copyright 2020 Google LLC. All Rights Reserved.
  6023. * Licensed under the Apache License, Version 2.0 (the "License");
  6024. * you may not use this file except in compliance with the License.
  6025. * You may obtain a copy of the License at
  6026. *
  6027. * http://www.apache.org/licenses/LICENSE-2.0
  6028. *
  6029. * Unless required by applicable law or agreed to in writing, software
  6030. * distributed under the License is distributed on an "AS IS" BASIS,
  6031. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  6032. * See the License for the specific language governing permissions and
  6033. * limitations under the License.
  6034. * =============================================================================
  6035. */const gn=me((t,e)=>t-e),mn=xe((t,e,n,r)=>({real:t-n,imag:e-r}));Te(s._99,gn,mn),s._99;
  6036. /**
  6037. * @license
  6038. * Copyright 2019 Google LLC. All Rights Reserved.
  6039. * Licensed under the Apache License, Version 2.0 (the "License");
  6040. * you may not use this file except in compliance with the License.
  6041. * You may obtain a copy of the License at
  6042. *
  6043. * http://www.apache.org/licenses/LICENSE-2.0
  6044. *
  6045. * Unless required by applicable law or agreed to in writing, software
  6046. * distributed under the License is distributed on an "AS IS" BASIS,
  6047. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  6048. * See the License for the specific language governing permissions and
  6049. * limitations under the License.
  6050. * =============================================================================
  6051. */
  6052. function vn(t,e){const n=new Array(t.rank);for(let r=0;r<n.length;r++)n[r]=t.shape[r]*e[r];const r=Object(s._118)(n,t.dtype);for(let e=0;e<r.values.length;++e){const n=r.indexToLoc(e),i=new Array(t.rank);for(let e=0;e<i.length;e++)i[e]=n[e]%t.shape[e];const o=t.locToIndex(i);r.values[e]=t.values[o]}return r}
  6053. /**
  6054. * @license
  6055. * Copyright 2020 Google LLC. All Rights Reserved.
  6056. * Licensed under the Apache License, Version 2.0 (the "License");
  6057. * you may not use this file except in compliance with the License.
  6058. * You may obtain a copy of the License at
  6059. *
  6060. * http://www.apache.org/licenses/LICENSE-2.0
  6061. *
  6062. * Unless required by applicable law or agreed to in writing, software
  6063. * distributed under the License is distributed on an "AS IS" BASIS,
  6064. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  6065. * See the License for the specific language governing permissions and
  6066. * limitations under the License.
  6067. * =============================================================================
  6068. */const bn=(t,e)=>{const n=e.value-t.value;return 0===n?t.index-e.index:n};function _n(t,e,n=0,r=t.length-1){for(;r>n;){if(r-n>600){const i=r-n+1,o=e-n+1,s=Math.log(i),a=.5*Math.exp(2*s/3),l=.5*Math.sqrt(s*a*(i-a)/i)*Math.sign(o-i/2);_n(t,e,Math.max(n,Math.floor(e-o*a/i+l)),Math.min(r,Math.floor(e+(i-o)*a/i+l)))}const i=t[e];let o=n,a=r;for(s._152.swap(t,n,e),bn(t[r],i)>0&&s._152.swap(t,n,r);o<a;){for(s._152.swap(t,o,a),o++,a--;bn(t[o],i)<0;)o+=1;for(;bn(t[a],i)>0;)a-=1}0===bn(t[n],i)?s._152.swap(t,n,a):(a+=1,s._152.swap(t,a,r)),a<=e&&(n=a+1),e<=a&&(r=a-1)}}function yn(t,e,n,r,i){const o=e[e.length-1],[a,l]=[t.length/o,o],u=s._152.getTypedArrayFromDType(n,a*r),c=s._152.getTypedArrayFromDType("int32",a*r);for(let e=0;e<a;e++){const n=e*l,o=t.subarray(n,n+l);let s=new Array(o.length);o.forEach((t,e)=>s[e]={value:t,index:e}),r<s.length&&(_n(s,r),s=s.slice(0,r)),i&&s.sort(bn);const a=e*r,h=u.subarray(a,a+r),d=c.subarray(a,a+r);for(let t=0;t<r;t++)h[t]=s[t].value,d[t]=s[t].index}const h=e.slice();return h[h.length-1]=r,[Object(s._118)(h,n,u),Object(s._118)(h,"int32",c)]}
  6069. /**
  6070. * @license
  6071. * Copyright 2020 Google LLC. All Rights Reserved.
  6072. * Licensed under the Apache License, Version 2.0 (the "License");
  6073. * you may not use this file except in compliance with the License.
  6074. * You may obtain a copy of the License at
  6075. *
  6076. * http://www.apache.org/licenses/LICENSE-2.0
  6077. *
  6078. * Unless required by applicable law or agreed to in writing, software
  6079. * distributed under the License is distributed on an "AS IS" BASIS,
  6080. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  6081. * See the License for the specific language governing permissions and
  6082. * limitations under the License.
  6083. * =============================================================================
  6084. */function Tn(t,e,n,r){const i=s._152.parseAxisParam(e,n)[0],o=[1,n[0],1];for(let t=0;t<i;t++)o[0]*=n[t];o[1]=n[i];for(let t=i+1;t<n.length;t++)o[2]*=n[t];const a={},l=new Int32Array(n[i]),u=new s._104(o,r,t),c=[],h=1===o[0]&&1===o[2];for(let e=0;e<n[i];e++){let n;if(h)n=t[e].toString();else{const t=[];for(let n=0;n<o[0];n++)for(let r=0;r<o[2];r++)t.push(u.get(n,e,r));n=t.join(",")}if(void 0!==a[n])l[e]=a[n];else{const t=Object.keys(a).length;a[n]=t,l[e]=t,c.push(e)}}const d=o.slice();d[1]=Object.keys(a).length;const p=new s._104(d,r);c.forEach((t,e)=>{for(let n=0;n<o[0];n++)for(let r=0;r<o[2];r++)p.set(u.get(n,t,r),n,e,r)});const f=n.slice();return f[i]=d[1],{outputValues:p.values,outputShape:f,indices:l}}
  6085. /**
  6086. * @license
  6087. * Copyright 2020 Google LLC. All Rights Reserved.
  6088. * Licensed under the Apache License, Version 2.0 (the "License");
  6089. * you may not use this file except in compliance with the License.
  6090. * You may obtain a copy of the License at
  6091. *
  6092. * http://www.apache.org/licenses/LICENSE-2.0
  6093. *
  6094. * Unless required by applicable law or agreed to in writing, software
  6095. * distributed under the License is distributed on an "AS IS" BASIS,
  6096. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  6097. * See the License for the specific language governing permissions and
  6098. * limitations under the License.
  6099. * =============================================================================
  6100. */
  6101. /**
  6102. * @license
  6103. * Copyright 2020 Google LLC. All Rights Reserved.
  6104. * Licensed under the Apache License, Version 2.0 (the "License");
  6105. * you may not use this file except in compliance with the License.
  6106. * You may obtain a copy of the License at
  6107. *
  6108. * http://www.apache.org/licenses/LICENSE-2.0
  6109. *
  6110. * Unless required by applicable law or agreed to in writing, software
  6111. * distributed under the License is distributed on an "AS IS" BASIS,
  6112. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  6113. * See the License for the specific language governing permissions and
  6114. * limitations under the License.
  6115. * =============================================================================
  6116. */const{addImpl:xn,bincountImpl:En,bincountReduceImpl:wn,ceilImpl:Cn,concatImpl:Sn,equalImpl:kn,expImpl:On,expm1Impl:In,floorImpl:Rn,gatherNdImpl:An,gatherV2Impl:Nn,greaterImpl:Dn,greaterEqualImpl:Mn,lessImpl:Ln,lessEqualImpl:Pn,linSpaceImpl:Fn,logImpl:Bn,maxImpl:jn,maximumImpl:$n,minimumImpl:Un,multiplyImpl:Vn,negImpl:Hn,notEqualImpl:Wn,prodImpl:Gn,rangeImpl:zn,rsqrtImpl:Xn,sigmoidImpl:Kn,simpleAbsImpl:Yn,sliceImpl:qn,sparseFillEmptyRowsImpl:Jn,sparseReshapeImpl:Zn,sparseSegmentReductionImpl:Qn,sqrtImpl:tr,stridedSliceImpl:er,stringNGramsImpl:nr,stringSplitImpl:rr,stringToHashBucketFastImpl:ir,subImpl:or,tileImpl:sr,topKImpl:ar,transposeImpl:lr,uniqueImpl:ur}=o;
  6117. /**
  6118. * @license
  6119. * Copyright 2018 Google LLC. All Rights Reserved.
  6120. * Licensed under the Apache License, Version 2.0 (the "License");
  6121. * you may not use this file except in compliance with the License.
  6122. * You may obtain a copy of the License at
  6123. *
  6124. * http://www.apache.org/licenses/LICENSE-2.0
  6125. *
  6126. * Unless required by applicable law or agreed to in writing, software
  6127. * distributed under the License is distributed on an "AS IS" BASIS,
  6128. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  6129. * See the License for the specific language governing permissions and
  6130. * limitations under the License.
  6131. * =============================================================================
  6132. */function cr(t,e){return["x","y","z","w","u","v"].slice(0,e).map(e=>`${t}.${e}`)}function hr(t,e){return 1===e?[t]:cr(t,e)}
  6133. /**
  6134. * @license
  6135. * Copyright 2018 Google LLC. All Rights Reserved.
  6136. * Licensed under the Apache License, Version 2.0 (the "License");
  6137. * you may not use this file except in compliance with the License.
  6138. * You may obtain a copy of the License at
  6139. *
  6140. * http://www.apache.org/licenses/LICENSE-2.0
  6141. *
  6142. * Unless required by applicable law or agreed to in writing, software
  6143. * distributed under the License is distributed on an "AS IS" BASIS,
  6144. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  6145. * See the License for the specific language governing permissions and
  6146. * limitations under the License.
  6147. * =============================================================================
  6148. */
  6149. class dr{constructor(t){if(this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0,this.outputShape=t,this.rank=t.length,this.enableShapeUniforms=Bt(this.outputShape.length),0===this.rank)this.userCode="\n void main() {\n setOutput(vec4(getA(), 0., 0., 0.));\n }\n ";else{const t=hr("rc",this.rank),e=Dt(this.rank),n=this.getOutOfBoundsCondition(t),r=this.getSetup(t),i=this.getOutput(t);this.userCode=`\n void main() {\n ${e} rc = getOutputCoords();\n\n if(${n}) {\n setOutput(vec4(0));\n } else {\n ${r}\n\n setOutput(vec4(${i}));\n }\n }\n `}}getSourceCoordsArr(t){const e=[];for(let n=0;n<=1;n++)for(let r=0;r<=1;r++){let i=`${0===n?"r":"rp1"}, ${0===r?"c":"cp1"}`;for(let e=2;e<this.rank;e++)i=`${t[t.length-1-e]},`+i;e.push(i)}return e}getOutOfBoundsCondition(t){if(1===this.rank)return`rc > ${this.enableShapeUniforms?"outShape":this.outputShape[0]}`;let e="";for(let n=this.rank-2;n<this.rank;n++)e+=`${t[n]} >= ${this.enableShapeUniforms?`outShape[${n}]`:this.outputShape[n]}`,n<this.rank-1&&(e+="||");return e}getSetup(t){if(1===this.rank)return"";const e=t.slice(-2),n=this.enableShapeUniforms?`outShape[${this.rank} - 1]`:this.outputShape[this.rank-1],r=this.enableShapeUniforms?`outShape[${this.rank} - 2]`:this.outputShape[this.rank-2];return`\n int r = ${e[0]};\n int c = ${e[1]};\n int rp1 = r + 1;\n int cp1 = c + 1;\n\n bool cEdge = cp1 >= ${n};\n bool rEdge = rp1 >= ${r};\n `}getOutput(t){const e=this.getSourceCoordsArr(t);if(1===this.rank){return`getA(rc), (rc + 1 >= ${this.enableShapeUniforms?"outShape":this.outputShape[0]} ? 0. : getA(rc + 1)), 0, 0`}return`getA(${e[0]}),\n cEdge ? 0. : getA(${e[1]}),\n rEdge ? 0. : getA(${e[2]}),\n rEdge || cEdge ? 0. : getA(${e[3]})`}}
  6150. /**
  6151. * @license
  6152. * Copyright 2018 Google LLC. All Rights Reserved.
  6153. * Licensed under the Apache License, Version 2.0 (the "License");
  6154. * you may not use this file except in compliance with the License.
  6155. * You may obtain a copy of the License at
  6156. *
  6157. * http://www.apache.org/licenses/LICENSE-2.0
  6158. *
  6159. * Unless required by applicable law or agreed to in writing, software
  6160. * distributed under the License is distributed on an "AS IS" BASIS,
  6161. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  6162. * See the License for the specific language governing permissions and
  6163. * limitations under the License.
  6164. * =============================================================================
  6165. */class pr{constructor(t,e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"inputShape",type:"ivec3"}],this.outputShape=t,this.enableShapeUniforms=Bt(this.outputShape.length);let n="";for(let t=0;t<4;t++){let e="thisRC = rc;";t%2==1&&(e+="thisRC.z += 1;"),t>1&&(e+="thisRC.y += 1;"),n+=`\n ${e}\n ${t>0?"if(thisRC.y < rows && thisRC.z < cols){":""}\n int flatIndex = getFlatIndex(thisRC);\n\n ivec3 inputRC = inputCoordsFromReshapedOutCoords(flatIndex);\n vec2 inputRCInnerDims = vec2(float(inputRC.y),float(inputRC.z));\n\n result[${t}] =\n getChannel(getA(inputRC.x, inputRC.y, inputRC.z), inputRCInnerDims);\n ${t>0?"}":""}\n `}var r,i;
  6166. /**
  6167. * @license
  6168. * Copyright 2017 Google LLC. All Rights Reserved.
  6169. * Licensed under the Apache License, Version 2.0 (the "License");
  6170. * you may not use this file except in compliance with the License.
  6171. * You may obtain a copy of the License at
  6172. *
  6173. * http://www.apache.org/licenses/LICENSE-2.0
  6174. *
  6175. * Unless required by applicable law or agreed to in writing, software
  6176. * distributed under the License is distributed on an "AS IS" BASIS,
  6177. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  6178. * See the License for the specific language governing permissions and
  6179. * limitations under the License.
  6180. * =============================================================================
  6181. */this.userCode=`\n ${r=e,i=this.enableShapeUniforms,`\n ivec3 inputCoordsFromReshapedOutCoords(int index) {\n ${i?_t(["r","c","d"],"inputShape"):vt(["r","c","d"],r)}\n return ivec3(r, c, d);\n }\n `}\n ${this.enableShapeUniforms?"\n int getFlatIndex(ivec3 coords) {\n return coords.x * outShapeStrides[0] + coords.y * outShapeStrides[1] + coords.z;\n }\n":yt(t)}\n\n void main() {\n ivec3 rc = getOutputCoords();\n\n vec4 result = vec4(0.);\n\n ivec3 thisRC;\n int rows = ${this.enableShapeUniforms?"outShape[1]":t[1]};\n int cols = ${this.enableShapeUniforms?"outShape[2]":t[2]};\n\n ${n}\n\n setOutput(result);\n }\n `}}class fr{constructor(t){this.gpgpu=t,this.numUsedTextures=0,this.numFreeTextures=0,this._numBytesAllocated=0,this._numBytesFree=0,this.freeTextures={},this.logEnabled=!1,this.usedTextures={}}acquireTexture(t,e,n){const r=mr(e,n),i=vr(t,r,n);i in this.freeTextures||(this.freeTextures[i]=[]),i in this.usedTextures||(this.usedTextures[i]=[]);const o=gr(t,r,this.gpgpu.gl,this.gpgpu.textureConfig,n);if(this.freeTextures[i].length>0){this.numFreeTextures--,this.numUsedTextures++,this._numBytesFree-=o,this.log();const t=this.freeTextures[i].shift();return this.usedTextures[i].push(t),t}let s;return r===p.PACKED_2X2_FLOAT32?s=this.gpgpu.createPackedMatrixTexture(t[0],t[1]):r===p.PACKED_2X2_FLOAT16?s=this.gpgpu.createFloat16PackedMatrixTexture(t[0],t[1]):r===p.UNPACKED_FLOAT32?s=this.gpgpu.createFloat32MatrixTexture(t[0],t[1]):r===p.UNPACKED_FLOAT16?s=this.gpgpu.createFloat16MatrixTexture(t[0],t[1]):r===p.PACKED_4X1_UNSIGNED_BYTE&&(s=this.gpgpu.createUnsignedBytesMatrixTexture(t[0],t[1])),this.usedTextures[i].push(s),this.numUsedTextures++,this._numBytesAllocated+=o,this.log(),s}releaseTexture(t,e,n,r){if(null==this.freeTextures)return;const i=mr(n,r),o=vr(e,i,r);o in this.freeTextures||(this.freeTextures[o]=[]);const a=gr(e,i,this.gpgpu.gl,this.gpgpu.textureConfig,r),l=Object(s._127)().get("WEBGL_DELETE_TEXTURE_THRESHOLD");-1!==l&&this._numBytesAllocated>l?(this.gpgpu.deleteMatrixTexture(t.texture),this._numBytesAllocated-=a):(this.freeTextures[o].push(t),this.numFreeTextures++,this._numBytesFree+=a),this.numUsedTextures--;const u=this.usedTextures[o],c=u.indexOf(t);if(c<0)throw new Error("Cannot release a texture that was never provided by this texture manager");u.splice(c,1),this.log()}log(){if(!this.logEnabled)return;const t=this.numFreeTextures+this.numUsedTextures;console.log("Free/Used",`${this.numFreeTextures} / ${this.numUsedTextures}`,`(${t})`);const e=this._numBytesFree/this._numBytesAllocated;console.log(`Bytes allocated: ${this._numBytesAllocated}`),console.log(`Bytes unused: ${this._numBytesFree} (${Math.round(100*e)}%)`)}get numBytesAllocated(){return this._numBytesAllocated}get numBytesFree(){return this._numBytesFree}getNumUsedTextures(){return this.numUsedTextures}getNumFreeTextures(){return this.numFreeTextures}dispose(){if(null!=this.freeTextures){for(const t in this.freeTextures)this.freeTextures[t].forEach(t=>{this.gpgpu.deleteMatrixTexture(t.texture)});for(const t in this.usedTextures)this.usedTextures[t].forEach(t=>{this.gpgpu.deleteMatrixTexture(t.texture)});this.freeTextures=null,this.usedTextures=null,this.numUsedTextures=0,this.numFreeTextures=0,this._numBytesAllocated=0,this._numBytesFree=0}}}function gr(t,e,n,r,i){const o=function(t,e){switch(t){case p.PACKED_2X2_FLOAT32:return ee(e);case p.PACKED_2X2_FLOAT16:return re(e);case p.UNPACKED_FLOAT32:return Yt(e);case p.UNPACKED_FLOAT16:return Jt(e);case p.PACKED_4X1_UNSIGNED_BYTE:return Qt(e);default:throw new Error(`Unknown physical texture type ${t}`)}}(e,r);let s;if(i){const[e,n]=m(t[0],t[1]);s=e*n}else{const[e,n]=f(t[0],t[1]);s=e*n}return s*function(t,e){const n=t;if(e===n.R32F)return 4;if(e===n.R16F)return 2;if(e===n.RGBA32F)return 16;if(e===t.RGBA)return 16;if(e===n.RGBA16F)return 8;if(e===n.RGBA8)return 4;throw new Error(`Unknown internal format ${e}`)}(n,o)}function mr(t,e){if(t===d.UPLOAD)return p.PACKED_2X2_FLOAT32;if(t===d.RENDER||null==t)return function(t){return Object(s._127)().getBool("WEBGL_RENDER_FLOAT32_ENABLED")?t?p.PACKED_2X2_FLOAT32:p.UNPACKED_FLOAT32:t?p.PACKED_2X2_FLOAT16:p.UNPACKED_FLOAT16}(e);if(t===d.DOWNLOAD||t===d.PIXELS)return p.PACKED_4X1_UNSIGNED_BYTE;throw new Error(`Unknown logical texture type ${t}`)}function vr(t,e,n){return`${t[0]}_${t[1]}_${e}_${n}`}
  6182. /**
  6183. * @license
  6184. * Copyright 2017 Google LLC. All Rights Reserved.
  6185. * Licensed under the Apache License, Version 2.0 (the "License");
  6186. * you may not use this file except in compliance with the License.
  6187. * You may obtain a copy of the License at
  6188. *
  6189. * http://www.apache.org/licenses/LICENSE-2.0
  6190. *
  6191. * Unless required by applicable law or agreed to in writing, software
  6192. * distributed under the License is distributed on an "AS IS" BASIS,
  6193. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  6194. * See the License for the specific language governing permissions and
  6195. * limitations under the License.
  6196. * =============================================================================
  6197. */class br{constructor(t,e){this.variableNames=["A"],this.outputShape=t,this.enableShapeUniforms=Bt(this.outputShape.length),this.userCode=`\n float unaryOperation(float x) {\n ${e}\n }\n\n void main() {\n float x = getAAtOutCoords();\n float y = unaryOperation(x);\n\n setOutput(y);\n }\n `}}const _r="if (isnan(x)) return x;",yr="return x;",Tr="return abs(x);";const xr="return (x >= 0.0) ? x : (exp(x) - 1.0);",Er=_r+"\n return (x < 0.0) ? 0.0 : x;\n",wr=_r+"\n return (x < 0.0) ? 0.0 : min(6.0, x);\n",Cr="return x;",Sr="return 1.0 / (1.0 + exp(-1.0 * x));",kr="return x;",Or="\n vec4 result;\n\n result.r = (x.r >= 0.0) ? x.r : (exp(x.r) - 1.0);\n result.g = (x.g >= 0.0) ? x.g : (exp(x.g) - 1.0);\n result.b = (x.b >= 0.0) ? x.b : (exp(x.b) - 1.0);\n result.a = (x.a >= 0.0) ? x.a : (exp(x.a) - 1.0);\n\n return result;\n",Ir="\n vec4 result = x * vec4(greaterThanEqual(x, vec4(0.0)));\n bvec4 isNaN = isnan(x);\n\n result.r = isNaN.r ? x.r : result.r;\n result.g = isNaN.g ? x.g : result.g;\n result.b = isNaN.b ? x.b : result.b;\n result.a = isNaN.a ? x.a : result.a;\n\n return result;\n",Rr="\n vec4 result = min(x, vec4(6.)) * vec4(greaterThanEqual(x, vec4(0.0)));\n bvec4 isNaN = isnan(x);\n\n result.r = isNaN.r ? x.r : result.r;\n result.g = isNaN.g ? x.g : result.g;\n result.b = isNaN.b ? x.b : result.b;\n result.a = isNaN.a ? x.a : result.a;\n\n return result;\n",Ar="return 1.0 / (1.0 + exp(-1.0 * x));";class Nr{constructor(t,e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=t,this.enableShapeUniforms=Bt(this.outputShape.length),this.userCode=`\n vec4 unaryOperation(vec4 x) {\n ${e}\n }\n\n void main() {\n vec4 x = getAAtOutCoords();\n vec4 y = unaryOperation(x);\n\n setOutput(y);\n }\n `}}
  6198. /**
  6199. * @license
  6200. * Copyright 2018 Google LLC. All Rights Reserved.
  6201. * Licensed under the Apache License, Version 2.0 (the "License");
  6202. * you may not use this file except in compliance with the License.
  6203. * You may obtain a copy of the License at
  6204. *
  6205. * http://www.apache.org/licenses/LICENSE-2.0
  6206. *
  6207. * Unless required by applicable law or agreed to in writing, software
  6208. * distributed under the License is distributed on an "AS IS" BASIS,
  6209. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  6210. * See the License for the specific language governing permissions and
  6211. * limitations under the License.
  6212. * =============================================================================
  6213. */class Dr{constructor(t){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!1,this.outputShape=t,this.enableShapeUniforms=Bt(this.outputShape.length);const e=t.length,n=hr("rc",e),r=Dt(e),i=function(t,e){if(1===t)return"rc";let n="";for(let r=0;r<t;r++)n+=e[r],r<t-1&&(n+=",");return n}(e,n),o=n.slice(-2),s=e<=1?"rc":`vec2(${o.join(",")})`;this.userCode=`\n void main() {\n ${r} rc = getOutputCoords();\n vec4 packedInput = getA(${i});\n\n setOutput(getChannel(packedInput, ${s}));\n }\n `}}
  6214. /**
  6215. * @license
  6216. * Copyright 2017 Google LLC. All Rights Reserved.
  6217. * Licensed under the Apache License, Version 2.0 (the "License");
  6218. * you may not use this file except in compliance with the License.
  6219. * You may obtain a copy of the License at
  6220. *
  6221. * http://www.apache.org/licenses/LICENSE-2.0
  6222. *
  6223. * Unless required by applicable law or agreed to in writing, software
  6224. * distributed under the License is distributed on an "AS IS" BASIS,
  6225. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  6226. * See the License for the specific language governing permissions and
  6227. * limitations under the License.
  6228. * =============================================================================
  6229. */const Mr=s._133.whereImpl,Lr=1e-7,Pr=1e-4,Fr={};const Br=Object(s._127)().getNumber("CPU_HANDOFF_SIZE_THRESHOLD"),jr=600;class $r extends s._21{constructor(t){if(super(),this.pendingRead=new WeakMap,this.pendingDisposal=new WeakSet,this.dataRefCount=new WeakMap,this.numBytesInGPU=0,this.uploadWaitMs=0,this.downloadWaitMs=0,this.lastGlFlushTime=0,this.warnedAboutMemory=!1,this.pendingDeletes=0,this.disposed=!1,!Object(s._127)().getBool("HAS_WEBGL"))throw new Error("WebGL is not supported on this device");let e;if(null!=t){if(t instanceof pe)e=t;else{const n=c(Object(s._127)().getNumber("WEBGL_VERSION"),t);e=new pe(n)}this.binaryCache={},this.gpgpuCreatedLocally=!1}else{const t=c(Object(s._127)().getNumber("WEBGL_VERSION"));e=new pe(t),this.binaryCache=(n=Object(s._127)().getNumber("WEBGL_VERSION"))in Fr?Fr[n]:(Fr[n]={},Fr[n]),this.gpgpuCreatedLocally=!0}var n;this.gpgpu=e,this.canvas=this.gpgpu.gl.canvas,this.textureManager=new fr(this.gpgpu),this.numMBBeforeWarning=null==Object(s._127)().global.screen?1024:Object(s._127)().global.screen.height*Object(s._127)().global.screen.width*window.devicePixelRatio*jr/1024/1024,this.texData=new s.M(this,Object(s._126)())}nextDataId(){return $r.nextDataId++}numDataIds(){return this.texData.numDataIds()-this.pendingDeletes}write(t,e,n){if((Object(s._127)().getBool("WEBGL_CHECK_NUMERICAL_PROBLEMS")||Object(s._127)().getBool("DEBUG"))&&this.checkNumericalProblems(t),"complex64"===n&&null!=t)throw new Error("Cannot write to a complex64 dtype. Please use tf.complex(real, imag).");const r={id:this.nextDataId()};return this.texData.set(r,{shape:e,dtype:n,values:t,usage:d.UPLOAD,refCount:1}),r}refCount(t){if(this.texData.has(t)){return this.texData.get(t).refCount}return 0}incRef(t){this.texData.get(t).refCount++}decRef(t){if(this.texData.has(t)){this.texData.get(t).refCount--}}move(t,e,n,r,i){if(Object(s._127)().getBool("DEBUG")&&this.checkNumericalProblems(e),"complex64"===r)throw new Error("Cannot write to a complex64 dtype. Please use tf.complex(real, imag).");this.texData.set(t,{shape:n,dtype:r,values:e,usage:d.UPLOAD,refCount:i})}disposeIntermediateTensorInfo(t){this.disposeData(t.dataId)}readSync(t){const e=this.texData.get(t),{values:n,dtype:r,complexTensorInfos:i,slice:o,shape:a,isPacked:l}=e;if(null!=o){let e;e=l?new Nr(a,Cr):new br(a,Cr);const n=this.runWebGLProgram(e,[{dataId:t,shape:a,dtype:r}],r),i=this.readSync(n.dataId);return this.disposeIntermediateTensorInfo(n),i}if(null!=n)return this.convertAndCacheOnCPU(t);if("string"===r)return n;const u=null!=this.activeTimers;let c,h;if(u&&(c=s._152.now()),"complex64"===r){const t=this.readSync(i.real.dataId),e=this.readSync(i.imag.dataId);h=s._115.mergeRealAndImagArrays(t,e)}else h=this.getValuesFromTexture(t);return u&&(this.downloadWaitMs+=s._152.now()-c),this.convertAndCacheOnCPU(t,h)}async read(t){if(this.pendingRead.has(t)){const e=this.pendingRead.get(t);return new Promise(t=>e.push(t))}const e=this.texData.get(t),{values:n,shape:r,slice:i,dtype:o,complexTensorInfos:a,isPacked:l}=e;if(null!=i){let e;e=l?new Nr(r,Cr):new br(r,Cr);const n=this.runWebGLProgram(e,[{dataId:t,shape:r,dtype:o}],o),i=this.read(n.dataId);return this.disposeIntermediateTensorInfo(n),i}if(null!=n)return this.convertAndCacheOnCPU(t);if(Object(s._127)().getBool("DEBUG")&&!Object(s._127)().getBool("WEBGL_DOWNLOAD_FLOAT_ENABLED")&&2===Object(s._127)().getNumber("WEBGL_VERSION"))throw new Error("tensor.data() with WEBGL_DOWNLOAD_FLOAT_ENABLED=false and WEBGL_VERSION=2 not yet supported.");let u,c,h=null;if("complex64"!==o&&Object(s._127)().get("WEBGL_BUFFER_SUPPORTED")){u=this.decode(t);const e=this.texData.get(u.dataId);h=this.gpgpu.createBufferFromTexture(e.texture.texture,...g(r))}if(this.pendingRead.set(t,[]),"complex64"!==o&&await this.gpgpu.createAndWaitForFence(),"complex64"===o){const t=await Promise.all([this.read(a.real.dataId),this.read(a.imag.dataId)]),e=t[0],n=t[1];c=s._115.mergeRealAndImagArrays(e,n)}else if(null==h)c=this.getValuesFromTexture(t);else{const t=s._152.sizeFromShape(r);c=this.gpgpu.downloadFloat32MatrixFromBuffer(h,t)}if(null!=u&&this.disposeIntermediateTensorInfo(u),null!=h){const t=this.gpgpu.gl;b(t,()=>t.deleteBuffer(h))}const d=this.convertAndCacheOnCPU(t,c),p=this.pendingRead.get(t);return this.pendingRead.delete(t),p.forEach(t=>t(d)),this.pendingDisposal.has(t)&&(this.pendingDisposal.delete(t),this.disposeData(t)&&Object(s._126)().removeDataId(t,this),this.pendingDeletes--),d}readToGPU(t,e={}){const n=this.texData.get(t),{values:r,shape:i,slice:o,dtype:a,isPacked:l,texture:u}=n;if("complex64"===a)throw new Error("Does not support reading texture for complex64 dtype.");if(null!=o){let n;n=l?new Nr(i,Cr):new br(i,Cr);const r=this.runWebGLProgram(n,[{dataId:t,shape:i,dtype:a}],a),o=this.readToGPU(r,e);return this.disposeIntermediateTensorInfo(r),o}if(null==u)throw null!=r?new Error("Data is not on GPU but on CPU."):new Error("There is no data on GPU or CPU.");const c=this.decode(t,e.customTexShape),h=Object(s._126)().makeTensorFromDataId(c.dataId,c.shape,c.dtype),d=this.texData.get(c.dataId);return Object.assign({tensorRef:h},d.texture)}bufferSync(t){const e=this.readSync(t.dataId);let n=e;if("string"===t.dtype)try{n=e.map(t=>s._152.decodeString(t))}catch(t){throw new Error("Failed to decode encoded string bytes into utf-8")}return Object(s._118)(t.shape,t.dtype,n)}checkNumericalProblems(t){if(null!=t)for(let e=0;e<t.length;e++){const n=t[e];if(!T(n)){if(Object(s._127)().getBool("WEBGL_RENDER_FLOAT32_CAPABLE"))throw Error(`The value ${n} cannot be represented with your `+"current settings. Consider enabling float32 rendering: 'tf.env().set('WEBGL_RENDER_FLOAT32_ENABLED', true);'");throw Error(`The value ${n} cannot be represented on this device.`)}}}getValuesFromTexture(t){const{shape:e,dtype:n,isPacked:r}=this.texData.get(t),i=s._152.sizeFromShape(e);if(Object(s._127)().getBool("WEBGL_DOWNLOAD_FLOAT_ENABLED")){const n=this.decode(t),r=this.texData.get(n.dataId),o=this.gpgpu.downloadMatrixFromPackedTexture(r.texture.texture,...g(e)).subarray(0,i);return this.disposeIntermediateTensorInfo(n),o}const o=Object(s._127)().getBool("WEBGL_PACK")&&!0===r,a=o?J(e):e,l=o?new Vt(a):new Ut(a),u=this.runWebGLProgram(l,[{shape:a,dtype:n,dataId:t}],"float32"),c=this.texData.get(u.dataId),h=this.gpgpu.downloadByteEncodedFloatMatrixFromOutputTexture(c.texture.texture,c.texShape[0],c.texShape[1]).subarray(0,i);return this.disposeIntermediateTensorInfo(u),h}timerAvailable(){return Object(s._127)().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0}time(t){const e=this.activeTimers,n=[];let r=!1;null==this.programTimersStack?(this.programTimersStack=n,r=!0):this.activeTimers.push(n),this.activeTimers=n,t();const i=s._152.flatten(this.activeTimers.map(t=>t.query)).filter(t=>null!=t),o=s._152.flatten(this.activeTimers.map(t=>t.name)).filter(t=>null!=t);this.activeTimers=e,r&&(this.programTimersStack=null);const a={uploadWaitMs:this.uploadWaitMs,downloadWaitMs:this.downloadWaitMs,kernelMs:null,wallMs:null};return(async()=>{if(Object(s._127)().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0){const t=await Promise.all(i);a.kernelMs=s._152.sum(t),a.getExtraProfileInfo=(()=>t.map((t,e)=>({name:o[e],ms:t})).map(t=>`${t.name}: ${t.ms}`).join(", "))}else a.kernelMs={error:"WebGL query timers are not supported in this environment."};return this.uploadWaitMs=0,this.downloadWaitMs=0,a})()}memory(){return{unreliable:!1,numBytesInGPU:this.numBytesInGPU,numBytesInGPUAllocated:this.textureManager.numBytesAllocated,numBytesInGPUFree:this.textureManager.numBytesFree}}startTimer(){return Object(s._127)().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0?this.gpgpu.beginQuery():{startMs:s._152.now(),endMs:null}}endTimer(t){return Object(s._127)().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0?(this.gpgpu.endQuery(),t):(t.endMs=s._152.now(),t)}async getQueryTime(t){if(Object(s._127)().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0)return this.gpgpu.waitForQueryAndGetTime(t);const e=t;return e.endMs-e.startMs}disposeData(t,e=!1){if(this.pendingDisposal.has(t))return!1;if(!this.texData.has(t))return!0;if(e?this.texData.get(t).refCount=0:this.texData.get(t).refCount--,!e&&this.texData.get(t).refCount>0)return!1;if(this.pendingRead.has(t))return this.pendingDisposal.add(t),this.pendingDeletes++,!1;this.releaseGPUData(t);const{complexTensorInfos:n}=this.texData.get(t);return null!=n&&(this.disposeData(n.real.dataId,e),this.disposeData(n.imag.dataId,e)),this.texData.delete(t),!0}releaseGPUData(t){const{texture:e,dtype:n,texShape:r,usage:i,isPacked:o,slice:s}=this.texData.get(t),a=s&&s.origDataId||t,l=this.dataRefCount.get(a);l>1?this.dataRefCount.set(a,l-1):(this.dataRefCount.delete(a),null!=e&&(this.numBytesInGPU-=this.computeBytes(r,n),this.textureManager.releaseTexture(e,r,i,o)));const u=this.texData.get(t);u.texture=null,u.texShape=null,u.isPacked=!1,u.slice=null}getTexture(t){return this.uploadToGPU(t),this.texData.get(t).texture.texture}getDataInfo(t){return this.texData.get(t)}shouldExecuteOnCPU(t,e=Br){return Object(s._127)().getBool("WEBGL_CPU_FORWARD")&&t.every(t=>null==this.texData.get(t.dataId).texture&&s._152.sizeFromShape(t.shape)<e)}getGPGPUContext(){return this.gpgpu}where(t){s._115.warn("tf.where() in webgl locks the UI thread. Call tf.whereAsync() instead");const e=t.dataSync();return Mr(t.shape,e)}packedUnaryOp(t,e,n){const r=new Nr(t.shape,e),i=this.compileAndRun(r,[t],n);return Object(s._126)().makeTensorFromDataId(i.dataId,i.shape,i.dtype)}abs(t){if(this.shouldExecuteOnCPU([t])&&"complex64"!==t.dtype){const e=Yn(this.texData.get(t.dataId).values);return this.makeOutput(t.shape,t.dtype,e)}if(Object(s._127)().getBool("WEBGL_PACK_UNARY_OPERATIONS"))return this.packedUnaryOp(t,Tr,t.dtype);const e=new br(t.shape,Tr),n=this.compileAndRun(e,[t]);return Object(s._126)().makeTensorFromDataId(n.dataId,n.shape,n.dtype)}makeTensorInfo(t,e,n){let r;if("string"===e&&null!=n&&n.length>0&&s._152.isString(n[0])){const i=n.map(t=>s._152.encodeString(t));r=this.write(i,t,e)}else r=this.write(n,t,e);return this.texData.get(r).usage=null,{dataId:r,shape:t,dtype:e}}makeOutput(t,e,n){const{dataId:r}=this.makeTensorInfo(t,e,n);return Object(s._126)().makeTensorFromDataId(r,t,e,this)}unpackTensor(t){const e=new Dr(t.shape);return this.runWebGLProgram(e,[t],t.dtype)}packTensor(t){const e=new dr(t.shape);return this.runWebGLProgram(e,[t],t.dtype,null,!0)}packedReshape(t,e){const n=[Y(t.shape),...q(t.shape)],r={dtype:t.dtype,shape:n,dataId:t.dataId},i=[Y(e),...q(e)],o=new pr(i,n),s=[n],a=this.runWebGLProgram(o,[r],t.dtype,s,!0);return{dataId:a.dataId,shape:e,dtype:a.dtype}}decode(t,e){const n=this.texData.get(t),{isPacked:r,shape:i,dtype:o}=n;if(null!=e){const t=s._152.sizeFromShape(i),n=e[0]*e[1]*4;s._152.assert(t<=n,()=>"customTexShape is too small. Row * Column * 4 should be equal or larger than the size of the tensor data.")}const a=J(i);let l;l=r?new $t(a):new jt(a);const u=[null!=e?e:g(a)];return{dtype:o,shape:i,dataId:this.runWebGLProgram(l,[{shape:a,dtype:o,dataId:t}],o,u,!0,e).dataId}}runWebGLProgram(t,e,n,r,i=!1,o){const a=this.makeTensorInfo(t.outputShape,n),l=this.texData.get(a.dataId);if(t.packedOutput&&(l.isPacked=!0),t.outPackingScheme===h.DENSE){const e=null!=o?o:g(t.outputShape);l.texShape=e.map(t=>2*t)}if(null!=t.outTexUsage&&(l.usage=t.outTexUsage),0===s._152.sizeFromShape(a.shape))return l.values=s._152.getTypedArrayFromDType(a.dtype,0),a;const u=[],c=e.map(e=>{if("complex64"===e.dtype)throw new Error("GPGPUProgram does not support complex64 input. For complex64 dtypes, please separate the program into real and imaginary parts.");let n=this.texData.get(e.dataId);if(null==n.texture){if(!t.packedInputs&&s._152.sizeFromShape(e.shape)<=Object(s._127)().getNumber("WEBGL_SIZE_UPLOAD_UNIFORM"))return{shape:e.shape,texData:null,isUniform:!0,uniformValues:n.values};t.packedInputs&&(n.isPacked=!0,n.shape=e.shape)}if(this.uploadToGPU(e.dataId),!!n.isPacked!=!!t.packedInputs)e=n.isPacked?this.unpackTensor(e):this.packTensor(e),u.push(e),n=this.texData.get(e.dataId);else if(n.isPacked&&!tt(n.shape,e.shape)){const t=e,r=e.shape;e.shape=n.shape,e=this.packedReshape(e,r),u.push(e),n=this.texData.get(e.dataId),t.shape=r}return{shape:e.shape,texData:n,isUniform:!1}});this.uploadToGPU(a.dataId);const d={shape:a.shape,texData:l,isUniform:!1},p=function(t,e,n){let r="";e.concat(n).forEach(e=>{const i=null!=e.texData&&null!=e.texData.slice&&e.texData.slice.flatOffset>0;if(t.enableShapeUniforms&&!e.isUniform){const o=e.texData.texShape,{useSqueezeShape:a,uniformShape:l,keptDims:u}=Mt(t.packedInputs,e.shape,o);let c="",h="",d="";if(1===l.length&&t.packedInputs){const t=[Math.ceil(o[0]/2),Math.ceil(o[1]/2)];c=`${t[0]>1}_${t[1]>1}`}else if(2!==l.length||t.packedInputs){if(l.length>2&&!t.packedInputs){const t=s._152.computeStrides(l);d=`${t[0]===o[1]}_${t[t.length-1]===o[1]}`}}else h=`${l[0]>1}_${l[1]>1}`;const p=e.shape.length,f=2===l.length&&s._152.arraysEqual(e.shape,o),g=1===s._152.sizeFromShape(e.shape),m=s._115.getBroadcastDims(e.shape,n.shape),v=!t.packedInputs&&p===n.shape.length&&s._152.arraysEqual(o,n.texData.texShape),b=t.packedInputs||l.length>2?"":`${o[0]>1}_${o[1]>1}`;r+=`${p}_${v}_${a?u:""}_${l.length}_${g}_${m}_${f}_${c}_${h}_${d}_${b}_${i}`}else{const t=e.isUniform?"uniform":e.texData.texShape;r+=`${e.shape}_${t}_${i}`}});const i=t.userCode;let o=t.constructor.name;return o+="_"+r+"_"+i+`${Object(s._127)().getNumber("WEBGL_VERSION")}`}(t,c,d),f=this.getAndSaveBinary(p,()=>(function(t,e,n,r){const i=n.map((t,n)=>{const r={logicalShape:t.shape,texShape:t.isUniform?null:t.texData.texShape,isUniform:t.isUniform,isPacked:!t.isUniform&&t.texData.isPacked,flatOffset:null};return null!=t.texData&&null!=t.texData.slice&&t.texData.slice.flatOffset>0&&(r.flatOffset=t.texData.slice.flatOffset),{name:e.variableNames[n],shapeInfo:r}}),o=i.map(t=>t.shapeInfo),a={logicalShape:r.shape,texShape:r.texData.texShape,isUniform:!1,isPacked:r.texData.isPacked,flatOffset:null},l=Et(i,a,e),u=C(t.gl,l),c=t.createProgram(u);let h=null;const d=t.getUniformLocation(c,"NAN",!1);1===Object(s._127)().getNumber("WEBGL_VERSION")&&(h=t.getUniformLocation(c,"INFINITY",!1));const p={},f={},g={};for(let n=0;n<e.variableNames.length;n++){const r=e.variableNames[n];p[r]=t.getUniformLocation(c,r,!1),p[`offset${r}`]=t.getUniformLocation(c,`offset${r}`,!1),e.enableShapeUniforms&&(f[`${r}Shape`]=t.getUniformLocation(c,`${r}Shape`,!1),g[`${r}TexShape`]=t.getUniformLocation(c,`${r}TexShape`,!1))}let m,v,b;e.enableShapeUniforms&&(m=t.getUniformLocation(c,"outShape",!1),b=t.getUniformLocation(c,"outShapeStrides",!1),v=t.getUniformLocation(c,"outTexShape",!1));const _=[];return e.customUniforms&&e.customUniforms.forEach((e,n)=>{_[n]=t.getUniformLocation(c,e.name,!1)}),{program:e,fragmentShader:u,source:l,webGLProgram:c,uniformLocations:p,customUniformLocations:_,inShapeInfos:o,outShapeInfo:a,infLoc:h,nanLoc:d,inShapesLocations:f,inTexShapesLocations:g,outShapeLocation:m,outShapeStridesLocation:b,outTexShapeLocation:v}})(this.gpgpu,t,c,d)),m=null!=this.activeTimers;let v;m&&(v=this.startTimer()),function(t,e,n,r,i){e.program.enableShapeUniforms||(Ft(e.inShapeInfos,n),Ft([e.outShapeInfo],[r]));const o=r.texData.texture,a=r.texData.texShape;r.texData.isPacked?t.setOutputPackedMatrixTexture(o.texture,a[0],a[1]):t.setOutputMatrixTexture(o.texture,a[0],a[1]),t.setProgram(e.webGLProgram),1===Object(s._127)().getNumber("WEBGL_VERSION")&&null!==e.infLoc&&t.gl.uniform1f(e.infLoc,1/0),null!==e.nanLoc&&t.gl.uniform1f(e.nanLoc,NaN),n.forEach((n,r)=>{const i=e.program.variableNames[r],o=e.uniformLocations[i],a=e.uniformLocations[`offset${i}`],l=e.inShapesLocations[`${i}Shape`],u=e.inTexShapesLocations[`${i}TexShape`];if(l){const{uniformShape:r}=Mt(e.program.packedInputs,n.shape,n.texData.texShape);switch(r.length){case 1:t.gl.uniform1iv(l,new Int32Array(r));break;case 2:t.gl.uniform2iv(l,new Int32Array(r));break;case 3:t.gl.uniform3iv(l,new Int32Array(r));break;case 4:t.gl.uniform4iv(l,new Int32Array(r))}}if(u&&t.gl.uniform2i(u,n.texData.texShape[0],n.texData.texShape[1]),null!=o)if(n.isUniform)if(s._152.sizeFromShape(n.shape)<2)t.gl.uniform1f(o,n.uniformValues[0]);else{let e=n.uniformValues;e instanceof Float32Array||(e=new Float32Array(e)),t.gl.uniform1fv(o,e)}else null!=n.texData.slice&&null!=a&&t.gl.uniform1i(a,n.texData.slice.flatOffset),t.setInputMatrixTexture(n.texData.texture.texture,o,r)});const l=e.outShapeLocation;if(l)switch(r.shape.length){case 1:t.gl.uniform1iv(l,new Int32Array(r.shape));break;case 2:t.gl.uniform2iv(l,new Int32Array(r.shape));break;case 3:t.gl.uniform3iv(l,new Int32Array(r.shape));break;case 4:t.gl.uniform4iv(l,new Int32Array(r.shape))}if(e.outShapeStridesLocation){const n=s._152.computeStrides(r.shape);switch(r.shape.length){case 2:t.gl.uniform1iv(e.outShapeStridesLocation,new Int32Array(n));break;case 3:t.gl.uniform2iv(e.outShapeStridesLocation,new Int32Array(n));break;case 4:t.gl.uniform3iv(e.outShapeStridesLocation,new Int32Array(n))}}e.outTexShapeLocation&&t.gl.uniform2i(e.outTexShapeLocation,r.texData.texShape[0],r.texData.texShape[1]),e.program.customUniforms&&i&&e.program.customUniforms.forEach((n,r)=>{const o=e.customUniformLocations[r],s=i[r];if("float"===n.type)t.gl.uniform1fv(o,s);else if("vec2"===n.type)t.gl.uniform2fv(o,s);else if("vec3"===n.type)t.gl.uniform3fv(o,s);else if("vec4"===n.type)t.gl.uniform4fv(o,s);else if("int"===n.type)t.gl.uniform1iv(o,s);else if("ivec2"===n.type)t.gl.uniform2iv(o,s);else if("ivec3"===n.type)t.gl.uniform3iv(o,s);else{if("ivec4"!==n.type)throw Error(`uniform type ${n.type} is not supported yet.`);t.gl.uniform4iv(o,s)}}),t.executeProgram()}(this.gpgpu,f,c,d,r),u.forEach(t=>this.disposeIntermediateTensorInfo(t)),m&&(v=this.endTimer(v),this.activeTimers.push({name:t.constructor.name,query:this.getQueryTime(v)}));const b=Object(s._127)().get("WEBGL_FLUSH_THRESHOLD");if(b>0){const t=s._152.now();t-this.lastGlFlushTime>b&&(this.gpgpu.gl.flush(),this.lastGlFlushTime=t)}if(!Object(s._127)().getBool("WEBGL_LAZILY_UNPACK")&&l.isPacked&&!1===i){const t=this.unpackTensor(a);return this.disposeIntermediateTensorInfo(a),t}return a}compileAndRun(t,e,n,r,i=!1){return n=n||e[0].dtype,this.runWebGLProgram(t,e,n,r,i)}getAndSaveBinary(t,e){return t in this.binaryCache||(this.binaryCache[t]=e()),this.binaryCache[t]}getTextureManager(){return this.textureManager}dispose(){if(!this.disposed){if(!Object(s._127)().getBool("IS_TEST")){Object.keys(this.binaryCache).forEach(t=>{this.gpgpu.deleteProgram(this.binaryCache[t].webGLProgram),delete this.binaryCache[t]})}this.textureManager.dispose(),null!=this.canvas&&"undefined"!=typeof HTMLCanvasElement&&this.canvas instanceof HTMLCanvasElement?this.canvas.remove():this.canvas=null,this.gpgpuCreatedLocally&&(this.gpgpu.program=null,this.gpgpu.dispose()),this.disposed=!0}}floatPrecision(){return null==this.floatPrecisionValue&&(this.floatPrecisionValue=Object(s._149)(()=>{if(!Object(s._127)().get("WEBGL_RENDER_FLOAT32_ENABLED")){const t=Object(s._127)().getBool("DEBUG");Object(s._127)().set("DEBUG",!1);const e=this.abs(Object(s._138)(1e-8)).dataSync()[0];if(Object(s._127)().set("DEBUG",t),e>0)return 32}return 16})),this.floatPrecisionValue}epsilon(){return 32===this.floatPrecision()?Lr:Pr}uploadToGPU(t){const e=this.texData.get(t),{shape:n,dtype:r,values:i,texture:o,usage:a,isPacked:l}=e;if(null!=o)return;const u=null!=this.activeTimers;let c;u&&(c=s._152.now());let h=e.texShape;if(null==h&&(h=Z(n,l),e.texShape=h),null!=i){const t=J(n);let o,a=h[1],p=h[0];const f=i instanceof Uint8Array||i instanceof Uint8ClampedArray;!l&&f||([a,p]=m(h[0],h[1])),o=l?new Wt(t,f):new Ht(t,f);const g=f?[p,a]:h,v=this.makeTensorInfo(g,r),b=this.texData.get(v.dataId);b.usage=f?d.PIXELS:d.UPLOAD,b.texShape=g,this.gpgpu.uploadDenseMatrixToTexture(this.getTexture(v.dataId),a,p,i);const _=[[p,a]],y=!0,T=this.runWebGLProgram(o,[v],r,_,y),x=this.texData.get(T.dataId);e.texture=x.texture,e.texShape=x.texShape,e.isPacked=x.isPacked,e.usage=x.usage,this.disposeIntermediateTensorInfo(v),this.texData.delete(T.dataId),e.values=null,u&&(this.uploadWaitMs+=s._152.now()-c)}else{const t=this.acquireTexture(h,a,r,l);e.texture=t}}convertAndCacheOnCPU(t,e){const n=this.texData.get(t),{dtype:r}=n;return this.releaseGPUData(t),null!=e&&(n.values=function(t,e){if("float32"===e||"complex64"===e)return t;if("int32"===e||"bool"===e){const n="int32"===e?new Int32Array(t.length):new Uint8Array(t.length);for(let e=0;e<n.length;++e)n[e]=Math.round(t[e]);return n}throw new Error(`Unknown dtype ${e}`)}
  6230. /** @license See the LICENSE file. */(e,r)),n.values}acquireTexture(t,e,n,r){if(this.numBytesInGPU+=this.computeBytes(t,n),!this.warnedAboutMemory&&this.numBytesInGPU>1024*this.numMBBeforeWarning*1024){const t=(this.numBytesInGPU/1024/1024).toFixed(2);this.warnedAboutMemory=!0,console.warn(`High memory usage in GPU: ${t} MB, `+"most likely due to a memory leak")}return this.textureManager.acquireTexture(t,e,r)}computeBytes(t,e){return t[0]*t[1]*s._152.bytesPerElement(e)}}$r.nextDataId=0;
  6231. /**
  6232. * @license
  6233. * Copyright 2019 Google LLC. All Rights Reserved.
  6234. * Licensed under the Apache License, Version 2.0 (the "License");
  6235. * you may not use this file except in compliance with the License.
  6236. * You may obtain a copy of the License at
  6237. *
  6238. * http://www.apache.org/licenses/LICENSE-2.0
  6239. *
  6240. * Unless required by applicable law or agreed to in writing, software
  6241. * distributed under the License is distributed on an "AS IS" BASIS,
  6242. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  6243. * See the License for the specific language governing permissions and
  6244. * limitations under the License.
  6245. * =============================================================================
  6246. */
  6247. function Ur(){Object(s._127)().set("WEBGL_FORCE_F16_TEXTURES",!0)}
  6248. /**
  6249. * @license
  6250. * Copyright 2020 Google Inc. All Rights Reserved.
  6251. * Licensed under the Apache License, Version 2.0 (the "License");
  6252. * you may not use this file except in compliance with the License.
  6253. * You may obtain a copy of the License at
  6254. *
  6255. * http://www.apache.org/licenses/LICENSE-2.0
  6256. *
  6257. * Unless required by applicable law or agreed to in writing, software
  6258. * distributed under the License is distributed on an "AS IS" BASIS,
  6259. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  6260. * See the License for the specific language governing permissions and
  6261. * limitations under the License.
  6262. * =============================================================================
  6263. */s._123.isBrowser()&&Object(s._135)("webgl",()=>new $r,2);const Vr={forceHalfFloat:Ur};
  6264. /**
  6265. * @license
  6266. * Copyright 2017 Google LLC. All Rights Reserved.
  6267. * Licensed under the Apache License, Version 2.0 (the "License");
  6268. * you may not use this file except in compliance with the License.
  6269. * You may obtain a copy of the License at
  6270. *
  6271. * http://www.apache.org/licenses/LICENSE-2.0
  6272. *
  6273. * Unless required by applicable law or agreed to in writing, software
  6274. * distributed under the License is distributed on an "AS IS" BASIS,
  6275. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  6276. * See the License for the specific language governing permissions and
  6277. * limitations under the License.
  6278. * =============================================================================
  6279. */class Hr{constructor(t,e,n){this.variableNames=["A","B"],this.outputShape=s._115.assertAndGetBroadcastShape(e,n),this.enableShapeUniforms=Bt(this.outputShape.length),this.userCode=`\n float binaryOperation(float a, float b) {\n ${t}\n }\n\n void main() {\n float a = getAAtOutCoords();\n float b = getBAtOutCoords();\n setOutput(binaryOperation(a, b));\n }\n `}}
  6280. /**
  6281. * @license
  6282. * Copyright 2018 Google LLC. All Rights Reserved.
  6283. * Licensed under the Apache License, Version 2.0 (the "License");
  6284. * you may not use this file except in compliance with the License.
  6285. * You may obtain a copy of the License at
  6286. *
  6287. * http://www.apache.org/licenses/LICENSE-2.0
  6288. *
  6289. * Unless required by applicable law or agreed to in writing, software
  6290. * distributed under the License is distributed on an "AS IS" BASIS,
  6291. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  6292. * See the License for the specific language governing permissions and
  6293. * limitations under the License.
  6294. * =============================================================================
  6295. */class Wr{constructor(t,e,n,r=!1){this.variableNames=["A","B"],this.supportsBroadcasting=!0,this.packedInputs=!0,this.packedOutput=!0,this.outputShape=s._115.assertAndGetBroadcastShape(e,n);const i=this.outputShape.length;this.enableShapeUniforms=Bt(i);let o="";if(r)if(0===i||1===s._152.sizeFromShape(this.outputShape))o="\n result.y = 0.;\n result.z = 0.;\n result.w = 0.;\n ";else{if(o=`\n ${Dt(i)} coords = getOutputCoords();\n `,1===i)this.enableShapeUniforms?o+="\n result.y = (coords + 1) >= outShape ? 0. : result.y;\n result.z = 0.;\n result.w = 0.;\n ":o+=`\n result.y = (coords + 1) >= ${this.outputShape[0]} ? 0. : result.y;\n result.z = 0.;\n result.w = 0.;\n `;else{const t=hr("coords",i);this.enableShapeUniforms?o+=`\n bool nextRowOutOfBounds =\n (${t[i-2]} + 1) >= outShape[${i} - 2];\n bool nextColOutOfBounds =\n (${t[i-1]} + 1) >= outShape[${i} - 1];\n result.y = nextColOutOfBounds ? 0. : result.y;\n result.z = nextRowOutOfBounds ? 0. : result.z;\n result.w = nextColOutOfBounds || nextRowOutOfBounds ? 0. : result.w;\n `:o+=`\n bool nextRowOutOfBounds =\n (${t[i-2]} + 1) >= ${this.outputShape[i-2]};\n bool nextColOutOfBounds =\n (${t[i-1]} + 1) >= ${this.outputShape[i-1]};\n result.y = nextColOutOfBounds ? 0. : result.y;\n result.z = nextRowOutOfBounds ? 0. : result.z;\n result.w = nextColOutOfBounds || nextRowOutOfBounds ? 0. : result.w;\n `}}this.userCode=`\n vec4 binaryOperation(vec4 a, vec4 b) {\n ${t}\n }\n\n void main() {\n vec4 a = getAAtOutCoords();\n vec4 b = getBAtOutCoords();\n\n vec4 result = binaryOperation(a, b);\n ${o}\n\n setOutput(result);\n }\n `}}
  6296. /**
  6297. * @license
  6298. * Copyright 2020 Google LLC. All Rights Reserved.
  6299. * Licensed under the Apache License, Version 2.0 (the "License");
  6300. * you may not use this file except in compliance with the License.
  6301. * You may obtain a copy of the License at
  6302. *
  6303. * http://www.apache.org/licenses/LICENSE-2.0
  6304. *
  6305. * Unless required by applicable law or agreed to in writing, software
  6306. * distributed under the License is distributed on an "AS IS" BASIS,
  6307. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  6308. * See the License for the specific language governing permissions and
  6309. * limitations under the License.
  6310. * =============================================================================
  6311. */function Gr(t){const{inputs:e,backend:n}=t,{x:r}=e;return n.incRef(r.dataId),{dataId:r.dataId,shape:r.shape,dtype:r.dtype}}const zr={kernelName:s._16,backendName:"webgl",kernelFunc:Gr};
  6312. /**
  6313. * @license
  6314. * Copyright 2020 Google LLC. All Rights Reserved.
  6315. * Licensed under the Apache License, Version 2.0 (the "License");
  6316. * you may not use this file except in compliance with the License.
  6317. * You may obtain a copy of the License at
  6318. *
  6319. * http://www.apache.org/licenses/LICENSE-2.0
  6320. *
  6321. * Unless required by applicable law or agreed to in writing, software
  6322. * distributed under the License is distributed on an "AS IS" BASIS,
  6323. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  6324. * See the License for the specific language governing permissions and
  6325. * limitations under the License.
  6326. * =============================================================================
  6327. */function Xr(t){const{inputs:e,backend:n}=t,{real:r,imag:i}=e,o=n.makeTensorInfo(r.shape,"complex64"),s=n.texData.get(o.dataId),a=Gr({inputs:{x:r},backend:n}),l=Gr({inputs:{x:i},backend:n});return s.complexTensorInfos={real:a,imag:l},o}const Kr={kernelName:s.z,backendName:"webgl",kernelFunc:Xr},Yr="return (a < 0.) ? b * a : a;",qr="\n vec4 aLessThanZero = vec4(lessThan(a, vec4(0.)));\n return (aLessThanZero * (b * a)) + ((vec4(1.0) - aLessThanZero) * a);\n";
  6328. /**
  6329. * @license
  6330. * Copyright 2020 Google LLC. All Rights Reserved.
  6331. * Licensed under the Apache License, Version 2.0 (the "License");
  6332. * you may not use this file except in compliance with the License.
  6333. * You may obtain a copy of the License at
  6334. *
  6335. * http://www.apache.org/licenses/LICENSE-2.0
  6336. *
  6337. * Unless required by applicable law or agreed to in writing, software
  6338. * distributed under the License is distributed on an "AS IS" BASIS,
  6339. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  6340. * See the License for the specific language governing permissions and
  6341. * limitations under the License.
  6342. * =============================================================================
  6343. */const Jr={kernelName:s._24,backendName:"webgl",kernelFunc:function(t){const{inputs:e,backend:n,attrs:r}=t,{x:i}=e,{alpha:o}=r,a=n.makeTensorInfo([],"float32",s._152.createScalarValue(o,"float32")),l=Object(s._127)().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new Wr(qr,i.shape,a.shape):new Hr(Yr,i.shape,a.shape),u=n.runWebGLProgram(l,[i,a],"float32");return n.disposeIntermediateTensorInfo(a),u}},Zr="return (a < 0.) ? b * a : a;",Qr="\n vec4 aLessThanZero = vec4(lessThan(a, vec4(0.)));\n return (aLessThanZero * (b * a)) + ((vec4(1.0) - aLessThanZero) * a);\n";
  6344. /**
  6345. * @license
  6346. * Copyright 2020 Google LLC. All Rights Reserved.
  6347. * Licensed under the Apache License, Version 2.0 (the "License");
  6348. * you may not use this file except in compliance with the License.
  6349. * You may obtain a copy of the License at
  6350. *
  6351. * http://www.apache.org/licenses/LICENSE-2.0
  6352. *
  6353. * Unless required by applicable law or agreed to in writing, software
  6354. * distributed under the License is distributed on an "AS IS" BASIS,
  6355. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  6356. * See the License for the specific language governing permissions and
  6357. * limitations under the License.
  6358. * =============================================================================
  6359. */const ti={kernelName:s._57,backendName:"webgl",kernelFunc:function(t){const{inputs:e,backend:n}=t,{x:r,alpha:i}=e,o=Object(s._127)().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new Wr(Qr,r.shape,i.shape):new Hr(Zr,r.shape,i.shape);return n.runWebGLProgram(o,[r,i],"float32")}};
  6360. /**
  6361. * @license
  6362. * Copyright 2020 Google LLC. All Rights Reserved.
  6363. * Licensed under the Apache License, Version 2.0 (the "License");
  6364. * you may not use this file except in compliance with the License.
  6365. * You may obtain a copy of the License at
  6366. *
  6367. * http://www.apache.org/licenses/LICENSE-2.0
  6368. *
  6369. * Unless required by applicable law or agreed to in writing, software
  6370. * distributed under the License is distributed on an "AS IS" BASIS,
  6371. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  6372. * See the License for the specific language governing permissions and
  6373. * limitations under the License.
  6374. * =============================================================================
  6375. */function ei({opSnippet:t,packedOpSnippet:e,cpuKernelImpl:n,dtype:r}){return({inputs:i,backend:o})=>{const{x:a}=i,l=o,u=r||a.dtype;if(l.shouldExecuteOnCPU([a])&&null!=n){const t=l.texData.get(a.dataId),e=n(t.values,u);return l.makeTensorInfo(a.shape,u,e)}let c;return c=Object(s._127)().getBool("WEBGL_PACK_UNARY_OPERATIONS")&&null!=e?new Nr(a.shape,e):new br(a.shape,t),l.runWebGLProgram(c,[a],u)}}function ni({opSnippet:t,packedOpSnippet:e,checkOutOfBounds:n=!1,supportsComplex:r=!1,cpuKernelImpl:i,dtype:o}){return({inputs:a,backend:l})=>{const{a:u,b:c}=a,h=l;if(r&&"complex64"===u.dtype){const e=h.texData.get(u.dataId),n=h.texData.get(c.dataId),[r,i]=[[e.complexTensorInfos.real,n.complexTensorInfos.real],[e.complexTensorInfos.imag,n.complexTensorInfos.imag]].map(e=>{const[n,r]=e,i={dataId:n.dataId,dtype:n.dtype,shape:u.shape},o={dataId:r.dataId,dtype:r.dtype,shape:c.shape},a=new Hr(t,u.shape,c.shape);return h.runWebGLProgram(a,[i,o],Object(s._151)(n.dtype,r.dtype))}),o=Xr({inputs:{real:r,imag:i},backend:h});return h.disposeIntermediateTensorInfo(r),h.disposeIntermediateTensorInfo(i),o}const d=o||Object(s._151)(u.dtype,c.dtype);if(("string"===u.dtype||"string"===c.dtype||h.shouldExecuteOnCPU([u,c]))&&null!=i){const t=h.texData.get(u.dataId).values,e=h.texData.get(c.dataId).values,n="string"===u.dtype?s._115.fromUint8ToStringArray(t):t,r="string"===u.dtype?s._115.fromUint8ToStringArray(e):e,[o,a]=i(u.shape,c.shape,n,r,d),l=h.makeTensorInfo(a,d);return h.texData.get(l.dataId).values=o,l}let p;return p=Object(s._127)().getBool("WEBGL_PACK_BINARY_OPERATIONS")&&null!=e?new Wr(e,u.shape,c.shape,n):new Hr(t,u.shape,c.shape),h.runWebGLProgram(p,[u,c],d)}}function ri(t,e=!1){if("linear"===t)return e?kr:yr;if("relu"===t)return e?Ir:Er;if("elu"===t)return e?Or:xr;if("relu6"===t)return e?Rr:wr;if("prelu"===t)return e?Qr:Zr;if("leakyrelu"===t)return e?qr:Yr;if("sigmoid"===t)return e?Ar:Sr;throw new Error(`Activation ${t} has not been implemented for the WebGL backend.`)}
  6376. /**
  6377. * @license
  6378. * Copyright 2018 Google LLC. All Rights Reserved.
  6379. * Licensed under the Apache License, Version 2.0 (the "License");
  6380. * you may not use this file except in compliance with the License.
  6381. * You may obtain a copy of the License at
  6382. *
  6383. * http://www.apache.org/licenses/LICENSE-2.0
  6384. *
  6385. * Unless required by applicable law or agreed to in writing, software
  6386. * distributed under the License is distributed on an "AS IS" BASIS,
  6387. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  6388. * See the License for the specific language governing permissions and
  6389. * limitations under the License.
  6390. * =============================================================================
  6391. */class ii{constructor(t,e,n,r=!1,i=!1,o=!1,s=null,a=!1,l=!1){this.variableNames=["matrixA","matrixB"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=n,this.enableShapeUniforms=Bt(this.outputShape.length);const u=r?t[1]:t[2],c=Math.ceil(u/2),h=r?"i * 2, rc.y":"rc.y, i * 2",d=i?"rc.z, i * 2":"i * 2, rc.z",p=r?["a.xxyy","a.zzww"]:["a.xxzz","a.yyww"],f=i?["b.xzxz","b.ywyw"]:["b.xyxy","b.zwzw"];let g="",m="";s&&(g=a?`vec4 activation(vec4 a) {\n vec4 b = getPreluActivationWeightsAtOutCoords();\n ${s}\n }`:l?`vec4 activation(vec4 a) {\n vec4 b = getLeakyreluAlphaAtOutCoords();\n ${s}\n }`:`vec4 activation(vec4 x) {\n ${s}\n }`,m="result = activation(result);");const v=o?"result += getBiasAtOutCoords();":"";o&&this.variableNames.push("bias"),a&&this.variableNames.push("preluActivationWeights"),l&&this.variableNames.push("leakyreluAlpha");let b="rc.x",_="rc.x";t[0]<e[0]?b=`int(min(float(rc.x), ${t[0]-1}.))`:e[0]<t[0]&&(_=`int(min(float(rc.x), ${e[0]-1}.))`),this.userCode=`\n ${g}\n // Don't use uniform for sharedDimensionPacked for performance.\n const float sharedDimension = ${c}.0;\n\n vec4 dot2x2ARowBCol(ivec3 rc) {\n vec4 result = vec4(0);\n for (int i = 0; i < ${c}; i++) {\n int batchA = ${b};\n int batchB = ${_};\n vec4 a = getMatrixA(batchA, ${h});\n vec4 b = getMatrixB(batchB, ${d});\n\n // These swizzled products need to be separately added.\n // See: https://github.com/tensorflow/tfjs/issues/1735\n result += (${p[0]} * ${f[0]});\n result += (${p[1]} * ${f[1]});\n }\n return result;\n }\n\n void main() {\n ivec3 rc = getOutputCoords();\n vec4 result = dot2x2ARowBCol(rc);\n\n ${v}\n\n ${m}\n\n setOutput(result);\n }\n `}}
  6392. /**
  6393. * @license
  6394. * Copyright 2018 Google LLC. All Rights Reserved.
  6395. * Licensed under the Apache License, Version 2.0 (the "License");
  6396. * you may not use this file except in compliance with the License.
  6397. * You may obtain a copy of the License at
  6398. *
  6399. * http://www.apache.org/licenses/LICENSE-2.0
  6400. *
  6401. * Unless required by applicable law or agreed to in writing, software
  6402. * distributed under the License is distributed on an "AS IS" BASIS,
  6403. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  6404. * See the License for the specific language governing permissions and
  6405. * limitations under the License.
  6406. * =============================================================================
  6407. */const oi={REAL:"return areal * breal - aimag * bimag;",IMAG:"return areal * bimag + aimag * breal;"};class si{constructor(t,e,n){this.variableNames=["AReal","AImag","BReal","BImag"],this.outputShape=s._115.assertAndGetBroadcastShape(e,n),this.userCode=`\n float binaryOpComplex(\n float areal, float aimag, float breal, float bimag) {\n ${t}\n }\n\n void main() {\n float areal = getARealAtOutCoords();\n float aimag = getAImagAtOutCoords();\n float breal = getBRealAtOutCoords();\n float bimag = getBImagAtOutCoords();\n setOutput(binaryOpComplex(areal, aimag, breal, bimag));\n }\n `}}
  6408. /**
  6409. * @license
  6410. * Copyright 2020 Google LLC. All Rights Reserved.
  6411. * Licensed under the Apache License, Version 2.0 (the "License");
  6412. * you may not use this file except in compliance with the License.
  6413. * You may obtain a copy of the License at
  6414. *
  6415. * http://www.apache.org/licenses/LICENSE-2.0
  6416. *
  6417. * Unless required by applicable law or agreed to in writing, software
  6418. * distributed under the License is distributed on an "AS IS" BASIS,
  6419. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  6420. * See the License for the specific language governing permissions and
  6421. * limitations under the License.
  6422. * =============================================================================
  6423. */const ai="return a * b;";function li(t){const{inputs:e,backend:n}=t,{a:r,b:i}=e,o=s._115.upcastType(r.dtype,i.dtype);if("complex64"===r.dtype){const t=n.texData.get(r.dataId),e=n.texData.get(i.dataId),o=new si(oi.REAL,r.shape,i.shape),s=new si(oi.IMAG,r.shape,i.shape),a=[{dataId:t.complexTensorInfos.real.dataId,dtype:t.complexTensorInfos.real.dtype,shape:r.shape},{dataId:t.complexTensorInfos.imag.dataId,dtype:t.complexTensorInfos.imag.dtype,shape:r.shape},{dataId:e.complexTensorInfos.real.dataId,dtype:e.complexTensorInfos.real.dtype,shape:i.shape},{dataId:e.complexTensorInfos.imag.dataId,dtype:e.complexTensorInfos.imag.dtype,shape:i.shape}],l=n.runWebGLProgram(o,a,"float32"),u=n.runWebGLProgram(s,a,"float32"),c=Xr({inputs:{real:l,imag:u},backend:n});return n.disposeIntermediateTensorInfo(l),n.disposeIntermediateTensorInfo(u),c}if(n.shouldExecuteOnCPU([r,i])){const t=n.texData.get(r.dataId),e=n.texData.get(i.dataId),[s,a]=Vn(r.shape,i.shape,t.values,e.values,o),l=n.makeTensorInfo(a,o);return n.texData.get(l.dataId).values=s,l}let a;return a=Object(s._127)().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new Wr(ai,r.shape,i.shape):new Hr(ai,r.shape,i.shape),n.runWebGLProgram(a,[r,i],o)}const ui={kernelName:s._46,backendName:"webgl",kernelFunc:li};
  6424. /**
  6425. * @license
  6426. * Copyright 2020 Google LLC. All Rights Reserved.
  6427. * Licensed under the Apache License, Version 2.0 (the "License");
  6428. * you may not use this file except in compliance with the License.
  6429. * You may obtain a copy of the License at
  6430. *
  6431. * http://www.apache.org/licenses/LICENSE-2.0
  6432. *
  6433. * Unless required by applicable law or agreed to in writing, software
  6434. * distributed under the License is distributed on an "AS IS" BASIS,
  6435. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  6436. * See the License for the specific language governing permissions and
  6437. * limitations under the License.
  6438. * =============================================================================
  6439. */
  6440. /**
  6441. * @license
  6442. * Copyright 2020 Google LLC. All Rights Reserved.
  6443. * Licensed under the Apache License, Version 2.0 (the "License");
  6444. * you may not use this file except in compliance with the License.
  6445. * You may obtain a copy of the License at
  6446. *
  6447. * http://www.apache.org/licenses/LICENSE-2.0
  6448. *
  6449. * Unless required by applicable law or agreed to in writing, software
  6450. * distributed under the License is distributed on an "AS IS" BASIS,
  6451. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  6452. * See the License for the specific language governing permissions and
  6453. * limitations under the License.
  6454. * =============================================================================
  6455. */
  6456. function ci(t){const{inputs:e,backend:n,attrs:r}=t,{x:i}=e,{shape:o}=r,a=n,l=s._152.sizeFromShape(i.shape),u=s._152.inferFromImplicitShape(o,l),c=s._152.sizeFromShape(u);s._152.assert(l===c,()=>`The new shape (${u}) has ${c} elements and the old `+`shape (${i.shape}) has ${l} elements. The new shape and old `+"shape must have the same number of elements.");const h=a.texData.get(i.dataId);return!h.isPacked||tt(i.shape,u)||null!==h.texture&&tt(h.shape,u)?(a.incRef(i.dataId),{dataId:i.dataId,shape:u,dtype:i.dtype}):function(t,e,n){const r=[Y(t.shape),...q(t.shape)],i={dtype:t.dtype,shape:r,dataId:t.dataId},o=[Y(e),...q(e)],s=new pr(o,r),a=[r],l=n.runWebGLProgram(s,[i],t.dtype,a,!0);return{dataId:l.dataId,shape:e,dtype:l.dtype}}(i,u,a)}const hi={kernelName:s._65,backendName:"webgl",kernelFunc:ci};
  6457. /**
  6458. * @license
  6459. * Copyright 2020 Google LLC. All Rights Reserved.
  6460. * Licensed under the Apache License, Version 2.0 (the "License");
  6461. * you may not use this file except in compliance with the License.
  6462. * You may obtain a copy of the License at
  6463. *
  6464. * http://www.apache.org/licenses/LICENSE-2.0
  6465. *
  6466. * Unless required by applicable law or agreed to in writing, software
  6467. * distributed under the License is distributed on an "AS IS" BASIS,
  6468. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  6469. * See the License for the specific language governing permissions and
  6470. * limitations under the License.
  6471. * =============================================================================
  6472. */class di{constructor(t,e){this.variableNames=["x"];const{windowSize:n,batchSize:r,inSize:i,outSize:o}=t;this.outputShape=[r,o];const a=4*Math.floor(n/4),l=n%4;let u="sumValue += dot(values, ones);";if(null!=e){const t=1/e;u=`sumValue += dot(values * ${s._152.isInt(t)?t.toPrecision(2):t}, ones);`}let c="";i%n>0&&(c=`\n if (inIdx < 0 || inIdx >= ${i}) {\n return 0.0;\n }\n `),this.userCode=`\n const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n float getValue(int batch, int inIdx) {\n ${c}\n return getX(batch, inIdx);\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = outIdx * ${n};\n\n float sumValue = 0.0;\n\n for (int i = 0; i < ${a}; i += 4) {\n int inIdx = inOffset + i;\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n getValue(batch, inIdx + 3)\n );\n\n ${u}\n }\n\n int inIdx = inOffset + ${a};\n if (${1===l}) {\n vec4 values = vec4(getValue(batch, inIdx), 0.0, 0.0, 0.0);\n\n ${u}\n } else if (${2===l}) {\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1), 0.0, 0.0);\n\n ${u}\n } else if (${3===l}) {\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2), 0.0);\n\n ${u}\n }\n setOutput(sumValue);\n }\n `}}
  6473. /**
  6474. * @license
  6475. * Copyright 2017 Google LLC. All Rights Reserved.
  6476. * Licensed under the Apache License, Version 2.0 (the "License");
  6477. * you may not use this file except in compliance with the License.
  6478. * You may obtain a copy of the License at
  6479. *
  6480. * http://www.apache.org/licenses/LICENSE-2.0
  6481. *
  6482. * Unless required by applicable law or agreed to in writing, software
  6483. * distributed under the License is distributed on an "AS IS" BASIS,
  6484. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  6485. * See the License for the specific language governing permissions and
  6486. * limitations under the License.
  6487. * =============================================================================
  6488. */class pi{constructor(t,e){this.variableNames=["x"];const{windowSize:n,batchSize:r,inSize:i,outSize:o}=t;this.outputShape=[r,o];let s="0.0",a="";"prod"===e?s="1.0":"min"===e?(s="1.0 / 1e-20",a="min"):"max"===e&&(s="-1.0 / 1e-20",a="max");let l=`${e}(${e}(${e}(`+"minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])";"sum"===e?l="sumValue":"prod"===e?l="prodValue":"all"===e?l="allValue":"any"===e&&(l="anyValue");const u=4*Math.floor(n/4),c=n%4;let h=`\n if (${"sum"===e}) {\n sumValue += dot(values, ones);\n } else if (${"prod"===e}) {\n vec2 tmp = vec2(values[0], values[1]) * vec2(values[2], values[3]);\n prodValue *= tmp[0] * tmp[1];\n } else {\n minMaxValue = ${a}(values, minMaxValue);\n if (${"min"===e} || ${"max"===e}) {\n minMaxValue = ${a}(values, minMaxValue);\n bvec4 isNaN = isnan(values);\n if (isNaN.r || isNaN.g || isNaN.b || isNaN.a) {\n minMaxValue = vec4(NAN);\n }\n }\n }\n `,d="vec4";"all"===e?(s="1.0",h="\n bool reducedAllValue = all(values);\n float floatedReducedAllValue = float(reducedAllValue);\n allValue = float(allValue >= 1.0 && floatedReducedAllValue >= 1.0);\n ",d="bvec4"):"any"===e&&(s="0.0",h="\n bool reducedAnyValue = any(values);\n float floatedReducedAnyValue = float(reducedAnyValue);\n anyValue = float(anyValue >= 1.0 || floatedReducedAnyValue >= 1.0);\n ",d="bvec4");let p="";i%n>0&&(p=`\n if (inIdx < 0 || inIdx >= ${i}) {\n return initializationValue;\n }\n `),this.userCode=`\n const float initializationValue = ${s};\n const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n float getValue(int batch, int inIdx) {\n ${p}\n return getX(batch, inIdx);\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = outIdx * ${n};\n\n vec4 minMaxValue = vec4(${s});\n float prodValue = 1.0;\n float sumValue = 0.0;\n float allValue = 1.0;\n float anyValue = 0.0;\n\n for (int i = 0; i < ${u}; i += 4) {\n int inIdx = inOffset + i;\n ${d} values = ${d}(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n getValue(batch, inIdx + 3)\n );\n\n ${h}\n }\n\n int inIdx = inOffset + ${u};\n if (${1===c}) {\n ${d} values = ${d}(\n getValue(batch, inIdx),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n ${h}\n } else if (${2===c}) {\n ${d} values = ${d}(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n initializationValue,\n initializationValue\n );\n\n ${h}\n } else if (${3===c}) {\n ${d} values = ${d}(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n initializationValue\n );\n\n ${h}\n }\n setOutput(${l});\n }\n `}}
  6489. /**
  6490. * @license
  6491. * Copyright 2020 Google LLC. All Rights Reserved.
  6492. * Licensed under the Apache License, Version 2.0 (the "License");
  6493. * you may not use this file except in compliance with the License.
  6494. * You may obtain a copy of the License at
  6495. *
  6496. * http://www.apache.org/licenses/LICENSE-2.0
  6497. *
  6498. * Unless required by applicable law or agreed to in writing, software
  6499. * distributed under the License is distributed on an "AS IS" BASIS,
  6500. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  6501. * See the License for the specific language governing permissions and
  6502. * limitations under the License.
  6503. * =============================================================================
  6504. */function fi(t,e,n,r){const i=function(t){const e=[];for(;0===e.length||1!==e[e.length-1].outSize;){const n=e.length?e[e.length-1].outSize:t[1],r=s._115.computeOptimalWindowSize(n);e.push({inSize:n,windowSize:r,outSize:Math.ceil(n/r)})}return e}(t.shape);let o=t;for(let s=0;s<i.length;s++){const{inSize:a,windowSize:l,outSize:u}=i[s];let c,h;c="mean"===n?0===s?new di({windowSize:l,inSize:a,batchSize:t.shape[0],outSize:u},a):new di({windowSize:l,inSize:a,batchSize:t.shape[0],outSize:u}):new pi({windowSize:l,inSize:a,batchSize:t.shape[0],outSize:u},n),h=o,o=r.runWebGLProgram(c,[o],e),h.dataId!==t.dataId&&r.disposeIntermediateTensorInfo(h)}return o}
  6505. /**
  6506. * @license
  6507. * Copyright 2017 Google LLC. All Rights Reserved.
  6508. * Licensed under the Apache License, Version 2.0 (the "License");
  6509. * you may not use this file except in compliance with the License.
  6510. * You may obtain a copy of the License at
  6511. *
  6512. * http://www.apache.org/licenses/LICENSE-2.0
  6513. *
  6514. * Unless required by applicable law or agreed to in writing, software
  6515. * distributed under the License is distributed on an "AS IS" BASIS,
  6516. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  6517. * See the License for the specific language governing permissions and
  6518. * limitations under the License.
  6519. * =============================================================================
  6520. */class gi{constructor(t,e){this.variableNames=["A"];const n=new Array(t.length);for(let r=0;r<n.length;r++)n[r]=t[e[r]];this.outputShape=n,this.rank=n.length;const r=Dt(this.rank),i=function(t){const e=t.length;if(e>6)throw Error(`Transpose for rank ${e} is not yet supported`);const n=["resRC.x","resRC.y","resRC.z","resRC.w","resRC.u","resRC.v"],r=new Array(e);for(let e=0;e<t.length;e++)r[t[e]]=n[e];return r.join()}
  6521. /**
  6522. * @license
  6523. * Copyright 2019 Google LLC. All Rights Reserved.
  6524. * Licensed under the Apache License, Version 2.0 (the "License");
  6525. * you may not use this file except in compliance with the License.
  6526. * You may obtain a copy of the License at
  6527. *
  6528. * http://www.apache.org/licenses/LICENSE-2.0
  6529. *
  6530. * Unless required by applicable law or agreed to in writing, software
  6531. * distributed under the License is distributed on an "AS IS" BASIS,
  6532. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  6533. * See the License for the specific language governing permissions and
  6534. * limitations under the License.
  6535. * =============================================================================
  6536. */(e);this.userCode=`\n void main() {\n ${r} resRC = getOutputCoords();\n setOutput(getA(${i}));\n }\n `}}class mi{constructor(t,e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0;const n=new Array(t.length);for(let r=0;r<n.length;r++)n[r]=t[e[r]];if(this.outputShape=n,this.rank=n.length,this.rank>6)throw Error(`Packed transpose for rank ${this.rank} is not yet supported.`);const r=Dt(this.rank),i=cr("rc",this.rank),o=new Array(this.rank);for(let t=0;t<e.length;t++)o[e[t]]=i[t];const s=`vec2(${o.slice(-2).join()})`,a=`++${i[this.rank-1]} < ${n[this.rank-1]}`,l=`getChannel(getA(${o.join()}), ${s})`;this.userCode=`\n void main() {\n ${r} rc = getOutputCoords();\n vec4 result = vec4(0.);\n result[0] = ${l};\n if(${a}) {\n result[1] = ${l};\n }\n --${i[this.rank-1]};\n if(++${i[this.rank-2]} < ${n[this.rank-2]}) {\n result[2] = ${l};\n if(${a}) {\n result[3] = ${l};\n }\n }\n setOutput(result);\n }\n `}}
  6537. /**
  6538. * @license
  6539. * Copyright 2020 Google LLC. All Rights Reserved.
  6540. * Licensed under the Apache License, Version 2.0 (the "License");
  6541. * you may not use this file except in compliance with the License.
  6542. * You may obtain a copy of the License at
  6543. *
  6544. * http://www.apache.org/licenses/LICENSE-2.0
  6545. *
  6546. * Unless required by applicable law or agreed to in writing, software
  6547. * distributed under the License is distributed on an "AS IS" BASIS,
  6548. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  6549. * See the License for the specific language governing permissions and
  6550. * limitations under the License.
  6551. * =============================================================================
  6552. */function vi(t,e,n){const r=Object(s._127)().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new mi(t.shape,e):new gi(t.shape,e);return n.runWebGLProgram(r,[t],t.dtype)}
  6553. /**
  6554. * @license
  6555. * Copyright 2020 Google LLC. All Rights Reserved.
  6556. * Licensed under the Apache License, Version 2.0 (the "License");
  6557. * you may not use this file except in compliance with the License.
  6558. * You may obtain a copy of the License at
  6559. *
  6560. * http://www.apache.org/licenses/LICENSE-2.0
  6561. *
  6562. * Unless required by applicable law or agreed to in writing, software
  6563. * distributed under the License is distributed on an "AS IS" BASIS,
  6564. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  6565. * See the License for the specific language governing permissions and
  6566. * limitations under the License.
  6567. * =============================================================================
  6568. */
  6569. /**
  6570. * @license
  6571. * Copyright 2020 Google LLC. All Rights Reserved.
  6572. * Licensed under the Apache License, Version 2.0 (the "License");
  6573. * you may not use this file except in compliance with the License.
  6574. * You may obtain a copy of the License at
  6575. *
  6576. * http://www.apache.org/licenses/LICENSE-2.0
  6577. *
  6578. * Unless required by applicable law or agreed to in writing, software
  6579. * distributed under the License is distributed on an "AS IS" BASIS,
  6580. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  6581. * See the License for the specific language governing permissions and
  6582. * limitations under the License.
  6583. * =============================================================================
  6584. */
  6585. function bi(t){const{inputs:e,backend:n,attrs:r}=t,{x:i}=e,{axis:o,keepDims:a}=r;return function(t,e,n,r){const i=e,o=t.shape.length,a=s._152.parseAxisParam(i,t.shape);let l=a;const u=s._115.getAxesPermutation(l,o),c=null!=u;let h=t;c&&(h=vi(t,u,r),l=s._115.getInnerMostAxes(l.length,o)),s._115.assertAxesAreInnerMostDims("sum",l,o);const[d,p]=s._115.computeOutAndReduceShapes(h.shape,l);let f=d;n&&(f=s._115.expandShapeToKeepDim(d,a));const g=s._152.sizeFromShape(p),m=ci({inputs:{x:h},attrs:{shape:[s._152.sizeFromShape(t.shape)/g,g]},backend:r}),v=fi(m,Object(s._145)(t.dtype),"sum",r),b=ci({inputs:{x:v},attrs:{shape:f},backend:r});return r.disposeIntermediateTensorInfo(m),r.disposeIntermediateTensorInfo(v),c&&r.disposeIntermediateTensorInfo(h),b}(i,o,a,n)}const _i={kernelName:s._100,backendName:"webgl",kernelFunc:bi};
  6586. /**
  6587. * @license
  6588. * Copyright 2020 Google LLC. All Rights Reserved.
  6589. * Licensed under the Apache License, Version 2.0 (the "License");
  6590. * you may not use this file except in compliance with the License.
  6591. * You may obtain a copy of the License at
  6592. *
  6593. * http://www.apache.org/licenses/LICENSE-2.0
  6594. *
  6595. * Unless required by applicable law or agreed to in writing, software
  6596. * distributed under the License is distributed on an "AS IS" BASIS,
  6597. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  6598. * See the License for the specific language governing permissions and
  6599. * limitations under the License.
  6600. * =============================================================================
  6601. */function yi(t){const{inputs:e,backend:n,attrs:r}=t,{x:i}=e,{perm:o}=r,s=n,a=i.shape.length,l=new Array(a);for(let t=0;t<l.length;t++)l[t]=i.shape[o[t]];let u;if(s.shouldExecuteOnCPU([i])){const t=s.texData.get(i.dataId).values,e=lr(t,i.shape,i.dtype,o,l);u=s.makeTensorInfo(l,i.dtype),s.texData.get(u.dataId).values=e}else u=vi(i,o,s);return u}const Ti={kernelName:s._108,backendName:"webgl",kernelFunc:yi},xi=1e3;
  6602. /**
  6603. * @license
  6604. * Copyright 2020 Google LLC. All Rights Reserved.
  6605. * Licensed under the Apache License, Version 2.0 (the "License");
  6606. * you may not use this file except in compliance with the License.
  6607. * You may obtain a copy of the License at
  6608. *
  6609. * http://www.apache.org/licenses/LICENSE-2.0
  6610. *
  6611. * Unless required by applicable law or agreed to in writing, software
  6612. * distributed under the License is distributed on an "AS IS" BASIS,
  6613. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  6614. * See the License for the specific language governing permissions and
  6615. * limitations under the License.
  6616. * =============================================================================
  6617. */function Ei({a:t,b:e,transposeA:n,transposeB:r,backend:i,bias:o=null,preluActivationWeights:a=null,leakyreluAlpha:l=0,activation:u=null}){const c=t.shape.length,h=e.shape.length,d=n?t.shape[c-2]:t.shape[c-1],p=r?e.shape[h-1]:e.shape[h-2],f=n?t.shape[c-1]:t.shape[c-2],g=r?e.shape[h-2]:e.shape[h-1],m=t.shape.slice(0,-2),v=e.shape.slice(0,-2),b=s._152.sizeFromShape(m),_=s._152.sizeFromShape(v),y=s._116.assertAndGetBroadcastShape(t.shape.slice(0,-2),e.shape.slice(0,-2)).concat([f,g]);s._152.assert(d===p,()=>`Error in matMul: inner shapes (${d}) and (`+`${p}) of Tensors with shapes ${t.shape} and `+`${e.shape} and transposeA=${n}`+` and transposeB=${r} must match.`);const T=n?[b,d,f]:[b,f,d],x=r?[_,g,p]:[_,p,g],E=ci({inputs:{x:t},backend:i,attrs:{shape:T}}),w=ci({inputs:{x:e},backend:i,attrs:{shape:x}}),C=[E,w],S=Math.max(b,_),k=n?E.shape[1]:E.shape[2],O=null!=o,I=null!=a,R="leakyrelu"===u,A=null!=u?ri(u,!0):null;let N;if((1===f||1===g)&&k>xi&&!1===(O||I||R||null!=A)){let t=E,e=w;n&&(t=yi({inputs:{x:E},backend:i,attrs:{perm:[0,2,1]}}),C.push(t)),r&&(e=yi({inputs:{x:w},backend:i,attrs:{perm:[0,2,1]}}),C.push(e));const o=1===g;let s=t;1!==g&&(s=ci({inputs:{x:t},backend:i,attrs:{shape:[S,k,1]}}),C.push(s));const a=1===g?2:1;let l=e;o&&(l=ci({inputs:{x:e},backend:i,attrs:{shape:[S,1,k]}}),C.push(l));const u=li({inputs:{a:s,b:l},backend:i});N=bi({inputs:{x:u},backend:i,attrs:{axis:a,keepDims:!0}}),C.push(u)}else{const u=Object(s._151)(t.dtype,e.dtype),c=new ii(T,x,[S,f,g],n,r,O,A,I,R),h=[E,w];if(null!=o&&h.push(o),I&&h.push(a),R){const t=i.makeTensorInfo([],"float32",s._152.createScalarValue(l,"float32"));h.push(t),C.push(t)}N=i.runWebGLProgram(c,h,u)}const D=ci({inputs:{x:N},backend:i,attrs:{shape:y}});C.push(N);for(const t of C)i.disposeIntermediateTensorInfo(t);return D}
  6618. /**
  6619. * @license
  6620. * Copyright 2020 Google LLC. All Rights Reserved.
  6621. * Licensed under the Apache License, Version 2.0 (the License);
  6622. * you may not use this file except in compliance with the License.
  6623. * You may obtain a copy of the License at
  6624. *
  6625. * http://www.apache.org/licenses/LICENSE-2.0
  6626. *
  6627. * Unless required by applicable law or agreed to in writing, software
  6628. * distributed under the License is distributed on an AS IS BASIS,
  6629. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  6630. * See the License for the specific language governing permissions and
  6631. * limitations under the License.
  6632. * =============================================================================
  6633. */const wi={kernelName:s._113,backendName:"webgl",kernelFunc:function(t){const{inputs:e,backend:n,attrs:r}=t,{a:i,b:o,bias:s,preluActivationWeights:a}=e,{transposeA:l,transposeB:u,activation:c,leakyreluAlpha:h}=r;return Ei({a:i,b:o,transposeA:l,transposeB:u,backend:n,bias:s,preluActivationWeights:a,leakyreluAlpha:h,activation:c})}},Ci="return abs(x);";
  6634. /**
  6635. * @license
  6636. * Copyright 2020 Google LLC. All Rights Reserved.
  6637. * Licensed under the Apache License, Version 2.0 (the "License");
  6638. * you may not use this file except in compliance with the License.
  6639. * You may obtain a copy of the License at
  6640. *
  6641. * http://www.apache.org/licenses/LICENSE-2.0
  6642. *
  6643. * Unless required by applicable law or agreed to in writing, software
  6644. * distributed under the License is distributed on an "AS IS" BASIS,
  6645. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  6646. * See the License for the specific language governing permissions and
  6647. * limitations under the License.
  6648. * =============================================================================
  6649. */const Si={kernelName:s.a,backendName:"webgl",kernelFunc:function(t){const{inputs:e,backend:n}=t,{x:r}=e;if(n.shouldExecuteOnCPU([r])&&"complex64"!==r.dtype){const t=n.texData.get(r.dataId),e=Yn(t.values);return n.makeTensorInfo(r.shape,r.dtype,e)}let i;return i=Object(s._127)().getBool("WEBGL_PACK_UNARY_OPERATIONS")?new Nr(r.shape,Ci):new br(r.shape,Ci),n.runWebGLProgram(i,[r],r.dtype)}},ki=ei({opSnippet:_r+"\n if (abs(x) > 1.) {\n return NAN;\n }\n return acos(x);\n"}),Oi={kernelName:s.b,backendName:"webgl",kernelFunc:ki},Ii=ei({opSnippet:_r+"\n if (x < 1.0) return NAN;\nreturn log(x + sqrt(x * x - 1.0));"}),Ri={kernelName:s.c,backendName:"webgl",kernelFunc:Ii},Ai="return a + b;",Ni=ni({opSnippet:Ai,packedOpSnippet:Ai,supportsComplex:!0,cpuKernelImpl:xn}),Di={kernelName:s.d,backendName:"webgl",kernelFunc:Ni};
  6650. /**
  6651. * @license
  6652. * Copyright 2020 Google LLC. All Rights Reserved.
  6653. * Licensed under the Apache License, Version 2.0 (the "License");
  6654. * you may not use this file except in compliance with the License.
  6655. * You may obtain a copy of the License at
  6656. *
  6657. * http://www.apache.org/licenses/LICENSE-2.0
  6658. *
  6659. * Unless required by applicable law or agreed to in writing, software
  6660. * distributed under the License is distributed on an "AS IS" BASIS,
  6661. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  6662. * See the License for the specific language governing permissions and
  6663. * limitations under the License.
  6664. * =============================================================================
  6665. */
  6666. /**
  6667. * @license
  6668. * Copyright 2019 Google LLC. All Rights Reserved.
  6669. * Licensed under the Apache License, Version 2.0 (the "License");
  6670. * you may not use this file except in compliance with the License.
  6671. * You may obtain a copy of the License at
  6672. *
  6673. * http://www.apache.org/licenses/LICENSE-2.0
  6674. *
  6675. * Unless required by applicable law or agreed to in writing, software
  6676. * distributed under the License is distributed on an "AS IS" BASIS,
  6677. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  6678. * See the License for the specific language governing permissions and
  6679. * limitations under the License.
  6680. * =============================================================================
  6681. */
  6682. class Mi{constructor(t,e){this.outputShape=[],this.outputShape=t,this.variableNames=e.map((t,e)=>`T${e}`);const n=[];this.variableNames.forEach(t=>{n.push(`float v${t} = get${t}AtOutCoords();`)});const r=this.variableNames.map(t=>`v${t}`).join(" + ");this.userCode=`\n void main() {\n ${n.join("\n ")}\n\n float result = ${r};\n setOutput(result);\n }\n `}}
  6683. /**
  6684. * @license
  6685. * Copyright 2019 Google LLC. All Rights Reserved.
  6686. * Licensed under the Apache License, Version 2.0 (the "License");
  6687. * you may not use this file except in compliance with the License.
  6688. * You may obtain a copy of the License at
  6689. *
  6690. * http://www.apache.org/licenses/LICENSE-2.0
  6691. *
  6692. * Unless required by applicable law or agreed to in writing, software
  6693. * distributed under the License is distributed on an "AS IS" BASIS,
  6694. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  6695. * See the License for the specific language governing permissions and
  6696. * limitations under the License.
  6697. * =============================================================================
  6698. */class Li{constructor(t,e){this.outputShape=[],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=t,this.variableNames=e.map((t,e)=>`T${e}`);const n=[];this.variableNames.forEach(t=>{n.push(`vec4 v${t} = get${t}AtOutCoords();`)});const r=this.variableNames.map(t=>`v${t}`).join(" + ");this.userCode=`\n void main() {\n ${n.join("\n ")}\n\n vec4 result = ${r};\n setOutput(result);\n }\n `}}
  6699. /**
  6700. * @license
  6701. * Copyright 2020 Google LLC. All Rights Reserved.
  6702. * Licensed under the Apache License, Version 2.0 (the "License");
  6703. * you may not use this file except in compliance with the License.
  6704. * You may obtain a copy of the License at
  6705. *
  6706. * http://www.apache.org/licenses/LICENSE-2.0
  6707. *
  6708. * Unless required by applicable law or agreed to in writing, software
  6709. * distributed under the License is distributed on an "AS IS" BASIS,
  6710. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  6711. * See the License for the specific language governing permissions and
  6712. * limitations under the License.
  6713. * =============================================================================
  6714. */const Pi={kernelName:s.e,backendName:"webgl",kernelFunc:function t(e){const{inputs:n,backend:r}=e,i=n;if(1===i.length)return Gr({inputs:{x:i[0]},backend:r});if(i.length>Object(s._127)().get("WEBGL_MAX_TEXTURES_IN_SHADER")){const e=Math.floor(i.length/2);return t({inputs:[t({inputs:i.slice(0,e),backend:r}),t({inputs:i.slice(e),backend:r})],backend:r})}const o=i.map(t=>t.dtype).reduce((t,e)=>Object(s._151)(t,e)),a=i.map(t=>t.shape),l=Object(s._127)().getBool("WEBGL_PACK")?new Li(i[0].shape,a):new Mi(i[0].shape,a);return r.runWebGLProgram(l,i,o)}};
  6715. /**
  6716. * @license
  6717. * Copyright 2020 Google LLC. All Rights Reserved.
  6718. * Licensed under the Apache License, Version 2.0 (the "License");
  6719. * you may not use this file except in compliance with the License.
  6720. * You may obtain a copy of the License at
  6721. *
  6722. * http://www.apache.org/licenses/LICENSE-2.0
  6723. *
  6724. * Unless required by applicable law or agreed to in writing, software
  6725. * distributed under the License is distributed on an "AS IS" BASIS,
  6726. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  6727. * See the License for the specific language governing permissions and
  6728. * limitations under the License.
  6729. * =============================================================================
  6730. */const Fi={kernelName:s.f,backendName:"webgl",kernelFunc:function(t){const{inputs:e,backend:n,attrs:r}=t,{x:i}=e,{axis:o,keepDims:a}=r,l=i.shape.length,u=s._152.parseAxisParam(o,i.shape);let c=u;const h=s._115.getAxesPermutation(c,l);let d=i;null!=h&&(d=yi({inputs:{x:i},backend:n,attrs:{perm:h}}),c=s._115.getInnerMostAxes(c.length,l)),s._115.assertAxesAreInnerMostDims("all",c,l);const[p,f]=s._115.computeOutAndReduceShapes(d.shape,c),g=ci({inputs:{x:d},backend:n,attrs:{shape:[-1,s._152.sizeFromShape(f)]}}),m=fi(g,g.dtype,"all",n);let v;v=ci(a?{inputs:{x:m},backend:n,attrs:{shape:s._115.expandShapeToKeepDim(p,u)}}:{inputs:{x:m},backend:n,attrs:{shape:p}});return n.disposeIntermediateTensorInfo(g),n.disposeIntermediateTensorInfo(m),null!=h&&n.disposeIntermediateTensorInfo(d),v}};
  6731. /**
  6732. * @license
  6733. * Copyright 2020 Google LLC. All Rights Reserved.
  6734. * Licensed under the Apache License, Version 2.0 (the "License");
  6735. * you may not use this file except in compliance with the License.
  6736. * You may obtain a copy of the License at
  6737. *
  6738. * http://www.apache.org/licenses/LICENSE-2.0
  6739. *
  6740. * Unless required by applicable law or agreed to in writing, software
  6741. * distributed under the License is distributed on an "AS IS" BASIS,
  6742. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  6743. * See the License for the specific language governing permissions and
  6744. * limitations under the License.
  6745. * =============================================================================
  6746. */const Bi={kernelName:s.g,backendName:"webgl",kernelFunc:function(t){const{inputs:e,backend:n,attrs:r}=t,{x:i}=e,{axis:o,keepDims:a}=r,l=i.shape.length,u=s._152.parseAxisParam(o,i.shape);let c=u;const h=s._115.getAxesPermutation(c,l);let d=i;null!=h&&(d=yi({inputs:{x:i},backend:n,attrs:{perm:h}}),c=s._115.getInnerMostAxes(c.length,l)),s._115.assertAxesAreInnerMostDims("any",c,l);const[p,f]=s._115.computeOutAndReduceShapes(d.shape,c),g=ci({inputs:{x:d},backend:n,attrs:{shape:[-1,s._152.sizeFromShape(f)]}}),m=fi(g,g.dtype,"any",n);let v;v=ci(a?{inputs:{x:m},backend:n,attrs:{shape:s._115.expandShapeToKeepDim(p,u)}}:{inputs:{x:m},backend:n,attrs:{shape:p}});return n.disposeIntermediateTensorInfo(g),n.disposeIntermediateTensorInfo(m),null!=h&&n.disposeIntermediateTensorInfo(d),v}};
  6747. /**
  6748. * @license
  6749. * Copyright 2017 Google LLC. All Rights Reserved.
  6750. * Licensed under the Apache License, Version 2.0 (the "License");
  6751. * you may not use this file except in compliance with the License.
  6752. * You may obtain a copy of the License at
  6753. *
  6754. * http://www.apache.org/licenses/LICENSE-2.0
  6755. *
  6756. * Unless required by applicable law or agreed to in writing, software
  6757. * distributed under the License is distributed on an "AS IS" BASIS,
  6758. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  6759. * See the License for the specific language governing permissions and
  6760. * limitations under the License.
  6761. * =============================================================================
  6762. */class ji{constructor(t,e,n){this.variableNames=["A"];const{windowSize:r,batchSize:i,outSize:o}=t;n||this.variableNames.push("bestIndicesA"),this.outputShape=[i,o];const s="max"===e?">":"<",a=n?"inOffset + i;":"round(getBestIndicesA(batch, inOffset + i));";this.userCode=`\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = outIdx * ${r};\n\n int bestIndex = inOffset;\n float bestValue = getA(batch, bestIndex);\n\n for (int i = 0; i < ${r}; i++) {\n int inIdx = ${a};\n float candidate = getA(batch, inIdx);\n if (candidate ${s} bestValue) {\n bestValue = candidate;\n bestIndex = inIdx;\n }\n }\n setOutput(float(bestIndex));\n }\n `}}
  6763. /**
  6764. * @license
  6765. * Copyright 2019 Google LLC. All Rights Reserved.
  6766. * Licensed under the Apache License, Version 2.0 (the "License");
  6767. * you may not use this file except in compliance with the License.
  6768. * You may obtain a copy of the License at
  6769. *
  6770. * http://www.apache.org/licenses/LICENSE-2.0
  6771. *
  6772. * Unless required by applicable law or agreed to in writing, software
  6773. * distributed under the License is distributed on an "AS IS" BASIS,
  6774. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  6775. * See the License for the specific language governing permissions and
  6776. * limitations under the License.
  6777. * =============================================================================
  6778. */class $i{constructor(t,e,n,r){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,s._152.assert(t.length>2,()=>`Packed arg${n.charAt(0).toUpperCase()+n.slice(1)} supports only inputs with rank above 2.`);const i=t[t.length-1],o=Math.ceil(i/e);this.outputShape=t.slice(0,-1),o>1&&this.outputShape.push(o),r||this.variableNames.push("bestIndicesA");const a=this.outputShape,l=a.length,u=Dt(l),c=hr("coords",l);let h,d;if(1===o){const t=Dt(d=l+1);h=`\n ${t} sourceLocR = ${t}(${c.join()}, 0);\n ++${c[l-1]};\n ${t} sourceLocG = ${t}(${c.join()}, 0);\n ++${c[l-2]};\n ${t} sourceLocA = ${t}(${c.join()}, 0);\n --${c[l-1]};\n ${t} sourceLocB = ${t}(${c.join()}, 0);\n --${c[l-2]};`}else d=l,h=`\n ${u} sourceLocR = coords;\n ++${c[l-1]};\n ${u} sourceLocG = coords;\n ++${c[l-2]};\n ${u} sourceLocA = coords;\n --${c[l-1]};\n ${u} sourceLocB = coords;\n --${c[l-2]};`;const p=["x","y","z","w","u","v"].slice(0,d),f="."+p[d-1],g=p.map(t=>"int "+t),m=hr("sourceLocR",d-1).concat("inIdx.r"),v=hr("sourceLocG",d-1).concat("inIdx.g"),b=hr("sourceLocB",d-1).concat("inIdx.b"),_=hr("sourceLocA",d-1).concat("inIdx.a"),y="max"===n?"greaterThan":"lessThan",T=r?"":`\n inIdx = round(vec4(getBestIndicesAChannel(${m.join()}),\n getBestIndicesAChannel(${v.join()}),\n getBestIndicesAChannel(${b.join()}),\n getBestIndicesAChannel(${_.join()})));`,x=`vec4(\n getAChannel(${m.join()}),\n hasNextCol ? getAChannel(${v.join()}) : 0.,\n hasNextRow ? getAChannel(${b.join()}) : 0.,\n hasNextRow && hasNextCol ? getAChannel(${_.join()}) : 0.)`,E=r?"":`\n float getBestIndicesAChannel(${g.join()}) {\n return getChannel(getBestIndicesA(${p.join()}),\n vec2(${p.slice(-2).join()}));\n }`;this.userCode=`\n float getAChannel(${g.join()}) {\n return getChannel(getA(${p.join()}),\n vec2(${p.slice(-2).join()}));\n }\n ${E}\n void main() {\n ${u} coords = getOutputCoords();\n bool hasNextCol = ${c[l-1]} < ${a[l-1]-1};\n bool hasNextRow = ${c[l-2]} < ${a[l-2]-1};\n ${h}\n ivec4 srcIdx = ivec4(sourceLocR${f}, sourceLocG${f},\n sourceLocB${f}, sourceLocA${f}) * ${e};\n ivec4 inIdx = srcIdx;\n vec4 bestIndex = vec4(inIdx);\n vec4 bestValue = ${x};\n\n for (int i = 0; i < ${e}; i++) {\n inIdx = srcIdx;\n ${T}\n vec4 candidate = ${x};\n bvec4 nan = isnan(candidate);\n bvec4 replace = bvec4(\n vec4(${y}(candidate, bestValue)) * (vec4(1.0) - vec4(nan)));\n\n bestValue = vec4(replace.x ? candidate.x : bestValue.x,\n replace.y ? candidate.y : bestValue.y,\n replace.z ? candidate.z : bestValue.z,\n replace.w ? candidate.w : bestValue.w);\n bestIndex = mix(bestIndex, vec4(inIdx), vec4(replace));\n srcIdx++;\n }\n setOutput(bestIndex);\n }\n `}}
  6779. /**
  6780. * @license
  6781. * Copyright 2020 Google LLC. All Rights Reserved.
  6782. * Licensed under the Apache License, Version 2.0 (the "License");
  6783. * you may not use this file except in compliance with the License.
  6784. * You may obtain a copy of the License at
  6785. *
  6786. * http://www.apache.org/licenses/LICENSE-2.0
  6787. *
  6788. * Unless required by applicable law or agreed to in writing, software
  6789. * distributed under the License is distributed on an "AS IS" BASIS,
  6790. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  6791. * See the License for the specific language governing permissions and
  6792. * limitations under the License.
  6793. * =============================================================================
  6794. */function Ui(t,e,n,r){const i=[n];if(s._115.assertAxesAreInnerMostDims("arg"+r.charAt(0).toUpperCase()+r.slice(1),i,e.shape.length),!Object(s._127)().getBool("WEBGL_PACK_REDUCE")||e.shape.length<=2){const n=[],o=t.texData.get(e.dataId);let a=e;null!==o&&o.isPacked&&(a=t.unpackTensor(e),n.push(a));const[l,u]=s._115.computeOutAndReduceShapes(a.shape,i),c=s._152.sizeFromShape(u),h=ci({inputs:{x:a},backend:t,attrs:{shape:[-1,c]}});n.push(h);const d=function t(e,n,r,i=null){let o=n.shape[0],a=n.shape[1];null!=i&&(o=i.shape[0],a=i.shape[1]);const l=s._115.computeOptimalWindowSize(a),u={windowSize:l,inSize:a,batchSize:o,outSize:Math.ceil(a/l)},c=new ji(u,r,null==i),h=[n];null!=i&&h.push(i);const d=e.runWebGLProgram(c,h,"int32");if(1===d.shape[1])return d;const p=t(e,n,r,d);return e.disposeIntermediateTensorInfo(d),p}(t,h,r);n.push(d);const p=ci({inputs:{x:d},backend:t,attrs:{shape:l}});return n.forEach(e=>t.disposeIntermediateTensorInfo(e)),p}return function t(e,n,r,i=null){const o=null!=i?i.shape:n.shape,a=o[o.length-1],l=s._115.computeOptimalWindowSize(a),u=new $i(o,l,r,null==i),c=null==i?[n]:[n,i],h=e.runWebGLProgram(u,c,"int32");if(h.shape.length===n.shape.length){const i=t(e,n,r,h);return e.disposeIntermediateTensorInfo(h),i}return h}(t,e,r)}
  6795. /**
  6796. * @license
  6797. * Copyright 2020 Google LLC. All Rights Reserved.
  6798. * Licensed under the Apache License, Version 2.0 (the "License");
  6799. * you may not use this file except in compliance with the License.
  6800. * You may obtain a copy of the License at
  6801. *
  6802. * http://www.apache.org/licenses/LICENSE-2.0
  6803. *
  6804. * Unless required by applicable law or agreed to in writing, software
  6805. * distributed under the License is distributed on an "AS IS" BASIS,
  6806. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  6807. * See the License for the specific language governing permissions and
  6808. * limitations under the License.
  6809. * =============================================================================
  6810. */const Vi={kernelName:s.h,backendName:"webgl",kernelFunc:function(t){const{inputs:e,backend:n,attrs:r}=t,{x:i}=e,{axis:o}=r;let a=s._152.parseAxisParam(o,i.shape);const l=s._115.getAxesPermutation(a,i.shape.length);let u=i;const c=[];null!=l&&(u=yi({inputs:{x:i},backend:n,attrs:{perm:l}}),c.push(u),a=s._115.getInnerMostAxes(a.length,u.shape.length)),s._115.assertAxesAreInnerMostDims("argMax",[a[0]],u.shape.length);const h=Ui(n,u,a[0],"max");return c.forEach(t=>n.disposeIntermediateTensorInfo(t)),h}};
  6811. /**
  6812. * @license
  6813. * Copyright 2020 Google LLC. All Rights Reserved.
  6814. * Licensed under the Apache License, Version 2.0 (the "License");
  6815. * you may not use this file except in compliance with the License.
  6816. * You may obtain a copy of the License at
  6817. *
  6818. * http://www.apache.org/licenses/LICENSE-2.0
  6819. *
  6820. * Unless required by applicable law or agreed to in writing, software
  6821. * distributed under the License is distributed on an "AS IS" BASIS,
  6822. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  6823. * See the License for the specific language governing permissions and
  6824. * limitations under the License.
  6825. * =============================================================================
  6826. */const Hi={kernelName:s.i,backendName:"webgl",kernelFunc:function(t){const{inputs:e,backend:n,attrs:r}=t,{x:i}=e,{axis:o}=r;let a=s._152.parseAxisParam(o,i.shape);const l=s._115.getAxesPermutation(a,i.shape.length);let u=i;const c=[];null!=l&&(u=yi({inputs:{x:i},backend:n,attrs:{perm:l}}),c.push(u),a=s._115.getInnerMostAxes(a.length,u.shape.length)),s._115.assertAxesAreInnerMostDims("argMin",[a[0]],u.shape.length);const h=Ui(n,u,a[0],"min");return c.forEach(t=>n.disposeIntermediateTensorInfo(t)),h}},Wi=ei({opSnippet:_r+"\n if (abs(x) > 1.) {\n return NAN;\n }\n return asin(x);\n"}),Gi={kernelName:s.j,backendName:"webgl",kernelFunc:Wi},zi=ei({opSnippet:_r+"return log(x + sqrt(x * x + 1.0));"}),Xi={kernelName:s.k,backendName:"webgl",kernelFunc:zi},Ki=ei({opSnippet:_r+"\n return atan(x);\n"}),Yi={kernelName:s.l,backendName:"webgl",kernelFunc:Ki},qi=ni({opSnippet:"\n if (isnan(a)) return a;\n if (isnan(b)) return b;\n\n return atan(a, b);\n",packedOpSnippet:"\n vec4 result = atan(a, b);\n vec4 isNaN = min(vec4(isnan(a)) + vec4(isnan(b)), vec4(1.0));\n \n result.r = isNaN.r > 0. ? NAN : result.r;\n result.g = isNaN.g > 0. ? NAN : result.g;\n result.b = isNaN.b > 0. ? NAN : result.b;\n result.a = isNaN.a > 0. ? NAN : result.a;\n\n return result;\n"}),Ji={kernelName:s.m,backendName:"webgl",kernelFunc:qi},Zi=ei({opSnippet:_r+"\n if ((x < -1.0) || (x > 1.0)) return NAN;\nreturn (log(1.0 + x) - log(1.0 - x)) / 2.0;"}),Qi={kernelName:s.n,backendName:"webgl",kernelFunc:Zi};
  6827. /**
  6828. * @license
  6829. * Copyright 2020 Google LLC. All Rights Reserved.
  6830. * Licensed under the Apache License, Version 2.0 (the "License");
  6831. * you may not use this file except in compliance with the License.
  6832. * You may obtain a copy of the License at
  6833. *
  6834. * http://www.apache.org/licenses/LICENSE-2.0
  6835. *
  6836. * Unless required by applicable law or agreed to in writing, software
  6837. * distributed under the License is distributed on an "AS IS" BASIS,
  6838. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  6839. * See the License for the specific language governing permissions and
  6840. * limitations under the License.
  6841. * =============================================================================
  6842. */
  6843. /**
  6844. * @license
  6845. * Copyright 2017 Google LLC. All Rights Reserved.
  6846. * Licensed under the Apache License, Version 2.0 (the "License");
  6847. * you may not use this file except in compliance with the License.
  6848. * You may obtain a copy of the License at
  6849. *
  6850. * http://www.apache.org/licenses/LICENSE-2.0
  6851. *
  6852. * Unless required by applicable law or agreed to in writing, software
  6853. * distributed under the License is distributed on an "AS IS" BASIS,
  6854. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  6855. * See the License for the specific language governing permissions and
  6856. * limitations under the License.
  6857. * =============================================================================
  6858. */
  6859. class to{constructor(t,e,n,r=!1,i=!1){if(this.variableNames=["x"],"avg"===e&&n)throw new Error("Cannot compute positions for average pool.");const o=t.filterWidth,s=t.strideHeight,a=t.strideWidth,l=t.dilationHeight,u=t.dilationWidth,c=t.effectiveFilterHeight,h=t.effectiveFilterWidth,d=t.padInfo.top,p=t.padInfo.left;this.outputShape=t.outShape;const f="avg"===e,g=`((batch * ${t.inHeight} + xR) * ${t.inWidth} + xC) * ${t.inChannels} + d`,m=`(xR * ${t.inWidth} + xC) * ${t.inChannels} + d`;let v="0.0";if(f||(v="-1.0 / 1e-20"),n){const e=">=";return void(this.userCode=`\n const ivec2 strides = ivec2(${s}, ${a});\n const ivec2 pads = ivec2(${d}, ${p});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d = coords[3];\n\n ivec2 xRCCorner = coords.yz * strides - pads;\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // max/min x(?, ?, d) to get y(yR, yC, d).\n // ? = to be determined\n float minMaxValue = 0.0;\n float minMaxValueFound = 0.0;\n int minMaxPosition = 0;\n float avgValue = 0.0;\n\n for (int wR = 0; wR < ${c};\n wR += ${l}) {\n int xR = xRCorner + wR;\n\n if (xR < 0 || xR >= ${t.inHeight}) {\n continue;\n }\n\n for (int wC = 0; wC < ${h};\n wC += ${u}) {\n int xC = xCCorner + wC;\n\n if (xC < 0 || xC >= ${t.inWidth}) {\n continue;\n }\n\n float value = getX(batch, xR, xC, d);\n\n // If a min / max value has already been found, use it. If not,\n // use the current value.\n float currMinMaxValue = mix(\n value, minMaxValue, minMaxValueFound);\n if (value ${e} currMinMaxValue) {\n minMaxValue = value;\n minMaxValueFound = 1.0;\n minMaxPosition = ${r?i?g:m:`wR * ${h} + wC`};\n }\n }\n }\n setOutput(float(minMaxPosition));\n }\n `)}let b=`${e}(${e}(${e}(`+"minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])";"avg"===e&&(b="avgValue / count");const _=4*Math.floor(o/4),y=o%4,T=`\n if (${f}) {\n avgValue += dot(values, ones);\n } else {\n minMaxValue = max(values, minMaxValue);\n }\n `;this.userCode=`\n const ivec2 strides = ivec2(${s}, ${a});\n const ivec2 pads = ivec2(${d}, ${p});\n const float initializationValue = ${v};\n const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n float count = 0.0;\n\n float getValue(int batch, int xR, int xC, int d) {\n if (xC < 0 || xC >= ${t.inWidth}) {\n return initializationValue;\n }\n count += 1.0;\n return getX(batch, xR, xC, d);\n }\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d = coords[3];\n\n ivec2 xRCCorner = coords.yz * strides - pads;\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // max/min x(?, ?, d) to get y(yR, yC, d).\n // ? = to be determined\n vec4 minMaxValue = vec4(${v});\n float avgValue = 0.0;\n count = 0.0;\n\n for (int wR = 0; wR < ${c};\n wR += ${l}) {\n int xR = xRCorner + wR;\n\n if (xR < 0 || xR >= ${t.inHeight}) {\n continue;\n }\n\n for (int wC = 0; wC < ${_}; wC += 4) {\n int xC = xCCorner + wC * ${u};\n\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + ${u}, d),\n getValue(batch, xR, xC + 2 * ${u}, d),\n getValue(batch, xR, xC + 3 * ${u}, d)\n );\n\n ${T}\n }\n\n int xC = xCCorner + ${_};\n if (${1===y}) {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n ${T}\n } else if (${2===y}) {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + ${u}, d),\n initializationValue,\n initializationValue\n );\n\n ${T}\n } else if (${3===y}) {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + ${u}, d),\n getValue(batch, xR, xC + 2 * ${u}, d),\n initializationValue\n );\n\n ${T}\n }\n }\n setOutput(${b});\n }\n `}}class eo{constructor(t,e,n,r=!1,i=!1){if(this.variableNames=["x"],"avg"===e&&n)throw new Error("Cannot compute positions for average pool.");const o=t.filterWidth,s=t.strideDepth,a=t.strideHeight,l=t.strideWidth,u=t.dilationDepth,c=t.dilationHeight,h=t.dilationWidth,d=t.effectiveFilterDepth,p=t.effectiveFilterHeight,f=t.effectiveFilterWidth,g=t.padInfo.front,m=t.padInfo.top,v=t.padInfo.left;this.outputShape=t.outShape;const b="avg"===e;let _="0.0";if(b||(_="-1.0 / 1e-20"),n){const e=">=";return void(this.userCode=`\n const ivec3 strides =\n ivec3(${s}, ${a}, ${l});\n const ivec3 pads = ivec3(${g}, ${m}, ${v});\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int ch = coords.u;\n\n ivec3 xCorner = ivec3(coords.y, coords.z, coords.w) * strides - pads;\n int xDCorner = xCorner.x;\n int xRCorner = xCorner.y;\n int xCCorner = xCorner.z;\n\n // max/min x(?, ?, ?, ch) to get y(yD, yR, yC, ch).\n // ? = to be determined\n float minMaxValue = 0.0;\n float minMaxValueFound = 0.0;\n int minMaxPosition = 0;\n\n for (int wD = 0; wD < ${d};\n wD += ${u}) {\n int xD = xDCorner + wD;\n\n if (xD < 0 || xD >= ${t.inDepth}) {\n continue;\n }\n\n for (int wR = 0; wR < ${p};\n wR += ${c}) {\n int xR = xRCorner + wR;\n\n if (xR < 0 || xR >= ${t.inHeight}) {\n continue;\n }\n\n for (int wC = 0; wC < ${f};\n wC += ${h}) {\n int xC = xCCorner + wC;\n\n if (xC < 0 || xC >= ${t.inWidth}) {\n continue;\n }\n\n float value = getX(batch, xD, xR, xC, ch);\n\n // If a min / max value has already been found, use it. If not,\n // use the current value.\n float currMinMaxValue = mix(\n value, minMaxValue, minMaxValueFound);\n if (value ${e} currMinMaxValue) {\n minMaxValue = value;\n minMaxValueFound = 1.0;\n minMaxPosition = ${r?i?`(((batch * ${t.inDepth} + xD) * ${t.inHeight} + xR) * ${t.inWidth} + xC) * ${t.inChannels} + ch`:`((xD * ${t.inHeight} + xR) * ${t.inWidth} + xC) * ${t.inChannels} + ch`:`wD * ${p} * ${f} +\n wR * ${f} + wC`};\n }\n }\n }\n }\n setOutput(float(minMaxPosition));\n }\n `)}let y=`${e}(${e}(${e}(`+"minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])";"avg"===e&&(y="avgValue / count");const T=4*Math.floor(o/4),x=o%4,E=`\n if (${b}) {\n avgValue += dot(values, ones);\n } else {\n minMaxValue = max(values, minMaxValue);\n }\n `;this.userCode=`\n const ivec3 strides =\n ivec3(${s}, ${a}, ${l});\n const ivec3 pads = ivec3(${g}, ${m}, ${v});\n const float initializationValue = ${_};\n const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n float count = 0.0;\n\n float getValue(int batch, int xD, int xR, int xC, int ch) {\n if (xC < 0 || xC >= ${t.inWidth}) {\n return initializationValue;\n }\n count += 1.0;\n return getX(batch, xD, xR, xC, ch);\n }\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int ch = coords.u;\n\n ivec3 xCorner = ivec3(coords.y, coords.z, coords.w) * strides - pads;\n int xDCorner = xCorner.x;\n int xRCorner = xCorner.y;\n int xCCorner = xCorner.z;\n\n // max/min x(?, ?, ?, d) to get y(yD, yR, yC, ch).\n // ? = to be determined\n vec4 minMaxValue = vec4(${_});\n float avgValue = 0.0;\n count = 0.0;\n\n for (int wD = 0; wD < ${d};\n wD += ${u}) {\n int xD = xDCorner + wD;\n\n if (xD < 0 || xD >= ${t.inDepth}) {\n continue;\n }\n\n for (int wR = 0; wR < ${p};\n wR += ${c}) {\n int xR = xRCorner + wR;\n\n if (xR < 0 || xR >= ${t.inHeight}) {\n continue;\n }\n\n for (int wC = 0; wC < ${T}; wC += 4) {\n int xC = xCCorner + wC * ${h};\n\n vec4 values = vec4(\n getValue(batch, xD, xR, xC, ch),\n getValue(batch, xD, xR, xC + ${h}, ch),\n getValue(batch, xD, xR, xC + 2 * ${h}, ch),\n getValue(batch, xD, xR, xC + 3 * ${h}, ch)\n );\n\n ${E}\n }\n\n int xC = xCCorner + ${T};\n if (${1===x}) {\n vec4 values = vec4(\n getValue(batch, xD, xR, xC, ch),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n ${E}\n } else if (${2===x}) {\n vec4 values = vec4(\n getValue(batch, xD, xR, xC, ch),\n getValue(batch, xD, xR, xC + ${h}, ch),\n initializationValue,\n initializationValue\n );\n\n ${E}\n } else if (${3===x}) {\n vec4 values = vec4(\n getValue(batch, xD, xR, xC, ch),\n getValue(batch, xD, xR, xC + ${h}, ch),\n getValue(batch, xD, xR, xC + 2 * ${h}, ch),\n initializationValue\n );\n\n ${E}\n }\n }\n setOutput(${y});\n }\n }\n `}}
  6860. /**
  6861. * @license
  6862. * Copyright 2020 Google LLC. All Rights Reserved.
  6863. * Licensed under the Apache License, Version 2.0 (the "License");
  6864. * you may not use this file except in compliance with the License.
  6865. * You may obtain a copy of the License at
  6866. *
  6867. * http://www.apache.org/licenses/LICENSE-2.0
  6868. *
  6869. * Unless required by applicable law or agreed to in writing, software
  6870. * distributed under the License is distributed on an "AS IS" BASIS,
  6871. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  6872. * See the License for the specific language governing permissions and
  6873. * limitations under the License.
  6874. * =============================================================================
  6875. */const no={kernelName:s.o,backendName:"webgl",kernelFunc:function(t){const{inputs:e,backend:n,attrs:r}=t,{x:i}=e;ft(i,"avgPool");const{filterSize:o,strides:a,pad:l,dimRoundingMode:u}=r;s._152.assert(s._115.eitherStridesOrDilationsAreOne(a,1),()=>"Error in avgPool: Either strides or dilations must be 1. "+`Got strides ${a} and dilations '1'`);const c=s._115.computePool2DInfo(i.shape,o,a,1,l,u);if(1===c.filterWidth&&1===c.filterHeight&&s._152.arraysEqual(c.inShape,c.outShape))return Gr({inputs:{x:i},backend:n});const h=new to(c,"avg",!1);return n.runWebGLProgram(h,[i],"float32")}};
  6876. /**
  6877. * @license
  6878. * Copyright 2020 Google LLC. All Rights Reserved.
  6879. * Licensed under the Apache License, Version 2.0 (the "License");
  6880. * you may not use this file except in compliance with the License.
  6881. * You may obtain a copy of the License at
  6882. *
  6883. * http://www.apache.org/licenses/LICENSE-2.0
  6884. *
  6885. * Unless required by applicable law or agreed to in writing, software
  6886. * distributed under the License is distributed on an "AS IS" BASIS,
  6887. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  6888. * See the License for the specific language governing permissions and
  6889. * limitations under the License.
  6890. * =============================================================================
  6891. */const ro={kernelName:s.p,backendName:"webgl",kernelFunc:function(t){const{inputs:e,backend:n,attrs:r}=t,{x:i}=e,{filterSize:o,strides:a,pad:l,dimRoundingMode:u,dataFormat:c}=r,h=s._115.computePool3DInfo(i.shape,o,a,[1,1,1],l,u,c),d=new eo(h,"avg",!1);return n.runWebGLProgram(d,[i],"float32")}};
  6892. /**
  6893. * @license
  6894. * Copyright 2017 Google LLC. All Rights Reserved.
  6895. * Licensed under the Apache License, Version 2.0 (the "License");
  6896. * you may not use this file except in compliance with the License.
  6897. * You may obtain a copy of the License at
  6898. *
  6899. * http://www.apache.org/licenses/LICENSE-2.0
  6900. *
  6901. * Unless required by applicable law or agreed to in writing, software
  6902. * distributed under the License is distributed on an "AS IS" BASIS,
  6903. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  6904. * See the License for the specific language governing permissions and
  6905. * limitations under the License.
  6906. * =============================================================================
  6907. */class io{constructor(t){this.variableNames=["dy"],this.outputShape=t.inShape;const e=t.filterHeight,n=t.filterWidth,r=t.strideHeight,i=t.strideWidth,o=t.dilationHeight,s=t.dilationWidth,a=t.effectiveFilterHeight,l=t.effectiveFilterWidth,u=a-1-t.padInfo.top,c=l-1-t.padInfo.left,h=1/(e*n);this.userCode=`\n const ivec2 pads = ivec2(${u}, ${c});\n const float avgMultiplier = float(${h});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n\n ivec2 dyRCCorner = coords.yz - pads;\n int dyRCorner = dyRCCorner.x;\n int dyCCorner = dyRCCorner.y;\n\n // Convolve dy(?, ?, d) with pos mask(:, :, d) to get dx(xR, xC, d).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < ${a};\n wR += ${o}) {\n float dyR = float(dyRCorner + wR) / ${r}.0;\n\n if (dyR < 0.0 || dyR >= ${t.outHeight}.0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n for (int wC = 0; wC < ${l};\n wC+= ${s}) {\n float dyC = float(dyCCorner + wC) / ${i}.0;\n\n if (dyC < 0.0 || dyC >= ${t.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n float dyValue = getDy(b, idyR, idyC, d);\n\n dotProd += dyValue * avgMultiplier;\n }\n }\n setOutput(dotProd);\n }\n `}}class oo{constructor(t){this.variableNames=["dy"],this.outputShape=t.inShape;const e=t.filterDepth,n=t.filterHeight,r=t.filterWidth,i=t.strideDepth,o=t.strideHeight,s=t.strideWidth,a=t.dilationDepth,l=t.dilationHeight,u=t.dilationWidth,c=t.effectiveFilterDepth,h=t.effectiveFilterHeight,d=t.effectiveFilterWidth,p=c-1-t.padInfo.front,f=h-1-t.padInfo.top,g=d-1-t.padInfo.left,m=1/(e*n*r);this.userCode=`\n const ivec3 pads = ivec3(${p}, ${f}, ${g});\n const float avgMultiplier = float(${m});\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int ch = coords.u;\n\n ivec3 dyCorner = ivec3(coords.y, coords.z, coords.w) - pads;\n int dyDCorner = dyCorner.x;\n int dyRCorner = dyCorner.y;\n int dyCCorner = dyCorner.z;\n\n // Convolve dy(?, ?, ?, d) with pos mask(:, :, :, ch) to get\n // dx(xD, xR, xC, ch).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n\n for (int wD = 0; wD < ${c};\n wD += ${a}) {\n float dyD = float(dyDCorner + wD) / ${i}.0;\n\n if (dyD < 0.0 || dyD >= ${t.outDepth}.0 || fract(dyD) > 0.0) {\n continue;\n }\n int idyD = int(dyD);\n\n for (int wR = 0; wR < ${h};\n wR += ${l}) {\n float dyR = float(dyRCorner + wR) / ${o}.0;\n\n if (dyR < 0.0 || dyR >= ${t.outHeight}.0 ||\n fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n for (int wC = 0; wC < ${d};\n wC += ${u}) {\n float dyC = float(dyCCorner + wC) / ${s}.0;\n\n if (dyC < 0.0 || dyC >= ${t.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n float dyValue = getDy(batch, idyD, idyR, idyC, ch);\n\n dotProd += dyValue * avgMultiplier;\n }\n }\n }\n setOutput(dotProd);\n }\n `}}
  6908. /**
  6909. * @license
  6910. * Copyright 2020 Google LLC. All Rights Reserved.
  6911. * Licensed under the Apache License, Version 2.0 (the "License");
  6912. * you may not use this file except in compliance with the License.
  6913. * You may obtain a copy of the License at
  6914. *
  6915. * http://www.apache.org/licenses/LICENSE-2.0
  6916. *
  6917. * Unless required by applicable law or agreed to in writing, software
  6918. * distributed under the License is distributed on an "AS IS" BASIS,
  6919. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  6920. * See the License for the specific language governing permissions and
  6921. * limitations under the License.
  6922. * =============================================================================
  6923. */const so={kernelName:s.q,backendName:"webgl",kernelFunc:function(t){const{inputs:e,backend:n,attrs:r}=t,{dy:i,input:o}=e,a=o,{filterSize:l,strides:u,pad:c,dimRoundingMode:h}=r,d=s._115.computePool3DInfo(a.shape,l,u,[1,1,1],c,h),p=new oo(d);return n.runWebGLProgram(p,[i],a.dtype)}};
  6924. /**
  6925. * @license
  6926. * Copyright 2020 Google LLC. All Rights Reserved.
  6927. * Licensed under the Apache License, Version 2.0 (the "License");
  6928. * you may not use this file except in compliance with the License.
  6929. * You may obtain a copy of the License at
  6930. *
  6931. * http://www.apache.org/licenses/LICENSE-2.0
  6932. *
  6933. * Unless required by applicable law or agreed to in writing, software
  6934. * distributed under the License is distributed on an "AS IS" BASIS,
  6935. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  6936. * See the License for the specific language governing permissions and
  6937. * limitations under the License.
  6938. * =============================================================================
  6939. */const ao={kernelName:s.r,backendName:"webgl",kernelFunc:function(t){const{inputs:e,backend:n,attrs:r}=t,{dy:i,input:o}=e,a=o;ft([i,o],"avgPoolGrad");const{filterSize:l,strides:u,pad:c}=r,h=s._115.computePool2DInfo(a.shape,l,u,1,c),d=new io(h);return n.runWebGLProgram(d,[i],a.dtype)}};
  6940. /**
  6941. * @license
  6942. * Copyright 2020 Google LLC. All Rights Reserved.
  6943. * Licensed under the Apache License, Version 2.0 (the "License");
  6944. * you may not use this file except in compliance with the License.
  6945. * You may obtain a copy of the License at
  6946. *
  6947. * http://www.apache.org/licenses/LICENSE-2.0
  6948. *
  6949. * Unless required by applicable law or agreed to in writing, software
  6950. * distributed under the License is distributed on an "AS IS" BASIS,
  6951. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  6952. * See the License for the specific language governing permissions and
  6953. * limitations under the License.
  6954. * =============================================================================
  6955. */const lo={kernelName:s.s,backendName:"webgl",kernelFunc:function(t){const{inputs:e,backend:n,attrs:r}=t,{a:i,b:o}=e,{transposeA:s,transposeB:a}=r;return Ei({a:i,b:o,transposeA:s,transposeB:a,backend:n})}};
  6956. /**
  6957. * @license
  6958. * Copyright 2017 Google LLC. All Rights Reserved.
  6959. * Licensed under the Apache License, Version 2.0 (the "License");
  6960. * you may not use this file except in compliance with the License.
  6961. * You may obtain a copy of the License at
  6962. *
  6963. * http://www.apache.org/licenses/LICENSE-2.0
  6964. *
  6965. * Unless required by applicable law or agreed to in writing, software
  6966. * distributed under the License is distributed on an "AS IS" BASIS,
  6967. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  6968. * See the License for the specific language governing permissions and
  6969. * limitations under the License.
  6970. * =============================================================================
  6971. */
  6972. /**
  6973. * @license
  6974. * Copyright 2020 Google LLC. All Rights Reserved.
  6975. * Licensed under the Apache License, Version 2.0 (the "License");
  6976. * you may not use this file except in compliance with the License.
  6977. * You may obtain a copy of the License at
  6978. *
  6979. * http://www.apache.org/licenses/LICENSE-2.0
  6980. *
  6981. * Unless required by applicable law or agreed to in writing, software
  6982. * distributed under the License is distributed on an "AS IS" BASIS,
  6983. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  6984. * See the License for the specific language governing permissions and
  6985. * limitations under the License.
  6986. * =============================================================================
  6987. */
  6988. const uo={kernelName:s._8,backendName:"webgl",kernelFunc:({inputs:t,backend:e,attrs:n})=>{const{x:r,mean:i,variance:o,offset:a,scale:l}=t;s._152.assert(i.shape.length===o.shape.length,()=>"Batch normalization gradient requires mean and variance to have equal ranks."),s._152.assert(null==a||i.shape.length===a.shape.length,()=>"Batch normalization gradient requires mean and offset to have equal ranks."),s._152.assert(null==l||i.shape.length===l.shape.length,()=>"Batch normalization gradient requires mean and scale to have equal ranks.");let{varianceEpsilon:u}=n;null==u&&(u=.001);const c=[r,i,o];let h=null;null!=a&&(h=a.shape,c.push(a));let d=null;null!=l&&(d=l.shape,c.push(l));const p=Object(s._127)().getBool("WEBGL_PACK_NORMALIZATION")?new
  6989. /**
  6990. * @license
  6991. * Copyright 2018 Google LLC. All Rights Reserved.
  6992. * Licensed under the Apache License, Version 2.0 (the "License");
  6993. * you may not use this file except in compliance with the License.
  6994. * You may obtain a copy of the License at
  6995. *
  6996. * http://www.apache.org/licenses/LICENSE-2.0
  6997. *
  6998. * Unless required by applicable law or agreed to in writing, software
  6999. * distributed under the License is distributed on an "AS IS" BASIS,
  7000. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7001. * See the License for the specific language governing permissions and
  7002. * limitations under the License.
  7003. * =============================================================================
  7004. */
  7005. class{constructor(t,e,n,r,i,o){this.packedInputs=!0,this.packedOutput=!0,this.variableNames=["x","mean","variance"],s._115.assertAndGetBroadcastShape(t,e),s._115.assertAndGetBroadcastShape(t,n);let a="vec4(0.0)";null!=r&&(s._115.assertAndGetBroadcastShape(t,r),this.variableNames.push("offset"),a="getOffsetAtOutCoords()");let l="vec4(1.0)";null!=i&&(s._115.assertAndGetBroadcastShape(t,i),this.variableNames.push("scale"),l="getScaleAtOutCoords()"),this.outputShape=t,this.userCode=`\n void main() {\n vec4 offset = ${a};\n vec4 scale = ${l};\n\n vec4 x = getXAtOutCoords();\n vec4 mean = getMeanAtOutCoords();\n vec4 variance = getVarianceAtOutCoords();\n\n vec4 inv = scale * inversesqrt(variance + vec4(${o}));\n\n setOutput((x - mean) * inv + offset);\n }\n `}}(r.shape,i.shape,o.shape,h,d,u):new class{constructor(t,e,n,r,i,o){this.outputShape=[],this.variableNames=["x","mean","variance"],s._115.assertAndGetBroadcastShape(t,e),s._115.assertAndGetBroadcastShape(t,n);let a="0.0";null!=r&&(s._115.assertAndGetBroadcastShape(t,r),this.variableNames.push("offset"),a="getOffsetAtOutCoords()");let l="1.0";null!=i&&(s._115.assertAndGetBroadcastShape(t,i),this.variableNames.push("scale"),l="getScaleAtOutCoords()"),this.outputShape=t,this.userCode=`\n void main() {\n float x = getXAtOutCoords();\n float mean = getMeanAtOutCoords();\n float variance = getVarianceAtOutCoords();\n float offset = ${a};\n float scale = ${l};\n float inv = scale * inversesqrt(variance + float(${o}));\n setOutput(dot(vec3(x, -mean, offset), vec3(inv, inv, 1)));\n }\n `}}(r.shape,i.shape,o.shape,h,d,u);return e.runWebGLProgram(p,c,c[0].dtype)}};
  7006. /**
  7007. * @license
  7008. * Copyright 2017 Google LLC. All Rights Reserved.
  7009. * Licensed under the Apache License, Version 2.0 (the "License");
  7010. * you may not use this file except in compliance with the License.
  7011. * You may obtain a copy of the License at
  7012. *
  7013. * http://www.apache.org/licenses/LICENSE-2.0
  7014. *
  7015. * Unless required by applicable law or agreed to in writing, software
  7016. * distributed under the License is distributed on an "AS IS" BASIS,
  7017. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7018. * See the License for the specific language governing permissions and
  7019. * limitations under the License.
  7020. * =============================================================================
  7021. */
  7022. class co{constructor(t){this.variableNames=["source"],this.outputShape=t,this.rank=t.length;const e=Dt(this.rank);this.customUniforms=[{name:"start",arrayIndex:this.rank,type:"int"}];const n=function(t){if(1===t)return"sourceLoc";if(t<=6)return ho.slice(0,t).map(t=>"sourceLoc."+t).join(",");throw Error(`Slicing for rank ${t} is not yet supported`)}
  7023. /**
  7024. * @license
  7025. * Copyright 2019 Google LLC. All Rights Reserved.
  7026. * Licensed under the Apache License, Version 2.0 (the "License");
  7027. * you may not use this file except in compliance with the License.
  7028. * You may obtain a copy of the License at
  7029. *
  7030. * http://www.apache.org/licenses/LICENSE-2.0
  7031. *
  7032. * Unless required by applicable law or agreed to in writing, software
  7033. * distributed under the License is distributed on an "AS IS" BASIS,
  7034. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7035. * See the License for the specific language governing permissions and
  7036. * limitations under the License.
  7037. * =============================================================================
  7038. */(this.rank);let r;r=`\n ${e} sourceLoc;\n ${e} coords = getOutputCoords();\n ${t.map((t,e)=>`sourceLoc.${ho[e]} = start[${e}] + coords.${ho[e]};`).join("\n")}\n `,this.userCode=`\n void main() {\n ${r}\n setOutput(getSource(${n}));\n }\n `}}const ho=["x","y","z","w","u","v"];class po{constructor(t){this.variableNames=["source"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=t,this.rank=t.length,this.customUniforms=[{name:"start",arrayIndex:this.rank,type:"int"}];const e=Dt(this.rank),n=hr("coords",this.rank),r=hr("sourceLoc",this.rank),i=1===this.rank?"sourceLoc":`vec2(${r.slice(-2).join()})`,o=`getChannel(getSource(${r.join()}), ${i})`,s=`\n result.x = ${o};\n if (++${n[this.rank-1]} < ${t[this.rank-1]}) {\n ++${r[this.rank-1]};\n result.y = ${o};\n --${r[this.rank-1]};\n }\n `,a=1===this.rank?"":`\n --${n[this.rank-1]};\n if (++${n[this.rank-2]} < ${t[this.rank-2]}) {\n ++${r[this.rank-2]};\n result.z = ${o};\n if (++${n[this.rank-1]} < ${t[this.rank-1]}) {\n ++${r[this.rank-1]};\n result.w = ${o};\n }\n }\n `,l=this.rank<=4?`sourceLoc = coords +\n ${e}(${t.map((t,e)=>`start[${e}]`).join()});`:t.map((t,e)=>`${r[e]} = ${n[e]} + start[${e}];`).join("\n");this.userCode=`\n void main() {\n ${e} coords = getOutputCoords();\n ${e} sourceLoc;\n ${l}\n vec4 result = vec4(0.);\n ${s}\n ${a}\n setOutput(result);\n }\n `}}
  7039. /**
  7040. * @license
  7041. * Copyright 2020 Google LLC. All Rights Reserved.
  7042. * Licensed under the Apache License, Version 2.0 (the "License");
  7043. * you may not use this file except in compliance with the License.
  7044. * You may obtain a copy of the License at
  7045. *
  7046. * http://www.apache.org/licenses/LICENSE-2.0
  7047. *
  7048. * Unless required by applicable law or agreed to in writing, software
  7049. * distributed under the License is distributed on an "AS IS" BASIS,
  7050. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7051. * See the License for the specific language governing permissions and
  7052. * limitations under the License.
  7053. * =============================================================================
  7054. */function fo(t){const{inputs:e,backend:n,attrs:r}=t,{x:i}=e,{begin:o,size:a}=r,[l,u]=s._141.parseSliceParams(i,o,a);if(s._141.assertParamsValid(i,l,u),0===s._152.sizeFromShape(u))return n.makeTensorInfo(u,i.dtype,[]);if(n.shouldExecuteOnCPU([i])||"string"===i.dtype){const t=n.texData.get(i.dataId),e=qn(t.values,l,u,i.shape,i.dtype);return n.makeTensorInfo(u,i.dtype,e)}const{isPacked:c}=n.texData.get(i.dataId),h=s._141.isSliceContinous(i.shape,l,u);if(c||!h){const t=Object(s._127)().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new po(u):new co(u),e=[l];return n.runWebGLProgram(t,[i],i.dtype,e)}return n.uploadToGPU(i.dataId),function(t,e,n,r){const i=r.texData.get(t.dataId),o=r.makeTensorInfo(n,t.dtype),a=r.texData.get(o.dataId);Object.assign(a,i),a.refCount=1,a.shape=n,a.dtype=t.dtype;let l=s._141.computeFlatOffset(e,s._152.computeStrides(t.shape));i.slice&&(l+=i.slice.flatOffset),a.slice={flatOffset:l,origDataId:i.slice&&i.slice.origDataId||t.dataId};const u=r.dataRefCount.get(a.slice.origDataId)||1;return r.dataRefCount.set(a.slice.origDataId,u+1),o}(i,l,u,n)}const go={kernelName:s._81,backendName:"webgl",kernelFunc:fo},mo={kernelName:s.t,backendName:"webgl",kernelFunc:t=>{const{inputs:e,backend:n,attrs:r}=t,{x:i}=e,{blockShape:o,crops:a}=r;s._152.assert(i.shape.length<=4,()=>"batchToSpaceND for rank > 4 with a WebGL backend not implemented yet");const l=o.reduce((t,e)=>t*e),u=s._115.getReshaped(i.shape,o,l),c=s._115.getPermuted(u.length,o.length),h=s._115.getReshapedPermuted(i.shape,o,l),d=s._115.getSliceBeginCoords(a,o.length),p=s._115.getSliceSize(h,a,o.length),f=[],g=ci({inputs:{x:i},backend:n,attrs:{shape:u}}),m=yi({inputs:{x:g},backend:n,attrs:{perm:c}}),v=ci({inputs:{x:m},backend:n,attrs:{shape:h}}),b=fo({inputs:{x:v},backend:n,attrs:{begin:d,size:p}});return f.push(g),f.push(m),f.push(v),f.forEach(t=>n.disposeIntermediateTensorInfo(t)),b}};
  7055. /**
  7056. * @license
  7057. * Copyright 2020 Google LLC. All Rights Reserved.
  7058. * Licensed under the Apache License, Version 2.0 (the "License");
  7059. * you may not use this file except in compliance with the License.
  7060. * You may obtain a copy of the License at
  7061. *
  7062. * http://www.apache.org/licenses/LICENSE-2.0
  7063. *
  7064. * Unless required by applicable law or agreed to in writing, software
  7065. * distributed under the License is distributed on an "AS IS" BASIS,
  7066. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7067. * See the License for the specific language governing permissions and
  7068. * limitations under the License.
  7069. * =============================================================================
  7070. */const vo={kernelName:s.u,backendName:"webgl",kernelFunc:
  7071. /**
  7072. * @license
  7073. * Copyright 2020 Google LLC. All Rights Reserved.
  7074. * Licensed under the Apache License, Version 2.0 (the "License");
  7075. * you may not use this file except in compliance with the License.
  7076. * You may obtain a copy of the License at
  7077. *
  7078. * http://www.apache.org/licenses/LICENSE-2.0
  7079. *
  7080. * Unless required by applicable law or agreed to in writing, software
  7081. * distributed under the License is distributed on an "AS IS" BASIS,
  7082. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7083. * See the License for the specific language governing permissions and
  7084. * limitations under the License.
  7085. * =============================================================================
  7086. */
  7087. function(t){const{inputs:e,backend:n,attrs:r}=t,{x:i,weights:o}=e,{size:s}=r,a=n.readSync(i.dataId),l=n.readSync(o.dataId),u=En(a,l,o.dtype,o.shape,s);return n.makeTensorInfo([s],o.dtype,u)}};
  7088. /**
  7089. * @license
  7090. * Copyright 2021 Google LLC. All Rights Reserved.
  7091. * Licensed under the Apache License, Version 2.0 (the "License");
  7092. * you may not use this file except in compliance with the License.
  7093. * You may obtain a copy of the License at
  7094. *
  7095. * http://www.apache.org/licenses/LICENSE-2.0
  7096. *
  7097. * Unless required by applicable law or agreed to in writing, software
  7098. * distributed under the License is distributed on an "AS IS" BASIS,
  7099. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7100. * See the License for the specific language governing permissions and
  7101. * limitations under the License.
  7102. * =============================================================================
  7103. */const bo={kernelName:s.v,backendName:"webgl",kernelFunc:function(t){const{inputs:e,backend:n}=t,{s0:r,s1:i}=e,o=n.readSync(r.dataId),a=n.readSync(i.dataId),l=s._115.assertAndGetBroadcastShape(Array.from(o),Array.from(a));return n.makeTensorInfo([l.length],"int32",Int32Array.from(l))}},_o=ni({opSnippet:"return float(a != b);",cpuKernelImpl:Wn,dtype:"bool"}),yo={kernelName:s._51,backendName:"webgl",kernelFunc:_o};
  7104. /**
  7105. * @license
  7106. * Copyright 2020 Google LLC. All Rights Reserved.
  7107. * Licensed under the Apache License, Version 2.0 (the "License");
  7108. * you may not use this file except in compliance with the License.
  7109. * You may obtain a copy of the License at
  7110. *
  7111. * http://www.apache.org/licenses/LICENSE-2.0
  7112. *
  7113. * Unless required by applicable law or agreed to in writing, software
  7114. * distributed under the License is distributed on an "AS IS" BASIS,
  7115. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7116. * See the License for the specific language governing permissions and
  7117. * limitations under the License.
  7118. * =============================================================================
  7119. */
  7120. /**
  7121. * @license
  7122. * Copyright 2020 Google LLC. All Rights Reserved.
  7123. * Licensed under the Apache License, Version 2.0 (the "License");
  7124. * you may not use this file except in compliance with the License.
  7125. * You may obtain a copy of the License at
  7126. *
  7127. * http://www.apache.org/licenses/LICENSE-2.0
  7128. *
  7129. * Unless required by applicable law or agreed to in writing, software
  7130. * distributed under the License is distributed on an "AS IS" BASIS,
  7131. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7132. * See the License for the specific language governing permissions and
  7133. * limitations under the License.
  7134. * =============================================================================
  7135. */
  7136. function To(t){const{inputs:e,backend:n}=t,{input:r}=e;return Gr({inputs:{x:n.texData.get(r.dataId).complexTensorInfos.real},backend:n})}const xo={kernelName:s._60,backendName:"webgl",kernelFunc:To},Eo="return float(int(x));";
  7137. /**
  7138. * @license
  7139. * Copyright 2020 Google LLC. All Rights Reserved.
  7140. * Licensed under the Apache License, Version 2.0 (the "License");
  7141. * you may not use this file except in compliance with the License.
  7142. * You may obtain a copy of the License at
  7143. *
  7144. * http://www.apache.org/licenses/LICENSE-2.0
  7145. *
  7146. * Unless required by applicable law or agreed to in writing, software
  7147. * distributed under the License is distributed on an "AS IS" BASIS,
  7148. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7149. * See the License for the specific language governing permissions and
  7150. * limitations under the License.
  7151. * =============================================================================
  7152. */const wo={kernelName:s.w,backendName:"webgl",kernelFunc:
  7153. /**
  7154. * @license
  7155. * Copyright 2020 Google LLC. All Rights Reserved.
  7156. * Licensed under the Apache License, Version 2.0 (the "License");
  7157. * you may not use this file except in compliance with the License.
  7158. * You may obtain a copy of the License at
  7159. *
  7160. * http://www.apache.org/licenses/LICENSE-2.0
  7161. *
  7162. * Unless required by applicable law or agreed to in writing, software
  7163. * distributed under the License is distributed on an "AS IS" BASIS,
  7164. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7165. * See the License for the specific language governing permissions and
  7166. * limitations under the License.
  7167. * =============================================================================
  7168. */
  7169. function t(e){const{inputs:n,backend:r,attrs:i}=e,{x:o}=n,{dtype:a}=i;if("complex64"===a){if("complex64"===o.dtype)return Gr({inputs:{x:o},backend:r});const e=s._153(o.shape),n=t({inputs:{x:o},backend:r,attrs:{dtype:"float32"}}),i=Xr({inputs:{real:n,imag:e},backend:r});return e.dispose(),r.disposeIntermediateTensorInfo(n),i}if("complex64"===o.dtype){const e=To({inputs:{input:o},backend:r}),n=t({inputs:{x:e},backend:r,attrs:{dtype:a}});return r.disposeIntermediateTensorInfo(e),n}if(!s._152.hasEncodingLoss(o.dtype,a)){const t=Gr({inputs:{x:o},backend:r});return{dataId:t.dataId,shape:t.shape,dtype:a}}if("int32"===a)return function(t,e){const n=new br(t.shape,Eo),r=e.runWebGLProgram(n,[t],"int32");return{dataId:r.dataId,shape:r.shape,dtype:r.dtype}}(o,r);if("bool"===a){const t=r.makeTensorInfo([],"bool",s._152.getTypedArrayFromDType("bool",1)),e=_o({inputs:{a:o,b:t},backend:r});return r.disposeIntermediateTensorInfo(t),e}throw new Error(`Error in Cast: failed to cast ${o.dtype} to ${a}`)}},Co="return ceil(x);",So=ei({opSnippet:Co,packedOpSnippet:Co,cpuKernelImpl:Cn}),ko={kernelName:s.x,backendName:"webgl",kernelFunc:So};
  7170. /**
  7171. * @license
  7172. * Copyright 2020 Google LLC. All Rights Reserved.
  7173. * Licensed under the Apache License, Version 2.0 (the "License");
  7174. * you may not use this file except in compliance with the License.
  7175. * You may obtain a copy of the License at
  7176. *
  7177. * http://www.apache.org/licenses/LICENSE-2.0
  7178. *
  7179. * Unless required by applicable law or agreed to in writing, software
  7180. * distributed under the License is distributed on an "AS IS" BASIS,
  7181. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7182. * See the License for the specific language governing permissions and
  7183. * limitations under the License.
  7184. * =============================================================================
  7185. */
  7186. /**
  7187. * @license
  7188. * Copyright 2017 Google LLC. All Rights Reserved.
  7189. * Licensed under the Apache License, Version 2.0 (the "License");
  7190. * you may not use this file except in compliance with the License.
  7191. * You may obtain a copy of the License at
  7192. *
  7193. * http://www.apache.org/licenses/LICENSE-2.0
  7194. *
  7195. * Unless required by applicable law or agreed to in writing, software
  7196. * distributed under the License is distributed on an "AS IS" BASIS,
  7197. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7198. * See the License for the specific language governing permissions and
  7199. * limitations under the License.
  7200. * =============================================================================
  7201. */
  7202. class Oo{constructor(t){this.variableNames=["A"],this.customUniforms=[{name:"minVal",type:"float"},{name:"maxVal",type:"float"}],this.outputShape=t,this.userCode="\n\n void main() {\n float value = getAAtOutCoords();\n if (isnan(value)) {\n setOutput(value);\n return;\n }\n\n setOutput(clamp(value, minVal, maxVal));\n }\n "}}
  7203. /**
  7204. * @license
  7205. * Copyright 2018 Google LLC. All Rights Reserved.
  7206. * Licensed under the Apache License, Version 2.0 (the "License");
  7207. * you may not use this file except in compliance with the License.
  7208. * You may obtain a copy of the License at
  7209. *
  7210. * http://www.apache.org/licenses/LICENSE-2.0
  7211. *
  7212. * Unless required by applicable law or agreed to in writing, software
  7213. * distributed under the License is distributed on an "AS IS" BASIS,
  7214. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7215. * See the License for the specific language governing permissions and
  7216. * limitations under the License.
  7217. * =============================================================================
  7218. */class Io{constructor(t){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"minVal",type:"float"},{name:"maxVal",type:"float"}],this.outputShape=t,this.userCode="\n void main() {\n vec4 value = getAAtOutCoords();\n\n if (any(isnan(value))) {\n setOutput(value);\n return;\n }\n\n setOutput(clamp(value, vec4(minVal), vec4(maxVal)));\n }\n "}}
  7219. /**
  7220. * @license
  7221. * Copyright 2020 Google LLC. All Rights Reserved.
  7222. * Licensed under the Apache License, Version 2.0 (the "License");
  7223. * you may not use this file except in compliance with the License.
  7224. * You may obtain a copy of the License at
  7225. *
  7226. * http://www.apache.org/licenses/LICENSE-2.0
  7227. *
  7228. * Unless required by applicable law or agreed to in writing, software
  7229. * distributed under the License is distributed on an "AS IS" BASIS,
  7230. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7231. * See the License for the specific language governing permissions and
  7232. * limitations under the License.
  7233. * =============================================================================
  7234. */const Ro={kernelName:s.y,backendName:"webgl",kernelFunc:function(t){const{inputs:e,backend:n,attrs:r}=t,{x:i}=e,{clipValueMin:o,clipValueMax:a}=r;let l;l=Object(s._127)().getBool("WEBGL_PACK_CLIP")?new Io(i.shape):new Oo(i.shape);const u=[[o],[a]];return n.runWebGLProgram(l,[i],i.dtype,u)}};
  7235. /**
  7236. * @license
  7237. * Copyright 2018 Google LLC. All Rights Reserved.
  7238. * Licensed under the Apache License, Version 2.0 (the "License");
  7239. * you may not use this file except in compliance with the License.
  7240. * You may obtain a copy of the License at
  7241. *
  7242. * http://www.apache.org/licenses/LICENSE-2.0
  7243. *
  7244. * Unless required by applicable law or agreed to in writing, software
  7245. * distributed under the License is distributed on an "AS IS" BASIS,
  7246. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7247. * See the License for the specific language governing permissions and
  7248. * limitations under the License.
  7249. * =============================================================================
  7250. */class Ao{constructor(t){this.variableNames=["real","imag"],this.outputShape=t,this.userCode="\n void main() {\n float re = abs(getRealAtOutCoords());\n float im = abs(getImagAtOutCoords());\n float mx = max(re, im);\n\n // sadly the length function in glsl is not underflow-safe\n // (at least not on Intel GPUs). So the safe solution is\n // to ensure underflow-safety in all cases.\n setOutput(\n mx == 0.0 ? 0.0 : mx * length(vec2(1, min(re, im)/mx))\n );\n }\n "}}
  7251. /**
  7252. * @license
  7253. * Copyright 2020 Google LLC. All Rights Reserved.
  7254. * Licensed under the Apache License, Version 2.0 (the "License");
  7255. * you may not use this file except in compliance with the License.
  7256. * You may obtain a copy of the License at
  7257. *
  7258. * http://www.apache.org/licenses/LICENSE-2.0
  7259. *
  7260. * Unless required by applicable law or agreed to in writing, software
  7261. * distributed under the License is distributed on an "AS IS" BASIS,
  7262. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7263. * See the License for the specific language governing permissions and
  7264. * limitations under the License.
  7265. * =============================================================================
  7266. */function No(t,e){return{dataId:e.dataId,dtype:e.dtype,shape:t.shape}}const Do={kernelName:s.A,backendName:"webgl",kernelFunc:function(t){const{inputs:e,backend:n}=t,{x:r}=e,i=n.texData.get(r.dataId),o=new Ao(r.shape),s=[No(r,i.complexTensorInfos.real),No(r,i.complexTensorInfos.imag)];return n.runWebGLProgram(o,s,s[0].dtype)}};
  7267. /**
  7268. * @license
  7269. * Copyright 2017 Google LLC. All Rights Reserved.
  7270. * Licensed under the Apache License, Version 2.0 (the "License");
  7271. * you may not use this file except in compliance with the License.
  7272. * You may obtain a copy of the License at
  7273. *
  7274. * http://www.apache.org/licenses/LICENSE-2.0
  7275. *
  7276. * Unless required by applicable law or agreed to in writing, software
  7277. * distributed under the License is distributed on an "AS IS" BASIS,
  7278. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7279. * See the License for the specific language governing permissions and
  7280. * limitations under the License.
  7281. * =============================================================================
  7282. */class Mo{constructor(t){this.outputShape=[],this.outputShape=s._115.computeOutShape(t,1),this.variableNames=t.map((t,e)=>`T${e}`);const e=new Array(t.length-1);e[0]=t[0][1];for(let n=1;n<e.length;n++)e[n]=e[n-1]+t[n][1];const n=[`if (yC < ${e[0]}) setOutput(getT0(yR, yC));`];for(let t=1;t<e.length;t++){const r=e[t-1];n.push(`else if (yC < ${e[t]}) `+`setOutput(getT${t}(yR, yC-${r}));`)}const r=e.length,i=e[e.length-1];n.push(`else setOutput(getT${r}(yR, yC-${i}));`),this.userCode=`\n void main() {\n ivec2 coords = getOutputCoords();\n int yR = coords.x;\n int yC = coords.y;\n\n ${n.join("\n ")}\n }\n `}}
  7283. /**
  7284. * @license
  7285. * Copyright 2019 Google LLC. All Rights Reserved.
  7286. * Licensed under the Apache License, Version 2.0 (the "License");
  7287. * you may not use this file except in compliance with the License.
  7288. * You may obtain a copy of the License at
  7289. *
  7290. * http://www.apache.org/licenses/LICENSE-2.0
  7291. *
  7292. * Unless required by applicable law or agreed to in writing, software
  7293. * distributed under the License is distributed on an "AS IS" BASIS,
  7294. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7295. * See the License for the specific language governing permissions and
  7296. * limitations under the License.
  7297. * =============================================================================
  7298. */class Lo{constructor(t,e){this.packedInputs=!0,this.packedOutput=!0,this.outputShape=[],this.outputShape=s._115.computeOutShape(t,e);const n=this.outputShape,r=n.length,i=Dt(r),o=hr("coords",r),a=["x","y","z","w","u","v"].slice(0,r);this.variableNames=t.map((t,e)=>`T${e}`);const l=new Array(t.length-1);l[0]=t[0][e];for(let n=1;n<l.length;n++)l[n]=l[n-1]+t[n][e];const u=a[e],c=a.slice(-2),h=a.join();let d=`if (${u} < ${l[0]}) {\n return getChannel(\n getT0(${h}), vec2(${c.join()}));\n }`;for(let t=1;t<l.length;t++){const e=l[t-1];d+=`\n if (${u} < ${l[t]} && ${u} >= ${l[t-1]}) {\n return getChannel(\n getT${t}(${Po(a,u,e)}),\n vec2(${Po(c,u,e)}));\n }`}const p=l.length,f=l[l.length-1];d+=`\n return getChannel(\n getT${p}(${Po(a,u,f)}),\n vec2(${Po(c,u,f)}));`,this.userCode=`\n float getValue(${a.map(t=>"int "+t)}) {\n ${d}\n }\n\n void main() {\n ${i} coords = getOutputCoords();\n vec4 result = vec4(getValue(${o}), 0., 0., 0.);\n\n ${o[r-1]} = ${o[r-1]} + 1;\n if (${o[r-1]} < ${n[r-1]}) {\n result.g = getValue(${o});\n }\n\n ${o[r-2]} = ${o[r-2]} + 1;\n if (${o[r-2]} < ${n[r-2]}) {\n result.a = getValue(${o});\n }\n\n ${o[r-1]} = ${o[r-1]} - 1;\n if (${o[r-2]} < ${n[r-2]} &&\n ${o[r-1]} < ${n[r-1]}) {\n result.b = getValue(${o});\n }\n setOutput(result);\n }\n `}}function Po(t,e,n){const r=t.indexOf(e);return t.map((t,e)=>e===r?`${t} - ${n}`:t).join()}
  7299. /**
  7300. * @license
  7301. * Copyright 2020 Google LLC. All Rights Reserved.
  7302. * Licensed under the Apache License, Version 2.0 (the "License");
  7303. * you may not use this file except in compliance with the License.
  7304. * You may obtain a copy of the License at
  7305. *
  7306. * http://www.apache.org/licenses/LICENSE-2.0
  7307. *
  7308. * Unless required by applicable law or agreed to in writing, software
  7309. * distributed under the License is distributed on an "AS IS" BASIS,
  7310. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7311. * See the License for the specific language governing permissions and
  7312. * limitations under the License.
  7313. * =============================================================================
  7314. */function Fo(t){const{inputs:e,backend:n}=t,{input:r}=e;return Gr({inputs:{x:n.texData.get(r.dataId).complexTensorInfos.imag},backend:n})}const Bo={kernelName:s._17,backendName:"webgl",kernelFunc:Fo};
  7315. /**
  7316. * @license
  7317. * Copyright 2020 Google LLC. All Rights Reserved.
  7318. * Licensed under the Apache License, Version 2.0 (the "License");
  7319. * you may not use this file except in compliance with the License.
  7320. * You may obtain a copy of the License at
  7321. *
  7322. * http://www.apache.org/licenses/LICENSE-2.0
  7323. *
  7324. * Unless required by applicable law or agreed to in writing, software
  7325. * distributed under the License is distributed on an "AS IS" BASIS,
  7326. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7327. * See the License for the specific language governing permissions and
  7328. * limitations under the License.
  7329. * =============================================================================
  7330. */function jo(t,e,n){const r=t[0].dtype;if("complex64"===r){const r=t.map(t=>To({inputs:{input:t},backend:n})),i=t.map(t=>Fo({inputs:{input:t},backend:n})),o=jo(r,e,n),s=jo(i,e,n),a=Xr({inputs:{real:o,imag:s},backend:n});return r.forEach(t=>n.disposeIntermediateTensorInfo(t)),i.forEach(t=>n.disposeIntermediateTensorInfo(t)),n.disposeIntermediateTensorInfo(o),n.disposeIntermediateTensorInfo(s),a}let i=n.shouldExecuteOnCPU(t);if("string"===r&&(i=!0),i){const i=t.map(t=>{const r=s._152.sizeFromShape(t.shape.slice(e));return ci({inputs:{x:t},backend:n,attrs:{shape:[-1,r]}})}),o=i.map(t=>({vals:n.readSync(t.dataId),shape:t.shape})),a=s._115.computeOutShape(i.map(t=>t.shape),1),l=1===i[0].shape[0],u=Sn(o,a,r,l),c=s._115.computeOutShape(t.map(t=>t.shape),e),h=n.makeTensorInfo(c,r,u);return i.forEach(t=>n.disposeIntermediateTensorInfo(t)),h}if(t.length>Object(s._127)().getNumber("WEBGL_MAX_TEXTURES_IN_SHADER")){const r=Math.floor(t.length/2),i=jo(t.slice(0,r),e,n),o=jo(t.slice(r),e,n),s=jo([i,o],e,n);return n.disposeIntermediateTensorInfo(i),n.disposeIntermediateTensorInfo(o),s}if(Object(s._127)().getBool("WEBGL_PACK_ARRAY_OPERATIONS")&&t[0].shape.length>1){const i=new Lo(t.map(t=>t.shape),e);return n.runWebGLProgram(i,t,r)}const{tensors2D:o,outShape:a}=function(t,e,n){const r=s._115.computeOutShape(t.map(t=>t.shape),e);return{tensors2D:t.map(t=>ci({inputs:{x:t},attrs:{shape:[-1,s._152.sizeFromShape(t.shape.slice(e))]},backend:n})),outShape:r}}
  7331. /**
  7332. * @license
  7333. * Copyright 2020 Google LLC. All Rights Reserved.
  7334. * Licensed under the Apache License, Version 2.0 (the "License");
  7335. * you may not use this file except in compliance with the License.
  7336. * You may obtain a copy of the License at
  7337. *
  7338. * http://www.apache.org/licenses/LICENSE-2.0
  7339. *
  7340. * Unless required by applicable law or agreed to in writing, software
  7341. * distributed under the License is distributed on an "AS IS" BASIS,
  7342. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7343. * See the License for the specific language governing permissions and
  7344. * limitations under the License.
  7345. * =============================================================================
  7346. */(t,e,n),l=new Mo(o.map(t=>t.shape)),u=n.runWebGLProgram(l,o,r);o.forEach(t=>n.disposeIntermediateTensorInfo(t));const c=ci({inputs:{x:u},attrs:{shape:a},backend:n});return n.disposeIntermediateTensorInfo(u),c}function $o(t){const{inputs:e,backend:n,attrs:r}=t,{axis:i}=r,o=s._152.parseAxisParam(i,e[0].shape)[0],a=s._115.computeOutShape(e.map(t=>t.shape),o);if(0===s._152.sizeFromShape(a))return n.makeTensorInfo(a,e[0].dtype,[]);const l=e.filter(t=>s._152.sizeFromShape(t.shape)>0);if(1===l.length)return Gr({inputs:{x:l[0]},backend:n});const u=l.map(t=>t.shape);return s._115.assertParamsConsistent(u,o),jo(l,o,n)}const Uo={kernelName:s.B,backendName:"webgl",kernelFunc:$o};
  7347. /**
  7348. * @license
  7349. * Copyright 2017 Google LLC. All Rights Reserved.
  7350. * Licensed under the Apache License, Version 2.0 (the "License");
  7351. * you may not use this file except in compliance with the License.
  7352. * You may obtain a copy of the License at
  7353. *
  7354. * http://www.apache.org/licenses/LICENSE-2.0
  7355. *
  7356. * Unless required by applicable law or agreed to in writing, software
  7357. * distributed under the License is distributed on an "AS IS" BASIS,
  7358. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7359. * See the License for the specific language governing permissions and
  7360. * limitations under the License.
  7361. * =============================================================================
  7362. */class Vo{constructor(t,e=!1,n=null,r=!1,i=!1){this.variableNames=["x","W"],this.outputShape=t.outShape;const o=t.padInfo.top,s=t.padInfo.left,a=t.strideHeight,l=t.strideWidth,u=t.dilationHeight,c=t.dilationWidth,h=t.filterHeight,d=t.filterWidth,p=4*Math.floor(t.inChannels/4),f=t.inChannels%4,g="channelsLast"===t.dataFormat,m=g?1:2,v=g?2:3,b=g?3:1;let _="",y="";n&&(_=r?`float activation(float a) {\n float b = getPreluActivationWeightsAtOutCoords();\n ${n}\n }`:i?`float activation(float a) {\n float b = getLeakyreluAlphaAtOutCoords();\n ${n}\n }`:`\n float activation(float x) {\n ${n}\n }\n `,y="result = activation(result);");const T=e?"result += getBiasAtOutCoords();":"";e&&this.variableNames.push("bias"),r&&this.variableNames.push("preluActivationWeights"),i&&this.variableNames.push("leakyreluAlpha"),this.userCode=`\n ${_}\n\n const ivec2 strides = ivec2(${a}, ${l});\n const ivec2 pads = ivec2(${o}, ${s});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d2 = coords[${b}];\n\n ivec2 xRCCorner =\n ivec2(coords[${m}], coords[${v}]) * strides - pads;\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // Convolve x(?, ?, d1) with w(:, :, d1, d2) to get y(yR, yC, d2).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < ${h}; wR++) {\n int xR = xRCorner + wR * ${u};\n\n if (xR < 0 || xR >= ${t.inHeight}) {\n continue;\n }\n\n for (int wC = 0; wC < ${d}; wC++) {\n int xC = xCCorner + wC * ${c};\n\n if (xC < 0 || xC >= ${t.inWidth}) {\n continue;\n }\n\n for (int d1 = 0; d1 < ${p}; d1 += 4) {\n vec4 wValues = vec4(\n getW(wR, wC, d1, d2),\n getW(wR, wC, d1 + 1, d2),\n getW(wR, wC, d1 + 2, d2),\n getW(wR, wC, d1 + 3, d2)\n );\n\n if (${g}) {\n vec4 xValues = vec4(\n getX(batch, xR, xC, d1),\n getX(batch, xR, xC, d1 + 1),\n getX(batch, xR, xC, d1 + 2),\n getX(batch, xR, xC, d1 + 3)\n );\n dotProd += dot(xValues, wValues);\n } else {\n vec4 xValues = vec4(\n getX(batch, d1, xR, xC),\n getX(batch, d1 + 1, xR, xC),\n getX(batch, d1 + 2, xR, xC),\n getX(batch, d1 + 3, xR, xC)\n );\n dotProd += dot(xValues, wValues);\n }\n }\n\n if (${1===f}) {\n\n if (${g}) {\n dotProd +=\n getX(batch, xR, xC, ${p}) *\n getW(wR, wC, ${p}, d2);\n } else {\n dotProd +=\n getX(batch, ${p}, xR, xC) *\n getW(wR, wC, ${p}, d2);\n }\n\n } else if (${2===f}) {\n vec2 wValues = vec2(\n getW(wR, wC, ${p}, d2),\n getW(wR, wC, ${p} + 1, d2)\n );\n\n if (${g}) {\n vec2 xValues = vec2(\n getX(batch, xR, xC, ${p}),\n getX(batch, xR, xC, ${p} + 1)\n );\n dotProd += dot(xValues, wValues);\n } else {\n vec2 xValues = vec2(\n getX(batch, ${p}, xR, xC),\n getX(batch, ${p} + 1, xR, xC)\n );\n dotProd += dot(xValues, wValues);\n }\n\n } else if (${3===f}) {\n vec3 wValues = vec3(\n getW(wR, wC, ${p}, d2),\n getW(wR, wC, ${p} + 1, d2),\n getW(wR, wC, ${p} + 2, d2)\n );\n\n if (${g}) {\n vec3 xValues = vec3(\n getX(batch, xR, xC, ${p}),\n getX(batch, xR, xC, ${p} + 1),\n getX(batch, xR, xC, ${p} + 2)\n );\n dotProd += dot(xValues, wValues);\n } else {\n vec3 xValues = vec3(\n getX(batch, ${p}, xR, xC),\n getX(batch, ${p} + 1, xR, xC),\n getX(batch, ${p} + 2, xR, xC)\n );\n dotProd += dot(xValues, wValues);\n }\n\n }\n }\n }\n\n float result = dotProd;\n ${T}\n ${y}\n setOutput(result);\n }\n `}}class Ho{constructor(t){this.variableNames=["x","W"],this.outputShape=t.outShape;const e=t.padInfo.front,n=t.padInfo.top,r=t.padInfo.left,i=t.strideDepth,o=t.strideHeight,s=t.strideWidth,a=t.dilationDepth,l=t.dilationHeight,u=t.dilationWidth,c=t.filterDepth,h=t.filterHeight,d=t.filterWidth,p=4*Math.floor(t.inChannels/4),f=t.inChannels%4;this.userCode=`\n const ivec3 strides = ivec3(${i}, ${o}, ${s});\n const ivec3 pads = ivec3(${e}, ${n}, ${r});\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int d2 = coords.u;\n\n ivec3 xFRCCorner = ivec3(coords.y, coords.z, coords.w) * strides - pads;\n int xFCorner = xFRCCorner.x;\n int xRCorner = xFRCCorner.y;\n int xCCorner = xFRCCorner.z;\n\n // Convolve x(?, ?, ?, d1) with w(:, :, :, d1, d2) to get\n // y(yF, yR, yC, d2). ? = to be determined. : = across all\n // values in that axis.\n float dotProd = 0.0;\n for (int wF = 0; wF < ${c}; wF++) {\n int xF = xFCorner + wF * ${a};\n\n if (xF < 0 || xF >= ${t.inDepth}) {\n continue;\n }\n\n for (int wR = 0; wR < ${h}; wR++) {\n int xR = xRCorner + wR * ${l};\n\n if (xR < 0 || xR >= ${t.inHeight}) {\n continue;\n }\n\n for (int wC = 0; wC < ${d}; wC++) {\n int xC = xCCorner + wC * ${u};\n\n if (xC < 0 || xC >= ${t.inWidth}) {\n continue;\n }\n\n for (int d1 = 0; d1 < ${p}; d1 += 4) {\n vec4 xValues = vec4(\n getX(batch, xF, xR, xC, d1),\n getX(batch, xF, xR, xC, d1 + 1),\n getX(batch, xF, xR, xC, d1 + 2),\n getX(batch, xF, xR, xC, d1 + 3)\n );\n vec4 wValues = vec4(\n getW(wF, wR, wC, d1, d2),\n getW(wF, wR, wC, d1 + 1, d2),\n getW(wF, wR, wC, d1 + 2, d2),\n getW(wF, wR, wC, d1 + 3, d2)\n );\n\n dotProd += dot(xValues, wValues);\n }\n\n if (${1===f}) {\n dotProd +=\n getX(batch, xF, xR, xC, ${p}) *\n getW(wF, wR, wC, ${p}, d2);\n } else if (${2===f}) {\n vec2 xValues = vec2(\n getX(batch, xF, xR, xC, ${p}),\n getX(batch, xF, xR, xC, ${p} + 1)\n );\n vec2 wValues = vec2(\n getW(wF, wR, wC, ${p}, d2),\n getW(wF, wR, wC, ${p} + 1, d2)\n );\n dotProd += dot(xValues, wValues);\n } else if (${3===f}) {\n vec3 xValues = vec3(\n getX(batch, xF, xR, xC, ${p}),\n getX(batch, xF, xR, xC, ${p} + 1),\n getX(batch, xF, xR, xC, ${p} + 2)\n );\n vec3 wValues = vec3(\n getW(wF, wR, wC, ${p}, d2),\n getW(wF, wR, wC, ${p} + 1, d2),\n getW(wF, wR, wC, ${p} + 2, d2)\n );\n dotProd += dot(xValues, wValues);\n }\n }\n }\n }\n setOutput(dotProd);\n }\n `}}
  7363. /**
  7364. * @license
  7365. * Copyright 2019 Google LLC. All Rights Reserved.
  7366. * Licensed under the Apache License, Version 2.0 (the "License");
  7367. * you may not use this file except in compliance with the License.
  7368. * You may obtain a copy of the License at
  7369. *
  7370. * http://www.apache.org/licenses/LICENSE-2.0
  7371. *
  7372. * Unless required by applicable law or agreed to in writing, software
  7373. * distributed under the License is distributed on an "AS IS" BASIS,
  7374. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7375. * See the License for the specific language governing permissions and
  7376. * limitations under the License.
  7377. * =============================================================================
  7378. */class Wo{constructor(t,e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"inputShape",type:"ivec3"},{name:"pad",type:"ivec2"},{name:"stride",type:"ivec2"},{name:"dilation",type:"ivec2"},{name:"inChannels",type:"int"},{name:"itemsPerBlockRow",type:"int"},{name:"outWidth",type:"int"}],this.outputShape=t,this.enableShapeUniforms=Bt(this.outputShape.length);const{dataFormat:n}=e,r=mt(),i="channelsLast"===n,o=i?0:1,s=i?1:2,a=this.enableShapeUniforms?"if(blockIndex < outShape[1] && pos < outShape[0]) {":`if(blockIndex < ${t[1]} && pos < ${t[0]}) {`;let l="";for(let t=0;t<=1;t++)for(let e=0;e<=1;e++)l+=`\n blockIndex = rc.y + ${e};\n pos = rc.x + ${t};\n\n ${a}\n offsetY = int(blockIndex / outWidth) * stride[0] - pad[0];\n d0 = offsetY + dilation[0] * (pos / itemsPerBlockRow);\n\n if(d0 < inputShape[${o}] && d0 >= 0) {\n // Use custom imod instead mod. On Intel GPU, mod may generate\n // unexpected value.\n // https://github.com/tensorflow/tfjs/issues/5447\n offsetX = imod(blockIndex, outWidth) * stride[1] - pad[1];\n d1 = offsetX + dilation[1] * (imod(pos, itemsPerBlockRow) /\n inChannels);\n\n if(d1 < inputShape[${s}] && d1 >= 0) {\n\n ch = imod(pos, inChannels);\n\n if (${i}) {\n innerDims = vec2(d1, ch);\n result[${2*t+e}] = getChannel(\n getA(d0, int(innerDims.x),\n int(innerDims.y)), innerDims);\n } else {\n innerDims = vec2(d0, d1);\n result[${2*t+e}] = getChannel(\n getA(ch, int(innerDims.x),\n int(innerDims.y)), innerDims);\n }\n }\n }\n }\n `;this.userCode=`\n void main() {\n ivec2 rc = getOutputCoords();\n\n vec4 result = vec4(0);\n\n int blockIndex, pos, offsetY, d0, offsetX, d1, ch;\n vec2 innerDims;\n\n ${l}\n\n ${r.output} = result;\n }\n `}}
  7379. /**
  7380. * @license
  7381. * Copyright 2020 Google LLC. All Rights Reserved.
  7382. * Licensed under the Apache License, Version 2.0 (the "License");
  7383. * you may not use this file except in compliance with the License.
  7384. * You may obtain a copy of the License at
  7385. *
  7386. * http://www.apache.org/licenses/LICENSE-2.0
  7387. *
  7388. * Unless required by applicable law or agreed to in writing, software
  7389. * distributed under the License is distributed on an "AS IS" BASIS,
  7390. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7391. * See the License for the specific language governing permissions and
  7392. * limitations under the License.
  7393. * =============================================================================
  7394. */function Go({x:t,filter:e,convInfo:n,backend:r,bias:i=null,preluActivationWeights:o=null,leakyreluAlpha:a=0,activation:l=null}){const u=t.shape,c=r.texData.get(t.dataId),h=n.inChannels,d=u[0]*u[1]*u[2],p=n.outChannels,f="channelsLast"===n.dataFormat;let g;const m=[];if(!((1===d||1===p)&&h>xi)&&c.isPacked&&f&&null!=c.texture&&u[2]%2!=0&&s._152.arraysEqual(c.shape.slice(-3),u.slice(-3))){const h=u[0]*u[1]*(u[2]+1),d={dataId:t.dataId,shape:[1,h,n.inChannels],dtype:t.dtype},p=c.shape;c.shape=c.shape.slice(),c.shape[c.shape.length-2]++,s._152.assert(tt(c.shape,d.shape),()=>`packed reshape ${c.shape} to ${d.shape} isn't free`);const f=ci({inputs:{x:e},backend:r,attrs:{shape:[1,n.inChannels,n.outChannels]}});m.push(f);const v=Ei({a:d,b:f,backend:r,transposeA:!1,transposeB:!1,bias:i,activation:l,preluActivationWeights:o,leakyreluAlpha:a}),b=r.texData.get(v.dataId);s._152.assert(b.isPacked,()=>"batchMatMul result is expected to be packed"),c.shape=p,b.shape=n.outShape,(g=Gr({inputs:{x:v},backend:r})).shape=n.outShape,m.push(v)}else{const s=ci({inputs:{x:t},backend:r,attrs:{shape:[1,f?u[0]*u[1]*u[2]:u[0]*u[2]*u[3],n.inChannels]}}),c=ci({inputs:{x:e},backend:r,attrs:{shape:[1,n.inChannels,n.outChannels]}}),h=Ei({a:s,b:c,transposeA:!1,transposeB:!1,backend:r,bias:i,activation:l,preluActivationWeights:o,leakyreluAlpha:a});g=ci({inputs:{x:h},backend:r,attrs:{shape:n.outShape}}),m.push(s),m.push(c),m.push(h)}for(const t of m)r.disposeIntermediateTensorInfo(t);return g}function zo({x:t,filter:e,convInfo:n,backend:r,bias:i=null,preluActivationWeights:o=null,leakyreluAlpha:a=0,activation:l=null}){const{filterWidth:u,filterHeight:c,inChannels:h,outWidth:d,outHeight:p,dataFormat:f}=n,g="channelsLast"===f,m=u*c*h,v=p*d,b=[m,v],_=[],y=ci({inputs:{x:t},backend:r,attrs:{shape:t.shape.slice(1)}}),T=ci({inputs:{x:e},backend:r,attrs:{shape:[1,m,s._152.sizeFromShape(e.shape)/m]}});_.push(y),_.push(T);const x=new Wo(b,n),E=[y.shape,[n.padInfo.top,n.padInfo.left],[n.strideHeight,n.strideWidth],[n.dilationHeight,n.dilationWidth],[n.inChannels],[n.filterWidth*n.inChannels],[n.outWidth]],w=r.runWebGLProgram(x,[y],"float32",E),C=ci({inputs:{x:w},backend:r,attrs:{shape:[1,b[0],b[1]]}});_.push(w),_.push(C);const S=null!=i,k=null!=o,O="leakyrelu"===l,I=l?ri(l,!0):null,R=new ii(C.shape,T.shape,[1,v,n.outChannels],!0,!1,S,I,k,O),A=[C,T];if(i&&A.push(i),k&&A.push(o),O){const t=r.makeTensorInfo([],"float32",s._152.createScalarValue(a,"float32"));A.push(t),_.push(t)}const N=r.runWebGLProgram(R,A,"float32"),D=ci({inputs:{x:N},backend:r,attrs:{shape:g?[1,p,d,n.outChannels]:[1,n.outChannels,p,d]}});_.push(N);for(const t of _)r.disposeIntermediateTensorInfo(t);return D}
  7395. /**
  7396. * @license
  7397. * Copyright 2020 Google LLC. All Rights Reserved.
  7398. * Licensed under the Apache License, Version 2.0 (the "License");
  7399. * you may not use this file except in compliance with the License.
  7400. * You may obtain a copy of the License at
  7401. *
  7402. * http://www.apache.org/licenses/LICENSE-2.0
  7403. *
  7404. * Unless required by applicable law or agreed to in writing, software
  7405. * distributed under the License is distributed on an "AS IS" BASIS,
  7406. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7407. * See the License for the specific language governing permissions and
  7408. * limitations under the License.
  7409. * =============================================================================
  7410. */const Xo={kernelName:s.C,backendName:"webgl",kernelFunc:function(t){const{inputs:e,backend:n,attrs:r}=t,{x:i,filter:o}=e,{strides:a,pad:l,dataFormat:u,dilations:c,dimRoundingMode:h}=r,d=s._115.convertConv2DDataFormat(u),p=s._115.computeConv2DInfo(i.shape,o.shape,a,c,l,h,!1,d);let f;if(1!==p.filterHeight||1!==p.filterWidth||1!==p.dilationHeight||1!==p.dilationWidth||1!==p.strideHeight||1!==p.strideWidth||"SAME"!==p.padInfo.type&&"VALID"!==p.padInfo.type)if(Object(s._127)().getBool("WEBGL_CONV_IM2COL")&&1===i.shape[0])f=zo({x:i,filter:o,convInfo:p,backend:n});else{const t=new Vo(p);f=n.runWebGLProgram(t,[i,o],"float32")}else f=Go({x:i,filter:o,convInfo:p,backend:n});const g=ci({inputs:{x:f},backend:n,attrs:{shape:p.outShape}});return n.disposeIntermediateTensorInfo(f),g}};
  7411. /**
  7412. * @license
  7413. * Copyright 2017 Google LLC. All Rights Reserved.
  7414. * Licensed under the Apache License, Version 2.0 (the "License");
  7415. * you may not use this file except in compliance with the License.
  7416. * You may obtain a copy of the License at
  7417. *
  7418. * http://www.apache.org/licenses/LICENSE-2.0
  7419. *
  7420. * Unless required by applicable law or agreed to in writing, software
  7421. * distributed under the License is distributed on an "AS IS" BASIS,
  7422. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7423. * See the License for the specific language governing permissions and
  7424. * limitations under the License.
  7425. * =============================================================================
  7426. */class Ko{constructor(t){this.variableNames=["x","dy"],this.outputShape=t.filterShape;const e=t.strideHeight,n=t.strideWidth,r=t.padInfo.top,i=t.padInfo.left,o="channelsLast"===t.dataFormat;this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int wR = coords.x;\n int wC = coords.y;\n int d1 = coords.z;\n int d2 = coords.w;\n\n // Convolve x(?, ?, d1) with dy(:, :, d2) to get dw(wR, wC, d1, d2).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n\n for (int b = 0; b < ${t.batchSize}; b++) {\n for (int yR = 0; yR < ${t.outHeight}; yR++) {\n int xR = wR + yR * ${e} - ${r};\n\n if (xR < 0 || xR >= ${t.inHeight}) {\n continue;\n }\n\n for (int yC = 0; yC < ${t.outWidth}; yC++) {\n int xC = wC + yC * ${n} - ${i};\n\n if (xC < 0 || xC >= ${t.inWidth}) {\n continue;\n }\n\n if (${o}) {\n float dyValue = getDy(b, yR, yC, d2);\n float xValue = getX(b, xR, xC, d1);\n dotProd += (xValue * dyValue);\n } else {\n float dyValue = getDy(b, d2, yR, yC);\n float xValue = getX(b, d1, xR, xC);\n dotProd += (xValue * dyValue);\n }\n\n }\n }\n }\n setOutput(dotProd);\n }\n `}}class Yo{constructor(t){this.variableNames=["dy","W"],this.outputShape=t.inShape;const e=t.filterHeight,n=t.filterWidth,r=t.strideHeight,i=t.strideWidth,o="channelsLast"===t.dataFormat,s=e-1-t.padInfo.top,a=n-1-t.padInfo.left,l=o?1:2,u=o?2:3,c=o?3:1;this.userCode=`\n const ivec2 pads = ivec2(${s}, ${a});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d1 = coords[${c}];\n\n ivec2 dyCorner = ivec2(coords[${l}], coords[${u}]) - pads;\n int dyRCorner = dyCorner.x;\n int dyCCorner = dyCorner.y;\n\n // Convolve dy(?, ?, d2) with w(:, :, d1, d2) to compute dx(xR, xC, d1).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < ${e}; wR++) {\n float dyR = float(dyRCorner + wR) / ${r}.0;\n\n if (dyR < 0.0 || dyR >= ${t.outHeight}.0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n int wRPerm = ${e} - 1 - wR;\n\n for (int wC = 0; wC < ${n}; wC++) {\n float dyC = float(dyCCorner + wC) / ${i}.0;\n\n if (dyC < 0.0 || dyC >= ${t.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n int wCPerm = ${n} - 1 - wC;\n\n for (int d2 = 0; d2 < ${t.outChannels}; d2++) {\n\n if (${o}) {\n float xValue = getDy(batch, idyR, idyC, d2);\n float wValue = getW(wRPerm, wCPerm, d1, d2);\n dotProd += xValue * wValue;\n } else {\n float xValue = getDy(batch, d2, idyR, idyC);\n float wValue = getW(wRPerm, wCPerm, d1, d2);\n dotProd += xValue * wValue;\n }\n\n }\n }\n }\n setOutput(dotProd);\n }\n `}}class qo{constructor(t){this.variableNames=["x","dy"],this.outputShape=t.filterShape;const e=t.strideDepth,n=t.strideHeight,r=t.strideWidth,i=t.padInfo.front,o=t.padInfo.top,s=t.padInfo.left;this.userCode=`\n void main() {\n ivec5 coords = getOutputCoords();\n int wF = coords.x;\n int wR = coords.y;\n int wC = coords.z;\n int d1 = coords.w;\n int d2 = coords.u;\n\n float dotProd = 0.0;\n\n for (int b = 0; b < ${t.batchSize}; b++) {\n for (int yF = 0; yF < ${t.outDepth}; yF++) {\n int xF = wF + yF * ${e} - ${i};\n\n if (xF < 0 || xF >= ${t.inDepth}) {\n continue;\n }\n\n for (int yR = 0; yR < ${t.outHeight}; yR++) {\n int xR = wR + yR * ${n} - ${o};\n\n if (xR < 0 || xR >= ${t.inHeight}) {\n continue;\n }\n\n for (int yC = 0; yC < ${t.outWidth}; yC++) {\n int xC = wC + yC * ${r} - ${s};\n\n if (xC < 0 || xC >= ${t.inWidth}) {\n continue;\n }\n\n float dyValue = getDy(b, yF, yR, yC, d2);\n float xValue = getX(b, xF, xR, xC, d1);\n dotProd += (xValue * dyValue);\n }\n }\n }\n }\n setOutput(dotProd);\n }\n `}}class Jo{constructor(t){this.variableNames=["dy","W"],this.outputShape=t.inShape;const e=t.filterDepth,n=t.filterHeight,r=t.filterWidth,i=t.strideDepth,o=t.strideHeight,s=t.strideWidth,a=e-1-t.padInfo.front,l=n-1-t.padInfo.top,u=r-1-t.padInfo.left;this.userCode=`\n const ivec3 pads = ivec3(${a}, ${l}, ${u});\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int d1 = coords.u;\n\n\n ivec3 dyCorner = ivec3(coords.y, coords.z, coords.w) - pads;\n int dyFCorner = dyCorner.x;\n int dyRCorner = dyCorner.y;\n int dyCCorner = dyCorner.z;\n\n float dotProd = 0.0;\n for (int wF = 0; wF < ${e}; wF++) {\n float dyF = float(dyFCorner + wF) / ${i}.0;\n\n if (dyF < 0.0 || dyF >= ${t.outDepth}.0 || fract(dyF) > 0.0) {\n continue;\n }\n int idyF = int(dyF);\n\n int wFPerm = ${e} - 1 - wF;\n\n for (int wR = 0; wR < ${n}; wR++) {\n float dyR = float(dyRCorner + wR) / ${o}.0;\n\n if (dyR < 0.0 || dyR >= ${t.outHeight}.0 ||\n fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n int wRPerm = ${n} - 1 - wR;\n\n for (int wC = 0; wC < ${r}; wC++) {\n float dyC = float(dyCCorner + wC) / ${s}.0;\n\n if (dyC < 0.0 || dyC >= ${t.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n int wCPerm = ${r} - 1 - wC;\n\n for (int d2 = 0; d2 < ${t.outChannels}; d2++) {\n float xValue = getDy(batch, idyF, idyR, idyC, d2);\n float wValue = getW(wFPerm, wRPerm, wCPerm, d1, d2);\n dotProd += xValue * wValue;\n }\n }\n }\n }\n setOutput(dotProd);\n }\n `}}
  7427. /**
  7428. * @license
  7429. * Copyright 2020 Google LLC. All Rights Reserved.
  7430. * Licensed under the Apache License, Version 2.0 (the "License");
  7431. * you may not use this file except in compliance with the License.
  7432. * You may obtain a copy of the License at
  7433. *
  7434. * http://www.apache.org/licenses/LICENSE-2.0
  7435. *
  7436. * Unless required by applicable law or agreed to in writing, software
  7437. * distributed under the License is distributed on an "AS IS" BASIS,
  7438. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7439. * See the License for the specific language governing permissions and
  7440. * limitations under the License.
  7441. * =============================================================================
  7442. */const Zo={kernelName:s.D,backendName:"webgl",kernelFunc:function(t){const{inputs:e,backend:n,attrs:r}=t,{x:i,dy:o}=e,{strides:a,pad:l,dataFormat:u,dimRoundingMode:c,filterShape:h}=r,d=s._115.convertConv2DDataFormat(u),p=s._115.computeConv2DInfo(i.shape,h,a,1,l,c,!1,d),f=new Ko(p);return n.runWebGLProgram(f,[i,o],"float32")}};
  7443. /**
  7444. * @license
  7445. * Copyright 2020 Google LLC. All Rights Reserved.
  7446. * Licensed under the Apache License, Version 2.0 (the "License");
  7447. * you may not use this file except in compliance with the License.
  7448. * You may obtain a copy of the License at
  7449. *
  7450. * http://www.apache.org/licenses/LICENSE-2.0
  7451. *
  7452. * Unless required by applicable law or agreed to in writing, software
  7453. * distributed under the License is distributed on an "AS IS" BASIS,
  7454. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7455. * See the License for the specific language governing permissions and
  7456. * limitations under the License.
  7457. * =============================================================================
  7458. */const Qo={kernelName:s.E,backendName:"webgl",kernelFunc:function(t){const{inputs:e,backend:n,attrs:r}=t,{dy:i,filter:o}=e,{inputShape:a,strides:l,pad:u,dataFormat:c,dimRoundingMode:h}=r,d=s._115.convertConv2DDataFormat(c),p=s._115.computeConv2DInfo(a,o.shape,l,1,u,h,!1,d),f=new Yo(p);return n.runWebGLProgram(f,[i,o],"float32")}};
  7459. /**
  7460. * @license
  7461. * Copyright 2020 Google LLC. All Rights Reserved.
  7462. * Licensed under the Apache License, Version 2.0 (the "License");
  7463. * you may not use this file except in compliance with the License.
  7464. * You may obtain a copy of the License at
  7465. *
  7466. * http://www.apache.org/licenses/LICENSE-2.0
  7467. *
  7468. * Unless required by applicable law or agreed to in writing, software
  7469. * distributed under the License is distributed on an "AS IS" BASIS,
  7470. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7471. * See the License for the specific language governing permissions and
  7472. * limitations under the License.
  7473. * =============================================================================
  7474. */const ts={kernelName:s.F,backendName:"webgl",kernelFunc:function(t){const{inputs:e,backend:n,attrs:r}=t,{x:i,filter:o}=e,{strides:a,pad:l,dilations:u}=r,c=s._115.computeConv3DInfo(i.shape,o.shape,a,u,l),h=new Ho(c);return n.runWebGLProgram(h,[i,o],"float32")}};
  7475. /**
  7476. * @license
  7477. * Copyright 2020 Google LLC. All Rights Reserved.
  7478. * Licensed under the Apache License, Version 2.0 (the "License");
  7479. * you may not use this file except in compliance with the License.
  7480. * You may obtain a copy of the License at
  7481. *
  7482. * http://www.apache.org/licenses/LICENSE-2.0
  7483. *
  7484. * Unless required by applicable law or agreed to in writing, software
  7485. * distributed under the License is distributed on an "AS IS" BASIS,
  7486. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7487. * See the License for the specific language governing permissions and
  7488. * limitations under the License.
  7489. * =============================================================================
  7490. */const es={kernelName:s.G,backendName:"webgl",kernelFunc:function(t){const{inputs:e,backend:n,attrs:r}=t,{x:i,dy:o}=e,{strides:a,pad:l,filterShape:u}=r,c=s._115.computeConv3DInfo(i.shape,u,a,1,l),h=new qo(c);return n.runWebGLProgram(h,[i,o],"float32")}};
  7491. /**
  7492. * @license
  7493. * Copyright 2020 Google LLC. All Rights Reserved.
  7494. * Licensed under the Apache License, Version 2.0 (the "License");
  7495. * you may not use this file except in compliance with the License.
  7496. * You may obtain a copy of the License at
  7497. *
  7498. * http://www.apache.org/licenses/LICENSE-2.0
  7499. *
  7500. * Unless required by applicable law or agreed to in writing, software
  7501. * distributed under the License is distributed on an "AS IS" BASIS,
  7502. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7503. * See the License for the specific language governing permissions and
  7504. * limitations under the License.
  7505. * =============================================================================
  7506. */const ns={kernelName:s.H,backendName:"webgl",kernelFunc:function(t){const{inputs:e,backend:n,attrs:r}=t,{dy:i,filter:o}=e,{pad:a,strides:l,inputShape:u}=r,c=s._115.computeConv3DInfo(u,o.shape,l,1,a),h=new Jo(c);return n.runWebGLProgram(h,[i,o],"float32")}},rs=ei({opSnippet:"if (isnan(x)) return x;\n return cos(x);\n"}),is={kernelName:s.I,backendName:"webgl",kernelFunc:rs},os=ei({opSnippet:"\n float e2x = exp(-x);\n return (e2x + 1.0 / e2x) / 2.0;\n"}),ss={kernelName:s.J,backendName:"webgl",kernelFunc:os};
  7507. /**
  7508. * @license
  7509. * Copyright 2020 Google LLC. All Rights Reserved.
  7510. * Licensed under the Apache License, Version 2.0 (the "License");
  7511. * you may not use this file except in compliance with the License.
  7512. * You may obtain a copy of the License at
  7513. *
  7514. * http://www.apache.org/licenses/LICENSE-2.0
  7515. *
  7516. * Unless required by applicable law or agreed to in writing, software
  7517. * distributed under the License is distributed on an "AS IS" BASIS,
  7518. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7519. * See the License for the specific language governing permissions and
  7520. * limitations under the License.
  7521. * =============================================================================
  7522. */
  7523. /**
  7524. * @license
  7525. * Copyright 2020 Google LLC. All Rights Reserved.
  7526. * Licensed under the Apache License, Version 2.0 (the "License");
  7527. * you may not use this file except in compliance with the License.
  7528. * You may obtain a copy of the License at
  7529. *
  7530. * http://www.apache.org/licenses/LICENSE-2.0
  7531. *
  7532. * Unless required by applicable law or agreed to in writing, software
  7533. * distributed under the License is distributed on an "AS IS" BASIS,
  7534. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7535. * See the License for the specific language governing permissions and
  7536. * limitations under the License.
  7537. * =============================================================================
  7538. */
  7539. const as={kernelName:s.K,backendName:"webgl",kernelFunc:t=>{const{inputs:e,backend:n,attrs:r}=t,{image:i,boxes:o,boxInd:s}=e,{cropSize:a,method:l,extrapolationValue:u}=r,c=new
  7540. /**
  7541. * @license
  7542. * Copyright 2017 Google LLC. All Rights Reserved.
  7543. * Licensed under the Apache License, Version 2.0 (the "License");
  7544. * you may not use this file except in compliance with the License.
  7545. * You may obtain a copy of the License at
  7546. *
  7547. * http://www.apache.org/licenses/LICENSE-2.0
  7548. *
  7549. * Unless required by applicable law or agreed to in writing, software
  7550. * distributed under the License is distributed on an "AS IS" BASIS,
  7551. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7552. * See the License for the specific language governing permissions and
  7553. * limitations under the License.
  7554. * =============================================================================
  7555. */
  7556. class{constructor(t,e,n,r,i){this.variableNames=["Image","Boxes","BoxInd"],this.outputShape=[];const[o,s,a,l]=t,[u]=e,[c,h]=n;this.outputShape=[u,c,h,l];const d="bilinear"===r?1:0,[p,f]=[`${s-1}.0`,`${a-1}.0`],[g,m,v]=c>1?[`${(s-1)/(c-1)}`,"(y2-y1) * height_ratio",`y1*${p} + float(y)*(height_scale)`]:["0.0","0.0",`0.5 * (y1+y2) * ${p}`],[b,_,y]=h>1?[`${(a-1)/(h-1)}`,"(x2-x1) * width_ratio",`x1*${f} + float(x)*(width_scale)`]:["0.0","0.0",`0.5 * (x1+x2) * ${f}`];this.userCode=`\n const float height_ratio = float(${g});\n const float width_ratio = float(${b});\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int y = coords[1];\n int x = coords[2];\n int d = coords[3];\n\n // get box vals\n float y1 = getBoxes(b,0);\n float x1 = getBoxes(b,1);\n float y2 = getBoxes(b,2);\n float x2 = getBoxes(b,3);\n\n // get image in batch index\n int bInd = round(getBoxInd(b));\n if(bInd < 0 || bInd >= ${o}) {\n return;\n }\n\n float height_scale = ${m};\n float width_scale = ${_};\n\n float in_y = ${v};\n if( in_y < 0.0 || in_y > ${p} ) {\n setOutput(float(${i}));\n return;\n }\n float in_x = ${y};\n if( in_x < 0.0 || in_x > ${f} ) {\n setOutput(float(${i}));\n return;\n }\n\n vec2 sourceFracIndexCR = vec2(in_x,in_y);\n if(${d} == 1) {\n // Compute the four integer indices.\n ivec2 sourceFloorCR = ivec2(sourceFracIndexCR);\n ivec2 sourceCeilCR = ivec2(ceil(sourceFracIndexCR));\n\n float topLeft = getImage(b, sourceFloorCR.y, sourceFloorCR.x, d);\n float bottomLeft = getImage(b, sourceCeilCR.y, sourceFloorCR.x, d);\n float topRight = getImage(b, sourceFloorCR.y, sourceCeilCR.x, d);\n float bottomRight = getImage(b, sourceCeilCR.y, sourceCeilCR.x, d);\n\n vec2 fracCR = sourceFracIndexCR - vec2(sourceFloorCR);\n\n float top = topLeft + (topRight - topLeft) * fracCR.x;\n float bottom = bottomLeft + (bottomRight - bottomLeft) * fracCR.x;\n float newValue = top + (bottom - top) * fracCR.y;\n setOutput(newValue);\n } else {\n // Compute the coordinators of nearest neighbor point.\n ivec2 sourceNearestCR = ivec2(floor(\n sourceFracIndexCR + vec2(0.5,0.5)));\n float newValue = getImage(b, sourceNearestCR.y, sourceNearestCR.x, d);\n setOutput(newValue);\n }\n }\n `}}(i.shape,o.shape,a,l,u);return n.runWebGLProgram(c,[i,o,s],"float32")}};class ls{constructor(t,e,n){this.variableNames=["x"],this.customUniforms=[{name:"index",type:"float"}],this.outputShape=t;const r=t.length,i=e?"0.0":`getX(${us(r,"coords")})`,o=t[t.length-1];let s="",a="";e?(s=n?`end != ${o-1}`:"end != 0",a=n?"end + 1":"end - 1"):(s=n?`end + pow2 < ${o}`:"end >= pow2",a=n?"end + pow2":"end - pow2"),this.userCode=`\n void main() {\n ${Dt(r)} coords = getOutputCoords();\n int end = ${cs(r,"coords")};\n float val = ${i};\n int pow2 = int(pow(2.0, index));\n if (${s}) {\n int idx = ${a};\n ${cs(r,"coords")} = idx;\n val += getX(${us(r,"coords")});\n }\n setOutput(val);\n }\n `}}function us(t,e){if(1===t)return`${e}`;if(2===t)return`${e}.x, ${e}.y`;if(3===t)return`${e}.x, ${e}.y, ${e}.z`;if(4===t)return`${e}.x, ${e}.y, ${e}.z, ${e}.w`;throw Error(`Cumulative sum for rank ${t} is not yet supported`)}function cs(t,e){if(1===t)return`${e}`;if(2===t)return`${e}.y`;if(3===t)return`${e}.z`;if(4===t)return`${e}.w`;throw Error(`Cumulative sum for rank ${t} is not yet supported`)}
  7557. /**
  7558. * @license
  7559. * Copyright 2020 Google LLC. All Rights Reserved.
  7560. * Licensed under the Apache License, Version 2.0 (the "License");
  7561. * you may not use this file except in compliance with the License.
  7562. * You may obtain a copy of the License at
  7563. *
  7564. * http://www.apache.org/licenses/LICENSE-2.0
  7565. *
  7566. * Unless required by applicable law or agreed to in writing, software
  7567. * distributed under the License is distributed on an "AS IS" BASIS,
  7568. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7569. * See the License for the specific language governing permissions and
  7570. * limitations under the License.
  7571. * =============================================================================
  7572. */const hs={kernelName:s.L,backendName:"webgl",kernelFunc:function(t){const{inputs:e,backend:n,attrs:r}=t,{x:i}=e,{axis:o,exclusive:a,reverse:l}=r,u=i.shape.length,c=s._115.getAxesPermutation([o],u);let h=i;null!=c&&(h=yi({inputs:{x:i},backend:n,attrs:{perm:c}}));const d=s._115.getInnerMostAxes(1,u)[0];if(d!==u-1)throw new Error(`WebGL cumsum shader expects an inner-most axis=${i.shape.length-1} `+`but got axis=${o}`);const p=h.shape[d];let f=Gr({inputs:{x:h},backend:n});for(let t=0;t<=Math.ceil(Math.log2(p))-1;t++){const e=new ls(h.shape,!1,l),r=[[t]],i=f;f=n.runWebGLProgram(e,[f],f.dtype,r),n.disposeIntermediateTensorInfo(i)}if(a){const t=new ls(h.shape,a,l),e=f;f=n.runWebGLProgram(t,[f],f.dtype),n.disposeIntermediateTensorInfo(e)}if(null!=c){const t=yi({inputs:{x:f},backend:n,attrs:{perm:s._115.getUndoAxesPermutation(c)}});return n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(h),t}return f}};
  7573. /**
  7574. * @license
  7575. * Copyright 2020 Google LLC. All Rights Reserved.
  7576. * Licensed under the Apache License, Version 2.0 (the "License");
  7577. * you may not use this file except in compliance with the License.
  7578. * You may obtain a copy of the License at
  7579. *
  7580. * http://www.apache.org/licenses/LICENSE-2.0
  7581. *
  7582. * Unless required by applicable law or agreed to in writing, software
  7583. * distributed under the License is distributed on an "AS IS" BASIS,
  7584. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7585. * See the License for the specific language governing permissions and
  7586. * limitations under the License.
  7587. * =============================================================================
  7588. */const ds={kernelName:s.N,backendName:"webgl",kernelFunc:function(t){const{inputs:e,backend:n,attrs:r}=t,{x:i,weights:o}=e,{size:s,binaryOutput:a}=r;if(1===i.shape.length){const t=n.readSync(i.dataId),e=n.readSync(o.dataId),r=En(t,e,o.dtype,o.shape,s);return n.makeTensorInfo([s],o.dtype,r)}if(2===i.shape.length){const t=n.bufferSync(i),e=n.bufferSync(o),r=wn(t,e,s,a);return n.makeTensorInfo(r.shape,o.dtype,r.values)}throw new Error("Error in denseBincount: input must be at most rank 2, but got rank"+`${i.shape.length}.`)}};
  7589. /**
  7590. * @license
  7591. * Copyright 2018 Google LLC. All Rights Reserved.
  7592. * Licensed under the Apache License, Version 2.0 (the "License");
  7593. * you may not use this file except in compliance with the License.
  7594. * You may obtain a copy of the License at
  7595. *
  7596. * http://www.apache.org/licenses/LICENSE-2.0
  7597. *
  7598. * Unless required by applicable law or agreed to in writing, software
  7599. * distributed under the License is distributed on an "AS IS" BASIS,
  7600. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7601. * See the License for the specific language governing permissions and
  7602. * limitations under the License.
  7603. * =============================================================================
  7604. */class ps{constructor(t,e,n){this.variableNames=["x"],this.outputShape=[],this.outputShape=t,this.blockSize=e,this.dataFormat=n,this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int h = ${this.getHeightCoordString()};\n int w = ${this.getWidthCoordString()};\n int d = ${this.getDepthCoordString()};\n\n int in_h = h / ${e};\n int offset_h = imod(h, ${e});\n int in_w = w / ${e};\n int offset_w = imod(w, ${e});\n int offset_d = (offset_h * ${e} + offset_w) *\n ${this.getOutputDepthSize()};\n int in_d = d + offset_d;\n\n float result = ${this.getInputSamplingString()};\n setOutput(result);\n }\n `}getHeightCoordString(){return"NHWC"===this.dataFormat?"coords[1]":"coords[2]"}getWidthCoordString(){return"NHWC"===this.dataFormat?"coords[2]":"coords[3]"}getDepthCoordString(){return"NHWC"===this.dataFormat?"coords[3]":"coords[1]"}getOutputDepthSize(){return"NHWC"===this.dataFormat?this.outputShape[3]:this.outputShape[1]}getInputSamplingString(){return"NHWC"===this.dataFormat?"getX(b, in_h, in_w, in_d)":"getX(b, in_d, in_h, in_w)"}}
  7605. /**
  7606. * @license
  7607. * Copyright 2020 Google LLC. All Rights Reserved.
  7608. * Licensed under the Apache License, Version 2.0 (the "License");
  7609. * you may not use this file except in compliance with the License.
  7610. * You may obtain a copy of the License at
  7611. *
  7612. * http://www.apache.org/licenses/LICENSE-2.0
  7613. *
  7614. * Unless required by applicable law or agreed to in writing, software
  7615. * distributed under the License is distributed on an "AS IS" BASIS,
  7616. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7617. * See the License for the specific language governing permissions and
  7618. * limitations under the License.
  7619. * =============================================================================
  7620. */const fs={kernelName:s.O,backendName:"webgl",kernelFunc:function(t){const{inputs:e,backend:n,attrs:r}=t,{x:i}=e,{blockSize:o,dataFormat:s}=r,a=i.shape[0],l=("NHWC"===s?i.shape[1]:i.shape[2])*o,u=("NHWC"===s?i.shape[2]:i.shape[3])*o,c=("NHWC"===s?i.shape[3]:i.shape[1])/(o*o),h=new ps("NHWC"===s?[a,l,u,c]:[a,c,l,u],o,s);return n.runWebGLProgram(h,[i],i.dtype)}};
  7621. /**
  7622. * @license
  7623. * Copyright 2017 Google LLC. All Rights Reserved.
  7624. * Licensed under the Apache License, Version 2.0 (the "License");
  7625. * you may not use this file except in compliance with the License.
  7626. * You may obtain a copy of the License at
  7627. *
  7628. * http://www.apache.org/licenses/LICENSE-2.0
  7629. *
  7630. * Unless required by applicable law or agreed to in writing, software
  7631. * distributed under the License is distributed on an "AS IS" BASIS,
  7632. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7633. * See the License for the specific language governing permissions and
  7634. * limitations under the License.
  7635. * =============================================================================
  7636. */class gs{constructor(t,e=!1,n=null,r=!1,i=!1){this.variableNames=["x","W"],this.customUniforms=[{name:"pads",type:"ivec2"},{name:"strides",type:"ivec2"},{name:"dilations",type:"ivec2"},{name:"inDims",type:"ivec2"}],this.outputShape=t.outShape,this.enableShapeUniforms=Bt(this.outputShape.length);const o=t.filterHeight,s=t.filterWidth,a=t.outChannels/t.inChannels;let l="",u="";n&&(l=r?`float activation(float a) {\n float b = getPreluActivationWeightsAtOutCoords();\n ${n}\n }`:i?`float activation(float a) {\n float b = getLeakyreluAlphaAtOutCoords();\n ${n}\n }`:`\n float activation(float x) {\n ${n}\n }\n `,u="result = activation(result);");const c=e?"result += getBiasAtOutCoords();":"";e&&this.variableNames.push("bias"),r&&this.variableNames.push("preluActivationWeights"),i&&this.variableNames.push("leakyreluAlpha"),this.userCode=`\n ${l}\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords.x;\n ivec2 xRCCorner = coords.yz * strides - pads;\n int d2 = coords.w;\n int d1 = d2 / ${a};\n int q = d2 - d1 * ${a};\n\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // Convolve x(?, ?, d1) with w(:, :, d1, q) to get y(yR, yC, d2).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n // TO DO(dsmilkov): Flatten the two for loops and vec4 the operations.\n for (int wR = 0; wR < ${o}; wR++) {\n int xR = xRCorner + wR * dilations[0];\n\n if (xR < 0 || xR >= inDims[0]) {\n continue;\n }\n\n for (int wC = 0; wC < ${s}; wC++) {\n int xC = xCCorner + wC * dilations[1];\n\n if (xC < 0 || xC >= inDims[1]) {\n continue;\n }\n\n float xVal = getX(batch, xR, xC, d1);\n float wVal = getW(wR, wC, d1, q);\n dotProd += xVal * wVal;\n }\n }\n\n float result = dotProd;\n ${c}\n ${u}\n setOutput(result);\n }\n `}}
  7637. /**
  7638. * @license
  7639. * Copyright 2018 Google LLC. All Rights Reserved.
  7640. * Licensed under the Apache License, Version 2.0 (the "License");
  7641. * you may not use this file except in compliance with the License.
  7642. * You may obtain a copy of the License at
  7643. *
  7644. * http://www.apache.org/licenses/LICENSE-2.0
  7645. *
  7646. * Unless required by applicable law or agreed to in writing, software
  7647. * distributed under the License is distributed on an "AS IS" BASIS,
  7648. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7649. * See the License for the specific language governing permissions and
  7650. * limitations under the License.
  7651. * =============================================================================
  7652. */class ms{constructor(t,e=!1,n=null,r=!1,i=!1){this.variableNames=["x","W"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"pads",type:"ivec2"},{name:"strides",type:"ivec2"},{name:"dilations",type:"ivec2"},{name:"inDims",type:"ivec2"}],this.outputShape=t.outShape,this.enableShapeUniforms=Bt(this.outputShape.length);const o=t.outChannels/t.inChannels,a=t.padInfo.left,l=t.strideWidth,u=t.dilationWidth,c=t.filterHeight,h=t.filterWidth,d=h;let p="\n int xR; int xC; int xCOffset;\n vec4 wTexel; vec4 previous; vec4 final;";for(let t=0;t<h;t++)p+=`\n vec4 xTexelC${2*t};\n int xTexelC${2*t}Ready;\n vec4 xTexelC${2*t+1};\n int xTexelC${2*t+1}Ready;\n vec4 xC${t};`;p+=`\n for (int r = 0; r < ${c}; r++) {\n `;for(let t=0;t<h;t++)p+=`\n xTexelC${2*t} = vec4(0.0);\n xTexelC${2*t}Ready = 0;\n xTexelC${2*t+1} = vec4(0.0);\n xTexelC${2*t+1}Ready = 0;\n xC${t} = vec4(0.0);`;p+="\n xR = xRCorner + r * dilations[0];\n if (xR >=0 && xR < inDims[0]) {\n ";for(let t=0;t<(d+1)/2;t++){const e=2*t;if(p+=`\n xC = xCCorner + ${e*u};\n `,1===l){if(e<h&&(a%2==1?(p+=`\n xCOffset = xC + 1;\n if (xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${e}Ready == 0) {\n xTexelC${e} = getX(batch, xR, xCOffset, d1);\n\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${e}.zw = vec2(0.0);\n }\n xTexelC${e}Ready = 1;\n }\n `,p+=1===u&&e>0?`\n xC${e} = vec4(xTexelC${e-2}.zw, xTexelC${e}.xy);\n `:`\n xCOffset = xC + 1 - 2;\n\n if (xCOffset >= 0 && xCOffset < inDims[1]) {\n previous = getX(batch, xR, xCOffset, d1);\n\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xCOffset + 1 >= inDims[1]) {\n previous.zw = vec2(0.0);\n }\n\n xC${e} = vec4(previous.zw, xTexelC${e}.xy);\n } else {\n xC${e} = vec4(0.0, 0.0, xTexelC${e}.xy);\n }\n `):p+=`\n if (xC >= 0 && xC < inDims[1] && xTexelC${e}Ready == 0) {\n xTexelC${e} = getX(batch, xR, xC, d1);\n if (xC + 1 >= inDims[1]) {\n xTexelC${e}.zw = vec2(0.0);\n }\n xTexelC${e}Ready = 1;\n }\n\n xC${e} = xTexelC${e};\n `,e+1<h)){const t=a%2==0?s._152.nearestLargerEven(u):u;u%2==0&&a%2==1||u%2!=0&&a%2!=1?(p+=`\n xCOffset = xC + imod(pads[1], 2) + ${t};\n\n if (xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${e+1}Ready == 0) {\n xTexelC${e+1} = getX(batch, xR, xCOffset, d1);\n\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${e+1}.zw = vec2(0.0);\n }\n xTexelC${e+1}Ready = 1;\n }\n `,u>1&&(p+=`\n xCOffset -= 2;\n if (xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${e}Ready == 0) {\n xTexelC${e} = getX(batch, xR, xCOffset, d1);\n xTexelC${e}Ready = 1;\n }\n `),p+=`\n xC${e+1} = vec4(xTexelC${e}.zw, xTexelC${e+1}.xy);\n `):p+=1===t?`\n xC${e+1} = xTexelC${e};\n `:`\n xCOffset = xC + ${t};\n\n if (xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${e+1}Ready == 0) {\n xTexelC${e+1} = getX(batch, xR, xCOffset, d1);\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${e+1}.zw = vec2(0.0);\n }\n xTexelC${e+1}Ready = 1;\n }\n\n xC${e+1} = xTexelC${e+1};\n `}}else e<h&&(a%2==1?(p+=`\n xCOffset = xC + 1 - strides[1];\n if(xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${e}Ready == 0) {\n xTexelC${e} = getX(batch, xR, xCOffset, d1);\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${e}.zw = vec2(0.0);\n }\n xTexelC${e}Ready = 1;\n }\n\n if(xC + 1 >= 0 && xC + 1 < inDims[1] && xTexelC${e+1}Ready == 0) {\n xTexelC${e+1} = getX(batch, xR, xC + 1, d1);\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xC + 2 >= inDims[1]) {\n xTexelC${e+1}.zw = vec2(0.0);\n }\n xTexelC${e+1}Ready = 1;\n }\n\n xC${e} = vec4(xTexelC${e}.zw, xTexelC${e+1}.zw);\n `,e+1<h&&(p+=`\n final = vec4(0.0);\n xCOffset = xC + 1 + strides[1];\n if(xCOffset >= 0 && xCOffset < inDims[1]) {\n final = getX(batch, xR, xCOffset, d1);\n }\n xC${e+1} = vec4(xTexelC${e+1}.xy, final.xy);\n `)):(p+=`\n if(xC >= 0 && xC < inDims[1] && xTexelC${e}Ready == 0) {\n xTexelC${e} = getX(batch, xR, xC, d1);\n if (xC + 1 >= inDims[1]) {\n xTexelC${e}.zw = vec2(0.0);\n }\n xTexelC${e}Ready = 1;\n }\n\n xCOffset = xC + strides[1];\n if(xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${e+1}Ready == 0) {\n xTexelC${e+1} = getX(batch, xR, xCOffset, d1);\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${e+1}.zw = vec2(0.);\n }\n xTexelC${e+1}Ready = 1;\n }\n\n xC${e} = vec4(\n xTexelC${e}.xy, xTexelC${e+1}.xy);\n `,e+1<h&&(p+=`\n xC${e+1} = vec4(xTexelC${e}.zw, xTexelC${e+1}.zw);\n `)));e<h&&(p+=`\n wTexel = getW(r, ${e}, d1, q);\n dotProd += xC${e} * vec4(wTexel.xz, wTexel.xz);\n `,e+1<h&&(p+=`\n wTexel = getW(r, ${e+1}, d1, q);\n dotProd += xC${e+1} * vec4(wTexel.xz, wTexel.xz);\n `))}p+="\n }\n ",p+="\n }\n ";let f="",g="";n&&(f=r?`vec4 activation(vec4 a) {\n vec4 b = getPreluActivationWeightsAtOutCoords();\n ${n}\n }`:i?`vec4 activation(vec4 a) {\n vec4 b = getLeakyreluAlphaAtOutCoords();\n ${n}\n }`:`vec4 activation(vec4 x) {\n ${n}\n }`,g="result = activation(result);");const m=e?"result += getBiasAtOutCoords();":"";e&&this.variableNames.push("bias"),r&&this.variableNames.push("preluActivationWeights"),i&&this.variableNames.push("leakyreluAlpha"),this.userCode=`\n ${f}\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords.x;\n ivec2 xRCCorner = coords.yz * strides - pads;\n int d2 = coords.w;\n int d1 = d2 / ${o};\n int q = d2 - d1 * ${o};\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n //intialize dotProd with a small epsilon seems to reduce GPU accuracy loss.\n vec4 dotProd = vec4(0.000000000000001);\n\n ${p}\n\n vec4 result = dotProd - vec4(0.000000000000001);\n ${m}\n ${g}\n setOutput(result);\n }\n `}}
  7653. /**
  7654. * @license
  7655. * Copyright 2020 Google LLC. All Rights Reserved.
  7656. * Licensed under the Apache License, Version 2.0 (the "License");
  7657. * you may not use this file except in compliance with the License.
  7658. * You may obtain a copy of the License at
  7659. *
  7660. * http://www.apache.org/licenses/LICENSE-2.0
  7661. *
  7662. * Unless required by applicable law or agreed to in writing, software
  7663. * distributed under the License is distributed on an "AS IS" BASIS,
  7664. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7665. * See the License for the specific language governing permissions and
  7666. * limitations under the License.
  7667. * =============================================================================
  7668. */const vs={kernelName:s.P,backendName:"webgl",kernelFunc:function(t){const{inputs:e,backend:n,attrs:r}=t,{x:i,filter:o}=e,{strides:a,pad:l,dilations:u,dimRoundingMode:c}=r;let h=u;null==h&&(h=[1,1]),s._152.assert(s._115.eitherStridesOrDilationsAreOne(a,h),()=>"Error in depthwiseConv2d: Either strides or dilations must be "+`1. Got strides ${a} and dilations '${h}'`);const d=s._115.computeConv2DInfo(i.shape,o.shape,a,h,l,c,!0);let p;p=Object(s._127)().getBool("WEBGL_PACK_DEPTHWISECONV")&&d.strideWidth<=2&&d.outChannels/d.inChannels==1?new ms(d):new gs(d);const f=[[d.padInfo.top,d.padInfo.left],[d.strideHeight,d.strideWidth],[d.dilationHeight,d.dilationWidth],[d.inHeight,d.inWidth]];return n.runWebGLProgram(p,[i,o],"float32",f)}};
  7669. /**
  7670. * @license
  7671. * Copyright 2018 Google LLC. All Rights Reserved.
  7672. * Licensed under the Apache License, Version 2.0 (the "License");
  7673. * you may not use this file except in compliance with the License.
  7674. * You may obtain a copy of the License at
  7675. *
  7676. * http://www.apache.org/licenses/LICENSE-2.0
  7677. *
  7678. * Unless required by applicable law or agreed to in writing, software
  7679. * distributed under the License is distributed on an "AS IS" BASIS,
  7680. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7681. * See the License for the specific language governing permissions and
  7682. * limitations under the License.
  7683. * =============================================================================
  7684. */class bs{constructor(t){this.variableNames=["x","dy"],this.outputShape=t.filterShape;const e=t.strideHeight,n=t.strideWidth,r=t.padInfo.top,i=t.padInfo.left,o=t.outChannels/t.inChannels;this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int wR = coords.x;\n int wC = coords.y;\n int d1 = coords.z;\n int dm = coords.w;\n int d2 = d1 * ${o} + dm;\n\n float dotProd = 0.0;\n\n // TO DO: Vec4 over the batch size\n for (int b = 0; b < ${t.batchSize}; b++) {\n for (int yR = 0; yR < ${t.outHeight}; yR++) {\n int xR = wR + yR * ${e} - ${r};\n\n if (xR < 0 || xR >= ${t.inHeight}) {\n continue;\n }\n\n for (int yC = 0; yC < ${t.outWidth}; yC++) {\n int xC = wC + yC * ${n} - ${i};\n\n if (xC < 0 || xC >= ${t.inWidth}) {\n continue;\n }\n\n float dyValue = getDy(b, yR, yC, d2);\n float xValue = getX(b, xR, xC, d1);\n dotProd += (xValue * dyValue);\n }\n }\n }\n setOutput(dotProd);\n }\n `}}class _s{constructor(t){this.variableNames=["dy","W"],this.outputShape=t.inShape;const e=t.filterHeight,n=t.filterWidth,r=t.strideHeight,i=t.strideWidth,o=e-1-t.padInfo.top,s=n-1-t.padInfo.left,a=t.outChannels/t.inChannels;this.userCode=`\n const ivec2 pads = ivec2(${o}, ${s});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d1 = coords[3];\n ivec2 dyCorner = coords.yz - pads;\n int dyRCorner = dyCorner.x;\n int dyCCorner = dyCorner.y;\n\n float dotProd = 0.0;\n\n for (int wR = 0; wR < ${e}; wR++) {\n float dyR = float(dyRCorner + wR) / ${r}.0;\n\n if (dyR < 0.0 || dyR >= ${t.outHeight}.0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n int wRPerm = ${e} - 1 - wR;\n\n for (int wC = 0; wC < ${n}; wC++) {\n float dyC = float(dyCCorner + wC) / ${i}.0;\n\n if (dyC < 0.0 || dyC >= ${t.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n int wCPerm = ${n} - 1 - wC;\n\n // TO DO: Vec4 over the channelMul\n for (int dm = 0; dm < ${a}; dm++) {\n int d2 = d1 * ${a} + dm;\n float xValue = getDy(batch, idyR, idyC, d2);\n float wValue = getW(wRPerm, wCPerm, d1, dm);\n dotProd += xValue * wValue;\n }\n }\n }\n setOutput(dotProd);\n }\n `}}
  7685. /**
  7686. * @license
  7687. * Copyright 2020 Google LLC. All Rights Reserved.
  7688. * Licensed under the Apache License, Version 2.0 (the "License");
  7689. * you may not use this file except in compliance with the License.
  7690. * You may obtain a copy of the License at
  7691. *
  7692. * http://www.apache.org/licenses/LICENSE-2.0
  7693. *
  7694. * Unless required by applicable law or agreed to in writing, software
  7695. * distributed under the License is distributed on an "AS IS" BASIS,
  7696. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7697. * See the License for the specific language governing permissions and
  7698. * limitations under the License.
  7699. * =============================================================================
  7700. */const ys={kernelName:s.Q,backendName:"webgl",kernelFunc:function(t){const{inputs:e,backend:n,attrs:r}=t,{x:i,dy:o}=e,{strides:a,dilations:l,pad:u,dimRoundingMode:c,filterShape:h}=r,d=s._115.computeConv2DInfo(i.shape,h,a,l,u,c,!0),p=new bs(d);return n.runWebGLProgram(p,[i,o],"float32")}};
  7701. /**
  7702. * @license
  7703. * Copyright 2020 Google LLC. All Rights Reserved.
  7704. * Licensed under the Apache License, Version 2.0 (the "License");
  7705. * you may not use this file except in compliance with the License.
  7706. * You may obtain a copy of the License at
  7707. *
  7708. * http://www.apache.org/licenses/LICENSE-2.0
  7709. *
  7710. * Unless required by applicable law or agreed to in writing, software
  7711. * distributed under the License is distributed on an "AS IS" BASIS,
  7712. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7713. * See the License for the specific language governing permissions and
  7714. * limitations under the License.
  7715. * =============================================================================
  7716. */const Ts={kernelName:s.R,backendName:"webgl",kernelFunc:function(t){const{inputs:e,backend:n,attrs:r}=t,{dy:i,filter:o}=e,{strides:a,dilations:l,pad:u,dimRoundingMode:c,inputShape:h}=r,d=s._115.computeConv2DInfo(h,o.shape,a,l,u,c,!0),p=new _s(d);return n.runWebGLProgram(p,[i,o],"float32")}};
  7717. /**
  7718. * @license
  7719. * Copyright 2019 Google LLC. All Rights Reserved.
  7720. * Licensed under the Apache License, Version 2.0 (the "License");
  7721. * you may not use this file except in compliance with the License.
  7722. * You may obtain a copy of the License at
  7723. *
  7724. * http://www.apache.org/licenses/LICENSE-2.0
  7725. *
  7726. * Unless required by applicable law or agreed to in writing, software
  7727. * distributed under the License is distributed on an "AS IS" BASIS,
  7728. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7729. * See the License for the specific language governing permissions and
  7730. * limitations under the License.
  7731. * =============================================================================
  7732. */class xs{constructor(t){this.variableNames=["X"],this.outputShape=[t,t],this.userCode="\n void main() {\n ivec2 coords = getOutputCoords();\n float val = coords[0] == coords[1] ? getX(coords[0]) : 0.0;\n setOutput(val);\n }\n "}}
  7733. /**
  7734. * @license
  7735. * Copyright 2020 Google LLC. All Rights Reserved.
  7736. * Licensed under the Apache License, Version 2.0 (the "License");
  7737. * you may not use this file except in compliance with the License.
  7738. * You may obtain a copy of the License at
  7739. *
  7740. * http://www.apache.org/licenses/LICENSE-2.0
  7741. *
  7742. * Unless required by applicable law or agreed to in writing, software
  7743. * distributed under the License is distributed on an "AS IS" BASIS,
  7744. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7745. * See the License for the specific language governing permissions and
  7746. * limitations under the License.
  7747. * =============================================================================
  7748. */const Es={kernelName:s.S,backendName:"webgl",kernelFunc:function(t){const{inputs:e,backend:n}=t,{x:r}=e,i=[...r.shape,...r.shape],o=s._152.sizeFromShape(r.shape),a=ci({inputs:{x:r},backend:n,attrs:{shape:[o]}}),l=new xs(o),u=n.runWebGLProgram(l,[a],a.dtype),c=ci({inputs:{x:u},backend:n,attrs:{shape:i}});return n.disposeIntermediateTensorInfo(a),n.disposeIntermediateTensorInfo(u),c}};
  7749. /**
  7750. * @license
  7751. * Copyright 2017 Google LLC. All Rights Reserved.
  7752. * Licensed under the Apache License, Version 2.0 (the "License");
  7753. * you may not use this file except in compliance with the License.
  7754. * You may obtain a copy of the License at
  7755. *
  7756. * http://www.apache.org/licenses/LICENSE-2.0
  7757. *
  7758. * Unless required by applicable law or agreed to in writing, software
  7759. * distributed under the License is distributed on an "AS IS" BASIS,
  7760. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7761. * See the License for the specific language governing permissions and
  7762. * limitations under the License.
  7763. * =============================================================================
  7764. */class ws{constructor(t){this.variableNames=["x","W"],this.outputShape=t.outShape;const{inHeight:e,inWidth:n,padInfo:r,strideHeight:i,strideWidth:o,filterHeight:s,filterWidth:a,dilationHeight:l,dilationWidth:u}=t,{top:c,left:h}=r;this.userCode=`\n const ivec2 strides = ivec2(${i}, ${o});\n const ivec2 pads = ivec2(${c}, ${h});\n const float neg_infinity = -3.4e38;\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords.x;\n int d1 = coords.w;\n ivec2 outTopLeftCorner =\n coords.yz * strides - pads;\n int hBeg = outTopLeftCorner.x;\n int wBeg = outTopLeftCorner.y;\n\n float curVal = neg_infinity;\n for (int h = 0; h < ${s}; h++) {\n int hIn = hBeg + h * ${l};\n\n if (hIn >= 0 && hIn < ${e}) {\n for (int w = 0; w < ${a}; w++) {\n int wIn = wBeg + w * ${u};\n\n if (wIn >= 0 && wIn < ${n}) {\n float xVal = getX(batch, hIn, wIn, d1);\n float wVal = getW(h, w, d1);\n\n float val = xVal + wVal;\n if (val > curVal) {\n curVal = val;\n }\n }\n }\n }\n }\n\n float result = curVal;\n setOutput(result);\n }\n `}}
  7765. /**
  7766. * @license
  7767. * Copyright 2020 Google LLC. All Rights Reserved.
  7768. * Licensed under the Apache License, Version 2.0 (the "License");
  7769. * you may not use this file except in compliance with the License.
  7770. * You may obtain a copy of the License at
  7771. *
  7772. * http://www.apache.org/licenses/LICENSE-2.0
  7773. *
  7774. * Unless required by applicable law or agreed to in writing, software
  7775. * distributed under the License is distributed on an "AS IS" BASIS,
  7776. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7777. * See the License for the specific language governing permissions and
  7778. * limitations under the License.
  7779. * =============================================================================
  7780. */const Cs={kernelName:s.T,backendName:"webgl",kernelFunc:function(t){const{inputs:e,backend:n,attrs:r}=t,{x:i,filter:o}=e,{strides:a,pad:l,dilations:u}=r,c=s._115.computeDilation2DInfo(i.shape,o.shape,a,l,"NHWC",u);let h;const d=new ws(c),p=ci({inputs:{x:h=n.runWebGLProgram(d,[i,o],"float32")},backend:n,attrs:{shape:c.outShape}});return n.disposeIntermediateTensorInfo(h),p}};
  7781. /**
  7782. * @license
  7783. * Copyright 2021 Google LLC. All Rights Reserved.
  7784. * Licensed under the Apache License, Version 2.0 (the "License");
  7785. * you may not use this file except in compliance with the License.
  7786. * You may obtain a copy of the License at
  7787. *
  7788. * http://www.apache.org/licenses/LICENSE-2.0
  7789. *
  7790. * Unless required by applicable law or agreed to in writing, software
  7791. * distributed under the License is distributed on an "AS IS" BASIS,
  7792. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7793. * See the License for the specific language governing permissions and
  7794. * limitations under the License.
  7795. * =============================================================================
  7796. */const Ss={kernelName:s.U,backendName:"webgl",kernelFunc:function(t){const{inputs:e,backend:n,attrs:r}=t,{equation:i}=r,o=e,{allDims:a,summedDims:l,idDims:u}=s._115.decodeEinsumEquation(i,o.length);s._115.checkEinsumDimSizes(a.length,u,o);const{path:c,steps:h}=s._115.getEinsumComputePath(l,u),d=h.length;let p=null,f=a.length;const g=[];for(let t=0;t<d;++t){for(const e of h[t]){const{permutationIndices:t,expandDims:r}=s._115.getEinsumPermutation(f,u[e]);let i;s._115.isIdentityPermutation(t)?i=o[e]:(i=yi({inputs:{x:o[e]},backend:n,attrs:{perm:t}}),g.push(i));const a=i.shape.slice();for(let t=0;t<r.length;++t)a.splice(r[t],0,1);s._152.arraysEqual(i.shape,a)||(i=ci({inputs:{x:i},backend:n,attrs:{shape:a}}),g.push(i)),null===p?p=i:(p=li({inputs:{a:i,b:p},backend:n}),g.push(p))}t<d-1&&(c[t]>=0&&(p=bi({inputs:{x:p},backend:n,attrs:{axis:c[t]-(a.length-f),keepDims:!1}}),g.push(p)),f--)}for(const t of g)t!==p&&n.disposeIntermediateTensorInfo(t);return p}},ks=ei({opSnippet:"return (x >= 0.0) ? x : (exp(x) - 1.0);",packedOpSnippet:"\n vec4 result;\n\n result.r = (x.r >= 0.0) ? x.r : (exp(x.r) - 1.0);\n result.g = (x.g >= 0.0) ? x.g : (exp(x.g) - 1.0);\n result.b = (x.b >= 0.0) ? x.b : (exp(x.b) - 1.0);\n result.a = (x.a >= 0.0) ? x.a : (exp(x.a) - 1.0);\n\n return result;\n"}),Os={kernelName:s.V,backendName:"webgl",kernelFunc:ks},Is={kernelName:s.W,backendName:"webgl",kernelFunc:t=>{const{inputs:e,backend:n}=t,{dy:r,y:i}=e,o=Object(s._127)().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new Wr("\n vec4 bGTEZero = vec4(greaterThanEqual(b, vec4(0.)));\n return (bGTEZero * a) + ((vec4(1.0) - bGTEZero) * (a * (b + vec4(1.0))));\n",r.shape,i.shape):new Hr("return (b >= 1.0) ? a : a * (b + 1.0);",r.shape,i.shape);return n.runWebGLProgram(o,[r,i],r.dtype)}},Rs=ni({opSnippet:"return float(a == b);",packedOpSnippet:"\n return vec4(equal(a, b));\n",dtype:"bool",cpuKernelImpl:kn}),As={kernelName:s.X,backendName:"webgl",kernelFunc:Rs},Ns=ei({opSnippet:`\n // Error function is calculated approximately with elementary function.\n // See "Handbook of Mathematical Functions with Formulas,\n // Graphs, and Mathematical Tables", Abramowitz and Stegun.\n float p = ${s._115.ERF_P};\n float a1 = ${s._115.ERF_A1};\n float a2 = ${s._115.ERF_A2};\n float a3 = ${s._115.ERF_A3};\n float a4 = ${s._115.ERF_A4};\n float a5 = ${s._115.ERF_A5};\n\n float sign = sign(x);\n x = abs(x);\n float t = 1.0 / (1.0 + p * x);\n return sign * (1.0 - (((((a5*t + a4)*t) + a3)*t + a2)*t + a1)*t*exp(-x*x));\n`}),Ds={kernelName:s.Y,backendName:"webgl",kernelFunc:Ns},Ms=ei({opSnippet:"if (isnan(x)) return x;\n return exp(x);\n",packedOpSnippet:"\n vec4 result = exp(x);\n bvec4 isNaN = isnan(x);\n result.r = isNaN.r ? x.r : result.r;\n result.g = isNaN.g ? x.g : result.g;\n result.b = isNaN.b ? x.b : result.b;\n result.a = isNaN.a ? x.a : result.a;\n\n return result;\n",cpuKernelImpl:On,dtype:"float32"}),Ls={kernelName:s.Z,backendName:"webgl",kernelFunc:Ms};
  7797. /**
  7798. * @license
  7799. * Copyright 2020 Google LLC. All Rights Reserved.
  7800. * Licensed under the Apache License, Version 2.0 (the "License");
  7801. * you may not use this file except in compliance with the License.
  7802. * You may obtain a copy of the License at
  7803. *
  7804. * http://www.apache.org/licenses/LICENSE-2.0
  7805. *
  7806. * Unless required by applicable law or agreed to in writing, software
  7807. * distributed under the License is distributed on an "AS IS" BASIS,
  7808. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7809. * See the License for the specific language governing permissions and
  7810. * limitations under the License.
  7811. * =============================================================================
  7812. */
  7813. /**
  7814. * @license
  7815. * Copyright 2020 Google LLC. All Rights Reserved.
  7816. * Licensed under the Apache License, Version 2.0 (the License);
  7817. * you may not use this file except in compliance with the License.
  7818. * You may obtain a copy of the License at
  7819. *
  7820. * http://www.apache.org/licenses/LICENSE-2.0
  7821. *
  7822. * Unless required by applicable law or agreed to in writing, software
  7823. * distributed under the License is distributed on an AS IS BASIS,
  7824. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7825. * See the License for the specific language governing permissions and
  7826. * limitations under the License.
  7827. * =============================================================================
  7828. */
  7829. function Ps(t){const{inputs:e,attrs:n,backend:r}=t,{dim:i}=n,{input:o}=e,a=o.shape.length,l=o.shape.slice();let u=i;return i<0&&(s._152.assert(-(a+1)<=i,()=>`Axis must be in the interval [${-(a+1)}, ${a}]`),u=a+i+1),l.splice(u,0,1),ci({inputs:{x:o},backend:r,attrs:{shape:l}})}const Fs={kernelName:s._0,backendName:"webgl",kernelFunc:Ps},Bs="return exp(x) - 1.0;",js=ei({opSnippet:Bs,packedOpSnippet:Bs,cpuKernelImpl:In}),$s={kernelName:s._1,backendName:"webgl",kernelFunc:js};
  7830. /**
  7831. * @license
  7832. * Copyright 2020 Google LLC. All Rights Reserved.
  7833. * Licensed under the Apache License, Version 2.0 (the "License");
  7834. * you may not use this file except in compliance with the License.
  7835. * You may obtain a copy of the License at
  7836. *
  7837. * http://www.apache.org/licenses/LICENSE-2.0
  7838. *
  7839. * Unless required by applicable law or agreed to in writing, software
  7840. * distributed under the License is distributed on an "AS IS" BASIS,
  7841. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7842. * See the License for the specific language governing permissions and
  7843. * limitations under the License.
  7844. * =============================================================================
  7845. */
  7846. /**
  7847. * @license
  7848. * Copyright 2018 Google LLC. All Rights Reserved.
  7849. * Licensed under the Apache License, Version 2.0 (the "License");
  7850. * you may not use this file except in compliance with the License.
  7851. * You may obtain a copy of the License at
  7852. *
  7853. * http://www.apache.org/licenses/LICENSE-2.0
  7854. *
  7855. * Unless required by applicable law or agreed to in writing, software
  7856. * distributed under the License is distributed on an "AS IS" BASIS,
  7857. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7858. * See the License for the specific language governing permissions and
  7859. * limitations under the License.
  7860. * =============================================================================
  7861. */
  7862. class Us{constructor(t,e,n){this.variableNames=["real","imag"];const r=e[1];this.outputShape=e;const i=n?`2.0 * ${Math.PI}`:`-2.0 * ${Math.PI}`,o=n?`${r}.0`:"1.0";let s;if("real"===t)s="return real * expR - imag * expI;";else{if("imag"!==t)throw new Error(`FFT component must be either "real" or "imag", got ${t}.`);s="return real * expI + imag * expR;"}this.userCode=`\n const float exponentMultiplier = ${i};\n\n float unaryOpComplex(float real, float expR, float imag, float expI) {\n ${s}\n }\n\n float mulMatDFT(int batch, int index) {\n float indexRatio = float(index) / float(${r});\n float exponentMultiplierTimesIndexRatio =\n exponentMultiplier * indexRatio;\n\n float result = 0.0;\n\n for (int i = 0; i < ${r}; i++) {\n // x = (-2|2 * PI / N) * index * i;\n float x = exponentMultiplierTimesIndexRatio * float(i);\n float expR = cos(x);\n float expI = sin(x);\n float real = getReal(batch, i);\n float imag = getImag(batch, i);\n\n result +=\n unaryOpComplex(real, expR, imag, expI) / ${o};\n }\n\n return result;\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n setOutput(mulMatDFT(coords[0], coords[1]));\n }\n `}}
  7863. /**
  7864. * @license
  7865. * Copyright 2020 Google LLC. All Rights Reserved.
  7866. * Licensed under the Apache License, Version 2.0 (the "License");
  7867. * you may not use this file except in compliance with the License.
  7868. * You may obtain a copy of the License at
  7869. *
  7870. * http://www.apache.org/licenses/LICENSE-2.0
  7871. *
  7872. * Unless required by applicable law or agreed to in writing, software
  7873. * distributed under the License is distributed on an "AS IS" BASIS,
  7874. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7875. * See the License for the specific language governing permissions and
  7876. * limitations under the License.
  7877. * =============================================================================
  7878. */function Vs(t,e,n){const r=n.texData.get(t.dataId),i=s._152.sizeFromShape(t.shape),o=t.shape[t.shape.length-1],a=ci({inputs:{x:t},backend:n,attrs:{shape:[i/o,o]}}),l=a.shape,u=new Us("real",l,e),c=new Us("imag",l,e),h=[{dataId:r.complexTensorInfos.real.dataId,dtype:r.complexTensorInfos.real.dtype,shape:l},{dataId:r.complexTensorInfos.imag.dataId,dtype:r.complexTensorInfos.imag.dtype,shape:l}],d=n.runWebGLProgram(u,h,"float32"),p=n.runWebGLProgram(c,h,"float32"),f=Xr({inputs:{real:d,imag:p},backend:n});n.disposeIntermediateTensorInfo(d),n.disposeIntermediateTensorInfo(p);const g=ci({inputs:{x:f},backend:n,attrs:{shape:t.shape}});return n.disposeIntermediateTensorInfo(a),n.disposeIntermediateTensorInfo(f),g}
  7879. /**
  7880. * @license
  7881. * Copyright 2020 Google LLC. All Rights Reserved.
  7882. * Licensed under the Apache License, Version 2.0 (the "License");
  7883. * you may not use this file except in compliance with the License.
  7884. * You may obtain a copy of the License at
  7885. *
  7886. * http://www.apache.org/licenses/LICENSE-2.0
  7887. *
  7888. * Unless required by applicable law or agreed to in writing, software
  7889. * distributed under the License is distributed on an "AS IS" BASIS,
  7890. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7891. * See the License for the specific language governing permissions and
  7892. * limitations under the License.
  7893. * =============================================================================
  7894. */const Hs={kernelName:s._2,backendName:"webgl",kernelFunc:function(t){const{inputs:e,backend:n}=t,{input:r}=e;return Vs(r,!1,n)}};
  7895. /**
  7896. * @license
  7897. * Copyright 2019 Google LLC. All Rights Reserved.
  7898. * Licensed under the Apache License, Version 2.0 (the "License");
  7899. * you may not use this file except in compliance with the License.
  7900. * You may obtain a copy of the License at
  7901. *
  7902. * http://www.apache.org/licenses/LICENSE-2.0
  7903. *
  7904. * Unless required by applicable law or agreed to in writing, software
  7905. * distributed under the License is distributed on an "AS IS" BASIS,
  7906. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7907. * See the License for the specific language governing permissions and
  7908. * limitations under the License.
  7909. * =============================================================================
  7910. */class Ws{constructor(t,e){this.outputShape=[],this.customUniforms=[{name:"value",type:"float"}],this.variableNames=["x"],this.outputShape=t,this.userCode="\n void main() {\n // Input can be obtained from uniform value.\n setOutput(value);\n }\n "}}
  7911. /**
  7912. * @license
  7913. * Copyright 2020 Google LLC. All Rights Reserved.
  7914. * Licensed under the Apache License, Version 2.0 (the "License");
  7915. * you may not use this file except in compliance with the License.
  7916. * You may obtain a copy of the License at
  7917. *
  7918. * http://www.apache.org/licenses/LICENSE-2.0
  7919. *
  7920. * Unless required by applicable law or agreed to in writing, software
  7921. * distributed under the License is distributed on an "AS IS" BASIS,
  7922. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7923. * See the License for the specific language governing permissions and
  7924. * limitations under the License.
  7925. * =============================================================================
  7926. */function Gs(t){const{backend:e,attrs:n}=t,{shape:r,value:i}=n;let{dtype:o}=n;if("string"===(o=o||s._152.inferDtype(i))){const t=s._152.getArrayFromDType(o,s._152.sizeFromShape(r));return t.fill(i),e.makeTensorInfo(r,o,t)}{const t=new Ws(r,i),n=[[i]];return e.runWebGLProgram(t,[],o,n)}}const zs={kernelName:s._3,backendName:"webgl",kernelFunc:Gs};
  7927. /**
  7928. * @license
  7929. * Copyright 2020 Google LLC. All Rights Reserved.
  7930. * Licensed under the Apache License, Version 2.0 (the "License");
  7931. * you may not use this file except in compliance with the License.
  7932. * You may obtain a copy of the License at
  7933. *
  7934. * http://www.apache.org/licenses/LICENSE-2.0
  7935. *
  7936. * Unless required by applicable law or agreed to in writing, software
  7937. * distributed under the License is distributed on an "AS IS" BASIS,
  7938. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7939. * See the License for the specific language governing permissions and
  7940. * limitations under the License.
  7941. * =============================================================================
  7942. */
  7943. /**
  7944. * @license
  7945. * Copyright 2020 Google LLC. All Rights Reserved.
  7946. * Licensed under the Apache License, Version 2.0 (the "License");
  7947. * you may not use this file except in compliance with the License.
  7948. * You may obtain a copy of the License at
  7949. *
  7950. * http://www.apache.org/licenses/LICENSE-2.0
  7951. *
  7952. * Unless required by applicable law or agreed to in writing, software
  7953. * distributed under the License is distributed on an "AS IS" BASIS,
  7954. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7955. * See the License for the specific language governing permissions and
  7956. * limitations under the License.
  7957. * =============================================================================
  7958. */
  7959. const Xs={kernelName:s._4,backendName:"webgl",kernelFunc:({inputs:t,backend:e})=>{const{image:n}=t,r=e,i=new class{constructor(t){this.variableNames=["Image"],this.outputShape=[];const e=t[2];this.outputShape=t,this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int x = coords[2];\n\n int coordX = ${e} - x - 1;\n float outputValue;\n if(coordX >= 0 && coordX < ${e}) {\n outputValue = getImage(coords[0], coords[1], coordX, coords[3]);\n } else {\n outputValue = getImage(coords[0], coords[1], coords[2], coords[3]);\n }\n setOutput(outputValue);\n }\n `}}(n.shape);return r.runWebGLProgram(i,[n],n.dtype)}},Ks="return floor(x);",Ys=ei({opSnippet:Ks,packedOpSnippet:Ks,cpuKernelImpl:Rn}),qs={kernelName:s._5,backendName:"webgl",kernelFunc:Ys},Js=ni({opSnippet:"\n float s = sign(a) * sign(b);\n int ia = round(a);\n int ib = round(b);\n if (ib != 0) {\n // Windows (D3D) wants guaranteed non-zero int division at compile-time.\n return float(idiv(ia, ib, s));\n } else {\n return NAN;\n }\n",packedOpSnippet:"\n ivec4 ia = round(a);\n ivec4 ib = round(b);\n bvec4 cond = notEqual(ib, ivec4(0));\n ivec4 result = ivec4(0);\n vec4 s = sign(a) * sign(b);\n\n // Windows (D3D) wants guaranteed non-zero int division at compile-time.\n if (cond[0]) {\n result[0] = idiv(ia[0], ib[0], s[0]);\n }\n if (cond[1]) {\n result[1] = idiv(ia[1], ib[1], s[1]);\n }\n if (cond[2]) {\n result[2] = idiv(ia[2], ib[2], s[2]);\n }\n if (cond[3]) {\n result[3] = idiv(ia[3], ib[3], s[3]);\n }\n return vec4(result);\n",dtype:"int32"}),Zs={kernelName:s._6,backendName:"webgl",kernelFunc:Js};
  7960. /**
  7961. * @license
  7962. * Copyright 2020 Google LLC. All Rights Reserved.
  7963. * Licensed under the Apache License, Version 2.0 (the "License");
  7964. * you may not use this file except in compliance with the License.
  7965. * You may obtain a copy of the License at
  7966. *
  7967. * http://www.apache.org/licenses/LICENSE-2.0
  7968. *
  7969. * Unless required by applicable law or agreed to in writing, software
  7970. * distributed under the License is distributed on an "AS IS" BASIS,
  7971. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7972. * See the License for the specific language governing permissions and
  7973. * limitations under the License.
  7974. * =============================================================================
  7975. */
  7976. /**
  7977. * @license
  7978. * Copyright 2018 Google LLC. All Rights Reserved.
  7979. * Licensed under the Apache License, Version 2.0 (the "License");
  7980. * you may not use this file except in compliance with the License.
  7981. * You may obtain a copy of the License at
  7982. *
  7983. * http://www.apache.org/licenses/LICENSE-2.0
  7984. *
  7985. * Unless required by applicable law or agreed to in writing, software
  7986. * distributed under the License is distributed on an "AS IS" BASIS,
  7987. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7988. * See the License for the specific language governing permissions and
  7989. * limitations under the License.
  7990. * =============================================================================
  7991. */
  7992. class Qs{constructor(t){this.variableNames=["A"];const e=mt(),[n,r]=t;this.outputShape=t,this.userCode=`\n void main() {\n ivec3 coords = getOutputCoords();\n int texR = coords[0];\n int texC = coords[1];\n int depth = coords[2];\n vec2 uv = (vec2(texC, texR) + halfCR) / vec2(${r}.0, ${n}.0);\n\n vec4 values = ${e.texture2D}(A, uv);\n float value;\n if (depth == 0) {\n value = values.r;\n } else if (depth == 1) {\n value = values.g;\n } else if (depth == 2) {\n value = values.b;\n } else if (depth == 3) {\n value = values.a;\n }\n\n setOutput(floor(value * 255.0 + 0.5));\n }\n `}}
  7993. /**
  7994. * @license
  7995. * Copyright 2018 Google LLC. All Rights Reserved.
  7996. * Licensed under the Apache License, Version 2.0 (the "License");
  7997. * you may not use this file except in compliance with the License.
  7998. * You may obtain a copy of the License at
  7999. *
  8000. * http://www.apache.org/licenses/LICENSE-2.0
  8001. *
  8002. * Unless required by applicable law or agreed to in writing, software
  8003. * distributed under the License is distributed on an "AS IS" BASIS,
  8004. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8005. * See the License for the specific language governing permissions and
  8006. * limitations under the License.
  8007. * =============================================================================
  8008. */class ta{constructor(t){this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0;const e=mt(),[n,r]=t;this.outputShape=t,this.userCode=`\n void main() {\n ivec3 coords = getOutputCoords();\n int texR = coords[0];\n int texC = coords[1];\n int depth = coords[2];\n\n vec4 result = vec4(0.);\n\n for(int row=0; row<=1; row++) {\n for(int col=0; col<=1; col++) {\n texC = coords[1] + row;\n depth = coords[2] + col;\n\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(${r}.0, ${n}.0);\n vec4 values = ${e.texture2D}(A, uv);\n float value;\n if (depth == 0) {\n value = values.r;\n } else if (depth == 1) {\n value = values.g;\n } else if (depth == 2) {\n value = values.b;\n } else if (depth == 3) {\n value = values.a;\n }\n\n result[row * 2 + col] = floor(value * 255.0 + 0.5);\n }\n }\n\n ${e.output} = result;\n }\n `}}
  8009. /**
  8010. * @license
  8011. * Copyright 2019 Google LLC. All Rights Reserved.
  8012. * Licensed under the Apache License, Version 2.0 (the "License");
  8013. * you may not use this file except in compliance with the License.
  8014. * You may obtain a copy of the License at
  8015. *
  8016. * http://www.apache.org/licenses/LICENSE-2.0
  8017. *
  8018. * Unless required by applicable law or agreed to in writing, software
  8019. * distributed under the License is distributed on an "AS IS" BASIS,
  8020. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8021. * See the License for the specific language governing permissions and
  8022. * limitations under the License.
  8023. * =============================================================================
  8024. */const ea={kernelName:s._7,backendName:"webgl",kernelFunc:function(t){const{inputs:e,backend:n,attrs:r}=t;let{pixels:i}=e;const{numChannels:o}=r,a="undefined"!=typeof HTMLVideoElement&&i instanceof HTMLVideoElement,l="undefined"!=typeof HTMLImageElement&&i instanceof HTMLImageElement,[u,c]=a?[i.videoWidth,i.videoHeight]:[i.width,i.height],h=[c,u],p=[c,u,o];(l||a)&&(null==na&&(na=document.createElement("canvas").getContext("2d")),na.canvas.width=u,na.canvas.height=c,na.drawImage(i,0,0,u,c),i=na.canvas);const f=n.makeTensorInfo(h,"int32");n.texData.get(f.dataId).usage=d.PIXELS,n.gpgpu.uploadPixelDataToTexture(n.getTexture(f.dataId),i);const g=Object(s._127)().getBool("WEBGL_PACK")?new ta(p):new Qs(p),m=n.runWebGLProgram(g,[f],"int32");return n.disposeData(f.dataId),m}
  8025. /**
  8026. * @license
  8027. * Copyright 2020 Google LLC. All Rights Reserved.
  8028. * Licensed under the Apache License, Version 2.0 (the "License");
  8029. * you may not use this file except in compliance with the License.
  8030. * You may obtain a copy of the License at
  8031. *
  8032. * http://www.apache.org/licenses/LICENSE-2.0
  8033. *
  8034. * Unless required by applicable law or agreed to in writing, software
  8035. * distributed under the License is distributed on an "AS IS" BASIS,
  8036. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8037. * See the License for the specific language governing permissions and
  8038. * limitations under the License.
  8039. * =============================================================================
  8040. */};let na;const ra={kernelName:s._9,backendName:"webgl",kernelFunc:function(t){const{inputs:e,backend:n,attrs:r}=t,{x:i,filter:o,bias:a,preluActivationWeights:l}=e,{strides:u,pad:c,dataFormat:h,dilations:d,dimRoundingMode:p,activation:f,leakyreluAlpha:g}=r,m=s._115.convertConv2DDataFormat(h),v=s._115.computeConv2DInfo(i.shape,o.shape,u,d,c,p,!1,m);let b;const _=[];if(1!==v.filterHeight||1!==v.filterWidth||1!==v.dilationHeight||1!==v.dilationWidth||1!==v.strideHeight||1!==v.strideWidth||"SAME"!==v.padInfo.type&&"VALID"!==v.padInfo.type)if(Object(s._127)().getBool("WEBGL_CONV_IM2COL")&&1===i.shape[0])b=zo({x:i,filter:o,convInfo:v,backend:n,bias:a,activation:f,preluActivationWeights:l,leakyreluAlpha:g});else{const t=null!=a,e=null!=l,r="leakyrelu"===f,u=f?ri(f,!1):null,c=new Vo(v,t,u,e,r),h=[i,o];if(a&&h.push(a),l&&h.push(l),r){const t=n.makeTensorInfo([],"float32",s._152.createScalarValue(g,"float32"));h.push(t),_.push(t)}b=n.runWebGLProgram(c,h,"float32")}else b=Go({x:i,filter:o,convInfo:v,backend:n,bias:a,activation:f,preluActivationWeights:l,leakyreluAlpha:g});const y=ci({inputs:{x:b},backend:n,attrs:{shape:v.outShape}});return _.push(b),_.forEach(t=>n.disposeIntermediateTensorInfo(t)),y}};
  8041. /**
  8042. * @license
  8043. * Copyright 2020 Google LLC. All Rights Reserved.
  8044. * Licensed under the Apache License, Version 2.0 (the "License");
  8045. * you may not use this file except in compliance with the License.
  8046. * You may obtain a copy of the License at
  8047. *
  8048. * http://www.apache.org/licenses/LICENSE-2.0
  8049. *
  8050. * Unless required by applicable law or agreed to in writing, software
  8051. * distributed under the License is distributed on an "AS IS" BASIS,
  8052. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8053. * See the License for the specific language governing permissions and
  8054. * limitations under the License.
  8055. * =============================================================================
  8056. */const ia={kernelName:s._10,backendName:"webgl",kernelFunc:function(t){const{inputs:e,backend:n,attrs:r}=t,{x:i,filter:o,bias:a,preluActivationWeights:l}=e,{strides:u,pad:c,dilations:h,dimRoundingMode:d,activation:p,leakyreluAlpha:f}=r,g=[];let m=h;null==m&&(m=[1,1]),s._152.assert(s._115.eitherStridesOrDilationsAreOne(u,m),()=>"Error in depthwiseConv2d: Either strides or dilations must be "+`1. Got strides ${u} and dilations '${m}'`);const v=s._115.computeConv2DInfo(i.shape,o.shape,u,m,c,d,!0),b=Object(s._127)().getBool("WEBGL_PACK_DEPTHWISECONV")&&v.strideWidth<=2&&v.outChannels/v.inChannels==1,_=p?ri(p,b):null,y=[i,o],T=null!=a,x=null!=l,E="leakyrelu"===p;if(T&&y.push(a),x&&y.push(l),E){const t=n.makeTensorInfo([],"float32",s._152.createScalarValue(f,"float32"));y.push(t),g.push(t)}let w;w=b?new ms(v,T,_,x,E):new gs(v,T,_,x,E);const C=[[v.padInfo.top,v.padInfo.left],[v.strideHeight,v.strideWidth],[v.dilationHeight,v.dilationWidth],[v.inHeight,v.inWidth]],S=n.runWebGLProgram(w,y,"float32",C);return g.forEach(t=>n.disposeIntermediateTensorInfo(t)),S}};class oa{constructor(t,e,n){this.sliceDim=t,this.strides=e,this.variableNames=["x","indices"],this.outputShape=n;const r=Dt(e.length),i=Dt(n.length),o=this.sliceDim>1?"strides[j]":"strides";this.userCode=`\n ${r} strides = ${r}(${this.strides});\n void main() {\n ${i} coords = getOutputCoords();\n int flattenIndex = 0;\n for (int j = 0; j < ${this.sliceDim}; j++) {\n int index = round(getIndices(coords[0], j));\n flattenIndex += index * ${o};\n }\n setOutput(getX(flattenIndex, coords[1]));\n }\n `}}
  8057. /**
  8058. * @license
  8059. * Copyright 2020 Google LLC. All Rights Reserved.
  8060. * Licensed under the Apache License, Version 2.0 (the "License");
  8061. * you may not use this file except in compliance with the License.
  8062. * You may obtain a copy of the License at
  8063. *
  8064. * http://www.apache.org/licenses/LICENSE-2.0
  8065. *
  8066. * Unless required by applicable law or agreed to in writing, software
  8067. * distributed under the License is distributed on an "AS IS" BASIS,
  8068. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8069. * See the License for the specific language governing permissions and
  8070. * limitations under the License.
  8071. * =============================================================================
  8072. */const sa={kernelName:s._11,backendName:"webgl",kernelFunc:function(t){const{inputs:e,backend:n}=t,{params:r,indices:i}=e,o=i.shape,a=o[o.length-1],l=s._152.sizeFromShape(r.shape),[u,c,h,d]=s._115.prepareAndValidate(r,i),p=ci({inputs:{x:i},backend:n,attrs:{shape:[c,a]}}),f=ci({inputs:{x:r},backend:n,attrs:{shape:[s._152.sizeFromShape(r.shape)/h,h]}});if(n.shouldExecuteOnCPU([r,i])||"string"===r.dtype){const t=n.readSync(i.dataId),e=n.bufferSync(r),o=An(t,e,r.dtype,c,a,h,d,r.shape,l);return n.makeTensorInfo(u,r.dtype,o.values)}const g=new oa(a,d,[c,h]),m=n.runWebGLProgram(g,[f,p],f.dtype),v=ci({inputs:{x:m},backend:n,attrs:{shape:u}});return n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(m),v}};
  8073. /**
  8074. * @license
  8075. * Copyright 2017 Google LLC. All Rights Reserved.
  8076. * Licensed under the Apache License, Version 2.0 (the "License");
  8077. * you may not use this file except in compliance with the License.
  8078. * You may obtain a copy of the License at
  8079. *
  8080. * http://www.apache.org/licenses/LICENSE-2.0
  8081. *
  8082. * Unless required by applicable law or agreed to in writing, software
  8083. * distributed under the License is distributed on an "AS IS" BASIS,
  8084. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8085. * See the License for the specific language governing permissions and
  8086. * limitations under the License.
  8087. * =============================================================================
  8088. */class aa{constructor(t,e){this.variableNames=["A","indices"],this.outputShape=e,this.rank=e.length;const n=Dt(this.rank),r=function(t,e){const n=["resRC.x","resRC.y","resRC.z","resRC.w"],r=[];for(let e=0;e<t.length;e++)2===e?r.push("index"):r.push(`${n[e]}`);return r.join()}
  8089. /**
  8090. * @license
  8091. * Copyright 2020 Google LLC. All Rights Reserved.
  8092. * Licensed under the Apache License, Version 2.0 (the "License");
  8093. * you may not use this file except in compliance with the License.
  8094. * You may obtain a copy of the License at
  8095. *
  8096. * http://www.apache.org/licenses/LICENSE-2.0
  8097. *
  8098. * Unless required by applicable law or agreed to in writing, software
  8099. * distributed under the License is distributed on an "AS IS" BASIS,
  8100. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8101. * See the License for the specific language governing permissions and
  8102. * limitations under the License.
  8103. * =============================================================================
  8104. */(t);this.userCode=`\n void main() {\n ${n} resRC = getOutputCoords();\n int index = int(getIndices(resRC.x, resRC.z));\n float inBounds = (index >= 0) && (index < ${t[2]}) ? 1.0 : 0.0;\n setOutput(inBounds * getA(${r}));\n }\n `}}function la(t){const{inputs:e,backend:n,attrs:r}=t,{x:i,indices:o}=e,{axis:a,batchDims:l}=r,u=s._152.parseAxisParam(a,i.shape)[0];if(Object(s._127)().get("DEBUG")){const t=n.readSync(o.dataId),e=i.shape[u];for(let n=0;n<t.length;++n){const r=t[n];s._152.assert(r<=e-1&&r>=0,()=>`GatherV2: the index value ${r} is not in [0, ${e-1}]`)}}const c=s._115.segment_util.collectGatherOpShapeInfo(i,o,u,l),h=s._152.sizeFromShape(o.shape),d=[],p=ci({inputs:{x:i},backend:n,attrs:{shape:[c.batchSize,c.outerSize,c.dimSize,c.sliceSize]}}),f=ci({inputs:{x:o},backend:n,attrs:{shape:[c.batchSize,h/c.batchSize]}});d.push(p),d.push(f);const g=[c.batchSize,c.outerSize,h/c.batchSize,c.sliceSize];if(n.shouldExecuteOnCPU([i,o])||"string"===i.dtype){const t=n.bufferSync(f),e=n.bufferSync(p),r=Nn(e,t,g);return d.forEach(t=>n.disposeIntermediateTensorInfo(t)),n.makeTensorInfo(c.outputShape,r.dtype,r.values)}const m=new aa(p.shape,g),v=n.runWebGLProgram(m,[p,f],p.dtype);d.push(v);const b=ci({inputs:{x:v},backend:n,attrs:{shape:c.outputShape}});return d.forEach(t=>n.disposeIntermediateTensorInfo(t)),b}const ua={kernelName:s._12,backendName:"webgl",kernelFunc:la},ca=ni({opSnippet:"return float(a > b);",packedOpSnippet:"\n return vec4(greaterThan(a, b));\n",cpuKernelImpl:Dn,dtype:"bool"}),ha={kernelName:s._13,backendName:"webgl",kernelFunc:ca},da=ni({opSnippet:"return float(a >= b);",packedOpSnippet:"\n return vec4(greaterThanEqual(a, b));\n",dtype:"bool",cpuKernelImpl:Mn}),pa={kernelName:s._14,backendName:"webgl",kernelFunc:da};
  8105. /**
  8106. * @license
  8107. * Copyright 2020 Google LLC. All Rights Reserved.
  8108. * Licensed under the Apache License, Version 2.0 (the "License");
  8109. * you may not use this file except in compliance with the License.
  8110. * You may obtain a copy of the License at
  8111. *
  8112. * http://www.apache.org/licenses/LICENSE-2.0
  8113. *
  8114. * Unless required by applicable law or agreed to in writing, software
  8115. * distributed under the License is distributed on an "AS IS" BASIS,
  8116. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8117. * See the License for the specific language governing permissions and
  8118. * limitations under the License.
  8119. * =============================================================================
  8120. */const fa={kernelName:s._15,backendName:"webgl",kernelFunc:
  8121. /**
  8122. * @license
  8123. * Copyright 2020 Google LLC. All Rights Reserved.
  8124. * Licensed under the Apache License, Version 2.0 (the "License");
  8125. * you may not use this file except in compliance with the License.
  8126. * You may obtain a copy of the License at
  8127. *
  8128. * http://www.apache.org/licenses/LICENSE-2.0
  8129. *
  8130. * Unless required by applicable law or agreed to in writing, software
  8131. * distributed under the License is distributed on an "AS IS" BASIS,
  8132. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8133. * See the License for the specific language governing permissions and
  8134. * limitations under the License.
  8135. * =============================================================================
  8136. */
  8137. function(t){const{inputs:e,backend:n}=t,{input:r}=e;return Vs(r,!0,n)}},ga=ei({opSnippet:"return float(!isnan(x) && !isinf(x));",dtype:"bool"}),ma={kernelName:s._18,backendName:"webgl",kernelFunc:ga},va=ei({opSnippet:"return float(isinf(x));",dtype:"bool"}),ba={kernelName:s._19,backendName:"webgl",kernelFunc:va},_a=ei({opSnippet:"return float(isnan(x));",dtype:"bool"}),ya={kernelName:s._20,backendName:"webgl",kernelFunc:_a},Ta=ni({opSnippet:"return float(a < b);",packedOpSnippet:"\n return vec4(lessThan(a, b));\n",cpuKernelImpl:Ln,dtype:"bool"}),xa={kernelName:s._25,backendName:"webgl",kernelFunc:Ta},Ea=ni({opSnippet:"return float(a <= b);",packedOpSnippet:"\n return vec4(lessThanEqual(a, b));\n",cpuKernelImpl:Pn,dtype:"bool"}),wa={kernelName:s._26,backendName:"webgl",kernelFunc:Ea};
  8138. /**
  8139. * @license
  8140. * Copyright 2020 Google LLC. All Rights Reserved.
  8141. * Licensed under the Apache License, Version 2.0 (the "License");
  8142. * you may not use this file except in compliance with the License.
  8143. * You may obtain a copy of the License at
  8144. *
  8145. * http://www.apache.org/licenses/LICENSE-2.0
  8146. *
  8147. * Unless required by applicable law or agreed to in writing, software
  8148. * distributed under the License is distributed on an "AS IS" BASIS,
  8149. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8150. * See the License for the specific language governing permissions and
  8151. * limitations under the License.
  8152. * =============================================================================
  8153. */const Ca={kernelName:s._27,backendName:"webgl",kernelFunc:
  8154. /**
  8155. * @license
  8156. * Copyright 2020 Google LLC. All Rights Reserved.
  8157. * Licensed under the Apache License, Version 2.0 (the "License");
  8158. * you may not use this file except in compliance with the License.
  8159. * You may obtain a copy of the License at
  8160. *
  8161. * http://www.apache.org/licenses/LICENSE-2.0
  8162. *
  8163. * Unless required by applicable law or agreed to in writing, software
  8164. * distributed under the License is distributed on an "AS IS" BASIS,
  8165. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8166. * See the License for the specific language governing permissions and
  8167. * limitations under the License.
  8168. * =============================================================================
  8169. */
  8170. function(t){const{backend:e,attrs:n}=t,{start:r,stop:i,num:o}=n,s=Fn(r,i,o);return e.makeTensorInfo([s.length],"float32",s)}},Sa=ei({opSnippet:"if (isnan(x)) return x;\n return x < 0.0 ? 0./0. : log(x);\n",packedOpSnippet:"\n vec4 result = log(x);\n bvec4 isNaN = isnan(x);\n result.r = isNaN.r ? x.r : (x.r < 0.0 ? 0./0. : result.r);\n result.g = isNaN.g ? x.g : (x.g < 0.0 ? 0./0. : result.g);\n result.b = isNaN.b ? x.b : (x.b < 0.0 ? 0./0. : result.b);\n result.a = isNaN.a ? x.a : (x.a < 0.0 ? 0./0. : result.a);\n return result;\n",cpuKernelImpl:Bn}),ka={kernelName:s._28,backendName:"webgl",kernelFunc:Sa},Oa=ei({opSnippet:"if (isnan(x)) return x;\n return log(1.0 + x);\n"}),Ia={kernelName:s._29,backendName:"webgl",kernelFunc:Oa},Ra=ni({opSnippet:"return float(a >= 1.0 && b >= 1.0);",packedOpSnippet:"\n return vec4(\n vec4(greaterThanEqual(a, vec4(1.0))) *\n vec4(greaterThanEqual(b, vec4(1.0))));\n",dtype:"bool"}),Aa={kernelName:s._30,backendName:"webgl",kernelFunc:Ra},Na=ei({opSnippet:"return float(!(x >= 1.0));"}),Da={kernelName:s._31,backendName:"webgl",kernelFunc:Na},Ma=ni({opSnippet:"return float(a >= 1.0 || b >= 1.0);",packedOpSnippet:"\n return min(\n vec4(greaterThanEqual(a, vec4(1.0))) +\n vec4(greaterThanEqual(b, vec4(1.0))),\n vec4(1.0));\n",dtype:"bool"}),La={kernelName:s._32,backendName:"webgl",kernelFunc:Ma};
  8171. /**
  8172. * @license
  8173. * Copyright 2020 Google LLC. All Rights Reserved.
  8174. * Licensed under the Apache License, Version 2.0 (the "License");
  8175. * you may not use this file except in compliance with the License.
  8176. * You may obtain a copy of the License at
  8177. *
  8178. * http://www.apache.org/licenses/LICENSE-2.0
  8179. *
  8180. * Unless required by applicable law or agreed to in writing, software
  8181. * distributed under the License is distributed on an "AS IS" BASIS,
  8182. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8183. * See the License for the specific language governing permissions and
  8184. * limitations under the License.
  8185. * =============================================================================
  8186. */
  8187. /**
  8188. * @license
  8189. * Copyright 2020 Google LLC. All Rights Reserved.
  8190. * Licensed under the Apache License, Version 2.0 (the "License");
  8191. * you may not use this file except in compliance with the License.
  8192. * You may obtain a copy of the License at
  8193. *
  8194. * http://www.apache.org/licenses/LICENSE-2.0
  8195. *
  8196. * Unless required by applicable law or agreed to in writing, software
  8197. * distributed under the License is distributed on an "AS IS" BASIS,
  8198. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8199. * See the License for the specific language governing permissions and
  8200. * limitations under the License.
  8201. * =============================================================================
  8202. */
  8203. const Pa={kernelName:s._22,backendName:"webgl",kernelFunc:t=>{const{inputs:e,backend:n,attrs:r}=t,{x:i}=e,{depthRadius:o,bias:a,alpha:l,beta:u}=r,c=Object(s._127)().getBool("WEBGL_PACK_NORMALIZATION")?new
  8204. /**
  8205. * @license
  8206. * Copyright 2019 Google LLC. All Rights Reserved.
  8207. * Licensed under the Apache License, Version 2.0 (the "License");
  8208. * you may not use this file except in compliance with the License.
  8209. * You may obtain a copy of the License at
  8210. *
  8211. * http://www.apache.org/licenses/LICENSE-2.0
  8212. *
  8213. * Unless required by applicable law or agreed to in writing, software
  8214. * distributed under the License is distributed on an "AS IS" BASIS,
  8215. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8216. * See the License for the specific language governing permissions and
  8217. * limitations under the License.
  8218. * =============================================================================
  8219. */
  8220. class{constructor(t,e,n,r,i){this.variableNames=["x"],this.outputShape=[],this.packedInputs=!0,this.packedOutput=!0;const o=e,s=t[3]-1;let a;this.outputShape=t;const l=`float(${n}) + float(${r}) * sum`;a=.5===i?`inversesqrt(${l})`:1===i?`1.0/(${l})`:`exp(log(${l}) * float(-${i}));`,this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords.x;\n int r = coords.y;\n int c = coords.z;\n int d = coords.w;\n\n bool hasNextCol = d < ${this.outputShape[3]};\n bool hasNextRow = c < ${this.outputShape[2]};\n\n vec4 sum = vec4(0.);\n vec4 xFragAtOutputCoords = getX(b, r, c, d);\n\n vec4 xAtOutputCoords = vec4(\n getChannel(xFragAtOutputCoords, vec2(c, d)),\n hasNextCol ?\n getChannel(xFragAtOutputCoords, vec2(c, d + 1)) : 0.0,\n hasNextRow ?\n getChannel(xFragAtOutputCoords , vec2(c + 1, d)) : 0.0,\n (hasNextRow && hasNextCol) ?\n getChannel(xFragAtOutputCoords, vec2(c + 1, d + 1)) : 0.0\n );\n\n int firstChannel = d - ${o};\n vec2 cache = vec2(0.);\n if(firstChannel >= 0){\n vec4 firstChannelFrag = getX(b, r, c, firstChannel);\n cache.x = getChannel(firstChannelFrag, vec2(c, firstChannel));\n if(hasNextRow){\n cache.y = getChannel(firstChannelFrag, vec2(c + 1, firstChannel));\n }\n }\n\n ivec2 depth = ivec2(d, d + 1);\n for (int j = - ${o}; j <= ${o}; j++) {\n ivec2 idx = depth + j;\n bvec2 aboveLowerBound = greaterThanEqual(idx, ivec2(0));\n bvec2 belowUpperBound = lessThanEqual(idx, ivec2(${s}));\n\n bool depthInRange = aboveLowerBound.x && belowUpperBound.x;\n bool depthPlusOneInRange = aboveLowerBound.y && belowUpperBound.y;\n\n if(depthInRange || depthPlusOneInRange){\n vec4 z = vec4(0.);\n vec4 xFragAtCurrentDepth;\n z.xz = cache.xy;\n if(depthPlusOneInRange && hasNextCol){\n xFragAtCurrentDepth = idx.y != d ?\n getX(b, r, c, idx.y) : xFragAtOutputCoords;\n z.y = getChannel(xFragAtCurrentDepth, vec2(c, idx.y));\n if(hasNextRow){\n z.w = getChannel(xFragAtCurrentDepth, vec2(c + 1, idx.y));\n }\n }\n cache.xy = z.yw;\n sum += z * z;\n }\n }\n vec4 result = xAtOutputCoords * ${a};\n setOutput(result);\n }\n `}}(i.shape,o,a,l,u):new
  8221. /**
  8222. * @license
  8223. * Copyright 2017 Google LLC. All Rights Reserved.
  8224. * Licensed under the Apache License, Version 2.0 (the "License");
  8225. * you may not use this file except in compliance with the License.
  8226. * You may obtain a copy of the License at
  8227. *
  8228. * http://www.apache.org/licenses/LICENSE-2.0
  8229. *
  8230. * Unless required by applicable law or agreed to in writing, software
  8231. * distributed under the License is distributed on an "AS IS" BASIS,
  8232. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8233. * See the License for the specific language governing permissions and
  8234. * limitations under the License.
  8235. * =============================================================================
  8236. */
  8237. class{constructor(t,e,n,r,i){this.variableNames=["x"],this.outputShape=[];const o=e,s=t[3]-1;let a;this.outputShape=t;const l=`float(${n}) + float(${r}) * sum`;a=.5===i?`inversesqrt(${l})`:1===i?`1.0/(${l})`:`exp(log(${l}) * float(-${i}));`,this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int r = coords[1];\n int c = coords[2];\n int d = coords[3];\n float x = getX(b, r, c, d);\n float sum = 0.0;\n for (int j = -${o}; j <= ${o}; j++) {\n int idx = d + j;\n if (idx >= 0 && idx <= ${s}) {\n float z = getX(b, r, c, idx);\n sum += z * z;\n }\n }\n float val = x * ${a};\n setOutput(val);\n }\n `}}(i.shape,o,a,l,u);return n.runWebGLProgram(c,[i],i.dtype)}};
  8238. /**
  8239. * @license
  8240. * Copyright 2020 Google LLC. All Rights Reserved.
  8241. * Licensed under the Apache License, Version 2.0 (the "License");
  8242. * you may not use this file except in compliance with the License.
  8243. * You may obtain a copy of the License at
  8244. *
  8245. * http://www.apache.org/licenses/LICENSE-2.0
  8246. *
  8247. * Unless required by applicable law or agreed to in writing, software
  8248. * distributed under the License is distributed on an "AS IS" BASIS,
  8249. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8250. * See the License for the specific language governing permissions and
  8251. * limitations under the License.
  8252. * =============================================================================
  8253. */
  8254. const Fa={kernelName:s._23,backendName:"webgl",kernelFunc:t=>{const{inputs:e,backend:n,attrs:r}=t,{x:i,y:o,dy:s}=e,{depthRadius:a,bias:l,alpha:u,beta:c}=r,h=new
  8255. /**
  8256. * @license
  8257. * Copyright 2018 Google LLC. All Rights Reserved.
  8258. * Licensed under the Apache License, Version 2.0 (the "License");
  8259. * you may not use this file except in compliance with the License.
  8260. * You may obtain a copy of the License at
  8261. *
  8262. * http://www.apache.org/licenses/LICENSE-2.0
  8263. *
  8264. * Unless required by applicable law or agreed to in writing, software
  8265. * distributed under the License is distributed on an "AS IS" BASIS,
  8266. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8267. * See the License for the specific language governing permissions and
  8268. * limitations under the License.
  8269. * =============================================================================
  8270. */
  8271. class{constructor(t,e,n,r,i){this.variableNames=["inputImage","outputImage","dy"],this.outputShape=[],this.outputShape=t,this.depth=t[3],this.depthRadius=e,this.bias=n,this.alpha=r,this.beta=i,this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int r = coords[1];\n int c = coords[2];\n\n float result = 0.0;\n for (int d = 0; d < ${this.depth}; ++d) {\n int depthBegin = int(max(0.0, float(d - ${e})));\n int depthEnd = int(min(float(${this.depth}),\n float(d + ${e} + 1)));\n\n const int MIN_DEPTH_BEGIN = 0;\n const int MAX_DEPTH_END = ${this.depth};\n\n float norm = 0.0;\n for (int k = MIN_DEPTH_BEGIN; k < MAX_DEPTH_END; ++k) {\n if (k < depthBegin){\n continue;\n }\n else if (k >= depthBegin && k < depthEnd) {\n norm += getInputImage(b, r, c, k) * getInputImage(b, r, c, k);\n }\n else {\n break;\n }\n }\n\n norm = float(${r}) * norm + float(${n});\n\n for(int k = MIN_DEPTH_BEGIN; k < MAX_DEPTH_END; ++k){\n if (k < depthBegin){\n continue;\n }\n else if (k >= depthBegin && k < depthEnd){\n float dyi = -2.0 * float(${r})\n * float(${i})\n * getInputImage(b ,r ,c, k) * getOutputImage(b, r, c, d)\n / norm;\n if (k == d) {\n dyi += pow(norm, -1.0 * ${i});\n }\n if (k == coords[3]) {\n dyi *= getDy(b, r, c, d);\n result += dyi;\n }\n }\n else {\n break;\n }\n }\n }\n setOutput(result);\n }\n `}}(i.shape,a,l,u,c);return n.runWebGLProgram(h,[i,o,s],i.dtype)}};
  8272. /**
  8273. * @license
  8274. * Copyright 2020 Google LLC. All Rights Reserved.
  8275. * Licensed under the Apache License, Version 2.0 (the "License");
  8276. * you may not use this file except in compliance with the License.
  8277. * You may obtain a copy of the License at
  8278. *
  8279. * http://www.apache.org/licenses/LICENSE-2.0
  8280. *
  8281. * Unless required by applicable law or agreed to in writing, software
  8282. * distributed under the License is distributed on an "AS IS" BASIS,
  8283. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8284. * See the License for the specific language governing permissions and
  8285. * limitations under the License.
  8286. * =============================================================================
  8287. */
  8288. function Ba(t){const{inputs:e,backend:n,attrs:r}=t,{x:i}=e,{reductionIndices:o,keepDims:a}=r,l=i.shape.length,u=s._152.parseAxisParam(o,i.shape);let c=u;const h=s._115.getAxesPermutation(c,l),d=null!=h,p=n.shouldExecuteOnCPU([i]);let f=i;if(d){if(p){const t=n.texData.get(f.dataId).values,e=new Array(l);for(let t=0;t<e.length;t++)e[t]=i.shape[h[t]];const r=lr(t,i.shape,i.dtype,h,e);f=n.makeTensorInfo(e,i.dtype),n.texData.get(f.dataId).values=r}else f=vi(i,h,n);c=s._115.getInnerMostAxes(c.length,l)}s._115.assertAxesAreInnerMostDims("max",c,l);const[g,m]=s._115.computeOutAndReduceShapes(f.shape,c);let v,b=g;if(a&&(b=s._115.expandShapeToKeepDim(g,u)),p){const t=n.texData.get(f.dataId).values,e=jn(t,s._152.sizeFromShape(m),b,i.dtype);v=n.makeTensorInfo(b,i.dtype),n.texData.get(v.dataId).values=e}else v=
  8289. /**
  8290. * @license
  8291. * Copyright 2020 Google LLC. All Rights Reserved.
  8292. * Licensed under the Apache License, Version 2.0 (the "License");
  8293. * you may not use this file except in compliance with the License.
  8294. * You may obtain a copy of the License at
  8295. *
  8296. * http://www.apache.org/licenses/LICENSE-2.0
  8297. *
  8298. * Unless required by applicable law or agreed to in writing, software
  8299. * distributed under the License is distributed on an "AS IS" BASIS,
  8300. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8301. * See the License for the specific language governing permissions and
  8302. * limitations under the License.
  8303. * =============================================================================
  8304. */
  8305. function(t,e,n,r){const i=s._152.sizeFromShape(e),o=ci({inputs:{x:t},attrs:{shape:[s._152.sizeFromShape(t.shape)/i,i]},backend:r}),a=fi(o,t.dtype,"max",r),l=ci({inputs:{x:a},attrs:{shape:n},backend:r});return r.disposeIntermediateTensorInfo(o),r.disposeIntermediateTensorInfo(a),l}(f,m,b,n);return d&&n.disposeIntermediateTensorInfo(f),v}const ja={kernelName:s._33,backendName:"webgl",kernelFunc:Ba},$a=ni({opSnippet:"\n if (isnan(a)) return a;\n if (isnan(b)) return b;\n\n return max(a, b);\n",packedOpSnippet:"\n vec4 result = vec4(max(a, b));\n vec4 isNaN = min(vec4(isnan(a)) + vec4(isnan(b)), vec4(1.0));\n \n result.r = isNaN.r > 0. ? NAN : result.r;\n result.g = isNaN.g > 0. ? NAN : result.g;\n result.b = isNaN.b > 0. ? NAN : result.b;\n result.a = isNaN.a > 0. ? NAN : result.a;\n\n return result;\n",cpuKernelImpl:$n}),Ua={kernelName:s._39,backendName:"webgl",kernelFunc:$a};
  8306. /**
  8307. * @license
  8308. * Copyright 2020 Google LLC. All Rights Reserved.
  8309. * Licensed under the Apache License, Version 2.0 (the "License");
  8310. * you may not use this file except in compliance with the License.
  8311. * You may obtain a copy of the License at
  8312. *
  8313. * http://www.apache.org/licenses/LICENSE-2.0
  8314. *
  8315. * Unless required by applicable law or agreed to in writing, software
  8316. * distributed under the License is distributed on an "AS IS" BASIS,
  8317. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8318. * See the License for the specific language governing permissions and
  8319. * limitations under the License.
  8320. * =============================================================================
  8321. */const Va={kernelName:s._34,backendName:"webgl",kernelFunc:
  8322. /**
  8323. * @license
  8324. * Copyright 2020 Google LLC. All Rights Reserved.
  8325. * Licensed under the Apache License, Version 2.0 (the "License");
  8326. * you may not use this file except in compliance with the License.
  8327. * You may obtain a copy of the License at
  8328. *
  8329. * http://www.apache.org/licenses/LICENSE-2.0
  8330. *
  8331. * Unless required by applicable law or agreed to in writing, software
  8332. * distributed under the License is distributed on an "AS IS" BASIS,
  8333. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8334. * See the License for the specific language governing permissions and
  8335. * limitations under the License.
  8336. * =============================================================================
  8337. */
  8338. function(t){const{inputs:e,backend:n,attrs:r}=t,{x:i}=e;ft(i,"maxPool");const{filterSize:o,strides:a,pad:l,dimRoundingMode:u}=r;s._152.assert(s._115.eitherStridesOrDilationsAreOne(a,1),()=>"Error in maxPool: Either strides or dilations must be 1. "+`Got strides ${a} and dilations '1'`);const c=s._115.computePool2DInfo(i.shape,o,a,1,l,u);if(1===c.filterWidth&&1===c.filterHeight&&s._152.arraysEqual(c.inShape,c.outShape))return Gr({inputs:{x:i},backend:n});const h=new to(c,"max",!1);return n.runWebGLProgram(h,[i],i.dtype)}};
  8339. /**
  8340. * @license
  8341. * Copyright 2020 Google LLC. All Rights Reserved.
  8342. * Licensed under the Apache License, Version 2.0 (the "License");
  8343. * you may not use this file except in compliance with the License.
  8344. * You may obtain a copy of the License at
  8345. *
  8346. * http://www.apache.org/licenses/LICENSE-2.0
  8347. *
  8348. * Unless required by applicable law or agreed to in writing, software
  8349. * distributed under the License is distributed on an "AS IS" BASIS,
  8350. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8351. * See the License for the specific language governing permissions and
  8352. * limitations under the License.
  8353. * =============================================================================
  8354. */const Ha={kernelName:s._35,backendName:"webgl",kernelFunc:function(t){const{inputs:e,backend:n,attrs:r}=t,{x:i}=e,{filterSize:o,strides:a,pad:l,dataFormat:u,dimRoundingMode:c}=r,h=s._115.computePool3DInfo(i.shape,o,a,[1,1,1],l,c,u),d=new eo(h,"max",!1);return n.runWebGLProgram(d,[i],i.dtype)}};
  8355. /**
  8356. * @license
  8357. * Copyright 2017 Google LLC. All Rights Reserved.
  8358. * Licensed under the Apache License, Version 2.0 (the "License");
  8359. * you may not use this file except in compliance with the License.
  8360. * You may obtain a copy of the License at
  8361. *
  8362. * http://www.apache.org/licenses/LICENSE-2.0
  8363. *
  8364. * Unless required by applicable law or agreed to in writing, software
  8365. * distributed under the License is distributed on an "AS IS" BASIS,
  8366. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8367. * See the License for the specific language governing permissions and
  8368. * limitations under the License.
  8369. * =============================================================================
  8370. */class Wa{constructor(t){this.variableNames=["dy","maxPos"],this.outputShape=t.inShape;const e=t.strideHeight,n=t.strideWidth,r=t.dilationHeight,i=t.effectiveFilterHeight,o=t.effectiveFilterWidth,s=i-1-t.padInfo.top,a=o-1-t.padInfo.left,l=i*o-1;this.userCode=`\n const ivec2 pads = ivec2(${s}, ${a});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n\n ivec2 dyRCCorner = coords.yz - pads;\n int dyRCorner = dyRCCorner.x;\n int dyCCorner = dyRCCorner.y;\n\n // Convolve dy(?, ?, d) with pos mask(:, :, d) to get dx(xR, xC, d).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < ${i};\n wR += ${r}) {\n float dyR = float(dyRCorner + wR) / ${e}.0;\n\n if (dyR < 0.0 || dyR >= ${t.outHeight}.0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n for (int wC = 0; wC < ${o}; wC++) {\n float dyC = float(dyCCorner + wC) / ${n}.0;\n\n if (dyC < 0.0 || dyC >= ${t.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n float dyValue = getDy(b, idyR, idyC, d);\n int maxPosValue = ${l} - int(getMaxPos(b, idyR, idyC, d));\n\n // Get the current value, check it against the value from the\n // position matrix.\n int curPosValue = wR * ${o} + wC;\n float mask = float(maxPosValue == curPosValue ? 1.0 : 0.0);\n\n dotProd += dyValue * mask;\n }\n }\n setOutput(dotProd);\n }\n `}}class Ga{constructor(t){this.variableNames=["dy","maxPos"],this.outputShape=t.inShape;const e=t.strideDepth,n=t.strideHeight,r=t.strideWidth,i=t.dilationDepth,o=t.dilationHeight,s=t.dilationWidth,a=t.effectiveFilterDepth,l=t.effectiveFilterHeight,u=t.effectiveFilterWidth,c=a-1-t.padInfo.front,h=l-1-t.padInfo.top,d=u-1-t.padInfo.left,p=a*l*u-1;this.userCode=`\n const ivec3 pads = ivec3(${c}, ${h}, ${d});\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int ch = coords.u;\n\n ivec3 dyCorner = ivec3(coords.y, coords.z, coords.w) - pads;\n int dyDCorner = dyCorner.x;\n int dyRCorner = dyCorner.y;\n int dyCCorner = dyCorner.z;\n\n // Convolve dy(?, ?, ?, ch) with pos mask(:, :, :, d) to get\n // dx(xD, xR, xC, ch).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n\n for (int wD = 0; wD < ${a};\n wD += ${i}) {\n float dyD = float(dyDCorner + wD) / ${e}.0;\n\n if (dyD < 0.0 || dyD >= ${t.outDepth}.0 || fract(dyD) > 0.0) {\n continue;\n }\n int idyD = int(dyD);\n\n for (int wR = 0; wR < ${l};\n wR += ${o}) {\n float dyR = float(dyRCorner + wR) / ${n}.0;\n\n if (dyR < 0.0 || dyR >= ${t.outHeight}.0 ||\n fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n for (int wC = 0; wC < ${u};\n wC += ${s}) {\n float dyC = float(dyCCorner + wC) / ${r}.0;\n\n if (dyC < 0.0 || dyC >= ${t.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n float dyValue = getDy(batch, idyD, idyR, idyC, ch);\n int maxPosValue = ${p} -\n int(getMaxPos(batch, idyD, idyR, idyC, ch));\n\n // Get the current value, check it against the value from the\n // position matrix.\n int curPosValue =\n wD * ${l} * ${u} +\n wR * ${u} + wC;\n float mask = float(maxPosValue == curPosValue ? 1.0 : 0.0);\n\n dotProd += dyValue * mask;\n }\n }\n }\n setOutput(dotProd);\n }\n `}}
  8371. /**
  8372. * @license
  8373. * Copyright 2020 Google LLC. All Rights Reserved.
  8374. * Licensed under the Apache License, Version 2.0 (the "License");
  8375. * you may not use this file except in compliance with the License.
  8376. * You may obtain a copy of the License at
  8377. *
  8378. * http://www.apache.org/licenses/LICENSE-2.0
  8379. *
  8380. * Unless required by applicable law or agreed to in writing, software
  8381. * distributed under the License is distributed on an "AS IS" BASIS,
  8382. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8383. * See the License for the specific language governing permissions and
  8384. * limitations under the License.
  8385. * =============================================================================
  8386. */const za={kernelName:s._36,backendName:"webgl",kernelFunc:function(t){const{inputs:e,backend:n,attrs:r}=t,{dy:i,input:o}=e,a=o,{filterSize:l,strides:u,pad:c,dimRoundingMode:h}=r,d=s._115.computePool3DInfo(a.shape,l,u,[1,1,1],c,h),p=new eo(d,"max",!0),f=n.runWebGLProgram(p,[a],a.dtype),g=new Ga(d),m=n.runWebGLProgram(g,[i,f],a.dtype);return n.disposeIntermediateTensorInfo(f),m}};
  8387. /**
  8388. * @license
  8389. * Copyright 2020 Google LLC. All Rights Reserved.
  8390. * Licensed under the Apache License, Version 2.0 (the "License");
  8391. * you may not use this file except in compliance with the License.
  8392. * You may obtain a copy of the License at
  8393. *
  8394. * http://www.apache.org/licenses/LICENSE-2.0
  8395. *
  8396. * Unless required by applicable law or agreed to in writing, software
  8397. * distributed under the License is distributed on an "AS IS" BASIS,
  8398. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8399. * See the License for the specific language governing permissions and
  8400. * limitations under the License.
  8401. * =============================================================================
  8402. */const Xa={kernelName:s._37,backendName:"webgl",kernelFunc:function(t){const{inputs:e,backend:n,attrs:r}=t,{dy:i,input:o,output:a}=e,l=o;ft([o,a],"maxPoolGrad");const{filterSize:u,strides:c,pad:h,dimRoundingMode:d}=r,p=s._115.computePool2DInfo(l.shape,u,c,1,h,d),f=new to(p,"max",!0),g=n.runWebGLProgram(f,[l],l.dtype),m=new Wa(p),v=n.runWebGLProgram(m,[i,g],l.dtype);return n.disposeIntermediateTensorInfo(g),v}};
  8403. /**
  8404. * @license
  8405. * Copyright 2020 Google LLC. All Rights Reserved.
  8406. * Licensed under the Apache License, Version 2.0 (the "License");
  8407. * you may not use this file except in compliance with the License.
  8408. * You may obtain a copy of the License at
  8409. *
  8410. * http://www.apache.org/licenses/LICENSE-2.0
  8411. *
  8412. * Unless required by applicable law or agreed to in writing, software
  8413. * distributed under the License is distributed on an "AS IS" BASIS,
  8414. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8415. * See the License for the specific language governing permissions and
  8416. * limitations under the License.
  8417. * =============================================================================
  8418. */
  8419. /**
  8420. * @license
  8421. * Copyright 2020 Google LLC. All Rights Reserved.
  8422. * Licensed under the Apache License, Version 2.0 (the "License");
  8423. * you may not use this file except in compliance with the License.
  8424. * You may obtain a copy of the License at
  8425. *
  8426. * http://www.apache.org/licenses/LICENSE-2.0
  8427. *
  8428. * Unless required by applicable law or agreed to in writing, software
  8429. * distributed under the License is distributed on an "AS IS" BASIS,
  8430. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8431. * See the License for the specific language governing permissions and
  8432. * limitations under the License.
  8433. * =============================================================================
  8434. */
  8435. const Ka={kernelName:s._38,backendName:"webgl",kernelFunc:({inputs:t,attrs:e,backend:n})=>{const{x:r}=t,{filterSize:i,strides:o,pad:a,includeBatchInIndex:l}=e,u=n;s._152.assert(4===r.shape.length,()=>`Error in maxPool: input must be rank 4 but got rank ${r.shape.length}.`);const c=[1,1];s._152.assert(s._115.eitherStridesOrDilationsAreOne(o,c),()=>"Error in maxPool: Either strides or dilations must be 1. "+`Got strides ${o} and dilations '${c}'`);const h=s._115.computePool2DInfo(r.shape,i,o,c,a),[d,p]=function(t,e,n,r){let i=new to(n,"max",!1);const o=r.runWebGLProgram(i,[t],"float32");return i=new to(n,"max",!0,!0,e),[o,r.runWebGLProgram(i,[t],"float32")]}(r,l,h,u);return[d,p]}};
  8436. /**
  8437. * @license
  8438. * Copyright 2020 Google LLC. All Rights Reserved.
  8439. * Licensed under the Apache License, Version 2.0 (the "License");
  8440. * you may not use this file except in compliance with the License.
  8441. * You may obtain a copy of the License at
  8442. *
  8443. * http://www.apache.org/licenses/LICENSE-2.0
  8444. *
  8445. * Unless required by applicable law or agreed to in writing, software
  8446. * distributed under the License is distributed on an "AS IS" BASIS,
  8447. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8448. * See the License for the specific language governing permissions and
  8449. * limitations under the License.
  8450. * =============================================================================
  8451. */
  8452. /**
  8453. * @license
  8454. * Copyright 2020 Google LLC. All Rights Reserved.
  8455. * Licensed under the Apache License, Version 2.0 (the "License");
  8456. * you may not use this file except in compliance with the License.
  8457. * You may obtain a copy of the License at
  8458. *
  8459. * http://www.apache.org/licenses/LICENSE-2.0
  8460. *
  8461. * Unless required by applicable law or agreed to in writing, software
  8462. * distributed under the License is distributed on an "AS IS" BASIS,
  8463. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8464. * See the License for the specific language governing permissions and
  8465. * limitations under the License.
  8466. * =============================================================================
  8467. */
  8468. const Ya={kernelName:s._40,backendName:"webgl",kernelFunc:({inputs:t,attrs:e,backend:n})=>{const{x:r}=t,{keepDims:i,axis:o}=e,a=n,l=r.shape.length,u=s._152.parseAxisParam(o,r.shape);let c=u;const h=s._115.getAxesPermutation(c,l),d=null!=h,p=a.shouldExecuteOnCPU([r]),f=[];let g=r;if(d){if(p){const t=a.texData.get(g.dataId).values,e=new Array(l);for(let t=0;t<e.length;t++)e[t]=r.shape[h[t]];const n=lr(t,r.shape,r.dtype,h,e);g=a.makeTensorInfo(e,r.dtype),a.texData.get(g.dataId).values=n}else g=vi(r,h,a);f.push(g),c=s._115.getInnerMostAxes(c.length,l)}s._115.assertAxesAreInnerMostDims("sum",c,l);const[m,v]=s._115.computeOutAndReduceShapes(g.shape,c);let b=m;i&&(b=s._115.expandShapeToKeepDim(m,u));const _=function(t,e,n,r){const i=s._152.sizeFromShape(e),o=ci({inputs:{x:t},attrs:{shape:[s._152.sizeFromShape(t.shape)/i,i]},backend:r}),a=fi(o,"float32","mean",r),l=ci({inputs:{x:a},attrs:{shape:n},backend:r});return r.disposeIntermediateTensorInfo(o),r.disposeIntermediateTensorInfo(a),l}(g,v,b,a);for(const t of f)a.disposeIntermediateTensorInfo(t);return _}};
  8469. /**
  8470. * @license
  8471. * Copyright 2020 Google LLC. All Rights Reserved.
  8472. * Licensed under the Apache License, Version 2.0 (the "License");
  8473. * you may not use this file except in compliance with the License.
  8474. * You may obtain a copy of the License at
  8475. *
  8476. * http://www.apache.org/licenses/LICENSE-2.0
  8477. *
  8478. * Unless required by applicable law or agreed to in writing, software
  8479. * distributed under the License is distributed on an "AS IS" BASIS,
  8480. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8481. * See the License for the specific language governing permissions and
  8482. * limitations under the License.
  8483. * =============================================================================
  8484. */const qa={kernelName:s._41,backendName:"webgl",kernelFunc:function(t){const{inputs:e,backend:n,attrs:r}=t,{x:i}=e,{axis:o,keepDims:a}=r,l=i.shape.length,u=s._152.parseAxisParam(o,i.shape);let c=u;const h=s._115.getAxesPermutation(c,l);let d=i;null!=h&&(d=yi({inputs:{x:i},backend:n,attrs:{perm:h}}),c=s._115.getInnerMostAxes(c.length,i.shape.length)),s._115.assertAxesAreInnerMostDims("min",c,l);const[p,f]=s._115.computeOutAndReduceShapes(d.shape,c),g=ci({inputs:{x:d},backend:n,attrs:{shape:[-1,s._152.sizeFromShape(f)]}}),m=fi(g,g.dtype,"min",n);let v;v=ci(a?{inputs:{x:m},backend:n,attrs:{shape:s._115.expandShapeToKeepDim(p,u)}}:{inputs:{x:m},backend:n,attrs:{shape:p}});return n.disposeIntermediateTensorInfo(g),n.disposeIntermediateTensorInfo(m),null!=h&&n.disposeIntermediateTensorInfo(d),v}},Ja=ni({opSnippet:"\n if (isnan(a)) return a;\n if (isnan(b)) return b;\n\n return min(a, b);\n",packedOpSnippet:"\n vec4 result = vec4(min(a, b));\n vec4 isNaN = min(vec4(isnan(a)) + vec4(isnan(b)), vec4(1.0));\n \n result.r = isNaN.r > 0. ? NAN : result.r;\n result.g = isNaN.g > 0. ? NAN : result.g;\n result.b = isNaN.b > 0. ? NAN : result.b;\n result.a = isNaN.a > 0. ? NAN : result.a;\n\n return result;\n",cpuKernelImpl:Un}),Za={kernelName:s._42,backendName:"webgl",kernelFunc:Ja};
  8485. /**
  8486. * @license
  8487. * Copyright 2020 Google LLC. All Rights Reserved.
  8488. * Licensed under the Apache License, Version 2.0 (the "License");
  8489. * you may not use this file except in compliance with the License.
  8490. * You may obtain a copy of the License at
  8491. *
  8492. * http://www.apache.org/licenses/LICENSE-2.0
  8493. *
  8494. * Unless required by applicable law or agreed to in writing, software
  8495. * distributed under the License is distributed on an "AS IS" BASIS,
  8496. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8497. * See the License for the specific language governing permissions and
  8498. * limitations under the License.
  8499. * =============================================================================
  8500. */
  8501. /**
  8502. * @license
  8503. * Copyright 2020 Google LLC. All Rights Reserved.
  8504. * Licensed under the Apache License, Version 2.0 (the "License");
  8505. * you may not use this file except in compliance with the License.
  8506. * You may obtain a copy of the License at
  8507. *
  8508. * http://www.apache.org/licenses/LICENSE-2.0
  8509. *
  8510. * Unless required by applicable law or agreed to in writing, software
  8511. * distributed under the License is distributed on an "AS IS" BASIS,
  8512. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8513. * See the License for the specific language governing permissions and
  8514. * limitations under the License.
  8515. * =============================================================================
  8516. */
  8517. const Qa={kernelName:s._43,backendName:"webgl",kernelFunc:({inputs:t,backend:e,attrs:n})=>{const{x:r}=t,{paddings:i,mode:o}=n,a=Object(s._127)().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new
  8518. /**
  8519. * @license
  8520. * Copyright 2020 Google LLC. All Rights Reserved.
  8521. * Licensed under the Apache License, Version 2.0 (the "License");
  8522. * you may not use this file except in compliance with the License.
  8523. * You may obtain a copy of the License at
  8524. *
  8525. * http://www.apache.org/licenses/LICENSE-2.0
  8526. *
  8527. * Unless required by applicable law or agreed to in writing, software
  8528. * distributed under the License is distributed on an "AS IS" BASIS,
  8529. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8530. * See the License for the specific language governing permissions and
  8531. * limitations under the License.
  8532. * =============================================================================
  8533. */
  8534. class{constructor(t,e,n){this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e.map((e,n)=>e[0]+t[n]+e[1]);const r=t.length,i=Dt(r),o=e.map(t=>t[0]).join(","),s=e.map((e,n)=>e[0]+t[n]).join(","),a=hr("rc",r),l=hr("source",r),u=`${a[r-1]} < ${this.outputShape[r-1]}`,c=1===r?"source":`vec2(${l.slice(-2).join()})`,h="reflect"===n?0:1;let d="";if(1===r){const t=`\n ${i} source = rc;\n if (source < start) {\n source = start * 2 - source - ${h};\n } else if (source >= end) {\n source = (end - 1) * 2 - source + ${h};\n }\n source -= start;\n `;d=`\n ${i} rc = outputLoc;\n ${t}\n result[0] = getChannel(getX(${l.join()}), ${c});\n ${a[r-1]} += 1;\n if(${u}) {\n ${t}\n result[1] = getChannel(getX(${l.join()}), ${c});\n }\n `}else{const t=`\n ${i} source = rc;\n ${i} lt = ${i}(lessThan(source, start));\n ${i} gte = ${i}(greaterThanEqual(source, end));\n ${i} orig = 1 - (lt + gte);\n source = orig * source +\n lt * (start * 2 - source - ${h}) +\n gte * ((end - 1) * 2 - source + ${h});\n source -= start;\n `;d=`\n ${i} rc = outputLoc;\n ${t}\n result[0] = getChannel(getX(${l.join()}), ${c});\n ${a[r-1]} += 1;\n if(${u}) {\n ${t}\n result[1] = getChannel(getX(${l.join()}), ${c});\n }\n rc = outputLoc;\n ${a[r-2]} += 1;\n if(${a[r-2]} < ${this.outputShape[r-2]}) {\n ${t}\n result[2] = getChannel(getX(${l.join()}), ${c});\n ${a[r-1]} += 1;\n if(${u}) {\n ${t}\n result[3] = getChannel(getX(${l.join()}), ${c});\n }\n }\n `}this.userCode=`\n const ${i} start = ${i}(${o});\n const ${i} end = ${i}(${s});\n\n void main() {\n ${i} outputLoc = getOutputCoords();\n vec4 result = vec4(0.);\n ${d}\n setOutput(result);\n }\n `}}(r.shape,i,o):new
  8535. /**
  8536. * @license
  8537. * Copyright 2020 Google LLC. All Rights Reserved.
  8538. * Licensed under the Apache License, Version 2.0 (the "License");
  8539. * you may not use this file except in compliance with the License.
  8540. * You may obtain a copy of the License at
  8541. *
  8542. * http://www.apache.org/licenses/LICENSE-2.0
  8543. *
  8544. * Unless required by applicable law or agreed to in writing, software
  8545. * distributed under the License is distributed on an "AS IS" BASIS,
  8546. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8547. * See the License for the specific language governing permissions and
  8548. * limitations under the License.
  8549. * =============================================================================
  8550. */
  8551. class{constructor(t,e,n){this.variableNames=["x"],this.outputShape=e.map((e,n)=>e[0]+t[n]+e[1]);const r=t.length,i=Dt(r),o=e.map(t=>t[0]).join(","),s=e.map((e,n)=>e[0]+t[n]).join(","),a=["coords[0]","coords[1]","coords[2]","coords[3]"].slice(0,r),l="reflect"===n?0:1;this.userCode=1!==r?`\n ${i} start = ${i}(${o});\n ${i} end = ${i}(${s});\n\n void main() {\n ${i} outC = getOutputCoords();\n for (int i = 0; i < ${r}; i++) {\n if (outC[i] < start[i]) {\n outC[i] = start[i] * 2 - outC[i] - ${l};\n } else if(outC[i] >= end[i]) {\n outC[i] = (end[i] - 1) * 2 - outC[i] + ${l};\n }\n }\n ${i} coords = outC - start;\n setOutput(getX(${a}));\n }\n `:`\n int start = ${o};\n int end = ${s};\n\n void main() {\n int outC = getOutputCoords();\n if (outC < start) {\n outC = start * 2 - outC - ${l};\n } else if(outC >= end) {\n outC = (end - 1) * 2 - outC + ${l};\n }\n setOutput(getX(outC - start));\n }\n `}}(r.shape,i,o);return e.runWebGLProgram(a,[r],r.dtype)}},tl=ni({opSnippet:"if (b == 0.0) return NAN;\n return mod(a, b);",packedOpSnippet:"\n vec4 result = mod(a, b);\n vec4 isNaN = vec4(equal(b, vec4(0.0)));\n \n result.r = isNaN.r > 0. ? NAN : result.r;\n result.g = isNaN.g > 0. ? NAN : result.g;\n result.b = isNaN.b > 0. ? NAN : result.b;\n result.a = isNaN.a > 0. ? NAN : result.a;\n\n return result;\n"}),el={kernelName:s._44,backendName:"webgl",kernelFunc:tl};
  8552. /**
  8553. * @license
  8554. * Copyright 2017 Google LLC. All Rights Reserved.
  8555. * Licensed under the Apache License, Version 2.0 (the "License");
  8556. * you may not use this file except in compliance with the License.
  8557. * You may obtain a copy of the License at
  8558. *
  8559. * http://www.apache.org/licenses/LICENSE-2.0
  8560. *
  8561. * Unless required by applicable law or agreed to in writing, software
  8562. * distributed under the License is distributed on an "AS IS" BASIS,
  8563. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8564. * See the License for the specific language governing permissions and
  8565. * limitations under the License.
  8566. * =============================================================================
  8567. */
  8568. class nl{constructor(t,e,n){this.variableNames=["probs"],this.customUniforms=[{name:"seed",type:"float"}],this.outputShape=[t,n],this.userCode=`\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n\n float r = random(seed);\n float cdf = 0.0;\n\n for (int i = 0; i < ${e-1}; i++) {\n cdf += getProbs(batch, i);\n\n if (r < cdf) {\n setOutput(float(i));\n return;\n }\n }\n\n // If no other event happened, last event happened.\n setOutput(float(${e-1}));\n }\n `}}
  8569. /**
  8570. * @license
  8571. * Copyright 2020 Google LLC. All Rights Reserved.
  8572. * Licensed under the Apache License, Version 2.0 (the "License");
  8573. * you may not use this file except in compliance with the License.
  8574. * You may obtain a copy of the License at
  8575. *
  8576. * http://www.apache.org/licenses/LICENSE-2.0
  8577. *
  8578. * Unless required by applicable law or agreed to in writing, software
  8579. * distributed under the License is distributed on an "AS IS" BASIS,
  8580. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8581. * See the License for the specific language governing permissions and
  8582. * limitations under the License.
  8583. * =============================================================================
  8584. */const rl=ni({opSnippet:"\nif (a == b) {\n return 1.0;\n};\nreturn a / b;",packedOpSnippet:"\n // vec4 one = vec4(equal(a, b));\n // return one + (vec4(1.0) - one) * a / b;\n vec4 result = a / b;\n if(a.x == b.x) {\n result.x = 1.;\n }\n if(a.y == b.y) {\n result.y = 1.;\n }\n if(a.z == b.z) {\n result.z = 1.;\n }\n if(a.w == b.w) {\n result.w = 1.;\n }\n\n return result;\n",checkOutOfBounds:!0}),il={kernelName:s._61,backendName:"webgl",kernelFunc:rl},ol="return a - b;",sl=ni({opSnippet:ol,packedOpSnippet:ol,supportsComplex:!0,cpuKernelImpl:or}),al={kernelName:s._99,backendName:"webgl",kernelFunc:sl};
  8585. /**
  8586. * @license
  8587. * Copyright 2020 Google LLC. All Rights Reserved.
  8588. * Licensed under the Apache License, Version 2.0 (the "License");
  8589. * you may not use this file except in compliance with the License.
  8590. * You may obtain a copy of the License at
  8591. *
  8592. * http://www.apache.org/licenses/LICENSE-2.0
  8593. *
  8594. * Unless required by applicable law or agreed to in writing, software
  8595. * distributed under the License is distributed on an "AS IS" BASIS,
  8596. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8597. * See the License for the specific language governing permissions and
  8598. * limitations under the License.
  8599. * =============================================================================
  8600. */
  8601. function ll(t){const{inputs:e,backend:n,attrs:r}=t,{logits:i}=e,{dim:o}=r,a=s._152.parseAxisParam([o],i.shape),l=Ba({inputs:{x:i},backend:n,attrs:{reductionIndices:a,keepDims:!1}}),u=s._115.expandShapeToKeepDim(l.shape,a),c=ci({inputs:{x:l},backend:n,attrs:{shape:u}}),h=sl({inputs:{a:i,b:c},backend:n}),d=Ms({inputs:{x:h},backend:n}),p=bi({inputs:{x:d},backend:n,attrs:{axis:a,keepDims:!1}}),f=ci({inputs:{x:p},backend:n,attrs:{shape:u}}),g=rl({inputs:{a:d,b:f},backend:n});return n.disposeIntermediateTensorInfo(l),n.disposeIntermediateTensorInfo(c),n.disposeIntermediateTensorInfo(h),n.disposeIntermediateTensorInfo(d),n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(f),g}const ul={kernelName:s._82,backendName:"webgl",kernelFunc:ll};
  8602. /**
  8603. * @license
  8604. * Copyright 2020 Google LLC. All Rights Reserved.
  8605. * Licensed under the Apache License, Version 2.0 (the "License");
  8606. * you may not use this file except in compliance with the License.
  8607. * You may obtain a copy of the License at
  8608. *
  8609. * http://www.apache.org/licenses/LICENSE-2.0
  8610. *
  8611. * Unless required by applicable law or agreed to in writing, software
  8612. * distributed under the License is distributed on an "AS IS" BASIS,
  8613. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8614. * See the License for the specific language governing permissions and
  8615. * limitations under the License.
  8616. * =============================================================================
  8617. */const cl={kernelName:s._45,backendName:"webgl",kernelFunc:function(t){const{inputs:e,backend:n,attrs:r}=t,{logits:i}=e,{numSamples:o,seed:s,normalized:a}=r,l=a?i:ll({inputs:{logits:i},backend:n,attrs:{dim:i.shape.length-1}}),u=l.shape[0],c=l.shape[1],h=new nl(u,c,o),d=[[s]],p=n.runWebGLProgram(h,[l],"int32",d);return a||n.disposeIntermediateTensorInfo(l),p}},hl=_r+"\n return -x;\n",dl="\n vec4 result = -x;\n bvec4 isNaN = isnan(x);\n\n result.r = isNaN.r ? x.r : result.r;\n result.g = isNaN.g ? x.g : result.g;\n result.b = isNaN.b ? x.b : result.b;\n result.a = isNaN.a ? x.a : result.a;\n\n return result;\n";
  8618. /**
  8619. * @license
  8620. * Copyright 2020 Google LLC. All Rights Reserved.
  8621. * Licensed under the Apache License, Version 2.0 (the "License");
  8622. * you may not use this file except in compliance with the License.
  8623. * You may obtain a copy of the License at
  8624. *
  8625. * http://www.apache.org/licenses/LICENSE-2.0
  8626. *
  8627. * Unless required by applicable law or agreed to in writing, software
  8628. * distributed under the License is distributed on an "AS IS" BASIS,
  8629. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8630. * See the License for the specific language governing permissions and
  8631. * limitations under the License.
  8632. * =============================================================================
  8633. */const pl={kernelName:s._47,backendName:"webgl",kernelFunc:function(t){const{inputs:e,backend:n}=t,{x:r}=e;if(n.shouldExecuteOnCPU([r])){const t=n.texData.get(r.dataId),[e,i]=Hn(t.values,r.shape,r.dtype);return n.makeTensorInfo(i,r.dtype,e)}let i;return i=Object(s._127)().getBool("WEBGL_PACK_UNARY_OPERATIONS")?new Nr(r.shape,dl):new br(r.shape,hl),n.runWebGLProgram(i,[r],r.dtype)}},fl=s._133.nonMaxSuppressionV3Impl;
  8634. /**
  8635. * @license
  8636. * Copyright 2020 Google LLC. All Rights Reserved.
  8637. * Licensed under the Apache License, Version 2.0 (the "License");
  8638. * you may not use this file except in compliance with the License.
  8639. * You may obtain a copy of the License at
  8640. *
  8641. * http://www.apache.org/licenses/LICENSE-2.0
  8642. *
  8643. * Unless required by applicable law or agreed to in writing, software
  8644. * distributed under the License is distributed on an "AS IS" BASIS,
  8645. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8646. * See the License for the specific language governing permissions and
  8647. * limitations under the License.
  8648. * =============================================================================
  8649. */const gl={kernelName:s._48,backendName:"webgl",kernelFunc:function(t){s._115.warn("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");const{inputs:e,backend:n,attrs:r}=t,{boxes:i,scores:o}=e,{maxOutputSize:a,iouThreshold:l,scoreThreshold:u}=r,c=n.readSync(i.dataId),h=n.readSync(o.dataId),{selectedIndices:d}=fl(c,h,a,l,u);return n.makeTensorInfo([d.length],"int32",new Int32Array(d))}},ml=s._133.nonMaxSuppressionV4Impl;
  8650. /**
  8651. * @license
  8652. * Copyright 2020 Google LLC. All Rights Reserved.
  8653. * Licensed under the Apache License, Version 2.0 (the "License");
  8654. * you may not use this file except in compliance with the License.
  8655. * You may obtain a copy of the License at
  8656. *
  8657. * http://www.apache.org/licenses/LICENSE-2.0
  8658. *
  8659. * Unless required by applicable law or agreed to in writing, software
  8660. * distributed under the License is distributed on an "AS IS" BASIS,
  8661. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8662. * See the License for the specific language governing permissions and
  8663. * limitations under the License.
  8664. * =============================================================================
  8665. */const vl={kernelName:s._49,backendName:"webgl",kernelFunc:function(t){s._115.warn("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");const{inputs:e,backend:n,attrs:r}=t,{boxes:i,scores:o}=e,{maxOutputSize:a,iouThreshold:l,scoreThreshold:u,padToMaxOutputSize:c}=r,h=n.readSync(i.dataId),d=n.readSync(o.dataId),{selectedIndices:p,validOutputs:f}=ml(h,d,a,l,u,c);return[n.makeTensorInfo([p.length],"int32",new Int32Array(p)),n.makeTensorInfo([],"int32",new Int32Array([f]))]}},bl=s._133.nonMaxSuppressionV5Impl;
  8666. /**
  8667. * @license
  8668. * Copyright 2020 Google LLC. All Rights Reserved.
  8669. * Licensed under the Apache License, Version 2.0 (the "License");
  8670. * you may not use this file except in compliance with the License.
  8671. * You may obtain a copy of the License at
  8672. *
  8673. * http://www.apache.org/licenses/LICENSE-2.0
  8674. *
  8675. * Unless required by applicable law or agreed to in writing, software
  8676. * distributed under the License is distributed on an "AS IS" BASIS,
  8677. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8678. * See the License for the specific language governing permissions and
  8679. * limitations under the License.
  8680. * =============================================================================
  8681. */const _l={kernelName:s._50,backendName:"webgl",kernelFunc:function(t){s._115.warn("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");const{inputs:e,backend:n,attrs:r}=t,{boxes:i,scores:o}=e,{maxOutputSize:a,iouThreshold:l,scoreThreshold:u,softNmsSigma:c}=r,h=n.readSync(i.dataId),d=n.readSync(o.dataId),p=a,f=l,g=u,m=c,{selectedIndices:v,selectedScores:b}=bl(h,d,p,f,g,m);return[n.makeTensorInfo([v.length],"int32",new Int32Array(v)),n.makeTensorInfo([b.length],"float32",new Float32Array(b))]}};
  8682. /**
  8683. * @license
  8684. * Copyright 2017 Google LLC. All Rights Reserved.
  8685. * Licensed under the Apache License, Version 2.0 (the "License");
  8686. * you may not use this file except in compliance with the License.
  8687. * You may obtain a copy of the License at
  8688. *
  8689. * http://www.apache.org/licenses/LICENSE-2.0
  8690. *
  8691. * Unless required by applicable law or agreed to in writing, software
  8692. * distributed under the License is distributed on an "AS IS" BASIS,
  8693. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8694. * See the License for the specific language governing permissions and
  8695. * limitations under the License.
  8696. * =============================================================================
  8697. */
  8698. /**
  8699. * @license
  8700. * Copyright 2020 Google LLC. All Rights Reserved.
  8701. * Licensed under the Apache License, Version 2.0 (the "License");
  8702. * you may not use this file except in compliance with the License.
  8703. * You may obtain a copy of the License at
  8704. *
  8705. * http://www.apache.org/licenses/LICENSE-2.0
  8706. *
  8707. * Unless required by applicable law or agreed to in writing, software
  8708. * distributed under the License is distributed on an "AS IS" BASIS,
  8709. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8710. * See the License for the specific language governing permissions and
  8711. * limitations under the License.
  8712. * =============================================================================
  8713. */
  8714. const yl={kernelName:s._52,backendName:"webgl",kernelFunc:t=>{const{inputs:e,backend:n,attrs:r}=t,{indices:i}=e,{depth:o,onValue:a,offValue:l}=r,u=s._152.sizeFromShape(i.shape),c=new class{constructor(t,e,n,r){this.variableNames=["indices"],this.outputShape=[t,e],this.userCode=`\n void main() {\n ivec2 coords = getOutputCoords();\n int index = round(getIndices(coords.x));\n setOutput(mix(float(${r}), float(${n}),\n float(index == coords.y)));\n }\n `}}(u,o,a,l),h=ci({inputs:{x:i},backend:n,attrs:{shape:[u]}}),d=n.runWebGLProgram(c,[h],i.dtype);n.disposeIntermediateTensorInfo(h);const p=ci({inputs:{x:d},backend:n,attrs:{shape:[...i.shape,o]}});return n.disposeIntermediateTensorInfo(d),p}};
  8715. /**
  8716. * @license
  8717. * Copyright 2020 Google LLC. All Rights Reserved.
  8718. * Licensed under the Apache License, Version 2.0 (the "License");
  8719. * you may not use this file except in compliance with the License.
  8720. * You may obtain a copy of the License at
  8721. *
  8722. * http://www.apache.org/licenses/LICENSE-2.0
  8723. *
  8724. * Unless required by applicable law or agreed to in writing, software
  8725. * distributed under the License is distributed on an "AS IS" BASIS,
  8726. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8727. * See the License for the specific language governing permissions and
  8728. * limitations under the License.
  8729. * =============================================================================
  8730. */
  8731. function Tl(t){const{inputs:e,backend:n}=t,{x:r}=e;if("complex64"===r.dtype){const t=To({inputs:{input:r},backend:n}),e=Tl({inputs:{x:t},backend:n}),i=Fo({inputs:{input:r},backend:n}),o=Tl({inputs:{x:i},backend:n}),s=Xr({inputs:{real:e,imag:o},backend:n});return n.disposeIntermediateTensorInfo(t),n.disposeIntermediateTensorInfo(e),n.disposeIntermediateTensorInfo(i),n.disposeIntermediateTensorInfo(o),s}return Gs({attrs:{shape:r.shape,dtype:r.dtype,value:"string"===r.dtype?"":0},backend:n})}const xl={kernelName:s._112,backendName:"webgl",kernelFunc:Tl};
  8732. /**
  8733. * @license
  8734. * Copyright 2020 Google LLC. All Rights Reserved.
  8735. * Licensed under the Apache License, Version 2.0 (the "License");
  8736. * you may not use this file except in compliance with the License.
  8737. * You may obtain a copy of the License at
  8738. *
  8739. * http://www.apache.org/licenses/LICENSE-2.0
  8740. *
  8741. * Unless required by applicable law or agreed to in writing, software
  8742. * distributed under the License is distributed on an "AS IS" BASIS,
  8743. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8744. * See the License for the specific language governing permissions and
  8745. * limitations under the License.
  8746. * =============================================================================
  8747. */const El={kernelName:s._53,backendName:"webgl",kernelFunc:function t(e){const{inputs:n,backend:r}=e,{x:i}=n;if("string"===i.dtype)throw new Error("onesLike is not supported under string dtype");if("complex64"===i.dtype){const e=To({inputs:{input:i},backend:r}),n=t({inputs:{x:e},backend:r}),o=Fo({inputs:{input:i},backend:r}),s=Tl({inputs:{x:o},backend:r}),a=Xr({inputs:{real:n,imag:s},backend:r});return r.disposeIntermediateTensorInfo(e),r.disposeIntermediateTensorInfo(n),r.disposeIntermediateTensorInfo(o),r.disposeIntermediateTensorInfo(s),a}return Gs({attrs:{shape:i.shape,dtype:i.dtype,value:1},backend:r})}};
  8748. /**
  8749. * @license
  8750. * Copyright 2020 Google LLC. All Rights Reserved.
  8751. * Licensed under the Apache License, Version 2.0 (the "License");
  8752. * you may not use this file except in compliance with the License.
  8753. * You may obtain a copy of the License at
  8754. *
  8755. * http://www.apache.org/licenses/LICENSE-2.0
  8756. *
  8757. * Unless required by applicable law or agreed to in writing, software
  8758. * distributed under the License is distributed on an "AS IS" BASIS,
  8759. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8760. * See the License for the specific language governing permissions and
  8761. * limitations under the License.
  8762. * =============================================================================
  8763. */const wl={kernelName:s._54,backendName:"webgl",kernelFunc:function(t){const{inputs:e,backend:n,attrs:r}=t,{axis:i}=r;if(1===e.length)return Ps({inputs:{input:e[0]},backend:n,attrs:{dim:i}});const o=e[0].shape,a=e[0].dtype;e.forEach(t=>{s._152.assertShapesMatch(o,t.shape,"All tensors passed to stack must have matching shapes"),s._152.assert(a===t.dtype,()=>"All tensors passed to stack must have matching dtypes")});const l=[],u=$o({inputs:e.map(t=>{const e=Ps({inputs:{input:t},backend:n,attrs:{dim:i}});return l.push(e),e}),backend:n,attrs:{axis:i}});return l.forEach(t=>n.disposeIntermediateTensorInfo(t)),u}};
  8764. /**
  8765. * @license
  8766. * Copyright 2017 Google LLC. All Rights Reserved.
  8767. * Licensed under the Apache License, Version 2.0 (the "License");
  8768. * you may not use this file except in compliance with the License.
  8769. * You may obtain a copy of the License at
  8770. *
  8771. * http://www.apache.org/licenses/LICENSE-2.0
  8772. *
  8773. * Unless required by applicable law or agreed to in writing, software
  8774. * distributed under the License is distributed on an "AS IS" BASIS,
  8775. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8776. * See the License for the specific language governing permissions and
  8777. * limitations under the License.
  8778. * =============================================================================
  8779. */
  8780. /**
  8781. * @license
  8782. * Copyright 2020 Google LLC. All Rights Reserved.
  8783. * Licensed under the Apache License, Version 2.0 (the "License");
  8784. * you may not use this file except in compliance with the License.
  8785. * You may obtain a copy of the License at
  8786. *
  8787. * http://www.apache.org/licenses/LICENSE-2.0
  8788. *
  8789. * Unless required by applicable law or agreed to in writing, software
  8790. * distributed under the License is distributed on an "AS IS" BASIS,
  8791. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8792. * See the License for the specific language governing permissions and
  8793. * limitations under the License.
  8794. * =============================================================================
  8795. */
  8796. const Cl=t=>{const{inputs:e,backend:n,attrs:r}=t,{x:i}=e,{paddings:o,constantValue:a}=r;if(0===s._152.sizeFromShape(i.shape)){return Gs({backend:n,attrs:{shape:o.map((t,e)=>t[0]+i.shape[e]+t[1]),value:a,dtype:i.dtype}})}const l=Object(s._127)().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new
  8797. /**
  8798. * @license
  8799. * Copyright 2019 Google LLC. All Rights Reserved.
  8800. * Licensed under the Apache License, Version 2.0 (the "License");
  8801. * you may not use this file except in compliance with the License.
  8802. * You may obtain a copy of the License at
  8803. *
  8804. * http://www.apache.org/licenses/LICENSE-2.0
  8805. *
  8806. * Unless required by applicable law or agreed to in writing, software
  8807. * distributed under the License is distributed on an "AS IS" BASIS,
  8808. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8809. * See the License for the specific language governing permissions and
  8810. * limitations under the License.
  8811. * =============================================================================
  8812. */
  8813. class{constructor(t,e,n){this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"value",type:"float"}],this.outputShape=e.map((e,n)=>e[0]+t[n]+e[1]);const r=t.length,i=Dt(r),o=e.map(t=>t[0]).join(","),s=e.map((e,n)=>e[0]+t[n]).join(","),a=hr("rc",r),l=hr("source",r),u=`${a[r-1]} < ${this.outputShape[r-1]}`,c=1===r?"source":`vec2(${l.slice(-2).join()})`,h=[`${i} rc = outputLoc;`,`${a[r-1]} += 1;\n if(${u}) {\n `,1===r?"":`}\n rc = outputLoc;\n ${a[r-2]} += 1;\n if(${a[r-2]} < ${this.outputShape[r-2]}) {`,1===r?"":` ${a[r-1]} += 1;\n if(${u}) {`],d=1===r?"rc < start || rc >= end":"any(lessThan(rc, start)) || any(greaterThanEqual(rc, end))";let p="";for(let t=0,e=1===r?2:4;t<e;t++)p+=`\n ${h[t]}\n if (${d}) {\n result[${t}] = float(value);\n } else {\n ${i} source = rc - start;\n result[${t}] = getChannel(getX(${l.join()}), ${c});\n }\n `;p+=1===r?"} ":"}}",this.userCode=`\n const ${i} start = ${i}(${o});\n const ${i} end = ${i}(${s});\n\n void main() {\n ${i} outputLoc = getOutputCoords();\n vec4 result = vec4(0.);\n ${p}\n setOutput(result);\n }\n `}}(i.shape,o,a):new class{constructor(t,e,n){this.variableNames=["x"],this.customUniforms=[{name:"value",type:"float"}],this.outputShape=e.map((e,n)=>e[0]+t[n]+e[1]);const r=t.length,i=Dt(r),o=e.map(t=>t[0]).join(","),s=e.map((e,n)=>e[0]+t[n]).join(","),a=["coords[0]","coords[1]","coords[2]","coords[3]"].slice(0,r);this.userCode=1!==r?`\n ${i} start = ${i}(${o});\n ${i} end = ${i}(${s});\n\n void main() {\n ${i} outC = getOutputCoords();\n if (any(lessThan(outC, start)) || any(greaterThanEqual(outC, end))) {\n setOutput(value);\n } else {\n ${i} coords = outC - start;\n setOutput(getX(${a}));\n }\n }\n `:`\n int start = ${o};\n int end = ${s};\n\n void main() {\n int outC = getOutputCoords();\n if (outC < start || outC >= end) {\n setOutput(value);\n } else {\n setOutput(getX(outC - start));\n }\n }\n `}}(i.shape,o,a),u=[[a]];return n.runWebGLProgram(l,[i],i.dtype,u)},Sl={kernelName:s._55,backendName:"webgl",kernelFunc:Cl},kl=ni({opSnippet:"\n if(a < 0.0 && floor(b) < b){\n return NAN;\n }\n if (b == 0.0) {\n return 1.0;\n }\n return (round(mod(b, 2.0)) != 1) ?\n pow(abs(a), b) : sign(a) * pow(abs(a), b);\n",packedOpSnippet:"\n // isModRound1 has 1 for components with round(mod(b, 2.0)) == 1, 0 otherwise.\n vec4 isModRound1 = vec4(equal(round(mod(b, 2.0)), ivec4(1)));\n vec4 multiplier = sign(a) * isModRound1 + (vec4(1.0) - isModRound1);\n vec4 result = multiplier * pow(abs(a), b);\n\n // Ensure that a^0 = 1, including 0^0 = 1 as this correspond to TF and JS\n bvec4 isExpZero = equal(b, vec4(0.0));\n result.r = isExpZero.r ? 1.0 : result.r;\n result.g = isExpZero.g ? 1.0 : result.g;\n result.b = isExpZero.b ? 1.0 : result.b;\n result.a = isExpZero.a ? 1.0 : result.a;\n\n vec4 isNaN = vec4(lessThan(a, vec4(0.0))) * vec4(lessThan(floor(b), b));\n \n result.r = isNaN.r > 0. ? NAN : result.r;\n result.g = isNaN.g > 0. ? NAN : result.g;\n result.b = isNaN.b > 0. ? NAN : result.b;\n result.a = isNaN.a > 0. ? NAN : result.a;\n\n return result;\n"}),Ol={kernelName:s._56,backendName:"webgl",kernelFunc:kl};const Il={kernelName:s._58,backendName:"webgl",kernelFunc:
  8814. /**
  8815. * @license
  8816. * Copyright 2020 Google LLC. All Rights Reserved.
  8817. * Licensed under the Apache License, Version 2.0 (the "License");
  8818. * you may not use this file except in compliance with the License.
  8819. * You may obtain a copy of the License at
  8820. *
  8821. * http://www.apache.org/licenses/LICENSE-2.0
  8822. *
  8823. * Unless required by applicable law or agreed to in writing, software
  8824. * distributed under the License is distributed on an "AS IS" BASIS,
  8825. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8826. * See the License for the specific language governing permissions and
  8827. * limitations under the License.
  8828. * =============================================================================
  8829. */
  8830. function(t){const{inputs:e,backend:n,attrs:r}=t,{x:i}=e,{axis:o,keepDims:a}=r,l=i.shape.length,u=[],c=s._152.parseAxisParam(o,i.shape);let h=c;const d=s._115.getAxesPermutation(h,l);let p,f=i;if(null!=d&&(f=yi({inputs:{x:i},backend:n,attrs:{perm:d}}),h=s._115.getInnerMostAxes(h.length,l),u.push(f)),s._115.assertAxesAreInnerMostDims("prod",h,l),n.shouldExecuteOnCPU([f])){const t=n.texData.get(f.dataId).values,{outVals:e,outShape:r,outDtype:i}=Gn(f.shape,f.dtype,t,h);p=n.makeTensorInfo(r,i,e)}else{const[t,e]=s._115.computeOutAndReduceShapes(f.shape,h),r=s._152.sizeFromShape(e),o=ci({inputs:{x:f},backend:n,attrs:{shape:[-1,r]}}),a=fi(o,Object(s._145)(i.dtype),"prod",n);p=ci({inputs:{x:a},backend:n,attrs:{shape:t}}),u.push(o),u.push(a)}if(a){u.push(p);const t=s._115.expandShapeToKeepDim(p.shape,c);p=ci({inputs:{x:p},backend:n,attrs:{shape:t}})}return u.forEach(t=>n.disposeIntermediateTensorInfo(t)),p}},Rl=t=>{const{backend:e,attrs:n}=t,{start:r,stop:i,step:o,dtype:s}=n,a=zn(r,i,o,s);return e.makeTensorInfo([a.length],s,a)},Al={kernelName:s._59,backendName:"webgl",kernelFunc:Rl},Nl=ei({opSnippet:"return 1.0 / x;"}),Dl={kernelName:s._62,backendName:"webgl",kernelFunc:Nl},Ml=ei({opSnippet:_r+"\n return (x < 0.0) ? 0.0 : x;\n",packedOpSnippet:"\n vec4 result = x * vec4(greaterThanEqual(x, vec4(0.0)));\n bvec4 isNaN = isnan(x);\n\n result.r = isNaN.r ? x.r : result.r;\n result.g = isNaN.g ? x.g : result.g;\n result.b = isNaN.b ? x.b : result.b;\n result.a = isNaN.a ? x.a : result.a;\n\n return result;\n"}),Ll={kernelName:s._63,backendName:"webgl",kernelFunc:Ml},Pl=ei({opSnippet:_r+"\n return (x < 0.0) ? 0.0 : min(6.0, x);\n",packedOpSnippet:"\n vec4 result = min(x, vec4(6.)) * vec4(greaterThanEqual(x, vec4(0.0)));\n bvec4 isNaN = isnan(x);\n\n result.r = isNaN.r ? x.r : result.r;\n result.g = isNaN.g ? x.g : result.g;\n result.b = isNaN.b ? x.b : result.b;\n result.a = isNaN.a ? x.a : result.a;\n\n return result;\n"}),Fl={kernelName:s._64,backendName:"webgl",kernelFunc:Pl};
  8831. /**
  8832. * @license
  8833. * Copyright 2020 Google LLC. All Rights Reserved.
  8834. * Licensed under the Apache License, Version 2.0 (the "License");
  8835. * you may not use this file except in compliance with the License.
  8836. * You may obtain a copy of the License at
  8837. *
  8838. * http://www.apache.org/licenses/LICENSE-2.0
  8839. *
  8840. * Unless required by applicable law or agreed to in writing, software
  8841. * distributed under the License is distributed on an "AS IS" BASIS,
  8842. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8843. * See the License for the specific language governing permissions and
  8844. * limitations under the License.
  8845. * =============================================================================
  8846. */
  8847. /**
  8848. * @license
  8849. * Copyright 2017 Google LLC. All Rights Reserved.
  8850. * Licensed under the Apache License, Version 2.0 (the "License");
  8851. * you may not use this file except in compliance with the License.
  8852. * You may obtain a copy of the License at
  8853. *
  8854. * http://www.apache.org/licenses/LICENSE-2.0
  8855. *
  8856. * Unless required by applicable law or agreed to in writing, software
  8857. * distributed under the License is distributed on an "AS IS" BASIS,
  8858. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8859. * See the License for the specific language governing permissions and
  8860. * limitations under the License.
  8861. * =============================================================================
  8862. */
  8863. class Bl{constructor(t,e,n,r,i){this.variableNames=["A"],this.outputShape=[];const[o,s,a,l]=t;this.outputShape=[o,e,n,l];const u=[r&&e>1?s-1:s,r&&n>1?a-1:a],c=[r&&e>1?e-1:e,r&&n>1?n-1:n];let h;h=i?"(vec2(yRC) + vec2(0.5)) * effectiveInputOverOutputRatioRC - vec2(0.5)":"vec2(yRC) * effectiveInputOverOutputRatioRC",this.userCode=`\n const vec2 effectiveInputOverOutputRatioRC = vec2(\n ${u[0]/c[0]},\n ${u[1]/c[1]});\n const vec2 inputShapeRC = vec2(${s}.0, ${a}.0);\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n ivec2 yRC = coords.yz;\n\n // Fractional source index.\n vec2 sourceFracIndexRC = ${h};\n\n // Compute the four integer indices.\n ivec2 sourceFloorRC = ivec2(max(sourceFracIndexRC, vec2(0.0)));\n ivec2 sourceCeilRC = ivec2(\n min(inputShapeRC - 1.0, ceil(sourceFracIndexRC)));\n\n float topLeft = getA(b, sourceFloorRC.x, sourceFloorRC.y, d);\n float bottomLeft = getA(b, sourceCeilRC.x, sourceFloorRC.y, d);\n float topRight = getA(b, sourceFloorRC.x, sourceCeilRC.y, d);\n float bottomRight = getA(b, sourceCeilRC.x, sourceCeilRC.y, d);\n\n vec2 fracRC = sourceFracIndexRC - vec2(sourceFloorRC);\n\n float top = topLeft + (topRight - topLeft) * fracRC.y;\n float bottom = bottomLeft + (bottomRight - bottomLeft) * fracRC.y;\n float newValue = top + (bottom - top) * fracRC.x;\n\n setOutput(newValue);\n }\n `}}
  8864. /**
  8865. * @license
  8866. * Copyright 2019 Google LLC. All Rights Reserved.
  8867. * Licensed under the Apache License, Version 2.0 (the "License");
  8868. * you may not use this file except in compliance with the License.
  8869. * You may obtain a copy of the License at
  8870. *
  8871. * http://www.apache.org/licenses/LICENSE-2.0
  8872. *
  8873. * Unless required by applicable law or agreed to in writing, software
  8874. * distributed under the License is distributed on an "AS IS" BASIS,
  8875. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8876. * See the License for the specific language governing permissions and
  8877. * limitations under the License.
  8878. * =============================================================================
  8879. */class jl{constructor(t,e,n,r,i){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=[];const[o,s,a,l]=t;this.outputShape=[o,e,n,l];const u=[r&&e>1?s-1:s,r&&n>1?a-1:a],c=[r&&e>1?e-1:e,r&&n>1?n-1:n];let h;h=i?"(vec3(yRC) + vec3(0.5)) * effectiveInputOverOutputRatioRC - vec3(0.5)":"vec3(yRC) * effectiveInputOverOutputRatioRC",this.userCode=`\n const vec3 effectiveInputOverOutputRatioRC = vec3(\n ${u[0]/c[0]},\n ${u[1]/c[1]},\n ${u[1]/c[1]});\n const vec3 inputShapeRC = vec3(${s}.0, ${a}.0,\n ${a}.0);\n\n float getAValue(int b, int r, int c, int d) {\n return getChannel(getA(b, r, c, d), vec2(c, d));\n }\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n // Calculate values for next column in yRC.z.\n ivec3 yRC = coords.yzz + ivec3(0, 0, 1);\n\n // Fractional source index.\n vec3 sourceFracIndexRC = ${h};\n\n // Compute the four integer indices.\n ivec3 sourceFloorRC = ivec3(max(sourceFracIndexRC, vec3(0.0)));\n ivec3 sourceCeilRC = ivec3(\n min(inputShapeRC - 1.0, ceil(sourceFracIndexRC)));\n\n // Should we calculate next column and row elements in 2x2 packed cell.\n bool hasNextCol = d < ${l-1};\n bool hasNextRow = coords.z < ${n-1};\n\n // In parallel, construct four corners for all four components in\n // packed 2x2 cell.\n vec4 topLeft = vec4(\n getAValue(b, sourceFloorRC.x, sourceFloorRC.y, d),\n hasNextCol ? getAValue(b, sourceFloorRC.x, sourceFloorRC.y, d + 1)\n : 0.0,\n hasNextRow ? getAValue(b, sourceFloorRC.x, sourceFloorRC.z, d)\n : 0.0,\n (hasNextRow && hasNextCol) ?\n getAValue(b, sourceFloorRC.x, sourceFloorRC.z, d + 1) : 0.0);\n\n vec4 bottomLeft = vec4(\n getAValue(b, sourceCeilRC.x, sourceFloorRC.y, d),\n hasNextCol ? getAValue(b, sourceCeilRC.x, sourceFloorRC.y, d + 1)\n : 0.0,\n hasNextRow ? getAValue(b, sourceCeilRC.x, sourceFloorRC.z, d)\n : 0.0,\n (hasNextRow && hasNextCol) ?\n getAValue(b, sourceCeilRC.x, sourceFloorRC.z, d + 1) : 0.0);\n\n vec4 topRight = vec4(\n getAValue(b, sourceFloorRC.x, sourceCeilRC.y, d),\n hasNextCol ? getAValue(b, sourceFloorRC.x, sourceCeilRC.y, d + 1)\n : 0.0,\n hasNextRow ? getAValue(b, sourceFloorRC.x, sourceCeilRC.z, d)\n : 0.0,\n (hasNextRow && hasNextCol) ?\n getAValue(b, sourceFloorRC.x, sourceCeilRC.z, d + 1) : 0.0);\n\n vec4 bottomRight = vec4(\n getAValue(b, sourceCeilRC.x, sourceCeilRC.y, d),\n hasNextCol ? getAValue(b, sourceCeilRC.x, sourceCeilRC.y, d + 1)\n : 0.0,\n hasNextRow ? getAValue(b, sourceCeilRC.x, sourceCeilRC.z, d)\n : 0.0,\n (hasNextRow && hasNextCol) ?\n getAValue(b, sourceCeilRC.x, sourceCeilRC.z, d + 1) : 0.0);\n\n vec3 fracRC = sourceFracIndexRC - vec3(sourceFloorRC);\n\n vec4 top = mix(topLeft, topRight, fracRC.yyzz);\n vec4 bottom = mix(bottomLeft, bottomRight, fracRC.yyzz);\n vec4 newValue = mix(top, bottom, fracRC.x);\n\n setOutput(newValue);\n }\n `}}
  8880. /**
  8881. * @license
  8882. * Copyright 2020 Google LLC. All Rights Reserved.
  8883. * Licensed under the Apache License, Version 2.0 (the "License");
  8884. * you may not use this file except in compliance with the License.
  8885. * You may obtain a copy of the License at
  8886. *
  8887. * http://www.apache.org/licenses/LICENSE-2.0
  8888. *
  8889. * Unless required by applicable law or agreed to in writing, software
  8890. * distributed under the License is distributed on an "AS IS" BASIS,
  8891. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8892. * See the License for the specific language governing permissions and
  8893. * limitations under the License.
  8894. * =============================================================================
  8895. */const $l={kernelName:s._66,backendName:"webgl",kernelFunc:function(t){const{inputs:e,backend:n,attrs:r}=t,{images:i}=e,{alignCorners:o,halfPixelCenters:a,size:l}=r,[u,c]=l,h=Object(s._127)().getBool("WEBGL_PACK_IMAGE_OPERATIONS")?new jl(i.shape,u,c,o,a):new Bl(i.shape,u,c,o,a);return n.runWebGLProgram(h,[i],"float32")}};
  8896. /**
  8897. * @license
  8898. * Copyright 2018 Google LLC. All Rights Reserved.
  8899. * Licensed under the Apache License, Version 2.0 (the "License");
  8900. * you may not use this file except in compliance with the License.
  8901. * You may obtain a copy of the License at
  8902. *
  8903. * http://www.apache.org/licenses/LICENSE-2.0
  8904. *
  8905. * Unless required by applicable law or agreed to in writing, software
  8906. * distributed under the License is distributed on an "AS IS" BASIS,
  8907. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8908. * See the License for the specific language governing permissions and
  8909. * limitations under the License.
  8910. * =============================================================================
  8911. */class Ul{constructor(t,e,n){this.variableNames=["dy"],this.outputShape=[],this.outputShape=e;const[,r,i]=e,[,o,s]=t,a=[n&&o>1?r-1:r,n&&s>1?i-1:i],l=[n&&o>1?o-1:o,n&&s>1?s-1:s],u=a[0]/l[0],c=a[1]/l[1],h=1/u,d=1/c,p=2*Math.ceil(h)+2,f=2*Math.ceil(d)+2;this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n int r = coords[1];\n int c = coords[2];\n\n float accumulator = 0.0;\n\n const float heightScale = float(${u});\n const float widthScale = float(${c});\n\n const float invHeightScale = float(${h});\n const float invWidthScale = float(${d});\n\n const int winHeight = int(${p});\n const int winWidth = int(${f});\n\n // Compute bounds for where in dy we will look\n float startRLerp = floor(float(r) * invHeightScale);\n int startDyR = int(startRLerp - float(winHeight / 2));\n\n float startCLerp = floor(float(c) * invWidthScale);\n int startDyC = int(startCLerp - float(winWidth / 2));\n\n // Loop over dy\n for (int dyROffset = 0; dyROffset < winHeight; dyROffset++) {\n int dyR = dyROffset + startDyR;\n\n // Guard against the window exceeding the bounds of dy\n if (dyR < 0 || dyR >= ${o}) {\n continue;\n }\n\n for (int dyCOffset = 0; dyCOffset < winWidth; dyCOffset++) {\n int dyC = dyCOffset + startDyC;\n\n // Guard against the window exceeding the bounds of dy\n if (dyC < 0 || dyC >= ${s}) {\n continue;\n }\n\n float dxR = float(dyR) * heightScale;\n int topDxRIndex = int(floor(dxR));\n int bottomDxRIndex = int(min(ceil(dxR), ${r-1}.0));\n float dxRLerp = dxR - float(topDxRIndex);\n float inverseDxRLerp = 1.0 - dxRLerp;\n\n float dxC = float(dyC) * widthScale;\n int leftDxCIndex = int(floor(dxC));\n int rightDxCIndex = int(min(ceil(dxC), ${i-1}.0));\n float dxCLerp = dxC - float(leftDxCIndex);\n float inverseDxCLerp = 1.0 - dxCLerp;\n\n if (r == topDxRIndex && c == leftDxCIndex) {\n // topLeft\n accumulator +=\n getDy(b, dyR, dyC, d) * inverseDxRLerp * inverseDxCLerp;\n }\n\n if (r == topDxRIndex && c == rightDxCIndex) {\n // topRight\n accumulator += getDy(b, dyR, dyC, d) * inverseDxRLerp * dxCLerp;\n }\n\n if (r == bottomDxRIndex && c == leftDxCIndex) {\n // bottomLeft\n accumulator += getDy(b, dyR, dyC, d) * dxRLerp * inverseDxCLerp;\n }\n\n if (r == bottomDxRIndex && c == rightDxCIndex) {\n // bottomRight\n accumulator += getDy(b, dyR, dyC, d) * dxRLerp * dxCLerp;\n }\n }\n }\n // End loop over dy\n\n setOutput(accumulator);\n }\n `}}
  8912. /**
  8913. * @license
  8914. * Copyright 2020 Google LLC. All Rights Reserved.
  8915. * Licensed under the Apache License, Version 2.0 (the "License");
  8916. * you may not use this file except in compliance with the License.
  8917. * You may obtain a copy of the License at
  8918. *
  8919. * http://www.apache.org/licenses/LICENSE-2.0
  8920. *
  8921. * Unless required by applicable law or agreed to in writing, software
  8922. * distributed under the License is distributed on an "AS IS" BASIS,
  8923. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8924. * See the License for the specific language governing permissions and
  8925. * limitations under the License.
  8926. * =============================================================================
  8927. */const Vl={kernelName:s._67,backendName:"webgl",kernelFunc:function(t){const{inputs:e,backend:n,attrs:r}=t,{images:i,dy:o}=e,{alignCorners:s}=r,a=new Ul(o.shape,i.shape,s);return n.runWebGLProgram(a,[o],o.dtype)}};
  8928. /**
  8929. * @license
  8930. * Copyright 2018 Google LLC. All Rights Reserved.
  8931. * Licensed under the Apache License, Version 2.0 (the "License");
  8932. * you may not use this file except in compliance with the License.
  8933. * You may obtain a copy of the License at
  8934. *
  8935. * http://www.apache.org/licenses/LICENSE-2.0
  8936. *
  8937. * Unless required by applicable law or agreed to in writing, software
  8938. * distributed under the License is distributed on an "AS IS" BASIS,
  8939. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8940. * See the License for the specific language governing permissions and
  8941. * limitations under the License.
  8942. * =============================================================================
  8943. */class Hl{constructor(t,e,n,r,i){this.variableNames=["A"],this.outputShape=[];const[o,s,a,l]=t;this.outputShape=[o,e,n,l];const u=[r&&e>1?s-1:s,r&&n>1?a-1:a],c=[r&&e>1?e-1:e,r&&n>1?n-1:n],h=r?"0.5":"0.0";let d;d=i?"max((vec2(yRC) + vec2(0.5)) * effectiveInputOverOutputRatioRC, vec2(0.0))":"vec2(yRC) * effectiveInputOverOutputRatioRC",this.userCode=`\n const vec2 effectiveInputOverOutputRatioRC = vec2(\n ${u[0]/c[0]},\n ${u[1]/c[1]});\n const vec2 inputShapeRC = vec2(${s}.0, ${a}.0);\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n ivec2 yRC = coords.yz;\n\n // Fractional source index.\n vec2 sourceFracIndexRC = ${d};\n\n // Compute the coordinators of nearest neighbor point.\n ivec2 sourceNearestRC = ivec2(\n min(inputShapeRC - 1.0, floor(sourceFracIndexRC + ${h})));\n float newValue = getA(b, sourceNearestRC.x, sourceNearestRC.y, d);\n\n setOutput(newValue);\n }\n `}}
  8944. /**
  8945. * @license
  8946. * Copyright 2019 Google LLC. All Rights Reserved.
  8947. * Licensed under the Apache License, Version 2.0 (the "License");
  8948. * you may not use this file except in compliance with the License.
  8949. * You may obtain a copy of the License at
  8950. *
  8951. * http://www.apache.org/licenses/LICENSE-2.0
  8952. *
  8953. * Unless required by applicable law or agreed to in writing, software
  8954. * distributed under the License is distributed on an "AS IS" BASIS,
  8955. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8956. * See the License for the specific language governing permissions and
  8957. * limitations under the License.
  8958. * =============================================================================
  8959. */class Wl{constructor(t,e,n,r,i){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=[];const[o,s,a,l]=t;this.outputShape=[o,e,n,l];const u=[r&&e>1?s-1:s,r&&n>1?a-1:a],c=[r&&e>1?e-1:e,r&&n>1?n-1:n],h=r?"0.5":"0.0";let d;d=i?"max((vec3(yRC) + vec3(0.5)) * effectiveInputOverOutputRatioRC, vec3(0.0))":"vec3(yRC) * effectiveInputOverOutputRatioRC",this.userCode=`\n const vec3 effectiveInputOverOutputRatioRC = vec3(\n ${u[0]/c[0]},\n ${u[1]/c[1]},\n ${u[1]/c[1]});\n const vec3 inputShapeRC = vec3(${s}.0, ${a}.0,\n ${a}.0);\n\n float getAValue(int b, int r, int c, int d) {\n return getChannel(getA(b, r, c, d), vec2(c, d));\n }\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n // Calculate values for next column in yRC.z.\n ivec3 yRC = coords.yzz + ivec3(0, 0, 1);\n\n // Fractional source index.\n vec3 sourceFracIndexRC = ${d};\n\n // Compute the coordinators of nearest neighbor point.\n ivec3 sourceNearestRC = ivec3(\n min(inputShapeRC - 1.0, floor(sourceFracIndexRC + ${h})));\n\n // Should we calculate next column and row elements in 2x2 packed cell.\n bool hasNextCol = d < ${l-1};\n bool hasNextRow = coords.z < ${n-1};\n\n vec4 newValue = vec4(\n getAValue(b, sourceNearestRC.x, sourceNearestRC.y, d),\n hasNextCol ? getAValue(b, sourceNearestRC.x, sourceNearestRC.y, d + 1)\n : 0.0,\n hasNextRow ? getAValue(b, sourceNearestRC.x, sourceNearestRC.z, d)\n : 0.0,\n (hasNextRow && hasNextCol) ?\n getAValue(b, sourceNearestRC.x, sourceNearestRC.z, d + 1) : 0.0);\n\n setOutput(newValue);\n }\n `}}
  8960. /**
  8961. * @license
  8962. * Copyright 2020 Google LLC. All Rights Reserved.
  8963. * Licensed under the Apache License, Version 2.0 (the "License");
  8964. * you may not use this file except in compliance with the License.
  8965. * You may obtain a copy of the License at
  8966. *
  8967. * http://www.apache.org/licenses/LICENSE-2.0
  8968. *
  8969. * Unless required by applicable law or agreed to in writing, software
  8970. * distributed under the License is distributed on an "AS IS" BASIS,
  8971. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8972. * See the License for the specific language governing permissions and
  8973. * limitations under the License.
  8974. * =============================================================================
  8975. */const Gl={kernelName:s._68,backendName:"webgl",kernelFunc:function(t){const{inputs:e,backend:n,attrs:r}=t,{images:i}=e,{alignCorners:o,halfPixelCenters:a,size:l}=r,[u,c]=l,h=Object(s._127)().getBool("WEBGL_PACK_IMAGE_OPERATIONS")?new Wl(i.shape,u,c,o,a):new Hl(i.shape,u,c,o,a);return n.runWebGLProgram(h,[i],i.dtype)}};
  8976. /**
  8977. * @license
  8978. * Copyright 2018 Google LLC. All Rights Reserved.
  8979. * Licensed under the Apache License, Version 2.0 (the "License");
  8980. * you may not use this file except in compliance with the License.
  8981. * You may obtain a copy of the License at
  8982. *
  8983. * http://www.apache.org/licenses/LICENSE-2.0
  8984. *
  8985. * Unless required by applicable law or agreed to in writing, software
  8986. * distributed under the License is distributed on an "AS IS" BASIS,
  8987. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8988. * See the License for the specific language governing permissions and
  8989. * limitations under the License.
  8990. * =============================================================================
  8991. */class zl{constructor(t,e,n){this.variableNames=["dy"],this.outputShape=[],this.outputShape=e;const[,r,i]=e,[,o,s]=t,a=[n&&o>1?r-1:r,n&&s>1?i-1:i],l=[n&&o>1?o-1:o,n&&s>1?s-1:s],u=a[0]/l[0],c=a[1]/l[1],h=1/u,d=1/c,p=2*Math.ceil(h)+2,f=2*Math.ceil(d)+2;this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n int r = coords[1];\n int c = coords[2];\n\n float accumulator = 0.0;\n\n const float heightScale = float(${u});\n const float widthScale = float(${c});\n\n const float invHeightScale = float(${h});\n const float invWidthScale = float(${d});\n\n const int winHeight = int(${p});\n const int winWidth = int(${f});\n\n // Compute bounds for where in dy we will look\n float startRLerp = floor(float(r) * invHeightScale);\n int startDyR = int(floor(startRLerp - float(winHeight / 2)));\n\n float startCLerp = floor(float(c) * invWidthScale);\n int startDyC = int(floor(startCLerp - float(winWidth / 2)));\n\n // Loop over dy\n for (int dyROffset = 0; dyROffset < winHeight; dyROffset++) {\n int dyR = dyROffset + startDyR;\n\n // Guard against the window exceeding the bounds of dy\n if (dyR < 0 || dyR >= ${o}) {\n continue;\n }\n\n for (int dyCOffset = 0; dyCOffset < winWidth; dyCOffset++) {\n int dyC = dyCOffset + startDyC;\n\n // Guard against the window exceeding the bounds of dy\n if (dyC < 0 || dyC >= ${s}) {\n continue;\n }\n\n float sourceFracRow =\n float(${a[0]}) *\n (float(dyR) / float(${l[0]}));\n\n float sourceFracCol =\n float(${a[1]}) *\n (float(dyC) / float(${l[1]}));\n\n int sourceNearestRow = int(min(\n float(int(${r}) - 1),\n ${n} ? float(round(sourceFracRow)) :\n float(floor(sourceFracRow))));\n\n int sourceNearestCol = int(min(\n float(int(${i}) - 1),\n ${n} ? float(round(sourceFracCol)) :\n float(floor(sourceFracCol))));\n\n if (r == sourceNearestRow && c == sourceNearestCol) {\n accumulator += getDy(b, dyR, dyC, d);\n }\n }\n }\n // End loop over dy\n\n setOutput(accumulator);\n }\n `}}
  8992. /**
  8993. * @license
  8994. * Copyright 2020 Google LLC. All Rights Reserved.
  8995. * Licensed under the Apache License, Version 2.0 (the "License");
  8996. * you may not use this file except in compliance with the License.
  8997. * You may obtain a copy of the License at
  8998. *
  8999. * http://www.apache.org/licenses/LICENSE-2.0
  9000. *
  9001. * Unless required by applicable law or agreed to in writing, software
  9002. * distributed under the License is distributed on an "AS IS" BASIS,
  9003. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9004. * See the License for the specific language governing permissions and
  9005. * limitations under the License.
  9006. * =============================================================================
  9007. */const Xl={kernelName:s._69,backendName:"webgl",kernelFunc:function(t){const{inputs:e,backend:n,attrs:r}=t,{images:i,dy:o}=e,{alignCorners:s}=r,a=new zl(o.shape,i.shape,s);return n.runWebGLProgram(a,[o],o.dtype)}};
  9008. /**
  9009. * @license
  9010. * Copyright 2017 Google LLC. All Rights Reserved.
  9011. * Licensed under the Apache License, Version 2.0 (the "License");
  9012. * you may not use this file except in compliance with the License.
  9013. * You may obtain a copy of the License at
  9014. *
  9015. * http://www.apache.org/licenses/LICENSE-2.0
  9016. *
  9017. * Unless required by applicable law or agreed to in writing, software
  9018. * distributed under the License is distributed on an "AS IS" BASIS,
  9019. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9020. * See the License for the specific language governing permissions and
  9021. * limitations under the License.
  9022. * =============================================================================
  9023. */class Kl{constructor(t,e){this.variableNames=["x"];const n=t.length;if(n>4)throw new Error(`WebGL backend: Reverse of rank-${n} tensor is not yet supported`);if(this.outputShape=t,1===n)return void(this.userCode=`\n void main() {\n int coord = getOutputCoords();\n setOutput(getX(${t[0]} - coord - 1));\n }\n `);const r=t.map((n,r)=>(n=>-1!==e.indexOf(n)&&1!==t[n]?`${t[n]} - coords[${n}] - 1`:`coords[${n}]`)(r)).join(","),i=Dt(n);this.userCode=`\n void main() {\n ${i} coords = getOutputCoords();\n setOutput(getX(${r}));\n }\n `}}
  9024. /**
  9025. * @license
  9026. * Copyright 2019 Google LLC. All Rights Reserved.
  9027. * Licensed under the Apache License, Version 2.0 (the "License");
  9028. * you may not use this file except in compliance with the License.
  9029. * You may obtain a copy of the License at
  9030. *
  9031. * http://www.apache.org/licenses/LICENSE-2.0
  9032. *
  9033. * Unless required by applicable law or agreed to in writing, software
  9034. * distributed under the License is distributed on an "AS IS" BASIS,
  9035. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9036. * See the License for the specific language governing permissions and
  9037. * limitations under the License.
  9038. * =============================================================================
  9039. */class Yl{constructor(t,e){this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0;const n=t.length;if(n>4)throw new Error(`WebGL backend: Reverse of rank-${n} tensor is not yet supported`);this.outputShape=t;const r=hr("rc",n),i=`${r[n-1]} + 1 < ${this.outputShape[n-1]}`,o=`${r[n-2]} + 1 < ${this.outputShape[n-2]}`,s=Dt(n);function a(n){const r=t.map((r,i)=>(i=i,o=n,-1!==e.indexOf(i)&&1!==t[i]?`${t[i]} - ${o[i]} - 1`:`${o[i]}`));var i,o;return`getChannel(getX(${r.join(",")}), vec2(${r.slice(-2).join(",")}))`}this.userCode=1===n?`\n void main(){\n int rc = getOutputCoords();\n vec4 result = vec4(0.);\n result.r = getChannel(getX(${t[0]} - rc - 1),\n ${t[0]} - rc - 1);\n if(${i}){\n result.g = getChannel(getX(${t[0]} - (rc + 1) - 1),\n ${t[0]} - (rc + 1) - 1);\n }\n setOutput(result);\n }\n `:`\n void main() {\n ${s} rc = getOutputCoords();\n vec4 result = vec4(0.);\n result.r = ${function(t){return a(t)}(r.slice())};\n if(${i}){\n result.g = ${function(t){return t[n-1]="("+t[n-1]+" + 1)",a(t)}(r.slice())};\n }\n if(${o}) {\n result.b = ${function(t){return t[n-2]="("+t[n-2]+" + 1)",a(t)}(r.slice())};\n if(${i}) {\n result.a = ${function(t){return t[n-1]="("+t[n-1]+" + 1)",t[n-2]="("+t[n-2]+" + 1)",a(t)}(r.slice())};\n }\n }\n setOutput(result);\n }\n `}}
  9040. /**
  9041. * @license
  9042. * Copyright 2020 Google LLC. All Rights Reserved.
  9043. * Licensed under the Apache License, Version 2.0 (the "License");
  9044. * you may not use this file except in compliance with the License.
  9045. * You may obtain a copy of the License at
  9046. *
  9047. * http://www.apache.org/licenses/LICENSE-2.0
  9048. *
  9049. * Unless required by applicable law or agreed to in writing, software
  9050. * distributed under the License is distributed on an "AS IS" BASIS,
  9051. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9052. * See the License for the specific language governing permissions and
  9053. * limitations under the License.
  9054. * =============================================================================
  9055. */const ql={kernelName:s._70,backendName:"webgl",kernelFunc:function(t){const{inputs:e,backend:n,attrs:r}=t,{x:i}=e,{dims:o}=r,a=i.shape.length,l=s._152.parseAxisParam(o,i.shape);if(0===a)return Gr({inputs:{x:i},backend:n});const u=Object(s._127)().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new Yl(i.shape,l):new Kl(i.shape,l);return n.runWebGLProgram(u,[i],i.dtype)}};
  9056. /**
  9057. * @license
  9058. * Copyright 2020 Google LLC. All Rights Reserved.
  9059. * Licensed under the Apache License, Version 2.0 (the "License");
  9060. * you may not use this file except in compliance with the License.
  9061. * You may obtain a copy of the License at
  9062. *
  9063. * http://www.apache.org/licenses/LICENSE-2.0
  9064. *
  9065. * Unless required by applicable law or agreed to in writing, software
  9066. * distributed under the License is distributed on an "AS IS" BASIS,
  9067. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9068. * See the License for the specific language governing permissions and
  9069. * limitations under the License.
  9070. * =============================================================================
  9071. */
  9072. /**
  9073. * @license
  9074. * Copyright 2020 Google LLC. All Rights Reserved.
  9075. * Licensed under the Apache License, Version 2.0 (the "License");
  9076. * you may not use this file except in compliance with the License.
  9077. * You may obtain a copy of the License at
  9078. *
  9079. * http://www.apache.org/licenses/LICENSE-2.0
  9080. *
  9081. * Unless required by applicable law or agreed to in writing, software
  9082. * distributed under the License is distributed on an "AS IS" BASIS,
  9083. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9084. * See the License for the specific language governing permissions and
  9085. * limitations under the License.
  9086. * =============================================================================
  9087. */
  9088. const Jl={kernelName:s._71,backendName:"webgl",kernelFunc:({inputs:t,attrs:e,backend:n})=>{const{image:r}=t,{radians:i,fillValue:o,center:a}=e,l=n,u=new class{constructor(t,e){this.variableNames=["Image"],this.outputShape=[],this.customUniforms=[{name:"params",type:"vec4"}];const n=t[1],r=t[2];this.outputShape=t;let i="";i="number"==typeof e?`float outputValue = ${e.toFixed(2)};`:`\n vec3 fill = vec3(${e.join(",")});\n float outputValue = fill[coords[3]];`,this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int x = coords[2];\n int y = coords[1];\n float coordXFloat = (float(x) - params[0]) * params[3] -\n (float(y) - params[1]) * params[2];\n float coordYFloat = (float(x) - params[0]) * params[2] +\n (float(y) - params[1]) * params[3];\n int coordX = int(round(coordXFloat + params[0]));\n int coordY = int(round(coordYFloat + params[1]));\n ${i}\n if(coordX >= 0 && coordX < ${r} && coordY >= 0 && coordY < ${n}) {\n outputValue = getImage(coords[0], coordY, coordX, coords[3]);\n }\n setOutput(outputValue);\n }\n `}}(r.shape,o),[c,h]=s._115.getImageCenter(a,r.shape[1],r.shape[2]),d=[[c,h,Math.sin(i),Math.cos(i)]];return l.runWebGLProgram(u,[r],r.dtype,d)}},Zl=ei({opSnippet:"\n // OpenGL ES does not support round function.\n // The algorithm is based on banker's rounding.\n float base = floor(x);\n if ((x - base) < 0.5) {\n return floor(x);\n } else if ((x - base) > 0.5) {\n return ceil(x);\n } else {\n if (mod(base, 2.0) == 0.0) {\n return base;\n } else {\n return base + 1.0;\n }\n }\n"}),Ql={kernelName:s._72,backendName:"webgl",kernelFunc:Zl},tu=ei({opSnippet:"return inversesqrt(x);",cpuKernelImpl:Xn}),eu={kernelName:s._73,backendName:"webgl",kernelFunc:tu};
  9089. /**
  9090. * @license
  9091. * Copyright 2020 Google LLC. All Rights Reserved.
  9092. * Licensed under the Apache License, Version 2.0 (the "License");
  9093. * you may not use this file except in compliance with the License.
  9094. * You may obtain a copy of the License at
  9095. *
  9096. * http://www.apache.org/licenses/LICENSE-2.0
  9097. *
  9098. * Unless required by applicable law or agreed to in writing, software
  9099. * distributed under the License is distributed on an "AS IS" BASIS,
  9100. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9101. * See the License for the specific language governing permissions and
  9102. * limitations under the License.
  9103. * =============================================================================
  9104. */
  9105. /**
  9106. * @license
  9107. * Copyright 2018 Google LLC. All Rights Reserved.
  9108. * Licensed under the Apache License, Version 2.0 (the "License");
  9109. * you may not use this file except in compliance with the License.
  9110. * You may obtain a copy of the License at
  9111. *
  9112. * http://www.apache.org/licenses/LICENSE-2.0
  9113. *
  9114. * Unless required by applicable law or agreed to in writing, software
  9115. * distributed under the License is distributed on an "AS IS" BASIS,
  9116. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9117. * See the License for the specific language governing permissions and
  9118. * limitations under the License.
  9119. * =============================================================================
  9120. */
  9121. class nu{constructor(t,e,n,r,i,o,s=!0){this.variableNames=["updates","indices","defaultValue"],this.outputShape=o;const a=Dt(i.length),l=Dt(o.length);let u="";1===n?u="i":2===n&&(u="i, j");const c=`getIndices(${u})`;let h="";1===r?h="i":2===r&&(h="i, coords[1]");const d=`getUpdates(${h})`,p=e>1?"strides[j]":"strides";this.userCode=`\n ${a} strides = ${a}(${i});\n\n void main() {\n ${l} coords = getOutputCoords();\n float sum = 0.0;\n bool found = false;\n for (int i = 0; i < ${t}; i++) {\n int flattenedIndex = 0;\n for (int j = 0; j < ${e}; j++) {\n int index = round(${c});\n flattenedIndex += index * ${p};\n }\n if (flattenedIndex == coords[0]) {\n sum += ${d};\n found = true;\n }\n }\n setOutput(mix(getDefaultValue(), sum, float(found)));\n }\n `}}
  9122. /**
  9123. * @license
  9124. * Copyright 2020 Google LLC. All Rights Reserved.
  9125. * Licensed under the Apache License, Version 2.0 (the "License");
  9126. * you may not use this file except in compliance with the License.
  9127. * You may obtain a copy of the License at
  9128. *
  9129. * http://www.apache.org/licenses/LICENSE-2.0
  9130. *
  9131. * Unless required by applicable law or agreed to in writing, software
  9132. * distributed under the License is distributed on an "AS IS" BASIS,
  9133. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9134. * See the License for the specific language governing permissions and
  9135. * limitations under the License.
  9136. * =============================================================================
  9137. */const ru={kernelName:s._74,backendName:"webgl",kernelFunc:function(t){const{inputs:e,backend:n,attrs:r}=t,{indices:i,updates:o}=e,{shape:a}=r,{sliceRank:l,numUpdates:u,sliceSize:c,strides:h,outputSize:d}=s._115.calculateShapes(o,i,a),p=[d/c,c];if(0===d)return n.makeTensorInfo(a,i.dtype);const f=ci({inputs:{x:i},backend:n,attrs:{shape:[u,l]}}),g=ci({inputs:{x:o},backend:n,attrs:{shape:[u,c]}}),m=n.makeTensorInfo([],"float32",new Float32Array([0])),v=new nu(u,l,f.shape.length,g.shape.length,h,p),b=n.runWebGLProgram(v,[g,f,m],g.dtype),_=ci({inputs:{x:b},backend:n,attrs:{shape:a}});return n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(g),n.disposeIntermediateTensorInfo(b),n.disposeIntermediateTensorInfo(m),_}};
  9138. /**
  9139. * @license
  9140. * Copyright 2017 Google LLC. All Rights Reserved.
  9141. * Licensed under the Apache License, Version 2.0 (the "License");
  9142. * you may not use this file except in compliance with the License.
  9143. * You may obtain a copy of the License at
  9144. *
  9145. * http://www.apache.org/licenses/LICENSE-2.0
  9146. *
  9147. * Unless required by applicable law or agreed to in writing, software
  9148. * distributed under the License is distributed on an "AS IS" BASIS,
  9149. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9150. * See the License for the specific language governing permissions and
  9151. * limitations under the License.
  9152. * =============================================================================
  9153. */class iu{constructor(t,e,n){let r,i;if(this.variableNames=["c","a","b"],this.outputShape=e,n>4)throw Error(`Where for rank ${n} is not yet supported`);if(1===n)i="resRC",r="resRC";else{const n=["resRC.x","resRC.y","resRC.z","resRC.w"],o=[],s=[];for(let r=0;r<e.length;r++)s.push(`${n[r]}`),r<t&&o.push(`${n[r]}`);r=o.join(),i=s.join()}const o=Dt(n);this.userCode=`\n void main() {\n ${o} resRC = getOutputCoords();\n float cVal = getC(${r});\n if (cVal >= 1.0) {\n setOutput(getA(${i}));\n } else {\n setOutput(getB(${i}));\n }\n }\n `}}
  9154. /**
  9155. * @license
  9156. * Copyright 2020 Google LLC. All Rights Reserved.
  9157. * Licensed under the Apache License, Version 2.0 (the "License");
  9158. * you may not use this file except in compliance with the License.
  9159. * You may obtain a copy of the License at
  9160. *
  9161. * http://www.apache.org/licenses/LICENSE-2.0
  9162. *
  9163. * Unless required by applicable law or agreed to in writing, software
  9164. * distributed under the License is distributed on an "AS IS" BASIS,
  9165. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9166. * See the License for the specific language governing permissions and
  9167. * limitations under the License.
  9168. * =============================================================================
  9169. */const ou={kernelName:s._75,backendName:"webgl",kernelFunc:function(t){const{inputs:e,backend:n}=t,{condition:r,t:i,e:o}=e,a=new iu(r.shape.length,i.shape,i.shape.length);return n.runWebGLProgram(a,[r,i,o],Object(s._151)(i.dtype,o.dtype))}},su=ei({opSnippet:`\n // Stable and Attracting Fixed Point (0, 1) for Normalized Weights.\n // see: https://arxiv.org/abs/1706.02515\n float scaleAlpha = ${s._115.SELU_SCALEALPHA};\n float scale = ${s._115.SELU_SCALE};\n return (x >= 0.0) ? scale * x : scaleAlpha * (exp(x) - 1.0);\n`}),au={kernelName:s._76,backendName:"webgl",kernelFunc:su},lu=ei({opSnippet:"if (isnan(x)) return x;\n return 1.0 / (1.0 + exp(-1.0 * x));\n",packedOpSnippet:"\n vec4 result = 1.0 / (1.0 + exp(-1.0 * x));\n bvec4 isNaN = isnan(x);\n\n result.r = isNaN.r ? x.r : result.r;\n result.g = isNaN.g ? x.g : result.g;\n result.b = isNaN.b ? x.b : result.b;\n result.a = isNaN.a ? x.a : result.a;\n\n return result;\n",cpuKernelImpl:Kn}),uu={kernelName:s._77,backendName:"webgl",kernelFunc:lu},cu=ei({opSnippet:"\n if (isnan(x)) { return 0.0; }\n return sign(x);\n"}),hu={kernelName:s._78,backendName:"webgl",kernelFunc:cu},du=ei({opSnippet:"if (isnan(x)) return x;\n return sin(x);\n"}),pu={kernelName:s._79,backendName:"webgl",kernelFunc:du},fu=ei({opSnippet:"\n float e2x = exp(x);\n return (e2x - 1.0 / e2x) / 2.0;\n"}),gu={kernelName:s._80,backendName:"webgl",kernelFunc:fu},mu=ei({opSnippet:"\n float epsilon = 1.1920928955078125e-7;\n float threshold = log(epsilon) + 2.0;\n\n bool too_large = x > -threshold;\n bool too_small = x < threshold;\n\n float result;\n float exp_x = exp(x);\n\n if (too_large){\n result = x;\n }\n else if (too_small){\n result = exp_x;\n }\n else{\n result = log(exp_x + 1.0);\n }\n return result;\n"}),vu={kernelName:s._83,backendName:"webgl",kernelFunc:mu},bu={kernelName:s._84,backendName:"webgl",kernelFunc:t=>{const{inputs:e,backend:n,attrs:r}=t,{x:i}=e,{blockShape:o,paddings:a}=r;s._152.assert(i.shape.length<=4,()=>"spaceToBatchND for rank > 4 with a WebGL backend not implemented yet");const l=o.reduce((t,e)=>t*e),u=[[0,0]];u.push(...a);for(let t=1+o.length;t<i.shape.length;++t)u.push([0,0]);const c=[],h=Cl({inputs:{x:i},backend:n,attrs:{paddings:u,constantValue:0}}),d=s._115.getReshaped(h.shape,o,l,!1),p=s._115.getPermuted(d.length,o.length,!1),f=s._115.getReshapedPermuted(h.shape,o,l,!1),g=ci({inputs:{x:h},backend:n,attrs:{shape:d}}),m=yi({inputs:{x:g},backend:n,attrs:{perm:p}}),v=ci({inputs:{x:m},backend:n,attrs:{shape:f}});return c.push(h),c.push(g),c.push(m),c.forEach(t=>n.disposeIntermediateTensorInfo(t)),v}};
  9170. /**
  9171. * @license
  9172. * Copyright 2020 Google LLC. All Rights Reserved.
  9173. * Licensed under the Apache License, Version 2.0 (the "License");
  9174. * you may not use this file except in compliance with the License.
  9175. * You may obtain a copy of the License at
  9176. *
  9177. * http://www.apache.org/licenses/LICENSE-2.0
  9178. *
  9179. * Unless required by applicable law or agreed to in writing, software
  9180. * distributed under the License is distributed on an "AS IS" BASIS,
  9181. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9182. * See the License for the specific language governing permissions and
  9183. * limitations under the License.
  9184. * =============================================================================
  9185. */const _u={kernelName:s._85,backendName:"webgl",kernelFunc:
  9186. /**
  9187. * @license
  9188. * Copyright 2021 Google LLC. All Rights Reserved.
  9189. * Licensed under the Apache License, Version 2.0 (the "License");
  9190. * you may not use this file except in compliance with the License.
  9191. * You may obtain a copy of the License at
  9192. *
  9193. * http://www.apache.org/licenses/LICENSE-2.0
  9194. *
  9195. * Unless required by applicable law or agreed to in writing, software
  9196. * distributed under the License is distributed on an "AS IS" BASIS,
  9197. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9198. * See the License for the specific language governing permissions and
  9199. * limitations under the License.
  9200. * =============================================================================
  9201. */
  9202. function(t){const{inputs:e,backend:n}=t,{indices:r,values:i,denseShape:o,defaultValue:s}=e;if(1!==o.shape.length)throw new Error(`Dense shape must be a vector, saw:\n ${o.shape}`);if(2!==r.shape.length)throw new Error(`Indices must be a matrix, saw:\n ${r.shape}`);if(1!==i.shape.length)throw new Error(`Values must be a vector, saw:\n ${i.shape}`);if(0!==s.shape.length)throw new Error(`Default value must be a scalar, saw:\n ${s.shape}`);const a=n.readSync(r.dataId),l=n.readSync(i.dataId),u=n.readSync(o.dataId),c=n.readSync(s.dataId)[0],[h,d,p,f,g]=Jn(a,r.shape,r.dtype,l,i.dtype,u,c);return[n.makeTensorInfo(d,r.dtype,h),n.makeTensorInfo([d[0]],i.dtype,p),n.makeTensorInfo([f.length],"bool",new Uint8Array(f.map(t=>Number(t)))),n.makeTensorInfo([g.length],r.dtype,new Int32Array(g))]}};
  9203. /**
  9204. * @license
  9205. * Copyright 2021 Google LLC. All Rights Reserved.
  9206. * Licensed under the Apache License, Version 2.0 (the "License");
  9207. * you may not use this file except in compliance with the License.
  9208. * You may obtain a copy of the License at
  9209. *
  9210. * http://www.apache.org/licenses/LICENSE-2.0
  9211. *
  9212. * Unless required by applicable law or agreed to in writing, software
  9213. * distributed under the License is distributed on an "AS IS" BASIS,
  9214. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9215. * See the License for the specific language governing permissions and
  9216. * limitations under the License.
  9217. * =============================================================================
  9218. */const yu={kernelName:s._86,backendName:"webgl",kernelFunc:function(t){const{inputs:e,backend:n}=t,{inputIndices:r,inputShape:i,newShape:o}=e;if(2!==r.shape.length)throw new Error(`Input indices should be a matrix but received shape ${r.shape}`);if(1!==i.shape.length)throw new Error(`Input shape should be a vector but received shape ${i.shape}`);if(1!==o.shape.length)throw new Error(`Target shape should be a vector but received shape ${o.shape}`);const s=Array.from(n.readSync(i.dataId)),a=n.readSync(r.dataId),l=Array.from(n.readSync(o.dataId)),[u,c,h]=Zn(a,r.shape,r.dtype,s,l);return[n.makeTensorInfo(c,r.dtype,u),n.makeTensorInfo([h.length],o.dtype,new Int32Array(h))]}};
  9219. /**
  9220. * @license
  9221. * Copyright 2021 Google LLC. All Rights Reserved.
  9222. * Licensed under the Apache License, Version 2.0 (the "License");
  9223. * you may not use this file except in compliance with the License.
  9224. * You may obtain a copy of the License at
  9225. *
  9226. * http://www.apache.org/licenses/LICENSE-2.0
  9227. *
  9228. * Unless required by applicable law or agreed to in writing, software
  9229. * distributed under the License is distributed on an "AS IS" BASIS,
  9230. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9231. * See the License for the specific language governing permissions and
  9232. * limitations under the License.
  9233. * =============================================================================
  9234. */const Tu={kernelName:s._87,backendName:"webgl",kernelFunc:function(t){const{inputs:e,backend:n}=t,{data:r,indices:i,segmentIds:o}=e;if(r.shape.length<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(1!==i.shape.length)throw new Error(`Indices should be a vector but received shape\n ${i.shape}`);if(1!==o.shape.length)throw new Error(`Segment ids should be a vector but received shape\n ${o.shape}`);const s=n.readSync(r.dataId),a=n.readSync(i.dataId),l=n.readSync(o.dataId),[u,c]=Qn(s,r.shape,r.dtype,a,l,!0);return n.makeTensorInfo(c,r.dtype,u)}};
  9235. /**
  9236. * @license
  9237. * Copyright 2021 Google LLC. All Rights Reserved.
  9238. * Licensed under the Apache License, Version 2.0 (the "License");
  9239. * you may not use this file except in compliance with the License.
  9240. * You may obtain a copy of the License at
  9241. *
  9242. * http://www.apache.org/licenses/LICENSE-2.0
  9243. *
  9244. * Unless required by applicable law or agreed to in writing, software
  9245. * distributed under the License is distributed on an "AS IS" BASIS,
  9246. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9247. * See the License for the specific language governing permissions and
  9248. * limitations under the License.
  9249. * =============================================================================
  9250. */const xu={kernelName:s._88,backendName:"webgl",kernelFunc:function(t){const{inputs:e,backend:n}=t,{data:r,indices:i,segmentIds:o}=e;if(r.shape.length<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(1!==i.shape.length)throw new Error(`Indices should be a vector but received shape\n ${i.shape}`);if(1!==o.shape.length)throw new Error(`Segment ids should be a vector but received shape\n ${o.shape}`);const s=n.readSync(r.dataId),a=n.readSync(i.dataId),l=n.readSync(o.dataId),[u,c]=Qn(s,r.shape,r.dtype,a,l);return n.makeTensorInfo(c,r.dtype,u)}};
  9251. /**
  9252. * @license
  9253. * Copyright 2020 Google LLC. All Rights Reserved.
  9254. * Licensed under the Apache License, Version 2.0 (the "License");
  9255. * you may not use this file except in compliance with the License.
  9256. * You may obtain a copy of the License at
  9257. *
  9258. * http://www.apache.org/licenses/LICENSE-2.0
  9259. *
  9260. * Unless required by applicable law or agreed to in writing, software
  9261. * distributed under the License is distributed on an "AS IS" BASIS,
  9262. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9263. * See the License for the specific language governing permissions and
  9264. * limitations under the License.
  9265. * =============================================================================
  9266. */const Eu={kernelName:s._89,backendName:"webgl",kernelFunc:function(t){const{inputs:e,backend:n,attrs:r}=t,{sparseIndices:i,sparseValues:o,defaultValue:a}=e,{outputShape:l}=r,{sliceRank:u,numUpdates:c,strides:h,outputSize:d}=s._115.calculateShapes(o,i,l),p=new nu(c,u,i.shape.length,o.shape.length,h,[d,1],!1),f=n.runWebGLProgram(p,[o,i,a],o.dtype),g=ci({inputs:{x:f},backend:n,attrs:{shape:l}});return n.disposeIntermediateTensorInfo(f),g}};
  9267. /**
  9268. * @license
  9269. * Copyright 2020 Google LLC. All Rights Reserved.
  9270. * Licensed under the Apache License, Version 2.0 (the "License");
  9271. * you may not use this file except in compliance with the License.
  9272. * You may obtain a copy of the License at
  9273. *
  9274. * http://www.apache.org/licenses/LICENSE-2.0
  9275. *
  9276. * Unless required by applicable law or agreed to in writing, software
  9277. * distributed under the License is distributed on an "AS IS" BASIS,
  9278. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9279. * See the License for the specific language governing permissions and
  9280. * limitations under the License.
  9281. * =============================================================================
  9282. */const wu={kernelName:s._90,backendName:"webgl",kernelFunc:function(t){const{inputs:e,backend:n,attrs:r}=t,{x:i}=e,{numOrSizeSplits:o,axis:a}=r,l=s._152.parseAxisParam(a,i.shape)[0],u=s._115.prepareSplitSize(i,o,l),c=i.shape.length,h=new Array(c).fill(0),d=i.shape.slice();return u.map(t=>{const e=[...d];e[l]=t;const r=fo({inputs:{x:i},backend:n,attrs:{begin:h,size:e}});return h[l]+=t,r})}},Cu="return sqrt(x);",Su=ei({opSnippet:Cu,packedOpSnippet:Cu,cpuKernelImpl:tr}),ku={kernelName:s._91,backendName:"webgl",kernelFunc:Su},Ou=ei({opSnippet:"return x * x;"}),Iu={kernelName:s._92,backendName:"webgl",kernelFunc:Ou},Ru=ni({opSnippet:"return (a - b) * (a - b);",packedOpSnippet:"return (a - b) * (a - b);"}),Au={kernelName:s._93,backendName:"webgl",kernelFunc:Ru};
  9283. /**
  9284. * @license
  9285. * Copyright 2020 Google LLC. All Rights Reserved.
  9286. * Licensed under the Apache License, Version 2.0 (the "License");
  9287. * you may not use this file except in compliance with the License.
  9288. * You may obtain a copy of the License at
  9289. *
  9290. * http://www.apache.org/licenses/LICENSE-2.0
  9291. *
  9292. * Unless required by applicable law or agreed to in writing, software
  9293. * distributed under the License is distributed on an "AS IS" BASIS,
  9294. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9295. * See the License for the specific language governing permissions and
  9296. * limitations under the License.
  9297. * =============================================================================
  9298. */const Nu={kernelName:s._94,backendName:"webgl",kernelFunc:
  9299. /**
  9300. * @license
  9301. * Copyright 2020 Google LLC. All Rights Reserved.
  9302. * Licensed under the Apache License, Version 2.0 (the "License");
  9303. * you may not use this file except in compliance with the License.
  9304. * You may obtain a copy of the License at
  9305. *
  9306. * http://www.apache.org/licenses/LICENSE-2.0
  9307. *
  9308. * Unless required by applicable law or agreed to in writing, software
  9309. * distributed under the License is distributed on an "AS IS" BASIS,
  9310. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9311. * See the License for the specific language governing permissions and
  9312. * limitations under the License.
  9313. * =============================================================================
  9314. */
  9315. function({inputs:t,attrs:e,backend:n}){const{x:r}=t,i=_r+`\n return x > 0.0 ? 1.0 : float(${e.alpha});\n `,o=new br(r.shape,i);return n.runWebGLProgram(o,[r],r.dtype)}};
  9316. /**
  9317. * @license
  9318. * Copyright 2017 Google LLC. All Rights Reserved.
  9319. * Licensed under the Apache License, Version 2.0 (the "License");
  9320. * you may not use this file except in compliance with the License.
  9321. * You may obtain a copy of the License at
  9322. *
  9323. * http://www.apache.org/licenses/LICENSE-2.0
  9324. *
  9325. * Unless required by applicable law or agreed to in writing, software
  9326. * distributed under the License is distributed on an "AS IS" BASIS,
  9327. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9328. * See the License for the specific language governing permissions and
  9329. * limitations under the License.
  9330. * =============================================================================
  9331. */class Du{constructor(t,e,n){this.variableNames=["x"],this.outputShape=n;const r=n.length,i=Dt(n.length),o=Dt(n.length);let s="";if(1===r)s="coords * strides + begin";else{let t=0;s=n.map((e,r)=>(t++,1===n.length?`coords * strides[${r}] + begin[${r}]`:`coords[${t-1}] * strides[${r}] + begin[${r}]`)).join(",")}this.userCode=`\n ${i} begin = ${i}(${t});\n ${i} strides = ${i}(${e});\n\n void main() {\n ${o} coords = getOutputCoords();\n setOutput(getX(${s}));\n }\n `}}
  9332. /**
  9333. * @license
  9334. * Copyright 2020 Google LLC. All Rights Reserved.
  9335. * Licensed under the Apache License, Version 2.0 (the "License");
  9336. * you may not use this file except in compliance with the License.
  9337. * You may obtain a copy of the License at
  9338. *
  9339. * http://www.apache.org/licenses/LICENSE-2.0
  9340. *
  9341. * Unless required by applicable law or agreed to in writing, software
  9342. * distributed under the License is distributed on an "AS IS" BASIS,
  9343. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9344. * See the License for the specific language governing permissions and
  9345. * limitations under the License.
  9346. * =============================================================================
  9347. */const Mu={kernelName:s._95,backendName:"webgl",kernelFunc:function(t){const{inputs:e,backend:n,attrs:r}=t,{x:i}=e,{begin:o,end:a,strides:l,beginMask:u,endMask:c,ellipsisMask:h,newAxisMask:d,shrinkAxisMask:p}=r,{finalShapeSparse:f,finalShape:g,isIdentity:m,sliceDim0:v,isSimpleSlice:b,begin:_,end:y,strides:T}=s._141.sliceInfo(i.shape,o,a,l,u,c,h,d,p);let x;if(m)x=ci({inputs:{x:i},backend:n,attrs:{shape:g}});else if(v||b){s._152.assert(i.shape.length>=1,()=>`Input must have rank at least 1, got: ${i.shape.length}`);const t=s._141.computeOutShape(_,y,T),e=fo({inputs:{x:i},backend:n,attrs:{begin:_,size:t}});x=ci({inputs:{x:e},backend:n,attrs:{shape:g}}),n.disposeIntermediateTensorInfo(e)}else if(n.shouldExecuteOnCPU([i])){const t=n.readSync(i.dataId),e=Object(s._118)(i.shape,i.dtype,t),r=er(f,e,T,_);x=n.makeTensorInfo(g,i.dtype,r.values)}else{const t=new Du(_,T,f);x=n.runWebGLProgram(t,[i],i.dtype)}const E=ci({inputs:{x:x},backend:n,attrs:{shape:g}});return n.disposeIntermediateTensorInfo(x),E}};
  9348. /**
  9349. * @license
  9350. * Copyright 2021 Google LLC. All Rights Reserved.
  9351. * Licensed under the Apache License, Version 2.0 (the "License");
  9352. * you may not use this file except in compliance with the License.
  9353. * You may obtain a copy of the License at
  9354. *
  9355. * http://www.apache.org/licenses/LICENSE-2.0
  9356. *
  9357. * Unless required by applicable law or agreed to in writing, software
  9358. * distributed under the License is distributed on an "AS IS" BASIS,
  9359. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9360. * See the License for the specific language governing permissions and
  9361. * limitations under the License.
  9362. * =============================================================================
  9363. */const Lu={kernelName:s._96,backendName:"webgl",kernelFunc:function(t){const{inputs:e,backend:n,attrs:r}=t,{separator:i,nGramWidths:o,leftPad:s,rightPad:a,padWidth:l,preserveShortSequences:u}=r,{data:c,dataSplits:h}=e,d=n.readSync(c.dataId),p=n.readSync(h.dataId),[f,g]=nr(d,p,i,o,s,a,l,u);return[n.makeTensorInfo([f.length],"string",f),n.makeTensorInfo(h.shape,"int32",g)]}};
  9364. /**
  9365. * @license
  9366. * Copyright 2021 Google LLC. All Rights Reserved.
  9367. * Licensed under the Apache License, Version 2.0 (the "License");
  9368. * you may not use this file except in compliance with the License.
  9369. * You may obtain a copy of the License at
  9370. *
  9371. * http://www.apache.org/licenses/LICENSE-2.0
  9372. *
  9373. * Unless required by applicable law or agreed to in writing, software
  9374. * distributed under the License is distributed on an "AS IS" BASIS,
  9375. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9376. * See the License for the specific language governing permissions and
  9377. * limitations under the License.
  9378. * =============================================================================
  9379. */const Pu={kernelName:s._97,backendName:"webgl",kernelFunc:function(t){const{inputs:e,backend:n,attrs:r}=t,{skipEmpty:i}=r,{input:o,delimiter:s}=e;if("string"!==o.dtype)throw new Error("Input must be of datatype string");if(1!==o.shape.length)throw new Error(`Input must be a vector, got shape: ${o.shape}`);if(0!==s.shape.length)throw new Error(`Delimiter must be a scalar, got shape: ${s.shape}`);const a=n.readSync(o.dataId),l=n.readSync(s.dataId)[0],[u,c,h]=rr(a,l,i),d=c.length;return[n.makeTensorInfo([d,2],"int32",u),n.makeTensorInfo([d],"string",c),n.makeTensorInfo([2],"int32",new Int32Array(h))]}};
  9380. /**
  9381. * @license
  9382. * Copyright 2021 Google LLC. All Rights Reserved.
  9383. * Licensed under the Apache License, Version 2.0 (the "License");
  9384. * you may not use this file except in compliance with the License.
  9385. * You may obtain a copy of the License at
  9386. *
  9387. * http://www.apache.org/licenses/LICENSE-2.0
  9388. *
  9389. * Unless required by applicable law or agreed to in writing, software
  9390. * distributed under the License is distributed on an "AS IS" BASIS,
  9391. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9392. * See the License for the specific language governing permissions and
  9393. * limitations under the License.
  9394. * =============================================================================
  9395. */const Fu={kernelName:s._98,backendName:"webgl",kernelFunc:function(t){const{inputs:e,backend:n,attrs:r}=t,{numBuckets:i}=r,{input:o}=e;if("string"!==o.dtype)throw new Error("Input must be of datatype string");if(i<=0)throw new Error("Number of buckets must be at least 1");const s=n.readSync(o.dataId),a=ir(s,i);return n.makeTensorInfo(o.shape,"int32",a)}},Bu=ei({opSnippet:"return tan(x);"}),ju={kernelName:s._101,backendName:"webgl",kernelFunc:Bu},$u=ei({opSnippet:"\n float e2x = exp(-2.0 * abs(x));\n return sign(x) * (1.0 - e2x) / (1.0 + e2x);\n"}),Uu={kernelName:s._102,backendName:"webgl",kernelFunc:$u};
  9396. /**
  9397. * @license
  9398. * Copyright 2020 Google LLC. All Rights Reserved.
  9399. * Licensed under the Apache License, Version 2.0 (the "License");
  9400. * you may not use this file except in compliance with the License.
  9401. * You may obtain a copy of the License at
  9402. *
  9403. * http://www.apache.org/licenses/LICENSE-2.0
  9404. *
  9405. * Unless required by applicable law or agreed to in writing, software
  9406. * distributed under the License is distributed on an "AS IS" BASIS,
  9407. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9408. * See the License for the specific language governing permissions and
  9409. * limitations under the License.
  9410. * =============================================================================
  9411. */
  9412. /**
  9413. * @license
  9414. * Copyright 2017 Google LLC. All Rights Reserved.
  9415. * Licensed under the Apache License, Version 2.0 (the "License");
  9416. * you may not use this file except in compliance with the License.
  9417. * You may obtain a copy of the License at
  9418. *
  9419. * http://www.apache.org/licenses/LICENSE-2.0
  9420. *
  9421. * Unless required by applicable law or agreed to in writing, software
  9422. * distributed under the License is distributed on an "AS IS" BASIS,
  9423. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9424. * See the License for the specific language governing permissions and
  9425. * limitations under the License.
  9426. * =============================================================================
  9427. */
  9428. class Vu{constructor(t,e){this.variableNames=["A"];const n=new Array(t.length);for(let r=0;r<n.length;r++)n[r]=t[r]*e[r];this.outputShape=n,this.rank=n.length;const r=Dt(this.rank),i=function(t){const e=t.length;if(e>5)throw Error(`Tile for rank ${e} is not yet supported`);if(1===e)return`imod(resRC, ${t[0]})`;const n=["resRC.x","resRC.y","resRC.z","resRC.w","resRC.u"],r=[];for(let e=0;e<t.length;e++)r.push(`imod(${n[e]}, ${t[e]})`);return r.join()}
  9429. /**
  9430. * @license
  9431. * Copyright 2020 Google LLC. All Rights Reserved.
  9432. * Licensed under the Apache License, Version 2.0 (the "License");
  9433. * you may not use this file except in compliance with the License.
  9434. * You may obtain a copy of the License at
  9435. *
  9436. * http://www.apache.org/licenses/LICENSE-2.0
  9437. *
  9438. * Unless required by applicable law or agreed to in writing, software
  9439. * distributed under the License is distributed on an "AS IS" BASIS,
  9440. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9441. * See the License for the specific language governing permissions and
  9442. * limitations under the License.
  9443. * =============================================================================
  9444. */(t);this.userCode=`\n void main() {\n ${r} resRC = getOutputCoords();\n setOutput(getA(${i}));\n }\n `}}function Hu(t){const{inputs:e,backend:n,attrs:r}=t,{x:i}=e,{reps:o}=r;if("string"===i.dtype||i.shape.length>5){const t=n.readSync(i.dataId),e="string"===i.dtype?t.map(t=>s._152.decodeString(t)):t,r=Object(s._118)(i.shape,i.dtype,e),a=sr(r,o);return n.makeTensorInfo(a.shape,a.dtype,a.values)}const a=new Vu(i.shape,o);return n.runWebGLProgram(a,[i],i.dtype)}const Wu={kernelName:s._105,backendName:"webgl",kernelFunc:Hu};class Gu{constructor(t){this.variableNames=["x","indices"],this.customUniforms=[{name:"n",type:"int"},{name:"firstPass",type:"int"},{name:"negativeInf",type:"float"},{name:"dir",type:"int"},{name:"inc",type:"int"}],this.outputShape=t,this.userCode="\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int elemIdx = coords[1];\n\n // We compare elements pair-wise within a group of size 2 * inc.\n // The comparing rule for each group alternates between ascending\n // and descending. Within each group, we compare each pair at\n // positions i and i+inc. To decide whether an element at position i\n // is x0 or x1, we mod it by 2 * inc, if the result is smaller than\n // inc, it is in the first half of the group, we denote it as x0,\n // otherwise we denote it as x1.\n // For example, as shown in the Bitonic top K paper referenced above,\n // Figure5(a) shows that element[1] is in the\n // second half of the group when group size is 2, but it is in the\n // first half of the group when group size is 4.\n\n bool isFirstInPair = imod(elemIdx, 2 * inc) < inc;\n int i = isFirstInPair ? elemIdx : elemIdx - inc;\n\n int i0 = firstPass == 1 ? i : int(getIndices(batch, i));\n int i1 = firstPass == 1 ? i + inc : int(getIndices(batch, i + inc));\n float x0 = i0 < n ? getX(batch, i0) : negativeInf;\n float x1 = i1 < n ? getX(batch, i1) : negativeInf;\n\n // Denotes which direction indices are in (ascending or descending).\n bool reverse = imod(elemIdx, 2 * dir) >= dir;\n bool isGreater = x0 > x1 || (x0 == x1 && i1 > i0);\n if (reverse == isGreater) { // Elements in opposite order of direction\n int iTemp = i0;\n i0 = i1;\n i1 = iTemp;\n }\n if (isFirstInPair) {\n setOutput(float(i0));\n } else {\n setOutput(float(i1));\n }\n }\n "}}class zu{constructor(t){this.variableNames=["x","indices"],this.customUniforms=[{name:"n",type:"int"},{name:"firstPass",type:"int"},{name:"k",type:"int"}],this.outputShape=t,this.userCode="\n void main() {\n // Takes max of indices (0, k), (1, k + 1), (2, k + 2) ...\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int elemIdx = coords[1];\n\n // The output size is half of the previous size.\n // If the previous sequence is | | | | _ _ _ _ | | | | _ _ _ _ (k=4),\n // we only need to output the indices at positions |, the indices at\n // positions _ can be thrown away, see Figure5(b) After Phase 2\n // (Merge phase) in the Bitonic Top K paper referenced above.\n // For example, the paper shows we only need to output the orange bars.\n // The output sequence should look like this | | | | | | | |.\n // Because the sequence is halved, to map the output index back\n // to the previous sequence to find the corresponding value,\n // we need to double the index. When we double the index,\n // we basically interpolate a position, so 2i looks like\n // | _ | _ | _ | _ | _ | _ | _. We move the | to the first k position\n // of each 2k positions by - elemIdx % k. E.g. for output at\n // index 4,5,6,7, we want to get the corresponding element at\n // original index 8,9,10,11, for output at index 8,9,10,11,\n // we want to get the corresponding element at original index\n // 16,17,18,19, so on and so forth.\n\n int i = elemIdx < k ? elemIdx : (elemIdx * 2 - imod(elemIdx, k));\n int i0 = firstPass == 1 ? i : int(getIndices(batch, i));\n int i1 = firstPass == 1 ? i + k : int(getIndices(batch, i + k));\n\n float x0 = getX(batch, i0);\n float x1 = i1 < n ? getX(batch, i1) : x0;\n\n setOutput(x0 >= x1 ? float(i0) : float(i1));\n }\n "}}
  9445. /**
  9446. * @license
  9447. * Copyright 2020 Google LLC. All Rights Reserved.
  9448. * Licensed under the Apache License, Version 2.0 (the "License");
  9449. * you may not use this file except in compliance with the License.
  9450. * You may obtain a copy of the License at
  9451. *
  9452. * http://www.apache.org/licenses/LICENSE-2.0
  9453. *
  9454. * Unless required by applicable law or agreed to in writing, software
  9455. * distributed under the License is distributed on an "AS IS" BASIS,
  9456. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9457. * See the License for the specific language governing permissions and
  9458. * limitations under the License.
  9459. * =============================================================================
  9460. */function Xu(t,e){null!==e&&t.disposeIntermediateTensorInfo(e)}function Ku(t){let e=1;for(;e<t;)e*=2;return e}const Yu={kernelName:s._106,backendName:"webgl",kernelFunc:function(t){const{inputs:e,backend:n,attrs:r}=t,{x:i}=e,{k:o,sorted:a}=r,l=Object(s._127)().getNumber("TOPK_LAST_DIM_CPU_HANDOFF_SIZE_THRESHOLD"),u=Object(s._127)().getNumber("TOPK_K_CPU_HANDOFF_THRESHOLD"),c=i.shape,h=c[c.length-1];if(n.shouldExecuteOnCPU([i])||h<l||o>u){const t=n.readSync(i.dataId),[e,r]=ar(t,c,i.dtype,o,a);return[n.makeTensorInfo(e.shape,e.dtype,e.values),n.makeTensorInfo(r.shape,r.dtype,r.values)]}if(0===o)return c[c.length-1]=0,[n.makeTensorInfo(c,i.dtype,[]),n.makeTensorInfo(c,"int32",[])];if(1===h)return[i,Gs({attrs:{shape:c,dtype:"int32",value:0},backend:n})];const d=n.texData.get(i.dataId),p=null!==d&&d.isPacked,f=p?n.unpackTensor(i):i,g=s._152.sizeFromShape(c)/h,m=ci({inputs:{x:f},attrs:{shape:[g,h]},backend:n});p&&Xu(n,f);const v=Ku(o),b=Ku(h);let _=null;const y=()=>null===_?[m,m]:[m,_],T=(t,e,r)=>{const i=y(),o=new Gu(r),s=[[h],[null===_?1:0],[Number.NEGATIVE_INFINITY],[t],[e]],a=_;_=n.runWebGLProgram(o,i,"int32",s),Xu(n,a)};for(let t=1;t<v;t*=2){const e=2*t;for(let n=t;n>=1;n/=2)T(e,n,[g,b])}for(let t=b;t>v;t/=2){const e=y(),r=new zu([g,t/2]),i=[[h],[null===_?1:0],[v]],o=_;_=n.runWebGLProgram(r,e,"int32",i),Xu(n,o);const s=v/2,a=2*s;for(let t=s;t>=1;t/=2)T(a,t,_.shape)}let x=_;_=fo({inputs:{x:_},backend:n,attrs:{begin:0,size:[g,o]}}),Xu(n,x);let E=la({inputs:{x:m,indices:_},backend:n,attrs:{axis:1,batchDims:1}});Xu(n,m);const w=c.slice(0,-1);w.push(o),x=_,_=ci({inputs:{x:_},attrs:{shape:w},backend:n}),Xu(n,x);const C=E;return E=ci({inputs:{x:E},attrs:{shape:w},backend:n}),Xu(n,C),[E,_]}};
  9461. /**
  9462. * @license
  9463. * Copyright 2021 Google LLC. All Rights Reserved.
  9464. * Licensed under the Apache License, Version 2.0 (the "License");
  9465. * you may not use this file except in compliance with the License.
  9466. * You may obtain a copy of the License at
  9467. *
  9468. * http://www.apache.org/licenses/LICENSE-2.0
  9469. *
  9470. * Unless required by applicable law or agreed to in writing, software
  9471. * distributed under the License is distributed on an "AS IS" BASIS,
  9472. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9473. * See the License for the specific language governing permissions and
  9474. * limitations under the License.
  9475. * =============================================================================
  9476. */class qu{constructor(t,e,n,r,i,o){this.variableNames=["Image","Transforms"],this.outputShape=o;const s="nearest"===n?1:2;let a;switch(r){case"constant":a=1;break;case"reflect":a=2;break;case"wrap":a=3;break;case"nearest":a=4;break;default:a=1}this.userCode=`\n float mapCoord(float outCoord, float len) {\n float inCoord = outCoord;\n if(${a} == 2) {\n if (inCoord < 0.0) {\n if (len <= 1.0) {\n inCoord = 0.0;\n } else {\n float sz2 = 2.0 * len;\n if (inCoord < sz2) {\n inCoord = sz2 * float(int(float(-inCoord / sz2))) +\n inCoord;\n }\n inCoord = inCoord < -len ? inCoord + sz2 : -inCoord - 1.0;\n }\n } else if (inCoord > len - 1.0) {\n if (len <= 1.0) {\n inCoord = 0.0;\n } else {\n float sz2 = 2.0 * len;\n inCoord -= sz2 * float(int(float(inCoord / sz2)));\n if (inCoord >= len) {\n inCoord = sz2 - inCoord - 1.0;\n }\n }\n }\n return clamp(inCoord, 0.0, len - 1.0);\n } else if (${a} == 3) {\n if (inCoord < 0.0) {\n if (len <= 1.0) {\n inCoord = 0.0;\n } else {\n float sz = len - 1.0;\n inCoord += len * (float(int(float(-inCoord / sz))) + 1.0);\n }\n } else if (inCoord > len - 1.0) {\n if (len <= 1.0) {\n inCoord = 0.0;\n } else {\n float sz = len - 1.0;\n inCoord -= len * float(int(float(inCoord / sz)));\n }\n }\n return clamp(inCoord, 0.0, len - 1.0);\n } else if (${a} == 4) {\n return clamp(outCoord, 0.0, len - 1.0);\n } else {\n return outCoord;\n }\n }\n\n float readWithFillValue(int batch, int coordY, int coordX,\n int channel) {\n float outputValue;\n if (0 <= coordY && coordY < ${t} && 0 <= coordX && coordX < ${e}) {\n outputValue = getImage(batch, coordY, coordX, channel);\n } else {\n outputValue = float(${i});\n }\n return outputValue;\n }\n\n void main() {\n ivec4 coords = getOutputCoords();\n float outputValue;\n int batch = coords[0];\n int x = coords[2];\n int y = coords[1];\n int channel = coords[3];\n float xf = float(x);\n float yf = float(y);\n float a1 = getTransforms(batch, 0);\n float a2 = getTransforms(batch, 1);\n float a3 = getTransforms(batch, 2);\n float b1 = getTransforms(batch, 3);\n float b2 = getTransforms(batch, 4);\n float b3 = getTransforms(batch, 5);\n float c1 = getTransforms(batch, 6);\n float c2 = getTransforms(batch, 7);\n float projection = c1 * xf + c2 * yf + 1.0;\n if (projection == 0.0) {\n outputValue = float(${i});\n } else {\n float inX = (a1 * xf + a2 * yf + a3) / projection;\n float inY = (b1 * xf + b2 * yf + b3) / projection;\n float mapX = mapCoord(inX, float(${e}));\n float mapY = mapCoord(inY, float(${t}));\n\n if (${s} == 1) {\n int coordY = int(round(mapY));\n int coordX = int(round(mapX));\n outputValue = readWithFillValue(batch, coordY, coordX,\n channel);\n } else {\n float yFloor = floor(mapY);\n float xFloor = floor(mapX);\n float yCeil = yFloor + 1.0;\n float xCeil = xFloor + 1.0;\n float valueYFloor = (xCeil - mapX) *\n readWithFillValue(batch, int(yFloor), int(xFloor), channel) +\n (mapX - xFloor) *\n readWithFillValue(batch, int(yFloor), int(xCeil), channel);\n float valueYCeil = (xCeil - mapX) *\n readWithFillValue(batch, int(yCeil), int(xFloor), channel) +\n (mapX - xFloor) *\n readWithFillValue(batch, int(yCeil), int(xCeil), channel);\n outputValue = (yCeil - mapY) * valueYFloor +\n (mapY - yFloor) * valueYCeil;\n }\n }\n setOutput(outputValue);\n }\n `}}
  9477. /**
  9478. * @license
  9479. * Copyright 2021 Google LLC. All Rights Reserved.
  9480. * Licensed under the Apache License, Version 2.0 (the "License");
  9481. * you may not use this file except in compliance with the License.
  9482. * You may obtain a copy of the License at
  9483. *
  9484. * http://www.apache.org/licenses/LICENSE-2.0
  9485. *
  9486. * Unless required by applicable law or agreed to in writing, software
  9487. * distributed under the License is distributed on an "AS IS" BASIS,
  9488. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9489. * See the License for the specific language governing permissions and
  9490. * limitations under the License.
  9491. * =============================================================================
  9492. */const Ju={kernelName:s._107,backendName:"webgl",kernelFunc:function(t){const{inputs:e,backend:n,attrs:r}=t,{image:i,transforms:o}=e,{interpolation:s,fillMode:a,fillValue:l,outputShape:u}=r,[c,h,d,p]=i.shape,[f,g]=null!=u?u:[h,d],m=new qu(h,d,s,a,l,[c,f,g,p]);return n.runWebGLProgram(m,[i,o],"float32")}};
  9493. /**
  9494. * @license
  9495. * Copyright 2020 Google LLC. All Rights Reserved.
  9496. * Licensed under the Apache License, Version 2.0 (the License);
  9497. * you may not use this file except in compliance with the License.
  9498. * You may obtain a copy of the License at
  9499. *
  9500. * http://www.apache.org/licenses/LICENSE-2.0
  9501. *
  9502. * Unless required by applicable law or agreed to in writing, software
  9503. * distributed under the License is distributed on an AS IS BASIS,
  9504. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9505. * See the License for the specific language governing permissions and
  9506. * limitations under the License.
  9507. * =============================================================================
  9508. */const Zu={kernelName:s._109,backendName:"webgl",kernelFunc:function(t){const{inputs:e,attrs:n,backend:r}=t,{axis:i}=n,{x:o}=e;ft(o,"unique"),console.warn("WARNING: ","UI might be locked temporarily as data is being downloaded");const s=r.readSync(o.dataId),{outputValues:a,outputShape:l,indices:u}=ur(s,i,o.shape,o.dtype);return[r.makeTensorInfo(l,o.dtype,a),r.makeTensorInfo([u.length],"int32",u)]}};
  9509. /**
  9510. * @license
  9511. * Copyright 2020 Google LLC. All Rights Reserved.
  9512. * Licensed under the Apache License, Version 2.0 (the "License");
  9513. * you may not use this file except in compliance with the License.
  9514. * You may obtain a copy of the License at
  9515. *
  9516. * http://www.apache.org/licenses/LICENSE-2.0
  9517. *
  9518. * Unless required by applicable law or agreed to in writing, software
  9519. * distributed under the License is distributed on an "AS IS" BASIS,
  9520. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9521. * See the License for the specific language governing permissions and
  9522. * limitations under the License.
  9523. * =============================================================================
  9524. */const Qu={kernelName:s._110,backendName:"webgl",kernelFunc:function(t){const{inputs:e,backend:n,attrs:r}=t,{value:i}=e;let{axis:o}=r;o<0&&(o+=i.shape.length);const s=i,a=s.shape.length,l=i.shape[o],u=new Array(a-1);let c=0;for(let t=0;t<a;t++)t!==o&&(u[c++]=s.shape[t]);const h=[],d=new Array(a).fill(0),p=s.shape.slice();p[o]=1;const f=new Array(l);for(let t=0;t<f.length;t++){d[o]=t;const e=fo({inputs:{x:s},backend:n,attrs:{begin:d,size:p}}),r=ci({inputs:{x:e},backend:n,attrs:{shape:u}});f[t]=r,h.push(e)}return h.forEach(t=>n.disposeIntermediateTensorInfo(t)),f}};
  9525. /**
  9526. * @license
  9527. * Copyright 2018 Google LLC. All Rights Reserved.
  9528. * Licensed under the Apache License, Version 2.0 (the "License");
  9529. * you may not use this file except in compliance with the License.
  9530. * You may obtain a copy of the License at
  9531. *
  9532. * http://www.apache.org/licenses/LICENSE-2.0
  9533. *
  9534. * Unless required by applicable law or agreed to in writing, software
  9535. * distributed under the License is distributed on an "AS IS" BASIS,
  9536. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9537. * See the License for the specific language governing permissions and
  9538. * limitations under the License.
  9539. * =============================================================================
  9540. */class tc{constructor(t,e){this.variableNames=["x","segmentIds"];const n=t.windowSize,r=t.batchSize,i=t.inSize,o=t.numSegments,s=o*Math.ceil(i/n);this.outputShape=[r,s];const a=4*Math.floor(n/4),l=n%4,u="\n sumValue += dot(values, segFilter);\n ";let c="";i%n>0&&(c=`\n if (inIdx < 0 || inIdx >= ${i}) {\n return initializationValue;\n }\n `);let h="";i%n>0&&(h=`\n if (inIdx < 0 || inIdx >= ${i}) {\n return -1.0;\n }\n `),this.userCode=`\n const float initializationValue = 0.0;\n\n float getValue(int batch, int inIdx) {\n ${c}\n return getX(batch, inIdx);\n }\n\n float getSegmentIdAtIndex(int inIdx) {\n ${h}\n return getSegmentIds(inIdx);\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = int(floor(float(outIdx) / float(\n ${o})) * float(${n}));\n int currentSeg = int(mod(float(outIdx), float(${o})));\n\n float sumValue = 0.0;\n\n for (int i = 0; i < ${a}; i += 4) {\n int inIdx = inOffset + i;\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n getValue(batch, inIdx + 3)\n );\n\n vec4 segFilter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 2)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 3)) == currentSeg ? 1 : 0\n );\n\n ${u}\n }\n\n int inIdx = inOffset + ${a};\n if (${1===l}) {\n vec4 values = vec4(\n getValue(batch, inIdx),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n int inIdxSeg = int(getSegmentIdAtIndex(inIdx));\n\n vec4 segFilter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n 0,\n 0,\n 0\n );\n\n ${u}\n } else if (${2===l}) {\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n initializationValue,\n initializationValue\n );\n\n vec4 segFilter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\n 0,\n 0\n );\n\n ${u}\n } else if (${3===l}) {\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n initializationValue\n );\n\n vec4 segFilter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 2)) == currentSeg ? 1 : 0,\n 0\n );\n\n ${u}\n }\n setOutput(sumValue);\n }\n `}}
  9541. /**
  9542. * @license
  9543. * Copyright 2020 Google LLC. All Rights Reserved.
  9544. * Licensed under the Apache License, Version 2.0 (the "License");
  9545. * you may not use this file except in compliance with the License.
  9546. * You may obtain a copy of the License at
  9547. *
  9548. * http://www.apache.org/licenses/LICENSE-2.0
  9549. *
  9550. * Unless required by applicable law or agreed to in writing, software
  9551. * distributed under the License is distributed on an "AS IS" BASIS,
  9552. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9553. * See the License for the specific language governing permissions and
  9554. * limitations under the License.
  9555. * =============================================================================
  9556. */const ec=[wi,Si,Oi,Ri,Di,Pi,Fi,Bi,Vi,Hi,Gi,Xi,Yi,Ji,Qi,no,ro,so,ao,lo,uo,mo,vo,bo,wo,ko,Ro,Kr,Do,Uo,Xo,Zo,Qo,ts,es,ns,is,ss,as,hs,ds,fs,vs,ys,Ts,Es,Cs,Ss,Os,Is,As,Ds,Ls,Fs,$s,Hs,zs,Xs,qs,Zs,ea,ra,ia,sa,ua,ha,pa,zr,fa,Bo,ma,ba,ya,Jr,xa,wa,Ca,ka,Ia,Aa,Da,La,Pa,Fa,ja,Ua,Va,Ha,za,Xa,Ka,Ya,qa,Za,Qa,el,cl,ui,pl,gl,vl,_l,yo,yl,El,wl,Sl,Ol,ti,Il,Al,xo,il,Dl,Ll,Fl,hi,$l,Vl,Gl,Xl,ql,Jl,Ql,eu,ru,ou,au,uu,hu,pu,gu,go,ul,vu,bu,_u,yu,Tu,xu,Eu,wu,ku,Iu,Au,Nu,Mu,Lu,Pu,Fu,al,_i,ju,Uu,Wu,Yu,Ju,Ti,Zu,Qu,{kernelName:s._111,backendName:"webgl",kernelFunc:function(t){const{inputs:e,backend:n,attrs:r}=t,{x:i,segmentIds:o}=e,{numSegments:a}=r,l=i.shape.length,u=[];let c=0;const h=s._115.getAxesPermutation([c],l);let d=i;null!=h&&(d=yi({inputs:{x:i},backend:n,attrs:{perm:h}}),u.push(d),c=s._115.getInnerMostAxes(1,l)[0]);const p=s._115.segment_util.computeOutShape(d.shape,c,a),f=s._152.sizeFromShape([d.shape[c]]),g=ci({inputs:{x:d},backend:n,attrs:{shape:[-1,f]}});u.push(g);const m=Object(s._145)(i.dtype),v=(t,e,r,i,o)=>{const a=t.shape[0],l=t.shape[1],c=s._115.segment_util.segOpComputeOptimalWindowSize(l,o),h=new tc({windowSize:c,inSize:l,batchSize:a,numSegments:o},e),d=n.compileAndRun(h,[t,r],i);if(u.push(d),d.shape[1]===o)return d;const p=Rl({backend:n,attrs:{start:0,stop:o,step:1,dtype:"float32"}}),f=Hu({inputs:{x:p},backend:n,attrs:{reps:[l/c]}});return u.push(p),u.push(f),v(d,e,f,i,o)},b=ci({inputs:{x:v(g,"unsortedSegmentSum",o,m,a)},backend:n,attrs:{shape:p}});let _=b;if(null!=h){u.push(b);const t=s._115.getUndoAxesPermutation(h);_=yi({inputs:{x:_},backend:n,attrs:{perm:t}})}return u.forEach(t=>n.disposeIntermediateTensorInfo(t)),_}},xl];
  9557. /**
  9558. * @license
  9559. * Copyright 2020 Google LLC. All Rights Reserved.
  9560. * Licensed under the Apache License, Version 2.0 (the "License");
  9561. * you may not use this file except in compliance with the License.
  9562. * You may obtain a copy of the License at
  9563. *
  9564. * http://www.apache.org/licenses/LICENSE-2.0
  9565. *
  9566. * Unless required by applicable law or agreed to in writing, software
  9567. * distributed under the License is distributed on an "AS IS" BASIS,
  9568. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9569. * See the License for the specific language governing permissions and
  9570. * limitations under the License.
  9571. * =============================================================================
  9572. */for(const t of ec)Object(s._136)(t);n.d(e,!1,function(){return"3.14.0"}),n.d(e,!1,function(){return Vr}),n.d(e,!1,function(){return $r}),n.d(e,!1,function(){return u}),n.d(e,!1,function(){return pe}),n.d(e,!1,function(){return i}),n.d(e,!1,function(){return r}),n.d(e,!1,function(){return Ur})},qR1P:function(t,e,n){"use strict";(function(t){e.i=k,e.c=O,e.f=I,e.e=N,e.d=D,e.k=L,e.g=P,e.h=F,e.j=B,e.b=j;var r=n("JV7f"),i=n("+gIa"),o=n("SW71"),s=n("zp+s"),a=n("tA/x"),l=n("X6Bc"),u=n("vgmL"),c=n("/Gr6"),h=n("IbAV"),d=n("2reR"),p=n("xFf5"),f=n("rtix"),g=n("0+0a"),m=n("HSvE"),v=n("dmtG"),b=n("Bf2p"),_=n("a0oK"),y=n("psUW"),T=n("Qy0b"),x=n("F08B"),E=n("fiWD"),w=n("0KS2"),C=n("F6Ex");function S(e,n){const i=Array.isArray(e)?String.fromCharCode.apply(null,e):function(e){const n=Object(r._127)().global;if(void 0!==n.atob)return n.atob(e);if(void 0!==t)return new t(e,"base64").toString();throw new Error("Unable to decode base64 in this environment. Missing built-in atob() or Buffer()")}(e);return n?i:i.toLowerCase()}function k(t,e,n,r=!1){const i=t[e];return null!=i?S(i.s,r):n}function O(t,e,n){const r=t[e];return r?r.b:n}function I(t,e,n){const r=t[e]||{},i=null!=r.i?r.i:null!=r.f?r.f:n;return"number"==typeof i?i:parseInt(i,10)}function R(t){switch("string"==typeof t&&(t=i.a[t]),t){case i.a.DT_FLOAT:case i.a.DT_HALF:return"float32";case i.a.DT_INT32:case i.a.DT_INT64:case i.a.DT_INT8:case i.a.DT_UINT8:return"int32";case i.a.DT_BOOL:return"bool";case i.a.DT_DOUBLE:return"float32";case i.a.DT_STRING:return"string";default:return null}}function A(t,e,n){const r=t[e];return r&&r.func?r.func.name:n}function N(t,e,n){const r=t[e];return r&&r.type?R(r.type):n}function D(t,e,n){const r=t[e];return r&&r.list&&r.list.type?r.list.type.map(t=>R(t)):n}function M(t){if(!t.unknownRank)return null!=t.dim?t.dim.map(t=>"number"==typeof t.size?t.size:parseInt(t.size,10)):[]}function L(t,e,n){const r=t[e];return r&&r.shape?M(r.shape):n}function P(t,e,n){const r=t[e];return r?((r.list.f&&r.list.f.length?r.list.f:r.list.i)||[]).map(t=>"number"==typeof t?t:parseInt(t,10)):n}function F(t,e,n,r=!1){const i=t[e];return i&&i.list&&i.list.s?i.list.s.map(t=>S(t,r)):n}function B(t,e,n){const r=t[e];return r&&r.list&&r.list.shape?r.list.shape.map(t=>M(t)):n}function j(t,e,n){const r=t[e];return r&&r.list&&r.list.b?r.list.b:n}e.a=
  9573. /**
  9574. * @license
  9575. * Copyright 2018 Google LLC. All Rights Reserved.
  9576. * Licensed under the Apache License, Version 2.0 (the "License");
  9577. * you may not use this file except in compliance with the License.
  9578. * You may obtain a copy of the License at
  9579. *
  9580. * http://www.apache.org/licenses/LICENSE-2.0
  9581. *
  9582. * Unless required by applicable law or agreed to in writing, software
  9583. * distributed under the License is distributed on an "AS IS" BASIS,
  9584. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9585. * See the License for the specific language governing permissions and
  9586. * limitations under the License.
  9587. * =============================================================================
  9588. */
  9589. class{static get Instance(){return this._instance||(this._instance=new this)}constructor(){const t=[].concat(...[a,l,u,c,h,d,p,f,g,m,v,b,_,y,T,x,E,w,C].map(t=>t.json));this.opMappers=t.reduce((t,e)=>(t[e.tfOpName]=e,t),{})}transformGraph(t,e={}){const n=[],r=[],i=[],o=t.node.reduce((t,e)=>(t[e.name]=this.mapNode(e),e.op.startsWith("Placeholder")?n.push(t[e.name]):"Const"===e.op?r.push(t[e.name]):null!=e.input&&0!==e.input.length||i.push(t[e.name]),t),{});let a=[];const l=[];let u={},c={};null!=e&&(u=this.mapSignatureEntries(e.inputs),c=this.mapSignatureEntries(e.outputs));const h=Object.keys(o);h.forEach(t=>{const e=o[t];e.inputNames.forEach((t,n)=>{const[r,,i]=Object(s.b)(t),a=o[r];if(null!=a.outputs){const t=a.outputs.indexOf(i);if(-1!==t){const i=`${r}:${t}`;e.inputNames[n]=i}}e.inputs.push(a),a.children.push(e)})}),0===Object.keys(c).length?h.forEach(t=>{const e=o[t];0===e.children.length&&l.push(e)}):Object.keys(c).forEach(t=>{const[e]=Object(s.b)(t),n=o[e];null!=n&&(n.signatureKey=c[t],l.push(n))}),Object.keys(u).length>0?Object.keys(u).forEach(t=>{const[e]=Object(s.b)(t),n=o[e];n&&(n.signatureKey=u[t],a.push(n))}):a=n;let d={};null!=t.library&&null!=t.library.function&&(d=t.library.function.reduce((t,e)=>(t[e.signature.name]=this.mapFunction(e),t),{}));const p={nodes:o,inputs:a,outputs:l,weights:r,placeholders:n,signature:e,functions:d};return i.length>0&&(p.initNodes=i),p}mapSignatureEntries(t){return Object.keys(t||{}).reduce((e,n)=>(e[t[n].name]=n,e),{})}mapNode(t){const e=Object(o.a)(t.op)||this.opMappers[t.op]||{};null==t.attr&&(t.attr={});const n={name:t.name,op:t.op,category:e.category,inputNames:(t.input||[]).map(t=>t.startsWith("^")?t.substr(1):t),inputs:[],children:[],inputParams:{},attrParams:{},rawAttrs:t.attr,outputs:e.outputs};return null!=e.inputs&&(n.inputParams=e.inputs.reduce((t,e)=>(t[e.name]={type:e.type,inputIndexStart:e.start,inputIndexEnd:e.end},t),{})),null!=e.attrs&&(n.attrParams=e.attrs.reduce((e,n)=>{const r=n.type;let i=void 0;switch(n.type){case"string":void 0===(i=k(t.attr,n.tfName,n.defaultValue))&&n.tfDeprecatedName&&(i=k(t.attr,n.tfDeprecatedName,n.defaultValue));break;case"string[]":void 0===(i=F(t.attr,n.tfName,n.defaultValue))&&n.tfDeprecatedName&&(i=F(t.attr,n.tfDeprecatedName,n.defaultValue));break;case"number":void 0===(i=I(t.attr,n.tfName,n.defaultValue||0))&&n.tfDeprecatedName&&(i=I(t.attr,n.tfDeprecatedName,n.defaultValue));break;case"number[]":void 0===(i=P(t.attr,n.tfName,n.defaultValue))&&n.tfDeprecatedName&&(i=P(t.attr,n.tfDeprecatedName,n.defaultValue));break;case"bool":void 0===(i=O(t.attr,n.tfName,n.defaultValue))&&n.tfDeprecatedName&&(i=O(t.attr,n.tfDeprecatedName,n.defaultValue));break;case"bool[]":void 0===(i=j(t.attr,n.tfName,n.defaultValue))&&n.tfDeprecatedName&&(i=j(t.attr,n.tfDeprecatedName,n.defaultValue));break;case"shape":void 0===(i=L(t.attr,n.tfName,n.defaultValue))&&n.tfDeprecatedName&&(i=L(t.attr,n.tfDeprecatedName,n.defaultValue));break;case"shape[]":void 0===(i=B(t.attr,n.tfName,n.defaultValue))&&n.tfDeprecatedName&&(i=B(t.attr,n.tfDeprecatedName,n.defaultValue));break;case"dtype":void 0===(i=N(t.attr,n.tfName,n.defaultValue))&&n.tfDeprecatedName&&(i=N(t.attr,n.tfDeprecatedName,n.defaultValue));break;case"dtype[]":void 0===(i=D(t.attr,n.tfName,n.defaultValue))&&n.tfDeprecatedName&&(i=D(t.attr,n.tfDeprecatedName,n.defaultValue));break;case"func":void 0===(i=A(t.attr,n.tfName,n.defaultValue))&&n.tfDeprecatedName&&(i=A(t.attr,n.tfDeprecatedName,n.defaultValue));break;case"tensor":case"tensors":break;default:throw new Error(`Unsupported param type: ${n.type} for op: ${t.op}`)}return e[n.name]={value:i,type:r},e},{})),n}mapFunction(t){const e=t.nodeDef,n=[];let r={};null!=e&&(r=e.reduce((t,e)=>(t[e.name]=this.mapNode(e),"Const"===e.op&&n.push(t[e.name]),t),{}));const i=[],o=[];t.signature.inputArg.forEach(t=>{const[e]=Object(s.b)(t.name),n={name:e,op:"Placeholder",inputs:[],inputNames:[],category:"graph",inputParams:{},attrParams:{dtype:{value:R(t.type),type:"dtype"}},children:[]};n.signatureKey=t.name,i.push(n),r[e]=n}),Object.keys(r).forEach(t=>{const e=r[t];e.inputNames.forEach((t,n)=>{const[i,,o]=Object(s.b)(t),a=r[i];if(null!=a.outputs){const t=a.outputs.indexOf(o);if(-1!==t){const r=`${i}:${t}`;e.inputNames[n]=r}}e.inputs.push(a),a.children.push(e)})});const a=t.ret;t.signature.outputArg.forEach(t=>{const[e,n]=Object(s.b)(a[t.name]),i=r[e];null!=i&&(i.defaultOutput=n,o.push(i))});const l=this.mapArgsToSignature(t);return{nodes:r,inputs:i,outputs:o,weights:n,placeholders:[],signature:l}}mapArgsToSignature(t){return{methodName:t.signature.name,inputs:t.signature.inputArg.reduce((t,e)=>(t[e.name]=this.mapArgToTensorInfo(e),t),{}),outputs:t.signature.outputArg.reduce((e,n)=>(e[n.name]=this.mapArgToTensorInfo(n,t.ret),e),{})}}mapArgToTensorInfo(t,e){let n=t.name;return null!=e&&(n=e[n]),{name:n,dtype:t.type}}}}).call(e,n("EuP9").Buffer)},qRfI:function(t,e,n){"use strict";t.exports=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}},qio6:function(t,e,n){var r=n("evD5"),i=n("77Pl"),o=n("lktj");t.exports=n("+E39")?Object.defineProperties:function(t,e){i(t);for(var n,s=o(e),a=s.length,l=0;a>l;)r.f(t,n=s[l++],e[n]);return t}},qkKv:function(t,e,n){var r=n("FeBl"),i=r.JSON||(r.JSON={stringify:JSON.stringify});t.exports=function(t){return i.stringify.apply(i,arguments)}},qyJz:function(t,e,n){"use strict";var r=n("+ZMJ"),i=n("kM2E"),o=n("sB3e"),s=n("msXi"),a=n("Mhyx"),l=n("QRG4"),u=n("fBQ2"),c=n("3fs2");i(i.S+i.F*!n("dY0y")(function(t){Array.from(t)}),"Array",{from:function(t){var e,n,i,h,d=o(t),p="function"==typeof this?this:Array,f=arguments.length,g=f>1?arguments[1]:void 0,m=void 0!==g,v=0,b=c(d);if(m&&(g=r(g,f>2?arguments[2]:void 0,2)),void 0==b||p==Array&&a(b))for(n=new p(e=l(d.length));e>v;v++)u(n,v,m?g(d[v],v):d[v]);else for(h=b.call(d),n=new p;!(i=h.next()).done;v++)u(n,v,m?s(h,g,[i.value,v],!0):i.value);return n.length=v,n}})},rQ0i:function(t,e,n){"use strict";var r=n("Kkag"),i=n("l5jf"),o=n("xMQ1"),s=n("XFvI"),a=n("35G1");const l=Object(a.a)({complex_:
  9590. /**
  9591. * @license
  9592. * Copyright 2020 Google LLC. All Rights Reserved.
  9593. * Licensed under the Apache License, Version 2.0 (the "License");
  9594. * you may not use this file except in compliance with the License.
  9595. * You may obtain a copy of the License at
  9596. *
  9597. * http://www.apache.org/licenses/LICENSE-2.0
  9598. *
  9599. * Unless required by applicable law or agreed to in writing, software
  9600. * distributed under the License is distributed on an "AS IS" BASIS,
  9601. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9602. * See the License for the specific language governing permissions and
  9603. * limitations under the License.
  9604. * =============================================================================
  9605. */
  9606. function(t,e){const n=Object(o.a)(t,"real","complex"),a=Object(o.a)(e,"imag","complex");s.assertShapesMatch(n.shape,a.shape,`real and imag shapes, ${n.shape} and ${a.shape}, `+"must match in call to tf.complex().");const l={real:n,imag:a};return r.a.runKernel(i.z,l)}});e.a=l},rtix:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.json=[{tfOpName:"PlaceholderWithDefault",category:"graph",inputs:[{start:0,name:"default",type:"tensor"}],attrs:[{tfName:"shape",name:"shape",type:"shape"},{tfName:"dtype",name:"dtype",type:"dtype"}]},{tfOpName:"Placeholder",category:"graph",attrs:[{tfName:"shape",name:"shape",type:"shape"},{tfName:"dtype",name:"dtype",type:"dtype"}]},{tfOpName:"Const",category:"graph"},{tfOpName:"Identity",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"IdentityN",category:"graph",inputs:[{start:0,end:0,name:"x",type:"tensors"}]},{tfOpName:"Snapshot",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"Rank",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"Size",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"Shape",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"ShapeN",category:"graph",inputs:[{start:0,end:0,name:"x",type:"tensors"}]},{tfOpName:"Print",category:"graph",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"data",type:"tensors"}],attrs:[{tfName:"message",name:"message",type:"string"},{tfName:"first_n",name:"firstN",type:"number",notSupported:!0},{tfName:"summarize",name:"summarize",type:"number",defaultValue:3}]},{tfOpName:"NoOp",category:"graph",inputs:[]},{tfOpName:"StopGradient",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"FakeQuantWithMinMaxVars",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"min",name:"min",type:"number"},{tfName:"max",name:"max",type:"number"}]}]},s2iQ:function(t,e,n){"use strict";e.a=
  9607. /**
  9608. * @license
  9609. * Copyright 2018 Google LLC. All Rights Reserved.
  9610. * Licensed under the Apache License, Version 2.0 (the "License");
  9611. * you may not use this file except in compliance with the License.
  9612. * You may obtain a copy of the License at
  9613. *
  9614. * http://www.apache.org/licenses/LICENSE-2.0
  9615. *
  9616. * Unless required by applicable law or agreed to in writing, software
  9617. * distributed under the License is distributed on an "AS IS" BASIS,
  9618. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9619. * See the License for the specific language governing permissions and
  9620. * limitations under the License.
  9621. * =============================================================================
  9622. */
  9623. function(t,e){if((Object(r.isTypedArray)(t)&&"string"!==e||Array.isArray(t))&&"complex64"!==e)throw new Error("Error creating a new Scalar: value must be a primitive (number|boolean|string)");if("string"===e&&Object(r.isTypedArray)(t)&&!(t instanceof Uint8Array))throw new Error("When making a scalar from encoded string, the value must be `Uint8Array`.");return Object(i.a)(t,[],[],e)};var r=n("XFvI"),i=n("M1Ti")},s3ue:function(t,e,n){t.exports=function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/dist/",n(n.s=126)}({0:function(t,e,n){"use strict";function r(t,e,n,r,i,o,s,a){var l,u="function"==typeof t?t.options:t;if(e&&(u.render=e,u.staticRenderFns=n,u._compiled=!0),r&&(u.functional=!0),o&&(u._scopeId="data-v-"+o),s?(l=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(s)},u._ssrRegister=l):i&&(l=a?function(){i.call(this,this.$root.$options.shadowRoot)}:i),l)if(u.functional){u._injectStyles=l;var c=u.render;u.render=function(t,e){return l.call(e),c(t,e)}}else{var h=u.beforeCreate;u.beforeCreate=h?[].concat(h,l):[l]}return{exports:t,options:u}}n.d(e,"a",function(){return r})},126:function(t,e,n){"use strict";n.r(e);var r=function(){var t=this.$createElement;return(this._self._c||t)("div",{staticClass:"el-checkbox-group",attrs:{role:"group","aria-label":"checkbox-group"}},[this._t("default")],2)};r._withStripped=!0;var i=n(4),o={name:"ElCheckboxGroup",componentName:"ElCheckboxGroup",mixins:[n.n(i).a],inject:{elFormItem:{default:""}},props:{value:{},disabled:Boolean,min:Number,max:Number,size:String,fill:String,textColor:String},computed:{_elFormItemSize:function(){return(this.elFormItem||{}).elFormItemSize},checkboxGroupSize:function(){return this.size||this._elFormItemSize||(this.$ELEMENT||{}).size}},watch:{value:function(t){this.dispatch("ElFormItem","el.form.change",[t])}}},s=n(0),a=Object(s.a)(o,r,[],!1,null,null,null);a.options.__file="packages/checkbox/src/checkbox-group.vue";var l=a.exports;l.install=function(t){t.component(l.name,l)};e.default=l},4:function(t,e){t.exports=n("fPll")}})},s9og:function(t,e,n){var r;r=function(t){
  9624. /** @preserve
  9625. * Counter block mode compatible with Dr Brian Gladman fileenc.c
  9626. * derived from CryptoJS.mode.CTR
  9627. * Jan Hruby jhruby.web@gmail.com
  9628. */
  9629. return t.mode.CTRGladman=function(){var e=t.lib.BlockCipherMode.extend();function n(t){if(255==(t>>24&255)){var e=t>>16&255,n=t>>8&255,r=255&t;255===e?(e=0,255===n?(n=0,255===r?r=0:++r):++n):++e,t=0,t+=e<<16,t+=n<<8,t+=r}else t+=1<<24;return t}var r=e.Encryptor=e.extend({processBlock:function(t,e){var r=this._cipher,i=r.blockSize,o=this._iv,s=this._counter;o&&(s=this._counter=o.slice(0),this._iv=void 0),function(t){0===(t[0]=n(t[0]))&&(t[1]=n(t[1]))}(s);var a=s.slice(0);r.encryptBlock(a,0);for(var l=0;l<i;l++)t[e+l]^=a[l]}});return e.Decryptor=r,e}(),t.mode.CTRGladman},t.exports=r(n("02Hb"),n("fGru"))},sB3e:function(t,e,n){var r=n("52gC");t.exports=function(t){return Object(r(t))}},sOR5:function(t,e){var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},sfDJ:function(t,e,n){"use strict";var r=n("Kkag"),i=n("l5jf"),o=n("jb1O"),s=n("xMQ1"),a=n("K9mh"),l=n("35G1");const u=Object(l.a)({div_:
  9630. /**
  9631. * @license
  9632. * Copyright 2020 Google LLC. All Rights Reserved.
  9633. * Licensed under the Apache License, Version 2.0 (the "License");
  9634. * you may not use this file except in compliance with the License.
  9635. * You may obtain a copy of the License at
  9636. *
  9637. * http://www.apache.org/licenses/LICENSE-2.0
  9638. *
  9639. * Unless required by applicable law or agreed to in writing, software
  9640. * distributed under the License is distributed on an "AS IS" BASIS,
  9641. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9642. * See the License for the specific language governing permissions and
  9643. * limitations under the License.
  9644. * =============================================================================
  9645. */
  9646. function(t,e){let n=Object(s.a)(t,"a","div"),l=Object(s.a)(e,"b","div");if([n,l]=Object(o.c)(n,l),"int32"===n.dtype&&"int32"===l.dtype)return Object(a.a)(n,l);const u={a:n,b:l};return r.a.runKernel(i._59,u,{})}});e.a=u},t8qj:function(t,e,n){"use strict";t.exports=function(t,e,n,r,i){return t.config=e,n&&(t.code=n),t.request=r,t.response=i,t.isAxiosError=!0,t.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},t}},t8x9:function(t,e,n){var r=n("77Pl"),i=n("lOnJ"),o=n("dSzd")("species");t.exports=function(t,e){var n,s=r(t).constructor;return void 0===s||void 0==(n=r(s)[o])?e:i(n)}},"tA/x":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.json=[{tfOpName:"Add",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"AddV2",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"AddN",category:"arithmetic",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}]},{tfOpName:"BiasAdd",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"Sub",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"RealDiv",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Div",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"DivNoNan",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"FloorDiv",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Mul",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Maximum",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Minimum",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Pow",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"SquaredDifference",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Mod",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"FloorMod",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}]},tIFN:function(t,e,n){"use strict";var r=n("cGG2"),i=n("JP+z"),o=n("XmWM"),s=n("DUeU");function a(t){var e=new o(t),n=i(o.prototype.request,e);return r.extend(n,o.prototype,e),r.extend(n,e),n}var l=a(n("KCLY"));l.Axios=o,l.create=function(t){return a(s(l.defaults,t))},l.Cancel=n("dVOP"),l.CancelToken=n("cWxy"),l.isCancel=n("pBtG"),l.all=function(t){return Promise.all(t)},l.spread=n("pxG4"),l.isAxiosError=n("SLDG"),t.exports=l,t.exports.default=l},tk3E:function(t,e,n){var r,i,o,s;s=function(t){
  9647. /**
  9648. * @license
  9649. * Copyright 2019 Google LLC
  9650. * SPDX-License-Identifier: Apache-2.0
  9651. */
  9652. "use strict";return t},i=[n("Ew4t")],void 0===(o="function"==typeof(r=s)?r.apply(e,i):r)||(t.exports=o)},uFh6:function(t,e,n){var r;r=function(t){return function(){var e=t,n=e.lib.WordArray;e.enc.Base64={stringify:function(t){var e=t.words,n=t.sigBytes,r=this._map;t.clamp();for(var i=[],o=0;o<n;o+=3)for(var s=(e[o>>>2]>>>24-o%4*8&255)<<16|(e[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|e[o+2>>>2]>>>24-(o+2)%4*8&255,a=0;a<4&&o+.75*a<n;a++)i.push(r.charAt(s>>>6*(3-a)&63));var l=r.charAt(64);if(l)for(;i.length%4;)i.push(l);return i.join("")},parse:function(t){var e=t.length,r=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var o=0;o<r.length;o++)i[r.charCodeAt(o)]=o}var s=r.charAt(64);if(s){var a=t.indexOf(s);-1!==a&&(e=a)}return function(t,e,r){for(var i=[],o=0,s=0;s<e;s++)if(s%4){var a=r[t.charCodeAt(s-1)]<<s%4*2,l=r[t.charCodeAt(s)]>>>6-s%4*2,u=a|l;i[o>>>2]|=u<<24-o%4*8,o++}return n.create(i,o)}(t,e,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),t.enc.Base64},t.exports=r(n("02Hb"))},uY1a:function(t,e){t.exports=function(t,e,n,r){var i,o=0;return"boolean"!=typeof e&&(r=n,n=e,e=void 0),function(){var s=this,a=Number(new Date)-o,l=arguments;function u(){o=Number(new Date),n.apply(s,l)}r&&!i&&u(),i&&clearTimeout(i),void 0===r&&a>t?u():!0!==e&&(i=setTimeout(r?function(){i=void 0}:u,void 0===r?t-a:t))}}},ujcs:function(t,e){
  9653. /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
  9654. e.read=function(t,e,n,r,i){var o,s,a=8*i-r-1,l=(1<<a)-1,u=l>>1,c=-7,h=n?i-1:0,d=n?-1:1,p=t[e+h];for(h+=d,o=p&(1<<-c)-1,p>>=-c,c+=a;c>0;o=256*o+t[e+h],h+=d,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=r;c>0;s=256*s+t[e+h],h+=d,c-=8);if(0===o)o=1-u;else{if(o===l)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,r),o-=u}return(p?-1:1)*s*Math.pow(2,o-r)},e.write=function(t,e,n,r,i,o){var s,a,l,u=8*o-i-1,c=(1<<u)-1,h=c>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,f=r?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=c):(s=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-s))<1&&(s--,l*=2),(e+=s+h>=1?d/l:d*Math.pow(2,1-h))*l>=2&&(s++,l/=2),s+h>=c?(a=0,s=c):s+h>=1?(a=(e*l-1)*Math.pow(2,i),s+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;t[n+p]=255&a,p+=f,a/=256,i-=8);for(s=s<<i|a,u+=i;u>0;t[n+p]=255&s,p+=f,s/=256,u-=8);t[n+p-f]|=128*g}},uqUo:function(t,e,n){var r=n("kM2E"),i=n("FeBl"),o=n("S82l");t.exports=function(t,e){var n=(i.Object||{})[t]||Object[t],s={};s[t]=e(n),r(r.S+r.F*o(function(){n(1)}),"Object",s)}},urW8:function(t,e,n){"use strict";e.__esModule=!0,e.i18n=e.use=e.t=void 0;var r=s(n("Vi3T")),i=s(n("7+uW")),o=s(n("i3rX"));function s(t){return t&&t.__esModule?t:{default:t}}var a=(0,s(n("SvnF")).default)(i.default),l=r.default,u=!1,c=function(){var t=Object.getPrototypeOf(this||i.default).$t;if("function"==typeof t&&i.default.locale)return u||(u=!0,i.default.locale(i.default.config.lang,(0,o.default)(l,i.default.locale(i.default.config.lang)||{},{clone:!0}))),t.apply(this,arguments)},h=e.t=function(t,e){var n=c.apply(this,arguments);if(null!==n&&void 0!==n)return n;for(var r=t.split("."),i=l,o=0,s=r.length;o<s;o++){if(n=i[r[o]],o===s-1)return a(n,e);if(!n)return"";i=n}return""},d=e.use=function(t){l=t||l},p=e.i18n=function(t){c=t||c};e.default={use:d,t:h,i18n:p}},"us/S":function(t,e,n){t.exports={default:n("Xd32"),__esModule:!0}},"v/P2":function(t,e,n){"use strict";e.b=s,e.c=function(t){a=t};var r=n("DYVU");
  9655. /**
  9656. * @license
  9657. * Copyright 2017 Google LLC. All Rights Reserved.
  9658. * Licensed under the Apache License, Version 2.0 (the "License");
  9659. * you may not use this file except in compliance with the License.
  9660. * You may obtain a copy of the License at
  9661. *
  9662. * http://www.apache.org/licenses/LICENSE-2.0
  9663. *
  9664. * Unless required by applicable law or agreed to in writing, software
  9665. * distributed under the License is distributed on an "AS IS" BASIS,
  9666. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9667. * See the License for the specific language governing permissions and
  9668. * limitations under the License.
  9669. * =============================================================================
  9670. */const i="tfjsflags";function o(t){const e={};return t.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g,(t,...n)=>((function(t,e,n){t[decodeURIComponent(e)]=decodeURIComponent(n||"")})(e,n[0],n[1]),n.join("="))),e}function s(){return a}e.a=class{constructor(t){this.global=t,this.flags={},this.flagRegistry={},this.urlFlags={},this.getQueryParams=o,this.populateURLFlags()}setPlatform(t,e){null!=this.platform&&(s().getBool("IS_TEST")||s().getBool("PROD")||console.warn(`Platform ${this.platformName} has already been set. `+`Overwriting the platform with ${t}.`)),this.platformName=t,this.platform=e}registerFlag(t,e,n){if(this.flagRegistry[t]={evaluationFn:e,setHook:n},null!=this.urlFlags[t]){const e=this.urlFlags[t];s().getBool("IS_TEST")||s().getBool("PROD")||console.warn(`Setting feature override from URL ${t}: ${e}.`),this.set(t,e)}}async getAsync(t){return t in this.flags?this.flags[t]:(this.flags[t]=await this.evaluateFlag(t),this.flags[t])}get(t){if(t in this.flags)return this.flags[t];const e=this.evaluateFlag(t);if(Object(r.x)(e))throw new Error(`Flag ${t} cannot be synchronously evaluated. `+"Please use getAsync() instead.");return this.flags[t]=e,this.flags[t]}getNumber(t){return this.get(t)}getBool(t){return this.get(t)}getFlags(){return this.flags}get features(){return this.flags}set(t,e){if(null==this.flagRegistry[t])throw new Error(`Cannot set flag ${t} as it has not been registered.`);this.flags[t]=e,null!=this.flagRegistry[t].setHook&&this.flagRegistry[t].setHook(e)}evaluateFlag(t){if(null==this.flagRegistry[t])throw new Error(`Cannot evaluate flag '${t}': no evaluation function found.`);return this.flagRegistry[t].evaluationFn()}setFlags(t){this.flags=Object.assign({},t)}reset(){this.flags={},this.urlFlags={},this.populateURLFlags()}populateURLFlags(){if(void 0===this.global||void 0===this.global.location||void 0===this.global.location.search)return;const t=this.getQueryParams(this.global.location.search);i in t&&t[i].split(",").forEach(t=>{const[e,n]=t.split(":");this.urlFlags[e]=function(t,e){if("true"===(e=e.toLowerCase())||"false"===e)return"true"===e;if(`${+e}`===e)return+e;throw new Error(`Could not parse value flag value ${e} for flag ${t}.`)}(e,n)})}};let a=null},v1IJ:function(t,e,n){var r;r=function(t){return function(e){var n=t,r=n.lib,i=r.WordArray,o=r.Hasher,s=n.x64.Word,a=n.algo,l=[],u=[],c=[];!function(){for(var t=1,e=0,n=0;n<24;n++){l[t+5*e]=(n+1)*(n+2)/2%64;var r=(2*t+3*e)%5;t=e%5,e=r}for(t=0;t<5;t++)for(e=0;e<5;e++)u[t+5*e]=e+(2*t+3*e)%5*5;for(var i=1,o=0;o<24;o++){for(var a=0,h=0,d=0;d<7;d++){if(1&i){var p=(1<<d)-1;p<32?h^=1<<p:a^=1<<p-32}128&i?i=i<<1^113:i<<=1}c[o]=s.create(a,h)}}();var h=[];!function(){for(var t=0;t<25;t++)h[t]=s.create()}();var d=a.SHA3=o.extend({cfg:o.cfg.extend({outputLength:512}),_doReset:function(){for(var t=this._state=[],e=0;e<25;e++)t[e]=new s.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(t,e){for(var n=this._state,r=this.blockSize/2,i=0;i<r;i++){var o=t[e+2*i],s=t[e+2*i+1];o=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),s=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),(O=n[i]).high^=s,O.low^=o}for(var a=0;a<24;a++){for(var d=0;d<5;d++){for(var p=0,f=0,g=0;g<5;g++){p^=(O=n[d+5*g]).high,f^=O.low}var m=h[d];m.high=p,m.low=f}for(d=0;d<5;d++){var v=h[(d+4)%5],b=h[(d+1)%5],_=b.high,y=b.low;for(p=v.high^(_<<1|y>>>31),f=v.low^(y<<1|_>>>31),g=0;g<5;g++){(O=n[d+5*g]).high^=p,O.low^=f}}for(var T=1;T<25;T++){var x=(O=n[T]).high,E=O.low,w=l[T];w<32?(p=x<<w|E>>>32-w,f=E<<w|x>>>32-w):(p=E<<w-32|x>>>64-w,f=x<<w-32|E>>>64-w);var C=h[u[T]];C.high=p,C.low=f}var S=h[0],k=n[0];S.high=k.high,S.low=k.low;for(d=0;d<5;d++)for(g=0;g<5;g++){var O=n[T=d+5*g],I=h[T],R=h[(d+1)%5+5*g],A=h[(d+2)%5+5*g];O.high=I.high^~R.high&A.high,O.low=I.low^~R.low&A.low}O=n[0];var N=c[a];O.high^=N.high,O.low^=N.low}},_doFinalize:function(){var t=this._data,n=t.words,r=(this._nDataBytes,8*t.sigBytes),o=32*this.blockSize;n[r>>>5]|=1<<24-r%32,n[(e.ceil((r+1)/o)*o>>>5)-1]|=128,t.sigBytes=4*n.length,this._process();for(var s=this._state,a=this.cfg.outputLength/8,l=a/8,u=[],c=0;c<l;c++){var h=s[c],d=h.high,p=h.low;d=16711935&(d<<8|d>>>24)|4278255360&(d<<24|d>>>8),p=16711935&(p<<8|p>>>24)|4278255360&(p<<24|p>>>8),u.push(p),u.push(d)}return new i.init(u,a)},clone:function(){for(var t=o.clone.call(this),e=t._state=this._state.slice(0),n=0;n<25;n++)e[n]=e[n].clone();return t}});n.SHA3=o._createHelper(d),n.HmacSHA3=o._createHmacHelper(d)}(Math),t.SHA3},t.exports=r(n("02Hb"),n("1J88"))},"vFc/":function(t,e,n){var r=n("TcQ7"),i=n("QRG4"),o=n("fkB2");t.exports=function(t){return function(e,n,s){var a,l=r(e),u=i(l.length),c=o(s,u);if(t&&n!=n){for(;u>c;)if((a=l[c++])!=a)return!0}else for(;u>c;c++)if((t||c in l)&&l[c]===n)return t||c||0;return!t&&-1}}},"vIB/":function(t,e,n){"use strict";var r=n("O4g8"),i=n("kM2E"),o=n("880/"),s=n("hJx8"),a=n("/bQp"),l=n("94VQ"),u=n("e6n0"),c=n("PzxK"),h=n("dSzd")("iterator"),d=!([].keys&&"next"in[].keys()),p=function(){return this};t.exports=function(t,e,n,f,g,m,v){l(n,e,f);var b,_,y,T=function(t){if(!d&&t in C)return C[t];switch(t){case"keys":case"values":return function(){return new n(this,t)}}return function(){return new n(this,t)}},x=e+" Iterator",E="values"==g,w=!1,C=t.prototype,S=C[h]||C["@@iterator"]||g&&C[g],k=S||T(g),O=g?E?T("entries"):k:void 0,I="Array"==e&&C.entries||S;if(I&&(y=c(I.call(new t)))!==Object.prototype&&y.next&&(u(y,x,!0),r||"function"==typeof y[h]||s(y,h,p)),E&&S&&"values"!==S.name&&(w=!0,k=function(){return S.call(this)}),r&&!v||!d&&!w&&C[h]||s(C,h,k),a[e]=k,a[x]=p,g)if(b={values:E?k:T("values"),keys:m?k:T("keys"),entries:O},v)for(_ in b)_ in C||o(C,_,b[_]);else i(i.P+i.F*(d||w),e,b);return b}},vgmL:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.json=[{tfOpName:"EmptyTensorList",category:"control",inputs:[{start:0,name:"elementShape",type:"shape"},{start:1,name:"maxNumElements",type:"number"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"LoopCond",category:"control",inputs:[{start:0,name:"pred",type:"tensor"}]},{tfOpName:"Switch",category:"control",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"pred",type:"tensor"}]},{tfOpName:"Merge",category:"control",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}]},{tfOpName:"Enter",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"frame_name",name:"frameName",type:"string"},{tfName:"is_constant",name:"isConstant",type:"bool"}]},{tfOpName:"Exit",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"NextIteration",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"TensorArrayV3",category:"control",inputs:[{start:0,name:"size",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"element_shape",name:"elementShape",type:"shape"},{tfName:"dynamic_size",name:"dynamicSize",type:"bool"},{tfName:"clear_after_read",name:"clearAfterRead",type:"bool"},{tfName:"identical_element_shapes",name:"identicalElementShapes",type:"bool"},{tfName:"tensor_array_name",name:"name",type:"string"}]},{tfOpName:"TensorArrayWriteV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"tensor",type:"tensor"},{start:3,name:"flowIn",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"TensorArrayReadV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"flowIn",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"TensorArrayGatherV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"flowIn",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"element_shape",name:"elementShape",type:"shape"}]},{tfOpName:"TensorArrayScatterV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"tensor",type:"tensor"},{start:3,name:"flowIn",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"TensorArrayConcatV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"flowIn",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"element_shape_except0",name:"elementShapeExcept0",type:"shape",notSupported:!0}]},{tfOpName:"TensorArraySplitV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"tensor",type:"tensor"},{start:2,name:"lengths",type:"number[]"},{start:3,name:"flowIn",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"TensorArraySizeV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"flowIn",type:"number"}]},{tfOpName:"TensorArrayCloseV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"}]},{tfOpName:"StatelessIf",category:"control",inputs:[{start:0,name:"cond",type:"tensor"},{start:1,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"then_branch",name:"thenBranch",type:"func"},{tfName:"else_branch",name:"elseBranch",type:"func"}]},{tfOpName:"If",category:"control",inputs:[{start:0,name:"cond",type:"tensor"},{start:1,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"then_branch",name:"thenBranch",type:"func"},{tfName:"else_branch",name:"elseBranch",type:"func"}]},{tfOpName:"StatelessWhile",category:"control",inputs:[{start:0,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"cond",name:"cond",type:"func"},{tfName:"body",name:"body",type:"func"}]},{tfOpName:"While",category:"control",inputs:[{start:0,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"cond",name:"cond",type:"func"},{tfName:"body",name:"body",type:"func"}]},{tfOpName:"TensorListScatter",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListScatterV2",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"elementShape",type:"shape"},{start:3,name:"numElements",type:"number"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListGather",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListGetItem",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListSetItem",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"tensor",type:"tensor"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListReserve",category:"control",inputs:[{start:0,name:"elementShape",type:"shape"},{start:1,name:"numElements",type:"number"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListFromTensor",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListStack",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"},{tfName:"num_elements",name:"numElements",type:"dtype"}]},{tfOpName:"TensorListSplit",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"elementShape",type:"shape"},{start:2,name:"lengths",type:"number[]"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListConcat",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"}],attrs:[{tfName:"element_shape",name:"elementShape",type:"shape"},{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListPopBack",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListPushBack",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"tensor",type:"tensor"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]}]},wTUY:function(t,e,n){var r,i,o,s;s=function(t){
  9671. /**
  9672. * @license
  9673. * Copyright 2020 Google LLC
  9674. * SPDX-License-Identifier: Apache-2.0
  9675. */
  9676. "use strict";return t.Blocks={},t.Blocks},i=[n("QUGb")],void 0===(o="function"==typeof(r=s)?r.apply(e,i):r)||(t.exports=o)},wj1U:function(t,e,n){var r;r=function(t){var e,n,r,i,o,s,a;return n=(e=t).lib,r=n.Base,i=n.WordArray,o=e.algo,s=o.MD5,a=o.EvpKDF=r.extend({cfg:r.extend({keySize:4,hasher:s,iterations:1}),init:function(t){this.cfg=this.cfg.extend(t)},compute:function(t,e){for(var n,r=this.cfg,o=r.hasher.create(),s=i.create(),a=s.words,l=r.keySize,u=r.iterations;a.length<l;){n&&o.update(n),n=o.update(t).finalize(e),o.reset();for(var c=1;c<u;c++)n=o.finalize(n),o.reset();s.concat(n)}return s.sigBytes=4*l,s}}),e.EvpKDF=function(t,e,n){return a.create(n).compute(t,e)},t.EvpKDF},t.exports=r(n("02Hb"),n("Ff/Y"),n("PIk1"))},woOf:function(t,e,n){t.exports={default:n("V3tA"),__esModule:!0}},wxAW:function(t,e,n){"use strict";e.__esModule=!0;var r,i=n("C4MV"),o=(r=i)&&r.__esModule?r:{default:r};e.default=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),(0,o.default)(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}()},x067:function(t,e,n){var r;r=function(t){var e,n,r,i,o,s,a;return n=(e=t).x64,r=n.Word,i=n.WordArray,o=e.algo,s=o.SHA512,a=o.SHA384=s.extend({_doReset:function(){this._hash=new i.init([new r.init(3418070365,3238371032),new r.init(1654270250,914150663),new r.init(2438529370,812702999),new r.init(355462360,4144912697),new r.init(1731405415,4290775857),new r.init(2394180231,1750603025),new r.init(3675008525,1694076839),new r.init(1203062813,3204075428)])},_doFinalize:function(){var t=s._doFinalize.call(this);return t.sigBytes-=16,t}}),e.SHA384=s._createHelper(a),e.HmacSHA384=s._createHmacHelper(a),t.SHA384},t.exports=r(n("02Hb"),n("1J88"),n("QA75"))},xFf5:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.json=[{tfOpName:"TopKV2",category:"evaluation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"k",type:"number"}],attrs:[{tfName:"sorted",name:"sorted",type:"bool"}]},{tfOpName:"Unique",category:"evaluation",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"UniqueV2",category:"evaluation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]}]},xGkn:function(t,e,n){"use strict";var r=n("4mcu"),i=n("EGZi"),o=n("/bQp"),s=n("TcQ7");t.exports=n("vIB/")(Array,"Array",function(t,e){this._t=s(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,i(1)):i(0,"keys"==e?n:"values"==e?t[n]:[n,t[n]])},"values"),o.Arguments=o.Array,r("keys"),r("values"),r("entries")},"xH/j":function(t,e,n){var r=n("hJx8");t.exports=function(t,e,n){for(var i in e)n&&t[i]?t[i]=e[i]:r(t,i,e[i]);return t}},xLtR:function(t,e,n){"use strict";var r=n("cGG2"),i=n("TNV1"),o=n("pBtG"),s=n("KCLY");function a(t){t.cancelToken&&t.cancelToken.throwIfRequested()}t.exports=function(t){return a(t),t.headers=t.headers||{},t.data=i(t.data,t.headers,t.transformRequest),t.headers=r.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),r.forEach(["delete","get","head","post","put","patch","common"],function(e){delete t.headers[e]}),(t.adapter||s.adapter)(t).then(function(e){return a(t),e.data=i(e.data,e.headers,t.transformResponse),e},function(e){return o(e)||(a(t),e&&e.response&&(e.response.data=i(e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)})}},xMQ1:function(t,e,n){"use strict";e.c=a,e.a=u,e.b=function(t,e,n,r="numeric"){if(!Array.isArray(t))throw new Error(`Argument ${e} passed to ${n} must be a `+"`Tensor[]` or `TensorLike[]`");return t.map((t,i)=>u(t,`${e}[${i}]`,n,r))};var r=n("Kkag"),i=n("v/P2"),o=n("XPNO"),s=n("XFvI");
  9677. /**
  9678. * @license
  9679. * Copyright 2018 Google LLC. All Rights Reserved.
  9680. * Licensed under the Apache License, Version 2.0 (the "License");
  9681. * you may not use this file except in compliance with the License.
  9682. * You may obtain a copy of the License at
  9683. *
  9684. * http://www.apache.org/licenses/LICENSE-2.0
  9685. *
  9686. * Unless required by applicable law or agreed to in writing, software
  9687. * distributed under the License is distributed on an "AS IS" BASIS,
  9688. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9689. * See the License for the specific language governing permissions and
  9690. * limitations under the License.
  9691. * =============================================================================
  9692. */
  9693. function a(t,e){let n=t;if(Object(s.isTypedArray)(t))return"string"===e?[]:[t.length];if(!Array.isArray(t))return[];const r=[];for(;Array.isArray(n)||Object(s.isTypedArray)(n)&&"string"!==e;)r.push(n.length),n=n[0];return Array.isArray(t)&&Object(i.b)().getBool("TENSORLIKE_CHECK_SHAPE_CONSISTENCY")&&function t(e,n,r){r=r||[];if(!Array.isArray(e)&&!Object(s.isTypedArray)(e))return void Object(s.assert)(0===n.length,()=>`Element arr[${r.join("][")}] is a primitive, `+`but should be an array/TypedArray of ${n[0]} elements`);Object(s.assert)(n.length>0,()=>`Element arr[${r.join("][")}] should be a primitive, `+`but is an array of ${e.length} elements`);Object(s.assert)(e.length===n[0],()=>`Element arr[${r.join("][")}] should have ${n[0]} `+`elements, but has ${e.length} elements`);const i=n.slice(1);for(let n=0;n<e.length;++n)t(e[n],i,r.concat(n))}(t,r,[]),r}function l(t,e,n,r){if("string_or_numeric"!==t){if(null==t)throw new Error("Expected dtype cannot be null.");if("numeric"!==t&&t!==e||"numeric"===t&&"string"===e)throw new Error(`Argument '${n}' passed to '${r}' must `+`be ${t} tensor, but got ${e} tensor`)}}function u(t,e,n,i="numeric"){if(t instanceof o.a)return l(i,t.dtype,e,n),t;let u=Object(s.inferDtype)(t);if("string"!==u&&["bool","int32","float32"].indexOf(i)>=0&&(u=i),l(i,u,e,n),null==t||!Object(s.isTypedArray)(t)&&!Array.isArray(t)&&"number"!=typeof t&&"boolean"!=typeof t&&"string"!=typeof t){const r=null==t?"null":t.constructor.name;throw new Error(`Argument '${e}' passed to '${n}' must be a `+`Tensor or TensorLike, but got '${r}'`)}const c=a(t,u);Object(s.isTypedArray)(t)||Array.isArray(t)||(t=[t]);const h="string"!==u?Object(s.toTypedArray)(t,u):Object(s.flatten)(t,[],!0);return r.a.makeTensor(h,c,u)}},xnUL:function(t,e,n){var r,i,o,s;s=function(t){
  9694. /**
  9695. * @license
  9696. * Copyright 2019 Google LLC
  9697. * SPDX-License-Identifier: Apache-2.0
  9698. */
  9699. "use strict";return t.setLocale=function(e){t.Msg=t.Msg||{},Object.keys(e).forEach(function(n){t.Msg[n]=e[n]})},t},i=[n("/dHd")],void 0===(o="function"==typeof(r=s)?r.apply(e,i):r)||(t.exports=o)},xnc9:function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},xnen:function(t,e,n){"use strict";e.a=
  9700. /**
  9701. * @license
  9702. * Copyright 2020 Google Inc. All Rights Reserved.
  9703. * Licensed under the Apache License, Version 2.0 (the "License");
  9704. * you may not use this file except in compliance with the License.
  9705. * You may obtain a copy of the License at
  9706. *
  9707. * http://www.apache.org/licenses/LICENSE-2.0
  9708. *
  9709. * Unless required by applicable law or agreed to in writing, software
  9710. * distributed under the License is distributed on an "AS IS" BASIS,
  9711. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9712. * See the License for the specific language governing permissions and
  9713. * limitations under the License.
  9714. * =============================================================================
  9715. */
  9716. function(t,e=!1){console.log(t.toString(e))}},"y+7x":function(t,e,n){"use strict";e.__esModule=!0;var r=n("urW8");e.default={methods:{t:function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];return r.t.apply(this,e)}}}},yUki:function(t,e,n){var r,i,o,s;s=function(t){return(t={Msg:{}}).Msg.ADD_COMMENT="Add Comment",t.Msg.CANNOT_DELETE_VARIABLE_PROCEDURE="Can't delete the variable '%1' because it's part of the definition of the function '%2'",t.Msg.CHANGE_VALUE_TITLE="Change value:",t.Msg.CLEAN_UP="Clean up Blocks",t.Msg.COLLAPSED_WARNINGS_WARNING="Collapsed blocks contain warnings.",t.Msg.COLLAPSE_ALL="Collapse Blocks",t.Msg.COLLAPSE_BLOCK="Collapse Block",t.Msg.COLOUR_BLEND_COLOUR1="colour 1",t.Msg.COLOUR_BLEND_COLOUR2="colour 2",t.Msg.COLOUR_BLEND_HELPURL="https://meyerweb.com/eric/tools/color-blend/#:::rgbp",t.Msg.COLOUR_BLEND_RATIO="ratio",t.Msg.COLOUR_BLEND_TITLE="blend",t.Msg.COLOUR_BLEND_TOOLTIP="Blends two colours together with a given ratio (0.0 - 1.0).",t.Msg.COLOUR_PICKER_HELPURL="https://en.wikipedia.org/wiki/Color",t.Msg.COLOUR_PICKER_TOOLTIP="Choose a colour from the palette.",t.Msg.COLOUR_RANDOM_HELPURL="http://randomcolour.com",t.Msg.COLOUR_RANDOM_TITLE="random colour",t.Msg.COLOUR_RANDOM_TOOLTIP="Choose a colour at random.",t.Msg.COLOUR_RGB_BLUE="blue",t.Msg.COLOUR_RGB_GREEN="green",t.Msg.COLOUR_RGB_HELPURL="https://www.december.com/html/spec/colorpercompact.html",t.Msg.COLOUR_RGB_RED="red",t.Msg.COLOUR_RGB_TITLE="colour with",t.Msg.COLOUR_RGB_TOOLTIP="Create a colour with the specified amount of red, green, and blue. All values must be between 0 and 100.",t.Msg.CONTROLS_FLOW_STATEMENTS_HELPURL="https://github.com/google/blockly/wiki/Loops#loop-termination-blocks",t.Msg.CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK="break out of loop",t.Msg.CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE="continue with next iteration of loop",t.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK="Break out of the containing loop.",t.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE="Skip the rest of this loop, and continue with the next iteration.",t.Msg.CONTROLS_FLOW_STATEMENTS_WARNING="Warning: This block may only be used within a loop.",t.Msg.CONTROLS_FOREACH_HELPURL="https://github.com/google/blockly/wiki/Loops#for-each",t.Msg.CONTROLS_FOREACH_TITLE="for each item %1 in list %2",t.Msg.CONTROLS_FOREACH_TOOLTIP="For each item in a list, set the variable '%1' to the item, and then do some statements.",t.Msg.CONTROLS_FOR_HELPURL="https://github.com/google/blockly/wiki/Loops#count-with",t.Msg.CONTROLS_FOR_TITLE="count with %1 from %2 to %3 by %4",t.Msg.CONTROLS_FOR_TOOLTIP="Have the variable '%1' take on the values from the start number to the end number, counting by the specified interval, and do the specified blocks.",t.Msg.CONTROLS_IF_ELSEIF_TOOLTIP="Add a condition to the if block.",t.Msg.CONTROLS_IF_ELSE_TOOLTIP="Add a final, catch-all condition to the if block.",t.Msg.CONTROLS_IF_HELPURL="https://github.com/google/blockly/wiki/IfElse",t.Msg.CONTROLS_IF_IF_TOOLTIP="Add, remove, or reorder sections to reconfigure this if block.",t.Msg.CONTROLS_IF_MSG_ELSE="else",t.Msg.CONTROLS_IF_MSG_ELSEIF="else if",t.Msg.CONTROLS_IF_MSG_IF="if",t.Msg.CONTROLS_IF_TOOLTIP_1="If a value is true, then do some statements.",t.Msg.CONTROLS_IF_TOOLTIP_2="If a value is true, then do the first block of statements. Otherwise, do the second block of statements.",t.Msg.CONTROLS_IF_TOOLTIP_3="If the first value is true, then do the first block of statements. Otherwise, if the second value is true, do the second block of statements.",t.Msg.CONTROLS_IF_TOOLTIP_4="If the first value is true, then do the first block of statements. Otherwise, if the second value is true, do the second block of statements. If none of the values are true, do the last block of statements.",t.Msg.CONTROLS_REPEAT_HELPURL="https://en.wikipedia.org/wiki/For_loop",t.Msg.CONTROLS_REPEAT_INPUT_DO="do",t.Msg.CONTROLS_REPEAT_TITLE="repeat %1 times",t.Msg.CONTROLS_REPEAT_TOOLTIP="Do some statements several times.",t.Msg.CONTROLS_WHILEUNTIL_HELPURL="https://github.com/google/blockly/wiki/Loops#repeat",t.Msg.CONTROLS_WHILEUNTIL_OPERATOR_UNTIL="repeat until",t.Msg.CONTROLS_WHILEUNTIL_OPERATOR_WHILE="repeat while",t.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL="While a value is false, then do some statements.",t.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE="While a value is true, then do some statements.",t.Msg.DELETE_ALL_BLOCKS="Delete all %1 blocks?",t.Msg.DELETE_BLOCK="Delete Block",t.Msg.DELETE_VARIABLE="Delete the '%1' variable",t.Msg.DELETE_VARIABLE_CONFIRMATION="Delete %1 uses of the '%2' variable?",t.Msg.DELETE_X_BLOCKS="Delete %1 Blocks",t.Msg.DISABLE_BLOCK="Disable Block",t.Msg.DUPLICATE_BLOCK="Duplicate",t.Msg.DUPLICATE_COMMENT="Duplicate Comment",t.Msg.ENABLE_BLOCK="Enable Block",t.Msg.EXPAND_ALL="Expand Blocks",t.Msg.EXPAND_BLOCK="Expand Block",t.Msg.EXTERNAL_INPUTS="External Inputs",t.Msg.HELP="Help",t.Msg.INLINE_INPUTS="Inline Inputs",t.Msg.IOS_CANCEL="Cancel",t.Msg.IOS_ERROR="Error",t.Msg.IOS_OK="OK",t.Msg.IOS_PROCEDURES_ADD_INPUT="+ Add Input",t.Msg.IOS_PROCEDURES_ALLOW_STATEMENTS="Allow statements",t.Msg.IOS_PROCEDURES_DUPLICATE_INPUTS_ERROR="This function has duplicate inputs.",t.Msg.IOS_PROCEDURES_INPUTS="INPUTS",t.Msg.IOS_VARIABLES_ADD_BUTTON="Add",t.Msg.IOS_VARIABLES_ADD_VARIABLE="+ Add Variable",t.Msg.IOS_VARIABLES_DELETE_BUTTON="Delete",t.Msg.IOS_VARIABLES_EMPTY_NAME_ERROR="You can't use an empty variable name.",t.Msg.IOS_VARIABLES_RENAME_BUTTON="Rename",t.Msg.IOS_VARIABLES_VARIABLE_NAME="Variable name",t.Msg.LISTS_CREATE_EMPTY_HELPURL="https://github.com/google/blockly/wiki/Lists#create-empty-list",t.Msg.LISTS_CREATE_EMPTY_TITLE="create empty list",t.Msg.LISTS_CREATE_EMPTY_TOOLTIP="Returns a list, of length 0, containing no data records",t.Msg.LISTS_CREATE_WITH_CONTAINER_TITLE_ADD="list",t.Msg.LISTS_CREATE_WITH_CONTAINER_TOOLTIP="Add, remove, or reorder sections to reconfigure this list block.",t.Msg.LISTS_CREATE_WITH_HELPURL="https://github.com/google/blockly/wiki/Lists#create-list-with",t.Msg.LISTS_CREATE_WITH_INPUT_WITH="create list with",t.Msg.LISTS_CREATE_WITH_ITEM_TOOLTIP="Add an item to the list.",t.Msg.LISTS_CREATE_WITH_TOOLTIP="Create a list with any number of items.",t.Msg.LISTS_GET_INDEX_FIRST="first",t.Msg.LISTS_GET_INDEX_FROM_END="# from end",t.Msg.LISTS_GET_INDEX_FROM_START="#",t.Msg.LISTS_GET_INDEX_GET="get",t.Msg.LISTS_GET_INDEX_GET_REMOVE="get and remove",t.Msg.LISTS_GET_INDEX_LAST="last",t.Msg.LISTS_GET_INDEX_RANDOM="random",t.Msg.LISTS_GET_INDEX_REMOVE="remove",t.Msg.LISTS_GET_INDEX_TAIL="",t.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FIRST="Returns the first item in a list.",t.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM="Returns the item at the specified position in a list.",t.Msg.LISTS_GET_INDEX_TOOLTIP_GET_LAST="Returns the last item in a list.",t.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM="Returns a random item in a list.",t.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FIRST="Removes and returns the first item in a list.",t.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM="Removes and returns the item at the specified position in a list.",t.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_LAST="Removes and returns the last item in a list.",t.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM="Removes and returns a random item in a list.",t.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FIRST="Removes the first item in a list.",t.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FROM="Removes the item at the specified position in a list.",t.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_LAST="Removes the last item in a list.",t.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_RANDOM="Removes a random item in a list.",t.Msg.LISTS_GET_SUBLIST_END_FROM_END="to # from end",t.Msg.LISTS_GET_SUBLIST_END_FROM_START="to #",t.Msg.LISTS_GET_SUBLIST_END_LAST="to last",t.Msg.LISTS_GET_SUBLIST_HELPURL="https://github.com/google/blockly/wiki/Lists#getting-a-sublist",t.Msg.LISTS_GET_SUBLIST_START_FIRST="get sub-list from first",t.Msg.LISTS_GET_SUBLIST_START_FROM_END="get sub-list from # from end",t.Msg.LISTS_GET_SUBLIST_START_FROM_START="get sub-list from #",t.Msg.LISTS_GET_SUBLIST_TAIL="",t.Msg.LISTS_GET_SUBLIST_TOOLTIP="Creates a copy of the specified portion of a list.",t.Msg.LISTS_INDEX_FROM_END_TOOLTIP="%1 is the last item.",t.Msg.LISTS_INDEX_FROM_START_TOOLTIP="%1 is the first item.",t.Msg.LISTS_INDEX_OF_FIRST="find first occurrence of item",t.Msg.LISTS_INDEX_OF_HELPURL="https://github.com/google/blockly/wiki/Lists#getting-items-from-a-list",t.Msg.LISTS_INDEX_OF_LAST="find last occurrence of item",t.Msg.LISTS_INDEX_OF_TOOLTIP="Returns the index of the first/last occurrence of the item in the list. Returns %1 if item is not found.",t.Msg.LISTS_INLIST="in list",t.Msg.LISTS_ISEMPTY_HELPURL="https://github.com/google/blockly/wiki/Lists#is-empty",t.Msg.LISTS_ISEMPTY_TITLE="%1 is empty",t.Msg.LISTS_ISEMPTY_TOOLTIP="Returns true if the list is empty.",t.Msg.LISTS_LENGTH_HELPURL="https://github.com/google/blockly/wiki/Lists#length-of",t.Msg.LISTS_LENGTH_TITLE="length of %1",t.Msg.LISTS_LENGTH_TOOLTIP="Returns the length of a list.",t.Msg.LISTS_REPEAT_HELPURL="https://github.com/google/blockly/wiki/Lists#create-list-with",t.Msg.LISTS_REPEAT_TITLE="create list with item %1 repeated %2 times",t.Msg.LISTS_REPEAT_TOOLTIP="Creates a list consisting of the given value repeated the specified number of times.",t.Msg.LISTS_REVERSE_HELPURL="https://github.com/google/blockly/wiki/Lists#reversing-a-list",t.Msg.LISTS_REVERSE_MESSAGE0="reverse %1",t.Msg.LISTS_REVERSE_TOOLTIP="Reverse a copy of a list.",t.Msg.LISTS_SET_INDEX_HELPURL="https://github.com/google/blockly/wiki/Lists#in-list--set",t.Msg.LISTS_SET_INDEX_INPUT_TO="as",t.Msg.LISTS_SET_INDEX_INSERT="insert at",t.Msg.LISTS_SET_INDEX_SET="set",t.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FIRST="Inserts the item at the start of a list.",t.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FROM="Inserts the item at the specified position in a list.",t.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_LAST="Append the item to the end of a list.",t.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_RANDOM="Inserts the item randomly in a list.",t.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FIRST="Sets the first item in a list.",t.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM="Sets the item at the specified position in a list.",t.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST="Sets the last item in a list.",t.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM="Sets a random item in a list.",t.Msg.LISTS_SORT_HELPURL="https://github.com/google/blockly/wiki/Lists#sorting-a-list",t.Msg.LISTS_SORT_ORDER_ASCENDING="ascending",t.Msg.LISTS_SORT_ORDER_DESCENDING="descending",t.Msg.LISTS_SORT_TITLE="sort %1 %2 %3",t.Msg.LISTS_SORT_TOOLTIP="Sort a copy of a list.",t.Msg.LISTS_SORT_TYPE_IGNORECASE="alphabetic, ignore case",t.Msg.LISTS_SORT_TYPE_NUMERIC="numeric",t.Msg.LISTS_SORT_TYPE_TEXT="alphabetic",t.Msg.LISTS_SPLIT_HELPURL="https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists",t.Msg.LISTS_SPLIT_LIST_FROM_TEXT="make list from text",t.Msg.LISTS_SPLIT_TEXT_FROM_LIST="make text from list",t.Msg.LISTS_SPLIT_TOOLTIP_JOIN="Join a list of texts into one text, separated by a delimiter.",t.Msg.LISTS_SPLIT_TOOLTIP_SPLIT="Split text into a list of texts, breaking at each delimiter.",t.Msg.LISTS_SPLIT_WITH_DELIMITER="with delimiter",t.Msg.LOGIC_BOOLEAN_FALSE="false",t.Msg.LOGIC_BOOLEAN_HELPURL="https://github.com/google/blockly/wiki/Logic#values",t.Msg.LOGIC_BOOLEAN_TOOLTIP="Returns either true or false.",t.Msg.LOGIC_BOOLEAN_TRUE="true",t.Msg.LOGIC_COMPARE_HELPURL="https://en.wikipedia.org/wiki/Inequality_(mathematics)",t.Msg.LOGIC_COMPARE_TOOLTIP_EQ="Return true if both inputs equal each other.",t.Msg.LOGIC_COMPARE_TOOLTIP_GT="Return true if the first input is greater than the second input.",t.Msg.LOGIC_COMPARE_TOOLTIP_GTE="Return true if the first input is greater than or equal to the second input.",t.Msg.LOGIC_COMPARE_TOOLTIP_LT="Return true if the first input is smaller than the second input.",t.Msg.LOGIC_COMPARE_TOOLTIP_LTE="Return true if the first input is smaller than or equal to the second input.",t.Msg.LOGIC_COMPARE_TOOLTIP_NEQ="Return true if both inputs are not equal to each other.",t.Msg.LOGIC_NEGATE_HELPURL="https://github.com/google/blockly/wiki/Logic#not",t.Msg.LOGIC_NEGATE_TITLE="not %1",t.Msg.LOGIC_NEGATE_TOOLTIP="Returns true if the input is false. Returns false if the input is true.",t.Msg.LOGIC_NULL="null",t.Msg.LOGIC_NULL_HELPURL="https://en.wikipedia.org/wiki/Nullable_type",t.Msg.LOGIC_NULL_TOOLTIP="Returns null.",t.Msg.LOGIC_OPERATION_AND="and",t.Msg.LOGIC_OPERATION_HELPURL="https://github.com/google/blockly/wiki/Logic#logical-operations",t.Msg.LOGIC_OPERATION_OR="or",t.Msg.LOGIC_OPERATION_TOOLTIP_AND="Return true if both inputs are true.",t.Msg.LOGIC_OPERATION_TOOLTIP_OR="Return true if at least one of the inputs is true.",t.Msg.LOGIC_TERNARY_CONDITION="test",t.Msg.LOGIC_TERNARY_HELPURL="https://en.wikipedia.org/wiki/%3F:",t.Msg.LOGIC_TERNARY_IF_FALSE="if false",t.Msg.LOGIC_TERNARY_IF_TRUE="if true",t.Msg.LOGIC_TERNARY_TOOLTIP="Check the condition in 'test'. If the condition is true, returns the 'if true' value; otherwise returns the 'if false' value.",t.Msg.MATH_ADDITION_SYMBOL="+",t.Msg.MATH_ARITHMETIC_HELPURL="https://en.wikipedia.org/wiki/Arithmetic",t.Msg.MATH_ARITHMETIC_TOOLTIP_ADD="Return the sum of the two numbers.",t.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE="Return the quotient of the two numbers.",t.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS="Return the difference of the two numbers.",t.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY="Return the product of the two numbers.",t.Msg.MATH_ARITHMETIC_TOOLTIP_POWER="Return the first number raised to the power of the second number.",t.Msg.MATH_ATAN2_HELPURL="https://en.wikipedia.org/wiki/Atan2",t.Msg.MATH_ATAN2_TITLE="atan2 of X:%1 Y:%2",t.Msg.MATH_ATAN2_TOOLTIP="Return the arctangent of point (X, Y) in degrees from -180 to 180.",t.Msg.MATH_CHANGE_HELPURL="https://en.wikipedia.org/wiki/Programming_idiom#Incrementing_a_counter",t.Msg.MATH_CHANGE_TITLE="change %1 by %2",t.Msg.MATH_CHANGE_TOOLTIP="Add a number to variable '%1'.",t.Msg.MATH_CONSTANT_HELPURL="https://en.wikipedia.org/wiki/Mathematical_constant",t.Msg.MATH_CONSTANT_TOOLTIP="Return one of the common constants: π (3.141…), e (2.718…), φ (1.618…), sqrt(2) (1.414…), sqrt(½) (0.707…), or ∞ (infinity).",t.Msg.MATH_CONSTRAIN_HELPURL="https://en.wikipedia.org/wiki/Clamping_(graphics)",t.Msg.MATH_CONSTRAIN_TITLE="constrain %1 low %2 high %3",t.Msg.MATH_CONSTRAIN_TOOLTIP="Constrain a number to be between the specified limits (inclusive).",t.Msg.MATH_DIVISION_SYMBOL="÷",t.Msg.MATH_IS_DIVISIBLE_BY="is divisible by",t.Msg.MATH_IS_EVEN="is even",t.Msg.MATH_IS_NEGATIVE="is negative",t.Msg.MATH_IS_ODD="is odd",t.Msg.MATH_IS_POSITIVE="is positive",t.Msg.MATH_IS_PRIME="is prime",t.Msg.MATH_IS_TOOLTIP="Check if a number is an even, odd, prime, whole, positive, negative, or if it is divisible by certain number. Returns true or false.",t.Msg.MATH_IS_WHOLE="is whole",t.Msg.MATH_MODULO_HELPURL="https://en.wikipedia.org/wiki/Modulo_operation",t.Msg.MATH_MODULO_TITLE="remainder of %1 ÷ %2",t.Msg.MATH_MODULO_TOOLTIP="Return the remainder from dividing the two numbers.",t.Msg.MATH_MULTIPLICATION_SYMBOL="×",t.Msg.MATH_NUMBER_HELPURL="https://en.wikipedia.org/wiki/Number",t.Msg.MATH_NUMBER_TOOLTIP="A number.",t.Msg.MATH_ONLIST_HELPURL="",t.Msg.MATH_ONLIST_OPERATOR_AVERAGE="average of list",t.Msg.MATH_ONLIST_OPERATOR_MAX="max of list",t.Msg.MATH_ONLIST_OPERATOR_MEDIAN="median of list",t.Msg.MATH_ONLIST_OPERATOR_MIN="min of list",t.Msg.MATH_ONLIST_OPERATOR_MODE="modes of list",t.Msg.MATH_ONLIST_OPERATOR_RANDOM="random item of list",t.Msg.MATH_ONLIST_OPERATOR_STD_DEV="standard deviation of list",t.Msg.MATH_ONLIST_OPERATOR_SUM="sum of list",t.Msg.MATH_ONLIST_TOOLTIP_AVERAGE="Return the average (arithmetic mean) of the numeric values in the list.",t.Msg.MATH_ONLIST_TOOLTIP_MAX="Return the largest number in the list.",t.Msg.MATH_ONLIST_TOOLTIP_MEDIAN="Return the median number in the list.",t.Msg.MATH_ONLIST_TOOLTIP_MIN="Return the smallest number in the list.",t.Msg.MATH_ONLIST_TOOLTIP_MODE="Return a list of the most common item(s) in the list.",t.Msg.MATH_ONLIST_TOOLTIP_RANDOM="Return a random element from the list.",t.Msg.MATH_ONLIST_TOOLTIP_STD_DEV="Return the standard deviation of the list.",t.Msg.MATH_ONLIST_TOOLTIP_SUM="Return the sum of all the numbers in the list.",t.Msg.MATH_POWER_SYMBOL="^",t.Msg.MATH_RANDOM_FLOAT_HELPURL="https://en.wikipedia.org/wiki/Random_number_generation",t.Msg.MATH_RANDOM_FLOAT_TITLE_RANDOM="random fraction",t.Msg.MATH_RANDOM_FLOAT_TOOLTIP="Return a random fraction between 0.0 (inclusive) and 1.0 (exclusive).",t.Msg.MATH_RANDOM_INT_HELPURL="https://en.wikipedia.org/wiki/Random_number_generation",t.Msg.MATH_RANDOM_INT_TITLE="random integer from %1 to %2",t.Msg.MATH_RANDOM_INT_TOOLTIP="Return a random integer between the two specified limits, inclusive.",t.Msg.MATH_ROUND_HELPURL="https://en.wikipedia.org/wiki/Rounding",t.Msg.MATH_ROUND_OPERATOR_ROUND="round",t.Msg.MATH_ROUND_OPERATOR_ROUNDDOWN="round down",t.Msg.MATH_ROUND_OPERATOR_ROUNDUP="round up",t.Msg.MATH_ROUND_TOOLTIP="Round a number up or down.",t.Msg.MATH_SINGLE_HELPURL="https://en.wikipedia.org/wiki/Square_root",t.Msg.MATH_SINGLE_OP_ABSOLUTE="absolute",t.Msg.MATH_SINGLE_OP_ROOT="square root",t.Msg.MATH_SINGLE_TOOLTIP_ABS="Return the absolute value of a number.",t.Msg.MATH_SINGLE_TOOLTIP_EXP="Return e to the power of a number.",t.Msg.MATH_SINGLE_TOOLTIP_LN="Return the natural logarithm of a number.",t.Msg.MATH_SINGLE_TOOLTIP_LOG10="Return the base 10 logarithm of a number.",t.Msg.MATH_SINGLE_TOOLTIP_NEG="Return the negation of a number.",t.Msg.MATH_SINGLE_TOOLTIP_POW10="Return 10 to the power of a number.",t.Msg.MATH_SINGLE_TOOLTIP_ROOT="Return the square root of a number.",t.Msg.MATH_SUBTRACTION_SYMBOL="-",t.Msg.MATH_TRIG_ACOS="acos",t.Msg.MATH_TRIG_ASIN="asin",t.Msg.MATH_TRIG_ATAN="atan",t.Msg.MATH_TRIG_COS="cos",t.Msg.MATH_TRIG_HELPURL="https://en.wikipedia.org/wiki/Trigonometric_functions",t.Msg.MATH_TRIG_SIN="sin",t.Msg.MATH_TRIG_TAN="tan",t.Msg.MATH_TRIG_TOOLTIP_ACOS="Return the arccosine of a number.",t.Msg.MATH_TRIG_TOOLTIP_ASIN="Return the arcsine of a number.",t.Msg.MATH_TRIG_TOOLTIP_ATAN="Return the arctangent of a number.",t.Msg.MATH_TRIG_TOOLTIP_COS="Return the cosine of a degree (not radian).",t.Msg.MATH_TRIG_TOOLTIP_SIN="Return the sine of a degree (not radian).",t.Msg.MATH_TRIG_TOOLTIP_TAN="Return the tangent of a degree (not radian).",t.Msg.NEW_COLOUR_VARIABLE="Create colour variable...",t.Msg.NEW_NUMBER_VARIABLE="Create number variable...",t.Msg.NEW_STRING_VARIABLE="Create string variable...",t.Msg.NEW_VARIABLE="Create variable...",t.Msg.NEW_VARIABLE_TITLE="New variable name:",t.Msg.NEW_VARIABLE_TYPE_TITLE="New variable type:",t.Msg.ORDINAL_NUMBER_SUFFIX="",t.Msg.PROCEDURES_ALLOW_STATEMENTS="allow statements",t.Msg.PROCEDURES_BEFORE_PARAMS="with:",t.Msg.PROCEDURES_CALLNORETURN_HELPURL="https://en.wikipedia.org/wiki/Subroutine",t.Msg.PROCEDURES_CALLNORETURN_TOOLTIP="Run the user-defined function '%1'.",t.Msg.PROCEDURES_CALLRETURN_HELPURL="https://en.wikipedia.org/wiki/Subroutine",t.Msg.PROCEDURES_CALLRETURN_TOOLTIP="Run the user-defined function '%1' and use its output.",t.Msg.PROCEDURES_CALL_BEFORE_PARAMS="with:",t.Msg.PROCEDURES_CREATE_DO="Create '%1'",t.Msg.PROCEDURES_DEFNORETURN_COMMENT="Describe this function...",t.Msg.PROCEDURES_DEFNORETURN_DO="",t.Msg.PROCEDURES_DEFNORETURN_HELPURL="https://en.wikipedia.org/wiki/Subroutine",t.Msg.PROCEDURES_DEFNORETURN_PROCEDURE="do something",t.Msg.PROCEDURES_DEFNORETURN_TITLE="to",t.Msg.PROCEDURES_DEFNORETURN_TOOLTIP="Creates a function with no output.",t.Msg.PROCEDURES_DEFRETURN_HELPURL="https://en.wikipedia.org/wiki/Subroutine",t.Msg.PROCEDURES_DEFRETURN_RETURN="return",t.Msg.PROCEDURES_DEFRETURN_TOOLTIP="Creates a function with an output.",t.Msg.PROCEDURES_DEF_DUPLICATE_WARNING="Warning: This function has duplicate parameters.",t.Msg.PROCEDURES_HIGHLIGHT_DEF="Highlight function definition",t.Msg.PROCEDURES_IFRETURN_HELPURL="http://c2.com/cgi/wiki?GuardClause",t.Msg.PROCEDURES_IFRETURN_TOOLTIP="If a value is true, then return a second value.",t.Msg.PROCEDURES_IFRETURN_WARNING="Warning: This block may be used only within a function definition.",t.Msg.PROCEDURES_MUTATORARG_TITLE="input name:",t.Msg.PROCEDURES_MUTATORARG_TOOLTIP="Add an input to the function.",t.Msg.PROCEDURES_MUTATORCONTAINER_TITLE="inputs",t.Msg.PROCEDURES_MUTATORCONTAINER_TOOLTIP="Add, remove, or reorder inputs to this function.",t.Msg.REDO="Redo",t.Msg.REMOVE_COMMENT="Remove Comment",t.Msg.RENAME_VARIABLE="Rename variable...",t.Msg.RENAME_VARIABLE_TITLE="Rename all '%1' variables to:",t.Msg.TEXT_APPEND_HELPURL="https://github.com/google/blockly/wiki/Text#text-modification",t.Msg.TEXT_APPEND_TITLE="to %1 append text %2",t.Msg.TEXT_APPEND_TOOLTIP="Append some text to variable '%1'.",t.Msg.TEXT_CHANGECASE_HELPURL="https://github.com/google/blockly/wiki/Text#adjusting-text-case",t.Msg.TEXT_CHANGECASE_OPERATOR_LOWERCASE="to lower case",t.Msg.TEXT_CHANGECASE_OPERATOR_TITLECASE="to Title Case",t.Msg.TEXT_CHANGECASE_OPERATOR_UPPERCASE="to UPPER CASE",t.Msg.TEXT_CHANGECASE_TOOLTIP="Return a copy of the text in a different case.",t.Msg.TEXT_CHARAT_FIRST="get first letter",t.Msg.TEXT_CHARAT_FROM_END="get letter # from end",t.Msg.TEXT_CHARAT_FROM_START="get letter #",t.Msg.TEXT_CHARAT_HELPURL="https://github.com/google/blockly/wiki/Text#extracting-text",t.Msg.TEXT_CHARAT_LAST="get last letter",t.Msg.TEXT_CHARAT_RANDOM="get random letter",t.Msg.TEXT_CHARAT_TAIL="",t.Msg.TEXT_CHARAT_TITLE="in text %1 %2",t.Msg.TEXT_CHARAT_TOOLTIP="Returns the letter at the specified position.",t.Msg.TEXT_COUNT_HELPURL="https://github.com/google/blockly/wiki/Text#counting-substrings",t.Msg.TEXT_COUNT_MESSAGE0="count %1 in %2",t.Msg.TEXT_COUNT_TOOLTIP="Count how many times some text occurs within some other text.",t.Msg.TEXT_CREATE_JOIN_ITEM_TOOLTIP="Add an item to the text.",t.Msg.TEXT_CREATE_JOIN_TITLE_JOIN="join",t.Msg.TEXT_CREATE_JOIN_TOOLTIP="Add, remove, or reorder sections to reconfigure this text block.",t.Msg.TEXT_GET_SUBSTRING_END_FROM_END="to letter # from end",t.Msg.TEXT_GET_SUBSTRING_END_FROM_START="to letter #",t.Msg.TEXT_GET_SUBSTRING_END_LAST="to last letter",t.Msg.TEXT_GET_SUBSTRING_HELPURL="https://github.com/google/blockly/wiki/Text#extracting-a-region-of-text",t.Msg.TEXT_GET_SUBSTRING_INPUT_IN_TEXT="in text",t.Msg.TEXT_GET_SUBSTRING_START_FIRST="get substring from first letter",t.Msg.TEXT_GET_SUBSTRING_START_FROM_END="get substring from letter # from end",t.Msg.TEXT_GET_SUBSTRING_START_FROM_START="get substring from letter #",t.Msg.TEXT_GET_SUBSTRING_TAIL="",t.Msg.TEXT_GET_SUBSTRING_TOOLTIP="Returns a specified portion of the text.",t.Msg.TEXT_INDEXOF_HELPURL="https://github.com/google/blockly/wiki/Text#finding-text",t.Msg.TEXT_INDEXOF_OPERATOR_FIRST="find first occurrence of text",t.Msg.TEXT_INDEXOF_OPERATOR_LAST="find last occurrence of text",t.Msg.TEXT_INDEXOF_TITLE="in text %1 %2 %3",t.Msg.TEXT_INDEXOF_TOOLTIP="Returns the index of the first/last occurrence of the first text in the second text. Returns %1 if text is not found.",t.Msg.TEXT_ISEMPTY_HELPURL="https://github.com/google/blockly/wiki/Text#checking-for-empty-text",t.Msg.TEXT_ISEMPTY_TITLE="%1 is empty",t.Msg.TEXT_ISEMPTY_TOOLTIP="Returns true if the provided text is empty.",t.Msg.TEXT_JOIN_HELPURL="https://github.com/google/blockly/wiki/Text#text-creation",t.Msg.TEXT_JOIN_TITLE_CREATEWITH="create text with",t.Msg.TEXT_JOIN_TOOLTIP="Create a piece of text by joining together any number of items.",t.Msg.TEXT_LENGTH_HELPURL="https://github.com/google/blockly/wiki/Text#text-modification",t.Msg.TEXT_LENGTH_TITLE="length of %1",t.Msg.TEXT_LENGTH_TOOLTIP="Returns the number of letters (including spaces) in the provided text.",t.Msg.TEXT_PRINT_HELPURL="https://github.com/google/blockly/wiki/Text#printing-text",t.Msg.TEXT_PRINT_TITLE="print %1",t.Msg.TEXT_PRINT_TOOLTIP="Print the specified text, number or other value.",t.Msg.TEXT_PROMPT_HELPURL="https://github.com/google/blockly/wiki/Text#getting-input-from-the-user",t.Msg.TEXT_PROMPT_TOOLTIP_NUMBER="Prompt for user for a number.",t.Msg.TEXT_PROMPT_TOOLTIP_TEXT="Prompt for user for some text.",t.Msg.TEXT_PROMPT_TYPE_NUMBER="prompt for number with message",t.Msg.TEXT_PROMPT_TYPE_TEXT="prompt for text with message",t.Msg.TEXT_REPLACE_HELPURL="https://github.com/google/blockly/wiki/Text#replacing-substrings",t.Msg.TEXT_REPLACE_MESSAGE0="replace %1 with %2 in %3",t.Msg.TEXT_REPLACE_TOOLTIP="Replace all occurances of some text within some other text.",t.Msg.TEXT_REVERSE_HELPURL="https://github.com/google/blockly/wiki/Text#reversing-text",t.Msg.TEXT_REVERSE_MESSAGE0="reverse %1",t.Msg.TEXT_REVERSE_TOOLTIP="Reverses the order of the characters in the text.",t.Msg.TEXT_TEXT_HELPURL="https://en.wikipedia.org/wiki/String_(computer_science)",t.Msg.TEXT_TEXT_TOOLTIP="A letter, word, or line of text.",t.Msg.TEXT_TRIM_HELPURL="https://github.com/google/blockly/wiki/Text#trimming-removing-spaces",t.Msg.TEXT_TRIM_OPERATOR_BOTH="trim spaces from both sides of",t.Msg.TEXT_TRIM_OPERATOR_LEFT="trim spaces from left side of",t.Msg.TEXT_TRIM_OPERATOR_RIGHT="trim spaces from right side of",t.Msg.TEXT_TRIM_TOOLTIP="Return a copy of the text with spaces removed from one or both ends.",t.Msg.TODAY="Today",t.Msg.UNDO="Undo",t.Msg.UNNAMED_KEY="unnamed",t.Msg.VARIABLES_DEFAULT_NAME="item",t.Msg.VARIABLES_GET_CREATE_SET="Create 'set %1'",t.Msg.VARIABLES_GET_HELPURL="https://github.com/google/blockly/wiki/Variables#get",t.Msg.VARIABLES_GET_TOOLTIP="Returns the value of this variable.",t.Msg.VARIABLES_SET="set %1 to %2",t.Msg.VARIABLES_SET_CREATE_GET="Create 'get %1'",t.Msg.VARIABLES_SET_HELPURL="https://github.com/google/blockly/wiki/Variables#set",t.Msg.VARIABLES_SET_TOOLTIP="Sets this variable to be equal to the input.",t.Msg.VARIABLE_ALREADY_EXISTS="A variable named '%1' already exists.",t.Msg.VARIABLE_ALREADY_EXISTS_FOR_ANOTHER_TYPE="A variable named '%1' already exists for another type: '%2'.",t.Msg.WORKSPACE_ARIA_LABEL="Blockly Workspace",t.Msg.WORKSPACE_COMMENT_DEFAULT_TEXT="Say something...",t.Msg.CONTROLS_FOREACH_INPUT_DO=t.Msg.CONTROLS_REPEAT_INPUT_DO,t.Msg.CONTROLS_FOR_INPUT_DO=t.Msg.CONTROLS_REPEAT_INPUT_DO,t.Msg.CONTROLS_IF_ELSEIF_TITLE_ELSEIF=t.Msg.CONTROLS_IF_MSG_ELSEIF,t.Msg.CONTROLS_IF_ELSE_TITLE_ELSE=t.Msg.CONTROLS_IF_MSG_ELSE,t.Msg.CONTROLS_IF_IF_TITLE_IF=t.Msg.CONTROLS_IF_MSG_IF,t.Msg.CONTROLS_IF_MSG_THEN=t.Msg.CONTROLS_REPEAT_INPUT_DO,t.Msg.CONTROLS_WHILEUNTIL_INPUT_DO=t.Msg.CONTROLS_REPEAT_INPUT_DO,t.Msg.LISTS_CREATE_WITH_ITEM_TITLE=t.Msg.VARIABLES_DEFAULT_NAME,t.Msg.LISTS_GET_INDEX_HELPURL=t.Msg.LISTS_INDEX_OF_HELPURL,t.Msg.LISTS_GET_INDEX_INPUT_IN_LIST=t.Msg.LISTS_INLIST,t.Msg.LISTS_GET_SUBLIST_INPUT_IN_LIST=t.Msg.LISTS_INLIST,t.Msg.LISTS_INDEX_OF_INPUT_IN_LIST=t.Msg.LISTS_INLIST,t.Msg.LISTS_SET_INDEX_INPUT_IN_LIST=t.Msg.LISTS_INLIST,t.Msg.MATH_CHANGE_TITLE_ITEM=t.Msg.VARIABLES_DEFAULT_NAME,t.Msg.PROCEDURES_DEFRETURN_COMMENT=t.Msg.PROCEDURES_DEFNORETURN_COMMENT,t.Msg.PROCEDURES_DEFRETURN_DO=t.Msg.PROCEDURES_DEFNORETURN_DO,t.Msg.PROCEDURES_DEFRETURN_PROCEDURE=t.Msg.PROCEDURES_DEFNORETURN_PROCEDURE,t.Msg.PROCEDURES_DEFRETURN_TITLE=t.Msg.PROCEDURES_DEFNORETURN_TITLE,t.Msg.TEXT_APPEND_VARIABLE=t.Msg.VARIABLES_DEFAULT_NAME,t.Msg.TEXT_CREATE_JOIN_ITEM_TITLE_ITEM=t.Msg.VARIABLES_DEFAULT_NAME,t.Msg.MATH_HUE="230",t.Msg.LOOPS_HUE="120",t.Msg.LISTS_HUE="260",t.Msg.LOGIC_HUE="210",t.Msg.VARIABLES_HUE="330",t.Msg.TEXTS_HUE="160",t.Msg.PROCEDURES_HUE="290",t.Msg.COLOUR_HUE="20",t.Msg.VARIABLES_DYNAMIC_HUE="310",t.Msg},i=[n("xnUL")],void 0===(o="function"==typeof(r=s)?r.apply(e,i):r)||(t.exports=o)},ylDJ:function(t,e,n){"use strict";e.__esModule=!0,e.isEmpty=e.isEqual=e.arrayEquals=e.looseEqual=e.capitalize=e.kebabCase=e.autoprefixer=e.isFirefox=e.isEdge=e.isIE=e.coerceTruthyValueToArray=e.arrayFind=e.arrayFindIndex=e.escapeRegexpString=e.valueEquals=e.generateId=e.getValueByPath=void 0;var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};e.noop=function(){},e.hasOwn=function(t,e){return l.call(t,e)},e.toObject=function(t){for(var e={},n=0;n<t.length;n++)t[n]&&u(e,t[n]);return e},e.getPropByPath=function(t,e,n){for(var r=t,i=(e=(e=e.replace(/\[(\w+)\]/g,".$1")).replace(/^\./,"")).split("."),o=0,s=i.length;o<s-1&&(r||n);++o){var a=i[o];if(!(a in r)){if(n)throw new Error("please transfer a valid prop path to form item!");break}r=r[a]}return{o:r,k:i[o],v:r?r[i[o]]:null}},e.rafThrottle=function(t){var e=!1;return function(){for(var n=this,r=arguments.length,i=Array(r),o=0;o<r;o++)i[o]=arguments[o];e||(e=!0,window.requestAnimationFrame(function(r){t.apply(n,i),e=!1}))}},e.objToArray=function(t){if(Array.isArray(t))return t;return p(t)?[]:[t]};var i,o=n("7+uW"),s=(i=o)&&i.__esModule?i:{default:i},a=n("835U");var l=Object.prototype.hasOwnProperty;function u(t,e){for(var n in e)t[n]=e[n];return t}e.getValueByPath=function(t,e){for(var n=(e=e||"").split("."),r=t,i=null,o=0,s=n.length;o<s;o++){var a=n[o];if(!r)break;if(o===s-1){i=r[a];break}r=r[a]}return i};e.generateId=function(){return Math.floor(1e4*Math.random())},e.valueEquals=function(t,e){if(t===e)return!0;if(!(t instanceof Array))return!1;if(!(e instanceof Array))return!1;if(t.length!==e.length)return!1;for(var n=0;n!==t.length;++n)if(t[n]!==e[n])return!1;return!0},e.escapeRegexpString=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return String(t).replace(/[|\\{}()[\]^$+*?.]/g,"\\$&")};var c=e.arrayFindIndex=function(t,e){for(var n=0;n!==t.length;++n)if(e(t[n]))return n;return-1},h=(e.arrayFind=function(t,e){var n=c(t,e);return-1!==n?t[n]:void 0},e.coerceTruthyValueToArray=function(t){return Array.isArray(t)?t:t?[t]:[]},e.isIE=function(){return!s.default.prototype.$isServer&&!isNaN(Number(document.documentMode))},e.isEdge=function(){return!s.default.prototype.$isServer&&navigator.userAgent.indexOf("Edge")>-1},e.isFirefox=function(){return!s.default.prototype.$isServer&&!!window.navigator.userAgent.match(/firefox/i)},e.autoprefixer=function(t){if("object"!==(void 0===t?"undefined":r(t)))return t;var e=["ms-","webkit-"];return["transform","transition","animation"].forEach(function(n){var r=t[n];n&&r&&e.forEach(function(e){t[e+n]=r})}),t},e.kebabCase=function(t){var e=/([^-])([A-Z])/g;return t.replace(e,"$1-$2").replace(e,"$1-$2").toLowerCase()},e.capitalize=function(t){return(0,a.isString)(t)?t.charAt(0).toUpperCase()+t.slice(1):t},e.looseEqual=function(t,e){var n=(0,a.isObject)(t),r=(0,a.isObject)(e);return n&&r?JSON.stringify(t)===JSON.stringify(e):!n&&!r&&String(t)===String(e)}),d=e.arrayEquals=function(t,e){if(t=t||[],e=e||[],t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(!h(t[n],e[n]))return!1;return!0},p=(e.isEqual=function(t,e){return Array.isArray(t)&&Array.isArray(e)?d(t,e):h(t,e)},e.isEmpty=function(t){if(null==t)return!0;if("boolean"==typeof t)return!1;if("number"==typeof t)return!t;if(t instanceof Error)return""===t.message;switch(Object.prototype.toString.call(t)){case"[object String]":case"[object Array]":return!t.length;case"[object File]":case"[object Map]":case"[object Set]":return!t.size;case"[object Object]":return!Object.keys(t).length}return!1})},"z+gd":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){var n=function(){if("undefined"!=typeof Map)return Map;function t(t,e){var n=-1;return t.some(function(t,r){return t[0]===e&&(n=r,!0)}),n}return function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(e){var n=t(this.__entries__,e),r=this.__entries__[n];return r&&r[1]},e.prototype.set=function(e,n){var r=t(this.__entries__,e);~r?this.__entries__[r][1]=n:this.__entries__.push([e,n])},e.prototype.delete=function(e){var n=this.__entries__,r=t(n,e);~r&&n.splice(r,1)},e.prototype.has=function(e){return!!~t(this.__entries__,e)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(t,e){void 0===e&&(e=null);for(var n=0,r=this.__entries__;n<r.length;n++){var i=r[n];t.call(e,i[1],i[0])}},e}()}(),r="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,i=void 0!==t&&t.Math===Math?t:"undefined"!=typeof self&&self.Math===Math?self:"undefined"!=typeof window&&window.Math===Math?window:Function("return this")(),o="function"==typeof requestAnimationFrame?requestAnimationFrame.bind(i):function(t){return setTimeout(function(){return t(Date.now())},1e3/60)},s=2;var a=20,l=["top","right","bottom","left","width","height","size","weight"],u="undefined"!=typeof MutationObserver,c=function(){function t(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(t,e){var n=!1,r=!1,i=0;function a(){n&&(n=!1,t()),r&&u()}function l(){o(a)}function u(){var t=Date.now();if(n){if(t-i<s)return;r=!0}else n=!0,r=!1,setTimeout(l,e);i=t}return u}(this.refresh.bind(this),a)}return t.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},t.prototype.removeObserver=function(t){var e=this.observers_,n=e.indexOf(t);~n&&e.splice(n,1),!e.length&&this.connected_&&this.disconnect_()},t.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},t.prototype.updateObservers_=function(){var t=this.observers_.filter(function(t){return t.gatherActive(),t.hasActive()});return t.forEach(function(t){return t.broadcastActive()}),t.length>0},t.prototype.connect_=function(){r&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),u?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},t.prototype.disconnect_=function(){r&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},t.prototype.onTransitionEnd_=function(t){var e=t.propertyName,n=void 0===e?"":e;l.some(function(t){return!!~n.indexOf(t)})&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),h=function(t,e){for(var n=0,r=Object.keys(e);n<r.length;n++){var i=r[n];Object.defineProperty(t,i,{value:e[i],enumerable:!1,writable:!1,configurable:!0})}return t},d=function(t){return t&&t.ownerDocument&&t.ownerDocument.defaultView||i},p=_(0,0,0,0);function f(t){return parseFloat(t)||0}function g(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return e.reduce(function(e,n){return e+f(t["border-"+n+"-width"])},0)}function m(t){var e=t.clientWidth,n=t.clientHeight;if(!e&&!n)return p;var r=d(t).getComputedStyle(t),i=function(t){for(var e={},n=0,r=["top","right","bottom","left"];n<r.length;n++){var i=r[n],o=t["padding-"+i];e[i]=f(o)}return e}(r),o=i.left+i.right,s=i.top+i.bottom,a=f(r.width),l=f(r.height);if("border-box"===r.boxSizing&&(Math.round(a+o)!==e&&(a-=g(r,"left","right")+o),Math.round(l+s)!==n&&(l-=g(r,"top","bottom")+s)),!function(t){return t===d(t).document.documentElement}(t)){var u=Math.round(a+o)-e,c=Math.round(l+s)-n;1!==Math.abs(u)&&(a-=u),1!==Math.abs(c)&&(l-=c)}return _(i.left,i.top,a,l)}var v="undefined"!=typeof SVGGraphicsElement?function(t){return t instanceof d(t).SVGGraphicsElement}:function(t){return t instanceof d(t).SVGElement&&"function"==typeof t.getBBox};function b(t){return r?v(t)?function(t){var e=t.getBBox();return _(0,0,e.width,e.height)}(t):m(t):p}function _(t,e,n,r){return{x:t,y:e,width:n,height:r}}var y=function(){function t(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=_(0,0,0,0),this.target=t}return t.prototype.isActive=function(){var t=b(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},t.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},t}(),T=function(){return function(t,e){var n,r,i,o,s,a,l,u=(r=(n=e).x,i=n.y,o=n.width,s=n.height,a="undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object,l=Object.create(a.prototype),h(l,{x:r,y:i,width:o,height:s,top:i,right:r+o,bottom:s+i,left:r}),l);h(this,{target:t,contentRect:u})}}(),x=function(){function t(t,e,r){if(this.activeObservations_=[],this.observations_=new n,"function"!=typeof t)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=e,this.callbackCtx_=r}return t.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(t instanceof d(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var e=this.observations_;e.has(t)||(e.set(t,new y(t)),this.controller_.addObserver(this),this.controller_.refresh())}},t.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(t instanceof d(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var e=this.observations_;e.has(t)&&(e.delete(t),e.size||this.controller_.removeObserver(this))}},t.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},t.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(e){e.isActive()&&t.activeObservations_.push(e)})},t.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,e=this.activeObservations_.map(function(t){return new T(t.target,t.broadcastRect())});this.callback_.call(t,e,t),this.clearActive()}},t.prototype.clearActive=function(){this.activeObservations_.splice(0)},t.prototype.hasActive=function(){return this.activeObservations_.length>0},t}(),E="undefined"!=typeof WeakMap?new WeakMap:new n,w=function(){return function t(e){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=c.getInstance(),r=new x(e,n,this);E.set(this,r)}}();["observe","unobserve","disconnect"].forEach(function(t){w.prototype[t]=function(){var e;return(e=E.get(this))[t].apply(e,arguments)}});var C=void 0!==i.ResizeObserver?i.ResizeObserver:w;e.default=C}.call(e,n("DuR2"))},"zAL+":function(t,e){t.exports=function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/dist/",n(n.s=95)}({0:function(t,e,n){"use strict";function r(t,e,n,r,i,o,s,a){var l,u="function"==typeof t?t.options:t;if(e&&(u.render=e,u.staticRenderFns=n,u._compiled=!0),r&&(u.functional=!0),o&&(u._scopeId="data-v-"+o),s?(l=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(s)},u._ssrRegister=l):i&&(l=a?function(){i.call(this,this.$root.$options.shadowRoot)}:i),l)if(u.functional){u._injectStyles=l;var c=u.render;u.render=function(t,e){return l.call(e),c(t,e)}}else{var h=u.beforeCreate;u.beforeCreate=h?[].concat(h,l):[l]}return{exports:t,options:u}}n.d(e,"a",function(){return r})},95:function(t,e,n){"use strict";n.r(e);var r=function(){var t=this.$createElement;return(this._self._c||t)("div",{staticClass:"el-button-group"},[this._t("default")],2)};r._withStripped=!0;var i={name:"ElButtonGroup"},o=n(0),s=Object(o.a)(i,r,[],!1,null,null,null);s.options.__file="packages/button/src/button-group.vue";var a=s.exports;a.install=function(t){t.component(a.name,a)};e.default=a}})},zL8q:function(t,e,n){t.exports=function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/dist/",n(n.s=45)}([function(t,e){t.exports=n("AMCD")},function(t,e){t.exports=n("2kvA")},function(t,e){t.exports=n("ylDJ")},function(t,e){t.exports=n("fPll")},function(t,e){t.exports=n("y+7x")},function(t,e){t.exports=n("fKx3")},function(t,e){t.exports=n("7+uW")},function(t,e){t.exports=n("jmaC")},function(t,e){t.exports=n("HJMx")},function(t,e){t.exports=n("aW5l")},function(t,e){t.exports=n("ISYW")},function(t,e){t.exports=n("7J9s")},function(t,e){t.exports=n("urW8")},function(t,e){t.exports=n("mtrD")},function(t,e){t.exports=n("02w1")},function(t,e){t.exports=n("ON3O")},function(t,e){t.exports=n("EKTV")},function(t,e){t.exports=n("fEB+")},function(t,e){t.exports=n("835U")},function(t,e){t.exports=n("E/in")},function(t,e){t.exports=n("eNfa")},function(t,e){t.exports=n("Zcwg")},function(t,e){t.exports=n("1oZe")},function(t,e){t.exports=n("fUqW")},function(t,e){t.exports=n("nvbp")},function(t,e){t.exports=n("uY1a")},function(t,e){t.exports=n("aMwW")},function(t,e){t.exports=n("zTCi")},function(t,e){t.exports=n("zAL+")},function(t,e){t.exports=n("orbS")},function(t,e){t.exports=n("6Twh")},function(t,e){t.exports=n("s3ue")},function(t,e){t.exports=n("H8dH")},function(t,e){t.exports=n("GegP")},function(t,e){t.exports=n("hyEB")},function(t,e){t.exports=n("HzcN")},function(t,e){t.exports=n("e0Bm")},function(t,e){t.exports=n("STLj")},function(t,e){t.exports=n("3fo+")},function(t,e){t.exports=n("DQJY")},function(t,e){t.exports=n("jwfv")},function(t,e){t.exports=n("0kY3")},function(t,e){t.exports=n("kNJA")},function(t,e){t.exports=n("RDoK")},function(t,e){t.exports=n("SXzR")},function(t,e,n){t.exports=n(46)},function(t,e,n){"use strict";n.r(e);var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("ul",{staticClass:"el-pager",on:{click:t.onPagerClick}},[t.pageCount>0?n("li",{staticClass:"number",class:{active:1===t.currentPage,disabled:t.disabled}},[t._v("1")]):t._e(),t.showPrevMore?n("li",{staticClass:"el-icon more btn-quickprev",class:[t.quickprevIconClass,{disabled:t.disabled}],on:{mouseenter:function(e){t.onMouseenter("left")},mouseleave:function(e){t.quickprevIconClass="el-icon-more"}}}):t._e(),t._l(t.pagers,function(e){return n("li",{key:e,staticClass:"number",class:{active:t.currentPage===e,disabled:t.disabled}},[t._v(t._s(e))])}),t.showNextMore?n("li",{staticClass:"el-icon more btn-quicknext",class:[t.quicknextIconClass,{disabled:t.disabled}],on:{mouseenter:function(e){t.onMouseenter("right")},mouseleave:function(e){t.quicknextIconClass="el-icon-more"}}}):t._e(),t.pageCount>1?n("li",{staticClass:"number",class:{active:t.currentPage===t.pageCount,disabled:t.disabled}},[t._v(t._s(t.pageCount))]):t._e()],2)};function i(t,e,n,r,i,o,s,a){var l,u="function"==typeof t?t.options:t;if(e&&(u.render=e,u.staticRenderFns=n,u._compiled=!0),r&&(u.functional=!0),o&&(u._scopeId="data-v-"+o),s?(l=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(s)},u._ssrRegister=l):i&&(l=a?function(){i.call(this,this.$root.$options.shadowRoot)}:i),l)if(u.functional){u._injectStyles=l;var c=u.render;u.render=function(t,e){return l.call(e),c(t,e)}}else{var h=u.beforeCreate;u.beforeCreate=h?[].concat(h,l):[l]}return{exports:t,options:u}}r._withStripped=!0;var o=i({name:"ElPager",props:{currentPage:Number,pageCount:Number,pagerCount:Number,disabled:Boolean},watch:{showPrevMore:function(t){t||(this.quickprevIconClass="el-icon-more")},showNextMore:function(t){t||(this.quicknextIconClass="el-icon-more")}},methods:{onPagerClick:function(t){var e=t.target;if("UL"!==e.tagName&&!this.disabled){var n=Number(t.target.textContent),r=this.pageCount,i=this.currentPage,o=this.pagerCount-2;-1!==e.className.indexOf("more")&&(-1!==e.className.indexOf("quickprev")?n=i-o:-1!==e.className.indexOf("quicknext")&&(n=i+o)),isNaN(n)||(n<1&&(n=1),n>r&&(n=r)),n!==i&&this.$emit("change",n)}},onMouseenter:function(t){this.disabled||("left"===t?this.quickprevIconClass="el-icon-d-arrow-left":this.quicknextIconClass="el-icon-d-arrow-right")}},computed:{pagers:function(){var t=this.pagerCount,e=(t-1)/2,n=Number(this.currentPage),r=Number(this.pageCount),i=!1,o=!1;r>t&&(n>t-e&&(i=!0),n<r-e&&(o=!0));var s=[];if(i&&!o)for(var a=r-(t-2);a<r;a++)s.push(a);else if(!i&&o)for(var l=2;l<t;l++)s.push(l);else if(i&&o)for(var u=Math.floor(t/2)-1,c=n-u;c<=n+u;c++)s.push(c);else for(var h=2;h<r;h++)s.push(h);return this.showPrevMore=i,this.showNextMore=o,s}},data:function(){return{current:null,showPrevMore:!1,showNextMore:!1,quicknextIconClass:"el-icon-more",quickprevIconClass:"el-icon-more"}}},r,[],!1,null,null,null);o.options.__file="packages/pagination/src/pager.vue";var s=o.exports,a=n(36),l=n.n(a),u=n(37),c=n.n(u),h=n(8),d=n.n(h),p=n(4),f=n.n(p),g=n(2),m={name:"ElPagination",props:{pageSize:{type:Number,default:10},small:Boolean,total:Number,pageCount:Number,pagerCount:{type:Number,validator:function(t){return(0|t)===t&&t>4&&t<22&&t%2==1},default:7},currentPage:{type:Number,default:1},layout:{default:"prev, pager, next, jumper, ->, total"},pageSizes:{type:Array,default:function(){return[10,20,30,40,50,100]}},popperClass:String,prevText:String,nextText:String,background:Boolean,disabled:Boolean,hideOnSinglePage:Boolean},data:function(){return{internalCurrentPage:1,internalPageSize:0,lastEmittedPage:-1,userChangePageSize:!1}},render:function(t){var e=this.layout;if(!e)return null;if(this.hideOnSinglePage&&(!this.internalPageCount||1===this.internalPageCount))return null;var n=t("div",{class:["el-pagination",{"is-background":this.background,"el-pagination--small":this.small}]}),r={prev:t("prev"),jumper:t("jumper"),pager:t("pager",{attrs:{currentPage:this.internalCurrentPage,pageCount:this.internalPageCount,pagerCount:this.pagerCount,disabled:this.disabled},on:{change:this.handleCurrentChange}}),next:t("next"),sizes:t("sizes",{attrs:{pageSizes:this.pageSizes}}),slot:t("slot",[this.$slots.default?this.$slots.default:""]),total:t("total")},i=e.split(",").map(function(t){return t.trim()}),o=t("div",{class:"el-pagination__rightwrapper"}),s=!1;return n.children=n.children||[],o.children=o.children||[],i.forEach(function(t){"->"!==t?s?o.children.push(r[t]):n.children.push(r[t]):s=!0}),s&&n.children.unshift(o),n},components:{Prev:{render:function(t){return t("button",{attrs:{type:"button",disabled:this.$parent.disabled||this.$parent.internalCurrentPage<=1},class:"btn-prev",on:{click:this.$parent.prev}},[this.$parent.prevText?t("span",[this.$parent.prevText]):t("i",{class:"el-icon el-icon-arrow-left"})])}},Next:{render:function(t){return t("button",{attrs:{type:"button",disabled:this.$parent.disabled||this.$parent.internalCurrentPage===this.$parent.internalPageCount||0===this.$parent.internalPageCount},class:"btn-next",on:{click:this.$parent.next}},[this.$parent.nextText?t("span",[this.$parent.nextText]):t("i",{class:"el-icon el-icon-arrow-right"})])}},Sizes:{mixins:[f.a],props:{pageSizes:Array},watch:{pageSizes:{immediate:!0,handler:function(t,e){Object(g.valueEquals)(t,e)||Array.isArray(t)&&(this.$parent.internalPageSize=t.indexOf(this.$parent.pageSize)>-1?this.$parent.pageSize:this.pageSizes[0])}}},render:function(t){var e=this;return t("span",{class:"el-pagination__sizes"},[t("el-select",{attrs:{value:this.$parent.internalPageSize,popperClass:this.$parent.popperClass||"",size:"mini",disabled:this.$parent.disabled},on:{input:this.handleChange}},[this.pageSizes.map(function(n){return t("el-option",{attrs:{value:n,label:n+e.t("el.pagination.pagesize")}})})])])},components:{ElSelect:l.a,ElOption:c.a},methods:{handleChange:function(t){t!==this.$parent.internalPageSize&&(this.$parent.internalPageSize=t=parseInt(t,10),this.$parent.userChangePageSize=!0,this.$parent.$emit("update:pageSize",t),this.$parent.$emit("size-change",t))}}},Jumper:{mixins:[f.a],components:{ElInput:d.a},data:function(){return{userInput:null}},watch:{"$parent.internalCurrentPage":function(){this.userInput=null}},methods:{handleKeyup:function(t){var e=t.keyCode,n=t.target;13===e&&this.handleChange(n.value)},handleInput:function(t){this.userInput=t},handleChange:function(t){this.$parent.internalCurrentPage=this.$parent.getValidCurrentPage(t),this.$parent.emitChange(),this.userInput=null}},render:function(t){return t("span",{class:"el-pagination__jump"},[this.t("el.pagination.goto"),t("el-input",{class:"el-pagination__editor is-in-pagination",attrs:{min:1,max:this.$parent.internalPageCount,value:null!==this.userInput?this.userInput:this.$parent.internalCurrentPage,type:"number",disabled:this.$parent.disabled},nativeOn:{keyup:this.handleKeyup},on:{input:this.handleInput,change:this.handleChange}}),this.t("el.pagination.pageClassifier")])}},Total:{mixins:[f.a],render:function(t){return"number"==typeof this.$parent.total?t("span",{class:"el-pagination__total"},[this.t("el.pagination.total",{total:this.$parent.total})]):""}},Pager:s},methods:{handleCurrentChange:function(t){this.internalCurrentPage=this.getValidCurrentPage(t),this.userChangePageSize=!0,this.emitChange()},prev:function(){if(!this.disabled){var t=this.internalCurrentPage-1;this.internalCurrentPage=this.getValidCurrentPage(t),this.$emit("prev-click",this.internalCurrentPage),this.emitChange()}},next:function(){if(!this.disabled){var t=this.internalCurrentPage+1;this.internalCurrentPage=this.getValidCurrentPage(t),this.$emit("next-click",this.internalCurrentPage),this.emitChange()}},getValidCurrentPage:function(t){t=parseInt(t,10);var e=void 0;return"number"==typeof this.internalPageCount?t<1?e=1:t>this.internalPageCount&&(e=this.internalPageCount):(isNaN(t)||t<1)&&(e=1),void 0===e&&isNaN(t)?e=1:0===e&&(e=1),void 0===e?t:e},emitChange:function(){var t=this;this.$nextTick(function(){(t.internalCurrentPage!==t.lastEmittedPage||t.userChangePageSize)&&(t.$emit("current-change",t.internalCurrentPage),t.lastEmittedPage=t.internalCurrentPage,t.userChangePageSize=!1)})}},computed:{internalPageCount:function(){return"number"==typeof this.total?Math.max(1,Math.ceil(this.total/this.internalPageSize)):"number"==typeof this.pageCount?Math.max(1,this.pageCount):null}},watch:{currentPage:{immediate:!0,handler:function(t){this.internalCurrentPage=this.getValidCurrentPage(t)}},pageSize:{immediate:!0,handler:function(t){this.internalPageSize=isNaN(t)?10:t}},internalCurrentPage:{immediate:!0,handler:function(t){this.$emit("update:currentPage",t),this.lastEmittedPage=-1}},internalPageCount:function(t){var e=this.internalCurrentPage;t>0&&0===e?this.internalCurrentPage=1:e>t&&(this.internalCurrentPage=0===t?1:t,this.userChangePageSize&&this.emitChange()),this.userChangePageSize=!1}},install:function(t){t.component(m.name,m)}},v=m,b=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("transition",{attrs:{name:"dialog-fade"},on:{"after-enter":t.afterEnter,"after-leave":t.afterLeave}},[n("div",{directives:[{name:"show",rawName:"v-show",value:t.visible,expression:"visible"}],staticClass:"el-dialog__wrapper",on:{click:function(e){return e.target!==e.currentTarget?null:t.handleWrapperClick(e)}}},[n("div",{key:t.key,ref:"dialog",class:["el-dialog",{"is-fullscreen":t.fullscreen,"el-dialog--center":t.center},t.customClass],style:t.style,attrs:{role:"dialog","aria-modal":"true","aria-label":t.title||"dialog"}},[n("div",{staticClass:"el-dialog__header"},[t._t("title",[n("span",{staticClass:"el-dialog__title"},[t._v(t._s(t.title))])]),t.showClose?n("button",{staticClass:"el-dialog__headerbtn",attrs:{type:"button","aria-label":"Close"},on:{click:t.handleClose}},[n("i",{staticClass:"el-dialog__close el-icon el-icon-close"})]):t._e()],2),t.rendered?n("div",{staticClass:"el-dialog__body"},[t._t("default")],2):t._e(),t.$slots.footer?n("div",{staticClass:"el-dialog__footer"},[t._t("footer")],2):t._e()])])])};b._withStripped=!0;var _=n(11),y=n.n(_),T=n(9),x=n.n(T),E=n(3),w=n.n(E),C=i({name:"ElDialog",mixins:[y.a,w.a,x.a],props:{title:{type:String,default:""},modal:{type:Boolean,default:!0},modalAppendToBody:{type:Boolean,default:!0},appendToBody:{type:Boolean,default:!1},lockScroll:{type:Boolean,default:!0},closeOnClickModal:{type:Boolean,default:!0},closeOnPressEscape:{type:Boolean,default:!0},showClose:{type:Boolean,default:!0},width:String,fullscreen:Boolean,customClass:{type:String,default:""},top:{type:String,default:"15vh"},beforeClose:Function,center:{type:Boolean,default:!1},destroyOnClose:Boolean},data:function(){return{closed:!1,key:0}},watch:{visible:function(t){var e=this;t?(this.closed=!1,this.$emit("open"),this.$el.addEventListener("scroll",this.updatePopper),this.$nextTick(function(){e.$refs.dialog.scrollTop=0}),this.appendToBody&&document.body.appendChild(this.$el)):(this.$el.removeEventListener("scroll",this.updatePopper),this.closed||this.$emit("close"),this.destroyOnClose&&this.$nextTick(function(){e.key++}))}},computed:{style:function(){var t={};return this.fullscreen||(t.marginTop=this.top,this.width&&(t.width=this.width)),t}},methods:{getMigratingConfig:function(){return{props:{size:"size is removed."}}},handleWrapperClick:function(){this.closeOnClickModal&&this.handleClose()},handleClose:function(){"function"==typeof this.beforeClose?this.beforeClose(this.hide):this.hide()},hide:function(t){!1!==t&&(this.$emit("update:visible",!1),this.$emit("close"),this.closed=!0)},updatePopper:function(){this.broadcast("ElSelectDropdown","updatePopper"),this.broadcast("ElDropdownMenu","updatePopper")},afterEnter:function(){this.$emit("opened")},afterLeave:function(){this.$emit("closed")}},mounted:function(){this.visible&&(this.rendered=!0,this.open(),this.appendToBody&&document.body.appendChild(this.$el))},destroyed:function(){this.appendToBody&&this.$el&&this.$el.parentNode&&this.$el.parentNode.removeChild(this.$el)}},b,[],!1,null,null,null);C.options.__file="packages/dialog/src/component.vue";var S=C.exports;S.install=function(t){t.component(S.name,S)};var k=S,O=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{directives:[{name:"clickoutside",rawName:"v-clickoutside",value:t.close,expression:"close"}],staticClass:"el-autocomplete",attrs:{"aria-haspopup":"listbox",role:"combobox","aria-expanded":t.suggestionVisible,"aria-owns":t.id}},[n("el-input",t._b({ref:"input",on:{input:t.handleInput,change:t.handleChange,focus:t.handleFocus,blur:t.handleBlur,clear:t.handleClear},nativeOn:{keydown:[function(e){if(!("button"in e)&&t._k(e.keyCode,"up",38,e.key,["Up","ArrowUp"]))return null;e.preventDefault(),t.highlight(t.highlightedIndex-1)},function(e){if(!("button"in e)&&t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"]))return null;e.preventDefault(),t.highlight(t.highlightedIndex+1)},function(e){return"button"in e||!t._k(e.keyCode,"enter",13,e.key,"Enter")?t.handleKeyEnter(e):null},function(e){return"button"in e||!t._k(e.keyCode,"tab",9,e.key,"Tab")?t.close(e):null}]}},"el-input",[t.$props,t.$attrs],!1),[t.$slots.prepend?n("template",{slot:"prepend"},[t._t("prepend")],2):t._e(),t.$slots.append?n("template",{slot:"append"},[t._t("append")],2):t._e(),t.$slots.prefix?n("template",{slot:"prefix"},[t._t("prefix")],2):t._e(),t.$slots.suffix?n("template",{slot:"suffix"},[t._t("suffix")],2):t._e()],2),n("el-autocomplete-suggestions",{ref:"suggestions",class:[t.popperClass?t.popperClass:""],attrs:{"visible-arrow":"","popper-options":t.popperOptions,"append-to-body":t.popperAppendToBody,placement:t.placement,id:t.id}},t._l(t.suggestions,function(e,r){return n("li",{key:r,class:{highlighted:t.highlightedIndex===r},attrs:{id:t.id+"-item-"+r,role:"option","aria-selected":t.highlightedIndex===r},on:{click:function(n){t.select(e)}}},[t._t("default",[t._v("\n "+t._s(e[t.valueKey])+"\n ")],{item:e})],2)}),0)],1)};O._withStripped=!0;var I=n(15),R=n.n(I),A=n(10),N=n.n(A),D=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("transition",{attrs:{name:"el-zoom-in-top"},on:{"after-leave":t.doDestroy}},[n("div",{directives:[{name:"show",rawName:"v-show",value:t.showPopper,expression:"showPopper"}],staticClass:"el-autocomplete-suggestion el-popper",class:{"is-loading":!t.parent.hideLoading&&t.parent.loading},style:{width:t.dropdownWidth},attrs:{role:"region"}},[n("el-scrollbar",{attrs:{tag:"ul","wrap-class":"el-autocomplete-suggestion__wrap","view-class":"el-autocomplete-suggestion__list"}},[!t.parent.hideLoading&&t.parent.loading?n("li",[n("i",{staticClass:"el-icon-loading"})]):t._t("default")],2)],1)])};D._withStripped=!0;var M=n(5),L=n.n(M),P=n(17),F=n.n(P),B=i({components:{ElScrollbar:F.a},mixins:[L.a,w.a],componentName:"ElAutocompleteSuggestions",data:function(){return{parent:this.$parent,dropdownWidth:""}},props:{options:{default:function(){return{gpuAcceleration:!1}}},id:String},methods:{select:function(t){this.dispatch("ElAutocomplete","item-click",t)}},updated:function(){var t=this;this.$nextTick(function(e){t.popperJS&&t.updatePopper()})},mounted:function(){this.$parent.popperElm=this.popperElm=this.$el,this.referenceElm=this.$parent.$refs.input.$refs.input||this.$parent.$refs.input.$refs.textarea,this.referenceList=this.$el.querySelector(".el-autocomplete-suggestion__list"),this.referenceList.setAttribute("role","listbox"),this.referenceList.setAttribute("id",this.id)},created:function(){var t=this;this.$on("visible",function(e,n){t.dropdownWidth=n+"px",t.showPopper=e})}},D,[],!1,null,null,null);B.options.__file="packages/autocomplete/src/autocomplete-suggestions.vue";var j=B.exports,$=n(22),U=n.n($),V=i({name:"ElAutocomplete",mixins:[w.a,U()("input"),x.a],inheritAttrs:!1,componentName:"ElAutocomplete",components:{ElInput:d.a,ElAutocompleteSuggestions:j},directives:{Clickoutside:N.a},props:{valueKey:{type:String,default:"value"},popperClass:String,popperOptions:Object,placeholder:String,clearable:{type:Boolean,default:!1},disabled:Boolean,name:String,size:String,value:String,maxlength:Number,minlength:Number,autofocus:Boolean,fetchSuggestions:Function,triggerOnFocus:{type:Boolean,default:!0},customItem:String,selectWhenUnmatched:{type:Boolean,default:!1},prefixIcon:String,suffixIcon:String,label:String,debounce:{type:Number,default:300},placement:{type:String,default:"bottom-start"},hideLoading:Boolean,popperAppendToBody:{type:Boolean,default:!0},highlightFirstItem:{type:Boolean,default:!1}},data:function(){return{activated:!1,suggestions:[],loading:!1,highlightedIndex:-1,suggestionDisabled:!1}},computed:{suggestionVisible:function(){var t=this.suggestions;return(Array.isArray(t)&&t.length>0||this.loading)&&this.activated},id:function(){return"el-autocomplete-"+Object(g.generateId)()}},watch:{suggestionVisible:function(t){var e=this.getInput();e&&this.broadcast("ElAutocompleteSuggestions","visible",[t,e.offsetWidth])}},methods:{getMigratingConfig:function(){return{props:{"custom-item":"custom-item is removed, use scoped slot instead.",props:"props is removed, use value-key instead."}}},getData:function(t){var e=this;this.suggestionDisabled||(this.loading=!0,this.fetchSuggestions(t,function(t){e.loading=!1,e.suggestionDisabled||(Array.isArray(t)?(e.suggestions=t,e.highlightedIndex=e.highlightFirstItem?0:-1):console.error("[Element Error][Autocomplete]autocomplete suggestions must be an array"))}))},handleInput:function(t){if(this.$emit("input",t),this.suggestionDisabled=!1,!this.triggerOnFocus&&!t)return this.suggestionDisabled=!0,void(this.suggestions=[]);this.debouncedGetData(t)},handleChange:function(t){this.$emit("change",t)},handleFocus:function(t){this.activated=!0,this.$emit("focus",t),this.triggerOnFocus&&this.debouncedGetData(this.value)},handleBlur:function(t){this.$emit("blur",t)},handleClear:function(){this.activated=!1,this.$emit("clear")},close:function(t){this.activated=!1},handleKeyEnter:function(t){var e=this;this.suggestionVisible&&this.highlightedIndex>=0&&this.highlightedIndex<this.suggestions.length?(t.preventDefault(),this.select(this.suggestions[this.highlightedIndex])):this.selectWhenUnmatched&&(this.$emit("select",{value:this.value}),this.$nextTick(function(t){e.suggestions=[],e.highlightedIndex=-1}))},select:function(t){var e=this;this.$emit("input",t[this.valueKey]),this.$emit("select",t),this.$nextTick(function(t){e.suggestions=[],e.highlightedIndex=-1})},highlight:function(t){if(this.suggestionVisible&&!this.loading)if(t<0)this.highlightedIndex=-1;else{t>=this.suggestions.length&&(t=this.suggestions.length-1);var e=this.$refs.suggestions.$el.querySelector(".el-autocomplete-suggestion__wrap"),n=e.querySelectorAll(".el-autocomplete-suggestion__list li")[t],r=e.scrollTop,i=n.offsetTop;i+n.scrollHeight>r+e.clientHeight&&(e.scrollTop+=n.scrollHeight),i<r&&(e.scrollTop-=n.scrollHeight),this.highlightedIndex=t,this.getInput().setAttribute("aria-activedescendant",this.id+"-item-"+this.highlightedIndex)}},getInput:function(){return this.$refs.input.getInput()}},mounted:function(){var t=this;this.debouncedGetData=R()(this.debounce,this.getData),this.$on("item-click",function(e){t.select(e)});var e=this.getInput();e.setAttribute("role","textbox"),e.setAttribute("aria-autocomplete","list"),e.setAttribute("aria-controls","id"),e.setAttribute("aria-activedescendant",this.id+"-item-"+this.highlightedIndex)},beforeDestroy:function(){this.$refs.suggestions.$destroy()}},O,[],!1,null,null,null);V.options.__file="packages/autocomplete/src/autocomplete.vue";var H=V.exports;H.install=function(t){t.component(H.name,H)};var W=H,G=n(13),z=n.n(G),X=n(28),K=n.n(X),Y=i({name:"ElDropdown",componentName:"ElDropdown",mixins:[w.a,x.a],directives:{Clickoutside:N.a},components:{ElButton:z.a,ElButtonGroup:K.a},provide:function(){return{dropdown:this}},props:{trigger:{type:String,default:"hover"},type:String,size:{type:String,default:""},splitButton:Boolean,hideOnClick:{type:Boolean,default:!0},placement:{type:String,default:"bottom-end"},visibleArrow:{default:!0},showTimeout:{type:Number,default:250},hideTimeout:{type:Number,default:150},tabindex:{type:Number,default:0}},data:function(){return{timeout:null,visible:!1,triggerElm:null,menuItems:null,menuItemsArray:null,dropdownElm:null,focusing:!1,listId:"dropdown-menu-"+Object(g.generateId)()}},computed:{dropdownSize:function(){return this.size||(this.$ELEMENT||{}).size}},mounted:function(){this.$on("menu-item-click",this.handleMenuItemClick)},watch:{visible:function(t){this.broadcast("ElDropdownMenu","visible",t),this.$emit("visible-change",t)},focusing:function(t){var e=this.$el.querySelector(".el-dropdown-selfdefine");e&&(t?e.className+=" focusing":e.className=e.className.replace("focusing",""))}},methods:{getMigratingConfig:function(){return{props:{"menu-align":"menu-align is renamed to placement."}}},show:function(){var t=this;this.triggerElm.disabled||(clearTimeout(this.timeout),this.timeout=setTimeout(function(){t.visible=!0},"click"===this.trigger?0:this.showTimeout))},hide:function(){var t=this;this.triggerElm.disabled||(this.removeTabindex(),this.tabindex>=0&&this.resetTabindex(this.triggerElm),clearTimeout(this.timeout),this.timeout=setTimeout(function(){t.visible=!1},"click"===this.trigger?0:this.hideTimeout))},handleClick:function(){this.triggerElm.disabled||(this.visible?this.hide():this.show())},handleTriggerKeyDown:function(t){var e=t.keyCode;[38,40].indexOf(e)>-1?(this.removeTabindex(),this.resetTabindex(this.menuItems[0]),this.menuItems[0].focus(),t.preventDefault(),t.stopPropagation()):13===e?this.handleClick():[9,27].indexOf(e)>-1&&this.hide()},handleItemKeyDown:function(t){var e=t.keyCode,n=t.target,r=this.menuItemsArray.indexOf(n),i=this.menuItemsArray.length-1,o=void 0;[38,40].indexOf(e)>-1?(o=38===e?0!==r?r-1:0:r<i?r+1:i,this.removeTabindex(),this.resetTabindex(this.menuItems[o]),this.menuItems[o].focus(),t.preventDefault(),t.stopPropagation()):13===e?(this.triggerElmFocus(),n.click(),this.hideOnClick&&(this.visible=!1)):[9,27].indexOf(e)>-1&&(this.hide(),this.triggerElmFocus())},resetTabindex:function(t){this.removeTabindex(),t.setAttribute("tabindex","0")},removeTabindex:function(){this.triggerElm.setAttribute("tabindex","-1"),this.menuItemsArray.forEach(function(t){t.setAttribute("tabindex","-1")})},initAria:function(){this.dropdownElm.setAttribute("id",this.listId),this.triggerElm.setAttribute("aria-haspopup","list"),this.triggerElm.setAttribute("aria-controls",this.listId),this.splitButton||(this.triggerElm.setAttribute("role","button"),this.triggerElm.setAttribute("tabindex",this.tabindex),this.triggerElm.setAttribute("class",(this.triggerElm.getAttribute("class")||"")+" el-dropdown-selfdefine"))},initEvent:function(){var t=this,e=this.trigger,n=this.show,r=this.hide,i=this.handleClick,o=this.splitButton,s=this.handleTriggerKeyDown,a=this.handleItemKeyDown;this.triggerElm=o?this.$refs.trigger.$el:this.$slots.default[0].elm;var l=this.dropdownElm;this.triggerElm.addEventListener("keydown",s),l.addEventListener("keydown",a,!0),o||(this.triggerElm.addEventListener("focus",function(){t.focusing=!0}),this.triggerElm.addEventListener("blur",function(){t.focusing=!1}),this.triggerElm.addEventListener("click",function(){t.focusing=!1})),"hover"===e?(this.triggerElm.addEventListener("mouseenter",n),this.triggerElm.addEventListener("mouseleave",r),l.addEventListener("mouseenter",n),l.addEventListener("mouseleave",r)):"click"===e&&this.triggerElm.addEventListener("click",i)},handleMenuItemClick:function(t,e){this.hideOnClick&&(this.visible=!1),this.$emit("command",t,e)},triggerElmFocus:function(){this.triggerElm.focus&&this.triggerElm.focus()},initDomOperation:function(){this.dropdownElm=this.popperElm,this.menuItems=this.dropdownElm.querySelectorAll("[tabindex='-1']"),this.menuItemsArray=[].slice.call(this.menuItems),this.initEvent(),this.initAria()}},render:function(t){var e=this,n=this.hide,r=this.splitButton,i=this.type,o=this.dropdownSize,s=r?t("el-button-group",[t("el-button",{attrs:{type:i,size:o},nativeOn:{click:function(t){e.$emit("click",t),n()}}},[this.$slots.default]),t("el-button",{ref:"trigger",attrs:{type:i,size:o},class:"el-dropdown__caret-button"},[t("i",{class:"el-dropdown__icon el-icon-arrow-down"})])]):this.$slots.default;return t("div",{class:"el-dropdown",directives:[{name:"clickoutside",value:n}]},[s,this.$slots.dropdown])}},void 0,void 0,!1,null,null,null);Y.options.__file="packages/dropdown/src/dropdown.vue";var q=Y.exports;q.install=function(t){t.component(q.name,q)};var J=q,Z=function(){var t=this.$createElement,e=this._self._c||t;return e("transition",{attrs:{name:"el-zoom-in-top"},on:{"after-leave":this.doDestroy}},[e("ul",{directives:[{name:"show",rawName:"v-show",value:this.showPopper,expression:"showPopper"}],staticClass:"el-dropdown-menu el-popper",class:[this.size&&"el-dropdown-menu--"+this.size]},[this._t("default")],2)])};Z._withStripped=!0;var Q=i({name:"ElDropdownMenu",componentName:"ElDropdownMenu",mixins:[L.a],props:{visibleArrow:{type:Boolean,default:!0},arrowOffset:{type:Number,default:0}},data:function(){return{size:this.dropdown.dropdownSize}},inject:["dropdown"],created:function(){var t=this;this.$on("updatePopper",function(){t.showPopper&&t.updatePopper()}),this.$on("visible",function(e){t.showPopper=e})},mounted:function(){this.dropdown.popperElm=this.popperElm=this.$el,this.referenceElm=this.dropdown.$el,this.dropdown.initDomOperation()},watch:{"dropdown.placement":{immediate:!0,handler:function(t){this.currentPlacement=t}}}},Z,[],!1,null,null,null);Q.options.__file="packages/dropdown/src/dropdown-menu.vue";var tt=Q.exports;tt.install=function(t){t.component(tt.name,tt)};var et=tt,nt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("li",{staticClass:"el-dropdown-menu__item",class:{"is-disabled":t.disabled,"el-dropdown-menu__item--divided":t.divided},attrs:{"aria-disabled":t.disabled,tabindex:t.disabled?null:-1},on:{click:t.handleClick}},[t.icon?n("i",{class:t.icon}):t._e(),t._t("default")],2)};nt._withStripped=!0;var rt=i({name:"ElDropdownItem",mixins:[w.a],props:{command:{},disabled:Boolean,divided:Boolean,icon:String},methods:{handleClick:function(t){this.dispatch("ElDropdown","menu-item-click",[this.command,this])}}},nt,[],!1,null,null,null);rt.options.__file="packages/dropdown/src/dropdown-item.vue";var it=rt.exports;it.install=function(t){t.component(it.name,it)};var ot=it,st=st||{};st.Utils=st.Utils||{},st.Utils.focusFirstDescendant=function(t){for(var e=0;e<t.childNodes.length;e++){var n=t.childNodes[e];if(st.Utils.attemptFocus(n)||st.Utils.focusFirstDescendant(n))return!0}return!1},st.Utils.focusLastDescendant=function(t){for(var e=t.childNodes.length-1;e>=0;e--){var n=t.childNodes[e];if(st.Utils.attemptFocus(n)||st.Utils.focusLastDescendant(n))return!0}return!1},st.Utils.attemptFocus=function(t){if(!st.Utils.isFocusable(t))return!1;st.Utils.IgnoreUtilFocusChanges=!0;try{t.focus()}catch(t){}return st.Utils.IgnoreUtilFocusChanges=!1,document.activeElement===t},st.Utils.isFocusable=function(t){if(t.tabIndex>0||0===t.tabIndex&&null!==t.getAttribute("tabIndex"))return!0;if(t.disabled)return!1;switch(t.nodeName){case"A":return!!t.href&&"ignore"!==t.rel;case"INPUT":return"hidden"!==t.type&&"file"!==t.type;case"BUTTON":case"SELECT":case"TEXTAREA":return!0;default:return!1}},st.Utils.triggerEvent=function(t,e){var n=void 0;n=/^mouse|click/.test(e)?"MouseEvents":/^key/.test(e)?"KeyboardEvent":"HTMLEvents";for(var r=document.createEvent(n),i=arguments.length,o=Array(i>2?i-2:0),s=2;s<i;s++)o[s-2]=arguments[s];return r.initEvent.apply(r,[e].concat(o)),t.dispatchEvent?t.dispatchEvent(r):t.fireEvent("on"+e,r),t},st.Utils.keys={tab:9,enter:13,space:32,left:37,up:38,right:39,down:40,esc:27};var at=st.Utils,lt=function(t,e){this.domNode=e,this.parent=t,this.subMenuItems=[],this.subIndex=0,this.init()};lt.prototype.init=function(){this.subMenuItems=this.domNode.querySelectorAll("li"),this.addListeners()},lt.prototype.gotoSubIndex=function(t){t===this.subMenuItems.length?t=0:t<0&&(t=this.subMenuItems.length-1),this.subMenuItems[t].focus(),this.subIndex=t},lt.prototype.addListeners=function(){var t=this,e=at.keys,n=this.parent.domNode;Array.prototype.forEach.call(this.subMenuItems,function(r){r.addEventListener("keydown",function(r){var i=!1;switch(r.keyCode){case e.down:t.gotoSubIndex(t.subIndex+1),i=!0;break;case e.up:t.gotoSubIndex(t.subIndex-1),i=!0;break;case e.tab:at.triggerEvent(n,"mouseleave");break;case e.enter:case e.space:i=!0,r.currentTarget.click()}return i&&(r.preventDefault(),r.stopPropagation()),!1})})};var ut=lt,ct=function(t){this.domNode=t,this.submenu=null,this.init()};ct.prototype.init=function(){this.domNode.setAttribute("tabindex","0");var t=this.domNode.querySelector(".el-menu");t&&(this.submenu=new ut(this,t)),this.addListeners()},ct.prototype.addListeners=function(){var t=this,e=at.keys;this.domNode.addEventListener("keydown",function(n){var r=!1;switch(n.keyCode){case e.down:at.triggerEvent(n.currentTarget,"mouseenter"),t.submenu&&t.submenu.gotoSubIndex(0),r=!0;break;case e.up:at.triggerEvent(n.currentTarget,"mouseenter"),t.submenu&&t.submenu.gotoSubIndex(t.submenu.subMenuItems.length-1),r=!0;break;case e.tab:at.triggerEvent(n.currentTarget,"mouseleave");break;case e.enter:case e.space:r=!0,n.currentTarget.click()}r&&n.preventDefault()})};var ht=ct,dt=function(t){this.domNode=t,this.init()};dt.prototype.init=function(){var t=this.domNode.childNodes;[].filter.call(t,function(t){return 1===t.nodeType}).forEach(function(t){new ht(t)})};var pt=dt,ft=n(1),gt=i({name:"ElMenu",render:function(t){var e=t("ul",{attrs:{role:"menubar"},key:+this.collapse,style:{backgroundColor:this.backgroundColor||""},class:{"el-menu--horizontal":"horizontal"===this.mode,"el-menu--collapse":this.collapse,"el-menu":!0}},[this.$slots.default]);return this.collapseTransition?t("el-menu-collapse-transition",[e]):e},componentName:"ElMenu",mixins:[w.a,x.a],provide:function(){return{rootMenu:this}},components:{"el-menu-collapse-transition":{functional:!0,render:function(t,e){return t("transition",{props:{mode:"out-in"},on:{beforeEnter:function(t){t.style.opacity=.2},enter:function(t){Object(ft.addClass)(t,"el-opacity-transition"),t.style.opacity=1},afterEnter:function(t){Object(ft.removeClass)(t,"el-opacity-transition"),t.style.opacity=""},beforeLeave:function(t){t.dataset||(t.dataset={}),Object(ft.hasClass)(t,"el-menu--collapse")?(Object(ft.removeClass)(t,"el-menu--collapse"),t.dataset.oldOverflow=t.style.overflow,t.dataset.scrollWidth=t.clientWidth,Object(ft.addClass)(t,"el-menu--collapse")):(Object(ft.addClass)(t,"el-menu--collapse"),t.dataset.oldOverflow=t.style.overflow,t.dataset.scrollWidth=t.clientWidth,Object(ft.removeClass)(t,"el-menu--collapse")),t.style.width=t.scrollWidth+"px",t.style.overflow="hidden"},leave:function(t){Object(ft.addClass)(t,"horizontal-collapse-transition"),t.style.width=t.dataset.scrollWidth+"px"}}},e.children)}}},props:{mode:{type:String,default:"vertical"},defaultActive:{type:String,default:""},defaultOpeneds:Array,uniqueOpened:Boolean,router:Boolean,menuTrigger:{type:String,default:"hover"},collapse:Boolean,backgroundColor:String,textColor:String,activeTextColor:String,collapseTransition:{type:Boolean,default:!0}},data:function(){return{activeIndex:this.defaultActive,openedMenus:this.defaultOpeneds&&!this.collapse?this.defaultOpeneds.slice(0):[],items:{},submenus:{}}},computed:{hoverBackground:function(){return this.backgroundColor?this.mixColor(this.backgroundColor,.2):""},isMenuPopup:function(){return"horizontal"===this.mode||"vertical"===this.mode&&this.collapse}},watch:{defaultActive:function(t){this.items[t]||(this.activeIndex=null),this.updateActiveIndex(t)},defaultOpeneds:function(t){this.collapse||(this.openedMenus=t)},collapse:function(t){t&&(this.openedMenus=[]),this.broadcast("ElSubmenu","toggle-collapse",t)}},methods:{updateActiveIndex:function(t){var e=this.items[t]||this.items[this.activeIndex]||this.items[this.defaultActive];e?(this.activeIndex=e.index,this.initOpenedMenu()):this.activeIndex=null},getMigratingConfig:function(){return{props:{theme:"theme is removed."}}},getColorChannels:function(t){if(t=t.replace("#",""),/^[0-9a-fA-F]{3}$/.test(t)){t=t.split("");for(var e=2;e>=0;e--)t.splice(e,0,t[e]);t=t.join("")}return/^[0-9a-fA-F]{6}$/.test(t)?{red:parseInt(t.slice(0,2),16),green:parseInt(t.slice(2,4),16),blue:parseInt(t.slice(4,6),16)}:{red:255,green:255,blue:255}},mixColor:function(t,e){var n=this.getColorChannels(t),r=n.red,i=n.green,o=n.blue;return e>0?(r*=1-e,i*=1-e,o*=1-e):(r+=(255-r)*e,i+=(255-i)*e,o+=(255-o)*e),"rgb("+Math.round(r)+", "+Math.round(i)+", "+Math.round(o)+")"},addItem:function(t){this.$set(this.items,t.index,t)},removeItem:function(t){delete this.items[t.index]},addSubmenu:function(t){this.$set(this.submenus,t.index,t)},removeSubmenu:function(t){delete this.submenus[t.index]},openMenu:function(t,e){var n=this.openedMenus;-1===n.indexOf(t)&&(this.uniqueOpened&&(this.openedMenus=n.filter(function(t){return-1!==e.indexOf(t)})),this.openedMenus.push(t))},closeMenu:function(t){var e=this.openedMenus.indexOf(t);-1!==e&&this.openedMenus.splice(e,1)},handleSubmenuClick:function(t){var e=t.index,n=t.indexPath;-1!==this.openedMenus.indexOf(e)?(this.closeMenu(e),this.$emit("close",e,n)):(this.openMenu(e,n),this.$emit("open",e,n))},handleItemClick:function(t){var e=this,n=t.index,r=t.indexPath,i=this.activeIndex,o=null!==t.index;o&&(this.activeIndex=t.index),this.$emit("select",n,r,t),("horizontal"===this.mode||this.collapse)&&(this.openedMenus=[]),this.router&&o&&this.routeToItem(t,function(t){if(e.activeIndex=i,t){if("NavigationDuplicated"===t.name)return;console.error(t)}})},initOpenedMenu:function(){var t=this,e=this.activeIndex,n=this.items[e];n&&"horizontal"!==this.mode&&!this.collapse&&n.indexPath.forEach(function(e){var n=t.submenus[e];n&&t.openMenu(e,n.indexPath)})},routeToItem:function(t,e){var n=t.route||t.index;try{this.$router.push(n,function(){},e)}catch(t){console.error(t)}},open:function(t){var e=this,n=this.submenus[t.toString()].indexPath;n.forEach(function(t){return e.openMenu(t,n)})},close:function(t){this.closeMenu(t)}},mounted:function(){this.initOpenedMenu(),this.$on("item-click",this.handleItemClick),this.$on("submenu-click",this.handleSubmenuClick),"horizontal"===this.mode&&new pt(this.$el),this.$watch("items",this.updateActiveIndex)}},void 0,void 0,!1,null,null,null);gt.options.__file="packages/menu/src/menu.vue";var mt=gt.exports;mt.install=function(t){t.component(mt.name,mt)};var vt=mt,bt=n(21),_t=n.n(bt),yt={inject:["rootMenu"],computed:{indexPath:function(){for(var t=[this.index],e=this.$parent;"ElMenu"!==e.$options.componentName;)e.index&&t.unshift(e.index),e=e.$parent;return t},parentMenu:function(){for(var t=this.$parent;t&&-1===["ElMenu","ElSubmenu"].indexOf(t.$options.componentName);)t=t.$parent;return t},paddingStyle:function(){if("vertical"!==this.rootMenu.mode)return{};var t=20,e=this.$parent;if(this.rootMenu.collapse)t=20;else for(;e&&"ElMenu"!==e.$options.componentName;)"ElSubmenu"===e.$options.componentName&&(t+=20),e=e.$parent;return{paddingLeft:t+"px"}}}},Tt={props:{transformOrigin:{type:[Boolean,String],default:!1},offset:L.a.props.offset,boundariesPadding:L.a.props.boundariesPadding,popperOptions:L.a.props.popperOptions},data:L.a.data,methods:L.a.methods,beforeDestroy:L.a.beforeDestroy,deactivated:L.a.deactivated},xt=i({name:"ElSubmenu",componentName:"ElSubmenu",mixins:[yt,w.a,Tt],components:{ElCollapseTransition:_t.a},props:{index:{type:String,required:!0},showTimeout:{type:Number,default:300},hideTimeout:{type:Number,default:300},popperClass:String,disabled:Boolean,popperAppendToBody:{type:Boolean,default:void 0}},data:function(){return{popperJS:null,timeout:null,items:{},submenus:{},mouseInChild:!1}},watch:{opened:function(t){var e=this;this.isMenuPopup&&this.$nextTick(function(t){e.updatePopper()})}},computed:{appendToBody:function(){return void 0===this.popperAppendToBody?this.isFirstLevel:this.popperAppendToBody},menuTransitionName:function(){return this.rootMenu.collapse?"el-zoom-in-left":"el-zoom-in-top"},opened:function(){return this.rootMenu.openedMenus.indexOf(this.index)>-1},active:function(){var t=!1,e=this.submenus,n=this.items;return Object.keys(n).forEach(function(e){n[e].active&&(t=!0)}),Object.keys(e).forEach(function(n){e[n].active&&(t=!0)}),t},hoverBackground:function(){return this.rootMenu.hoverBackground},backgroundColor:function(){return this.rootMenu.backgroundColor||""},activeTextColor:function(){return this.rootMenu.activeTextColor||""},textColor:function(){return this.rootMenu.textColor||""},mode:function(){return this.rootMenu.mode},isMenuPopup:function(){return this.rootMenu.isMenuPopup},titleStyle:function(){return"horizontal"!==this.mode?{color:this.textColor}:{borderBottomColor:this.active?this.rootMenu.activeTextColor?this.activeTextColor:"":"transparent",color:this.active?this.activeTextColor:this.textColor}},isFirstLevel:function(){for(var t=!0,e=this.$parent;e&&e!==this.rootMenu;){if(["ElSubmenu","ElMenuItemGroup"].indexOf(e.$options.componentName)>-1){t=!1;break}e=e.$parent}return t}},methods:{handleCollapseToggle:function(t){t?this.initPopper():this.doDestroy()},addItem:function(t){this.$set(this.items,t.index,t)},removeItem:function(t){delete this.items[t.index]},addSubmenu:function(t){this.$set(this.submenus,t.index,t)},removeSubmenu:function(t){delete this.submenus[t.index]},handleClick:function(){var t=this.rootMenu,e=this.disabled;"hover"===t.menuTrigger&&"horizontal"===t.mode||t.collapse&&"vertical"===t.mode||e||this.dispatch("ElMenu","submenu-click",this)},handleMouseenter:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.showTimeout;if("ActiveXObject"in window||"focus"!==t.type||t.relatedTarget){var r=this.rootMenu,i=this.disabled;"click"===r.menuTrigger&&"horizontal"===r.mode||!r.collapse&&"vertical"===r.mode||i||(this.dispatch("ElSubmenu","mouse-enter-child"),clearTimeout(this.timeout),this.timeout=setTimeout(function(){e.rootMenu.openMenu(e.index,e.indexPath)},n),this.appendToBody&&this.$parent.$el.dispatchEvent(new MouseEvent("mouseenter")))}},handleMouseleave:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=this.rootMenu;"click"===n.menuTrigger&&"horizontal"===n.mode||!n.collapse&&"vertical"===n.mode||(this.dispatch("ElSubmenu","mouse-leave-child"),clearTimeout(this.timeout),this.timeout=setTimeout(function(){!t.mouseInChild&&t.rootMenu.closeMenu(t.index)},this.hideTimeout),this.appendToBody&&e&&"ElSubmenu"===this.$parent.$options.name&&this.$parent.handleMouseleave(!0))},handleTitleMouseenter:function(){if("horizontal"!==this.mode||this.rootMenu.backgroundColor){var t=this.$refs["submenu-title"];t&&(t.style.backgroundColor=this.rootMenu.hoverBackground)}},handleTitleMouseleave:function(){if("horizontal"!==this.mode||this.rootMenu.backgroundColor){var t=this.$refs["submenu-title"];t&&(t.style.backgroundColor=this.rootMenu.backgroundColor||"")}},updatePlacement:function(){this.currentPlacement="horizontal"===this.mode&&this.isFirstLevel?"bottom-start":"right-start"},initPopper:function(){this.referenceElm=this.$el,this.popperElm=this.$refs.menu,this.updatePlacement()}},created:function(){var t=this;this.$on("toggle-collapse",this.handleCollapseToggle),this.$on("mouse-enter-child",function(){t.mouseInChild=!0,clearTimeout(t.timeout)}),this.$on("mouse-leave-child",function(){t.mouseInChild=!1,clearTimeout(t.timeout)})},mounted:function(){this.parentMenu.addSubmenu(this),this.rootMenu.addSubmenu(this),this.initPopper()},beforeDestroy:function(){this.parentMenu.removeSubmenu(this),this.rootMenu.removeSubmenu(this)},render:function(t){var e=this,n=this.active,r=this.opened,i=this.paddingStyle,o=this.titleStyle,s=this.backgroundColor,a=this.rootMenu,l=this.currentPlacement,u=this.menuTransitionName,c=this.mode,h=this.disabled,d=this.popperClass,p=this.$slots,f=this.isFirstLevel,g=t("transition",{attrs:{name:u}},[t("div",{ref:"menu",directives:[{name:"show",value:r}],class:["el-menu--"+c,d],on:{mouseenter:function(t){return e.handleMouseenter(t,100)},mouseleave:function(){return e.handleMouseleave(!0)},focus:function(t){return e.handleMouseenter(t,100)}}},[t("ul",{attrs:{role:"menu"},class:["el-menu el-menu--popup","el-menu--popup-"+l],style:{backgroundColor:a.backgroundColor||""}},[p.default])])]),m=t("el-collapse-transition",[t("ul",{attrs:{role:"menu"},class:"el-menu el-menu--inline",directives:[{name:"show",value:r}],style:{backgroundColor:a.backgroundColor||""}},[p.default])]),v="horizontal"===a.mode&&f||"vertical"===a.mode&&!a.collapse?"el-icon-arrow-down":"el-icon-arrow-right";return t("li",{class:{"el-submenu":!0,"is-active":n,"is-opened":r,"is-disabled":h},attrs:{role:"menuitem","aria-haspopup":"true","aria-expanded":r},on:{mouseenter:this.handleMouseenter,mouseleave:function(){return e.handleMouseleave(!1)},focus:this.handleMouseenter}},[t("div",{class:"el-submenu__title",ref:"submenu-title",on:{click:this.handleClick,mouseenter:this.handleTitleMouseenter,mouseleave:this.handleTitleMouseleave},style:[i,o,{backgroundColor:s}]},[p.title,t("i",{class:["el-submenu__icon-arrow",v]})]),this.isMenuPopup?g:m])}},void 0,void 0,!1,null,null,null);xt.options.__file="packages/menu/src/submenu.vue";var Et=xt.exports;Et.install=function(t){t.component(Et.name,Et)};var wt=Et,Ct=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("li",{staticClass:"el-menu-item",class:{"is-active":t.active,"is-disabled":t.disabled},style:[t.paddingStyle,t.itemStyle,{backgroundColor:t.backgroundColor}],attrs:{role:"menuitem",tabindex:"-1"},on:{click:t.handleClick,mouseenter:t.onMouseEnter,focus:t.onMouseEnter,blur:t.onMouseLeave,mouseleave:t.onMouseLeave}},["ElMenu"===t.parentMenu.$options.componentName&&t.rootMenu.collapse&&t.$slots.title?n("el-tooltip",{attrs:{effect:"dark",placement:"right"}},[n("div",{attrs:{slot:"content"},slot:"content"},[t._t("title")],2),n("div",{staticStyle:{position:"absolute",left:"0",top:"0",height:"100%",width:"100%",display:"inline-block","box-sizing":"border-box",padding:"0 20px"}},[t._t("default")],2)]):[t._t("default"),t._t("title")]],2)};Ct._withStripped=!0;var St=n(26),kt=n.n(St),Ot=i({name:"ElMenuItem",componentName:"ElMenuItem",mixins:[yt,w.a],components:{ElTooltip:kt.a},props:{index:{default:null,validator:function(t){return"string"==typeof t||null===t}},route:[String,Object],disabled:Boolean},computed:{active:function(){return this.index===this.rootMenu.activeIndex},hoverBackground:function(){return this.rootMenu.hoverBackground},backgroundColor:function(){return this.rootMenu.backgroundColor||""},activeTextColor:function(){return this.rootMenu.activeTextColor||""},textColor:function(){return this.rootMenu.textColor||""},mode:function(){return this.rootMenu.mode},itemStyle:function(){var t={color:this.active?this.activeTextColor:this.textColor};return"horizontal"!==this.mode||this.isNested||(t.borderBottomColor=this.active?this.rootMenu.activeTextColor?this.activeTextColor:"":"transparent"),t},isNested:function(){return this.parentMenu!==this.rootMenu}},methods:{onMouseEnter:function(){("horizontal"!==this.mode||this.rootMenu.backgroundColor)&&(this.$el.style.backgroundColor=this.hoverBackground)},onMouseLeave:function(){("horizontal"!==this.mode||this.rootMenu.backgroundColor)&&(this.$el.style.backgroundColor=this.backgroundColor)},handleClick:function(){this.disabled||(this.dispatch("ElMenu","item-click",this),this.$emit("click",this))}},mounted:function(){this.parentMenu.addItem(this),this.rootMenu.addItem(this)},beforeDestroy:function(){this.parentMenu.removeItem(this),this.rootMenu.removeItem(this)}},Ct,[],!1,null,null,null);Ot.options.__file="packages/menu/src/menu-item.vue";var It=Ot.exports;It.install=function(t){t.component(It.name,It)};var Rt=It,At=function(){var t=this.$createElement,e=this._self._c||t;return e("li",{staticClass:"el-menu-item-group"},[e("div",{staticClass:"el-menu-item-group__title",style:{paddingLeft:this.levelPadding+"px"}},[this.$slots.title?this._t("title"):[this._v(this._s(this.title))]],2),e("ul",[this._t("default")],2)])};At._withStripped=!0;var Nt=i({name:"ElMenuItemGroup",componentName:"ElMenuItemGroup",inject:["rootMenu"],props:{title:{type:String}},data:function(){return{paddingLeft:20}},computed:{levelPadding:function(){var t=20,e=this.$parent;if(this.rootMenu.collapse)return 20;for(;e&&"ElMenu"!==e.$options.componentName;)"ElSubmenu"===e.$options.componentName&&(t+=20),e=e.$parent;return t}}},At,[],!1,null,null,null);Nt.options.__file="packages/menu/src/menu-item-group.vue";var Dt=Nt.exports;Dt.install=function(t){t.component(Dt.name,Dt)};var Mt=Dt,Lt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:["textarea"===t.type?"el-textarea":"el-input",t.inputSize?"el-input--"+t.inputSize:"",{"is-disabled":t.inputDisabled,"is-exceed":t.inputExceed,"el-input-group":t.$slots.prepend||t.$slots.append,"el-input-group--append":t.$slots.append,"el-input-group--prepend":t.$slots.prepend,"el-input--prefix":t.$slots.prefix||t.prefixIcon,"el-input--suffix":t.$slots.suffix||t.suffixIcon||t.clearable||t.showPassword}],on:{mouseenter:function(e){t.hovering=!0},mouseleave:function(e){t.hovering=!1}}},["textarea"!==t.type?[t.$slots.prepend?n("div",{staticClass:"el-input-group__prepend"},[t._t("prepend")],2):t._e(),"textarea"!==t.type?n("input",t._b({ref:"input",staticClass:"el-input__inner",attrs:{tabindex:t.tabindex,type:t.showPassword?t.passwordVisible?"text":"password":t.type,disabled:t.inputDisabled,readonly:t.readonly,autocomplete:t.autoComplete||t.autocomplete,"aria-label":t.label},on:{compositionstart:t.handleCompositionStart,compositionupdate:t.handleCompositionUpdate,compositionend:t.handleCompositionEnd,input:t.handleInput,focus:t.handleFocus,blur:t.handleBlur,change:t.handleChange}},"input",t.$attrs,!1)):t._e(),t.$slots.prefix||t.prefixIcon?n("span",{staticClass:"el-input__prefix"},[t._t("prefix"),t.prefixIcon?n("i",{staticClass:"el-input__icon",class:t.prefixIcon}):t._e()],2):t._e(),t.getSuffixVisible()?n("span",{staticClass:"el-input__suffix"},[n("span",{staticClass:"el-input__suffix-inner"},[t.showClear&&t.showPwdVisible&&t.isWordLimitVisible?t._e():[t._t("suffix"),t.suffixIcon?n("i",{staticClass:"el-input__icon",class:t.suffixIcon}):t._e()],t.showClear?n("i",{staticClass:"el-input__icon el-icon-circle-close el-input__clear",on:{mousedown:function(t){t.preventDefault()},click:t.clear}}):t._e(),t.showPwdVisible?n("i",{staticClass:"el-input__icon el-icon-view el-input__clear",on:{click:t.handlePasswordVisible}}):t._e(),t.isWordLimitVisible?n("span",{staticClass:"el-input__count"},[n("span",{staticClass:"el-input__count-inner"},[t._v("\n "+t._s(t.textLength)+"/"+t._s(t.upperLimit)+"\n ")])]):t._e()],2),t.validateState?n("i",{staticClass:"el-input__icon",class:["el-input__validateIcon",t.validateIcon]}):t._e()]):t._e(),t.$slots.append?n("div",{staticClass:"el-input-group__append"},[t._t("append")],2):t._e()]:n("textarea",t._b({ref:"textarea",staticClass:"el-textarea__inner",style:t.textareaStyle,attrs:{tabindex:t.tabindex,disabled:t.inputDisabled,readonly:t.readonly,autocomplete:t.autoComplete||t.autocomplete,"aria-label":t.label},on:{compositionstart:t.handleCompositionStart,compositionupdate:t.handleCompositionUpdate,compositionend:t.handleCompositionEnd,input:t.handleInput,focus:t.handleFocus,blur:t.handleBlur,change:t.handleChange}},"textarea",t.$attrs,!1)),t.isWordLimitVisible&&"textarea"===t.type?n("span",{staticClass:"el-input__count"},[t._v(t._s(t.textLength)+"/"+t._s(t.upperLimit))]):t._e()],2)};Lt._withStripped=!0;var Pt=void 0,Ft="\n height:0 !important;\n visibility:hidden !important;\n overflow:hidden !important;\n position:absolute !important;\n z-index:-1000 !important;\n top:0 !important;\n right:0 !important\n",Bt=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing"];function jt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;Pt||(Pt=document.createElement("textarea"),document.body.appendChild(Pt));var r=function(t){var e=window.getComputedStyle(t),n=e.getPropertyValue("box-sizing"),r=parseFloat(e.getPropertyValue("padding-bottom"))+parseFloat(e.getPropertyValue("padding-top")),i=parseFloat(e.getPropertyValue("border-bottom-width"))+parseFloat(e.getPropertyValue("border-top-width"));return{contextStyle:Bt.map(function(t){return t+":"+e.getPropertyValue(t)}).join(";"),paddingSize:r,borderSize:i,boxSizing:n}}(t),i=r.paddingSize,o=r.borderSize,s=r.boxSizing,a=r.contextStyle;Pt.setAttribute("style",a+";"+Ft),Pt.value=t.value||t.placeholder||"";var l=Pt.scrollHeight,u={};"border-box"===s?l+=o:"content-box"===s&&(l-=i),Pt.value="";var c=Pt.scrollHeight-i;if(null!==e){var h=c*e;"border-box"===s&&(h=h+i+o),l=Math.max(h,l),u.minHeight=h+"px"}if(null!==n){var d=c*n;"border-box"===s&&(d=d+i+o),l=Math.min(d,l)}return u.height=l+"px",Pt.parentNode&&Pt.parentNode.removeChild(Pt),Pt=null,u}var $t=n(7),Ut=n.n($t),Vt=n(19),Ht=i({name:"ElInput",componentName:"ElInput",mixins:[w.a,x.a],inheritAttrs:!1,inject:{elForm:{default:""},elFormItem:{default:""}},data:function(){return{textareaCalcStyle:{},hovering:!1,focused:!1,isComposing:!1,passwordVisible:!1}},props:{value:[String,Number],size:String,resize:String,form:String,disabled:Boolean,readonly:Boolean,type:{type:String,default:"text"},autosize:{type:[Boolean,Object],default:!1},autocomplete:{type:String,default:"off"},autoComplete:{type:String,validator:function(t){return!0}},validateEvent:{type:Boolean,default:!0},suffixIcon:String,prefixIcon:String,label:String,clearable:{type:Boolean,default:!1},showPassword:{type:Boolean,default:!1},showWordLimit:{type:Boolean,default:!1},tabindex:String},computed:{_elFormItemSize:function(){return(this.elFormItem||{}).elFormItemSize},validateState:function(){return this.elFormItem?this.elFormItem.validateState:""},needStatusIcon:function(){return!!this.elForm&&this.elForm.statusIcon},validateIcon:function(){return{validating:"el-icon-loading",success:"el-icon-circle-check",error:"el-icon-circle-close"}[this.validateState]},textareaStyle:function(){return Ut()({},this.textareaCalcStyle,{resize:this.resize})},inputSize:function(){return this.size||this._elFormItemSize||(this.$ELEMENT||{}).size},inputDisabled:function(){return this.disabled||(this.elForm||{}).disabled},nativeInputValue:function(){return null===this.value||void 0===this.value?"":String(this.value)},showClear:function(){return this.clearable&&!this.inputDisabled&&!this.readonly&&this.nativeInputValue&&(this.focused||this.hovering)},showPwdVisible:function(){return this.showPassword&&!this.inputDisabled&&!this.readonly&&(!!this.nativeInputValue||this.focused)},isWordLimitVisible:function(){return this.showWordLimit&&this.$attrs.maxlength&&("text"===this.type||"textarea"===this.type)&&!this.inputDisabled&&!this.readonly&&!this.showPassword},upperLimit:function(){return this.$attrs.maxlength},textLength:function(){return"number"==typeof this.value?String(this.value).length:(this.value||"").length},inputExceed:function(){return this.isWordLimitVisible&&this.textLength>this.upperLimit}},watch:{value:function(t){this.$nextTick(this.resizeTextarea),this.validateEvent&&this.dispatch("ElFormItem","el.form.change",[t])},nativeInputValue:function(){this.setNativeInputValue()},type:function(){var t=this;this.$nextTick(function(){t.setNativeInputValue(),t.resizeTextarea(),t.updateIconOffset()})}},methods:{focus:function(){this.getInput().focus()},blur:function(){this.getInput().blur()},getMigratingConfig:function(){return{props:{icon:"icon is removed, use suffix-icon / prefix-icon instead.","on-icon-click":"on-icon-click is removed."},events:{click:"click is removed."}}},handleBlur:function(t){this.focused=!1,this.$emit("blur",t),this.validateEvent&&this.dispatch("ElFormItem","el.form.blur",[this.value])},select:function(){this.getInput().select()},resizeTextarea:function(){if(!this.$isServer){var t=this.autosize;if("textarea"===this.type)if(t){var e=t.minRows,n=t.maxRows;this.textareaCalcStyle=jt(this.$refs.textarea,e,n)}else this.textareaCalcStyle={minHeight:jt(this.$refs.textarea).minHeight}}},setNativeInputValue:function(){var t=this.getInput();t&&t.value!==this.nativeInputValue&&(t.value=this.nativeInputValue)},handleFocus:function(t){this.focused=!0,this.$emit("focus",t)},handleCompositionStart:function(){this.isComposing=!0},handleCompositionUpdate:function(t){var e=t.target.value,n=e[e.length-1]||"";this.isComposing=!Object(Vt.isKorean)(n)},handleCompositionEnd:function(t){this.isComposing&&(this.isComposing=!1,this.handleInput(t))},handleInput:function(t){this.isComposing||t.target.value!==this.nativeInputValue&&(this.$emit("input",t.target.value),this.$nextTick(this.setNativeInputValue))},handleChange:function(t){this.$emit("change",t.target.value)},calcIconOffset:function(t){var e=[].slice.call(this.$el.querySelectorAll(".el-input__"+t)||[]);if(e.length){for(var n=null,r=0;r<e.length;r++)if(e[r].parentNode===this.$el){n=e[r];break}if(n){var i={suffix:"append",prefix:"prepend"}[t];this.$slots[i]?n.style.transform="translateX("+("suffix"===t?"-":"")+this.$el.querySelector(".el-input-group__"+i).offsetWidth+"px)":n.removeAttribute("style")}}},updateIconOffset:function(){this.calcIconOffset("prefix"),this.calcIconOffset("suffix")},clear:function(){this.$emit("input",""),this.$emit("change",""),this.$emit("clear")},handlePasswordVisible:function(){var t=this;this.passwordVisible=!this.passwordVisible,this.$nextTick(function(){t.focus()})},getInput:function(){return this.$refs.input||this.$refs.textarea},getSuffixVisible:function(){return this.$slots.suffix||this.suffixIcon||this.showClear||this.showPassword||this.isWordLimitVisible||this.validateState&&this.needStatusIcon}},created:function(){this.$on("inputSelect",this.select)},mounted:function(){this.setNativeInputValue(),this.resizeTextarea(),this.updateIconOffset()},updated:function(){this.$nextTick(this.updateIconOffset)}},Lt,[],!1,null,null,null);Ht.options.__file="packages/input/src/input.vue";var Wt=Ht.exports;Wt.install=function(t){t.component(Wt.name,Wt)};var Gt=Wt,zt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:["el-input-number",t.inputNumberSize?"el-input-number--"+t.inputNumberSize:"",{"is-disabled":t.inputNumberDisabled},{"is-without-controls":!t.controls},{"is-controls-right":t.controlsAtRight}],on:{dragstart:function(t){t.preventDefault()}}},[t.controls?n("span",{directives:[{name:"repeat-click",rawName:"v-repeat-click",value:t.decrease,expression:"decrease"}],staticClass:"el-input-number__decrease",class:{"is-disabled":t.minDisabled},attrs:{role:"button"},on:{keydown:function(e){return"button"in e||!t._k(e.keyCode,"enter",13,e.key,"Enter")?t.decrease(e):null}}},[n("i",{class:"el-icon-"+(t.controlsAtRight?"arrow-down":"minus")})]):t._e(),t.controls?n("span",{directives:[{name:"repeat-click",rawName:"v-repeat-click",value:t.increase,expression:"increase"}],staticClass:"el-input-number__increase",class:{"is-disabled":t.maxDisabled},attrs:{role:"button"},on:{keydown:function(e){return"button"in e||!t._k(e.keyCode,"enter",13,e.key,"Enter")?t.increase(e):null}}},[n("i",{class:"el-icon-"+(t.controlsAtRight?"arrow-up":"plus")})]):t._e(),n("el-input",{ref:"input",attrs:{value:t.displayValue,placeholder:t.placeholder,disabled:t.inputNumberDisabled,size:t.inputNumberSize,max:t.max,min:t.min,name:t.name,label:t.label},on:{blur:t.handleBlur,focus:t.handleFocus,input:t.handleInput,change:t.handleInputChange},nativeOn:{keydown:[function(e){return"button"in e||!t._k(e.keyCode,"up",38,e.key,["Up","ArrowUp"])?(e.preventDefault(),t.increase(e)):null},function(e){return"button"in e||!t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"])?(e.preventDefault(),t.decrease(e)):null}]}})],1)};zt._withStripped=!0;var Xt={bind:function(t,e,n){var r=null,i=void 0,o=function(){return n.context[e.expression].apply()},s=function(){Date.now()-i<100&&o(),clearInterval(r),r=null};Object(ft.on)(t,"mousedown",function(t){0===t.button&&(i=Date.now(),Object(ft.once)(document,"mouseup",s),clearInterval(r),r=setInterval(o,100))})}},Kt=i({name:"ElInputNumber",mixins:[U()("input")],inject:{elForm:{default:""},elFormItem:{default:""}},directives:{repeatClick:Xt},components:{ElInput:d.a},props:{step:{type:Number,default:1},stepStrictly:{type:Boolean,default:!1},max:{type:Number,default:1/0},min:{type:Number,default:-1/0},value:{},disabled:Boolean,size:String,controls:{type:Boolean,default:!0},controlsPosition:{type:String,default:""},name:String,label:String,placeholder:String,precision:{type:Number,validator:function(t){return t>=0&&t===parseInt(t,10)}}},data:function(){return{currentValue:0,userInput:null}},watch:{value:{immediate:!0,handler:function(t){var e=void 0===t?t:Number(t);if(void 0!==e){if(isNaN(e))return;if(this.stepStrictly){var n=this.getPrecision(this.step),r=Math.pow(10,n);e=Math.round(e/this.step)*r*this.step/r}void 0!==this.precision&&(e=this.toPrecision(e,this.precision))}e>=this.max&&(e=this.max),e<=this.min&&(e=this.min),this.currentValue=e,this.userInput=null,this.$emit("input",e)}}},computed:{minDisabled:function(){return this._decrease(this.value,this.step)<this.min},maxDisabled:function(){return this._increase(this.value,this.step)>this.max},numPrecision:function(){var t=this.value,e=this.step,n=this.getPrecision,r=this.precision,i=n(e);return void 0!==r?(i>r&&console.warn("[Element Warn][InputNumber]precision should not be less than the decimal places of step"),r):Math.max(n(t),i)},controlsAtRight:function(){return this.controls&&"right"===this.controlsPosition},_elFormItemSize:function(){return(this.elFormItem||{}).elFormItemSize},inputNumberSize:function(){return this.size||this._elFormItemSize||(this.$ELEMENT||{}).size},inputNumberDisabled:function(){return this.disabled||!!(this.elForm||{}).disabled},displayValue:function(){if(null!==this.userInput)return this.userInput;var t=this.currentValue;if("number"==typeof t){if(this.stepStrictly){var e=this.getPrecision(this.step),n=Math.pow(10,e);t=Math.round(t/this.step)*n*this.step/n}void 0!==this.precision&&(t=t.toFixed(this.precision))}return t}},methods:{toPrecision:function(t,e){return void 0===e&&(e=this.numPrecision),parseFloat(Math.round(t*Math.pow(10,e))/Math.pow(10,e))},getPrecision:function(t){if(void 0===t)return 0;var e=t.toString(),n=e.indexOf("."),r=0;return-1!==n&&(r=e.length-n-1),r},_increase:function(t,e){if("number"!=typeof t&&void 0!==t)return this.currentValue;var n=Math.pow(10,this.numPrecision);return this.toPrecision((n*t+n*e)/n)},_decrease:function(t,e){if("number"!=typeof t&&void 0!==t)return this.currentValue;var n=Math.pow(10,this.numPrecision);return this.toPrecision((n*t-n*e)/n)},increase:function(){if(!this.inputNumberDisabled&&!this.maxDisabled){var t=this.value||0,e=this._increase(t,this.step);this.setCurrentValue(e)}},decrease:function(){if(!this.inputNumberDisabled&&!this.minDisabled){var t=this.value||0,e=this._decrease(t,this.step);this.setCurrentValue(e)}},handleBlur:function(t){this.$emit("blur",t)},handleFocus:function(t){this.$emit("focus",t)},setCurrentValue:function(t){var e=this.currentValue;"number"==typeof t&&void 0!==this.precision&&(t=this.toPrecision(t,this.precision)),t>=this.max&&(t=this.max),t<=this.min&&(t=this.min),e!==t&&(this.userInput=null,this.$emit("input",t),this.$emit("change",t,e),this.currentValue=t)},handleInput:function(t){this.userInput=t},handleInputChange:function(t){var e=""===t?void 0:Number(t);isNaN(e)&&""!==t||this.setCurrentValue(e),this.userInput=null},select:function(){this.$refs.input.select()}},mounted:function(){var t=this.$refs.input.$refs.input;t.setAttribute("role","spinbutton"),t.setAttribute("aria-valuemax",this.max),t.setAttribute("aria-valuemin",this.min),t.setAttribute("aria-valuenow",this.currentValue),t.setAttribute("aria-disabled",this.inputNumberDisabled)},updated:function(){this.$refs&&this.$refs.input&&this.$refs.input.$refs.input.setAttribute("aria-valuenow",this.currentValue)}},zt,[],!1,null,null,null);Kt.options.__file="packages/input-number/src/input-number.vue";var Yt=Kt.exports;Yt.install=function(t){t.component(Yt.name,Yt)};var qt=Yt,Jt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("label",{staticClass:"el-radio",class:[t.border&&t.radioSize?"el-radio--"+t.radioSize:"",{"is-disabled":t.isDisabled},{"is-focus":t.focus},{"is-bordered":t.border},{"is-checked":t.model===t.label}],attrs:{role:"radio","aria-checked":t.model===t.label,"aria-disabled":t.isDisabled,tabindex:t.tabIndex},on:{keydown:function(e){if(!("button"in e)&&t._k(e.keyCode,"space",32,e.key,[" ","Spacebar"]))return null;e.stopPropagation(),e.preventDefault(),t.model=t.isDisabled?t.model:t.label}}},[n("span",{staticClass:"el-radio__input",class:{"is-disabled":t.isDisabled,"is-checked":t.model===t.label}},[n("span",{staticClass:"el-radio__inner"}),n("input",{directives:[{name:"model",rawName:"v-model",value:t.model,expression:"model"}],ref:"radio",staticClass:"el-radio__original",attrs:{type:"radio","aria-hidden":"true",name:t.name,disabled:t.isDisabled,tabindex:"-1"},domProps:{value:t.label,checked:t._q(t.model,t.label)},on:{focus:function(e){t.focus=!0},blur:function(e){t.focus=!1},change:[function(e){t.model=t.label},t.handleChange]}})]),n("span",{staticClass:"el-radio__label",on:{keydown:function(t){t.stopPropagation()}}},[t._t("default"),t.$slots.default?t._e():[t._v(t._s(t.label))]],2)])};Jt._withStripped=!0;var Zt=i({name:"ElRadio",mixins:[w.a],inject:{elForm:{default:""},elFormItem:{default:""}},componentName:"ElRadio",props:{value:{},label:{},disabled:Boolean,name:String,border:Boolean,size:String},data:function(){return{focus:!1}},computed:{isGroup:function(){for(var t=this.$parent;t;){if("ElRadioGroup"===t.$options.componentName)return this._radioGroup=t,!0;t=t.$parent}return!1},model:{get:function(){return this.isGroup?this._radioGroup.value:this.value},set:function(t){this.isGroup?this.dispatch("ElRadioGroup","input",[t]):this.$emit("input",t),this.$refs.radio&&(this.$refs.radio.checked=this.model===this.label)}},_elFormItemSize:function(){return(this.elFormItem||{}).elFormItemSize},radioSize:function(){var t=this.size||this._elFormItemSize||(this.$ELEMENT||{}).size;return this.isGroup&&this._radioGroup.radioGroupSize||t},isDisabled:function(){return this.isGroup?this._radioGroup.disabled||this.disabled||(this.elForm||{}).disabled:this.disabled||(this.elForm||{}).disabled},tabIndex:function(){return this.isDisabled||this.isGroup&&this.model!==this.label?-1:0}},methods:{handleChange:function(){var t=this;this.$nextTick(function(){t.$emit("change",t.model),t.isGroup&&t.dispatch("ElRadioGroup","handleChange",t.model)})}}},Jt,[],!1,null,null,null);Zt.options.__file="packages/radio/src/radio.vue";var Qt=Zt.exports;Qt.install=function(t){t.component(Qt.name,Qt)};var te=Qt,ee=function(){var t=this.$createElement;return(this._self._c||t)(this._elTag,{tag:"component",staticClass:"el-radio-group",attrs:{role:"radiogroup"},on:{keydown:this.handleKeydown}},[this._t("default")],2)};ee._withStripped=!0;var ne=Object.freeze({LEFT:37,UP:38,RIGHT:39,DOWN:40}),re=i({name:"ElRadioGroup",componentName:"ElRadioGroup",inject:{elFormItem:{default:""}},mixins:[w.a],props:{value:{},size:String,fill:String,textColor:String,disabled:Boolean},computed:{_elFormItemSize:function(){return(this.elFormItem||{}).elFormItemSize},_elTag:function(){return(this.$vnode.data||{}).tag||"div"},radioGroupSize:function(){return this.size||this._elFormItemSize||(this.$ELEMENT||{}).size}},created:function(){var t=this;this.$on("handleChange",function(e){t.$emit("change",e)})},mounted:function(){var t=this.$el.querySelectorAll("[type=radio]"),e=this.$el.querySelectorAll("[role=radio]")[0];![].some.call(t,function(t){return t.checked})&&e&&(e.tabIndex=0)},methods:{handleKeydown:function(t){var e=t.target,n="INPUT"===e.nodeName?"[type=radio]":"[role=radio]",r=this.$el.querySelectorAll(n),i=r.length,o=[].indexOf.call(r,e),s=this.$el.querySelectorAll("[role=radio]");switch(t.keyCode){case ne.LEFT:case ne.UP:t.stopPropagation(),t.preventDefault(),0===o?(s[i-1].click(),s[i-1].focus()):(s[o-1].click(),s[o-1].focus());break;case ne.RIGHT:case ne.DOWN:o===i-1?(t.stopPropagation(),t.preventDefault(),s[0].click(),s[0].focus()):(s[o+1].click(),s[o+1].focus())}}},watch:{value:function(t){this.dispatch("ElFormItem","el.form.change",[this.value])}}},ee,[],!1,null,null,null);re.options.__file="packages/radio/src/radio-group.vue";var ie=re.exports;ie.install=function(t){t.component(ie.name,ie)};var oe=ie,se=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("label",{staticClass:"el-radio-button",class:[t.size?"el-radio-button--"+t.size:"",{"is-active":t.value===t.label},{"is-disabled":t.isDisabled},{"is-focus":t.focus}],attrs:{role:"radio","aria-checked":t.value===t.label,"aria-disabled":t.isDisabled,tabindex:t.tabIndex},on:{keydown:function(e){if(!("button"in e)&&t._k(e.keyCode,"space",32,e.key,[" ","Spacebar"]))return null;e.stopPropagation(),e.preventDefault(),t.value=t.isDisabled?t.value:t.label}}},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.value,expression:"value"}],staticClass:"el-radio-button__orig-radio",attrs:{type:"radio",name:t.name,disabled:t.isDisabled,tabindex:"-1"},domProps:{value:t.label,checked:t._q(t.value,t.label)},on:{change:[function(e){t.value=t.label},t.handleChange],focus:function(e){t.focus=!0},blur:function(e){t.focus=!1}}}),n("span",{staticClass:"el-radio-button__inner",style:t.value===t.label?t.activeStyle:null,on:{keydown:function(t){t.stopPropagation()}}},[t._t("default"),t.$slots.default?t._e():[t._v(t._s(t.label))]],2)])};se._withStripped=!0;var ae=i({name:"ElRadioButton",mixins:[w.a],inject:{elForm:{default:""},elFormItem:{default:""}},props:{label:{},disabled:Boolean,name:String},data:function(){return{focus:!1}},computed:{value:{get:function(){return this._radioGroup.value},set:function(t){this._radioGroup.$emit("input",t)}},_radioGroup:function(){for(var t=this.$parent;t;){if("ElRadioGroup"===t.$options.componentName)return t;t=t.$parent}return!1},activeStyle:function(){return{backgroundColor:this._radioGroup.fill||"",borderColor:this._radioGroup.fill||"",boxShadow:this._radioGroup.fill?"-1px 0 0 0 "+this._radioGroup.fill:"",color:this._radioGroup.textColor||""}},_elFormItemSize:function(){return(this.elFormItem||{}).elFormItemSize},size:function(){return this._radioGroup.radioGroupSize||this._elFormItemSize||(this.$ELEMENT||{}).size},isDisabled:function(){return this.disabled||this._radioGroup.disabled||(this.elForm||{}).disabled},tabIndex:function(){return this.isDisabled||this._radioGroup&&this.value!==this.label?-1:0}},methods:{handleChange:function(){var t=this;this.$nextTick(function(){t.dispatch("ElRadioGroup","handleChange",t.value)})}}},se,[],!1,null,null,null);ae.options.__file="packages/radio/src/radio-button.vue";var le=ae.exports;le.install=function(t){t.component(le.name,le)};var ue=le,ce=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("label",{staticClass:"el-checkbox",class:[t.border&&t.checkboxSize?"el-checkbox--"+t.checkboxSize:"",{"is-disabled":t.isDisabled},{"is-bordered":t.border},{"is-checked":t.isChecked}],attrs:{id:t.id}},[n("span",{staticClass:"el-checkbox__input",class:{"is-disabled":t.isDisabled,"is-checked":t.isChecked,"is-indeterminate":t.indeterminate,"is-focus":t.focus},attrs:{tabindex:!!t.indeterminate&&0,role:!!t.indeterminate&&"checkbox","aria-checked":!!t.indeterminate&&"mixed"}},[n("span",{staticClass:"el-checkbox__inner"}),t.trueLabel||t.falseLabel?n("input",{directives:[{name:"model",rawName:"v-model",value:t.model,expression:"model"}],staticClass:"el-checkbox__original",attrs:{type:"checkbox","aria-hidden":t.indeterminate?"true":"false",name:t.name,disabled:t.isDisabled,"true-value":t.trueLabel,"false-value":t.falseLabel},domProps:{checked:Array.isArray(t.model)?t._i(t.model,null)>-1:t._q(t.model,t.trueLabel)},on:{change:[function(e){var n=t.model,r=e.target,i=r.checked?t.trueLabel:t.falseLabel;if(Array.isArray(n)){var o=t._i(n,null);r.checked?o<0&&(t.model=n.concat([null])):o>-1&&(t.model=n.slice(0,o).concat(n.slice(o+1)))}else t.model=i},t.handleChange],focus:function(e){t.focus=!0},blur:function(e){t.focus=!1}}}):n("input",{directives:[{name:"model",rawName:"v-model",value:t.model,expression:"model"}],staticClass:"el-checkbox__original",attrs:{type:"checkbox","aria-hidden":t.indeterminate?"true":"false",disabled:t.isDisabled,name:t.name},domProps:{value:t.label,checked:Array.isArray(t.model)?t._i(t.model,t.label)>-1:t.model},on:{change:[function(e){var n=t.model,r=e.target,i=!!r.checked;if(Array.isArray(n)){var o=t.label,s=t._i(n,o);r.checked?s<0&&(t.model=n.concat([o])):s>-1&&(t.model=n.slice(0,s).concat(n.slice(s+1)))}else t.model=i},t.handleChange],focus:function(e){t.focus=!0},blur:function(e){t.focus=!1}}})]),t.$slots.default||t.label?n("span",{staticClass:"el-checkbox__label"},[t._t("default"),t.$slots.default?t._e():[t._v(t._s(t.label))]],2):t._e()])};ce._withStripped=!0;var he=i({name:"ElCheckbox",mixins:[w.a],inject:{elForm:{default:""},elFormItem:{default:""}},componentName:"ElCheckbox",data:function(){return{selfModel:!1,focus:!1,isLimitExceeded:!1}},computed:{model:{get:function(){return this.isGroup?this.store:void 0!==this.value?this.value:this.selfModel},set:function(t){this.isGroup?(this.isLimitExceeded=!1,void 0!==this._checkboxGroup.min&&t.length<this._checkboxGroup.min&&(this.isLimitExceeded=!0),void 0!==this._checkboxGroup.max&&t.length>this._checkboxGroup.max&&(this.isLimitExceeded=!0),!1===this.isLimitExceeded&&this.dispatch("ElCheckboxGroup","input",[t])):(this.$emit("input",t),this.selfModel=t)}},isChecked:function(){return"[object Boolean]"==={}.toString.call(this.model)?this.model:Array.isArray(this.model)?this.model.indexOf(this.label)>-1:null!==this.model&&void 0!==this.model?this.model===this.trueLabel:void 0},isGroup:function(){for(var t=this.$parent;t;){if("ElCheckboxGroup"===t.$options.componentName)return this._checkboxGroup=t,!0;t=t.$parent}return!1},store:function(){return this._checkboxGroup?this._checkboxGroup.value:this.value},isLimitDisabled:function(){var t=this._checkboxGroup,e=t.max,n=t.min;return!(!e&&!n)&&this.model.length>=e&&!this.isChecked||this.model.length<=n&&this.isChecked},isDisabled:function(){return this.isGroup?this._checkboxGroup.disabled||this.disabled||(this.elForm||{}).disabled||this.isLimitDisabled:this.disabled||(this.elForm||{}).disabled},_elFormItemSize:function(){return(this.elFormItem||{}).elFormItemSize},checkboxSize:function(){var t=this.size||this._elFormItemSize||(this.$ELEMENT||{}).size;return this.isGroup&&this._checkboxGroup.checkboxGroupSize||t}},props:{value:{},label:{},indeterminate:Boolean,disabled:Boolean,checked:Boolean,name:String,trueLabel:[String,Number],falseLabel:[String,Number],id:String,controls:String,border:Boolean,size:String},methods:{addToStore:function(){Array.isArray(this.model)&&-1===this.model.indexOf(this.label)?this.model.push(this.label):this.model=this.trueLabel||!0},handleChange:function(t){var e=this;if(!this.isLimitExceeded){var n=void 0;n=t.target.checked?void 0===this.trueLabel||this.trueLabel:void 0!==this.falseLabel&&this.falseLabel,this.$emit("change",n,t),this.$nextTick(function(){e.isGroup&&e.dispatch("ElCheckboxGroup","change",[e._checkboxGroup.value])})}}},created:function(){this.checked&&this.addToStore()},mounted:function(){this.indeterminate&&this.$el.setAttribute("aria-controls",this.controls)},watch:{value:function(t){this.dispatch("ElFormItem","el.form.change",t)}}},ce,[],!1,null,null,null);he.options.__file="packages/checkbox/src/checkbox.vue";var de=he.exports;de.install=function(t){t.component(de.name,de)};var pe=de,fe=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("label",{staticClass:"el-checkbox-button",class:[t.size?"el-checkbox-button--"+t.size:"",{"is-disabled":t.isDisabled},{"is-checked":t.isChecked},{"is-focus":t.focus}],attrs:{role:"checkbox","aria-checked":t.isChecked,"aria-disabled":t.isDisabled}},[t.trueLabel||t.falseLabel?n("input",{directives:[{name:"model",rawName:"v-model",value:t.model,expression:"model"}],staticClass:"el-checkbox-button__original",attrs:{type:"checkbox",name:t.name,disabled:t.isDisabled,"true-value":t.trueLabel,"false-value":t.falseLabel},domProps:{checked:Array.isArray(t.model)?t._i(t.model,null)>-1:t._q(t.model,t.trueLabel)},on:{change:[function(e){var n=t.model,r=e.target,i=r.checked?t.trueLabel:t.falseLabel;if(Array.isArray(n)){var o=t._i(n,null);r.checked?o<0&&(t.model=n.concat([null])):o>-1&&(t.model=n.slice(0,o).concat(n.slice(o+1)))}else t.model=i},t.handleChange],focus:function(e){t.focus=!0},blur:function(e){t.focus=!1}}}):n("input",{directives:[{name:"model",rawName:"v-model",value:t.model,expression:"model"}],staticClass:"el-checkbox-button__original",attrs:{type:"checkbox",name:t.name,disabled:t.isDisabled},domProps:{value:t.label,checked:Array.isArray(t.model)?t._i(t.model,t.label)>-1:t.model},on:{change:[function(e){var n=t.model,r=e.target,i=!!r.checked;if(Array.isArray(n)){var o=t.label,s=t._i(n,o);r.checked?s<0&&(t.model=n.concat([o])):s>-1&&(t.model=n.slice(0,s).concat(n.slice(s+1)))}else t.model=i},t.handleChange],focus:function(e){t.focus=!0},blur:function(e){t.focus=!1}}}),t.$slots.default||t.label?n("span",{staticClass:"el-checkbox-button__inner",style:t.isChecked?t.activeStyle:null},[t._t("default",[t._v(t._s(t.label))])],2):t._e()])};fe._withStripped=!0;var ge=i({name:"ElCheckboxButton",mixins:[w.a],inject:{elForm:{default:""},elFormItem:{default:""}},data:function(){return{selfModel:!1,focus:!1,isLimitExceeded:!1}},props:{value:{},label:{},disabled:Boolean,checked:Boolean,name:String,trueLabel:[String,Number],falseLabel:[String,Number]},computed:{model:{get:function(){return this._checkboxGroup?this.store:void 0!==this.value?this.value:this.selfModel},set:function(t){this._checkboxGroup?(this.isLimitExceeded=!1,void 0!==this._checkboxGroup.min&&t.length<this._checkboxGroup.min&&(this.isLimitExceeded=!0),void 0!==this._checkboxGroup.max&&t.length>this._checkboxGroup.max&&(this.isLimitExceeded=!0),!1===this.isLimitExceeded&&this.dispatch("ElCheckboxGroup","input",[t])):void 0!==this.value?this.$emit("input",t):this.selfModel=t}},isChecked:function(){return"[object Boolean]"==={}.toString.call(this.model)?this.model:Array.isArray(this.model)?this.model.indexOf(this.label)>-1:null!==this.model&&void 0!==this.model?this.model===this.trueLabel:void 0},_checkboxGroup:function(){for(var t=this.$parent;t;){if("ElCheckboxGroup"===t.$options.componentName)return t;t=t.$parent}return!1},store:function(){return this._checkboxGroup?this._checkboxGroup.value:this.value},activeStyle:function(){return{backgroundColor:this._checkboxGroup.fill||"",borderColor:this._checkboxGroup.fill||"",color:this._checkboxGroup.textColor||"","box-shadow":"-1px 0 0 0 "+this._checkboxGroup.fill}},_elFormItemSize:function(){return(this.elFormItem||{}).elFormItemSize},size:function(){return this._checkboxGroup.checkboxGroupSize||this._elFormItemSize||(this.$ELEMENT||{}).size},isLimitDisabled:function(){var t=this._checkboxGroup,e=t.max,n=t.min;return!(!e&&!n)&&this.model.length>=e&&!this.isChecked||this.model.length<=n&&this.isChecked},isDisabled:function(){return this._checkboxGroup?this._checkboxGroup.disabled||this.disabled||(this.elForm||{}).disabled||this.isLimitDisabled:this.disabled||(this.elForm||{}).disabled}},methods:{addToStore:function(){Array.isArray(this.model)&&-1===this.model.indexOf(this.label)?this.model.push(this.label):this.model=this.trueLabel||!0},handleChange:function(t){var e=this;if(!this.isLimitExceeded){var n=void 0;n=t.target.checked?void 0===this.trueLabel||this.trueLabel:void 0!==this.falseLabel&&this.falseLabel,this.$emit("change",n,t),this.$nextTick(function(){e._checkboxGroup&&e.dispatch("ElCheckboxGroup","change",[e._checkboxGroup.value])})}}},created:function(){this.checked&&this.addToStore()}},fe,[],!1,null,null,null);ge.options.__file="packages/checkbox/src/checkbox-button.vue";var me=ge.exports;me.install=function(t){t.component(me.name,me)};var ve=me,be=function(){var t=this.$createElement;return(this._self._c||t)("div",{staticClass:"el-checkbox-group",attrs:{role:"group","aria-label":"checkbox-group"}},[this._t("default")],2)};be._withStripped=!0;var _e=i({name:"ElCheckboxGroup",componentName:"ElCheckboxGroup",mixins:[w.a],inject:{elFormItem:{default:""}},props:{value:{},disabled:Boolean,min:Number,max:Number,size:String,fill:String,textColor:String},computed:{_elFormItemSize:function(){return(this.elFormItem||{}).elFormItemSize},checkboxGroupSize:function(){return this.size||this._elFormItemSize||(this.$ELEMENT||{}).size}},watch:{value:function(t){this.dispatch("ElFormItem","el.form.change",[t])}}},be,[],!1,null,null,null);_e.options.__file="packages/checkbox/src/checkbox-group.vue";var ye=_e.exports;ye.install=function(t){t.component(ye.name,ye)};var Te=ye,xe=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"el-switch",class:{"is-disabled":t.switchDisabled,"is-checked":t.checked},attrs:{role:"switch","aria-checked":t.checked,"aria-disabled":t.switchDisabled},on:{click:function(e){return e.preventDefault(),t.switchValue(e)}}},[n("input",{ref:"input",staticClass:"el-switch__input",attrs:{type:"checkbox",id:t.id,name:t.name,"true-value":t.activeValue,"false-value":t.inactiveValue,disabled:t.switchDisabled},on:{change:t.handleChange,keydown:function(e){return"button"in e||!t._k(e.keyCode,"enter",13,e.key,"Enter")?t.switchValue(e):null}}}),t.inactiveIconClass||t.inactiveText?n("span",{class:["el-switch__label","el-switch__label--left",t.checked?"":"is-active"]},[t.inactiveIconClass?n("i",{class:[t.inactiveIconClass]}):t._e(),!t.inactiveIconClass&&t.inactiveText?n("span",{attrs:{"aria-hidden":t.checked}},[t._v(t._s(t.inactiveText))]):t._e()]):t._e(),n("span",{ref:"core",staticClass:"el-switch__core",style:{width:t.coreWidth+"px"}}),t.activeIconClass||t.activeText?n("span",{class:["el-switch__label","el-switch__label--right",t.checked?"is-active":""]},[t.activeIconClass?n("i",{class:[t.activeIconClass]}):t._e(),!t.activeIconClass&&t.activeText?n("span",{attrs:{"aria-hidden":!t.checked}},[t._v(t._s(t.activeText))]):t._e()]):t._e()])};xe._withStripped=!0;var Ee=i({name:"ElSwitch",mixins:[U()("input"),x.a,w.a],inject:{elForm:{default:""}},props:{value:{type:[Boolean,String,Number],default:!1},disabled:{type:Boolean,default:!1},width:{type:Number,default:40},activeIconClass:{type:String,default:""},inactiveIconClass:{type:String,default:""},activeText:String,inactiveText:String,activeColor:{type:String,default:""},inactiveColor:{type:String,default:""},activeValue:{type:[Boolean,String,Number],default:!0},inactiveValue:{type:[Boolean,String,Number],default:!1},name:{type:String,default:""},validateEvent:{type:Boolean,default:!0},id:String},data:function(){return{coreWidth:this.width}},created:function(){~[this.activeValue,this.inactiveValue].indexOf(this.value)||this.$emit("input",this.inactiveValue)},computed:{checked:function(){return this.value===this.activeValue},switchDisabled:function(){return this.disabled||(this.elForm||{}).disabled}},watch:{checked:function(){this.$refs.input.checked=this.checked,(this.activeColor||this.inactiveColor)&&this.setBackgroundColor(),this.validateEvent&&this.dispatch("ElFormItem","el.form.change",[this.value])}},methods:{handleChange:function(t){var e=this,n=this.checked?this.inactiveValue:this.activeValue;this.$emit("input",n),this.$emit("change",n),this.$nextTick(function(){e.$refs.input.checked=e.checked})},setBackgroundColor:function(){var t=this.checked?this.activeColor:this.inactiveColor;this.$refs.core.style.borderColor=t,this.$refs.core.style.backgroundColor=t},switchValue:function(){!this.switchDisabled&&this.handleChange()},getMigratingConfig:function(){return{props:{"on-color":"on-color is renamed to active-color.","off-color":"off-color is renamed to inactive-color.","on-text":"on-text is renamed to active-text.","off-text":"off-text is renamed to inactive-text.","on-value":"on-value is renamed to active-value.","off-value":"off-value is renamed to inactive-value.","on-icon-class":"on-icon-class is renamed to active-icon-class.","off-icon-class":"off-icon-class is renamed to inactive-icon-class."}}}},mounted:function(){this.coreWidth=this.width||40,(this.activeColor||this.inactiveColor)&&this.setBackgroundColor(),this.$refs.input.checked=this.checked}},xe,[],!1,null,null,null);Ee.options.__file="packages/switch/src/component.vue";var we=Ee.exports;we.install=function(t){t.component(we.name,we)};var Ce=we,Se=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{directives:[{name:"clickoutside",rawName:"v-clickoutside",value:t.handleClose,expression:"handleClose"}],staticClass:"el-select",class:[t.selectSize?"el-select--"+t.selectSize:""],on:{click:function(e){return e.stopPropagation(),t.toggleMenu(e)}}},[t.multiple?n("div",{ref:"tags",staticClass:"el-select__tags",style:{"max-width":t.inputWidth-32+"px",width:"100%"}},[t.collapseTags&&t.selected.length?n("span",[n("el-tag",{attrs:{closable:!t.selectDisabled,size:t.collapseTagSize,hit:t.selected[0].hitState,type:"info","disable-transitions":""},on:{close:function(e){t.deleteTag(e,t.selected[0])}}},[n("span",{staticClass:"el-select__tags-text"},[t._v(t._s(t.selected[0].currentLabel))])]),t.selected.length>1?n("el-tag",{attrs:{closable:!1,size:t.collapseTagSize,type:"info","disable-transitions":""}},[n("span",{staticClass:"el-select__tags-text"},[t._v("+ "+t._s(t.selected.length-1))])]):t._e()],1):t._e(),t.collapseTags?t._e():n("transition-group",{on:{"after-leave":t.resetInputHeight}},t._l(t.selected,function(e){return n("el-tag",{key:t.getValueKey(e),attrs:{closable:!t.selectDisabled,size:t.collapseTagSize,hit:e.hitState,type:"info","disable-transitions":""},on:{close:function(n){t.deleteTag(n,e)}}},[n("span",{staticClass:"el-select__tags-text"},[t._v(t._s(e.currentLabel))])])}),1),t.filterable?n("input",{directives:[{name:"model",rawName:"v-model",value:t.query,expression:"query"}],ref:"input",staticClass:"el-select__input",class:[t.selectSize?"is-"+t.selectSize:""],style:{"flex-grow":"1",width:t.inputLength/(t.inputWidth-32)+"%","max-width":t.inputWidth-42+"px"},attrs:{type:"text",disabled:t.selectDisabled,autocomplete:t.autoComplete||t.autocomplete},domProps:{value:t.query},on:{focus:t.handleFocus,blur:function(e){t.softFocus=!1},keyup:t.managePlaceholder,keydown:[t.resetInputState,function(e){if(!("button"in e)&&t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"]))return null;e.preventDefault(),t.navigateOptions("next")},function(e){if(!("button"in e)&&t._k(e.keyCode,"up",38,e.key,["Up","ArrowUp"]))return null;e.preventDefault(),t.navigateOptions("prev")},function(e){return"button"in e||!t._k(e.keyCode,"enter",13,e.key,"Enter")?(e.preventDefault(),t.selectOption(e)):null},function(e){if(!("button"in e)&&t._k(e.keyCode,"esc",27,e.key,["Esc","Escape"]))return null;e.stopPropagation(),e.preventDefault(),t.visible=!1},function(e){return"button"in e||!t._k(e.keyCode,"delete",[8,46],e.key,["Backspace","Delete","Del"])?t.deletePrevTag(e):null},function(e){if(!("button"in e)&&t._k(e.keyCode,"tab",9,e.key,"Tab"))return null;t.visible=!1}],compositionstart:t.handleComposition,compositionupdate:t.handleComposition,compositionend:t.handleComposition,input:[function(e){e.target.composing||(t.query=e.target.value)},t.debouncedQueryChange]}}):t._e()],1):t._e(),n("el-input",{ref:"reference",class:{"is-focus":t.visible},attrs:{type:"text",placeholder:t.currentPlaceholder,name:t.name,id:t.id,autocomplete:t.autoComplete||t.autocomplete,size:t.selectSize,disabled:t.selectDisabled,readonly:t.readonly,"validate-event":!1,tabindex:t.multiple&&t.filterable?"-1":null},on:{focus:t.handleFocus,blur:t.handleBlur},nativeOn:{keyup:function(e){return t.debouncedOnInputChange(e)},keydown:[function(e){if(!("button"in e)&&t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"]))return null;e.stopPropagation(),e.preventDefault(),t.navigateOptions("next")},function(e){if(!("button"in e)&&t._k(e.keyCode,"up",38,e.key,["Up","ArrowUp"]))return null;e.stopPropagation(),e.preventDefault(),t.navigateOptions("prev")},function(e){return"button"in e||!t._k(e.keyCode,"enter",13,e.key,"Enter")?(e.preventDefault(),t.selectOption(e)):null},function(e){if(!("button"in e)&&t._k(e.keyCode,"esc",27,e.key,["Esc","Escape"]))return null;e.stopPropagation(),e.preventDefault(),t.visible=!1},function(e){if(!("button"in e)&&t._k(e.keyCode,"tab",9,e.key,"Tab"))return null;t.visible=!1}],paste:function(e){return t.debouncedOnInputChange(e)},mouseenter:function(e){t.inputHovering=!0},mouseleave:function(e){t.inputHovering=!1}},model:{value:t.selectedLabel,callback:function(e){t.selectedLabel=e},expression:"selectedLabel"}},[t.$slots.prefix?n("template",{slot:"prefix"},[t._t("prefix")],2):t._e(),n("template",{slot:"suffix"},[n("i",{directives:[{name:"show",rawName:"v-show",value:!t.showClose,expression:"!showClose"}],class:["el-select__caret","el-input__icon","el-icon-"+t.iconClass]}),t.showClose?n("i",{staticClass:"el-select__caret el-input__icon el-icon-circle-close",on:{click:t.handleClearClick}}):t._e()])],2),n("transition",{attrs:{name:"el-zoom-in-top"},on:{"before-enter":t.handleMenuEnter,"after-leave":t.doDestroy}},[n("el-select-menu",{directives:[{name:"show",rawName:"v-show",value:t.visible&&!1!==t.emptyText,expression:"visible && emptyText !== false"}],ref:"popper",attrs:{"append-to-body":t.popperAppendToBody}},[n("el-scrollbar",{directives:[{name:"show",rawName:"v-show",value:t.options.length>0&&!t.loading,expression:"options.length > 0 && !loading"}],ref:"scrollbar",class:{"is-empty":!t.allowCreate&&t.query&&0===t.filteredOptionsCount},attrs:{tag:"ul","wrap-class":"el-select-dropdown__wrap","view-class":"el-select-dropdown__list"}},[t.showNewOption?n("el-option",{attrs:{value:t.query,created:""}}):t._e(),t._t("default")],2),t.emptyText&&(!t.allowCreate||t.loading||t.allowCreate&&0===t.options.length)?[t.$slots.empty?t._t("empty"):n("p",{staticClass:"el-select-dropdown__empty"},[t._v("\n "+t._s(t.emptyText)+"\n ")])]:t._e()],2)],1)],1)};Se._withStripped=!0;var ke=function(){var t=this.$createElement;return(this._self._c||t)("div",{staticClass:"el-select-dropdown el-popper",class:[{"is-multiple":this.$parent.multiple},this.popperClass],style:{minWidth:this.minWidth}},[this._t("default")],2)};ke._withStripped=!0;var Oe=i({name:"ElSelectDropdown",componentName:"ElSelectDropdown",mixins:[L.a],props:{placement:{default:"bottom-start"},boundariesPadding:{default:0},popperOptions:{default:function(){return{gpuAcceleration:!1}}},visibleArrow:{default:!0},appendToBody:{type:Boolean,default:!0}},data:function(){return{minWidth:""}},computed:{popperClass:function(){return this.$parent.popperClass}},watch:{"$parent.inputWidth":function(){this.minWidth=this.$parent.$el.getBoundingClientRect().width+"px"}},mounted:function(){var t=this;this.referenceElm=this.$parent.$refs.reference.$el,this.$parent.popperElm=this.popperElm=this.$el,this.$on("updatePopper",function(){t.$parent.visible&&t.updatePopper()}),this.$on("destroyPopper",this.destroyPopper)}},ke,[],!1,null,null,null);Oe.options.__file="packages/select/src/select-dropdown.vue";var Ie=Oe.exports,Re=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("li",{directives:[{name:"show",rawName:"v-show",value:t.visible,expression:"visible"}],staticClass:"el-select-dropdown__item",class:{selected:t.itemSelected,"is-disabled":t.disabled||t.groupDisabled||t.limitReached,hover:t.hover},on:{mouseenter:t.hoverItem,click:function(e){return e.stopPropagation(),t.selectOptionClick(e)}}},[t._t("default",[n("span",[t._v(t._s(t.currentLabel))])])],2)};Re._withStripped=!0;var Ae="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ne=i({mixins:[w.a],name:"ElOption",componentName:"ElOption",inject:["select"],props:{value:{required:!0},label:[String,Number],created:Boolean,disabled:{type:Boolean,default:!1}},data:function(){return{index:-1,groupDisabled:!1,visible:!0,hitState:!1,hover:!1}},computed:{isObject:function(){return"[object object]"===Object.prototype.toString.call(this.value).toLowerCase()},currentLabel:function(){return this.label||(this.isObject?"":this.value)},currentValue:function(){return this.value||this.label||""},itemSelected:function(){return this.select.multiple?this.contains(this.select.value,this.value):this.isEqual(this.value,this.select.value)},limitReached:function(){return!!this.select.multiple&&(!this.itemSelected&&(this.select.value||[]).length>=this.select.multipleLimit&&this.select.multipleLimit>0)}},watch:{currentLabel:function(){this.created||this.select.remote||this.dispatch("ElSelect","setSelected")},value:function(t,e){var n=this.select,r=n.remote,i=n.valueKey;if(!this.created&&!r){if(i&&"object"===(void 0===t?"undefined":Ae(t))&&"object"===(void 0===e?"undefined":Ae(e))&&t[i]===e[i])return;this.dispatch("ElSelect","setSelected")}}},methods:{isEqual:function(t,e){if(this.isObject){var n=this.select.valueKey;return Object(g.getValueByPath)(t,n)===Object(g.getValueByPath)(e,n)}return t===e},contains:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments[1];if(this.isObject){var n=this.select.valueKey;return t&&t.some(function(t){return Object(g.getValueByPath)(t,n)===Object(g.getValueByPath)(e,n)})}return t&&t.indexOf(e)>-1},handleGroupDisabled:function(t){this.groupDisabled=t},hoverItem:function(){this.disabled||this.groupDisabled||(this.select.hoverIndex=this.select.options.indexOf(this))},selectOptionClick:function(){!0!==this.disabled&&!0!==this.groupDisabled&&this.dispatch("ElSelect","handleOptionClick",[this,!0])},queryChange:function(t){this.visible=new RegExp(Object(g.escapeRegexpString)(t),"i").test(this.currentLabel)||this.created,this.visible||this.select.filteredOptionsCount--}},created:function(){this.select.options.push(this),this.select.cachedOptions.push(this),this.select.optionsCount++,this.select.filteredOptionsCount++,this.$on("queryChange",this.queryChange),this.$on("handleGroupDisabled",this.handleGroupDisabled)},beforeDestroy:function(){var t=this.select,e=t.selected,n=t.multiple?e:[e],r=this.select.cachedOptions.indexOf(this),i=n.indexOf(this);r>-1&&i<0&&this.select.cachedOptions.splice(r,1),this.select.onOptionDestroy(this.select.options.indexOf(this))}},Re,[],!1,null,null,null);Ne.options.__file="packages/select/src/option.vue";var De=Ne.exports,Me=n(29),Le=n.n(Me),Pe=n(14),Fe=n(27),Be=n.n(Fe),je=i({mixins:[w.a,f.a,U()("reference"),{data:function(){return{hoverOption:-1}},computed:{optionsAllDisabled:function(){return this.options.filter(function(t){return t.visible}).every(function(t){return t.disabled})}},watch:{hoverIndex:function(t){var e=this;"number"==typeof t&&t>-1&&(this.hoverOption=this.options[t]||{}),this.options.forEach(function(t){t.hover=e.hoverOption===t})}},methods:{navigateOptions:function(t){var e=this;if(this.visible){if(0!==this.options.length&&0!==this.filteredOptionsCount&&!this.optionsAllDisabled){"next"===t?(this.hoverIndex++,this.hoverIndex===this.options.length&&(this.hoverIndex=0)):"prev"===t&&(this.hoverIndex--,this.hoverIndex<0&&(this.hoverIndex=this.options.length-1));var n=this.options[this.hoverIndex];!0!==n.disabled&&!0!==n.groupDisabled&&n.visible||this.navigateOptions(t),this.$nextTick(function(){return e.scrollToOption(e.hoverOption)})}}else this.visible=!0}}}],name:"ElSelect",componentName:"ElSelect",inject:{elForm:{default:""},elFormItem:{default:""}},provide:function(){return{select:this}},computed:{_elFormItemSize:function(){return(this.elFormItem||{}).elFormItemSize},readonly:function(){return!this.filterable||this.multiple||!Object(g.isIE)()&&!Object(g.isEdge)()&&!this.visible},showClose:function(){var t=this.multiple?Array.isArray(this.value)&&this.value.length>0:void 0!==this.value&&null!==this.value&&""!==this.value;return this.clearable&&!this.selectDisabled&&this.inputHovering&&t},iconClass:function(){return this.remote&&this.filterable?"":this.visible?"arrow-up is-reverse":"arrow-up"},debounce:function(){return this.remote?300:0},emptyText:function(){return this.loading?this.loadingText||this.t("el.select.loading"):(!this.remote||""!==this.query||0!==this.options.length)&&(this.filterable&&this.query&&this.options.length>0&&0===this.filteredOptionsCount?this.noMatchText||this.t("el.select.noMatch"):0===this.options.length?this.noDataText||this.t("el.select.noData"):null)},showNewOption:function(){var t=this,e=this.options.filter(function(t){return!t.created}).some(function(e){return e.currentLabel===t.query});return this.filterable&&this.allowCreate&&""!==this.query&&!e},selectSize:function(){return this.size||this._elFormItemSize||(this.$ELEMENT||{}).size},selectDisabled:function(){return this.disabled||(this.elForm||{}).disabled},collapseTagSize:function(){return["small","mini"].indexOf(this.selectSize)>-1?"mini":"small"},propPlaceholder:function(){return void 0!==this.placeholder?this.placeholder:this.t("el.select.placeholder")}},components:{ElInput:d.a,ElSelectMenu:Ie,ElOption:De,ElTag:Le.a,ElScrollbar:F.a},directives:{Clickoutside:N.a},props:{name:String,id:String,value:{required:!0},autocomplete:{type:String,default:"off"},autoComplete:{type:String,validator:function(t){return!0}},automaticDropdown:Boolean,size:String,disabled:Boolean,clearable:Boolean,filterable:Boolean,allowCreate:Boolean,loading:Boolean,popperClass:String,remote:Boolean,loadingText:String,noMatchText:String,noDataText:String,remoteMethod:Function,filterMethod:Function,multiple:Boolean,multipleLimit:{type:Number,default:0},placeholder:{type:String,required:!1},defaultFirstOption:Boolean,reserveKeyword:Boolean,valueKey:{type:String,default:"value"},collapseTags:Boolean,popperAppendToBody:{type:Boolean,default:!0}},data:function(){return{options:[],cachedOptions:[],createdLabel:null,createdSelected:!1,selected:this.multiple?[]:{},inputLength:20,inputWidth:0,initialInputHeight:0,cachedPlaceHolder:"",optionsCount:0,filteredOptionsCount:0,visible:!1,softFocus:!1,selectedLabel:"",hoverIndex:-1,query:"",previousQuery:null,inputHovering:!1,currentPlaceholder:"",menuVisibleOnFocus:!1,isOnComposition:!1,isSilentBlur:!1}},watch:{selectDisabled:function(){var t=this;this.$nextTick(function(){t.resetInputHeight()})},propPlaceholder:function(t){this.cachedPlaceHolder=this.currentPlaceholder=t},value:function(t,e){this.multiple&&(this.resetInputHeight(),t&&t.length>0||this.$refs.input&&""!==this.query?this.currentPlaceholder="":this.currentPlaceholder=this.cachedPlaceHolder,this.filterable&&!this.reserveKeyword&&(this.query="",this.handleQueryChange(this.query))),this.setSelected(),this.filterable&&!this.multiple&&(this.inputLength=20),Object(g.valueEquals)(t,e)||this.dispatch("ElFormItem","el.form.change",t)},visible:function(t){var e=this;t?(this.broadcast("ElSelectDropdown","updatePopper"),this.filterable&&(this.query=this.remote?"":this.selectedLabel,this.handleQueryChange(this.query),this.multiple?this.$refs.input.focus():(this.remote||(this.broadcast("ElOption","queryChange",""),this.broadcast("ElOptionGroup","queryChange")),this.selectedLabel&&(this.currentPlaceholder=this.selectedLabel,this.selectedLabel="")))):(this.broadcast("ElSelectDropdown","destroyPopper"),this.$refs.input&&this.$refs.input.blur(),this.query="",this.previousQuery=null,this.selectedLabel="",this.inputLength=20,this.menuVisibleOnFocus=!1,this.resetHoverIndex(),this.$nextTick(function(){e.$refs.input&&""===e.$refs.input.value&&0===e.selected.length&&(e.currentPlaceholder=e.cachedPlaceHolder)}),this.multiple||(this.selected&&(this.filterable&&this.allowCreate&&this.createdSelected&&this.createdLabel?this.selectedLabel=this.createdLabel:this.selectedLabel=this.selected.currentLabel,this.filterable&&(this.query=this.selectedLabel)),this.filterable&&(this.currentPlaceholder=this.cachedPlaceHolder))),this.$emit("visible-change",t)},options:function(){var t=this;if(!this.$isServer){this.$nextTick(function(){t.broadcast("ElSelectDropdown","updatePopper")}),this.multiple&&this.resetInputHeight();var e=this.$el.querySelectorAll("input");-1===[].indexOf.call(e,document.activeElement)&&this.setSelected(),this.defaultFirstOption&&(this.filterable||this.remote)&&this.filteredOptionsCount&&this.checkDefaultFirstOption()}}},methods:{handleComposition:function(t){var e=this,n=t.target.value;if("compositionend"===t.type)this.isOnComposition=!1,this.$nextTick(function(t){return e.handleQueryChange(n)});else{var r=n[n.length-1]||"";this.isOnComposition=!Object(Vt.isKorean)(r)}},handleQueryChange:function(t){var e=this;this.previousQuery===t||this.isOnComposition||(null!==this.previousQuery||"function"!=typeof this.filterMethod&&"function"!=typeof this.remoteMethod?(this.previousQuery=t,this.$nextTick(function(){e.visible&&e.broadcast("ElSelectDropdown","updatePopper")}),this.hoverIndex=-1,this.multiple&&this.filterable&&this.$nextTick(function(){var t=15*e.$refs.input.value.length+20;e.inputLength=e.collapseTags?Math.min(50,t):t,e.managePlaceholder(),e.resetInputHeight()}),this.remote&&"function"==typeof this.remoteMethod?(this.hoverIndex=-1,this.remoteMethod(t)):"function"==typeof this.filterMethod?(this.filterMethod(t),this.broadcast("ElOptionGroup","queryChange")):(this.filteredOptionsCount=this.optionsCount,this.broadcast("ElOption","queryChange",t),this.broadcast("ElOptionGroup","queryChange")),this.defaultFirstOption&&(this.filterable||this.remote)&&this.filteredOptionsCount&&this.checkDefaultFirstOption()):this.previousQuery=t)},scrollToOption:function(t){var e=Array.isArray(t)&&t[0]?t[0].$el:t.$el;if(this.$refs.popper&&e){var n=this.$refs.popper.$el.querySelector(".el-select-dropdown__wrap");Be()(n,e)}this.$refs.scrollbar&&this.$refs.scrollbar.handleScroll()},handleMenuEnter:function(){var t=this;this.$nextTick(function(){return t.scrollToOption(t.selected)})},emitChange:function(t){Object(g.valueEquals)(this.value,t)||this.$emit("change",t)},getOption:function(t){for(var e=void 0,n="[object object]"===Object.prototype.toString.call(t).toLowerCase(),r="[object null]"===Object.prototype.toString.call(t).toLowerCase(),i="[object undefined]"===Object.prototype.toString.call(t).toLowerCase(),o=this.cachedOptions.length-1;o>=0;o--){var s=this.cachedOptions[o];if(n?Object(g.getValueByPath)(s.value,this.valueKey)===Object(g.getValueByPath)(t,this.valueKey):s.value===t){e=s;break}}if(e)return e;var a={value:t,currentLabel:n||r||i?"":String(t)};return this.multiple&&(a.hitState=!1),a},setSelected:function(){var t=this;if(!this.multiple){var e=this.getOption(this.value);return e.created?(this.createdLabel=e.currentLabel,this.createdSelected=!0):this.createdSelected=!1,this.selectedLabel=e.currentLabel,this.selected=e,void(this.filterable&&(this.query=this.selectedLabel))}var n=[];Array.isArray(this.value)&&this.value.forEach(function(e){n.push(t.getOption(e))}),this.selected=n,this.$nextTick(function(){t.resetInputHeight()})},handleFocus:function(t){this.softFocus?this.softFocus=!1:((this.automaticDropdown||this.filterable)&&(this.visible=!0,this.filterable&&(this.menuVisibleOnFocus=!0)),this.$emit("focus",t))},blur:function(){this.visible=!1,this.$refs.reference.blur()},handleBlur:function(t){var e=this;setTimeout(function(){e.isSilentBlur?e.isSilentBlur=!1:e.$emit("blur",t)},50),this.softFocus=!1},handleClearClick:function(t){this.deleteSelected(t)},doDestroy:function(){this.$refs.popper&&this.$refs.popper.doDestroy()},handleClose:function(){this.visible=!1},toggleLastOptionHitState:function(t){if(Array.isArray(this.selected)){var e=this.selected[this.selected.length-1];if(e)return!0===t||!1===t?(e.hitState=t,t):(e.hitState=!e.hitState,e.hitState)}},deletePrevTag:function(t){if(t.target.value.length<=0&&!this.toggleLastOptionHitState()){var e=this.value.slice();e.pop(),this.$emit("input",e),this.emitChange(e)}},managePlaceholder:function(){""!==this.currentPlaceholder&&(this.currentPlaceholder=this.$refs.input.value?"":this.cachedPlaceHolder)},resetInputState:function(t){8!==t.keyCode&&this.toggleLastOptionHitState(!1),this.inputLength=15*this.$refs.input.value.length+20,this.resetInputHeight()},resetInputHeight:function(){var t=this;this.collapseTags&&!this.filterable||this.$nextTick(function(){if(t.$refs.reference){var e=t.$refs.reference.$el.childNodes,n=[].filter.call(e,function(t){return"INPUT"===t.tagName})[0],r=t.$refs.tags,i=t.initialInputHeight||40;n.style.height=0===t.selected.length?i+"px":Math.max(r?r.clientHeight+(r.clientHeight>i?6:0):0,i)+"px",t.visible&&!1!==t.emptyText&&t.broadcast("ElSelectDropdown","updatePopper")}})},resetHoverIndex:function(){var t=this;setTimeout(function(){t.multiple?t.selected.length>0?t.hoverIndex=Math.min.apply(null,t.selected.map(function(e){return t.options.indexOf(e)})):t.hoverIndex=-1:t.hoverIndex=t.options.indexOf(t.selected)},300)},handleOptionSelect:function(t,e){var n=this;if(this.multiple){var r=(this.value||[]).slice(),i=this.getValueIndex(r,t.value);i>-1?r.splice(i,1):(this.multipleLimit<=0||r.length<this.multipleLimit)&&r.push(t.value),this.$emit("input",r),this.emitChange(r),t.created&&(this.query="",this.handleQueryChange(""),this.inputLength=20),this.filterable&&this.$refs.input.focus()}else this.$emit("input",t.value),this.emitChange(t.value),this.visible=!1;this.isSilentBlur=e,this.setSoftFocus(),this.visible||this.$nextTick(function(){n.scrollToOption(t)})},setSoftFocus:function(){this.softFocus=!0;var t=this.$refs.input||this.$refs.reference;t&&t.focus()},getValueIndex:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments[1];if("[object object]"===Object.prototype.toString.call(e).toLowerCase()){var n=this.valueKey,r=-1;return t.some(function(t,i){return Object(g.getValueByPath)(t,n)===Object(g.getValueByPath)(e,n)&&(r=i,!0)}),r}return t.indexOf(e)},toggleMenu:function(){this.selectDisabled||(this.menuVisibleOnFocus?this.menuVisibleOnFocus=!1:this.visible=!this.visible,this.visible&&(this.$refs.input||this.$refs.reference).focus())},selectOption:function(){this.visible?this.options[this.hoverIndex]&&this.handleOptionSelect(this.options[this.hoverIndex]):this.toggleMenu()},deleteSelected:function(t){t.stopPropagation();var e=this.multiple?[]:"";this.$emit("input",e),this.emitChange(e),this.visible=!1,this.$emit("clear")},deleteTag:function(t,e){var n=this.selected.indexOf(e);if(n>-1&&!this.selectDisabled){var r=this.value.slice();r.splice(n,1),this.$emit("input",r),this.emitChange(r),this.$emit("remove-tag",e.value)}t.stopPropagation()},onInputChange:function(){this.filterable&&this.query!==this.selectedLabel&&(this.query=this.selectedLabel,this.handleQueryChange(this.query))},onOptionDestroy:function(t){t>-1&&(this.optionsCount--,this.filteredOptionsCount--,this.options.splice(t,1))},resetInputWidth:function(){this.inputWidth=this.$refs.reference.$el.getBoundingClientRect().width},handleResize:function(){this.resetInputWidth(),this.multiple&&this.resetInputHeight()},checkDefaultFirstOption:function(){this.hoverIndex=-1;for(var t=!1,e=this.options.length-1;e>=0;e--)if(this.options[e].created){t=!0,this.hoverIndex=e;break}if(!t)for(var n=0;n!==this.options.length;++n){var r=this.options[n];if(this.query){if(!r.disabled&&!r.groupDisabled&&r.visible){this.hoverIndex=n;break}}else if(r.itemSelected){this.hoverIndex=n;break}}},getValueKey:function(t){return"[object object]"!==Object.prototype.toString.call(t.value).toLowerCase()?t.value:Object(g.getValueByPath)(t.value,this.valueKey)}},created:function(){var t=this;this.cachedPlaceHolder=this.currentPlaceholder=this.propPlaceholder,this.multiple&&!Array.isArray(this.value)&&this.$emit("input",[]),!this.multiple&&Array.isArray(this.value)&&this.$emit("input",""),this.debouncedOnInputChange=R()(this.debounce,function(){t.onInputChange()}),this.debouncedQueryChange=R()(this.debounce,function(e){t.handleQueryChange(e.target.value)}),this.$on("handleOptionClick",this.handleOptionSelect),this.$on("setSelected",this.setSelected)},mounted:function(){var t=this;this.multiple&&Array.isArray(this.value)&&this.value.length>0&&(this.currentPlaceholder=""),Object(Pe.addResizeListener)(this.$el,this.handleResize);var e=this.$refs.reference;if(e&&e.$el){var n=e.$el.querySelector("input");this.initialInputHeight=n.getBoundingClientRect().height||{medium:36,small:32,mini:28}[this.selectSize]}this.remote&&this.multiple&&this.resetInputHeight(),this.$nextTick(function(){e&&e.$el&&(t.inputWidth=e.$el.getBoundingClientRect().width)}),this.setSelected()},beforeDestroy:function(){this.$el&&this.handleResize&&Object(Pe.removeResizeListener)(this.$el,this.handleResize)}},Se,[],!1,null,null,null);je.options.__file="packages/select/src/select.vue";var $e=je.exports;$e.install=function(t){t.component($e.name,$e)};var Ue=$e;De.install=function(t){t.component(De.name,De)};var Ve=De,He=function(){var t=this.$createElement,e=this._self._c||t;return e("ul",{directives:[{name:"show",rawName:"v-show",value:this.visible,expression:"visible"}],staticClass:"el-select-group__wrap"},[e("li",{staticClass:"el-select-group__title"},[this._v(this._s(this.label))]),e("li",[e("ul",{staticClass:"el-select-group"},[this._t("default")],2)])])};He._withStripped=!0;var We=i({mixins:[w.a],name:"ElOptionGroup",componentName:"ElOptionGroup",props:{label:String,disabled:{type:Boolean,default:!1}},data:function(){return{visible:!0}},watch:{disabled:function(t){this.broadcast("ElOption","handleGroupDisabled",t)}},methods:{queryChange:function(){this.visible=this.$children&&Array.isArray(this.$children)&&this.$children.some(function(t){return!0===t.visible})}},created:function(){this.$on("queryChange",this.queryChange)},mounted:function(){this.disabled&&this.broadcast("ElOption","handleGroupDisabled",this.disabled)}},He,[],!1,null,null,null);We.options.__file="packages/select/src/option-group.vue";var Ge=We.exports;Ge.install=function(t){t.component(Ge.name,Ge)};var ze=Ge,Xe=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("button",{staticClass:"el-button",class:[t.type?"el-button--"+t.type:"",t.buttonSize?"el-button--"+t.buttonSize:"",{"is-disabled":t.buttonDisabled,"is-loading":t.loading,"is-plain":t.plain,"is-round":t.round,"is-circle":t.circle}],attrs:{disabled:t.buttonDisabled||t.loading,autofocus:t.autofocus,type:t.nativeType},on:{click:t.handleClick}},[t.loading?n("i",{staticClass:"el-icon-loading"}):t._e(),t.icon&&!t.loading?n("i",{class:t.icon}):t._e(),t.$slots.default?n("span",[t._t("default")],2):t._e()])};Xe._withStripped=!0;var Ke=i({name:"ElButton",inject:{elForm:{default:""},elFormItem:{default:""}},props:{type:{type:String,default:"default"},size:String,icon:{type:String,default:""},nativeType:{type:String,default:"button"},loading:Boolean,disabled:Boolean,plain:Boolean,autofocus:Boolean,round:Boolean,circle:Boolean},computed:{_elFormItemSize:function(){return(this.elFormItem||{}).elFormItemSize},buttonSize:function(){return this.size||this._elFormItemSize||(this.$ELEMENT||{}).size},buttonDisabled:function(){return this.disabled||(this.elForm||{}).disabled}},methods:{handleClick:function(t){this.$emit("click",t)}}},Xe,[],!1,null,null,null);Ke.options.__file="packages/button/src/button.vue";var Ye=Ke.exports;Ye.install=function(t){t.component(Ye.name,Ye)};var qe=Ye,Je=function(){var t=this.$createElement;return(this._self._c||t)("div",{staticClass:"el-button-group"},[this._t("default")],2)};Je._withStripped=!0;var Ze=i({name:"ElButtonGroup"},Je,[],!1,null,null,null);Ze.options.__file="packages/button/src/button-group.vue";var Qe=Ze.exports;Qe.install=function(t){t.component(Qe.name,Qe)};var tn=Qe,en=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"el-table",class:[{"el-table--fit":t.fit,"el-table--striped":t.stripe,"el-table--border":t.border||t.isGroup,"el-table--hidden":t.isHidden,"el-table--group":t.isGroup,"el-table--fluid-height":t.maxHeight,"el-table--scrollable-x":t.layout.scrollX,"el-table--scrollable-y":t.layout.scrollY,"el-table--enable-row-hover":!t.store.states.isComplex,"el-table--enable-row-transition":0!==(t.store.states.data||[]).length&&(t.store.states.data||[]).length<100},t.tableSize?"el-table--"+t.tableSize:""],on:{mouseleave:function(e){t.handleMouseLeave(e)}}},[n("div",{ref:"hiddenColumns",staticClass:"hidden-columns"},[t._t("default")],2),t.showHeader?n("div",{directives:[{name:"mousewheel",rawName:"v-mousewheel",value:t.handleHeaderFooterMousewheel,expression:"handleHeaderFooterMousewheel"}],ref:"headerWrapper",staticClass:"el-table__header-wrapper"},[n("table-header",{ref:"tableHeader",style:{width:t.layout.bodyWidth?t.layout.bodyWidth+"px":""},attrs:{store:t.store,border:t.border,"default-sort":t.defaultSort}})],1):t._e(),n("div",{ref:"bodyWrapper",staticClass:"el-table__body-wrapper",class:[t.layout.scrollX?"is-scrolling-"+t.scrollPosition:"is-scrolling-none"],style:[t.bodyHeight]},[n("table-body",{style:{width:t.bodyWidth},attrs:{context:t.context,store:t.store,stripe:t.stripe,"row-class-name":t.rowClassName,"row-style":t.rowStyle,highlight:t.highlightCurrentRow}}),t.data&&0!==t.data.length?t._e():n("div",{ref:"emptyBlock",staticClass:"el-table__empty-block",style:t.emptyBlockStyle},[n("span",{staticClass:"el-table__empty-text"},[t._t("empty",[t._v(t._s(t.emptyText||t.t("el.table.emptyText")))])],2)]),t.$slots.append?n("div",{ref:"appendWrapper",staticClass:"el-table__append-wrapper"},[t._t("append")],2):t._e()],1),t.showSummary?n("div",{directives:[{name:"show",rawName:"v-show",value:t.data&&t.data.length>0,expression:"data && data.length > 0"},{name:"mousewheel",rawName:"v-mousewheel",value:t.handleHeaderFooterMousewheel,expression:"handleHeaderFooterMousewheel"}],ref:"footerWrapper",staticClass:"el-table__footer-wrapper"},[n("table-footer",{style:{width:t.layout.bodyWidth?t.layout.bodyWidth+"px":""},attrs:{store:t.store,border:t.border,"sum-text":t.sumText||t.t("el.table.sumText"),"summary-method":t.summaryMethod,"default-sort":t.defaultSort}})],1):t._e(),t.fixedColumns.length>0?n("div",{directives:[{name:"mousewheel",rawName:"v-mousewheel",value:t.handleFixedMousewheel,expression:"handleFixedMousewheel"}],ref:"fixedWrapper",staticClass:"el-table__fixed",style:[{width:t.layout.fixedWidth?t.layout.fixedWidth+"px":""},t.fixedHeight]},[t.showHeader?n("div",{ref:"fixedHeaderWrapper",staticClass:"el-table__fixed-header-wrapper"},[n("table-header",{ref:"fixedTableHeader",style:{width:t.bodyWidth},attrs:{fixed:"left",border:t.border,store:t.store}})],1):t._e(),n("div",{ref:"fixedBodyWrapper",staticClass:"el-table__fixed-body-wrapper",style:[{top:t.layout.headerHeight+"px"},t.fixedBodyHeight]},[n("table-body",{style:{width:t.bodyWidth},attrs:{fixed:"left",store:t.store,stripe:t.stripe,highlight:t.highlightCurrentRow,"row-class-name":t.rowClassName,"row-style":t.rowStyle}}),t.$slots.append?n("div",{staticClass:"el-table__append-gutter",style:{height:t.layout.appendHeight+"px"}}):t._e()],1),t.showSummary?n("div",{directives:[{name:"show",rawName:"v-show",value:t.data&&t.data.length>0,expression:"data && data.length > 0"}],ref:"fixedFooterWrapper",staticClass:"el-table__fixed-footer-wrapper"},[n("table-footer",{style:{width:t.bodyWidth},attrs:{fixed:"left",border:t.border,"sum-text":t.sumText||t.t("el.table.sumText"),"summary-method":t.summaryMethod,store:t.store}})],1):t._e()]):t._e(),t.rightFixedColumns.length>0?n("div",{directives:[{name:"mousewheel",rawName:"v-mousewheel",value:t.handleFixedMousewheel,expression:"handleFixedMousewheel"}],ref:"rightFixedWrapper",staticClass:"el-table__fixed-right",style:[{width:t.layout.rightFixedWidth?t.layout.rightFixedWidth+"px":"",right:t.layout.scrollY?(t.border?t.layout.gutterWidth:t.layout.gutterWidth||0)+"px":""},t.fixedHeight]},[t.showHeader?n("div",{ref:"rightFixedHeaderWrapper",staticClass:"el-table__fixed-header-wrapper"},[n("table-header",{ref:"rightFixedTableHeader",style:{width:t.bodyWidth},attrs:{fixed:"right",border:t.border,store:t.store}})],1):t._e(),n("div",{ref:"rightFixedBodyWrapper",staticClass:"el-table__fixed-body-wrapper",style:[{top:t.layout.headerHeight+"px"},t.fixedBodyHeight]},[n("table-body",{style:{width:t.bodyWidth},attrs:{fixed:"right",store:t.store,stripe:t.stripe,"row-class-name":t.rowClassName,"row-style":t.rowStyle,highlight:t.highlightCurrentRow}}),t.$slots.append?n("div",{staticClass:"el-table__append-gutter",style:{height:t.layout.appendHeight+"px"}}):t._e()],1),t.showSummary?n("div",{directives:[{name:"show",rawName:"v-show",value:t.data&&t.data.length>0,expression:"data && data.length > 0"}],ref:"rightFixedFooterWrapper",staticClass:"el-table__fixed-footer-wrapper"},[n("table-footer",{style:{width:t.bodyWidth},attrs:{fixed:"right",border:t.border,"sum-text":t.sumText||t.t("el.table.sumText"),"summary-method":t.summaryMethod,store:t.store}})],1):t._e()]):t._e(),t.rightFixedColumns.length>0?n("div",{ref:"rightFixedPatch",staticClass:"el-table__fixed-right-patch",style:{width:t.layout.scrollY?t.layout.gutterWidth+"px":"0",height:t.layout.headerHeight+"px"}}):t._e(),n("div",{directives:[{name:"show",rawName:"v-show",value:t.resizeProxyVisible,expression:"resizeProxyVisible"}],ref:"resizeProxy",staticClass:"el-table__column-resize-proxy"})])};en._withStripped=!0;var nn=n(16),rn=n.n(nn),on=n(35),sn=n(38),an=n.n(sn),ln="undefined"!=typeof navigator&&navigator.userAgent.toLowerCase().indexOf("firefox")>-1,un={bind:function(t,e){var n,r;n=t,r=e.value,n&&n.addEventListener&&n.addEventListener(ln?"DOMMouseScroll":"mousewheel",function(t){var e=an()(t);r&&r.apply(this,[t,e])})}},cn=n(6),hn=n.n(cn),dn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pn=function(t){for(var e=t.target;e&&"HTML"!==e.tagName.toUpperCase();){if("TD"===e.tagName.toUpperCase())return e;e=e.parentNode}return null},fn=function(t){return null!==t&&"object"===(void 0===t?"undefined":dn(t))},gn=function(t,e,n,r,i){if(!e&&!r&&(!i||Array.isArray(i)&&!i.length))return t;n="string"==typeof n?"descending"===n?-1:1:n&&n<0?-1:1;var o=r?null:function(n,r){return i?(Array.isArray(i)||(i=[i]),i.map(function(e){return"string"==typeof e?Object(g.getValueByPath)(n,e):e(n,r,t)})):("$key"!==e&&fn(n)&&"$value"in n&&(n=n.$value),[fn(n)?Object(g.getValueByPath)(n,e):n])};return t.map(function(t,e){return{value:t,index:e,key:o?o(t,e):null}}).sort(function(t,e){var i=function(t,e){if(r)return r(t.value,e.value);for(var n=0,i=t.key.length;n<i;n++){if(t.key[n]<e.key[n])return-1;if(t.key[n]>e.key[n])return 1}return 0}(t,e);return i||(i=t.index-e.index),i*n}).map(function(t){return t.value})},mn=function(t,e){var n=null;return t.columns.forEach(function(t){t.id===e&&(n=t)}),n},vn=function(t,e){var n=(e.className||"").match(/el-table_[^\s]+/gm);return n?mn(t,n[0]):null},bn=function(t,e){if(!t)throw new Error("row is required when get row identity");if("string"==typeof e){if(e.indexOf(".")<0)return t[e];for(var n=e.split("."),r=t,i=0;i<n.length;i++)r=r[n[i]];return r}if("function"==typeof e)return e.call(null,t)},_n=function(t,e){var n={};return(t||[]).forEach(function(t,r){n[bn(t,e)]={row:t,index:r}}),n};function yn(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Tn(t){return void 0!==t&&(t=parseInt(t,10),isNaN(t)&&(t=null)),t}function xn(t){return"number"==typeof t?t:"string"==typeof t?/^\d+(?:px)?$/.test(t)?parseInt(t,10):t:null}function En(t,e,n){var r=!1,i=t.indexOf(e),o=-1!==i,s=function(){t.push(e),r=!0},a=function(){t.splice(i,1),r=!0};return"boolean"==typeof n?n&&!o?s():!n&&o&&a():o?a():s(),r}function wn(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"children",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"hasChildren",i=function(t){return!(Array.isArray(t)&&t.length)};t.forEach(function(t){if(t[r])e(t,null,0);else{var o=t[n];i(o)||function t(o,s,a){e(o,s,a),s.forEach(function(o){if(o[r])e(o,null,a+1);else{var s=o[n];i(s)||t(o,s,a+1)}})}(t,o,0)}})}var Cn={data:function(){return{states:{defaultExpandAll:!1,expandRows:[]}}},methods:{updateExpandRows:function(){var t=this.states,e=t.data,n=void 0===e?[]:e,r=t.rowKey,i=t.defaultExpandAll,o=t.expandRows;if(i)this.states.expandRows=n.slice();else if(r){var s=_n(o,r);this.states.expandRows=n.reduce(function(t,e){var n=bn(e,r);return s[n]&&t.push(e),t},[])}else this.states.expandRows=[]},toggleRowExpansion:function(t,e){En(this.states.expandRows,t,e)&&(this.table.$emit("expand-change",t,this.states.expandRows.slice()),this.scheduleLayout())},setExpandRowKeys:function(t){this.assertRowKey();var e=this.states,n=e.data,r=e.rowKey,i=_n(n,r);this.states.expandRows=t.reduce(function(t,e){var n=i[e];return n&&t.push(n.row),t},[])},isRowExpanded:function(t){var e=this.states,n=e.expandRows,r=void 0===n?[]:n,i=e.rowKey;return i?!!_n(r,i)[bn(t,i)]:-1!==r.indexOf(t)}}},Sn={data:function(){return{states:{_currentRowKey:null,currentRow:null}}},methods:{setCurrentRowKey:function(t){this.assertRowKey(),this.states._currentRowKey=t,this.setCurrentRowByKey(t)},restoreCurrentRowKey:function(){this.states._currentRowKey=null},setCurrentRowByKey:function(t){var e=this.states,n=e.data,r=void 0===n?[]:n,i=e.rowKey,o=null;i&&(o=Object(g.arrayFind)(r,function(e){return bn(e,i)===t})),e.currentRow=o},updateCurrentRow:function(t){var e=this.states,n=this.table,r=e.currentRow;if(t&&t!==r)return e.currentRow=t,void n.$emit("current-change",t,r);!t&&r&&(e.currentRow=null,n.$emit("current-change",null,r))},updateCurrentRowData:function(){var t=this.states,e=this.table,n=t.rowKey,r=t._currentRowKey,i=t.data||[],o=t.currentRow;if(-1===i.indexOf(o)&&o){if(n){var s=bn(o,n);this.setCurrentRowByKey(s)}else t.currentRow=null;null===t.currentRow&&e.$emit("current-change",null,o)}else r&&(this.setCurrentRowByKey(r),this.restoreCurrentRowKey())}}},kn=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},On={data:function(){return{states:{expandRowKeys:[],treeData:{},indent:16,lazy:!1,lazyTreeNodeMap:{},lazyColumnIdentifier:"hasChildren",childrenColumnName:"children"}}},computed:{normalizedData:function(){if(!this.states.rowKey)return{};var t=this.states.data||[];return this.normalize(t)},normalizedLazyNode:function(){var t=this.states,e=t.rowKey,n=t.lazyTreeNodeMap,r=t.lazyColumnIdentifier,i=Object.keys(n),o={};return i.length?(i.forEach(function(t){if(n[t].length){var i={children:[]};n[t].forEach(function(t){var n=bn(t,e);i.children.push(n),t[r]&&!o[n]&&(o[n]={children:[]})}),o[t]=i}}),o):o}},watch:{normalizedData:"updateTreeData",normalizedLazyNode:"updateTreeData"},methods:{normalize:function(t){var e=this.states,n=e.childrenColumnName,r=e.lazyColumnIdentifier,i=e.rowKey,o=e.lazy,s={};return wn(t,function(t,e,n){var r=bn(t,i);Array.isArray(e)?s[r]={children:e.map(function(t){return bn(t,i)}),level:n}:o&&(s[r]={children:[],lazy:!0,level:n})},n,r),s},updateTreeData:function(){var t=this.normalizedData,e=this.normalizedLazyNode,n=Object.keys(t),r={};if(n.length){var i=this.states,o=i.treeData,s=i.defaultExpandAll,a=i.expandRowKeys,l=i.lazy,u=[],c=function(t,e){var n=s||a&&-1!==a.indexOf(e);return!!(t&&t.expanded||n)};n.forEach(function(e){var n=o[e],i=kn({},t[e]);if(i.expanded=c(n,e),i.lazy){var s=n||{},a=s.loaded,l=void 0!==a&&a,h=s.loading,d=void 0!==h&&h;i.loaded=!!l,i.loading=!!d,u.push(e)}r[e]=i});var h=Object.keys(e);l&&h.length&&u.length&&h.forEach(function(t){var n=o[t],i=e[t].children;if(-1!==u.indexOf(t)){if(0!==r[t].children.length)throw new Error("[ElTable]children must be an empty array.");r[t].children=i}else{var s=n||{},a=s.loaded,l=void 0!==a&&a,h=s.loading,d=void 0!==h&&h;r[t]={lazy:!0,loaded:!!l,loading:!!d,expanded:c(n,t),children:i,level:""}}})}this.states.treeData=r,this.updateTableScrollY()},updateTreeExpandKeys:function(t){this.states.expandRowKeys=t,this.updateTreeData()},toggleTreeExpansion:function(t,e){this.assertRowKey();var n=this.states,r=n.rowKey,i=n.treeData,o=bn(t,r),s=o&&i[o];if(o&&s&&"expanded"in s){var a=s.expanded;e=void 0===e?!s.expanded:e,i[o].expanded=e,a!==e&&this.table.$emit("expand-change",t,e),this.updateTableScrollY()}},loadOrToggle:function(t){this.assertRowKey();var e=this.states,n=e.lazy,r=e.treeData,i=e.rowKey,o=bn(t,i),s=r[o];n&&s&&"loaded"in s&&!s.loaded?this.loadData(t,o,s):this.toggleTreeExpansion(t)},loadData:function(t,e,n){var r=this,i=this.table.load,o=this.states.treeData;i&&!o[e].loaded&&(o[e].loading=!0,i(t,n,function(n){if(!Array.isArray(n))throw new Error("[ElTable] data must be an array");var i=r.states,o=i.lazyTreeNodeMap,s=i.treeData;s[e].loading=!1,s[e].loaded=!0,s[e].expanded=!0,n.length&&r.$set(o,e,n),r.table.$emit("expand-change",t,!0)}))}}},In=function t(e){var n=[];return e.forEach(function(e){e.children?n.push.apply(n,t(e.children)):n.push(e)}),n},Rn=hn.a.extend({data:function(){return{states:{rowKey:null,data:[],isComplex:!1,_columns:[],originColumns:[],columns:[],fixedColumns:[],rightFixedColumns:[],leafColumns:[],fixedLeafColumns:[],rightFixedLeafColumns:[],leafColumnsLength:0,fixedLeafColumnsLength:0,rightFixedLeafColumnsLength:0,isAllSelected:!1,selection:[],reserveSelection:!1,selectOnIndeterminate:!1,selectable:null,filters:{},filteredData:null,sortingColumn:null,sortProp:null,sortOrder:null,hoverRow:null}}},mixins:[Cn,Sn,On],methods:{assertRowKey:function(){if(!this.states.rowKey)throw new Error("[ElTable] prop row-key is required")},updateColumns:function(){var t=this.states,e=t._columns||[];t.fixedColumns=e.filter(function(t){return!0===t.fixed||"left"===t.fixed}),t.rightFixedColumns=e.filter(function(t){return"right"===t.fixed}),t.fixedColumns.length>0&&e[0]&&"selection"===e[0].type&&!e[0].fixed&&(e[0].fixed=!0,t.fixedColumns.unshift(e[0]));var n=e.filter(function(t){return!t.fixed});t.originColumns=[].concat(t.fixedColumns).concat(n).concat(t.rightFixedColumns);var r=In(n),i=In(t.fixedColumns),o=In(t.rightFixedColumns);t.leafColumnsLength=r.length,t.fixedLeafColumnsLength=i.length,t.rightFixedLeafColumnsLength=o.length,t.columns=[].concat(i).concat(r).concat(o),t.isComplex=t.fixedColumns.length>0||t.rightFixedColumns.length>0},scheduleLayout:function(t){t&&this.updateColumns(),this.table.debouncedUpdateLayout()},isSelected:function(t){var e=this.states.selection;return(void 0===e?[]:e).indexOf(t)>-1},clearSelection:function(){var t=this.states;t.isAllSelected=!1,t.selection.length&&(t.selection=[],this.table.$emit("selection-change",[]))},cleanSelection:function(){var t=this.states,e=t.data,n=t.rowKey,r=t.selection,i=void 0;if(n){i=[];var o=_n(r,n),s=_n(e,n);for(var a in o)o.hasOwnProperty(a)&&!s[a]&&i.push(o[a].row)}else i=r.filter(function(t){return-1===e.indexOf(t)});if(i.length){var l=r.filter(function(t){return-1===i.indexOf(t)});t.selection=l,this.table.$emit("selection-change",l.slice())}},toggleRowSelection:function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(En(this.states.selection,t,e)){var r=(this.states.selection||[]).slice();n&&this.table.$emit("select",r,t),this.table.$emit("selection-change",r)}},_toggleAllSelection:function(){var t=this.states,e=t.data,n=void 0===e?[]:e,r=t.selection,i=t.selectOnIndeterminate?!t.isAllSelected:!(t.isAllSelected||r.length);t.isAllSelected=i;var o=!1;n.forEach(function(e,n){t.selectable?t.selectable.call(null,e,n)&&En(r,e,i)&&(o=!0):En(r,e,i)&&(o=!0)}),o&&this.table.$emit("selection-change",r?r.slice():[]),this.table.$emit("select-all",r)},updateSelectionByRowKey:function(){var t=this.states,e=t.selection,n=t.rowKey,r=t.data,i=_n(e,n);r.forEach(function(t){var r=bn(t,n),o=i[r];o&&(e[o.index]=t)})},updateAllSelected:function(){var t=this.states,e=t.selection,n=t.rowKey,r=t.selectable,i=t.data||[];if(0!==i.length){var o=void 0;n&&(o=_n(e,n));for(var s,a=!0,l=0,u=0,c=i.length;u<c;u++){var h=i[u],d=r&&r.call(null,h,u);if(s=h,o?o[bn(s,n)]:-1!==e.indexOf(s))l++;else if(!r||d){a=!1;break}}0===l&&(a=!1),t.isAllSelected=a}else t.isAllSelected=!1},updateFilters:function(t,e){Array.isArray(t)||(t=[t]);var n=this.states,r={};return t.forEach(function(t){n.filters[t.id]=e,r[t.columnKey||t.id]=e}),r},updateSort:function(t,e,n){this.states.sortingColumn&&this.states.sortingColumn!==t&&(this.states.sortingColumn.order=null),this.states.sortingColumn=t,this.states.sortProp=e,this.states.sortOrder=n},execFilter:function(){var t=this,e=this.states,n=e._data,r=e.filters,i=n;Object.keys(r).forEach(function(n){var r=e.filters[n];if(r&&0!==r.length){var o=mn(t.states,n);o&&o.filterMethod&&(i=i.filter(function(t){return r.some(function(e){return o.filterMethod.call(null,e,t,o)})}))}}),e.filteredData=i},execSort:function(){var t=this.states;t.data=function(t,e){var n=e.sortingColumn;return n&&"string"!=typeof n.sortable?gn(t,e.sortProp,e.sortOrder,n.sortMethod,n.sortBy):t}(t.filteredData,t)},execQuery:function(t){t&&t.filter||this.execFilter(),this.execSort()},clearFilter:function(t){var e=this.states,n=this.table.$refs,r=n.tableHeader,i=n.fixedTableHeader,o=n.rightFixedTableHeader,s={};r&&(s=Ut()(s,r.filterPanels)),i&&(s=Ut()(s,i.filterPanels)),o&&(s=Ut()(s,o.filterPanels));var a=Object.keys(s);if(a.length)if("string"==typeof t&&(t=[t]),Array.isArray(t)){var l=t.map(function(t){return function(t,e){for(var n=null,r=0;r<t.columns.length;r++){var i=t.columns[r];if(i.columnKey===e){n=i;break}}return n}(e,t)});a.forEach(function(t){l.find(function(e){return e.id===t})&&(s[t].filteredValue=[])}),this.commit("filterChange",{column:l,values:[],silent:!0,multi:!0})}else a.forEach(function(t){s[t].filteredValue=[]}),e.filters={},this.commit("filterChange",{column:{},values:[],silent:!0})},clearSort:function(){this.states.sortingColumn&&(this.updateSort(null,null,null),this.commit("changeSortCondition",{silent:!0}))},setExpandRowKeysAdapter:function(t){this.setExpandRowKeys(t),this.updateTreeExpandKeys(t)},toggleRowExpansionAdapter:function(t,e){this.states.columns.some(function(t){return"expand"===t.type})?this.toggleRowExpansion(t,e):this.toggleTreeExpansion(t,e)}}});Rn.prototype.mutations={setData:function(t,e){var n=t._data!==e;t._data=e,this.execQuery(),this.updateCurrentRowData(),this.updateExpandRows(),t.reserveSelection?(this.assertRowKey(),this.updateSelectionByRowKey()):n?this.clearSelection():this.cleanSelection(),this.updateAllSelected(),this.updateTableScrollY()},insertColumn:function(t,e,n,r){var i=t._columns;r&&((i=r.children)||(i=r.children=[])),void 0!==n?i.splice(n,0,e):i.push(e),"selection"===e.type&&(t.selectable=e.selectable,t.reserveSelection=e.reserveSelection),this.table.$ready&&(this.updateColumns(),this.scheduleLayout())},removeColumn:function(t,e,n){var r=t._columns;n&&((r=n.children)||(r=n.children=[])),r&&r.splice(r.indexOf(e),1),this.table.$ready&&(this.updateColumns(),this.scheduleLayout())},sort:function(t,e){var n=e.prop,r=e.order,i=e.init;if(n){var o=Object(g.arrayFind)(t.columns,function(t){return t.property===n});o&&(o.order=r,this.updateSort(o,n,r),this.commit("changeSortCondition",{init:i}))}},changeSortCondition:function(t,e){var n=t.sortingColumn,r=t.sortProp,i=t.sortOrder;null===i&&(t.sortingColumn=null,t.sortProp=null);this.execQuery({filter:!0}),e&&(e.silent||e.init)||this.table.$emit("sort-change",{column:n,prop:r,order:i}),this.updateTableScrollY()},filterChange:function(t,e){var n=e.column,r=e.values,i=e.silent,o=this.updateFilters(n,r);this.execQuery(),i||this.table.$emit("filter-change",o),this.updateTableScrollY()},toggleAllSelection:function(){this.toggleAllSelection()},rowSelectedChanged:function(t,e){this.toggleRowSelection(e),this.updateAllSelected()},setHoverRow:function(t,e){t.hoverRow=e},setCurrentRow:function(t,e){this.updateCurrentRow(e)}},Rn.prototype.commit=function(t){var e=this.mutations;if(!e[t])throw new Error("Action not found: "+t);for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];e[t].apply(this,[this.states].concat(r))},Rn.prototype.updateTableScrollY=function(){hn.a.nextTick(this.table.updateScrollY)};var An=Rn;function Nn(t){var e={};return Object.keys(t).forEach(function(n){var r=t[n],i=void 0;"string"==typeof r?i=function(){return this.store.states[r]}:"function"==typeof r?i=function(){return r.call(this,this.store.states)}:console.error("invalid value type"),i&&(e[n]=i)}),e}var Dn=n(30),Mn=n.n(Dn);var Ln=function(){function t(e){for(var n in function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.observers=[],this.table=null,this.store=null,this.columns=null,this.fit=!0,this.showHeader=!0,this.height=null,this.scrollX=!1,this.scrollY=!1,this.bodyWidth=null,this.fixedWidth=null,this.rightFixedWidth=null,this.tableHeight=null,this.headerHeight=44,this.appendHeight=0,this.footerHeight=44,this.viewportHeight=null,this.bodyHeight=null,this.fixedBodyHeight=null,this.gutterWidth=Mn()(),e)e.hasOwnProperty(n)&&(this[n]=e[n]);if(!this.table)throw new Error("table is required for Table Layout");if(!this.store)throw new Error("store is required for Table Layout")}return t.prototype.updateScrollY=function(){if(null===this.height)return!1;var t=this.table.bodyWrapper;if(this.table.$el&&t){var e=t.querySelector(".el-table__body"),n=this.scrollY,r=e.offsetHeight>this.bodyHeight;return this.scrollY=r,n!==r}return!1},t.prototype.setHeight=function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"height";if(!hn.a.prototype.$isServer){var r=this.table.$el;if(t=xn(t),this.height=t,!r&&(t||0===t))return hn.a.nextTick(function(){return e.setHeight(t,n)});"number"==typeof t?(r.style[n]=t+"px",this.updateElsHeight()):"string"==typeof t&&(r.style[n]=t,this.updateElsHeight())}},t.prototype.setMaxHeight=function(t){this.setHeight(t,"max-height")},t.prototype.getFlattenColumns=function(){var t=[];return this.table.columns.forEach(function(e){e.isColumnGroup?t.push.apply(t,e.columns):t.push(e)}),t},t.prototype.updateElsHeight=function(){var t=this;if(!this.table.$ready)return hn.a.nextTick(function(){return t.updateElsHeight()});var e=this.table.$refs,n=e.headerWrapper,r=e.appendWrapper,i=e.footerWrapper;if(this.appendHeight=r?r.offsetHeight:0,!this.showHeader||n){var o=n?n.querySelector(".el-table__header tr"):null,s=this.headerDisplayNone(o),a=this.headerHeight=this.showHeader?n.offsetHeight:0;if(this.showHeader&&!s&&n.offsetWidth>0&&(this.table.columns||[]).length>0&&a<2)return hn.a.nextTick(function(){return t.updateElsHeight()});var l=this.tableHeight=this.table.$el.clientHeight,u=this.footerHeight=i?i.offsetHeight:0;null!==this.height&&(this.bodyHeight=l-a-u+(i?1:0)),this.fixedBodyHeight=this.scrollX?this.bodyHeight-this.gutterWidth:this.bodyHeight;var c=!(this.store.states.data&&this.store.states.data.length);this.viewportHeight=this.scrollX?l-(c?0:this.gutterWidth):l,this.updateScrollY(),this.notifyObservers("scrollable")}},t.prototype.headerDisplayNone=function(t){if(!t)return!0;for(var e=t;"DIV"!==e.tagName;){if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1},t.prototype.updateColumnsWidth=function(){if(!hn.a.prototype.$isServer){var t=this.fit,e=this.table.$el.clientWidth,n=0,r=this.getFlattenColumns(),i=r.filter(function(t){return"number"!=typeof t.width});if(r.forEach(function(t){"number"==typeof t.width&&t.realWidth&&(t.realWidth=null)}),i.length>0&&t){r.forEach(function(t){n+=t.width||t.minWidth||80});var o=this.scrollY?this.gutterWidth:0;if(n<=e-o){this.scrollX=!1;var s=e-o-n;if(1===i.length)i[0].realWidth=(i[0].minWidth||80)+s;else{var a=s/i.reduce(function(t,e){return t+(e.minWidth||80)},0),l=0;i.forEach(function(t,e){if(0!==e){var n=Math.floor((t.minWidth||80)*a);l+=n,t.realWidth=(t.minWidth||80)+n}}),i[0].realWidth=(i[0].minWidth||80)+s-l}}else this.scrollX=!0,i.forEach(function(t){t.realWidth=t.minWidth});this.bodyWidth=Math.max(n,e),this.table.resizeState.width=this.bodyWidth}else r.forEach(function(t){t.width||t.minWidth?t.realWidth=t.width||t.minWidth:t.realWidth=80,n+=t.realWidth}),this.scrollX=n>e,this.bodyWidth=n;var u=this.store.states.fixedColumns;if(u.length>0){var c=0;u.forEach(function(t){c+=t.realWidth||t.width}),this.fixedWidth=c}var h=this.store.states.rightFixedColumns;if(h.length>0){var d=0;h.forEach(function(t){d+=t.realWidth||t.width}),this.rightFixedWidth=d}this.notifyObservers("columns")}},t.prototype.addObserver=function(t){this.observers.push(t)},t.prototype.removeObserver=function(t){var e=this.observers.indexOf(t);-1!==e&&this.observers.splice(e,1)},t.prototype.notifyObservers=function(t){var e=this;this.observers.forEach(function(n){switch(t){case"columns":n.onColumnsChange(e);break;case"scrollable":n.onScrollableChange(e);break;default:throw new Error("Table Layout don't have event "+t+".")}})},t}(),Pn={created:function(){this.tableLayout.addObserver(this)},destroyed:function(){this.tableLayout.removeObserver(this)},computed:{tableLayout:function(){var t=this.layout;if(!t&&this.table&&(t=this.table.layout),!t)throw new Error("Can not find table layout.");return t}},mounted:function(){this.onColumnsChange(this.tableLayout),this.onScrollableChange(this.tableLayout)},updated:function(){this.__updated__||(this.onColumnsChange(this.tableLayout),this.onScrollableChange(this.tableLayout),this.__updated__=!0)},methods:{onColumnsChange:function(t){var e=this.$el.querySelectorAll("colgroup > col");if(e.length){var n={};t.getFlattenColumns().forEach(function(t){n[t.id]=t});for(var r=0,i=e.length;r<i;r++){var o=e[r],s=o.getAttribute("name"),a=n[s];a&&o.setAttribute("width",a.realWidth||a.width)}}},onScrollableChange:function(t){for(var e=this.$el.querySelectorAll("colgroup > col[name=gutter]"),n=0,r=e.length;n<r;n++){e[n].setAttribute("width",t.scrollY?t.gutterWidth:"0")}for(var i=this.$el.querySelectorAll("th.gutter"),o=0,s=i.length;o<s;o++){var a=i[o];a.style.width=t.scrollY?t.gutterWidth+"px":"0",a.style.display=t.scrollY?"":"none"}}}},Fn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bn=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},jn={name:"ElTableBody",mixins:[Pn],components:{ElCheckbox:rn.a,ElTooltip:kt.a},props:{store:{required:!0},stripe:Boolean,context:{},rowClassName:[String,Function],rowStyle:[Object,Function],fixed:String,highlight:Boolean},render:function(t){var e=this,n=this.data||[];return t("table",{class:"el-table__body",attrs:{cellspacing:"0",cellpadding:"0",border:"0"}},[t("colgroup",[this.columns.map(function(e){return t("col",{attrs:{name:e.id},key:e.id})})]),t("tbody",[n.reduce(function(t,n){return t.concat(e.wrappedRowRender(n,t.length))},[]),t("el-tooltip",{attrs:{effect:this.table.tooltipEffect,placement:"top",content:this.tooltipContent},ref:"tooltip"})])])},computed:Bn({table:function(){return this.$parent}},Nn({data:"data",columns:"columns",treeIndent:"indent",leftFixedLeafCount:"fixedLeafColumnsLength",rightFixedLeafCount:"rightFixedLeafColumnsLength",columnsCount:function(t){return t.columns.length},leftFixedCount:function(t){return t.fixedColumns.length},rightFixedCount:function(t){return t.rightFixedColumns.length},hasExpandColumn:function(t){return t.columns.some(function(t){return"expand"===t.type})}}),{firstDefaultColumnIndex:function(){return Object(g.arrayFindIndex)(this.columns,function(t){return"default"===t.type})}}),watch:{"store.states.hoverRow":function(t,e){var n=this;if(this.store.states.isComplex&&!this.$isServer){var r=window.requestAnimationFrame;r||(r=function(t){return setTimeout(t,16)}),r(function(){var r=n.$el.querySelectorAll(".el-table__row"),i=r[e],o=r[t];i&&Object(ft.removeClass)(i,"hover-row"),o&&Object(ft.addClass)(o,"hover-row")})}}},data:function(){return{tooltipContent:""}},created:function(){this.activateTooltip=R()(50,function(t){return t.handleShowPopper()})},methods:{getKeyOfRow:function(t,e){var n=this.table.rowKey;return n?bn(t,n):e},isColumnHidden:function(t){return!0===this.fixed||"left"===this.fixed?t>=this.leftFixedLeafCount:"right"===this.fixed?t<this.columnsCount-this.rightFixedLeafCount:t<this.leftFixedLeafCount||t>=this.columnsCount-this.rightFixedLeafCount},getSpan:function(t,e,n,r){var i=1,o=1,s=this.table.spanMethod;if("function"==typeof s){var a=s({row:t,column:e,rowIndex:n,columnIndex:r});Array.isArray(a)?(i=a[0],o=a[1]):"object"===(void 0===a?"undefined":Fn(a))&&(i=a.rowspan,o=a.colspan)}return{rowspan:i,colspan:o}},getRowStyle:function(t,e){var n=this.table.rowStyle;return"function"==typeof n?n.call(null,{row:t,rowIndex:e}):n||null},getRowClass:function(t,e){var n=["el-table__row"];this.table.highlightCurrentRow&&t===this.store.states.currentRow&&n.push("current-row"),this.stripe&&e%2==1&&n.push("el-table__row--striped");var r=this.table.rowClassName;return"string"==typeof r?n.push(r):"function"==typeof r&&n.push(r.call(null,{row:t,rowIndex:e})),this.store.states.expandRows.indexOf(t)>-1&&n.push("expanded"),n},getCellStyle:function(t,e,n,r){var i=this.table.cellStyle;return"function"==typeof i?i.call(null,{rowIndex:t,columnIndex:e,row:n,column:r}):i},getCellClass:function(t,e,n,r){var i=[r.id,r.align,r.className];this.isColumnHidden(e)&&i.push("is-hidden");var o=this.table.cellClassName;return"string"==typeof o?i.push(o):"function"==typeof o&&i.push(o.call(null,{rowIndex:t,columnIndex:e,row:n,column:r})),i.join(" ")},getColspanRealWidth:function(t,e,n){return e<1?t[n].realWidth:t.map(function(t){return t.realWidth}).slice(n,n+e).reduce(function(t,e){return t+e},-1)},handleCellMouseEnter:function(t,e){var n=this.table,r=pn(t);if(r){var i=vn(n,r),o=n.hoverState={cell:r,column:i,row:e};n.$emit("cell-mouse-enter",o.row,o.column,o.cell,t)}var s=t.target.querySelector(".cell");if(Object(ft.hasClass)(s,"el-tooltip")&&s.childNodes.length){var a=document.createRange();if(a.setStart(s,0),a.setEnd(s,s.childNodes.length),(a.getBoundingClientRect().width+((parseInt(Object(ft.getStyle)(s,"paddingLeft"),10)||0)+(parseInt(Object(ft.getStyle)(s,"paddingRight"),10)||0))>s.offsetWidth||s.scrollWidth>s.offsetWidth)&&this.$refs.tooltip){var l=this.$refs.tooltip;this.tooltipContent=r.innerText||r.textContent,l.referenceElm=r,l.$refs.popper&&(l.$refs.popper.style.display="none"),l.doDestroy(),l.setExpectedState(!0),this.activateTooltip(l)}}},handleCellMouseLeave:function(t){var e=this.$refs.tooltip;if(e&&(e.setExpectedState(!1),e.handleClosePopper()),pn(t)){var n=this.table.hoverState||{};this.table.$emit("cell-mouse-leave",n.row,n.column,n.cell,t)}},handleMouseEnter:R()(30,function(t){this.store.commit("setHoverRow",t)}),handleMouseLeave:R()(30,function(){this.store.commit("setHoverRow",null)}),handleContextMenu:function(t,e){this.handleEvent(t,e,"contextmenu")},handleDoubleClick:function(t,e){this.handleEvent(t,e,"dblclick")},handleClick:function(t,e){this.store.commit("setCurrentRow",e),this.handleEvent(t,e,"click")},handleEvent:function(t,e,n){var r=this.table,i=pn(t),o=void 0;i&&(o=vn(r,i))&&r.$emit("cell-"+n,e,o,i,t),r.$emit("row-"+n,e,o,t)},rowRender:function(t,e,n){var r=this,i=this.$createElement,o=this.treeIndent,s=this.columns,a=this.firstDefaultColumnIndex,l=s.map(function(t,e){return r.isColumnHidden(e)}),u=this.getRowClass(t,e),c=!0;return n&&(u.push("el-table__row--level-"+n.level),c=n.display),i("tr",{style:[c?null:{display:"none"},this.getRowStyle(t,e)],class:u,key:this.getKeyOfRow(t,e),on:{dblclick:function(e){return r.handleDoubleClick(e,t)},click:function(e){return r.handleClick(e,t)},contextmenu:function(e){return r.handleContextMenu(e,t)},mouseenter:function(t){return r.handleMouseEnter(e)},mouseleave:this.handleMouseLeave}},[s.map(function(u,c){var h=r.getSpan(t,u,e,c),d=h.rowspan,p=h.colspan;if(!d||!p)return null;var f=Bn({},u);f.realWidth=r.getColspanRealWidth(s,p,c);var g={store:r.store,_self:r.context||r.table.$vnode.context,column:f,row:t,$index:e};return c===a&&n&&(g.treeNode={indent:n.level*o,level:n.level},"boolean"==typeof n.expanded&&(g.treeNode.expanded=n.expanded,"loading"in n&&(g.treeNode.loading=n.loading),"noLazyChildren"in n&&(g.treeNode.noLazyChildren=n.noLazyChildren))),i("td",{style:r.getCellStyle(e,c,t,u),class:r.getCellClass(e,c,t,u),attrs:{rowspan:d,colspan:p},on:{mouseenter:function(e){return r.handleCellMouseEnter(e,t)},mouseleave:r.handleCellMouseLeave}},[u.renderCell.call(r._renderProxy,r.$createElement,g,l[c])])})])},wrappedRowRender:function(t,e){var n=this,r=this.$createElement,i=this.store,o=i.isRowExpanded,s=i.assertRowKey,a=i.states,l=a.treeData,u=a.lazyTreeNodeMap,c=a.childrenColumnName,h=a.rowKey;if(this.hasExpandColumn&&o(t)){var d=this.table.renderExpanded,p=this.rowRender(t,e);return d?[[p,r("tr",{key:"expanded-row__"+p.key},[r("td",{attrs:{colspan:this.columnsCount},class:"el-table__expanded-cell"},[d(this.$createElement,{row:t,$index:e,store:this.store})])])]]:(console.error("[Element Error]renderExpanded is required."),p)}if(Object.keys(l).length){s();var f=bn(t,h),g=l[f],m=null;g&&(m={expanded:g.expanded,level:g.level,display:!0},"boolean"==typeof g.lazy&&("boolean"==typeof g.loaded&&g.loaded&&(m.noLazyChildren=!(g.children&&g.children.length)),m.loading=g.loading));var v=[this.rowRender(t,e,m)];if(g){var b=0;g.display=!0,function t(r,i){r&&r.length&&i&&r.forEach(function(r){var o={display:i.display&&i.expanded,level:i.level+1},s=bn(r,h);if(void 0===s||null===s)throw new Error("for nested data item, row-key is required.");if((g=Bn({},l[s]))&&(o.expanded=g.expanded,g.level=g.level||o.level,g.display=!(!g.expanded||!o.display),"boolean"==typeof g.lazy&&("boolean"==typeof g.loaded&&g.loaded&&(o.noLazyChildren=!(g.children&&g.children.length)),o.loading=g.loading)),b++,v.push(n.rowRender(r,e+b,o)),g){var a=u[s]||r[c];t(a,g)}})}(u[f]||t[c],g)}return v}return this.rowRender(t,e)}}},$n=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("transition",{attrs:{name:"el-zoom-in-top"}},[t.multiple?n("div",{directives:[{name:"clickoutside",rawName:"v-clickoutside",value:t.handleOutsideClick,expression:"handleOutsideClick"},{name:"show",rawName:"v-show",value:t.showPopper,expression:"showPopper"}],staticClass:"el-table-filter"},[n("div",{staticClass:"el-table-filter__content"},[n("el-scrollbar",{attrs:{"wrap-class":"el-table-filter__wrap"}},[n("el-checkbox-group",{staticClass:"el-table-filter__checkbox-group",model:{value:t.filteredValue,callback:function(e){t.filteredValue=e},expression:"filteredValue"}},t._l(t.filters,function(e){return n("el-checkbox",{key:e.value,attrs:{label:e.value}},[t._v(t._s(e.text))])}),1)],1)],1),n("div",{staticClass:"el-table-filter__bottom"},[n("button",{class:{"is-disabled":0===t.filteredValue.length},attrs:{disabled:0===t.filteredValue.length},on:{click:t.handleConfirm}},[t._v(t._s(t.t("el.table.confirmFilter")))]),n("button",{on:{click:t.handleReset}},[t._v(t._s(t.t("el.table.resetFilter")))])])]):n("div",{directives:[{name:"clickoutside",rawName:"v-clickoutside",value:t.handleOutsideClick,expression:"handleOutsideClick"},{name:"show",rawName:"v-show",value:t.showPopper,expression:"showPopper"}],staticClass:"el-table-filter"},[n("ul",{staticClass:"el-table-filter__list"},[n("li",{staticClass:"el-table-filter__list-item",class:{"is-active":void 0===t.filterValue||null===t.filterValue},on:{click:function(e){t.handleSelect(null)}}},[t._v(t._s(t.t("el.table.clearFilter")))]),t._l(t.filters,function(e){return n("li",{key:e.value,staticClass:"el-table-filter__list-item",class:{"is-active":t.isActive(e)},attrs:{label:e.value},on:{click:function(n){t.handleSelect(e.value)}}},[t._v(t._s(e.text))])})],2)])])};$n._withStripped=!0;var Un=[];!hn.a.prototype.$isServer&&document.addEventListener("click",function(t){Un.forEach(function(e){var n=t.target;e&&e.$el&&(n===e.$el||e.$el.contains(n)||e.handleOutsideClick&&e.handleOutsideClick(t))})});var Vn=function(t){t&&Un.push(t)},Hn=function(t){-1!==Un.indexOf(t)&&Un.splice(t,1)},Wn=n(31),Gn=n.n(Wn),zn=i({name:"ElTableFilterPanel",mixins:[L.a,f.a],directives:{Clickoutside:N.a},components:{ElCheckbox:rn.a,ElCheckboxGroup:Gn.a,ElScrollbar:F.a},props:{placement:{type:String,default:"bottom-end"}},methods:{isActive:function(t){return t.value===this.filterValue},handleOutsideClick:function(){var t=this;setTimeout(function(){t.showPopper=!1},16)},handleConfirm:function(){this.confirmFilter(this.filteredValue),this.handleOutsideClick()},handleReset:function(){this.filteredValue=[],this.confirmFilter(this.filteredValue),this.handleOutsideClick()},handleSelect:function(t){this.filterValue=t,void 0!==t&&null!==t?this.confirmFilter(this.filteredValue):this.confirmFilter([]),this.handleOutsideClick()},confirmFilter:function(t){this.table.store.commit("filterChange",{column:this.column,values:t}),this.table.store.updateAllSelected()}},data:function(){return{table:null,cell:null,column:null}},computed:{filters:function(){return this.column&&this.column.filters},filterValue:{get:function(){return(this.column.filteredValue||[])[0]},set:function(t){this.filteredValue&&(void 0!==t&&null!==t?this.filteredValue.splice(0,1,t):this.filteredValue.splice(0,1))}},filteredValue:{get:function(){return this.column&&this.column.filteredValue||[]},set:function(t){this.column&&(this.column.filteredValue=t)}},multiple:function(){return!this.column||this.column.filterMultiple}},mounted:function(){var t=this;this.popperElm=this.$el,this.referenceElm=this.cell,this.table.bodyWrapper.addEventListener("scroll",function(){t.updatePopper()}),this.$watch("showPopper",function(e){t.column&&(t.column.filterOpened=e),e?Vn(t):Hn(t)})},watch:{showPopper:function(t){!0===t&&parseInt(this.popperJS._popper.style.zIndex,10)<_.PopupManager.zIndex&&(this.popperJS._popper.style.zIndex=_.PopupManager.nextZIndex())}}},$n,[],!1,null,null,null);zn.options.__file="packages/table/src/filter-panel.vue";var Xn=zn.exports,Kn=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Yn=function(t){var e=1;t.forEach(function(t){t.level=1,function t(n,r){if(r&&(n.level=r.level+1,e<n.level&&(e=n.level)),n.children){var i=0;n.children.forEach(function(e){t(e,n),i+=e.colSpan}),n.colSpan=i}else n.colSpan=1}(t)});for(var n=[],r=0;r<e;r++)n.push([]);return function t(e){var n=[];return e.forEach(function(e){e.children?(n.push(e),n.push.apply(n,t(e.children))):n.push(e)}),n}(t).forEach(function(t){t.children?t.rowSpan=1:t.rowSpan=e-t.level+1,n[t.level-1].push(t)}),n},qn={name:"ElTableHeader",mixins:[Pn],render:function(t){var e=this,n=this.store.states.originColumns,r=Yn(n,this.columns),i=r.length>1;return i&&(this.$parent.isGroup=!0),t("table",{class:"el-table__header",attrs:{cellspacing:"0",cellpadding:"0",border:"0"}},[t("colgroup",[this.columns.map(function(e){return t("col",{attrs:{name:e.id},key:e.id})}),this.hasGutter?t("col",{attrs:{name:"gutter"}}):""]),t("thead",{class:[{"is-group":i,"has-gutter":this.hasGutter}]},[this._l(r,function(n,r){return t("tr",{style:e.getHeaderRowStyle(r),class:e.getHeaderRowClass(r)},[n.map(function(i,o){return t("th",{attrs:{colspan:i.colSpan,rowspan:i.rowSpan},on:{mousemove:function(t){return e.handleMouseMove(t,i)},mouseout:e.handleMouseOut,mousedown:function(t){return e.handleMouseDown(t,i)},click:function(t){return e.handleHeaderClick(t,i)},contextmenu:function(t){return e.handleHeaderContextMenu(t,i)}},style:e.getHeaderCellStyle(r,o,n,i),class:e.getHeaderCellClass(r,o,n,i),key:i.id},[t("div",{class:["cell",i.filteredValue&&i.filteredValue.length>0?"highlight":"",i.labelClassName]},[i.renderHeader?i.renderHeader.call(e._renderProxy,t,{column:i,$index:o,store:e.store,_self:e.$parent.$vnode.context}):i.label,i.sortable?t("span",{class:"caret-wrapper",on:{click:function(t){return e.handleSortClick(t,i)}}},[t("i",{class:"sort-caret ascending",on:{click:function(t){return e.handleSortClick(t,i,"ascending")}}}),t("i",{class:"sort-caret descending",on:{click:function(t){return e.handleSortClick(t,i,"descending")}}})]):"",i.filterable?t("span",{class:"el-table__column-filter-trigger",on:{click:function(t){return e.handleFilterClick(t,i)}}},[t("i",{class:["el-icon-arrow-down",i.filterOpened?"el-icon-arrow-up":""]})]):""])])}),e.hasGutter?t("th",{class:"gutter"}):""])})])])},props:{fixed:String,store:{required:!0},border:Boolean,defaultSort:{type:Object,default:function(){return{prop:"",order:""}}}},components:{ElCheckbox:rn.a},computed:Kn({table:function(){return this.$parent},hasGutter:function(){return!this.fixed&&this.tableLayout.gutterWidth}},Nn({columns:"columns",isAllSelected:"isAllSelected",leftFixedLeafCount:"fixedLeafColumnsLength",rightFixedLeafCount:"rightFixedLeafColumnsLength",columnsCount:function(t){return t.columns.length},leftFixedCount:function(t){return t.fixedColumns.length},rightFixedCount:function(t){return t.rightFixedColumns.length}})),created:function(){this.filterPanels={}},mounted:function(){var t=this;this.$nextTick(function(){var e=t.defaultSort,n=e.prop,r=e.order;t.store.commit("sort",{prop:n,order:r,init:!0})})},beforeDestroy:function(){var t=this.filterPanels;for(var e in t)t.hasOwnProperty(e)&&t[e]&&t[e].$destroy(!0)},methods:{isCellHidden:function(t,e){for(var n=0,r=0;r<t;r++)n+=e[r].colSpan;var i=n+e[t].colSpan-1;return!0===this.fixed||"left"===this.fixed?i>=this.leftFixedLeafCount:"right"===this.fixed?n<this.columnsCount-this.rightFixedLeafCount:i<this.leftFixedLeafCount||n>=this.columnsCount-this.rightFixedLeafCount},getHeaderRowStyle:function(t){var e=this.table.headerRowStyle;return"function"==typeof e?e.call(null,{rowIndex:t}):e},getHeaderRowClass:function(t){var e=[],n=this.table.headerRowClassName;return"string"==typeof n?e.push(n):"function"==typeof n&&e.push(n.call(null,{rowIndex:t})),e.join(" ")},getHeaderCellStyle:function(t,e,n,r){var i=this.table.headerCellStyle;return"function"==typeof i?i.call(null,{rowIndex:t,columnIndex:e,row:n,column:r}):i},getHeaderCellClass:function(t,e,n,r){var i=[r.id,r.order,r.headerAlign,r.className,r.labelClassName];0===t&&this.isCellHidden(e,n)&&i.push("is-hidden"),r.children||i.push("is-leaf"),r.sortable&&i.push("is-sortable");var o=this.table.headerCellClassName;return"string"==typeof o?i.push(o):"function"==typeof o&&i.push(o.call(null,{rowIndex:t,columnIndex:e,row:n,column:r})),i.join(" ")},toggleAllSelection:function(t){t.stopPropagation(),this.store.commit("toggleAllSelection")},handleFilterClick:function(t,e){t.stopPropagation();var n=t.target,r="TH"===n.tagName?n:n.parentNode;if(!Object(ft.hasClass)(r,"noclick")){r=r.querySelector(".el-table__column-filter-trigger")||r;var i=this.$parent,o=this.filterPanels[e.id];o&&e.filterOpened?o.showPopper=!1:(o||(o=new hn.a(Xn),this.filterPanels[e.id]=o,e.filterPlacement&&(o.placement=e.filterPlacement),o.table=i,o.cell=r,o.column=e,!this.$isServer&&o.$mount(document.createElement("div"))),setTimeout(function(){o.showPopper=!0},16))}},handleHeaderClick:function(t,e){!e.filters&&e.sortable?this.handleSortClick(t,e):e.filterable&&!e.sortable&&this.handleFilterClick(t,e),this.$parent.$emit("header-click",e,t)},handleHeaderContextMenu:function(t,e){this.$parent.$emit("header-contextmenu",e,t)},handleMouseDown:function(t,e){var n=this;if(!this.$isServer&&!(e.children&&e.children.length>0)&&this.draggingColumn&&this.border){this.dragging=!0,this.$parent.resizeProxyVisible=!0;var r=this.$parent,i=r.$el.getBoundingClientRect().left,o=this.$el.querySelector("th."+e.id),s=o.getBoundingClientRect(),a=s.left-i+30;Object(ft.addClass)(o,"noclick"),this.dragState={startMouseLeft:t.clientX,startLeft:s.right-i,startColumnLeft:s.left-i,tableLeft:i};var l=r.$refs.resizeProxy;l.style.left=this.dragState.startLeft+"px",document.onselectstart=function(){return!1},document.ondragstart=function(){return!1};var u=function(t){var e=t.clientX-n.dragState.startMouseLeft,r=n.dragState.startLeft+e;l.style.left=Math.max(a,r)+"px"};document.addEventListener("mousemove",u),document.addEventListener("mouseup",function i(){if(n.dragging){var s=n.dragState,a=s.startColumnLeft,c=s.startLeft,h=parseInt(l.style.left,10)-a;e.width=e.realWidth=h,r.$emit("header-dragend",e.width,c-a,e,t),n.store.scheduleLayout(),document.body.style.cursor="",n.dragging=!1,n.draggingColumn=null,n.dragState={},r.resizeProxyVisible=!1}document.removeEventListener("mousemove",u),document.removeEventListener("mouseup",i),document.onselectstart=null,document.ondragstart=null,setTimeout(function(){Object(ft.removeClass)(o,"noclick")},0)})}},handleMouseMove:function(t,e){if(!(e.children&&e.children.length>0)){for(var n=t.target;n&&"TH"!==n.tagName;)n=n.parentNode;if(e&&e.resizable&&!this.dragging&&this.border){var r=n.getBoundingClientRect(),i=document.body.style;r.width>12&&r.right-t.pageX<8?(i.cursor="col-resize",Object(ft.hasClass)(n,"is-sortable")&&(n.style.cursor="col-resize"),this.draggingColumn=e):this.dragging||(i.cursor="",Object(ft.hasClass)(n,"is-sortable")&&(n.style.cursor="pointer"),this.draggingColumn=null)}}},handleMouseOut:function(){this.$isServer||(document.body.style.cursor="")},toggleOrder:function(t){var e=t.order,n=t.sortOrders;if(""===e)return n[0];var r=n.indexOf(e||null);return n[r>n.length-2?0:r+1]},handleSortClick:function(t,e,n){t.stopPropagation();for(var r=e.order===n?null:n||this.toggleOrder(e),i=t.target;i&&"TH"!==i.tagName;)i=i.parentNode;if(i&&"TH"===i.tagName&&Object(ft.hasClass)(i,"noclick"))Object(ft.removeClass)(i,"noclick");else if(e.sortable){var o=this.store.states,s=o.sortProp,a=void 0,l=o.sortingColumn;(l!==e||l===e&&null===l.order)&&(l&&(l.order=null),o.sortingColumn=e,s=e.property),a=e.order=r||null,o.sortProp=s,o.sortOrder=a,this.store.commit("changeSortCondition")}}},data:function(){return{draggingColumn:null,dragging:!1,dragState:{}}}},Jn=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Zn={name:"ElTableFooter",mixins:[Pn],render:function(t){var e=this,n=[];return this.summaryMethod?n=this.summaryMethod({columns:this.columns,data:this.store.states.data}):this.columns.forEach(function(t,r){if(0!==r){var i=e.store.states.data.map(function(e){return Number(e[t.property])}),o=[],s=!0;i.forEach(function(t){if(!isNaN(t)){s=!1;var e=(""+t).split(".")[1];o.push(e?e.length:0)}});var a=Math.max.apply(null,o);n[r]=s?"":i.reduce(function(t,e){var n=Number(e);return isNaN(n)?t:parseFloat((t+e).toFixed(Math.min(a,20)))},0)}else n[r]=e.sumText}),t("table",{class:"el-table__footer",attrs:{cellspacing:"0",cellpadding:"0",border:"0"}},[t("colgroup",[this.columns.map(function(e){return t("col",{attrs:{name:e.id},key:e.id})}),this.hasGutter?t("col",{attrs:{name:"gutter"}}):""]),t("tbody",{class:[{"has-gutter":this.hasGutter}]},[t("tr",[this.columns.map(function(r,i){return t("td",{key:i,attrs:{colspan:r.colSpan,rowspan:r.rowSpan},class:e.getRowClasses(r,i)},[t("div",{class:["cell",r.labelClassName]},[n[i]])])}),this.hasGutter?t("th",{class:"gutter"}):""])])])},props:{fixed:String,store:{required:!0},summaryMethod:Function,sumText:String,border:Boolean,defaultSort:{type:Object,default:function(){return{prop:"",order:""}}}},computed:Jn({table:function(){return this.$parent},hasGutter:function(){return!this.fixed&&this.tableLayout.gutterWidth}},Nn({columns:"columns",isAllSelected:"isAllSelected",leftFixedLeafCount:"fixedLeafColumnsLength",rightFixedLeafCount:"rightFixedLeafColumnsLength",columnsCount:function(t){return t.columns.length},leftFixedCount:function(t){return t.fixedColumns.length},rightFixedCount:function(t){return t.rightFixedColumns.length}})),methods:{isCellHidden:function(t,e,n){if(!0===this.fixed||"left"===this.fixed)return t>=this.leftFixedLeafCount;if("right"===this.fixed){for(var r=0,i=0;i<t;i++)r+=e[i].colSpan;return r<this.columnsCount-this.rightFixedLeafCount}return!(this.fixed||!n.fixed)||(t<this.leftFixedCount||t>=this.columnsCount-this.rightFixedCount)},getRowClasses:function(t,e){var n=[t.id,t.align,t.labelClassName];return t.className&&n.push(t.className),this.isCellHidden(e,this.columns,t)&&n.push("is-hidden"),t.children||n.push("is-leaf"),n}}},Qn=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},tr=1,er=i({name:"ElTable",mixins:[f.a,x.a],directives:{Mousewheel:un},props:{data:{type:Array,default:function(){return[]}},size:String,width:[String,Number],height:[String,Number],maxHeight:[String,Number],fit:{type:Boolean,default:!0},stripe:Boolean,border:Boolean,rowKey:[String,Function],context:{},showHeader:{type:Boolean,default:!0},showSummary:Boolean,sumText:String,summaryMethod:Function,rowClassName:[String,Function],rowStyle:[Object,Function],cellClassName:[String,Function],cellStyle:[Object,Function],headerRowClassName:[String,Function],headerRowStyle:[Object,Function],headerCellClassName:[String,Function],headerCellStyle:[Object,Function],highlightCurrentRow:Boolean,currentRowKey:[String,Number],emptyText:String,expandRowKeys:Array,defaultExpandAll:Boolean,defaultSort:Object,tooltipEffect:String,spanMethod:Function,selectOnIndeterminate:{type:Boolean,default:!0},indent:{type:Number,default:16},treeProps:{type:Object,default:function(){return{hasChildren:"hasChildren",children:"children"}}},lazy:Boolean,load:Function},components:{TableHeader:qn,TableFooter:Zn,TableBody:jn,ElCheckbox:rn.a},methods:{getMigratingConfig:function(){return{events:{expand:"expand is renamed to expand-change"}}},setCurrentRow:function(t){this.store.commit("setCurrentRow",t)},toggleRowSelection:function(t,e){this.store.toggleRowSelection(t,e,!1),this.store.updateAllSelected()},toggleRowExpansion:function(t,e){this.store.toggleRowExpansionAdapter(t,e)},clearSelection:function(){this.store.clearSelection()},clearFilter:function(t){this.store.clearFilter(t)},clearSort:function(){this.store.clearSort()},handleMouseLeave:function(){this.store.commit("setHoverRow",null),this.hoverState&&(this.hoverState=null)},updateScrollY:function(){this.layout.updateScrollY()&&(this.layout.notifyObservers("scrollable"),this.layout.updateColumnsWidth())},handleFixedMousewheel:function(t,e){var n=this.bodyWrapper;if(Math.abs(e.spinY)>0){var r=n.scrollTop;e.pixelY<0&&0!==r&&t.preventDefault(),e.pixelY>0&&n.scrollHeight-n.clientHeight>r&&t.preventDefault(),n.scrollTop+=Math.ceil(e.pixelY/5)}else n.scrollLeft+=Math.ceil(e.pixelX/5)},handleHeaderFooterMousewheel:function(t,e){var n=e.pixelX,r=e.pixelY;Math.abs(n)>=Math.abs(r)&&(this.bodyWrapper.scrollLeft+=e.pixelX/5)},syncPostion:Object(on.throttle)(20,function(){var t=this.bodyWrapper,e=t.scrollLeft,n=t.scrollTop,r=t.offsetWidth,i=t.scrollWidth,o=this.$refs,s=o.headerWrapper,a=o.footerWrapper,l=o.fixedBodyWrapper,u=o.rightFixedBodyWrapper;s&&(s.scrollLeft=e),a&&(a.scrollLeft=e),l&&(l.scrollTop=n),u&&(u.scrollTop=n);var c=i-r-1;this.scrollPosition=e>=c?"right":0===e?"left":"middle"}),bindEvents:function(){this.bodyWrapper.addEventListener("scroll",this.syncPostion,{passive:!0}),this.fit&&Object(Pe.addResizeListener)(this.$el,this.resizeListener)},unbindEvents:function(){this.bodyWrapper.removeEventListener("scroll",this.syncPostion,{passive:!0}),this.fit&&Object(Pe.removeResizeListener)(this.$el,this.resizeListener)},resizeListener:function(){if(this.$ready){var t=!1,e=this.$el,n=this.resizeState,r=n.width,i=n.height,o=e.offsetWidth;r!==o&&(t=!0);var s=e.offsetHeight;(this.height||this.shouldUpdateHeight)&&i!==s&&(t=!0),t&&(this.resizeState.width=o,this.resizeState.height=s,this.doLayout())}},doLayout:function(){this.shouldUpdateHeight&&this.layout.updateElsHeight(),this.layout.updateColumnsWidth()},sort:function(t,e){this.store.commit("sort",{prop:t,order:e})},toggleAllSelection:function(){this.store.commit("toggleAllSelection")}},computed:Qn({tableSize:function(){return this.size||(this.$ELEMENT||{}).size},bodyWrapper:function(){return this.$refs.bodyWrapper},shouldUpdateHeight:function(){return this.height||this.maxHeight||this.fixedColumns.length>0||this.rightFixedColumns.length>0},bodyWidth:function(){var t=this.layout,e=t.bodyWidth,n=t.scrollY,r=t.gutterWidth;return e?e-(n?r:0)+"px":""},bodyHeight:function(){var t=this.layout,e=t.headerHeight,n=void 0===e?0:e,r=t.bodyHeight,i=t.footerHeight,o=void 0===i?0:i;if(this.height)return{height:r?r+"px":""};if(this.maxHeight){var s=xn(this.maxHeight);if("number"==typeof s)return{"max-height":s-o-(this.showHeader?n:0)+"px"}}return{}},fixedBodyHeight:function(){if(this.height)return{height:this.layout.fixedBodyHeight?this.layout.fixedBodyHeight+"px":""};if(this.maxHeight){var t=xn(this.maxHeight);if("number"==typeof t)return t=this.layout.scrollX?t-this.layout.gutterWidth:t,this.showHeader&&(t-=this.layout.headerHeight),{"max-height":(t-=this.layout.footerHeight)+"px"}}return{}},fixedHeight:function(){return this.maxHeight?this.showSummary?{bottom:0}:{bottom:this.layout.scrollX&&this.data.length?this.layout.gutterWidth+"px":""}:this.showSummary?{height:this.layout.tableHeight?this.layout.tableHeight+"px":""}:{height:this.layout.viewportHeight?this.layout.viewportHeight+"px":""}},emptyBlockStyle:function(){if(this.data&&this.data.length)return null;var t="100%";return this.layout.appendHeight&&(t="calc(100% - "+this.layout.appendHeight+"px)"),{width:this.bodyWidth,height:t}}},Nn({selection:"selection",columns:"columns",tableData:"data",fixedColumns:"fixedColumns",rightFixedColumns:"rightFixedColumns"})),watch:{height:{immediate:!0,handler:function(t){this.layout.setHeight(t)}},maxHeight:{immediate:!0,handler:function(t){this.layout.setMaxHeight(t)}},currentRowKey:{immediate:!0,handler:function(t){this.rowKey&&this.store.setCurrentRowKey(t)}},data:{immediate:!0,handler:function(t){this.store.commit("setData",t)}},expandRowKeys:{immediate:!0,handler:function(t){t&&this.store.setExpandRowKeysAdapter(t)}}},created:function(){var t=this;this.tableId="el-table_"+tr++,this.debouncedUpdateLayout=Object(on.debounce)(50,function(){return t.doLayout()})},mounted:function(){var t=this;this.bindEvents(),this.store.updateColumns(),this.doLayout(),this.resizeState={width:this.$el.offsetWidth,height:this.$el.offsetHeight},this.store.states.columns.forEach(function(e){e.filteredValue&&e.filteredValue.length&&t.store.commit("filterChange",{column:e,values:e.filteredValue,silent:!0})}),this.$ready=!0},destroyed:function(){this.unbindEvents()},data:function(){var t=this.treeProps,e=t.hasChildren,n=void 0===e?"hasChildren":e,r=t.children,i=void 0===r?"children":r;return this.store=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!t)throw new Error("Table is required.");var n=new An;return n.table=t,n.toggleAllSelection=R()(10,n._toggleAllSelection),Object.keys(e).forEach(function(t){n.states[t]=e[t]}),n}(this,{rowKey:this.rowKey,defaultExpandAll:this.defaultExpandAll,selectOnIndeterminate:this.selectOnIndeterminate,indent:this.indent,lazy:this.lazy,lazyColumnIdentifier:n,childrenColumnName:i}),{layout:new Ln({store:this.store,table:this,fit:this.fit,showHeader:this.showHeader}),isHidden:!1,renderExpanded:null,resizeProxyVisible:!1,resizeState:{width:null,height:null},isGroup:!1,scrollPosition:"left"}}},en,[],!1,null,null,null);er.options.__file="packages/table/src/table.vue";var nr=er.exports;nr.install=function(t){t.component(nr.name,nr)};var rr=nr,ir={default:{order:""},selection:{width:48,minWidth:48,realWidth:48,order:"",className:"el-table-column--selection"},expand:{width:48,minWidth:48,realWidth:48,order:""},index:{width:48,minWidth:48,realWidth:48,order:""}},or={selection:{renderHeader:function(t,e){var n=e.store;return t("el-checkbox",{attrs:{disabled:n.states.data&&0===n.states.data.length,indeterminate:n.states.selection.length>0&&!this.isAllSelected,value:this.isAllSelected},nativeOn:{click:this.toggleAllSelection}})},renderCell:function(t,e){var n=e.row,r=e.column,i=e.store,o=e.$index;return t("el-checkbox",{nativeOn:{click:function(t){return t.stopPropagation()}},attrs:{value:i.isSelected(n),disabled:!!r.selectable&&!r.selectable.call(null,n,o)},on:{input:function(){i.commit("rowSelectedChanged",n)}}})},sortable:!1,resizable:!1},index:{renderHeader:function(t,e){return e.column.label||"#"},renderCell:function(t,e){var n=e.$index,r=n+1,i=e.column.index;return"number"==typeof i?r=n+i:"function"==typeof i&&(r=i(n)),t("div",[r])},sortable:!1},expand:{renderHeader:function(t,e){return e.column.label||""},renderCell:function(t,e){var n=e.row,r=e.store,i=["el-table__expand-icon"];r.states.expandRows.indexOf(n)>-1&&i.push("el-table__expand-icon--expanded");return t("div",{class:i,on:{click:function(t){t.stopPropagation(),r.toggleRowExpansion(n)}}},[t("i",{class:"el-icon el-icon-arrow-right"})])},sortable:!1,resizable:!1,className:"el-table__expand-column"}};function sr(t,e){var n=e.row,r=e.column,i=e.$index,o=r.property,s=o&&Object(g.getPropByPath)(n,o).v;return r&&r.formatter?r.formatter(n,r,s,i):s}var ar=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},lr=1,ur={name:"ElTableColumn",props:{type:{type:String,default:"default"},label:String,className:String,labelClassName:String,property:String,prop:String,width:{},minWidth:{},renderHeader:Function,sortable:{type:[Boolean,String],default:!1},sortMethod:Function,sortBy:[String,Function,Array],resizable:{type:Boolean,default:!0},columnKey:String,align:String,headerAlign:String,showTooltipWhenOverflow:Boolean,showOverflowTooltip:Boolean,fixed:[Boolean,String],formatter:Function,selectable:Function,reserveSelection:Boolean,filterMethod:Function,filteredValue:Array,filters:Array,filterPlacement:String,filterMultiple:{type:Boolean,default:!0},index:[Number,Function],sortOrders:{type:Array,default:function(){return["ascending","descending",null]},validator:function(t){return t.every(function(t){return["ascending","descending",null].indexOf(t)>-1})}}},data:function(){return{isSubColumn:!1,columns:[]}},computed:{owner:function(){for(var t=this.$parent;t&&!t.tableId;)t=t.$parent;return t},columnOrTableParent:function(){for(var t=this.$parent;t&&!t.tableId&&!t.columnId;)t=t.$parent;return t},realWidth:function(){return Tn(this.width)},realMinWidth:function(){return void 0!==(t=this.minWidth)&&(t=Tn(t),isNaN(t)&&(t=80)),t;var t},realAlign:function(){return this.align?"is-"+this.align:null},realHeaderAlign:function(){return this.headerAlign?"is-"+this.headerAlign:this.realAlign}},methods:{getPropsData:function(){for(var t=this,e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return n.reduce(function(e,n){return Array.isArray(n)&&n.forEach(function(n){e[n]=t[n]}),e},{})},getColumnElIndex:function(t,e){return[].indexOf.call(t,e)},setColumnWidth:function(t){return this.realWidth&&(t.width=this.realWidth),this.realMinWidth&&(t.minWidth=this.realMinWidth),t.minWidth||(t.minWidth=80),t.realWidth=void 0===t.width?t.minWidth:t.width,t},setColumnForcedProps:function(t){var e=t.type,n=or[e]||{};return Object.keys(n).forEach(function(e){var r=n[e];void 0!==r&&(t[e]="className"===e?t[e]+" "+r:r)}),t},setColumnRenders:function(t){var e=this;this.$createElement;this.renderHeader?console.warn("[Element Warn][TableColumn]Comparing to render-header, scoped-slot header is easier to use. We recommend users to use scoped-slot header."):"selection"!==t.type&&(t.renderHeader=function(n,r){var i=e.$scopedSlots.header;return i?i(r):t.label});var n=t.renderCell;return"expand"===t.type?(t.renderCell=function(t,e){return t("div",{class:"cell"},[n(t,e)])},this.owner.renderExpanded=function(t,n){return e.$scopedSlots.default?e.$scopedSlots.default(n):e.$slots.default}):(n=n||sr,t.renderCell=function(r,i){var o=null;o=e.$scopedSlots.default?e.$scopedSlots.default(i):n(r,i);var s=function(t,e){var n=e.row,r=e.treeNode,i=e.store;if(!r)return null;var o=[];if(r.indent&&o.push(t("span",{class:"el-table__indent",style:{"padding-left":r.indent+"px"}})),"boolean"!=typeof r.expanded||r.noLazyChildren)o.push(t("span",{class:"el-table__placeholder"}));else{var s=["el-table__expand-icon",r.expanded?"el-table__expand-icon--expanded":""],a=["el-icon-arrow-right"];r.loading&&(a=["el-icon-loading"]),o.push(t("div",{class:s,on:{click:function(t){t.stopPropagation(),i.loadOrToggle(n)}}},[t("i",{class:a})]))}return o}(r,i),a={class:"cell",style:{}};return t.showOverflowTooltip&&(a.class+=" el-tooltip",a.style={width:(i.column.realWidth||i.column.width)-1+"px"}),r("div",a,[s,o])}),t},registerNormalWatchers:function(){var t=this,e={prop:"property",realAlign:"align",realHeaderAlign:"headerAlign",realWidth:"width"},n=["label","property","filters","filterMultiple","sortable","index","formatter","className","labelClassName","showOverflowTooltip"].reduce(function(t,e){return t[e]=e,t},e);Object.keys(n).forEach(function(n){var r=e[n];t.$watch(n,function(e){t.columnConfig[r]=e})})},registerComplexWatchers:function(){var t=this,e={realWidth:"width",realMinWidth:"minWidth"},n=["fixed"].reduce(function(t,e){return t[e]=e,t},e);Object.keys(n).forEach(function(n){var r=e[n];t.$watch(n,function(e){t.columnConfig[r]=e;var n="fixed"===r;t.owner.store.scheduleLayout(n)})})}},components:{ElCheckbox:rn.a},beforeCreate:function(){this.row={},this.column={},this.$index=0,this.columnId=""},created:function(){var t=this.columnOrTableParent;this.isSubColumn=this.owner!==t,this.columnId=(t.tableId||t.columnId)+"_column_"+lr++;var e=this.type||"default",n=""===this.sortable||this.sortable,r=ar({},ir[e],{id:this.columnId,type:e,property:this.prop||this.property,align:this.realAlign,headerAlign:this.realHeaderAlign,showOverflowTooltip:this.showOverflowTooltip||this.showTooltipWhenOverflow,filterable:this.filters||this.filterMethod,filteredValue:[],filterPlacement:"",isColumnGroup:!1,filterOpened:!1,sortable:n,index:this.index}),i=this.getPropsData(["columnKey","label","className","labelClassName","type","renderHeader","formatter","fixed","resizable"],["sortMethod","sortBy","sortOrders"],["selectable","reserveSelection"],["filterMethod","filters","filterMultiple","filterOpened","filteredValue","filterPlacement"]);i=function(t,e){var n={},r=void 0;for(r in t)n[r]=t[r];for(r in e)if(yn(e,r)){var i=e[r];void 0!==i&&(n[r]=i)}return n}(r,i),i=function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];return 0===e.length?function(t){return t}:1===e.length?e[0]:e.reduce(function(t,e){return function(){return t(e.apply(void 0,arguments))}})}(this.setColumnRenders,this.setColumnWidth,this.setColumnForcedProps)(i),this.columnConfig=i,this.registerNormalWatchers(),this.registerComplexWatchers()},mounted:function(){var t=this.owner,e=this.columnOrTableParent,n=this.isSubColumn?e.$el.children:e.$refs.hiddenColumns.children,r=this.getColumnElIndex(n,this.$el);t.store.commit("insertColumn",this.columnConfig,r,this.isSubColumn?e.columnConfig:null)},destroyed:function(){if(this.$parent){var t=this.$parent;this.owner.store.commit("removeColumn",this.columnConfig,this.isSubColumn?t.columnConfig:null)}},render:function(t){return t("div",this.$slots.default)},install:function(t){t.component(ur.name,ur)}},cr=ur,hr=function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.ranged?n("div",{directives:[{name:"clickoutside",rawName:"v-clickoutside",value:t.handleClose,expression:"handleClose"}],ref:"reference",staticClass:"el-date-editor el-range-editor el-input__inner",class:["el-date-editor--"+t.type,t.pickerSize?"el-range-editor--"+t.pickerSize:"",t.pickerDisabled?"is-disabled":"",t.pickerVisible?"is-active":""],on:{click:t.handleRangeClick,mouseenter:t.handleMouseEnter,mouseleave:function(e){t.showClose=!1},keydown:t.handleKeydown}},[n("i",{class:["el-input__icon","el-range__icon",t.triggerClass]}),n("input",t._b({staticClass:"el-range-input",attrs:{autocomplete:"off",placeholder:t.startPlaceholder,disabled:t.pickerDisabled,readonly:!t.editable||t.readonly,name:t.name&&t.name[0]},domProps:{value:t.displayValue&&t.displayValue[0]},on:{input:t.handleStartInput,change:t.handleStartChange,focus:t.handleFocus}},"input",t.firstInputId,!1)),t._t("range-separator",[n("span",{staticClass:"el-range-separator"},[t._v(t._s(t.rangeSeparator))])]),n("input",t._b({staticClass:"el-range-input",attrs:{autocomplete:"off",placeholder:t.endPlaceholder,disabled:t.pickerDisabled,readonly:!t.editable||t.readonly,name:t.name&&t.name[1]},domProps:{value:t.displayValue&&t.displayValue[1]},on:{input:t.handleEndInput,change:t.handleEndChange,focus:t.handleFocus}},"input",t.secondInputId,!1)),t.haveTrigger?n("i",{staticClass:"el-input__icon el-range__close-icon",class:[t.showClose?""+t.clearIcon:""],on:{click:t.handleClickIcon}}):t._e()],2):n("el-input",t._b({directives:[{name:"clickoutside",rawName:"v-clickoutside",value:t.handleClose,expression:"handleClose"}],ref:"reference",staticClass:"el-date-editor",class:"el-date-editor--"+t.type,attrs:{readonly:!t.editable||t.readonly||"dates"===t.type||"week"===t.type,disabled:t.pickerDisabled,size:t.pickerSize,name:t.name,placeholder:t.placeholder,value:t.displayValue,validateEvent:!1},on:{focus:t.handleFocus,input:function(e){return t.userInput=e},change:t.handleChange},nativeOn:{keydown:function(e){return t.handleKeydown(e)},mouseenter:function(e){return t.handleMouseEnter(e)},mouseleave:function(e){t.showClose=!1}}},"el-input",t.firstInputId,!1),[n("i",{staticClass:"el-input__icon",class:t.triggerClass,attrs:{slot:"prefix"},on:{click:t.handleFocus},slot:"prefix"}),t.haveTrigger?n("i",{staticClass:"el-input__icon",class:[t.showClose?""+t.clearIcon:""],attrs:{slot:"suffix"},on:{click:t.handleClickIcon},slot:"suffix"}):t._e()])};hr._withStripped=!0;var dr=n(0),pr={props:{appendToBody:L.a.props.appendToBody,offset:L.a.props.offset,boundariesPadding:L.a.props.boundariesPadding,arrowOffset:L.a.props.arrowOffset},methods:L.a.methods,data:function(){return Ut()({visibleArrow:!0},L.a.data)},beforeDestroy:L.a.beforeDestroy},fr={date:"yyyy-MM-dd",month:"yyyy-MM",datetime:"yyyy-MM-dd HH:mm:ss",time:"HH:mm:ss",week:"yyyywWW",timerange:"HH:mm:ss",daterange:"yyyy-MM-dd",monthrange:"yyyy-MM",datetimerange:"yyyy-MM-dd HH:mm:ss",year:"yyyy"},gr=["date","datetime","time","time-select","week","month","year","daterange","monthrange","timerange","datetimerange","dates"],mr=function(t,e){return"timestamp"===e?t.getTime():Object(dr.formatDate)(t,e)},vr=function(t,e){return"timestamp"===e?new Date(Number(t)):Object(dr.parseDate)(t,e)},br=function(t,e){if(Array.isArray(t)&&2===t.length){var n=t[0],r=t[1];if(n&&r)return[mr(n,e),mr(r,e)]}return""},_r=function(t,e,n){if(Array.isArray(t)||(t=t.split(n)),2===t.length){var r=t[0],i=t[1];return[vr(r,e),vr(i,e)]}return[]},yr={default:{formatter:function(t){return t?""+t:""},parser:function(t){return void 0===t||""===t?null:t}},week:{formatter:function(t,e){var n=Object(dr.getWeekNumber)(t),r=t.getMonth(),i=new Date(t);1===n&&11===r&&(i.setHours(0,0,0,0),i.setDate(i.getDate()+3-(i.getDay()+6)%7));var o=Object(dr.formatDate)(i,e);return o=/WW/.test(o)?o.replace(/WW/,n<10?"0"+n:n):o.replace(/W/,n)},parser:function(t,e){return yr.date.parser(t,e)}},date:{formatter:mr,parser:vr},datetime:{formatter:mr,parser:vr},daterange:{formatter:br,parser:_r},monthrange:{formatter:br,parser:_r},datetimerange:{formatter:br,parser:_r},timerange:{formatter:br,parser:_r},time:{formatter:mr,parser:vr},month:{formatter:mr,parser:vr},year:{formatter:mr,parser:vr},number:{formatter:function(t){return t?""+t:""},parser:function(t){var e=Number(t);return isNaN(t)?null:e}},dates:{formatter:function(t,e){return t.map(function(t){return mr(t,e)})},parser:function(t,e){return("string"==typeof t?t.split(", "):t).map(function(t){return t instanceof Date?t:vr(t,e)})}}},Tr={left:"bottom-start",center:"bottom",right:"bottom-end"},xr=function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"-";return t?(0,(yr[n]||yr.default).parser)(t,e||fr[n],r):null},Er=function(t,e,n){return t?(0,(yr[n]||yr.default).formatter)(t,e||fr[n]):null},wr=function(t,e){var n=function(t,e){var n=t instanceof Date,r=e instanceof Date;return n&&r?t.getTime()===e.getTime():!n&&!r&&t===e},r=t instanceof Array,i=e instanceof Array;return r&&i?t.length===e.length&&t.every(function(t,r){return n(t,e[r])}):!r&&!i&&n(t,e)},Cr=function(t){return"string"==typeof t||t instanceof String},Sr=function(t){return null===t||void 0===t||Cr(t)||Array.isArray(t)&&2===t.length&&t.every(Cr)},kr=i({mixins:[w.a,pr],inject:{elForm:{default:""},elFormItem:{default:""}},props:{size:String,format:String,valueFormat:String,readonly:Boolean,placeholder:String,startPlaceholder:String,endPlaceholder:String,prefixIcon:String,clearIcon:{type:String,default:"el-icon-circle-close"},name:{default:"",validator:Sr},disabled:Boolean,clearable:{type:Boolean,default:!0},id:{default:"",validator:Sr},popperClass:String,editable:{type:Boolean,default:!0},align:{type:String,default:"left"},value:{},defaultValue:{},defaultTime:{},rangeSeparator:{default:"-"},pickerOptions:{},unlinkPanels:Boolean,validateEvent:{type:Boolean,default:!0}},components:{ElInput:d.a},directives:{Clickoutside:N.a},data:function(){return{pickerVisible:!1,showClose:!1,userInput:null,valueOnOpen:null,unwatchPickerOptions:null}},watch:{pickerVisible:function(t){this.readonly||this.pickerDisabled||(t?(this.showPicker(),this.valueOnOpen=Array.isArray(this.value)?[].concat(this.value):this.value):(this.hidePicker(),this.emitChange(this.value),this.userInput=null,this.validateEvent&&this.dispatch("ElFormItem","el.form.blur"),this.$emit("blur",this),this.blur()))},parsedValue:{immediate:!0,handler:function(t){this.picker&&(this.picker.value=t)}},defaultValue:function(t){this.picker&&(this.picker.defaultValue=t)},value:function(t,e){wr(t,e)||this.pickerVisible||!this.validateEvent||this.dispatch("ElFormItem","el.form.change",t)}},computed:{ranged:function(){return this.type.indexOf("range")>-1},reference:function(){var t=this.$refs.reference;return t.$el||t},refInput:function(){return this.reference?[].slice.call(this.reference.querySelectorAll("input")):[]},valueIsEmpty:function(){var t=this.value;if(Array.isArray(t)){for(var e=0,n=t.length;e<n;e++)if(t[e])return!1}else if(t)return!1;return!0},triggerClass:function(){return this.prefixIcon||(-1!==this.type.indexOf("time")?"el-icon-time":"el-icon-date")},selectionMode:function(){return"week"===this.type?"week":"month"===this.type?"month":"year"===this.type?"year":"dates"===this.type?"dates":"day"},haveTrigger:function(){return void 0!==this.showTrigger?this.showTrigger:-1!==gr.indexOf(this.type)},displayValue:function(){var t=Er(this.parsedValue,this.format,this.type,this.rangeSeparator);return Array.isArray(this.userInput)?[this.userInput[0]||t&&t[0]||"",this.userInput[1]||t&&t[1]||""]:null!==this.userInput?this.userInput:t?"dates"===this.type?t.join(", "):t:""},parsedValue:function(){return this.value?"time-select"===this.type?this.value:Object(dr.isDateObject)(this.value)||Array.isArray(this.value)&&this.value.every(dr.isDateObject)?this.value:this.valueFormat?xr(this.value,this.valueFormat,this.type,this.rangeSeparator)||this.value:Array.isArray(this.value)?this.value.map(function(t){return new Date(t)}):new Date(this.value):this.value},_elFormItemSize:function(){return(this.elFormItem||{}).elFormItemSize},pickerSize:function(){return this.size||this._elFormItemSize||(this.$ELEMENT||{}).size},pickerDisabled:function(){return this.disabled||(this.elForm||{}).disabled},firstInputId:function(){var t={},e=void 0;return(e=this.ranged?this.id&&this.id[0]:this.id)&&(t.id=e),t},secondInputId:function(){var t={},e=void 0;return this.ranged&&(e=this.id&&this.id[1]),e&&(t.id=e),t}},created:function(){this.popperOptions={boundariesPadding:0,gpuAcceleration:!1},this.placement=Tr[this.align]||Tr.left,this.$on("fieldReset",this.handleFieldReset)},methods:{focus:function(){this.ranged?this.handleFocus():this.$refs.reference.focus()},blur:function(){this.refInput.forEach(function(t){return t.blur()})},parseValue:function(t){var e=Object(dr.isDateObject)(t)||Array.isArray(t)&&t.every(dr.isDateObject);return this.valueFormat&&!e&&xr(t,this.valueFormat,this.type,this.rangeSeparator)||t},formatToValue:function(t){var e=Object(dr.isDateObject)(t)||Array.isArray(t)&&t.every(dr.isDateObject);return this.valueFormat&&e?Er(t,this.valueFormat,this.type,this.rangeSeparator):t},parseString:function(t){var e=Array.isArray(t)?this.type:this.type.replace("range","");return xr(t,this.format,e)},formatToString:function(t){var e=Array.isArray(t)?this.type:this.type.replace("range","");return Er(t,this.format,e)},handleMouseEnter:function(){this.readonly||this.pickerDisabled||!this.valueIsEmpty&&this.clearable&&(this.showClose=!0)},handleChange:function(){if(this.userInput){var t=this.parseString(this.displayValue);t&&(this.picker.value=t,this.isValidValue(t)&&(this.emitInput(t),this.userInput=null))}""===this.userInput&&(this.emitInput(null),this.emitChange(null),this.userInput=null)},handleStartInput:function(t){this.userInput?this.userInput=[t.target.value,this.userInput[1]]:this.userInput=[t.target.value,null]},handleEndInput:function(t){this.userInput?this.userInput=[this.userInput[0],t.target.value]:this.userInput=[null,t.target.value]},handleStartChange:function(t){var e=this.parseString(this.userInput&&this.userInput[0]);if(e){this.userInput=[this.formatToString(e),this.displayValue[1]];var n=[e,this.picker.value&&this.picker.value[1]];this.picker.value=n,this.isValidValue(n)&&(this.emitInput(n),this.userInput=null)}},handleEndChange:function(t){var e=this.parseString(this.userInput&&this.userInput[1]);if(e){this.userInput=[this.displayValue[0],this.formatToString(e)];var n=[this.picker.value&&this.picker.value[0],e];this.picker.value=n,this.isValidValue(n)&&(this.emitInput(n),this.userInput=null)}},handleClickIcon:function(t){this.readonly||this.pickerDisabled||(this.showClose?(this.valueOnOpen=this.value,t.stopPropagation(),this.emitInput(null),this.emitChange(null),this.showClose=!1,this.picker&&"function"==typeof this.picker.handleClear&&this.picker.handleClear()):this.pickerVisible=!this.pickerVisible)},handleClose:function(){if(this.pickerVisible&&(this.pickerVisible=!1,"dates"===this.type)){var t=xr(this.valueOnOpen,this.valueFormat,this.type,this.rangeSeparator)||this.valueOnOpen;this.emitInput(t)}},handleFieldReset:function(t){this.userInput=""===t?null:t},handleFocus:function(){var t=this.type;-1===gr.indexOf(t)||this.pickerVisible||(this.pickerVisible=!0),this.$emit("focus",this)},handleKeydown:function(t){var e=this,n=t.keyCode;return 27===n?(this.pickerVisible=!1,void t.stopPropagation()):9!==n?13===n?((""===this.userInput||this.isValidValue(this.parseString(this.displayValue)))&&(this.handleChange(),this.pickerVisible=this.picker.visible=!1,this.blur()),void t.stopPropagation()):void(this.userInput?t.stopPropagation():this.picker&&this.picker.handleKeydown&&this.picker.handleKeydown(t)):void(this.ranged?setTimeout(function(){-1===e.refInput.indexOf(document.activeElement)&&(e.pickerVisible=!1,e.blur(),t.stopPropagation())},0):(this.handleChange(),this.pickerVisible=this.picker.visible=!1,this.blur(),t.stopPropagation()))},handleRangeClick:function(){var t=this.type;-1===gr.indexOf(t)||this.pickerVisible||(this.pickerVisible=!0),this.$emit("focus",this)},hidePicker:function(){this.picker&&(this.picker.resetView&&this.picker.resetView(),this.pickerVisible=this.picker.visible=!1,this.destroyPopper())},showPicker:function(){var t=this;this.$isServer||(this.picker||this.mountPicker(),this.pickerVisible=this.picker.visible=!0,this.updatePopper(),this.picker.value=this.parsedValue,this.picker.resetView&&this.picker.resetView(),this.$nextTick(function(){t.picker.adjustSpinners&&t.picker.adjustSpinners()}))},mountPicker:function(){var t=this;this.picker=new hn.a(this.panel).$mount(),this.picker.defaultValue=this.defaultValue,this.picker.defaultTime=this.defaultTime,this.picker.popperClass=this.popperClass,this.popperElm=this.picker.$el,this.picker.width=this.reference.getBoundingClientRect().width,this.picker.showTime="datetime"===this.type||"datetimerange"===this.type,this.picker.selectionMode=this.selectionMode,this.picker.unlinkPanels=this.unlinkPanels,this.picker.arrowControl=this.arrowControl||this.timeArrowControl||!1,this.$watch("format",function(e){t.picker.format=e});var e=function(){var e=t.pickerOptions;if(e&&e.selectableRange){var n=e.selectableRange,r=yr.datetimerange.parser,i=fr.timerange;n=Array.isArray(n)?n:[n],t.picker.selectableRange=n.map(function(e){return r(e,i,t.rangeSeparator)})}for(var o in e)e.hasOwnProperty(o)&&"selectableRange"!==o&&(t.picker[o]=e[o]);t.format&&(t.picker.format=t.format)};e(),this.unwatchPickerOptions=this.$watch("pickerOptions",function(){return e()},{deep:!0}),this.$el.appendChild(this.picker.$el),this.picker.resetView&&this.picker.resetView(),this.picker.$on("dodestroy",this.doDestroy),this.picker.$on("pick",function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t.userInput=null,t.pickerVisible=t.picker.visible=n,t.emitInput(e),t.picker.resetView&&t.picker.resetView()}),this.picker.$on("select-range",function(e,n,r){0!==t.refInput.length&&(r&&"min"!==r?"max"===r&&(t.refInput[1].setSelectionRange(e,n),t.refInput[1].focus()):(t.refInput[0].setSelectionRange(e,n),t.refInput[0].focus()))})},unmountPicker:function(){this.picker&&(this.picker.$destroy(),this.picker.$off(),"function"==typeof this.unwatchPickerOptions&&this.unwatchPickerOptions(),this.picker.$el.parentNode.removeChild(this.picker.$el))},emitChange:function(t){wr(t,this.valueOnOpen)||(this.$emit("change",t),this.valueOnOpen=t,this.validateEvent&&this.dispatch("ElFormItem","el.form.change",t))},emitInput:function(t){var e=this.formatToValue(t);wr(this.value,e)||this.$emit("input",e)},isValidValue:function(t){return this.picker||this.mountPicker(),!this.picker.isValidValue||t&&this.picker.isValidValue(t)}}},hr,[],!1,null,null,null);kr.options.__file="packages/date-picker/src/picker.vue";var Or=kr.exports,Ir=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("transition",{attrs:{name:"el-zoom-in-top"},on:{"after-enter":t.handleEnter,"after-leave":t.handleLeave}},[n("div",{directives:[{name:"show",rawName:"v-show",value:t.visible,expression:"visible"}],staticClass:"el-picker-panel el-date-picker el-popper",class:[{"has-sidebar":t.$slots.sidebar||t.shortcuts,"has-time":t.showTime},t.popperClass]},[n("div",{staticClass:"el-picker-panel__body-wrapper"},[t._t("sidebar"),t.shortcuts?n("div",{staticClass:"el-picker-panel__sidebar"},t._l(t.shortcuts,function(e,r){return n("button",{key:r,staticClass:"el-picker-panel__shortcut",attrs:{type:"button"},on:{click:function(n){t.handleShortcutClick(e)}}},[t._v(t._s(e.text))])}),0):t._e(),n("div",{staticClass:"el-picker-panel__body"},[t.showTime?n("div",{staticClass:"el-date-picker__time-header"},[n("span",{staticClass:"el-date-picker__editor-wrap"},[n("el-input",{attrs:{placeholder:t.t("el.datepicker.selectDate"),value:t.visibleDate,size:"small"},on:{input:function(e){return t.userInputDate=e},change:t.handleVisibleDateChange}})],1),n("span",{directives:[{name:"clickoutside",rawName:"v-clickoutside",value:t.handleTimePickClose,expression:"handleTimePickClose"}],staticClass:"el-date-picker__editor-wrap"},[n("el-input",{ref:"input",attrs:{placeholder:t.t("el.datepicker.selectTime"),value:t.visibleTime,size:"small"},on:{focus:function(e){t.timePickerVisible=!0},input:function(e){return t.userInputTime=e},change:t.handleVisibleTimeChange}}),n("time-picker",{ref:"timepicker",attrs:{"time-arrow-control":t.arrowControl,visible:t.timePickerVisible},on:{pick:t.handleTimePick,mounted:t.proxyTimePickerDataProperties}})],1)]):t._e(),n("div",{directives:[{name:"show",rawName:"v-show",value:"time"!==t.currentView,expression:"currentView !== 'time'"}],staticClass:"el-date-picker__header",class:{"el-date-picker__header--bordered":"year"===t.currentView||"month"===t.currentView}},[n("button",{staticClass:"el-picker-panel__icon-btn el-date-picker__prev-btn el-icon-d-arrow-left",attrs:{type:"button","aria-label":t.t("el.datepicker.prevYear")},on:{click:t.prevYear}}),n("button",{directives:[{name:"show",rawName:"v-show",value:"date"===t.currentView,expression:"currentView === 'date'"}],staticClass:"el-picker-panel__icon-btn el-date-picker__prev-btn el-icon-arrow-left",attrs:{type:"button","aria-label":t.t("el.datepicker.prevMonth")},on:{click:t.prevMonth}}),n("span",{staticClass:"el-date-picker__header-label",attrs:{role:"button"},on:{click:t.showYearPicker}},[t._v(t._s(t.yearLabel))]),n("span",{directives:[{name:"show",rawName:"v-show",value:"date"===t.currentView,expression:"currentView === 'date'"}],staticClass:"el-date-picker__header-label",class:{active:"month"===t.currentView},attrs:{role:"button"},on:{click:t.showMonthPicker}},[t._v(t._s(t.t("el.datepicker.month"+(t.month+1))))]),n("button",{staticClass:"el-picker-panel__icon-btn el-date-picker__next-btn el-icon-d-arrow-right",attrs:{type:"button","aria-label":t.t("el.datepicker.nextYear")},on:{click:t.nextYear}}),n("button",{directives:[{name:"show",rawName:"v-show",value:"date"===t.currentView,expression:"currentView === 'date'"}],staticClass:"el-picker-panel__icon-btn el-date-picker__next-btn el-icon-arrow-right",attrs:{type:"button","aria-label":t.t("el.datepicker.nextMonth")},on:{click:t.nextMonth}})]),n("div",{staticClass:"el-picker-panel__content"},[n("date-table",{directives:[{name:"show",rawName:"v-show",value:"date"===t.currentView,expression:"currentView === 'date'"}],attrs:{"selection-mode":t.selectionMode,"first-day-of-week":t.firstDayOfWeek,value:t.value,"default-value":t.defaultValue?new Date(t.defaultValue):null,date:t.date,"cell-class-name":t.cellClassName,"disabled-date":t.disabledDate},on:{pick:t.handleDatePick}}),n("year-table",{directives:[{name:"show",rawName:"v-show",value:"year"===t.currentView,expression:"currentView === 'year'"}],attrs:{value:t.value,"default-value":t.defaultValue?new Date(t.defaultValue):null,date:t.date,"disabled-date":t.disabledDate},on:{pick:t.handleYearPick}}),n("month-table",{directives:[{name:"show",rawName:"v-show",value:"month"===t.currentView,expression:"currentView === 'month'"}],attrs:{value:t.value,"default-value":t.defaultValue?new Date(t.defaultValue):null,date:t.date,"disabled-date":t.disabledDate},on:{pick:t.handleMonthPick}})],1)])],2),n("div",{directives:[{name:"show",rawName:"v-show",value:t.footerVisible&&"date"===t.currentView,expression:"footerVisible && currentView === 'date'"}],staticClass:"el-picker-panel__footer"},[n("el-button",{directives:[{name:"show",rawName:"v-show",value:"dates"!==t.selectionMode,expression:"selectionMode !== 'dates'"}],staticClass:"el-picker-panel__link-btn",attrs:{size:"mini",type:"text"},on:{click:t.changeToNow}},[t._v("\n "+t._s(t.t("el.datepicker.now"))+"\n ")]),n("el-button",{staticClass:"el-picker-panel__link-btn",attrs:{plain:"",size:"mini"},on:{click:t.confirm}},[t._v("\n "+t._s(t.t("el.datepicker.confirm"))+"\n ")])],1)])])};Ir._withStripped=!0;var Rr=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("transition",{attrs:{name:"el-zoom-in-top"},on:{"after-leave":function(e){t.$emit("dodestroy")}}},[n("div",{directives:[{name:"show",rawName:"v-show",value:t.visible,expression:"visible"}],staticClass:"el-time-panel el-popper",class:t.popperClass},[n("div",{staticClass:"el-time-panel__content",class:{"has-seconds":t.showSeconds}},[n("time-spinner",{ref:"spinner",attrs:{"arrow-control":t.useArrow,"show-seconds":t.showSeconds,"am-pm-mode":t.amPmMode,date:t.date},on:{change:t.handleChange,"select-range":t.setSelectionRange}})],1),n("div",{staticClass:"el-time-panel__footer"},[n("button",{staticClass:"el-time-panel__btn cancel",attrs:{type:"button"},on:{click:t.handleCancel}},[t._v(t._s(t.t("el.datepicker.cancel")))]),n("button",{staticClass:"el-time-panel__btn",class:{confirm:!t.disabled},attrs:{type:"button"},on:{click:function(e){t.handleConfirm()}}},[t._v(t._s(t.t("el.datepicker.confirm")))])])])])};Rr._withStripped=!0;var Ar=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"el-time-spinner",class:{"has-seconds":t.showSeconds}},[t.arrowControl?t._e():[n("el-scrollbar",{ref:"hours",staticClass:"el-time-spinner__wrapper",attrs:{"wrap-style":"max-height: inherit;","view-class":"el-time-spinner__list",noresize:"",tag:"ul"},nativeOn:{mouseenter:function(e){t.emitSelectRange("hours")},mousemove:function(e){t.adjustCurrentSpinner("hours")}}},t._l(t.hoursList,function(e,r){return n("li",{key:r,staticClass:"el-time-spinner__item",class:{active:r===t.hours,disabled:e},on:{click:function(n){t.handleClick("hours",{value:r,disabled:e})}}},[t._v(t._s(("0"+(t.amPmMode?r%12||12:r)).slice(-2))+t._s(t.amPm(r)))])}),0),n("el-scrollbar",{ref:"minutes",staticClass:"el-time-spinner__wrapper",attrs:{"wrap-style":"max-height: inherit;","view-class":"el-time-spinner__list",noresize:"",tag:"ul"},nativeOn:{mouseenter:function(e){t.emitSelectRange("minutes")},mousemove:function(e){t.adjustCurrentSpinner("minutes")}}},t._l(t.minutesList,function(e,r){return n("li",{key:r,staticClass:"el-time-spinner__item",class:{active:r===t.minutes,disabled:!e},on:{click:function(e){t.handleClick("minutes",{value:r,disabled:!1})}}},[t._v(t._s(("0"+r).slice(-2)))])}),0),n("el-scrollbar",{directives:[{name:"show",rawName:"v-show",value:t.showSeconds,expression:"showSeconds"}],ref:"seconds",staticClass:"el-time-spinner__wrapper",attrs:{"wrap-style":"max-height: inherit;","view-class":"el-time-spinner__list",noresize:"",tag:"ul"},nativeOn:{mouseenter:function(e){t.emitSelectRange("seconds")},mousemove:function(e){t.adjustCurrentSpinner("seconds")}}},t._l(60,function(e,r){return n("li",{key:r,staticClass:"el-time-spinner__item",class:{active:r===t.seconds},on:{click:function(e){t.handleClick("seconds",{value:r,disabled:!1})}}},[t._v(t._s(("0"+r).slice(-2)))])}),0)],t.arrowControl?[n("div",{staticClass:"el-time-spinner__wrapper is-arrow",on:{mouseenter:function(e){t.emitSelectRange("hours")}}},[n("i",{directives:[{name:"repeat-click",rawName:"v-repeat-click",value:t.decrease,expression:"decrease"}],staticClass:"el-time-spinner__arrow el-icon-arrow-up"}),n("i",{directives:[{name:"repeat-click",rawName:"v-repeat-click",value:t.increase,expression:"increase"}],staticClass:"el-time-spinner__arrow el-icon-arrow-down"}),n("ul",{ref:"hours",staticClass:"el-time-spinner__list"},t._l(t.arrowHourList,function(e,r){return n("li",{key:r,staticClass:"el-time-spinner__item",class:{active:e===t.hours,disabled:t.hoursList[e]}},[t._v(t._s(void 0===e?"":("0"+(t.amPmMode?e%12||12:e)).slice(-2)+t.amPm(e)))])}),0)]),n("div",{staticClass:"el-time-spinner__wrapper is-arrow",on:{mouseenter:function(e){t.emitSelectRange("minutes")}}},[n("i",{directives:[{name:"repeat-click",rawName:"v-repeat-click",value:t.decrease,expression:"decrease"}],staticClass:"el-time-spinner__arrow el-icon-arrow-up"}),n("i",{directives:[{name:"repeat-click",rawName:"v-repeat-click",value:t.increase,expression:"increase"}],staticClass:"el-time-spinner__arrow el-icon-arrow-down"}),n("ul",{ref:"minutes",staticClass:"el-time-spinner__list"},t._l(t.arrowMinuteList,function(e,r){return n("li",{key:r,staticClass:"el-time-spinner__item",class:{active:e===t.minutes}},[t._v("\n "+t._s(void 0===e?"":("0"+e).slice(-2))+"\n ")])}),0)]),t.showSeconds?n("div",{staticClass:"el-time-spinner__wrapper is-arrow",on:{mouseenter:function(e){t.emitSelectRange("seconds")}}},[n("i",{directives:[{name:"repeat-click",rawName:"v-repeat-click",value:t.decrease,expression:"decrease"}],staticClass:"el-time-spinner__arrow el-icon-arrow-up"}),n("i",{directives:[{name:"repeat-click",rawName:"v-repeat-click",value:t.increase,expression:"increase"}],staticClass:"el-time-spinner__arrow el-icon-arrow-down"}),n("ul",{ref:"seconds",staticClass:"el-time-spinner__list"},t._l(t.arrowSecondList,function(e,r){return n("li",{key:r,staticClass:"el-time-spinner__item",class:{active:e===t.seconds}},[t._v("\n "+t._s(void 0===e?"":("0"+e).slice(-2))+"\n ")])}),0)]):t._e()]:t._e()],2)};Ar._withStripped=!0;var Nr=i({components:{ElScrollbar:F.a},directives:{repeatClick:Xt},props:{date:{},defaultValue:{},showSeconds:{type:Boolean,default:!0},arrowControl:Boolean,amPmMode:{type:String,default:""}},computed:{hours:function(){return this.date.getHours()},minutes:function(){return this.date.getMinutes()},seconds:function(){return this.date.getSeconds()},hoursList:function(){return Object(dr.getRangeHours)(this.selectableRange)},minutesList:function(){return Object(dr.getRangeMinutes)(this.selectableRange,this.hours)},arrowHourList:function(){var t=this.hours;return[t>0?t-1:void 0,t,t<23?t+1:void 0]},arrowMinuteList:function(){var t=this.minutes;return[t>0?t-1:void 0,t,t<59?t+1:void 0]},arrowSecondList:function(){var t=this.seconds;return[t>0?t-1:void 0,t,t<59?t+1:void 0]}},data:function(){return{selectableRange:[],currentScrollbar:null}},mounted:function(){var t=this;this.$nextTick(function(){!t.arrowControl&&t.bindScrollEvent()})},methods:{increase:function(){this.scrollDown(1)},decrease:function(){this.scrollDown(-1)},modifyDateField:function(t,e){switch(t){case"hours":this.$emit("change",Object(dr.modifyTime)(this.date,e,this.minutes,this.seconds));break;case"minutes":this.$emit("change",Object(dr.modifyTime)(this.date,this.hours,e,this.seconds));break;case"seconds":this.$emit("change",Object(dr.modifyTime)(this.date,this.hours,this.minutes,e))}},handleClick:function(t,e){var n=e.value;e.disabled||(this.modifyDateField(t,n),this.emitSelectRange(t),this.adjustSpinner(t,n))},emitSelectRange:function(t){"hours"===t?this.$emit("select-range",0,2):"minutes"===t?this.$emit("select-range",3,5):"seconds"===t&&this.$emit("select-range",6,8),this.currentScrollbar=t},bindScrollEvent:function(){var t=this,e=function(e){t.$refs[e].wrap.onscroll=function(n){t.handleScroll(e,n)}};e("hours"),e("minutes"),e("seconds")},handleScroll:function(t){var e=Math.min(Math.round((this.$refs[t].wrap.scrollTop-(.5*this.scrollBarHeight(t)-10)/this.typeItemHeight(t)+3)/this.typeItemHeight(t)),"hours"===t?23:59);this.modifyDateField(t,e)},adjustSpinners:function(){this.adjustSpinner("hours",this.hours),this.adjustSpinner("minutes",this.minutes),this.adjustSpinner("seconds",this.seconds)},adjustCurrentSpinner:function(t){this.adjustSpinner(t,this[t])},adjustSpinner:function(t,e){if(!this.arrowControl){var n=this.$refs[t].wrap;n&&(n.scrollTop=Math.max(0,e*this.typeItemHeight(t)))}},scrollDown:function(t){var e=this;this.currentScrollbar||this.emitSelectRange("hours");var n=this.currentScrollbar,r=this.hoursList,i=this[n];if("hours"===this.currentScrollbar){var o=Math.abs(t);t=t>0?1:-1;for(var s=r.length;s--&&o;)r[i=(i+t+r.length)%r.length]||o--;if(r[i])return}else i=(i+t+60)%60;this.modifyDateField(n,i),this.adjustSpinner(n,i),this.$nextTick(function(){return e.emitSelectRange(e.currentScrollbar)})},amPm:function(t){if(!("a"===this.amPmMode.toLowerCase()))return"";var e="A"===this.amPmMode,n=t<12?" am":" pm";return e&&(n=n.toUpperCase()),n},typeItemHeight:function(t){return this.$refs[t].$el.querySelector("li").offsetHeight},scrollBarHeight:function(t){return this.$refs[t].$el.offsetHeight}}},Ar,[],!1,null,null,null);Nr.options.__file="packages/date-picker/src/basic/time-spinner.vue";var Dr=Nr.exports,Mr=i({mixins:[f.a],components:{TimeSpinner:Dr},props:{visible:Boolean,timeArrowControl:Boolean},watch:{visible:function(t){var e=this;t?(this.oldValue=this.value,this.$nextTick(function(){return e.$refs.spinner.emitSelectRange("hours")})):this.needInitAdjust=!0},value:function(t){var e=this,n=void 0;t instanceof Date?n=Object(dr.limitTimeRange)(t,this.selectableRange,this.format):t||(n=this.defaultValue?new Date(this.defaultValue):new Date),this.date=n,this.visible&&this.needInitAdjust&&(this.$nextTick(function(t){return e.adjustSpinners()}),this.needInitAdjust=!1)},selectableRange:function(t){this.$refs.spinner.selectableRange=t},defaultValue:function(t){Object(dr.isDate)(this.value)||(this.date=t?new Date(t):new Date)}},data:function(){return{popperClass:"",format:"HH:mm:ss",value:"",defaultValue:null,date:new Date,oldValue:new Date,selectableRange:[],selectionRange:[0,2],disabled:!1,arrowControl:!1,needInitAdjust:!0}},computed:{showSeconds:function(){return-1!==(this.format||"").indexOf("ss")},useArrow:function(){return this.arrowControl||this.timeArrowControl||!1},amPmMode:function(){return-1!==(this.format||"").indexOf("A")?"A":-1!==(this.format||"").indexOf("a")?"a":""}},methods:{handleCancel:function(){this.$emit("pick",this.oldValue,!1)},handleChange:function(t){this.visible&&(this.date=Object(dr.clearMilliseconds)(t),this.isValidValue(this.date)&&this.$emit("pick",this.date,!0))},setSelectionRange:function(t,e){this.$emit("select-range",t,e),this.selectionRange=[t,e]},handleConfirm:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments[1];if(!e){var n=Object(dr.clearMilliseconds)(Object(dr.limitTimeRange)(this.date,this.selectableRange,this.format));this.$emit("pick",n,t,e)}},handleKeydown:function(t){var e=t.keyCode,n={38:-1,40:1,37:-1,39:1};if(37===e||39===e){var r=n[e];return this.changeSelectionRange(r),void t.preventDefault()}if(38===e||40===e){var i=n[e];return this.$refs.spinner.scrollDown(i),void t.preventDefault()}},isValidValue:function(t){return Object(dr.timeWithinRange)(t,this.selectableRange,this.format)},adjustSpinners:function(){return this.$refs.spinner.adjustSpinners()},changeSelectionRange:function(t){var e=[0,3].concat(this.showSeconds?[6]:[]),n=["hours","minutes"].concat(this.showSeconds?["seconds"]:[]),r=(e.indexOf(this.selectionRange[0])+t+e.length)%e.length;this.$refs.spinner.emitSelectRange(n[r])}},mounted:function(){var t=this;this.$nextTick(function(){return t.handleConfirm(!0,!0)}),this.$emit("mounted")}},Rr,[],!1,null,null,null);Mr.options.__file="packages/date-picker/src/panel/time.vue";var Lr=Mr.exports,Pr=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("table",{staticClass:"el-year-table",on:{click:t.handleYearTableClick}},[n("tbody",[n("tr",[n("td",{staticClass:"available",class:t.getCellStyle(t.startYear+0)},[n("a",{staticClass:"cell"},[t._v(t._s(t.startYear))])]),n("td",{staticClass:"available",class:t.getCellStyle(t.startYear+1)},[n("a",{staticClass:"cell"},[t._v(t._s(t.startYear+1))])]),n("td",{staticClass:"available",class:t.getCellStyle(t.startYear+2)},[n("a",{staticClass:"cell"},[t._v(t._s(t.startYear+2))])]),n("td",{staticClass:"available",class:t.getCellStyle(t.startYear+3)},[n("a",{staticClass:"cell"},[t._v(t._s(t.startYear+3))])])]),n("tr",[n("td",{staticClass:"available",class:t.getCellStyle(t.startYear+4)},[n("a",{staticClass:"cell"},[t._v(t._s(t.startYear+4))])]),n("td",{staticClass:"available",class:t.getCellStyle(t.startYear+5)},[n("a",{staticClass:"cell"},[t._v(t._s(t.startYear+5))])]),n("td",{staticClass:"available",class:t.getCellStyle(t.startYear+6)},[n("a",{staticClass:"cell"},[t._v(t._s(t.startYear+6))])]),n("td",{staticClass:"available",class:t.getCellStyle(t.startYear+7)},[n("a",{staticClass:"cell"},[t._v(t._s(t.startYear+7))])])]),n("tr",[n("td",{staticClass:"available",class:t.getCellStyle(t.startYear+8)},[n("a",{staticClass:"cell"},[t._v(t._s(t.startYear+8))])]),n("td",{staticClass:"available",class:t.getCellStyle(t.startYear+9)},[n("a",{staticClass:"cell"},[t._v(t._s(t.startYear+9))])]),n("td"),n("td")])])])};Pr._withStripped=!0;var Fr=i({props:{disabledDate:{},value:{},defaultValue:{validator:function(t){return null===t||t instanceof Date&&Object(dr.isDate)(t)}},date:{}},computed:{startYear:function(){return 10*Math.floor(this.date.getFullYear()/10)}},methods:{getCellStyle:function(t){var e={},n=new Date;return e.disabled="function"==typeof this.disabledDate&&function(t){var e=Object(dr.getDayCountOfYear)(t),n=new Date(t,0,1);return Object(dr.range)(e).map(function(t){return Object(dr.nextDate)(n,t)})}(t).every(this.disabledDate),e.current=Object(g.arrayFindIndex)(Object(g.coerceTruthyValueToArray)(this.value),function(e){return e.getFullYear()===t})>=0,e.today=n.getFullYear()===t,e.default=this.defaultValue&&this.defaultValue.getFullYear()===t,e},handleYearTableClick:function(t){var e=t.target;if("A"===e.tagName){if(Object(ft.hasClass)(e.parentNode,"disabled"))return;var n=e.textContent||e.innerText;this.$emit("pick",Number(n))}}}},Pr,[],!1,null,null,null);Fr.options.__file="packages/date-picker/src/basic/year-table.vue";var Br=Fr.exports,jr=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("table",{staticClass:"el-month-table",on:{click:t.handleMonthTableClick,mousemove:t.handleMouseMove}},[n("tbody",t._l(t.rows,function(e,r){return n("tr",{key:r},t._l(e,function(e,r){return n("td",{key:r,class:t.getCellStyle(e)},[n("div",[n("a",{staticClass:"cell"},[t._v(t._s(t.t("el.datepicker.months."+t.months[e.text])))])])])}),0)}),0)])};jr._withStripped=!0;var $r=function(t){return new Date(t.getFullYear(),t.getMonth())},Ur=function(t){return"number"==typeof t||"string"==typeof t?$r(new Date(t)).getTime():t instanceof Date?$r(t).getTime():NaN},Vr=i({props:{disabledDate:{},value:{},selectionMode:{default:"month"},minDate:{},maxDate:{},defaultValue:{validator:function(t){return null===t||Object(dr.isDate)(t)||Array.isArray(t)&&t.every(dr.isDate)}},date:{},rangeState:{default:function(){return{endDate:null,selecting:!1}}}},mixins:[f.a],watch:{"rangeState.endDate":function(t){this.markRange(this.minDate,t)},minDate:function(t,e){Ur(t)!==Ur(e)&&this.markRange(this.minDate,this.maxDate)},maxDate:function(t,e){Ur(t)!==Ur(e)&&this.markRange(this.minDate,this.maxDate)}},data:function(){return{months:["jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"],tableRows:[[],[],[]],lastRow:null,lastColumn:null}},methods:{cellMatchesDate:function(t,e){var n=new Date(e);return this.date.getFullYear()===n.getFullYear()&&Number(t.text)===n.getMonth()},getCellStyle:function(t){var e=this,n={},r=this.date.getFullYear(),i=new Date,o=t.text,s=this.defaultValue?Array.isArray(this.defaultValue)?this.defaultValue:[this.defaultValue]:[];return n.disabled="function"==typeof this.disabledDate&&function(t,e){var n=Object(dr.getDayCountOfMonth)(t,e),r=new Date(t,e,1);return Object(dr.range)(n).map(function(t){return Object(dr.nextDate)(r,t)})}(r,o).every(this.disabledDate),n.current=Object(g.arrayFindIndex)(Object(g.coerceTruthyValueToArray)(this.value),function(t){return t.getFullYear()===r&&t.getMonth()===o})>=0,n.today=i.getFullYear()===r&&i.getMonth()===o,n.default=s.some(function(n){return e.cellMatchesDate(t,n)}),t.inRange&&(n["in-range"]=!0,t.start&&(n["start-date"]=!0),t.end&&(n["end-date"]=!0)),n},getMonthOfCell:function(t){var e=this.date.getFullYear();return new Date(e,t,1)},markRange:function(t,e){t=Ur(t),e=Ur(e)||t;var n=[Math.min(t,e),Math.max(t,e)];t=n[0],e=n[1];for(var r=this.rows,i=0,o=r.length;i<o;i++)for(var s=r[i],a=0,l=s.length;a<l;a++){var u=s[a],c=4*i+a,h=new Date(this.date.getFullYear(),c).getTime();u.inRange=t&&h>=t&&h<=e,u.start=t&&h===t,u.end=e&&h===e}},handleMouseMove:function(t){if(this.rangeState.selecting){var e=t.target;if("A"===e.tagName&&(e=e.parentNode.parentNode),"DIV"===e.tagName&&(e=e.parentNode),"TD"===e.tagName){var n=e.parentNode.rowIndex,r=e.cellIndex;this.rows[n][r].disabled||n===this.lastRow&&r===this.lastColumn||(this.lastRow=n,this.lastColumn=r,this.$emit("changerange",{minDate:this.minDate,maxDate:this.maxDate,rangeState:{selecting:!0,endDate:this.getMonthOfCell(4*n+r)}}))}}},handleMonthTableClick:function(t){var e=t.target;if("A"===e.tagName&&(e=e.parentNode.parentNode),"DIV"===e.tagName&&(e=e.parentNode),"TD"===e.tagName&&!Object(ft.hasClass)(e,"disabled")){var n=e.cellIndex,r=4*e.parentNode.rowIndex+n,i=this.getMonthOfCell(r);"range"===this.selectionMode?this.rangeState.selecting?(i>=this.minDate?this.$emit("pick",{minDate:this.minDate,maxDate:i}):this.$emit("pick",{minDate:i,maxDate:this.minDate}),this.rangeState.selecting=!1):(this.$emit("pick",{minDate:i,maxDate:null}),this.rangeState.selecting=!0):this.$emit("pick",r)}}},computed:{rows:function(){for(var t=this,e=this.tableRows,n=this.disabledDate,r=[],i=Ur(new Date),o=0;o<3;o++)for(var s=e[o],a=function(e){var a=s[e];a||(a={row:o,column:e,type:"normal",inRange:!1,start:!1,end:!1}),a.type="normal";var l=4*o+e,u=new Date(t.date.getFullYear(),l).getTime();a.inRange=u>=Ur(t.minDate)&&u<=Ur(t.maxDate),a.start=t.minDate&&u===Ur(t.minDate),a.end=t.maxDate&&u===Ur(t.maxDate),u===i&&(a.type="today"),a.text=l;var c=new Date(u);a.disabled="function"==typeof n&&n(c),a.selected=Object(g.arrayFind)(r,function(t){return t.getTime()===c.getTime()}),t.$set(s,e,a)},l=0;l<4;l++)a(l);return e}}},jr,[],!1,null,null,null);Vr.options.__file="packages/date-picker/src/basic/month-table.vue";var Hr=Vr.exports,Wr=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("table",{staticClass:"el-date-table",class:{"is-week-mode":"week"===t.selectionMode},attrs:{cellspacing:"0",cellpadding:"0"},on:{click:t.handleClick,mousemove:t.handleMouseMove}},[n("tbody",[n("tr",[t.showWeekNumber?n("th",[t._v(t._s(t.t("el.datepicker.week")))]):t._e(),t._l(t.WEEKS,function(e,r){return n("th",{key:r},[t._v(t._s(t.t("el.datepicker.weeks."+e)))])})],2),t._l(t.rows,function(e,r){return n("tr",{key:r,staticClass:"el-date-table__row",class:{current:t.isWeekActive(e[1])}},t._l(e,function(e,r){return n("td",{key:r,class:t.getCellClasses(e)},[n("div",[n("span",[t._v("\n "+t._s(e.text)+"\n ")])])])}),0)})],2)])};Wr._withStripped=!0;var Gr=["sun","mon","tue","wed","thu","fri","sat"],zr=function(t){return"number"==typeof t||"string"==typeof t?Object(dr.clearTime)(new Date(t)).getTime():t instanceof Date?Object(dr.clearTime)(t).getTime():NaN},Xr=i({mixins:[f.a],props:{firstDayOfWeek:{default:7,type:Number,validator:function(t){return t>=1&&t<=7}},value:{},defaultValue:{validator:function(t){return null===t||Object(dr.isDate)(t)||Array.isArray(t)&&t.every(dr.isDate)}},date:{},selectionMode:{default:"day"},showWeekNumber:{type:Boolean,default:!1},disabledDate:{},cellClassName:{},minDate:{},maxDate:{},rangeState:{default:function(){return{endDate:null,selecting:!1}}}},computed:{offsetDay:function(){var t=this.firstDayOfWeek;return t>3?7-t:-t},WEEKS:function(){var t=this.firstDayOfWeek;return Gr.concat(Gr).slice(t,t+7)},year:function(){return this.date.getFullYear()},month:function(){return this.date.getMonth()},startDate:function(){return Object(dr.getStartDateOfMonth)(this.year,this.month)},rows:function(){var t=this,e=new Date(this.year,this.month,1),n=Object(dr.getFirstDayOfMonth)(e),r=Object(dr.getDayCountOfMonth)(e.getFullYear(),e.getMonth()),i=Object(dr.getDayCountOfMonth)(e.getFullYear(),0===e.getMonth()?11:e.getMonth()-1);n=0===n?7:n;for(var o=this.offsetDay,s=this.tableRows,a=1,l=this.startDate,u=this.disabledDate,c=this.cellClassName,h="dates"===this.selectionMode?Object(g.coerceTruthyValueToArray)(this.value):[],d=zr(new Date),p=0;p<6;p++){var f=s[p];this.showWeekNumber&&(f[0]||(f[0]={type:"week",text:Object(dr.getWeekNumber)(Object(dr.nextDate)(l,7*p+1))}));for(var m=function(e){var s=f[t.showWeekNumber?e+1:e];s||(s={row:p,column:e,type:"normal",inRange:!1,start:!1,end:!1}),s.type="normal";var m=7*p+e,v=Object(dr.nextDate)(l,m-o).getTime();if(s.inRange=v>=zr(t.minDate)&&v<=zr(t.maxDate),s.start=t.minDate&&v===zr(t.minDate),s.end=t.maxDate&&v===zr(t.maxDate),v===d&&(s.type="today"),p>=0&&p<=1){var b=n+o<0?7+n+o:n+o;e+7*p>=b?s.text=a++:(s.text=i-(b-e%7)+1+7*p,s.type="prev-month")}else a<=r?s.text=a++:(s.text=a++-r,s.type="next-month");var _=new Date(v);s.disabled="function"==typeof u&&u(_),s.selected=Object(g.arrayFind)(h,function(t){return t.getTime()===_.getTime()}),s.customClass="function"==typeof c&&c(_),t.$set(f,t.showWeekNumber?e+1:e,s)},v=0;v<7;v++)m(v);if("week"===this.selectionMode){var b=this.showWeekNumber?1:0,_=this.showWeekNumber?7:6,y=this.isWeekActive(f[b+1]);f[b].inRange=y,f[b].start=y,f[_].inRange=y,f[_].end=y}}return s}},watch:{"rangeState.endDate":function(t){this.markRange(this.minDate,t)},minDate:function(t,e){zr(t)!==zr(e)&&this.markRange(this.minDate,this.maxDate)},maxDate:function(t,e){zr(t)!==zr(e)&&this.markRange(this.minDate,this.maxDate)}},data:function(){return{tableRows:[[],[],[],[],[],[]],lastRow:null,lastColumn:null}},methods:{cellMatchesDate:function(t,e){var n=new Date(e);return this.year===n.getFullYear()&&this.month===n.getMonth()&&Number(t.text)===n.getDate()},getCellClasses:function(t){var e=this,n=this.selectionMode,r=this.defaultValue?Array.isArray(this.defaultValue)?this.defaultValue:[this.defaultValue]:[],i=[];return"normal"!==t.type&&"today"!==t.type||t.disabled?i.push(t.type):(i.push("available"),"today"===t.type&&i.push("today")),"normal"===t.type&&r.some(function(n){return e.cellMatchesDate(t,n)})&&i.push("default"),"day"!==n||"normal"!==t.type&&"today"!==t.type||!this.cellMatchesDate(t,this.value)||i.push("current"),!t.inRange||"normal"!==t.type&&"today"!==t.type&&"week"!==this.selectionMode||(i.push("in-range"),t.start&&i.push("start-date"),t.end&&i.push("end-date")),t.disabled&&i.push("disabled"),t.selected&&i.push("selected"),t.customClass&&i.push(t.customClass),i.join(" ")},getDateOfCell:function(t,e){var n=7*t+(e-(this.showWeekNumber?1:0))-this.offsetDay;return Object(dr.nextDate)(this.startDate,n)},isWeekActive:function(t){if("week"!==this.selectionMode)return!1;var e=new Date(this.year,this.month,1),n=e.getFullYear(),r=e.getMonth();if("prev-month"===t.type&&(e.setMonth(0===r?11:r-1),e.setFullYear(0===r?n-1:n)),"next-month"===t.type&&(e.setMonth(11===r?0:r+1),e.setFullYear(11===r?n+1:n)),e.setDate(parseInt(t.text,10)),Object(dr.isDate)(this.value)){var i=(this.value.getDay()-this.firstDayOfWeek+7)%7-1;return Object(dr.prevDate)(this.value,i).getTime()===e.getTime()}return!1},markRange:function(t,e){t=zr(t),e=zr(e)||t;var n=[Math.min(t,e),Math.max(t,e)];t=n[0],e=n[1];for(var r=this.startDate,i=this.rows,o=0,s=i.length;o<s;o++)for(var a=i[o],l=0,u=a.length;l<u;l++)if(!this.showWeekNumber||0!==l){var c=a[l],h=7*o+l+(this.showWeekNumber?-1:0),d=Object(dr.nextDate)(r,h-this.offsetDay).getTime();c.inRange=t&&d>=t&&d<=e,c.start=t&&d===t,c.end=e&&d===e}},handleMouseMove:function(t){if(this.rangeState.selecting){var e=t.target;if("SPAN"===e.tagName&&(e=e.parentNode.parentNode),"DIV"===e.tagName&&(e=e.parentNode),"TD"===e.tagName){var n=e.parentNode.rowIndex-1,r=e.cellIndex;this.rows[n][r].disabled||n===this.lastRow&&r===this.lastColumn||(this.lastRow=n,this.lastColumn=r,this.$emit("changerange",{minDate:this.minDate,maxDate:this.maxDate,rangeState:{selecting:!0,endDate:this.getDateOfCell(n,r)}}))}}},handleClick:function(t){var e=t.target;if("SPAN"===e.tagName&&(e=e.parentNode.parentNode),"DIV"===e.tagName&&(e=e.parentNode),"TD"===e.tagName){var n=e.parentNode.rowIndex-1,r="week"===this.selectionMode?1:e.cellIndex,i=this.rows[n][r];if(!i.disabled&&"week"!==i.type){var o,s,a,l=this.getDateOfCell(n,r);if("range"===this.selectionMode)this.rangeState.selecting?(l>=this.minDate?this.$emit("pick",{minDate:this.minDate,maxDate:l}):this.$emit("pick",{minDate:l,maxDate:this.minDate}),this.rangeState.selecting=!1):(this.$emit("pick",{minDate:l,maxDate:null}),this.rangeState.selecting=!0);else if("day"===this.selectionMode)this.$emit("pick",l);else if("week"===this.selectionMode){var u=Object(dr.getWeekNumber)(l),c=l.getFullYear()+"w"+u;this.$emit("pick",{year:l.getFullYear(),week:u,value:c,date:l})}else if("dates"===this.selectionMode){var h=this.value||[],d=i.selected?(o=h,(a="function"==typeof(s=function(t){return t.getTime()===l.getTime()})?Object(g.arrayFindIndex)(o,s):o.indexOf(s))>=0?[].concat(o.slice(0,a),o.slice(a+1)):o):[].concat(h,[l]);this.$emit("pick",d)}}}}}},Wr,[],!1,null,null,null);Xr.options.__file="packages/date-picker/src/basic/date-table.vue";var Kr=Xr.exports,Yr=i({mixins:[f.a],directives:{Clickoutside:N.a},watch:{showTime:function(t){var e=this;t&&this.$nextTick(function(t){var n=e.$refs.input.$el;n&&(e.pickerWidth=n.getBoundingClientRect().width+10)})},value:function(t){"dates"===this.selectionMode&&this.value||(Object(dr.isDate)(t)?this.date=new Date(t):this.date=this.getDefaultValue())},defaultValue:function(t){Object(dr.isDate)(this.value)||(this.date=t?new Date(t):new Date)},timePickerVisible:function(t){var e=this;t&&this.$nextTick(function(){return e.$refs.timepicker.adjustSpinners()})},selectionMode:function(t){"month"===t?"year"===this.currentView&&"month"===this.currentView||(this.currentView="month"):"dates"===t&&(this.currentView="date")}},methods:{proxyTimePickerDataProperties:function(){var t,e=this,n=function(t){e.$refs.timepicker.value=t},r=function(t){e.$refs.timepicker.date=t},i=function(t){e.$refs.timepicker.selectableRange=t};this.$watch("value",n),this.$watch("date",r),this.$watch("selectableRange",i),t=this.timeFormat,e.$refs.timepicker.format=t,n(this.value),r(this.date),i(this.selectableRange)},handleClear:function(){this.date=this.getDefaultValue(),this.$emit("pick",null)},emit:function(t){for(var e=this,n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];if(t)if(Array.isArray(t)){var o=t.map(function(t){return e.showTime?Object(dr.clearMilliseconds)(t):Object(dr.clearTime)(t)});this.$emit.apply(this,["pick",o].concat(r))}else this.$emit.apply(this,["pick",this.showTime?Object(dr.clearMilliseconds)(t):Object(dr.clearTime)(t)].concat(r));else this.$emit.apply(this,["pick",t].concat(r));this.userInputDate=null,this.userInputTime=null},showMonthPicker:function(){this.currentView="month"},showYearPicker:function(){this.currentView="year"},prevMonth:function(){this.date=Object(dr.prevMonth)(this.date)},nextMonth:function(){this.date=Object(dr.nextMonth)(this.date)},prevYear:function(){"year"===this.currentView?this.date=Object(dr.prevYear)(this.date,10):this.date=Object(dr.prevYear)(this.date)},nextYear:function(){"year"===this.currentView?this.date=Object(dr.nextYear)(this.date,10):this.date=Object(dr.nextYear)(this.date)},handleShortcutClick:function(t){t.onClick&&t.onClick(this)},handleTimePick:function(t,e,n){if(Object(dr.isDate)(t)){var r=this.value?Object(dr.modifyTime)(this.value,t.getHours(),t.getMinutes(),t.getSeconds()):Object(dr.modifyWithTimeString)(this.getDefaultValue(),this.defaultTime);this.date=r,this.emit(this.date,!0)}else this.emit(t,!0);n||(this.timePickerVisible=e)},handleTimePickClose:function(){this.timePickerVisible=!1},handleMonthPick:function(t){"month"===this.selectionMode?(this.date=Object(dr.modifyDate)(this.date,this.year,t,1),this.emit(this.date)):(this.date=Object(dr.changeYearMonthAndClampDate)(this.date,this.year,t),this.currentView="date")},handleDatePick:function(t){if("day"===this.selectionMode){var e=this.value?Object(dr.modifyDate)(this.value,t.getFullYear(),t.getMonth(),t.getDate()):Object(dr.modifyWithTimeString)(t,this.defaultTime);this.checkDateWithinRange(e)||(e=Object(dr.modifyDate)(this.selectableRange[0][0],t.getFullYear(),t.getMonth(),t.getDate())),this.date=e,this.emit(this.date,this.showTime)}else"week"===this.selectionMode?this.emit(t.date):"dates"===this.selectionMode&&this.emit(t,!0)},handleYearPick:function(t){"year"===this.selectionMode?(this.date=Object(dr.modifyDate)(this.date,t,0,1),this.emit(this.date)):(this.date=Object(dr.changeYearMonthAndClampDate)(this.date,t,this.month),this.currentView="month")},changeToNow:function(){this.disabledDate&&this.disabledDate(new Date)||!this.checkDateWithinRange(new Date)||(this.date=new Date,this.emit(this.date))},confirm:function(){if("dates"===this.selectionMode)this.emit(this.value);else{var t=this.value?this.value:Object(dr.modifyWithTimeString)(this.getDefaultValue(),this.defaultTime);this.date=new Date(t),this.emit(t)}},resetView:function(){"month"===this.selectionMode?this.currentView="month":"year"===this.selectionMode?this.currentView="year":this.currentView="date"},handleEnter:function(){document.body.addEventListener("keydown",this.handleKeydown)},handleLeave:function(){this.$emit("dodestroy"),document.body.removeEventListener("keydown",this.handleKeydown)},handleKeydown:function(t){var e=t.keyCode;this.visible&&!this.timePickerVisible&&(-1!==[38,40,37,39].indexOf(e)&&(this.handleKeyControl(e),t.stopPropagation(),t.preventDefault()),13===e&&null===this.userInputDate&&null===this.userInputTime&&this.emit(this.date,!1))},handleKeyControl:function(t){for(var e={year:{38:-4,40:4,37:-1,39:1,offset:function(t,e){return t.setFullYear(t.getFullYear()+e)}},month:{38:-4,40:4,37:-1,39:1,offset:function(t,e){return t.setMonth(t.getMonth()+e)}},week:{38:-1,40:1,37:-1,39:1,offset:function(t,e){return t.setDate(t.getDate()+7*e)}},day:{38:-7,40:7,37:-1,39:1,offset:function(t,e){return t.setDate(t.getDate()+e)}}},n=this.selectionMode,r=this.date.getTime(),i=new Date(this.date.getTime());Math.abs(r-i.getTime())<=31536e6;){var o=e[n];if(o.offset(i,o[t]),"function"!=typeof this.disabledDate||!this.disabledDate(i)){this.date=i,this.$emit("pick",i,!0);break}}},handleVisibleTimeChange:function(t){var e=Object(dr.parseDate)(t,this.timeFormat);e&&this.checkDateWithinRange(e)&&(this.date=Object(dr.modifyDate)(e,this.year,this.month,this.monthDate),this.userInputTime=null,this.$refs.timepicker.value=this.date,this.timePickerVisible=!1,this.emit(this.date,!0))},handleVisibleDateChange:function(t){var e=Object(dr.parseDate)(t,this.dateFormat);if(e){if("function"==typeof this.disabledDate&&this.disabledDate(e))return;this.date=Object(dr.modifyTime)(e,this.date.getHours(),this.date.getMinutes(),this.date.getSeconds()),this.userInputDate=null,this.resetView(),this.emit(this.date,!0)}},isValidValue:function(t){return t&&!isNaN(t)&&("function"!=typeof this.disabledDate||!this.disabledDate(t))&&this.checkDateWithinRange(t)},getDefaultValue:function(){return this.defaultValue?new Date(this.defaultValue):new Date},checkDateWithinRange:function(t){return!(this.selectableRange.length>0)||Object(dr.timeWithinRange)(t,this.selectableRange,this.format||"HH:mm:ss")}},components:{TimePicker:Lr,YearTable:Br,MonthTable:Hr,DateTable:Kr,ElInput:d.a,ElButton:z.a},data:function(){return{popperClass:"",date:new Date,value:"",defaultValue:null,defaultTime:null,showTime:!1,selectionMode:"day",shortcuts:"",visible:!1,currentView:"date",disabledDate:"",cellClassName:"",selectableRange:[],firstDayOfWeek:7,showWeekNumber:!1,timePickerVisible:!1,format:"",arrowControl:!1,userInputDate:null,userInputTime:null}},computed:{year:function(){return this.date.getFullYear()},month:function(){return this.date.getMonth()},week:function(){return Object(dr.getWeekNumber)(this.date)},monthDate:function(){return this.date.getDate()},footerVisible:function(){return this.showTime||"dates"===this.selectionMode},visibleTime:function(){return null!==this.userInputTime?this.userInputTime:Object(dr.formatDate)(this.value||this.defaultValue,this.timeFormat)},visibleDate:function(){return null!==this.userInputDate?this.userInputDate:Object(dr.formatDate)(this.value||this.defaultValue,this.dateFormat)},yearLabel:function(){var t=this.t("el.datepicker.year");if("year"===this.currentView){var e=10*Math.floor(this.year/10);return t?e+" "+t+" - "+(e+9)+" "+t:e+" - "+(e+9)}return this.year+" "+t},timeFormat:function(){return this.format?Object(dr.extractTimeFormat)(this.format):"HH:mm:ss"},dateFormat:function(){return this.format?Object(dr.extractDateFormat)(this.format):"yyyy-MM-dd"}}},Ir,[],!1,null,null,null);Yr.options.__file="packages/date-picker/src/panel/date.vue";var qr=Yr.exports,Jr=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("transition",{attrs:{name:"el-zoom-in-top"},on:{"after-leave":function(e){t.$emit("dodestroy")}}},[n("div",{directives:[{name:"show",rawName:"v-show",value:t.visible,expression:"visible"}],staticClass:"el-picker-panel el-date-range-picker el-popper",class:[{"has-sidebar":t.$slots.sidebar||t.shortcuts,"has-time":t.showTime},t.popperClass]},[n("div",{staticClass:"el-picker-panel__body-wrapper"},[t._t("sidebar"),t.shortcuts?n("div",{staticClass:"el-picker-panel__sidebar"},t._l(t.shortcuts,function(e,r){return n("button",{key:r,staticClass:"el-picker-panel__shortcut",attrs:{type:"button"},on:{click:function(n){t.handleShortcutClick(e)}}},[t._v(t._s(e.text))])}),0):t._e(),n("div",{staticClass:"el-picker-panel__body"},[t.showTime?n("div",{staticClass:"el-date-range-picker__time-header"},[n("span",{staticClass:"el-date-range-picker__editors-wrap"},[n("span",{staticClass:"el-date-range-picker__time-picker-wrap"},[n("el-input",{ref:"minInput",staticClass:"el-date-range-picker__editor",attrs:{size:"small",disabled:t.rangeState.selecting,placeholder:t.t("el.datepicker.startDate"),value:t.minVisibleDate},on:{input:function(e){return t.handleDateInput(e,"min")},change:function(e){return t.handleDateChange(e,"min")}}})],1),n("span",{directives:[{name:"clickoutside",rawName:"v-clickoutside",value:t.handleMinTimeClose,expression:"handleMinTimeClose"}],staticClass:"el-date-range-picker__time-picker-wrap"},[n("el-input",{staticClass:"el-date-range-picker__editor",attrs:{size:"small",disabled:t.rangeState.selecting,placeholder:t.t("el.datepicker.startTime"),value:t.minVisibleTime},on:{focus:function(e){t.minTimePickerVisible=!0},input:function(e){return t.handleTimeInput(e,"min")},change:function(e){return t.handleTimeChange(e,"min")}}}),n("time-picker",{ref:"minTimePicker",attrs:{"time-arrow-control":t.arrowControl,visible:t.minTimePickerVisible},on:{pick:t.handleMinTimePick,mounted:function(e){t.$refs.minTimePicker.format=t.timeFormat}}})],1)]),n("span",{staticClass:"el-icon-arrow-right"}),n("span",{staticClass:"el-date-range-picker__editors-wrap is-right"},[n("span",{staticClass:"el-date-range-picker__time-picker-wrap"},[n("el-input",{staticClass:"el-date-range-picker__editor",attrs:{size:"small",disabled:t.rangeState.selecting,placeholder:t.t("el.datepicker.endDate"),value:t.maxVisibleDate,readonly:!t.minDate},on:{input:function(e){return t.handleDateInput(e,"max")},change:function(e){return t.handleDateChange(e,"max")}}})],1),n("span",{directives:[{name:"clickoutside",rawName:"v-clickoutside",value:t.handleMaxTimeClose,expression:"handleMaxTimeClose"}],staticClass:"el-date-range-picker__time-picker-wrap"},[n("el-input",{staticClass:"el-date-range-picker__editor",attrs:{size:"small",disabled:t.rangeState.selecting,placeholder:t.t("el.datepicker.endTime"),value:t.maxVisibleTime,readonly:!t.minDate},on:{focus:function(e){t.minDate&&(t.maxTimePickerVisible=!0)},input:function(e){return t.handleTimeInput(e,"max")},change:function(e){return t.handleTimeChange(e,"max")}}}),n("time-picker",{ref:"maxTimePicker",attrs:{"time-arrow-control":t.arrowControl,visible:t.maxTimePickerVisible},on:{pick:t.handleMaxTimePick,mounted:function(e){t.$refs.maxTimePicker.format=t.timeFormat}}})],1)])]):t._e(),n("div",{staticClass:"el-picker-panel__content el-date-range-picker__content is-left"},[n("div",{staticClass:"el-date-range-picker__header"},[n("button",{staticClass:"el-picker-panel__icon-btn el-icon-d-arrow-left",attrs:{type:"button"},on:{click:t.leftPrevYear}}),n("button",{staticClass:"el-picker-panel__icon-btn el-icon-arrow-left",attrs:{type:"button"},on:{click:t.leftPrevMonth}}),t.unlinkPanels?n("button",{staticClass:"el-picker-panel__icon-btn el-icon-d-arrow-right",class:{"is-disabled":!t.enableYearArrow},attrs:{type:"button",disabled:!t.enableYearArrow},on:{click:t.leftNextYear}}):t._e(),t.unlinkPanels?n("button",{staticClass:"el-picker-panel__icon-btn el-icon-arrow-right",class:{"is-disabled":!t.enableMonthArrow},attrs:{type:"button",disabled:!t.enableMonthArrow},on:{click:t.leftNextMonth}}):t._e(),n("div",[t._v(t._s(t.leftLabel))])]),n("date-table",{attrs:{"selection-mode":"range",date:t.leftDate,"default-value":t.defaultValue,"min-date":t.minDate,"max-date":t.maxDate,"range-state":t.rangeState,"disabled-date":t.disabledDate,"cell-class-name":t.cellClassName,"first-day-of-week":t.firstDayOfWeek},on:{changerange:t.handleChangeRange,pick:t.handleRangePick}})],1),n("div",{staticClass:"el-picker-panel__content el-date-range-picker__content is-right"},[n("div",{staticClass:"el-date-range-picker__header"},[t.unlinkPanels?n("button",{staticClass:"el-picker-panel__icon-btn el-icon-d-arrow-left",class:{"is-disabled":!t.enableYearArrow},attrs:{type:"button",disabled:!t.enableYearArrow},on:{click:t.rightPrevYear}}):t._e(),t.unlinkPanels?n("button",{staticClass:"el-picker-panel__icon-btn el-icon-arrow-left",class:{"is-disabled":!t.enableMonthArrow},attrs:{type:"button",disabled:!t.enableMonthArrow},on:{click:t.rightPrevMonth}}):t._e(),n("button",{staticClass:"el-picker-panel__icon-btn el-icon-d-arrow-right",attrs:{type:"button"},on:{click:t.rightNextYear}}),n("button",{staticClass:"el-picker-panel__icon-btn el-icon-arrow-right",attrs:{type:"button"},on:{click:t.rightNextMonth}}),n("div",[t._v(t._s(t.rightLabel))])]),n("date-table",{attrs:{"selection-mode":"range",date:t.rightDate,"default-value":t.defaultValue,"min-date":t.minDate,"max-date":t.maxDate,"range-state":t.rangeState,"disabled-date":t.disabledDate,"cell-class-name":t.cellClassName,"first-day-of-week":t.firstDayOfWeek},on:{changerange:t.handleChangeRange,pick:t.handleRangePick}})],1)])],2),t.showTime?n("div",{staticClass:"el-picker-panel__footer"},[n("el-button",{staticClass:"el-picker-panel__link-btn",attrs:{size:"mini",type:"text"},on:{click:t.handleClear}},[t._v("\n "+t._s(t.t("el.datepicker.clear"))+"\n ")]),n("el-button",{staticClass:"el-picker-panel__link-btn",attrs:{plain:"",size:"mini",disabled:t.btnDisabled},on:{click:function(e){t.handleConfirm(!1)}}},[t._v("\n "+t._s(t.t("el.datepicker.confirm"))+"\n ")])],1):t._e()])])};Jr._withStripped=!0;var Zr=function(t){return Array.isArray(t)?[new Date(t[0]),new Date(t[1])]:t?[new Date(t),Object(dr.nextDate)(new Date(t),1)]:[new Date,Object(dr.nextDate)(new Date,1)]},Qr=i({mixins:[f.a],directives:{Clickoutside:N.a},computed:{btnDisabled:function(){return!(this.minDate&&this.maxDate&&!this.selecting&&this.isValidValue([this.minDate,this.maxDate]))},leftLabel:function(){return this.leftDate.getFullYear()+" "+this.t("el.datepicker.year")+" "+this.t("el.datepicker.month"+(this.leftDate.getMonth()+1))},rightLabel:function(){return this.rightDate.getFullYear()+" "+this.t("el.datepicker.year")+" "+this.t("el.datepicker.month"+(this.rightDate.getMonth()+1))},leftYear:function(){return this.leftDate.getFullYear()},leftMonth:function(){return this.leftDate.getMonth()},leftMonthDate:function(){return this.leftDate.getDate()},rightYear:function(){return this.rightDate.getFullYear()},rightMonth:function(){return this.rightDate.getMonth()},rightMonthDate:function(){return this.rightDate.getDate()},minVisibleDate:function(){return null!==this.dateUserInput.min?this.dateUserInput.min:this.minDate?Object(dr.formatDate)(this.minDate,this.dateFormat):""},maxVisibleDate:function(){return null!==this.dateUserInput.max?this.dateUserInput.max:this.maxDate||this.minDate?Object(dr.formatDate)(this.maxDate||this.minDate,this.dateFormat):""},minVisibleTime:function(){return null!==this.timeUserInput.min?this.timeUserInput.min:this.minDate?Object(dr.formatDate)(this.minDate,this.timeFormat):""},maxVisibleTime:function(){return null!==this.timeUserInput.max?this.timeUserInput.max:this.maxDate||this.minDate?Object(dr.formatDate)(this.maxDate||this.minDate,this.timeFormat):""},timeFormat:function(){return this.format?Object(dr.extractTimeFormat)(this.format):"HH:mm:ss"},dateFormat:function(){return this.format?Object(dr.extractDateFormat)(this.format):"yyyy-MM-dd"},enableMonthArrow:function(){var t=(this.leftMonth+1)%12,e=this.leftMonth+1>=12?1:0;return this.unlinkPanels&&new Date(this.leftYear+e,t)<new Date(this.rightYear,this.rightMonth)},enableYearArrow:function(){return this.unlinkPanels&&12*this.rightYear+this.rightMonth-(12*this.leftYear+this.leftMonth+1)>=12}},data:function(){return{popperClass:"",value:[],defaultValue:null,defaultTime:null,minDate:"",maxDate:"",leftDate:new Date,rightDate:Object(dr.nextMonth)(new Date),rangeState:{endDate:null,selecting:!1,row:null,column:null},showTime:!1,shortcuts:"",visible:"",disabledDate:"",cellClassName:"",firstDayOfWeek:7,minTimePickerVisible:!1,maxTimePickerVisible:!1,format:"",arrowControl:!1,unlinkPanels:!1,dateUserInput:{min:null,max:null},timeUserInput:{min:null,max:null}}},watch:{minDate:function(t){var e=this;this.dateUserInput.min=null,this.timeUserInput.min=null,this.$nextTick(function(){if(e.$refs.maxTimePicker&&e.maxDate&&e.maxDate<e.minDate){e.$refs.maxTimePicker.selectableRange=[[Object(dr.parseDate)(Object(dr.formatDate)(e.minDate,"HH:mm:ss"),"HH:mm:ss"),Object(dr.parseDate)("23:59:59","HH:mm:ss")]]}}),t&&this.$refs.minTimePicker&&(this.$refs.minTimePicker.date=t,this.$refs.minTimePicker.value=t)},maxDate:function(t){this.dateUserInput.max=null,this.timeUserInput.max=null,t&&this.$refs.maxTimePicker&&(this.$refs.maxTimePicker.date=t,this.$refs.maxTimePicker.value=t)},minTimePickerVisible:function(t){var e=this;t&&this.$nextTick(function(){e.$refs.minTimePicker.date=e.minDate,e.$refs.minTimePicker.value=e.minDate,e.$refs.minTimePicker.adjustSpinners()})},maxTimePickerVisible:function(t){var e=this;t&&this.$nextTick(function(){e.$refs.maxTimePicker.date=e.maxDate,e.$refs.maxTimePicker.value=e.maxDate,e.$refs.maxTimePicker.adjustSpinners()})},value:function(t){if(t){if(Array.isArray(t))if(this.minDate=Object(dr.isDate)(t[0])?new Date(t[0]):null,this.maxDate=Object(dr.isDate)(t[1])?new Date(t[1]):null,this.minDate)if(this.leftDate=this.minDate,this.unlinkPanels&&this.maxDate){var e=this.minDate.getFullYear(),n=this.minDate.getMonth(),r=this.maxDate.getFullYear(),i=this.maxDate.getMonth();this.rightDate=e===r&&n===i?Object(dr.nextMonth)(this.maxDate):this.maxDate}else this.rightDate=Object(dr.nextMonth)(this.leftDate);else this.leftDate=Zr(this.defaultValue)[0],this.rightDate=Object(dr.nextMonth)(this.leftDate)}else this.minDate=null,this.maxDate=null},defaultValue:function(t){if(!Array.isArray(this.value)){var e=Zr(t),n=e[0],r=e[1];this.leftDate=n,this.rightDate=t&&t[1]&&this.unlinkPanels?r:Object(dr.nextMonth)(this.leftDate)}}},methods:{handleClear:function(){this.minDate=null,this.maxDate=null,this.leftDate=Zr(this.defaultValue)[0],this.rightDate=Object(dr.nextMonth)(this.leftDate),this.$emit("pick",null)},handleChangeRange:function(t){this.minDate=t.minDate,this.maxDate=t.maxDate,this.rangeState=t.rangeState},handleDateInput:function(t,e){if(this.dateUserInput[e]=t,t.length===this.dateFormat.length){var n=Object(dr.parseDate)(t,this.dateFormat);if(n){if("function"==typeof this.disabledDate&&this.disabledDate(new Date(n)))return;"min"===e?(this.minDate=Object(dr.modifyDate)(this.minDate||new Date,n.getFullYear(),n.getMonth(),n.getDate()),this.leftDate=new Date(n),this.unlinkPanels||(this.rightDate=Object(dr.nextMonth)(this.leftDate))):(this.maxDate=Object(dr.modifyDate)(this.maxDate||new Date,n.getFullYear(),n.getMonth(),n.getDate()),this.rightDate=new Date(n),this.unlinkPanels||(this.leftDate=Object(dr.prevMonth)(n)))}}},handleDateChange:function(t,e){var n=Object(dr.parseDate)(t,this.dateFormat);n&&("min"===e?(this.minDate=Object(dr.modifyDate)(this.minDate,n.getFullYear(),n.getMonth(),n.getDate()),this.minDate>this.maxDate&&(this.maxDate=this.minDate)):(this.maxDate=Object(dr.modifyDate)(this.maxDate,n.getFullYear(),n.getMonth(),n.getDate()),this.maxDate<this.minDate&&(this.minDate=this.maxDate)))},handleTimeInput:function(t,e){var n=this;if(this.timeUserInput[e]=t,t.length===this.timeFormat.length){var r=Object(dr.parseDate)(t,this.timeFormat);r&&("min"===e?(this.minDate=Object(dr.modifyTime)(this.minDate,r.getHours(),r.getMinutes(),r.getSeconds()),this.$nextTick(function(t){return n.$refs.minTimePicker.adjustSpinners()})):(this.maxDate=Object(dr.modifyTime)(this.maxDate,r.getHours(),r.getMinutes(),r.getSeconds()),this.$nextTick(function(t){return n.$refs.maxTimePicker.adjustSpinners()})))}},handleTimeChange:function(t,e){var n=Object(dr.parseDate)(t,this.timeFormat);n&&("min"===e?(this.minDate=Object(dr.modifyTime)(this.minDate,n.getHours(),n.getMinutes(),n.getSeconds()),this.minDate>this.maxDate&&(this.maxDate=this.minDate),this.$refs.minTimePicker.value=this.minDate,this.minTimePickerVisible=!1):(this.maxDate=Object(dr.modifyTime)(this.maxDate,n.getHours(),n.getMinutes(),n.getSeconds()),this.maxDate<this.minDate&&(this.minDate=this.maxDate),this.$refs.maxTimePicker.value=this.minDate,this.maxTimePickerVisible=!1))},handleRangePick:function(t){var e=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=this.defaultTime||[],i=Object(dr.modifyWithTimeString)(t.minDate,r[0]),o=Object(dr.modifyWithTimeString)(t.maxDate,r[1]);this.maxDate===o&&this.minDate===i||(this.onPick&&this.onPick(t),this.maxDate=o,this.minDate=i,setTimeout(function(){e.maxDate=o,e.minDate=i},10),n&&!this.showTime&&this.handleConfirm())},handleShortcutClick:function(t){t.onClick&&t.onClick(this)},handleMinTimePick:function(t,e,n){this.minDate=this.minDate||new Date,t&&(this.minDate=Object(dr.modifyTime)(this.minDate,t.getHours(),t.getMinutes(),t.getSeconds())),n||(this.minTimePickerVisible=e),(!this.maxDate||this.maxDate&&this.maxDate.getTime()<this.minDate.getTime())&&(this.maxDate=new Date(this.minDate))},handleMinTimeClose:function(){this.minTimePickerVisible=!1},handleMaxTimePick:function(t,e,n){this.maxDate&&t&&(this.maxDate=Object(dr.modifyTime)(this.maxDate,t.getHours(),t.getMinutes(),t.getSeconds())),n||(this.maxTimePickerVisible=e),this.maxDate&&this.minDate&&this.minDate.getTime()>this.maxDate.getTime()&&(this.minDate=new Date(this.maxDate))},handleMaxTimeClose:function(){this.maxTimePickerVisible=!1},leftPrevYear:function(){this.leftDate=Object(dr.prevYear)(this.leftDate),this.unlinkPanels||(this.rightDate=Object(dr.nextMonth)(this.leftDate))},leftPrevMonth:function(){this.leftDate=Object(dr.prevMonth)(this.leftDate),this.unlinkPanels||(this.rightDate=Object(dr.nextMonth)(this.leftDate))},rightNextYear:function(){this.unlinkPanels?this.rightDate=Object(dr.nextYear)(this.rightDate):(this.leftDate=Object(dr.nextYear)(this.leftDate),this.rightDate=Object(dr.nextMonth)(this.leftDate))},rightNextMonth:function(){this.unlinkPanels?this.rightDate=Object(dr.nextMonth)(this.rightDate):(this.leftDate=Object(dr.nextMonth)(this.leftDate),this.rightDate=Object(dr.nextMonth)(this.leftDate))},leftNextYear:function(){this.leftDate=Object(dr.nextYear)(this.leftDate)},leftNextMonth:function(){this.leftDate=Object(dr.nextMonth)(this.leftDate)},rightPrevYear:function(){this.rightDate=Object(dr.prevYear)(this.rightDate)},rightPrevMonth:function(){this.rightDate=Object(dr.prevMonth)(this.rightDate)},handleConfirm:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.isValidValue([this.minDate,this.maxDate])&&this.$emit("pick",[this.minDate,this.maxDate],t)},isValidValue:function(t){return Array.isArray(t)&&t&&t[0]&&t[1]&&Object(dr.isDate)(t[0])&&Object(dr.isDate)(t[1])&&t[0].getTime()<=t[1].getTime()&&("function"!=typeof this.disabledDate||!this.disabledDate(t[0])&&!this.disabledDate(t[1]))},resetView:function(){this.minDate&&null==this.maxDate&&(this.rangeState.selecting=!1),this.minDate=this.value&&Object(dr.isDate)(this.value[0])?new Date(this.value[0]):null,this.maxDate=this.value&&Object(dr.isDate)(this.value[0])?new Date(this.value[1]):null}},components:{TimePicker:Lr,DateTable:Kr,ElInput:d.a,ElButton:z.a}},Jr,[],!1,null,null,null);Qr.options.__file="packages/date-picker/src/panel/date-range.vue";var ti=Qr.exports,ei=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("transition",{attrs:{name:"el-zoom-in-top"},on:{"after-leave":function(e){t.$emit("dodestroy")}}},[n("div",{directives:[{name:"show",rawName:"v-show",value:t.visible,expression:"visible"}],staticClass:"el-picker-panel el-date-range-picker el-popper",class:[{"has-sidebar":t.$slots.sidebar||t.shortcuts},t.popperClass]},[n("div",{staticClass:"el-picker-panel__body-wrapper"},[t._t("sidebar"),t.shortcuts?n("div",{staticClass:"el-picker-panel__sidebar"},t._l(t.shortcuts,function(e,r){return n("button",{key:r,staticClass:"el-picker-panel__shortcut",attrs:{type:"button"},on:{click:function(n){t.handleShortcutClick(e)}}},[t._v(t._s(e.text))])}),0):t._e(),n("div",{staticClass:"el-picker-panel__body"},[n("div",{staticClass:"el-picker-panel__content el-date-range-picker__content is-left"},[n("div",{staticClass:"el-date-range-picker__header"},[n("button",{staticClass:"el-picker-panel__icon-btn el-icon-d-arrow-left",attrs:{type:"button"},on:{click:t.leftPrevYear}}),t.unlinkPanels?n("button",{staticClass:"el-picker-panel__icon-btn el-icon-d-arrow-right",class:{"is-disabled":!t.enableYearArrow},attrs:{type:"button",disabled:!t.enableYearArrow},on:{click:t.leftNextYear}}):t._e(),n("div",[t._v(t._s(t.leftLabel))])]),n("month-table",{attrs:{"selection-mode":"range",date:t.leftDate,"default-value":t.defaultValue,"min-date":t.minDate,"max-date":t.maxDate,"range-state":t.rangeState,"disabled-date":t.disabledDate},on:{changerange:t.handleChangeRange,pick:t.handleRangePick}})],1),n("div",{staticClass:"el-picker-panel__content el-date-range-picker__content is-right"},[n("div",{staticClass:"el-date-range-picker__header"},[t.unlinkPanels?n("button",{staticClass:"el-picker-panel__icon-btn el-icon-d-arrow-left",class:{"is-disabled":!t.enableYearArrow},attrs:{type:"button",disabled:!t.enableYearArrow},on:{click:t.rightPrevYear}}):t._e(),n("button",{staticClass:"el-picker-panel__icon-btn el-icon-d-arrow-right",attrs:{type:"button"},on:{click:t.rightNextYear}}),n("div",[t._v(t._s(t.rightLabel))])]),n("month-table",{attrs:{"selection-mode":"range",date:t.rightDate,"default-value":t.defaultValue,"min-date":t.minDate,"max-date":t.maxDate,"range-state":t.rangeState,"disabled-date":t.disabledDate},on:{changerange:t.handleChangeRange,pick:t.handleRangePick}})],1)])],2)])])};ei._withStripped=!0;var ni=function(t){return Array.isArray(t)?[new Date(t[0]),new Date(t[1])]:t?[new Date(t),Object(dr.nextMonth)(new Date(t))]:[new Date,Object(dr.nextMonth)(new Date)]},ri=i({mixins:[f.a],directives:{Clickoutside:N.a},computed:{btnDisabled:function(){return!(this.minDate&&this.maxDate&&!this.selecting&&this.isValidValue([this.minDate,this.maxDate]))},leftLabel:function(){return this.leftDate.getFullYear()+" "+this.t("el.datepicker.year")},rightLabel:function(){return this.rightDate.getFullYear()+" "+this.t("el.datepicker.year")},leftYear:function(){return this.leftDate.getFullYear()},rightYear:function(){return this.rightDate.getFullYear()===this.leftDate.getFullYear()?this.leftDate.getFullYear()+1:this.rightDate.getFullYear()},enableYearArrow:function(){return this.unlinkPanels&&this.rightYear>this.leftYear+1}},data:function(){return{popperClass:"",value:[],defaultValue:null,defaultTime:null,minDate:"",maxDate:"",leftDate:new Date,rightDate:Object(dr.nextYear)(new Date),rangeState:{endDate:null,selecting:!1,row:null,column:null},shortcuts:"",visible:"",disabledDate:"",format:"",arrowControl:!1,unlinkPanels:!1}},watch:{value:function(t){if(t){if(Array.isArray(t))if(this.minDate=Object(dr.isDate)(t[0])?new Date(t[0]):null,this.maxDate=Object(dr.isDate)(t[1])?new Date(t[1]):null,this.minDate)if(this.leftDate=this.minDate,this.unlinkPanels&&this.maxDate){var e=this.minDate.getFullYear(),n=this.maxDate.getFullYear();this.rightDate=e===n?Object(dr.nextYear)(this.maxDate):this.maxDate}else this.rightDate=Object(dr.nextYear)(this.leftDate);else this.leftDate=ni(this.defaultValue)[0],this.rightDate=Object(dr.nextYear)(this.leftDate)}else this.minDate=null,this.maxDate=null},defaultValue:function(t){if(!Array.isArray(this.value)){var e=ni(t),n=e[0],r=e[1];this.leftDate=n,this.rightDate=t&&t[1]&&n.getFullYear()!==r.getFullYear()&&this.unlinkPanels?r:Object(dr.nextYear)(this.leftDate)}}},methods:{handleClear:function(){this.minDate=null,this.maxDate=null,this.leftDate=ni(this.defaultValue)[0],this.rightDate=Object(dr.nextYear)(this.leftDate),this.$emit("pick",null)},handleChangeRange:function(t){this.minDate=t.minDate,this.maxDate=t.maxDate,this.rangeState=t.rangeState},handleRangePick:function(t){var e=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=this.defaultTime||[],i=Object(dr.modifyWithTimeString)(t.minDate,r[0]),o=Object(dr.modifyWithTimeString)(t.maxDate,r[1]);this.maxDate===o&&this.minDate===i||(this.onPick&&this.onPick(t),this.maxDate=o,this.minDate=i,setTimeout(function(){e.maxDate=o,e.minDate=i},10),n&&this.handleConfirm())},handleShortcutClick:function(t){t.onClick&&t.onClick(this)},leftPrevYear:function(){this.leftDate=Object(dr.prevYear)(this.leftDate),this.unlinkPanels||(this.rightDate=Object(dr.prevYear)(this.rightDate))},rightNextYear:function(){this.unlinkPanels||(this.leftDate=Object(dr.nextYear)(this.leftDate)),this.rightDate=Object(dr.nextYear)(this.rightDate)},leftNextYear:function(){this.leftDate=Object(dr.nextYear)(this.leftDate)},rightPrevYear:function(){this.rightDate=Object(dr.prevYear)(this.rightDate)},handleConfirm:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.isValidValue([this.minDate,this.maxDate])&&this.$emit("pick",[this.minDate,this.maxDate],t)},isValidValue:function(t){return Array.isArray(t)&&t&&t[0]&&t[1]&&Object(dr.isDate)(t[0])&&Object(dr.isDate)(t[1])&&t[0].getTime()<=t[1].getTime()&&("function"!=typeof this.disabledDate||!this.disabledDate(t[0])&&!this.disabledDate(t[1]))},resetView:function(){this.minDate=this.value&&Object(dr.isDate)(this.value[0])?new Date(this.value[0]):null,this.maxDate=this.value&&Object(dr.isDate)(this.value[0])?new Date(this.value[1]):null}},components:{MonthTable:Hr,ElInput:d.a,ElButton:z.a}},ei,[],!1,null,null,null);ri.options.__file="packages/date-picker/src/panel/month-range.vue";var ii=ri.exports,oi=function(t){return"daterange"===t||"datetimerange"===t?ti:"monthrange"===t?ii:qr},si={mixins:[Or],name:"ElDatePicker",props:{type:{type:String,default:"date"},timeArrowControl:Boolean},watch:{type:function(t){this.picker?(this.unmountPicker(),this.panel=oi(t),this.mountPicker()):this.panel=oi(t)}},created:function(){this.panel=oi(this.type)},install:function(t){t.component(si.name,si)}},ai=si,li=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("transition",{attrs:{name:"el-zoom-in-top"},on:{"before-enter":t.handleMenuEnter,"after-leave":function(e){t.$emit("dodestroy")}}},[n("div",{directives:[{name:"show",rawName:"v-show",value:t.visible,expression:"visible"}],ref:"popper",staticClass:"el-picker-panel time-select el-popper",class:t.popperClass,style:{width:t.width+"px"}},[n("el-scrollbar",{attrs:{noresize:"","wrap-class":"el-picker-panel__content"}},t._l(t.items,function(e){return n("div",{key:e.value,staticClass:"time-select-item",class:{selected:t.value===e.value,disabled:e.disabled,default:e.value===t.defaultValue},attrs:{disabled:e.disabled},on:{click:function(n){t.handleClick(e)}}},[t._v(t._s(e.value))])}),0)],1)])};li._withStripped=!0;var ui=function(t){var e=(t||"").split(":");return e.length>=2?{hours:parseInt(e[0],10),minutes:parseInt(e[1],10)}:null},ci=function(t,e){var n=ui(t),r=ui(e),i=n.minutes+60*n.hours,o=r.minutes+60*r.hours;return i===o?0:i>o?1:-1},hi=function(t,e){var n=ui(t),r=ui(e),i={hours:n.hours,minutes:n.minutes};return i.minutes+=r.minutes,i.hours+=r.hours,i.hours+=Math.floor(i.minutes/60),i.minutes=i.minutes%60,function(t){return(t.hours<10?"0"+t.hours:t.hours)+":"+(t.minutes<10?"0"+t.minutes:t.minutes)}(i)},di=i({components:{ElScrollbar:F.a},watch:{value:function(t){var e=this;t&&this.$nextTick(function(){return e.scrollToOption()})}},methods:{handleClick:function(t){t.disabled||this.$emit("pick",t.value)},handleClear:function(){this.$emit("pick",null)},scrollToOption:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:".selected",e=this.$refs.popper.querySelector(".el-picker-panel__content");Be()(e,e.querySelector(t))},handleMenuEnter:function(){var t=this,e=-1!==this.items.map(function(t){return t.value}).indexOf(this.value),n=-1!==this.items.map(function(t){return t.value}).indexOf(this.defaultValue),r=(e?".selected":n&&".default")||".time-select-item:not(.disabled)";this.$nextTick(function(){return t.scrollToOption(r)})},scrollDown:function(t){for(var e=this.items,n=e.length,r=e.length,i=e.map(function(t){return t.value}).indexOf(this.value);r--;)if(!e[i=(i+t+n)%n].disabled)return void this.$emit("pick",e[i].value,!0)},isValidValue:function(t){return-1!==this.items.filter(function(t){return!t.disabled}).map(function(t){return t.value}).indexOf(t)},handleKeydown:function(t){var e=t.keyCode;if(38===e||40===e){var n={40:1,38:-1}[e.toString()];return this.scrollDown(n),void t.stopPropagation()}}},data:function(){return{popperClass:"",start:"09:00",end:"18:00",step:"00:30",value:"",defaultValue:"",visible:!1,minTime:"",maxTime:"",width:0}},computed:{items:function(){var t=this.start,e=this.end,n=this.step,r=[];if(t&&e&&n)for(var i=t;ci(i,e)<=0;)r.push({value:i,disabled:ci(i,this.minTime||"-1:-1")<=0||ci(i,this.maxTime||"100:100")>=0}),i=hi(i,n);return r}}},li,[],!1,null,null,null);di.options.__file="packages/date-picker/src/panel/time-select.vue";var pi=di.exports,fi={mixins:[Or],name:"ElTimeSelect",componentName:"ElTimeSelect",props:{type:{type:String,default:"time-select"}},beforeCreate:function(){this.panel=pi},install:function(t){t.component(fi.name,fi)}},gi=fi,mi=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("transition",{attrs:{name:"el-zoom-in-top"},on:{"after-leave":function(e){t.$emit("dodestroy")}}},[n("div",{directives:[{name:"show",rawName:"v-show",value:t.visible,expression:"visible"}],staticClass:"el-time-range-picker el-picker-panel el-popper",class:t.popperClass},[n("div",{staticClass:"el-time-range-picker__content"},[n("div",{staticClass:"el-time-range-picker__cell"},[n("div",{staticClass:"el-time-range-picker__header"},[t._v(t._s(t.t("el.datepicker.startTime")))]),n("div",{staticClass:"el-time-range-picker__body el-time-panel__content",class:{"has-seconds":t.showSeconds,"is-arrow":t.arrowControl}},[n("time-spinner",{ref:"minSpinner",attrs:{"show-seconds":t.showSeconds,"am-pm-mode":t.amPmMode,"arrow-control":t.arrowControl,date:t.minDate},on:{change:t.handleMinChange,"select-range":t.setMinSelectionRange}})],1)]),n("div",{staticClass:"el-time-range-picker__cell"},[n("div",{staticClass:"el-time-range-picker__header"},[t._v(t._s(t.t("el.datepicker.endTime")))]),n("div",{staticClass:"el-time-range-picker__body el-time-panel__content",class:{"has-seconds":t.showSeconds,"is-arrow":t.arrowControl}},[n("time-spinner",{ref:"maxSpinner",attrs:{"show-seconds":t.showSeconds,"am-pm-mode":t.amPmMode,"arrow-control":t.arrowControl,date:t.maxDate},on:{change:t.handleMaxChange,"select-range":t.setMaxSelectionRange}})],1)])]),n("div",{staticClass:"el-time-panel__footer"},[n("button",{staticClass:"el-time-panel__btn cancel",attrs:{type:"button"},on:{click:function(e){t.handleCancel()}}},[t._v(t._s(t.t("el.datepicker.cancel")))]),n("button",{staticClass:"el-time-panel__btn confirm",attrs:{type:"button",disabled:t.btnDisabled},on:{click:function(e){t.handleConfirm()}}},[t._v(t._s(t.t("el.datepicker.confirm")))])])])])};mi._withStripped=!0;var vi=Object(dr.parseDate)("00:00:00","HH:mm:ss"),bi=Object(dr.parseDate)("23:59:59","HH:mm:ss"),_i=function(t){return Object(dr.modifyDate)(bi,t.getFullYear(),t.getMonth(),t.getDate())},yi=function(t,e){return new Date(Math.min(t.getTime()+e,_i(t).getTime()))},Ti=i({mixins:[f.a],components:{TimeSpinner:Dr},computed:{showSeconds:function(){return-1!==(this.format||"").indexOf("ss")},offset:function(){return this.showSeconds?11:8},spinner:function(){return this.selectionRange[0]<this.offset?this.$refs.minSpinner:this.$refs.maxSpinner},btnDisabled:function(){return this.minDate.getTime()>this.maxDate.getTime()},amPmMode:function(){return-1!==(this.format||"").indexOf("A")?"A":-1!==(this.format||"").indexOf("a")?"a":""}},data:function(){return{popperClass:"",minDate:new Date,maxDate:new Date,value:[],oldValue:[new Date,new Date],defaultValue:null,format:"HH:mm:ss",visible:!1,selectionRange:[0,2],arrowControl:!1}},watch:{value:function(t){Array.isArray(t)?(this.minDate=new Date(t[0]),this.maxDate=new Date(t[1])):Array.isArray(this.defaultValue)?(this.minDate=new Date(this.defaultValue[0]),this.maxDate=new Date(this.defaultValue[1])):this.defaultValue?(this.minDate=new Date(this.defaultValue),this.maxDate=yi(new Date(this.defaultValue),36e5)):(this.minDate=new Date,this.maxDate=yi(new Date,36e5))},visible:function(t){var e=this;t&&(this.oldValue=this.value,this.$nextTick(function(){return e.$refs.minSpinner.emitSelectRange("hours")}))}},methods:{handleClear:function(){this.$emit("pick",null)},handleCancel:function(){this.$emit("pick",this.oldValue)},handleMinChange:function(t){this.minDate=Object(dr.clearMilliseconds)(t),this.handleChange()},handleMaxChange:function(t){this.maxDate=Object(dr.clearMilliseconds)(t),this.handleChange()},handleChange:function(){var t;this.isValidValue([this.minDate,this.maxDate])&&(this.$refs.minSpinner.selectableRange=[[(t=this.minDate,Object(dr.modifyDate)(vi,t.getFullYear(),t.getMonth(),t.getDate())),this.maxDate]],this.$refs.maxSpinner.selectableRange=[[this.minDate,_i(this.maxDate)]],this.$emit("pick",[this.minDate,this.maxDate],!0))},setMinSelectionRange:function(t,e){this.$emit("select-range",t,e,"min"),this.selectionRange=[t,e]},setMaxSelectionRange:function(t,e){this.$emit("select-range",t,e,"max"),this.selectionRange=[t+this.offset,e+this.offset]},handleConfirm:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.$refs.minSpinner.selectableRange,n=this.$refs.maxSpinner.selectableRange;this.minDate=Object(dr.limitTimeRange)(this.minDate,e,this.format),this.maxDate=Object(dr.limitTimeRange)(this.maxDate,n,this.format),this.$emit("pick",[this.minDate,this.maxDate],t)},adjustSpinners:function(){this.$refs.minSpinner.adjustSpinners(),this.$refs.maxSpinner.adjustSpinners()},changeSelectionRange:function(t){var e=this.showSeconds?[0,3,6,11,14,17]:[0,3,8,11],n=["hours","minutes"].concat(this.showSeconds?["seconds"]:[]),r=(e.indexOf(this.selectionRange[0])+t+e.length)%e.length,i=e.length/2;r<i?this.$refs.minSpinner.emitSelectRange(n[r]):this.$refs.maxSpinner.emitSelectRange(n[r-i])},isValidValue:function(t){return Array.isArray(t)&&Object(dr.timeWithinRange)(this.minDate,this.$refs.minSpinner.selectableRange)&&Object(dr.timeWithinRange)(this.maxDate,this.$refs.maxSpinner.selectableRange)},handleKeydown:function(t){var e=t.keyCode,n={38:-1,40:1,37:-1,39:1};if(37===e||39===e){var r=n[e];return this.changeSelectionRange(r),void t.preventDefault()}if(38===e||40===e){var i=n[e];return this.spinner.scrollDown(i),void t.preventDefault()}}}},mi,[],!1,null,null,null);Ti.options.__file="packages/date-picker/src/panel/time-range.vue";var xi=Ti.exports,Ei={mixins:[Or],name:"ElTimePicker",props:{isRange:Boolean,arrowControl:Boolean},data:function(){return{type:""}},watch:{isRange:function(t){this.picker?(this.unmountPicker(),this.type=t?"timerange":"time",this.panel=t?xi:Lr,this.mountPicker()):(this.type=t?"timerange":"time",this.panel=t?xi:Lr)}},created:function(){this.type=this.isRange?"timerange":"time",this.panel=this.isRange?xi:Lr},install:function(t){t.component(Ei.name,Ei)}},wi=Ei,Ci=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("span",[n("transition",{attrs:{name:t.transition},on:{"after-enter":t.handleAfterEnter,"after-leave":t.handleAfterLeave}},[n("div",{directives:[{name:"show",rawName:"v-show",value:!t.disabled&&t.showPopper,expression:"!disabled && showPopper"}],ref:"popper",staticClass:"el-popover el-popper",class:[t.popperClass,t.content&&"el-popover--plain"],style:{width:t.width+"px"},attrs:{role:"tooltip",id:t.tooltipId,"aria-hidden":t.disabled||!t.showPopper?"true":"false"}},[t.title?n("div",{staticClass:"el-popover__title",domProps:{textContent:t._s(t.title)}}):t._e(),t._t("default",[t._v(t._s(t.content))])],2)]),n("span",{ref:"wrapper",staticClass:"el-popover__reference-wrapper"},[t._t("reference")],2)],1)};Ci._withStripped=!0;var Si=i({name:"ElPopover",mixins:[L.a],props:{trigger:{type:String,default:"click",validator:function(t){return["click","focus","hover","manual"].indexOf(t)>-1}},openDelay:{type:Number,default:0},closeDelay:{type:Number,default:200},title:String,disabled:Boolean,content:String,reference:{},popperClass:String,width:{},visibleArrow:{default:!0},arrowOffset:{type:Number,default:0},transition:{type:String,default:"fade-in-linear"},tabindex:{type:Number,default:0}},computed:{tooltipId:function(){return"el-popover-"+Object(g.generateId)()}},watch:{showPopper:function(t){this.disabled||(t?this.$emit("show"):this.$emit("hide"))}},mounted:function(){var t=this,e=this.referenceElm=this.reference||this.$refs.reference,n=this.popper||this.$refs.popper;!e&&this.$refs.wrapper.children&&(e=this.referenceElm=this.$refs.wrapper.children[0]),e&&(Object(ft.addClass)(e,"el-popover__reference"),e.setAttribute("aria-describedby",this.tooltipId),e.setAttribute("tabindex",this.tabindex),n.setAttribute("tabindex",0),"click"!==this.trigger&&(Object(ft.on)(e,"focusin",function(){t.handleFocus();var n=e.__vue__;n&&"function"==typeof n.focus&&n.focus()}),Object(ft.on)(n,"focusin",this.handleFocus),Object(ft.on)(e,"focusout",this.handleBlur),Object(ft.on)(n,"focusout",this.handleBlur)),Object(ft.on)(e,"keydown",this.handleKeydown),Object(ft.on)(e,"click",this.handleClick)),"click"===this.trigger?(Object(ft.on)(e,"click",this.doToggle),Object(ft.on)(document,"click",this.handleDocumentClick)):"hover"===this.trigger?(Object(ft.on)(e,"mouseenter",this.handleMouseEnter),Object(ft.on)(n,"mouseenter",this.handleMouseEnter),Object(ft.on)(e,"mouseleave",this.handleMouseLeave),Object(ft.on)(n,"mouseleave",this.handleMouseLeave)):"focus"===this.trigger&&(this.tabindex<0&&console.warn("[Element Warn][Popover]a negative taindex means that the element cannot be focused by tab key"),e.querySelector("input, textarea")?(Object(ft.on)(e,"focusin",this.doShow),Object(ft.on)(e,"focusout",this.doClose)):(Object(ft.on)(e,"mousedown",this.doShow),Object(ft.on)(e,"mouseup",this.doClose)))},beforeDestroy:function(){this.cleanup()},deactivated:function(){this.cleanup()},methods:{doToggle:function(){this.showPopper=!this.showPopper},doShow:function(){this.showPopper=!0},doClose:function(){this.showPopper=!1},handleFocus:function(){Object(ft.addClass)(this.referenceElm,"focusing"),"click"!==this.trigger&&"focus"!==this.trigger||(this.showPopper=!0)},handleClick:function(){Object(ft.removeClass)(this.referenceElm,"focusing")},handleBlur:function(){Object(ft.removeClass)(this.referenceElm,"focusing"),"click"!==this.trigger&&"focus"!==this.trigger||(this.showPopper=!1)},handleMouseEnter:function(){var t=this;clearTimeout(this._timer),this.openDelay?this._timer=setTimeout(function(){t.showPopper=!0},this.openDelay):this.showPopper=!0},handleKeydown:function(t){27===t.keyCode&&"manual"!==this.trigger&&this.doClose()},handleMouseLeave:function(){var t=this;clearTimeout(this._timer),this.closeDelay?this._timer=setTimeout(function(){t.showPopper=!1},this.closeDelay):this.showPopper=!1},handleDocumentClick:function(t){var e=this.reference||this.$refs.reference,n=this.popper||this.$refs.popper;!e&&this.$refs.wrapper.children&&(e=this.referenceElm=this.$refs.wrapper.children[0]),this.$el&&e&&!this.$el.contains(t.target)&&!e.contains(t.target)&&n&&!n.contains(t.target)&&(this.showPopper=!1)},handleAfterEnter:function(){this.$emit("after-enter")},handleAfterLeave:function(){this.$emit("after-leave"),this.doDestroy()},cleanup:function(){(this.openDelay||this.closeDelay)&&clearTimeout(this._timer)}},destroyed:function(){var t=this.reference;Object(ft.off)(t,"click",this.doToggle),Object(ft.off)(t,"mouseup",this.doClose),Object(ft.off)(t,"mousedown",this.doShow),Object(ft.off)(t,"focusin",this.doShow),Object(ft.off)(t,"focusout",this.doClose),Object(ft.off)(t,"mousedown",this.doShow),Object(ft.off)(t,"mouseup",this.doClose),Object(ft.off)(t,"mouseleave",this.handleMouseLeave),Object(ft.off)(t,"mouseenter",this.handleMouseEnter),Object(ft.off)(document,"click",this.handleDocumentClick)}},Ci,[],!1,null,null,null);Si.options.__file="packages/popover/src/main.vue";var ki=Si.exports,Oi=function(t,e,n){var r=e.expression?e.value:e.arg,i=n.context.$refs[r];i&&(Array.isArray(i)?i[0].$refs.reference=t:i.$refs.reference=t)},Ii={bind:function(t,e,n){Oi(t,e,n)},inserted:function(t,e,n){Oi(t,e,n)}};hn.a.directive("popover",Ii),ki.install=function(t){t.directive("popover",Ii),t.component(ki.name,ki)},ki.directive=Ii;var Ri=ki,Ai={name:"ElTooltip",mixins:[L.a],props:{openDelay:{type:Number,default:0},disabled:Boolean,manual:Boolean,effect:{type:String,default:"dark"},arrowOffset:{type:Number,default:0},popperClass:String,content:String,visibleArrow:{default:!0},transition:{type:String,default:"el-fade-in-linear"},popperOptions:{default:function(){return{boundariesPadding:10,gpuAcceleration:!1}}},enterable:{type:Boolean,default:!0},hideAfter:{type:Number,default:0},tabindex:{type:Number,default:0}},data:function(){return{tooltipId:"el-tooltip-"+Object(g.generateId)(),timeoutPending:null,focusing:!1}},beforeCreate:function(){var t=this;this.$isServer||(this.popperVM=new hn.a({data:{node:""},render:function(t){return this.node}}).$mount(),this.debounceClose=R()(200,function(){return t.handleClosePopper()}))},render:function(t){var e=this;this.popperVM&&(this.popperVM.node=t("transition",{attrs:{name:this.transition},on:{afterLeave:this.doDestroy}},[t("div",{on:{mouseleave:function(){e.setExpectedState(!1),e.debounceClose()},mouseenter:function(){e.setExpectedState(!0)}},ref:"popper",attrs:{role:"tooltip",id:this.tooltipId,"aria-hidden":this.disabled||!this.showPopper?"true":"false"},directives:[{name:"show",value:!this.disabled&&this.showPopper}],class:["el-tooltip__popper","is-"+this.effect,this.popperClass]},[this.$slots.content||this.content])]));var n=this.getFirstElement();if(!n)return null;var r=n.data=n.data||{};return r.staticClass=this.addTooltipClass(r.staticClass),n},mounted:function(){var t=this;this.referenceElm=this.$el,1===this.$el.nodeType&&(this.$el.setAttribute("aria-describedby",this.tooltipId),this.$el.setAttribute("tabindex",this.tabindex),Object(ft.on)(this.referenceElm,"mouseenter",this.show),Object(ft.on)(this.referenceElm,"mouseleave",this.hide),Object(ft.on)(this.referenceElm,"focus",function(){if(t.$slots.default&&t.$slots.default.length){var e=t.$slots.default[0].componentInstance;e&&e.focus?e.focus():t.handleFocus()}else t.handleFocus()}),Object(ft.on)(this.referenceElm,"blur",this.handleBlur),Object(ft.on)(this.referenceElm,"click",this.removeFocusing)),this.value&&this.popperVM&&this.popperVM.$nextTick(function(){t.value&&t.updatePopper()})},watch:{focusing:function(t){t?Object(ft.addClass)(this.referenceElm,"focusing"):Object(ft.removeClass)(this.referenceElm,"focusing")}},methods:{show:function(){this.setExpectedState(!0),this.handleShowPopper()},hide:function(){this.setExpectedState(!1),this.debounceClose()},handleFocus:function(){this.focusing=!0,this.show()},handleBlur:function(){this.focusing=!1,this.hide()},removeFocusing:function(){this.focusing=!1},addTooltipClass:function(t){return t?"el-tooltip "+t.replace("el-tooltip",""):"el-tooltip"},handleShowPopper:function(){var t=this;this.expectedState&&!this.manual&&(clearTimeout(this.timeout),this.timeout=setTimeout(function(){t.showPopper=!0},this.openDelay),this.hideAfter>0&&(this.timeoutPending=setTimeout(function(){t.showPopper=!1},this.hideAfter)))},handleClosePopper:function(){this.enterable&&this.expectedState||this.manual||(clearTimeout(this.timeout),this.timeoutPending&&clearTimeout(this.timeoutPending),this.showPopper=!1,this.disabled&&this.doDestroy())},setExpectedState:function(t){!1===t&&clearTimeout(this.timeoutPending),this.expectedState=t},getFirstElement:function(){var t=this.$slots.default;if(!Array.isArray(t))return null;for(var e=null,n=0;n<t.length;n++)t[n]&&t[n].tag&&(e=t[n]);return e}},beforeDestroy:function(){this.popperVM&&this.popperVM.$destroy()},destroyed:function(){var t=this.referenceElm;1===t.nodeType&&(Object(ft.off)(t,"mouseenter",this.show),Object(ft.off)(t,"mouseleave",this.hide),Object(ft.off)(t,"focus",this.handleFocus),Object(ft.off)(t,"blur",this.handleBlur),Object(ft.off)(t,"click",this.removeFocusing))},install:function(t){t.component(Ai.name,Ai)}},Ni=Ai,Di=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("transition",{attrs:{name:"msgbox-fade"}},[n("div",{directives:[{name:"show",rawName:"v-show",value:t.visible,expression:"visible"}],staticClass:"el-message-box__wrapper",attrs:{tabindex:"-1",role:"dialog","aria-modal":"true","aria-label":t.title||"dialog"},on:{click:function(e){return e.target!==e.currentTarget?null:t.handleWrapperClick(e)}}},[n("div",{staticClass:"el-message-box",class:[t.customClass,t.center&&"el-message-box--center"]},[null!==t.title?n("div",{staticClass:"el-message-box__header"},[n("div",{staticClass:"el-message-box__title"},[t.icon&&t.center?n("div",{class:["el-message-box__status",t.icon]}):t._e(),n("span",[t._v(t._s(t.title))])]),t.showClose?n("button",{staticClass:"el-message-box__headerbtn",attrs:{type:"button","aria-label":"Close"},on:{click:function(e){t.handleAction(t.distinguishCancelAndClose?"close":"cancel")},keydown:function(e){if(!("button"in e)&&t._k(e.keyCode,"enter",13,e.key,"Enter"))return null;t.handleAction(t.distinguishCancelAndClose?"close":"cancel")}}},[n("i",{staticClass:"el-message-box__close el-icon-close"})]):t._e()]):t._e(),n("div",{staticClass:"el-message-box__content"},[n("div",{staticClass:"el-message-box__container"},[t.icon&&!t.center&&""!==t.message?n("div",{class:["el-message-box__status",t.icon]}):t._e(),""!==t.message?n("div",{staticClass:"el-message-box__message"},[t._t("default",[t.dangerouslyUseHTMLString?n("p",{domProps:{innerHTML:t._s(t.message)}}):n("p",[t._v(t._s(t.message))])])],2):t._e()]),n("div",{directives:[{name:"show",rawName:"v-show",value:t.showInput,expression:"showInput"}],staticClass:"el-message-box__input"},[n("el-input",{ref:"input",attrs:{type:t.inputType,placeholder:t.inputPlaceholder},nativeOn:{keydown:function(e){return"button"in e||!t._k(e.keyCode,"enter",13,e.key,"Enter")?t.handleInputEnter(e):null}},model:{value:t.inputValue,callback:function(e){t.inputValue=e},expression:"inputValue"}}),n("div",{staticClass:"el-message-box__errormsg",style:{visibility:t.editorErrorMessage?"visible":"hidden"}},[t._v(t._s(t.editorErrorMessage))])],1)]),n("div",{staticClass:"el-message-box__btns"},[t.showCancelButton?n("el-button",{class:[t.cancelButtonClasses],attrs:{loading:t.cancelButtonLoading,round:t.roundButton,size:"small"},on:{keydown:function(e){if(!("button"in e)&&t._k(e.keyCode,"enter",13,e.key,"Enter"))return null;t.handleAction("cancel")}},nativeOn:{click:function(e){t.handleAction("cancel")}}},[t._v("\n "+t._s(t.cancelButtonText||t.t("el.messagebox.cancel"))+"\n ")]):t._e(),n("el-button",{directives:[{name:"show",rawName:"v-show",value:t.showConfirmButton,expression:"showConfirmButton"}],ref:"confirm",class:[t.confirmButtonClasses],attrs:{loading:t.confirmButtonLoading,round:t.roundButton,size:"small"},on:{keydown:function(e){if(!("button"in e)&&t._k(e.keyCode,"enter",13,e.key,"Enter"))return null;t.handleAction("confirm")}},nativeOn:{click:function(e){t.handleAction("confirm")}}},[t._v("\n "+t._s(t.confirmButtonText||t.t("el.messagebox.confirm"))+"\n ")])],1)])])])};Di._withStripped=!0;var Mi=n(12),Li=n.n(Mi),Pi=n(39),Fi=n.n(Pi),Bi=void 0,ji={success:"success",info:"info",warning:"warning",error:"error"},$i=i({mixins:[y.a,f.a],props:{modal:{default:!0},lockScroll:{default:!0},showClose:{type:Boolean,default:!0},closeOnClickModal:{default:!0},closeOnPressEscape:{default:!0},closeOnHashChange:{default:!0},center:{default:!1,type:Boolean},roundButton:{default:!1,type:Boolean}},components:{ElInput:d.a,ElButton:z.a},computed:{icon:function(){var t=this.type;return this.iconClass||(t&&ji[t]?"el-icon-"+ji[t]:"")},confirmButtonClasses:function(){return"el-button--primary "+this.confirmButtonClass},cancelButtonClasses:function(){return""+this.cancelButtonClass}},methods:{getSafeClose:function(){var t=this,e=this.uid;return function(){t.$nextTick(function(){e===t.uid&&t.doClose()})}},doClose:function(){var t=this;this.visible&&(this.visible=!1,this._closing=!0,this.onClose&&this.onClose(),Bi.closeDialog(),this.lockScroll&&setTimeout(this.restoreBodyStyle,200),this.opened=!1,this.doAfterClose(),setTimeout(function(){t.action&&t.callback(t.action,t)}))},handleWrapperClick:function(){this.closeOnClickModal&&this.handleAction(this.distinguishCancelAndClose?"close":"cancel")},handleInputEnter:function(){if("textarea"!==this.inputType)return this.handleAction("confirm")},handleAction:function(t){("prompt"!==this.$type||"confirm"!==t||this.validate())&&(this.action=t,"function"==typeof this.beforeClose?(this.close=this.getSafeClose(),this.beforeClose(t,this,this.close)):this.doClose())},validate:function(){if("prompt"===this.$type){var t=this.inputPattern;if(t&&!t.test(this.inputValue||""))return this.editorErrorMessage=this.inputErrorMessage||Object(Mi.t)("el.messagebox.error"),Object(ft.addClass)(this.getInputElement(),"invalid"),!1;var e=this.inputValidator;if("function"==typeof e){var n=e(this.inputValue);if(!1===n)return this.editorErrorMessage=this.inputErrorMessage||Object(Mi.t)("el.messagebox.error"),Object(ft.addClass)(this.getInputElement(),"invalid"),!1;if("string"==typeof n)return this.editorErrorMessage=n,Object(ft.addClass)(this.getInputElement(),"invalid"),!1}}return this.editorErrorMessage="",Object(ft.removeClass)(this.getInputElement(),"invalid"),!0},getFirstFocus:function(){var t=this.$el.querySelector(".el-message-box__btns .el-button"),e=this.$el.querySelector(".el-message-box__btns .el-message-box__title");return t||e},getInputElement:function(){var t=this.$refs.input.$refs;return t.input||t.textarea},handleClose:function(){this.handleAction("close")}},watch:{inputValue:{immediate:!0,handler:function(t){var e=this;this.$nextTick(function(n){"prompt"===e.$type&&null!==t&&e.validate()})}},visible:function(t){var e=this;t&&(this.uid++,"alert"!==this.$type&&"confirm"!==this.$type||this.$nextTick(function(){e.$refs.confirm.$el.focus()}),this.focusAfterClosed=document.activeElement,Bi=new Fi.a(this.$el,this.focusAfterClosed,this.getFirstFocus())),"prompt"===this.$type&&(t?setTimeout(function(){e.$refs.input&&e.$refs.input.$el&&e.getInputElement().focus()},500):(this.editorErrorMessage="",Object(ft.removeClass)(this.getInputElement(),"invalid")))}},mounted:function(){var t=this;this.$nextTick(function(){t.closeOnHashChange&&window.addEventListener("hashchange",t.close)})},beforeDestroy:function(){this.closeOnHashChange&&window.removeEventListener("hashchange",this.close),setTimeout(function(){Bi.closeDialog()})},data:function(){return{uid:1,title:void 0,message:"",type:"",iconClass:"",customClass:"",showInput:!1,inputValue:null,inputPlaceholder:"",inputType:"text",inputPattern:null,inputValidator:null,inputErrorMessage:"",showConfirmButton:!0,showCancelButton:!1,action:"",confirmButtonText:"",cancelButtonText:"",confirmButtonLoading:!1,cancelButtonLoading:!1,confirmButtonClass:"",confirmButtonDisabled:!1,cancelButtonClass:"",editorErrorMessage:null,callback:null,dangerouslyUseHTMLString:!1,focusAfterClosed:null,isOnComposition:!1,distinguishCancelAndClose:!1}}},Di,[],!1,null,null,null);$i.options.__file="packages/message-box/src/main.vue";var Ui=$i.exports,Vi=n(23),Hi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wi={title:null,message:"",type:"",iconClass:"",showInput:!1,showClose:!0,modalFade:!0,lockScroll:!0,closeOnClickModal:!0,closeOnPressEscape:!0,closeOnHashChange:!0,inputValue:null,inputPlaceholder:"",inputType:"text",inputPattern:null,inputValidator:null,inputErrorMessage:"",showConfirmButton:!0,showCancelButton:!1,confirmButtonPosition:"right",confirmButtonHighlight:!1,cancelButtonHighlight:!1,confirmButtonText:"",cancelButtonText:"",confirmButtonClass:"",cancelButtonClass:"",customClass:"",beforeClose:null,dangerouslyUseHTMLString:!1,center:!1,roundButton:!1,distinguishCancelAndClose:!1},Gi=hn.a.extend(Ui),zi=void 0,Xi=void 0,Ki=[],Yi=function(t){if(zi){var e=zi.callback;"function"==typeof e&&(Xi.showInput?e(Xi.inputValue,t):e(t)),zi.resolve&&("confirm"===t?Xi.showInput?zi.resolve({value:Xi.inputValue,action:t}):zi.resolve(t):!zi.reject||"cancel"!==t&&"close"!==t||zi.reject(t))}},qi=function t(){if(Xi||((Xi=new Gi({el:document.createElement("div")})).callback=Yi),Xi.action="",(!Xi.visible||Xi.closeTimer)&&Ki.length>0){var e=(zi=Ki.shift()).options;for(var n in e)e.hasOwnProperty(n)&&(Xi[n]=e[n]);void 0===e.callback&&(Xi.callback=Yi);var r=Xi.callback;Xi.callback=function(e,n){r(e,n),t()},Object(Vi.isVNode)(Xi.message)?(Xi.$slots.default=[Xi.message],Xi.message=null):delete Xi.$slots.default,["modal","showClose","closeOnClickModal","closeOnPressEscape","closeOnHashChange"].forEach(function(t){void 0===Xi[t]&&(Xi[t]=!0)}),document.body.appendChild(Xi.$el),hn.a.nextTick(function(){Xi.visible=!0})}},Ji=function t(e,n){if(!hn.a.prototype.$isServer){if("string"==typeof e||Object(Vi.isVNode)(e)?(e={message:e},"string"==typeof arguments[1]&&(e.title=arguments[1])):e.callback&&!n&&(n=e.callback),"undefined"!=typeof Promise)return new Promise(function(r,i){Ki.push({options:Ut()({},Wi,t.defaults,e),callback:n,resolve:r,reject:i}),qi()});Ki.push({options:Ut()({},Wi,t.defaults,e),callback:n}),qi()}};Ji.setDefaults=function(t){Ji.defaults=t},Ji.alert=function(t,e,n){return"object"===(void 0===e?"undefined":Hi(e))?(n=e,e=""):void 0===e&&(e=""),Ji(Ut()({title:e,message:t,$type:"alert",closeOnPressEscape:!1,closeOnClickModal:!1},n))},Ji.confirm=function(t,e,n){return"object"===(void 0===e?"undefined":Hi(e))?(n=e,e=""):void 0===e&&(e=""),Ji(Ut()({title:e,message:t,$type:"confirm",showCancelButton:!0},n))},Ji.prompt=function(t,e,n){return"object"===(void 0===e?"undefined":Hi(e))?(n=e,e=""):void 0===e&&(e=""),Ji(Ut()({title:e,message:t,showCancelButton:!0,showInput:!0,$type:"prompt"},n))},Ji.close=function(){Xi.doClose(),Xi.visible=!1,Ki=[],zi=null};var Zi=Ji,Qi=function(){var t=this.$createElement;return(this._self._c||t)("div",{staticClass:"el-breadcrumb",attrs:{"aria-label":"Breadcrumb",role:"navigation"}},[this._t("default")],2)};Qi._withStripped=!0;var to=i({name:"ElBreadcrumb",props:{separator:{type:String,default:"/"},separatorClass:{type:String,default:""}},provide:function(){return{elBreadcrumb:this}},mounted:function(){var t=this.$el.querySelectorAll(".el-breadcrumb__item");t.length&&t[t.length-1].setAttribute("aria-current","page")}},Qi,[],!1,null,null,null);to.options.__file="packages/breadcrumb/src/breadcrumb.vue";var eo=to.exports;eo.install=function(t){t.component(eo.name,eo)};var no=eo,ro=function(){var t=this.$createElement,e=this._self._c||t;return e("span",{staticClass:"el-breadcrumb__item"},[e("span",{ref:"link",class:["el-breadcrumb__inner",this.to?"is-link":""],attrs:{role:"link"}},[this._t("default")],2),this.separatorClass?e("i",{staticClass:"el-breadcrumb__separator",class:this.separatorClass}):e("span",{staticClass:"el-breadcrumb__separator",attrs:{role:"presentation"}},[this._v(this._s(this.separator))])])};ro._withStripped=!0;var io=i({name:"ElBreadcrumbItem",props:{to:{},replace:Boolean},data:function(){return{separator:"",separatorClass:""}},inject:["elBreadcrumb"],mounted:function(){var t=this;this.separator=this.elBreadcrumb.separator,this.separatorClass=this.elBreadcrumb.separatorClass;var e=this.$refs.link;e.setAttribute("role","link"),e.addEventListener("click",function(e){var n=t.to,r=t.$router;n&&r&&(t.replace?r.replace(n):r.push(n))})}},ro,[],!1,null,null,null);io.options.__file="packages/breadcrumb/src/breadcrumb-item.vue";var oo=io.exports;oo.install=function(t){t.component(oo.name,oo)};var so=oo,ao=function(){var t=this.$createElement;return(this._self._c||t)("form",{staticClass:"el-form",class:[this.labelPosition?"el-form--label-"+this.labelPosition:"",{"el-form--inline":this.inline}]},[this._t("default")],2)};ao._withStripped=!0;var lo=i({name:"ElForm",componentName:"ElForm",provide:function(){return{elForm:this}},props:{model:Object,rules:Object,labelPosition:String,labelWidth:String,labelSuffix:{type:String,default:""},inline:Boolean,inlineMessage:Boolean,statusIcon:Boolean,showMessage:{type:Boolean,default:!0},size:String,disabled:Boolean,validateOnRuleChange:{type:Boolean,default:!0},hideRequiredAsterisk:{type:Boolean,default:!1}},watch:{rules:function(){this.fields.forEach(function(t){t.removeValidateEvents(),t.addValidateEvents()}),this.validateOnRuleChange&&this.validate(function(){})}},computed:{autoLabelWidth:function(){if(!this.potentialLabelWidthArr.length)return 0;var t=Math.max.apply(Math,this.potentialLabelWidthArr);return t?t+"px":""}},data:function(){return{fields:[],potentialLabelWidthArr:[]}},created:function(){var t=this;this.$on("el.form.addField",function(e){e&&t.fields.push(e)}),this.$on("el.form.removeField",function(e){e.prop&&t.fields.splice(t.fields.indexOf(e),1)})},methods:{resetFields:function(){this.model?this.fields.forEach(function(t){t.resetField()}):console.warn("[Element Warn][Form]model is required for resetFields to work.")},clearValidate:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];(t.length?"string"==typeof t?this.fields.filter(function(e){return t===e.prop}):this.fields.filter(function(e){return t.indexOf(e.prop)>-1}):this.fields).forEach(function(t){t.clearValidate()})},validate:function(t){var e=this;if(this.model){var n=void 0;"function"!=typeof t&&window.Promise&&(n=new window.Promise(function(e,n){t=function(t){t?e(t):n(t)}}));var r=!0,i=0;0===this.fields.length&&t&&t(!0);var o={};return this.fields.forEach(function(n){n.validate("",function(n,s){n&&(r=!1),o=Ut()({},o,s),"function"==typeof t&&++i===e.fields.length&&t(r,o)})}),n||void 0}console.warn("[Element Warn][Form]model is required for validate to work!")},validateField:function(t,e){t=[].concat(t);var n=this.fields.filter(function(e){return-1!==t.indexOf(e.prop)});n.length?n.forEach(function(t){t.validate("",e)}):console.warn("[Element Warn]please pass correct props!")},getLabelWidthIndex:function(t){var e=this.potentialLabelWidthArr.indexOf(t);if(-1===e)throw new Error("[ElementForm]unpected width ",t);return e},registerLabelWidth:function(t,e){if(t&&e){var n=this.getLabelWidthIndex(e);this.potentialLabelWidthArr.splice(n,1,t)}else t&&this.potentialLabelWidthArr.push(t)},deregisterLabelWidth:function(t){var e=this.getLabelWidthIndex(t);this.potentialLabelWidthArr.splice(e,1)}}},ao,[],!1,null,null,null);lo.options.__file="packages/form/src/form.vue";var uo=lo.exports;uo.install=function(t){t.component(uo.name,uo)};var co=uo,ho=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"el-form-item",class:[{"el-form-item--feedback":t.elForm&&t.elForm.statusIcon,"is-error":"error"===t.validateState,"is-validating":"validating"===t.validateState,"is-success":"success"===t.validateState,"is-required":t.isRequired||t.required,"is-no-asterisk":t.elForm&&t.elForm.hideRequiredAsterisk},t.sizeClass?"el-form-item--"+t.sizeClass:""]},[n("label-wrap",{attrs:{"is-auto-width":t.labelStyle&&"auto"===t.labelStyle.width,"update-all":"auto"===t.form.labelWidth}},[t.label||t.$slots.label?n("label",{staticClass:"el-form-item__label",style:t.labelStyle,attrs:{for:t.labelFor}},[t._t("label",[t._v(t._s(t.label+t.form.labelSuffix))])],2):t._e()]),n("div",{staticClass:"el-form-item__content",style:t.contentStyle},[t._t("default"),n("transition",{attrs:{name:"el-zoom-in-top"}},["error"===t.validateState&&t.showMessage&&t.form.showMessage?t._t("error",[n("div",{staticClass:"el-form-item__error",class:{"el-form-item__error--inline":"boolean"==typeof t.inlineMessage?t.inlineMessage:t.elForm&&t.elForm.inlineMessage||!1}},[t._v("\n "+t._s(t.validateMessage)+"\n ")])],{error:t.validateMessage}):t._e()],2)],2)],1)};ho._withStripped=!0;var po=n(40),fo=n.n(po),go=i({props:{isAutoWidth:Boolean,updateAll:Boolean},inject:["elForm","elFormItem"],render:function(){var t=arguments[0],e=this.$slots.default;if(!e)return null;if(this.isAutoWidth){var n=this.elForm.autoLabelWidth,r={};if(n&&"auto"!==n){var i=parseInt(n,10)-this.computedWidth;i&&(r.marginLeft=i+"px")}return t("div",{class:"el-form-item__label-wrap",style:r},[e])}return e[0]},methods:{getLabelWidth:function(){if(this.$el&&this.$el.firstElementChild){var t=window.getComputedStyle(this.$el.firstElementChild).width;return Math.ceil(parseFloat(t))}return 0},updateLabelWidth:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"update";this.$slots.default&&this.isAutoWidth&&this.$el.firstElementChild&&("update"===t?this.computedWidth=this.getLabelWidth():"remove"===t&&this.elForm.deregisterLabelWidth(this.computedWidth))}},watch:{computedWidth:function(t,e){this.updateAll&&(this.elForm.registerLabelWidth(t,e),this.elFormItem.updateComputedLabelWidth(t))}},data:function(){return{computedWidth:0}},mounted:function(){this.updateLabelWidth("update")},updated:function(){this.updateLabelWidth("update")},beforeDestroy:function(){this.updateLabelWidth("remove")}},void 0,void 0,!1,null,null,null);go.options.__file="packages/form/src/label-wrap.vue";var mo=go.exports,vo=i({name:"ElFormItem",componentName:"ElFormItem",mixins:[w.a],provide:function(){return{elFormItem:this}},inject:["elForm"],props:{label:String,labelWidth:String,prop:String,required:{type:Boolean,default:void 0},rules:[Object,Array],error:String,validateStatus:String,for:String,inlineMessage:{type:[String,Boolean],default:""},showMessage:{type:Boolean,default:!0},size:String},components:{LabelWrap:mo},watch:{error:{immediate:!0,handler:function(t){this.validateMessage=t,this.validateState=t?"error":""}},validateStatus:function(t){this.validateState=t}},computed:{labelFor:function(){return this.for||this.prop},labelStyle:function(){var t={};if("top"===this.form.labelPosition)return t;var e=this.labelWidth||this.form.labelWidth;return e&&(t.width=e),t},contentStyle:function(){var t={},e=this.label;if("top"===this.form.labelPosition||this.form.inline)return t;if(!e&&!this.labelWidth&&this.isNested)return t;var n=this.labelWidth||this.form.labelWidth;return"auto"===n?"auto"===this.labelWidth?t.marginLeft=this.computedLabelWidth:"auto"===this.form.labelWidth&&(t.marginLeft=this.elForm.autoLabelWidth):t.marginLeft=n,t},form:function(){for(var t=this.$parent,e=t.$options.componentName;"ElForm"!==e;)"ElFormItem"===e&&(this.isNested=!0),e=(t=t.$parent).$options.componentName;return t},fieldValue:function(){var t=this.form.model;if(t&&this.prop){var e=this.prop;return-1!==e.indexOf(":")&&(e=e.replace(/:/,".")),Object(g.getPropByPath)(t,e,!0).v}},isRequired:function(){var t=this.getRules(),e=!1;return t&&t.length&&t.every(function(t){return!t.required||(e=!0,!1)}),e},_formSize:function(){return this.elForm.size},elFormItemSize:function(){return this.size||this._formSize},sizeClass:function(){return this.elFormItemSize||(this.$ELEMENT||{}).size}},data:function(){return{validateState:"",validateMessage:"",validateDisabled:!1,validator:{},isNested:!1,computedLabelWidth:""}},methods:{validate:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:g.noop;this.validateDisabled=!1;var r=this.getFilteredRule(t);if((!r||0===r.length)&&void 0===this.required)return n(),!0;this.validateState="validating";var i={};r&&r.length>0&&r.forEach(function(t){delete t.trigger}),i[this.prop]=r;var o=new fo.a(i),s={};s[this.prop]=this.fieldValue,o.validate(s,{firstFields:!0},function(t,r){e.validateState=t?"error":"success",e.validateMessage=t?t[0].message:"",n(e.validateMessage,r),e.elForm&&e.elForm.$emit("validate",e.prop,!t,e.validateMessage||null)})},clearValidate:function(){this.validateState="",this.validateMessage="",this.validateDisabled=!1},resetField:function(){var t=this;this.validateState="",this.validateMessage="";var e=this.form.model,n=this.fieldValue,r=this.prop;-1!==r.indexOf(":")&&(r=r.replace(/:/,"."));var i=Object(g.getPropByPath)(e,r,!0);this.validateDisabled=!0,Array.isArray(n)?i.o[i.k]=[].concat(this.initialValue):i.o[i.k]=this.initialValue,this.$nextTick(function(){t.validateDisabled=!1}),this.broadcast("ElTimeSelect","fieldReset",this.initialValue)},getRules:function(){var t=this.form.rules,e=this.rules,n=void 0!==this.required?{required:!!this.required}:[],r=Object(g.getPropByPath)(t,this.prop||"");return t=t?r.o[this.prop||""]||r.v:[],[].concat(e||t||[]).concat(n)},getFilteredRule:function(t){return this.getRules().filter(function(e){return!e.trigger||""===t||(Array.isArray(e.trigger)?e.trigger.indexOf(t)>-1:e.trigger===t)}).map(function(t){return Ut()({},t)})},onFieldBlur:function(){this.validate("blur")},onFieldChange:function(){this.validateDisabled?this.validateDisabled=!1:this.validate("change")},updateComputedLabelWidth:function(t){this.computedLabelWidth=t?t+"px":""},addValidateEvents:function(){(this.getRules().length||void 0!==this.required)&&(this.$on("el.form.blur",this.onFieldBlur),this.$on("el.form.change",this.onFieldChange))},removeValidateEvents:function(){this.$off()}},mounted:function(){if(this.prop){this.dispatch("ElForm","el.form.addField",[this]);var t=this.fieldValue;Array.isArray(t)&&(t=[].concat(t)),Object.defineProperty(this,"initialValue",{value:t}),this.addValidateEvents()}},beforeDestroy:function(){this.dispatch("ElForm","el.form.removeField",[this])}},ho,[],!1,null,null,null);vo.options.__file="packages/form/src/form-item.vue";var bo=vo.exports;bo.install=function(t){t.component(bo.name,bo)};var _o=bo,yo=function(){var t=this.$createElement;return(this._self._c||t)("div",{staticClass:"el-tabs__active-bar",class:"is-"+this.rootTabs.tabPosition,style:this.barStyle})};yo._withStripped=!0;var To=i({name:"TabBar",props:{tabs:Array},inject:["rootTabs"],computed:{barStyle:{get:function(){var t=this,e={},n=0,r=0,i=-1!==["top","bottom"].indexOf(this.rootTabs.tabPosition)?"width":"height",o="width"===i?"x":"y",s=function(t){return t.toLowerCase().replace(/( |^)[a-z]/g,function(t){return t.toUpperCase()})};this.tabs.every(function(e,o){var a=Object(g.arrayFind)(t.$parent.$refs.tabs||[],function(t){return t.id.replace("tab-","")===e.paneName});if(!a)return!1;if(e.active){r=a["client"+s(i)];var l=window.getComputedStyle(a);return"width"===i&&t.tabs.length>1&&(r-=parseFloat(l.paddingLeft)+parseFloat(l.paddingRight)),"width"===i&&(n+=parseFloat(l.paddingLeft)),!1}return n+=a["client"+s(i)],!0});var a="translate"+s(o)+"("+n+"px)";return e[i]=r+"px",e.transform=a,e.msTransform=a,e.webkitTransform=a,e}}}},yo,[],!1,null,null,null);function xo(){}To.options.__file="packages/tabs/src/tab-bar.vue";var Eo=function(t){return t.toLowerCase().replace(/( |^)[a-z]/g,function(t){return t.toUpperCase()})},wo=i({name:"TabNav",components:{TabBar:To.exports},inject:["rootTabs"],props:{panes:Array,currentName:String,editable:Boolean,onTabClick:{type:Function,default:xo},onTabRemove:{type:Function,default:xo},type:String,stretch:Boolean},data:function(){return{scrollable:!1,navOffset:0,isFocus:!1,focusable:!0}},computed:{navStyle:function(){return{transform:"translate"+(-1!==["top","bottom"].indexOf(this.rootTabs.tabPosition)?"X":"Y")+"(-"+this.navOffset+"px)"}},sizeName:function(){return-1!==["top","bottom"].indexOf(this.rootTabs.tabPosition)?"width":"height"}},methods:{scrollPrev:function(){var t=this.$refs.navScroll["offset"+Eo(this.sizeName)],e=this.navOffset;if(e){var n=e>t?e-t:0;this.navOffset=n}},scrollNext:function(){var t=this.$refs.nav["offset"+Eo(this.sizeName)],e=this.$refs.navScroll["offset"+Eo(this.sizeName)],n=this.navOffset;if(!(t-n<=e)){var r=t-n>2*e?n+e:t-e;this.navOffset=r}},scrollToActiveTab:function(){if(this.scrollable){var t=this.$refs.nav,e=this.$el.querySelector(".is-active");if(e){var n=this.$refs.navScroll,r=-1!==["top","bottom"].indexOf(this.rootTabs.tabPosition),i=e.getBoundingClientRect(),o=n.getBoundingClientRect(),s=r?t.offsetWidth-o.width:t.offsetHeight-o.height,a=this.navOffset,l=a;r?(i.left<o.left&&(l=a-(o.left-i.left)),i.right>o.right&&(l=a+i.right-o.right)):(i.top<o.top&&(l=a-(o.top-i.top)),i.bottom>o.bottom&&(l=a+(i.bottom-o.bottom))),l=Math.max(l,0),this.navOffset=Math.min(l,s)}}},update:function(){if(this.$refs.nav){var t=this.sizeName,e=this.$refs.nav["offset"+Eo(t)],n=this.$refs.navScroll["offset"+Eo(t)],r=this.navOffset;if(n<e){var i=this.navOffset;this.scrollable=this.scrollable||{},this.scrollable.prev=i,this.scrollable.next=i+n<e,e-i<n&&(this.navOffset=e-n)}else this.scrollable=!1,r>0&&(this.navOffset=0)}},changeTab:function(t){var e=t.keyCode,n=void 0,r=void 0,i=void 0;-1!==[37,38,39,40].indexOf(e)&&(i=t.currentTarget.querySelectorAll("[role=tab]"),r=Array.prototype.indexOf.call(i,t.target),i[n=37===e||38===e?0===r?i.length-1:r-1:r<i.length-1?r+1:0].focus(),i[n].click(),this.setFocus())},setFocus:function(){this.focusable&&(this.isFocus=!0)},removeFocus:function(){this.isFocus=!1},visibilityChangeHandler:function(){var t=this,e=document.visibilityState;"hidden"===e?this.focusable=!1:"visible"===e&&setTimeout(function(){t.focusable=!0},50)},windowBlurHandler:function(){this.focusable=!1},windowFocusHandler:function(){var t=this;setTimeout(function(){t.focusable=!0},50)}},updated:function(){this.update()},render:function(t){var e=this,n=this.type,r=this.panes,i=this.editable,o=this.stretch,s=this.onTabClick,a=this.onTabRemove,l=this.navStyle,u=this.scrollable,c=this.scrollNext,h=this.scrollPrev,d=this.changeTab,p=this.setFocus,f=this.removeFocus,g=u?[t("span",{class:["el-tabs__nav-prev",u.prev?"":"is-disabled"],on:{click:h}},[t("i",{class:"el-icon-arrow-left"})]),t("span",{class:["el-tabs__nav-next",u.next?"":"is-disabled"],on:{click:c}},[t("i",{class:"el-icon-arrow-right"})])]:null,m=this._l(r,function(n,r){var o,l=n.name||n.index||r,u=n.isClosable||i;n.index=""+r;var c=u?t("span",{class:"el-icon-close",on:{click:function(t){a(n,t)}}}):null,h=n.$slots.label||n.label,d=n.active?0:-1;return t("div",{class:(o={"el-tabs__item":!0},o["is-"+e.rootTabs.tabPosition]=!0,o["is-active"]=n.active,o["is-disabled"]=n.disabled,o["is-closable"]=u,o["is-focus"]=e.isFocus,o),attrs:{id:"tab-"+l,"aria-controls":"pane-"+l,role:"tab","aria-selected":n.active,tabindex:d},key:"tab-"+l,ref:"tabs",refInFor:!0,on:{focus:function(){p()},blur:function(){f()},click:function(t){f(),s(n,l,t)},keydown:function(t){!u||46!==t.keyCode&&8!==t.keyCode||a(n,t)}}},[h,c])});return t("div",{class:["el-tabs__nav-wrap",u?"is-scrollable":"","is-"+this.rootTabs.tabPosition]},[g,t("div",{class:["el-tabs__nav-scroll"],ref:"navScroll"},[t("div",{class:["el-tabs__nav","is-"+this.rootTabs.tabPosition,o&&-1!==["top","bottom"].indexOf(this.rootTabs.tabPosition)?"is-stretch":""],ref:"nav",style:l,attrs:{role:"tablist"},on:{keydown:d}},[n?null:t("tab-bar",{attrs:{tabs:r}}),m])])])},mounted:function(){var t=this;Object(Pe.addResizeListener)(this.$el,this.update),document.addEventListener("visibilitychange",this.visibilityChangeHandler),window.addEventListener("blur",this.windowBlurHandler),window.addEventListener("focus",this.windowFocusHandler),setTimeout(function(){t.scrollToActiveTab()},0)},beforeDestroy:function(){this.$el&&this.update&&Object(Pe.removeResizeListener)(this.$el,this.update),document.removeEventListener("visibilitychange",this.visibilityChangeHandler),window.removeEventListener("blur",this.windowBlurHandler),window.removeEventListener("focus",this.windowFocusHandler)}},void 0,void 0,!1,null,null,null);wo.options.__file="packages/tabs/src/tab-nav.vue";var Co=i({name:"ElTabs",components:{TabNav:wo.exports},props:{type:String,activeName:String,closable:Boolean,addable:Boolean,value:{},editable:Boolean,tabPosition:{type:String,default:"top"},beforeLeave:Function,stretch:Boolean},provide:function(){return{rootTabs:this}},data:function(){return{currentName:this.value||this.activeName,panes:[]}},watch:{activeName:function(t){this.setCurrentName(t)},value:function(t){this.setCurrentName(t)},currentName:function(t){var e=this;this.$refs.nav&&this.$nextTick(function(){e.$refs.nav.$nextTick(function(t){e.$refs.nav.scrollToActiveTab()})})}},methods:{calcPaneInstances:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.$slots.default){var n=this.$slots.default.filter(function(t){return t.tag&&t.componentOptions&&"ElTabPane"===t.componentOptions.Ctor.options.name}).map(function(t){return t.componentInstance}),r=!(n.length===this.panes.length&&n.every(function(e,n){return e===t.panes[n]}));(e||r)&&(this.panes=n)}else 0!==this.panes.length&&(this.panes=[])},handleTabClick:function(t,e,n){t.disabled||(this.setCurrentName(e),this.$emit("tab-click",t,n))},handleTabRemove:function(t,e){t.disabled||(e.stopPropagation(),this.$emit("edit",t.name,"remove"),this.$emit("tab-remove",t.name))},handleTabAdd:function(){this.$emit("edit",null,"add"),this.$emit("tab-add")},setCurrentName:function(t){var e=this,n=function(){e.currentName=t,e.$emit("input",t)};if(this.currentName!==t&&this.beforeLeave){var r=this.beforeLeave(t,this.currentName);r&&r.then?r.then(function(){n(),e.$refs.nav&&e.$refs.nav.removeFocus()},function(){}):!1!==r&&n()}else n()}},render:function(t){var e,n=this.type,r=this.handleTabClick,i=this.handleTabRemove,o=this.handleTabAdd,s=this.currentName,a=this.panes,l=this.editable,u=this.addable,c=this.tabPosition,h=this.stretch,d=t("div",{class:["el-tabs__header","is-"+c]},[l||u?t("span",{class:"el-tabs__new-tab",on:{click:o,keydown:function(t){13===t.keyCode&&o()}},attrs:{tabindex:"0"}},[t("i",{class:"el-icon-plus"})]):null,t("tab-nav",{props:{currentName:s,onTabClick:r,onTabRemove:i,editable:l,type:n,panes:a,stretch:h},ref:"nav"})]),p=t("div",{class:"el-tabs__content"},[this.$slots.default]);return t("div",{class:(e={"el-tabs":!0,"el-tabs--card":"card"===n},e["el-tabs--"+c]=!0,e["el-tabs--border-card"]="border-card"===n,e)},["bottom"!==c?[d,p]:[p,d]])},created:function(){this.currentName||this.setCurrentName("0"),this.$on("tab-nav-update",this.calcPaneInstances.bind(null,!0))},mounted:function(){this.calcPaneInstances()},updated:function(){this.calcPaneInstances()}},void 0,void 0,!1,null,null,null);Co.options.__file="packages/tabs/src/tabs.vue";var So=Co.exports;So.install=function(t){t.component(So.name,So)};var ko=So,Oo=function(){var t=this,e=t.$createElement,n=t._self._c||e;return!t.lazy||t.loaded||t.active?n("div",{directives:[{name:"show",rawName:"v-show",value:t.active,expression:"active"}],staticClass:"el-tab-pane",attrs:{role:"tabpanel","aria-hidden":!t.active,id:"pane-"+t.paneName,"aria-labelledby":"tab-"+t.paneName}},[t._t("default")],2):t._e()};Oo._withStripped=!0;var Io=i({name:"ElTabPane",componentName:"ElTabPane",props:{label:String,labelContent:Function,name:String,closable:Boolean,disabled:Boolean,lazy:Boolean},data:function(){return{index:null,loaded:!1}},computed:{isClosable:function(){return this.closable||this.$parent.closable},active:function(){var t=this.$parent.currentName===(this.name||this.index);return t&&(this.loaded=!0),t},paneName:function(){return this.name||this.index}},updated:function(){this.$parent.$emit("tab-nav-update")}},Oo,[],!1,null,null,null);Io.options.__file="packages/tabs/src/tab-pane.vue";var Ro=Io.exports;Ro.install=function(t){t.component(Ro.name,Ro)};var Ao=Ro,No=i({name:"ElTag",props:{text:String,closable:Boolean,type:String,hit:Boolean,disableTransitions:Boolean,color:String,size:String,effect:{type:String,default:"light",validator:function(t){return-1!==["dark","light","plain"].indexOf(t)}}},methods:{handleClose:function(t){t.stopPropagation(),this.$emit("close",t)},handleClick:function(t){this.$emit("click",t)}},computed:{tagSize:function(){return this.size||(this.$ELEMENT||{}).size}},render:function(t){var e=this.type,n=this.tagSize,r=this.hit,i=this.effect,o=t("span",{class:["el-tag",e?"el-tag--"+e:"",n?"el-tag--"+n:"",i?"el-tag--"+i:"",r&&"is-hit"],style:{backgroundColor:this.color},on:{click:this.handleClick}},[this.$slots.default,this.closable&&t("i",{class:"el-tag__close el-icon-close",on:{click:this.handleClose}})]);return this.disableTransitions?o:t("transition",{attrs:{name:"el-zoom-in-center"}},[o])}},void 0,void 0,!1,null,null,null);No.options.__file="packages/tag/src/tag.vue";var Do=No.exports;Do.install=function(t){t.component(Do.name,Do)};var Mo=Do,Lo=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"el-tree",class:{"el-tree--highlight-current":t.highlightCurrent,"is-dragging":!!t.dragState.draggingNode,"is-drop-not-allow":!t.dragState.allowDrop,"is-drop-inner":"inner"===t.dragState.dropType},attrs:{role:"tree"}},[t._l(t.root.childNodes,function(e){return n("el-tree-node",{key:t.getNodeKey(e),attrs:{node:e,props:t.props,"render-after-expand":t.renderAfterExpand,"show-checkbox":t.showCheckbox,"render-content":t.renderContent},on:{"node-expand":t.handleNodeExpand}})}),t.isEmpty?n("div",{staticClass:"el-tree__empty-block"},[n("span",{staticClass:"el-tree__empty-text"},[t._v(t._s(t.emptyText))])]):t._e(),n("div",{directives:[{name:"show",rawName:"v-show",value:t.dragState.showDropIndicator,expression:"dragState.showDropIndicator"}],ref:"dropIndicator",staticClass:"el-tree__drop-indicator"})],2)};Lo._withStripped=!0;var Po="$treeNodeId",Fo=function(t,e){e&&!e[Po]&&Object.defineProperty(e,Po,{value:t.id,enumerable:!1,configurable:!1,writable:!1})},Bo=function(t,e){return t?e[t]:e[Po]},jo=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();var $o=function(t){for(var e=!0,n=!0,r=!0,i=0,o=t.length;i<o;i++){var s=t[i];(!0!==s.checked||s.indeterminate)&&(e=!1,s.disabled||(r=!1)),(!1!==s.checked||s.indeterminate)&&(n=!1)}return{all:e,none:n,allWithoutDisable:r,half:!e&&!n}},Uo=function t(e){if(0!==e.childNodes.length){var n=$o(e.childNodes),r=n.all,i=n.none,o=n.half;r?(e.checked=!0,e.indeterminate=!1):o?(e.checked=!1,e.indeterminate=!0):i&&(e.checked=!1,e.indeterminate=!1);var s=e.parent;s&&0!==s.level&&(e.store.checkStrictly||t(s))}},Vo=function(t,e){var n=t.store.props,r=t.data||{},i=n[e];if("function"==typeof i)return i(r,t);if("string"==typeof i)return r[i];if(void 0===i){var o=r[e];return void 0===o?"":o}},Ho=0,Wo=function(){function t(e){for(var n in function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.id=Ho++,this.text=null,this.checked=!1,this.indeterminate=!1,this.data=null,this.expanded=!1,this.parent=null,this.visible=!0,this.isCurrent=!1,e)e.hasOwnProperty(n)&&(this[n]=e[n]);this.level=0,this.loaded=!1,this.childNodes=[],this.loading=!1,this.parent&&(this.level=this.parent.level+1);var r=this.store;if(!r)throw new Error("[Node]store is required!");r.registerNode(this);var i=r.props;if(i&&void 0!==i.isLeaf){var o=Vo(this,"isLeaf");"boolean"==typeof o&&(this.isLeafByUser=o)}if(!0!==r.lazy&&this.data?(this.setData(this.data),r.defaultExpandAll&&(this.expanded=!0)):this.level>0&&r.lazy&&r.defaultExpandAll&&this.expand(),Array.isArray(this.data)||Fo(this,this.data),this.data){var s=r.defaultExpandedKeys,a=r.key;a&&s&&-1!==s.indexOf(this.key)&&this.expand(null,r.autoExpandParent),a&&void 0!==r.currentNodeKey&&this.key===r.currentNodeKey&&(r.currentNode=this,r.currentNode.isCurrent=!0),r.lazy&&r._initDefaultCheckedNode(this),this.updateLeafState()}}return t.prototype.setData=function(t){Array.isArray(t)||Fo(this,t),this.data=t,this.childNodes=[];for(var e=void 0,n=0,r=(e=0===this.level&&this.data instanceof Array?this.data:Vo(this,"children")||[]).length;n<r;n++)this.insertChild({data:e[n]})},t.prototype.contains=function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return function n(r){for(var i=r.childNodes||[],o=!1,s=0,a=i.length;s<a;s++){var l=i[s];if(l===t||e&&n(l)){o=!0;break}}return o}(this)},t.prototype.remove=function(){var t=this.parent;t&&t.removeChild(this)},t.prototype.insertChild=function(e,n,r){if(!e)throw new Error("insertChild error: child is required.");if(!(e instanceof t)){if(!r){var i=this.getChildren(!0);-1===i.indexOf(e.data)&&(void 0===n||n<0?i.push(e.data):i.splice(n,0,e.data))}Ut()(e,{parent:this,store:this.store}),e=new t(e)}e.level=this.level+1,void 0===n||n<0?this.childNodes.push(e):this.childNodes.splice(n,0,e),this.updateLeafState()},t.prototype.insertBefore=function(t,e){var n=void 0;e&&(n=this.childNodes.indexOf(e)),this.insertChild(t,n)},t.prototype.insertAfter=function(t,e){var n=void 0;e&&-1!==(n=this.childNodes.indexOf(e))&&(n+=1),this.insertChild(t,n)},t.prototype.removeChild=function(t){var e=this.getChildren()||[],n=e.indexOf(t.data);n>-1&&e.splice(n,1);var r=this.childNodes.indexOf(t);r>-1&&(this.store&&this.store.deregisterNode(t),t.parent=null,this.childNodes.splice(r,1)),this.updateLeafState()},t.prototype.removeChildByData=function(t){for(var e=null,n=0;n<this.childNodes.length;n++)if(this.childNodes[n].data===t){e=this.childNodes[n];break}e&&this.removeChild(e)},t.prototype.expand=function(t,e){var n=this,r=function(){if(e)for(var r=n.parent;r.level>0;)r.expanded=!0,r=r.parent;n.expanded=!0,t&&t()};this.shouldLoadData()?this.loadData(function(t){t instanceof Array&&(n.checked?n.setChecked(!0,!0):n.store.checkStrictly||Uo(n),r())}):r()},t.prototype.doCreateChildren=function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.forEach(function(t){e.insertChild(Ut()({data:t},n),void 0,!0)})},t.prototype.collapse=function(){this.expanded=!1},t.prototype.shouldLoadData=function(){return!0===this.store.lazy&&this.store.load&&!this.loaded},t.prototype.updateLeafState=function(){if(!0!==this.store.lazy||!0===this.loaded||void 0===this.isLeafByUser){var t=this.childNodes;!this.store.lazy||!0===this.store.lazy&&!0===this.loaded?this.isLeaf=!t||0===t.length:this.isLeaf=!1}else this.isLeaf=this.isLeafByUser},t.prototype.setChecked=function(t,e,n,r){var i=this;if(this.indeterminate="half"===t,this.checked=!0===t,!this.store.checkStrictly){if(!this.shouldLoadData()||this.store.checkDescendants){var o=$o(this.childNodes),s=o.all,a=o.allWithoutDisable;this.isLeaf||s||!a||(this.checked=!1,t=!1);var l=function(){if(e){for(var n=i.childNodes,o=0,s=n.length;o<s;o++){var a=n[o];r=r||!1!==t;var l=a.disabled?a.checked:r;a.setChecked(l,e,!0,r)}var u=$o(n),c=u.half,h=u.all;h||(i.checked=h,i.indeterminate=c)}};if(this.shouldLoadData())return void this.loadData(function(){l(),Uo(i)},{checked:!1!==t});l()}var u=this.parent;u&&0!==u.level&&(n||Uo(u))}},t.prototype.getChildren=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(0===this.level)return this.data;var e=this.data;if(!e)return null;var n=this.store.props,r="children";return n&&(r=n.children||"children"),void 0===e[r]&&(e[r]=null),t&&!e[r]&&(e[r]=[]),e[r]},t.prototype.updateChildren=function(){var t=this,e=this.getChildren()||[],n=this.childNodes.map(function(t){return t.data}),r={},i=[];e.forEach(function(t,e){var o=t[Po];!!o&&Object(g.arrayFindIndex)(n,function(t){return t[Po]===o})>=0?r[o]={index:e,data:t}:i.push({index:e,data:t})}),this.store.lazy||n.forEach(function(e){r[e[Po]]||t.removeChildByData(e)}),i.forEach(function(e){var n=e.index,r=e.data;t.insertChild({data:r},n)}),this.updateLeafState()},t.prototype.loadData=function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!0!==this.store.lazy||!this.store.load||this.loaded||this.loading&&!Object.keys(n).length)t&&t.call(this);else{this.loading=!0;this.store.load(this,function(r){e.loaded=!0,e.loading=!1,e.childNodes=[],e.doCreateChildren(r,n),e.updateLeafState(),t&&t.call(e,r)})}},jo(t,[{key:"label",get:function(){return Vo(this,"label")}},{key:"key",get:function(){var t=this.store.key;return this.data?this.data[t]:null}},{key:"disabled",get:function(){return Vo(this,"disabled")}},{key:"nextSibling",get:function(){var t=this.parent;if(t){var e=t.childNodes.indexOf(this);if(e>-1)return t.childNodes[e+1]}return null}},{key:"previousSibling",get:function(){var t=this.parent;if(t){var e=t.childNodes.indexOf(this);if(e>-1)return e>0?t.childNodes[e-1]:null}return null}}]),t}(),Go="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};var zo=function(){function t(e){var n=this;for(var r in function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.currentNode=null,this.currentNodeKey=null,e)e.hasOwnProperty(r)&&(this[r]=e[r]);(this.nodesMap={},this.root=new Wo({data:this.data,store:this}),this.lazy&&this.load)?(0,this.load)(this.root,function(t){n.root.doCreateChildren(t),n._initDefaultCheckedNodes()}):this._initDefaultCheckedNodes()}return t.prototype.filter=function(t){var e=this.filterNodeMethod,n=this.lazy;!function r(i){var o=i.root?i.root.childNodes:i.childNodes;if(o.forEach(function(n){n.visible=e.call(n,t,n.data,n),r(n)}),!i.visible&&o.length){var s;s=!o.some(function(t){return t.visible}),i.root?i.root.visible=!1===s:i.visible=!1===s}t&&(!i.visible||i.isLeaf||n||i.expand())}(this)},t.prototype.setData=function(t){t!==this.root.data?(this.root.setData(t),this._initDefaultCheckedNodes()):this.root.updateChildren()},t.prototype.getNode=function(t){if(t instanceof Wo)return t;var e="object"!==(void 0===t?"undefined":Go(t))?t:Bo(this.key,t);return this.nodesMap[e]||null},t.prototype.insertBefore=function(t,e){var n=this.getNode(e);n.parent.insertBefore({data:t},n)},t.prototype.insertAfter=function(t,e){var n=this.getNode(e);n.parent.insertAfter({data:t},n)},t.prototype.remove=function(t){var e=this.getNode(t);e&&e.parent&&(e===this.currentNode&&(this.currentNode=null),e.parent.removeChild(e))},t.prototype.append=function(t,e){var n=e?this.getNode(e):this.root;n&&n.insertChild({data:t})},t.prototype._initDefaultCheckedNodes=function(){var t=this,e=this.defaultCheckedKeys||[],n=this.nodesMap;e.forEach(function(e){var r=n[e];r&&r.setChecked(!0,!t.checkStrictly)})},t.prototype._initDefaultCheckedNode=function(t){-1!==(this.defaultCheckedKeys||[]).indexOf(t.key)&&t.setChecked(!0,!this.checkStrictly)},t.prototype.setDefaultCheckedKey=function(t){t!==this.defaultCheckedKeys&&(this.defaultCheckedKeys=t,this._initDefaultCheckedNodes())},t.prototype.registerNode=function(t){this.key&&t&&t.data&&(void 0!==t.key&&(this.nodesMap[t.key]=t))},t.prototype.deregisterNode=function(t){var e=this;this.key&&t&&t.data&&(t.childNodes.forEach(function(t){e.deregisterNode(t)}),delete this.nodesMap[t.key])},t.prototype.getCheckedNodes=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=[];return function r(i){(i.root?i.root.childNodes:i.childNodes).forEach(function(i){(i.checked||e&&i.indeterminate)&&(!t||t&&i.isLeaf)&&n.push(i.data),r(i)})}(this),n},t.prototype.getCheckedKeys=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.getCheckedNodes(e).map(function(e){return(e||{})[t.key]})},t.prototype.getHalfCheckedNodes=function(){var t=[];return function e(n){(n.root?n.root.childNodes:n.childNodes).forEach(function(n){n.indeterminate&&t.push(n.data),e(n)})}(this),t},t.prototype.getHalfCheckedKeys=function(){var t=this;return this.getHalfCheckedNodes().map(function(e){return(e||{})[t.key]})},t.prototype._getAllNodes=function(){var t=[],e=this.nodesMap;for(var n in e)e.hasOwnProperty(n)&&t.push(e[n]);return t},t.prototype.updateChildren=function(t,e){var n=this.nodesMap[t];if(n){for(var r=n.childNodes,i=r.length-1;i>=0;i--){var o=r[i];this.remove(o.data)}for(var s=0,a=e.length;s<a;s++){var l=e[s];this.append(l,n.data)}}},t.prototype._setCheckedKeys=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments[2],r=this._getAllNodes().sort(function(t,e){return e.level-t.level}),i=Object.create(null),o=Object.keys(n);r.forEach(function(t){return t.setChecked(!1,!1)});for(var s=0,a=r.length;s<a;s++){var l=r[s],u=l.data[t].toString();if(o.indexOf(u)>-1){for(var c=l.parent;c&&c.level>0;)i[c.data[t]]=!0,c=c.parent;l.isLeaf||this.checkStrictly?l.setChecked(!0,!1):(l.setChecked(!0,!0),e&&function(){l.setChecked(!1,!1);!function t(e){e.childNodes.forEach(function(e){e.isLeaf||e.setChecked(!1,!1),t(e)})}(l)}())}else l.checked&&!i[u]&&l.setChecked(!1,!1)}},t.prototype.setCheckedNodes=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.key,r={};t.forEach(function(t){r[(t||{})[n]]=!0}),this._setCheckedKeys(n,e,r)},t.prototype.setCheckedKeys=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.defaultCheckedKeys=t;var n=this.key,r={};t.forEach(function(t){r[t]=!0}),this._setCheckedKeys(n,e,r)},t.prototype.setDefaultExpandedKeys=function(t){var e=this;t=t||[],this.defaultExpandedKeys=t,t.forEach(function(t){var n=e.getNode(t);n&&n.expand(null,e.autoExpandParent)})},t.prototype.setChecked=function(t,e,n){var r=this.getNode(t);r&&r.setChecked(!!e,n)},t.prototype.getCurrentNode=function(){return this.currentNode},t.prototype.setCurrentNode=function(t){var e=this.currentNode;e&&(e.isCurrent=!1),this.currentNode=t,this.currentNode.isCurrent=!0},t.prototype.setUserCurrentNode=function(t){var e=t[this.key],n=this.nodesMap[e];this.setCurrentNode(n)},t.prototype.setCurrentNodeKey=function(t){if(null===t||void 0===t)return this.currentNode&&(this.currentNode.isCurrent=!1),void(this.currentNode=null);var e=this.getNode(t);e&&this.setCurrentNode(e)},t}(),Xo=function(){var t=this,e=this,n=e.$createElement,r=e._self._c||n;return r("div",{directives:[{name:"show",rawName:"v-show",value:e.node.visible,expression:"node.visible"}],ref:"node",staticClass:"el-tree-node",class:{"is-expanded":e.expanded,"is-current":e.node.isCurrent,"is-hidden":!e.node.visible,"is-focusable":!e.node.disabled,"is-checked":!e.node.disabled&&e.node.checked},attrs:{role:"treeitem",tabindex:"-1","aria-expanded":e.expanded,"aria-disabled":e.node.disabled,"aria-checked":e.node.checked,draggable:e.tree.draggable},on:{click:function(t){return t.stopPropagation(),e.handleClick(t)},contextmenu:function(e){return t.handleContextMenu(e)},dragstart:function(t){return t.stopPropagation(),e.handleDragStart(t)},dragover:function(t){return t.stopPropagation(),e.handleDragOver(t)},dragend:function(t){return t.stopPropagation(),e.handleDragEnd(t)},drop:function(t){return t.stopPropagation(),e.handleDrop(t)}}},[r("div",{staticClass:"el-tree-node__content",style:{"padding-left":(e.node.level-1)*e.tree.indent+"px"}},[r("span",{class:[{"is-leaf":e.node.isLeaf,expanded:!e.node.isLeaf&&e.expanded},"el-tree-node__expand-icon",e.tree.iconClass?e.tree.iconClass:"el-icon-caret-right"],on:{click:function(t){return t.stopPropagation(),e.handleExpandIconClick(t)}}}),e.showCheckbox?r("el-checkbox",{attrs:{indeterminate:e.node.indeterminate,disabled:!!e.node.disabled},on:{change:e.handleCheckChange},nativeOn:{click:function(t){t.stopPropagation()}},model:{value:e.node.checked,callback:function(t){e.$set(e.node,"checked",t)},expression:"node.checked"}}):e._e(),e.node.loading?r("span",{staticClass:"el-tree-node__loading-icon el-icon-loading"}):e._e(),r("node-content",{attrs:{node:e.node}})],1),r("el-collapse-transition",[!e.renderAfterExpand||e.childNodeRendered?r("div",{directives:[{name:"show",rawName:"v-show",value:e.expanded,expression:"expanded"}],staticClass:"el-tree-node__children",attrs:{role:"group","aria-expanded":e.expanded}},e._l(e.node.childNodes,function(t){return r("el-tree-node",{key:e.getNodeKey(t),attrs:{"render-content":e.renderContent,"render-after-expand":e.renderAfterExpand,"show-checkbox":e.showCheckbox,node:t},on:{"node-expand":e.handleChildNodeExpand}})}),1):e._e()])],1)};Xo._withStripped=!0;var Ko=i({name:"ElTreeNode",componentName:"ElTreeNode",mixins:[w.a],props:{node:{default:function(){return{}}},props:{},renderContent:Function,renderAfterExpand:{type:Boolean,default:!0},showCheckbox:{type:Boolean,default:!1}},components:{ElCollapseTransition:_t.a,ElCheckbox:rn.a,NodeContent:{props:{node:{required:!0}},render:function(t){var e=this.$parent,n=e.tree,r=this.node,i=r.data,o=r.store;return e.renderContent?e.renderContent.call(e._renderProxy,t,{_self:n.$vnode.context,node:r,data:i,store:o}):n.$scopedSlots.default?n.$scopedSlots.default({node:r,data:i}):t("span",{class:"el-tree-node__label"},[r.label])}}},data:function(){return{tree:null,expanded:!1,childNodeRendered:!1,oldChecked:null,oldIndeterminate:null}},watch:{"node.indeterminate":function(t){this.handleSelectChange(this.node.checked,t)},"node.checked":function(t){this.handleSelectChange(t,this.node.indeterminate)},"node.expanded":function(t){var e=this;this.$nextTick(function(){return e.expanded=t}),t&&(this.childNodeRendered=!0)}},methods:{getNodeKey:function(t){return Bo(this.tree.nodeKey,t.data)},handleSelectChange:function(t,e){this.oldChecked!==t&&this.oldIndeterminate!==e&&this.tree.$emit("check-change",this.node.data,t,e),this.oldChecked=t,this.indeterminate=e},handleClick:function(){var t=this.tree.store;t.setCurrentNode(this.node),this.tree.$emit("current-change",t.currentNode?t.currentNode.data:null,t.currentNode),this.tree.currentNode=this,this.tree.expandOnClickNode&&this.handleExpandIconClick(),this.tree.checkOnClickNode&&!this.node.disabled&&this.handleCheckChange(null,{target:{checked:!this.node.checked}}),this.tree.$emit("node-click",this.node.data,this.node,this)},handleContextMenu:function(t){this.tree._events["node-contextmenu"]&&this.tree._events["node-contextmenu"].length>0&&(t.stopPropagation(),t.preventDefault()),this.tree.$emit("node-contextmenu",t,this.node.data,this.node,this)},handleExpandIconClick:function(){this.node.isLeaf||(this.expanded?(this.tree.$emit("node-collapse",this.node.data,this.node,this),this.node.collapse()):(this.node.expand(),this.$emit("node-expand",this.node.data,this.node,this)))},handleCheckChange:function(t,e){var n=this;this.node.setChecked(e.target.checked,!this.tree.checkStrictly),this.$nextTick(function(){var t=n.tree.store;n.tree.$emit("check",n.node.data,{checkedNodes:t.getCheckedNodes(),checkedKeys:t.getCheckedKeys(),halfCheckedNodes:t.getHalfCheckedNodes(),halfCheckedKeys:t.getHalfCheckedKeys()})})},handleChildNodeExpand:function(t,e,n){this.broadcast("ElTreeNode","tree-node-expand",e),this.tree.$emit("node-expand",t,e,n)},handleDragStart:function(t){this.tree.draggable&&this.tree.$emit("tree-node-drag-start",t,this)},handleDragOver:function(t){this.tree.draggable&&(this.tree.$emit("tree-node-drag-over",t,this),t.preventDefault())},handleDrop:function(t){t.preventDefault()},handleDragEnd:function(t){this.tree.draggable&&this.tree.$emit("tree-node-drag-end",t,this)}},created:function(){var t=this,e=this.$parent;e.isTree?this.tree=e:this.tree=e.tree;var n=this.tree;n||console.warn("Can not find node's tree.");var r=(n.props||{}).children||"children";this.$watch("node.data."+r,function(){t.node.updateChildren()}),this.node.expanded&&(this.expanded=!0,this.childNodeRendered=!0),this.tree.accordion&&this.$on("tree-node-expand",function(e){t.node!==e&&t.node.collapse()})}},Xo,[],!1,null,null,null);Ko.options.__file="packages/tree/src/tree-node.vue";var Yo=Ko.exports,qo=i({name:"ElTree",mixins:[w.a],components:{ElTreeNode:Yo},data:function(){return{store:null,root:null,currentNode:null,treeItems:null,checkboxItems:[],dragState:{showDropIndicator:!1,draggingNode:null,dropNode:null,allowDrop:!0}}},props:{data:{type:Array},emptyText:{type:String,default:function(){return Object(Mi.t)("el.tree.emptyText")}},renderAfterExpand:{type:Boolean,default:!0},nodeKey:String,checkStrictly:Boolean,defaultExpandAll:Boolean,expandOnClickNode:{type:Boolean,default:!0},checkOnClickNode:Boolean,checkDescendants:{type:Boolean,default:!1},autoExpandParent:{type:Boolean,default:!0},defaultCheckedKeys:Array,defaultExpandedKeys:Array,currentNodeKey:[String,Number],renderContent:Function,showCheckbox:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1},allowDrag:Function,allowDrop:Function,props:{default:function(){return{children:"children",label:"label",disabled:"disabled"}}},lazy:{type:Boolean,default:!1},highlightCurrent:Boolean,load:Function,filterNodeMethod:Function,accordion:Boolean,indent:{type:Number,default:18},iconClass:String},computed:{children:{set:function(t){this.data=t},get:function(){return this.data}},treeItemArray:function(){return Array.prototype.slice.call(this.treeItems)},isEmpty:function(){var t=this.root.childNodes;return!t||0===t.length||t.every(function(t){return!t.visible})}},watch:{defaultCheckedKeys:function(t){this.store.setDefaultCheckedKey(t)},defaultExpandedKeys:function(t){this.store.defaultExpandedKeys=t,this.store.setDefaultExpandedKeys(t)},data:function(t){this.store.setData(t)},checkboxItems:function(t){Array.prototype.forEach.call(t,function(t){t.setAttribute("tabindex",-1)})},checkStrictly:function(t){this.store.checkStrictly=t}},methods:{filter:function(t){if(!this.filterNodeMethod)throw new Error("[Tree] filterNodeMethod is required when filter");this.store.filter(t)},getNodeKey:function(t){return Bo(this.nodeKey,t.data)},getNodePath:function(t){if(!this.nodeKey)throw new Error("[Tree] nodeKey is required in getNodePath");var e=this.store.getNode(t);if(!e)return[];for(var n=[e.data],r=e.parent;r&&r!==this.root;)n.push(r.data),r=r.parent;return n.reverse()},getCheckedNodes:function(t,e){return this.store.getCheckedNodes(t,e)},getCheckedKeys:function(t){return this.store.getCheckedKeys(t)},getCurrentNode:function(){var t=this.store.getCurrentNode();return t?t.data:null},getCurrentKey:function(){if(!this.nodeKey)throw new Error("[Tree] nodeKey is required in getCurrentKey");var t=this.getCurrentNode();return t?t[this.nodeKey]:null},setCheckedNodes:function(t,e){if(!this.nodeKey)throw new Error("[Tree] nodeKey is required in setCheckedNodes");this.store.setCheckedNodes(t,e)},setCheckedKeys:function(t,e){if(!this.nodeKey)throw new Error("[Tree] nodeKey is required in setCheckedKeys");this.store.setCheckedKeys(t,e)},setChecked:function(t,e,n){this.store.setChecked(t,e,n)},getHalfCheckedNodes:function(){return this.store.getHalfCheckedNodes()},getHalfCheckedKeys:function(){return this.store.getHalfCheckedKeys()},setCurrentNode:function(t){if(!this.nodeKey)throw new Error("[Tree] nodeKey is required in setCurrentNode");this.store.setUserCurrentNode(t)},setCurrentKey:function(t){if(!this.nodeKey)throw new Error("[Tree] nodeKey is required in setCurrentKey");this.store.setCurrentNodeKey(t)},getNode:function(t){return this.store.getNode(t)},remove:function(t){this.store.remove(t)},append:function(t,e){this.store.append(t,e)},insertBefore:function(t,e){this.store.insertBefore(t,e)},insertAfter:function(t,e){this.store.insertAfter(t,e)},handleNodeExpand:function(t,e,n){this.broadcast("ElTreeNode","tree-node-expand",e),this.$emit("node-expand",t,e,n)},updateKeyChildren:function(t,e){if(!this.nodeKey)throw new Error("[Tree] nodeKey is required in updateKeyChild");this.store.updateChildren(t,e)},initTabIndex:function(){this.treeItems=this.$el.querySelectorAll(".is-focusable[role=treeitem]"),this.checkboxItems=this.$el.querySelectorAll("input[type=checkbox]");var t=this.$el.querySelectorAll(".is-checked[role=treeitem]");t.length?t[0].setAttribute("tabindex",0):this.treeItems[0]&&this.treeItems[0].setAttribute("tabindex",0)},handleKeydown:function(t){var e=t.target;if(-1!==e.className.indexOf("el-tree-node")){var n=t.keyCode;this.treeItems=this.$el.querySelectorAll(".is-focusable[role=treeitem]");var r=this.treeItemArray.indexOf(e),i=void 0;[38,40].indexOf(n)>-1&&(t.preventDefault(),i=38===n?0!==r?r-1:0:r<this.treeItemArray.length-1?r+1:0,this.treeItemArray[i].focus()),[37,39].indexOf(n)>-1&&(t.preventDefault(),e.click());var o=e.querySelector('[type="checkbox"]');[13,32].indexOf(n)>-1&&o&&(t.preventDefault(),o.click())}}},created:function(){var t=this;this.isTree=!0,this.store=new zo({key:this.nodeKey,data:this.data,lazy:this.lazy,props:this.props,load:this.load,currentNodeKey:this.currentNodeKey,checkStrictly:this.checkStrictly,checkDescendants:this.checkDescendants,defaultCheckedKeys:this.defaultCheckedKeys,defaultExpandedKeys:this.defaultExpandedKeys,autoExpandParent:this.autoExpandParent,defaultExpandAll:this.defaultExpandAll,filterNodeMethod:this.filterNodeMethod}),this.root=this.store.root;var e=this.dragState;this.$on("tree-node-drag-start",function(n,r){if("function"==typeof t.allowDrag&&!t.allowDrag(r.node))return n.preventDefault(),!1;n.dataTransfer.effectAllowed="move";try{n.dataTransfer.setData("text/plain","")}catch(t){}e.draggingNode=r,t.$emit("node-drag-start",r.node,n)}),this.$on("tree-node-drag-over",function(n,r){var i=function(t,e){for(var n=t;n&&"BODY"!==n.tagName;){if(n.__vue__&&n.__vue__.$options.name===e)return n.__vue__;n=n.parentNode}return null}(n.target,"ElTreeNode"),o=e.dropNode;o&&o!==i&&Object(ft.removeClass)(o.$el,"is-drop-inner");var s=e.draggingNode;if(s&&i){var a=!0,l=!0,u=!0,c=!0;"function"==typeof t.allowDrop&&(a=t.allowDrop(s.node,i.node,"prev"),c=l=t.allowDrop(s.node,i.node,"inner"),u=t.allowDrop(s.node,i.node,"next")),n.dataTransfer.dropEffect=l?"move":"none",(a||l||u)&&o!==i&&(o&&t.$emit("node-drag-leave",s.node,o.node,n),t.$emit("node-drag-enter",s.node,i.node,n)),(a||l||u)&&(e.dropNode=i),i.node.nextSibling===s.node&&(u=!1),i.node.previousSibling===s.node&&(a=!1),i.node.contains(s.node,!1)&&(l=!1),(s.node===i.node||s.node.contains(i.node))&&(a=!1,l=!1,u=!1);var h=i.$el.getBoundingClientRect(),d=t.$el.getBoundingClientRect(),p=void 0,f=a?l?.25:u?.45:1:-1,g=u?l?.75:a?.55:0:1,m=-9999,v=n.clientY-h.top;p=v<h.height*f?"before":v>h.height*g?"after":l?"inner":"none";var b=i.$el.querySelector(".el-tree-node__expand-icon").getBoundingClientRect(),_=t.$refs.dropIndicator;"before"===p?m=b.top-d.top:"after"===p&&(m=b.bottom-d.top),_.style.top=m+"px",_.style.left=b.right-d.left+"px","inner"===p?Object(ft.addClass)(i.$el,"is-drop-inner"):Object(ft.removeClass)(i.$el,"is-drop-inner"),e.showDropIndicator="before"===p||"after"===p,e.allowDrop=e.showDropIndicator||c,e.dropType=p,t.$emit("node-drag-over",s.node,i.node,n)}}),this.$on("tree-node-drag-end",function(n){var r=e.draggingNode,i=e.dropType,o=e.dropNode;if(n.preventDefault(),n.dataTransfer.dropEffect="move",r&&o){var s={data:r.node.data};"none"!==i&&r.node.remove(),"before"===i?o.node.parent.insertBefore(s,o.node):"after"===i?o.node.parent.insertAfter(s,o.node):"inner"===i&&o.node.insertChild(s),"none"!==i&&t.store.registerNode(s),Object(ft.removeClass)(o.$el,"is-drop-inner"),t.$emit("node-drag-end",r.node,o.node,i,n),"none"!==i&&t.$emit("node-drop",r.node,o.node,i,n)}r&&!o&&t.$emit("node-drag-end",r.node,null,i,n),e.showDropIndicator=!1,e.draggingNode=null,e.dropNode=null,e.allowDrop=!0})},mounted:function(){this.initTabIndex(),this.$el.addEventListener("keydown",this.handleKeydown)},updated:function(){this.treeItems=this.$el.querySelectorAll("[role=treeitem]"),this.checkboxItems=this.$el.querySelectorAll("input[type=checkbox]")}},Lo,[],!1,null,null,null);qo.options.__file="packages/tree/src/tree.vue";var Jo=qo.exports;Jo.install=function(t){t.component(Jo.name,Jo)};var Zo=Jo,Qo=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("transition",{attrs:{name:"el-alert-fade"}},[n("div",{directives:[{name:"show",rawName:"v-show",value:t.visible,expression:"visible"}],staticClass:"el-alert",class:[t.typeClass,t.center?"is-center":"","is-"+t.effect],attrs:{role:"alert"}},[t.showIcon?n("i",{staticClass:"el-alert__icon",class:[t.iconClass,t.isBigIcon]}):t._e(),n("div",{staticClass:"el-alert__content"},[t.title||t.$slots.title?n("span",{staticClass:"el-alert__title",class:[t.isBoldTitle]},[t._t("title",[t._v(t._s(t.title))])],2):t._e(),t.$slots.default&&!t.description?n("p",{staticClass:"el-alert__description"},[t._t("default")],2):t._e(),t.description&&!t.$slots.default?n("p",{staticClass:"el-alert__description"},[t._v(t._s(t.description))]):t._e(),n("i",{directives:[{name:"show",rawName:"v-show",value:t.closable,expression:"closable"}],staticClass:"el-alert__closebtn",class:{"is-customed":""!==t.closeText,"el-icon-close":""===t.closeText},on:{click:function(e){t.close()}}},[t._v(t._s(t.closeText))])])])])};Qo._withStripped=!0;var ts={success:"el-icon-success",warning:"el-icon-warning",error:"el-icon-error"},es=i({name:"ElAlert",props:{title:{type:String,default:""},description:{type:String,default:""},type:{type:String,default:"info"},closable:{type:Boolean,default:!0},closeText:{type:String,default:""},showIcon:Boolean,center:Boolean,effect:{type:String,default:"light",validator:function(t){return-1!==["light","dark"].indexOf(t)}}},data:function(){return{visible:!0}},methods:{close:function(){this.visible=!1,this.$emit("close")}},computed:{typeClass:function(){return"el-alert--"+this.type},iconClass:function(){return ts[this.type]||"el-icon-info"},isBigIcon:function(){return this.description||this.$slots.default?"is-big":""},isBoldTitle:function(){return this.description||this.$slots.default?"is-bold":""}}},Qo,[],!1,null,null,null);es.options.__file="packages/alert/src/main.vue";var ns=es.exports;ns.install=function(t){t.component(ns.name,ns)};var rs=ns,is=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("transition",{attrs:{name:"el-notification-fade"}},[n("div",{directives:[{name:"show",rawName:"v-show",value:t.visible,expression:"visible"}],class:["el-notification",t.customClass,t.horizontalClass],style:t.positionStyle,attrs:{role:"alert"},on:{mouseenter:function(e){t.clearTimer()},mouseleave:function(e){t.startTimer()},click:t.click}},[t.type||t.iconClass?n("i",{staticClass:"el-notification__icon",class:[t.typeClass,t.iconClass]}):t._e(),n("div",{staticClass:"el-notification__group",class:{"is-with-icon":t.typeClass||t.iconClass}},[n("h2",{staticClass:"el-notification__title",domProps:{textContent:t._s(t.title)}}),n("div",{directives:[{name:"show",rawName:"v-show",value:t.message,expression:"message"}],staticClass:"el-notification__content"},[t._t("default",[t.dangerouslyUseHTMLString?n("p",{domProps:{innerHTML:t._s(t.message)}}):n("p",[t._v(t._s(t.message))])])],2),t.showClose?n("div",{staticClass:"el-notification__closeBtn el-icon-close",on:{click:function(e){return e.stopPropagation(),t.close(e)}}}):t._e()])])])};is._withStripped=!0;var os={success:"success",info:"info",warning:"warning",error:"error"},ss=i({data:function(){return{visible:!1,title:"",message:"",duration:4500,type:"",showClose:!0,customClass:"",iconClass:"",onClose:null,onClick:null,closed:!1,verticalOffset:0,timer:null,dangerouslyUseHTMLString:!1,position:"top-right"}},computed:{typeClass:function(){return this.type&&os[this.type]?"el-icon-"+os[this.type]:""},horizontalClass:function(){return this.position.indexOf("right")>-1?"right":"left"},verticalProperty:function(){return/^top-/.test(this.position)?"top":"bottom"},positionStyle:function(){var t;return(t={})[this.verticalProperty]=this.verticalOffset+"px",t}},watch:{closed:function(t){t&&(this.visible=!1,this.$el.addEventListener("transitionend",this.destroyElement))}},methods:{destroyElement:function(){this.$el.removeEventListener("transitionend",this.destroyElement),this.$destroy(!0),this.$el.parentNode.removeChild(this.$el)},click:function(){"function"==typeof this.onClick&&this.onClick()},close:function(){this.closed=!0,"function"==typeof this.onClose&&this.onClose()},clearTimer:function(){clearTimeout(this.timer)},startTimer:function(){var t=this;this.duration>0&&(this.timer=setTimeout(function(){t.closed||t.close()},this.duration))},keydown:function(t){46===t.keyCode||8===t.keyCode?this.clearTimer():27===t.keyCode?this.closed||this.close():this.startTimer()}},mounted:function(){var t=this;this.duration>0&&(this.timer=setTimeout(function(){t.closed||t.close()},this.duration)),document.addEventListener("keydown",this.keydown)},beforeDestroy:function(){document.removeEventListener("keydown",this.keydown)}},is,[],!1,null,null,null);ss.options.__file="packages/notification/src/main.vue";var as=ss.exports,ls=hn.a.extend(as),us=void 0,cs=[],hs=1,ds=function t(e){if(!hn.a.prototype.$isServer){var n=(e=Ut()({},e)).onClose,r="notification_"+hs++,i=e.position||"top-right";e.onClose=function(){t.close(r,n)},us=new ls({data:e}),Object(Vi.isVNode)(e.message)&&(us.$slots.default=[e.message],e.message="REPLACED_BY_VNODE"),us.id=r,us.$mount(),document.body.appendChild(us.$el),us.visible=!0,us.dom=us.$el,us.dom.style.zIndex=_.PopupManager.nextZIndex();var o=e.offset||0;return cs.filter(function(t){return t.position===i}).forEach(function(t){o+=t.$el.offsetHeight+16}),o+=16,us.verticalOffset=o,cs.push(us),us}};["success","warning","info","error"].forEach(function(t){ds[t]=function(e){return("string"==typeof e||Object(Vi.isVNode)(e))&&(e={message:e}),e.type=t,ds(e)}}),ds.close=function(t,e){var n=-1,r=cs.length,i=cs.filter(function(e,r){return e.id===t&&(n=r,!0)})[0];if(i&&("function"==typeof e&&e(i),cs.splice(n,1),!(r<=1)))for(var o=i.position,s=i.dom.offsetHeight,a=n;a<r-1;a++)cs[a].position===o&&(cs[a].dom.style[i.verticalProperty]=parseInt(cs[a].dom.style[i.verticalProperty],10)-s-16+"px")},ds.closeAll=function(){for(var t=cs.length-1;t>=0;t--)cs[t].close()};var ps=ds,fs=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"el-slider",class:{"is-vertical":t.vertical,"el-slider--with-input":t.showInput},attrs:{role:"slider","aria-valuemin":t.min,"aria-valuemax":t.max,"aria-orientation":t.vertical?"vertical":"horizontal","aria-disabled":t.sliderDisabled}},[t.showInput&&!t.range?n("el-input-number",{ref:"input",staticClass:"el-slider__input",attrs:{step:t.step,disabled:t.sliderDisabled,controls:t.showInputControls,min:t.min,max:t.max,debounce:t.debounce,size:t.inputSize},on:{change:t.emitChange},model:{value:t.firstValue,callback:function(e){t.firstValue=e},expression:"firstValue"}}):t._e(),n("div",{ref:"slider",staticClass:"el-slider__runway",class:{"show-input":t.showInput,disabled:t.sliderDisabled},style:t.runwayStyle,on:{click:t.onSliderClick}},[n("div",{staticClass:"el-slider__bar",style:t.barStyle}),n("slider-button",{ref:"button1",attrs:{vertical:t.vertical,"tooltip-class":t.tooltipClass},model:{value:t.firstValue,callback:function(e){t.firstValue=e},expression:"firstValue"}}),t.range?n("slider-button",{ref:"button2",attrs:{vertical:t.vertical,"tooltip-class":t.tooltipClass},model:{value:t.secondValue,callback:function(e){t.secondValue=e},expression:"secondValue"}}):t._e(),t._l(t.stops,function(e,r){return t.showStops?n("div",{key:r,staticClass:"el-slider__stop",style:t.getStopStyle(e)}):t._e()}),t.markList.length>0?[n("div",t._l(t.markList,function(e,r){return n("div",{key:r,staticClass:"el-slider__stop el-slider__marks-stop",style:t.getStopStyle(e.position)})}),0),n("div",{staticClass:"el-slider__marks"},t._l(t.markList,function(e,r){return n("slider-marker",{key:r,style:t.getStopStyle(e.position),attrs:{mark:e.mark}})}),1)]:t._e()],2)],1)};fs._withStripped=!0;var gs=n(41),ms=n.n(gs),vs=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{ref:"button",staticClass:"el-slider__button-wrapper",class:{hover:t.hovering,dragging:t.dragging},style:t.wrapperStyle,attrs:{tabindex:"0"},on:{mouseenter:t.handleMouseEnter,mouseleave:t.handleMouseLeave,mousedown:t.onButtonDown,touchstart:t.onButtonDown,focus:t.handleMouseEnter,blur:t.handleMouseLeave,keydown:[function(e){return"button"in e||!t._k(e.keyCode,"left",37,e.key,["Left","ArrowLeft"])?"button"in e&&0!==e.button?null:t.onLeftKeyDown(e):null},function(e){return"button"in e||!t._k(e.keyCode,"right",39,e.key,["Right","ArrowRight"])?"button"in e&&2!==e.button?null:t.onRightKeyDown(e):null},function(e){return"button"in e||!t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"])?(e.preventDefault(),t.onLeftKeyDown(e)):null},function(e){return"button"in e||!t._k(e.keyCode,"up",38,e.key,["Up","ArrowUp"])?(e.preventDefault(),t.onRightKeyDown(e)):null}]}},[n("el-tooltip",{ref:"tooltip",attrs:{placement:"top","popper-class":t.tooltipClass,disabled:!t.showTooltip}},[n("span",{attrs:{slot:"content"},slot:"content"},[t._v(t._s(t.formatValue))]),n("div",{staticClass:"el-slider__button",class:{hover:t.hovering,dragging:t.dragging}})])],1)};vs._withStripped=!0;var bs=i({name:"ElSliderButton",components:{ElTooltip:kt.a},props:{value:{type:Number,default:0},vertical:{type:Boolean,default:!1},tooltipClass:String},data:function(){return{hovering:!1,dragging:!1,isClick:!1,startX:0,currentX:0,startY:0,currentY:0,startPosition:0,newPosition:null,oldValue:this.value}},computed:{disabled:function(){return this.$parent.sliderDisabled},max:function(){return this.$parent.max},min:function(){return this.$parent.min},step:function(){return this.$parent.step},showTooltip:function(){return this.$parent.showTooltip},precision:function(){return this.$parent.precision},currentPosition:function(){return(this.value-this.min)/(this.max-this.min)*100+"%"},enableFormat:function(){return this.$parent.formatTooltip instanceof Function},formatValue:function(){return this.enableFormat&&this.$parent.formatTooltip(this.value)||this.value},wrapperStyle:function(){return this.vertical?{bottom:this.currentPosition}:{left:this.currentPosition}}},watch:{dragging:function(t){this.$parent.dragging=t}},methods:{displayTooltip:function(){this.$refs.tooltip&&(this.$refs.tooltip.showPopper=!0)},hideTooltip:function(){this.$refs.tooltip&&(this.$refs.tooltip.showPopper=!1)},handleMouseEnter:function(){this.hovering=!0,this.displayTooltip()},handleMouseLeave:function(){this.hovering=!1,this.hideTooltip()},onButtonDown:function(t){this.disabled||(t.preventDefault(),this.onDragStart(t),window.addEventListener("mousemove",this.onDragging),window.addEventListener("touchmove",this.onDragging),window.addEventListener("mouseup",this.onDragEnd),window.addEventListener("touchend",this.onDragEnd),window.addEventListener("contextmenu",this.onDragEnd))},onLeftKeyDown:function(){this.disabled||(this.newPosition=parseFloat(this.currentPosition)-this.step/(this.max-this.min)*100,this.setPosition(this.newPosition),this.$parent.emitChange())},onRightKeyDown:function(){this.disabled||(this.newPosition=parseFloat(this.currentPosition)+this.step/(this.max-this.min)*100,this.setPosition(this.newPosition),this.$parent.emitChange())},onDragStart:function(t){this.dragging=!0,this.isClick=!0,"touchstart"===t.type&&(t.clientY=t.touches[0].clientY,t.clientX=t.touches[0].clientX),this.vertical?this.startY=t.clientY:this.startX=t.clientX,this.startPosition=parseFloat(this.currentPosition),this.newPosition=this.startPosition},onDragging:function(t){if(this.dragging){this.isClick=!1,this.displayTooltip(),this.$parent.resetSize();var e=0;"touchmove"===t.type&&(t.clientY=t.touches[0].clientY,t.clientX=t.touches[0].clientX),this.vertical?(this.currentY=t.clientY,e=(this.startY-this.currentY)/this.$parent.sliderSize*100):(this.currentX=t.clientX,e=(this.currentX-this.startX)/this.$parent.sliderSize*100),this.newPosition=this.startPosition+e,this.setPosition(this.newPosition)}},onDragEnd:function(){var t=this;this.dragging&&(setTimeout(function(){t.dragging=!1,t.hideTooltip(),t.isClick||(t.setPosition(t.newPosition),t.$parent.emitChange())},0),window.removeEventListener("mousemove",this.onDragging),window.removeEventListener("touchmove",this.onDragging),window.removeEventListener("mouseup",this.onDragEnd),window.removeEventListener("touchend",this.onDragEnd),window.removeEventListener("contextmenu",this.onDragEnd))},setPosition:function(t){var e=this;if(null!==t&&!isNaN(t)){t<0?t=0:t>100&&(t=100);var n=100/((this.max-this.min)/this.step),r=Math.round(t/n)*n*(this.max-this.min)*.01+this.min;r=parseFloat(r.toFixed(this.precision)),this.$emit("input",r),this.$nextTick(function(){e.displayTooltip(),e.$refs.tooltip&&e.$refs.tooltip.updatePopper()}),this.dragging||this.value===this.oldValue||(this.oldValue=this.value)}}}},vs,[],!1,null,null,null);bs.options.__file="packages/slider/src/button.vue";var _s=bs.exports,ys={name:"ElMarker",props:{mark:{type:[String,Object]}},render:function(){var t=arguments[0],e="string"==typeof this.mark?this.mark:this.mark.label;return t("div",{class:"el-slider__marks-text",style:this.mark.style||{}},[e])}},Ts=i({name:"ElSlider",mixins:[w.a],inject:{elForm:{default:""}},props:{min:{type:Number,default:0},max:{type:Number,default:100},step:{type:Number,default:1},value:{type:[Number,Array],default:0},showInput:{type:Boolean,default:!1},showInputControls:{type:Boolean,default:!0},inputSize:{type:String,default:"small"},showStops:{type:Boolean,default:!1},showTooltip:{type:Boolean,default:!0},formatTooltip:Function,disabled:{type:Boolean,default:!1},range:{type:Boolean,default:!1},vertical:{type:Boolean,default:!1},height:{type:String},debounce:{type:Number,default:300},label:{type:String},tooltipClass:String,marks:Object},components:{ElInputNumber:ms.a,SliderButton:_s,SliderMarker:ys},data:function(){return{firstValue:null,secondValue:null,oldValue:null,dragging:!1,sliderSize:1}},watch:{value:function(t,e){this.dragging||Array.isArray(t)&&Array.isArray(e)&&t.every(function(t,n){return t===e[n]})||this.setValues()},dragging:function(t){t||this.setValues()},firstValue:function(t){this.range?this.$emit("input",[this.minValue,this.maxValue]):this.$emit("input",t)},secondValue:function(){this.range&&this.$emit("input",[this.minValue,this.maxValue])},min:function(){this.setValues()},max:function(){this.setValues()}},methods:{valueChanged:function(){var t=this;return this.range?![this.minValue,this.maxValue].every(function(e,n){return e===t.oldValue[n]}):this.value!==this.oldValue},setValues:function(){if(this.min>this.max)console.error("[Element Error][Slider]min should not be greater than max.");else{var t=this.value;this.range&&Array.isArray(t)?t[1]<this.min?this.$emit("input",[this.min,this.min]):t[0]>this.max?this.$emit("input",[this.max,this.max]):t[0]<this.min?this.$emit("input",[this.min,t[1]]):t[1]>this.max?this.$emit("input",[t[0],this.max]):(this.firstValue=t[0],this.secondValue=t[1],this.valueChanged()&&(this.dispatch("ElFormItem","el.form.change",[this.minValue,this.maxValue]),this.oldValue=t.slice())):this.range||"number"!=typeof t||isNaN(t)||(t<this.min?this.$emit("input",this.min):t>this.max?this.$emit("input",this.max):(this.firstValue=t,this.valueChanged()&&(this.dispatch("ElFormItem","el.form.change",t),this.oldValue=t)))}},setPosition:function(t){var e=this.min+t*(this.max-this.min)/100;if(this.range){var n=void 0;n=Math.abs(this.minValue-e)<Math.abs(this.maxValue-e)?this.firstValue<this.secondValue?"button1":"button2":this.firstValue>this.secondValue?"button1":"button2",this.$refs[n].setPosition(t)}else this.$refs.button1.setPosition(t)},onSliderClick:function(t){if(!this.sliderDisabled&&!this.dragging){if(this.resetSize(),this.vertical){var e=this.$refs.slider.getBoundingClientRect().bottom;this.setPosition((e-t.clientY)/this.sliderSize*100)}else{var n=this.$refs.slider.getBoundingClientRect().left;this.setPosition((t.clientX-n)/this.sliderSize*100)}this.emitChange()}},resetSize:function(){this.$refs.slider&&(this.sliderSize=this.$refs.slider["client"+(this.vertical?"Height":"Width")])},emitChange:function(){var t=this;this.$nextTick(function(){t.$emit("change",t.range?[t.minValue,t.maxValue]:t.value)})},getStopStyle:function(t){return this.vertical?{bottom:t+"%"}:{left:t+"%"}}},computed:{stops:function(){var t=this;if(!this.showStops||this.min>this.max)return[];if(0===this.step)return[];for(var e=(this.max-this.min)/this.step,n=100*this.step/(this.max-this.min),r=[],i=1;i<e;i++)r.push(i*n);return this.range?r.filter(function(e){return e<100*(t.minValue-t.min)/(t.max-t.min)||e>100*(t.maxValue-t.min)/(t.max-t.min)}):r.filter(function(e){return e>100*(t.firstValue-t.min)/(t.max-t.min)})},markList:function(){var t=this;return this.marks?Object.keys(this.marks).map(parseFloat).sort(function(t,e){return t-e}).filter(function(e){return e<=t.max&&e>=t.min}).map(function(e){return{point:e,position:100*(e-t.min)/(t.max-t.min),mark:t.marks[e]}}):[]},minValue:function(){return Math.min(this.firstValue,this.secondValue)},maxValue:function(){return Math.max(this.firstValue,this.secondValue)},barSize:function(){return this.range?100*(this.maxValue-this.minValue)/(this.max-this.min)+"%":100*(this.firstValue-this.min)/(this.max-this.min)+"%"},barStart:function(){return this.range?100*(this.minValue-this.min)/(this.max-this.min)+"%":"0%"},precision:function(){var t=[this.min,this.max,this.step].map(function(t){var e=(""+t).split(".")[1];return e?e.length:0});return Math.max.apply(null,t)},runwayStyle:function(){return this.vertical?{height:this.height}:{}},barStyle:function(){return this.vertical?{height:this.barSize,bottom:this.barStart}:{width:this.barSize,left:this.barStart}},sliderDisabled:function(){return this.disabled||(this.elForm||{}).disabled}},mounted:function(){var t=void 0;this.range?(Array.isArray(this.value)?(this.firstValue=Math.max(this.min,this.value[0]),this.secondValue=Math.min(this.max,this.value[1])):(this.firstValue=this.min,this.secondValue=this.max),this.oldValue=[this.firstValue,this.secondValue],t=this.firstValue+"-"+this.secondValue):("number"!=typeof this.value||isNaN(this.value)?this.firstValue=this.min:this.firstValue=Math.min(this.max,Math.max(this.min,this.value)),this.oldValue=this.firstValue,t=this.firstValue),this.$el.setAttribute("aria-valuetext",t),this.$el.setAttribute("aria-label",this.label?this.label:"slider between "+this.min+" and "+this.max),this.resetSize(),window.addEventListener("resize",this.resetSize)},beforeDestroy:function(){window.removeEventListener("resize",this.resetSize)}},fs,[],!1,null,null,null);Ts.options.__file="packages/slider/src/main.vue";var xs=Ts.exports;xs.install=function(t){t.component(xs.name,xs)};var Es=xs,ws=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("transition",{attrs:{name:"el-loading-fade"},on:{"after-leave":t.handleAfterLeave}},[n("div",{directives:[{name:"show",rawName:"v-show",value:t.visible,expression:"visible"}],staticClass:"el-loading-mask",class:[t.customClass,{"is-fullscreen":t.fullscreen}],style:{backgroundColor:t.background||""}},[n("div",{staticClass:"el-loading-spinner"},[t.spinner?n("i",{class:t.spinner}):n("svg",{staticClass:"circular",attrs:{viewBox:"25 25 50 50"}},[n("circle",{staticClass:"path",attrs:{cx:"50",cy:"50",r:"20",fill:"none"}})]),t.text?n("p",{staticClass:"el-loading-text"},[t._v(t._s(t.text))]):t._e()])])])};ws._withStripped=!0;var Cs=i({data:function(){return{text:null,spinner:null,background:null,fullscreen:!0,visible:!1,customClass:""}},methods:{handleAfterLeave:function(){this.$emit("after-leave")},setText:function(t){this.text=t}}},ws,[],!1,null,null,null);Cs.options.__file="packages/loading/src/loading.vue";var Ss=Cs.exports,ks=n(32),Os=n.n(ks),Is=hn.a.extend(Ss),Rs={install:function(t){if(!t.prototype.$isServer){var e=function(e,r){r.value?t.nextTick(function(){r.modifiers.fullscreen?(e.originalPosition=Object(ft.getStyle)(document.body,"position"),e.originalOverflow=Object(ft.getStyle)(document.body,"overflow"),e.maskStyle.zIndex=_.PopupManager.nextZIndex(),Object(ft.addClass)(e.mask,"is-fullscreen"),n(document.body,e,r)):(Object(ft.removeClass)(e.mask,"is-fullscreen"),r.modifiers.body?(e.originalPosition=Object(ft.getStyle)(document.body,"position"),["top","left"].forEach(function(t){var n="top"===t?"scrollTop":"scrollLeft";e.maskStyle[t]=e.getBoundingClientRect()[t]+document.body[n]+document.documentElement[n]-parseInt(Object(ft.getStyle)(document.body,"margin-"+t),10)+"px"}),["height","width"].forEach(function(t){e.maskStyle[t]=e.getBoundingClientRect()[t]+"px"}),n(document.body,e,r)):(e.originalPosition=Object(ft.getStyle)(e,"position"),n(e,e,r)))}):(Os()(e.instance,function(t){if(e.instance.hiding){e.domVisible=!1;var n=r.modifiers.fullscreen||r.modifiers.body?document.body:e;Object(ft.removeClass)(n,"el-loading-parent--relative"),Object(ft.removeClass)(n,"el-loading-parent--hidden"),e.instance.hiding=!1}},300,!0),e.instance.visible=!1,e.instance.hiding=!0)},n=function(e,n,r){n.domVisible||"none"===Object(ft.getStyle)(n,"display")||"hidden"===Object(ft.getStyle)(n,"visibility")?n.domVisible&&!0===n.instance.hiding&&(n.instance.visible=!0,n.instance.hiding=!1):(Object.keys(n.maskStyle).forEach(function(t){n.mask.style[t]=n.maskStyle[t]}),"absolute"!==n.originalPosition&&"fixed"!==n.originalPosition&&Object(ft.addClass)(e,"el-loading-parent--relative"),r.modifiers.fullscreen&&r.modifiers.lock&&Object(ft.addClass)(e,"el-loading-parent--hidden"),n.domVisible=!0,e.appendChild(n.mask),t.nextTick(function(){n.instance.hiding?n.instance.$emit("after-leave"):n.instance.visible=!0}),n.domInserted=!0)};t.directive("loading",{bind:function(t,n,r){var i=t.getAttribute("element-loading-text"),o=t.getAttribute("element-loading-spinner"),s=t.getAttribute("element-loading-background"),a=t.getAttribute("element-loading-custom-class"),l=r.context,u=new Is({el:document.createElement("div"),data:{text:l&&l[i]||i,spinner:l&&l[o]||o,background:l&&l[s]||s,customClass:l&&l[a]||a,fullscreen:!!n.modifiers.fullscreen}});t.instance=u,t.mask=u.$el,t.maskStyle={},n.value&&e(t,n)},update:function(t,n){t.instance.setText(t.getAttribute("element-loading-text")),n.oldValue!==n.value&&e(t,n)},unbind:function(t,n){t.domInserted&&(t.mask&&t.mask.parentNode&&t.mask.parentNode.removeChild(t.mask),e(t,{value:!1,modifiers:n.modifiers})),t.instance&&t.instance.$destroy()}})}}},As=Rs,Ns=hn.a.extend(Ss),Ds={text:null,fullscreen:!0,body:!1,lock:!1,customClass:""},Ms=void 0;Ns.prototype.originalPosition="",Ns.prototype.originalOverflow="",Ns.prototype.close=function(){var t=this;this.fullscreen&&(Ms=void 0),Os()(this,function(e){var n=t.fullscreen||t.body?document.body:t.target;Object(ft.removeClass)(n,"el-loading-parent--relative"),Object(ft.removeClass)(n,"el-loading-parent--hidden"),t.$el&&t.$el.parentNode&&t.$el.parentNode.removeChild(t.$el),t.$destroy()},300),this.visible=!1};var Ls=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!hn.a.prototype.$isServer){if("string"==typeof(t=Ut()({},Ds,t)).target&&(t.target=document.querySelector(t.target)),t.target=t.target||document.body,t.target!==document.body?t.fullscreen=!1:t.body=!0,t.fullscreen&&Ms)return Ms;var e=t.body?document.body:t.target,n=new Ns({el:document.createElement("div"),data:t});return function(t,e,n){var r={};t.fullscreen?(n.originalPosition=Object(ft.getStyle)(document.body,"position"),n.originalOverflow=Object(ft.getStyle)(document.body,"overflow"),r.zIndex=_.PopupManager.nextZIndex()):t.body?(n.originalPosition=Object(ft.getStyle)(document.body,"position"),["top","left"].forEach(function(e){var n="top"===e?"scrollTop":"scrollLeft";r[e]=t.target.getBoundingClientRect()[e]+document.body[n]+document.documentElement[n]+"px"}),["height","width"].forEach(function(e){r[e]=t.target.getBoundingClientRect()[e]+"px"})):n.originalPosition=Object(ft.getStyle)(e,"position"),Object.keys(r).forEach(function(t){n.$el.style[t]=r[t]})}(t,e,n),"absolute"!==n.originalPosition&&"fixed"!==n.originalPosition&&Object(ft.addClass)(e,"el-loading-parent--relative"),t.fullscreen&&t.lock&&Object(ft.addClass)(e,"el-loading-parent--hidden"),e.appendChild(n.$el),hn.a.nextTick(function(){n.visible=!0}),t.fullscreen&&(Ms=n),n}},Ps={install:function(t){t.use(As),t.prototype.$loading=Ls},directive:As,service:Ls},Fs=function(){var t=this.$createElement;return(this._self._c||t)("i",{class:"el-icon-"+this.name})};Fs._withStripped=!0;var Bs=i({name:"ElIcon",props:{name:String}},Fs,[],!1,null,null,null);Bs.options.__file="packages/icon/src/icon.vue";var js=Bs.exports;js.install=function(t){t.component(js.name,js)};var $s=js,Us={name:"ElRow",componentName:"ElRow",props:{tag:{type:String,default:"div"},gutter:Number,type:String,justify:{type:String,default:"start"},align:String},computed:{style:function(){var t={};return this.gutter&&(t.marginLeft="-"+this.gutter/2+"px",t.marginRight=t.marginLeft),t}},render:function(t){return t(this.tag,{class:["el-row","start"!==this.justify?"is-justify-"+this.justify:"",this.align?"is-align-"+this.align:"",{"el-row--flex":"flex"===this.type}],style:this.style},this.$slots.default)},install:function(t){t.component(Us.name,Us)}},Vs=Us,Hs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ws={name:"ElCol",props:{span:{type:Number,default:24},tag:{type:String,default:"div"},offset:Number,pull:Number,push:Number,xs:[Number,Object],sm:[Number,Object],md:[Number,Object],lg:[Number,Object],xl:[Number,Object]},computed:{gutter:function(){for(var t=this.$parent;t&&"ElRow"!==t.$options.componentName;)t=t.$parent;return t?t.gutter:0}},render:function(t){var e=this,n=[],r={};return this.gutter&&(r.paddingLeft=this.gutter/2+"px",r.paddingRight=r.paddingLeft),["span","offset","pull","push"].forEach(function(t){(e[t]||0===e[t])&&n.push("span"!==t?"el-col-"+t+"-"+e[t]:"el-col-"+e[t])}),["xs","sm","md","lg","xl"].forEach(function(t){if("number"==typeof e[t])n.push("el-col-"+t+"-"+e[t]);else if("object"===Hs(e[t])){var r=e[t];Object.keys(r).forEach(function(e){n.push("span"!==e?"el-col-"+t+"-"+e+"-"+r[e]:"el-col-"+t+"-"+r[e])})}}),t(this.tag,{class:["el-col",n],style:r},this.$slots.default)},install:function(t){t.component(Ws.name,Ws)}},Gs=Ws,zs=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("transition-group",{class:["el-upload-list","el-upload-list--"+t.listType,{"is-disabled":t.disabled}],attrs:{tag:"ul",name:"el-list"}},t._l(t.files,function(e){return n("li",{key:e.uid,class:["el-upload-list__item","is-"+e.status,t.focusing?"focusing":""],attrs:{tabindex:"0"},on:{keydown:function(n){if(!("button"in n)&&t._k(n.keyCode,"delete",[8,46],n.key,["Backspace","Delete","Del"]))return null;!t.disabled&&t.$emit("remove",e)},focus:function(e){t.focusing=!0},blur:function(e){t.focusing=!1},click:function(e){t.focusing=!1}}},[t._t("default",["uploading"!==e.status&&["picture-card","picture"].indexOf(t.listType)>-1?n("img",{staticClass:"el-upload-list__item-thumbnail",attrs:{src:e.url,alt:""}}):t._e(),n("a",{staticClass:"el-upload-list__item-name",on:{click:function(n){t.handleClick(e)}}},[n("i",{staticClass:"el-icon-document"}),t._v(t._s(e.name)+"\n ")]),n("label",{staticClass:"el-upload-list__item-status-label"},[n("i",{class:{"el-icon-upload-success":!0,"el-icon-circle-check":"text"===t.listType,"el-icon-check":["picture-card","picture"].indexOf(t.listType)>-1}})]),t.disabled?t._e():n("i",{staticClass:"el-icon-close",on:{click:function(n){t.$emit("remove",e)}}}),t.disabled?t._e():n("i",{staticClass:"el-icon-close-tip"},[t._v(t._s(t.t("el.upload.deleteTip")))]),"uploading"===e.status?n("el-progress",{attrs:{type:"picture-card"===t.listType?"circle":"line","stroke-width":"picture-card"===t.listType?6:2,percentage:t.parsePercentage(e.percentage)}}):t._e(),"picture-card"===t.listType?n("span",{staticClass:"el-upload-list__item-actions"},[t.handlePreview&&"picture-card"===t.listType?n("span",{staticClass:"el-upload-list__item-preview",on:{click:function(n){t.handlePreview(e)}}},[n("i",{staticClass:"el-icon-zoom-in"})]):t._e(),t.disabled?t._e():n("span",{staticClass:"el-upload-list__item-delete",on:{click:function(n){t.$emit("remove",e)}}},[n("i",{staticClass:"el-icon-delete"})])]):t._e()],{file:e})],2)}),0)};zs._withStripped=!0;var Xs=n(33),Ks=n.n(Xs),Ys=i({name:"ElUploadList",mixins:[f.a],data:function(){return{focusing:!1}},components:{ElProgress:Ks.a},props:{files:{type:Array,default:function(){return[]}},disabled:{type:Boolean,default:!1},handlePreview:Function,listType:String},methods:{parsePercentage:function(t){return parseInt(t,10)},handleClick:function(t){this.handlePreview&&this.handlePreview(t)}}},zs,[],!1,null,null,null);Ys.options.__file="packages/upload/src/upload-list.vue";var qs=Ys.exports,Js=n(24),Zs=n.n(Js);var Qs=function(){var t=this,e=t.$createElement;return(t._self._c||e)("div",{staticClass:"el-upload-dragger",class:{"is-dragover":t.dragover},on:{drop:function(e){return e.preventDefault(),t.onDrop(e)},dragover:function(e){return e.preventDefault(),t.onDragover(e)},dragleave:function(e){e.preventDefault(),t.dragover=!1}}},[t._t("default")],2)};Qs._withStripped=!0;var ta=i({name:"ElUploadDrag",props:{disabled:Boolean},inject:{uploader:{default:""}},data:function(){return{dragover:!1}},methods:{onDragover:function(){this.disabled||(this.dragover=!0)},onDrop:function(t){if(!this.disabled&&this.uploader){var e=this.uploader.accept;this.dragover=!1,e?this.$emit("file",[].slice.call(t.dataTransfer.files).filter(function(t){var n=t.type,r=t.name,i=r.indexOf(".")>-1?"."+r.split(".").pop():"",o=n.replace(/\/.*$/,"");return e.split(",").map(function(t){return t.trim()}).filter(function(t){return t}).some(function(t){return/\..+$/.test(t)?i===t:/\/\*$/.test(t)?o===t.replace(/\/\*$/,""):!!/^[^\/]+\/[^\/]+$/.test(t)&&n===t})})):this.$emit("file",t.dataTransfer.files)}}}},Qs,[],!1,null,null,null);ta.options.__file="packages/upload/src/upload-dragger.vue";var ea=i({inject:["uploader"],components:{UploadDragger:ta.exports},props:{type:String,action:{type:String,required:!0},name:{type:String,default:"file"},data:Object,headers:Object,withCredentials:Boolean,multiple:Boolean,accept:String,onStart:Function,onProgress:Function,onSuccess:Function,onError:Function,beforeUpload:Function,drag:Boolean,onPreview:{type:Function,default:function(){}},onRemove:{type:Function,default:function(){}},fileList:Array,autoUpload:Boolean,listType:String,httpRequest:{type:Function,default:function(t){if("undefined"!=typeof XMLHttpRequest){var e=new XMLHttpRequest,n=t.action;e.upload&&(e.upload.onprogress=function(e){e.total>0&&(e.percent=e.loaded/e.total*100),t.onProgress(e)});var r=new FormData;t.data&&Object.keys(t.data).forEach(function(e){r.append(e,t.data[e])}),r.append(t.filename,t.file,t.file.name),e.onerror=function(e){t.onError(e)},e.onload=function(){if(e.status<200||e.status>=300)return t.onError(function(t,e,n){var r=void 0;r=n.response?""+(n.response.error||n.response):n.responseText?""+n.responseText:"fail to post "+t+" "+n.status;var i=new Error(r);return i.status=n.status,i.method="post",i.url=t,i}(n,0,e));t.onSuccess(function(t){var e=t.responseText||t.response;if(!e)return e;try{return JSON.parse(e)}catch(t){return e}}(e))},e.open("post",n,!0),t.withCredentials&&"withCredentials"in e&&(e.withCredentials=!0);var i=t.headers||{};for(var o in i)i.hasOwnProperty(o)&&null!==i[o]&&e.setRequestHeader(o,i[o]);return e.send(r),e}}},disabled:Boolean,limit:Number,onExceed:Function},data:function(){return{mouseover:!1,reqs:{}}},methods:{isImage:function(t){return-1!==t.indexOf("image")},handleChange:function(t){var e=t.target.files;e&&this.uploadFiles(e)},uploadFiles:function(t){var e=this;if(this.limit&&this.fileList.length+t.length>this.limit)this.onExceed&&this.onExceed(t,this.fileList);else{var n=Array.prototype.slice.call(t);this.multiple||(n=n.slice(0,1)),0!==n.length&&n.forEach(function(t){e.onStart(t),e.autoUpload&&e.upload(t)})}},upload:function(t){var e=this;if(this.$refs.input.value=null,!this.beforeUpload)return this.post(t);var n=this.beforeUpload(t);n&&n.then?n.then(function(n){var r=Object.prototype.toString.call(n);if("[object File]"===r||"[object Blob]"===r){for(var i in"[object Blob]"===r&&(n=new File([n],t.name,{type:t.type})),t)t.hasOwnProperty(i)&&(n[i]=t[i]);e.post(n)}else e.post(t)},function(){e.onRemove(null,t)}):!1!==n?this.post(t):this.onRemove(null,t)},abort:function(t){var e=this.reqs;if(t){var n=t;t.uid&&(n=t.uid),e[n]&&e[n].abort()}else Object.keys(e).forEach(function(t){e[t]&&e[t].abort(),delete e[t]})},post:function(t){var e=this,n=t.uid,r={headers:this.headers,withCredentials:this.withCredentials,file:t,data:this.data,filename:this.name,action:this.action,onProgress:function(n){e.onProgress(n,t)},onSuccess:function(r){e.onSuccess(r,t),delete e.reqs[n]},onError:function(r){e.onError(r,t),delete e.reqs[n]}},i=this.httpRequest(r);this.reqs[n]=i,i&&i.then&&i.then(r.onSuccess,r.onError)},handleClick:function(){this.disabled||(this.$refs.input.value=null,this.$refs.input.click())},handleKeydown:function(t){t.target===t.currentTarget&&(13!==t.keyCode&&32!==t.keyCode||this.handleClick())}},render:function(t){var e=this.handleClick,n=this.drag,r=this.name,i=this.handleChange,o=this.multiple,s=this.accept,a=this.listType,l=this.uploadFiles,u=this.disabled,c={class:{"el-upload":!0},on:{click:e,keydown:this.handleKeydown}};return c.class["el-upload--"+a]=!0,t("div",Zs()([c,{attrs:{tabindex:"0"}}]),[n?t("upload-dragger",{attrs:{disabled:u},on:{file:l}},[this.$slots.default]):this.$slots.default,t("input",{class:"el-upload__input",attrs:{type:"file",name:r,multiple:o,accept:s},ref:"input",on:{change:i}})])}},void 0,void 0,!1,null,null,null);ea.options.__file="packages/upload/src/upload.vue";var na=ea.exports;function ra(){}var ia=i({name:"ElUpload",mixins:[x.a],components:{ElProgress:Ks.a,UploadList:qs,Upload:na},provide:function(){return{uploader:this}},inject:{elForm:{default:""}},props:{action:{type:String,required:!0},headers:{type:Object,default:function(){return{}}},data:Object,multiple:Boolean,name:{type:String,default:"file"},drag:Boolean,dragger:Boolean,withCredentials:Boolean,showFileList:{type:Boolean,default:!0},accept:String,type:{type:String,default:"select"},beforeUpload:Function,beforeRemove:Function,onRemove:{type:Function,default:ra},onChange:{type:Function,default:ra},onPreview:{type:Function},onSuccess:{type:Function,default:ra},onProgress:{type:Function,default:ra},onError:{type:Function,default:ra},fileList:{type:Array,default:function(){return[]}},autoUpload:{type:Boolean,default:!0},listType:{type:String,default:"text"},httpRequest:Function,disabled:Boolean,limit:Number,onExceed:{type:Function,default:ra}},data:function(){return{uploadFiles:[],dragOver:!1,draging:!1,tempIndex:1}},computed:{uploadDisabled:function(){return this.disabled||(this.elForm||{}).disabled}},watch:{listType:function(t){"picture-card"!==t&&"picture"!==t||(this.uploadFiles=this.uploadFiles.map(function(t){if(!t.url&&t.raw)try{t.url=URL.createObjectURL(t.raw)}catch(t){console.error("[Element Error][Upload]",t)}return t}))},fileList:{immediate:!0,handler:function(t){var e=this;this.uploadFiles=t.map(function(t){return t.uid=t.uid||Date.now()+e.tempIndex++,t.status=t.status||"success",t})}}},methods:{handleStart:function(t){t.uid=Date.now()+this.tempIndex++;var e={status:"ready",name:t.name,size:t.size,percentage:0,uid:t.uid,raw:t};if("picture-card"===this.listType||"picture"===this.listType)try{e.url=URL.createObjectURL(t)}catch(t){return void console.error("[Element Error][Upload]",t)}this.uploadFiles.push(e),this.onChange(e,this.uploadFiles)},handleProgress:function(t,e){var n=this.getFile(e);this.onProgress(t,n,this.uploadFiles),n.status="uploading",n.percentage=t.percent||0},handleSuccess:function(t,e){var n=this.getFile(e);n&&(n.status="success",n.response=t,this.onSuccess(t,n,this.uploadFiles),this.onChange(n,this.uploadFiles))},handleError:function(t,e){var n=this.getFile(e),r=this.uploadFiles;n.status="fail",r.splice(r.indexOf(n),1),this.onError(t,n,this.uploadFiles),this.onChange(n,this.uploadFiles)},handleRemove:function(t,e){var n=this;e&&(t=this.getFile(e));var r=function(){n.abort(t);var e=n.uploadFiles;e.splice(e.indexOf(t),1),n.onRemove(t,e)};if(this.beforeRemove){if("function"==typeof this.beforeRemove){var i=this.beforeRemove(t,this.uploadFiles);i&&i.then?i.then(function(){r()},ra):!1!==i&&r()}}else r()},getFile:function(t){var e=void 0;return this.uploadFiles.every(function(n){return!(e=t.uid===n.uid?n:null)}),e},abort:function(t){this.$refs["upload-inner"].abort(t)},clearFiles:function(){this.uploadFiles=[]},submit:function(){var t=this;this.uploadFiles.filter(function(t){return"ready"===t.status}).forEach(function(e){t.$refs["upload-inner"].upload(e.raw)})},getMigratingConfig:function(){return{props:{"default-file-list":"default-file-list is renamed to file-list.","show-upload-list":"show-upload-list is renamed to show-file-list.","thumbnail-mode":"thumbnail-mode has been deprecated, you can implement the same effect according to this case: http://element.eleme.io/#/zh-CN/component/upload#yong-hu-tou-xiang-shang-chuan"}}}},beforeDestroy:function(){this.uploadFiles.forEach(function(t){t.url&&0===t.url.indexOf("blob:")&&URL.revokeObjectURL(t.url)})},render:function(t){var e=this,n=void 0;this.showFileList&&(n=t(qs,{attrs:{disabled:this.uploadDisabled,listType:this.listType,files:this.uploadFiles,handlePreview:this.onPreview},on:{remove:this.handleRemove}},[function(t){if(e.$scopedSlots.file)return e.$scopedSlots.file({file:t.file})}]));var r=t("upload",{props:{type:this.type,drag:this.drag,action:this.action,multiple:this.multiple,"before-upload":this.beforeUpload,"with-credentials":this.withCredentials,headers:this.headers,name:this.name,data:this.data,accept:this.accept,fileList:this.uploadFiles,autoUpload:this.autoUpload,listType:this.listType,disabled:this.uploadDisabled,limit:this.limit,"on-exceed":this.onExceed,"on-start":this.handleStart,"on-progress":this.handleProgress,"on-success":this.handleSuccess,"on-error":this.handleError,"on-preview":this.onPreview,"on-remove":this.handleRemove,"http-request":this.httpRequest},ref:"upload-inner"},[this.$slots.trigger||this.$slots.default]);return t("div",["picture-card"===this.listType?n:"",this.$slots.trigger?[r,this.$slots.default]:r,this.$slots.tip,"picture-card"!==this.listType?n:""])}},void 0,void 0,!1,null,null,null);ia.options.__file="packages/upload/src/index.vue";var oa=ia.exports;oa.install=function(t){t.component(oa.name,oa)};var sa=oa,aa=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"el-progress",class:["el-progress--"+t.type,t.status?"is-"+t.status:"",{"el-progress--without-text":!t.showText,"el-progress--text-inside":t.textInside}],attrs:{role:"progressbar","aria-valuenow":t.percentage,"aria-valuemin":"0","aria-valuemax":"100"}},["line"===t.type?n("div",{staticClass:"el-progress-bar"},[n("div",{staticClass:"el-progress-bar__outer",style:{height:t.strokeWidth+"px"}},[n("div",{staticClass:"el-progress-bar__inner",style:t.barStyle},[t.showText&&t.textInside?n("div",{staticClass:"el-progress-bar__innerText"},[t._v(t._s(t.content))]):t._e()])])]):n("div",{staticClass:"el-progress-circle",style:{height:t.width+"px",width:t.width+"px"}},[n("svg",{attrs:{viewBox:"0 0 100 100"}},[n("path",{staticClass:"el-progress-circle__track",style:t.trailPathStyle,attrs:{d:t.trackPath,stroke:"#e5e9f2","stroke-width":t.relativeStrokeWidth,fill:"none"}}),n("path",{staticClass:"el-progress-circle__path",style:t.circlePathStyle,attrs:{d:t.trackPath,stroke:t.stroke,fill:"none","stroke-linecap":t.strokeLinecap,"stroke-width":t.percentage?t.relativeStrokeWidth:0}})])]),t.showText&&!t.textInside?n("div",{staticClass:"el-progress__text",style:{fontSize:t.progressTextSize+"px"}},[t.status?n("i",{class:t.iconClass}):[t._v(t._s(t.content))]],2):t._e()])};aa._withStripped=!0;var la=i({name:"ElProgress",props:{type:{type:String,default:"line",validator:function(t){return["line","circle","dashboard"].indexOf(t)>-1}},percentage:{type:Number,default:0,required:!0,validator:function(t){return t>=0&&t<=100}},status:{type:String,validator:function(t){return["success","exception","warning"].indexOf(t)>-1}},strokeWidth:{type:Number,default:6},strokeLinecap:{type:String,default:"round"},textInside:{type:Boolean,default:!1},width:{type:Number,default:126},showText:{type:Boolean,default:!0},color:{type:[String,Array,Function],default:""},format:Function},computed:{barStyle:function(){var t={};return t.width=this.percentage+"%",t.backgroundColor=this.getCurrentColor(this.percentage),t},relativeStrokeWidth:function(){return(this.strokeWidth/this.width*100).toFixed(1)},radius:function(){return"circle"===this.type||"dashboard"===this.type?parseInt(50-parseFloat(this.relativeStrokeWidth)/2,10):0},trackPath:function(){var t=this.radius,e="dashboard"===this.type;return"\n M 50 50\n m 0 "+(e?"":"-")+t+"\n a "+t+" "+t+" 0 1 1 0 "+(e?"-":"")+2*t+"\n a "+t+" "+t+" 0 1 1 0 "+(e?"":"-")+2*t+"\n "},perimeter:function(){return 2*Math.PI*this.radius},rate:function(){return"dashboard"===this.type?.75:1},strokeDashoffset:function(){return-1*this.perimeter*(1-this.rate)/2+"px"},trailPathStyle:function(){return{strokeDasharray:this.perimeter*this.rate+"px, "+this.perimeter+"px",strokeDashoffset:this.strokeDashoffset}},circlePathStyle:function(){return{strokeDasharray:this.perimeter*this.rate*(this.percentage/100)+"px, "+this.perimeter+"px",strokeDashoffset:this.strokeDashoffset,transition:"stroke-dasharray 0.6s ease 0s, stroke 0.6s ease"}},stroke:function(){var t=void 0;if(this.color)t=this.getCurrentColor(this.percentage);else switch(this.status){case"success":t="#13ce66";break;case"exception":t="#ff4949";break;case"warning":t="#e6a23c";break;default:t="#20a0ff"}return t},iconClass:function(){return"warning"===this.status?"el-icon-warning":"line"===this.type?"success"===this.status?"el-icon-circle-check":"el-icon-circle-close":"success"===this.status?"el-icon-check":"el-icon-close"},progressTextSize:function(){return"line"===this.type?12+.4*this.strokeWidth:.111111*this.width+2},content:function(){return"function"==typeof this.format?this.format(this.percentage)||"":this.percentage+"%"}},methods:{getCurrentColor:function(t){return"function"==typeof this.color?this.color(t):"string"==typeof this.color?this.color:this.getLevelColor(t)},getLevelColor:function(t){for(var e=this.getColorArray().sort(function(t,e){return t.percentage-e.percentage}),n=0;n<e.length;n++)if(e[n].percentage>t)return e[n].color;return e[e.length-1].color},getColorArray:function(){var t=this.color,e=100/t.length;return t.map(function(t,n){return"string"==typeof t?{color:t,percentage:(n+1)*e}:t})}}},aa,[],!1,null,null,null);la.options.__file="packages/progress/src/progress.vue";var ua=la.exports;ua.install=function(t){t.component(ua.name,ua)};var ca=ua,ha=function(){var t=this.$createElement,e=this._self._c||t;return e("span",{staticClass:"el-spinner"},[e("svg",{staticClass:"el-spinner-inner",style:{width:this.radius/2+"px",height:this.radius/2+"px"},attrs:{viewBox:"0 0 50 50"}},[e("circle",{staticClass:"path",attrs:{cx:"25",cy:"25",r:"20",fill:"none",stroke:this.strokeColor,"stroke-width":this.strokeWidth}})])])};ha._withStripped=!0;var da=i({name:"ElSpinner",props:{type:String,radius:{type:Number,default:100},strokeWidth:{type:Number,default:5},strokeColor:{type:String,default:"#efefef"}}},ha,[],!1,null,null,null);da.options.__file="packages/spinner/src/spinner.vue";var pa=da.exports;pa.install=function(t){t.component(pa.name,pa)};var fa=pa,ga=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("transition",{attrs:{name:"el-message-fade"},on:{"after-leave":t.handleAfterLeave}},[n("div",{directives:[{name:"show",rawName:"v-show",value:t.visible,expression:"visible"}],class:["el-message",t.type&&!t.iconClass?"el-message--"+t.type:"",t.center?"is-center":"",t.showClose?"is-closable":"",t.customClass],style:t.positionStyle,attrs:{role:"alert"},on:{mouseenter:t.clearTimer,mouseleave:t.startTimer}},[t.iconClass?n("i",{class:t.iconClass}):n("i",{class:t.typeClass}),t._t("default",[t.dangerouslyUseHTMLString?n("p",{staticClass:"el-message__content",domProps:{innerHTML:t._s(t.message)}}):n("p",{staticClass:"el-message__content"},[t._v(t._s(t.message))])]),t.showClose?n("i",{staticClass:"el-message__closeBtn el-icon-close",on:{click:t.close}}):t._e()],2)])};ga._withStripped=!0;var ma={success:"success",info:"info",warning:"warning",error:"error"},va=i({data:function(){return{visible:!1,message:"",duration:3e3,type:"info",iconClass:"",customClass:"",onClose:null,showClose:!1,closed:!1,verticalOffset:20,timer:null,dangerouslyUseHTMLString:!1,center:!1}},computed:{typeClass:function(){return this.type&&!this.iconClass?"el-message__icon el-icon-"+ma[this.type]:""},positionStyle:function(){return{top:this.verticalOffset+"px"}}},watch:{closed:function(t){t&&(this.visible=!1)}},methods:{handleAfterLeave:function(){this.$destroy(!0),this.$el.parentNode.removeChild(this.$el)},close:function(){this.closed=!0,"function"==typeof this.onClose&&this.onClose(this)},clearTimer:function(){clearTimeout(this.timer)},startTimer:function(){var t=this;this.duration>0&&(this.timer=setTimeout(function(){t.closed||t.close()},this.duration))},keydown:function(t){27===t.keyCode&&(this.closed||this.close())}},mounted:function(){this.startTimer(),document.addEventListener("keydown",this.keydown)},beforeDestroy:function(){document.removeEventListener("keydown",this.keydown)}},ga,[],!1,null,null,null);va.options.__file="packages/message/src/main.vue";var ba=va.exports,_a=hn.a.extend(ba),ya=void 0,Ta=[],xa=1,Ea=function t(e){if(!hn.a.prototype.$isServer){"string"==typeof(e=e||{})&&(e={message:e});var n=e.onClose,r="message_"+xa++;e.onClose=function(){t.close(r,n)},(ya=new _a({data:e})).id=r,Object(Vi.isVNode)(ya.message)&&(ya.$slots.default=[ya.message],ya.message=null),ya.$mount(),document.body.appendChild(ya.$el);var i=e.offset||20;return Ta.forEach(function(t){i+=t.$el.offsetHeight+16}),ya.verticalOffset=i,ya.visible=!0,ya.$el.style.zIndex=_.PopupManager.nextZIndex(),Ta.push(ya),ya}};["success","warning","info","error"].forEach(function(t){Ea[t]=function(e){return"string"==typeof e&&(e={message:e}),e.type=t,Ea(e)}}),Ea.close=function(t,e){for(var n=Ta.length,r=-1,i=void 0,o=0;o<n;o++)if(t===Ta[o].id){i=Ta[o].$el.offsetHeight,r=o,"function"==typeof e&&e(Ta[o]),Ta.splice(o,1);break}if(!(n<=1||-1===r||r>Ta.length-1))for(var s=r;s<n-1;s++){var a=Ta[s].$el;a.style.top=parseInt(a.style.top,10)-i-16+"px"}},Ea.closeAll=function(){for(var t=Ta.length-1;t>=0;t--)Ta[t].close()};var wa=Ea,Ca=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"el-badge"},[t._t("default"),n("transition",{attrs:{name:"el-zoom-in-center"}},[n("sup",{directives:[{name:"show",rawName:"v-show",value:!t.hidden&&(t.content||0===t.content||t.isDot),expression:"!hidden && (content || content === 0 || isDot)"}],staticClass:"el-badge__content",class:["el-badge__content--"+t.type,{"is-fixed":t.$slots.default,"is-dot":t.isDot}],domProps:{textContent:t._s(t.content)}})])],2)};Ca._withStripped=!0;var Sa=i({name:"ElBadge",props:{value:[String,Number],max:Number,isDot:Boolean,hidden:Boolean,type:{type:String,validator:function(t){return["primary","success","warning","info","danger"].indexOf(t)>-1}}},computed:{content:function(){if(!this.isDot){var t=this.value,e=this.max;return"number"==typeof t&&"number"==typeof e&&e<t?e+"+":t}}}},Ca,[],!1,null,null,null);Sa.options.__file="packages/badge/src/main.vue";var ka=Sa.exports;ka.install=function(t){t.component(ka.name,ka)};var Oa=ka,Ia=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"el-card",class:t.shadow?"is-"+t.shadow+"-shadow":"is-always-shadow"},[t.$slots.header||t.header?n("div",{staticClass:"el-card__header"},[t._t("header",[t._v(t._s(t.header))])],2):t._e(),n("div",{staticClass:"el-card__body",style:t.bodyStyle},[t._t("default")],2)])};Ia._withStripped=!0;var Ra=i({name:"ElCard",props:{header:{},bodyStyle:{},shadow:{type:String}}},Ia,[],!1,null,null,null);Ra.options.__file="packages/card/src/main.vue";var Aa=Ra.exports;Aa.install=function(t){t.component(Aa.name,Aa)};var Na=Aa,Da=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"el-rate",attrs:{role:"slider","aria-valuenow":t.currentValue,"aria-valuetext":t.text,"aria-valuemin":"0","aria-valuemax":t.max,tabindex:"0"},on:{keydown:t.handleKey}},[t._l(t.max,function(e,r){return n("span",{key:r,staticClass:"el-rate__item",style:{cursor:t.rateDisabled?"auto":"pointer"},on:{mousemove:function(n){t.setCurrentValue(e,n)},mouseleave:t.resetCurrentValue,click:function(n){t.selectValue(e)}}},[n("i",{staticClass:"el-rate__icon",class:[t.classes[e-1],{hover:t.hoverIndex===e}],style:t.getIconStyle(e)},[t.showDecimalIcon(e)?n("i",{staticClass:"el-rate__decimal",class:t.decimalIconClass,style:t.decimalStyle}):t._e()])])}),t.showText||t.showScore?n("span",{staticClass:"el-rate__text",style:{color:t.textColor}},[t._v(t._s(t.text))]):t._e()],2)};Da._withStripped=!0;var Ma=n(18),La=i({name:"ElRate",mixins:[x.a],inject:{elForm:{default:""}},data:function(){return{pointerAtLeftHalf:!0,currentValue:this.value,hoverIndex:-1}},props:{value:{type:Number,default:0},lowThreshold:{type:Number,default:2},highThreshold:{type:Number,default:4},max:{type:Number,default:5},colors:{type:[Array,Object],default:function(){return["#F7BA2A","#F7BA2A","#F7BA2A"]}},voidColor:{type:String,default:"#C6D1DE"},disabledVoidColor:{type:String,default:"#EFF2F7"},iconClasses:{type:[Array,Object],default:function(){return["el-icon-star-on","el-icon-star-on","el-icon-star-on"]}},voidIconClass:{type:String,default:"el-icon-star-off"},disabledVoidIconClass:{type:String,default:"el-icon-star-on"},disabled:{type:Boolean,default:!1},allowHalf:{type:Boolean,default:!1},showText:{type:Boolean,default:!1},showScore:{type:Boolean,default:!1},textColor:{type:String,default:"#1f2d3d"},texts:{type:Array,default:function(){return["极差","失望","一般","满意","惊喜"]}},scoreTemplate:{type:String,default:"{value}"}},computed:{text:function(){var t="";return this.showScore?t=this.scoreTemplate.replace(/\{\s*value\s*\}/,this.rateDisabled?this.value:this.currentValue):this.showText&&(t=this.texts[Math.ceil(this.currentValue)-1]),t},decimalStyle:function(){var t="";return this.rateDisabled?t=this.valueDecimal+"%":this.allowHalf&&(t="50%"),{color:this.activeColor,width:t}},valueDecimal:function(){return 100*this.value-100*Math.floor(this.value)},classMap:function(){var t;return Array.isArray(this.iconClasses)?((t={})[this.lowThreshold]=this.iconClasses[0],t[this.highThreshold]={value:this.iconClasses[1],excluded:!0},t[this.max]=this.iconClasses[2],t):this.iconClasses},decimalIconClass:function(){return this.getValueFromMap(this.value,this.classMap)},voidClass:function(){return this.rateDisabled?this.disabledVoidIconClass:this.voidIconClass},activeClass:function(){return this.getValueFromMap(this.currentValue,this.classMap)},colorMap:function(){var t;return Array.isArray(this.colors)?((t={})[this.lowThreshold]=this.colors[0],t[this.highThreshold]={value:this.colors[1],excluded:!0},t[this.max]=this.colors[2],t):this.colors},activeColor:function(){return this.getValueFromMap(this.currentValue,this.colorMap)},classes:function(){var t=[],e=0,n=this.currentValue;for(this.allowHalf&&this.currentValue!==Math.floor(this.currentValue)&&n--;e<n;e++)t.push(this.activeClass);for(;e<this.max;e++)t.push(this.voidClass);return t},rateDisabled:function(){return this.disabled||(this.elForm||{}).disabled}},watch:{value:function(t){this.currentValue=t,this.pointerAtLeftHalf=this.value!==Math.floor(this.value)}},methods:{getMigratingConfig:function(){return{props:{"text-template":"text-template is renamed to score-template."}}},getValueFromMap:function(t,e){var n=Object.keys(e).filter(function(n){var r=e[n];return!!Object(Ma.isObject)(r)&&r.excluded?t<n:t<=n}).sort(function(t,e){return t-e}),r=e[n[0]];return Object(Ma.isObject)(r)?r.value:r||""},showDecimalIcon:function(t){var e=this.rateDisabled&&this.valueDecimal>0&&t-1<this.value&&t>this.value,n=this.allowHalf&&this.pointerAtLeftHalf&&t-.5<=this.currentValue&&t>this.currentValue;return e||n},getIconStyle:function(t){var e=this.rateDisabled?this.disabledVoidColor:this.voidColor;return{color:t<=this.currentValue?this.activeColor:e}},selectValue:function(t){this.rateDisabled||(this.allowHalf&&this.pointerAtLeftHalf?(this.$emit("input",this.currentValue),this.$emit("change",this.currentValue)):(this.$emit("input",t),this.$emit("change",t)))},handleKey:function(t){if(!this.rateDisabled){var e=this.currentValue,n=t.keyCode;38===n||39===n?(this.allowHalf?e+=.5:e+=1,t.stopPropagation(),t.preventDefault()):37!==n&&40!==n||(this.allowHalf?e-=.5:e-=1,t.stopPropagation(),t.preventDefault()),e=(e=e<0?0:e)>this.max?this.max:e,this.$emit("input",e),this.$emit("change",e)}},setCurrentValue:function(t,e){if(!this.rateDisabled){if(this.allowHalf){var n=e.target;Object(ft.hasClass)(n,"el-rate__item")&&(n=n.querySelector(".el-rate__icon")),Object(ft.hasClass)(n,"el-rate__decimal")&&(n=n.parentNode),this.pointerAtLeftHalf=2*e.offsetX<=n.clientWidth,this.currentValue=this.pointerAtLeftHalf?t-.5:t}else this.currentValue=t;this.hoverIndex=t}},resetCurrentValue:function(){this.rateDisabled||(this.allowHalf&&(this.pointerAtLeftHalf=this.value!==Math.floor(this.value)),this.currentValue=this.value,this.hoverIndex=-1)}},created:function(){this.value||this.$emit("input",0)}},Da,[],!1,null,null,null);La.options.__file="packages/rate/src/main.vue";var Pa=La.exports;Pa.install=function(t){t.component(Pa.name,Pa)};var Fa=Pa,Ba=function(){var t=this.$createElement;return(this._self._c||t)("div",{staticClass:"el-steps",class:[!this.simple&&"el-steps--"+this.direction,this.simple&&"el-steps--simple"]},[this._t("default")],2)};Ba._withStripped=!0;var ja=i({name:"ElSteps",mixins:[x.a],props:{space:[Number,String],active:Number,direction:{type:String,default:"horizontal"},alignCenter:Boolean,simple:Boolean,finishStatus:{type:String,default:"finish"},processStatus:{type:String,default:"process"}},data:function(){return{steps:[],stepOffset:0}},methods:{getMigratingConfig:function(){return{props:{center:"center is removed."}}}},watch:{active:function(t,e){this.$emit("change",t,e)},steps:function(t){t.forEach(function(t,e){t.index=e})}}},Ba,[],!1,null,null,null);ja.options.__file="packages/steps/src/steps.vue";var $a=ja.exports;$a.install=function(t){t.component($a.name,$a)};var Ua=$a,Va=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"el-step",class:[!t.isSimple&&"is-"+t.$parent.direction,t.isSimple&&"is-simple",t.isLast&&!t.space&&!t.isCenter&&"is-flex",t.isCenter&&!t.isVertical&&!t.isSimple&&"is-center"],style:t.style},[n("div",{staticClass:"el-step__head",class:"is-"+t.currentStatus},[n("div",{staticClass:"el-step__line",style:t.isLast?"":{marginRight:t.$parent.stepOffset+"px"}},[n("i",{staticClass:"el-step__line-inner",style:t.lineStyle})]),n("div",{staticClass:"el-step__icon",class:"is-"+(t.icon?"icon":"text")},["success"!==t.currentStatus&&"error"!==t.currentStatus?t._t("icon",[t.icon?n("i",{staticClass:"el-step__icon-inner",class:[t.icon]}):t._e(),t.icon||t.isSimple?t._e():n("div",{staticClass:"el-step__icon-inner"},[t._v(t._s(t.index+1))])]):n("i",{staticClass:"el-step__icon-inner is-status",class:["el-icon-"+("success"===t.currentStatus?"check":"close")]})],2)]),n("div",{staticClass:"el-step__main"},[n("div",{ref:"title",staticClass:"el-step__title",class:["is-"+t.currentStatus]},[t._t("title",[t._v(t._s(t.title))])],2),t.isSimple?n("div",{staticClass:"el-step__arrow"}):n("div",{staticClass:"el-step__description",class:["is-"+t.currentStatus]},[t._t("description",[t._v(t._s(t.description))])],2)])])};Va._withStripped=!0;var Ha=i({name:"ElStep",props:{title:String,icon:String,description:String,status:String},data:function(){return{index:-1,lineStyle:{},internalStatus:""}},beforeCreate:function(){this.$parent.steps.push(this)},beforeDestroy:function(){var t=this.$parent.steps,e=t.indexOf(this);e>=0&&t.splice(e,1)},computed:{currentStatus:function(){return this.status||this.internalStatus},prevStatus:function(){var t=this.$parent.steps[this.index-1];return t?t.currentStatus:"wait"},isCenter:function(){return this.$parent.alignCenter},isVertical:function(){return"vertical"===this.$parent.direction},isSimple:function(){return this.$parent.simple},isLast:function(){var t=this.$parent;return t.steps[t.steps.length-1]===this},stepsCount:function(){return this.$parent.steps.length},space:function(){var t=this.isSimple,e=this.$parent.space;return t?"":e},style:function(){var t={},e=this.$parent.steps.length,n="number"==typeof this.space?this.space+"px":this.space?this.space:100/(e-(this.isCenter?0:1))+"%";return t.flexBasis=n,this.isVertical?t:(this.isLast?t.maxWidth=100/this.stepsCount+"%":t.marginRight=-this.$parent.stepOffset+"px",t)}},methods:{updateStatus:function(t){var e=this.$parent.$children[this.index-1];t>this.index?this.internalStatus=this.$parent.finishStatus:t===this.index&&"error"!==this.prevStatus?this.internalStatus=this.$parent.processStatus:this.internalStatus="wait",e&&e.calcProgress(this.internalStatus)},calcProgress:function(t){var e=100,n={};n.transitionDelay=150*this.index+"ms",t===this.$parent.processStatus?(this.currentStatus,e=0):"wait"===t&&(e=0,n.transitionDelay=-150*this.index+"ms"),n.borderWidth=e&&!this.isSimple?"1px":0,"vertical"===this.$parent.direction?n.height=e+"%":n.width=e+"%",this.lineStyle=n}},mounted:function(){var t=this,e=this.$watch("index",function(n){t.$watch("$parent.active",t.updateStatus,{immediate:!0}),t.$watch("$parent.processStatus",function(){var e=t.$parent.active;t.updateStatus(e)},{immediate:!0}),e()})}},Va,[],!1,null,null,null);Ha.options.__file="packages/steps/src/step.vue";var Wa=Ha.exports;Wa.install=function(t){t.component(Wa.name,Wa)};var Ga=Wa,za=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:t.carouselClasses,on:{mouseenter:function(e){return e.stopPropagation(),t.handleMouseEnter(e)},mouseleave:function(e){return e.stopPropagation(),t.handleMouseLeave(e)}}},[n("div",{staticClass:"el-carousel__container",style:{height:t.height}},[t.arrowDisplay?n("transition",{attrs:{name:"carousel-arrow-left"}},[n("button",{directives:[{name:"show",rawName:"v-show",value:("always"===t.arrow||t.hover)&&(t.loop||t.activeIndex>0),expression:"(arrow === 'always' || hover) && (loop || activeIndex > 0)"}],staticClass:"el-carousel__arrow el-carousel__arrow--left",attrs:{type:"button"},on:{mouseenter:function(e){t.handleButtonEnter("left")},mouseleave:t.handleButtonLeave,click:function(e){e.stopPropagation(),t.throttledArrowClick(t.activeIndex-1)}}},[n("i",{staticClass:"el-icon-arrow-left"})])]):t._e(),t.arrowDisplay?n("transition",{attrs:{name:"carousel-arrow-right"}},[n("button",{directives:[{name:"show",rawName:"v-show",value:("always"===t.arrow||t.hover)&&(t.loop||t.activeIndex<t.items.length-1),expression:"(arrow === 'always' || hover) && (loop || activeIndex < items.length - 1)"}],staticClass:"el-carousel__arrow el-carousel__arrow--right",attrs:{type:"button"},on:{mouseenter:function(e){t.handleButtonEnter("right")},mouseleave:t.handleButtonLeave,click:function(e){e.stopPropagation(),t.throttledArrowClick(t.activeIndex+1)}}},[n("i",{staticClass:"el-icon-arrow-right"})])]):t._e(),t._t("default")],2),"none"!==t.indicatorPosition?n("ul",{class:t.indicatorsClasses},t._l(t.items,function(e,r){return n("li",{key:r,class:["el-carousel__indicator","el-carousel__indicator--"+t.direction,{"is-active":r===t.activeIndex}],on:{mouseenter:function(e){t.throttledIndicatorHover(r)},click:function(e){e.stopPropagation(),t.handleIndicatorClick(r)}}},[n("button",{staticClass:"el-carousel__button"},[t.hasLabel?n("span",[t._v(t._s(e.label))]):t._e()])])}),0):t._e()])};za._withStripped=!0;var Xa=n(25),Ka=n.n(Xa),Ya=i({name:"ElCarousel",props:{initialIndex:{type:Number,default:0},height:String,trigger:{type:String,default:"hover"},autoplay:{type:Boolean,default:!0},interval:{type:Number,default:3e3},indicatorPosition:String,indicator:{type:Boolean,default:!0},arrow:{type:String,default:"hover"},type:String,loop:{type:Boolean,default:!0},direction:{type:String,default:"horizontal",validator:function(t){return-1!==["horizontal","vertical"].indexOf(t)}}},data:function(){return{items:[],activeIndex:-1,containerWidth:0,timer:null,hover:!1}},computed:{arrowDisplay:function(){return"never"!==this.arrow&&"vertical"!==this.direction},hasLabel:function(){return this.items.some(function(t){return t.label.toString().length>0})},carouselClasses:function(){var t=["el-carousel","el-carousel--"+this.direction];return"card"===this.type&&t.push("el-carousel--card"),t},indicatorsClasses:function(){var t=["el-carousel__indicators","el-carousel__indicators--"+this.direction];return this.hasLabel&&t.push("el-carousel__indicators--labels"),"outside"!==this.indicatorPosition&&"card"!==this.type||t.push("el-carousel__indicators--outside"),t}},watch:{items:function(t){t.length>0&&this.setActiveItem(this.initialIndex)},activeIndex:function(t,e){this.resetItemPosition(e),e>-1&&this.$emit("change",t,e)},autoplay:function(t){t?this.startTimer():this.pauseTimer()},loop:function(){this.setActiveItem(this.activeIndex)},interval:function(){this.pauseTimer(),this.startTimer()}},methods:{handleMouseEnter:function(){this.hover=!0,this.pauseTimer()},handleMouseLeave:function(){this.hover=!1,this.startTimer()},itemInStage:function(t,e){var n=this.items.length;return e===n-1&&t.inStage&&this.items[0].active||t.inStage&&this.items[e+1]&&this.items[e+1].active?"left":!!(0===e&&t.inStage&&this.items[n-1].active||t.inStage&&this.items[e-1]&&this.items[e-1].active)&&"right"},handleButtonEnter:function(t){var e=this;"vertical"!==this.direction&&this.items.forEach(function(n,r){t===e.itemInStage(n,r)&&(n.hover=!0)})},handleButtonLeave:function(){"vertical"!==this.direction&&this.items.forEach(function(t){t.hover=!1})},updateItems:function(){this.items=this.$children.filter(function(t){return"ElCarouselItem"===t.$options.name})},resetItemPosition:function(t){var e=this;this.items.forEach(function(n,r){n.translateItem(r,e.activeIndex,t)})},playSlides:function(){this.activeIndex<this.items.length-1?this.activeIndex++:this.loop&&(this.activeIndex=0)},pauseTimer:function(){this.timer&&(clearInterval(this.timer),this.timer=null)},startTimer:function(){this.interval<=0||!this.autoplay||this.timer||(this.timer=setInterval(this.playSlides,this.interval))},setActiveItem:function(t){if("string"==typeof t){var e=this.items.filter(function(e){return e.name===t});e.length>0&&(t=this.items.indexOf(e[0]))}if(t=Number(t),isNaN(t)||t!==Math.floor(t))console.warn("[Element Warn][Carousel]index must be an integer.");else{var n=this.items.length,r=this.activeIndex;this.activeIndex=t<0?this.loop?n-1:0:t>=n?this.loop?0:n-1:t,r===this.activeIndex&&this.resetItemPosition(r)}},prev:function(){this.setActiveItem(this.activeIndex-1)},next:function(){this.setActiveItem(this.activeIndex+1)},handleIndicatorClick:function(t){this.activeIndex=t},handleIndicatorHover:function(t){"hover"===this.trigger&&t!==this.activeIndex&&(this.activeIndex=t)}},created:function(){var t=this;this.throttledArrowClick=Ka()(300,!0,function(e){t.setActiveItem(e)}),this.throttledIndicatorHover=Ka()(300,function(e){t.handleIndicatorHover(e)})},mounted:function(){var t=this;this.updateItems(),this.$nextTick(function(){Object(Pe.addResizeListener)(t.$el,t.resetItemPosition),t.initialIndex<t.items.length&&t.initialIndex>=0&&(t.activeIndex=t.initialIndex),t.startTimer()})},beforeDestroy:function(){this.$el&&Object(Pe.removeResizeListener)(this.$el,this.resetItemPosition),this.pauseTimer()}},za,[],!1,null,null,null);Ya.options.__file="packages/carousel/src/main.vue";var qa=Ya.exports;qa.install=function(t){t.component(qa.name,qa)};var Ja=qa,Za={vertical:{offset:"offsetHeight",scroll:"scrollTop",scrollSize:"scrollHeight",size:"height",key:"vertical",axis:"Y",client:"clientY",direction:"top"},horizontal:{offset:"offsetWidth",scroll:"scrollLeft",scrollSize:"scrollWidth",size:"width",key:"horizontal",axis:"X",client:"clientX",direction:"left"}};var Qa={name:"Bar",props:{vertical:Boolean,size:String,move:Number},computed:{bar:function(){return Za[this.vertical?"vertical":"horizontal"]},wrap:function(){return this.$parent.wrap}},render:function(t){var e=this.size,n=this.move,r=this.bar;return t("div",{class:["el-scrollbar__bar","is-"+r.key],on:{mousedown:this.clickTrackHandler}},[t("div",{ref:"thumb",class:"el-scrollbar__thumb",on:{mousedown:this.clickThumbHandler},style:function(t){var e=t.move,n=t.size,r=t.bar,i={},o="translate"+r.axis+"("+e+"%)";return i[r.size]=n,i.transform=o,i.msTransform=o,i.webkitTransform=o,i}({size:e,move:n,bar:r})})])},methods:{clickThumbHandler:function(t){t.ctrlKey||2===t.button||(this.startDrag(t),this[this.bar.axis]=t.currentTarget[this.bar.offset]-(t[this.bar.client]-t.currentTarget.getBoundingClientRect()[this.bar.direction]))},clickTrackHandler:function(t){var e=100*(Math.abs(t.target.getBoundingClientRect()[this.bar.direction]-t[this.bar.client])-this.$refs.thumb[this.bar.offset]/2)/this.$el[this.bar.offset];this.wrap[this.bar.scroll]=e*this.wrap[this.bar.scrollSize]/100},startDrag:function(t){t.stopImmediatePropagation(),this.cursorDown=!0,Object(ft.on)(document,"mousemove",this.mouseMoveDocumentHandler),Object(ft.on)(document,"mouseup",this.mouseUpDocumentHandler),document.onselectstart=function(){return!1}},mouseMoveDocumentHandler:function(t){if(!1!==this.cursorDown){var e=this[this.bar.axis];if(e){var n=100*(-1*(this.$el.getBoundingClientRect()[this.bar.direction]-t[this.bar.client])-(this.$refs.thumb[this.bar.offset]-e))/this.$el[this.bar.offset];this.wrap[this.bar.scroll]=n*this.wrap[this.bar.scrollSize]/100}}},mouseUpDocumentHandler:function(t){this.cursorDown=!1,this[this.bar.axis]=0,Object(ft.off)(document,"mousemove",this.mouseMoveDocumentHandler),document.onselectstart=null}},destroyed:function(){Object(ft.off)(document,"mouseup",this.mouseUpDocumentHandler)}},tl={name:"ElScrollbar",components:{Bar:Qa},props:{native:Boolean,wrapStyle:{},wrapClass:{},viewClass:{},viewStyle:{},noresize:Boolean,tag:{type:String,default:"div"}},data:function(){return{sizeWidth:"0",sizeHeight:"0",moveX:0,moveY:0}},computed:{wrap:function(){return this.$refs.wrap}},render:function(t){var e=Mn()(),n=this.wrapStyle;if(e){var r="-"+e+"px",i="margin-bottom: "+r+"; margin-right: "+r+";";Array.isArray(this.wrapStyle)?(n=Object(g.toObject)(this.wrapStyle)).marginRight=n.marginBottom=r:"string"==typeof this.wrapStyle?n+=i:n=i}var o=t(this.tag,{class:["el-scrollbar__view",this.viewClass],style:this.viewStyle,ref:"resize"},this.$slots.default),s=t("div",{ref:"wrap",style:n,on:{scroll:this.handleScroll},class:[this.wrapClass,"el-scrollbar__wrap",e?"":"el-scrollbar__wrap--hidden-default"]},[[o]]);return t("div",{class:"el-scrollbar"},this.native?[t("div",{ref:"wrap",class:[this.wrapClass,"el-scrollbar__wrap"],style:n},[[o]])]:[s,t(Qa,{attrs:{move:this.moveX,size:this.sizeWidth}}),t(Qa,{attrs:{vertical:!0,move:this.moveY,size:this.sizeHeight}})])},methods:{handleScroll:function(){var t=this.wrap;this.moveY=100*t.scrollTop/t.clientHeight,this.moveX=100*t.scrollLeft/t.clientWidth},update:function(){var t,e,n=this.wrap;n&&(t=100*n.clientHeight/n.scrollHeight,e=100*n.clientWidth/n.scrollWidth,this.sizeHeight=t<100?t+"%":"",this.sizeWidth=e<100?e+"%":"")}},mounted:function(){this.native||(this.$nextTick(this.update),!this.noresize&&Object(Pe.addResizeListener)(this.$refs.resize,this.update))},beforeDestroy:function(){this.native||!this.noresize&&Object(Pe.removeResizeListener)(this.$refs.resize,this.update)},install:function(t){t.component(tl.name,tl)}},el=tl,nl=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{directives:[{name:"show",rawName:"v-show",value:t.ready,expression:"ready"}],staticClass:"el-carousel__item",class:{"is-active":t.active,"el-carousel__item--card":"card"===t.$parent.type,"is-in-stage":t.inStage,"is-hover":t.hover,"is-animating":t.animating},style:t.itemStyle,on:{click:t.handleItemClick}},["card"===t.$parent.type?n("div",{directives:[{name:"show",rawName:"v-show",value:!t.active,expression:"!active"}],staticClass:"el-carousel__mask"}):t._e(),t._t("default")],2)};nl._withStripped=!0;var rl=i({name:"ElCarouselItem",props:{name:String,label:{type:[String,Number],default:""}},data:function(){return{hover:!1,translate:0,scale:1,active:!1,ready:!1,inStage:!1,animating:!1}},methods:{processIndex:function(t,e,n){return 0===e&&t===n-1?-1:e===n-1&&0===t?n:t<e-1&&e-t>=n/2?n+1:t>e+1&&t-e>=n/2?-2:t},calcCardTranslate:function(t,e){var n=this.$parent.$el.offsetWidth;return this.inStage?n*(1.17*(t-e)+1)/4:t<e?-1.83*n/4:3.83*n/4},calcTranslate:function(t,e,n){return this.$parent.$el[n?"offsetHeight":"offsetWidth"]*(t-e)},translateItem:function(t,e,n){var r=this.$parent.type,i=this.parentDirection,o=this.$parent.items.length;if("card"!==r&&void 0!==n&&(this.animating=t===e||t===n),t!==e&&o>2&&this.$parent.loop&&(t=this.processIndex(t,e,o)),"card"===r)"vertical"===i&&console.warn("[Element Warn][Carousel]vertical direction is not supported in card mode"),this.inStage=Math.round(Math.abs(t-e))<=1,this.active=t===e,this.translate=this.calcCardTranslate(t,e),this.scale=this.active?1:.83;else{this.active=t===e;var s="vertical"===i;this.translate=this.calcTranslate(t,e,s),this.scale=1}this.ready=!0},handleItemClick:function(){var t=this.$parent;if(t&&"card"===t.type){var e=t.items.indexOf(this);t.setActiveItem(e)}}},computed:{parentDirection:function(){return this.$parent.direction},itemStyle:function(){var t={transform:("vertical"===this.parentDirection?"translateY":"translateX")+"("+this.translate+"px) scale("+this.scale+")"};return Object(g.autoprefixer)(t)}},created:function(){this.$parent&&this.$parent.updateItems()},destroyed:function(){this.$parent&&this.$parent.updateItems()}},nl,[],!1,null,null,null);rl.options.__file="packages/carousel/src/item.vue";var il=rl.exports;il.install=function(t){t.component(il.name,il)};var ol=il,sl=function(){var t=this.$createElement;return(this._self._c||t)("div",{staticClass:"el-collapse",attrs:{role:"tablist","aria-multiselectable":"true"}},[this._t("default")],2)};sl._withStripped=!0;var al=i({name:"ElCollapse",componentName:"ElCollapse",props:{accordion:Boolean,value:{type:[Array,String,Number],default:function(){return[]}}},data:function(){return{activeNames:[].concat(this.value)}},provide:function(){return{collapse:this}},watch:{value:function(t){this.activeNames=[].concat(t)}},methods:{setActiveNames:function(t){t=[].concat(t);var e=this.accordion?t[0]:t;this.activeNames=t,this.$emit("input",e),this.$emit("change",e)},handleItemClick:function(t){if(this.accordion)this.setActiveNames(!this.activeNames[0]&&0!==this.activeNames[0]||this.activeNames[0]!==t.name?t.name:"");else{var e=this.activeNames.slice(0),n=e.indexOf(t.name);n>-1?e.splice(n,1):e.push(t.name),this.setActiveNames(e)}}},created:function(){this.$on("item-click",this.handleItemClick)}},sl,[],!1,null,null,null);al.options.__file="packages/collapse/src/collapse.vue";var ll=al.exports;ll.install=function(t){t.component(ll.name,ll)};var ul=ll,cl=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"el-collapse-item",class:{"is-active":t.isActive,"is-disabled":t.disabled}},[n("div",{attrs:{role:"tab","aria-expanded":t.isActive,"aria-controls":"el-collapse-content-"+t.id,"aria-describedby":"el-collapse-content-"+t.id}},[n("div",{staticClass:"el-collapse-item__header",class:{focusing:t.focusing,"is-active":t.isActive},attrs:{role:"button",id:"el-collapse-head-"+t.id,tabindex:t.disabled?void 0:0},on:{click:t.handleHeaderClick,keyup:function(e){return"button"in e||!t._k(e.keyCode,"space",32,e.key,[" ","Spacebar"])||!t._k(e.keyCode,"enter",13,e.key,"Enter")?(e.stopPropagation(),t.handleEnterClick(e)):null},focus:t.handleFocus,blur:function(e){t.focusing=!1}}},[t._t("title",[t._v(t._s(t.title))]),n("i",{staticClass:"el-collapse-item__arrow el-icon-arrow-right",class:{"is-active":t.isActive}})],2)]),n("el-collapse-transition",[n("div",{directives:[{name:"show",rawName:"v-show",value:t.isActive,expression:"isActive"}],staticClass:"el-collapse-item__wrap",attrs:{role:"tabpanel","aria-hidden":!t.isActive,"aria-labelledby":"el-collapse-head-"+t.id,id:"el-collapse-content-"+t.id}},[n("div",{staticClass:"el-collapse-item__content"},[t._t("default")],2)])])],1)};cl._withStripped=!0;var hl=i({name:"ElCollapseItem",componentName:"ElCollapseItem",mixins:[w.a],components:{ElCollapseTransition:_t.a},data:function(){return{contentWrapStyle:{height:"auto",display:"block"},contentHeight:0,focusing:!1,isClick:!1,id:Object(g.generateId)()}},inject:["collapse"],props:{title:String,name:{type:[String,Number],default:function(){return this._uid}},disabled:Boolean},computed:{isActive:function(){return this.collapse.activeNames.indexOf(this.name)>-1}},methods:{handleFocus:function(){var t=this;setTimeout(function(){t.isClick?t.isClick=!1:t.focusing=!0},50)},handleHeaderClick:function(){this.disabled||(this.dispatch("ElCollapse","item-click",this),this.focusing=!1,this.isClick=!0)},handleEnterClick:function(){this.dispatch("ElCollapse","item-click",this)}}},cl,[],!1,null,null,null);hl.options.__file="packages/collapse/src/collapse-item.vue";var dl=hl.exports;dl.install=function(t){t.component(dl.name,dl)};var pl=dl,fl=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{directives:[{name:"clickoutside",rawName:"v-clickoutside",value:function(){return t.toggleDropDownVisible(!1)},expression:"() => toggleDropDownVisible(false)"}],ref:"reference",class:["el-cascader",t.realSize&&"el-cascader--"+t.realSize,{"is-disabled":t.isDisabled}],on:{mouseenter:function(e){t.inputHover=!0},mouseleave:function(e){t.inputHover=!1},click:function(){return t.toggleDropDownVisible(!t.readonly||void 0)},keydown:t.handleKeyDown}},[n("el-input",{ref:"input",class:{"is-focus":t.dropDownVisible},attrs:{size:t.realSize,placeholder:t.placeholder,readonly:t.readonly,disabled:t.isDisabled,"validate-event":!1},on:{focus:t.handleFocus,blur:t.handleBlur,input:t.handleInput},model:{value:t.multiple?t.presentText:t.inputValue,callback:function(e){t.multiple?t.presentText:t.inputValue=e},expression:"multiple ? presentText : inputValue"}},[n("template",{slot:"suffix"},[t.clearBtnVisible?n("i",{key:"clear",staticClass:"el-input__icon el-icon-circle-close",on:{click:function(e){return e.stopPropagation(),t.handleClear(e)}}}):n("i",{key:"arrow-down",class:["el-input__icon","el-icon-arrow-down",t.dropDownVisible&&"is-reverse"],on:{click:function(e){e.stopPropagation(),t.toggleDropDownVisible()}}})])],2),t.multiple?n("div",{staticClass:"el-cascader__tags"},[t._l(t.presentTags,function(e){return n("el-tag",{key:e.key,attrs:{type:"info",size:t.tagSize,hit:e.hitState,closable:e.closable,"disable-transitions":""},on:{close:function(n){t.deleteTag(e)}}},[n("span",[t._v(t._s(e.text))])])}),t.filterable&&!t.isDisabled?n("input",{directives:[{name:"model",rawName:"v-model.trim",value:t.inputValue,expression:"inputValue",modifiers:{trim:!0}}],staticClass:"el-cascader__search-input",attrs:{type:"text",placeholder:t.presentTags.length?"":t.placeholder},domProps:{value:t.inputValue},on:{input:[function(e){e.target.composing||(t.inputValue=e.target.value.trim())},function(e){return t.handleInput(t.inputValue,e)}],click:function(e){e.stopPropagation(),t.toggleDropDownVisible(!0)},keydown:function(e){return"button"in e||!t._k(e.keyCode,"delete",[8,46],e.key,["Backspace","Delete","Del"])?t.handleDelete(e):null},blur:function(e){t.$forceUpdate()}}}):t._e()],2):t._e(),n("transition",{attrs:{name:"el-zoom-in-top"},on:{"after-leave":t.handleDropdownLeave}},[n("div",{directives:[{name:"show",rawName:"v-show",value:t.dropDownVisible,expression:"dropDownVisible"}],ref:"popper",class:["el-popper","el-cascader__dropdown",t.popperClass]},[n("el-cascader-panel",{directives:[{name:"show",rawName:"v-show",value:!t.filtering,expression:"!filtering"}],ref:"panel",attrs:{options:t.options,props:t.config,border:!1,"render-label":t.$scopedSlots.default},on:{"expand-change":t.handleExpandChange,close:function(e){t.toggleDropDownVisible(!1)}},model:{value:t.checkedValue,callback:function(e){t.checkedValue=e},expression:"checkedValue"}}),t.filterable?n("el-scrollbar",{directives:[{name:"show",rawName:"v-show",value:t.filtering,expression:"filtering"}],ref:"suggestionPanel",staticClass:"el-cascader__suggestion-panel",attrs:{tag:"ul","view-class":"el-cascader__suggestion-list"},nativeOn:{keydown:function(e){return t.handleSuggestionKeyDown(e)}}},[t.suggestions.length?t._l(t.suggestions,function(e,r){return n("li",{key:e.uid,class:["el-cascader__suggestion-item",e.checked&&"is-checked"],attrs:{tabindex:-1},on:{click:function(e){t.handleSuggestionClick(r)}}},[n("span",[t._v(t._s(e.text))]),e.checked?n("i",{staticClass:"el-icon-check"}):t._e()])}):t._t("empty",[n("li",{staticClass:"el-cascader__empty-text"},[t._v(t._s(t.t("el.cascader.noMatch")))])])],2):t._e()],1)])],1)};fl._withStripped=!0;var gl=n(42),ml=n.n(gl),vl=n(34),bl=n.n(vl),_l=bl.a.keys,yl={expandTrigger:{newProp:"expandTrigger",type:String},changeOnSelect:{newProp:"checkStrictly",type:Boolean},hoverThreshold:{newProp:"hoverThreshold",type:Number}},Tl={props:{placement:{type:String,default:"bottom-start"},appendToBody:L.a.props.appendToBody,visibleArrow:{type:Boolean,default:!0},arrowOffset:L.a.props.arrowOffset,offset:L.a.props.offset,boundariesPadding:L.a.props.boundariesPadding,popperOptions:L.a.props.popperOptions},methods:L.a.methods,data:L.a.data,beforeDestroy:L.a.beforeDestroy},xl={medium:36,small:32,mini:28},El=i({name:"ElCascader",directives:{Clickoutside:N.a},mixins:[Tl,w.a,f.a,x.a],inject:{elForm:{default:""},elFormItem:{default:""}},components:{ElInput:d.a,ElTag:Le.a,ElScrollbar:F.a,ElCascaderPanel:ml.a},props:{value:{},options:Array,props:Object,size:String,placeholder:{type:String,default:function(){return Object(Mi.t)("el.cascader.placeholder")}},disabled:Boolean,clearable:Boolean,filterable:Boolean,filterMethod:Function,separator:{type:String,default:" / "},showAllLevels:{type:Boolean,default:!0},collapseTags:Boolean,debounce:{type:Number,default:300},beforeFilter:{type:Function,default:function(){return function(){}}},popperClass:String},data:function(){return{dropDownVisible:!1,checkedValue:this.value||null,inputHover:!1,inputValue:null,presentText:null,presentTags:[],checkedNodes:[],filtering:!1,suggestions:[],inputInitialHeight:0,pressDeleteCount:0}},computed:{realSize:function(){var t=(this.elFormItem||{}).elFormItemSize;return this.size||t||(this.$ELEMENT||{}).size},tagSize:function(){return["small","mini"].indexOf(this.realSize)>-1?"mini":"small"},isDisabled:function(){return this.disabled||(this.elForm||{}).disabled},config:function(){var t=this.props||{},e=this.$attrs;return Object.keys(yl).forEach(function(n){var r=yl[n],i=r.newProp,o=r.type,s=e[n]||e[Object(g.kebabCase)(n)];Object(Vt.isDef)(n)&&!Object(Vt.isDef)(t[i])&&(o===Boolean&&""===s&&(s=!0),t[i]=s)}),t},multiple:function(){return this.config.multiple},leafOnly:function(){return!this.config.checkStrictly},readonly:function(){return!this.filterable||this.multiple},clearBtnVisible:function(){return!(!this.clearable||this.isDisabled||this.filtering||!this.inputHover)&&(this.multiple?!!this.checkedNodes.filter(function(t){return!t.isDisabled}).length:!!this.presentText)},panel:function(){return this.$refs.panel}},watch:{disabled:function(){this.computePresentContent()},value:function(t){Object(g.isEqual)(t,this.checkedValue)||(this.checkedValue=t,this.computePresentContent())},checkedValue:function(t){var e=this.value,n=this.dropDownVisible,r=this.config,i=r.checkStrictly,o=r.multiple;Object(g.isEqual)(t,e)&&!Object(Ma.isUndefined)(e)||(this.computePresentContent(),o||i||!n||this.toggleDropDownVisible(!1),this.$emit("input",t),this.$emit("change",t),this.dispatch("ElFormItem","el.form.change",[t]))},options:{handler:function(){this.$nextTick(this.computePresentContent)},deep:!0},presentText:function(t){this.inputValue=t},presentTags:function(t,e){this.multiple&&(t.length||e.length)&&this.$nextTick(this.updateStyle)},filtering:function(t){this.$nextTick(this.updatePopper)}},mounted:function(){var t=this,e=this.$refs.input;e&&e.$el&&(this.inputInitialHeight=e.$el.offsetHeight||xl[this.realSize]||40),Object(g.isEmpty)(this.value)||this.computePresentContent(),this.filterHandler=R()(this.debounce,function(){var e=t.inputValue;if(e){var n=t.beforeFilter(e);n&&n.then?n.then(t.getSuggestions):!1!==n?t.getSuggestions():t.filtering=!1}else t.filtering=!1}),Object(Pe.addResizeListener)(this.$el,this.updateStyle)},beforeDestroy:function(){Object(Pe.removeResizeListener)(this.$el,this.updateStyle)},methods:{getMigratingConfig:function(){return{props:{"expand-trigger":"expand-trigger is removed, use `props.expandTrigger` instead.","change-on-select":"change-on-select is removed, use `props.checkStrictly` instead.","hover-threshold":"hover-threshold is removed, use `props.hoverThreshold` instead"},events:{"active-item-change":"active-item-change is renamed to expand-change"}}},toggleDropDownVisible:function(t){var e=this;if(!this.isDisabled){var n=this.dropDownVisible,r=this.$refs.input;(t=Object(Vt.isDef)(t)?t:!n)!==n&&(this.dropDownVisible=t,t&&this.$nextTick(function(){e.updatePopper(),e.panel.scrollIntoView()}),r.$refs.input.setAttribute("aria-expanded",t),this.$emit("visible-change",t))}},handleDropdownLeave:function(){this.filtering=!1,this.inputValue=this.presentText},handleKeyDown:function(t){switch(t.keyCode){case _l.enter:this.toggleDropDownVisible();break;case _l.down:this.toggleDropDownVisible(!0),this.focusFirstNode(),t.preventDefault();break;case _l.esc:case _l.tab:this.toggleDropDownVisible(!1)}},handleFocus:function(t){this.$emit("focus",t)},handleBlur:function(t){this.$emit("blur",t)},handleInput:function(t,e){!this.dropDownVisible&&this.toggleDropDownVisible(!0),e&&e.isComposing||(t?this.filterHandler():this.filtering=!1)},handleClear:function(){this.presentText="",this.panel.clearCheckedNodes()},handleExpandChange:function(t){this.$nextTick(this.updatePopper.bind(this)),this.$emit("expand-change",t),this.$emit("active-item-change",t)},focusFirstNode:function(){var t=this;this.$nextTick(function(){var e=t.filtering,n=t.$refs,r=n.popper,i=n.suggestionPanel,o=null;e&&i?o=i.$el.querySelector(".el-cascader__suggestion-item"):o=r.querySelector(".el-cascader-menu").querySelector('.el-cascader-node[tabindex="-1"]');o&&(o.focus(),!e&&o.click())})},computePresentContent:function(){var t=this;this.$nextTick(function(){t.config.multiple?(t.computePresentTags(),t.presentText=t.presentTags.length?" ":null):t.computePresentText()})},computePresentText:function(){var t=this.checkedValue,e=this.config;if(!Object(g.isEmpty)(t)){var n=this.panel.getNodeByValue(t);if(n&&(e.checkStrictly||n.isLeaf))return void(this.presentText=n.getText(this.showAllLevels,this.separator))}this.presentText=null},computePresentTags:function(){var t=this.isDisabled,e=this.leafOnly,n=this.showAllLevels,r=this.separator,i=this.collapseTags,o=this.getCheckedNodes(e),s=[],a=function(e){return{node:e,key:e.uid,text:e.getText(n,r),hitState:!1,closable:!t&&!e.isDisabled}};if(o.length){var l=o[0],u=o.slice(1),c=u.length;s.push(a(l)),c&&(i?s.push({key:-1,text:"+ "+c,closable:!1}):u.forEach(function(t){return s.push(a(t))}))}this.checkedNodes=o,this.presentTags=s},getSuggestions:function(){var t=this,e=this.filterMethod;Object(Ma.isFunction)(e)||(e=function(t,e){return t.text.includes(e)});var n=this.panel.getFlattedNodes(this.leafOnly).filter(function(n){return!n.isDisabled&&(n.text=n.getText(t.showAllLevels,t.separator)||"",e(n,t.inputValue))});this.multiple?this.presentTags.forEach(function(t){t.hitState=!1}):n.forEach(function(e){e.checked=Object(g.isEqual)(t.checkedValue,e.getValueByOption())}),this.filtering=!0,this.suggestions=n,this.$nextTick(this.updatePopper)},handleSuggestionKeyDown:function(t){var e=t.keyCode,n=t.target;switch(e){case _l.enter:n.click();break;case _l.up:var r=n.previousElementSibling;r&&r.focus();break;case _l.down:var i=n.nextElementSibling;i&&i.focus();break;case _l.esc:case _l.tab:this.toggleDropDownVisible(!1)}},handleDelete:function(){var t=this.inputValue,e=this.pressDeleteCount,n=this.presentTags,r=n[n.length-1];this.pressDeleteCount=t?0:e+1,r&&this.pressDeleteCount&&(r.hitState?this.deleteTag(r):r.hitState=!0)},handleSuggestionClick:function(t){var e=this.multiple,n=this.suggestions[t];if(e){var r=n.checked;n.doCheck(!r),this.panel.calculateMultiCheckedValue()}else this.checkedValue=n.getValueByOption(),this.toggleDropDownVisible(!1)},deleteTag:function(t){var e=this.checkedValue,n=t.node.getValueByOption(),r=e.find(function(t){return Object(g.isEqual)(t,n)});this.checkedValue=e.filter(function(t){return!Object(g.isEqual)(t,n)}),this.$emit("remove-tag",r)},updateStyle:function(){var t=this.$el,e=this.inputInitialHeight;if(!this.$isServer&&t){var n=this.$refs.suggestionPanel,r=t.querySelector(".el-input__inner");if(r){var i=t.querySelector(".el-cascader__tags"),o=null;if(n&&(o=n.$el))o.querySelector(".el-cascader__suggestion-list").style.minWidth=r.offsetWidth+"px";if(i){var s=i.offsetHeight,a=Math.max(s+6,e)+"px";r.style.height=a,this.updatePopper()}}}},getCheckedNodes:function(t){return this.panel.getCheckedNodes(t)}}},fl,[],!1,null,null,null);El.options.__file="packages/cascader/src/cascader.vue";var wl=El.exports;wl.install=function(t){t.component(wl.name,wl)};var Cl=wl,Sl=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{directives:[{name:"clickoutside",rawName:"v-clickoutside",value:t.hide,expression:"hide"}],class:["el-color-picker",t.colorDisabled?"is-disabled":"",t.colorSize?"el-color-picker--"+t.colorSize:""]},[t.colorDisabled?n("div",{staticClass:"el-color-picker__mask"}):t._e(),n("div",{staticClass:"el-color-picker__trigger",on:{click:t.handleTrigger}},[n("span",{staticClass:"el-color-picker__color",class:{"is-alpha":t.showAlpha}},[n("span",{staticClass:"el-color-picker__color-inner",style:{backgroundColor:t.displayedColor}}),t.value||t.showPanelColor?t._e():n("span",{staticClass:"el-color-picker__empty el-icon-close"})]),n("span",{directives:[{name:"show",rawName:"v-show",value:t.value||t.showPanelColor,expression:"value || showPanelColor"}],staticClass:"el-color-picker__icon el-icon-arrow-down"})]),n("picker-dropdown",{ref:"dropdown",class:["el-color-picker__panel",t.popperClass||""],attrs:{color:t.color,"show-alpha":t.showAlpha,predefine:t.predefine},on:{pick:t.confirmValue,clear:t.clearValue},model:{value:t.showPicker,callback:function(e){t.showPicker=e},expression:"showPicker"}})],1)};Sl._withStripped=!0;var kl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};var Ol=function(t,e,n){return[t,e*n/((t=(2-e)*n)<1?t:2-t)||0,t/2]},Il=function(t,e){var n;"string"==typeof(n=t)&&-1!==n.indexOf(".")&&1===parseFloat(n)&&(t="100%");var r=function(t){return"string"==typeof t&&-1!==t.indexOf("%")}(t);return t=Math.min(e,Math.max(0,parseFloat(t))),r&&(t=parseInt(t*e,10)/100),Math.abs(t-e)<1e-6?1:t%e/parseFloat(e)},Rl={10:"A",11:"B",12:"C",13:"D",14:"E",15:"F"},Al={A:10,B:11,C:12,D:13,E:14,F:15},Nl=function(t){return 2===t.length?16*(Al[t[0].toUpperCase()]||+t[0])+(Al[t[1].toUpperCase()]||+t[1]):Al[t[1].toUpperCase()]||+t[1]},Dl=function(t,e,n){t=Il(t,255),e=Il(e,255),n=Il(n,255);var r,i=Math.max(t,e,n),o=Math.min(t,e,n),s=void 0,a=i,l=i-o;if(r=0===i?0:l/i,i===o)s=0;else{switch(i){case t:s=(e-n)/l+(e<n?6:0);break;case e:s=(n-t)/l+2;break;case n:s=(t-e)/l+4}s/=6}return{h:360*s,s:100*r,v:100*a}},Ml=function(t,e,n){t=6*Il(t,360),e=Il(e,100),n=Il(n,100);var r=Math.floor(t),i=t-r,o=n*(1-e),s=n*(1-i*e),a=n*(1-(1-i)*e),l=r%6,u=[n,s,o,o,a,n][l],c=[a,n,n,s,o,o][l],h=[o,o,a,n,n,s][l];return{r:Math.round(255*u),g:Math.round(255*c),b:Math.round(255*h)}},Ll=function(){function t(e){for(var n in function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._hue=0,this._saturation=100,this._value=100,this._alpha=100,this.enableAlpha=!1,this.format="hex",this.value="",e=e||{})e.hasOwnProperty(n)&&(this[n]=e[n]);this.doOnChange()}return t.prototype.set=function(t,e){if(1!==arguments.length||"object"!==(void 0===t?"undefined":kl(t)))this["_"+t]=e,this.doOnChange();else for(var n in t)t.hasOwnProperty(n)&&this.set(n,t[n])},t.prototype.get=function(t){return this["_"+t]},t.prototype.toRgb=function(){return Ml(this._hue,this._saturation,this._value)},t.prototype.fromString=function(t){var e=this;if(!t)return this._hue=0,this._saturation=100,this._value=100,void this.doOnChange();var n=function(t,n,r){e._hue=Math.max(0,Math.min(360,t)),e._saturation=Math.max(0,Math.min(100,n)),e._value=Math.max(0,Math.min(100,r)),e.doOnChange()};if(-1!==t.indexOf("hsl")){var r=t.replace(/hsla|hsl|\(|\)/gm,"").split(/\s|,/g).filter(function(t){return""!==t}).map(function(t,e){return e>2?parseFloat(t):parseInt(t,10)});if(4===r.length?this._alpha=Math.floor(100*parseFloat(r[3])):3===r.length&&(this._alpha=100),r.length>=3){var i=function(t,e,n){n/=100;var r=e/=100,i=Math.max(n,.01);return e*=(n*=2)<=1?n:2-n,r*=i<=1?i:2-i,{h:t,s:100*(0===n?2*r/(i+r):2*e/(n+e)),v:(n+e)/2*100}}(r[0],r[1],r[2]);n(i.h,i.s,i.v)}}else if(-1!==t.indexOf("hsv")){var o=t.replace(/hsva|hsv|\(|\)/gm,"").split(/\s|,/g).filter(function(t){return""!==t}).map(function(t,e){return e>2?parseFloat(t):parseInt(t,10)});4===o.length?this._alpha=Math.floor(100*parseFloat(o[3])):3===o.length&&(this._alpha=100),o.length>=3&&n(o[0],o[1],o[2])}else if(-1!==t.indexOf("rgb")){var s=t.replace(/rgba|rgb|\(|\)/gm,"").split(/\s|,/g).filter(function(t){return""!==t}).map(function(t,e){return e>2?parseFloat(t):parseInt(t,10)});if(4===s.length?this._alpha=Math.floor(100*parseFloat(s[3])):3===s.length&&(this._alpha=100),s.length>=3){var a=Dl(s[0],s[1],s[2]);n(a.h,a.s,a.v)}}else if(-1!==t.indexOf("#")){var l=t.replace("#","").trim();if(!/^(?:[0-9a-fA-F]{3}){1,2}|[0-9a-fA-F]{8}$/.test(l))return;var u=void 0,c=void 0,h=void 0;3===l.length?(u=Nl(l[0]+l[0]),c=Nl(l[1]+l[1]),h=Nl(l[2]+l[2])):6!==l.length&&8!==l.length||(u=Nl(l.substring(0,2)),c=Nl(l.substring(2,4)),h=Nl(l.substring(4,6))),8===l.length?this._alpha=Math.floor(Nl(l.substring(6))/255*100):3!==l.length&&6!==l.length||(this._alpha=100);var d=Dl(u,c,h);n(d.h,d.s,d.v)}},t.prototype.compare=function(t){return Math.abs(t._hue-this._hue)<2&&Math.abs(t._saturation-this._saturation)<1&&Math.abs(t._value-this._value)<1&&Math.abs(t._alpha-this._alpha)<1},t.prototype.doOnChange=function(){var t=this._hue,e=this._saturation,n=this._value,r=this._alpha,i=this.format;if(this.enableAlpha)switch(i){case"hsl":var o=Ol(t,e/100,n/100);this.value="hsla("+t+", "+Math.round(100*o[1])+"%, "+Math.round(100*o[2])+"%, "+r/100+")";break;case"hsv":this.value="hsva("+t+", "+Math.round(e)+"%, "+Math.round(n)+"%, "+r/100+")";break;default:var s=Ml(t,e,n),a=s.r,l=s.g,u=s.b;this.value="rgba("+a+", "+l+", "+u+", "+r/100+")"}else switch(i){case"hsl":var c=Ol(t,e/100,n/100);this.value="hsl("+t+", "+Math.round(100*c[1])+"%, "+Math.round(100*c[2])+"%)";break;case"hsv":this.value="hsv("+t+", "+Math.round(e)+"%, "+Math.round(n)+"%)";break;case"rgb":var h=Ml(t,e,n),d=h.r,p=h.g,f=h.b;this.value="rgb("+d+", "+p+", "+f+")";break;default:this.value=function(t){var e=t.r,n=t.g,r=t.b,i=function(t){t=Math.min(Math.round(t),255);var e=Math.floor(t/16),n=t%16;return""+(Rl[e]||e)+(Rl[n]||n)};return isNaN(e)||isNaN(n)||isNaN(r)?"":"#"+i(e)+i(n)+i(r)}(Ml(t,e,n))}},t}(),Pl=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("transition",{attrs:{name:"el-zoom-in-top"},on:{"after-leave":t.doDestroy}},[n("div",{directives:[{name:"show",rawName:"v-show",value:t.showPopper,expression:"showPopper"}],staticClass:"el-color-dropdown"},[n("div",{staticClass:"el-color-dropdown__main-wrapper"},[n("hue-slider",{ref:"hue",staticStyle:{float:"right"},attrs:{color:t.color,vertical:""}}),n("sv-panel",{ref:"sl",attrs:{color:t.color}})],1),t.showAlpha?n("alpha-slider",{ref:"alpha",attrs:{color:t.color}}):t._e(),t.predefine?n("predefine",{attrs:{color:t.color,colors:t.predefine}}):t._e(),n("div",{staticClass:"el-color-dropdown__btns"},[n("span",{staticClass:"el-color-dropdown__value"},[n("el-input",{attrs:{"validate-event":!1,size:"mini"},on:{blur:t.handleConfirm},nativeOn:{keyup:function(e){return"button"in e||!t._k(e.keyCode,"enter",13,e.key,"Enter")?t.handleConfirm(e):null}},model:{value:t.customInput,callback:function(e){t.customInput=e},expression:"customInput"}})],1),n("el-button",{staticClass:"el-color-dropdown__link-btn",attrs:{size:"mini",type:"text"},on:{click:function(e){t.$emit("clear")}}},[t._v("\n "+t._s(t.t("el.colorpicker.clear"))+"\n ")]),n("el-button",{staticClass:"el-color-dropdown__btn",attrs:{plain:"",size:"mini"},on:{click:t.confirmValue}},[t._v("\n "+t._s(t.t("el.colorpicker.confirm"))+"\n ")])],1)],1)])};Pl._withStripped=!0;var Fl=function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"el-color-svpanel",style:{backgroundColor:this.background}},[e("div",{staticClass:"el-color-svpanel__white"}),e("div",{staticClass:"el-color-svpanel__black"}),e("div",{staticClass:"el-color-svpanel__cursor",style:{top:this.cursorTop+"px",left:this.cursorLeft+"px"}},[e("div")])])};Fl._withStripped=!0;var Bl=!1,jl=function(t,e){if(!hn.a.prototype.$isServer){var n=function(t){e.drag&&e.drag(t)},r=function t(r){document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",t),document.onselectstart=null,document.ondragstart=null,Bl=!1,e.end&&e.end(r)};t.addEventListener("mousedown",function(t){Bl||(document.onselectstart=function(){return!1},document.ondragstart=function(){return!1},document.addEventListener("mousemove",n),document.addEventListener("mouseup",r),Bl=!0,e.start&&e.start(t))})}},$l=i({name:"el-sl-panel",props:{color:{required:!0}},computed:{colorValue:function(){return{hue:this.color.get("hue"),value:this.color.get("value")}}},watch:{colorValue:function(){this.update()}},methods:{update:function(){var t=this.color.get("saturation"),e=this.color.get("value"),n=this.$el,r=n.clientWidth,i=n.clientHeight;this.cursorLeft=t*r/100,this.cursorTop=(100-e)*i/100,this.background="hsl("+this.color.get("hue")+", 100%, 50%)"},handleDrag:function(t){var e=this.$el.getBoundingClientRect(),n=t.clientX-e.left,r=t.clientY-e.top;n=Math.max(0,n),n=Math.min(n,e.width),r=Math.max(0,r),r=Math.min(r,e.height),this.cursorLeft=n,this.cursorTop=r,this.color.set({saturation:n/e.width*100,value:100-r/e.height*100})}},mounted:function(){var t=this;jl(this.$el,{drag:function(e){t.handleDrag(e)},end:function(e){t.handleDrag(e)}}),this.update()},data:function(){return{cursorTop:0,cursorLeft:0,background:"hsl(0, 100%, 50%)"}}},Fl,[],!1,null,null,null);$l.options.__file="packages/color-picker/src/components/sv-panel.vue";var Ul=$l.exports,Vl=function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"el-color-hue-slider",class:{"is-vertical":this.vertical}},[e("div",{ref:"bar",staticClass:"el-color-hue-slider__bar",on:{click:this.handleClick}}),e("div",{ref:"thumb",staticClass:"el-color-hue-slider__thumb",style:{left:this.thumbLeft+"px",top:this.thumbTop+"px"}})])};Vl._withStripped=!0;var Hl=i({name:"el-color-hue-slider",props:{color:{required:!0},vertical:Boolean},data:function(){return{thumbLeft:0,thumbTop:0}},computed:{hueValue:function(){return this.color.get("hue")}},watch:{hueValue:function(){this.update()}},methods:{handleClick:function(t){var e=this.$refs.thumb;t.target!==e&&this.handleDrag(t)},handleDrag:function(t){var e=this.$el.getBoundingClientRect(),n=this.$refs.thumb,r=void 0;if(this.vertical){var i=t.clientY-e.top;i=Math.min(i,e.height-n.offsetHeight/2),i=Math.max(n.offsetHeight/2,i),r=Math.round((i-n.offsetHeight/2)/(e.height-n.offsetHeight)*360)}else{var o=t.clientX-e.left;o=Math.min(o,e.width-n.offsetWidth/2),o=Math.max(n.offsetWidth/2,o),r=Math.round((o-n.offsetWidth/2)/(e.width-n.offsetWidth)*360)}this.color.set("hue",r)},getThumbLeft:function(){if(this.vertical)return 0;var t=this.$el,e=this.color.get("hue");if(!t)return 0;var n=this.$refs.thumb;return Math.round(e*(t.offsetWidth-n.offsetWidth/2)/360)},getThumbTop:function(){if(!this.vertical)return 0;var t=this.$el,e=this.color.get("hue");if(!t)return 0;var n=this.$refs.thumb;return Math.round(e*(t.offsetHeight-n.offsetHeight/2)/360)},update:function(){this.thumbLeft=this.getThumbLeft(),this.thumbTop=this.getThumbTop()}},mounted:function(){var t=this,e=this.$refs,n=e.bar,r=e.thumb,i={drag:function(e){t.handleDrag(e)},end:function(e){t.handleDrag(e)}};jl(n,i),jl(r,i),this.update()}},Vl,[],!1,null,null,null);Hl.options.__file="packages/color-picker/src/components/hue-slider.vue";var Wl=Hl.exports,Gl=function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"el-color-alpha-slider",class:{"is-vertical":this.vertical}},[e("div",{ref:"bar",staticClass:"el-color-alpha-slider__bar",style:{background:this.background},on:{click:this.handleClick}}),e("div",{ref:"thumb",staticClass:"el-color-alpha-slider__thumb",style:{left:this.thumbLeft+"px",top:this.thumbTop+"px"}})])};Gl._withStripped=!0;var zl=i({name:"el-color-alpha-slider",props:{color:{required:!0},vertical:Boolean},watch:{"color._alpha":function(){this.update()},"color.value":function(){this.update()}},methods:{handleClick:function(t){var e=this.$refs.thumb;t.target!==e&&this.handleDrag(t)},handleDrag:function(t){var e=this.$el.getBoundingClientRect(),n=this.$refs.thumb;if(this.vertical){var r=t.clientY-e.top;r=Math.max(n.offsetHeight/2,r),r=Math.min(r,e.height-n.offsetHeight/2),this.color.set("alpha",Math.round((r-n.offsetHeight/2)/(e.height-n.offsetHeight)*100))}else{var i=t.clientX-e.left;i=Math.max(n.offsetWidth/2,i),i=Math.min(i,e.width-n.offsetWidth/2),this.color.set("alpha",Math.round((i-n.offsetWidth/2)/(e.width-n.offsetWidth)*100))}},getThumbLeft:function(){if(this.vertical)return 0;var t=this.$el,e=this.color._alpha;if(!t)return 0;var n=this.$refs.thumb;return Math.round(e*(t.offsetWidth-n.offsetWidth/2)/100)},getThumbTop:function(){if(!this.vertical)return 0;var t=this.$el,e=this.color._alpha;if(!t)return 0;var n=this.$refs.thumb;return Math.round(e*(t.offsetHeight-n.offsetHeight/2)/100)},getBackground:function(){if(this.color&&this.color.value){var t=this.color.toRgb(),e=t.r,n=t.g,r=t.b;return"linear-gradient(to right, rgba("+e+", "+n+", "+r+", 0) 0%, rgba("+e+", "+n+", "+r+", 1) 100%)"}return null},update:function(){this.thumbLeft=this.getThumbLeft(),this.thumbTop=this.getThumbTop(),this.background=this.getBackground()}},data:function(){return{thumbLeft:0,thumbTop:0,background:null}},mounted:function(){var t=this,e=this.$refs,n=e.bar,r=e.thumb,i={drag:function(e){t.handleDrag(e)},end:function(e){t.handleDrag(e)}};jl(n,i),jl(r,i),this.update()}},Gl,[],!1,null,null,null);zl.options.__file="packages/color-picker/src/components/alpha-slider.vue";var Xl=zl.exports,Kl=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"el-color-predefine"},[n("div",{staticClass:"el-color-predefine__colors"},t._l(t.rgbaColors,function(e,r){return n("div",{key:t.colors[r],staticClass:"el-color-predefine__color-selector",class:{selected:e.selected,"is-alpha":e._alpha<100},on:{click:function(e){t.handleSelect(r)}}},[n("div",{style:{"background-color":e.value}})])}),0)])};Kl._withStripped=!0;var Yl=i({props:{colors:{type:Array,required:!0},color:{required:!0}},data:function(){return{rgbaColors:this.parseColors(this.colors,this.color)}},methods:{handleSelect:function(t){this.color.fromString(this.colors[t])},parseColors:function(t,e){return t.map(function(t){var n=new Ll;return n.enableAlpha=!0,n.format="rgba",n.fromString(t),n.selected=n.value===e.value,n})}},watch:{"$parent.currentColor":function(t){var e=new Ll;e.fromString(t),this.rgbaColors.forEach(function(t){t.selected=e.compare(t)})},colors:function(t){this.rgbaColors=this.parseColors(t,this.color)},color:function(t){this.rgbaColors=this.parseColors(this.colors,t)}}},Kl,[],!1,null,null,null);Yl.options.__file="packages/color-picker/src/components/predefine.vue";var ql=Yl.exports,Jl=i({name:"el-color-picker-dropdown",mixins:[L.a,f.a],components:{SvPanel:Ul,HueSlider:Wl,AlphaSlider:Xl,ElInput:d.a,ElButton:z.a,Predefine:ql},props:{color:{required:!0},showAlpha:Boolean,predefine:Array},data:function(){return{customInput:""}},computed:{currentColor:function(){var t=this.$parent;return t.value||t.showPanelColor?t.color.value:""}},methods:{confirmValue:function(){this.$emit("pick")},handleConfirm:function(){this.color.fromString(this.customInput)}},mounted:function(){this.$parent.popperElm=this.popperElm=this.$el,this.referenceElm=this.$parent.$el},watch:{showPopper:function(t){var e=this;!0===t&&this.$nextTick(function(){var t=e.$refs,n=t.sl,r=t.hue,i=t.alpha;n&&n.update(),r&&r.update(),i&&i.update()})},currentColor:{immediate:!0,handler:function(t){this.customInput=t}}}},Pl,[],!1,null,null,null);Jl.options.__file="packages/color-picker/src/components/picker-dropdown.vue";var Zl=Jl.exports,Ql=i({name:"ElColorPicker",mixins:[w.a],props:{value:String,showAlpha:Boolean,colorFormat:String,disabled:Boolean,size:String,popperClass:String,predefine:Array},inject:{elForm:{default:""},elFormItem:{default:""}},directives:{Clickoutside:N.a},computed:{displayedColor:function(){return this.value||this.showPanelColor?this.displayedRgb(this.color,this.showAlpha):"transparent"},_elFormItemSize:function(){return(this.elFormItem||{}).elFormItemSize},colorSize:function(){return this.size||this._elFormItemSize||(this.$ELEMENT||{}).size},colorDisabled:function(){return this.disabled||(this.elForm||{}).disabled}},watch:{value:function(t){t?t&&t!==this.color.value&&this.color.fromString(t):this.showPanelColor=!1},color:{deep:!0,handler:function(){this.showPanelColor=!0}},displayedColor:function(t){if(this.showPicker){var e=new Ll({enableAlpha:this.showAlpha,format:this.colorFormat});e.fromString(this.value),t!==this.displayedRgb(e,this.showAlpha)&&this.$emit("active-change",t)}}},methods:{handleTrigger:function(){this.colorDisabled||(this.showPicker=!this.showPicker)},confirmValue:function(){var t=this.color.value;this.$emit("input",t),this.$emit("change",t),this.dispatch("ElFormItem","el.form.change",t),this.showPicker=!1},clearValue:function(){this.$emit("input",null),this.$emit("change",null),null!==this.value&&this.dispatch("ElFormItem","el.form.change",null),this.showPanelColor=!1,this.showPicker=!1,this.resetColor()},hide:function(){this.showPicker=!1,this.resetColor()},resetColor:function(){var t=this;this.$nextTick(function(e){t.value?t.color.fromString(t.value):t.showPanelColor=!1})},displayedRgb:function(t,e){if(!(t instanceof Ll))throw Error("color should be instance of Color Class");var n=t.toRgb(),r=n.r,i=n.g,o=n.b;return e?"rgba("+r+", "+i+", "+o+", "+t.get("alpha")/100+")":"rgb("+r+", "+i+", "+o+")"}},mounted:function(){var t=this.value;t&&this.color.fromString(t),this.popperElm=this.$refs.dropdown.$el},data:function(){return{color:new Ll({enableAlpha:this.showAlpha,format:this.colorFormat}),showPicker:!1,showPanelColor:!1}},components:{PickerDropdown:Zl}},Sl,[],!1,null,null,null);Ql.options.__file="packages/color-picker/src/main.vue";var tu=Ql.exports;tu.install=function(t){t.component(tu.name,tu)};var eu=tu,nu=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"el-transfer"},[n("transfer-panel",t._b({ref:"leftPanel",attrs:{data:t.sourceData,title:t.titles[0]||t.t("el.transfer.titles.0"),"default-checked":t.leftDefaultChecked,placeholder:t.filterPlaceholder||t.t("el.transfer.filterPlaceholder")},on:{"checked-change":t.onSourceCheckedChange}},"transfer-panel",t.$props,!1),[t._t("left-footer")],2),n("div",{staticClass:"el-transfer__buttons"},[n("el-button",{class:["el-transfer__button",t.hasButtonTexts?"is-with-texts":""],attrs:{type:"primary",disabled:0===t.rightChecked.length},nativeOn:{click:function(e){return t.addToLeft(e)}}},[n("i",{staticClass:"el-icon-arrow-left"}),void 0!==t.buttonTexts[0]?n("span",[t._v(t._s(t.buttonTexts[0]))]):t._e()]),n("el-button",{class:["el-transfer__button",t.hasButtonTexts?"is-with-texts":""],attrs:{type:"primary",disabled:0===t.leftChecked.length},nativeOn:{click:function(e){return t.addToRight(e)}}},[void 0!==t.buttonTexts[1]?n("span",[t._v(t._s(t.buttonTexts[1]))]):t._e(),n("i",{staticClass:"el-icon-arrow-right"})])],1),n("transfer-panel",t._b({ref:"rightPanel",attrs:{data:t.targetData,title:t.titles[1]||t.t("el.transfer.titles.1"),"default-checked":t.rightDefaultChecked,placeholder:t.filterPlaceholder||t.t("el.transfer.filterPlaceholder")},on:{"checked-change":t.onTargetCheckedChange}},"transfer-panel",t.$props,!1),[t._t("right-footer")],2)],1)};nu._withStripped=!0;var ru=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"el-transfer-panel"},[n("p",{staticClass:"el-transfer-panel__header"},[n("el-checkbox",{attrs:{indeterminate:t.isIndeterminate},on:{change:t.handleAllCheckedChange},model:{value:t.allChecked,callback:function(e){t.allChecked=e},expression:"allChecked"}},[t._v("\n "+t._s(t.title)+"\n "),n("span",[t._v(t._s(t.checkedSummary))])])],1),n("div",{class:["el-transfer-panel__body",t.hasFooter?"is-with-footer":""]},[t.filterable?n("el-input",{staticClass:"el-transfer-panel__filter",attrs:{size:"small",placeholder:t.placeholder},nativeOn:{mouseenter:function(e){t.inputHover=!0},mouseleave:function(e){t.inputHover=!1}},model:{value:t.query,callback:function(e){t.query=e},expression:"query"}},[n("i",{class:["el-input__icon","el-icon-"+t.inputIcon],attrs:{slot:"prefix"},on:{click:t.clearQuery},slot:"prefix"})]):t._e(),n("el-checkbox-group",{directives:[{name:"show",rawName:"v-show",value:!t.hasNoMatch&&t.data.length>0,expression:"!hasNoMatch && data.length > 0"}],staticClass:"el-transfer-panel__list",class:{"is-filterable":t.filterable},model:{value:t.checked,callback:function(e){t.checked=e},expression:"checked"}},t._l(t.filteredData,function(e){return n("el-checkbox",{key:e[t.keyProp],staticClass:"el-transfer-panel__item",attrs:{label:e[t.keyProp],disabled:e[t.disabledProp]}},[n("option-content",{attrs:{option:e}})],1)}),1),n("p",{directives:[{name:"show",rawName:"v-show",value:t.hasNoMatch,expression:"hasNoMatch"}],staticClass:"el-transfer-panel__empty"},[t._v(t._s(t.t("el.transfer.noMatch")))]),n("p",{directives:[{name:"show",rawName:"v-show",value:0===t.data.length&&!t.hasNoMatch,expression:"data.length === 0 && !hasNoMatch"}],staticClass:"el-transfer-panel__empty"},[t._v(t._s(t.t("el.transfer.noData")))])],1),t.hasFooter?n("p",{staticClass:"el-transfer-panel__footer"},[t._t("default")],2):t._e()])};ru._withStripped=!0;var iu=i({mixins:[f.a],name:"ElTransferPanel",componentName:"ElTransferPanel",components:{ElCheckboxGroup:Gn.a,ElCheckbox:rn.a,ElInput:d.a,OptionContent:{props:{option:Object},render:function(t){var e=function t(e){return"ElTransferPanel"===e.$options.componentName?e:e.$parent?t(e.$parent):e}(this),n=e.$parent||e;return e.renderContent?e.renderContent(t,this.option):n.$scopedSlots.default?n.$scopedSlots.default({option:this.option}):t("span",[this.option[e.labelProp]||this.option[e.keyProp]])}}},props:{data:{type:Array,default:function(){return[]}},renderContent:Function,placeholder:String,title:String,filterable:Boolean,format:Object,filterMethod:Function,defaultChecked:Array,props:Object},data:function(){return{checked:[],allChecked:!1,query:"",inputHover:!1,checkChangeByUser:!0}},watch:{checked:function(t,e){if(this.updateAllChecked(),this.checkChangeByUser){var n=t.concat(e).filter(function(n){return-1===t.indexOf(n)||-1===e.indexOf(n)});this.$emit("checked-change",t,n)}else this.$emit("checked-change",t),this.checkChangeByUser=!0},data:function(){var t=this,e=[],n=this.filteredData.map(function(e){return e[t.keyProp]});this.checked.forEach(function(t){n.indexOf(t)>-1&&e.push(t)}),this.checkChangeByUser=!1,this.checked=e},checkableData:function(){this.updateAllChecked()},defaultChecked:{immediate:!0,handler:function(t,e){var n=this;if(!e||t.length!==e.length||!t.every(function(t){return e.indexOf(t)>-1})){var r=[],i=this.checkableData.map(function(t){return t[n.keyProp]});t.forEach(function(t){i.indexOf(t)>-1&&r.push(t)}),this.checkChangeByUser=!1,this.checked=r}}}},computed:{filteredData:function(){var t=this;return this.data.filter(function(e){return"function"==typeof t.filterMethod?t.filterMethod(t.query,e):(e[t.labelProp]||e[t.keyProp].toString()).toLowerCase().indexOf(t.query.toLowerCase())>-1})},checkableData:function(){var t=this;return this.filteredData.filter(function(e){return!e[t.disabledProp]})},checkedSummary:function(){var t=this.checked.length,e=this.data.length,n=this.format,r=n.noChecked,i=n.hasChecked;return r&&i?t>0?i.replace(/\${checked}/g,t).replace(/\${total}/g,e):r.replace(/\${total}/g,e):t+"/"+e},isIndeterminate:function(){var t=this.checked.length;return t>0&&t<this.checkableData.length},hasNoMatch:function(){return this.query.length>0&&0===this.filteredData.length},inputIcon:function(){return this.query.length>0&&this.inputHover?"circle-close":"search"},labelProp:function(){return this.props.label||"label"},keyProp:function(){return this.props.key||"key"},disabledProp:function(){return this.props.disabled||"disabled"},hasFooter:function(){return!!this.$slots.default}},methods:{updateAllChecked:function(){var t=this,e=this.checkableData.map(function(e){return e[t.keyProp]});this.allChecked=e.length>0&&e.every(function(e){return t.checked.indexOf(e)>-1})},handleAllCheckedChange:function(t){var e=this;this.checked=t?this.checkableData.map(function(t){return t[e.keyProp]}):[]},clearQuery:function(){"circle-close"===this.inputIcon&&(this.query="")}}},ru,[],!1,null,null,null);iu.options.__file="packages/transfer/src/transfer-panel.vue";var ou=iu.exports,su=i({name:"ElTransfer",mixins:[w.a,f.a,x.a],components:{TransferPanel:ou,ElButton:z.a},props:{data:{type:Array,default:function(){return[]}},titles:{type:Array,default:function(){return[]}},buttonTexts:{type:Array,default:function(){return[]}},filterPlaceholder:{type:String,default:""},filterMethod:Function,leftDefaultChecked:{type:Array,default:function(){return[]}},rightDefaultChecked:{type:Array,default:function(){return[]}},renderContent:Function,value:{type:Array,default:function(){return[]}},format:{type:Object,default:function(){return{}}},filterable:Boolean,props:{type:Object,default:function(){return{label:"label",key:"key",disabled:"disabled"}}},targetOrder:{type:String,default:"original"}},data:function(){return{leftChecked:[],rightChecked:[]}},computed:{dataObj:function(){var t=this.props.key;return this.data.reduce(function(e,n){return(e[n[t]]=n)&&e},{})},sourceData:function(){var t=this;return this.data.filter(function(e){return-1===t.value.indexOf(e[t.props.key])})},targetData:function(){var t=this;return"original"===this.targetOrder?this.data.filter(function(e){return t.value.indexOf(e[t.props.key])>-1}):this.value.reduce(function(e,n){var r=t.dataObj[n];return r&&e.push(r),e},[])},hasButtonTexts:function(){return 2===this.buttonTexts.length}},watch:{value:function(t){this.dispatch("ElFormItem","el.form.change",t)}},methods:{getMigratingConfig:function(){return{props:{"footer-format":"footer-format is renamed to format."}}},onSourceCheckedChange:function(t,e){this.leftChecked=t,void 0!==e&&this.$emit("left-check-change",t,e)},onTargetCheckedChange:function(t,e){this.rightChecked=t,void 0!==e&&this.$emit("right-check-change",t,e)},addToLeft:function(){var t=this.value.slice();this.rightChecked.forEach(function(e){var n=t.indexOf(e);n>-1&&t.splice(n,1)}),this.$emit("input",t),this.$emit("change",t,"left",this.rightChecked)},addToRight:function(){var t=this,e=this.value.slice(),n=[],r=this.props.key;this.data.forEach(function(e){var i=e[r];t.leftChecked.indexOf(i)>-1&&-1===t.value.indexOf(i)&&n.push(i)}),e="unshift"===this.targetOrder?n.concat(e):e.concat(n),this.$emit("input",e),this.$emit("change",e,"right",this.leftChecked)},clearQuery:function(t){"left"===t?this.$refs.leftPanel.query="":"right"===t&&(this.$refs.rightPanel.query="")}}},nu,[],!1,null,null,null);su.options.__file="packages/transfer/src/main.vue";var au=su.exports;au.install=function(t){t.component(au.name,au)};var lu=au,uu=function(){var t=this.$createElement;return(this._self._c||t)("section",{staticClass:"el-container",class:{"is-vertical":this.isVertical}},[this._t("default")],2)};uu._withStripped=!0;var cu=i({name:"ElContainer",componentName:"ElContainer",props:{direction:String},computed:{isVertical:function(){return"vertical"===this.direction||"horizontal"!==this.direction&&(!(!this.$slots||!this.$slots.default)&&this.$slots.default.some(function(t){var e=t.componentOptions&&t.componentOptions.tag;return"el-header"===e||"el-footer"===e}))}}},uu,[],!1,null,null,null);cu.options.__file="packages/container/src/main.vue";var hu=cu.exports;hu.install=function(t){t.component(hu.name,hu)};var du=hu,pu=function(){var t=this.$createElement;return(this._self._c||t)("header",{staticClass:"el-header",style:{height:this.height}},[this._t("default")],2)};pu._withStripped=!0;var fu=i({name:"ElHeader",componentName:"ElHeader",props:{height:{type:String,default:"60px"}}},pu,[],!1,null,null,null);fu.options.__file="packages/header/src/main.vue";var gu=fu.exports;gu.install=function(t){t.component(gu.name,gu)};var mu=gu,vu=function(){var t=this.$createElement;return(this._self._c||t)("aside",{staticClass:"el-aside",style:{width:this.width}},[this._t("default")],2)};vu._withStripped=!0;var bu=i({name:"ElAside",componentName:"ElAside",props:{width:{type:String,default:"300px"}}},vu,[],!1,null,null,null);bu.options.__file="packages/aside/src/main.vue";var _u=bu.exports;_u.install=function(t){t.component(_u.name,_u)};var yu=_u,Tu=function(){var t=this.$createElement;return(this._self._c||t)("main",{staticClass:"el-main"},[this._t("default")],2)};Tu._withStripped=!0;var xu=i({name:"ElMain",componentName:"ElMain"},Tu,[],!1,null,null,null);xu.options.__file="packages/main/src/main.vue";var Eu=xu.exports;Eu.install=function(t){t.component(Eu.name,Eu)};var wu=Eu,Cu=function(){var t=this.$createElement;return(this._self._c||t)("footer",{staticClass:"el-footer",style:{height:this.height}},[this._t("default")],2)};Cu._withStripped=!0;var Su=i({name:"ElFooter",componentName:"ElFooter",props:{height:{type:String,default:"60px"}}},Cu,[],!1,null,null,null);Su.options.__file="packages/footer/src/main.vue";var ku=Su.exports;ku.install=function(t){t.component(ku.name,ku)};var Ou=ku,Iu=i({name:"ElTimeline",props:{reverse:{type:Boolean,default:!1}},provide:function(){return{timeline:this}},render:function(){var t=arguments[0],e=this.reverse,n={"el-timeline":!0,"is-reverse":e},r=this.$slots.default||[];return e&&(r=r.reverse()),t("ul",{class:n},[r])}},void 0,void 0,!1,null,null,null);Iu.options.__file="packages/timeline/src/main.vue";var Ru=Iu.exports;Ru.install=function(t){t.component(Ru.name,Ru)};var Au=Ru,Nu=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("li",{staticClass:"el-timeline-item"},[n("div",{staticClass:"el-timeline-item__tail"}),t.$slots.dot?t._e():n("div",{staticClass:"el-timeline-item__node",class:["el-timeline-item__node--"+(t.size||""),"el-timeline-item__node--"+(t.type||"")],style:{backgroundColor:t.color}},[t.icon?n("i",{staticClass:"el-timeline-item__icon",class:t.icon}):t._e()]),t.$slots.dot?n("div",{staticClass:"el-timeline-item__dot"},[t._t("dot")],2):t._e(),n("div",{staticClass:"el-timeline-item__wrapper"},[t.hideTimestamp||"top"!==t.placement?t._e():n("div",{staticClass:"el-timeline-item__timestamp is-top"},[t._v("\n "+t._s(t.timestamp)+"\n ")]),n("div",{staticClass:"el-timeline-item__content"},[t._t("default")],2),t.hideTimestamp||"bottom"!==t.placement?t._e():n("div",{staticClass:"el-timeline-item__timestamp is-bottom"},[t._v("\n "+t._s(t.timestamp)+"\n ")])])])};Nu._withStripped=!0;var Du=i({name:"ElTimelineItem",inject:["timeline"],props:{timestamp:String,hideTimestamp:{type:Boolean,default:!1},placement:{type:String,default:"bottom"},type:String,color:String,size:{type:String,default:"normal"},icon:String}},Nu,[],!1,null,null,null);Du.options.__file="packages/timeline/src/item.vue";var Mu=Du.exports;Mu.install=function(t){t.component(Mu.name,Mu)};var Lu=Mu,Pu=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("a",t._b({class:["el-link",t.type?"el-link--"+t.type:"",t.disabled&&"is-disabled",t.underline&&!t.disabled&&"is-underline"],attrs:{href:t.disabled?null:t.href},on:{click:t.handleClick}},"a",t.$attrs,!1),[t.icon?n("i",{class:t.icon}):t._e(),t.$slots.default?n("span",{staticClass:"el-link--inner"},[t._t("default")],2):t._e(),t.$slots.icon?[t.$slots.icon?t._t("icon"):t._e()]:t._e()],2)};Pu._withStripped=!0;var Fu=i({name:"ElLink",props:{type:{type:String,default:"default"},underline:{type:Boolean,default:!0},disabled:Boolean,href:String,icon:String},methods:{handleClick:function(t){this.disabled||this.href||this.$emit("click",t)}}},Pu,[],!1,null,null,null);Fu.options.__file="packages/link/src/main.vue";var Bu=Fu.exports;Bu.install=function(t){t.component(Bu.name,Bu)};var ju=Bu,$u=function(t,e){var n=e._c;return n("div",e._g(e._b({class:[e.data.staticClass,"el-divider","el-divider--"+e.props.direction]},"div",e.data.attrs,!1),e.listeners),[e.slots().default&&"vertical"!==e.props.direction?n("div",{class:["el-divider__text","is-"+e.props.contentPosition]},[e._t("default")],2):e._e()])};$u._withStripped=!0;var Uu=i({name:"ElDivider",props:{direction:{type:String,default:"horizontal",validator:function(t){return-1!==["horizontal","vertical"].indexOf(t)}},contentPosition:{type:String,default:"center",validator:function(t){return-1!==["left","center","right"].indexOf(t)}}}},$u,[],!0,null,null,null);Uu.options.__file="packages/divider/src/main.vue";var Vu=Uu.exports;Vu.install=function(t){t.component(Vu.name,Vu)};var Hu=Vu,Wu=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"el-image"},[t.loading?t._t("placeholder",[n("div",{staticClass:"el-image__placeholder"})]):t.error?t._t("error",[n("div",{staticClass:"el-image__error"},[t._v(t._s(t.t("el.image.error")))])]):n("img",t._g(t._b({staticClass:"el-image__inner",class:{"el-image__inner--center":t.alignCenter,"el-image__preview":t.preview},style:t.imageStyle,attrs:{src:t.src},on:{click:t.clickHandler}},"img",t.$attrs,!1),t.$listeners)),t.preview?[t.showViewer?n("image-viewer",{attrs:{"z-index":t.zIndex,"initial-index":t.imageIndex,"on-close":t.closeViewer,"url-list":t.previewSrcList}}):t._e()]:t._e()],2)};Wu._withStripped=!0;var Gu=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("transition",{attrs:{name:"viewer-fade"}},[n("div",{ref:"el-image-viewer__wrapper",staticClass:"el-image-viewer__wrapper",style:{"z-index":t.viewerZIndex},attrs:{tabindex:"-1"}},[n("div",{staticClass:"el-image-viewer__mask",on:{click:function(e){return e.target!==e.currentTarget?null:t.handleMaskClick(e)}}}),n("span",{staticClass:"el-image-viewer__btn el-image-viewer__close",on:{click:t.hide}},[n("i",{staticClass:"el-icon-close"})]),t.isSingle?t._e():[n("span",{staticClass:"el-image-viewer__btn el-image-viewer__prev",class:{"is-disabled":!t.infinite&&t.isFirst},on:{click:t.prev}},[n("i",{staticClass:"el-icon-arrow-left"})]),n("span",{staticClass:"el-image-viewer__btn el-image-viewer__next",class:{"is-disabled":!t.infinite&&t.isLast},on:{click:t.next}},[n("i",{staticClass:"el-icon-arrow-right"})])],n("div",{staticClass:"el-image-viewer__btn el-image-viewer__actions"},[n("div",{staticClass:"el-image-viewer__actions__inner"},[n("i",{staticClass:"el-icon-zoom-out",on:{click:function(e){t.handleActions("zoomOut")}}}),n("i",{staticClass:"el-icon-zoom-in",on:{click:function(e){t.handleActions("zoomIn")}}}),n("i",{staticClass:"el-image-viewer__actions__divider"}),n("i",{class:t.mode.icon,on:{click:t.toggleMode}}),n("i",{staticClass:"el-image-viewer__actions__divider"}),n("i",{staticClass:"el-icon-refresh-left",on:{click:function(e){t.handleActions("anticlocelise")}}}),n("i",{staticClass:"el-icon-refresh-right",on:{click:function(e){t.handleActions("clocelise")}}})])]),n("div",{staticClass:"el-image-viewer__canvas"},t._l(t.urlList,function(e,r){return r===t.index?n("img",{key:e,ref:"img",refInFor:!0,staticClass:"el-image-viewer__img",style:t.imgStyle,attrs:{src:t.currentImg},on:{load:t.handleImgLoad,error:t.handleImgError,mousedown:t.handleMouseDown}}):t._e()}),0)],2)])};Gu._withStripped=!0;var zu=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Xu={CONTAIN:{name:"contain",icon:"el-icon-full-screen"},ORIGINAL:{name:"original",icon:"el-icon-c-scale-to-original"}},Ku=Object(g.isFirefox)()?"DOMMouseScroll":"mousewheel",Yu=i({name:"elImageViewer",props:{urlList:{type:Array,default:function(){return[]}},zIndex:{type:Number,default:2e3},onSwitch:{type:Function,default:function(){}},onClose:{type:Function,default:function(){}},initialIndex:{type:Number,default:0},appendToBody:{type:Boolean,default:!0},maskClosable:{type:Boolean,default:!0}},data:function(){return{index:this.initialIndex,isShow:!1,infinite:!0,loading:!1,mode:Xu.CONTAIN,transform:{scale:1,deg:0,offsetX:0,offsetY:0,enableTransition:!1}}},computed:{isSingle:function(){return this.urlList.length<=1},isFirst:function(){return 0===this.index},isLast:function(){return this.index===this.urlList.length-1},currentImg:function(){return this.urlList[this.index]},imgStyle:function(){var t=this.transform,e=t.scale,n=t.deg,r=t.offsetX,i=t.offsetY,o={transform:"scale("+e+") rotate("+n+"deg)",transition:t.enableTransition?"transform .3s":"","margin-left":r+"px","margin-top":i+"px"};return this.mode===Xu.CONTAIN&&(o.maxWidth=o.maxHeight="100%"),o},viewerZIndex:function(){var t=_.PopupManager.nextZIndex();return this.zIndex>t?this.zIndex:t}},watch:{index:{handler:function(t){this.reset(),this.onSwitch(t)}},currentImg:function(t){var e=this;this.$nextTick(function(t){e.$refs.img[0].complete||(e.loading=!0)})}},methods:{hide:function(){this.deviceSupportUninstall(),this.onClose()},deviceSupportInstall:function(){var t=this;this._keyDownHandler=function(e){switch(e.stopPropagation(),e.keyCode){case 27:t.hide();break;case 32:t.toggleMode();break;case 37:t.prev();break;case 38:t.handleActions("zoomIn");break;case 39:t.next();break;case 40:t.handleActions("zoomOut")}},this._mouseWheelHandler=Object(g.rafThrottle)(function(e){(e.wheelDelta?e.wheelDelta:-e.detail)>0?t.handleActions("zoomIn",{zoomRate:.015,enableTransition:!1}):t.handleActions("zoomOut",{zoomRate:.015,enableTransition:!1})}),Object(ft.on)(document,"keydown",this._keyDownHandler),Object(ft.on)(document,Ku,this._mouseWheelHandler)},deviceSupportUninstall:function(){Object(ft.off)(document,"keydown",this._keyDownHandler),Object(ft.off)(document,Ku,this._mouseWheelHandler),this._keyDownHandler=null,this._mouseWheelHandler=null},handleImgLoad:function(t){this.loading=!1},handleImgError:function(t){this.loading=!1,t.target.alt="加载失败"},handleMouseDown:function(t){var e=this;if(!this.loading&&0===t.button){var n=this.transform,r=n.offsetX,i=n.offsetY,o=t.pageX,s=t.pageY;this._dragHandler=Object(g.rafThrottle)(function(t){e.transform.offsetX=r+t.pageX-o,e.transform.offsetY=i+t.pageY-s}),Object(ft.on)(document,"mousemove",this._dragHandler),Object(ft.on)(document,"mouseup",function(t){Object(ft.off)(document,"mousemove",e._dragHandler)}),t.preventDefault()}},handleMaskClick:function(){this.maskClosable&&this.hide()},reset:function(){this.transform={scale:1,deg:0,offsetX:0,offsetY:0,enableTransition:!1}},toggleMode:function(){if(!this.loading){var t=Object.keys(Xu),e=(Object.values(Xu).indexOf(this.mode)+1)%t.length;this.mode=Xu[t[e]],this.reset()}},prev:function(){if(!this.isFirst||this.infinite){var t=this.urlList.length;this.index=(this.index-1+t)%t}},next:function(){if(!this.isLast||this.infinite){var t=this.urlList.length;this.index=(this.index+1)%t}},handleActions:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.loading){var n=zu({zoomRate:.2,rotateDeg:90,enableTransition:!0},e),r=n.zoomRate,i=n.rotateDeg,o=n.enableTransition,s=this.transform;switch(t){case"zoomOut":s.scale>.2&&(s.scale=parseFloat((s.scale-r).toFixed(3)));break;case"zoomIn":s.scale=parseFloat((s.scale+r).toFixed(3));break;case"clocelise":s.deg+=i;break;case"anticlocelise":s.deg-=i}s.enableTransition=o}}},mounted:function(){this.deviceSupportInstall(),this.appendToBody&&document.body.appendChild(this.$el),this.$refs["el-image-viewer__wrapper"].focus()},destroyed:function(){this.appendToBody&&this.$el&&this.$el.parentNode&&this.$el.parentNode.removeChild(this.$el)}},Gu,[],!1,null,null,null);Yu.options.__file="packages/image/src/image-viewer.vue";var qu=Yu.exports,Ju=function(){return void 0!==document.documentElement.style.objectFit},Zu="none",Qu="contain",tc="cover",ec="fill",nc="scale-down",rc="",ic=i({name:"ElImage",mixins:[f.a],inheritAttrs:!1,components:{ImageViewer:qu},props:{src:String,fit:String,lazy:Boolean,scrollContainer:{},previewSrcList:{type:Array,default:function(){return[]}},zIndex:{type:Number,default:2e3}},data:function(){return{loading:!0,error:!1,show:!this.lazy,imageWidth:0,imageHeight:0,showViewer:!1}},computed:{imageStyle:function(){var t=this.fit;return!this.$isServer&&t?Ju()?{"object-fit":t}:this.getImageStyle(t):{}},alignCenter:function(){return!this.$isServer&&!Ju()&&this.fit!==ec},preview:function(){var t=this.previewSrcList;return Array.isArray(t)&&t.length>0},imageIndex:function(){var t=0,e=this.previewSrcList.indexOf(this.src);return e>=0&&(t=e),t}},watch:{src:function(t){this.show&&this.loadImage()},show:function(t){t&&this.loadImage()}},mounted:function(){this.lazy?this.addLazyLoadListener():this.loadImage()},beforeDestroy:function(){this.lazy&&this.removeLazyLoadListener()},methods:{loadImage:function(){var t=this;if(!this.$isServer){this.loading=!0,this.error=!1;var e=new Image;e.onload=function(n){return t.handleLoad(n,e)},e.onerror=this.handleError.bind(this),Object.keys(this.$attrs).forEach(function(n){var r=t.$attrs[n];e.setAttribute(n,r)}),e.src=this.src}},handleLoad:function(t,e){this.imageWidth=e.width,this.imageHeight=e.height,this.loading=!1,this.error=!1},handleError:function(t){this.loading=!1,this.error=!0,this.$emit("error",t)},handleLazyLoad:function(){Object(ft.isInContainer)(this.$el,this._scrollContainer)&&(this.show=!0,this.removeLazyLoadListener())},addLazyLoadListener:function(){if(!this.$isServer){var t=this.scrollContainer,e=null;(e=Object(Ma.isHtmlElement)(t)?t:Object(Ma.isString)(t)?document.querySelector(t):Object(ft.getScrollContainer)(this.$el))&&(this._scrollContainer=e,this._lazyLoadHandler=Ka()(200,this.handleLazyLoad),Object(ft.on)(e,"scroll",this._lazyLoadHandler),this.handleLazyLoad())}},removeLazyLoadListener:function(){var t=this._scrollContainer,e=this._lazyLoadHandler;!this.$isServer&&t&&e&&(Object(ft.off)(t,"scroll",e),this._scrollContainer=null,this._lazyLoadHandler=null)},getImageStyle:function(t){var e=this.imageWidth,n=this.imageHeight,r=this.$el,i=r.clientWidth,o=r.clientHeight;if(!(e&&n&&i&&o))return{};var s=e/n,a=i/o;t===nc&&(t=e<i&&n<o?Zu:Qu);switch(t){case Zu:return{width:"auto",height:"auto"};case Qu:return s<a?{width:"auto"}:{height:"auto"};case tc:return s<a?{height:"auto"}:{width:"auto"};default:return{}}},clickHandler:function(){this.preview&&(rc=document.body.style.overflow,document.body.style.overflow="hidden",this.showViewer=!0)},closeViewer:function(){document.body.style.overflow=rc,this.showViewer=!1}}},Wu,[],!1,null,null,null);ic.options.__file="packages/image/src/main.vue";var oc=ic.exports;oc.install=function(t){t.component(oc.name,oc)};var sc=oc,ac=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"el-calendar"},[n("div",{staticClass:"el-calendar__header"},[n("div",{staticClass:"el-calendar__title"},[t._v("\n "+t._s(t.i18nDate)+"\n ")]),0===t.validatedRange.length?n("div",{staticClass:"el-calendar__button-group"},[n("el-button-group",[n("el-button",{attrs:{type:"plain",size:"mini"},on:{click:function(e){t.selectDate("prev-month")}}},[t._v("\n "+t._s(t.t("el.datepicker.prevMonth"))+"\n ")]),n("el-button",{attrs:{type:"plain",size:"mini"},on:{click:function(e){t.selectDate("today")}}},[t._v("\n "+t._s(t.t("el.datepicker.today"))+"\n ")]),n("el-button",{attrs:{type:"plain",size:"mini"},on:{click:function(e){t.selectDate("next-month")}}},[t._v("\n "+t._s(t.t("el.datepicker.nextMonth"))+"\n ")])],1)],1):t._e()]),0===t.validatedRange.length?n("div",{key:"no-range",staticClass:"el-calendar__body"},[n("date-table",{attrs:{date:t.date,"selected-day":t.realSelectedDay,"first-day-of-week":t.realFirstDayOfWeek},on:{pick:t.pickDay}})],1):n("div",{key:"has-range",staticClass:"el-calendar__body"},t._l(t.validatedRange,function(e,r){return n("date-table",{key:r,attrs:{date:e[0],"selected-day":t.realSelectedDay,range:e,"hide-header":0!==r,"first-day-of-week":t.realFirstDayOfWeek},on:{pick:t.pickDay}})}),1)])};ac._withStripped=!0;var lc=n(20),uc=n.n(lc),cc=i({props:{selectedDay:String,range:{type:Array,validator:function(t){if(!t||!t.length)return!0;var e=t[0],n=t[1];return Object(dr.validateRangeInOneMonth)(e,n)}},date:Date,hideHeader:Boolean,firstDayOfWeek:Number},inject:["elCalendar"],methods:{toNestedArr:function(t){return Object(dr.range)(t.length/7).map(function(e,n){var r=7*n;return t.slice(r,r+7)})},getFormateDate:function(t,e){if(!t||-1===["prev","current","next"].indexOf(e))throw new Error("invalid day or type");var n=this.curMonthDatePrefix;return"prev"===e?n=this.prevMonthDatePrefix:"next"===e&&(n=this.nextMonthDatePrefix),n+"-"+(t=("00"+t).slice(-2))},getCellClass:function(t){var e=t.text,n=t.type,r=[n];if("current"===n){var i=this.getFormateDate(e,n);i===this.selectedDay&&r.push("is-selected"),i===this.formatedToday&&r.push("is-today")}return r},pickDay:function(t){var e=t.text,n=t.type,r=this.getFormateDate(e,n);this.$emit("pick",r)},cellRenderProxy:function(t){var e=t.text,n=t.type,r=this.$createElement,i=this.elCalendar.$scopedSlots.dateCell;if(!i)return r("span",[e]);var o=this.getFormateDate(e,n);return i({date:new Date(o),data:{isSelected:this.selectedDay===o,type:n+"-month",day:o}})}},computed:{WEEK_DAYS:function(){return Object(dr.getI18nSettings)().dayNames},prevMonthDatePrefix:function(){var t=new Date(this.date.getTime());return t.setDate(0),uc.a.format(t,"yyyy-MM")},curMonthDatePrefix:function(){return uc.a.format(this.date,"yyyy-MM")},nextMonthDatePrefix:function(){var t=new Date(this.date.getFullYear(),this.date.getMonth()+1,1);return uc.a.format(t,"yyyy-MM")},formatedToday:function(){return this.elCalendar.formatedToday},isInRange:function(){return this.range&&this.range.length},rows:function(){var t=[];if(this.isInRange){var e=this.range,n=e[0],r=e[1],i=Object(dr.range)(r.getDate()-n.getDate()+1).map(function(t,e){return{text:n.getDate()+e,type:"current"}}),o=i.length%7;o=0===o?0:7-o;var s=Object(dr.range)(o).map(function(t,e){return{text:e+1,type:"next"}});t=i.concat(s)}else{var a=this.date,l=Object(dr.getFirstDayOfMonth)(a),u=(7+(l=0===l?7:l)-("number"==typeof this.firstDayOfWeek?this.firstDayOfWeek:1))%7,c=Object(dr.getPrevMonthLastDays)(a,u).map(function(t){return{text:t,type:"prev"}}),h=Object(dr.getMonthDays)(a).map(function(t){return{text:t,type:"current"}});t=[].concat(c,h);var d=Object(dr.range)(42-t.length).map(function(t,e){return{text:e+1,type:"next"}});t=t.concat(d)}return this.toNestedArr(t)},weekDays:function(){var t=this.firstDayOfWeek,e=this.WEEK_DAYS;return"number"!=typeof t||0===t?e.slice():e.slice(t).concat(e.slice(0,t))}},render:function(){var t=this,e=arguments[0],n=this.hideHeader?null:e("thead",[this.weekDays.map(function(t){return e("th",{key:t},[t])})]);return e("table",{class:{"el-calendar-table":!0,"is-range":this.isInRange},attrs:{cellspacing:"0",cellpadding:"0"}},[n,e("tbody",[this.rows.map(function(n,r){return e("tr",{class:{"el-calendar-table__row":!0,"el-calendar-table__row--hide-border":0===r&&t.hideHeader},key:r},[n.map(function(n,r){return e("td",{key:r,class:t.getCellClass(n),on:{click:t.pickDay.bind(t,n)}},[e("div",{class:"el-calendar-day"},[t.cellRenderProxy(n)])])})])})])])}},void 0,void 0,!1,null,null,null);cc.options.__file="packages/calendar/src/date-table.vue";var hc=cc.exports,dc=["prev-month","today","next-month"],pc=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],fc=i({name:"ElCalendar",mixins:[f.a],components:{DateTable:hc,ElButton:z.a,ElButtonGroup:K.a},props:{value:[Date,String,Number],range:{type:Array,validator:function(t){return!Array.isArray(t)||2===t.length&&t.every(function(t){return"string"==typeof t||"number"==typeof t||t instanceof Date})}},firstDayOfWeek:{type:Number,default:1}},provide:function(){return{elCalendar:this}},methods:{pickDay:function(t){this.realSelectedDay=t},selectDate:function(t){if(-1===dc.indexOf(t))throw new Error("invalid type "+t);var e="";(e="prev-month"===t?this.prevMonthDatePrefix+"-01":"next-month"===t?this.nextMonthDatePrefix+"-01":this.formatedToday)!==this.formatedDate&&this.pickDay(e)},toDate:function(t){if(!t)throw new Error("invalid val");return t instanceof Date?t:new Date(t)},rangeValidator:function(t,e){var n=this.realFirstDayOfWeek,r=e?n:0===n?6:n-1,i=(e?"start":"end")+" of range should be "+pc[r]+".";return t.getDay()===r||(console.warn("[ElementCalendar]",i,"Invalid range will be ignored."),!1)}},computed:{prevMonthDatePrefix:function(){var t=new Date(this.date.getTime());return t.setDate(0),uc.a.format(t,"yyyy-MM")},curMonthDatePrefix:function(){return uc.a.format(this.date,"yyyy-MM")},nextMonthDatePrefix:function(){var t=new Date(this.date.getFullYear(),this.date.getMonth()+1,1);return uc.a.format(t,"yyyy-MM")},formatedDate:function(){return uc.a.format(this.date,"yyyy-MM-dd")},i18nDate:function(){var t=this.date.getFullYear(),e=this.date.getMonth()+1;return t+" "+this.t("el.datepicker.year")+" "+this.t("el.datepicker.month"+e)},formatedToday:function(){return uc.a.format(this.now,"yyyy-MM-dd")},realSelectedDay:{get:function(){return this.value?this.formatedDate:this.selectedDay},set:function(t){this.selectedDay=t;var e=new Date(t);this.$emit("input",e)}},date:function(){if(this.value)return this.toDate(this.value);if(this.realSelectedDay){var t=this.selectedDay.split("-");return new Date(t[0],t[1]-1,t[2])}return this.validatedRange.length?this.validatedRange[0][0]:this.now},validatedRange:function(){var t=this,e=this.range;if(!e)return[];if(2===(e=e.reduce(function(e,n,r){var i=t.toDate(n);return t.rangeValidator(i,0===r)&&(e=e.concat(i)),e},[])).length){var n=e,r=n[0],i=n[1];if(r>i)return console.warn("[ElementCalendar]end time should be greater than start time"),[];if(Object(dr.validateRangeInOneMonth)(r,i))return[[r,i]];var o=[],s=new Date(r.getFullYear(),r.getMonth()+1,1),a=this.toDate(s.getTime()-864e5);if(!Object(dr.validateRangeInOneMonth)(s,i))return console.warn("[ElementCalendar]start time and end time interval must not exceed two months"),[];o.push([r,a]);var l=this.realFirstDayOfWeek,u=s.getDay(),c=0;return u!==l&&(c=0===l?7-u:(c=l-u)>0?c:7+c),(s=this.toDate(s.getTime()+864e5*c)).getDate()<i.getDate()&&o.push([s,i]),o}return[]},realFirstDayOfWeek:function(){return this.firstDayOfWeek<1||this.firstDayOfWeek>6?0:Math.floor(this.firstDayOfWeek)}},data:function(){return{selectedDay:"",now:new Date}}},ac,[],!1,null,null,null);fc.options.__file="packages/calendar/src/main.vue";var gc=fc.exports;gc.install=function(t){t.component(gc.name,gc)};var mc=gc,vc=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("transition",{attrs:{name:"el-fade-in"}},[t.visible?n("div",{staticClass:"el-backtop",style:{right:t.styleRight,bottom:t.styleBottom},on:{click:function(e){return e.stopPropagation(),t.handleClick(e)}}},[t._t("default",[n("el-icon",{attrs:{name:"caret-top"}})])],2):t._e()])};vc._withStripped=!0;var bc=function(t){return Math.pow(t,3)},_c=i({name:"ElBacktop",props:{visibilityHeight:{type:Number,default:200},target:[String],right:{type:Number,default:40},bottom:{type:Number,default:40}},data:function(){return{el:null,container:null,visible:!1}},computed:{styleBottom:function(){return this.bottom+"px"},styleRight:function(){return this.right+"px"}},mounted:function(){this.init(),this.throttledScrollHandler=Ka()(300,this.onScroll),this.container.addEventListener("scroll",this.throttledScrollHandler)},methods:{init:function(){if(this.container=document,this.el=document.documentElement,this.target){if(this.el=document.querySelector(this.target),!this.el)throw new Error("target is not existed: "+this.target);this.container=this.el}},onScroll:function(){var t=this.el.scrollTop;this.visible=t>=this.visibilityHeight},handleClick:function(t){this.scrollToTop(),this.$emit("click",t)},scrollToTop:function(){var t=this.el,e=Date.now(),n=t.scrollTop,r=window.requestAnimationFrame||function(t){return setTimeout(t,16)};r(function i(){var o,s=(Date.now()-e)/500;s<1?(t.scrollTop=n*(1-((o=s)<.5?bc(2*o)/2:1-bc(2*(1-o))/2)),r(i)):t.scrollTop=0})}},beforeDestroy:function(){this.container.removeEventListener("scroll",this.throttledScrollHandler)}},vc,[],!1,null,null,null);_c.options.__file="packages/backtop/src/main.vue";var yc=_c.exports;yc.install=function(t){t.component(yc.name,yc)};var Tc=yc,xc=function(t,e){return t===window||t===document?document.documentElement[e]:t[e]},Ec=function(t){return xc(t,"offsetHeight")},wc="ElInfiniteScroll",Cc={delay:{type:Number,default:200},distance:{type:Number,default:0},disabled:{type:Boolean,default:!1},immediate:{type:Boolean,default:!0}},Sc=function(t,e){return Object(Ma.isHtmlElement)(t)?(n=Cc,Object.keys(n||{}).map(function(t){return[t,n[t]]})).reduce(function(n,r){var i=r[0],o=r[1],s=o.type,a=o.default,l=t.getAttribute("infinite-scroll-"+i);switch(l=Object(Ma.isUndefined)(e[l])?l:e[l],s){case Number:l=Number(l),l=Number.isNaN(l)?a:l;break;case Boolean:l=Object(Ma.isDefined)(l)?"false"!==l&&Boolean(l):a;break;default:l=s(l)}return n[i]=l,n},{}):{};var n},kc=function(t){return t.getBoundingClientRect().top},Oc=function(t){var e=this[wc],n=e.el,r=e.vm,i=e.container,o=e.observer,s=Sc(n,r),a=s.distance;if(!s.disabled){var l=i.getBoundingClientRect();if(l.width||l.height){var u=!1;if(i===n){var c=i.scrollTop+function(t){return xc(t,"clientHeight")}(i);u=i.scrollHeight-c<=a}else{u=Ec(n)+kc(n)-kc(i)-Ec(i)+Number.parseFloat(function(t,e){if(t===window&&(t=document.documentElement),1!==t.nodeType)return[];var n=window.getComputedStyle(t,null);return e?n[e]:n}(i,"borderBottomWidth"))<=a}u&&Object(Ma.isFunction)(t)?t.call(r):o&&(o.disconnect(),this[wc].observer=null)}}},Ic={name:"InfiniteScroll",inserted:function(t,e,n){var r=e.value,i=n.context,o=Object(ft.getScrollContainer)(t,!0),s=Sc(t,i),a=s.delay,l=s.immediate,u=R()(a,Oc.bind(t,r));(t[wc]={el:t,vm:i,container:o,onScroll:u},o)&&(o.addEventListener("scroll",u),l&&((t[wc].observer=new MutationObserver(u)).observe(o,{childList:!0,subtree:!0}),u()))},unbind:function(t){var e=t[wc],n=e.container,r=e.onScroll;n&&n.removeEventListener("scroll",r)},install:function(t){t.directive(Ic.name,Ic)}},Rc=Ic,Ac=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"el-page-header"},[n("div",{staticClass:"el-page-header__left",on:{click:function(e){t.$emit("back")}}},[n("i",{staticClass:"el-icon-back"}),n("div",{staticClass:"el-page-header__title"},[t._t("title",[t._v(t._s(t.title))])],2)]),n("div",{staticClass:"el-page-header__content"},[t._t("content",[t._v(t._s(t.content))])],2)])};Ac._withStripped=!0;var Nc=i({name:"ElPageHeader",props:{title:{type:String,default:function(){return Object(Mi.t)("el.pageHeader.title")}},content:String}},Ac,[],!1,null,null,null);Nc.options.__file="packages/page-header/src/main.vue";var Dc=Nc.exports;Dc.install=function(t){t.component(Dc.name,Dc)};var Mc=Dc,Lc=function(){var t=this.$createElement,e=this._self._c||t;return e("div",{class:["el-cascader-panel",this.border&&"is-bordered"],on:{keydown:this.handleKeyDown}},this._l(this.menus,function(t,n){return e("cascader-menu",{key:n,ref:"menu",refInFor:!0,attrs:{index:n,nodes:t}})}),1)};Lc._withStripped=!0;var Pc=n(43),Fc=n.n(Pc),Bc=function(t){return t.stopPropagation()},jc=i({inject:["panel"],components:{ElCheckbox:rn.a,ElRadio:Fc.a},props:{node:{required:!0},nodeId:String},computed:{config:function(){return this.panel.config},isLeaf:function(){return this.node.isLeaf},isDisabled:function(){return this.node.isDisabled},checkedValue:function(){return this.panel.checkedValue},isChecked:function(){return this.node.isSameNode(this.checkedValue)},inActivePath:function(){return this.isInPath(this.panel.activePath)},inCheckedPath:function(){var t=this;return!!this.config.checkStrictly&&this.panel.checkedNodePaths.some(function(e){return t.isInPath(e)})},value:function(){return this.node.getValueByOption()}},methods:{handleExpand:function(){var t=this,e=this.panel,n=this.node,r=this.isDisabled,i=this.config,o=i.multiple;!i.checkStrictly&&r||n.loading||(i.lazy&&!n.loaded?e.lazyLoad(n,function(){var e=t.isLeaf;if(e||t.handleExpand(),o){var r=!!e&&n.checked;t.handleMultiCheckChange(r)}}):e.handleExpand(n))},handleCheckChange:function(){var t=this.panel,e=this.value,n=this.node;t.handleCheckChange(e),t.handleExpand(n)},handleMultiCheckChange:function(t){this.node.doCheck(t),this.panel.calculateMultiCheckedValue()},isInPath:function(t){var e=this.node;return(t[e.level-1]||{}).uid===e.uid},renderPrefix:function(t){var e=this.isLeaf,n=this.isChecked,r=this.config,i=r.checkStrictly;return r.multiple?this.renderCheckbox(t):i?this.renderRadio(t):e&&n?this.renderCheckIcon(t):null},renderPostfix:function(t){var e=this.node,n=this.isLeaf;return e.loading?this.renderLoadingIcon(t):n?null:this.renderExpandIcon(t)},renderCheckbox:function(t){var e=this.node,n=this.config,r=this.isDisabled,i={on:{change:this.handleMultiCheckChange},nativeOn:{}};return n.checkStrictly&&(i.nativeOn.click=Bc),t("el-checkbox",Zs()([{attrs:{value:e.checked,indeterminate:e.indeterminate,disabled:r}},i]))},renderRadio:function(t){var e=this.checkedValue,n=this.value,r=this.isDisabled;return Object(g.isEqual)(n,e)&&(n=e),t("el-radio",{attrs:{value:e,label:n,disabled:r},on:{change:this.handleCheckChange},nativeOn:{click:Bc}},[t("span")])},renderCheckIcon:function(t){return t("i",{class:"el-icon-check el-cascader-node__prefix"})},renderLoadingIcon:function(t){return t("i",{class:"el-icon-loading el-cascader-node__postfix"})},renderExpandIcon:function(t){return t("i",{class:"el-icon-arrow-right el-cascader-node__postfix"})},renderContent:function(t){var e=this.panel,n=this.node,r=e.renderLabelFn;return t("span",{class:"el-cascader-node__label"},[(r?r({node:n,data:n.data}):null)||n.label])}},render:function(t){var e=this,n=this.inActivePath,r=this.inCheckedPath,i=this.isChecked,o=this.isLeaf,s=this.isDisabled,a=this.config,l=this.nodeId,u=a.expandTrigger,c=a.checkStrictly,h=a.multiple,d=!c&&s,p={on:{}};return"click"===u?p.on.click=this.handleExpand:(p.on.mouseenter=function(t){e.handleExpand(),e.$emit("expand",t)},p.on.focus=function(t){e.handleExpand(),e.$emit("expand",t)}),!o||s||c||h||(p.on.click=this.handleCheckChange),t("li",Zs()([{attrs:{role:"menuitem",id:l,"aria-expanded":n,tabindex:d?null:-1},class:{"el-cascader-node":!0,"is-selectable":c,"in-active-path":n,"in-checked-path":r,"is-active":i,"is-disabled":d}},p]),[this.renderPrefix(t),this.renderContent(t),this.renderPostfix(t)])}},void 0,void 0,!1,null,null,null);jc.options.__file="packages/cascader-panel/src/cascader-node.vue";var $c=jc.exports,Uc=i({name:"ElCascaderMenu",mixins:[f.a],inject:["panel"],components:{ElScrollbar:F.a,CascaderNode:$c},props:{nodes:{type:Array,required:!0},index:Number},data:function(){return{activeNode:null,hoverTimer:null,id:Object(g.generateId)()}},computed:{isEmpty:function(){return!this.nodes.length},menuId:function(){return"cascader-menu-"+this.id+"-"+this.index}},methods:{handleExpand:function(t){this.activeNode=t.target},handleMouseMove:function(t){var e=this.activeNode,n=this.hoverTimer,r=this.$refs.hoverZone;if(e&&r)if(e.contains(t.target)){clearTimeout(n);var i=this.$el.getBoundingClientRect().left,o=t.clientX-i,s=this.$el,a=s.offsetWidth,l=s.offsetHeight,u=e.offsetTop,c=u+e.offsetHeight;r.innerHTML='\n <path style="pointer-events: auto;" fill="transparent" d="M'+o+" "+u+" L"+a+" 0 V"+u+' Z" />\n <path style="pointer-events: auto;" fill="transparent" d="M'+o+" "+c+" L"+a+" "+l+" V"+c+' Z" />\n '}else n||(this.hoverTimer=setTimeout(this.clearHoverZone,this.panel.config.hoverThreshold))},clearHoverZone:function(){var t=this.$refs.hoverZone;t&&(t.innerHTML="")},renderEmptyText:function(t){return t("div",{class:"el-cascader-menu__empty-text"},[this.t("el.cascader.noData")])},renderNodeList:function(t){var e=this.menuId,n=this.panel.isHoverMenu,r={on:{}};n&&(r.on.expand=this.handleExpand);var i=this.nodes.map(function(n,i){var o=n.hasChildren;return t("cascader-node",Zs()([{key:n.uid,attrs:{node:n,"node-id":e+"-"+i,"aria-haspopup":o,"aria-owns":o?e:null}},r]))});return[].concat(i,[n?t("svg",{ref:"hoverZone",class:"el-cascader-menu__hover-zone"}):null])}},render:function(t){var e=this.isEmpty,n=this.menuId,r={nativeOn:{}};return this.panel.isHoverMenu&&(r.nativeOn.mousemove=this.handleMouseMove),t("el-scrollbar",Zs()([{attrs:{tag:"ul",role:"menu",id:n,"wrap-class":"el-cascader-menu__wrap","view-class":{"el-cascader-menu__list":!0,"is-empty":e}},class:"el-cascader-menu"},r]),[e?this.renderEmptyText(t):this.renderNodeList(t)])}},void 0,void 0,!1,null,null,null);Uc.options.__file="packages/cascader-panel/src/cascader-menu.vue";var Vc=Uc.exports,Hc=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();var Wc=0,Gc=function(){function t(e,n,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.data=e,this.config=n,this.parent=r||null,this.level=this.parent?this.parent.level+1:1,this.uid=Wc++,this.initState(),this.initChildren()}return t.prototype.initState=function(){var t=this.config,e=t.value,n=t.label;this.value=this.data[e],this.label=this.data[n],this.pathNodes=this.calculatePathNodes(),this.path=this.pathNodes.map(function(t){return t.value}),this.pathLabels=this.pathNodes.map(function(t){return t.label}),this.loading=!1,this.loaded=!1},t.prototype.initChildren=function(){var e=this,n=this.config,r=n.children,i=this.data[r];this.hasChildren=Array.isArray(i),this.children=(i||[]).map(function(r){return new t(r,n,e)})},t.prototype.calculatePathNodes=function(){for(var t=[this],e=this.parent;e;)t.unshift(e),e=e.parent;return t},t.prototype.getPath=function(){return this.path},t.prototype.getValue=function(){return this.value},t.prototype.getValueByOption=function(){return this.config.emitPath?this.getPath():this.getValue()},t.prototype.getText=function(t,e){return t?this.pathLabels.join(e):this.label},t.prototype.isSameNode=function(t){var e=this.getValueByOption();return this.config.multiple&&Array.isArray(t)?t.some(function(t){return Object(g.isEqual)(t,e)}):Object(g.isEqual)(t,e)},t.prototype.broadcast=function(t){for(var e=arguments.length,n=Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];var i="onParent"+Object(g.capitalize)(t);this.children.forEach(function(e){e&&(e.broadcast.apply(e,[t].concat(n)),e[i]&&e[i].apply(e,n))})},t.prototype.emit=function(t){var e=this.parent,n="onChild"+Object(g.capitalize)(t);if(e){for(var r=arguments.length,i=Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];e[n]&&e[n].apply(e,i),e.emit.apply(e,[t].concat(i))}},t.prototype.onParentCheck=function(t){this.isDisabled||this.setCheckState(t)},t.prototype.onChildCheck=function(){var t=this.children.filter(function(t){return!t.isDisabled}),e=!!t.length&&t.every(function(t){return t.checked});this.setCheckState(e)},t.prototype.setCheckState=function(t){var e=this.children.length,n=this.children.reduce(function(t,e){return t+(e.checked?1:e.indeterminate?.5:0)},0);this.checked=t,this.indeterminate=n!==e&&n>0},t.prototype.syncCheckState=function(t){var e=this.getValueByOption(),n=this.isSameNode(t,e);this.doCheck(n)},t.prototype.doCheck=function(t){this.checked!==t&&(this.config.checkStrictly?this.checked=t:(this.broadcast("check",t),this.setCheckState(t),this.emit("check")))},Hc(t,[{key:"isDisabled",get:function(){var t=this.data,e=this.parent,n=this.config,r=n.disabled,i=n.checkStrictly;return t[r]||!i&&e&&e.isDisabled}},{key:"isLeaf",get:function(){var t=this.data,e=this.loaded,n=this.hasChildren,r=this.children,i=this.config,o=i.lazy,s=i.leaf;if(o){var a=Object(Vt.isDef)(t[s])?t[s]:!!e&&!r.length;return this.hasChildren=!a,a}return!n}}]),t}();var zc=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.config=n,this.initNodes(e)}return t.prototype.initNodes=function(t){var e=this;t=Object(g.coerceTruthyValueToArray)(t),this.nodes=t.map(function(t){return new Gc(t,e.config)}),this.flattedNodes=this.getFlattedNodes(!1,!1),this.leafNodes=this.getFlattedNodes(!0,!1)},t.prototype.appendNode=function(t,e){var n=new Gc(t,this.config,e);(e?e.children:this.nodes).push(n)},t.prototype.appendNodes=function(t,e){var n=this;(t=Object(g.coerceTruthyValueToArray)(t)).forEach(function(t){return n.appendNode(t,e)})},t.prototype.getNodes=function(){return this.nodes},t.prototype.getFlattedNodes=function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=t?this.leafNodes:this.flattedNodes;return e?n:function t(e,n){return e.reduce(function(e,r){return r.isLeaf?e.push(r):(!n&&e.push(r),e=e.concat(t(r.children,n))),e},[])}(this.nodes,t)},t.prototype.getNodeByValue=function(t){if(t){var e=this.getFlattedNodes(!1,!this.config.lazy).filter(function(e){return Object(g.valueEquals)(e.path,t)||e.value===t});return e&&e.length?e[0]:null}return null},t}(),Xc=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Kc=bl.a.keys,Yc={expandTrigger:"click",multiple:!1,checkStrictly:!1,emitPath:!0,lazy:!1,lazyLoad:g.noop,value:"value",label:"label",children:"children",leaf:"leaf",disabled:"disabled",hoverThreshold:500},qc=function(t){return!t.getAttribute("aria-owns")},Jc=function(t,e){var n=t.parentNode;if(n){var r=n.querySelectorAll('.el-cascader-node[tabindex="-1"]');return r[Array.prototype.indexOf.call(r,t)+e]||null}return null},Zc=function(t,e){if(t){var n=t.id.split("-");return Number(n[n.length-2])}},Qc=function(t){t&&(t.focus(),!qc(t)&&t.click())},th=i({name:"ElCascaderPanel",components:{CascaderMenu:Vc},props:{value:{},options:Array,props:Object,border:{type:Boolean,default:!0},renderLabel:Function},provide:function(){return{panel:this}},data:function(){return{checkedValue:null,checkedNodePaths:[],store:[],menus:[],activePath:[],loadCount:0}},computed:{config:function(){return Ut()(Xc({},Yc),this.props||{})},multiple:function(){return this.config.multiple},checkStrictly:function(){return this.config.checkStrictly},leafOnly:function(){return!this.checkStrictly},isHoverMenu:function(){return"hover"===this.config.expandTrigger},renderLabelFn:function(){return this.renderLabel||this.$scopedSlots.default}},watch:{options:{handler:function(){this.initStore()},immediate:!0,deep:!0},value:function(){this.syncCheckedValue(),this.checkStrictly&&this.calculateCheckedNodePaths()},checkedValue:function(t){Object(g.isEqual)(t,this.value)||(this.checkStrictly&&this.calculateCheckedNodePaths(),this.$emit("input",t),this.$emit("change",t))}},mounted:function(){Object(g.isEmpty)(this.value)||this.syncCheckedValue()},methods:{initStore:function(){var t=this.config,e=this.options;t.lazy&&Object(g.isEmpty)(e)?this.lazyLoad():(this.store=new zc(e,t),this.menus=[this.store.getNodes()],this.syncMenuState())},syncCheckedValue:function(){var t=this.value,e=this.checkedValue;Object(g.isEqual)(t,e)||(this.activePath=[],this.checkedValue=t,this.syncMenuState())},syncMenuState:function(){var t=this.multiple,e=this.checkStrictly;this.syncActivePath(),t&&this.syncMultiCheckState(),e&&this.calculateCheckedNodePaths(),this.$nextTick(this.scrollIntoView)},syncMultiCheckState:function(){var t=this;this.getFlattedNodes(this.leafOnly).forEach(function(e){e.syncCheckState(t.checkedValue)})},syncActivePath:function(){var t=this,e=this.store,n=this.multiple,r=this.activePath,i=this.checkedValue;if(Object(g.isEmpty)(r))if(Object(g.isEmpty)(i))this.activePath=[],this.menus=[e.getNodes()];else{var o=n?i[0]:i,s=((this.getNodeByValue(o)||{}).pathNodes||[]).slice(0,-1);this.expandNodes(s)}else{var a=r.map(function(e){return t.getNodeByValue(e.getValue())});this.expandNodes(a)}},expandNodes:function(t){var e=this;t.forEach(function(t){return e.handleExpand(t,!0)})},calculateCheckedNodePaths:function(){var t=this,e=this.checkedValue,n=this.multiple?Object(g.coerceTruthyValueToArray)(e):[e];this.checkedNodePaths=n.map(function(e){var n=t.getNodeByValue(e);return n?n.pathNodes:[]})},handleKeyDown:function(t){var e=t.target;switch(t.keyCode){case Kc.up:var n=Jc(e,-1);Qc(n);break;case Kc.down:var r=Jc(e,1);Qc(r);break;case Kc.left:var i=this.$refs.menu[Zc(e)-1];if(i){var o=i.$el.querySelector('.el-cascader-node[aria-expanded="true"]');Qc(o)}break;case Kc.right:var s=this.$refs.menu[Zc(e)+1];if(s){var a=s.$el.querySelector('.el-cascader-node[tabindex="-1"]');Qc(a)}break;case Kc.enter:!function(t){if(t){var e=t.querySelector("input");e?e.click():qc(t)&&t.click()}}(e);break;case Kc.esc:case Kc.tab:this.$emit("close");break;default:return}},handleExpand:function(t,e){var n=this.activePath,r=t.level,i=n.slice(0,r-1),o=this.menus.slice(0,r);if(t.isLeaf||(i.push(t),o.push(t.children)),this.activePath=i,this.menus=o,!e){var s=i.map(function(t){return t.getValue()}),a=n.map(function(t){return t.getValue()});Object(g.valueEquals)(s,a)||(this.$emit("active-item-change",s),this.$emit("expand-change",s))}},handleCheckChange:function(t){this.checkedValue=t},lazyLoad:function(t,e){var n=this,r=this.config;t||(t=t||{root:!0,level:0},this.store=new zc([],r),this.menus=[this.store.getNodes()]),t.loading=!0;r.lazyLoad(t,function(r){var i=t.root?null:t;if(r&&r.length&&n.store.appendNodes(r,i),t.loading=!1,t.loaded=!0,Array.isArray(n.checkedValue)){var o=n.checkedValue[n.loadCount++],s=n.config.value,a=n.config.leaf;if(Array.isArray(r)&&r.filter(function(t){return t[s]===o}).length>0){var l=n.store.getNodeByValue(o);l.data[a]||n.lazyLoad(l,function(){n.handleExpand(l)}),n.loadCount===n.checkedValue.length&&n.$parent.computePresentText()}}e&&e(r)})},calculateMultiCheckedValue:function(){this.checkedValue=this.getCheckedNodes(this.leafOnly).map(function(t){return t.getValueByOption()})},scrollIntoView:function(){this.$isServer||(this.$refs.menu||[]).forEach(function(t){var e=t.$el;if(e){var n=e.querySelector(".el-scrollbar__wrap"),r=e.querySelector(".el-cascader-node.is-active")||e.querySelector(".el-cascader-node.in-active-path");Be()(n,r)}})},getNodeByValue:function(t){return this.store.getNodeByValue(t)},getFlattedNodes:function(t){var e=!this.config.lazy;return this.store.getFlattedNodes(t,e)},getCheckedNodes:function(t){var e=this.checkedValue;return this.multiple?this.getFlattedNodes(t).filter(function(t){return t.checked}):Object(g.isEmpty)(e)?[]:[this.getNodeByValue(e)]},clearCheckedNodes:function(){var t=this.config,e=this.leafOnly,n=t.multiple,r=t.emitPath;n?(this.getCheckedNodes(e).filter(function(t){return!t.isDisabled}).forEach(function(t){return t.doCheck(!1)}),this.calculateMultiCheckedValue()):this.checkedValue=r?[]:null}}},Lc,[],!1,null,null,null);th.options.__file="packages/cascader-panel/src/cascader-panel.vue";var eh=th.exports;eh.install=function(t){t.component(eh.name,eh)};var nh=eh,rh=i({name:"ElAvatar",props:{size:{type:[Number,String],validator:function(t){return"string"==typeof t?["large","medium","small"].includes(t):"number"==typeof t}},shape:{type:String,default:"circle",validator:function(t){return["circle","square"].includes(t)}},icon:String,src:String,alt:String,srcSet:String,error:Function,fit:{type:String,default:"cover"}},data:function(){return{isImageExist:!0}},computed:{avatarClass:function(){var t=this.size,e=this.icon,n=this.shape,r=["el-avatar"];return t&&"string"==typeof t&&r.push("el-avatar--"+t),e&&r.push("el-avatar--icon"),n&&r.push("el-avatar--"+n),r.join(" ")}},methods:{handleError:function(){var t=this.error;!1!==(t?t():void 0)&&(this.isImageExist=!1)},renderAvatar:function(){var t=this.$createElement,e=this.icon,n=this.src,r=this.alt,i=this.isImageExist,o=this.srcSet,s=this.fit;return i&&n?t("img",{attrs:{src:n,alt:r,srcSet:o},on:{error:this.handleError},style:{"object-fit":s}}):e?t("i",{class:e}):this.$slots.default}},render:function(){var t=arguments[0],e=this.avatarClass,n=this.size;return t("span",{class:e,style:"number"==typeof n?{height:n+"px",width:n+"px",lineHeight:n+"px"}:{}},[this.renderAvatar()])}},void 0,void 0,!1,null,null,null);rh.options.__file="packages/avatar/src/main.vue";var ih=rh.exports;ih.install=function(t){t.component(ih.name,ih)};var oh=ih,sh=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("transition",{attrs:{name:"el-drawer-fade"},on:{"after-enter":t.afterEnter,"after-leave":t.afterLeave}},[n("div",{directives:[{name:"show",rawName:"v-show",value:t.visible,expression:"visible"}],staticClass:"el-drawer__wrapper",attrs:{tabindex:"-1"}},[n("div",{staticClass:"el-drawer__container",class:t.visible&&"el-drawer__open",attrs:{role:"document",tabindex:"-1"},on:{click:function(e){return e.target!==e.currentTarget?null:t.handleWrapperClick(e)}}},[n("div",{ref:"drawer",staticClass:"el-drawer",class:[t.direction,t.customClass],style:t.isHorizontal?"width: "+t.drawerSize:"height: "+t.drawerSize,attrs:{"aria-modal":"true","aria-labelledby":"el-drawer__title","aria-label":t.title,role:"dialog",tabindex:"-1"}},[t.withHeader?n("header",{staticClass:"el-drawer__header",attrs:{id:"el-drawer__title"}},[t._t("title",[n("span",{attrs:{role:"heading",title:t.title}},[t._v(t._s(t.title))])]),t.showClose?n("button",{staticClass:"el-drawer__close-btn",attrs:{"aria-label":"close "+(t.title||"drawer"),type:"button"},on:{click:t.closeDrawer}},[n("i",{staticClass:"el-dialog__close el-icon el-icon-close"})]):t._e()],2):t._e(),t.rendered?n("section",{staticClass:"el-drawer__body"},[t._t("default")],2):t._e()])])])])};sh._withStripped=!0;var ah=i({name:"ElDrawer",mixins:[y.a,w.a],props:{appendToBody:{type:Boolean,default:!1},beforeClose:{type:Function},customClass:{type:String,default:""},closeOnPressEscape:{type:Boolean,default:!0},destroyOnClose:{type:Boolean,default:!1},modal:{type:Boolean,default:!0},direction:{type:String,default:"rtl",validator:function(t){return-1!==["ltr","rtl","ttb","btt"].indexOf(t)}},modalAppendToBody:{type:Boolean,default:!0},showClose:{type:Boolean,default:!0},size:{type:[Number,String],default:"30%"},title:{type:String,default:""},visible:{type:Boolean},wrapperClosable:{type:Boolean,default:!0},withHeader:{type:Boolean,default:!0}},computed:{isHorizontal:function(){return"rtl"===this.direction||"ltr"===this.direction},drawerSize:function(){return"number"==typeof this.size?this.size+"px":this.size}},data:function(){return{closed:!1,prevActiveElement:null}},watch:{visible:function(t){var e=this;t?(this.closed=!1,this.$emit("open"),this.appendToBody&&document.body.appendChild(this.$el),this.prevActiveElement=document.activeElement):(this.closed||(this.$emit("close"),!0===this.destroyOnClose&&(this.rendered=!1)),this.$nextTick(function(){e.prevActiveElement&&e.prevActiveElement.focus()}))}},methods:{afterEnter:function(){this.$emit("opened")},afterLeave:function(){this.$emit("closed")},hide:function(t){!1!==t&&(this.$emit("update:visible",!1),this.$emit("close"),!0===this.destroyOnClose&&(this.rendered=!1),this.closed=!0)},handleWrapperClick:function(){this.wrapperClosable&&this.closeDrawer()},closeDrawer:function(){"function"==typeof this.beforeClose?this.beforeClose(this.hide):this.hide()},handleClose:function(){this.closeDrawer()}},mounted:function(){this.visible&&(this.rendered=!0,this.open())},destroyed:function(){this.appendToBody&&this.$el&&this.$el.parentNode&&this.$el.parentNode.removeChild(this.$el)}},sh,[],!1,null,null,null);ah.options.__file="packages/drawer/src/main.vue";var lh=ah.exports;lh.install=function(t){t.component(lh.name,lh)};var uh=lh,ch=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("el-popover",t._b({attrs:{trigger:"click"},model:{value:t.visible,callback:function(e){t.visible=e},expression:"visible"}},"el-popover",t.$attrs,!1),[n("div",{staticClass:"el-popconfirm"},[n("p",{staticClass:"el-popconfirm__main"},[t.hideIcon?t._e():n("i",{staticClass:"el-popconfirm__icon",class:t.icon,style:{color:t.iconColor}}),t._v("\n "+t._s(t.title)+"\n ")]),n("div",{staticClass:"el-popconfirm__action"},[n("el-button",{attrs:{size:"mini",type:t.cancelButtonType},on:{click:t.cancel}},[t._v("\n "+t._s(t.displayCancelButtonText)+"\n ")]),n("el-button",{attrs:{size:"mini",type:t.confirmButtonType},on:{click:t.confirm}},[t._v("\n "+t._s(t.displayConfirmButtonText)+"\n ")])],1)]),t._t("reference",null,{slot:"reference"})],2)};ch._withStripped=!0;var hh=n(44),dh=i({name:"ElPopconfirm",props:{title:{type:String},confirmButtonText:{type:String},cancelButtonText:{type:String},confirmButtonType:{type:String,default:"primary"},cancelButtonType:{type:String,default:"text"},icon:{type:String,default:"el-icon-question"},iconColor:{type:String,default:"#f90"},hideIcon:{type:Boolean,default:!1}},components:{ElPopover:n.n(hh).a,ElButton:z.a},data:function(){return{visible:!1}},computed:{displayConfirmButtonText:function(){return this.confirmButtonText||Object(Mi.t)("el.popconfirm.confirmButtonText")},displayCancelButtonText:function(){return this.cancelButtonText||Object(Mi.t)("el.popconfirm.cancelButtonText")}},methods:{confirm:function(){this.visible=!1,this.$emit("confirm")},cancel:function(){this.visible=!1,this.$emit("cancel")}}},ch,[],!1,null,null,null);dh.options.__file="packages/popconfirm/src/main.vue";var ph=dh.exports;ph.install=function(t){t.component(ph.name,ph)};var fh=ph,gh=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[t.uiLoading?[n("div",t._b({class:["el-skeleton",t.animated?"is-animated":""]},"div",t.$attrs,!1),[t._l(t.count,function(e){return[t.loading?t._t("template",t._l(t.rows,function(e){return n("el-skeleton-item",{key:e,class:{"el-skeleton__paragraph":1!==e,"is-first":1===e,"is-last":e===t.rows&&t.rows>1},attrs:{variant:"p"}})})):t._e()]})],2)]:[t._t("default",null,null,t.$attrs)]],2)};gh._withStripped=!0;var mh=i({name:"ElSkeleton",props:{animated:{type:Boolean,default:!1},count:{type:Number,default:1},rows:{type:Number,default:4},loading:{type:Boolean,default:!0},throttle:{type:Number,default:0}},watch:{loading:{handler:function(t){var e=this;this.throttle<=0?this.uiLoading=t:t?(clearTimeout(this.timeoutHandle),this.timeoutHandle=setTimeout(function(){e.uiLoading=e.loading},this.throttle)):this.uiLoading=t},immediate:!0}},data:function(){return{uiLoading:this.throttle<=0&&this.loading}}},gh,[],!1,null,null,null);mh.options.__file="packages/skeleton/src/index.vue";var vh=mh.exports;vh.install=function(t){t.component(vh.name,vh)};var bh=vh,_h=function(){var t=this.$createElement,e=this._self._c||t;return e("div",{class:["el-skeleton__item","el-skeleton__"+this.variant]},["image"===this.variant?e("img-placeholder"):this._e()],1)};_h._withStripped=!0;var yh=function(){var t=this.$createElement,e=this._self._c||t;return e("svg",{attrs:{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"}},[e("path",{attrs:{d:"M64 896V128h896v768H64z m64-128l192-192 116.352 116.352L640 448l256 307.2V192H128v576z m224-480a96 96 0 1 1-0.064 192.064A96 96 0 0 1 352 288z"}})])};yh._withStripped=!0;var Th=i({name:"ImgPlaceholder"},yh,[],!1,null,null,null);Th.options.__file="packages/skeleton/src/img-placeholder.vue";var xh,Eh=Th.exports,wh=i({name:"ElSkeletonItem",props:{variant:{type:String,default:"text"}},components:(xh={},xh[Eh.name]=Eh,xh)},_h,[],!1,null,null,null);wh.options.__file="packages/skeleton/src/item.vue";var Ch=wh.exports;Ch.install=function(t){t.component(Ch.name,Ch)};var Sh=Ch,kh=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"el-empty"},[n("div",{staticClass:"el-empty__image",style:t.imageStyle},[t.image?n("img",{attrs:{src:t.image,ondragstart:"return false"}}):t._t("image",[n("img-empty")])],2),n("div",{staticClass:"el-empty__description"},[t.$slots.description?t._t("description"):n("p",[t._v(t._s(t.emptyDescription))])],2),t.$slots.default?n("div",{staticClass:"el-empty__bottom"},[t._t("default")],2):t._e()])};kh._withStripped=!0;var Oh=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("svg",{attrs:{viewBox:"0 0 79 86",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"}},[n("defs",[n("linearGradient",{attrs:{id:"linearGradient-1-"+t.id,x1:"38.8503086%",y1:"0%",x2:"61.1496914%",y2:"100%"}},[n("stop",{attrs:{"stop-color":"#FCFCFD",offset:"0%"}}),n("stop",{attrs:{"stop-color":"#EEEFF3",offset:"100%"}})],1),n("linearGradient",{attrs:{id:"linearGradient-2-"+t.id,x1:"0%",y1:"9.5%",x2:"100%",y2:"90.5%"}},[n("stop",{attrs:{"stop-color":"#FCFCFD",offset:"0%"}}),n("stop",{attrs:{"stop-color":"#E9EBEF",offset:"100%"}})],1),n("rect",{attrs:{id:"path-3-"+t.id,x:"0",y:"0",width:"17",height:"36"}})],1),n("g",{attrs:{id:"Illustrations",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"}},[n("g",{attrs:{id:"B-type",transform:"translate(-1268.000000, -535.000000)"}},[n("g",{attrs:{id:"Group-2",transform:"translate(1268.000000, 535.000000)"}},[n("path",{attrs:{id:"Oval-Copy-2",d:"M39.5,86 C61.3152476,86 79,83.9106622 79,81.3333333 C79,78.7560045 57.3152476,78 35.5,78 C13.6847524,78 0,78.7560045 0,81.3333333 C0,83.9106622 17.6847524,86 39.5,86 Z",fill:"#F7F8FC"}}),n("polygon",{attrs:{id:"Rectangle-Copy-14",fill:"#E5E7E9",transform:"translate(27.500000, 51.500000) scale(1, -1) translate(-27.500000, -51.500000) ",points:"13 58 53 58 42 45 2 45"}}),n("g",{attrs:{id:"Group-Copy",transform:"translate(34.500000, 31.500000) scale(-1, 1) rotate(-25.000000) translate(-34.500000, -31.500000) translate(7.000000, 10.000000)"}},[n("polygon",{attrs:{id:"Rectangle-Copy-10",fill:"#E5E7E9",transform:"translate(11.500000, 5.000000) scale(1, -1) translate(-11.500000, -5.000000) ",points:"2.84078316e-14 3 18 3 23 7 5 7"}}),n("polygon",{attrs:{id:"Rectangle-Copy-11",fill:"#EDEEF2",points:"-3.69149156e-15 7 38 7 38 43 -3.69149156e-15 43"}}),n("rect",{attrs:{id:"Rectangle-Copy-12",fill:"url(#linearGradient-1-"+t.id+")",transform:"translate(46.500000, 25.000000) scale(-1, 1) translate(-46.500000, -25.000000) ",x:"38",y:"7",width:"17",height:"36"}}),n("polygon",{attrs:{id:"Rectangle-Copy-13",fill:"#F8F9FB",transform:"translate(39.500000, 3.500000) scale(-1, 1) translate(-39.500000, -3.500000) ",points:"24 7 41 7 55 -3.63806207e-12 38 -3.63806207e-12"}})]),n("rect",{attrs:{id:"Rectangle-Copy-15",fill:"url(#linearGradient-2-"+t.id+")",x:"13",y:"45",width:"40",height:"36"}}),n("g",{attrs:{id:"Rectangle-Copy-17",transform:"translate(53.000000, 45.000000)"}},[n("mask",{attrs:{id:"mask-4-"+t.id,fill:"white"}},[n("use",{attrs:{"xlink:href":"#path-3-"+t.id}})]),n("use",{attrs:{id:"Mask",fill:"#E0E3E9",transform:"translate(8.500000, 18.000000) scale(-1, 1) translate(-8.500000, -18.000000) ","xlink:href":"#path-3-"+t.id}}),n("polygon",{attrs:{id:"Rectangle-Copy",fill:"#D5D7DE",mask:"url(#mask-4-"+t.id+")",transform:"translate(12.000000, 9.000000) scale(-1, 1) translate(-12.000000, -9.000000) ",points:"7 0 24 0 20 18 -1.70530257e-13 16"}})]),n("polygon",{attrs:{id:"Rectangle-Copy-18",fill:"#F8F9FB",transform:"translate(66.000000, 51.500000) scale(-1, 1) translate(-66.000000, -51.500000) ",points:"62 45 79 45 70 58 53 58"}})])])])])};Oh._withStripped=!0;var Ih=0,Rh=i({name:"ImgEmpty",data:function(){return{id:++Ih}}},Oh,[],!1,null,null,null);Rh.options.__file="packages/empty/src/img-empty.vue";var Ah,Nh=Rh.exports,Dh=i({name:"ElEmpty",components:(Ah={},Ah[Nh.name]=Nh,Ah),props:{image:{type:String,default:""},imageSize:Number,description:{type:String,default:""}},computed:{emptyDescription:function(){return this.description||Object(Mi.t)("el.empty.description")},imageStyle:function(){return{width:this.imageSize?this.imageSize+"px":""}}}},kh,[],!1,null,null,null);Dh.options.__file="packages/empty/src/index.vue";var Mh=Dh.exports;Mh.install=function(t){t.component(Mh.name,Mh)};var Lh=Mh,Ph=[v,k,W,J,et,ot,vt,wt,Rt,Mt,Gt,qt,te,oe,ue,pe,ve,Te,Ce,Ue,Ve,ze,qe,tn,rr,cr,ai,gi,wi,Ri,Ni,no,so,co,_o,ko,Ao,Mo,Zo,rs,Es,$s,Vs,Gs,sa,ca,fa,Oa,Na,Fa,Ua,Ga,Ja,el,ol,ul,pl,Cl,eu,lu,du,mu,yu,wu,Ou,Au,Lu,ju,Hu,sc,mc,Tc,Mc,nh,oh,uh,fh,bh,Sh,Lh,_t.a],Fh=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Li.a.use(e.locale),Li.a.i18n(e.i18n),Ph.forEach(function(e){t.component(e.name,e)}),t.use(Rc),t.use(Ps.directive),t.prototype.$ELEMENT={size:e.size||"",zIndex:e.zIndex||2e3},t.prototype.$loading=Ps.service,t.prototype.$msgbox=Zi,t.prototype.$alert=Zi.alert,t.prototype.$confirm=Zi.confirm,t.prototype.$prompt=Zi.prompt,t.prototype.$notify=ps,t.prototype.$message=wa};"undefined"!=typeof window&&window.Vue&&Fh(window.Vue);e.default={version:"2.15.3",locale:Li.a.use,i18n:Li.a.i18n,install:Fh,CollapseTransition:_t.a,Loading:Ps,Pagination:v,Dialog:k,Autocomplete:W,Dropdown:J,DropdownMenu:et,DropdownItem:ot,Menu:vt,Submenu:wt,MenuItem:Rt,MenuItemGroup:Mt,Input:Gt,InputNumber:qt,Radio:te,RadioGroup:oe,RadioButton:ue,Checkbox:pe,CheckboxButton:ve,CheckboxGroup:Te,Switch:Ce,Select:Ue,Option:Ve,OptionGroup:ze,Button:qe,ButtonGroup:tn,Table:rr,TableColumn:cr,DatePicker:ai,TimeSelect:gi,TimePicker:wi,Popover:Ri,Tooltip:Ni,MessageBox:Zi,Breadcrumb:no,BreadcrumbItem:so,Form:co,FormItem:_o,Tabs:ko,TabPane:Ao,Tag:Mo,Tree:Zo,Alert:rs,Notification:ps,Slider:Es,Icon:$s,Row:Vs,Col:Gs,Upload:sa,Progress:ca,Spinner:fa,Message:wa,Badge:Oa,Card:Na,Rate:Fa,Steps:Ua,Step:Ga,Carousel:Ja,Scrollbar:el,CarouselItem:ol,Collapse:ul,CollapseItem:pl,Cascader:Cl,ColorPicker:eu,Transfer:lu,Container:du,Header:mu,Aside:yu,Main:wu,Footer:Ou,Timeline:Au,TimelineItem:Lu,Link:ju,Divider:Hu,Image:sc,Calendar:mc,Backtop:Tc,InfiniteScroll:Rc,PageHeader:Mc,CascaderPanel:nh,Avatar:oh,Drawer:uh,Popconfirm:fh,Skeleton:bh,SkeletonItem:Sh,Empty:Lh}}]).default},zQR9:function(t,e,n){"use strict";var r=n("h65t")(!0);n("vIB/")(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=r(e,n),this._i+=t.length,{value:t,done:!1})})},zTCi:function(t,e,n){"use strict";e.__esModule=!0,e.default=function(t,e){if(o.default.prototype.$isServer)return;if(!e)return void(t.scrollTop=0);var n=[],r=e.offsetParent;for(;r&&t!==r&&t.contains(r);)n.push(r),r=r.offsetParent;var i=e.offsetTop+n.reduce(function(t,e){return t+e.offsetTop},0),s=i+e.offsetHeight,a=t.scrollTop,l=a+t.clientHeight;i<a?t.scrollTop=i:s>l&&(t.scrollTop=s-t.clientHeight)};var r,i=n("7+uW"),o=(r=i)&&r.__esModule?r:{default:r}},"zp+s":function(t,e,n){"use strict";e.d=i,e.e=o,e.f=function(t,e,n){return e[s(t,n.currentContextId)]},e.b=function(t,e){const[n,r,i]=a(t);return[s(n,e&&e.currentContextId),r,i]},e.g=a,e.c=function(t,e,n){let r=i("pad",t,e,n);if("explicit"===r){r=i("explicitPaddings",t,e,n);const o=[[0,0],[0,0],[0,0],[0,0]];for(let t=0;t<4;t++)o[t][0]=r[2*t],o[t][1]=r[2*t+1];return o}return r},e.a=function(t){return t.kept?t:Object(r._121)(t)};var r=n("JV7f");
  9717. /**
  9718. * @license
  9719. * Copyright 2018 Google LLC. All Rights Reserved.
  9720. * Licensed under the Apache License, Version 2.0 (the "License");
  9721. * you may not use this file except in compliance with the License.
  9722. * You may obtain a copy of the License at
  9723. *
  9724. * http://www.apache.org/licenses/LICENSE-2.0
  9725. *
  9726. * Unless required by applicable law or agreed to in writing, software
  9727. * distributed under the License is distributed on an "AS IS" BASIS,
  9728. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9729. * See the License for the specific language governing permissions and
  9730. * limitations under the License.
  9731. * =============================================================================
  9732. */function i(t,e,n,i,s){const a=e.inputParams[t];if(a&&void 0!==a.inputIndexStart){const t=a.inputIndexStart,l=0===a.inputIndexEnd?void 0:void 0===a.inputIndexEnd?t+1:a.inputIndexEnd;if("tensor"===a.type)return o(e.inputNames[a.inputIndexStart],n,i,s);if("tensors"===a.type){return e.inputNames.slice(t,l).map(t=>o(t,n,i,s))}const u=o(e.inputNames.slice(t)[0],n,i,s),c=u.dataSync();return"number"===a.type?c[0]:r._152.toNestedArray(u.shape,c)}const l=e.attrParams[t];return l&&l.value}function o(t,e,n,r){const[i,o]=a(t);if(null!=r){const t=r.getHashTableHandleByName(i);if(null!=t)return t}const l=n.currentContextIds.find(t=>!!e[s(i,t)]);return void 0!==l?e[s(i,l)][o]:void 0}function s(t,e){return e?`${t}-${e}`:t}function a(t){const e=t.split(":");if(1===e.length)return[t,0,void 0];const n=e[0],r=3===e.length?e[1]:void 0;return[n,Number(e[e.length-1]),r]}}});
  9733. //# sourceMappingURL=vendor.1442b48262f29d17d337.js.map