game-min-0722.js 782 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564
  1. /*
  2. zlib.js 2012 - imaya [ https://github.com/imaya/zlib.js ] The MIT License */
  3. var egret;
  4. (function(c) {
  5. var e = function() {
  6. function c() {
  7. this._hashCode = c.hashCount++
  8. }
  9. Object.defineProperty(c.prototype, "hashCode", {
  10. get: function() {
  11. return this._hashCode
  12. },
  13. enumerable: !0,
  14. configurable: !0
  15. });
  16. c.hashCount = 1;
  17. return c
  18. }();
  19. c.HashObject = e
  20. })(egret || (egret = {}));
  21. var __extends = this.__extends || function(c, e) {
  22. function d() {
  23. this.constructor = c
  24. }
  25. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  26. d.prototype = e.prototype;
  27. c.prototype = new d
  28. };
  29. (function(c) {
  30. var e = function(c) {
  31. function a(b) {
  32. "undefined" === typeof b && (b = 300);
  33. c.call(this);
  34. this.objectPool = [];
  35. this._length = 0;
  36. 1 > b && (b = 1);
  37. this.autoDisposeTime = b;
  38. this.frameCount = 0
  39. }
  40. __extends(a, c);
  41. a.prototype._checkFrame = function() {
  42. this.frameCount--;
  43. 0 >= this.frameCount && this.dispose()
  44. };
  45. Object.defineProperty(a.prototype, "length", {
  46. get: function() {
  47. return this._length
  48. },
  49. enumerable: !0,
  50. configurable: !0
  51. });
  52. a.prototype.push = function(b) {
  53. var h = this.objectPool; - 1 == h.indexOf(b) && (h.push(b), this._length++, 0 == this.frameCount &&
  54. (this.frameCount = this.autoDisposeTime, a._callBackList.push(this)))
  55. };
  56. a.prototype.pop = function() {
  57. if (0 == this._length) return null;
  58. this._length--;
  59. return this.objectPool.pop()
  60. };
  61. a.prototype.dispose = function() {
  62. 0 < this._length && (this.objectPool = [], this._length = 0);
  63. this.frameCount = 0;
  64. var b = a._callBackList,
  65. h = b.indexOf(this); - 1 != h && b.splice(h, 1)
  66. };
  67. a._callBackList = [];
  68. return a
  69. }(c.HashObject);
  70. c.Recycler = e
  71. })(egret || (egret = {}));
  72. (function(c) {
  73. c.__START_TIME;
  74. c.getTimer = function() {
  75. return Date.now() - c.__START_TIME
  76. }
  77. })(egret || (egret = {}));
  78. (function(c) {
  79. c.__callLaterFunctionList = [];
  80. c.__callLaterThisList = [];
  81. c.__callLaterArgsList = [];
  82. c.callLater = function(e, d) {
  83. for (var a = [], b = 0; b < arguments.length - 2; b++) a[b] = arguments[b + 2];
  84. c.__callLaterFunctionList.push(e);
  85. c.__callLaterThisList.push(d);
  86. c.__callLaterArgsList.push(a)
  87. }
  88. })(egret || (egret = {}));
  89. __extends = this.__extends || function(c, e) {
  90. function d() {
  91. this.constructor = c
  92. }
  93. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  94. d.prototype = e.prototype;
  95. c.prototype = new d
  96. };
  97. (function(c) {
  98. var e = function(d) {
  99. function a(b, a, c) {
  100. "undefined" === typeof a && (a = !1);
  101. "undefined" === typeof c && (c = !1);
  102. d.call(this);
  103. this._eventPhase = 2;
  104. this._isPropagationImmediateStopped = this._isPropagationStopped = this._isDefaultPrevented = !1;
  105. this.isNew = !0;
  106. this._type = b;
  107. this._bubbles = a;
  108. this._cancelable = c
  109. }
  110. __extends(a, d);
  111. Object.defineProperty(a.prototype, "type", {
  112. get: function() {
  113. return this._type
  114. },
  115. enumerable: !0,
  116. configurable: !0
  117. });
  118. Object.defineProperty(a.prototype, "bubbles", {
  119. get: function() {
  120. return this._bubbles
  121. },
  122. enumerable: !0,
  123. configurable: !0
  124. });
  125. Object.defineProperty(a.prototype, "cancelable", {
  126. get: function() {
  127. return this._cancelable
  128. },
  129. enumerable: !0,
  130. configurable: !0
  131. });
  132. Object.defineProperty(a.prototype, "eventPhase", {
  133. get: function() {
  134. return this._eventPhase
  135. },
  136. enumerable: !0,
  137. configurable: !0
  138. });
  139. Object.defineProperty(a.prototype, "currentTarget", {
  140. get: function() {
  141. return this._currentTarget
  142. },
  143. enumerable: !0,
  144. configurable: !0
  145. });
  146. a.prototype._setCurrentTarget = function(b) {
  147. this._currentTarget = b
  148. };
  149. Object.defineProperty(a.prototype, "target", {
  150. get: function() {
  151. return this._target
  152. },
  153. enumerable: !0,
  154. configurable: !0
  155. });
  156. a.prototype.isDefaultPrevented = function() {
  157. return this._isDefaultPrevented
  158. };
  159. a.prototype.preventDefault = function() {
  160. this._cancelable && (this._isDefaultPrevented = !0)
  161. };
  162. a.prototype.stopPropagation = function() {
  163. this._bubbles && (this._isPropagationStopped = !0)
  164. };
  165. a.prototype.stopImmediatePropagation = function() {
  166. this._bubbles && (this._isPropagationImmediateStopped = !0)
  167. };
  168. a.prototype._reset = function() {
  169. this.isNew ? this.isNew = !1 : (this._isPropagationImmediateStopped =
  170. this._isPropagationStopped = this._isDefaultPrevented = !1, this._currentTarget = this._target = null, this._eventPhase = 2)
  171. };
  172. a._dispatchByTarget = function(b, a, l, d, e, g) {
  173. "undefined" === typeof e && (e = !1);
  174. "undefined" === typeof g && (g = !1);
  175. var k = b.eventRecycler;
  176. k || (k = b.eventRecycler = new c.Recycler);
  177. var n = k.pop();
  178. n ? n._type = l : n = new b(l);
  179. n._bubbles = e;
  180. n._cancelable = g;
  181. if (d)
  182. for (var p in d) n[p] = d[p], null !== n[p] && (d[p] = null);
  183. b = a.dispatchEvent(n);
  184. k.push(n);
  185. return b
  186. };
  187. a._getPropertyData = function(b) {
  188. var a = b._props;
  189. a || (a = b._props = {});
  190. return a
  191. };
  192. a.dispatchEvent = function(b, h, c, d) {
  193. "undefined" === typeof c && (c = !1);
  194. var e = a._getPropertyData(a);
  195. d && (e.data = d);
  196. a._dispatchByTarget(a, b, h, e, c)
  197. };
  198. a.ADDED_TO_STAGE = "addedToStage";
  199. a.REMOVED_FROM_STAGE = "removedFromStage";
  200. a.ADDED = "added";
  201. a.REMOVED = "removed";
  202. a.COMPLETE = "complete";
  203. a.ENTER_FRAME = "enterFrame";
  204. a.RENDER = "render";
  205. a.FINISH_RENDER = "finishRender";
  206. a.FINISH_UPDATE_TRANSFORM = "finishUpdateTransform";
  207. a.LEAVE_STAGE = "leaveStage";
  208. a.RESIZE = "resize";
  209. a.CHANGE = "change";
  210. return a
  211. }(c.HashObject);
  212. c.Event =
  213. e
  214. })(egret || (egret = {}));
  215. __extends = this.__extends || function(c, e) {
  216. function d() {
  217. this.constructor = c
  218. }
  219. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  220. d.prototype = e.prototype;
  221. c.prototype = new d
  222. };
  223. (function(c) {
  224. var e = function(d) {
  225. function a(b, a, c) {
  226. "undefined" === typeof a && (a = !1);
  227. "undefined" === typeof c && (c = !1);
  228. d.call(this, b, a, c)
  229. }
  230. __extends(a, d);
  231. a.dispatchIOErrorEvent = function(b) {
  232. c.Event._dispatchByTarget(a, b, a.IO_ERROR)
  233. };
  234. a.IO_ERROR = "ioError";
  235. return a
  236. }(c.Event);
  237. c.IOErrorEvent = e
  238. })(egret || (egret = {}));
  239. __extends = this.__extends || function(c, e) {
  240. function d() {
  241. this.constructor = c
  242. }
  243. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  244. d.prototype = e.prototype;
  245. c.prototype = new d
  246. };
  247. (function(c) {
  248. var e = function(d) {
  249. function a(b, a, c, m, e, g, k, n, p, q) {
  250. "undefined" === typeof a && (a = !0);
  251. "undefined" === typeof c && (c = !0);
  252. "undefined" === typeof m && (m = 0);
  253. "undefined" === typeof e && (e = 0);
  254. "undefined" === typeof g && (g = 0);
  255. "undefined" === typeof k && (k = !1);
  256. "undefined" === typeof n && (n = !1);
  257. "undefined" === typeof q && (q = !1);
  258. d.call(this, b, a, c);
  259. this._localY = this._localX = this._stageY = this._stageX = 0;
  260. this.touchPointID = m;
  261. this._stageX = e;
  262. this._stageY = g;
  263. this.ctrlKey = k;
  264. this.altKey = n;
  265. this.touchDown = q
  266. }
  267. __extends(a, d);
  268. Object.defineProperty(a.prototype,
  269. "stageX", {
  270. get: function() {
  271. return this._stageX
  272. },
  273. enumerable: !0,
  274. configurable: !0
  275. });
  276. Object.defineProperty(a.prototype, "stageY", {
  277. get: function() {
  278. return this._stageY
  279. },
  280. enumerable: !0,
  281. configurable: !0
  282. });
  283. Object.defineProperty(a.prototype, "localX", {
  284. get: function() {
  285. return this._localX
  286. },
  287. enumerable: !0,
  288. configurable: !0
  289. });
  290. Object.defineProperty(a.prototype, "localY", {
  291. get: function() {
  292. return this._localY
  293. },
  294. enumerable: !0,
  295. configurable: !0
  296. });
  297. a.prototype._setCurrentTarget = function(b) {
  298. d.prototype._setCurrentTarget.call(this, b);
  299. b instanceof
  300. c.DisplayObject && (b = b.globalToLocal(this._stageX, this._stageY, c.Point.identity), this._localX = b.x, this._localY = b.y)
  301. };
  302. a.dispatchTouchEvent = function(b, h, l, d, e, g, k, n, p) {
  303. "undefined" === typeof l && (l = 0);
  304. "undefined" === typeof d && (d = 0);
  305. "undefined" === typeof e && (e = 0);
  306. "undefined" === typeof g && (g = !1);
  307. "undefined" === typeof k && (k = !1);
  308. "undefined" === typeof n && (n = !1);
  309. "undefined" === typeof p && (p = !1);
  310. var q = c.Event._getPropertyData(a);
  311. q.touchPointID = l;
  312. q._stageX = d;
  313. q._stageY = e;
  314. q.ctrlKey = g;
  315. q.altKey = k;
  316. q.shiftKey = n;
  317. q.touchDown =
  318. p;
  319. c.Event._dispatchByTarget(a, b, h, q, !0, !0)
  320. };
  321. a.TOUCH_TAP = "touchTap";
  322. a.TOUCH_MOVE = "touchMove";
  323. a.TOUCH_BEGIN = "touchBegin";
  324. a.TOUCH_END = "touchEnd";
  325. a.TOUCH_RELEASE_OUTSIDE = "touchReleaseOutside";
  326. a.TOUCH_ROLL_OUT = "touchRollOut";
  327. a.TOUCH_ROLL_OVER = "touchRollOver";
  328. a.TOUCH_OUT = "touchOut";
  329. a.TOUCH_OVER = "touchOver";
  330. return a
  331. }(c.Event);
  332. c.TouchEvent = e
  333. })(egret || (egret = {}));
  334. __extends = this.__extends || function(c, e) {
  335. function d() {
  336. this.constructor = c
  337. }
  338. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  339. d.prototype = e.prototype;
  340. c.prototype = new d
  341. };
  342. (function(c) {
  343. var e = function(d) {
  344. function a(b, a, c) {
  345. "undefined" === typeof a && (a = !1);
  346. "undefined" === typeof c && (c = !1);
  347. d.call(this, b, a, c)
  348. }
  349. __extends(a, d);
  350. a.dispatchTimerEvent = function(b, h) {
  351. c.Event._dispatchByTarget(a, b, h)
  352. };
  353. a.TIMER = "timer";
  354. a.TIMER_COMPLETE = "timerComplete";
  355. return a
  356. }(c.Event);
  357. c.TimerEvent = e
  358. })(egret || (egret = {}));
  359. (function(c) {
  360. var e = function() {
  361. function c() {}
  362. c.CAPTURING_PHASE = 1;
  363. c.AT_TARGET = 2;
  364. c.BUBBLING_PHASE = 3;
  365. return c
  366. }();
  367. c.EventPhase = e
  368. })(egret || (egret = {}));
  369. __extends = this.__extends || function(c, e) {
  370. function d() {
  371. this.constructor = c
  372. }
  373. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  374. d.prototype = e.prototype;
  375. c.prototype = new d
  376. };
  377. (function(c) {
  378. var e = function(d) {
  379. function a(b) {
  380. "undefined" === typeof b && (b = null);
  381. d.call(this);
  382. this._eventTarget = b ? b : this
  383. }
  384. __extends(a, d);
  385. a.prototype.addEventListener = function(b, a, l, d, e) {
  386. "undefined" === typeof d && (d = !1);
  387. "undefined" === typeof e && (e = 0);
  388. "undefined" === typeof d && (d = !1);
  389. "undefined" === typeof e && (e = 0);
  390. a || c.Logger.fatal("addEventListener\u4fa6\u542c\u51fd\u6570\u4e0d\u80fd\u4e3a\u7a7a");
  391. d ? (this._captureEventsMap || (this._captureEventsMap = {}), d = this._captureEventsMap) : (this._eventsMap || (this._eventsMap = {}), d = this._eventsMap);
  392. var g = d[b];
  393. g || (g = d[b] = []);
  394. this._insertEventBin(g, a, l, e)
  395. };
  396. a.prototype._insertEventBin = function(b, a, c, d) {
  397. for (var e = -1, g = b.length, k = 0; k < g; k++) {
  398. var n = b[k];
  399. if (n.listener === a && n.thisObject === c) return !1; - 1 == e && n.priority < d && (e = k)
  400. }
  401. a = {
  402. listener: a,
  403. thisObject: c,
  404. priority: d
  405. }; - 1 != e ? b.splice(e, 0, a) : b.push(a);
  406. return !0
  407. };
  408. a.prototype.removeEventListener = function(b, a, c, d) {
  409. "undefined" === typeof d && (d = !1);
  410. if (d = d ? this._captureEventsMap : this._eventsMap) {
  411. var e = d[b];
  412. e && (this._removeEventBin(e, a, c), 0 ==
  413. e.length && delete d[b])
  414. }
  415. };
  416. a.prototype._removeEventBin = function(b, a, c) {
  417. for (var d = b.length, e = 0; e < d; e++) {
  418. var g = b[e];
  419. if (g.listener === a && g.thisObject === c) return b.splice(e, 1), !0
  420. }
  421. return !1
  422. };
  423. a.prototype.hasEventListener = function(b) {
  424. return this._eventsMap && this._eventsMap[b] || this._captureEventsMap && this._captureEventsMap[b]
  425. };
  426. a.prototype.willTrigger = function(b) {
  427. return this.hasEventListener(b)
  428. };
  429. a.prototype.dispatchEvent = function(b) {
  430. b._reset();
  431. b._target = this._eventTarget;
  432. b._setCurrentTarget(this._eventTarget);
  433. return this._notifyListener(b)
  434. };
  435. a.prototype._notifyListener = function(b) {
  436. var a = 1 == b._eventPhase ? this._captureEventsMap : this._eventsMap;
  437. if (!a) return !0;
  438. a = a[b.type];
  439. if (!a) return !0;
  440. for (var a = a.concat(), c = a.length, d = 0; d < c; d++) {
  441. var e = a[d];
  442. e.listener.call(e.thisObject, b);
  443. if (b._isPropagationImmediateStopped) break
  444. }
  445. return !b.isDefaultPrevented()
  446. };
  447. a.prototype.dispatchEventWith = function(b, a, l) {
  448. "undefined" === typeof a && (a = !1);
  449. c.Event.dispatchEvent(this, b, a, l)
  450. };
  451. return a
  452. }(c.HashObject);
  453. c.EventDispatcher = e
  454. })(egret ||
  455. (egret = {}));
  456. __extends = this.__extends || function(c, e) {
  457. function d() {
  458. this.constructor = c
  459. }
  460. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  461. d.prototype = e.prototype;
  462. c.prototype = new d
  463. };
  464. (function(c) {
  465. var e = function(d) {
  466. function a() {
  467. d.call(this);
  468. this.reuseEvent = new c.Event("")
  469. }
  470. __extends(a, d);
  471. a.prototype.run = function() {
  472. c.Ticker.getInstance().run();
  473. c.Ticker.getInstance().register(this.renderLoop, this, Number.NEGATIVE_INFINITY);
  474. c.Ticker.getInstance().register(this.broadcastEnterFrame, this, Number.POSITIVE_INFINITY);
  475. this.touchContext.run();
  476. c.__invalidateModuleFlag = !0
  477. };
  478. a.prototype.renderLoop = function(b) {
  479. b = this.rendererContext;
  480. b.clearScreen();
  481. if (0 < c.__callLaterFunctionList.length) {
  482. var a = c.__callLaterFunctionList;
  483. c.__callLaterFunctionList = [];
  484. var l = c.__callLaterThisList;
  485. c.__callLaterThisList = [];
  486. var d = c.__callLaterArgsList;
  487. c.__callLaterArgsList = []
  488. }
  489. this.dispatchEventWith(c.Event.RENDER);
  490. c.Stage._invalidateRenderFlag && (this.broadcastRender(), c.Stage._invalidateRenderFlag = !1);
  491. a && this.doCallLaterList(a, l, d);
  492. this.stage._updateTransform();
  493. this.dispatchEventWith(c.Event.FINISH_UPDATE_TRANSFORM);
  494. this.stage._draw(b);
  495. this.dispatchEventWith(c.Event.FINISH_RENDER)
  496. };
  497. a.prototype.broadcastEnterFrame = function(b) {
  498. b = this.reuseEvent;
  499. b._type = c.Event.ENTER_FRAME;
  500. this.dispatchEvent(b);
  501. for (var a = c.DisplayObject._enterFrameCallBackList.concat(), l = a.length, d = 0; d < l; d++) {
  502. var e = a[d];
  503. b._target = e.display;
  504. b._setCurrentTarget(e.display);
  505. e.listener.call(e.thisObject, b)
  506. }
  507. a = c.Recycler._callBackList;
  508. for (d = a.length - 1; 0 <= d; d--) a[d]._checkFrame()
  509. };
  510. a.prototype.broadcastRender = function() {
  511. var b = this.reuseEvent;
  512. b._type = c.Event.RENDER;
  513. for (var a = c.DisplayObject._renderCallBackList.concat(), l = a.length, d = 0; d < l; d++) {
  514. var e = a[d];
  515. b._target = e.display;
  516. b._setCurrentTarget(e.display);
  517. e.listener.call(e.thisObject, b)
  518. }
  519. };
  520. a.prototype.doCallLaterList = function(b, a, c) {
  521. for (var d = b.length, e = 0; e < d; e++) {
  522. var g = b[e];
  523. null != g && g.apply(a[e], c[e])
  524. }
  525. };
  526. return a
  527. }(c.EventDispatcher);
  528. c.MainContext = e
  529. })(egret || (egret = {}));
  530. egret.MainContext.instance = new egret.MainContext;
  531. (function(c) {
  532. var e = function() {
  533. function d() {
  534. this._tick = this._preDrawCount = this._updateTransformPerformanceCost = this._renderPerformanceCost = this._logicPerformanceCost = this._lastTime = 0;
  535. this._maxDeltaTime = 500;
  536. this._totalDeltaTime = 0
  537. }
  538. d.getInstance = function() {
  539. null == d.instance && (d.instance = new d);
  540. return d.instance
  541. };
  542. d.prototype.run = function() {
  543. c.Ticker.getInstance().register(this.update, this);
  544. null == this._txt && (this._txt = new c.TextField, this._txt.size = 28, c.MainContext.instance.stage.addChild(this._txt));
  545. var a =
  546. c.MainContext.instance;
  547. a.addEventListener(c.Event.ENTER_FRAME, this.onEnterFrame, this);
  548. a.addEventListener(c.Event.RENDER, this.onStartRender, this);
  549. a.addEventListener(c.Event.FINISH_RENDER, this.onFinishRender, this);
  550. a.addEventListener(c.Event.FINISH_UPDATE_TRANSFORM, this.onFinishUpdateTransform, this)
  551. };
  552. d.prototype.onEnterFrame = function(a) {
  553. this._lastTime = c.getTimer()
  554. };
  555. d.prototype.onStartRender = function(a) {
  556. a = c.getTimer();
  557. this._logicPerformanceCost = a - this._lastTime;
  558. this._lastTime = a
  559. };
  560. d.prototype.onFinishUpdateTransform =
  561. function(a) {
  562. a = c.getTimer();
  563. this._updateTransformPerformanceCost = a - this._lastTime;
  564. this._lastTime = a
  565. };
  566. d.prototype.onFinishRender = function(a) {
  567. a = c.getTimer();
  568. this._renderPerformanceCost = a - this._lastTime;
  569. this._lastTime = a
  570. };
  571. d.prototype.update = function(a) {
  572. this._tick++;
  573. this._totalDeltaTime += a;
  574. if (this._totalDeltaTime >= this._maxDeltaTime) {
  575. a = (this._preDrawCount - 1).toString();
  576. var b = Math.ceil(this._logicPerformanceCost).toString() + "," + Math.ceil(this._updateTransformPerformanceCost).toString() + "," + Math.ceil(this._renderPerformanceCost).toString() +
  577. "," + Math.ceil(c.MainContext.instance.rendererContext.renderCost).toString();
  578. this._txt.text = "draw:" + a + "\ncost:" + b + "\nFPS:" + Math.floor(1E3 * this._tick / this._totalDeltaTime).toString();
  579. this._tick = this._totalDeltaTime = 0
  580. }
  581. this._preDrawCount = 0
  582. };
  583. d.prototype.onDrawImage = function() {
  584. this._preDrawCount++
  585. };
  586. return d
  587. }();
  588. c.Profiler = e
  589. })(egret || (egret = {}));
  590. __extends = this.__extends || function(c, e) {
  591. function d() {
  592. this.constructor = c
  593. }
  594. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  595. d.prototype = e.prototype;
  596. c.prototype = new d
  597. };
  598. (function(c) {
  599. var e = function(d) {
  600. function a() {
  601. d.apply(this, arguments);
  602. this._timeScale = 1;
  603. this._paused = !1;
  604. this.callBackList = []
  605. }
  606. __extends(a, d);
  607. a.prototype.run = function() {
  608. c.__START_TIME = (new Date).getTime();
  609. c.MainContext.instance.deviceContext.executeMainLoop(this.update, this)
  610. };
  611. a.prototype.update = function(b) {
  612. var a = this.callBackList.concat(),
  613. c = a.length;
  614. b *= this._timeScale;
  615. b *= this._timeScale;
  616. for (var d = 0; d < c; d++) {
  617. var e = a[d];
  618. e.listener.call(e.thisObject, b)
  619. }
  620. };
  621. a.prototype.register = function(b, a, c) {
  622. "undefined" ===
  623. typeof c && (c = 0);
  624. this._insertEventBin(this.callBackList, b, a, c)
  625. };
  626. a.prototype.unregister = function(b, a) {
  627. this._removeEventBin(this.callBackList, b, a)
  628. };
  629. a.prototype.setTimeout = function(b, a, c) {
  630. for (var d = [], e = 0; e < arguments.length - 3; e++) d[e] = arguments[e + 3];
  631. var g = this,
  632. k = 0;
  633. this.register(function(e) {
  634. 0 == c ? (g.unregister(arguments.callee, a), b.apply(a, d)) : (k += e, k >= c && (g.unregister(arguments.callee, a), b.apply(a, d)))
  635. }, a)
  636. };
  637. a.prototype.setTimeScale = function(b) {
  638. this._timeScale = b
  639. };
  640. a.prototype.getTimeScale = function() {
  641. return this._timeScale
  642. };
  643. a.prototype.pause = function() {
  644. this._paused = !0
  645. };
  646. a.prototype.resume = function() {
  647. this._paused = !1
  648. };
  649. a.getInstance = function() {
  650. null == a.instance && (a.instance = new a);
  651. return a.instance
  652. };
  653. return a
  654. }(c.EventDispatcher);
  655. c.Ticker = e
  656. })(egret || (egret = {}));
  657. (function(c) {
  658. var e = function() {
  659. function c() {}
  660. c.LEFT = "left";
  661. c.RIGHT = "right";
  662. c.CENTER = "center";
  663. c.JUSTIFY = "justify";
  664. c.CONTENT_JUSTIFY = "contentJustify";
  665. return c
  666. }();
  667. c.HorizontalAlign = e
  668. })(egret || (egret = {}));
  669. (function(c) {
  670. var e = function() {
  671. function c() {}
  672. c.TOP = "top";
  673. c.BOTTOM = "bottom";
  674. c.MIDDLE = "middle";
  675. c.JUSTIFY = "justify";
  676. c.CONTENT_JUSTIFY = "contentJustify";
  677. return c
  678. }();
  679. c.VerticalAlign = e
  680. })(egret || (egret = {}));
  681. __extends = this.__extends || function(c, e) {
  682. function d() {
  683. this.constructor = c
  684. }
  685. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  686. d.prototype = e.prototype;
  687. c.prototype = new d
  688. };
  689. (function(c) {
  690. var e = function(d) {
  691. function a(b, a) {
  692. "undefined" === typeof a && (a = 0);
  693. d.call(this);
  694. this._currentCount = 0;
  695. this.delay = b;
  696. this.repeatCount = a
  697. }
  698. __extends(a, d);
  699. a.prototype.currentCount = function() {
  700. return this._currentCount
  701. };
  702. Object.defineProperty(a.prototype, "running", {
  703. get: function() {
  704. return this._running
  705. },
  706. enumerable: !0,
  707. configurable: !0
  708. });
  709. a.prototype.reset = function() {
  710. this.stop();
  711. this._currentCount = 0
  712. };
  713. a.prototype.start = function() {
  714. this._running || (this.lastTime = c.getTimer(), 0 != this._currentCount && (this._currentCount =
  715. 0), c.Ticker.getInstance().register(this.onEnterFrame, this), this._running = !0)
  716. };
  717. a.prototype.stop = function() {
  718. this._running && (c.Ticker.getInstance().unregister(this.onEnterFrame, this), this._running = !1)
  719. };
  720. a.prototype.onEnterFrame = function(b) {
  721. b = c.getTimer();
  722. b - this.lastTime > this.delay && (this.lastTime = b, this._currentCount++, c.TimerEvent.dispatchTimerEvent(this, c.TimerEvent.TIMER), 0 < this.repeatCount && this._currentCount >= this.repeatCount && (this.stop(), c.TimerEvent.dispatchTimerEvent(this, c.TimerEvent.TIMER_COMPLETE)))
  723. };
  724. return a
  725. }(c.EventDispatcher);
  726. c.Timer = e
  727. })(egret || (egret = {}));
  728. (function(c) {
  729. function e(b) {
  730. b = b.toString();
  731. var a = b.indexOf("(");
  732. return b.substring(9, a)
  733. }
  734. function d(b, h) {
  735. for (var c in b) {
  736. var m = b[c],
  737. f = typeof m;
  738. "function" == f ? m.prototype && (f = m.toString(), a[f] || (a[f] = h + "." + e(m))) : "object" != f || m instanceof Array || d(m, h + "." + c)
  739. }
  740. }
  741. c.__moduleNameList = ["egret", "RES", "dragonBones"];
  742. c.__invalidateModuleFlag = !0;
  743. var a = {};
  744. c.getQualifiedClassName = function(b) {
  745. b = b.prototype ? b.prototype.constructor : b.__proto__.constructor;
  746. var h = b.toString(),
  747. l = a[h];
  748. if (l) return l;
  749. if (c.__invalidateModuleFlag) {
  750. for (var l =
  751. c.__moduleNameList, m = l.length, f = 0; f < m; f++) {
  752. var g = l[f],
  753. k = __global[g];
  754. k && "object" == typeof k && k.__proto__ && "Object" == e(k.__proto__.constructor) && d(k, g)
  755. }
  756. c.__invalidateModuleFlag = !1;
  757. if (l = a[h]) return l
  758. }
  759. return a[h] = l = e(b)
  760. }
  761. })(egret || (egret = {}));
  762. var __global = __global || this;
  763. (function(c) {
  764. var e = {};
  765. c.getDefinitionByName = function(c) {
  766. if (!c) return null;
  767. var a = e[c];
  768. if (a) return a;
  769. for (var b = c.split("."), h = b.length, a = __global, l = 0; l < h; l++)
  770. if (a = a[b[l]], !a) return null;
  771. return e[c] = a
  772. }
  773. })(egret || (egret = {}));
  774. __global = __global || this;
  775. (function(c) {
  776. c.hasDefinition = function(e) {
  777. return c.getDefinitionByName(e) ? !0 : !1
  778. }
  779. })(egret || (egret = {}));
  780. (function(c) {
  781. c.toColorString = function(c) {
  782. if (isNaN(c) || 0 > c) c = 0;
  783. 16777215 < c && (c = 16777215);
  784. for (c = c.toString(16).toUpperCase(); 6 > c.length;) c = "0" + c;
  785. return "#" + c
  786. }
  787. })(egret || (egret = {}));
  788. __extends = this.__extends || function(c, e) {
  789. function d() {
  790. this.constructor = c
  791. }
  792. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  793. d.prototype = e.prototype;
  794. c.prototype = new d
  795. };
  796. (function(c) {
  797. var e = function(d) {
  798. function a(b, a, c, e, f, g) {
  799. "undefined" === typeof b && (b = 1);
  800. "undefined" === typeof a && (a = 0);
  801. "undefined" === typeof c && (c = 0);
  802. "undefined" === typeof e && (e = 1);
  803. "undefined" === typeof f && (f = 0);
  804. "undefined" === typeof g && (g = 0);
  805. d.call(this);
  806. this.a = b;
  807. this.b = a;
  808. this.c = c;
  809. this.d = e;
  810. this.tx = f;
  811. this.ty = g
  812. }
  813. __extends(a, d);
  814. a.prototype.prepend = function(b, a, c, d, e, g) {
  815. var k = this.tx;
  816. if (1 != b || 0 != a || 0 != c || 1 != d) {
  817. var n = this.a,
  818. p = this.c;
  819. this.a = n * b + this.b * c;
  820. this.b = n * a + this.b * d;
  821. this.c = p * b + this.d * c;
  822. this.d = p * a + this.d *
  823. d
  824. }
  825. this.tx = k * b + this.ty * c + e;
  826. this.ty = k * a + this.ty * d + g;
  827. return this
  828. };
  829. a.prototype.append = function(b, a, c, d, e, g) {
  830. var k = this.a,
  831. n = this.b,
  832. p = this.c,
  833. q = this.d;
  834. this.a = b * k + a * p;
  835. this.b = b * n + a * q;
  836. this.c = c * k + d * p;
  837. this.d = c * n + d * q;
  838. this.tx = e * k + g * p + this.tx;
  839. this.ty = e * n + g * q + this.ty;
  840. return this
  841. };
  842. a.prototype.prependMatrix = function(b) {
  843. this.prepend(b.a, b.b, b.c, b.d, b.tx, b.ty);
  844. return this
  845. };
  846. a.prototype.appendMatrix = function(b) {
  847. this.append(b.a, b.b, b.c, b.d, b.tx, b.ty);
  848. return this
  849. };
  850. a.prototype.prependTransform = function(b, h, c, d, e, g, k, n, p) {
  851. if (e %
  852. 360) {
  853. var q = e * a.DEG_TO_RAD;
  854. e = Math.cos(q);
  855. q = Math.sin(q)
  856. } else e = 1, q = 0; if (n || p) this.tx -= n, this.ty -= p;
  857. g || k ? (g *= a.DEG_TO_RAD, k *= a.DEG_TO_RAD, this.prepend(e * c, q * c, -q * d, e * d, 0, 0), this.prepend(Math.cos(k), Math.sin(k), -Math.sin(g), Math.cos(g), b, h)) : this.prepend(e * c, q * c, -q * d, e * d, b, h);
  858. return this
  859. };
  860. a.prototype.appendTransform = function(b, h, c, d, e, g, k, n, p) {
  861. if (e % 360) {
  862. var q = e * a.DEG_TO_RAD;
  863. e = Math.cos(q);
  864. q = Math.sin(q)
  865. } else e = 1, q = 0;
  866. g || k ? (g *= a.DEG_TO_RAD, k *= a.DEG_TO_RAD, this.append(Math.cos(k), Math.sin(k), -Math.sin(g),
  867. Math.cos(g), b, h), this.append(e * c, q * c, -q * d, e * d, 0, 0)) : this.append(e * c, q * c, -q * d, e * d, b, h);
  868. if (n || p) this.tx -= n * this.a + p * this.c, this.ty -= n * this.b + p * this.d;
  869. return this
  870. };
  871. a.prototype.rotate = function(b) {
  872. var a = Math.cos(b);
  873. b = Math.sin(b);
  874. var c = this.a,
  875. d = this.c,
  876. e = this.tx;
  877. this.a = c * a - this.b * b;
  878. this.b = c * b + this.b * a;
  879. this.c = d * a - this.d * b;
  880. this.d = d * b + this.d * a;
  881. this.tx = e * a - this.ty * b;
  882. this.ty = e * b + this.ty * a;
  883. return this
  884. };
  885. a.prototype.skew = function(b, h) {
  886. b *= a.DEG_TO_RAD;
  887. h *= a.DEG_TO_RAD;
  888. this.append(Math.cos(h), Math.sin(h), -Math.sin(b),
  889. Math.cos(b), 0, 0);
  890. return this
  891. };
  892. a.prototype.scale = function(b, a) {
  893. this.a *= b;
  894. this.d *= a;
  895. this.c *= b;
  896. this.b *= a;
  897. this.tx *= b;
  898. this.ty *= a;
  899. return this
  900. };
  901. a.prototype.translate = function(b, a) {
  902. this.tx += b;
  903. this.ty += a;
  904. return this
  905. };
  906. a.prototype.identity = function() {
  907. this.a = this.d = 1;
  908. this.b = this.c = this.tx = this.ty = 0;
  909. return this
  910. };
  911. a.prototype.invert = function() {
  912. var b = this.a,
  913. a = this.b,
  914. c = this.c,
  915. d = this.d,
  916. e = this.tx,
  917. g = b * d - a * c;
  918. this.a = d / g;
  919. this.b = -a / g;
  920. this.c = -c / g;
  921. this.d = b / g;
  922. this.tx = (c * this.ty - d * e) / g;
  923. this.ty = -(b * this.ty - a * e) / g;
  924. return this
  925. };
  926. a.transformCoords = function(b, a, l) {
  927. var d = c.Point.identity;
  928. d.x = b.a * a + b.c * l + b.tx;
  929. d.y = b.d * l + b.b * a + b.ty;
  930. return d
  931. };
  932. a.identity = new a;
  933. a.DEG_TO_RAD = Math.PI / 180;
  934. return a
  935. }(c.HashObject);
  936. c.Matrix = e
  937. })(egret || (egret = {}));
  938. __extends = this.__extends || function(c, e) {
  939. function d() {
  940. this.constructor = c
  941. }
  942. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  943. d.prototype = e.prototype;
  944. c.prototype = new d
  945. };
  946. (function(c) {
  947. var e = function(c) {
  948. function a(b, a) {
  949. "undefined" === typeof b && (b = 0);
  950. "undefined" === typeof a && (a = 0);
  951. c.call(this);
  952. this.x = b;
  953. this.y = a
  954. }
  955. __extends(a, c);
  956. a.prototype.clone = function() {
  957. return new a(this.x, this.y)
  958. };
  959. a.prototype.equals = function(b) {
  960. return this.x == b.x && this.y == b.y
  961. };
  962. a.distance = function(b, a) {
  963. return Math.sqrt((b.x - a.x) * (b.x - a.x) + (b.y - a.y) * (b.y - a.y))
  964. };
  965. a.identity = new a(0, 0);
  966. return a
  967. }(c.HashObject);
  968. c.Point = e
  969. })(egret || (egret = {}));
  970. __extends = this.__extends || function(c, e) {
  971. function d() {
  972. this.constructor = c
  973. }
  974. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  975. d.prototype = e.prototype;
  976. c.prototype = new d
  977. };
  978. (function(c) {
  979. var e = function(c) {
  980. function a(b, a, l, e) {
  981. "undefined" === typeof b && (b = 0);
  982. "undefined" === typeof a && (a = 0);
  983. "undefined" === typeof l && (l = 0);
  984. "undefined" === typeof e && (e = 0);
  985. c.call(this);
  986. this.x = b;
  987. this.y = a;
  988. this.width = l;
  989. this.height = e
  990. }
  991. __extends(a, c);
  992. Object.defineProperty(a.prototype, "right", {
  993. get: function() {
  994. return this.x + this.width
  995. },
  996. set: function(b) {
  997. this.width = b - this.x
  998. },
  999. enumerable: !0,
  1000. configurable: !0
  1001. });
  1002. Object.defineProperty(a.prototype, "bottom", {
  1003. get: function() {
  1004. return this.y + this.height
  1005. },
  1006. set: function(b) {
  1007. this.height =
  1008. b - this.y
  1009. },
  1010. enumerable: !0,
  1011. configurable: !0
  1012. });
  1013. a.prototype.initialize = function(b, a, c, d) {
  1014. this.x = b;
  1015. this.y = a;
  1016. this.width = c;
  1017. this.height = d;
  1018. return this
  1019. };
  1020. a.prototype.contains = function(b, a) {
  1021. return this.x <= b && this.x + this.width >= b && this.y <= a && this.y + this.height >= a
  1022. };
  1023. a.prototype.intersects = function(b) {
  1024. return this.contains(b.x, b.y) || this.contains(b.x, b.bottom) || this.contains(b.right, b.y) || this.contains(b.right, b.bottom) ? !0 : !1
  1025. };
  1026. a.prototype.clone = function() {
  1027. return new a(this.x, this.y, this.width, this.height)
  1028. };
  1029. a.prototype.containsPoint =
  1030. function(b) {
  1031. return this.x < b.x && this.x + this.width > b.x && this.y < b.y && this.y + this.height > b.y ? !0 : !1
  1032. };
  1033. a.identity = new a(0, 0, 0, 0);
  1034. return a
  1035. }(c.HashObject);
  1036. c.Rectangle = e
  1037. })(egret || (egret = {}));
  1038. (function(c) {
  1039. var e = function() {
  1040. function d() {}
  1041. d.fatal = function(a, b) {
  1042. "undefined" === typeof b && (b = null);
  1043. c.Logger.traceToConsole("Fatal", a, b);
  1044. throw Error(c.Logger.getTraceCode("Fatal", a, b));
  1045. };
  1046. d.info = function(a, b) {
  1047. "undefined" === typeof b && (b = null);
  1048. c.Logger.traceToConsole("Info", a, b)
  1049. };
  1050. d.warning = function(a, b) {
  1051. "undefined" === typeof b && (b = null);
  1052. c.Logger.traceToConsole("Warning", a, b)
  1053. };
  1054. d.traceToConsole = function(a, b, h) {
  1055. console.log(c.Logger.getTraceCode(a, b, h))
  1056. };
  1057. d.getTraceCode = function(a, b, h) {
  1058. return "[" + a + "]" + b + ":" +
  1059. (null == h ? "" : h)
  1060. };
  1061. return d
  1062. }();
  1063. c.Logger = e
  1064. })(egret || (egret = {}));
  1065. __extends = this.__extends || function(c, e) {
  1066. function d() {
  1067. this.constructor = c
  1068. }
  1069. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  1070. d.prototype = e.prototype;
  1071. c.prototype = new d
  1072. };
  1073. (function(c) {
  1074. var e = function(b) {
  1075. function h() {
  1076. b.call(this);
  1077. this._designHeight = this._designWidth = 0;
  1078. this._scaleY = this._scaleX = 1;
  1079. var a = document.getElementById(h.canvas_name),
  1080. c = a.height;
  1081. this._designWidth = a.width;
  1082. this._designHeight = c
  1083. }
  1084. __extends(h, b);
  1085. h.getInstance = function() {
  1086. null == h.instance && (a.initialize(), h.instance = new h);
  1087. return h.instance
  1088. };
  1089. h.prototype.setDesignSize = function(b, a, h) {
  1090. this.setResolutionPolicy(h);
  1091. this._designWidth = b;
  1092. this._designHeight = a;
  1093. this._resolutionPolicy._apply(this, this._designWidth,
  1094. this._designHeight)
  1095. };
  1096. h.prototype.setResolutionPolicy = function(b) {
  1097. this._resolutionPolicy = b;
  1098. b.init(this)
  1099. };
  1100. h.prototype.getScaleX = function() {
  1101. return this._scaleX
  1102. };
  1103. h.prototype.getScaleY = function() {
  1104. return this._scaleY
  1105. };
  1106. h.canvas_name = "gameCanvas";
  1107. h.canvas_div_name = "gameDiv";
  1108. return h
  1109. }(c.HashObject);
  1110. c.StageDelegate = e;
  1111. var d = function() {
  1112. function b(a, h) {
  1113. this.setContainerStrategy(a);
  1114. this.setContentStrategy(h)
  1115. }
  1116. b.prototype.init = function(b) {
  1117. this._containerStrategy.init(b);
  1118. this._contentStrategy.init(b)
  1119. };
  1120. b.prototype._apply =
  1121. function(b, a, h) {
  1122. this._containerStrategy._apply(b, a, h);
  1123. this._contentStrategy._apply(b, a, h)
  1124. };
  1125. b.prototype.setContainerStrategy = function(b) {
  1126. b instanceof a && (this._containerStrategy = b)
  1127. };
  1128. b.prototype.setContentStrategy = function(b) {
  1129. b instanceof h && (this._contentStrategy = b)
  1130. };
  1131. return b
  1132. }();
  1133. c.ResolutionPolicy = d;
  1134. var a = function() {
  1135. function a() {}
  1136. a.initialize = function() {
  1137. a.EQUAL_TO_FRAME = new b
  1138. };
  1139. a.prototype.init = function(b) {};
  1140. a.prototype._apply = function(b, a, h) {};
  1141. a.prototype._setupContainer = function() {
  1142. var b = document.body,
  1143. a;
  1144. b && (a = b.style) && (a.paddingTop = a.paddingTop || "0px", a.paddingRight = a.paddingRight || "0px", a.paddingBottom = a.paddingBottom || "0px", a.paddingLeft = a.paddingLeft || "0px", a.borderTop = a.borderTop || "0px", a.borderRight = a.borderRight || "0px", a.borderBottom = a.borderBottom || "0px", a.borderLeft = a.borderLeft || "0px", a.marginTop = a.marginTop || "0px", a.marginRight = a.marginRight || "0px", a.marginBottom = a.marginBottom || "0px", a.marginLeft = a.marginLeft || "0px")
  1145. };
  1146. return a
  1147. }();
  1148. c.ContainerStrategy = a;
  1149. var b = function(b) {
  1150. function a() {
  1151. b.apply(this,
  1152. arguments)
  1153. }
  1154. __extends(a, b);
  1155. a.prototype._apply = function(b) {
  1156. this._setupContainer()
  1157. };
  1158. return a
  1159. }(a);
  1160. c.EqualToFrame = b;
  1161. var h = function() {
  1162. function b() {}
  1163. b.prototype.init = function(b) {};
  1164. b.prototype._apply = function(b, a, h) {};
  1165. return b
  1166. }();
  1167. c.ContentStrategy = h;
  1168. d = function(b) {
  1169. function a() {
  1170. b.apply(this, arguments)
  1171. }
  1172. __extends(a, b);
  1173. a.prototype._apply = function(b, a, h) {
  1174. var c = document.getElementById(e.canvas_name),
  1175. l = document.getElementById(e.canvas_div_name),
  1176. d = c.height / h,
  1177. m = window.innerHeight,
  1178. d = m / h,
  1179. s = a * d;
  1180. c.width = a;
  1181. c.height = h;
  1182. c.style.width =
  1183. s + "px";
  1184. c.style.height = m + "px";
  1185. l.style.width = s + "px";
  1186. l.style.height = m + "px";
  1187. b._scaleX = d;
  1188. b._scaleY = d
  1189. };
  1190. return a
  1191. }(h);
  1192. c.FixedHeight = d;
  1193. d = function(b) {
  1194. function a() {
  1195. b.apply(this, arguments)
  1196. }
  1197. __extends(a, b);
  1198. a.prototype._apply = function(b, a, h) {
  1199. h = document.getElementById(e.canvas_name);
  1200. var c = document.getElementById(e.canvas_div_name),
  1201. l = document.documentElement.clientWidth,
  1202. d = document.documentElement.clientHeight,
  1203. m = l / a;
  1204. h.width = a;
  1205. h.height = d / m;
  1206. h.style.width = l + "px";
  1207. h.style.height = d + "px";
  1208. c.style.width = l + "px";
  1209. c.style.height =
  1210. d + "px";
  1211. b._scaleX = m;
  1212. b._scaleY = m
  1213. };
  1214. return a
  1215. }(h);
  1216. c.FixedWidth = d;
  1217. d = function(b) {
  1218. function a(h, c) {
  1219. b.call(this);
  1220. this.width = h;
  1221. this.height = c
  1222. }
  1223. __extends(a, b);
  1224. a.prototype._apply = function(b, a, h) {
  1225. h = document.getElementById(e.canvas_name);
  1226. var c = document.getElementById(e.canvas_div_name),
  1227. l = this.width,
  1228. d = this.height,
  1229. m = l / a;
  1230. h.width = a;
  1231. h.height = d / m;
  1232. h.style.width = l + "px";
  1233. h.style.height = d + "px";
  1234. c.style.width = l + "px";
  1235. c.style.height = d + "px";
  1236. b._scaleX = m;
  1237. b._scaleY = m
  1238. };
  1239. return a
  1240. }(h);
  1241. c.FixedSize = d;
  1242. d = function(b) {
  1243. function a(h, c) {
  1244. b.call(this);
  1245. this.width = h;
  1246. this.height = c
  1247. }
  1248. __extends(a, b);
  1249. a.prototype._apply = function(b, a, h) {
  1250. a = document.getElementById(e.canvas_name);
  1251. a.style.width = a.width + "px";
  1252. a.style.height = a.height + "px";
  1253. b._scaleX = 1;
  1254. b._scaleY = 1
  1255. };
  1256. return a
  1257. }(h);
  1258. c.NoScale = d
  1259. })(egret || (egret = {}));
  1260. __extends = this.__extends || function(c, e) {
  1261. function d() {
  1262. this.constructor = c
  1263. }
  1264. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  1265. d.prototype = e.prototype;
  1266. c.prototype = new d
  1267. };
  1268. (function(c) {
  1269. var e = function(d) {
  1270. function a() {
  1271. d.call(this);
  1272. this._originalData = {};
  1273. this._drawAreaList = []
  1274. }
  1275. __extends(a, d);
  1276. a.getInstance = function() {
  1277. null == a.instance && (a.instance = new a);
  1278. return a.instance
  1279. };
  1280. a.prototype.addDrawArea = function(b) {
  1281. this._drawAreaList.push(b)
  1282. };
  1283. a.prototype.clearDrawArea = function() {
  1284. this._drawAreaList = []
  1285. };
  1286. a.prototype.drawImage = function(b, a, l, d, e, g, k, n, p, q) {
  1287. k = k || 0;
  1288. n = n || 0;
  1289. var r = a._texture_to_render;
  1290. if (null != r && 0 != g && 0 != e && 0 != p && 0 != q)
  1291. if (a._worldBounds) {
  1292. var s = this._originalData;
  1293. s.sourceX =
  1294. l;
  1295. s.sourceY = d;
  1296. s.sourceWidth = e;
  1297. s.sourceHeight = g;
  1298. s.destX = k;
  1299. s.destY = n;
  1300. s.destWidth = p;
  1301. s.destHeight = q;
  1302. for (var z = this.getDrawAreaList(), A = 0; A < z.length; A++) {
  1303. var v = z[A];
  1304. if (!this.ignoreRender(a, v, s.destX, s.destY)) {
  1305. if (0 != this._drawAreaList.length)
  1306. if (0 != a._worldTransform.b || 0 != a._worldTransform.c) {
  1307. if (a._worldBounds.x + s.destX < v.x || a._worldBounds.y + s.destY < v.y || a._worldBounds.x + a._worldBounds.width + s.destX > v.x + v.width || a._worldBounds.y + a._worldBounds.height + s.destY > v.y + v.height) {
  1308. c.Logger.fatal("\u8bf7\u4e0d\u8981\u8ba9\u5e26\u6709\u65cb\u8f6c\u548c\u659c\u5207\u7684\u663e\u793a\u5bf9\u8c61\u8de8\u8fc7\u91cd\u7ed8\u533a\u57df");
  1309. break
  1310. }
  1311. } else {
  1312. var B = a._worldTransform.a,
  1313. C = a._worldTransform.d,
  1314. t;
  1315. a._worldBounds.x + s.destX < v.x && (t = (v.x - a._worldBounds.x) / B - s.destX, l += t / (p / e), e -= t / (p / e), p -= t, k += t);
  1316. a._worldBounds.y + s.destY < v.y && (t = (v.y - a._worldBounds.y) / C - s.destY, d += t / (q / g), g -= t / (q / g), q -= t, n += t);
  1317. a._worldBounds.x + a._worldBounds.width + s.destX > v.x + v.width && (t = (a._worldBounds.x + a._worldBounds.width - v.x - v.width) / B + s.destX, e -= t / (p / e), p -= t);
  1318. a._worldBounds.y + a._worldBounds.height + s.destY > v.y + v.height && (t = (a._worldBounds.y + a._worldBounds.height -
  1319. v.y - v.height) / C + s.destY, g -= t / (q / g), q -= t)
  1320. }
  1321. b.drawImage(r, l, d, e, g, k, n, p, q)
  1322. }
  1323. }
  1324. } else b.drawImage(r, l, d, e, g, k, n, p, q)
  1325. };
  1326. a.prototype.ignoreRender = function(b, a, c, d) {
  1327. var e = b._worldBounds;
  1328. c *= b._worldTransform.a;
  1329. d *= b._worldTransform.d;
  1330. return e.x + e.width + c <= a.x || e.x + c >= a.x + a.width || e.y + e.height + d <= a.y || e.y + d >= a.y + a.height ? !0 : !1
  1331. };
  1332. a.prototype.getDrawAreaList = function() {
  1333. var b;
  1334. 0 == this._drawAreaList.length ? (this._defaultDrawAreaList || (this._defaultDrawAreaList = [new c.Rectangle(0, 0, c.MainContext.instance.stage.stageWidth,
  1335. c.MainContext.instance.stage.stageHeight)]), b = this._defaultDrawAreaList) : b = this._drawAreaList;
  1336. return b
  1337. };
  1338. return a
  1339. }(c.HashObject);
  1340. c.RenderFilter = e
  1341. })(egret || (egret = {}));
  1342. (function(c) {
  1343. var e = function() {
  1344. function d() {}
  1345. d.mapClass = function(a, b, h) {
  1346. "undefined" === typeof h && (h = "");
  1347. a = this.getKey(a) + "#" + h;
  1348. this.mapClassDic[a] = b
  1349. };
  1350. d.getKey = function(a) {
  1351. return "string" == typeof a ? a : c.getQualifiedClassName(a)
  1352. };
  1353. d.mapValue = function(a, b, h) {
  1354. "undefined" === typeof h && (h = "");
  1355. a = this.getKey(a) + "#" + h;
  1356. this.mapValueDic[a] = b
  1357. };
  1358. d.hasMapRule = function(a, b) {
  1359. "undefined" === typeof b && (b = "");
  1360. var h = this.getKey(a) + "#" + b;
  1361. return this.mapValueDic[h] || this.mapClassDic[h] ? !0 : !1
  1362. };
  1363. d.getInstance = function(a, b) {
  1364. "undefined" ===
  1365. typeof b && (b = "");
  1366. var h = this.getKey(a) + "#" + b;
  1367. if (this.mapValueDic[h]) return this.mapValueDic[h];
  1368. var c = this.mapClassDic[h];
  1369. if (c) return c = new c, this.mapValueDic[h] = c, delete this.mapClassDic[h], c;
  1370. throw Error("\u8c03\u7528\u4e86\u672a\u914d\u7f6e\u7684\u6ce8\u5165\u89c4\u5219:" + h + "\u3002 \u8bf7\u5148\u5728\u9879\u76ee\u521d\u59cb\u5316\u91cc\u914d\u7f6e\u6307\u5b9a\u7684\u6ce8\u5165\u89c4\u5219\uff0c\u518d\u8c03\u7528\u5bf9\u5e94\u5355\u4f8b\u3002");
  1371. };
  1372. d.mapClassDic = {};
  1373. d.mapValueDic = {};
  1374. return d
  1375. }();
  1376. c.Injector =
  1377. e
  1378. })(egret || (egret = {}));
  1379. __extends = this.__extends || function(c, e) {
  1380. function d() {
  1381. this.constructor = c
  1382. }
  1383. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  1384. d.prototype = e.prototype;
  1385. c.prototype = new d
  1386. };
  1387. (function(c) {
  1388. var e = function(d) {
  1389. function a() {
  1390. d.call(this);
  1391. this._parent = null;
  1392. this._cacheAsBitmap = !1;
  1393. this._y = this._x = 0;
  1394. this._scaleY = this._scaleX = 1;
  1395. this._anchorY = this._anchorX = this._anchorOffsetY = this._anchorOffsetX = 0;
  1396. this.visible = !0;
  1397. this._rotation = 0;
  1398. this._alpha = 1;
  1399. this._skewY = this._skewX = 0;
  1400. this._hasHeightSet = this._hasWidthSet = !1;
  1401. this.worldAlpha = 1;
  1402. this._worldTransform = new c.Matrix;
  1403. this._cacheBounds = new c.Rectangle(0, 0, 0, 0)
  1404. }
  1405. __extends(a, d);
  1406. Object.defineProperty(a.prototype, "parent", {
  1407. get: function() {
  1408. return this._parent
  1409. },
  1410. enumerable: !0,
  1411. configurable: !0
  1412. });
  1413. a.prototype._parentChanged = function(b) {
  1414. this._parent = b
  1415. };
  1416. Object.defineProperty(a.prototype, "x", {
  1417. get: function() {
  1418. return this._x
  1419. },
  1420. set: function(b) {
  1421. c.NumberUtils.isNumber(b) && (this._x = b)
  1422. },
  1423. enumerable: !0,
  1424. configurable: !0
  1425. });
  1426. Object.defineProperty(a.prototype, "y", {
  1427. get: function() {
  1428. return this._y
  1429. },
  1430. set: function(b) {
  1431. c.NumberUtils.isNumber(b) && (this._y = b)
  1432. },
  1433. enumerable: !0,
  1434. configurable: !0
  1435. });
  1436. Object.defineProperty(a.prototype, "scaleX", {
  1437. get: function() {
  1438. return this._scaleX
  1439. },
  1440. set: function(b) {
  1441. c.NumberUtils.isNumber(b) &&
  1442. (this._scaleX = b)
  1443. },
  1444. enumerable: !0,
  1445. configurable: !0
  1446. });
  1447. Object.defineProperty(a.prototype, "scaleY", {
  1448. get: function() {
  1449. return this._scaleY
  1450. },
  1451. set: function(b) {
  1452. c.NumberUtils.isNumber(b) && (this._scaleY = b)
  1453. },
  1454. enumerable: !0,
  1455. configurable: !0
  1456. });
  1457. Object.defineProperty(a.prototype, "anchorOffsetX", {
  1458. get: function() {
  1459. return this._anchorOffsetX
  1460. },
  1461. set: function(b) {
  1462. c.NumberUtils.isNumber(b) && (this._anchorOffsetX = b)
  1463. },
  1464. enumerable: !0,
  1465. configurable: !0
  1466. });
  1467. Object.defineProperty(a.prototype, "anchorOffsetY", {
  1468. get: function() {
  1469. return this._anchorOffsetY
  1470. },
  1471. set: function(b) {
  1472. c.NumberUtils.isNumber(b) && (this._anchorOffsetY = b)
  1473. },
  1474. enumerable: !0,
  1475. configurable: !0
  1476. });
  1477. Object.defineProperty(a.prototype, "anchorX", {
  1478. get: function() {
  1479. return this._anchorX
  1480. },
  1481. set: function(b) {
  1482. c.NumberUtils.isNumber(b) && (this._anchorX = b)
  1483. },
  1484. enumerable: !0,
  1485. configurable: !0
  1486. });
  1487. Object.defineProperty(a.prototype, "anchorY", {
  1488. get: function() {
  1489. return this._anchorY
  1490. },
  1491. set: function(b) {
  1492. c.NumberUtils.isNumber(b) && (this._anchorY = b)
  1493. },
  1494. enumerable: !0,
  1495. configurable: !0
  1496. });
  1497. Object.defineProperty(a.prototype, "rotation", {
  1498. get: function() {
  1499. return this._rotation
  1500. },
  1501. set: function(b) {
  1502. c.NumberUtils.isNumber(b) && (this._rotation = b)
  1503. },
  1504. enumerable: !0,
  1505. configurable: !0
  1506. });
  1507. Object.defineProperty(a.prototype, "alpha", {
  1508. get: function() {
  1509. return this._alpha
  1510. },
  1511. set: function(b) {
  1512. c.NumberUtils.isNumber(b) && (this._alpha = b)
  1513. },
  1514. enumerable: !0,
  1515. configurable: !0
  1516. });
  1517. Object.defineProperty(a.prototype, "skewX", {
  1518. get: function() {
  1519. return this._skewX
  1520. },
  1521. set: function(b) {
  1522. c.NumberUtils.isNumber(b) && (this._skewX = b)
  1523. },
  1524. enumerable: !0,
  1525. configurable: !0
  1526. });
  1527. Object.defineProperty(a.prototype, "skewY", {
  1528. get: function() {
  1529. return this._skewY
  1530. },
  1531. set: function(b) {
  1532. c.NumberUtils.isNumber(b) && (this._skewY = b)
  1533. },
  1534. enumerable: !0,
  1535. configurable: !0
  1536. });
  1537. Object.defineProperty(a.prototype, "touchEnabled", {
  1538. get: function() {
  1539. return this._touchEnabled
  1540. },
  1541. set: function(b) {
  1542. this._touchEnabled = b
  1543. },
  1544. enumerable: !0,
  1545. configurable: !0
  1546. });
  1547. Object.defineProperty(a.prototype, "scrollRect", {
  1548. get: function() {
  1549. return this._scrollRect
  1550. },
  1551. set: function(b) {
  1552. this._scrollRect = b
  1553. },
  1554. enumerable: !0,
  1555. configurable: !0
  1556. });
  1557. Object.defineProperty(a.prototype, "measuredWidth", {
  1558. get: function() {
  1559. return this._measureBounds().width
  1560. },
  1561. enumerable: !0,
  1562. configurable: !0
  1563. });
  1564. Object.defineProperty(a.prototype, "measuredHeight", {
  1565. get: function() {
  1566. return this._measureBounds().height
  1567. },
  1568. enumerable: !0,
  1569. configurable: !0
  1570. });
  1571. Object.defineProperty(a.prototype, "explicitWidth", {
  1572. get: function() {
  1573. return this._explicitWidth
  1574. },
  1575. enumerable: !0,
  1576. configurable: !0
  1577. });
  1578. Object.defineProperty(a.prototype, "explicitHeight", {
  1579. get: function() {
  1580. return this._explicitHeight
  1581. },
  1582. enumerable: !0,
  1583. configurable: !0
  1584. });
  1585. Object.defineProperty(a.prototype, "width", {
  1586. get: function() {
  1587. return this.getBounds(c.Rectangle.identity).width
  1588. },
  1589. set: function(b) {
  1590. this._setWidth(b)
  1591. },
  1592. enumerable: !0,
  1593. configurable: !0
  1594. });
  1595. Object.defineProperty(a.prototype, "height", {
  1596. get: function() {
  1597. return this.getBounds(c.Rectangle.identity).height
  1598. },
  1599. set: function(b) {
  1600. this._setHeight(b)
  1601. },
  1602. enumerable: !0,
  1603. configurable: !0
  1604. });
  1605. a.prototype._setWidth = function(b) {
  1606. this._explicitWidth = b;
  1607. this._hasWidthSet = c.NumberUtils.isNumber(b)
  1608. };
  1609. a.prototype._setHeight = function(b) {
  1610. this._explicitHeight = b;
  1611. this._hasHeightSet = c.NumberUtils.isNumber(b)
  1612. };
  1613. a.prototype._draw = function(b) {
  1614. if (this.visible && !this.drawCacheTexture(b)) {
  1615. b.setAlpha(this.worldAlpha,
  1616. this.blendMode);
  1617. b.setTransform(this._worldTransform);
  1618. var a = this.mask || this._scrollRect;
  1619. a && b.pushMask(a);
  1620. this._render(b);
  1621. a && b.popMask()
  1622. }
  1623. this.destroyCacheBounds()
  1624. };
  1625. a.prototype.drawCacheTexture = function(b) {
  1626. if (this._cacheAsBitmap) {
  1627. var a = this._texture_to_render,
  1628. l = a._offsetX,
  1629. d = a._offsetY,
  1630. e = a._textureWidth,
  1631. a = a._textureHeight;
  1632. this._updateTransform();
  1633. b.setAlpha(this.worldAlpha, this.blendMode);
  1634. b.setTransform(this._worldTransform);
  1635. var g = this.mask || this._scrollRect;
  1636. g && b.pushMask(g);
  1637. var k = c.MainContext.instance.rendererContext.texture_scale_factor;
  1638. c.RenderFilter.getInstance().drawImage(b, this, 0, 0, e * k, a * k, l, d, e, a);
  1639. g && b.popMask();
  1640. return !0
  1641. }
  1642. return !1
  1643. };
  1644. a.prototype._updateTransform = function() {
  1645. this._worldTransform.identity().appendMatrix(this._parent._worldTransform);
  1646. var b = this._getOffsetPoint();
  1647. this._worldTransform.appendTransform(this._x, this._y, this._scaleX, this._scaleY, this._rotation, this._skewX, this._skewY, b.x, b.y);
  1648. this._scrollRect && this._worldTransform.append(1, 0, 0, 1, -this._scrollRect.x, -this._scrollRect.y);
  1649. this.worldAlpha = this._parent.worldAlpha *
  1650. this._alpha
  1651. };
  1652. a.prototype._render = function(b) {};
  1653. a.prototype.getBounds = function(b) {
  1654. if (0 == this._cacheBounds.x && 0 == this._cacheBounds.y && 0 == this._cacheBounds.width && 0 == this._cacheBounds.height) {
  1655. var a = this._measureBounds(),
  1656. l = this._hasWidthSet ? this._explicitWidth : a.width,
  1657. d = this._hasHeightSet ? this._explicitHeight : a.height,
  1658. e = a.x,
  1659. a = a.y,
  1660. g, k;
  1661. 0 != this._anchorX || 0 != this._anchorY ? (g = l * this._anchorX, k = d * this._anchorY) : (g = this._anchorOffsetX, k = this._anchorOffsetY);
  1662. this._cacheBounds.initialize(e - g, a - k, l, d)
  1663. }
  1664. l = this._cacheBounds;
  1665. b || (b = new c.Rectangle);
  1666. return b.initialize(l.x, l.y, l.width, l.height)
  1667. };
  1668. a.prototype.destroyCacheBounds = function() {
  1669. this._cacheBounds.x = 0;
  1670. this._cacheBounds.y = 0;
  1671. this._cacheBounds.width = 0;
  1672. this._cacheBounds.height = 0
  1673. };
  1674. a.prototype._getConcatenatedMatrix = function() {
  1675. for (var b = a.identityMatrixForGetConcatenated.identity(), h = this; null != h;) {
  1676. if (0 != h._anchorX || 0 != h._anchorY) {
  1677. var l = h._getSize(c.Rectangle.identity);
  1678. b.prependTransform(h._x, h._y, h._scaleX, h._scaleY, h._rotation, h._skewX, h._skewY, l.width * h._anchorX, l.height *
  1679. h._anchorY)
  1680. } else b.prependTransform(h._x, h._y, h._scaleX, h._scaleY, h._rotation, h._skewX, h._skewY, h._anchorOffsetX, h._anchorOffsetY);
  1681. h = h._parent
  1682. }
  1683. return b
  1684. };
  1685. a.prototype.localToGlobal = function(b, a, l) {
  1686. "undefined" === typeof b && (b = 0);
  1687. "undefined" === typeof a && (a = 0);
  1688. var d = this._getConcatenatedMatrix();
  1689. d.append(1, 0, 0, 1, b, a);
  1690. l || (l = new c.Point);
  1691. l.x = d.tx;
  1692. l.y = d.ty;
  1693. return l
  1694. };
  1695. a.prototype.globalToLocal = function(b, a, l) {
  1696. "undefined" === typeof b && (b = 0);
  1697. "undefined" === typeof a && (a = 0);
  1698. var d = this._getConcatenatedMatrix();
  1699. d.invert();
  1700. d.append(1, 0, 0, 1, b, a);
  1701. l || (l = new c.Point);
  1702. l.x = d.tx;
  1703. l.y = d.ty;
  1704. return l
  1705. };
  1706. a.prototype.hitTest = function(b, a, l) {
  1707. "undefined" === typeof l && (l = !1);
  1708. if (!this.visible || !l && !this._touchEnabled) return null;
  1709. l = this._getSize(c.Rectangle.identity);
  1710. return 0 < b && b < l.width && 0 < a && a < l.height ? this.mask || this._scrollRect ? this._scrollRect && b < this._scrollRect.width && a < this._scrollRect.height || this.mask && this.mask.x < b && b < this.mask.x + this.mask.width && this.mask.y < a && a < this.mask.y + this.mask.height ? this : null : this : null
  1711. };
  1712. a.prototype.hitTestPoint =
  1713. function(b, a, l) {
  1714. b = this.globalToLocal(b, a);
  1715. return l ? (this._hitTestPointTexture || (this._hitTestPointTexture = new c.RenderTexture), l = this._hitTestPointTexture, l.drawToTexture(this), 0 != l.getPixel32(b.x - this._hitTestPointTexture._offsetX, b.y - this._hitTestPointTexture._offsetY)[3] ? !0 : !1) : !!this.hitTest(b.x, b.y, !0)
  1716. };
  1717. a.prototype._getMatrix = function() {
  1718. var b = c.Matrix.identity.identity(),
  1719. a = this._getOffsetPoint();
  1720. b.appendTransform(this._x, this._y, this._scaleX, this._scaleY, this._rotation, this._skewX, this._skewY,
  1721. a.x, a.y);
  1722. return b
  1723. };
  1724. a.prototype._getSize = function(b) {
  1725. return this._hasHeightSet && this._hasWidthSet ? b.initialize(NaN, NaN, this._explicitWidth, this._explicitHeight) : this._measureSize(c.Rectangle.identity)
  1726. };
  1727. a.prototype._measureSize = function(b) {
  1728. return this._measureBounds()
  1729. };
  1730. a.prototype._measureBounds = function() {
  1731. return c.Rectangle.identity.initialize(0, 0, 0, 0)
  1732. };
  1733. a.prototype._getOffsetPoint = function() {
  1734. var b = this._anchorOffsetX,
  1735. a = this._anchorOffsetY;
  1736. if (0 != this._anchorX || 0 != this._anchorY) a = this._getSize(c.Rectangle.identity),
  1737. b = this._anchorX * a.width, a = this._anchorY * a.height;
  1738. var l = c.Point.identity;
  1739. l.x = b;
  1740. l.y = a;
  1741. return l
  1742. };
  1743. a.prototype._onAddToStage = function() {
  1744. this._stage = c.MainContext.instance.stage;
  1745. c.DisplayObjectContainer.__EVENT__ADD_TO_STAGE_LIST.push(this)
  1746. };
  1747. a.prototype._onRemoveFromStage = function() {
  1748. this._stage = null;
  1749. c.DisplayObjectContainer.__EVENT__REMOVE_FROM_STAGE_LIST.push(this)
  1750. };
  1751. Object.defineProperty(a.prototype, "stage", {
  1752. get: function() {
  1753. return this._stage
  1754. },
  1755. enumerable: !0,
  1756. configurable: !0
  1757. });
  1758. a.prototype.addEventListener =
  1759. function(b, h, l, e, f) {
  1760. "undefined" === typeof e && (e = !1);
  1761. "undefined" === typeof f && (f = 0);
  1762. d.prototype.addEventListener.call(this, b, h, l, e, f);
  1763. ((e = b == c.Event.ENTER_FRAME) || b == c.Event.RENDER) && this._insertEventBin(e ? a._enterFrameCallBackList : a._renderCallBackList, h, l, f)
  1764. };
  1765. a.prototype.removeEventListener = function(b, h, l, e) {
  1766. "undefined" === typeof e && (e = !1);
  1767. d.prototype.removeEventListener.call(this, b, h, l, e);
  1768. ((e = b == c.Event.ENTER_FRAME) || b == c.Event.RENDER) && this._removeEventBin(e ? a._enterFrameCallBackList : a._renderCallBackList,
  1769. h, l)
  1770. };
  1771. a.prototype.dispatchEvent = function(b) {
  1772. if (!b._bubbles) return d.prototype.dispatchEvent.call(this, b);
  1773. for (var a = [], c = this; c;) a.unshift(c), c = c.parent;
  1774. for (var e = a.length, c = e - 1, e = e - 2; 0 <= e; e--) a.push(a[e]);
  1775. b._reset();
  1776. this._dispatchPropagationEvent(b, a, c);
  1777. return !b.isDefaultPrevented()
  1778. };
  1779. a.prototype._dispatchPropagationEvent = function(b, a, c) {
  1780. for (var d = a.length, e = 0; e < d; e++) {
  1781. var g = a[e];
  1782. b._setCurrentTarget(g);
  1783. b._target = this;
  1784. b._eventPhase = e < c ? 1 : e == c ? 2 : 3;
  1785. g._notifyListener(b);
  1786. if (b._isPropagationStopped || b._isPropagationImmediateStopped) break
  1787. }
  1788. };
  1789. a.prototype.willTrigger = function(b) {
  1790. for (var a = this; a;) {
  1791. if (a.hasEventListener(b)) return !0;
  1792. a = a._parent
  1793. }
  1794. return !1
  1795. };
  1796. Object.defineProperty(a.prototype, "cacheAsBitmap", {
  1797. get: function() {
  1798. return this._cacheAsBitmap
  1799. },
  1800. set: function(b) {
  1801. (this._cacheAsBitmap = b) ? (this.renderTexture || (this.renderTexture = new c.RenderTexture), this.renderTexture.drawToTexture(this), this._texture_to_render = this.renderTexture) : this._texture_to_render = null
  1802. },
  1803. enumerable: !0,
  1804. configurable: !0
  1805. });
  1806. a.getTransformBounds = function(b, a) {
  1807. var c, d, e = b.width,
  1808. g = b.height,
  1809. k = e * a.a,
  1810. e = e * a.b,
  1811. n = g * a.c,
  1812. g = g * a.d,
  1813. p = a.tx,
  1814. q = a.ty,
  1815. r = p,
  1816. s = p,
  1817. z = q,
  1818. A = q;
  1819. (c = k + p) < r ? r = c : c > s && (s = c);
  1820. (c = k + n + p) < r ? r = c : c > s && (s = c);
  1821. (c = n + p) < r ? r = c : c > s && (s = c);
  1822. (d = e + q) < z ? z = d : d > A && (A = d);
  1823. (d = e + g + q) < z ? z = d : d > A && (A = d);
  1824. (d = g + q) < z ? z = d : d > A && (A = d);
  1825. return b.initialize(r, z, s - r, A - z)
  1826. };
  1827. a.identityMatrixForGetConcatenated = new c.Matrix;
  1828. a._enterFrameCallBackList = [];
  1829. a._renderCallBackList = [];
  1830. return a
  1831. }(c.EventDispatcher);
  1832. c.DisplayObject = e
  1833. })(egret || (egret = {}));
  1834. __extends = this.__extends || function(c, e) {
  1835. function d() {
  1836. this.constructor = c
  1837. }
  1838. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  1839. d.prototype = e.prototype;
  1840. c.prototype = new d
  1841. };
  1842. (function(c) {
  1843. var e = function(d) {
  1844. function a() {
  1845. d.call(this);
  1846. this._touchChildren = !0;
  1847. this._children = []
  1848. }
  1849. __extends(a, d);
  1850. Object.defineProperty(a.prototype, "touchChildren", {
  1851. get: function() {
  1852. return this._touchChildren
  1853. },
  1854. set: function(b) {
  1855. this._touchChildren = b
  1856. },
  1857. enumerable: !0,
  1858. configurable: !0
  1859. });
  1860. Object.defineProperty(a.prototype, "numChildren", {
  1861. get: function() {
  1862. return this._children.length
  1863. },
  1864. enumerable: !0,
  1865. configurable: !0
  1866. });
  1867. a.prototype.setChildIndex = function(b, a) {
  1868. this.doSetChildIndex(b, a)
  1869. };
  1870. a.prototype.doSetChildIndex = function(b,
  1871. a) {
  1872. var d = this._children.indexOf(b);
  1873. 0 > d && c.Logger.fatal("child\u4e0d\u5728\u5f53\u524d\u5bb9\u5668\u5185");
  1874. this._children.splice(d, 1);
  1875. 0 > a || this._children.length <= a ? this._children.push(b) : this._children.splice(a, 0, b)
  1876. };
  1877. a.prototype.addChild = function(b) {
  1878. var a = this.numChildren;
  1879. b._parent == this && a--;
  1880. return this._doAddChild(b, a)
  1881. };
  1882. a.prototype.addChildAt = function(b, a) {
  1883. return this._doAddChild(b, a)
  1884. };
  1885. a.prototype._doAddChild = function(b, h, d) {
  1886. "undefined" === typeof d && (d = !0);
  1887. if (b == this) return b;
  1888. if (0 > h || h > this._children.length) return c.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4"),
  1889. b;
  1890. var e = b.parent;
  1891. if (e == this) return this.doSetChildIndex(b, h), b;
  1892. e && e.removeChild(b);
  1893. this._children.splice(h, 0, b);
  1894. b._parentChanged(this);
  1895. d && b.dispatchEventWith(c.Event.ADDED, !0);
  1896. if (this._stage)
  1897. for (b._onAddToStage(), h = a.__EVENT__ADD_TO_STAGE_LIST; 0 < h.length;) h.shift().dispatchEventWith(c.Event.ADDED_TO_STAGE);
  1898. return b
  1899. };
  1900. a.prototype.removeChild = function(b) {
  1901. b = this._children.indexOf(b);
  1902. if (0 <= b) return this._doRemoveChild(b);
  1903. c.Logger.fatal("child\u672a\u88abaddChild\u5230\u8be5parent");
  1904. return null
  1905. };
  1906. a.prototype.removeChildAt =
  1907. function(b) {
  1908. if (0 <= b && b < this._children.length) return this._doRemoveChild(b);
  1909. c.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4");
  1910. return null
  1911. };
  1912. a.prototype._doRemoveChild = function(b, h) {
  1913. "undefined" === typeof h && (h = !0);
  1914. var d = this._children,
  1915. e = d[b];
  1916. h && e.dispatchEventWith(c.Event.REMOVED, !0);
  1917. if (this._stage) {
  1918. e._onRemoveFromStage();
  1919. for (var f = a.__EVENT__REMOVE_FROM_STAGE_LIST; 0 < f.length;) f.shift().dispatchEventWith(c.Event.REMOVED_FROM_STAGE)
  1920. }
  1921. e._parentChanged(null);
  1922. d.splice(b, 1);
  1923. return e
  1924. };
  1925. a.prototype.getChildAt = function(b) {
  1926. if (0 <= b && b < this._children.length) return this._children[b];
  1927. c.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4");
  1928. return null
  1929. };
  1930. a.prototype.contains = function(b) {
  1931. for (; b;) {
  1932. if (b == this) return !0;
  1933. b = b._parent
  1934. }
  1935. return !1
  1936. };
  1937. a.prototype.swapChildrenAt = function(b, a) {
  1938. 0 <= b && b < this._children.length && 0 <= a && a < this._children.length ? this._swapChildrenAt(b, a) : c.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4")
  1939. };
  1940. a.prototype.swapChildren = function(b,
  1941. a) {
  1942. var d = this._children.indexOf(b),
  1943. e = this._children.indexOf(a); - 1 == d || -1 == e ? c.Logger.fatal("child\u672a\u88abaddChild\u5230\u8be5parent") : this._swapChildrenAt(d, e)
  1944. };
  1945. a.prototype._swapChildrenAt = function(b, a) {
  1946. if (b != a) {
  1947. var c = this._children,
  1948. d = c[b];
  1949. c[b] = c[a];
  1950. c[a] = d
  1951. }
  1952. };
  1953. a.prototype.getChildIndex = function(b) {
  1954. return this._children.indexOf(b)
  1955. };
  1956. a.prototype.removeChildren = function() {
  1957. for (var b = this._children.length - 1; 0 <= b; b--) this._doRemoveChild(b)
  1958. };
  1959. a.prototype._updateTransform = function() {
  1960. if (this.visible) {
  1961. d.prototype._updateTransform.call(this);
  1962. for (var b = 0, a = this._children.length; b < a; b++) this._children[b]._updateTransform()
  1963. }
  1964. };
  1965. a.prototype._render = function(b) {
  1966. for (var a = 0, c = this._children.length; a < c; a++) this._children[a]._draw(b)
  1967. };
  1968. a.prototype._measureBounds = function() {
  1969. for (var b = 0, a = 0, d = 0, e = 0, f = this._children.length, g = 0; g < f; g++) {
  1970. var k = this._children[g],
  1971. n;
  1972. if (k.visible && (n = c.DisplayObject.getTransformBounds(k._getSize(c.Rectangle.identity), k._getMatrix()))) {
  1973. var k = n.x,
  1974. p = n.y,
  1975. q = n.width + n.x,
  1976. r = n.height + n.y;
  1977. if (k < b || 0 == g) b = k;
  1978. if (q > a || 0 == g) a = q;
  1979. if (p < d ||
  1980. 0 == g) d = p;
  1981. if (r > e || 0 == g) e = r
  1982. }
  1983. }
  1984. return c.Rectangle.identity.initialize(b, d, a - b, e - d)
  1985. };
  1986. a.prototype.hitTest = function(b, a, l) {
  1987. "undefined" === typeof l && (l = !1);
  1988. var e;
  1989. if (!this.visible) return null;
  1990. if (this._scrollRect) {
  1991. if (b > this._scrollRect.width || a > this._scrollRect.height) return null
  1992. } else if (this.mask && (this.mask.x > b || b > this.mask.x + this.mask.width || this.mask.y > a || a > this.mask.y + this.mask.height)) return null;
  1993. for (var f = this._children, g = this._touchChildren, k = f.length - 1; 0 <= k; k--) {
  1994. var n = f[k],
  1995. p = n,
  1996. q = p._getOffsetPoint(),
  1997. r = p._x,
  1998. s = p._y;
  1999. this._scrollRect && (r -= this._scrollRect.x, s -= this._scrollRect.y);
  2000. p = c.Matrix.identity.identity().prependTransform(r, s, p._scaleX, p._scaleY, p._rotation, 0, 0, q.x, q.y);
  2001. p.invert();
  2002. p = c.Matrix.transformCoords(p, b, a);
  2003. if (n = n.hitTest(p.x, p.y, !0)) {
  2004. if (n._touchEnabled && g) return n;
  2005. if (this._touchEnabled) return this;
  2006. null == e && (e = n)
  2007. }
  2008. }
  2009. return e || !this._texture_to_render && !this._graphics ? e : d.prototype.hitTest.call(this, b, a, l)
  2010. };
  2011. a.prototype._onAddToStage = function() {
  2012. d.prototype._onAddToStage.call(this);
  2013. for (var b =
  2014. this.numChildren, a = 0; a < b; a++) this._children[a]._onAddToStage()
  2015. };
  2016. a.prototype._onRemoveFromStage = function() {
  2017. d.prototype._onRemoveFromStage.call(this);
  2018. for (var b = this.numChildren, a = 0; a < b; a++) this._children[a]._onRemoveFromStage()
  2019. };
  2020. a.prototype.getChildByName = function(b) {
  2021. for (var a = this._children, c = this.numChildren, d, e = 0; e < c; e++)
  2022. if (d = a[e], d.name == b) return d;
  2023. return null
  2024. };
  2025. a.__EVENT__ADD_TO_STAGE_LIST = [];
  2026. a.__EVENT__REMOVE_FROM_STAGE_LIST = [];
  2027. return a
  2028. }(c.DisplayObject);
  2029. c.DisplayObjectContainer = e
  2030. })(egret || (egret = {}));
  2031. __extends = this.__extends || function(c, e) {
  2032. function d() {
  2033. this.constructor = c
  2034. }
  2035. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  2036. d.prototype = e.prototype;
  2037. c.prototype = new d
  2038. };
  2039. (function(c) {
  2040. var e = function(d) {
  2041. function a(b, a) {
  2042. d.call(this);
  2043. this.touchEnabled = !0;
  2044. this._stage = this;
  2045. this._stageWidth = b;
  2046. this._stageHeight = a
  2047. }
  2048. __extends(a, d);
  2049. a.prototype.invalidate = function() {
  2050. a._invalidateRenderFlag = !0
  2051. };
  2052. a.prototype._setStageSize = function(b, a) {
  2053. if (this._stageWidth != b || this._stageHeight != a) this._stageWidth = b, this._stageHeight = a, this.dispatchEventWith(c.Event.RESIZE)
  2054. };
  2055. Object.defineProperty(a.prototype, "stageWidth", {
  2056. get: function() {
  2057. return this._stageWidth
  2058. },
  2059. enumerable: !0,
  2060. configurable: !0
  2061. });
  2062. Object.defineProperty(a.prototype,
  2063. "stageHeight", {
  2064. get: function() {
  2065. return this._stageHeight
  2066. },
  2067. enumerable: !0,
  2068. configurable: !0
  2069. });
  2070. a.prototype.hitTest = function(b, a) {
  2071. if (!this.touchEnabled) return null;
  2072. var d;
  2073. if (!this.visible) return this;
  2074. for (var e = this._children, f = e.length - 1; 0 <= f; f--) {
  2075. var g = d = e[f],
  2076. k = g._getOffsetPoint(),
  2077. g = c.Matrix.identity.identity().prependTransform(g.x, g.y, g.scaleX, g.scaleY, g.rotation, 0, 0, k.x, k.y);
  2078. g.invert();
  2079. g = c.Matrix.transformCoords(g, b, a);
  2080. if ((d = d.hitTest(g.x, g.y, !0)) && d.touchEnabled) return d
  2081. }
  2082. return this
  2083. };
  2084. a.prototype.getBounds =
  2085. function(b) {
  2086. b || (b = new c.Rectangle);
  2087. return b.initialize(0, 0, this._stageWidth, this._stageHeight)
  2088. };
  2089. a.prototype._updateTransform = function() {
  2090. for (var b = 0, a = this._children.length; b < a; b++) this._children[b]._updateTransform()
  2091. };
  2092. a._invalidateRenderFlag = !1;
  2093. return a
  2094. }(c.DisplayObjectContainer);
  2095. c.Stage = e
  2096. })(egret || (egret = {}));
  2097. (function(c) {
  2098. var e = function() {
  2099. function c() {}
  2100. c.REPEAT = "repeat";
  2101. c.SCALE = "scale";
  2102. return c
  2103. }();
  2104. c.BitmapFillMode = e
  2105. })(egret || (egret = {}));
  2106. __extends = this.__extends || function(c, e) {
  2107. function d() {
  2108. this.constructor = c
  2109. }
  2110. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  2111. d.prototype = e.prototype;
  2112. c.prototype = new d
  2113. };
  2114. (function(c) {
  2115. var e = function(d) {
  2116. function a(b) {
  2117. d.call(this);
  2118. this.debug = !1;
  2119. this.debugColor = 16711680;
  2120. this.fillMode = "scale";
  2121. b && (this.texture = b)
  2122. }
  2123. __extends(a, d);
  2124. a.prototype._render = function(b) {
  2125. var c = this.texture;
  2126. c ? (this._texture_to_render = c, a._drawBitmap(b, this._hasWidthSet ? this._explicitWidth : c._textureWidth, this._hasHeightSet ? this._explicitHeight : c._textureHeight, this)) : this._texture_to_render = null
  2127. };
  2128. a._drawBitmap = function(b, h, d, e) {
  2129. var f = e._texture_to_render;
  2130. if (f) {
  2131. var g = f._textureWidth,
  2132. k = f._textureHeight;
  2133. if ("scale" == e.fillMode) {
  2134. var n = e.scale9Grid;
  2135. if (n && g - n.width < h && k - n.height < d) a.drawScale9GridImage(b, e, e.scale9Grid, h, d);
  2136. else {
  2137. var n = f._offsetX,
  2138. p = f._offsetY,
  2139. q = f._bitmapWidth || g,
  2140. r = f._bitmapHeight || k;
  2141. e._hasWidthSet ? (h /= g, n = Math.round(n * h), h = Math.round(q * h)) : h = q;
  2142. e._hasHeightSet ? (d /= k, p = Math.round(p * d), d = Math.round(r * d)) : d = r;
  2143. c.RenderFilter.getInstance().drawImage(b, e, f._bitmapX, f._bitmapY, q, r, n, p, h, d)
  2144. }
  2145. } else a.drawRepeatImage(b, e, h, d)
  2146. }
  2147. };
  2148. a.drawRepeatImage = function(b, a, d, e) {
  2149. var f = a._texture_to_render;
  2150. if (f)
  2151. for (var g =
  2152. f._textureWidth, k = f._textureHeight, n = f._bitmapX, p = f._bitmapY, q = f._bitmapWidth || g, r = f._bitmapHeight || k, s = f._offsetX, f = f._offsetY, z = c.RenderFilter.getInstance(); s < d; s += g)
  2153. for (var A = f; A < e; A += k) {
  2154. var v = Math.min(q, d - s),
  2155. B = Math.min(r, e - A);
  2156. z.drawImage(b, a, n, p, q, r, s, A, v, B)
  2157. }
  2158. };
  2159. a.drawScale9GridImage = function(b, a, d, e, f) {
  2160. var g = a._texture_to_render;
  2161. if (g && d) {
  2162. var k = c.RenderFilter.getInstance(),
  2163. n = g._textureWidth,
  2164. p = g._textureHeight,
  2165. q = g._bitmapX,
  2166. r = g._bitmapY,
  2167. s = g._bitmapWidth || n,
  2168. z = g._bitmapHeight || p,
  2169. A = g._offsetX,
  2170. g = g._offsetY;
  2171. d = c.Rectangle.identity.initialize(d.x - Math.round(A), d.y - Math.round(A), d.width, d.height);
  2172. A = Math.round(A);
  2173. g = Math.round(g);
  2174. e -= n - s;
  2175. f -= p - z;
  2176. d.y == d.bottom && (d.bottom < z ? d.bottom++ : d.y--);
  2177. d.x == d.right && (d.right < s ? d.right++ : d.x--);
  2178. var n = q + d.x,
  2179. p = q + d.right,
  2180. v = s - d.right,
  2181. B = r + d.y,
  2182. C = r + d.bottom,
  2183. t = z - d.bottom,
  2184. u = A + d.x,
  2185. D = g + d.y,
  2186. z = f - (z - d.bottom),
  2187. s = e - (s - d.right);
  2188. k.drawImage(b, a, q, r, d.x, d.y, A, g, d.x, d.y);
  2189. k.drawImage(b, a, n, r, d.width, d.y, u, g, s - d.x, d.y);
  2190. k.drawImage(b, a, p, r, v, d.y, A + s, g, e - s, d.y);
  2191. k.drawImage(b, a, q, B, d.x, d.height,
  2192. A, D, d.x, z - d.y);
  2193. k.drawImage(b, a, n, B, d.width, d.height, u, D, s - d.x, z - d.y);
  2194. k.drawImage(b, a, p, B, v, d.height, A + s, D, e - s, z - d.y);
  2195. k.drawImage(b, a, q, C, d.x, t, A, g + z, d.x, f - z);
  2196. k.drawImage(b, a, n, C, d.width, t, u, g + z, s - d.x, f - z);
  2197. k.drawImage(b, a, p, C, v, t, A + s, g + z, e - s, f - z)
  2198. }
  2199. };
  2200. a.prototype._measureBounds = function() {
  2201. var b = this.texture;
  2202. return b ? c.Rectangle.identity.initialize(b._offsetX, b._offsetY, b._textureWidth, b._textureHeight) : d.prototype._measureBounds.call(this)
  2203. };
  2204. a.debug = !1;
  2205. return a
  2206. }(c.DisplayObject);
  2207. c.Bitmap = e
  2208. })(egret || (egret = {}));
  2209. __extends = this.__extends || function(c, e) {
  2210. function d() {
  2211. this.constructor = c
  2212. }
  2213. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  2214. d.prototype = e.prototype;
  2215. c.prototype = new d
  2216. };
  2217. (function(c) {
  2218. var e = function(d) {
  2219. function a() {
  2220. d.call(this);
  2221. this.text = "";
  2222. this._bitmapPool = []
  2223. }
  2224. __extends(a, d);
  2225. a.prototype._updateTransform = function() {
  2226. this.visible && (this._renderText(), d.prototype._updateTransform.call(this))
  2227. };
  2228. a.prototype._renderText = function(b) {
  2229. "undefined" === typeof b && (b = !1);
  2230. var a = c.Rectangle.identity.initialize(0, 0, 0, 0);
  2231. b || this.removeChildren();
  2232. for (var d = 0, e = this.text.length; d < e; d++) {
  2233. var f = this.text.charAt(d),
  2234. f = this.spriteSheet.getTexture(f),
  2235. g = f._offsetX,
  2236. k = f._offsetY,
  2237. n = f._textureWidth;
  2238. if (!b) {
  2239. var p = this._bitmapPool[d];
  2240. p || (p = new c.Bitmap, this._bitmapPool.push(p));
  2241. p.texture = f;
  2242. this.addChild(p);
  2243. p.x = a.width
  2244. }
  2245. a.width += n + g;
  2246. k + f._textureHeight > a.height && (a.height = k + f._textureHeight)
  2247. }
  2248. return a
  2249. };
  2250. a.prototype._measureBounds = function() {
  2251. return this._renderText(!0)
  2252. };
  2253. return a
  2254. }(c.DisplayObjectContainer);
  2255. c.BitmapText = e
  2256. })(egret || (egret = {}));
  2257. (function(c) {
  2258. var e = function() {
  2259. function c() {
  2260. this.commandQueue = []
  2261. }
  2262. c.prototype.beginFill = function(a, b) {};
  2263. c.prototype._setStyle = function(a) {};
  2264. c.prototype.drawRect = function(a, b, c, d) {};
  2265. c.prototype.drawCircle = function(a, b, c) {};
  2266. c.prototype.lineStyle = function(a, b, c, d, e, f, g, k) {};
  2267. c.prototype.lineTo = function(a, b) {};
  2268. c.prototype.curveTo = function(a, b, c, d) {};
  2269. c.prototype.moveTo = function(a, b) {};
  2270. c.prototype.clear = function() {};
  2271. c.prototype.endFill = function() {};
  2272. c.prototype._draw = function(a) {};
  2273. return c
  2274. }();
  2275. c.Graphics = e;
  2276. (function() {
  2277. return function(c, a, b) {
  2278. this.method = c;
  2279. this.thisObject = a;
  2280. this.args = b
  2281. }
  2282. })()
  2283. })(egret || (egret = {}));
  2284. __extends = this.__extends || function(c, e) {
  2285. function d() {
  2286. this.constructor = c
  2287. }
  2288. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  2289. d.prototype = e.prototype;
  2290. c.prototype = new d
  2291. };
  2292. (function(c) {
  2293. var e = function(d) {
  2294. function a() {
  2295. d.call(this)
  2296. }
  2297. __extends(a, d);
  2298. Object.defineProperty(a.prototype, "graphics", {
  2299. get: function() {
  2300. this._graphics || (this._graphics = new c.Graphics);
  2301. return this._graphics
  2302. },
  2303. enumerable: !0,
  2304. configurable: !0
  2305. });
  2306. a.prototype._render = function(b) {
  2307. this._graphics && this._graphics._draw(b)
  2308. };
  2309. return a
  2310. }(c.DisplayObject);
  2311. c.Shape = e
  2312. })(egret || (egret = {}));
  2313. __extends = this.__extends || function(c, e) {
  2314. function d() {
  2315. this.constructor = c
  2316. }
  2317. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  2318. d.prototype = e.prototype;
  2319. c.prototype = new d
  2320. };
  2321. (function(c) {
  2322. var e = function(d) {
  2323. function a() {
  2324. d.call(this)
  2325. }
  2326. __extends(a, d);
  2327. Object.defineProperty(a.prototype, "graphics", {
  2328. get: function() {
  2329. this._graphics || (this._graphics = new c.Graphics);
  2330. return this._graphics
  2331. },
  2332. enumerable: !0,
  2333. configurable: !0
  2334. });
  2335. a.prototype._render = function(b) {
  2336. this._graphics && this._graphics._draw(b);
  2337. d.prototype._render.call(this, b)
  2338. };
  2339. return a
  2340. }(c.DisplayObjectContainer);
  2341. c.Sprite = e
  2342. })(egret || (egret = {}));
  2343. __extends = this.__extends || function(c, e) {
  2344. function d() {
  2345. this.constructor = c
  2346. }
  2347. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  2348. d.prototype = e.prototype;
  2349. c.prototype = new d
  2350. };
  2351. (function(c) {
  2352. var e = function(d) {
  2353. function a() {
  2354. d.call(this);
  2355. this._textDirty = !0;
  2356. this._fontFamily = "Arial";
  2357. this._size = 30;
  2358. this._textColorString = "#FFFFFF";
  2359. this._textColor = 16777215;
  2360. this._strokeColorString = "#000000";
  2361. this._stroke = this._strokeColor = 0;
  2362. this._textAlign = "left";
  2363. this._verticalAlign = "top";
  2364. this._numLines = this._lineSpacing = 0;
  2365. this.measuredWidths = []
  2366. }
  2367. __extends(a, d);
  2368. Object.defineProperty(a.prototype, "text", {
  2369. get: function() {
  2370. return this._text
  2371. },
  2372. set: function(b) {
  2373. this._text != b && (this._textDirty = !0, this._text = b)
  2374. },
  2375. enumerable: !0,
  2376. configurable: !0
  2377. });
  2378. Object.defineProperty(a.prototype, "fontFamily", {
  2379. get: function() {
  2380. return this._fontFamily
  2381. },
  2382. set: function(b) {
  2383. this._fontFamily != b && (this._textDirty = !0, this._fontFamily = b)
  2384. },
  2385. enumerable: !0,
  2386. configurable: !0
  2387. });
  2388. Object.defineProperty(a.prototype, "size", {
  2389. get: function() {
  2390. return this._size
  2391. },
  2392. set: function(b) {
  2393. this._size != b && (this._textDirty = !0, this._size = b)
  2394. },
  2395. enumerable: !0,
  2396. configurable: !0
  2397. });
  2398. Object.defineProperty(a.prototype, "italic", {
  2399. get: function() {
  2400. return this._italic
  2401. },
  2402. set: function(b) {
  2403. this._italic !=
  2404. b && (this._textDirty = !0, this._italic = b)
  2405. },
  2406. enumerable: !0,
  2407. configurable: !0
  2408. });
  2409. Object.defineProperty(a.prototype, "bold", {
  2410. get: function() {
  2411. return this._bold
  2412. },
  2413. set: function(b) {
  2414. this._bold != b && (this._textDirty = !0, this._bold = b)
  2415. },
  2416. enumerable: !0,
  2417. configurable: !0
  2418. });
  2419. Object.defineProperty(a.prototype, "textColor", {
  2420. get: function() {
  2421. return this._textColor
  2422. },
  2423. set: function(b) {
  2424. this._textColor != b && (this._textDirty = !0, this._textColor = b, this._textColorString = c.toColorString(b))
  2425. },
  2426. enumerable: !0,
  2427. configurable: !0
  2428. });
  2429. Object.defineProperty(a.prototype,
  2430. "strokeColor", {
  2431. get: function() {
  2432. return this._strokeColor
  2433. },
  2434. set: function(b) {
  2435. this._strokeColor != b && (this._textDirty = !0, this._strokeColor = b, this._strokeColorString = c.toColorString(b))
  2436. },
  2437. enumerable: !0,
  2438. configurable: !0
  2439. });
  2440. Object.defineProperty(a.prototype, "stroke", {
  2441. get: function() {
  2442. return this._stroke
  2443. },
  2444. set: function(b) {
  2445. this._stroke != b && (this._textDirty = !0, this._stroke = b)
  2446. },
  2447. enumerable: !0,
  2448. configurable: !0
  2449. });
  2450. Object.defineProperty(a.prototype, "textAlign", {
  2451. get: function() {
  2452. return this._textAlign
  2453. },
  2454. set: function(b) {
  2455. this._textAlign !=
  2456. b && (this._textDirty = !0, this._textAlign = b)
  2457. },
  2458. enumerable: !0,
  2459. configurable: !0
  2460. });
  2461. Object.defineProperty(a.prototype, "verticalAlign", {
  2462. get: function() {
  2463. return this._verticalAlign
  2464. },
  2465. set: function(b) {
  2466. this._verticalAlign != b && (this._textDirty = !0, this._verticalAlign = b)
  2467. },
  2468. enumerable: !0,
  2469. configurable: !0
  2470. });
  2471. Object.defineProperty(a.prototype, "lineSpacing", {
  2472. get: function() {
  2473. return this._lineSpacing
  2474. },
  2475. set: function(b) {
  2476. this._lineSpacing != b && (this._textDirty = !0, this._lineSpacing = b)
  2477. },
  2478. enumerable: !0,
  2479. configurable: !0
  2480. });
  2481. Object.defineProperty(a.prototype,
  2482. "numLines", {
  2483. get: function() {
  2484. return this._numLines
  2485. },
  2486. enumerable: !0,
  2487. configurable: !0
  2488. });
  2489. a.prototype._render = function(b) {
  2490. this.drawText(b, !1);
  2491. this._textDirty = !1
  2492. };
  2493. a.prototype._measureBounds = function() {
  2494. return this.drawText(c.MainContext.instance.rendererContext, !0)
  2495. };
  2496. a.prototype.drawText = function(b, a) {
  2497. var d = this.getTextLines(b);
  2498. if (!d) return c.Rectangle.identity.initialize(0, 0, 0, 0);
  2499. var e = d.length,
  2500. f = 0.5 * this._size,
  2501. g = this._size + this._lineSpacing,
  2502. k = e * g - this._lineSpacing;
  2503. this._textHeight = k;
  2504. var n = this._explicitHeight;
  2505. if (this._hasHeightSet && k < n) {
  2506. var p = 0;
  2507. this._verticalAlign == c.VerticalAlign.MIDDLE ? p = 0.5 : this._verticalAlign == c.VerticalAlign.BOTTOM && (p = 1);
  2508. f += p * (n - k)
  2509. } else n = Number.POSITIVE_INFINITY;
  2510. var p = f = Math.round(f),
  2511. q = 0;
  2512. this._textAlign == c.HorizontalAlign.CENTER ? q = 0.5 : this._textAlign == c.HorizontalAlign.RIGHT && (q = 1);
  2513. var r = this.measuredWidths,
  2514. s;
  2515. s = this._hasWidthSet ? this._explicitWidth : this._textWidth;
  2516. for (var z = Number.POSITIVE_INFINITY, A = 0; A < e; A++) {
  2517. var v = d[A],
  2518. B = Math.round((s - r[A]) * q);
  2519. B < z && (z = B);
  2520. !a && f < n && b.drawText(this,
  2521. v, B, f, s);
  2522. f += g
  2523. }
  2524. return c.Rectangle.identity.initialize(z, p, s, k)
  2525. };
  2526. a.prototype.getTextLines = function(b) {
  2527. var a = this.text ? this.text.toString() : "";
  2528. if (!a) return null;
  2529. var c = this.measuredWidths;
  2530. c.length = 0;
  2531. b.setupFont(this);
  2532. var a = a.split(/(?:\r\n|\r|\n)/),
  2533. d = a.length,
  2534. e = 0;
  2535. if (this._hasWidthSet)
  2536. for (var g = this._explicitWidth, k = 0; k < d; k++) {
  2537. var n = a[k],
  2538. p = b.measureText(n);
  2539. if (p > g) {
  2540. for (var q = "", r = 0, s = n.length, z = 0; z < s; z++) {
  2541. var A = n.charAt(z),
  2542. p = b.measureText(A);
  2543. r + p > g && (0 == r ? (a.splice(k, 0, A), c[k] = p, e < p && (e = p), p = 0, A = "") : (a.splice(k,
  2544. 0, q), c[k] = r, e < r && (e = r), q = "", r = 0), k++, d++);
  2545. r += p;
  2546. q += A
  2547. }
  2548. a[k] = q;
  2549. c[k] = r
  2550. } else c[k] = p, e < p && (e = p)
  2551. } else
  2552. for (k = 0; k < d; k++) n = a[k], p = b.measureText(n), c[k] = p, e < p && (e = p);
  2553. this._textWidth = e;
  2554. return a
  2555. };
  2556. return a
  2557. }(c.DisplayObject);
  2558. c.TextField = e
  2559. })(egret || (egret = {}));
  2560. (function(c) {
  2561. var e = function() {
  2562. function c() {}
  2563. c.DYNAMIC = "dynamic";
  2564. c.INPUT = "input";
  2565. return c
  2566. }();
  2567. c.TextFieldType = e
  2568. })(egret || (egret = {}));
  2569. __extends = this.__extends || function(c, e) {
  2570. function d() {
  2571. this.constructor = c
  2572. }
  2573. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  2574. d.prototype = e.prototype;
  2575. c.prototype = new d
  2576. };
  2577. (function(c) {
  2578. var e = function(d) {
  2579. function a(b) {
  2580. d.call(this);
  2581. var a = b.bitmapData;
  2582. this.bitmapData = a;
  2583. this._textureMap = {};
  2584. this._sourceWidth = a.width;
  2585. this._sourceHeight = a.height;
  2586. this._bitmapX = b._bitmapX;
  2587. this._bitmapY = b._bitmapY
  2588. }
  2589. __extends(a, d);
  2590. a.prototype.getTexture = function(b) {
  2591. return this._textureMap[b]
  2592. };
  2593. a.prototype.createTexture = function(b, a, d, e, f, g, k, n, p) {
  2594. "undefined" === typeof g && (g = 0);
  2595. "undefined" === typeof k && (k = 0);
  2596. "undefined" === typeof n && (n = g + e);
  2597. "undefined" === typeof p && (p = k + f);
  2598. var q = new c.Texture;
  2599. q._bitmapData =
  2600. this.bitmapData;
  2601. q._bitmapX = this._bitmapX + a;
  2602. q._bitmapY = this._bitmapY + d;
  2603. q._bitmapWidth = e;
  2604. q._bitmapHeight = f;
  2605. q._offsetX = g;
  2606. q._offsetY = k;
  2607. q._textureWidth = n;
  2608. q._textureHeight = p;
  2609. q._sourceWidth = this._sourceWidth;
  2610. q._sourceHeight = this._sourceHeight;
  2611. return this._textureMap[b] = q
  2612. };
  2613. return a
  2614. }(c.HashObject);
  2615. c.SpriteSheet = e
  2616. })(egret || (egret = {}));
  2617. __extends = this.__extends || function(c, e) {
  2618. function d() {
  2619. this.constructor = c
  2620. }
  2621. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  2622. d.prototype = e.prototype;
  2623. c.prototype = new d
  2624. };
  2625. (function(c) {
  2626. var e = function(d) {
  2627. function a() {
  2628. d.apply(this, arguments);
  2629. this._placeholderText = "";
  2630. this._edFontSize = 14;
  2631. this._textColor = 16711680;
  2632. this._placeholderFontSize = 14;
  2633. this._placeholderColor = 16776960;
  2634. this._preY = this._preX = 0
  2635. }
  2636. __extends(a, d);
  2637. a.prototype._onAddToStage = function() {
  2638. d.prototype._onAddToStage.call(this);
  2639. var b = this.localToGlobal(),
  2640. a = new c.StageText;
  2641. a._open(b.x, b.y, this._explicitWidth, this._explicitHeight);
  2642. this.addEventListener(c.TouchEvent.TOUCH_BEGIN, this.onMouseDownHandler, this);
  2643. this.stageText =
  2644. a
  2645. };
  2646. a.prototype.setText = function(b) {
  2647. this.stageText._setText(b)
  2648. };
  2649. a.prototype.getText = function() {
  2650. return this.stageText._getText()
  2651. };
  2652. a.prototype.setTextType = function(b) {
  2653. this.stageText._setTextType(b)
  2654. };
  2655. a.prototype.getTextType = function() {
  2656. return this.stageText._getTextType()
  2657. };
  2658. a.prototype.onMouseDownHandler = function(b) {};
  2659. a.prototype._onRemoveFromStage = function() {
  2660. this.stageText._remove()
  2661. };
  2662. a.prototype._measureBounds = function() {
  2663. return c.Rectangle.identity
  2664. };
  2665. a.prototype.hitTest = function(b, a, c) {
  2666. return null
  2667. };
  2668. return a
  2669. }(c.DisplayObject);
  2670. c.TextInput = e;
  2671. e = function() {
  2672. function c() {}
  2673. c.prototype.editBoxEditingDidBegin = function(a) {};
  2674. c.prototype.editBoxEditingDidEnd = function(a) {};
  2675. c.prototype.editBoxTextChanged = function(a, b) {};
  2676. c.prototype.editBoxReturn = function(a) {};
  2677. return c
  2678. }();
  2679. c.TextInputDegelete = e
  2680. })(egret || (egret = {}));
  2681. __extends = this.__extends || function(c, e) {
  2682. function d() {
  2683. this.constructor = c
  2684. }
  2685. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  2686. d.prototype = e.prototype;
  2687. c.prototype = new d
  2688. };
  2689. (function(c) {
  2690. var e = function(c) {
  2691. function a(b, a) {
  2692. c.call(this, b);
  2693. this.charList = this.parseConfig(a)
  2694. }
  2695. __extends(a, c);
  2696. a.prototype.getTexture = function(b) {
  2697. var a = this._textureMap[b];
  2698. if (!a) {
  2699. a = this.charList[b];
  2700. if (!a) return null;
  2701. a = this.createTexture(b, a.x, a.y, a.width, a.height, a.offsetX, a.offsetY);
  2702. this._textureMap[b] = a
  2703. }
  2704. return a
  2705. };
  2706. a.prototype.parseConfig = function(b) {
  2707. b = b.split("\r\n").join("\n");
  2708. b = b.split("\n");
  2709. for (var a = this.getConfigByKey(b[3], "count"), c = {}, d = 4; d < 4 + a; d++) {
  2710. var e = b[d],
  2711. g = String.fromCharCode(this.getConfigByKey(e,
  2712. "id")),
  2713. k = {};
  2714. c[g] = k;
  2715. k.x = this.getConfigByKey(e, "x");
  2716. k.y = this.getConfigByKey(e, "y");
  2717. k.width = this.getConfigByKey(e, "width");
  2718. k.height = this.getConfigByKey(e, "height");
  2719. k.offsetX = this.getConfigByKey(e, "xoffset");
  2720. k.offsetY = this.getConfigByKey(e, "yoffset")
  2721. }
  2722. return c
  2723. };
  2724. a.prototype.getConfigByKey = function(b, a) {
  2725. for (var c = b.split(" "), d = 0, e = c.length; d < e; d++) {
  2726. var g = c[d];
  2727. if (a == g.substring(0, a.length)) return c = g.substring(a.length + 1), parseInt(c)
  2728. }
  2729. return 0
  2730. };
  2731. return a
  2732. }(c.SpriteSheet);
  2733. c.BitmapTextSpriteSheet = e
  2734. })(egret ||
  2735. (egret = {}));
  2736. __extends = this.__extends || function(c, e) {
  2737. function d() {
  2738. this.constructor = c
  2739. }
  2740. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  2741. d.prototype = e.prototype;
  2742. c.prototype = new d
  2743. };
  2744. (function(c) {
  2745. var e = function(a) {
  2746. function b(b, l) {
  2747. a.call(this);
  2748. this.frameRate = 60;
  2749. null != l && l instanceof c.Texture ? (c.Logger.warning("MovieClip#constructor\u63a5\u53e3\u53c2\u6570\u5df2\u7ecf\u53d8\u66f4\uff0c\u8bf7\u5c3d\u5feb\u8c03\u6574\u7528\u6cd5\u4e3a new MovieClip(new DefaultMovieClipDelegate(data,texture))"), this.delegate = new d(b, l)) : this.delegate = b;
  2750. this.delegate.setMovieClip(this)
  2751. }
  2752. __extends(b, a);
  2753. b.prototype.gotoAndPlay = function(b) {
  2754. this.delegate.gotoAndPlay(b)
  2755. };
  2756. b.prototype.gotoAndStop = function(b) {
  2757. this.delegate.gotoAndStop(b)
  2758. };
  2759. b.prototype.stop = function() {
  2760. this.delegate.stop()
  2761. };
  2762. b.prototype.dispose = function() {
  2763. this.delegate.dispose()
  2764. };
  2765. b.prototype.release = function() {
  2766. c.Logger.warning("MovieClip#release\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03");
  2767. this.dispose()
  2768. };
  2769. b.prototype.getCurrentFrameIndex = function() {
  2770. c.Logger.warning("MovieClip#getCurrentFrameIndex\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03");
  2771. return this.delegate._currentFrameIndex
  2772. };
  2773. b.prototype.getTotalFrame = function() {
  2774. c.Logger.warning("MovieClip#getTotalFrame\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03");
  2775. return this.delegate._totalFrame
  2776. };
  2777. b.prototype.setInterval = function(b) {
  2778. c.Logger.warning("MovieClip#setInterval\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03,\u8bf7\u4f7f\u7528MovieClip#frameRate\u4ee3\u66ff");
  2779. this.frameRate = 60 / b
  2780. };
  2781. b.prototype.getIsPlaying = function() {
  2782. c.Logger.warning("MovieClip#getIsPlaying\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03");
  2783. return this.delegate.isPlaying
  2784. };
  2785. return b
  2786. }(c.DisplayObjectContainer);
  2787. c.MovieClip = e;
  2788. var d = function() {
  2789. function a(b, a) {
  2790. this.data = b;
  2791. this._currentFrameIndex = this._passTime = this._totalFrame =
  2792. 0;
  2793. this._isPlaying = !1;
  2794. this._frameData = b;
  2795. this._spriteSheet = new c.SpriteSheet(a)
  2796. }
  2797. a.prototype.setMovieClip = function(b) {
  2798. this.movieClip = b;
  2799. this.bitmap = new c.Bitmap;
  2800. this.movieClip.addChild(this.bitmap)
  2801. };
  2802. a.prototype.gotoAndPlay = function(b) {
  2803. this.checkHasFrame(b);
  2804. this._isPlaying = !0;
  2805. this._currentFrameIndex = 0;
  2806. this._currentFrameName = b;
  2807. this.playNextFrame();
  2808. this._passTime = 0;
  2809. c.Ticker.getInstance().register(this.update, this);
  2810. this._totalFrame = this._frameData.frames[b].totalFrame
  2811. };
  2812. a.prototype.gotoAndStop = function(b) {
  2813. this.checkHasFrame(b);
  2814. this.stop();
  2815. this._currentFrameIndex = this._passTime = 0;
  2816. this._currentFrameName = b;
  2817. this._totalFrame = this._frameData.frames[b].totalFrame;
  2818. this.playNextFrame()
  2819. };
  2820. a.prototype.stop = function() {
  2821. this._isPlaying = !1;
  2822. c.Ticker.getInstance().unregister(this.update, this)
  2823. };
  2824. a.prototype.dispose = function() {};
  2825. a.prototype.checkHasFrame = function(b) {
  2826. void 0 == this._frameData.frames[b] && c.Logger.fatal("MovieClip\u6ca1\u6709\u5bf9\u5e94\u7684frame\uff1a", b)
  2827. };
  2828. a.prototype.update = function(b) {
  2829. for (var a = 1E3 / this.movieClip.frameRate,
  2830. a = Math.floor((this._passTime % a + b) / a); 1 <= a;) 1 == a ? this.playNextFrame() : this.playNextFrame(!1), a--;
  2831. this._passTime += b
  2832. };
  2833. a.prototype.playNextFrame = function(b) {
  2834. "undefined" === typeof b && (b = !0);
  2835. var a = this._frameData.frames[this._currentFrameName].childrenFrame[this._currentFrameIndex];
  2836. if (b) {
  2837. b = this.getTexture(a.res);
  2838. var c = this.bitmap;
  2839. c.x = a.x;
  2840. c.y = a.y;
  2841. c.texture = b
  2842. }
  2843. null != a.action && this.movieClip.dispatchEventWith(a.action);
  2844. this._currentFrameIndex++;
  2845. this._currentFrameIndex == this._totalFrame && (this._currentFrameIndex =
  2846. 0)
  2847. };
  2848. a.prototype.getTexture = function(b) {
  2849. var a = this._frameData.res[b],
  2850. c = this._spriteSheet.getTexture(b);
  2851. c || (c = this._spriteSheet.createTexture(b, a.x, a.y, a.w, a.h));
  2852. return c
  2853. };
  2854. return a
  2855. }();
  2856. c.DefaultMovieClipDelegate = d
  2857. })(egret || (egret = {}));
  2858. __extends = this.__extends || function(c, e) {
  2859. function d() {
  2860. this.constructor = c
  2861. }
  2862. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  2863. d.prototype = e.prototype;
  2864. c.prototype = new d
  2865. };
  2866. (function(c) {
  2867. var e = function(d) {
  2868. function a() {
  2869. d.call(this)
  2870. }
  2871. __extends(a, d);
  2872. a.prototype._getText = function() {
  2873. return this.inputElement.value
  2874. };
  2875. a.prototype._setText = function(b) {
  2876. this.inputElement.value = b
  2877. };
  2878. a.prototype._setTextType = function(b) {
  2879. this.inputElement.type = b
  2880. };
  2881. a.prototype._getTextType = function() {
  2882. return this.inputElement.type
  2883. };
  2884. a.prototype._open = function(b, a, d, e) {
  2885. "undefined" === typeof d && (d = 160);
  2886. "undefined" === typeof e && (e = 21);
  2887. var f = c.StageDelegate.getInstance().getScaleX(),
  2888. g = c.StageDelegate.getInstance().getScaleY(),
  2889. k = document.createElement("input");
  2890. k.type = "text";
  2891. k.style.fontSize = "20px";
  2892. k.style.color = "#FFFFFF";
  2893. k.style.borderStyle = "none";
  2894. k.style.background = "none";
  2895. k.style.width = d * f + "px";
  2896. k.style.height = e * g + "px";
  2897. k.style.outline = "medium";
  2898. var n = c.Browser.getInstance().$new("div");
  2899. n.style.position = "absolute";
  2900. n.position.x = b * f;
  2901. n.style.width = d * f + "px";
  2902. n.style.height = e * g + "px";
  2903. n.position.y = a * g;
  2904. n.transforms();
  2905. n.appendChild(k);
  2906. b = c.Browser.getInstance().$("#StageDelegateDiv");
  2907. b || (d = document.getElementById(c.StageDelegate.canvas_div_name),
  2908. e = d.clientHeight, d = d.clientWidth, b = c.Browser.getInstance().$new("div"), b.id = "StageDelegateDiv", b.style.position = "absolute", b.style.width = d + "px", b.style.maxHeight = e + "px", b.style.margin = "0px", document.getElementById(c.StageDelegate.canvas_div_name).appendChild(b), b.position.y = -e, b.transforms());
  2909. b.appendChild(n);
  2910. this.div = n;
  2911. this.inputElement = k
  2912. };
  2913. a.prototype._remove = function() {
  2914. var b = this.div;
  2915. b && b.parentNode && b.parentNode.removeChild(b)
  2916. };
  2917. return a
  2918. }(c.HashObject);
  2919. c.StageText = e
  2920. })(egret || (egret = {}));
  2921. (function(c) {
  2922. var e = function() {
  2923. function c() {}
  2924. c.GET = "GET";
  2925. c.POST = "POST";
  2926. return c
  2927. }();
  2928. c.URLRequestMethod = e
  2929. })(egret || (egret = {}));
  2930. (function(c) {
  2931. var e = function() {
  2932. function c() {}
  2933. c.BINARY = "binary";
  2934. c.TEXT = "text";
  2935. c.VARIABLES = "variables";
  2936. c.TEXTURE = "texture";
  2937. c.SOUND = "sound";
  2938. return c
  2939. }();
  2940. c.URLLoaderDataFormat = e
  2941. })(egret || (egret = {}));
  2942. __extends = this.__extends || function(c, e) {
  2943. function d() {
  2944. this.constructor = c
  2945. }
  2946. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  2947. d.prototype = e.prototype;
  2948. c.prototype = new d
  2949. };
  2950. (function(c) {
  2951. var e = function(c) {
  2952. function a(b) {
  2953. "undefined" === typeof b && (b = null);
  2954. c.call(this);
  2955. null !== b && this.decode(b)
  2956. }
  2957. __extends(a, c);
  2958. a.prototype.decode = function(b) {
  2959. this.variables || (this.variables = {});
  2960. b = b.split("+").join(" ");
  2961. for (var a, c = /[?&]?([^=]+)=([^&]*)/g; a = c.exec(b);) this.variables[decodeURIComponent(a[1])] = decodeURIComponent(a[2])
  2962. };
  2963. a.prototype.toString = function() {
  2964. if (!this.variables) return "";
  2965. var b = this.variables,
  2966. a = "",
  2967. c = !0,
  2968. d;
  2969. for (d in b) c ? c = !1 : a += "&", a += d + "=" + b[d];
  2970. return a
  2971. };
  2972. return a
  2973. }(c.HashObject);
  2974. c.URLVariables = e
  2975. })(egret || (egret = {}));
  2976. __extends = this.__extends || function(c, e) {
  2977. function d() {
  2978. this.constructor = c
  2979. }
  2980. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  2981. d.prototype = e.prototype;
  2982. c.prototype = new d
  2983. };
  2984. (function(c) {
  2985. var e = function(d) {
  2986. function a(b) {
  2987. "undefined" === typeof b && (b = null);
  2988. d.call(this);
  2989. this.method = c.URLRequestMethod.GET;
  2990. this.url = b
  2991. }
  2992. __extends(a, d);
  2993. return a
  2994. }(c.HashObject);
  2995. c.URLRequest = e
  2996. })(egret || (egret = {}));
  2997. __extends = this.__extends || function(c, e) {
  2998. function d() {
  2999. this.constructor = c
  3000. }
  3001. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  3002. d.prototype = e.prototype;
  3003. c.prototype = new d
  3004. };
  3005. (function(c) {
  3006. var e = function(d) {
  3007. function a(b) {
  3008. "undefined" === typeof b && (b = null);
  3009. d.call(this);
  3010. this.dataFormat = c.URLLoaderDataFormat.TEXT;
  3011. b && this.load(b)
  3012. }
  3013. __extends(a, d);
  3014. a.prototype.load = function(b) {
  3015. this._request = b;
  3016. this.data = null;
  3017. c.MainContext.instance.netContext.proceed(this)
  3018. };
  3019. return a
  3020. }(c.EventDispatcher);
  3021. c.URLLoader = e
  3022. })(egret || (egret = {}));
  3023. __extends = this.__extends || function(c, e) {
  3024. function d() {
  3025. this.constructor = c
  3026. }
  3027. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  3028. d.prototype = e.prototype;
  3029. c.prototype = new d
  3030. };
  3031. (function(c) {
  3032. var e = function(d) {
  3033. function a() {
  3034. d.call(this);
  3035. this._textureHeight = this._textureWidth = this._offsetY = this._offsetX = this._bitmapHeight = this._bitmapWidth = this._bitmapY = this._bitmapX = 0
  3036. }
  3037. __extends(a, d);
  3038. Object.defineProperty(a.prototype, "textureWidth", {
  3039. get: function() {
  3040. return this._textureWidth
  3041. },
  3042. enumerable: !0,
  3043. configurable: !0
  3044. });
  3045. Object.defineProperty(a.prototype, "textureHeight", {
  3046. get: function() {
  3047. return this._textureHeight
  3048. },
  3049. enumerable: !0,
  3050. configurable: !0
  3051. });
  3052. Object.defineProperty(a.prototype, "bitmapData", {
  3053. get: function() {
  3054. return this._bitmapData
  3055. },
  3056. enumerable: !0,
  3057. configurable: !0
  3058. });
  3059. a.prototype._setBitmapData = function(b) {
  3060. var a = c.MainContext.instance.rendererContext.texture_scale_factor;
  3061. this._bitmapData = b;
  3062. this._sourceWidth = b.width;
  3063. this._sourceHeight = b.height;
  3064. this._textureWidth = this._sourceWidth * a;
  3065. this._textureHeight = this._sourceHeight * a;
  3066. this._bitmapWidth = this._textureWidth;
  3067. this._bitmapHeight = this._textureHeight;
  3068. this._offsetX = this._offsetY = this._bitmapX = this._bitmapY = 0
  3069. };
  3070. a.prototype.getPixel32 = function(b, a) {
  3071. return this._bitmapData.getContext("2d").getImageData(b,
  3072. a, 1, 1).data
  3073. };
  3074. return a
  3075. }(c.HashObject);
  3076. c.Texture = e
  3077. })(egret || (egret = {}));
  3078. __extends = this.__extends || function(c, e) {
  3079. function d() {
  3080. this.constructor = c
  3081. }
  3082. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  3083. d.prototype = e.prototype;
  3084. c.prototype = new d
  3085. };
  3086. (function(c) {
  3087. var e = function(d) {
  3088. function a() {
  3089. d.call(this);
  3090. this._bitmapData = document.createElement("canvas");
  3091. this.renderContext = c.RendererContext.createRendererContext(this._bitmapData)
  3092. }
  3093. __extends(a, d);
  3094. a.prototype.drawToTexture = function(b) {
  3095. var a = this._bitmapData,
  3096. d = b.getBounds(c.Rectangle.identity);
  3097. a.width = d.width;
  3098. a.height = d.height;
  3099. b._worldTransform.identity();
  3100. b.worldAlpha = 1;
  3101. if (b instanceof c.DisplayObjectContainer) {
  3102. this._offsetX = d.x;
  3103. this._offsetY = d.y;
  3104. b._worldTransform.append(1, 0, 0, 1, -d.x, -d.y);
  3105. for (var a =
  3106. b._children, d = 0, e = a.length; d < e; d++) a[d]._updateTransform()
  3107. }
  3108. a = c.RenderFilter.getInstance();
  3109. d = a._drawAreaList.concat();
  3110. a._drawAreaList.length = 0;
  3111. this.renderContext.clearScreen();
  3112. b._render(this.renderContext);
  3113. a._drawAreaList = d;
  3114. this._textureWidth = this._bitmapData.width;
  3115. this._textureHeight = this._bitmapData.height;
  3116. this._sourceWidth = this._textureWidth;
  3117. this._sourceHeight = this._textureHeight
  3118. };
  3119. return a
  3120. }(c.Texture);
  3121. c.RenderTexture = e
  3122. })(egret || (egret = {}));
  3123. __extends = this.__extends || function(c, e) {
  3124. function d() {
  3125. this.constructor = c
  3126. }
  3127. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  3128. d.prototype = e.prototype;
  3129. c.prototype = new d
  3130. };
  3131. (function(c) {
  3132. var e = function(d) {
  3133. function a() {
  3134. d.call(this);
  3135. this.renderCost = 0;
  3136. this.texture_scale_factor = 1
  3137. }
  3138. __extends(a, d);
  3139. a.prototype.clearScreen = function() {};
  3140. a.prototype.clearRect = function(b, a, c, d) {};
  3141. a.prototype.drawImage = function(b, a, d, e, f, g, k, n, p) {
  3142. c.Profiler.getInstance().onDrawImage()
  3143. };
  3144. a.prototype.setTransform = function(b) {};
  3145. a.prototype.setAlpha = function(b, a) {};
  3146. a.prototype.setupFont = function(b) {};
  3147. a.prototype.measureText = function(b) {
  3148. return 0
  3149. };
  3150. a.prototype.drawText = function(b, a, d, e, f) {
  3151. c.Profiler.getInstance().onDrawImage()
  3152. };
  3153. a.prototype.strokeRect = function(b, a, c, d, e) {};
  3154. a.prototype.pushMask = function(b) {};
  3155. a.prototype.popMask = function() {};
  3156. a.createRendererContext = function(b) {
  3157. return null
  3158. };
  3159. return a
  3160. }(c.HashObject);
  3161. c.RendererContext = e;
  3162. e = function() {
  3163. function d(a) {
  3164. this.type = a;
  3165. switch (a) {
  3166. case "add":
  3167. case "layer":
  3168. this.value = "lighter";
  3169. break;
  3170. default:
  3171. this.value = "source-over"
  3172. }
  3173. }
  3174. d.getBlendMode = function(a) {
  3175. return a ? c.BlendMode[a.toUpperCase()] : c.BlendMode.NORMAL
  3176. };
  3177. d.NORMAL = new d("normal");
  3178. d.ADD = new d("add");
  3179. d.LAYER = new d("layer");
  3180. return d
  3181. }();
  3182. c.BlendMode = e
  3183. })(egret || (egret = {}));
  3184. (function(c) {
  3185. var e = function() {
  3186. function c() {}
  3187. c.MOUSE = "mouse";
  3188. c.TOUCH = "touch";
  3189. c.mode = "touch";
  3190. return c
  3191. }();
  3192. c.InteractionMode = e
  3193. })(egret || (egret = {}));
  3194. __extends = this.__extends || function(c, e) {
  3195. function d() {
  3196. this.constructor = c
  3197. }
  3198. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  3199. d.prototype = e.prototype;
  3200. c.prototype = new d
  3201. };
  3202. (function(c) {
  3203. var e = function(d) {
  3204. function a() {
  3205. d.call(this);
  3206. this._currentTouchTarget = {};
  3207. this.maxTouches = 2;
  3208. this.touchDownTarget = {};
  3209. this.lastTouchY = this.lastTouchX = -1
  3210. }
  3211. __extends(a, d);
  3212. a.prototype.run = function() {};
  3213. a.prototype.getTouchData = function(b, a, c) {
  3214. var d = this._currentTouchTarget[b];
  3215. null == d && (d = {}, this._currentTouchTarget[b] = d);
  3216. d.stageX = a;
  3217. d.stageY = c;
  3218. d.identifier = b;
  3219. return d
  3220. };
  3221. a.prototype.dispatchEvent = function(b, a) {
  3222. c.TouchEvent.dispatchTouchEvent(a.target, b, a.identifier, a.stageX, a.stageY, !1, !1, !1, !0 ==
  3223. this.touchDownTarget[a.identifier])
  3224. };
  3225. a.prototype.onTouchBegan = function(b, a, d) {
  3226. var e = c.MainContext.instance.stage.hitTest(b, a);
  3227. e && (b = this.getTouchData(d, b, a), this.touchDownTarget[d] = !0, b.target = e, b.beginTarget = e, this.dispatchEvent(c.TouchEvent.TOUCH_BEGIN, b))
  3228. };
  3229. a.prototype.onTouchMove = function(b, a, d) {
  3230. if (b != this.lastTouchX || a != this.lastTouchY) {
  3231. this.lastTouchX = b;
  3232. this.lastTouchY = a;
  3233. var e = c.MainContext.instance.stage.hitTest(b, a);
  3234. e && (b = this.getTouchData(d, b, a), b.target = e, this.dispatchEvent(c.TouchEvent.TOUCH_MOVE,
  3235. b))
  3236. }
  3237. };
  3238. a.prototype.onTouchEnd = function(b, a, d) {
  3239. var e = c.MainContext.instance.stage.hitTest(b, a);
  3240. e && (b = this.getTouchData(d, b, a), delete this.touchDownTarget[d], d = b.beginTarget, b.target = e, this.dispatchEvent(c.TouchEvent.TOUCH_END, b), d == e ? this.dispatchEvent(c.TouchEvent.TOUCH_TAP, b) : b.beginTarget && (b.target = b.beginTarget, this.dispatchEvent(c.TouchEvent.TOUCH_RELEASE_OUTSIDE, b)), delete this._currentTouchTarget[b.identifier])
  3241. };
  3242. return a
  3243. }(c.HashObject);
  3244. c.TouchContext = e
  3245. })(egret || (egret = {}));
  3246. __extends = this.__extends || function(c, e) {
  3247. function d() {
  3248. this.constructor = c
  3249. }
  3250. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  3251. d.prototype = e.prototype;
  3252. c.prototype = new d
  3253. };
  3254. (function(c) {
  3255. var e = function(c) {
  3256. function a() {
  3257. c.call(this)
  3258. }
  3259. __extends(a, c);
  3260. a.prototype.proceed = function(b) {};
  3261. return a
  3262. }(c.HashObject);
  3263. c.NetContext = e
  3264. })(egret || (egret = {}));
  3265. __extends = this.__extends || function(c, e) {
  3266. function d() {
  3267. this.constructor = c
  3268. }
  3269. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  3270. d.prototype = e.prototype;
  3271. c.prototype = new d
  3272. };
  3273. (function(c) {
  3274. var e = function(c) {
  3275. function a() {
  3276. c.call(this);
  3277. this.frameRate = 60
  3278. }
  3279. __extends(a, c);
  3280. a.prototype.executeMainLoop = function(b, a) {};
  3281. return a
  3282. }(c.HashObject);
  3283. c.DeviceContext = e
  3284. })(egret || (egret = {}));
  3285. __extends = this.__extends || function(c, e) {
  3286. function d() {
  3287. this.constructor = c
  3288. }
  3289. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  3290. d.prototype = e.prototype;
  3291. c.prototype = new d
  3292. };
  3293. (function(c) {
  3294. var e = function(d) {
  3295. function a() {
  3296. d.call(this);
  3297. this.translate = this.isHD ? function(b) {
  3298. return "translate3d(" + b.x + "px, " + (b.y - c.MainContext.instance.stage.stageHeight) + "px, 0) "
  3299. } : function(b) {
  3300. console.log("translate(" + b.x + "px, " + b.y + "px) ");
  3301. return "translate(" + b.x + "px, " + b.y + "px) "
  3302. };
  3303. this.rotate = this.isHD ? function(b) {
  3304. return "rotateZ(" + b + "deg) "
  3305. } : function(b) {
  3306. return "rotate(" + b + "deg) "
  3307. };
  3308. this.ua = navigator.userAgent.toLowerCase();
  3309. var b = this.ua.match(/micromessenger|qqbrowser|mqqbrowser|ucbrowser|360browser|baidubrowser|maxthon|ie|opera|firefox/) ||
  3310. this.ua.match(/chrome|safari/);
  3311. b && 0 < b.length && (b = b[0], "micromessenger" == b && (this.type = "wechat"), this.type = b);
  3312. this.type = "unknow";
  3313. switch (this.type) {
  3314. case "firefox":
  3315. this.pfx = "Moz";
  3316. this.isHD = !0;
  3317. break;
  3318. case "chrome":
  3319. case "safari":
  3320. this.pfx = "webkit";
  3321. this.isHD = !0;
  3322. break;
  3323. case "opera":
  3324. this.pfx = "O";
  3325. this.isHD = !1;
  3326. break;
  3327. case "ie":
  3328. this.pfx = "ms";
  3329. this.isHD = !1;
  3330. break;
  3331. default:
  3332. this.pfx = "webkit", this.isHD = !0
  3333. }
  3334. this.trans = this.pfx + "Transform";
  3335. this.isMobile = -1 != this.ua.indexOf("mobile") || -1 != this.ua.indexOf("android")
  3336. }
  3337. __extends(a,
  3338. d);
  3339. a.getInstance = function() {
  3340. null == a.instance && (a.instance = new a);
  3341. return a.instance
  3342. };
  3343. a.prototype.$new = function(b) {
  3344. return this.$(document.createElement(b))
  3345. };
  3346. a.prototype.$ = function(b) {
  3347. var h = document;
  3348. if (b = b instanceof HTMLElement ? b : h.querySelector(b)) b.find = b.find || this.$, b.hasClass = b.hasClass || function(b) {
  3349. return this.className.match(new RegExp("(\\s|^)" + b + "(\\s|$)"))
  3350. }, b.addClass = b.addClass || function(b) {
  3351. this.hasClass(b) || (this.className && (this.className += " "), this.className += b);
  3352. return this
  3353. }, b.removeClass =
  3354. b.removeClass || function(b) {
  3355. this.hasClass(b) && (this.className = this.className.replace(b, ""));
  3356. return this
  3357. }, b.remove = b.remove || function() {}, b.appendTo = b.appendTo || function(b) {
  3358. b.appendChild(this);
  3359. return this
  3360. }, b.prependTo = b.prependTo || function(b) {
  3361. b.childNodes[0] ? b.insertBefore(this, b.childNodes[0]) : b.appendChild(this);
  3362. return this
  3363. }, b.transforms = b.transforms || function() {
  3364. this.style[a.getInstance().trans] = a.getInstance().translate(this.position) + a.getInstance().rotate(this.rotation) + a.getInstance().scale(this.scale) +
  3365. a.getInstance().skew(this.skew);
  3366. return this
  3367. }, b.position = b.position || {
  3368. x: 0,
  3369. y: 0
  3370. }, b.rotation = b.rotation || 0, b.scale = b.scale || {
  3371. x: 1,
  3372. y: 1
  3373. }, b.skew = b.skew || {
  3374. x: 0,
  3375. y: 0
  3376. }, b.translates = function(b, a) {
  3377. this.position.x = b;
  3378. this.position.y = a - c.MainContext.instance.stage.stageHeight;
  3379. this.transforms();
  3380. return this
  3381. }, b.rotate = function(b) {
  3382. this.rotation = b;
  3383. this.transforms();
  3384. return this
  3385. }, b.resize = function(b, a) {
  3386. this.scale.x = b;
  3387. this.scale.y = a;
  3388. this.transforms();
  3389. return this
  3390. }, b.setSkew = function(b, a) {
  3391. this.skew.x = b;
  3392. this.skew.y = a;
  3393. this.transforms();
  3394. return this
  3395. };
  3396. return b
  3397. };
  3398. a.prototype.scale = function(b) {
  3399. return "scale(" + b.x + ", " + b.y + ") "
  3400. };
  3401. a.prototype.skew = function(b) {
  3402. return "skewX(" + -b.x + "deg) skewY(" + b.y + "deg)"
  3403. };
  3404. return a
  3405. }(c.HashObject);
  3406. c.Browser = e
  3407. })(egret || (egret = {}));
  3408. egret.Codec = {
  3409. name: "Jacob__Codec"
  3410. };
  3411. egret.Utils = {};
  3412. egret.Utils.unzip = function() {
  3413. return egret.Codec.GZip.gunzip.apply(egret.Codec.GZip, arguments)
  3414. };
  3415. egret.Utils.unzipBase64 = function() {
  3416. var c = egret.Codec.Base64.decode.apply(egret.Codec.Base64, arguments);
  3417. return egret.Codec.GZip.gunzip.apply(egret.Codec.GZip, [c])
  3418. };
  3419. egret.Utils.unzipBase64AsArray = function(c, e) {
  3420. e = e || 1;
  3421. var d = this.unzipBase64(c),
  3422. a = [],
  3423. b, h, l;
  3424. b = 0;
  3425. for (l = d.length / e; b < l; b++)
  3426. for (a[b] = 0, h = e - 1; 0 <= h; --h) a[b] += d.charCodeAt(b * e + h) << 8 * h;
  3427. return a
  3428. };
  3429. egret.Utils.unzipAsArray = function(c, e) {
  3430. e = e || 1;
  3431. var d = this.unzip(c),
  3432. a = [],
  3433. b, h, l;
  3434. b = 0;
  3435. for (l = d.length / e; b < l; b++)
  3436. for (a[b] = 0, h = e - 1; 0 <= h; --h) a[b] += d.charCodeAt(b * e + h) << 8 * h;
  3437. return a
  3438. };
  3439. egret.Utils.StringToArray = function(c) {
  3440. c = c.split(",");
  3441. var e = [],
  3442. d;
  3443. for (d = 0; d < c.length; d++) e.push(parseInt(c[d]));
  3444. return e
  3445. };
  3446. egret.Codec.Base64 = {
  3447. name: "Jacob__Codec__Base64"
  3448. };
  3449. egret.Codec.Base64._keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
  3450. egret.Codec.Base64.decode = function(c) {
  3451. var e = [],
  3452. d, a, b, h, l, m = 0;
  3453. for (c = c.replace(/[^A-Za-z0-9\+\/\=]/g, ""); m < c.length;) d = this._keyStr.indexOf(c.charAt(m++)), a = this._keyStr.indexOf(c.charAt(m++)), h = this._keyStr.indexOf(c.charAt(m++)), l = this._keyStr.indexOf(c.charAt(m++)), d = d << 2 | a >> 4, a = (a & 15) << 4 | h >> 2, b = (h & 3) << 6 | l, e.push(String.fromCharCode(d)), 64 != h && e.push(String.fromCharCode(a)), 64 != l && e.push(String.fromCharCode(b));
  3454. return e = e.join("")
  3455. };
  3456. egret.Codec.Base64.decodeAsArray = function(c, e) {
  3457. var d = this.decode(c),
  3458. a = [],
  3459. b, h, l;
  3460. b = 0;
  3461. for (l = d.length / e; b < l; b++)
  3462. for (a[b] = 0, h = e - 1; 0 <= h; --h) a[b] += d.charCodeAt(b * e + h) << 8 * h;
  3463. return a
  3464. };
  3465. egret.Utils.uint8ArrayToUint32Array = function(c) {
  3466. if (0 != c.length % 4) return null;
  3467. for (var e = c.length / 4, d = window.Uint32Array ? new Uint32Array(e) : [], a = 0; a < e; a++) {
  3468. var b = 4 * a;
  3469. d[a] = c[b] + 256 * c[b + 1] + 65536 * c[b + 2] + 16777216 * c[b + 3]
  3470. }
  3471. return d
  3472. };
  3473. egret.Codec.GZip = function(c) {
  3474. this.data = c;
  3475. this.debug = !1;
  3476. this.gpflags = void 0;
  3477. this.files = 0;
  3478. this.unzipped = [];
  3479. this.buf32k = Array(32768);
  3480. this.bIdx = 0;
  3481. this.modeZIP = !1;
  3482. this.bytepos = 0;
  3483. this.bb = 1;
  3484. this.bits = 0;
  3485. this.nameBuf = [];
  3486. this.fileout = void 0;
  3487. this.literalTree = Array(egret.Codec.GZip.LITERALS);
  3488. this.distanceTree = Array(32);
  3489. this.treepos = 0;
  3490. this.Places = null;
  3491. this.len = 0;
  3492. this.fpos = Array(17);
  3493. this.fpos[0] = 0;
  3494. this.fmax = this.flens = void 0
  3495. };
  3496. egret.Codec.GZip.gunzip = function(c) {
  3497. return (new egret.Codec.GZip(c)).gunzip()[0][0]
  3498. };
  3499. egret.Codec.GZip.HufNode = function() {
  3500. this.b1 = this.b0 = 0;
  3501. this.jump = null;
  3502. this.jumppos = -1
  3503. };
  3504. egret.Codec.GZip.LITERALS = 288;
  3505. egret.Codec.GZip.NAMEMAX = 256;
  3506. egret.Codec.GZip.bitReverse = [0, 128, 64, 192, 32, 160, 96, 224, 16, 144, 80, 208, 48, 176, 112, 240, 8, 136, 72, 200, 40, 168, 104, 232, 24, 152, 88, 216, 56, 184, 120, 248, 4, 132, 68, 196, 36, 164, 100, 228, 20, 148, 84, 212, 52, 180, 116, 244, 12, 140, 76, 204, 44, 172, 108, 236, 28, 156, 92, 220, 60, 188, 124, 252, 2, 130, 66, 194, 34, 162, 98, 226, 18, 146, 82, 210, 50, 178, 114, 242, 10, 138, 74, 202, 42, 170, 106, 234, 26, 154, 90, 218, 58, 186, 122, 250, 6, 134, 70, 198, 38, 166, 102, 230, 22, 150, 86, 214, 54, 182, 118, 246, 14, 142, 78, 206, 46, 174, 110, 238, 30, 158, 94, 222, 62, 190, 126, 254, 1, 129, 65, 193, 33,
  3507. 161, 97, 225, 17, 145, 81, 209, 49, 177, 113, 241, 9, 137, 73, 201, 41, 169, 105, 233, 25, 153, 89, 217, 57, 185, 121, 249, 5, 133, 69, 197, 37, 165, 101, 229, 21, 149, 85, 213, 53, 181, 117, 245, 13, 141, 77, 205, 45, 173, 109, 237, 29, 157, 93, 221, 61, 189, 125, 253, 3, 131, 67, 195, 35, 163, 99, 227, 19, 147, 83, 211, 51, 179, 115, 243, 11, 139, 75, 203, 43, 171, 107, 235, 27, 155, 91, 219, 59, 187, 123, 251, 7, 135, 71, 199, 39, 167, 103, 231, 23, 151, 87, 215, 55, 183, 119, 247, 15, 143, 79, 207, 47, 175, 111, 239, 31, 159, 95, 223, 63, 191, 127, 255
  3508. ];
  3509. egret.Codec.GZip.cplens = [3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0];
  3510. egret.Codec.GZip.cplext = [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 99, 99];
  3511. egret.Codec.GZip.cpdist = [1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577];
  3512. egret.Codec.GZip.cpdext = [0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13];
  3513. egret.Codec.GZip.border = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];
  3514. egret.Codec.GZip.prototype.gunzip = function() {
  3515. this.outputArr = [];
  3516. this.nextFile();
  3517. return this.unzipped
  3518. };
  3519. egret.Codec.GZip.prototype.readByte = function() {
  3520. this.bits += 8;
  3521. return this.bytepos < this.data.length ? this.data.charCodeAt(this.bytepos++) : -1
  3522. };
  3523. egret.Codec.GZip.prototype.byteAlign = function() {
  3524. this.bb = 1
  3525. };
  3526. egret.Codec.GZip.prototype.readBit = function() {
  3527. var c;
  3528. this.bits++;
  3529. c = this.bb & 1;
  3530. this.bb >>= 1;
  3531. 0 == this.bb && (this.bb = this.readByte(), c = this.bb & 1, this.bb = this.bb >> 1 | 128);
  3532. return c
  3533. };
  3534. egret.Codec.GZip.prototype.readBits = function(c) {
  3535. for (var e = 0, d = c; d--;) e = e << 1 | this.readBit();
  3536. c && (e = egret.Codec.GZip.bitReverse[e] >> 8 - c);
  3537. return e
  3538. };
  3539. egret.Codec.GZip.prototype.flushBuffer = function() {
  3540. this.bIdx = 0
  3541. };
  3542. egret.Codec.GZip.prototype.addBuffer = function(c) {
  3543. this.buf32k[this.bIdx++] = c;
  3544. this.outputArr.push(String.fromCharCode(c));
  3545. 32768 == this.bIdx && (this.bIdx = 0)
  3546. };
  3547. egret.Codec.GZip.prototype.IsPat = function() {
  3548. for (;;) {
  3549. if (this.fpos[this.len] >= this.fmax) return -1;
  3550. if (this.flens[this.fpos[this.len]] == this.len) return this.fpos[this.len]++;
  3551. this.fpos[this.len]++
  3552. }
  3553. };
  3554. egret.Codec.GZip.prototype.Rec = function() {
  3555. var c = this.Places[this.treepos],
  3556. e;
  3557. if (17 == this.len) return -1;
  3558. this.treepos++;
  3559. this.len++;
  3560. e = this.IsPat();
  3561. if (0 <= e) c.b0 = e;
  3562. else if (c.b0 = 32768, this.Rec()) return -1;
  3563. e = this.IsPat();
  3564. if (0 <= e) c.b1 = e, c.jump = null;
  3565. else if (c.b1 = 32768, c.jump = this.Places[this.treepos], c.jumppos = this.treepos, this.Rec()) return -1;
  3566. this.len--;
  3567. return 0
  3568. };
  3569. egret.Codec.GZip.prototype.CreateTree = function(c, e, d, a) {
  3570. this.Places = c;
  3571. this.treepos = 0;
  3572. this.flens = d;
  3573. this.fmax = e;
  3574. for (c = 0; 17 > c; c++) this.fpos[c] = 0;
  3575. this.len = 0;
  3576. return this.Rec() ? -1 : 0
  3577. };
  3578. egret.Codec.GZip.prototype.DecodeValue = function(c) {
  3579. for (var e, d, a = 0, b = c[a];;)
  3580. if (e = this.readBit()) {
  3581. if (!(b.b1 & 32768)) return b.b1;
  3582. b = b.jump;
  3583. e = c.length;
  3584. for (d = 0; d < e; d++)
  3585. if (c[d] === b) {
  3586. a = d;
  3587. break
  3588. }
  3589. } else {
  3590. if (!(b.b0 & 32768)) return b.b0;
  3591. a++;
  3592. b = c[a]
  3593. }
  3594. return -1
  3595. };
  3596. egret.Codec.GZip.prototype.DeflateLoop = function() {
  3597. var c, e, d, a, b;
  3598. do
  3599. if (c = this.readBit(), d = this.readBits(2), 0 == d)
  3600. for (this.byteAlign(), d = this.readByte(), d |= this.readByte() << 8, e = this.readByte(), e |= this.readByte() << 8, (d ^ ~e) & 65535 && document.write("BlockLen checksum mismatch\n"); d--;) e = this.readByte(), this.addBuffer(e);
  3601. else if (1 == d)
  3602. for (;;)
  3603. if (d = egret.Codec.GZip.bitReverse[this.readBits(7)] >> 1, 23 < d ? (d = d << 1 | this.readBit(), 199 < d ? (d -= 128, d = d << 1 | this.readBit()) : (d -= 48, 143 < d && (d += 136))) : d += 256, 256 > d) this.addBuffer(d);
  3604. else if (256 == d) break;
  3605. else {
  3606. var h;
  3607. d -= 257;
  3608. b = this.readBits(egret.Codec.GZip.cplext[d]) + egret.Codec.GZip.cplens[d];
  3609. d = egret.Codec.GZip.bitReverse[this.readBits(5)] >> 3;
  3610. 8 < egret.Codec.GZip.cpdext[d] ? (h = this.readBits(8), h |= this.readBits(egret.Codec.GZip.cpdext[d] - 8) << 8) : h = this.readBits(egret.Codec.GZip.cpdext[d]);
  3611. h += egret.Codec.GZip.cpdist[d];
  3612. for (d = 0; d < b; d++) e = this.buf32k[this.bIdx - h & 32767], this.addBuffer(e)
  3613. } else if (2 == d) {
  3614. var l = Array(320);
  3615. e = 257 + this.readBits(5);
  3616. h = 1 + this.readBits(5);
  3617. a = 4 + this.readBits(4);
  3618. for (d =
  3619. 0; 19 > d; d++) l[d] = 0;
  3620. for (d = 0; d < a; d++) l[egret.Codec.GZip.border[d]] = this.readBits(3);
  3621. b = this.distanceTree.length;
  3622. for (a = 0; a < b; a++) this.distanceTree[a] = new egret.Codec.GZip.HufNode;
  3623. if (this.CreateTree(this.distanceTree, 19, l, 0)) return this.flushBuffer(), 1;
  3624. b = e + h;
  3625. a = 0;
  3626. for (var m = -1; a < b;)
  3627. if (m++, d = this.DecodeValue(this.distanceTree), 16 > d) l[a++] = d;
  3628. else if (16 == d) {
  3629. var f;
  3630. d = 3 + this.readBits(2);
  3631. if (a + d > b) return this.flushBuffer(), 1;
  3632. for (f = a ? l[a - 1] : 0; d--;) l[a++] = f
  3633. } else {
  3634. d = 17 == d ? 3 + this.readBits(3) : 11 + this.readBits(7);
  3635. if (a +
  3636. d > b) return this.flushBuffer(), 1;
  3637. for (; d--;) l[a++] = 0
  3638. }
  3639. b = this.literalTree.length;
  3640. for (a = 0; a < b; a++) this.literalTree[a] = new egret.Codec.GZip.HufNode;
  3641. if (this.CreateTree(this.literalTree, e, l, 0)) return this.flushBuffer(), 1;
  3642. b = this.literalTree.length;
  3643. for (a = 0; a < b; a++) this.distanceTree[a] = new egret.Codec.GZip.HufNode;
  3644. d = [];
  3645. for (a = e; a < l.length; a++) d[a - e] = l[a];
  3646. if (this.CreateTree(this.distanceTree, h, d, 0)) return this.flushBuffer(), 1;
  3647. for (;;)
  3648. if (d = this.DecodeValue(this.literalTree), 256 <= d) {
  3649. d -= 256;
  3650. if (0 == d) break;
  3651. d--;
  3652. b = this.readBits(egret.Codec.GZip.cplext[d]) +
  3653. egret.Codec.GZip.cplens[d];
  3654. d = this.DecodeValue(this.distanceTree);
  3655. 8 < egret.Codec.GZip.cpdext[d] ? (h = this.readBits(8), h |= this.readBits(egret.Codec.GZip.cpdext[d] - 8) << 8) : h = this.readBits(egret.Codec.GZip.cpdext[d]);
  3656. for (h += egret.Codec.GZip.cpdist[d]; b--;) e = this.buf32k[this.bIdx - h & 32767], this.addBuffer(e)
  3657. } else this.addBuffer(d)
  3658. }
  3659. while (!c);
  3660. this.flushBuffer();
  3661. this.byteAlign();
  3662. return 0
  3663. };
  3664. egret.Codec.GZip.prototype.unzipFile = function(c) {
  3665. var e;
  3666. this.gunzip();
  3667. for (e = 0; e < this.unzipped.length; e++)
  3668. if (this.unzipped[e][1] == c) return this.unzipped[e][0]
  3669. };
  3670. egret.Codec.GZip.prototype.nextFile = function() {
  3671. this.outputArr = [];
  3672. this.modeZIP = !1;
  3673. var c = [];
  3674. c[0] = this.readByte();
  3675. c[1] = this.readByte();
  3676. 120 == c[0] && 218 == c[1] && (this.DeflateLoop(), this.unzipped[this.files] = [this.outputArr.join(""), "geonext.gxt"], this.files++);
  3677. 31 == c[0] && 139 == c[1] && (this.skipdir(), this.unzipped[this.files] = [this.outputArr.join(""), "file"], this.files++);
  3678. if (80 == c[0] && 75 == c[1] && (this.modeZIP = !0, c[2] = this.readByte(), c[3] = this.readByte(), 3 == c[2] && 4 == c[3])) {
  3679. c[0] = this.readByte();
  3680. c[1] = this.readByte();
  3681. this.gpflags = this.readByte();
  3682. this.gpflags |= this.readByte() << 8;
  3683. c = this.readByte();
  3684. c |= this.readByte() << 8;
  3685. this.readByte();
  3686. this.readByte();
  3687. this.readByte();
  3688. this.readByte();
  3689. this.readByte();
  3690. this.readByte();
  3691. this.readByte();
  3692. this.readByte();
  3693. this.readByte();
  3694. this.readByte();
  3695. this.readByte();
  3696. this.readByte();
  3697. var e = this.readByte(),
  3698. e = e | this.readByte() << 8,
  3699. d = this.readByte(),
  3700. d = d | this.readByte() << 8,
  3701. a = 0;
  3702. for (this.nameBuf = []; e--;) {
  3703. var b = this.readByte();
  3704. "/" == b | ":" == b ? a = 0 : a < egret.Codec.GZip.NAMEMAX - 1 && (this.nameBuf[a++] = String.fromCharCode(b))
  3705. }
  3706. this.fileout ||
  3707. (this.fileout = this.nameBuf);
  3708. for (var a = 0; a < d;) this.readByte(), a++;
  3709. 8 == c && (this.DeflateLoop(), this.unzipped[this.files] = [this.outputArr.join(""), this.nameBuf.join("")], this.files++);
  3710. this.skipdir()
  3711. }
  3712. };
  3713. egret.Codec.GZip.prototype.skipdir = function() {
  3714. var c = [],
  3715. e;
  3716. this.gpflags & 8 && (c[0] = this.readByte(), c[1] = this.readByte(), c[2] = this.readByte(), c[3] = this.readByte(), this.readByte(), this.readByte(), this.readByte(), this.readByte(), this.readByte(), this.readByte(), this.readByte(), this.readByte());
  3717. this.modeZIP && this.nextFile();
  3718. c[0] = this.readByte();
  3719. if (8 != c[0]) return 0;
  3720. this.gpflags = this.readByte();
  3721. this.readByte();
  3722. this.readByte();
  3723. this.readByte();
  3724. this.readByte();
  3725. this.readByte();
  3726. this.readByte();
  3727. if (this.gpflags & 4)
  3728. for (c[0] =
  3729. this.readByte(), c[2] = this.readByte(), this.len = c[0] + 256 * c[1], c = 0; c < this.len; c++) this.readByte();
  3730. if (this.gpflags & 8)
  3731. for (c = 0, this.nameBuf = []; e = this.readByte();) {
  3732. if ("7" == e || ":" == e) c = 0;
  3733. c < egret.Codec.GZip.NAMEMAX - 1 && (this.nameBuf[c++] = e)
  3734. }
  3735. if (this.gpflags & 16)
  3736. for (; this.readByte(););
  3737. this.gpflags & 2 && (this.readByte(), this.readByte());
  3738. this.DeflateLoop();
  3739. this.readByte();
  3740. this.readByte();
  3741. this.readByte();
  3742. this.readByte();
  3743. this.modeZIP && this.nextFile()
  3744. };
  3745. (function() {
  3746. function c(b) {
  3747. throw b;
  3748. }
  3749. function e(b, a) {
  3750. var c = b.split("."),
  3751. h = C;
  3752. c[0] in h || !h.execScript || h.execScript("var " + c[0]);
  3753. for (var d; c.length && (d = c.shift());) c.length || a === v ? h = h[d] ? h[d] : h[d] = {} : h[d] = a
  3754. }
  3755. function d(b) {
  3756. if ("string" === typeof b) {
  3757. b = b.split("");
  3758. var a, c;
  3759. a = 0;
  3760. for (c = b.length; a < c; a++) b[a] = (b[a].charCodeAt(0) & 255) >>> 0
  3761. }
  3762. a = 1;
  3763. c = 0;
  3764. for (var h = b.length, d, l = 0; 0 < h;) {
  3765. d = 1024 < h ? 1024 : h;
  3766. h -= d;
  3767. do a += b[l++], c += a; while (--d);
  3768. a %= 65521;
  3769. c %= 65521
  3770. }
  3771. return (c << 16 | a) >>> 0
  3772. }
  3773. function a(b, a) {
  3774. this.index = "number" === typeof a ? a : 0;
  3775. this.i = 0;
  3776. this.buffer = b instanceof(t ? Uint8Array : Array) ? b : new(t ? Uint8Array : Array)(32768);
  3777. 2 * this.buffer.length <= this.index && c(Error("invalid index"));
  3778. this.buffer.length <= this.index && this.f()
  3779. }
  3780. function b(b) {
  3781. this.buffer = new(t ? Uint16Array : Array)(2 * b);
  3782. this.length = 0
  3783. }
  3784. function h(b) {
  3785. var a = b.length,
  3786. c = 0,
  3787. h = Number.POSITIVE_INFINITY,
  3788. d, l, e, m, f, g, k, p, q;
  3789. for (p = 0; p < a; ++p) b[p] > c && (c = b[p]), b[p] < h && (h = b[p]);
  3790. d = 1 << c;
  3791. l = new(t ? Uint32Array : Array)(d);
  3792. e = 1;
  3793. m = 0;
  3794. for (f = 2; e <= c;) {
  3795. for (p = 0; p < a; ++p)
  3796. if (b[p] === e) {
  3797. g = 0;
  3798. k = m;
  3799. for (q = 0; q < e; ++q) g =
  3800. g << 1 | k & 1, k >>= 1;
  3801. for (q = g; q < d; q += f) l[q] = e << 16 | p;
  3802. ++m
  3803. }++e;
  3804. m <<= 1;
  3805. f <<= 1
  3806. }
  3807. return [l, c, h]
  3808. }
  3809. function l(b, a) {
  3810. this.h = H;
  3811. this.w = 0;
  3812. this.input = b;
  3813. this.b = 0;
  3814. a && (a.lazy && (this.w = a.lazy), "number" === typeof a.compressionType && (this.h = a.compressionType), a.outputBuffer && (this.a = t && a.outputBuffer instanceof Array ? new Uint8Array(a.outputBuffer) : a.outputBuffer), "number" === typeof a.outputIndex && (this.b = a.outputIndex));
  3815. this.a || (this.a = new(t ? Uint8Array : Array)(32768))
  3816. }
  3817. function m(b, a) {
  3818. this.length = b;
  3819. this.G = a
  3820. }
  3821. function f() {
  3822. var b = G;
  3823. switch (B) {
  3824. case 3 ===
  3825. b:
  3826. return [257, b - 3, 0];
  3827. case 4 === b:
  3828. return [258, b - 4, 0];
  3829. case 5 === b:
  3830. return [259, b - 5, 0];
  3831. case 6 === b:
  3832. return [260, b - 6, 0];
  3833. case 7 === b:
  3834. return [261, b - 7, 0];
  3835. case 8 === b:
  3836. return [262, b - 8, 0];
  3837. case 9 === b:
  3838. return [263, b - 9, 0];
  3839. case 10 === b:
  3840. return [264, b - 10, 0];
  3841. case 12 >= b:
  3842. return [265, b - 11, 1];
  3843. case 14 >= b:
  3844. return [266, b - 13, 1];
  3845. case 16 >= b:
  3846. return [267, b - 15, 1];
  3847. case 18 >= b:
  3848. return [268, b - 17, 1];
  3849. case 22 >= b:
  3850. return [269, b - 19, 2];
  3851. case 26 >= b:
  3852. return [270, b - 23, 2];
  3853. case 30 >= b:
  3854. return [271, b - 27, 2];
  3855. case 34 >= b:
  3856. return [272, b - 31, 2];
  3857. case 42 >= b:
  3858. return [273, b - 35, 3];
  3859. case 50 >=
  3860. b:
  3861. return [274, b - 43, 3];
  3862. case 58 >= b:
  3863. return [275, b - 51, 3];
  3864. case 66 >= b:
  3865. return [276, b - 59, 3];
  3866. case 82 >= b:
  3867. return [277, b - 67, 4];
  3868. case 98 >= b:
  3869. return [278, b - 83, 4];
  3870. case 114 >= b:
  3871. return [279, b - 99, 4];
  3872. case 130 >= b:
  3873. return [280, b - 115, 4];
  3874. case 162 >= b:
  3875. return [281, b - 131, 5];
  3876. case 194 >= b:
  3877. return [282, b - 163, 5];
  3878. case 226 >= b:
  3879. return [283, b - 195, 5];
  3880. case 257 >= b:
  3881. return [284, b - 227, 5];
  3882. case 258 === b:
  3883. return [285, b - 258, 0];
  3884. default:
  3885. c("invalid length: " + b)
  3886. }
  3887. }
  3888. function g(b, a) {
  3889. function h(b, a) {
  3890. var d = b.G,
  3891. l = [],
  3892. e = 0,
  3893. m;
  3894. m = M[b.length];
  3895. l[e++] = m & 65535;
  3896. l[e++] = m >> 16 & 255;
  3897. l[e++] =
  3898. m >> 24;
  3899. var f;
  3900. switch (B) {
  3901. case 1 === d:
  3902. f = [0, d - 1, 0];
  3903. break;
  3904. case 2 === d:
  3905. f = [1, d - 2, 0];
  3906. break;
  3907. case 3 === d:
  3908. f = [2, d - 3, 0];
  3909. break;
  3910. case 4 === d:
  3911. f = [3, d - 4, 0];
  3912. break;
  3913. case 6 >= d:
  3914. f = [4, d - 5, 1];
  3915. break;
  3916. case 8 >= d:
  3917. f = [5, d - 7, 1];
  3918. break;
  3919. case 12 >= d:
  3920. f = [6, d - 9, 2];
  3921. break;
  3922. case 16 >= d:
  3923. f = [7, d - 13, 2];
  3924. break;
  3925. case 24 >= d:
  3926. f = [8, d - 17, 3];
  3927. break;
  3928. case 32 >= d:
  3929. f = [9, d - 25, 3];
  3930. break;
  3931. case 48 >= d:
  3932. f = [10, d - 33, 4];
  3933. break;
  3934. case 64 >= d:
  3935. f = [11, d - 49, 4];
  3936. break;
  3937. case 96 >= d:
  3938. f = [12, d - 65, 5];
  3939. break;
  3940. case 128 >= d:
  3941. f = [13, d - 97, 5];
  3942. break;
  3943. case 192 >= d:
  3944. f = [14, d - 129, 6];
  3945. break;
  3946. case 256 >= d:
  3947. f = [15, d - 193, 6];
  3948. break;
  3949. case 384 >= d:
  3950. f = [16, d - 257, 7];
  3951. break;
  3952. case 512 >= d:
  3953. f = [17, d - 385, 7];
  3954. break;
  3955. case 768 >= d:
  3956. f = [18, d - 513, 8];
  3957. break;
  3958. case 1024 >= d:
  3959. f = [19, d - 769, 8];
  3960. break;
  3961. case 1536 >= d:
  3962. f = [20, d - 1025, 9];
  3963. break;
  3964. case 2048 >= d:
  3965. f = [21, d - 1537, 9];
  3966. break;
  3967. case 3072 >= d:
  3968. f = [22, d - 2049, 10];
  3969. break;
  3970. case 4096 >= d:
  3971. f = [23, d - 3073, 10];
  3972. break;
  3973. case 6144 >= d:
  3974. f = [24, d - 4097, 11];
  3975. break;
  3976. case 8192 >= d:
  3977. f = [25, d - 6145, 11];
  3978. break;
  3979. case 12288 >= d:
  3980. f = [26, d - 8193, 12];
  3981. break;
  3982. case 16384 >= d:
  3983. f = [27, d - 12289, 12];
  3984. break;
  3985. case 24576 >= d:
  3986. f = [28, d - 16385, 13];
  3987. break;
  3988. case 32768 >= d:
  3989. f = [29, d - 24577, 13];
  3990. break;
  3991. default:
  3992. c("invalid distance")
  3993. }
  3994. m =
  3995. f;
  3996. l[e++] = m[0];
  3997. l[e++] = m[1];
  3998. l[e++] = m[2];
  3999. d = 0;
  4000. for (e = l.length; d < e; ++d) q[r++] = l[d];
  4001. n[l[0]]++;
  4002. w[l[3]]++;
  4003. s = b.length + a - 1;
  4004. p = null
  4005. }
  4006. var d, l, e, f, g, k = {},
  4007. p, q = t ? new Uint16Array(2 * a.length) : [],
  4008. r = 0,
  4009. s = 0,
  4010. n = new(t ? Uint32Array : Array)(286),
  4011. w = new(t ? Uint32Array : Array)(30),
  4012. z = b.w,
  4013. A;
  4014. if (!t) {
  4015. for (e = 0; 285 >= e;) n[e++] = 0;
  4016. for (e = 0; 29 >= e;) w[e++] = 0
  4017. }
  4018. n[256] = 1;
  4019. d = 0;
  4020. for (l = a.length; d < l; ++d) {
  4021. e = g = 0;
  4022. for (f = 3; e < f && d + e !== l; ++e) g = g << 8 | a[d + e];
  4023. k[g] === v && (k[g] = []);
  4024. e = k[g];
  4025. if (!(0 < s--)) {
  4026. for (; 0 < e.length && 32768 < d - e[0];) e.shift();
  4027. if (d + 3 >= l) {
  4028. p && h(p, -1);
  4029. e = 0;
  4030. for (f = l - d; e < f; ++e) A = a[d + e], q[r++] = A, ++n[A];
  4031. break
  4032. }
  4033. if (0 < e.length) {
  4034. g = f = v;
  4035. var D = 0,
  4036. E = v,
  4037. x = v,
  4038. y = E = v,
  4039. u = a.length,
  4040. x = 0,
  4041. y = e.length;
  4042. a: for (; x < y; x++) {
  4043. f = e[y - x - 1];
  4044. E = 3;
  4045. if (3 < D) {
  4046. for (E = D; 3 < E; E--)
  4047. if (a[f + E - 1] !== a[d + E - 1]) continue a;
  4048. E = D
  4049. }
  4050. for (; 258 > E && d + E < u && a[f + E] === a[d + E];)++E;
  4051. E > D && (g = f, D = E);
  4052. if (258 === E) break
  4053. }
  4054. f = new m(D, d - g);
  4055. p ? p.length < f.length ? (A = a[d - 1], q[r++] = A, ++n[A], h(f, 0)) : h(p, -1) : f.length < z ? p = f : h(f, 0)
  4056. } else p ? h(p, -1) : (A = a[d], q[r++] = A, ++n[A])
  4057. }
  4058. e.push(d)
  4059. }
  4060. q[r++] = 256;
  4061. n[256]++;
  4062. b.L = n;
  4063. b.K = w;
  4064. return t ? q.subarray(0, r) : q
  4065. }
  4066. function k(a,
  4067. c) {
  4068. function h(b) {
  4069. var a = q[b][r[b]];
  4070. a === k ? (h(b + 1), h(b + 1)) : --p[a];
  4071. ++r[b]
  4072. }
  4073. var d = a.length,
  4074. l = new b(572),
  4075. e = new(t ? Uint8Array : Array)(d),
  4076. m, f, g;
  4077. if (!t)
  4078. for (f = 0; f < d; f++) e[f] = 0;
  4079. for (f = 0; f < d; ++f) 0 < a[f] && l.push(f, a[f]);
  4080. d = Array(l.length / 2);
  4081. m = new(t ? Uint32Array : Array)(l.length / 2);
  4082. if (1 === d.length) return e[l.pop().index] = 1, e;
  4083. f = 0;
  4084. for (g = l.length / 2; f < g; ++f) d[f] = l.pop(), m[f] = d[f].value;
  4085. var k = m.length;
  4086. f = new(t ? Uint16Array : Array)(c);
  4087. var l = new(t ? Uint8Array : Array)(c),
  4088. p = new(t ? Uint8Array : Array)(k);
  4089. g = Array(c);
  4090. var q = Array(c),
  4091. r =
  4092. Array(c),
  4093. s = (1 << c) - k,
  4094. n = 1 << c - 1,
  4095. w, z, v;
  4096. f[c - 1] = k;
  4097. for (w = 0; w < c; ++w) s < n ? l[w] = 0 : (l[w] = 1, s -= n), s <<= 1, f[c - 2 - w] = (f[c - 1 - w] / 2 | 0) + k;
  4098. f[0] = l[0];
  4099. g[0] = Array(f[0]);
  4100. q[0] = Array(f[0]);
  4101. for (w = 1; w < c; ++w) f[w] > 2 * f[w - 1] + l[w] && (f[w] = 2 * f[w - 1] + l[w]), g[w] = Array(f[w]), q[w] = Array(f[w]);
  4102. for (s = 0; s < k; ++s) p[s] = c;
  4103. for (n = 0; n < f[c - 1]; ++n) g[c - 1][n] = m[n], q[c - 1][n] = n;
  4104. for (s = 0; s < c; ++s) r[s] = 0;
  4105. 1 === l[c - 1] && (--p[0], ++r[c - 1]);
  4106. for (w = c - 2; 0 <= w; --w) {
  4107. z = s = 0;
  4108. v = r[w + 1];
  4109. for (n = 0; n < f[w]; n++) z = g[w + 1][v] + g[w + 1][v + 1], z > m[s] ? (g[w][n] = z, q[w][n] = k, v += 2) : (g[w][n] = m[s],
  4110. q[w][n] = s, ++s);
  4111. r[w] = 0;
  4112. 1 === l[w] && h(w)
  4113. }
  4114. m = p;
  4115. f = 0;
  4116. for (g = d.length; f < g; ++f) e[d[f].index] = m[f];
  4117. return e
  4118. }
  4119. function n(b) {
  4120. var a = new(t ? Uint16Array : Array)(b.length),
  4121. h = [],
  4122. d = [],
  4123. l = 0,
  4124. e, m, f;
  4125. e = 0;
  4126. for (m = b.length; e < m; e++) h[b[e]] = (h[b[e]] | 0) + 1;
  4127. e = 1;
  4128. for (m = 16; e <= m; e++) d[e] = l, l += h[e] | 0, l > 1 << e && c("overcommitted"), l <<= 1;
  4129. 65536 > l && c("undercommitted");
  4130. e = 0;
  4131. for (m = b.length; e < m; e++)
  4132. for (l = d[b[e]], d[b[e]] += 1, h = a[e] = 0, f = b[e]; h < f; h++) a[e] = a[e] << 1 | l & 1, l >>>= 1;
  4133. return a
  4134. }
  4135. function p(b, a) {
  4136. this.input = b;
  4137. this.a = new(t ? Uint8Array : Array)(32768);
  4138. this.h =
  4139. J.j;
  4140. var c = {},
  4141. h;
  4142. !a && (a = {}) || "number" !== typeof a.compressionType || (this.h = a.compressionType);
  4143. for (h in a) c[h] = a[h];
  4144. c.outputBuffer = this.a;
  4145. this.z = new l(this.input, c)
  4146. }
  4147. function q(b, a) {
  4148. this.k = [];
  4149. this.l = 32768;
  4150. this.e = this.g = this.c = this.q = 0;
  4151. this.input = t ? new Uint8Array(b) : b;
  4152. this.s = !1;
  4153. this.m = F;
  4154. this.B = !1;
  4155. if (a || !(a = {})) a.index && (this.c = a.index), a.bufferSize && (this.l = a.bufferSize), a.bufferType && (this.m = a.bufferType), a.resize && (this.B = a.resize);
  4156. switch (this.m) {
  4157. case N:
  4158. this.b = 32768;
  4159. this.a = new(t ? Uint8Array : Array)(32768 +
  4160. this.l + 258);
  4161. break;
  4162. case F:
  4163. this.b = 0;
  4164. this.a = new(t ? Uint8Array : Array)(this.l);
  4165. this.f = this.J;
  4166. this.t = this.H;
  4167. this.o = this.I;
  4168. break;
  4169. default:
  4170. c(Error("invalid inflate mode"))
  4171. }
  4172. }
  4173. function r(b, a) {
  4174. for (var h = b.g, d = b.e, l = b.input, e = b.c, m; d < a;) m = l[e++], m === v && c(Error("input buffer is broken")), h |= m << d, d += 8;
  4175. b.g = h >>> a;
  4176. b.e = d - a;
  4177. b.c = e;
  4178. return h & (1 << a) - 1
  4179. }
  4180. function s(b, a) {
  4181. for (var h = b.g, d = b.e, l = b.input, e = b.c, m = a[0], f = a[1], g; d < f;) g = l[e++], g === v && c(Error("input buffer is broken")), h |= g << d, d += 8;
  4182. l = m[h & (1 << f) - 1];
  4183. m = l >>> 16;
  4184. b.g = h >> m;
  4185. b.e =
  4186. d - m;
  4187. b.c = e;
  4188. return l & 65535
  4189. }
  4190. function z(b) {
  4191. function a(b, c, h) {
  4192. var d, l, e, m;
  4193. for (m = 0; m < b;) switch (d = s(this, c), d) {
  4194. case 16:
  4195. for (e = 3 + r(this, 2); e--;) h[m++] = l;
  4196. break;
  4197. case 17:
  4198. for (e = 3 + r(this, 3); e--;) h[m++] = 0;
  4199. l = 0;
  4200. break;
  4201. case 18:
  4202. for (e = 11 + r(this, 7); e--;) h[m++] = 0;
  4203. l = 0;
  4204. break;
  4205. default:
  4206. l = h[m++] = d
  4207. }
  4208. return h
  4209. }
  4210. var c = r(b, 5) + 257,
  4211. d = r(b, 5) + 1,
  4212. l = r(b, 4) + 4,
  4213. e = new(t ? Uint8Array : Array)(K.length),
  4214. m;
  4215. for (m = 0; m < l; ++m) e[K[m]] = r(b, 3);
  4216. l = h(e);
  4217. e = new(t ? Uint8Array : Array)(c);
  4218. m = new(t ? Uint8Array : Array)(d);
  4219. b.o(h(a.call(b, c, l, e)), h(a.call(b, d, l, m)))
  4220. }
  4221. function A(b,
  4222. a) {
  4223. var h, d;
  4224. this.input = b;
  4225. this.c = 0;
  4226. if (a || !(a = {})) a.index && (this.c = a.index), a.verify && (this.M = a.verify);
  4227. h = b[this.c++];
  4228. d = b[this.c++];
  4229. switch (h & 15) {
  4230. case O:
  4231. this.method = O;
  4232. break;
  4233. default:
  4234. c(Error("unsupported compression method"))
  4235. }
  4236. 0 !== ((h << 8) + d) % 31 && c(Error("invalid fcheck flag:" + ((h << 8) + d) % 31));
  4237. d & 32 && c(Error("fdict flag is not supported"));
  4238. this.A = new q(b, {
  4239. index: this.c,
  4240. bufferSize: a.bufferSize,
  4241. bufferType: a.bufferType,
  4242. resize: a.resize
  4243. })
  4244. }
  4245. var v = void 0,
  4246. B = !0,
  4247. C = this,
  4248. t = "undefined" !== typeof Uint8Array && "undefined" !==
  4249. typeof Uint16Array && "undefined" !== typeof Uint32Array;
  4250. a.prototype.f = function() {
  4251. var b = this.buffer,
  4252. a, c = b.length,
  4253. h = new(t ? Uint8Array : Array)(c << 1);
  4254. if (t) h.set(b);
  4255. else
  4256. for (a = 0; a < c; ++a) h[a] = b[a];
  4257. return this.buffer = h
  4258. };
  4259. a.prototype.d = function(b, a, c) {
  4260. var h = this.buffer,
  4261. d = this.index,
  4262. l = this.i,
  4263. e = h[d];
  4264. c && 1 < a && (b = 8 < a ? (y[b & 255] << 24 | y[b >>> 8 & 255] << 16 | y[b >>> 16 & 255] << 8 | y[b >>> 24 & 255]) >> 32 - a : y[b] >> 8 - a);
  4265. if (8 > a + l) e = e << a | b, l += a;
  4266. else
  4267. for (c = 0; c < a; ++c) e = e << 1 | b >> a - c - 1 & 1, 8 === ++l && (l = 0, h[d++] = y[e], e = 0, d === h.length && (h = this.f()));
  4268. h[d] = e;
  4269. this.buffer = h;
  4270. this.i = l;
  4271. this.index = d
  4272. };
  4273. a.prototype.finish = function() {
  4274. var b = this.buffer,
  4275. a = this.index,
  4276. c;
  4277. 0 < this.i && (b[a] <<= 8 - this.i, b[a] = y[b[a]], a++);
  4278. t ? c = b.subarray(0, a) : (b.length = a, c = b);
  4279. return c
  4280. };
  4281. var u = new(t ? Uint8Array : Array)(256),
  4282. D;
  4283. for (D = 0; 256 > D; ++D) {
  4284. for (var w = D, E = w, x = 7, w = w >>> 1; w; w >>>= 1) E <<= 1, E |= w & 1, --x;
  4285. u[D] = (E << x & 255) >>> 0
  4286. }
  4287. var y = u,
  4288. u = [0, 1996959894, 3993919788, 2567524794, 124634137, 1886057615, 3915621685, 2657392035, 249268274, 2044508324, 3772115230, 2547177864, 162941995, 2125561021, 3887607047, 2428444049,
  4289. 498536548, 1789927666, 4089016648, 2227061214, 450548861, 1843258603, 4107580753, 2211677639, 325883990, 1684777152, 4251122042, 2321926636, 335633487, 1661365465, 4195302755, 2366115317, 997073096, 1281953886, 3579855332, 2724688242, 1006888145, 1258607687, 3524101629, 2768942443, 901097722, 1119000684, 3686517206, 2898065728, 853044451, 1172266101, 3705015759, 2882616665, 651767980, 1373503546, 3369554304, 3218104598, 565507253, 1454621731, 3485111705, 3099436303, 671266974, 1594198024, 3322730930, 2970347812, 795835527, 1483230225, 3244367275,
  4290. 3060149565, 1994146192, 31158534, 2563907772, 4023717930, 1907459465, 112637215, 2680153253, 3904427059, 2013776290, 251722036, 2517215374, 3775830040, 2137656763, 141376813, 2439277719, 3865271297, 1802195444, 476864866, 2238001368, 4066508878, 1812370925, 453092731, 2181625025, 4111451223, 1706088902, 314042704, 2344532202, 4240017532, 1658658271, 366619977, 2362670323, 4224994405, 1303535960, 984961486, 2747007092, 3569037538, 1256170817, 1037604311, 2765210733, 3554079995, 1131014506, 879679996, 2909243462, 3663771856, 1141124467, 855842277,
  4291. 2852801631, 3708648649, 1342533948, 654459306, 3188396048, 3373015174, 1466479909, 544179635, 3110523913, 3462522015, 1591671054, 702138776, 2966460450, 3352799412, 1504918807, 783551873, 3082640443, 3233442989, 3988292384, 2596254646, 62317068, 1957810842, 3939845945, 2647816111, 81470997, 1943803523, 3814918930, 2489596804, 225274430, 2053790376, 3826175755, 2466906013, 167816743, 2097651377, 4027552580, 2265490386, 503444072, 1762050814, 4150417245, 2154129355, 426522225, 1852507879, 4275313526, 2312317920, 282753626, 1742555852, 4189708143,
  4292. 2394877945, 397917763, 1622183637, 3604390888, 2714866558, 953729732, 1340076626, 3518719985, 2797360999, 1068828381, 1219638859, 3624741850, 2936675148, 906185462, 1090812512, 3747672003, 2825379669, 829329135, 1181335161, 3412177804, 3160834842, 628085408, 1382605366, 3423369109, 3138078467, 570562233, 1426400815, 3317316542, 2998733608, 733239954, 1555261956, 3268935591, 3050360625, 752459403, 1541320221, 2607071920, 3965973030, 1969922972, 40735498, 2617837225, 3943577151, 1913087877, 83908371, 2512341634, 3803740692, 2075208622, 213261112,
  4293. 2463272603, 3855990285, 2094854071, 198958881, 2262029012, 4057260610, 1759359992, 534414190, 2176718541, 4139329115, 1873836001, 414664567, 2282248934, 4279200368, 1711684554, 285281116, 2405801727, 4167216745, 1634467795, 376229701, 2685067896, 3608007406, 1308918612, 956543938, 2808555105, 3495958263, 1231636301, 1047427035, 2932959818, 3654703836, 1088359270, 936918E3, 2847714899, 3736837829, 1202900863, 817233897, 3183342108, 3401237130, 1404277552, 615818150, 3134207493, 3453421203, 1423857449, 601450431, 3009837614, 3294710456, 1567103746,
  4294. 711928724, 3020668471, 3272380065, 1510334235, 755167117
  4295. ];
  4296. t && new Uint32Array(u);
  4297. b.prototype.getParent = function(b) {
  4298. return 2 * ((b - 2) / 4 | 0)
  4299. };
  4300. b.prototype.push = function(b, a) {
  4301. var c, h, d = this.buffer,
  4302. l;
  4303. c = this.length;
  4304. d[this.length++] = a;
  4305. for (d[this.length++] = b; 0 < c;)
  4306. if (h = this.getParent(c), d[c] > d[h]) l = d[c], d[c] = d[h], d[h] = l, l = d[c + 1], d[c + 1] = d[h + 1], d[h + 1] = l, c = h;
  4307. else break;
  4308. return this.length
  4309. };
  4310. b.prototype.pop = function() {
  4311. var b, a, c = this.buffer,
  4312. h, d, l;
  4313. a = c[0];
  4314. b = c[1];
  4315. this.length -= 2;
  4316. c[0] = c[this.length];
  4317. c[1] = c[this.length + 1];
  4318. for (l =
  4319. 0;;) {
  4320. d = 2 * l + 2;
  4321. if (d >= this.length) break;
  4322. d + 2 < this.length && c[d + 2] > c[d] && (d += 2);
  4323. if (c[d] > c[l]) h = c[l], c[l] = c[d], c[d] = h, h = c[l + 1], c[l + 1] = c[d + 1], c[d + 1] = h;
  4324. else break;
  4325. l = d
  4326. }
  4327. return {
  4328. index: b,
  4329. value: a,
  4330. length: this.length
  4331. }
  4332. };
  4333. var H = 2,
  4334. u = {
  4335. NONE: 0,
  4336. r: 1,
  4337. j: H,
  4338. N: 3
  4339. },
  4340. L = [];
  4341. for (D = 0; 288 > D; D++) switch (B) {
  4342. case 143 >= D:
  4343. L.push([D + 48, 8]);
  4344. break;
  4345. case 255 >= D:
  4346. L.push([D - 144 + 400, 9]);
  4347. break;
  4348. case 279 >= D:
  4349. L.push([D - 256 + 0, 7]);
  4350. break;
  4351. case 287 >= D:
  4352. L.push([D - 280 + 192, 8]);
  4353. break;
  4354. default:
  4355. c("invalid literal: " + D)
  4356. }
  4357. l.prototype.n = function() {
  4358. var b, h, d, l, e = this.input;
  4359. switch (this.h) {
  4360. case 0:
  4361. d = 0;
  4362. for (l = e.length; d < l;) {
  4363. h = t ? e.subarray(d, d + 65535) : e.slice(d, d + 65535);
  4364. d += h.length;
  4365. var m = d === l,
  4366. f = v,
  4367. p = f = v,
  4368. p = f = v,
  4369. q = this.a,
  4370. r = this.b;
  4371. if (t) {
  4372. for (q = new Uint8Array(this.a.buffer); q.length <= r + h.length + 5;) q = new Uint8Array(q.length << 1);
  4373. q.set(this.a)
  4374. }
  4375. f = m ? 1 : 0;
  4376. q[r++] = f | 0;
  4377. f = h.length;
  4378. p = ~f + 65536 & 65535;
  4379. q[r++] = f & 255;
  4380. q[r++] = f >>> 8 & 255;
  4381. q[r++] = p & 255;
  4382. q[r++] = p >>> 8 & 255;
  4383. if (t) q.set(h, r), r += h.length, q = q.subarray(0, r);
  4384. else {
  4385. f = 0;
  4386. for (p = h.length; f < p; ++f) q[r++] = h[f];
  4387. q.length = r
  4388. }
  4389. this.b = r;
  4390. this.a = q
  4391. }
  4392. break;
  4393. case 1:
  4394. d =
  4395. new a(new Uint8Array(this.a.buffer), this.b);
  4396. d.d(1, 1, B);
  4397. d.d(1, 2, B);
  4398. e = g(this, e);
  4399. h = 0;
  4400. for (m = e.length; h < m; h++)
  4401. if (l = e[h], a.prototype.d.apply(d, L[l]), 256 < l) d.d(e[++h], e[++h], B), d.d(e[++h], 5), d.d(e[++h], e[++h], B);
  4402. else if (256 === l) break;
  4403. this.a = d.finish();
  4404. this.b = this.a.length;
  4405. break;
  4406. case H:
  4407. l = new a(new Uint8Array(this.a), this.b);
  4408. var s, w, z, A = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15],
  4409. D, E, f = Array(19),
  4410. x, q = H;
  4411. l.d(1, 1, B);
  4412. l.d(q, 2, B);
  4413. e = g(this, e);
  4414. p = k(this.L, 15);
  4415. D = n(p);
  4416. q = k(this.K, 7);
  4417. r = n(q);
  4418. for (s = 286; 257 < s && 0 === p[s -
  4419. 1]; s--);
  4420. for (w = 30; 1 < w && 0 === q[w - 1]; w--);
  4421. var y = s,
  4422. u = w;
  4423. b = new(t ? Uint32Array : Array)(y + u);
  4424. var C = new(t ? Uint32Array : Array)(316),
  4425. G, F;
  4426. E = new(t ? Uint8Array : Array)(19);
  4427. for (x = z = 0; x < y; x++) b[z++] = p[x];
  4428. for (x = 0; x < u; x++) b[z++] = q[x];
  4429. if (!t)
  4430. for (x = 0, u = E.length; x < u; ++x) E[x] = 0;
  4431. x = G = 0;
  4432. for (u = b.length; x < u; x += z) {
  4433. for (z = 1; x + z < u && b[x + z] === b[x]; ++z);
  4434. y = z;
  4435. if (0 === b[x])
  4436. if (3 > y)
  4437. for (; 0 < y--;) C[G++] = 0, E[0]++;
  4438. else
  4439. for (; 0 < y;) F = 138 > y ? y : 138, F > y - 3 && F < y && (F = y - 3), 10 >= F ? (C[G++] = 17, C[G++] = F - 3, E[17]++) : (C[G++] = 18, C[G++] = F - 11, E[18]++), y -= F;
  4440. else if (C[G++] =
  4441. b[x], E[b[x]]++, y--, 3 > y)
  4442. for (; 0 < y--;) C[G++] = b[x], E[b[x]]++;
  4443. else
  4444. for (; 0 < y;) F = 6 > y ? y : 6, F > y - 3 && F < y && (F = y - 3), C[G++] = 16, C[G++] = F - 3, E[16]++, y -= F
  4445. }
  4446. b = t ? C.subarray(0, G) : C.slice(0, G);
  4447. E = k(E, 7);
  4448. for (x = 0; 19 > x; x++) f[x] = E[A[x]];
  4449. for (z = 19; 4 < z && 0 === f[z - 1]; z--);
  4450. A = n(E);
  4451. l.d(s - 257, 5, B);
  4452. l.d(w - 1, 5, B);
  4453. l.d(z - 4, 4, B);
  4454. for (x = 0; x < z; x++) l.d(f[x], 3, B);
  4455. x = 0;
  4456. for (f = b.length; x < f; x++)
  4457. if (h = b[x], l.d(A[h], E[h], B), 16 <= h) {
  4458. x++;
  4459. switch (h) {
  4460. case 16:
  4461. m = 2;
  4462. break;
  4463. case 17:
  4464. m = 3;
  4465. break;
  4466. case 18:
  4467. m = 7;
  4468. break;
  4469. default:
  4470. c("invalid code: " + h)
  4471. }
  4472. l.d(b[x], m, B)
  4473. }
  4474. m = [D, p];
  4475. r = [r,
  4476. q
  4477. ];
  4478. h = m[0];
  4479. m = m[1];
  4480. q = r[0];
  4481. D = r[1];
  4482. r = 0;
  4483. for (f = e.length; r < f; ++r)
  4484. if (d = e[r], l.d(h[d], m[d], B), 256 < d) l.d(e[++r], e[++r], B), p = e[++r], l.d(q[p], D[p], B), l.d(e[++r], e[++r], B);
  4485. else if (256 === d) break;
  4486. this.a = l.finish();
  4487. this.b = this.a.length;
  4488. break;
  4489. default:
  4490. c("invalid compression type")
  4491. }
  4492. return this.a
  4493. };
  4494. D = [];
  4495. var G;
  4496. for (G = 3; 258 >= G; G++) w = f(), D[G] = w[2] << 24 | w[1] << 16 | w[0];
  4497. var M = t ? new Uint32Array(D) : D,
  4498. J = u;
  4499. p.prototype.n = function() {
  4500. var b, a, h, l, e = 0;
  4501. l = this.a;
  4502. b = O;
  4503. switch (b) {
  4504. case O:
  4505. a = Math.LOG2E * Math.log(32768) - 8;
  4506. break;
  4507. default:
  4508. c(Error("invalid compression method"))
  4509. }
  4510. a =
  4511. a << 4 | b;
  4512. l[e++] = a;
  4513. switch (b) {
  4514. case O:
  4515. switch (this.h) {
  4516. case J.NONE:
  4517. h = 0;
  4518. break;
  4519. case J.r:
  4520. h = 1;
  4521. break;
  4522. case J.j:
  4523. h = 2;
  4524. break;
  4525. default:
  4526. c(Error("unsupported compression type"))
  4527. }
  4528. break;
  4529. default:
  4530. c(Error("invalid compression method"))
  4531. }
  4532. b = h << 6 | 0;
  4533. l[e++] = b | 31 - (256 * a + b) % 31;
  4534. b = d(this.input);
  4535. this.z.b = e;
  4536. l = this.z.n();
  4537. e = l.length;
  4538. t && (l = new Uint8Array(l.buffer), l.length <= e + 4 && (this.a = new Uint8Array(l.length + 4), this.a.set(l), l = this.a), l = l.subarray(0, e + 4));
  4539. l[e++] = b >> 24 & 255;
  4540. l[e++] = b >> 16 & 255;
  4541. l[e++] = b >> 8 & 255;
  4542. l[e++] = b & 255;
  4543. return l
  4544. };
  4545. e("Zlib.Deflate",
  4546. p);
  4547. e("Zlib.Deflate.compress", function(b, a) {
  4548. return (new p(b, a)).n()
  4549. });
  4550. e("Zlib.Deflate.CompressionType", J);
  4551. e("Zlib.Deflate.CompressionType.NONE", J.NONE);
  4552. e("Zlib.Deflate.CompressionType.FIXED", J.r);
  4553. e("Zlib.Deflate.CompressionType.DYNAMIC", J.j);
  4554. var N = 0,
  4555. F = 1,
  4556. u = {
  4557. D: N,
  4558. C: F
  4559. };
  4560. q.prototype.p = function() {
  4561. for (; !this.s;) {
  4562. var b = r(this, 3);
  4563. b & 1 && (this.s = B);
  4564. b >>>= 1;
  4565. switch (b) {
  4566. case 0:
  4567. var b = this.input,
  4568. a = this.c,
  4569. h = this.a,
  4570. d = this.b,
  4571. l = v,
  4572. e = v,
  4573. m = v,
  4574. f = h.length,
  4575. l = v;
  4576. this.e = this.g = 0;
  4577. l = b[a++];
  4578. l === v && c(Error("invalid uncompressed block header: LEN (first byte)"));
  4579. e = l;
  4580. l = b[a++];
  4581. l === v && c(Error("invalid uncompressed block header: LEN (second byte)"));
  4582. e |= l << 8;
  4583. l = b[a++];
  4584. l === v && c(Error("invalid uncompressed block header: NLEN (first byte)"));
  4585. m = l;
  4586. l = b[a++];
  4587. l === v && c(Error("invalid uncompressed block header: NLEN (second byte)"));
  4588. m |= l << 8;
  4589. e === ~m && c(Error("invalid uncompressed block header: length verify"));
  4590. a + e > b.length && c(Error("input buffer is broken"));
  4591. switch (this.m) {
  4592. case N:
  4593. for (; d + e > h.length;) {
  4594. l = f - d;
  4595. e -= l;
  4596. if (t) h.set(b.subarray(a, a + l), d), d += l, a += l;
  4597. else
  4598. for (; l--;) h[d++] =
  4599. b[a++];
  4600. this.b = d;
  4601. h = this.f();
  4602. d = this.b
  4603. }
  4604. break;
  4605. case F:
  4606. for (; d + e > h.length;) h = this.f({
  4607. v: 2
  4608. });
  4609. break;
  4610. default:
  4611. c(Error("invalid inflate mode"))
  4612. }
  4613. if (t) h.set(b.subarray(a, a + e), d), d += e, a += e;
  4614. else
  4615. for (; e--;) h[d++] = b[a++];
  4616. this.c = a;
  4617. this.b = d;
  4618. this.a = h;
  4619. break;
  4620. case 1:
  4621. this.o(S, T);
  4622. break;
  4623. case 2:
  4624. z(this);
  4625. break;
  4626. default:
  4627. c(Error("unknown BTYPE: " + b))
  4628. }
  4629. }
  4630. return this.t()
  4631. };
  4632. D = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];
  4633. var K = t ? new Uint16Array(D) : D;
  4634. D = [3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227,
  4635. 258, 258, 258
  4636. ];
  4637. var I = t ? new Uint16Array(D) : D;
  4638. D = [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 0, 0];
  4639. var P = t ? new Uint8Array(D) : D;
  4640. D = [1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577];
  4641. var R = t ? new Uint16Array(D) : D;
  4642. D = [0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13];
  4643. var Q = t ? new Uint8Array(D) : D;
  4644. D = new(t ? Uint8Array : Array)(288);
  4645. w = 0;
  4646. for (E = D.length; w < E; ++w) D[w] = 143 >= w ? 8 : 255 >= w ? 9 : 279 >= w ? 7 : 8;
  4647. var S = h(D);
  4648. D = new(t ? Uint8Array :
  4649. Array)(30);
  4650. w = 0;
  4651. for (E = D.length; w < E; ++w) D[w] = 5;
  4652. var T = h(D);
  4653. q.prototype.o = function(b, a) {
  4654. var c = this.a,
  4655. h = this.b;
  4656. this.u = b;
  4657. for (var d = c.length - 258, l, e, m; 256 !== (l = s(this, b));)
  4658. if (256 > l) h >= d && (this.b = h, c = this.f(), h = this.b), c[h++] = l;
  4659. else
  4660. for (l -= 257, m = I[l], 0 < P[l] && (m += r(this, P[l])), l = s(this, a), e = R[l], 0 < Q[l] && (e += r(this, Q[l])), h >= d && (this.b = h, c = this.f(), h = this.b); m--;) c[h] = c[h++-e];
  4661. for (; 8 <= this.e;) this.e -= 8, this.c--;
  4662. this.b = h
  4663. };
  4664. q.prototype.I = function(b, a) {
  4665. var c = this.a,
  4666. h = this.b;
  4667. this.u = b;
  4668. for (var d = c.length, l, e, m; 256 !==
  4669. (l = s(this, b));)
  4670. if (256 > l) h >= d && (c = this.f(), d = c.length), c[h++] = l;
  4671. else
  4672. for (l -= 257, m = I[l], 0 < P[l] && (m += r(this, P[l])), l = s(this, a), e = R[l], 0 < Q[l] && (e += r(this, Q[l])), h + m > d && (c = this.f(), d = c.length); m--;) c[h] = c[h++-e];
  4673. for (; 8 <= this.e;) this.e -= 8, this.c--;
  4674. this.b = h
  4675. };
  4676. q.prototype.f = function() {
  4677. var b = new(t ? Uint8Array : Array)(this.b - 32768),
  4678. a = this.b - 32768,
  4679. c, h, d = this.a;
  4680. if (t) b.set(d.subarray(32768, b.length));
  4681. else
  4682. for (c = 0, h = b.length; c < h; ++c) b[c] = d[c + 32768];
  4683. this.k.push(b);
  4684. this.q += b.length;
  4685. if (t) d.set(d.subarray(a, a + 32768));
  4686. else
  4687. for (c = 0; 32768 > c; ++c) d[c] = d[a + c];
  4688. this.b = 32768;
  4689. return d
  4690. };
  4691. q.prototype.J = function(b) {
  4692. var a, c = this.input.length / this.c + 1 | 0,
  4693. h, d, l, e = this.input,
  4694. m = this.a;
  4695. b && ("number" === typeof b.v && (c = b.v), "number" === typeof b.F && (c += b.F));
  4696. 2 > c ? (h = (e.length - this.c) / this.u[2], l = h / 2 * 258 | 0, d = l < m.length ? m.length + l : m.length << 1) : d = m.length * c;
  4697. t ? (a = new Uint8Array(d), a.set(m)) : a = m;
  4698. return this.a = a
  4699. };
  4700. q.prototype.t = function() {
  4701. var b = 0,
  4702. a = this.a,
  4703. c = this.k,
  4704. h, d = new(t ? Uint8Array : Array)(this.q + (this.b - 32768)),
  4705. l, e, m, f;
  4706. if (0 === c.length) return t ?
  4707. this.a.subarray(32768, this.b) : this.a.slice(32768, this.b);
  4708. l = 0;
  4709. for (e = c.length; l < e; ++l)
  4710. for (h = c[l], m = 0, f = h.length; m < f; ++m) d[b++] = h[m];
  4711. l = 32768;
  4712. for (e = this.b; l < e; ++l) d[b++] = a[l];
  4713. this.k = [];
  4714. return this.buffer = d
  4715. };
  4716. q.prototype.H = function() {
  4717. var b, a = this.b;
  4718. t ? this.B ? (b = new Uint8Array(a), b.set(this.a.subarray(0, a))) : b = this.a.subarray(0, a) : (this.a.length > a && (this.a.length = a), b = this.a);
  4719. return this.buffer = b
  4720. };
  4721. A.prototype.p = function() {
  4722. var b = this.input,
  4723. a, h;
  4724. a = this.A.p();
  4725. this.c = this.A.c;
  4726. this.M && (h = (b[this.c++] << 24 | b[this.c++] <<
  4727. 16 | b[this.c++] << 8 | b[this.c++]) >>> 0, h !== d(a) && c(Error("invalid adler-32 checksum")));
  4728. return a
  4729. };
  4730. e("Zlib.Inflate", A);
  4731. e("Zlib.Inflate.BufferType", u);
  4732. u.ADAPTIVE = u.C;
  4733. u.BLOCK = u.D;
  4734. e("Zlib.Inflate.prototype.decompress", A.prototype.p);
  4735. u = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];
  4736. t && new Uint16Array(u);
  4737. u = [3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 258, 258];
  4738. t && new Uint16Array(u);
  4739. u = [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 0, 0];
  4740. t && new Uint8Array(u);
  4741. u = [1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577];
  4742. t && new Uint16Array(u);
  4743. u = [0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13];
  4744. t && new Uint8Array(u);
  4745. u = new(t ? Uint8Array : Array)(288);
  4746. D = 0;
  4747. for (w = u.length; D < w; ++D) u[D] = 143 >= D ? 8 : 255 >= D ? 9 : 279 >= D ? 7 : 8;
  4748. h(u);
  4749. u = new(t ? Uint8Array : Array)(30);
  4750. D = 0;
  4751. for (w = u.length; D < w; ++D) u[D] = 5;
  4752. h(u);
  4753. var O = 8
  4754. }).call(this);
  4755. (function(c) {
  4756. var e = function() {
  4757. function d() {}
  4758. d.parse = function(a) {
  4759. a = c.SAXParser.getInstance().parserXML(a);
  4760. if (!a || !a.childNodes) return null;
  4761. for (var b = a.childNodes.length, h = !1, l = 0; l < b; l++) {
  4762. var e = a.childNodes[l];
  4763. if (1 == e.nodeType) {
  4764. h = !0;
  4765. break
  4766. }
  4767. }
  4768. return h ? d.parseNode(e) : null
  4769. };
  4770. d.parseNode = function(a) {
  4771. if (!a || 1 != a.nodeType) return null;
  4772. var b = {};
  4773. b.localName = a.localName;
  4774. b.name = a.nodeName;
  4775. a.namespaceURI && (b.namespace = a.namespaceURI);
  4776. a.prefix && (b.prefix = a.prefix);
  4777. for (var c = a.attributes, l = c.length, e = 0; e < l; e++) {
  4778. var f =
  4779. c[e],
  4780. g = f.name;
  4781. 0 != g.indexOf("xmlns:") && (b["$" + g] = f.value)
  4782. }
  4783. c = a.childNodes;
  4784. l = c.length;
  4785. for (e = 0; e < l; e++)
  4786. if (f = d.parseNode(c[e])) b.children || (b.children = []), f.parent = b, b.children.push(f);
  4787. !b.children && (a = a.textContent.trim()) && (b.text = a);
  4788. return b
  4789. };
  4790. d.findChildren = function(a, b, c) {
  4791. c ? c.length = 0 : c = [];
  4792. d.findByPath(a, b, c);
  4793. return c
  4794. };
  4795. d.findByPath = function(a, b, c) {
  4796. var l = b.indexOf("."),
  4797. e; - 1 == l ? (e = b, l = !0) : (e = b.substring(0, l), b = b.substring(l + 1), l = !1);
  4798. if (a = a.children)
  4799. for (var f = a.length, g = 0; g < f; g++) {
  4800. var k = a[g];
  4801. k.localName ==
  4802. e && (l ? c.push(k) : d.findByPath(k, b, c))
  4803. }
  4804. };
  4805. d.getAttributes = function(a, b) {
  4806. b ? b.length = 0 : b = [];
  4807. for (var c in a) "$" == c.charAt(0) && b.push(c.substring(1));
  4808. return b
  4809. };
  4810. return d
  4811. }();
  4812. c.XML = e
  4813. })(egret || (egret = {}));
  4814. __extends = this.__extends || function(c, e) {
  4815. function d() {
  4816. this.constructor = c
  4817. }
  4818. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  4819. d.prototype = e.prototype;
  4820. c.prototype = new d
  4821. };
  4822. (function(c) {
  4823. var e = function(d) {
  4824. function a(b, a, c) {
  4825. d.call(this);
  4826. this._target = null;
  4827. this.loop = this.ignoreGlobalPause = this._useTicks = !1;
  4828. this._actions = this._steps = this.pluginData = null;
  4829. this.paused = !1;
  4830. this.duration = 0;
  4831. this._prevPos = -1;
  4832. this.position = null;
  4833. this._stepPosition = this._prevPosition = 0;
  4834. this.passive = !1;
  4835. this.initialize(b, a, c)
  4836. }
  4837. __extends(a, d);
  4838. a.get = function(b, c, d, e) {
  4839. "undefined" === typeof c && (c = null);
  4840. "undefined" === typeof d && (d = null);
  4841. "undefined" === typeof e && (e = !1);
  4842. e && a.removeTweens(b);
  4843. return new a(b, c, d)
  4844. };
  4845. a.removeTweens = function(b) {
  4846. if (b.tween_count) {
  4847. for (var c = a._tweens, d = c.length - 1; 0 <= d; d--) c[d]._target == b && (c[d].paused = !0, c.splice(d, 1));
  4848. b.tween_count = 0
  4849. }
  4850. };
  4851. a.tick = function(b, c) {
  4852. "undefined" === typeof c && (c = !1);
  4853. for (var d = a._tweens.concat(), e = d.length - 1; 0 <= e; e--) {
  4854. var f = d[e];
  4855. c && !f.ignoreGlobalPause || f.paused || f.tick(f._useTicks ? 1 : b)
  4856. }
  4857. };
  4858. a._register = function(b, h) {
  4859. var d = b._target,
  4860. e = a._tweens;
  4861. if (h) d && (d.tween_count = d.tween_count ? d.tween_count + 1 : 1), e.push(b), a._inited || (c.Ticker.getInstance().register(a.tick, null),
  4862. a._inited = !0);
  4863. else
  4864. for (d && d.tween_count--, d = e.length; d--;)
  4865. if (e[d] == b) {
  4866. e.splice(d, 1);
  4867. break
  4868. }
  4869. };
  4870. a.removeAllTweens = function() {
  4871. for (var b = a._tweens, c = 0, d = b.length; c < d; c++) {
  4872. var e = b[c];
  4873. e.paused = !0;
  4874. e._target.tweenjs_count = 0
  4875. }
  4876. b.length = 0
  4877. };
  4878. a.prototype.initialize = function(b, c, d) {
  4879. this._target = b;
  4880. c && (this._useTicks = c.useTicks, this.ignoreGlobalPause = c.ignoreGlobalPause, this.loop = c.loop, c.onChange && this.addEventListener("change", c.onChange, c.onChangeObj), c.override && a.removeTweens(b));
  4881. this.pluginData = d || {};
  4882. this._curQueueProps = {};
  4883. this._initQueueProps = {};
  4884. this._steps = [];
  4885. this._actions = [];
  4886. c && c.paused ? this.paused = !0 : a._register(this, !0);
  4887. c && null != c.position && this.setPosition(c.position, a.NONE)
  4888. };
  4889. a.prototype.setPosition = function(b, a) {
  4890. "undefined" === typeof a && (a = 1);
  4891. 0 > b && (b = 0);
  4892. var c = b,
  4893. d = !1;
  4894. c >= this.duration && (this.loop ? c %= this.duration : (c = this.duration, d = !0));
  4895. if (c == this._prevPos) return d;
  4896. var e = this._prevPos;
  4897. this.position = this._prevPos = c;
  4898. this._prevPosition = b;
  4899. if (this._target)
  4900. if (d) this._updateTargetProps(null, 1);
  4901. else if (0 < this._steps.length) {
  4902. for (var g =
  4903. 0, k = this._steps.length; g < k && !(this._steps[g].t > c); g++);
  4904. g = this._steps[g - 1];
  4905. this._updateTargetProps(g, (this._stepPosition = c - g.t) / g.d)
  4906. }
  4907. 0 != a && 0 < this._actions.length && (this._useTicks ? this._runActions(c, c) : 1 == a && c < e ? (e != this.duration && this._runActions(e, this.duration), this._runActions(0, c, !0)) : this._runActions(e, c));
  4908. d && this.setPaused(!0);
  4909. this.dispatchEventWith("change");
  4910. return d
  4911. };
  4912. a.prototype._runActions = function(b, a, c) {
  4913. "undefined" === typeof c && (c = !1);
  4914. var d = b,
  4915. e = a,
  4916. g = -1,
  4917. k = this._actions.length,
  4918. n = 1;
  4919. b > a && (d = a,
  4920. e = b, g = k, k = n = -1);
  4921. for (;
  4922. (g += n) != k;) {
  4923. a = this._actions[g];
  4924. var p = a.t;
  4925. (p == e || p > d && p < e || c && p == b) && a.f.apply(a.o, a.p)
  4926. }
  4927. };
  4928. a.prototype._updateTargetProps = function(b, c) {
  4929. var d, e, f, g;
  4930. if (b || 1 != c) {
  4931. if (this.passive = !!b.v) return;
  4932. b.e && (c = b.e(c, 0, 1, 1));
  4933. d = b.p0;
  4934. e = b.p1
  4935. } else this.passive = !1, d = e = this._curQueueProps;
  4936. for (var k in this._initQueueProps) {
  4937. null == (f = d[k]) && (d[k] = f = this._initQueueProps[k]);
  4938. null == (g = e[k]) && (e[k] = g = f);
  4939. f = f == g || 0 == c || 1 == c || "number" != typeof f ? 1 == c ? g : f : f + (g - f) * c;
  4940. var n = !1;
  4941. if (g = a._plugins[k])
  4942. for (var p = 0, q = g.length; p <
  4943. q; p++) {
  4944. var r = g[p].tween(this, k, f, d, e, c, !!b && d == e, !b);
  4945. r == a.IGNORE ? n = !0 : f = r
  4946. }
  4947. n || (this._target[k] = f)
  4948. }
  4949. };
  4950. a.prototype.setPaused = function(b) {
  4951. this.paused = b;
  4952. a._register(this, !b);
  4953. return this
  4954. };
  4955. a.prototype._cloneProps = function(b) {
  4956. var a = {},
  4957. c;
  4958. for (c in b) a[c] = b[c];
  4959. return a
  4960. };
  4961. a.prototype._addStep = function(b) {
  4962. 0 < b.d && (this._steps.push(b), b.t = this.duration, this.duration += b.d);
  4963. return this
  4964. };
  4965. a.prototype._appendQueueProps = function(b) {
  4966. var c, d, e, f, g, k;
  4967. for (k in b)
  4968. if (void 0 === this._initQueueProps[k]) {
  4969. d = this._target[k];
  4970. if (c = a._plugins[k])
  4971. for (e =
  4972. 0, f = c.length; e < f; e++) d = c[e].init(this, k, d);
  4973. this._initQueueProps[k] = this._curQueueProps[k] = void 0 === d ? null : d
  4974. }
  4975. for (k in b) {
  4976. d = this._curQueueProps[k];
  4977. if (c = a._plugins[k])
  4978. for (g = g || {}, e = 0, f = c.length; e < f; e++) c[e].step && c[e].step(this, k, d, b[k], g);
  4979. this._curQueueProps[k] = b[k]
  4980. }
  4981. g && this._appendQueueProps(g);
  4982. return this._curQueueProps
  4983. };
  4984. a.prototype._addAction = function(b) {
  4985. b.t = this.duration;
  4986. this._actions.push(b);
  4987. return this
  4988. };
  4989. a.prototype._set = function(b, a) {
  4990. for (var c in b) a[c] = b[c]
  4991. };
  4992. a.prototype.wait = function(b, a) {
  4993. "undefined" ===
  4994. typeof a && (a = !1);
  4995. if (null == b || 0 >= b) return this;
  4996. var c = this._cloneProps(this._curQueueProps);
  4997. return this._addStep({
  4998. d: b,
  4999. p0: c,
  5000. p1: c,
  5001. v: a
  5002. })
  5003. };
  5004. a.prototype.to = function(b, a, c) {
  5005. "undefined" === typeof c && (c = void 0);
  5006. if (isNaN(a) || 0 > a) a = 0;
  5007. return this._addStep({
  5008. d: a || 0,
  5009. p0: this._cloneProps(this._curQueueProps),
  5010. e: c,
  5011. p1: this._cloneProps(this._appendQueueProps(b))
  5012. })
  5013. };
  5014. a.prototype.call = function(b, a, c) {
  5015. "undefined" === typeof a && (a = void 0);
  5016. "undefined" === typeof c && (c = void 0);
  5017. return this._addAction({
  5018. f: b,
  5019. p: c ? c : [this],
  5020. o: a ? a : this._target
  5021. })
  5022. };
  5023. a.prototype.set = function(b, a) {
  5024. "undefined" === typeof a && (a = null);
  5025. return this._addAction({
  5026. f: this._set,
  5027. o: this,
  5028. p: [b, a ? a : this._target]
  5029. })
  5030. };
  5031. a.prototype.play = function(b) {
  5032. b || (b = this);
  5033. return this.call(b.setPaused, [!1], b)
  5034. };
  5035. a.prototype.pause = function(b) {
  5036. b || (b = this);
  5037. return this.call(b.setPaused, [!0], b)
  5038. };
  5039. a.prototype.tick = function(b) {
  5040. this.paused || this.setPosition(this._prevPosition + b)
  5041. };
  5042. a.NONE = 0;
  5043. a.LOOP = 1;
  5044. a.REVERSE = 2;
  5045. a._tweens = [];
  5046. a.IGNORE = {};
  5047. a._plugins = {};
  5048. a._inited = !1;
  5049. return a
  5050. }(c.EventDispatcher);
  5051. c.Tween = e
  5052. })(egret ||
  5053. (egret = {}));
  5054. (function(c) {
  5055. var e = function() {
  5056. function d() {
  5057. c.Logger.fatal("Ease\u4e0d\u80fd\u88ab\u5b9e\u4f8b\u5316")
  5058. }
  5059. d.get = function(a) {
  5060. -1 > a && (a = -1);
  5061. 1 < a && (a = 1);
  5062. return function(b) {
  5063. return 0 == a ? b : 0 > a ? b * (b * -a + 1 + a) : b * ((2 - b) * a + (1 - a))
  5064. }
  5065. };
  5066. d.getPowIn = function(a) {
  5067. return function(b) {
  5068. return Math.pow(b, a)
  5069. }
  5070. };
  5071. d.getPowOut = function(a) {
  5072. return function(b) {
  5073. return 1 - Math.pow(1 - b, a)
  5074. }
  5075. };
  5076. d.getPowInOut = function(a) {
  5077. return function(b) {
  5078. return 1 > (b *= 2) ? 0.5 * Math.pow(b, a) : 1 - 0.5 * Math.abs(Math.pow(2 - b, a))
  5079. }
  5080. };
  5081. d.sineIn = function(a) {
  5082. return 1 - Math.cos(a *
  5083. Math.PI / 2)
  5084. };
  5085. d.sineOut = function(a) {
  5086. return Math.sin(a * Math.PI / 2)
  5087. };
  5088. d.sineInOut = function(a) {
  5089. return -0.5 * (Math.cos(Math.PI * a) - 1)
  5090. };
  5091. d.getBackIn = function(a) {
  5092. return function(b) {
  5093. return b * b * ((a + 1) * b - a)
  5094. }
  5095. };
  5096. d.getBackOut = function(a) {
  5097. return function(b) {
  5098. b -= 1;
  5099. return b * b * ((a + 1) * b + a) + 1
  5100. }
  5101. };
  5102. d.getBackInOut = function(a) {
  5103. a *= 1.525;
  5104. return function(b) {
  5105. return 1 > (b *= 2) ? 0.5 * b * b * ((a + 1) * b - a) : 0.5 * ((b -= 2) * b * ((a + 1) * b + a) + 2)
  5106. }
  5107. };
  5108. d.circIn = function(a) {
  5109. return -(Math.sqrt(1 - a * a) - 1)
  5110. };
  5111. d.circOut = function(a) {
  5112. return Math.sqrt(1 - a * a)
  5113. };
  5114. d.circInOut = function(a) {
  5115. return 1 >
  5116. (a *= 2) ? -0.5 * (Math.sqrt(1 - a * a) - 1) : 0.5 * (Math.sqrt(1 - (a -= 2) * a) + 1)
  5117. };
  5118. d.bounceIn = function(a) {
  5119. return 1 - d.bounceOut(1 - a)
  5120. };
  5121. d.bounceOut = function(a) {
  5122. return a < 1 / 2.75 ? 7.5625 * a * a : a < 2 / 2.75 ? 7.5625 * (a -= 1.5 / 2.75) * a + 0.75 : a < 2.5 / 2.75 ? 7.5625 * (a -= 2.25 / 2.75) * a + 0.9375 : 7.5625 * (a -= 2.625 / 2.75) * a + 0.984375
  5123. };
  5124. d.bounceInOut = function(a) {
  5125. return 0.5 > a ? 0.5 * d.bounceIn(2 * a) : 0.5 * d.bounceOut(2 * a - 1) + 0.5
  5126. };
  5127. d.getElasticIn = function(a, b) {
  5128. var c = 2 * Math.PI;
  5129. return function(d) {
  5130. if (0 == d || 1 == d) return d;
  5131. var e = b / c * Math.asin(1 / a);
  5132. return -(a * Math.pow(2, 10 *
  5133. (d -= 1)) * Math.sin((d - e) * c / b))
  5134. }
  5135. };
  5136. d.getElasticOut = function(a, b) {
  5137. var c = 2 * Math.PI;
  5138. return function(d) {
  5139. if (0 == d || 1 == d) return d;
  5140. var e = b / c * Math.asin(1 / a);
  5141. return a * Math.pow(2, -10 * d) * Math.sin((d - e) * c / b) + 1
  5142. }
  5143. };
  5144. d.getElasticInOut = function(a, b) {
  5145. var c = 2 * Math.PI;
  5146. return function(d) {
  5147. var e = b / c * Math.asin(1 / a);
  5148. return 1 > (d *= 2) ? -0.5 * a * Math.pow(2, 10 * (d -= 1)) * Math.sin((d - e) * c / b) : a * Math.pow(2, -10 * (d -= 1)) * Math.sin((d - e) * c / b) * 0.5 + 1
  5149. }
  5150. };
  5151. d.quadIn = d.getPowIn(2);
  5152. d.quadOut = d.getPowOut(2);
  5153. d.quadInOut = d.getPowInOut(2);
  5154. d.cubicIn = d.getPowIn(3);
  5155. d.cubicOut = d.getPowOut(3);
  5156. d.cubicInOut = d.getPowInOut(3);
  5157. d.quartIn = d.getPowIn(4);
  5158. d.quartOut = d.getPowOut(4);
  5159. d.quartInOut = d.getPowInOut(4);
  5160. d.quintIn = d.getPowIn(5);
  5161. d.quintOut = d.getPowOut(5);
  5162. d.quintInOut = d.getPowInOut(5);
  5163. d.backIn = d.getBackIn(1.7);
  5164. d.backOut = d.getBackOut(1.7);
  5165. d.backInOut = d.getBackInOut(1.7);
  5166. d.elasticIn = d.getElasticIn(1, 0.3);
  5167. d.elasticOut = d.getElasticOut(1, 0.3);
  5168. d.elasticInOut = d.getElasticInOut(1, 0.3 * 1.5);
  5169. return d
  5170. }();
  5171. c.Ease = e
  5172. })(egret || (egret = {}));
  5173. (function(c) {
  5174. var e = function() {
  5175. function c() {}
  5176. c.prototype.play = function(a) {
  5177. "undefined" === typeof a && (a = !1);
  5178. var b = this.audio;
  5179. b && (isNaN(b.duration) || (b.currentTime = 0), b.loop = a, b.play())
  5180. };
  5181. c.prototype.pause = function() {
  5182. var a = this.audio;
  5183. a && a.pause()
  5184. };
  5185. c.prototype.load = function() {
  5186. var a = this.audio;
  5187. a && a.load()
  5188. };
  5189. c.prototype.addEventListener = function(a, b) {
  5190. this.audio && this.audio.addEventListener(a, b, !1)
  5191. };
  5192. c.prototype.removeEventListener = function(a, b) {
  5193. this.audio && this.audio.removeEventListener(a, b, !1)
  5194. };
  5195. c.prototype.setVolume =
  5196. function(a) {
  5197. var b = this.audio;
  5198. b && (b.volume = a)
  5199. };
  5200. c.prototype.getVolume = function() {
  5201. return this.audio ? this.audio.volume : 0
  5202. };
  5203. return c
  5204. }();
  5205. c.Sound = e
  5206. })(egret || (egret = {}));
  5207. __extends = this.__extends || function(c, e) {
  5208. function d() {
  5209. this.constructor = c
  5210. }
  5211. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  5212. d.prototype = e.prototype;
  5213. c.prototype = new d
  5214. };
  5215. (function(c) {
  5216. var e = function(d) {
  5217. function a(b) {
  5218. "undefined" === typeof b && (b = null);
  5219. d.call(this);
  5220. this._source = b ? b : []
  5221. }
  5222. __extends(a, d);
  5223. Object.defineProperty(a.prototype, "source", {
  5224. get: function() {
  5225. return this._source
  5226. },
  5227. set: function(b) {
  5228. b || (b = []);
  5229. this._source = b;
  5230. this.dispatchCoEvent(c.CollectionEventKind.RESET)
  5231. },
  5232. enumerable: !0,
  5233. configurable: !0
  5234. });
  5235. a.prototype.refresh = function() {
  5236. this.dispatchCoEvent(c.CollectionEventKind.REFRESH)
  5237. };
  5238. a.prototype.contains = function(b) {
  5239. return -1 != this.getItemIndex(b)
  5240. };
  5241. a.prototype.checkIndex =
  5242. function(b) {
  5243. if (0 > b || b >= this._source.length) throw new RangeError('\u7d22\u5f15:"' + b + '"\u8d85\u51fa\u96c6\u5408\u5143\u7d20\u7d22\u5f15\u8303\u56f4');
  5244. };
  5245. Object.defineProperty(a.prototype, "length", {
  5246. get: function() {
  5247. return this._source.length
  5248. },
  5249. enumerable: !0,
  5250. configurable: !0
  5251. });
  5252. a.prototype.addItem = function(b) {
  5253. this._source.push(b);
  5254. this.dispatchCoEvent(c.CollectionEventKind.ADD, this._source.length - 1, -1, [b])
  5255. };
  5256. a.prototype.addItemAt = function(b, a) {
  5257. if (0 > a || a > this._source.length) throw new RangeError('\u7d22\u5f15:"' +
  5258. a + '"\u8d85\u51fa\u96c6\u5408\u5143\u7d20\u7d22\u5f15\u8303\u56f4');
  5259. this._source.splice(a, 0, b);
  5260. this.dispatchCoEvent(c.CollectionEventKind.ADD, a, -1, [b])
  5261. };
  5262. a.prototype.getItemAt = function(b) {
  5263. return this._source[b]
  5264. };
  5265. a.prototype.getItemIndex = function(b) {
  5266. for (var a = this._source.length, c = 0; c < a; c++)
  5267. if (this._source[c] === b) return c;
  5268. return -1
  5269. };
  5270. a.prototype.itemUpdated = function(b) {
  5271. var a = this.getItemIndex(b); - 1 != a && this.dispatchCoEvent(c.CollectionEventKind.UPDATE, a, -1, [b])
  5272. };
  5273. a.prototype.removeAll = function() {
  5274. var b =
  5275. this._source.concat();
  5276. this._source.length = 0;
  5277. this.dispatchCoEvent(c.CollectionEventKind.REMOVE, 0, -1, b)
  5278. };
  5279. a.prototype.removeItemAt = function(b) {
  5280. this.checkIndex(b);
  5281. var a = this._source.splice(b, 1)[0];
  5282. this.dispatchCoEvent(c.CollectionEventKind.REMOVE, b, -1, [a]);
  5283. return a
  5284. };
  5285. a.prototype.replaceItemAt = function(b, a) {
  5286. this.checkIndex(a);
  5287. var d = this._source.splice(a, 1, b)[0];
  5288. this.dispatchCoEvent(c.CollectionEventKind.REPLACE, a, -1, [b], [d]);
  5289. return d
  5290. };
  5291. a.prototype.replaceAll = function(b) {
  5292. b || (b = []);
  5293. for (var a = b.length, c = this._source.length,
  5294. d = a; d < c; d++) this.removeItemAt(a);
  5295. for (d = 0; d < a; d++) d >= c ? this.addItemAt(b[d], d) : this.replaceItemAt(b[d], d);
  5296. this._source = b
  5297. };
  5298. a.prototype.moveItemAt = function(b, a) {
  5299. this.checkIndex(b);
  5300. this.checkIndex(a);
  5301. var d = this._source.splice(b, 1)[0];
  5302. this._source.splice(a, 0, d);
  5303. this.dispatchCoEvent(c.CollectionEventKind.MOVE, a, b, [d]);
  5304. return d
  5305. };
  5306. a.prototype.dispatchCoEvent = function(b, a, d, e, f) {
  5307. "undefined" === typeof b && (b = null);
  5308. "undefined" === typeof a && (a = -1);
  5309. "undefined" === typeof d && (d = -1);
  5310. "undefined" === typeof e && (e = null);
  5311. "undefined" ===
  5312. typeof f && (f = null);
  5313. c.CollectionEvent.dispatchCollectionEvent(this, c.CollectionEvent.COLLECTION_CHANGE, b, a, d, e, f)
  5314. };
  5315. return a
  5316. }(c.EventDispatcher);
  5317. c.ArrayCollection = e
  5318. })(egret || (egret = {}));
  5319. __extends = this.__extends || function(c, e) {
  5320. function d() {
  5321. this.constructor = c
  5322. }
  5323. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  5324. d.prototype = e.prototype;
  5325. c.prototype = new d
  5326. };
  5327. (function(c) {
  5328. var e = function(d) {
  5329. function a(b, a) {
  5330. "undefined" === typeof b && (b = "children");
  5331. "undefined" === typeof a && (a = "parent");
  5332. d.call(this);
  5333. this.nodeList = [];
  5334. this._openNodes = [];
  5335. this._showRoot = !1;
  5336. this.childrenKey = b;
  5337. this.parentKey = a
  5338. }
  5339. __extends(a, d);
  5340. Object.defineProperty(a.prototype, "source", {
  5341. get: function() {
  5342. return this._source
  5343. },
  5344. set: function(b) {
  5345. this._source = b;
  5346. this._openNodes = [];
  5347. this.nodeList = [];
  5348. this._source && (this._showRoot ? this.nodeList.push(this._source) : (this._openNodes = [this._source], this.addChildren(this._source,
  5349. this.nodeList)));
  5350. this.dispatchCoEvent(c.CollectionEventKind.RESET)
  5351. },
  5352. enumerable: !0,
  5353. configurable: !0
  5354. });
  5355. Object.defineProperty(a.prototype, "openNodes", {
  5356. get: function() {
  5357. return this._openNodes.concat()
  5358. },
  5359. set: function(b) {
  5360. this._openNodes = b ? b.concat() : [];
  5361. this.refresh()
  5362. },
  5363. enumerable: !0,
  5364. configurable: !0
  5365. });
  5366. Object.defineProperty(a.prototype, "length", {
  5367. get: function() {
  5368. return this.nodeList.length
  5369. },
  5370. enumerable: !0,
  5371. configurable: !0
  5372. });
  5373. a.prototype.getItemAt = function(b) {
  5374. return this.nodeList[b]
  5375. };
  5376. a.prototype.getItemIndex = function(b) {
  5377. for (var a =
  5378. this.nodeList.length, c = 0; c < a; c++)
  5379. if (this.nodeList[c] === b) return c;
  5380. return -1
  5381. };
  5382. a.prototype.itemUpdated = function(b) {
  5383. var a = this.getItemIndex(b); - 1 != a && this.dispatchCoEvent(c.CollectionEventKind.UPDATE, a, -1, [b])
  5384. };
  5385. a.prototype.removeItem = function(b) {
  5386. this.isItemOpen(b) && this.closeNode(b);
  5387. if (b) {
  5388. var a = b[this.parentKey];
  5389. if (a && (a = a[this.childrenKey])) {
  5390. var d = a.indexOf(b); - 1 != d && a.splice(d, 1);
  5391. b[this.parentKey] = null;
  5392. d = this.nodeList.indexOf(b); - 1 != d && (this.nodeList.splice(d, 1), this.dispatchCoEvent(c.CollectionEventKind.REMOVE,
  5393. d, -1, [b]))
  5394. }
  5395. }
  5396. };
  5397. Object.defineProperty(a.prototype, "showRoot", {
  5398. get: function() {
  5399. return this._showRoot
  5400. },
  5401. set: function(b) {
  5402. this._showRoot != b && (this._showRoot = b, this._source && (this._showRoot ? this.nodeList.splice(0, 0, this._source) : (this.nodeList.shift(), -1 == this.openNodes.indexOf(this._source) && this.openNodes.push(this._source)), this.refresh()))
  5403. },
  5404. enumerable: !0,
  5405. configurable: !0
  5406. });
  5407. a.prototype.addChildren = function(b, a) {
  5408. if (b.hasOwnProperty(this.childrenKey) && -1 != this._openNodes.indexOf(b))
  5409. for (var c = b[this.childrenKey],
  5410. d = c.length, e = 0; e < d; e++) {
  5411. var g = c[e];
  5412. a.push(g);
  5413. this.addChildren(g, a)
  5414. }
  5415. };
  5416. a.prototype.hasChildren = function(b) {
  5417. return b.hasOwnProperty(this.childrenKey) ? 0 < b[this.childrenKey].length : !1
  5418. };
  5419. a.prototype.isItemOpen = function(b) {
  5420. return -1 != this._openNodes.indexOf(b)
  5421. };
  5422. a.prototype.expandItem = function(b, a) {
  5423. "undefined" === typeof a && (a = !0);
  5424. a ? this.openNode(b) : this.closeNode(b)
  5425. };
  5426. a.prototype.openNode = function(b) {
  5427. if (-1 == this._openNodes.indexOf(b)) {
  5428. this._openNodes.push(b);
  5429. var a = this.nodeList.indexOf(b);
  5430. if (-1 != a) {
  5431. var d = [];
  5432. this.addChildren(b, d);
  5433. for (var e = a; d.length;) {
  5434. e++;
  5435. var f = d.shift();
  5436. this.nodeList.splice(e, 0, f);
  5437. this.dispatchCoEvent(c.CollectionEventKind.ADD, e, -1, [f])
  5438. }
  5439. this.dispatchCoEvent("open", a, a, [b])
  5440. }
  5441. }
  5442. };
  5443. a.prototype.closeNode = function(b) {
  5444. var a = this._openNodes.indexOf(b);
  5445. if (-1 != a) {
  5446. var d = [];
  5447. this.addChildren(b, d);
  5448. this._openNodes.splice(a, 1);
  5449. a = this.nodeList.indexOf(b);
  5450. if (-1 != a) {
  5451. for (a++; d.length;) {
  5452. var e = this.nodeList.splice(a, 1)[0];
  5453. this.dispatchCoEvent(c.CollectionEventKind.REMOVE, a, -1, [e]);
  5454. d.shift()
  5455. }
  5456. a--;
  5457. this.dispatchCoEvent(c.CollectionEventKind.CLOSE,
  5458. a, a, [b])
  5459. }
  5460. }
  5461. };
  5462. a.prototype.getDepth = function(b) {
  5463. var a = 0;
  5464. for (b = b[this.parentKey]; b;) a++, b = b[this.parentKey];
  5465. 0 < a && !this._showRoot && a--;
  5466. return a
  5467. };
  5468. a.prototype.refresh = function() {
  5469. this.nodeList = [];
  5470. this._source && (this._showRoot && this.nodeList.push(this._source), this.addChildren(this._source, this.nodeList));
  5471. this.dispatchCoEvent(c.CollectionEventKind.REFRESH)
  5472. };
  5473. a.prototype.dispatchCoEvent = function(b, a, d, e, f) {
  5474. "undefined" === typeof b && (b = null);
  5475. "undefined" === typeof a && (a = -1);
  5476. "undefined" === typeof d && (d = -1);
  5477. "undefined" ===
  5478. typeof e && (e = null);
  5479. "undefined" === typeof f && (f = null);
  5480. c.CollectionEvent.dispatchCollectionEvent(this, c.CollectionEvent.COLLECTION_CHANGE, b, a, d, e, f)
  5481. };
  5482. a.assignParent = function(b, c, d) {
  5483. "undefined" === typeof c && (c = "children");
  5484. "undefined" === typeof d && (d = "parent");
  5485. if (b.hasOwnProperty(c))
  5486. for (var e = b[c], f = e.length, g = 0; g < f; g++) {
  5487. var k = e[g];
  5488. try {
  5489. k[d] = b
  5490. } catch (n) {}
  5491. a.assignParent(k, c, d)
  5492. }
  5493. };
  5494. return a
  5495. }(c.EventDispatcher);
  5496. c.ObjectCollection = e
  5497. })(egret || (egret = {}));
  5498. __extends = this.__extends || function(c, e) {
  5499. function d() {
  5500. this.constructor = c
  5501. }
  5502. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  5503. d.prototype = e.prototype;
  5504. c.prototype = new d
  5505. };
  5506. (function(c) {
  5507. var e = function(d) {
  5508. function a() {
  5509. d.call(this);
  5510. this.targetLevel = Number.MAX_VALUE;
  5511. this.updateCompleteQueue = new c.DepthQueue;
  5512. this.invalidateClientPropertiesFlag = this.invalidatePropertiesFlag = !1;
  5513. this.invalidatePropertiesQueue = new c.DepthQueue;
  5514. this.invalidateClientSizeFlag = this.invalidateSizeFlag = !1;
  5515. this.invalidateSizeQueue = new c.DepthQueue;
  5516. this.invalidateDisplayListFlag = !1;
  5517. this.invalidateDisplayListQueue = new c.DepthQueue;
  5518. this.listenersAttached = !1
  5519. }
  5520. __extends(a, d);
  5521. a.prototype.invalidateProperties =
  5522. function(b) {
  5523. this.invalidatePropertiesFlag || (this.invalidatePropertiesFlag = !0, this.listenersAttached || this.attachListeners());
  5524. this.targetLevel <= b.nestLevel && (this.invalidateClientPropertiesFlag = !0);
  5525. this.invalidatePropertiesQueue.insert(b)
  5526. };
  5527. a.prototype.validateProperties = function() {
  5528. for (var b = this.invalidatePropertiesQueue.shift(); b;) b.parent && (b.validateProperties(), b.updateCompletePendingFlag || (this.updateCompleteQueue.insert(b), b.updateCompletePendingFlag = !0)), b = this.invalidatePropertiesQueue.shift();
  5529. this.invalidatePropertiesQueue.isEmpty() && (this.invalidatePropertiesFlag = !1)
  5530. };
  5531. a.prototype.invalidateSize = function(b) {
  5532. this.invalidateSizeFlag || (this.invalidateSizeFlag = !0, this.listenersAttached || this.attachListeners());
  5533. this.targetLevel <= b.nestLevel && (this.invalidateClientSizeFlag = !0);
  5534. this.invalidateSizeQueue.insert(b)
  5535. };
  5536. a.prototype.validateSize = function() {
  5537. for (var b = this.invalidateSizeQueue.pop(); b;) b.parent && (b.validateSize(), b.updateCompletePendingFlag || (this.updateCompleteQueue.insert(b), b.updateCompletePendingFlag = !0)), b = this.invalidateSizeQueue.pop();
  5538. this.invalidateSizeQueue.isEmpty() && (this.invalidateSizeFlag = !1)
  5539. };
  5540. a.prototype.invalidateDisplayList = function(b) {
  5541. this.invalidateDisplayListFlag || (this.invalidateDisplayListFlag = !0, this.listenersAttached || this.attachListeners());
  5542. this.invalidateDisplayListQueue.insert(b)
  5543. };
  5544. a.prototype.validateDisplayList = function() {
  5545. for (var b = this.invalidateDisplayListQueue.shift(); b;) b.parent && (b.validateDisplayList(), b.updateCompletePendingFlag || (this.updateCompleteQueue.insert(b),
  5546. b.updateCompletePendingFlag = !0)), b = this.invalidateDisplayListQueue.shift();
  5547. this.invalidateDisplayListQueue.isEmpty() && (this.invalidateDisplayListFlag = !1)
  5548. };
  5549. a.prototype.attachListeners = function() {
  5550. c.UIGlobals.stage.addEventListener(c.Event.ENTER_FRAME, this.doPhasedInstantiationCallBack, this);
  5551. c.UIGlobals.stage.addEventListener(c.Event.RENDER, this.doPhasedInstantiationCallBack, this);
  5552. c.UIGlobals.stage.invalidate();
  5553. this.listenersAttached = !0
  5554. };
  5555. a.prototype.doPhasedInstantiationCallBack = function(b) {
  5556. c.UIGlobals.stage.removeEventListener(c.Event.ENTER_FRAME,
  5557. this.doPhasedInstantiationCallBack, this);
  5558. c.UIGlobals.stage.removeEventListener(c.Event.RENDER, this.doPhasedInstantiationCallBack, this);
  5559. this.doPhasedInstantiation()
  5560. };
  5561. a.prototype.doPhasedInstantiation = function() {
  5562. this.invalidatePropertiesFlag && this.validateProperties();
  5563. this.invalidateSizeFlag && this.validateSize();
  5564. this.invalidateDisplayListFlag && this.validateDisplayList();
  5565. if (this.invalidatePropertiesFlag || this.invalidateSizeFlag || this.invalidateDisplayListFlag) this.attachListeners();
  5566. else {
  5567. this.listenersAttached = !1;
  5568. for (var b = this.updateCompleteQueue.pop(); b;) b.initialized || (b.initialized = !0), b.hasEventListener(c.UIEvent.UPDATE_COMPLETE) && c.UIEvent.dispatchUIEvent(b, c.UIEvent.UPDATE_COMPLETE), b.updateCompletePendingFlag = !1, b = this.updateCompleteQueue.pop();
  5569. c.UIEvent.dispatchUIEvent(this, c.UIEvent.UPDATE_COMPLETE)
  5570. }
  5571. };
  5572. a.prototype.validateNow = function() {
  5573. for (var b = 0; this.listenersAttached && 100 > b++;) this.doPhasedInstantiationCallBack()
  5574. };
  5575. a.prototype.validateClient = function(b, a) {
  5576. "undefined" === typeof a && (a = !1);
  5577. var d,
  5578. e = !1,
  5579. f = this.targetLevel;
  5580. this.targetLevel == Number.MAX_VALUE && (this.targetLevel = b.nestLevel);
  5581. for (; !e;) {
  5582. e = !0;
  5583. for (d = this.invalidatePropertiesQueue.removeSmallestChild(b); d;) d.parent && (d.validateProperties(), d.updateCompletePendingFlag || (this.updateCompleteQueue.insert(d), d.updateCompletePendingFlag = !0)), d = this.invalidatePropertiesQueue.removeSmallestChild(b);
  5584. this.invalidatePropertiesQueue.isEmpty() && (this.invalidatePropertiesFlag = !1);
  5585. this.invalidateClientPropertiesFlag = !1;
  5586. for (d = this.invalidateSizeQueue.removeLargestChild(b); d;) {
  5587. d.parent &&
  5588. (d.validateSize(), d.updateCompletePendingFlag || (this.updateCompleteQueue.insert(d), d.updateCompletePendingFlag = !0));
  5589. if (this.invalidateClientPropertiesFlag && (d = this.invalidatePropertiesQueue.removeSmallestChild(b))) {
  5590. this.invalidatePropertiesQueue.insert(d);
  5591. e = !1;
  5592. break
  5593. }
  5594. d = this.invalidateSizeQueue.removeLargestChild(b)
  5595. }
  5596. this.invalidateSizeQueue.isEmpty() && (this.invalidateSizeFlag = !1);
  5597. this.invalidateClientSizeFlag = this.invalidateClientPropertiesFlag = !1;
  5598. if (!a) {
  5599. for (d = this.invalidateDisplayListQueue.removeSmallestChild(b); d;) {
  5600. d.parent &&
  5601. (d.validateDisplayList(), d.updateCompletePendingFlag || (this.updateCompleteQueue.insert(d), d.updateCompletePendingFlag = !0));
  5602. if (this.invalidateClientPropertiesFlag && (d = this.invalidatePropertiesQueue.removeSmallestChild(b))) {
  5603. this.invalidatePropertiesQueue.insert(d);
  5604. e = !1;
  5605. break
  5606. }
  5607. if (this.invalidateClientSizeFlag && (d = this.invalidateSizeQueue.removeLargestChild(b))) {
  5608. this.invalidateSizeQueue.insert(d);
  5609. e = !1;
  5610. break
  5611. }
  5612. d = this.invalidateDisplayListQueue.removeSmallestChild(b)
  5613. }
  5614. this.invalidateDisplayListQueue.isEmpty() &&
  5615. (this.invalidateDisplayListFlag = !1)
  5616. }
  5617. }
  5618. if (f == Number.MAX_VALUE && (this.targetLevel = Number.MAX_VALUE, !a))
  5619. for (d = this.updateCompleteQueue.removeLargestChild(b); d;) d.initialized || (d.initialized = !0), d.hasEventListener(c.UIEvent.UPDATE_COMPLETE) && c.UIEvent.dispatchUIEvent(d, c.UIEvent.UPDATE_COMPLETE), d.updateCompletePendingFlag = !1, d = this.updateCompleteQueue.removeLargestChild(b)
  5620. };
  5621. return a
  5622. }(c.EventDispatcher);
  5623. c.LayoutManager = e
  5624. })(egret || (egret = {}));
  5625. (function(c) {
  5626. var e = function() {
  5627. function a() {
  5628. this.depthBins = [];
  5629. this.minDepth = 0;
  5630. this.maxDepth = -1
  5631. }
  5632. a.prototype.insert = function(b) {
  5633. var a = b.nestLevel,
  5634. c = b.hashCode;
  5635. this.maxDepth < this.minDepth ? this.minDepth = this.maxDepth = a : (a < this.minDepth && (this.minDepth = a), a > this.maxDepth && (this.maxDepth = a));
  5636. var e = this.depthBins[a];
  5637. e ? null == e.items[c] && (e.items[c] = b, e.length++) : (e = new d, this.depthBins[a] = e, e.items[c] = b, e.length++)
  5638. };
  5639. a.prototype.pop = function() {
  5640. var b = null;
  5641. if (this.minDepth <= this.maxDepth) {
  5642. for (var a = this.depthBins[this.maxDepth]; !a ||
  5643. 0 == a.length;) {
  5644. this.maxDepth--;
  5645. if (this.maxDepth < this.minDepth) return null;
  5646. a = this.depthBins[this.maxDepth]
  5647. }
  5648. var c = a.items,
  5649. d;
  5650. for (d in c) {
  5651. b = c[d];
  5652. this.remove(b, this.maxDepth);
  5653. break
  5654. }
  5655. for (; !a || 0 == a.length;) {
  5656. this.maxDepth--;
  5657. if (this.maxDepth < this.minDepth) break;
  5658. a = this.depthBins[this.maxDepth]
  5659. }
  5660. }
  5661. return b
  5662. };
  5663. a.prototype.shift = function() {
  5664. var b = null;
  5665. if (this.minDepth <= this.maxDepth) {
  5666. for (var a = this.depthBins[this.minDepth]; !a || 0 == a.length;) {
  5667. this.minDepth++;
  5668. if (this.minDepth > this.maxDepth) return null;
  5669. a = this.depthBins[this.minDepth]
  5670. }
  5671. var c =
  5672. a.items,
  5673. d;
  5674. for (d in c) {
  5675. b = c[d];
  5676. this.remove(b, this.minDepth);
  5677. break
  5678. }
  5679. for (; !a || 0 == a.length;) {
  5680. this.minDepth++;
  5681. if (this.minDepth > this.maxDepth) break;
  5682. a = this.depthBins[this.minDepth]
  5683. }
  5684. }
  5685. return b
  5686. };
  5687. a.prototype.removeLargestChild = function(b) {
  5688. for (var a = this.maxDepth, d = b.nestLevel, e = b.hashCode; d <= a;) {
  5689. var f = this.depthBins[a];
  5690. if (f && 0 < f.length) {
  5691. if (a == b.nestLevel) {
  5692. if (f.items[e]) return this.remove(b, a), b
  5693. } else {
  5694. var f = f.items,
  5695. g;
  5696. for (g in f) {
  5697. var k = f[g];
  5698. if (k instanceof c.DisplayObject && b instanceof c.DisplayObjectContainer &&
  5699. b.contains(k)) return this.remove(k, a), k
  5700. }
  5701. }
  5702. a--
  5703. } else if (a == this.maxDepth && this.maxDepth--, a--, a < d) break
  5704. }
  5705. return null
  5706. };
  5707. a.prototype.removeSmallestChild = function(b) {
  5708. for (var a = b.nestLevel, d = b.hashCode; a <= this.maxDepth;) {
  5709. var e = this.depthBins[a];
  5710. if (e && 0 < e.length) {
  5711. if (a == b.nestLevel) {
  5712. if (e.items[d]) return this.remove(b, a), b
  5713. } else {
  5714. var e = e.items,
  5715. f;
  5716. for (f in e) {
  5717. var g = e[f];
  5718. if (g instanceof c.DisplayObject && b instanceof c.DisplayObjectContainer && b.contains(g)) return this.remove(g, a), g
  5719. }
  5720. }
  5721. a++
  5722. } else if (a == this.minDepth && this.minDepth++,
  5723. a++, a > this.maxDepth) break
  5724. }
  5725. return null
  5726. };
  5727. a.prototype.remove = function(b, a) {
  5728. "undefined" === typeof a && (a = -1);
  5729. var c = b.hashCode,
  5730. d = this.depthBins[0 <= a ? a : b.nestLevel];
  5731. return d && null != d.items[c] ? (delete d.items[c], d.length--, b) : null
  5732. };
  5733. a.prototype.removeAll = function() {
  5734. this.minDepth = this.depthBins.length = 0;
  5735. this.maxDepth = -1
  5736. };
  5737. a.prototype.isEmpty = function() {
  5738. return this.minDepth > this.maxDepth
  5739. };
  5740. return a
  5741. }();
  5742. c.DepthQueue = e;
  5743. var d = function() {
  5744. return function() {
  5745. this.length = 0;
  5746. this.items = []
  5747. }
  5748. }();
  5749. c.DepthBin = d
  5750. })(egret || (egret = {}));
  5751. (function(c) {
  5752. var e = function() {
  5753. function d() {}
  5754. Object.defineProperty(d, "stage", {
  5755. get: function() {
  5756. return d._stage
  5757. },
  5758. enumerable: !0,
  5759. configurable: !0
  5760. });
  5761. d._initlize = function(a) {
  5762. d.initlized || (d._stage = a, d._layoutManager = new c.LayoutManager, d.initlized = !0)
  5763. };
  5764. Object.defineProperty(d, "uiStage", {
  5765. get: function() {
  5766. return d._uiStage
  5767. },
  5768. enumerable: !0,
  5769. configurable: !0
  5770. });
  5771. d.initlized = !1;
  5772. return d
  5773. }();
  5774. c.UIGlobals = e
  5775. })(egret || (egret = {}));
  5776. __extends = this.__extends || function(c, e) {
  5777. function d() {
  5778. this.constructor = c
  5779. }
  5780. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  5781. d.prototype = e.prototype;
  5782. c.prototype = new d
  5783. };
  5784. (function(c) {
  5785. var e = function(d) {
  5786. function a() {
  5787. d.call(this);
  5788. this.initializeCalled = this._initialized = this._updateCompletePendingFlag = !1;
  5789. this._nestLevel = 0;
  5790. this._enabled = !0;
  5791. this._minWidth = this._height = this._width = 0;
  5792. this._maxWidth = 1E4;
  5793. this._minHeight = 0;
  5794. this._maxHeight = 1E4;
  5795. this._measuredHeight = this._measuredWidth = 0;
  5796. this._validateNowFlag = this._invalidateDisplayListFlag = this._invalidateSizeFlag = this._invalidatePropertiesFlag = !1;
  5797. this._includeInLayout = !0;
  5798. this._layoutHeightExplicitlySet = this._layoutWidthExplicitlySet = !1;
  5799. this.touchEnabled = !0;
  5800. this.addEventListener(c.Event.ADDED_TO_STAGE, this.onAddedToStage, this);
  5801. this.addEventListener(c.Event.ADDED_TO_STAGE, this.checkInvalidateFlag, this)
  5802. }
  5803. __extends(a, d);
  5804. a.prototype.onAddedToStage = function(b) {
  5805. this.removeEventListener(c.Event.ADDED_TO_STAGE, this.onAddedToStage, this);
  5806. this._initialize();
  5807. c.UIGlobals._initlize(this.stage);
  5808. 0 < this._nestLevel && this.checkInvalidateFlag()
  5809. };
  5810. Object.defineProperty(a.prototype, "id", {
  5811. get: function() {
  5812. return this._id
  5813. },
  5814. set: function(b) {
  5815. this._id = b
  5816. },
  5817. enumerable: !0,
  5818. configurable: !0
  5819. });
  5820. Object.defineProperty(a.prototype, "isPopUp", {
  5821. get: function() {
  5822. return this._isPopUp
  5823. },
  5824. set: function(b) {
  5825. this._isPopUp = b
  5826. },
  5827. enumerable: !0,
  5828. configurable: !0
  5829. });
  5830. Object.defineProperty(a.prototype, "owner", {
  5831. get: function() {
  5832. return this._owner ? this._owner : this.parent
  5833. },
  5834. enumerable: !0,
  5835. configurable: !0
  5836. });
  5837. a.prototype.ownerChanged = function(b) {
  5838. this._owner = b
  5839. };
  5840. Object.defineProperty(a.prototype, "updateCompletePendingFlag", {
  5841. get: function() {
  5842. return this._updateCompletePendingFlag
  5843. },
  5844. set: function(b) {
  5845. this._updateCompletePendingFlag =
  5846. b
  5847. },
  5848. enumerable: !0,
  5849. configurable: !0
  5850. });
  5851. Object.defineProperty(a.prototype, "initialized", {
  5852. get: function() {
  5853. return this._initialized
  5854. },
  5855. set: function(b) {
  5856. this._initialized != b && (this._initialized = b) && c.UIEvent.dispatchUIEvent(this, c.UIEvent.CREATION_COMPLETE)
  5857. },
  5858. enumerable: !0,
  5859. configurable: !0
  5860. });
  5861. a.prototype._initialize = function() {
  5862. this.initializeCalled || (c.UIGlobals.stage && this.removeEventListener(c.Event.ADDED_TO_STAGE, this.onAddedToStage, this), this.initializeCalled = !0, c.UIEvent.dispatchUIEvent(this, c.UIEvent.INITIALIZE),
  5863. this.createChildren(), this.childrenCreated())
  5864. };
  5865. a.prototype.createChildren = function() {};
  5866. a.prototype.childrenCreated = function() {
  5867. this.invalidateProperties();
  5868. this.invalidateSize();
  5869. this.invalidateDisplayList()
  5870. };
  5871. Object.defineProperty(a.prototype, "nestLevel", {
  5872. get: function() {
  5873. return this._nestLevel
  5874. },
  5875. set: function(b) {
  5876. if (this._nestLevel != b)
  5877. for (this._nestLevel = b, 0 == this._nestLevel ? this.addEventListener(c.Event.ADDED_TO_STAGE, this.checkInvalidateFlag, this) : this.removeEventListener(c.Event.ADDED_TO_STAGE, this.checkInvalidateFlag,
  5878. this), b = this.numChildren - 1; 0 <= b; b--) {
  5879. var a = this.getChildAt(b);
  5880. null != a && (a.nestLevel = this._nestLevel + 1)
  5881. }
  5882. },
  5883. enumerable: !0,
  5884. configurable: !0
  5885. });
  5886. a.prototype._addToDisplayList = function(b, a) {
  5887. "undefined" === typeof a && (a = !0);
  5888. var c = this.numChildren;
  5889. b.parent == this && c--;
  5890. this._addingChild(b);
  5891. this._doAddChild(b, c, a);
  5892. this._childAdded(b);
  5893. return b
  5894. };
  5895. a.prototype._addToDisplayListAt = function(b, a, c) {
  5896. "undefined" === typeof c && (c = !0);
  5897. this._addingChild(b);
  5898. this._doAddChild(b, a, c);
  5899. this._childAdded(b);
  5900. return b
  5901. };
  5902. a.prototype._removeFromDisplayList =
  5903. function(b, a) {
  5904. "undefined" === typeof a && (a = !0);
  5905. var d = this._children.indexOf(b);
  5906. if (0 <= d) return this._doRemoveChild(d, a), this._childRemoved(b), b;
  5907. c.Logger.fatal("child\u672a\u88abaddChild\u5230\u8be5parent");
  5908. return null
  5909. };
  5910. a.prototype._removeFromDisplayListAt = function(b, a) {
  5911. "undefined" === typeof a && (a = !0);
  5912. if (0 <= b && b < this._children.length) {
  5913. var d = this._doRemoveChild(b, a);
  5914. this._childRemoved(d);
  5915. return d
  5916. }
  5917. c.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4");
  5918. return null
  5919. };
  5920. a.prototype.addChild =
  5921. function(b) {
  5922. this._addingChild(b);
  5923. d.prototype.addChild.call(this, b);
  5924. this._childAdded(b);
  5925. return b
  5926. };
  5927. a.prototype.addChildAt = function(b, a) {
  5928. this._addingChild(b);
  5929. d.prototype.addChildAt.call(this, b, a);
  5930. this._childAdded(b);
  5931. return b
  5932. };
  5933. a.prototype._addingChild = function(b) {
  5934. b && "nestLevel" in b && (b.nestLevel = this._nestLevel + 1)
  5935. };
  5936. a.prototype._childAdded = function(b) {
  5937. b instanceof a && (b._initialize(), b.checkInvalidateFlag())
  5938. };
  5939. a.prototype.removeChild = function(b) {
  5940. d.prototype.removeChild.call(this, b);
  5941. this._childRemoved(b);
  5942. return b
  5943. };
  5944. a.prototype.removeChildAt = function(b) {
  5945. b = d.prototype.removeChildAt.call(this, b);
  5946. this._childRemoved(b);
  5947. return b
  5948. };
  5949. a.prototype._childRemoved = function(b) {
  5950. b && "nestLevel" in b && (b.nestLevel = 0)
  5951. };
  5952. a.prototype.checkInvalidateFlag = function(b) {
  5953. c.UIGlobals._layoutManager && (this._invalidatePropertiesFlag && c.UIGlobals._layoutManager.invalidateProperties(this), this._invalidateSizeFlag && c.UIGlobals._layoutManager.invalidateSize(this), this._invalidateDisplayListFlag && c.UIGlobals._layoutManager.invalidateDisplayList(this),
  5954. this._validateNowFlag && (c.UIGlobals._layoutManager.validateClient(this), this._validateNowFlag = !1))
  5955. };
  5956. Object.defineProperty(a.prototype, "enabled", {
  5957. get: function() {
  5958. return this._enabled
  5959. },
  5960. set: function(b) {
  5961. this._enabled = b
  5962. },
  5963. enumerable: !0,
  5964. configurable: !0
  5965. });
  5966. a.prototype._setWidth = function(b) {
  5967. if (this._width != b || this._explicitWidth != b) d.prototype._setWidth.call(this, b), isNaN(b) ? this.invalidateSize() : this._width = b, this.invalidateProperties(), this.invalidateDisplayList(), this.invalidateParentSizeAndDisplayList()
  5968. };
  5969. Object.defineProperty(a.prototype, "width", {
  5970. get: function() {
  5971. return this._width
  5972. },
  5973. set: function(b) {
  5974. this._setWidth(b)
  5975. },
  5976. enumerable: !0,
  5977. configurable: !0
  5978. });
  5979. a.prototype._setHeight = function(b) {
  5980. if (this._height != b || this._explicitHeight != b) d.prototype._setHeight.call(this, b), isNaN(b) ? this.invalidateSize() : this._height = b, this.invalidateProperties(), this.invalidateDisplayList(), this.invalidateParentSizeAndDisplayList()
  5981. };
  5982. Object.defineProperty(a.prototype, "height", {
  5983. get: function() {
  5984. return this._height
  5985. },
  5986. set: function(b) {
  5987. this._setHeight(b)
  5988. },
  5989. enumerable: !0,
  5990. configurable: !0
  5991. });
  5992. Object.defineProperty(a.prototype, "scaleX", {
  5993. get: function() {
  5994. return this._scaleX
  5995. },
  5996. set: function(b) {
  5997. this._setScaleX(b)
  5998. },
  5999. enumerable: !0,
  6000. configurable: !0
  6001. });
  6002. a.prototype._setScaleX = function(b) {
  6003. this._scaleX != b && (this._scaleX = b, this.invalidateParentSizeAndDisplayList())
  6004. };
  6005. Object.defineProperty(a.prototype, "scaleY", {
  6006. get: function() {
  6007. return this._scaleY
  6008. },
  6009. set: function(b) {
  6010. this._setScaleY(b)
  6011. },
  6012. enumerable: !0,
  6013. configurable: !0
  6014. });
  6015. a.prototype._setScaleY = function(b) {
  6016. this._scaleY != b && (this._scaleY =
  6017. b, this.invalidateParentSizeAndDisplayList())
  6018. };
  6019. Object.defineProperty(a.prototype, "minWidth", {
  6020. get: function() {
  6021. return this._minWidth
  6022. },
  6023. set: function(b) {
  6024. this._minWidth != b && (this._minWidth = b, this.invalidateSize())
  6025. },
  6026. enumerable: !0,
  6027. configurable: !0
  6028. });
  6029. Object.defineProperty(a.prototype, "maxWidth", {
  6030. get: function() {
  6031. return this._maxWidth
  6032. },
  6033. set: function(b) {
  6034. this._maxWidth != b && (this._maxWidth = b, this.invalidateSize())
  6035. },
  6036. enumerable: !0,
  6037. configurable: !0
  6038. });
  6039. Object.defineProperty(a.prototype, "minHeight", {
  6040. get: function() {
  6041. return this._minHeight
  6042. },
  6043. set: function(b) {
  6044. this._minHeight != b && (this._minHeight = b, this.invalidateSize())
  6045. },
  6046. enumerable: !0,
  6047. configurable: !0
  6048. });
  6049. Object.defineProperty(a.prototype, "maxHeight", {
  6050. get: function() {
  6051. return this._maxHeight
  6052. },
  6053. set: function(b) {
  6054. this._maxHeight != b && (this._maxHeight = b, this.invalidateSize())
  6055. },
  6056. enumerable: !0,
  6057. configurable: !0
  6058. });
  6059. Object.defineProperty(a.prototype, "measuredWidth", {
  6060. get: function() {
  6061. return this._measuredWidth
  6062. },
  6063. set: function(b) {
  6064. this._measuredWidth = b
  6065. },
  6066. enumerable: !0,
  6067. configurable: !0
  6068. });
  6069. Object.defineProperty(a.prototype,
  6070. "measuredHeight", {
  6071. get: function() {
  6072. return this._measuredHeight
  6073. },
  6074. set: function(b) {
  6075. this._measuredHeight = b
  6076. },
  6077. enumerable: !0,
  6078. configurable: !0
  6079. });
  6080. a.prototype.setActualSize = function(b, a) {
  6081. var c = !1;
  6082. this._width != b && (this._width = b, c = !0);
  6083. this._height != a && (this._height = a, c = !0);
  6084. c && (this.invalidateDisplayList(), this.dispatchResizeEvent())
  6085. };
  6086. Object.defineProperty(a.prototype, "x", {
  6087. get: function() {
  6088. return this._x
  6089. },
  6090. set: function(b) {
  6091. this._x != b && (this._x = b, this.invalidateProperties(), this._includeInLayout && this.parent && this.parent instanceof a && this.parent._childXYChanged())
  6092. },
  6093. enumerable: !0,
  6094. configurable: !0
  6095. });
  6096. Object.defineProperty(a.prototype, "y", {
  6097. get: function() {
  6098. return this._y
  6099. },
  6100. set: function(b) {
  6101. this._y != b && (this._y = b, this.invalidateProperties(), this._includeInLayout && this.parent && this.parent instanceof a && this.parent._childXYChanged())
  6102. },
  6103. enumerable: !0,
  6104. configurable: !0
  6105. });
  6106. a.prototype.invalidateProperties = function() {
  6107. this._invalidatePropertiesFlag || (this._invalidatePropertiesFlag = !0, this.parent && c.UIGlobals._layoutManager && c.UIGlobals._layoutManager.invalidateProperties(this))
  6108. };
  6109. a.prototype.validateProperties = function() {
  6110. this._invalidatePropertiesFlag && (this.commitProperties(), this._invalidatePropertiesFlag = !1)
  6111. };
  6112. a.prototype.invalidateSize = function() {
  6113. this._invalidateSizeFlag || (this._invalidateSizeFlag = !0, this.parent && c.UIGlobals._layoutManager && c.UIGlobals._layoutManager.invalidateSize(this))
  6114. };
  6115. a.prototype.validateSize = function(b) {
  6116. "undefined" === typeof b && (b = !1);
  6117. if (b)
  6118. for (b = 0; b < this.numChildren; b++) {
  6119. var a = this.getChildAt(b);
  6120. "validateSize" in a && a.validateSize(!0)
  6121. }
  6122. this._invalidateSizeFlag &&
  6123. (this.measureSizes() && (this.invalidateDisplayList(), this.invalidateParentSizeAndDisplayList()), this._invalidateSizeFlag = !1)
  6124. };
  6125. a.prototype.measureSizes = function() {
  6126. var b = !1;
  6127. if (!this._invalidateSizeFlag) return b;
  6128. this.canSkipMeasurement() || (this.measure(), this.measuredWidth < this.minWidth && (this.measuredWidth = this.minWidth), this.measuredWidth > this.maxWidth && (this.measuredWidth = this.maxWidth), this.measuredHeight < this.minHeight && (this.measuredHeight = this.minHeight), this.measuredHeight > this.maxHeight && (this.measuredHeight =
  6129. this.maxHeight));
  6130. if (isNaN(this._oldPreferWidth)) this._oldPreferWidth = this.preferredWidth, this._oldPreferHeight = this.preferredHeight, b = !0;
  6131. else {
  6132. if (this.preferredWidth != this._oldPreferWidth || this.preferredHeight != this._oldPreferHeight) b = !0;
  6133. this._oldPreferWidth = this.preferredWidth;
  6134. this._oldPreferHeight = this.preferredHeight
  6135. }
  6136. return b
  6137. };
  6138. a.prototype.invalidateDisplayList = function() {
  6139. this._invalidateDisplayListFlag || (this._invalidateDisplayListFlag = !0, this.parent && c.UIGlobals._layoutManager && c.UIGlobals._layoutManager.invalidateDisplayList(this))
  6140. };
  6141. a.prototype.validateDisplayList = function() {
  6142. if (this._invalidateDisplayListFlag) {
  6143. var b = 0,
  6144. a = 0,
  6145. b = this._layoutWidthExplicitlySet ? this._width : isNaN(this.explicitWidth) ? this.measuredWidth : this._explicitWidth,
  6146. a = this._layoutHeightExplicitlySet ? this._height : isNaN(this.explicitHeight) ? this.measuredHeight : this._explicitHeight;
  6147. isNaN(b) && (b = 0);
  6148. isNaN(a) && (a = 0);
  6149. this.setActualSize(b, a);
  6150. this.updateDisplayList(b, a);
  6151. this._invalidateDisplayListFlag = !1
  6152. }
  6153. };
  6154. a.prototype.validateNow = function(b) {
  6155. "undefined" === typeof b && (b = !1);
  6156. this._validateNowFlag || null == c.UIGlobals._layoutManager ? this._validateNowFlag = !0 : c.UIGlobals._layoutManager.validateClient(this, b)
  6157. };
  6158. a.prototype.invalidateParentSizeAndDisplayList = function() {
  6159. if (this.parent && this._includeInLayout && "invalidateSize" in this.parent) {
  6160. var b = this.parent;
  6161. b.invalidateSize();
  6162. b.invalidateDisplayList()
  6163. }
  6164. };
  6165. a.prototype.updateDisplayList = function(b, a) {};
  6166. a.prototype.canSkipMeasurement = function() {
  6167. return !isNaN(this._explicitWidth) && !isNaN(this._explicitHeight)
  6168. };
  6169. a.prototype.commitProperties =
  6170. function() {
  6171. this.oldWidth == this._width && this.oldHeight == this._height || this.dispatchResizeEvent();
  6172. this.oldX == this.x && this.oldY == this.y || this.dispatchMoveEvent()
  6173. };
  6174. a.prototype.measure = function() {
  6175. this._measuredWidth = this._measuredHeight = 0
  6176. };
  6177. a.prototype.dispatchMoveEvent = function() {
  6178. this.hasEventListener(c.MoveEvent.MOVE) && c.MoveEvent.dispatchMoveEvent(this, this.oldX, this.oldY);
  6179. this.oldX = this.x;
  6180. this.oldY = this.y
  6181. };
  6182. a.prototype._childXYChanged = function() {};
  6183. a.prototype.dispatchResizeEvent = function() {
  6184. this.hasEventListener(c.ResizeEvent.RESIZE) &&
  6185. c.ResizeEvent.dispatchResizeEvent(this, this.oldWidth, this.oldHeight);
  6186. this.oldWidth = this._width;
  6187. this.oldHeight = this._height
  6188. };
  6189. Object.defineProperty(a.prototype, "includeInLayout", {
  6190. get: function() {
  6191. return this._includeInLayout
  6192. },
  6193. set: function(b) {
  6194. this._includeInLayout != b && (this._includeInLayout = !0, this.invalidateParentSizeAndDisplayList(), this._includeInLayout = b)
  6195. },
  6196. enumerable: !0,
  6197. configurable: !0
  6198. });
  6199. Object.defineProperty(a.prototype, "left", {
  6200. get: function() {
  6201. return this._left
  6202. },
  6203. set: function(b) {
  6204. this._left != b && (this._left =
  6205. b, this.invalidateParentSizeAndDisplayList())
  6206. },
  6207. enumerable: !0,
  6208. configurable: !0
  6209. });
  6210. Object.defineProperty(a.prototype, "right", {
  6211. get: function() {
  6212. return this._right
  6213. },
  6214. set: function(b) {
  6215. this._right != b && (this._right = b, this.invalidateParentSizeAndDisplayList())
  6216. },
  6217. enumerable: !0,
  6218. configurable: !0
  6219. });
  6220. Object.defineProperty(a.prototype, "top", {
  6221. get: function() {
  6222. return this._top
  6223. },
  6224. set: function(b) {
  6225. this._top != b && (this._top = b, this.invalidateParentSizeAndDisplayList())
  6226. },
  6227. enumerable: !0,
  6228. configurable: !0
  6229. });
  6230. Object.defineProperty(a.prototype,
  6231. "bottom", {
  6232. get: function() {
  6233. return this._bottom
  6234. },
  6235. set: function(b) {
  6236. this._bottom != b && (this._bottom = b, this.invalidateParentSizeAndDisplayList())
  6237. },
  6238. enumerable: !0,
  6239. configurable: !0
  6240. });
  6241. Object.defineProperty(a.prototype, "horizontalCenter", {
  6242. get: function() {
  6243. return this._horizontalCenter
  6244. },
  6245. set: function(b) {
  6246. this._horizontalCenter != b && (this._horizontalCenter = b, this.invalidateParentSizeAndDisplayList())
  6247. },
  6248. enumerable: !0,
  6249. configurable: !0
  6250. });
  6251. Object.defineProperty(a.prototype, "verticalCenter", {
  6252. get: function() {
  6253. return this._verticalCenter
  6254. },
  6255. set: function(b) {
  6256. this._verticalCenter != b && (this._verticalCenter = b, this.invalidateParentSizeAndDisplayList())
  6257. },
  6258. enumerable: !0,
  6259. configurable: !0
  6260. });
  6261. Object.defineProperty(a.prototype, "percentWidth", {
  6262. get: function() {
  6263. return this._percentWidth
  6264. },
  6265. set: function(b) {
  6266. this._percentWidth != b && (this._percentWidth = b, this.invalidateParentSizeAndDisplayList())
  6267. },
  6268. enumerable: !0,
  6269. configurable: !0
  6270. });
  6271. Object.defineProperty(a.prototype, "percentHeight", {
  6272. get: function() {
  6273. return this._percentHeight
  6274. },
  6275. set: function(b) {
  6276. this._percentHeight !=
  6277. b && (this._percentHeight = b, this.invalidateParentSizeAndDisplayList())
  6278. },
  6279. enumerable: !0,
  6280. configurable: !0
  6281. });
  6282. a.prototype.setLayoutBoundsSize = function(b, a) {
  6283. isNaN(b) ? (this._layoutWidthExplicitlySet = !1, b = this.preferredWidth) : this._layoutWidthExplicitlySet = !0;
  6284. isNaN(a) ? (this._layoutHeightExplicitlySet = !1, a = this.preferredHeight) : this._layoutHeightExplicitlySet = !0;
  6285. this.setActualSize(b / this._scaleX, a / this._scaleY)
  6286. };
  6287. a.prototype.setLayoutBoundsPosition = function(b, a) {
  6288. 0 > this._scaleX && (b += this.layoutBoundsWidth);
  6289. 0 > this._scaleY &&
  6290. (a += this.layoutBoundsHeight);
  6291. var c = !1;
  6292. this._x != b && (this._x = b, c = !0);
  6293. this._y != a && (this._y = a, c = !0);
  6294. c && this.dispatchMoveEvent()
  6295. };
  6296. Object.defineProperty(a.prototype, "preferredWidth", {
  6297. get: function() {
  6298. var b = this._hasWidthSet ? this._explicitWidth : this._measuredWidth,
  6299. a = this._scaleX;
  6300. 0 > a && (a = -a);
  6301. return b * a
  6302. },
  6303. enumerable: !0,
  6304. configurable: !0
  6305. });
  6306. Object.defineProperty(a.prototype, "preferredHeight", {
  6307. get: function() {
  6308. var b = this._hasHeightSet ? this._explicitHeight : this._measuredHeight,
  6309. a = this._scaleY;
  6310. 0 > a && (a = -a);
  6311. return b * a
  6312. },
  6313. enumerable: !0,
  6314. configurable: !0
  6315. });
  6316. Object.defineProperty(a.prototype, "preferredX", {
  6317. get: function() {
  6318. return 0 <= this._scaleX ? this._x : this._x - this.preferredWidth
  6319. },
  6320. enumerable: !0,
  6321. configurable: !0
  6322. });
  6323. Object.defineProperty(a.prototype, "preferredY", {
  6324. get: function() {
  6325. return 0 <= this._scaleY ? this._y : this._y - this.preferredHeight
  6326. },
  6327. enumerable: !0,
  6328. configurable: !0
  6329. });
  6330. Object.defineProperty(a.prototype, "layoutBoundsX", {
  6331. get: function() {
  6332. return 0 <= this._scaleX ? this._x : this._x - this.layoutBoundsWidth
  6333. },
  6334. enumerable: !0,
  6335. configurable: !0
  6336. });
  6337. Object.defineProperty(a.prototype, "layoutBoundsY", {
  6338. get: function() {
  6339. return 0 <= this._scaleY ? this._y : this._y - this.layoutBoundsHeight
  6340. },
  6341. enumerable: !0,
  6342. configurable: !0
  6343. });
  6344. Object.defineProperty(a.prototype, "layoutBoundsWidth", {
  6345. get: function() {
  6346. var b = 0,
  6347. b = this._layoutWidthExplicitlySet ? this._width : this._hasWidthSet ? this._explicitWidth : this._measuredWidth,
  6348. a = this._scaleX;
  6349. 0 > a && (a = -a);
  6350. return b * a
  6351. },
  6352. enumerable: !0,
  6353. configurable: !0
  6354. });
  6355. Object.defineProperty(a.prototype, "layoutBoundsHeight", {
  6356. get: function() {
  6357. var b = 0,
  6358. b = this._layoutHeightExplicitlySet ?
  6359. this._height : this._hasHeightSet ? this._explicitHeight : this._measuredHeight,
  6360. a = this.scaleY;
  6361. 0 > a && (a = -a);
  6362. return b * a
  6363. },
  6364. enumerable: !0,
  6365. configurable: !0
  6366. });
  6367. return a
  6368. }(c.DisplayObjectContainer);
  6369. c.UIComponent = e
  6370. })(egret || (egret = {}));
  6371. (function(c) {
  6372. var e = function() {
  6373. function c() {}
  6374. c.ABOVE = "above";
  6375. c.BELOW = "below";
  6376. c.CENTER = "center";
  6377. c.TOP_LEFT = "topLeft";
  6378. c.LEFT = "left";
  6379. c.RIGHT = "right";
  6380. return c
  6381. }();
  6382. c.PopUpPosition = e
  6383. })(egret || (egret = {}));
  6384. (function(c) {
  6385. var e = function() {
  6386. function c() {}
  6387. c.AUTO = "auto";
  6388. c.OFF = "off";
  6389. c.ON = "on";
  6390. return c
  6391. }();
  6392. c.ScrollPolicy = e
  6393. })(egret || (egret = {}));
  6394. __extends = this.__extends || function(c, e) {
  6395. function d() {
  6396. this.constructor = c
  6397. }
  6398. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  6399. d.prototype = e.prototype;
  6400. c.prototype = new d
  6401. };
  6402. (function(c) {
  6403. var e = function(c) {
  6404. function a(b) {
  6405. "undefined" === typeof b && (b = null);
  6406. c.call(this);
  6407. this.generator = b
  6408. }
  6409. __extends(a, c);
  6410. a.prototype.newInstance = function() {
  6411. return new this.generator
  6412. };
  6413. return a
  6414. }(c.HashObject);
  6415. c.ClassFactory = e
  6416. })(egret || (egret = {}));
  6417. __extends = this.__extends || function(c, e) {
  6418. function d() {
  6419. this.constructor = c
  6420. }
  6421. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  6422. d.prototype = e.prototype;
  6423. c.prototype = new d
  6424. };
  6425. (function(c) {
  6426. var e = function(c) {
  6427. function a() {
  6428. c.call(this)
  6429. }
  6430. __extends(a, c);
  6431. a.prototype.initialize = function(b) {};
  6432. a.prototype.apply = function(b) {};
  6433. a.prototype.remove = function(b) {};
  6434. a.prototype.initializeFromObject = function(b) {
  6435. for (var a in b) this[a] = b[a];
  6436. return this
  6437. };
  6438. return a
  6439. }(c.HashObject);
  6440. c.OverrideBase = e
  6441. })(egret || (egret = {}));
  6442. __extends = this.__extends || function(c, e) {
  6443. function d() {
  6444. this.constructor = c
  6445. }
  6446. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  6447. d.prototype = e.prototype;
  6448. c.prototype = new d
  6449. };
  6450. (function(c) {
  6451. var e = function(d) {
  6452. function a(b, c, e, m) {
  6453. d.call(this);
  6454. this.propertyName = "";
  6455. this.position = a.LAST;
  6456. this.target = b;
  6457. this.propertyName = c;
  6458. this.position = e;
  6459. this.relativeTo = m
  6460. }
  6461. __extends(a, d);
  6462. a.prototype.initialize = function(b) {
  6463. if ((b = b[this.target]) && !(b instanceof c.SkinnableComponent) && "_initialize" in b) try {
  6464. b._initialize()
  6465. } catch (a) {}
  6466. };
  6467. a.prototype.apply = function(b) {
  6468. var c, d;
  6469. try {
  6470. d = b[this.relativeTo]
  6471. } catch (e) {}
  6472. var f = b[this.target];
  6473. b = this.propertyName ? b[this.propertyName] : b;
  6474. if (f && b) {
  6475. switch (this.position) {
  6476. case a.FIRST:
  6477. c =
  6478. 0;
  6479. break;
  6480. case a.LAST:
  6481. c = -1;
  6482. break;
  6483. case a.BEFORE:
  6484. c = b.getElementIndex(d);
  6485. break;
  6486. case a.AFTER:
  6487. c = b.getElementIndex(d) + 1
  6488. } - 1 == c && (c = b.numElements);
  6489. b.addElementAt(f, c)
  6490. }
  6491. };
  6492. a.prototype.remove = function(b) {
  6493. var a = null == this.propertyName || "" == this.propertyName ? b : b[this.propertyName];
  6494. (b = b[this.target]) && a && -1 != a.getElementIndex(b) && a.removeElement(b)
  6495. };
  6496. a.FIRST = "first";
  6497. a.LAST = "last";
  6498. a.BEFORE = "before";
  6499. a.AFTER = "after";
  6500. return a
  6501. }(c.OverrideBase);
  6502. c.AddItems = e
  6503. })(egret || (egret = {}));
  6504. __extends = this.__extends || function(c, e) {
  6505. function d() {
  6506. this.constructor = c
  6507. }
  6508. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  6509. d.prototype = e.prototype;
  6510. c.prototype = new d
  6511. };
  6512. (function(c) {
  6513. var e = function(c) {
  6514. function a(b, a, e) {
  6515. c.call(this);
  6516. this.target = b;
  6517. this.name = a;
  6518. this.value = e
  6519. }
  6520. __extends(a, c);
  6521. a.prototype.apply = function(b) {
  6522. b = null == this.target || "" == this.target ? b : b[this.target];
  6523. null != b && (this.oldValue = b[this.name], this.setPropertyValue(b, this.name, this.value, this.oldValue))
  6524. };
  6525. a.prototype.remove = function(b) {
  6526. b = null == this.target || "" == this.target ? b : b[this.target];
  6527. null != b && (this.setPropertyValue(b, this.name, this.oldValue, this.oldValue), this.oldValue = null)
  6528. };
  6529. a.prototype.setPropertyValue =
  6530. function(b, a, c, d) {
  6531. b[a] = void 0 === c || null === c ? c : "boolean" == typeof d ? this.toBoolean(c) : c
  6532. };
  6533. a.prototype.toBoolean = function(b) {
  6534. return "string" == typeof b ? "true" == b.toLowerCase() : !1 != b
  6535. };
  6536. return a
  6537. }(c.OverrideBase);
  6538. c.SetProperty = e
  6539. })(egret || (egret = {}));
  6540. __extends = this.__extends || function(c, e) {
  6541. function d() {
  6542. this.constructor = c
  6543. }
  6544. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  6545. d.prototype = e.prototype;
  6546. c.prototype = new d
  6547. };
  6548. (function(c) {
  6549. var e = function(c) {
  6550. function a(b, a) {
  6551. c.call(this);
  6552. this.initialized = !1;
  6553. this.name = b;
  6554. this.overrides = a
  6555. }
  6556. __extends(a, c);
  6557. a.prototype.initialize = function(b) {
  6558. if (!this.initialized) {
  6559. this.initialized = !0;
  6560. for (var a = 0; a < this.overrides.length; a++) this.overrides[a].initialize(b)
  6561. }
  6562. };
  6563. return a
  6564. }(c.HashObject);
  6565. c.State = e
  6566. })(egret || (egret = {}));
  6567. (function(c) {
  6568. var e = function() {
  6569. function c() {}
  6570. c.adjustRelativeByXY = function(a, b) {
  6571. "undefined" === typeof b && (b = null);
  6572. if (a && (b || (b = a.parent), b)) {
  6573. var c = a.x,
  6574. d = a.y,
  6575. e = a.layoutBoundsHeight,
  6576. f = a.layoutBoundsWidth,
  6577. g = b.width,
  6578. k = b.height;
  6579. isNaN(a.left) || (a.left = c);
  6580. isNaN(a.right) || (a.right = g - c - f);
  6581. isNaN(a.horizontalCenter) || (a.horizontalCenter = c + 0.5 * f - 0.5 * g);
  6582. isNaN(a.top) || (a.top = d);
  6583. isNaN(a.bottom) || (a.bottom = k - d - e);
  6584. isNaN(a.verticalCenter) || (a.verticalCenter = 0.5 * e - 0.5 * k + d)
  6585. }
  6586. };
  6587. return c
  6588. }();
  6589. c.LayoutUtil = e
  6590. })(egret || (egret = {}));
  6591. __extends = this.__extends || function(c, e) {
  6592. function d() {
  6593. this.constructor = c
  6594. }
  6595. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  6596. d.prototype = e.prototype;
  6597. c.prototype = new d
  6598. };
  6599. (function(c) {
  6600. var e = function(d) {
  6601. function a(b, a) {
  6602. "undefined" === typeof a && (a = !0);
  6603. d.call(this);
  6604. this.fillMode = "scale";
  6605. this.contentReused = this.createChildrenCalled = this.sourceChanged = !1;
  6606. this.autoScale = !0;
  6607. this.touchChildren = !1;
  6608. b && (this.source = b);
  6609. this.autoScale = a
  6610. }
  6611. __extends(a, d);
  6612. Object.defineProperty(a.prototype, "source", {
  6613. get: function() {
  6614. return this._source
  6615. },
  6616. set: function(b) {
  6617. this._source != b && (this._source = b, this.createChildrenCalled ? this.parseSource() : this.sourceChanged = !0)
  6618. },
  6619. enumerable: !0,
  6620. configurable: !0
  6621. });
  6622. Object.defineProperty(a.prototype, "content", {
  6623. get: function() {
  6624. return this._content
  6625. },
  6626. enumerable: !0,
  6627. configurable: !0
  6628. });
  6629. a.prototype.createChildren = function() {
  6630. d.prototype.createChildren.call(this);
  6631. this.sourceChanged && this.parseSource();
  6632. this.createChildrenCalled = !0
  6633. };
  6634. a.prototype.parseSource = function() {
  6635. this.sourceChanged = !1;
  6636. var b = a.assetAdapter;
  6637. b || (b = this.getAdapter());
  6638. if (this._source) {
  6639. var c = this.contentReused ? null : this._content;
  6640. this.contentReused = !0;
  6641. b.getAsset(this._source, this.contentChanged, this, c)
  6642. } else this.contentChanged(null,
  6643. null)
  6644. };
  6645. a.prototype.getAdapter = function() {
  6646. var b;
  6647. try {
  6648. b = c.Injector.getInstance("egret.IAssetAdapter")
  6649. } catch (d) {
  6650. b = new c.DefaultAssetAdapter
  6651. }
  6652. return a.assetAdapter = b
  6653. };
  6654. a.prototype.contentChanged = function(b, a) {
  6655. if (a === this._source) {
  6656. var d = this._content;
  6657. this._content = b;
  6658. d !== b && (d instanceof c.DisplayObject && this._removeFromDisplayList(d), b instanceof c.DisplayObject && this._addToDisplayListAt(b, 0));
  6659. b instanceof c.Texture && b.scale9Grid instanceof c.Rectangle && (this.scale9Grid = b.scale9Grid);
  6660. this.invalidateSize();
  6661. this.invalidateDisplayList();
  6662. this.contentReused = !1;
  6663. this.hasEventListener(c.UIEvent.CONTENT_CHANGED) && c.UIEvent.dispatchUIEvent(this, c.UIEvent.CONTENT_CHANGED)
  6664. }
  6665. };
  6666. a.prototype.measure = function() {
  6667. d.prototype.measure.call(this);
  6668. var b = this._content;
  6669. b instanceof c.DisplayObject ? "preferredWidth" in b ? (this.measuredWidth = b.preferredWidth, this.measuredHeight = b.preferredHeight) : (this.measuredWidth = b.width * b.scaleX, this.measuredHeight = b.height * b.scaleY) : b instanceof c.Texture && (this.measuredWidth = b._textureWidth,
  6670. this.measuredHeight = b._textureHeight)
  6671. };
  6672. a.prototype.updateDisplayList = function(b, a) {
  6673. d.prototype.updateDisplayList.call(this, b, a);
  6674. var e = this._content;
  6675. this.autoScale && e instanceof c.DisplayObject && ("setLayoutBoundsSize" in e ? e.setLayoutBoundsSize(b, a) : (e.width = b / e.scaleX, e.height = a / e.scaleY))
  6676. };
  6677. a.prototype._render = function(b) {
  6678. if (this._content instanceof c.Texture) {
  6679. var a = this._content;
  6680. this._texture_to_render = a;
  6681. var e;
  6682. this.autoScale ? (e = this._width, a = this._height) : (e = a.textureWidth, a = a.textureHeight);
  6683. c.Bitmap._drawBitmap(b,
  6684. e, a, this)
  6685. } else this._texture_to_render = null;
  6686. d.prototype._render.call(this, b)
  6687. };
  6688. a.prototype._measureBounds = function() {
  6689. var b = d.prototype._measureBounds.call(this);
  6690. if (this._content instanceof c.Texture) {
  6691. var a = this._content,
  6692. e = this.width,
  6693. m = this.height,
  6694. f = Math.floor(a._offsetX * e / a._textureWidth),
  6695. a = Math.floor(a._offsetY * m / a._textureHeight);
  6696. f < b.x && (b.x = f);
  6697. a < b.y && (b.y = a);
  6698. f + e > b.right && (b.right = f + e);
  6699. a + m > b.bottom && (b.bottom = a + m)
  6700. }
  6701. return b
  6702. };
  6703. a.prototype.addChild = function(b) {
  6704. throw Error("addChild()" + a.errorStr + "addElement()\u4ee3\u66ff");
  6705. };
  6706. a.prototype.addChildAt = function(b, c) {
  6707. throw Error("addChildAt()" + a.errorStr + "addElementAt()\u4ee3\u66ff");
  6708. };
  6709. a.prototype.removeChild = function(b) {
  6710. throw Error("removeChild()" + a.errorStr + "removeElement()\u4ee3\u66ff");
  6711. };
  6712. a.prototype.removeChildAt = function(b) {
  6713. throw Error("removeChildAt()" + a.errorStr + "removeElementAt()\u4ee3\u66ff");
  6714. };
  6715. a.prototype.setChildIndex = function(b, c) {
  6716. throw Error("setChildIndex()" + a.errorStr + "setElementIndex()\u4ee3\u66ff");
  6717. };
  6718. a.prototype.swapChildren = function(b, c) {
  6719. throw Error("swapChildren()" +
  6720. a.errorStr + "swapElements()\u4ee3\u66ff");
  6721. };
  6722. a.prototype.swapChildrenAt = function(b, c) {
  6723. throw Error("swapChildrenAt()" + a.errorStr + "swapElementsAt()\u4ee3\u66ff");
  6724. };
  6725. a.errorStr = "\u5728\u6b64\u7ec4\u4ef6\u4e2d\u4e0d\u53ef\u7528\uff0c\u82e5\u6b64\u7ec4\u4ef6\u4e3a\u5bb9\u5668\u7c7b\uff0c\u8bf7\u4f7f\u7528";
  6726. return a
  6727. }(c.UIComponent);
  6728. c.UIAsset = e
  6729. })(egret || (egret = {}));
  6730. __extends = this.__extends || function(c, e) {
  6731. function d() {
  6732. this.constructor = c
  6733. }
  6734. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  6735. d.prototype = e.prototype;
  6736. c.prototype = new d
  6737. };
  6738. (function(c) {
  6739. var e = function(d) {
  6740. function a() {
  6741. d.call(this);
  6742. this.hostComponentKey = "egret.SkinnableComponent";
  6743. this.stateIsDirty = this.createChildrenCalled = this._skinNameExplicitlySet = !1;
  6744. this.explicitMouseEnabled = this.explicitMouseChildren = this._autoMouseEnabled = !0
  6745. }
  6746. __extends(a, d);
  6747. Object.defineProperty(a.prototype, "skinName", {
  6748. get: function() {
  6749. return this._skinName
  6750. },
  6751. set: function(b) {
  6752. this._skinName != b && (this._skinName = b, this._skinNameExplicitlySet = !0, this.createChildrenCalled && this.parseSkinName())
  6753. },
  6754. enumerable: !0,
  6755. configurable: !0
  6756. });
  6757. Object.defineProperty(a.prototype, "skin", {
  6758. get: function() {
  6759. return this._skin
  6760. },
  6761. enumerable: !0,
  6762. configurable: !0
  6763. });
  6764. a.prototype.createChildren = function() {
  6765. d.prototype.createChildren.call(this);
  6766. this.parseSkinName();
  6767. this.createChildrenCalled = !0
  6768. };
  6769. a.prototype.parseSkinName = function() {
  6770. var b = a.skinAdapter;
  6771. b || (b = this.getSkinAdapter());
  6772. var b = b.getSkin(this._skinName, this.hostComponentKey),
  6773. d = this._skin;
  6774. this.detachSkin(d);
  6775. d instanceof c.DisplayObject && this._removeFromDisplayList(d);
  6776. this._skin = b;
  6777. b instanceof
  6778. c.DisplayObject && this._addToDisplayListAt(this._skin, 0);
  6779. this.attachSkin(b);
  6780. this.invalidateSkinState();
  6781. this.invalidateSize();
  6782. this.invalidateDisplayList();
  6783. this.hasEventListener(c.UIEvent.SKIN_CHANGED) && c.UIEvent.dispatchUIEvent(this, c.UIEvent.SKIN_CHANGED)
  6784. };
  6785. a.prototype.getSkinAdapter = function() {
  6786. var b;
  6787. try {
  6788. b = c.Injector.getInstance("egret.ISkinAdapter")
  6789. } catch (d) {
  6790. b = new c.DefaultSkinAdapter
  6791. }
  6792. return a.skinAdapter = b
  6793. };
  6794. a.prototype.attachSkin = function(b) {
  6795. b && "hostComponent" in b && (b.hostComponent = this, this.findSkinParts());
  6796. b && "hostComponent" in b && b instanceof c.DisplayObject ? this._setSkinLayoutEnabled(!1) : this._setSkinLayoutEnabled(!0)
  6797. };
  6798. a.prototype.findSkinParts = function() {
  6799. var b = this._skin;
  6800. if (b && "skinParts" in b)
  6801. for (var a = b.skinParts, c = a.length, d = 0; d < c; d++) {
  6802. var e = a[d];
  6803. if (e in b) try {
  6804. this[e] = b[e], this.partAdded(e, b[e])
  6805. } catch (g) {}
  6806. }
  6807. };
  6808. a.prototype.detachSkin = function(b) {
  6809. if (b && "skinParts" in b) {
  6810. for (var a = b.skinParts, c = a.length, d = 0; d < c; d++) {
  6811. var e = a[d];
  6812. e in this && (null != this[e] && this.partRemoved(e, this[e]), this[e] = null)
  6813. }
  6814. b.hostComponent =
  6815. null
  6816. }
  6817. };
  6818. a.prototype.partAdded = function(b, a) {
  6819. c.SkinPartEvent.dispatchSkinPartEvent(this, c.SkinPartEvent.PART_ADDED, b, a)
  6820. };
  6821. a.prototype.partRemoved = function(b, a) {
  6822. c.SkinPartEvent.dispatchSkinPartEvent(this, c.SkinPartEvent.PART_REMOVED, b, a)
  6823. };
  6824. a.prototype.invalidateSkinState = function() {
  6825. this.stateIsDirty || (this.stateIsDirty = !0, this.invalidateProperties())
  6826. };
  6827. a.prototype.validateSkinState = function() {
  6828. var b = this.getCurrentSkinState(),
  6829. a = this._skin;
  6830. a && "currentState" in a && (a.currentState = b);
  6831. this.hasEventListener("stateChanged") &&
  6832. this.dispatchEventWith("stateChanged")
  6833. };
  6834. Object.defineProperty(a.prototype, "autoTouchEnabled", {
  6835. get: function() {
  6836. return this._autoMouseEnabled
  6837. },
  6838. set: function(b) {
  6839. this._autoMouseEnabled != b && ((this._autoMouseEnabled = b) ? (this._touchChildren = this.enabled ? this.explicitMouseChildren : !1, this._touchEnabled = this.enabled ? this.explicitMouseEnabled : !1) : (this._touchChildren = this.explicitMouseChildren, this._touchEnabled = this.explicitMouseEnabled))
  6840. },
  6841. enumerable: !0,
  6842. configurable: !0
  6843. });
  6844. Object.defineProperty(a.prototype, "touchChildren", {
  6845. get: function() {
  6846. return this._touchChildren
  6847. },
  6848. set: function(b) {
  6849. this.enabled && (this._touchChildren = b);
  6850. this.explicitMouseChildren = b
  6851. },
  6852. enumerable: !0,
  6853. configurable: !0
  6854. });
  6855. Object.defineProperty(a.prototype, "touchEnabled", {
  6856. get: function() {
  6857. return this._touchEnabled
  6858. },
  6859. set: function(b) {
  6860. this.enabled && (this._touchEnabled = b);
  6861. this.explicitMouseEnabled = b
  6862. },
  6863. enumerable: !0,
  6864. configurable: !0
  6865. });
  6866. Object.defineProperty(a.prototype, "enabled", {
  6867. get: function() {
  6868. return this._enabled
  6869. },
  6870. set: function(b) {
  6871. this._setEnabled(b)
  6872. },
  6873. enumerable: !0,
  6874. configurable: !0
  6875. });
  6876. a.prototype._setEnabled = function(b) {
  6877. this._enabled != b && (this._enabled = b, this._autoMouseEnabled && (this._touchChildren = b ? this.explicitMouseChildren : !1, this._touchEnabled = b ? this.explicitMouseEnabled : !1), this.invalidateSkinState())
  6878. };
  6879. a.prototype.getCurrentSkinState = function() {
  6880. return this.enabled ? "normal" : "disabled"
  6881. };
  6882. a.prototype.commitProperties = function() {
  6883. d.prototype.commitProperties.call(this);
  6884. this.stateIsDirty && (this.stateIsDirty = !1, this.validateSkinState())
  6885. };
  6886. a.prototype._setSkinLayoutEnabled = function(b) {
  6887. null !=
  6888. this.skinLayout != b && (b ? (this.skinLayout = new c.SkinBasicLayout, this.skinLayout.target = this) : this.skinLayout = this.skinLayout.target = null, this.invalidateSize(), this.invalidateDisplayList())
  6889. };
  6890. a.prototype._childXYChanged = function() {
  6891. this.skinLayout && (this.invalidateSize(), this.invalidateDisplayList())
  6892. };
  6893. a.prototype.measure = function() {
  6894. d.prototype.measure.call(this);
  6895. var b = this._skin;
  6896. if (b) {
  6897. var a = b instanceof c.DisplayObject;
  6898. a && (b && "preferredWidth" in b ? (this.measuredWidth = b.preferredWidth, this.measuredHeight =
  6899. b.preferredHeight) : (this.measuredWidth = b.width, this.measuredHeight = b.height));
  6900. this.skinLayout && this.skinLayout.measure();
  6901. if (!a) {
  6902. var a = this.measuredWidth,
  6903. e = this.measuredHeight;
  6904. try {
  6905. isNaN(b.width) || (a = Math.ceil(b.width)), isNaN(b.height) || (e = Math.ceil(b.height)), b.hasOwnProperty("minWidth") && a < b.minWidth && (a = b.minWidth), b.hasOwnProperty("maxWidth") && a > b.maxWidth && (a = b.maxWidth), b.hasOwnProperty("minHeight") && e < b.minHeight && (e = b.minHeight), b.hasOwnProperty("maxHeight") && e > b.maxHeight && (e = b.maxHeight),
  6906. this.measuredWidth = a, this.measuredHeight = e
  6907. } catch (m) {}
  6908. }
  6909. }
  6910. };
  6911. a.prototype.updateDisplayList = function(b, a) {
  6912. d.prototype.updateDisplayList.call(this, b, a);
  6913. var e = this._skin;
  6914. e && ("setLayoutBoundsSize" in e ? e.setLayoutBoundsSize(b, a) : e instanceof c.DisplayObject && (e.scaleX = 0 == e.width ? 1 : b / e.width, e.scaleY = 0 == e.height ? 1 : a / e.height));
  6915. this.skinLayout && this.skinLayout.updateDisplayList(b, a)
  6916. };
  6917. a.prototype.addChild = function(b) {
  6918. throw Error("addChild()" + a.errorStr + "addElement()\u4ee3\u66ff");
  6919. };
  6920. a.prototype.addChildAt = function(b,
  6921. c) {
  6922. throw Error("addChildAt()" + a.errorStr + "addElementAt()\u4ee3\u66ff");
  6923. };
  6924. a.prototype.removeChild = function(b) {
  6925. throw Error("removeChild()" + a.errorStr + "removeElement()\u4ee3\u66ff");
  6926. };
  6927. a.prototype.removeChildAt = function(b) {
  6928. throw Error("removeChildAt()" + a.errorStr + "removeElementAt()\u4ee3\u66ff");
  6929. };
  6930. a.prototype.setChildIndex = function(b, c) {
  6931. throw Error("setChildIndex()" + a.errorStr + "setElementIndex()\u4ee3\u66ff");
  6932. };
  6933. a.prototype.swapChildren = function(b, c) {
  6934. throw Error("swapChildren()" + a.errorStr + "swapElements()\u4ee3\u66ff");
  6935. };
  6936. a.prototype.swapChildrenAt = function(b, c) {
  6937. throw Error("swapChildrenAt()" + a.errorStr + "swapElementsAt()\u4ee3\u66ff");
  6938. };
  6939. a.errorStr = "\u5728\u6b64\u7ec4\u4ef6\u4e2d\u4e0d\u53ef\u7528\uff0c\u82e5\u6b64\u7ec4\u4ef6\u4e3a\u5bb9\u5668\u7c7b\uff0c\u8bf7\u4f7f\u7528";
  6940. return a
  6941. }(c.UIComponent);
  6942. c.SkinnableComponent = e
  6943. })(egret || (egret = {}));
  6944. (function(c) {
  6945. var e = function() {
  6946. function d() {}
  6947. d.prototype.getSkin = function(a, b) {
  6948. if (!a) return null;
  6949. if (a.prototype) return new a;
  6950. if ("string" == typeof a) {
  6951. var d = c.getDefinitionByName(a);
  6952. return d ? new d : null
  6953. }
  6954. return a
  6955. };
  6956. return d
  6957. }();
  6958. c.DefaultSkinAdapter = e
  6959. })(egret || (egret = {}));
  6960. (function(c) {
  6961. var e = function() {
  6962. function d() {}
  6963. d.prototype.getAsset = function(a, b, d, e) {
  6964. var m = a;
  6965. a.prototype && (m = new a);
  6966. if (m instanceof c.DisplayObject || m instanceof c.Texture) b.call(d, m, a);
  6967. else if ("string" == typeof a) {
  6968. var f = new c.URLLoader;
  6969. f.dataFormat = c.URLLoaderDataFormat.TEXTURE;
  6970. f.addEventListener(c.Event.COMPLETE, function(c) {
  6971. m = f.data;
  6972. b.call(d, m, a)
  6973. }, this);
  6974. f.load(new c.URLRequest(a))
  6975. } else b.call(d, m, a)
  6976. };
  6977. return d
  6978. }();
  6979. c.DefaultAssetAdapter = e
  6980. })(egret || (egret = {}));
  6981. __extends = this.__extends || function(c, e) {
  6982. function d() {
  6983. this.constructor = c
  6984. }
  6985. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  6986. d.prototype = e.prototype;
  6987. c.prototype = new d
  6988. };
  6989. (function(c) {
  6990. var e = function(c) {
  6991. function a() {
  6992. c.call(this)
  6993. }
  6994. __extends(a, c);
  6995. Object.defineProperty(a.prototype, "target", {
  6996. get: function() {
  6997. return this._target
  6998. },
  6999. set: function(b) {
  7000. this._target = b
  7001. },
  7002. enumerable: !0,
  7003. configurable: !0
  7004. });
  7005. a.prototype.measure = function() {
  7006. if (null != this.target) {
  7007. for (var b = 0, a = 0, c = this._target.skin, d = this.target.numChildren, e = 0; e < d; e++) {
  7008. var g = this.target.getChildAt(e);
  7009. if (g && g != c && g.includeInLayout) {
  7010. var k = g.horizontalCenter,
  7011. n = g.verticalCenter,
  7012. p = g.left,
  7013. q = g.right,
  7014. r = g.top,
  7015. s = g.bottom;
  7016. isNaN(p) || isNaN(q) ?
  7017. isNaN(k) ? isNaN(p) && isNaN(q) ? k = g.preferredX : (k = isNaN(p) ? 0 : p, k += isNaN(q) ? 0 : q) : k = 2 * Math.abs(k) : k = p + q;
  7018. isNaN(r) || isNaN(s) ? isNaN(n) ? isNaN(r) && isNaN(s) ? n = g.preferredY : (n = isNaN(r) ? 0 : r, n += isNaN(s) ? 0 : s) : n = 2 * Math.abs(n) : n = r + s;
  7019. s = g.preferredHeight;
  7020. b = Math.ceil(Math.max(b, k + g.preferredWidth));
  7021. a = Math.ceil(Math.max(a, n + s))
  7022. }
  7023. }
  7024. this.target.measuredWidth = Math.max(b, this.target.measuredWidth);
  7025. this.target.measuredHeight = Math.max(a, this.target.measuredHeight)
  7026. }
  7027. };
  7028. a.prototype.updateDisplayList = function(b, a) {
  7029. if (null != this.target)
  7030. for (var c =
  7031. this.target.numChildren, d = this._target.skin, e = 0; e < c; e++) {
  7032. var g = this.target.getChildAt(e);
  7033. if (null != g && g != d && g.includeInLayout) {
  7034. var k = g.horizontalCenter,
  7035. n = g.verticalCenter,
  7036. p = g.left,
  7037. q = g.right,
  7038. r = g.top,
  7039. s = g.bottom,
  7040. z = g.percentWidth,
  7041. A = g.percentHeight,
  7042. v = NaN,
  7043. B = NaN;
  7044. isNaN(p) || isNaN(q) ? isNaN(z) || (v = Math.round(b * Math.min(0.01 * z, 1))) : v = b - q - p;
  7045. isNaN(r) || isNaN(s) ? isNaN(A) || (B = Math.round(a * Math.min(0.01 * A, 1))) : B = a - s - r;
  7046. g.setLayoutBoundsSize(v, B);
  7047. z = g.layoutBoundsWidth;
  7048. A = g.layoutBoundsHeight;
  7049. B = v = NaN;
  7050. v = isNaN(k) ? isNaN(p) ?
  7051. isNaN(q) ? g.layoutBoundsX : b - z - q : p : Math.round((b - z) / 2 + k);
  7052. B = isNaN(n) ? isNaN(r) ? isNaN(s) ? g.layoutBoundsY : a - A - s : r : Math.round((a - A) / 2 + n);
  7053. g.setLayoutBoundsPosition(v, B)
  7054. }
  7055. }
  7056. };
  7057. return a
  7058. }(c.HashObject);
  7059. c.SkinBasicLayout = e
  7060. })(egret || (egret = {}));
  7061. __extends = this.__extends || function(c, e) {
  7062. function d() {
  7063. this.constructor = c
  7064. }
  7065. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  7066. d.prototype = e.prototype;
  7067. c.prototype = new d
  7068. };
  7069. (function(c) {
  7070. var e = function(d) {
  7071. function a() {
  7072. d.call(this);
  7073. this._autoRepeat = this._downEventFired = !1;
  7074. this._repeatInterval = this._repeatDelay = 35;
  7075. this._keepDown = this._hovered = !1;
  7076. this._label = "";
  7077. this.touchChildren = this._stickyHighlighting = this._mouseCaptured = !1;
  7078. this.addHandlers()
  7079. }
  7080. __extends(a, d);
  7081. Object.defineProperty(a.prototype, "autoRepeat", {
  7082. get: function() {
  7083. return this._autoRepeat
  7084. },
  7085. set: function(b) {
  7086. b != this._autoRepeat && (this._autoRepeat = b, this.checkAutoRepeatTimerConditions(this.isDown()))
  7087. },
  7088. enumerable: !0,
  7089. configurable: !0
  7090. });
  7091. Object.defineProperty(a.prototype, "repeatDelay", {
  7092. get: function() {
  7093. return this._repeatDelay
  7094. },
  7095. set: function(b) {
  7096. this._repeatDelay = b
  7097. },
  7098. enumerable: !0,
  7099. configurable: !0
  7100. });
  7101. Object.defineProperty(a.prototype, "repeatInterval", {
  7102. get: function() {
  7103. return this._repeatInterval
  7104. },
  7105. set: function(b) {
  7106. this._repeatInterval = b
  7107. },
  7108. enumerable: !0,
  7109. configurable: !0
  7110. });
  7111. Object.defineProperty(a.prototype, "hovered", {
  7112. get: function() {
  7113. return this._hovered
  7114. },
  7115. set: function(b) {
  7116. b != this._hovered && (this._hovered = b, this.invalidateSkinState(), this.checkButtonDownConditions())
  7117. },
  7118. enumerable: !0,
  7119. configurable: !0
  7120. });
  7121. a.prototype._setKeepDown = function(b) {
  7122. this._keepDown != b && (this._keepDown = b, this.invalidateSkinState())
  7123. };
  7124. Object.defineProperty(a.prototype, "label", {
  7125. get: function() {
  7126. return this._getLabel()
  7127. },
  7128. set: function(b) {
  7129. this._setLabel(b)
  7130. },
  7131. enumerable: !0,
  7132. configurable: !0
  7133. });
  7134. a.prototype._getLabel = function() {
  7135. return this.labelDisplay ? this.labelDisplay.text : this._label
  7136. };
  7137. a.prototype._setLabel = function(b) {
  7138. this._label = b;
  7139. this.labelDisplay && (this.labelDisplay.text = b)
  7140. };
  7141. Object.defineProperty(a.prototype,
  7142. "mouseCaptured", {
  7143. get: function() {
  7144. return this._mouseCaptured
  7145. },
  7146. set: function(b) {
  7147. b != this._mouseCaptured && (this._mouseCaptured = b, this.invalidateSkinState(), b || this.removeStageMouseHandlers(), this.checkButtonDownConditions())
  7148. },
  7149. enumerable: !0,
  7150. configurable: !0
  7151. });
  7152. Object.defineProperty(a.prototype, "stickyHighlighting", {
  7153. get: function() {
  7154. return this._stickyHighlighting
  7155. },
  7156. set: function(b) {
  7157. b != this._stickyHighlighting && (this._stickyHighlighting = b, this.invalidateSkinState(), this.checkButtonDownConditions())
  7158. },
  7159. enumerable: !0,
  7160. configurable: !0
  7161. });
  7162. a.prototype.checkButtonDownConditions = function() {
  7163. var b = this.isDown();
  7164. this._downEventFired != b && (b && c.UIEvent.dispatchUIEvent(this, c.UIEvent.BUTTON_DOWN), this._downEventFired = b, this.checkAutoRepeatTimerConditions(b))
  7165. };
  7166. a.prototype.addHandlers = function() {
  7167. this.addEventListener(c.TouchEvent.TOUCH_ROLL_OVER, this.mouseEventHandler, this);
  7168. this.addEventListener(c.TouchEvent.TOUCH_ROLL_OUT, this.mouseEventHandler, this);
  7169. this.addEventListener(c.TouchEvent.TOUCH_BEGIN, this.mouseEventHandler, this);
  7170. this.addEventListener(c.TouchEvent.TOUCH_END, this.mouseEventHandler, this);
  7171. this.addEventListener(c.TouchEvent.TOUCH_TAP, this.mouseEventHandler, this)
  7172. };
  7173. a.prototype.addStageMouseHandlers = function() {
  7174. c.UIGlobals.stage.addEventListener(c.TouchEvent.TOUCH_END, this.stage_mouseUpHandler, this);
  7175. c.UIGlobals.stage.addEventListener(c.Event.LEAVE_STAGE, this.stage_mouseUpHandler, this)
  7176. };
  7177. a.prototype.removeStageMouseHandlers = function() {
  7178. c.UIGlobals.stage.removeEventListener(c.TouchEvent.TOUCH_END, this.stage_mouseUpHandler,
  7179. this);
  7180. c.UIGlobals.stage.removeEventListener(c.Event.LEAVE_STAGE, this.stage_mouseUpHandler, this)
  7181. };
  7182. a.prototype.isDown = function() {
  7183. return this.enabled ? this.mouseCaptured && (this.hovered || this.stickyHighlighting) ? !0 : !1 : !1
  7184. };
  7185. a.prototype.checkAutoRepeatTimerConditions = function(b) {
  7186. b = this.autoRepeat && b;
  7187. b != (null != this.autoRepeatTimer) && (b ? this.startTimer() : this.stopTimer())
  7188. };
  7189. a.prototype.startTimer = function() {
  7190. this.autoRepeatTimer = new c.Timer(1);
  7191. this.autoRepeatTimer.delay = this._repeatDelay;
  7192. this.autoRepeatTimer.addEventListener(c.TimerEvent.TIMER,
  7193. this.autoRepeat_timerDelayHandler, this);
  7194. this.autoRepeatTimer.start()
  7195. };
  7196. a.prototype.stopTimer = function() {
  7197. this.autoRepeatTimer.stop();
  7198. this.autoRepeatTimer = null
  7199. };
  7200. a.prototype.mouseEventHandler = function(b) {
  7201. switch (b.type) {
  7202. case c.TouchEvent.TOUCH_ROLL_OVER:
  7203. if (b.touchDown && !this.mouseCaptured) break;
  7204. this.hovered = !0;
  7205. break;
  7206. case c.TouchEvent.TOUCH_ROLL_OUT:
  7207. this.hovered = !1;
  7208. break;
  7209. case c.TouchEvent.TOUCH_BEGIN:
  7210. this.addStageMouseHandlers();
  7211. c.InteractionMode.mode == c.InteractionMode.TOUCH && (this.hovered = !0);
  7212. this.mouseCaptured = !0;
  7213. break;
  7214. case c.TouchEvent.TOUCH_END:
  7215. b.target == this && (this.hovered = !0, this.mouseCaptured && (this.buttonReleased(), this.mouseCaptured = !1));
  7216. break;
  7217. case c.TouchEvent.TOUCH_TAP:
  7218. this.enabled ? this.clickHandler(b) : b.stopImmediatePropagation()
  7219. }
  7220. };
  7221. a.prototype.buttonReleased = function() {};
  7222. a.prototype.clickHandler = function(b) {};
  7223. a.prototype.stage_mouseUpHandler = function(b) {
  7224. b.target != this && (this.mouseCaptured = !1)
  7225. };
  7226. a.prototype.autoRepeat_timerDelayHandler = function(b) {
  7227. this.autoRepeatTimer.reset();
  7228. this.autoRepeatTimer.removeEventListener(c.TimerEvent.TIMER,
  7229. this.autoRepeat_timerDelayHandler, this);
  7230. this.autoRepeatTimer.delay = this._repeatInterval;
  7231. this.autoRepeatTimer.addEventListener(c.TimerEvent.TIMER, this.autoRepeat_timerHandler, this);
  7232. this.autoRepeatTimer.start()
  7233. };
  7234. a.prototype.autoRepeat_timerHandler = function(b) {
  7235. c.UIEvent.dispatchUIEvent(this, c.UIEvent.BUTTON_DOWN)
  7236. };
  7237. a.prototype.getCurrentSkinState = function() {
  7238. return this.enabled ? this.isDown() || this._keepDown ? "down" : c.InteractionMode.mode == c.InteractionMode.MOUSE && (this.hovered || this.mouseCaptured) ? "over" :
  7239. "up" : d.prototype.getCurrentSkinState.call(this)
  7240. };
  7241. a.prototype.partAdded = function(b, a) {
  7242. d.prototype.partAdded.call(this, b, a);
  7243. a == this.labelDisplay && (this.labelDisplay.text = this._label)
  7244. };
  7245. return a
  7246. }(c.SkinnableComponent);
  7247. c.ButtonBase = e
  7248. })(egret || (egret = {}));
  7249. __extends = this.__extends || function(c, e) {
  7250. function d() {
  7251. this.constructor = c
  7252. }
  7253. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  7254. d.prototype = e.prototype;
  7255. c.prototype = new d
  7256. };
  7257. (function(c) {
  7258. var e = function(d) {
  7259. function a() {
  7260. d.call(this);
  7261. this._autoSelected = !0
  7262. }
  7263. __extends(a, d);
  7264. Object.defineProperty(a.prototype, "selected", {
  7265. get: function() {
  7266. return this._selected
  7267. },
  7268. set: function(b) {
  7269. this._setSelected(b)
  7270. },
  7271. enumerable: !0,
  7272. configurable: !0
  7273. });
  7274. a.prototype._setSelected = function(b) {
  7275. b != this._selected && (this._selected = b, c.UIEvent.dispatchUIEvent(this, c.UIEvent.VALUE_COMMIT), this.invalidateSkinState())
  7276. };
  7277. a.prototype.getCurrentSkinState = function() {
  7278. return this.selected ? d.prototype.getCurrentSkinState.call(this) +
  7279. "AndSelected" : d.prototype.getCurrentSkinState.call(this)
  7280. };
  7281. a.prototype.buttonReleased = function() {
  7282. d.prototype.buttonReleased.call(this);
  7283. this._autoSelected && this.enabled && (this.selected = !this.selected, this.dispatchEventWith(c.Event.CHANGE))
  7284. };
  7285. return a
  7286. }(c.ButtonBase);
  7287. c.ToggleButtonBase = e
  7288. })(egret || (egret = {}));
  7289. __extends = this.__extends || function(c, e) {
  7290. function d() {
  7291. this.constructor = c
  7292. }
  7293. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  7294. d.prototype = e.prototype;
  7295. c.prototype = new d
  7296. };
  7297. (function(c) {
  7298. var e = function(d) {
  7299. function a() {
  7300. d.call(this);
  7301. this._fontFamily = "SimSun";
  7302. this._size = 30;
  7303. this._textAlign = c.HorizontalAlign.LEFT;
  7304. this._verticalAlign = c.VerticalAlign.TOP;
  7305. this._lineSpacing = 0;
  7306. this._textColor = 16777215;
  7307. this._text = ""
  7308. }
  7309. __extends(a, d);
  7310. Object.defineProperty(a.prototype, "fontFamily", {
  7311. get: function() {
  7312. return this._fontFamily
  7313. },
  7314. set: function(b) {
  7315. this._fontFamily != b && (this._fontFamily = b, this.fontFamilyChanged = !0, this.invalidateProperties(), this.invalidateSize(), this.invalidateDisplayList())
  7316. },
  7317. enumerable: !0,
  7318. configurable: !0
  7319. });
  7320. Object.defineProperty(a.prototype, "size", {
  7321. get: function() {
  7322. return this._size
  7323. },
  7324. set: function(b) {
  7325. this._size != b && (this._size = b, this.sizeChanged = !0, this.invalidateProperties(), this.invalidateSize(), this.invalidateDisplayList())
  7326. },
  7327. enumerable: !0,
  7328. configurable: !0
  7329. });
  7330. Object.defineProperty(a.prototype, "bold", {
  7331. get: function() {
  7332. return this._bold
  7333. },
  7334. set: function(b) {
  7335. this._bold != b && (this._bold = b, this.boldChanged = !0, this.invalidateProperties(), this.invalidateSize(), this.invalidateDisplayList())
  7336. },
  7337. enumerable: !0,
  7338. configurable: !0
  7339. });
  7340. Object.defineProperty(a.prototype, "italic", {
  7341. get: function() {
  7342. return this._italic
  7343. },
  7344. set: function(b) {
  7345. this._italic != b && (this._italic = b, this.italicChanged = !0, this.invalidateProperties(), this.invalidateSize(), this.invalidateDisplayList())
  7346. },
  7347. enumerable: !0,
  7348. configurable: !0
  7349. });
  7350. Object.defineProperty(a.prototype, "textAlign", {
  7351. get: function() {
  7352. return this._textAlign
  7353. },
  7354. set: function(b) {
  7355. this._textAlign != b && (this._textAlign = b, this.textAlignChanged = !0, this.invalidateProperties(), this.invalidateSize(),
  7356. this.invalidateDisplayList())
  7357. },
  7358. enumerable: !0,
  7359. configurable: !0
  7360. });
  7361. Object.defineProperty(a.prototype, "verticalAlign", {
  7362. get: function() {
  7363. return this._verticalAlign
  7364. },
  7365. set: function(b) {
  7366. this._verticalAlign != b && (this._verticalAlign = b, this.verticalAlignChanged = !0, this.invalidateProperties(), this.invalidateSize(), this.invalidateDisplayList())
  7367. },
  7368. enumerable: !0,
  7369. configurable: !0
  7370. });
  7371. Object.defineProperty(a.prototype, "lineSpacing", {
  7372. get: function() {
  7373. return this._lineSpacing
  7374. },
  7375. set: function(b) {
  7376. this._lineSpacing != b && (this._lineSpacing =
  7377. b, this.lineSpacingChanged = !0, this.invalidateProperties(), this.invalidateSize(), this.invalidateDisplayList())
  7378. },
  7379. enumerable: !0,
  7380. configurable: !0
  7381. });
  7382. Object.defineProperty(a.prototype, "textColor", {
  7383. get: function() {
  7384. return this._textColor
  7385. },
  7386. set: function(b) {
  7387. this._textColor != b && (this._textColor = b, this.textColorChanged = !0, this.invalidateProperties())
  7388. },
  7389. enumerable: !0,
  7390. configurable: !0
  7391. });
  7392. Object.defineProperty(a.prototype, "text", {
  7393. get: function() {
  7394. return this._text
  7395. },
  7396. set: function(b) {
  7397. b != this._text && (this._text = b, this._textChanged = !0, this.invalidateProperties(), this.invalidateSize(), this.invalidateDisplayList())
  7398. },
  7399. enumerable: !0,
  7400. configurable: !0
  7401. });
  7402. a.prototype.createChildren = function() {
  7403. d.prototype.createChildren.call(this);
  7404. this._textField || this.checkTextField()
  7405. };
  7406. a.prototype.commitProperties = function() {
  7407. d.prototype.commitProperties.call(this);
  7408. this._textField || this.checkTextField();
  7409. this.fontFamilyChanged && (this._textField.fontFamily = this._fontFamily, this.fontFamilyChanged = !1);
  7410. this.sizeChanged && (this._textField.size = this._size, this.sizeChanged = !1);
  7411. this.boldChanged && (this._textField.bold = this._bold, this.boldChanged = !1);
  7412. this.italic && (this._textField.italic = this._italic, this.italicChanged = !1);
  7413. this.textAlignChanged && (this._textField.textAlign = this._textAlign, this.textAlignChanged = !1);
  7414. this.verticalAlignChanged && (this._textField.verticalAlign = this._verticalAlign, this.verticalAlignChanged = !1);
  7415. this.lineSpacingChanged && (this._textField.lineSpacing = this._lineSpacing, this.lineSpacingChanged = !1);
  7416. this.textColorChanged && (this._textField.textColor = this._textColor,
  7417. this.textColorChanged = !1);
  7418. this._textChanged && (this._textField.text = this._text, this._textChanged = !1)
  7419. };
  7420. a.prototype.checkTextField = function() {
  7421. this._textField || (this.createTextField(), this._textField.text = this._text, this._textChanged = !0, this.invalidateProperties())
  7422. };
  7423. a.prototype.createTextField = function() {
  7424. this._textField = new c.TextField;
  7425. this._textField.fontFamily = this._fontFamily;
  7426. this._textField.size = this._size;
  7427. this._textField.textAlign = this._textAlign;
  7428. this._textField.verticalAlign = this._verticalAlign;
  7429. this._textField.lineSpacing = this._lineSpacing;
  7430. this._textField.textColor = this._textColor;
  7431. this._addToDisplayList(this._textField)
  7432. };
  7433. a.prototype.measure = function() {
  7434. d.prototype.measure.call(this);
  7435. this.measuredWidth = a.DEFAULT_MEASURED_WIDTH;
  7436. this.measuredHeight = a.DEFAULT_MEASURED_HEIGHT
  7437. };
  7438. a.prototype.$updateDisplayList = function(b, a) {
  7439. d.prototype.updateDisplayList.call(this, b, a)
  7440. };
  7441. a.prototype.updateDisplayList = function(b, a) {
  7442. d.prototype.updateDisplayList.call(this, b, a);
  7443. this._textField.width = b;
  7444. this._textField.height =
  7445. a
  7446. };
  7447. a.DEFAULT_MEASURED_WIDTH = 160;
  7448. a.DEFAULT_MEASURED_HEIGHT = 22;
  7449. return a
  7450. }(c.UIComponent);
  7451. c.TextBase = e
  7452. })(egret || (egret = {}));
  7453. __extends = this.__extends || function(c, e) {
  7454. function d() {
  7455. this.constructor = c
  7456. }
  7457. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  7458. d.prototype = e.prototype;
  7459. c.prototype = new d
  7460. };
  7461. (function(c) {
  7462. var e = function(d) {
  7463. function a() {
  7464. d.call(this);
  7465. this._contentHeight = this._contentWidth = 0;
  7466. this._clipAndEnableScrolling = !1;
  7467. this._verticalScrollPosition = this._horizontalScrollPosition = 0;
  7468. this.touchEnabled = this._layoutInvalidateSizeFlag = this._layoutInvalidateDisplayListFlag = !1
  7469. }
  7470. __extends(a, d);
  7471. a.prototype.createChildren = function() {
  7472. d.prototype.createChildren.call(this);
  7473. this._layout || (this.layout = new c.BasicLayout)
  7474. };
  7475. Object.defineProperty(a.prototype, "contentWidth", {
  7476. get: function() {
  7477. return this._contentWidth
  7478. },
  7479. enumerable: !0,
  7480. configurable: !0
  7481. });
  7482. a.prototype.setContentWidth = function(b) {
  7483. if (b != this._contentWidth) {
  7484. var a = this._contentWidth;
  7485. this._contentWidth = b;
  7486. this.hasEventListener("propertyChange") && c.PropertyChangeEvent.dispatchPropertyChangeEvent(this, c.PropertyChangeEventKind.UPDATE, "contentWidth", a, b, this)
  7487. }
  7488. };
  7489. Object.defineProperty(a.prototype, "contentHeight", {
  7490. get: function() {
  7491. return this._contentHeight
  7492. },
  7493. enumerable: !0,
  7494. configurable: !0
  7495. });
  7496. a.prototype.setContentHeight = function(b) {
  7497. if (b != this._contentHeight) {
  7498. var a = this._contentHeight;
  7499. this._contentHeight = b;
  7500. this.hasEventListener("propertyChange") && c.PropertyChangeEvent.dispatchPropertyChangeEvent(this, c.PropertyChangeEventKind.UPDATE, "contentHeight", a, b, this)
  7501. }
  7502. };
  7503. a.prototype.setContentSize = function(b, a) {
  7504. if (b != this._contentWidth || a != this._contentHeight) this.setContentWidth(b), this.setContentHeight(a)
  7505. };
  7506. Object.defineProperty(a.prototype, "layout", {
  7507. get: function() {
  7508. return this._layout
  7509. },
  7510. set: function(b) {
  7511. this._setLayout(b)
  7512. },
  7513. enumerable: !0,
  7514. configurable: !0
  7515. });
  7516. a.prototype._setLayout = function(b) {
  7517. if (this._layout !=
  7518. b) {
  7519. this._layout && (this._layout.target = null);
  7520. if (this._layout = b) this._layout.target = this;
  7521. this.invalidateSize();
  7522. this.invalidateDisplayList();
  7523. this.dispatchEventWith("layoutChanged")
  7524. }
  7525. };
  7526. Object.defineProperty(a.prototype, "clipAndEnableScrolling", {
  7527. get: function() {
  7528. return this._clipAndEnableScrolling
  7529. },
  7530. set: function(b) {
  7531. b != this._clipAndEnableScrolling && (this.scrollRect = (this._clipAndEnableScrolling = b) ? new c.Rectangle(this._horizontalScrollPosition, this._verticalScrollPosition, this.width, this.height) : null)
  7532. },
  7533. enumerable: !0,
  7534. configurable: !0
  7535. });
  7536. Object.defineProperty(a.prototype, "horizontalScrollPosition", {
  7537. get: function() {
  7538. return this._horizontalScrollPosition
  7539. },
  7540. set: function(b) {
  7541. if (b != this._horizontalScrollPosition) {
  7542. var a = this._horizontalScrollPosition;
  7543. this._horizontalScrollPosition = b;
  7544. this.scrollPositionChanged();
  7545. c.PropertyChangeEvent.dispatchPropertyChangeEvent(this, c.PropertyChangeEventKind.UPDATE, "horizontalScrollPosition", a, b, this)
  7546. }
  7547. },
  7548. enumerable: !0,
  7549. configurable: !0
  7550. });
  7551. Object.defineProperty(a.prototype, "verticalScrollPosition", {
  7552. get: function() {
  7553. return this._verticalScrollPosition
  7554. },
  7555. set: function(b) {
  7556. if (b != this._verticalScrollPosition) {
  7557. var a = this._verticalScrollPosition;
  7558. this._verticalScrollPosition = b;
  7559. this.scrollPositionChanged();
  7560. c.PropertyChangeEvent.dispatchPropertyChangeEvent(this, c.PropertyChangeEventKind.UPDATE, "verticalScrollPosition", a, b, this)
  7561. }
  7562. },
  7563. enumerable: !0,
  7564. configurable: !0
  7565. });
  7566. a.prototype.scrollPositionChanged = function() {
  7567. this._clipAndEnableScrolling && (this.updateScrollRect(this.width, this.height), this._invalidateDisplayListExceptLayout(),
  7568. this._layout && this._layout.scrollPositionChanged())
  7569. };
  7570. a.prototype.updateScrollRect = function(b, a) {
  7571. var d = this._scrollRect;
  7572. this._clipAndEnableScrolling ? d ? (d.x = this._horizontalScrollPosition, d.y = this._verticalScrollPosition, d.width = b, d.height = a) : this._scrollRect = new c.Rectangle(this._horizontalScrollPosition, this._verticalScrollPosition, b, a) : d && (this._scrollRect = null)
  7573. };
  7574. a.prototype.measure = function() {
  7575. this._layout && this._layoutInvalidateSizeFlag && (d.prototype.measure.call(this), this._layout.measure())
  7576. };
  7577. a.prototype._invalidateDisplayListExceptLayout = function() {
  7578. d.prototype.invalidateDisplayList.call(this)
  7579. };
  7580. a.prototype.invalidateDisplayList = function() {
  7581. d.prototype.invalidateDisplayList.call(this);
  7582. this._layoutInvalidateDisplayListFlag = !0
  7583. };
  7584. a.prototype._childXYChanged = function() {
  7585. this.invalidateSize();
  7586. this.invalidateDisplayList()
  7587. };
  7588. a.prototype._invalidateSizeExceptLayout = function() {
  7589. d.prototype.invalidateSize.call(this)
  7590. };
  7591. a.prototype.invalidateSize = function() {
  7592. d.prototype.invalidateSize.call(this);
  7593. this._layoutInvalidateSizeFlag = !0
  7594. };
  7595. a.prototype.updateDisplayList = function(b, a) {
  7596. d.prototype.updateDisplayList.call(this, b, a);
  7597. this._layoutInvalidateDisplayListFlag && this._layout && (this._layoutInvalidateDisplayListFlag = !1, this._layout.updateDisplayList(b, a), this.updateScrollRect(b, a))
  7598. };
  7599. Object.defineProperty(a.prototype, "numElements", {
  7600. get: function() {
  7601. return -1
  7602. },
  7603. enumerable: !0,
  7604. configurable: !0
  7605. });
  7606. a.prototype.getElementAt = function(b) {
  7607. return null
  7608. };
  7609. a.prototype.getElementIndex = function(b) {
  7610. return -1
  7611. };
  7612. a.prototype.getElementIndicesInView = function() {
  7613. var b = [],
  7614. a;
  7615. if (this.scrollRect)
  7616. for (a = 0; a < this.numChildren; a++) {
  7617. var d = this.getChildAt(a);
  7618. if (d) {
  7619. var e = new c.Rectangle;
  7620. e.x = d.layoutBoundsX;
  7621. e.y = d.layoutBoundsY;
  7622. e.width = d.layoutBoundsWidth;
  7623. e.height = d.layoutBoundsHeight;
  7624. this.scrollRect.intersects(e) && b.push(a)
  7625. }
  7626. } else
  7627. for (a = 0; a < this.numChildren; a++) b.push(a);
  7628. return b
  7629. };
  7630. a.prototype.setVirtualElementIndicesInView = function(b, a) {};
  7631. a.prototype.getVirtualElementAt = function(b) {
  7632. return this.getElementAt(b)
  7633. };
  7634. return a
  7635. }(c.UIComponent);
  7636. c.GroupBase = e
  7637. })(egret || (egret = {}));
  7638. __extends = this.__extends || function(c, e) {
  7639. function d() {
  7640. this.constructor = c
  7641. }
  7642. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  7643. d.prototype = e.prototype;
  7644. c.prototype = new d
  7645. };
  7646. (function(c) {
  7647. var e = function(c) {
  7648. function a() {
  7649. c.call(this);
  7650. this._selected = this.dataChangedFlag = !1;
  7651. this._itemIndex = -1;
  7652. this.touchChildren = !0
  7653. }
  7654. __extends(a, c);
  7655. Object.defineProperty(a.prototype, "data", {
  7656. get: function() {
  7657. return this._data
  7658. },
  7659. set: function(b) {
  7660. this._data = b;
  7661. this.initialized || this.parent ? (this.dataChangedFlag = !1, this.dataChanged()) : (this.dataChangedFlag = !0, this.invalidateProperties())
  7662. },
  7663. enumerable: !0,
  7664. configurable: !0
  7665. });
  7666. a.prototype.dataChanged = function() {};
  7667. Object.defineProperty(a.prototype, "selected", {
  7668. get: function() {
  7669. return this._selected
  7670. },
  7671. set: function(b) {
  7672. this._selected != b && (this._selected = b, this.invalidateSkinState())
  7673. },
  7674. enumerable: !0,
  7675. configurable: !0
  7676. });
  7677. Object.defineProperty(a.prototype, "itemIndex", {
  7678. get: function() {
  7679. return this._itemIndex
  7680. },
  7681. set: function(b) {
  7682. this._itemIndex = b
  7683. },
  7684. enumerable: !0,
  7685. configurable: !0
  7686. });
  7687. a.prototype.commitProperties = function() {
  7688. c.prototype.commitProperties.call(this);
  7689. this.dataChangedFlag && (this.dataChangedFlag = !1, this.dataChanged())
  7690. };
  7691. a.prototype.getCurrentSkinState = function() {
  7692. return this._selected ?
  7693. "down" : c.prototype.getCurrentSkinState.call(this)
  7694. };
  7695. return a
  7696. }(c.ButtonBase);
  7697. c.ItemRenderer = e
  7698. })(egret || (egret = {}));
  7699. __extends = this.__extends || function(c, e) {
  7700. function d() {
  7701. this.constructor = c
  7702. }
  7703. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  7704. d.prototype = e.prototype;
  7705. c.prototype = new d
  7706. };
  7707. (function(c) {
  7708. var e = function(d) {
  7709. function a() {
  7710. d.call(this);
  7711. this._indentation = 17;
  7712. this._depth = 0;
  7713. this._isOpen = this._hasChildren = !1;
  7714. this.addEventListener(c.TouchEvent.TOUCH_BEGIN, this.onItemMouseDown, this, !1, 1E3)
  7715. }
  7716. __extends(a, d);
  7717. a.prototype.onItemMouseDown = function(b) {
  7718. b.target == this.disclosureButton && b.stopImmediatePropagation()
  7719. };
  7720. Object.defineProperty(a.prototype, "indentation", {
  7721. get: function() {
  7722. return this._indentation
  7723. },
  7724. set: function(b) {
  7725. this._indentation = b
  7726. },
  7727. enumerable: !0,
  7728. configurable: !0
  7729. });
  7730. Object.defineProperty(a.prototype,
  7731. "iconSkinName", {
  7732. get: function() {
  7733. return this._iconSkinName
  7734. },
  7735. set: function(b) {
  7736. this._iconSkinName != b && (this._iconSkinName = b, this.iconDisplay && (this.iconDisplay.source = this._iconSkinName))
  7737. },
  7738. enumerable: !0,
  7739. configurable: !0
  7740. });
  7741. Object.defineProperty(a.prototype, "depth", {
  7742. get: function() {
  7743. return this._depth
  7744. },
  7745. set: function(b) {
  7746. b != this._depth && (this._depth = b, this.contentGroup && (this.contentGroup.x = this._depth * this._indentation))
  7747. },
  7748. enumerable: !0,
  7749. configurable: !0
  7750. });
  7751. Object.defineProperty(a.prototype, "hasChildren", {
  7752. get: function() {
  7753. return this._hasChildren
  7754. },
  7755. set: function(b) {
  7756. this._hasChildren != b && (this._hasChildren = b, this.disclosureButton && (this.disclosureButton.visible = this._hasChildren))
  7757. },
  7758. enumerable: !0,
  7759. configurable: !0
  7760. });
  7761. Object.defineProperty(a.prototype, "opened", {
  7762. get: function() {
  7763. return this._isOpen
  7764. },
  7765. set: function(b) {
  7766. this._isOpen != b && (this._isOpen = b, this.disclosureButton && (this.disclosureButton.selected = this._isOpen))
  7767. },
  7768. enumerable: !0,
  7769. configurable: !0
  7770. });
  7771. a.prototype.partAdded = function(b, a) {
  7772. d.prototype.partAdded.call(this, b, a);
  7773. a == this.iconDisplay ? this.iconDisplay.source =
  7774. this._iconSkinName : a == this.disclosureButton ? (this.disclosureButton.visible = this._hasChildren, this.disclosureButton.selected = this._isOpen, this.disclosureButton._autoSelected = !1, this.disclosureButton.addEventListener(c.TouchEvent.TOUCH_BEGIN, this.disclosureButton_mouseDownHandler, this)) : a == this.contentGroup && (this.contentGroup.x = this._depth * this._indentation)
  7775. };
  7776. a.prototype.partRemoved = function(b, a) {
  7777. d.prototype.partRemoved.call(this, b, a);
  7778. a == this.iconDisplay ? this.iconDisplay.source = null : a == this.disclosureButton &&
  7779. (this.disclosureButton.removeEventListener(c.TouchEvent.TOUCH_BEGIN, this.disclosureButton_mouseDownHandler, this), this.disclosureButton._autoSelected = !0, this.disclosureButton.visible = !0)
  7780. };
  7781. a.prototype.disclosureButton_mouseDownHandler = function(b) {
  7782. c.TreeEvent.dispatchTreeEvent(this, c.TreeEvent.ITEM_OPENING, this.itemIndex, this.data, this, !this._isOpen)
  7783. };
  7784. return a
  7785. }(c.ItemRenderer);
  7786. c.TreeItemRenderer = e
  7787. })(egret || (egret = {}));
  7788. (function(c) {
  7789. var e = function() {
  7790. function d(a, b) {
  7791. this.easerFunction = c.Ease.sineInOut;
  7792. this._duration = 500;
  7793. this._startDelay = 0;
  7794. this._repeatCount = 1;
  7795. this._repeatDelay = 0;
  7796. this.motionPaths = [];
  7797. this._currentValue = {};
  7798. this.pauseTime = 0;
  7799. this._isPaused = !1;
  7800. this.startTime = 0;
  7801. this._started = !1;
  7802. this.playedTimes = 0;
  7803. this.updateFunction = a;
  7804. this.thisObject = b
  7805. }
  7806. Object.defineProperty(d.prototype, "isPlaying", {
  7807. get: function() {
  7808. return this._isPlaying
  7809. },
  7810. enumerable: !0,
  7811. configurable: !0
  7812. });
  7813. Object.defineProperty(d.prototype, "duration", {
  7814. get: function() {
  7815. return this._duration
  7816. },
  7817. set: function(a) {
  7818. this._duration = a
  7819. },
  7820. enumerable: !0,
  7821. configurable: !0
  7822. });
  7823. Object.defineProperty(d.prototype, "startDelay", {
  7824. get: function() {
  7825. return this._startDelay
  7826. },
  7827. set: function(a) {
  7828. this._startDelay = a
  7829. },
  7830. enumerable: !0,
  7831. configurable: !0
  7832. });
  7833. Object.defineProperty(d.prototype, "repeatCount", {
  7834. get: function() {
  7835. return this._repeatCount
  7836. },
  7837. set: function(a) {
  7838. this._repeatCount = a
  7839. },
  7840. enumerable: !0,
  7841. configurable: !0
  7842. });
  7843. Object.defineProperty(d.prototype, "repeatDelay", {
  7844. get: function() {
  7845. return this._repeatDelay
  7846. },
  7847. set: function(a) {
  7848. this._repeatDelay =
  7849. a
  7850. },
  7851. enumerable: !0,
  7852. configurable: !0
  7853. });
  7854. Object.defineProperty(d.prototype, "currentValue", {
  7855. get: function() {
  7856. return this._currentValue
  7857. },
  7858. enumerable: !0,
  7859. configurable: !0
  7860. });
  7861. d.prototype.play = function() {
  7862. this.stopAnimation();
  7863. this.start()
  7864. };
  7865. d.prototype.seek = function(a) {
  7866. a = Math.min(a, this.duration);
  7867. this.caculateCurrentValue(a / this.duration);
  7868. this.startTime = c.getTimer() - a - this._startDelay;
  7869. null != this.updateFunction && this.updateFunction.call(this.thisObject, this)
  7870. };
  7871. d.prototype.start = function() {
  7872. this.playedTimes = 0;
  7873. this._started = !0;
  7874. this._isPlaying = !1;
  7875. this._currentValue = {};
  7876. this.caculateCurrentValue(0);
  7877. this.startTime = c.getTimer();
  7878. d.currentTime = this.startTime;
  7879. this.doInterval();
  7880. d.addAnimation(this)
  7881. };
  7882. d.prototype.end = function() {
  7883. this._started || (this.caculateCurrentValue(0), null != this.startFunction && this.startFunction.call(this.thisObject, this), null != this.updateFunction && this.updateFunction.call(this.thisObject, this));
  7884. this.caculateCurrentValue(1);
  7885. null != this.updateFunction && this.updateFunction.call(this.thisObject, this);
  7886. this.stopAnimation();
  7887. null != this.endFunction && this.endFunction.call(this.thisObject, this)
  7888. };
  7889. d.prototype.stop = function() {
  7890. this.stopAnimation();
  7891. null != this.stopFunction && this.stopFunction.call(this.thisObject, this)
  7892. };
  7893. d.prototype.stopAnimation = function() {
  7894. this.playedTimes = 0;
  7895. this._isPlaying = !1;
  7896. this.startTime = 0;
  7897. this._started = !1;
  7898. d.removeAnimation(this)
  7899. };
  7900. Object.defineProperty(d.prototype, "isPaused", {
  7901. get: function() {
  7902. return this._isPaused
  7903. },
  7904. enumerable: !0,
  7905. configurable: !0
  7906. });
  7907. d.prototype.pause = function() {
  7908. this._started && (this._isPaused = !0,
  7909. this.pauseTime = c.getTimer(), this._isPlaying = !1, d.removeAnimation(this))
  7910. };
  7911. d.prototype.resume = function() {
  7912. this._started && this._isPaused && (this._isPaused = !1, this.startTime += c.getTimer() - this.pauseTime, this.pauseTime = -1, d.addAnimation(this))
  7913. };
  7914. Object.defineProperty(d.prototype, "started", {
  7915. get: function() {
  7916. return this._started
  7917. },
  7918. enumerable: !0,
  7919. configurable: !0
  7920. });
  7921. d.prototype.doInterval = function() {
  7922. var a = d.currentTime - this.startTime - (0 < this.playedTimes ? this._repeatDelay : this._startDelay);
  7923. if (0 > a) return !1;
  7924. this._isPlaying ||
  7925. (this._isPlaying = !0, 0 == this.playedTimes && null != this.startFunction && this.startFunction.call(this.thisObject, this));
  7926. var b = 0 == this._duration ? 1 : Math.min(a, this._duration) / this._duration;
  7927. this.caculateCurrentValue(b);
  7928. null != this.updateFunction && this.updateFunction.call(this.thisObject, this);
  7929. if (a = a >= this._duration) this.playedTimes++, this._isPlaying = !1, this.startTime = d.currentTime, 0 == this._repeatCount || this.playedTimes < this._repeatCount ? a = !1 : (d.removeAnimation(this), this._started = !1, this.playedTimes = 0);
  7930. a &&
  7931. null != this.endFunction && this.endFunction.call(this.thisObject, this);
  7932. return a
  7933. };
  7934. d.prototype.caculateCurrentValue = function(a) {
  7935. this.easerFunction && (a = this.easerFunction(a));
  7936. for (var b = this.motionPaths, c = b.length, d = 0; d < c; d++) {
  7937. var e = b[d];
  7938. this.currentValue[e.prop] = e.from + (e.to - e.from) * a
  7939. }
  7940. };
  7941. d.addAnimation = function(a) {
  7942. -1 == d.activeAnimations.indexOf(a) && (d.activeAnimations.push(a), d.registered || (d.registered = !0, c.Ticker.getInstance().register(d.onEnterFrame, null)))
  7943. };
  7944. d.removeAnimation = function(a) {
  7945. a = d.activeAnimations.indexOf(a); - 1 != a && (d.activeAnimations.splice(a, 1), a <= d.currentIntervalIndex && d.currentIntervalIndex--);
  7946. 0 == d.activeAnimations.length && d.registered && (d.registered = !1, c.Ticker.getInstance().unregister(d.onEnterFrame, null))
  7947. };
  7948. d.onEnterFrame = function(a, b) {
  7949. d.currentTime = c.getTimer();
  7950. for (d.currentIntervalIndex = 0; d.currentIntervalIndex < d.activeAnimations.length;) d.activeAnimations[d.currentIntervalIndex].doInterval(), d.currentIntervalIndex++;
  7951. d.currentIntervalIndex = -1;
  7952. 0 == d.activeAnimations.length && d.registered && (d.registered = !1, c.Ticker.getInstance().unregister(d.onEnterFrame, null))
  7953. };
  7954. d.currentTime = 0;
  7955. d.TIMER_RESOLUTION = 1E3 / 60;
  7956. d.activeAnimations = [];
  7957. d.currentIntervalIndex = -1;
  7958. return d
  7959. }();
  7960. c.Animation = e
  7961. })(egret || (egret = {}));
  7962. __extends = this.__extends || function(c, e) {
  7963. function d() {
  7964. this.constructor = c
  7965. }
  7966. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  7967. d.prototype = e.prototype;
  7968. c.prototype = new d
  7969. };
  7970. (function(c) {
  7971. var e = function(c) {
  7972. function a() {
  7973. c.call(this);
  7974. this._maximum = 100;
  7975. this.maxChanged = !1;
  7976. this._minimum = 0;
  7977. this.minChanged = !1;
  7978. this._stepSize = 1;
  7979. this.stepSizeChanged = !1;
  7980. this._changedValue = this._value = 0;
  7981. this.valueChanged = !1;
  7982. this._snapInterval = 1;
  7983. this._explicitSnapInterval = this.snapIntervalChanged = !1
  7984. }
  7985. __extends(a, c);
  7986. Object.defineProperty(a.prototype, "maximum", {
  7987. get: function() {
  7988. return this._maximum
  7989. },
  7990. set: function(b) {
  7991. this._setMaximun(b)
  7992. },
  7993. enumerable: !0,
  7994. configurable: !0
  7995. });
  7996. a.prototype._setMaximun = function(b) {
  7997. b !=
  7998. this._maximum && (this._maximum = b, this.maxChanged = !0, this.invalidateProperties())
  7999. };
  8000. Object.defineProperty(a.prototype, "minimum", {
  8001. get: function() {
  8002. return this._minimum
  8003. },
  8004. set: function(b) {
  8005. this._setMinimun(b)
  8006. },
  8007. enumerable: !0,
  8008. configurable: !0
  8009. });
  8010. a.prototype._setMinimun = function(b) {
  8011. b != this._minimum && (this._minimum = b, this.minChanged = !0, this.invalidateProperties())
  8012. };
  8013. Object.defineProperty(a.prototype, "stepSize", {
  8014. get: function() {
  8015. return this._stepSize
  8016. },
  8017. set: function(b) {
  8018. b != this._stepSize && (this._stepSize = b, this.stepSizeChanged = !0, this.invalidateProperties())
  8019. },
  8020. enumerable: !0,
  8021. configurable: !0
  8022. });
  8023. Object.defineProperty(a.prototype, "value", {
  8024. get: function() {
  8025. return this._getValue()
  8026. },
  8027. set: function(b) {
  8028. this._setValue(b)
  8029. },
  8030. enumerable: !0,
  8031. configurable: !0
  8032. });
  8033. a.prototype._setValue = function(b) {
  8034. b != this.value && (this._changedValue = b, this.valueChanged = !0, this.invalidateProperties())
  8035. };
  8036. a.prototype._getValue = function() {
  8037. return this.valueChanged ? this._changedValue : this._value
  8038. };
  8039. Object.defineProperty(a.prototype, "snapInterval", {
  8040. get: function() {
  8041. return this._snapInterval
  8042. },
  8043. set: function(b) {
  8044. this._explicitSnapInterval = !0;
  8045. b != this._snapInterval && (isNaN(b) ? (this._snapInterval = 1, this._explicitSnapInterval = !1) : this._snapInterval = b, this.stepSizeChanged = this.snapIntervalChanged = !0, this.invalidateProperties())
  8046. },
  8047. enumerable: !0,
  8048. configurable: !0
  8049. });
  8050. a.prototype.commitProperties = function() {
  8051. c.prototype.commitProperties.call(this);
  8052. this.minimum > this.maximum && (this.maxChanged ? this._maximum = this._minimum : this._minimum = this._maximum);
  8053. if (this.valueChanged || this.maxChanged || this.minChanged ||
  8054. this.snapIntervalChanged) {
  8055. var b = this.valueChanged ? this._changedValue : this._value;
  8056. this.snapIntervalChanged = this.minChanged = this.maxChanged = this.valueChanged = !1;
  8057. this.setValue(this.nearestValidValue(b, this.snapInterval))
  8058. }
  8059. this.stepSizeChanged && (this._explicitSnapInterval ? this._stepSize = this.nearestValidSize(this._stepSize) : (this._snapInterval = this._stepSize, this.setValue(this.nearestValidValue(this._value, this.snapInterval))), this.stepSizeChanged = !1)
  8060. };
  8061. a.prototype.nearestValidSize = function(b) {
  8062. var a = this.snapInterval;
  8063. if (0 == a) return b;
  8064. b = Math.round(b / a) * a;
  8065. return Math.abs(b) < a ? a : b
  8066. };
  8067. a.prototype.nearestValidValue = function(b, a) {
  8068. if (0 == a) return Math.max(this.minimum, Math.min(this.maximum, b));
  8069. var c = this.maximum - this.minimum,
  8070. d = 1;
  8071. b -= this.minimum;
  8072. a != Math.round(a) && (d = (1 + a).toString().split("."), d = Math.pow(10, d[1].length), c *= d, b = Math.round(b * d), a = Math.round(a * d));
  8073. var e = Math.max(0, Math.floor(b / a) * a),
  8074. c = Math.min(c, Math.floor((b + a) / a) * a);
  8075. return (b - e >= (c - e) / 2 ? c : e) / d + this.minimum
  8076. };
  8077. a.prototype.setValue = function(b) {
  8078. this._value != b &&
  8079. (isNaN(b) && (b = 0), !isNaN(this.maximum) && !isNaN(this.minimum) && this.maximum > this.minimum ? this._value = Math.min(this.maximum, Math.max(this.minimum, b)) : this._value = b, this.valueChanged = !1)
  8080. };
  8081. a.prototype.changeValueByStep = function(b) {
  8082. "undefined" === typeof b && (b = !0);
  8083. 0 != this.stepSize && this.setValue(this.nearestValidValue(b ? this.value + this.stepSize : this.value - this.stepSize, this.snapInterval))
  8084. };
  8085. return a
  8086. }(c.SkinnableComponent);
  8087. c.Range = e
  8088. })(egret || (egret = {}));
  8089. __extends = this.__extends || function(c, e) {
  8090. function d() {
  8091. this.constructor = c
  8092. }
  8093. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  8094. d.prototype = e.prototype;
  8095. c.prototype = new d
  8096. };
  8097. (function(c) {
  8098. var e = function(d) {
  8099. function a() {
  8100. d.call(this);
  8101. this._slideDuration = 300;
  8102. this.needUpdateValue = !1;
  8103. this.addEventListener(c.Event.ADDED_TO_STAGE, this.addedToStageHandler, this);
  8104. this.addEventListener(c.TouchEvent.TOUCH_BEGIN, this.mouseDownHandler, this)
  8105. }
  8106. __extends(a, d);
  8107. Object.defineProperty(a.prototype, "slideDuration", {
  8108. get: function() {
  8109. return this._slideDuration
  8110. },
  8111. set: function(b) {
  8112. this._slideDuration = b
  8113. },
  8114. enumerable: !0,
  8115. configurable: !0
  8116. });
  8117. Object.defineProperty(a.prototype, "maximum", {
  8118. get: function() {
  8119. return this._maximum
  8120. },
  8121. set: function(b) {
  8122. b != this._maximum && (this._setMaximun(b), this.invalidateDisplayList())
  8123. },
  8124. enumerable: !0,
  8125. configurable: !0
  8126. });
  8127. Object.defineProperty(a.prototype, "minimum", {
  8128. get: function() {
  8129. return this._minimum
  8130. },
  8131. set: function(b) {
  8132. b != this._minimum && (this._setMinimun(b), this.invalidateDisplayList())
  8133. },
  8134. enumerable: !0,
  8135. configurable: !0
  8136. });
  8137. Object.defineProperty(a.prototype, "value", {
  8138. get: function() {
  8139. return this._getValue()
  8140. },
  8141. set: function(b) {
  8142. b != this._getValue() && (this._setValue(b), this.invalidateDisplayList())
  8143. },
  8144. enumerable: !0,
  8145. configurable: !0
  8146. });
  8147. a.prototype.setValue = function(b) {
  8148. d.prototype.setValue.call(this, b);
  8149. this.invalidateDisplayList()
  8150. };
  8151. a.prototype.pointToValue = function(b, a) {
  8152. return this.minimum
  8153. };
  8154. a.prototype.changeValueByStep = function(b) {
  8155. "undefined" === typeof b && (b = !0);
  8156. var a = this.value;
  8157. d.prototype.changeValueByStep.call(this, b);
  8158. this.value != a && this.dispatchEventWith(c.Event.CHANGE)
  8159. };
  8160. a.prototype.partAdded = function(b, a) {
  8161. d.prototype.partAdded.call(this, b, a);
  8162. a == this.thumb ? (this.thumb.addEventListener(c.TouchEvent.TOUCH_BEGIN,
  8163. this.thumb_mouseDownHandler, this), this.thumb.addEventListener(c.ResizeEvent.RESIZE, this.thumb_resizeHandler, this), this.thumb.addEventListener(c.UIEvent.UPDATE_COMPLETE, this.thumb_updateCompleteHandler, this), this.thumb.stickyHighlighting = !0) : a == this.track && (this.track.addEventListener(c.TouchEvent.TOUCH_BEGIN, this.track_mouseDownHandler, this), this.track.addEventListener(c.ResizeEvent.RESIZE, this.track_resizeHandler, this))
  8164. };
  8165. a.prototype.partRemoved = function(b, a) {
  8166. d.prototype.partRemoved.call(this, b, a);
  8167. a == this.thumb ? (this.thumb.removeEventListener(c.TouchEvent.TOUCH_BEGIN, this.thumb_mouseDownHandler, this), this.thumb.removeEventListener(c.ResizeEvent.RESIZE, this.thumb_resizeHandler, this), this.thumb.removeEventListener(c.UIEvent.UPDATE_COMPLETE, this.thumb_updateCompleteHandler, this)) : a == this.track && (this.track.removeEventListener(c.TouchEvent.TOUCH_BEGIN, this.track_mouseDownHandler, this), this.track.removeEventListener(c.ResizeEvent.RESIZE, this.track_resizeHandler, this))
  8168. };
  8169. a.prototype.updateDisplayList =
  8170. function(b, a) {
  8171. d.prototype.updateDisplayList.call(this, b, a);
  8172. this.updateSkinDisplayList()
  8173. };
  8174. a.prototype.updateSkinDisplayList = function() {};
  8175. a.prototype.addedToStageHandler = function(b) {
  8176. this.updateSkinDisplayList()
  8177. };
  8178. a.prototype.track_resizeHandler = function(b) {
  8179. this.updateSkinDisplayList()
  8180. };
  8181. a.prototype.thumb_resizeHandler = function(b) {
  8182. this.updateSkinDisplayList()
  8183. };
  8184. a.prototype.thumb_updateCompleteHandler = function(b) {
  8185. this.updateSkinDisplayList();
  8186. this.thumb.removeEventListener(c.UIEvent.UPDATE_COMPLETE, this.thumb_updateCompleteHandler,
  8187. this)
  8188. };
  8189. a.prototype.thumb_mouseDownHandler = function(b) {
  8190. c.UIGlobals.stage.addEventListener(c.TouchEvent.TOUCH_MOVE, this.stage_mouseMoveHandler, this);
  8191. c.UIGlobals.stage.addEventListener(c.TouchEvent.TOUCH_END, this.stage_mouseUpHandler, this);
  8192. c.UIGlobals.stage.addEventListener(c.Event.LEAVE_STAGE, this.stage_mouseUpHandler, this);
  8193. this.addEventListener(c.Event.ENTER_FRAME, this.onEnterFrame, this);
  8194. b = this.thumb.globalToLocal(b.stageX, b.stageY, c.Point.identity);
  8195. this._clickOffsetX = b.x;
  8196. this._clickOffsetY = b.y;
  8197. c.TrackBaseEvent.dispatchTrackBaseEvent(this,
  8198. c.TrackBaseEvent.THUMB_PRESS);
  8199. c.UIEvent.dispatchUIEvent(this, c.UIEvent.CHANGE_START)
  8200. };
  8201. a.prototype.onEnterFrame = function(b) {
  8202. this.needUpdateValue && this.track && (this.updateWhenMouseMove(), this.needUpdateValue = !1)
  8203. };
  8204. a.prototype.updateWhenMouseMove = function() {
  8205. if (this.track) {
  8206. var b = this.track.globalToLocal(this._moveStageX, this._moveStageY, c.Point.identity),
  8207. b = this.pointToValue(b.x - this._clickOffsetX, b.y - this._clickOffsetY),
  8208. b = this.nearestValidValue(b, this.snapInterval);
  8209. b != this.value && (this.setValue(b), this.validateDisplayList(),
  8210. c.TrackBaseEvent.dispatchTrackBaseEvent(this, c.TrackBaseEvent.THUMB_DRAG), this.dispatchEventWith(c.Event.CHANGE))
  8211. }
  8212. };
  8213. a.prototype.stage_mouseMoveHandler = function(b) {
  8214. this._moveStageX = b.stageX;
  8215. this._moveStageY = b.stageY;
  8216. this.needUpdateValue || (this.needUpdateValue = !0)
  8217. };
  8218. a.prototype.stage_mouseUpHandler = function(b) {
  8219. c.UIGlobals.stage.removeEventListener(c.TouchEvent.TOUCH_MOVE, this.stage_mouseMoveHandler, this);
  8220. c.UIGlobals.stage.removeEventListener(c.TouchEvent.TOUCH_END, this.stage_mouseUpHandler, this);
  8221. c.UIGlobals.stage.removeEventListener(c.Event.LEAVE_STAGE,
  8222. this.stage_mouseUpHandler, this);
  8223. this.removeEventListener(c.Event.ENTER_FRAME, this.updateWhenMouseMove, this);
  8224. this.needUpdateValue && (this.updateWhenMouseMove(), this.needUpdateValue = !1);
  8225. c.TrackBaseEvent.dispatchTrackBaseEvent(this, c.TrackBaseEvent.THUMB_RELEASE);
  8226. c.UIEvent.dispatchUIEvent(this, c.UIEvent.CHANGE_END)
  8227. };
  8228. a.prototype.track_mouseDownHandler = function(b) {};
  8229. a.prototype.mouseDownHandler = function(b) {
  8230. c.UIGlobals.stage.addEventListener(c.TouchEvent.TOUCH_END, this.stage_mouseUpSomewhereHandler, this);
  8231. c.UIGlobals.stage.addEventListener(c.Event.LEAVE_STAGE, this.stage_mouseUpSomewhereHandler, this);
  8232. this.mouseDownTarget = b.target
  8233. };
  8234. a.prototype.stage_mouseUpSomewhereHandler = function(b) {
  8235. c.UIGlobals.stage.removeEventListener(c.TouchEvent.TOUCH_END, this.stage_mouseUpSomewhereHandler, this);
  8236. c.UIGlobals.stage.removeEventListener(c.Event.LEAVE_STAGE, this.stage_mouseUpSomewhereHandler, this);
  8237. if (this.mouseDownTarget != b.target && b instanceof c.TouchEvent && this.contains(b.target)) {
  8238. var a = b.target.localToGlobal(b.localX,
  8239. b.localY);
  8240. c.TouchEvent.dispatchTouchEvent(this, c.TouchEvent.TOUCH_TAP, b.touchPointID, a.x, a.y, b.ctrlKey, b.altKey, b.shiftKey, b.touchDown)
  8241. }
  8242. this.mouseDownTarget = null
  8243. };
  8244. return a
  8245. }(c.Range);
  8246. c.TrackBase = e
  8247. })(egret || (egret = {}));
  8248. __extends = this.__extends || function(c, e) {
  8249. function d() {
  8250. this.constructor = c
  8251. }
  8252. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  8253. d.prototype = e.prototype;
  8254. c.prototype = new d
  8255. };
  8256. (function(c) {
  8257. var e = function(d) {
  8258. function a() {
  8259. d.call(this);
  8260. this._showTrackHighlight = !0;
  8261. this._pendingValue = 0;
  8262. this._liveDragging = !0;
  8263. this.maximum = 10
  8264. }
  8265. __extends(a, d);
  8266. Object.defineProperty(a.prototype, "showTrackHighlight", {
  8267. get: function() {
  8268. return this._showTrackHighlight
  8269. },
  8270. set: function(b) {
  8271. this._showTrackHighlight != b && (this._showTrackHighlight = b, this.trackHighlight && (this.trackHighlight.visible = b), this.invalidateDisplayList())
  8272. },
  8273. enumerable: !0,
  8274. configurable: !0
  8275. });
  8276. Object.defineProperty(a.prototype, "pendingValue", {
  8277. get: function() {
  8278. return this._pendingValue
  8279. },
  8280. set: function(b) {
  8281. b != this._pendingValue && (this._pendingValue = b, this.invalidateDisplayList())
  8282. },
  8283. enumerable: !0,
  8284. configurable: !0
  8285. });
  8286. a.prototype.setValue = function(b) {
  8287. this._pendingValue = b;
  8288. d.prototype.setValue.call(this, b)
  8289. };
  8290. a.prototype.animationUpdateHandler = function(b) {
  8291. this.pendingValue = b.currentValue.value
  8292. };
  8293. a.prototype.animationEndHandler = function(b) {
  8294. this.setValue(this.slideToValue);
  8295. this.dispatchEventWith(c.Event.CHANGE);
  8296. c.UIEvent.dispatchUIEvent(this, c.UIEvent.CHANGE_END)
  8297. };
  8298. a.prototype.stopAnimation = function() {
  8299. this.animator.stop();
  8300. this.setValue(this.nearestValidValue(this.pendingValue, this.snapInterval));
  8301. this.dispatchEventWith(c.Event.CHANGE);
  8302. c.UIEvent.dispatchUIEvent(this, c.UIEvent.CHANGE_END)
  8303. };
  8304. a.prototype.thumb_mouseDownHandler = function(b) {
  8305. this.animator && this.animator.isPlaying && this.stopAnimation();
  8306. d.prototype.thumb_mouseDownHandler.call(this, b)
  8307. };
  8308. Object.defineProperty(a.prototype, "liveDragging", {
  8309. get: function() {
  8310. return this._liveDragging
  8311. },
  8312. set: function(b) {
  8313. this._liveDragging =
  8314. b
  8315. },
  8316. enumerable: !0,
  8317. configurable: !0
  8318. });
  8319. a.prototype.updateWhenMouseMove = function() {
  8320. if (this.track) {
  8321. var b = this.track.globalToLocal(this._moveStageX, this._moveStageY, c.Point.identity),
  8322. b = this.pointToValue(b.x - this._clickOffsetX, b.y - this._clickOffsetY),
  8323. b = this.nearestValidValue(b, this.snapInterval);
  8324. b != this.pendingValue && (c.TrackBaseEvent.dispatchTrackBaseEvent(this, c.TrackBaseEvent.THUMB_DRAG), !0 == this.liveDragging ? (this.setValue(b), this.dispatchEventWith(c.Event.CHANGE)) : this.pendingValue = b)
  8325. }
  8326. };
  8327. a.prototype.stage_mouseUpHandler =
  8328. function(b) {
  8329. d.prototype.stage_mouseUpHandler.call(this, b);
  8330. !1 == this.liveDragging && this.value != this.pendingValue && (this.setValue(this.pendingValue), this.dispatchEventWith(c.Event.CHANGE))
  8331. };
  8332. a.prototype.track_mouseDownHandler = function(b) {
  8333. this.enabled && (b = this.track.globalToLocal(b.stageX - (this.thumb ? this.thumb.width : 0) / 2, b.stageY - (this.thumb ? this.thumb.height : 0) / 2, c.Point.identity), b = this.pointToValue(b.x, b.y), b = this.nearestValidValue(b, this.snapInterval), b != this.pendingValue && (0 != this.slideDuration ?
  8334. (this.animator || (this.animator = new c.Animation(this.animationUpdateHandler, this), this.animator.endFunction = this.animationEndHandler), this.animator.isPlaying && this.stopAnimation(), this.slideToValue = b, this.animator.duration = this.slideDuration * (Math.abs(this.pendingValue - this.slideToValue) / (this.maximum - this.minimum)), this.animator.motionPaths = [{
  8335. prop: "value",
  8336. from: this.pendingValue,
  8337. to: this.slideToValue
  8338. }], c.UIEvent.dispatchUIEvent(this, c.UIEvent.CHANGE_START), this.animator.play()) : (this.setValue(b), this.dispatchEventWith(c.Event.CHANGE))))
  8339. };
  8340. a.prototype.partAdded = function(b, a) {
  8341. d.prototype.partAdded.call(this, b, a);
  8342. a == this.trackHighlight && (this.trackHighlight.touchEnabled = !1, this.trackHighlight instanceof c.DisplayObjectContainer && (this.trackHighlight.touchChildren = !1), this.trackHighlight.visible = this._showTrackHighlight)
  8343. };
  8344. return a
  8345. }(c.TrackBase);
  8346. c.SliderBase = e
  8347. })(egret || (egret = {}));
  8348. __extends = this.__extends || function(c, e) {
  8349. function d() {
  8350. this.constructor = c
  8351. }
  8352. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  8353. d.prototype = e.prototype;
  8354. c.prototype = new d
  8355. };
  8356. (function(c) {
  8357. var e = function(d) {
  8358. function a() {
  8359. d.call(this);
  8360. this._maxDisplayedLines = 0;
  8361. this.lastUnscaledWidth = NaN;
  8362. this._padding = 0;
  8363. this._paddingBottom = this._paddingTop = this._paddingRight = this._paddingLeft = NaN;
  8364. this.addEventListener(c.UIEvent.UPDATE_COMPLETE, this.updateCompleteHandler, this)
  8365. }
  8366. __extends(a, d);
  8367. a.prototype.updateCompleteHandler = function(b) {
  8368. this.lastUnscaledWidth = NaN
  8369. };
  8370. Object.defineProperty(a.prototype, "maxDisplayedLines", {
  8371. get: function() {
  8372. return this._maxDisplayedLines
  8373. },
  8374. set: function(b) {
  8375. this._maxDisplayedLines !=
  8376. b && (this._maxDisplayedLines = b, this.invalidateSize(), this.invalidateDisplayList())
  8377. },
  8378. enumerable: !0,
  8379. configurable: !0
  8380. });
  8381. Object.defineProperty(a.prototype, "padding", {
  8382. get: function() {
  8383. return this._padding
  8384. },
  8385. set: function(b) {
  8386. this._padding != b && (this._padding = b, this.invalidateSize(), this.invalidateDisplayList())
  8387. },
  8388. enumerable: !0,
  8389. configurable: !0
  8390. });
  8391. Object.defineProperty(a.prototype, "paddingLeft", {
  8392. get: function() {
  8393. return this._paddingLeft
  8394. },
  8395. set: function(b) {
  8396. this._paddingLeft != b && (this._paddingLeft = b, this.invalidateSize(),
  8397. this.invalidateDisplayList())
  8398. },
  8399. enumerable: !0,
  8400. configurable: !0
  8401. });
  8402. Object.defineProperty(a.prototype, "paddingRight", {
  8403. get: function() {
  8404. return this._paddingRight
  8405. },
  8406. set: function(b) {
  8407. this._paddingRight != b && (this._paddingRight = b, this.invalidateSize(), this.invalidateDisplayList())
  8408. },
  8409. enumerable: !0,
  8410. configurable: !0
  8411. });
  8412. Object.defineProperty(a.prototype, "paddingTop", {
  8413. get: function() {
  8414. return this._paddingTop
  8415. },
  8416. set: function(b) {
  8417. this._paddingTop != b && (this._paddingTop = b, this.invalidateSize(), this.invalidateDisplayList())
  8418. },
  8419. enumerable: !0,
  8420. configurable: !0
  8421. });
  8422. Object.defineProperty(a.prototype, "paddingBottom", {
  8423. get: function() {
  8424. return this._paddingBottom
  8425. },
  8426. set: function(b) {
  8427. this._paddingBottom != b && (this._paddingBottom = b, this.invalidateSize(), this.invalidateDisplayList())
  8428. },
  8429. enumerable: !0,
  8430. configurable: !0
  8431. });
  8432. a.prototype.measure = function() {
  8433. this._invalidatePropertiesFlag && this.validateProperties();
  8434. if (this.isSpecialCase())
  8435. if (isNaN(this.lastUnscaledWidth)) this._oldPreferHeight = this._oldPreferWidth = NaN;
  8436. else {
  8437. this.measureUsingWidth(this.lastUnscaledWidth);
  8438. return
  8439. }
  8440. var b;
  8441. isNaN(this.explicitWidth) ? 1E4 != this.maxWidth && (b = this.maxWidth) : b = this.explicitWidth;
  8442. this.measureUsingWidth(b)
  8443. };
  8444. a.prototype.isSpecialCase = function() {
  8445. return 1 != this._maxDisplayedLines && (!isNaN(this.percentWidth) || !isNaN(this.left) && !isNaN(this.right)) && isNaN(this.explicitHeight) && isNaN(this.percentHeight)
  8446. };
  8447. a.prototype.measureUsingWidth = function(b) {
  8448. var a = this._textField.text;
  8449. this._textChanged && (this._textField.text = this._text);
  8450. var c = isNaN(this._padding) ? 0 : this._padding,
  8451. d = isNaN(this._paddingLeft) ?
  8452. c : this._paddingLeft,
  8453. e = isNaN(this._paddingRight) ? c : this._paddingRight,
  8454. g = isNaN(this._paddingTop) ? c : this._paddingTop,
  8455. c = isNaN(this._paddingBottom) ? c : this._paddingBottom;
  8456. this._textField.width = NaN;
  8457. this._textField.height = NaN;
  8458. isNaN(b) || (this._textField.width = b - d - e);
  8459. this.measuredWidth = Math.ceil(this._textField.measuredWidth);
  8460. this.measuredHeight = Math.ceil(this._textField.measuredHeight);
  8461. 0 < this._maxDisplayedLines && this._textField.numLines > this._maxDisplayedLines && (b = this._textField.lineSpacing, this.measuredHeight =
  8462. (this._textField.size + b) * this._maxDisplayedLines - b);
  8463. this.measuredWidth += d + e;
  8464. this.measuredHeight += g + c;
  8465. this._textField.text = a
  8466. };
  8467. a.prototype.updateDisplayList = function(b, a) {
  8468. this.$updateDisplayList(b, a);
  8469. var c = isNaN(this._padding) ? 0 : this._padding,
  8470. d = isNaN(this._paddingLeft) ? c : this._paddingLeft,
  8471. e = isNaN(this._paddingRight) ? c : this._paddingRight,
  8472. g = isNaN(this._paddingTop) ? c : this._paddingTop,
  8473. c = isNaN(this._paddingBottom) ? c : this._paddingBottom;
  8474. this._textField.x = d;
  8475. this._textField.y = g;
  8476. if (this.isSpecialCase()) {
  8477. var k =
  8478. isNaN(this.lastUnscaledWidth) || this.lastUnscaledWidth != b;
  8479. this.lastUnscaledWidth = b;
  8480. if (k) {
  8481. this._oldPreferHeight = this._oldPreferWidth = NaN;
  8482. this.invalidateSize();
  8483. return
  8484. }
  8485. }
  8486. this._invalidateSizeFlag && this.validateSize();
  8487. this._textField.visible || (this._textField.visible = !0);
  8488. this._textField.width = b - d - e;
  8489. d = a - g - c;
  8490. this._textField.height = d;
  8491. 0 < this._maxDisplayedLines && this._textField.numLines > this._maxDisplayedLines && (e = this._textField.lineSpacing, this._textField.height = Math.min(d, (this._textField.size + e) * this._maxDisplayedLines -
  8492. e))
  8493. };
  8494. return a
  8495. }(c.TextBase);
  8496. c.Label = e
  8497. })(egret || (egret = {}));
  8498. __extends = this.__extends || function(c, e) {
  8499. function d() {
  8500. this.constructor = c
  8501. }
  8502. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  8503. d.prototype = e.prototype;
  8504. c.prototype = new d
  8505. };
  8506. (function(c) {
  8507. var e = function(d) {
  8508. function a() {
  8509. d.call(this);
  8510. this._fillColor = 16777215;
  8511. this._fillAlpha = 1;
  8512. this._strokeColor = 4473924;
  8513. this._strokeAlpha = 0;
  8514. this._strokeWeight = 1;
  8515. this.touchChildren = !1
  8516. }
  8517. __extends(a, d);
  8518. Object.defineProperty(a.prototype, "graphics", {
  8519. get: function() {
  8520. this._graphics || (this._graphics = new c.Graphics);
  8521. return this._graphics
  8522. },
  8523. enumerable: !0,
  8524. configurable: !0
  8525. });
  8526. a.prototype._render = function(b) {
  8527. this._graphics && this._graphics._draw(b);
  8528. d.prototype._render.call(this, b)
  8529. };
  8530. Object.defineProperty(a.prototype,
  8531. "fillColor", {
  8532. get: function() {
  8533. return this._fillColor
  8534. },
  8535. set: function(b) {
  8536. this._fillColor != b && (this._fillColor = b, this.invalidateDisplayList())
  8537. },
  8538. enumerable: !0,
  8539. configurable: !0
  8540. });
  8541. Object.defineProperty(a.prototype, "fillAlpha", {
  8542. get: function() {
  8543. return this._fillAlpha
  8544. },
  8545. set: function(b) {
  8546. this._fillAlpha != b && (this._fillAlpha = b, this.invalidateDisplayList())
  8547. },
  8548. enumerable: !0,
  8549. configurable: !0
  8550. });
  8551. Object.defineProperty(a.prototype, "strokeColor", {
  8552. get: function() {
  8553. return this._strokeColor
  8554. },
  8555. set: function(b) {
  8556. this._strokeColor != b &&
  8557. (this._strokeColor = b, this.invalidateDisplayList())
  8558. },
  8559. enumerable: !0,
  8560. configurable: !0
  8561. });
  8562. Object.defineProperty(a.prototype, "strokeAlpha", {
  8563. get: function() {
  8564. return this._strokeAlpha
  8565. },
  8566. set: function(b) {
  8567. this._strokeAlpha != b && (this._strokeAlpha = b, this.invalidateDisplayList())
  8568. },
  8569. enumerable: !0,
  8570. configurable: !0
  8571. });
  8572. Object.defineProperty(a.prototype, "strokeWeight", {
  8573. get: function() {
  8574. return this._strokeWeight
  8575. },
  8576. set: function(b) {
  8577. this._strokeWeight != b && (this._strokeWeight = b, this.invalidateDisplayList())
  8578. },
  8579. enumerable: !0,
  8580. configurable: !0
  8581. });
  8582. a.prototype._measureBounds = function() {
  8583. var b = d.prototype._measureBounds.call(this),
  8584. a = this.width,
  8585. c = this.height;
  8586. 0 < b.x && (b.x = 0);
  8587. 0 < b.y && (b.y = 0);
  8588. 0 + a > b.right && (b.right = 0 + a);
  8589. 0 + c > b.bottom && (b.bottom = 0 + c);
  8590. return b
  8591. };
  8592. a.prototype.updateDisplayList = function(b, a) {
  8593. d.prototype.updateDisplayList.call(this, b, b);
  8594. var c = this.graphics;
  8595. c.clear();
  8596. c.beginFill(this._fillColor, this._fillAlpha);
  8597. 0 < this._strokeAlpha && c.lineStyle(this._strokeWeight, this._strokeColor, this._strokeAlpha, !0, "normal", "square", "miter");
  8598. c.drawRect(0, 0,
  8599. b, a);
  8600. c.endFill()
  8601. };
  8602. return a
  8603. }(c.UIComponent);
  8604. c.Rect = e
  8605. })(egret || (egret = {}));
  8606. __extends = this.__extends || function(c, e) {
  8607. function d() {
  8608. this.constructor = c
  8609. }
  8610. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  8611. d.prototype = e.prototype;
  8612. c.prototype = new d
  8613. };
  8614. (function(c) {
  8615. var e = function(c) {
  8616. function a() {
  8617. c.call(this);
  8618. this.hostComponentKey = "egret.Button"
  8619. }
  8620. __extends(a, c);
  8621. return a
  8622. }(c.ButtonBase);
  8623. c.Button = e
  8624. })(egret || (egret = {}));
  8625. __extends = this.__extends || function(c, e) {
  8626. function d() {
  8627. this.constructor = c
  8628. }
  8629. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  8630. d.prototype = e.prototype;
  8631. c.prototype = new d
  8632. };
  8633. (function(c) {
  8634. var e = function(c) {
  8635. function a() {
  8636. c.call(this);
  8637. this.hostComponentKey = "egret.ToggleButton"
  8638. }
  8639. __extends(a, c);
  8640. return a
  8641. }(c.ToggleButtonBase);
  8642. c.ToggleButton = e
  8643. })(egret || (egret = {}));
  8644. __extends = this.__extends || function(c, e) {
  8645. function d() {
  8646. this.constructor = c
  8647. }
  8648. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  8649. d.prototype = e.prototype;
  8650. c.prototype = new d
  8651. };
  8652. (function(c) {
  8653. var e = function(c) {
  8654. function a() {
  8655. c.call(this);
  8656. this.hostComponentKey = "egret.CheckBox"
  8657. }
  8658. __extends(a, c);
  8659. return a
  8660. }(c.ToggleButtonBase);
  8661. c.CheckBox = e
  8662. })(egret || (egret = {}));
  8663. __extends = this.__extends || function(c, e) {
  8664. function d() {
  8665. this.constructor = c
  8666. }
  8667. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  8668. d.prototype = e.prototype;
  8669. c.prototype = new d
  8670. };
  8671. (function(c) {
  8672. var e = function(d) {
  8673. function a() {
  8674. d.call(this);
  8675. this.radioButtons = [];
  8676. this._enabled = !0;
  8677. this._name = "_radioButtonGroup" + a.groupCount;
  8678. a.groupCount++
  8679. }
  8680. __extends(a, d);
  8681. Object.defineProperty(a.prototype, "enabled", {
  8682. get: function() {
  8683. return this._enabled
  8684. },
  8685. set: function(b) {
  8686. if (this._enabled != b)
  8687. for (this._enabled = b, b = 0; b < this.numRadioButtons; b++) this.getRadioButtonAt(b).invalidateSkinState()
  8688. },
  8689. enumerable: !0,
  8690. configurable: !0
  8691. });
  8692. Object.defineProperty(a.prototype, "numRadioButtons", {
  8693. get: function() {
  8694. return this.radioButtons.length
  8695. },
  8696. enumerable: !0,
  8697. configurable: !0
  8698. });
  8699. Object.defineProperty(a.prototype, "selectedValue", {
  8700. get: function() {
  8701. return this.selection ? null != this.selection.value ? this.selection.value : this.selection.label : null
  8702. },
  8703. set: function(b) {
  8704. this._selectedValue = b;
  8705. if (null == b) this._setSelection(null, !1);
  8706. else
  8707. for (var a = this.numRadioButtons, d = 0; d < a; d++) {
  8708. var e = this.getRadioButtonAt(d);
  8709. if (e.value == b || e.label == b) {
  8710. this.changeSelection(d, !1);
  8711. this._selectedValue = null;
  8712. c.UIEvent.dispatchUIEvent(this, c.UIEvent.VALUE_COMMIT);
  8713. break
  8714. }
  8715. }
  8716. },
  8717. enumerable: !0,
  8718. configurable: !0
  8719. });
  8720. Object.defineProperty(a.prototype, "selection", {
  8721. get: function() {
  8722. return this._selection
  8723. },
  8724. set: function(b) {
  8725. this._selection != b && this._setSelection(b, !1)
  8726. },
  8727. enumerable: !0,
  8728. configurable: !0
  8729. });
  8730. a.prototype.getRadioButtonAt = function(b) {
  8731. return 0 <= b && b < this.numRadioButtons ? this.radioButtons[b] : null
  8732. };
  8733. a.prototype._addInstance = function(b) {
  8734. function a(b, d) {
  8735. var e = b.parent,
  8736. l = d.parent;
  8737. if (!e || !l) return 0;
  8738. var n = b instanceof c.UIComponent ? b.nestLevel : -1,
  8739. p = d instanceof c.UIComponent ? d.nestLevel : -1,
  8740. q = 0,
  8741. r = 0;
  8742. e ==
  8743. l && (q = "getElementIndex" in e && "ownerChanged" in b ? e.getElementIndex(b) : e.getChildIndex(b), r = "getElementIndex" in l && "ownerChanged" in d ? l.getElementIndex(d) : l.getChildIndex(d));
  8744. return n > p || q > r ? 1 : n < p || r > q ? -1 : b == d ? 0 : a(e, l)
  8745. }
  8746. b.addEventListener(c.Event.REMOVED, this.radioButton_removedHandler, this);
  8747. this.radioButtons.push(b);
  8748. this.radioButtons.sort(a);
  8749. for (var d = 0; d < this.radioButtons.length; d++) this.radioButtons[d]._indexNumber = d;
  8750. this._selectedValue && (this.selectedValue = this._selectedValue);
  8751. !0 == b.selected && (this.selection =
  8752. b);
  8753. b._radioButtonGroup = this;
  8754. b.invalidateSkinState();
  8755. this.dispatchEventWith("numRadioButtonsChanged")
  8756. };
  8757. a.prototype._removeInstance = function(b) {
  8758. this.doRemoveInstance(b, !1)
  8759. };
  8760. a.prototype.doRemoveInstance = function(b, a) {
  8761. "undefined" === typeof a && (a = !0);
  8762. if (b) {
  8763. for (var d = !1, e = 0; e < this.numRadioButtons; e++) {
  8764. var f = this.getRadioButtonAt(e);
  8765. d ? f._indexNumber -= 1 : f == b && (a && b.addEventListener(c.Event.ADDED, this.radioButton_addedHandler, this), b == this._selection && (this._selection = null), b._radioButtonGroup = null, b.invalidateSkinState(),
  8766. this.radioButtons.splice(e, 1), d = !0, e--)
  8767. }
  8768. d && this.dispatchEventWith("numRadioButtonsChanged")
  8769. }
  8770. };
  8771. a.prototype._setSelection = function(b, a) {
  8772. "undefined" === typeof a && (a = !0);
  8773. if (this._selection != b) {
  8774. if (b)
  8775. for (var d = this.numRadioButtons, e = 0; e < d; e++) {
  8776. if (b == this.getRadioButtonAt(e)) {
  8777. this.changeSelection(e, a);
  8778. break
  8779. }
  8780. } else this.selection && (this._selection.selected = !1, this._selection = null, a && this.dispatchEventWith(c.Event.CHANGE));
  8781. c.UIEvent.dispatchUIEvent(this, c.UIEvent.VALUE_COMMIT)
  8782. }
  8783. };
  8784. a.prototype.changeSelection =
  8785. function(b, a) {
  8786. "undefined" === typeof a && (a = !0);
  8787. var d = this.getRadioButtonAt(b);
  8788. d && d != this._selection && (this._selection && (this._selection.selected = !1), this._selection = d, this._selection.selected = !0, a && this.dispatchEventWith(c.Event.CHANGE))
  8789. };
  8790. a.prototype.radioButton_addedHandler = function(b) {
  8791. if (b = b.target) b.removeEventListener(c.Event.ADDED, this.radioButton_addedHandler, this), this._addInstance(b)
  8792. };
  8793. a.prototype.radioButton_removedHandler = function(b) {
  8794. if (b = b.target) b.removeEventListener(c.Event.REMOVED, this.radioButton_removedHandler,
  8795. this), this.doRemoveInstance(b)
  8796. };
  8797. a.groupCount = 0;
  8798. return a
  8799. }(c.EventDispatcher);
  8800. c.RadioButtonGroup = e
  8801. })(egret || (egret = {}));
  8802. __extends = this.__extends || function(c, e) {
  8803. function d() {
  8804. this.constructor = c
  8805. }
  8806. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  8807. d.prototype = e.prototype;
  8808. c.prototype = new d
  8809. };
  8810. (function(c) {
  8811. var e = function(d) {
  8812. function a() {
  8813. d.call(this);
  8814. this._indexNumber = 0;
  8815. this._radioButtonGroup = null;
  8816. this.groupChanged = !1;
  8817. this._groupName = "radioGroup";
  8818. this.hostComponentKey = "egret.RadioButton";
  8819. this.groupName = "radioGroup"
  8820. }
  8821. __extends(a, d);
  8822. Object.defineProperty(a.prototype, "enabled", {
  8823. get: function() {
  8824. return this._enabled ? !this._radioButtonGroup || this._radioButtonGroup.enabled : !1
  8825. },
  8826. set: function(b) {
  8827. this._setEnabled(b)
  8828. },
  8829. enumerable: !0,
  8830. configurable: !0
  8831. });
  8832. Object.defineProperty(a.prototype, "group", {
  8833. get: function() {
  8834. if (!this._group &&
  8835. this._groupName) {
  8836. a.automaticRadioButtonGroups || (a.automaticRadioButtonGroups = {});
  8837. var b = a.automaticRadioButtonGroups[this._groupName];
  8838. b || (b = new c.RadioButtonGroup, b._name = this._groupName, a.automaticRadioButtonGroups[this._groupName] = b);
  8839. this._group = b
  8840. }
  8841. return this._group
  8842. },
  8843. set: function(b) {
  8844. this._group != b && (this._radioButtonGroup && this._radioButtonGroup._removeInstance(this), this._groupName = (this._group = b) ? this.group._name : "radioGroup", this.groupChanged = !0, this.invalidateProperties(), this.invalidateDisplayList())
  8845. },
  8846. enumerable: !0,
  8847. configurable: !0
  8848. });
  8849. Object.defineProperty(a.prototype, "groupName", {
  8850. get: function() {
  8851. return this._groupName
  8852. },
  8853. set: function(b) {
  8854. b && "" != b && (this._groupName = b, this._radioButtonGroup && this._radioButtonGroup._removeInstance(this), this._group = null, this.groupChanged = !0, this.invalidateProperties(), this.invalidateDisplayList())
  8855. },
  8856. enumerable: !0,
  8857. configurable: !0
  8858. });
  8859. a.prototype._setSelected = function(b) {
  8860. d.prototype._setSelected.call(this, b);
  8861. this.invalidateDisplayList()
  8862. };
  8863. Object.defineProperty(a.prototype, "value", {
  8864. get: function() {
  8865. return this._value
  8866. },
  8867. set: function(b) {
  8868. this._value != b && (this._value = b, this.selected && this.group && c.UIEvent.dispatchUIEvent(this.group, c.UIEvent.VALUE_COMMIT))
  8869. },
  8870. enumerable: !0,
  8871. configurable: !0
  8872. });
  8873. a.prototype.commitProperties = function() {
  8874. this.groupChanged && (this.addToGroup(), this.groupChanged = !1);
  8875. d.prototype.commitProperties.call(this)
  8876. };
  8877. a.prototype.updateDisplayList = function(b, a) {
  8878. d.prototype.updateDisplayList.call(this, b, a);
  8879. this.group && (this.selected ? this._group.selection = this : this.group.selection ==
  8880. this && (this._group.selection = null))
  8881. };
  8882. a.prototype.buttonReleased = function() {
  8883. this.enabled && !this.selected && (this._radioButtonGroup || this.addToGroup(), d.prototype.buttonReleased.call(this), this.group._setSelection(this))
  8884. };
  8885. a.prototype.addToGroup = function() {
  8886. var b = this.group;
  8887. b && b._addInstance(this);
  8888. return b
  8889. };
  8890. return a
  8891. }(c.ToggleButtonBase);
  8892. c.RadioButton = e
  8893. })(egret || (egret = {}));
  8894. __extends = this.__extends || function(c, e) {
  8895. function d() {
  8896. this.constructor = c
  8897. }
  8898. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  8899. d.prototype = e.prototype;
  8900. c.prototype = new d
  8901. };
  8902. (function(c) {
  8903. var e = function(d) {
  8904. function a() {
  8905. d.call(this);
  8906. this.elementsContentChanged = this.createChildrenCalled = !1;
  8907. this._elementsContent = []
  8908. }
  8909. __extends(a, d);
  8910. a.prototype.createChildren = function() {
  8911. d.prototype.createChildren.call(this);
  8912. this.createChildrenCalled = !0;
  8913. this.elementsContentChanged && (this.elementsContentChanged = !1, this.setElementsContent(this._elementsContent))
  8914. };
  8915. a.prototype._getElementsContent = function() {
  8916. return this._elementsContent
  8917. };
  8918. Object.defineProperty(a.prototype, "elementsContent", {
  8919. set: function(b) {
  8920. null ==
  8921. b && (b = []);
  8922. if (b != this._elementsContent)
  8923. if (this.createChildrenCalled) this.setElementsContent(b);
  8924. else {
  8925. this.elementsContentChanged = !0;
  8926. for (var a = this._elementsContent.length - 1; 0 <= a; a--) this._elementRemoved(this._elementsContent[a], a);
  8927. this._elementsContent = b
  8928. }
  8929. },
  8930. enumerable: !0,
  8931. configurable: !0
  8932. });
  8933. a.prototype.setElementsContent = function(b) {
  8934. var a;
  8935. for (a = this._elementsContent.length - 1; 0 <= a; a--) this._elementRemoved(this._elementsContent[a], a);
  8936. this._elementsContent = b.concat();
  8937. b = this._elementsContent.length;
  8938. for (a =
  8939. 0; a < b; a++) {
  8940. var c = this._elementsContent[a];
  8941. c.parent && "removeElement" in c.parent ? c.parent.removeElement(c) : c.owner && "removeElement" in c.owner && c.owner.removeElement(c);
  8942. this._elementAdded(c, a)
  8943. }
  8944. };
  8945. Object.defineProperty(a.prototype, "numElements", {
  8946. get: function() {
  8947. return this._elementsContent.length
  8948. },
  8949. enumerable: !0,
  8950. configurable: !0
  8951. });
  8952. a.prototype.getElementAt = function(b) {
  8953. this.checkForRangeError(b);
  8954. return this._elementsContent[b]
  8955. };
  8956. a.prototype.checkForRangeError = function(b, a) {
  8957. "undefined" === typeof a && (a = !1);
  8958. var c =
  8959. this._elementsContent.length - 1;
  8960. a && c++;
  8961. if (0 > b || b > c) throw new RangeError('\u7d22\u5f15:"' + b + '"\u8d85\u51fa\u53ef\u89c6\u5143\u7d20\u7d22\u5f15\u8303\u56f4');
  8962. };
  8963. a.prototype.addElement = function(b) {
  8964. var a = this.numElements;
  8965. b.parent == this && (a = this.numElements - 1);
  8966. return this.addElementAt(b, a)
  8967. };
  8968. a.prototype.addElementAt = function(b, a) {
  8969. if (b == this) return b;
  8970. this.checkForRangeError(a, !0);
  8971. var c = b.owner;
  8972. if (c == this) return this.setElementIndex(b, a), b;
  8973. c && "removeElement" in c && b.owner.removeElement(b);
  8974. this._elementsContent.splice(a,
  8975. 0, b);
  8976. this.elementsContentChanged || this._elementAdded(b, a);
  8977. return b
  8978. };
  8979. a.prototype.removeElement = function(b) {
  8980. return this.removeElementAt(this.getElementIndex(b))
  8981. };
  8982. a.prototype.removeElementAt = function(b) {
  8983. this.checkForRangeError(b);
  8984. var a = this._elementsContent[b];
  8985. this.elementsContentChanged || this._elementRemoved(a, b);
  8986. this._elementsContent.splice(b, 1);
  8987. return a
  8988. };
  8989. a.prototype.removeAllElements = function() {
  8990. for (var b = this.numElements - 1; 0 <= b; b--) this.removeElementAt(b)
  8991. };
  8992. a.prototype.getElementIndex = function(b) {
  8993. return this._elementsContent.indexOf(b)
  8994. };
  8995. a.prototype.setElementIndex = function(b, a) {
  8996. this.checkForRangeError(a);
  8997. var c = this.getElementIndex(b); - 1 != c && c != a && (this.elementsContentChanged || this._elementRemoved(b, c, !1), this._elementsContent.splice(c, 1), this._elementsContent.splice(a, 0, b), this.elementsContentChanged || this._elementAdded(b, a, !1))
  8998. };
  8999. a.prototype.swapElements = function(b, a) {
  9000. this.swapElementsAt(this.getElementIndex(b), this.getElementIndex(a))
  9001. };
  9002. a.prototype.swapElementsAt = function(b, a) {
  9003. this.checkForRangeError(b);
  9004. this.checkForRangeError(a);
  9005. if (b > a) {
  9006. var c = a;
  9007. a = b;
  9008. b = c
  9009. } else if (b == a) return;
  9010. var c = this._elementsContent,
  9011. d = c[b],
  9012. e = c[a];
  9013. this.elementsContentChanged || (this._elementRemoved(d, b, !1), this._elementRemoved(e, a, !1));
  9014. c[b] = e;
  9015. c[a] = d;
  9016. this.elementsContentChanged || (this._elementAdded(e, b, !1), this._elementAdded(d, a, !1))
  9017. };
  9018. a.prototype._elementAdded = function(b, a, d) {
  9019. "undefined" === typeof d && (d = !0);
  9020. b instanceof c.DisplayObject && this._addToDisplayListAt(b, a, d);
  9021. d && this.hasEventListener(c.ElementExistenceEvent.ELEMENT_ADD) && c.ElementExistenceEvent.dispatchElementExistenceEvent(this,
  9022. c.ElementExistenceEvent.ELEMENT_ADD, b, a);
  9023. this.invalidateSize();
  9024. this.invalidateDisplayList()
  9025. };
  9026. a.prototype._elementRemoved = function(b, a, d) {
  9027. "undefined" === typeof d && (d = !0);
  9028. d && this.hasEventListener(c.ElementExistenceEvent.ELEMENT_REMOVE) && c.ElementExistenceEvent.dispatchElementExistenceEvent(this, c.ElementExistenceEvent.ELEMENT_REMOVE, b, a);
  9029. b instanceof c.DisplayObject && b.parent == this && this._removeFromDisplayList(b, d);
  9030. this.invalidateSize();
  9031. this.invalidateDisplayList()
  9032. };
  9033. a.prototype.addChild = function(b) {
  9034. throw Error("addChild()" +
  9035. a.errorStr + "addElement()\u4ee3\u66ff");
  9036. };
  9037. a.prototype.addChildAt = function(b, c) {
  9038. throw Error("addChildAt()" + a.errorStr + "addElementAt()\u4ee3\u66ff");
  9039. };
  9040. a.prototype.removeChild = function(b) {
  9041. throw Error("removeChild()" + a.errorStr + "removeElement()\u4ee3\u66ff");
  9042. };
  9043. a.prototype.removeChildAt = function(b) {
  9044. throw Error("removeChildAt()" + a.errorStr + "removeElementAt()\u4ee3\u66ff");
  9045. };
  9046. a.prototype.setChildIndex = function(b, c) {
  9047. throw Error("setChildIndex()" + a.errorStr + "setElementIndex()\u4ee3\u66ff");
  9048. };
  9049. a.prototype.swapChildren =
  9050. function(b, c) {
  9051. throw Error("swapChildren()" + a.errorStr + "swapElements()\u4ee3\u66ff");
  9052. };
  9053. a.prototype.swapChildrenAt = function(b, c) {
  9054. throw Error("swapChildrenAt()" + a.errorStr + "swapElementsAt()\u4ee3\u66ff");
  9055. };
  9056. a.errorStr = "\u5728\u6b64\u7ec4\u4ef6\u4e2d\u4e0d\u53ef\u7528\uff0c\u82e5\u6b64\u7ec4\u4ef6\u4e3a\u5bb9\u5668\u7c7b\uff0c\u8bf7\u4f7f\u7528";
  9057. return a
  9058. }(c.GroupBase);
  9059. c.Group = e
  9060. })(egret || (egret = {}));
  9061. __extends = this.__extends || function(c, e) {
  9062. function d() {
  9063. this.constructor = c
  9064. }
  9065. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  9066. d.prototype = e.prototype;
  9067. c.prototype = new d
  9068. };
  9069. (function(c) {
  9070. var e = function(d) {
  9071. function a() {
  9072. d.call(this);
  9073. this._createAllChildren = !1;
  9074. this.proposedSelectedIndex = a.NO_PROPOSED_SELECTION;
  9075. this._selectedIndex = -1;
  9076. this.childOrderingChanged = this.notifyTabBar = !1;
  9077. this._setLayout(new c.BasicLayout)
  9078. }
  9079. __extends(a, d);
  9080. Object.defineProperty(a.prototype, "layout", {
  9081. get: function() {
  9082. return this._layout
  9083. },
  9084. set: function(b) {},
  9085. enumerable: !0,
  9086. configurable: !0
  9087. });
  9088. Object.defineProperty(a.prototype, "createAllChildren", {
  9089. get: function() {
  9090. return this._createAllChildren
  9091. },
  9092. set: function(b) {
  9093. if (this._createAllChildren !=
  9094. b && (this._createAllChildren = b)) {
  9095. b = this._getElementsContent();
  9096. for (var a = b.length, d = 0; d < a; d++) {
  9097. var e = b[d];
  9098. e instanceof c.DisplayObject && e.parent != this && (this.childOrderingChanged = !0, this._addToDisplayList(e))
  9099. }
  9100. this.childOrderingChanged && this.invalidateProperties()
  9101. }
  9102. },
  9103. enumerable: !0,
  9104. configurable: !0
  9105. });
  9106. Object.defineProperty(a.prototype, "selectedChild", {
  9107. get: function() {
  9108. var b = this.selectedIndex;
  9109. return 0 <= b && b < this.numElements ? this.getElementAt(b) : null
  9110. },
  9111. set: function(b) {
  9112. b = this.getElementIndex(b);
  9113. 0 <= b && b < this.numElements &&
  9114. this._setSelectedIndex(b)
  9115. },
  9116. enumerable: !0,
  9117. configurable: !0
  9118. });
  9119. Object.defineProperty(a.prototype, "selectedIndex", {
  9120. get: function() {
  9121. return this.proposedSelectedIndex != a.NO_PROPOSED_SELECTION ? this.proposedSelectedIndex : this._selectedIndex
  9122. },
  9123. set: function(b) {
  9124. this._setSelectedIndex(b)
  9125. },
  9126. enumerable: !0,
  9127. configurable: !0
  9128. });
  9129. a.prototype._setSelectedIndex = function(b, a) {
  9130. "undefined" === typeof a && (a = !0);
  9131. b != this.selectedIndex && (this.proposedSelectedIndex = b, this.invalidateProperties(), c.UIEvent.dispatchUIEvent(this, c.UIEvent.VALUE_COMMIT),
  9132. this.notifyTabBar = this.notifyTabBar || a)
  9133. };
  9134. a.prototype._elementAdded = function(b, a, d) {
  9135. "undefined" === typeof d && (d = !0);
  9136. this._createAllChildren && b instanceof c.DisplayObject && this._addToDisplayListAt(b, a, d);
  9137. d && this.hasEventListener(c.ElementExistenceEvent.ELEMENT_ADD) && c.ElementExistenceEvent.dispatchElementExistenceEvent(this, c.ElementExistenceEvent.ELEMENT_ADD, b, a);
  9138. b.visible = !1;
  9139. b.includeInLayout = !1; - 1 == this.selectedIndex ? this._setSelectedIndex(a, !1) : a <= this.selectedIndex && this.initialized && this._setSelectedIndex(this.selectedIndex +
  9140. 1);
  9141. this.dispatchCoEvent(c.CollectionEventKind.ADD, a, -1, [b.name])
  9142. };
  9143. a.prototype._elementRemoved = function(b, a, e) {
  9144. "undefined" === typeof e && (e = !0);
  9145. d.prototype._elementRemoved.call(this, b, a, e);
  9146. b.visible = !0;
  9147. b.includeInLayout = !0;
  9148. a == this.selectedIndex ? 0 < this.numElements ? 0 == a ? (this.proposedSelectedIndex = 0, this.invalidateProperties()) : this._setSelectedIndex(0, !1) : this._setSelectedIndex(-1) : a < this.selectedIndex && this._setSelectedIndex(this.selectedIndex - 1);
  9149. this.dispatchCoEvent(c.CollectionEventKind.REMOVE, a, -1, [b.name])
  9150. };
  9151. a.prototype.commitProperties = function() {
  9152. d.prototype.commitProperties.call(this);
  9153. this.proposedSelectedIndex != a.NO_PROPOSED_SELECTION && (this.commitSelection(this.proposedSelectedIndex), this.proposedSelectedIndex = a.NO_PROPOSED_SELECTION);
  9154. if (this.childOrderingChanged) {
  9155. this.childOrderingChanged = !1;
  9156. for (var b = this._getElementsContent(), e = b.length, l = 0; l < e; l++) {
  9157. var m = b[l];
  9158. m instanceof c.DisplayObject && m.parent == this && this._addToDisplayList(m)
  9159. }
  9160. }
  9161. this.notifyTabBar && (this.notifyTabBar = !0, this.dispatchEventWith("IndexChanged"))
  9162. };
  9163. a.prototype.commitSelection = function(b) {
  9164. 0 <= b && b < this.numElements ? (this._selectedIndex = b, this._selectedChild && this._selectedChild.parent == this && (this._selectedChild.visible = !1, this._selectedChild.includeInLayout = !1), this._selectedChild = this.getElementAt(this._selectedIndex), this._selectedChild.visible = !0, this._selectedChild.includeInLayout = !0, this._selectedChild.parent != this && this._selectedChild instanceof c.DisplayObject && (this._addToDisplayList(this._selectedChild), this.childOrderingChanged || (this.childOrderingChanged = !0))) : (this._selectedChild = null, this._selectedIndex = -1);
  9165. this.invalidateSize();
  9166. this.invalidateDisplayList()
  9167. };
  9168. Object.defineProperty(a.prototype, "length", {
  9169. get: function() {
  9170. return this.numElements
  9171. },
  9172. enumerable: !0,
  9173. configurable: !0
  9174. });
  9175. a.prototype.getItemAt = function(b) {
  9176. return (b = this.getElementAt(b)) ? b.name : ""
  9177. };
  9178. a.prototype.getItemIndex = function(b) {
  9179. for (var a = this._getElementsContent(), c = a.length, d = 0; d < c; d++)
  9180. if (a[d].name === b) return d;
  9181. return -1
  9182. };
  9183. a.prototype.dispatchCoEvent = function(b, a, d, e, f) {
  9184. "undefined" === typeof b &&
  9185. (b = null);
  9186. "undefined" === typeof a && (a = -1);
  9187. "undefined" === typeof d && (d = -1);
  9188. "undefined" === typeof e && (e = null);
  9189. "undefined" === typeof f && (f = null);
  9190. c.CollectionEvent.dispatchCollectionEvent(this, c.CollectionEvent.COLLECTION_CHANGE, b, a, d, e, f)
  9191. };
  9192. a.NO_PROPOSED_SELECTION = -2;
  9193. return a
  9194. }(c.Group);
  9195. c.ViewStack = e
  9196. })(egret || (egret = {}));
  9197. __extends = this.__extends || function(c, e) {
  9198. function d() {
  9199. this.constructor = c
  9200. }
  9201. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  9202. d.prototype = e.prototype;
  9203. c.prototype = new d
  9204. };
  9205. (function(c) {
  9206. var e = function(d) {
  9207. function a() {
  9208. d.call(this);
  9209. this.maxWidth = 1E4;
  9210. this.minWidth = 0;
  9211. this.maxHeight = 1E4;
  9212. this.minHeight = 0;
  9213. this.height = this.width = NaN;
  9214. this._initialized = !1;
  9215. this._elementsContent = [];
  9216. this._states = [];
  9217. this.initialized = !1
  9218. }
  9219. __extends(a, d);
  9220. a.prototype.createChildren = function() {};
  9221. Object.defineProperty(a.prototype, "hostComponent", {
  9222. get: function() {
  9223. return this._hostComponent
  9224. },
  9225. set: function(b) {
  9226. this._setHostComponent(b)
  9227. },
  9228. enumerable: !0,
  9229. configurable: !0
  9230. });
  9231. a.prototype._setHostComponent = function(b) {
  9232. if (this._hostComponent !=
  9233. b) {
  9234. var a;
  9235. if (this._hostComponent)
  9236. for (a = this._elementsContent.length - 1; 0 <= a; a--) this._elementRemoved(this._elementsContent[a], a);
  9237. this._hostComponent = b;
  9238. this._initialized || (this._initialized = !0, this.createChildren());
  9239. if (this._hostComponent) {
  9240. b = this._elementsContent.length;
  9241. for (a = 0; a < b; a++) this._elementAdded(this._elementsContent[a], a);
  9242. this.initializeStates();
  9243. this.currentStateChanged && this.commitCurrentState()
  9244. }
  9245. }
  9246. };
  9247. a.prototype._getElementsContent = function() {
  9248. return this._elementsContent
  9249. };
  9250. Object.defineProperty(a.prototype,
  9251. "elementsContent", {
  9252. set: function(b) {
  9253. null == b && (b = []);
  9254. if (b != this._elementsContent)
  9255. if (this._hostComponent) {
  9256. var a;
  9257. for (a = this._elementsContent.length - 1; 0 <= a; a--) this._elementRemoved(this._elementsContent[a], a);
  9258. this._elementsContent = b.concat();
  9259. b = this._elementsContent.length;
  9260. for (a = 0; a < b; a++) {
  9261. var c = this._elementsContent[a];
  9262. c.parent && "removeElement" in c.parent ? c.parent.removeElement(c) : c.owner && "removeElement" in c.owner && c.owner.removeElement(c);
  9263. this._elementAdded(c, a)
  9264. }
  9265. } else this._elementsContent = b.concat()
  9266. },
  9267. enumerable: !0,
  9268. configurable: !0
  9269. });
  9270. Object.defineProperty(a.prototype, "numElements", {
  9271. get: function() {
  9272. return this._elementsContent.length
  9273. },
  9274. enumerable: !0,
  9275. configurable: !0
  9276. });
  9277. a.prototype.getElementAt = function(b) {
  9278. this.checkForRangeError(b);
  9279. return this._elementsContent[b]
  9280. };
  9281. a.prototype.checkForRangeError = function(b, a) {
  9282. "undefined" === typeof a && (a = !1);
  9283. var c = this._elementsContent.length - 1;
  9284. a && c++;
  9285. if (0 > b || b > c) throw new RangeError('\u7d22\u5f15:"' + b + '"\u8d85\u51fa\u53ef\u89c6\u5143\u7d20\u7d22\u5f15\u8303\u56f4');
  9286. };
  9287. a.prototype.addElement = function(b) {
  9288. var a = this.numElements;
  9289. b.owner == this && (a = this.numElements - 1);
  9290. return this.addElementAt(b, a)
  9291. };
  9292. a.prototype.addElementAt = function(b, a) {
  9293. this.checkForRangeError(a, !0);
  9294. var c = b.owner;
  9295. if (c == this) return this.setElementIndex(b, a), b;
  9296. c && "removeElement" in c && c.removeElement(b);
  9297. this._elementsContent.splice(a, 0, b);
  9298. this._hostComponent ? this._elementAdded(b, a) : b.ownerChanged(this);
  9299. return b
  9300. };
  9301. a.prototype.removeElement = function(b) {
  9302. return this.removeElementAt(this.getElementIndex(b))
  9303. };
  9304. a.prototype.removeElementAt = function(b) {
  9305. this.checkForRangeError(b);
  9306. var a = this._elementsContent[b];
  9307. this._hostComponent ? this._elementRemoved(a, b) : a.ownerChanged(null);
  9308. this._elementsContent.splice(b, 1);
  9309. return a
  9310. };
  9311. a.prototype.getElementIndex = function(b) {
  9312. return this._elementsContent.indexOf(b)
  9313. };
  9314. a.prototype.setElementIndex = function(b, a) {
  9315. this.checkForRangeError(a);
  9316. var c = this.getElementIndex(b); - 1 != c && c != a && (this._hostComponent && this._elementRemoved(b, c, !1), this._elementsContent.splice(c, 1), this._elementsContent.splice(a,
  9317. 0, b), this._hostComponent && this._elementAdded(b, a, !1))
  9318. };
  9319. a.prototype._elementAdded = function(b, a, d) {
  9320. "undefined" === typeof d && (d = !0);
  9321. b.ownerChanged(this);
  9322. b instanceof c.DisplayObject && this._hostComponent._addToDisplayListAt(b, a, d);
  9323. d && this.hasEventListener(c.ElementExistenceEvent.ELEMENT_ADD) && c.ElementExistenceEvent.dispatchElementExistenceEvent(this, c.ElementExistenceEvent.ELEMENT_ADD, b, a);
  9324. this._hostComponent.invalidateSize();
  9325. this._hostComponent.invalidateDisplayList()
  9326. };
  9327. a.prototype._elementRemoved = function(b,
  9328. a, d) {
  9329. "undefined" === typeof d && (d = !0);
  9330. d && this.hasEventListener(c.ElementExistenceEvent.ELEMENT_REMOVE) && c.ElementExistenceEvent.dispatchElementExistenceEvent(this, c.ElementExistenceEvent.ELEMENT_REMOVE, b, a);
  9331. b instanceof c.DisplayObject && b.parent == this._hostComponent && this._hostComponent._removeFromDisplayList(b, d);
  9332. b.ownerChanged(null);
  9333. this._hostComponent.invalidateSize();
  9334. this._hostComponent.invalidateDisplayList()
  9335. };
  9336. Object.defineProperty(a.prototype, "states", {
  9337. get: function() {
  9338. return this._states
  9339. },
  9340. set: function(b) {
  9341. this._setStates(b)
  9342. },
  9343. enumerable: !0,
  9344. configurable: !0
  9345. });
  9346. a.prototype._setStates = function(b) {
  9347. b || (b = []);
  9348. if ("string" == typeof b[0])
  9349. for (var a = b.length, d = 0; d < a; d++) {
  9350. var e = new c.State(b[d], []);
  9351. b[d] = e
  9352. }
  9353. this._states = b;
  9354. this.currentStateChanged = !0;
  9355. this.requestedCurrentState = this._currentState;
  9356. this.hasState(this.requestedCurrentState) || (this.requestedCurrentState = this.getDefaultState())
  9357. };
  9358. Object.defineProperty(a.prototype, "currentState", {
  9359. get: function() {
  9360. return this.currentStateChanged ? this.requestedCurrentState : this._currentState ? this._currentState :
  9361. this.getDefaultState()
  9362. },
  9363. set: function(b) {
  9364. b || (b = this.getDefaultState());
  9365. b != this.currentState && b && this.currentState && (this.requestedCurrentState = b, this.currentStateChanged = !0, this._hostComponent && this.commitCurrentState())
  9366. },
  9367. enumerable: !0,
  9368. configurable: !0
  9369. });
  9370. a.prototype.hasState = function(b) {
  9371. return null != this.getState(b)
  9372. };
  9373. a.prototype.getDefaultState = function() {
  9374. return 0 < this._states.length ? this._states[0].name : null
  9375. };
  9376. a.prototype.commitCurrentState = function() {
  9377. if (this.currentStateChanged) {
  9378. this.currentStateChanged = !1;
  9379. this.getState(this.requestedCurrentState) || (this.requestedCurrentState = this.getDefaultState());
  9380. var b = this._currentState ? this._currentState : "";
  9381. this.hasEventListener(c.StateChangeEvent.CURRENT_STATE_CHANGING) && c.StateChangeEvent.dispatchStateChangeEvent(this, c.StateChangeEvent.CURRENT_STATE_CHANGING, b, this.requestedCurrentState ? this.requestedCurrentState : "");
  9382. this.removeState(this._currentState);
  9383. (this._currentState = this.requestedCurrentState) && this.applyState(this._currentState);
  9384. this.hasEventListener(c.StateChangeEvent.CURRENT_STATE_CHANGE) &&
  9385. c.StateChangeEvent.dispatchStateChangeEvent(this, c.StateChangeEvent.CURRENT_STATE_CHANGE, b, this._currentState ? this._currentState : "")
  9386. }
  9387. };
  9388. a.prototype.getState = function(b) {
  9389. if (!b) return null;
  9390. for (var a = this._states, c = a.length, d = 0; d < c; d++) {
  9391. var e = a[d];
  9392. if (e.name == b) return e
  9393. }
  9394. return null
  9395. };
  9396. a.prototype.removeState = function(b) {
  9397. if (b = this.getState(b)) {
  9398. b = b.overrides;
  9399. for (var a = b.length - 1; 0 <= a; a--) b[a].remove(this)
  9400. }
  9401. };
  9402. a.prototype.applyState = function(b) {
  9403. if (b = this.getState(b)) {
  9404. b = b.overrides;
  9405. for (var a = b.length, c = 0; c < a; c++) b[c].apply(this)
  9406. }
  9407. };
  9408. a.prototype.initializeStates = function() {
  9409. if (!this.initialized) {
  9410. this.initialized = !0;
  9411. for (var b = this._states, a = b.length, c = 0; c < a; c++) b[c].initialize(this)
  9412. }
  9413. };
  9414. return a
  9415. }(c.EventDispatcher);
  9416. c.Skin = e
  9417. })(egret || (egret = {}));
  9418. __extends = this.__extends || function(c, e) {
  9419. function d() {
  9420. this.constructor = c
  9421. }
  9422. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  9423. d.prototype = e.prototype;
  9424. c.prototype = new d
  9425. };
  9426. (function(c) {
  9427. var e = function(d) {
  9428. function a() {
  9429. d.call(this);
  9430. this.useVirtualLayoutChanged = !1;
  9431. this.rendererToClassMap = [];
  9432. this.freeRenderers = [];
  9433. this.dataProviderChanged = this.createNewRendererFlag = !1;
  9434. this.recyclerDic = [];
  9435. this.typicalItemChanged = this.virtualLayoutUnderway = this.itemRendererSkinNameChange = !1;
  9436. this.indexToRenderer = [];
  9437. this.renderersBeingUpdated = this.cleanFreeRenderer = !1
  9438. }
  9439. __extends(a, d);
  9440. Object.defineProperty(a.prototype, "layout", {
  9441. get: function() {
  9442. return this._layout
  9443. },
  9444. set: function(b) {
  9445. b != this.layout &&
  9446. (this.layout && (this.layout.typicalLayoutRect = null, this.layout.removeEventListener("useVirtualLayoutChanged", this.layout_useVirtualLayoutChangedHandler, this)), this.layout && b && this.layout.useVirtualLayout != b.useVirtualLayout && this.changeUseVirtualLayout(), this._setLayout(b), b && (b.typicalLayoutRect = this.typicalLayoutRect, b.addEventListener("useVirtualLayoutChanged", this.layout_useVirtualLayoutChangedHandler, this)))
  9447. },
  9448. enumerable: !0,
  9449. configurable: !0
  9450. });
  9451. a.prototype.layout_useVirtualLayoutChangedHandler = function(b) {
  9452. this.changeUseVirtualLayout()
  9453. };
  9454. a.prototype.setVirtualElementIndicesInView = function(b, a) {
  9455. if (this.layout && this.layout.useVirtualLayout) {
  9456. this.virtualRendererIndices = [];
  9457. for (var c = b; c <= a; c++) this.virtualRendererIndices.push(c);
  9458. for (var d in this.indexToRenderer) d = parseInt(d), -1 == this.virtualRendererIndices.indexOf(d) && this.freeRendererByIndex(d)
  9459. }
  9460. };
  9461. a.prototype.getVirtualElementAt = function(b) {
  9462. if (0 > b || b >= this.dataProvider.length) return null;
  9463. var a = this.indexToRenderer[b];
  9464. if (!a) {
  9465. var a = this.dataProvider.getItemAt(b),
  9466. d = this.createVirtualRenderer(b);
  9467. this.indexToRenderer[b] = d;
  9468. this.updateRenderer(d, b, a);
  9469. this.createNewRendererFlag && ("validateNow" in d && d.validateNow(), this.createNewRendererFlag = !1, c.RendererExistenceEvent.dispatchRendererExistenceEvent(this, c.RendererExistenceEvent.RENDERER_ADD, d, b, a));
  9470. a = d
  9471. }
  9472. return a
  9473. };
  9474. a.prototype.freeRendererByIndex = function(b) {
  9475. if (this.indexToRenderer[b]) {
  9476. var a = this.indexToRenderer[b];
  9477. delete this.indexToRenderer[b];
  9478. a && a instanceof c.DisplayObject && this.doFreeRenderer(a)
  9479. }
  9480. };
  9481. a.prototype.doFreeRenderer = function(b) {
  9482. var a =
  9483. this.rendererToClassMap[b.hashCode].hashCode;
  9484. this.freeRenderers[a] || (this.freeRenderers[a] = []);
  9485. this.freeRenderers[a].push(b);
  9486. b.visible = !1
  9487. };
  9488. a.prototype.invalidateSize = function() {
  9489. this.createNewRendererFlag || d.prototype.invalidateSize.call(this)
  9490. };
  9491. a.prototype.createVirtualRenderer = function(b) {
  9492. b = this.dataProvider.getItemAt(b);
  9493. b = this.itemToRendererClass(b);
  9494. var a = b.hashCode,
  9495. c = this.freeRenderers;
  9496. if (c[a] && 0 < c[a].length) return b = c[a].pop(), b.visible = !0, b;
  9497. this.createNewRendererFlag = !0;
  9498. return this.createOneRenderer(b)
  9499. };
  9500. a.prototype.createOneRenderer = function(b) {
  9501. var a, d = b.hashCode,
  9502. e = this.recyclerDic[d];
  9503. e && (a = e.pop(), 0 == e.length && delete this.recyclerDic[d]);
  9504. a || (a = b.newInstance(), this.rendererToClassMap[a.hashCode] = b);
  9505. if (!(a && a instanceof c.DisplayObject)) return null;
  9506. this._itemRendererSkinName && this.setItemRenderSkinName(a);
  9507. this._addToDisplayList(a);
  9508. a.setLayoutBoundsSize(NaN, NaN);
  9509. return a
  9510. };
  9511. a.prototype.setItemRenderSkinName = function(b) {
  9512. b && (b ? b._skinNameExplicitlySet || (b.skinName = this._itemRendererSkinName) : b && !b.skinName &&
  9513. (b.skinName = this._itemRendererSkinName))
  9514. };
  9515. a.prototype.finishVirtualLayout = function() {
  9516. if (this.virtualLayoutUnderway) {
  9517. var b = this.virtualLayoutUnderway = !1,
  9518. a;
  9519. for (a in this.freeRenderers)
  9520. if (0 < this.freeRenderers[a].length) {
  9521. b = !0;
  9522. break
  9523. }
  9524. b && (this.cleanTimer || (this.cleanTimer = new c.Timer(3E3, 1), this.cleanTimer.addEventListener(c.TimerEvent.TIMER, this.cleanAllFreeRenderer, this)), this.cleanTimer.reset(), this.cleanTimer.start())
  9525. }
  9526. };
  9527. a.prototype.cleanAllFreeRenderer = function(b) {
  9528. var a = this.freeRenderers,
  9529. c;
  9530. for (c in a)
  9531. for (var d =
  9532. a[c], e = d.length, g = 0; g < e; g++) b = d[g], b.visible = !0, this.recycle(b);
  9533. this.freeRenderers = [];
  9534. this.cleanFreeRenderer = !1
  9535. };
  9536. a.prototype.getElementIndicesInView = function() {
  9537. return this.layout && this.layout.useVirtualLayout ? this.virtualRendererIndices ? this.virtualRendererIndices : [] : d.prototype.getElementIndicesInView.call(this)
  9538. };
  9539. a.prototype.changeUseVirtualLayout = function() {
  9540. this.cleanFreeRenderer = this.useVirtualLayoutChanged = !0;
  9541. this.removeDataProviderListener();
  9542. this.invalidateProperties()
  9543. };
  9544. Object.defineProperty(a.prototype,
  9545. "dataProvider", {
  9546. get: function() {
  9547. return this._dataProvider
  9548. },
  9549. set: function(b) {
  9550. this._dataProvider != b && (this.removeDataProviderListener(), this._dataProvider = b, this.cleanFreeRenderer = this.dataProviderChanged = !0, this.invalidateProperties(), this.invalidateSize(), this.invalidateDisplayList())
  9551. },
  9552. enumerable: !0,
  9553. configurable: !0
  9554. });
  9555. a.prototype.removeDataProviderListener = function() {
  9556. this._dataProvider && this._dataProvider.removeEventListener(c.CollectionEvent.COLLECTION_CHANGE, this.onCollectionChange, this)
  9557. };
  9558. a.prototype.onCollectionChange =
  9559. function(b) {
  9560. switch (b.kind) {
  9561. case c.CollectionEventKind.ADD:
  9562. this.itemAddedHandler(b.items, b.location);
  9563. break;
  9564. case c.CollectionEventKind.MOVE:
  9565. this.itemMovedHandler(b.items[0], b.location, b.oldLocation);
  9566. break;
  9567. case c.CollectionEventKind.REMOVE:
  9568. this.itemRemovedHandler(b.items, b.location);
  9569. break;
  9570. case c.CollectionEventKind.UPDATE:
  9571. this.itemUpdatedHandler(b.items[0], b.location);
  9572. break;
  9573. case c.CollectionEventKind.REPLACE:
  9574. this.itemRemoved(b.oldItems[0], b.location);
  9575. this.itemAdded(b.items[0], b.location);
  9576. break;
  9577. case c.CollectionEventKind.RESET:
  9578. case c.CollectionEventKind.REFRESH:
  9579. if (this.layout &&
  9580. this.layout.useVirtualLayout)
  9581. for (var a in this.indexToRenderer) a = parseInt(a), this.freeRendererByIndex(a);
  9582. this.dataProviderChanged = !0;
  9583. this.invalidateProperties()
  9584. }
  9585. this.invalidateSize();
  9586. this.invalidateDisplayList()
  9587. };
  9588. a.prototype.itemAddedHandler = function(b, a) {
  9589. for (var c = b.length, d = 0; d < c; d++) this.itemAdded(b[d], a + d);
  9590. this.resetRenderersIndices()
  9591. };
  9592. a.prototype.itemMovedHandler = function(b, a, c) {
  9593. this.itemRemoved(b, c);
  9594. this.itemAdded(b, a);
  9595. this.resetRenderersIndices()
  9596. };
  9597. a.prototype.itemRemovedHandler = function(b,
  9598. a) {
  9599. for (var c = b.length - 1; 0 <= c; c--) this.itemRemoved(b[c], a + c);
  9600. this.resetRenderersIndices()
  9601. };
  9602. a.prototype.itemAdded = function(b, a) {
  9603. this.layout && this.layout.elementAdded(a);
  9604. if (this.layout && this.layout.useVirtualLayout) {
  9605. var d = this.virtualRendererIndices;
  9606. if (d) {
  9607. for (var e = d.length, f = 0; f < e; f++) {
  9608. var g = d[f];
  9609. g >= a && (d[f] = g + 1)
  9610. }
  9611. this.indexToRenderer.splice(a, 0, null)
  9612. }
  9613. } else d = this.itemToRendererClass(b), d = this.createOneRenderer(d), this.indexToRenderer.splice(a, 0, d), d && (this.updateRenderer(d, a, b), c.RendererExistenceEvent.dispatchRendererExistenceEvent(this,
  9614. c.RendererExistenceEvent.RENDERER_ADD, d, a, b))
  9615. };
  9616. a.prototype.itemRemoved = function(b, a) {
  9617. this.layout && this.layout.elementRemoved(a);
  9618. var d = this.virtualRendererIndices;
  9619. if (d && 0 < d.length) {
  9620. for (var e = -1, f = d.length, g = 0; g < f; g++) {
  9621. var k = d[g];
  9622. k == a ? e = g : k > a && (d[g] = k - 1)
  9623. } - 1 != e && d.splice(e, 1)
  9624. }
  9625. d = this.indexToRenderer[a];
  9626. this.indexToRenderer.length > a && this.indexToRenderer.splice(a, 1);
  9627. c.RendererExistenceEvent.dispatchRendererExistenceEvent(this, c.RendererExistenceEvent.RENDERER_REMOVE, d, a, b);
  9628. d && d instanceof c.DisplayObject &&
  9629. this.recycle(d)
  9630. };
  9631. a.prototype.recycle = function(b) {
  9632. this._removeFromDisplayList(b);
  9633. "ownerChanged" in b && b.ownerChanged(null);
  9634. var a = this.rendererToClassMap[b.hashCode].hashCode;
  9635. this.recyclerDic[a] || (this.recyclerDic[a] = new c.Recycler);
  9636. this.recyclerDic[a].push(b)
  9637. };
  9638. a.prototype.resetRenderersIndices = function() {
  9639. if (0 != this.indexToRenderer.length)
  9640. if (this.layout && this.layout.useVirtualLayout)
  9641. for (var b = this.virtualRendererIndices, a = b.length, c = 0; c < a; c++) {
  9642. var d = b[c];
  9643. this.resetRendererItemIndex(d)
  9644. } else
  9645. for (b = this.indexToRenderer.length,
  9646. d = 0; d < b; d++) this.resetRendererItemIndex(d)
  9647. };
  9648. a.prototype.itemUpdatedHandler = function(b, a) {
  9649. if (!this.renderersBeingUpdated) {
  9650. var c = this.indexToRenderer[a];
  9651. c && this.updateRenderer(c, a, b)
  9652. }
  9653. };
  9654. a.prototype.resetRendererItemIndex = function(b) {
  9655. var a = this.indexToRenderer[b];
  9656. a && (a.itemIndex = b)
  9657. };
  9658. Object.defineProperty(a.prototype, "itemRenderer", {
  9659. get: function() {
  9660. return this._itemRenderer
  9661. },
  9662. set: function(b) {
  9663. this._itemRenderer !== b && (this._itemRenderer = b, this.cleanFreeRenderer = this.typicalItemChanged = this.itemRendererChanged = !0, this.removeDataProviderListener(), this.invalidateProperties())
  9664. },
  9665. enumerable: !0,
  9666. configurable: !0
  9667. });
  9668. Object.defineProperty(a.prototype, "itemRendererSkinName", {
  9669. get: function() {
  9670. return this._itemRendererSkinName
  9671. },
  9672. set: function(b) {
  9673. this._itemRendererSkinName != b && (this._itemRendererSkinName = b) && this.initialized && (this.itemRendererSkinNameChange = !0, this.invalidateProperties())
  9674. },
  9675. enumerable: !0,
  9676. configurable: !0
  9677. });
  9678. Object.defineProperty(a.prototype, "itemRendererFunction", {
  9679. get: function() {
  9680. return this._itemRendererFunction
  9681. },
  9682. set: function(b) {
  9683. this._itemRendererFunction != b && (this._itemRendererFunction = b, this.typicalItemChanged = this.itemRendererChanged = !0, this.removeDataProviderListener(), this.invalidateProperties())
  9684. },
  9685. enumerable: !0,
  9686. configurable: !0
  9687. });
  9688. a.prototype.itemToRendererClass = function(b) {
  9689. null != this._itemRendererFunction ? (b = this._itemRendererFunction(b), b || (b = this._itemRenderer)) : b = this._itemRenderer;
  9690. return b ? b : a.defaultRendererFactory
  9691. };
  9692. a.prototype.createChildren = function() {
  9693. if (!this.layout) {
  9694. var b = new c.VerticalLayout;
  9695. b.gap = 0;
  9696. b.horizontalAlign = c.HorizontalAlign.CONTENT_JUSTIFY;
  9697. this.layout = b
  9698. }
  9699. d.prototype.createChildren.call(this)
  9700. };
  9701. a.prototype.commitProperties = function() {
  9702. if (this.itemRendererChanged || this.dataProviderChanged || this.useVirtualLayoutChanged) this.removeAllRenderers(), this.layout && this.layout.clearVirtualLayoutCache(), this.setTypicalLayoutRect(null), this.itemRendererChanged = this.useVirtualLayoutChanged = !1, this._dataProvider && this._dataProvider.addEventListener(c.CollectionEvent.COLLECTION_CHANGE, this.onCollectionChange,
  9703. this), this.layout && this.layout.useVirtualLayout ? (this.invalidateSize(), this.invalidateDisplayList()) : this.createRenderers(), this.dataProviderChanged && (this.dataProviderChanged = !1, this.verticalScrollPosition = this.horizontalScrollPosition = 0);
  9704. d.prototype.commitProperties.call(this);
  9705. this.typicalItemChanged && (this.typicalItemChanged = !1, this._dataProvider && 0 < this._dataProvider.length && (this.typicalItem = this._dataProvider.getItemAt(0), this.measureRendererSize()));
  9706. if (this.itemRendererSkinNameChange) {
  9707. this.itemRendererSkinNameChange = !1;
  9708. for (var b = this.indexToRenderer.length, a = 0; a < b; a++) this.setItemRenderSkinName(this.indexToRenderer[a]);
  9709. var e = this.freeRenderers,
  9710. m;
  9711. for (m in e) {
  9712. var f = e[m];
  9713. if (f)
  9714. for (b = f.length, a = 0; a < b; a++) this.setItemRenderSkinName(f[a])
  9715. }
  9716. }
  9717. };
  9718. a.prototype.measure = function() {
  9719. this.layout && this.layout.useVirtualLayout && this.ensureTypicalLayoutElement();
  9720. d.prototype.measure.call(this)
  9721. };
  9722. a.prototype.updateDisplayList = function(b, a) {
  9723. this._layoutInvalidateDisplayListFlag && this.layout && this.layout.useVirtualLayout && (this.virtualLayoutUnderway = !0, this.ensureTypicalLayoutElement());
  9724. d.prototype.updateDisplayList.call(this, b, a);
  9725. this.virtualLayoutUnderway && this.finishVirtualLayout()
  9726. };
  9727. a.prototype.ensureTypicalLayoutElement = function() {
  9728. !this.layout.typicalLayoutRect && this._dataProvider && 0 < this._dataProvider.length && (this.typicalItem = this._dataProvider.getItemAt(0), this.measureRendererSize())
  9729. };
  9730. a.prototype.measureRendererSize = function() {
  9731. if (this.typicalItem) {
  9732. var b = this.itemToRendererClass(this.typicalItem);
  9733. if (b = this.createOneRenderer(b)) {
  9734. this.createNewRendererFlag = !0;
  9735. this.updateRenderer(b, 0, this.typicalItem);
  9736. "validateNow" in b && b.validateNow();
  9737. var a = new c.Rectangle(0, 0, b.preferredWidth, b.preferredHeight);
  9738. this.recycle(b);
  9739. this.setTypicalLayoutRect(a);
  9740. this.createNewRendererFlag = !1
  9741. } else this.setTypicalLayoutRect(null)
  9742. } else this.setTypicalLayoutRect(null)
  9743. };
  9744. a.prototype.setTypicalLayoutRect = function(b) {
  9745. this.typicalLayoutRect = b;
  9746. this.layout && (this.layout.typicalLayoutRect = b)
  9747. };
  9748. a.prototype.removeAllRenderers = function() {
  9749. for (var b = this.indexToRenderer.length, a, d = 0; d < b; d++)
  9750. if (a =
  9751. this.indexToRenderer[d]) this.recycle(a), c.RendererExistenceEvent.dispatchRendererExistenceEvent(this, c.RendererExistenceEvent.RENDERER_REMOVE, a, a.itemIndex, a.data);
  9752. this.indexToRenderer = [];
  9753. this.virtualRendererIndices = null;
  9754. this.cleanFreeRenderer && this.cleanAllFreeRenderer()
  9755. };
  9756. a.prototype.createRenderers = function() {
  9757. if (this._dataProvider)
  9758. for (var b = 0, a = this._dataProvider.length, d = 0; d < a; d++) {
  9759. var e = this._dataProvider.getItemAt(d),
  9760. f = this.itemToRendererClass(e);
  9761. if (f = this.createOneRenderer(f)) this.indexToRenderer[b] =
  9762. f, this.updateRenderer(f, b, e), c.RendererExistenceEvent.dispatchRendererExistenceEvent(this, c.RendererExistenceEvent.RENDERER_ADD, f, b, e), b++
  9763. }
  9764. };
  9765. a.prototype.updateRenderer = function(b, a, c) {
  9766. this.renderersBeingUpdated = !0;
  9767. this._rendererOwner ? b = this._rendererOwner.updateRenderer(b, a, c) : ("ownerChanged" in b && b.ownerChanged(this), b.itemIndex = a, b.label = this.itemToLabel(c), b.data = c);
  9768. this.renderersBeingUpdated = !1;
  9769. return b
  9770. };
  9771. a.prototype.itemToLabel = function(b) {
  9772. return b ? b.toString() : " "
  9773. };
  9774. a.prototype.getElementAt = function(b) {
  9775. return this.indexToRenderer[b]
  9776. };
  9777. a.prototype.getElementIndex = function(b) {
  9778. return b ? this.indexToRenderer.indexOf(b) : -1
  9779. };
  9780. Object.defineProperty(a.prototype, "numElements", {
  9781. get: function() {
  9782. return this._dataProvider ? this._dataProvider.length : 0
  9783. },
  9784. enumerable: !0,
  9785. configurable: !0
  9786. });
  9787. a.prototype.addChild = function(b) {
  9788. throw Error("addChild()" + a.errorStr + "addElement()\u4ee3\u66ff");
  9789. };
  9790. a.prototype.addChildAt = function(b, c) {
  9791. throw Error("addChildAt()" + a.errorStr + "addElementAt()\u4ee3\u66ff");
  9792. };
  9793. a.prototype.removeChild = function(b) {
  9794. throw Error("removeChild()" +
  9795. a.errorStr + "removeElement()\u4ee3\u66ff");
  9796. };
  9797. a.prototype.removeChildAt = function(b) {
  9798. throw Error("removeChildAt()" + a.errorStr + "removeElementAt()\u4ee3\u66ff");
  9799. };
  9800. a.prototype.setChildIndex = function(b, c) {
  9801. throw Error("setChildIndex()" + a.errorStr + "setElementIndex()\u4ee3\u66ff");
  9802. };
  9803. a.prototype.swapChildren = function(b, c) {
  9804. throw Error("swapChildren()" + a.errorStr + "swapElements()\u4ee3\u66ff");
  9805. };
  9806. a.prototype.swapChildrenAt = function(b, c) {
  9807. throw Error("swapChildrenAt()" + a.errorStr + "swapElementsAt()\u4ee3\u66ff");
  9808. };
  9809. a.defaultRendererFactory = new c.ClassFactory(c.ItemRenderer);
  9810. a.errorStr = "\u5728\u6b64\u7ec4\u4ef6\u4e2d\u4e0d\u53ef\u7528\uff0c\u82e5\u6b64\u7ec4\u4ef6\u4e3a\u5bb9\u5668\u7c7b\uff0c\u8bf7\u4f7f\u7528";
  9811. return a
  9812. }(c.GroupBase);
  9813. c.DataGroup = e
  9814. })(egret || (egret = {}));
  9815. __extends = this.__extends || function(c, e) {
  9816. function d() {
  9817. this.constructor = c
  9818. }
  9819. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  9820. d.prototype = e.prototype;
  9821. c.prototype = new d
  9822. };
  9823. (function(c) {
  9824. var e = function(d) {
  9825. function a() {
  9826. d.call(this);
  9827. this.contentGroupProperties = {};
  9828. this.hostComponentKey = "egret.SkinnableContainer"
  9829. }
  9830. __extends(a, d);
  9831. a.prototype._getCurrentContentGroup = function() {
  9832. return null == this.contentGroup ? (null == this._placeHolderGroup && (this._placeHolderGroup = new c.Group, this._placeHolderGroup.visible = !1, this._addToDisplayList(this._placeHolderGroup)), this._placeHolderGroup.addEventListener(c.ElementExistenceEvent.ELEMENT_ADD, this._contentGroup_elementAddedHandler, this), this._placeHolderGroup.addEventListener(c.ElementExistenceEvent.ELEMENT_REMOVE,
  9833. this._contentGroup_elementRemovedHandler, this), this._placeHolderGroup) : this.contentGroup
  9834. };
  9835. Object.defineProperty(a.prototype, "elementsContent", {
  9836. set: function(b) {
  9837. this._getCurrentContentGroup().elementsContent = b
  9838. },
  9839. enumerable: !0,
  9840. configurable: !0
  9841. });
  9842. Object.defineProperty(a.prototype, "numElements", {
  9843. get: function() {
  9844. return this._getCurrentContentGroup().numElements
  9845. },
  9846. enumerable: !0,
  9847. configurable: !0
  9848. });
  9849. a.prototype.getElementAt = function(b) {
  9850. return this._getCurrentContentGroup().getElementAt(b)
  9851. };
  9852. a.prototype.addElement =
  9853. function(b) {
  9854. return this._getCurrentContentGroup().addElement(b)
  9855. };
  9856. a.prototype.addElementAt = function(b, a) {
  9857. return this._getCurrentContentGroup().addElementAt(b, a)
  9858. };
  9859. a.prototype.removeElement = function(b) {
  9860. return this._getCurrentContentGroup().removeElement(b)
  9861. };
  9862. a.prototype.removeElementAt = function(b) {
  9863. return this._getCurrentContentGroup().removeElementAt(b)
  9864. };
  9865. a.prototype.removeAllElements = function() {
  9866. this._getCurrentContentGroup().removeAllElements()
  9867. };
  9868. a.prototype.getElementIndex = function(b) {
  9869. return this._getCurrentContentGroup().getElementIndex(b)
  9870. };
  9871. a.prototype.setElementIndex = function(b, a) {
  9872. this._getCurrentContentGroup().setElementIndex(b, a)
  9873. };
  9874. a.prototype.swapElements = function(b, a) {
  9875. this._getCurrentContentGroup().swapElements(b, a)
  9876. };
  9877. a.prototype.swapElementsAt = function(b, a) {
  9878. this._getCurrentContentGroup().swapElementsAt(b, a)
  9879. };
  9880. Object.defineProperty(a.prototype, "layout", {
  9881. get: function() {
  9882. return null != this.contentGroup ? this.contentGroup.layout : this.contentGroupProperties.layout
  9883. },
  9884. set: function(b) {
  9885. null != this.contentGroup ? this.contentGroup.layout = b : this.contentGroupProperties.layout =
  9886. b
  9887. },
  9888. enumerable: !0,
  9889. configurable: !0
  9890. });
  9891. a.prototype.partAdded = function(b, a) {
  9892. d.prototype.partAdded.call(this, b, a);
  9893. if (a == this.contentGroup) {
  9894. void 0 !== this.contentGroupProperties.layout && (this.contentGroup.layout = this.contentGroupProperties.layout, this.contentGroupProperties = {});
  9895. if (this._placeHolderGroup) {
  9896. this._placeHolderGroup.removeEventListener(c.ElementExistenceEvent.ELEMENT_ADD, this._contentGroup_elementAddedHandler, this);
  9897. this._placeHolderGroup.removeEventListener(c.ElementExistenceEvent.ELEMENT_REMOVE,
  9898. this._contentGroup_elementRemovedHandler, this);
  9899. for (var e = this._placeHolderGroup._getElementsContent().concat(), m = this._placeHolderGroup.numElements; 0 < m; m--) {
  9900. var f = this._placeHolderGroup.removeElementAt(0);
  9901. f.ownerChanged(null)
  9902. }
  9903. this._removeFromDisplayList(this._placeHolderGroup);
  9904. this.contentGroup.elementsContent = e;
  9905. for (m = e.length - 1; 0 <= m; m--) f = e[m], f.ownerChanged(this);
  9906. this._placeHolderGroup = null
  9907. }
  9908. this.contentGroup.addEventListener(c.ElementExistenceEvent.ELEMENT_ADD, this._contentGroup_elementAddedHandler,
  9909. this);
  9910. this.contentGroup.addEventListener(c.ElementExistenceEvent.ELEMENT_REMOVE, this._contentGroup_elementRemovedHandler, this)
  9911. }
  9912. };
  9913. a.prototype.partRemoved = function(b, a) {
  9914. d.prototype.partRemoved.call(this, b, a);
  9915. if (a == this.contentGroup && (this.contentGroup.removeEventListener(c.ElementExistenceEvent.ELEMENT_ADD, this._contentGroup_elementAddedHandler, this), this.contentGroup.removeEventListener(c.ElementExistenceEvent.ELEMENT_REMOVE, this._contentGroup_elementRemovedHandler, this), this.contentGroupProperties.layout =
  9916. this.contentGroup.layout, this.contentGroup.layout = null, 0 < this.contentGroup.numElements)) {
  9917. for (this._placeHolderGroup = new c.Group; 0 < this.contentGroup.numElements;) this._placeHolderGroup.addElement(this.contentGroup.getElementAt(0));
  9918. this._placeHolderGroup.addEventListener(c.ElementExistenceEvent.ELEMENT_ADD, this._contentGroup_elementAddedHandler, this);
  9919. this._placeHolderGroup.addEventListener(c.ElementExistenceEvent.ELEMENT_REMOVE, this._contentGroup_elementRemovedHandler, this)
  9920. }
  9921. };
  9922. a.prototype._contentGroup_elementAddedHandler =
  9923. function(b) {
  9924. b.element.ownerChanged(this);
  9925. this.dispatchEvent(b)
  9926. };
  9927. a.prototype._contentGroup_elementRemovedHandler = function(b) {
  9928. b.element.ownerChanged(null);
  9929. this.dispatchEvent(b)
  9930. };
  9931. return a
  9932. }(c.SkinnableComponent);
  9933. c.SkinnableContainer = e
  9934. })(egret || (egret = {}));
  9935. __extends = this.__extends || function(c, e) {
  9936. function d() {
  9937. this.constructor = c
  9938. }
  9939. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  9940. d.prototype = e.prototype;
  9941. c.prototype = new d
  9942. };
  9943. (function(c) {
  9944. var e = function(d) {
  9945. function a() {
  9946. d.call(this);
  9947. this._dataGroupProperties = {};
  9948. this.hostComponentKey = "egret.SkinnableDataContainer"
  9949. }
  9950. __extends(a, d);
  9951. a.prototype.updateRenderer = function(b, a, c) {
  9952. "ownerChanged" in b && b.ownerChanged(this);
  9953. b.itemIndex = a;
  9954. b.label = this.itemToLabel(c);
  9955. b.data = c;
  9956. return b
  9957. };
  9958. a.prototype.itemToLabel = function(b) {
  9959. return null !== b ? b.toString() : " "
  9960. };
  9961. Object.defineProperty(a.prototype, "dataProvider", {
  9962. get: function() {
  9963. return this._getDataProvider()
  9964. },
  9965. set: function(b) {
  9966. this._setDataProvider(b)
  9967. },
  9968. enumerable: !0,
  9969. configurable: !0
  9970. });
  9971. a.prototype._getDataProvider = function() {
  9972. return null != this.dataGroup ? this.dataGroup.dataProvider : this._dataGroupProperties.dataProvider
  9973. };
  9974. a.prototype._setDataProvider = function(b) {
  9975. null == this.dataGroup ? this._dataGroupProperties.dataProvider = b : (this.dataGroup.dataProvider = b, this._dataGroupProperties.dataProvider = !0)
  9976. };
  9977. Object.defineProperty(a.prototype, "itemRenderer", {
  9978. get: function() {
  9979. return this.dataGroup ? this.dataGroup.itemRenderer : this._dataGroupProperties.itemRenderer
  9980. },
  9981. set: function(b) {
  9982. null == this.dataGroup ? this._dataGroupProperties.itemRenderer = b : (this.dataGroup.itemRenderer = b, this._dataGroupProperties.itemRenderer = !0)
  9983. },
  9984. enumerable: !0,
  9985. configurable: !0
  9986. });
  9987. Object.defineProperty(a.prototype, "itemRendererSkinName", {
  9988. get: function() {
  9989. return this.dataGroup ? this.dataGroup.itemRendererSkinName : this._dataGroupProperties.itemRendererSkinName
  9990. },
  9991. set: function(b) {
  9992. null == this.dataGroup ? this._dataGroupProperties.itemRendererSkinName = b : (this.dataGroup.itemRendererSkinName = b, this._dataGroupProperties.itemRendererSkinName = !0)
  9993. },
  9994. enumerable: !0,
  9995. configurable: !0
  9996. });
  9997. Object.defineProperty(a.prototype, "itemRendererFunction", {
  9998. get: function() {
  9999. return this.dataGroup ? this.dataGroup.itemRendererFunction : this._dataGroupProperties.itemRendererFunction
  10000. },
  10001. set: function(b) {
  10002. null == this.dataGroup ? this._dataGroupProperties.itemRendererFunction = b : (this.dataGroup.itemRendererFunction = b, this._dataGroupProperties.itemRendererFunction = !0)
  10003. },
  10004. enumerable: !0,
  10005. configurable: !0
  10006. });
  10007. Object.defineProperty(a.prototype, "layout", {
  10008. get: function() {
  10009. return this.dataGroup ?
  10010. this.dataGroup.layout : this._dataGroupProperties.layout
  10011. },
  10012. set: function(b) {
  10013. this._setLayout(b)
  10014. },
  10015. enumerable: !0,
  10016. configurable: !0
  10017. });
  10018. a.prototype._setLayout = function(b) {
  10019. null == this.dataGroup ? this._dataGroupProperties.layout = b : (this.dataGroup.layout = b, this._dataGroupProperties.layout = !0)
  10020. };
  10021. a.prototype.partAdded = function(b, a) {
  10022. d.prototype.partAdded.call(this, b, a);
  10023. if (a == this.dataGroup) {
  10024. var e = {};
  10025. void 0 !== this._dataGroupProperties.layout && (this.dataGroup.layout = this._dataGroupProperties.layout, e.layout = !0);
  10026. void 0 !==
  10027. this._dataGroupProperties.dataProvider && (this.dataGroup.dataProvider = this._dataGroupProperties.dataProvider, e.dataProvider = !0);
  10028. void 0 !== this._dataGroupProperties.itemRenderer && (this.dataGroup.itemRenderer = this._dataGroupProperties.itemRenderer, e.itemRenderer = !0);
  10029. void 0 !== this._dataGroupProperties.itemRendererSkinName && (this.dataGroup.itemRendererSkinName = this._dataGroupProperties.itemRendererSkinName, e.itemRendererSkinName = !0);
  10030. void 0 !== this._dataGroupProperties.itemRendererFunction && (this.dataGroup.itemRendererFunction =
  10031. this._dataGroupProperties.itemRendererFunction, e.itemRendererFunction = !0);
  10032. this.dataGroup._rendererOwner = this;
  10033. this._dataGroupProperties = e;
  10034. this.hasEventListener(c.RendererExistenceEvent.RENDERER_ADD) && this.dataGroup.addEventListener(c.RendererExistenceEvent.RENDERER_ADD, this.dispatchEvent, this);
  10035. this.hasEventListener(c.RendererExistenceEvent.RENDERER_REMOVE) && this.dataGroup.addEventListener(c.RendererExistenceEvent.RENDERER_REMOVE, this.dispatchEvent, this)
  10036. }
  10037. };
  10038. a.prototype.partRemoved = function(b, a) {
  10039. d.prototype.partRemoved.call(this,
  10040. b, a);
  10041. if (a == this.dataGroup) {
  10042. this.dataGroup.removeEventListener(c.RendererExistenceEvent.RENDERER_ADD, this.dispatchEvent, this);
  10043. this.dataGroup.removeEventListener(c.RendererExistenceEvent.RENDERER_REMOVE, this.dispatchEvent, this);
  10044. var e = {};
  10045. this._dataGroupProperties.layout && (e.layout = this.dataGroup.layout);
  10046. this._dataGroupProperties.dataProvider && (e.dataProvider = this.dataGroup.dataProvider);
  10047. this._dataGroupProperties.itemRenderer && (e.itemRenderer = this.dataGroup.itemRenderer);
  10048. this._dataGroupProperties.itemRendererSkinName &&
  10049. (e.itemRendererSkinName = this.dataGroup.itemRendererSkinName);
  10050. this._dataGroupProperties.itemRendererFunction && (e.itemRendererFunction = this.dataGroup.itemRendererFunction);
  10051. this._dataGroupProperties = e;
  10052. this.dataGroup._rendererOwner = null;
  10053. this.dataGroup.dataProvider = null;
  10054. this.dataGroup.layout = null
  10055. }
  10056. };
  10057. a.prototype.addEventListener = function(b, a, e, m, f) {
  10058. "undefined" === typeof m && (m = !1);
  10059. "undefined" === typeof f && (f = 0);
  10060. d.prototype.addEventListener.call(this, b, a, e, m, f);
  10061. b == c.RendererExistenceEvent.RENDERER_ADD && this.dataGroup &&
  10062. this.dataGroup.addEventListener(c.RendererExistenceEvent.RENDERER_ADD, this.dispatchEvent, this);
  10063. b == c.RendererExistenceEvent.RENDERER_REMOVE && this.dataGroup && this.dataGroup.addEventListener(c.RendererExistenceEvent.RENDERER_REMOVE, this.dispatchEvent, this)
  10064. };
  10065. a.prototype.removeEventListener = function(b, a, e, m) {
  10066. "undefined" === typeof m && (m = !1);
  10067. d.prototype.removeEventListener.call(this, b, a, e, m);
  10068. b == c.RendererExistenceEvent.RENDERER_ADD && this.dataGroup && (this.hasEventListener(c.RendererExistenceEvent.RENDERER_ADD) ||
  10069. this.dataGroup.removeEventListener(c.RendererExistenceEvent.RENDERER_ADD, this.dispatchEvent, this));
  10070. b == c.RendererExistenceEvent.RENDERER_REMOVE && this.dataGroup && (this.hasEventListener(c.RendererExistenceEvent.RENDERER_REMOVE) || this.dataGroup.removeEventListener(c.RendererExistenceEvent.RENDERER_REMOVE, this.dispatchEvent, this))
  10071. };
  10072. return a
  10073. }(c.SkinnableComponent);
  10074. c.SkinnableDataContainer = e
  10075. })(egret || (egret = {}));
  10076. __extends = this.__extends || function(c, e) {
  10077. function d() {
  10078. this.constructor = c
  10079. }
  10080. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  10081. d.prototype = e.prototype;
  10082. c.prototype = new d
  10083. };
  10084. (function(c) {
  10085. var e = function(d) {
  10086. function a() {
  10087. d.call(this);
  10088. this._doingWholesaleChanges = !1;
  10089. this._labelField = "label";
  10090. this.requireSelectionChanged = this._requireSelection = !1;
  10091. this._proposedSelectedIndex = a.NO_PROPOSED_SELECTION;
  10092. this._selectedIndex = a.NO_SELECTION;
  10093. this.selectedIndexAdjusted = this._useVirtualLayout = this._dispatchChangeAfterSelection = this._allowCustomSelectedItem = !1
  10094. }
  10095. __extends(a, d);
  10096. a.prototype._setDataProvider = function(b) {
  10097. this.dataProvider && this.dataProvider.removeEventListener(c.CollectionEvent.COLLECTION_CHANGE,
  10098. this.dataProvider_collectionChangeHandler, this);
  10099. this._doingWholesaleChanges = this.dataProviderChanged = !0;
  10100. b && b.addEventListener(c.CollectionEvent.COLLECTION_CHANGE, this.dataProvider_collectionChangeHandler, this);
  10101. d.prototype._setDataProvider.call(this, b);
  10102. this.invalidateProperties()
  10103. };
  10104. Object.defineProperty(a.prototype, "layout", {
  10105. get: function() {
  10106. return this.dataGroup ? this.dataGroup.layout : this._dataGroupProperties.layout
  10107. },
  10108. set: function(b) {
  10109. b && this.useVirtualLayout && (b.useVirtualLayout = !0);
  10110. this._setLayout(b)
  10111. },
  10112. enumerable: !0,
  10113. configurable: !0
  10114. });
  10115. Object.defineProperty(a.prototype, "labelField", {
  10116. get: function() {
  10117. return this._labelField
  10118. },
  10119. set: function(b) {
  10120. this._setLabelField(b)
  10121. },
  10122. enumerable: !0,
  10123. configurable: !0
  10124. });
  10125. a.prototype._setLabelField = function(b) {
  10126. b != this._labelField && (this._labelField = b, this.labelFieldOrFunctionChanged = !0, this.invalidateProperties())
  10127. };
  10128. Object.defineProperty(a.prototype, "labelFunction", {
  10129. get: function() {
  10130. return this._labelFunction
  10131. },
  10132. set: function(b) {
  10133. this._setLabelFunction(b)
  10134. },
  10135. enumerable: !0,
  10136. configurable: !0
  10137. });
  10138. a.prototype._setLabelFunction = function(b) {
  10139. b != this._labelFunction && (this._labelFunction = b, this.labelFieldOrFunctionChanged = !0, this.invalidateProperties())
  10140. };
  10141. Object.defineProperty(a.prototype, "requireSelection", {
  10142. get: function() {
  10143. return this._requireSelection
  10144. },
  10145. set: function(b) {
  10146. this._setRequireSelection(b)
  10147. },
  10148. enumerable: !0,
  10149. configurable: !0
  10150. });
  10151. a.prototype._setRequireSelection = function(b) {
  10152. b != this._requireSelection && (this._requireSelection = b) && (this.requireSelectionChanged = !0, this.invalidateProperties())
  10153. };
  10154. Object.defineProperty(a.prototype,
  10155. "selectedIndex", {
  10156. get: function() {
  10157. return this._getSelectedIndex()
  10158. },
  10159. set: function(b) {
  10160. this._setSelectedIndex(b, !1)
  10161. },
  10162. enumerable: !0,
  10163. configurable: !0
  10164. });
  10165. a.prototype._getSelectedIndex = function() {
  10166. return this._proposedSelectedIndex != a.NO_PROPOSED_SELECTION ? this._proposedSelectedIndex : this._selectedIndex
  10167. };
  10168. a.prototype._setSelectedIndex = function(b, a) {
  10169. "undefined" === typeof a && (a = !1);
  10170. b != this.selectedIndex && (a && (this._dispatchChangeAfterSelection = this._dispatchChangeAfterSelection || a), this._proposedSelectedIndex = b, this.invalidateProperties())
  10171. };
  10172. Object.defineProperty(a.prototype, "selectedItem", {
  10173. get: function() {
  10174. return void 0 !== this._pendingSelectedItem ? this._pendingSelectedItem : this._allowCustomSelectedItem && this.selectedIndex == a.CUSTOM_SELECTED_ITEM ? this._selectedItem : this.selectedIndex == a.NO_SELECTION || null == this.dataProvider ? void 0 : this.dataProvider.length > this.selectedIndex ? this.dataProvider.getItemAt(this.selectedIndex) : void 0
  10175. },
  10176. set: function(b) {
  10177. this._setSelectedItem(b, !1)
  10178. },
  10179. enumerable: !0,
  10180. configurable: !0
  10181. });
  10182. a.prototype._setSelectedItem = function(b,
  10183. a) {
  10184. "undefined" === typeof a && (a = !1);
  10185. this.selectedItem !== b && (a && (this._dispatchChangeAfterSelection = this._dispatchChangeAfterSelection || a), this._pendingSelectedItem = b, this.invalidateProperties())
  10186. };
  10187. Object.defineProperty(a.prototype, "useVirtualLayout", {
  10188. get: function() {
  10189. return this._getUseVirtualLayout()
  10190. },
  10191. set: function(b) {
  10192. this._setUseVirtualLayout(b)
  10193. },
  10194. enumerable: !0,
  10195. configurable: !0
  10196. });
  10197. a.prototype._getUseVirtualLayout = function() {
  10198. return this.layout ? this.layout.useVirtualLayout : this._useVirtualLayout
  10199. };
  10200. a.prototype._setUseVirtualLayout =
  10201. function(b) {
  10202. b != this.useVirtualLayout && (this._useVirtualLayout = b, this.layout && (this.layout.useVirtualLayout = b))
  10203. };
  10204. a.prototype.commitProperties = function() {
  10205. d.prototype.commitProperties.call(this);
  10206. this.dataProviderChanged && (this._doingWholesaleChanges = this.dataProviderChanged = !1, 0 <= this.selectedIndex && this.dataProvider && this.selectedIndex < this.dataProvider.length ? this.itemSelected(this.selectedIndex, !0) : this.requireSelection ? this._proposedSelectedIndex = 0 : this._setSelectedIndex(-1, !1));
  10207. this.requireSelectionChanged &&
  10208. (this.requireSelectionChanged = !1, this.requireSelection && this.selectedIndex == a.NO_SELECTION && this.dataProvider && 0 < this.dataProvider.length && (this._proposedSelectedIndex = 0));
  10209. void 0 !== this._pendingSelectedItem && (this._proposedSelectedIndex = this.dataProvider ? this.dataProvider.getItemIndex(this._pendingSelectedItem) : a.NO_SELECTION, this._allowCustomSelectedItem && -1 == this._proposedSelectedIndex && (this._proposedSelectedIndex = a.CUSTOM_SELECTED_ITEM, this._selectedItem = this._pendingSelectedItem), this._pendingSelectedItem =
  10210. void 0);
  10211. var b = !1;
  10212. this._proposedSelectedIndex != a.NO_PROPOSED_SELECTION && (b = this.commitSelection());
  10213. this.selectedIndexAdjusted && (this.selectedIndexAdjusted = !1, b || c.UIEvent.dispatchUIEvent(this, c.UIEvent.VALUE_COMMIT));
  10214. if (this.labelFieldOrFunctionChanged) {
  10215. if (null != this.dataGroup)
  10216. if (this.layout && this.layout.useVirtualLayout)
  10217. for (var e = this.dataGroup.getElementIndicesInView(), l = e.length, m = 0; m < l; m++) b = e[m], this.updateRendererLabelProperty(b);
  10218. else
  10219. for (e = this.dataGroup.numElements, b = 0; b < e; b++) this.updateRendererLabelProperty(b);
  10220. this.labelFieldOrFunctionChanged = !1
  10221. }
  10222. };
  10223. a.prototype.updateRendererLabelProperty = function(b) {
  10224. if (b = this.dataGroup.getElementAt(b)) b.label = this.itemToLabel(b.data)
  10225. };
  10226. a.prototype.partAdded = function(b, a) {
  10227. d.prototype.partAdded.call(this, b, a);
  10228. a == this.dataGroup && (this._useVirtualLayout && this.dataGroup.layout && (this.dataGroup.layout.useVirtualLayout = !0), this.dataGroup.addEventListener(c.RendererExistenceEvent.RENDERER_ADD, this.dataGroup_rendererAddHandler, this), this.dataGroup.addEventListener(c.RendererExistenceEvent.RENDERER_REMOVE,
  10229. this.dataGroup_rendererRemoveHandler, this))
  10230. };
  10231. a.prototype.partRemoved = function(b, a) {
  10232. d.prototype.partRemoved.call(this, b, a);
  10233. a == this.dataGroup && (this.dataGroup.removeEventListener(c.RendererExistenceEvent.RENDERER_ADD, this.dataGroup_rendererAddHandler, this), this.dataGroup.removeEventListener(c.RendererExistenceEvent.RENDERER_REMOVE, this.dataGroup_rendererRemoveHandler, this))
  10234. };
  10235. a.prototype.updateRenderer = function(b, a, c) {
  10236. this.itemSelected(a, this._isItemIndexSelected(a));
  10237. return d.prototype.updateRenderer.call(this,
  10238. b, a, c)
  10239. };
  10240. a.prototype.itemToLabel = function(b) {
  10241. if (null != this._labelFunction) return this._labelFunction(b);
  10242. if ("string" == typeof b) return b;
  10243. if (b instanceof c.XML) try {
  10244. 0 != b[this.labelField].length() && (b = b[this.labelField])
  10245. } catch (a) {} else if (b instanceof Object) try {
  10246. null != b[this.labelField] && (b = b[this.labelField])
  10247. } catch (d) {}
  10248. if ("string" == typeof b) return b;
  10249. try {
  10250. if (null !== b) return b.toString()
  10251. } catch (e) {}
  10252. return " "
  10253. };
  10254. a.prototype.itemSelected = function(b, a) {
  10255. if (this.dataGroup) {
  10256. var c = this.dataGroup.getElementAt(b);
  10257. null !=
  10258. c && (c.selected = a)
  10259. }
  10260. };
  10261. a.prototype._isItemIndexSelected = function(b) {
  10262. return b == this.selectedIndex
  10263. };
  10264. a.prototype.commitSelection = function(b) {
  10265. "undefined" === typeof b && (b = !0);
  10266. var d = this.dataProvider ? this.dataProvider.length - 1 : -1,
  10267. e = this._selectedIndex;
  10268. if (!this._allowCustomSelectedItem || this._proposedSelectedIndex != a.CUSTOM_SELECTED_ITEM)
  10269. if (this._proposedSelectedIndex < a.NO_SELECTION && (this._proposedSelectedIndex = a.NO_SELECTION), this._proposedSelectedIndex > d && (this._proposedSelectedIndex = d), this.requireSelection &&
  10270. this._proposedSelectedIndex == a.NO_SELECTION && this.dataProvider && 0 < this.dataProvider.length) return this._proposedSelectedIndex = a.NO_PROPOSED_SELECTION, this._dispatchChangeAfterSelection = !1;
  10271. d = this._proposedSelectedIndex;
  10272. if (this._dispatchChangeAfterSelection && !c.IndexChangeEvent.dispatchIndexChangeEvent(this, c.IndexChangeEvent.CHANGING, this._selectedIndex, this._proposedSelectedIndex, !0)) return this.itemSelected(this._proposedSelectedIndex, !1), this._proposedSelectedIndex = a.NO_PROPOSED_SELECTION, this._dispatchChangeAfterSelection = !1;
  10273. this._selectedIndex = d;
  10274. this._proposedSelectedIndex = a.NO_PROPOSED_SELECTION;
  10275. e != a.NO_SELECTION && this.itemSelected(e, !1);
  10276. this._selectedIndex != a.NO_SELECTION && this.itemSelected(this._selectedIndex, !0);
  10277. b && (this._dispatchChangeAfterSelection && (c.IndexChangeEvent.dispatchIndexChangeEvent(this, c.IndexChangeEvent.CHANGE, e, this._selectedIndex), this._dispatchChangeAfterSelection = !1), c.UIEvent.dispatchUIEvent(this, c.UIEvent.VALUE_COMMIT));
  10278. return !0
  10279. };
  10280. a.prototype.adjustSelection = function(b, c) {
  10281. this._proposedSelectedIndex !=
  10282. a.NO_PROPOSED_SELECTION ? this._proposedSelectedIndex = b : this._selectedIndex = b;
  10283. this.selectedIndexAdjusted = !0;
  10284. this.invalidateProperties()
  10285. };
  10286. a.prototype.itemAdded = function(b) {
  10287. this._doingWholesaleChanges || (this.selectedIndex == a.NO_SELECTION ? this.requireSelection && this.adjustSelection(b, !0) : b <= this.selectedIndex && this.adjustSelection(this.selectedIndex + 1, !0))
  10288. };
  10289. a.prototype.itemRemoved = function(b) {
  10290. this.selectedIndex == a.NO_SELECTION || this._doingWholesaleChanges || (b == this.selectedIndex ? this.requireSelection &&
  10291. this.dataProvider && 0 < this.dataProvider.length ? 0 == b ? (this._proposedSelectedIndex = 0, this.invalidateProperties()) : this._setSelectedIndex(0, !1) : this.adjustSelection(-1, !1) : b < this.selectedIndex && this.adjustSelection(this.selectedIndex - 1, !1))
  10292. };
  10293. a.prototype.dataGroup_rendererAddHandler = function(b) {
  10294. b = b.renderer;
  10295. null != b && (b.addEventListener(c.TouchEvent.TOUCH_ROLL_OVER, this.item_mouseEventHandler, this), b.addEventListener(c.TouchEvent.TOUCH_ROLL_OUT, this.item_mouseEventHandler, this))
  10296. };
  10297. a.prototype.dataGroup_rendererRemoveHandler =
  10298. function(b) {
  10299. b = b.renderer;
  10300. null != b && (b.removeEventListener(c.TouchEvent.TOUCH_ROLL_OVER, this.item_mouseEventHandler, this), b.removeEventListener(c.TouchEvent.TOUCH_ROLL_OUT, this.item_mouseEventHandler, this))
  10301. };
  10302. a.prototype.item_mouseEventHandler = function(b) {
  10303. var c = b.type,
  10304. c = a.TYPE_MAP[c];
  10305. this.hasEventListener(c) && this._dispatchListEvent(b, c, b.currentTarget)
  10306. };
  10307. a.prototype._dispatchListEvent = function(b, a, d) {
  10308. var e = -1,
  10309. e = d ? d.itemIndex : this.dataGroup.getElementIndex(b.currentTarget),
  10310. f = this.dataProvider.getItemAt(e);
  10311. c.ListEvent.dispatchListEvent(this, a, b, e, f, d)
  10312. };
  10313. a.prototype.dataProvider_collectionChangeHandler = function(b) {
  10314. var d = b.items;
  10315. if (b.kind == c.CollectionEventKind.ADD)
  10316. for (var d = d.length, e = 0; e < d; e++) this.itemAdded(b.location + e);
  10317. else if (b.kind == c.CollectionEventKind.REMOVE)
  10318. for (d = d.length, e = d - 1; 0 <= e; e--) this.itemRemoved(b.location + e);
  10319. else b.kind == c.CollectionEventKind.MOVE ? (this.itemRemoved(b.oldLocation), this.itemAdded(b.location)) : b.kind == c.CollectionEventKind.RESET ? 0 == this.dataProvider.length ? this._setSelectedIndex(a.NO_SELECTION, !1) : (this.dataProviderChanged = !0, this.invalidateProperties()) : b.kind == c.CollectionEventKind.REFRESH && this._setSelectedIndex(a.NO_SELECTION, !1)
  10320. };
  10321. a.NO_SELECTION = -1;
  10322. a.NO_PROPOSED_SELECTION = -2;
  10323. a.CUSTOM_SELECTED_ITEM = -3;
  10324. a.TYPE_MAP = {
  10325. rollOver: "itemRollOver",
  10326. rollOut: "itemRollOut"
  10327. };
  10328. return a
  10329. }(c.SkinnableDataContainer);
  10330. c.ListBase = e
  10331. })(egret || (egret = {}));
  10332. __extends = this.__extends || function(c, e) {
  10333. function d() {
  10334. this.constructor = c
  10335. }
  10336. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  10337. d.prototype = e.prototype;
  10338. c.prototype = new d
  10339. };
  10340. (function(c) {
  10341. var e = function(c) {
  10342. function a() {
  10343. c.call(this);
  10344. this._title = "";
  10345. this.hostComponentKey = "egret.Panel";
  10346. this.touchEnabled = !1
  10347. }
  10348. __extends(a, c);
  10349. Object.defineProperty(a.prototype, "title", {
  10350. get: function() {
  10351. return this._title
  10352. },
  10353. set: function(b) {
  10354. this._title = b;
  10355. this.titleDisplay && (this.titleDisplay.text = this.title)
  10356. },
  10357. enumerable: !0,
  10358. configurable: !0
  10359. });
  10360. a.prototype.partAdded = function(b, a) {
  10361. c.prototype.partAdded.call(this, b, a);
  10362. a == this.titleDisplay && (this.titleDisplay.text = this.title)
  10363. };
  10364. return a
  10365. }(c.SkinnableContainer);
  10366. c.Panel = e
  10367. })(egret || (egret = {}));
  10368. __extends = this.__extends || function(c, e) {
  10369. function d() {
  10370. this.constructor = c
  10371. }
  10372. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  10373. d.prototype = e.prototype;
  10374. c.prototype = new d
  10375. };
  10376. (function(c) {
  10377. var e = function(d) {
  10378. function a() {
  10379. d.call(this);
  10380. this._autoBackToStage = this._showCloseButton = !0;
  10381. this.hostComponentKey = "egret.TitleWindow";
  10382. this.addEventListener(c.TouchEvent.TOUCH_BEGIN, this.onWindowMouseDown, this, !0, 100)
  10383. }
  10384. __extends(a, d);
  10385. a.prototype.onWindowMouseDown = function(b) {
  10386. this.enabled && this.isPopUp && b.target != this.closeButton && c.PopUpManager.bringToFront(this)
  10387. };
  10388. Object.defineProperty(a.prototype, "showCloseButton", {
  10389. get: function() {
  10390. return this._showCloseButton
  10391. },
  10392. set: function(b) {
  10393. this._showCloseButton !=
  10394. b && (this._showCloseButton = b, this.closeButton && (this.closeButton.visible = this._showCloseButton))
  10395. },
  10396. enumerable: !0,
  10397. configurable: !0
  10398. });
  10399. Object.defineProperty(a.prototype, "autoBackToStage", {
  10400. get: function() {
  10401. return this._autoBackToStage
  10402. },
  10403. set: function(b) {
  10404. this._autoBackToStage = b
  10405. },
  10406. enumerable: !0,
  10407. configurable: !0
  10408. });
  10409. a.prototype.partAdded = function(b, a) {
  10410. d.prototype.partAdded.call(this, b, a);
  10411. a == this.moveArea ? this.moveArea.addEventListener(c.TouchEvent.TOUCH_BEGIN, this.moveArea_mouseDownHandler, this) : a == this.closeButton &&
  10412. (this.closeButton.addEventListener(c.TouchEvent.TOUCH_TAP, this.closeButton_clickHandler, this), this.closeButton.visible = this._showCloseButton)
  10413. };
  10414. a.prototype.partRemoved = function(b, a) {
  10415. d.prototype.partRemoved.call(this, b, a);
  10416. a == this.moveArea ? this.moveArea.removeEventListener(c.TouchEvent.TOUCH_BEGIN, this.moveArea_mouseDownHandler, this) : a == this.closeButton && this.closeButton.removeEventListener(c.TouchEvent.TOUCH_TAP, this.closeButton_clickHandler, this)
  10417. };
  10418. a.prototype.closeButton_clickHandler = function(b) {
  10419. c.CloseEvent.dispatchCloseEvent(this,
  10420. c.CloseEvent.CLOSE)
  10421. };
  10422. a.prototype.moveArea_mouseDownHandler = function(b) {
  10423. this.enabled && this.isPopUp && (b = this.globalToLocal(b.stageX, b.stageY, c.Point.identity), this._offsetPointX = b.x, this._offsetPointY = b.y, this._includeInLayout = !1, c.UIGlobals.stage.addEventListener(c.TouchEvent.TOUCH_MOVE, this.moveArea_mouseMoveHandler, this), c.UIGlobals.stage.addEventListener(c.TouchEvent.TOUCH_END, this.moveArea_mouseUpHandler, this), c.UIGlobals.stage.addEventListener(c.Event.LEAVE_STAGE, this.moveArea_mouseUpHandler,
  10424. this))
  10425. };
  10426. a.prototype.moveArea_mouseMoveHandler = function(b) {
  10427. b = this.globalToLocal(b.stageX, b.stageY, c.Point.identity);
  10428. this.x += b.x - this._offsetPointX;
  10429. this.y += b.y - this._offsetPointY
  10430. };
  10431. a.prototype.moveArea_mouseUpHandler = function(b) {
  10432. c.UIGlobals.stage.removeEventListener(c.TouchEvent.TOUCH_MOVE, this.moveArea_mouseMoveHandler, this);
  10433. c.UIGlobals.stage.removeEventListener(c.TouchEvent.TOUCH_END, this.moveArea_mouseUpHandler, this);
  10434. c.UIGlobals.stage.removeEventListener(c.Event.LEAVE_STAGE, this.moveArea_mouseUpHandler,
  10435. this);
  10436. this._autoBackToStage && this.adjustPosForStage();
  10437. c.LayoutUtil.adjustRelativeByXY(this);
  10438. this.includeInLayout = !0
  10439. };
  10440. a.prototype.adjustPosForStage = function() {
  10441. if (this.moveArea && this.stage) {
  10442. var b = this.moveArea.localToGlobal(0, 0),
  10443. a = b.x,
  10444. c = b.y;
  10445. 35 > b.x + this.moveArea.width && (a = 35 - this.moveArea.width);
  10446. b.x > this.stage.stageWidth - 20 && (a = this.stage.stageWidth - 20);
  10447. 20 > b.y + this.moveArea.height && (c = 20 - this.moveArea.height);
  10448. b.y > this.stage.stageHeight - 20 && (c = this.stage.stageHeight - 20);
  10449. this.x += a - b.x;
  10450. this.y += c - b.y
  10451. }
  10452. };
  10453. return a
  10454. }(c.Panel);
  10455. c.TitleWindow = e
  10456. })(egret || (egret = {}));
  10457. __extends = this.__extends || function(c, e) {
  10458. function d() {
  10459. this.constructor = c
  10460. }
  10461. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  10462. d.prototype = e.prototype;
  10463. c.prototype = new d
  10464. };
  10465. (function(c) {
  10466. var e = function(d) {
  10467. function a() {
  10468. d.call(this);
  10469. this._contentText = this._secondButtonLabel = this._firstButtonLabel = "";
  10470. this.hostComponentKey = "egret.Alert"
  10471. }
  10472. __extends(a, d);
  10473. a.show = function(b, d, e, m, f, g, k) {
  10474. "undefined" === typeof b && (b = "");
  10475. "undefined" === typeof d && (d = "");
  10476. "undefined" === typeof e && (e = null);
  10477. "undefined" === typeof m && (m = "\u786e\u5b9a");
  10478. "undefined" === typeof f && (f = "");
  10479. "undefined" === typeof g && (g = !0);
  10480. "undefined" === typeof k && (k = !0);
  10481. var n = new a;
  10482. n.contentText = b;
  10483. n.title = d;
  10484. n._firstButtonLabel = m;
  10485. n._secondButtonLabel =
  10486. f;
  10487. n.closeHandler = e;
  10488. c.PopUpManager.addPopUp(n, g, k);
  10489. return n
  10490. };
  10491. Object.defineProperty(a.prototype, "firstButtonLabel", {
  10492. get: function() {
  10493. return this._firstButtonLabel
  10494. },
  10495. set: function(b) {
  10496. this._firstButtonLabel != b && (this._firstButtonLabel = b, this.firstButton && (this.firstButton.label = b))
  10497. },
  10498. enumerable: !0,
  10499. configurable: !0
  10500. });
  10501. Object.defineProperty(a.prototype, "secondButtonLabel", {
  10502. get: function() {
  10503. return this._secondButtonLabel
  10504. },
  10505. set: function(b) {
  10506. this._secondButtonLabel != b && (this._secondButtonLabel = b, !this.secondButton ||
  10507. null != b && "" != b || (this.secondButton.includeInLayout = this.secondButton.visible = "" != this._secondButtonLabel && null != this._secondButtonLabel))
  10508. },
  10509. enumerable: !0,
  10510. configurable: !0
  10511. });
  10512. Object.defineProperty(a.prototype, "contentText", {
  10513. get: function() {
  10514. return this._contentText
  10515. },
  10516. set: function(b) {
  10517. this._contentText != b && (this._contentText = b, this.contentDisplay && (this.contentDisplay.text = b))
  10518. },
  10519. enumerable: !0,
  10520. configurable: !0
  10521. });
  10522. a.prototype.onClose = function(b) {
  10523. c.PopUpManager.removePopUp(this);
  10524. if (null != this.closeHandler) {
  10525. var d =
  10526. new c.CloseEvent(c.CloseEvent.CLOSE);
  10527. switch (b.currentTarget) {
  10528. case this.firstButton:
  10529. d.detail = a.FIRST_BUTTON;
  10530. break;
  10531. case this.secondButton:
  10532. d.detail = a.SECOND_BUTTON
  10533. }
  10534. this.closeHandler(d)
  10535. }
  10536. };
  10537. a.prototype.closeButton_clickHandler = function(b) {
  10538. d.prototype.closeButton_clickHandler.call(this, b);
  10539. c.PopUpManager.removePopUp(this);
  10540. b = new c.CloseEvent(c.CloseEvent.CLOSE, !1, !1, a.CLOSE_BUTTON);
  10541. null != this.closeHandler && this.closeHandler(b)
  10542. };
  10543. a.prototype.partAdded = function(b, a) {
  10544. d.prototype.partAdded.call(this, b, a);
  10545. a == this.contentDisplay ?
  10546. this.contentDisplay.text = this._contentText : a == this.firstButton ? (this.firstButton.label = this._firstButtonLabel, this.firstButton.addEventListener(c.TouchEvent.TOUCH_TAP, this.onClose, this)) : a == this.secondButton && (this.secondButton.label = this._secondButtonLabel, this.secondButton.includeInLayout = this.secondButton.visible = "" != this._secondButtonLabel && null != this._secondButtonLabel, this.secondButton.addEventListener(c.TouchEvent.TOUCH_TAP, this.onClose, this))
  10547. };
  10548. a.prototype.partRemoved = function(b, a) {
  10549. d.prototype.partRemoved.call(this,
  10550. b, a);
  10551. a == this.firstButton ? this.firstButton.removeEventListener(c.TouchEvent.TOUCH_TAP, this.onClose, this) : a == this.secondButton && this.secondButton.removeEventListener(c.TouchEvent.TOUCH_TAP, this.onClose, this)
  10552. };
  10553. a.FIRST_BUTTON = "firstButton";
  10554. a.SECOND_BUTTON = "secondButton";
  10555. a.CLOSE_BUTTON = "closeButton";
  10556. return a
  10557. }(c.TitleWindow);
  10558. c.Alert = e
  10559. })(egret || (egret = {}));
  10560. __extends = this.__extends || function(c, e) {
  10561. function d() {
  10562. this.constructor = c
  10563. }
  10564. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  10565. d.prototype = e.prototype;
  10566. c.prototype = new d
  10567. };
  10568. (function(c) {
  10569. var e = function(d) {
  10570. function a() {
  10571. d.call(this);
  10572. this._slideDuration = 500;
  10573. this._direction = c.ProgressBarDirection.LEFT_TO_RIGHT;
  10574. this.animationValue = 0;
  10575. this.trackResizedOrMoved = !1;
  10576. this.hostComponentKey = "egret.ProgressBar"
  10577. }
  10578. __extends(a, d);
  10579. Object.defineProperty(a.prototype, "labelFunction", {
  10580. get: function() {
  10581. return this._labelFunction
  10582. },
  10583. set: function(b) {
  10584. this._labelFunction != b && (this._labelFunction = b, this.invalidateDisplayList())
  10585. },
  10586. enumerable: !0,
  10587. configurable: !0
  10588. });
  10589. a.prototype.valueToLabel = function(b, a) {
  10590. return null !=
  10591. this.labelFunction ? this._labelFunction(b, a) : b + " / " + a
  10592. };
  10593. Object.defineProperty(a.prototype, "slideDuration", {
  10594. get: function() {
  10595. return this._slideDuration
  10596. },
  10597. set: function(b) {
  10598. this._slideDuration != b && (this._slideDuration = b, this.animator && this.animator.isPlaying && (this.animator.stop(), this._setValue(this.slideToValue)))
  10599. },
  10600. enumerable: !0,
  10601. configurable: !0
  10602. });
  10603. Object.defineProperty(a.prototype, "direction", {
  10604. get: function() {
  10605. return this._direction
  10606. },
  10607. set: function(b) {
  10608. this._direction != b && (this._direction = b, this.invalidateDisplayList())
  10609. },
  10610. enumerable: !0,
  10611. configurable: !0
  10612. });
  10613. Object.defineProperty(a.prototype, "value", {
  10614. get: function() {
  10615. return this._getValue()
  10616. },
  10617. set: function(b) {
  10618. this._getValue() != b && (this._setValue(b), 0 < this._slideDuration && this.stage ? (this.validateProperties(), this.animator || (this.animator = new c.Animation(this.animationUpdateHandler, this)), this.animator.isPlaying && (this.animationValue = this.slideToValue, this.invalidateDisplayList(), this.animator.stop()), this.slideToValue = this.nearestValidValue(b, this.snapInterval), this.slideToValue !=
  10619. this.animationValue && (b = this._slideDuration * (Math.abs(this.animationValue - this.slideToValue) / (this.maximum - this.minimum)), this.animator.duration = Infinity === b ? 0 : b, this.animator.motionPaths = [{
  10620. prop: "value",
  10621. from: this.animationValue,
  10622. to: this.slideToValue
  10623. }], this.animator.play())) : this.animationValue = this._getValue())
  10624. },
  10625. enumerable: !0,
  10626. configurable: !0
  10627. });
  10628. a.prototype.animationUpdateHandler = function(b) {
  10629. b = this.nearestValidValue(b.currentValue.value, this.snapInterval);
  10630. this.animationValue = Math.min(this.maximum, Math.max(this.minimum,
  10631. b));
  10632. this.invalidateDisplayList()
  10633. };
  10634. a.prototype.setValue = function(b) {
  10635. d.prototype.setValue.call(this, b);
  10636. this.invalidateDisplayList()
  10637. };
  10638. a.prototype.updateDisplayList = function(b, a) {
  10639. d.prototype.updateDisplayList.call(this, b, a);
  10640. this.updateSkinDisplayList()
  10641. };
  10642. a.prototype.partAdded = function(b, a) {
  10643. a == this.track && this.track instanceof c.UIComponent && (this.track.addEventListener(c.ResizeEvent.RESIZE, this.onTrackResizeOrMove, this), this.track.addEventListener(c.MoveEvent.MOVE, this.onTrackResizeOrMove, this))
  10644. };
  10645. a.prototype.partRemoved =
  10646. function(b, a) {
  10647. a == this.track && this.track instanceof c.UIComponent && (this.track.removeEventListener(c.ResizeEvent.RESIZE, this.onTrackResizeOrMove, this), this.track.removeEventListener(c.MoveEvent.MOVE, this.onTrackResizeOrMove, this))
  10648. };
  10649. a.prototype.onTrackResizeOrMove = function(b) {
  10650. this.trackResizedOrMoved = !0;
  10651. this.invalidateProperties()
  10652. };
  10653. a.prototype.commitProperties = function() {
  10654. d.prototype.commitProperties.call(this);
  10655. this.trackResizedOrMoved && (this.trackResizedOrMoved = !1, this.updateSkinDisplayList())
  10656. };
  10657. a.prototype.updateSkinDisplayList =
  10658. function() {
  10659. this.trackResizedOrMoved = !1;
  10660. var b = this.value;
  10661. this.animator && this.animator.isPlaying ? b = this.animationValue : (b = this.value, isNaN(b) && (b = 0));
  10662. var a = isNaN(this.maximum) ? 0 : this.maximum;
  10663. if (this.thumb && this.track) {
  10664. var d = isNaN(this.track.width) ? 0 : this.track.width,
  10665. d = d * this.track.scaleX,
  10666. e = isNaN(this.track.height) ? 0 : this.track.height,
  10667. e = e * this.track.scaleY,
  10668. f = Math.round(b / a * d);
  10669. if (isNaN(f) || 0 > f || Infinity === f) f = 0;
  10670. var g = Math.round(b / a * e);
  10671. if (isNaN(g) || 0 > g || Infinity === g) g = 0;
  10672. var k = this.track.localToGlobal(0,
  10673. 0),
  10674. n = this.globalToLocal(k.x, k.y, c.Point.identity),
  10675. k = n.x,
  10676. n = n.y;
  10677. switch (this._direction) {
  10678. case c.ProgressBarDirection.LEFT_TO_RIGHT:
  10679. this.thumb.width = f;
  10680. this.thumb.height = e;
  10681. this.thumb.x = k;
  10682. break;
  10683. case c.ProgressBarDirection.RIGHT_TO_LEFT:
  10684. this.thumb.width = f;
  10685. this.thumb.height = e;
  10686. this.thumb.x = k + d - f;
  10687. break;
  10688. case c.ProgressBarDirection.TOP_TO_BOTTOM:
  10689. this.thumb.width = d;
  10690. this.thumb.height = g;
  10691. this.thumb.y = n;
  10692. break;
  10693. case c.ProgressBarDirection.BOTTOM_TO_TOP:
  10694. this.thumb.width = d, this.thumb.height = g, this.thumb.y = n + e - g
  10695. }
  10696. }
  10697. this.labelDisplay &&
  10698. (this.labelDisplay.text = this.valueToLabel(b, a))
  10699. };
  10700. return a
  10701. }(c.Range);
  10702. c.ProgressBar = e
  10703. })(egret || (egret = {}));
  10704. (function(c) {
  10705. var e = function() {
  10706. function c() {}
  10707. c.LEFT_TO_RIGHT = "leftToRight";
  10708. c.RIGHT_TO_LEFT = "rightToLeft";
  10709. c.TOP_TO_BOTTOM = "topToBottom";
  10710. c.BOTTOM_TO_TOP = "bottomToTop";
  10711. return c
  10712. }();
  10713. c.ProgressBarDirection = e
  10714. })(egret || (egret = {}));
  10715. __extends = this.__extends || function(c, e) {
  10716. function d() {
  10717. this.constructor = c
  10718. }
  10719. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  10720. d.prototype = e.prototype;
  10721. c.prototype = new d
  10722. };
  10723. (function(c) {
  10724. var e = function(d) {
  10725. function a() {
  10726. d.call(this);
  10727. this.hostComponentKey = "egret.HSlider"
  10728. }
  10729. __extends(a, d);
  10730. a.prototype.pointToValue = function(b, a) {
  10731. if (!this.thumb || !this.track) return 0;
  10732. var c = this.maximum - this.minimum,
  10733. d = this.track.layoutBoundsWidth - this.thumb.layoutBoundsWidth;
  10734. return this.minimum + (0 != d ? b / d * c : 0)
  10735. };
  10736. a.prototype.updateSkinDisplayList = function() {
  10737. if (this.thumb && this.track) {
  10738. var b = this.track.layoutBoundsWidth - this.thumb.layoutBoundsWidth,
  10739. a = this.maximum - this.minimum,
  10740. b = 0 < a ? (this.pendingValue -
  10741. this.minimum) / a * b : 0,
  10742. d = this.track.localToGlobal(b, 0),
  10743. a = d.x,
  10744. d = d.y,
  10745. e = this.thumb.parent.globalToLocal(a, d, c.Point.identity).x;
  10746. this.thumb.setLayoutBoundsPosition(Math.round(e), this.thumb.layoutBoundsY);
  10747. this.showTrackHighlight && this.trackHighlight && this.trackHighlight.parent && (a = this.trackHighlight.parent.globalToLocal(a, d, c.Point.identity).x - b, this.trackHighlight.x = Math.round(a), this.trackHighlight.width = Math.round(b))
  10748. }
  10749. };
  10750. return a
  10751. }(c.SliderBase);
  10752. c.HSlider = e
  10753. })(egret || (egret = {}));
  10754. __extends = this.__extends || function(c, e) {
  10755. function d() {
  10756. this.constructor = c
  10757. }
  10758. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  10759. d.prototype = e.prototype;
  10760. c.prototype = new d
  10761. };
  10762. (function(c) {
  10763. var e = function(d) {
  10764. function a() {
  10765. d.call(this);
  10766. this.hostComponentKey = "egret.VSlider"
  10767. }
  10768. __extends(a, d);
  10769. a.prototype.pointToValue = function(b, a) {
  10770. if (!this.thumb || !this.track) return 0;
  10771. var c = this.maximum - this.minimum,
  10772. d = this.track.layoutBoundsHeight - this.thumb.layoutBoundsHeight;
  10773. return this.minimum + (0 != d ? (d - a) / d * c : 0)
  10774. };
  10775. a.prototype.updateSkinDisplayList = function() {
  10776. if (this.thumb && this.track) {
  10777. var b = this.thumb.layoutBoundsHeight,
  10778. a = this.track.layoutBoundsHeight - b,
  10779. d = this.maximum - this.minimum,
  10780. e = this.track.localToGlobal(0,
  10781. 0 < d ? a - (this.pendingValue - this.minimum) / d * a : 0),
  10782. d = e.x,
  10783. e = e.y,
  10784. f = this.thumb.parent.globalToLocal(d, e, c.Point.identity).y;
  10785. this.thumb.setLayoutBoundsPosition(this.thumb.layoutBoundsX, Math.round(f));
  10786. this.showTrackHighlight && this.trackHighlight && this.trackHighlight._parent && (d = this.trackHighlight._parent.globalToLocal(d, e, c.Point.identity).y, this.trackHighlight.y = Math.round(d + b), this.trackHighlight.height = Math.round(a - d))
  10787. }
  10788. };
  10789. return a
  10790. }(c.SliderBase);
  10791. c.VSlider = e
  10792. })(egret || (egret = {}));
  10793. __extends = this.__extends || function(c, e) {
  10794. function d() {
  10795. this.constructor = c
  10796. }
  10797. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  10798. d.prototype = e.prototype;
  10799. c.prototype = new d
  10800. };
  10801. (function(c) {
  10802. var e = function(d) {
  10803. function a() {
  10804. d.call(this);
  10805. this._allowMultipleSelection = !1;
  10806. this._selectedIndices = [];
  10807. this._captureItemRenderer = !0;
  10808. this.hostComponentKey = "egret.List";
  10809. this.useVirtualLayout = !0
  10810. }
  10811. __extends(a, d);
  10812. a.prototype.createChildren = function() {
  10813. this.itemRenderer || (this.itemRenderer = c.DataGroup.defaultRendererFactory);
  10814. d.prototype.createChildren.call(this)
  10815. };
  10816. Object.defineProperty(a.prototype, "useVirtualLayout", {
  10817. get: function() {
  10818. return this._getUseVirtualLayout()
  10819. },
  10820. set: function(b) {
  10821. this._setUseVirtualLayout(b)
  10822. },
  10823. enumerable: !0,
  10824. configurable: !0
  10825. });
  10826. Object.defineProperty(a.prototype, "allowMultipleSelection", {
  10827. get: function() {
  10828. return this._allowMultipleSelection
  10829. },
  10830. set: function(b) {
  10831. this._allowMultipleSelection = b
  10832. },
  10833. enumerable: !0,
  10834. configurable: !0
  10835. });
  10836. Object.defineProperty(a.prototype, "selectedIndices", {
  10837. get: function() {
  10838. return this._proposedSelectedIndices ? this._proposedSelectedIndices : this._selectedIndices
  10839. },
  10840. set: function(b) {
  10841. this._setSelectedIndices(b, !1)
  10842. },
  10843. enumerable: !0,
  10844. configurable: !0
  10845. });
  10846. Object.defineProperty(a.prototype, "selectedIndex", {
  10847. get: function() {
  10848. return this._proposedSelectedIndices ? 0 < this._proposedSelectedIndices.length ? this._proposedSelectedIndices[0] : -1 : this._getSelectedIndex()
  10849. },
  10850. set: function(b) {
  10851. this._setSelectedIndex(b)
  10852. },
  10853. enumerable: !0,
  10854. configurable: !0
  10855. });
  10856. Object.defineProperty(a.prototype, "selectedItems", {
  10857. get: function() {
  10858. var b = [],
  10859. a = this.selectedIndices;
  10860. if (a)
  10861. for (var c = a.length, d = 0; d < c; d++) b[d] = this.dataProvider.getItemAt(a[d]);
  10862. return b
  10863. },
  10864. set: function(b) {
  10865. var a = [];
  10866. if (b)
  10867. for (var c = b.length, d = 0; d < c; d++) {
  10868. var e = this.dataProvider.getItemIndex(b[d]); - 1 != e && a.splice(0, 0, e);
  10869. if (-1 == e) {
  10870. a = [];
  10871. break
  10872. }
  10873. }
  10874. this._setSelectedIndices(a, !1)
  10875. },
  10876. enumerable: !0,
  10877. configurable: !0
  10878. });
  10879. a.prototype._setSelectedIndices = function(b, a) {
  10880. "undefined" === typeof a && (a = !1);
  10881. a && (this._dispatchChangeAfterSelection = this._dispatchChangeAfterSelection || a);
  10882. this._proposedSelectedIndices = b ? b : [];
  10883. this.invalidateProperties()
  10884. };
  10885. a.prototype.commitProperties = function() {
  10886. d.prototype.commitProperties.call(this);
  10887. this._proposedSelectedIndices && this.commitSelection()
  10888. };
  10889. a.prototype.commitSelection = function(b) {
  10890. "undefined" ===
  10891. typeof b && (b = !0);
  10892. var a = this._selectedIndex;
  10893. if (this._proposedSelectedIndices) {
  10894. this._proposedSelectedIndices = this._proposedSelectedIndices.filter(this.isValidIndex);
  10895. if (!this.allowMultipleSelection && 0 < this._proposedSelectedIndices.length) {
  10896. var e = [];
  10897. e.push(this._proposedSelectedIndices[0]);
  10898. this._proposedSelectedIndices = e
  10899. }
  10900. this._proposedSelectedIndex = 0 < this._proposedSelectedIndices.length ? this._proposedSelectedIndices[0] : -1
  10901. }
  10902. e = d.prototype.commitSelection.call(this, !1);
  10903. if (!e) return this._proposedSelectedIndices =
  10904. null, !1;
  10905. this.selectedIndex > c.ListBase.NO_SELECTION && (this._proposedSelectedIndices ? -1 == this._proposedSelectedIndices.indexOf(this.selectedIndex) && this._proposedSelectedIndices.push(this.selectedIndex) : this._proposedSelectedIndices = [this.selectedIndex]);
  10906. this._proposedSelectedIndices && (-1 != this._proposedSelectedIndices.indexOf(a) && this.itemSelected(a, !0), this.commitMultipleSelection());
  10907. b && e && (this._dispatchChangeAfterSelection && (c.IndexChangeEvent.dispatchIndexChangeEvent(this, c.IndexChangeEvent.CHANGE,
  10908. a, this._selectedIndex), this._dispatchChangeAfterSelection = !1), c.UIEvent.dispatchUIEvent(this, c.UIEvent.VALUE_COMMIT));
  10909. return e
  10910. };
  10911. a.prototype.isValidIndex = function(b, a, c) {
  10912. return this.dataProvider && 0 <= b && b < this.dataProvider.length
  10913. };
  10914. a.prototype.commitMultipleSelection = function() {
  10915. var b = [],
  10916. a = [],
  10917. c, d;
  10918. if (0 < this._selectedIndices.length && 0 < this._proposedSelectedIndices.length) {
  10919. d = this._proposedSelectedIndices.length;
  10920. for (c = 0; c < d; c++) - 1 == this._selectedIndices.indexOf(this._proposedSelectedIndices[c]) && a.push(this._proposedSelectedIndices[c]);
  10921. d = this._selectedIndices.length;
  10922. for (c = 0; c < d; c++) - 1 == this._proposedSelectedIndices.indexOf(this._selectedIndices[c]) && b.push(this._selectedIndices[c])
  10923. } else 0 < this._selectedIndices.length ? b = this._selectedIndices : 0 < this._proposedSelectedIndices.length && (a = this._proposedSelectedIndices);
  10924. this._selectedIndices = this._proposedSelectedIndices;
  10925. if (0 < b.length)
  10926. for (d = b.length, c = 0; c < d; c++) this.itemSelected(b[c], !1);
  10927. if (0 < a.length)
  10928. for (d = a.length, c = 0; c < d; c++) this.itemSelected(a[c], !0);
  10929. this._proposedSelectedIndices =
  10930. null
  10931. };
  10932. a.prototype._isItemIndexSelected = function(b) {
  10933. return this._allowMultipleSelection ? -1 != this._selectedIndices.indexOf(b) : d.prototype._isItemIndexSelected.call(this, b)
  10934. };
  10935. a.prototype.dataGroup_rendererAddHandler = function(b) {
  10936. d.prototype.dataGroup_rendererAddHandler.call(this, b);
  10937. b = b.renderer;
  10938. null != b && (b.addEventListener(c.TouchEvent.TOUCH_BEGIN, this.item_mouseDownHandler, this), b.addEventListener(c.TouchEvent.TOUCH_END, this.item_mouseUpHandler, this))
  10939. };
  10940. a.prototype.dataGroup_rendererRemoveHandler = function(b) {
  10941. d.prototype.dataGroup_rendererRemoveHandler.call(this,
  10942. b);
  10943. b = b.renderer;
  10944. null != b && (b.removeEventListener(c.TouchEvent.TOUCH_BEGIN, this.item_mouseDownHandler, this), b.removeEventListener(c.TouchEvent.TOUCH_END, this.item_mouseUpHandler, this))
  10945. };
  10946. a.prototype.item_mouseDownHandler = function(b) {
  10947. if (!b.isDefaultPrevented()) {
  10948. var a = b.currentTarget,
  10949. d;
  10950. d = a ? a.itemIndex : this.dataGroup.getElementIndex(b.currentTarget);
  10951. this._allowMultipleSelection ? this._setSelectedIndices(this.calculateSelectedIndices(d, b.shiftKey, b.ctrlKey), !0) : this._setSelectedIndex(d, !0);
  10952. this._captureItemRenderer &&
  10953. (this.mouseDownItemRenderer = a, c.UIGlobals.stage.addEventListener(c.TouchEvent.TOUCH_END, this.stage_mouseUpHandler, this), c.UIGlobals.stage.addEventListener(c.Event.LEAVE_STAGE, this.stage_mouseUpHandler, this))
  10954. }
  10955. };
  10956. a.prototype.calculateSelectedIndices = function(b, a, c) {
  10957. var d = [];
  10958. if (a)
  10959. if (a = 0 < this._selectedIndices.length ? this._selectedIndices[this._selectedIndices.length - 1] : 0, a < b)
  10960. for (; a <= b; a++) d.splice(0, 0, a);
  10961. else
  10962. for (; a >= b; a--) d.splice(0, 0, a);
  10963. else if (c)
  10964. if (0 < this._selectedIndices.length)
  10965. if (1 == this._selectedIndices.length &&
  10966. this._selectedIndices[0] == b) {
  10967. if (!this.requireSelection) return d;
  10968. d.splice(0, 0, this._selectedIndices[0])
  10969. } else {
  10970. c = !1;
  10971. for (a = 0; a < this._selectedIndices.length; a++) this._selectedIndices[a] == b ? c = !0 : this._selectedIndices[a] != b && d.splice(0, 0, this._selectedIndices[a]);
  10972. c || d.splice(0, 0, b)
  10973. } else d.splice(0, 0, b);
  10974. else d.splice(0, 0, b);
  10975. return d
  10976. };
  10977. a.prototype.item_mouseUpHandler = function(b) {
  10978. var a = b.currentTarget;
  10979. a == this.mouseDownItemRenderer && this._dispatchListEvent(b, c.ListEvent.ITEM_CLICK, a)
  10980. };
  10981. a.prototype.stage_mouseUpHandler =
  10982. function(b) {
  10983. c.UIGlobals.stage.removeEventListener(c.TouchEvent.TOUCH_END, this.stage_mouseUpHandler, this);
  10984. c.UIGlobals.stage.removeEventListener(c.Event.LEAVE_STAGE, this.stage_mouseUpHandler, this);
  10985. this.mouseDownItemRenderer = null
  10986. };
  10987. return a
  10988. }(c.ListBase);
  10989. c.List = e
  10990. })(egret || (egret = {}));
  10991. __extends = this.__extends || function(c, e) {
  10992. function d() {
  10993. this.constructor = c
  10994. }
  10995. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  10996. d.prototype = e.prototype;
  10997. c.prototype = new d
  10998. };
  10999. (function(c) {
  11000. var e = function(d) {
  11001. function a() {
  11002. d.call(this);
  11003. this._displayPopUp = this._popUpWidthMatchesAnchorWidth = this._popUpHeightMatchesAnchorHeight = this.addedToStage = this.popUpIsDisplayed = !1;
  11004. this._popUpPosition = c.PopUpPosition.TOP_LEFT;
  11005. this.inAnimation = !1;
  11006. this.animator = null;
  11007. this._openDuration = 250;
  11008. this._closeDuration = 150;
  11009. this.valueRange = 1;
  11010. this.addEventListener(c.Event.ADDED_TO_STAGE, this.addedToStageHandler, this);
  11011. this.addEventListener(c.Event.REMOVED_FROM_STAGE, this.removedFromStageHandler, this)
  11012. }
  11013. __extends(a,
  11014. d);
  11015. Object.defineProperty(a.prototype, "popUpHeightMatchesAnchorHeight", {
  11016. get: function() {
  11017. return this._popUpHeightMatchesAnchorHeight
  11018. },
  11019. set: function(b) {
  11020. this._popUpHeightMatchesAnchorHeight != b && (this._popUpHeightMatchesAnchorHeight = b, this.invalidateDisplayList())
  11021. },
  11022. enumerable: !0,
  11023. configurable: !0
  11024. });
  11025. Object.defineProperty(a.prototype, "popUpWidthMatchesAnchorWidth", {
  11026. get: function() {
  11027. return this._popUpWidthMatchesAnchorWidth
  11028. },
  11029. set: function(b) {
  11030. this._popUpWidthMatchesAnchorWidth != b && (this._popUpWidthMatchesAnchorWidth =
  11031. b, this.invalidateDisplayList())
  11032. },
  11033. enumerable: !0,
  11034. configurable: !0
  11035. });
  11036. Object.defineProperty(a.prototype, "displayPopUp", {
  11037. get: function() {
  11038. return this._displayPopUp
  11039. },
  11040. set: function(b) {
  11041. this._displayPopUp != b && (this._displayPopUp = b, this.addOrRemovePopUp())
  11042. },
  11043. enumerable: !0,
  11044. configurable: !0
  11045. });
  11046. Object.defineProperty(a.prototype, "popUp", {
  11047. get: function() {
  11048. return this._popUp
  11049. },
  11050. set: function(b) {
  11051. this._popUp != b && (this._popUp = b, this.dispatchEventWith("popUpChanged"))
  11052. },
  11053. enumerable: !0,
  11054. configurable: !0
  11055. });
  11056. Object.defineProperty(a.prototype,
  11057. "popUpPosition", {
  11058. get: function() {
  11059. return this._popUpPosition
  11060. },
  11061. set: function(b) {
  11062. this._popUpPosition != b && (this._popUpPosition = b, this.invalidateDisplayList())
  11063. },
  11064. enumerable: !0,
  11065. configurable: !0
  11066. });
  11067. a.prototype.updateDisplayList = function(b, a) {
  11068. d.prototype.updateDisplayList.call(this, b, a);
  11069. this.applyPopUpTransform(b, a)
  11070. };
  11071. a.prototype.updatePopUpTransform = function() {
  11072. this.applyPopUpTransform(this.width, this.height)
  11073. };
  11074. a.prototype.calculatePopUpPosition = function() {
  11075. var b = c.Point.identity;
  11076. switch (this._popUpPosition) {
  11077. case c.PopUpPosition.BELOW:
  11078. b.x =
  11079. 0;
  11080. b.y = this.height;
  11081. break;
  11082. case c.PopUpPosition.ABOVE:
  11083. b.x = 0;
  11084. b.y = -this.popUp.layoutBoundsHeight;
  11085. break;
  11086. case c.PopUpPosition.LEFT:
  11087. b.x = -this.popUp.layoutBoundsWidth;
  11088. b.y = 0;
  11089. break;
  11090. case c.PopUpPosition.RIGHT:
  11091. b.x = this.width;
  11092. b.y = 0;
  11093. break;
  11094. case c.PopUpPosition.CENTER:
  11095. b.x = 0.5 * (this.width - this.popUp.layoutBoundsWidth), b.y = 0.5 * (this.height - this.popUp.layoutBoundsHeight)
  11096. }
  11097. b = this.localToGlobal(b.x, b.y, b);
  11098. return b = this.popUp.parent.globalToLocal(b.x, b.y, b)
  11099. };
  11100. Object.defineProperty(a.prototype, "openDuration", {
  11101. get: function() {
  11102. return this._openDuration
  11103. },
  11104. set: function(b) {
  11105. this._openDuration = b
  11106. },
  11107. enumerable: !0,
  11108. configurable: !0
  11109. });
  11110. Object.defineProperty(a.prototype, "closeDuration", {
  11111. get: function() {
  11112. return this._closeDuration
  11113. },
  11114. set: function(b) {
  11115. this._closeDuration = b
  11116. },
  11117. enumerable: !0,
  11118. configurable: !0
  11119. });
  11120. a.prototype.animationStartHandler = function(b) {
  11121. this.inAnimation = !0;
  11122. this.popUp && "enabled" in this.popUp && (this.popUp.enabled = !1)
  11123. };
  11124. a.prototype.animationUpdateHandler = function(b) {
  11125. var a = this.popUp._scrollRect,
  11126. d = Math.round(b.currentValue.x);
  11127. b = Math.round(b.currentValue.y);
  11128. a ?
  11129. (a.x = d, a.y = b, a.width = this.popUp.width, a.height = this.popUp.height) : this.popUp._scrollRect = new c.Rectangle(d, b, this.popUp.width, this.popUp.height)
  11130. };
  11131. a.prototype.animationEndHandler = function(b) {
  11132. this.inAnimation = !1;
  11133. this.popUp && "enabled" in this.popUp && (this.popUp.enabled = !0);
  11134. this.popUp.scrollRect = null;
  11135. this.popUpIsDisplayed || (c.PopUpManager.removePopUp(this.popUp), this.popUp.ownerChanged(null))
  11136. };
  11137. a.prototype.addOrRemovePopUp = function() {
  11138. this.addedToStage && this.popUp && (null == this.popUp.parent && this.displayPopUp ?
  11139. (c.PopUpManager.addPopUp(this.popUp, !1, !1), this.popUp.ownerChanged(this), this.popUpIsDisplayed = !0, this.inAnimation && this.animator.end(), this.initialized ? (this.applyPopUpTransform(this.width, this.height), 0 < this._openDuration && this.startAnimation()) : c.callLater(function() {
  11140. 0 < this.openDuration && this.startAnimation()
  11141. }, this)) : null == this.popUp.parent || this.displayPopUp || this.removeAndResetPopUp())
  11142. };
  11143. a.prototype.removeAndResetPopUp = function() {
  11144. this.inAnimation && this.animator.end();
  11145. this.popUpIsDisplayed = !1;
  11146. 0 < this._closeDuration ? this.startAnimation() : (c.PopUpManager.removePopUp(this.popUp), this.popUp.ownerChanged(null))
  11147. };
  11148. a.prototype.applyPopUpTransform = function(b, a) {
  11149. if (this.popUpIsDisplayed) {
  11150. this.popUpWidthMatchesAnchorWidth && (this.popUp.width = b);
  11151. this.popUpHeightMatchesAnchorHeight && (this.popUp.height = a);
  11152. "validateNow" in this.popUp && this.popUp.validateNow();
  11153. var c = this.calculatePopUpPosition();
  11154. this.popUp.x = c.x;
  11155. this.popUp.y = c.y
  11156. }
  11157. };
  11158. a.prototype.startAnimation = function() {
  11159. this.animator || (this.animator = new c.Animation(this.animationUpdateHandler,
  11160. this), this.animator.endFunction = this.animationEndHandler, this.animator.startFunction = this.animationStartHandler);
  11161. this.animator.motionPaths = this.createMotionPath();
  11162. this.animator.duration = this.popUpIsDisplayed ? this._openDuration : this._closeDuration;
  11163. this.animator.play()
  11164. };
  11165. a.prototype.createMotionPath = function() {
  11166. var b = {
  11167. prop: "x"
  11168. },
  11169. a = {
  11170. prop: "y"
  11171. },
  11172. d = [b, a];
  11173. switch (this._popUpPosition) {
  11174. case c.PopUpPosition.TOP_LEFT:
  11175. case c.PopUpPosition.CENTER:
  11176. case c.PopUpPosition.BELOW:
  11177. b.from = b.to = 0;
  11178. a.from = this.popUp.height;
  11179. a.to =
  11180. 0;
  11181. this.valueRange = this.popUp.height;
  11182. break;
  11183. case c.PopUpPosition.ABOVE:
  11184. b.from = b.to = 0;
  11185. a.from = -this.popUp.height;
  11186. a.to = 0;
  11187. this.valueRange = this.popUp.height;
  11188. break;
  11189. case c.PopUpPosition.LEFT:
  11190. a.from = a.to = 0;
  11191. b.from = -this.popUp.width;
  11192. b.to = 0;
  11193. this.valueRange = this.popUp.width;
  11194. break;
  11195. case c.PopUpPosition.RIGHT:
  11196. a.from = a.to = 0;
  11197. b.from = this.popUp.width;
  11198. b.to = 0;
  11199. this.valueRange = this.popUp.width;
  11200. break;
  11201. default:
  11202. this.valueRange = 1
  11203. }
  11204. this.valueRange = Math.abs(this.valueRange);
  11205. if (!this.popUpIsDisplayed) {
  11206. var e = b.from;
  11207. b.from = b.to;
  11208. b.to =
  11209. e;
  11210. e = a.from;
  11211. a.from = a.to;
  11212. a.to = e
  11213. }
  11214. return d
  11215. };
  11216. a.prototype.addedToStageHandler = function(b) {
  11217. this.addedToStage = !0;
  11218. c.callLater(this.checkPopUpState, this)
  11219. };
  11220. a.prototype.checkPopUpState = function() {
  11221. this.addedToStage ? this.addOrRemovePopUp() : null != this.popUp && null != this.popUp.parent && this.removeAndResetPopUp()
  11222. };
  11223. a.prototype.removedFromStageHandler = function(b) {
  11224. this.addedToStage = !1;
  11225. c.callLater(this.checkPopUpState, this)
  11226. };
  11227. return a
  11228. }(c.UIComponent);
  11229. c.PopUpAnchor = e
  11230. })(egret || (egret = {}));
  11231. __extends = this.__extends || function(c, e) {
  11232. function d() {
  11233. this.constructor = c
  11234. }
  11235. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  11236. d.prototype = e.prototype;
  11237. c.prototype = new d
  11238. };
  11239. (function(c) {
  11240. var e = function(d) {
  11241. function a() {
  11242. d.call(this);
  11243. this._isOpen = !1;
  11244. this._closeOnResize = !0;
  11245. this._rollOverOpenDelay = NaN
  11246. }
  11247. __extends(a, d);
  11248. Object.defineProperty(a.prototype, "openButton", {
  11249. get: function() {
  11250. return this._openButton
  11251. },
  11252. set: function(b) {
  11253. this._openButton !== b && (this.removeOpenTriggers(), this._openButton = b, this.addOpenTriggers())
  11254. },
  11255. enumerable: !0,
  11256. configurable: !0
  11257. });
  11258. Object.defineProperty(a.prototype, "dropDown", {
  11259. get: function() {
  11260. return this._dropDown
  11261. },
  11262. set: function(b) {
  11263. this._dropDown !== b && (this._dropDown =
  11264. b)
  11265. },
  11266. enumerable: !0,
  11267. configurable: !0
  11268. });
  11269. Object.defineProperty(a.prototype, "isOpen", {
  11270. get: function() {
  11271. return this._isOpen
  11272. },
  11273. enumerable: !0,
  11274. configurable: !0
  11275. });
  11276. Object.defineProperty(a.prototype, "closeOnResize", {
  11277. get: function() {
  11278. return this._closeOnResize
  11279. },
  11280. set: function(b) {
  11281. this._closeOnResize != b && (this.isOpen && this.removeCloseOnResizeTrigger(), this._closeOnResize = b, this.addCloseOnResizeTrigger())
  11282. },
  11283. enumerable: !0,
  11284. configurable: !0
  11285. });
  11286. Object.defineProperty(a.prototype, "rollOverOpenDelay", {
  11287. get: function() {
  11288. return this._rollOverOpenDelay
  11289. },
  11290. set: function(b) {
  11291. this._rollOverOpenDelay != b && (this.removeOpenTriggers(), this._rollOverOpenDelay = b, this.addOpenTriggers())
  11292. },
  11293. enumerable: !0,
  11294. configurable: !0
  11295. });
  11296. a.prototype.addOpenTriggers = function() {
  11297. this.openButton && (isNaN(this.rollOverOpenDelay) ? this.openButton.addEventListener(c.UIEvent.BUTTON_DOWN, this._openButton_buttonDownHandler, this) : this.openButton.addEventListener(c.TouchEvent.TOUCH_ROLL_OVER, this._openButton_rollOverHandler, this))
  11298. };
  11299. a.prototype.removeOpenTriggers = function() {
  11300. this.openButton && (isNaN(this.rollOverOpenDelay) ?
  11301. this.openButton.removeEventListener(c.UIEvent.BUTTON_DOWN, this._openButton_buttonDownHandler, this) : this.openButton.removeEventListener(c.TouchEvent.TOUCH_ROLL_OVER, this._openButton_rollOverHandler, this))
  11302. };
  11303. a.prototype.addCloseTriggers = function() {
  11304. c.UIGlobals.stage && (isNaN(this.rollOverOpenDelay) ? (c.UIGlobals.stage.addEventListener(c.TouchEvent.TOUCH_BEGIN, this.stage_mouseDownHandler, this), c.UIGlobals.stage.addEventListener(c.TouchEvent.TOUCH_END, this.stage_mouseUpHandler_noRollOverOpenDelay, this)) :
  11305. c.UIGlobals.stage.addEventListener(c.TouchEvent.TOUCH_MOVE, this.stage_mouseMoveHandler, this), this.addCloseOnResizeTrigger())
  11306. };
  11307. a.prototype.removeCloseTriggers = function() {
  11308. c.UIGlobals.stage && (isNaN(this.rollOverOpenDelay) ? (c.UIGlobals.stage.removeEventListener(c.TouchEvent.TOUCH_BEGIN, this.stage_mouseDownHandler, this), c.UIGlobals.stage.removeEventListener(c.TouchEvent.TOUCH_END, this.stage_mouseUpHandler_noRollOverOpenDelay, this)) : (c.UIGlobals.stage.removeEventListener(c.TouchEvent.TOUCH_MOVE, this.stage_mouseMoveHandler,
  11309. this), c.UIGlobals.stage.removeEventListener(c.TouchEvent.TOUCH_END, this.stage_mouseUpHandler, this), c.UIGlobals.stage.removeEventListener(c.Event.LEAVE_STAGE, this.stage_mouseUpHandler, this)), this.removeCloseOnResizeTrigger())
  11310. };
  11311. a.prototype.addCloseOnResizeTrigger = function() {
  11312. this.closeOnResize && c.UIGlobals.stage.addEventListener(c.Event.RESIZE, this.stage_resizeHandler, this)
  11313. };
  11314. a.prototype.removeCloseOnResizeTrigger = function() {
  11315. this.closeOnResize && c.UIGlobals.stage.removeEventListener(c.Event.RESIZE, this.stage_resizeHandler,
  11316. this)
  11317. };
  11318. a.prototype.isTargetOverDropDownOrOpenButton = function(b) {
  11319. if (b) {
  11320. if (this.openButton && this.openButton.contains(b)) return !0;
  11321. if (null != this.hitAreaAdditions)
  11322. for (var a = 0; a < this.hitAreaAdditions.length; a++)
  11323. if (this.hitAreaAdditions[a] == b || this.hitAreaAdditions[a] instanceof c.DisplayObjectContainer && this.hitAreaAdditions[a].contains(b)) return !0;
  11324. if (this.dropDown instanceof c.DisplayObjectContainer) {
  11325. if (this.dropDown.contains(b)) return !0
  11326. } else if (b == this.dropDown) return !0
  11327. }
  11328. return !1
  11329. };
  11330. a.prototype.openDropDown =
  11331. function() {
  11332. this.openDropDownHelper()
  11333. };
  11334. a.prototype.openDropDownHelper = function() {
  11335. this.isOpen || (this.addCloseTriggers(), this._isOpen = !0, this.openButton && this.openButton._setKeepDown(!0), c.UIEvent.dispatchUIEvent(this, c.UIEvent.OPEN))
  11336. };
  11337. a.prototype.closeDropDown = function(b) {
  11338. if (this.isOpen) {
  11339. this._isOpen = !1;
  11340. this.openButton && this.openButton._setKeepDown(!1);
  11341. var a = new c.UIEvent(c.UIEvent.CLOSE, !1, !0);
  11342. b || a.preventDefault();
  11343. this.dispatchEvent(a);
  11344. this.removeCloseTriggers()
  11345. }
  11346. };
  11347. a.prototype._openButton_buttonDownHandler =
  11348. function(b) {
  11349. this.isOpen ? this.closeDropDown(!0) : (this.mouseIsDown = !0, this.openDropDownHelper())
  11350. };
  11351. a.prototype._openButton_rollOverHandler = function(b) {
  11352. 0 == this.rollOverOpenDelay ? this.openDropDownHelper() : (this.openButton.addEventListener(c.TouchEvent.TOUCH_ROLL_OUT, this.openButton_rollOutHandler, this), this.rollOverOpenDelayTimer = new c.Timer(this.rollOverOpenDelay, 1), this.rollOverOpenDelayTimer.addEventListener(c.TimerEvent.TIMER_COMPLETE, this.rollOverDelay_timerCompleteHandler, this), this.rollOverOpenDelayTimer.start())
  11353. };
  11354. a.prototype.openButton_rollOutHandler = function(b) {
  11355. this.rollOverOpenDelayTimer && this.rollOverOpenDelayTimer.running && (this.rollOverOpenDelayTimer.stop(), this.rollOverOpenDelayTimer = null);
  11356. this.openButton.removeEventListener(c.TouchEvent.TOUCH_ROLL_OUT, this.openButton_rollOutHandler, this)
  11357. };
  11358. a.prototype.rollOverDelay_timerCompleteHandler = function(b) {
  11359. this.openButton.removeEventListener(c.TouchEvent.TOUCH_ROLL_OUT, this.openButton_rollOutHandler, this);
  11360. this.rollOverOpenDelayTimer = null;
  11361. this.openDropDownHelper()
  11362. };
  11363. a.prototype.stage_mouseDownHandler = function(b) {
  11364. if (this.mouseIsDown) this.mouseIsDown = !1;
  11365. else if (!this.dropDown || this.dropDown && (b.target == this.dropDown || this.dropDown instanceof c.DisplayObjectContainer && !this.dropDown.contains(b.target))) {
  11366. var a = b.target;
  11367. if (!(this.openButton && a && this.openButton.contains(a))) {
  11368. if (null != this.hitAreaAdditions)
  11369. for (a = 0; a < this.hitAreaAdditions.length; a++)
  11370. if (this.hitAreaAdditions[a] == b.target || this.hitAreaAdditions[a] instanceof c.DisplayObjectContainer && this.hitAreaAdditions[a].contains(b.target)) return;
  11371. this.closeDropDown(!0)
  11372. }
  11373. }
  11374. };
  11375. a.prototype.stage_mouseMoveHandler = function(b) {
  11376. this.isTargetOverDropDownOrOpenButton(b.target) || (b instanceof c.TouchEvent && b.touchDown ? (c.UIGlobals.stage.addEventListener(c.TouchEvent.TOUCH_END, this.stage_mouseUpHandler, this), c.UIGlobals.stage.addEventListener(c.Event.LEAVE_STAGE, this.stage_mouseUpHandler, this)) : this.closeDropDown(!0))
  11377. };
  11378. a.prototype.stage_mouseUpHandler_noRollOverOpenDelay = function(b) {
  11379. this.mouseIsDown && (this.mouseIsDown = !1)
  11380. };
  11381. a.prototype.stage_mouseUpHandler =
  11382. function(b) {
  11383. this.isTargetOverDropDownOrOpenButton(b.target) ? (c.UIGlobals.stage.removeEventListener(c.TouchEvent.TOUCH_END, this.stage_mouseUpHandler, this), c.UIGlobals.stage.removeEventListener(c.Event.LEAVE_STAGE, this.stage_mouseUpHandler, this)) : this.closeDropDown(!0)
  11384. };
  11385. a.prototype.stage_resizeHandler = function(b) {
  11386. this.closeDropDown(!0)
  11387. };
  11388. a.prototype.stage_mouseWheelHandler = function(b) {
  11389. !this.dropDown || this.dropDown.contains(b.target) && b.isDefaultPrevented() || this.closeDropDown(!1)
  11390. };
  11391. return a
  11392. }(c.EventDispatcher);
  11393. c.DropDownController = e
  11394. })(egret || (egret = {}));
  11395. __extends = this.__extends || function(c, e) {
  11396. function d() {
  11397. this.constructor = c
  11398. }
  11399. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  11400. d.prototype = e.prototype;
  11401. c.prototype = new d
  11402. };
  11403. (function(c) {
  11404. var e = function(d) {
  11405. function a() {
  11406. d.call(this);
  11407. this._labelChanged = !1;
  11408. this._userProposedSelectedIndex = c.ListBase.NO_SELECTION;
  11409. this._captureItemRenderer = !1;
  11410. this.dropDownController = new c.DropDownController
  11411. }
  11412. __extends(a, d);
  11413. a.prototype._setDataProvider = function(b) {
  11414. this.dataProvider !== b && (d.prototype._setDataProvider.call(this, b), this._labelChanged = !0, this.invalidateProperties())
  11415. };
  11416. a.prototype._setLabelField = function(b) {
  11417. this.labelField != b && (d.prototype._setLabelField.call(this, b), this._labelChanged = !0, this.invalidateProperties())
  11418. };
  11419. a.prototype._setLabelFunction = function(b) {
  11420. this.labelFunction != b && (d.prototype._setLabelFunction.call(this, b), this._labelChanged = !0, this.invalidateProperties())
  11421. };
  11422. Object.defineProperty(a.prototype, "dropDownController", {
  11423. get: function() {
  11424. return this._dropDownController
  11425. },
  11426. set: function(b) {
  11427. this._dropDownController != b && (this._dropDownController = b, this._dropDownController.addEventListener(c.UIEvent.OPEN, this._dropDownController_openHandler, this), this._dropDownController.addEventListener(c.UIEvent.CLOSE,
  11428. this.dropDownController_closeHandler, this), this.openButton && (this._dropDownController.openButton = this.openButton), this.dropDown && (this._dropDownController.dropDown = this.dropDown))
  11429. },
  11430. enumerable: !0,
  11431. configurable: !0
  11432. });
  11433. Object.defineProperty(a.prototype, "isDropDownOpen", {
  11434. get: function() {
  11435. return this.dropDownController ? this.dropDownController.isOpen : !1
  11436. },
  11437. enumerable: !0,
  11438. configurable: !0
  11439. });
  11440. a.prototype.commitProperties = function() {
  11441. d.prototype.commitProperties.call(this);
  11442. this._labelChanged && (this._labelChanged = !1,
  11443. this.updateLabelDisplay())
  11444. };
  11445. a.prototype.partAdded = function(b, a) {
  11446. d.prototype.partAdded.call(this, b, a);
  11447. a == this.openButton ? this.dropDownController && (this.dropDownController.openButton = this.openButton) : a == this.dropDown && this.dropDownController && (this.dropDownController.dropDown = this.dropDown)
  11448. };
  11449. a.prototype.partRemoved = function(b, a) {
  11450. this.dropDownController && (a == this.openButton && (this.dropDownController.openButton = null), a == this.dropDown && (this.dropDownController.dropDown = null));
  11451. d.prototype.partRemoved.call(this,
  11452. b, a)
  11453. };
  11454. a.prototype.getCurrentSkinState = function() {
  11455. return this.enabled ? this.isDropDownOpen ? "open" : "normal" : "disabled"
  11456. };
  11457. a.prototype.commitSelection = function(b) {
  11458. "undefined" === typeof b && (b = !0);
  11459. b = d.prototype.commitSelection.call(this, b);
  11460. this.updateLabelDisplay();
  11461. return b
  11462. };
  11463. a.prototype._isItemIndexSelected = function(b) {
  11464. return this._userProposedSelectedIndex == b
  11465. };
  11466. a.prototype.openDropDown = function() {
  11467. this.dropDownController.openDropDown()
  11468. };
  11469. a.prototype.closeDropDown = function(b) {
  11470. this.dropDownController.closeDropDown(b)
  11471. };
  11472. a.prototype.updateLabelDisplay = function(b) {};
  11473. a.prototype._changeHighlightedSelection = function(b, a) {
  11474. this.itemSelected(this._userProposedSelectedIndex, !1);
  11475. this._userProposedSelectedIndex = b;
  11476. this.itemSelected(this._userProposedSelectedIndex, !0)
  11477. };
  11478. a.prototype.dataProvider_collectionChangeHandler = function(b) {
  11479. d.prototype.dataProvider_collectionChangeHandler.call(this, b);
  11480. this._labelChanged = !0;
  11481. this.invalidateProperties()
  11482. };
  11483. a.prototype.item_mouseDownHandler = function(b) {
  11484. d.prototype.item_mouseDownHandler.call(this,
  11485. b);
  11486. this._dispatchListEvent(b, c.ListEvent.ITEM_CLICK, b.currentTarget);
  11487. this._userProposedSelectedIndex = this.selectedIndex;
  11488. this.closeDropDown(!0)
  11489. };
  11490. a.prototype._dropDownController_openHandler = function(b) {
  11491. this.addEventListener(c.UIEvent.UPDATE_COMPLETE, this._open_updateCompleteHandler, this);
  11492. this._userProposedSelectedIndex = this.selectedIndex;
  11493. this.invalidateSkinState()
  11494. };
  11495. a.prototype._open_updateCompleteHandler = function(b) {
  11496. this.removeEventListener(c.UIEvent.UPDATE_COMPLETE, this._open_updateCompleteHandler,
  11497. this);
  11498. c.UIEvent.dispatchUIEvent(this, c.UIEvent.OPEN)
  11499. };
  11500. a.prototype.dropDownController_closeHandler = function(b) {
  11501. this.addEventListener(c.UIEvent.UPDATE_COMPLETE, this.close_updateCompleteHandler, this);
  11502. this.invalidateSkinState();
  11503. b.isDefaultPrevented() ? this._changeHighlightedSelection(this.selectedIndex) : this._setSelectedIndex(this._userProposedSelectedIndex, !0)
  11504. };
  11505. a.prototype.close_updateCompleteHandler = function(b) {
  11506. this.removeEventListener(c.UIEvent.UPDATE_COMPLETE, this.close_updateCompleteHandler, this);
  11507. c.UIEvent.dispatchUIEvent(this, c.UIEvent.CLOSE)
  11508. };
  11509. a.PAGE_SIZE = 5;
  11510. return a
  11511. }(c.List);
  11512. c.DropDownListBase = e
  11513. })(egret || (egret = {}));
  11514. __extends = this.__extends || function(c, e) {
  11515. function d() {
  11516. this.constructor = c
  11517. }
  11518. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  11519. d.prototype = e.prototype;
  11520. c.prototype = new d
  11521. };
  11522. (function(c) {
  11523. var e = function(d) {
  11524. function a() {
  11525. d.call(this);
  11526. this.iconFieldOrFunctionChanged = !1;
  11527. this.hostComponentKey = "egret.Tree"
  11528. }
  11529. __extends(a, d);
  11530. a.prototype.createChildren = function() {
  11531. this.itemRenderer || (this.itemRenderer = a.defaultTreeRendererFactory);
  11532. d.prototype.createChildren.call(this)
  11533. };
  11534. a.prototype.updateRenderer = function(b, a, c) {
  11535. if ("hasChildren" in b && "hasChildren" in this.dataProvider) {
  11536. var e = this.dataProvider;
  11537. b.hasChildren = e.hasChildren(c);
  11538. b.opened = e.isItemOpen(c);
  11539. b.depth = e.getDepth(c);
  11540. b.iconSkinName =
  11541. this.itemToIcon(c)
  11542. }
  11543. return d.prototype.updateRenderer.call(this, b, a, c)
  11544. };
  11545. a.prototype.itemToIcon = function(b) {
  11546. if (!b) return null;
  11547. if (null != this._iconFunction) return this._iconFunction(b);
  11548. var a;
  11549. if (b instanceof Object) try {
  11550. b[this.iconField] && (a = b[this.iconField])
  11551. } catch (c) {}
  11552. return a
  11553. };
  11554. a.prototype.dataGroup_rendererAddHandler = function(b) {
  11555. d.prototype.dataGroup_rendererAddHandler.call(this, b);
  11556. b.renderer && "hasChildren" in b.renderer && b.renderer.addEventListener(c.TreeEvent.ITEM_OPENING, this.onItemOpening, this)
  11557. };
  11558. a.prototype.onItemOpening = function(b) {
  11559. var a = b.itemRenderer,
  11560. d = b.item,
  11561. e = this._getDataProvider();
  11562. a && e && "hasChildren" in e && this.dispatchEvent(b) && (b = !a.opened, e.expandItem(d, b), c.TreeEvent.dispatchTreeEvent(this, b ? c.TreeEvent.ITEM_OPEN : c.TreeEvent.ITEM_CLOSE, a.itemIndex, d, a))
  11563. };
  11564. a.prototype.dataGroup_rendererRemoveHandler = function(b) {
  11565. d.prototype.dataGroup_rendererRemoveHandler.call(this, b);
  11566. b.renderer && "hasChildren" in b.renderer && b.renderer.removeEventListener(c.TreeEvent.ITEM_OPENING, this.onItemOpening,
  11567. this)
  11568. };
  11569. Object.defineProperty(a.prototype, "iconField", {
  11570. get: function() {
  11571. return this._iconField
  11572. },
  11573. set: function(b) {
  11574. this._iconField != b && (this._iconField = b, this.iconFieldOrFunctionChanged = !0, this.invalidateProperties())
  11575. },
  11576. enumerable: !0,
  11577. configurable: !0
  11578. });
  11579. Object.defineProperty(a.prototype, "iconFunction", {
  11580. get: function() {
  11581. return this._iconFunction
  11582. },
  11583. set: function(b) {
  11584. this._iconFunction != b && (this._iconFunction = b, this.iconFieldOrFunctionChanged = !0, this.invalidateProperties())
  11585. },
  11586. enumerable: !0,
  11587. configurable: !0
  11588. });
  11589. a.prototype.expandItem =
  11590. function(b, a) {
  11591. "undefined" === typeof a && (a = !0);
  11592. var c = this._getDataProvider();
  11593. c && "hasChildren" in c && c.expandItem(b, a)
  11594. };
  11595. a.prototype.isItemOpen = function(b) {
  11596. var a = this._getDataProvider();
  11597. return a && "hasChildren" in a ? a.isItemOpen(b) : !1
  11598. };
  11599. a.prototype.dataProvider_collectionChangeHandler = function(b) {
  11600. d.prototype.dataProvider_collectionChangeHandler.call(this, b);
  11601. if (b.kind == c.CollectionEventKind.OPEN || b.kind == c.CollectionEventKind.CLOSE) {
  11602. var a = this.dataGroup ? this.dataGroup.getElementAt(b.location) : null;
  11603. a && (this.updateRenderer(a,
  11604. b.location, b.items[0]), b.kind == c.CollectionEventKind.CLOSE && this.layout && this.layout.useVirtualLayout && (this.layout.clearVirtualLayoutCache(), this.invalidateSize()))
  11605. }
  11606. };
  11607. a.prototype.commitProperties = function() {
  11608. d.prototype.commitProperties.call(this);
  11609. if (this.iconFieldOrFunctionChanged) {
  11610. if (null != this.dataGroup) {
  11611. var b;
  11612. if (this.layout && this.layout.useVirtualLayout)
  11613. for (var a = this.dataGroup.getElementIndicesInView(), c = a.length, e = 0; e < c; e++) b = a[e], this.updateRendererIconProperty(b);
  11614. else
  11615. for (a = this.dataGroup.numElements,
  11616. b = 0; b < a; b++) this.updateRendererIconProperty(b)
  11617. }
  11618. this.iconFieldOrFunctionChanged = !1
  11619. }
  11620. };
  11621. a.prototype.updateRendererIconProperty = function(b) {
  11622. if (b = this.dataGroup.getElementAt(b)) b.iconSkinName = this.itemToIcon(b.data)
  11623. };
  11624. a.defaultTreeRendererFactory = new c.ClassFactory(c.TreeItemRenderer);
  11625. return a
  11626. }(c.List);
  11627. c.Tree = e
  11628. })(egret || (egret = {}));
  11629. __extends = this.__extends || function(c, e) {
  11630. function d() {
  11631. this.constructor = c
  11632. }
  11633. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  11634. d.prototype = e.prototype;
  11635. c.prototype = new d
  11636. };
  11637. (function(c) {
  11638. var e = function(c) {
  11639. function a() {
  11640. c.call(this);
  11641. this._prompt = "";
  11642. this.hostComponentKey = "egret.DropDownList"
  11643. }
  11644. __extends(a, c);
  11645. Object.defineProperty(a.prototype, "prompt", {
  11646. get: function() {
  11647. return this._prompt
  11648. },
  11649. set: function(b) {
  11650. this._prompt != b && (this._prompt = b, this._labelChanged = !0, this.invalidateProperties())
  11651. },
  11652. enumerable: !0,
  11653. configurable: !0
  11654. });
  11655. a.prototype.partAdded = function(b, a) {
  11656. c.prototype.partAdded.call(this, b, a);
  11657. a == this.labelDisplay && (this._labelChanged = !0, this.invalidateProperties())
  11658. };
  11659. a.prototype.updateLabelDisplay =
  11660. function(b) {
  11661. "undefined" === typeof b && (b = void 0);
  11662. this.labelDisplay && (void 0 == b && (b = this.selectedItem), this.labelDisplay.text = null != b && void 0 != b ? this.itemToLabel(b) : this._prompt)
  11663. };
  11664. return a
  11665. }(c.DropDownListBase);
  11666. c.DropDownList = e
  11667. })(egret || (egret = {}));
  11668. __extends = this.__extends || function(c, e) {
  11669. function d() {
  11670. this.constructor = c
  11671. }
  11672. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  11673. d.prototype = e.prototype;
  11674. c.prototype = new d
  11675. };
  11676. (function(c) {
  11677. var e = function(c) {
  11678. function a() {
  11679. c.call(this);
  11680. this._allowDeselection = !0;
  11681. this.hostComponentKey = "egret.TabBarButton"
  11682. }
  11683. __extends(a, c);
  11684. Object.defineProperty(a.prototype, "allowDeselection", {
  11685. get: function() {
  11686. return this._allowDeselection
  11687. },
  11688. set: function(b) {
  11689. this._allowDeselection = b
  11690. },
  11691. enumerable: !0,
  11692. configurable: !0
  11693. });
  11694. Object.defineProperty(a.prototype, "data", {
  11695. get: function() {
  11696. return this._data
  11697. },
  11698. set: function(b) {
  11699. this._data = b;
  11700. this.dispatchEventWith("dataChange")
  11701. },
  11702. enumerable: !0,
  11703. configurable: !0
  11704. });
  11705. Object.defineProperty(a.prototype,
  11706. "itemIndex", {
  11707. get: function() {
  11708. return this._itemIndex
  11709. },
  11710. set: function(b) {
  11711. this._itemIndex = b
  11712. },
  11713. enumerable: !0,
  11714. configurable: !0
  11715. });
  11716. a.prototype._setLabel = function(b) {
  11717. b != this._getLabel() && (c.prototype._setLabel.call(this, b), this.labelDisplay && (this.labelDisplay.text = this._getLabel()))
  11718. };
  11719. a.prototype.buttonReleased = function() {
  11720. this.selected && !this.allowDeselection || c.prototype.buttonReleased.call(this)
  11721. };
  11722. return a
  11723. }(c.ToggleButtonBase);
  11724. c.TabBarButton = e
  11725. })(egret || (egret = {}));
  11726. __extends = this.__extends || function(c, e) {
  11727. function d() {
  11728. this.constructor = c
  11729. }
  11730. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  11731. d.prototype = e.prototype;
  11732. c.prototype = new d
  11733. };
  11734. (function(c) {
  11735. var e = function(d) {
  11736. function a() {
  11737. d.call(this);
  11738. this.hostComponentKey = "egret.TabBar";
  11739. this.requireSelection = !0
  11740. }
  11741. __extends(a, d);
  11742. a.prototype.c = function(b) {
  11743. b != this._requireSelection && (d.prototype._setRequireSelection.call(this, b), this.requireSelectionChanged_tabBar = !0, this.invalidateProperties())
  11744. };
  11745. a.prototype._setDataProvider = function(b) {
  11746. this.dataProvider instanceof c.ViewStack && (this.dataProvider.removeEventListener("IndexChanged", this.onViewStackIndexChange, this), this.removeEventListener(c.IndexChangeEvent.CHANGE,
  11747. this.onIndexChanged, this));
  11748. b instanceof c.ViewStack && (b.addEventListener("IndexChanged", this.onViewStackIndexChange, this), this.addEventListener(c.IndexChangeEvent.CHANGE, this.onIndexChanged, this));
  11749. d.prototype._setDataProvider.call(this, b)
  11750. };
  11751. a.prototype.onIndexChanged = function(b) {
  11752. this.dataProvider._setSelectedIndex(b.newIndex, !1)
  11753. };
  11754. a.prototype.onViewStackIndexChange = function(b) {
  11755. this._setSelectedIndex(this.dataProvider.selectedIndex, !1)
  11756. };
  11757. a.prototype.commitProperties = function() {
  11758. d.prototype.commitProperties.call(this);
  11759. if (this.requireSelectionChanged_tabBar && this.dataGroup) {
  11760. this.requireSelectionChanged_tabBar = !1;
  11761. for (var b = this.dataGroup.numElements, a = 0; a < b; a++) {
  11762. var c = this.dataGroup.getElementAt(a);
  11763. c && (c.allowDeselection = !this.requireSelection)
  11764. }
  11765. }
  11766. };
  11767. a.prototype.dataGroup_rendererAddHandler = function(b) {
  11768. d.prototype.dataGroup_rendererAddHandler.call(this, b);
  11769. if (b = b.renderer) b.addEventListener(c.TouchEvent.TOUCH_TAP, this.item_clickHandler, this), b instanceof c.TabBarButton && (b.allowDeselection = !this.requireSelection)
  11770. };
  11771. a.prototype.dataGroup_rendererRemoveHandler =
  11772. function(b) {
  11773. d.prototype.dataGroup_rendererRemoveHandler.call(this, b);
  11774. (b = b.renderer) && b.removeEventListener(c.TouchEvent.TOUCH_TAP, this.item_clickHandler, this)
  11775. };
  11776. a.prototype.item_clickHandler = function(b) {
  11777. var a = b.currentTarget,
  11778. d;
  11779. d = a ? a.itemIndex : this.dataGroup.getElementIndex(b.currentTarget);
  11780. d == this.selectedIndex ? this.requireSelection || this._setSelectedIndex(c.ListBase.NO_SELECTION, !0) : this._setSelectedIndex(d, !0);
  11781. this._dispatchListEvent(b, c.ListEvent.ITEM_CLICK, a)
  11782. };
  11783. return a
  11784. }(c.ListBase);
  11785. c.TabBar = e
  11786. })(egret ||
  11787. (egret = {}));
  11788. __extends = this.__extends || function(c, e) {
  11789. function d() {
  11790. this.constructor = c
  11791. }
  11792. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  11793. d.prototype = e.prototype;
  11794. c.prototype = new d
  11795. };
  11796. (function(c) {
  11797. var e = function(d) {
  11798. function a() {
  11799. d.call(this);
  11800. this._horizontalScrollPolicy = this._verticalScrollPolicy = "auto";
  11801. this.ignoreTouchBegin = !1;
  11802. this._velocityY = this._velocityX = 0;
  11803. this._previousVelocityX = [];
  11804. this._previousVelocityY = []
  11805. }
  11806. __extends(a, d);
  11807. a.prototype.measure = function() {
  11808. this._viewport && (this.measuredWidth = this._viewport.preferredWidth, this.measuredHeight = this._viewport.preferredHeight)
  11809. };
  11810. a.prototype.updateDisplayList = function(b, a) {
  11811. this._viewport.setLayoutBoundsSize(b, a)
  11812. };
  11813. Object.defineProperty(a.prototype,
  11814. "verticalScrollPolicy", {
  11815. get: function() {
  11816. return this._verticalScrollPolicy
  11817. },
  11818. set: function(b) {
  11819. this._verticalScrollPolicy = b
  11820. },
  11821. enumerable: !0,
  11822. configurable: !0
  11823. });
  11824. Object.defineProperty(a.prototype, "horizontalScrollPolicy", {
  11825. get: function() {
  11826. return this._horizontalScrollPolicy
  11827. },
  11828. set: function(b) {
  11829. this._horizontalScrollPolicy = b
  11830. },
  11831. enumerable: !0,
  11832. configurable: !0
  11833. });
  11834. Object.defineProperty(a.prototype, "viewport", {
  11835. get: function() {
  11836. return this._viewport
  11837. },
  11838. set: function(b) {
  11839. b != this._viewport && (this.uninstallViewport(), this._viewport =
  11840. b, this.installViewport(), this.dispatchEventWith("viewportChanged"))
  11841. },
  11842. enumerable: !0,
  11843. configurable: !0
  11844. });
  11845. a.prototype.installViewport = function() {
  11846. this.viewport && (this.viewport.clipAndEnableScrolling = !0, this.viewport.addEventListener(c.TouchEvent.TOUCH_BEGIN, this.onTouchBegin, this), this.viewport.addEventListener(c.TouchEvent.TOUCH_BEGIN, this.onTouchBeginCapture, this, !0), this.viewport.addEventListener(c.TouchEvent.TOUCH_END, this.onTouchEndCapture, this, !0), this._addToDisplayListAt(this.viewport, 0))
  11847. };
  11848. a.prototype.uninstallViewport =
  11849. function() {
  11850. this.viewport && (this.viewport.clipAndEnableScrolling = !1, this.viewport.removeEventListener(c.TouchEvent.TOUCH_BEGIN, this.onTouchBegin, this), this.viewport.removeEventListener(c.TouchEvent.TOUCH_BEGIN, this.onTouchBeginCapture, this, !0), this.viewport.removeEventListener(c.TouchEvent.TOUCH_END, this.onTouchEndCapture, this, !0), this._removeFromDisplayList(this.viewport))
  11851. };
  11852. a.prototype.onTouchEndCapture = function(b) {
  11853. this.delayTouchBeginEvent && (b.stopPropagation(), this.delayTouchEndEvent = this.cloneTouchEvent(b),
  11854. this.onTouchBeginTimer(), this.touchEndTimer || (this.touchEndTimer = new c.Timer(100, 1), this.touchEndTimer.addEventListener(c.TimerEvent.TIMER_COMPLETE, this.onTouchEndTimer, this)), this.touchEndTimer.start())
  11855. };
  11856. a.prototype.onTouchEndTimer = function(b) {
  11857. this.touchEndTimer.stop();
  11858. b = this.delayTouchEndEvent;
  11859. this.delayTouchEndEvent = null;
  11860. this.dispatchPropagationEvent(b)
  11861. };
  11862. a.prototype.dispatchPropagationEvent = function(b) {
  11863. for (var a = [], c = b._target; c;) a.push(c), c = c.parent;
  11864. for (var d = this._viewport, e = 1;; e += 2) {
  11865. c = a[e];
  11866. if (!c || c === d) break;
  11867. a.unshift(c)
  11868. }
  11869. c = a.indexOf(b._target);
  11870. this._dispatchPropagationEvent(b, a, c)
  11871. };
  11872. a.prototype.onTouchBeginCapture = function(b) {
  11873. var d = this.checkScrollPolicy();
  11874. if (d) {
  11875. for (var e = b.target; e != this;) {
  11876. if (e instanceof a && (d = e.checkScrollPolicy())) return;
  11877. e = e.parent
  11878. }
  11879. this.delayTouchEndEvent && (this.delayTouchEndEvent = null, this.touchEndTimer.stop());
  11880. b.stopPropagation();
  11881. this.delayTouchBeginEvent = this.cloneTouchEvent(b);
  11882. this.touchBeginTimer || (this.touchBeginTimer = new c.Timer(100, 1), this.touchBeginTimer.addEventListener(c.TimerEvent.TIMER_COMPLETE,
  11883. this.onTouchBeginTimer, this));
  11884. this.touchBeginTimer.start();
  11885. this.onTouchBegin(b)
  11886. }
  11887. };
  11888. a.prototype.cloneTouchEvent = function(b) {
  11889. var a = new c.TouchEvent(b._type, b._bubbles, b.cancelable);
  11890. a.touchPointID = b.touchPointID;
  11891. a._stageX = b._stageX;
  11892. a._stageY = b._stageY;
  11893. a.ctrlKey = b.ctrlKey;
  11894. a.altKey = b.altKey;
  11895. a.shiftKey = b.shiftKey;
  11896. a.touchDown = b.touchDown;
  11897. a._isDefaultPrevented = !1;
  11898. a._target = b._target;
  11899. return a
  11900. };
  11901. a.prototype.onTouchBeginTimer = function(b) {
  11902. this.touchBeginTimer.stop();
  11903. b = this.delayTouchBeginEvent;
  11904. this.delayTouchBeginEvent =
  11905. null;
  11906. this.dispatchPropagationEvent(b)
  11907. };
  11908. a.prototype.checkScrollPolicy = function() {
  11909. var b = this._viewport,
  11910. a;
  11911. switch (this._horizontalScrollPolicy) {
  11912. case "auto":
  11913. a = b.contentWidth > b.width ? !0 : !1;
  11914. break;
  11915. case "on":
  11916. a = !0;
  11917. break;
  11918. case "off":
  11919. a = !1
  11920. }
  11921. this._horizontalCanScroll = a;
  11922. var c;
  11923. switch (this._verticalScrollPolicy) {
  11924. case "auto":
  11925. c = b.contentHeight > b.height ? !0 : !1;
  11926. break;
  11927. case "on":
  11928. c = !0;
  11929. break;
  11930. case "off":
  11931. c = !1
  11932. }
  11933. this._verticalCanScroll = c;
  11934. return a || c
  11935. };
  11936. a.prototype.onTouchBegin = function(b) {
  11937. if (!b.isDefaultPrevented() && this.checkScrollPolicy()) {
  11938. this.verticalAnimator &&
  11939. this.verticalAnimator.isPlaying && this.verticalAnimator.stop();
  11940. this.horizontalAnimator && this.horizontalAnimator.isPlaying && this.horizontalAnimator.stop();
  11941. var a = this._viewport,
  11942. d = a.horizontalScrollPosition,
  11943. a = a.verticalScrollPosition;
  11944. this._offsetPointX = d + b.stageX;
  11945. this._offsetPointY = a + b.stageY;
  11946. this._velocityY = this._velocityX = 0;
  11947. this._previousVelocityX.length = 0;
  11948. this._previousVelocityY.length = 0;
  11949. this._previousTouchTime = c.getTimer();
  11950. this._previousTouchX = this._startTouchX = this._currentTouchX = b.stageX;
  11951. this._previousTouchY =
  11952. this._startTouchY = this._currentTouchY = b.stageY;
  11953. this._startHorizontalScrollPosition = d;
  11954. this._startVerticalScrollPosition = a;
  11955. c.UIGlobals.stage.addEventListener(c.TouchEvent.TOUCH_MOVE, this.onTouchMove, this);
  11956. c.UIGlobals.stage.addEventListener(c.TouchEvent.TOUCH_END, this.onTouchEnd, this);
  11957. c.UIGlobals.stage.addEventListener(c.Event.LEAVE_STAGE, this.onTouchEnd, this);
  11958. this.addEventListener(c.Event.ENTER_FRAME, this.enterFrameHandler, this);
  11959. b.preventDefault()
  11960. }
  11961. };
  11962. a.prototype.onTouchMove = function(b) {
  11963. this._currentTouchX =
  11964. b.stageX;
  11965. this._currentTouchY = b.stageY;
  11966. this.delayTouchBeginEvent && (this.delayTouchBeginEvent = null, this.touchBeginTimer.stop());
  11967. var a = this._viewport;
  11968. if (this._horizontalCanScroll) {
  11969. var c = this._offsetPointX - b.stageX;
  11970. 0 > c && (c *= 0.5);
  11971. c > a.contentWidth - a.width && (c = 0.5 * (c + a.contentWidth - a.width));
  11972. a.horizontalScrollPosition = c
  11973. }
  11974. this._verticalCanScroll && (b = this._offsetPointY - b.stageY, 0 > b && (b *= 0.5), b > a.contentHeight - a.height && (b = 0.5 * (b + a.contentHeight - a.height)), a.verticalScrollPosition = b)
  11975. };
  11976. a.prototype.onTouchEnd =
  11977. function(a) {
  11978. c.UIGlobals.stage.removeEventListener(c.TouchEvent.TOUCH_MOVE, this.onTouchMove, this);
  11979. c.UIGlobals.stage.removeEventListener(c.TouchEvent.TOUCH_END, this.onTouchEnd, this);
  11980. c.UIGlobals.stage.removeEventListener(c.Event.LEAVE_STAGE, this.onTouchEnd, this);
  11981. this.removeEventListener(c.Event.ENTER_FRAME, this.enterFrameHandler, this);
  11982. this._horizontalCanScroll && this.checkHorizontalScrollPosition();
  11983. this._verticalCanScroll && this.checkVerticalScrollPosition()
  11984. };
  11985. a.easeOut = function(a) {
  11986. a -= 1;
  11987. return a * a * a + 1
  11988. };
  11989. a.prototype.enterFrameHandler = function(a) {
  11990. a = c.getTimer();
  11991. var d = a - this._previousTouchTime;
  11992. 0 < d && (this._previousVelocityX[this._previousVelocityX.length] = this._velocityX, 4 < this._previousVelocityX.length && this._previousVelocityX.shift(), this._previousVelocityY[this._previousVelocityY.length] = this._velocityY, 4 < this._previousVelocityY.length && this._previousVelocityY.shift(), this._velocityX = (this._currentTouchX - this._previousTouchX) / d, this._velocityY = (this._currentTouchY - this._previousTouchY) / d, this._previousTouchTime =
  11993. a, this._previousTouchX = this._currentTouchX, this._previousTouchY = this._currentTouchY);
  11994. a = Math.abs(this._currentTouchX - this._startTouchX);
  11995. d = Math.abs(this._currentTouchY - this._startTouchY);
  11996. this._horizontalCanScroll && 0.04 <= a && (this._startTouchX = this._currentTouchX, this._startHorizontalScrollPosition = this._viewport.horizontalScrollPosition);
  11997. this._verticalCanScroll && 0.04 <= d && (this._startTouchY = this._currentTouchY, this._startVerticalScrollPosition = this._viewport.verticalScrollPosition)
  11998. };
  11999. a.prototype.checkHorizontalScrollPosition =
  12000. function() {
  12001. for (var b = this._viewport, c = b.horizontalScrollPosition, b = b.contentWidth - b.width, b = Math.max(0, b), d = 2.33 * this._velocityX, e = this._previousVelocityX.length, f = 2.33, g = 0; g < e; g++) var k = a.VELOCITY_WEIGHTS[g],
  12002. d = d + this._previousVelocityX.shift() * k,
  12003. f = f + k;
  12004. d /= f;
  12005. 0.02 >= Math.abs(d) ? this.finishScrollingHorizontally() : (c = this.getAnimationDatas(d, c, b), this.throwHorizontally(c[0], c[1]))
  12006. };
  12007. a.prototype.checkVerticalScrollPosition = function() {
  12008. for (var b = this._viewport, c = b.verticalScrollPosition, b = b.contentHeight -
  12009. b.height, d = 2.33 * this._velocityY, e = this._previousVelocityY.length, f = 2.33, g = 0; g < e; g++) var k = a.VELOCITY_WEIGHTS[g],
  12010. d = d + this._previousVelocityY.shift() * k,
  12011. f = f + k;
  12012. d /= f;
  12013. 0.02 >= Math.abs(d) ? this.finishScrollingVertically() : (c = this.getAnimationDatas(d, c, b), this.throwVertically(c[0], c[1]))
  12014. };
  12015. a.prototype.getAnimationDatas = function(b, c, d) {
  12016. var e = Math.abs(b),
  12017. f = 0,
  12018. g = c + (b - 0.02) / Math.log(0.998);
  12019. if (0 > g || g > d)
  12020. for (g = c; 0.02 < Math.abs(b);) g -= b, b = 0 > g || g > d ? 0.998 * b * 0.95 : 0.998 * b, f++;
  12021. else f = Math.log(0.02 / e) / Math.log(0.998);
  12022. a.animationData ||
  12023. (a.animationData = [0, 0]);
  12024. b = a.animationData;
  12025. b[0] = g;
  12026. b[1] = f;
  12027. return b
  12028. };
  12029. a.prototype.finishScrollingHorizontally = function(a) {
  12030. var c = this._viewport;
  12031. a = c.horizontalScrollPosition;
  12032. var c = c.contentWidth - c.width,
  12033. d = a;
  12034. 0 > a && (d = 0);
  12035. a > c && (d = c);
  12036. this.throwHorizontally(d, 300)
  12037. };
  12038. a.prototype.throwHorizontally = function(b, d) {
  12039. "undefined" === typeof d && (d = 500);
  12040. var e = this._viewport.horizontalScrollPosition;
  12041. e != b && (this.horizontalAnimator || (this.horizontalAnimator = new c.Animation(this.horizontalUpdateHandler, this), this.horizontalAnimator.endFunction =
  12042. this.finishScrollingHorizontally, this.horizontalAnimator.easerFunction = a.easeOut), this.horizontalAnimator.isPlaying && this.horizontalAnimator.stop(), this.horizontalAnimator.duration = d, this.horizontalAnimator.motionPaths = [{
  12043. prop: "hsp",
  12044. from: e,
  12045. to: b
  12046. }], this.horizontalAnimator.play())
  12047. };
  12048. a.prototype.horizontalUpdateHandler = function(a) {
  12049. this._viewport.horizontalScrollPosition = a.currentValue.hsp
  12050. };
  12051. a.prototype.finishScrollingVertically = function(a) {
  12052. var c = this._viewport;
  12053. a = c.verticalScrollPosition;
  12054. var c = c.contentHeight -
  12055. c.height,
  12056. c = Math.max(0, c),
  12057. d = a;
  12058. 0 > a && (d = 0);
  12059. a > c && (d = c);
  12060. this.throwVertically(d, 300)
  12061. };
  12062. a.prototype.throwVertically = function(b, d) {
  12063. "undefined" === typeof d && (d = 500);
  12064. var e = this._viewport.verticalScrollPosition;
  12065. e != b && (this.verticalAnimator || (this.verticalAnimator = new c.Animation(this.verticalUpdateHandler, this), this.verticalAnimator.endFunction = this.finishScrollingVertically, this.verticalAnimator.easerFunction = a.easeOut), this.verticalAnimator.isPlaying && this.verticalAnimator.stop(), this.verticalAnimator.duration =
  12066. d, this.verticalAnimator.motionPaths = [{
  12067. prop: "vsp",
  12068. from: e,
  12069. to: b
  12070. }], this.verticalAnimator.play())
  12071. };
  12072. a.prototype.verticalUpdateHandler = function(a) {
  12073. this._viewport.verticalScrollPosition = a.currentValue.vsp
  12074. };
  12075. Object.defineProperty(a.prototype, "numElements", {
  12076. get: function() {
  12077. return this.viewport ? 1 : 0
  12078. },
  12079. enumerable: !0,
  12080. configurable: !0
  12081. });
  12082. a.prototype.throwRangeError = function(a) {
  12083. throw new RangeError('\u7d22\u5f15:"' + a + '"\u8d85\u51fa\u53ef\u89c6\u5143\u7d20\u7d22\u5f15\u8303\u56f4');
  12084. };
  12085. a.prototype.getElementAt = function(a) {
  12086. if (this.viewport &&
  12087. 0 == a) return this.viewport;
  12088. this.throwRangeError(a);
  12089. return null
  12090. };
  12091. a.prototype.getElementIndex = function(a) {
  12092. return null != a && a == this.viewport ? 0 : -1
  12093. };
  12094. a.prototype.containsElement = function(a) {
  12095. return null != a && a == this.viewport ? !0 : !1
  12096. };
  12097. a.prototype.throwNotSupportedError = function() {
  12098. throw Error("\u6b64\u65b9\u6cd5\u5728Scroller\u7ec4\u4ef6\u5185\u4e0d\u53ef\u7528!");
  12099. };
  12100. a.prototype.addElement = function(a) {
  12101. this.throwNotSupportedError();
  12102. return null
  12103. };
  12104. a.prototype.addElementAt = function(a, c) {
  12105. this.throwNotSupportedError();
  12106. return null
  12107. };
  12108. a.prototype.removeElement = function(a) {
  12109. this.throwNotSupportedError();
  12110. return null
  12111. };
  12112. a.prototype.removeElementAt = function(a) {
  12113. this.throwNotSupportedError();
  12114. return null
  12115. };
  12116. a.prototype.removeAllElements = function() {
  12117. this.throwNotSupportedError()
  12118. };
  12119. a.prototype.setElementIndex = function(a, c) {
  12120. this.throwNotSupportedError()
  12121. };
  12122. a.prototype.swapElements = function(a, c) {
  12123. this.throwNotSupportedError()
  12124. };
  12125. a.prototype.swapElementsAt = function(a, c) {
  12126. this.throwNotSupportedError()
  12127. };
  12128. a.prototype.addChild = function(a) {
  12129. this.throwNotSupportedError();
  12130. return null
  12131. };
  12132. a.prototype.addChildAt = function(a, c) {
  12133. this.throwNotSupportedError();
  12134. return null
  12135. };
  12136. a.prototype.removeChild = function(a) {
  12137. this.throwNotSupportedError();
  12138. return null
  12139. };
  12140. a.prototype.removeChildAt = function(a) {
  12141. this.throwNotSupportedError();
  12142. return null
  12143. };
  12144. a.prototype.setChildIndex = function(a, c) {
  12145. this.throwNotSupportedError()
  12146. };
  12147. a.prototype.swapChildren = function(a, c) {
  12148. this.throwNotSupportedError()
  12149. };
  12150. a.prototype.swapChildrenAt = function(a, c) {
  12151. this.throwNotSupportedError()
  12152. };
  12153. a.VELOCITY_WEIGHTS = [1, 1.33, 1.66, 2];
  12154. return a
  12155. }(c.UIComponent);
  12156. c.Scroller = e
  12157. })(egret || (egret = {}));
  12158. __extends = this.__extends || function(c, e) {
  12159. function d() {
  12160. this.constructor = c
  12161. }
  12162. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  12163. d.prototype = e.prototype;
  12164. c.prototype = new d
  12165. };
  12166. (function(c) {
  12167. var e = function(d) {
  12168. function a(a, c, e) {
  12169. "undefined" === typeof c && (c = !1);
  12170. "undefined" === typeof e && (e = !1);
  12171. d.call(this, a, c, e)
  12172. }
  12173. __extends(a, d);
  12174. a.dispatchUIEvent = function(b, d) {
  12175. c.Event._dispatchByTarget(a, b, d)
  12176. };
  12177. a.INITIALIZE = "initialize";
  12178. a.CREATION_COMPLETE = "creationComplete";
  12179. a.UPDATE_COMPLETE = "updateComplete";
  12180. a.BUTTON_DOWN = "buttonDown";
  12181. a.CHANGE_END = "changeEnd";
  12182. a.CHANGE_START = "changeStart";
  12183. a.CHANGING = "changing";
  12184. a.VALUE_COMMIT = "valueCommit";
  12185. a.SKIN_CHANGED = "skinChanged";
  12186. a.CONTENT_CHANGED = "contentChanged";
  12187. a.OPEN = "open";
  12188. a.CLOSE = "close";
  12189. a.PLAY_COMPLETE = "playComplete";
  12190. return a
  12191. }(c.Event);
  12192. c.UIEvent = e
  12193. })(egret || (egret = {}));
  12194. __extends = this.__extends || function(c, e) {
  12195. function d() {
  12196. this.constructor = c
  12197. }
  12198. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  12199. d.prototype = e.prototype;
  12200. c.prototype = new d
  12201. };
  12202. (function(c) {
  12203. var e = function(d) {
  12204. function a(a, c, e, m, f, g, k, n) {
  12205. "undefined" === typeof c && (c = !1);
  12206. "undefined" === typeof e && (e = !1);
  12207. "undefined" === typeof m && (m = null);
  12208. "undefined" === typeof f && (f = null);
  12209. "undefined" === typeof g && (g = null);
  12210. "undefined" === typeof k && (k = null);
  12211. "undefined" === typeof n && (n = null);
  12212. d.call(this, a, c, e);
  12213. this.kind = m;
  12214. this.property = f;
  12215. this.oldValue = g;
  12216. this.newValue = k;
  12217. this.source = n
  12218. }
  12219. __extends(a, d);
  12220. a.dispatchPropertyChangeEvent = function(b, d, e, m, f, g) {
  12221. "undefined" === typeof d && (d = null);
  12222. "undefined" === typeof e &&
  12223. (e = null);
  12224. "undefined" === typeof m && (m = null);
  12225. "undefined" === typeof f && (f = null);
  12226. "undefined" === typeof g && (g = null);
  12227. var k = c.Event._getPropertyData(a);
  12228. k.kind = d;
  12229. k.property = e;
  12230. k.oldValue = m;
  12231. k.newValue = f;
  12232. k.source = g;
  12233. c.Event._dispatchByTarget(a, b, a.PROPERTY_CHANGE, k)
  12234. };
  12235. a.PROPERTY_CHANGE = "propertyChange";
  12236. return a
  12237. }(c.Event);
  12238. c.PropertyChangeEvent = e
  12239. })(egret || (egret = {}));
  12240. (function(c) {
  12241. var e = function() {
  12242. function c() {}
  12243. c.UPDATE = "update";
  12244. c.DELETE = "delete";
  12245. return c
  12246. }();
  12247. c.PropertyChangeEventKind = e
  12248. })(egret || (egret = {}));
  12249. __extends = this.__extends || function(c, e) {
  12250. function d() {
  12251. this.constructor = c
  12252. }
  12253. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  12254. d.prototype = e.prototype;
  12255. c.prototype = new d
  12256. };
  12257. (function(c) {
  12258. var e = function(d) {
  12259. function a(a, c, e, m, f) {
  12260. "undefined" === typeof c && (c = NaN);
  12261. "undefined" === typeof e && (e = NaN);
  12262. "undefined" === typeof m && (m = !1);
  12263. "undefined" === typeof f && (f = !1);
  12264. d.call(this, a, m, f);
  12265. this.oldX = c;
  12266. this.oldY = e
  12267. }
  12268. __extends(a, d);
  12269. a.dispatchMoveEvent = function(b, d, e) {
  12270. "undefined" === typeof d && (d = NaN);
  12271. "undefined" === typeof e && (e = NaN);
  12272. var m = c.Event._getPropertyData(a);
  12273. m.oldX = d;
  12274. m.oldY = e;
  12275. c.Event._dispatchByTarget(a, b, a.MOVE, m)
  12276. };
  12277. a.MOVE = "move";
  12278. return a
  12279. }(c.Event);
  12280. c.MoveEvent = e
  12281. })(egret || (egret = {}));
  12282. __extends = this.__extends || function(c, e) {
  12283. function d() {
  12284. this.constructor = c
  12285. }
  12286. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  12287. d.prototype = e.prototype;
  12288. c.prototype = new d
  12289. };
  12290. (function(c) {
  12291. var e = function(d) {
  12292. function a(a, c, e, m, f) {
  12293. "undefined" === typeof c && (c = NaN);
  12294. "undefined" === typeof e && (e = NaN);
  12295. "undefined" === typeof m && (m = !1);
  12296. "undefined" === typeof f && (f = !1);
  12297. d.call(this, a, m, f);
  12298. this.oldWidth = c;
  12299. this.oldHeight = e
  12300. }
  12301. __extends(a, d);
  12302. a.dispatchResizeEvent = function(b, d, e) {
  12303. "undefined" === typeof d && (d = NaN);
  12304. "undefined" === typeof e && (e = NaN);
  12305. var m = c.Event._getPropertyData(a);
  12306. m.oldWidth = d;
  12307. m.oldHeight = e;
  12308. c.Event._dispatchByTarget(a, b, a.RESIZE, m)
  12309. };
  12310. a.RESIZE = "resize";
  12311. return a
  12312. }(c.Event);
  12313. c.ResizeEvent =
  12314. e
  12315. })(egret || (egret = {}));
  12316. __extends = this.__extends || function(c, e) {
  12317. function d() {
  12318. this.constructor = c
  12319. }
  12320. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  12321. d.prototype = e.prototype;
  12322. c.prototype = new d
  12323. };
  12324. (function(c) {
  12325. var e = function(d) {
  12326. function a(a, c, e, m, f) {
  12327. "undefined" === typeof c && (c = !1);
  12328. "undefined" === typeof e && (e = !1);
  12329. "undefined" === typeof m && (m = null);
  12330. "undefined" === typeof f && (f = null);
  12331. d.call(this, a, c, e);
  12332. this.partName = m;
  12333. this.instance = f
  12334. }
  12335. __extends(a, d);
  12336. a.dispatchSkinPartEvent = function(b, d, e, m) {
  12337. "undefined" === typeof e && (e = null);
  12338. "undefined" === typeof m && (m = null);
  12339. var f = c.Event._getPropertyData(a);
  12340. f.partName = e;
  12341. f.instance = m;
  12342. c.Event._dispatchByTarget(a, b, d, f)
  12343. };
  12344. a.PART_ADDED = "partAdded";
  12345. a.PART_REMOVED = "partRemoved";
  12346. return a
  12347. }(c.Event);
  12348. c.SkinPartEvent = e
  12349. })(egret || (egret = {}));
  12350. __extends = this.__extends || function(c, e) {
  12351. function d() {
  12352. this.constructor = c
  12353. }
  12354. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  12355. d.prototype = e.prototype;
  12356. c.prototype = new d
  12357. };
  12358. (function(c) {
  12359. var e = function(d) {
  12360. function a(a, c, e, m) {
  12361. "undefined" === typeof c && (c = !1);
  12362. "undefined" === typeof e && (e = !1);
  12363. "undefined" === typeof m && (m = -1);
  12364. d.call(this, a, c, e);
  12365. this.detail = m
  12366. }
  12367. __extends(a, d);
  12368. a.dispatchCloseEvent = function(b, d, e) {
  12369. "undefined" === typeof e && (e = -1);
  12370. var m = c.Event._getPropertyData(a);
  12371. m.detail = e;
  12372. c.Event._dispatchByTarget(a, b, d, m)
  12373. };
  12374. a.CLOSE = "close";
  12375. return a
  12376. }(c.Event);
  12377. c.CloseEvent = e
  12378. })(egret || (egret = {}));
  12379. __extends = this.__extends || function(c, e) {
  12380. function d() {
  12381. this.constructor = c
  12382. }
  12383. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  12384. d.prototype = e.prototype;
  12385. c.prototype = new d
  12386. };
  12387. (function(c) {
  12388. var e = function(d) {
  12389. function a(a, c, e, m, f, g, k, n) {
  12390. "undefined" === typeof c && (c = !1);
  12391. "undefined" === typeof e && (e = !1);
  12392. "undefined" === typeof m && (m = null);
  12393. "undefined" === typeof f && (f = -1);
  12394. "undefined" === typeof g && (g = -1);
  12395. "undefined" === typeof k && (k = null);
  12396. "undefined" === typeof n && (n = null);
  12397. d.call(this, a, c, e);
  12398. this.kind = m;
  12399. this.location = f;
  12400. this.oldLocation = g;
  12401. this.items = k ? k : [];
  12402. this.oldItems = n ? n : []
  12403. }
  12404. __extends(a, d);
  12405. a.dispatchCollectionEvent = function(b, d, e, m, f, g, k) {
  12406. "undefined" === typeof e && (e = null);
  12407. "undefined" === typeof m &&
  12408. (m = -1);
  12409. "undefined" === typeof f && (f = -1);
  12410. "undefined" === typeof g && (g = null);
  12411. "undefined" === typeof k && (k = null);
  12412. var n = c.Event._getPropertyData(a);
  12413. n.kind = e;
  12414. n.location = m;
  12415. n.oldLocation = f;
  12416. n.items = g;
  12417. n.oldItems = k;
  12418. c.Event._dispatchByTarget(a, b, d, n)
  12419. };
  12420. a.COLLECTION_CHANGE = "collectionChange";
  12421. return a
  12422. }(c.Event);
  12423. c.CollectionEvent = e
  12424. })(egret || (egret = {}));
  12425. (function(c) {
  12426. var e = function() {
  12427. function c() {}
  12428. c.ADD = "add";
  12429. c.MOVE = "move";
  12430. c.REFRESH = "refresh";
  12431. c.REMOVE = "remove";
  12432. c.REPLACE = "replace";
  12433. c.RESET = "reset";
  12434. c.UPDATE = "update";
  12435. c.OPEN = "open";
  12436. c.CLOSE = "close";
  12437. return c
  12438. }();
  12439. c.CollectionEventKind = e
  12440. })(egret || (egret = {}));
  12441. __extends = this.__extends || function(c, e) {
  12442. function d() {
  12443. this.constructor = c
  12444. }
  12445. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  12446. d.prototype = e.prototype;
  12447. c.prototype = new d
  12448. };
  12449. (function(c) {
  12450. var e = function(d) {
  12451. function a(a, c, e, m, f) {
  12452. "undefined" === typeof c && (c = !1);
  12453. "undefined" === typeof e && (e = !1);
  12454. "undefined" === typeof m && (m = null);
  12455. "undefined" === typeof f && (f = -1);
  12456. d.call(this, a, c, e);
  12457. this.element = m;
  12458. this.index = f
  12459. }
  12460. __extends(a, d);
  12461. a.dispatchElementExistenceEvent = function(b, d, e, m) {
  12462. "undefined" === typeof e && (e = null);
  12463. "undefined" === typeof m && (m = -1);
  12464. var f = c.Event._getPropertyData(a);
  12465. f.element = e;
  12466. f.index = m;
  12467. c.Event._dispatchByTarget(a, b, d, f)
  12468. };
  12469. a.ELEMENT_ADD = "elementAdd";
  12470. a.ELEMENT_REMOVE = "elementRemove";
  12471. return a
  12472. }(c.Event);
  12473. c.ElementExistenceEvent = e
  12474. })(egret || (egret = {}));
  12475. __extends = this.__extends || function(c, e) {
  12476. function d() {
  12477. this.constructor = c
  12478. }
  12479. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  12480. d.prototype = e.prototype;
  12481. c.prototype = new d
  12482. };
  12483. (function(c) {
  12484. var e = function(d) {
  12485. function a(a, c, e, m, f) {
  12486. "undefined" === typeof c && (c = !1);
  12487. "undefined" === typeof e && (e = !1);
  12488. "undefined" === typeof m && (m = -1);
  12489. "undefined" === typeof f && (f = -1);
  12490. d.call(this, a, c, e);
  12491. this.oldIndex = m;
  12492. this.newIndex = f
  12493. }
  12494. __extends(a, d);
  12495. a.dispatchIndexChangeEvent = function(b, d, e, m, f) {
  12496. "undefined" === typeof e && (e = -1);
  12497. "undefined" === typeof m && (m = -1);
  12498. "undefined" === typeof f && (f = !1);
  12499. var g = c.Event._getPropertyData(a);
  12500. g.oldIndex = e;
  12501. g.newIndex = m;
  12502. return c.Event._dispatchByTarget(a, b, d, g, !1, f)
  12503. };
  12504. a.CHANGE = "change";
  12505. a.CHANGING = "changing";
  12506. return a
  12507. }(c.Event);
  12508. c.IndexChangeEvent = e
  12509. })(egret || (egret = {}));
  12510. __extends = this.__extends || function(c, e) {
  12511. function d() {
  12512. this.constructor = c
  12513. }
  12514. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  12515. d.prototype = e.prototype;
  12516. c.prototype = new d
  12517. };
  12518. (function(c) {
  12519. var e = function(d) {
  12520. function a(a, c, e, m, f, g, k, n, p, q, r, s, z) {
  12521. "undefined" === typeof c && (c = !0);
  12522. "undefined" === typeof e && (e = !0);
  12523. "undefined" === typeof m && (m = 0);
  12524. "undefined" === typeof f && (f = 0);
  12525. "undefined" === typeof g && (g = 0);
  12526. "undefined" === typeof k && (k = !1);
  12527. "undefined" === typeof n && (n = !1);
  12528. "undefined" === typeof p && (p = !1);
  12529. "undefined" === typeof q && (q = !1);
  12530. "undefined" === typeof r && (r = -1);
  12531. "undefined" === typeof s && (s = null);
  12532. "undefined" === typeof z && (z = null);
  12533. d.call(this, a, c, e, m, f, g, k, n, p, q);
  12534. this.itemIndex = r;
  12535. this.item =
  12536. s;
  12537. this.itemRenderer = z
  12538. }
  12539. __extends(a, d);
  12540. a.dispatchListEvent = function(b, d, e, m, f, g) {
  12541. "undefined" === typeof e && (e = null);
  12542. "undefined" === typeof m && (m = -1);
  12543. "undefined" === typeof f && (f = null);
  12544. "undefined" === typeof g && (g = null);
  12545. var k = c.Event._getPropertyData(a);
  12546. k.touchPointID = e.touchPointID;
  12547. k._stageX = e.stageX;
  12548. k._stageY = e.stageY;
  12549. k.ctrlKey = e.ctrlKey;
  12550. k.altKey = e.altKey;
  12551. k.shiftKey = e.shiftKey;
  12552. k.touchDown = e.touchDown;
  12553. k.itemIndex = m;
  12554. k.item = f;
  12555. k.itemRenderer = g;
  12556. c.Event._dispatchByTarget(a, b, d, k)
  12557. };
  12558. a.ITEM_ROLL_OUT = "itemRollOut";
  12559. a.ITEM_ROLL_OVER = "itemRollOver";
  12560. a.ITEM_CLICK = "itemClick";
  12561. return a
  12562. }(c.TouchEvent);
  12563. c.ListEvent = e
  12564. })(egret || (egret = {}));
  12565. __extends = this.__extends || function(c, e) {
  12566. function d() {
  12567. this.constructor = c
  12568. }
  12569. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  12570. d.prototype = e.prototype;
  12571. c.prototype = new d
  12572. };
  12573. (function(c) {
  12574. var e = function(d) {
  12575. function a(a, c, e, m, f) {
  12576. "undefined" === typeof c && (c = !1);
  12577. "undefined" === typeof e && (e = !1);
  12578. "undefined" === typeof m && (m = null);
  12579. "undefined" === typeof f && (f = !1);
  12580. d.call(this, a, c, e);
  12581. this.popUp = m;
  12582. this.modal = f
  12583. }
  12584. __extends(a, d);
  12585. a.dispatchPopUpEvent = function(b, d, e, m) {
  12586. "undefined" === typeof e && (e = null);
  12587. "undefined" === typeof m && (m = !1);
  12588. var f = c.Event._getPropertyData(a);
  12589. f.popUp = e;
  12590. f.modal = m;
  12591. c.Event._dispatchByTarget(a, b, d, f)
  12592. };
  12593. a.ADD_POPUP = "addPopUp";
  12594. a.REMOVE_POPUP = "removePopUp";
  12595. a.BRING_TO_FRONT =
  12596. "bringToFront";
  12597. return a
  12598. }(c.Event);
  12599. c.PopUpEvent = e
  12600. })(egret || (egret = {}));
  12601. __extends = this.__extends || function(c, e) {
  12602. function d() {
  12603. this.constructor = c
  12604. }
  12605. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  12606. d.prototype = e.prototype;
  12607. c.prototype = new d
  12608. };
  12609. (function(c) {
  12610. var e = function(d) {
  12611. function a(a, c, e, m, f, g) {
  12612. "undefined" === typeof c && (c = !1);
  12613. "undefined" === typeof e && (e = !1);
  12614. "undefined" === typeof m && (m = null);
  12615. "undefined" === typeof f && (f = -1);
  12616. "undefined" === typeof g && (g = null);
  12617. d.call(this, a, c, e);
  12618. this.renderer = m;
  12619. this.index = f;
  12620. this.data = g
  12621. }
  12622. __extends(a, d);
  12623. a.dispatchRendererExistenceEvent = function(b, d, e, m, f) {
  12624. "undefined" === typeof e && (e = null);
  12625. "undefined" === typeof m && (m = -1);
  12626. "undefined" === typeof f && (f = null);
  12627. var g = c.Event._getPropertyData(a);
  12628. g.renderer = e;
  12629. g.index = m;
  12630. g.data =
  12631. f;
  12632. c.Event._dispatchByTarget(a, b, d, g)
  12633. };
  12634. a.RENDERER_ADD = "rendererAdd";
  12635. a.RENDERER_REMOVE = "rendererRemove";
  12636. return a
  12637. }(c.Event);
  12638. c.RendererExistenceEvent = e
  12639. })(egret || (egret = {}));
  12640. __extends = this.__extends || function(c, e) {
  12641. function d() {
  12642. this.constructor = c
  12643. }
  12644. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  12645. d.prototype = e.prototype;
  12646. c.prototype = new d
  12647. };
  12648. (function(c) {
  12649. var e = function(d) {
  12650. function a(a, c, e, m, f) {
  12651. "undefined" === typeof c && (c = !1);
  12652. "undefined" === typeof e && (e = !1);
  12653. "undefined" === typeof m && (m = null);
  12654. "undefined" === typeof f && (f = null);
  12655. d.call(this, a, c, e);
  12656. this.oldState = m;
  12657. this.newState = f
  12658. }
  12659. __extends(a, d);
  12660. a.dispatchStateChangeEvent = function(b, d, e, m) {
  12661. "undefined" === typeof e && (e = null);
  12662. "undefined" === typeof m && (m = null);
  12663. var f = c.Event._getPropertyData(a);
  12664. f.oldState = e;
  12665. f.newState = m;
  12666. c.Event._dispatchByTarget(a, b, d, f)
  12667. };
  12668. a.CURRENT_STATE_CHANGE = "currentStateChange";
  12669. a.CURRENT_STATE_CHANGING =
  12670. "currentStateChanging";
  12671. return a
  12672. }(c.Event);
  12673. c.StateChangeEvent = e
  12674. })(egret || (egret = {}));
  12675. __extends = this.__extends || function(c, e) {
  12676. function d() {
  12677. this.constructor = c
  12678. }
  12679. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  12680. d.prototype = e.prototype;
  12681. c.prototype = new d
  12682. };
  12683. (function(c) {
  12684. var e = function(d) {
  12685. function a(a, c, e) {
  12686. "undefined" === typeof c && (c = !1);
  12687. "undefined" === typeof e && (e = !1);
  12688. d.call(this, a, c, e)
  12689. }
  12690. __extends(a, d);
  12691. a.dispatchTrackBaseEvent = function(b, d) {
  12692. c.Event._dispatchByTarget(a, b, d)
  12693. };
  12694. a.THUMB_DRAG = "thumbDrag";
  12695. a.THUMB_PRESS = "thumbPress";
  12696. a.THUMB_RELEASE = "thumbRelease";
  12697. return a
  12698. }(c.Event);
  12699. c.TrackBaseEvent = e
  12700. })(egret || (egret = {}));
  12701. __extends = this.__extends || function(c, e) {
  12702. function d() {
  12703. this.constructor = c
  12704. }
  12705. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  12706. d.prototype = e.prototype;
  12707. c.prototype = new d
  12708. };
  12709. (function(c) {
  12710. var e = function(d) {
  12711. function a(a, c, e, m, f, g) {
  12712. "undefined" === typeof c && (c = !1);
  12713. "undefined" === typeof e && (e = !0);
  12714. "undefined" === typeof m && (m = -1);
  12715. "undefined" === typeof f && (f = null);
  12716. "undefined" === typeof g && (g = null);
  12717. d.call(this, a, c, e);
  12718. this.item = f;
  12719. this.itemRenderer = g;
  12720. this.itemIndex = m
  12721. }
  12722. __extends(a, d);
  12723. a.dispatchTreeEvent = function(b, d, e, m, f, g) {
  12724. "undefined" === typeof e && (e = -1);
  12725. "undefined" === typeof m && (m = null);
  12726. "undefined" === typeof f && (f = null);
  12727. "undefined" === typeof g && (g = !1);
  12728. var k = c.Event._getPropertyData(a);
  12729. k.itemIndex = e;
  12730. k.item = m;
  12731. k.itemRenderer = f;
  12732. k.opening = g;
  12733. c.Event._dispatchByTarget(a, b, d, k)
  12734. };
  12735. a.ITEM_CLOSE = "itemClose";
  12736. a.ITEM_OPEN = "itemOpen";
  12737. a.ITEM_OPENING = "itemOpening";
  12738. return a
  12739. }(c.Event);
  12740. c.TreeEvent = e
  12741. })(egret || (egret = {}));
  12742. __extends = this.__extends || function(c, e) {
  12743. function d() {
  12744. this.constructor = c
  12745. }
  12746. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  12747. d.prototype = e.prototype;
  12748. c.prototype = new d
  12749. };
  12750. (function(c) {
  12751. var e = function(c) {
  12752. function a() {
  12753. c.call(this);
  12754. this._useVirtualLayout = !1
  12755. }
  12756. __extends(a, c);
  12757. Object.defineProperty(a.prototype, "target", {
  12758. get: function() {
  12759. return this._target
  12760. },
  12761. set: function(a) {
  12762. this._target != a && (this._target = a, this.clearVirtualLayoutCache())
  12763. },
  12764. enumerable: !0,
  12765. configurable: !0
  12766. });
  12767. Object.defineProperty(a.prototype, "useVirtualLayout", {
  12768. get: function() {
  12769. return this._useVirtualLayout
  12770. },
  12771. set: function(a) {
  12772. this._useVirtualLayout != a && (this._useVirtualLayout = a, this.dispatchEventWith("useVirtualLayoutChanged"),
  12773. this._useVirtualLayout && !a && this.clearVirtualLayoutCache(), this.target && this.target.invalidateDisplayList())
  12774. },
  12775. enumerable: !0,
  12776. configurable: !0
  12777. });
  12778. Object.defineProperty(a.prototype, "typicalLayoutRect", {
  12779. get: function() {
  12780. return this._typicalLayoutRect
  12781. },
  12782. set: function(a) {
  12783. this._typicalLayoutRect != a && (this._typicalLayoutRect = a, this.target && this.target.invalidateSize())
  12784. },
  12785. enumerable: !0,
  12786. configurable: !0
  12787. });
  12788. a.prototype.scrollPositionChanged = function() {};
  12789. a.prototype.clearVirtualLayoutCache = function() {};
  12790. a.prototype.elementAdded =
  12791. function(a) {};
  12792. a.prototype.elementRemoved = function(a) {};
  12793. a.prototype.measure = function() {};
  12794. a.prototype.updateDisplayList = function(a, c) {};
  12795. return a
  12796. }(c.EventDispatcher);
  12797. c.LayoutBase = e
  12798. })(egret || (egret = {}));
  12799. __extends = this.__extends || function(c, e) {
  12800. function d() {
  12801. this.constructor = c
  12802. }
  12803. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  12804. d.prototype = e.prototype;
  12805. c.prototype = new d
  12806. };
  12807. (function(c) {
  12808. var e = function(d) {
  12809. function a() {
  12810. d.call(this);
  12811. this._mouseWheelSpeed = 20
  12812. }
  12813. __extends(a, d);
  12814. Object.defineProperty(a.prototype, "useVirtualLayout", {
  12815. set: function(a) {},
  12816. enumerable: !0,
  12817. configurable: !0
  12818. });
  12819. Object.defineProperty(a.prototype, "mouseWheelSpeed", {
  12820. get: function() {
  12821. return this._mouseWheelSpeed
  12822. },
  12823. set: function(a) {
  12824. 0 == a && (a = 1);
  12825. this._mouseWheelSpeed = a
  12826. },
  12827. enumerable: !0,
  12828. configurable: !0
  12829. });
  12830. a.prototype.getElementBoundsLeftOfScrollRect = function(a) {
  12831. var d = new c.Rectangle;
  12832. d.x = a.x - this._mouseWheelSpeed;
  12833. d.right =
  12834. a.x;
  12835. return d
  12836. };
  12837. a.prototype.getElementBoundsRightOfScrollRect = function(a) {
  12838. var d = new c.Rectangle;
  12839. d.x = a.right;
  12840. d.right = a.right + this._mouseWheelSpeed;
  12841. return d
  12842. };
  12843. a.prototype.getElementBoundsAboveScrollRect = function(a) {
  12844. var d = new c.Rectangle;
  12845. d.y = a.y - this._mouseWheelSpeed;
  12846. d.bottom = a.y;
  12847. return d
  12848. };
  12849. a.prototype.getElementBoundsBelowScrollRect = function(a) {
  12850. var d = new c.Rectangle;
  12851. d.y = a.bottom;
  12852. d.bottom = a.bottom + this._mouseWheelSpeed;
  12853. return d
  12854. };
  12855. a.prototype.measure = function() {
  12856. d.prototype.measure.call(this);
  12857. if (null != this.target) {
  12858. for (var a =
  12859. 0, c = 0, e = this.target.numElements, m = 0; m < e; m++) {
  12860. var f = this.target.getElementAt(m);
  12861. if (f && f.includeInLayout) {
  12862. var g = f.horizontalCenter,
  12863. k = f.verticalCenter,
  12864. n = f.left,
  12865. p = f.right,
  12866. q = f.top,
  12867. r = f.bottom;
  12868. isNaN(n) || isNaN(p) ? isNaN(g) ? isNaN(n) && isNaN(p) ? g = f.preferredX : (g = isNaN(n) ? 0 : n, g += isNaN(p) ? 0 : p) : g = 2 * Math.abs(g) : g = n + p;
  12869. isNaN(q) || isNaN(r) ? isNaN(k) ? isNaN(q) && isNaN(r) ? k = f.preferredY : (k = isNaN(q) ? 0 : q, k += isNaN(r) ? 0 : r) : k = 2 * Math.abs(k) : k = q + r;
  12870. r = f.preferredHeight;
  12871. a = Math.ceil(Math.max(a, g + f.preferredWidth));
  12872. c = Math.ceil(Math.max(c,
  12873. k + r))
  12874. }
  12875. }
  12876. this.target.measuredWidth = a;
  12877. this.target.measuredHeight = c
  12878. }
  12879. };
  12880. a.prototype.updateDisplayList = function(a, c) {
  12881. d.prototype.updateDisplayList.call(this, a, c);
  12882. if (null != this.target) {
  12883. for (var e = this.target.numElements, m = 0, f = 0, g = 0; g < e; g++) {
  12884. var k = this.target.getElementAt(g);
  12885. if (null != k && k.includeInLayout) {
  12886. var n = k.horizontalCenter,
  12887. p = k.verticalCenter,
  12888. q = k.left,
  12889. r = k.right,
  12890. s = k.top,
  12891. z = k.bottom,
  12892. A = k.percentWidth,
  12893. v = k.percentHeight,
  12894. B = NaN,
  12895. C = NaN;
  12896. isNaN(q) || isNaN(r) ? isNaN(A) || (B = Math.round(a * Math.min(0.01 * A, 1))) : B = a - r - q;
  12897. isNaN(s) ||
  12898. isNaN(z) ? isNaN(v) || (C = Math.round(c * Math.min(0.01 * v, 1))) : C = c - z - s;
  12899. k.setLayoutBoundsSize(B, C);
  12900. A = k.layoutBoundsWidth;
  12901. v = k.layoutBoundsHeight;
  12902. C = B = NaN;
  12903. B = isNaN(n) ? isNaN(q) ? isNaN(r) ? k.layoutBoundsX : a - A - r : q : Math.round((a - A) / 2 + n);
  12904. C = isNaN(p) ? isNaN(s) ? isNaN(z) ? k.layoutBoundsY : c - v - z : s : Math.round((c - v) / 2 + p);
  12905. k.setLayoutBoundsPosition(B, C);
  12906. m = Math.max(m, B + A);
  12907. f = Math.max(f, C + v)
  12908. }
  12909. }
  12910. this.target.setContentSize(m, f)
  12911. }
  12912. };
  12913. return a
  12914. }(c.LayoutBase);
  12915. c.BasicLayout = e
  12916. })(egret || (egret = {}));
  12917. (function(c) {
  12918. var e = function() {
  12919. function c() {}
  12920. c.LEFT = "left";
  12921. c.JUSTIFY_USING_GAP = "justifyUsingGap";
  12922. c.JUSTIFY_USING_WIDTH = "justifyUsingWidth";
  12923. return c
  12924. }();
  12925. c.ColumnAlign = e
  12926. })(egret || (egret = {}));
  12927. (function(c) {
  12928. var e = function() {
  12929. function c() {}
  12930. c.TOP = "top";
  12931. c.JUSTIFY_USING_GAP = "justifyUsingGap";
  12932. c.JUSTIFY_USING_HEIGHT = "justifyUsingHeight";
  12933. return c
  12934. }();
  12935. c.RowAlign = e
  12936. })(egret || (egret = {}));
  12937. (function(c) {
  12938. var e = function() {
  12939. function c() {}
  12940. c.ROWS = "rows";
  12941. c.COLUMNS = "columns";
  12942. return c
  12943. }();
  12944. c.TileOrientation = e
  12945. })(egret || (egret = {}));
  12946. __extends = this.__extends || function(c, e) {
  12947. function d() {
  12948. this.constructor = c
  12949. }
  12950. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  12951. d.prototype = e.prototype;
  12952. c.prototype = new d
  12953. };
  12954. (function(c) {
  12955. var e = function(a) {
  12956. function b() {
  12957. a.call(this);
  12958. this._horizontalAlign = c.HorizontalAlign.LEFT;
  12959. this._verticalAlign = c.VerticalAlign.TOP;
  12960. this._gap = 6;
  12961. this._padding = 0;
  12962. this._paddingBottom = this._paddingTop = this._paddingRight = this._paddingLeft = NaN;
  12963. this.elementSizeTable = [];
  12964. this.endIndex = this.startIndex = -1;
  12965. this.indexInViewCalculated = !1;
  12966. this.maxElementWidth = 0
  12967. }
  12968. __extends(b, a);
  12969. Object.defineProperty(b.prototype, "horizontalAlign", {
  12970. get: function() {
  12971. return this._horizontalAlign
  12972. },
  12973. set: function(a) {
  12974. this._horizontalAlign !=
  12975. a && (this._horizontalAlign = a, this.target && this.target.invalidateDisplayList())
  12976. },
  12977. enumerable: !0,
  12978. configurable: !0
  12979. });
  12980. Object.defineProperty(b.prototype, "verticalAlign", {
  12981. get: function() {
  12982. return this._verticalAlign
  12983. },
  12984. set: function(a) {
  12985. this._verticalAlign != a && (this._verticalAlign = a, this.target && this.target.invalidateDisplayList())
  12986. },
  12987. enumerable: !0,
  12988. configurable: !0
  12989. });
  12990. Object.defineProperty(b.prototype, "gap", {
  12991. get: function() {
  12992. return this._gap
  12993. },
  12994. set: function(a) {
  12995. this._gap != a && (this._gap = a, this.invalidateTargetSizeAndDisplayList(),
  12996. this.hasEventListener("gapChanged") && this.dispatchEventWith("gapChanged"))
  12997. },
  12998. enumerable: !0,
  12999. configurable: !0
  13000. });
  13001. Object.defineProperty(b.prototype, "padding", {
  13002. get: function() {
  13003. return this._padding
  13004. },
  13005. set: function(a) {
  13006. this._padding != a && (this._padding = a, this.invalidateTargetSizeAndDisplayList())
  13007. },
  13008. enumerable: !0,
  13009. configurable: !0
  13010. });
  13011. Object.defineProperty(b.prototype, "paddingLeft", {
  13012. get: function() {
  13013. return this._paddingLeft
  13014. },
  13015. set: function(a) {
  13016. this._paddingLeft != a && (this._paddingLeft = a, this.invalidateTargetSizeAndDisplayList())
  13017. },
  13018. enumerable: !0,
  13019. configurable: !0
  13020. });
  13021. Object.defineProperty(b.prototype, "paddingRight", {
  13022. get: function() {
  13023. return this._paddingRight
  13024. },
  13025. set: function(a) {
  13026. this._paddingRight != a && (this._paddingRight = a, this.invalidateTargetSizeAndDisplayList())
  13027. },
  13028. enumerable: !0,
  13029. configurable: !0
  13030. });
  13031. Object.defineProperty(b.prototype, "paddingTop", {
  13032. get: function() {
  13033. return this._paddingTop
  13034. },
  13035. set: function(a) {
  13036. this._paddingTop != a && (this._paddingTop = a, this.invalidateTargetSizeAndDisplayList())
  13037. },
  13038. enumerable: !0,
  13039. configurable: !0
  13040. });
  13041. Object.defineProperty(b.prototype,
  13042. "paddingBottom", {
  13043. get: function() {
  13044. return this._paddingBottom
  13045. },
  13046. set: function(a) {
  13047. this._paddingBottom != a && (this._paddingBottom = a, this.invalidateTargetSizeAndDisplayList())
  13048. },
  13049. enumerable: !0,
  13050. configurable: !0
  13051. });
  13052. b.prototype.invalidateTargetSizeAndDisplayList = function() {
  13053. this.target && (this.target.invalidateSize(), this.target.invalidateDisplayList())
  13054. };
  13055. b.prototype.measure = function() {
  13056. a.prototype.measure.call(this);
  13057. this.target && (this.useVirtualLayout ? this.measureVirtual() : this.measureReal())
  13058. };
  13059. b.prototype.measureVirtual =
  13060. function() {
  13061. for (var a = this.typicalLayoutRect ? this.typicalLayoutRect.height : 22, b = Math.max(this.maxElementWidth, this.typicalLayoutRect ? this.typicalLayoutRect.width : 71), c = this.getElementTotalSize(), d = this.target.getElementIndicesInView(), e = d.length, k = 0; k < e; k++) {
  13062. var n = d[k],
  13063. p = this.target.getElementAt(n);
  13064. if (null != p && p.includeInLayout) var q = p.preferredWidth,
  13065. c = c + p.preferredHeight,
  13066. c = c - (isNaN(this.elementSizeTable[n]) ? a : this.elementSizeTable[n]),
  13067. b = Math.max(b, q)
  13068. }
  13069. k = isNaN(this._padding) ? 0 : this._padding;
  13070. a = isNaN(this._paddingLeft) ?
  13071. k : this._paddingLeft;
  13072. d = isNaN(this._paddingRight) ? k : this._paddingRight;
  13073. e = isNaN(this._paddingTop) ? k : this._paddingTop;
  13074. k = isNaN(this._paddingBottom) ? k : this._paddingBottom;
  13075. e += k;
  13076. this.target.measuredWidth = Math.ceil(b + (a + d));
  13077. this.target.measuredHeight = Math.ceil(c + e)
  13078. };
  13079. b.prototype.measureReal = function() {
  13080. for (var a = this.target.numElements, b = a, c = 0, d = 0, e = 0; e < a; e++) {
  13081. var k = this.target.getElementAt(e);
  13082. if (k && k.includeInLayout) var n = k.preferredWidth,
  13083. d = d + k.preferredHeight,
  13084. c = Math.max(c, n);
  13085. else b--
  13086. }
  13087. a = isNaN(this._gap) ? 0 :
  13088. this._gap;
  13089. d += (b - 1) * a;
  13090. k = isNaN(this._padding) ? 0 : this._padding;
  13091. b = isNaN(this._paddingLeft) ? k : this._paddingLeft;
  13092. a = isNaN(this._paddingRight) ? k : this._paddingRight;
  13093. e = isNaN(this._paddingTop) ? k : this._paddingTop;
  13094. k = isNaN(this._paddingBottom) ? k : this._paddingBottom;
  13095. e += k;
  13096. this.target.measuredWidth = Math.ceil(c + (b + a));
  13097. this.target.measuredHeight = Math.ceil(d + e)
  13098. };
  13099. b.prototype.updateDisplayList = function(b, c) {
  13100. a.prototype.updateDisplayList.call(this, b, c);
  13101. this.target && (this.useVirtualLayout ? this.updateDisplayListVirtual(b,
  13102. c) : this.updateDisplayListReal(b, c))
  13103. };
  13104. b.prototype.getStartPosition = function(a) {
  13105. var b = isNaN(this._padding) ? 0 : this._padding,
  13106. c = isNaN(this._paddingTop) ? b : this._paddingTop,
  13107. b = isNaN(this._gap) ? 0 : this._gap;
  13108. if (!this.useVirtualLayout) {
  13109. var d;
  13110. this.target && (d = this.target.getElementAt(a));
  13111. return d ? d.y : c
  13112. }
  13113. d = this.typicalLayoutRect ? this.typicalLayoutRect.height : 22;
  13114. for (var e = 0; e < a; e++) {
  13115. var k = this.elementSizeTable[e];
  13116. isNaN(k) && (k = d);
  13117. c += k + b
  13118. }
  13119. return c
  13120. };
  13121. b.prototype.getElementSize = function(a) {
  13122. return this.useVirtualLayout ?
  13123. (a = this.elementSizeTable[a], isNaN(a) && (a = this.typicalLayoutRect ? this.typicalLayoutRect.height : 22), a) : this.target ? this.target.getElementAt(a).height : 0
  13124. };
  13125. b.prototype.getElementTotalSize = function() {
  13126. for (var a = isNaN(this._gap) ? 0 : this._gap, b = this.typicalLayoutRect ? this.typicalLayoutRect.height : 22, c = 0, d = this.target.numElements, e = 0; e < d; e++) {
  13127. var k = this.elementSizeTable[e];
  13128. isNaN(k) && (k = b);
  13129. c += k + a
  13130. }
  13131. return c - a
  13132. };
  13133. b.prototype.elementAdded = function(b) {
  13134. a.prototype.elementAdded.call(this, b);
  13135. this.elementSizeTable.splice(b,
  13136. 0, this.typicalLayoutRect ? this.typicalLayoutRect.height : 22)
  13137. };
  13138. b.prototype.elementRemoved = function(b) {
  13139. a.prototype.elementRemoved.call(this, b);
  13140. this.elementSizeTable.splice(b, 1)
  13141. };
  13142. b.prototype.clearVirtualLayoutCache = function() {
  13143. a.prototype.clearVirtualLayoutCache.call(this);
  13144. this.elementSizeTable = [];
  13145. this.maxElementWidth = 0
  13146. };
  13147. b.prototype.findIndexAt = function(a, b, c) {
  13148. var d = Math.floor(0.5 * (b + c)),
  13149. e = this.getStartPosition(d),
  13150. k = this.getElementSize(d),
  13151. n = isNaN(this._gap) ? 0 : this._gap;
  13152. return a >= e && a < e + k + n ? d : b == c ? -1 : a <
  13153. e ? this.findIndexAt(a, b, Math.max(b, d - 1)) : this.findIndexAt(a, Math.min(d + 1, c), c)
  13154. };
  13155. b.prototype.scrollPositionChanged = function() {
  13156. a.prototype.scrollPositionChanged.call(this);
  13157. this.useVirtualLayout && this.getIndexInView() && (this.indexInViewCalculated = !0, this.target.invalidateDisplayList())
  13158. };
  13159. b.prototype.getIndexInView = function() {
  13160. if (!this.target || 0 == this.target.numElements || isNaN(this.target.width) || 0 == this.target.width || isNaN(this.target.height) || 0 == this.target.height) return this.startIndex = this.endIndex = -1, !1;
  13161. var a = isNaN(this._padding) ? 0 : this._padding,
  13162. b = isNaN(this._paddingTop) ? a : this._paddingTop,
  13163. c = isNaN(this._paddingBottom) ? a : this._paddingBottom,
  13164. a = this.target.numElements,
  13165. d = this.getStartPosition(a - 1) + this.elementSizeTable[a - 1] + c,
  13166. e = this.target.verticalScrollPosition;
  13167. if (e > d - c) return this.endIndex = this.startIndex = -1, !1;
  13168. c = this.target.verticalScrollPosition + this.target.height;
  13169. if (c < b) return this.endIndex = this.startIndex = -1, !1;
  13170. b = this.startIndex;
  13171. d = this.endIndex;
  13172. this.startIndex = this.findIndexAt(e, 0, a - 1); - 1 ==
  13173. this.startIndex && (this.startIndex = 0);
  13174. this.endIndex = this.findIndexAt(c, 0, a - 1); - 1 == this.endIndex && (this.endIndex = a - 1);
  13175. return b != this.startIndex || d != this.endIndex
  13176. };
  13177. b.prototype.updateDisplayListVirtual = function(a, b) {
  13178. this.indexInViewCalculated ? this.indexInViewCalculated = !1 : this.getIndexInView();
  13179. var d = isNaN(this._padding) ? 0 : this._padding,
  13180. e = isNaN(this._paddingLeft) ? d : this._paddingLeft,
  13181. g = isNaN(this._paddingRight) ? d : this._paddingRight,
  13182. k = isNaN(this._paddingBottom) ? d : this._paddingBottom,
  13183. n = isNaN(this._gap) ? 0 :
  13184. this._gap,
  13185. p = this.target.numElements;
  13186. if (-1 == this.startIndex || -1 == this.endIndex) e = this.getStartPosition(p) - n + k, this.target.setContentSize(this.target.contentWidth, Math.ceil(e));
  13187. else {
  13188. this.target.setVirtualElementIndicesInView(this.startIndex, this.endIndex);
  13189. var q = this._horizontalAlign == c.HorizontalAlign.JUSTIFY || this._horizontalAlign == c.HorizontalAlign.CONTENT_JUSTIFY,
  13190. r = this._horizontalAlign == c.HorizontalAlign.CONTENT_JUSTIFY,
  13191. s = 0;
  13192. q || (this._horizontalAlign == c.HorizontalAlign.CENTER ? s = 0.5 : this._horizontalAlign ==
  13193. c.HorizontalAlign.RIGHT && (s = 1));
  13194. var z = Math.max(0, a - e - g),
  13195. A = Math.ceil(z),
  13196. v, B = this.typicalLayoutRect ? this.typicalLayoutRect.height : 22,
  13197. d = Math.max(this.typicalLayoutRect ? this.typicalLayoutRect.width : 71, this.maxElementWidth);
  13198. if (r) {
  13199. for (var C = this.startIndex; C <= this.endIndex; C++)(v = this.target.getVirtualElementAt(C)) && v.includeInLayout && (this.maxElementWidth = Math.max(this.maxElementWidth, v.preferredWidth));
  13200. A = Math.ceil(Math.max(z, this.maxElementWidth))
  13201. }
  13202. for (var t = 0, u = 0, C = 0, D = !1, w = this.startIndex; w <= this.endIndex; w++)
  13203. if (t =
  13204. 0, v = this.target.getVirtualElementAt(w)) v.includeInLayout ? (q ? (t = e, v.setLayoutBoundsSize(A, NaN)) : (t = (z - v.layoutBoundsWidth) * s, t = 0 < t ? t : 0, t = e + t), r || (this.maxElementWidth = Math.max(this.maxElementWidth, v.preferredWidth)), C = Math.max(C, v.layoutBoundsWidth), D || (u = isNaN(this.elementSizeTable[w]) ? B : this.elementSizeTable[w], u != v.layoutBoundsHeight && (D = !0)), 0 == w && 0 < this.elementSizeTable.length && this.elementSizeTable[w] != v.layoutBoundsHeight && (this.typicalLayoutRect = null), this.elementSizeTable[w] = v.layoutBoundsHeight,
  13205. u = this.getStartPosition(w), v.setLayoutBoundsPosition(Math.round(t), Math.round(u))) : this.elementSizeTable[w] = 0;
  13206. C += e + g;
  13207. e = this.getStartPosition(p) - n + k;
  13208. this.target.setContentSize(Math.ceil(C), Math.ceil(e));
  13209. (D || d < this.maxElementWidth) && this.target.invalidateSize()
  13210. }
  13211. };
  13212. b.prototype.updateDisplayListReal = function(a, e) {
  13213. var m = isNaN(this._padding) ? 0 : this._padding,
  13214. f = isNaN(this._paddingLeft) ? m : this._paddingLeft,
  13215. g = isNaN(this._paddingRight) ? m : this._paddingRight,
  13216. k = isNaN(this._paddingTop) ? m : this._paddingTop,
  13217. m = isNaN(this._paddingBottom) ?
  13218. m : this._paddingBottom,
  13219. n = isNaN(this._gap) ? 0 : this._gap,
  13220. p = Math.max(0, a - f - g),
  13221. q = Math.max(0, e - k - m),
  13222. r = this._verticalAlign == c.VerticalAlign.JUSTIFY,
  13223. s = this._horizontalAlign == c.HorizontalAlign.JUSTIFY || this._horizontalAlign == c.HorizontalAlign.CONTENT_JUSTIFY,
  13224. z = 0;
  13225. s || (this._horizontalAlign == c.HorizontalAlign.CENTER ? z = 0.5 : this._horizontalAlign == c.HorizontalAlign.RIGHT && (z = 1));
  13226. var A = this.target.numElements,
  13227. v = A,
  13228. B = f,
  13229. C = k,
  13230. t, u, D = 0,
  13231. B = 0,
  13232. w = [],
  13233. E, x = q;
  13234. for (t = 0; t < A; t++)(u = this.target.getElementAt(t)) && u.includeInLayout ? (this.maxElementWidth =
  13235. Math.max(this.maxElementWidth, u.preferredWidth), r ? D += u.preferredHeight : isNaN(u.percentHeight) ? x -= u.preferredHeight : (B += u.percentHeight, E = new d, E.layoutElement = u, E.percent = u.percentHeight, E.min = u.minHeight, E.max = u.maxHeight, w.push(E))) : v--;
  13236. var x = x - (v - 1) * n,
  13237. x = 0 < x ? x : 0,
  13238. y = q - D - n * (v - 1),
  13239. H, L = v,
  13240. G = [];
  13241. if (r) {
  13242. if (0 > y) {
  13243. H = x / v;
  13244. for (t = 0; t < A; t++)(u = this.target.getElementAt(t)) && u.includeInLayout && (u = u.preferredHeight, u <= H && (x -= u, L--));
  13245. x = 0 < x ? x : 0
  13246. }
  13247. } else if (0 < B) {
  13248. b.flexChildrenProportionally(q, x, B, w);
  13249. q = 0;
  13250. u = w.length;
  13251. for (t = 0; t <
  13252. u; t++) E = w[t], B = Math.round(E.size + q), q += E.size - B, G[E.layoutElement.hashCode] = B, x -= B;
  13253. x = 0 < x ? x : 0
  13254. }
  13255. this._verticalAlign == c.VerticalAlign.MIDDLE ? C = k + 0.5 * x : this._verticalAlign == c.VerticalAlign.BOTTOM && (C = k + x);
  13256. w = f;
  13257. u = v = 0;
  13258. E = Math.ceil(p);
  13259. this._horizontalAlign == c.HorizontalAlign.CONTENT_JUSTIFY && (E = Math.ceil(Math.max(p, this.maxElementWidth)));
  13260. q = 0;
  13261. v = NaN;
  13262. for (t = 0; t < A; t++) B = 0, (u = this.target.getElementAt(t)) && u.includeInLayout && (v = NaN, r ? (B = NaN, 0 < y ? B = x * u.preferredHeight / D : 0 > y && u.preferredHeight > H && (B = x / L), isNaN(B) ||
  13263. (v = Math.round(B + q), q += B - v)) : v = G[u.hashCode], s ? (B = f, u.setLayoutBoundsSize(E, v)) : (B = NaN, isNaN(u.percentWidth) || (B = Math.min(100, u.percentWidth), B = Math.round(p * B * 0.01)), u.setLayoutBoundsSize(B, v), B = (p - u.layoutBoundsWidth) * z, B = 0 < B ? B : 0, B = f + B), u.setLayoutBoundsPosition(Math.round(B), Math.round(C)), v = Math.ceil(u.layoutBoundsWidth), u = Math.ceil(u.layoutBoundsHeight), w = Math.max(w, B + v), k = Math.max(k, C + u), C += u + n);
  13264. this.target.setContentSize(Math.ceil(w + g), Math.ceil(k + m))
  13265. };
  13266. b.flexChildrenProportionally = function(a,
  13267. b, c, d) {
  13268. var e = d.length,
  13269. k;
  13270. do {
  13271. k = !0;
  13272. var n = b - a * c / 100;
  13273. 0 < n ? b -= n : n = 0;
  13274. for (var p = b / c, q = 0; q < e; q++) {
  13275. var r = d[q],
  13276. s = r.percent * p;
  13277. if (s < r.min) {
  13278. k = r.min;
  13279. r.size = k;
  13280. d[q] = d[--e];
  13281. d[e] = r;
  13282. c -= r.percent;
  13283. n >= k || (b -= k - n);
  13284. k = !1;
  13285. break
  13286. } else if (s > r.max) {
  13287. k = r.max;
  13288. r.size = k;
  13289. d[q] = d[--e];
  13290. d[e] = r;
  13291. c -= r.percent;
  13292. n >= k || (b -= k - n);
  13293. k = !1;
  13294. break
  13295. } else r.size = s
  13296. }
  13297. } while (!k)
  13298. };
  13299. return b
  13300. }(c.LayoutBase);
  13301. c.VerticalLayout = e;
  13302. var d = function() {
  13303. return function() {
  13304. this.size = 0
  13305. }
  13306. }()
  13307. })(egret || (egret = {}));
  13308. __extends = this.__extends || function(c, e) {
  13309. function d() {
  13310. this.constructor = c
  13311. }
  13312. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  13313. d.prototype = e.prototype;
  13314. c.prototype = new d
  13315. };
  13316. (function(c) {
  13317. var e = function(a) {
  13318. function b() {
  13319. a.call(this);
  13320. this._horizontalAlign = c.HorizontalAlign.LEFT;
  13321. this._verticalAlign = c.VerticalAlign.TOP;
  13322. this._gap = 6;
  13323. this._padding = 0;
  13324. this._paddingBottom = this._paddingTop = this._paddingRight = this._paddingLeft = NaN;
  13325. this.elementSizeTable = [];
  13326. this.endIndex = this.startIndex = -1;
  13327. this.indexInViewCalculated = !1;
  13328. this.maxElementHeight = 0
  13329. }
  13330. __extends(b, a);
  13331. Object.defineProperty(b.prototype, "horizontalAlign", {
  13332. get: function() {
  13333. return this._horizontalAlign
  13334. },
  13335. set: function(a) {
  13336. this._horizontalAlign !=
  13337. a && (this._horizontalAlign = a, this.target && this.target.invalidateDisplayList())
  13338. },
  13339. enumerable: !0,
  13340. configurable: !0
  13341. });
  13342. Object.defineProperty(b.prototype, "verticalAlign", {
  13343. get: function() {
  13344. return this._verticalAlign
  13345. },
  13346. set: function(a) {
  13347. this._verticalAlign != a && (this._verticalAlign = a, this.target && this.target.invalidateDisplayList())
  13348. },
  13349. enumerable: !0,
  13350. configurable: !0
  13351. });
  13352. Object.defineProperty(b.prototype, "gap", {
  13353. get: function() {
  13354. return this._gap
  13355. },
  13356. set: function(a) {
  13357. this._gap != a && (this._gap = a, this.invalidateTargetSizeAndDisplayList(),
  13358. this.hasEventListener("gapChanged") && this.dispatchEventWith("gapChanged"))
  13359. },
  13360. enumerable: !0,
  13361. configurable: !0
  13362. });
  13363. Object.defineProperty(b.prototype, "padding", {
  13364. get: function() {
  13365. return this._padding
  13366. },
  13367. set: function(a) {
  13368. this._padding != a && (this._padding = a, this.invalidateTargetSizeAndDisplayList())
  13369. },
  13370. enumerable: !0,
  13371. configurable: !0
  13372. });
  13373. Object.defineProperty(b.prototype, "paddingLeft", {
  13374. get: function() {
  13375. return this._paddingLeft
  13376. },
  13377. set: function(a) {
  13378. this._paddingLeft != a && (this._paddingLeft = a, this.invalidateTargetSizeAndDisplayList())
  13379. },
  13380. enumerable: !0,
  13381. configurable: !0
  13382. });
  13383. Object.defineProperty(b.prototype, "paddingRight", {
  13384. get: function() {
  13385. return this._paddingRight
  13386. },
  13387. set: function(a) {
  13388. this._paddingRight != a && (this._paddingRight = a, this.invalidateTargetSizeAndDisplayList())
  13389. },
  13390. enumerable: !0,
  13391. configurable: !0
  13392. });
  13393. Object.defineProperty(b.prototype, "paddingTop", {
  13394. get: function() {
  13395. return this._paddingTop
  13396. },
  13397. set: function(a) {
  13398. this._paddingTop != a && (this._paddingTop = a, this.invalidateTargetSizeAndDisplayList())
  13399. },
  13400. enumerable: !0,
  13401. configurable: !0
  13402. });
  13403. Object.defineProperty(b.prototype,
  13404. "paddingBottom", {
  13405. get: function() {
  13406. return this._paddingBottom
  13407. },
  13408. set: function(a) {
  13409. this._paddingBottom != a && (this._paddingBottom = a, this.invalidateTargetSizeAndDisplayList())
  13410. },
  13411. enumerable: !0,
  13412. configurable: !0
  13413. });
  13414. b.prototype.invalidateTargetSizeAndDisplayList = function() {
  13415. this.target && (this.target.invalidateSize(), this.target.invalidateDisplayList())
  13416. };
  13417. b.prototype.measure = function() {
  13418. a.prototype.measure.call(this);
  13419. this.target && (this.useVirtualLayout ? this.measureVirtual() : this.measureReal())
  13420. };
  13421. b.prototype.measureVirtual =
  13422. function() {
  13423. for (var a = this.typicalLayoutRect ? this.typicalLayoutRect.height : 22, b = this.typicalLayoutRect ? this.typicalLayoutRect.width : 71, c = this.getElementTotalSize(), a = Math.max(this.maxElementHeight, a), d = this.target.getElementIndicesInView(), e = d.length, k = 0; k < e; k++) {
  13424. var n = d[k],
  13425. p = this.target.getElementAt(n);
  13426. if (null != p && p.includeInLayout) var q = p.preferredHeight,
  13427. c = c + p.preferredWidth,
  13428. c = c - (isNaN(this.elementSizeTable[n]) ? b : this.elementSizeTable[n]),
  13429. a = Math.max(a, q)
  13430. }
  13431. k = isNaN(this._padding) ? 0 : this._padding;
  13432. b =
  13433. isNaN(this._paddingLeft) ? k : this._paddingLeft;
  13434. d = isNaN(this._paddingRight) ? k : this._paddingRight;
  13435. e = isNaN(this._paddingTop) ? k : this._paddingTop;
  13436. k = isNaN(this._paddingBottom) ? k : this._paddingBottom;
  13437. e += k;
  13438. this.target.measuredWidth = Math.ceil(c + (b + d));
  13439. this.target.measuredHeight = Math.ceil(a + e)
  13440. };
  13441. b.prototype.measureReal = function() {
  13442. for (var a = this.target.numElements, b = a, c = 0, d = 0, e = 0; e < a; e++) {
  13443. var k = this.target.getElementAt(e);
  13444. if (k && k.includeInLayout) var n = k.preferredHeight,
  13445. c = c + k.preferredWidth,
  13446. d = Math.max(d, n);
  13447. else b--
  13448. }
  13449. a =
  13450. isNaN(this._gap) ? 0 : this._gap;
  13451. c += (b - 1) * a;
  13452. k = isNaN(this._padding) ? 0 : this._padding;
  13453. b = isNaN(this._paddingLeft) ? k : this._paddingLeft;
  13454. a = isNaN(this._paddingRight) ? k : this._paddingRight;
  13455. e = isNaN(this._paddingTop) ? k : this._paddingTop;
  13456. k = isNaN(this._paddingBottom) ? k : this._paddingBottom;
  13457. e += k;
  13458. this.target.measuredWidth = Math.ceil(c + (b + a));
  13459. this.target.measuredHeight = Math.ceil(d + e)
  13460. };
  13461. b.prototype.updateDisplayList = function(b, c) {
  13462. a.prototype.updateDisplayList.call(this, b, c);
  13463. this.target && (this.useVirtualLayout ? this.updateDisplayListVirtual(b,
  13464. c) : this.updateDisplayListReal(b, c))
  13465. };
  13466. b.prototype.getStartPosition = function(a) {
  13467. var b = isNaN(this._padding) ? 0 : this._padding,
  13468. c = isNaN(this._paddingLeft) ? b : this._paddingLeft,
  13469. b = isNaN(this._gap) ? 0 : this._gap;
  13470. if (!this.useVirtualLayout) {
  13471. var d;
  13472. this.target && (d = this.target.getElementAt(a));
  13473. return d ? d.x : c
  13474. }
  13475. d = this.typicalLayoutRect ? this.typicalLayoutRect.width : 71;
  13476. for (var e = 0; e < a; e++) {
  13477. var k = this.elementSizeTable[e];
  13478. isNaN(k) && (k = d);
  13479. c += k + b
  13480. }
  13481. return c
  13482. };
  13483. b.prototype.getElementSize = function(a) {
  13484. return this.useVirtualLayout ?
  13485. (a = this.elementSizeTable[a], isNaN(a) && (a = this.typicalLayoutRect ? this.typicalLayoutRect.width : 71), a) : this.target ? this.target.getElementAt(a).width : 0
  13486. };
  13487. b.prototype.getElementTotalSize = function() {
  13488. for (var a = this.typicalLayoutRect ? this.typicalLayoutRect.width : 71, b = isNaN(this._gap) ? 0 : this._gap, c = 0, d = this.target.numElements, e = 0; e < d; e++) {
  13489. var k = this.elementSizeTable[e];
  13490. isNaN(k) && (k = a);
  13491. c += k + b
  13492. }
  13493. return c - b
  13494. };
  13495. b.prototype.elementAdded = function(b) {
  13496. this.useVirtualLayout && (a.prototype.elementAdded.call(this, b), this.elementSizeTable.splice(b,
  13497. 0, this.typicalLayoutRect ? this.typicalLayoutRect.width : 71))
  13498. };
  13499. b.prototype.elementRemoved = function(b) {
  13500. this.useVirtualLayout && (a.prototype.elementRemoved.call(this, b), this.elementSizeTable.splice(b, 1))
  13501. };
  13502. b.prototype.clearVirtualLayoutCache = function() {
  13503. this.useVirtualLayout && (a.prototype.clearVirtualLayoutCache.call(this), this.elementSizeTable = [], this.maxElementHeight = 0)
  13504. };
  13505. b.prototype.findIndexAt = function(a, b, c) {
  13506. var d = Math.floor(0.5 * (b + c)),
  13507. e = this.getStartPosition(d),
  13508. k = this.getElementSize(d),
  13509. n = isNaN(this._gap) ?
  13510. 0 : this._gap;
  13511. return a >= e && a < e + k + n ? d : b == c ? -1 : a < e ? this.findIndexAt(a, b, Math.max(b, d - 1)) : this.findIndexAt(a, Math.min(d + 1, c), c)
  13512. };
  13513. b.prototype.scrollPositionChanged = function() {
  13514. a.prototype.scrollPositionChanged.call(this);
  13515. this.useVirtualLayout && this.getIndexInView() && (this.indexInViewCalculated = !0, this.target.invalidateDisplayList())
  13516. };
  13517. b.prototype.getIndexInView = function() {
  13518. if (!this.target || 0 == this.target.numElements || isNaN(this.target.width) || 0 == this.target.width || isNaN(this.target.height) || 0 == this.target.height) return this.startIndex =
  13519. this.endIndex = -1, !1;
  13520. var a = isNaN(this._padding) ? 0 : this._padding,
  13521. b = isNaN(this._paddingLeft) ? a : this._paddingLeft,
  13522. c = isNaN(this._paddingRight) ? a : this._paddingRight;
  13523. isNaN(this._paddingTop);
  13524. isNaN(this._paddingBottom);
  13525. var a = this.target.numElements,
  13526. d = this.getStartPosition(a - 1) + this.elementSizeTable[a - 1] + c,
  13527. e = this.target.horizontalScrollPosition;
  13528. if (e > d - c) return this.endIndex = this.startIndex = -1, !1;
  13529. c = this.target.horizontalScrollPosition + this.target.width;
  13530. if (c < b) return this.endIndex = this.startIndex = -1, !1;
  13531. b = this.startIndex;
  13532. d = this.endIndex;
  13533. this.startIndex = this.findIndexAt(e, 0, a - 1); - 1 == this.startIndex && (this.startIndex = 0);
  13534. this.endIndex = this.findIndexAt(c, 0, a - 1); - 1 == this.endIndex && (this.endIndex = a - 1);
  13535. return b != this.startIndex || d != this.endIndex
  13536. };
  13537. b.prototype.updateDisplayListVirtual = function(a, b) {
  13538. this.indexInViewCalculated ? this.indexInViewCalculated = !1 : this.getIndexInView();
  13539. var d = isNaN(this._padding) ? 0 : this._padding,
  13540. e = isNaN(this._paddingRight) ? d : this._paddingRight,
  13541. g = isNaN(this._paddingTop) ? d : this._paddingTop,
  13542. k = isNaN(this._paddingBottom) ?
  13543. d : this._paddingBottom,
  13544. n = isNaN(this._gap) ? 0 : this._gap,
  13545. p = this.target.numElements;
  13546. if (-1 == this.startIndex || -1 == this.endIndex) e = this.getStartPosition(p) - n + e, this.target.setContentSize(Math.ceil(e), this.target.contentHeight);
  13547. else {
  13548. this.target.setVirtualElementIndicesInView(this.startIndex, this.endIndex);
  13549. var q = this._verticalAlign == c.VerticalAlign.JUSTIFY || this._verticalAlign == c.VerticalAlign.CONTENT_JUSTIFY,
  13550. r = this._verticalAlign == c.VerticalAlign.CONTENT_JUSTIFY,
  13551. s = 0;
  13552. q || (this._verticalAlign == c.VerticalAlign.MIDDLE ?
  13553. s = 0.5 : this._verticalAlign == c.VerticalAlign.BOTTOM && (s = 1));
  13554. var z = Math.max(0, b - g - k),
  13555. A = Math.ceil(z),
  13556. v, B = this.typicalLayoutRect ? this.typicalLayoutRect.width : 71,
  13557. d = Math.max(this.typicalLayoutRect ? this.typicalLayoutRect.height : 22, this.maxElementHeight);
  13558. if (r) {
  13559. for (var C = this.startIndex; C <= this.endIndex; C++)(v = this.target.getVirtualElementAt(C)) && v.includeInLayout && (this.maxElementHeight = Math.max(this.maxElementHeight, v.preferredHeight));
  13560. A = Math.ceil(Math.max(z, this.maxElementHeight))
  13561. }
  13562. for (var t = 0, u = 0, C = 0, D = !1, w = this.startIndex; w <= this.endIndex; w++)
  13563. if (u = 0, v = this.target.getVirtualElementAt(w)) v.includeInLayout ? (q ? (u = g, v.setLayoutBoundsSize(NaN, A)) : (u = (z - v.layoutBoundsHeight) * s, u = 0 < u ? u : 0, u = g + u), r || (this.maxElementHeight = Math.max(this.maxElementHeight, v.preferredHeight)), C = Math.max(C, v.layoutBoundsHeight), D || (t = isNaN(this.elementSizeTable[w]) ? B : this.elementSizeTable[w], t != v.layoutBoundsWidth && (D = !0)), 0 == w && 0 < this.elementSizeTable.length && this.elementSizeTable[w] != v.layoutBoundsWidth && (this.typicalLayoutRect =
  13564. null), this.elementSizeTable[w] = v.layoutBoundsWidth, t = this.getStartPosition(w), v.setLayoutBoundsPosition(Math.round(t), Math.round(u))) : this.elementSizeTable[w] = 0;
  13565. C += g + k;
  13566. e = this.getStartPosition(p) - n + e;
  13567. this.target.setContentSize(Math.ceil(e), Math.ceil(C));
  13568. (D || d < this.maxElementHeight) && this.target.invalidateSize()
  13569. }
  13570. };
  13571. b.prototype.updateDisplayListReal = function(a, e) {
  13572. var m = isNaN(this._padding) ? 0 : this._padding,
  13573. f = isNaN(this._paddingLeft) ? m : this._paddingLeft,
  13574. g = isNaN(this._paddingRight) ? m : this._paddingRight,
  13575. k = isNaN(this._paddingTop) ? m : this._paddingTop,
  13576. m = isNaN(this._paddingBottom) ? m : this._paddingBottom,
  13577. n = isNaN(this._gap) ? 0 : this._gap,
  13578. p = Math.max(0, a - f - g),
  13579. q = Math.max(0, e - k - m),
  13580. r = this._horizontalAlign == c.HorizontalAlign.JUSTIFY,
  13581. s = this._verticalAlign == c.VerticalAlign.JUSTIFY || this._verticalAlign == c.VerticalAlign.CONTENT_JUSTIFY,
  13582. z = 0;
  13583. s || (this._verticalAlign == c.VerticalAlign.MIDDLE ? z = 0.5 : this._verticalAlign == c.VerticalAlign.BOTTOM && (z = 1));
  13584. var A = this.target.numElements,
  13585. v = A,
  13586. B = f,
  13587. C = k,
  13588. t, u, D = 0,
  13589. C = 0,
  13590. w = [],
  13591. E, x = p;
  13592. for (t = 0; t <
  13593. A; t++)(u = this.target.getElementAt(t)) && u.includeInLayout ? (this.maxElementHeight = Math.max(this.maxElementHeight, u.preferredHeight), r ? D += u.preferredWidth : isNaN(u.percentWidth) ? x -= u.preferredWidth : (C += u.percentWidth, E = new d, E.layoutElement = u, E.percent = u.percentWidth, E.min = u.minWidth, E.max = u.maxWidth, w.push(E))) : v--;
  13594. var x = x - n * (v - 1),
  13595. x = 0 < x ? x : 0,
  13596. y = p - D - n * (v - 1),
  13597. H, L = v,
  13598. G = [];
  13599. if (r) {
  13600. if (0 > y) {
  13601. H = x / v;
  13602. for (t = 0; t < A; t++)(u = this.target.getElementAt(t)) && u.includeInLayout && (u = u.preferredWidth, u <= H && (x -= u, L--));
  13603. x = 0 < x ? x : 0
  13604. }
  13605. } else if (0 <
  13606. C) {
  13607. b.flexChildrenProportionally(p, x, C, w);
  13608. p = 0;
  13609. u = w.length;
  13610. for (t = 0; t < u; t++) E = w[t], C = Math.round(E.size + p), p += E.size - C, G[E.layoutElement.hashCode] = C, x -= C;
  13611. x = 0 < x ? x : 0
  13612. }
  13613. this._horizontalAlign == c.HorizontalAlign.CENTER ? B = f + 0.5 * x : this._horizontalAlign == c.HorizontalAlign.RIGHT && (B = f + x);
  13614. w = k;
  13615. u = v = 0;
  13616. E = Math.ceil(q);
  13617. this._verticalAlign == c.VerticalAlign.CONTENT_JUSTIFY && (E = Math.ceil(Math.max(q, this.maxElementHeight)));
  13618. for (t = p = 0; t < A; t++) C = 0, (u = this.target.getElementAt(t)) && u.includeInLayout && (v = NaN, r ? (C = NaN, 0 < y ? C = x * u.preferredWidth /
  13619. D : 0 > y && u.preferredWidth > H && (C = x / L), isNaN(C) || (v = Math.round(C + p), p += C - v)) : v = G[u.hashCode], s ? (C = k, u.setLayoutBoundsSize(v, E)) : (C = NaN, isNaN(u.percentHeight) || (C = Math.min(100, u.percentHeight), C = Math.round(q * C * 0.01)), u.setLayoutBoundsSize(v, C), C = (q - u.layoutBoundsHeight) * z, C = 0 < C ? C : 0, C = k + C), u.setLayoutBoundsPosition(Math.round(B), Math.round(C)), v = Math.ceil(u.layoutBoundsWidth), u = Math.ceil(u.layoutBoundsHeight), f = Math.max(f, B + v), w = Math.max(w, C + u), B += v + n);
  13620. this.target.setContentSize(Math.ceil(f + g), Math.ceil(w +
  13621. m))
  13622. };
  13623. b.flexChildrenProportionally = function(a, b, c, d) {
  13624. var e = d.length,
  13625. k;
  13626. do {
  13627. k = !0;
  13628. var n = b - a * c / 100;
  13629. 0 < n ? b -= n : n = 0;
  13630. for (var p = b / c, q = 0; q < e; q++) {
  13631. var r = d[q],
  13632. s = r.percent * p;
  13633. if (s < r.min) {
  13634. k = r.min;
  13635. r.size = k;
  13636. d[q] = d[--e];
  13637. d[e] = r;
  13638. c -= r.percent;
  13639. n >= k || (b -= k - n);
  13640. k = !1;
  13641. break
  13642. } else if (s > r.max) {
  13643. k = r.max;
  13644. r.size = k;
  13645. d[q] = d[--e];
  13646. d[e] = r;
  13647. c -= r.percent;
  13648. n >= k || (b -= k - n);
  13649. k = !1;
  13650. break
  13651. } else r.size = s
  13652. }
  13653. } while (!k)
  13654. };
  13655. return b
  13656. }(c.LayoutBase);
  13657. c.HorizontalLayout = e;
  13658. var d = function() {
  13659. return function() {
  13660. this.size = 0
  13661. }
  13662. }()
  13663. })(egret || (egret = {}));
  13664. __extends = this.__extends || function(c, e) {
  13665. function d() {
  13666. this.constructor = c
  13667. }
  13668. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  13669. d.prototype = e.prototype;
  13670. c.prototype = new d
  13671. };
  13672. (function(c) {
  13673. var e = function(d) {
  13674. function a() {
  13675. d.call(this);
  13676. this.explicitHorizontalGap = NaN;
  13677. this._horizontalGap = 6;
  13678. this.explicitVerticalGap = NaN;
  13679. this._verticalGap = 6;
  13680. this._columnCount = -1;
  13681. this._requestedColumnCount = 0;
  13682. this._rowCount = -1;
  13683. this._requestedRowCount = 0;
  13684. this._rowHeight = this.explicitRowHeight = this._columnWidth = this.explicitColumnWidth = NaN;
  13685. this._padding = 0;
  13686. this._paddingBottom = this._paddingTop = this._paddingRight = this._paddingLeft = NaN;
  13687. this._horizontalAlign = c.HorizontalAlign.JUSTIFY;
  13688. this._verticalAlign =
  13689. c.VerticalAlign.JUSTIFY;
  13690. this._columnAlign = c.ColumnAlign.LEFT;
  13691. this._rowAlign = c.RowAlign.TOP;
  13692. this._orientation = c.TileOrientation.ROWS;
  13693. this.maxElementHeight = this.maxElementWidth = 0;
  13694. this.endIndex = this.startIndex = -1;
  13695. this.indexInViewCalculated = !1
  13696. }
  13697. __extends(a, d);
  13698. Object.defineProperty(a.prototype, "horizontalGap", {
  13699. get: function() {
  13700. return this._horizontalGap
  13701. },
  13702. set: function(a) {
  13703. a != this._horizontalGap && (this._horizontalGap = this.explicitHorizontalGap = a, this.invalidateTargetSizeAndDisplayList(), this.hasEventListener("gapChanged") &&
  13704. this.dispatchEventWith("gapChanged"))
  13705. },
  13706. enumerable: !0,
  13707. configurable: !0
  13708. });
  13709. Object.defineProperty(a.prototype, "verticalGap", {
  13710. get: function() {
  13711. return this._verticalGap
  13712. },
  13713. set: function(a) {
  13714. a != this._verticalGap && (this._verticalGap = this.explicitVerticalGap = a, this.invalidateTargetSizeAndDisplayList(), this.hasEventListener("gapChanged") && this.dispatchEventWith("gapChanged"))
  13715. },
  13716. enumerable: !0,
  13717. configurable: !0
  13718. });
  13719. Object.defineProperty(a.prototype, "columnCount", {
  13720. get: function() {
  13721. return this._columnCount
  13722. },
  13723. enumerable: !0,
  13724. configurable: !0
  13725. });
  13726. Object.defineProperty(a.prototype, "requestedColumnCount", {
  13727. get: function() {
  13728. return this._requestedColumnCount
  13729. },
  13730. set: function(a) {
  13731. this._requestedColumnCount != a && (this._columnCount = this._requestedColumnCount = a, this.invalidateTargetSizeAndDisplayList())
  13732. },
  13733. enumerable: !0,
  13734. configurable: !0
  13735. });
  13736. Object.defineProperty(a.prototype, "rowCount", {
  13737. get: function() {
  13738. return this._rowCount
  13739. },
  13740. enumerable: !0,
  13741. configurable: !0
  13742. });
  13743. Object.defineProperty(a.prototype, "requestedRowCount", {
  13744. get: function() {
  13745. return this._requestedRowCount
  13746. },
  13747. set: function(a) {
  13748. this._requestedRowCount !=
  13749. a && (this._rowCount = this._requestedRowCount = a, this.invalidateTargetSizeAndDisplayList())
  13750. },
  13751. enumerable: !0,
  13752. configurable: !0
  13753. });
  13754. Object.defineProperty(a.prototype, "columnWidth", {
  13755. get: function() {
  13756. return this._columnWidth
  13757. },
  13758. set: function(a) {
  13759. a != this._columnWidth && (this._columnWidth = this.explicitColumnWidth = a, this.invalidateTargetSizeAndDisplayList())
  13760. },
  13761. enumerable: !0,
  13762. configurable: !0
  13763. });
  13764. Object.defineProperty(a.prototype, "rowHeight", {
  13765. get: function() {
  13766. return this._rowHeight
  13767. },
  13768. set: function(a) {
  13769. a != this._rowHeight && (this._rowHeight =
  13770. this.explicitRowHeight = a, this.invalidateTargetSizeAndDisplayList())
  13771. },
  13772. enumerable: !0,
  13773. configurable: !0
  13774. });
  13775. Object.defineProperty(a.prototype, "padding", {
  13776. get: function() {
  13777. return this._padding
  13778. },
  13779. set: function(a) {
  13780. this._padding != a && (this._padding = a, this.invalidateTargetSizeAndDisplayList())
  13781. },
  13782. enumerable: !0,
  13783. configurable: !0
  13784. });
  13785. Object.defineProperty(a.prototype, "paddingLeft", {
  13786. get: function() {
  13787. return this._paddingLeft
  13788. },
  13789. set: function(a) {
  13790. this._paddingLeft != a && (this._paddingLeft = a, this.invalidateTargetSizeAndDisplayList())
  13791. },
  13792. enumerable: !0,
  13793. configurable: !0
  13794. });
  13795. Object.defineProperty(a.prototype, "paddingRight", {
  13796. get: function() {
  13797. return this._paddingRight
  13798. },
  13799. set: function(a) {
  13800. this._paddingRight != a && (this._paddingRight = a, this.invalidateTargetSizeAndDisplayList())
  13801. },
  13802. enumerable: !0,
  13803. configurable: !0
  13804. });
  13805. Object.defineProperty(a.prototype, "paddingTop", {
  13806. get: function() {
  13807. return this._paddingTop
  13808. },
  13809. set: function(a) {
  13810. this._paddingTop != a && (this._paddingTop = a, this.invalidateTargetSizeAndDisplayList())
  13811. },
  13812. enumerable: !0,
  13813. configurable: !0
  13814. });
  13815. Object.defineProperty(a.prototype,
  13816. "paddingBottom", {
  13817. get: function() {
  13818. return this._paddingBottom
  13819. },
  13820. set: function(a) {
  13821. this._paddingBottom != a && (this._paddingBottom = a, this.invalidateTargetSizeAndDisplayList())
  13822. },
  13823. enumerable: !0,
  13824. configurable: !0
  13825. });
  13826. Object.defineProperty(a.prototype, "horizontalAlign", {
  13827. get: function() {
  13828. return this._horizontalAlign
  13829. },
  13830. set: function(a) {
  13831. this._horizontalAlign != a && (this._horizontalAlign = a, this.invalidateTargetSizeAndDisplayList())
  13832. },
  13833. enumerable: !0,
  13834. configurable: !0
  13835. });
  13836. Object.defineProperty(a.prototype, "verticalAlign", {
  13837. get: function() {
  13838. return this._verticalAlign
  13839. },
  13840. set: function(a) {
  13841. this._verticalAlign != a && (this._verticalAlign = a, this.invalidateTargetSizeAndDisplayList())
  13842. },
  13843. enumerable: !0,
  13844. configurable: !0
  13845. });
  13846. Object.defineProperty(a.prototype, "columnAlign", {
  13847. get: function() {
  13848. return this._columnAlign
  13849. },
  13850. set: function(a) {
  13851. this._columnAlign != a && (this._columnAlign = a, this.invalidateTargetSizeAndDisplayList())
  13852. },
  13853. enumerable: !0,
  13854. configurable: !0
  13855. });
  13856. Object.defineProperty(a.prototype, "rowAlign", {
  13857. get: function() {
  13858. return this._rowAlign
  13859. },
  13860. set: function(a) {
  13861. this._rowAlign != a && (this._rowAlign = a,
  13862. this.invalidateTargetSizeAndDisplayList())
  13863. },
  13864. enumerable: !0,
  13865. configurable: !0
  13866. });
  13867. Object.defineProperty(a.prototype, "orientation", {
  13868. get: function() {
  13869. return this._orientation
  13870. },
  13871. set: function(a) {
  13872. this._orientation != a && (this._orientation = a, this.invalidateTargetSizeAndDisplayList(), this.hasEventListener("orientationChanged") && this.dispatchEventWith("orientationChanged"))
  13873. },
  13874. enumerable: !0,
  13875. configurable: !0
  13876. });
  13877. a.prototype.invalidateTargetSizeAndDisplayList = function() {
  13878. this.target && (this.target.invalidateSize(), this.target.invalidateDisplayList())
  13879. };
  13880. a.prototype.measure = function() {
  13881. if (this.target) {
  13882. var a = this._columnCount,
  13883. c = this._rowCount,
  13884. d = this._columnWidth,
  13885. e = this._rowHeight,
  13886. f = 0,
  13887. g = 0;
  13888. this.calculateRowAndColumn(this.target.explicitWidth, this.target.explicitHeight);
  13889. var k = 0 < this._requestedColumnCount ? this._requestedColumnCount : this._columnCount,
  13890. n = 0 < this._requestedRowCount ? this._requestedRowCount : this._rowCount,
  13891. p = isNaN(this._horizontalGap) ? 0 : this._horizontalGap,
  13892. q = isNaN(this._verticalGap) ? 0 : this._verticalGap;
  13893. 0 < k && (f = k * (this._columnWidth + p) - p);
  13894. 0 < n && (g =
  13895. n * (this._rowHeight + q) - q);
  13896. q = isNaN(this._padding) ? 0 : this._padding;
  13897. k = isNaN(this._paddingLeft) ? q : this._paddingLeft;
  13898. n = isNaN(this._paddingRight) ? q : this._paddingRight;
  13899. p = isNaN(this._paddingTop) ? q : this._paddingTop;
  13900. q = isNaN(this._paddingBottom) ? q : this._paddingBottom;
  13901. p += q;
  13902. this.target.measuredWidth = Math.ceil(f + (k + n));
  13903. this.target.measuredHeight = Math.ceil(g + p);
  13904. this._columnCount = a;
  13905. this._rowCount = c;
  13906. this._columnWidth = d;
  13907. this._rowHeight = e
  13908. }
  13909. };
  13910. a.prototype.calculateRowAndColumn = function(a, d) {
  13911. var e = isNaN(this._horizontalGap) ?
  13912. 0 : this._horizontalGap,
  13913. m = isNaN(this._verticalGap) ? 0 : this._verticalGap;
  13914. this._rowCount = this._columnCount = -1;
  13915. for (var f = this.target.numElements, g = f, k = 0; k < g; k++) {
  13916. var n = this.target.getElementAt(k);
  13917. n && !n.includeInLayout && f--
  13918. }
  13919. if (0 == f) this._rowCount = this._columnCount = 0;
  13920. else {
  13921. (isNaN(this.explicitColumnWidth) || isNaN(this.explicitRowHeight)) && this.updateMaxElementSize();
  13922. isNaN(this.explicitColumnWidth) ? this._columnWidth = this.maxElementWidth : this._columnWidth = this.explicitColumnWidth;
  13923. isNaN(this.explicitRowHeight) ?
  13924. this._rowHeight = this.maxElementHeight : this._rowHeight = this.explicitRowHeight;
  13925. g = this._columnWidth + e;
  13926. 0 >= g && (g = 1);
  13927. k = this._rowHeight + m;
  13928. 0 >= k && (k = 1);
  13929. var n = this.orientation == c.TileOrientation.COLUMNS,
  13930. p = !isNaN(a),
  13931. q = !isNaN(d),
  13932. r = isNaN(this._padding) ? 0 : this._padding,
  13933. s = isNaN(this._paddingLeft) ? r : this._paddingLeft,
  13934. z = isNaN(this._paddingRight) ? r : this._paddingRight,
  13935. A = isNaN(this._paddingTop) ? r : this._paddingTop,
  13936. r = isNaN(this._paddingBottom) ? r : this._paddingBottom;
  13937. 0 < this._requestedColumnCount || 0 < this._requestedRowCount ?
  13938. (0 < this._requestedRowCount && (this._rowCount = Math.min(this._requestedRowCount, f)), 0 < this._requestedColumnCount && (this._columnCount = Math.min(this._requestedColumnCount, f))) : p || q ? !p || q && n ? (e = Math.max(0, d - A - r), this._rowCount = Math.floor((e + m) / k), this._rowCount = Math.max(1, Math.min(this._rowCount, f))) : (m = Math.max(0, a - s - z), this._columnCount = Math.floor((m + e) / g), this._columnCount = Math.max(1, Math.min(this._columnCount, f))) : (e = Math.sqrt(f * g * k), n ? this._rowCount = Math.max(1, Math.round(e / k)) : this._columnCount = Math.max(1,
  13939. Math.round(e / g))); - 1 == this._rowCount && (this._rowCount = Math.max(1, Math.ceil(f / this._columnCount))); - 1 == this._columnCount && (this._columnCount = Math.max(1, Math.ceil(f / this._rowCount)));
  13940. 0 < this._requestedColumnCount && 0 < this._requestedRowCount && (this.orientation == c.TileOrientation.ROWS ? this._rowCount = Math.max(1, Math.ceil(f / this._requestedColumnCount)) : this._columnCount = Math.max(1, Math.ceil(f / this._requestedRowCount)))
  13941. }
  13942. };
  13943. a.prototype.updateMaxElementSize = function() {
  13944. this.target && (this.useVirtualLayout ? this.updateMaxElementSizeVirtual() :
  13945. this.updateMaxElementSizeReal())
  13946. };
  13947. a.prototype.updateMaxElementSizeVirtual = function() {
  13948. var a = this.typicalLayoutRect ? this.typicalLayoutRect.height : 22;
  13949. this.maxElementWidth = Math.max(this.maxElementWidth, this.typicalLayoutRect ? this.typicalLayoutRect.width : 22);
  13950. this.maxElementHeight = Math.max(this.maxElementHeight, a);
  13951. if (-1 != this.startIndex && -1 != this.endIndex)
  13952. for (a = this.startIndex; a <= this.endIndex; a++) {
  13953. var c = this.target.getVirtualElementAt(a);
  13954. c && c.includeInLayout && (this.maxElementWidth = Math.max(this.maxElementWidth,
  13955. c.preferredWidth), this.maxElementHeight = Math.max(this.maxElementHeight, c.preferredHeight))
  13956. }
  13957. };
  13958. a.prototype.updateMaxElementSizeReal = function() {
  13959. for (var a = this.target.numElements, c = 0; c < a; c++) {
  13960. var d = this.target.getElementAt(c);
  13961. d && d.includeInLayout && (this.maxElementWidth = Math.max(this.maxElementWidth, d.preferredWidth), this.maxElementHeight = Math.max(this.maxElementHeight, d.preferredHeight))
  13962. }
  13963. };
  13964. a.prototype.clearVirtualLayoutCache = function() {
  13965. d.prototype.clearVirtualLayoutCache.call(this);
  13966. this.maxElementHeight =
  13967. this.maxElementWidth = 0
  13968. };
  13969. a.prototype.scrollPositionChanged = function() {
  13970. d.prototype.scrollPositionChanged.call(this);
  13971. this.useVirtualLayout && this.getIndexInView() && (this.indexInViewCalculated = !0, this.target.invalidateDisplayList())
  13972. };
  13973. a.prototype.getIndexInView = function() {
  13974. if (!this.target || 0 == this.target.numElements) return this.startIndex = this.endIndex = -1, !1;
  13975. var a = this.target.numElements;
  13976. if (!this.useVirtualLayout) return this.startIndex = 0, this.endIndex = a - 1, !1;
  13977. if (isNaN(this.target.width) || 0 == this.target.width ||
  13978. isNaN(this.target.height) || 0 == this.target.height) return this.startIndex = this.endIndex = -1, !1;
  13979. var d = this.startIndex,
  13980. e = this.endIndex,
  13981. m = isNaN(this._padding) ? 0 : this._padding,
  13982. f = isNaN(this._paddingLeft) ? m : this._paddingLeft,
  13983. m = isNaN(this._paddingTop) ? m : this._paddingTop,
  13984. g = isNaN(this._horizontalGap) ? 0 : this._horizontalGap,
  13985. k = isNaN(this._verticalGap) ? 0 : this._verticalGap;
  13986. if (this.orientation == c.TileOrientation.COLUMNS) {
  13987. g = this._columnWidth + g;
  13988. if (0 >= g) return this.startIndex = 0, this.endIndex = a - 1, !1;
  13989. k = this.target.horizontalScrollPosition +
  13990. this.target.width;
  13991. m = Math.floor((this.target.horizontalScrollPosition - f) / g);
  13992. 0 > m && (m = 0);
  13993. f = Math.ceil((k - f) / g);
  13994. 0 > f && (f = 0);
  13995. this.startIndex = Math.min(a - 1, Math.max(0, m * this._rowCount));
  13996. this.endIndex = Math.min(a - 1, Math.max(0, f * this._rowCount - 1))
  13997. } else {
  13998. g = this._rowHeight + k;
  13999. if (0 >= g) return this.startIndex = 0, this.endIndex = a - 1, !1;
  14000. k = this.target.verticalScrollPosition + this.target.height;
  14001. f = Math.floor((this.target.verticalScrollPosition - m) / g);
  14002. 0 > f && (f = 0);
  14003. m = Math.ceil((k - m) / g);
  14004. 0 > m && (m = 0);
  14005. this.startIndex = Math.min(a - 1, Math.max(0,
  14006. f * this._columnCount));
  14007. this.endIndex = Math.min(a - 1, Math.max(0, m * this._columnCount - 1))
  14008. }
  14009. return this.startIndex != d || this.endIndex != e
  14010. };
  14011. a.prototype.updateDisplayList = function(a, e) {
  14012. d.prototype.updateDisplayList.call(this, a, e);
  14013. if (this.target) {
  14014. var l = isNaN(this._padding) ? 0 : this._padding,
  14015. m = isNaN(this._paddingLeft) ? l : this._paddingLeft,
  14016. f = isNaN(this._paddingRight) ? l : this._paddingRight,
  14017. g = isNaN(this._paddingTop) ? l : this._paddingTop,
  14018. k = isNaN(this._paddingBottom) ? l : this._paddingBottom,
  14019. l = isNaN(this._horizontalGap) ? 0 : this._horizontalGap,
  14020. n = isNaN(this._verticalGap) ? 0 : this._verticalGap;
  14021. if (this.indexInViewCalculated) this.indexInViewCalculated = !1;
  14022. else {
  14023. this.calculateRowAndColumn(a, e);
  14024. if (0 == this._rowCount || 0 == this._columnCount) {
  14025. this.target.setContentSize(m + f, g + k);
  14026. return
  14027. }
  14028. this.adjustForJustify(a, e);
  14029. this.getIndexInView()
  14030. }
  14031. this.useVirtualLayout && (this.calculateRowAndColumn(a, e), this.adjustForJustify(a, e));
  14032. if (-1 == this.startIndex || -1 == this.endIndex) this.target.setContentSize(0, 0);
  14033. else {
  14034. this.target.setVirtualElementIndicesInView(this.startIndex,
  14035. this.endIndex);
  14036. for (var p, q, r, s = this.orientation == c.TileOrientation.COLUMNS, z = this.startIndex, A = this.startIndex; A <= this.endIndex; A++) p = this.useVirtualLayout ? this.target.getVirtualElementAt(A) : this.target.getElementAt(A), null != p && p.includeInLayout && (s ? (q = Math.ceil((z + 1) / this._rowCount) - 1, r = Math.ceil((z + 1) % this._rowCount) - 1, -1 == r && (r = this._rowCount - 1)) : (q = Math.ceil((z + 1) % this._columnCount) - 1, -1 == q && (q = this._columnCount - 1), r = Math.ceil((z + 1) / this._columnCount) - 1), q = q * (this._columnWidth + l) + m, r = r * (this._rowHeight +
  14037. n) + g, this.sizeAndPositionElement(p, q, r, this._columnWidth, this.rowHeight), z++);
  14038. g += k;
  14039. n = (this._rowHeight + n) * this._rowCount - n;
  14040. this.target.setContentSize(Math.ceil((this._columnWidth + l) * this._columnCount - l + (m + f)), Math.ceil(n + g))
  14041. }
  14042. }
  14043. };
  14044. a.prototype.sizeAndPositionElement = function(a, d, e, m, f) {
  14045. var g = NaN,
  14046. k = NaN;
  14047. this.horizontalAlign == c.HorizontalAlign.JUSTIFY ? g = m : isNaN(a.percentWidth) || (g = m * a.percentWidth * 0.01);
  14048. this.verticalAlign == c.VerticalAlign.JUSTIFY ? k = f : isNaN(a.percentHeight) || (k = f * a.percentHeight * 0.01);
  14049. a.setLayoutBoundsSize(Math.round(g),
  14050. Math.round(k));
  14051. g = d;
  14052. switch (this.horizontalAlign) {
  14053. case c.HorizontalAlign.RIGHT:
  14054. g += m - a.layoutBoundsWidth;
  14055. break;
  14056. case c.HorizontalAlign.CENTER:
  14057. g = d + (m - a.layoutBoundsWidth) / 2
  14058. }
  14059. d = e;
  14060. switch (this.verticalAlign) {
  14061. case c.VerticalAlign.BOTTOM:
  14062. d += f - a.layoutBoundsHeight;
  14063. break;
  14064. case c.VerticalAlign.MIDDLE:
  14065. d += (f - a.layoutBoundsHeight) / 2
  14066. }
  14067. a.setLayoutBoundsPosition(Math.round(g), Math.round(d))
  14068. };
  14069. a.prototype.adjustForJustify = function(a, d) {
  14070. var e = isNaN(this._padding) ? 0 : this._padding,
  14071. m = isNaN(this._paddingLeft) ? e : this._paddingLeft,
  14072. f = isNaN(this._paddingRight) ? e : this._paddingRight,
  14073. g = isNaN(this._paddingTop) ? e : this._paddingTop,
  14074. e = isNaN(this._paddingBottom) ? e : this._paddingBottom,
  14075. m = Math.max(0, a - m - f),
  14076. g = Math.max(0, d - g - e);
  14077. isNaN(this.explicitVerticalGap) || (this._verticalGap = this.explicitVerticalGap);
  14078. isNaN(this.explicitHorizontalGap) || (this._horizontalGap = this.explicitHorizontalGap);
  14079. this._verticalGap = isNaN(this._verticalGap) ? 0 : this._verticalGap;
  14080. this._horizontalGap = isNaN(this._horizontalGap) ? 0 : this._horizontalGap;
  14081. g -= this._rowHeight * this._rowCount;
  14082. m -= this._columnWidth * this._columnCount;
  14083. 0 < g && (this.rowAlign == c.RowAlign.JUSTIFY_USING_GAP ? (f = Math.max(1, this._rowCount - 1), this._verticalGap = g / f) : this.rowAlign == c.RowAlign.JUSTIFY_USING_HEIGHT && 0 < this._rowCount && (this._rowHeight += (g - (this._rowCount - 1) * this._verticalGap) / this._rowCount));
  14084. 0 < m && (this.columnAlign == c.ColumnAlign.JUSTIFY_USING_GAP ? (f = Math.max(1, this._columnCount - 1), this._horizontalGap = m / f) : this.columnAlign == c.ColumnAlign.JUSTIFY_USING_WIDTH && 0 < this._columnCount && (this._columnWidth += (m - (this._columnCount -
  14085. 1) * this._horizontalGap) / this._columnCount))
  14086. };
  14087. return a
  14088. }(c.LayoutBase);
  14089. c.TileLayout = e
  14090. })(egret || (egret = {}));
  14091. (function(c) {
  14092. var e = function() {
  14093. function c(a, b, d) {
  14094. this.raw_getElementAt = "raw_getElementAt";
  14095. this.raw_addElementAt = "raw_addElementAt";
  14096. this.raw_getElementIndex = "raw_getElementIndex";
  14097. this.raw_removeElement = "raw_removeElement";
  14098. this.raw_removeElementAt = "raw_removeElementAt";
  14099. this.raw_setElementIndex = "raw_setElementIndex";
  14100. this.owner = a;
  14101. this.lowerBoundReference = b;
  14102. this.upperBoundReference = d
  14103. }
  14104. Object.defineProperty(c.prototype, "numElements", {
  14105. get: function() {
  14106. return this.owner[this.upperBoundReference] - this.owner[this.lowerBoundReference]
  14107. },
  14108. enumerable: !0,
  14109. configurable: !0
  14110. });
  14111. c.prototype.getElementAt = function(a) {
  14112. return this.owner[this.raw_getElementAt](this.owner[this.lowerBoundReference] + a)
  14113. };
  14114. c.prototype.addElement = function(a) {
  14115. var b = this.owner[this.upperBoundReference];
  14116. a.parent === this.owner && b--;
  14117. this.owner[this.upperBoundReference]++;
  14118. this.owner[this.raw_addElementAt](a, b);
  14119. a.ownerChanged(this);
  14120. return a
  14121. };
  14122. c.prototype.addElementAt = function(a, b) {
  14123. this.owner[this.upperBoundReference]++;
  14124. this.owner[this.raw_addElementAt](a, this.owner[this.lowerBoundReference] +
  14125. b);
  14126. a.ownerChanged(this);
  14127. return a
  14128. };
  14129. c.prototype.removeElement = function(a) {
  14130. var b = this.owner[this.raw_getElementIndex](a);
  14131. this.owner[this.lowerBoundReference] <= b && b < this.owner[this.upperBoundReference] && (this.owner[this.raw_removeElement](a), this.owner[this.upperBoundReference]--);
  14132. a.ownerChanged(null);
  14133. return a
  14134. };
  14135. c.prototype.removeElementAt = function(a) {
  14136. a += this.owner[this.lowerBoundReference];
  14137. var b;
  14138. this.owner[this.lowerBoundReference] <= a && a < this.owner[this.upperBoundReference] && (b = this.owner[this.raw_removeElementAt](a),
  14139. this.owner[this.upperBoundReference]--);
  14140. b.ownerChanged(null);
  14141. return b
  14142. };
  14143. c.prototype.getElementIndex = function(a) {
  14144. a = this.owner[this.raw_getElementIndex](a);
  14145. return a -= this.owner[this.lowerBoundReference]
  14146. };
  14147. c.prototype.setElementIndex = function(a, b) {
  14148. this.owner[this.raw_setElementIndex](a, this.owner[this.lowerBoundReference] + b)
  14149. };
  14150. return c
  14151. }();
  14152. c.UILayer = e
  14153. })(egret || (egret = {}));
  14154. __extends = this.__extends || function(c, e) {
  14155. function d() {
  14156. this.constructor = c
  14157. }
  14158. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  14159. d.prototype = e.prototype;
  14160. c.prototype = new d
  14161. };
  14162. (function(c) {
  14163. var e = function(d) {
  14164. function a() {
  14165. d.call(this);
  14166. this._autoResize = !0;
  14167. this._cursorIndex = this._toolTipIndex = this._topMostIndex = this._noTopMostIndex = 0;
  14168. this.addEventListener(c.Event.ADDED_TO_STAGE, this.onAddToStage, this);
  14169. this.addEventListener(c.Event.REMOVED_FROM_STAGE, this.onRemoveFromStage, this)
  14170. }
  14171. __extends(a, d);
  14172. a.prototype.onAddToStage = function(a) {
  14173. if (c.UIGlobals._uiStage) throw Error("UIStage\u662fGUI\u6839\u5bb9\u5668\uff0c\u53ea\u80fd\u6709\u4e00\u4e2a\u6b64\u5b9e\u4f8b\u5728\u663e\u793a\u5217\u8868\u4e2d\uff01");
  14174. c.UIGlobals._uiStage = this;
  14175. this._autoResize && (this.stage.addEventListener(c.Event.RESIZE, this.onResize, this), this.onResize())
  14176. };
  14177. a.prototype.onRemoveFromStage = function(a) {
  14178. c.UIGlobals._uiStage = null;
  14179. this._autoResize && this.stage.removeEventListener(c.Event.RESIZE, this.onResize, this)
  14180. };
  14181. a.prototype.onResize = function(a) {
  14182. this._setWidth(this.stage.stageWidth);
  14183. this._setHeight(this.stage.stageHeight)
  14184. };
  14185. Object.defineProperty(a.prototype, "autoResize", {
  14186. get: function() {
  14187. return this._autoResize
  14188. },
  14189. set: function(a) {
  14190. this._autoResize !=
  14191. a && (this._autoResize = a, this.stage && (this._autoResize ? (this.stage.addEventListener(c.Event.RESIZE, this.onResize, this), this.onResize()) : this.stage.removeEventListener(c.Event.RESIZE, this.onResize, this)))
  14192. },
  14193. enumerable: !0,
  14194. configurable: !0
  14195. });
  14196. Object.defineProperty(a.prototype, "x", {
  14197. get: function() {
  14198. return this._x
  14199. },
  14200. set: function(a) {
  14201. this._autoResize || (this._x = a)
  14202. },
  14203. enumerable: !0,
  14204. configurable: !0
  14205. });
  14206. Object.defineProperty(a.prototype, "y", {
  14207. get: function() {
  14208. return this._y
  14209. },
  14210. set: function(a) {
  14211. this._autoResize || (this._y = a)
  14212. },
  14213. enumerable: !0,
  14214. configurable: !0
  14215. });
  14216. Object.defineProperty(a.prototype, "width", {
  14217. get: function() {
  14218. return this._width
  14219. },
  14220. set: function(a) {
  14221. this._autoResize || this._setWidth(a)
  14222. },
  14223. enumerable: !0,
  14224. configurable: !0
  14225. });
  14226. Object.defineProperty(a.prototype, "height", {
  14227. get: function() {
  14228. return this._height
  14229. },
  14230. set: function(a) {
  14231. this._autoResize || this._setHeight(a)
  14232. },
  14233. enumerable: !0,
  14234. configurable: !0
  14235. });
  14236. Object.defineProperty(a.prototype, "scaleX", {
  14237. get: function() {
  14238. return this._scaleX
  14239. },
  14240. set: function(a) {
  14241. this._autoResize || this._setScaleX(a)
  14242. },
  14243. enumerable: !0,
  14244. configurable: !0
  14245. });
  14246. Object.defineProperty(a.prototype, "scaleY", {
  14247. get: function() {
  14248. return this._scaleY
  14249. },
  14250. set: function(a) {
  14251. this._autoResize || this._setScaleY(a)
  14252. },
  14253. enumerable: !0,
  14254. configurable: !0
  14255. });
  14256. a.prototype.setActualSize = function(a, c) {
  14257. this._autoResize || d.prototype.setActualSize.call(this, a, c)
  14258. };
  14259. a.prototype.setLayoutBoundsPosition = function(a, c) {
  14260. this._autoResize || d.prototype.setLayoutBoundsPosition.call(this, a, c)
  14261. };
  14262. a.prototype.setLayoutBoundsSize = function(a, c) {
  14263. this._autoResize || d.prototype.setLayoutBoundsSize.call(this,
  14264. a, c)
  14265. };
  14266. Object.defineProperty(a.prototype, "layout", {
  14267. get: function() {
  14268. return this._layout
  14269. },
  14270. set: function(a) {
  14271. a instanceof c.BasicLayout && this._setLayout(a)
  14272. },
  14273. enumerable: !0,
  14274. configurable: !0
  14275. });
  14276. Object.defineProperty(a.prototype, "popUpContainer", {
  14277. get: function() {
  14278. this._popUpContainer || (this._popUpContainer = new c.UILayer(this, "noTopMostIndex", "topMostIndex"));
  14279. return this._popUpContainer
  14280. },
  14281. enumerable: !0,
  14282. configurable: !0
  14283. });
  14284. Object.defineProperty(a.prototype, "toolTipContainer", {
  14285. get: function() {
  14286. this._toolTipContainer || (this._toolTipContainer =
  14287. new c.UILayer(this, "topMostIndex", "toolTipIndex"));
  14288. return this._toolTipContainer
  14289. },
  14290. enumerable: !0,
  14291. configurable: !0
  14292. });
  14293. Object.defineProperty(a.prototype, "cursorContainer", {
  14294. get: function() {
  14295. this._cursorContainer || (this._cursorContainer = new c.UILayer(this, "toolTipIndex", "cursorIndex"));
  14296. return this._cursorContainer
  14297. },
  14298. enumerable: !0,
  14299. configurable: !0
  14300. });
  14301. Object.defineProperty(a.prototype, "noTopMostIndex", {
  14302. get: function() {
  14303. return this._noTopMostIndex
  14304. },
  14305. set: function(a) {
  14306. var c = a - this._noTopMostIndex;
  14307. this._noTopMostIndex =
  14308. a;
  14309. this.topMostIndex += c
  14310. },
  14311. enumerable: !0,
  14312. configurable: !0
  14313. });
  14314. Object.defineProperty(a.prototype, "topMostIndex", {
  14315. get: function() {
  14316. return this._topMostIndex
  14317. },
  14318. set: function(a) {
  14319. var c = a - this._topMostIndex;
  14320. this._topMostIndex = a;
  14321. this.toolTipIndex += c
  14322. },
  14323. enumerable: !0,
  14324. configurable: !0
  14325. });
  14326. Object.defineProperty(a.prototype, "toolTipIndex", {
  14327. get: function() {
  14328. return this._toolTipIndex
  14329. },
  14330. set: function(a) {
  14331. var c = a - this._toolTipIndex;
  14332. this._toolTipIndex = a;
  14333. this.cursorIndex += c
  14334. },
  14335. enumerable: !0,
  14336. configurable: !0
  14337. });
  14338. Object.defineProperty(a.prototype,
  14339. "cursorIndex", {
  14340. get: function() {
  14341. return this._cursorIndex
  14342. },
  14343. set: function(a) {
  14344. this._cursorIndex = a
  14345. },
  14346. enumerable: !0,
  14347. configurable: !0
  14348. });
  14349. a.prototype.addElement = function(a) {
  14350. var c = this._noTopMostIndex;
  14351. a.parent == this && c--;
  14352. return this.addElementAt(a, c)
  14353. };
  14354. a.prototype.addElementAt = function(a, c) {
  14355. if (a.parent == this) {
  14356. var e = this.getElementIndex(a);
  14357. e < this._noTopMostIndex ? this.noTopMostIndex-- : e >= this._noTopMostIndex && e < this._topMostIndex ? this.topMostIndex-- : e >= this._topMostIndex && e < this._toolTipIndex ? this.toolTipIndex-- :
  14358. this.cursorIndex--
  14359. }
  14360. c <= this._noTopMostIndex ? this.noTopMostIndex++ : c > this._noTopMostIndex && c <= this._topMostIndex ? this.topMostIndex++ : c > this._topMostIndex && c <= this._toolTipIndex ? this.toolTipIndex++ : this.cursorIndex++;
  14361. return d.prototype.addElementAt.call(this, a, c)
  14362. };
  14363. a.prototype.removeElement = function(a) {
  14364. return this.removeElementAt(d.prototype.getElementIndex.call(this, a))
  14365. };
  14366. a.prototype.removeElementAt = function(a) {
  14367. var c = d.prototype.removeElementAt.call(this, a);
  14368. a < this._noTopMostIndex ? this.noTopMostIndex-- :
  14369. a >= this._noTopMostIndex && a < this._topMostIndex ? this.topMostIndex-- : a >= this._topMostIndex && a < this._toolTipIndex ? this.toolTipIndex-- : this.cursorIndex--;
  14370. return c
  14371. };
  14372. a.prototype.removeAllElements = function() {
  14373. for (; 0 < this._noTopMostIndex;) d.prototype.removeElementAt.call(this, 0), this.noTopMostIndex--
  14374. };
  14375. a.prototype._elementRemoved = function(a, e, l) {
  14376. "undefined" === typeof l && (l = !0);
  14377. l && c.Event.dispatchEvent(a, "removeFromUIStage");
  14378. d.prototype._elementRemoved.call(this, a, e, l)
  14379. };
  14380. a.prototype.raw_getElementAt = function(a) {
  14381. return d.prototype.getElementAt.call(this,
  14382. a)
  14383. };
  14384. a.prototype.raw_addElement = function(a) {
  14385. var c = this.numElements;
  14386. a.parent == this && c--;
  14387. return this.raw_addElementAt(a, c)
  14388. };
  14389. a.prototype.raw_addElementAt = function(a, c) {
  14390. if (a.parent == this) {
  14391. var e = this.getElementIndex(a);
  14392. e < this._noTopMostIndex ? this.noTopMostIndex-- : e >= this._noTopMostIndex && e < this._topMostIndex ? this.topMostIndex-- : e >= this._topMostIndex && e < this._toolTipIndex ? this.toolTipIndex-- : this.cursorIndex--
  14393. }
  14394. return d.prototype.addElementAt.call(this, a, c)
  14395. };
  14396. a.prototype.raw_removeElement = function(a) {
  14397. return d.prototype.removeElementAt.call(this,
  14398. d.prototype.getElementIndex.call(this, a))
  14399. };
  14400. a.prototype.raw_removeElementAt = function(a) {
  14401. return d.prototype.removeElementAt.call(this, a)
  14402. };
  14403. a.prototype.raw_removeAllElements = function() {
  14404. for (; 0 < this.numElements;) d.prototype.removeElementAt.call(this, 0)
  14405. };
  14406. a.prototype.raw_getElementIndex = function(a) {
  14407. return d.prototype.getElementIndex.call(this, a)
  14408. };
  14409. a.prototype.raw_setElementIndex = function(a, c) {
  14410. d.prototype.setElementIndex.call(this, a, c)
  14411. };
  14412. a.prototype.raw_swapElements = function(a, c) {
  14413. d.prototype.swapElementsAt.call(this,
  14414. d.prototype.getElementIndex.call(this, a), d.prototype.getElementIndex.call(this, c))
  14415. };
  14416. a.prototype.raw_swapElementsAt = function(a, c) {
  14417. d.prototype.swapElementsAt.call(this, a, c)
  14418. };
  14419. return a
  14420. }(c.Group);
  14421. c.UIStage = e
  14422. })(egret || (egret = {}));
  14423. __extends = this.__extends || function(c, e) {
  14424. function d() {
  14425. this.constructor = c
  14426. }
  14427. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  14428. d.prototype = e.prototype;
  14429. c.prototype = new d
  14430. };
  14431. (function(c) {
  14432. var e = function(a) {
  14433. function b() {
  14434. a.call(this);
  14435. this._popUpList = [];
  14436. this.popUpDataList = [];
  14437. this._modalColor = 0;
  14438. this._modalAlpha = 0.5;
  14439. this.invalidateModalFlag = !1
  14440. }
  14441. __extends(b, a);
  14442. Object.defineProperty(b.prototype, "popUpList", {
  14443. get: function() {
  14444. return this._popUpList.concat()
  14445. },
  14446. enumerable: !0,
  14447. configurable: !0
  14448. });
  14449. b.prototype.findPopUpData = function(a) {
  14450. for (var b = this.popUpDataList, c = b.length, d = 0; d < c; d++) {
  14451. var e = b[d];
  14452. if (e.popUp == a) return e
  14453. }
  14454. return null
  14455. };
  14456. b.prototype.addPopUp = function(a, e, m) {
  14457. "undefined" === typeof e &&
  14458. (e = !1);
  14459. "undefined" === typeof m && (m = !0);
  14460. var f = c.UIGlobals.uiStage,
  14461. g = this.findPopUpData(a);
  14462. g ? (g.modal = e, a.removeEventListener(b.REMOVE_FROM_UISTAGE, this.onRemoved, this)) : (g = new d(a, e), this.popUpDataList.push(g), this._popUpList.push(a));
  14463. f.popUpContainer.addElement(a);
  14464. m && this.centerPopUp(a);
  14465. "isPopUp" in a && (a.isPopUp = !0);
  14466. e && this.invalidateModal();
  14467. a.addEventListener(b.REMOVE_FROM_UISTAGE, this.onRemoved, this)
  14468. };
  14469. b.prototype.onRemoved = function(a) {
  14470. for (var c = 0, d = this.popUpDataList, e = d.length, g = 0; g < e; g++) {
  14471. var k =
  14472. d[g];
  14473. if (k.popUp == a.target) {
  14474. "isPopUp" in k.popUp && (k.popUp.isPopUp = !1);
  14475. k.popUp.removeEventListener(b.REMOVE_FROM_UISTAGE, this.onRemoved, this);
  14476. this.popUpDataList.splice(c, 1);
  14477. this._popUpList.splice(c, 1);
  14478. this.invalidateModal();
  14479. break
  14480. }
  14481. c++
  14482. }
  14483. };
  14484. Object.defineProperty(b.prototype, "modalColor", {
  14485. get: function() {
  14486. return this._modalColor
  14487. },
  14488. set: function(a) {
  14489. this._modalColor != a && (this._modalColor = a, this.invalidateModal())
  14490. },
  14491. enumerable: !0,
  14492. configurable: !0
  14493. });
  14494. Object.defineProperty(b.prototype, "modalAlpha", {
  14495. get: function() {
  14496. return this._modalAlpha
  14497. },
  14498. set: function(a) {
  14499. this._modalAlpha != a && (this._modalAlpha = a, this.invalidateModal())
  14500. },
  14501. enumerable: !0,
  14502. configurable: !0
  14503. });
  14504. b.prototype.invalidateModal = function() {
  14505. this.invalidateModalFlag || (this.invalidateModalFlag = !0, c.UIGlobals.stage.addEventListener(c.Event.ENTER_FRAME, this.validateModal, this), c.UIGlobals.stage.addEventListener(c.Event.RENDER, this.validateModal, this), c.UIGlobals.stage.invalidate())
  14506. };
  14507. b.prototype.validateModal = function(a) {
  14508. this.invalidateModalFlag = !1;
  14509. c.UIGlobals.stage.removeEventListener(c.Event.ENTER_FRAME,
  14510. this.validateModal, this);
  14511. c.UIGlobals.stage.removeEventListener(c.Event.RENDER, this.validateModal, this);
  14512. this.updateModal(c.UIGlobals.uiStage)
  14513. };
  14514. b.prototype.updateModal = function(a) {
  14515. for (var b = a.popUpContainer, d = !1, e = b.numElements - 1; 0 <= e; e--) {
  14516. var g = b.getElementAt(e);
  14517. if ((g = this.findPopUpData(g)) && g.modal) {
  14518. d = !0;
  14519. break
  14520. }
  14521. }
  14522. d ? (this.modalMask || (this.modalMask = new c.Rect, this.modalMask.touchEnabled = !0, this.modalMask.top = this.modalMask.left = this.modalMask.right = this.modalMask.bottom = 0), this.modalMask.fillColor = this._modalColor,
  14523. this.modalMask.alpha = this._modalAlpha, this.modalMask.parent == a ? (b.getElementIndex(this.modalMask) < e && e--, b.setElementIndex(this.modalMask, e)) : b.addElementAt(this.modalMask, e)) : this.modalMask && this.modalMask.parent == a && b.removeElement(this.modalMask)
  14524. };
  14525. b.prototype.removePopUp = function(a) {
  14526. a && a.parent && this.findPopUpData(a) && ("removeElement" in a.parent ? a.parent.removeElement(a) : a.parent instanceof c.UIComponent ? a.parent._removeFromDisplayList(a) : a instanceof c.DisplayObject && a.parent.removeChild(a))
  14527. };
  14528. b.prototype.centerPopUp = function(a) {
  14529. a.top = a.bottom = a.left = a.right = NaN;
  14530. a.verticalCenter = a.horizontalCenter = 0;
  14531. var b = a.parent;
  14532. b && ("validateNow" in a && a.validateNow(), a.x = 0.5 * (b.width - a.layoutBoundsWidth), a.y = 0.5 * (b.height - a.layoutBoundsHeight))
  14533. };
  14534. b.prototype.bringToFront = function(a) {
  14535. if (this.findPopUpData(a) && a.parent && "popUpContainer" in a.parent) {
  14536. var b = a.parent;
  14537. b.popUpContainer.setElementIndex(a, b.popUpContainer.numElements - 1);
  14538. this.invalidateModal()
  14539. }
  14540. };
  14541. b.REMOVE_FROM_UISTAGE = "removeFromUIStage";
  14542. return b
  14543. }(c.EventDispatcher);
  14544. c.PopUpManagerImpl = e;
  14545. var d = function() {
  14546. return function(a, b) {
  14547. this.popUp = a;
  14548. this.modal = b
  14549. }
  14550. }()
  14551. })(egret || (egret = {}));
  14552. (function(c) {
  14553. var e = function() {
  14554. function d() {}
  14555. d.getImpl = function() {
  14556. if (!d._impl) try {
  14557. d._impl = c.Injector.getInstance("egret.IPopUpManager")
  14558. } catch (a) {
  14559. d._impl = new c.PopUpManagerImpl
  14560. }
  14561. return d._impl
  14562. };
  14563. Object.defineProperty(d.prototype, "modalColor", {
  14564. get: function() {
  14565. return d.getImpl().modalColor
  14566. },
  14567. set: function(a) {
  14568. d.getImpl().modalColor = a
  14569. },
  14570. enumerable: !0,
  14571. configurable: !0
  14572. });
  14573. Object.defineProperty(d.prototype, "modalAlpha", {
  14574. get: function() {
  14575. return d.getImpl().modalAlpha
  14576. },
  14577. set: function(a) {
  14578. d.getImpl().modalAlpha = a
  14579. },
  14580. enumerable: !0,
  14581. configurable: !0
  14582. });
  14583. d.addPopUp = function(a, b, e) {
  14584. "undefined" === typeof b && (b = !1);
  14585. "undefined" === typeof e && (e = !0);
  14586. d.getImpl().addPopUp(a, b, e);
  14587. c.PopUpEvent.dispatchPopUpEvent(d.getImpl(), c.PopUpEvent.ADD_POPUP, a, b)
  14588. };
  14589. d.removePopUp = function(a) {
  14590. d.getImpl().removePopUp(a);
  14591. c.PopUpEvent.dispatchPopUpEvent(d.getImpl(), c.PopUpEvent.REMOVE_POPUP, a)
  14592. };
  14593. d.centerPopUp = function(a) {
  14594. d.getImpl().centerPopUp(a)
  14595. };
  14596. d.bringToFront = function(a) {
  14597. d.getImpl().bringToFront(a);
  14598. c.PopUpEvent.dispatchPopUpEvent(d.getImpl(), c.PopUpEvent.BRING_TO_FRONT,
  14599. a)
  14600. };
  14601. Object.defineProperty(d, "popUpList", {
  14602. get: function() {
  14603. return d.getImpl().popUpList
  14604. },
  14605. enumerable: !0,
  14606. configurable: !0
  14607. });
  14608. d.addEventListener = function(a, b, c, e, m) {
  14609. "undefined" === typeof e && (e = !1);
  14610. "undefined" === typeof m && (m = 0);
  14611. d.getImpl().addEventListener(a, b, this, e, m)
  14612. };
  14613. d.removeEventListener = function(a, b, c, e) {
  14614. "undefined" === typeof e && (e = !1);
  14615. d.getImpl().removeEventListener(a, b, c, e)
  14616. };
  14617. return d
  14618. }();
  14619. c.PopUpManager = e
  14620. })(egret || (egret = {}));
  14621. var __extends = this.__extends || function(c, e) {
  14622. function d() {
  14623. this.constructor = c
  14624. }
  14625. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  14626. d.prototype = e.prototype;
  14627. c.prototype = new d
  14628. },
  14629. dragonBones;
  14630. (function(c) {
  14631. (function(a) {
  14632. var b = function() {
  14633. function a(b, c) {
  14634. "undefined" === typeof b && (b = 0);
  14635. "undefined" === typeof c && (c = 0);
  14636. this.x = b;
  14637. this.y = c
  14638. }
  14639. a.prototype.toString = function() {
  14640. return "[Point (x=" + this.x + " y=" + this.y + ")]"
  14641. };
  14642. return a
  14643. }();
  14644. a.Point = b;
  14645. b = function() {
  14646. return function(a, b, c, d) {
  14647. "undefined" === typeof a && (a = 0);
  14648. "undefined" === typeof b && (b = 0);
  14649. "undefined" === typeof c && (c = 0);
  14650. "undefined" === typeof d && (d = 0);
  14651. this.x = a;
  14652. this.y = b;
  14653. this.width = c;
  14654. this.height = d
  14655. }
  14656. }();
  14657. a.Rectangle = b;
  14658. b = function() {
  14659. function a() {
  14660. this.a = 1;
  14661. this.c = this.b =
  14662. 0;
  14663. this.d = 1;
  14664. this.ty = this.tx = 0
  14665. }
  14666. a.prototype.invert = function() {
  14667. var a = this.a,
  14668. b = this.b,
  14669. c = this.c,
  14670. d = this.d,
  14671. e = this.tx,
  14672. h = a * d - b * c;
  14673. this.a = d / h;
  14674. this.b = -b / h;
  14675. this.c = -c / h;
  14676. this.d = a / h;
  14677. this.tx = (c * this.ty - d * e) / h;
  14678. this.ty = -(a * this.ty - b * e) / h
  14679. };
  14680. return a
  14681. }();
  14682. a.Matrix = b;
  14683. b = function() {
  14684. return function() {
  14685. this.redOffset = this.redMultiplier = this.greenOffset = this.greenMultiplier = this.blueOffset = this.blueMultiplier = this.alphaOffset = this.alphaMultiplier = 0
  14686. }
  14687. }();
  14688. a.ColorTransform = b
  14689. })(c.geom || (c.geom = {}));
  14690. var e = c.geom;
  14691. (function(a) {
  14692. var b = function() {
  14693. return function(a) {
  14694. this.type =
  14695. a
  14696. }
  14697. }();
  14698. a.Event = b;
  14699. var c = function(a) {
  14700. function b(c) {
  14701. a.call(this, c)
  14702. }
  14703. __extends(b, a);
  14704. b.FADE_IN = "fadeIn";
  14705. b.FADE_OUT = "fadeOut";
  14706. b.START = "start";
  14707. b.COMPLETE = "complete";
  14708. b.LOOP_COMPLETE = "loopComplete";
  14709. b.FADE_IN_COMPLETE = "fadeInComplete";
  14710. b.FADE_OUT_COMPLETE = "fadeOutComplete";
  14711. return b
  14712. }(b);
  14713. a.AnimationEvent = c;
  14714. c = function(a) {
  14715. function b(c) {
  14716. a.call(this, c)
  14717. }
  14718. __extends(b, a);
  14719. b.Z_ORDER_UPDATED = "zOrderUpdated";
  14720. return b
  14721. }(b);
  14722. a.ArmatureEvent = c;
  14723. c = function(a) {
  14724. function b(c) {
  14725. a.call(this, c)
  14726. }
  14727. __extends(b, a);
  14728. b.ANIMATION_FRAME_EVENT = "animationFrameEvent";
  14729. b.BONE_FRAME_EVENT = "boneFrameEvent";
  14730. return b
  14731. }(b);
  14732. a.FrameEvent = c;
  14733. b = function(a) {
  14734. function b(c) {
  14735. a.call(this, c)
  14736. }
  14737. __extends(b, a);
  14738. b.SOUND = "sound";
  14739. b.BONE_FRAME_EVENT = "boneFrameEvent";
  14740. return b
  14741. }(b);
  14742. a.SoundEvent = b;
  14743. b = function() {
  14744. function a() {}
  14745. a.prototype.hasEventListener = function(a) {
  14746. return this._listenersMap && this._listenersMap[a] ? !0 : !1
  14747. };
  14748. a.prototype.addEventListener = function(a, b) {
  14749. if (a && b) {
  14750. this._listenersMap || (this._listenersMap = {});
  14751. var c = this._listenersMap[a];
  14752. c && this.removeEventListener(a, b);
  14753. c ? c.push(b) : this._listenersMap[a] = [b]
  14754. }
  14755. };
  14756. a.prototype.removeEventListener = function(a, b) {
  14757. if (this._listenersMap && a && b) {
  14758. var c = this._listenersMap[a];
  14759. if (c)
  14760. for (var d = c.length, e = 0; e < d; e++) c[e] == b && (1 == d ? (c.length = 0, delete this._listenersMap[a]) : c.splice(e, 1))
  14761. }
  14762. };
  14763. a.prototype.removeAllEventListeners = function(a) {
  14764. a ? delete this._listenersMap[a] : this._listenersMap = null
  14765. };
  14766. a.prototype.dispatchEvent = function(a) {
  14767. if (a) {
  14768. var b = this._listenersMap[a.type];
  14769. if (b) {
  14770. a.target = this;
  14771. for (var c = b.concat(), b = b.length, d = 0; d < b; d++) c[d](a)
  14772. }
  14773. }
  14774. };
  14775. return a
  14776. }();
  14777. a.EventDispatcher =
  14778. b;
  14779. b = function(a) {
  14780. function b() {
  14781. a.call(this);
  14782. if (b._instance) throw Error("Singleton already constructed!");
  14783. }
  14784. __extends(b, a);
  14785. b.getInstance = function() {
  14786. b._instance || (b._instance = new b);
  14787. return b._instance
  14788. };
  14789. return b
  14790. }(b);
  14791. a.SoundEventManager = b
  14792. })(c.events || (c.events = {}));
  14793. var d = c.events;
  14794. (function(a) {
  14795. var c = function() {
  14796. function a() {
  14797. this.timeScale = 1;
  14798. this.time = 0.001 * (new Date).getTime();
  14799. this._animatableList = []
  14800. }
  14801. a.prototype.contains = function(a) {
  14802. return 0 <= this._animatableList.indexOf(a)
  14803. };
  14804. a.prototype.add = function(a) {
  14805. a &&
  14806. -1 == this._animatableList.indexOf(a) && this._animatableList.push(a)
  14807. };
  14808. a.prototype.remove = function(a) {
  14809. a = this._animatableList.indexOf(a);
  14810. 0 <= a && (this._animatableList[a] = null)
  14811. };
  14812. a.prototype.clear = function() {
  14813. this._animatableList.length = 0
  14814. };
  14815. a.prototype.advanceTime = function(a) {
  14816. if (0 > a) {
  14817. var b = 0.001 * (new Date).getTime();
  14818. a = b - this.time;
  14819. this.time = b
  14820. }
  14821. a *= this.timeScale;
  14822. b = this._animatableList.length;
  14823. if (0 != b) {
  14824. for (var c = 0, d = 0; d < b; d++) {
  14825. var e = this._animatableList[d];
  14826. e && (c != d && (this._animatableList[c] = e, this._animatableList[d] =
  14827. null), e.advanceTime(a), c++)
  14828. }
  14829. if (c != d) {
  14830. for (b = this._animatableList.length; d < b;) this._animatableList[c++] = this._animatableList[d++];
  14831. this._animatableList.length = c
  14832. }
  14833. }
  14834. };
  14835. a.clock = new a;
  14836. return a
  14837. }();
  14838. a.WorldClock = c;
  14839. var l = function() {
  14840. function a() {
  14841. this.transform = new b.DBTransform;
  14842. this.pivot = new e.Point;
  14843. this._durationTransform = new b.DBTransform;
  14844. this._durationPivot = new e.Point;
  14845. this._durationColor = new e.ColorTransform
  14846. }
  14847. a._borrowObject = function() {
  14848. return 0 == a._pool.length ? new a : a._pool.pop()
  14849. };
  14850. a._returnObject = function(b) {
  14851. 0 >
  14852. a._pool.indexOf(b) && (a._pool[a._pool.length] = b);
  14853. b.clear()
  14854. };
  14855. a._clear = function() {
  14856. for (var b = a._pool.length; b--;) a._pool[b].clear();
  14857. a._pool.length = 0
  14858. };
  14859. a.getEaseValue = function(b, c) {
  14860. if (1 < c) {
  14861. var d = 0.5 * (1 - Math.cos(b * Math.PI)) - b;
  14862. c -= 1
  14863. } else 0 < c ? d = Math.sin(b * a.HALF_PI) - b : 0 > c && (d = 1 - Math.cos(b * a.HALF_PI) - b, c *= -1);
  14864. return d * c + b
  14865. };
  14866. a.prototype.fadeIn = function(a, b, c) {
  14867. this._bone = a;
  14868. this._animationState = b;
  14869. this._timeline = c;
  14870. this._originTransform = this._timeline.originTransform;
  14871. this._originPivot = this._timeline.originPivot;
  14872. this._tweenColor =
  14873. this._tweenTransform = !1;
  14874. this._totalTime = this._animationState.totalTime;
  14875. this.transform.x = 0;
  14876. this.transform.y = 0;
  14877. this.transform.scaleX = 0;
  14878. this.transform.scaleY = 0;
  14879. this.transform.skewX = 0;
  14880. this.transform.skewY = 0;
  14881. this.pivot.x = 0;
  14882. this.pivot.y = 0;
  14883. this._durationTransform.x = 0;
  14884. this._durationTransform.y = 0;
  14885. this._durationTransform.scaleX = 0;
  14886. this._durationTransform.scaleY = 0;
  14887. this._durationTransform.skewX = 0;
  14888. this._durationTransform.skewY = 0;
  14889. this._durationPivot.x = 0;
  14890. this._durationPivot.y = 0;
  14891. this._currentFrame = null;
  14892. switch (this._timeline.getFrameList().length) {
  14893. case 0:
  14894. this._bone._arriveAtFrame(null,
  14895. this, this._animationState, !1);
  14896. this._updateState = 0;
  14897. break;
  14898. case 1:
  14899. this._updateState = -1;
  14900. break;
  14901. default:
  14902. this._updateState = 1
  14903. }
  14904. };
  14905. a.prototype.fadeOut = function() {
  14906. this.transform.skewX = h.TransformUtil.formatRadian(this.transform.skewX);
  14907. this.transform.skewY = h.TransformUtil.formatRadian(this.transform.skewY)
  14908. };
  14909. a.prototype.update = function(b) {
  14910. if (this._updateState)
  14911. if (0 < this._updateState) {
  14912. b = 0 == this._timeline.scale ? 1 : b / this._timeline.scale;
  14913. 1 == b && (b = 0.99999999);
  14914. b += this._timeline.offset;
  14915. var c = Math.floor(b);
  14916. b -= c;
  14917. for (var d =
  14918. this._totalTime * b, e = !1, l; !this._currentFrame || d > this._currentFramePosition + this._currentFrameDuration || d < this._currentFramePosition;) e && this._bone._arriveAtFrame(this._currentFrame, this, this._animationState, !0), e = !0, this._currentFrame ? (l = this._timeline.getFrameList().indexOf(this._currentFrame) + 1, l >= this._timeline.getFrameList().length && (l = 0), this._currentFrame = this._timeline.getFrameList()[l]) : (l = 0, this._currentFrame = this._timeline.getFrameList()[0]), this._currentFrameDuration = this._currentFrame.duration,
  14919. this._currentFramePosition = this._currentFrame.position;
  14920. e && (this.tweenActive = 0 <= this._currentFrame.displayIndex, l++, l >= this._timeline.getFrameList().length && (l = 0), e = this._timeline.getFrameList()[l], 0 == l && this._animationState.loop && this._animationState.loopCount >= Math.abs(this._animationState.loop) - 1 && 0.99999999 < ((this._currentFramePosition + this._currentFrameDuration) / this._totalTime + c - this._timeline.offset) * this._timeline.scale ? (this._updateState = 0, this._tweenEasing = NaN) : 0 > this._currentFrame.displayIndex ||
  14921. 0 > e.displayIndex || !this._animationState.tweenEnabled ? this._tweenEasing = NaN : isNaN(this._animationState.clip.tweenEasing) ? this._tweenEasing = this._currentFrame.tweenEasing : this._tweenEasing = this._animationState.clip.tweenEasing, isNaN(this._tweenEasing) ? this._tweenColor = this._tweenTransform = !1 : (this._durationTransform.x = e.transform.x - this._currentFrame.transform.x, this._durationTransform.y = e.transform.y - this._currentFrame.transform.y, this._durationTransform.skewX = e.transform.skewX - this._currentFrame.transform.skewX,
  14922. this._durationTransform.skewY = e.transform.skewY - this._currentFrame.transform.skewY, this._durationTransform.scaleX = e.transform.scaleX - this._currentFrame.transform.scaleX, this._durationTransform.scaleY = e.transform.scaleY - this._currentFrame.transform.scaleY, 0 == l && (this._durationTransform.skewX = h.TransformUtil.formatRadian(this._durationTransform.skewX), this._durationTransform.skewY = h.TransformUtil.formatRadian(this._durationTransform.skewY)), this._durationPivot.x = e.pivot.x - this._currentFrame.pivot.x,
  14923. this._durationPivot.y = e.pivot.y - this._currentFrame.pivot.y, this._tweenTransform = 0 != this._durationTransform.x || 0 != this._durationTransform.y || 0 != this._durationTransform.skewX || 0 != this._durationTransform.skewY || 0 != this._durationTransform.scaleX || 0 != this._durationTransform.scaleY || 0 != this._durationPivot.x || 0 != this._durationPivot.y ? !0 : !1, this._currentFrame.color && e.color ? (this._durationColor.alphaOffset = e.color.alphaOffset - this._currentFrame.color.alphaOffset, this._durationColor.redOffset = e.color.redOffset -
  14924. this._currentFrame.color.redOffset, this._durationColor.greenOffset = e.color.greenOffset - this._currentFrame.color.greenOffset, this._durationColor.blueOffset = e.color.blueOffset - this._currentFrame.color.blueOffset, this._durationColor.alphaMultiplier = e.color.alphaMultiplier - this._currentFrame.color.alphaMultiplier, this._durationColor.redMultiplier = e.color.redMultiplier - this._currentFrame.color.redMultiplier, this._durationColor.greenMultiplier = e.color.greenMultiplier - this._currentFrame.color.greenMultiplier,
  14925. this._durationColor.blueMultiplier = e.color.blueMultiplier - this._currentFrame.color.blueMultiplier, this._tweenColor = 0 != this._durationColor.alphaOffset || 0 != this._durationColor.redOffset || 0 != this._durationColor.greenOffset || 0 != this._durationColor.blueOffset || 0 != this._durationColor.alphaMultiplier || 0 != this._durationColor.redMultiplier || 0 != this._durationColor.greenMultiplier || 0 != this._durationColor.blueMultiplier ? !0 : !1) : this._currentFrame.color ? (this._tweenColor = !0, this._durationColor.alphaOffset = -this._currentFrame.color.alphaOffset,
  14926. this._durationColor.redOffset = -this._currentFrame.color.redOffset, this._durationColor.greenOffset = -this._currentFrame.color.greenOffset, this._durationColor.blueOffset = -this._currentFrame.color.blueOffset, this._durationColor.alphaMultiplier = 1 - this._currentFrame.color.alphaMultiplier, this._durationColor.redMultiplier = 1 - this._currentFrame.color.redMultiplier, this._durationColor.greenMultiplier = 1 - this._currentFrame.color.greenMultiplier, this._durationColor.blueMultiplier = 1 - this._currentFrame.color.blueMultiplier) :
  14927. e.color ? (this._tweenColor = !0, this._durationColor.alphaOffset = e.color.alphaOffset, this._durationColor.redOffset = e.color.redOffset, this._durationColor.greenOffset = e.color.greenOffset, this._durationColor.blueOffset = e.color.blueOffset, this._durationColor.alphaMultiplier = e.color.alphaMultiplier - 1, this._durationColor.redMultiplier = e.color.redMultiplier - 1, this._durationColor.greenMultiplier = e.color.greenMultiplier - 1, this._durationColor.blueMultiplier = e.color.blueMultiplier - 1) : this._tweenColor = !1), this._tweenTransform ||
  14928. (this._animationState.blend ? (this.transform.x = this._originTransform.x + this._currentFrame.transform.x, this.transform.y = this._originTransform.y + this._currentFrame.transform.y, this.transform.skewX = this._originTransform.skewX + this._currentFrame.transform.skewX, this.transform.skewY = this._originTransform.skewY + this._currentFrame.transform.skewY, this.transform.scaleX = this._originTransform.scaleX + this._currentFrame.transform.scaleX, this.transform.scaleY = this._originTransform.scaleY + this._currentFrame.transform.scaleY,
  14929. this.pivot.x = this._originPivot.x + this._currentFrame.pivot.x, this.pivot.y = this._originPivot.y + this._currentFrame.pivot.y) : (this.transform.x = this._currentFrame.transform.x, this.transform.y = this._currentFrame.transform.y, this.transform.skewX = this._currentFrame.transform.skewX, this.transform.skewY = this._currentFrame.transform.skewY, this.transform.scaleX = this._currentFrame.transform.scaleX, this.transform.scaleY = this._currentFrame.transform.scaleY, this.pivot.x = this._currentFrame.pivot.x, this.pivot.y = this._currentFrame.pivot.y)),
  14930. this._tweenColor || (this._currentFrame.color ? this._bone._updateColor(this._currentFrame.color.alphaOffset, this._currentFrame.color.redOffset, this._currentFrame.color.greenOffset, this._currentFrame.color.blueOffset, this._currentFrame.color.alphaMultiplier, this._currentFrame.color.redMultiplier, this._currentFrame.color.greenMultiplier, this._currentFrame.color.blueMultiplier, !0) : this._bone._isColorChanged && this._bone._updateColor(0, 0, 0, 0, 1, 1, 1, 1, !1)), this._bone._arriveAtFrame(this._currentFrame, this,
  14931. this._animationState, !1));
  14932. if (this._tweenTransform || this._tweenColor) b = (d - this._currentFramePosition) / this._currentFrameDuration, this._tweenEasing && (b = a.getEaseValue(b, this._tweenEasing));
  14933. this._tweenTransform && (c = this._currentFrame.transform, d = this._currentFrame.pivot, this._animationState.blend ? (this.transform.x = this._originTransform.x + c.x + this._durationTransform.x * b, this.transform.y = this._originTransform.y + c.y + this._durationTransform.y * b, this.transform.skewX = this._originTransform.skewX + c.skewX + this._durationTransform.skewX *
  14934. b, this.transform.skewY = this._originTransform.skewY + c.skewY + this._durationTransform.skewY * b, this.transform.scaleX = this._originTransform.scaleX + c.scaleX + this._durationTransform.scaleX * b, this.transform.scaleY = this._originTransform.scaleY + c.scaleY + this._durationTransform.scaleY * b, this.pivot.x = this._originPivot.x + d.x + this._durationPivot.x * b, this.pivot.y = this._originPivot.y + d.y + this._durationPivot.y * b) : (this.transform.x = c.x + this._durationTransform.x * b, this.transform.y = c.y + this._durationTransform.y * b, this.transform.skewX =
  14935. c.skewX + this._durationTransform.skewX * b, this.transform.skewY = c.skewY + this._durationTransform.skewY * b, this.transform.scaleX = c.scaleX + this._durationTransform.scaleX * b, this.transform.scaleY = c.scaleY + this._durationTransform.scaleY * b, this.pivot.x = d.x + this._durationPivot.x * b, this.pivot.y = d.y + this._durationPivot.y * b));
  14936. this._tweenColor && (this._currentFrame.color ? this._bone._updateColor(this._currentFrame.color.alphaOffset + this._durationColor.alphaOffset * b, this._currentFrame.color.redOffset + this._durationColor.redOffset *
  14937. b, this._currentFrame.color.greenOffset + this._durationColor.greenOffset * b, this._currentFrame.color.blueOffset + this._durationColor.blueOffset * b, this._currentFrame.color.alphaMultiplier + this._durationColor.alphaMultiplier * b, this._currentFrame.color.redMultiplier + this._durationColor.redMultiplier * b, this._currentFrame.color.greenMultiplier + this._durationColor.greenMultiplier * b, this._currentFrame.color.blueMultiplier + this._durationColor.blueMultiplier * b, !0) : this._bone._updateColor(this._durationColor.alphaOffset *
  14938. b, this._durationColor.redOffset * b, this._durationColor.greenOffset * b, this._durationColor.blueOffset * b, 1 + this._durationColor.alphaMultiplier * b, 1 + this._durationColor.redMultiplier * b, 1 + this._durationColor.greenMultiplier * b, 1 + this._durationColor.blueMultiplier * b, !0))
  14939. } else this._updateState = 0, this._animationState.blend ? (this.transform.copy(this._originTransform), this.pivot.x = this._originPivot.x, this.pivot.y = this._originPivot.y) : (this.transform.x = this.transform.y = this.transform.skewX = this.transform.skewY =
  14940. this.transform.scaleX = this.transform.scaleY = 0, this.pivot.x = 0, this.pivot.y = 0), this._currentFrame = this._timeline.getFrameList()[0], this.tweenActive = 0 <= this._currentFrame.displayIndex, this._currentFrame.color ? this._bone._updateColor(this._currentFrame.color.alphaOffset, this._currentFrame.color.redOffset, this._currentFrame.color.greenOffset, this._currentFrame.color.blueOffset, this._currentFrame.color.alphaMultiplier, this._currentFrame.color.redMultiplier, this._currentFrame.color.greenMultiplier, this._currentFrame.color.blueMultiplier, !0) : this._bone._updateColor(0, 0, 0, 0, 1, 1, 1, 1, !1), this._bone._arriveAtFrame(this._currentFrame, this, this._animationState, !1)
  14941. };
  14942. a.prototype.clear = function() {
  14943. this._updateState = 0;
  14944. this._originPivot = this._originTransform = this._currentFrame = this._timeline = this._animationState = this._bone = null
  14945. };
  14946. a.HALF_PI = 0.5 * Math.PI;
  14947. a._pool = [];
  14948. return a
  14949. }();
  14950. a.TimelineState = l;
  14951. var f = function() {
  14952. function a() {
  14953. this.layer = this.loop = 0;
  14954. this._timelineStates = {}
  14955. }
  14956. a._borrowObject = function() {
  14957. return 0 == a._pool.length ? new a : a._pool.pop()
  14958. };
  14959. a._returnObject =
  14960. function(b) {
  14961. 0 > a._pool.indexOf(b) && (a._pool[a._pool.length] = b);
  14962. b.clear()
  14963. };
  14964. a._clear = function() {
  14965. for (var b = a._pool.length; b--;) a._pool[b].clear();
  14966. a._pool.length = 0
  14967. };
  14968. a.prototype.fadeIn = function(a, b, c, d, e, h, l, f) {
  14969. this.layer = h;
  14970. this.clip = b;
  14971. this.name = this.clip.name;
  14972. this.totalTime = this.clip.duration;
  14973. this._armature = a;
  14974. 2 > Math.round(this.clip.duration * this.clip.frameRate) || Infinity == d ? (this.timeScale = 1, this.currentTime = this.totalTime, this.loop = 0 <= this.loop ? 1 : -1) : (this.timeScale = d, this.currentTime = 0, this.loop = e);
  14975. this._pauseBeforeFadeInComplete = f;
  14976. this._fadeInTime = c * this.timeScale;
  14977. this._fadeState = 1;
  14978. this._fadeOutBeginTime = 0;
  14979. this._fadeOutWeight = -1;
  14980. this._fadeWeight = 0;
  14981. this._fadeIn = !0;
  14982. this._fadeOut = !1;
  14983. this.loopCount = -1;
  14984. this.displayControl = l;
  14985. this.isPlaying = !0;
  14986. this.isComplete = !1;
  14987. this.weight = 1;
  14988. this.tweenEnabled = this.enabled = this.blend = !0;
  14989. this.updateTimelineStates()
  14990. };
  14991. a.prototype.fadeOut = function(a, b) {
  14992. "undefined" === typeof b && (b = !1);
  14993. if (this._armature && !(0 <= this._fadeOutWeight)) {
  14994. this._fadeState = -1;
  14995. this._fadeOutWeight =
  14996. this._fadeWeight;
  14997. this._fadeOutTime = a * this.timeScale;
  14998. this._fadeOutBeginTime = this.currentTime;
  14999. this._fadeOut = !0;
  15000. this.isPlaying = !b;
  15001. this.displayControl = !1;
  15002. for (var c in this._timelineStates) this._timelineStates[c].fadeOut();
  15003. this.enabled = !0
  15004. }
  15005. };
  15006. a.prototype.play = function() {
  15007. this.isPlaying = !0
  15008. };
  15009. a.prototype.stop = function() {
  15010. this.isPlaying = !1
  15011. };
  15012. a.prototype.getMixingTransform = function(a) {
  15013. return this._mixingTransforms ? Number(this._mixingTransforms[a]) : -1
  15014. };
  15015. a.prototype.addMixingTransform = function(a, b, c) {
  15016. "undefined" ===
  15017. typeof b && (b = 2);
  15018. "undefined" === typeof c && (c = !0);
  15019. if (this.clip && this.clip.getTimeline(a)) {
  15020. this._mixingTransforms || (this._mixingTransforms = {});
  15021. if (c) {
  15022. c = this._armature._boneList.length;
  15023. for (var d, e; c--;) d = this._armature._boneList[c], d.name == a && (e = d), e && (e == d || e.contains(d)) && (this._mixingTransforms[d.name] = b)
  15024. } else this._mixingTransforms[a] = b;
  15025. this.updateTimelineStates()
  15026. } else throw Error();
  15027. };
  15028. a.prototype.removeMixingTransform = function(a, b) {
  15029. "undefined" === typeof a && (a = null);
  15030. "undefined" === typeof b && (b = !0);
  15031. if (a) {
  15032. if (b)
  15033. for (var c =
  15034. this._armature._boneList.length, d, e; c--;) d = this._armature._boneList[c], d.name == a && (e = d), e && (e == d || e.contains(d)) && delete this._mixingTransforms[d.name];
  15035. else delete this._mixingTransforms[a];
  15036. for (var h in this._mixingTransforms) {
  15037. var l = !0;
  15038. break
  15039. }
  15040. l || (this._mixingTransforms = null)
  15041. } else this._mixingTransforms = null;
  15042. this.updateTimelineStates()
  15043. };
  15044. a.prototype.advanceTime = function(a) {
  15045. if (!this.enabled) return !1;
  15046. var b, c;
  15047. this._fadeIn && (this._fadeIn = !1, this._armature.hasEventListener(d.AnimationEvent.FADE_IN) && (b = new d.AnimationEvent(d.AnimationEvent.FADE_IN),
  15048. b.animationState = this, this._armature._eventList.push(b)));
  15049. this._fadeOut && (this._fadeOut = !1, this._armature.hasEventListener(d.AnimationEvent.FADE_OUT) && (b = new d.AnimationEvent(d.AnimationEvent.FADE_OUT), b.animationState = this, this._armature._eventList.push(b)));
  15050. this.currentTime += a * this.timeScale;
  15051. if (this.isPlaying && !this.isComplete) {
  15052. var e;
  15053. if (this._pauseBeforeFadeInComplete) this.isPlaying = this._pauseBeforeFadeInComplete = !1, a = 0, e = Math.floor(a);
  15054. else if (a = this.currentTime / this.totalTime, e = Math.floor(a),
  15055. e != this.loopCount && (-1 == this.loopCount && this._armature.hasEventListener(d.AnimationEvent.START) && (b = new d.AnimationEvent(d.AnimationEvent.START), b.animationState = this, this._armature._eventList.push(b)), this.loopCount = e)) this.loop && this.loopCount * this.loopCount >= this.loop * this.loop - 1 ? (c = !0, a = 1, e = 0, this._armature.hasEventListener(d.AnimationEvent.COMPLETE) && (b = new d.AnimationEvent(d.AnimationEvent.COMPLETE), b.animationState = this, this._armature._eventList.push(b))) : this._armature.hasEventListener(d.AnimationEvent.LOOP_COMPLETE) &&
  15056. (b = new d.AnimationEvent(d.AnimationEvent.LOOP_COMPLETE), b.animationState = this, this._armature._eventList.push(b));
  15057. for (var h in this._timelineStates) this._timelineStates[h].update(a);
  15058. b = this.clip.getFrameList();
  15059. if (0 < b.length) {
  15060. a = this.totalTime * (a - e);
  15061. for (e = !1; !this._currentFrame || a > this._currentFrame.position + this._currentFrame.duration || a < this._currentFrame.position;) e && this._armature._arriveAtFrame(this._currentFrame, null, this, !0), e = !0, this._currentFrame ? (h = b.indexOf(this._currentFrame), h++, h >= b.length &&
  15062. (h = 0), this._currentFrame = b[h]) : this._currentFrame = b[0];
  15063. e && this._armature._arriveAtFrame(this._currentFrame, null, this, !1)
  15064. }
  15065. }
  15066. if (0 < this._fadeState) 0 == this._fadeInTime ? (this._fadeWeight = 1, this._fadeState = 0, this.isPlaying = !0, this._armature.hasEventListener(d.AnimationEvent.FADE_IN_COMPLETE) && (b = new d.AnimationEvent(d.AnimationEvent.FADE_IN_COMPLETE), b.animationState = this, this._armature._eventList.push(b))) : (this._fadeWeight = this.currentTime / this._fadeInTime, 1 <= this._fadeWeight && (this._fadeWeight = 1, this._fadeState =
  15067. 0, this.isPlaying || (this.currentTime -= this._fadeInTime), this.isPlaying = !0, this._armature.hasEventListener(d.AnimationEvent.FADE_IN_COMPLETE) && (b = new d.AnimationEvent(d.AnimationEvent.FADE_IN_COMPLETE), b.animationState = this, this._armature._eventList.push(b))));
  15068. else if (0 > this._fadeState) {
  15069. if (0 == this._fadeOutTime) return this._fadeState = this._fadeWeight = 0, this._armature.hasEventListener(d.AnimationEvent.FADE_OUT_COMPLETE) && (b = new d.AnimationEvent(d.AnimationEvent.FADE_OUT_COMPLETE), b.animationState = this,
  15070. this._armature._eventList.push(b)), !0;
  15071. this._fadeWeight = (1 - (this.currentTime - this._fadeOutBeginTime) / this._fadeOutTime) * this._fadeOutWeight;
  15072. if (0 >= this._fadeWeight) return this._fadeState = this._fadeWeight = 0, this._armature.hasEventListener(d.AnimationEvent.FADE_OUT_COMPLETE) && (b = new d.AnimationEvent(d.AnimationEvent.FADE_OUT_COMPLETE), b.animationState = this, this._armature._eventList.push(b)), !0
  15073. }
  15074. c && (this.isComplete = !0, 0 > this.loop && this.fadeOut((this._fadeOutWeight || this._fadeInTime) / this.timeScale, !0));
  15075. return !1
  15076. };
  15077. a.prototype.updateTimelineStates = function() {
  15078. if (this._mixingTransforms) {
  15079. for (var a in this._timelineStates) null == this._mixingTransforms[a] && this.removeTimelineState(a);
  15080. for (a in this._mixingTransforms) this._timelineStates[a] || this.addTimelineState(a)
  15081. } else
  15082. for (a in this.clip.getTimelines()) this._timelineStates[a] || this.addTimelineState(a)
  15083. };
  15084. a.prototype.addTimelineState = function(a) {
  15085. var b = this._armature.getBone(a);
  15086. if (b) {
  15087. var c = l._borrowObject(),
  15088. d = this.clip.getTimeline(a);
  15089. c.fadeIn(b, this, d);
  15090. this._timelineStates[a] =
  15091. c
  15092. }
  15093. };
  15094. a.prototype.removeTimelineState = function(a) {
  15095. l._returnObject(this._timelineStates[a]);
  15096. delete this._timelineStates[a]
  15097. };
  15098. a.prototype.clear = function() {
  15099. this.clip = null;
  15100. this.enabled = !1;
  15101. this._mixingTransforms = this._currentFrame = this._armature = null;
  15102. for (var a in this._timelineStates) this.removeTimelineState(a)
  15103. };
  15104. a._pool = [];
  15105. return a
  15106. }();
  15107. a.AnimationState = f;
  15108. c = function() {
  15109. function a(b) {
  15110. this._armature = b;
  15111. this._animationLayer = [];
  15112. this._isPlaying = !1;
  15113. this.animationNameList = [];
  15114. this.tweenEnabled = !0;
  15115. this.timeScale = 1
  15116. }
  15117. a.prototype.getLastAnimationName =
  15118. function() {
  15119. return this._lastAnimationState ? this._lastAnimationState.name : null
  15120. };
  15121. a.prototype.getLastAnimationState = function() {
  15122. return this._lastAnimationState
  15123. };
  15124. a.prototype.getAnimationDataList = function() {
  15125. return this._animationDataList
  15126. };
  15127. a.prototype.setAnimationDataList = function(a) {
  15128. this._animationDataList = a;
  15129. this.animationNameList.length = 0;
  15130. for (var b in this._animationDataList) this.animationNameList[this.animationNameList.length] = this._animationDataList[b].name
  15131. };
  15132. a.prototype.getIsPlaying = function() {
  15133. return this._isPlaying &&
  15134. !this.getIsComplete()
  15135. };
  15136. a.prototype.getIsComplete = function() {
  15137. if (this._lastAnimationState) {
  15138. if (!this._lastAnimationState.isComplete) return !1;
  15139. for (var a = this._animationLayer.length; a--;)
  15140. for (var b = this._animationLayer[a], c = b.length; c--;)
  15141. if (!b[c].isComplete) return !1;
  15142. return !0
  15143. }
  15144. return !1
  15145. };
  15146. a.prototype.dispose = function() {
  15147. if (this._armature) {
  15148. this.stop();
  15149. for (var a = this._animationLayer.length; a--;) {
  15150. for (var b = this._animationLayer[a], c = b.length; c--;) f._returnObject(b[c]);
  15151. b.length = 0
  15152. }
  15153. this._animationLayer.length = 0;
  15154. this.animationNameList.length =
  15155. 0;
  15156. this.animationNameList = this._animationDataList = this._animationLayer = this._armature = null
  15157. }
  15158. };
  15159. a.prototype.gotoAndPlay = function(b, c, d, e, h, l, m, k, g, p) {
  15160. "undefined" === typeof c && (c = -1);
  15161. "undefined" === typeof d && (d = -1);
  15162. "undefined" === typeof e && (e = NaN);
  15163. "undefined" === typeof h && (h = 0);
  15164. "undefined" === typeof l && (l = null);
  15165. "undefined" === typeof m && (m = a.SAME_LAYER_AND_GROUP);
  15166. "undefined" === typeof k && (k = !0);
  15167. "undefined" === typeof g && (g = !0);
  15168. "undefined" === typeof p && (p = !0);
  15169. if (!this._animationDataList) return null;
  15170. for (var n = this._animationDataList.length,
  15171. x; n--;)
  15172. if (this._animationDataList[n].name == b) {
  15173. x = this._animationDataList[n];
  15174. break
  15175. }
  15176. if (!x) return null;
  15177. this._isPlaying = !0;
  15178. c = 0 > c ? 0 > x.fadeInTime ? 0.3 : x.fadeInTime : c;
  15179. d = 0 > d ? 0 > x.scale ? 1 : x.scale : d / x.duration;
  15180. e = isNaN(e) ? x.loop : e;
  15181. h = this.addLayer(h);
  15182. var y;
  15183. switch (m) {
  15184. case a.NONE:
  15185. break;
  15186. case a.SAME_LAYER:
  15187. y = this._animationLayer[h];
  15188. for (n = y.length; n--;) m = y[n], m.fadeOut(c, g);
  15189. break;
  15190. case a.SAME_GROUP:
  15191. for (H = this._animationLayer.length; H--;)
  15192. for (y = this._animationLayer[H], n = y.length; n--;) m = y[n], m.group == l && m.fadeOut(c, g);
  15193. break;
  15194. case a.ALL:
  15195. for (var H = this._animationLayer.length; H--;)
  15196. for (y = this._animationLayer[H], n = y.length; n--;) m = y[n], m.fadeOut(c, g);
  15197. break;
  15198. default:
  15199. for (y = this._animationLayer[h], n = y.length; n--;) m = y[n], m.group == l && m.fadeOut(c, g)
  15200. }
  15201. this._lastAnimationState = f._borrowObject();
  15202. this._lastAnimationState.group = l;
  15203. this._lastAnimationState.tweenEnabled = this.tweenEnabled;
  15204. this._lastAnimationState.fadeIn(this._armature, x, c, 1 / d, e, h, k, p);
  15205. this.addState(this._lastAnimationState);
  15206. e = this._armature._slotList;
  15207. for (n = e.length; n--;) h =
  15208. e[n], (h = h.getChildArmature()) && h.animation.gotoAndPlay(b, c);
  15209. return this._lastAnimationState
  15210. };
  15211. a.prototype.play = function() {
  15212. this._animationDataList && 0 != this._animationDataList.length && (this._lastAnimationState ? this._isPlaying ? this.gotoAndPlay(this._lastAnimationState.name) : this._isPlaying = !0 : this.gotoAndPlay(this._animationDataList[0].name))
  15213. };
  15214. a.prototype.stop = function() {
  15215. this._isPlaying = !1
  15216. };
  15217. a.prototype.getState = function(a, b) {
  15218. "undefined" === typeof b && (b = 0);
  15219. var c = this._animationLayer.length;
  15220. if (0 == c) return null;
  15221. b >= c && (b = c - 1);
  15222. c = this._animationLayer[b];
  15223. if (!c) return null;
  15224. for (var d = c.length; d--;)
  15225. if (c[d].name == a) return c[d];
  15226. return null
  15227. };
  15228. a.prototype.hasAnimation = function(a) {
  15229. for (var b = this._animationDataList.length; b--;)
  15230. if (this._animationDataList[b].name == a) return !0;
  15231. return !1
  15232. };
  15233. a.prototype.advanceTime = function(a) {
  15234. if (this._isPlaying) {
  15235. a *= this.timeScale;
  15236. var b = this._armature._boneList.length,
  15237. c, d, e = b,
  15238. h, l, f, m, k, g, p, q, n, r, G, M, J, N, F, K, I;
  15239. for (b--; e--;) {
  15240. l = this._armature._boneList[e];
  15241. f = l.name;
  15242. m = 1;
  15243. M = G = r = n = q = p = g = k = 0;
  15244. for (c = this._animationLayer.length; c--;) {
  15245. J =
  15246. 0;
  15247. N = this._animationLayer[c];
  15248. h = N.length;
  15249. for (d = 0; d < h; d++) F = N[d], e == b && F.advanceTime(a) ? (this.removeState(F), d--, h--) : (K = F._timelineStates[f]) && K.tweenActive && (F = F._fadeWeight * F.weight * m, I = K.transform, K = K.pivot, k += I.x * F, g += I.y * F, p += I.skewX * F, q += I.skewY * F, n += I.scaleX * F, r += I.scaleY * F, G += K.x * F, M += K.y * F, J += F);
  15250. if (J >= m) break;
  15251. else m -= J
  15252. }
  15253. I = l.tween;
  15254. K = l._tweenPivot;
  15255. I.x = k;
  15256. I.y = g;
  15257. I.skewX = p;
  15258. I.skewY = q;
  15259. I.scaleX = n;
  15260. I.scaleY = r;
  15261. K.x = G;
  15262. K.y = M
  15263. }
  15264. }
  15265. };
  15266. a.prototype.addLayer = function(a) {
  15267. a >= this._animationLayer.length && (a = this._animationLayer.length,
  15268. this._animationLayer[a] = []);
  15269. return a
  15270. };
  15271. a.prototype.addState = function(a) {
  15272. this._animationLayer[a.layer].push(a)
  15273. };
  15274. a.prototype.removeState = function(a) {
  15275. var b = a.layer,
  15276. c = this._animationLayer[b];
  15277. c.splice(c.indexOf(a), 1);
  15278. f._returnObject(a);
  15279. 0 == c.length && b == this._animationLayer.length - 1 && this._animationLayer.length--
  15280. };
  15281. a.NONE = "none";
  15282. a.SAME_LAYER = "sameLayer";
  15283. a.SAME_GROUP = "sameGroup";
  15284. a.SAME_LAYER_AND_GROUP = "sameLayerAndGroup";
  15285. a.ALL = "all";
  15286. return a
  15287. }();
  15288. a.Animation = c
  15289. })(c.animation || (c.animation = {}));
  15290. var a = c.animation;
  15291. (function(a) {
  15292. var b = function() {
  15293. function a() {
  15294. this.skewY = this.skewX = this.y = this.x = 0;
  15295. this.scaleY = this.scaleX = 1
  15296. }
  15297. a.prototype.getRotation = function() {
  15298. return this.skewX
  15299. };
  15300. a.prototype.setRotation = function(a) {
  15301. this.skewX = this.skewY = a
  15302. };
  15303. a.prototype.copy = function(a) {
  15304. this.x = a.x;
  15305. this.y = a.y;
  15306. this.skewX = a.skewX;
  15307. this.skewY = a.skewY;
  15308. this.scaleX = a.scaleX;
  15309. this.scaleY = a.scaleY
  15310. };
  15311. a.prototype.toString = function() {
  15312. return "[DBTransform (x=" + this.x + " y=" + this.y + " skewX=" + this.skewX + " skewY=" + this.skewY + " scaleX=" + this.scaleX + " scaleY=" +
  15313. this.scaleY + ")]"
  15314. };
  15315. return a
  15316. }();
  15317. a.DBTransform = b;
  15318. var c = function() {
  15319. function a() {
  15320. this.duration = this.position = 0
  15321. }
  15322. a.prototype.dispose = function() {};
  15323. return a
  15324. }();
  15325. a.Frame = c;
  15326. var d = function(a) {
  15327. function c() {
  15328. a.call(this);
  15329. this.displayIndex = this.tweenRotate = this.tweenEasing = 0;
  15330. this.zOrder = NaN;
  15331. this.visible = !0;
  15332. this.global = new b;
  15333. this.transform = new b;
  15334. this.pivot = new e.Point
  15335. }
  15336. __extends(c, a);
  15337. c.prototype.dispose = function() {
  15338. a.prototype.dispose.call(this);
  15339. this.color = this.pivot = this.transform = this.global = null
  15340. };
  15341. return c
  15342. }(c);
  15343. a.TransformFrame =
  15344. d;
  15345. var l = function() {
  15346. function a() {
  15347. this._frameList = [];
  15348. this.duration = 0;
  15349. this.scale = 1
  15350. }
  15351. a.prototype.getFrameList = function() {
  15352. return this._frameList
  15353. };
  15354. a.prototype.dispose = function() {
  15355. for (var a = this._frameList.length; a--;) this._frameList[a].dispose();
  15356. this._frameList.length = 0;
  15357. this._frameList = null
  15358. };
  15359. a.prototype.addFrame = function(a) {
  15360. if (!a) throw Error();
  15361. if (0 > this._frameList.indexOf(a)) this._frameList[this._frameList.length] = a;
  15362. else throw Error();
  15363. };
  15364. return a
  15365. }();
  15366. a.Timeline = l;
  15367. var f = function(a) {
  15368. function c() {
  15369. a.call(this);
  15370. this.originTransform = new b;
  15371. this.originPivot = new e.Point;
  15372. this.offset = 0;
  15373. this.transformed = !1
  15374. }
  15375. __extends(c, a);
  15376. c.prototype.dispose = function() {
  15377. this != c.HIDE_TIMELINE && (a.prototype.dispose.call(this), this.originPivot = this.originTransform = null)
  15378. };
  15379. c.HIDE_TIMELINE = new c;
  15380. return c
  15381. }(l);
  15382. a.TransformTimeline = f;
  15383. var m = function(a) {
  15384. function b() {
  15385. a.call(this);
  15386. this.loop = this.frameRate = 0;
  15387. this.tweenEasing = NaN;
  15388. this.fadeInTime = 0;
  15389. this._timelines = {}
  15390. }
  15391. __extends(b, a);
  15392. b.prototype.getTimelines = function() {
  15393. return this._timelines
  15394. };
  15395. b.prototype.dispose =
  15396. function() {
  15397. a.prototype.dispose.call(this);
  15398. for (var b in this._timelines) this._timelines[b].dispose();
  15399. this._timelines = null
  15400. };
  15401. b.prototype.getTimeline = function(a) {
  15402. return this._timelines[a]
  15403. };
  15404. b.prototype.addTimeline = function(a, b) {
  15405. if (!a) throw Error();
  15406. this._timelines[b] = a
  15407. };
  15408. return b
  15409. }(l);
  15410. a.AnimationData = m;
  15411. var g = function() {
  15412. function a() {
  15413. this.transform = new b
  15414. }
  15415. a.prototype.dispose = function() {
  15416. this.pivot = this.transform = null
  15417. };
  15418. a.ARMATURE = "armature";
  15419. a.IMAGE = "image";
  15420. return a
  15421. }();
  15422. a.DisplayData = g;
  15423. var v = function() {
  15424. function a() {
  15425. this._displayDataList = [];
  15426. this.zOrder = 0;
  15427. this.blendMode = "normal"
  15428. }
  15429. a.prototype.getDisplayDataList = function() {
  15430. return this._displayDataList
  15431. };
  15432. a.prototype.dispose = function() {
  15433. for (var a = this._displayDataList.length; a--;) this._displayDataList[a].dispose();
  15434. this._displayDataList.length = 0;
  15435. this._displayDataList = null
  15436. };
  15437. a.prototype.addDisplayData = function(a) {
  15438. if (!a) throw Error();
  15439. if (0 > this._displayDataList.indexOf(a)) this._displayDataList[this._displayDataList.length] = a;
  15440. else throw Error();
  15441. };
  15442. a.prototype.getDisplayData = function(a) {
  15443. for (var b =
  15444. this._displayDataList.length; b--;)
  15445. if (this._displayDataList[b].name == a) return this._displayDataList[b];
  15446. return null
  15447. };
  15448. return a
  15449. }();
  15450. a.SlotData = v;
  15451. var B = function() {
  15452. function a() {
  15453. this.length = 0;
  15454. this.global = new b;
  15455. this.transform = new b;
  15456. this.scaleMode = 1;
  15457. this.fixedRotation = !1
  15458. }
  15459. a.prototype.dispose = function() {
  15460. this.transform = this.global = null
  15461. };
  15462. return a
  15463. }();
  15464. a.BoneData = B;
  15465. var C = function() {
  15466. function a() {
  15467. this._slotDataList = []
  15468. }
  15469. a.prototype.getSlotDataList = function() {
  15470. return this._slotDataList
  15471. };
  15472. a.prototype.dispose = function() {
  15473. for (var a =
  15474. this._slotDataList.length; a--;) this._slotDataList[a].dispose();
  15475. this._slotDataList.length = 0;
  15476. this._slotDataList = null
  15477. };
  15478. a.prototype.getSlotData = function(a) {
  15479. for (var b = this._slotDataList.length; b--;)
  15480. if (this._slotDataList[b].name == a) return this._slotDataList[b];
  15481. return null
  15482. };
  15483. a.prototype.addSlotData = function(a) {
  15484. if (!a) throw Error();
  15485. if (0 > this._slotDataList.indexOf(a)) this._slotDataList[this._slotDataList.length] = a;
  15486. else throw Error();
  15487. };
  15488. return a
  15489. }();
  15490. a.SkinData = C;
  15491. var t = function() {
  15492. function a() {
  15493. this._boneDataList = [];
  15494. this._skinDataList = [];
  15495. this._animationDataList = []
  15496. }
  15497. a.prototype.getBoneDataList = function() {
  15498. return this._boneDataList
  15499. };
  15500. a.prototype.getSkinDataList = function() {
  15501. return this._skinDataList
  15502. };
  15503. a.prototype.getAnimationDataList = function() {
  15504. return this._animationDataList
  15505. };
  15506. a.prototype.dispose = function() {
  15507. for (var a = this._boneDataList.length; a--;) this._boneDataList[a].dispose();
  15508. for (a = this._skinDataList.length; a--;) this._skinDataList[a].dispose();
  15509. for (a = this._animationDataList.length; a--;) this._animationDataList[a].dispose();
  15510. this._boneDataList.length = 0;
  15511. this._skinDataList.length = 0;
  15512. this._animationDataList.length = 0;
  15513. this._animationDataList = this._skinDataList = this._boneDataList = null
  15514. };
  15515. a.prototype.getBoneData = function(a) {
  15516. for (var b = this._boneDataList.length; b--;)
  15517. if (this._boneDataList[b].name == a) return this._boneDataList[b];
  15518. return null
  15519. };
  15520. a.prototype.getSkinData = function(a) {
  15521. if (!a) return this._skinDataList[0];
  15522. for (var b = this._skinDataList.length; b--;)
  15523. if (this._skinDataList[b].name == a) return this._skinDataList[b];
  15524. return null
  15525. };
  15526. a.prototype.getAnimationData =
  15527. function(a) {
  15528. for (var b = this._animationDataList.length; b--;)
  15529. if (this._animationDataList[b].name == a) return this._animationDataList[b];
  15530. return null
  15531. };
  15532. a.prototype.addBoneData = function(a) {
  15533. if (!a) throw Error();
  15534. if (0 > this._boneDataList.indexOf(a)) this._boneDataList[this._boneDataList.length] = a;
  15535. else throw Error();
  15536. };
  15537. a.prototype.addSkinData = function(a) {
  15538. if (!a) throw Error();
  15539. if (0 > this._skinDataList.indexOf(a)) this._skinDataList[this._skinDataList.length] = a;
  15540. else throw Error();
  15541. };
  15542. a.prototype.addAnimationData = function(a) {
  15543. if (!a) throw Error();
  15544. 0 > this._animationDataList.indexOf(a) && (this._animationDataList[this._animationDataList.length] = a)
  15545. };
  15546. a.prototype.sortBoneDataList = function() {
  15547. var a = this._boneDataList.length;
  15548. if (0 != a) {
  15549. for (var b = []; a--;) {
  15550. for (var c = this._boneDataList[a], d = 0, e = c; e && e.parent;) d++, e = this.getBoneData(e.parent);
  15551. b[a] = {
  15552. level: d,
  15553. boneData: c
  15554. }
  15555. }
  15556. b.sort(this.sortBoneData);
  15557. for (a = b.length; a--;) this._boneDataList[a] = b[a].boneData
  15558. }
  15559. };
  15560. a.prototype.sortBoneData = function(a, b) {
  15561. return a.level > b.level ? 1 : -1
  15562. };
  15563. return a
  15564. }();
  15565. a.ArmatureData = t;
  15566. var u = function() {
  15567. function a() {
  15568. this._armatureDataList = [];
  15569. this._subTexturePivots = {}
  15570. }
  15571. a.prototype.getArmatureNames = function() {
  15572. var a = [],
  15573. b;
  15574. for (b in this._armatureDataList) a[a.length] = this._armatureDataList[b].name;
  15575. return a
  15576. };
  15577. a.prototype.getArmatureDataList = function() {
  15578. return this._armatureDataList
  15579. };
  15580. a.prototype.dispose = function() {
  15581. for (var a in this._armatureDataList) this._armatureDataList[a].dispose();
  15582. this._armatureDataList.length = 0;
  15583. this._subTexturePivots = this._armatureDataList = null
  15584. };
  15585. a.prototype.getArmatureData = function(a) {
  15586. for (var b = this._armatureDataList.length; b--;)
  15587. if (this._armatureDataList[b].name ==
  15588. a) return this._armatureDataList[b];
  15589. return null
  15590. };
  15591. a.prototype.addArmatureData = function(a) {
  15592. if (!a) throw Error();
  15593. if (0 > this._armatureDataList.indexOf(a)) this._armatureDataList[this._armatureDataList.length] = a;
  15594. else throw Error();
  15595. };
  15596. a.prototype.removeArmatureData = function(a) {
  15597. a = this._armatureDataList.indexOf(a);
  15598. 0 <= a && this._armatureDataList.splice(a, 1)
  15599. };
  15600. a.prototype.removeArmatureDataByName = function(a) {
  15601. for (var b = this._armatureDataList.length; b--;) this._armatureDataList[b].name == a && this._armatureDataList.splice(b,
  15602. 1)
  15603. };
  15604. a.prototype.getSubTexturePivot = function(a) {
  15605. return this._subTexturePivots[a]
  15606. };
  15607. a.prototype.addSubTexturePivot = function(a, b, c) {
  15608. var d = this._subTexturePivots[c];
  15609. d ? (d.x = a, d.y = b) : this._subTexturePivots[c] = d = new e.Point(a, b);
  15610. return d
  15611. };
  15612. a.prototype.removeSubTexturePivot = function(a) {
  15613. if (a) delete this._subTexturePivots[a];
  15614. else
  15615. for (a in this._subTexturePivots) delete this._subTexturePivots[a]
  15616. };
  15617. return a
  15618. }();
  15619. a.SkeletonData = u;
  15620. l = function() {
  15621. function a() {}
  15622. a.parseTextureAtlasData = function(a, b) {
  15623. "undefined" === typeof b &&
  15624. (b = 1);
  15625. if (!a) throw Error();
  15626. var c = {};
  15627. c.__name = a[h.ConstValues.A_NAME];
  15628. var d = a[h.ConstValues.SUB_TEXTURE],
  15629. l;
  15630. for (l in d) {
  15631. var f = d[l],
  15632. m = f[h.ConstValues.A_NAME],
  15633. f = new e.Rectangle(Number(f[h.ConstValues.A_X]) / b, Number(f[h.ConstValues.A_Y]) / b, Number(f[h.ConstValues.A_WIDTH]) / b, Number(f[h.ConstValues.A_HEIGHT]) / b);
  15634. c[m] = f
  15635. }
  15636. return c
  15637. };
  15638. a.parseSkeletonData = function(b) {
  15639. if (!b) throw Error();
  15640. var c = Number(b[h.ConstValues.A_FRAME_RATE]),
  15641. d = new u;
  15642. d.name = b[h.ConstValues.A_NAME];
  15643. b = b[h.ConstValues.ARMATURE];
  15644. for (var e in b) d.addArmatureData(a.parseArmatureData(b[e],
  15645. d, c));
  15646. return d
  15647. };
  15648. a.parseArmatureData = function(b, c, d) {
  15649. var e = new t;
  15650. e.name = b[h.ConstValues.A_NAME];
  15651. var l = b[h.ConstValues.BONE],
  15652. f;
  15653. for (f in l) e.addBoneData(a.parseBoneData(l[f]));
  15654. l = b[h.ConstValues.SKIN];
  15655. for (f in l) e.addSkinData(a.parseSkinData(l[f], c));
  15656. h.DBDataUtil.transformArmatureData(e);
  15657. e.sortBoneDataList();
  15658. b = b[h.ConstValues.ANIMATION];
  15659. for (f in b) e.addAnimationData(a.parseAnimationData(b[f], e, d));
  15660. return e
  15661. };
  15662. a.parseBoneData = function(b) {
  15663. var c = new B;
  15664. c.name = b[h.ConstValues.A_NAME];
  15665. c.parent = b[h.ConstValues.A_PARENT];
  15666. c.length = Number(b[h.ConstValues.A_LENGTH]) || 0;
  15667. var d = Number(b[h.ConstValues.A_SCALE_MODE]);
  15668. !isNaN(d) && d && (c.scaleMode = d);
  15669. if (d = b[h.ConstValues.A_FIXED_ROTATION]) c.fixedRotation = d;
  15670. a.parseTransform(b[h.ConstValues.TRANSFORM], c.global);
  15671. c.transform.copy(c.global);
  15672. return c
  15673. };
  15674. a.parseSkinData = function(b, c) {
  15675. var d = new C;
  15676. d.name = b[h.ConstValues.A_NAME];
  15677. var e = b[h.ConstValues.SLOT],
  15678. l;
  15679. for (l in e) d.addSlotData(a.parseSlotData(e[l], c));
  15680. return d
  15681. };
  15682. a.parseSlotData = function(b, c) {
  15683. var d = new v;
  15684. d.name = b[h.ConstValues.A_NAME];
  15685. d.parent = b[h.ConstValues.A_PARENT];
  15686. d.zOrder = Number(b[h.ConstValues.A_Z_ORDER]);
  15687. d.blendMode = b[h.ConstValues.A_BLENDMODE];
  15688. d.blendMode || (d.blendMode = "normal");
  15689. var e = b[h.ConstValues.DISPLAY],
  15690. l;
  15691. for (l in e) d.addDisplayData(a.parseDisplayData(e[l], c));
  15692. return d
  15693. };
  15694. a.parseDisplayData = function(b, c) {
  15695. var d = new g;
  15696. d.name = b[h.ConstValues.A_NAME];
  15697. d.type = b[h.ConstValues.A_TYPE];
  15698. d.pivot = c.addSubTexturePivot(0, 0, d.name);
  15699. a.parseTransform(b[h.ConstValues.TRANSFORM], d.transform, d.pivot);
  15700. return d
  15701. };
  15702. a.parseAnimationData = function(b,
  15703. c, d) {
  15704. var e = new m;
  15705. e.name = b[h.ConstValues.A_NAME];
  15706. e.frameRate = d;
  15707. e.loop = Number(b[h.ConstValues.A_LOOP]) || 0;
  15708. e.fadeInTime = Number(b[h.ConstValues.A_FADE_IN_TIME]);
  15709. e.duration = Number(b[h.ConstValues.A_DURATION]) / d;
  15710. e.scale = Number(b[h.ConstValues.A_SCALE]);
  15711. if (b.hasOwnProperty(h.ConstValues.A_TWEEN_EASING)) {
  15712. var l = b[h.ConstValues.A_TWEEN_EASING];
  15713. e.tweenEasing = void 0 == l || null == l ? NaN : Number(l)
  15714. } else e.tweenEasing = NaN;
  15715. a.parseTimeline(b, e, a.parseMainFrame, d);
  15716. var f, l = b[h.ConstValues.TIMELINE],
  15717. k;
  15718. for (k in l) f = l[k], b =
  15719. a.parseTransformTimeline(f, e.duration, d), f = f[h.ConstValues.A_NAME], e.addTimeline(b, f);
  15720. h.DBDataUtil.addHideTimeline(e, c);
  15721. h.DBDataUtil.transformAnimationData(e, c);
  15722. return e
  15723. };
  15724. a.parseTimeline = function(a, b, c, d) {
  15725. var e = 0,
  15726. l;
  15727. a = a[h.ConstValues.FRAME];
  15728. for (var f in a) l = c(a[f], d), l.position = e, b.addFrame(l), e += l.duration;
  15729. l && (l.duration = b.duration - l.position)
  15730. };
  15731. a.parseTransformTimeline = function(b, c, d) {
  15732. var e = new f;
  15733. e.duration = c;
  15734. a.parseTimeline(b, e, a.parseTransformFrame, d);
  15735. e.scale = Number(b[h.ConstValues.A_SCALE]);
  15736. e.offset =
  15737. Number(b[h.ConstValues.A_OFFSET]);
  15738. return e
  15739. };
  15740. a.parseFrame = function(a, b, c) {
  15741. b.duration = Number(a[h.ConstValues.A_DURATION]) / c;
  15742. b.action = a[h.ConstValues.A_ACTION];
  15743. b.event = a[h.ConstValues.A_EVENT];
  15744. b.sound = a[h.ConstValues.A_SOUND]
  15745. };
  15746. a.parseMainFrame = function(b, d) {
  15747. var e = new c;
  15748. a.parseFrame(b, e, d);
  15749. return e
  15750. };
  15751. a.parseTransformFrame = function(b, c) {
  15752. var l = new d;
  15753. a.parseFrame(b, l, c);
  15754. l.visible = 1 != Number(b[h.ConstValues.A_HIDE]);
  15755. if (b.hasOwnProperty(h.ConstValues.A_TWEEN_EASING)) {
  15756. var f = b[h.ConstValues.A_TWEEN_EASING];
  15757. l.tweenEasing =
  15758. void 0 == f || null == f ? NaN : Number(f)
  15759. } else l.tweenEasing = 0;
  15760. l.tweenRotate = Number(b[h.ConstValues.A_TWEEN_ROTATE]) || 0;
  15761. l.displayIndex = Number(b[h.ConstValues.A_DISPLAY_INDEX]) || 0;
  15762. l.zOrder = Number(b[h.ConstValues.A_Z_ORDER]) || 0;
  15763. a.parseTransform(b[h.ConstValues.TRANSFORM], l.global, l.pivot);
  15764. l.transform.copy(l.global);
  15765. if (f = b[h.ConstValues.COLOR_TRANSFORM]) l.color = new e.ColorTransform, l.color.alphaOffset = Number(f[h.ConstValues.A_ALPHA_OFFSET]), l.color.redOffset = Number(f[h.ConstValues.A_RED_OFFSET]), l.color.greenOffset =
  15766. Number(f[h.ConstValues.A_GREEN_OFFSET]), l.color.blueOffset = Number(f[h.ConstValues.A_BLUE_OFFSET]), l.color.alphaMultiplier = 0.01 * Number(f[h.ConstValues.A_ALPHA_MULTIPLIER]), l.color.redMultiplier = 0.01 * Number(f[h.ConstValues.A_RED_MULTIPLIER]), l.color.greenMultiplier = 0.01 * Number(f[h.ConstValues.A_GREEN_MULTIPLIER]), l.color.blueMultiplier = 0.01 * Number(f[h.ConstValues.A_BLUE_MULTIPLIER]);
  15767. return l
  15768. };
  15769. a.parseTransform = function(a, b, c) {
  15770. "undefined" === typeof c && (c = null);
  15771. a && (b && (b.x = Number(a[h.ConstValues.A_X]),
  15772. b.y = Number(a[h.ConstValues.A_Y]), b.skewX = Number(a[h.ConstValues.A_SKEW_X]) * h.ConstValues.ANGLE_TO_RADIAN, b.skewY = Number(a[h.ConstValues.A_SKEW_Y]) * h.ConstValues.ANGLE_TO_RADIAN, b.scaleX = Number(a[h.ConstValues.A_SCALE_X]), b.scaleY = Number(a[h.ConstValues.A_SCALE_Y])), c && (c.x = Number(a[h.ConstValues.A_PIVOT_X]), c.y = Number(a[h.ConstValues.A_PIVOT_Y])))
  15773. };
  15774. return a
  15775. }();
  15776. a.DataParser = l
  15777. })(c.objects || (c.objects = {}));
  15778. var b = c.objects;
  15779. (function(a) {
  15780. var c = function(a) {
  15781. function c() {
  15782. a.call(this);
  15783. this._dataDic = {};
  15784. this._textureAtlasDic = {};
  15785. this._textureAtlasLoadingDic = {}
  15786. }
  15787. __extends(c, a);
  15788. c.prototype.getSkeletonData = function(a) {
  15789. return this._dataDic[a]
  15790. };
  15791. c.prototype.addSkeletonData = function(a, b) {
  15792. "undefined" === typeof b && (b = null);
  15793. if (!a) throw Error();
  15794. b = b || a.name;
  15795. if (!b) throw Error("Unnamed data!");
  15796. this._dataDic[b] = a
  15797. };
  15798. c.prototype.removeSkeletonData = function(a) {
  15799. delete this._dataDic[a]
  15800. };
  15801. c.prototype.getTextureAtlas = function(a) {
  15802. return this._textureAtlasDic[a]
  15803. };
  15804. c.prototype.addTextureAtlas = function(a, b) {
  15805. "undefined" === typeof b && (b = null);
  15806. if (!a) throw Error();
  15807. b = b || a.name;
  15808. if (!b) throw Error("Unnamed data!");
  15809. this._textureAtlasDic[b] = a
  15810. };
  15811. c.prototype.removeTextureAtlas = function(a) {
  15812. delete this._textureAtlasDic[a]
  15813. };
  15814. c.prototype.dispose = function(a) {
  15815. "undefined" === typeof a && (a = !0);
  15816. if (a) {
  15817. for (var b in this._dataDic) this._dataDic[b].dispose();
  15818. for (b in this._textureAtlasDic) this._textureAtlasDic[b].dispose()
  15819. }
  15820. this._currentTextureAtlasName = this._currentDataName = this._textureAtlasLoadingDic = this._textureAtlasDic = this._dataDic = null
  15821. };
  15822. c.prototype.buildArmature = function(a, c,
  15823. d, e, h) {
  15824. if (d) {
  15825. var l = this._dataDic[d];
  15826. if (l) var m = l.getArmatureData(a)
  15827. } else
  15828. for (d in this._dataDic)
  15829. if (l = this._dataDic[d], m = l.getArmatureData(a)) break; if (!m) return null;
  15830. this._currentDataName = d;
  15831. this._currentTextureAtlasName = e || d;
  15832. e = this._generateArmature();
  15833. e.name = a;
  15834. var k, g, p = m.getBoneDataList(),
  15835. q;
  15836. for (q in p) g = p[q], k = new f, k.name = g.name, k.fixedRotation = g.fixedRotation, k.scaleMode = g.scaleMode, k.origin.copy(g.transform), m.getBoneData(g.parent) ? e.addChild(k, g.parent) : e.addChild(k, null);
  15837. if (c && c != a) {
  15838. var n = l.getArmatureData(c);
  15839. if (!n)
  15840. for (d in this._dataDic)
  15841. if (l = this._dataDic[d], n = l.getArmatureData(c)) break
  15842. }
  15843. n ? e.animation.setAnimationDataList(n.getAnimationDataList()) : e.animation.setAnimationDataList(m.getAnimationDataList());
  15844. k = m.getSkinData(h);
  15845. if (!k) throw Error();
  15846. a = [];
  15847. d = k.getSlotDataList();
  15848. for (q in d)
  15849. if (l = d[q], k = e.getBone(l.parent)) {
  15850. h = l.getDisplayDataList();
  15851. c = this._generateSlot();
  15852. c.name = l.name;
  15853. c._blendMode = l.blendMode;
  15854. c._originZOrder = l.zOrder;
  15855. c._dislayDataList = h;
  15856. a.length = 0;
  15857. for (l = h.length; l--;) switch (m = h[l], m.type) {
  15858. case b.DisplayData.ARMATURE:
  15859. (m =
  15860. this.buildArmature(m.name, null, this._currentDataName, this._currentTextureAtlasName, null)) && (a[l] = m);
  15861. break;
  15862. default:
  15863. a[l] = this._generateDisplay(this._textureAtlasDic[this._currentTextureAtlasName], m.name, m.pivot.x, m.pivot.y)
  15864. }
  15865. c.setDisplayList(a);
  15866. c._changeDisplay(0);
  15867. k.addChild(c)
  15868. }
  15869. e._slotsZOrderChanged = !0;
  15870. e.advanceTime(0);
  15871. return e
  15872. };
  15873. c.prototype.getTextureDisplay = function(a, b, c, d) {
  15874. if (b) var e = this._textureAtlasDic[b];
  15875. if (!e && !b)
  15876. for (b in this._textureAtlasDic) {
  15877. e = this._textureAtlasDic[b];
  15878. if (e.getRegion(a)) break;
  15879. e = null
  15880. }
  15881. if (e) {
  15882. if (isNaN(c) || isNaN(d))
  15883. if (b = this._dataDic[b])
  15884. if (b = b.getSubTexturePivot(a)) c = b.x, d = b.y;
  15885. return this._generateDisplay(e, a, c, d)
  15886. }
  15887. return null
  15888. };
  15889. c.prototype._generateArmature = function() {
  15890. return null
  15891. };
  15892. c.prototype._generateSlot = function() {
  15893. return null
  15894. };
  15895. c.prototype._generateDisplay = function(a, b, c, d) {
  15896. return null
  15897. };
  15898. return c
  15899. }(d.EventDispatcher);
  15900. a.BaseFactory = c
  15901. })(c.factorys || (c.factorys = {}));
  15902. (function(c) {
  15903. var d = function() {
  15904. function a() {}
  15905. a.ANGLE_TO_RADIAN = Math.PI / 180;
  15906. a.DRAGON_BONES = "dragonBones";
  15907. a.ARMATURE =
  15908. "armature";
  15909. a.SKIN = "skin";
  15910. a.BONE = "bone";
  15911. a.SLOT = "slot";
  15912. a.DISPLAY = "display";
  15913. a.ANIMATION = "animation";
  15914. a.TIMELINE = "timeline";
  15915. a.FRAME = "frame";
  15916. a.TRANSFORM = "transform";
  15917. a.COLOR_TRANSFORM = "colorTransform";
  15918. a.TEXTURE_ATLAS = "TextureAtlas";
  15919. a.SUB_TEXTURE = "SubTexture";
  15920. a.A_VERSION = "version";
  15921. a.A_IMAGE_PATH = "imagePath";
  15922. a.A_FRAME_RATE = "frameRate";
  15923. a.A_NAME = "name";
  15924. a.A_PARENT = "parent";
  15925. a.A_LENGTH = "length";
  15926. a.A_TYPE = "type";
  15927. a.A_FADE_IN_TIME = "fadeInTime";
  15928. a.A_DURATION = "duration";
  15929. a.A_SCALE = "scale";
  15930. a.A_OFFSET = "offset";
  15931. a.A_LOOP =
  15932. "loop";
  15933. a.A_EVENT = "event";
  15934. a.A_SOUND = "sound";
  15935. a.A_ACTION = "action";
  15936. a.A_HIDE = "hide";
  15937. a.A_TWEEN_EASING = "tweenEasing";
  15938. a.A_TWEEN_ROTATE = "tweenRotate";
  15939. a.A_DISPLAY_INDEX = "displayIndex";
  15940. a.A_Z_ORDER = "z";
  15941. a.A_BLENDMODE = "blendMode";
  15942. a.A_WIDTH = "width";
  15943. a.A_HEIGHT = "height";
  15944. a.A_SCALE_MODE = "scaleMode";
  15945. a.A_FIXED_ROTATION = "fixedRotation";
  15946. a.A_X = "x";
  15947. a.A_Y = "y";
  15948. a.A_SKEW_X = "skX";
  15949. a.A_SKEW_Y = "skY";
  15950. a.A_SCALE_X = "scX";
  15951. a.A_SCALE_Y = "scY";
  15952. a.A_PIVOT_X = "pX";
  15953. a.A_PIVOT_Y = "pY";
  15954. a.A_ALPHA_OFFSET = "aO";
  15955. a.A_RED_OFFSET = "rO";
  15956. a.A_GREEN_OFFSET = "gO";
  15957. a.A_BLUE_OFFSET = "bO";
  15958. a.A_ALPHA_MULTIPLIER = "aM";
  15959. a.A_RED_MULTIPLIER = "rM";
  15960. a.A_GREEN_MULTIPLIER = "gM";
  15961. a.A_BLUE_MULTIPLIER = "bM";
  15962. return a
  15963. }();
  15964. c.ConstValues = d;
  15965. var h = function() {
  15966. function a() {}
  15967. a.transformPointWithParent = function(b, c) {
  15968. var d = a._helpMatrix;
  15969. a.transformToMatrix(c, d);
  15970. d.invert();
  15971. var e = b.x,
  15972. h = b.y;
  15973. b.x = d.a * e + d.c * h + d.tx;
  15974. b.y = d.d * h + d.b * e + d.ty;
  15975. b.skewX = a.formatRadian(b.skewX - c.skewX);
  15976. b.skewY = a.formatRadian(b.skewY - c.skewY)
  15977. };
  15978. a.transformToMatrix = function(a, b) {
  15979. b.a = a.scaleX * Math.cos(a.skewY);
  15980. b.b = a.scaleX * Math.sin(a.skewY);
  15981. b.c = -a.scaleY * Math.sin(a.skewX);
  15982. b.d = a.scaleY * Math.cos(a.skewX);
  15983. b.tx = a.x;
  15984. b.ty = a.y
  15985. };
  15986. a.formatRadian = function(b) {
  15987. b %= a.DOUBLE_PI;
  15988. b > Math.PI && (b -= a.DOUBLE_PI);
  15989. b < -Math.PI && (b += a.DOUBLE_PI);
  15990. return b
  15991. };
  15992. a.DOUBLE_PI = 2 * Math.PI;
  15993. a._helpMatrix = new e.Matrix;
  15994. return a
  15995. }();
  15996. c.TransformUtil = h;
  15997. d = function() {
  15998. function c() {}
  15999. c.transformArmatureData = function(a) {
  16000. for (var b = a.getBoneDataList(), c = b.length, d, e; c--;)
  16001. if (d = b[c], d.parent && (e = a.getBoneData(d.parent))) d.transform.copy(d.global), h.transformPointWithParent(d.transform, e.global)
  16002. };
  16003. c.transformArmatureDataAnimations = function(a) {
  16004. for (var b = a.getAnimationDataList(), d = b.length; d--;) c.transformAnimationData(b[d], a)
  16005. };
  16006. c.transformAnimationData = function(a, b) {
  16007. for (var d = b.getSkinData(null), e = b.getBoneDataList(), d = d.getSlotDataList(), l = e.length, f, m, k, g, n, w, E, x, y, H; l--;)
  16008. if (f = e[l], m = a.getTimeline(f.name)) {
  16009. k = null;
  16010. for (var L in d)
  16011. if (k = d[L], k.parent == f.name) break;
  16012. g = f.parent ? a.getTimeline(f.parent) : null;
  16013. n = m.getFrameList();
  16014. x = E = w = null;
  16015. H = n.length;
  16016. for (var G = 0; G < H; G++) {
  16017. y = n[G];
  16018. g ? (c._helpTransform1.copy(y.global),
  16019. c.getTimelineTransform(g, y.position, c._helpTransform2), h.transformPointWithParent(c._helpTransform1, c._helpTransform2), y.transform.copy(c._helpTransform1)) : y.transform.copy(y.global);
  16020. y.transform.x -= f.transform.x;
  16021. y.transform.y -= f.transform.y;
  16022. y.transform.skewX -= f.transform.skewX;
  16023. y.transform.skewY -= f.transform.skewY;
  16024. y.transform.scaleX -= f.transform.scaleX;
  16025. y.transform.scaleY -= f.transform.scaleY;
  16026. !m.transformed && k && (y.zOrder -= k.zOrder);
  16027. w || (w = m.originTransform, w.copy(y.transform), w.skewX = h.formatRadian(w.skewX),
  16028. w.skewY = h.formatRadian(w.skewY), E = m.originPivot, E.x = y.pivot.x, E.y = y.pivot.y);
  16029. y.transform.x -= w.x;
  16030. y.transform.y -= w.y;
  16031. y.transform.skewX = h.formatRadian(y.transform.skewX - w.skewX);
  16032. y.transform.skewY = h.formatRadian(y.transform.skewY - w.skewY);
  16033. y.transform.scaleX -= w.scaleX;
  16034. y.transform.scaleY -= w.scaleY;
  16035. m.transformed || (y.pivot.x -= E.x, y.pivot.y -= E.y);
  16036. if (x) {
  16037. var M = y.transform.skewX - x.transform.skewX;
  16038. x.tweenRotate ? 0 < x.tweenRotate ? (0 > M && (y.transform.skewX += 2 * Math.PI, y.transform.skewY += 2 * Math.PI), 1 < x.tweenRotate &&
  16039. (y.transform.skewX += 2 * Math.PI * (x.tweenRotate - 1), y.transform.skewY += 2 * Math.PI * (x.tweenRotate - 1))) : (0 < M && (y.transform.skewX -= 2 * Math.PI, y.transform.skewY -= 2 * Math.PI), 1 > x.tweenRotate && (y.transform.skewX += 2 * Math.PI * (x.tweenRotate + 1), y.transform.skewY += 2 * Math.PI * (x.tweenRotate + 1))) : (y.transform.skewX = x.transform.skewX + h.formatRadian(y.transform.skewX - x.transform.skewX), y.transform.skewY = x.transform.skewY + h.formatRadian(y.transform.skewY - x.transform.skewY))
  16040. }
  16041. x = y
  16042. }
  16043. m.transformed = !0
  16044. }
  16045. };
  16046. c.getTimelineTransform =
  16047. function(b, c, d) {
  16048. for (var e = b.getFrameList(), l = e.length, f; l--;)
  16049. if (b = e[l], b.position <= c && b.position + b.duration > c) {
  16050. f = b.tweenEasing;
  16051. l == e.length - 1 || isNaN(f) || c == b.position ? d.copy(b.global) : (c = (c - b.position) / b.duration, f && (c = a.TimelineState.getEaseValue(c, f)), e = e[l + 1], d.x = b.global.x + (e.global.x - b.global.x) * c, d.y = b.global.y + (e.global.y - b.global.y) * c, d.skewX = h.formatRadian(b.global.skewX + (e.global.skewX - b.global.skewX) * c), d.skewY = h.formatRadian(b.global.skewY + (e.global.skewY - b.global.skewY) * c), d.scaleX = b.global.scaleX +
  16052. (e.global.scaleX - b.global.scaleX) * c, d.scaleY = b.global.scaleY + (e.global.scaleY - b.global.scaleY) * c);
  16053. break
  16054. }
  16055. };
  16056. c.addHideTimeline = function(a, c) {
  16057. for (var d = c.getBoneDataList(), e = d.length, h; e--;) h = d[e], h = h.name, a.getTimeline(h) || a.addTimeline(b.TransformTimeline.HIDE_TIMELINE, h)
  16058. };
  16059. c._helpTransform1 = new b.DBTransform;
  16060. c._helpTransform2 = new b.DBTransform;
  16061. return c
  16062. }();
  16063. c.DBDataUtil = d
  16064. })(c.utils || (c.utils = {}));
  16065. var h = c.utils,
  16066. l = function() {
  16067. function a() {
  16068. this.global = new b.DBTransform;
  16069. this.origin = new b.DBTransform;
  16070. this.offset =
  16071. new b.DBTransform;
  16072. this.tween = new b.DBTransform;
  16073. this.tween.scaleX = this.tween.scaleY = 0;
  16074. this._globalTransformMatrix = new e.Matrix;
  16075. this._visible = !0;
  16076. this._isDisplayOnStage = this._isColorChanged = !1;
  16077. this._scaleType = 0;
  16078. this.fixedRotation = !1
  16079. }
  16080. a.prototype.getVisible = function() {
  16081. return this._visible
  16082. };
  16083. a.prototype.setVisible = function(a) {
  16084. this._visible = a
  16085. };
  16086. a.prototype._setParent = function(a) {
  16087. this.parent = a
  16088. };
  16089. a.prototype._setArmature = function(a) {
  16090. this.armature && this.armature._removeDBObject(this);
  16091. (this.armature = a) && this.armature._addDBObject(this)
  16092. };
  16093. a.prototype.dispose = function() {
  16094. this._globalTransformMatrix = this.tween = this.offset = this.origin = this.global = this.armature = this.parent = null
  16095. };
  16096. a.prototype._update = function() {
  16097. this.global.scaleX = (this.origin.scaleX + this.tween.scaleX) * this.offset.scaleX;
  16098. this.global.scaleY = (this.origin.scaleY + this.tween.scaleY) * this.offset.scaleY;
  16099. if (this.parent) {
  16100. var a = this.origin.x + this.offset.x + this.tween.x,
  16101. b = this.origin.y + this.offset.y + this.tween.y,
  16102. c = this.parent._globalTransformMatrix;
  16103. this._globalTransformMatrix.tx = this.global.x =
  16104. c.a * a + c.c * b + c.tx;
  16105. this._globalTransformMatrix.ty = this.global.y = c.d * b + c.b * a + c.ty;
  16106. this.fixedRotation ? (this.global.skewX = this.origin.skewX + this.offset.skewX + this.tween.skewX, this.global.skewY = this.origin.skewY + this.offset.skewY + this.tween.skewY) : (this.global.skewX = this.origin.skewX + this.offset.skewX + this.tween.skewX + this.parent.global.skewX, this.global.skewY = this.origin.skewY + this.offset.skewY + this.tween.skewY + this.parent.global.skewY);
  16107. this.parent.scaleMode >= this._scaleType && (this.global.scaleX *= this.parent.global.scaleX,
  16108. this.global.scaleY *= this.parent.global.scaleY)
  16109. } else this._globalTransformMatrix.tx = this.global.x = this.origin.x + this.offset.x + this.tween.x, this._globalTransformMatrix.ty = this.global.y = this.origin.y + this.offset.y + this.tween.y, this.global.skewX = this.origin.skewX + this.offset.skewX + this.tween.skewX, this.global.skewY = this.origin.skewY + this.offset.skewY + this.tween.skewY;
  16110. this._globalTransformMatrix.a = this.global.scaleX * Math.cos(this.global.skewY);
  16111. this._globalTransformMatrix.b = this.global.scaleX * Math.sin(this.global.skewY);
  16112. this._globalTransformMatrix.c = -this.global.scaleY * Math.sin(this.global.skewX);
  16113. this._globalTransformMatrix.d = this.global.scaleY * Math.cos(this.global.skewX)
  16114. };
  16115. return a
  16116. }();
  16117. c.DBObject = l;
  16118. var m = function(a) {
  16119. function b(c) {
  16120. a.call(this);
  16121. this._displayBridge = c;
  16122. this._displayList = [];
  16123. this._displayIndex = -1;
  16124. this._scaleType = 1;
  16125. this._offsetZOrder = this._tweenZorder = this._originZOrder = 0;
  16126. this._isHideDisplay = this._isDisplayOnStage = !1;
  16127. this._blendMode = "normal";
  16128. this._displayBridge.updateBlendMode(this._blendMode)
  16129. }
  16130. __extends(b,
  16131. a);
  16132. b.prototype.getZOrder = function() {
  16133. return this._originZOrder + this._tweenZorder + this._offsetZOrder
  16134. };
  16135. b.prototype.setZOrder = function(a) {
  16136. this.getZOrder() != a && (this._offsetZOrder = a - this._originZOrder - this._tweenZorder, this.armature && (this.armature._slotsZOrderChanged = !0))
  16137. };
  16138. b.prototype.getDisplay = function() {
  16139. var a = this._displayList[this._displayIndex];
  16140. return a instanceof g ? a.getDisplay() : a
  16141. };
  16142. b.prototype.setDisplay = function(a) {
  16143. this._displayList[this._displayIndex] = a;
  16144. this._setDisplay(a)
  16145. };
  16146. b.prototype.getBlendMode =
  16147. function() {
  16148. return this._blendMode
  16149. };
  16150. b.prototype.setBlendMode = function(a) {
  16151. this._blendMode != a && (this._blendMode = a, this._displayBridge.getDisplay() && this._displayBridge.updateBlendMode(this._blendMode))
  16152. };
  16153. b.prototype.getChildArmature = function() {
  16154. var a = this._displayList[this._displayIndex];
  16155. return a instanceof g ? a : null
  16156. };
  16157. b.prototype.setChildArmature = function(a) {
  16158. (this._displayList[this._displayIndex] = a) && this._setDisplay(a.getDisplay())
  16159. };
  16160. b.prototype.getDisplayList = function() {
  16161. return this._displayList
  16162. };
  16163. b.prototype.setDisplayList =
  16164. function(a) {
  16165. if (!a) throw Error();
  16166. for (var b = this._displayList.length = a.length; b--;) this._displayList[b] = a[b];
  16167. 0 <= this._displayIndex && (a = this._displayIndex, this._displayIndex = -1, this._changeDisplay(a))
  16168. };
  16169. b.prototype._setDisplay = function(a) {
  16170. this._displayBridge.getDisplay() ? this._displayBridge.setDisplay(a) : (this._displayBridge.setDisplay(a), this.armature && (this._displayBridge.addDisplay(this.armature.getDisplay(), -1), this.armature._slotsZOrderChanged = !0));
  16171. this.updateChildArmatureAnimation();
  16172. a && this._displayBridge.updateBlendMode(this._blendMode);
  16173. !this._isHideDisplay && this._displayBridge.getDisplay() ? this._isDisplayOnStage = !0 : this._isDisplayOnStage = !1
  16174. };
  16175. b.prototype._changeDisplay = function(a) {
  16176. if (0 > a) this._isHideDisplay || (this._isHideDisplay = !0, this._displayBridge.removeDisplay(), this.updateChildArmatureAnimation());
  16177. else {
  16178. if (this._isHideDisplay) {
  16179. this._isHideDisplay = !1;
  16180. var b = !0;
  16181. this.armature && (this._displayBridge.addDisplay(this.armature.getDisplay(), -1), this.armature._slotsZOrderChanged = !0)
  16182. }
  16183. var c = this._displayList.length;
  16184. a >= c && 0 < c && (a = c - 1);
  16185. this._displayIndex !=
  16186. a ? (this._displayIndex = a, a = this._displayList[this._displayIndex], a instanceof g ? this._setDisplay(a.getDisplay()) : this._setDisplay(a), this._dislayDataList && this._displayIndex <= this._dislayDataList.length && this.origin.copy(this._dislayDataList[this._displayIndex].transform)) : b && this.updateChildArmatureAnimation()
  16187. }!this._isHideDisplay && this._displayBridge.getDisplay() ? this._isDisplayOnStage = !0 : this._isDisplayOnStage = !1
  16188. };
  16189. b.prototype.setVisible = function(a) {
  16190. a != this._visible && (this._visible = a, this._updateVisible(this._visible))
  16191. };
  16192. b.prototype._setArmature = function(b) {
  16193. a.prototype._setArmature.call(this, b);
  16194. this.armature ? (this.armature._slotsZOrderChanged = !0, this._displayBridge.addDisplay(this.armature.getDisplay(), -1)) : this._displayBridge.removeDisplay()
  16195. };
  16196. b.prototype.dispose = function() {
  16197. this._displayBridge && (a.prototype.dispose.call(this), this._displayBridge.dispose(), this._displayList.length = 0, this._dislayDataList = this._displayList = this._displayBridge = null)
  16198. };
  16199. b.prototype._update = function() {
  16200. a.prototype._update.call(this);
  16201. if (this._isDisplayOnStage) {
  16202. var b =
  16203. this.parent._tweenPivot.x,
  16204. c = this.parent._tweenPivot.y;
  16205. if (b || c) {
  16206. var d = this.parent._globalTransformMatrix;
  16207. this._globalTransformMatrix.tx += d.a * b + d.c * c;
  16208. this._globalTransformMatrix.ty += d.b * b + d.d * c
  16209. }
  16210. this._displayBridge.updateTransform(this._globalTransformMatrix, this.global)
  16211. }
  16212. };
  16213. b.prototype._updateVisible = function(a) {
  16214. this._displayBridge.setVisible(this.parent.getVisible() && this._visible && a)
  16215. };
  16216. b.prototype.updateChildArmatureAnimation = function() {
  16217. var a = this.getChildArmature();
  16218. if (a)
  16219. if (this._isHideDisplay) a.animation.stop(),
  16220. a.animation._lastAnimationState = null;
  16221. else {
  16222. var b = this.armature ? this.armature.animation.getLastAnimationName() : null;
  16223. b && a.animation.hasAnimation(b) ? a.animation.gotoAndPlay(b) : a.animation.play()
  16224. }
  16225. };
  16226. return b
  16227. }(l);
  16228. c.Slot = m;
  16229. var f = function(a) {
  16230. function b() {
  16231. a.call(this);
  16232. this._children = [];
  16233. this._scaleType = 2;
  16234. this._tweenPivot = new e.Point;
  16235. this.scaleMode = 1
  16236. }
  16237. __extends(b, a);
  16238. b.prototype.setVisible = function(a) {
  16239. if (this._visible != a)
  16240. for (this._visible = a, a = this._children.length; a--;) {
  16241. var b = this._children[a];
  16242. b instanceof m &&
  16243. b._updateVisible(this._visible)
  16244. }
  16245. };
  16246. b.prototype._setArmature = function(b) {
  16247. a.prototype._setArmature.call(this, b);
  16248. for (b = this._children.length; b--;) this._children[b]._setArmature(this.armature)
  16249. };
  16250. b.prototype.dispose = function() {
  16251. if (this._children) {
  16252. a.prototype.dispose.call(this);
  16253. for (var b = this._children.length; b--;) this._children[b].dispose();
  16254. this._children.length = 0;
  16255. this.slot = this._tweenPivot = this._children = null
  16256. }
  16257. };
  16258. b.prototype.contains = function(a) {
  16259. if (!a) throw Error();
  16260. if (a == this) return !1;
  16261. for (; a != this && null !=
  16262. a;) a = a.parent;
  16263. return a == this
  16264. };
  16265. b.prototype.addChild = function(a) {
  16266. if (!a) throw Error();
  16267. if (a == this || a instanceof b && a.contains(this)) throw Error("An Bone cannot be added as a child to itself or one of its children (or children's children, etc.)");
  16268. a.parent && a.parent.removeChild(a);
  16269. this._children[this._children.length] = a;
  16270. a._setParent(this);
  16271. a._setArmature(this.armature);
  16272. !this.slot && a instanceof m && (this.slot = a)
  16273. };
  16274. b.prototype.removeChild = function(a) {
  16275. if (!a) throw Error();
  16276. var b = this._children.indexOf(a);
  16277. if (0 <=
  16278. b) this._children.splice(b, 1), a._setParent(null), a._setArmature(null), a == this.slot && (this.slot = null);
  16279. else throw Error();
  16280. };
  16281. b.prototype.getSlots = function() {
  16282. for (var a = [], b = this._children.length; b--;) this._children[b] instanceof m && a.unshift(this._children[b]);
  16283. return a
  16284. };
  16285. b.prototype._arriveAtFrame = function(a, c, e, h) {
  16286. if (a) {
  16287. if (c = e.getMixingTransform(this.name), !e.displayControl || 2 != c && -1 != c || this.displayController && this.displayController != e.name || !this.slot || (c = a.displayIndex, 0 <= c && !isNaN(a.zOrder) && a.zOrder !=
  16288. this.slot._tweenZorder && (this.slot._tweenZorder = a.zOrder, this.armature._slotsZOrderChanged = !0), this.slot._changeDisplay(c), this.slot._updateVisible(a.visible)), a.event && this.armature.hasEventListener(d.FrameEvent.BONE_FRAME_EVENT) && (c = new d.FrameEvent(d.FrameEvent.BONE_FRAME_EVENT), c.bone = this, c.animationState = e, c.frameLabel = a.event, this.armature._eventList.push(c)), a.sound && b._soundManager.hasEventListener(d.SoundEvent.SOUND) && (c = new d.SoundEvent(d.SoundEvent.SOUND), c.armature = this.armature, c.animationState =
  16289. e, c.sound = a.sound, b._soundManager.dispatchEvent(c)), a.action)
  16290. for (var l in this._children) this._children[l] instanceof m && (e = this._children[l].getChildArmature()) && e.animation.gotoAndPlay(a.action)
  16291. } else this.slot && this.slot._changeDisplay(-1)
  16292. };
  16293. b.prototype._updateColor = function(a, b, c, d, e, h, l, f, m) {
  16294. (m || this._isColorChanged) && this.slot._displayBridge.updateColor(a, b, c, d, e, h, l, f);
  16295. this._isColorChanged = m
  16296. };
  16297. b._soundManager = d.SoundEventManager.getInstance();
  16298. return b
  16299. }(l);
  16300. c.Bone = f;
  16301. var g = function(b) {
  16302. function c(d) {
  16303. b.call(this);
  16304. this.animation = new a.Animation(this);
  16305. this._display = d;
  16306. this._slotsZOrderChanged = !1;
  16307. this._slotList = [];
  16308. this._boneList = [];
  16309. this._eventList = []
  16310. }
  16311. __extends(c, b);
  16312. c.prototype.getDisplay = function() {
  16313. return this._display
  16314. };
  16315. c.prototype.dispose = function() {
  16316. if (this.animation) {
  16317. this.animation.dispose();
  16318. for (var a = this._slotList.length; a--;) this._slotList[a].dispose();
  16319. for (a = this._boneList.length; a--;) this._boneList[a].dispose();
  16320. this._slotList.length = 0;
  16321. this._boneList.length = 0;
  16322. this._eventList.length = 0;
  16323. this.animation = this._display =
  16324. this._eventList = this._boneList = this._slotList = null
  16325. }
  16326. };
  16327. c.prototype.advanceTime = function(a) {
  16328. this.animation.advanceTime(a);
  16329. a *= this.animation.timeScale;
  16330. for (var b = this._boneList.length; b--;) this._boneList[b]._update();
  16331. for (var b = this._slotList.length, c; b--;) c = this._slotList[b], c._update(), c._isDisplayOnStage && (c = c.getChildArmature()) && c.advanceTime(a);
  16332. this._slotsZOrderChanged && (this.updateSlotsZOrder(), this.hasEventListener(d.ArmatureEvent.Z_ORDER_UPDATED) && this.dispatchEvent(new d.ArmatureEvent(d.ArmatureEvent.Z_ORDER_UPDATED)));
  16333. if (this._eventList.length) {
  16334. a = this._eventList.length;
  16335. for (b = 0; b < a; b++) this.dispatchEvent(this._eventList[b]);
  16336. this._eventList.length = 0
  16337. }
  16338. };
  16339. c.prototype.getSlots = function(a) {
  16340. "undefined" === typeof a && (a = !0);
  16341. return a ? this._slotList.concat() : this._slotList
  16342. };
  16343. c.prototype.getBones = function(a) {
  16344. "undefined" === typeof a && (a = !0);
  16345. return a ? this._boneList.concat() : this._boneList
  16346. };
  16347. c.prototype.getSlot = function(a) {
  16348. for (var b = this._slotList.length; b--;)
  16349. if (this._slotList[b].name == a) return this._slotList[b];
  16350. return null
  16351. };
  16352. c.prototype.getSlotByDisplay =
  16353. function(a) {
  16354. if (a)
  16355. for (var b = this._slotList.length; b--;)
  16356. if (this._slotList[b].getDisplay() == a) return this._slotList[b];
  16357. return null
  16358. };
  16359. c.prototype.removeSlot = function(a) {
  16360. if (!a) throw Error();
  16361. if (0 <= this._slotList.indexOf(a)) a.parent.removeChild(a);
  16362. else throw Error();
  16363. };
  16364. c.prototype.removeSlotByName = function(a) {
  16365. a && (a = this.getSlot(a)) && this.removeSlot(a)
  16366. };
  16367. c.prototype.getBone = function(a) {
  16368. for (var b = this._boneList.length; b--;)
  16369. if (this._boneList[b].name == a) return this._boneList[b];
  16370. return null
  16371. };
  16372. c.prototype.getBoneByDisplay =
  16373. function(a) {
  16374. return (a = this.getSlotByDisplay(a)) ? a.parent : null
  16375. };
  16376. c.prototype.removeBone = function(a) {
  16377. if (!a) throw Error();
  16378. if (0 <= this._boneList.indexOf(a)) a.parent ? a.parent.removeChild(a) : a._setArmature(null);
  16379. else throw Error();
  16380. };
  16381. c.prototype.removeBoneByName = function(a) {
  16382. a && (a = this.getBone(a)) && this.removeBone(a)
  16383. };
  16384. c.prototype.addChild = function(a, b) {
  16385. if (!a) throw Error();
  16386. if (b) {
  16387. var c = this.getBone(b);
  16388. if (c) c.addChild(a);
  16389. else throw Error();
  16390. } else a.parent && a.parent.removeChild(a), a._setArmature(this)
  16391. };
  16392. c.prototype.updateSlotsZOrder =
  16393. function() {
  16394. this._slotList.sort(this.sortSlot);
  16395. for (var a = this._slotList.length, b; a--;) b = this._slotList[a], b._isDisplayOnStage && b._displayBridge.addDisplay(this._display, -1);
  16396. this._slotsZOrderChanged = !1
  16397. };
  16398. c.prototype._addDBObject = function(a) {
  16399. a instanceof m ? 0 > this._slotList.indexOf(a) && (this._slotList[this._slotList.length] = a) : a instanceof f && 0 > this._boneList.indexOf(a) && (this._boneList[this._boneList.length] = a, this._sortBoneList())
  16400. };
  16401. c.prototype._removeDBObject = function(a) {
  16402. a instanceof m ? (a = this._slotList.indexOf(a),
  16403. 0 <= a && this._slotList.splice(a, 1)) : a instanceof f && (a = this._boneList.indexOf(a), 0 <= a && this._boneList.splice(a, 1))
  16404. };
  16405. c.prototype._sortBoneList = function() {
  16406. var a = this._boneList.length;
  16407. if (0 != a) {
  16408. for (var b = [], c, d, e; a--;) {
  16409. c = 0;
  16410. for (e = d = this._boneList[a]; e;) c++, e = e.parent;
  16411. b[a] = {
  16412. level: c,
  16413. bone: d
  16414. }
  16415. }
  16416. b.sort(this.sortBone);
  16417. for (a = b.length; a--;) this._boneList[a] = b[a].bone
  16418. }
  16419. };
  16420. c.prototype._arriveAtFrame = function(a, b, e, h) {
  16421. a.event && this.hasEventListener(d.FrameEvent.ANIMATION_FRAME_EVENT) && (b = new d.FrameEvent(d.FrameEvent.ANIMATION_FRAME_EVENT),
  16422. b.animationState = e, b.frameLabel = a.event, this._eventList.push(b));
  16423. a.sound && c._soundManager.hasEventListener(d.SoundEvent.SOUND) && (b = new d.SoundEvent(d.SoundEvent.SOUND), b.armature = this, b.animationState = e, b.sound = a.sound, c._soundManager.dispatchEvent(b));
  16424. a.action && e.isPlaying && this.animation.gotoAndPlay(a.action)
  16425. };
  16426. c.prototype.sortSlot = function(a, b) {
  16427. return a.getZOrder() < b.getZOrder() ? 1 : -1
  16428. };
  16429. c.prototype.sortBone = function(a, b) {
  16430. return a.level < b.level ? 1 : -1
  16431. };
  16432. c._soundManager = d.SoundEventManager.getInstance();
  16433. return c
  16434. }(d.EventDispatcher);
  16435. c.Armature = g
  16436. })(dragonBones || (dragonBones = {}));
  16437. __extends = this.__extends || function(c, e) {
  16438. function d() {
  16439. this.constructor = c
  16440. }
  16441. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  16442. d.prototype = e.prototype;
  16443. c.prototype = new d
  16444. };
  16445. (function(c) {
  16446. (function(c) {
  16447. var a = function() {
  16448. function a() {}
  16449. a.prototype.getVisible = function() {
  16450. return this._display ? this._display.visible : !1
  16451. };
  16452. a.prototype.setVisible = function(a) {
  16453. this._display && (this._display.visible = a)
  16454. };
  16455. a.prototype.getDisplay = function() {
  16456. return this._display
  16457. };
  16458. a.prototype.setDisplay = function(a) {
  16459. if (this._display != a) {
  16460. if (this._display) {
  16461. var b = this._display.parent;
  16462. if (b) var c = b.getChildIndex(this._display);
  16463. this.removeDisplay()
  16464. }
  16465. this._display = a;
  16466. this.addDisplay(b, c)
  16467. }
  16468. };
  16469. a.prototype.dispose = function() {
  16470. this._display =
  16471. null
  16472. };
  16473. a.prototype.updateTransform = function(c, d) {
  16474. this._display._x = c.tx;
  16475. this._display._y = c.ty;
  16476. this._display._skewX = d.skewX * a.RADIAN_TO_ANGLE;
  16477. this._display._skewY = d.skewY * a.RADIAN_TO_ANGLE;
  16478. this._display._scaleX = d.scaleX;
  16479. this._display._scaleY = d.scaleY
  16480. };
  16481. a.prototype.updateColor = function(a, b, c, d, e, k, n, p) {
  16482. this._display && (this._display._alpha = e)
  16483. };
  16484. a.prototype.updateBlendMode = function(a) {
  16485. this._display && a && (this._display.blendMode = egret.BlendMode.getBlendMode(a))
  16486. };
  16487. a.prototype.addDisplay = function(a, b) {
  16488. a && this._display &&
  16489. (this._display._parent && this._display._parent.removeChild(this._display), 0 > b ? a.addChild(this._display) : a.addChildAt(this._display, Math.min(b, a.numChildren)))
  16490. };
  16491. a.prototype.removeDisplay = function() {
  16492. this._display && this._display._parent && this._display._parent.removeChild(this._display)
  16493. };
  16494. a.RADIAN_TO_ANGLE = 180 / Math.PI;
  16495. return a
  16496. }();
  16497. c.DragonBonesEgretBridge = a
  16498. })(c.display || (c.display = {}));
  16499. var e = c.display;
  16500. (function(d) {
  16501. var a = function() {
  16502. function a(b, d, e) {
  16503. "undefined" === typeof e && (e = 1);
  16504. this.texture = b;
  16505. this.textureAtlasRawData =
  16506. d;
  16507. this._textureData = {};
  16508. this.scale = e;
  16509. this.name = d[c.utils.ConstValues.A_NAME];
  16510. this.parseData(d);
  16511. this.spriteSheet = new egret.SpriteSheet(b)
  16512. }
  16513. a.prototype.getTexture = function(a) {
  16514. var b = this.spriteSheet.getTexture(a);
  16515. b || (b = this._textureData[a], b = this.spriteSheet.createTexture(a, b.x, b.y, b.width, b.height));
  16516. return b
  16517. };
  16518. a.prototype.dispose = function() {
  16519. this.texture = null
  16520. };
  16521. a.prototype.getRegion = function(a) {
  16522. throw Error("error");
  16523. };
  16524. a.prototype.parseData = function(a) {
  16525. for (var b = a.SubTexture.length, c = 0; c < b; c++) {
  16526. var d = a.SubTexture[c];
  16527. this._textureData[d.name] = d
  16528. }
  16529. };
  16530. return a
  16531. }();
  16532. d.EgretTextureAtlas = a
  16533. })(c.textures || (c.textures = {}));
  16534. (function(d) {
  16535. var a = function(a) {
  16536. function d() {
  16537. a.call(this)
  16538. }
  16539. __extends(d, a);
  16540. d.prototype._generateArmature = function() {
  16541. return new c.Armature(new egret.DisplayObjectContainer)
  16542. };
  16543. d.prototype._generateSlot = function() {
  16544. return new c.Slot(new e.DragonBonesEgretBridge)
  16545. };
  16546. d.prototype._generateDisplay = function(a, b, c, d) {
  16547. var e = new egret.Bitmap;
  16548. e.texture = a.getTexture(b);
  16549. e.anchorOffsetX = c;
  16550. e.anchorOffsetY = d;
  16551. return e
  16552. };
  16553. return d
  16554. }(d.BaseFactory);
  16555. d.EgretFactory = a
  16556. })(c.factorys || (c.factorys = {}))
  16557. })(dragonBones || (dragonBones = {}));
  16558. (function(c) {
  16559. var e = function() {
  16560. function d() {}
  16561. d.TRACE_RENDER_LOOP = function(a) {
  16562. "undefined" === typeof a && (a = 0);
  16563. var b = c.Ticker.getInstance(),
  16564. d = c.MainContext.instance;
  16565. switch (a) {
  16566. case 0:
  16567. b.unregister(d.renderLoop, d);
  16568. break;
  16569. case 1:
  16570. d.renderLoop();
  16571. break;
  16572. case 2:
  16573. b.register(d.renderLoop, d)
  16574. }
  16575. };
  16576. d.DRAW_IMAGE = !0;
  16577. d.ADD_EVENT_LISTENER = !0;
  16578. d.SCALE_BITMAP_SET_SCALE_GRID = !0;
  16579. return d
  16580. }();
  16581. c.DEBUG = e
  16582. })(egret || (egret = {}));
  16583. (function(c) {
  16584. var e = function() {
  16585. function c() {}
  16586. c.isNumber = function(a) {
  16587. return "number" === typeof a && !isNaN(a)
  16588. };
  16589. return c
  16590. }();
  16591. c.NumberUtils = e
  16592. })(egret || (egret = {}));
  16593. var __extends = this.__extends || function(c, e) {
  16594. function d() {
  16595. this.constructor = c
  16596. }
  16597. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  16598. d.prototype = e.prototype;
  16599. c.prototype = new d
  16600. },
  16601. RES;
  16602. (function(c) {
  16603. var e = function(c) {
  16604. function a(a, e, l) {
  16605. "undefined" === typeof e && (e = !1);
  16606. "undefined" === typeof l && (l = !1);
  16607. c.call(this, a, e, l);
  16608. this.itemsTotal = this.itemsLoaded = 0
  16609. }
  16610. __extends(a, c);
  16611. a.dispatchResourceEvent = function(b, c, d, e, f, g) {
  16612. "undefined" === typeof d && (d = "");
  16613. "undefined" === typeof e && (e = null);
  16614. "undefined" === typeof f && (f = 0);
  16615. "undefined" === typeof g && (g = 0);
  16616. var k = egret.Event._getPropertyData(a);
  16617. k.groupName = d;
  16618. k.resItem = e;
  16619. k.itemsLoaded = f;
  16620. k.itemsTotal = g;
  16621. egret.Event._dispatchByTarget(a, b, c, k)
  16622. };
  16623. a.ITEM_LOAD_ERROR =
  16624. "itemLoadError";
  16625. a.CONFIG_COMPLETE = "configComplete";
  16626. a.GROUP_PROGRESS = "groupProgress";
  16627. a.GROUP_COMPLETE = "groupComplete";
  16628. return a
  16629. }(egret.Event);
  16630. c.ResourceEvent = e
  16631. })(RES || (RES = {}));
  16632. (function(c) {
  16633. var e = function() {
  16634. function c(a, b, d) {
  16635. this._loaded = !1;
  16636. this.name = a;
  16637. this.url = b;
  16638. this.type = d
  16639. }
  16640. Object.defineProperty(c.prototype, "loaded", {
  16641. get: function() {
  16642. return this.data ? this.data.loaded : this._loaded
  16643. },
  16644. set: function(a) {
  16645. this.data && (this.data.loaded = a);
  16646. this._loaded = a
  16647. },
  16648. enumerable: !0,
  16649. configurable: !0
  16650. });
  16651. c.prototype.toString = function() {
  16652. return '[ResourceItem name="' + this.name + '" url="' + this.url + '" type="' + this.type + '"]'
  16653. };
  16654. c.TYPE_XML = "xml";
  16655. c.TYPE_IMAGE = "image";
  16656. c.TYPE_BIN = "bin";
  16657. c.TYPE_TEXT = "text";
  16658. c.TYPE_JSON =
  16659. "json";
  16660. c.TYPE_SHEET = "sheet";
  16661. c.TYPE_FONT = "font";
  16662. c.TYPE_SOUND = "sound";
  16663. return c
  16664. }();
  16665. c.ResourceItem = e
  16666. })(RES || (RES = {}));
  16667. (function(c) {
  16668. var e = function() {
  16669. function d() {
  16670. this.keyMap = {};
  16671. this.groupDic = {}
  16672. }
  16673. d.prototype.getGroupByName = function(a) {
  16674. var b = [];
  16675. if (!this.groupDic[a]) return b;
  16676. a = this.groupDic[a];
  16677. for (var c = a.length, d = 0; d < c; d++) b.push(this.parseResourceItem(a[d]));
  16678. return b
  16679. };
  16680. d.prototype.getRawGroupByName = function(a) {
  16681. return this.groupDic[a] ? this.groupDic[a] : []
  16682. };
  16683. d.prototype.createGroup = function(a, b, c) {
  16684. "undefined" === typeof c && (c = !1);
  16685. if (!c && this.groupDic[a] || !b || 0 == b.length) return !1;
  16686. c = this.groupDic;
  16687. for (var d = [], e = b.length, f = 0; f <
  16688. e; f++) {
  16689. var g = b[f],
  16690. k = c[g];
  16691. if (k)
  16692. for (var g = k.length, n = 0; n < g; n++) {
  16693. var p = k[n]; - 1 == d.indexOf(p) && d.push(p)
  16694. } else(p = this.keyMap[g]) && -1 == d.indexOf(p) && d.push(p)
  16695. }
  16696. if (0 == d.length) return !1;
  16697. this.groupDic[a] = d;
  16698. return !0
  16699. };
  16700. d.prototype.parseConfig = function(a, b) {
  16701. if (a) {
  16702. var c = a.resources;
  16703. if (c)
  16704. for (var d = c.length, e = 0; e < d; e++) {
  16705. var f = c[e];
  16706. f.url = b + f.url;
  16707. this.keyMap[f.name] || (this.keyMap[f.name] = f)
  16708. }
  16709. if (c = a.groups)
  16710. for (d = c.length, e = 0; e < d; e++) {
  16711. for (var g = c[e], k = [], n = g.keys.split(","), p = n.length, q = 0; q < p; q++) f = n[q].trim(), (f = this.keyMap[f]) &&
  16712. -1 == k.indexOf(f) && k.push(f);
  16713. this.groupDic[g.name] = k
  16714. }
  16715. }
  16716. };
  16717. d.prototype.getType = function(a) {
  16718. return (a = this.keyMap[a]) ? a.type : ""
  16719. };
  16720. d.prototype.getRawResourceItem = function(a) {
  16721. return this.keyMap[a]
  16722. };
  16723. d.prototype.getResourceItem = function(a) {
  16724. return (a = this.keyMap[a]) ? this.parseResourceItem(a) : null
  16725. };
  16726. d.prototype.parseResourceItem = function(a) {
  16727. var b = new c.ResourceItem(a.name, a.url, a.type);
  16728. b.data = a;
  16729. return b
  16730. };
  16731. return d
  16732. }();
  16733. c.ResourceConfig = e
  16734. })(RES || (RES = {}));
  16735. __extends = this.__extends || function(c, e) {
  16736. function d() {
  16737. this.constructor = c
  16738. }
  16739. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  16740. d.prototype = e.prototype;
  16741. c.prototype = new d
  16742. };
  16743. (function(c) {
  16744. var e = function(d) {
  16745. function a() {
  16746. d.call(this);
  16747. this.groupTotalDic = {};
  16748. this.numLoadedDic = {};
  16749. this.itemListDic = {};
  16750. this.priorityQueue = {};
  16751. this.lazyLoadList = [];
  16752. this.analyzerDic = {};
  16753. this.queueIndex = 0
  16754. }
  16755. __extends(a, d);
  16756. a.prototype.isGroupInLoading = function(a) {
  16757. return void 0 !== this.itemListDic[a]
  16758. };
  16759. a.prototype.loadGroup = function(a, d, e) {
  16760. "undefined" === typeof e && (e = 0);
  16761. if (!this.itemListDic[d] && d)
  16762. if (a && 0 != a.length) {
  16763. this.priorityQueue[e] ? this.priorityQueue[e].push(d) : this.priorityQueue[e] = [d];
  16764. this.itemListDic[d] =
  16765. a;
  16766. e = a.length;
  16767. for (var m = 0; m < e; m++) a[m].groupName = d;
  16768. this.groupTotalDic[d] = a.length;
  16769. this.numLoadedDic[d] = 0;
  16770. this.next()
  16771. } else a = new c.ResourceEvent(c.ResourceEvent.GROUP_COMPLETE), a.groupName = d, this.dispatchEvent(a)
  16772. };
  16773. a.prototype.loadItem = function(a) {
  16774. this.lazyLoadList.push(a);
  16775. a.groupName = "";
  16776. this.next()
  16777. };
  16778. a.prototype.next = function() {
  16779. var a = this.getOneResourceItem();
  16780. if (a)
  16781. if (a.loaded) this.onItemComplete(a);
  16782. else {
  16783. var d = this.analyzerDic[a.type];
  16784. d || (d = this.analyzerDic[a.type] = egret.Injector.getInstance(c.AnalyzerBase,
  16785. a.type));
  16786. d.loadFile(a, this.onItemComplete, this)
  16787. }
  16788. };
  16789. a.prototype.getOneResourceItem = function() {
  16790. var a = Number.NEGATIVE_INFINITY,
  16791. c;
  16792. for (c in this.priorityQueue) a = Math.max(a, c);
  16793. a = this.priorityQueue[a];
  16794. if (!a || 0 == a.length) return 0 == this.lazyLoadList.length ? null : this.lazyLoadList.pop();
  16795. c = a.length;
  16796. for (var d, e = 0; e < c; e++) {
  16797. this.queueIndex >= c && (this.queueIndex = 0);
  16798. d = this.itemListDic[a[this.queueIndex]];
  16799. if (0 < d.length) break;
  16800. this.queueIndex++
  16801. }
  16802. return 0 == d.length ? null : d.shift()
  16803. };
  16804. a.prototype.onItemComplete = function(a) {
  16805. var d =
  16806. a.groupName;
  16807. a.loaded || c.ResourceEvent.dispatchResourceEvent(this.resInstance, c.ResourceEvent.ITEM_LOAD_ERROR, d, a);
  16808. if (d) {
  16809. this.numLoadedDic[d]++;
  16810. var e = this.numLoadedDic[d],
  16811. m = this.groupTotalDic[d];
  16812. c.ResourceEvent.dispatchResourceEvent(this.resInstance, c.ResourceEvent.GROUP_PROGRESS, d, a, e, m);
  16813. e == m && (this.removeGroupName(d), delete this.groupTotalDic[d], delete this.numLoadedDic[d], delete this.itemListDic[d], c.ResourceEvent.dispatchResourceEvent(this, c.ResourceEvent.GROUP_COMPLETE, d))
  16814. } else this.callBack.call(this.resInstance,
  16815. a);
  16816. this.next()
  16817. };
  16818. a.prototype.removeGroupName = function(a) {
  16819. for (var c in this.priorityQueue) {
  16820. for (var d = this.priorityQueue[c], e = d.length, f = 0, g = !1, e = d.length, k = 0; k < e; k++) {
  16821. if (d[k] == a) {
  16822. d.splice(f, 1);
  16823. g = !0;
  16824. break
  16825. }
  16826. f++
  16827. }
  16828. if (g) {
  16829. 0 == d.length && delete this.priorityQueue[c];
  16830. break
  16831. }
  16832. }
  16833. };
  16834. return a
  16835. }(egret.EventDispatcher);
  16836. c.ResourceLoader = e
  16837. })(RES || (RES = {}));
  16838. __extends = this.__extends || function(c, e) {
  16839. function d() {
  16840. this.constructor = c
  16841. }
  16842. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  16843. d.prototype = e.prototype;
  16844. c.prototype = new d
  16845. };
  16846. (function(c) {
  16847. var e = function(c) {
  16848. function a() {
  16849. c.call(this)
  16850. }
  16851. __extends(a, c);
  16852. a.prototype.loadFile = function(a, c, d) {};
  16853. a.prototype.getRes = function(a) {};
  16854. a.prototype.destroyRes = function(a) {
  16855. return !1
  16856. };
  16857. a.getStringPrefix = function(a) {
  16858. if (!a) return "";
  16859. var c = a.indexOf(".");
  16860. return -1 != c ? a.substring(0, c) : ""
  16861. };
  16862. a.getStringTail = function(a) {
  16863. if (!a) return "";
  16864. var c = a.indexOf(".");
  16865. return -1 != c ? a.substring(c + 1) : ""
  16866. };
  16867. return a
  16868. }(egret.HashObject);
  16869. c.AnalyzerBase = e
  16870. })(RES || (RES = {}));
  16871. __extends = this.__extends || function(c, e) {
  16872. function d() {
  16873. this.constructor = c
  16874. }
  16875. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  16876. d.prototype = e.prototype;
  16877. c.prototype = new d
  16878. };
  16879. (function(c) {
  16880. var e = function(c) {
  16881. function a() {
  16882. c.call(this);
  16883. this.fileDic = {};
  16884. this.resItemDic = [];
  16885. this._dataFormat = egret.URLLoaderDataFormat.BINARY;
  16886. this.recycler = new egret.Recycler
  16887. }
  16888. __extends(a, c);
  16889. a.prototype.loadFile = function(a, c, d) {
  16890. if (this.fileDic[a.name]) c.call(d, a);
  16891. else {
  16892. var e = this.getLoader();
  16893. this.resItemDic[e.hashCode] = {
  16894. item: a,
  16895. func: c,
  16896. thisObject: d
  16897. };
  16898. e.load(new egret.URLRequest(a.url))
  16899. }
  16900. };
  16901. a.prototype.getLoader = function() {
  16902. var a = this.recycler.pop();
  16903. a || (a = new egret.URLLoader, a.addEventListener(egret.Event.COMPLETE,
  16904. this.onLoadFinish, this), a.addEventListener(egret.IOErrorEvent.IO_ERROR, this.onLoadFinish, this));
  16905. a.dataFormat = this._dataFormat;
  16906. return a
  16907. };
  16908. a.prototype.onLoadFinish = function(a) {
  16909. var c = a.target,
  16910. d = this.resItemDic[c.hashCode];
  16911. delete this.resItemDic[c.hashCode];
  16912. this.recycler.push(c);
  16913. var e = d.item,
  16914. f = d.func;
  16915. e.loaded = a.type == egret.Event.COMPLETE;
  16916. e.loaded && this.analyzeData(e, c.data);
  16917. f.call(d.thisObject, e)
  16918. };
  16919. a.prototype.analyzeData = function(a, c) {
  16920. var d = a.name;
  16921. !this.fileDic[d] && c && (this.fileDic[d] = c)
  16922. };
  16923. a.prototype.getRes =
  16924. function(a) {
  16925. return this.fileDic[a]
  16926. };
  16927. a.prototype.hasRes = function(a) {
  16928. return null != this.getRes(a)
  16929. };
  16930. a.prototype.destroyRes = function(a) {
  16931. return this.fileDic[a] ? (delete this.fileDic[a], !0) : !1
  16932. };
  16933. return a
  16934. }(c.AnalyzerBase);
  16935. c.BinAnalyzer = e
  16936. })(RES || (RES = {}));
  16937. __extends = this.__extends || function(c, e) {
  16938. function d() {
  16939. this.constructor = c
  16940. }
  16941. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  16942. d.prototype = e.prototype;
  16943. c.prototype = new d
  16944. };
  16945. (function(c) {
  16946. var e = function(c) {
  16947. function a() {
  16948. c.call(this);
  16949. this._dataFormat = egret.URLLoaderDataFormat.TEXTURE
  16950. }
  16951. __extends(a, c);
  16952. a.prototype.analyzeData = function(a, c) {
  16953. var d = a.name;
  16954. !this.fileDic[d] && c && (this.fileDic[d] = c, (d = a.data) && d.scale9grid && (d = d.scale9grid.split(","), c.scale9Grid = new egret.Rectangle(parseInt(d[0]), parseInt(d[1]), parseInt(d[2]), parseInt(d[3]))))
  16955. };
  16956. return a
  16957. }(c.BinAnalyzer);
  16958. c.ImageAnalyzer = e
  16959. })(RES || (RES = {}));
  16960. __extends = this.__extends || function(c, e) {
  16961. function d() {
  16962. this.constructor = c
  16963. }
  16964. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  16965. d.prototype = e.prototype;
  16966. c.prototype = new d
  16967. };
  16968. (function(c) {
  16969. var e = function(c) {
  16970. function a() {
  16971. c.call(this);
  16972. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  16973. }
  16974. __extends(a, c);
  16975. a.prototype.analyzeData = function(a, c) {
  16976. var d = a.name;
  16977. if (!this.fileDic[d] && c) try {
  16978. this.fileDic[d] = JSON.parse(c)
  16979. } catch (e) {}
  16980. };
  16981. return a
  16982. }(c.BinAnalyzer);
  16983. c.JsonAnalyzer = e
  16984. })(RES || (RES = {}));
  16985. __extends = this.__extends || function(c, e) {
  16986. function d() {
  16987. this.constructor = c
  16988. }
  16989. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  16990. d.prototype = e.prototype;
  16991. c.prototype = new d
  16992. };
  16993. (function(c) {
  16994. var e = function(c) {
  16995. function a() {
  16996. c.call(this);
  16997. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  16998. }
  16999. __extends(a, c);
  17000. return a
  17001. }(c.BinAnalyzer);
  17002. c.TextAnalyzer = e
  17003. })(RES || (RES = {}));
  17004. __extends = this.__extends || function(c, e) {
  17005. function d() {
  17006. this.constructor = c
  17007. }
  17008. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  17009. d.prototype = e.prototype;
  17010. c.prototype = new d
  17011. };
  17012. (function(c) {
  17013. var e = function(d) {
  17014. function a() {
  17015. d.call(this);
  17016. this.sheetMap = {};
  17017. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  17018. }
  17019. __extends(a, d);
  17020. a.prototype.getRes = function(a) {
  17021. var d = this.fileDic[a];
  17022. !d && (d = c.AnalyzerBase.getStringPrefix(a), d = this.fileDic[d]) && (a = c.AnalyzerBase.getStringTail(a), d = d.getTexture(a));
  17023. return d
  17024. };
  17025. a.prototype.onLoadFinish = function(a) {
  17026. var c = a.target,
  17027. d = this.resItemDic[c.hashCode];
  17028. delete this.resItemDic[c.hashCode];
  17029. this.recycler.push(c);
  17030. var e = d.item,
  17031. f = d.func;
  17032. e.loaded = a.type == egret.Event.COMPLETE;
  17033. e.loaded && this.analyzeData(e, c.data);
  17034. "string" == typeof c.data ? (this._dataFormat = egret.URLLoaderDataFormat.TEXTURE, this.loadFile(e, f, d.thisObject), this._dataFormat = egret.URLLoaderDataFormat.TEXT) : f.call(d.thisObject, e)
  17035. };
  17036. a.prototype.analyzeData = function(a, c) {
  17037. var d = a.name;
  17038. if (!this.fileDic[d] && c) {
  17039. var e;
  17040. if ("string" == typeof c) {
  17041. try {
  17042. e = JSON.parse(c)
  17043. } catch (f) {}
  17044. e && (this.sheetMap[d] = e, a.loaded = !1, a.url = this.getRelativePath(a.url, e.file))
  17045. } else e = this.sheetMap[d], delete this.sheetMap[d], c && (e = this.parseSpriteSheet(c,
  17046. e), this.fileDic[d] = e)
  17047. }
  17048. };
  17049. a.prototype.getRelativePath = function(a, c) {
  17050. a = a.split("\\").join("/");
  17051. var d = a.lastIndexOf("/");
  17052. return a = -1 != d ? a.substring(0, d + 1) + c : c
  17053. };
  17054. a.prototype.parseSpriteSheet = function(a, c) {
  17055. var d = c.frames;
  17056. if (!d) return null;
  17057. var e = new egret.SpriteSheet(a),
  17058. f;
  17059. for (f in d) {
  17060. var g = d[f];
  17061. e.createTexture(f, g.x, g.y, g.w, g.h)
  17062. }
  17063. return e
  17064. };
  17065. return a
  17066. }(c.BinAnalyzer);
  17067. c.SheetAnalyzer = e
  17068. })(RES || (RES = {}));
  17069. __extends = this.__extends || function(c, e) {
  17070. function d() {
  17071. this.constructor = c
  17072. }
  17073. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  17074. d.prototype = e.prototype;
  17075. c.prototype = new d
  17076. };
  17077. (function(c) {
  17078. var e = function(c) {
  17079. function a() {
  17080. c.call(this)
  17081. }
  17082. __extends(a, c);
  17083. a.prototype.analyzeData = function(a, c) {
  17084. var d = a.name;
  17085. if (!this.fileDic[d] && c) {
  17086. var e;
  17087. "string" == typeof c ? (e = c, this.sheetMap[d] = e, a.loaded = !1, a.url = this.getTexturePath(a.url, e)) : (e = this.sheetMap[d], delete this.sheetMap[d], c && (e = new egret.BitmapTextSpriteSheet(c, e), this.fileDic[d] = e))
  17088. }
  17089. };
  17090. a.prototype.getTexturePath = function(a, c) {
  17091. var d = "",
  17092. e = c.split("\n")[2],
  17093. f = e.indexOf('file="'); - 1 != f && (e = e.substring(f + 6), f = e.indexOf('"'), d = e.substring(0,
  17094. f));
  17095. a = a.split("\\").join("/");
  17096. f = a.lastIndexOf("/");
  17097. return a = -1 != f ? a.substring(0, f + 1) + d : d
  17098. };
  17099. return a
  17100. }(c.SheetAnalyzer);
  17101. c.FontAnalyzer = e
  17102. })(RES || (RES = {}));
  17103. __extends = this.__extends || function(c, e) {
  17104. function d() {
  17105. this.constructor = c
  17106. }
  17107. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  17108. d.prototype = e.prototype;
  17109. c.prototype = new d
  17110. };
  17111. (function(c) {
  17112. var e = function(c) {
  17113. function a() {
  17114. c.call(this);
  17115. this._dataFormat = egret.URLLoaderDataFormat.SOUND
  17116. }
  17117. __extends(a, c);
  17118. return a
  17119. }(c.BinAnalyzer);
  17120. c.SoundAnalyzer = e
  17121. })(RES || (RES = {}));
  17122. __extends = this.__extends || function(c, e) {
  17123. function d() {
  17124. this.constructor = c
  17125. }
  17126. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  17127. d.prototype = e.prototype;
  17128. c.prototype = new d
  17129. };
  17130. (function(c) {
  17131. var e = function(c) {
  17132. function a() {
  17133. c.call(this);
  17134. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  17135. }
  17136. __extends(a, c);
  17137. a.prototype.analyzeData = function(a, c) {
  17138. var d = a.name;
  17139. if (!this.fileDic[d] && c) try {
  17140. var e = egret.XML.parse(c);
  17141. this.fileDic[d] = e
  17142. } catch (f) {}
  17143. };
  17144. return a
  17145. }(c.BinAnalyzer);
  17146. c.XMLAnalyzer = e
  17147. })(RES || (RES = {}));
  17148. __extends = this.__extends || function(c, e) {
  17149. function d() {
  17150. this.constructor = c
  17151. }
  17152. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  17153. d.prototype = e.prototype;
  17154. c.prototype = new d
  17155. };
  17156. (function(c) {
  17157. c.loadConfig = function(c, a) {
  17158. "undefined" === typeof a && (a = "");
  17159. e.loadConfig(c, a)
  17160. };
  17161. c.loadGroup = function(c, a) {
  17162. "undefined" === typeof a && (a = 0);
  17163. e.loadGroup(c, a)
  17164. };
  17165. c.isGroupLoaded = function(c) {
  17166. return e.isGroupLoaded(c)
  17167. };
  17168. c.getGroupByName = function(c) {
  17169. return e.getGroupByName(c)
  17170. };
  17171. c.createGroup = function(c, a, b) {
  17172. "undefined" === typeof b && (b = !1);
  17173. return e.createGroup(c, a, b)
  17174. };
  17175. c.hasRes = function(c) {
  17176. return e.hasRes(c)
  17177. };
  17178. c.getRes = function(c) {
  17179. return e.getRes(c)
  17180. };
  17181. c.getResAsync = function(c, a, b) {
  17182. e.getResAsync(c, a, b)
  17183. };
  17184. c.getResByUrl =
  17185. function(c, a, b, h) {
  17186. "undefined" === typeof h && (h = "");
  17187. e.getResByUrl(c, a, b, h)
  17188. };
  17189. c.destroyRes = function(c) {
  17190. return e.destroyRes(c)
  17191. };
  17192. c.addEventListener = function(c, a, b, h, l) {
  17193. "undefined" === typeof h && (h = !1);
  17194. "undefined" === typeof l && (l = 0);
  17195. e.addEventListener(c, a, b, h, l)
  17196. };
  17197. c.removeEventListener = function(c, a, b, h) {
  17198. "undefined" === typeof h && (h = !1);
  17199. e.removeEventListener(c, a, b, h)
  17200. };
  17201. var e = new(function(d) {
  17202. function a() {
  17203. d.call(this);
  17204. this.analyzerDic = {};
  17205. this.configComplete = !1;
  17206. this.loadedGroups = [];
  17207. this.groupNameList = [];
  17208. this.asyncDic = {};
  17209. this.init()
  17210. }
  17211. __extends(a, d);
  17212. a.prototype.getAnalyzerByType = function(a) {
  17213. var d = this.analyzerDic[a];
  17214. d || (d = this.analyzerDic[a] = egret.Injector.getInstance(c.AnalyzerBase, a));
  17215. return d
  17216. };
  17217. a.prototype.init = function() {
  17218. egret.Injector.hasMapRule(c.AnalyzerBase, c.ResourceItem.TYPE_BIN) || egret.Injector.mapClass(c.AnalyzerBase, c.BinAnalyzer, c.ResourceItem.TYPE_BIN);
  17219. egret.Injector.hasMapRule(c.AnalyzerBase, c.ResourceItem.TYPE_IMAGE) || egret.Injector.mapClass(c.AnalyzerBase, c.ImageAnalyzer, c.ResourceItem.TYPE_IMAGE);
  17220. egret.Injector.hasMapRule(c.AnalyzerBase, c.ResourceItem.TYPE_TEXT) || egret.Injector.mapClass(c.AnalyzerBase, c.TextAnalyzer, c.ResourceItem.TYPE_TEXT);
  17221. egret.Injector.hasMapRule(c.AnalyzerBase, c.ResourceItem.TYPE_JSON) || egret.Injector.mapClass(c.AnalyzerBase, c.JsonAnalyzer, c.ResourceItem.TYPE_JSON);
  17222. egret.Injector.hasMapRule(c.AnalyzerBase, c.ResourceItem.TYPE_SHEET) || egret.Injector.mapClass(c.AnalyzerBase, c.SheetAnalyzer, c.ResourceItem.TYPE_SHEET);
  17223. egret.Injector.hasMapRule(c.AnalyzerBase, c.ResourceItem.TYPE_FONT) ||
  17224. egret.Injector.mapClass(c.AnalyzerBase, c.FontAnalyzer, c.ResourceItem.TYPE_FONT);
  17225. egret.Injector.hasMapRule(c.AnalyzerBase, c.ResourceItem.TYPE_SOUND) || egret.Injector.mapClass(c.AnalyzerBase, c.SoundAnalyzer, c.ResourceItem.TYPE_SOUND);
  17226. egret.Injector.hasMapRule(c.AnalyzerBase, c.ResourceItem.TYPE_XML) || egret.Injector.mapClass(c.AnalyzerBase, c.XMLAnalyzer, c.ResourceItem.TYPE_XML);
  17227. this.resConfig = new c.ResourceConfig;
  17228. this.resLoader = new c.ResourceLoader;
  17229. this.resLoader.callBack = this.onResourceItemComp;
  17230. this.resLoader.resInstance =
  17231. this;
  17232. this.resLoader.addEventListener(c.ResourceEvent.GROUP_COMPLETE, this.onGroupComp, this)
  17233. };
  17234. a.prototype.loadConfig = function(b, d) {
  17235. this.configURL = b;
  17236. this.resourceRoot = d;
  17237. var e = [new c.ResourceItem(b, b, c.ResourceItem.TYPE_JSON)];
  17238. this.resLoader.loadGroup(e, a.GROUP_CONFIG, Number.MAX_VALUE)
  17239. };
  17240. a.prototype.isGroupLoaded = function(a) {
  17241. return -1 != this.loadedGroups.indexOf(a)
  17242. };
  17243. a.prototype.getGroupByName = function(a) {
  17244. return this.resConfig.getGroupByName(a)
  17245. };
  17246. a.prototype.loadGroup = function(a, c) {
  17247. "undefined" === typeof c &&
  17248. (c = 0);
  17249. if (-1 == this.loadedGroups.indexOf(a) && !this.resLoader.isGroupInLoading(a))
  17250. if (this.configComplete) {
  17251. var d = this.resConfig.getGroupByName(a);
  17252. this.resLoader.loadGroup(d, a, c)
  17253. } else this.groupNameList.push({
  17254. name: a,
  17255. priority: c
  17256. })
  17257. };
  17258. a.prototype.createGroup = function(a, c, d) {
  17259. "undefined" === typeof d && (d = !1);
  17260. return this.resConfig.createGroup(a, c, d)
  17261. };
  17262. a.prototype.onGroupComp = function(b) {
  17263. if (b.groupName == a.GROUP_CONFIG) {
  17264. b = this.getAnalyzerByType(c.ResourceItem.TYPE_JSON);
  17265. var d = b.getRes(this.configURL);
  17266. b.destroyRes(this.configURL);
  17267. this.resConfig.parseConfig(d, this.resourceRoot);
  17268. this.configComplete = !0;
  17269. c.ResourceEvent.dispatchResourceEvent(this, c.ResourceEvent.CONFIG_COMPLETE);
  17270. b = this.groupNameList;
  17271. for (var d = b.length, e = 0; e < d; e++) {
  17272. var m = b[e];
  17273. this.loadGroup(m.name, m.priority)
  17274. }
  17275. this.groupNameList = []
  17276. } else this.loadedGroups.push(b.groupName), this.dispatchEvent(b)
  17277. };
  17278. a.prototype.hasRes = function(a) {
  17279. var d = this.resConfig.getType(a);
  17280. return "" == d && (a = c.AnalyzerBase.getStringPrefix(a), d = this.resConfig.getType(a), "" == d) ? !1 : !0
  17281. };
  17282. a.prototype.getRes =
  17283. function(a) {
  17284. var d = this.resConfig.getType(a);
  17285. return "" == d && (d = c.AnalyzerBase.getStringPrefix(a), d = this.resConfig.getType(d), "" == d) ? null : this.getAnalyzerByType(d).getRes(a)
  17286. };
  17287. a.prototype.getResAsync = function(a, d, e) {
  17288. var m = this.resConfig.getType(a),
  17289. f = a;
  17290. if ("" == m && (f = c.AnalyzerBase.getStringPrefix(a), m = this.resConfig.getType(f), "" == m)) {
  17291. d.call(e, null);
  17292. return
  17293. }(m = this.getAnalyzerByType(m).getRes(a)) ? d.call(e, m): (a = {
  17294. name: a,
  17295. compFunc: d,
  17296. thisObject: e
  17297. }, this.asyncDic[f] ? this.asyncDic[f].push(a) : (this.asyncDic[f] = [a],
  17298. f = this.resConfig.getResourceItem(f), this.resLoader.loadItem(f)))
  17299. };
  17300. a.prototype.getResByUrl = function(a, d, e, m) {
  17301. "undefined" === typeof m && (m = "");
  17302. if (a) {
  17303. m || (m = this.getTypeByUrl(a));
  17304. var f = this.getAnalyzerByType(m).getRes(a);
  17305. f ? d.call(e, f) : (d = {
  17306. name: a,
  17307. compFunc: d,
  17308. thisObject: e
  17309. }, this.asyncDic[a] ? this.asyncDic[a].push(d) : (this.asyncDic[a] = [d], a = new c.ResourceItem(a, a, m), this.resLoader.loadItem(a)))
  17310. } else d.call(e, null)
  17311. };
  17312. a.prototype.getTypeByUrl = function(a) {
  17313. a = a.substr(a.lastIndexOf(".") + 1);
  17314. switch (a) {
  17315. case c.ResourceItem.TYPE_XML:
  17316. case c.ResourceItem.TYPE_JSON:
  17317. case c.ResourceItem.TYPE_SHEET:
  17318. break;
  17319. case "png":
  17320. case "jpg":
  17321. case "gif":
  17322. a = c.ResourceItem.TYPE_IMAGE;
  17323. break;
  17324. case "fnt":
  17325. a = c.ResourceItem.TYPE_FONT;
  17326. break;
  17327. case "txt":
  17328. a = c.ResourceItem.TYPE_TEXT;
  17329. break;
  17330. default:
  17331. a = c.ResourceItem.TYPE_BIN
  17332. }
  17333. return a
  17334. };
  17335. a.prototype.onResourceItemComp = function(a) {
  17336. var c = this.asyncDic[a.name];
  17337. delete this.asyncDic[a.name];
  17338. a = this.getAnalyzerByType(a.type);
  17339. for (var d = c.length, e = 0; e < d; e++) {
  17340. var f = c[e],
  17341. g = a.getRes(f.name);
  17342. f.compFunc.call(f.thisObject, g)
  17343. }
  17344. };
  17345. a.prototype.destroyRes = function(a) {
  17346. var c = this.resConfig.getRawGroupByName(a);
  17347. if (c) {
  17348. var d = this.loadedGroups.indexOf(a); - 1 != d && this.loadedGroups.splice(d, 1);
  17349. a = c.length;
  17350. for (var e = 0; e < a; e++) {
  17351. d = c[e];
  17352. d.loaded = !1;
  17353. var f = this.getAnalyzerByType(d.type);
  17354. f.destroyRes(d.name)
  17355. }
  17356. return !0
  17357. }
  17358. c = this.resConfig.getType(a);
  17359. if ("" == c) return !1;
  17360. d = this.resConfig.getRawResourceItem(a);
  17361. d.loaded = !1;
  17362. f = this.getAnalyzerByType(c);
  17363. return f.destroyRes(a)
  17364. };
  17365. a.GROUP_CONFIG = "RES__CONFIG";
  17366. return a
  17367. }(egret.EventDispatcher))
  17368. })(RES || (RES = {}));
  17369. __extends = this.__extends || function(c, e) {
  17370. function d() {
  17371. this.constructor = c
  17372. }
  17373. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  17374. d.prototype = e.prototype;
  17375. c.prototype = new d
  17376. };
  17377. (function(c) {
  17378. var e = function(d) {
  17379. function a() {
  17380. d.call(this);
  17381. this._time = 0;
  17382. this.frameRate = 60;
  17383. a.instance = this;
  17384. this.registerListener()
  17385. }
  17386. __extends(a, d);
  17387. a.prototype.enterFrame = function() {
  17388. var b = a.instance,
  17389. d = a._thisObject,
  17390. e = a._callback,
  17391. m = c.getTimer();
  17392. e.call(d, m - b._time);
  17393. b._time = m;
  17394. b._requestAnimationId = a.requestAnimationFrame.call(window, a.prototype.enterFrame)
  17395. };
  17396. a.prototype.executeMainLoop = function(b, c) {
  17397. a._callback = b;
  17398. a._thisObject = c;
  17399. this.enterFrame()
  17400. };
  17401. a.prototype.reset = function() {
  17402. var b = a.instance;
  17403. b._requestAnimationId &&
  17404. (b._time = c.getTimer(), a.cancelAnimationFrame.call(window, b._requestAnimationId));
  17405. b.enterFrame()
  17406. };
  17407. a.prototype.registerListener = function() {
  17408. window.onfocus = function() {
  17409. a.instance.reset()
  17410. };
  17411. window.onblur = function() {}
  17412. };
  17413. a.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(a) {
  17414. return window.setTimeout(a, 1E3 / 60)
  17415. };
  17416. a.cancelAnimationFrame = window.cancelAnimationFrame || window.msCancelAnimationFrame ||
  17417. window.mozCancelAnimationFrame || window.webkitCancelAnimationFrame || window.oCancelAnimationFrame || window.cancelRequestAnimationFrame || window.msCancelRequestAnimationFrame || window.mozCancelRequestAnimationFrame || window.oCancelRequestAnimationFrame || window.webkitCancelRequestAnimationFrame || function(a) {
  17418. return window.clearTimeout(a)
  17419. };
  17420. return a
  17421. }(c.DeviceContext);
  17422. c.HTML5DeviceContext = e
  17423. })(egret || (egret = {}));
  17424. __extends = this.__extends || function(c, e) {
  17425. function d() {
  17426. this.constructor = c
  17427. }
  17428. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  17429. d.prototype = e.prototype;
  17430. c.prototype = new d
  17431. };
  17432. (function(c) {
  17433. var e = function(d) {
  17434. function a(a) {
  17435. this.canvas = a;
  17436. this.canvasContext = a.getContext("2d");
  17437. var c = this.canvasContext.setTransform,
  17438. e = this;
  17439. this.canvasContext.setTransform = function(a, b, d, k, n, p) {
  17440. e._matrixA = a;
  17441. e._matrixB = b;
  17442. e._matrixC = d;
  17443. e._matrixD = k;
  17444. e._matrixTx = n;
  17445. e._matrixTy = p;
  17446. c.call(e.canvasContext, a, b, d, k, n, p)
  17447. };
  17448. this._matrixA = 1;
  17449. this._matrixC = this._matrixB = 0;
  17450. this._matrixD = 1;
  17451. this._transformTy = this._transformTx = this._matrixTy = this._matrixTx = 0;
  17452. d.call(this)
  17453. }
  17454. __extends(a, d);
  17455. a.prototype.clearScreen = function() {
  17456. this.setTransform(c.Matrix.identity.identity());
  17457. for (var a = c.RenderFilter.getInstance().getDrawAreaList(), d = 0, e = a.length; d < e; d++) {
  17458. var m = a[d];
  17459. this.clearRect(m.x + this._transformTx, m.y + this._transformTy, m.width, m.height)
  17460. }
  17461. this.renderCost = 0
  17462. };
  17463. a.prototype.clearRect = function(a, c, d, e) {
  17464. this.canvasContext.clearRect(a, c, d, e)
  17465. };
  17466. a.prototype.drawImage = function(a, e, l, m, f, g, k, n, p) {
  17467. e /= c.MainContext.instance.rendererContext.texture_scale_factor;
  17468. l /= c.MainContext.instance.rendererContext.texture_scale_factor;
  17469. m /= c.MainContext.instance.rendererContext.texture_scale_factor;
  17470. f /= c.MainContext.instance.rendererContext.texture_scale_factor;
  17471. a = a._bitmapData;
  17472. g += this._transformTx;
  17473. k += this._transformTy;
  17474. var q = c.getTimer();
  17475. this.canvasContext.drawImage(a, e, l, m, f, g, k, n, p);
  17476. d.prototype.drawImage.call(this, a, e, l, m, f, g, k, n, p);
  17477. this.renderCost += c.getTimer() - q
  17478. };
  17479. a.prototype.setTransform = function(a) {
  17480. 1 == a.a && 0 == a.b && 0 == a.c && 1 == a.d && 1 == this._matrixA && 0 == this._matrixB && 0 == this._matrixC && 1 == this._matrixD ? (this._transformTx = a.tx - this._matrixTx, this._transformTy = a.ty - this._matrixTy) : (this._transformTx =
  17481. this._transformTy = 0, this._matrixA == a.a && this._matrixB == a.b && this._matrixC == a.c && this._matrixD == a.d && this._matrixTx == a.tx && this._matrixTy == a.ty || this.canvasContext.setTransform(a.a, a.b, a.c, a.d, a.tx, a.ty))
  17482. };
  17483. a.prototype.save = function() {
  17484. this.canvasContext.save()
  17485. };
  17486. a.prototype.restore = function() {
  17487. this.canvasContext.restore();
  17488. this.canvasContext.setTransform(1, 0, 0, 1, 0, 0)
  17489. };
  17490. a.prototype.setAlpha = function(a, d) {
  17491. a != this.canvasContext.globalAlpha && (this.canvasContext.globalAlpha = a);
  17492. d ? (this.blendValue = d.value, this.canvasContext.globalCompositeOperation =
  17493. d.value) : this.blendValue != c.BlendMode.NORMAL.value && (this.blendValue = c.BlendMode.NORMAL.value, this.canvasContext.globalCompositeOperation = c.BlendMode.NORMAL.value)
  17494. };
  17495. a.prototype.setupFont = function(a) {
  17496. var c = this.canvasContext,
  17497. d = a.italic ? "italic " : "normal ",
  17498. d = d + (a.bold ? "bold " : "normal "),
  17499. d = d + (a.size + "px " + a.fontFamily);
  17500. c.font = d;
  17501. c.textAlign = "left";
  17502. c.textBaseline = "middle"
  17503. };
  17504. a.prototype.measureText = function(a) {
  17505. return this.canvasContext.measureText(a).width
  17506. };
  17507. a.prototype.drawText = function(a, c, e, m, f) {
  17508. var g =
  17509. a._strokeColorString,
  17510. k = a.stroke,
  17511. n = this.canvasContext;
  17512. n.fillStyle = a._textColorString;
  17513. n.strokeStyle = g;
  17514. k && (n.lineWidth = 2 * k, n.strokeText(c, e + this._transformTx, m + this._transformTy, f || 65535));
  17515. n.fillText(c, e + this._transformTx, m + this._transformTy, f || 65535);
  17516. d.prototype.drawText.call(this, a, c, e, m, f)
  17517. };
  17518. a.prototype.clip = function(a, c, d, e) {};
  17519. a.prototype.strokeRect = function(a, c, d, e, f) {
  17520. this.canvasContext.strokeStyle = f;
  17521. this.canvasContext.strokeRect(a, c, d, e)
  17522. };
  17523. a.prototype.pushMask = function(a) {
  17524. this.canvasContext.save();
  17525. this.canvasContext.beginPath();
  17526. this.canvasContext.rect(a.x + this._transformTx, a.y + this._transformTy, a.width, a.height);
  17527. this.canvasContext.clip();
  17528. this.canvasContext.closePath()
  17529. };
  17530. a.prototype.popMask = function() {
  17531. this.canvasContext.restore();
  17532. this.canvasContext.setTransform(1, 0, 0, 1, 0, 0)
  17533. };
  17534. return a
  17535. }(c.RendererContext);
  17536. c.HTML5CanvasRenderer = e
  17537. })(egret || (egret = {}));
  17538. var egret_h5_graphics;
  17539. (function(c) {
  17540. c.beginFill = function(c, a) {
  17541. "undefined" === typeof a && (a = 1);
  17542. var b = "rgba(" + (c >> 16) + "," + ((c & 65280) >> 8) + "," + (c & 255) + "," + a + ")";
  17543. this.fillStyleColor = b;
  17544. this.commandQueue.push(new e(this._setStyle, this, [b]))
  17545. };
  17546. c.drawRect = function(c, a, b, h) {
  17547. this.commandQueue.push(new e(function(a, b, c, d) {
  17548. var e = this.renderContext;
  17549. this.canvasContext.beginPath();
  17550. this.canvasContext.rect(e._transformTx + a, e._transformTy + b, c, d);
  17551. this.canvasContext.closePath()
  17552. }, this, [c, a, b, h]));
  17553. this._fill()
  17554. };
  17555. c.drawCircle = function(c, a, b) {
  17556. this.commandQueue.push(new e(function(a,
  17557. b, c) {
  17558. var d = this.renderContext;
  17559. this.canvasContext.beginPath();
  17560. this.canvasContext.arc(d._transformTx + a, d._transformTy + b, c, 0, 2 * Math.PI);
  17561. this.canvasContext.closePath()
  17562. }, this, [c, a, b]));
  17563. this._fill()
  17564. };
  17565. c.lineStyle = function(c, a, b, h, l, m, f, g) {
  17566. "undefined" === typeof c && (c = NaN);
  17567. "undefined" === typeof a && (a = 0);
  17568. "undefined" === typeof b && (b = 1);
  17569. "undefined" === typeof h && (h = !1);
  17570. "undefined" === typeof l && (l = "normal");
  17571. "undefined" === typeof m && (m = null);
  17572. "undefined" === typeof f && (f = null);
  17573. "undefined" === typeof g && (g = 3);
  17574. this.strokeStyleColor &&
  17575. (this.createEndLineCommand(), this.commandQueue.push(this.endLineCommand));
  17576. this.strokeStyleColor = a = "rgba(" + (a >> 16) + "," + ((a & 65280) >> 8) + "," + (a & 255) + "," + b + ")";
  17577. this.commandQueue.push(new e(function(a, b) {
  17578. this.canvasContext.lineWidth = a;
  17579. this.canvasContext.strokeStyle = b;
  17580. this.canvasContext.beginPath()
  17581. }, this, [c, a]));
  17582. "undefined" === typeof this.lineX && (this.lineY = this.lineX = 0);
  17583. this.moveTo(this.lineX, this.lineY)
  17584. };
  17585. c.lineTo = function(c, a) {
  17586. this.commandQueue.push(new e(function(a, c) {
  17587. var d = this.renderContext;
  17588. this.canvasContext.lineTo(d._transformTx +
  17589. a, d._transformTy + c)
  17590. }, this, [c, a]));
  17591. this.lineX = c;
  17592. this.lineY = a
  17593. };
  17594. c.curveTo = function(c, a, b, h) {
  17595. this.commandQueue.push(new e(function(a, b, c, d) {
  17596. var e = this.renderContext;
  17597. this.canvasContext.quadraticCurveTo(e._transformTx + a, e._transformTy + b, c, d)
  17598. }, this, [c, a, b, h]));
  17599. this.lineX = b;
  17600. this.lineY = h
  17601. };
  17602. c.moveTo = function(c, a) {
  17603. this.commandQueue.push(new e(function(a, c) {
  17604. var d = this.renderContext;
  17605. this.canvasContext.moveTo(d._transformTx + a, d._transformTy + c)
  17606. }, this, [c, a]))
  17607. };
  17608. c.clear = function() {
  17609. this.lineY = this.lineX = this.commandQueue.length =
  17610. 0;
  17611. this.fillStyleColor = this.strokeStyleColor = null
  17612. };
  17613. c.createEndFillCommand = function() {
  17614. this.endFillCommand || (this.endFillCommand = new e(function() {
  17615. this.canvasContext.fill()
  17616. }, this, null))
  17617. };
  17618. c.endFill = function() {
  17619. this.fillStyleColor = null
  17620. };
  17621. c._fill = function() {
  17622. this.fillStyleColor && (this.createEndFillCommand(), this.commandQueue.push(this.endFillCommand))
  17623. };
  17624. c.createEndLineCommand = function() {
  17625. this.endLineCommand || (this.endLineCommand = new e(function() {
  17626. this.canvasContext.stroke();
  17627. this.canvasContext.closePath()
  17628. }, this,
  17629. null))
  17630. };
  17631. c._draw = function(c) {
  17632. this.renderContext = c;
  17633. c = this.canvasContext = this.renderContext.canvasContext;
  17634. c.save();
  17635. var a = this.commandQueue.length;
  17636. this.strokeStyleColor && 0 < a && this.commandQueue[a - 1] != this.endLineCommand && (this.createEndLineCommand(), this.commandQueue.push(this.endLineCommand));
  17637. for (var b = 0; b < a; b++) {
  17638. var e = this.commandQueue[b];
  17639. e.method.apply(e.thisObject, e.args)
  17640. }
  17641. c.restore()
  17642. };
  17643. var e = function() {
  17644. return function(c, a, b) {
  17645. this.method = c;
  17646. this.thisObject = a;
  17647. this.args = b
  17648. }
  17649. }();
  17650. c._setStyle = function(c) {
  17651. this.canvasContext.fillStyle =
  17652. c
  17653. };
  17654. c.init = function() {
  17655. for (var d in c) egret.Graphics.prototype[d] = c[d];
  17656. egret.RendererContext.createRendererContext = function(a) {
  17657. return new egret.HTML5CanvasRenderer(a)
  17658. }
  17659. }
  17660. })(egret_h5_graphics || (egret_h5_graphics = {}));
  17661. egret_h5_graphics.init();
  17662. __extends = this.__extends || function(c, e) {
  17663. function d() {
  17664. this.constructor = c
  17665. }
  17666. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  17667. d.prototype = e.prototype;
  17668. c.prototype = new d
  17669. };
  17670. (function(c) {
  17671. var e = function(d) {
  17672. function a() {
  17673. d.call(this)
  17674. }
  17675. __extends(a, d);
  17676. a.prototype.proceed = function(a) {
  17677. function d(e) {
  17678. c.IOErrorEvent.dispatchIOErrorEvent(a)
  17679. }
  17680. function e(d) {
  17681. switch (this.dataFormat) {
  17682. case c.URLLoaderDataFormat.TEXT:
  17683. a.data = f.responseText;
  17684. break;
  17685. case c.URLLoaderDataFormat.VARIABLES:
  17686. a.data = new c.URLVariables(f.responseText);
  17687. break;
  17688. case c.URLLoaderDataFormat.BINARY:
  17689. a.data = f.response;
  17690. break;
  17691. default:
  17692. a.data = f.responseText
  17693. }
  17694. c.callLater(c.Event.dispatchEvent, c.Event, a, c.Event.COMPLETE)
  17695. }
  17696. if (a.dataFormat ==
  17697. c.URLLoaderDataFormat.TEXTURE) this.loadTexture(a);
  17698. else if (a.dataFormat == c.URLLoaderDataFormat.SOUND) this.loadSound(a);
  17699. else {
  17700. var m = a._request,
  17701. f = this.getXHR();
  17702. f.onerror = d;
  17703. f.onload = e;
  17704. f.open(m.method, m.url, !0);
  17705. this.setResponseType(f, a.dataFormat);
  17706. m.method != c.URLRequestMethod.GET && m.data ? m.data instanceof c.URLVariables ? (f.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"), f.send(m.data.toString())) : (f.setRequestHeader("Content-Type", "multipart/form-data"), f.send(m.data)) : f.send()
  17707. }
  17708. };
  17709. a.prototype.loadSound =
  17710. function(a) {
  17711. function d(f) {
  17712. m.removeEventListener("canplaythrough", d, !1);
  17713. m.removeEventListener("error", e, !1);
  17714. f = new c.Sound;
  17715. f.audio = m;
  17716. a.data = f;
  17717. c.callLater(c.Event.dispatchEvent, c.Event, a, c.Event.COMPLETE)
  17718. }
  17719. function e(f) {
  17720. m.removeEventListener("canplaythrough", d, !1);
  17721. m.removeEventListener("error", e, !1);
  17722. c.IOErrorEvent.dispatchIOErrorEvent(a)
  17723. }
  17724. var m = new Audio(a._request.url);
  17725. m.addEventListener("canplaythrough", d, !1);
  17726. m.addEventListener("error", e, !1);
  17727. m.load()
  17728. };
  17729. a.prototype.getXHR = function() {
  17730. return window.XMLHttpRequest ?
  17731. new window.XMLHttpRequest : new ActiveXObject("MSXML2.XMLHTTP")
  17732. };
  17733. a.prototype.setResponseType = function(a, d) {
  17734. switch (d) {
  17735. case c.URLLoaderDataFormat.TEXT:
  17736. case c.URLLoaderDataFormat.VARIABLES:
  17737. a.responseType = c.URLLoaderDataFormat.TEXT;
  17738. break;
  17739. case c.URLLoaderDataFormat.BINARY:
  17740. a.responseType = "arraybuffer";
  17741. break;
  17742. default:
  17743. a.responseType = d
  17744. }
  17745. };
  17746. a.prototype.loadTexture = function(a) {
  17747. var d = a._request,
  17748. e = new Image;
  17749. e.crossOrigin = "Anonymous";
  17750. e.onload = function(d) {
  17751. e.onerror = null;
  17752. e.onload = null;
  17753. d = new c.Texture;
  17754. d._setBitmapData(e);
  17755. a.data = d;
  17756. c.callLater(c.Event.dispatchEvent, c.Event, a, c.Event.COMPLETE)
  17757. };
  17758. e.onerror = function(d) {
  17759. e.onerror = null;
  17760. e.onload = null;
  17761. c.IOErrorEvent.dispatchIOErrorEvent(a)
  17762. };
  17763. e.src = d.url
  17764. };
  17765. return a
  17766. }(c.NetContext);
  17767. c.HTML5NetContext = e
  17768. })(egret || (egret = {}));
  17769. __extends = this.__extends || function(c, e) {
  17770. function d() {
  17771. this.constructor = c
  17772. }
  17773. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  17774. d.prototype = e.prototype;
  17775. c.prototype = new d
  17776. };
  17777. (function(c) {
  17778. var e = function(d) {
  17779. function a(a) {
  17780. d.call(this);
  17781. this.canvas = a;
  17782. this._isTouchDown = !1
  17783. }
  17784. __extends(a, d);
  17785. a.prototype.run = function() {
  17786. var a = this;
  17787. "ontouchstart" in window ? (this.canvas.addEventListener("touchstart", function(c) {
  17788. for (var d = c.changedTouches.length, e = 0; e < d && e < a.maxTouches; e++) a._onTouchBegin(c.changedTouches[e]);
  17789. c.stopPropagation();
  17790. c.preventDefault()
  17791. }, !1), this.canvas.addEventListener("touchmove", function(c) {
  17792. for (var d = c.changedTouches.length, e = 0; e < d && e < a.maxTouches; e++) a._onTouchMove(c.changedTouches[e]);
  17793. c.stopPropagation();
  17794. c.preventDefault()
  17795. }, !1), this.canvas.addEventListener("touchend", function(c) {
  17796. for (var d = c.changedTouches.length, e = 0; e < d && e < a.maxTouches; e++) a._onTouchEnd(c.changedTouches[e]);
  17797. c.stopPropagation();
  17798. c.preventDefault()
  17799. }, !1), this.canvas.addEventListener("touchcancel", function(c) {
  17800. for (var d = c.changedTouches.length, e = 0; e < d && e < a.maxTouches; e++) a._onTouchEnd(c.changedTouches[e]);
  17801. c.stopPropagation();
  17802. c.preventDefault()
  17803. }, !1)) : window.navigator.msPointerEnabled ? (this.canvas.addEventListener("MSPointerDown",
  17804. function(c) {
  17805. a._onTouchBegin(c);
  17806. c.stopPropagation();
  17807. c.preventDefault()
  17808. }, !1), this.canvas.addEventListener("MSPointerMove", function(c) {
  17809. a._onTouchMove(c);
  17810. c.stopPropagation();
  17811. c.preventDefault()
  17812. }, !1), this.canvas.addEventListener("MSPointerUp", function(c) {
  17813. a._onTouchEnd(c);
  17814. c.stopPropagation();
  17815. c.preventDefault()
  17816. }, !1)) : (this.canvas.addEventListener("mousedown", function(c) {
  17817. a._onTouchBegin(c)
  17818. }), this.canvas.addEventListener("mousemove", function(c) {
  17819. a._onTouchMove(c)
  17820. }), this.canvas.addEventListener("mouseup", function(c) {
  17821. a._onTouchEnd(c)
  17822. }));
  17823. window.addEventListener("mousedown", function(c) {
  17824. a.inOutOfCanvas(c) ? a.dispatchLeaveStageEvent() : a._isTouchDown = !0
  17825. });
  17826. window.addEventListener("mouseup", function(c) {
  17827. a._isTouchDown && a.inOutOfCanvas(c) && a.dispatchLeaveStageEvent();
  17828. a._isTouchDown = !1
  17829. })
  17830. };
  17831. a.prototype.inOutOfCanvas = function(a) {
  17832. a = this.getLocation(this.canvas, a);
  17833. return 0 > a.x || 0 > a.y || a.x > this.canvas.width || a.y > this.canvas.height ? !0 : !1
  17834. };
  17835. a.prototype.dispatchLeaveStageEvent = function() {
  17836. c.MainContext.instance.stage.dispatchEventWith(c.Event.LEAVE_STAGE)
  17837. };
  17838. a.prototype._onTouchBegin = function(a) {
  17839. var c = this.getLocation(this.canvas, a),
  17840. d = -1;
  17841. a.hasOwnProperty("identifier") && (d = a.identifier);
  17842. this.onTouchBegan(c.x, c.y, d)
  17843. };
  17844. a.prototype._onTouchMove = function(a) {
  17845. var c = this.getLocation(this.canvas, a),
  17846. d = -1;
  17847. a.hasOwnProperty("identifier") && (d = a.identifier);
  17848. this.onTouchMove(c.x, c.y, d)
  17849. };
  17850. a.prototype._onTouchEnd = function(a) {
  17851. var c = this.getLocation(this.canvas, a),
  17852. d = -1;
  17853. a.hasOwnProperty("identifier") && (d = a.identifier);
  17854. this.onTouchEnd(c.x, c.y, d)
  17855. };
  17856. a.prototype.getLocation = function(a,
  17857. d) {
  17858. var e = document.documentElement,
  17859. m = window,
  17860. f, g;
  17861. "function" === typeof a.getBoundingClientRect ? (g = a.getBoundingClientRect(), f = g.left, g = g.top) : g = f = 0;
  17862. f += m.pageXOffset - e.clientLeft;
  17863. g += m.pageYOffset - e.clientTop;
  17864. null != d.pageX ? (e = d.pageX, m = d.pageY) : (f -= document.body.scrollLeft, g -= document.body.scrollTop, e = d.clientX, m = d.clientY);
  17865. var k = c.Point.identity;
  17866. k.x = (e - f) / c.StageDelegate.getInstance().getScaleX();
  17867. k.y = (m - g) / c.StageDelegate.getInstance().getScaleY();
  17868. return k
  17869. };
  17870. return a
  17871. }(c.TouchContext);
  17872. c.HTML5TouchContext =
  17873. e
  17874. })(egret || (egret = {}));
  17875. __extends = this.__extends || function(c, e) {
  17876. function d() {
  17877. this.constructor = c
  17878. }
  17879. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  17880. d.prototype = e.prototype;
  17881. c.prototype = new d
  17882. };
  17883. (function(c) {
  17884. var e = function(d) {
  17885. function a() {
  17886. d.call(this);
  17887. this._isSupportDOMParser = this._xmlDict = this._parser = null;
  17888. this._xmlDict = {};
  17889. window.DOMParser ? (this._isSupportDOMParser = !0, this._parser = new DOMParser) : this._isSupportDOMParser = !1
  17890. }
  17891. __extends(a, d);
  17892. a.getInstance = function() {
  17893. a._instance || (a._instance = new a);
  17894. return a._instance
  17895. };
  17896. a.prototype.parserXML = function(a) {
  17897. for (var d = 0;
  17898. "\n" == a.charAt(d) || "\t" == a.charAt(d) || "\r" == a.charAt(d) || " " == a.charAt(d);) d++;
  17899. 0 != d && (a = a.substring(d, a.length));
  17900. this._isSupportDOMParser ?
  17901. d = this._parser.parseFromString(a, "text/xml") : (d = new ActiveXObject("Microsoft.XMLDOM"), d.async = "false", d.loadXML(a));
  17902. null == d && c.Logger.info("xml not found!");
  17903. return d
  17904. };
  17905. a._instance = null;
  17906. return a
  17907. }(c.HashObject);
  17908. c.SAXParser = e
  17909. })(egret || (egret = {}));
  17910. var __extends = this.__extends || function(c, e) {
  17911. function d() {
  17912. this.constructor = c
  17913. }
  17914. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  17915. d.prototype = e.prototype;
  17916. c.prototype = new d
  17917. },
  17918. catgame;
  17919. (function(c) {
  17920. var e = function(c) {
  17921. function a(a, e) {
  17922. var l = RES.getRes("pot1");
  17923. this.posx = a;
  17924. this.posy = e;
  17925. c.call(this, l);
  17926. this.anchorX = this.anchorY = 0.5;
  17927. this.fill = !1
  17928. }
  17929. __extends(a, c);
  17930. a.prototype.doFillPot = function() {
  17931. this.texture = RES.getRes("pot2");
  17932. this.fill = !0
  17933. };
  17934. a.prototype.clean = function() {
  17935. this.prenode = null
  17936. };
  17937. a.prototype.getPos = function() {
  17938. return [this.posx, this.posy]
  17939. };
  17940. a.prototype.isFill = function() {
  17941. return this.fill
  17942. };
  17943. return a
  17944. }(egret.Bitmap);
  17945. c.Node = e
  17946. })(catgame || (catgame = {}));
  17947. (function(c) {
  17948. var e = function() {
  17949. function c() {}
  17950. c.hitTest = function(a, b) {
  17951. var c = a.getBounds(),
  17952. d = b.getBounds();
  17953. c.x = a.x;
  17954. c.y = a.y;
  17955. d.x = b.x;
  17956. d.y = b.y;
  17957. return c.intersects(d)
  17958. };
  17959. return c
  17960. }();
  17961. c.GameUtil = e;
  17962. c.createBitmapByName = function(c) {
  17963. var a = new egret.Bitmap;
  17964. c = RES.getRes(c);
  17965. a.texture = c;
  17966. return a
  17967. }
  17968. })(catgame || (catgame = {}));
  17969. __extends = this.__extends || function(c, e) {
  17970. function d() {
  17971. this.constructor = c
  17972. }
  17973. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  17974. d.prototype = e.prototype;
  17975. c.prototype = new d
  17976. };
  17977. (function(c) {
  17978. var e = function(c) {
  17979. function a() {
  17980. c.call(this);
  17981. this.isWeizhu = !1;
  17982. var a = RES.getRes("stay_json"),
  17983. e = RES.getRes("stay_png");
  17984. this.standmc = new egret.MovieClip(a, e);
  17985. this.standmc.setInterval(3);
  17986. this.standmc.gotoAndPlay("stay");
  17987. a = RES.getRes("weizhu_json");
  17988. e = RES.getRes("weizhu_png");
  17989. this.weizhumc = new egret.MovieClip(a, e);
  17990. this.weizhumc.setInterval(3);
  17991. this.weizhumc.gotoAndPlay("weizhu");
  17992. this.anchorX = 0.5;
  17993. this.anchorY = 1;
  17994. this.stay()
  17995. }
  17996. __extends(a, c);
  17997. a.prototype.init = function() {
  17998. this.isWeizhu = !1;
  17999. this.stay()
  18000. };
  18001. a.prototype.run = function(a) {
  18002. this.x = a[0];
  18003. this.y = a[1];
  18004. this.dispatchEventWith("catRun")
  18005. };
  18006. a.prototype.stay = function() {
  18007. this.numChildren && this.removeChildAt(0);
  18008. this.isWeizhu ? this.addChild(this.weizhumc) : this.addChild(this.standmc)
  18009. };
  18010. a.prototype.weizhu = function() {
  18011. this.isWeizhu = !0;
  18012. this.stay()
  18013. };
  18014. a.prototype.successShow = function() {};
  18015. a.prototype.failShow = function() {};
  18016. return a
  18017. }(egret.Sprite);
  18018. c.Cat = e
  18019. })(catgame || (catgame = {}));
  18020. __extends = this.__extends || function(c, e) {
  18021. function d() {
  18022. this.constructor = c
  18023. }
  18024. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  18025. d.prototype = e.prototype;
  18026. c.prototype = new d
  18027. };
  18028. (function(c) {
  18029. var e = function(c) {
  18030. function a() {
  18031. c.call(this);
  18032. var a = this.createBitmapByName("failed_bg");
  18033. this.tap_textfeild = new egret.TextField;
  18034. this.tap_textfeild.width = 400;
  18035. this.tap_textfeild.textColor = 16711680;
  18036. this.tap_textfeild.textAlign = egret.HorizontalAlign.CENTER;
  18037. this.tap_textfeild.text = "\u4f60\u6ca1\u6709\u6293\u4f4f\u795e\uff01\u7ecf\uff01\u732b\uff01\uff01";
  18038. this.tap_textfeild.size = 22;
  18039. this.tap_textfeild.x = 20;
  18040. this.tap_textfeild.y = 190;
  18041. this.rank_textfeild = new egret.TextField;
  18042. this.rank_textfeild.width =
  18043. 400;
  18044. this.rank_textfeild.textColor = 16777215;
  18045. this.rank_textfeild.textAlign = egret.HorizontalAlign.CENTER;
  18046. this.rank_textfeild.text = "\u7cbe\u795e\u75c5\u9662\u957f\u53c8\u53d1\u795e\u7ecf\u75c5\u4e86\uff01";
  18047. this.rank_textfeild.size = 22;
  18048. this.rank_textfeild.strokeColor = 0;
  18049. this.rank_textfeild.stroke = 2;
  18050. this.rank_textfeild.x = 20;
  18051. this.rank_textfeild.y = 230;
  18052. this.share_btn = this.createBitmapByName("share_btn");
  18053. this.share_btn.x = 10;
  18054. this.share_btn.y = a.height + 20;
  18055. this.share_btn.touchEnabled = !0;
  18056. this.share_btn.addEventListener(egret.TouchEvent.TOUCH_TAP,
  18057. this.doShare, this);
  18058. this.replay_btn = this.createBitmapByName("replay_btn");
  18059. this.replay_btn.x = 220;
  18060. this.replay_btn.y = a.height + 20;
  18061. this.replay_btn.touchEnabled = !0;
  18062. this.replay_btn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.doRepaly, this);
  18063. this.addChild(a);
  18064. this.addChild(this.tap_textfeild);
  18065. this.addChild(this.rank_textfeild);
  18066. this.addChild(this.share_btn);
  18067. this.addChild(this.replay_btn)
  18068. }
  18069. __extends(a, c);
  18070. a.prototype.score = function(a) {
  18071. this.tap_textfeild.text = "\u60a8\u7528" + a + "\u6b65\u90fd\u6ca1\u6709\u6293\u4f4f\u795e\u7ecf\u732b"
  18072. };
  18073. a.prototype.doShare = function(a) {
  18074. this.dispatchEventWith("shareEvent")
  18075. };
  18076. a.prototype.doRepaly = function(a) {
  18077. this.dispatchEventWith("replayEvent")
  18078. };
  18079. a.prototype.createBitmapByName = function(a) {
  18080. var c = new egret.Bitmap;
  18081. a = RES.getRes(a);
  18082. c.texture = a;
  18083. return c
  18084. };
  18085. return a
  18086. }(egret.Sprite);
  18087. c.FailPanel = e
  18088. })(catgame || (catgame = {}));
  18089. __extends = this.__extends || function(c, e) {
  18090. function d() {
  18091. this.constructor = c
  18092. }
  18093. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  18094. d.prototype = e.prototype;
  18095. c.prototype = new d
  18096. };
  18097. (function(c) {
  18098. var e = function(d) {
  18099. function a() {
  18100. d.call(this);
  18101. this.map = [];
  18102. this.mapsize = 9;
  18103. this.playTurn = !0;
  18104. this.block = 0.2;
  18105. this.tap = 0;
  18106. this.addEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this)
  18107. }
  18108. __extends(a, d);
  18109. a.prototype.onAddToStage = function(a) {
  18110. this.removeEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this)
  18111. };
  18112. a.prototype.init = function() {
  18113. for (; this.numChildren;) this.removeChildAt(0);
  18114. this.map = [];
  18115. this.createMap();
  18116. this.tap = 0
  18117. };
  18118. a.prototype.createMap = function() {
  18119. for (var a, d = 0; d < this.mapsize; d++) {
  18120. this.map[d] = [];
  18121. for (var e = 0; e < this.mapsize; e++) {
  18122. a = new c.Node(d, e);
  18123. a.x = 48 * d + e % 2 * 24;
  18124. a.y = 44 * e;
  18125. this.map[d][e] = a;
  18126. a.touchEnabled = !0;
  18127. a.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onNodeClick, this);
  18128. this.addChild(a);
  18129. var m = (this.mapsize - 1) / 2;
  18130. d != m && e != m && Math.random() < this.block && (a.doFillPot(), a.touchEnabled = !1)
  18131. }
  18132. }
  18133. };
  18134. a.prototype.lock = function() {
  18135. this.playTurn = !1
  18136. };
  18137. a.prototype.unlock = function() {
  18138. this.playTurn = !0
  18139. };
  18140. a.prototype.getNode = function(a) {
  18141. return this.map[a[0]][a[1]]
  18142. };
  18143. a.prototype.onNodeClick = function(a) {
  18144. this.playTurn &&
  18145. (this.tap += 1, a = a.target, a.doFillPot(), a.touchEnabled = !1, a.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onNodeClick, this), this.dispatchEventWith("nodeClick"))
  18146. };
  18147. a.prototype.showRound = function(a) {
  18148. var c = a.getPos();
  18149. a = this.getRound(c);
  18150. for (var d = a.length, e, f = 0; f < this.mapsize; f++)
  18151. for (var g = 0; g < this.mapsize; g++)
  18152. if (f != c[0] || g != c[1]) e = this.map[f][g], e.clean();
  18153. for (f = 0; f < d; f++) c = a[f], e = this.map[c[0]][c[1]], e.doFillPot()
  18154. };
  18155. a.prototype.coverPos2Point = function(a) {
  18156. return [this.x + 48 * a[0] + a[1] % 2 * 24, this.y + 44 * a[1]]
  18157. };
  18158. a.prototype.getRound = function(a) {
  18159. var c = a[0],
  18160. d = a[1];
  18161. a = [];
  18162. c = 0 == d % 2 ? [
  18163. [c - 1, d - 1],
  18164. [c - 1, d],
  18165. [c - 1, d + 1],
  18166. [c, d + 1],
  18167. [c + 1, d],
  18168. [c, d - 1]
  18169. ] : [
  18170. [c, d - 1],
  18171. [c - 1, d],
  18172. [c, d + 1],
  18173. [c + 1, d + 1],
  18174. [c + 1, d],
  18175. [c + 1, d - 1]
  18176. ];
  18177. for (d = 0; 6 > d; d++) {
  18178. var e = c[d];
  18179. 0 <= e[0] && 0 <= e[1] && e[0] < this.mapsize && e[1] < this.mapsize && a.push(e)
  18180. }
  18181. return a
  18182. };
  18183. a.prototype.findPath = function(a) {
  18184. for (var c, d = 0; d < this.mapsize; d++)
  18185. for (var e = 0; e < this.mapsize; e++) c = this.map[d][e], c.clean();
  18186. c = this.findNode(a);
  18187. d = [];
  18188. if (c)
  18189. for (; c.prenode;) d.push(c.getPos()), c = c.prenode;
  18190. else console.log("\u5df2\u7ecf\u88ab\u56f0\u968f\u4fbf\u8d70\u4e00\u6b65"),
  18191. this.dispatchEventWith("weizhu"), d = this.getNear(a);
  18192. return d.reverse()
  18193. };
  18194. a.prototype.randomSort = function(a, c) {
  18195. return 0.5 < Math.random() ? 1 : -1
  18196. };
  18197. a.prototype.findNode = function(a) {
  18198. var c = [a];
  18199. a = [a];
  18200. for (var d, e = 0, f = 0, g = 0, k = 0, n, p;;) {
  18201. f = a.length;
  18202. if (0 == f) return null;
  18203. for (var q = [], e = 0; e < f; e++) {
  18204. n = a.shift();
  18205. d = this.getRound(n.getPos());
  18206. k = d.length;
  18207. for (g = 0; g < k; g++)
  18208. if (p = d[g], p = this.map[p[0]][p[1]], p.isFill()) c.push(p);
  18209. else if (!(-1 < c.indexOf(p) || -1 < a.indexOf(p))) {
  18210. p.prenode = n;
  18211. if (this.isExit(p)) return p;
  18212. q.push(p)
  18213. }
  18214. c.push(n)
  18215. }
  18216. a =
  18217. q
  18218. }
  18219. };
  18220. a.prototype.getNear = function(a) {
  18221. a = a.getPos();
  18222. a = this.getRound(a);
  18223. for (var c = a.length, d = 0; d < c; d++)
  18224. if (!this.getNode(a[d]).isFill()) return [a[d]];
  18225. return []
  18226. };
  18227. a.prototype.isExit = function(a) {
  18228. a = a.getPos();
  18229. return 0 == a[0] || 0 == a[1] || a[0] == this.mapsize - 1 || a[1] == this.mapsize - 1 ? !0 : !1
  18230. };
  18231. return a
  18232. }(egret.DisplayObjectContainer);
  18233. c.Map = e
  18234. })(catgame || (catgame = {}));
  18235. __extends = this.__extends || function(c, e) {
  18236. function d() {
  18237. this.constructor = c
  18238. }
  18239. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  18240. d.prototype = e.prototype;
  18241. c.prototype = new d
  18242. };
  18243. (function(c) {
  18244. var e = function(c) {
  18245. function a() {
  18246. c.call(this);
  18247. var a = this.graphics;
  18248. a.beginFill(0, 0.8);
  18249. a.drawRect(0, 0, 400, 200);
  18250. a.endFill();
  18251. this.txt = new egret.TextField;
  18252. this.txt.width = 400;
  18253. this.txt.height = 200;
  18254. this.txt.textAlign = "center";
  18255. this.txt.textColor = 16777215;
  18256. this.txt.size = 24;
  18257. this.txt.y = 60;
  18258. this.addChild(this.txt)
  18259. }
  18260. __extends(a, c);
  18261. a.prototype.showScore = function(a) {
  18262. this.txt.text = a + "\n\u518d\u6765\u4e00\u6b21\u5427"
  18263. };
  18264. return a
  18265. }(egret.Sprite);
  18266. c.ScorePanel = e
  18267. })(catgame || (catgame = {}));
  18268. __extends = this.__extends || function(c, e) {
  18269. function d() {
  18270. this.constructor = c
  18271. }
  18272. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  18273. d.prototype = e.prototype;
  18274. c.prototype = new d
  18275. };
  18276. (function(c) {
  18277. var e = function(c) {
  18278. function a() {
  18279. c.call(this);
  18280. this.titles_arr = "\u585e\u5916\u9ad8\u624b \u795e\u7cbe\u75c5\u535a\u58eb \u795e\u7ecf\u5927\u795e \u4f60\u662f\u6211\u7684\u5c0f\u82f9\u679c \u9662\u957f\u6d3e\u6765\u7684\u6551\u5175 \u7cbe\u795e\u75c5\u9662\u957f \u626b\u5730\u50e7 \u4f20\u8bf4\u4e2d\u7684\u9ad8\u624b \u98ce\u9a9a\u7684\u5c11\u5e74 \u767d\u5929\u7761\u89c9\u55b5 \u9694\u58c1\u738b\u4f2f\u4f2f".split(" ");
  18281. this.titles2_arr = "\u795e\u7ecf\u5927\u6761 \u6211\u662f\u5904\u5973\u5ea7\u7684 \u505c\u4e0d\u4e0b\u6765 \u4f60\u662f\u6211\u7684\u5c0f\u82f9\u679c \u55b5\u4e86\u4e2a\u54aa\u7684 M78\u661f\u4eba \u51e4\u59d0\u592b \u7b11\u800c\u4e0d\u8bed".split(" ");
  18282. var a = this.createBitmapByName("victory_bg");
  18283. this.tap_textfeild = new egret.TextField;
  18284. this.tap_textfeild.width = 400;
  18285. this.tap_textfeild.textColor = 16711680;
  18286. this.tap_textfeild.textAlign = egret.HorizontalAlign.CENTER;
  18287. this.tap_textfeild.text = "\u60a8\u752813\u6b65\u6293\u4f4f\u4e86\u795e\u7ecf\u732b";
  18288. this.tap_textfeild.size = 22;
  18289. this.tap_textfeild.x = 20;
  18290. this.tap_textfeild.y = 150;
  18291. this.rank_textfeild = new egret.TextField;
  18292. this.rank_textfeild.width = 400;
  18293. this.rank_textfeild.textColor = 16777215;
  18294. this.rank_textfeild.textAlign =
  18295. egret.HorizontalAlign.CENTER;
  18296. this.rank_textfeild.text = "\u795e\u7ecf\u5168\u56fd\u6392\u540d421\u4f4d";
  18297. this.rank_textfeild.size = 22;
  18298. this.rank_textfeild.strokeColor = 0;
  18299. this.rank_textfeild.stroke = 2;
  18300. this.rank_textfeild.x = 20;
  18301. this.rank_textfeild.y = 190;
  18302. this.beat_textfeild = new egret.TextField;
  18303. this.beat_textfeild.width = 400;
  18304. this.beat_textfeild.textColor = 16711680;
  18305. this.beat_textfeild.textAlign = egret.HorizontalAlign.CENTER;
  18306. this.beat_textfeild.size = 22;
  18307. this.beat_textfeild.text = "\u51fb\u8d25\u4e86\u7cbe\u795e\u75c5\u966280%\u7684\u7cbe\u795e\u75c5\u60a3\u8005";
  18308. this.beat_textfeild.x = 20;
  18309. this.beat_textfeild.y = 230;
  18310. this.title_textfeild = new egret.TextField;
  18311. this.title_textfeild.width = 400;
  18312. this.title_textfeild.textColor = 16711680;
  18313. this.title_textfeild.textAlign = egret.HorizontalAlign.CENTER;
  18314. this.title_textfeild.size = 24;
  18315. this.title_textfeild.text = "\u83b7\u5f97\u79f0\u53f7\uff1a\u601d\u7ef4\u5e7f";
  18316. this.title_textfeild.x = 20;
  18317. this.title_textfeild.y = 270;
  18318. this.share_btn = this.createBitmapByName("share_btn");
  18319. this.share_btn.x = 10;
  18320. this.share_btn.y = a.height + 20;
  18321. this.share_btn.touchEnabled = !0;
  18322. this.share_btn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.doShare, this);
  18323. this.replay_btn = this.createBitmapByName("replay_btn");
  18324. this.replay_btn.x = 220;
  18325. this.replay_btn.y = a.height + 20;
  18326. this.replay_btn.touchEnabled = !0;
  18327. this.replay_btn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.doRepaly, this);
  18328. this.addChild(a);
  18329. this.addChild(this.tap_textfeild);
  18330. this.addChild(this.rank_textfeild);
  18331. this.addChild(this.beat_textfeild);
  18332. this.addChild(this.title_textfeild);
  18333. this.addChild(this.share_btn);
  18334. this.addChild(this.replay_btn)
  18335. }
  18336. __extends(a, c);
  18337. a.prototype.score = function(a) {
  18338. this.tap_textfeild.text = "\u60a8\u7528" + a + "\u6b65\u6293\u4f4f\u4e86\u795e\u7ecf\u732b";
  18339. this.rank_textfeild.text = "\u795e\u7ecf\u5168\u56fd\u6392\u540d" + Math.floor(100 * a + Math.random() * a * 5) + "\u4f4d";
  18340. this.beat_textfeild.text = "\u51fb\u8d25\u4e86\u7cbe\u795e\u75c5\u9662" + (100 - Math.floor(a * Math.random())) + "%\u7684\u7cbe\u795e\u75c5\u60a3\u8005";
  18341. a = 11 > a ? this.titles_arr[a] : this.titles2_arr[Math.floor(Math.random() * this.titles2_arr.length)];
  18342. this.title_textfeild.text =
  18343. "\u83b7\u5f97\u79f0\u53f7\uff1a" + a
  18344. };
  18345. a.prototype.doShare = function(a) {
  18346. this.dispatchEventWith("shareEvent")
  18347. };
  18348. a.prototype.doRepaly = function(a) {
  18349. this.dispatchEventWith("replayEvent")
  18350. };
  18351. a.prototype.createBitmapByName = function(a) {
  18352. var c = new egret.Bitmap;
  18353. a = RES.getRes(a);
  18354. c.texture = a;
  18355. return c
  18356. };
  18357. return a
  18358. }(egret.Sprite);
  18359. c.SuccessPanel = e
  18360. })(catgame || (catgame = {}));
  18361. var __extends = this.__extends || function(c, e) {
  18362. function d() {
  18363. this.constructor = c
  18364. }
  18365. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  18366. d.prototype = e.prototype;
  18367. c.prototype = new d
  18368. },
  18369. LoadingUI = function(c) {
  18370. function e() {
  18371. c.call(this);
  18372. this.createView()
  18373. }
  18374. __extends(e, c);
  18375. e.prototype.createView = function() {
  18376. this.textField = new egret.TextField;
  18377. this.addChild(this.textField);
  18378. this.textField.y = 300;
  18379. this.textField.width = 480;
  18380. this.textField.height = 100;
  18381. this.textField.textAlign = "center"
  18382. };
  18383. e.prototype.setProgress = function(c, a) {
  18384. this.textField.text =
  18385. "\u6e38\u620f\u52a0\u8f7d\u4e2d..." + c + "/" + a
  18386. };
  18387. return e
  18388. }(egret.Sprite),
  18389. __extends = this.__extends || function(c, e) {
  18390. function d() {
  18391. this.constructor = c
  18392. }
  18393. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  18394. d.prototype = e.prototype;
  18395. c.prototype = new d
  18396. };
  18397. (function(c) {
  18398. var e = function(d) {
  18399. function a() {
  18400. d.call(this);
  18401. this.isWin = 0;
  18402. this.addEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this)
  18403. }
  18404. __extends(a, d);
  18405. a.prototype.onAddToStage = function(a) {
  18406. this.removeEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this);
  18407. this.createGameScene()
  18408. };
  18409. a.prototype.createGameScene = function() {
  18410. this.stageW = this.stage.stageWidth;
  18411. this.stageH = this.stage.stageHeight;
  18412. this.map = new c.Map;
  18413. this.map.init();
  18414. this.map.x = 35;
  18415. this.map.y = this.stageH - 440;
  18416. this.addChild(this.map);
  18417. this.cat = new c.Cat;
  18418. this.map.addEventListener("nodeClick", this.onNodeClick, this);
  18419. this.map.addEventListener("weizhu", this.onWeiZhu, this);
  18420. this.cat.addEventListener("catRun", this.onCatRun, this);
  18421. this.btnStart = this.createBitmapByName("btnStart");
  18422. this.btnStart.x = (this.stageW - this.btnStart.width) / 2;
  18423. this.btnStart.y = (this.stageH - this.btnStart.height) / 2;
  18424. this.btnStart.touchEnabled = !0;
  18425. this.btnStart.addEventListener(egret.TouchEvent.TOUCH_TAP, this.gameStart, this);
  18426. this.addChild(this.btnStart);
  18427. this.morebtn = this.createBitmapByName("more_btn");
  18428. this.morebtn.x = (this.stageW - this.morebtn.width) / 2;
  18429. this.morebtn.y = this.stageH - this.morebtn.height;
  18430. this.morebtn.touchEnabled = !0;
  18431. this.morebtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.doMore, this);
  18432. this.scorePanel = new c.ScorePanel;
  18433. this.successPanel = new c.SuccessPanel;
  18434. this.successPanel.addEventListener("shareEvent", this.doShare, this);
  18435. this.successPanel.addEventListener("replayEvent", this.doRestart, this);
  18436. this.failPanel = new c.FailPanel;
  18437. this.failPanel.addEventListener("shareEvent", this.doShare, this);
  18438. this.failPanel.addEventListener("replayEvent", this.doRestart, this)
  18439. };
  18440. a.prototype.onWeiZhu = function(a) {
  18441. this.cat.weizhu()
  18442. };
  18443. a.prototype.doShare = function(a) {
  18444. dp_share(this.map.tap, this.isWin)
  18445. };
  18446. a.prototype.doRestart = function(a) {
  18447. this.gameStart(null)
  18448. };
  18449. a.prototype.doMore = function(a) {
  18450. showme()
  18451. };
  18452. a.prototype.gameStart = function(a) {
  18453. this.map.init();
  18454. this.cat.init();
  18455. this.cat.node = this.map.getNode([4, 4]);
  18456. a = this.map.coverPos2Point([4, 4]);
  18457. this.cat.x = a[0];
  18458. this.cat.y = a[1] + 10;
  18459. this.addChild(this.cat);
  18460. this.btnStart.parent && this.removeChild(this.btnStart);
  18461. this.successPanel.parent && this.removeChild(this.successPanel);
  18462. this.failPanel.parent && this.removeChild(this.failPanel);
  18463. this.morebtn.parent && this.removeChild(this.morebtn);
  18464. this.map.unlock();
  18465. this.isWin = 0
  18466. };
  18467. a.prototype.onNodeClick = function(a) {
  18468. if (this.map.isExit(this.cat.node)) this.showResult(!1);
  18469. else if (this.map.lock(), a = this.map.findPath(this.cat.node), a.length) {
  18470. a = a[0];
  18471. var c = this.map.coverPos2Point(a);
  18472. this.cat.node = this.map.getNode(a);
  18473. this.cat.run(c)
  18474. } else this.showResult(!0)
  18475. };
  18476. a.prototype.onCatRun = function(a) {
  18477. this.map.unlock()
  18478. };
  18479. a.prototype.showResult = function(a) {
  18480. a ? (this.successPanel.x = (this.stageW - this.successPanel.width) / 2, this.successPanel.y = (this.stageH - this.successPanel.height - this.morebtn.height) / 2, this.successPanel.score(this.map.tap), this.addChild(this.successPanel), this.isWin = 1) : (this.failPanel.x = (this.stageW - this.failPanel.width) / 2, this.failPanel.y = (this.stageH - this.failPanel.height - this.morebtn.height) / 2, this.successPanel.score(this.map.tap), this.addChild(this.failPanel), this.isWin = 2);
  18481. this.addChild(this.morebtn)
  18482. };
  18483. a.prototype.createBitmapByName = function(a) {
  18484. var c = new egret.Bitmap;
  18485. a = RES.getRes(a);
  18486. c.texture = a;
  18487. return c
  18488. };
  18489. return a
  18490. }(egret.DisplayObjectContainer);
  18491. c.GameContainer = e
  18492. })(catgame || (catgame = {}));
  18493. var __extends = this.__extends || function(c, e) {
  18494. function d() {
  18495. this.constructor = c
  18496. }
  18497. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  18498. d.prototype = e.prototype;
  18499. c.prototype = new d
  18500. },
  18501. GameApp = function(c) {
  18502. function e() {
  18503. c.call(this);
  18504. this.addEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this)
  18505. }
  18506. __extends(e, c);
  18507. e.prototype.onAddToStage = function(c) {
  18508. this.loadingView = new LoadingUI;
  18509. this.stage.addChild(this.loadingView);
  18510. RES.addEventListener(RES.ResourceEvent.CONFIG_COMPLETE, this.onConfigComplete, this);
  18511. RES.loadConfig("static/json/resource.js",
  18512. "static/json/")
  18513. };
  18514. e.prototype.onConfigComplete = function(c) {
  18515. RES.removeEventListener(RES.ResourceEvent.CONFIG_COMPLETE, this.onConfigComplete, this);
  18516. RES.addEventListener(RES.ResourceEvent.GROUP_COMPLETE, this.onResourceLoadComplete, this);
  18517. RES.addEventListener(RES.ResourceEvent.GROUP_PROGRESS, this.onResourceProgress, this);
  18518. RES.loadGroup("preload")
  18519. };
  18520. e.prototype.onResourceLoadComplete = function(c) {
  18521. "preload" == c.groupName && (this.stage.removeChild(this.loadingView), RES.removeEventListener(RES.ResourceEvent.GROUP_COMPLETE,
  18522. this.onResourceLoadComplete, this), RES.removeEventListener(RES.ResourceEvent.GROUP_PROGRESS, this.onResourceProgress, this), this.createGameScene())
  18523. };
  18524. e.prototype.onResourceProgress = function(c) {
  18525. "preload" == c.groupName && this.loadingView.setProgress(c.itemsLoaded, c.itemsTotal)
  18526. };
  18527. e.prototype.createGameScene = function() {
  18528. var c = this.createBitmapByName("bgImage");
  18529. this.addChild(c);
  18530. var a = this.stage.stageHeight;
  18531. c.width = this.stage.stageWidth;
  18532. c.height = a;
  18533. c = new catgame.GameContainer;
  18534. this.addChild(c)
  18535. };
  18536. e.prototype.createBitmapByName =
  18537. function(c) {
  18538. var a = new egret.Bitmap;
  18539. c = RES.getRes(c);
  18540. a.texture = c;
  18541. return a
  18542. };
  18543. return e
  18544. }(egret.DisplayObjectContainer);